/******/ var __webpack_modules__ = ({

/***/ 5817:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

(function webpackUniversalModuleDefinition(root, factory) {
	if(true)
		module.exports = factory(__webpack_require__(73776), __webpack_require__(17159));
	else {}
})((typeof self !== "undefined" ? self : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : this), (__WEBPACK_EXTERNAL_MODULE_core_Misc_observable__, __WEBPACK_EXTERNAL_MODULE_gui_2D_controls_container__) => {
return /******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss":
/*!**********************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss ***!
  \**********************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_1804__) => {

"use strict";
__nested_webpack_require_1804__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1804__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1804__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1804__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1804__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1804__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.color-picker-container {
  width: 320px;
  height: 300px;
  background-color: white;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 50% 50px 60px 40px 1fr auto;
  font-family: "acumin-pro-condensed";
  font-weight: normal;
  font-size: 14px;
}
.color-picker-container.with-hints {
  height: 380px;
}
.color-picker-container .color-picker-saturation {
  grid-row: 1;
  grid-column: 1;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 100%;
  position: relative;
  cursor: pointer;
}
.color-picker-container .color-picker-saturation .color-picker-saturation-white {
  grid-row: 1;
  grid-column: 1;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
.color-picker-container .color-picker-saturation .color-picker-saturation-black {
  grid-row: 1;
  grid-column: 1;
  background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));
}
.color-picker-container .color-picker-saturation .color-picker-saturation-cursor {
  pointer-events: none;
  width: 4px;
  height: 4px;
  box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  transform: translate(-2px, -2px);
  position: absolute;
}
.color-picker-container .color-picker-hue {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  margin: 10px;
  grid-template-columns: 24% 76%;
  grid-template-rows: 100%;
}
.color-picker-container .color-picker-hue .color-picker-hue-color {
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  justify-self: center;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  border: 1px solid black;
}
.color-picker-container .color-picker-hue .color-picker-hue-slider {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  height: 16px;
  position: relative;
  cursor: pointer;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.color-picker-container .color-picker-hue .color-picker-hue-slider .color-picker-hue-cursor {
  pointer-events: none;
  width: 8px;
  height: 18px;
  transform: translate(-4px, -2px);
  background-color: rgb(248, 248, 248);
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
  position: absolute;
}
.color-picker-container .color-picker-component {
  display: grid;
  margin: 5px;
  grid-template-columns: 100%;
  grid-template-rows: 50% 50%;
}
.color-picker-container .color-picker-component .color-picker-component-value {
  justify-self: center;
  align-self: center;
  grid-row: 1;
  grid-column: 1;
  margin-bottom: 4px;
}
.color-picker-container .color-picker-component .color-picker-component-value input {
  width: 50px;
}
.color-picker-container .color-picker-component .color-picker-component-label {
  justify-self: center;
  align-self: center;
  grid-row: 2;
  grid-column: 1;
  color: black;
}
.color-picker-container .color-picker-rgb {
  grid-row: 3;
  grid-column: 1;
  display: grid;
  margin: 10px;
  grid-template-columns: 20% 6.66% 20% 6.66% 20% 6.66% 20%;
  grid-template-rows: 100%;
}
.color-picker-container .red {
  grid-row: 1;
  grid-column: 1;
}
.color-picker-container .green {
  grid-row: 1;
  grid-column: 3;
}
.color-picker-container .blue {
  grid-row: 1;
  grid-column: 5;
}
.color-picker-container .alpha {
  grid-row: 1;
  grid-column: 7;
}
.color-picker-container .alpha.grayed {
  opacity: 0.5;
}
.color-picker-container .color-picker-hex {
  grid-row: 4;
  grid-column: 1;
  display: grid;
  grid-template-columns: 20% 80%;
  grid-template-rows: 100%;
}
.color-picker-container .color-picker-hex .color-picker-hex-label {
  justify-self: center;
  align-self: center;
  grid-row: 1;
  grid-column: 1;
  margin-left: 10px;
  color: black;
}
.color-picker-container .color-picker-hex .color-picker-hex-value {
  justify-self: left;
  align-self: center;
  grid-row: 1;
  grid-column: 2;
  margin-left: 10px;
  margin-right: 10px;
}
.color-picker-container .color-picker-hex .color-picker-hex-value input {
  width: 70px;
}
.color-picker-container .color-picker-warning {
  color: black;
  font-size: 11px;
  padding: 4px;
  justify-self: left;
  align-self: center;
  grid-row: 6;
  grid-column: 1;
}`, "",{"version":3,"sources":["webpack://./../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss"],"names":[],"mappings":"AAAA;EACI,YAAA;EACA,aAAA;EACA,uBAAA;EACA,aAAA;EACA,2BAAA;EACA,+CAAA;EACA,mCAAA;EACA,mBAAA;EACA,eAAA;AACJ;AACI;EACI,aAAA;AACR;AAEI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,2BAAA;EACA,wBAAA;EACA,kBAAA;EACA,eAAA;AAAR;AAEQ;EACI,WAAA;EACA,cAAA;EAEA,mEAAA;AADZ;AAIQ;EACI,WAAA;EACA,cAAA;EAEA,2DAAA;AAHZ;AAMQ;EACI,oBAAA;EACA,UAAA;EACA,WAAA;EACA,kGACI;EAGJ,kBAAA;EACA,gCAAA;EACA,kBAAA;AAPZ;AAWI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,YAAA;EACA,8BAAA;EACA,wBAAA;AATR;AAWQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,oBAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,uBAAA;AATZ;AAYQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;EAEA,2GAAA;AAXZ;AAaY;EACI,oBAAA;EACA,UAAA;EACA,YAAA;EACA,gCAAA;EACA,oCAAA;EACA,2CAAA;EACA,kBAAA;AAXhB;AAgBI;EACI,aAAA;EACA,WAAA;EACA,2BAAA;EACA,2BAAA;AAdR;AAgBQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;AAdZ;AAgBY;EACI,WAAA;AAdhB;AAkBQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,YAAA;AAhBZ;AAoBI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,YAAA;EACA,wDAAA;EACA,wBAAA;AAlBR;AAqBI;EACI,WAAA;EACA,cAAA;AAnBR;AAsBI;EACI,WAAA;EACA,cAAA;AApBR;AAuBI;EACI,WAAA;EACA,cAAA;AArBR;AAwBI;EACI,WAAA;EACA,cAAA;AAtBR;AAwBQ;EACI,YAAA;AAtBZ;AA0BI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,8BAAA;EACA,wBAAA;AAxBR;AA0BQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,YAAA;AAxBZ;AA2BQ;EACI,kBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AAzBZ;AA2BY;EACI,WAAA;AAzBhB;AA8BI;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,kBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;AA5BR","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/log/log.scss":
/*!**********************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/log/log.scss ***!
  \**********************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_10079__) => {

"use strict";
__nested_webpack_require_10079__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_10079__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_10079__(/*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_10079__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_10079__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_10079__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#log-console {
  background: #333333;
  height: 120px;
  box-sizing: border-box;
  margin: 0;
  padding: 10px;
  width: 100%;
  overflow: hidden;
  overflow-y: auto;
}
#log-console .log {
  color: white;
  font-size: 14px;
  font-family: "Courier New", Courier, monospace;
}
#log-console .log.error {
  color: red;
}`, "",{"version":3,"sources":["webpack://./../../../tools/guiEditor/dist/components/log/log.scss"],"names":[],"mappings":"AAAA;EACI,mBAAA;EACA,aAAA;EACA,sBAAA;EACA,SAAA;EACA,aAAA;EACA,WAAA;EACA,gBAAA;EACA,gBAAA;AACJ;AACI;EACI,YAAA;EACA,eAAA;EACA,8CAAA;AACR;AACQ;EACI,UAAA;AACZ","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss":
/*!**************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss ***!
  \**************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_13278__) => {

"use strict";
__nested_webpack_require_13278__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_13278__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_13278__(/*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_13278__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_13278__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_13278__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `:root {
  --backgroundGrey: #aaaaaa;
  --spacingHeight: 30px;
  --button: #333333;
  --buttonBackground: #ffffff;
  --buttonDisabledBackground: #c8c8c8;
  --disabledBackground: #c8c8c8;
  --buttonPressed: #ffffff;
  --buttonPressedBackground: #606060;
  --buttonHoverBackground: #afafaf;
}

#ge-propertyTab {
  user-select: none;
  color: black;
  background: #e2e2e2;
}
#ge-propertyTab * {
  font-family: "acumin-pro-condensed", sans-serif;
  font-size: 12px;
}
#ge-propertyTab #header {
  height: 32px;
  font-size: 16px;
  color: white;
  background: white;
  grid-row: 1;
  text-align: center;
  display: grid;
  grid-template-columns: 30px 1fr;
  user-select: none;
}
#ge-propertyTab #header #logo {
  position: relative;
  grid-column: 1;
  width: 32px;
  height: 32px;
  left: 0;
  display: flex;
  align-self: center;
  justify-self: center;
  filter: invert(1);
}
#ge-propertyTab #header #title {
  background: white;
  color: black;
  grid-column: 2;
  display: grid;
  align-items: center;
  text-align: center;
}
#ge-propertyTab .copy {
  display: none;
}
#ge-propertyTab .range {
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  background: #bcbcbc;
  border-radius: 5px;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0;
}
#ge-propertyTab .range:hover {
  opacity: 1;
}
#ge-propertyTab .range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e2e2e2;
  border: solid;
  border-width: thin;
  cursor: pointer;
}
#ge-propertyTab .range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgb(0, 0, 0);
  cursor: pointer;
}
#ge-propertyTab input[type=color] {
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0;
  width: 30px;
  height: 20px;
}
#ge-propertyTab input[type=color]::-webkit-color-swatch-wrapper {
  padding: 0;
}
#ge-propertyTab input[type=color]::-webkit-color-swatch {
  border: none;
}
#ge-propertyTab hr {
  border: 1px solid #d0cece;
}
#ge-propertyTab .icon {
  width: 30px;
  height: 30px;
}
#ge-propertyTab .unit {
  width: 26px;
  height: 26px;
  color: var(--button);
  background-color: var(--buttonBackground);
  border: none;
  margin-top: 2px;
  cursor: pointer;
  margin-left: 2px;
  font-family: "atten-round-new", sans-serif;
  font-weight: 500;
  font-style: normal;
  display: flex;
  justify-content: center;
  align-items: center;
}
#ge-propertyTab .unit:disabled {
  background-color: var(--buttonDisabledBackground);
  cursor: not-allowed;
}
#ge-propertyTab .unit:not(:disabled):hover {
  background-color: var(--buttonHoverBackground);
}
#ge-propertyTab .unit:not(:disabled):active {
  color: var(--buttonPressed);
  background-color: var(--buttonPressedBackground);
}
#ge-propertyTab input,
#ge-propertyTab select {
  outline-style: solid;
  outline-width: 0px;
  outline-color: transparent;
  outline-offset: -1px;
  outline-width: 1px;
  transition: outline-color 0.2s;
  border: transparent;
  padding-left: 5px;
}
#ge-propertyTab input:focus,
#ge-propertyTab select:focus {
  outline-width: 1px;
  outline-color: black;
}
#ge-propertyTab .hasArrows input::-webkit-outer-spin-button,
#ge-propertyTab .hasArrows input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#ge-propertyTab .sliderLine {
  height: var(--spacingHeight);
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: auto 1fr 20px 1fr;
  flex-grow: 1;
}
#ge-propertyTab .sliderLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
  min-width: 15px;
  font-weight: 600;
}
#ge-propertyTab .sliderLine .img {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .sliderLine .slider {
  grid-column: 4;
  grid-row: 1;
  margin-right: 5px;
  display: flex;
  align-items: center;
  padding-left: 5px;
}
#ge-propertyTab .sliderLine .floatLine {
  grid-column: 2;
  padding-left: 0px;
  grid-template-columns: 1fr auto;
}
#ge-propertyTab .sliderLine .floatLine .label {
  grid-column: 1;
  display: none;
  align-items: center;
  font-weight: 600;
}
#ge-propertyTab .sliderLine .floatLine .short {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .sliderLine .floatLine .short input {
  width: 100%;
  background-color: white;
  height: 24px;
}
#ge-propertyTab .sliderLine .floatLine .short input::-webkit-outer-spin-button,
#ge-propertyTab .sliderLine .floatLine .short input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#ge-propertyTab .sliderLine .floatLine .short input[type=number] {
  -webkit-appearance: textfield;
  appearance: textfield;
}
#ge-propertyTab .sliderLine .floatLine .copy {
  display: none;
}
#ge-propertyTab .sliderLine .copy {
  display: none;
}
#ge-propertyTab .ge-divider {
  padding-right: 18px;
  padding-left: 5px;
  display: grid;
  grid-template-columns: auto 1fr;
  padding-top: 1px;
  padding-bottom: 1px;
}
#ge-propertyTab .ge-divider > .textLine + .command-button {
  margin-top: -3px;
  grid-column: 5;
}
#ge-propertyTab .ge-divider.double {
  display: grid;
  grid-template-columns: auto 1fr 5px 1fr;
}
#ge-propertyTab .ge-divider.double > .textInputLine:first-of-type,
#ge-propertyTab .ge-divider.double > .floatLine:first-of-type {
  grid-column: 2;
}
#ge-propertyTab .ge-divider.double > .textInputLine:nth-of-type(2),
#ge-propertyTab .ge-divider.double > .floatLine:nth-of-type(2) {
  grid-column: 4;
}
#ge-propertyTab .ge-divider.double > .command-button {
  grid-column: 5;
  margin-left: 5px;
}
#ge-propertyTab .ge-divider.quad {
  display: grid;
  grid-template-columns: 1fr 5px 1fr 5px 1fr 5px 1fr;
}
#ge-propertyTab .ge-divider.quad > .textInputLine:first-of-type,
#ge-propertyTab .ge-divider.quad > .floatLine:first-of-type {
  grid-column: 1;
}
#ge-propertyTab .ge-divider.quad > .textInputLine:nth-of-type(2),
#ge-propertyTab .ge-divider.quad > .floatLine:nth-of-type(2) {
  grid-column: 3;
}
#ge-propertyTab .ge-divider.quad > .textInputLine:nth-of-type(3),
#ge-propertyTab .ge-divider.quad > .floatLine:nth-of-type(3) {
  grid-column: 5;
}
#ge-propertyTab .ge-divider.quad > .textInputLine:nth-of-type(4),
#ge-propertyTab .ge-divider.quad > .floatLine:nth-of-type(4) {
  grid-column: 7;
}
#ge-propertyTab .ge-grid-divider {
  display: grid;
  grid-template-columns: 150px 1fr auto;
}
#ge-propertyTab .ge-grid-divider .textLine {
  grid-column: auto;
}
#ge-propertyTab .ge-grid-button-divider {
  display: grid;
  grid-template-columns: 60px 60px 60px 60px;
}
#ge-propertyTab .ge-grid-remove {
  display: grid;
  background-color: #c2c2c2;
  margin-bottom: 5px;
  filter: invert(1);
}
#ge-propertyTab .ge-grid-edit {
  display: grid;
  background-color: #878787;
  margin-bottom: 5px;
  filter: invert(1);
}
#ge-propertyTab .ge-grid {
  display: grid;
  margin-bottom: 5px;
}
#ge-propertyTab .ge-divider.double .textInputLine {
  grid-template-columns: auto auto 1fr auto;
}
#ge-propertyTab .textInputLine,
#ge-propertyTab .floatLine {
  user-select: none;
  padding-bottom: 0px;
  padding-top: 0px;
  height: var(--spacingHeight);
  display: grid;
  grid-template-columns: auto auto 1fr;
  flex-grow: 1;
}
#ge-propertyTab .textInputLine .label,
#ge-propertyTab .floatLine .label {
  grid-column: 2;
  display: flex;
  align-items: center;
  min-width: 15px;
  font-weight: 600;
}
#ge-propertyTab .textInputLine .disabled,
#ge-propertyTab .floatLine .disabled {
  color: var(--backgroundGrey);
  background-color: var(--disabledBackground);
}
#ge-propertyTab .textInputLine img,
#ge-propertyTab .floatLine img {
  width: 30px;
}
#ge-propertyTab .textInputLine .img,
#ge-propertyTab .floatLine .img {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .textInputLine .value,
#ge-propertyTab .floatLine .value {
  display: flex;
  align-items: center;
  grid-column: 3;
  background: transparent;
  height: 26px;
  position: relative;
  background-color: white;
  margin-top: 2px;
  overflow-y: hidden;
}
#ge-propertyTab .textInputLine .value input,
#ge-propertyTab .floatLine .value input {
  width: 100%;
  height: 24px;
  color: #333333;
}
#ge-propertyTab .textInputLine .value input.hasArrows,
#ge-propertyTab .floatLine .value input.hasArrows {
  padding-right: 15px;
}
#ge-propertyTab .textInputLine .value .arrows,
#ge-propertyTab .floatLine .value .arrows {
  display: none;
  position: absolute;
  right: 0;
  flex-direction: column;
  cursor: grab;
}
#ge-propertyTab .textInputLine .value .arrows .downArrowIcon,
#ge-propertyTab .textInputLine .value .arrows .upArrowIcon,
#ge-propertyTab .floatLine .value .arrows .downArrowIcon,
#ge-propertyTab .floatLine .value .arrows .upArrowIcon {
  width: 13px;
  height: 13px;
}
#ge-propertyTab .textInputLine .value:hover .arrows, #ge-propertyTab .textInputLine .value:focus .arrows, #ge-propertyTab .textInputLine .value.dragging .arrows,
#ge-propertyTab .floatLine .value:hover .arrows,
#ge-propertyTab .floatLine .value:focus .arrows,
#ge-propertyTab .floatLine .value.dragging .arrows {
  display: flex;
}
#ge-propertyTab .textInputLine .value .arrows:hover,
#ge-propertyTab .floatLine .value .arrows:hover {
  background-color: var(--buttonHoverBackground);
}
#ge-propertyTab .textInputLine .value.dragging .arrows,
#ge-propertyTab .floatLine .value.dragging .arrows {
  background-color: var(--buttonPressedBackground);
}
#ge-propertyTab .textInputLine .value.dragging .arrows .downArrowIcon,
#ge-propertyTab .textInputLine .value.dragging .arrows .upArrowIcon,
#ge-propertyTab .floatLine .value.dragging .arrows .downArrowIcon,
#ge-propertyTab .floatLine .value.dragging .arrows .upArrowIcon {
  filter: brightness(10);
}
#ge-propertyTab .textInputLine .copy,
#ge-propertyTab .floatLine .copy {
  display: none;
}
#ge-propertyTab .textInputLine.withUnits {
  grid-template-columns: auto auto 1fr auto;
}
#ge-propertyTab .textInputArea {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 120px;
}
#ge-propertyTab .textInputArea .disabled {
  color: var(--backgroundGrey);
  background-color: var(--disabledBackground);
}
#ge-propertyTab .textInputArea .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .textInputArea .value {
  display: flex;
  align-items: center;
  grid-column: 2;
}
#ge-propertyTab .textInputArea .value textarea {
  width: calc(150% - 5px);
  margin-left: -50%;
  height: 40px;
}
#ge-propertyTab .paneContainer {
  margin-top: 3px;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
}
#ge-propertyTab .paneContainer .paneList {
  border-left: 3px solid transparent;
}
#ge-propertyTab .paneContainer:hover .paneList {
  border-left: 3px solid rgba(51, 122, 183, 0.8);
}
#ge-propertyTab .paneContainer:hover .paneContainer-content .header .title {
  border-left: 3px solid rgb(51, 122, 183);
}
#ge-propertyTab .paneContainer .paneContainer-highlight-border {
  grid-row: 1;
  grid-column: 1;
  opacity: 1;
  border: 3px solid red;
  transition: opacity 250ms;
  pointer-events: none;
}
#ge-propertyTab .paneContainer .paneContainer-highlight-border.transparent {
  opacity: 0;
}
#ge-propertyTab .paneContainer .paneContainer-content {
  grid-row: 1;
  grid-column: 1;
}
#ge-propertyTab .paneContainer .paneContainer-content .header {
  display: grid;
  grid-template-columns: 1fr auto;
  background: #cccccc;
  height: var(--spacingHeight);
  padding-bottom: 0px;
  padding-top: 0px;
  padding-right: 5px;
  cursor: pointer;
}
#ge-propertyTab .paneContainer .paneContainer-content .header .title {
  border-left: 3px solid transparent;
  padding-left: 5px;
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .paneContainer .paneContainer-content .header .collapse {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-items: center;
  transform-origin: center;
}
#ge-propertyTab .paneContainer .paneContainer-content .header .collapse.closed {
  transform: rotate(180deg);
}
#ge-propertyTab .paneContainer .paneContainer-content .paneList > div:not(:last-child) {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}
#ge-propertyTab .paneContainer .paneContainer-content .fragment > div:not(:last-child) {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}
#ge-propertyTab .color-picker {
  height: 26px;
  width: 26px;
}
#ge-propertyTab .color-picker .color-rect-background {
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  border: 1px black solid;
  cursor: pointer;
  background: repeating-conic-gradient(#e2e2e2 0% 25%, white 0% 50%) 50%/100% 100%;
}
#ge-propertyTab .color-picker .color-rect-background .color-rect {
  height: 100%;
}
#ge-propertyTab .color-picker .color-picker-cover {
  z-index: 2;
  position: fixed;
  top: 0px;
  right: 0px;
  bottom: 0px;
  left: 0px;
}
#ge-propertyTab .color-picker .color-picker-float {
  position: absolute;
  outline: 1px solid black;
}
#ge-propertyTab .color-picker .color-picker-container {
  background-color: #e2e2e2;
}
#ge-propertyTab .gradient-step {
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 20px 30px 40px auto 20px 30px;
  padding-top: 5px;
  padding-left: 5px;
  padding-bottom: 5px;
}
#ge-propertyTab .gradient-step .step {
  grid-row: 1;
  grid-column: 1;
}
#ge-propertyTab .gradient-step .color {
  grid-row: 1;
  grid-column: 2;
  cursor: pointer;
}
#ge-propertyTab .gradient-step .step-value {
  margin-left: 5px;
  grid-row: 1;
  grid-column: 3;
  text-align: right;
  margin-right: 5px;
}
#ge-propertyTab .gradient-step .step-slider {
  grid-row: 1;
  grid-column: 4;
  display: grid;
  justify-content: stretch;
  align-content: center;
  margin-right: -5px;
  padding-left: 12px;
}
#ge-propertyTab .gradient-step .step-slider input {
  width: 90%;
}
#ge-propertyTab .gradient-step .gradient-copy {
  grid-row: 1;
  grid-column: 5;
  display: grid;
  align-content: center;
  justify-content: center;
}
#ge-propertyTab .gradient-step .gradient-copy .img {
  height: 20px;
  width: 20px;
}
#ge-propertyTab .gradient-step .gradient-copy .img:hover {
  cursor: pointer;
}
#ge-propertyTab .gradient-step .gradient-delete {
  grid-row: 1;
  grid-column: 6;
  display: grid;
  align-content: center;
  justify-content: center;
}
#ge-propertyTab .gradient-step .gradient-delete .img {
  height: 20px;
  width: 20px;
}
#ge-propertyTab .gradient-step .gradient-delete .img:hover {
  cursor: pointer;
}
#ge-propertyTab .alignment-bar {
  display: flex;
  justify-content: center;
  padding-right: 5px;
}
#ge-propertyTab .command-button {
  cursor: pointer;
  width: 30px;
}
#ge-propertyTab .command-button .command-label {
  display: none;
}
#ge-propertyTab .command-button .command-button-icon {
  height: 100%;
  width: 100%;
  display: grid;
  color: white;
  align-content: center;
  justify-content: center;
}
#ge-propertyTab .command-button:hover {
  background-color: white;
}
#ge-propertyTab .command-button .active {
  transform-origin: center;
  background-color: white;
}
#ge-propertyTab .command-button img.active {
  background-color: white;
}
#ge-propertyTab .command-button.disabled {
  background-color: var(--buttonDisabledBackground);
  pointer-events: none;
}
#ge-propertyTab .command-button-alt {
  cursor: pointer;
  width: 40px;
  margin-left: 5px;
  margin-right: 5px;
  background-color: white;
}
#ge-propertyTab .command-button-alt .command-label {
  display: none;
}
#ge-propertyTab .command-button-alt .command-button-icon {
  height: 100%;
  width: 100%;
  display: grid;
  align-content: center;
  justify-content: center;
}
#ge-propertyTab .command-button-alt:hover {
  background-color: #c2c2c2;
  filter: invert(1);
}
#ge-propertyTab .command-button-alt-disabled {
  cursor: pointer;
  pointer-events: none;
  width: 40px;
  margin-left: 5px;
  margin-right: 5px;
  background-color: white;
}
#ge-propertyTab .command-button-alt-disabled .command-label {
  display: none;
}
#ge-propertyTab .command-button-alt-disabled .command-button-icon {
  height: 100%;
  width: 100%;
  display: grid;
  align-content: center;
  justify-content: center;
}
#ge-propertyTab .command-button-alt-disabled img {
  filter: invert(1);
}
#ge-propertyTab .command-button-alt-active {
  cursor: pointer;
  pointer-events: none;
  width: 40px;
  margin-left: 5px;
  margin-right: 5px;
  background-color: #c2c2c2;
  filter: invert(1);
}
#ge-propertyTab .command-button-alt-active .command-label {
  display: none;
}
#ge-propertyTab .command-button-alt-active .command-button-icon {
  height: 100%;
  width: 100%;
  display: grid;
  align-content: center;
  justify-content: center;
}
#ge-propertyTab .floatLine {
  user-select: none;
  height: var(--spacingHeight);
  padding-bottom: 0px;
  padding-top: 0px;
  display: grid;
  grid-template-columns: auto auto 2fr auto;
  flex-grow: 1;
}
#ge-propertyTab .floatLine .label {
  grid-column: 2;
  display: flex;
  align-items: center;
  min-width: 15px;
  font-weight: 600;
}
#ge-propertyTab .floatLine img {
  width: 30px;
}
#ge-propertyTab .floatLine .img {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .floatLine .value {
  display: flex;
  align-items: center;
  grid-column: 3;
  background: transparent;
  height: 26px;
}
#ge-propertyTab .floatLine .value input {
  width: 100%;
  background-color: white;
  height: 24px;
}
#ge-propertyTab .floatLine .short {
  grid-column: 2;
  display: flex;
  align-items: center;
}
#ge-propertyTab .floatLine .short input {
  width: 100%;
}
#ge-propertyTab .floatLine .short input::-webkit-outer-spin-button,
#ge-propertyTab .floatLine .short input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#ge-propertyTab .floatLine .copy {
  display: none;
}
#ge-propertyTab .vector3Line {
  padding-bottom: 0px;
  padding-top: 0px;
  display: grid;
}
#ge-propertyTab .vector3Line .firstLine {
  display: grid;
  grid-template-columns: 1fr auto 20px;
  height: var(--spacingHeight);
}
#ge-propertyTab .vector3Line .firstLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .vector3Line .firstLine .vector {
  grid-column: 2;
  display: flex;
  align-items: center;
  text-align: right;
  opacity: 0.8;
}
#ge-propertyTab .vector3Line .firstLine .expand {
  grid-column: 3;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#ge-propertyTab .vector3Line .firstLine .copy {
  display: none;
}
#ge-propertyTab .vector3Line .secondLine {
  display: grid;
  padding-right: 5px;
  border-left: 1px solid rgb(51, 122, 183);
}
#ge-propertyTab .vector3Line .secondLine .no-right-margin {
  margin-right: 0;
}
#ge-propertyTab .vector3Line .secondLine .numeric {
  display: grid;
  grid-template-columns: 1fr auto;
}
#ge-propertyTab .vector3Line .secondLine .numeric-label {
  text-align: right;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-self: right;
  margin-right: 10px;
}
#ge-propertyTab .vector3Line .secondLine .numeric-value {
  width: 120px;
  grid-column: 2;
  display: flex;
  align-items: center;
  border: 1px solid rgb(51, 122, 183);
}
#ge-propertyTab .buttonLine {
  height: var(--spacingHeight);
  padding-bottom: 0px;
  padding-top: 0px;
  display: grid;
  align-items: center;
  justify-items: stretch;
  padding-bottom: 5px;
}
#ge-propertyTab .buttonLine input[type=file] {
  display: none;
}
#ge-propertyTab .buttonLine .file-upload {
  background: var(--backgroundGrey);
  border: 1px solid #424242;
  margin: 5px 10px;
  color: white;
  padding: 4px 5px;
  opacity: 0.9;
  cursor: pointer;
  text-align: center;
  border-radius: 4px;
}
#ge-propertyTab .buttonLine .file-upload:hover {
  opacity: 1;
}
#ge-propertyTab .buttonLine .file-upload:active {
  transform: scale(0.98);
  transform-origin: 0.5 0.5;
}
#ge-propertyTab .buttonLine button {
  background: var(--backgroundGrey);
  border: 1px solid #424242;
  margin: 5px 10px 5px 10px;
  color: white;
  padding: 4px 5px;
  opacity: 0.9;
  border-radius: 4px;
}
#ge-propertyTab .buttonLine button:hover {
  opacity: 1;
}
#ge-propertyTab .buttonLine button:active {
  background: #282828;
}
#ge-propertyTab .buttonLine button:focus {
  border: 1px solid #424242;
  outline: 0px;
}
#ge-propertyTab .numeric {
  padding-bottom: 0px;
  padding-top: 0px;
  height: var(--spacingHeight);
  display: grid;
  grid-template-columns: 1fr 120px auto;
}
#ge-propertyTab .numeric .numeric-label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .numeric .number {
  display: flex;
  align-items: center;
  grid-column: 2;
  height: 10px;
}
#ge-propertyTab .numeric .number .input {
  width: calc(100% - 5px);
  height: 10px;
}
#ge-propertyTab .checkBoxLine {
  padding-bottom: 0px;
  padding-top: 0px;
  height: var(--spacingHeight);
  display: grid;
  grid-template-columns: auto 1fr auto;
  flex-grow: 1;
}
#ge-propertyTab .checkBoxLine .label {
  grid-column: 2;
  display: flex;
  align-items: center;
  min-width: 100px;
  margin-left: 15px;
  height: var(--spacingHeight);
  font-weight: 600;
}
#ge-propertyTab .checkBoxLine img {
  width: 30px;
}
#ge-propertyTab .checkBoxLine .img {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .checkBoxLine .hidden {
  display: none;
}
#ge-propertyTab .checkBoxLine .copy {
  display: none;
}
#ge-propertyTab .listLine {
  padding-bottom: 0px;
  padding-top: 0px;
  height: var(--spacingHeight);
  display: grid;
  grid-template-columns: auto 1fr auto;
  flex-grow: 1;
}
#ge-propertyTab .listLine .label {
  grid-column: 2;
  display: none;
  align-items: center;
}
#ge-propertyTab .listLine img {
  width: 30px;
}
#ge-propertyTab .listLine .img {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .listLine .options {
  grid-column: 2;
  padding-left: 15px;
  display: flex;
  align-items: center;
}
#ge-propertyTab .listLine .options select {
  width: 100%;
  height: 25px;
  border: transparent;
}
#ge-propertyTab .listLine .options input {
  width: 100%;
  height: 24px;
  color: #333333;
}
#ge-propertyTab .listLine .copy {
  display: none;
}
#ge-propertyTab .color3Line {
  padding-left: 15px;
  padding-bottom: 0px;
  padding-top: 0px;
  display: grid;
  flex-grow: 1;
}
#ge-propertyTab .color3Line .firstLine {
  height: var(--spacingHeight);
  display: flex;
  align-items: center;
}
#ge-propertyTab .color3Line .firstLine .label {
  grid-column: 2;
  padding-left: 5px;
  display: none;
  align-items: center;
  min-width: 15px;
}
#ge-propertyTab .color3Line .firstLine .img {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .color3Line .firstLine img {
  width: 30px;
  height: 30px;
}
#ge-propertyTab .color3Line .firstLine .textInputLine {
  grid-column: 3;
  padding-left: 2px;
  flex-grow: 1;
}
#ge-propertyTab .color3Line .firstLine .color3 {
  display: flex;
  align-items: center;
}
#ge-propertyTab .color3Line .firstLine .color3 input {
  margin-right: 5px;
}
#ge-propertyTab .color3Line .firstLine .expand {
  grid-column: 3;
  display: none;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#ge-propertyTab .color3Line .firstLine .expand img {
  height: 100%;
  width: 20px;
}
#ge-propertyTab .color3Line .firstLine .copy {
  grid-column: 4;
  display: none;
  align-items: center;
  justify-items: center;
  cursor: pointer;
  color: black;
}
#ge-propertyTab .color3Line .firstLine .copy img {
  height: 100%;
  width: 20px;
}
#ge-propertyTab .color3Line .secondLine {
  display: grid;
  padding-right: 5px;
  border-left: 1px solid rgb(51, 122, 183);
}
#ge-propertyTab .color3Line .secondLine .numeric {
  display: grid;
  grid-template-columns: 1fr auto;
}
#ge-propertyTab .color3Line .secondLine .numeric-label {
  text-align: right;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-self: right;
  margin-right: 10px;
}
#ge-propertyTab .color3Line .secondLine .numeric-value {
  width: 120px;
  grid-column: 2;
  display: flex;
  align-items: center;
  border: 1px solid rgb(51, 122, 183);
}
#ge-propertyTab .textLine {
  padding-left: 5px;
  padding-bottom: 0px;
  padding-top: 0px;
  padding-right: 18px;
  height: auto;
  display: grid;
  grid-template-columns: auto auto 2fr 1fr;
}
#ge-propertyTab .textLine .label {
  grid-column: 2;
  padding-left: 5px;
  padding-top: 4px;
  display: flex;
  align-items: left;
  min-width: 15px;
  color: #a9a9a9;
  font-size: 10px;
  font-family: "acumin-pro-semi-condensed", sans-serif;
  font-weight: 600;
}
#ge-propertyTab .textLine img {
  width: 30px;
}
#ge-propertyTab .textLine .img {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#ge-propertyTab .textLine .link-value {
  grid-column: 2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: end;
  opacity: 0.8;
  margin: 5px;
  margin-top: 6px;
  max-width: 140px;
  text-decoration: underline;
  cursor: pointer;
}
#ge-propertyTab .textLine .value {
  display: none;
  grid-column: 3;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: end;
  opacity: 0.8;
  margin: 5px;
  margin-top: 6px;
  max-width: 200px;
  user-select: text;
}
#ge-propertyTab .textLine .value.check {
  color: green;
}
#ge-propertyTab .textLine .value.uncheck {
  color: red;
}`, "",{"version":3,"sources":["webpack://./../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss"],"names":[],"mappings":"AAAA;EACI,yBAAA;EACA,qBAAA;EACA,iBAAA;EACA,2BAAA;EACA,mCAAA;EACA,6BAAA;EACA,wBAAA;EACA,kCAAA;EACA,gCAAA;AACJ;;AAEA;EACI,iBAAA;EAKA,YAAA;EACA,mBAAA;AAHJ;AAII;EACI,+CAAA;EACA,eAAA;AAFR;AAII;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,iBAAA;EACA,WAAA;EACA,kBAAA;EACA,aAAA;EACA,+BAAA;EACA,iBAAA;AAFR;AAIQ;EACI,kBAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,OAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;EACA,iBAAA;AAFZ;AAKQ;EACI,iBAAA;EACA,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;AAHZ;AAOI;EACI,aAAA;AALR;AAQI;EACI,wBAAA;EACA,WAAA;EACA,WAAA;EACA,mBAAA;EACA,kBAAA;EACA,aAAA;EACA,YAAA;EACA,wBAAA;EACA,UAAA;AANR;AASI;EACI,UAAA;AAPR;AAUI;EACI,wBAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,mBAAA;EACA,aAAA;EACA,kBAAA;EACA,eAAA;AARR;AAWI;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,wBAAA;EACA,eAAA;AATR;AAYI;EACI,wBAAA;EACA,0CAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;AAVR;AAYI;EACI,UAAA;AAVR;AAYI;EACI,YAAA;AAVR;AAaI;EACI,yBAAA;AAXR;AAcI;EACI,WAAA;EACA,YAAA;AAZR;AAeI;EACI,WAAA;EACA,YAAA;EACA,oBAAA;EACA,yCAAA;EACA,YAAA;EACA,eAAA;EACA,eAAA;EACA,gBAAA;EACA,0CAAA;EACA,gBAAA;EACA,kBAAA;EACA,aAAA;EACA,uBAAA;EACA,mBAAA;AAbR;AAgBI;EACI,iDAAA;EACA,mBAAA;AAdR;AAiBI;EACI,8CAAA;AAfR;AAkBI;EACI,2BAAA;EACA,gDAAA;AAhBR;AAmBI;;EAEI,oBAAA;EACA,kBAAA;EACA,0BAAA;EACA,oBAAA;EACA,kBAAA;EACA,8BAAA;EACA,mBAAA;EACA,iBAAA;AAjBR;AAmBQ;;EACI,kBAAA;EACA,oBAAA;AAhBZ;AAoBI;;EAEI,wBAAA;EACA,SAAA;AAlBR;AAqBI;EACI,4BAAA;EACA,aAAA;EACA,wBAAA;EACA,wCAAA;EACA,YAAA;AAnBR;AAqBQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,gBAAA;AAnBZ;AAsBQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AApBZ;AAuBQ;EACI,cAAA;EACA,WAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,iBAAA;AArBZ;AAwBQ;EACI,cAAA;EACA,iBAAA;EACA,+BAAA;AAtBZ;AAwBY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,gBAAA;AAtBhB;AAyBY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAvBhB;AAyBgB;EACI,WAAA;EACA,uBAAA;EACA,YAAA;AAvBpB;AA0BgB;;EAEI,wBAAA;EACA,SAAA;AAxBpB;AA2BgB;EACI,6BAAA;EACA,qBAAA;AAzBpB;AA6BY;EACI,aAAA;AA3BhB;AA+BQ;EACI,aAAA;AA7BZ;AAiCI;EACI,mBAzOiB;EA0OjB,iBAAA;EACA,aAAA;EACA,+BAAA;EACA,gBAAA;EACA,mBAAA;AA/BR;AAiCQ;EACI,gBAAA;EACA,cAAA;AA/BZ;AAkCI;EACI,aAAA;EACA,uCAAA;AAhCR;AAmCY;;EACI,cAAA;AAhChB;AAkCY;;EACI,cAAA;AA/BhB;AAkCQ;EACI,cAAA;EACA,gBAAA;AAhCZ;AAmCI;EACI,aAAA;EACA,kDAAA;AAjCR;AAoCY;;EACI,cAAA;AAjChB;AAmCY;;EACI,cAAA;AAhChB;AAkCY;;EACI,cAAA;AA/BhB;AAiCY;;EACI,cAAA;AA9BhB;AAkCI;EACI,aAAA;EACA,qCAAA;AAhCR;AAkCQ;EACI,iBAAA;AAhCZ;AAoCI;EACI,aAAA;EACA,0CAAA;AAlCR;AAqCI;EACI,aAAA;EACA,yBAAA;EACA,kBAAA;EACA,iBAAA;AAnCR;AAsCI;EACI,aAAA;EACA,yBAAA;EACA,kBAAA;EACA,iBAAA;AApCR;AAuCI;EACI,aAAA;EACA,kBAAA;AArCR;AAwCI;EACI,yCAAA;AAtCR;AAyCI;;EAEI,iBAAA;EACA,mBAnUkB;EAoUlB,gBAnUe;EAoUf,4BAAA;EACA,aAAA;EACA,oCAAA;EACA,YAAA;AAvCR;AAwCQ;;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,gBAAA;AArCZ;AAwCQ;;EACI,4BAAA;EACA,2CAAA;AArCZ;AAwCQ;;EACI,WAAA;AArCZ;AAwCQ;;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AArCZ;AAwCQ;;EACI,aAAA;EACA,mBAAA;EACA,cAAA;EACA,uBAAA;EACA,YAAA;EACA,kBAAA;EACA,uBAAA;EACA,eAAA;EACA,kBAAA;AArCZ;AAsCY;;EACI,WAAA;EACA,YAAA;EACA,cAAA;AAnChB;AAqCY;;EACI,mBAAA;AAlChB;AAoCY;;EACI,aAAA;EACA,kBAAA;EACA,QAAA;EACA,sBAAA;EACA,YAAA;AAjChB;AAkCgB;;;;EAEI,WAAA;EACA,YAAA;AA9BpB;AAiCY;;;;EAGI,aAAA;AA9BhB;AAgCY;;EACI,8CAAA;AA7BhB;AA+BY;;EACI,gDAAA;AA5BhB;AA6BgB;;;;EAEI,sBAAA;AAzBpB;AA8BQ;;EACI,aAAA;AA3BZ;AA+BI;EACI,yCAAA;AA7BR;AAgCI;EACI,YAAA;EACA,aAAA;EACA,gCAAA;AA9BR;AAgCQ;EACI,4BAAA;EACA,2CAAA;AA9BZ;AAiCQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA/BZ;AAkCQ;EACI,aAAA;EACA,mBAAA;EACA,cAAA;AAhCZ;AAkCY;EACI,uBAAA;EACA,iBAAA;EACA,YAAA;AAhChB;AAqCI;EACI,eAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;AAnCR;AAqCQ;EACI,kCAAA;AAnCZ;AAuCY;EACI,8CAAA;AArChB;AA0CoB;EACI,wCAAA;AAxCxB;AA8CQ;EACI,WAAA;EACA,cAAA;EACA,UAAA;EACA,qBAAA;EACA,yBAAA;EACA,oBAAA;AA5CZ;AA8CY;EACI,UAAA;AA5ChB;AAgDQ;EACI,WAAA;EACA,cAAA;AA9CZ;AAgDY;EACI,aAAA;EACA,+BAAA;EACA,mBAAA;EACA,4BAAA;EACA,mBAneU;EAoeV,gBAneO;EAoeP,kBAAA;EACA,eAAA;AA9ChB;AAgDgB;EACI,kCAAA;EACA,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;AA9CpB;AAiDgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,wBAAA;AA/CpB;AAiDoB;EACI,yBAAA;AA/CxB;AAoDY;EACI,mDAAA;AAlDhB;AAqDY;EACI,mDAAA;AAnDhB;AAwDI;EACI,YAAA;EACA,WAAA;AAtDR;AAwDQ;EACI,uBAAA;EACA,wBAAA;EACA,uBAAA;EACA,eAAA;EACA,gFAAA;AAtDZ;AAuDY;EACI,YAAA;AArDhB;AAyDQ;EACI,UAAA;EACA,eAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;AAvDZ;AA0DQ;EACI,kBAAA;EACA,wBAAA;AAxDZ;AA2DQ;EACI,yBAAA;AAzDZ;AA6DI;EACI,aAAA;EACA,wBAAA;EACA,oDAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;AA3DR;AA6DQ;EACI,WAAA;EACA,cAAA;AA3DZ;AA8DQ;EACI,WAAA;EACA,cAAA;EACA,eAAA;AA5DZ;AA+DQ;EACI,gBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,iBAAA;AA7DZ;AAgEQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,qBAAA;EACA,kBAAA;EACA,kBAAA;AA9DZ;AAgEY;EACI,UAAA;AA9DhB;AAkEQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AAhEZ;AAkEY;EACI,YAAA;EACA,WAAA;AAhEhB;AAkEY;EACI,eAAA;AAhEhB;AAmEQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AAjEZ;AAkEY;EACI,YAAA;EACA,WAAA;AAhEhB;AAkEY;EACI,eAAA;AAhEhB;AAqEI;EACI,aAAA;EACA,uBAAA;EACA,kBAAA;AAnER;AAsEI;EACI,eAAA;EACA,WAAA;AApER;AAsEQ;EACI,aAAA;AApEZ;AAuEQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,qBAAA;EACA,uBAAA;AArEZ;AAwEQ;EACI,uBAAA;AAtEZ;AAyEQ;EACI,wBAAA;EACA,uBAAA;AAvEZ;AA2EY;EACI,uBAAA;AAzEhB;AA6EQ;EACI,iDAAA;EACA,oBAAA;AA3EZ;AA+EI;EACI,eAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EACA,uBAAA;AA7ER;AA8EQ;EACI,aAAA;AA5EZ;AA+EQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AA7EZ;AA+EQ;EACI,yBAAA;EACA,iBAAA;AA7EZ;AAiFI;EACI,eAAA;EACA,oBAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EACA,uBAAA;AA/ER;AAgFQ;EACI,aAAA;AA9EZ;AAiFQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AA/EZ;AAkFQ;EACI,iBAAA;AAhFZ;AAoFI;EACI,eAAA;EACA,oBAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EACA,yBAAA;EACA,iBAAA;AAlFR;AAmFQ;EACI,aAAA;AAjFZ;AAoFQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AAlFZ;AAsFI;EACI,iBAAA;EACA,4BAAA;EACA,mBApuBkB;EAquBlB,gBApuBe;EAquBf,aAAA;EACA,yCAAA;EACA,YAAA;AApFR;AAsFQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,gBAAA;AApFZ;AAuFQ;EACI,WAAA;AArFZ;AAwFQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAtFZ;AAyFQ;EACI,aAAA;EACA,mBAAA;EACA,cAAA;EACA,uBAAA;EACA,YAAA;AAvFZ;AAwFY;EACI,WAAA;EACA,uBAAA;EACA,YAAA;AAtFhB;AA0FQ;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;AAzFZ;AA2FY;EACI,WAAA;AAzFhB;AA4FY;;EAEI,wBAAA;EACA,SAAA;AA1FhB;AA8FQ;EACI,aAAA;AA5FZ;AAgGI;EACI,mBAhyBkB;EAiyBlB,gBAhyBe;EAiyBf,aAAA;AA9FR;AA+FQ;EACI,aAAA;EACA,oCAAA;EACA,4BAAA;AA7FZ;AA+FY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA7FhB;AAgGY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,iBAAA;EACA,YAAA;AA9FhB;AAiGY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AA/FhB;AAkGY;EACI,aAAA;AAhGhB;AAoGQ;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AAlGZ;AAoGY;EACI,eAAA;AAlGhB;AAqGY;EACI,aAAA;EACA,+BAAA;AAnGhB;AAsGY;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AApGhB;AAuGY;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AArGhB;AA0GI;EACI,4BAAA;EACA,mBAt2BkB;EAu2BlB,gBAt2Be;EAu2Bf,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,mBAAA;AAxGR;AAyGQ;EACI,aAAA;AAvGZ;AA0GQ;EACI,iCAAA;EACA,yBAAA;EACA,gBAAA;EACA,YAAA;EACA,gBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,kBAAA;AAxGZ;AA2GQ;EACI,UAAA;AAzGZ;AA4GQ;EACI,sBAAA;EACA,yBAAA;AA1GZ;AA6GQ;EACI,iCAAA;EACA,yBAAA;EACA,yBAAA;EACA,YAAA;EACA,gBAAA;EACA,YAAA;EACA,kBAAA;AA3GZ;AA8GQ;EACI,UAAA;AA5GZ;AA+GQ;EACI,mBAAA;AA7GZ;AAgHQ;EACI,yBAAA;EACA,YAAA;AA9GZ;AAkHI;EACI,mBA95BkB;EA+5BlB,gBA95Be;EA+5Bf,4BAAA;EACA,aAAA;EACA,qCAAA;AAhHR;AAkHQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAhHZ;AAmHQ;EACI,aAAA;EACA,mBAAA;EACA,cAAA;EACA,YAAA;AAjHZ;AAkHY;EACI,uBAAA;EACA,YAAA;AAhHhB;AAqHI;EACI,mBAv7BkB;EAw7BlB,gBAv7Be;EAw7Bf,4BAAA;EACA,aAAA;EACA,oCAAA;EACA,YAAA;AAnHR;AAqHQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,gBAAA;EACA,iBAAA;EACA,4BAAA;EACA,gBAAA;AAnHZ;AAsHQ;EACI,WAAA;AApHZ;AAuHQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AArHZ;AAwHQ;EACI,aAAA;AAtHZ;AAyHQ;EACI,aAAA;AAvHZ;AA2HI;EACI,mBA59BkB;EA69BlB,gBA59Be;EA69Bf,4BAAA;EACA,aAAA;EACA,oCAAA;EACA,YAAA;AAzHR;AA2HQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAzHZ;AA4HQ;EACI,WAAA;AA1HZ;AA6HQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA3HZ;AA8HQ;EACI,cAAA;EACA,kBAAA;EACA,aAAA;EACA,mBAAA;AA5HZ;AA8HY;EACI,WAAA;EACA,YAAA;EACA,mBAAA;AA5HhB;AA+HY;EACI,WAAA;EACA,YAAA;EACA,cAAA;AA7HhB;AAiIQ;EACI,aAAA;AA/HZ;AAmII;EACI,kBAAA;EACA,mBA7gCkB;EA8gClB,gBA7gCe;EA8gCf,aAAA;EACA,YAAA;AAjIR;AAmIQ;EACI,4BAAA;EACA,aAAA;EACA,mBAAA;AAjIZ;AAmIY;EACI,cAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;AAjIhB;AAoIY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAlIhB;AAqIY;EACI,WAAA;EACA,YAAA;AAnIhB;AAsIY;EACI,cAAA;EACA,iBAAA;EACA,YAAA;AApIhB;AAuIY;EACI,aAAA;EACA,mBAAA;AArIhB;AAuIgB;EACI,iBAAA;AArIpB;AAyIY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAvIhB;AAyIgB;EACI,YAAA;EACA,WAAA;AAvIpB;AA2IY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;EACA,YAAA;AAzIhB;AA0IgB;EACI,YAAA;EACA,WAAA;AAxIpB;AA6IQ;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AA3IZ;AA6IY;EACI,aAAA;EACA,+BAAA;AA3IhB;AA8IY;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AA5IhB;AA+IY;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AA7IhB;AAkJI;EACI,iBAnnCgB;EAonChB,mBAnnCkB;EAonClB,gBAnnCe;EAonCf,mBAnnCiB;EAonCjB,YAAA;EACA,aAAA;EACA,wCAAA;AAhJR;AAiJQ;EACI,cAAA;EACA,iBAAA;EACA,gBAAA;EACA,aAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,eAAA;EACA,oDAAA;EACA,gBAAA;AA/IZ;AAkJQ;EACI,WAAA;AAhJZ;AAmJQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAjJZ;AAoJQ;EACI,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,0BAAA;EACA,eAAA;AAlJZ;AAqJQ;EACI,aAAA;EACA,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,iBAAA;AAnJZ;AAqJY;EACI,YAAA;AAnJhB;AAsJY;EACI,UAAA;AApJhB","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss":
/*!******************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss ***!
  \******************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_50585__) => {

"use strict";
__nested_webpack_require_50585__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_50585__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_50585__(/*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_50585__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_50585__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_50585__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#ge-scene-explorer-host {
  position: absolute;
  left: 0px;
  top: 0px;
  bottom: 0px;
}
#ge-scene-explorer-host * {
  font-family: "acumin-pro-condensed";
}
#ge-scene-explorer-host:focus {
  outline: none;
}

#ge-__resizable_base__ {
  display: none;
}

.ge-context-menu {
  background: #e2e2e2;
}
.ge-context-menu .react-contextmenu-item {
  padding: 10px;
  cursor: pointer;
}
.ge-context-menu .react-contextmenu-item:hover {
  background: #e2e2e2;
}

.ge-eact-contextmenu.context-menu.react-contextmenu--visible {
  z-index: 99;
  transform: scale(1);
}

#ge-sceneExplorer {
  background: #e2e2e2;
  height: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  font: 16px "acumin-pro-condensed";
}
#ge-sceneExplorer:focus {
  outline: none;
}
#ge-sceneExplorer #header {
  height: 30px;
  font-size: 16px;
  color: black;
  background: #e2e2e2;
  grid-row: 1;
  text-align: center;
  display: grid;
  grid-template-columns: 30px 1fr 50px;
  user-select: none;
}
#ge-sceneExplorer #header #logo {
  position: relative;
  grid-column: 1;
  width: 24px;
  height: 24px;
  left: 0;
  display: flex;
  align-self: center;
  justify-self: center;
}
#ge-sceneExplorer #header #title {
  grid-column: 2;
  display: grid;
  align-items: center;
  text-align: center;
}
#ge-sceneExplorer #header #commands {
  grid-column: 3;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 1fr;
}
#ge-sceneExplorer #header #commands .expand {
  grid-column: 1;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#ge-sceneExplorer #header #commands .close {
  grid-column: 2;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#ge-sceneExplorer #tree {
  grid-row: 2;
  overflow-x: hidden;
  overflow-y: auto;
}
#ge-sceneExplorer .filter {
  display: flex;
  align-items: stretch;
}
#ge-sceneExplorer .filter input {
  width: 100%;
  margin: 10px 40px 5px 40px;
  display: block;
  border: none;
  padding: 0;
  border-bottom: solid 1px rgb(51, 122, 183);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, rgb(51, 122, 183) 4%);
  background-position: -1000px 0;
  background-size: 1000px 100%;
  background-repeat: no-repeat;
  color: black;
}
#ge-sceneExplorer .filter input::placeholder {
  color: lightgray;
}
#ge-sceneExplorer .filter input:focus {
  box-shadow: none;
  outline: none;
  background-position: 0 0;
}
#ge-sceneExplorer .groupContainer {
  margin-left: 0px;
  color: black;
  margin-top: 0px;
  margin-bottom: 0px;
  height: 24px;
  user-select: none;
  align-self: center;
  display: grid;
  align-items: center;
}
#ge-sceneExplorer .groupContainer:hover {
  background: #bbbbbb;
}
#ge-sceneExplorer .groupContainer .expandableHeader {
  display: grid;
  grid-template-columns: 1fr 20px;
}
#ge-sceneExplorer .groupContainer .expandableHeader .text {
  grid-column: 1;
  display: grid;
  grid-template-columns: 20px 1fr;
}
#ge-sceneExplorer .groupContainer .expandableHeader .text .arrow {
  grid-column: 1;
  margin-left: 0px;
  color: black;
  cursor: pointer;
  display: inline-block;
  margin-right: 6px;
  opacity: 0.5;
}
#ge-sceneExplorer .groupContainer .expandableHeader .text .text-value {
  grid-column: 2;
  display: flex;
  align-items: center;
}
#ge-sceneExplorer .groupContainer .expandableHeader .expandAll {
  opacity: 0.5;
  grid-column: 2;
  margin-right: 10px;
}
#ge-sceneExplorer .icon {
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#ge-sceneExplorer .addComponent {
  display: none;
}
#ge-sceneExplorer .makeChild {
  grid-column: 3;
}
#ge-sceneExplorer .itemContainer {
  margin-left: 0px;
  color: black;
  margin-top: 0px;
  margin-bottom: 0px;
  height: 32px;
  -webkit-user-select: none;
  user-select: none;
  display: grid;
  grid-template-columns: 20px 1fr;
  border: 2px solid transparent;
}
#ge-sceneExplorer .itemContainer.hover {
  border: 2px solid #527089;
  cursor: pointer;
}
#ge-sceneExplorer .itemContainer.seAbove {
  border-top: 2px solid #527089;
  cursor: pointer;
}
#ge-sceneExplorer .itemContainer.seBelow {
  border-bottom: 2px solid #527089;
  cursor: pointer;
}
#ge-sceneExplorer .itemContainer.selected {
  background: #bfbebe;
  color: black;
}
#ge-sceneExplorer .itemContainer.dragged {
  background: transparent;
  color: black;
}
#ge-sceneExplorer .itemContainer.parent {
  background: #ffffff;
  color: black;
}
#ge-sceneExplorer .itemContainer .isNotActive {
  opacity: 0.3;
}
#ge-sceneExplorer .itemContainer .arrow {
  grid-column: 1;
  color: black;
  opacity: 0.6;
}
#ge-sceneExplorer .itemContainer .popup {
  width: 200px;
  visibility: hidden;
  background-color: #bbbbbb;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: absolute;
  z-index: 1;
  margin-left: -180px;
  box-sizing: border-box;
}
#ge-sceneExplorer .itemContainer .popup.show {
  visibility: visible;
}
#ge-sceneExplorer .itemContainer .popup:focus {
  outline: none;
}
#ge-sceneExplorer .itemContainer .popup .popupMenu {
  padding: 6px 5px 5px 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  height: 18px;
}
#ge-sceneExplorer .itemContainer .popup .popupMenu:hover {
  background: white;
  color: #333333;
}
#ge-sceneExplorer .itemContainer .sceneNode {
  grid-column: 2;
  margin-left: -10px;
  display: grid;
  grid-template-columns: 1fr 20px 20px 20px 20px 10px 20px 20px auto 5px;
  align-items: center;
  cursor: pointer;
}
#ge-sceneExplorer .itemContainer .sceneNode .sceneTitle {
  grid-column: 1;
  margin-right: 5px;
  display: flex;
  align-items: center;
  height: 24px;
}
#ge-sceneExplorer .itemContainer .sceneNode .translation {
  grid-column: 2;
  opacity: 0.6;
}
#ge-sceneExplorer .itemContainer .sceneNode .translation.selected {
  opacity: 1;
}
#ge-sceneExplorer .itemContainer .sceneNode .rotation {
  grid-column: 3;
  opacity: 0.6;
}
#ge-sceneExplorer .itemContainer .sceneNode .rotation.selected {
  opacity: 1;
}
#ge-sceneExplorer .itemContainer .sceneNode .scaling {
  grid-column: 4;
  opacity: 0.6;
}
#ge-sceneExplorer .itemContainer .sceneNode .scaling.selected {
  opacity: 1;
}
#ge-sceneExplorer .itemContainer .sceneNode .bounding {
  grid-column: 5;
  opacity: 0.6;
}
#ge-sceneExplorer .itemContainer .sceneNode .bounding.selected {
  opacity: 1;
}
#ge-sceneExplorer .itemContainer .sceneNode .separator {
  grid-column: 6;
  margin-left: 5px;
  width: 5px;
  display: flex;
  align-items: center;
  height: 18px;
  border-left: solid 1px rgb(51, 122, 183);
}
#ge-sceneExplorer .itemContainer .sceneNode .pickingMode {
  grid-column: 7;
  opacity: 0.6;
}
#ge-sceneExplorer .itemContainer .sceneNode .pickingMode.selected {
  opacity: 1;
}
#ge-sceneExplorer .itemContainer .sceneNode .refresh {
  grid-column: 8;
}
#ge-sceneExplorer .itemContainer .sceneNode .extensions {
  width: 20px;
  grid-column: 9;
}
#ge-sceneExplorer .itemContainer .adtextureTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 20px auto 5px;
  align-items: center;
}
#ge-sceneExplorer .itemContainer .adtextureTools .pickingMode {
  grid-column: 2;
  opacity: 0.6;
}
#ge-sceneExplorer .itemContainer .adtextureTools .pickingMode.selected {
  opacity: 1;
}
#ge-sceneExplorer .itemContainer .adtextureTools .extensions {
  width: 20px;
  grid-column: 3;
}
#ge-sceneExplorer .itemContainer .controlTools {
  grid-column: 2;
  display: grid;
  align-items: center;
  grid-template-columns: auto 1fr auto auto auto;
}
#ge-sceneExplorer .itemContainer .controlTools .controlType {
  grid-column: 1;
}
#ge-sceneExplorer .itemContainer .controlTools .controlType img {
  width: 32px;
  height: 32px;
  filter: invert(100%);
}
#ge-sceneExplorer .itemContainer .controlTools .highlight {
  grid-column: 3;
}
#ge-sceneExplorer .itemContainer .controlTools .visibility {
  grid-column: 4;
}
#ge-sceneExplorer .itemContainer .controlTools .extensions {
  width: 20px;
  grid-column: 5;
}
#ge-sceneExplorer .itemContainer .title {
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  margin-right: 5px;
  align-items: center;
  height: 24px;
  cursor: pointer;
}
#ge-sceneExplorer .itemContainer .title .titleText {
  font-family: "acumin-pro-condensed", sans-serif;
  font-size: 16px;
  border: unset;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  outline: none;
}`, "",{"version":3,"sources":["webpack://./../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss"],"names":[],"mappings":"AAAA;EACI,kBAAA;EACA,SAAA;EACA,QAAA;EACA,WAAA;AACJ;AAAI;EACI,mCAAA;AAER;AAAI;EACI,aAAA;AAER;;AAEA;EACI,aAAA;AACJ;;AAEA;EACI,mBAAA;AACJ;AACI;EACI,aAAA;EACA,eAAA;AACR;AACQ;EACI,mBAAA;AACZ;;AAIA;EACI,WAAA;EACA,mBAAA;AADJ;;AAIA;EACI,mBAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,aAAA;EACA,4BAAA;EACA,iCAAA;AADJ;AAGI;EACI,aAAA;AADR;AAII;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,mBAAA;EACA,WAAA;EACA,kBAAA;EACA,aAAA;EACA,oCAAA;EACA,iBAAA;AAFR;AAIQ;EACI,kBAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,OAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;AAFZ;AAKQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;AAHZ;AAMQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,8BAAA;AAJZ;AAMY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAJhB;AAOY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AALhB;AAUI;EACI,WAAA;EAEA,kBAAA;EACA,gBAAA;AATR;AAYI;EACI,aAAA;EACA,oBAAA;AAVR;AAYQ;EACI,WAAA;EACA,0BAAA;EACA,cAAA;EACA,YAAA;EACA,UAAA;EACA,0CAAA;EACA,wFAAA;EACA,8BAAA;EACA,4BAAA;EACA,4BAAA;EACA,YAAA;AAVZ;AAaQ;EACI,gBAAA;AAXZ;AAcQ;EACI,gBAAA;EACA,aAAA;EACA,wBAAA;AAZZ;AAgBI;EACI,gBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;EAEA,iBAAA;EAEA,kBAAA;EACA,aAAA;EACA,mBAAA;AAhBR;AAkBQ;EACI,mBAAA;AAhBZ;AAmBQ;EACI,aAAA;EACA,+BAAA;AAjBZ;AAmBY;EACI,cAAA;EACA,aAAA;EACA,+BAAA;AAjBhB;AAmBgB;EACI,cAAA;EACA,gBAAA;EACA,YAAA;EACA,eAAA;EACA,qBAAA;EACA,iBAAA;EACA,YAAA;AAjBpB;AAoBgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAlBpB;AAsBY;EACI,YAAA;EACA,cAAA;EACA,kBAAA;AApBhB;AAyBI;EACI,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAvBR;AA0BI;EACI,aAAA;AAxBR;AA2BI;EACI,cAAA;AAzBR;AA4BI;EACI,gBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;EACA,yBAAA;EACA,iBAAA;EACA,aAAA;EACA,+BAAA;EACA,6BAAA;AA1BR;AA2BQ;EACI,yBAAA;EACA,eAAA;AAzBZ;AA4BQ;EACI,6BAAA;EACA,eAAA;AA1BZ;AA4BQ;EACI,gCAAA;EACA,eAAA;AA1BZ;AA6BQ;EACI,mBAAA;EACA,YAAA;AA3BZ;AA8BQ;EACI,uBAAA;EACA,YAAA;AA5BZ;AA+BQ;EACI,mBAAA;EACA,YAAA;AA7BZ;AAgCQ;EACI,YAAA;AA9BZ;AAgCQ;EACI,cAAA;EACA,YAAA;EACA,YAAA;AA9BZ;AAiCQ;EACI,YAAA;EACA,kBAAA;EACA,yBAAA;EACA,WAAA;EACA,0CAAA;EACA,kBAAA;EACA,UAAA;EACA,mBAAA;EACA,sBAAA;AA/BZ;AAiCY;EACI,mBAAA;AA/BhB;AAkCY;EACI,aAAA;AAhChB;AAmCY;EACI,yBAAA;EACA,gBAAA;EACA,mBAAA;EACA,uBAAA;EACA,YAAA;AAjChB;AAmCgB;EACI,iBAAA;EACA,cAAA;AAjCpB;AAsCQ;EACI,cAAA;EACA,kBAAA;EACA,aAAA;EACA,sEAAA;EACA,mBAAA;EACA,eAAA;AApCZ;AAsCY;EACI,cAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;AApChB;AAuCY;EACI,cAAA;EACA,YAAA;AArChB;AAuCgB;EACI,UAAA;AArCpB;AAyCY;EACI,cAAA;EACA,YAAA;AAvChB;AAyCgB;EACI,UAAA;AAvCpB;AA2CY;EACI,cAAA;EACA,YAAA;AAzChB;AA0CgB;EACI,UAAA;AAxCpB;AA4CY;EACI,cAAA;EACA,YAAA;AA1ChB;AA2CgB;EACI,UAAA;AAzCpB;AA6CY;EACI,cAAA;EACA,gBAAA;EACA,UAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;EACA,wCAAA;AA3ChB;AA8CY;EACI,cAAA;EACA,YAAA;AA5ChB;AA8CgB;EACI,UAAA;AA5CpB;AAgDY;EACI,cAAA;AA9ChB;AAiDY;EACI,WAAA;EACA,cAAA;AA/ChB;AAmDQ;EACI,cAAA;EACA,aAAA;EACA,wCAAA;EACA,mBAAA;AAjDZ;AAmDY;EACI,cAAA;EACA,YAAA;AAjDhB;AAmDgB;EACI,UAAA;AAjDpB;AAqDY;EACI,WAAA;EACA,cAAA;AAnDhB;AAuDQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,8CAAA;AArDZ;AAuDY;EACI,cAAA;AArDhB;AAsDgB;EACI,WAAA;EACA,YAAA;EACA,oBAAA;AApDpB;AAwDY;EACI,cAAA;AAtDhB;AAyDY;EACI,cAAA;AAvDhB;AA0DY;EACI,WAAA;EACA,cAAA;AAxDhB;AA4DQ;EACI,uBAAA;EACA,mBAAA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,mBAAA;EACA,YAAA;EACA,eAAA;AA1DZ;AA4DY;EACI,+CAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,aAAA;AA1DhB","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss":
/*!***************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss ***!
  \***************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_64915__) => {

"use strict";
__nested_webpack_require_64915__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_64915__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_64915__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_64915__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_64915__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_64915__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#workbench-canvas {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font: 14px "acumin-pro-condensed";
  cursor: default;
  user-select: none;
  overflow: hidden;
  background-image: linear-gradient(to right, #4f4e4f 1px, transparent 1px), linear-gradient(to bottom, #4f4e4f 1px, transparent 1px);
}
#workbench-canvas #selection-container {
  pointer-events: none;
}
#workbench-canvas #selection-container .selection-box {
  z-index: 10;
  background: rgba(72, 72, 196, 0.5);
  border: blue solid 2px;
}
#workbench-canvas #workbench-container {
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  transform-origin: left top;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
}
#workbench-canvas #workbench-container #frame-container {
  overflow: visible;
  grid-row: 1;
  grid-column: 1;
  position: relative;
  width: 100%;
  height: 100%;
}
#workbench-canvas #workbench-container .frame-box {
  position: absolute;
  background: rgba(72, 72, 72, 0.7);
  display: grid;
  grid-template-rows: 40px calc(100% - 40px);
  grid-template-columns: 100%;
  box-sizing: border-box;
}
#workbench-canvas #workbench-container .frame-box.collapsed {
  height: auto !important;
  width: 200px !important;
  z-index: 3;
}
#workbench-canvas #workbench-container .frame-box.collapsed .frame-box-header {
  font-size: 16px;
  grid-template-columns: calc(100% - 37px) 30px 7px;
}
#workbench-canvas #workbench-container .frame-box.collapsed .frame-box-header .frame-box-header-collapse {
  margin-top: -2px;
}
#workbench-canvas #workbench-container .frame-box.collapsed .frame-box-header .frame-box-header-close {
  display: none;
}
#workbench-canvas #workbench-container .frame-box.collapsed .frame-comments.has-comments .frame-comment-span {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
#workbench-canvas #workbench-container .frame-box .frame-box-border {
  grid-row: 1/span 2;
  grid-column: 1;
  width: 100%;
  height: 100%;
  border: transparent solid 4px;
  pointer-events: none;
  box-sizing: border-box;
}
#workbench-canvas #workbench-container .frame-box .frame-box-header {
  grid-row: 1;
  grid-column: 1;
  background: rgb(72, 72, 72);
  color: white;
  font-size: 24px;
  text-align: center;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: calc(100% - 74px) 30px 7px 30px 7px;
  align-content: center;
  overflow: hidden;
}
#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-button {
  cursor: pointer;
  align-self: center;
  transform-origin: 50% 50%;
  transform: scale(1);
  stroke: transparent;
  fill: white;
  display: grid;
}
#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-button.down {
  transform: scale(0.9);
}
#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-collapse {
  grid-column: 2;
  grid-row: 1;
}
#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-close {
  grid-column: 4;
  grid-row: 1;
}
#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-title {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  height: 100%;
  width: 100%;
  align-self: stretch;
  align-items: center;
  margin-top: -2px;
}
#workbench-canvas #workbench-container .frame-box .frame-comments.has-comments {
  display: grid;
  grid-row: 2;
  grid-column: 1;
  padding: 0 10px;
  font-style: italic;
  word-wrap: break-word;
}
#workbench-canvas #workbench-container .frame-box.selected .frame-box-border {
  border-color: white;
}
#workbench-canvas #workbench-container .frame-box .right-handle {
  grid-area: 1/2/3/2;
  width: 4px;
  background-color: transparent;
  cursor: ew-resize;
}
#workbench-canvas #workbench-container .frame-box .right-handle::after {
  content: "";
  width: 8px;
  position: absolute;
  top: 0;
  bottom: 0;
  margin-left: -4px;
  cursor: ew-resize;
}
#workbench-canvas #workbench-container .frame-box .right-handle.collapsed {
  cursor: pointer;
}
#workbench-canvas #workbench-container .frame-box .top-right-corner-handle {
  background-color: transparent;
  height: 4px;
  z-index: 21;
  cursor: ne-resize;
  width: 4px;
  margin-left: -6px;
}
#workbench-canvas #workbench-container .frame-box .top-right-corner-handle::after {
  background-color: transparent;
  cursor: ne-resize;
  margin-left: unset;
  top: -4px;
  height: 10px;
  width: 10px;
}
#workbench-canvas #workbench-container .frame-box .bottom-right-corner-handle {
  background-color: transparent;
  height: 0px;
  z-index: 21;
  cursor: nw-resize;
  grid-area: 4/2/4/2;
  margin-left: -2px;
}
#workbench-canvas #workbench-container .frame-box .bottom-right-corner-handle::after {
  background-color: transparent;
  height: 10px;
  cursor: nw-resize;
  top: unset;
  bottom: -4px;
  width: 10px;
}
#workbench-canvas #workbench-container .frame-box .left-handle {
  grid-area: 1/1/3/1;
  width: 4px;
  background-color: transparent;
  cursor: ew-resize;
}
#workbench-canvas #workbench-container .frame-box .left-handle::before {
  content: "";
  width: 8px;
  position: absolute;
  top: 0;
  bottom: 0;
  margin-left: -4px;
}
#workbench-canvas #workbench-container .frame-box .top-left-corner-handle {
  background-color: transparent;
  height: 4px;
  z-index: 21;
  cursor: nw-resize;
  width: 4px;
  margin-left: -4px;
}
#workbench-canvas #workbench-container .frame-box .top-left-corner-handle::before {
  background-color: transparent;
  cursor: nw-resize;
  margin-left: unset;
  top: -4px;
  height: 10px;
  width: 10px;
}
#workbench-canvas #workbench-container .frame-box .bottom-left-corner-handle {
  background-color: transparent;
  height: 0px;
  z-index: 21;
  cursor: sw-resize;
  grid-area: 4/1/4/1;
}
#workbench-canvas #workbench-container .frame-box .bottom-left-corner-handle::before {
  background-color: transparent;
  height: 10px;
  cursor: sw-resize;
  top: unset;
  bottom: -4px;
  width: 10px;
}
#workbench-canvas #workbench-container .frame-box .top-handle {
  grid-area: 1/1/1/1;
  background-color: transparent;
  height: 4px;
  cursor: ns-resize;
}
#workbench-canvas #workbench-container .frame-box .top-handle::before {
  content: "";
  width: 100%;
  position: absolute;
  top: -4px;
  bottom: 100%;
  right: 0;
  left: 0;
  margin-bottom: -8px;
  cursor: ns-resize;
  height: 8px;
}
#workbench-canvas #workbench-container .frame-box .bottom-handle {
  grid-area: 3/1/3/1;
  background-color: transparent;
  height: 4px;
  cursor: ns-resize;
}
#workbench-canvas #workbench-container .frame-box .bottom-handle::after {
  content: "";
  width: 100%;
  position: absolute;
  top: 100%;
  bottom: 0;
  right: 0;
  left: 0;
  margin-top: -8px;
  cursor: ns-resize;
  height: 12px;
}
#workbench-canvas #workbench-container .frame-box.collapsed .top-handle,
#workbench-canvas #workbench-container .frame-box.collapsed .top-right-corner-handle,
#workbench-canvas #workbench-container .frame-box.collapsed .right-handle,
#workbench-canvas #workbench-container .frame-box.collapsed .bottom-right-corner-handle,
#workbench-canvas #workbench-container .frame-box.collapsed .bottom-handle,
#workbench-canvas #workbench-container .frame-box.collapsed .bottom-left-corner-handle,
#workbench-canvas #workbench-container .frame-box.collapsed .left-handle,
#workbench-canvas #workbench-container .frame-box.collapsed .top-left-corner-handle {
  cursor: default;
}
#workbench-canvas #workbench-container .frame-box.collapsed .right-handle::after,
#workbench-canvas #workbench-container .frame-box.collapsed .bottom-handle::after,
#workbench-canvas #workbench-container .frame-box.collapsed .top-right-corner-handle::after,
#workbench-canvas #workbench-container .frame-box.collapsed .bottom-right-corner-handle::after {
  cursor: default;
}
#workbench-canvas #workbench-container .frame-box.collapsed .left-handle::before,
#workbench-canvas #workbench-container .frame-box.collapsed .top-handle::before,
#workbench-canvas #workbench-container .frame-box.collapsed .top-left-corner-handle::before,
#workbench-canvas #workbench-container .frame-box.collapsed .bottom-left-corner-handle::before {
  cursor: default;
}
#workbench-canvas #workbench-container #workbench-svg-container {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}
#workbench-canvas #workbench-container #workbench-svg-container .link {
  stroke-width: 4px;
}
#workbench-canvas #workbench-container #workbench-svg-container .link.selected {
  stroke: white !important;
  stroke-dasharray: 10, 2;
}
#workbench-canvas #workbench-container #workbench-svg-container .link.hidden {
  display: none;
}
#workbench-canvas #workbench-container #workbench-svg-container .selection-link {
  pointer-events: all;
  stroke-width: 16px;
  opacity: 0;
  transition: opacity 75ms;
  stroke: transparent;
  cursor: pointer;
}
#workbench-canvas #workbench-container #workbench-svg-container .selection-link.hidden {
  display: none;
}
#workbench-canvas #workbench-container #workbench-svg-container .selection-link:hover, #workbench-canvas #workbench-container #workbench-svg-container .selection-link.selected {
  stroke: white !important;
  opacity: 0.4;
}
#workbench-canvas #workbench-container #workbench-canvas-container {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  width: 100%;
  height: 100%;
}
#workbench-canvas #workbench-container #workbench-canvas-container .visual {
  z-index: 4;
  width: 200px;
  position: absolute;
  left: 0;
  top: 0;
  background: gray;
  border: 4px solid black;
  border-radius: 12px;
  display: grid;
  grid-template-rows: 30px auto;
  grid-template-columns: 100%;
  color: white;
}
#workbench-canvas #workbench-container #workbench-canvas-container .visual.hidden {
  display: none;
}
#workbench-canvas #workbench-container #workbench-canvas-container .visual .comments {
  position: absolute;
  top: -50px;
  width: 200px;
  height: 45px;
  overflow: hidden;
  font-style: italic;
  opacity: 0.8;
  display: grid;
  align-items: flex-end;
  pointer-events: none;
}
#workbench-canvas #workbench-container #workbench-canvas-container .visual .selection-border {
  grid-row: 1/span 3;
  grid-column: 1;
  margin: -4px;
  transition: border-color 100ms;
  border: 4px solid black;
  border-radius: 12px;
}
#workbench-canvas #workbench-container #workbench-canvas-container .visual.selected .selection-border {
  border-color: white;
}
#workbench-canvas #workbench-container #workbench-canvas-container .visual .header {
  grid-row: 1;
  grid-column: 1;
  border: 4px solid black;
  border-top-right-radius: 7px;
  border-top-left-radius: 7px;
  font-size: 16px;
  text-align: center;
  margin-top: -1px;
  margin-left: -1px;
  margin-right: -1px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  background: black;
  color: white;
}
#workbench-canvas #workbench-container #workbench-canvas-container .visual .header.constant {
  border-color: #464348;
  background: #464348;
}
#workbench-canvas #workbench-container #workbench-canvas-container .visual .header.inspector {
  border-color: #66491b;
  background: #66491b;
}`, "",{"version":3,"sources":["webpack://./../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss"],"names":[],"mappings":"AAAA;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,iCAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EAEA,mIAAA;AAAJ;AAEI;EACI,oBAAA;AAAR;AAEQ;EACI,WAAA;EACA,kCAAA;EACA,sBAAA;AAAZ;AAII;EACI,WAAA;EACA,YAAA;EACA,OAAA;EACA,MAAA;EACA,0BAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;AAFR;AAIQ;EACI,iBAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;AAFZ;AAKQ;EACI,kBAAA;EACA,iCAAA;EACA,aAAA;EACA,0CAAA;EACA,2BAAA;EACA,sBAAA;AAHZ;AAKY;EACI,uBAAA;EACA,uBAAA;EACA,UAAA;AAHhB;AAKgB;EACI,eAAA;EACA,iDAAA;AAHpB;AAKoB;EACI,gBAAA;AAHxB;AAMoB;EACI,aAAA;AAJxB;AASoB;EACI,mBAAA;EACA,uBAAA;EACA,gBAAA;AAPxB;AAYY;EACI,kBAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,6BAAA;EACA,oBAAA;EACA,sBAAA;AAVhB;AAaY;EACI,WAAA;EACA,cAAA;EACA,2BAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,aAAA;EACA,wBAAA;EACA,0DAAA;EACA,qBAAA;EACA,gBAAA;AAXhB;AAagB;EACI,eAAA;EACA,kBAAA;EACA,yBAAA;EACA,mBAAA;EACA,mBAAA;EACA,WAAA;EACA,aAAA;AAXpB;AAaoB;EACI,qBAAA;AAXxB;AAegB;EACI,cAAA;EACA,WAAA;AAbpB;AAgBgB;EACI,cAAA;EACA,WAAA;AAdpB;AAiBgB;EACI,cAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,mBAAA;EACA,gBAAA;AAfpB;AAmBY;EACI,aAAA;EACA,WAAA;EACA,cAAA;EACA,eAAA;EACA,kBAAA;EACA,qBAAA;AAjBhB;AAqBgB;EACI,mBAAA;AAnBpB;AAuBY;EACI,kBAAA;EACA,UAAA;EACA,6BAAA;EACA,iBAAA;AArBhB;AAuBgB;EACI,WAAA;EACA,UAAA;EACA,kBAAA;EACA,MAAA;EACA,SAAA;EACA,iBAAA;EACA,iBAAA;AArBpB;AAwBgB;EACI,eAAA;AAtBpB;AA0BY;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,UAAA;EACA,iBAAA;AAxBhB;AA0BgB;EACI,6BAAA;EACA,iBAAA;EACA,kBAAA;EACA,SAAA;EACA,YAAA;EACA,WAAA;AAxBpB;AA4BY;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;EACA,iBAAA;AA1BhB;AA4BgB;EACI,6BAAA;EACA,YAAA;EACA,iBAAA;EACA,UAAA;EACA,YAAA;EACA,WAAA;AA1BpB;AA8BY;EACI,kBAAA;EACA,UAAA;EACA,6BAAA;EACA,iBAAA;AA5BhB;AA8BgB;EACI,WAAA;EACA,UAAA;EACA,kBAAA;EACA,MAAA;EACA,SAAA;EACA,iBAAA;AA5BpB;AAgCY;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,UAAA;EACA,iBAAA;AA9BhB;AAgCgB;EACI,6BAAA;EACA,iBAAA;EACA,kBAAA;EACA,SAAA;EACA,YAAA;EACA,WAAA;AA9BpB;AAkCY;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;AAhChB;AAkCgB;EACI,6BAAA;EACA,YAAA;EACA,iBAAA;EACA,UAAA;EACA,YAAA;EACA,WAAA;AAhCpB;AAoCY;EACI,kBAAA;EACA,6BAAA;EACA,WAAA;EACA,iBAAA;AAlChB;AAoCgB;EACI,WAAA;EACA,WAAA;EACA,kBAAA;EACA,SAAA;EACA,YAAA;EACA,QAAA;EACA,OAAA;EACA,mBAAA;EACA,iBAAA;EACA,WAAA;AAlCpB;AAsCY;EACI,kBAAA;EACA,6BAAA;EACA,WAAA;EACA,iBAAA;AApChB;AAsCgB;EACI,WAAA;EACA,WAAA;EACA,kBAAA;EACA,SAAA;EACA,SAAA;EACA,QAAA;EACA,OAAA;EACA,gBAAA;EACA,iBAAA;EACA,YAAA;AApCpB;AAyCgB;;;;;;;;EAQI,eAAA;AAvCpB;AA8CoB;;;;EACI,eAAA;AAzCxB;AAiDoB;;;;EACI,eAAA;AA5CxB;AAkDQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,oBAAA;EACA,UAAA;AAhDZ;AAkDY;EACI,iBAAA;AAhDhB;AAiDgB;EACI,wBAAA;EACA,uBAAA;AA/CpB;AAkDgB;EACI,aAAA;AAhDpB;AAoDY;EACI,mBAAA;EACA,kBAAA;EACA,UAAA;EACA,wBAAA;EACA,mBAAA;EACA,eAAA;AAlDhB;AAoDgB;EACI,aAAA;AAlDpB;AAqDgB;EAEI,wBAAA;EACA,YAAA;AApDpB;AAyDQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;AAvDZ;AAyDY;EACI,UAAA;EACA,YAAA;EACA,kBAAA;EACA,OAAA;EACA,MAAA;EACA,gBAAA;EACA,uBAAA;EACA,mBAAA;EACA,aAAA;EACA,6BAAA;EACA,2BAAA;EACA,YAAA;AAvDhB;AAyDgB;EACI,aAAA;AAvDpB;AA0DgB;EACI,kBAAA;EACA,UAAA;EACA,YAAA;EACA,YAAA;EACA,gBAAA;EACA,kBAAA;EACA,YAAA;EACA,aAAA;EACA,qBAAA;EACA,oBAAA;AAxDpB;AA2DgB;EACI,kBAAA;EACA,cAAA;EACA,YAAA;EAEA,8BAAA;EAEA,uBAAA;EACA,mBAAA;AA3DpB;AA+DoB;EACI,mBAAA;AA7DxB;AAiEgB;EACI,WAAA;EACA,cAAA;EACA,uBAAA;EACA,4BAAA;EACA,2BAAA;EACA,eAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,iBAAA;EACA,YAAA;AA/DpB;AAiEoB;EACI,qBAAA;EACA,mBAAA;AA/DxB;AAkEoB;EACI,qBAAA;EACA,mBAAA;AAhExB","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/main.scss":
/*!********************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/main.scss ***!
  \********************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_82273__) => {

"use strict";
__nested_webpack_require_82273__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_82273__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_82273__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_82273__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_82273__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_82273__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `:root {
  --blackBarHeight: 55px;
}

#gui-editor-workbench-root {
  display: grid;
  grid-template-rows: calc(100% - 55px);
  height: 100%;
  width: 100%;
  background: #e2e2e2;
  font: 14px "acumin-pro-condensed";
}

.wait-screen {
  display: grid;
  justify-content: center;
  align-content: center;
  height: 100%;
  width: 100%;
  background: #464646;
  opacity: 0.95;
  color: white;
  font: 24px "acumin-pro-condensed";
  position: absolute;
  top: 0;
  left: 0;
}
.wait-screen.hidden {
  visibility: hidden;
}

#leftGrab {
  width: 5px;
  height: 100%;
  cursor: ew-resize;
  position: absolute;
  right: -1px;
  top: 0;
}

#rightGrab {
  cursor: ew-resize;
  width: 5px;
  bottom: 0;
  position: absolute;
  top: 0;
  left: 0;
}

.toolbarGrab {
  background: #333333;
  grid-row: 1/span 3;
  grid-column: 2;
  height: 100%;
  overflow-y: auto;
}
.toolbarGrab .blackLine {
  height: 16px;
  background: black;
  position: relative;
}
.toolbarGrab .arrow {
  color: white;
  position: absolute;
}
.toolbarGrab .toolbar-label {
  color: white;
  font-size: 18px;
  display: grid;
  align-items: center;
  cursor: pointer;
  user-select: none;
  grid-template-columns: 1fr 20px;
  grid-template-rows: 100%;
  position: relative;
}
.toolbarGrab .toolbar-label.active {
  font-weight: bold;
  font-size: 20px;
}
.toolbarGrab .toolbar-label:hover {
  background: var(--selectionGrey);
}
.toolbarGrab .toolbar-label:hover .sub-items {
  display: block;
}
.toolbarGrab .toolbar-icon {
  width: 40px;
  height: 40px;
}
.toolbarGrab.expanded .toolbar-content-sub1 {
  column-count: 2;
}

.diagram-container {
  position: relative;
  display: grid;
  grid-row: 1;
  grid-column: 2;
  background: #cccccc;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.diagram-container .diagram {
  display: none;
  width: 100%;
  height: 100%;
}

.left-panel {
  grid-row: 1/span 2;
  grid-column: 1;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 1fr 50px;
  position: relative;
  overflow: hidden;
}
.left-panel.expand {
  grid-template-columns: 1fr 100px;
}

.right-panel {
  grid-row: 1/span 2;
  grid-column: 3;
  display: grid;
  grid-template-rows: 1fr 40px auto 40px;
  grid-template-columns: 100%;
  overflow-y: auto;
  position: relative;
}
.right-panel #propertyTab {
  grid-row: 1;
  grid-column: 1;
}
.right-panel .button {
  display: grid;
  justify-content: center;
  align-content: center;
  height: auto;
  width: 14.2857142857%;
  cursor: pointer;
}
.right-panel .button:hover {
  background: rgb(51, 122, 183);
  color: white;
  opacity: 0.8;
}
.right-panel .button.selected {
  background: rgb(51, 122, 183);
  color: white;
}
.right-panel .button.align {
  justify-content: stretch;
  text-align: center;
}

.blocker {
  visibility: hidden;
  position: absolute;
  width: calc(100% - 40px);
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(20, 20, 20, 0.95);
  font-family: "acumin-pro-condensed", sans-serif;
  color: white;
  font-size: 24px;
  display: grid;
  align-content: center;
  justify-content: center;
  user-select: none;
  padding: 20px;
  text-align: center;
}

#log-console {
  grid-row: 2;
  grid-column: 4;
  display: none;
}

.gizmo * {
  user-select: none;
}
.gizmo .bounding-box-line {
  background-color: black;
  position: absolute;
  line-height: 1px;
  height: 1px;
  pointer-events: none;
}
.gizmo .scale-point-container {
  position: absolute;
  width: 30px;
  height: 30px;
}
.gizmo .scale-point-container .scale-point {
  top: 10px;
  left: 10px;
  position: absolute;
  width: 10px;
  height: 10px;
  background: transparent;
  outline: rgb(125, 125, 125) 2px solid;
}
.gizmo .scale-point-container .rotate-click-area {
  width: 20px;
  height: 20px;
  position: absolute;
}
.gizmo .scale-point-container .scale-click-area {
  width: 20px;
  height: 20px;
  position: absolute;
}
.gizmo .pivot-point {
  width: 30px;
  height: 30px;
  background: transparent;
  position: absolute;
}

#workbench-canvas {
  position: relative;
}

.artboard-stroke {
  outline: 1px solid black;
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.artboard-background {
  position: absolute;
  background: repeating-conic-gradient(#e2e2e2 0% 25%, white 0% 50%) 50%/10px 10px;
  width: 100%;
  height: 100%;
}`, "",{"version":3,"sources":["webpack://./../../../tools/guiEditor/dist/main.scss"],"names":[],"mappings":"AAAA;EACI,sBAAA;AACJ;;AAEA;EACI,aAAA;EACA,qCAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,iCAAA;AACJ;;AAEA;EACI,aAAA;EACA,uBAAA;EACA,qBAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,aAAA;EACA,YAAA;EACA,iCAAA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;AACJ;AACI;EACI,kBAAA;AACR;;AAGA;EACI,UAAA;EACA,YAAA;EACA,iBAAA;EACA,kBAAA;EACA,WAAA;EACA,MAAA;AAAJ;;AAGA;EACI,iBAAA;EACA,UAAA;EACA,SAAA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;AAAJ;;AAGA;EACI,mBAAA;EACA,kBAAA;EACA,cAAA;EACA,YAAA;EACA,gBAAA;AAAJ;AAEI;EACI,YAAA;EACA,iBAAA;EACA,kBAAA;AAAR;AAEI;EACI,YAAA;EACA,kBAAA;AAAR;AAEI;EACI,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,+BAAA;EACA,wBAAA;EACA,kBAAA;AAAR;AAEQ;EACI,iBAAA;EACA,eAAA;AAAZ;AAGQ;EACI,gCAAA;AADZ;AAEY;EACI,cAAA;AAAhB;AAII;EACI,WAAA;EACA,YAAA;AAFR;AAKQ;EACI,eAAA;AAHZ;;AAQA;EACI,kBAAA;EACA,aAAA;EACA,WAAA;EACA,cAAA;EACA,mBAAA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;AALJ;AAOI;EACI,aAAA;EACA,WAAA;EACA,YAAA;AALR;;AASA;EACI,kBAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,+BAAA;EACA,kBAAA;EACA,gBAAA;AANJ;AAOI;EACI,gCAAA;AALR;;AASA;EACI,kBAAA;EACA,cAAA;EACA,aAAA;EACA,sCAAA;EACA,2BAAA;EACA,gBAAA;EACA,kBAAA;AANJ;AAQI;EACI,WAAA;EACA,cAAA;AANR;AASI;EACI,aAAA;EACA,uBAAA;EACA,qBAAA;EACA,YAAA;EACA,qBAAA;EACA,eAAA;AAPR;AASQ;EACI,6BAAA;EACA,YAAA;EACA,YAAA;AAPZ;AAUQ;EACI,6BAAA;EACA,YAAA;AARZ;AAWQ;EACI,wBAAA;EACA,kBAAA;AATZ;;AAcA;EACI,kBAAA;EACA,kBAAA;EACA,wBAAA;EACA,YAAA;EACA,MAAA;EACA,OAAA;EAEA,kCAAA;EACA,+CAAA;EACA,YAAA;EACA,eAAA;EAEA,aAAA;EACA,qBAAA;EACA,uBAAA;EAEA,iBAAA;EAEA,aAAA;EACA,kBAAA;AAfJ;;AAkBA;EACI,WAAA;EACA,cAAA;EACA,aAAA;AAfJ;;AAmBI;EACI,iBAAA;AAhBR;AAkBI;EACI,uBAAA;EACA,kBAAA;EACA,gBAAA;EACA,WAAA;EACA,oBAAA;AAhBR;AAkBI;EACI,kBAAA;EACA,WAAA;EACA,YAAA;AAhBR;AAiBQ;EACI,SAAA;EACA,UAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;EACA,uBAAA;EACA,qCAAA;AAfZ;AAiBQ;EACI,WAAA;EACA,YAAA;EACA,kBAAA;AAfZ;AAiBQ;EACI,WAAA;EACA,YAAA;EACA,kBAAA;AAfZ;AAkBI;EACI,WAAA;EACA,YAAA;EACA,uBAAA;EACA,kBAAA;AAhBR;;AAmBA;EACI,kBAAA;AAhBJ;;AAkBA;EACI,wBAAA;EACA,kBAAA;EACA,UAAA;EACA,oBAAA;AAfJ;;AAiBA;EACI,kBAAA;EACA,gFAAA;EACA,WAAA;EACA,YAAA;AAdJ","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/commandBar.scss":
/*!*******************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/commandBar.scss ***!
  \*******************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_91176__) => {

"use strict";
__nested_webpack_require_91176__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_91176__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_91176__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_91176__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_91176__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_91176__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `:root {
  --selectionGrey: #666666;
}

.ge-commands {
  grid-row: 1;
  grid-column: 1;
  user-select: none;
}
.ge-commands * {
  font-family: "acumin-pro-condensed";
  font-weight: 600;
  font-size: 12px;
}
.ge-commands .copy {
  display: none;
}
.ge-commands .commands-left {
  float: left;
  display: flex;
}
.ge-commands .commands-right {
  float: right;
  display: flex;
}
.ge-commands .commands-right .beta-flag {
  height: 30px;
  position: relative;
  left: -15px;
}
.ge-commands.background-ts .command-button img,
.ge-commands.background-ts .command-dropdown img {
  filter: invert(64%) sepia(78%) saturate(940%) hue-rotate(323deg) brightness(105%) contrast(103%);
}
.ge-commands.background-ts .command-button .command-dropdown-active,
.ge-commands.background-ts .command-dropdown .command-dropdown-active {
  color: #333333;
}
.ge-commands.background-ts .command-button:hover img, .ge-commands.background-ts .command-button.activated img,
.ge-commands.background-ts .command-dropdown:hover img,
.ge-commands.background-ts .command-dropdown.activated img {
  filter: invert(34%) sepia(21%) saturate(3832%) hue-rotate(324deg) brightness(88%) contrast(82%) !important;
}
.ge-commands.background-js .command-button img,
.ge-commands.background-js .command-dropdown img {
  filter: invert(57%) sepia(80%) saturate(2031%) hue-rotate(215deg);
}
.ge-commands.background-js .command-button .command-dropdown-active,
.ge-commands.background-js .command-dropdown .command-dropdown-active {
  color: #333333;
}
.ge-commands.background-js .command-button:hover img, .ge-commands.background-js .command-button.activated img,
.ge-commands.background-js .command-dropdown:hover img,
.ge-commands.background-js .command-dropdown.activated img {
  filter: invert(17%) !important;
}
.ge-commands .command-button {
  cursor: pointer;
  width: 55px;
  height: 55px;
}
.ge-commands .command-button .command-label {
  display: none;
}
.ge-commands .command-button .command-button-icon {
  height: 100%;
  width: 100%;
  display: grid;
  color: white;
  align-content: center;
  justify-content: center;
}
.ge-commands .command-button .active {
  transform-origin: center;
  background-color: var(--selectionGrey);
}
.ge-commands .command-button img.active {
  background-color: var(--selectionGrey);
}
.ge-commands .command-button:hover {
  background-color: var(--selectionGrey);
}
.ge-commands .copyAndDeleteDisabled {
  pointer-events: none;
  color: black;
}
.ge-commands .pasteDisabled {
  pointer-events: none;
  color: black;
}
.ge-commands .command-dropdown-root {
  position: relative;
  text-transform: uppercase;
  z-index: 1;
}
.ge-commands .command-dropdown {
  cursor: pointer;
  width: 55px;
  height: 55px;
}
.ge-commands .command-dropdown .command-dropdown-icon {
  height: 100%;
  width: 100%;
  display: grid;
  align-content: center;
  justify-content: center;
}
.ge-commands .command-dropdown .command-dropdown-active {
  height: 100%;
  width: 100%;
  display: grid;
  align-content: center;
  justify-content: center;
  font-size: 14px;
}
.ge-commands .command-dropdown:hover, .ge-commands .command-dropdown.activated {
  background-color: #666666;
  color: black;
}
.ge-commands .command-dropdown:active {
  transform-origin: center;
  transform: scale(0.95);
}
.ge-commands .command-dropdown-blocker {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scale(1);
  z-index: 1;
}
.ge-commands.background-js .command-dropdown-content {
  background: #333333;
}
.ge-commands.background-js .command-dropdown-content .command-dropdown-label:hover {
  background: #333333;
}
.ge-commands.background-ts .command-dropdown-content .command-dropdown-label:hover {
  background: #333333;
}
.ge-commands .command-dropdown-content {
  background: #333333;
  position: absolute;
  top: 55px;
  width: 55px;
  transform: scale(1);
}
.ge-commands .command-dropdown-content.toRight {
  width: 120px;
}
.ge-commands .command-dropdown-content .command-dropdown-label {
  color: white;
  padding: 5px;
  padding-left: 7px;
  height: 35px;
  font-size: 18px;
  display: grid;
  align-items: center;
  cursor: pointer;
  user-select: none;
  grid-template-columns: 1fr 20px;
  grid-template-rows: 100%;
  position: relative;
}
.ge-commands .command-dropdown-content .command-dropdown-label.active {
  font-weight: bold;
  font-size: 20px;
}
.ge-commands .command-dropdown-content .command-dropdown-label:hover {
  background: var(--selectionGrey);
}
.ge-commands .command-dropdown-content .command-dropdown-label:hover .sub-items {
  display: block;
}
.ge-commands .command-dropdown-content .command-dropdown-label .command-dropdown-label-text {
  font-size: 12px;
  grid-column: 1;
  grid-row: 1;
}
.ge-commands .command-dropdown-content .command-dropdown-label .command-dropdown-label-check {
  grid-column: 2;
  grid-row: 1;
}
.ge-commands .command-dropdown-content .command-dropdown-label .command-dropdown-arrow {
  grid-column: 2;
  grid-row: 1;
  font-size: 20px;
  font-weight: bold;
  padding-bottom: 10px;
  padding-left: 4px;
}
.ge-commands .command-dropdown-content .command-dropdown-label .sub-items {
  position: absolute;
  left: 200px;
  top: 0;
  width: 150px;
  display: none;
}
.ge-commands .command-dropdown-content .command-dropdown-label .sub-items.background-js {
  background: #bfabff;
}
.ge-commands .command-dropdown-content .command-dropdown-label .sub-items.background-js .sub-item:hover {
  background-color: #333333;
  color: white;
}
.ge-commands .command-dropdown-content .command-dropdown-label .sub-items.background-ts {
  background: #333333;
}
.ge-commands .command-dropdown-content .command-dropdown-label .sub-items.background-ts .sub-item:hover {
  background-color: #333333;
  color: white;
}
.ge-commands .command-dropdown-content .command-dropdown-label .sub-items .sub-item {
  color: white;
  padding: 5px;
  padding-left: 10px;
  height: 35px;
  display: grid;
}
.ge-commands .command-dropdown-content .command-dropdown-label .sub-items .sub-item.checked {
  background: white;
  color: black;
}
.ge-commands .command-dropdown-content .buttonLine {
  color: white;
  padding: 5px;
  padding-left: 7px;
  height: 35px;
  font-size: 18px;
  display: grid;
  align-items: center;
  cursor: pointer;
  user-select: none;
  grid-template-columns: 1fr 20px;
  grid-template-rows: 100%;
  position: relative;
  font-size: 12px;
  grid-column: 1;
  grid-row: 1;
}
.ge-commands .command-dropdown-content .buttonLine input[type=file] {
  display: none;
}
.ge-commands .command-dropdown-content .buttonLine.active {
  font-weight: bold;
  font-size: 20px;
  cursor: pointer;
}
.ge-commands .command-dropdown-content .buttonLine:hover {
  background: var(--selectionGrey);
  cursor: pointer;
}
.ge-commands .command-dropdown-content .buttonLine:hover .sub-items {
  display: block;
}
.ge-commands .command-dropdown-content .buttonLine .file-upload {
  cursor: pointer;
}
.ge-commands .divider {
  display: flex;
  align-items: center;
  border-right: 1px solid black;
  color: white;
}
.ge-commands .divider:last-of-type {
  border-right: none;
}
.ge-commands .divider.padded {
  padding-left: 10px;
  padding-right: 10px;
}
.ge-commands .floatLine,
.ge-commands .checkBoxLine {
  display: flex;
  align-items: center;
}
.ge-commands .floatLine .copy,
.ge-commands .checkBoxLine .copy {
  display: none;
}
.ge-commands .checkBoxLine .icon {
  filter: brightness(10);
}
.ge-commands .checkBoxLine .hidden {
  display: none;
}
.ge-commands .checkBoxLine .checkBox {
  height: 40px;
}
.ge-commands .checkBoxLine .copy {
  display: none;
}
.ge-commands .color3Line {
  display: grid;
}
.ge-commands .color3Line .firstLine {
  display: flex;
  align-items: center;
}
.ge-commands .color3Line .firstLine .label {
  padding-right: 5px;
}
.ge-commands .color3Line .firstLine .floatLine .value {
  padding-left: 2px;
}
.ge-commands .color3Line .firstLine .copy {
  display: none;
}
.ge-commands .color3Line .firstLine .expand {
  display: none;
}
.ge-commands .color3Line .secondLine {
  display: grid;
  padding-right: 5px;
  border-left: 1px solid rgb(51, 122, 183);
}
.ge-commands .color3Line .secondLine .numeric {
  display: grid;
  grid-template-columns: 1fr auto;
}
.ge-commands .color3Line .secondLine .numeric-label {
  text-align: right;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-self: right;
  margin-right: 10px;
}
.ge-commands .color3Line .secondLine .numeric-value {
  width: 120px;
  grid-column: 2;
  display: flex;
  align-items: center;
  border: 1px solid rgb(51, 122, 183);
}
.ge-commands .color-picker {
  height: 26px;
  width: 26px;
}
.ge-commands .color-picker .color-rect-background {
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  border: 1px solid white;
  cursor: pointer;
  background: repeating-conic-gradient(#e2e2e2 0% 25%, white 0% 50%) 50%/100% 100%;
}
.ge-commands .color-picker .color-rect-background .color-rect {
  height: 100%;
}
.ge-commands .color-picker .color-picker-cover {
  position: fixed;
  top: 0px;
  right: 0px;
  bottom: 0px;
  left: 0px;
  z-index: 2;
}
.ge-commands .color-picker .color-picker-float {
  position: absolute;
  outline: 1px solid black;
}
.ge-commands .color-picker .color-picker-container {
  background-color: #e2e2e2;
}
.ge-commands .color-picker input:focus {
  outline-color: black;
}
.ge-commands .floatLine input,
.ge-commands .listLine select {
  background-color: #000000;
  color: white;
  padding: 5px;
  border: none;
}
.ge-commands input,
.ge-commands .listLine select {
  outline-color: transparent;
  outline-width: 1px;
  outline-offset: -1px;
  outline-style: solid;
  transition: 0.2s outline;
  border: none;
}
.ge-commands .floatLine .value {
  position: relative;
  margin: 5px;
}
.ge-commands .floatLine input:focus {
  outline-color: white;
}
.ge-commands .listLine select {
  width: 150px;
}
.ge-commands .hasArrows .arrows {
  display: none;
  position: absolute;
  right: 0;
  top: 0;
  flex-direction: column;
  cursor: grab;
  filter: brightness(10);
}
.ge-commands .hasArrows .arrows .downArrowIcon,
.ge-commands .hasArrows .arrows .upArrowIcon {
  width: 13px;
  height: 13px;
}
.ge-commands .hasArrows:hover .arrows, .ge-commands .hasArrows:focus .arrows, .ge-commands .hasArrows.dragging .arrows {
  display: flex;
}
.ge-commands .hasArrows .arrows:hover {
  background-color: var(--buttonHoverBackground);
  filter: none;
}
.ge-commands .hasArrows.dragging .arrows {
  background-color: var(--buttonPressedBackground);
}
.ge-commands .hasArrows.dragging .arrows .downArrowIcon,
.ge-commands .hasArrows.dragging .arrows .upArrowIcon {
  filter: none;
}
.ge-commands .hasArrows input::-webkit-outer-spin-button,
.ge-commands .hasArrows input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ge-commands .hasArrows input[type=number] {
  -moz-appearance: textfield;
}`, "",{"version":3,"sources":["webpack://./../../../tools/guiEditor/dist/scss/commandBar.scss"],"names":[],"mappings":"AAAA;EACI,wBAAA;AACJ;;AAEA;EACI,WAAA;EACA,cAAA;EACA,iBAAA;AACJ;AAAI;EACI,mCAAA;EACA,gBAAA;EACA,eAAA;AAER;AACI;EACI,aAAA;AACR;AAEI;EACI,WAAA;EACA,aAAA;AAAR;AAGI;EACI,YAAA;EACA,aAAA;AADR;AAEQ;EACI,YAAA;EACA,kBAAA;EACA,WAAA;AAAZ;AAOY;;EACI,gGAAA;AAJhB;AAOY;;EACI,cAAA;AAJhB;AASgB;;;EACI,0GAAA;AALpB;AAcY;;EACI,iEAAA;AAXhB;AAcY;;EACI,cAAA;AAXhB;AAgBgB;;;EACI,8BAAA;AAZpB;AAkBI;EACI,eAAA;EACA,WAAA;EACA,YAAA;AAhBR;AAkBQ;EACI,aAAA;AAhBZ;AAmBQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,qBAAA;EACA,uBAAA;AAjBZ;AAoBQ;EACI,wBAAA;EACA,sCAAA;AAlBZ;AAsBY;EACI,sCAAA;AApBhB;AAwBI;EACI,sCAAA;AAtBR;AAwBI;EACI,oBAAA;EACA,YAAA;AAtBR;AAwBI;EACI,oBAAA;EACA,YAAA;AAtBR;AAwBI;EACI,kBAAA;EACA,yBAAA;EACA,UAAA;AAtBR;AAyBI;EACI,eAAA;EACA,WAAA;EACA,YAAA;AAvBR;AAyBQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AAvBZ;AA0BQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;EACA,eAAA;AAxBZ;AA2BQ;EAEI,yBAAA;EACA,YAAA;AA1BZ;AA6BQ;EACI,wBAAA;EACA,sBAAA;AA3BZ;AA+BI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,UAAA;AA7BR;AAiCQ;EACI,mBAAA;AA/BZ;AAiCgB;EACI,mBAAA;AA/BpB;AAwCgB;EACI,mBAAA;AAtCpB;AA4CI;EACI,mBAAA;EACA,kBAAA;EACA,SAAA;EACA,WAAA;EACA,mBAAA;AA1CR;AA4CQ;EACI,YAAA;AA1CZ;AA6CQ;EACI,YAAA;EACA,YAAA;EACA,iBAAA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,+BAAA;EACA,wBAAA;EACA,kBAAA;AA3CZ;AA6CY;EACI,iBAAA;EACA,eAAA;AA3ChB;AA8CY;EACI,gCAAA;AA5ChB;AA6CgB;EACI,cAAA;AA3CpB;AA+CY;EACI,eAAA;EACA,cAAA;EACA,WAAA;AA7ChB;AAgDY;EACI,cAAA;EACA,WAAA;AA9ChB;AAiDY;EACI,cAAA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;EACA,oBAAA;EACA,iBAAA;AA/ChB;AAkDY;EACI,kBAAA;EACA,WAAA;EACA,MAAA;EACA,YAAA;EACA,aAAA;AAhDhB;AAkDgB;EACI,mBAAA;AAhDpB;AAkDwB;EACI,yBAAA;EACA,YAAA;AAhD5B;AAqDgB;EACI,mBAAA;AAnDpB;AAqDwB;EACI,yBAAA;EACA,YAAA;AAnD5B;AAwDgB;EACI,YAAA;EACA,YAAA;EACA,kBAAA;EACA,YAAA;EACA,aAAA;AAtDpB;AAwDoB;EACI,iBAAA;EACA,YAAA;AAtDxB;AA4DQ;EACI,YAAA;EACA,YAAA;EACA,iBAAA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,+BAAA;EACA,wBAAA;EACA,kBAAA;EACA,eAAA;EACA,cAAA;EACA,WAAA;AA1DZ;AA2DY;EACI,aAAA;AAzDhB;AA4DY;EACI,iBAAA;EACA,eAAA;EACA,eAAA;AA1DhB;AA6DY;EACI,gCAAA;EACA,eAAA;AA3DhB;AA4DgB;EACI,cAAA;AA1DpB;AA8DY;EACI,eAAA;AA5DhB;AAiEI;EACI,aAAA;EACA,mBAAA;EACA,6BAAA;EACA,YAAA;AA/DR;AAgEQ;EACI,kBAAA;AA9DZ;AAgEQ;EACI,kBAAA;EACA,mBAAA;AA9DZ;AAkEI;;EAEI,aAAA;EACA,mBAAA;AAhER;AAkEQ;;EACI,aAAA;AA/DZ;AAoEQ;EACI,sBAAA;AAlEZ;AAqEQ;EACI,aAAA;AAnEZ;AAsEQ;EACI,YAAA;AApEZ;AAuEQ;EACI,aAAA;AArEZ;AAyEI;EACI,aAAA;AAvER;AAyEQ;EACI,aAAA;EACA,mBAAA;AAvEZ;AAyEY;EACI,kBAAA;AAvEhB;AA2EgB;EACI,iBAAA;AAzEpB;AA6EY;EACI,aAAA;AA3EhB;AA8EY;EACI,aAAA;AA5EhB;AAgFQ;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AA9EZ;AAgFY;EACI,aAAA;EACA,+BAAA;AA9EhB;AAiFY;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AA/EhB;AAkFY;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AAhFhB;AAqFI;EACI,YAAA;EACA,WAAA;AAnFR;AAqFQ;EACI,uBAAA;EACA,wBAAA;EACA,uBAAA;EACA,eAAA;EACA,gFAAA;AAnFZ;AAoFY;EACI,YAAA;AAlFhB;AAsFQ;EACI,eAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,UAAA;AApFZ;AAuFQ;EACI,kBAAA;EACA,wBAAA;AArFZ;AAwFQ;EACI,yBAAA;AAtFZ;AAyFQ;EACI,oBAAA;AAvFZ;AA2FI;;EAEI,yBAAA;EACA,YAAA;EACA,YAAA;EACA,YAAA;AAzFR;AA4FI;;EAEI,0BAAA;EACA,kBAAA;EACA,oBAAA;EACA,oBAAA;EACA,wBAAA;EACA,YAAA;AA1FR;AA6FI;EACI,kBAAA;EACA,WAAA;AA3FR;AA8FI;EACI,oBAAA;AA5FR;AA+FI;EACI,YAAA;AA7FR;AAiGQ;EACI,aAAA;EACA,kBAAA;EACA,QAAA;EACA,MAAA;EACA,sBAAA;EACA,YAAA;EACA,sBAAA;AA/FZ;AAgGY;;EAEI,WAAA;EACA,YAAA;AA9FhB;AAiGQ;EAGI,aAAA;AAjGZ;AAmGQ;EACI,8CAAA;EACA,YAAA;AAjGZ;AAmGQ;EACI,gDAAA;AAjGZ;AAkGY;;EAEI,YAAA;AAhGhB;AAoGI;;EAEI,wBAAA;EACA,SAAA;AAlGR;AAqGI;EACI,0BAAA;AAnGR","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/header.scss":
/*!***************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/header.scss ***!
  \***************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_108225__) => {

"use strict";
__nested_webpack_require_108225__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_108225__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_108225__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_108225__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_108225__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_108225__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#ge-header {
  width: 100%;
  grid-column: 2/4;
  grid-row: 1;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 100%;
  background: #333333;
}
#ge-header .command-bar {
  padding-left: 15px;
  grid-row: 1;
  grid-column: 2;
  width: 100%;
}
#ge-header .command-bar .language-button {
  grid-row: 1;
  grid-column: 2;
  color: white;
  width: 144px;
  font-size: 18px;
  text-align: center;
  display: grid;
  align-content: center;
  border-top-left-radius: 14px;
  transform: scale(1);
  user-select: none;
}
#ge-header .command-bar .language-button.active {
  width: 74px;
  cursor: pointer;
  grid-column: 1;
  margin-right: -5px;
  transform: translateX(10px);
}`, "",{"version":3,"sources":["webpack://./../../../tools/guiEditor/dist/scss/header.scss"],"names":[],"mappings":"AAAA;EACI,WAAA;EACA,gBAAA;EACA,WAAA;EACA,UAAA;EACA,SAAA;EACA,aAAA;EACA,+BAAA;EACA,wBAAA;EACA,mBAAA;AACJ;AACI;EACI,kBAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;AACR;AACQ;EACI,WAAA;EACA,cAAA;EACA,YAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,aAAA;EACA,qBAAA;EACA,4BAAA;EACA,mBAAA;EACA,iBAAA;AACZ;AACY;EACI,WAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,2BAAA;AAChB","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Button.module.scss":
/*!***********************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Button.module.scss ***!
  \***********************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_111989__) => {

"use strict";
__nested_webpack_require_111989__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_111989__.d(__nested_webpack_exports__, {
/* harmony export */   active: () => (/* binding */ active),
/* harmony export */   button: () => (/* binding */ button),
/* harmony export */   dark: () => (/* binding */ dark),
/* harmony export */   "dark-active-background": () => (/* binding */ _6),
/* harmony export */   "dark-background": () => (/* binding */ _5),
/* harmony export */   "dark-color": () => (/* binding */ _7),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   light: () => (/* binding */ light),
/* harmony export */   "light-active-background": () => (/* binding */ _2),
/* harmony export */   "light-background": () => (/* binding */ _1),
/* harmony export */   "light-color": () => (/* binding */ _4),
/* harmony export */   "light-disabled-background": () => (/* binding */ _3),
/* harmony export */   small: () => (/* binding */ small),
/* harmony export */   smaller: () => (/* binding */ smaller),
/* harmony export */   wide: () => (/* binding */ wide)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_111989__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_111989__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_111989__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_111989__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_Fonts_scss__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_111989__(/*! -!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./Fonts.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../dev/sharedUiComponents/dist/components/Fonts.scss");
// Imports



var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_Fonts_scss__WEBPACK_IMPORTED_MODULE_2__["default"], "", true);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.\\---------dev-sharedUiComponents-dist-components-Button-module__button {
  width: 55px;
  height: 55px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0;
}
.\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__wide {
  width: 120px;
  height: 45px;
  justify-content: start;
}
.\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__small {
  width: 30px;
  height: 30px;
}
.\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__smaller {
  width: 25px;
  height: 25px;
}
.\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__light {
  background-color: #E2E2E2;
  color: #333333;
}
.\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__light:hover, .\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__light.\\---------dev-sharedUiComponents-dist-components-Button-module__active {
  background-color: #FFFFFF;
}
.\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__light:disabled {
  background-color: #FFFFFF;
}
.\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__dark {
  background-color: #333333;
  color: #FFFFFF;
}
.\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__dark:hover, .\\---------dev-sharedUiComponents-dist-components-Button-module__button.\\---------dev-sharedUiComponents-dist-components-Button-module__dark.\\---------dev-sharedUiComponents-dist-components-Button-module__active {
  background-color: #666666;
}`, "",{"version":3,"sources":["webpack://./../../../dev/sharedUiComponents/dist/components/Button.module.scss"],"names":[],"mappings":"AACA;EAEI,WAAA;EACA,YAAA;EACA,YAAA;EACA,oBAAA;EACA,mBAAA;EACA,uBAAA;EACA,YAAA;AAOJ;AANI;EACI,YAAA;EACA,YAAA;EACA,sBAAA;AAQR;AANI;EACI,WAAA;EACA,YAAA;AAQR;AANI;EACI,WAAA;EACA,YAAA;AAQR;AANI;EACI,yBAAA;EACA,cAAA;AAQR;AAPQ;EAEI,yBAAA;AAQZ;AANQ;EACI,yBAAA;AAQZ;AALI;EACI,yBAAA;EACA,cAAA;AAOR;AANQ;EAEI,yBAAA;AAOZ","sourceRoot":""}]);
// Exports
var _1 = `#E2E2E2`;

var _2 = `#FFFFFF`;

var _3 = `#C8C8C8`;

var _4 = `#FFFFFF`;

var _5 = `#333333`;

var _6 = `#666666`;

var _7 = `#333333`;

var button = `---------dev-sharedUiComponents-dist-components-Button-module__button ${_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_Fonts_scss__WEBPACK_IMPORTED_MODULE_2__.fontRegular}`;
var wide = `---------dev-sharedUiComponents-dist-components-Button-module__wide`;
var small = `---------dev-sharedUiComponents-dist-components-Button-module__small`;
var smaller = `---------dev-sharedUiComponents-dist-components-Button-module__smaller`;
var light = `---------dev-sharedUiComponents-dist-components-Button-module__light`;
var active = `---------dev-sharedUiComponents-dist-components-Button-module__active`;
var dark = `---------dev-sharedUiComponents-dist-components-Button-module__dark`;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Icon.module.scss":
/*!*********************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Icon.module.scss ***!
  \*********************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_119468__) => {

"use strict";
__nested_webpack_require_119468__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_119468__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   light: () => (/* binding */ light)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_119468__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_119468__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_119468__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_119468__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.\\---------dev-sharedUiComponents-dist-components-Icon-module__light {
  filter: brightness(10);
}`, "",{"version":3,"sources":["webpack://./../../../dev/sharedUiComponents/dist/components/Icon.module.scss"],"names":[],"mappings":"AAAA;EACI,sBAAA;AACJ","sourceRoot":""}]);
// Exports
var light = `---------dev-sharedUiComponents-dist-components-Icon-module__light`;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/MessageDialog.module.scss":
/*!******************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/MessageDialog.module.scss ***!
  \******************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_122478__) => {

"use strict";
__nested_webpack_require_122478__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_122478__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   dialog: () => (/* binding */ dialog),
/* harmony export */   "dialog-button-ok": () => (/* binding */ _4),
/* harmony export */   "dialog-buttons": () => (/* binding */ _3),
/* harmony export */   "dialog-container": () => (/* binding */ _1),
/* harmony export */   "dialog-message": () => (/* binding */ _2),
/* harmony export */   error: () => (/* binding */ error)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_122478__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_122478__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_122478__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_122478__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-container {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0.1, 0.1, 0.1, 0.6);
  display: grid;
  font-family: "acumin-pro";
  top: 0;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog {
  align-self: center;
  justify-self: center;
  min-height: 140px;
  max-width: 400px;
  border-radius: 10px;
  background: white;
  padding: 10px;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 1fr 50px;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-message {
  grid-row: 1;
  grid-column: 1;
  margin-top: 20px;
  padding: 10px;
  font-size: 18px;
  color: black;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-buttons {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
  color: white;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-buttons .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-button-ok {
  cursor: pointer;
  justify-self: center;
  background: green;
  min-width: 80px;
  justify-content: center;
  display: grid;
  align-content: center;
  align-self: center;
  height: 35px;
  border-radius: 10px;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-buttons .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-button-ok:hover {
  opacity: 0.8;
}
.\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-buttons .\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-button-ok.\\---------dev-sharedUiComponents-dist-components-MessageDialog-module__error {
  background: red;
}`, "",{"version":3,"sources":["webpack://./../../../dev/sharedUiComponents/dist/components/MessageDialog.module.scss"],"names":[],"mappings":"AAAA;EACI,kBAAA;EACA,WAAA;EACA,YAAA;EACA,oCAAA;EACA,aAAA;EACA,yBAAA;EACA,MAAA;AACJ;AACI;EACI,kBAAA;EACA,oBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,iBAAA;EACA,aAAA;EAEA,aAAA;EACA,2BAAA;EACA,4BAAA;AAAR;AAEQ;EACI,WAAA;EACA,cAAA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,YAAA;AAAZ;AAGQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;EACA,YAAA;AADZ;AAGY;EACI,eAAA;EACA,oBAAA;EACA,iBAAA;EACA,eAAA;EACA,uBAAA;EACA,aAAA;EACA,qBAAA;EACA,kBAAA;EACA,YAAA;EACA,mBAAA;AADhB;AAGgB;EACI,YAAA;AADpB;AAIgB;EACI,eAAA;AAFpB","sourceRoot":""}]);
// Exports
var _1 = `---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-container`;

var dialog = `---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog`;
var _2 = `---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-message`;

var _3 = `---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-buttons`;

var _4 = `---------dev-sharedUiComponents-dist-components-MessageDialog-module__dialog-button-ok`;

var error = `---------dev-sharedUiComponents-dist-components-MessageDialog-module__error`;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.module.scss":
/*!************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.module.scss ***!
  \************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_129523__) => {

"use strict";
__nested_webpack_require_129523__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_129523__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   input: () => (/* binding */ input),
/* harmony export */   invalid: () => (/* binding */ invalid),
/* harmony export */   line: () => (/* binding */ line),
/* harmony export */   valid: () => (/* binding */ valid)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_129523__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_129523__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_129523__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_129523__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.\\---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-module__line {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.\\---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-module__input {
  border: unset;
  background-color: inherit;
  flex-grow: 1;
  width: 100px;
}

.\\---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-module__valid {
  background-color: white;
}

.\\---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-module__invalid {
  background-color: rgba(255, 204, 204, 0.8);
}`, "",{"version":3,"sources":["webpack://./../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.module.scss"],"names":[],"mappings":"AAAA;EACI,WAAA;EACA,YAAA;EACA,aAAA;EACA,8BAAA;EACA,mBAAA;AACJ;;AAEA;EACI,aAAA;EACA,yBAAA;EACA,YAAA;EACA,YAAA;AACJ;;AAEA;EACI,uBAAA;AACJ;;AAEA;EACI,0CAAA;AACJ","sourceRoot":""}]);
// Exports
var line = `---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-module__line`;
var input = `---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-module__input`;
var valid = `---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-module__valid`;
var invalid = `---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-module__invalid`;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.module.scss":
/*!*******************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.module.scss ***!
  \*******************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_133740__) => {

"use strict";
__nested_webpack_require_133740__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_133740__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   optionsLine: () => (/* binding */ optionsLine),
/* harmony export */   optionsSelect: () => (/* binding */ optionsSelect)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_133740__(/*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_133740__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_133740__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_133740__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.\\---------dev-sharedUiComponents-dist-components-lines-OptionsLineComponent-module__optionsLine {
  font-family: "acumin-pro-condensed", sans-serif;
  font-size: 12px;
  height: 25px;
  padding-left: 15px;
}

.\\---------dev-sharedUiComponents-dist-components-lines-OptionsLineComponent-module__optionsSelect {
  width: 100%;
  height: 100%;
  border: unset;
}`, "",{"version":3,"sources":["webpack://./../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.module.scss"],"names":[],"mappings":"AAAA;EACI,+CAAA;EACA,eAAA;EACA,YAAA;EACA,kBAAA;AACJ;;AAEA;EACI,WAAA;EACA,YAAA;EACA,aAAA;AACJ","sourceRoot":""}]);
// Exports
var optionsLine = `---------dev-sharedUiComponents-dist-components-lines-OptionsLineComponent-module__optionsLine`;
var optionsSelect = `---------dev-sharedUiComponents-dist-components-lines-OptionsLineComponent-module__optionsSelect`;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../dev/sharedUiComponents/dist/components/Fonts.scss":
/*!**********************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../dev/sharedUiComponents/dist/components/Fonts.scss ***!
  \**********************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_136986__) => {

"use strict";
__nested_webpack_require_136986__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_136986__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   fontRegular: () => (/* binding */ fontRegular)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_136986__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_136986__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_136986__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_136986__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.\\---------dev-sharedUiComponents-dist-components-Fonts__fontRegular {
    font-family: "acumin-pro-condensed";
    font-size: 14px;
}
`, "",{"version":3,"sources":["webpack://./../../../dev/sharedUiComponents/dist/components/Fonts.scss"],"names":[],"mappings":"AAAA;IACI,mCAAmC;IACnC,eAAe;AACnB","sourcesContent":[":local(.fontRegular) {\r\n    font-family: \"acumin-pro-condensed\";\r\n    font-size: 14px;\r\n}\r\n"],"sourceRoot":""}]);
// Exports
var fontRegular = `---------dev-sharedUiComponents-dist-components-Fonts__fontRegular`;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js":
/*!***************************************************************************!*\
  !*** ../../../../node_modules/@fortawesome/react-fontawesome/index.es.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_139566__) => {

"use strict";
__nested_webpack_require_139566__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_139566__.d(__nested_webpack_exports__, {
/* harmony export */   FontAwesomeIcon: () => (/* binding */ FontAwesomeIcon)
/* harmony export */ });
/* harmony import */ var _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_139566__(/*! @fortawesome/fontawesome-svg-core */ "../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_139566__(/*! prop-types */ "../../../../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_139566__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_139566__(/*! react */ "../../../../node_modules/react/index.js");




function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);

  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function (sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys.push.apply(keys, symbols);
  }

  return keys;
}

function _objectSpread2(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = null != arguments[i] ? arguments[i] : {};
    i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
      _defineProperty(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }

  return target;
}

function _typeof(obj) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
    return typeof obj;
  } : function (obj) {
    return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  }, _typeof(obj);
}

function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}

function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;

  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }

  return target;
}

function _objectWithoutProperties(source, excluded) {
  if (source == null) return {};

  var target = _objectWithoutPropertiesLoose(source, excluded);

  var key, i;

  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);

    for (i = 0; i < sourceSymbolKeys.length; i++) {
      key = sourceSymbolKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
      target[key] = source[key];
    }
  }

  return target;
}

function _toConsumableArray(arr) {
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}

function _arrayWithoutHoles(arr) {
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}

function _iterableToArray(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}

function _unsupportedIterableToArray(o, minLen) {
  if (!o) return;
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  var n = Object.prototype.toString.call(o).slice(8, -1);
  if (n === "Object" && o.constructor) n = o.constructor.name;
  if (n === "Map" || n === "Set") return Array.from(o);
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}

function _arrayLikeToArray(arr, len) {
  if (len == null || len > arr.length) len = arr.length;

  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];

  return arr2;
}

function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

// Get CSS class list from a props object
function classList(props) {
  var _classes;

  var beat = props.beat,
      fade = props.fade,
      beatFade = props.beatFade,
      bounce = props.bounce,
      shake = props.shake,
      flash = props.flash,
      spin = props.spin,
      spinPulse = props.spinPulse,
      spinReverse = props.spinReverse,
      pulse = props.pulse,
      fixedWidth = props.fixedWidth,
      inverse = props.inverse,
      border = props.border,
      listItem = props.listItem,
      flip = props.flip,
      size = props.size,
      rotation = props.rotation,
      pull = props.pull; // map of CSS class names to properties

  var classes = (_classes = {
    'fa-beat': beat,
    'fa-fade': fade,
    'fa-beat-fade': beatFade,
    'fa-bounce': bounce,
    'fa-shake': shake,
    'fa-flash': flash,
    'fa-spin': spin,
    'fa-spin-reverse': spinReverse,
    'fa-spin-pulse': spinPulse,
    'fa-pulse': pulse,
    'fa-fw': fixedWidth,
    'fa-inverse': inverse,
    'fa-border': border,
    'fa-li': listItem,
    'fa-flip': flip === true,
    'fa-flip-horizontal': flip === 'horizontal' || flip === 'both',
    'fa-flip-vertical': flip === 'vertical' || flip === 'both'
  }, _defineProperty(_classes, "fa-".concat(size), typeof size !== 'undefined' && size !== null), _defineProperty(_classes, "fa-rotate-".concat(rotation), typeof rotation !== 'undefined' && rotation !== null && rotation !== 0), _defineProperty(_classes, "fa-pull-".concat(pull), typeof pull !== 'undefined' && pull !== null), _defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes); // map over all the keys in the classes object
  // return an array of the keys where the value for the key is not null

  return Object.keys(classes).map(function (key) {
    return classes[key] ? key : null;
  }).filter(function (key) {
    return key;
  });
}

// Camelize taken from humps
// humps is copyright © 2012+ Dom Christie
// Released under the MIT license.
// Performant way to determine if object coerces to a number
function _isNumerical(obj) {
  obj = obj - 0; // eslint-disable-next-line no-self-compare

  return obj === obj;
}

function camelize(string) {
  if (_isNumerical(string)) {
    return string;
  } // eslint-disable-next-line no-useless-escape


  string = string.replace(/[\-_\s]+(.)?/g, function (match, chr) {
    return chr ? chr.toUpperCase() : '';
  }); // Ensure 1st char is always lowercase

  return string.substr(0, 1).toLowerCase() + string.substr(1);
}

var _excluded = ["style"];

function capitalize(val) {
  return val.charAt(0).toUpperCase() + val.slice(1);
}

function styleToObject(style) {
  return style.split(';').map(function (s) {
    return s.trim();
  }).filter(function (s) {
    return s;
  }).reduce(function (acc, pair) {
    var i = pair.indexOf(':');
    var prop = camelize(pair.slice(0, i));
    var value = pair.slice(i + 1).trim();
    prop.startsWith('webkit') ? acc[capitalize(prop)] = value : acc[prop] = value;
    return acc;
  }, {});
}

function convert(createElement, element) {
  var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

  if (typeof element === 'string') {
    return element;
  }

  var children = (element.children || []).map(function (child) {
    return convert(createElement, child);
  });
  /* eslint-disable dot-notation */

  var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {
    var val = element.attributes[key];

    switch (key) {
      case 'class':
        acc.attrs['className'] = val;
        delete element.attributes['class'];
        break;

      case 'style':
        acc.attrs['style'] = styleToObject(val);
        break;

      default:
        if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0) {
          acc.attrs[key.toLowerCase()] = val;
        } else {
          acc.attrs[camelize(key)] = val;
        }

    }

    return acc;
  }, {
    attrs: {}
  });

  var _extraProps$style = extraProps.style,
      existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,
      remaining = _objectWithoutProperties(extraProps, _excluded);

  mixins.attrs['style'] = _objectSpread2(_objectSpread2({}, mixins.attrs['style']), existingStyle);
  /* eslint-enable */

  return createElement.apply(void 0, [element.tag, _objectSpread2(_objectSpread2({}, mixins.attrs), remaining)].concat(_toConsumableArray(children)));
}

var PRODUCTION = false;

try {
  PRODUCTION = "development" === 'production';
} catch (e) {}

function log () {
  if (!PRODUCTION && console && typeof console.error === 'function') {
    var _console;

    (_console = console).error.apply(_console, arguments);
  }
}

function normalizeIconArgs(icon) {
  // this has everything that it needs to be rendered which means it was probably imported
  // directly from an icon svg package
  if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
    return icon;
  }

  if (_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.icon) {
    return _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.icon(icon);
  } // if the icon is null, there's nothing to do


  if (icon === null) {
    return null;
  } // if the icon is an object and has a prefix and an icon name, return it


  if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName) {
    return icon;
  } // if it's an array with length of two


  if (Array.isArray(icon) && icon.length === 2) {
    // use the first item as prefix, second as icon name
    return {
      prefix: icon[0],
      iconName: icon[1]
    };
  } // if it's a string, use it as the icon name


  if (typeof icon === 'string') {
    return {
      prefix: 'fas',
      iconName: icon
    };
  }
}

// creates an object with a key of key
// and a value of value
// if certain conditions are met
function objectWithKey(key, value) {
  // if the value is a non-empty array
  // or it's not an array but it is truthy
  // then create the object with the key and the value
  // if not, return an empty array
  return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
}

var defaultProps = {
  border: false,
  className: '',
  mask: null,
  maskId: null,
  fixedWidth: false,
  inverse: false,
  flip: false,
  icon: null,
  listItem: false,
  pull: null,
  pulse: false,
  rotation: null,
  size: null,
  spin: false,
  spinPulse: false,
  spinReverse: false,
  beat: false,
  fade: false,
  beatFade: false,
  bounce: false,
  shake: false,
  symbol: false,
  title: '',
  titleId: null,
  transform: null,
  swapOpacity: false
};
var FontAwesomeIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(function (props, ref) {
  var allProps = _objectSpread2(_objectSpread2({}, defaultProps), props);

  var iconArgs = allProps.icon,
      maskArgs = allProps.mask,
      symbol = allProps.symbol,
      className = allProps.className,
      title = allProps.title,
      titleId = allProps.titleId,
      maskId = allProps.maskId;
  var iconLookup = normalizeIconArgs(iconArgs);
  var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(allProps)), _toConsumableArray((className || '').split(' '))));
  var transform = objectWithKey('transform', typeof allProps.transform === 'string' ? _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.transform(allProps.transform) : allProps.transform);
  var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
  var renderedIcon = (0,_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.icon)(iconLookup, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, {
    symbol: symbol,
    title: title,
    titleId: titleId,
    maskId: maskId
  }));

  if (!renderedIcon) {
    log('Could not find icon', iconLookup);
    return null;
  }

  var abstract = renderedIcon.abstract;
  var extraProps = {
    ref: ref
  };
  Object.keys(allProps).forEach(function (key) {
    // eslint-disable-next-line no-prototype-builtins
    if (!defaultProps.hasOwnProperty(key)) {
      extraProps[key] = allProps[key];
    }
  });
  return convertCurry(abstract[0], extraProps);
});
FontAwesomeIcon.displayName = 'FontAwesomeIcon';
FontAwesomeIcon.propTypes = {
  beat: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  border: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  beatFade: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  bounce: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  fade: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  flash: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  mask: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().object), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
  maskId: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  fixedWidth: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  inverse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  flip: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf([true, false, 'horizontal', 'vertical', 'both']),
  icon: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().object), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
  listItem: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  pull: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['right', 'left']),
  pulse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  rotation: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf([0, 90, 180, 270]),
  shake: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  size: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
  spin: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  spinPulse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  spinReverse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  symbol: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  titleId: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  transform: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)]),
  swapOpacity: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
};
var convertCurry = convert.bind(null, react__WEBPACK_IMPORTED_MODULE_2__.createElement);




/***/ }),

/***/ "../../../../node_modules/css-loader/dist/runtime/api.js":
/*!***************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/runtime/api.js ***!
  \***************************************************************/
/***/ ((module) => {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
  var list = [];

  // return the list of modules as css string
  list.toString = function toString() {
    return this.map(function (item) {
      var content = "";
      var needLayer = typeof item[5] !== "undefined";
      if (item[4]) {
        content += "@supports (".concat(item[4], ") {");
      }
      if (item[2]) {
        content += "@media ".concat(item[2], " {");
      }
      if (needLayer) {
        content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
      }
      content += cssWithMappingToString(item);
      if (needLayer) {
        content += "}";
      }
      if (item[2]) {
        content += "}";
      }
      if (item[4]) {
        content += "}";
      }
      return content;
    }).join("");
  };

  // import a list of modules into the list
  list.i = function i(modules, media, dedupe, supports, layer) {
    if (typeof modules === "string") {
      modules = [[null, modules, undefined]];
    }
    var alreadyImportedModules = {};
    if (dedupe) {
      for (var k = 0; k < this.length; k++) {
        var id = this[k][0];
        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }
    for (var _k = 0; _k < modules.length; _k++) {
      var item = [].concat(modules[_k]);
      if (dedupe && alreadyImportedModules[item[0]]) {
        continue;
      }
      if (typeof layer !== "undefined") {
        if (typeof item[5] === "undefined") {
          item[5] = layer;
        } else {
          item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
          item[5] = layer;
        }
      }
      if (media) {
        if (!item[2]) {
          item[2] = media;
        } else {
          item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
          item[2] = media;
        }
      }
      if (supports) {
        if (!item[4]) {
          item[4] = "".concat(supports);
        } else {
          item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
          item[4] = supports;
        }
      }
      list.push(item);
    }
  };
  return list;
};

/***/ }),

/***/ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js":
/*!**********************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";


module.exports = function (item) {
  var content = item[1];
  var cssMapping = item[3];
  if (!cssMapping) {
    return content;
  }
  if (typeof btoa === "function") {
    var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
    var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
    var sourceMapping = "/*# ".concat(data, " */");
    return [content].concat([sourceMapping]).join("\n");
  }
  return [content].join("\n");
};

/***/ }),

/***/ "../../../../node_modules/object-assign/index.js":
/*!*******************************************************!*\
  !*** ../../../../node_modules/object-assign/index.js ***!
  \*******************************************************/
/***/ ((module) => {

"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/


/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;

function toObject(val) {
	if (val === null || val === undefined) {
		throw new TypeError('Object.assign cannot be called with null or undefined');
	}

	return Object(val);
}

function shouldUseNative() {
	try {
		if (!Object.assign) {
			return false;
		}

		// Detect buggy property enumeration order in older V8 versions.

		// https://bugs.chromium.org/p/v8/issues/detail?id=4118
		var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
		test1[5] = 'de';
		if (Object.getOwnPropertyNames(test1)[0] === '5') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test2 = {};
		for (var i = 0; i < 10; i++) {
			test2['_' + String.fromCharCode(i)] = i;
		}
		var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
			return test2[n];
		});
		if (order2.join('') !== '0123456789') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test3 = {};
		'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
			test3[letter] = letter;
		});
		if (Object.keys(Object.assign({}, test3)).join('') !==
				'abcdefghijklmnopqrst') {
			return false;
		}

		return true;
	} catch (err) {
		// We don't expect any of the above to throw, but better to be safe.
		return false;
	}
}

module.exports = shouldUseNative() ? Object.assign : function (target, source) {
	var from;
	var to = toObject(target);
	var symbols;

	for (var s = 1; s < arguments.length; s++) {
		from = Object(arguments[s]);

		for (var key in from) {
			if (hasOwnProperty.call(from, key)) {
				to[key] = from[key];
			}
		}

		if (getOwnPropertySymbols) {
			symbols = getOwnPropertySymbols(from);
			for (var i = 0; i < symbols.length; i++) {
				if (propIsEnumerable.call(from, symbols[i])) {
					to[symbols[i]] = from[symbols[i]];
				}
			}
		}
	}

	return to;
};


/***/ }),

/***/ "../../../../node_modules/prop-types/checkPropTypes.js":
/*!*************************************************************!*\
  !*** ../../../../node_modules/prop-types/checkPropTypes.js ***!
  \*************************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_161371__) => {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var printWarning = function() {};

if (true) {
  var ReactPropTypesSecret = __nested_webpack_require_161371__(/*! ./lib/ReactPropTypesSecret */ "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js");
  var loggedTypeFailures = {};
  var has = __nested_webpack_require_161371__(/*! ./lib/has */ "../../../../node_modules/prop-types/lib/has.js");

  printWarning = function(text) {
    var message = 'Warning: ' + text;
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) { /**/ }
  };
}

/**
 * Assert that the values match with the type specs.
 * Error messages are memorized and will only be shown once.
 *
 * @param {object} typeSpecs Map of name to a ReactPropType
 * @param {object} values Runtime values that need to be type-checked
 * @param {string} location e.g. "prop", "context", "child context"
 * @param {string} componentName Name of the component for error messages.
 * @param {?Function} getStack Returns the component stack.
 * @private
 */
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  if (true) {
    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error;
        // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.
        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error(
              (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
              'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
              'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
            );
            err.name = 'Invariant Violation';
            throw err;
          }
          error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
        } catch (ex) {
          error = ex;
        }
        if (error && !(error instanceof Error)) {
          printWarning(
            (componentName || 'React class') + ': type specification of ' +
            location + ' `' + typeSpecName + '` is invalid; the type checker ' +
            'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
            'You may have forgotten to pass an argument to the type checker ' +
            'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
            'shape all require an argument).'
          );
        }
        if (error instanceof Error && !(error.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error.message] = true;

          var stack = getStack ? getStack() : '';

          printWarning(
            'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
          );
        }
      }
    }
  }
}

/**
 * Resets warning cache when testing.
 *
 * @private
 */
checkPropTypes.resetWarningCache = function() {
  if (true) {
    loggedTypeFailures = {};
  }
}

module.exports = checkPropTypes;


/***/ }),

/***/ "../../../../node_modules/prop-types/factoryWithTypeCheckers.js":
/*!**********************************************************************!*\
  !*** ../../../../node_modules/prop-types/factoryWithTypeCheckers.js ***!
  \**********************************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_165671__) => {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var ReactIs = __nested_webpack_require_165671__(/*! react-is */ "../../../../node_modules/prop-types/node_modules/react-is/index.js");
var assign = __nested_webpack_require_165671__(/*! object-assign */ "../../../../node_modules/object-assign/index.js");

var ReactPropTypesSecret = __nested_webpack_require_165671__(/*! ./lib/ReactPropTypesSecret */ "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js");
var has = __nested_webpack_require_165671__(/*! ./lib/has */ "../../../../node_modules/prop-types/lib/has.js");
var checkPropTypes = __nested_webpack_require_165671__(/*! ./checkPropTypes */ "../../../../node_modules/prop-types/checkPropTypes.js");

var printWarning = function() {};

if (true) {
  printWarning = function(text) {
    var message = 'Warning: ' + text;
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };
}

function emptyFunctionThatReturnsNull() {
  return null;
}

module.exports = function(isValidElement, throwOnDirectAccess) {
  /* global Symbol */
  var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.

  /**
   * Returns the iterator method function contained on the iterable object.
   *
   * Be sure to invoke the function with the iterable as context:
   *
   *     var iteratorFn = getIteratorFn(myIterable);
   *     if (iteratorFn) {
   *       var iterator = iteratorFn.call(myIterable);
   *       ...
   *     }
   *
   * @param {?object} maybeIterable
   * @return {?function}
   */
  function getIteratorFn(maybeIterable) {
    var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
    if (typeof iteratorFn === 'function') {
      return iteratorFn;
    }
  }

  /**
   * Collection of methods that allow declaration and validation of props that are
   * supplied to React components. Example usage:
   *
   *   var Props = require('ReactPropTypes');
   *   var MyArticle = React.createClass({
   *     propTypes: {
   *       // An optional string prop named "description".
   *       description: Props.string,
   *
   *       // A required enum prop named "category".
   *       category: Props.oneOf(['News','Photos']).isRequired,
   *
   *       // A prop named "dialog" that requires an instance of Dialog.
   *       dialog: Props.instanceOf(Dialog).isRequired
   *     },
   *     render: function() { ... }
   *   });
   *
   * A more formal specification of how these methods are used:
   *
   *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
   *   decl := ReactPropTypes.{type}(.isRequired)?
   *
   * Each and every declaration produces a function with the same signature. This
   * allows the creation of custom validation functions. For example:
   *
   *  var MyLink = React.createClass({
   *    propTypes: {
   *      // An optional string or URI prop named "href".
   *      href: function(props, propName, componentName) {
   *        var propValue = props[propName];
   *        if (propValue != null && typeof propValue !== 'string' &&
   *            !(propValue instanceof URI)) {
   *          return new Error(
   *            'Expected a string or an URI for ' + propName + ' in ' +
   *            componentName
   *          );
   *        }
   *      }
   *    },
   *    render: function() {...}
   *  });
   *
   * @internal
   */

  var ANONYMOUS = '<<anonymous>>';

  // Important!
  // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
  var ReactPropTypes = {
    array: createPrimitiveTypeChecker('array'),
    bigint: createPrimitiveTypeChecker('bigint'),
    bool: createPrimitiveTypeChecker('boolean'),
    func: createPrimitiveTypeChecker('function'),
    number: createPrimitiveTypeChecker('number'),
    object: createPrimitiveTypeChecker('object'),
    string: createPrimitiveTypeChecker('string'),
    symbol: createPrimitiveTypeChecker('symbol'),

    any: createAnyTypeChecker(),
    arrayOf: createArrayOfTypeChecker,
    element: createElementTypeChecker(),
    elementType: createElementTypeTypeChecker(),
    instanceOf: createInstanceTypeChecker,
    node: createNodeChecker(),
    objectOf: createObjectOfTypeChecker,
    oneOf: createEnumTypeChecker,
    oneOfType: createUnionTypeChecker,
    shape: createShapeTypeChecker,
    exact: createStrictShapeTypeChecker,
  };

  /**
   * inlined Object.is polyfill to avoid requiring consumers ship their own
   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
   */
  /*eslint-disable no-self-compare*/
  function is(x, y) {
    // SameValue algorithm
    if (x === y) {
      // Steps 1-5, 7-10
      // Steps 6.b-6.e: +0 != -0
      return x !== 0 || 1 / x === 1 / y;
    } else {
      // Step 6.a: NaN == NaN
      return x !== x && y !== y;
    }
  }
  /*eslint-enable no-self-compare*/

  /**
   * We use an Error-like object for backward compatibility as people may call
   * PropTypes directly and inspect their output. However, we don't use real
   * Errors anymore. We don't inspect their stack anyway, and creating them
   * is prohibitively expensive if they are created too often, such as what
   * happens in oneOfType() for any type before the one that matched.
   */
  function PropTypeError(message, data) {
    this.message = message;
    this.data = data && typeof data === 'object' ? data: {};
    this.stack = '';
  }
  // Make `instanceof Error` still work for returned errors.
  PropTypeError.prototype = Error.prototype;

  function createChainableTypeChecker(validate) {
    if (true) {
      var manualPropTypeCallCache = {};
      var manualPropTypeWarningCount = 0;
    }
    function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
      componentName = componentName || ANONYMOUS;
      propFullName = propFullName || propName;

      if (secret !== ReactPropTypesSecret) {
        if (throwOnDirectAccess) {
          // New behavior only for users of `prop-types` package
          var err = new Error(
            'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
            'Use `PropTypes.checkPropTypes()` to call them. ' +
            'Read more at http://fb.me/use-check-prop-types'
          );
          err.name = 'Invariant Violation';
          throw err;
        } else if (  true && typeof console !== 'undefined') {
          // Old behavior for people using React.PropTypes
          var cacheKey = componentName + ':' + propName;
          if (
            !manualPropTypeCallCache[cacheKey] &&
            // Avoid spamming the console because they are often not actionable except for lib authors
            manualPropTypeWarningCount < 3
          ) {
            printWarning(
              'You are manually calling a React.PropTypes validation ' +
              'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
              'and will throw in the standalone `prop-types` package. ' +
              'You may be seeing this warning due to a third-party PropTypes ' +
              'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
            );
            manualPropTypeCallCache[cacheKey] = true;
            manualPropTypeWarningCount++;
          }
        }
      }
      if (props[propName] == null) {
        if (isRequired) {
          if (props[propName] === null) {
            return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
          }
          return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
        }
        return null;
      } else {
        return validate(props, propName, componentName, location, propFullName);
      }
    }

    var chainedCheckType = checkType.bind(null, false);
    chainedCheckType.isRequired = checkType.bind(null, true);

    return chainedCheckType;
  }

  function createPrimitiveTypeChecker(expectedType) {
    function validate(props, propName, componentName, location, propFullName, secret) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== expectedType) {
        // `propValue` being instance of, say, date/regexp, pass the 'object'
        // check, but we can offer a more precise error message here rather than
        // 'of type `object`'.
        var preciseType = getPreciseType(propValue);

        return new PropTypeError(
          'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
          {expectedType: expectedType}
        );
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createAnyTypeChecker() {
    return createChainableTypeChecker(emptyFunctionThatReturnsNull);
  }

  function createArrayOfTypeChecker(typeChecker) {
    function validate(props, propName, componentName, location, propFullName) {
      if (typeof typeChecker !== 'function') {
        return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
      }
      var propValue = props[propName];
      if (!Array.isArray(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
      }
      for (var i = 0; i < propValue.length; i++) {
        var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
        if (error instanceof Error) {
          return error;
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createElementTypeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      if (!isValidElement(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createElementTypeTypeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      if (!ReactIs.isValidElementType(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createInstanceTypeChecker(expectedClass) {
    function validate(props, propName, componentName, location, propFullName) {
      if (!(props[propName] instanceof expectedClass)) {
        var expectedClassName = expectedClass.name || ANONYMOUS;
        var actualClassName = getClassName(props[propName]);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createEnumTypeChecker(expectedValues) {
    if (!Array.isArray(expectedValues)) {
      if (true) {
        if (arguments.length > 1) {
          printWarning(
            'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
            'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
          );
        } else {
          printWarning('Invalid argument supplied to oneOf, expected an array.');
        }
      }
      return emptyFunctionThatReturnsNull;
    }

    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      for (var i = 0; i < expectedValues.length; i++) {
        if (is(propValue, expectedValues[i])) {
          return null;
        }
      }

      var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
        var type = getPreciseType(value);
        if (type === 'symbol') {
          return String(value);
        }
        return value;
      });
      return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
    }
    return createChainableTypeChecker(validate);
  }

  function createObjectOfTypeChecker(typeChecker) {
    function validate(props, propName, componentName, location, propFullName) {
      if (typeof typeChecker !== 'function') {
        return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
      }
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
      }
      for (var key in propValue) {
        if (has(propValue, key)) {
          var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
          if (error instanceof Error) {
            return error;
          }
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createUnionTypeChecker(arrayOfTypeCheckers) {
    if (!Array.isArray(arrayOfTypeCheckers)) {
        true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
      return emptyFunctionThatReturnsNull;
    }

    for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
      var checker = arrayOfTypeCheckers[i];
      if (typeof checker !== 'function') {
        printWarning(
          'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
          'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
        );
        return emptyFunctionThatReturnsNull;
      }
    }

    function validate(props, propName, componentName, location, propFullName) {
      var expectedTypes = [];
      for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
        var checker = arrayOfTypeCheckers[i];
        var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
        if (checkerResult == null) {
          return null;
        }
        if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
          expectedTypes.push(checkerResult.data.expectedType);
        }
      }
      var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
      return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
    }
    return createChainableTypeChecker(validate);
  }

  function createNodeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      if (!isNode(props[propName])) {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function invalidValidatorError(componentName, location, propFullName, key, type) {
    return new PropTypeError(
      (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
      'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
    );
  }

  function createShapeTypeChecker(shapeTypes) {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
      }
      for (var key in shapeTypes) {
        var checker = shapeTypes[key];
        if (typeof checker !== 'function') {
          return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
        }
        var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
        if (error) {
          return error;
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createStrictShapeTypeChecker(shapeTypes) {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
      }
      // We need to check all keys in case some are required but missing from props.
      var allKeys = assign({}, props[propName], shapeTypes);
      for (var key in allKeys) {
        var checker = shapeTypes[key];
        if (has(shapeTypes, key) && typeof checker !== 'function') {
          return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
        }
        if (!checker) {
          return new PropTypeError(
            'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
            '\nBad object: ' + JSON.stringify(props[propName], null, '  ') +
            '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, '  ')
          );
        }
        var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
        if (error) {
          return error;
        }
      }
      return null;
    }

    return createChainableTypeChecker(validate);
  }

  function isNode(propValue) {
    switch (typeof propValue) {
      case 'number':
      case 'string':
      case 'undefined':
        return true;
      case 'boolean':
        return !propValue;
      case 'object':
        if (Array.isArray(propValue)) {
          return propValue.every(isNode);
        }
        if (propValue === null || isValidElement(propValue)) {
          return true;
        }

        var iteratorFn = getIteratorFn(propValue);
        if (iteratorFn) {
          var iterator = iteratorFn.call(propValue);
          var step;
          if (iteratorFn !== propValue.entries) {
            while (!(step = iterator.next()).done) {
              if (!isNode(step.value)) {
                return false;
              }
            }
          } else {
            // Iterator will provide entry [k,v] tuples rather than values.
            while (!(step = iterator.next()).done) {
              var entry = step.value;
              if (entry) {
                if (!isNode(entry[1])) {
                  return false;
                }
              }
            }
          }
        } else {
          return false;
        }

        return true;
      default:
        return false;
    }
  }

  function isSymbol(propType, propValue) {
    // Native Symbol.
    if (propType === 'symbol') {
      return true;
    }

    // falsy value can't be a Symbol
    if (!propValue) {
      return false;
    }

    // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
    if (propValue['@@toStringTag'] === 'Symbol') {
      return true;
    }

    // Fallback for non-spec compliant Symbols which are polyfilled.
    if (typeof Symbol === 'function' && propValue instanceof Symbol) {
      return true;
    }

    return false;
  }

  // Equivalent of `typeof` but with special handling for array and regexp.
  function getPropType(propValue) {
    var propType = typeof propValue;
    if (Array.isArray(propValue)) {
      return 'array';
    }
    if (propValue instanceof RegExp) {
      // Old webkits (at least until Android 4.0) return 'function' rather than
      // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
      // passes PropTypes.object.
      return 'object';
    }
    if (isSymbol(propType, propValue)) {
      return 'symbol';
    }
    return propType;
  }

  // This handles more types than `getPropType`. Only used for error messages.
  // See `createPrimitiveTypeChecker`.
  function getPreciseType(propValue) {
    if (typeof propValue === 'undefined' || propValue === null) {
      return '' + propValue;
    }
    var propType = getPropType(propValue);
    if (propType === 'object') {
      if (propValue instanceof Date) {
        return 'date';
      } else if (propValue instanceof RegExp) {
        return 'regexp';
      }
    }
    return propType;
  }

  // Returns a string that is postfixed to a warning about an invalid type.
  // For example, "undefined" or "of type array"
  function getPostfixForTypeWarning(value) {
    var type = getPreciseType(value);
    switch (type) {
      case 'array':
      case 'object':
        return 'an ' + type;
      case 'boolean':
      case 'date':
      case 'regexp':
        return 'a ' + type;
      default:
        return type;
    }
  }

  // Returns class name of the object, if any.
  function getClassName(propValue) {
    if (!propValue.constructor || !propValue.constructor.name) {
      return ANONYMOUS;
    }
    return propValue.constructor.name;
  }

  ReactPropTypes.checkPropTypes = checkPropTypes;
  ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
  ReactPropTypes.PropTypes = ReactPropTypes;

  return ReactPropTypes;
};


/***/ }),

/***/ "../../../../node_modules/prop-types/index.js":
/*!****************************************************!*\
  !*** ../../../../node_modules/prop-types/index.js ***!
  \****************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_188904__) => {

/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

if (true) {
  var ReactIs = __nested_webpack_require_188904__(/*! react-is */ "../../../../node_modules/prop-types/node_modules/react-is/index.js");

  // By explicitly using `prop-types` you are opting into new development behavior.
  // http://fb.me/prop-types-in-prod
  var throwOnDirectAccess = true;
  module.exports = __nested_webpack_require_188904__(/*! ./factoryWithTypeCheckers */ "../../../../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
} else {}


/***/ }),

/***/ "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js":
/*!***********************************************************************!*\
  !*** ../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';

module.exports = ReactPropTypesSecret;


/***/ }),

/***/ "../../../../node_modules/prop-types/lib/has.js":
/*!******************************************************!*\
  !*** ../../../../node_modules/prop-types/lib/has.js ***!
  \******************************************************/
/***/ ((module) => {

module.exports = Function.call.bind(Object.prototype.hasOwnProperty);


/***/ }),

/***/ "../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js":
/*!*********************************************************************************************!*\
  !*** ../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***!
  \*********************************************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
/** @license React v16.13.1
 * react-is.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
// (unstable) APIs that have been removed. Can we remove the symbols?

var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;

function isValidElementType(type) {
  return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
}

function typeOf(object) {
  if (typeof object === 'object' && object !== null) {
    var $$typeof = object.$$typeof;

    switch ($$typeof) {
      case REACT_ELEMENT_TYPE:
        var type = object.type;

        switch (type) {
          case REACT_ASYNC_MODE_TYPE:
          case REACT_CONCURRENT_MODE_TYPE:
          case REACT_FRAGMENT_TYPE:
          case REACT_PROFILER_TYPE:
          case REACT_STRICT_MODE_TYPE:
          case REACT_SUSPENSE_TYPE:
            return type;

          default:
            var $$typeofType = type && type.$$typeof;

            switch ($$typeofType) {
              case REACT_CONTEXT_TYPE:
              case REACT_FORWARD_REF_TYPE:
              case REACT_LAZY_TYPE:
              case REACT_MEMO_TYPE:
              case REACT_PROVIDER_TYPE:
                return $$typeofType;

              default:
                return $$typeof;
            }

        }

      case REACT_PORTAL_TYPE:
        return $$typeof;
    }
  }

  return undefined;
} // AsyncMode is deprecated along with isAsyncMode

var AsyncMode = REACT_ASYNC_MODE_TYPE;
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated

function isAsyncMode(object) {
  {
    if (!hasWarnedAboutDeprecatedIsAsyncMode) {
      hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint

      console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
    }
  }

  return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
}
function isConcurrentMode(object) {
  return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
}
function isContextConsumer(object) {
  return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
  return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
  return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
  return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
  return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
  return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
  return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
  return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
  return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
  return typeOf(object) === REACT_SUSPENSE_TYPE;
}

exports.AsyncMode = AsyncMode;
exports.ConcurrentMode = ConcurrentMode;
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
  })();
}


/***/ }),

/***/ "../../../../node_modules/prop-types/node_modules/react-is/index.js":
/*!**************************************************************************!*\
  !*** ../../../../node_modules/prop-types/node_modules/react-is/index.js ***!
  \**************************************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_198358__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_198358__(/*! ./cjs/react-is.development.js */ "../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js");
}


/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/AbstractMenu.js":
/*!**********************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/AbstractMenu.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_198944__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__nested_webpack_require_198944__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_198944__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _MenuItem = _interopRequireDefault(__nested_webpack_require_198944__(/*! ./MenuItem */ "../../../../node_modules/react-contextmenu/es6/MenuItem.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var AbstractMenu = /*#__PURE__*/function (_Component) {
  _inherits(AbstractMenu, _Component);

  var _super = _createSuper(AbstractMenu);

  function AbstractMenu(_props) {
    var _this;

    _classCallCheck(this, AbstractMenu);

    _this = _super.call(this, _props);

    _defineProperty(_assertThisInitialized(_this), "handleKeyNavigation", function (e) {
      // check for isVisible strictly here as it might be undefined when this code executes in the context of SubMenu
      // but we only need to check when it runs in the ContextMenu context
      if (_this.state.isVisible === false) {
        return;
      }

      switch (e.keyCode) {
        case 37: // left arrow

        case 27:
          // escape
          e.preventDefault();

          _this.hideMenu(e);

          break;

        case 38:
          // up arrow
          e.preventDefault();

          _this.selectChildren(true);

          break;

        case 40:
          // down arrow
          e.preventDefault();

          _this.selectChildren(false);

          break;

        case 39:
          // right arrow
          _this.tryToOpenSubMenu(e);

          break;

        case 13:
          // enter
          e.preventDefault();

          _this.tryToOpenSubMenu(e);

          {
            // determine the selected item is disabled or not
            var disabled = _this.seletedItemRef && _this.seletedItemRef.props && _this.seletedItemRef.props.disabled;

            if (_this.seletedItemRef && _this.seletedItemRef.ref instanceof HTMLElement && !disabled) {
              _this.seletedItemRef.ref.click();
            } else {
              _this.hideMenu(e);
            }
          }
          break;

        default: // do nothing

      }
    });

    _defineProperty(_assertThisInitialized(_this), "handleForceClose", function () {
      _this.setState({
        forceSubMenuOpen: false
      });
    });

    _defineProperty(_assertThisInitialized(_this), "tryToOpenSubMenu", function (e) {
      if (_this.state.selectedItem && _this.state.selectedItem.type === _this.getSubMenuType()) {
        e.preventDefault();

        _this.setState({
          forceSubMenuOpen: true
        });
      }
    });

    _defineProperty(_assertThisInitialized(_this), "selectChildren", function (forward) {
      var selectedItem = _this.state.selectedItem;
      var children = [];
      var disabledChildrenCount = 0;
      var disabledChildIndexes = {};

      var childCollector = function childCollector(child, index) {
        // child can be empty in case you do conditional rendering of components, in which
        // case it should not be accounted for as a real child
        if (!child) {
          return;
        }

        if ([_MenuItem["default"], _this.getSubMenuType()].indexOf(child.type) < 0) {
          // Maybe the MenuItem or SubMenu is capsuled in a wrapper div or something else
          _react["default"].Children.forEach(child.props.children, childCollector);
        } else if (!child.props.divider) {
          if (child.props.disabled) {
            ++disabledChildrenCount;
            disabledChildIndexes[index] = true;
          }

          children.push(child);
        }
      };

      _react["default"].Children.forEach(_this.props.children, childCollector);

      if (disabledChildrenCount === children.length) {
        // All menu items are disabled, so none can be selected, don't do anything
        return;
      }

      function findNextEnabledChildIndex(currentIndex) {
        var i = currentIndex;

        var incrementCounter = function incrementCounter() {
          if (forward) {
            --i;
          } else {
            ++i;
          }

          if (i < 0) {
            i = children.length - 1;
          } else if (i >= children.length) {
            i = 0;
          }
        };

        do {
          incrementCounter();
        } while (i !== currentIndex && disabledChildIndexes[i]);

        return i === currentIndex ? null : i;
      }

      var currentIndex = children.indexOf(selectedItem);
      var nextEnabledChildIndex = findNextEnabledChildIndex(currentIndex);

      if (nextEnabledChildIndex !== null) {
        _this.setState({
          selectedItem: children[nextEnabledChildIndex],
          forceSubMenuOpen: false
        });
      }
    });

    _defineProperty(_assertThisInitialized(_this), "onChildMouseMove", function (child) {
      if (_this.state.selectedItem !== child) {
        _this.setState({
          selectedItem: child,
          forceSubMenuOpen: false
        });
      }
    });

    _defineProperty(_assertThisInitialized(_this), "onChildMouseLeave", function () {
      _this.setState({
        selectedItem: null,
        forceSubMenuOpen: false
      });
    });

    _defineProperty(_assertThisInitialized(_this), "renderChildren", function (children) {
      return _react["default"].Children.map(children, function (child) {
        var props = {};
        if (! /*#__PURE__*/_react["default"].isValidElement(child)) return child;

        if ([_MenuItem["default"], _this.getSubMenuType()].indexOf(child.type) < 0) {
          // Maybe the MenuItem or SubMenu is capsuled in a wrapper div or something else
          props.children = _this.renderChildren(child.props.children);
          return /*#__PURE__*/_react["default"].cloneElement(child, props);
        }

        props.onMouseLeave = _this.onChildMouseLeave.bind(_assertThisInitialized(_this));

        if (child.type === _this.getSubMenuType()) {
          // special props for SubMenu only
          props.forceOpen = _this.state.forceSubMenuOpen && _this.state.selectedItem === child;
          props.forceClose = _this.handleForceClose;
          props.parentKeyNavigationHandler = _this.handleKeyNavigation;
        }

        if (!child.props.divider && _this.state.selectedItem === child) {
          // special props for selected item only
          props.selected = true;

          props.ref = function (ref) {
            _this.seletedItemRef = ref;
          };

          return /*#__PURE__*/_react["default"].cloneElement(child, props);
        } // onMouseMove is only needed for non selected items


        props.onMouseMove = function () {
          return _this.onChildMouseMove(child);
        };

        return /*#__PURE__*/_react["default"].cloneElement(child, props);
      });
    });

    _this.seletedItemRef = null;
    _this.state = {
      selectedItem: null,
      forceSubMenuOpen: false
    };
    return _this;
  }

  return _createClass(AbstractMenu);
}(_react.Component);

exports["default"] = AbstractMenu;

_defineProperty(AbstractMenu, "propTypes", {
  children: _propTypes["default"].node.isRequired
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/ContextMenu.js":
/*!*********************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/ContextMenu.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_211150__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireDefault(__nested_webpack_require_211150__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_211150__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _classnames = _interopRequireDefault(__nested_webpack_require_211150__(/*! classnames */ "../../../../node_modules/classnames/index.js"));

var _objectAssign = _interopRequireDefault(__nested_webpack_require_211150__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _globalEventListener = _interopRequireDefault(__nested_webpack_require_211150__(/*! ./globalEventListener */ "../../../../node_modules/react-contextmenu/es6/globalEventListener.js"));

var _AbstractMenu2 = _interopRequireDefault(__nested_webpack_require_211150__(/*! ./AbstractMenu */ "../../../../node_modules/react-contextmenu/es6/AbstractMenu.js"));

var _SubMenu = _interopRequireDefault(__nested_webpack_require_211150__(/*! ./SubMenu */ "../../../../node_modules/react-contextmenu/es6/SubMenu.js"));

var _actions = __nested_webpack_require_211150__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _helpers = __nested_webpack_require_211150__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var ContextMenu = /*#__PURE__*/function (_AbstractMenu) {
  _inherits(ContextMenu, _AbstractMenu);

  var _super = _createSuper(ContextMenu);

  function ContextMenu(props) {
    var _this;

    _classCallCheck(this, ContextMenu);

    _this = _super.call(this, props);

    _defineProperty(_assertThisInitialized(_this), "registerHandlers", function () {
      document.addEventListener('mousedown', _this.handleOutsideClick);
      document.addEventListener('touchstart', _this.handleOutsideClick);
      if (!_this.props.preventHideOnScroll) document.addEventListener('scroll', _this.handleHide);
      if (!_this.props.preventHideOnContextMenu) document.addEventListener('contextmenu', _this.handleHide);
      document.addEventListener('keydown', _this.handleKeyNavigation);
      if (!_this.props.preventHideOnResize) window.addEventListener('resize', _this.handleHide);
    });

    _defineProperty(_assertThisInitialized(_this), "unregisterHandlers", function () {
      document.removeEventListener('mousedown', _this.handleOutsideClick);
      document.removeEventListener('touchstart', _this.handleOutsideClick);
      document.removeEventListener('scroll', _this.handleHide);
      document.removeEventListener('contextmenu', _this.handleHide);
      document.removeEventListener('keydown', _this.handleKeyNavigation);
      window.removeEventListener('resize', _this.handleHide);
    });

    _defineProperty(_assertThisInitialized(_this), "handleShow", function (e) {
      if (e.detail.id !== _this.props.id || _this.state.isVisible) return;
      var _e$detail$position = e.detail.position,
          x = _e$detail$position.x,
          y = _e$detail$position.y;

      _this.setState({
        isVisible: true,
        x: x,
        y: y
      });

      _this.registerHandlers();

      (0, _helpers.callIfExists)(_this.props.onShow, e);
    });

    _defineProperty(_assertThisInitialized(_this), "handleHide", function (e) {
      if (_this.state.isVisible && (!e.detail || !e.detail.id || e.detail.id === _this.props.id)) {
        _this.unregisterHandlers();

        _this.setState({
          isVisible: false,
          selectedItem: null,
          forceSubMenuOpen: false
        });

        (0, _helpers.callIfExists)(_this.props.onHide, e);
      }
    });

    _defineProperty(_assertThisInitialized(_this), "handleOutsideClick", function (e) {
      if (!_this.menu.contains(e.target)) (0, _actions.hideMenu)();
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function (event) {
      event.preventDefault();
      (0, _helpers.callIfExists)(_this.props.onMouseLeave, event, (0, _objectAssign["default"])({}, _this.props.data, _helpers.store.data), _helpers.store.target);
      if (_this.props.hideOnLeave) (0, _actions.hideMenu)();
    });

    _defineProperty(_assertThisInitialized(_this), "handleContextMenu", function (e) {
      if (false) {}

      _this.handleHide(e);
    });

    _defineProperty(_assertThisInitialized(_this), "hideMenu", function (e) {
      if (e.keyCode === 27 || e.keyCode === 13) {
        // ECS or enter
        (0, _actions.hideMenu)();
      }
    });

    _defineProperty(_assertThisInitialized(_this), "getMenuPosition", function () {
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var menuStyles = {
        top: y,
        left: x
      };
      if (!_this.menu) return menuStyles;
      var _window = window,
          innerWidth = _window.innerWidth,
          innerHeight = _window.innerHeight;

      var rect = _this.menu.getBoundingClientRect();

      if (y + rect.height > innerHeight) {
        menuStyles.top -= rect.height;
      }

      if (x + rect.width > innerWidth) {
        menuStyles.left -= rect.width;
      }

      if (menuStyles.top < 0) {
        menuStyles.top = rect.height < innerHeight ? (innerHeight - rect.height) / 2 : 0;
      }

      if (menuStyles.left < 0) {
        menuStyles.left = rect.width < innerWidth ? (innerWidth - rect.width) / 2 : 0;
      }

      return menuStyles;
    });

    _defineProperty(_assertThisInitialized(_this), "getRTLMenuPosition", function () {
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var menuStyles = {
        top: y,
        left: x
      };
      if (!_this.menu) return menuStyles;
      var _window2 = window,
          innerWidth = _window2.innerWidth,
          innerHeight = _window2.innerHeight;

      var rect = _this.menu.getBoundingClientRect(); // Try to position the menu on the left side of the cursor


      menuStyles.left = x - rect.width;

      if (y + rect.height > innerHeight) {
        menuStyles.top -= rect.height;
      }

      if (menuStyles.left < 0) {
        menuStyles.left += rect.width;
      }

      if (menuStyles.top < 0) {
        menuStyles.top = rect.height < innerHeight ? (innerHeight - rect.height) / 2 : 0;
      }

      if (menuStyles.left + rect.width > innerWidth) {
        menuStyles.left = rect.width < innerWidth ? (innerWidth - rect.width) / 2 : 0;
      }

      return menuStyles;
    });

    _defineProperty(_assertThisInitialized(_this), "menuRef", function (c) {
      _this.menu = c;
    });

    _this.state = (0, _objectAssign["default"])({}, _this.state, {
      x: 0,
      y: 0,
      isVisible: false
    });
    return _this;
  }

  _createClass(ContextMenu, [{
    key: "getSubMenuType",
    value: function getSubMenuType() {
      // eslint-disable-line class-methods-use-this
      return _SubMenu["default"];
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      this.listenId = _globalEventListener["default"].register(this.handleShow, this.handleHide);
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate() {
      var _this2 = this;

      var wrapper = window.requestAnimationFrame || setTimeout;

      if (this.state.isVisible) {
        wrapper(function () {
          var _this2$state = _this2.state,
              x = _this2$state.x,
              y = _this2$state.y;

          var _ref = _this2.props.rtl ? _this2.getRTLMenuPosition(x, y) : _this2.getMenuPosition(x, y),
              top = _ref.top,
              left = _ref.left;

          wrapper(function () {
            if (!_this2.menu) return;
            _this2.menu.style.top = "".concat(top, "px");
            _this2.menu.style.left = "".concat(left, "px");
            _this2.menu.style.opacity = 1;
            _this2.menu.style.pointerEvents = 'auto';
          });
        });
      } else {
        wrapper(function () {
          if (!_this2.menu) return;
          _this2.menu.style.opacity = 0;
          _this2.menu.style.pointerEvents = 'none';
        });
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      if (this.listenId) {
        _globalEventListener["default"].unregister(this.listenId);
      }

      this.unregisterHandlers();
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props = this.props,
          children = _this$props.children,
          className = _this$props.className,
          style = _this$props.style;
      var isVisible = this.state.isVisible;
      var inlineStyle = (0, _objectAssign["default"])({}, style, {
        position: 'fixed',
        opacity: 0,
        pointerEvents: 'none'
      });
      var menuClassnames = (0, _classnames["default"])(_helpers.cssClasses.menu, className, _defineProperty({}, _helpers.cssClasses.menuVisible, isVisible));
      return /*#__PURE__*/_react["default"].createElement("nav", {
        role: "menu",
        tabIndex: "-1",
        ref: this.menuRef,
        style: inlineStyle,
        className: menuClassnames,
        onContextMenu: this.handleContextMenu,
        onMouseLeave: this.handleMouseLeave
      }, this.renderChildren(children));
    }
  }]);

  return ContextMenu;
}(_AbstractMenu2["default"]);

exports["default"] = ContextMenu;

_defineProperty(ContextMenu, "propTypes", {
  id: _propTypes["default"].string.isRequired,
  children: _propTypes["default"].node.isRequired,
  data: _propTypes["default"].object,
  className: _propTypes["default"].string,
  hideOnLeave: _propTypes["default"].bool,
  rtl: _propTypes["default"].bool,
  onHide: _propTypes["default"].func,
  onMouseLeave: _propTypes["default"].func,
  onShow: _propTypes["default"].func,
  preventHideOnContextMenu: _propTypes["default"].bool,
  preventHideOnResize: _propTypes["default"].bool,
  preventHideOnScroll: _propTypes["default"].bool,
  style: _propTypes["default"].object
});

_defineProperty(ContextMenu, "defaultProps", {
  className: '',
  data: {},
  hideOnLeave: false,
  rtl: false,
  onHide: function onHide() {
    return null;
  },
  onMouseLeave: function onMouseLeave() {
    return null;
  },
  onShow: function onShow() {
    return null;
  },
  preventHideOnContextMenu: false,
  preventHideOnResize: false,
  preventHideOnScroll: false,
  style: {}
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js":
/*!****************************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_225527__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__nested_webpack_require_225527__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_225527__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _classnames = _interopRequireDefault(__nested_webpack_require_225527__(/*! classnames */ "../../../../node_modules/classnames/index.js"));

var _objectAssign = _interopRequireDefault(__nested_webpack_require_225527__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _actions = __nested_webpack_require_225527__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _helpers = __nested_webpack_require_225527__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var ContextMenuTrigger = /*#__PURE__*/function (_Component) {
  _inherits(ContextMenuTrigger, _Component);

  var _super = _createSuper(ContextMenuTrigger);

  function ContextMenuTrigger() {
    var _this;

    _classCallCheck(this, ContextMenuTrigger);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "touchHandled", false);

    _defineProperty(_assertThisInitialized(_this), "handleMouseDown", function (event) {
      if (_this.props.holdToDisplay >= 0 && event.button === 0) {
        event.persist();
        event.stopPropagation();
        _this.mouseDownTimeoutId = setTimeout(function () {
          return _this.handleContextClick(event);
        }, _this.props.holdToDisplay);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onMouseDown, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseUp", function (event) {
      if (event.button === 0) {
        clearTimeout(_this.mouseDownTimeoutId);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onMouseUp, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseOut", function (event) {
      if (event.button === 0) {
        clearTimeout(_this.mouseDownTimeoutId);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onMouseOut, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleTouchstart", function (event) {
      _this.touchHandled = false;

      if (_this.props.holdToDisplay >= 0) {
        event.persist();
        event.stopPropagation();
        _this.touchstartTimeoutId = setTimeout(function () {
          _this.handleContextClick(event);

          _this.touchHandled = true;
        }, _this.props.holdToDisplay);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onTouchStart, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleTouchEnd", function (event) {
      if (_this.touchHandled) {
        event.preventDefault();
      }

      clearTimeout(_this.touchstartTimeoutId);
      (0, _helpers.callIfExists)(_this.props.attributes.onTouchEnd, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleContextMenu", function (event) {
      if (event.button === _this.props.mouseButton) {
        _this.handleContextClick(event);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onContextMenu, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseClick", function (event) {
      if (event.button === _this.props.mouseButton) {
        _this.handleContextClick(event);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onClick, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleContextClick", function (event) {
      if (_this.props.disable) return;
      if (_this.props.disableIfShiftIsPressed && event.shiftKey) return;
      event.preventDefault();
      event.stopPropagation();
      var x = event.clientX || event.touches && event.touches[0].pageX;
      var y = event.clientY || event.touches && event.touches[0].pageY;

      if (_this.props.posX) {
        x -= _this.props.posX;
      }

      if (_this.props.posY) {
        y -= _this.props.posY;
      }

      (0, _actions.hideMenu)();
      var data = (0, _helpers.callIfExists)(_this.props.collect, _this.props);
      var showMenuConfig = {
        position: {
          x: x,
          y: y
        },
        target: _this.elem,
        id: _this.props.id
      };

      if (data && typeof data.then === 'function') {
        // it's promise
        data.then(function (resp) {
          showMenuConfig.data = (0, _objectAssign["default"])({}, resp, {
            target: event.target
          });
          (0, _actions.showMenu)(showMenuConfig);
        });
      } else {
        showMenuConfig.data = (0, _objectAssign["default"])({}, data, {
          target: event.target
        });
        (0, _actions.showMenu)(showMenuConfig);
      }
    });

    _defineProperty(_assertThisInitialized(_this), "elemRef", function (c) {
      _this.elem = c;
    });

    return _this;
  }

  _createClass(ContextMenuTrigger, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          renderTag = _this$props.renderTag,
          attributes = _this$props.attributes,
          children = _this$props.children;
      var newAttrs = (0, _objectAssign["default"])({}, attributes, {
        className: (0, _classnames["default"])(_helpers.cssClasses.menuWrapper, attributes.className),
        onContextMenu: this.handleContextMenu,
        onClick: this.handleMouseClick,
        onMouseDown: this.handleMouseDown,
        onMouseUp: this.handleMouseUp,
        onTouchStart: this.handleTouchstart,
        onTouchEnd: this.handleTouchEnd,
        onMouseOut: this.handleMouseOut,
        ref: this.elemRef
      });
      return /*#__PURE__*/_react["default"].createElement(renderTag, newAttrs, children);
    }
  }]);

  return ContextMenuTrigger;
}(_react.Component);

exports["default"] = ContextMenuTrigger;

_defineProperty(ContextMenuTrigger, "propTypes", {
  id: _propTypes["default"].string.isRequired,
  children: _propTypes["default"].node.isRequired,
  attributes: _propTypes["default"].object,
  collect: _propTypes["default"].func,
  disable: _propTypes["default"].bool,
  holdToDisplay: _propTypes["default"].number,
  posX: _propTypes["default"].number,
  posY: _propTypes["default"].number,
  renderTag: _propTypes["default"].elementType,
  mouseButton: _propTypes["default"].number,
  disableIfShiftIsPressed: _propTypes["default"].bool
});

_defineProperty(ContextMenuTrigger, "defaultProps", {
  attributes: {},
  collect: function collect() {
    return null;
  },
  disable: false,
  holdToDisplay: 1000,
  renderTag: 'div',
  posX: 0,
  posY: 0,
  mouseButton: 2,
  // 0 is left click, 2 is right click
  disableIfShiftIsPressed: false
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/MenuItem.js":
/*!******************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/MenuItem.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_237469__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__nested_webpack_require_237469__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_237469__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _classnames = _interopRequireDefault(__nested_webpack_require_237469__(/*! classnames */ "../../../../node_modules/classnames/index.js"));

var _objectAssign = _interopRequireDefault(__nested_webpack_require_237469__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _actions = __nested_webpack_require_237469__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _helpers = __nested_webpack_require_237469__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var MenuItem = /*#__PURE__*/function (_Component) {
  _inherits(MenuItem, _Component);

  var _super = _createSuper(MenuItem);

  function MenuItem() {
    var _this;

    _classCallCheck(this, MenuItem);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
      if (event.button !== 0 && event.button !== 1) {
        event.preventDefault();
      }

      if (_this.props.disabled || _this.props.divider) return;
      (0, _helpers.callIfExists)(_this.props.onClick, event, (0, _objectAssign["default"])({}, _this.props.data, _helpers.store.data), _helpers.store.target);
      if (_this.props.preventClose) return;
      (0, _actions.hideMenu)();
    });

    return _this;
  }

  _createClass(MenuItem, [{
    key: "render",
    value: function render() {
      var _cx,
          _this2 = this;

      var _this$props = this.props,
          attributes = _this$props.attributes,
          children = _this$props.children,
          className = _this$props.className,
          disabled = _this$props.disabled,
          divider = _this$props.divider,
          selected = _this$props.selected;
      var menuItemClassNames = (0, _classnames["default"])(className, _helpers.cssClasses.menuItem, attributes.className, (_cx = {}, _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemDisabled, attributes.disabledClassName), disabled), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemDivider, attributes.dividerClassName), divider), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemSelected, attributes.selectedClassName), selected), _cx));
      return /*#__PURE__*/_react["default"].createElement("div", _extends({}, attributes, {
        className: menuItemClassNames,
        role: "menuitem",
        tabIndex: "-1",
        "aria-disabled": disabled ? 'true' : 'false',
        "aria-orientation": divider ? 'horizontal' : null,
        ref: function ref(_ref) {
          _this2.ref = _ref;
        },
        onMouseMove: this.props.onMouseMove,
        onMouseLeave: this.props.onMouseLeave,
        onTouchEnd: this.handleClick,
        onClick: this.handleClick
      }), divider ? null : children);
    }
  }]);

  return MenuItem;
}(_react.Component);

exports["default"] = MenuItem;

_defineProperty(MenuItem, "propTypes", {
  attributes: _propTypes["default"].object,
  children: _propTypes["default"].node,
  className: _propTypes["default"].string,
  data: _propTypes["default"].object,
  disabled: _propTypes["default"].bool,
  divider: _propTypes["default"].bool,
  onClick: _propTypes["default"].func,
  onMouseLeave: _propTypes["default"].func,
  onMouseMove: _propTypes["default"].func,
  preventClose: _propTypes["default"].bool,
  selected: _propTypes["default"].bool
});

_defineProperty(MenuItem, "defaultProps", {
  attributes: {},
  children: null,
  className: '',
  data: {},
  disabled: false,
  divider: false,
  onClick: function onClick() {
    return null;
  },
  onMouseMove: function onMouseMove() {
    return null;
  },
  onMouseLeave: function onMouseLeave() {
    return null;
  },
  preventClose: false,
  selected: false
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/SubMenu.js":
/*!*****************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/SubMenu.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_246995__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireDefault(__nested_webpack_require_246995__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_246995__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _classnames = _interopRequireDefault(__nested_webpack_require_246995__(/*! classnames */ "../../../../node_modules/classnames/index.js"));

var _objectAssign = _interopRequireDefault(__nested_webpack_require_246995__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _actions = __nested_webpack_require_246995__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _AbstractMenu2 = _interopRequireDefault(__nested_webpack_require_246995__(/*! ./AbstractMenu */ "../../../../node_modules/react-contextmenu/es6/AbstractMenu.js"));

var _helpers = __nested_webpack_require_246995__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

var _globalEventListener = _interopRequireDefault(__nested_webpack_require_246995__(/*! ./globalEventListener */ "../../../../node_modules/react-contextmenu/es6/globalEventListener.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var SubMenu = /*#__PURE__*/function (_AbstractMenu) {
  _inherits(SubMenu, _AbstractMenu);

  var _super = _createSuper(SubMenu);

  function SubMenu(props) {
    var _this;

    _classCallCheck(this, SubMenu);

    _this = _super.call(this, props);

    _defineProperty(_assertThisInitialized(_this), "getMenuPosition", function () {
      var _window = window,
          innerWidth = _window.innerWidth,
          innerHeight = _window.innerHeight;

      var rect = _this.subMenu.getBoundingClientRect();

      var position = {};

      if (rect.bottom > innerHeight) {
        position.bottom = 0;
      } else {
        position.top = 0;
      }

      if (rect.right < innerWidth) {
        position.left = '100%';
      } else {
        position.right = '100%';
      }

      return position;
    });

    _defineProperty(_assertThisInitialized(_this), "getRTLMenuPosition", function () {
      var _window2 = window,
          innerHeight = _window2.innerHeight;

      var rect = _this.subMenu.getBoundingClientRect();

      var position = {};

      if (rect.bottom > innerHeight) {
        position.bottom = 0;
      } else {
        position.top = 0;
      }

      if (rect.left < 0) {
        position.left = '100%';
      } else {
        position.right = '100%';
      }

      return position;
    });

    _defineProperty(_assertThisInitialized(_this), "hideMenu", function (e) {
      e.preventDefault();

      _this.hideSubMenu(e);
    });

    _defineProperty(_assertThisInitialized(_this), "hideSubMenu", function (e) {
      // avoid closing submenus of a different menu tree
      if (e.detail && e.detail.id && _this.menu && e.detail.id !== _this.menu.id) {
        return;
      }

      if (_this.props.forceOpen) {
        _this.props.forceClose();
      }

      _this.setState({
        visible: false,
        selectedItem: null
      });

      _this.unregisterHandlers();
    });

    _defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
      event.preventDefault();
      if (_this.props.disabled) return;
      (0, _helpers.callIfExists)(_this.props.onClick, event, (0, _objectAssign["default"])({}, _this.props.data, _helpers.store.data), _helpers.store.target);
      if (!_this.props.onClick || _this.props.preventCloseOnClick) return;
      (0, _actions.hideMenu)();
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function () {
      if (_this.closetimer) clearTimeout(_this.closetimer);
      if (_this.props.disabled || _this.state.visible) return;
      _this.opentimer = setTimeout(function () {
        return _this.setState({
          visible: true,
          selectedItem: null
        });
      }, _this.props.hoverDelay);
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function () {
      if (_this.opentimer) clearTimeout(_this.opentimer);
      if (!_this.state.visible) return;
      _this.closetimer = setTimeout(function () {
        return _this.setState({
          visible: false,
          selectedItem: null
        });
      }, _this.props.hoverDelay);
    });

    _defineProperty(_assertThisInitialized(_this), "menuRef", function (c) {
      _this.menu = c;
    });

    _defineProperty(_assertThisInitialized(_this), "subMenuRef", function (c) {
      _this.subMenu = c;
    });

    _defineProperty(_assertThisInitialized(_this), "registerHandlers", function () {
      document.removeEventListener('keydown', _this.props.parentKeyNavigationHandler);
      document.addEventListener('keydown', _this.handleKeyNavigation);
    });

    _defineProperty(_assertThisInitialized(_this), "unregisterHandlers", function (dismounting) {
      document.removeEventListener('keydown', _this.handleKeyNavigation);

      if (!dismounting) {
        document.addEventListener('keydown', _this.props.parentKeyNavigationHandler);
      }
    });

    _this.state = (0, _objectAssign["default"])({}, _this.state, {
      visible: false
    });
    return _this;
  }

  _createClass(SubMenu, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.listenId = _globalEventListener["default"].register(function () {}, this.hideSubMenu);
    }
  }, {
    key: "getSubMenuType",
    value: function getSubMenuType() {
      // eslint-disable-line class-methods-use-this
      return SubMenu;
    }
  }, {
    key: "shouldComponentUpdate",
    value: function shouldComponentUpdate(nextProps, nextState) {
      this.isVisibilityChange = (this.state.visible !== nextState.visible || this.props.forceOpen !== nextProps.forceOpen) && !(this.state.visible && nextProps.forceOpen) && !(this.props.forceOpen && nextState.visible);
      return true;
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate() {
      var _this2 = this;

      if (!this.isVisibilityChange) return;

      if (this.props.forceOpen || this.state.visible) {
        var wrapper = window.requestAnimationFrame || setTimeout;
        wrapper(function () {
          var styles = _this2.props.rtl ? _this2.getRTLMenuPosition() : _this2.getMenuPosition();

          _this2.subMenu.style.removeProperty('top');

          _this2.subMenu.style.removeProperty('bottom');

          _this2.subMenu.style.removeProperty('left');

          _this2.subMenu.style.removeProperty('right');

          if ((0, _helpers.hasOwnProp)(styles, 'top')) _this2.subMenu.style.top = styles.top;
          if ((0, _helpers.hasOwnProp)(styles, 'left')) _this2.subMenu.style.left = styles.left;
          if ((0, _helpers.hasOwnProp)(styles, 'bottom')) _this2.subMenu.style.bottom = styles.bottom;
          if ((0, _helpers.hasOwnProp)(styles, 'right')) _this2.subMenu.style.right = styles.right;

          _this2.subMenu.classList.add(_helpers.cssClasses.menuVisible);

          _this2.registerHandlers();

          _this2.setState({
            selectedItem: null
          });
        });
      } else {
        var cleanup = function cleanup() {
          _this2.subMenu.removeEventListener('transitionend', cleanup);

          _this2.subMenu.style.removeProperty('bottom');

          _this2.subMenu.style.removeProperty('right');

          _this2.subMenu.style.top = 0;
          _this2.subMenu.style.left = '100%';

          _this2.unregisterHandlers();
        };

        this.subMenu.addEventListener('transitionend', cleanup);
        this.subMenu.classList.remove(_helpers.cssClasses.menuVisible);
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      if (this.listenId) {
        _globalEventListener["default"].unregister(this.listenId);
      }

      if (this.opentimer) clearTimeout(this.opentimer);
      if (this.closetimer) clearTimeout(this.closetimer);
      this.unregisterHandlers(true);
    }
  }, {
    key: "render",
    value: function render() {
      var _cx;

      var _this$props = this.props,
          children = _this$props.children,
          attributes = _this$props.attributes,
          disabled = _this$props.disabled,
          title = _this$props.title,
          selected = _this$props.selected;
      var visible = this.state.visible;
      var menuProps = {
        ref: this.menuRef,
        onMouseEnter: this.handleMouseEnter,
        onMouseLeave: this.handleMouseLeave,
        className: (0, _classnames["default"])(_helpers.cssClasses.menuItem, _helpers.cssClasses.subMenu, attributes.listClassName),
        style: {
          position: 'relative'
        }
      };
      var menuItemProps = {
        className: (0, _classnames["default"])(_helpers.cssClasses.menuItem, attributes.className, (_cx = {}, _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemDisabled, attributes.disabledClassName), disabled), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemActive, attributes.visibleClassName), visible), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemSelected, attributes.selectedClassName), selected), _cx)),
        onMouseMove: this.props.onMouseMove,
        onMouseOut: this.props.onMouseOut,
        onClick: this.handleClick
      };
      var subMenuProps = {
        ref: this.subMenuRef,
        style: {
          position: 'absolute',
          transition: 'opacity 1ms',
          // trigger transitionend event
          top: 0,
          left: '100%'
        },
        className: (0, _classnames["default"])(_helpers.cssClasses.menu, this.props.className)
      };
      return /*#__PURE__*/_react["default"].createElement("nav", _extends({}, menuProps, {
        role: "menuitem",
        tabIndex: "-1",
        "aria-haspopup": "true"
      }), /*#__PURE__*/_react["default"].createElement("div", _extends({}, attributes, menuItemProps), title), /*#__PURE__*/_react["default"].createElement("nav", _extends({}, subMenuProps, {
        role: "menu",
        tabIndex: "-1"
      }), this.renderChildren(children)));
    }
  }]);

  return SubMenu;
}(_AbstractMenu2["default"]);

exports["default"] = SubMenu;

_defineProperty(SubMenu, "propTypes", {
  children: _propTypes["default"].node.isRequired,
  attributes: _propTypes["default"].object,
  title: _propTypes["default"].node.isRequired,
  className: _propTypes["default"].string,
  disabled: _propTypes["default"].bool,
  hoverDelay: _propTypes["default"].number,
  rtl: _propTypes["default"].bool,
  selected: _propTypes["default"].bool,
  onMouseMove: _propTypes["default"].func,
  onMouseOut: _propTypes["default"].func,
  forceOpen: _propTypes["default"].bool,
  forceClose: _propTypes["default"].func,
  parentKeyNavigationHandler: _propTypes["default"].func
});

_defineProperty(SubMenu, "defaultProps", {
  disabled: false,
  hoverDelay: 500,
  attributes: {},
  className: '',
  rtl: false,
  selected: false,
  onMouseMove: function onMouseMove() {
    return null;
  },
  onMouseOut: function onMouseOut() {
    return null;
  },
  forceOpen: false,
  forceClose: function forceClose() {
    return null;
  },
  parentKeyNavigationHandler: function parentKeyNavigationHandler() {
    return null;
  }
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/actions.js":
/*!*****************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/actions.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_262452__) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.MENU_SHOW = exports.MENU_HIDE = void 0;
exports.dispatchGlobalEvent = dispatchGlobalEvent;
exports.hideMenu = hideMenu;
exports.showMenu = showMenu;

var _objectAssign = _interopRequireDefault(__nested_webpack_require_262452__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _helpers = __nested_webpack_require_262452__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var MENU_SHOW = 'REACT_CONTEXTMENU_SHOW';
exports.MENU_SHOW = MENU_SHOW;
var MENU_HIDE = 'REACT_CONTEXTMENU_HIDE';
exports.MENU_HIDE = MENU_HIDE;

function dispatchGlobalEvent(eventName, opts) {
  var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window;
  // Compatibale with IE
  // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
  var event;

  if (typeof window.CustomEvent === 'function') {
    event = new window.CustomEvent(eventName, {
      detail: opts
    });
  } else {
    event = document.createEvent('CustomEvent');
    event.initCustomEvent(eventName, false, true, opts);
  }

  if (target) {
    target.dispatchEvent(event);
    (0, _objectAssign["default"])(_helpers.store, opts);
  }
}

function showMenu() {
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var target = arguments.length > 1 ? arguments[1] : undefined;
  dispatchGlobalEvent(MENU_SHOW, (0, _objectAssign["default"])({}, opts, {
    type: MENU_SHOW
  }), target);
}

function hideMenu() {
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var target = arguments.length > 1 ? arguments[1] : undefined;
  dispatchGlobalEvent(MENU_HIDE, (0, _objectAssign["default"])({}, opts, {
    type: MENU_HIDE
  }), target);
}

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/connectMenu.js":
/*!*********************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/connectMenu.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_264783__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = _default;

var _react = _interopRequireWildcard(__nested_webpack_require_264783__(/*! react */ "../../../../node_modules/react/index.js"));

var _ContextMenuTrigger = _interopRequireDefault(__nested_webpack_require_264783__(/*! ./ContextMenuTrigger */ "../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js"));

var _globalEventListener = _interopRequireDefault(__nested_webpack_require_264783__(/*! ./globalEventListener */ "../../../../node_modules/react-contextmenu/es6/globalEventListener.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

// collect ContextMenuTrigger's expected props to NOT pass them on as part of the context
var ignoredTriggerProps = [].concat(_toConsumableArray(Object.keys(_ContextMenuTrigger["default"].propTypes)), ['children']); // expect the id of the menu to be responsible for as outer parameter

function _default(menuId) {
  // expect menu component to connect as inner parameter
  // <Child/> is presumably a wrapper of <ContextMenu/>
  return function connect(Child) {
    // return wrapper for <Child/> that forwards the ContextMenuTrigger's additional props
    return /*#__PURE__*/function (_Component) {
      _inherits(ConnectMenu, _Component);

      var _super = _createSuper(ConnectMenu);

      function ConnectMenu(props) {
        var _this;

        _classCallCheck(this, ConnectMenu);

        _this = _super.call(this, props);

        _defineProperty(_assertThisInitialized(_this), "handleShow", function (e) {
          if (e.detail.id !== menuId) return; // the onShow event's detail.data object holds all ContextMenuTrigger props

          var data = e.detail.data;
          var filteredData = {};

          for (var key in data) {
            // exclude props the ContextMenuTrigger is expecting itself
            if (!ignoredTriggerProps.includes(key)) {
              filteredData[key] = data[key];
            }
          }

          _this.setState({
            trigger: filteredData
          });
        });

        _defineProperty(_assertThisInitialized(_this), "handleHide", function () {
          _this.setState({
            trigger: null
          });
        });

        _this.state = {
          trigger: null
        };
        return _this;
      }

      _createClass(ConnectMenu, [{
        key: "componentDidMount",
        value: function componentDidMount() {
          this.listenId = _globalEventListener["default"].register(this.handleShow, this.handleHide);
        }
      }, {
        key: "componentWillUnmount",
        value: function componentWillUnmount() {
          if (this.listenId) {
            _globalEventListener["default"].unregister(this.listenId);
          }
        }
      }, {
        key: "render",
        value: function render() {
          return /*#__PURE__*/_react["default"].createElement(Child, _extends({}, this.props, {
            id: menuId,
            trigger: this.state.trigger
          }));
        }
      }]);

      return ConnectMenu;
    }(_react.Component);
  };
}

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/globalEventListener.js":
/*!*****************************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/globalEventListener.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_274357__) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _actions = __nested_webpack_require_274357__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _helpers = __nested_webpack_require_274357__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var GlobalEventListener = /*#__PURE__*/_createClass(function GlobalEventListener() {
  var _this = this;

  _classCallCheck(this, GlobalEventListener);

  _defineProperty(this, "handleShowEvent", function (event) {
    for (var id in _this.callbacks) {
      if ((0, _helpers.hasOwnProp)(_this.callbacks, id)) _this.callbacks[id].show(event);
    }
  });

  _defineProperty(this, "handleHideEvent", function (event) {
    for (var id in _this.callbacks) {
      if ((0, _helpers.hasOwnProp)(_this.callbacks, id)) _this.callbacks[id].hide(event);
    }
  });

  _defineProperty(this, "register", function (showCallback, hideCallback) {
    var id = (0, _helpers.uniqueId)();
    _this.callbacks[id] = {
      show: showCallback,
      hide: hideCallback
    };
    return id;
  });

  _defineProperty(this, "unregister", function (id) {
    if (id && _this.callbacks[id]) {
      delete _this.callbacks[id];
    }
  });

  this.callbacks = {};

  if (_helpers.canUseDOM) {
    window.addEventListener(_actions.MENU_SHOW, this.handleShowEvent);
    window.addEventListener(_actions.MENU_HIDE, this.handleHideEvent);
  }
});

var _default = new GlobalEventListener();

exports["default"] = _default;

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/helpers.js":
/*!*****************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/helpers.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.callIfExists = callIfExists;
exports.cssClasses = exports.canUseDOM = void 0;
exports.hasOwnProp = hasOwnProp;
exports.store = void 0;
exports.uniqueId = uniqueId;

function callIfExists(func) {
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    args[_key - 1] = arguments[_key];
  }

  return typeof func === 'function' && func.apply(void 0, args);
}

function hasOwnProp(obj, prop) {
  return Object.prototype.hasOwnProperty.call(obj, prop);
}

function uniqueId() {
  return Math.random().toString(36).substring(7);
}

var cssClasses = {
  menu: 'react-contextmenu',
  menuVisible: 'react-contextmenu--visible',
  menuWrapper: 'react-contextmenu-wrapper',
  menuItem: 'react-contextmenu-item',
  menuItemActive: 'react-contextmenu-item--active',
  menuItemDisabled: 'react-contextmenu-item--disabled',
  menuItemDivider: 'react-contextmenu-item--divider',
  menuItemSelected: 'react-contextmenu-item--selected',
  subMenu: 'react-contextmenu-submenu'
};
exports.cssClasses = cssClasses;
var store = {};
exports.store = store;
var canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
exports.canUseDOM = canUseDOM;

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/index.js":
/*!***************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/index.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_278884__) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
Object.defineProperty(exports, "ContextMenu", ({
  enumerable: true,
  get: function get() {
    return _ContextMenu["default"];
  }
}));
Object.defineProperty(exports, "ContextMenuTrigger", ({
  enumerable: true,
  get: function get() {
    return _ContextMenuTrigger["default"];
  }
}));
Object.defineProperty(exports, "MenuItem", ({
  enumerable: true,
  get: function get() {
    return _MenuItem["default"];
  }
}));
Object.defineProperty(exports, "SubMenu", ({
  enumerable: true,
  get: function get() {
    return _SubMenu["default"];
  }
}));
Object.defineProperty(exports, "connectMenu", ({
  enumerable: true,
  get: function get() {
    return _connectMenu["default"];
  }
}));
Object.defineProperty(exports, "hideMenu", ({
  enumerable: true,
  get: function get() {
    return _actions.hideMenu;
  }
}));
Object.defineProperty(exports, "showMenu", ({
  enumerable: true,
  get: function get() {
    return _actions.showMenu;
  }
}));

var _ContextMenu = _interopRequireDefault(__nested_webpack_require_278884__(/*! ./ContextMenu */ "../../../../node_modules/react-contextmenu/es6/ContextMenu.js"));

var _ContextMenuTrigger = _interopRequireDefault(__nested_webpack_require_278884__(/*! ./ContextMenuTrigger */ "../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js"));

var _MenuItem = _interopRequireDefault(__nested_webpack_require_278884__(/*! ./MenuItem */ "../../../../node_modules/react-contextmenu/es6/MenuItem.js"));

var _SubMenu = _interopRequireDefault(__nested_webpack_require_278884__(/*! ./SubMenu */ "../../../../node_modules/react-contextmenu/es6/SubMenu.js"));

var _connectMenu = _interopRequireDefault(__nested_webpack_require_278884__(/*! ./connectMenu */ "../../../../node_modules/react-contextmenu/es6/connectMenu.js"));

var _actions = __nested_webpack_require_278884__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

/***/ }),

/***/ "../../../../node_modules/react-dom/cjs/react-dom.development.js":
/*!***********************************************************************!*\
  !*** ../../../../node_modules/react-dom/cjs/react-dom.development.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_281268__) => {

"use strict";
/** @license React v17.0.2
 * react-dom.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var React = __nested_webpack_require_281268__(/*! react */ "../../../../node_modules/react/index.js");
var _assign = __nested_webpack_require_281268__(/*! object-assign */ "../../../../node_modules/object-assign/index.js");
var Scheduler = __nested_webpack_require_281268__(/*! scheduler */ "../../../../node_modules/scheduler/index.js");
var tracing = __nested_webpack_require_281268__(/*! scheduler/tracing */ "../../../../node_modules/scheduler/tracing.js");

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

// by calls to these methods by a Babel plugin.
//
// In PROD (or in packages without access to React internals),
// they are left as they are instead.

function warn(format) {
  {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    printWarning('warn', format, args);
  }
}
function error(format) {
  {
    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      args[_key2 - 1] = arguments[_key2];
    }

    printWarning('error', format, args);
  }
}

function printWarning(level, format, args) {
  // When changing this logic, you might want to also
  // update consoleWithStackDev.www.js as well.
  {
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();

    if (stack !== '') {
      format += '%s';
      args = args.concat([stack]);
    }

    var argsWithFormat = args.map(function (item) {
      return '' + item;
    }); // Careful: RN currently depends on this prefix

    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
    // breaks IE9: https://github.com/facebook/react/issues/13610
    // eslint-disable-next-line react-internal/no-production-logging

    Function.prototype.apply.call(console[level], console, argsWithFormat);
  }
}

if (!React) {
  {
    throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." );
  }
}

var FunctionComponent = 0;
var ClassComponent = 1;
var IndeterminateComponent = 2; // Before we know whether it is function or class

var HostRoot = 3; // Root of a host tree. Could be nested inside another node.

var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.

var HostComponent = 5;
var HostText = 6;
var Fragment = 7;
var Mode = 8;
var ContextConsumer = 9;
var ContextProvider = 10;
var ForwardRef = 11;
var Profiler = 12;
var SuspenseComponent = 13;
var MemoComponent = 14;
var SimpleMemoComponent = 15;
var LazyComponent = 16;
var IncompleteClassComponent = 17;
var DehydratedFragment = 18;
var SuspenseListComponent = 19;
var FundamentalComponent = 20;
var ScopeComponent = 21;
var Block = 22;
var OffscreenComponent = 23;
var LegacyHiddenComponent = 24;

// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.

var enableProfilerTimer = true; // Record durations for commit and passive effects phases.

var enableFundamentalAPI = false; // Experimental Scope support.
var enableNewReconciler = false; // Errors that are thrown while unmounting (or after in the case of passive effects)
var warnAboutStringRefs = false;

var allNativeEvents = new Set();
/**
 * Mapping from registration name to event name
 */


var registrationNameDependencies = {};
/**
 * Mapping from lowercase registration names to the properly cased version,
 * used to warn in the case of missing event handlers. Available
 * only in true.
 * @type {Object}
 */

var possibleRegistrationNames =  {} ; // Trust the developer to only use possibleRegistrationNames in true

function registerTwoPhaseEvent(registrationName, dependencies) {
  registerDirectEvent(registrationName, dependencies);
  registerDirectEvent(registrationName + 'Capture', dependencies);
}
function registerDirectEvent(registrationName, dependencies) {
  {
    if (registrationNameDependencies[registrationName]) {
      error('EventRegistry: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName);
    }
  }

  registrationNameDependencies[registrationName] = dependencies;

  {
    var lowerCasedName = registrationName.toLowerCase();
    possibleRegistrationNames[lowerCasedName] = registrationName;

    if (registrationName === 'onDoubleClick') {
      possibleRegistrationNames.ondblclick = registrationName;
    }
  }

  for (var i = 0; i < dependencies.length; i++) {
    allNativeEvents.add(dependencies[i]);
  }
}

var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');

// A reserved attribute.
// It is handled by React separately and shouldn't be written to the DOM.
var RESERVED = 0; // A simple string attribute.
// Attributes that aren't in the filter are presumed to have this type.

var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
// "enumerated" attributes with "true" and "false" as possible values.
// When true, it should be set to a "true" string.
// When false, it should be set to a "false" string.

var BOOLEANISH_STRING = 2; // A real boolean attribute.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.

var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
// For any other value, should be present with that value.

var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
// When falsy, it should be removed.

var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
// When falsy, it should be removed.

var POSITIVE_NUMERIC = 6;

/* eslint-disable max-len */
var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
/* eslint-enable max-len */

var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
var hasOwnProperty = Object.prototype.hasOwnProperty;
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};
function isAttributeNameSafe(attributeName) {
  if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
    return true;
  }

  if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
    return false;
  }

  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
    validatedAttributeNameCache[attributeName] = true;
    return true;
  }

  illegalAttributeNameCache[attributeName] = true;

  {
    error('Invalid attribute name: `%s`', attributeName);
  }

  return false;
}
function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null) {
    return propertyInfo.type === RESERVED;
  }

  if (isCustomComponentTag) {
    return false;
  }

  if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
    return true;
  }

  return false;
}
function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null && propertyInfo.type === RESERVED) {
    return false;
  }

  switch (typeof value) {
    case 'function': // $FlowIssue symbol is perfectly valid here

    case 'symbol':
      // eslint-disable-line
      return true;

    case 'boolean':
      {
        if (isCustomComponentTag) {
          return false;
        }

        if (propertyInfo !== null) {
          return !propertyInfo.acceptsBooleans;
        } else {
          var prefix = name.toLowerCase().slice(0, 5);
          return prefix !== 'data-' && prefix !== 'aria-';
        }
      }

    default:
      return false;
  }
}
function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
  if (value === null || typeof value === 'undefined') {
    return true;
  }

  if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
    return true;
  }

  if (isCustomComponentTag) {
    return false;
  }

  if (propertyInfo !== null) {

    switch (propertyInfo.type) {
      case BOOLEAN:
        return !value;

      case OVERLOADED_BOOLEAN:
        return value === false;

      case NUMERIC:
        return isNaN(value);

      case POSITIVE_NUMERIC:
        return isNaN(value) || value < 1;
    }
  }

  return false;
}
function getPropertyInfo(name) {
  return properties.hasOwnProperty(name) ? properties[name] : null;
}

function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
  this.attributeName = attributeName;
  this.attributeNamespace = attributeNamespace;
  this.mustUseProperty = mustUseProperty;
  this.propertyName = name;
  this.type = type;
  this.sanitizeURL = sanitizeURL;
  this.removeEmptyString = removeEmptyString;
} // When adding attributes to this list, be sure to also add them to
// the `possibleStandardNames` module to ensure casing and incorrect
// name warnings.


var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.

var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
// elements (not just inputs). Now that ReactDOMInput assigns to the
// defaultValue property -- do we need this?
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
reservedProps.forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // A few React string attributes have a different name.
// This is a mapping from React prop names to the attribute names.

[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
  var name = _ref[0],
      attributeName = _ref[1];
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are "enumerated" HTML attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).

['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are "enumerated" SVG attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
// Since these are SVG attributes, their attribute names are case-sensitive.

['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are HTML boolean attributes.

['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
// on the client side because the browsers are inconsistent. Instead we call focus().
'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
'itemScope'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are the few React props that we set as DOM properties
// rather than attributes. These are all booleans.

['checked', // Note: `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`. We have special logic for handling this.
'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are HTML attributes that are "overloaded booleans": they behave like
// booleans, but can also accept a string value.

['capture', 'download' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are HTML attributes that must be positive numbers.

['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are HTML attributes that must be numbers.

['rowSpan', 'start'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
});
var CAMELIZE = /[\-\:]([a-z])/g;

var capitalize = function (token) {
  return token[1].toUpperCase();
}; // This is a list of all SVG attributes that need special casing, namespacing,
// or boolean value assignment. Regular attributes that just accept strings
// and have the same names are omitted, just like in the HTML attribute filter.
// Some of these attributes can be hard to find. This list was created by
// scraping the MDN documentation.


['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // String SVG attributes with the xlink namespace.

['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL
  false);
}); // String SVG attributes with the xml namespace.

['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL
  false);
}); // These attribute exists both in HTML and SVG.
// The attribute name is case-sensitive in SVG so we can't just use
// the React name like we do for attributes that exist only in HTML.

['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  attributeName.toLowerCase(), // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These attributes accept URLs. These must not allow javascript: URLS.
// These will also need to accept Trusted Types object in the future.

var xlinkHref = 'xlinkHref';
properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL
false);
['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  attributeName.toLowerCase(), // attributeName
  null, // attributeNamespace
  true, // sanitizeURL
  true);
});

// and any newline or tab are filtered out as if they're not part of the URL.
// https://url.spec.whatwg.org/#url-parsing
// Tab or newline are defined as \r\n\t:
// https://infra.spec.whatwg.org/#ascii-tab-or-newline
// A C0 control is a code point in the range \u0000 NULL to \u001F
// INFORMATION SEPARATOR ONE, inclusive:
// https://infra.spec.whatwg.org/#c0-control-or-space

/* eslint-disable max-len */

var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
var didWarn = false;

function sanitizeURL(url) {
  {
    if (!didWarn && isJavaScriptProtocol.test(url)) {
      didWarn = true;

      error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
    }
  }
}

/**
 * Get the value for a property on a node. Only used in DEV for SSR validation.
 * The "expected" argument is used as a hint of what the expected value is.
 * Some properties have multiple equivalent values.
 */
function getValueForProperty(node, name, expected, propertyInfo) {
  {
    if (propertyInfo.mustUseProperty) {
      var propertyName = propertyInfo.propertyName;
      return node[propertyName];
    } else {
      if ( propertyInfo.sanitizeURL) {
        // If we haven't fully disabled javascript: URLs, and if
        // the hydration is successful of a javascript: URL, we
        // still want to warn on the client.
        sanitizeURL('' + expected);
      }

      var attributeName = propertyInfo.attributeName;
      var stringValue = null;

      if (propertyInfo.type === OVERLOADED_BOOLEAN) {
        if (node.hasAttribute(attributeName)) {
          var value = node.getAttribute(attributeName);

          if (value === '') {
            return true;
          }

          if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
            return value;
          }

          if (value === '' + expected) {
            return expected;
          }

          return value;
        }
      } else if (node.hasAttribute(attributeName)) {
        if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
          // We had an attribute but shouldn't have had one, so read it
          // for the error message.
          return node.getAttribute(attributeName);
        }

        if (propertyInfo.type === BOOLEAN) {
          // If this was a boolean, it doesn't matter what the value is
          // the fact that we have it is the same as the expected.
          return expected;
        } // Even if this property uses a namespace we use getAttribute
        // because we assume its namespaced name is the same as our config.
        // To use getAttributeNS we need the local name which we don't have
        // in our config atm.


        stringValue = node.getAttribute(attributeName);
      }

      if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
        return stringValue === null ? expected : stringValue;
      } else if (stringValue === '' + expected) {
        return expected;
      } else {
        return stringValue;
      }
    }
  }
}
/**
 * Get the value for a attribute on a node. Only used in DEV for SSR validation.
 * The third argument is used as a hint of what the expected value is. Some
 * attributes have multiple equivalent values.
 */

function getValueForAttribute(node, name, expected) {
  {
    if (!isAttributeNameSafe(name)) {
      return;
    } // If the object is an opaque reference ID, it's expected that
    // the next prop is different than the server value, so just return
    // expected


    if (isOpaqueHydratingObject(expected)) {
      return expected;
    }

    if (!node.hasAttribute(name)) {
      return expected === undefined ? undefined : null;
    }

    var value = node.getAttribute(name);

    if (value === '' + expected) {
      return expected;
    }

    return value;
  }
}
/**
 * Sets the value for a property on a node.
 *
 * @param {DOMElement} node
 * @param {string} name
 * @param {*} value
 */

function setValueForProperty(node, name, value, isCustomComponentTag) {
  var propertyInfo = getPropertyInfo(name);

  if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
    return;
  }

  if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
    value = null;
  } // If the prop isn't in the special list, treat it as a simple attribute.


  if (isCustomComponentTag || propertyInfo === null) {
    if (isAttributeNameSafe(name)) {
      var _attributeName = name;

      if (value === null) {
        node.removeAttribute(_attributeName);
      } else {
        node.setAttribute(_attributeName,  '' + value);
      }
    }

    return;
  }

  var mustUseProperty = propertyInfo.mustUseProperty;

  if (mustUseProperty) {
    var propertyName = propertyInfo.propertyName;

    if (value === null) {
      var type = propertyInfo.type;
      node[propertyName] = type === BOOLEAN ? false : '';
    } else {
      // Contrary to `setAttribute`, object properties are properly
      // `toString`ed by IE8/9.
      node[propertyName] = value;
    }

    return;
  } // The rest are treated as attributes with special cases.


  var attributeName = propertyInfo.attributeName,
      attributeNamespace = propertyInfo.attributeNamespace;

  if (value === null) {
    node.removeAttribute(attributeName);
  } else {
    var _type = propertyInfo.type;
    var attributeValue;

    if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
      // If attribute type is boolean, we know for sure it won't be an execution sink
      // and we won't require Trusted Type here.
      attributeValue = '';
    } else {
      // `setAttribute` with objects becomes only `[object]` in IE8/9,
      // ('' + value) makes it output the correct toString()-value.
      {
        attributeValue = '' + value;
      }

      if (propertyInfo.sanitizeURL) {
        sanitizeURL(attributeValue.toString());
      }
    }

    if (attributeNamespace) {
      node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
    } else {
      node.setAttribute(attributeName, attributeValue);
    }
  }
}

// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
var REACT_FRAGMENT_TYPE = 0xeacb;
var REACT_STRICT_MODE_TYPE = 0xeacc;
var REACT_PROFILER_TYPE = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
var REACT_SUSPENSE_TYPE = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_BLOCK_TYPE = 0xead9;
var REACT_SERVER_BLOCK_TYPE = 0xeada;
var REACT_FUNDAMENTAL_TYPE = 0xead5;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;

if (typeof Symbol === 'function' && Symbol.for) {
  var symbolFor = Symbol.for;
  REACT_ELEMENT_TYPE = symbolFor('react.element');
  REACT_PORTAL_TYPE = symbolFor('react.portal');
  REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
  REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
  REACT_PROFILER_TYPE = symbolFor('react.profiler');
  REACT_PROVIDER_TYPE = symbolFor('react.provider');
  REACT_CONTEXT_TYPE = symbolFor('react.context');
  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
  REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
  REACT_MEMO_TYPE = symbolFor('react.memo');
  REACT_LAZY_TYPE = symbolFor('react.lazy');
  REACT_BLOCK_TYPE = symbolFor('react.block');
  REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
  REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
  REACT_SCOPE_TYPE = symbolFor('react.scope');
  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
}

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }

  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];

  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }

  return null;
}

// Helpers to patch console.logs to avoid logging during side-effect free
// replaying on render function. This currently only patches the object
// lazily which won't cover if the log function was extracted eagerly.
// We could also eagerly patch the method.
var disabledDepth = 0;
var prevLog;
var prevInfo;
var prevWarn;
var prevError;
var prevGroup;
var prevGroupCollapsed;
var prevGroupEnd;

function disabledLog() {}

disabledLog.__reactDisabledLog = true;
function disableLogs() {
  {
    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      prevLog = console.log;
      prevInfo = console.info;
      prevWarn = console.warn;
      prevError = console.error;
      prevGroup = console.group;
      prevGroupCollapsed = console.groupCollapsed;
      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099

      var props = {
        configurable: true,
        enumerable: true,
        value: disabledLog,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        info: props,
        log: props,
        warn: props,
        error: props,
        group: props,
        groupCollapsed: props,
        groupEnd: props
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    disabledDepth++;
  }
}
function reenableLogs() {
  {
    disabledDepth--;

    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      var props = {
        configurable: true,
        enumerable: true,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        log: _assign({}, props, {
          value: prevLog
        }),
        info: _assign({}, props, {
          value: prevInfo
        }),
        warn: _assign({}, props, {
          value: prevWarn
        }),
        error: _assign({}, props, {
          value: prevError
        }),
        group: _assign({}, props, {
          value: prevGroup
        }),
        groupCollapsed: _assign({}, props, {
          value: prevGroupCollapsed
        }),
        groupEnd: _assign({}, props, {
          value: prevGroupEnd
        })
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    if (disabledDepth < 0) {
      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
    }
  }
}

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name, source, ownerFn) {
  {
    if (prefix === undefined) {
      // Extract the VM specific prefix used by each line.
      try {
        throw Error();
      } catch (x) {
        var match = x.stack.trim().match(/\n( *(at )?)/);
        prefix = match && match[1] || '';
      }
    } // We use the prefix to ensure our stacks line up with native stack frames.


    return '\n' + prefix + name;
  }
}
var reentry = false;
var componentFrameCache;

{
  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
  componentFrameCache = new PossiblyWeakMap();
}

function describeNativeComponentFrame(fn, construct) {
  // If something asked for a stack inside a fake render, it should get ignored.
  if (!fn || reentry) {
    return '';
  }

  {
    var frame = componentFrameCache.get(fn);

    if (frame !== undefined) {
      return frame;
    }
  }

  var control;
  reentry = true;
  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.

  Error.prepareStackTrace = undefined;
  var previousDispatcher;

  {
    previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
    // for warnings.

    ReactCurrentDispatcher.current = null;
    disableLogs();
  }

  try {
    // This should throw.
    if (construct) {
      // Something should be setting the props in the constructor.
      var Fake = function () {
        throw Error();
      }; // $FlowFixMe


      Object.defineProperty(Fake.prototype, 'props', {
        set: function () {
          // We use a throwing setter instead of frozen or non-writable props
          // because that won't throw in a non-strict mode function.
          throw Error();
        }
      });

      if (typeof Reflect === 'object' && Reflect.construct) {
        // We construct a different control for this case to include any extra
        // frames added by the construct call.
        try {
          Reflect.construct(Fake, []);
        } catch (x) {
          control = x;
        }

        Reflect.construct(fn, [], Fake);
      } else {
        try {
          Fake.call();
        } catch (x) {
          control = x;
        }

        fn.call(Fake.prototype);
      }
    } else {
      try {
        throw Error();
      } catch (x) {
        control = x;
      }

      fn();
    }
  } catch (sample) {
    // This is inlined manually because closure doesn't do it for us.
    if (sample && control && typeof sample.stack === 'string') {
      // This extracts the first frame from the sample that isn't also in the control.
      // Skipping one frame that we assume is the frame that calls the two.
      var sampleLines = sample.stack.split('\n');
      var controlLines = control.stack.split('\n');
      var s = sampleLines.length - 1;
      var c = controlLines.length - 1;

      while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
        // We expect at least one stack frame to be shared.
        // Typically this will be the root most one. However, stack frames may be
        // cut off due to maximum stack limits. In this case, one maybe cut off
        // earlier than the other. We assume that the sample is longer or the same
        // and there for cut off earlier. So we should find the root most frame in
        // the sample somewhere in the control.
        c--;
      }

      for (; s >= 1 && c >= 0; s--, c--) {
        // Next we find the first one that isn't the same which should be the
        // frame that called our sample function and the control.
        if (sampleLines[s] !== controlLines[c]) {
          // In V8, the first line is describing the message but other VMs don't.
          // If we're about to return the first line, and the control is also on the same
          // line, that's a pretty good indicator that our sample threw at same line as
          // the control. I.e. before we entered the sample frame. So we ignore this result.
          // This can happen if you passed a class to function component, or non-function.
          if (s !== 1 || c !== 1) {
            do {
              s--;
              c--; // We may still have similar intermediate frames from the construct call.
              // The next one that isn't the same should be our match though.

              if (c < 0 || sampleLines[s] !== controlLines[c]) {
                // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
                var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');

                {
                  if (typeof fn === 'function') {
                    componentFrameCache.set(fn, _frame);
                  }
                } // Return the line we found.


                return _frame;
              }
            } while (s >= 1 && c >= 0);
          }

          break;
        }
      }
    }
  } finally {
    reentry = false;

    {
      ReactCurrentDispatcher.current = previousDispatcher;
      reenableLogs();
    }

    Error.prepareStackTrace = previousPrepareStackTrace;
  } // Fallback to just using the name if we couldn't make it throw.


  var name = fn ? fn.displayName || fn.name : '';
  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';

  {
    if (typeof fn === 'function') {
      componentFrameCache.set(fn, syntheticFrame);
    }
  }

  return syntheticFrame;
}

function describeClassComponentFrame(ctor, source, ownerFn) {
  {
    return describeNativeComponentFrame(ctor, true);
  }
}
function describeFunctionComponentFrame(fn, source, ownerFn) {
  {
    return describeNativeComponentFrame(fn, false);
  }
}

function shouldConstruct(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {

  if (type == null) {
    return '';
  }

  if (typeof type === 'function') {
    {
      return describeNativeComponentFrame(type, shouldConstruct(type));
    }
  }

  if (typeof type === 'string') {
    return describeBuiltInComponentFrame(type);
  }

  switch (type) {
    case REACT_SUSPENSE_TYPE:
      return describeBuiltInComponentFrame('Suspense');

    case REACT_SUSPENSE_LIST_TYPE:
      return describeBuiltInComponentFrame('SuspenseList');
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_FORWARD_REF_TYPE:
        return describeFunctionComponentFrame(type.render);

      case REACT_MEMO_TYPE:
        // Memo may contain any component type so we recursively resolve it.
        return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);

      case REACT_BLOCK_TYPE:
        return describeFunctionComponentFrame(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            // Lazy may contain any component type so we recursively resolve it.
            return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
          } catch (x) {}
        }
    }
  }

  return '';
}

function describeFiber(fiber) {
  var owner =  fiber._debugOwner ? fiber._debugOwner.type : null ;
  var source =  fiber._debugSource ;

  switch (fiber.tag) {
    case HostComponent:
      return describeBuiltInComponentFrame(fiber.type);

    case LazyComponent:
      return describeBuiltInComponentFrame('Lazy');

    case SuspenseComponent:
      return describeBuiltInComponentFrame('Suspense');

    case SuspenseListComponent:
      return describeBuiltInComponentFrame('SuspenseList');

    case FunctionComponent:
    case IndeterminateComponent:
    case SimpleMemoComponent:
      return describeFunctionComponentFrame(fiber.type);

    case ForwardRef:
      return describeFunctionComponentFrame(fiber.type.render);

    case Block:
      return describeFunctionComponentFrame(fiber.type._render);

    case ClassComponent:
      return describeClassComponentFrame(fiber.type);

    default:
      return '';
  }
}

function getStackByFiberInDevAndProd(workInProgress) {
  try {
    var info = '';
    var node = workInProgress;

    do {
      info += describeFiber(node);
      node = node.return;
    } while (node);

    return info;
  } catch (x) {
    return '\nError generating stack: ' + x.message + '\n' + x.stack;
  }
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
}

function getContextName(type) {
  return type.displayName || 'Context';
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }

  {
    if (typeof type.tag === 'number') {
      error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }

  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }

  if (typeof type === 'string') {
    return type;
  }

  switch (type) {
    case REACT_FRAGMENT_TYPE:
      return 'Fragment';

    case REACT_PORTAL_TYPE:
      return 'Portal';

    case REACT_PROFILER_TYPE:
      return 'Profiler';

    case REACT_STRICT_MODE_TYPE:
      return 'StrictMode';

    case REACT_SUSPENSE_TYPE:
      return 'Suspense';

    case REACT_SUSPENSE_LIST_TYPE:
      return 'SuspenseList';
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        var context = type;
        return getContextName(context) + '.Consumer';

      case REACT_PROVIDER_TYPE:
        var provider = type;
        return getContextName(provider._context) + '.Provider';

      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');

      case REACT_MEMO_TYPE:
        return getComponentName(type.type);

      case REACT_BLOCK_TYPE:
        return getComponentName(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            return getComponentName(init(payload));
          } catch (x) {
            return null;
          }
        }
    }
  }

  return null;
}

var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var current = null;
var isRendering = false;
function getCurrentFiberOwnerNameInDevOrNull() {
  {
    if (current === null) {
      return null;
    }

    var owner = current._debugOwner;

    if (owner !== null && typeof owner !== 'undefined') {
      return getComponentName(owner.type);
    }
  }

  return null;
}

function getCurrentFiberStackInDev() {
  {
    if (current === null) {
      return '';
    } // Safe because if current fiber exists, we are reconciling,
    // and it is guaranteed to be the work-in-progress version.


    return getStackByFiberInDevAndProd(current);
  }
}

function resetCurrentFiber() {
  {
    ReactDebugCurrentFrame.getCurrentStack = null;
    current = null;
    isRendering = false;
  }
}
function setCurrentFiber(fiber) {
  {
    ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
    current = fiber;
    isRendering = false;
  }
}
function setIsRendering(rendering) {
  {
    isRendering = rendering;
  }
}
function getIsRendering() {
  {
    return isRendering;
  }
}

// Flow does not allow string concatenation of most non-string types. To work
// around this limitation, we use an opaque type that can only be obtained by
// passing the value through getToStringValue first.
function toString(value) {
  return '' + value;
}
function getToStringValue(value) {
  switch (typeof value) {
    case 'boolean':
    case 'number':
    case 'object':
    case 'string':
    case 'undefined':
      return value;

    default:
      // function, symbol are assigned as empty strings
      return '';
  }
}

var hasReadOnlyValue = {
  button: true,
  checkbox: true,
  image: true,
  hidden: true,
  radio: true,
  reset: true,
  submit: true
};
function checkControlledValueProps(tagName, props) {
  {
    if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
      error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    }

    if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
      error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    }
  }
}

function isCheckable(elem) {
  var type = elem.type;
  var nodeName = elem.nodeName;
  return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
}

function getTracker(node) {
  return node._valueTracker;
}

function detachTracker(node) {
  node._valueTracker = null;
}

function getValueFromNode(node) {
  var value = '';

  if (!node) {
    return value;
  }

  if (isCheckable(node)) {
    value = node.checked ? 'true' : 'false';
  } else {
    value = node.value;
  }

  return value;
}

function trackValueOnNode(node) {
  var valueField = isCheckable(node) ? 'checked' : 'value';
  var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
  var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail
  // and don't track value will cause over reporting of changes,
  // but it's better then a hard failure
  // (needed for certain tests that spyOn input values and Safari)

  if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
    return;
  }

  var get = descriptor.get,
      set = descriptor.set;
  Object.defineProperty(node, valueField, {
    configurable: true,
    get: function () {
      return get.call(this);
    },
    set: function (value) {
      currentValue = '' + value;
      set.call(this, value);
    }
  }); // We could've passed this the first time
  // but it triggers a bug in IE11 and Edge 14/15.
  // Calling defineProperty() again should be equivalent.
  // https://github.com/facebook/react/issues/11768

  Object.defineProperty(node, valueField, {
    enumerable: descriptor.enumerable
  });
  var tracker = {
    getValue: function () {
      return currentValue;
    },
    setValue: function (value) {
      currentValue = '' + value;
    },
    stopTracking: function () {
      detachTracker(node);
      delete node[valueField];
    }
  };
  return tracker;
}

function track(node) {
  if (getTracker(node)) {
    return;
  } // TODO: Once it's just Fiber we can move this to node._wrapperState


  node._valueTracker = trackValueOnNode(node);
}
function updateValueIfChanged(node) {
  if (!node) {
    return false;
  }

  var tracker = getTracker(node); // if there is no tracker at this point it's unlikely
  // that trying again will succeed

  if (!tracker) {
    return true;
  }

  var lastValue = tracker.getValue();
  var nextValue = getValueFromNode(node);

  if (nextValue !== lastValue) {
    tracker.setValue(nextValue);
    return true;
  }

  return false;
}

function getActiveElement(doc) {
  doc = doc || (typeof document !== 'undefined' ? document : undefined);

  if (typeof doc === 'undefined') {
    return null;
  }

  try {
    return doc.activeElement || doc.body;
  } catch (e) {
    return doc.body;
  }
}

var didWarnValueDefaultValue = false;
var didWarnCheckedDefaultChecked = false;
var didWarnControlledToUncontrolled = false;
var didWarnUncontrolledToControlled = false;

function isControlled(props) {
  var usesChecked = props.type === 'checkbox' || props.type === 'radio';
  return usesChecked ? props.checked != null : props.value != null;
}
/**
 * Implements an <input> host component that allows setting these optional
 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
 *
 * If `checked` or `value` are not supplied (or null/undefined), user actions
 * that affect the checked state or value will trigger updates to the element.
 *
 * If they are supplied (and not null/undefined), the rendered element will not
 * trigger updates to the element. Instead, the props must change in order for
 * the rendered element to be updated.
 *
 * The rendered element will be initialized as unchecked (or `defaultChecked`)
 * with an empty value (or `defaultValue`).
 *
 * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
 */


function getHostProps(element, props) {
  var node = element;
  var checked = props.checked;

  var hostProps = _assign({}, props, {
    defaultChecked: undefined,
    defaultValue: undefined,
    value: undefined,
    checked: checked != null ? checked : node._wrapperState.initialChecked
  });

  return hostProps;
}
function initWrapperState(element, props) {
  {
    checkControlledValueProps('input', props);

    if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
      error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);

      didWarnCheckedDefaultChecked = true;
    }

    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
      error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);

      didWarnValueDefaultValue = true;
    }
  }

  var node = element;
  var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
  node._wrapperState = {
    initialChecked: props.checked != null ? props.checked : props.defaultChecked,
    initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
    controlled: isControlled(props)
  };
}
function updateChecked(element, props) {
  var node = element;
  var checked = props.checked;

  if (checked != null) {
    setValueForProperty(node, 'checked', checked, false);
  }
}
function updateWrapper(element, props) {
  var node = element;

  {
    var controlled = isControlled(props);

    if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
      error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by the value changing from undefined to ' + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');

      didWarnUncontrolledToControlled = true;
    }

    if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
      error('A component is changing a controlled input to be uncontrolled. ' + 'This is likely caused by the value changing from a defined to ' + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');

      didWarnControlledToUncontrolled = true;
    }
  }

  updateChecked(element, props);
  var value = getToStringValue(props.value);
  var type = props.type;

  if (value != null) {
    if (type === 'number') {
      if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.
      // eslint-disable-next-line
      node.value != value) {
        node.value = toString(value);
      }
    } else if (node.value !== toString(value)) {
      node.value = toString(value);
    }
  } else if (type === 'submit' || type === 'reset') {
    // Submit/reset inputs need the attribute removed completely to avoid
    // blank-text buttons.
    node.removeAttribute('value');
    return;
  }

  {
    // When syncing the value attribute, the value comes from a cascade of
    // properties:
    //  1. The value React property
    //  2. The defaultValue React property
    //  3. Otherwise there should be no change
    if (props.hasOwnProperty('value')) {
      setDefaultValue(node, props.type, value);
    } else if (props.hasOwnProperty('defaultValue')) {
      setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
    }
  }

  {
    // When syncing the checked attribute, it only changes when it needs
    // to be removed, such as transitioning from a checkbox into a text input
    if (props.checked == null && props.defaultChecked != null) {
      node.defaultChecked = !!props.defaultChecked;
    }
  }
}
function postMountWrapper(element, props, isHydrating) {
  var node = element; // Do not assign value if it is already set. This prevents user text input
  // from being lost during SSR hydration.

  if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
    var type = props.type;
    var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the
    // default value provided by the browser. See: #12872

    if (isButton && (props.value === undefined || props.value === null)) {
      return;
    }

    var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input
    // from being lost during SSR hydration.

    if (!isHydrating) {
      {
        // When syncing the value attribute, the value property should use
        // the wrapperState._initialValue property. This uses:
        //
        //   1. The value React property when present
        //   2. The defaultValue React property when present
        //   3. An empty string
        if (initialValue !== node.value) {
          node.value = initialValue;
        }
      }
    }

    {
      // Otherwise, the value attribute is synchronized to the property,
      // so we assign defaultValue to the same thing as the value property
      // assignment step above.
      node.defaultValue = initialValue;
    }
  } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
  // this is needed to work around a chrome bug where setting defaultChecked
  // will sometimes influence the value of checked (even after detachment).
  // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
  // We need to temporarily unset name to avoid disrupting radio button groups.


  var name = node.name;

  if (name !== '') {
    node.name = '';
  }

  {
    // When syncing the checked attribute, both the checked property and
    // attribute are assigned at the same time using defaultChecked. This uses:
    //
    //   1. The checked React property when present
    //   2. The defaultChecked React property when present
    //   3. Otherwise, false
    node.defaultChecked = !node.defaultChecked;
    node.defaultChecked = !!node._wrapperState.initialChecked;
  }

  if (name !== '') {
    node.name = name;
  }
}
function restoreControlledState(element, props) {
  var node = element;
  updateWrapper(node, props);
  updateNamedCousins(node, props);
}

function updateNamedCousins(rootNode, props) {
  var name = props.name;

  if (props.type === 'radio' && name != null) {
    var queryRoot = rootNode;

    while (queryRoot.parentNode) {
      queryRoot = queryRoot.parentNode;
    } // If `rootNode.form` was non-null, then we could try `form.elements`,
    // but that sometimes behaves strangely in IE8. We could also try using
    // `form.getElementsByName`, but that will only return direct children
    // and won't include inputs that use the HTML5 `form=` attribute. Since
    // the input might not even be in a form. It might not even be in the
    // document. Let's just use the local `querySelectorAll` to ensure we don't
    // miss anything.


    var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');

    for (var i = 0; i < group.length; i++) {
      var otherNode = group[i];

      if (otherNode === rootNode || otherNode.form !== rootNode.form) {
        continue;
      } // This will throw if radio buttons rendered by different copies of React
      // and the same name are rendered into the same form (same as #1939).
      // That's probably okay; we don't support it just as we don't support
      // mixing React radio buttons with non-React ones.


      var otherProps = getFiberCurrentPropsFromNode(otherNode);

      if (!otherProps) {
        {
          throw Error( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." );
        }
      } // We need update the tracked value on the named cousin since the value
      // was changed but the input saw no event or value set


      updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that
      // was previously checked to update will cause it to be come re-checked
      // as appropriate.

      updateWrapper(otherNode, otherProps);
    }
  }
} // In Chrome, assigning defaultValue to certain input types triggers input validation.
// For number inputs, the display value loses trailing decimal points. For email inputs,
// Chrome raises "The specified value <x> is not a valid email address".
//
// Here we check to see if the defaultValue has actually changed, avoiding these problems
// when the user is inputting text
//
// https://github.com/facebook/react/issues/7253


function setDefaultValue(node, type, value) {
  if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
  type !== 'number' || getActiveElement(node.ownerDocument) !== node) {
    if (value == null) {
      node.defaultValue = toString(node._wrapperState.initialValue);
    } else if (node.defaultValue !== toString(value)) {
      node.defaultValue = toString(value);
    }
  }
}

var didWarnSelectedSetOnOption = false;
var didWarnInvalidChild = false;

function flattenChildren(children) {
  var content = ''; // Flatten children. We'll warn if they are invalid
  // during validateProps() which runs for hydration too.
  // Note that this would throw on non-element objects.
  // Elements are stringified (which is normally irrelevant
  // but matters for <fbt>).

  React.Children.forEach(children, function (child) {
    if (child == null) {
      return;
    }

    content += child; // Note: we don't warn about invalid children here.
    // Instead, this is done separately below so that
    // it happens during the hydration code path too.
  });
  return content;
}
/**
 * Implements an <option> host component that warns when `selected` is set.
 */


function validateProps(element, props) {
  {
    // This mirrors the code path above, but runs for hydration too.
    // Warn about invalid children here so that client and hydration are consistent.
    // TODO: this seems like it could cause a DEV-only throw for hydration
    // if children contains a non-element object. We should try to avoid that.
    if (typeof props.children === 'object' && props.children !== null) {
      React.Children.forEach(props.children, function (child) {
        if (child == null) {
          return;
        }

        if (typeof child === 'string' || typeof child === 'number') {
          return;
        }

        if (typeof child.type !== 'string') {
          return;
        }

        if (!didWarnInvalidChild) {
          didWarnInvalidChild = true;

          error('Only strings and numbers are supported as <option> children.');
        }
      });
    } // TODO: Remove support for `selected` in <option>.


    if (props.selected != null && !didWarnSelectedSetOnOption) {
      error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');

      didWarnSelectedSetOnOption = true;
    }
  }
}
function postMountWrapper$1(element, props) {
  // value="" should make a value attribute (#6219)
  if (props.value != null) {
    element.setAttribute('value', toString(getToStringValue(props.value)));
  }
}
function getHostProps$1(element, props) {
  var hostProps = _assign({
    children: undefined
  }, props);

  var content = flattenChildren(props.children);

  if (content) {
    hostProps.children = content;
  }

  return hostProps;
}

var didWarnValueDefaultValue$1;

{
  didWarnValueDefaultValue$1 = false;
}

function getDeclarationErrorAddendum() {
  var ownerName = getCurrentFiberOwnerNameInDevOrNull();

  if (ownerName) {
    return '\n\nCheck the render method of `' + ownerName + '`.';
  }

  return '';
}

var valuePropNames = ['value', 'defaultValue'];
/**
 * Validation function for `value` and `defaultValue`.
 */

function checkSelectPropTypes(props) {
  {
    checkControlledValueProps('select', props);

    for (var i = 0; i < valuePropNames.length; i++) {
      var propName = valuePropNames[i];

      if (props[propName] == null) {
        continue;
      }

      var isArray = Array.isArray(props[propName]);

      if (props.multiple && !isArray) {
        error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
      } else if (!props.multiple && isArray) {
        error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
      }
    }
  }
}

function updateOptions(node, multiple, propValue, setDefaultSelected) {
  var options = node.options;

  if (multiple) {
    var selectedValues = propValue;
    var selectedValue = {};

    for (var i = 0; i < selectedValues.length; i++) {
      // Prefix to avoid chaos with special keys.
      selectedValue['$' + selectedValues[i]] = true;
    }

    for (var _i = 0; _i < options.length; _i++) {
      var selected = selectedValue.hasOwnProperty('$' + options[_i].value);

      if (options[_i].selected !== selected) {
        options[_i].selected = selected;
      }

      if (selected && setDefaultSelected) {
        options[_i].defaultSelected = true;
      }
    }
  } else {
    // Do not set `select.value` as exact behavior isn't consistent across all
    // browsers for all cases.
    var _selectedValue = toString(getToStringValue(propValue));

    var defaultSelected = null;

    for (var _i2 = 0; _i2 < options.length; _i2++) {
      if (options[_i2].value === _selectedValue) {
        options[_i2].selected = true;

        if (setDefaultSelected) {
          options[_i2].defaultSelected = true;
        }

        return;
      }

      if (defaultSelected === null && !options[_i2].disabled) {
        defaultSelected = options[_i2];
      }
    }

    if (defaultSelected !== null) {
      defaultSelected.selected = true;
    }
  }
}
/**
 * Implements a <select> host component that allows optionally setting the
 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
 * stringable. If `multiple` is true, the prop must be an array of stringables.
 *
 * If `value` is not supplied (or null/undefined), user actions that change the
 * selected option will trigger updates to the rendered options.
 *
 * If it is supplied (and not null/undefined), the rendered options will not
 * update in response to user actions. Instead, the `value` prop must change in
 * order for the rendered options to update.
 *
 * If `defaultValue` is provided, any options with the supplied values will be
 * selected.
 */


function getHostProps$2(element, props) {
  return _assign({}, props, {
    value: undefined
  });
}
function initWrapperState$1(element, props) {
  var node = element;

  {
    checkSelectPropTypes(props);
  }

  node._wrapperState = {
    wasMultiple: !!props.multiple
  };

  {
    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
      error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components');

      didWarnValueDefaultValue$1 = true;
    }
  }
}
function postMountWrapper$2(element, props) {
  var node = element;
  node.multiple = !!props.multiple;
  var value = props.value;

  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  } else if (props.defaultValue != null) {
    updateOptions(node, !!props.multiple, props.defaultValue, true);
  }
}
function postUpdateWrapper(element, props) {
  var node = element;
  var wasMultiple = node._wrapperState.wasMultiple;
  node._wrapperState.wasMultiple = !!props.multiple;
  var value = props.value;

  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  } else if (wasMultiple !== !!props.multiple) {
    // For simplicity, reapply `defaultValue` if `multiple` is toggled.
    if (props.defaultValue != null) {
      updateOptions(node, !!props.multiple, props.defaultValue, true);
    } else {
      // Revert the select back to its default unselected state.
      updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
    }
  }
}
function restoreControlledState$1(element, props) {
  var node = element;
  var value = props.value;

  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  }
}

var didWarnValDefaultVal = false;

/**
 * Implements a <textarea> host component that allows setting `value`, and
 * `defaultValue`. This differs from the traditional DOM API because value is
 * usually set as PCDATA children.
 *
 * If `value` is not supplied (or null/undefined), user actions that affect the
 * value will trigger updates to the element.
 *
 * If `value` is supplied (and not null/undefined), the rendered element will
 * not trigger updates to the element. Instead, the `value` prop must change in
 * order for the rendered element to be updated.
 *
 * The rendered element will be initialized with an empty value, the prop
 * `defaultValue` if specified, or the children content (deprecated).
 */
function getHostProps$3(element, props) {
  var node = element;

  if (!(props.dangerouslySetInnerHTML == null)) {
    {
      throw Error( "`dangerouslySetInnerHTML` does not make sense on <textarea>." );
    }
  } // Always set children to the same thing. In IE9, the selection range will
  // get reset if `textContent` is mutated.  We could add a check in setTextContent
  // to only set the value if/when the value differs from the node value (which would
  // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
  // solution. The value can be a boolean or object so that's why it's forced
  // to be a string.


  var hostProps = _assign({}, props, {
    value: undefined,
    defaultValue: undefined,
    children: toString(node._wrapperState.initialValue)
  });

  return hostProps;
}
function initWrapperState$2(element, props) {
  var node = element;

  {
    checkControlledValueProps('textarea', props);

    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
      error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');

      didWarnValDefaultVal = true;
    }
  }

  var initialValue = props.value; // Only bother fetching default value if we're going to use it

  if (initialValue == null) {
    var children = props.children,
        defaultValue = props.defaultValue;

    if (children != null) {
      {
        error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
      }

      {
        if (!(defaultValue == null)) {
          {
            throw Error( "If you supply `defaultValue` on a <textarea>, do not pass children." );
          }
        }

        if (Array.isArray(children)) {
          if (!(children.length <= 1)) {
            {
              throw Error( "<textarea> can only have at most one child." );
            }
          }

          children = children[0];
        }

        defaultValue = children;
      }
    }

    if (defaultValue == null) {
      defaultValue = '';
    }

    initialValue = defaultValue;
  }

  node._wrapperState = {
    initialValue: getToStringValue(initialValue)
  };
}
function updateWrapper$1(element, props) {
  var node = element;
  var value = getToStringValue(props.value);
  var defaultValue = getToStringValue(props.defaultValue);

  if (value != null) {
    // Cast `value` to a string to ensure the value is set correctly. While
    // browsers typically do this as necessary, jsdom doesn't.
    var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed

    if (newValue !== node.value) {
      node.value = newValue;
    }

    if (props.defaultValue == null && node.defaultValue !== newValue) {
      node.defaultValue = newValue;
    }
  }

  if (defaultValue != null) {
    node.defaultValue = toString(defaultValue);
  }
}
function postMountWrapper$3(element, props) {
  var node = element; // This is in postMount because we need access to the DOM node, which is not
  // available until after the component has mounted.

  var textContent = node.textContent; // Only set node.value if textContent is equal to the expected
  // initial value. In IE10/IE11 there is a bug where the placeholder attribute
  // will populate textContent as well.
  // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/

  if (textContent === node._wrapperState.initialValue) {
    if (textContent !== '' && textContent !== null) {
      node.value = textContent;
    }
  }
}
function restoreControlledState$2(element, props) {
  // DOM component is still mounted; update
  updateWrapper$1(element, props);
}

var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
var Namespaces = {
  html: HTML_NAMESPACE,
  mathml: MATH_NAMESPACE,
  svg: SVG_NAMESPACE
}; // Assumes there is no parent namespace.

function getIntrinsicNamespace(type) {
  switch (type) {
    case 'svg':
      return SVG_NAMESPACE;

    case 'math':
      return MATH_NAMESPACE;

    default:
      return HTML_NAMESPACE;
  }
}
function getChildNamespace(parentNamespace, type) {
  if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
    // No (or default) parent namespace: potential entry point.
    return getIntrinsicNamespace(type);
  }

  if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
    // We're leaving SVG.
    return HTML_NAMESPACE;
  } // By default, pass namespace below.


  return parentNamespace;
}

/* globals MSApp */

/**
 * Create a function which has 'unsafe' privileges (required by windows8 apps)
 */
var createMicrosoftUnsafeLocalFunction = function (func) {
  if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
    return function (arg0, arg1, arg2, arg3) {
      MSApp.execUnsafeLocalFunction(function () {
        return func(arg0, arg1, arg2, arg3);
      });
    };
  } else {
    return func;
  }
};

var reusableSVGContainer;
/**
 * Set the innerHTML property of a node
 *
 * @param {DOMElement} node
 * @param {string} html
 * @internal
 */

var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
  if (node.namespaceURI === Namespaces.svg) {

    if (!('innerHTML' in node)) {
      // IE does not have innerHTML for SVG nodes, so instead we inject the
      // new markup in a temp node and then move the child nodes across into
      // the target node
      reusableSVGContainer = reusableSVGContainer || document.createElement('div');
      reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';
      var svgNode = reusableSVGContainer.firstChild;

      while (node.firstChild) {
        node.removeChild(node.firstChild);
      }

      while (svgNode.firstChild) {
        node.appendChild(svgNode.firstChild);
      }

      return;
    }
  }

  node.innerHTML = html;
});

/**
 * HTML nodeType values that represent the type of the node
 */
var ELEMENT_NODE = 1;
var TEXT_NODE = 3;
var COMMENT_NODE = 8;
var DOCUMENT_NODE = 9;
var DOCUMENT_FRAGMENT_NODE = 11;

/**
 * Set the textContent property of a node. For text updates, it's faster
 * to set the `nodeValue` of the Text node directly instead of using
 * `.textContent` which will remove the existing node and create a new one.
 *
 * @param {DOMElement} node
 * @param {string} text
 * @internal
 */

var setTextContent = function (node, text) {
  if (text) {
    var firstChild = node.firstChild;

    if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
      firstChild.nodeValue = text;
      return;
    }
  }

  node.textContent = text;
};

// List derived from Gecko source code:
// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
var shorthandToLonghand = {
  animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
  background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
  backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
  border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
  borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
  borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
  borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
  borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
  borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
  borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
  borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
  borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
  borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
  borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
  borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
  columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
  columns: ['columnCount', 'columnWidth'],
  flex: ['flexBasis', 'flexGrow', 'flexShrink'],
  flexFlow: ['flexDirection', 'flexWrap'],
  font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
  fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
  gap: ['columnGap', 'rowGap'],
  grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
  gridColumn: ['gridColumnEnd', 'gridColumnStart'],
  gridColumnGap: ['columnGap'],
  gridGap: ['columnGap', 'rowGap'],
  gridRow: ['gridRowEnd', 'gridRowStart'],
  gridRowGap: ['rowGap'],
  gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
  margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
  marker: ['markerEnd', 'markerMid', 'markerStart'],
  mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
  maskPosition: ['maskPositionX', 'maskPositionY'],
  outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
  overflow: ['overflowX', 'overflowY'],
  padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
  placeContent: ['alignContent', 'justifyContent'],
  placeItems: ['alignItems', 'justifyItems'],
  placeSelf: ['alignSelf', 'justifySelf'],
  textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
  textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
  transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
  wordWrap: ['overflowWrap']
};

/**
 * CSS properties which accept numbers but are not in units of "px".
 */
var isUnitlessNumber = {
  animationIterationCount: true,
  borderImageOutset: true,
  borderImageSlice: true,
  borderImageWidth: true,
  boxFlex: true,
  boxFlexGroup: true,
  boxOrdinalGroup: true,
  columnCount: true,
  columns: true,
  flex: true,
  flexGrow: true,
  flexPositive: true,
  flexShrink: true,
  flexNegative: true,
  flexOrder: true,
  gridArea: true,
  gridRow: true,
  gridRowEnd: true,
  gridRowSpan: true,
  gridRowStart: true,
  gridColumn: true,
  gridColumnEnd: true,
  gridColumnSpan: true,
  gridColumnStart: true,
  fontWeight: true,
  lineClamp: true,
  lineHeight: true,
  opacity: true,
  order: true,
  orphans: true,
  tabSize: true,
  widows: true,
  zIndex: true,
  zoom: true,
  // SVG-related properties
  fillOpacity: true,
  floodOpacity: true,
  stopOpacity: true,
  strokeDasharray: true,
  strokeDashoffset: true,
  strokeMiterlimit: true,
  strokeOpacity: true,
  strokeWidth: true
};
/**
 * @param {string} prefix vendor-specific prefix, eg: Webkit
 * @param {string} key style name, eg: transitionDuration
 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
 * WebkitTransitionDuration
 */

function prefixKey(prefix, key) {
  return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}
/**
 * Support style names that may come passed in prefixed by adding permutations
 * of vendor prefixes.
 */


var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
// infinite loop, because it iterates over the newly added props too.

Object.keys(isUnitlessNumber).forEach(function (prop) {
  prefixes.forEach(function (prefix) {
    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  });
});

/**
 * Convert a value into the proper css writable value. The style name `name`
 * should be logical (no hyphens), as specified
 * in `CSSProperty.isUnitlessNumber`.
 *
 * @param {string} name CSS property name such as `topMargin`.
 * @param {*} value CSS property value such as `10px`.
 * @return {string} Normalized style value with dimensions applied.
 */

function dangerousStyleValue(name, value, isCustomProperty) {
  // Note that we've removed escapeTextForBrowser() calls here since the
  // whole string will be escaped when the attribute is injected into
  // the markup. If you provide unsafe user data here they can inject
  // arbitrary CSS which may be problematic (I couldn't repro this):
  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  // This is not an XSS hole but instead a potential CSS injection issue
  // which has lead to a greater discussion about how we're going to
  // trust URLs moving forward. See #2115901
  var isEmpty = value == null || typeof value === 'boolean' || value === '';

  if (isEmpty) {
    return '';
  }

  if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
  }

  return ('' + value).trim();
}

var uppercasePattern = /([A-Z])/g;
var msPattern = /^ms-/;
/**
 * Hyphenates a camelcased CSS property name, for example:
 *
 *   > hyphenateStyleName('backgroundColor')
 *   < "background-color"
 *   > hyphenateStyleName('MozTransition')
 *   < "-moz-transition"
 *   > hyphenateStyleName('msTransition')
 *   < "-ms-transition"
 *
 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
 * is converted to `-ms-`.
 */

function hyphenateStyleName(name) {
  return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
}

var warnValidStyle = function () {};

{
  // 'msTransform' is correct, but the other prefixes should be capitalized
  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  var msPattern$1 = /^-ms-/;
  var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon

  var badStyleValueWithSemicolonPattern = /;\s*$/;
  var warnedStyleNames = {};
  var warnedStyleValues = {};
  var warnedForNaNValue = false;
  var warnedForInfinityValue = false;

  var camelize = function (string) {
    return string.replace(hyphenPattern, function (_, character) {
      return character.toUpperCase();
    });
  };

  var warnHyphenatedStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;

    error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
    // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
    // is converted to lowercase `ms`.
    camelize(name.replace(msPattern$1, 'ms-')));
  };

  var warnBadVendoredStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;

    error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
  };

  var warnStyleValueWithSemicolon = function (name, value) {
    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
      return;
    }

    warnedStyleValues[value] = true;

    error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
  };

  var warnStyleValueIsNaN = function (name, value) {
    if (warnedForNaNValue) {
      return;
    }

    warnedForNaNValue = true;

    error('`NaN` is an invalid value for the `%s` css style property.', name);
  };

  var warnStyleValueIsInfinity = function (name, value) {
    if (warnedForInfinityValue) {
      return;
    }

    warnedForInfinityValue = true;

    error('`Infinity` is an invalid value for the `%s` css style property.', name);
  };

  warnValidStyle = function (name, value) {
    if (name.indexOf('-') > -1) {
      warnHyphenatedStyleName(name);
    } else if (badVendoredStyleNamePattern.test(name)) {
      warnBadVendoredStyleName(name);
    } else if (badStyleValueWithSemicolonPattern.test(value)) {
      warnStyleValueWithSemicolon(name, value);
    }

    if (typeof value === 'number') {
      if (isNaN(value)) {
        warnStyleValueIsNaN(name, value);
      } else if (!isFinite(value)) {
        warnStyleValueIsInfinity(name, value);
      }
    }
  };
}

var warnValidStyle$1 = warnValidStyle;

/**
 * Operations for dealing with CSS properties.
 */

/**
 * This creates a string that is expected to be equivalent to the style
 * attribute generated by server-side rendering. It by-passes warnings and
 * security checks so it's not safe to use this value for anything other than
 * comparison. It is only used in DEV for SSR validation.
 */

function createDangerousStringForStyles(styles) {
  {
    var serialized = '';
    var delimiter = '';

    for (var styleName in styles) {
      if (!styles.hasOwnProperty(styleName)) {
        continue;
      }

      var styleValue = styles[styleName];

      if (styleValue != null) {
        var isCustomProperty = styleName.indexOf('--') === 0;
        serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';
        serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
        delimiter = ';';
      }
    }

    return serialized || null;
  }
}
/**
 * Sets the value for multiple styles on a node.  If a value is specified as
 * '' (empty string), the corresponding style property will be unset.
 *
 * @param {DOMElement} node
 * @param {object} styles
 */

function setValueForStyles(node, styles) {
  var style = node.style;

  for (var styleName in styles) {
    if (!styles.hasOwnProperty(styleName)) {
      continue;
    }

    var isCustomProperty = styleName.indexOf('--') === 0;

    {
      if (!isCustomProperty) {
        warnValidStyle$1(styleName, styles[styleName]);
      }
    }

    var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);

    if (styleName === 'float') {
      styleName = 'cssFloat';
    }

    if (isCustomProperty) {
      style.setProperty(styleName, styleValue);
    } else {
      style[styleName] = styleValue;
    }
  }
}

function isValueEmpty(value) {
  return value == null || typeof value === 'boolean' || value === '';
}
/**
 * Given {color: 'red', overflow: 'hidden'} returns {
 *   color: 'color',
 *   overflowX: 'overflow',
 *   overflowY: 'overflow',
 * }. This can be read as "the overflowY property was set by the overflow
 * shorthand". That is, the values are the property that each was derived from.
 */


function expandShorthandMap(styles) {
  var expanded = {};

  for (var key in styles) {
    var longhands = shorthandToLonghand[key] || [key];

    for (var i = 0; i < longhands.length; i++) {
      expanded[longhands[i]] = key;
    }
  }

  return expanded;
}
/**
 * When mixing shorthand and longhand property names, we warn during updates if
 * we expect an incorrect result to occur. In particular, we warn for:
 *
 * Updating a shorthand property (longhand gets overwritten):
 *   {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
 *   becomes .style.font = 'baz'
 * Removing a shorthand property (longhand gets lost too):
 *   {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
 *   becomes .style.font = ''
 * Removing a longhand property (should revert to shorthand; doesn't):
 *   {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
 *   becomes .style.fontVariant = ''
 */


function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
  {
    if (!nextStyles) {
      return;
    }

    var expandedUpdates = expandShorthandMap(styleUpdates);
    var expandedStyles = expandShorthandMap(nextStyles);
    var warnedAbout = {};

    for (var key in expandedUpdates) {
      var originalKey = expandedUpdates[key];
      var correctOriginalKey = expandedStyles[key];

      if (correctOriginalKey && originalKey !== correctOriginalKey) {
        var warningKey = originalKey + ',' + correctOriginalKey;

        if (warnedAbout[warningKey]) {
          continue;
        }

        warnedAbout[warningKey] = true;

        error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
      }
    }
  }
}

// For HTML, certain tags should omit their close tag. We keep a list for
// those special-case tags.
var omittedCloseTags = {
  area: true,
  base: true,
  br: true,
  col: true,
  embed: true,
  hr: true,
  img: true,
  input: true,
  keygen: true,
  link: true,
  meta: true,
  param: true,
  source: true,
  track: true,
  wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.

};

// `omittedCloseTags` except that `menuitem` should still have its closing tag.

var voidElementTags = _assign({
  menuitem: true
}, omittedCloseTags);

var HTML = '__html';

function assertValidProps(tag, props) {
  if (!props) {
    return;
  } // Note the use of `==` which checks for null or undefined.


  if (voidElementTags[tag]) {
    if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
      {
        throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." );
      }
    }
  }

  if (props.dangerouslySetInnerHTML != null) {
    if (!(props.children == null)) {
      {
        throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." );
      }
    }

    if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
      {
        throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information." );
      }
    }
  }

  {
    if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
      error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');
    }
  }

  if (!(props.style == null || typeof props.style === 'object')) {
    {
      throw Error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." );
    }
  }
}

function isCustomComponent(tagName, props) {
  if (tagName.indexOf('-') === -1) {
    return typeof props.is === 'string';
  }

  switch (tagName) {
    // These are reserved SVG and MathML elements.
    // We don't mind this list too much because we expect it to never grow.
    // The alternative is to track the namespace in a few places which is convoluted.
    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
    case 'annotation-xml':
    case 'color-profile':
    case 'font-face':
    case 'font-face-src':
    case 'font-face-uri':
    case 'font-face-format':
    case 'font-face-name':
    case 'missing-glyph':
      return false;

    default:
      return true;
  }
}

// When adding attributes to the HTML or SVG allowed attribute list, be sure to
// also add them to this module to ensure casing and incorrect name
// warnings.
var possibleStandardNames = {
  // HTML
  accept: 'accept',
  acceptcharset: 'acceptCharset',
  'accept-charset': 'acceptCharset',
  accesskey: 'accessKey',
  action: 'action',
  allowfullscreen: 'allowFullScreen',
  alt: 'alt',
  as: 'as',
  async: 'async',
  autocapitalize: 'autoCapitalize',
  autocomplete: 'autoComplete',
  autocorrect: 'autoCorrect',
  autofocus: 'autoFocus',
  autoplay: 'autoPlay',
  autosave: 'autoSave',
  capture: 'capture',
  cellpadding: 'cellPadding',
  cellspacing: 'cellSpacing',
  challenge: 'challenge',
  charset: 'charSet',
  checked: 'checked',
  children: 'children',
  cite: 'cite',
  class: 'className',
  classid: 'classID',
  classname: 'className',
  cols: 'cols',
  colspan: 'colSpan',
  content: 'content',
  contenteditable: 'contentEditable',
  contextmenu: 'contextMenu',
  controls: 'controls',
  controlslist: 'controlsList',
  coords: 'coords',
  crossorigin: 'crossOrigin',
  dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
  data: 'data',
  datetime: 'dateTime',
  default: 'default',
  defaultchecked: 'defaultChecked',
  defaultvalue: 'defaultValue',
  defer: 'defer',
  dir: 'dir',
  disabled: 'disabled',
  disablepictureinpicture: 'disablePictureInPicture',
  disableremoteplayback: 'disableRemotePlayback',
  download: 'download',
  draggable: 'draggable',
  enctype: 'encType',
  enterkeyhint: 'enterKeyHint',
  for: 'htmlFor',
  form: 'form',
  formmethod: 'formMethod',
  formaction: 'formAction',
  formenctype: 'formEncType',
  formnovalidate: 'formNoValidate',
  formtarget: 'formTarget',
  frameborder: 'frameBorder',
  headers: 'headers',
  height: 'height',
  hidden: 'hidden',
  high: 'high',
  href: 'href',
  hreflang: 'hrefLang',
  htmlfor: 'htmlFor',
  httpequiv: 'httpEquiv',
  'http-equiv': 'httpEquiv',
  icon: 'icon',
  id: 'id',
  innerhtml: 'innerHTML',
  inputmode: 'inputMode',
  integrity: 'integrity',
  is: 'is',
  itemid: 'itemID',
  itemprop: 'itemProp',
  itemref: 'itemRef',
  itemscope: 'itemScope',
  itemtype: 'itemType',
  keyparams: 'keyParams',
  keytype: 'keyType',
  kind: 'kind',
  label: 'label',
  lang: 'lang',
  list: 'list',
  loop: 'loop',
  low: 'low',
  manifest: 'manifest',
  marginwidth: 'marginWidth',
  marginheight: 'marginHeight',
  max: 'max',
  maxlength: 'maxLength',
  media: 'media',
  mediagroup: 'mediaGroup',
  method: 'method',
  min: 'min',
  minlength: 'minLength',
  multiple: 'multiple',
  muted: 'muted',
  name: 'name',
  nomodule: 'noModule',
  nonce: 'nonce',
  novalidate: 'noValidate',
  open: 'open',
  optimum: 'optimum',
  pattern: 'pattern',
  placeholder: 'placeholder',
  playsinline: 'playsInline',
  poster: 'poster',
  preload: 'preload',
  profile: 'profile',
  radiogroup: 'radioGroup',
  readonly: 'readOnly',
  referrerpolicy: 'referrerPolicy',
  rel: 'rel',
  required: 'required',
  reversed: 'reversed',
  role: 'role',
  rows: 'rows',
  rowspan: 'rowSpan',
  sandbox: 'sandbox',
  scope: 'scope',
  scoped: 'scoped',
  scrolling: 'scrolling',
  seamless: 'seamless',
  selected: 'selected',
  shape: 'shape',
  size: 'size',
  sizes: 'sizes',
  span: 'span',
  spellcheck: 'spellCheck',
  src: 'src',
  srcdoc: 'srcDoc',
  srclang: 'srcLang',
  srcset: 'srcSet',
  start: 'start',
  step: 'step',
  style: 'style',
  summary: 'summary',
  tabindex: 'tabIndex',
  target: 'target',
  title: 'title',
  type: 'type',
  usemap: 'useMap',
  value: 'value',
  width: 'width',
  wmode: 'wmode',
  wrap: 'wrap',
  // SVG
  about: 'about',
  accentheight: 'accentHeight',
  'accent-height': 'accentHeight',
  accumulate: 'accumulate',
  additive: 'additive',
  alignmentbaseline: 'alignmentBaseline',
  'alignment-baseline': 'alignmentBaseline',
  allowreorder: 'allowReorder',
  alphabetic: 'alphabetic',
  amplitude: 'amplitude',
  arabicform: 'arabicForm',
  'arabic-form': 'arabicForm',
  ascent: 'ascent',
  attributename: 'attributeName',
  attributetype: 'attributeType',
  autoreverse: 'autoReverse',
  azimuth: 'azimuth',
  basefrequency: 'baseFrequency',
  baselineshift: 'baselineShift',
  'baseline-shift': 'baselineShift',
  baseprofile: 'baseProfile',
  bbox: 'bbox',
  begin: 'begin',
  bias: 'bias',
  by: 'by',
  calcmode: 'calcMode',
  capheight: 'capHeight',
  'cap-height': 'capHeight',
  clip: 'clip',
  clippath: 'clipPath',
  'clip-path': 'clipPath',
  clippathunits: 'clipPathUnits',
  cliprule: 'clipRule',
  'clip-rule': 'clipRule',
  color: 'color',
  colorinterpolation: 'colorInterpolation',
  'color-interpolation': 'colorInterpolation',
  colorinterpolationfilters: 'colorInterpolationFilters',
  'color-interpolation-filters': 'colorInterpolationFilters',
  colorprofile: 'colorProfile',
  'color-profile': 'colorProfile',
  colorrendering: 'colorRendering',
  'color-rendering': 'colorRendering',
  contentscripttype: 'contentScriptType',
  contentstyletype: 'contentStyleType',
  cursor: 'cursor',
  cx: 'cx',
  cy: 'cy',
  d: 'd',
  datatype: 'datatype',
  decelerate: 'decelerate',
  descent: 'descent',
  diffuseconstant: 'diffuseConstant',
  direction: 'direction',
  display: 'display',
  divisor: 'divisor',
  dominantbaseline: 'dominantBaseline',
  'dominant-baseline': 'dominantBaseline',
  dur: 'dur',
  dx: 'dx',
  dy: 'dy',
  edgemode: 'edgeMode',
  elevation: 'elevation',
  enablebackground: 'enableBackground',
  'enable-background': 'enableBackground',
  end: 'end',
  exponent: 'exponent',
  externalresourcesrequired: 'externalResourcesRequired',
  fill: 'fill',
  fillopacity: 'fillOpacity',
  'fill-opacity': 'fillOpacity',
  fillrule: 'fillRule',
  'fill-rule': 'fillRule',
  filter: 'filter',
  filterres: 'filterRes',
  filterunits: 'filterUnits',
  floodopacity: 'floodOpacity',
  'flood-opacity': 'floodOpacity',
  floodcolor: 'floodColor',
  'flood-color': 'floodColor',
  focusable: 'focusable',
  fontfamily: 'fontFamily',
  'font-family': 'fontFamily',
  fontsize: 'fontSize',
  'font-size': 'fontSize',
  fontsizeadjust: 'fontSizeAdjust',
  'font-size-adjust': 'fontSizeAdjust',
  fontstretch: 'fontStretch',
  'font-stretch': 'fontStretch',
  fontstyle: 'fontStyle',
  'font-style': 'fontStyle',
  fontvariant: 'fontVariant',
  'font-variant': 'fontVariant',
  fontweight: 'fontWeight',
  'font-weight': 'fontWeight',
  format: 'format',
  from: 'from',
  fx: 'fx',
  fy: 'fy',
  g1: 'g1',
  g2: 'g2',
  glyphname: 'glyphName',
  'glyph-name': 'glyphName',
  glyphorientationhorizontal: 'glyphOrientationHorizontal',
  'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
  glyphorientationvertical: 'glyphOrientationVertical',
  'glyph-orientation-vertical': 'glyphOrientationVertical',
  glyphref: 'glyphRef',
  gradienttransform: 'gradientTransform',
  gradientunits: 'gradientUnits',
  hanging: 'hanging',
  horizadvx: 'horizAdvX',
  'horiz-adv-x': 'horizAdvX',
  horizoriginx: 'horizOriginX',
  'horiz-origin-x': 'horizOriginX',
  ideographic: 'ideographic',
  imagerendering: 'imageRendering',
  'image-rendering': 'imageRendering',
  in2: 'in2',
  in: 'in',
  inlist: 'inlist',
  intercept: 'intercept',
  k1: 'k1',
  k2: 'k2',
  k3: 'k3',
  k4: 'k4',
  k: 'k',
  kernelmatrix: 'kernelMatrix',
  kernelunitlength: 'kernelUnitLength',
  kerning: 'kerning',
  keypoints: 'keyPoints',
  keysplines: 'keySplines',
  keytimes: 'keyTimes',
  lengthadjust: 'lengthAdjust',
  letterspacing: 'letterSpacing',
  'letter-spacing': 'letterSpacing',
  lightingcolor: 'lightingColor',
  'lighting-color': 'lightingColor',
  limitingconeangle: 'limitingConeAngle',
  local: 'local',
  markerend: 'markerEnd',
  'marker-end': 'markerEnd',
  markerheight: 'markerHeight',
  markermid: 'markerMid',
  'marker-mid': 'markerMid',
  markerstart: 'markerStart',
  'marker-start': 'markerStart',
  markerunits: 'markerUnits',
  markerwidth: 'markerWidth',
  mask: 'mask',
  maskcontentunits: 'maskContentUnits',
  maskunits: 'maskUnits',
  mathematical: 'mathematical',
  mode: 'mode',
  numoctaves: 'numOctaves',
  offset: 'offset',
  opacity: 'opacity',
  operator: 'operator',
  order: 'order',
  orient: 'orient',
  orientation: 'orientation',
  origin: 'origin',
  overflow: 'overflow',
  overlineposition: 'overlinePosition',
  'overline-position': 'overlinePosition',
  overlinethickness: 'overlineThickness',
  'overline-thickness': 'overlineThickness',
  paintorder: 'paintOrder',
  'paint-order': 'paintOrder',
  panose1: 'panose1',
  'panose-1': 'panose1',
  pathlength: 'pathLength',
  patterncontentunits: 'patternContentUnits',
  patterntransform: 'patternTransform',
  patternunits: 'patternUnits',
  pointerevents: 'pointerEvents',
  'pointer-events': 'pointerEvents',
  points: 'points',
  pointsatx: 'pointsAtX',
  pointsaty: 'pointsAtY',
  pointsatz: 'pointsAtZ',
  prefix: 'prefix',
  preservealpha: 'preserveAlpha',
  preserveaspectratio: 'preserveAspectRatio',
  primitiveunits: 'primitiveUnits',
  property: 'property',
  r: 'r',
  radius: 'radius',
  refx: 'refX',
  refy: 'refY',
  renderingintent: 'renderingIntent',
  'rendering-intent': 'renderingIntent',
  repeatcount: 'repeatCount',
  repeatdur: 'repeatDur',
  requiredextensions: 'requiredExtensions',
  requiredfeatures: 'requiredFeatures',
  resource: 'resource',
  restart: 'restart',
  result: 'result',
  results: 'results',
  rotate: 'rotate',
  rx: 'rx',
  ry: 'ry',
  scale: 'scale',
  security: 'security',
  seed: 'seed',
  shaperendering: 'shapeRendering',
  'shape-rendering': 'shapeRendering',
  slope: 'slope',
  spacing: 'spacing',
  specularconstant: 'specularConstant',
  specularexponent: 'specularExponent',
  speed: 'speed',
  spreadmethod: 'spreadMethod',
  startoffset: 'startOffset',
  stddeviation: 'stdDeviation',
  stemh: 'stemh',
  stemv: 'stemv',
  stitchtiles: 'stitchTiles',
  stopcolor: 'stopColor',
  'stop-color': 'stopColor',
  stopopacity: 'stopOpacity',
  'stop-opacity': 'stopOpacity',
  strikethroughposition: 'strikethroughPosition',
  'strikethrough-position': 'strikethroughPosition',
  strikethroughthickness: 'strikethroughThickness',
  'strikethrough-thickness': 'strikethroughThickness',
  string: 'string',
  stroke: 'stroke',
  strokedasharray: 'strokeDasharray',
  'stroke-dasharray': 'strokeDasharray',
  strokedashoffset: 'strokeDashoffset',
  'stroke-dashoffset': 'strokeDashoffset',
  strokelinecap: 'strokeLinecap',
  'stroke-linecap': 'strokeLinecap',
  strokelinejoin: 'strokeLinejoin',
  'stroke-linejoin': 'strokeLinejoin',
  strokemiterlimit: 'strokeMiterlimit',
  'stroke-miterlimit': 'strokeMiterlimit',
  strokewidth: 'strokeWidth',
  'stroke-width': 'strokeWidth',
  strokeopacity: 'strokeOpacity',
  'stroke-opacity': 'strokeOpacity',
  suppresscontenteditablewarning: 'suppressContentEditableWarning',
  suppresshydrationwarning: 'suppressHydrationWarning',
  surfacescale: 'surfaceScale',
  systemlanguage: 'systemLanguage',
  tablevalues: 'tableValues',
  targetx: 'targetX',
  targety: 'targetY',
  textanchor: 'textAnchor',
  'text-anchor': 'textAnchor',
  textdecoration: 'textDecoration',
  'text-decoration': 'textDecoration',
  textlength: 'textLength',
  textrendering: 'textRendering',
  'text-rendering': 'textRendering',
  to: 'to',
  transform: 'transform',
  typeof: 'typeof',
  u1: 'u1',
  u2: 'u2',
  underlineposition: 'underlinePosition',
  'underline-position': 'underlinePosition',
  underlinethickness: 'underlineThickness',
  'underline-thickness': 'underlineThickness',
  unicode: 'unicode',
  unicodebidi: 'unicodeBidi',
  'unicode-bidi': 'unicodeBidi',
  unicoderange: 'unicodeRange',
  'unicode-range': 'unicodeRange',
  unitsperem: 'unitsPerEm',
  'units-per-em': 'unitsPerEm',
  unselectable: 'unselectable',
  valphabetic: 'vAlphabetic',
  'v-alphabetic': 'vAlphabetic',
  values: 'values',
  vectoreffect: 'vectorEffect',
  'vector-effect': 'vectorEffect',
  version: 'version',
  vertadvy: 'vertAdvY',
  'vert-adv-y': 'vertAdvY',
  vertoriginx: 'vertOriginX',
  'vert-origin-x': 'vertOriginX',
  vertoriginy: 'vertOriginY',
  'vert-origin-y': 'vertOriginY',
  vhanging: 'vHanging',
  'v-hanging': 'vHanging',
  videographic: 'vIdeographic',
  'v-ideographic': 'vIdeographic',
  viewbox: 'viewBox',
  viewtarget: 'viewTarget',
  visibility: 'visibility',
  vmathematical: 'vMathematical',
  'v-mathematical': 'vMathematical',
  vocab: 'vocab',
  widths: 'widths',
  wordspacing: 'wordSpacing',
  'word-spacing': 'wordSpacing',
  writingmode: 'writingMode',
  'writing-mode': 'writingMode',
  x1: 'x1',
  x2: 'x2',
  x: 'x',
  xchannelselector: 'xChannelSelector',
  xheight: 'xHeight',
  'x-height': 'xHeight',
  xlinkactuate: 'xlinkActuate',
  'xlink:actuate': 'xlinkActuate',
  xlinkarcrole: 'xlinkArcrole',
  'xlink:arcrole': 'xlinkArcrole',
  xlinkhref: 'xlinkHref',
  'xlink:href': 'xlinkHref',
  xlinkrole: 'xlinkRole',
  'xlink:role': 'xlinkRole',
  xlinkshow: 'xlinkShow',
  'xlink:show': 'xlinkShow',
  xlinktitle: 'xlinkTitle',
  'xlink:title': 'xlinkTitle',
  xlinktype: 'xlinkType',
  'xlink:type': 'xlinkType',
  xmlbase: 'xmlBase',
  'xml:base': 'xmlBase',
  xmllang: 'xmlLang',
  'xml:lang': 'xmlLang',
  xmlns: 'xmlns',
  'xml:space': 'xmlSpace',
  xmlnsxlink: 'xmlnsXlink',
  'xmlns:xlink': 'xmlnsXlink',
  xmlspace: 'xmlSpace',
  y1: 'y1',
  y2: 'y2',
  y: 'y',
  ychannelselector: 'yChannelSelector',
  z: 'z',
  zoomandpan: 'zoomAndPan'
};

var ariaProperties = {
  'aria-current': 0,
  // state
  'aria-details': 0,
  'aria-disabled': 0,
  // state
  'aria-hidden': 0,
  // state
  'aria-invalid': 0,
  // state
  'aria-keyshortcuts': 0,
  'aria-label': 0,
  'aria-roledescription': 0,
  // Widget Attributes
  'aria-autocomplete': 0,
  'aria-checked': 0,
  'aria-expanded': 0,
  'aria-haspopup': 0,
  'aria-level': 0,
  'aria-modal': 0,
  'aria-multiline': 0,
  'aria-multiselectable': 0,
  'aria-orientation': 0,
  'aria-placeholder': 0,
  'aria-pressed': 0,
  'aria-readonly': 0,
  'aria-required': 0,
  'aria-selected': 0,
  'aria-sort': 0,
  'aria-valuemax': 0,
  'aria-valuemin': 0,
  'aria-valuenow': 0,
  'aria-valuetext': 0,
  // Live Region Attributes
  'aria-atomic': 0,
  'aria-busy': 0,
  'aria-live': 0,
  'aria-relevant': 0,
  // Drag-and-Drop Attributes
  'aria-dropeffect': 0,
  'aria-grabbed': 0,
  // Relationship Attributes
  'aria-activedescendant': 0,
  'aria-colcount': 0,
  'aria-colindex': 0,
  'aria-colspan': 0,
  'aria-controls': 0,
  'aria-describedby': 0,
  'aria-errormessage': 0,
  'aria-flowto': 0,
  'aria-labelledby': 0,
  'aria-owns': 0,
  'aria-posinset': 0,
  'aria-rowcount': 0,
  'aria-rowindex': 0,
  'aria-rowspan': 0,
  'aria-setsize': 0
};

var warnedProperties = {};
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;

function validateProperty(tagName, name) {
  {
    if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
      return true;
    }

    if (rARIACamel.test(name)) {
      var ariaName = 'aria-' + name.slice(4).toLowerCase();
      var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
      // DOM properties, then it is an invalid aria-* attribute.

      if (correctName == null) {
        error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);

        warnedProperties[name] = true;
        return true;
      } // aria-* attributes should be lowercase; suggest the lowercase version.


      if (name !== correctName) {
        error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);

        warnedProperties[name] = true;
        return true;
      }
    }

    if (rARIA.test(name)) {
      var lowerCasedName = name.toLowerCase();
      var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
      // DOM properties, then it is an invalid aria-* attribute.

      if (standardName == null) {
        warnedProperties[name] = true;
        return false;
      } // aria-* attributes should be lowercase; suggest the lowercase version.


      if (name !== standardName) {
        error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);

        warnedProperties[name] = true;
        return true;
      }
    }
  }

  return true;
}

function warnInvalidARIAProps(type, props) {
  {
    var invalidProps = [];

    for (var key in props) {
      var isValid = validateProperty(type, key);

      if (!isValid) {
        invalidProps.push(key);
      }
    }

    var unknownPropString = invalidProps.map(function (prop) {
      return '`' + prop + '`';
    }).join(', ');

    if (invalidProps.length === 1) {
      error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);
    } else if (invalidProps.length > 1) {
      error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);
    }
  }
}

function validateProperties(type, props) {
  if (isCustomComponent(type, props)) {
    return;
  }

  warnInvalidARIAProps(type, props);
}

var didWarnValueNull = false;
function validateProperties$1(type, props) {
  {
    if (type !== 'input' && type !== 'textarea' && type !== 'select') {
      return;
    }

    if (props != null && props.value === null && !didWarnValueNull) {
      didWarnValueNull = true;

      if (type === 'select' && props.multiple) {
        error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
      } else {
        error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
      }
    }
  }
}

var validateProperty$1 = function () {};

{
  var warnedProperties$1 = {};
  var _hasOwnProperty = Object.prototype.hasOwnProperty;
  var EVENT_NAME_REGEX = /^on./;
  var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
  var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');

  validateProperty$1 = function (tagName, name, value, eventRegistry) {
    if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
      return true;
    }

    var lowerCasedName = name.toLowerCase();

    if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
      error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');

      warnedProperties$1[name] = true;
      return true;
    } // We can't rely on the event system being injected on the server.


    if (eventRegistry != null) {
      var registrationNameDependencies = eventRegistry.registrationNameDependencies,
          possibleRegistrationNames = eventRegistry.possibleRegistrationNames;

      if (registrationNameDependencies.hasOwnProperty(name)) {
        return true;
      }

      var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;

      if (registrationName != null) {
        error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);

        warnedProperties$1[name] = true;
        return true;
      }

      if (EVENT_NAME_REGEX.test(name)) {
        error('Unknown event handler property `%s`. It will be ignored.', name);

        warnedProperties$1[name] = true;
        return true;
      }
    } else if (EVENT_NAME_REGEX.test(name)) {
      // If no event plugins have been injected, we are in a server environment.
      // So we can't tell if the event name is correct for sure, but we can filter
      // out known bad ones like `onclick`. We can't suggest a specific replacement though.
      if (INVALID_EVENT_NAME_REGEX.test(name)) {
        error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
      }

      warnedProperties$1[name] = true;
      return true;
    } // Let the ARIA attribute hook validate ARIA attributes


    if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
      return true;
    }

    if (lowerCasedName === 'innerhtml') {
      error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');

      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'aria') {
      error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');

      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
      error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);

      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'number' && isNaN(value)) {
      error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);

      warnedProperties$1[name] = true;
      return true;
    }

    var propertyInfo = getPropertyInfo(name);
    var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.

    if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
      var standardName = possibleStandardNames[lowerCasedName];

      if (standardName !== name) {
        error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);

        warnedProperties$1[name] = true;
        return true;
      }
    } else if (!isReserved && name !== lowerCasedName) {
      // Unknown attributes should have lowercase casing since that's how they
      // will be cased anyway with server rendering.
      error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);

      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      if (value) {
        error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
      } else {
        error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
      }

      warnedProperties$1[name] = true;
      return true;
    } // Now that we've validated casing, do not validate
    // data types for reserved props


    if (isReserved) {
      return true;
    } // Warn when a known attribute is a bad type


    if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      warnedProperties$1[name] = true;
      return false;
    } // Warn when passing the strings 'false' or 'true' into a boolean prop


    if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
      error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);

      warnedProperties$1[name] = true;
      return true;
    }

    return true;
  };
}

var warnUnknownProperties = function (type, props, eventRegistry) {
  {
    var unknownProps = [];

    for (var key in props) {
      var isValid = validateProperty$1(type, key, props[key], eventRegistry);

      if (!isValid) {
        unknownProps.push(key);
      }
    }

    var unknownPropString = unknownProps.map(function (prop) {
      return '`' + prop + '`';
    }).join(', ');

    if (unknownProps.length === 1) {
      error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);
    } else if (unknownProps.length > 1) {
      error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);
    }
  }
};

function validateProperties$2(type, props, eventRegistry) {
  if (isCustomComponent(type, props)) {
    return;
  }

  warnUnknownProperties(type, props, eventRegistry);
}

var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
var IS_NON_DELEGATED = 1 << 1;
var IS_CAPTURE_PHASE = 1 << 2;
var IS_REPLAYED = 1 << 4;
// set to LEGACY_FB_SUPPORT. LEGACY_FB_SUPPORT only gets set when
// we call willDeferLaterForLegacyFBSupport, thus not bailing out
// will result in endless cycles like an infinite loop.
// We also don't want to defer during event replaying.

var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;

/**
 * Gets the target node from a native browser event by accounting for
 * inconsistencies in browser DOM APIs.
 *
 * @param {object} nativeEvent Native browser event.
 * @return {DOMEventTarget} Target node.
 */

function getEventTarget(nativeEvent) {
  // Fallback to nativeEvent.srcElement for IE9
  // https://github.com/facebook/react/issues/12506
  var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963

  if (target.correspondingUseElement) {
    target = target.correspondingUseElement;
  } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
  // @see http://www.quirksmode.org/js/events_properties.html


  return target.nodeType === TEXT_NODE ? target.parentNode : target;
}

var restoreImpl = null;
var restoreTarget = null;
var restoreQueue = null;

function restoreStateOfTarget(target) {
  // We perform this translation at the end of the event loop so that we
  // always receive the correct fiber here
  var internalInstance = getInstanceFromNode(target);

  if (!internalInstance) {
    // Unmounted
    return;
  }

  if (!(typeof restoreImpl === 'function')) {
    {
      throw Error( "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue." );
    }
  }

  var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted.

  if (stateNode) {
    var _props = getFiberCurrentPropsFromNode(stateNode);

    restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
  }
}

function setRestoreImplementation(impl) {
  restoreImpl = impl;
}
function enqueueStateRestore(target) {
  if (restoreTarget) {
    if (restoreQueue) {
      restoreQueue.push(target);
    } else {
      restoreQueue = [target];
    }
  } else {
    restoreTarget = target;
  }
}
function needsStateRestore() {
  return restoreTarget !== null || restoreQueue !== null;
}
function restoreStateIfNeeded() {
  if (!restoreTarget) {
    return;
  }

  var target = restoreTarget;
  var queuedTargets = restoreQueue;
  restoreTarget = null;
  restoreQueue = null;
  restoreStateOfTarget(target);

  if (queuedTargets) {
    for (var i = 0; i < queuedTargets.length; i++) {
      restoreStateOfTarget(queuedTargets[i]);
    }
  }
}

// the renderer. Such as when we're dispatching events or if third party
// libraries need to call batchedUpdates. Eventually, this API will go away when
// everything is batched by default. We'll then have a similar API to opt-out of
// scheduled work and instead do synchronous work.
// Defaults

var batchedUpdatesImpl = function (fn, bookkeeping) {
  return fn(bookkeeping);
};

var discreteUpdatesImpl = function (fn, a, b, c, d) {
  return fn(a, b, c, d);
};

var flushDiscreteUpdatesImpl = function () {};

var batchedEventUpdatesImpl = batchedUpdatesImpl;
var isInsideEventHandler = false;
var isBatchingEventUpdates = false;

function finishEventHandler() {
  // Here we wait until all updates have propagated, which is important
  // when using controlled components within layers:
  // https://github.com/facebook/react/issues/1698
  // Then we restore state of any controlled component.
  var controlledComponentsHavePendingUpdates = needsStateRestore();

  if (controlledComponentsHavePendingUpdates) {
    // If a controlled event was fired, we may need to restore the state of
    // the DOM node back to the controlled value. This is necessary when React
    // bails out of the update without touching the DOM.
    flushDiscreteUpdatesImpl();
    restoreStateIfNeeded();
  }
}

function batchedUpdates(fn, bookkeeping) {
  if (isInsideEventHandler) {
    // If we are currently inside another batch, we need to wait until it
    // fully completes before restoring state.
    return fn(bookkeeping);
  }

  isInsideEventHandler = true;

  try {
    return batchedUpdatesImpl(fn, bookkeeping);
  } finally {
    isInsideEventHandler = false;
    finishEventHandler();
  }
}
function batchedEventUpdates(fn, a, b) {
  if (isBatchingEventUpdates) {
    // If we are currently inside another batch, we need to wait until it
    // fully completes before restoring state.
    return fn(a, b);
  }

  isBatchingEventUpdates = true;

  try {
    return batchedEventUpdatesImpl(fn, a, b);
  } finally {
    isBatchingEventUpdates = false;
    finishEventHandler();
  }
}
function discreteUpdates(fn, a, b, c, d) {
  var prevIsInsideEventHandler = isInsideEventHandler;
  isInsideEventHandler = true;

  try {
    return discreteUpdatesImpl(fn, a, b, c, d);
  } finally {
    isInsideEventHandler = prevIsInsideEventHandler;

    if (!isInsideEventHandler) {
      finishEventHandler();
    }
  }
}
function flushDiscreteUpdatesIfNeeded(timeStamp) {
  {
    if (!isInsideEventHandler) {
      flushDiscreteUpdatesImpl();
    }
  }
}
function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
  batchedUpdatesImpl = _batchedUpdatesImpl;
  discreteUpdatesImpl = _discreteUpdatesImpl;
  flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
  batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
}

function isInteractive(tag) {
  return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
}

function shouldPreventMouseEvent(name, type, props) {
  switch (name) {
    case 'onClick':
    case 'onClickCapture':
    case 'onDoubleClick':
    case 'onDoubleClickCapture':
    case 'onMouseDown':
    case 'onMouseDownCapture':
    case 'onMouseMove':
    case 'onMouseMoveCapture':
    case 'onMouseUp':
    case 'onMouseUpCapture':
    case 'onMouseEnter':
      return !!(props.disabled && isInteractive(type));

    default:
      return false;
  }
}
/**
 * @param {object} inst The instance, which is the source of events.
 * @param {string} registrationName Name of listener (e.g. `onClick`).
 * @return {?function} The stored callback.
 */


function getListener(inst, registrationName) {
  var stateNode = inst.stateNode;

  if (stateNode === null) {
    // Work in progress (ex: onload events in incremental mode).
    return null;
  }

  var props = getFiberCurrentPropsFromNode(stateNode);

  if (props === null) {
    // Work in progress.
    return null;
  }

  var listener = props[registrationName];

  if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
    return null;
  }

  if (!(!listener || typeof listener === 'function')) {
    {
      throw Error( "Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type." );
    }
  }

  return listener;
}

var passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support

if (canUseDOM) {
  try {
    var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value

    Object.defineProperty(options, 'passive', {
      get: function () {
        passiveBrowserEventsSupported = true;
      }
    });
    window.addEventListener('test', options, options);
    window.removeEventListener('test', options, options);
  } catch (e) {
    passiveBrowserEventsSupported = false;
  }
}

function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {
  var funcArgs = Array.prototype.slice.call(arguments, 3);

  try {
    func.apply(context, funcArgs);
  } catch (error) {
    this.onError(error);
  }
}

var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;

{
  // In DEV mode, we swap out invokeGuardedCallback for a special version
  // that plays more nicely with the browser's DevTools. The idea is to preserve
  // "Pause on exceptions" behavior. Because React wraps all user-provided
  // functions in invokeGuardedCallback, and the production version of
  // invokeGuardedCallback uses a try-catch, all user exceptions are treated
  // like caught exceptions, and the DevTools won't pause unless the developer
  // takes the extra step of enabling pause on caught exceptions. This is
  // unintuitive, though, because even though React has caught the error, from
  // the developer's perspective, the error is uncaught.
  //
  // To preserve the expected "Pause on exceptions" behavior, we don't use a
  // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
  // DOM node, and call the user-provided callback from inside an event handler
  // for that fake event. If the callback throws, the error is "captured" using
  // a global event handler. But because the error happens in a different
  // event loop context, it does not interrupt the normal program flow.
  // Effectively, this gives us try-catch behavior without actually using
  // try-catch. Neat!
  // Check that the browser supports the APIs we need to implement our special
  // DEV version of invokeGuardedCallback
  if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
    var fakeNode = document.createElement('react');

    invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {
      // If document doesn't exist we know for sure we will crash in this method
      // when we call document.createEvent(). However this can cause confusing
      // errors: https://github.com/facebookincubator/create-react-app/issues/3482
      // So we preemptively throw with a better message instead.
      if (!(typeof document !== 'undefined')) {
        {
          throw Error( "The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous." );
        }
      }

      var evt = document.createEvent('Event');
      var didCall = false; // Keeps track of whether the user-provided callback threw an error. We
      // set this to true at the beginning, then set it to false right after
      // calling the function. If the function errors, `didError` will never be
      // set to false. This strategy works even if the browser is flaky and
      // fails to call our global error handler, because it doesn't rely on
      // the error event at all.

      var didError = true; // Keeps track of the value of window.event so that we can reset it
      // during the callback to let user code access window.event in the
      // browsers that support it.

      var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event
      // dispatching: https://github.com/facebook/react/issues/13688

      var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');

      function restoreAfterDispatch() {
        // We immediately remove the callback from event listeners so that
        // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
        // nested call would trigger the fake event handlers of any call higher
        // in the stack.
        fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the
        // window.event assignment in both IE <= 10 as they throw an error
        // "Member not found" in strict mode, and in Firefox which does not
        // support window.event.

        if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
          window.event = windowEvent;
        }
      } // Create an event handler for our fake event. We will synchronously
      // dispatch our fake event using `dispatchEvent`. Inside the handler, we
      // call the user-provided callback.


      var funcArgs = Array.prototype.slice.call(arguments, 3);

      function callCallback() {
        didCall = true;
        restoreAfterDispatch();
        func.apply(context, funcArgs);
        didError = false;
      } // Create a global error event handler. We use this to capture the value
      // that was thrown. It's possible that this error handler will fire more
      // than once; for example, if non-React code also calls `dispatchEvent`
      // and a handler for that event throws. We should be resilient to most of
      // those cases. Even if our error event handler fires more than once, the
      // last error event is always used. If the callback actually does error,
      // we know that the last error event is the correct one, because it's not
      // possible for anything else to have happened in between our callback
      // erroring and the code that follows the `dispatchEvent` call below. If
      // the callback doesn't error, but the error event was fired, we know to
      // ignore it because `didError` will be false, as described above.


      var error; // Use this to track whether the error event is ever called.

      var didSetError = false;
      var isCrossOriginError = false;

      function handleWindowError(event) {
        error = event.error;
        didSetError = true;

        if (error === null && event.colno === 0 && event.lineno === 0) {
          isCrossOriginError = true;
        }

        if (event.defaultPrevented) {
          // Some other error handler has prevented default.
          // Browsers silence the error report if this happens.
          // We'll remember this to later decide whether to log it or not.
          if (error != null && typeof error === 'object') {
            try {
              error._suppressLogging = true;
            } catch (inner) {// Ignore.
            }
          }
        }
      } // Create a fake event type.


      var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers

      window.addEventListener('error', handleWindowError);
      fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function
      // errors, it will trigger our global error handler.

      evt.initEvent(evtType, false, false);
      fakeNode.dispatchEvent(evt);

      if (windowEventDescriptor) {
        Object.defineProperty(window, 'event', windowEventDescriptor);
      }

      if (didCall && didError) {
        if (!didSetError) {
          // The callback errored, but the error event never fired.
          error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
        } else if (isCrossOriginError) {
          error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://reactjs.org/link/crossorigin-error for more information.');
        }

        this.onError(error);
      } // Remove our event listeners


      window.removeEventListener('error', handleWindowError);

      if (!didCall) {
        // Something went really wrong, and our event was not dispatched.
        // https://github.com/facebook/react/issues/16734
        // https://github.com/facebook/react/issues/16585
        // Fall back to the production implementation.
        restoreAfterDispatch();
        return invokeGuardedCallbackProd.apply(this, arguments);
      }
    };
  }
}

var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;

var hasError = false;
var caughtError = null; // Used by event system to capture/rethrow the first error.

var hasRethrowError = false;
var rethrowError = null;
var reporter = {
  onError: function (error) {
    hasError = true;
    caughtError = error;
  }
};
/**
 * Call a function while guarding against errors that happens within it.
 * Returns an error if it throws, otherwise null.
 *
 * In production, this is implemented using a try-catch. The reason we don't
 * use a try-catch directly is so that we can swap out a different
 * implementation in DEV mode.
 *
 * @param {String} name of the guard to use for logging or debugging
 * @param {Function} func The function to invoke
 * @param {*} context The context to use when calling the function
 * @param {...*} args Arguments for function
 */

function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
  hasError = false;
  caughtError = null;
  invokeGuardedCallbackImpl$1.apply(reporter, arguments);
}
/**
 * Same as invokeGuardedCallback, but instead of returning an error, it stores
 * it in a global so it can be rethrown by `rethrowCaughtError` later.
 * TODO: See if caughtError and rethrowError can be unified.
 *
 * @param {String} name of the guard to use for logging or debugging
 * @param {Function} func The function to invoke
 * @param {*} context The context to use when calling the function
 * @param {...*} args Arguments for function
 */

function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
  invokeGuardedCallback.apply(this, arguments);

  if (hasError) {
    var error = clearCaughtError();

    if (!hasRethrowError) {
      hasRethrowError = true;
      rethrowError = error;
    }
  }
}
/**
 * During execution of guarded functions we will capture the first error which
 * we will rethrow to be handled by the top level error handler.
 */

function rethrowCaughtError() {
  if (hasRethrowError) {
    var error = rethrowError;
    hasRethrowError = false;
    rethrowError = null;
    throw error;
  }
}
function hasCaughtError() {
  return hasError;
}
function clearCaughtError() {
  if (hasError) {
    var error = caughtError;
    hasError = false;
    caughtError = null;
    return error;
  } else {
    {
      {
        throw Error( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." );
      }
    }
  }
}

/**
 * `ReactInstanceMap` maintains a mapping from a public facing stateful
 * instance (key) and the internal representation (value). This allows public
 * methods to accept the user facing instance as an argument and map them back
 * to internal methods.
 *
 * Note that this module is currently shared and assumed to be stateless.
 * If this becomes an actual Map, that will break.
 */
function get(key) {
  return key._reactInternals;
}
function has(key) {
  return key._reactInternals !== undefined;
}
function set(key, value) {
  key._reactInternals = value;
}

// Don't change these two values. They're used by React Dev Tools.
var NoFlags =
/*                      */
0;
var PerformedWork =
/*                */
1; // You can change the rest (and add more).

var Placement =
/*                    */
2;
var Update =
/*                       */
4;
var PlacementAndUpdate =
/*           */
6;
var Deletion =
/*                     */
8;
var ContentReset =
/*                 */
16;
var Callback =
/*                     */
32;
var DidCapture =
/*                   */
64;
var Ref =
/*                          */
128;
var Snapshot =
/*                     */
256;
var Passive =
/*                      */
512; // TODO (effects) Remove this bit once the new reconciler is synced to the old.

var PassiveUnmountPendingDev =
/*     */
8192;
var Hydrating =
/*                    */
1024;
var HydratingAndUpdate =
/*           */
1028; // Passive & Update & Callback & Ref & Snapshot

var LifecycleEffectMask =
/*          */
932; // Union of all host effects

var HostEffectMask =
/*               */
2047; // These are not really side effects, but we still reuse this field.

var Incomplete =
/*                   */
2048;
var ShouldCapture =
/*                */
4096;
var ForceUpdateForLegacySuspense =
/* */
16384; // Static tags describe aspects of a fiber that are not specific to a render,

var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
function getNearestMountedFiber(fiber) {
  var node = fiber;
  var nearestMounted = fiber;

  if (!fiber.alternate) {
    // If there is no alternate, this might be a new tree that isn't inserted
    // yet. If it is, then it will have a pending insertion effect on it.
    var nextNode = node;

    do {
      node = nextNode;

      if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
        // This is an insertion or in-progress hydration. The nearest possible
        // mounted fiber is the parent but we need to continue to figure out
        // if that one is still mounted.
        nearestMounted = node.return;
      }

      nextNode = node.return;
    } while (nextNode);
  } else {
    while (node.return) {
      node = node.return;
    }
  }

  if (node.tag === HostRoot) {
    // TODO: Check if this was a nested HostRoot when used with
    // renderContainerIntoSubtree.
    return nearestMounted;
  } // If we didn't hit the root, that means that we're in an disconnected tree
  // that has been unmounted.


  return null;
}
function getSuspenseInstanceFromFiber(fiber) {
  if (fiber.tag === SuspenseComponent) {
    var suspenseState = fiber.memoizedState;

    if (suspenseState === null) {
      var current = fiber.alternate;

      if (current !== null) {
        suspenseState = current.memoizedState;
      }
    }

    if (suspenseState !== null) {
      return suspenseState.dehydrated;
    }
  }

  return null;
}
function getContainerFromFiber(fiber) {
  return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
}
function isFiberMounted(fiber) {
  return getNearestMountedFiber(fiber) === fiber;
}
function isMounted(component) {
  {
    var owner = ReactCurrentOwner.current;

    if (owner !== null && owner.tag === ClassComponent) {
      var ownerFiber = owner;
      var instance = ownerFiber.stateNode;

      if (!instance._warnedAboutRefsInRender) {
        error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component');
      }

      instance._warnedAboutRefsInRender = true;
    }
  }

  var fiber = get(component);

  if (!fiber) {
    return false;
  }

  return getNearestMountedFiber(fiber) === fiber;
}

function assertIsMounted(fiber) {
  if (!(getNearestMountedFiber(fiber) === fiber)) {
    {
      throw Error( "Unable to find node on an unmounted component." );
    }
  }
}

function findCurrentFiberUsingSlowPath(fiber) {
  var alternate = fiber.alternate;

  if (!alternate) {
    // If there is no alternate, then we only need to check if it is mounted.
    var nearestMounted = getNearestMountedFiber(fiber);

    if (!(nearestMounted !== null)) {
      {
        throw Error( "Unable to find node on an unmounted component." );
      }
    }

    if (nearestMounted !== fiber) {
      return null;
    }

    return fiber;
  } // If we have two possible branches, we'll walk backwards up to the root
  // to see what path the root points to. On the way we may hit one of the
  // special cases and we'll deal with them.


  var a = fiber;
  var b = alternate;

  while (true) {
    var parentA = a.return;

    if (parentA === null) {
      // We're at the root.
      break;
    }

    var parentB = parentA.alternate;

    if (parentB === null) {
      // There is no alternate. This is an unusual case. Currently, it only
      // happens when a Suspense component is hidden. An extra fragment fiber
      // is inserted in between the Suspense fiber and its children. Skip
      // over this extra fragment fiber and proceed to the next parent.
      var nextParent = parentA.return;

      if (nextParent !== null) {
        a = b = nextParent;
        continue;
      } // If there's no parent, we're at the root.


      break;
    } // If both copies of the parent fiber point to the same child, we can
    // assume that the child is current. This happens when we bailout on low
    // priority: the bailed out fiber's child reuses the current child.


    if (parentA.child === parentB.child) {
      var child = parentA.child;

      while (child) {
        if (child === a) {
          // We've determined that A is the current branch.
          assertIsMounted(parentA);
          return fiber;
        }

        if (child === b) {
          // We've determined that B is the current branch.
          assertIsMounted(parentA);
          return alternate;
        }

        child = child.sibling;
      } // We should never have an alternate for any mounting node. So the only
      // way this could possibly happen is if this was unmounted, if at all.


      {
        {
          throw Error( "Unable to find node on an unmounted component." );
        }
      }
    }

    if (a.return !== b.return) {
      // The return pointer of A and the return pointer of B point to different
      // fibers. We assume that return pointers never criss-cross, so A must
      // belong to the child set of A.return, and B must belong to the child
      // set of B.return.
      a = parentA;
      b = parentB;
    } else {
      // The return pointers point to the same fiber. We'll have to use the
      // default, slow path: scan the child sets of each parent alternate to see
      // which child belongs to which set.
      //
      // Search parent A's child set
      var didFindChild = false;
      var _child = parentA.child;

      while (_child) {
        if (_child === a) {
          didFindChild = true;
          a = parentA;
          b = parentB;
          break;
        }

        if (_child === b) {
          didFindChild = true;
          b = parentA;
          a = parentB;
          break;
        }

        _child = _child.sibling;
      }

      if (!didFindChild) {
        // Search parent B's child set
        _child = parentB.child;

        while (_child) {
          if (_child === a) {
            didFindChild = true;
            a = parentB;
            b = parentA;
            break;
          }

          if (_child === b) {
            didFindChild = true;
            b = parentB;
            a = parentA;
            break;
          }

          _child = _child.sibling;
        }

        if (!didFindChild) {
          {
            throw Error( "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." );
          }
        }
      }
    }

    if (!(a.alternate === b)) {
      {
        throw Error( "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." );
      }
    }
  } // If the root is not a host container, we're in a disconnected tree. I.e.
  // unmounted.


  if (!(a.tag === HostRoot)) {
    {
      throw Error( "Unable to find node on an unmounted component." );
    }
  }

  if (a.stateNode.current === a) {
    // We've determined that A is the current branch.
    return fiber;
  } // Otherwise B has to be current branch.


  return alternate;
}
function findCurrentHostFiber(parent) {
  var currentParent = findCurrentFiberUsingSlowPath(parent);

  if (!currentParent) {
    return null;
  } // Next we'll drill down this component to find the first HostComponent/Text.


  var node = currentParent;

  while (true) {
    if (node.tag === HostComponent || node.tag === HostText) {
      return node;
    } else if (node.child) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === currentParent) {
      return null;
    }

    while (!node.sibling) {
      if (!node.return || node.return === currentParent) {
        return null;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  } // Flow needs the return null here, but ESLint complains about it.
  // eslint-disable-next-line no-unreachable


  return null;
}
function findCurrentHostFiberWithNoPortals(parent) {
  var currentParent = findCurrentFiberUsingSlowPath(parent);

  if (!currentParent) {
    return null;
  } // Next we'll drill down this component to find the first HostComponent/Text.


  var node = currentParent;

  while (true) {
    if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI ) {
      return node;
    } else if (node.child && node.tag !== HostPortal) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === currentParent) {
      return null;
    }

    while (!node.sibling) {
      if (!node.return || node.return === currentParent) {
        return null;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  } // Flow needs the return null here, but ESLint complains about it.
  // eslint-disable-next-line no-unreachable


  return null;
}
function doesFiberContain(parentFiber, childFiber) {
  var node = childFiber;
  var parentFiberAlternate = parentFiber.alternate;

  while (node !== null) {
    if (node === parentFiber || node === parentFiberAlternate) {
      return true;
    }

    node = node.return;
  }

  return false;
}

var attemptUserBlockingHydration;
function setAttemptUserBlockingHydration(fn) {
  attemptUserBlockingHydration = fn;
}
var attemptContinuousHydration;
function setAttemptContinuousHydration(fn) {
  attemptContinuousHydration = fn;
}
var attemptHydrationAtCurrentPriority;
function setAttemptHydrationAtCurrentPriority(fn) {
  attemptHydrationAtCurrentPriority = fn;
}
var attemptHydrationAtPriority;
function setAttemptHydrationAtPriority(fn) {
  attemptHydrationAtPriority = fn;
} // TODO: Upgrade this definition once we're on a newer version of Flow that
var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.

var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.
// if the last target was dehydrated.

var queuedFocus = null;
var queuedDrag = null;
var queuedMouse = null; // For pointer events there can be one latest event per pointerId.

var queuedPointers = new Map();
var queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.

var queuedExplicitHydrationTargets = [];
function hasQueuedDiscreteEvents() {
  return queuedDiscreteEvents.length > 0;
}
var discreteReplayableEvents = ['mousedown', 'mouseup', 'touchcancel', 'touchend', 'touchstart', 'auxclick', 'dblclick', 'pointercancel', 'pointerdown', 'pointerup', 'dragend', 'dragstart', 'drop', 'compositionend', 'compositionstart', 'keydown', 'keypress', 'keyup', 'input', 'textInput', // Intentionally camelCase
'copy', 'cut', 'paste', 'click', 'change', 'contextmenu', 'reset', 'submit'];
function isReplayableDiscreteEvent(eventType) {
  return discreteReplayableEvents.indexOf(eventType) > -1;
}

function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  return {
    blockedOn: blockedOn,
    domEventName: domEventName,
    eventSystemFlags: eventSystemFlags | IS_REPLAYED,
    nativeEvent: nativeEvent,
    targetContainers: [targetContainer]
  };
}

function queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
  queuedDiscreteEvents.push(queuedEvent);
} // Resets the replaying for this type of continuous event to no event.

function clearIfContinuousEvent(domEventName, nativeEvent) {
  switch (domEventName) {
    case 'focusin':
    case 'focusout':
      queuedFocus = null;
      break;

    case 'dragenter':
    case 'dragleave':
      queuedDrag = null;
      break;

    case 'mouseover':
    case 'mouseout':
      queuedMouse = null;
      break;

    case 'pointerover':
    case 'pointerout':
      {
        var pointerId = nativeEvent.pointerId;
        queuedPointers.delete(pointerId);
        break;
      }

    case 'gotpointercapture':
    case 'lostpointercapture':
      {
        var _pointerId = nativeEvent.pointerId;
        queuedPointerCaptures.delete(_pointerId);
        break;
      }
  }
}

function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
    var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);

    if (blockedOn !== null) {
      var _fiber2 = getInstanceFromNode(blockedOn);

      if (_fiber2 !== null) {
        // Attempt to increase the priority of this target.
        attemptContinuousHydration(_fiber2);
      }
    }

    return queuedEvent;
  } // If we have already queued this exact event, then it's because
  // the different event systems have different DOM event listeners.
  // We can accumulate the flags, and the targetContainers, and
  // store a single event to be replayed.


  existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
  var targetContainers = existingQueuedEvent.targetContainers;

  if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
    targetContainers.push(targetContainer);
  }

  return existingQueuedEvent;
}

function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  // These set relatedTarget to null because the replayed event will be treated as if we
  // moved from outside the window (no target) onto the target once it hydrates.
  // Instead of mutating we could clone the event.
  switch (domEventName) {
    case 'focusin':
      {
        var focusEvent = nativeEvent;
        queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
        return true;
      }

    case 'dragenter':
      {
        var dragEvent = nativeEvent;
        queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
        return true;
      }

    case 'mouseover':
      {
        var mouseEvent = nativeEvent;
        queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
        return true;
      }

    case 'pointerover':
      {
        var pointerEvent = nativeEvent;
        var pointerId = pointerEvent.pointerId;
        queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
        return true;
      }

    case 'gotpointercapture':
      {
        var _pointerEvent = nativeEvent;
        var _pointerId2 = _pointerEvent.pointerId;
        queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
        return true;
      }
  }

  return false;
} // Check if this target is unblocked. Returns true if it's unblocked.

function attemptExplicitHydrationTarget(queuedTarget) {
  // TODO: This function shares a lot of logic with attemptToDispatchEvent.
  // Try to unify them. It's a bit tricky since it would require two return
  // values.
  var targetInst = getClosestInstanceFromNode(queuedTarget.target);

  if (targetInst !== null) {
    var nearestMounted = getNearestMountedFiber(targetInst);

    if (nearestMounted !== null) {
      var tag = nearestMounted.tag;

      if (tag === SuspenseComponent) {
        var instance = getSuspenseInstanceFromFiber(nearestMounted);

        if (instance !== null) {
          // We're blocked on hydrating this boundary.
          // Increase its priority.
          queuedTarget.blockedOn = instance;
          attemptHydrationAtPriority(queuedTarget.lanePriority, function () {
            Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {
              attemptHydrationAtCurrentPriority(nearestMounted);
            });
          });
          return;
        }
      } else if (tag === HostRoot) {
        var root = nearestMounted.stateNode;

        if (root.hydrate) {
          queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of
          // a root other than sync.

          return;
        }
      }
    }
  }

  queuedTarget.blockedOn = null;
}

function attemptReplayContinuousQueuedEvent(queuedEvent) {
  if (queuedEvent.blockedOn !== null) {
    return false;
  }

  var targetContainers = queuedEvent.targetContainers;

  while (targetContainers.length > 0) {
    var targetContainer = targetContainers[0];
    var nextBlockedOn = attemptToDispatchEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);

    if (nextBlockedOn !== null) {
      // We're still blocked. Try again later.
      var _fiber3 = getInstanceFromNode(nextBlockedOn);

      if (_fiber3 !== null) {
        attemptContinuousHydration(_fiber3);
      }

      queuedEvent.blockedOn = nextBlockedOn;
      return false;
    } // This target container was successfully dispatched. Try the next.


    targetContainers.shift();
  }

  return true;
}

function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
  if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
    map.delete(key);
  }
}

function replayUnblockedEvents() {
  hasScheduledReplayAttempt = false; // First replay discrete events.

  while (queuedDiscreteEvents.length > 0) {
    var nextDiscreteEvent = queuedDiscreteEvents[0];

    if (nextDiscreteEvent.blockedOn !== null) {
      // We're still blocked.
      // Increase the priority of this boundary to unblock
      // the next discrete event.
      var _fiber4 = getInstanceFromNode(nextDiscreteEvent.blockedOn);

      if (_fiber4 !== null) {
        attemptUserBlockingHydration(_fiber4);
      }

      break;
    }

    var targetContainers = nextDiscreteEvent.targetContainers;

    while (targetContainers.length > 0) {
      var targetContainer = targetContainers[0];
      var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.domEventName, nextDiscreteEvent.eventSystemFlags, targetContainer, nextDiscreteEvent.nativeEvent);

      if (nextBlockedOn !== null) {
        // We're still blocked. Try again later.
        nextDiscreteEvent.blockedOn = nextBlockedOn;
        break;
      } // This target container was successfully dispatched. Try the next.


      targetContainers.shift();
    }

    if (nextDiscreteEvent.blockedOn === null) {
      // We've successfully replayed the first event. Let's try the next one.
      queuedDiscreteEvents.shift();
    }
  } // Next replay any continuous events.


  if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
    queuedFocus = null;
  }

  if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
    queuedDrag = null;
  }

  if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
    queuedMouse = null;
  }

  queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
  queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
}

function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
  if (queuedEvent.blockedOn === unblocked) {
    queuedEvent.blockedOn = null;

    if (!hasScheduledReplayAttempt) {
      hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are
      // now unblocked. This first might not actually be unblocked yet.
      // We could check it early to avoid scheduling an unnecessary callback.

      Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
    }
  }
}

function retryIfBlockedOn(unblocked) {
  // Mark anything that was blocked on this as no longer blocked
  // and eligible for a replay.
  if (queuedDiscreteEvents.length > 0) {
    scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's
    // worth it because we expect very few discrete events to queue up and once
    // we are actually fully unblocked it will be fast to replay them.

    for (var i = 1; i < queuedDiscreteEvents.length; i++) {
      var queuedEvent = queuedDiscreteEvents[i];

      if (queuedEvent.blockedOn === unblocked) {
        queuedEvent.blockedOn = null;
      }
    }
  }

  if (queuedFocus !== null) {
    scheduleCallbackIfUnblocked(queuedFocus, unblocked);
  }

  if (queuedDrag !== null) {
    scheduleCallbackIfUnblocked(queuedDrag, unblocked);
  }

  if (queuedMouse !== null) {
    scheduleCallbackIfUnblocked(queuedMouse, unblocked);
  }

  var unblock = function (queuedEvent) {
    return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
  };

  queuedPointers.forEach(unblock);
  queuedPointerCaptures.forEach(unblock);

  for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
    var queuedTarget = queuedExplicitHydrationTargets[_i];

    if (queuedTarget.blockedOn === unblocked) {
      queuedTarget.blockedOn = null;
    }
  }

  while (queuedExplicitHydrationTargets.length > 0) {
    var nextExplicitTarget = queuedExplicitHydrationTargets[0];

    if (nextExplicitTarget.blockedOn !== null) {
      // We're still blocked.
      break;
    } else {
      attemptExplicitHydrationTarget(nextExplicitTarget);

      if (nextExplicitTarget.blockedOn === null) {
        // We're unblocked.
        queuedExplicitHydrationTargets.shift();
      }
    }
  }
}

var DiscreteEvent = 0;
var UserBlockingEvent = 1;
var ContinuousEvent = 2;

/**
 * Generate a mapping of standard vendor prefixes using the defined style property and event name.
 *
 * @param {string} styleProp
 * @param {string} eventName
 * @returns {object}
 */

function makePrefixMap(styleProp, eventName) {
  var prefixes = {};
  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  prefixes['Webkit' + styleProp] = 'webkit' + eventName;
  prefixes['Moz' + styleProp] = 'moz' + eventName;
  return prefixes;
}
/**
 * A list of event names to a configurable list of vendor prefixes.
 */


var vendorPrefixes = {
  animationend: makePrefixMap('Animation', 'AnimationEnd'),
  animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
  animationstart: makePrefixMap('Animation', 'AnimationStart'),
  transitionend: makePrefixMap('Transition', 'TransitionEnd')
};
/**
 * Event names that have already been detected and prefixed (if applicable).
 */

var prefixedEventNames = {};
/**
 * Element to check for prefixes on.
 */

var style = {};
/**
 * Bootstrap if a DOM exists.
 */

if (canUseDOM) {
  style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,
  // the un-prefixed "animation" and "transition" properties are defined on the
  // style object but the events that fire will still be prefixed, so we need
  // to check if the un-prefixed events are usable, and if not remove them from the map.

  if (!('AnimationEvent' in window)) {
    delete vendorPrefixes.animationend.animation;
    delete vendorPrefixes.animationiteration.animation;
    delete vendorPrefixes.animationstart.animation;
  } // Same as above


  if (!('TransitionEvent' in window)) {
    delete vendorPrefixes.transitionend.transition;
  }
}
/**
 * Attempts to determine the correct vendor prefixed event name.
 *
 * @param {string} eventName
 * @returns {string}
 */


function getVendorPrefixedEventName(eventName) {
  if (prefixedEventNames[eventName]) {
    return prefixedEventNames[eventName];
  } else if (!vendorPrefixes[eventName]) {
    return eventName;
  }

  var prefixMap = vendorPrefixes[eventName];

  for (var styleProp in prefixMap) {
    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
      return prefixedEventNames[eventName] = prefixMap[styleProp];
    }
  }

  return eventName;
}

var ANIMATION_END = getVendorPrefixedEventName('animationend');
var ANIMATION_ITERATION = getVendorPrefixedEventName('animationiteration');
var ANIMATION_START = getVendorPrefixedEventName('animationstart');
var TRANSITION_END = getVendorPrefixedEventName('transitionend');

var topLevelEventsToReactNames = new Map();
var eventPriorities = new Map(); // We store most of the events in this module in pairs of two strings so we can re-use
// the code required to apply the same logic for event prioritization and that of the
// SimpleEventPlugin. This complicates things slightly, but the aim is to reduce code
// duplication (for which there would be quite a bit). For the events that are not needed
// for the SimpleEventPlugin (otherDiscreteEvents) we process them separately as an
// array of top level events.
// Lastly, we ignore prettier so we can keep the formatting sane.
// prettier-ignore

var discreteEventPairsForSimpleEventPlugin = ['cancel', 'cancel', 'click', 'click', 'close', 'close', 'contextmenu', 'contextMenu', 'copy', 'copy', 'cut', 'cut', 'auxclick', 'auxClick', 'dblclick', 'doubleClick', // Careful!
'dragend', 'dragEnd', 'dragstart', 'dragStart', 'drop', 'drop', 'focusin', 'focus', // Careful!
'focusout', 'blur', // Careful!
'input', 'input', 'invalid', 'invalid', 'keydown', 'keyDown', 'keypress', 'keyPress', 'keyup', 'keyUp', 'mousedown', 'mouseDown', 'mouseup', 'mouseUp', 'paste', 'paste', 'pause', 'pause', 'play', 'play', 'pointercancel', 'pointerCancel', 'pointerdown', 'pointerDown', 'pointerup', 'pointerUp', 'ratechange', 'rateChange', 'reset', 'reset', 'seeked', 'seeked', 'submit', 'submit', 'touchcancel', 'touchCancel', 'touchend', 'touchEnd', 'touchstart', 'touchStart', 'volumechange', 'volumeChange'];
var otherDiscreteEvents = ['change', 'selectionchange', 'textInput', 'compositionstart', 'compositionend', 'compositionupdate'];


var userBlockingPairsForSimpleEventPlugin = ['drag', 'drag', 'dragenter', 'dragEnter', 'dragexit', 'dragExit', 'dragleave', 'dragLeave', 'dragover', 'dragOver', 'mousemove', 'mouseMove', 'mouseout', 'mouseOut', 'mouseover', 'mouseOver', 'pointermove', 'pointerMove', 'pointerout', 'pointerOut', 'pointerover', 'pointerOver', 'scroll', 'scroll', 'toggle', 'toggle', 'touchmove', 'touchMove', 'wheel', 'wheel']; // prettier-ignore

var continuousPairsForSimpleEventPlugin = ['abort', 'abort', ANIMATION_END, 'animationEnd', ANIMATION_ITERATION, 'animationIteration', ANIMATION_START, 'animationStart', 'canplay', 'canPlay', 'canplaythrough', 'canPlayThrough', 'durationchange', 'durationChange', 'emptied', 'emptied', 'encrypted', 'encrypted', 'ended', 'ended', 'error', 'error', 'gotpointercapture', 'gotPointerCapture', 'load', 'load', 'loadeddata', 'loadedData', 'loadedmetadata', 'loadedMetadata', 'loadstart', 'loadStart', 'lostpointercapture', 'lostPointerCapture', 'playing', 'playing', 'progress', 'progress', 'seeking', 'seeking', 'stalled', 'stalled', 'suspend', 'suspend', 'timeupdate', 'timeUpdate', TRANSITION_END, 'transitionEnd', 'waiting', 'waiting'];
/**
 * Turns
 * ['abort', ...]
 *
 * into
 *
 * topLevelEventsToReactNames = new Map([
 *   ['abort', 'onAbort'],
 * ]);
 *
 * and registers them.
 */

function registerSimplePluginEventsAndSetTheirPriorities(eventTypes, priority) {
  // As the event types are in pairs of two, we need to iterate
  // through in twos. The events are in pairs of two to save code
  // and improve init perf of processing this array, as it will
  // result in far fewer object allocations and property accesses
  // if we only use three arrays to process all the categories of
  // instead of tuples.
  for (var i = 0; i < eventTypes.length; i += 2) {
    var topEvent = eventTypes[i];
    var event = eventTypes[i + 1];
    var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
    var reactName = 'on' + capitalizedEvent;
    eventPriorities.set(topEvent, priority);
    topLevelEventsToReactNames.set(topEvent, reactName);
    registerTwoPhaseEvent(reactName, [topEvent]);
  }
}

function setEventPriorities(eventTypes, priority) {
  for (var i = 0; i < eventTypes.length; i++) {
    eventPriorities.set(eventTypes[i], priority);
  }
}

function getEventPriorityForPluginSystem(domEventName) {
  var priority = eventPriorities.get(domEventName); // Default to a ContinuousEvent. Note: we might
  // want to warn if we can't detect the priority
  // for the event.

  return priority === undefined ? ContinuousEvent : priority;
}
function registerSimpleEvents() {
  registerSimplePluginEventsAndSetTheirPriorities(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);
  registerSimplePluginEventsAndSetTheirPriorities(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);
  registerSimplePluginEventsAndSetTheirPriorities(continuousPairsForSimpleEventPlugin, ContinuousEvent);
  setEventPriorities(otherDiscreteEvents, DiscreteEvent);
}

var Scheduler_now = Scheduler.unstable_now;

{
  // Provide explicit error message when production+profiling bundle of e.g.
  // react-dom is used with production (non-profiling) bundle of
  // scheduler/tracing
  if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
    {
      throw Error( "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" );
    }
  }
}
// ascending numbers so we can compare them like numbers. They start at 90 to
// avoid clashing with Scheduler's priorities.

var ImmediatePriority = 99;
var UserBlockingPriority = 98;
var NormalPriority = 97;
var LowPriority = 96;
var IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.

var NoPriority = 90;
var initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.

var SyncLanePriority = 15;
var SyncBatchedLanePriority = 14;
var InputDiscreteHydrationLanePriority = 13;
var InputDiscreteLanePriority = 12;
var InputContinuousHydrationLanePriority = 11;
var InputContinuousLanePriority = 10;
var DefaultHydrationLanePriority = 9;
var DefaultLanePriority = 8;
var TransitionHydrationPriority = 7;
var TransitionPriority = 6;
var RetryLanePriority = 5;
var SelectiveHydrationLanePriority = 4;
var IdleHydrationLanePriority = 3;
var IdleLanePriority = 2;
var OffscreenLanePriority = 1;
var NoLanePriority = 0;
var TotalLanes = 31;
var NoLanes =
/*                        */
0;
var NoLane =
/*                          */
0;
var SyncLane =
/*                        */
1;
var SyncBatchedLane =
/*                 */
2;
var InputDiscreteHydrationLane =
/*      */
4;
var InputDiscreteLanes =
/*                    */
24;
var InputContinuousHydrationLane =
/*           */
32;
var InputContinuousLanes =
/*                  */
192;
var DefaultHydrationLane =
/*            */
256;
var DefaultLanes =
/*                   */
3584;
var TransitionHydrationLane =
/*                */
4096;
var TransitionLanes =
/*                       */
4186112;
var RetryLanes =
/*                            */
62914560;
var SomeRetryLane =
/*                  */
33554432;
var SelectiveHydrationLane =
/*          */
67108864;
var NonIdleLanes =
/*                                 */
134217727;
var IdleHydrationLane =
/*               */
134217728;
var IdleLanes =
/*                             */
805306368;
var OffscreenLane =
/*                   */
1073741824;
var NoTimestamp = -1;
function setCurrentUpdateLanePriority(newLanePriority) {
} // "Registers" used to "return" multiple values
// Used by getHighestPriorityLanes and getNextLanes:

var return_highestLanePriority = DefaultLanePriority;

function getHighestPriorityLanes(lanes) {
  if ((SyncLane & lanes) !== NoLanes) {
    return_highestLanePriority = SyncLanePriority;
    return SyncLane;
  }

  if ((SyncBatchedLane & lanes) !== NoLanes) {
    return_highestLanePriority = SyncBatchedLanePriority;
    return SyncBatchedLane;
  }

  if ((InputDiscreteHydrationLane & lanes) !== NoLanes) {
    return_highestLanePriority = InputDiscreteHydrationLanePriority;
    return InputDiscreteHydrationLane;
  }

  var inputDiscreteLanes = InputDiscreteLanes & lanes;

  if (inputDiscreteLanes !== NoLanes) {
    return_highestLanePriority = InputDiscreteLanePriority;
    return inputDiscreteLanes;
  }

  if ((lanes & InputContinuousHydrationLane) !== NoLanes) {
    return_highestLanePriority = InputContinuousHydrationLanePriority;
    return InputContinuousHydrationLane;
  }

  var inputContinuousLanes = InputContinuousLanes & lanes;

  if (inputContinuousLanes !== NoLanes) {
    return_highestLanePriority = InputContinuousLanePriority;
    return inputContinuousLanes;
  }

  if ((lanes & DefaultHydrationLane) !== NoLanes) {
    return_highestLanePriority = DefaultHydrationLanePriority;
    return DefaultHydrationLane;
  }

  var defaultLanes = DefaultLanes & lanes;

  if (defaultLanes !== NoLanes) {
    return_highestLanePriority = DefaultLanePriority;
    return defaultLanes;
  }

  if ((lanes & TransitionHydrationLane) !== NoLanes) {
    return_highestLanePriority = TransitionHydrationPriority;
    return TransitionHydrationLane;
  }

  var transitionLanes = TransitionLanes & lanes;

  if (transitionLanes !== NoLanes) {
    return_highestLanePriority = TransitionPriority;
    return transitionLanes;
  }

  var retryLanes = RetryLanes & lanes;

  if (retryLanes !== NoLanes) {
    return_highestLanePriority = RetryLanePriority;
    return retryLanes;
  }

  if (lanes & SelectiveHydrationLane) {
    return_highestLanePriority = SelectiveHydrationLanePriority;
    return SelectiveHydrationLane;
  }

  if ((lanes & IdleHydrationLane) !== NoLanes) {
    return_highestLanePriority = IdleHydrationLanePriority;
    return IdleHydrationLane;
  }

  var idleLanes = IdleLanes & lanes;

  if (idleLanes !== NoLanes) {
    return_highestLanePriority = IdleLanePriority;
    return idleLanes;
  }

  if ((OffscreenLane & lanes) !== NoLanes) {
    return_highestLanePriority = OffscreenLanePriority;
    return OffscreenLane;
  }

  {
    error('Should have found matching lanes. This is a bug in React.');
  } // This shouldn't be reachable, but as a fallback, return the entire bitmask.


  return_highestLanePriority = DefaultLanePriority;
  return lanes;
}

function schedulerPriorityToLanePriority(schedulerPriorityLevel) {
  switch (schedulerPriorityLevel) {
    case ImmediatePriority:
      return SyncLanePriority;

    case UserBlockingPriority:
      return InputContinuousLanePriority;

    case NormalPriority:
    case LowPriority:
      // TODO: Handle LowSchedulerPriority, somehow. Maybe the same lane as hydration.
      return DefaultLanePriority;

    case IdlePriority:
      return IdleLanePriority;

    default:
      return NoLanePriority;
  }
}
function lanePriorityToSchedulerPriority(lanePriority) {
  switch (lanePriority) {
    case SyncLanePriority:
    case SyncBatchedLanePriority:
      return ImmediatePriority;

    case InputDiscreteHydrationLanePriority:
    case InputDiscreteLanePriority:
    case InputContinuousHydrationLanePriority:
    case InputContinuousLanePriority:
      return UserBlockingPriority;

    case DefaultHydrationLanePriority:
    case DefaultLanePriority:
    case TransitionHydrationPriority:
    case TransitionPriority:
    case SelectiveHydrationLanePriority:
    case RetryLanePriority:
      return NormalPriority;

    case IdleHydrationLanePriority:
    case IdleLanePriority:
    case OffscreenLanePriority:
      return IdlePriority;

    case NoLanePriority:
      return NoPriority;

    default:
      {
        {
          throw Error( "Invalid update priority: " + lanePriority + ". This is a bug in React." );
        }
      }

  }
}
function getNextLanes(root, wipLanes) {
  // Early bailout if there's no pending work left.
  var pendingLanes = root.pendingLanes;

  if (pendingLanes === NoLanes) {
    return_highestLanePriority = NoLanePriority;
    return NoLanes;
  }

  var nextLanes = NoLanes;
  var nextLanePriority = NoLanePriority;
  var expiredLanes = root.expiredLanes;
  var suspendedLanes = root.suspendedLanes;
  var pingedLanes = root.pingedLanes; // Check if any work has expired.

  if (expiredLanes !== NoLanes) {
    nextLanes = expiredLanes;
    nextLanePriority = return_highestLanePriority = SyncLanePriority;
  } else {
    // Do not work on any idle work until all the non-idle work has finished,
    // even if the work is suspended.
    var nonIdlePendingLanes = pendingLanes & NonIdleLanes;

    if (nonIdlePendingLanes !== NoLanes) {
      var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;

      if (nonIdleUnblockedLanes !== NoLanes) {
        nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
        nextLanePriority = return_highestLanePriority;
      } else {
        var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;

        if (nonIdlePingedLanes !== NoLanes) {
          nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
          nextLanePriority = return_highestLanePriority;
        }
      }
    } else {
      // The only remaining work is Idle.
      var unblockedLanes = pendingLanes & ~suspendedLanes;

      if (unblockedLanes !== NoLanes) {
        nextLanes = getHighestPriorityLanes(unblockedLanes);
        nextLanePriority = return_highestLanePriority;
      } else {
        if (pingedLanes !== NoLanes) {
          nextLanes = getHighestPriorityLanes(pingedLanes);
          nextLanePriority = return_highestLanePriority;
        }
      }
    }
  }

  if (nextLanes === NoLanes) {
    // This should only be reachable if we're suspended
    // TODO: Consider warning in this path if a fallback timer is not scheduled.
    return NoLanes;
  } // If there are higher priority lanes, we'll include them even if they
  // are suspended.


  nextLanes = pendingLanes & getEqualOrHigherPriorityLanes(nextLanes); // If we're already in the middle of a render, switching lanes will interrupt
  // it and we'll lose our progress. We should only do this if the new lanes are
  // higher priority.

  if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't
  // bother waiting until the root is complete.
  (wipLanes & suspendedLanes) === NoLanes) {
    getHighestPriorityLanes(wipLanes);
    var wipLanePriority = return_highestLanePriority;

    if (nextLanePriority <= wipLanePriority) {
      return wipLanes;
    } else {
      return_highestLanePriority = nextLanePriority;
    }
  } // Check for entangled lanes and add them to the batch.
  //
  // A lane is said to be entangled with another when it's not allowed to render
  // in a batch that does not also include the other lane. Typically we do this
  // when multiple updates have the same source, and we only want to respond to
  // the most recent event from that source.
  //
  // Note that we apply entanglements *after* checking for partial work above.
  // This means that if a lane is entangled during an interleaved event while
  // it's already rendering, we won't interrupt it. This is intentional, since
  // entanglement is usually "best effort": we'll try our best to render the
  // lanes in the same batch, but it's not worth throwing out partially
  // completed work in order to do it.
  //
  // For those exceptions where entanglement is semantically important, like
  // useMutableSource, we should ensure that there is no partial work at the
  // time we apply the entanglement.


  var entangledLanes = root.entangledLanes;

  if (entangledLanes !== NoLanes) {
    var entanglements = root.entanglements;
    var lanes = nextLanes & entangledLanes;

    while (lanes > 0) {
      var index = pickArbitraryLaneIndex(lanes);
      var lane = 1 << index;
      nextLanes |= entanglements[index];
      lanes &= ~lane;
    }
  }

  return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
  var eventTimes = root.eventTimes;
  var mostRecentEventTime = NoTimestamp;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    var eventTime = eventTimes[index];

    if (eventTime > mostRecentEventTime) {
      mostRecentEventTime = eventTime;
    }

    lanes &= ~lane;
  }

  return mostRecentEventTime;
}

function computeExpirationTime(lane, currentTime) {
  // TODO: Expiration heuristic is constant per lane, so could use a map.
  getHighestPriorityLanes(lane);
  var priority = return_highestLanePriority;

  if (priority >= InputContinuousLanePriority) {
    // User interactions should expire slightly more quickly.
    //
    // NOTE: This is set to the corresponding constant as in Scheduler.js. When
    // we made it larger, a product metric in www regressed, suggesting there's
    // a user interaction that's being starved by a series of synchronous
    // updates. If that theory is correct, the proper solution is to fix the
    // starvation. However, this scenario supports the idea that expiration
    // times are an important safeguard when starvation does happen.
    //
    // Also note that, in the case of user input specifically, this will soon no
    // longer be an issue because we plan to make user input synchronous by
    // default (until you enter `startTransition`, of course.)
    //
    // If weren't planning to make these updates synchronous soon anyway, I
    // would probably make this number a configurable parameter.
    return currentTime + 250;
  } else if (priority >= TransitionPriority) {
    return currentTime + 5000;
  } else {
    // Anything idle priority or lower should never expire.
    return NoTimestamp;
  }
}

function markStarvedLanesAsExpired(root, currentTime) {
  // TODO: This gets called every time we yield. We can optimize by storing
  // the earliest expiration time on the root. Then use that to quickly bail out
  // of this function.
  var pendingLanes = root.pendingLanes;
  var suspendedLanes = root.suspendedLanes;
  var pingedLanes = root.pingedLanes;
  var expirationTimes = root.expirationTimes; // Iterate through the pending lanes and check if we've reached their
  // expiration time. If so, we'll assume the update is being starved and mark
  // it as expired to force it to finish.

  var lanes = pendingLanes;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    var expirationTime = expirationTimes[index];

    if (expirationTime === NoTimestamp) {
      // Found a pending lane with no expiration time. If it's not suspended, or
      // if it's pinged, assume it's CPU-bound. Compute a new expiration time
      // using the current time.
      if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
        // Assumes timestamps are monotonically increasing.
        expirationTimes[index] = computeExpirationTime(lane, currentTime);
      }
    } else if (expirationTime <= currentTime) {
      // This lane expired
      root.expiredLanes |= lane;
    }

    lanes &= ~lane;
  }
} // This returns the highest priority pending lanes regardless of whether they
function getLanesToRetrySynchronouslyOnError(root) {
  var everythingButOffscreen = root.pendingLanes & ~OffscreenLane;

  if (everythingButOffscreen !== NoLanes) {
    return everythingButOffscreen;
  }

  if (everythingButOffscreen & OffscreenLane) {
    return OffscreenLane;
  }

  return NoLanes;
}
function returnNextLanesPriority() {
  return return_highestLanePriority;
}
function includesNonIdleWork(lanes) {
  return (lanes & NonIdleLanes) !== NoLanes;
}
function includesOnlyRetries(lanes) {
  return (lanes & RetryLanes) === lanes;
}
function includesOnlyTransitions(lanes) {
  return (lanes & TransitionLanes) === lanes;
} // To ensure consistency across multiple updates in the same event, this should
// be a pure function, so that it always returns the same lane for given inputs.

function findUpdateLane(lanePriority, wipLanes) {
  switch (lanePriority) {
    case NoLanePriority:
      break;

    case SyncLanePriority:
      return SyncLane;

    case SyncBatchedLanePriority:
      return SyncBatchedLane;

    case InputDiscreteLanePriority:
      {
        var _lane = pickArbitraryLane(InputDiscreteLanes & ~wipLanes);

        if (_lane === NoLane) {
          // Shift to the next priority level
          return findUpdateLane(InputContinuousLanePriority, wipLanes);
        }

        return _lane;
      }

    case InputContinuousLanePriority:
      {
        var _lane2 = pickArbitraryLane(InputContinuousLanes & ~wipLanes);

        if (_lane2 === NoLane) {
          // Shift to the next priority level
          return findUpdateLane(DefaultLanePriority, wipLanes);
        }

        return _lane2;
      }

    case DefaultLanePriority:
      {
        var _lane3 = pickArbitraryLane(DefaultLanes & ~wipLanes);

        if (_lane3 === NoLane) {
          // If all the default lanes are already being worked on, look for a
          // lane in the transition range.
          _lane3 = pickArbitraryLane(TransitionLanes & ~wipLanes);

          if (_lane3 === NoLane) {
            // All the transition lanes are taken, too. This should be very
            // rare, but as a last resort, pick a default lane. This will have
            // the effect of interrupting the current work-in-progress render.
            _lane3 = pickArbitraryLane(DefaultLanes);
          }
        }

        return _lane3;
      }

    case TransitionPriority: // Should be handled by findTransitionLane instead

    case RetryLanePriority:
      // Should be handled by findRetryLane instead
      break;

    case IdleLanePriority:
      var lane = pickArbitraryLane(IdleLanes & ~wipLanes);

      if (lane === NoLane) {
        lane = pickArbitraryLane(IdleLanes);
      }

      return lane;
  }

  {
    {
      throw Error( "Invalid update priority: " + lanePriority + ". This is a bug in React." );
    }
  }
} // To ensure consistency across multiple updates in the same event, this should
// be pure function, so that it always returns the same lane for given inputs.

function findTransitionLane(wipLanes, pendingLanes) {
  // First look for lanes that are completely unclaimed, i.e. have no
  // pending work.
  var lane = pickArbitraryLane(TransitionLanes & ~pendingLanes);

  if (lane === NoLane) {
    // If all lanes have pending work, look for a lane that isn't currently
    // being worked on.
    lane = pickArbitraryLane(TransitionLanes & ~wipLanes);

    if (lane === NoLane) {
      // If everything is being worked on, pick any lane. This has the
      // effect of interrupting the current work-in-progress.
      lane = pickArbitraryLane(TransitionLanes);
    }
  }

  return lane;
} // To ensure consistency across multiple updates in the same event, this should
// be pure function, so that it always returns the same lane for given inputs.

function findRetryLane(wipLanes) {
  // This is a fork of `findUpdateLane` designed specifically for Suspense
  // "retries" — a special update that attempts to flip a Suspense boundary
  // from its placeholder state to its primary/resolved state.
  var lane = pickArbitraryLane(RetryLanes & ~wipLanes);

  if (lane === NoLane) {
    lane = pickArbitraryLane(RetryLanes);
  }

  return lane;
}

function getHighestPriorityLane(lanes) {
  return lanes & -lanes;
}

function getLowestPriorityLane(lanes) {
  // This finds the most significant non-zero bit.
  var index = 31 - clz32(lanes);
  return index < 0 ? NoLanes : 1 << index;
}

function getEqualOrHigherPriorityLanes(lanes) {
  return (getLowestPriorityLane(lanes) << 1) - 1;
}

function pickArbitraryLane(lanes) {
  // This wrapper function gets inlined. Only exists so to communicate that it
  // doesn't matter which bit is selected; you can pick any bit without
  // affecting the algorithms where its used. Here I'm using
  // getHighestPriorityLane because it requires the fewest operations.
  return getHighestPriorityLane(lanes);
}

function pickArbitraryLaneIndex(lanes) {
  return 31 - clz32(lanes);
}

function laneToIndex(lane) {
  return pickArbitraryLaneIndex(lane);
}

function includesSomeLane(a, b) {
  return (a & b) !== NoLanes;
}
function isSubsetOfLanes(set, subset) {
  return (set & subset) === subset;
}
function mergeLanes(a, b) {
  return a | b;
}
function removeLanes(set, subset) {
  return set & ~subset;
} // Seems redundant, but it changes the type from a single lane (used for
// updates) to a group of lanes (used for flushing work).

function laneToLanes(lane) {
  return lane;
}
function higherPriorityLane(a, b) {
  // This works because the bit ranges decrease in priority as you go left.
  return a !== NoLane && a < b ? a : b;
}
function createLaneMap(initial) {
  // Intentionally pushing one by one.
  // https://v8.dev/blog/elements-kinds#avoid-creating-holes
  var laneMap = [];

  for (var i = 0; i < TotalLanes; i++) {
    laneMap.push(initial);
  }

  return laneMap;
}
function markRootUpdated(root, updateLane, eventTime) {
  root.pendingLanes |= updateLane; // TODO: Theoretically, any update to any lane can unblock any other lane. But
  // it's not practical to try every single possible combination. We need a
  // heuristic to decide which lanes to attempt to render, and in which batches.
  // For now, we use the same heuristic as in the old ExpirationTimes model:
  // retry any lane at equal or lower priority, but don't try updates at higher
  // priority without also including the lower priority updates. This works well
  // when considering updates across different priority levels, but isn't
  // sufficient for updates within the same priority, since we want to treat
  // those updates as parallel.
  // Unsuspend any update at equal or lower priority.

  var higherPriorityLanes = updateLane - 1; // Turns 0b1000 into 0b0111

  root.suspendedLanes &= higherPriorityLanes;
  root.pingedLanes &= higherPriorityLanes;
  var eventTimes = root.eventTimes;
  var index = laneToIndex(updateLane); // We can always overwrite an existing timestamp because we prefer the most
  // recent event, and we assume time is monotonically increasing.

  eventTimes[index] = eventTime;
}
function markRootSuspended(root, suspendedLanes) {
  root.suspendedLanes |= suspendedLanes;
  root.pingedLanes &= ~suspendedLanes; // The suspended lanes are no longer CPU-bound. Clear their expiration times.

  var expirationTimes = root.expirationTimes;
  var lanes = suspendedLanes;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    expirationTimes[index] = NoTimestamp;
    lanes &= ~lane;
  }
}
function markRootPinged(root, pingedLanes, eventTime) {
  root.pingedLanes |= root.suspendedLanes & pingedLanes;
}
function markDiscreteUpdatesExpired(root) {
  root.expiredLanes |= InputDiscreteLanes & root.pendingLanes;
}
function hasDiscreteLanes(lanes) {
  return (lanes & InputDiscreteLanes) !== NoLanes;
}
function markRootMutableRead(root, updateLane) {
  root.mutableReadLanes |= updateLane & root.pendingLanes;
}
function markRootFinished(root, remainingLanes) {
  var noLongerPendingLanes = root.pendingLanes & ~remainingLanes;
  root.pendingLanes = remainingLanes; // Let's try everything again

  root.suspendedLanes = 0;
  root.pingedLanes = 0;
  root.expiredLanes &= remainingLanes;
  root.mutableReadLanes &= remainingLanes;
  root.entangledLanes &= remainingLanes;
  var entanglements = root.entanglements;
  var eventTimes = root.eventTimes;
  var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work

  var lanes = noLongerPendingLanes;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    entanglements[index] = NoLanes;
    eventTimes[index] = NoTimestamp;
    expirationTimes[index] = NoTimestamp;
    lanes &= ~lane;
  }
}
function markRootEntangled(root, entangledLanes) {
  root.entangledLanes |= entangledLanes;
  var entanglements = root.entanglements;
  var lanes = entangledLanes;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    entanglements[index] |= entangledLanes;
    lanes &= ~lane;
  }
}
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros. Only used on lanes, so assume input is an integer.
// Based on:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32

var log = Math.log;
var LN2 = Math.LN2;

function clz32Fallback(lanes) {
  if (lanes === 0) {
    return 32;
  }

  return 31 - (log(lanes) / LN2 | 0) | 0;
}

// Intentionally not named imports because Rollup would use dynamic dispatch for
var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority,
    runWithPriority = Scheduler.unstable_runWithPriority; // TODO: can we stop exporting these?

var _enabled = true; // This is exported in FB builds for use by legacy FB layer infra.
// We'd like to remove this but it's not clear if this is safe.

function setEnabled(enabled) {
  _enabled = !!enabled;
}
function isEnabled() {
  return _enabled;
}
function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
  var eventPriority = getEventPriorityForPluginSystem(domEventName);
  var listenerWrapper;

  switch (eventPriority) {
    case DiscreteEvent:
      listenerWrapper = dispatchDiscreteEvent;
      break;

    case UserBlockingEvent:
      listenerWrapper = dispatchUserBlockingUpdate;
      break;

    case ContinuousEvent:
    default:
      listenerWrapper = dispatchEvent;
      break;
  }

  return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
}

function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
  {
    flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
  }

  discreteUpdates(dispatchEvent, domEventName, eventSystemFlags, container, nativeEvent);
}

function dispatchUserBlockingUpdate(domEventName, eventSystemFlags, container, nativeEvent) {
  {
    runWithPriority(UserBlockingPriority$1, dispatchEvent.bind(null, domEventName, eventSystemFlags, container, nativeEvent));
  }
}

function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  if (!_enabled) {
    return;
  }

  var allowReplay = true;

  {
    // TODO: replaying capture phase events is currently broken
    // because we used to do it during top-level native bubble handlers
    // but now we use different bubble and capture handlers.
    // In eager mode, we attach capture listeners early, so we need
    // to filter them out until we fix the logic to handle them correctly.
    // This could've been outside the flag but I put it inside to reduce risk.
    allowReplay = (eventSystemFlags & IS_CAPTURE_PHASE) === 0;
  }

  if (allowReplay && hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(domEventName)) {
    // If we already have a queue of discrete events, and this is another discrete
    // event, then we can't dispatch it regardless of its target, since they
    // need to dispatch in order.
    queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.
    domEventName, eventSystemFlags, targetContainer, nativeEvent);
    return;
  }

  var blockedOn = attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);

  if (blockedOn === null) {
    // We successfully dispatched this event.
    if (allowReplay) {
      clearIfContinuousEvent(domEventName, nativeEvent);
    }

    return;
  }

  if (allowReplay) {
    if (isReplayableDiscreteEvent(domEventName)) {
      // This this to be replayed later once the target is available.
      queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
      return;
    }

    if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
      return;
    } // We need to clear only if we didn't queue because
    // queueing is accummulative.


    clearIfContinuousEvent(domEventName, nativeEvent);
  } // This is not replayable so we'll invoke it but without a target,
  // in case the event system needs to trace it.


  dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
} // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.

function attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  // TODO: Warn if _enabled is false.
  var nativeEventTarget = getEventTarget(nativeEvent);
  var targetInst = getClosestInstanceFromNode(nativeEventTarget);

  if (targetInst !== null) {
    var nearestMounted = getNearestMountedFiber(targetInst);

    if (nearestMounted === null) {
      // This tree has been unmounted already. Dispatch without a target.
      targetInst = null;
    } else {
      var tag = nearestMounted.tag;

      if (tag === SuspenseComponent) {
        var instance = getSuspenseInstanceFromFiber(nearestMounted);

        if (instance !== null) {
          // Queue the event to be replayed later. Abort dispatching since we
          // don't want this event dispatched twice through the event system.
          // TODO: If this is the first discrete event in the queue. Schedule an increased
          // priority for this boundary.
          return instance;
        } // This shouldn't happen, something went wrong but to avoid blocking
        // the whole system, dispatch the event without a target.
        // TODO: Warn.


        targetInst = null;
      } else if (tag === HostRoot) {
        var root = nearestMounted.stateNode;

        if (root.hydrate) {
          // If this happens during a replay something went wrong and it might block
          // the whole system.
          return getContainerFromFiber(nearestMounted);
        }

        targetInst = null;
      } else if (nearestMounted !== targetInst) {
        // If we get an event (ex: img onload) before committing that
        // component's mount, ignore it for now (that is, treat it as if it was an
        // event on a non-React tree). We might also consider queueing events and
        // dispatching them after the mount.
        targetInst = null;
      }
    }
  }

  dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer); // We're not blocked on anything.

  return null;
}

function addEventBubbleListener(target, eventType, listener) {
  target.addEventListener(eventType, listener, false);
  return listener;
}
function addEventCaptureListener(target, eventType, listener) {
  target.addEventListener(eventType, listener, true);
  return listener;
}
function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {
  target.addEventListener(eventType, listener, {
    capture: true,
    passive: passive
  });
  return listener;
}
function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {
  target.addEventListener(eventType, listener, {
    passive: passive
  });
  return listener;
}

/**
 * These variables store information about text content of a target node,
 * allowing comparison of content before and after a given event.
 *
 * Identify the node where selection currently begins, then observe
 * both its text content and its current position in the DOM. Since the
 * browser may natively replace the target node during composition, we can
 * use its position to find its replacement.
 *
 *
 */
var root = null;
var startText = null;
var fallbackText = null;
function initialize(nativeEventTarget) {
  root = nativeEventTarget;
  startText = getText();
  return true;
}
function reset() {
  root = null;
  startText = null;
  fallbackText = null;
}
function getData() {
  if (fallbackText) {
    return fallbackText;
  }

  var start;
  var startValue = startText;
  var startLength = startValue.length;
  var end;
  var endValue = getText();
  var endLength = endValue.length;

  for (start = 0; start < startLength; start++) {
    if (startValue[start] !== endValue[start]) {
      break;
    }
  }

  var minEnd = startLength - start;

  for (end = 1; end <= minEnd; end++) {
    if (startValue[startLength - end] !== endValue[endLength - end]) {
      break;
    }
  }

  var sliceTail = end > 1 ? 1 - end : undefined;
  fallbackText = endValue.slice(start, sliceTail);
  return fallbackText;
}
function getText() {
  if ('value' in root) {
    return root.value;
  }

  return root.textContent;
}

/**
 * `charCode` represents the actual "character code" and is safe to use with
 * `String.fromCharCode`. As such, only keys that correspond to printable
 * characters produce a valid `charCode`, the only exception to this is Enter.
 * The Tab-key is considered non-printable and does not have a `charCode`,
 * presumably because it does not produce a tab-character in browsers.
 *
 * @param {object} nativeEvent Native browser event.
 * @return {number} Normalized `charCode` property.
 */
function getEventCharCode(nativeEvent) {
  var charCode;
  var keyCode = nativeEvent.keyCode;

  if ('charCode' in nativeEvent) {
    charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.

    if (charCode === 0 && keyCode === 13) {
      charCode = 13;
    }
  } else {
    // IE8 does not implement `charCode`, but `keyCode` has the correct value.
    charCode = keyCode;
  } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
  // report Enter as charCode 10 when ctrl is pressed.


  if (charCode === 10) {
    charCode = 13;
  } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
  // Must not discard the (non-)printable Enter-key.


  if (charCode >= 32 || charCode === 13) {
    return charCode;
  }

  return 0;
}

function functionThatReturnsTrue() {
  return true;
}

function functionThatReturnsFalse() {
  return false;
} // This is intentionally a factory so that we have different returned constructors.
// If we had a single constructor, it would be megamorphic and engines would deopt.


function createSyntheticEvent(Interface) {
  /**
   * Synthetic events are dispatched by event plugins, typically in response to a
   * top-level event delegation handler.
   *
   * These systems should generally use pooling to reduce the frequency of garbage
   * collection. The system should check `isPersistent` to determine whether the
   * event should be released into the pool after being dispatched. Users that
   * need a persisted event should invoke `persist`.
   *
   * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
   * normalizing browser quirks. Subclasses do not necessarily have to implement a
   * DOM interface; custom application-specific events can also subclass this.
   */
  function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
    this._reactName = reactName;
    this._targetInst = targetInst;
    this.type = reactEventType;
    this.nativeEvent = nativeEvent;
    this.target = nativeEventTarget;
    this.currentTarget = null;

    for (var _propName in Interface) {
      if (!Interface.hasOwnProperty(_propName)) {
        continue;
      }

      var normalize = Interface[_propName];

      if (normalize) {
        this[_propName] = normalize(nativeEvent);
      } else {
        this[_propName] = nativeEvent[_propName];
      }
    }

    var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;

    if (defaultPrevented) {
      this.isDefaultPrevented = functionThatReturnsTrue;
    } else {
      this.isDefaultPrevented = functionThatReturnsFalse;
    }

    this.isPropagationStopped = functionThatReturnsFalse;
    return this;
  }

  _assign(SyntheticBaseEvent.prototype, {
    preventDefault: function () {
      this.defaultPrevented = true;
      var event = this.nativeEvent;

      if (!event) {
        return;
      }

      if (event.preventDefault) {
        event.preventDefault(); // $FlowFixMe - flow is not aware of `unknown` in IE
      } else if (typeof event.returnValue !== 'unknown') {
        event.returnValue = false;
      }

      this.isDefaultPrevented = functionThatReturnsTrue;
    },
    stopPropagation: function () {
      var event = this.nativeEvent;

      if (!event) {
        return;
      }

      if (event.stopPropagation) {
        event.stopPropagation(); // $FlowFixMe - flow is not aware of `unknown` in IE
      } else if (typeof event.cancelBubble !== 'unknown') {
        // The ChangeEventPlugin registers a "propertychange" event for
        // IE. This event does not support bubbling or cancelling, and
        // any references to cancelBubble throw "Member not found".  A
        // typeof check of "unknown" circumvents this issue (and is also
        // IE specific).
        event.cancelBubble = true;
      }

      this.isPropagationStopped = functionThatReturnsTrue;
    },

    /**
     * We release all dispatched `SyntheticEvent`s after each event loop, adding
     * them back into the pool. This allows a way to hold onto a reference that
     * won't be added back into the pool.
     */
    persist: function () {// Modern event system doesn't use pooling.
    },

    /**
     * Checks if this event should be released back into the pool.
     *
     * @return {boolean} True if this should not be released, false otherwise.
     */
    isPersistent: functionThatReturnsTrue
  });

  return SyntheticBaseEvent;
}
/**
 * @interface Event
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */


var EventInterface = {
  eventPhase: 0,
  bubbles: 0,
  cancelable: 0,
  timeStamp: function (event) {
    return event.timeStamp || Date.now();
  },
  defaultPrevented: 0,
  isTrusted: 0
};
var SyntheticEvent = createSyntheticEvent(EventInterface);

var UIEventInterface = _assign({}, EventInterface, {
  view: 0,
  detail: 0
});

var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
var lastMovementX;
var lastMovementY;
var lastMouseEvent;

function updateMouseMovementPolyfillState(event) {
  if (event !== lastMouseEvent) {
    if (lastMouseEvent && event.type === 'mousemove') {
      lastMovementX = event.screenX - lastMouseEvent.screenX;
      lastMovementY = event.screenY - lastMouseEvent.screenY;
    } else {
      lastMovementX = 0;
      lastMovementY = 0;
    }

    lastMouseEvent = event;
  }
}
/**
 * @interface MouseEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */


var MouseEventInterface = _assign({}, UIEventInterface, {
  screenX: 0,
  screenY: 0,
  clientX: 0,
  clientY: 0,
  pageX: 0,
  pageY: 0,
  ctrlKey: 0,
  shiftKey: 0,
  altKey: 0,
  metaKey: 0,
  getModifierState: getEventModifierState,
  button: 0,
  buttons: 0,
  relatedTarget: function (event) {
    if (event.relatedTarget === undefined) return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
    return event.relatedTarget;
  },
  movementX: function (event) {
    if ('movementX' in event) {
      return event.movementX;
    }

    updateMouseMovementPolyfillState(event);
    return lastMovementX;
  },
  movementY: function (event) {
    if ('movementY' in event) {
      return event.movementY;
    } // Don't need to call updateMouseMovementPolyfillState() here
    // because it's guaranteed to have already run when movementX
    // was copied.


    return lastMovementY;
  }
});

var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
/**
 * @interface DragEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */

var DragEventInterface = _assign({}, MouseEventInterface, {
  dataTransfer: 0
});

var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
/**
 * @interface FocusEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */

var FocusEventInterface = _assign({}, UIEventInterface, {
  relatedTarget: 0
});

var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
 */

var AnimationEventInterface = _assign({}, EventInterface, {
  animationName: 0,
  elapsedTime: 0,
  pseudoElement: 0
});

var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/clipboard-apis/
 */

var ClipboardEventInterface = _assign({}, EventInterface, {
  clipboardData: function (event) {
    return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
  }
});

var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
 */

var CompositionEventInterface = _assign({}, EventInterface, {
  data: 0
});

var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
 *      /#events-inputevents
 */
// Happens to share the same list for now.

var SyntheticInputEvent = SyntheticCompositionEvent;
/**
 * Normalization of deprecated HTML5 `key` values
 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
 */

var normalizeKey = {
  Esc: 'Escape',
  Spacebar: ' ',
  Left: 'ArrowLeft',
  Up: 'ArrowUp',
  Right: 'ArrowRight',
  Down: 'ArrowDown',
  Del: 'Delete',
  Win: 'OS',
  Menu: 'ContextMenu',
  Apps: 'ContextMenu',
  Scroll: 'ScrollLock',
  MozPrintableKey: 'Unidentified'
};
/**
 * Translation from legacy `keyCode` to HTML5 `key`
 * Only special keys supported, all others depend on keyboard layout or browser
 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
 */

var translateToKey = {
  '8': 'Backspace',
  '9': 'Tab',
  '12': 'Clear',
  '13': 'Enter',
  '16': 'Shift',
  '17': 'Control',
  '18': 'Alt',
  '19': 'Pause',
  '20': 'CapsLock',
  '27': 'Escape',
  '32': ' ',
  '33': 'PageUp',
  '34': 'PageDown',
  '35': 'End',
  '36': 'Home',
  '37': 'ArrowLeft',
  '38': 'ArrowUp',
  '39': 'ArrowRight',
  '40': 'ArrowDown',
  '45': 'Insert',
  '46': 'Delete',
  '112': 'F1',
  '113': 'F2',
  '114': 'F3',
  '115': 'F4',
  '116': 'F5',
  '117': 'F6',
  '118': 'F7',
  '119': 'F8',
  '120': 'F9',
  '121': 'F10',
  '122': 'F11',
  '123': 'F12',
  '144': 'NumLock',
  '145': 'ScrollLock',
  '224': 'Meta'
};
/**
 * @param {object} nativeEvent Native browser event.
 * @return {string} Normalized `key` property.
 */

function getEventKey(nativeEvent) {
  if (nativeEvent.key) {
    // Normalize inconsistent values reported by browsers due to
    // implementations of a working draft specification.
    // FireFox implements `key` but returns `MozPrintableKey` for all
    // printable characters (normalized to `Unidentified`), ignore it.
    var key = normalizeKey[nativeEvent.key] || nativeEvent.key;

    if (key !== 'Unidentified') {
      return key;
    }
  } // Browser does not implement `key`, polyfill as much of it as we can.


  if (nativeEvent.type === 'keypress') {
    var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can
    // thus be captured by `keypress`, no other non-printable key should.

    return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
  }

  if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
    // While user keyboard layout determines the actual meaning of each
    // `keyCode` value, almost all function keys have a universal value.
    return translateToKey[nativeEvent.keyCode] || 'Unidentified';
  }

  return '';
}
/**
 * Translation from modifier key to the associated property in the event.
 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
 */


var modifierKeyToProp = {
  Alt: 'altKey',
  Control: 'ctrlKey',
  Meta: 'metaKey',
  Shift: 'shiftKey'
}; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
// getModifierState. If getModifierState is not supported, we map it to a set of
// modifier keys exposed by the event. In this case, Lock-keys are not supported.

function modifierStateGetter(keyArg) {
  var syntheticEvent = this;
  var nativeEvent = syntheticEvent.nativeEvent;

  if (nativeEvent.getModifierState) {
    return nativeEvent.getModifierState(keyArg);
  }

  var keyProp = modifierKeyToProp[keyArg];
  return keyProp ? !!nativeEvent[keyProp] : false;
}

function getEventModifierState(nativeEvent) {
  return modifierStateGetter;
}
/**
 * @interface KeyboardEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */


var KeyboardEventInterface = _assign({}, UIEventInterface, {
  key: getEventKey,
  code: 0,
  location: 0,
  ctrlKey: 0,
  shiftKey: 0,
  altKey: 0,
  metaKey: 0,
  repeat: 0,
  locale: 0,
  getModifierState: getEventModifierState,
  // Legacy Interface
  charCode: function (event) {
    // `charCode` is the result of a KeyPress event and represents the value of
    // the actual printable character.
    // KeyPress is deprecated, but its replacement is not yet final and not
    // implemented in any major browser. Only KeyPress has charCode.
    if (event.type === 'keypress') {
      return getEventCharCode(event);
    }

    return 0;
  },
  keyCode: function (event) {
    // `keyCode` is the result of a KeyDown/Up event and represents the value of
    // physical keyboard key.
    // The actual meaning of the value depends on the users' keyboard layout
    // which cannot be detected. Assuming that it is a US keyboard layout
    // provides a surprisingly accurate mapping for US and European users.
    // Due to this, it is left to the user to implement at this time.
    if (event.type === 'keydown' || event.type === 'keyup') {
      return event.keyCode;
    }

    return 0;
  },
  which: function (event) {
    // `which` is an alias for either `keyCode` or `charCode` depending on the
    // type of the event.
    if (event.type === 'keypress') {
      return getEventCharCode(event);
    }

    if (event.type === 'keydown' || event.type === 'keyup') {
      return event.keyCode;
    }

    return 0;
  }
});

var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
/**
 * @interface PointerEvent
 * @see http://www.w3.org/TR/pointerevents/
 */

var PointerEventInterface = _assign({}, MouseEventInterface, {
  pointerId: 0,
  width: 0,
  height: 0,
  pressure: 0,
  tangentialPressure: 0,
  tiltX: 0,
  tiltY: 0,
  twist: 0,
  pointerType: 0,
  isPrimary: 0
});

var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
/**
 * @interface TouchEvent
 * @see http://www.w3.org/TR/touch-events/
 */

var TouchEventInterface = _assign({}, UIEventInterface, {
  touches: 0,
  targetTouches: 0,
  changedTouches: 0,
  altKey: 0,
  metaKey: 0,
  ctrlKey: 0,
  shiftKey: 0,
  getModifierState: getEventModifierState
});

var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
 * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
 */

var TransitionEventInterface = _assign({}, EventInterface, {
  propertyName: 0,
  elapsedTime: 0,
  pseudoElement: 0
});

var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
/**
 * @interface WheelEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */

var WheelEventInterface = _assign({}, MouseEventInterface, {
  deltaX: function (event) {
    return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
    'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
  },
  deltaY: function (event) {
    return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
    'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
    'wheelDelta' in event ? -event.wheelDelta : 0;
  },
  deltaZ: 0,
  // Browsers without "deltaMode" is reporting in raw wheel delta where one
  // notch on the scroll is always +/- 120, roughly equivalent to pixels.
  // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
  // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
  deltaMode: 0
});

var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);

var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space

var START_KEYCODE = 229;
var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
var documentMode = null;

if (canUseDOM && 'documentMode' in document) {
  documentMode = document.documentMode;
} // Webkit offers a very useful `textInput` event that can be used to
// directly represent `beforeInput`. The IE `textinput` event is not as
// useful, so we don't use it.


var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied
// by the native compositionend event may be incorrect. Japanese ideographic
// spaces, for instance (\u3000) are not recorded correctly.

var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);

function registerEvents() {
  registerTwoPhaseEvent('onBeforeInput', ['compositionend', 'keypress', 'textInput', 'paste']);
  registerTwoPhaseEvent('onCompositionEnd', ['compositionend', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);
  registerTwoPhaseEvent('onCompositionStart', ['compositionstart', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);
  registerTwoPhaseEvent('onCompositionUpdate', ['compositionupdate', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);
} // Track whether we've ever handled a keypress on the space key.


var hasSpaceKeypress = false;
/**
 * Return whether a native keypress event is assumed to be a command.
 * This is required because Firefox fires `keypress` events for key commands
 * (cut, copy, select-all, etc.) even though no character is inserted.
 */

function isKeypressCommand(nativeEvent) {
  return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
  !(nativeEvent.ctrlKey && nativeEvent.altKey);
}
/**
 * Translate native top level events into event types.
 */


function getCompositionEventType(domEventName) {
  switch (domEventName) {
    case 'compositionstart':
      return 'onCompositionStart';

    case 'compositionend':
      return 'onCompositionEnd';

    case 'compositionupdate':
      return 'onCompositionUpdate';
  }
}
/**
 * Does our fallback best-guess model think this event signifies that
 * composition has begun?
 */


function isFallbackCompositionStart(domEventName, nativeEvent) {
  return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;
}
/**
 * Does our fallback mode think that this event is the end of composition?
 */


function isFallbackCompositionEnd(domEventName, nativeEvent) {
  switch (domEventName) {
    case 'keyup':
      // Command keys insert or clear IME input.
      return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;

    case 'keydown':
      // Expect IME keyCode on each keydown. If we get any other
      // code we must have exited earlier.
      return nativeEvent.keyCode !== START_KEYCODE;

    case 'keypress':
    case 'mousedown':
    case 'focusout':
      // Events are not possible without cancelling IME.
      return true;

    default:
      return false;
  }
}
/**
 * Google Input Tools provides composition data via a CustomEvent,
 * with the `data` property populated in the `detail` object. If this
 * is available on the event object, use it. If not, this is a plain
 * composition event and we have nothing special to extract.
 *
 * @param {object} nativeEvent
 * @return {?string}
 */


function getDataFromCustomEvent(nativeEvent) {
  var detail = nativeEvent.detail;

  if (typeof detail === 'object' && 'data' in detail) {
    return detail.data;
  }

  return null;
}
/**
 * Check if a composition event was triggered by Korean IME.
 * Our fallback mode does not work well with IE's Korean IME,
 * so just use native composition events when Korean IME is used.
 * Although CompositionEvent.locale property is deprecated,
 * it is available in IE, where our fallback mode is enabled.
 *
 * @param {object} nativeEvent
 * @return {boolean}
 */


function isUsingKoreanIME(nativeEvent) {
  return nativeEvent.locale === 'ko';
} // Track the current IME composition status, if any.


var isComposing = false;
/**
 * @return {?object} A SyntheticCompositionEvent.
 */

function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
  var eventType;
  var fallbackData;

  if (canUseCompositionEvent) {
    eventType = getCompositionEventType(domEventName);
  } else if (!isComposing) {
    if (isFallbackCompositionStart(domEventName, nativeEvent)) {
      eventType = 'onCompositionStart';
    }
  } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
    eventType = 'onCompositionEnd';
  }

  if (!eventType) {
    return null;
  }

  if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
    // The current composition is stored statically and must not be
    // overwritten while composition continues.
    if (!isComposing && eventType === 'onCompositionStart') {
      isComposing = initialize(nativeEventTarget);
    } else if (eventType === 'onCompositionEnd') {
      if (isComposing) {
        fallbackData = getData();
      }
    }
  }

  var listeners = accumulateTwoPhaseListeners(targetInst, eventType);

  if (listeners.length > 0) {
    var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
    dispatchQueue.push({
      event: event,
      listeners: listeners
    });

    if (fallbackData) {
      // Inject data generated from fallback path into the synthetic event.
      // This matches the property of native CompositionEventInterface.
      event.data = fallbackData;
    } else {
      var customData = getDataFromCustomEvent(nativeEvent);

      if (customData !== null) {
        event.data = customData;
      }
    }
  }
}

function getNativeBeforeInputChars(domEventName, nativeEvent) {
  switch (domEventName) {
    case 'compositionend':
      return getDataFromCustomEvent(nativeEvent);

    case 'keypress':
      /**
       * If native `textInput` events are available, our goal is to make
       * use of them. However, there is a special case: the spacebar key.
       * In Webkit, preventing default on a spacebar `textInput` event
       * cancels character insertion, but it *also* causes the browser
       * to fall back to its default spacebar behavior of scrolling the
       * page.
       *
       * Tracking at:
       * https://code.google.com/p/chromium/issues/detail?id=355103
       *
       * To avoid this issue, use the keypress event as if no `textInput`
       * event is available.
       */
      var which = nativeEvent.which;

      if (which !== SPACEBAR_CODE) {
        return null;
      }

      hasSpaceKeypress = true;
      return SPACEBAR_CHAR;

    case 'textInput':
      // Record the characters to be added to the DOM.
      var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled
      // it at the keypress level and bail immediately. Android Chrome
      // doesn't give us keycodes, so we need to ignore it.

      if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
        return null;
      }

      return chars;

    default:
      // For other native event types, do nothing.
      return null;
  }
}
/**
 * For browsers that do not provide the `textInput` event, extract the
 * appropriate string to use for SyntheticInputEvent.
 */


function getFallbackBeforeInputChars(domEventName, nativeEvent) {
  // If we are currently composing (IME) and using a fallback to do so,
  // try to extract the composed characters from the fallback object.
  // If composition event is available, we extract a string only at
  // compositionevent, otherwise extract it at fallback events.
  if (isComposing) {
    if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
      var chars = getData();
      reset();
      isComposing = false;
      return chars;
    }

    return null;
  }

  switch (domEventName) {
    case 'paste':
      // If a paste event occurs after a keypress, throw out the input
      // chars. Paste events should not lead to BeforeInput events.
      return null;

    case 'keypress':
      /**
       * As of v27, Firefox may fire keypress events even when no character
       * will be inserted. A few possibilities:
       *
       * - `which` is `0`. Arrow keys, Esc key, etc.
       *
       * - `which` is the pressed key code, but no char is available.
       *   Ex: 'AltGr + d` in Polish. There is no modified character for
       *   this key combination and no character is inserted into the
       *   document, but FF fires the keypress for char code `100` anyway.
       *   No `input` event will occur.
       *
       * - `which` is the pressed key code, but a command combination is
       *   being used. Ex: `Cmd+C`. No character is inserted, and no
       *   `input` event will occur.
       */
      if (!isKeypressCommand(nativeEvent)) {
        // IE fires the `keypress` event when a user types an emoji via
        // Touch keyboard of Windows.  In such a case, the `char` property
        // holds an emoji character like `\uD83D\uDE0A`.  Because its length
        // is 2, the property `which` does not represent an emoji correctly.
        // In such a case, we directly return the `char` property instead of
        // using `which`.
        if (nativeEvent.char && nativeEvent.char.length > 1) {
          return nativeEvent.char;
        } else if (nativeEvent.which) {
          return String.fromCharCode(nativeEvent.which);
        }
      }

      return null;

    case 'compositionend':
      return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;

    default:
      return null;
  }
}
/**
 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
 * `textInput` or fallback behavior.
 *
 * @return {?object} A SyntheticInputEvent.
 */


function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
  var chars;

  if (canUseTextInputEvent) {
    chars = getNativeBeforeInputChars(domEventName, nativeEvent);
  } else {
    chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
  } // If no characters are being inserted, no BeforeInput event should
  // be fired.


  if (!chars) {
    return null;
  }

  var listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput');

  if (listeners.length > 0) {
    var event = new SyntheticInputEvent('onBeforeInput', 'beforeinput', null, nativeEvent, nativeEventTarget);
    dispatchQueue.push({
      event: event,
      listeners: listeners
    });
    event.data = chars;
  }
}
/**
 * Create an `onBeforeInput` event to match
 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
 *
 * This event plugin is based on the native `textInput` event
 * available in Chrome, Safari, Opera, and IE. This event fires after
 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
 *
 * `beforeInput` is spec'd but not implemented in any browsers, and
 * the `input` event does not provide any useful information about what has
 * actually been added, contrary to the spec. Thus, `textInput` is the best
 * available event to identify the characters that have actually been inserted
 * into the target node.
 *
 * This plugin is also responsible for emitting `composition` events, thus
 * allowing us to share composition fallback code for both `beforeInput` and
 * `composition` event types.
 */


function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
  extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
}

/**
 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
 */
var supportedInputTypes = {
  color: true,
  date: true,
  datetime: true,
  'datetime-local': true,
  email: true,
  month: true,
  number: true,
  password: true,
  range: true,
  search: true,
  tel: true,
  text: true,
  time: true,
  url: true,
  week: true
};

function isTextInputElement(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();

  if (nodeName === 'input') {
    return !!supportedInputTypes[elem.type];
  }

  if (nodeName === 'textarea') {
    return true;
  }

  return false;
}

/**
 * Checks if an event is supported in the current execution environment.
 *
 * NOTE: This will not work correctly for non-generic events such as `change`,
 * `reset`, `load`, `error`, and `select`.
 *
 * Borrows from Modernizr.
 *
 * @param {string} eventNameSuffix Event name, e.g. "click".
 * @return {boolean} True if the event is supported.
 * @internal
 * @license Modernizr 3.0.0pre (Custom Build) | MIT
 */

function isEventSupported(eventNameSuffix) {
  if (!canUseDOM) {
    return false;
  }

  var eventName = 'on' + eventNameSuffix;
  var isSupported = (eventName in document);

  if (!isSupported) {
    var element = document.createElement('div');
    element.setAttribute(eventName, 'return;');
    isSupported = typeof element[eventName] === 'function';
  }

  return isSupported;
}

function registerEvents$1() {
  registerTwoPhaseEvent('onChange', ['change', 'click', 'focusin', 'focusout', 'input', 'keydown', 'keyup', 'selectionchange']);
}

function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
  // Flag this event loop as needing state restore.
  enqueueStateRestore(target);
  var listeners = accumulateTwoPhaseListeners(inst, 'onChange');

  if (listeners.length > 0) {
    var event = new SyntheticEvent('onChange', 'change', null, nativeEvent, target);
    dispatchQueue.push({
      event: event,
      listeners: listeners
    });
  }
}
/**
 * For IE shims
 */


var activeElement = null;
var activeElementInst = null;
/**
 * SECTION: handle `change` event
 */

function shouldUseChangeEvent(elem) {
  var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}

function manualDispatchChangeEvent(nativeEvent) {
  var dispatchQueue = [];
  createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the
  // other events and have it go through ReactBrowserEventEmitter. Since it
  // doesn't, we manually listen for the events and so we have to enqueue and
  // process the abstract event manually.
  //
  // Batching is necessary here in order to ensure that all event handlers run
  // before the next rerender (including event handlers attached to ancestor
  // elements instead of directly on the input). Without this, controlled
  // components don't work properly in conjunction with event bubbling because
  // the component is rerendered and the value reverted before all the event
  // handlers can run. See https://github.com/facebook/react/issues/708.

  batchedUpdates(runEventInBatch, dispatchQueue);
}

function runEventInBatch(dispatchQueue) {
  processDispatchQueue(dispatchQueue, 0);
}

function getInstIfValueChanged(targetInst) {
  var targetNode = getNodeFromInstance(targetInst);

  if (updateValueIfChanged(targetNode)) {
    return targetInst;
  }
}

function getTargetInstForChangeEvent(domEventName, targetInst) {
  if (domEventName === 'change') {
    return targetInst;
  }
}
/**
 * SECTION: handle `input` event
 */


var isInputEventSupported = false;

if (canUseDOM) {
  // IE9 claims to support the input event but fails to trigger it when
  // deleting text, so we ignore its input events.
  isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
}
/**
 * (For IE <=9) Starts tracking propertychange events on the passed-in element
 * and override the value property so that we can distinguish user events from
 * value changes in JS.
 */


function startWatchingForValueChange(target, targetInst) {
  activeElement = target;
  activeElementInst = targetInst;
  activeElement.attachEvent('onpropertychange', handlePropertyChange);
}
/**
 * (For IE <=9) Removes the event listeners from the currently-tracked element,
 * if any exists.
 */


function stopWatchingForValueChange() {
  if (!activeElement) {
    return;
  }

  activeElement.detachEvent('onpropertychange', handlePropertyChange);
  activeElement = null;
  activeElementInst = null;
}
/**
 * (For IE <=9) Handles a propertychange event, sending a `change` event if
 * the value of the active element has changed.
 */


function handlePropertyChange(nativeEvent) {
  if (nativeEvent.propertyName !== 'value') {
    return;
  }

  if (getInstIfValueChanged(activeElementInst)) {
    manualDispatchChangeEvent(nativeEvent);
  }
}

function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
  if (domEventName === 'focusin') {
    // In IE9, propertychange fires for most input events but is buggy and
    // doesn't fire when text is deleted, but conveniently, selectionchange
    // appears to fire in all of the remaining cases so we catch those and
    // forward the event if the value has changed
    // In either case, we don't want to call the event handler if the value
    // is changed from JS so we redefine a setter for `.value` that updates
    // our activeElementValue variable, allowing us to ignore those changes
    //
    // stopWatching() should be a noop here but we call it just in case we
    // missed a blur event somehow.
    stopWatchingForValueChange();
    startWatchingForValueChange(target, targetInst);
  } else if (domEventName === 'focusout') {
    stopWatchingForValueChange();
  }
} // For IE8 and IE9.


function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
  if (domEventName === 'selectionchange' || domEventName === 'keyup' || domEventName === 'keydown') {
    // On the selectionchange event, the target is just document which isn't
    // helpful for us so just check activeElement instead.
    //
    // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
    // propertychange on the first input event after setting `value` from a
    // script and fires only keydown, keypress, keyup. Catching keyup usually
    // gets it and catching keydown lets us fire an event for the first
    // keystroke if user does a key repeat (it'll be a little delayed: right
    // before the second keystroke). Other input methods (e.g., paste) seem to
    // fire selectionchange normally.
    return getInstIfValueChanged(activeElementInst);
  }
}
/**
 * SECTION: handle `click` event
 */


function shouldUseClickEvent(elem) {
  // Use the `click` event to detect changes to checkbox and radio inputs.
  // This approach works across all browsers, whereas `change` does not fire
  // until `blur` in IE8.
  var nodeName = elem.nodeName;
  return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
}

function getTargetInstForClickEvent(domEventName, targetInst) {
  if (domEventName === 'click') {
    return getInstIfValueChanged(targetInst);
  }
}

function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
  if (domEventName === 'input' || domEventName === 'change') {
    return getInstIfValueChanged(targetInst);
  }
}

function handleControlledInputBlur(node) {
  var state = node._wrapperState;

  if (!state || !state.controlled || node.type !== 'number') {
    return;
  }

  {
    // If controlled, assign the value attribute to the current value on blur
    setDefaultValue(node, 'number', node.value);
  }
}
/**
 * This plugin creates an `onChange` event that normalizes change events
 * across form elements. This event fires at a time when it's possible to
 * change the element's value without seeing a flicker.
 *
 * Supported elements are:
 * - input (see `isTextInputElement`)
 * - textarea
 * - select
 */


function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
  var getTargetInstFunc, handleEventFunc;

  if (shouldUseChangeEvent(targetNode)) {
    getTargetInstFunc = getTargetInstForChangeEvent;
  } else if (isTextInputElement(targetNode)) {
    if (isInputEventSupported) {
      getTargetInstFunc = getTargetInstForInputOrChangeEvent;
    } else {
      getTargetInstFunc = getTargetInstForInputEventPolyfill;
      handleEventFunc = handleEventsForInputEventPolyfill;
    }
  } else if (shouldUseClickEvent(targetNode)) {
    getTargetInstFunc = getTargetInstForClickEvent;
  }

  if (getTargetInstFunc) {
    var inst = getTargetInstFunc(domEventName, targetInst);

    if (inst) {
      createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
      return;
    }
  }

  if (handleEventFunc) {
    handleEventFunc(domEventName, targetNode, targetInst);
  } // When blurring, set the value attribute for number inputs


  if (domEventName === 'focusout') {
    handleControlledInputBlur(targetNode);
  }
}

function registerEvents$2() {
  registerDirectEvent('onMouseEnter', ['mouseout', 'mouseover']);
  registerDirectEvent('onMouseLeave', ['mouseout', 'mouseover']);
  registerDirectEvent('onPointerEnter', ['pointerout', 'pointerover']);
  registerDirectEvent('onPointerLeave', ['pointerout', 'pointerover']);
}
/**
 * For almost every interaction we care about, there will be both a top-level
 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
 * we do not extract duplicate events. However, moving the mouse into the
 * browser from outside will not fire a `mouseout` event. In this case, we use
 * the `mouseover` top-level event.
 */


function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  var isOverEvent = domEventName === 'mouseover' || domEventName === 'pointerover';
  var isOutEvent = domEventName === 'mouseout' || domEventName === 'pointerout';

  if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0) {
    // If this is an over event with a target, we might have already dispatched
    // the event in the out event of the other target. If this is replayed,
    // then it's because we couldn't dispatch against this target previously
    // so we have to do it now instead.
    var related = nativeEvent.relatedTarget || nativeEvent.fromElement;

    if (related) {
      // If the related node is managed by React, we can assume that we have
      // already dispatched the corresponding events during its mouseout.
      if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
        return;
      }
    }
  }

  if (!isOutEvent && !isOverEvent) {
    // Must not be a mouse or pointer in or out - ignoring.
    return;
  }

  var win; // TODO: why is this nullable in the types but we read from it?

  if (nativeEventTarget.window === nativeEventTarget) {
    // `nativeEventTarget` is probably a window object.
    win = nativeEventTarget;
  } else {
    // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
    var doc = nativeEventTarget.ownerDocument;

    if (doc) {
      win = doc.defaultView || doc.parentWindow;
    } else {
      win = window;
    }
  }

  var from;
  var to;

  if (isOutEvent) {
    var _related = nativeEvent.relatedTarget || nativeEvent.toElement;

    from = targetInst;
    to = _related ? getClosestInstanceFromNode(_related) : null;

    if (to !== null) {
      var nearestMounted = getNearestMountedFiber(to);

      if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
        to = null;
      }
    }
  } else {
    // Moving to a node from outside the window.
    from = null;
    to = targetInst;
  }

  if (from === to) {
    // Nothing pertains to our managed components.
    return;
  }

  var SyntheticEventCtor = SyntheticMouseEvent;
  var leaveEventType = 'onMouseLeave';
  var enterEventType = 'onMouseEnter';
  var eventTypePrefix = 'mouse';

  if (domEventName === 'pointerout' || domEventName === 'pointerover') {
    SyntheticEventCtor = SyntheticPointerEvent;
    leaveEventType = 'onPointerLeave';
    enterEventType = 'onPointerEnter';
    eventTypePrefix = 'pointer';
  }

  var fromNode = from == null ? win : getNodeFromInstance(from);
  var toNode = to == null ? win : getNodeFromInstance(to);
  var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + 'leave', from, nativeEvent, nativeEventTarget);
  leave.target = fromNode;
  leave.relatedTarget = toNode;
  var enter = null; // We should only process this nativeEvent if we are processing
  // the first ancestor. Next time, we will ignore the event.

  var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);

  if (nativeTargetInst === targetInst) {
    var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + 'enter', to, nativeEvent, nativeEventTarget);
    enterEvent.target = toNode;
    enterEvent.relatedTarget = fromNode;
    enter = enterEvent;
  }

  accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
}

/**
 * inlined Object.is polyfill to avoid requiring consumers ship their own
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
 */
function is(x, y) {
  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
  ;
}

var objectIs = typeof Object.is === 'function' ? Object.is : is;

var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
/**
 * Performs equality by iterating through keys on an object and returning false
 * when any key has values which are not strictly equal between the arguments.
 * Returns true when the values of all keys are strictly equal.
 */

function shallowEqual(objA, objB) {
  if (objectIs(objA, objB)) {
    return true;
  }

  if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
    return false;
  }

  var keysA = Object.keys(objA);
  var keysB = Object.keys(objB);

  if (keysA.length !== keysB.length) {
    return false;
  } // Test for A's keys different from B.


  for (var i = 0; i < keysA.length; i++) {
    if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {
      return false;
    }
  }

  return true;
}

/**
 * Given any node return the first leaf node without children.
 *
 * @param {DOMElement|DOMTextNode} node
 * @return {DOMElement|DOMTextNode}
 */

function getLeafNode(node) {
  while (node && node.firstChild) {
    node = node.firstChild;
  }

  return node;
}
/**
 * Get the next sibling within a container. This will walk up the
 * DOM if a node's siblings have been exhausted.
 *
 * @param {DOMElement|DOMTextNode} node
 * @return {?DOMElement|DOMTextNode}
 */


function getSiblingNode(node) {
  while (node) {
    if (node.nextSibling) {
      return node.nextSibling;
    }

    node = node.parentNode;
  }
}
/**
 * Get object describing the nodes which contain characters at offset.
 *
 * @param {DOMElement|DOMTextNode} root
 * @param {number} offset
 * @return {?object}
 */


function getNodeForCharacterOffset(root, offset) {
  var node = getLeafNode(root);
  var nodeStart = 0;
  var nodeEnd = 0;

  while (node) {
    if (node.nodeType === TEXT_NODE) {
      nodeEnd = nodeStart + node.textContent.length;

      if (nodeStart <= offset && nodeEnd >= offset) {
        return {
          node: node,
          offset: offset - nodeStart
        };
      }

      nodeStart = nodeEnd;
    }

    node = getLeafNode(getSiblingNode(node));
  }
}

/**
 * @param {DOMElement} outerNode
 * @return {?object}
 */

function getOffsets(outerNode) {
  var ownerDocument = outerNode.ownerDocument;
  var win = ownerDocument && ownerDocument.defaultView || window;
  var selection = win.getSelection && win.getSelection();

  if (!selection || selection.rangeCount === 0) {
    return null;
  }

  var anchorNode = selection.anchorNode,
      anchorOffset = selection.anchorOffset,
      focusNode = selection.focusNode,
      focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
  // up/down buttons on an <input type="number">. Anonymous divs do not seem to
  // expose properties, triggering a "Permission denied error" if any of its
  // properties are accessed. The only seemingly possible way to avoid erroring
  // is to access a property that typically works for non-anonymous divs and
  // catch any error that may otherwise arise. See
  // https://bugzilla.mozilla.org/show_bug.cgi?id=208427

  try {
    /* eslint-disable no-unused-expressions */
    anchorNode.nodeType;
    focusNode.nodeType;
    /* eslint-enable no-unused-expressions */
  } catch (e) {
    return null;
  }

  return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
}
/**
 * Returns {start, end} where `start` is the character/codepoint index of
 * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
 * `end` is the index of (focusNode, focusOffset).
 *
 * Returns null if you pass in garbage input but we should probably just crash.
 *
 * Exported only for testing.
 */

function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
  var length = 0;
  var start = -1;
  var end = -1;
  var indexWithinAnchor = 0;
  var indexWithinFocus = 0;
  var node = outerNode;
  var parentNode = null;

  outer: while (true) {
    var next = null;

    while (true) {
      if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
        start = length + anchorOffset;
      }

      if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
        end = length + focusOffset;
      }

      if (node.nodeType === TEXT_NODE) {
        length += node.nodeValue.length;
      }

      if ((next = node.firstChild) === null) {
        break;
      } // Moving from `node` to its first child `next`.


      parentNode = node;
      node = next;
    }

    while (true) {
      if (node === outerNode) {
        // If `outerNode` has children, this is always the second time visiting
        // it. If it has no children, this is still the first loop, and the only
        // valid selection is anchorNode and focusNode both equal to this node
        // and both offsets 0, in which case we will have handled above.
        break outer;
      }

      if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
        start = length;
      }

      if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
        end = length;
      }

      if ((next = node.nextSibling) !== null) {
        break;
      }

      node = parentNode;
      parentNode = node.parentNode;
    } // Moving from `node` to its next sibling `next`.


    node = next;
  }

  if (start === -1 || end === -1) {
    // This should never happen. (Would happen if the anchor/focus nodes aren't
    // actually inside the passed-in node.)
    return null;
  }

  return {
    start: start,
    end: end
  };
}
/**
 * In modern non-IE browsers, we can support both forward and backward
 * selections.
 *
 * Note: IE10+ supports the Selection object, but it does not support
 * the `extend` method, which means that even in modern IE, it's not possible
 * to programmatically create a backward selection. Thus, for all IE
 * versions, we use the old IE API to create our selections.
 *
 * @param {DOMElement|DOMTextNode} node
 * @param {object} offsets
 */

function setOffsets(node, offsets) {
  var doc = node.ownerDocument || document;
  var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios.
  // (For instance: TinyMCE editor used in a list component that supports pasting to add more,
  // fails when pasting 100+ items)

  if (!win.getSelection) {
    return;
  }

  var selection = win.getSelection();
  var length = node.textContent.length;
  var start = Math.min(offsets.start, length);
  var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.
  // Flip backward selections, so we can set with a single range.

  if (!selection.extend && start > end) {
    var temp = end;
    end = start;
    start = temp;
  }

  var startMarker = getNodeForCharacterOffset(node, start);
  var endMarker = getNodeForCharacterOffset(node, end);

  if (startMarker && endMarker) {
    if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
      return;
    }

    var range = doc.createRange();
    range.setStart(startMarker.node, startMarker.offset);
    selection.removeAllRanges();

    if (start > end) {
      selection.addRange(range);
      selection.extend(endMarker.node, endMarker.offset);
    } else {
      range.setEnd(endMarker.node, endMarker.offset);
      selection.addRange(range);
    }
  }
}

function isTextNode(node) {
  return node && node.nodeType === TEXT_NODE;
}

function containsNode(outerNode, innerNode) {
  if (!outerNode || !innerNode) {
    return false;
  } else if (outerNode === innerNode) {
    return true;
  } else if (isTextNode(outerNode)) {
    return false;
  } else if (isTextNode(innerNode)) {
    return containsNode(outerNode, innerNode.parentNode);
  } else if ('contains' in outerNode) {
    return outerNode.contains(innerNode);
  } else if (outerNode.compareDocumentPosition) {
    return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  } else {
    return false;
  }
}

function isInDocument(node) {
  return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
}

function isSameOriginFrame(iframe) {
  try {
    // Accessing the contentDocument of a HTMLIframeElement can cause the browser
    // to throw, e.g. if it has a cross-origin src attribute.
    // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
    // iframe.contentDocument.defaultView;
    // A safety way is to access one of the cross origin properties: Window or Location
    // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
    // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl
    return typeof iframe.contentWindow.location.href === 'string';
  } catch (err) {
    return false;
  }
}

function getActiveElementDeep() {
  var win = window;
  var element = getActiveElement();

  while (element instanceof win.HTMLIFrameElement) {
    if (isSameOriginFrame(element)) {
      win = element.contentWindow;
    } else {
      return element;
    }

    element = getActiveElement(win.document);
  }

  return element;
}
/**
 * @ReactInputSelection: React input selection module. Based on Selection.js,
 * but modified to be suitable for react and has a couple of bug fixes (doesn't
 * assume buttons have range selections allowed).
 * Input selection module for React.
 */

/**
 * @hasSelectionCapabilities: we get the element types that support selection
 * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
 * and `selectionEnd` rows.
 */


function hasSelectionCapabilities(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
}
function getSelectionInformation() {
  var focusedElem = getActiveElementDeep();
  return {
    focusedElem: focusedElem,
    selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
  };
}
/**
 * @restoreSelection: If any selection information was potentially lost,
 * restore it. This is useful when performing operations that could remove dom
 * nodes and place them back in, resulting in focus being lost.
 */

function restoreSelection(priorSelectionInformation) {
  var curFocusedElem = getActiveElementDeep();
  var priorFocusedElem = priorSelectionInformation.focusedElem;
  var priorSelectionRange = priorSelectionInformation.selectionRange;

  if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
    if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
      setSelection(priorFocusedElem, priorSelectionRange);
    } // Focusing a node can change the scroll position, which is undesirable


    var ancestors = [];
    var ancestor = priorFocusedElem;

    while (ancestor = ancestor.parentNode) {
      if (ancestor.nodeType === ELEMENT_NODE) {
        ancestors.push({
          element: ancestor,
          left: ancestor.scrollLeft,
          top: ancestor.scrollTop
        });
      }
    }

    if (typeof priorFocusedElem.focus === 'function') {
      priorFocusedElem.focus();
    }

    for (var i = 0; i < ancestors.length; i++) {
      var info = ancestors[i];
      info.element.scrollLeft = info.left;
      info.element.scrollTop = info.top;
    }
  }
}
/**
 * @getSelection: Gets the selection bounds of a focused textarea, input or
 * contentEditable node.
 * -@input: Look up selection bounds of this input
 * -@return {start: selectionStart, end: selectionEnd}
 */

function getSelection(input) {
  var selection;

  if ('selectionStart' in input) {
    // Modern browser with input or textarea.
    selection = {
      start: input.selectionStart,
      end: input.selectionEnd
    };
  } else {
    // Content editable or old IE textarea.
    selection = getOffsets(input);
  }

  return selection || {
    start: 0,
    end: 0
  };
}
/**
 * @setSelection: Sets the selection bounds of a textarea or input and focuses
 * the input.
 * -@input     Set selection bounds of this input or textarea
 * -@offsets   Object of same form that is returned from get*
 */

function setSelection(input, offsets) {
  var start = offsets.start;
  var end = offsets.end;

  if (end === undefined) {
    end = start;
  }

  if ('selectionStart' in input) {
    input.selectionStart = start;
    input.selectionEnd = Math.min(end, input.value.length);
  } else {
    setOffsets(input, offsets);
  }
}

var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;

function registerEvents$3() {
  registerTwoPhaseEvent('onSelect', ['focusout', 'contextmenu', 'dragend', 'focusin', 'keydown', 'keyup', 'mousedown', 'mouseup', 'selectionchange']);
}

var activeElement$1 = null;
var activeElementInst$1 = null;
var lastSelection = null;
var mouseDown = false;
/**
 * Get an object which is a unique representation of the current selection.
 *
 * The return value will not be consistent across nodes or browsers, but
 * two identical selections on the same node will return identical objects.
 */

function getSelection$1(node) {
  if ('selectionStart' in node && hasSelectionCapabilities(node)) {
    return {
      start: node.selectionStart,
      end: node.selectionEnd
    };
  } else {
    var win = node.ownerDocument && node.ownerDocument.defaultView || window;
    var selection = win.getSelection();
    return {
      anchorNode: selection.anchorNode,
      anchorOffset: selection.anchorOffset,
      focusNode: selection.focusNode,
      focusOffset: selection.focusOffset
    };
  }
}
/**
 * Get document associated with the event target.
 */


function getEventTargetDocument(eventTarget) {
  return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
}
/**
 * Poll selection to see whether it's changed.
 *
 * @param {object} nativeEvent
 * @param {object} nativeEventTarget
 * @return {?SyntheticEvent}
 */


function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
  // Ensure we have the right element, and that the user is not dragging a
  // selection (this matches native `select` event behavior). In HTML5, select
  // fires only on input and textarea thus if there's no focused element we
  // won't dispatch.
  var doc = getEventTargetDocument(nativeEventTarget);

  if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
    return;
  } // Only fire when selection has actually changed.


  var currentSelection = getSelection$1(activeElement$1);

  if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
    lastSelection = currentSelection;
    var listeners = accumulateTwoPhaseListeners(activeElementInst$1, 'onSelect');

    if (listeners.length > 0) {
      var event = new SyntheticEvent('onSelect', 'select', null, nativeEvent, nativeEventTarget);
      dispatchQueue.push({
        event: event,
        listeners: listeners
      });
      event.target = activeElement$1;
    }
  }
}
/**
 * This plugin creates an `onSelect` event that normalizes select events
 * across form elements.
 *
 * Supported elements are:
 * - input (see `isTextInputElement`)
 * - textarea
 * - contentEditable
 *
 * This differs from native browser implementations in the following ways:
 * - Fires on contentEditable fields as well as inputs.
 * - Fires for collapsed selection.
 * - Fires after user input.
 */


function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {

  var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;

  switch (domEventName) {
    // Track the input node that has focus.
    case 'focusin':
      if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
        activeElement$1 = targetNode;
        activeElementInst$1 = targetInst;
        lastSelection = null;
      }

      break;

    case 'focusout':
      activeElement$1 = null;
      activeElementInst$1 = null;
      lastSelection = null;
      break;
    // Don't fire the event while the user is dragging. This matches the
    // semantics of the native select event.

    case 'mousedown':
      mouseDown = true;
      break;

    case 'contextmenu':
    case 'mouseup':
    case 'dragend':
      mouseDown = false;
      constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
      break;
    // Chrome and IE fire non-standard event when selection is changed (and
    // sometimes when it hasn't). IE's event fires out of order with respect
    // to key and input events on deletion, so we discard it.
    //
    // Firefox doesn't support selectionchange, so check selection status
    // after each key entry. The selection changes after keydown and before
    // keyup, but we check on keydown as well in the case of holding down a
    // key, when multiple keydown events are fired but only one keyup is.
    // This is also our approach for IE handling, for the reason above.

    case 'selectionchange':
      if (skipSelectionChangeEvent) {
        break;
      }

    // falls through

    case 'keydown':
    case 'keyup':
      constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
  }
}

function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  var reactName = topLevelEventsToReactNames.get(domEventName);

  if (reactName === undefined) {
    return;
  }

  var SyntheticEventCtor = SyntheticEvent;
  var reactEventType = domEventName;

  switch (domEventName) {
    case 'keypress':
      // Firefox creates a keypress event for function keys too. This removes
      // the unwanted keypress events. Enter is however both printable and
      // non-printable. One would expect Tab to be as well (but it isn't).
      if (getEventCharCode(nativeEvent) === 0) {
        return;
      }

    /* falls through */

    case 'keydown':
    case 'keyup':
      SyntheticEventCtor = SyntheticKeyboardEvent;
      break;

    case 'focusin':
      reactEventType = 'focus';
      SyntheticEventCtor = SyntheticFocusEvent;
      break;

    case 'focusout':
      reactEventType = 'blur';
      SyntheticEventCtor = SyntheticFocusEvent;
      break;

    case 'beforeblur':
    case 'afterblur':
      SyntheticEventCtor = SyntheticFocusEvent;
      break;

    case 'click':
      // Firefox creates a click event on right mouse clicks. This removes the
      // unwanted click events.
      if (nativeEvent.button === 2) {
        return;
      }

    /* falls through */

    case 'auxclick':
    case 'dblclick':
    case 'mousedown':
    case 'mousemove':
    case 'mouseup': // TODO: Disabled elements should not respond to mouse events

    /* falls through */

    case 'mouseout':
    case 'mouseover':
    case 'contextmenu':
      SyntheticEventCtor = SyntheticMouseEvent;
      break;

    case 'drag':
    case 'dragend':
    case 'dragenter':
    case 'dragexit':
    case 'dragleave':
    case 'dragover':
    case 'dragstart':
    case 'drop':
      SyntheticEventCtor = SyntheticDragEvent;
      break;

    case 'touchcancel':
    case 'touchend':
    case 'touchmove':
    case 'touchstart':
      SyntheticEventCtor = SyntheticTouchEvent;
      break;

    case ANIMATION_END:
    case ANIMATION_ITERATION:
    case ANIMATION_START:
      SyntheticEventCtor = SyntheticAnimationEvent;
      break;

    case TRANSITION_END:
      SyntheticEventCtor = SyntheticTransitionEvent;
      break;

    case 'scroll':
      SyntheticEventCtor = SyntheticUIEvent;
      break;

    case 'wheel':
      SyntheticEventCtor = SyntheticWheelEvent;
      break;

    case 'copy':
    case 'cut':
    case 'paste':
      SyntheticEventCtor = SyntheticClipboardEvent;
      break;

    case 'gotpointercapture':
    case 'lostpointercapture':
    case 'pointercancel':
    case 'pointerdown':
    case 'pointermove':
    case 'pointerout':
    case 'pointerover':
    case 'pointerup':
      SyntheticEventCtor = SyntheticPointerEvent;
      break;
  }

  var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;

  {
    // Some events don't bubble in the browser.
    // In the past, React has always bubbled them, but this can be surprising.
    // We're going to try aligning closer to the browser behavior by not bubbling
    // them in React either. We'll start by not bubbling onScroll, and then expand.
    var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from
    // nonDelegatedEvents list in DOMPluginEventSystem.
    // Then we can remove this special list.
    // This is a breaking change that can wait until React 18.
    domEventName === 'scroll';

    var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);

    if (_listeners.length > 0) {
      // Intentionally create event lazily.
      var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);

      dispatchQueue.push({
        event: _event,
        listeners: _listeners
      });
    }
  }
}

// TODO: remove top-level side effect.
registerSimpleEvents();
registerEvents$2();
registerEvents$1();
registerEvents$3();
registerEvents();

function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  // TODO: we should remove the concept of a "SimpleEventPlugin".
  // This is the basic functionality of the event system. All
  // the other plugins are essentially polyfills. So the plugin
  // should probably be inlined somewhere and have its logic
  // be core the to event system. This would potentially allow
  // us to ship builds of React without the polyfilled plugins below.
  extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
  var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0; // We don't process these events unless we are in the
  // event's native "bubble" phase, which means that we're
  // not in the capture phase. That's because we emulate
  // the capture phase here still. This is a trade-off,
  // because in an ideal world we would not emulate and use
  // the phases properly, like we do with the SimpleEvent
  // plugin. However, the plugins below either expect
  // emulation (EnterLeave) or use state localized to that
  // plugin (BeforeInput, Change, Select). The state in
  // these modules complicates things, as you'll essentially
  // get the case where the capture phase event might change
  // state, only for the following bubble event to come in
  // later and not trigger anything as the state now
  // invalidates the heuristics of the event plugin. We
  // could alter all these plugins to work in such ways, but
  // that might cause other unknown side-effects that we
  // can't forsee right now.

  if (shouldProcessPolyfillPlugins) {
    extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
    extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
    extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
    extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
  }
} // List of events that need to be individually attached to media elements.


var mediaEventTypes = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'encrypted', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting']; // We should not delegate these events to the container, but rather
// set them on the actual target element itself. This is primarily
// because these events do not consistently bubble in the DOM.

var nonDelegatedEvents = new Set(['cancel', 'close', 'invalid', 'load', 'scroll', 'toggle'].concat(mediaEventTypes));

function executeDispatch(event, listener, currentTarget) {
  var type = event.type || 'unknown-event';
  event.currentTarget = currentTarget;
  invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
  event.currentTarget = null;
}

function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
  var previousInstance;

  if (inCapturePhase) {
    for (var i = dispatchListeners.length - 1; i >= 0; i--) {
      var _dispatchListeners$i = dispatchListeners[i],
          instance = _dispatchListeners$i.instance,
          currentTarget = _dispatchListeners$i.currentTarget,
          listener = _dispatchListeners$i.listener;

      if (instance !== previousInstance && event.isPropagationStopped()) {
        return;
      }

      executeDispatch(event, listener, currentTarget);
      previousInstance = instance;
    }
  } else {
    for (var _i = 0; _i < dispatchListeners.length; _i++) {
      var _dispatchListeners$_i = dispatchListeners[_i],
          _instance = _dispatchListeners$_i.instance,
          _currentTarget = _dispatchListeners$_i.currentTarget,
          _listener = _dispatchListeners$_i.listener;

      if (_instance !== previousInstance && event.isPropagationStopped()) {
        return;
      }

      executeDispatch(event, _listener, _currentTarget);
      previousInstance = _instance;
    }
  }
}

function processDispatchQueue(dispatchQueue, eventSystemFlags) {
  var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;

  for (var i = 0; i < dispatchQueue.length; i++) {
    var _dispatchQueue$i = dispatchQueue[i],
        event = _dispatchQueue$i.event,
        listeners = _dispatchQueue$i.listeners;
    processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); //  event system doesn't use pooling.
  } // This would be a good time to rethrow if any of the event handlers threw.


  rethrowCaughtError();
}

function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
  var nativeEventTarget = getEventTarget(nativeEvent);
  var dispatchQueue = [];
  extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
  processDispatchQueue(dispatchQueue, eventSystemFlags);
}

function listenToNonDelegatedEvent(domEventName, targetElement) {
  var isCapturePhaseListener = false;
  var listenerSet = getEventListenerSet(targetElement);
  var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);

  if (!listenerSet.has(listenerSetKey)) {
    addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
    listenerSet.add(listenerSetKey);
  }
}
var listeningMarker = '_reactListening' + Math.random().toString(36).slice(2);
function listenToAllSupportedEvents(rootContainerElement) {
  {
    if (rootContainerElement[listeningMarker]) {
      // Performance optimization: don't iterate through events
      // for the same portal container or root node more than once.
      // TODO: once we remove the flag, we may be able to also
      // remove some of the bookkeeping maps used for laziness.
      return;
    }

    rootContainerElement[listeningMarker] = true;
    allNativeEvents.forEach(function (domEventName) {
      if (!nonDelegatedEvents.has(domEventName)) {
        listenToNativeEvent(domEventName, false, rootContainerElement, null);
      }

      listenToNativeEvent(domEventName, true, rootContainerElement, null);
    });
  }
}
function listenToNativeEvent(domEventName, isCapturePhaseListener, rootContainerElement, targetElement) {
  var eventSystemFlags = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
  var target = rootContainerElement; // selectionchange needs to be attached to the document
  // otherwise it won't capture incoming events that are only
  // triggered on the document directly.

  if (domEventName === 'selectionchange' && rootContainerElement.nodeType !== DOCUMENT_NODE) {
    target = rootContainerElement.ownerDocument;
  } // If the event can be delegated (or is capture phase), we can
  // register it to the root container. Otherwise, we should
  // register the event to the target element and mark it as
  // a non-delegated event.


  if (targetElement !== null && !isCapturePhaseListener && nonDelegatedEvents.has(domEventName)) {
    // For all non-delegated events, apart from scroll, we attach
    // their event listeners to the respective elements that their
    // events fire on. That means we can skip this step, as event
    // listener has already been added previously. However, we
    // special case the scroll event because the reality is that any
    // element can scroll.
    // TODO: ideally, we'd eventually apply the same logic to all
    // events from the nonDelegatedEvents list. Then we can remove
    // this special case and use the same logic for all events.
    if (domEventName !== 'scroll') {
      return;
    }

    eventSystemFlags |= IS_NON_DELEGATED;
    target = targetElement;
  }

  var listenerSet = getEventListenerSet(target);
  var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener); // If the listener entry is empty or we should upgrade, then
  // we need to trap an event listener onto the target.

  if (!listenerSet.has(listenerSetKey)) {
    if (isCapturePhaseListener) {
      eventSystemFlags |= IS_CAPTURE_PHASE;
    }

    addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
    listenerSet.add(listenerSetKey);
  }
}

function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
  var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags); // If passive option is not supported, then the event will be
  // active and not passive.

  var isPassiveListener = undefined;

  if (passiveBrowserEventsSupported) {
    // Browsers introduced an intervention, making these events
    // passive by default on document. React doesn't bind them
    // to document anymore, but changing this now would undo
    // the performance wins from the change. So we emulate
    // the existing behavior manually on the roots now.
    // https://github.com/facebook/react/issues/19651
    if (domEventName === 'touchstart' || domEventName === 'touchmove' || domEventName === 'wheel') {
      isPassiveListener = true;
    }
  }

  targetContainer =  targetContainer;
  var unsubscribeListener; // When legacyFBSupport is enabled, it's for when we


  if (isCapturePhaseListener) {
    if (isPassiveListener !== undefined) {
      unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
    } else {
      unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);
    }
  } else {
    if (isPassiveListener !== undefined) {
      unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
    } else {
      unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);
    }
  }
}

function isMatchingRootContainer(grandContainer, targetContainer) {
  return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
}

function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
  var ancestorInst = targetInst;

  if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
    var targetContainerNode = targetContainer; // If we are using the legacy FB support flag, we

    if (targetInst !== null) {
      // The below logic attempts to work out if we need to change
      // the target fiber to a different ancestor. We had similar logic
      // in the legacy event system, except the big difference between
      // systems is that the modern event system now has an event listener
      // attached to each React Root and React Portal Root. Together,
      // the DOM nodes representing these roots are the "rootContainer".
      // To figure out which ancestor instance we should use, we traverse
      // up the fiber tree from the target instance and attempt to find
      // root boundaries that match that of our current "rootContainer".
      // If we find that "rootContainer", we find the parent fiber
      // sub-tree for that root and make that our ancestor instance.
      var node = targetInst;

      mainLoop: while (true) {
        if (node === null) {
          return;
        }

        var nodeTag = node.tag;

        if (nodeTag === HostRoot || nodeTag === HostPortal) {
          var container = node.stateNode.containerInfo;

          if (isMatchingRootContainer(container, targetContainerNode)) {
            break;
          }

          if (nodeTag === HostPortal) {
            // The target is a portal, but it's not the rootContainer we're looking for.
            // Normally portals handle their own events all the way down to the root.
            // So we should be able to stop now. However, we don't know if this portal
            // was part of *our* root.
            var grandNode = node.return;

            while (grandNode !== null) {
              var grandTag = grandNode.tag;

              if (grandTag === HostRoot || grandTag === HostPortal) {
                var grandContainer = grandNode.stateNode.containerInfo;

                if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
                  // This is the rootContainer we're looking for and we found it as
                  // a parent of the Portal. That means we can ignore it because the
                  // Portal will bubble through to us.
                  return;
                }
              }

              grandNode = grandNode.return;
            }
          } // Now we need to find it's corresponding host fiber in the other
          // tree. To do this we can use getClosestInstanceFromNode, but we
          // need to validate that the fiber is a host instance, otherwise
          // we need to traverse up through the DOM till we find the correct
          // node that is from the other tree.


          while (container !== null) {
            var parentNode = getClosestInstanceFromNode(container);

            if (parentNode === null) {
              return;
            }

            var parentTag = parentNode.tag;

            if (parentTag === HostComponent || parentTag === HostText) {
              node = ancestorInst = parentNode;
              continue mainLoop;
            }

            container = container.parentNode;
          }
        }

        node = node.return;
      }
    }
  }

  batchedEventUpdates(function () {
    return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
  });
}

function createDispatchListener(instance, listener, currentTarget) {
  return {
    instance: instance,
    listener: listener,
    currentTarget: currentTarget
  };
}

function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly) {
  var captureName = reactName !== null ? reactName + 'Capture' : null;
  var reactEventName = inCapturePhase ? captureName : reactName;
  var listeners = [];
  var instance = targetFiber;
  var lastHostComponent = null; // Accumulate all instances and listeners via the target -> root path.

  while (instance !== null) {
    var _instance2 = instance,
        stateNode = _instance2.stateNode,
        tag = _instance2.tag; // Handle listeners that are on HostComponents (i.e. <div>)

    if (tag === HostComponent && stateNode !== null) {
      lastHostComponent = stateNode; // createEventHandle listeners


      if (reactEventName !== null) {
        var listener = getListener(instance, reactEventName);

        if (listener != null) {
          listeners.push(createDispatchListener(instance, listener, lastHostComponent));
        }
      }
    } // If we are only accumulating events for the target, then we don't
    // continue to propagate through the React fiber tree to find other
    // listeners.


    if (accumulateTargetOnly) {
      break;
    }

    instance = instance.return;
  }

  return listeners;
} // We should only use this function for:
// - BeforeInputEventPlugin
// - ChangeEventPlugin
// - SelectEventPlugin
// This is because we only process these plugins
// in the bubble phase, so we need to accumulate two
// phase event listeners (via emulation).

function accumulateTwoPhaseListeners(targetFiber, reactName) {
  var captureName = reactName + 'Capture';
  var listeners = [];
  var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.

  while (instance !== null) {
    var _instance3 = instance,
        stateNode = _instance3.stateNode,
        tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)

    if (tag === HostComponent && stateNode !== null) {
      var currentTarget = stateNode;
      var captureListener = getListener(instance, captureName);

      if (captureListener != null) {
        listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
      }

      var bubbleListener = getListener(instance, reactName);

      if (bubbleListener != null) {
        listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
      }
    }

    instance = instance.return;
  }

  return listeners;
}

function getParent(inst) {
  if (inst === null) {
    return null;
  }

  do {
    inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.
    // That is depending on if we want nested subtrees (layers) to bubble
    // events to their parent. We could also go through parentNode on the
    // host node but that wouldn't work for React Native and doesn't let us
    // do the portal feature.
  } while (inst && inst.tag !== HostComponent);

  if (inst) {
    return inst;
  }

  return null;
}
/**
 * Return the lowest common ancestor of A and B, or null if they are in
 * different trees.
 */


function getLowestCommonAncestor(instA, instB) {
  var nodeA = instA;
  var nodeB = instB;
  var depthA = 0;

  for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
    depthA++;
  }

  var depthB = 0;

  for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
    depthB++;
  } // If A is deeper, crawl up.


  while (depthA - depthB > 0) {
    nodeA = getParent(nodeA);
    depthA--;
  } // If B is deeper, crawl up.


  while (depthB - depthA > 0) {
    nodeB = getParent(nodeB);
    depthB--;
  } // Walk in lockstep until we find a match.


  var depth = depthA;

  while (depth--) {
    if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
      return nodeA;
    }

    nodeA = getParent(nodeA);
    nodeB = getParent(nodeB);
  }

  return null;
}

function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
  var registrationName = event._reactName;
  var listeners = [];
  var instance = target;

  while (instance !== null) {
    if (instance === common) {
      break;
    }

    var _instance4 = instance,
        alternate = _instance4.alternate,
        stateNode = _instance4.stateNode,
        tag = _instance4.tag;

    if (alternate !== null && alternate === common) {
      break;
    }

    if (tag === HostComponent && stateNode !== null) {
      var currentTarget = stateNode;

      if (inCapturePhase) {
        var captureListener = getListener(instance, registrationName);

        if (captureListener != null) {
          listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
        }
      } else if (!inCapturePhase) {
        var bubbleListener = getListener(instance, registrationName);

        if (bubbleListener != null) {
          listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
        }
      }
    }

    instance = instance.return;
  }

  if (listeners.length !== 0) {
    dispatchQueue.push({
      event: event,
      listeners: listeners
    });
  }
} // We should only use this function for:
// - EnterLeaveEventPlugin
// This is because we only process this plugin
// in the bubble phase, so we need to accumulate two
// phase event listeners.


function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
  var common = from && to ? getLowestCommonAncestor(from, to) : null;

  if (from !== null) {
    accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
  }

  if (to !== null && enterEvent !== null) {
    accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
  }
}
function getListenerSetKey(domEventName, capture) {
  return domEventName + "__" + (capture ? 'capture' : 'bubble');
}

var didWarnInvalidHydration = false;
var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
var AUTOFOCUS = 'autoFocus';
var CHILDREN = 'children';
var STYLE = 'style';
var HTML$1 = '__html';
var HTML_NAMESPACE$1 = Namespaces.html;
var warnedUnknownTags;
var suppressHydrationWarning;
var validatePropertiesInDevelopment;
var warnForTextDifference;
var warnForPropDifference;
var warnForExtraAttributes;
var warnForInvalidEventListener;
var canDiffStyleForHydrationWarning;
var normalizeMarkupForTextOrAttribute;
var normalizeHTML;

{
  warnedUnknownTags = {
    // There are working polyfills for <dialog>. Let people use it.
    dialog: true,
    // Electron ships a custom <webview> tag to display external web content in
    // an isolated frame and process.
    // This tag is not present in non Electron environments such as JSDom which
    // is often used for testing purposes.
    // @see https://electronjs.org/docs/api/webview-tag
    webview: true
  };

  validatePropertiesInDevelopment = function (type, props) {
    validateProperties(type, props);
    validateProperties$1(type, props);
    validateProperties$2(type, props, {
      registrationNameDependencies: registrationNameDependencies,
      possibleRegistrationNames: possibleRegistrationNames
    });
  }; // IE 11 parses & normalizes the style attribute as opposed to other
  // browsers. It adds spaces and sorts the properties in some
  // non-alphabetical order. Handling that would require sorting CSS
  // properties in the client & server versions or applying
  // `expectedStyle` to a temporary DOM node to read its `style` attribute
  // normalized. Since it only affects IE, we're skipping style warnings
  // in that browser completely in favor of doing all that work.
  // See https://github.com/facebook/react/issues/11807


  canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.
  // It also can turn \u0000 into \uFFFD inside attributes.
  // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream
  // If we have a mismatch, it might be caused by that.
  // We will still patch up in this case but not fire the warning.

  var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
  var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;

  normalizeMarkupForTextOrAttribute = function (markup) {
    var markupString = typeof markup === 'string' ? markup : '' + markup;
    return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
  };

  warnForTextDifference = function (serverText, clientText) {
    if (didWarnInvalidHydration) {
      return;
    }

    var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
    var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);

    if (normalizedServerText === normalizedClientText) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
  };

  warnForPropDifference = function (propName, serverValue, clientValue) {
    if (didWarnInvalidHydration) {
      return;
    }

    var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
    var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);

    if (normalizedServerValue === normalizedClientValue) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
  };

  warnForExtraAttributes = function (attributeNames) {
    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;
    var names = [];
    attributeNames.forEach(function (name) {
      names.push(name);
    });

    error('Extra attributes from the server: %s', names);
  };

  warnForInvalidEventListener = function (registrationName, listener) {
    if (listener === false) {
      error('Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
    } else {
      error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
    }
  }; // Parse the HTML and read it back to normalize the HTML string so that it
  // can be used for comparison.


  normalizeHTML = function (parent, html) {
    // We could have created a separate document here to avoid
    // re-initializing custom elements if they exist. But this breaks
    // how <noscript> is being handled. So we use the same document.
    // See the discussion in https://github.com/facebook/react/pull/11157.
    var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
    testElement.innerHTML = html;
    return testElement.innerHTML;
  };
}

function getOwnerDocumentFromRootContainer(rootContainerElement) {
  return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
}

function noop() {}

function trapClickOnNonInteractiveElement(node) {
  // Mobile Safari does not fire properly bubble click events on
  // non-interactive elements, which means delegated click listeners do not
  // fire. The workaround for this bug involves attaching an empty click
  // listener on the target node.
  // https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  // Just set it using the onclick property so that we don't have to manage any
  // bookkeeping for it. Not sure if we need to clear it when the listener is
  // removed.
  // TODO: Only do this for the relevant Safaris maybe?
  node.onclick = noop;
}

function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
  for (var propKey in nextProps) {
    if (!nextProps.hasOwnProperty(propKey)) {
      continue;
    }

    var nextProp = nextProps[propKey];

    if (propKey === STYLE) {
      {
        if (nextProp) {
          // Freeze the next style object so that we can assume it won't be
          // mutated. We have already warned for this in the past.
          Object.freeze(nextProp);
        }
      } // Relies on `updateStylesByID` not mutating `styleUpdates`.


      setValueForStyles(domElement, nextProp);
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      var nextHtml = nextProp ? nextProp[HTML$1] : undefined;

      if (nextHtml != null) {
        setInnerHTML(domElement, nextHtml);
      }
    } else if (propKey === CHILDREN) {
      if (typeof nextProp === 'string') {
        // Avoid setting initial textContent when the text is empty. In IE11 setting
        // textContent on a <textarea> will cause the placeholder to not
        // show within the <textarea> until it has been focused and blurred again.
        // https://github.com/facebook/react/issues/6731#issuecomment-254874553
        var canSetTextContent = tag !== 'textarea' || nextProp !== '';

        if (canSetTextContent) {
          setTextContent(domElement, nextProp);
        }
      } else if (typeof nextProp === 'number') {
        setTextContent(domElement, '' + nextProp);
      }
    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        if ( typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }

        if (propKey === 'onScroll') {
          listenToNonDelegatedEvent('scroll', domElement);
        }
      }
    } else if (nextProp != null) {
      setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
    }
  }
}

function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
  // TODO: Handle wasCustomComponentTag
  for (var i = 0; i < updatePayload.length; i += 2) {
    var propKey = updatePayload[i];
    var propValue = updatePayload[i + 1];

    if (propKey === STYLE) {
      setValueForStyles(domElement, propValue);
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      setInnerHTML(domElement, propValue);
    } else if (propKey === CHILDREN) {
      setTextContent(domElement, propValue);
    } else {
      setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
    }
  }
}

function createElement(type, props, rootContainerElement, parentNamespace) {
  var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML
  // tags get no namespace.

  var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
  var domElement;
  var namespaceURI = parentNamespace;

  if (namespaceURI === HTML_NAMESPACE$1) {
    namespaceURI = getIntrinsicNamespace(type);
  }

  if (namespaceURI === HTML_NAMESPACE$1) {
    {
      isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to
      // allow <SVG> or <mATH>.

      if (!isCustomComponentTag && type !== type.toLowerCase()) {
        error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);
      }
    }

    if (type === 'script') {
      // Create the script via .innerHTML so its "parser-inserted" flag is
      // set to true and it does not execute
      var div = ownerDocument.createElement('div');

      div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
      // This is guaranteed to yield a script element.

      var firstChild = div.firstChild;
      domElement = div.removeChild(firstChild);
    } else if (typeof props.is === 'string') {
      // $FlowIssue `createElement` should be updated for Web Components
      domElement = ownerDocument.createElement(type, {
        is: props.is
      });
    } else {
      // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
      // See discussion in https://github.com/facebook/react/pull/6896
      // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
      domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`
      // attributes on `select`s needs to be added before `option`s are inserted.
      // This prevents:
      // - a bug where the `select` does not scroll to the correct option because singular
      //  `select` elements automatically pick the first item #13222
      // - a bug where the `select` set the first item as selected despite the `size` attribute #14239
      // See https://github.com/facebook/react/issues/13222
      // and https://github.com/facebook/react/issues/14239

      if (type === 'select') {
        var node = domElement;

        if (props.multiple) {
          node.multiple = true;
        } else if (props.size) {
          // Setting a size greater than 1 causes a select to behave like `multiple=true`, where
          // it is possible that no option is selected.
          //
          // This is only necessary when a select in "single selection mode".
          node.size = props.size;
        }
      }
    }
  } else {
    domElement = ownerDocument.createElementNS(namespaceURI, type);
  }

  {
    if (namespaceURI === HTML_NAMESPACE$1) {
      if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
        warnedUnknownTags[type] = true;

        error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
      }
    }
  }

  return domElement;
}
function createTextNode(text, rootContainerElement) {
  return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
}
function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
  var isCustomComponentTag = isCustomComponent(tag, rawProps);

  {
    validatePropertiesInDevelopment(tag, rawProps);
  } // TODO: Make sure that we check isMounted before firing any of these events.


  var props;

  switch (tag) {
    case 'dialog':
      listenToNonDelegatedEvent('cancel', domElement);
      listenToNonDelegatedEvent('close', domElement);
      props = rawProps;
      break;

    case 'iframe':
    case 'object':
    case 'embed':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the load event.
      listenToNonDelegatedEvent('load', domElement);
      props = rawProps;
      break;

    case 'video':
    case 'audio':
      // We listen to these events in case to ensure emulated bubble
      // listeners still fire for all the media events.
      for (var i = 0; i < mediaEventTypes.length; i++) {
        listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
      }

      props = rawProps;
      break;

    case 'source':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the error event.
      listenToNonDelegatedEvent('error', domElement);
      props = rawProps;
      break;

    case 'img':
    case 'image':
    case 'link':
      // We listen to these events in case to ensure emulated bubble
      // listeners still fire for error and load events.
      listenToNonDelegatedEvent('error', domElement);
      listenToNonDelegatedEvent('load', domElement);
      props = rawProps;
      break;

    case 'details':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the toggle event.
      listenToNonDelegatedEvent('toggle', domElement);
      props = rawProps;
      break;

    case 'input':
      initWrapperState(domElement, rawProps);
      props = getHostProps(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    case 'option':
      validateProps(domElement, rawProps);
      props = getHostProps$1(domElement, rawProps);
      break;

    case 'select':
      initWrapperState$1(domElement, rawProps);
      props = getHostProps$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    case 'textarea':
      initWrapperState$2(domElement, rawProps);
      props = getHostProps$3(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    default:
      props = rawProps;
  }

  assertValidProps(tag, props);
  setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);

  switch (tag) {
    case 'input':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper(domElement, rawProps, false);
      break;

    case 'textarea':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper$3(domElement);
      break;

    case 'option':
      postMountWrapper$1(domElement, rawProps);
      break;

    case 'select':
      postMountWrapper$2(domElement, rawProps);
      break;

    default:
      if (typeof props.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }

      break;
  }
} // Calculate the diff between the two objects.

function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
  {
    validatePropertiesInDevelopment(tag, nextRawProps);
  }

  var updatePayload = null;
  var lastProps;
  var nextProps;

  switch (tag) {
    case 'input':
      lastProps = getHostProps(domElement, lastRawProps);
      nextProps = getHostProps(domElement, nextRawProps);
      updatePayload = [];
      break;

    case 'option':
      lastProps = getHostProps$1(domElement, lastRawProps);
      nextProps = getHostProps$1(domElement, nextRawProps);
      updatePayload = [];
      break;

    case 'select':
      lastProps = getHostProps$2(domElement, lastRawProps);
      nextProps = getHostProps$2(domElement, nextRawProps);
      updatePayload = [];
      break;

    case 'textarea':
      lastProps = getHostProps$3(domElement, lastRawProps);
      nextProps = getHostProps$3(domElement, nextRawProps);
      updatePayload = [];
      break;

    default:
      lastProps = lastRawProps;
      nextProps = nextRawProps;

      if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }

      break;
  }

  assertValidProps(tag, nextProps);
  var propKey;
  var styleName;
  var styleUpdates = null;

  for (propKey in lastProps) {
    if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
      continue;
    }

    if (propKey === STYLE) {
      var lastStyle = lastProps[propKey];

      for (styleName in lastStyle) {
        if (lastStyle.hasOwnProperty(styleName)) {
          if (!styleUpdates) {
            styleUpdates = {};
          }

          styleUpdates[styleName] = '';
        }
      }
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {
      // This is a special case. If any listener updates we need to ensure
      // that the "current" fiber pointer gets updated so we need a commit
      // to update this element.
      if (!updatePayload) {
        updatePayload = [];
      }
    } else {
      // For all other deleted properties we add it to the queue. We use
      // the allowed property list in the commit phase instead.
      (updatePayload = updatePayload || []).push(propKey, null);
    }
  }

  for (propKey in nextProps) {
    var nextProp = nextProps[propKey];
    var lastProp = lastProps != null ? lastProps[propKey] : undefined;

    if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
      continue;
    }

    if (propKey === STYLE) {
      {
        if (nextProp) {
          // Freeze the next style object so that we can assume it won't be
          // mutated. We have already warned for this in the past.
          Object.freeze(nextProp);
        }
      }

      if (lastProp) {
        // Unset styles on `lastProp` but not on `nextProp`.
        for (styleName in lastProp) {
          if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
            if (!styleUpdates) {
              styleUpdates = {};
            }

            styleUpdates[styleName] = '';
          }
        } // Update styles that changed since `lastProp`.


        for (styleName in nextProp) {
          if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
            if (!styleUpdates) {
              styleUpdates = {};
            }

            styleUpdates[styleName] = nextProp[styleName];
          }
        }
      } else {
        // Relies on `updateStylesByID` not mutating `styleUpdates`.
        if (!styleUpdates) {
          if (!updatePayload) {
            updatePayload = [];
          }

          updatePayload.push(propKey, styleUpdates);
        }

        styleUpdates = nextProp;
      }
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      var nextHtml = nextProp ? nextProp[HTML$1] : undefined;
      var lastHtml = lastProp ? lastProp[HTML$1] : undefined;

      if (nextHtml != null) {
        if (lastHtml !== nextHtml) {
          (updatePayload = updatePayload || []).push(propKey, nextHtml);
        }
      }
    } else if (propKey === CHILDREN) {
      if (typeof nextProp === 'string' || typeof nextProp === 'number') {
        (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
      }
    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        // We eagerly listen to this even though we haven't committed yet.
        if ( typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }

        if (propKey === 'onScroll') {
          listenToNonDelegatedEvent('scroll', domElement);
        }
      }

      if (!updatePayload && lastProp !== nextProp) {
        // This is a special case. If any listener updates we need to ensure
        // that the "current" props pointer gets updated so we need a commit
        // to update this element.
        updatePayload = [];
      }
    } else if (typeof nextProp === 'object' && nextProp !== null && nextProp.$$typeof === REACT_OPAQUE_ID_TYPE) {
      // If we encounter useOpaqueReference's opaque object, this means we are hydrating.
      // In this case, call the opaque object's toString function which generates a new client
      // ID so client and server IDs match and throws to rerender.
      nextProp.toString();
    } else {
      // For any other property we always add it to the queue and then we
      // filter it out using the allowed property list during the commit.
      (updatePayload = updatePayload || []).push(propKey, nextProp);
    }
  }

  if (styleUpdates) {
    {
      validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
    }

    (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
  }

  return updatePayload;
} // Apply the diff.

function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
  // Update checked *before* name.
  // In the middle of an update, it is possible to have multiple checked.
  // When a checked radio tries to change name, browser makes another radio's checked false.
  if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
    updateChecked(domElement, nextRawProps);
  }

  var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
  var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.

  updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props
  // changed.

  switch (tag) {
    case 'input':
      // Update the wrapper around inputs *after* updating props. This has to
      // happen after `updateDOMProperties`. Otherwise HTML5 input validations
      // raise warnings and prevent the new value from being assigned.
      updateWrapper(domElement, nextRawProps);
      break;

    case 'textarea':
      updateWrapper$1(domElement, nextRawProps);
      break;

    case 'select':
      // <select> value update needs to occur after <option> children
      // reconciliation
      postUpdateWrapper(domElement, nextRawProps);
      break;
  }
}

function getPossibleStandardName(propName) {
  {
    var lowerCasedName = propName.toLowerCase();

    if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
      return null;
    }

    return possibleStandardNames[lowerCasedName] || null;
  }
}

function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
  var isCustomComponentTag;
  var extraAttributeNames;

  {
    suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;
    isCustomComponentTag = isCustomComponent(tag, rawProps);
    validatePropertiesInDevelopment(tag, rawProps);
  } // TODO: Make sure that we check isMounted before firing any of these events.


  switch (tag) {
    case 'dialog':
      listenToNonDelegatedEvent('cancel', domElement);
      listenToNonDelegatedEvent('close', domElement);
      break;

    case 'iframe':
    case 'object':
    case 'embed':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the load event.
      listenToNonDelegatedEvent('load', domElement);
      break;

    case 'video':
    case 'audio':
      // We listen to these events in case to ensure emulated bubble
      // listeners still fire for all the media events.
      for (var i = 0; i < mediaEventTypes.length; i++) {
        listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
      }

      break;

    case 'source':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the error event.
      listenToNonDelegatedEvent('error', domElement);
      break;

    case 'img':
    case 'image':
    case 'link':
      // We listen to these events in case to ensure emulated bubble
      // listeners still fire for error and load events.
      listenToNonDelegatedEvent('error', domElement);
      listenToNonDelegatedEvent('load', domElement);
      break;

    case 'details':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the toggle event.
      listenToNonDelegatedEvent('toggle', domElement);
      break;

    case 'input':
      initWrapperState(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    case 'option':
      validateProps(domElement, rawProps);
      break;

    case 'select':
      initWrapperState$1(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    case 'textarea':
      initWrapperState$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;
  }

  assertValidProps(tag, rawProps);

  {
    extraAttributeNames = new Set();
    var attributes = domElement.attributes;

    for (var _i = 0; _i < attributes.length; _i++) {
      var name = attributes[_i].name.toLowerCase();

      switch (name) {
        // Built-in SSR attribute is allowed
        case 'data-reactroot':
          break;
        // Controlled attributes are not validated
        // TODO: Only ignore them on controlled tags.

        case 'value':
          break;

        case 'checked':
          break;

        case 'selected':
          break;

        default:
          // Intentionally use the original name.
          // See discussion in https://github.com/facebook/react/pull/10676.
          extraAttributeNames.add(attributes[_i].name);
      }
    }
  }

  var updatePayload = null;

  for (var propKey in rawProps) {
    if (!rawProps.hasOwnProperty(propKey)) {
      continue;
    }

    var nextProp = rawProps[propKey];

    if (propKey === CHILDREN) {
      // For text content children we compare against textContent. This
      // might match additional HTML that is hidden when we read it using
      // textContent. E.g. "foo" will match "f<span>oo</span>" but that still
      // satisfies our requirement. Our requirement is not to produce perfect
      // HTML and attributes. Ideally we should preserve structure but it's
      // ok not to if the visible content is still enough to indicate what
      // even listeners these nodes might be wired up to.
      // TODO: Warn if there is more than a single textNode as a child.
      // TODO: Should we use domElement.firstChild.nodeValue to compare?
      if (typeof nextProp === 'string') {
        if (domElement.textContent !== nextProp) {
          if ( !suppressHydrationWarning) {
            warnForTextDifference(domElement.textContent, nextProp);
          }

          updatePayload = [CHILDREN, nextProp];
        }
      } else if (typeof nextProp === 'number') {
        if (domElement.textContent !== '' + nextProp) {
          if ( !suppressHydrationWarning) {
            warnForTextDifference(domElement.textContent, nextProp);
          }

          updatePayload = [CHILDREN, '' + nextProp];
        }
      }
    } else if (registrationNameDependencies.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        if ( typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }

        if (propKey === 'onScroll') {
          listenToNonDelegatedEvent('scroll', domElement);
        }
      }
    } else if ( // Convince Flow we've calculated it (it's DEV-only in this method.)
    typeof isCustomComponentTag === 'boolean') {
      // Validate that the properties correspond to their expected values.
      var serverValue = void 0;
      var propertyInfo = getPropertyInfo(propKey);

      if (suppressHydrationWarning) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated
      // TODO: Only ignore them on controlled tags.
      propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
        var serverHTML = domElement.innerHTML;
        var nextHtml = nextProp ? nextProp[HTML$1] : undefined;

        if (nextHtml != null) {
          var expectedHTML = normalizeHTML(domElement, nextHtml);

          if (expectedHTML !== serverHTML) {
            warnForPropDifference(propKey, serverHTML, expectedHTML);
          }
        }
      } else if (propKey === STYLE) {
        // $FlowFixMe - Should be inferred as not undefined.
        extraAttributeNames.delete(propKey);

        if (canDiffStyleForHydrationWarning) {
          var expectedStyle = createDangerousStringForStyles(nextProp);
          serverValue = domElement.getAttribute('style');

          if (expectedStyle !== serverValue) {
            warnForPropDifference(propKey, serverValue, expectedStyle);
          }
        }
      } else if (isCustomComponentTag) {
        // $FlowFixMe - Should be inferred as not undefined.
        extraAttributeNames.delete(propKey.toLowerCase());
        serverValue = getValueForAttribute(domElement, propKey, nextProp);

        if (nextProp !== serverValue) {
          warnForPropDifference(propKey, serverValue, nextProp);
        }
      } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
        var isMismatchDueToBadCasing = false;

        if (propertyInfo !== null) {
          // $FlowFixMe - Should be inferred as not undefined.
          extraAttributeNames.delete(propertyInfo.attributeName);
          serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
        } else {
          var ownNamespace = parentNamespace;

          if (ownNamespace === HTML_NAMESPACE$1) {
            ownNamespace = getIntrinsicNamespace(tag);
          }

          if (ownNamespace === HTML_NAMESPACE$1) {
            // $FlowFixMe - Should be inferred as not undefined.
            extraAttributeNames.delete(propKey.toLowerCase());
          } else {
            var standardName = getPossibleStandardName(propKey);

            if (standardName !== null && standardName !== propKey) {
              // If an SVG prop is supplied with bad casing, it will
              // be successfully parsed from HTML, but will produce a mismatch
              // (and would be incorrectly rendered on the client).
              // However, we already warn about bad casing elsewhere.
              // So we'll skip the misleading extra mismatch warning in this case.
              isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.

              extraAttributeNames.delete(standardName);
            } // $FlowFixMe - Should be inferred as not undefined.


            extraAttributeNames.delete(propKey);
          }

          serverValue = getValueForAttribute(domElement, propKey, nextProp);
        }

        if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
          warnForPropDifference(propKey, serverValue, nextProp);
        }
      }
    }
  }

  {
    // $FlowFixMe - Should be inferred as not undefined.
    if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
      // $FlowFixMe - Should be inferred as not undefined.
      warnForExtraAttributes(extraAttributeNames);
    }
  }

  switch (tag) {
    case 'input':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper(domElement, rawProps, true);
      break;

    case 'textarea':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper$3(domElement);
      break;

    case 'select':
    case 'option':
      // For input and textarea we current always set the value property at
      // post mount to force it to diverge from attributes. However, for
      // option and select we don't quite do the same thing and select
      // is not resilient to the DOM state changing so we don't do that here.
      // TODO: Consider not doing this for input and textarea.
      break;

    default:
      if (typeof rawProps.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }

      break;
  }

  return updatePayload;
}
function diffHydratedText(textNode, text) {
  var isDifferent = textNode.nodeValue !== text;
  return isDifferent;
}
function warnForUnmatchedText(textNode, text) {
  {
    warnForTextDifference(textNode.nodeValue, text);
  }
}
function warnForDeletedHydratableElement(parentNode, child) {
  {
    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
  }
}
function warnForDeletedHydratableText(parentNode, child) {
  {
    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
  }
}
function warnForInsertedHydratedElement(parentNode, tag, props) {
  {
    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
  }
}
function warnForInsertedHydratedText(parentNode, text) {
  {
    if (text === '') {
      // We expect to insert empty text nodes since they're not represented in
      // the HTML.
      // TODO: Remove this special case if we can just avoid inserting empty
      // text nodes.
      return;
    }

    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
  }
}
function restoreControlledState$3(domElement, tag, props) {
  switch (tag) {
    case 'input':
      restoreControlledState(domElement, props);
      return;

    case 'textarea':
      restoreControlledState$2(domElement, props);
      return;

    case 'select':
      restoreControlledState$1(domElement, props);
      return;
  }
}

var validateDOMNesting = function () {};

var updatedAncestorInfo = function () {};

{
  // This validation code was written based on the HTML5 parsing spec:
  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  //
  // Note: this does not catch all invalid nesting, nor does it try to (as it's
  // not clear what practical benefit doing so provides); instead, we warn only
  // for cases where the parser will give a parse tree differing from what React
  // intended. For example, <b><div></div></b> is invalid but we don't warn
  // because it still parses correctly; we do warn for other cases like nested
  // <p> tags where the beginning of the second element implicitly closes the
  // first, causing a confusing mess.
  // https://html.spec.whatwg.org/multipage/syntax.html#special
  var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope

  var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
  // TODO: Distinguish by namespace here -- for <title>, including it here
  // errs on the side of fewer warnings
  'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope

  var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags

  var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
  var emptyAncestorInfo = {
    current: null,
    formTag: null,
    aTagInScope: null,
    buttonTagInScope: null,
    nobrTagInScope: null,
    pTagInButtonScope: null,
    listItemTagAutoclosing: null,
    dlItemTagAutoclosing: null
  };

  updatedAncestorInfo = function (oldInfo, tag) {
    var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);

    var info = {
      tag: tag
    };

    if (inScopeTags.indexOf(tag) !== -1) {
      ancestorInfo.aTagInScope = null;
      ancestorInfo.buttonTagInScope = null;
      ancestorInfo.nobrTagInScope = null;
    }

    if (buttonScopeTags.indexOf(tag) !== -1) {
      ancestorInfo.pTagInButtonScope = null;
    } // See rules for 'li', 'dd', 'dt' start tags in
    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody


    if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
      ancestorInfo.listItemTagAutoclosing = null;
      ancestorInfo.dlItemTagAutoclosing = null;
    }

    ancestorInfo.current = info;

    if (tag === 'form') {
      ancestorInfo.formTag = info;
    }

    if (tag === 'a') {
      ancestorInfo.aTagInScope = info;
    }

    if (tag === 'button') {
      ancestorInfo.buttonTagInScope = info;
    }

    if (tag === 'nobr') {
      ancestorInfo.nobrTagInScope = info;
    }

    if (tag === 'p') {
      ancestorInfo.pTagInButtonScope = info;
    }

    if (tag === 'li') {
      ancestorInfo.listItemTagAutoclosing = info;
    }

    if (tag === 'dd' || tag === 'dt') {
      ancestorInfo.dlItemTagAutoclosing = info;
    }

    return ancestorInfo;
  };
  /**
   * Returns whether
   */


  var isTagValidWithParent = function (tag, parentTag) {
    // First, let's check if we're in an unusual parsing mode...
    switch (parentTag) {
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
      case 'select':
        return tag === 'option' || tag === 'optgroup' || tag === '#text';

      case 'optgroup':
        return tag === 'option' || tag === '#text';
      // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
      // but

      case 'option':
        return tag === '#text';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
      // No special behavior since these rules fall back to "in body" mode for
      // all except special table nodes which cause bad parsing behavior anyway.
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr

      case 'tr':
        return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody

      case 'tbody':
      case 'thead':
      case 'tfoot':
        return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup

      case 'colgroup':
        return tag === 'col' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable

      case 'table':
        return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead

      case 'head':
        return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element

      case 'html':
        return tag === 'head' || tag === 'body' || tag === 'frameset';

      case 'frameset':
        return tag === 'frame';

      case '#document':
        return tag === 'html';
    } // Probably in the "in body" parsing mode, so we outlaw only tag combos
    // where the parsing rules cause implicit opens or closes to be added.
    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody


    switch (tag) {
      case 'h1':
      case 'h2':
      case 'h3':
      case 'h4':
      case 'h5':
      case 'h6':
        return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';

      case 'rp':
      case 'rt':
        return impliedEndTags.indexOf(parentTag) === -1;

      case 'body':
      case 'caption':
      case 'col':
      case 'colgroup':
      case 'frameset':
      case 'frame':
      case 'head':
      case 'html':
      case 'tbody':
      case 'td':
      case 'tfoot':
      case 'th':
      case 'thead':
      case 'tr':
        // These tags are only valid with a few parents that have special child
        // parsing rules -- if we're down here, then none of those matched and
        // so we allow it only if we don't know what the parent is, as all other
        // cases are invalid.
        return parentTag == null;
    }

    return true;
  };
  /**
   * Returns whether
   */


  var findInvalidAncestorForTag = function (tag, ancestorInfo) {
    switch (tag) {
      case 'address':
      case 'article':
      case 'aside':
      case 'blockquote':
      case 'center':
      case 'details':
      case 'dialog':
      case 'dir':
      case 'div':
      case 'dl':
      case 'fieldset':
      case 'figcaption':
      case 'figure':
      case 'footer':
      case 'header':
      case 'hgroup':
      case 'main':
      case 'menu':
      case 'nav':
      case 'ol':
      case 'p':
      case 'section':
      case 'summary':
      case 'ul':
      case 'pre':
      case 'listing':
      case 'table':
      case 'hr':
      case 'xmp':
      case 'h1':
      case 'h2':
      case 'h3':
      case 'h4':
      case 'h5':
      case 'h6':
        return ancestorInfo.pTagInButtonScope;

      case 'form':
        return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;

      case 'li':
        return ancestorInfo.listItemTagAutoclosing;

      case 'dd':
      case 'dt':
        return ancestorInfo.dlItemTagAutoclosing;

      case 'button':
        return ancestorInfo.buttonTagInScope;

      case 'a':
        // Spec says something about storing a list of markers, but it sounds
        // equivalent to this check.
        return ancestorInfo.aTagInScope;

      case 'nobr':
        return ancestorInfo.nobrTagInScope;
    }

    return null;
  };

  var didWarn$1 = {};

  validateDOMNesting = function (childTag, childText, ancestorInfo) {
    ancestorInfo = ancestorInfo || emptyAncestorInfo;
    var parentInfo = ancestorInfo.current;
    var parentTag = parentInfo && parentInfo.tag;

    if (childText != null) {
      if (childTag != null) {
        error('validateDOMNesting: when childText is passed, childTag should be null');
      }

      childTag = '#text';
    }

    var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
    var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
    var invalidParentOrAncestor = invalidParent || invalidAncestor;

    if (!invalidParentOrAncestor) {
      return;
    }

    var ancestorTag = invalidParentOrAncestor.tag;
    var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag;

    if (didWarn$1[warnKey]) {
      return;
    }

    didWarn$1[warnKey] = true;
    var tagDisplayName = childTag;
    var whitespaceInfo = '';

    if (childTag === '#text') {
      if (/\S/.test(childText)) {
        tagDisplayName = 'Text nodes';
      } else {
        tagDisplayName = 'Whitespace text nodes';
        whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
      }
    } else {
      tagDisplayName = '<' + childTag + '>';
    }

    if (invalidParent) {
      var info = '';

      if (ancestorTag === 'table' && childTag === 'tr') {
        info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';
      }

      error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);
    } else {
      error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag);
    }
  };
}

var SUPPRESS_HYDRATION_WARNING$1;

{
  SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
}

var SUSPENSE_START_DATA = '$';
var SUSPENSE_END_DATA = '/$';
var SUSPENSE_PENDING_START_DATA = '$?';
var SUSPENSE_FALLBACK_START_DATA = '$!';
var STYLE$1 = 'style';
var eventsEnabled = null;
var selectionInformation = null;

function shouldAutoFocusHostComponent(type, props) {
  switch (type) {
    case 'button':
    case 'input':
    case 'select':
    case 'textarea':
      return !!props.autoFocus;
  }

  return false;
}
function getRootHostContext(rootContainerInstance) {
  var type;
  var namespace;
  var nodeType = rootContainerInstance.nodeType;

  switch (nodeType) {
    case DOCUMENT_NODE:
    case DOCUMENT_FRAGMENT_NODE:
      {
        type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
        var root = rootContainerInstance.documentElement;
        namespace = root ? root.namespaceURI : getChildNamespace(null, '');
        break;
      }

    default:
      {
        var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
        var ownNamespace = container.namespaceURI || null;
        type = container.tagName;
        namespace = getChildNamespace(ownNamespace, type);
        break;
      }
  }

  {
    var validatedTag = type.toLowerCase();
    var ancestorInfo = updatedAncestorInfo(null, validatedTag);
    return {
      namespace: namespace,
      ancestorInfo: ancestorInfo
    };
  }
}
function getChildHostContext(parentHostContext, type, rootContainerInstance) {
  {
    var parentHostContextDev = parentHostContext;
    var namespace = getChildNamespace(parentHostContextDev.namespace, type);
    var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
    return {
      namespace: namespace,
      ancestorInfo: ancestorInfo
    };
  }
}
function getPublicInstance(instance) {
  return instance;
}
function prepareForCommit(containerInfo) {
  eventsEnabled = isEnabled();
  selectionInformation = getSelectionInformation();
  var activeInstance = null;

  setEnabled(false);
  return activeInstance;
}
function resetAfterCommit(containerInfo) {
  restoreSelection(selectionInformation);
  setEnabled(eventsEnabled);
  eventsEnabled = null;
  selectionInformation = null;
}
function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  var parentNamespace;

  {
    // TODO: take namespace into account when validating.
    var hostContextDev = hostContext;
    validateDOMNesting(type, null, hostContextDev.ancestorInfo);

    if (typeof props.children === 'string' || typeof props.children === 'number') {
      var string = '' + props.children;
      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
      validateDOMNesting(null, string, ownAncestorInfo);
    }

    parentNamespace = hostContextDev.namespace;
  }

  var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
  precacheFiberNode(internalInstanceHandle, domElement);
  updateFiberProps(domElement, props);
  return domElement;
}
function appendInitialChild(parentInstance, child) {
  parentInstance.appendChild(child);
}
function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
  setInitialProperties(domElement, type, props, rootContainerInstance);
  return shouldAutoFocusHostComponent(type, props);
}
function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
  {
    var hostContextDev = hostContext;

    if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
      var string = '' + newProps.children;
      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
      validateDOMNesting(null, string, ownAncestorInfo);
    }
  }

  return diffProperties(domElement, type, oldProps, newProps);
}
function shouldSetTextContent(type, props) {
  return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
}
function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
  {
    var hostContextDev = hostContext;
    validateDOMNesting(null, text, hostContextDev.ancestorInfo);
  }

  var textNode = createTextNode(text, rootContainerInstance);
  precacheFiberNode(internalInstanceHandle, textNode);
  return textNode;
}
// if a component just imports ReactDOM (e.g. for findDOMNode).
// Some environments might not have setTimeout or clearTimeout.

var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
var noTimeout = -1; // -------------------
function commitMount(domElement, type, newProps, internalInstanceHandle) {
  // Despite the naming that might imply otherwise, this method only
  // fires if there is an `Update` effect scheduled during mounting.
  // This happens if `finalizeInitialChildren` returns `true` (which it
  // does to implement the `autoFocus` attribute on the client). But
  // there are also other cases when this might happen (such as patching
  // up text content during hydration mismatch). So we'll check this again.
  if (shouldAutoFocusHostComponent(type, newProps)) {
    domElement.focus();
  }
}
function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
  // Update the props handle so that we know which props are the ones with
  // with current event handlers.
  updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.

  updateProperties(domElement, updatePayload, type, oldProps, newProps);
}
function resetTextContent(domElement) {
  setTextContent(domElement, '');
}
function commitTextUpdate(textInstance, oldText, newText) {
  textInstance.nodeValue = newText;
}
function appendChild(parentInstance, child) {
  parentInstance.appendChild(child);
}
function appendChildToContainer(container, child) {
  var parentNode;

  if (container.nodeType === COMMENT_NODE) {
    parentNode = container.parentNode;
    parentNode.insertBefore(child, container);
  } else {
    parentNode = container;
    parentNode.appendChild(child);
  } // This container might be used for a portal.
  // If something inside a portal is clicked, that click should bubble
  // through the React tree. However, on Mobile Safari the click would
  // never bubble through the *DOM* tree unless an ancestor with onclick
  // event exists. So we wouldn't see it and dispatch it.
  // This is why we ensure that non React root containers have inline onclick
  // defined.
  // https://github.com/facebook/react/issues/11918


  var reactRootContainer = container._reactRootContainer;

  if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
    // TODO: This cast may not be sound for SVG, MathML or custom elements.
    trapClickOnNonInteractiveElement(parentNode);
  }
}
function insertBefore(parentInstance, child, beforeChild) {
  parentInstance.insertBefore(child, beforeChild);
}
function insertInContainerBefore(container, child, beforeChild) {
  if (container.nodeType === COMMENT_NODE) {
    container.parentNode.insertBefore(child, beforeChild);
  } else {
    container.insertBefore(child, beforeChild);
  }
}

function removeChild(parentInstance, child) {
  parentInstance.removeChild(child);
}
function removeChildFromContainer(container, child) {
  if (container.nodeType === COMMENT_NODE) {
    container.parentNode.removeChild(child);
  } else {
    container.removeChild(child);
  }
}
function hideInstance(instance) {
  // TODO: Does this work for all element types? What about MathML? Should we
  // pass host context to this method?
  instance = instance;
  var style = instance.style;

  if (typeof style.setProperty === 'function') {
    style.setProperty('display', 'none', 'important');
  } else {
    style.display = 'none';
  }
}
function hideTextInstance(textInstance) {
  textInstance.nodeValue = '';
}
function unhideInstance(instance, props) {
  instance = instance;
  var styleProp = props[STYLE$1];
  var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
  instance.style.display = dangerousStyleValue('display', display);
}
function unhideTextInstance(textInstance, text) {
  textInstance.nodeValue = text;
}
function clearContainer(container) {
  if (container.nodeType === ELEMENT_NODE) {
    container.textContent = '';
  } else if (container.nodeType === DOCUMENT_NODE) {
    var body = container.body;

    if (body != null) {
      body.textContent = '';
    }
  }
} // -------------------
function canHydrateInstance(instance, type, props) {
  if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
    return null;
  } // This has now been refined to an element node.


  return instance;
}
function canHydrateTextInstance(instance, text) {
  if (text === '' || instance.nodeType !== TEXT_NODE) {
    // Empty strings are not parsed by HTML so there won't be a correct match here.
    return null;
  } // This has now been refined to a text node.


  return instance;
}
function isSuspenseInstancePending(instance) {
  return instance.data === SUSPENSE_PENDING_START_DATA;
}
function isSuspenseInstanceFallback(instance) {
  return instance.data === SUSPENSE_FALLBACK_START_DATA;
}

function getNextHydratable(node) {
  // Skip non-hydratable nodes.
  for (; node != null; node = node.nextSibling) {
    var nodeType = node.nodeType;

    if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
      break;
    }
  }

  return node;
}

function getNextHydratableSibling(instance) {
  return getNextHydratable(instance.nextSibling);
}
function getFirstHydratableChild(parentInstance) {
  return getNextHydratable(parentInstance.firstChild);
}
function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
  // get attached.

  updateFiberProps(instance, props);
  var parentNamespace;

  {
    var hostContextDev = hostContext;
    parentNamespace = hostContextDev.namespace;
  }

  return diffHydratedProperties(instance, type, props, parentNamespace);
}
function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
  precacheFiberNode(internalInstanceHandle, textInstance);
  return diffHydratedText(textInstance, text);
}
function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
  var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.
  // There might be nested nodes so we need to keep track of how
  // deep we are and only break out when we're back on top.

  var depth = 0;

  while (node) {
    if (node.nodeType === COMMENT_NODE) {
      var data = node.data;

      if (data === SUSPENSE_END_DATA) {
        if (depth === 0) {
          return getNextHydratableSibling(node);
        } else {
          depth--;
        }
      } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
        depth++;
      }
    }

    node = node.nextSibling;
  } // TODO: Warn, we didn't find the end comment boundary.


  return null;
} // Returns the SuspenseInstance if this node is a direct child of a
// SuspenseInstance. I.e. if its previous sibling is a Comment with
// SUSPENSE_x_START_DATA. Otherwise, null.

function getParentSuspenseInstance(targetInstance) {
  var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.
  // There might be nested nodes so we need to keep track of how
  // deep we are and only break out when we're back on top.

  var depth = 0;

  while (node) {
    if (node.nodeType === COMMENT_NODE) {
      var data = node.data;

      if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
        if (depth === 0) {
          return node;
        } else {
          depth--;
        }
      } else if (data === SUSPENSE_END_DATA) {
        depth++;
      }
    }

    node = node.previousSibling;
  }

  return null;
}
function commitHydratedContainer(container) {
  // Retry if any event replaying was blocked on this.
  retryIfBlockedOn(container);
}
function commitHydratedSuspenseInstance(suspenseInstance) {
  // Retry if any event replaying was blocked on this.
  retryIfBlockedOn(suspenseInstance);
}
function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
  {
    warnForUnmatchedText(textInstance, text);
  }
}
function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
    warnForUnmatchedText(textInstance, text);
  }
}
function didNotHydrateContainerInstance(parentContainer, instance) {
  {
    if (instance.nodeType === ELEMENT_NODE) {
      warnForDeletedHydratableElement(parentContainer, instance);
    } else if (instance.nodeType === COMMENT_NODE) ; else {
      warnForDeletedHydratableText(parentContainer, instance);
    }
  }
}
function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
    if (instance.nodeType === ELEMENT_NODE) {
      warnForDeletedHydratableElement(parentInstance, instance);
    } else if (instance.nodeType === COMMENT_NODE) ; else {
      warnForDeletedHydratableText(parentInstance, instance);
    }
  }
}
function didNotFindHydratableContainerInstance(parentContainer, type, props) {
  {
    warnForInsertedHydratedElement(parentContainer, type);
  }
}
function didNotFindHydratableContainerTextInstance(parentContainer, text) {
  {
    warnForInsertedHydratedText(parentContainer, text);
  }
}
function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
    warnForInsertedHydratedElement(parentInstance, type);
  }
}
function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
    warnForInsertedHydratedText(parentInstance, text);
  }
}
function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ;
}
var clientId = 0;
function makeClientIdInDEV(warnOnAccessInDEV) {
  var id = 'r:' + (clientId++).toString(36);
  return {
    toString: function () {
      warnOnAccessInDEV();
      return id;
    },
    valueOf: function () {
      warnOnAccessInDEV();
      return id;
    }
  };
}
function isOpaqueHydratingObject(value) {
  return value !== null && typeof value === 'object' && value.$$typeof === REACT_OPAQUE_ID_TYPE;
}
function makeOpaqueHydratingObject(attemptToReadValue) {
  return {
    $$typeof: REACT_OPAQUE_ID_TYPE,
    toString: attemptToReadValue,
    valueOf: attemptToReadValue
  };
}
function preparePortalMount(portalInstance) {
  {
    listenToAllSupportedEvents(portalInstance);
  }
}

var randomKey = Math.random().toString(36).slice(2);
var internalInstanceKey = '__reactFiber$' + randomKey;
var internalPropsKey = '__reactProps$' + randomKey;
var internalContainerInstanceKey = '__reactContainer$' + randomKey;
var internalEventHandlersKey = '__reactEvents$' + randomKey;
function precacheFiberNode(hostInst, node) {
  node[internalInstanceKey] = hostInst;
}
function markContainerAsRoot(hostRoot, node) {
  node[internalContainerInstanceKey] = hostRoot;
}
function unmarkContainerAsRoot(node) {
  node[internalContainerInstanceKey] = null;
}
function isContainerMarkedAsRoot(node) {
  return !!node[internalContainerInstanceKey];
} // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.
// If the target node is part of a hydrated or not yet rendered subtree, then
// this may also return a SuspenseComponent or HostRoot to indicate that.
// Conceptually the HostRoot fiber is a child of the Container node. So if you
// pass the Container node as the targetNode, you will not actually get the
// HostRoot back. To get to the HostRoot, you need to pass a child of it.
// The same thing applies to Suspense boundaries.

function getClosestInstanceFromNode(targetNode) {
  var targetInst = targetNode[internalInstanceKey];

  if (targetInst) {
    // Don't return HostRoot or SuspenseComponent here.
    return targetInst;
  } // If the direct event target isn't a React owned DOM node, we need to look
  // to see if one of its parents is a React owned DOM node.


  var parentNode = targetNode.parentNode;

  while (parentNode) {
    // We'll check if this is a container root that could include
    // React nodes in the future. We need to check this first because
    // if we're a child of a dehydrated container, we need to first
    // find that inner container before moving on to finding the parent
    // instance. Note that we don't check this field on  the targetNode
    // itself because the fibers are conceptually between the container
    // node and the first child. It isn't surrounding the container node.
    // If it's not a container, we check if it's an instance.
    targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];

    if (targetInst) {
      // Since this wasn't the direct target of the event, we might have
      // stepped past dehydrated DOM nodes to get here. However they could
      // also have been non-React nodes. We need to answer which one.
      // If we the instance doesn't have any children, then there can't be
      // a nested suspense boundary within it. So we can use this as a fast
      // bailout. Most of the time, when people add non-React children to
      // the tree, it is using a ref to a child-less DOM node.
      // Normally we'd only need to check one of the fibers because if it
      // has ever gone from having children to deleting them or vice versa
      // it would have deleted the dehydrated boundary nested inside already.
      // However, since the HostRoot starts out with an alternate it might
      // have one on the alternate so we need to check in case this was a
      // root.
      var alternate = targetInst.alternate;

      if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
        // Next we need to figure out if the node that skipped past is
        // nested within a dehydrated boundary and if so, which one.
        var suspenseInstance = getParentSuspenseInstance(targetNode);

        while (suspenseInstance !== null) {
          // We found a suspense instance. That means that we haven't
          // hydrated it yet. Even though we leave the comments in the
          // DOM after hydrating, and there are boundaries in the DOM
          // that could already be hydrated, we wouldn't have found them
          // through this pass since if the target is hydrated it would
          // have had an internalInstanceKey on it.
          // Let's get the fiber associated with the SuspenseComponent
          // as the deepest instance.
          var targetSuspenseInst = suspenseInstance[internalInstanceKey];

          if (targetSuspenseInst) {
            return targetSuspenseInst;
          } // If we don't find a Fiber on the comment, it might be because
          // we haven't gotten to hydrate it yet. There might still be a
          // parent boundary that hasn't above this one so we need to find
          // the outer most that is known.


          suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent
          // host component also hasn't hydrated yet. We can return it
          // below since it will bail out on the isMounted check later.
        }
      }

      return targetInst;
    }

    targetNode = parentNode;
    parentNode = targetNode.parentNode;
  }

  return null;
}
/**
 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
 * instance, or null if the node was not rendered by this React.
 */

function getInstanceFromNode(node) {
  var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];

  if (inst) {
    if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
      return inst;
    } else {
      return null;
    }
  }

  return null;
}
/**
 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
 * DOM node.
 */

function getNodeFromInstance(inst) {
  if (inst.tag === HostComponent || inst.tag === HostText) {
    // In Fiber this, is just the state node right now. We assume it will be
    // a host component or host text.
    return inst.stateNode;
  } // Without this first invariant, passing a non-DOM-component triggers the next
  // invariant for a missing parent, which is super confusing.


  {
    {
      throw Error( "getNodeFromInstance: Invalid argument." );
    }
  }
}
function getFiberCurrentPropsFromNode(node) {
  return node[internalPropsKey] || null;
}
function updateFiberProps(node, props) {
  node[internalPropsKey] = props;
}
function getEventListenerSet(node) {
  var elementListenerSet = node[internalEventHandlersKey];

  if (elementListenerSet === undefined) {
    elementListenerSet = node[internalEventHandlersKey] = new Set();
  }

  return elementListenerSet;
}

var loggedTypeFailures = {};
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame$1.setExtraStackFrame(null);
    }
  }
}

function checkPropTypes(typeSpecs, values, location, componentName, element) {
  {
    // $FlowFixMe This is okay but Flow doesn't know it.
    var has = Function.call.bind(Object.prototype.hasOwnProperty);

    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.

        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
            err.name = 'Invariant Violation';
            throw err;
          }

          error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
        } catch (ex) {
          error$1 = ex;
        }

        if (error$1 && !(error$1 instanceof Error)) {
          setCurrentlyValidatingElement(element);

          error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);

          setCurrentlyValidatingElement(null);
        }

        if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error$1.message] = true;
          setCurrentlyValidatingElement(element);

          error('Failed %s type: %s', location, error$1.message);

          setCurrentlyValidatingElement(null);
        }
      }
    }
  }
}

var valueStack = [];
var fiberStack;

{
  fiberStack = [];
}

var index = -1;

function createCursor(defaultValue) {
  return {
    current: defaultValue
  };
}

function pop(cursor, fiber) {
  if (index < 0) {
    {
      error('Unexpected pop.');
    }

    return;
  }

  {
    if (fiber !== fiberStack[index]) {
      error('Unexpected Fiber popped.');
    }
  }

  cursor.current = valueStack[index];
  valueStack[index] = null;

  {
    fiberStack[index] = null;
  }

  index--;
}

function push(cursor, value, fiber) {
  index++;
  valueStack[index] = cursor.current;

  {
    fiberStack[index] = fiber;
  }

  cursor.current = value;
}

var warnedAboutMissingGetChildContext;

{
  warnedAboutMissingGetChildContext = {};
}

var emptyContextObject = {};

{
  Object.freeze(emptyContextObject);
} // A cursor to the current merged context object on the stack.


var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.

var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.
// We use this to get access to the parent context after we have already
// pushed the next context provider, and now need to merge their contexts.

var previousContext = emptyContextObject;

function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
  {
    if (didPushOwnContextIfProvider && isContextProvider(Component)) {
      // If the fiber is a context provider itself, when we read its context
      // we may have already pushed its own child context on the stack. A context
      // provider should not "see" its own child context. Therefore we read the
      // previous (parent) context instead for a context provider.
      return previousContext;
    }

    return contextStackCursor.current;
  }
}

function cacheContext(workInProgress, unmaskedContext, maskedContext) {
  {
    var instance = workInProgress.stateNode;
    instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
    instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
  }
}

function getMaskedContext(workInProgress, unmaskedContext) {
  {
    var type = workInProgress.type;
    var contextTypes = type.contextTypes;

    if (!contextTypes) {
      return emptyContextObject;
    } // Avoid recreating masked context unless unmasked context has changed.
    // Failing to do this will result in unnecessary calls to componentWillReceiveProps.
    // This may trigger infinite loops if componentWillReceiveProps calls setState.


    var instance = workInProgress.stateNode;

    if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
      return instance.__reactInternalMemoizedMaskedChildContext;
    }

    var context = {};

    for (var key in contextTypes) {
      context[key] = unmaskedContext[key];
    }

    {
      var name = getComponentName(type) || 'Unknown';
      checkPropTypes(contextTypes, context, 'context', name);
    } // Cache unmasked context so we can avoid recreating masked context unless necessary.
    // Context is created before the class component is instantiated so check for instance.


    if (instance) {
      cacheContext(workInProgress, unmaskedContext, context);
    }

    return context;
  }
}

function hasContextChanged() {
  {
    return didPerformWorkStackCursor.current;
  }
}

function isContextProvider(type) {
  {
    var childContextTypes = type.childContextTypes;
    return childContextTypes !== null && childContextTypes !== undefined;
  }
}

function popContext(fiber) {
  {
    pop(didPerformWorkStackCursor, fiber);
    pop(contextStackCursor, fiber);
  }
}

function popTopLevelContextObject(fiber) {
  {
    pop(didPerformWorkStackCursor, fiber);
    pop(contextStackCursor, fiber);
  }
}

function pushTopLevelContextObject(fiber, context, didChange) {
  {
    if (!(contextStackCursor.current === emptyContextObject)) {
      {
        throw Error( "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    push(contextStackCursor, context, fiber);
    push(didPerformWorkStackCursor, didChange, fiber);
  }
}

function processChildContext(fiber, type, parentContext) {
  {
    var instance = fiber.stateNode;
    var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future.
    // It has only been added in Fiber to match the (unintentional) behavior in Stack.

    if (typeof instance.getChildContext !== 'function') {
      {
        var componentName = getComponentName(type) || 'Unknown';

        if (!warnedAboutMissingGetChildContext[componentName]) {
          warnedAboutMissingGetChildContext[componentName] = true;

          error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
        }
      }

      return parentContext;
    }

    var childContext = instance.getChildContext();

    for (var contextKey in childContext) {
      if (!(contextKey in childContextTypes)) {
        {
          throw Error( (getComponentName(type) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes." );
        }
      }
    }

    {
      var name = getComponentName(type) || 'Unknown';
      checkPropTypes(childContextTypes, childContext, 'child context', name);
    }

    return _assign({}, parentContext, childContext);
  }
}

function pushContextProvider(workInProgress) {
  {
    var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.
    // If the instance does not exist yet, we will push null at first,
    // and replace it on the stack later when invalidating the context.

    var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.
    // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.

    previousContext = contextStackCursor.current;
    push(contextStackCursor, memoizedMergedChildContext, workInProgress);
    push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
    return true;
  }
}

function invalidateContextProvider(workInProgress, type, didChange) {
  {
    var instance = workInProgress.stateNode;

    if (!instance) {
      {
        throw Error( "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    if (didChange) {
      // Merge parent and own context.
      // Skip this if we're not updating due to sCU.
      // This avoids unnecessarily recomputing memoized values.
      var mergedContext = processChildContext(workInProgress, type, previousContext);
      instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.
      // It is important to unwind the context in the reverse order.

      pop(didPerformWorkStackCursor, workInProgress);
      pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.

      push(contextStackCursor, mergedContext, workInProgress);
      push(didPerformWorkStackCursor, didChange, workInProgress);
    } else {
      pop(didPerformWorkStackCursor, workInProgress);
      push(didPerformWorkStackCursor, didChange, workInProgress);
    }
  }
}

function findCurrentUnmaskedContext(fiber) {
  {
    // Currently this is only used with renderSubtreeIntoContainer; not sure if it
    // makes sense elsewhere
    if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
      {
        throw Error( "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    var node = fiber;

    do {
      switch (node.tag) {
        case HostRoot:
          return node.stateNode.context;

        case ClassComponent:
          {
            var Component = node.type;

            if (isContextProvider(Component)) {
              return node.stateNode.__reactInternalMemoizedMergedChildContext;
            }

            break;
          }
      }

      node = node.return;
    } while (node !== null);

    {
      {
        throw Error( "Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue." );
      }
    }
  }
}

var LegacyRoot = 0;
var BlockingRoot = 1;
var ConcurrentRoot = 2;

var rendererID = null;
var injectedHook = null;
var hasLoggedError = false;
var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';
function injectInternals(internals) {
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
    // No DevTools
    return false;
  }

  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;

  if (hook.isDisabled) {
    // This isn't a real property on the hook, but it can be set to opt out
    // of DevTools integration and associated warnings and logs.
    // https://github.com/facebook/react/issues/3877
    return true;
  }

  if (!hook.supportsFiber) {
    {
      error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://reactjs.org/link/react-devtools');
    } // DevTools exists, even though it doesn't support Fiber.


    return true;
  }

  try {
    rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.

    injectedHook = hook;
  } catch (err) {
    // Catch all errors because it is unsafe to throw during initialization.
    {
      error('React instrumentation encountered an error: %s.', err);
    }
  } // DevTools exists


  return true;
}
function onScheduleRoot(root, children) {
  {
    if (injectedHook && typeof injectedHook.onScheduleFiberRoot === 'function') {
      try {
        injectedHook.onScheduleFiberRoot(rendererID, root, children);
      } catch (err) {
        if ( !hasLoggedError) {
          hasLoggedError = true;

          error('React instrumentation encountered an error: %s', err);
        }
      }
    }
  }
}
function onCommitRoot(root, priorityLevel) {
  if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') {
    try {
      var didError = (root.current.flags & DidCapture) === DidCapture;

      if (enableProfilerTimer) {
        injectedHook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);
      } else {
        injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError);
      }
    } catch (err) {
      {
        if (!hasLoggedError) {
          hasLoggedError = true;

          error('React instrumentation encountered an error: %s', err);
        }
      }
    }
  }
}
function onCommitUnmount(fiber) {
  if (injectedHook && typeof injectedHook.onCommitFiberUnmount === 'function') {
    try {
      injectedHook.onCommitFiberUnmount(rendererID, fiber);
    } catch (err) {
      {
        if (!hasLoggedError) {
          hasLoggedError = true;

          error('React instrumentation encountered an error: %s', err);
        }
      }
    }
  }
}

var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,
    Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,
    Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,
    Scheduler_shouldYield = Scheduler.unstable_shouldYield,
    Scheduler_requestPaint = Scheduler.unstable_requestPaint,
    Scheduler_now$1 = Scheduler.unstable_now,
    Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,
    Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,
    Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,
    Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,
    Scheduler_LowPriority = Scheduler.unstable_LowPriority,
    Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;

{
  // Provide explicit error message when production+profiling bundle of e.g.
  // react-dom is used with production (non-profiling) bundle of
  // scheduler/tracing
  if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
    {
      throw Error( "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" );
    }
  }
}

var fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use
// ascending numbers so we can compare them like numbers. They start at 90 to
// avoid clashing with Scheduler's priorities.

var ImmediatePriority$1 = 99;
var UserBlockingPriority$2 = 98;
var NormalPriority$1 = 97;
var LowPriority$1 = 96;
var IdlePriority$1 = 95; // NoPriority is the absence of priority. Also React-only.

var NoPriority$1 = 90;
var shouldYield = Scheduler_shouldYield;
var requestPaint = // Fall back gracefully if we're running an older version of Scheduler.
Scheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};
var syncQueue = null;
var immediateQueueCallbackNode = null;
var isFlushingSyncQueue = false;
var initialTimeMs$1 = Scheduler_now$1(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.
// This will be the case for modern browsers that support `performance.now`. In
// older browsers, Scheduler falls back to `Date.now`, which returns a Unix
// timestamp. In that case, subtract the module initialization time to simulate
// the behavior of performance.now and keep our times small enough to fit
// within 32 bits.
// TODO: Consider lifting this into Scheduler.

var now = initialTimeMs$1 < 10000 ? Scheduler_now$1 : function () {
  return Scheduler_now$1() - initialTimeMs$1;
};
function getCurrentPriorityLevel() {
  switch (Scheduler_getCurrentPriorityLevel()) {
    case Scheduler_ImmediatePriority:
      return ImmediatePriority$1;

    case Scheduler_UserBlockingPriority:
      return UserBlockingPriority$2;

    case Scheduler_NormalPriority:
      return NormalPriority$1;

    case Scheduler_LowPriority:
      return LowPriority$1;

    case Scheduler_IdlePriority:
      return IdlePriority$1;

    default:
      {
        {
          throw Error( "Unknown priority level." );
        }
      }

  }
}

function reactPriorityToSchedulerPriority(reactPriorityLevel) {
  switch (reactPriorityLevel) {
    case ImmediatePriority$1:
      return Scheduler_ImmediatePriority;

    case UserBlockingPriority$2:
      return Scheduler_UserBlockingPriority;

    case NormalPriority$1:
      return Scheduler_NormalPriority;

    case LowPriority$1:
      return Scheduler_LowPriority;

    case IdlePriority$1:
      return Scheduler_IdlePriority;

    default:
      {
        {
          throw Error( "Unknown priority level." );
        }
      }

  }
}

function runWithPriority$1(reactPriorityLevel, fn) {
  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  return Scheduler_runWithPriority(priorityLevel, fn);
}
function scheduleCallback(reactPriorityLevel, callback, options) {
  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  return Scheduler_scheduleCallback(priorityLevel, callback, options);
}
function scheduleSyncCallback(callback) {
  // Push this callback into an internal queue. We'll flush these either in
  // the next tick, or earlier if something calls `flushSyncCallbackQueue`.
  if (syncQueue === null) {
    syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.

    immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
  } else {
    // Push onto existing queue. Don't need to schedule a callback because
    // we already scheduled one when we created the queue.
    syncQueue.push(callback);
  }

  return fakeCallbackNode;
}
function cancelCallback(callbackNode) {
  if (callbackNode !== fakeCallbackNode) {
    Scheduler_cancelCallback(callbackNode);
  }
}
function flushSyncCallbackQueue() {
  if (immediateQueueCallbackNode !== null) {
    var node = immediateQueueCallbackNode;
    immediateQueueCallbackNode = null;
    Scheduler_cancelCallback(node);
  }

  flushSyncCallbackQueueImpl();
}

function flushSyncCallbackQueueImpl() {
  if (!isFlushingSyncQueue && syncQueue !== null) {
    // Prevent re-entrancy.
    isFlushingSyncQueue = true;
    var i = 0;

    {
      try {
        var _isSync2 = true;
        var _queue = syncQueue;
        runWithPriority$1(ImmediatePriority$1, function () {
          for (; i < _queue.length; i++) {
            var callback = _queue[i];

            do {
              callback = callback(_isSync2);
            } while (callback !== null);
          }
        });
        syncQueue = null;
      } catch (error) {
        // If something throws, leave the remaining callbacks on the queue.
        if (syncQueue !== null) {
          syncQueue = syncQueue.slice(i + 1);
        } // Resume flushing in the next tick


        Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
        throw error;
      } finally {
        isFlushingSyncQueue = false;
      }
    }
  }
}

// TODO: this is special because it gets imported during build.
var ReactVersion = '17.0.2';

var NoMode = 0;
var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root
// tag instead

var BlockingMode = 2;
var ConcurrentMode = 4;
var ProfileMode = 8;
var DebugTracingMode = 16;

var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
var NoTransition = 0;
function requestCurrentTransition() {
  return ReactCurrentBatchConfig.transition;
}

var ReactStrictModeWarnings = {
  recordUnsafeLifecycleWarnings: function (fiber, instance) {},
  flushPendingUnsafeLifecycleWarnings: function () {},
  recordLegacyContextWarning: function (fiber, instance) {},
  flushLegacyContextWarning: function () {},
  discardPendingWarnings: function () {}
};

{
  var findStrictRoot = function (fiber) {
    var maybeStrictRoot = null;
    var node = fiber;

    while (node !== null) {
      if (node.mode & StrictMode) {
        maybeStrictRoot = node;
      }

      node = node.return;
    }

    return maybeStrictRoot;
  };

  var setToSortedString = function (set) {
    var array = [];
    set.forEach(function (value) {
      array.push(value);
    });
    return array.sort().join(', ');
  };

  var pendingComponentWillMountWarnings = [];
  var pendingUNSAFE_ComponentWillMountWarnings = [];
  var pendingComponentWillReceivePropsWarnings = [];
  var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
  var pendingComponentWillUpdateWarnings = [];
  var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.

  var didWarnAboutUnsafeLifecycles = new Set();

  ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
    // Dedup strategy: Warn once per component.
    if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
      return;
    }

    if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.
    instance.componentWillMount.__suppressDeprecationWarning !== true) {
      pendingComponentWillMountWarnings.push(fiber);
    }

    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {
      pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
    }

    if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
      pendingComponentWillReceivePropsWarnings.push(fiber);
    }

    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
      pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
    }

    if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
      pendingComponentWillUpdateWarnings.push(fiber);
    }

    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {
      pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
    }
  };

  ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
    // We do an initial pass to gather component names
    var componentWillMountUniqueNames = new Set();

    if (pendingComponentWillMountWarnings.length > 0) {
      pendingComponentWillMountWarnings.forEach(function (fiber) {
        componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingComponentWillMountWarnings = [];
    }

    var UNSAFE_componentWillMountUniqueNames = new Set();

    if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
      pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {
        UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingUNSAFE_ComponentWillMountWarnings = [];
    }

    var componentWillReceivePropsUniqueNames = new Set();

    if (pendingComponentWillReceivePropsWarnings.length > 0) {
      pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
        componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingComponentWillReceivePropsWarnings = [];
    }

    var UNSAFE_componentWillReceivePropsUniqueNames = new Set();

    if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
      pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {
        UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
    }

    var componentWillUpdateUniqueNames = new Set();

    if (pendingComponentWillUpdateWarnings.length > 0) {
      pendingComponentWillUpdateWarnings.forEach(function (fiber) {
        componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingComponentWillUpdateWarnings = [];
    }

    var UNSAFE_componentWillUpdateUniqueNames = new Set();

    if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
      pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {
        UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingUNSAFE_ComponentWillUpdateWarnings = [];
    } // Finally, we flush all the warnings
    // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'


    if (UNSAFE_componentWillMountUniqueNames.size > 0) {
      var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);

      error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames);
    }

    if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
      var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);

      error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n' + '\nPlease update the following components: %s', _sortedNames);
    }

    if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
      var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);

      error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2);
    }

    if (componentWillMountUniqueNames.size > 0) {
      var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);

      warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3);
    }

    if (componentWillReceivePropsUniqueNames.size > 0) {
      var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);

      warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4);
    }

    if (componentWillUpdateUniqueNames.size > 0) {
      var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);

      warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5);
    }
  };

  var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.

  var didWarnAboutLegacyContext = new Set();

  ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
    var strictRoot = findStrictRoot(fiber);

    if (strictRoot === null) {
      error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');

      return;
    } // Dedup strategy: Warn once per component.


    if (didWarnAboutLegacyContext.has(fiber.type)) {
      return;
    }

    var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);

    if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
      if (warningsForRoot === undefined) {
        warningsForRoot = [];
        pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
      }

      warningsForRoot.push(fiber);
    }
  };

  ReactStrictModeWarnings.flushLegacyContextWarning = function () {
    pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
      if (fiberArray.length === 0) {
        return;
      }

      var firstFiber = fiberArray[0];
      var uniqueNames = new Set();
      fiberArray.forEach(function (fiber) {
        uniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutLegacyContext.add(fiber.type);
      });
      var sortedNames = setToSortedString(uniqueNames);

      try {
        setCurrentFiber(firstFiber);

        error('Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context', sortedNames);
      } finally {
        resetCurrentFiber();
      }
    });
  };

  ReactStrictModeWarnings.discardPendingWarnings = function () {
    pendingComponentWillMountWarnings = [];
    pendingUNSAFE_ComponentWillMountWarnings = [];
    pendingComponentWillReceivePropsWarnings = [];
    pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
    pendingComponentWillUpdateWarnings = [];
    pendingUNSAFE_ComponentWillUpdateWarnings = [];
    pendingLegacyContextWarning = new Map();
  };
}

function resolveDefaultProps(Component, baseProps) {
  if (Component && Component.defaultProps) {
    // Resolve default props. Taken from ReactElement
    var props = _assign({}, baseProps);

    var defaultProps = Component.defaultProps;

    for (var propName in defaultProps) {
      if (props[propName] === undefined) {
        props[propName] = defaultProps[propName];
      }
    }

    return props;
  }

  return baseProps;
}

// Max 31 bit integer. The max integer size in V8 for 32-bit systems.
// Math.pow(2, 30) - 1
// 0b111111111111111111111111111111
var MAX_SIGNED_31_BIT_INT = 1073741823;

var valueCursor = createCursor(null);
var rendererSigil;

{
  // Use this to detect multiple renderers using the same context
  rendererSigil = {};
}

var currentlyRenderingFiber = null;
var lastContextDependency = null;
var lastContextWithAllBitsObserved = null;
var isDisallowedContextReadInDEV = false;
function resetContextDependencies() {
  // This is called right before React yields execution, to ensure `readContext`
  // cannot be called outside the render phase.
  currentlyRenderingFiber = null;
  lastContextDependency = null;
  lastContextWithAllBitsObserved = null;

  {
    isDisallowedContextReadInDEV = false;
  }
}
function enterDisallowedContextReadInDEV() {
  {
    isDisallowedContextReadInDEV = true;
  }
}
function exitDisallowedContextReadInDEV() {
  {
    isDisallowedContextReadInDEV = false;
  }
}
function pushProvider(providerFiber, nextValue) {
  var context = providerFiber.type._context;

  {
    push(valueCursor, context._currentValue, providerFiber);
    context._currentValue = nextValue;

    {
      if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
        error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');
      }

      context._currentRenderer = rendererSigil;
    }
  }
}
function popProvider(providerFiber) {
  var currentValue = valueCursor.current;
  pop(valueCursor, providerFiber);
  var context = providerFiber.type._context;

  {
    context._currentValue = currentValue;
  }
}
function calculateChangedBits(context, newValue, oldValue) {
  if (objectIs(oldValue, newValue)) {
    // No change
    return 0;
  } else {
    var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;

    {
      if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {
        error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);
      }
    }

    return changedBits | 0;
  }
}
function scheduleWorkOnParentPath(parent, renderLanes) {
  // Update the child lanes of all the ancestors, including the alternates.
  var node = parent;

  while (node !== null) {
    var alternate = node.alternate;

    if (!isSubsetOfLanes(node.childLanes, renderLanes)) {
      node.childLanes = mergeLanes(node.childLanes, renderLanes);

      if (alternate !== null) {
        alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);
      }
    } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) {
      alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);
    } else {
      // Neither alternate was updated, which means the rest of the
      // ancestor path already has sufficient priority.
      break;
    }

    node = node.return;
  }
}
function propagateContextChange(workInProgress, context, changedBits, renderLanes) {
  var fiber = workInProgress.child;

  if (fiber !== null) {
    // Set the return pointer of the child to the work-in-progress fiber.
    fiber.return = workInProgress;
  }

  while (fiber !== null) {
    var nextFiber = void 0; // Visit this fiber.

    var list = fiber.dependencies;

    if (list !== null) {
      nextFiber = fiber.child;
      var dependency = list.firstContext;

      while (dependency !== null) {
        // Check if the context matches.
        if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
          // Match! Schedule an update on this fiber.
          if (fiber.tag === ClassComponent) {
            // Schedule a force update on the work-in-progress.
            var update = createUpdate(NoTimestamp, pickArbitraryLane(renderLanes));
            update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the
            // update to the current fiber, too, which means it will persist even if
            // this render is thrown away. Since it's a race condition, not sure it's
            // worth fixing.

            enqueueUpdate(fiber, update);
          }

          fiber.lanes = mergeLanes(fiber.lanes, renderLanes);
          var alternate = fiber.alternate;

          if (alternate !== null) {
            alternate.lanes = mergeLanes(alternate.lanes, renderLanes);
          }

          scheduleWorkOnParentPath(fiber.return, renderLanes); // Mark the updated lanes on the list, too.

          list.lanes = mergeLanes(list.lanes, renderLanes); // Since we already found a match, we can stop traversing the
          // dependency list.

          break;
        }

        dependency = dependency.next;
      }
    } else if (fiber.tag === ContextProvider) {
      // Don't scan deeper if this is a matching provider
      nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
    } else {
      // Traverse down.
      nextFiber = fiber.child;
    }

    if (nextFiber !== null) {
      // Set the return pointer of the child to the work-in-progress fiber.
      nextFiber.return = fiber;
    } else {
      // No child. Traverse to next sibling.
      nextFiber = fiber;

      while (nextFiber !== null) {
        if (nextFiber === workInProgress) {
          // We're back to the root of this subtree. Exit.
          nextFiber = null;
          break;
        }

        var sibling = nextFiber.sibling;

        if (sibling !== null) {
          // Set the return pointer of the sibling to the work-in-progress fiber.
          sibling.return = nextFiber.return;
          nextFiber = sibling;
          break;
        } // No more siblings. Traverse up.


        nextFiber = nextFiber.return;
      }
    }

    fiber = nextFiber;
  }
}
function prepareToReadContext(workInProgress, renderLanes) {
  currentlyRenderingFiber = workInProgress;
  lastContextDependency = null;
  lastContextWithAllBitsObserved = null;
  var dependencies = workInProgress.dependencies;

  if (dependencies !== null) {
    var firstContext = dependencies.firstContext;

    if (firstContext !== null) {
      if (includesSomeLane(dependencies.lanes, renderLanes)) {
        // Context list has a pending update. Mark that this fiber performed work.
        markWorkInProgressReceivedUpdate();
      } // Reset the work-in-progress list


      dependencies.firstContext = null;
    }
  }
}
function readContext(context, observedBits) {
  {
    // This warning would fire if you read context inside a Hook like useMemo.
    // Unlike the class check below, it's not enforced in production for perf.
    if (isDisallowedContextReadInDEV) {
      error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
    }
  }

  if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else {
    var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.

    if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {
      // Observe all updates.
      lastContextWithAllBitsObserved = context;
      resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
    } else {
      resolvedObservedBits = observedBits;
    }

    var contextItem = {
      context: context,
      observedBits: resolvedObservedBits,
      next: null
    };

    if (lastContextDependency === null) {
      if (!(currentlyRenderingFiber !== null)) {
        {
          throw Error( "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." );
        }
      } // This is the first dependency for this component. Create a new list.


      lastContextDependency = contextItem;
      currentlyRenderingFiber.dependencies = {
        lanes: NoLanes,
        firstContext: contextItem,
        responders: null
      };
    } else {
      // Append a new context item.
      lastContextDependency = lastContextDependency.next = contextItem;
    }
  }

  return  context._currentValue ;
}

var UpdateState = 0;
var ReplaceState = 1;
var ForceUpdate = 2;
var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`.
// It should only be read right after calling `processUpdateQueue`, via
// `checkHasForceUpdateAfterProcessing`.

var hasForceUpdate = false;
var didWarnUpdateInsideUpdate;
var currentlyProcessingQueue;

{
  didWarnUpdateInsideUpdate = false;
  currentlyProcessingQueue = null;
}

function initializeUpdateQueue(fiber) {
  var queue = {
    baseState: fiber.memoizedState,
    firstBaseUpdate: null,
    lastBaseUpdate: null,
    shared: {
      pending: null
    },
    effects: null
  };
  fiber.updateQueue = queue;
}
function cloneUpdateQueue(current, workInProgress) {
  // Clone the update queue from current. Unless it's already a clone.
  var queue = workInProgress.updateQueue;
  var currentQueue = current.updateQueue;

  if (queue === currentQueue) {
    var clone = {
      baseState: currentQueue.baseState,
      firstBaseUpdate: currentQueue.firstBaseUpdate,
      lastBaseUpdate: currentQueue.lastBaseUpdate,
      shared: currentQueue.shared,
      effects: currentQueue.effects
    };
    workInProgress.updateQueue = clone;
  }
}
function createUpdate(eventTime, lane) {
  var update = {
    eventTime: eventTime,
    lane: lane,
    tag: UpdateState,
    payload: null,
    callback: null,
    next: null
  };
  return update;
}
function enqueueUpdate(fiber, update) {
  var updateQueue = fiber.updateQueue;

  if (updateQueue === null) {
    // Only occurs if the fiber has been unmounted.
    return;
  }

  var sharedQueue = updateQueue.shared;
  var pending = sharedQueue.pending;

  if (pending === null) {
    // This is the first update. Create a circular list.
    update.next = update;
  } else {
    update.next = pending.next;
    pending.next = update;
  }

  sharedQueue.pending = update;

  {
    if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
      error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');

      didWarnUpdateInsideUpdate = true;
    }
  }
}
function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
  // Captured updates are updates that are thrown by a child during the render
  // phase. They should be discarded if the render is aborted. Therefore,
  // we should only put them on the work-in-progress queue, not the current one.
  var queue = workInProgress.updateQueue; // Check if the work-in-progress queue is a clone.

  var current = workInProgress.alternate;

  if (current !== null) {
    var currentQueue = current.updateQueue;

    if (queue === currentQueue) {
      // The work-in-progress queue is the same as current. This happens when
      // we bail out on a parent fiber that then captures an error thrown by
      // a child. Since we want to append the update only to the work-in
      // -progress queue, we need to clone the updates. We usually clone during
      // processUpdateQueue, but that didn't happen in this case because we
      // skipped over the parent when we bailed out.
      var newFirst = null;
      var newLast = null;
      var firstBaseUpdate = queue.firstBaseUpdate;

      if (firstBaseUpdate !== null) {
        // Loop through the updates and clone them.
        var update = firstBaseUpdate;

        do {
          var clone = {
            eventTime: update.eventTime,
            lane: update.lane,
            tag: update.tag,
            payload: update.payload,
            callback: update.callback,
            next: null
          };

          if (newLast === null) {
            newFirst = newLast = clone;
          } else {
            newLast.next = clone;
            newLast = clone;
          }

          update = update.next;
        } while (update !== null); // Append the captured update the end of the cloned list.


        if (newLast === null) {
          newFirst = newLast = capturedUpdate;
        } else {
          newLast.next = capturedUpdate;
          newLast = capturedUpdate;
        }
      } else {
        // There are no base updates.
        newFirst = newLast = capturedUpdate;
      }

      queue = {
        baseState: currentQueue.baseState,
        firstBaseUpdate: newFirst,
        lastBaseUpdate: newLast,
        shared: currentQueue.shared,
        effects: currentQueue.effects
      };
      workInProgress.updateQueue = queue;
      return;
    }
  } // Append the update to the end of the list.


  var lastBaseUpdate = queue.lastBaseUpdate;

  if (lastBaseUpdate === null) {
    queue.firstBaseUpdate = capturedUpdate;
  } else {
    lastBaseUpdate.next = capturedUpdate;
  }

  queue.lastBaseUpdate = capturedUpdate;
}

function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
  switch (update.tag) {
    case ReplaceState:
      {
        var payload = update.payload;

        if (typeof payload === 'function') {
          // Updater function
          {
            enterDisallowedContextReadInDEV();
          }

          var nextState = payload.call(instance, prevState, nextProps);

          {
            if ( workInProgress.mode & StrictMode) {
              disableLogs();

              try {
                payload.call(instance, prevState, nextProps);
              } finally {
                reenableLogs();
              }
            }

            exitDisallowedContextReadInDEV();
          }

          return nextState;
        } // State object


        return payload;
      }

    case CaptureUpdate:
      {
        workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture;
      }
    // Intentional fallthrough

    case UpdateState:
      {
        var _payload = update.payload;
        var partialState;

        if (typeof _payload === 'function') {
          // Updater function
          {
            enterDisallowedContextReadInDEV();
          }

          partialState = _payload.call(instance, prevState, nextProps);

          {
            if ( workInProgress.mode & StrictMode) {
              disableLogs();

              try {
                _payload.call(instance, prevState, nextProps);
              } finally {
                reenableLogs();
              }
            }

            exitDisallowedContextReadInDEV();
          }
        } else {
          // Partial state object
          partialState = _payload;
        }

        if (partialState === null || partialState === undefined) {
          // Null and undefined are treated as no-ops.
          return prevState;
        } // Merge the partial state and the previous state.


        return _assign({}, prevState, partialState);
      }

    case ForceUpdate:
      {
        hasForceUpdate = true;
        return prevState;
      }
  }

  return prevState;
}

function processUpdateQueue(workInProgress, props, instance, renderLanes) {
  // This is always non-null on a ClassComponent or HostRoot
  var queue = workInProgress.updateQueue;
  hasForceUpdate = false;

  {
    currentlyProcessingQueue = queue.shared;
  }

  var firstBaseUpdate = queue.firstBaseUpdate;
  var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue.

  var pendingQueue = queue.shared.pending;

  if (pendingQueue !== null) {
    queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first
    // and last so that it's non-circular.

    var lastPendingUpdate = pendingQueue;
    var firstPendingUpdate = lastPendingUpdate.next;
    lastPendingUpdate.next = null; // Append pending updates to base queue

    if (lastBaseUpdate === null) {
      firstBaseUpdate = firstPendingUpdate;
    } else {
      lastBaseUpdate.next = firstPendingUpdate;
    }

    lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then
    // we need to transfer the updates to that queue, too. Because the base
    // queue is a singly-linked list with no cycles, we can append to both
    // lists and take advantage of structural sharing.
    // TODO: Pass `current` as argument

    var current = workInProgress.alternate;

    if (current !== null) {
      // This is always non-null on a ClassComponent or HostRoot
      var currentQueue = current.updateQueue;
      var currentLastBaseUpdate = currentQueue.lastBaseUpdate;

      if (currentLastBaseUpdate !== lastBaseUpdate) {
        if (currentLastBaseUpdate === null) {
          currentQueue.firstBaseUpdate = firstPendingUpdate;
        } else {
          currentLastBaseUpdate.next = firstPendingUpdate;
        }

        currentQueue.lastBaseUpdate = lastPendingUpdate;
      }
    }
  } // These values may change as we process the queue.


  if (firstBaseUpdate !== null) {
    // Iterate through the list of updates to compute the result.
    var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes
    // from the original lanes.

    var newLanes = NoLanes;
    var newBaseState = null;
    var newFirstBaseUpdate = null;
    var newLastBaseUpdate = null;
    var update = firstBaseUpdate;

    do {
      var updateLane = update.lane;
      var updateEventTime = update.eventTime;

      if (!isSubsetOfLanes(renderLanes, updateLane)) {
        // Priority is insufficient. Skip this update. If this is the first
        // skipped update, the previous update/state is the new base
        // update/state.
        var clone = {
          eventTime: updateEventTime,
          lane: updateLane,
          tag: update.tag,
          payload: update.payload,
          callback: update.callback,
          next: null
        };

        if (newLastBaseUpdate === null) {
          newFirstBaseUpdate = newLastBaseUpdate = clone;
          newBaseState = newState;
        } else {
          newLastBaseUpdate = newLastBaseUpdate.next = clone;
        } // Update the remaining priority in the queue.


        newLanes = mergeLanes(newLanes, updateLane);
      } else {
        // This update does have sufficient priority.
        if (newLastBaseUpdate !== null) {
          var _clone = {
            eventTime: updateEventTime,
            // This update is going to be committed so we never want uncommit
            // it. Using NoLane works because 0 is a subset of all bitmasks, so
            // this will never be skipped by the check above.
            lane: NoLane,
            tag: update.tag,
            payload: update.payload,
            callback: update.callback,
            next: null
          };
          newLastBaseUpdate = newLastBaseUpdate.next = _clone;
        } // Process this update.


        newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);
        var callback = update.callback;

        if (callback !== null) {
          workInProgress.flags |= Callback;
          var effects = queue.effects;

          if (effects === null) {
            queue.effects = [update];
          } else {
            effects.push(update);
          }
        }
      }

      update = update.next;

      if (update === null) {
        pendingQueue = queue.shared.pending;

        if (pendingQueue === null) {
          break;
        } else {
          // An update was scheduled from inside a reducer. Add the new
          // pending updates to the end of the list and keep processing.
          var _lastPendingUpdate = pendingQueue; // Intentionally unsound. Pending updates form a circular list, but we
          // unravel them when transferring them to the base queue.

          var _firstPendingUpdate = _lastPendingUpdate.next;
          _lastPendingUpdate.next = null;
          update = _firstPendingUpdate;
          queue.lastBaseUpdate = _lastPendingUpdate;
          queue.shared.pending = null;
        }
      }
    } while (true);

    if (newLastBaseUpdate === null) {
      newBaseState = newState;
    }

    queue.baseState = newBaseState;
    queue.firstBaseUpdate = newFirstBaseUpdate;
    queue.lastBaseUpdate = newLastBaseUpdate; // Set the remaining expiration time to be whatever is remaining in the queue.
    // This should be fine because the only two other things that contribute to
    // expiration time are props and context. We're already in the middle of the
    // begin phase by the time we start processing the queue, so we've already
    // dealt with the props. Context in components that specify
    // shouldComponentUpdate is tricky; but we'll have to account for
    // that regardless.

    markSkippedUpdateLanes(newLanes);
    workInProgress.lanes = newLanes;
    workInProgress.memoizedState = newState;
  }

  {
    currentlyProcessingQueue = null;
  }
}

function callCallback(callback, context) {
  if (!(typeof callback === 'function')) {
    {
      throw Error( "Invalid argument passed as callback. Expected a function. Instead received: " + callback );
    }
  }

  callback.call(context);
}

function resetHasForceUpdateBeforeProcessing() {
  hasForceUpdate = false;
}
function checkHasForceUpdateAfterProcessing() {
  return hasForceUpdate;
}
function commitUpdateQueue(finishedWork, finishedQueue, instance) {
  // Commit the effects
  var effects = finishedQueue.effects;
  finishedQueue.effects = null;

  if (effects !== null) {
    for (var i = 0; i < effects.length; i++) {
      var effect = effects[i];
      var callback = effect.callback;

      if (callback !== null) {
        effect.callback = null;
        callCallback(callback, instance);
      }
    }
  }
}

var fakeInternalInstance = {};
var isArray = Array.isArray; // React.Component uses a shared frozen object by default.
// We'll use it to determine whether we need to initialize legacy refs.

var emptyRefsObject = new React.Component().refs;
var didWarnAboutStateAssignmentForComponent;
var didWarnAboutUninitializedState;
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
var didWarnAboutLegacyLifecyclesAndDerivedState;
var didWarnAboutUndefinedDerivedState;
var warnOnUndefinedDerivedState;
var warnOnInvalidCallback;
var didWarnAboutDirectlyAssigningPropsToState;
var didWarnAboutContextTypeAndContextTypes;
var didWarnAboutInvalidateContextType;

{
  didWarnAboutStateAssignmentForComponent = new Set();
  didWarnAboutUninitializedState = new Set();
  didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
  didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
  didWarnAboutDirectlyAssigningPropsToState = new Set();
  didWarnAboutUndefinedDerivedState = new Set();
  didWarnAboutContextTypeAndContextTypes = new Set();
  didWarnAboutInvalidateContextType = new Set();
  var didWarnOnInvalidCallback = new Set();

  warnOnInvalidCallback = function (callback, callerName) {
    if (callback === null || typeof callback === 'function') {
      return;
    }

    var key = callerName + '_' + callback;

    if (!didWarnOnInvalidCallback.has(key)) {
      didWarnOnInvalidCallback.add(key);

      error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
    }
  };

  warnOnUndefinedDerivedState = function (type, partialState) {
    if (partialState === undefined) {
      var componentName = getComponentName(type) || 'Component';

      if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
        didWarnAboutUndefinedDerivedState.add(componentName);

        error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
      }
    }
  }; // This is so gross but it's at least non-critical and can be removed if
  // it causes problems. This is meant to give a nicer error message for
  // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,
  // ...)) which otherwise throws a "_processChildContext is not a function"
  // exception.


  Object.defineProperty(fakeInternalInstance, '_processChildContext', {
    enumerable: false,
    value: function () {
      {
        {
          throw Error( "_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal)." );
        }
      }
    }
  });
  Object.freeze(fakeInternalInstance);
}

function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
  var prevState = workInProgress.memoizedState;

  {
    if ( workInProgress.mode & StrictMode) {
      disableLogs();

      try {
        // Invoke the function an extra time to help detect side-effects.
        getDerivedStateFromProps(nextProps, prevState);
      } finally {
        reenableLogs();
      }
    }
  }

  var partialState = getDerivedStateFromProps(nextProps, prevState);

  {
    warnOnUndefinedDerivedState(ctor, partialState);
  } // Merge the partial state and the previous state.


  var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
  workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the
  // base state.

  if (workInProgress.lanes === NoLanes) {
    // Queue is always non-null for classes
    var updateQueue = workInProgress.updateQueue;
    updateQueue.baseState = memoizedState;
  }
}
var classComponentUpdater = {
  isMounted: isMounted,
  enqueueSetState: function (inst, payload, callback) {
    var fiber = get(inst);
    var eventTime = requestEventTime();
    var lane = requestUpdateLane(fiber);
    var update = createUpdate(eventTime, lane);
    update.payload = payload;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback(callback, 'setState');
      }

      update.callback = callback;
    }

    enqueueUpdate(fiber, update);
    scheduleUpdateOnFiber(fiber, lane, eventTime);
  },
  enqueueReplaceState: function (inst, payload, callback) {
    var fiber = get(inst);
    var eventTime = requestEventTime();
    var lane = requestUpdateLane(fiber);
    var update = createUpdate(eventTime, lane);
    update.tag = ReplaceState;
    update.payload = payload;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback(callback, 'replaceState');
      }

      update.callback = callback;
    }

    enqueueUpdate(fiber, update);
    scheduleUpdateOnFiber(fiber, lane, eventTime);
  },
  enqueueForceUpdate: function (inst, callback) {
    var fiber = get(inst);
    var eventTime = requestEventTime();
    var lane = requestUpdateLane(fiber);
    var update = createUpdate(eventTime, lane);
    update.tag = ForceUpdate;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback(callback, 'forceUpdate');
      }

      update.callback = callback;
    }

    enqueueUpdate(fiber, update);
    scheduleUpdateOnFiber(fiber, lane, eventTime);
  }
};

function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
  var instance = workInProgress.stateNode;

  if (typeof instance.shouldComponentUpdate === 'function') {
    {
      if ( workInProgress.mode & StrictMode) {
        disableLogs();

        try {
          // Invoke the function an extra time to help detect side-effects.
          instance.shouldComponentUpdate(newProps, newState, nextContext);
        } finally {
          reenableLogs();
        }
      }
    }

    var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);

    {
      if (shouldUpdate === undefined) {
        error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component');
      }
    }

    return shouldUpdate;
  }

  if (ctor.prototype && ctor.prototype.isPureReactComponent) {
    return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
  }

  return true;
}

function checkClassInstance(workInProgress, ctor, newProps) {
  var instance = workInProgress.stateNode;

  {
    var name = getComponentName(ctor) || 'Component';
    var renderPresent = instance.render;

    if (!renderPresent) {
      if (ctor.prototype && typeof ctor.prototype.render === 'function') {
        error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
      } else {
        error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
      }
    }

    if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
      error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);
    }

    if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
      error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);
    }

    if (instance.propTypes) {
      error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);
    }

    if (instance.contextType) {
      error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);
    }

    {
      if (instance.contextTypes) {
        error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);
      }

      if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
        didWarnAboutContextTypeAndContextTypes.add(ctor);

        error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
      }
    }

    if (typeof instance.componentShouldUpdate === 'function') {
      error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);
    }

    if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
      error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
    }

    if (typeof instance.componentDidUnmount === 'function') {
      error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);
    }

    if (typeof instance.componentDidReceiveProps === 'function') {
      error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);
    }

    if (typeof instance.componentWillRecieveProps === 'function') {
      error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);
    }

    if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {
      error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);
    }

    var hasMutatedProps = instance.props !== newProps;

    if (instance.props !== undefined && hasMutatedProps) {
      error('%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name);
    }

    if (instance.defaultProps) {
      error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);
    }

    if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
      didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);

      error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
    }

    if (typeof instance.getDerivedStateFromProps === 'function') {
      error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);
    }

    if (typeof instance.getDerivedStateFromError === 'function') {
      error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);
    }

    if (typeof ctor.getSnapshotBeforeUpdate === 'function') {
      error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);
    }

    var _state = instance.state;

    if (_state && (typeof _state !== 'object' || isArray(_state))) {
      error('%s.state: must be set to an object or null', name);
    }

    if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') {
      error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);
    }
  }
}

function adoptClassInstance(workInProgress, instance) {
  instance.updater = classComponentUpdater;
  workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates

  set(instance, workInProgress);

  {
    instance._reactInternalInstance = fakeInternalInstance;
  }
}

function constructClassInstance(workInProgress, ctor, props) {
  var isLegacyContextConsumer = false;
  var unmaskedContext = emptyContextObject;
  var context = emptyContextObject;
  var contextType = ctor.contextType;

  {
    if ('contextType' in ctor) {
      var isValid = // Allow null for conditional declaration
      contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>

      if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
        didWarnAboutInvalidateContextType.add(ctor);
        var addendum = '';

        if (contextType === undefined) {
          addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
        } else if (typeof contextType !== 'object') {
          addendum = ' However, it is set to a ' + typeof contextType + '.';
        } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
          addendum = ' Did you accidentally pass the Context.Provider instead?';
        } else if (contextType._context !== undefined) {
          // <Context.Consumer>
          addendum = ' Did you accidentally pass the Context.Consumer instead?';
        } else {
          addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
        }

        error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);
      }
    }
  }

  if (typeof contextType === 'object' && contextType !== null) {
    context = readContext(contextType);
  } else {
    unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    var contextTypes = ctor.contextTypes;
    isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
    context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
  } // Instantiate twice to help detect side-effects.


  {
    if ( workInProgress.mode & StrictMode) {
      disableLogs();

      try {
        new ctor(props, context); // eslint-disable-line no-new
      } finally {
        reenableLogs();
      }
    }
  }

  var instance = new ctor(props, context);
  var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
  adoptClassInstance(workInProgress, instance);

  {
    if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
      var componentName = getComponentName(ctor) || 'Component';

      if (!didWarnAboutUninitializedState.has(componentName)) {
        didWarnAboutUninitializedState.add(componentName);

        error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);
      }
    } // If new component APIs are defined, "unsafe" lifecycles won't be called.
    // Warn about these lifecycles if they are present.
    // Don't warn about react-lifecycles-compat polyfilled methods though.


    if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
      var foundWillMountName = null;
      var foundWillReceivePropsName = null;
      var foundWillUpdateName = null;

      if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
        foundWillMountName = 'componentWillMount';
      } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
        foundWillMountName = 'UNSAFE_componentWillMount';
      }

      if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
        foundWillReceivePropsName = 'componentWillReceiveProps';
      } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
        foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
      }

      if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
        foundWillUpdateName = 'componentWillUpdate';
      } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
        foundWillUpdateName = 'UNSAFE_componentWillUpdate';
      }

      if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
        var _componentName = getComponentName(ctor) || 'Component';

        var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';

        if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
          didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);

          error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://reactjs.org/link/unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n  " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n  " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n  " + foundWillUpdateName : '');
        }
      }
    }
  } // Cache unmasked context so we can avoid recreating masked context unless necessary.
  // ReactFiberContext usually updates this cache but can't for newly-created instances.


  if (isLegacyContextConsumer) {
    cacheContext(workInProgress, unmaskedContext, context);
  }

  return instance;
}

function callComponentWillMount(workInProgress, instance) {
  var oldState = instance.state;

  if (typeof instance.componentWillMount === 'function') {
    instance.componentWillMount();
  }

  if (typeof instance.UNSAFE_componentWillMount === 'function') {
    instance.UNSAFE_componentWillMount();
  }

  if (oldState !== instance.state) {
    {
      error('%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
    }

    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  }
}

function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
  var oldState = instance.state;

  if (typeof instance.componentWillReceiveProps === 'function') {
    instance.componentWillReceiveProps(newProps, nextContext);
  }

  if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
    instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  }

  if (instance.state !== oldState) {
    {
      var componentName = getComponentName(workInProgress.type) || 'Component';

      if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
        didWarnAboutStateAssignmentForComponent.add(componentName);

        error('%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
      }
    }

    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  }
} // Invokes the mount life-cycles on a previously never rendered instance.


function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
  {
    checkClassInstance(workInProgress, ctor, newProps);
  }

  var instance = workInProgress.stateNode;
  instance.props = newProps;
  instance.state = workInProgress.memoizedState;
  instance.refs = emptyRefsObject;
  initializeUpdateQueue(workInProgress);
  var contextType = ctor.contextType;

  if (typeof contextType === 'object' && contextType !== null) {
    instance.context = readContext(contextType);
  } else {
    var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    instance.context = getMaskedContext(workInProgress, unmaskedContext);
  }

  {
    if (instance.state === newProps) {
      var componentName = getComponentName(ctor) || 'Component';

      if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
        didWarnAboutDirectlyAssigningPropsToState.add(componentName);

        error('%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
      }
    }

    if (workInProgress.mode & StrictMode) {
      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
    }

    {
      ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
    }
  }

  processUpdateQueue(workInProgress, newProps, instance, renderLanes);
  instance.state = workInProgress.memoizedState;
  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    instance.state = workInProgress.memoizedState;
  } // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.


  if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
    callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's
    // process them now.

    processUpdateQueue(workInProgress, newProps, instance, renderLanes);
    instance.state = workInProgress.memoizedState;
  }

  if (typeof instance.componentDidMount === 'function') {
    workInProgress.flags |= Update;
  }
}

function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {
  var instance = workInProgress.stateNode;
  var oldProps = workInProgress.memoizedProps;
  instance.props = oldProps;
  var oldContext = instance.context;
  var contextType = ctor.contextType;
  var nextContext = emptyContextObject;

  if (typeof contextType === 'object' && contextType !== null) {
    nextContext = readContext(contextType);
  } else {
    var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
  // ever the previously attempted to render - not the "current". However,
  // during componentDidUpdate we pass the "current" props.
  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.

  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
    if (oldProps !== newProps || oldContext !== nextContext) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
    }
  }

  resetHasForceUpdateBeforeProcessing();
  var oldState = workInProgress.memoizedState;
  var newState = instance.state = oldState;
  processUpdateQueue(workInProgress, newProps, instance, renderLanes);
  newState = workInProgress.memoizedState;

  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.flags |= Update;
    }

    return false;
  }

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    newState = workInProgress.memoizedState;
  }

  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);

  if (shouldUpdate) {
    // In order to support react-lifecycles-compat polyfilled components,
    // Unsafe lifecycles should not be invoked for components using the new APIs.
    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
      if (typeof instance.componentWillMount === 'function') {
        instance.componentWillMount();
      }

      if (typeof instance.UNSAFE_componentWillMount === 'function') {
        instance.UNSAFE_componentWillMount();
      }
    }

    if (typeof instance.componentDidMount === 'function') {
      workInProgress.flags |= Update;
    }
  } else {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.flags |= Update;
    } // If shouldComponentUpdate returned false, we should still update the
    // memoized state to indicate that this work can be reused.


    workInProgress.memoizedProps = newProps;
    workInProgress.memoizedState = newState;
  } // Update the existing instance's state, props, and context pointers even
  // if shouldComponentUpdate returns false.


  instance.props = newProps;
  instance.state = newState;
  instance.context = nextContext;
  return shouldUpdate;
} // Invokes the update life-cycles and returns false if it shouldn't rerender.


function updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) {
  var instance = workInProgress.stateNode;
  cloneUpdateQueue(current, workInProgress);
  var unresolvedOldProps = workInProgress.memoizedProps;
  var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps);
  instance.props = oldProps;
  var unresolvedNewProps = workInProgress.pendingProps;
  var oldContext = instance.context;
  var contextType = ctor.contextType;
  var nextContext = emptyContextObject;

  if (typeof contextType === 'object' && contextType !== null) {
    nextContext = readContext(contextType);
  } else {
    var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
  // ever the previously attempted to render - not the "current". However,
  // during componentDidUpdate we pass the "current" props.
  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.

  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
    if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
    }
  }

  resetHasForceUpdateBeforeProcessing();
  var oldState = workInProgress.memoizedState;
  var newState = instance.state = oldState;
  processUpdateQueue(workInProgress, newProps, instance, renderLanes);
  newState = workInProgress.memoizedState;

  if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.flags |= Update;
      }
    }

    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.flags |= Snapshot;
      }
    }

    return false;
  }

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    newState = workInProgress.memoizedState;
  }

  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);

  if (shouldUpdate) {
    // In order to support react-lifecycles-compat polyfilled components,
    // Unsafe lifecycles should not be invoked for components using the new APIs.
    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
      if (typeof instance.componentWillUpdate === 'function') {
        instance.componentWillUpdate(newProps, newState, nextContext);
      }

      if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
        instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
      }
    }

    if (typeof instance.componentDidUpdate === 'function') {
      workInProgress.flags |= Update;
    }

    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      workInProgress.flags |= Snapshot;
    }
  } else {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.flags |= Update;
      }
    }

    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.flags |= Snapshot;
      }
    } // If shouldComponentUpdate returned false, we should still update the
    // memoized props/state to indicate that this work can be reused.


    workInProgress.memoizedProps = newProps;
    workInProgress.memoizedState = newState;
  } // Update the existing instance's state, props, and context pointers even
  // if shouldComponentUpdate returns false.


  instance.props = newProps;
  instance.state = newState;
  instance.context = nextContext;
  return shouldUpdate;
}

var didWarnAboutMaps;
var didWarnAboutGenerators;
var didWarnAboutStringRefs;
var ownerHasKeyUseWarning;
var ownerHasFunctionTypeWarning;

var warnForMissingKey = function (child, returnFiber) {};

{
  didWarnAboutMaps = false;
  didWarnAboutGenerators = false;
  didWarnAboutStringRefs = {};
  /**
   * Warn if there's no key explicitly set on dynamic arrays of children or
   * object keys are not valid. This allows us to keep track of children between
   * updates.
   */

  ownerHasKeyUseWarning = {};
  ownerHasFunctionTypeWarning = {};

  warnForMissingKey = function (child, returnFiber) {
    if (child === null || typeof child !== 'object') {
      return;
    }

    if (!child._store || child._store.validated || child.key != null) {
      return;
    }

    if (!(typeof child._store === 'object')) {
      {
        throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    child._store.validated = true;
    var componentName = getComponentName(returnFiber.type) || 'Component';

    if (ownerHasKeyUseWarning[componentName]) {
      return;
    }

    ownerHasKeyUseWarning[componentName] = true;

    error('Each child in a list should have a unique ' + '"key" prop. See https://reactjs.org/link/warning-keys for ' + 'more information.');
  };
}

var isArray$1 = Array.isArray;

function coerceRef(returnFiber, current, element) {
  var mixedRef = element.ref;

  if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
    {
      // TODO: Clean this up once we turn on the string ref warning for
      // everyone, because the strict mode case will no longer be relevant
      if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
      // because these cannot be automatically converted to an arrow function
      // using a codemod. Therefore, we don't have to warn about string refs again.
      !(element._owner && element._self && element._owner.stateNode !== element._self)) {
        var componentName = getComponentName(returnFiber.type) || 'Component';

        if (!didWarnAboutStringRefs[componentName]) {
          {
            error('A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', mixedRef);
          }

          didWarnAboutStringRefs[componentName] = true;
        }
      }
    }

    if (element._owner) {
      var owner = element._owner;
      var inst;

      if (owner) {
        var ownerFiber = owner;

        if (!(ownerFiber.tag === ClassComponent)) {
          {
            throw Error( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref" );
          }
        }

        inst = ownerFiber.stateNode;
      }

      if (!inst) {
        {
          throw Error( "Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue." );
        }
      }

      var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref

      if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {
        return current.ref;
      }

      var ref = function (value) {
        var refs = inst.refs;

        if (refs === emptyRefsObject) {
          // This is a lazy pooled frozen object, so we need to initialize.
          refs = inst.refs = {};
        }

        if (value === null) {
          delete refs[stringRef];
        } else {
          refs[stringRef] = value;
        }
      };

      ref._stringRef = stringRef;
      return ref;
    } else {
      if (!(typeof mixedRef === 'string')) {
        {
          throw Error( "Expected ref to be a function, a string, an object returned by React.createRef(), or null." );
        }
      }

      if (!element._owner) {
        {
          throw Error( "Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information." );
        }
      }
    }
  }

  return mixedRef;
}

function throwOnInvalidObjectType(returnFiber, newChild) {
  if (returnFiber.type !== 'textarea') {
    {
      {
        throw Error( "Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + "). If you meant to render a collection of children, use an array instead." );
      }
    }
  }
}

function warnOnFunctionType(returnFiber) {
  {
    var componentName = getComponentName(returnFiber.type) || 'Component';

    if (ownerHasFunctionTypeWarning[componentName]) {
      return;
    }

    ownerHasFunctionTypeWarning[componentName] = true;

    error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
  }
} // We avoid inlining this to avoid potential deopts from using try/catch.
// to be able to optimize each path individually by branching early. This needs
// a compiler or we can do it manually. Helpers that don't need this branching
// live outside of this function.


function ChildReconciler(shouldTrackSideEffects) {
  function deleteChild(returnFiber, childToDelete) {
    if (!shouldTrackSideEffects) {
      // Noop.
      return;
    } // Deletions are added in reversed order so we add it to the front.
    // At this point, the return fiber's effect list is empty except for
    // deletions, so we can just append the deletion to the list. The remaining
    // effects aren't added until the complete phase. Once we implement
    // resuming, this may not be true.


    var last = returnFiber.lastEffect;

    if (last !== null) {
      last.nextEffect = childToDelete;
      returnFiber.lastEffect = childToDelete;
    } else {
      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
    }

    childToDelete.nextEffect = null;
    childToDelete.flags = Deletion;
  }

  function deleteRemainingChildren(returnFiber, currentFirstChild) {
    if (!shouldTrackSideEffects) {
      // Noop.
      return null;
    } // TODO: For the shouldClone case, this could be micro-optimized a bit by
    // assuming that after the first child we've already added everything.


    var childToDelete = currentFirstChild;

    while (childToDelete !== null) {
      deleteChild(returnFiber, childToDelete);
      childToDelete = childToDelete.sibling;
    }

    return null;
  }

  function mapRemainingChildren(returnFiber, currentFirstChild) {
    // Add the remaining children to a temporary map so that we can find them by
    // keys quickly. Implicit (null) keys get added to this set with their index
    // instead.
    var existingChildren = new Map();
    var existingChild = currentFirstChild;

    while (existingChild !== null) {
      if (existingChild.key !== null) {
        existingChildren.set(existingChild.key, existingChild);
      } else {
        existingChildren.set(existingChild.index, existingChild);
      }

      existingChild = existingChild.sibling;
    }

    return existingChildren;
  }

  function useFiber(fiber, pendingProps) {
    // We currently set sibling to null and index to 0 here because it is easy
    // to forget to do before returning it. E.g. for the single child case.
    var clone = createWorkInProgress(fiber, pendingProps);
    clone.index = 0;
    clone.sibling = null;
    return clone;
  }

  function placeChild(newFiber, lastPlacedIndex, newIndex) {
    newFiber.index = newIndex;

    if (!shouldTrackSideEffects) {
      // Noop.
      return lastPlacedIndex;
    }

    var current = newFiber.alternate;

    if (current !== null) {
      var oldIndex = current.index;

      if (oldIndex < lastPlacedIndex) {
        // This is a move.
        newFiber.flags = Placement;
        return lastPlacedIndex;
      } else {
        // This item can stay in place.
        return oldIndex;
      }
    } else {
      // This is an insertion.
      newFiber.flags = Placement;
      return lastPlacedIndex;
    }
  }

  function placeSingleChild(newFiber) {
    // This is simpler for the single child case. We only need to do a
    // placement for inserting new children.
    if (shouldTrackSideEffects && newFiber.alternate === null) {
      newFiber.flags = Placement;
    }

    return newFiber;
  }

  function updateTextNode(returnFiber, current, textContent, lanes) {
    if (current === null || current.tag !== HostText) {
      // Insert
      var created = createFiberFromText(textContent, returnFiber.mode, lanes);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current, textContent);
      existing.return = returnFiber;
      return existing;
    }
  }

  function updateElement(returnFiber, current, element, lanes) {
    if (current !== null) {
      if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
       isCompatibleFamilyForHotReloading(current, element) )) {
        // Move based on index
        var existing = useFiber(current, element.props);
        existing.ref = coerceRef(returnFiber, current, element);
        existing.return = returnFiber;

        {
          existing._debugSource = element._source;
          existing._debugOwner = element._owner;
        }

        return existing;
      }
    } // Insert


    var created = createFiberFromElement(element, returnFiber.mode, lanes);
    created.ref = coerceRef(returnFiber, current, element);
    created.return = returnFiber;
    return created;
  }

  function updatePortal(returnFiber, current, portal, lanes) {
    if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {
      // Insert
      var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current, portal.children || []);
      existing.return = returnFiber;
      return existing;
    }
  }

  function updateFragment(returnFiber, current, fragment, lanes, key) {
    if (current === null || current.tag !== Fragment) {
      // Insert
      var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current, fragment);
      existing.return = returnFiber;
      return existing;
    }
  }

  function createChild(returnFiber, newChild, lanes) {
    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys. If the previous node is implicitly keyed
      // we can continue to replace it without aborting even if it is not a text
      // node.
      var created = createFiberFromText('' + newChild, returnFiber.mode, lanes);
      created.return = returnFiber;
      return created;
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);

            _created.ref = coerceRef(returnFiber, null, newChild);
            _created.return = returnFiber;
            return _created;
          }

        case REACT_PORTAL_TYPE:
          {
            var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);

            _created2.return = returnFiber;
            return _created2;
          }
      }

      if (isArray$1(newChild) || getIteratorFn(newChild)) {
        var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);

        _created3.return = returnFiber;
        return _created3;
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType(returnFiber);
      }
    }

    return null;
  }

  function updateSlot(returnFiber, oldFiber, newChild, lanes) {
    // Update the fiber if the keys match, otherwise return null.
    var key = oldFiber !== null ? oldFiber.key : null;

    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys. If the previous node is implicitly keyed
      // we can continue to replace it without aborting even if it is not a text
      // node.
      if (key !== null) {
        return null;
      }

      return updateTextNode(returnFiber, oldFiber, '' + newChild, lanes);
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            if (newChild.key === key) {
              if (newChild.type === REACT_FRAGMENT_TYPE) {
                return updateFragment(returnFiber, oldFiber, newChild.props.children, lanes, key);
              }

              return updateElement(returnFiber, oldFiber, newChild, lanes);
            } else {
              return null;
            }
          }

        case REACT_PORTAL_TYPE:
          {
            if (newChild.key === key) {
              return updatePortal(returnFiber, oldFiber, newChild, lanes);
            } else {
              return null;
            }
          }
      }

      if (isArray$1(newChild) || getIteratorFn(newChild)) {
        if (key !== null) {
          return null;
        }

        return updateFragment(returnFiber, oldFiber, newChild, lanes, null);
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType(returnFiber);
      }
    }

    return null;
  }

  function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys, so we neither have to check the old nor
      // new node for the key. If both are text nodes, they match.
      var matchedFiber = existingChildren.get(newIdx) || null;
      return updateTextNode(returnFiber, matchedFiber, '' + newChild, lanes);
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;

            if (newChild.type === REACT_FRAGMENT_TYPE) {
              return updateFragment(returnFiber, _matchedFiber, newChild.props.children, lanes, newChild.key);
            }

            return updateElement(returnFiber, _matchedFiber, newChild, lanes);
          }

        case REACT_PORTAL_TYPE:
          {
            var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;

            return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
          }

      }

      if (isArray$1(newChild) || getIteratorFn(newChild)) {
        var _matchedFiber3 = existingChildren.get(newIdx) || null;

        return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null);
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType(returnFiber);
      }
    }

    return null;
  }
  /**
   * Warns if there is a duplicate or missing key
   */


  function warnOnInvalidKey(child, knownKeys, returnFiber) {
    {
      if (typeof child !== 'object' || child === null) {
        return knownKeys;
      }

      switch (child.$$typeof) {
        case REACT_ELEMENT_TYPE:
        case REACT_PORTAL_TYPE:
          warnForMissingKey(child, returnFiber);
          var key = child.key;

          if (typeof key !== 'string') {
            break;
          }

          if (knownKeys === null) {
            knownKeys = new Set();
            knownKeys.add(key);
            break;
          }

          if (!knownKeys.has(key)) {
            knownKeys.add(key);
            break;
          }

          error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);

          break;
      }
    }

    return knownKeys;
  }

  function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
    // This algorithm can't optimize by searching from both ends since we
    // don't have backpointers on fibers. I'm trying to see how far we can get
    // with that model. If it ends up not being worth the tradeoffs, we can
    // add it later.
    // Even with a two ended optimization, we'd want to optimize for the case
    // where there are few changes and brute force the comparison instead of
    // going for the Map. It'd like to explore hitting that path first in
    // forward-only mode and only go for the Map once we notice that we need
    // lots of look ahead. This doesn't handle reversal as well as two ended
    // search but that's unusual. Besides, for the two ended optimization to
    // work on Iterables, we'd need to copy the whole set.
    // In this first iteration, we'll just live with hitting the bad case
    // (adding everything to a Map) in for every insert/move.
    // If you change this code, also update reconcileChildrenIterator() which
    // uses the same algorithm.
    {
      // First, validate keys.
      var knownKeys = null;

      for (var i = 0; i < newChildren.length; i++) {
        var child = newChildren[i];
        knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
      }
    }

    var resultingFirstChild = null;
    var previousNewFiber = null;
    var oldFiber = currentFirstChild;
    var lastPlacedIndex = 0;
    var newIdx = 0;
    var nextOldFiber = null;

    for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
      if (oldFiber.index > newIdx) {
        nextOldFiber = oldFiber;
        oldFiber = null;
      } else {
        nextOldFiber = oldFiber.sibling;
      }

      var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);

      if (newFiber === null) {
        // TODO: This breaks on empty slots like null children. That's
        // unfortunate because it triggers the slow path all the time. We need
        // a better way to communicate whether this was a miss or null,
        // boolean, undefined, etc.
        if (oldFiber === null) {
          oldFiber = nextOldFiber;
        }

        break;
      }

      if (shouldTrackSideEffects) {
        if (oldFiber && newFiber.alternate === null) {
          // We matched the slot, but we didn't reuse the existing fiber, so we
          // need to delete the existing child.
          deleteChild(returnFiber, oldFiber);
        }
      }

      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);

      if (previousNewFiber === null) {
        // TODO: Move out of the loop. This only happens for the first run.
        resultingFirstChild = newFiber;
      } else {
        // TODO: Defer siblings if we're not at the right index for this slot.
        // I.e. if we had null values before, then we want to defer this
        // for each null value. However, we also don't want to call updateSlot
        // with the previous one.
        previousNewFiber.sibling = newFiber;
      }

      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }

    if (newIdx === newChildren.length) {
      // We've reached the end of the new children. We can delete the rest.
      deleteRemainingChildren(returnFiber, oldFiber);
      return resultingFirstChild;
    }

    if (oldFiber === null) {
      // If we don't have any more existing children we can choose a fast path
      // since the rest will all be insertions.
      for (; newIdx < newChildren.length; newIdx++) {
        var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);

        if (_newFiber === null) {
          continue;
        }

        lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);

        if (previousNewFiber === null) {
          // TODO: Move out of the loop. This only happens for the first run.
          resultingFirstChild = _newFiber;
        } else {
          previousNewFiber.sibling = _newFiber;
        }

        previousNewFiber = _newFiber;
      }

      return resultingFirstChild;
    } // Add all children to a key map for quick lookups.


    var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.

    for (; newIdx < newChildren.length; newIdx++) {
      var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);

      if (_newFiber2 !== null) {
        if (shouldTrackSideEffects) {
          if (_newFiber2.alternate !== null) {
            // The new fiber is a work in progress, but if there exists a
            // current, that means that we reused the fiber. We need to delete
            // it from the child list so that we don't add it to the deletion
            // list.
            existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
          }
        }

        lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);

        if (previousNewFiber === null) {
          resultingFirstChild = _newFiber2;
        } else {
          previousNewFiber.sibling = _newFiber2;
        }

        previousNewFiber = _newFiber2;
      }
    }

    if (shouldTrackSideEffects) {
      // Any existing children that weren't consumed above were deleted. We need
      // to add them to the deletion list.
      existingChildren.forEach(function (child) {
        return deleteChild(returnFiber, child);
      });
    }

    return resultingFirstChild;
  }

  function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
    // This is the same implementation as reconcileChildrenArray(),
    // but using the iterator instead.
    var iteratorFn = getIteratorFn(newChildrenIterable);

    if (!(typeof iteratorFn === 'function')) {
      {
        throw Error( "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    {
      // We don't support rendering Generators because it's a mutation.
      // See https://github.com/facebook/react/issues/12995
      if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag
      newChildrenIterable[Symbol.toStringTag] === 'Generator') {
        if (!didWarnAboutGenerators) {
          error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');
        }

        didWarnAboutGenerators = true;
      } // Warn about using Maps as children


      if (newChildrenIterable.entries === iteratorFn) {
        if (!didWarnAboutMaps) {
          error('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
        }

        didWarnAboutMaps = true;
      } // First, validate keys.
      // We'll get a different iterator later for the main pass.


      var _newChildren = iteratorFn.call(newChildrenIterable);

      if (_newChildren) {
        var knownKeys = null;

        var _step = _newChildren.next();

        for (; !_step.done; _step = _newChildren.next()) {
          var child = _step.value;
          knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
        }
      }
    }

    var newChildren = iteratorFn.call(newChildrenIterable);

    if (!(newChildren != null)) {
      {
        throw Error( "An iterable object provided no iterator." );
      }
    }

    var resultingFirstChild = null;
    var previousNewFiber = null;
    var oldFiber = currentFirstChild;
    var lastPlacedIndex = 0;
    var newIdx = 0;
    var nextOldFiber = null;
    var step = newChildren.next();

    for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
      if (oldFiber.index > newIdx) {
        nextOldFiber = oldFiber;
        oldFiber = null;
      } else {
        nextOldFiber = oldFiber.sibling;
      }

      var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);

      if (newFiber === null) {
        // TODO: This breaks on empty slots like null children. That's
        // unfortunate because it triggers the slow path all the time. We need
        // a better way to communicate whether this was a miss or null,
        // boolean, undefined, etc.
        if (oldFiber === null) {
          oldFiber = nextOldFiber;
        }

        break;
      }

      if (shouldTrackSideEffects) {
        if (oldFiber && newFiber.alternate === null) {
          // We matched the slot, but we didn't reuse the existing fiber, so we
          // need to delete the existing child.
          deleteChild(returnFiber, oldFiber);
        }
      }

      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);

      if (previousNewFiber === null) {
        // TODO: Move out of the loop. This only happens for the first run.
        resultingFirstChild = newFiber;
      } else {
        // TODO: Defer siblings if we're not at the right index for this slot.
        // I.e. if we had null values before, then we want to defer this
        // for each null value. However, we also don't want to call updateSlot
        // with the previous one.
        previousNewFiber.sibling = newFiber;
      }

      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }

    if (step.done) {
      // We've reached the end of the new children. We can delete the rest.
      deleteRemainingChildren(returnFiber, oldFiber);
      return resultingFirstChild;
    }

    if (oldFiber === null) {
      // If we don't have any more existing children we can choose a fast path
      // since the rest will all be insertions.
      for (; !step.done; newIdx++, step = newChildren.next()) {
        var _newFiber3 = createChild(returnFiber, step.value, lanes);

        if (_newFiber3 === null) {
          continue;
        }

        lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);

        if (previousNewFiber === null) {
          // TODO: Move out of the loop. This only happens for the first run.
          resultingFirstChild = _newFiber3;
        } else {
          previousNewFiber.sibling = _newFiber3;
        }

        previousNewFiber = _newFiber3;
      }

      return resultingFirstChild;
    } // Add all children to a key map for quick lookups.


    var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.

    for (; !step.done; newIdx++, step = newChildren.next()) {
      var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);

      if (_newFiber4 !== null) {
        if (shouldTrackSideEffects) {
          if (_newFiber4.alternate !== null) {
            // The new fiber is a work in progress, but if there exists a
            // current, that means that we reused the fiber. We need to delete
            // it from the child list so that we don't add it to the deletion
            // list.
            existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
          }
        }

        lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);

        if (previousNewFiber === null) {
          resultingFirstChild = _newFiber4;
        } else {
          previousNewFiber.sibling = _newFiber4;
        }

        previousNewFiber = _newFiber4;
      }
    }

    if (shouldTrackSideEffects) {
      // Any existing children that weren't consumed above were deleted. We need
      // to add them to the deletion list.
      existingChildren.forEach(function (child) {
        return deleteChild(returnFiber, child);
      });
    }

    return resultingFirstChild;
  }

  function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
    // There's no need to check for keys on text nodes since we don't have a
    // way to define them.
    if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
      // We already have an existing node so let's just update it and delete
      // the rest.
      deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
      var existing = useFiber(currentFirstChild, textContent);
      existing.return = returnFiber;
      return existing;
    } // The existing first child is not a text node so we need to create one
    // and delete the existing ones.


    deleteRemainingChildren(returnFiber, currentFirstChild);
    var created = createFiberFromText(textContent, returnFiber.mode, lanes);
    created.return = returnFiber;
    return created;
  }

  function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
    var key = element.key;
    var child = currentFirstChild;

    while (child !== null) {
      // TODO: If key === null and child.key === null, then this only applies to
      // the first item in the list.
      if (child.key === key) {
        switch (child.tag) {
          case Fragment:
            {
              if (element.type === REACT_FRAGMENT_TYPE) {
                deleteRemainingChildren(returnFiber, child.sibling);
                var existing = useFiber(child, element.props.children);
                existing.return = returnFiber;

                {
                  existing._debugSource = element._source;
                  existing._debugOwner = element._owner;
                }

                return existing;
              }

              break;
            }

          case Block:

          // We intentionally fallthrough here if enableBlocksAPI is not on.
          // eslint-disable-next-lined no-fallthrough

          default:
            {
              if (child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
               isCompatibleFamilyForHotReloading(child, element) )) {
                deleteRemainingChildren(returnFiber, child.sibling);

                var _existing3 = useFiber(child, element.props);

                _existing3.ref = coerceRef(returnFiber, child, element);
                _existing3.return = returnFiber;

                {
                  _existing3._debugSource = element._source;
                  _existing3._debugOwner = element._owner;
                }

                return _existing3;
              }

              break;
            }
        } // Didn't match.


        deleteRemainingChildren(returnFiber, child);
        break;
      } else {
        deleteChild(returnFiber, child);
      }

      child = child.sibling;
    }

    if (element.type === REACT_FRAGMENT_TYPE) {
      var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
      created.return = returnFiber;
      return created;
    } else {
      var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);

      _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
      _created4.return = returnFiber;
      return _created4;
    }
  }

  function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
    var key = portal.key;
    var child = currentFirstChild;

    while (child !== null) {
      // TODO: If key === null and child.key === null, then this only applies to
      // the first item in the list.
      if (child.key === key) {
        if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
          deleteRemainingChildren(returnFiber, child.sibling);
          var existing = useFiber(child, portal.children || []);
          existing.return = returnFiber;
          return existing;
        } else {
          deleteRemainingChildren(returnFiber, child);
          break;
        }
      } else {
        deleteChild(returnFiber, child);
      }

      child = child.sibling;
    }

    var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
    created.return = returnFiber;
    return created;
  } // This API will tag the children with the side-effect of the reconciliation
  // itself. They will be added to the side-effect list as we pass through the
  // children and the parent.


  function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) {
    // This function is not recursive.
    // If the top level item is an array, we treat it as a set of children,
    // not as a fragment. Nested arrays on the other hand will be treated as
    // fragment nodes. Recursion happens at the normal flow.
    // Handle top level unkeyed fragments as if they were arrays.
    // This leads to an ambiguity between <>{[...]}</> and <>...</>.
    // We treat the ambiguous cases above the same.
    var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;

    if (isUnkeyedTopLevelFragment) {
      newChild = newChild.props.children;
    } // Handle object types


    var isObject = typeof newChild === 'object' && newChild !== null;

    if (isObject) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));

        case REACT_PORTAL_TYPE:
          return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));

      }
    }

    if (typeof newChild === 'string' || typeof newChild === 'number') {
      return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, lanes));
    }

    if (isArray$1(newChild)) {
      return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
    }

    if (getIteratorFn(newChild)) {
      return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
    }

    if (isObject) {
      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType(returnFiber);
      }
    }

    if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
      // If the new child is undefined, and the return fiber is a composite
      // component, throw an error. If Fiber return types are disabled,
      // we already threw above.
      switch (returnFiber.tag) {
        case ClassComponent:
          {
            {
              var instance = returnFiber.stateNode;

              if (instance.render._isMockFunction) {
                // We allow auto-mocks to proceed as if they're returning null.
                break;
              }
            }
          }
        // Intentionally fall through to the next case, which handles both
        // functions and classes
        // eslint-disable-next-lined no-fallthrough

        case Block:
        case FunctionComponent:
        case ForwardRef:
        case SimpleMemoComponent:
          {
            {
              {
                throw Error( (getComponentName(returnFiber.type) || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." );
              }
            }
          }
      }
    } // Remaining cases are all treated as empty.


    return deleteRemainingChildren(returnFiber, currentFirstChild);
  }

  return reconcileChildFibers;
}

var reconcileChildFibers = ChildReconciler(true);
var mountChildFibers = ChildReconciler(false);
function cloneChildFibers(current, workInProgress) {
  if (!(current === null || workInProgress.child === current.child)) {
    {
      throw Error( "Resuming work not yet implemented." );
    }
  }

  if (workInProgress.child === null) {
    return;
  }

  var currentChild = workInProgress.child;
  var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
  workInProgress.child = newChild;
  newChild.return = workInProgress;

  while (currentChild.sibling !== null) {
    currentChild = currentChild.sibling;
    newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
    newChild.return = workInProgress;
  }

  newChild.sibling = null;
} // Reset a workInProgress child set to prepare it for a second pass.

function resetChildFibers(workInProgress, lanes) {
  var child = workInProgress.child;

  while (child !== null) {
    resetWorkInProgress(child, lanes);
    child = child.sibling;
  }
}

var NO_CONTEXT = {};
var contextStackCursor$1 = createCursor(NO_CONTEXT);
var contextFiberStackCursor = createCursor(NO_CONTEXT);
var rootInstanceStackCursor = createCursor(NO_CONTEXT);

function requiredContext(c) {
  if (!(c !== NO_CONTEXT)) {
    {
      throw Error( "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." );
    }
  }

  return c;
}

function getRootHostContainer() {
  var rootInstance = requiredContext(rootInstanceStackCursor.current);
  return rootInstance;
}

function pushHostContainer(fiber, nextRootInstance) {
  // Push current root instance onto the stack;
  // This allows us to reset root when portals are popped.
  push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.
  // This enables us to pop only Fibers that provide unique contexts.

  push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.
  // However, we can't just call getRootHostContext() and push it because
  // we'd have a different number of entries on the stack depending on
  // whether getRootHostContext() throws somewhere in renderer code or not.
  // So we push an empty value first. This lets us safely unwind on errors.

  push(contextStackCursor$1, NO_CONTEXT, fiber);
  var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.

  pop(contextStackCursor$1, fiber);
  push(contextStackCursor$1, nextRootContext, fiber);
}

function popHostContainer(fiber) {
  pop(contextStackCursor$1, fiber);
  pop(contextFiberStackCursor, fiber);
  pop(rootInstanceStackCursor, fiber);
}

function getHostContext() {
  var context = requiredContext(contextStackCursor$1.current);
  return context;
}

function pushHostContext(fiber) {
  var rootInstance = requiredContext(rootInstanceStackCursor.current);
  var context = requiredContext(contextStackCursor$1.current);
  var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.

  if (context === nextContext) {
    return;
  } // Track the context and the Fiber that provided it.
  // This enables us to pop only Fibers that provide unique contexts.


  push(contextFiberStackCursor, fiber, fiber);
  push(contextStackCursor$1, nextContext, fiber);
}

function popHostContext(fiber) {
  // Do not pop unless this Fiber provided the current context.
  // pushHostContext() only pushes Fibers that provide unique contexts.
  if (contextFiberStackCursor.current !== fiber) {
    return;
  }

  pop(contextStackCursor$1, fiber);
  pop(contextFiberStackCursor, fiber);
}

var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is
// inherited deeply down the subtree. The upper bits only affect
// this immediate suspense boundary and gets reset each new
// boundary or suspense list.

var SubtreeSuspenseContextMask = 1; // Subtree Flags:
// InvisibleParentSuspenseContext indicates that one of our parent Suspense
// boundaries is not currently showing visible main content.
// Either because it is already showing a fallback or is not mounted at all.
// We can use this to determine if it is desirable to trigger a fallback at
// the parent. If not, then we might need to trigger undesirable boundaries
// and/or suspend the commit to avoid hiding the parent content.

var InvisibleParentSuspenseContext = 1; // Shallow Flags:
// ForceSuspenseFallback can be used by SuspenseList to force newly added
// items into their fallback state during one of the render passes.

var ForceSuspenseFallback = 2;
var suspenseStackCursor = createCursor(DefaultSuspenseContext);
function hasSuspenseContext(parentContext, flag) {
  return (parentContext & flag) !== 0;
}
function setDefaultShallowSuspenseContext(parentContext) {
  return parentContext & SubtreeSuspenseContextMask;
}
function setShallowSuspenseContext(parentContext, shallowContext) {
  return parentContext & SubtreeSuspenseContextMask | shallowContext;
}
function addSubtreeSuspenseContext(parentContext, subtreeContext) {
  return parentContext | subtreeContext;
}
function pushSuspenseContext(fiber, newContext) {
  push(suspenseStackCursor, newContext, fiber);
}
function popSuspenseContext(fiber) {
  pop(suspenseStackCursor, fiber);
}

function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
  // If it was the primary children that just suspended, capture and render the
  // fallback. Otherwise, don't capture and bubble to the next boundary.
  var nextState = workInProgress.memoizedState;

  if (nextState !== null) {
    if (nextState.dehydrated !== null) {
      // A dehydrated boundary always captures.
      return true;
    }

    return false;
  }

  var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.

  if (props.fallback === undefined) {
    return false;
  } // Regular boundaries always capture.


  if (props.unstable_avoidThisFallback !== true) {
    return true;
  } // If it's a boundary we should avoid, then we prefer to bubble up to the
  // parent boundary if it is currently invisible.


  if (hasInvisibleParent) {
    return false;
  } // If the parent is not able to handle it, we must handle it.


  return true;
}
function findFirstSuspended(row) {
  var node = row;

  while (node !== null) {
    if (node.tag === SuspenseComponent) {
      var state = node.memoizedState;

      if (state !== null) {
        var dehydrated = state.dehydrated;

        if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
          return node;
        }
      }
    } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
    // keep track of whether it suspended or not.
    node.memoizedProps.revealOrder !== undefined) {
      var didSuspend = (node.flags & DidCapture) !== NoFlags;

      if (didSuspend) {
        return node;
      }
    } else if (node.child !== null) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === row) {
      return null;
    }

    while (node.sibling === null) {
      if (node.return === null || node.return === row) {
        return null;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  }

  return null;
}

var NoFlags$1 =
/*  */
0; // Represents whether effect should fire.

var HasEffect =
/* */
1; // Represents the phase in which the effect (not the clean-up) fires.

var Layout =
/*    */
2;
var Passive$1 =
/*   */
4;

// This may have been an insertion or a hydration.

var hydrationParentFiber = null;
var nextHydratableInstance = null;
var isHydrating = false;

function enterHydrationState(fiber) {

  var parentInstance = fiber.stateNode.containerInfo;
  nextHydratableInstance = getFirstHydratableChild(parentInstance);
  hydrationParentFiber = fiber;
  isHydrating = true;
  return true;
}

function deleteHydratableInstance(returnFiber, instance) {
  {
    switch (returnFiber.tag) {
      case HostRoot:
        didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
        break;

      case HostComponent:
        didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
        break;
    }
  }

  var childToDelete = createFiberFromHostInstanceForDeletion();
  childToDelete.stateNode = instance;
  childToDelete.return = returnFiber;
  childToDelete.flags = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,
  // these children are not part of the reconciliation list of children.
  // Even if we abort and rereconcile the children, that will try to hydrate
  // again and the nodes are still in the host tree so these will be
  // recreated.

  if (returnFiber.lastEffect !== null) {
    returnFiber.lastEffect.nextEffect = childToDelete;
    returnFiber.lastEffect = childToDelete;
  } else {
    returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
  }
}

function insertNonHydratedInstance(returnFiber, fiber) {
  fiber.flags = fiber.flags & ~Hydrating | Placement;

  {
    switch (returnFiber.tag) {
      case HostRoot:
        {
          var parentContainer = returnFiber.stateNode.containerInfo;

          switch (fiber.tag) {
            case HostComponent:
              var type = fiber.type;
              var props = fiber.pendingProps;
              didNotFindHydratableContainerInstance(parentContainer, type);
              break;

            case HostText:
              var text = fiber.pendingProps;
              didNotFindHydratableContainerTextInstance(parentContainer, text);
              break;
          }

          break;
        }

      case HostComponent:
        {
          var parentType = returnFiber.type;
          var parentProps = returnFiber.memoizedProps;
          var parentInstance = returnFiber.stateNode;

          switch (fiber.tag) {
            case HostComponent:
              var _type = fiber.type;
              var _props = fiber.pendingProps;
              didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);
              break;

            case HostText:
              var _text = fiber.pendingProps;
              didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
              break;

            case SuspenseComponent:
              didNotFindHydratableSuspenseInstance(parentType, parentProps);
              break;
          }

          break;
        }

      default:
        return;
    }
  }
}

function tryHydrate(fiber, nextInstance) {
  switch (fiber.tag) {
    case HostComponent:
      {
        var type = fiber.type;
        var props = fiber.pendingProps;
        var instance = canHydrateInstance(nextInstance, type);

        if (instance !== null) {
          fiber.stateNode = instance;
          return true;
        }

        return false;
      }

    case HostText:
      {
        var text = fiber.pendingProps;
        var textInstance = canHydrateTextInstance(nextInstance, text);

        if (textInstance !== null) {
          fiber.stateNode = textInstance;
          return true;
        }

        return false;
      }

    case SuspenseComponent:
      {

        return false;
      }

    default:
      return false;
  }
}

function tryToClaimNextHydratableInstance(fiber) {
  if (!isHydrating) {
    return;
  }

  var nextInstance = nextHydratableInstance;

  if (!nextInstance) {
    // Nothing to hydrate. Make it an insertion.
    insertNonHydratedInstance(hydrationParentFiber, fiber);
    isHydrating = false;
    hydrationParentFiber = fiber;
    return;
  }

  var firstAttemptedInstance = nextInstance;

  if (!tryHydrate(fiber, nextInstance)) {
    // If we can't hydrate this instance let's try the next one.
    // We use this as a heuristic. It's based on intuition and not data so it
    // might be flawed or unnecessary.
    nextInstance = getNextHydratableSibling(firstAttemptedInstance);

    if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
      // Nothing to hydrate. Make it an insertion.
      insertNonHydratedInstance(hydrationParentFiber, fiber);
      isHydrating = false;
      hydrationParentFiber = fiber;
      return;
    } // We matched the next one, we'll now assume that the first one was
    // superfluous and we'll delete it. Since we can't eagerly delete it
    // we'll have to schedule a deletion. To do that, this node needs a dummy
    // fiber associated with it.


    deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
  }

  hydrationParentFiber = fiber;
  nextHydratableInstance = getFirstHydratableChild(nextInstance);
}

function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {

  var instance = fiber.stateNode;
  var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component.

  fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
  // is a new ref we mark this as an update.

  if (updatePayload !== null) {
    return true;
  }

  return false;
}

function prepareToHydrateHostTextInstance(fiber) {

  var textInstance = fiber.stateNode;
  var textContent = fiber.memoizedProps;
  var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);

  {
    if (shouldUpdate) {
      // We assume that prepareToHydrateHostTextInstance is called in a context where the
      // hydration parent is the parent host component of this host text.
      var returnFiber = hydrationParentFiber;

      if (returnFiber !== null) {
        switch (returnFiber.tag) {
          case HostRoot:
            {
              var parentContainer = returnFiber.stateNode.containerInfo;
              didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
              break;
            }

          case HostComponent:
            {
              var parentType = returnFiber.type;
              var parentProps = returnFiber.memoizedProps;
              var parentInstance = returnFiber.stateNode;
              didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
              break;
            }
        }
      }
    }
  }

  return shouldUpdate;
}

function skipPastDehydratedSuspenseInstance(fiber) {

  var suspenseState = fiber.memoizedState;
  var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;

  if (!suspenseInstance) {
    {
      throw Error( "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." );
    }
  }

  return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
}

function popToNextHostParent(fiber) {
  var parent = fiber.return;

  while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
    parent = parent.return;
  }

  hydrationParentFiber = parent;
}

function popHydrationState(fiber) {

  if (fiber !== hydrationParentFiber) {
    // We're deeper than the current hydration context, inside an inserted
    // tree.
    return false;
  }

  if (!isHydrating) {
    // If we're not currently hydrating but we're in a hydration context, then
    // we were an insertion and now need to pop up reenter hydration of our
    // siblings.
    popToNextHostParent(fiber);
    isHydrating = true;
    return false;
  }

  var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now.
  // We only do this deeper than head and body since they tend to have random
  // other nodes in them. We also ignore components with pure text content in
  // side of them.
  // TODO: Better heuristic.

  if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
    var nextInstance = nextHydratableInstance;

    while (nextInstance) {
      deleteHydratableInstance(fiber, nextInstance);
      nextInstance = getNextHydratableSibling(nextInstance);
    }
  }

  popToNextHostParent(fiber);

  if (fiber.tag === SuspenseComponent) {
    nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
  } else {
    nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
  }

  return true;
}

function resetHydrationState() {

  hydrationParentFiber = null;
  nextHydratableInstance = null;
  isHydrating = false;
}

function getIsHydrating() {
  return isHydrating;
}

// and should be reset before starting a new render.
// This tracks which mutable sources need to be reset after a render.

var workInProgressSources = [];
var rendererSigil$1;

{
  // Used to detect multiple renderers using the same mutable source.
  rendererSigil$1 = {};
}

function markSourceAsDirty(mutableSource) {
  workInProgressSources.push(mutableSource);
}
function resetWorkInProgressVersions() {
  for (var i = 0; i < workInProgressSources.length; i++) {
    var mutableSource = workInProgressSources[i];

    {
      mutableSource._workInProgressVersionPrimary = null;
    }
  }

  workInProgressSources.length = 0;
}
function getWorkInProgressVersion(mutableSource) {
  {
    return mutableSource._workInProgressVersionPrimary;
  }
}
function setWorkInProgressVersion(mutableSource, version) {
  {
    mutableSource._workInProgressVersionPrimary = version;
  }

  workInProgressSources.push(mutableSource);
}
function warnAboutMultipleRenderersDEV(mutableSource) {
  {
    {
      if (mutableSource._currentPrimaryRenderer == null) {
        mutableSource._currentPrimaryRenderer = rendererSigil$1;
      } else if (mutableSource._currentPrimaryRenderer !== rendererSigil$1) {
        error('Detected multiple renderers concurrently rendering the ' + 'same mutable source. This is currently unsupported.');
      }
    }
  }
} // Eager reads the version of a mutable source and stores it on the root.

var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
    ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
var didWarnAboutMismatchedHooksForComponent;
var didWarnAboutUseOpaqueIdentifier;

{
  didWarnAboutUseOpaqueIdentifier = {};
  didWarnAboutMismatchedHooksForComponent = new Set();
}

// These are set right before calling the component.
var renderLanes = NoLanes; // The work-in-progress fiber. I've named it differently to distinguish it from
// the work-in-progress hook.

var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The
// current hook list is the list that belongs to the current fiber. The
// work-in-progress hook list is a new list that will be added to the
// work-in-progress fiber.

var currentHook = null;
var workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This
// does not get reset if we do another render pass; only when we're completely
// finished evaluating this component. This is an optimization so we know
// whether we need to clear render phase updates after a throw.

var didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only during the current render pass. This
// gets reset after each attempt.
// TODO: Maybe there's some way to consolidate this with
// `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`.

var didScheduleRenderPhaseUpdateDuringThisPass = false;
var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook

var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.
// The list stores the order of hooks used during the initial render (mount).
// Subsequent renders (updates) reference this list.

var hookTypesDev = null;
var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore
// the dependencies for Hooks that need them (e.g. useEffect or useMemo).
// When true, such Hooks will always be "remounted". Only used during hot reload.

var ignorePreviousDependencies = false;

function mountHookTypesDev() {
  {
    var hookName = currentHookNameInDev;

    if (hookTypesDev === null) {
      hookTypesDev = [hookName];
    } else {
      hookTypesDev.push(hookName);
    }
  }
}

function updateHookTypesDev() {
  {
    var hookName = currentHookNameInDev;

    if (hookTypesDev !== null) {
      hookTypesUpdateIndexDev++;

      if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
        warnOnHookMismatchInDev(hookName);
      }
    }
  }
}

function checkDepsAreArrayDev(deps) {
  {
    if (deps !== undefined && deps !== null && !Array.isArray(deps)) {
      // Verify deps, but only on mount to avoid extra checks.
      // It's unlikely their type would change as usually you define them inline.
      error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);
    }
  }
}

function warnOnHookMismatchInDev(currentHookName) {
  {
    var componentName = getComponentName(currentlyRenderingFiber$1.type);

    if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
      didWarnAboutMismatchedHooksForComponent.add(componentName);

      if (hookTypesDev !== null) {
        var table = '';
        var secondColumnStart = 30;

        for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
          var oldHookName = hookTypesDev[i];
          var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
          var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up
          // lol @ IE not supporting String#repeat

          while (row.length < secondColumnStart) {
            row += ' ';
          }

          row += newHookName + '\n';
          table += row;
        }

        error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n' + '   Previous render            Next render\n' + '   ------------------------------------------------------\n' + '%s' + '   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
      }
    }
  }
}

function throwInvalidHookError() {
  {
    {
      throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
    }
  }
}

function areHookInputsEqual(nextDeps, prevDeps) {
  {
    if (ignorePreviousDependencies) {
      // Only true when this component is being hot reloaded.
      return false;
    }
  }

  if (prevDeps === null) {
    {
      error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
    }

    return false;
  }

  {
    // Don't bother comparing lengths in prod because these arrays should be
    // passed inline.
    if (nextDeps.length !== prevDeps.length) {
      error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]");
    }
  }

  for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
    if (objectIs(nextDeps[i], prevDeps[i])) {
      continue;
    }

    return false;
  }

  return true;
}

function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) {
  renderLanes = nextRenderLanes;
  currentlyRenderingFiber$1 = workInProgress;

  {
    hookTypesDev = current !== null ? current._debugHookTypes : null;
    hookTypesUpdateIndexDev = -1; // Used for hot reloading:

    ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;
  }

  workInProgress.memoizedState = null;
  workInProgress.updateQueue = null;
  workInProgress.lanes = NoLanes; // The following should have already been reset
  // currentHook = null;
  // workInProgressHook = null;
  // didScheduleRenderPhaseUpdate = false;
  // TODO Warn if no hooks are used at all during mount, then some are used during update.
  // Currently we will identify the update render as a mount because memoizedState === null.
  // This is tricky because it's valid for certain types of components (e.g. React.lazy)
  // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used.
  // Non-stateful hooks (e.g. context) don't get added to memoizedState,
  // so memoizedState would be null during updates and mounts.

  {
    if (current !== null && current.memoizedState !== null) {
      ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
    } else if (hookTypesDev !== null) {
      // This dispatcher handles an edge case where a component is updating,
      // but no stateful hooks have been used.
      // We want to match the production code behavior (which will use HooksDispatcherOnMount),
      // but with the extra DEV validation to ensure hooks ordering hasn't changed.
      // This dispatcher does that.
      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
    } else {
      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
    }
  }

  var children = Component(props, secondArg); // Check if there was a render phase update

  if (didScheduleRenderPhaseUpdateDuringThisPass) {
    // Keep rendering in a loop for as long as render phase updates continue to
    // be scheduled. Use a counter to prevent infinite loops.
    var numberOfReRenders = 0;

    do {
      didScheduleRenderPhaseUpdateDuringThisPass = false;

      if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
        {
          throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." );
        }
      }

      numberOfReRenders += 1;

      {
        // Even when hot reloading, allow dependencies to stabilize
        // after first render to prevent infinite render phase updates.
        ignorePreviousDependencies = false;
      } // Start over from the beginning of the list


      currentHook = null;
      workInProgressHook = null;
      workInProgress.updateQueue = null;

      {
        // Also validate hook order for cascading updates.
        hookTypesUpdateIndexDev = -1;
      }

      ReactCurrentDispatcher$1.current =  HooksDispatcherOnRerenderInDEV ;
      children = Component(props, secondArg);
    } while (didScheduleRenderPhaseUpdateDuringThisPass);
  } // We can assume the previous dispatcher is always this one, since we set it
  // at the beginning of the render phase and there's no re-entrancy.


  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;

  {
    workInProgress._debugHookTypes = hookTypesDev;
  } // This check uses currentHook so that it works the same in DEV and prod bundles.
  // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.


  var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
  renderLanes = NoLanes;
  currentlyRenderingFiber$1 = null;
  currentHook = null;
  workInProgressHook = null;

  {
    currentHookNameInDev = null;
    hookTypesDev = null;
    hookTypesUpdateIndexDev = -1;
  }

  didScheduleRenderPhaseUpdate = false;

  if (!!didRenderTooFewHooks) {
    {
      throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." );
    }
  }

  return children;
}
function bailoutHooks(current, workInProgress, lanes) {
  workInProgress.updateQueue = current.updateQueue;
  workInProgress.flags &= ~(Passive | Update);
  current.lanes = removeLanes(current.lanes, lanes);
}
function resetHooksAfterThrow() {
  // We can assume the previous dispatcher is always this one, since we set it
  // at the beginning of the render phase and there's no re-entrancy.
  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;

  if (didScheduleRenderPhaseUpdate) {
    // There were render phase updates. These are only valid for this render
    // phase, which we are now aborting. Remove the updates from the queues so
    // they do not persist to the next render. Do not remove updates from hooks
    // that weren't processed.
    //
    // Only reset the updates from the queue if it has a clone. If it does
    // not have a clone, that means it wasn't processed, and the updates were
    // scheduled before we entered the render phase.
    var hook = currentlyRenderingFiber$1.memoizedState;

    while (hook !== null) {
      var queue = hook.queue;

      if (queue !== null) {
        queue.pending = null;
      }

      hook = hook.next;
    }

    didScheduleRenderPhaseUpdate = false;
  }

  renderLanes = NoLanes;
  currentlyRenderingFiber$1 = null;
  currentHook = null;
  workInProgressHook = null;

  {
    hookTypesDev = null;
    hookTypesUpdateIndexDev = -1;
    currentHookNameInDev = null;
    isUpdatingOpaqueValueInRenderPhase = false;
  }

  didScheduleRenderPhaseUpdateDuringThisPass = false;
}

function mountWorkInProgressHook() {
  var hook = {
    memoizedState: null,
    baseState: null,
    baseQueue: null,
    queue: null,
    next: null
  };

  if (workInProgressHook === null) {
    // This is the first hook in the list
    currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
  } else {
    // Append to the end of the list
    workInProgressHook = workInProgressHook.next = hook;
  }

  return workInProgressHook;
}

function updateWorkInProgressHook() {
  // This function is used both for updates and for re-renders triggered by a
  // render phase update. It assumes there is either a current hook we can
  // clone, or a work-in-progress hook from a previous render pass that we can
  // use as a base. When we reach the end of the base list, we must switch to
  // the dispatcher used for mounts.
  var nextCurrentHook;

  if (currentHook === null) {
    var current = currentlyRenderingFiber$1.alternate;

    if (current !== null) {
      nextCurrentHook = current.memoizedState;
    } else {
      nextCurrentHook = null;
    }
  } else {
    nextCurrentHook = currentHook.next;
  }

  var nextWorkInProgressHook;

  if (workInProgressHook === null) {
    nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
  } else {
    nextWorkInProgressHook = workInProgressHook.next;
  }

  if (nextWorkInProgressHook !== null) {
    // There's already a work-in-progress. Reuse it.
    workInProgressHook = nextWorkInProgressHook;
    nextWorkInProgressHook = workInProgressHook.next;
    currentHook = nextCurrentHook;
  } else {
    // Clone from the current hook.
    if (!(nextCurrentHook !== null)) {
      {
        throw Error( "Rendered more hooks than during the previous render." );
      }
    }

    currentHook = nextCurrentHook;
    var newHook = {
      memoizedState: currentHook.memoizedState,
      baseState: currentHook.baseState,
      baseQueue: currentHook.baseQueue,
      queue: currentHook.queue,
      next: null
    };

    if (workInProgressHook === null) {
      // This is the first hook in the list.
      currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
    } else {
      // Append to the end of the list.
      workInProgressHook = workInProgressHook.next = newHook;
    }
  }

  return workInProgressHook;
}

function createFunctionComponentUpdateQueue() {
  return {
    lastEffect: null
  };
}

function basicStateReducer(state, action) {
  // $FlowFixMe: Flow doesn't like mixed types
  return typeof action === 'function' ? action(state) : action;
}

function mountReducer(reducer, initialArg, init) {
  var hook = mountWorkInProgressHook();
  var initialState;

  if (init !== undefined) {
    initialState = init(initialArg);
  } else {
    initialState = initialArg;
  }

  hook.memoizedState = hook.baseState = initialState;
  var queue = hook.queue = {
    pending: null,
    dispatch: null,
    lastRenderedReducer: reducer,
    lastRenderedState: initialState
  };
  var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
  return [hook.memoizedState, dispatch];
}

function updateReducer(reducer, initialArg, init) {
  var hook = updateWorkInProgressHook();
  var queue = hook.queue;

  if (!(queue !== null)) {
    {
      throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." );
    }
  }

  queue.lastRenderedReducer = reducer;
  var current = currentHook; // The last rebase update that is NOT part of the base state.

  var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet.

  var pendingQueue = queue.pending;

  if (pendingQueue !== null) {
    // We have new updates that haven't been processed yet.
    // We'll add them to the base queue.
    if (baseQueue !== null) {
      // Merge the pending queue and the base queue.
      var baseFirst = baseQueue.next;
      var pendingFirst = pendingQueue.next;
      baseQueue.next = pendingFirst;
      pendingQueue.next = baseFirst;
    }

    {
      if (current.baseQueue !== baseQueue) {
        // Internal invariant that should never happen, but feasibly could in
        // the future if we implement resuming, or some form of that.
        error('Internal error: Expected work-in-progress queue to be a clone. ' + 'This is a bug in React.');
      }
    }

    current.baseQueue = baseQueue = pendingQueue;
    queue.pending = null;
  }

  if (baseQueue !== null) {
    // We have a queue to process.
    var first = baseQueue.next;
    var newState = current.baseState;
    var newBaseState = null;
    var newBaseQueueFirst = null;
    var newBaseQueueLast = null;
    var update = first;

    do {
      var updateLane = update.lane;

      if (!isSubsetOfLanes(renderLanes, updateLane)) {
        // Priority is insufficient. Skip this update. If this is the first
        // skipped update, the previous update/state is the new base
        // update/state.
        var clone = {
          lane: updateLane,
          action: update.action,
          eagerReducer: update.eagerReducer,
          eagerState: update.eagerState,
          next: null
        };

        if (newBaseQueueLast === null) {
          newBaseQueueFirst = newBaseQueueLast = clone;
          newBaseState = newState;
        } else {
          newBaseQueueLast = newBaseQueueLast.next = clone;
        } // Update the remaining priority in the queue.
        // TODO: Don't need to accumulate this. Instead, we can remove
        // renderLanes from the original lanes.


        currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
        markSkippedUpdateLanes(updateLane);
      } else {
        // This update does have sufficient priority.
        if (newBaseQueueLast !== null) {
          var _clone = {
            // This update is going to be committed so we never want uncommit
            // it. Using NoLane works because 0 is a subset of all bitmasks, so
            // this will never be skipped by the check above.
            lane: NoLane,
            action: update.action,
            eagerReducer: update.eagerReducer,
            eagerState: update.eagerState,
            next: null
          };
          newBaseQueueLast = newBaseQueueLast.next = _clone;
        } // Process this update.


        if (update.eagerReducer === reducer) {
          // If this update was processed eagerly, and its reducer matches the
          // current reducer, we can use the eagerly computed state.
          newState = update.eagerState;
        } else {
          var action = update.action;
          newState = reducer(newState, action);
        }
      }

      update = update.next;
    } while (update !== null && update !== first);

    if (newBaseQueueLast === null) {
      newBaseState = newState;
    } else {
      newBaseQueueLast.next = newBaseQueueFirst;
    } // Mark that the fiber performed work, but only if the new state is
    // different from the current state.


    if (!objectIs(newState, hook.memoizedState)) {
      markWorkInProgressReceivedUpdate();
    }

    hook.memoizedState = newState;
    hook.baseState = newBaseState;
    hook.baseQueue = newBaseQueueLast;
    queue.lastRenderedState = newState;
  }

  var dispatch = queue.dispatch;
  return [hook.memoizedState, dispatch];
}

function rerenderReducer(reducer, initialArg, init) {
  var hook = updateWorkInProgressHook();
  var queue = hook.queue;

  if (!(queue !== null)) {
    {
      throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." );
    }
  }

  queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous
  // work-in-progress hook.

  var dispatch = queue.dispatch;
  var lastRenderPhaseUpdate = queue.pending;
  var newState = hook.memoizedState;

  if (lastRenderPhaseUpdate !== null) {
    // The queue doesn't persist past this render pass.
    queue.pending = null;
    var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
    var update = firstRenderPhaseUpdate;

    do {
      // Process this render phase update. We don't have to check the
      // priority because it will always be the same as the current
      // render's.
      var action = update.action;
      newState = reducer(newState, action);
      update = update.next;
    } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is
    // different from the current state.


    if (!objectIs(newState, hook.memoizedState)) {
      markWorkInProgressReceivedUpdate();
    }

    hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to
    // the base state unless the queue is empty.
    // TODO: Not sure if this is the desired semantics, but it's what we
    // do for gDSFP. I can't remember why.

    if (hook.baseQueue === null) {
      hook.baseState = newState;
    }

    queue.lastRenderedState = newState;
  }

  return [newState, dispatch];
}

function readFromUnsubcribedMutableSource(root, source, getSnapshot) {
  {
    warnAboutMultipleRenderersDEV(source);
  }

  var getVersion = source._getVersion;
  var version = getVersion(source._source); // Is it safe for this component to read from this source during the current render?

  var isSafeToReadFromSource = false; // Check the version first.
  // If this render has already been started with a specific version,
  // we can use it alone to determine if we can safely read from the source.

  var currentRenderVersion = getWorkInProgressVersion(source);

  if (currentRenderVersion !== null) {
    // It's safe to read if the store hasn't been mutated since the last time
    // we read something.
    isSafeToReadFromSource = currentRenderVersion === version;
  } else {
    // If there's no version, then this is the first time we've read from the
    // source during the current render pass, so we need to do a bit more work.
    // What we need to determine is if there are any hooks that already
    // subscribed to the source, and if so, whether there are any pending
    // mutations that haven't been synchronized yet.
    //
    // If there are no pending mutations, then `root.mutableReadLanes` will be
    // empty, and we know we can safely read.
    //
    // If there *are* pending mutations, we may still be able to safely read
    // if the currently rendering lanes are inclusive of the pending mutation
    // lanes, since that guarantees that the value we're about to read from
    // the source is consistent with the values that we read during the most
    // recent mutation.
    isSafeToReadFromSource = isSubsetOfLanes(renderLanes, root.mutableReadLanes);

    if (isSafeToReadFromSource) {
      // If it's safe to read from this source during the current render,
      // store the version in case other components read from it.
      // A changed version number will let those components know to throw and restart the render.
      setWorkInProgressVersion(source, version);
    }
  }

  if (isSafeToReadFromSource) {
    var snapshot = getSnapshot(source._source);

    {
      if (typeof snapshot === 'function') {
        error('Mutable source should not return a function as the snapshot value. ' + 'Functions may close over mutable values and cause tearing.');
      }
    }

    return snapshot;
  } else {
    // This handles the special case of a mutable source being shared between renderers.
    // In that case, if the source is mutated between the first and second renderer,
    // The second renderer don't know that it needs to reset the WIP version during unwind,
    // (because the hook only marks sources as dirty if it's written to their WIP version).
    // That would cause this tear check to throw again and eventually be visible to the user.
    // We can avoid this infinite loop by explicitly marking the source as dirty.
    //
    // This can lead to tearing in the first renderer when it resumes,
    // but there's nothing we can do about that (short of throwing here and refusing to continue the render).
    markSourceAsDirty(source);

    {
      {
        throw Error( "Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue." );
      }
    }
  }
}

function useMutableSource(hook, source, getSnapshot, subscribe) {
  var root = getWorkInProgressRoot();

  if (!(root !== null)) {
    {
      throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." );
    }
  }

  var getVersion = source._getVersion;
  var version = getVersion(source._source);
  var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const

  var _dispatcher$useState = dispatcher.useState(function () {
    return readFromUnsubcribedMutableSource(root, source, getSnapshot);
  }),
      currentSnapshot = _dispatcher$useState[0],
      setSnapshot = _dispatcher$useState[1];

  var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
  // We use it to clear the pending update queue if we have a new source.

  var stateHook = workInProgressHook;
  var memoizedState = hook.memoizedState;
  var refs = memoizedState.refs;
  var prevGetSnapshot = refs.getSnapshot;
  var prevSource = memoizedState.source;
  var prevSubscribe = memoizedState.subscribe;
  var fiber = currentlyRenderingFiber$1;
  hook.memoizedState = {
    refs: refs,
    source: source,
    subscribe: subscribe
  }; // Sync the values needed by our subscription handler after each commit.

  dispatcher.useEffect(function () {
    refs.getSnapshot = getSnapshot; // Normally the dispatch function for a state hook never changes,
    // but this hook recreates the queue in certain cases  to avoid updates from stale sources.
    // handleChange() below needs to reference the dispatch function without re-subscribing,
    // so we use a ref to ensure that it always has the latest version.

    refs.setSnapshot = setSnapshot; // Check for a possible change between when we last rendered now.

    var maybeNewVersion = getVersion(source._source);

    if (!objectIs(version, maybeNewVersion)) {
      var maybeNewSnapshot = getSnapshot(source._source);

      {
        if (typeof maybeNewSnapshot === 'function') {
          error('Mutable source should not return a function as the snapshot value. ' + 'Functions may close over mutable values and cause tearing.');
        }
      }

      if (!objectIs(snapshot, maybeNewSnapshot)) {
        setSnapshot(maybeNewSnapshot);
        var lane = requestUpdateLane(fiber);
        markRootMutableRead(root, lane);
      } // If the source mutated between render and now,
      // there may be state updates already scheduled from the old source.
      // Entangle the updates so that they render in the same batch.


      markRootEntangled(root, root.mutableReadLanes);
    }
  }, [getSnapshot, source, subscribe]); // If we got a new source or subscribe function, re-subscribe in a passive effect.

  dispatcher.useEffect(function () {
    var handleChange = function () {
      var latestGetSnapshot = refs.getSnapshot;
      var latestSetSnapshot = refs.setSnapshot;

      try {
        latestSetSnapshot(latestGetSnapshot(source._source)); // Record a pending mutable source update with the same expiration time.

        var lane = requestUpdateLane(fiber);
        markRootMutableRead(root, lane);
      } catch (error) {
        // A selector might throw after a source mutation.
        // e.g. it might try to read from a part of the store that no longer exists.
        // In this case we should still schedule an update with React.
        // Worst case the selector will throw again and then an error boundary will handle it.
        latestSetSnapshot(function () {
          throw error;
        });
      }
    };

    var unsubscribe = subscribe(source._source, handleChange);

    {
      if (typeof unsubscribe !== 'function') {
        error('Mutable source subscribe function must return an unsubscribe function.');
      }
    }

    return unsubscribe;
  }, [source, subscribe]); // If any of the inputs to useMutableSource change, reading is potentially unsafe.
  //
  // If either the source or the subscription have changed we can't can't trust the update queue.
  // Maybe the source changed in a way that the old subscription ignored but the new one depends on.
  //
  // If the getSnapshot function changed, we also shouldn't rely on the update queue.
  // It's possible that the underlying source was mutated between the when the last "change" event fired,
  // and when the current render (with the new getSnapshot function) is processed.
  //
  // In both cases, we need to throw away pending updates (since they are no longer relevant)
  // and treat reading from the source as we do in the mount case.

  if (!objectIs(prevGetSnapshot, getSnapshot) || !objectIs(prevSource, source) || !objectIs(prevSubscribe, subscribe)) {
    // Create a new queue and setState method,
    // So if there are interleaved updates, they get pushed to the older queue.
    // When this becomes current, the previous queue and dispatch method will be discarded,
    // including any interleaving updates that occur.
    var newQueue = {
      pending: null,
      dispatch: null,
      lastRenderedReducer: basicStateReducer,
      lastRenderedState: snapshot
    };
    newQueue.dispatch = setSnapshot = dispatchAction.bind(null, currentlyRenderingFiber$1, newQueue);
    stateHook.queue = newQueue;
    stateHook.baseQueue = null;
    snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot);
    stateHook.memoizedState = stateHook.baseState = snapshot;
  }

  return snapshot;
}

function mountMutableSource(source, getSnapshot, subscribe) {
  var hook = mountWorkInProgressHook();
  hook.memoizedState = {
    refs: {
      getSnapshot: getSnapshot,
      setSnapshot: null
    },
    source: source,
    subscribe: subscribe
  };
  return useMutableSource(hook, source, getSnapshot, subscribe);
}

function updateMutableSource(source, getSnapshot, subscribe) {
  var hook = updateWorkInProgressHook();
  return useMutableSource(hook, source, getSnapshot, subscribe);
}

function mountState(initialState) {
  var hook = mountWorkInProgressHook();

  if (typeof initialState === 'function') {
    // $FlowFixMe: Flow doesn't like mixed types
    initialState = initialState();
  }

  hook.memoizedState = hook.baseState = initialState;
  var queue = hook.queue = {
    pending: null,
    dispatch: null,
    lastRenderedReducer: basicStateReducer,
    lastRenderedState: initialState
  };
  var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
  return [hook.memoizedState, dispatch];
}

function updateState(initialState) {
  return updateReducer(basicStateReducer);
}

function rerenderState(initialState) {
  return rerenderReducer(basicStateReducer);
}

function pushEffect(tag, create, destroy, deps) {
  var effect = {
    tag: tag,
    create: create,
    destroy: destroy,
    deps: deps,
    // Circular
    next: null
  };
  var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;

  if (componentUpdateQueue === null) {
    componentUpdateQueue = createFunctionComponentUpdateQueue();
    currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
    componentUpdateQueue.lastEffect = effect.next = effect;
  } else {
    var lastEffect = componentUpdateQueue.lastEffect;

    if (lastEffect === null) {
      componentUpdateQueue.lastEffect = effect.next = effect;
    } else {
      var firstEffect = lastEffect.next;
      lastEffect.next = effect;
      effect.next = firstEffect;
      componentUpdateQueue.lastEffect = effect;
    }
  }

  return effect;
}

function mountRef(initialValue) {
  var hook = mountWorkInProgressHook();
  var ref = {
    current: initialValue
  };

  {
    Object.seal(ref);
  }

  hook.memoizedState = ref;
  return ref;
}

function updateRef(initialValue) {
  var hook = updateWorkInProgressHook();
  return hook.memoizedState;
}

function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  currentlyRenderingFiber$1.flags |= fiberFlags;
  hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps);
}

function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var destroy = undefined;

  if (currentHook !== null) {
    var prevEffect = currentHook.memoizedState;
    destroy = prevEffect.destroy;

    if (nextDeps !== null) {
      var prevDeps = prevEffect.deps;

      if (areHookInputsEqual(nextDeps, prevDeps)) {
        pushEffect(hookFlags, create, destroy, nextDeps);
        return;
      }
    }
  }

  currentlyRenderingFiber$1.flags |= fiberFlags;
  hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
}

function mountEffect(create, deps) {
  {
    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
    if ('undefined' !== typeof jest) {
      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
    }
  }

  return mountEffectImpl(Update | Passive, Passive$1, create, deps);
}

function updateEffect(create, deps) {
  {
    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
    if ('undefined' !== typeof jest) {
      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
    }
  }

  return updateEffectImpl(Update | Passive, Passive$1, create, deps);
}

function mountLayoutEffect(create, deps) {
  return mountEffectImpl(Update, Layout, create, deps);
}

function updateLayoutEffect(create, deps) {
  return updateEffectImpl(Update, Layout, create, deps);
}

function imperativeHandleEffect(create, ref) {
  if (typeof ref === 'function') {
    var refCallback = ref;

    var _inst = create();

    refCallback(_inst);
    return function () {
      refCallback(null);
    };
  } else if (ref !== null && ref !== undefined) {
    var refObject = ref;

    {
      if (!refObject.hasOwnProperty('current')) {
        error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');
      }
    }

    var _inst2 = create();

    refObject.current = _inst2;
    return function () {
      refObject.current = null;
    };
  }
}

function mountImperativeHandle(ref, create, deps) {
  {
    if (typeof create !== 'function') {
      error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
    }
  } // TODO: If deps are provided, should we skip comparing the ref itself?


  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
  return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
}

function updateImperativeHandle(ref, create, deps) {
  {
    if (typeof create !== 'function') {
      error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
    }
  } // TODO: If deps are provided, should we skip comparing the ref itself?


  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
  return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
}

function mountDebugValue(value, formatterFn) {// This hook is normally a no-op.
  // The react-debug-hooks package injects its own implementation
  // so that e.g. DevTools can display custom hook values.
}

var updateDebugValue = mountDebugValue;

function mountCallback(callback, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  hook.memoizedState = [callback, nextDeps];
  return callback;
}

function updateCallback(callback, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var prevState = hook.memoizedState;

  if (prevState !== null) {
    if (nextDeps !== null) {
      var prevDeps = prevState[1];

      if (areHookInputsEqual(nextDeps, prevDeps)) {
        return prevState[0];
      }
    }
  }

  hook.memoizedState = [callback, nextDeps];
  return callback;
}

function mountMemo(nextCreate, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var nextValue = nextCreate();
  hook.memoizedState = [nextValue, nextDeps];
  return nextValue;
}

function updateMemo(nextCreate, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var prevState = hook.memoizedState;

  if (prevState !== null) {
    // Assume these are defined. If they're not, areHookInputsEqual will warn.
    if (nextDeps !== null) {
      var prevDeps = prevState[1];

      if (areHookInputsEqual(nextDeps, prevDeps)) {
        return prevState[0];
      }
    }
  }

  var nextValue = nextCreate();
  hook.memoizedState = [nextValue, nextDeps];
  return nextValue;
}

function mountDeferredValue(value) {
  var _mountState = mountState(value),
      prevValue = _mountState[0],
      setValue = _mountState[1];

  mountEffect(function () {
    var prevTransition = ReactCurrentBatchConfig$1.transition;
    ReactCurrentBatchConfig$1.transition = 1;

    try {
      setValue(value);
    } finally {
      ReactCurrentBatchConfig$1.transition = prevTransition;
    }
  }, [value]);
  return prevValue;
}

function updateDeferredValue(value) {
  var _updateState = updateState(),
      prevValue = _updateState[0],
      setValue = _updateState[1];

  updateEffect(function () {
    var prevTransition = ReactCurrentBatchConfig$1.transition;
    ReactCurrentBatchConfig$1.transition = 1;

    try {
      setValue(value);
    } finally {
      ReactCurrentBatchConfig$1.transition = prevTransition;
    }
  }, [value]);
  return prevValue;
}

function rerenderDeferredValue(value) {
  var _rerenderState = rerenderState(),
      prevValue = _rerenderState[0],
      setValue = _rerenderState[1];

  updateEffect(function () {
    var prevTransition = ReactCurrentBatchConfig$1.transition;
    ReactCurrentBatchConfig$1.transition = 1;

    try {
      setValue(value);
    } finally {
      ReactCurrentBatchConfig$1.transition = prevTransition;
    }
  }, [value]);
  return prevValue;
}

function startTransition(setPending, callback) {
  var priorityLevel = getCurrentPriorityLevel();

  {
    runWithPriority$1(priorityLevel < UserBlockingPriority$2 ? UserBlockingPriority$2 : priorityLevel, function () {
      setPending(true);
    });
    runWithPriority$1(priorityLevel > NormalPriority$1 ? NormalPriority$1 : priorityLevel, function () {
      var prevTransition = ReactCurrentBatchConfig$1.transition;
      ReactCurrentBatchConfig$1.transition = 1;

      try {
        setPending(false);
        callback();
      } finally {
        ReactCurrentBatchConfig$1.transition = prevTransition;
      }
    });
  }
}

function mountTransition() {
  var _mountState2 = mountState(false),
      isPending = _mountState2[0],
      setPending = _mountState2[1]; // The `start` method can be stored on a ref, since `setPending`
  // never changes.


  var start = startTransition.bind(null, setPending);
  mountRef(start);
  return [start, isPending];
}

function updateTransition() {
  var _updateState2 = updateState(),
      isPending = _updateState2[0];

  var startRef = updateRef();
  var start = startRef.current;
  return [start, isPending];
}

function rerenderTransition() {
  var _rerenderState2 = rerenderState(),
      isPending = _rerenderState2[0];

  var startRef = updateRef();
  var start = startRef.current;
  return [start, isPending];
}

var isUpdatingOpaqueValueInRenderPhase = false;
function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
  {
    return isUpdatingOpaqueValueInRenderPhase;
  }
}

function warnOnOpaqueIdentifierAccessInDEV(fiber) {
  {
    // TODO: Should warn in effects and callbacks, too
    var name = getComponentName(fiber.type) || 'Unknown';

    if (getIsRendering() && !didWarnAboutUseOpaqueIdentifier[name]) {
      error('The object passed back from useOpaqueIdentifier is meant to be ' + 'passed through to attributes only. Do not read the ' + 'value directly.');

      didWarnAboutUseOpaqueIdentifier[name] = true;
    }
  }
}

function mountOpaqueIdentifier() {
  var makeId =  makeClientIdInDEV.bind(null, warnOnOpaqueIdentifierAccessInDEV.bind(null, currentlyRenderingFiber$1)) ;

  if (getIsHydrating()) {
    var didUpgrade = false;
    var fiber = currentlyRenderingFiber$1;

    var readValue = function () {
      if (!didUpgrade) {
        // Only upgrade once. This works even inside the render phase because
        // the update is added to a shared queue, which outlasts the
        // in-progress render.
        didUpgrade = true;

        {
          isUpdatingOpaqueValueInRenderPhase = true;
          setId(makeId());
          isUpdatingOpaqueValueInRenderPhase = false;
          warnOnOpaqueIdentifierAccessInDEV(fiber);
        }
      }

      {
        {
          throw Error( "The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly." );
        }
      }
    };

    var id = makeOpaqueHydratingObject(readValue);
    var setId = mountState(id)[1];

    if ((currentlyRenderingFiber$1.mode & BlockingMode) === NoMode) {
      currentlyRenderingFiber$1.flags |= Update | Passive;
      pushEffect(HasEffect | Passive$1, function () {
        setId(makeId());
      }, undefined, null);
    }

    return id;
  } else {
    var _id = makeId();

    mountState(_id);
    return _id;
  }
}

function updateOpaqueIdentifier() {
  var id = updateState()[0];
  return id;
}

function rerenderOpaqueIdentifier() {
  var id = rerenderState()[0];
  return id;
}

function dispatchAction(fiber, queue, action) {
  {
    if (typeof arguments[3] === 'function') {
      error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');
    }
  }

  var eventTime = requestEventTime();
  var lane = requestUpdateLane(fiber);
  var update = {
    lane: lane,
    action: action,
    eagerReducer: null,
    eagerState: null,
    next: null
  }; // Append the update to the end of the list.

  var pending = queue.pending;

  if (pending === null) {
    // This is the first update. Create a circular list.
    update.next = update;
  } else {
    update.next = pending.next;
    pending.next = update;
  }

  queue.pending = update;
  var alternate = fiber.alternate;

  if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
    // This is a render phase update. Stash it in a lazily-created map of
    // queue -> linked list of updates. After this render pass, we'll restart
    // and apply the stashed updates on top of the work-in-progress hook.
    didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
  } else {
    if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
      // The queue is currently empty, which means we can eagerly compute the
      // next state before entering the render phase. If the new state is the
      // same as the current state, we may be able to bail out entirely.
      var lastRenderedReducer = queue.lastRenderedReducer;

      if (lastRenderedReducer !== null) {
        var prevDispatcher;

        {
          prevDispatcher = ReactCurrentDispatcher$1.current;
          ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
        }

        try {
          var currentState = queue.lastRenderedState;
          var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute
          // it, on the update object. If the reducer hasn't changed by the
          // time we enter the render phase, then the eager state can be used
          // without calling the reducer again.

          update.eagerReducer = lastRenderedReducer;
          update.eagerState = eagerState;

          if (objectIs(eagerState, currentState)) {
            // Fast path. We can bail out without scheduling React to re-render.
            // It's still possible that we'll need to rebase this update later,
            // if the component re-renders for a different reason and by that
            // time the reducer has changed.
            return;
          }
        } catch (error) {// Suppress the error. It will throw again in the render phase.
        } finally {
          {
            ReactCurrentDispatcher$1.current = prevDispatcher;
          }
        }
      }
    }

    {
      // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
      if ('undefined' !== typeof jest) {
        warnIfNotScopedWithMatchingAct(fiber);
        warnIfNotCurrentlyActingUpdatesInDev(fiber);
      }
    }

    scheduleUpdateOnFiber(fiber, lane, eventTime);
  }
}

var ContextOnlyDispatcher = {
  readContext: readContext,
  useCallback: throwInvalidHookError,
  useContext: throwInvalidHookError,
  useEffect: throwInvalidHookError,
  useImperativeHandle: throwInvalidHookError,
  useLayoutEffect: throwInvalidHookError,
  useMemo: throwInvalidHookError,
  useReducer: throwInvalidHookError,
  useRef: throwInvalidHookError,
  useState: throwInvalidHookError,
  useDebugValue: throwInvalidHookError,
  useDeferredValue: throwInvalidHookError,
  useTransition: throwInvalidHookError,
  useMutableSource: throwInvalidHookError,
  useOpaqueIdentifier: throwInvalidHookError,
  unstable_isNewReconciler: enableNewReconciler
};
var HooksDispatcherOnMountInDEV = null;
var HooksDispatcherOnMountWithHookTypesInDEV = null;
var HooksDispatcherOnUpdateInDEV = null;
var HooksDispatcherOnRerenderInDEV = null;
var InvalidNestedHooksDispatcherOnMountInDEV = null;
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
var InvalidNestedHooksDispatcherOnRerenderInDEV = null;

{
  var warnInvalidContextAccess = function () {
    error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
  };

  var warnInvalidHookAccess = function () {
    error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://reactjs.org/link/rules-of-hooks');
  };

  HooksDispatcherOnMountInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      mountHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      mountHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      mountHookTypesDev();
      return mountDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      mountHookTypesDev();
      return mountDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      mountHookTypesDev();
      return mountTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      mountHookTypesDev();
      return mountMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      mountHookTypesDev();
      return mountOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  HooksDispatcherOnMountWithHookTypesInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return mountDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      updateHookTypesDev();
      return mountDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      updateHookTypesDev();
      return mountTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      updateHookTypesDev();
      return mountMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      updateHookTypesDev();
      return mountOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  HooksDispatcherOnUpdateInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return updateRef();
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return updateDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      updateHookTypesDev();
      return updateDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      updateHookTypesDev();
      return updateTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      updateHookTypesDev();
      return updateMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      updateHookTypesDev();
      return updateOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  HooksDispatcherOnRerenderInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;

      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;

      try {
        return rerenderReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return updateRef();
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;

      try {
        return rerenderState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return updateDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      updateHookTypesDev();
      return rerenderDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      updateHookTypesDev();
      return rerenderTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      updateHookTypesDev();
      return updateMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      updateHookTypesDev();
      return rerenderOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  InvalidNestedHooksDispatcherOnMountInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  InvalidNestedHooksDispatcherOnUpdateInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateRef();
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  InvalidNestedHooksDispatcherOnRerenderInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return rerenderReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateRef();
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return rerenderState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return rerenderDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return rerenderTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return rerenderOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
}

var now$1 = Scheduler.unstable_now;
var commitTime = 0;
var profilerStartTime = -1;

function getCommitTime() {
  return commitTime;
}

function recordCommitTime() {

  commitTime = now$1();
}

function startProfilerTimer(fiber) {

  profilerStartTime = now$1();

  if (fiber.actualStartTime < 0) {
    fiber.actualStartTime = now$1();
  }
}

function stopProfilerTimerIfRunning(fiber) {

  profilerStartTime = -1;
}

function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {

  if (profilerStartTime >= 0) {
    var elapsedTime = now$1() - profilerStartTime;
    fiber.actualDuration += elapsedTime;

    if (overrideBaseTime) {
      fiber.selfBaseDuration = elapsedTime;
    }

    profilerStartTime = -1;
  }
}

function transferActualDuration(fiber) {
  // Transfer time spent rendering these children so we don't lose it
  // after we rerender. This is used as a helper in special cases
  // where we should count the work of multiple passes.
  var child = fiber.child;

  while (child) {
    fiber.actualDuration += child.actualDuration;
    child = child.sibling;
  }
}

var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
var didReceiveUpdate = false;
var didWarnAboutBadClass;
var didWarnAboutModulePatternComponent;
var didWarnAboutContextTypeOnFunctionComponent;
var didWarnAboutGetDerivedStateOnFunctionComponent;
var didWarnAboutFunctionRefs;
var didWarnAboutReassigningProps;
var didWarnAboutRevealOrder;
var didWarnAboutTailOptions;

{
  didWarnAboutBadClass = {};
  didWarnAboutModulePatternComponent = {};
  didWarnAboutContextTypeOnFunctionComponent = {};
  didWarnAboutGetDerivedStateOnFunctionComponent = {};
  didWarnAboutFunctionRefs = {};
  didWarnAboutReassigningProps = false;
  didWarnAboutRevealOrder = {};
  didWarnAboutTailOptions = {};
}

function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
  if (current === null) {
    // If this is a fresh new component that hasn't been rendered yet, we
    // won't update its child set by applying minimal side-effects. Instead,
    // we will add them all to the child before it gets rendered. That means
    // we can optimize this reconciliation pass by not tracking side-effects.
    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);
  } else {
    // If the current child is the same as the work in progress, it means that
    // we haven't yet started any work on these children. Therefore, we use
    // the clone algorithm to create a copy of all the current children.
    // If we had any progressed work already, that is invalid at this point so
    // let's throw it out.
    workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes);
  }
}

function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) {
  // This function is fork of reconcileChildren. It's used in cases where we
  // want to reconcile without matching against the existing set. This has the
  // effect of all current children being unmounted; even if the type and key
  // are the same, the old child is unmounted and a new child is created.
  //
  // To do this, we're going to go through the reconcile algorithm twice. In
  // the first pass, we schedule a deletion for all the current children by
  // passing null.
  workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); // In the second pass, we mount the new children. The trick here is that we
  // pass null in place of where we usually pass the current child set. This has
  // the effect of remounting all children regardless of whether their
  // identities match.

  workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);
}

function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) {
  // TODO: current can be non-null here even if the component
  // hasn't yet mounted. This happens after the first render suspends.
  // We'll need to figure out if this is fine or can cause issues.
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;

      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component));
      }
    }
  }

  var render = Component.render;
  var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent

  var nextChildren;
  prepareToReadContext(workInProgress, renderLanes);

  {
    ReactCurrentOwner$1.current = workInProgress;
    setIsRendering(true);
    nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);

    if ( workInProgress.mode & StrictMode) {
      disableLogs();

      try {
        nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);
      } finally {
        reenableLogs();
      }
    }

    setIsRendering(false);
  }

  if (current !== null && !didReceiveUpdate) {
    bailoutHooks(current, workInProgress, renderLanes);
    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) {
  if (current === null) {
    var type = Component.type;

    if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
    Component.defaultProps === undefined) {
      var resolvedType = type;

      {
        resolvedType = resolveFunctionForHotReloading(type);
      } // If this is a plain function component without default props,
      // and with only the default shallow comparison, we upgrade it
      // to a SimpleMemoComponent to allow fast path updates.


      workInProgress.tag = SimpleMemoComponent;
      workInProgress.type = resolvedType;

      {
        validateFunctionComponentInDev(workInProgress, type);
      }

      return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateLanes, renderLanes);
    }

    {
      var innerPropTypes = type.propTypes;

      if (innerPropTypes) {
        // Inner memo component props aren't currently validated in createElement.
        // We could move it there, but we'd still need this for lazy code path.
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(type));
      }
    }

    var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes);
    child.ref = workInProgress.ref;
    child.return = workInProgress;
    workInProgress.child = child;
    return child;
  }

  {
    var _type = Component.type;
    var _innerPropTypes = _type.propTypes;

    if (_innerPropTypes) {
      // Inner memo component props aren't currently validated in createElement.
      // We could move it there, but we'd still need this for lazy code path.
      checkPropTypes(_innerPropTypes, nextProps, // Resolved props
      'prop', getComponentName(_type));
    }
  }

  var currentChild = current.child; // This is always exactly one child

  if (!includesSomeLane(updateLanes, renderLanes)) {
    // This will be the props with resolved defaultProps,
    // unlike current.memoizedProps which will be the unresolved ones.
    var prevProps = currentChild.memoizedProps; // Default to shallow comparison

    var compare = Component.compare;
    compare = compare !== null ? compare : shallowEqual;

    if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {
      return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
    }
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;
  var newChild = createWorkInProgress(currentChild, nextProps);
  newChild.ref = workInProgress.ref;
  newChild.return = workInProgress;
  workInProgress.child = newChild;
  return newChild;
}

function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) {
  // TODO: current can be non-null here even if the component
  // hasn't yet mounted. This happens when the inner render suspends.
  // We'll need to figure out if this is fine or can cause issues.
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var outerMemoType = workInProgress.elementType;

      if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
        // We warn when you define propTypes on lazy()
        // so let's just skip over it to find memo() outer wrapper.
        // Inner props for memo are validated later.
        var lazyComponent = outerMemoType;
        var payload = lazyComponent._payload;
        var init = lazyComponent._init;

        try {
          outerMemoType = init(payload);
        } catch (x) {
          outerMemoType = null;
        } // Inner propTypes will be validated in the function component path.


        var outerPropTypes = outerMemoType && outerMemoType.propTypes;

        if (outerPropTypes) {
          checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)
          'prop', getComponentName(outerMemoType));
        }
      }
    }
  }

  if (current !== null) {
    var prevProps = current.memoizedProps;

    if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload.
     workInProgress.type === current.type )) {
      didReceiveUpdate = false;

      if (!includesSomeLane(renderLanes, updateLanes)) {
        // The pending lanes were cleared at the beginning of beginWork. We're
        // about to bail out, but there might be other lanes that weren't
        // included in the current render. Usually, the priority level of the
        // remaining updates is accumlated during the evaluation of the
        // component (i.e. when processing the update queue). But since since
        // we're bailing out early *without* evaluating the component, we need
        // to account for it here, too. Reset to the value of the current fiber.
        // NOTE: This only applies to SimpleMemoComponent, not MemoComponent,
        // because a MemoComponent fiber does not have hooks or an update queue;
        // rather, it wraps around an inner component, which may or may not
        // contains hooks.
        // TODO: Move the reset at in beginWork out of the common path so that
        // this is no longer necessary.
        workInProgress.lanes = current.lanes;
        return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
      } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
        // This is a special case that only exists for legacy mode.
        // See https://github.com/facebook/react/pull/19216.
        didReceiveUpdate = true;
      }
    }
  }

  return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes);
}

function updateOffscreenComponent(current, workInProgress, renderLanes) {
  var nextProps = workInProgress.pendingProps;
  var nextChildren = nextProps.children;
  var prevState = current !== null ? current.memoizedState : null;

  if (nextProps.mode === 'hidden' || nextProps.mode === 'unstable-defer-without-hiding') {
    if ((workInProgress.mode & ConcurrentMode) === NoMode) {
      // In legacy sync mode, don't defer the subtree. Render it now.
      // TODO: Figure out what we should do in Blocking mode.
      var nextState = {
        baseLanes: NoLanes
      };
      workInProgress.memoizedState = nextState;
      pushRenderLanes(workInProgress, renderLanes);
    } else if (!includesSomeLane(renderLanes, OffscreenLane)) {
      var nextBaseLanes;

      if (prevState !== null) {
        var prevBaseLanes = prevState.baseLanes;
        nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes);
      } else {
        nextBaseLanes = renderLanes;
      } // Schedule this fiber to re-render at offscreen priority. Then bailout.


      {
        markSpawnedWork(OffscreenLane);
      }

      workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane);
      var _nextState = {
        baseLanes: nextBaseLanes
      };
      workInProgress.memoizedState = _nextState; // We're about to bail out, but we need to push this to the stack anyway
      // to avoid a push/pop misalignment.

      pushRenderLanes(workInProgress, nextBaseLanes);
      return null;
    } else {
      // Rendering at offscreen, so we can clear the base lanes.
      var _nextState2 = {
        baseLanes: NoLanes
      };
      workInProgress.memoizedState = _nextState2; // Push the lanes that were skipped when we bailed out.

      var subtreeRenderLanes = prevState !== null ? prevState.baseLanes : renderLanes;
      pushRenderLanes(workInProgress, subtreeRenderLanes);
    }
  } else {
    var _subtreeRenderLanes;

    if (prevState !== null) {
      _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes); // Since we're not hidden anymore, reset the state

      workInProgress.memoizedState = null;
    } else {
      // We weren't previously hidden, and we still aren't, so there's nothing
      // special to do. Need to push to the stack regardless, though, to avoid
      // a push/pop misalignment.
      _subtreeRenderLanes = renderLanes;
    }

    pushRenderLanes(workInProgress, _subtreeRenderLanes);
  }

  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
} // Note: These happen to have identical begin phases, for now. We shouldn't hold
// ourselves to this constraint, though. If the behavior diverges, we should
// fork the function.


var updateLegacyHiddenComponent = updateOffscreenComponent;

function updateFragment(current, workInProgress, renderLanes) {
  var nextChildren = workInProgress.pendingProps;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateMode(current, workInProgress, renderLanes) {
  var nextChildren = workInProgress.pendingProps.children;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateProfiler(current, workInProgress, renderLanes) {
  {
    workInProgress.flags |= Update; // Reset effect durations for the next eventual effect phase.
    // These are reset during render to allow the DevTools commit hook a chance to read them,

    var stateNode = workInProgress.stateNode;
    stateNode.effectDuration = 0;
    stateNode.passiveEffectDuration = 0;
  }

  var nextProps = workInProgress.pendingProps;
  var nextChildren = nextProps.children;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function markRef(current, workInProgress) {
  var ref = workInProgress.ref;

  if (current === null && ref !== null || current !== null && current.ref !== ref) {
    // Schedule a Ref effect
    workInProgress.flags |= Ref;
  }
}

function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) {
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;

      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component));
      }
    }
  }

  var context;

  {
    var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
    context = getMaskedContext(workInProgress, unmaskedContext);
  }

  var nextChildren;
  prepareToReadContext(workInProgress, renderLanes);

  {
    ReactCurrentOwner$1.current = workInProgress;
    setIsRendering(true);
    nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);

    if ( workInProgress.mode & StrictMode) {
      disableLogs();

      try {
        nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);
      } finally {
        reenableLogs();
      }
    }

    setIsRendering(false);
  }

  if (current !== null && !didReceiveUpdate) {
    bailoutHooks(current, workInProgress, renderLanes);
    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) {
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;

      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component));
      }
    }
  } // Push context providers early to prevent context stack mismatches.
  // During mounting we don't know the child context yet as the instance doesn't exist.
  // We will invalidate the child context in finishClassComponent() right after rendering.


  var hasContext;

  if (isContextProvider(Component)) {
    hasContext = true;
    pushContextProvider(workInProgress);
  } else {
    hasContext = false;
  }

  prepareToReadContext(workInProgress, renderLanes);
  var instance = workInProgress.stateNode;
  var shouldUpdate;

  if (instance === null) {
    if (current !== null) {
      // A class component without an instance only mounts if it suspended
      // inside a non-concurrent tree, in an inconsistent state. We want to
      // treat it like a new mount, even though an empty version of it already
      // committed. Disconnect the alternate pointers.
      current.alternate = null;
      workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect

      workInProgress.flags |= Placement;
    } // In the initial pass we might need to construct the instance.


    constructClassInstance(workInProgress, Component, nextProps);
    mountClassInstance(workInProgress, Component, nextProps, renderLanes);
    shouldUpdate = true;
  } else if (current === null) {
    // In a resume, we'll already have an instance we can reuse.
    shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes);
  } else {
    shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes);
  }

  var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes);

  {
    var inst = workInProgress.stateNode;

    if (shouldUpdate && inst.props !== nextProps) {
      if (!didWarnAboutReassigningProps) {
        error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component');
      }

      didWarnAboutReassigningProps = true;
    }
  }

  return nextUnitOfWork;
}

function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) {
  // Refs should update even if shouldComponentUpdate returns false
  markRef(current, workInProgress);
  var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags;

  if (!shouldUpdate && !didCaptureError) {
    // Context providers should defer to sCU for rendering
    if (hasContext) {
      invalidateContextProvider(workInProgress, Component, false);
    }

    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  }

  var instance = workInProgress.stateNode; // Rerender

  ReactCurrentOwner$1.current = workInProgress;
  var nextChildren;

  if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
    // If we captured an error, but getDerivedStateFromError is not defined,
    // unmount all the children. componentDidCatch will schedule an update to
    // re-render a fallback. This is temporary until we migrate everyone to
    // the new API.
    // TODO: Warn in a future release.
    nextChildren = null;

    {
      stopProfilerTimerIfRunning();
    }
  } else {
    {
      setIsRendering(true);
      nextChildren = instance.render();

      if ( workInProgress.mode & StrictMode) {
        disableLogs();

        try {
          instance.render();
        } finally {
          reenableLogs();
        }
      }

      setIsRendering(false);
    }
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;

  if (current !== null && didCaptureError) {
    // If we're recovering from an error, reconcile without reusing any of
    // the existing children. Conceptually, the normal children and the children
    // that are shown on error are two different sets, so we shouldn't reuse
    // normal children even if their identities match.
    forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes);
  } else {
    reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  } // Memoize state using the values we just used to render.
  // TODO: Restructure so we never read values from the instance.


  workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.

  if (hasContext) {
    invalidateContextProvider(workInProgress, Component, true);
  }

  return workInProgress.child;
}

function pushHostRootContext(workInProgress) {
  var root = workInProgress.stateNode;

  if (root.pendingContext) {
    pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
  } else if (root.context) {
    // Should always be set
    pushTopLevelContextObject(workInProgress, root.context, false);
  }

  pushHostContainer(workInProgress, root.containerInfo);
}

function updateHostRoot(current, workInProgress, renderLanes) {
  pushHostRootContext(workInProgress);
  var updateQueue = workInProgress.updateQueue;

  if (!(current !== null && updateQueue !== null)) {
    {
      throw Error( "If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue." );
    }
  }

  var nextProps = workInProgress.pendingProps;
  var prevState = workInProgress.memoizedState;
  var prevChildren = prevState !== null ? prevState.element : null;
  cloneUpdateQueue(current, workInProgress);
  processUpdateQueue(workInProgress, nextProps, null, renderLanes);
  var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property
  // being called "element".

  var nextChildren = nextState.element;

  if (nextChildren === prevChildren) {
    resetHydrationState();
    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  }

  var root = workInProgress.stateNode;

  if (root.hydrate && enterHydrationState(workInProgress)) {
    // If we don't have any current children this might be the first pass.
    // We always try to hydrate. If this isn't a hydration pass there won't
    // be any children to hydrate which is effectively the same thing as
    // not hydrating.
    {
      var mutableSourceEagerHydrationData = root.mutableSourceEagerHydrationData;

      if (mutableSourceEagerHydrationData != null) {
        for (var i = 0; i < mutableSourceEagerHydrationData.length; i += 2) {
          var mutableSource = mutableSourceEagerHydrationData[i];
          var version = mutableSourceEagerHydrationData[i + 1];
          setWorkInProgressVersion(mutableSource, version);
        }
      }
    }

    var child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);
    workInProgress.child = child;
    var node = child;

    while (node) {
      // Mark each child as hydrating. This is a fast path to know whether this
      // tree is part of a hydrating tree. This is used to determine if a child
      // node has fully mounted yet, and for scheduling event replaying.
      // Conceptually this is similar to Placement in that a new subtree is
      // inserted into the React tree here. It just happens to not need DOM
      // mutations because it already exists.
      node.flags = node.flags & ~Placement | Hydrating;
      node = node.sibling;
    }
  } else {
    // Otherwise reset hydration state in case we aborted and resumed another
    // root.
    reconcileChildren(current, workInProgress, nextChildren, renderLanes);
    resetHydrationState();
  }

  return workInProgress.child;
}

function updateHostComponent(current, workInProgress, renderLanes) {
  pushHostContext(workInProgress);

  if (current === null) {
    tryToClaimNextHydratableInstance(workInProgress);
  }

  var type = workInProgress.type;
  var nextProps = workInProgress.pendingProps;
  var prevProps = current !== null ? current.memoizedProps : null;
  var nextChildren = nextProps.children;
  var isDirectTextChild = shouldSetTextContent(type, nextProps);

  if (isDirectTextChild) {
    // We special case a direct text child of a host node. This is a common
    // case. We won't handle it as a reified child. We will instead handle
    // this in the host environment that also has access to this prop. That
    // avoids allocating another HostText fiber and traversing it.
    nextChildren = null;
  } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
    // If we're switching from a direct text child to a normal child, or to
    // empty, we need to schedule the text content to be reset.
    workInProgress.flags |= ContentReset;
  }

  markRef(current, workInProgress);
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateHostText(current, workInProgress) {
  if (current === null) {
    tryToClaimNextHydratableInstance(workInProgress);
  } // Nothing to do here. This is terminal. We'll do the completion step
  // immediately after.


  return null;
}

function mountLazyComponent(_current, workInProgress, elementType, updateLanes, renderLanes) {
  if (_current !== null) {
    // A lazy component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect

    workInProgress.flags |= Placement;
  }

  var props = workInProgress.pendingProps;
  var lazyComponent = elementType;
  var payload = lazyComponent._payload;
  var init = lazyComponent._init;
  var Component = init(payload); // Store the unwrapped component in the type.

  workInProgress.type = Component;
  var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
  var resolvedProps = resolveDefaultProps(Component, props);
  var child;

  switch (resolvedTag) {
    case FunctionComponent:
      {
        {
          validateFunctionComponentInDev(workInProgress, Component);
          workInProgress.type = Component = resolveFunctionForHotReloading(Component);
        }

        child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes);
        return child;
      }

    case ClassComponent:
      {
        {
          workInProgress.type = Component = resolveClassForHotReloading(Component);
        }

        child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes);
        return child;
      }

    case ForwardRef:
      {
        {
          workInProgress.type = Component = resolveForwardRefForHotReloading(Component);
        }

        child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes);
        return child;
      }

    case MemoComponent:
      {
        {
          if (workInProgress.type !== workInProgress.elementType) {
            var outerPropTypes = Component.propTypes;

            if (outerPropTypes) {
              checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only
              'prop', getComponentName(Component));
            }
          }
        }

        child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
        updateLanes, renderLanes);
        return child;
      }
  }

  var hint = '';

  {
    if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
      hint = ' Did you wrap a component in React.lazy() more than once?';
    }
  } // This message intentionally doesn't mention ForwardRef or MemoComponent
  // because the fact that it's a separate type of work is an
  // implementation detail.


  {
    {
      throw Error( "Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint );
    }
  }
}

function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) {
  if (_current !== null) {
    // An incomplete component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect

    workInProgress.flags |= Placement;
  } // Promote the fiber to a class and try rendering again.


  workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent`
  // Push context providers early to prevent context stack mismatches.
  // During mounting we don't know the child context yet as the instance doesn't exist.
  // We will invalidate the child context in finishClassComponent() right after rendering.

  var hasContext;

  if (isContextProvider(Component)) {
    hasContext = true;
    pushContextProvider(workInProgress);
  } else {
    hasContext = false;
  }

  prepareToReadContext(workInProgress, renderLanes);
  constructClassInstance(workInProgress, Component, nextProps);
  mountClassInstance(workInProgress, Component, nextProps, renderLanes);
  return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);
}

function mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) {
  if (_current !== null) {
    // An indeterminate component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect

    workInProgress.flags |= Placement;
  }

  var props = workInProgress.pendingProps;
  var context;

  {
    var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
    context = getMaskedContext(workInProgress, unmaskedContext);
  }

  prepareToReadContext(workInProgress, renderLanes);
  var value;

  {
    if (Component.prototype && typeof Component.prototype.render === 'function') {
      var componentName = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutBadClass[componentName]) {
        error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);

        didWarnAboutBadClass[componentName] = true;
      }
    }

    if (workInProgress.mode & StrictMode) {
      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
    }

    setIsRendering(true);
    ReactCurrentOwner$1.current = workInProgress;
    value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);
    setIsRendering(false);
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;

  {
    // Support for module components is deprecated and is removed behind a flag.
    // Whether or not it would crash later, we want to show a good message in DEV first.
    if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
      var _componentName = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutModulePatternComponent[_componentName]) {
        error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);

        didWarnAboutModulePatternComponent[_componentName] = true;
      }
    }
  }

  if ( // Run these checks in production only if the flag is off.
  // Eventually we'll delete this branch altogether.
   typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
    {
      var _componentName2 = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutModulePatternComponent[_componentName2]) {
        error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName2, _componentName2, _componentName2);

        didWarnAboutModulePatternComponent[_componentName2] = true;
      }
    } // Proceed under the assumption that this is a class instance


    workInProgress.tag = ClassComponent; // Throw out any hooks that were used.

    workInProgress.memoizedState = null;
    workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches.
    // During mounting we don't know the child context yet as the instance doesn't exist.
    // We will invalidate the child context in finishClassComponent() right after rendering.

    var hasContext = false;

    if (isContextProvider(Component)) {
      hasContext = true;
      pushContextProvider(workInProgress);
    } else {
      hasContext = false;
    }

    workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;
    initializeUpdateQueue(workInProgress);
    var getDerivedStateFromProps = Component.getDerivedStateFromProps;

    if (typeof getDerivedStateFromProps === 'function') {
      applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);
    }

    adoptClassInstance(workInProgress, value);
    mountClassInstance(workInProgress, Component, props, renderLanes);
    return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);
  } else {
    // Proceed under the assumption that this is a function component
    workInProgress.tag = FunctionComponent;

    {

      if ( workInProgress.mode & StrictMode) {
        disableLogs();

        try {
          value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);
        } finally {
          reenableLogs();
        }
      }
    }

    reconcileChildren(null, workInProgress, value, renderLanes);

    {
      validateFunctionComponentInDev(workInProgress, Component);
    }

    return workInProgress.child;
  }
}

function validateFunctionComponentInDev(workInProgress, Component) {
  {
    if (Component) {
      if (Component.childContextTypes) {
        error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');
      }
    }

    if (workInProgress.ref !== null) {
      var info = '';
      var ownerName = getCurrentFiberOwnerNameInDevOrNull();

      if (ownerName) {
        info += '\n\nCheck the render method of `' + ownerName + '`.';
      }

      var warningKey = ownerName || workInProgress._debugID || '';
      var debugSource = workInProgress._debugSource;

      if (debugSource) {
        warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
      }

      if (!didWarnAboutFunctionRefs[warningKey]) {
        didWarnAboutFunctionRefs[warningKey] = true;

        error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);
      }
    }

    if (typeof Component.getDerivedStateFromProps === 'function') {
      var _componentName3 = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
        error('%s: Function components do not support getDerivedStateFromProps.', _componentName3);

        didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
      }
    }

    if (typeof Component.contextType === 'object' && Component.contextType !== null) {
      var _componentName4 = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
        error('%s: Function components do not support contextType.', _componentName4);

        didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
      }
    }
  }
}

var SUSPENDED_MARKER = {
  dehydrated: null,
  retryLane: NoLane
};

function mountSuspenseOffscreenState(renderLanes) {
  return {
    baseLanes: renderLanes
  };
}

function updateSuspenseOffscreenState(prevOffscreenState, renderLanes) {
  return {
    baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes)
  };
} // TODO: Probably should inline this back


function shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) {
  // If we're already showing a fallback, there are cases where we need to
  // remain on that fallback regardless of whether the content has resolved.
  // For example, SuspenseList coordinates when nested content appears.
  if (current !== null) {
    var suspenseState = current.memoizedState;

    if (suspenseState === null) {
      // Currently showing content. Don't hide it, even if ForceSuspenseFallack
      // is true. More precise name might be "ForceRemainSuspenseFallback".
      // Note: This is a factoring smell. Can't remain on a fallback if there's
      // no fallback to remain on.
      return false;
    }
  } // Not currently showing content. Consult the Suspense context.


  return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
}

function getRemainingWorkInPrimaryTree(current, renderLanes) {
  // TODO: Should not remove render lanes that were pinged during this render
  return removeLanes(current.childLanes, renderLanes);
}

function updateSuspenseComponent(current, workInProgress, renderLanes) {
  var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.

  {
    if (shouldSuspend(workInProgress)) {
      workInProgress.flags |= DidCapture;
    }
  }

  var suspenseContext = suspenseStackCursor.current;
  var showFallback = false;
  var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags;

  if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {
    // Something in this boundary's subtree already suspended. Switch to
    // rendering the fallback children.
    showFallback = true;
    workInProgress.flags &= ~DidCapture;
  } else {
    // Attempting the main content
    if (current === null || current.memoizedState !== null) {
      // This is a new mount or this boundary is already showing a fallback state.
      // Mark this subtree context as having at least one invisible parent that could
      // handle the fallback state.
      // Boundaries without fallbacks or should be avoided are not considered since
      // they cannot handle preferred fallback states.
      if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {
        suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
      }
    }
  }

  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  pushSuspenseContext(workInProgress, suspenseContext); // OK, the next part is confusing. We're about to reconcile the Suspense
  // boundary's children. This involves some custom reconcilation logic. Two
  // main reasons this is so complicated.
  //
  // First, Legacy Mode has different semantics for backwards compatibility. The
  // primary tree will commit in an inconsistent state, so when we do the
  // second pass to render the fallback, we do some exceedingly, uh, clever
  // hacks to make that not totally break. Like transferring effects and
  // deletions from hidden tree. In Concurrent Mode, it's much simpler,
  // because we bailout on the primary tree completely and leave it in its old
  // state, no effects. Same as what we do for Offscreen (except that
  // Offscreen doesn't have the first render pass).
  //
  // Second is hydration. During hydration, the Suspense fiber has a slightly
  // different layout, where the child points to a dehydrated fragment, which
  // contains the DOM rendered by the server.
  //
  // Third, even if you set all that aside, Suspense is like error boundaries in
  // that we first we try to render one tree, and if that fails, we render again
  // and switch to a different tree. Like a try/catch block. So we have to track
  // which branch we're currently rendering. Ideally we would model this using
  // a stack.

  if (current === null) {
    // Initial mount
    // If we're currently hydrating, try to hydrate this boundary.
    // But only if this has a fallback.
    if (nextProps.fallback !== undefined) {
      tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.
    }

    var nextPrimaryChildren = nextProps.children;
    var nextFallbackChildren = nextProps.fallback;

    if (showFallback) {
      var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);
      var primaryChildFragment = workInProgress.child;
      primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);
      workInProgress.memoizedState = SUSPENDED_MARKER;
      return fallbackFragment;
    } else if (typeof nextProps.unstable_expectedLoadTime === 'number') {
      // This is a CPU-bound tree. Skip this tree and show a placeholder to
      // unblock the surrounding content. Then immediately retry after the
      // initial commit.
      var _fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);

      var _primaryChildFragment = workInProgress.child;
      _primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);
      workInProgress.memoizedState = SUSPENDED_MARKER; // Since nothing actually suspended, there will nothing to ping this to
      // get it started back up to attempt the next item. While in terms of
      // priority this work has the same priority as this current render, it's
      // not part of the same transition once the transition has committed. If
      // it's sync, we still want to yield so that it can be painted.
      // Conceptually, this is really the same as pinging. We can use any
      // RetryLane even if it's the one currently rendering since we're leaving
      // it behind on this node.

      workInProgress.lanes = SomeRetryLane;

      {
        markSpawnedWork(SomeRetryLane);
      }

      return _fallbackFragment;
    } else {
      return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren, renderLanes);
    }
  } else {
    // This is an update.
    // If the current fiber has a SuspenseState, that means it's already showing
    // a fallback.
    var prevState = current.memoizedState;

    if (prevState !== null) {

      if (showFallback) {
        var _nextFallbackChildren2 = nextProps.fallback;
        var _nextPrimaryChildren2 = nextProps.children;

        var _fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren2, _nextFallbackChildren2, renderLanes);

        var _primaryChildFragment3 = workInProgress.child;
        var prevOffscreenState = current.child.memoizedState;
        _primaryChildFragment3.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes);
        _primaryChildFragment3.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes);
        workInProgress.memoizedState = SUSPENDED_MARKER;
        return _fallbackChildFragment;
      } else {
        var _nextPrimaryChildren3 = nextProps.children;

        var _primaryChildFragment4 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren3, renderLanes);

        workInProgress.memoizedState = null;
        return _primaryChildFragment4;
      }
    } else {
      // The current tree is not already showing a fallback.
      if (showFallback) {
        // Timed out.
        var _nextFallbackChildren3 = nextProps.fallback;
        var _nextPrimaryChildren4 = nextProps.children;

        var _fallbackChildFragment2 = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren4, _nextFallbackChildren3, renderLanes);

        var _primaryChildFragment5 = workInProgress.child;
        var _prevOffscreenState = current.child.memoizedState;
        _primaryChildFragment5.memoizedState = _prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(_prevOffscreenState, renderLanes);
        _primaryChildFragment5.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); // Skip the primary children, and continue working on the
        // fallback children.

        workInProgress.memoizedState = SUSPENDED_MARKER;
        return _fallbackChildFragment2;
      } else {
        // Still haven't timed out. Continue rendering the children, like we
        // normally do.
        var _nextPrimaryChildren5 = nextProps.children;

        var _primaryChildFragment6 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren5, renderLanes);

        workInProgress.memoizedState = null;
        return _primaryChildFragment6;
      }
    }
  }
}

function mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) {
  var mode = workInProgress.mode;
  var primaryChildProps = {
    mode: 'visible',
    children: primaryChildren
  };
  var primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, renderLanes, null);
  primaryChildFragment.return = workInProgress;
  workInProgress.child = primaryChildFragment;
  return primaryChildFragment;
}

function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) {
  var mode = workInProgress.mode;
  var progressedPrimaryFragment = workInProgress.child;
  var primaryChildProps = {
    mode: 'hidden',
    children: primaryChildren
  };
  var primaryChildFragment;
  var fallbackChildFragment;

  if ((mode & BlockingMode) === NoMode && progressedPrimaryFragment !== null) {
    // In legacy mode, we commit the primary tree as if it successfully
    // completed, even though it's in an inconsistent state.
    primaryChildFragment = progressedPrimaryFragment;
    primaryChildFragment.childLanes = NoLanes;
    primaryChildFragment.pendingProps = primaryChildProps;

    if ( workInProgress.mode & ProfileMode) {
      // Reset the durations from the first pass so they aren't included in the
      // final amounts. This seems counterintuitive, since we're intentionally
      // not measuring part of the render phase, but this makes it match what we
      // do in Concurrent Mode.
      primaryChildFragment.actualDuration = 0;
      primaryChildFragment.actualStartTime = -1;
      primaryChildFragment.selfBaseDuration = 0;
      primaryChildFragment.treeBaseDuration = 0;
    }

    fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);
  } else {
    primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, NoLanes, null);
    fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);
  }

  primaryChildFragment.return = workInProgress;
  fallbackChildFragment.return = workInProgress;
  primaryChildFragment.sibling = fallbackChildFragment;
  workInProgress.child = primaryChildFragment;
  return fallbackChildFragment;
}

function createWorkInProgressOffscreenFiber(current, offscreenProps) {
  // The props argument to `createWorkInProgress` is `any` typed, so we use this
  // wrapper function to constrain it.
  return createWorkInProgress(current, offscreenProps);
}

function updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) {
  var currentPrimaryChildFragment = current.child;
  var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
  var primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
    mode: 'visible',
    children: primaryChildren
  });

  if ((workInProgress.mode & BlockingMode) === NoMode) {
    primaryChildFragment.lanes = renderLanes;
  }

  primaryChildFragment.return = workInProgress;
  primaryChildFragment.sibling = null;

  if (currentFallbackChildFragment !== null) {
    // Delete the fallback child fragment
    currentFallbackChildFragment.nextEffect = null;
    currentFallbackChildFragment.flags = Deletion;
    workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChildFragment;
  }

  workInProgress.child = primaryChildFragment;
  return primaryChildFragment;
}

function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) {
  var mode = workInProgress.mode;
  var currentPrimaryChildFragment = current.child;
  var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
  var primaryChildProps = {
    mode: 'hidden',
    children: primaryChildren
  };
  var primaryChildFragment;

  if ( // In legacy mode, we commit the primary tree as if it successfully
  // completed, even though it's in an inconsistent state.
  (mode & BlockingMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was
  // already cloned. In legacy mode, the only case where this isn't true is
  // when DevTools forces us to display a fallback; we skip the first render
  // pass entirely and go straight to rendering the fallback. (In Concurrent
  // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
  // only codepath.)
  workInProgress.child !== currentPrimaryChildFragment) {
    var progressedPrimaryFragment = workInProgress.child;
    primaryChildFragment = progressedPrimaryFragment;
    primaryChildFragment.childLanes = NoLanes;
    primaryChildFragment.pendingProps = primaryChildProps;

    if ( workInProgress.mode & ProfileMode) {
      // Reset the durations from the first pass so they aren't included in the
      // final amounts. This seems counterintuitive, since we're intentionally
      // not measuring part of the render phase, but this makes it match what we
      // do in Concurrent Mode.
      primaryChildFragment.actualDuration = 0;
      primaryChildFragment.actualStartTime = -1;
      primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
      primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
    } // The fallback fiber was added as a deletion effect during the first pass.
    // However, since we're going to remain on the fallback, we no longer want
    // to delete it. So we need to remove it from the list. Deletions are stored
    // on the same list as effects. We want to keep the effects from the primary
    // tree. So we copy the primary child fragment's effect list, which does not
    // include the fallback deletion effect.


    var progressedLastEffect = primaryChildFragment.lastEffect;

    if (progressedLastEffect !== null) {
      workInProgress.firstEffect = primaryChildFragment.firstEffect;
      workInProgress.lastEffect = progressedLastEffect;
      progressedLastEffect.nextEffect = null;
    } else {
      // TODO: Reset this somewhere else? Lol legacy mode is so weird.
      workInProgress.firstEffect = workInProgress.lastEffect = null;
    }
  } else {
    primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
  }

  var fallbackChildFragment;

  if (currentFallbackChildFragment !== null) {
    fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
  } else {
    fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); // Needs a placement effect because the parent (the Suspense boundary) already
    // mounted but this is a new fiber.

    fallbackChildFragment.flags |= Placement;
  }

  fallbackChildFragment.return = workInProgress;
  primaryChildFragment.return = workInProgress;
  primaryChildFragment.sibling = fallbackChildFragment;
  workInProgress.child = primaryChildFragment;
  return fallbackChildFragment;
}

function scheduleWorkOnFiber(fiber, renderLanes) {
  fiber.lanes = mergeLanes(fiber.lanes, renderLanes);
  var alternate = fiber.alternate;

  if (alternate !== null) {
    alternate.lanes = mergeLanes(alternate.lanes, renderLanes);
  }

  scheduleWorkOnParentPath(fiber.return, renderLanes);
}

function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) {
  // Mark any Suspense boundaries with fallbacks as having work to do.
  // If they were previously forced into fallbacks, they may now be able
  // to unblock.
  var node = firstChild;

  while (node !== null) {
    if (node.tag === SuspenseComponent) {
      var state = node.memoizedState;

      if (state !== null) {
        scheduleWorkOnFiber(node, renderLanes);
      }
    } else if (node.tag === SuspenseListComponent) {
      // If the tail is hidden there might not be an Suspense boundaries
      // to schedule work on. In this case we have to schedule it on the
      // list itself.
      // We don't have to traverse to the children of the list since
      // the list will propagate the change when it rerenders.
      scheduleWorkOnFiber(node, renderLanes);
    } else if (node.child !== null) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === workInProgress) {
      return;
    }

    while (node.sibling === null) {
      if (node.return === null || node.return === workInProgress) {
        return;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function findLastContentRow(firstChild) {
  // This is going to find the last row among these children that is already
  // showing content on the screen, as opposed to being in fallback state or
  // new. If a row has multiple Suspense boundaries, any of them being in the
  // fallback state, counts as the whole row being in a fallback state.
  // Note that the "rows" will be workInProgress, but any nested children
  // will still be current since we haven't rendered them yet. The mounted
  // order may not be the same as the new order. We use the new order.
  var row = firstChild;
  var lastContentRow = null;

  while (row !== null) {
    var currentRow = row.alternate; // New rows can't be content rows.

    if (currentRow !== null && findFirstSuspended(currentRow) === null) {
      lastContentRow = row;
    }

    row = row.sibling;
  }

  return lastContentRow;
}

function validateRevealOrder(revealOrder) {
  {
    if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {
      didWarnAboutRevealOrder[revealOrder] = true;

      if (typeof revealOrder === 'string') {
        switch (revealOrder.toLowerCase()) {
          case 'together':
          case 'forwards':
          case 'backwards':
            {
              error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());

              break;
            }

          case 'forward':
          case 'backward':
            {
              error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());

              break;
            }

          default:
            error('"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);

            break;
        }
      } else {
        error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
      }
    }
  }
}

function validateTailOptions(tailMode, revealOrder) {
  {
    if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {
      if (tailMode !== 'collapsed' && tailMode !== 'hidden') {
        didWarnAboutTailOptions[tailMode] = true;

        error('"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode);
      } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {
        didWarnAboutTailOptions[tailMode] = true;

        error('<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode);
      }
    }
  }
}

function validateSuspenseListNestedChild(childSlot, index) {
  {
    var isArray = Array.isArray(childSlot);
    var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';

    if (isArray || isIterable) {
      var type = isArray ? 'array' : 'iterable';

      error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);

      return false;
    }
  }

  return true;
}

function validateSuspenseListChildren(children, revealOrder) {
  {
    if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {
      if (Array.isArray(children)) {
        for (var i = 0; i < children.length; i++) {
          if (!validateSuspenseListNestedChild(children[i], i)) {
            return;
          }
        }
      } else {
        var iteratorFn = getIteratorFn(children);

        if (typeof iteratorFn === 'function') {
          var childrenIterator = iteratorFn.call(children);

          if (childrenIterator) {
            var step = childrenIterator.next();
            var _i = 0;

            for (; !step.done; step = childrenIterator.next()) {
              if (!validateSuspenseListNestedChild(step.value, _i)) {
                return;
              }

              _i++;
            }
          }
        } else {
          error('A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);
        }
      }
    }
  }
}

function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {
  var renderState = workInProgress.memoizedState;

  if (renderState === null) {
    workInProgress.memoizedState = {
      isBackwards: isBackwards,
      rendering: null,
      renderingStartTime: 0,
      last: lastContentRow,
      tail: tail,
      tailMode: tailMode,
      lastEffect: lastEffectBeforeRendering
    };
  } else {
    // We can reuse the existing object from previous renders.
    renderState.isBackwards = isBackwards;
    renderState.rendering = null;
    renderState.renderingStartTime = 0;
    renderState.last = lastContentRow;
    renderState.tail = tail;
    renderState.tailMode = tailMode;
    renderState.lastEffect = lastEffectBeforeRendering;
  }
} // This can end up rendering this component multiple passes.
// The first pass splits the children fibers into two sets. A head and tail.
// We first render the head. If anything is in fallback state, we do another
// pass through beginWork to rerender all children (including the tail) with
// the force suspend context. If the first render didn't have anything in
// in fallback state. Then we render each row in the tail one-by-one.
// That happens in the completeWork phase without going back to beginWork.


function updateSuspenseListComponent(current, workInProgress, renderLanes) {
  var nextProps = workInProgress.pendingProps;
  var revealOrder = nextProps.revealOrder;
  var tailMode = nextProps.tail;
  var newChildren = nextProps.children;
  validateRevealOrder(revealOrder);
  validateTailOptions(tailMode, revealOrder);
  validateSuspenseListChildren(newChildren, revealOrder);
  reconcileChildren(current, workInProgress, newChildren, renderLanes);
  var suspenseContext = suspenseStackCursor.current;
  var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);

  if (shouldForceFallback) {
    suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
    workInProgress.flags |= DidCapture;
  } else {
    var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags;

    if (didSuspendBefore) {
      // If we previously forced a fallback, we need to schedule work
      // on any nested boundaries to let them know to try to render
      // again. This is the same as context updating.
      propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes);
    }

    suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  }

  pushSuspenseContext(workInProgress, suspenseContext);

  if ((workInProgress.mode & BlockingMode) === NoMode) {
    // In legacy mode, SuspenseList doesn't work so we just
    // use make it a noop by treating it as the default revealOrder.
    workInProgress.memoizedState = null;
  } else {
    switch (revealOrder) {
      case 'forwards':
        {
          var lastContentRow = findLastContentRow(workInProgress.child);
          var tail;

          if (lastContentRow === null) {
            // The whole list is part of the tail.
            // TODO: We could fast path by just rendering the tail now.
            tail = workInProgress.child;
            workInProgress.child = null;
          } else {
            // Disconnect the tail rows after the content row.
            // We're going to render them separately later.
            tail = lastContentRow.sibling;
            lastContentRow.sibling = null;
          }

          initSuspenseListRenderState(workInProgress, false, // isBackwards
          tail, lastContentRow, tailMode, workInProgress.lastEffect);
          break;
        }

      case 'backwards':
        {
          // We're going to find the first row that has existing content.
          // At the same time we're going to reverse the list of everything
          // we pass in the meantime. That's going to be our tail in reverse
          // order.
          var _tail = null;
          var row = workInProgress.child;
          workInProgress.child = null;

          while (row !== null) {
            var currentRow = row.alternate; // New rows can't be content rows.

            if (currentRow !== null && findFirstSuspended(currentRow) === null) {
              // This is the beginning of the main content.
              workInProgress.child = row;
              break;
            }

            var nextRow = row.sibling;
            row.sibling = _tail;
            _tail = row;
            row = nextRow;
          } // TODO: If workInProgress.child is null, we can continue on the tail immediately.


          initSuspenseListRenderState(workInProgress, true, // isBackwards
          _tail, null, // last
          tailMode, workInProgress.lastEffect);
          break;
        }

      case 'together':
        {
          initSuspenseListRenderState(workInProgress, false, // isBackwards
          null, // tail
          null, // last
          undefined, workInProgress.lastEffect);
          break;
        }

      default:
        {
          // The default reveal order is the same as not having
          // a boundary.
          workInProgress.memoizedState = null;
        }
    }
  }

  return workInProgress.child;
}

function updatePortalComponent(current, workInProgress, renderLanes) {
  pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  var nextChildren = workInProgress.pendingProps;

  if (current === null) {
    // Portals are special because we don't append the children during mount
    // but at commit. Therefore we need to track insertions which the normal
    // flow doesn't do during mount. This doesn't happen at the root because
    // the root always starts with a "current" with a null child.
    // TODO: Consider unifying this with how the root works.
    workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);
  } else {
    reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  }

  return workInProgress.child;
}

var hasWarnedAboutUsingNoValuePropOnContextProvider = false;

function updateContextProvider(current, workInProgress, renderLanes) {
  var providerType = workInProgress.type;
  var context = providerType._context;
  var newProps = workInProgress.pendingProps;
  var oldProps = workInProgress.memoizedProps;
  var newValue = newProps.value;

  {
    if (!('value' in newProps)) {
      if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
        hasWarnedAboutUsingNoValuePropOnContextProvider = true;

        error('The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?');
      }
    }

    var providerPropTypes = workInProgress.type.propTypes;

    if (providerPropTypes) {
      checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider');
    }
  }

  pushProvider(workInProgress, newValue);

  if (oldProps !== null) {
    var oldValue = oldProps.value;
    var changedBits = calculateChangedBits(context, newValue, oldValue);

    if (changedBits === 0) {
      // No change. Bailout early if children are the same.
      if (oldProps.children === newProps.children && !hasContextChanged()) {
        return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
      }
    } else {
      // The context value changed. Search for matching consumers and schedule
      // them to update.
      propagateContextChange(workInProgress, context, changedBits, renderLanes);
    }
  }

  var newChildren = newProps.children;
  reconcileChildren(current, workInProgress, newChildren, renderLanes);
  return workInProgress.child;
}

var hasWarnedAboutUsingContextAsConsumer = false;

function updateContextConsumer(current, workInProgress, renderLanes) {
  var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In
  // DEV mode, we create a separate object for Context.Consumer that acts
  // like a proxy to Context. This proxy object adds unnecessary code in PROD
  // so we use the old behaviour (Context.Consumer references Context) to
  // reduce size and overhead. The separate object references context via
  // a property called "_context", which also gives us the ability to check
  // in DEV mode if this property exists or not and warn if it does not.

  {
    if (context._context === undefined) {
      // This may be because it's a Context (rather than a Consumer).
      // Or it may be because it's older React where they're the same thing.
      // We only want to warn if we're sure it's a new React.
      if (context !== context.Consumer) {
        if (!hasWarnedAboutUsingContextAsConsumer) {
          hasWarnedAboutUsingContextAsConsumer = true;

          error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
        }
      }
    } else {
      context = context._context;
    }
  }

  var newProps = workInProgress.pendingProps;
  var render = newProps.children;

  {
    if (typeof render !== 'function') {
      error('A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');
    }
  }

  prepareToReadContext(workInProgress, renderLanes);
  var newValue = readContext(context, newProps.unstable_observedBits);
  var newChildren;

  {
    ReactCurrentOwner$1.current = workInProgress;
    setIsRendering(true);
    newChildren = render(newValue);
    setIsRendering(false);
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;
  reconcileChildren(current, workInProgress, newChildren, renderLanes);
  return workInProgress.child;
}

function markWorkInProgressReceivedUpdate() {
  didReceiveUpdate = true;
}

function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
  if (current !== null) {
    // Reuse previous dependencies
    workInProgress.dependencies = current.dependencies;
  }

  {
    // Don't update "base" render times for bailouts.
    stopProfilerTimerIfRunning();
  }

  markSkippedUpdateLanes(workInProgress.lanes); // Check if the children have any pending work.

  if (!includesSomeLane(renderLanes, workInProgress.childLanes)) {
    // The children don't have any work either. We can skip them.
    // TODO: Once we add back resuming, we should check if the children are
    // a work-in-progress set. If so, we need to transfer their effects.
    return null;
  } else {
    // This fiber doesn't have work, but its subtree does. Clone the child
    // fibers and continue.
    cloneChildFibers(current, workInProgress);
    return workInProgress.child;
  }
}

function remountFiber(current, oldWorkInProgress, newWorkInProgress) {
  {
    var returnFiber = oldWorkInProgress.return;

    if (returnFiber === null) {
      throw new Error('Cannot swap the root fiber.');
    } // Disconnect from the old current.
    // It will get deleted.


    current.alternate = null;
    oldWorkInProgress.alternate = null; // Connect to the new tree.

    newWorkInProgress.index = oldWorkInProgress.index;
    newWorkInProgress.sibling = oldWorkInProgress.sibling;
    newWorkInProgress.return = oldWorkInProgress.return;
    newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.

    if (oldWorkInProgress === returnFiber.child) {
      returnFiber.child = newWorkInProgress;
    } else {
      var prevSibling = returnFiber.child;

      if (prevSibling === null) {
        throw new Error('Expected parent to have a child.');
      }

      while (prevSibling.sibling !== oldWorkInProgress) {
        prevSibling = prevSibling.sibling;

        if (prevSibling === null) {
          throw new Error('Expected to find the previous sibling.');
        }
      }

      prevSibling.sibling = newWorkInProgress;
    } // Delete the old fiber and place the new one.
    // Since the old fiber is disconnected, we have to schedule it manually.


    var last = returnFiber.lastEffect;

    if (last !== null) {
      last.nextEffect = current;
      returnFiber.lastEffect = current;
    } else {
      returnFiber.firstEffect = returnFiber.lastEffect = current;
    }

    current.nextEffect = null;
    current.flags = Deletion;
    newWorkInProgress.flags |= Placement; // Restart work from the new fiber.

    return newWorkInProgress;
  }
}

function beginWork(current, workInProgress, renderLanes) {
  var updateLanes = workInProgress.lanes;

  {
    if (workInProgress._debugNeedsRemount && current !== null) {
      // This will restart the begin phase with a new fiber.
      return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes));
    }
  }

  if (current !== null) {
    var oldProps = current.memoizedProps;
    var newProps = workInProgress.pendingProps;

    if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:
     workInProgress.type !== current.type )) {
      // If props or context changed, mark the fiber as having performed work.
      // This may be unset if the props are determined to be equal later (memo).
      didReceiveUpdate = true;
    } else if (!includesSomeLane(renderLanes, updateLanes)) {
      didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering
      // the begin phase. There's still some bookkeeping we that needs to be done
      // in this optimized path, mostly pushing stuff onto the stack.

      switch (workInProgress.tag) {
        case HostRoot:
          pushHostRootContext(workInProgress);
          resetHydrationState();
          break;

        case HostComponent:
          pushHostContext(workInProgress);
          break;

        case ClassComponent:
          {
            var Component = workInProgress.type;

            if (isContextProvider(Component)) {
              pushContextProvider(workInProgress);
            }

            break;
          }

        case HostPortal:
          pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
          break;

        case ContextProvider:
          {
            var newValue = workInProgress.memoizedProps.value;
            pushProvider(workInProgress, newValue);
            break;
          }

        case Profiler:
          {
            // Profiler should only call onRender when one of its descendants actually rendered.
            var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);

            if (hasChildWork) {
              workInProgress.flags |= Update;
            } // Reset effect durations for the next eventual effect phase.
            // These are reset during render to allow the DevTools commit hook a chance to read them,


            var stateNode = workInProgress.stateNode;
            stateNode.effectDuration = 0;
            stateNode.passiveEffectDuration = 0;
          }

          break;

        case SuspenseComponent:
          {
            var state = workInProgress.memoizedState;

            if (state !== null) {
              // whether to retry the primary children, or to skip over it and
              // go straight to the fallback. Check the priority of the primary
              // child fragment.


              var primaryChildFragment = workInProgress.child;
              var primaryChildLanes = primaryChildFragment.childLanes;

              if (includesSomeLane(renderLanes, primaryChildLanes)) {
                // The primary children have pending work. Use the normal path
                // to attempt to render the primary children again.
                return updateSuspenseComponent(current, workInProgress, renderLanes);
              } else {
                // The primary child fragment does not have pending work marked
                // on it
                pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient
                // priority. Bailout.

                var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);

                if (child !== null) {
                  // The fallback children have pending work. Skip over the
                  // primary children and work on the fallback.
                  return child.sibling;
                } else {
                  return null;
                }
              }
            } else {
              pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
            }

            break;
          }

        case SuspenseListComponent:
          {
            var didSuspendBefore = (current.flags & DidCapture) !== NoFlags;

            var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);

            if (didSuspendBefore) {
              if (_hasChildWork) {
                // If something was in fallback state last time, and we have all the
                // same children then we're still in progressive loading state.
                // Something might get unblocked by state updates or retries in the
                // tree which will affect the tail. So we need to use the normal
                // path to compute the correct tail.
                return updateSuspenseListComponent(current, workInProgress, renderLanes);
              } // If none of the children had any work, that means that none of
              // them got retried so they'll still be blocked in the same way
              // as before. We can fast bail out.


              workInProgress.flags |= DidCapture;
            } // If nothing suspended before and we're rendering the same children,
            // then the tail doesn't matter. Anything new that suspends will work
            // in the "together" mode, so we can continue from the state we had.


            var renderState = workInProgress.memoizedState;

            if (renderState !== null) {
              // Reset to the "together" mode in case we've started a different
              // update in the past but didn't complete it.
              renderState.rendering = null;
              renderState.tail = null;
              renderState.lastEffect = null;
            }

            pushSuspenseContext(workInProgress, suspenseStackCursor.current);

            if (_hasChildWork) {
              break;
            } else {
              // If none of the children had any work, that means that none of
              // them got retried so they'll still be blocked in the same way
              // as before. We can fast bail out.
              return null;
            }
          }

        case OffscreenComponent:
        case LegacyHiddenComponent:
          {
            // Need to check if the tree still needs to be deferred. This is
            // almost identical to the logic used in the normal update path,
            // so we'll just enter that. The only difference is we'll bail out
            // at the next level instead of this one, because the child props
            // have not changed. Which is fine.
            // TODO: Probably should refactor `beginWork` to split the bailout
            // path from the normal path. I'm tempted to do a labeled break here
            // but I won't :)
            workInProgress.lanes = NoLanes;
            return updateOffscreenComponent(current, workInProgress, renderLanes);
          }
      }

      return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
    } else {
      if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
        // This is a special case that only exists for legacy mode.
        // See https://github.com/facebook/react/pull/19216.
        didReceiveUpdate = true;
      } else {
        // An update was scheduled on this fiber, but there are no new props
        // nor legacy context. Set this to false. If an update queue or context
        // consumer produces a changed value, it will set this to true. Otherwise,
        // the component will assume the children have not changed and bail out.
        didReceiveUpdate = false;
      }
    }
  } else {
    didReceiveUpdate = false;
  } // Before entering the begin phase, clear pending update priority.
  // TODO: This assumes that we're about to evaluate the component and process
  // the update queue. However, there's an exception: SimpleMemoComponent
  // sometimes bails out later in the begin phase. This indicates that we should
  // move this assignment out of the common path and into each branch.


  workInProgress.lanes = NoLanes;

  switch (workInProgress.tag) {
    case IndeterminateComponent:
      {
        return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes);
      }

    case LazyComponent:
      {
        var elementType = workInProgress.elementType;
        return mountLazyComponent(current, workInProgress, elementType, updateLanes, renderLanes);
      }

    case FunctionComponent:
      {
        var _Component = workInProgress.type;
        var unresolvedProps = workInProgress.pendingProps;
        var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
        return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderLanes);
      }

    case ClassComponent:
      {
        var _Component2 = workInProgress.type;
        var _unresolvedProps = workInProgress.pendingProps;

        var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);

        return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderLanes);
      }

    case HostRoot:
      return updateHostRoot(current, workInProgress, renderLanes);

    case HostComponent:
      return updateHostComponent(current, workInProgress, renderLanes);

    case HostText:
      return updateHostText(current, workInProgress);

    case SuspenseComponent:
      return updateSuspenseComponent(current, workInProgress, renderLanes);

    case HostPortal:
      return updatePortalComponent(current, workInProgress, renderLanes);

    case ForwardRef:
      {
        var type = workInProgress.type;
        var _unresolvedProps2 = workInProgress.pendingProps;

        var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);

        return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderLanes);
      }

    case Fragment:
      return updateFragment(current, workInProgress, renderLanes);

    case Mode:
      return updateMode(current, workInProgress, renderLanes);

    case Profiler:
      return updateProfiler(current, workInProgress, renderLanes);

    case ContextProvider:
      return updateContextProvider(current, workInProgress, renderLanes);

    case ContextConsumer:
      return updateContextConsumer(current, workInProgress, renderLanes);

    case MemoComponent:
      {
        var _type2 = workInProgress.type;
        var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.

        var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);

        {
          if (workInProgress.type !== workInProgress.elementType) {
            var outerPropTypes = _type2.propTypes;

            if (outerPropTypes) {
              checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only
              'prop', getComponentName(_type2));
            }
          }
        }

        _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
        return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateLanes, renderLanes);
      }

    case SimpleMemoComponent:
      {
        return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateLanes, renderLanes);
      }

    case IncompleteClassComponent:
      {
        var _Component3 = workInProgress.type;
        var _unresolvedProps4 = workInProgress.pendingProps;

        var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);

        return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderLanes);
      }

    case SuspenseListComponent:
      {
        return updateSuspenseListComponent(current, workInProgress, renderLanes);
      }

    case FundamentalComponent:
      {

        break;
      }

    case ScopeComponent:
      {

        break;
      }

    case Block:
      {

        break;
      }

    case OffscreenComponent:
      {
        return updateOffscreenComponent(current, workInProgress, renderLanes);
      }

    case LegacyHiddenComponent:
      {
        return updateLegacyHiddenComponent(current, workInProgress, renderLanes);
      }
  }

  {
    {
      throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function markUpdate(workInProgress) {
  // Tag the fiber with an update effect. This turns a Placement into
  // a PlacementAndUpdate.
  workInProgress.flags |= Update;
}

function markRef$1(workInProgress) {
  workInProgress.flags |= Ref;
}

var appendAllChildren;
var updateHostContainer;
var updateHostComponent$1;
var updateHostText$1;

{
  // Mutation mode
  appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
    // We only have the top Fiber that was created but we need recurse down its
    // children to find all the terminal nodes.
    var node = workInProgress.child;

    while (node !== null) {
      if (node.tag === HostComponent || node.tag === HostText) {
        appendInitialChild(parent, node.stateNode);
      } else if (node.tag === HostPortal) ; else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }

      if (node === workInProgress) {
        return;
      }

      while (node.sibling === null) {
        if (node.return === null || node.return === workInProgress) {
          return;
        }

        node = node.return;
      }

      node.sibling.return = node.return;
      node = node.sibling;
    }
  };

  updateHostContainer = function (workInProgress) {// Noop
  };

  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
    // If we have an alternate, that means this is an update and we need to
    // schedule a side-effect to do the updates.
    var oldProps = current.memoizedProps;

    if (oldProps === newProps) {
      // In mutation mode, this is sufficient for a bailout because
      // we won't touch this node even if children changed.
      return;
    } // If we get updated because one of our children updated, we don't
    // have newProps so we'll have to reuse them.
    // TODO: Split the update API as separate for the props vs. children.
    // Even better would be if children weren't special cased at all tho.


    var instance = workInProgress.stateNode;
    var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host
    // component is hitting the resume path. Figure out why. Possibly
    // related to `hidden`.

    var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.

    workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
    // is a new ref we mark this as an update. All the work is done in commitWork.

    if (updatePayload) {
      markUpdate(workInProgress);
    }
  };

  updateHostText$1 = function (current, workInProgress, oldText, newText) {
    // If the text differs, mark it as an update. All the work in done in commitWork.
    if (oldText !== newText) {
      markUpdate(workInProgress);
    }
  };
}

function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
  if (getIsHydrating()) {
    // If we're hydrating, we should consume as many items as we can
    // so we don't leave any behind.
    return;
  }

  switch (renderState.tailMode) {
    case 'hidden':
      {
        // Any insertions at the end of the tail list after this point
        // should be invisible. If there are already mounted boundaries
        // anything before them are not considered for collapsing.
        // Therefore we need to go through the whole tail to find if
        // there are any.
        var tailNode = renderState.tail;
        var lastTailNode = null;

        while (tailNode !== null) {
          if (tailNode.alternate !== null) {
            lastTailNode = tailNode;
          }

          tailNode = tailNode.sibling;
        } // Next we're simply going to delete all insertions after the
        // last rendered item.


        if (lastTailNode === null) {
          // All remaining items in the tail are insertions.
          renderState.tail = null;
        } else {
          // Detach the insertion after the last node that was already
          // inserted.
          lastTailNode.sibling = null;
        }

        break;
      }

    case 'collapsed':
      {
        // Any insertions at the end of the tail list after this point
        // should be invisible. If there are already mounted boundaries
        // anything before them are not considered for collapsing.
        // Therefore we need to go through the whole tail to find if
        // there are any.
        var _tailNode = renderState.tail;
        var _lastTailNode = null;

        while (_tailNode !== null) {
          if (_tailNode.alternate !== null) {
            _lastTailNode = _tailNode;
          }

          _tailNode = _tailNode.sibling;
        } // Next we're simply going to delete all insertions after the
        // last rendered item.


        if (_lastTailNode === null) {
          // All remaining items in the tail are insertions.
          if (!hasRenderedATailFallback && renderState.tail !== null) {
            // We suspended during the head. We want to show at least one
            // row at the tail. So we'll keep on and cut off the rest.
            renderState.tail.sibling = null;
          } else {
            renderState.tail = null;
          }
        } else {
          // Detach the insertion after the last node that was already
          // inserted.
          _lastTailNode.sibling = null;
        }

        break;
      }
  }
}

function completeWork(current, workInProgress, renderLanes) {
  var newProps = workInProgress.pendingProps;

  switch (workInProgress.tag) {
    case IndeterminateComponent:
    case LazyComponent:
    case SimpleMemoComponent:
    case FunctionComponent:
    case ForwardRef:
    case Fragment:
    case Mode:
    case Profiler:
    case ContextConsumer:
    case MemoComponent:
      return null;

    case ClassComponent:
      {
        var Component = workInProgress.type;

        if (isContextProvider(Component)) {
          popContext(workInProgress);
        }

        return null;
      }

    case HostRoot:
      {
        popHostContainer(workInProgress);
        popTopLevelContextObject(workInProgress);
        resetWorkInProgressVersions();
        var fiberRoot = workInProgress.stateNode;

        if (fiberRoot.pendingContext) {
          fiberRoot.context = fiberRoot.pendingContext;
          fiberRoot.pendingContext = null;
        }

        if (current === null || current.child === null) {
          // If we hydrated, pop so that we can delete any remaining children
          // that weren't hydrated.
          var wasHydrated = popHydrationState(workInProgress);

          if (wasHydrated) {
            // If we hydrated, then we'll need to schedule an update for
            // the commit side-effects on the root.
            markUpdate(workInProgress);
          } else if (!fiberRoot.hydrate) {
            // Schedule an effect to clear this container at the start of the next commit.
            // This handles the case of React rendering into a container with previous children.
            // It's also safe to do for updates too, because current.child would only be null
            // if the previous render was null (so the the container would already be empty).
            workInProgress.flags |= Snapshot;
          }
        }

        updateHostContainer(workInProgress);
        return null;
      }

    case HostComponent:
      {
        popHostContext(workInProgress);
        var rootContainerInstance = getRootHostContainer();
        var type = workInProgress.type;

        if (current !== null && workInProgress.stateNode != null) {
          updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);

          if (current.ref !== workInProgress.ref) {
            markRef$1(workInProgress);
          }
        } else {
          if (!newProps) {
            if (!(workInProgress.stateNode !== null)) {
              {
                throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." );
              }
            } // This can happen when we abort work.


            return null;
          }

          var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
          // "stack" as the parent. Then append children as we go in beginWork
          // or completeWork depending on whether we want to add them top->down or
          // bottom->up. Top->down is faster in IE11.

          var _wasHydrated = popHydrationState(workInProgress);

          if (_wasHydrated) {
            // TODO: Move this and createInstance step into the beginPhase
            // to consolidate.
            if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {
              // If changes to the hydrated node need to be applied at the
              // commit-phase we mark this as such.
              markUpdate(workInProgress);
            }
          } else {
            var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);
            appendAllChildren(instance, workInProgress, false, false);
            workInProgress.stateNode = instance; // Certain renderers require commit-time effects for initial mount.
            // (eg DOM renderer supports auto-focus for certain elements).
            // Make sure such renderers get scheduled for later work.

            if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
              markUpdate(workInProgress);
            }
          }

          if (workInProgress.ref !== null) {
            // If there is a ref on a host node we need to schedule a callback
            markRef$1(workInProgress);
          }
        }

        return null;
      }

    case HostText:
      {
        var newText = newProps;

        if (current && workInProgress.stateNode != null) {
          var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need
          // to schedule a side-effect to do the updates.

          updateHostText$1(current, workInProgress, oldText, newText);
        } else {
          if (typeof newText !== 'string') {
            if (!(workInProgress.stateNode !== null)) {
              {
                throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." );
              }
            } // This can happen when we abort work.

          }

          var _rootContainerInstance = getRootHostContainer();

          var _currentHostContext = getHostContext();

          var _wasHydrated2 = popHydrationState(workInProgress);

          if (_wasHydrated2) {
            if (prepareToHydrateHostTextInstance(workInProgress)) {
              markUpdate(workInProgress);
            }
          } else {
            workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);
          }
        }

        return null;
      }

    case SuspenseComponent:
      {
        popSuspenseContext(workInProgress);
        var nextState = workInProgress.memoizedState;

        if ((workInProgress.flags & DidCapture) !== NoFlags) {
          // Something suspended. Re-render with the fallback children.
          workInProgress.lanes = renderLanes; // Do not reset the effect list.

          if ( (workInProgress.mode & ProfileMode) !== NoMode) {
            transferActualDuration(workInProgress);
          }

          return workInProgress;
        }

        var nextDidTimeout = nextState !== null;
        var prevDidTimeout = false;

        if (current === null) {
          if (workInProgress.memoizedProps.fallback !== undefined) {
            popHydrationState(workInProgress);
          }
        } else {
          var prevState = current.memoizedState;
          prevDidTimeout = prevState !== null;
        }

        if (nextDidTimeout && !prevDidTimeout) {
          // If this subtreee is running in blocking mode we can suspend,
          // otherwise we won't suspend.
          // TODO: This will still suspend a synchronous tree if anything
          // in the concurrent tree already suspended during this render.
          // This is a known bug.
          if ((workInProgress.mode & BlockingMode) !== NoMode) {
            // TODO: Move this back to throwException because this is too late
            // if this is a large tree which is common for initial loads. We
            // don't know if we should restart a render or not until we get
            // this marker, and this is too late.
            // If this render already had a ping or lower pri updates,
            // and this is the first time we know we're going to suspend we
            // should be able to immediately restart from within throwException.
            var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;

            if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
              // If this was in an invisible tree or a new render, then showing
              // this boundary is ok.
              renderDidSuspend();
            } else {
              // Otherwise, we're going to have to hide content so we should
              // suspend for longer if possible.
              renderDidSuspendDelayIfPossible();
            }
          }
        }

        {
          // TODO: Only schedule updates if these values are non equal, i.e. it changed.
          if (nextDidTimeout || prevDidTimeout) {
            // If this boundary just timed out, schedule an effect to attach a
            // retry listener to the promise. This flag is also used to hide the
            // primary children. In mutation mode, we also need the flag to
            // *unhide* children that were previously hidden, so check if this
            // is currently timed out, too.
            workInProgress.flags |= Update;
          }
        }

        return null;
      }

    case HostPortal:
      popHostContainer(workInProgress);
      updateHostContainer(workInProgress);

      if (current === null) {
        preparePortalMount(workInProgress.stateNode.containerInfo);
      }

      return null;

    case ContextProvider:
      // Pop provider fiber
      popProvider(workInProgress);
      return null;

    case IncompleteClassComponent:
      {
        // Same as class component case. I put it down here so that the tags are
        // sequential to ensure this switch is compiled to a jump table.
        var _Component = workInProgress.type;

        if (isContextProvider(_Component)) {
          popContext(workInProgress);
        }

        return null;
      }

    case SuspenseListComponent:
      {
        popSuspenseContext(workInProgress);
        var renderState = workInProgress.memoizedState;

        if (renderState === null) {
          // We're running in the default, "independent" mode.
          // We don't do anything in this mode.
          return null;
        }

        var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags;
        var renderedTail = renderState.rendering;

        if (renderedTail === null) {
          // We just rendered the head.
          if (!didSuspendAlready) {
            // This is the first pass. We need to figure out if anything is still
            // suspended in the rendered set.
            // If new content unsuspended, but there's still some content that
            // didn't. Then we need to do a second pass that forces everything
            // to keep showing their fallbacks.
            // We might be suspended if something in this render pass suspended, or
            // something in the previous committed pass suspended. Otherwise,
            // there's no chance so we can skip the expensive call to
            // findFirstSuspended.
            var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags);

            if (!cannotBeSuspended) {
              var row = workInProgress.child;

              while (row !== null) {
                var suspended = findFirstSuspended(row);

                if (suspended !== null) {
                  didSuspendAlready = true;
                  workInProgress.flags |= DidCapture;
                  cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as
                  // part of the second pass. In that case nothing will subscribe to
                  // its thennables. Instead, we'll transfer its thennables to the
                  // SuspenseList so that it can retry if they resolve.
                  // There might be multiple of these in the list but since we're
                  // going to wait for all of them anyway, it doesn't really matter
                  // which ones gets to ping. In theory we could get clever and keep
                  // track of how many dependencies remain but it gets tricky because
                  // in the meantime, we can add/remove/change items and dependencies.
                  // We might bail out of the loop before finding any but that
                  // doesn't matter since that means that the other boundaries that
                  // we did find already has their listeners attached.

                  var newThennables = suspended.updateQueue;

                  if (newThennables !== null) {
                    workInProgress.updateQueue = newThennables;
                    workInProgress.flags |= Update;
                  } // Rerender the whole list, but this time, we'll force fallbacks
                  // to stay in place.
                  // Reset the effect list before doing the second pass since that's now invalid.


                  if (renderState.lastEffect === null) {
                    workInProgress.firstEffect = null;
                  }

                  workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state.

                  resetChildFibers(workInProgress, renderLanes); // Set up the Suspense Context to force suspense and immediately
                  // rerender the children.

                  pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
                  return workInProgress.child;
                }

                row = row.sibling;
              }
            }

            if (renderState.tail !== null && now() > getRenderTargetTime()) {
              // We have already passed our CPU deadline but we still have rows
              // left in the tail. We'll just give up further attempts to render
              // the main content and only render fallbacks.
              workInProgress.flags |= DidCapture;
              didSuspendAlready = true;
              cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this
              // to get it started back up to attempt the next item. While in terms
              // of priority this work has the same priority as this current render,
              // it's not part of the same transition once the transition has
              // committed. If it's sync, we still want to yield so that it can be
              // painted. Conceptually, this is really the same as pinging.
              // We can use any RetryLane even if it's the one currently rendering
              // since we're leaving it behind on this node.

              workInProgress.lanes = SomeRetryLane;

              {
                markSpawnedWork(SomeRetryLane);
              }
            }
          } else {
            cutOffTailIfNeeded(renderState, false);
          } // Next we're going to render the tail.

        } else {
          // Append the rendered row to the child list.
          if (!didSuspendAlready) {
            var _suspended = findFirstSuspended(renderedTail);

            if (_suspended !== null) {
              workInProgress.flags |= DidCapture;
              didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't
              // get lost if this row ends up dropped during a second pass.

              var _newThennables = _suspended.updateQueue;

              if (_newThennables !== null) {
                workInProgress.updateQueue = _newThennables;
                workInProgress.flags |= Update;
              }

              cutOffTailIfNeeded(renderState, true); // This might have been modified.

              if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate && !getIsHydrating() // We don't cut it if we're hydrating.
              ) {
                  // We need to delete the row we just rendered.
                  // Reset the effect list to what it was before we rendered this
                  // child. The nested children have already appended themselves.
                  var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.

                  if (lastEffect !== null) {
                    lastEffect.nextEffect = null;
                  } // We're done.


                  return null;
                }
            } else if ( // The time it took to render last row is greater than the remaining
            // time we have to render. So rendering one more row would likely
            // exceed it.
            now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes !== OffscreenLane) {
              // We have now passed our CPU deadline and we'll just give up further
              // attempts to render the main content and only render fallbacks.
              // The assumption is that this is usually faster.
              workInProgress.flags |= DidCapture;
              didSuspendAlready = true;
              cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this
              // to get it started back up to attempt the next item. While in terms
              // of priority this work has the same priority as this current render,
              // it's not part of the same transition once the transition has
              // committed. If it's sync, we still want to yield so that it can be
              // painted. Conceptually, this is really the same as pinging.
              // We can use any RetryLane even if it's the one currently rendering
              // since we're leaving it behind on this node.

              workInProgress.lanes = SomeRetryLane;

              {
                markSpawnedWork(SomeRetryLane);
              }
            }
          }

          if (renderState.isBackwards) {
            // The effect list of the backwards tail will have been added
            // to the end. This breaks the guarantee that life-cycles fire in
            // sibling order but that isn't a strong guarantee promised by React.
            // Especially since these might also just pop in during future commits.
            // Append to the beginning of the list.
            renderedTail.sibling = workInProgress.child;
            workInProgress.child = renderedTail;
          } else {
            var previousSibling = renderState.last;

            if (previousSibling !== null) {
              previousSibling.sibling = renderedTail;
            } else {
              workInProgress.child = renderedTail;
            }

            renderState.last = renderedTail;
          }
        }

        if (renderState.tail !== null) {
          // We still have tail rows to render.
          // Pop a row.
          var next = renderState.tail;
          renderState.rendering = next;
          renderState.tail = next.sibling;
          renderState.lastEffect = workInProgress.lastEffect;
          renderState.renderingStartTime = now();
          next.sibling = null; // Restore the context.
          // TODO: We can probably just avoid popping it instead and only
          // setting it the first time we go from not suspended to suspended.

          var suspenseContext = suspenseStackCursor.current;

          if (didSuspendAlready) {
            suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
          } else {
            suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
          }

          pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.

          return next;
        }

        return null;
      }

    case FundamentalComponent:
      {

        break;
      }

    case ScopeComponent:
      {

        break;
      }

    case Block:

      break;

    case OffscreenComponent:
    case LegacyHiddenComponent:
      {
        popRenderLanes(workInProgress);

        if (current !== null) {
          var _nextState = workInProgress.memoizedState;
          var _prevState = current.memoizedState;
          var prevIsHidden = _prevState !== null;
          var nextIsHidden = _nextState !== null;

          if (prevIsHidden !== nextIsHidden && newProps.mode !== 'unstable-defer-without-hiding') {
            workInProgress.flags |= Update;
          }
        }

        return null;
      }
  }

  {
    {
      throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function unwindWork(workInProgress, renderLanes) {
  switch (workInProgress.tag) {
    case ClassComponent:
      {
        var Component = workInProgress.type;

        if (isContextProvider(Component)) {
          popContext(workInProgress);
        }

        var flags = workInProgress.flags;

        if (flags & ShouldCapture) {
          workInProgress.flags = flags & ~ShouldCapture | DidCapture;

          if ( (workInProgress.mode & ProfileMode) !== NoMode) {
            transferActualDuration(workInProgress);
          }

          return workInProgress;
        }

        return null;
      }

    case HostRoot:
      {
        popHostContainer(workInProgress);
        popTopLevelContextObject(workInProgress);
        resetWorkInProgressVersions();
        var _flags = workInProgress.flags;

        if (!((_flags & DidCapture) === NoFlags)) {
          {
            throw Error( "The root failed to unmount after an error. This is likely a bug in React. Please file an issue." );
          }
        }

        workInProgress.flags = _flags & ~ShouldCapture | DidCapture;
        return workInProgress;
      }

    case HostComponent:
      {
        // TODO: popHydrationState
        popHostContext(workInProgress);
        return null;
      }

    case SuspenseComponent:
      {
        popSuspenseContext(workInProgress);

        var _flags2 = workInProgress.flags;

        if (_flags2 & ShouldCapture) {
          workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.

          if ( (workInProgress.mode & ProfileMode) !== NoMode) {
            transferActualDuration(workInProgress);
          }

          return workInProgress;
        }

        return null;
      }

    case SuspenseListComponent:
      {
        popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been
        // caught by a nested boundary. If not, it should bubble through.

        return null;
      }

    case HostPortal:
      popHostContainer(workInProgress);
      return null;

    case ContextProvider:
      popProvider(workInProgress);
      return null;

    case OffscreenComponent:
    case LegacyHiddenComponent:
      popRenderLanes(workInProgress);
      return null;

    default:
      return null;
  }
}

function unwindInterruptedWork(interruptedWork) {
  switch (interruptedWork.tag) {
    case ClassComponent:
      {
        var childContextTypes = interruptedWork.type.childContextTypes;

        if (childContextTypes !== null && childContextTypes !== undefined) {
          popContext(interruptedWork);
        }

        break;
      }

    case HostRoot:
      {
        popHostContainer(interruptedWork);
        popTopLevelContextObject(interruptedWork);
        resetWorkInProgressVersions();
        break;
      }

    case HostComponent:
      {
        popHostContext(interruptedWork);
        break;
      }

    case HostPortal:
      popHostContainer(interruptedWork);
      break;

    case SuspenseComponent:
      popSuspenseContext(interruptedWork);
      break;

    case SuspenseListComponent:
      popSuspenseContext(interruptedWork);
      break;

    case ContextProvider:
      popProvider(interruptedWork);
      break;

    case OffscreenComponent:
    case LegacyHiddenComponent:
      popRenderLanes(interruptedWork);
      break;
  }
}

function createCapturedValue(value, source) {
  // If the value is an error, call this function immediately after it is thrown
  // so the stack is accurate.
  return {
    value: value,
    source: source,
    stack: getStackByFiberInDevAndProd(source)
  };
}

// This module is forked in different environments.
// By default, return `true` to log errors to the console.
// Forks can return `false` if this isn't desirable.
function showErrorDialog(boundary, errorInfo) {
  return true;
}

function logCapturedError(boundary, errorInfo) {
  try {
    var logError = showErrorDialog(boundary, errorInfo); // Allow injected showErrorDialog() to prevent default console.error logging.
    // This enables renderers like ReactNative to better manage redbox behavior.

    if (logError === false) {
      return;
    }

    var error = errorInfo.value;

    if (true) {
      var source = errorInfo.source;
      var stack = errorInfo.stack;
      var componentStack = stack !== null ? stack : ''; // Browsers support silencing uncaught errors by calling
      // `preventDefault()` in window `error` handler.
      // We record this information as an expando on the error.

      if (error != null && error._suppressLogging) {
        if (boundary.tag === ClassComponent) {
          // The error is recoverable and was silenced.
          // Ignore it and don't print the stack addendum.
          // This is handy for testing error boundaries without noise.
          return;
        } // The error is fatal. Since the silencing might have
        // been accidental, we'll surface it anyway.
        // However, the browser would have silenced the original error
        // so we'll print it first, and then print the stack addendum.


        console['error'](error); // Don't transform to our wrapper
        // For a more detailed description of this block, see:
        // https://github.com/facebook/react/pull/13384
      }

      var componentName = source ? getComponentName(source.type) : null;
      var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : 'The above error occurred in one of your React components:';
      var errorBoundaryMessage;
      var errorBoundaryName = getComponentName(boundary.type);

      if (errorBoundaryName) {
        errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
      } else {
        errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.';
      }

      var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.
      // We don't include the original error message and JS stack because the browser
      // has already printed it. Even if the application swallows the error, it is still
      // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.

      console['error'](combinedMessage); // Don't transform to our wrapper
    } else {}
  } catch (e) {
    // This method must not throw, or React internal state will get messed up.
    // If console.error is overridden, or logCapturedError() shows a dialog that throws,
    // we want to report this error outside of the normal stack as a last resort.
    // https://github.com/facebook/react/issues/13188
    setTimeout(function () {
      throw e;
    });
  }
}

var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;

function createRootErrorUpdate(fiber, errorInfo, lane) {
  var update = createUpdate(NoTimestamp, lane); // Unmount the root by rendering null.

  update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property
  // being called "element".

  update.payload = {
    element: null
  };
  var error = errorInfo.value;

  update.callback = function () {
    onUncaughtError(error);
    logCapturedError(fiber, errorInfo);
  };

  return update;
}

function createClassErrorUpdate(fiber, errorInfo, lane) {
  var update = createUpdate(NoTimestamp, lane);
  update.tag = CaptureUpdate;
  var getDerivedStateFromError = fiber.type.getDerivedStateFromError;

  if (typeof getDerivedStateFromError === 'function') {
    var error$1 = errorInfo.value;

    update.payload = function () {
      logCapturedError(fiber, errorInfo);
      return getDerivedStateFromError(error$1);
    };
  }

  var inst = fiber.stateNode;

  if (inst !== null && typeof inst.componentDidCatch === 'function') {
    update.callback = function callback() {
      {
        markFailedErrorBoundaryForHotReloading(fiber);
      }

      if (typeof getDerivedStateFromError !== 'function') {
        // To preserve the preexisting retry behavior of error boundaries,
        // we keep track of which ones already failed during this batch.
        // This gets reset before we yield back to the browser.
        // TODO: Warn in strict mode if getDerivedStateFromError is
        // not defined.
        markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined

        logCapturedError(fiber, errorInfo);
      }

      var error$1 = errorInfo.value;
      var stack = errorInfo.stack;
      this.componentDidCatch(error$1, {
        componentStack: stack !== null ? stack : ''
      });

      {
        if (typeof getDerivedStateFromError !== 'function') {
          // If componentDidCatch is the only error boundary method defined,
          // then it needs to call setState to recover from errors.
          // If no state update is scheduled then the boundary will swallow the error.
          if (!includesSomeLane(fiber.lanes, SyncLane)) {
            error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown');
          }
        }
      }
    };
  } else {
    update.callback = function () {
      markFailedErrorBoundaryForHotReloading(fiber);
    };
  }

  return update;
}

function attachPingListener(root, wakeable, lanes) {
  // Attach a listener to the promise to "ping" the root and retry. But only if
  // one does not already exist for the lanes we're currently rendering (which
  // acts like a "thread ID" here).
  var pingCache = root.pingCache;
  var threadIDs;

  if (pingCache === null) {
    pingCache = root.pingCache = new PossiblyWeakMap$1();
    threadIDs = new Set();
    pingCache.set(wakeable, threadIDs);
  } else {
    threadIDs = pingCache.get(wakeable);

    if (threadIDs === undefined) {
      threadIDs = new Set();
      pingCache.set(wakeable, threadIDs);
    }
  }

  if (!threadIDs.has(lanes)) {
    // Memoize using the thread ID to prevent redundant listeners.
    threadIDs.add(lanes);
    var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes);
    wakeable.then(ping, ping);
  }
}

function throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) {
  // The source fiber did not complete.
  sourceFiber.flags |= Incomplete; // Its effect list is no longer valid.

  sourceFiber.firstEffect = sourceFiber.lastEffect = null;

  if (value !== null && typeof value === 'object' && typeof value.then === 'function') {
    // This is a wakeable.
    var wakeable = value;

    if ((sourceFiber.mode & BlockingMode) === NoMode) {
      // Reset the memoizedState to what it was before we attempted
      // to render it.
      var currentSource = sourceFiber.alternate;

      if (currentSource) {
        sourceFiber.updateQueue = currentSource.updateQueue;
        sourceFiber.memoizedState = currentSource.memoizedState;
        sourceFiber.lanes = currentSource.lanes;
      } else {
        sourceFiber.updateQueue = null;
        sourceFiber.memoizedState = null;
      }
    }

    var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view.

    var _workInProgress = returnFiber;

    do {
      if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
        // Found the nearest boundary.
        // Stash the promise on the boundary fiber. If the boundary times out, we'll
        // attach another listener to flip the boundary back to its normal state.
        var wakeables = _workInProgress.updateQueue;

        if (wakeables === null) {
          var updateQueue = new Set();
          updateQueue.add(wakeable);
          _workInProgress.updateQueue = updateQueue;
        } else {
          wakeables.add(wakeable);
        } // If the boundary is outside of blocking mode, we should *not*
        // suspend the commit. Pretend as if the suspended component rendered
        // null and keep rendering. In the commit phase, we'll schedule a
        // subsequent synchronous update to re-render the Suspense.
        //
        // Note: It doesn't matter whether the component that suspended was
        // inside a blocking mode tree. If the Suspense is outside of it, we
        // should *not* suspend the commit.


        if ((_workInProgress.mode & BlockingMode) === NoMode) {
          _workInProgress.flags |= DidCapture;
          sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.
          // But we shouldn't call any lifecycle methods or callbacks. Remove
          // all lifecycle effect tags.

          sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);

          if (sourceFiber.tag === ClassComponent) {
            var currentSourceFiber = sourceFiber.alternate;

            if (currentSourceFiber === null) {
              // This is a new mount. Change the tag so it's not mistaken for a
              // completed class component. For example, we should not call
              // componentWillUnmount if it is deleted.
              sourceFiber.tag = IncompleteClassComponent;
            } else {
              // When we try rendering again, we should not reuse the current fiber,
              // since it's known to be in an inconsistent state. Use a force update to
              // prevent a bail out.
              var update = createUpdate(NoTimestamp, SyncLane);
              update.tag = ForceUpdate;
              enqueueUpdate(sourceFiber, update);
            }
          } // The source fiber did not complete. Mark it with Sync priority to
          // indicate that it still has pending work.


          sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane); // Exit without suspending.

          return;
        } // Confirmed that the boundary is in a concurrent mode tree. Continue
        // with the normal suspend path.
        //
        // After this we'll use a set of heuristics to determine whether this
        // render pass will run to completion or restart or "suspend" the commit.
        // The actual logic for this is spread out in different places.
        //
        // This first principle is that if we're going to suspend when we complete
        // a root, then we should also restart if we get an update or ping that
        // might unsuspend it, and vice versa. The only reason to suspend is
        // because you think you might want to restart before committing. However,
        // it doesn't make sense to restart only while in the period we're suspended.
        //
        // Restarting too aggressively is also not good because it starves out any
        // intermediate loading state. So we use heuristics to determine when.
        // Suspense Heuristics
        //
        // If nothing threw a Promise or all the same fallbacks are already showing,
        // then don't suspend/restart.
        //
        // If this is an initial render of a new tree of Suspense boundaries and
        // those trigger a fallback, then don't suspend/restart. We want to ensure
        // that we can show the initial loading state as quickly as possible.
        //
        // If we hit a "Delayed" case, such as when we'd switch from content back into
        // a fallback, then we should always suspend/restart. Transitions apply
        // to this case. If none is defined, JND is used instead.
        //
        // If we're already showing a fallback and it gets "retried", allowing us to show
        // another level, but there's still an inner boundary that would show a fallback,
        // then we suspend/restart for 500ms since the last time we showed a fallback
        // anywhere in the tree. This effectively throttles progressive loading into a
        // consistent train of commits. This also gives us an opportunity to restart to
        // get to the completed state slightly earlier.
        //
        // If there's ambiguity due to batching it's resolved in preference of:
        // 1) "delayed", 2) "initial render", 3) "retry".
        //
        // We want to ensure that a "busy" state doesn't get force committed. We want to
        // ensure that new initial loading states can commit as soon as possible.


        attachPingListener(root, wakeable, rootRenderLanes);
        _workInProgress.flags |= ShouldCapture;
        _workInProgress.lanes = rootRenderLanes;
        return;
      } // This boundary already captured during this render. Continue to the next
      // boundary.


      _workInProgress = _workInProgress.return;
    } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode.
    // TODO: Use invariant so the message is stripped in prod?


    value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.');
  } // We didn't find a boundary that could handle this type of exception. Start
  // over and traverse parent path again, this time treating the exception
  // as an error.


  renderDidError();
  value = createCapturedValue(value, sourceFiber);
  var workInProgress = returnFiber;

  do {
    switch (workInProgress.tag) {
      case HostRoot:
        {
          var _errorInfo = value;
          workInProgress.flags |= ShouldCapture;
          var lane = pickArbitraryLane(rootRenderLanes);
          workInProgress.lanes = mergeLanes(workInProgress.lanes, lane);

          var _update = createRootErrorUpdate(workInProgress, _errorInfo, lane);

          enqueueCapturedUpdate(workInProgress, _update);
          return;
        }

      case ClassComponent:
        // Capture and retry
        var errorInfo = value;
        var ctor = workInProgress.type;
        var instance = workInProgress.stateNode;

        if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
          workInProgress.flags |= ShouldCapture;

          var _lane = pickArbitraryLane(rootRenderLanes);

          workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state

          var _update2 = createClassErrorUpdate(workInProgress, errorInfo, _lane);

          enqueueCapturedUpdate(workInProgress, _update2);
          return;
        }

        break;
    }

    workInProgress = workInProgress.return;
  } while (workInProgress !== null);
}

var didWarnAboutUndefinedSnapshotBeforeUpdate = null;

{
  didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
}

var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;

var callComponentWillUnmountWithTimer = function (current, instance) {
  instance.props = current.memoizedProps;
  instance.state = current.memoizedState;

  {
    instance.componentWillUnmount();
  }
}; // Capture errors so they don't interrupt unmounting.


function safelyCallComponentWillUnmount(current, instance) {
  {
    invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);

    if (hasCaughtError()) {
      var unmountError = clearCaughtError();
      captureCommitPhaseError(current, unmountError);
    }
  }
}

function safelyDetachRef(current) {
  var ref = current.ref;

  if (ref !== null) {
    if (typeof ref === 'function') {
      {
        invokeGuardedCallback(null, ref, null, null);

        if (hasCaughtError()) {
          var refError = clearCaughtError();
          captureCommitPhaseError(current, refError);
        }
      }
    } else {
      ref.current = null;
    }
  }
}

function safelyCallDestroy(current, destroy) {
  {
    invokeGuardedCallback(null, destroy, null);

    if (hasCaughtError()) {
      var error = clearCaughtError();
      captureCommitPhaseError(current, error);
    }
  }
}

function commitBeforeMutationLifeCycles(current, finishedWork) {
  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case SimpleMemoComponent:
    case Block:
      {
        return;
      }

    case ClassComponent:
      {
        if (finishedWork.flags & Snapshot) {
          if (current !== null) {
            var prevProps = current.memoizedProps;
            var prevState = current.memoizedState;
            var instance = finishedWork.stateNode; // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.

            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                if (instance.props !== finishedWork.memoizedProps) {
                  error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }

                if (instance.state !== finishedWork.memoizedState) {
                  error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }
              }
            }

            var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);

            {
              var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;

              if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
                didWarnSet.add(finishedWork.type);

                error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));
              }
            }

            instance.__reactInternalSnapshotBeforeUpdate = snapshot;
          }
        }

        return;
      }

    case HostRoot:
      {
        {
          if (finishedWork.flags & Snapshot) {
            var root = finishedWork.stateNode;
            clearContainer(root.containerInfo);
          }
        }

        return;
      }

    case HostComponent:
    case HostText:
    case HostPortal:
    case IncompleteClassComponent:
      // Nothing to do for these component types
      return;
  }

  {
    {
      throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function commitHookEffectListUnmount(tag, finishedWork) {
  var updateQueue = finishedWork.updateQueue;
  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;

  if (lastEffect !== null) {
    var firstEffect = lastEffect.next;
    var effect = firstEffect;

    do {
      if ((effect.tag & tag) === tag) {
        // Unmount
        var destroy = effect.destroy;
        effect.destroy = undefined;

        if (destroy !== undefined) {
          destroy();
        }
      }

      effect = effect.next;
    } while (effect !== firstEffect);
  }
}

function commitHookEffectListMount(tag, finishedWork) {
  var updateQueue = finishedWork.updateQueue;
  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;

  if (lastEffect !== null) {
    var firstEffect = lastEffect.next;
    var effect = firstEffect;

    do {
      if ((effect.tag & tag) === tag) {
        // Mount
        var create = effect.create;
        effect.destroy = create();

        {
          var destroy = effect.destroy;

          if (destroy !== undefined && typeof destroy !== 'function') {
            var addendum = void 0;

            if (destroy === null) {
              addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';
            } else if (typeof destroy.then === 'function') {
              addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + '  async function fetchData() {\n' + '    // You can await here\n' + '    const response = await MyAPI.getData(someId);\n' + '    // ...\n' + '  }\n' + '  fetchData();\n' + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + 'Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching';
            } else {
              addendum = ' You returned: ' + destroy;
            }

            error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s', addendum);
          }
        }
      }

      effect = effect.next;
    } while (effect !== firstEffect);
  }
}

function schedulePassiveEffects(finishedWork) {
  var updateQueue = finishedWork.updateQueue;
  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;

  if (lastEffect !== null) {
    var firstEffect = lastEffect.next;
    var effect = firstEffect;

    do {
      var _effect = effect,
          next = _effect.next,
          tag = _effect.tag;

      if ((tag & Passive$1) !== NoFlags$1 && (tag & HasEffect) !== NoFlags$1) {
        enqueuePendingPassiveHookEffectUnmount(finishedWork, effect);
        enqueuePendingPassiveHookEffectMount(finishedWork, effect);
      }

      effect = next;
    } while (effect !== firstEffect);
  }
}

function commitLifeCycles(finishedRoot, current, finishedWork, committedLanes) {
  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case SimpleMemoComponent:
    case Block:
      {
        // At this point layout effects have already been destroyed (during mutation phase).
        // This is done to prevent sibling component effects from interfering with each other,
        // e.g. a destroy function in one component should never override a ref set
        // by a create function in another component during the same commit.
        {
          commitHookEffectListMount(Layout | HasEffect, finishedWork);
        }

        schedulePassiveEffects(finishedWork);
        return;
      }

    case ClassComponent:
      {
        var instance = finishedWork.stateNode;

        if (finishedWork.flags & Update) {
          if (current === null) {
            // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.
            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                if (instance.props !== finishedWork.memoizedProps) {
                  error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }

                if (instance.state !== finishedWork.memoizedState) {
                  error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }
              }
            }

            {
              instance.componentDidMount();
            }
          } else {
            var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);
            var prevState = current.memoizedState; // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.

            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                if (instance.props !== finishedWork.memoizedProps) {
                  error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }

                if (instance.state !== finishedWork.memoizedState) {
                  error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }
              }
            }

            {
              instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
            }
          }
        } // TODO: I think this is now always non-null by the time it reaches the
        // commit phase. Consider removing the type check.


        var updateQueue = finishedWork.updateQueue;

        if (updateQueue !== null) {
          {
            if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
              if (instance.props !== finishedWork.memoizedProps) {
                error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
              }

              if (instance.state !== finishedWork.memoizedState) {
                error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
              }
            }
          } // We could update instance props and state here,
          // but instead we rely on them being set during last render.
          // TODO: revisit this when we implement resuming.


          commitUpdateQueue(finishedWork, updateQueue, instance);
        }

        return;
      }

    case HostRoot:
      {
        // TODO: I think this is now always non-null by the time it reaches the
        // commit phase. Consider removing the type check.
        var _updateQueue = finishedWork.updateQueue;

        if (_updateQueue !== null) {
          var _instance = null;

          if (finishedWork.child !== null) {
            switch (finishedWork.child.tag) {
              case HostComponent:
                _instance = getPublicInstance(finishedWork.child.stateNode);
                break;

              case ClassComponent:
                _instance = finishedWork.child.stateNode;
                break;
            }
          }

          commitUpdateQueue(finishedWork, _updateQueue, _instance);
        }

        return;
      }

    case HostComponent:
      {
        var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted
        // (eg DOM renderer may schedule auto-focus for inputs and form controls).
        // These effects should only be committed when components are first mounted,
        // aka when there is no current/alternate.

        if (current === null && finishedWork.flags & Update) {
          var type = finishedWork.type;
          var props = finishedWork.memoizedProps;
          commitMount(_instance2, type, props);
        }

        return;
      }

    case HostText:
      {
        // We have no life-cycles associated with text.
        return;
      }

    case HostPortal:
      {
        // We have no life-cycles associated with portals.
        return;
      }

    case Profiler:
      {
        {
          var _finishedWork$memoize2 = finishedWork.memoizedProps,
              onCommit = _finishedWork$memoize2.onCommit,
              onRender = _finishedWork$memoize2.onRender;
          var effectDuration = finishedWork.stateNode.effectDuration;
          var commitTime = getCommitTime();

          if (typeof onRender === 'function') {
            {
              onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime, finishedRoot.memoizedInteractions);
            }
          }
        }

        return;
      }

    case SuspenseComponent:
      {
        commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
        return;
      }

    case SuspenseListComponent:
    case IncompleteClassComponent:
    case FundamentalComponent:
    case ScopeComponent:
    case OffscreenComponent:
    case LegacyHiddenComponent:
      return;
  }

  {
    {
      throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function hideOrUnhideAllChildren(finishedWork, isHidden) {
  {
    // We only have the top Fiber that was inserted but we need to recurse down its
    // children to find all the terminal nodes.
    var node = finishedWork;

    while (true) {
      if (node.tag === HostComponent) {
        var instance = node.stateNode;

        if (isHidden) {
          hideInstance(instance);
        } else {
          unhideInstance(node.stateNode, node.memoizedProps);
        }
      } else if (node.tag === HostText) {
        var _instance3 = node.stateNode;

        if (isHidden) {
          hideTextInstance(_instance3);
        } else {
          unhideTextInstance(_instance3, node.memoizedProps);
        }
      } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ; else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }

      if (node === finishedWork) {
        return;
      }

      while (node.sibling === null) {
        if (node.return === null || node.return === finishedWork) {
          return;
        }

        node = node.return;
      }

      node.sibling.return = node.return;
      node = node.sibling;
    }
  }
}

function commitAttachRef(finishedWork) {
  var ref = finishedWork.ref;

  if (ref !== null) {
    var instance = finishedWork.stateNode;
    var instanceToUse;

    switch (finishedWork.tag) {
      case HostComponent:
        instanceToUse = getPublicInstance(instance);
        break;

      default:
        instanceToUse = instance;
    } // Moved outside to ensure DCE works with this flag

    if (typeof ref === 'function') {
      ref(instanceToUse);
    } else {
      {
        if (!ref.hasOwnProperty('current')) {
          error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().', getComponentName(finishedWork.type));
        }
      }

      ref.current = instanceToUse;
    }
  }
}

function commitDetachRef(current) {
  var currentRef = current.ref;

  if (currentRef !== null) {
    if (typeof currentRef === 'function') {
      currentRef(null);
    } else {
      currentRef.current = null;
    }
  }
} // User-originating errors (lifecycles and refs) should not interrupt
// deletion, so don't let them throw. Host-originating errors should
// interrupt deletion, so it's okay


function commitUnmount(finishedRoot, current, renderPriorityLevel) {
  onCommitUnmount(current);

  switch (current.tag) {
    case FunctionComponent:
    case ForwardRef:
    case MemoComponent:
    case SimpleMemoComponent:
    case Block:
      {
        var updateQueue = current.updateQueue;

        if (updateQueue !== null) {
          var lastEffect = updateQueue.lastEffect;

          if (lastEffect !== null) {
            var firstEffect = lastEffect.next;
            var effect = firstEffect;

            do {
              var _effect2 = effect,
                  destroy = _effect2.destroy,
                  tag = _effect2.tag;

              if (destroy !== undefined) {
                if ((tag & Passive$1) !== NoFlags$1) {
                  enqueuePendingPassiveHookEffectUnmount(current, effect);
                } else {
                  {
                    safelyCallDestroy(current, destroy);
                  }
                }
              }

              effect = effect.next;
            } while (effect !== firstEffect);
          }
        }

        return;
      }

    case ClassComponent:
      {
        safelyDetachRef(current);
        var instance = current.stateNode;

        if (typeof instance.componentWillUnmount === 'function') {
          safelyCallComponentWillUnmount(current, instance);
        }

        return;
      }

    case HostComponent:
      {
        safelyDetachRef(current);
        return;
      }

    case HostPortal:
      {
        // TODO: this is recursive.
        // We are also not using this parent because
        // the portal will get pushed immediately.
        {
          unmountHostComponents(finishedRoot, current);
        }

        return;
      }

    case FundamentalComponent:
      {

        return;
      }

    case DehydratedFragment:
      {

        return;
      }

    case ScopeComponent:
      {

        return;
      }
  }
}

function commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {
  // While we're inside a removed host node we don't want to call
  // removeChild on the inner nodes because they're removed by the top
  // call anyway. We also want to call componentWillUnmount on all
  // composites before this host node is removed from the tree. Therefore
  // we do an inner loop while we're still inside the host node.
  var node = root;

  while (true) {
    commitUnmount(finishedRoot, node); // Visit children because they may contain more composite or host nodes.
    // Skip portals because commitUnmount() currently visits them recursively.

    if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.
    // If we don't use mutation we drill down into portals here instead.
     node.tag !== HostPortal)) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === root) {
      return;
    }

    while (node.sibling === null) {
      if (node.return === null || node.return === root) {
        return;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function detachFiberMutation(fiber) {
  // Cut off the return pointers to disconnect it from the tree. Ideally, we
  // should clear the child pointer of the parent alternate to let this
  // get GC:ed but we don't know which for sure which parent is the current
  // one so we'll settle for GC:ing the subtree of this child. This child
  // itself will be GC:ed when the parent updates the next time.
  // Note: we cannot null out sibling here, otherwise it can cause issues
  // with findDOMNode and how it requires the sibling field to carry out
  // traversal in a later effect. See PR #16820. We now clear the sibling
  // field after effects, see: detachFiberAfterEffects.
  //
  // Don't disconnect stateNode now; it will be detached in detachFiberAfterEffects.
  // It may be required if the current component is an error boundary,
  // and one of its descendants throws while unmounting a passive effect.
  fiber.alternate = null;
  fiber.child = null;
  fiber.dependencies = null;
  fiber.firstEffect = null;
  fiber.lastEffect = null;
  fiber.memoizedProps = null;
  fiber.memoizedState = null;
  fiber.pendingProps = null;
  fiber.return = null;
  fiber.updateQueue = null;

  {
    fiber._debugOwner = null;
  }
}

function getHostParentFiber(fiber) {
  var parent = fiber.return;

  while (parent !== null) {
    if (isHostParent(parent)) {
      return parent;
    }

    parent = parent.return;
  }

  {
    {
      throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function isHostParent(fiber) {
  return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
}

function getHostSibling(fiber) {
  // We're going to search forward into the tree until we find a sibling host
  // node. Unfortunately, if multiple insertions are done in a row we have to
  // search past them. This leads to exponential search for the next sibling.
  // TODO: Find a more efficient way to do this.
  var node = fiber;

  siblings: while (true) {
    // If we didn't find anything, let's try the next sibling.
    while (node.sibling === null) {
      if (node.return === null || isHostParent(node.return)) {
        // If we pop out of the root or hit the parent the fiber we are the
        // last sibling.
        return null;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;

    while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
      // If it is not host node and, we might have a host node inside it.
      // Try to search down until we find one.
      if (node.flags & Placement) {
        // If we don't have a child, try the siblings instead.
        continue siblings;
      } // If we don't have a child, try the siblings instead.
      // We also skip portals because they are not part of this host tree.


      if (node.child === null || node.tag === HostPortal) {
        continue siblings;
      } else {
        node.child.return = node;
        node = node.child;
      }
    } // Check if this host node is stable or about to be placed.


    if (!(node.flags & Placement)) {
      // Found it!
      return node.stateNode;
    }
  }
}

function commitPlacement(finishedWork) {


  var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.

  var parent;
  var isContainer;
  var parentStateNode = parentFiber.stateNode;

  switch (parentFiber.tag) {
    case HostComponent:
      parent = parentStateNode;
      isContainer = false;
      break;

    case HostRoot:
      parent = parentStateNode.containerInfo;
      isContainer = true;
      break;

    case HostPortal:
      parent = parentStateNode.containerInfo;
      isContainer = true;
      break;

    case FundamentalComponent:

    // eslint-disable-next-line-no-fallthrough

    default:
      {
        {
          throw Error( "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." );
        }
      }

  }

  if (parentFiber.flags & ContentReset) {
    // Reset the text content of the parent before doing any insertions
    resetTextContent(parent); // Clear ContentReset from the effect tag

    parentFiber.flags &= ~ContentReset;
  }

  var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its
  // children to find all the terminal nodes.

  if (isContainer) {
    insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);
  } else {
    insertOrAppendPlacementNode(finishedWork, before, parent);
  }
}

function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
  var tag = node.tag;
  var isHost = tag === HostComponent || tag === HostText;

  if (isHost || enableFundamentalAPI ) {
    var stateNode = isHost ? node.stateNode : node.stateNode.instance;

    if (before) {
      insertInContainerBefore(parent, stateNode, before);
    } else {
      appendChildToContainer(parent, stateNode);
    }
  } else if (tag === HostPortal) ; else {
    var child = node.child;

    if (child !== null) {
      insertOrAppendPlacementNodeIntoContainer(child, before, parent);
      var sibling = child.sibling;

      while (sibling !== null) {
        insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
        sibling = sibling.sibling;
      }
    }
  }
}

function insertOrAppendPlacementNode(node, before, parent) {
  var tag = node.tag;
  var isHost = tag === HostComponent || tag === HostText;

  if (isHost || enableFundamentalAPI ) {
    var stateNode = isHost ? node.stateNode : node.stateNode.instance;

    if (before) {
      insertBefore(parent, stateNode, before);
    } else {
      appendChild(parent, stateNode);
    }
  } else if (tag === HostPortal) ; else {
    var child = node.child;

    if (child !== null) {
      insertOrAppendPlacementNode(child, before, parent);
      var sibling = child.sibling;

      while (sibling !== null) {
        insertOrAppendPlacementNode(sibling, before, parent);
        sibling = sibling.sibling;
      }
    }
  }
}

function unmountHostComponents(finishedRoot, current, renderPriorityLevel) {
  // We only have the top Fiber that was deleted but we need to recurse down its
  // children to find all the terminal nodes.
  var node = current; // Each iteration, currentParent is populated with node's host parent if not
  // currentParentIsValid.

  var currentParentIsValid = false; // Note: these two variables *must* always be updated together.

  var currentParent;
  var currentParentIsContainer;

  while (true) {
    if (!currentParentIsValid) {
      var parent = node.return;

      findParent: while (true) {
        if (!(parent !== null)) {
          {
            throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." );
          }
        }

        var parentStateNode = parent.stateNode;

        switch (parent.tag) {
          case HostComponent:
            currentParent = parentStateNode;
            currentParentIsContainer = false;
            break findParent;

          case HostRoot:
            currentParent = parentStateNode.containerInfo;
            currentParentIsContainer = true;
            break findParent;

          case HostPortal:
            currentParent = parentStateNode.containerInfo;
            currentParentIsContainer = true;
            break findParent;

        }

        parent = parent.return;
      }

      currentParentIsValid = true;
    }

    if (node.tag === HostComponent || node.tag === HostText) {
      commitNestedUnmounts(finishedRoot, node); // After all the children have unmounted, it is now safe to remove the
      // node from the tree.

      if (currentParentIsContainer) {
        removeChildFromContainer(currentParent, node.stateNode);
      } else {
        removeChild(currentParent, node.stateNode);
      } // Don't visit children because we already visited them.

    } else if (node.tag === HostPortal) {
      if (node.child !== null) {
        // When we go into a portal, it becomes the parent to remove from.
        // We will reassign it back when we pop the portal on the way up.
        currentParent = node.stateNode.containerInfo;
        currentParentIsContainer = true; // Visit children because portals might contain host components.

        node.child.return = node;
        node = node.child;
        continue;
      }
    } else {
      commitUnmount(finishedRoot, node); // Visit children because we may find more host components below.

      if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
    }

    if (node === current) {
      return;
    }

    while (node.sibling === null) {
      if (node.return === null || node.return === current) {
        return;
      }

      node = node.return;

      if (node.tag === HostPortal) {
        // When we go out of the portal, we need to restore the parent.
        // Since we don't keep a stack of them, we will search for it.
        currentParentIsValid = false;
      }
    }

    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function commitDeletion(finishedRoot, current, renderPriorityLevel) {
  {
    // Recursively delete all host nodes from the parent.
    // Detach refs and call componentWillUnmount() on the whole subtree.
    unmountHostComponents(finishedRoot, current);
  }

  var alternate = current.alternate;
  detachFiberMutation(current);

  if (alternate !== null) {
    detachFiberMutation(alternate);
  }
}

function commitWork(current, finishedWork) {

  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case MemoComponent:
    case SimpleMemoComponent:
    case Block:
      {
        // Layout effects are destroyed during the mutation phase so that all
        // destroy functions for all fibers are called before any create functions.
        // This prevents sibling component effects from interfering with each other,
        // e.g. a destroy function in one component should never override a ref set
        // by a create function in another component during the same commit.
        {
          commitHookEffectListUnmount(Layout | HasEffect, finishedWork);
        }

        return;
      }

    case ClassComponent:
      {
        return;
      }

    case HostComponent:
      {
        var instance = finishedWork.stateNode;

        if (instance != null) {
          // Commit the work prepared earlier.
          var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
          // as the newProps. The updatePayload will contain the real change in
          // this case.

          var oldProps = current !== null ? current.memoizedProps : newProps;
          var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.

          var updatePayload = finishedWork.updateQueue;
          finishedWork.updateQueue = null;

          if (updatePayload !== null) {
            commitUpdate(instance, updatePayload, type, oldProps, newProps);
          }
        }

        return;
      }

    case HostText:
      {
        if (!(finishedWork.stateNode !== null)) {
          {
            throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." );
          }
        }

        var textInstance = finishedWork.stateNode;
        var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
        // as the newProps. The updatePayload will contain the real change in
        // this case.

        var oldText = current !== null ? current.memoizedProps : newText;
        commitTextUpdate(textInstance, oldText, newText);
        return;
      }

    case HostRoot:
      {
        {
          var _root = finishedWork.stateNode;

          if (_root.hydrate) {
            // We've just hydrated. No need to hydrate again.
            _root.hydrate = false;
            commitHydratedContainer(_root.containerInfo);
          }
        }

        return;
      }

    case Profiler:
      {
        return;
      }

    case SuspenseComponent:
      {
        commitSuspenseComponent(finishedWork);
        attachSuspenseRetryListeners(finishedWork);
        return;
      }

    case SuspenseListComponent:
      {
        attachSuspenseRetryListeners(finishedWork);
        return;
      }

    case IncompleteClassComponent:
      {
        return;
      }

    case FundamentalComponent:
      {

        break;
      }

    case ScopeComponent:
      {

        break;
      }

    case OffscreenComponent:
    case LegacyHiddenComponent:
      {
        var newState = finishedWork.memoizedState;
        var isHidden = newState !== null;
        hideOrUnhideAllChildren(finishedWork, isHidden);
        return;
      }
  }

  {
    {
      throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function commitSuspenseComponent(finishedWork) {
  var newState = finishedWork.memoizedState;

  if (newState !== null) {
    markCommitTimeOfFallback();

    {
      // Hide the Offscreen component that contains the primary children. TODO:
      // Ideally, this effect would have been scheduled on the Offscreen fiber
      // itself. That's how unhiding works: the Offscreen component schedules an
      // effect on itself. However, in this case, the component didn't complete,
      // so the fiber was never added to the effect list in the normal path. We
      // could have appended it to the effect list in the Suspense component's
      // second pass, but doing it this way is less complicated. This would be
      // simpler if we got rid of the effect list and traversed the tree, like
      // we're planning to do.
      var primaryChildParent = finishedWork.child;
      hideOrUnhideAllChildren(primaryChildParent, true);
    }
  }
}

function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {

  var newState = finishedWork.memoizedState;

  if (newState === null) {
    var current = finishedWork.alternate;

    if (current !== null) {
      var prevState = current.memoizedState;

      if (prevState !== null) {
        var suspenseInstance = prevState.dehydrated;

        if (suspenseInstance !== null) {
          commitHydratedSuspenseInstance(suspenseInstance);
        }
      }
    }
  }
}

function attachSuspenseRetryListeners(finishedWork) {
  // If this boundary just timed out, then it will have a set of wakeables.
  // For each wakeable, attach a listener so that when it resolves, React
  // attempts to re-render the boundary in the primary (pre-timeout) state.
  var wakeables = finishedWork.updateQueue;

  if (wakeables !== null) {
    finishedWork.updateQueue = null;
    var retryCache = finishedWork.stateNode;

    if (retryCache === null) {
      retryCache = finishedWork.stateNode = new PossiblyWeakSet();
    }

    wakeables.forEach(function (wakeable) {
      // Memoize using the boundary fiber to prevent redundant listeners.
      var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);

      if (!retryCache.has(wakeable)) {
        {
          if (wakeable.__reactDoNotTraceInteractions !== true) {
            retry = tracing.unstable_wrap(retry);
          }
        }

        retryCache.add(wakeable);
        wakeable.then(retry, retry);
      }
    });
  }
} // This function detects when a Suspense boundary goes from visible to hidden.
// It returns false if the boundary is already hidden.
// TODO: Use an effect tag.


function isSuspenseBoundaryBeingHidden(current, finishedWork) {
  if (current !== null) {
    var oldState = current.memoizedState;

    if (oldState === null || oldState.dehydrated !== null) {
      var newState = finishedWork.memoizedState;
      return newState !== null && newState.dehydrated === null;
    }
  }

  return false;
}

function commitResetTextContent(current) {

  resetTextContent(current.stateNode);
}

var COMPONENT_TYPE = 0;
var HAS_PSEUDO_CLASS_TYPE = 1;
var ROLE_TYPE = 2;
var TEST_NAME_TYPE = 3;
var TEXT_TYPE = 4;

if (typeof Symbol === 'function' && Symbol.for) {
  var symbolFor$1 = Symbol.for;
  COMPONENT_TYPE = symbolFor$1('selector.component');
  HAS_PSEUDO_CLASS_TYPE = symbolFor$1('selector.has_pseudo_class');
  ROLE_TYPE = symbolFor$1('selector.role');
  TEST_NAME_TYPE = symbolFor$1('selector.test_id');
  TEXT_TYPE = symbolFor$1('selector.text');
}
var commitHooks = [];
function onCommitRoot$1() {
  {
    commitHooks.forEach(function (commitHook) {
      return commitHook();
    });
  }
}

var ceil = Math.ceil;
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher,
    ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
    IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
var NoContext =
/*             */
0;
var BatchedContext =
/*               */
1;
var EventContext =
/*                 */
2;
var DiscreteEventContext =
/*         */
4;
var LegacyUnbatchedContext =
/*       */
8;
var RenderContext =
/*                */
16;
var CommitContext =
/*                */
32;
var RetryAfterError =
/*       */
64;
var RootIncomplete = 0;
var RootFatalErrored = 1;
var RootErrored = 2;
var RootSuspended = 3;
var RootSuspendedWithDelay = 4;
var RootCompleted = 5; // Describes where we are in the React execution stack

var executionContext = NoContext; // The root we're working on

var workInProgressRoot = null; // The fiber we're working on

var workInProgress = null; // The lanes we're rendering

var workInProgressRootRenderLanes = NoLanes; // Stack that allows components to change the render lanes for its subtree
// This is a superset of the lanes we started working on at the root. The only
// case where it's different from `workInProgressRootRenderLanes` is when we
// enter a subtree that is hidden and needs to be unhidden: Suspense and
// Offscreen component.
//
// Most things in the work loop should deal with workInProgressRootRenderLanes.
// Most things in begin/complete phases should deal with subtreeRenderLanes.

var subtreeRenderLanes = NoLanes;
var subtreeRenderLanesCursor = createCursor(NoLanes); // Whether to root completed, errored, suspended, etc.

var workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown

var workInProgressRootFatalError = null; // "Included" lanes refer to lanes that were worked on during this render. It's
// slightly different than `renderLanes` because `renderLanes` can change as you
// enter and exit an Offscreen tree. This value is the combination of all render
// lanes for the entire render phase.

var workInProgressRootIncludedLanes = NoLanes; // The work left over by components that were visited during this render. Only
// includes unprocessed updates, not work in bailed out children.

var workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render.

var workInProgressRootUpdatedLanes = NoLanes; // Lanes that were pinged (in an interleaved event) during this render.

var workInProgressRootPingedLanes = NoLanes;
var mostRecentlyUpdatedRoot = null; // The most recent time we committed a fallback. This lets us ensure a train
// model where we don't commit new loading states in too quick succession.

var globalMostRecentFallbackTime = 0;
var FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering
// more and prefer CPU suspense heuristics instead.

var workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU
// suspense heuristics and opt out of rendering more content.

var RENDER_TIMEOUT_MS = 500;

function resetRenderTimer() {
  workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;
}

function getRenderTargetTime() {
  return workInProgressRootRenderTargetTime;
}
var nextEffect = null;
var hasUncaughtError = false;
var firstUncaughtError = null;
var legacyErrorBoundariesThatAlreadyFailed = null;
var rootDoesHavePassiveEffects = false;
var rootWithPendingPassiveEffects = null;
var pendingPassiveEffectsRenderPriority = NoPriority$1;
var pendingPassiveEffectsLanes = NoLanes;
var pendingPassiveHookEffectsMount = [];
var pendingPassiveHookEffectsUnmount = [];
var rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates

var NESTED_UPDATE_LIMIT = 50;
var nestedUpdateCount = 0;
var rootWithNestedUpdates = null;
var NESTED_PASSIVE_UPDATE_LIMIT = 50;
var nestedPassiveUpdateCount = 0; // Marks the need to reschedule pending interactions at these lanes
// during the commit phase. This enables them to be traced across components
// that spawn new work during render. E.g. hidden boundaries, suspended SSR
// hydration or SuspenseList.
// TODO: Can use a bitmask instead of an array

var spawnedWorkDuringRender = null; // If two updates are scheduled within the same event, we should treat their
// event times as simultaneous, even if the actual clock time has advanced
// between the first and second call.

var currentEventTime = NoTimestamp;
var currentEventWipLanes = NoLanes;
var currentEventPendingLanes = NoLanes; // Dev only flag that tracks if passive effects are currently being flushed.
// We warn about state updates for unmounted components differently in this case.

var isFlushingPassiveEffects = false;
var focusedInstanceHandle = null;
var shouldFireAfterActiveInstanceBlur = false;
function getWorkInProgressRoot() {
  return workInProgressRoot;
}
function requestEventTime() {
  if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
    // We're inside React, so it's fine to read the actual time.
    return now();
  } // We're not inside React, so we may be in the middle of a browser event.


  if (currentEventTime !== NoTimestamp) {
    // Use the same start time for all updates until we enter React again.
    return currentEventTime;
  } // This is the first update since React yielded. Compute a new start time.


  currentEventTime = now();
  return currentEventTime;
}
function requestUpdateLane(fiber) {
  // Special cases
  var mode = fiber.mode;

  if ((mode & BlockingMode) === NoMode) {
    return SyncLane;
  } else if ((mode & ConcurrentMode) === NoMode) {
    return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
  } // The algorithm for assigning an update to a lane should be stable for all
  // updates at the same priority within the same event. To do this, the inputs
  // to the algorithm must be the same. For example, we use the `renderLanes`
  // to avoid choosing a lane that is already in the middle of rendering.
  //
  // However, the "included" lanes could be mutated in between updates in the
  // same event, like if you perform an update inside `flushSync`. Or any other
  // code path that might call `prepareFreshStack`.
  //
  // The trick we use is to cache the first of each of these inputs within an
  // event. Then reset the cached values once we can be sure the event is over.
  // Our heuristic for that is whenever we enter a concurrent work loop.
  //
  // We'll do the same for `currentEventPendingLanes` below.


  if (currentEventWipLanes === NoLanes) {
    currentEventWipLanes = workInProgressRootIncludedLanes;
  }

  var isTransition = requestCurrentTransition() !== NoTransition;

  if (isTransition) {
    if (currentEventPendingLanes !== NoLanes) {
      currentEventPendingLanes = mostRecentlyUpdatedRoot !== null ? mostRecentlyUpdatedRoot.pendingLanes : NoLanes;
    }

    return findTransitionLane(currentEventWipLanes, currentEventPendingLanes);
  } // TODO: Remove this dependency on the Scheduler priority.
  // To do that, we're replacing it with an update lane priority.


  var schedulerPriority = getCurrentPriorityLevel(); // The old behavior was using the priority level of the Scheduler.
  // This couples React to the Scheduler internals, so we're replacing it
  // with the currentUpdateLanePriority above. As an example of how this
  // could be problematic, if we're not inside `Scheduler.runWithPriority`,
  // then we'll get the priority of the current running Scheduler task,
  // which is probably not what we want.

  var lane;

  if ( // TODO: Temporary. We're removing the concept of discrete updates.
  (executionContext & DiscreteEventContext) !== NoContext && schedulerPriority === UserBlockingPriority$2) {
    lane = findUpdateLane(InputDiscreteLanePriority, currentEventWipLanes);
  } else {
    var schedulerLanePriority = schedulerPriorityToLanePriority(schedulerPriority);

    lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes);
  }

  return lane;
}

function requestRetryLane(fiber) {
  // This is a fork of `requestUpdateLane` designed specifically for Suspense
  // "retries" — a special update that attempts to flip a Suspense boundary
  // from its placeholder state to its primary/resolved state.
  // Special cases
  var mode = fiber.mode;

  if ((mode & BlockingMode) === NoMode) {
    return SyncLane;
  } else if ((mode & ConcurrentMode) === NoMode) {
    return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
  } // See `requestUpdateLane` for explanation of `currentEventWipLanes`


  if (currentEventWipLanes === NoLanes) {
    currentEventWipLanes = workInProgressRootIncludedLanes;
  }

  return findRetryLane(currentEventWipLanes);
}

function scheduleUpdateOnFiber(fiber, lane, eventTime) {
  checkForNestedUpdates();
  warnAboutRenderPhaseUpdatesInDEV(fiber);
  var root = markUpdateLaneFromFiberToRoot(fiber, lane);

  if (root === null) {
    warnAboutUpdateOnUnmountedFiberInDEV(fiber);
    return null;
  } // Mark that the root has a pending update.


  markRootUpdated(root, lane, eventTime);

  if (root === workInProgressRoot) {
    // Received an update to a tree that's in the middle of rendering. Mark
    // that there was an interleaved update work on this root. Unless the
    // `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render
    // phase update. In that case, we don't treat render phase updates as if
    // they were interleaved, for backwards compat reasons.
    {
      workInProgressRootUpdatedLanes = mergeLanes(workInProgressRootUpdatedLanes, lane);
    }

    if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
      // The root already suspended with a delay, which means this render
      // definitely won't finish. Since we have a new update, let's mark it as
      // suspended now, right before marking the incoming update. This has the
      // effect of interrupting the current render and switching to the update.
      // TODO: Make sure this doesn't override pings that happen while we've
      // already started rendering.
      markRootSuspended$1(root, workInProgressRootRenderLanes);
    }
  } // TODO: requestUpdateLanePriority also reads the priority. Pass the
  // priority as an argument to that function and this one.


  var priorityLevel = getCurrentPriorityLevel();

  if (lane === SyncLane) {
    if ( // Check if we're inside unbatchedUpdates
    (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering
    (executionContext & (RenderContext | CommitContext)) === NoContext) {
      // Register pending interactions on the root to avoid losing traced interaction data.
      schedulePendingInteractions(root, lane); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed
      // root inside of batchedUpdates should be synchronous, but layout updates
      // should be deferred until the end of the batch.

      performSyncWorkOnRoot(root);
    } else {
      ensureRootIsScheduled(root, eventTime);
      schedulePendingInteractions(root, lane);

      if (executionContext === NoContext) {
        // Flush the synchronous work now, unless we're already working or inside
        // a batch. This is intentionally inside scheduleUpdateOnFiber instead of
        // scheduleCallbackForFiber to preserve the ability to schedule a callback
        // without immediately flushing it. We only do this for user-initiated
        // updates, to preserve historical behavior of legacy mode.
        resetRenderTimer();
        flushSyncCallbackQueue();
      }
    }
  } else {
    // Schedule a discrete update but only if it's not Sync.
    if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered
    // discrete, even inside a discrete event.
    priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority$1)) {
      // This is the result of a discrete event. Track the lowest priority
      // discrete update per root so we can flush them early, if needed.
      if (rootsWithPendingDiscreteUpdates === null) {
        rootsWithPendingDiscreteUpdates = new Set([root]);
      } else {
        rootsWithPendingDiscreteUpdates.add(root);
      }
    } // Schedule other updates after in case the callback is sync.


    ensureRootIsScheduled(root, eventTime);
    schedulePendingInteractions(root, lane);
  } // We use this when assigning a lane for a transition inside
  // `requestUpdateLane`. We assume it's the same as the root being updated,
  // since in the common case of a single root app it probably is. If it's not
  // the same root, then it's not a huge deal, we just might batch more stuff
  // together more than necessary.


  mostRecentlyUpdatedRoot = root;
} // This is split into a separate function so we can mark a fiber with pending
// work without treating it as a typical update that originates from an event;
// e.g. retrying a Suspense boundary isn't an update, but it does schedule work
// on a fiber.

function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
  // Update the source fiber's lanes
  sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
  var alternate = sourceFiber.alternate;

  if (alternate !== null) {
    alternate.lanes = mergeLanes(alternate.lanes, lane);
  }

  {
    if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
      warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
    }
  } // Walk the parent path to the root and update the child expiration time.


  var node = sourceFiber;
  var parent = sourceFiber.return;

  while (parent !== null) {
    parent.childLanes = mergeLanes(parent.childLanes, lane);
    alternate = parent.alternate;

    if (alternate !== null) {
      alternate.childLanes = mergeLanes(alternate.childLanes, lane);
    } else {
      {
        if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
          warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
        }
      }
    }

    node = parent;
    parent = parent.return;
  }

  if (node.tag === HostRoot) {
    var root = node.stateNode;
    return root;
  } else {
    return null;
  }
} // Use this function to schedule a task for a root. There's only one task per
// root; if a task was already scheduled, we'll check to make sure the priority
// of the existing task is the same as the priority of the next level that the
// root has work on. This function is called on every update, and right before
// exiting a task.


function ensureRootIsScheduled(root, currentTime) {
  var existingCallbackNode = root.callbackNode; // Check if any lanes are being starved by other work. If so, mark them as
  // expired so we know to work on those next.

  markStarvedLanesAsExpired(root, currentTime); // Determine the next lanes to work on, and their priority.

  var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); // This returns the priority level computed during the `getNextLanes` call.

  var newCallbackPriority = returnNextLanesPriority();

  if (nextLanes === NoLanes) {
    // Special case: There's nothing to work on.
    if (existingCallbackNode !== null) {
      cancelCallback(existingCallbackNode);
      root.callbackNode = null;
      root.callbackPriority = NoLanePriority;
    }

    return;
  } // Check if there's an existing task. We may be able to reuse it.


  if (existingCallbackNode !== null) {
    var existingCallbackPriority = root.callbackPriority;

    if (existingCallbackPriority === newCallbackPriority) {
      // The priority hasn't changed. We can reuse the existing task. Exit.
      return;
    } // The priority changed. Cancel the existing callback. We'll schedule a new
    // one below.


    cancelCallback(existingCallbackNode);
  } // Schedule a new callback.


  var newCallbackNode;

  if (newCallbackPriority === SyncLanePriority) {
    // Special case: Sync React callbacks are scheduled on a special
    // internal queue
    newCallbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
  } else if (newCallbackPriority === SyncBatchedLanePriority) {
    newCallbackNode = scheduleCallback(ImmediatePriority$1, performSyncWorkOnRoot.bind(null, root));
  } else {
    var schedulerPriorityLevel = lanePriorityToSchedulerPriority(newCallbackPriority);
    newCallbackNode = scheduleCallback(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root));
  }

  root.callbackPriority = newCallbackPriority;
  root.callbackNode = newCallbackNode;
} // This is the entry point for every concurrent task, i.e. anything that
// goes through Scheduler.


function performConcurrentWorkOnRoot(root) {
  // Since we know we're in a React event, we can clear the current
  // event time. The next update will compute a new event time.
  currentEventTime = NoTimestamp;
  currentEventWipLanes = NoLanes;
  currentEventPendingLanes = NoLanes;

  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
    {
      throw Error( "Should not already be working." );
    }
  } // Flush any pending passive effects before deciding which lanes to work on,
  // in case they schedule additional work.


  var originalCallbackNode = root.callbackNode;
  var didFlushPassiveEffects = flushPassiveEffects();

  if (didFlushPassiveEffects) {
    // Something in the passive effect phase may have canceled the current task.
    // Check if the task node for this root was changed.
    if (root.callbackNode !== originalCallbackNode) {
      // The current task was canceled. Exit. We don't need to call
      // `ensureRootIsScheduled` because the check above implies either that
      // there's a new task, or that there's no remaining work on this root.
      return null;
    }
  } // Determine the next expiration time to work on, using the fields stored
  // on the root.


  var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);

  if (lanes === NoLanes) {
    // Defensive coding. This is never expected to happen.
    return null;
  }

  var exitStatus = renderRootConcurrent(root, lanes);

  if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
    // The render included lanes that were updated during the render phase.
    // For example, when unhiding a hidden tree, we include all the lanes
    // that were previously skipped when the tree was hidden. That set of
    // lanes is a superset of the lanes we started rendering with.
    //
    // So we'll throw out the current work and restart.
    prepareFreshStack(root, NoLanes);
  } else if (exitStatus !== RootIncomplete) {
    if (exitStatus === RootErrored) {
      executionContext |= RetryAfterError; // If an error occurred during hydration,
      // discard server response and fall back to client side render.

      if (root.hydrate) {
        root.hydrate = false;
        clearContainer(root.containerInfo);
      } // If something threw an error, try rendering one more time. We'll render
      // synchronously to block concurrent data mutations, and we'll includes
      // all pending updates are included. If it still fails after the second
      // attempt, we'll give up and commit the resulting tree.


      lanes = getLanesToRetrySynchronouslyOnError(root);

      if (lanes !== NoLanes) {
        exitStatus = renderRootSync(root, lanes);
      }
    }

    if (exitStatus === RootFatalErrored) {
      var fatalError = workInProgressRootFatalError;
      prepareFreshStack(root, NoLanes);
      markRootSuspended$1(root, lanes);
      ensureRootIsScheduled(root, now());
      throw fatalError;
    } // We now have a consistent tree. The next step is either to commit it,
    // or, if something suspended, wait to commit it after a timeout.


    var finishedWork = root.current.alternate;
    root.finishedWork = finishedWork;
    root.finishedLanes = lanes;
    finishConcurrentRender(root, exitStatus, lanes);
  }

  ensureRootIsScheduled(root, now());

  if (root.callbackNode === originalCallbackNode) {
    // The task node scheduled for this root is the same one that's
    // currently executed. Need to return a continuation.
    return performConcurrentWorkOnRoot.bind(null, root);
  }

  return null;
}

function finishConcurrentRender(root, exitStatus, lanes) {
  switch (exitStatus) {
    case RootIncomplete:
    case RootFatalErrored:
      {
        {
          {
            throw Error( "Root did not complete. This is a bug in React." );
          }
        }
      }
    // Flow knows about invariant, so it complains if I add a break
    // statement, but eslint doesn't know about invariant, so it complains
    // if I do. eslint-disable-next-line no-fallthrough

    case RootErrored:
      {
        // We should have already attempted to retry this tree. If we reached
        // this point, it errored again. Commit it.
        commitRoot(root);
        break;
      }

    case RootSuspended:
      {
        markRootSuspended$1(root, lanes); // We have an acceptable loading state. We need to figure out if we
        // should immediately commit it or wait a bit.

        if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope
        !shouldForceFlushFallbacksInDEV()) {
          // This render only included retries, no updates. Throttle committing
          // retries so that we don't show too many loading states too quickly.
          var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.

          if (msUntilTimeout > 10) {
            var nextLanes = getNextLanes(root, NoLanes);

            if (nextLanes !== NoLanes) {
              // There's additional work on this root.
              break;
            }

            var suspendedLanes = root.suspendedLanes;

            if (!isSubsetOfLanes(suspendedLanes, lanes)) {
              // We should prefer to render the fallback of at the last
              // suspended level. Ping the last suspended level to try
              // rendering it again.
              // FIXME: What if the suspended lanes are Idle? Should not restart.
              var eventTime = requestEventTime();
              markRootPinged(root, suspendedLanes);
              break;
            } // The render is suspended, it hasn't timed out, and there's no
            // lower priority work to do. Instead of committing the fallback
            // immediately, wait for more data to arrive.


            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);
            break;
          }
        } // The work expired. Commit immediately.


        commitRoot(root);
        break;
      }

    case RootSuspendedWithDelay:
      {
        markRootSuspended$1(root, lanes);

        if (includesOnlyTransitions(lanes)) {
          // This is a transition, so we should exit without committing a
          // placeholder and without scheduling a timeout. Delay indefinitely
          // until we receive more data.
          break;
        }

        if (!shouldForceFlushFallbacksInDEV()) {
          // This is not a transition, but we did trigger an avoided state.
          // Schedule a placeholder to display after a short delay, using the Just
          // Noticeable Difference.
          // TODO: Is the JND optimization worth the added complexity? If this is
          // the only reason we track the event time, then probably not.
          // Consider removing.
          var mostRecentEventTime = getMostRecentEventTime(root, lanes);
          var eventTimeMs = mostRecentEventTime;
          var timeElapsedMs = now() - eventTimeMs;

          var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.


          if (_msUntilTimeout > 10) {
            // Instead of committing the fallback immediately, wait for more data
            // to arrive.
            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);
            break;
          }
        } // Commit the placeholder.


        commitRoot(root);
        break;
      }

    case RootCompleted:
      {
        // The work completed. Ready to commit.
        commitRoot(root);
        break;
      }

    default:
      {
        {
          {
            throw Error( "Unknown root exit status." );
          }
        }
      }
  }
}

function markRootSuspended$1(root, suspendedLanes) {
  // When suspending, we should always exclude lanes that were pinged or (more
  // rarely, since we try to avoid it) updated during the render phase.
  // TODO: Lol maybe there's a better way to factor this besides this
  // obnoxiously named function :)
  suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
  suspendedLanes = removeLanes(suspendedLanes, workInProgressRootUpdatedLanes);
  markRootSuspended(root, suspendedLanes);
} // This is the entry point for synchronous tasks that don't go
// through Scheduler


function performSyncWorkOnRoot(root) {
  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
    {
      throw Error( "Should not already be working." );
    }
  }

  flushPassiveEffects();
  var lanes;
  var exitStatus;

  if (root === workInProgressRoot && includesSomeLane(root.expiredLanes, workInProgressRootRenderLanes)) {
    // There's a partial tree, and at least one of its lanes has expired. Finish
    // rendering it before rendering the rest of the expired work.
    lanes = workInProgressRootRenderLanes;
    exitStatus = renderRootSync(root, lanes);

    if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
      // The render included lanes that were updated during the render phase.
      // For example, when unhiding a hidden tree, we include all the lanes
      // that were previously skipped when the tree was hidden. That set of
      // lanes is a superset of the lanes we started rendering with.
      //
      // Note that this only happens when part of the tree is rendered
      // concurrently. If the whole tree is rendered synchronously, then there
      // are no interleaved events.
      lanes = getNextLanes(root, lanes);
      exitStatus = renderRootSync(root, lanes);
    }
  } else {
    lanes = getNextLanes(root, NoLanes);
    exitStatus = renderRootSync(root, lanes);
  }

  if (root.tag !== LegacyRoot && exitStatus === RootErrored) {
    executionContext |= RetryAfterError; // If an error occurred during hydration,
    // discard server response and fall back to client side render.

    if (root.hydrate) {
      root.hydrate = false;
      clearContainer(root.containerInfo);
    } // If something threw an error, try rendering one more time. We'll render
    // synchronously to block concurrent data mutations, and we'll includes
    // all pending updates are included. If it still fails after the second
    // attempt, we'll give up and commit the resulting tree.


    lanes = getLanesToRetrySynchronouslyOnError(root);

    if (lanes !== NoLanes) {
      exitStatus = renderRootSync(root, lanes);
    }
  }

  if (exitStatus === RootFatalErrored) {
    var fatalError = workInProgressRootFatalError;
    prepareFreshStack(root, NoLanes);
    markRootSuspended$1(root, lanes);
    ensureRootIsScheduled(root, now());
    throw fatalError;
  } // We now have a consistent tree. Because this is a sync render, we
  // will commit it even if something suspended.


  var finishedWork = root.current.alternate;
  root.finishedWork = finishedWork;
  root.finishedLanes = lanes;
  commitRoot(root); // Before exiting, make sure there's a callback scheduled for the next
  // pending level.

  ensureRootIsScheduled(root, now());
  return null;
}
function flushDiscreteUpdates() {
  // TODO: Should be able to flush inside batchedUpdates, but not inside `act`.
  // However, `act` uses `batchedUpdates`, so there's no way to distinguish
  // those two cases. Need to fix this before exposing flushDiscreteUpdates
  // as a public API.
  if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
    {
      if ((executionContext & RenderContext) !== NoContext) {
        error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');
      }
    } // We're already rendering, so we can't synchronously flush pending work.
    // This is probably a nested event dispatch triggered by a lifecycle/effect,
    // like `el.focus()`. Exit.


    return;
  }

  flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that
  // they fire before the next serial event.

  flushPassiveEffects();
}

function flushPendingDiscreteUpdates() {
  if (rootsWithPendingDiscreteUpdates !== null) {
    // For each root with pending discrete updates, schedule a callback to
    // immediately flush them.
    var roots = rootsWithPendingDiscreteUpdates;
    rootsWithPendingDiscreteUpdates = null;
    roots.forEach(function (root) {
      markDiscreteUpdatesExpired(root);
      ensureRootIsScheduled(root, now());
    });
  } // Now flush the immediate queue.


  flushSyncCallbackQueue();
}

function batchedUpdates$1(fn, a) {
  var prevExecutionContext = executionContext;
  executionContext |= BatchedContext;

  try {
    return fn(a);
  } finally {
    executionContext = prevExecutionContext;

    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      resetRenderTimer();
      flushSyncCallbackQueue();
    }
  }
}
function batchedEventUpdates$1(fn, a) {
  var prevExecutionContext = executionContext;
  executionContext |= EventContext;

  try {
    return fn(a);
  } finally {
    executionContext = prevExecutionContext;

    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      resetRenderTimer();
      flushSyncCallbackQueue();
    }
  }
}
function discreteUpdates$1(fn, a, b, c, d) {
  var prevExecutionContext = executionContext;
  executionContext |= DiscreteEventContext;

  {
    try {
      return runWithPriority$1(UserBlockingPriority$2, fn.bind(null, a, b, c, d));
    } finally {
      executionContext = prevExecutionContext;

      if (executionContext === NoContext) {
        // Flush the immediate callbacks that were scheduled during this batch
        resetRenderTimer();
        flushSyncCallbackQueue();
      }
    }
  }
}
function unbatchedUpdates(fn, a) {
  var prevExecutionContext = executionContext;
  executionContext &= ~BatchedContext;
  executionContext |= LegacyUnbatchedContext;

  try {
    return fn(a);
  } finally {
    executionContext = prevExecutionContext;

    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      resetRenderTimer();
      flushSyncCallbackQueue();
    }
  }
}
function flushSync(fn, a) {
  var prevExecutionContext = executionContext;

  if ((prevExecutionContext & (RenderContext | CommitContext)) !== NoContext) {
    {
      error('flushSync was called from inside a lifecycle method. React cannot ' + 'flush when React is already rendering. Consider moving this call to ' + 'a scheduler task or micro task.');
    }

    return fn(a);
  }

  executionContext |= BatchedContext;

  {
    try {
      if (fn) {
        return runWithPriority$1(ImmediatePriority$1, fn.bind(null, a));
      } else {
        return undefined;
      }
    } finally {
      executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.
      // Note that this will happen even if batchedUpdates is higher up
      // the stack.

      flushSyncCallbackQueue();
    }
  }
}
function pushRenderLanes(fiber, lanes) {
  push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
  subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
  workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
}
function popRenderLanes(fiber) {
  subtreeRenderLanes = subtreeRenderLanesCursor.current;
  pop(subtreeRenderLanesCursor, fiber);
}

function prepareFreshStack(root, lanes) {
  root.finishedWork = null;
  root.finishedLanes = NoLanes;
  var timeoutHandle = root.timeoutHandle;

  if (timeoutHandle !== noTimeout) {
    // The root previous suspended and scheduled a timeout to commit a fallback
    // state. Now that we have additional work, cancel the timeout.
    root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above

    cancelTimeout(timeoutHandle);
  }

  if (workInProgress !== null) {
    var interruptedWork = workInProgress.return;

    while (interruptedWork !== null) {
      unwindInterruptedWork(interruptedWork);
      interruptedWork = interruptedWork.return;
    }
  }

  workInProgressRoot = root;
  workInProgress = createWorkInProgress(root.current, null);
  workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
  workInProgressRootExitStatus = RootIncomplete;
  workInProgressRootFatalError = null;
  workInProgressRootSkippedLanes = NoLanes;
  workInProgressRootUpdatedLanes = NoLanes;
  workInProgressRootPingedLanes = NoLanes;

  {
    spawnedWorkDuringRender = null;
  }

  {
    ReactStrictModeWarnings.discardPendingWarnings();
  }
}

function handleError(root, thrownValue) {
  do {
    var erroredWork = workInProgress;

    try {
      // Reset module-level state that was set during the render phase.
      resetContextDependencies();
      resetHooksAfterThrow();
      resetCurrentFiber(); // TODO: I found and added this missing line while investigating a
      // separate issue. Write a regression test using string refs.

      ReactCurrentOwner$2.current = null;

      if (erroredWork === null || erroredWork.return === null) {
        // Expected to be working on a non-root fiber. This is a fatal error
        // because there's no ancestor that can handle it; the root is
        // supposed to capture all errors that weren't caught by an error
        // boundary.
        workInProgressRootExitStatus = RootFatalErrored;
        workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
        // sibling, or the parent if there are no siblings. But since the root
        // has no siblings nor a parent, we set it to null. Usually this is
        // handled by `completeUnitOfWork` or `unwindWork`, but since we're
        // intentionally not calling those, we need set it here.
        // TODO: Consider calling `unwindWork` to pop the contexts.

        workInProgress = null;
        return;
      }

      if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
        // Record the time spent rendering before an error was thrown. This
        // avoids inaccurate Profiler durations in the case of a
        // suspended render.
        stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
      }

      throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
      completeUnitOfWork(erroredWork);
    } catch (yetAnotherThrownValue) {
      // Something in the return path also threw.
      thrownValue = yetAnotherThrownValue;

      if (workInProgress === erroredWork && erroredWork !== null) {
        // If this boundary has already errored, then we had trouble processing
        // the error. Bubble it to the next boundary.
        erroredWork = erroredWork.return;
        workInProgress = erroredWork;
      } else {
        erroredWork = workInProgress;
      }

      continue;
    } // Return to the normal work loop.


    return;
  } while (true);
}

function pushDispatcher() {
  var prevDispatcher = ReactCurrentDispatcher$2.current;
  ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;

  if (prevDispatcher === null) {
    // The React isomorphic package does not include a default dispatcher.
    // Instead the first renderer will lazily attach one, in order to give
    // nicer error messages.
    return ContextOnlyDispatcher;
  } else {
    return prevDispatcher;
  }
}

function popDispatcher(prevDispatcher) {
  ReactCurrentDispatcher$2.current = prevDispatcher;
}

function pushInteractions(root) {
  {
    var prevInteractions = tracing.__interactionsRef.current;
    tracing.__interactionsRef.current = root.memoizedInteractions;
    return prevInteractions;
  }
}

function popInteractions(prevInteractions) {
  {
    tracing.__interactionsRef.current = prevInteractions;
  }
}

function markCommitTimeOfFallback() {
  globalMostRecentFallbackTime = now();
}
function markSkippedUpdateLanes(lane) {
  workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
}
function renderDidSuspend() {
  if (workInProgressRootExitStatus === RootIncomplete) {
    workInProgressRootExitStatus = RootSuspended;
  }
}
function renderDidSuspendDelayIfPossible() {
  if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
    workInProgressRootExitStatus = RootSuspendedWithDelay;
  } // Check if there are updates that we skipped tree that might have unblocked
  // this render.


  if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootUpdatedLanes))) {
    // Mark the current render as suspended so that we switch to working on
    // the updates that were skipped. Usually we only suspend at the end of
    // the render phase.
    // TODO: We should probably always mark the root as suspended immediately
    // (inside this function), since by suspending at the end of the render
    // phase introduces a potential mistake where we suspend lanes that were
    // pinged or updated while we were rendering.
    markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
  }
}
function renderDidError() {
  if (workInProgressRootExitStatus !== RootCompleted) {
    workInProgressRootExitStatus = RootErrored;
  }
} // Called during render to determine if anything has suspended.
// Returns false if we're not sure.

function renderHasNotSuspendedYet() {
  // If something errored or completed, we can't really be sure,
  // so those are false.
  return workInProgressRootExitStatus === RootIncomplete;
}

function renderRootSync(root, lanes) {
  var prevExecutionContext = executionContext;
  executionContext |= RenderContext;
  var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack
  // and prepare a fresh one. Otherwise we'll continue where we left off.

  if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {
    prepareFreshStack(root, lanes);
    startWorkOnPendingInteractions(root, lanes);
  }

  var prevInteractions = pushInteractions(root);

  do {
    try {
      workLoopSync();
      break;
    } catch (thrownValue) {
      handleError(root, thrownValue);
    }
  } while (true);

  resetContextDependencies();

  {
    popInteractions(prevInteractions);
  }

  executionContext = prevExecutionContext;
  popDispatcher(prevDispatcher);

  if (workInProgress !== null) {
    // This is a sync render, so we should have finished the whole tree.
    {
      {
        throw Error( "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." );
      }
    }
  }


  workInProgressRoot = null;
  workInProgressRootRenderLanes = NoLanes;
  return workInProgressRootExitStatus;
} // The work loop is an extremely hot path. Tell Closure not to inline it.

/** @noinline */


function workLoopSync() {
  // Already timed out, so perform work without checking if we need to yield.
  while (workInProgress !== null) {
    performUnitOfWork(workInProgress);
  }
}

function renderRootConcurrent(root, lanes) {
  var prevExecutionContext = executionContext;
  executionContext |= RenderContext;
  var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack
  // and prepare a fresh one. Otherwise we'll continue where we left off.

  if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {
    resetRenderTimer();
    prepareFreshStack(root, lanes);
    startWorkOnPendingInteractions(root, lanes);
  }

  var prevInteractions = pushInteractions(root);

  do {
    try {
      workLoopConcurrent();
      break;
    } catch (thrownValue) {
      handleError(root, thrownValue);
    }
  } while (true);

  resetContextDependencies();

  {
    popInteractions(prevInteractions);
  }

  popDispatcher(prevDispatcher);
  executionContext = prevExecutionContext;


  if (workInProgress !== null) {

    return RootIncomplete;
  } else {


    workInProgressRoot = null;
    workInProgressRootRenderLanes = NoLanes; // Return the final exit status.

    return workInProgressRootExitStatus;
  }
}
/** @noinline */


function workLoopConcurrent() {
  // Perform work until Scheduler asks us to yield
  while (workInProgress !== null && !shouldYield()) {
    performUnitOfWork(workInProgress);
  }
}

function performUnitOfWork(unitOfWork) {
  // The current, flushed, state of this fiber is the alternate. Ideally
  // nothing should rely on this, but relying on it here means that we don't
  // need an additional field on the work in progress.
  var current = unitOfWork.alternate;
  setCurrentFiber(unitOfWork);
  var next;

  if ( (unitOfWork.mode & ProfileMode) !== NoMode) {
    startProfilerTimer(unitOfWork);
    next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
    stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
  } else {
    next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
  }

  resetCurrentFiber();
  unitOfWork.memoizedProps = unitOfWork.pendingProps;

  if (next === null) {
    // If this doesn't spawn new work, complete the current work.
    completeUnitOfWork(unitOfWork);
  } else {
    workInProgress = next;
  }

  ReactCurrentOwner$2.current = null;
}

function completeUnitOfWork(unitOfWork) {
  // Attempt to complete the current unit of work, then move to the next
  // sibling. If there are no more siblings, return to the parent fiber.
  var completedWork = unitOfWork;

  do {
    // The current, flushed, state of this fiber is the alternate. Ideally
    // nothing should rely on this, but relying on it here means that we don't
    // need an additional field on the work in progress.
    var current = completedWork.alternate;
    var returnFiber = completedWork.return; // Check if the work completed or if something threw.

    if ((completedWork.flags & Incomplete) === NoFlags) {
      setCurrentFiber(completedWork);
      var next = void 0;

      if ( (completedWork.mode & ProfileMode) === NoMode) {
        next = completeWork(current, completedWork, subtreeRenderLanes);
      } else {
        startProfilerTimer(completedWork);
        next = completeWork(current, completedWork, subtreeRenderLanes); // Update render duration assuming we didn't error.

        stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
      }

      resetCurrentFiber();

      if (next !== null) {
        // Completing this fiber spawned new work. Work on that next.
        workInProgress = next;
        return;
      }

      resetChildLanes(completedWork);

      if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete
      (returnFiber.flags & Incomplete) === NoFlags) {
        // Append all the effects of the subtree and this fiber onto the effect
        // list of the parent. The completion order of the children affects the
        // side-effect order.
        if (returnFiber.firstEffect === null) {
          returnFiber.firstEffect = completedWork.firstEffect;
        }

        if (completedWork.lastEffect !== null) {
          if (returnFiber.lastEffect !== null) {
            returnFiber.lastEffect.nextEffect = completedWork.firstEffect;
          }

          returnFiber.lastEffect = completedWork.lastEffect;
        } // If this fiber had side-effects, we append it AFTER the children's
        // side-effects. We can perform certain side-effects earlier if needed,
        // by doing multiple passes over the effect list. We don't want to
        // schedule our own side-effect on our own list because if end up
        // reusing children we'll schedule this effect onto itself since we're
        // at the end.


        var flags = completedWork.flags; // Skip both NoWork and PerformedWork tags when creating the effect
        // list. PerformedWork effect is read by React DevTools but shouldn't be
        // committed.

        if (flags > PerformedWork) {
          if (returnFiber.lastEffect !== null) {
            returnFiber.lastEffect.nextEffect = completedWork;
          } else {
            returnFiber.firstEffect = completedWork;
          }

          returnFiber.lastEffect = completedWork;
        }
      }
    } else {
      // This fiber did not complete because something threw. Pop values off
      // the stack without entering the complete phase. If this is a boundary,
      // capture values if possible.
      var _next = unwindWork(completedWork); // Because this fiber did not complete, don't reset its expiration time.


      if (_next !== null) {
        // If completing this work spawned new work, do that next. We'll come
        // back here again.
        // Since we're restarting, remove anything that is not a host effect
        // from the effect tag.
        _next.flags &= HostEffectMask;
        workInProgress = _next;
        return;
      }

      if ( (completedWork.mode & ProfileMode) !== NoMode) {
        // Record the render duration for the fiber that errored.
        stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); // Include the time spent working on failed children before continuing.

        var actualDuration = completedWork.actualDuration;
        var child = completedWork.child;

        while (child !== null) {
          actualDuration += child.actualDuration;
          child = child.sibling;
        }

        completedWork.actualDuration = actualDuration;
      }

      if (returnFiber !== null) {
        // Mark the parent fiber as incomplete and clear its effect list.
        returnFiber.firstEffect = returnFiber.lastEffect = null;
        returnFiber.flags |= Incomplete;
      }
    }

    var siblingFiber = completedWork.sibling;

    if (siblingFiber !== null) {
      // If there is more work to do in this returnFiber, do that next.
      workInProgress = siblingFiber;
      return;
    } // Otherwise, return to the parent


    completedWork = returnFiber; // Update the next thing we're working on in case something throws.

    workInProgress = completedWork;
  } while (completedWork !== null); // We've reached the root.


  if (workInProgressRootExitStatus === RootIncomplete) {
    workInProgressRootExitStatus = RootCompleted;
  }
}

function resetChildLanes(completedWork) {
  if ( // TODO: Move this check out of the hot path by moving `resetChildLanes`
  // to switch statement in `completeWork`.
  (completedWork.tag === LegacyHiddenComponent || completedWork.tag === OffscreenComponent) && completedWork.memoizedState !== null && !includesSomeLane(subtreeRenderLanes, OffscreenLane) && (completedWork.mode & ConcurrentMode) !== NoLanes) {
    // The children of this component are hidden. Don't bubble their
    // expiration times.
    return;
  }

  var newChildLanes = NoLanes; // Bubble up the earliest expiration time.

  if ( (completedWork.mode & ProfileMode) !== NoMode) {
    // In profiling mode, resetChildExpirationTime is also used to reset
    // profiler durations.
    var actualDuration = completedWork.actualDuration;
    var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will
    // only be updated if work is done on the fiber (i.e. it doesn't bailout).
    // When work is done, it should bubble to the parent's actualDuration. If
    // the fiber has not been cloned though, (meaning no work was done), then
    // this value will reflect the amount of time spent working on a previous
    // render. In that case it should not bubble. We determine whether it was
    // cloned by comparing the child pointer.

    var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
    var child = completedWork.child;

    while (child !== null) {
      newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));

      if (shouldBubbleActualDurations) {
        actualDuration += child.actualDuration;
      }

      treeBaseDuration += child.treeBaseDuration;
      child = child.sibling;
    }

    var isTimedOutSuspense = completedWork.tag === SuspenseComponent && completedWork.memoizedState !== null;

    if (isTimedOutSuspense) {
      // Don't count time spent in a timed out Suspense subtree as part of the base duration.
      var primaryChildFragment = completedWork.child;

      if (primaryChildFragment !== null) {
        treeBaseDuration -= primaryChildFragment.treeBaseDuration;
      }
    }

    completedWork.actualDuration = actualDuration;
    completedWork.treeBaseDuration = treeBaseDuration;
  } else {
    var _child = completedWork.child;

    while (_child !== null) {
      newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
      _child = _child.sibling;
    }
  }

  completedWork.childLanes = newChildLanes;
}

function commitRoot(root) {
  var renderPriorityLevel = getCurrentPriorityLevel();
  runWithPriority$1(ImmediatePriority$1, commitRootImpl.bind(null, root, renderPriorityLevel));
  return null;
}

function commitRootImpl(root, renderPriorityLevel) {
  do {
    // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which
    // means `flushPassiveEffects` will sometimes result in additional
    // passive effects. So we need to keep flushing in a loop until there are
    // no more pending effects.
    // TODO: Might be better if `flushPassiveEffects` did not automatically
    // flush synchronous work at the end, to avoid factoring hazards like this.
    flushPassiveEffects();
  } while (rootWithPendingPassiveEffects !== null);

  flushRenderPhaseStrictModeWarningsInDEV();

  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
    {
      throw Error( "Should not already be working." );
    }
  }

  var finishedWork = root.finishedWork;
  var lanes = root.finishedLanes;

  if (finishedWork === null) {

    return null;
  }

  root.finishedWork = null;
  root.finishedLanes = NoLanes;

  if (!(finishedWork !== root.current)) {
    {
      throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." );
    }
  } // commitRoot never returns a continuation; it always finishes synchronously.
  // So we can clear these now to allow a new callback to be scheduled.


  root.callbackNode = null; // Update the first and last pending times on this root. The new first
  // pending time is whatever is left on the root fiber.

  var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
  markRootFinished(root, remainingLanes); // Clear already finished discrete updates in case that a later call of
  // `flushDiscreteUpdates` starts a useless render pass which may cancels
  // a scheduled timeout.

  if (rootsWithPendingDiscreteUpdates !== null) {
    if (!hasDiscreteLanes(remainingLanes) && rootsWithPendingDiscreteUpdates.has(root)) {
      rootsWithPendingDiscreteUpdates.delete(root);
    }
  }

  if (root === workInProgressRoot) {
    // We can reset these now that they are finished.
    workInProgressRoot = null;
    workInProgress = null;
    workInProgressRootRenderLanes = NoLanes;
  } // Get the list of effects.


  var firstEffect;

  if (finishedWork.flags > PerformedWork) {
    // A fiber's effect list consists only of its children, not itself. So if
    // the root has an effect, we need to add it to the end of the list. The
    // resulting list is the set that would belong to the root's parent, if it
    // had one; that is, all the effects in the tree including the root.
    if (finishedWork.lastEffect !== null) {
      finishedWork.lastEffect.nextEffect = finishedWork;
      firstEffect = finishedWork.firstEffect;
    } else {
      firstEffect = finishedWork;
    }
  } else {
    // There is no effect on the root.
    firstEffect = finishedWork.firstEffect;
  }

  if (firstEffect !== null) {

    var prevExecutionContext = executionContext;
    executionContext |= CommitContext;
    var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles

    ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass
    // of the effect list for each phase: all mutation effects come before all
    // layout effects, and so on.
    // The first phase a "before mutation" phase. We use this phase to read the
    // state of the host tree right before we mutate it. This is where
    // getSnapshotBeforeUpdate is called.

    focusedInstanceHandle = prepareForCommit(root.containerInfo);
    shouldFireAfterActiveInstanceBlur = false;
    nextEffect = firstEffect;

    do {
      {
        invokeGuardedCallback(null, commitBeforeMutationEffects, null);

        if (hasCaughtError()) {
          if (!(nextEffect !== null)) {
            {
              throw Error( "Should be working on an effect." );
            }
          }

          var error = clearCaughtError();
          captureCommitPhaseError(nextEffect, error);
          nextEffect = nextEffect.nextEffect;
        }
      }
    } while (nextEffect !== null); // We no longer need to track the active instance fiber


    focusedInstanceHandle = null;

    {
      // Mark the current commit time to be shared by all Profilers in this
      // batch. This enables them to be grouped later.
      recordCommitTime();
    } // The next phase is the mutation phase, where we mutate the host tree.


    nextEffect = firstEffect;

    do {
      {
        invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);

        if (hasCaughtError()) {
          if (!(nextEffect !== null)) {
            {
              throw Error( "Should be working on an effect." );
            }
          }

          var _error = clearCaughtError();

          captureCommitPhaseError(nextEffect, _error);
          nextEffect = nextEffect.nextEffect;
        }
      }
    } while (nextEffect !== null);

    resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after
    // the mutation phase, so that the previous tree is still current during
    // componentWillUnmount, but before the layout phase, so that the finished
    // work is current during componentDidMount/Update.

    root.current = finishedWork; // The next phase is the layout phase, where we call effects that read
    // the host tree after it's been mutated. The idiomatic use case for this is
    // layout, but class component lifecycles also fire here for legacy reasons.

    nextEffect = firstEffect;

    do {
      {
        invokeGuardedCallback(null, commitLayoutEffects, null, root, lanes);

        if (hasCaughtError()) {
          if (!(nextEffect !== null)) {
            {
              throw Error( "Should be working on an effect." );
            }
          }

          var _error2 = clearCaughtError();

          captureCommitPhaseError(nextEffect, _error2);
          nextEffect = nextEffect.nextEffect;
        }
      }
    } while (nextEffect !== null);

    nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an
    // opportunity to paint.

    requestPaint();

    {
      popInteractions(prevInteractions);
    }

    executionContext = prevExecutionContext;
  } else {
    // No effects.
    root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were
    // no effects.
    // TODO: Maybe there's a better way to report this.

    {
      recordCommitTime();
    }
  }

  var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;

  if (rootDoesHavePassiveEffects) {
    // This commit has passive effects. Stash a reference to them. But don't
    // schedule a callback until after flushing layout work.
    rootDoesHavePassiveEffects = false;
    rootWithPendingPassiveEffects = root;
    pendingPassiveEffectsLanes = lanes;
    pendingPassiveEffectsRenderPriority = renderPriorityLevel;
  } else {
    // We are done with the effect chain at this point so let's clear the
    // nextEffect pointers to assist with GC. If we have passive effects, we'll
    // clear this in flushPassiveEffects.
    nextEffect = firstEffect;

    while (nextEffect !== null) {
      var nextNextEffect = nextEffect.nextEffect;
      nextEffect.nextEffect = null;

      if (nextEffect.flags & Deletion) {
        detachFiberAfterEffects(nextEffect);
      }

      nextEffect = nextNextEffect;
    }
  } // Read this again, since an effect might have updated it


  remainingLanes = root.pendingLanes; // Check if there's remaining work on this root

  if (remainingLanes !== NoLanes) {
    {
      if (spawnedWorkDuringRender !== null) {
        var expirationTimes = spawnedWorkDuringRender;
        spawnedWorkDuringRender = null;

        for (var i = 0; i < expirationTimes.length; i++) {
          scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);
        }
      }

      schedulePendingInteractions(root, remainingLanes);
    }
  } else {
    // If there's no remaining work, we can clear the set of already failed
    // error boundaries.
    legacyErrorBoundariesThatAlreadyFailed = null;
  }

  {
    if (!rootDidHavePassiveEffects) {
      // If there are no passive effects, then we can complete the pending interactions.
      // Otherwise, we'll wait until after the passive effects are flushed.
      // Wait to do this until after remaining work has been scheduled,
      // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.
      finishPendingInteractions(root, lanes);
    }
  }

  if (remainingLanes === SyncLane) {
    // Count the number of times the root synchronously re-renders without
    // finishing. If there are too many, it indicates an infinite update loop.
    if (root === rootWithNestedUpdates) {
      nestedUpdateCount++;
    } else {
      nestedUpdateCount = 0;
      rootWithNestedUpdates = root;
    }
  } else {
    nestedUpdateCount = 0;
  }

  onCommitRoot(finishedWork.stateNode, renderPriorityLevel);

  {
    onCommitRoot$1();
  } // Always call this before exiting `commitRoot`, to ensure that any
  // additional work on this root is scheduled.


  ensureRootIsScheduled(root, now());

  if (hasUncaughtError) {
    hasUncaughtError = false;
    var _error3 = firstUncaughtError;
    firstUncaughtError = null;
    throw _error3;
  }

  if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
    // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired
    // synchronously, but layout updates should be deferred until the end
    // of the batch.


    return null;
  } // If layout work was scheduled, flush it now.


  flushSyncCallbackQueue();

  return null;
}

function commitBeforeMutationEffects() {
  while (nextEffect !== null) {
    var current = nextEffect.alternate;

    if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {
      if ((nextEffect.flags & Deletion) !== NoFlags) {
        if (doesFiberContain(nextEffect, focusedInstanceHandle)) {
          shouldFireAfterActiveInstanceBlur = true;
        }
      } else {
        // TODO: Move this out of the hot path using a dedicated effect tag.
        if (nextEffect.tag === SuspenseComponent && isSuspenseBoundaryBeingHidden(current, nextEffect) && doesFiberContain(nextEffect, focusedInstanceHandle)) {
          shouldFireAfterActiveInstanceBlur = true;
        }
      }
    }

    var flags = nextEffect.flags;

    if ((flags & Snapshot) !== NoFlags) {
      setCurrentFiber(nextEffect);
      commitBeforeMutationLifeCycles(current, nextEffect);
      resetCurrentFiber();
    }

    if ((flags & Passive) !== NoFlags) {
      // If there are passive effects, schedule a callback to flush at
      // the earliest opportunity.
      if (!rootDoesHavePassiveEffects) {
        rootDoesHavePassiveEffects = true;
        scheduleCallback(NormalPriority$1, function () {
          flushPassiveEffects();
          return null;
        });
      }
    }

    nextEffect = nextEffect.nextEffect;
  }
}

function commitMutationEffects(root, renderPriorityLevel) {
  // TODO: Should probably move the bulk of this function to commitWork.
  while (nextEffect !== null) {
    setCurrentFiber(nextEffect);
    var flags = nextEffect.flags;

    if (flags & ContentReset) {
      commitResetTextContent(nextEffect);
    }

    if (flags & Ref) {
      var current = nextEffect.alternate;

      if (current !== null) {
        commitDetachRef(current);
      }
    } // The following switch statement is only concerned about placement,
    // updates, and deletions. To avoid needing to add a case for every possible
    // bitmap value, we remove the secondary effects from the effect tag and
    // switch on that value.


    var primaryFlags = flags & (Placement | Update | Deletion | Hydrating);

    switch (primaryFlags) {
      case Placement:
        {
          commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
          // inserted, before any life-cycles like componentDidMount gets called.
          // TODO: findDOMNode doesn't rely on this any more but isMounted does
          // and isMounted is deprecated anyway so we should be able to kill this.

          nextEffect.flags &= ~Placement;
          break;
        }

      case PlacementAndUpdate:
        {
          // Placement
          commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
          // inserted, before any life-cycles like componentDidMount gets called.

          nextEffect.flags &= ~Placement; // Update

          var _current = nextEffect.alternate;
          commitWork(_current, nextEffect);
          break;
        }

      case Hydrating:
        {
          nextEffect.flags &= ~Hydrating;
          break;
        }

      case HydratingAndUpdate:
        {
          nextEffect.flags &= ~Hydrating; // Update

          var _current2 = nextEffect.alternate;
          commitWork(_current2, nextEffect);
          break;
        }

      case Update:
        {
          var _current3 = nextEffect.alternate;
          commitWork(_current3, nextEffect);
          break;
        }

      case Deletion:
        {
          commitDeletion(root, nextEffect);
          break;
        }
    }

    resetCurrentFiber();
    nextEffect = nextEffect.nextEffect;
  }
}

function commitLayoutEffects(root, committedLanes) {


  while (nextEffect !== null) {
    setCurrentFiber(nextEffect);
    var flags = nextEffect.flags;

    if (flags & (Update | Callback)) {
      var current = nextEffect.alternate;
      commitLifeCycles(root, current, nextEffect);
    }

    {
      if (flags & Ref) {
        commitAttachRef(nextEffect);
      }
    }

    resetCurrentFiber();
    nextEffect = nextEffect.nextEffect;
  }
}

function flushPassiveEffects() {
  // Returns whether passive effects were flushed.
  if (pendingPassiveEffectsRenderPriority !== NoPriority$1) {
    var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority$1 ? NormalPriority$1 : pendingPassiveEffectsRenderPriority;
    pendingPassiveEffectsRenderPriority = NoPriority$1;

    {
      return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);
    }
  }

  return false;
}
function enqueuePendingPassiveHookEffectMount(fiber, effect) {
  pendingPassiveHookEffectsMount.push(effect, fiber);

  if (!rootDoesHavePassiveEffects) {
    rootDoesHavePassiveEffects = true;
    scheduleCallback(NormalPriority$1, function () {
      flushPassiveEffects();
      return null;
    });
  }
}
function enqueuePendingPassiveHookEffectUnmount(fiber, effect) {
  pendingPassiveHookEffectsUnmount.push(effect, fiber);

  {
    fiber.flags |= PassiveUnmountPendingDev;
    var alternate = fiber.alternate;

    if (alternate !== null) {
      alternate.flags |= PassiveUnmountPendingDev;
    }
  }

  if (!rootDoesHavePassiveEffects) {
    rootDoesHavePassiveEffects = true;
    scheduleCallback(NormalPriority$1, function () {
      flushPassiveEffects();
      return null;
    });
  }
}

function invokePassiveEffectCreate(effect) {
  var create = effect.create;
  effect.destroy = create();
}

function flushPassiveEffectsImpl() {
  if (rootWithPendingPassiveEffects === null) {
    return false;
  }

  var root = rootWithPendingPassiveEffects;
  var lanes = pendingPassiveEffectsLanes;
  rootWithPendingPassiveEffects = null;
  pendingPassiveEffectsLanes = NoLanes;

  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
    {
      throw Error( "Cannot flush passive effects while already rendering." );
    }
  }

  {
    isFlushingPassiveEffects = true;
  }

  var prevExecutionContext = executionContext;
  executionContext |= CommitContext;
  var prevInteractions = pushInteractions(root); // It's important that ALL pending passive effect destroy functions are called
  // before ANY passive effect create functions are called.
  // Otherwise effects in sibling components might interfere with each other.
  // e.g. a destroy function in one component may unintentionally override a ref
  // value set by a create function in another component.
  // Layout effects have the same constraint.
  // First pass: Destroy stale passive effects.

  var unmountEffects = pendingPassiveHookEffectsUnmount;
  pendingPassiveHookEffectsUnmount = [];

  for (var i = 0; i < unmountEffects.length; i += 2) {
    var _effect = unmountEffects[i];
    var fiber = unmountEffects[i + 1];
    var destroy = _effect.destroy;
    _effect.destroy = undefined;

    {
      fiber.flags &= ~PassiveUnmountPendingDev;
      var alternate = fiber.alternate;

      if (alternate !== null) {
        alternate.flags &= ~PassiveUnmountPendingDev;
      }
    }

    if (typeof destroy === 'function') {
      {
        setCurrentFiber(fiber);

        {
          invokeGuardedCallback(null, destroy, null);
        }

        if (hasCaughtError()) {
          if (!(fiber !== null)) {
            {
              throw Error( "Should be working on an effect." );
            }
          }

          var error = clearCaughtError();
          captureCommitPhaseError(fiber, error);
        }

        resetCurrentFiber();
      }
    }
  } // Second pass: Create new passive effects.


  var mountEffects = pendingPassiveHookEffectsMount;
  pendingPassiveHookEffectsMount = [];

  for (var _i = 0; _i < mountEffects.length; _i += 2) {
    var _effect2 = mountEffects[_i];
    var _fiber = mountEffects[_i + 1];

    {
      setCurrentFiber(_fiber);

      {
        invokeGuardedCallback(null, invokePassiveEffectCreate, null, _effect2);
      }

      if (hasCaughtError()) {
        if (!(_fiber !== null)) {
          {
            throw Error( "Should be working on an effect." );
          }
        }

        var _error4 = clearCaughtError();

        captureCommitPhaseError(_fiber, _error4);
      }

      resetCurrentFiber();
    }
  } // Note: This currently assumes there are no passive effects on the root fiber
  // because the root is not part of its own effect list.
  // This could change in the future.


  var effect = root.current.firstEffect;

  while (effect !== null) {
    var nextNextEffect = effect.nextEffect; // Remove nextEffect pointer to assist GC

    effect.nextEffect = null;

    if (effect.flags & Deletion) {
      detachFiberAfterEffects(effect);
    }

    effect = nextNextEffect;
  }

  {
    popInteractions(prevInteractions);
    finishPendingInteractions(root, lanes);
  }

  {
    isFlushingPassiveEffects = false;
  }

  executionContext = prevExecutionContext;
  flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this
  // exceeds the limit, we'll fire a warning.

  nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
  return true;
}

function isAlreadyFailedLegacyErrorBoundary(instance) {
  return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
}
function markLegacyErrorBoundaryAsFailed(instance) {
  if (legacyErrorBoundariesThatAlreadyFailed === null) {
    legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
  } else {
    legacyErrorBoundariesThatAlreadyFailed.add(instance);
  }
}

function prepareToThrowUncaughtError(error) {
  if (!hasUncaughtError) {
    hasUncaughtError = true;
    firstUncaughtError = error;
  }
}

var onUncaughtError = prepareToThrowUncaughtError;

function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
  var errorInfo = createCapturedValue(error, sourceFiber);
  var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
  enqueueUpdate(rootFiber, update);
  var eventTime = requestEventTime();
  var root = markUpdateLaneFromFiberToRoot(rootFiber, SyncLane);

  if (root !== null) {
    markRootUpdated(root, SyncLane, eventTime);
    ensureRootIsScheduled(root, eventTime);
    schedulePendingInteractions(root, SyncLane);
  }
}

function captureCommitPhaseError(sourceFiber, error) {
  if (sourceFiber.tag === HostRoot) {
    // Error was thrown at the root. There is no parent, so the root
    // itself should capture it.
    captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
    return;
  }

  var fiber = sourceFiber.return;

  while (fiber !== null) {
    if (fiber.tag === HostRoot) {
      captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
      return;
    } else if (fiber.tag === ClassComponent) {
      var ctor = fiber.type;
      var instance = fiber.stateNode;

      if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
        var errorInfo = createCapturedValue(error, sourceFiber);
        var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
        enqueueUpdate(fiber, update);
        var eventTime = requestEventTime();
        var root = markUpdateLaneFromFiberToRoot(fiber, SyncLane);

        if (root !== null) {
          markRootUpdated(root, SyncLane, eventTime);
          ensureRootIsScheduled(root, eventTime);
          schedulePendingInteractions(root, SyncLane);
        } else {
          // This component has already been unmounted.
          // We can't schedule any follow up work for the root because the fiber is already unmounted,
          // but we can still call the log-only boundary so the error isn't swallowed.
          //
          // TODO This is only a temporary bandaid for the old reconciler fork.
          // We can delete this special case once the new fork is merged.
          if (typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
            try {
              instance.componentDidCatch(error, errorInfo);
            } catch (errorToIgnore) {// TODO Ignore this error? Rethrow it?
              // This is kind of an edge case.
            }
          }
        }

        return;
      }
    }

    fiber = fiber.return;
  }
}
function pingSuspendedRoot(root, wakeable, pingedLanes) {
  var pingCache = root.pingCache;

  if (pingCache !== null) {
    // The wakeable resolved, so we no longer need to memoize, because it will
    // never be thrown again.
    pingCache.delete(wakeable);
  }

  var eventTime = requestEventTime();
  markRootPinged(root, pingedLanes);

  if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
    // Received a ping at the same priority level at which we're currently
    // rendering. We might want to restart this render. This should mirror
    // the logic of whether or not a root suspends once it completes.
    // TODO: If we're rendering sync either due to Sync, Batched or expired,
    // we should probably never restart.
    // If we're suspended with delay, or if it's a retry, we'll always suspend
    // so we can always restart.
    if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
      // Restart from the root.
      prepareFreshStack(root, NoLanes);
    } else {
      // Even though we can't restart right now, we might get an
      // opportunity later. So we mark this render as having a ping.
      workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
    }
  }

  ensureRootIsScheduled(root, eventTime);
  schedulePendingInteractions(root, pingedLanes);
}

function retryTimedOutBoundary(boundaryFiber, retryLane) {
  // The boundary fiber (a Suspense component or SuspenseList component)
  // previously was rendered in its fallback state. One of the promises that
  // suspended it has resolved, which means at least part of the tree was
  // likely unblocked. Try rendering again, at a new expiration time.
  if (retryLane === NoLane) {
    retryLane = requestRetryLane(boundaryFiber);
  } // TODO: Special case idle priority?


  var eventTime = requestEventTime();
  var root = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane);

  if (root !== null) {
    markRootUpdated(root, retryLane, eventTime);
    ensureRootIsScheduled(root, eventTime);
    schedulePendingInteractions(root, retryLane);
  }
}
function resolveRetryWakeable(boundaryFiber, wakeable) {
  var retryLane = NoLane; // Default

  var retryCache;

  {
    retryCache = boundaryFiber.stateNode;
  }

  if (retryCache !== null) {
    // The wakeable resolved, so we no longer need to memoize, because it will
    // never be thrown again.
    retryCache.delete(wakeable);
  }

  retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.

function jnd(timeElapsed) {
  return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
}

function checkForNestedUpdates() {
  if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
    nestedUpdateCount = 0;
    rootWithNestedUpdates = null;

    {
      {
        throw Error( "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." );
      }
    }
  }

  {
    if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
      nestedPassiveUpdateCount = 0;

      error('Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');
    }
  }
}

function flushRenderPhaseStrictModeWarningsInDEV() {
  {
    ReactStrictModeWarnings.flushLegacyContextWarning();

    {
      ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
    }
  }
}

var didWarnStateUpdateForNotYetMountedComponent = null;

function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
  {
    if ((executionContext & RenderContext) !== NoContext) {
      // We let the other warning about render phase updates deal with this one.
      return;
    }

    if (!(fiber.mode & (BlockingMode | ConcurrentMode))) {
      return;
    }

    var tag = fiber.tag;

    if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
      // Only warn for user-defined components, not internal ones like Suspense.
      return;
    } // We show the whole stack but dedupe on the top component's name because
    // the problematic code almost always lies inside that component.


    var componentName = getComponentName(fiber.type) || 'ReactComponent';

    if (didWarnStateUpdateForNotYetMountedComponent !== null) {
      if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
        return;
      }

      didWarnStateUpdateForNotYetMountedComponent.add(componentName);
    } else {
      didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]);
    }

    var previousFiber = current;

    try {
      setCurrentFiber(fiber);

      error("Can't perform a React state update on a component that hasn't mounted yet. " + 'This indicates that you have a side-effect in your render function that ' + 'asynchronously later calls tries to update the component. Move this work to ' + 'useEffect instead.');
    } finally {
      if (previousFiber) {
        setCurrentFiber(fiber);
      } else {
        resetCurrentFiber();
      }
    }
  }
}

var didWarnStateUpdateForUnmountedComponent = null;

function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
  {
    var tag = fiber.tag;

    if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
      // Only warn for user-defined components, not internal ones like Suspense.
      return;
    } // If there are pending passive effects unmounts for this Fiber,
    // we can assume that they would have prevented this update.


    if ((fiber.flags & PassiveUnmountPendingDev) !== NoFlags) {
      return;
    } // We show the whole stack but dedupe on the top component's name because
    // the problematic code almost always lies inside that component.


    var componentName = getComponentName(fiber.type) || 'ReactComponent';

    if (didWarnStateUpdateForUnmountedComponent !== null) {
      if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
        return;
      }

      didWarnStateUpdateForUnmountedComponent.add(componentName);
    } else {
      didWarnStateUpdateForUnmountedComponent = new Set([componentName]);
    }

    if (isFlushingPassiveEffects) ; else {
      var previousFiber = current;

      try {
        setCurrentFiber(fiber);

        error("Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function');
      } finally {
        if (previousFiber) {
          setCurrentFiber(fiber);
        } else {
          resetCurrentFiber();
        }
      }
    }
  }
}

var beginWork$1;

{
  var dummyFiber = null;

  beginWork$1 = function (current, unitOfWork, lanes) {
    // If a component throws an error, we replay it again in a synchronously
    // dispatched event, so that the debugger will treat it as an uncaught
    // error See ReactErrorUtils for more information.
    // Before entering the begin phase, copy the work-in-progress onto a dummy
    // fiber. If beginWork throws, we'll use this to reset the state.
    var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);

    try {
      return beginWork(current, unitOfWork, lanes);
    } catch (originalError) {
      if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {
        // Don't replay promises. Treat everything else like an error.
        throw originalError;
      } // Keep this code in sync with handleError; any changes here must have
      // corresponding changes there.


      resetContextDependencies();
      resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the
      // same fiber again.
      // Unwind the failed stack frame

      unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber.

      assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);

      if ( unitOfWork.mode & ProfileMode) {
        // Reset the profiler timer.
        startProfilerTimer(unitOfWork);
      } // Run beginWork again.


      invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes);

      if (hasCaughtError()) {
        var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.
        // Rethrow this error instead of the original one.

        throw replayError;
      } else {
        // This branch is reachable if the render phase is impure.
        throw originalError;
      }
    }
  };
}

var didWarnAboutUpdateInRender = false;
var didWarnAboutUpdateInRenderForAnotherComponent;

{
  didWarnAboutUpdateInRenderForAnotherComponent = new Set();
}

function warnAboutRenderPhaseUpdatesInDEV(fiber) {
  {
    if (isRendering && (executionContext & RenderContext) !== NoContext && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
      switch (fiber.tag) {
        case FunctionComponent:
        case ForwardRef:
        case SimpleMemoComponent:
          {
            var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.

            var dedupeKey = renderingComponentName;

            if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
              didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
              var setStateComponentName = getComponentName(fiber.type) || 'Unknown';

              error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://reactjs.org/link/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);
            }

            break;
          }

        case ClassComponent:
          {
            if (!didWarnAboutUpdateInRender) {
              error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');

              didWarnAboutUpdateInRender = true;
            }

            break;
          }
      }
    }
  }
} // a 'shared' variable that changes when act() opens/closes in tests.


var IsThisRendererActing = {
  current: false
};
function warnIfNotScopedWithMatchingAct(fiber) {
  {
    if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
      var previousFiber = current;

      try {
        setCurrentFiber(fiber);

        error("It looks like you're using the wrong act() around your test interactions.\n" + 'Be sure to use the matching version of act() corresponding to your renderer:\n\n' + '// for react-dom:\n' + // Break up imports to avoid accidentally parsing them as dependencies.
        'import {act} fr' + "om 'react-dom/test-utils';\n" + '// ...\n' + 'act(() => ...);\n\n' + '// for react-test-renderer:\n' + // Break up imports to avoid accidentally parsing them as dependencies.
        'import TestRenderer fr' + "om react-test-renderer';\n" + 'const {act} = TestRenderer;\n' + '// ...\n' + 'act(() => ...);');
      } finally {
        if (previousFiber) {
          setCurrentFiber(fiber);
        } else {
          resetCurrentFiber();
        }
      }
    }
  }
}
function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
  {
    if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
      error('An update to %s ran an effect, but was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + '  /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act', getComponentName(fiber.type));
    }
  }
}

function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
  {
    if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
      var previousFiber = current;

      try {
        setCurrentFiber(fiber);

        error('An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + '  /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act', getComponentName(fiber.type));
      } finally {
        if (previousFiber) {
          setCurrentFiber(fiber);
        } else {
          resetCurrentFiber();
        }
      }
    }
  }
}

var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler.

var didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked
// scheduler is the actual recommendation. The alternative could be a testing build,
// a new lib, or whatever; we dunno just yet. This message is for early adopters
// to get their tests right.

function warnIfUnmockedScheduler(fiber) {
  {
    if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {
      if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
        didWarnAboutUnmockedScheduler = true;

        error('In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + // Break up requires to avoid accidentally parsing them as dependencies.
        "jest.mock('scheduler', () => require" + "('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://reactjs.org/link/mock-scheduler');
      }
    }
  }
}

function computeThreadID(root, lane) {
  // Interaction threads are unique per root and expiration time.
  // NOTE: Intentionally unsound cast. All that matters is that it's a number
  // and it represents a batch of work. Could make a helper function instead,
  // but meh this is fine for now.
  return lane * 1000 + root.interactionThreadID;
}

function markSpawnedWork(lane) {

  if (spawnedWorkDuringRender === null) {
    spawnedWorkDuringRender = [lane];
  } else {
    spawnedWorkDuringRender.push(lane);
  }
}

function scheduleInteractions(root, lane, interactions) {

  if (interactions.size > 0) {
    var pendingInteractionMap = root.pendingInteractionMap;
    var pendingInteractions = pendingInteractionMap.get(lane);

    if (pendingInteractions != null) {
      interactions.forEach(function (interaction) {
        if (!pendingInteractions.has(interaction)) {
          // Update the pending async work count for previously unscheduled interaction.
          interaction.__count++;
        }

        pendingInteractions.add(interaction);
      });
    } else {
      pendingInteractionMap.set(lane, new Set(interactions)); // Update the pending async work count for the current interactions.

      interactions.forEach(function (interaction) {
        interaction.__count++;
      });
    }

    var subscriber = tracing.__subscriberRef.current;

    if (subscriber !== null) {
      var threadID = computeThreadID(root, lane);
      subscriber.onWorkScheduled(interactions, threadID);
    }
  }
}

function schedulePendingInteractions(root, lane) {

  scheduleInteractions(root, lane, tracing.__interactionsRef.current);
}

function startWorkOnPendingInteractions(root, lanes) {
  // we can accurately attribute time spent working on it, And so that cascading
  // work triggered during the render phase will be associated with it.


  var interactions = new Set();
  root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledLane) {
    if (includesSomeLane(lanes, scheduledLane)) {
      scheduledInteractions.forEach(function (interaction) {
        return interactions.add(interaction);
      });
    }
  }); // Store the current set of interactions on the FiberRoot for a few reasons:
  // We can re-use it in hot functions like performConcurrentWorkOnRoot()
  // without having to recalculate it. We will also use it in commitWork() to
  // pass to any Profiler onRender() hooks. This also provides DevTools with a
  // way to access it when the onCommitRoot() hook is called.

  root.memoizedInteractions = interactions;

  if (interactions.size > 0) {
    var subscriber = tracing.__subscriberRef.current;

    if (subscriber !== null) {
      var threadID = computeThreadID(root, lanes);

      try {
        subscriber.onWorkStarted(interactions, threadID);
      } catch (error) {
        // If the subscriber throws, rethrow it in a separate task
        scheduleCallback(ImmediatePriority$1, function () {
          throw error;
        });
      }
    }
  }
}

function finishPendingInteractions(root, committedLanes) {

  var remainingLanesAfterCommit = root.pendingLanes;
  var subscriber;

  try {
    subscriber = tracing.__subscriberRef.current;

    if (subscriber !== null && root.memoizedInteractions.size > 0) {
      // FIXME: More than one lane can finish in a single commit.
      var threadID = computeThreadID(root, committedLanes);
      subscriber.onWorkStopped(root.memoizedInteractions, threadID);
    }
  } catch (error) {
    // If the subscriber throws, rethrow it in a separate task
    scheduleCallback(ImmediatePriority$1, function () {
      throw error;
    });
  } finally {
    // Clear completed interactions from the pending Map.
    // Unless the render was suspended or cascading work was scheduled,
    // In which case– leave pending interactions until the subsequent render.
    var pendingInteractionMap = root.pendingInteractionMap;
    pendingInteractionMap.forEach(function (scheduledInteractions, lane) {
      // Only decrement the pending interaction count if we're done.
      // If there's still work at the current priority,
      // That indicates that we are waiting for suspense data.
      if (!includesSomeLane(remainingLanesAfterCommit, lane)) {
        pendingInteractionMap.delete(lane);
        scheduledInteractions.forEach(function (interaction) {
          interaction.__count--;

          if (subscriber !== null && interaction.__count === 0) {
            try {
              subscriber.onInteractionScheduledWorkCompleted(interaction);
            } catch (error) {
              // If the subscriber throws, rethrow it in a separate task
              scheduleCallback(ImmediatePriority$1, function () {
                throw error;
              });
            }
          }
        });
      }
    });
  }
} // `act` testing API

function shouldForceFlushFallbacksInDEV() {
  // Never force flush in production. This function should get stripped out.
  return  actingUpdatesScopeDepth > 0;
}
// so we can tell if any async act() calls try to run in parallel.


var actingUpdatesScopeDepth = 0;

function detachFiberAfterEffects(fiber) {
  fiber.sibling = null;
  fiber.stateNode = null;
}

var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.

var failedBoundaries = null;
var setRefreshHandler = function (handler) {
  {
    resolveFamily = handler;
  }
};
function resolveFunctionForHotReloading(type) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return type;
    }

    var family = resolveFamily(type);

    if (family === undefined) {
      return type;
    } // Use the latest known implementation.


    return family.current;
  }
}
function resolveClassForHotReloading(type) {
  // No implementation differences.
  return resolveFunctionForHotReloading(type);
}
function resolveForwardRefForHotReloading(type) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return type;
    }

    var family = resolveFamily(type);

    if (family === undefined) {
      // Check if we're dealing with a real forwardRef. Don't want to crash early.
      if (type !== null && type !== undefined && typeof type.render === 'function') {
        // ForwardRef is special because its resolved .type is an object,
        // but it's possible that we only have its inner render function in the map.
        // If that inner render function is different, we'll build a new forwardRef type.
        var currentRender = resolveFunctionForHotReloading(type.render);

        if (type.render !== currentRender) {
          var syntheticType = {
            $$typeof: REACT_FORWARD_REF_TYPE,
            render: currentRender
          };

          if (type.displayName !== undefined) {
            syntheticType.displayName = type.displayName;
          }

          return syntheticType;
        }
      }

      return type;
    } // Use the latest known implementation.


    return family.current;
  }
}
function isCompatibleFamilyForHotReloading(fiber, element) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return false;
    }

    var prevType = fiber.elementType;
    var nextType = element.type; // If we got here, we know types aren't === equal.

    var needsCompareFamilies = false;
    var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;

    switch (fiber.tag) {
      case ClassComponent:
        {
          if (typeof nextType === 'function') {
            needsCompareFamilies = true;
          }

          break;
        }

      case FunctionComponent:
        {
          if (typeof nextType === 'function') {
            needsCompareFamilies = true;
          } else if ($$typeofNextType === REACT_LAZY_TYPE) {
            // We don't know the inner type yet.
            // We're going to assume that the lazy inner type is stable,
            // and so it is sufficient to avoid reconciling it away.
            // We're not going to unwrap or actually use the new lazy type.
            needsCompareFamilies = true;
          }

          break;
        }

      case ForwardRef:
        {
          if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
            needsCompareFamilies = true;
          } else if ($$typeofNextType === REACT_LAZY_TYPE) {
            needsCompareFamilies = true;
          }

          break;
        }

      case MemoComponent:
      case SimpleMemoComponent:
        {
          if ($$typeofNextType === REACT_MEMO_TYPE) {
            // TODO: if it was but can no longer be simple,
            // we shouldn't set this.
            needsCompareFamilies = true;
          } else if ($$typeofNextType === REACT_LAZY_TYPE) {
            needsCompareFamilies = true;
          }

          break;
        }

      default:
        return false;
    } // Check if both types have a family and it's the same one.


    if (needsCompareFamilies) {
      // Note: memo() and forwardRef() we'll compare outer rather than inner type.
      // This means both of them need to be registered to preserve state.
      // If we unwrapped and compared the inner types for wrappers instead,
      // then we would risk falsely saying two separate memo(Foo)
      // calls are equivalent because they wrap the same Foo function.
      var prevFamily = resolveFamily(prevType);

      if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {
        return true;
      }
    }

    return false;
  }
}
function markFailedErrorBoundaryForHotReloading(fiber) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return;
    }

    if (typeof WeakSet !== 'function') {
      return;
    }

    if (failedBoundaries === null) {
      failedBoundaries = new WeakSet();
    }

    failedBoundaries.add(fiber);
  }
}
var scheduleRefresh = function (root, update) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return;
    }

    var staleFamilies = update.staleFamilies,
        updatedFamilies = update.updatedFamilies;
    flushPassiveEffects();
    flushSync(function () {
      scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);
    });
  }
};
var scheduleRoot = function (root, element) {
  {
    if (root.context !== emptyContextObject) {
      // Super edge case: root has a legacy _renderSubtree context
      // but we don't know the parentComponent so we can't pass it.
      // Just ignore. We'll delete this with _renderSubtree code path later.
      return;
    }

    flushPassiveEffects();
    flushSync(function () {
      updateContainer(element, root, null, null);
    });
  }
};

function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
  {
    var alternate = fiber.alternate,
        child = fiber.child,
        sibling = fiber.sibling,
        tag = fiber.tag,
        type = fiber.type;
    var candidateType = null;

    switch (tag) {
      case FunctionComponent:
      case SimpleMemoComponent:
      case ClassComponent:
        candidateType = type;
        break;

      case ForwardRef:
        candidateType = type.render;
        break;
    }

    if (resolveFamily === null) {
      throw new Error('Expected resolveFamily to be set during hot reload.');
    }

    var needsRender = false;
    var needsRemount = false;

    if (candidateType !== null) {
      var family = resolveFamily(candidateType);

      if (family !== undefined) {
        if (staleFamilies.has(family)) {
          needsRemount = true;
        } else if (updatedFamilies.has(family)) {
          if (tag === ClassComponent) {
            needsRemount = true;
          } else {
            needsRender = true;
          }
        }
      }
    }

    if (failedBoundaries !== null) {
      if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
        needsRemount = true;
      }
    }

    if (needsRemount) {
      fiber._debugNeedsRemount = true;
    }

    if (needsRemount || needsRender) {
      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
    }

    if (child !== null && !needsRemount) {
      scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
    }

    if (sibling !== null) {
      scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
    }
  }
}

var findHostInstancesForRefresh = function (root, families) {
  {
    var hostInstances = new Set();
    var types = new Set(families.map(function (family) {
      return family.current;
    }));
    findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);
    return hostInstances;
  }
};

function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
  {
    var child = fiber.child,
        sibling = fiber.sibling,
        tag = fiber.tag,
        type = fiber.type;
    var candidateType = null;

    switch (tag) {
      case FunctionComponent:
      case SimpleMemoComponent:
      case ClassComponent:
        candidateType = type;
        break;

      case ForwardRef:
        candidateType = type.render;
        break;
    }

    var didMatch = false;

    if (candidateType !== null) {
      if (types.has(candidateType)) {
        didMatch = true;
      }
    }

    if (didMatch) {
      // We have a match. This only drills down to the closest host components.
      // There's no need to search deeper because for the purpose of giving
      // visual feedback, "flashing" outermost parent rectangles is sufficient.
      findHostInstancesForFiberShallowly(fiber, hostInstances);
    } else {
      // If there's no match, maybe there will be one further down in the child tree.
      if (child !== null) {
        findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
      }
    }

    if (sibling !== null) {
      findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
    }
  }
}

function findHostInstancesForFiberShallowly(fiber, hostInstances) {
  {
    var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);

    if (foundHostInstances) {
      return;
    } // If we didn't find any host children, fallback to closest host parent.


    var node = fiber;

    while (true) {
      switch (node.tag) {
        case HostComponent:
          hostInstances.add(node.stateNode);
          return;

        case HostPortal:
          hostInstances.add(node.stateNode.containerInfo);
          return;

        case HostRoot:
          hostInstances.add(node.stateNode.containerInfo);
          return;
      }

      if (node.return === null) {
        throw new Error('Expected to reach root first.');
      }

      node = node.return;
    }
  }
}

function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
  {
    var node = fiber;
    var foundHostInstances = false;

    while (true) {
      if (node.tag === HostComponent) {
        // We got a match.
        foundHostInstances = true;
        hostInstances.add(node.stateNode); // There may still be more, so keep searching.
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }

      if (node === fiber) {
        return foundHostInstances;
      }

      while (node.sibling === null) {
        if (node.return === null || node.return === fiber) {
          return foundHostInstances;
        }

        node = node.return;
      }

      node.sibling.return = node.return;
      node = node.sibling;
    }
  }

  return false;
}

var hasBadMapPolyfill;

{
  hasBadMapPolyfill = false;

  try {
    var nonExtensibleObject = Object.preventExtensions({});
    /* eslint-disable no-new */

    new Map([[nonExtensibleObject, null]]);
    new Set([nonExtensibleObject]);
    /* eslint-enable no-new */
  } catch (e) {
    // TODO: Consider warning about bad polyfills
    hasBadMapPolyfill = true;
  }
}

var debugCounter = 1;

function FiberNode(tag, pendingProps, key, mode) {
  // Instance
  this.tag = tag;
  this.key = key;
  this.elementType = null;
  this.type = null;
  this.stateNode = null; // Fiber

  this.return = null;
  this.child = null;
  this.sibling = null;
  this.index = 0;
  this.ref = null;
  this.pendingProps = pendingProps;
  this.memoizedProps = null;
  this.updateQueue = null;
  this.memoizedState = null;
  this.dependencies = null;
  this.mode = mode; // Effects

  this.flags = NoFlags;
  this.nextEffect = null;
  this.firstEffect = null;
  this.lastEffect = null;
  this.lanes = NoLanes;
  this.childLanes = NoLanes;
  this.alternate = null;

  {
    // Note: The following is done to avoid a v8 performance cliff.
    //
    // Initializing the fields below to smis and later updating them with
    // double values will cause Fibers to end up having separate shapes.
    // This behavior/bug has something to do with Object.preventExtension().
    // Fortunately this only impacts DEV builds.
    // Unfortunately it makes React unusably slow for some applications.
    // To work around this, initialize the fields below with doubles.
    //
    // Learn more about this here:
    // https://github.com/facebook/react/issues/14365
    // https://bugs.chromium.org/p/v8/issues/detail?id=8538
    this.actualDuration = Number.NaN;
    this.actualStartTime = Number.NaN;
    this.selfBaseDuration = Number.NaN;
    this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.
    // This won't trigger the performance cliff mentioned above,
    // and it simplifies other profiler code (including DevTools).

    this.actualDuration = 0;
    this.actualStartTime = -1;
    this.selfBaseDuration = 0;
    this.treeBaseDuration = 0;
  }

  {
    // This isn't directly used but is handy for debugging internals:
    this._debugID = debugCounter++;
    this._debugSource = null;
    this._debugOwner = null;
    this._debugNeedsRemount = false;
    this._debugHookTypes = null;

    if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
      Object.preventExtensions(this);
    }
  }
} // This is a constructor function, rather than a POJO constructor, still
// please ensure we do the following:
// 1) Nobody should add any instance methods on this. Instance methods can be
//    more difficult to predict when they get optimized and they are almost
//    never inlined properly in static compilers.
// 2) Nobody should rely on `instanceof Fiber` for type testing. We should
//    always know when it is a fiber.
// 3) We might want to experiment with using numeric keys since they are easier
//    to optimize in a non-JIT environment.
// 4) We can easily go from a constructor to a createFiber object literal if that
//    is faster.
// 5) It should be easy to port this to a C struct and keep a C implementation
//    compatible.


var createFiber = function (tag, pendingProps, key, mode) {
  // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors
  return new FiberNode(tag, pendingProps, key, mode);
};

function shouldConstruct$1(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function isSimpleFunctionComponent(type) {
  return typeof type === 'function' && !shouldConstruct$1(type) && type.defaultProps === undefined;
}
function resolveLazyComponentTag(Component) {
  if (typeof Component === 'function') {
    return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;
  } else if (Component !== undefined && Component !== null) {
    var $$typeof = Component.$$typeof;

    if ($$typeof === REACT_FORWARD_REF_TYPE) {
      return ForwardRef;
    }

    if ($$typeof === REACT_MEMO_TYPE) {
      return MemoComponent;
    }
  }

  return IndeterminateComponent;
} // This is used to create an alternate fiber to do work on.

function createWorkInProgress(current, pendingProps) {
  var workInProgress = current.alternate;

  if (workInProgress === null) {
    // We use a double buffering pooling technique because we know that we'll
    // only ever need at most two versions of a tree. We pool the "other" unused
    // node that we're free to reuse. This is lazily created to avoid allocating
    // extra objects for things that are never updated. It also allow us to
    // reclaim the extra memory if needed.
    workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);
    workInProgress.elementType = current.elementType;
    workInProgress.type = current.type;
    workInProgress.stateNode = current.stateNode;

    {
      // DEV-only fields
      workInProgress._debugID = current._debugID;
      workInProgress._debugSource = current._debugSource;
      workInProgress._debugOwner = current._debugOwner;
      workInProgress._debugHookTypes = current._debugHookTypes;
    }

    workInProgress.alternate = current;
    current.alternate = workInProgress;
  } else {
    workInProgress.pendingProps = pendingProps; // Needed because Blocks store data on type.

    workInProgress.type = current.type; // We already have an alternate.
    // Reset the effect tag.

    workInProgress.flags = NoFlags; // The effect list is no longer valid.

    workInProgress.nextEffect = null;
    workInProgress.firstEffect = null;
    workInProgress.lastEffect = null;

    {
      // We intentionally reset, rather than copy, actualDuration & actualStartTime.
      // This prevents time from endlessly accumulating in new commits.
      // This has the downside of resetting values for different priority renders,
      // But works for yielding (the common case) and should support resuming.
      workInProgress.actualDuration = 0;
      workInProgress.actualStartTime = -1;
    }
  }

  workInProgress.childLanes = current.childLanes;
  workInProgress.lanes = current.lanes;
  workInProgress.child = current.child;
  workInProgress.memoizedProps = current.memoizedProps;
  workInProgress.memoizedState = current.memoizedState;
  workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so
  // it cannot be shared with the current fiber.

  var currentDependencies = current.dependencies;
  workInProgress.dependencies = currentDependencies === null ? null : {
    lanes: currentDependencies.lanes,
    firstContext: currentDependencies.firstContext
  }; // These will be overridden during the parent's reconciliation

  workInProgress.sibling = current.sibling;
  workInProgress.index = current.index;
  workInProgress.ref = current.ref;

  {
    workInProgress.selfBaseDuration = current.selfBaseDuration;
    workInProgress.treeBaseDuration = current.treeBaseDuration;
  }

  {
    workInProgress._debugNeedsRemount = current._debugNeedsRemount;

    switch (workInProgress.tag) {
      case IndeterminateComponent:
      case FunctionComponent:
      case SimpleMemoComponent:
        workInProgress.type = resolveFunctionForHotReloading(current.type);
        break;

      case ClassComponent:
        workInProgress.type = resolveClassForHotReloading(current.type);
        break;

      case ForwardRef:
        workInProgress.type = resolveForwardRefForHotReloading(current.type);
        break;
    }
  }

  return workInProgress;
} // Used to reuse a Fiber for a second pass.

function resetWorkInProgress(workInProgress, renderLanes) {
  // This resets the Fiber to what createFiber or createWorkInProgress would
  // have set the values to before during the first pass. Ideally this wouldn't
  // be necessary but unfortunately many code paths reads from the workInProgress
  // when they should be reading from current and writing to workInProgress.
  // We assume pendingProps, index, key, ref, return are still untouched to
  // avoid doing another reconciliation.
  // Reset the effect tag but keep any Placement tags, since that's something
  // that child fiber is setting, not the reconciliation.
  workInProgress.flags &= Placement; // The effect list is no longer valid.

  workInProgress.nextEffect = null;
  workInProgress.firstEffect = null;
  workInProgress.lastEffect = null;
  var current = workInProgress.alternate;

  if (current === null) {
    // Reset to createFiber's initial values.
    workInProgress.childLanes = NoLanes;
    workInProgress.lanes = renderLanes;
    workInProgress.child = null;
    workInProgress.memoizedProps = null;
    workInProgress.memoizedState = null;
    workInProgress.updateQueue = null;
    workInProgress.dependencies = null;
    workInProgress.stateNode = null;

    {
      // Note: We don't reset the actualTime counts. It's useful to accumulate
      // actual time across multiple render passes.
      workInProgress.selfBaseDuration = 0;
      workInProgress.treeBaseDuration = 0;
    }
  } else {
    // Reset to the cloned values that createWorkInProgress would've.
    workInProgress.childLanes = current.childLanes;
    workInProgress.lanes = current.lanes;
    workInProgress.child = current.child;
    workInProgress.memoizedProps = current.memoizedProps;
    workInProgress.memoizedState = current.memoizedState;
    workInProgress.updateQueue = current.updateQueue; // Needed because Blocks store data on type.

    workInProgress.type = current.type; // Clone the dependencies object. This is mutated during the render phase, so
    // it cannot be shared with the current fiber.

    var currentDependencies = current.dependencies;
    workInProgress.dependencies = currentDependencies === null ? null : {
      lanes: currentDependencies.lanes,
      firstContext: currentDependencies.firstContext
    };

    {
      // Note: We don't reset the actualTime counts. It's useful to accumulate
      // actual time across multiple render passes.
      workInProgress.selfBaseDuration = current.selfBaseDuration;
      workInProgress.treeBaseDuration = current.treeBaseDuration;
    }
  }

  return workInProgress;
}
function createHostRootFiber(tag) {
  var mode;

  if (tag === ConcurrentRoot) {
    mode = ConcurrentMode | BlockingMode | StrictMode;
  } else if (tag === BlockingRoot) {
    mode = BlockingMode | StrictMode;
  } else {
    mode = NoMode;
  }

  if ( isDevToolsPresent) {
    // Always collect profile timings when DevTools are present.
    // This enables DevTools to start capturing timing at any point–
    // Without some nodes in the tree having empty base times.
    mode |= ProfileMode;
  }

  return createFiber(HostRoot, null, null, mode);
}
function createFiberFromTypeAndProps(type, // React$ElementType
key, pendingProps, owner, mode, lanes) {
  var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.

  var resolvedType = type;

  if (typeof type === 'function') {
    if (shouldConstruct$1(type)) {
      fiberTag = ClassComponent;

      {
        resolvedType = resolveClassForHotReloading(resolvedType);
      }
    } else {
      {
        resolvedType = resolveFunctionForHotReloading(resolvedType);
      }
    }
  } else if (typeof type === 'string') {
    fiberTag = HostComponent;
  } else {
    getTag: switch (type) {
      case REACT_FRAGMENT_TYPE:
        return createFiberFromFragment(pendingProps.children, mode, lanes, key);

      case REACT_DEBUG_TRACING_MODE_TYPE:
        fiberTag = Mode;
        mode |= DebugTracingMode;
        break;

      case REACT_STRICT_MODE_TYPE:
        fiberTag = Mode;
        mode |= StrictMode;
        break;

      case REACT_PROFILER_TYPE:
        return createFiberFromProfiler(pendingProps, mode, lanes, key);

      case REACT_SUSPENSE_TYPE:
        return createFiberFromSuspense(pendingProps, mode, lanes, key);

      case REACT_SUSPENSE_LIST_TYPE:
        return createFiberFromSuspenseList(pendingProps, mode, lanes, key);

      case REACT_OFFSCREEN_TYPE:
        return createFiberFromOffscreen(pendingProps, mode, lanes, key);

      case REACT_LEGACY_HIDDEN_TYPE:
        return createFiberFromLegacyHidden(pendingProps, mode, lanes, key);

      case REACT_SCOPE_TYPE:

      // eslint-disable-next-line no-fallthrough

      default:
        {
          if (typeof type === 'object' && type !== null) {
            switch (type.$$typeof) {
              case REACT_PROVIDER_TYPE:
                fiberTag = ContextProvider;
                break getTag;

              case REACT_CONTEXT_TYPE:
                // This is a consumer
                fiberTag = ContextConsumer;
                break getTag;

              case REACT_FORWARD_REF_TYPE:
                fiberTag = ForwardRef;

                {
                  resolvedType = resolveForwardRefForHotReloading(resolvedType);
                }

                break getTag;

              case REACT_MEMO_TYPE:
                fiberTag = MemoComponent;
                break getTag;

              case REACT_LAZY_TYPE:
                fiberTag = LazyComponent;
                resolvedType = null;
                break getTag;

              case REACT_BLOCK_TYPE:
                fiberTag = Block;
                break getTag;
            }
          }

          var info = '';

          {
            if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
              info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
            }

            var ownerName = owner ? getComponentName(owner.type) : null;

            if (ownerName) {
              info += '\n\nCheck the render method of `' + ownerName + '`.';
            }
          }

          {
            {
              throw Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info );
            }
          }
        }
    }
  }

  var fiber = createFiber(fiberTag, pendingProps, key, mode);
  fiber.elementType = type;
  fiber.type = resolvedType;
  fiber.lanes = lanes;

  {
    fiber._debugOwner = owner;
  }

  return fiber;
}
function createFiberFromElement(element, mode, lanes) {
  var owner = null;

  {
    owner = element._owner;
  }

  var type = element.type;
  var key = element.key;
  var pendingProps = element.props;
  var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);

  {
    fiber._debugSource = element._source;
    fiber._debugOwner = element._owner;
  }

  return fiber;
}
function createFiberFromFragment(elements, mode, lanes, key) {
  var fiber = createFiber(Fragment, elements, key, mode);
  fiber.lanes = lanes;
  return fiber;
}

function createFiberFromProfiler(pendingProps, mode, lanes, key) {
  {
    if (typeof pendingProps.id !== 'string') {
      error('Profiler must specify an "id" as a prop');
    }
  }

  var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag.

  fiber.elementType = REACT_PROFILER_TYPE;
  fiber.type = REACT_PROFILER_TYPE;
  fiber.lanes = lanes;

  {
    fiber.stateNode = {
      effectDuration: 0,
      passiveEffectDuration: 0
    };
  }

  return fiber;
}

function createFiberFromSuspense(pendingProps, mode, lanes, key) {
  var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.
  // This needs to be fixed in getComponentName so that it relies on the tag
  // instead.

  fiber.type = REACT_SUSPENSE_TYPE;
  fiber.elementType = REACT_SUSPENSE_TYPE;
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
  var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);

  {
    // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.
    // This needs to be fixed in getComponentName so that it relies on the tag
    // instead.
    fiber.type = REACT_SUSPENSE_LIST_TYPE;
  }

  fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
  var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); // TODO: The OffscreenComponent fiber shouldn't have a type. It has a tag.
  // This needs to be fixed in getComponentName so that it relies on the tag
  // instead.

  {
    fiber.type = REACT_OFFSCREEN_TYPE;
  }

  fiber.elementType = REACT_OFFSCREEN_TYPE;
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromLegacyHidden(pendingProps, mode, lanes, key) {
  var fiber = createFiber(LegacyHiddenComponent, pendingProps, key, mode); // TODO: The LegacyHidden fiber shouldn't have a type. It has a tag.
  // This needs to be fixed in getComponentName so that it relies on the tag
  // instead.

  {
    fiber.type = REACT_LEGACY_HIDDEN_TYPE;
  }

  fiber.elementType = REACT_LEGACY_HIDDEN_TYPE;
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromText(content, mode, lanes) {
  var fiber = createFiber(HostText, content, null, mode);
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromHostInstanceForDeletion() {
  var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type.

  fiber.elementType = 'DELETED';
  fiber.type = 'DELETED';
  return fiber;
}
function createFiberFromPortal(portal, mode, lanes) {
  var pendingProps = portal.children !== null ? portal.children : [];
  var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
  fiber.lanes = lanes;
  fiber.stateNode = {
    containerInfo: portal.containerInfo,
    pendingChildren: null,
    // Used by persistent updates
    implementation: portal.implementation
  };
  return fiber;
} // Used for stashing WIP properties to replay failed work in DEV.

function assignFiberPropertiesInDEV(target, source) {
  if (target === null) {
    // This Fiber's initial properties will always be overwritten.
    // We only use a Fiber to ensure the same hidden class so DEV isn't slow.
    target = createFiber(IndeterminateComponent, null, null, NoMode);
  } // This is intentionally written as a list of all properties.
  // We tried to use Object.assign() instead but this is called in
  // the hottest path, and Object.assign() was too slow:
  // https://github.com/facebook/react/issues/12502
  // This code is DEV-only so size is not a concern.


  target.tag = source.tag;
  target.key = source.key;
  target.elementType = source.elementType;
  target.type = source.type;
  target.stateNode = source.stateNode;
  target.return = source.return;
  target.child = source.child;
  target.sibling = source.sibling;
  target.index = source.index;
  target.ref = source.ref;
  target.pendingProps = source.pendingProps;
  target.memoizedProps = source.memoizedProps;
  target.updateQueue = source.updateQueue;
  target.memoizedState = source.memoizedState;
  target.dependencies = source.dependencies;
  target.mode = source.mode;
  target.flags = source.flags;
  target.nextEffect = source.nextEffect;
  target.firstEffect = source.firstEffect;
  target.lastEffect = source.lastEffect;
  target.lanes = source.lanes;
  target.childLanes = source.childLanes;
  target.alternate = source.alternate;

  {
    target.actualDuration = source.actualDuration;
    target.actualStartTime = source.actualStartTime;
    target.selfBaseDuration = source.selfBaseDuration;
    target.treeBaseDuration = source.treeBaseDuration;
  }

  target._debugID = source._debugID;
  target._debugSource = source._debugSource;
  target._debugOwner = source._debugOwner;
  target._debugNeedsRemount = source._debugNeedsRemount;
  target._debugHookTypes = source._debugHookTypes;
  return target;
}

function FiberRootNode(containerInfo, tag, hydrate) {
  this.tag = tag;
  this.containerInfo = containerInfo;
  this.pendingChildren = null;
  this.current = null;
  this.pingCache = null;
  this.finishedWork = null;
  this.timeoutHandle = noTimeout;
  this.context = null;
  this.pendingContext = null;
  this.hydrate = hydrate;
  this.callbackNode = null;
  this.callbackPriority = NoLanePriority;
  this.eventTimes = createLaneMap(NoLanes);
  this.expirationTimes = createLaneMap(NoTimestamp);
  this.pendingLanes = NoLanes;
  this.suspendedLanes = NoLanes;
  this.pingedLanes = NoLanes;
  this.expiredLanes = NoLanes;
  this.mutableReadLanes = NoLanes;
  this.finishedLanes = NoLanes;
  this.entangledLanes = NoLanes;
  this.entanglements = createLaneMap(NoLanes);

  {
    this.mutableSourceEagerHydrationData = null;
  }

  {
    this.interactionThreadID = tracing.unstable_getThreadID();
    this.memoizedInteractions = new Set();
    this.pendingInteractionMap = new Map();
  }

  {
    switch (tag) {
      case BlockingRoot:
        this._debugRootType = 'createBlockingRoot()';
        break;

      case ConcurrentRoot:
        this._debugRootType = 'createRoot()';
        break;

      case LegacyRoot:
        this._debugRootType = 'createLegacyRoot()';
        break;
    }
  }
}

function createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {
  var root = new FiberRootNode(containerInfo, tag, hydrate);
  // stateNode is any.


  var uninitializedFiber = createHostRootFiber(tag);
  root.current = uninitializedFiber;
  uninitializedFiber.stateNode = root;
  initializeUpdateQueue(uninitializedFiber);
  return root;
}

// This ensures that the version used for server rendering matches the one
// that is eventually read during hydration.
// If they don't match there's a potential tear and a full deopt render is required.

function registerMutableSourceForHydration(root, mutableSource) {
  var getVersion = mutableSource._getVersion;
  var version = getVersion(mutableSource._source); // TODO Clear this data once all pending hydration work is finished.
  // Retaining it forever may interfere with GC.

  if (root.mutableSourceEagerHydrationData == null) {
    root.mutableSourceEagerHydrationData = [mutableSource, version];
  } else {
    root.mutableSourceEagerHydrationData.push(mutableSource, version);
  }
}

function createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
  var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  return {
    // This tag allow us to uniquely identify this as a React Portal
    $$typeof: REACT_PORTAL_TYPE,
    key: key == null ? null : '' + key,
    children: children,
    containerInfo: containerInfo,
    implementation: implementation
  };
}

var didWarnAboutNestedUpdates;
var didWarnAboutFindNodeInStrictMode;

{
  didWarnAboutNestedUpdates = false;
  didWarnAboutFindNodeInStrictMode = {};
}

function getContextForSubtree(parentComponent) {
  if (!parentComponent) {
    return emptyContextObject;
  }

  var fiber = get(parentComponent);
  var parentContext = findCurrentUnmaskedContext(fiber);

  if (fiber.tag === ClassComponent) {
    var Component = fiber.type;

    if (isContextProvider(Component)) {
      return processChildContext(fiber, Component, parentContext);
    }
  }

  return parentContext;
}

function findHostInstanceWithWarning(component, methodName) {
  {
    var fiber = get(component);

    if (fiber === undefined) {
      if (typeof component.render === 'function') {
        {
          {
            throw Error( "Unable to find node on an unmounted component." );
          }
        }
      } else {
        {
          {
            throw Error( "Argument appears to not be a ReactComponent. Keys: " + Object.keys(component) );
          }
        }
      }
    }

    var hostFiber = findCurrentHostFiber(fiber);

    if (hostFiber === null) {
      return null;
    }

    if (hostFiber.mode & StrictMode) {
      var componentName = getComponentName(fiber.type) || 'Component';

      if (!didWarnAboutFindNodeInStrictMode[componentName]) {
        didWarnAboutFindNodeInStrictMode[componentName] = true;
        var previousFiber = current;

        try {
          setCurrentFiber(hostFiber);

          if (fiber.mode & StrictMode) {
            error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName);
          } else {
            error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName);
          }
        } finally {
          // Ideally this should reset to previous but this shouldn't be called in
          // render and there's another warning for that anyway.
          if (previousFiber) {
            setCurrentFiber(previousFiber);
          } else {
            resetCurrentFiber();
          }
        }
      }
    }

    return hostFiber.stateNode;
  }
}

function createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {
  return createFiberRoot(containerInfo, tag, hydrate);
}
function updateContainer(element, container, parentComponent, callback) {
  {
    onScheduleRoot(container, element);
  }

  var current$1 = container.current;
  var eventTime = requestEventTime();

  {
    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
    if ('undefined' !== typeof jest) {
      warnIfUnmockedScheduler(current$1);
      warnIfNotScopedWithMatchingAct(current$1);
    }
  }

  var lane = requestUpdateLane(current$1);

  var context = getContextForSubtree(parentComponent);

  if (container.context === null) {
    container.context = context;
  } else {
    container.pendingContext = context;
  }

  {
    if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
      didWarnAboutNestedUpdates = true;

      error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
    }
  }

  var update = createUpdate(eventTime, lane); // Caution: React DevTools currently depends on this property
  // being called "element".

  update.payload = {
    element: element
  };
  callback = callback === undefined ? null : callback;

  if (callback !== null) {
    {
      if (typeof callback !== 'function') {
        error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
      }
    }

    update.callback = callback;
  }

  enqueueUpdate(current$1, update);
  scheduleUpdateOnFiber(current$1, lane, eventTime);
  return lane;
}
function getPublicRootInstance(container) {
  var containerFiber = container.current;

  if (!containerFiber.child) {
    return null;
  }

  switch (containerFiber.child.tag) {
    case HostComponent:
      return getPublicInstance(containerFiber.child.stateNode);

    default:
      return containerFiber.child.stateNode;
  }
}

function markRetryLaneImpl(fiber, retryLane) {
  var suspenseState = fiber.memoizedState;

  if (suspenseState !== null && suspenseState.dehydrated !== null) {
    suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
  }
} // Increases the priority of thennables when they resolve within this boundary.


function markRetryLaneIfNotHydrated(fiber, retryLane) {
  markRetryLaneImpl(fiber, retryLane);
  var alternate = fiber.alternate;

  if (alternate) {
    markRetryLaneImpl(alternate, retryLane);
  }
}

function attemptUserBlockingHydration$1(fiber) {
  if (fiber.tag !== SuspenseComponent) {
    // We ignore HostRoots here because we can't increase
    // their priority and they should not suspend on I/O,
    // since you have to wrap anything that might suspend in
    // Suspense.
    return;
  }

  var eventTime = requestEventTime();
  var lane = InputDiscreteHydrationLane;
  scheduleUpdateOnFiber(fiber, lane, eventTime);
  markRetryLaneIfNotHydrated(fiber, lane);
}
function attemptContinuousHydration$1(fiber) {
  if (fiber.tag !== SuspenseComponent) {
    // We ignore HostRoots here because we can't increase
    // their priority and they should not suspend on I/O,
    // since you have to wrap anything that might suspend in
    // Suspense.
    return;
  }

  var eventTime = requestEventTime();
  var lane = SelectiveHydrationLane;
  scheduleUpdateOnFiber(fiber, lane, eventTime);
  markRetryLaneIfNotHydrated(fiber, lane);
}
function attemptHydrationAtCurrentPriority$1(fiber) {
  if (fiber.tag !== SuspenseComponent) {
    // We ignore HostRoots here because we can't increase
    // their priority other than synchronously flush it.
    return;
  }

  var eventTime = requestEventTime();
  var lane = requestUpdateLane(fiber);
  scheduleUpdateOnFiber(fiber, lane, eventTime);
  markRetryLaneIfNotHydrated(fiber, lane);
}
function runWithPriority$2(priority, fn) {

  try {
    setCurrentUpdateLanePriority(priority);
    return fn();
  } finally {
  }
}
function findHostInstanceWithNoPortals(fiber) {
  var hostFiber = findCurrentHostFiberWithNoPortals(fiber);

  if (hostFiber === null) {
    return null;
  }

  if (hostFiber.tag === FundamentalComponent) {
    return hostFiber.stateNode.instance;
  }

  return hostFiber.stateNode;
}

var shouldSuspendImpl = function (fiber) {
  return false;
};

function shouldSuspend(fiber) {
  return shouldSuspendImpl(fiber);
}
var overrideHookState = null;
var overrideHookStateDeletePath = null;
var overrideHookStateRenamePath = null;
var overrideProps = null;
var overridePropsDeletePath = null;
var overridePropsRenamePath = null;
var scheduleUpdate = null;
var setSuspenseHandler = null;

{
  var copyWithDeleteImpl = function (obj, path, index) {
    var key = path[index];
    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);

    if (index + 1 === path.length) {
      if (Array.isArray(updated)) {
        updated.splice(key, 1);
      } else {
        delete updated[key];
      }

      return updated;
    } // $FlowFixMe number or string is fine here


    updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);
    return updated;
  };

  var copyWithDelete = function (obj, path) {
    return copyWithDeleteImpl(obj, path, 0);
  };

  var copyWithRenameImpl = function (obj, oldPath, newPath, index) {
    var oldKey = oldPath[index];
    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);

    if (index + 1 === oldPath.length) {
      var newKey = newPath[index]; // $FlowFixMe number or string is fine here

      updated[newKey] = updated[oldKey];

      if (Array.isArray(updated)) {
        updated.splice(oldKey, 1);
      } else {
        delete updated[oldKey];
      }
    } else {
      // $FlowFixMe number or string is fine here
      updated[oldKey] = copyWithRenameImpl( // $FlowFixMe number or string is fine here
      obj[oldKey], oldPath, newPath, index + 1);
    }

    return updated;
  };

  var copyWithRename = function (obj, oldPath, newPath) {
    if (oldPath.length !== newPath.length) {
      warn('copyWithRename() expects paths of the same length');

      return;
    } else {
      for (var i = 0; i < newPath.length - 1; i++) {
        if (oldPath[i] !== newPath[i]) {
          warn('copyWithRename() expects paths to be the same except for the deepest key');

          return;
        }
      }
    }

    return copyWithRenameImpl(obj, oldPath, newPath, 0);
  };

  var copyWithSetImpl = function (obj, path, index, value) {
    if (index >= path.length) {
      return value;
    }

    var key = path[index];
    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here

    updated[key] = copyWithSetImpl(obj[key], path, index + 1, value);
    return updated;
  };

  var copyWithSet = function (obj, path, value) {
    return copyWithSetImpl(obj, path, 0, value);
  };

  var findHook = function (fiber, id) {
    // For now, the "id" of stateful hooks is just the stateful hook index.
    // This may change in the future with e.g. nested hooks.
    var currentHook = fiber.memoizedState;

    while (currentHook !== null && id > 0) {
      currentHook = currentHook.next;
      id--;
    }

    return currentHook;
  }; // Support DevTools editable values for useState and useReducer.


  overrideHookState = function (fiber, id, path, value) {
    var hook = findHook(fiber, id);

    if (hook !== null) {
      var newState = copyWithSet(hook.memoizedState, path, value);
      hook.memoizedState = newState;
      hook.baseState = newState; // We aren't actually adding an update to the queue,
      // because there is no update we can add for useReducer hooks that won't trigger an error.
      // (There's no appropriate action type for DevTools overrides.)
      // As a result though, React will see the scheduled update as a noop and bailout.
      // Shallow cloning props works as a workaround for now to bypass the bailout check.

      fiber.memoizedProps = _assign({}, fiber.memoizedProps);
      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
    }
  };

  overrideHookStateDeletePath = function (fiber, id, path) {
    var hook = findHook(fiber, id);

    if (hook !== null) {
      var newState = copyWithDelete(hook.memoizedState, path);
      hook.memoizedState = newState;
      hook.baseState = newState; // We aren't actually adding an update to the queue,
      // because there is no update we can add for useReducer hooks that won't trigger an error.
      // (There's no appropriate action type for DevTools overrides.)
      // As a result though, React will see the scheduled update as a noop and bailout.
      // Shallow cloning props works as a workaround for now to bypass the bailout check.

      fiber.memoizedProps = _assign({}, fiber.memoizedProps);
      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
    }
  };

  overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) {
    var hook = findHook(fiber, id);

    if (hook !== null) {
      var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
      hook.memoizedState = newState;
      hook.baseState = newState; // We aren't actually adding an update to the queue,
      // because there is no update we can add for useReducer hooks that won't trigger an error.
      // (There's no appropriate action type for DevTools overrides.)
      // As a result though, React will see the scheduled update as a noop and bailout.
      // Shallow cloning props works as a workaround for now to bypass the bailout check.

      fiber.memoizedProps = _assign({}, fiber.memoizedProps);
      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
    }
  }; // Support DevTools props for function components, forwardRef, memo, host components, etc.


  overrideProps = function (fiber, path, value) {
    fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);

    if (fiber.alternate) {
      fiber.alternate.pendingProps = fiber.pendingProps;
    }

    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
  };

  overridePropsDeletePath = function (fiber, path) {
    fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);

    if (fiber.alternate) {
      fiber.alternate.pendingProps = fiber.pendingProps;
    }

    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
  };

  overridePropsRenamePath = function (fiber, oldPath, newPath) {
    fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);

    if (fiber.alternate) {
      fiber.alternate.pendingProps = fiber.pendingProps;
    }

    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
  };

  scheduleUpdate = function (fiber) {
    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
  };

  setSuspenseHandler = function (newShouldSuspendImpl) {
    shouldSuspendImpl = newShouldSuspendImpl;
  };
}

function findHostInstanceByFiber(fiber) {
  var hostFiber = findCurrentHostFiber(fiber);

  if (hostFiber === null) {
    return null;
  }

  return hostFiber.stateNode;
}

function emptyFindFiberByHostInstance(instance) {
  return null;
}

function getCurrentFiberForDevTools() {
  return current;
}

function injectIntoDevTools(devToolsConfig) {
  var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
  var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
  return injectInternals({
    bundleType: devToolsConfig.bundleType,
    version: devToolsConfig.version,
    rendererPackageName: devToolsConfig.rendererPackageName,
    rendererConfig: devToolsConfig.rendererConfig,
    overrideHookState: overrideHookState,
    overrideHookStateDeletePath: overrideHookStateDeletePath,
    overrideHookStateRenamePath: overrideHookStateRenamePath,
    overrideProps: overrideProps,
    overridePropsDeletePath: overridePropsDeletePath,
    overridePropsRenamePath: overridePropsRenamePath,
    setSuspenseHandler: setSuspenseHandler,
    scheduleUpdate: scheduleUpdate,
    currentDispatcherRef: ReactCurrentDispatcher,
    findHostInstanceByFiber: findHostInstanceByFiber,
    findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
    // React Refresh
    findHostInstancesForRefresh:  findHostInstancesForRefresh ,
    scheduleRefresh:  scheduleRefresh ,
    scheduleRoot:  scheduleRoot ,
    setRefreshHandler:  setRefreshHandler ,
    // Enables DevTools to append owner stacks to error messages in DEV mode.
    getCurrentFiber:  getCurrentFiberForDevTools 
  });
}

function ReactDOMRoot(container, options) {
  this._internalRoot = createRootImpl(container, ConcurrentRoot, options);
}

function ReactDOMBlockingRoot(container, tag, options) {
  this._internalRoot = createRootImpl(container, tag, options);
}

ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children) {
  var root = this._internalRoot;

  {
    if (typeof arguments[1] === 'function') {
      error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');
    }

    var container = root.containerInfo;

    if (container.nodeType !== COMMENT_NODE) {
      var hostInstance = findHostInstanceWithNoPortals(root.current);

      if (hostInstance) {
        if (hostInstance.parentNode !== container) {
          error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + "root.unmount() to empty a root's container.");
        }
      }
    }
  }

  updateContainer(children, root, null, null);
};

ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function () {
  {
    if (typeof arguments[0] === 'function') {
      error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');
    }
  }

  var root = this._internalRoot;
  var container = root.containerInfo;
  updateContainer(null, root, null, function () {
    unmarkContainerAsRoot(container);
  });
};

function createRootImpl(container, tag, options) {
  // Tag is either LegacyRoot or Concurrent Root
  var hydrate = options != null && options.hydrate === true;
  var hydrationCallbacks = options != null && options.hydrationOptions || null;
  var mutableSources = options != null && options.hydrationOptions != null && options.hydrationOptions.mutableSources || null;
  var root = createContainer(container, tag, hydrate);
  markContainerAsRoot(root.current, container);
  var containerNodeType = container.nodeType;

  {
    var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
    listenToAllSupportedEvents(rootContainerElement);
  }

  if (mutableSources) {
    for (var i = 0; i < mutableSources.length; i++) {
      var mutableSource = mutableSources[i];
      registerMutableSourceForHydration(root, mutableSource);
    }
  }

  return root;
}
function createLegacyRoot(container, options) {
  return new ReactDOMBlockingRoot(container, LegacyRoot, options);
}
function isValidContainer(node) {
  return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
}

var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
var topLevelUpdateWarnings;
var warnedAboutHydrateAPI = false;

{
  topLevelUpdateWarnings = function (container) {
    if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
      var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);

      if (hostInstance) {
        if (hostInstance.parentNode !== container) {
          error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');
        }
      }
    }

    var isRootRenderedBySomeReact = !!container._reactRootContainer;
    var rootEl = getReactRootElementInContainer(container);
    var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));

    if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
      error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');
    }

    if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {
      error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');
    }
  };
}

function getReactRootElementInContainer(container) {
  if (!container) {
    return null;
  }

  if (container.nodeType === DOCUMENT_NODE) {
    return container.documentElement;
  } else {
    return container.firstChild;
  }
}

function shouldHydrateDueToLegacyHeuristic(container) {
  var rootElement = getReactRootElementInContainer(container);
  return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
}

function legacyCreateRootFromDOMContainer(container, forceHydrate) {
  var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content.

  if (!shouldHydrate) {
    var warned = false;
    var rootSibling;

    while (rootSibling = container.lastChild) {
      {
        if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
          warned = true;

          error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
        }
      }

      container.removeChild(rootSibling);
    }
  }

  {
    if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
      warnedAboutHydrateAPI = true;

      warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v18. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
    }
  }

  return createLegacyRoot(container, shouldHydrate ? {
    hydrate: true
  } : undefined);
}

function warnOnInvalidCallback$1(callback, callerName) {
  {
    if (callback !== null && typeof callback !== 'function') {
      error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
    }
  }
}

function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
  {
    topLevelUpdateWarnings(container);
    warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');
  } // TODO: Without `any` type, Flow says "Property cannot be accessed on any
  // member of intersection type." Whyyyyyy.


  var root = container._reactRootContainer;
  var fiberRoot;

  if (!root) {
    // Initial mount
    root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
    fiberRoot = root._internalRoot;

    if (typeof callback === 'function') {
      var originalCallback = callback;

      callback = function () {
        var instance = getPublicRootInstance(fiberRoot);
        originalCallback.call(instance);
      };
    } // Initial mount should not be batched.


    unbatchedUpdates(function () {
      updateContainer(children, fiberRoot, parentComponent, callback);
    });
  } else {
    fiberRoot = root._internalRoot;

    if (typeof callback === 'function') {
      var _originalCallback = callback;

      callback = function () {
        var instance = getPublicRootInstance(fiberRoot);

        _originalCallback.call(instance);
      };
    } // Update


    updateContainer(children, fiberRoot, parentComponent, callback);
  }

  return getPublicRootInstance(fiberRoot);
}

function findDOMNode(componentOrElement) {
  {
    var owner = ReactCurrentOwner$3.current;

    if (owner !== null && owner.stateNode !== null) {
      var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;

      if (!warnedAboutRefsInRender) {
        error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component');
      }

      owner.stateNode._warnedAboutRefsInRender = true;
    }
  }

  if (componentOrElement == null) {
    return null;
  }

  if (componentOrElement.nodeType === ELEMENT_NODE) {
    return componentOrElement;
  }

  {
    return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');
  }
}
function hydrate(element, container, callback) {
  if (!isValidContainer(container)) {
    {
      throw Error( "Target container is not a DOM element." );
    }
  }

  {
    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;

    if (isModernRoot) {
      error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');
    }
  } // TODO: throw or warn if we couldn't hydrate?


  return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
}
function render(element, container, callback) {
  if (!isValidContainer(container)) {
    {
      throw Error( "Target container is not a DOM element." );
    }
  }

  {
    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;

    if (isModernRoot) {
      error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');
    }
  }

  return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
}
function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
  if (!isValidContainer(containerNode)) {
    {
      throw Error( "Target container is not a DOM element." );
    }
  }

  if (!(parentComponent != null && has(parentComponent))) {
    {
      throw Error( "parentComponent must be a valid React Component" );
    }
  }

  return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
}
function unmountComponentAtNode(container) {
  if (!isValidContainer(container)) {
    {
      throw Error( "unmountComponentAtNode(...): Target container is not a DOM element." );
    }
  }

  {
    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;

    if (isModernRoot) {
      error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');
    }
  }

  if (container._reactRootContainer) {
    {
      var rootEl = getReactRootElementInContainer(container);
      var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);

      if (renderedByDifferentReact) {
        error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.');
      }
    } // Unmount should not be batched.


    unbatchedUpdates(function () {
      legacyRenderSubtreeIntoContainer(null, null, container, false, function () {
        // $FlowFixMe This should probably use `delete container._reactRootContainer`
        container._reactRootContainer = null;
        unmarkContainerAsRoot(container);
      });
    }); // If you call unmountComponentAtNode twice in quick succession, you'll
    // get `true` twice. That's probably fine?

    return true;
  } else {
    {
      var _rootEl = getReactRootElementInContainer(container);

      var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl)); // Check if the container itself is a React root node.

      var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;

      if (hasNonRootReactChild) {
        error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');
      }
    }

    return false;
  }
}

setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
setAttemptContinuousHydration(attemptContinuousHydration$1);
setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
setAttemptHydrationAtPriority(runWithPriority$2);
var didWarnAboutUnstableCreatePortal = false;

{
  if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype
  Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype
  Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
    error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
  }
}

setRestoreImplementation(restoreControlledState$3);
setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);

function createPortal$1(children, container) {
  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

  if (!isValidContainer(container)) {
    {
      throw Error( "Target container is not a DOM element." );
    }
  } // TODO: pass ReactDOM portal implementation as third argument
  // $FlowFixMe The Flow type is opaque but there's no way to actually create it.


  return createPortal(children, container, null, key);
}

function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {

  return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
}

function unstable_createPortal(children, container) {
  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

  {
    if (!didWarnAboutUnstableCreatePortal) {
      didWarnAboutUnstableCreatePortal = true;

      warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 18+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
    }
  }

  return createPortal$1(children, container, key);
}

var Internals = {
  // Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js.
  // This is an array for better minification.
  Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, flushPassiveEffects, // TODO: This is related to `act`, not events. Move to separate key?
  IsThisRendererActing]
};
var foundDevTools = injectIntoDevTools({
  findFiberByHostInstance: getClosestInstanceFromNode,
  bundleType:  1 ,
  version: ReactVersion,
  rendererPackageName: 'react-dom'
});

{
  if (!foundDevTools && canUseDOM && window.top === window.self) {
    // If we're in Chrome or Firefox, provide a download link if not installed.
    if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
      var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.

      if (/^(https?|file):$/.test(protocol)) {
        // eslint-disable-next-line react-internal/no-production-logging
        console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://reactjs.org/link/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://reactjs.org/link/react-devtools-faq' : ''), 'font-weight:bold');
      }
    }
  }
}

exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = createPortal$1;
exports.findDOMNode = findDOMNode;
exports.flushSync = flushSync;
exports.hydrate = hydrate;
exports.render = render;
exports.unmountComponentAtNode = unmountComponentAtNode;
exports.unstable_batchedUpdates = batchedUpdates$1;
exports.unstable_createPortal = unstable_createPortal;
exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
exports.version = ReactVersion;
  })();
}


/***/ }),

/***/ "../../../../node_modules/react-dom/index.js":
/*!***************************************************!*\
  !*** ../../../../node_modules/react-dom/index.js ***!
  \***************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1176022__) => {

"use strict";


function checkDCE() {
  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  if (
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
  ) {
    return;
  }
  if (true) {
    // This branch is unreachable because this function is only called
    // in production, but the condition is true only in development.
    // Therefore if the branch is still here, dead code elimination wasn't
    // properly applied.
    // Don't change the message. React DevTools relies on it. Also make sure
    // this message doesn't occur elsewhere in this function, or it will cause
    // a false positive.
    throw new Error('^_^');
  }
  try {
    // Verify that the code above has been dead code eliminated (DCE'd).
    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  } catch (err) {
    // DevTools shouldn't crash React, no matter what.
    // We should still report in case we break this code.
    console.error(err);
  }
}

if (false) {} else {
  module.exports = __nested_webpack_require_1176022__(/*! ./cjs/react-dom.development.js */ "../../../../node_modules/react-dom/cjs/react-dom.development.js");
}


/***/ }),

/***/ "../../../../node_modules/react/cjs/react-jsx-runtime.development.js":
/*!***************************************************************************!*\
  !*** ../../../../node_modules/react/cjs/react-jsx-runtime.development.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_1177596__) => {

"use strict";
/** @license React v17.0.2
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var React = __nested_webpack_require_1177596__(/*! react */ "../../../../node_modules/react/index.js");
var _assign = __nested_webpack_require_1177596__(/*! object-assign */ "../../../../node_modules/object-assign/index.js");

// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
exports.Fragment = 0xeacb;
var REACT_STRICT_MODE_TYPE = 0xeacc;
var REACT_PROFILER_TYPE = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
var REACT_SUSPENSE_TYPE = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_BLOCK_TYPE = 0xead9;
var REACT_SERVER_BLOCK_TYPE = 0xeada;
var REACT_FUNDAMENTAL_TYPE = 0xead5;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;

if (typeof Symbol === 'function' && Symbol.for) {
  var symbolFor = Symbol.for;
  REACT_ELEMENT_TYPE = symbolFor('react.element');
  REACT_PORTAL_TYPE = symbolFor('react.portal');
  exports.Fragment = symbolFor('react.fragment');
  REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
  REACT_PROFILER_TYPE = symbolFor('react.profiler');
  REACT_PROVIDER_TYPE = symbolFor('react.provider');
  REACT_CONTEXT_TYPE = symbolFor('react.context');
  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
  REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
  REACT_MEMO_TYPE = symbolFor('react.memo');
  REACT_LAZY_TYPE = symbolFor('react.lazy');
  REACT_BLOCK_TYPE = symbolFor('react.block');
  REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
  REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
  REACT_SCOPE_TYPE = symbolFor('react.scope');
  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
}

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }

  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];

  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }

  return null;
}

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

function error(format) {
  {
    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      args[_key2 - 1] = arguments[_key2];
    }

    printWarning('error', format, args);
  }
}

function printWarning(level, format, args) {
  // When changing this logic, you might want to also
  // update consoleWithStackDev.www.js as well.
  {
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();

    if (stack !== '') {
      format += '%s';
      args = args.concat([stack]);
    }

    var argsWithFormat = args.map(function (item) {
      return '' + item;
    }); // Careful: RN currently depends on this prefix

    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
    // breaks IE9: https://github.com/facebook/react/issues/13610
    // eslint-disable-next-line react-internal/no-production-logging

    Function.prototype.apply.call(console[level], console, argsWithFormat);
  }
}

// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.

var enableScopeAPI = false; // Experimental Create Event Handle API.

function isValidElementType(type) {
  if (typeof type === 'string' || typeof type === 'function') {
    return true;
  } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).


  if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
    return true;
  }

  if (typeof type === 'object' && type !== null) {
    if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
      return true;
    }
  }

  return false;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
}

function getContextName(type) {
  return type.displayName || 'Context';
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }

  {
    if (typeof type.tag === 'number') {
      error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }

  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }

  if (typeof type === 'string') {
    return type;
  }

  switch (type) {
    case exports.Fragment:
      return 'Fragment';

    case REACT_PORTAL_TYPE:
      return 'Portal';

    case REACT_PROFILER_TYPE:
      return 'Profiler';

    case REACT_STRICT_MODE_TYPE:
      return 'StrictMode';

    case REACT_SUSPENSE_TYPE:
      return 'Suspense';

    case REACT_SUSPENSE_LIST_TYPE:
      return 'SuspenseList';
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        var context = type;
        return getContextName(context) + '.Consumer';

      case REACT_PROVIDER_TYPE:
        var provider = type;
        return getContextName(provider._context) + '.Provider';

      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');

      case REACT_MEMO_TYPE:
        return getComponentName(type.type);

      case REACT_BLOCK_TYPE:
        return getComponentName(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            return getComponentName(init(payload));
          } catch (x) {
            return null;
          }
        }
    }
  }

  return null;
}

// Helpers to patch console.logs to avoid logging during side-effect free
// replaying on render function. This currently only patches the object
// lazily which won't cover if the log function was extracted eagerly.
// We could also eagerly patch the method.
var disabledDepth = 0;
var prevLog;
var prevInfo;
var prevWarn;
var prevError;
var prevGroup;
var prevGroupCollapsed;
var prevGroupEnd;

function disabledLog() {}

disabledLog.__reactDisabledLog = true;
function disableLogs() {
  {
    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      prevLog = console.log;
      prevInfo = console.info;
      prevWarn = console.warn;
      prevError = console.error;
      prevGroup = console.group;
      prevGroupCollapsed = console.groupCollapsed;
      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099

      var props = {
        configurable: true,
        enumerable: true,
        value: disabledLog,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        info: props,
        log: props,
        warn: props,
        error: props,
        group: props,
        groupCollapsed: props,
        groupEnd: props
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    disabledDepth++;
  }
}
function reenableLogs() {
  {
    disabledDepth--;

    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      var props = {
        configurable: true,
        enumerable: true,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        log: _assign({}, props, {
          value: prevLog
        }),
        info: _assign({}, props, {
          value: prevInfo
        }),
        warn: _assign({}, props, {
          value: prevWarn
        }),
        error: _assign({}, props, {
          value: prevError
        }),
        group: _assign({}, props, {
          value: prevGroup
        }),
        groupCollapsed: _assign({}, props, {
          value: prevGroupCollapsed
        }),
        groupEnd: _assign({}, props, {
          value: prevGroupEnd
        })
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    if (disabledDepth < 0) {
      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
    }
  }
}

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name, source, ownerFn) {
  {
    if (prefix === undefined) {
      // Extract the VM specific prefix used by each line.
      try {
        throw Error();
      } catch (x) {
        var match = x.stack.trim().match(/\n( *(at )?)/);
        prefix = match && match[1] || '';
      }
    } // We use the prefix to ensure our stacks line up with native stack frames.


    return '\n' + prefix + name;
  }
}
var reentry = false;
var componentFrameCache;

{
  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
  componentFrameCache = new PossiblyWeakMap();
}

function describeNativeComponentFrame(fn, construct) {
  // If something asked for a stack inside a fake render, it should get ignored.
  if (!fn || reentry) {
    return '';
  }

  {
    var frame = componentFrameCache.get(fn);

    if (frame !== undefined) {
      return frame;
    }
  }

  var control;
  reentry = true;
  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.

  Error.prepareStackTrace = undefined;
  var previousDispatcher;

  {
    previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
    // for warnings.

    ReactCurrentDispatcher.current = null;
    disableLogs();
  }

  try {
    // This should throw.
    if (construct) {
      // Something should be setting the props in the constructor.
      var Fake = function () {
        throw Error();
      }; // $FlowFixMe


      Object.defineProperty(Fake.prototype, 'props', {
        set: function () {
          // We use a throwing setter instead of frozen or non-writable props
          // because that won't throw in a non-strict mode function.
          throw Error();
        }
      });

      if (typeof Reflect === 'object' && Reflect.construct) {
        // We construct a different control for this case to include any extra
        // frames added by the construct call.
        try {
          Reflect.construct(Fake, []);
        } catch (x) {
          control = x;
        }

        Reflect.construct(fn, [], Fake);
      } else {
        try {
          Fake.call();
        } catch (x) {
          control = x;
        }

        fn.call(Fake.prototype);
      }
    } else {
      try {
        throw Error();
      } catch (x) {
        control = x;
      }

      fn();
    }
  } catch (sample) {
    // This is inlined manually because closure doesn't do it for us.
    if (sample && control && typeof sample.stack === 'string') {
      // This extracts the first frame from the sample that isn't also in the control.
      // Skipping one frame that we assume is the frame that calls the two.
      var sampleLines = sample.stack.split('\n');
      var controlLines = control.stack.split('\n');
      var s = sampleLines.length - 1;
      var c = controlLines.length - 1;

      while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
        // We expect at least one stack frame to be shared.
        // Typically this will be the root most one. However, stack frames may be
        // cut off due to maximum stack limits. In this case, one maybe cut off
        // earlier than the other. We assume that the sample is longer or the same
        // and there for cut off earlier. So we should find the root most frame in
        // the sample somewhere in the control.
        c--;
      }

      for (; s >= 1 && c >= 0; s--, c--) {
        // Next we find the first one that isn't the same which should be the
        // frame that called our sample function and the control.
        if (sampleLines[s] !== controlLines[c]) {
          // In V8, the first line is describing the message but other VMs don't.
          // If we're about to return the first line, and the control is also on the same
          // line, that's a pretty good indicator that our sample threw at same line as
          // the control. I.e. before we entered the sample frame. So we ignore this result.
          // This can happen if you passed a class to function component, or non-function.
          if (s !== 1 || c !== 1) {
            do {
              s--;
              c--; // We may still have similar intermediate frames from the construct call.
              // The next one that isn't the same should be our match though.

              if (c < 0 || sampleLines[s] !== controlLines[c]) {
                // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
                var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');

                {
                  if (typeof fn === 'function') {
                    componentFrameCache.set(fn, _frame);
                  }
                } // Return the line we found.


                return _frame;
              }
            } while (s >= 1 && c >= 0);
          }

          break;
        }
      }
    }
  } finally {
    reentry = false;

    {
      ReactCurrentDispatcher.current = previousDispatcher;
      reenableLogs();
    }

    Error.prepareStackTrace = previousPrepareStackTrace;
  } // Fallback to just using the name if we couldn't make it throw.


  var name = fn ? fn.displayName || fn.name : '';
  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';

  {
    if (typeof fn === 'function') {
      componentFrameCache.set(fn, syntheticFrame);
    }
  }

  return syntheticFrame;
}
function describeFunctionComponentFrame(fn, source, ownerFn) {
  {
    return describeNativeComponentFrame(fn, false);
  }
}

function shouldConstruct(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {

  if (type == null) {
    return '';
  }

  if (typeof type === 'function') {
    {
      return describeNativeComponentFrame(type, shouldConstruct(type));
    }
  }

  if (typeof type === 'string') {
    return describeBuiltInComponentFrame(type);
  }

  switch (type) {
    case REACT_SUSPENSE_TYPE:
      return describeBuiltInComponentFrame('Suspense');

    case REACT_SUSPENSE_LIST_TYPE:
      return describeBuiltInComponentFrame('SuspenseList');
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_FORWARD_REF_TYPE:
        return describeFunctionComponentFrame(type.render);

      case REACT_MEMO_TYPE:
        // Memo may contain any component type so we recursively resolve it.
        return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);

      case REACT_BLOCK_TYPE:
        return describeFunctionComponentFrame(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            // Lazy may contain any component type so we recursively resolve it.
            return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
          } catch (x) {}
        }
    }
  }

  return '';
}

var loggedTypeFailures = {};
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame.setExtraStackFrame(null);
    }
  }
}

function checkPropTypes(typeSpecs, values, location, componentName, element) {
  {
    // $FlowFixMe This is okay but Flow doesn't know it.
    var has = Function.call.bind(Object.prototype.hasOwnProperty);

    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.

        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
            err.name = 'Invariant Violation';
            throw err;
          }

          error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
        } catch (ex) {
          error$1 = ex;
        }

        if (error$1 && !(error$1 instanceof Error)) {
          setCurrentlyValidatingElement(element);

          error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);

          setCurrentlyValidatingElement(null);
        }

        if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error$1.message] = true;
          setCurrentlyValidatingElement(element);

          error('Failed %s type: %s', location, error$1.message);

          setCurrentlyValidatingElement(null);
        }
      }
    }
  }
}

var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var RESERVED_PROPS = {
  key: true,
  ref: true,
  __self: true,
  __source: true
};
var specialPropKeyWarningShown;
var specialPropRefWarningShown;
var didWarnAboutStringRefs;

{
  didWarnAboutStringRefs = {};
}

function hasValidRef(config) {
  {
    if (hasOwnProperty.call(config, 'ref')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.ref !== undefined;
}

function hasValidKey(config) {
  {
    if (hasOwnProperty.call(config, 'key')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.key !== undefined;
}

function warnIfStringRefCannotBeAutoConverted(config, self) {
  {
    if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
      var componentName = getComponentName(ReactCurrentOwner.current.type);

      if (!didWarnAboutStringRefs[componentName]) {
        error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);

        didWarnAboutStringRefs[componentName] = true;
      }
    }
  }
}

function defineKeyPropWarningGetter(props, displayName) {
  {
    var warnAboutAccessingKey = function () {
      if (!specialPropKeyWarningShown) {
        specialPropKeyWarningShown = true;

        error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    };

    warnAboutAccessingKey.isReactWarning = true;
    Object.defineProperty(props, 'key', {
      get: warnAboutAccessingKey,
      configurable: true
    });
  }
}

function defineRefPropWarningGetter(props, displayName) {
  {
    var warnAboutAccessingRef = function () {
      if (!specialPropRefWarningShown) {
        specialPropRefWarningShown = true;

        error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    };

    warnAboutAccessingRef.isReactWarning = true;
    Object.defineProperty(props, 'ref', {
      get: warnAboutAccessingRef,
      configurable: true
    });
  }
}
/**
 * Factory method to create a new React element. This no longer adheres to
 * the class pattern, so do not use new to call it. Also, instanceof check
 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
 * if something is a React Element.
 *
 * @param {*} type
 * @param {*} props
 * @param {*} key
 * @param {string|object} ref
 * @param {*} owner
 * @param {*} self A *temporary* helper to detect places where `this` is
 * different from the `owner` when React.createElement is called, so that we
 * can warn. We want to get rid of owner and replace string `ref`s with arrow
 * functions, and as long as `this` and owner are the same, there will be no
 * change in behavior.
 * @param {*} source An annotation object (added by a transpiler or otherwise)
 * indicating filename, line number, and/or other information.
 * @internal
 */


var ReactElement = function (type, key, ref, self, source, owner, props) {
  var element = {
    // This tag allows us to uniquely identify this as a React Element
    $$typeof: REACT_ELEMENT_TYPE,
    // Built-in properties that belong on the element
    type: type,
    key: key,
    ref: ref,
    props: props,
    // Record the component responsible for creating this element.
    _owner: owner
  };

  {
    // The validation flag is currently mutative. We put it on
    // an external backing store so that we can freeze the whole object.
    // This can be replaced with a WeakMap once they are implemented in
    // commonly used development environments.
    element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
    // the validation flag non-enumerable (where possible, which should
    // include every environment we run tests in), so the test framework
    // ignores it.

    Object.defineProperty(element._store, 'validated', {
      configurable: false,
      enumerable: false,
      writable: true,
      value: false
    }); // self and source are DEV only properties.

    Object.defineProperty(element, '_self', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: self
    }); // Two elements created in two different places should be considered
    // equal for testing purposes and therefore we hide it from enumeration.

    Object.defineProperty(element, '_source', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: source
    });

    if (Object.freeze) {
      Object.freeze(element.props);
      Object.freeze(element);
    }
  }

  return element;
};
/**
 * https://github.com/reactjs/rfcs/pull/107
 * @param {*} type
 * @param {object} props
 * @param {string} key
 */

function jsxDEV(type, config, maybeKey, source, self) {
  {
    var propName; // Reserved names are extracted

    var props = {};
    var key = null;
    var ref = null; // Currently, key can be spread in as a prop. This causes a potential
    // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
    // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
    // but as an intermediary step, we will use jsxDEV for everything except
    // <div {...props} key="Hi" />, because we aren't currently able to tell if
    // key is explicitly declared to be undefined or not.

    if (maybeKey !== undefined) {
      key = '' + maybeKey;
    }

    if (hasValidKey(config)) {
      key = '' + config.key;
    }

    if (hasValidRef(config)) {
      ref = config.ref;
      warnIfStringRefCannotBeAutoConverted(config, self);
    } // Remaining properties are added to a new props object


    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        props[propName] = config[propName];
      }
    } // Resolve default props


    if (type && type.defaultProps) {
      var defaultProps = type.defaultProps;

      for (propName in defaultProps) {
        if (props[propName] === undefined) {
          props[propName] = defaultProps[propName];
        }
      }
    }

    if (key || ref) {
      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;

      if (key) {
        defineKeyPropWarningGetter(props, displayName);
      }

      if (ref) {
        defineRefPropWarningGetter(props, displayName);
      }
    }

    return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  }
}

var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement$1(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame$1.setExtraStackFrame(null);
    }
  }
}

var propTypesMisspellWarningShown;

{
  propTypesMisspellWarningShown = false;
}
/**
 * Verifies the object is a ReactElement.
 * See https://reactjs.org/docs/react-api.html#isvalidelement
 * @param {?object} object
 * @return {boolean} True if `object` is a ReactElement.
 * @final
 */

function isValidElement(object) {
  {
    return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  }
}

function getDeclarationErrorAddendum() {
  {
    if (ReactCurrentOwner$1.current) {
      var name = getComponentName(ReactCurrentOwner$1.current.type);

      if (name) {
        return '\n\nCheck the render method of `' + name + '`.';
      }
    }

    return '';
  }
}

function getSourceInfoErrorAddendum(source) {
  {
    if (source !== undefined) {
      var fileName = source.fileName.replace(/^.*[\\\/]/, '');
      var lineNumber = source.lineNumber;
      return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
    }

    return '';
  }
}
/**
 * Warn if there's no key explicitly set on dynamic arrays of children or
 * object keys are not valid. This allows us to keep track of children between
 * updates.
 */


var ownerHasKeyUseWarning = {};

function getCurrentComponentErrorInfo(parentType) {
  {
    var info = getDeclarationErrorAddendum();

    if (!info) {
      var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;

      if (parentName) {
        info = "\n\nCheck the top-level render call using <" + parentName + ">.";
      }
    }

    return info;
  }
}
/**
 * Warn if the element doesn't have an explicit key assigned to it.
 * This element is in an array. The array could grow and shrink or be
 * reordered. All children that haven't already been validated are required to
 * have a "key" property assigned to it. Error statuses are cached so a warning
 * will only be shown once.
 *
 * @internal
 * @param {ReactElement} element Element that requires a key.
 * @param {*} parentType element's parent's type.
 */


function validateExplicitKey(element, parentType) {
  {
    if (!element._store || element._store.validated || element.key != null) {
      return;
    }

    element._store.validated = true;
    var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);

    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
      return;
    }

    ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
    // property, it may be the creator of the child that's responsible for
    // assigning it a key.

    var childOwner = '';

    if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
      // Give the component that originally created this child.
      childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
    }

    setCurrentlyValidatingElement$1(element);

    error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);

    setCurrentlyValidatingElement$1(null);
  }
}
/**
 * Ensure that every element either is passed in a static location, in an
 * array with an explicit keys property defined, or in an object literal
 * with valid key property.
 *
 * @internal
 * @param {ReactNode} node Statically passed child of any type.
 * @param {*} parentType node's parent's type.
 */


function validateChildKeys(node, parentType) {
  {
    if (typeof node !== 'object') {
      return;
    }

    if (Array.isArray(node)) {
      for (var i = 0; i < node.length; i++) {
        var child = node[i];

        if (isValidElement(child)) {
          validateExplicitKey(child, parentType);
        }
      }
    } else if (isValidElement(node)) {
      // This element was passed in a valid location.
      if (node._store) {
        node._store.validated = true;
      }
    } else if (node) {
      var iteratorFn = getIteratorFn(node);

      if (typeof iteratorFn === 'function') {
        // Entry iterators used to provide implicit keys,
        // but now we print a separate warning for them later.
        if (iteratorFn !== node.entries) {
          var iterator = iteratorFn.call(node);
          var step;

          while (!(step = iterator.next()).done) {
            if (isValidElement(step.value)) {
              validateExplicitKey(step.value, parentType);
            }
          }
        }
      }
    }
  }
}
/**
 * Given an element, validate that its props follow the propTypes definition,
 * provided by the type.
 *
 * @param {ReactElement} element
 */


function validatePropTypes(element) {
  {
    var type = element.type;

    if (type === null || type === undefined || typeof type === 'string') {
      return;
    }

    var propTypes;

    if (typeof type === 'function') {
      propTypes = type.propTypes;
    } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
    // Inner props are checked in the reconciler.
    type.$$typeof === REACT_MEMO_TYPE)) {
      propTypes = type.propTypes;
    } else {
      return;
    }

    if (propTypes) {
      // Intentionally inside to avoid triggering lazy initializers:
      var name = getComponentName(type);
      checkPropTypes(propTypes, element.props, 'prop', name, element);
    } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
      propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:

      var _name = getComponentName(type);

      error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
    }

    if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
      error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
    }
  }
}
/**
 * Given a fragment, validate that it can only be provided with fragment props
 * @param {ReactElement} fragment
 */


function validateFragmentProps(fragment) {
  {
    var keys = Object.keys(fragment.props);

    for (var i = 0; i < keys.length; i++) {
      var key = keys[i];

      if (key !== 'children' && key !== 'key') {
        setCurrentlyValidatingElement$1(fragment);

        error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);

        setCurrentlyValidatingElement$1(null);
        break;
      }
    }

    if (fragment.ref !== null) {
      setCurrentlyValidatingElement$1(fragment);

      error('Invalid attribute `ref` supplied to `React.Fragment`.');

      setCurrentlyValidatingElement$1(null);
    }
  }
}

function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
  {
    var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
    // succeed and there will likely be errors in render.

    if (!validType) {
      var info = '';

      if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
        info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
      }

      var sourceInfo = getSourceInfoErrorAddendum(source);

      if (sourceInfo) {
        info += sourceInfo;
      } else {
        info += getDeclarationErrorAddendum();
      }

      var typeString;

      if (type === null) {
        typeString = 'null';
      } else if (Array.isArray(type)) {
        typeString = 'array';
      } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
        typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
        info = ' Did you accidentally export a JSX literal instead of a component?';
      } else {
        typeString = typeof type;
      }

      error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
    }

    var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
    // TODO: Drop this when these are no longer allowed as the type argument.

    if (element == null) {
      return element;
    } // Skip key warning if the type isn't valid since our key validation logic
    // doesn't expect a non-string/function type and can throw confusing errors.
    // We don't want exception behavior to differ between dev and prod.
    // (Rendering will throw with a helpful message and as soon as the type is
    // fixed, the key warnings will appear.)


    if (validType) {
      var children = props.children;

      if (children !== undefined) {
        if (isStaticChildren) {
          if (Array.isArray(children)) {
            for (var i = 0; i < children.length; i++) {
              validateChildKeys(children[i], type);
            }

            if (Object.freeze) {
              Object.freeze(children);
            }
          } else {
            error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
          }
        } else {
          validateChildKeys(children, type);
        }
      }
    }

    if (type === exports.Fragment) {
      validateFragmentProps(element);
    } else {
      validatePropTypes(element);
    }

    return element;
  }
} // These two functions exist to still get child warnings in dev
// even with the prod transform. This means that jsxDEV is purely
// opt-in behavior for better messages but that we won't stop
// giving you warnings if you use production apis.

function jsxWithValidationStatic(type, props, key) {
  {
    return jsxWithValidation(type, props, key, true);
  }
}
function jsxWithValidationDynamic(type, props, key) {
  {
    return jsxWithValidation(type, props, key, false);
  }
}

var jsx =  jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
// for now we can ship identical prod functions

var jsxs =  jsxWithValidationStatic ;

exports.jsx = jsx;
exports.jsxs = jsxs;
  })();
}


/***/ }),

/***/ "../../../../node_modules/react/cjs/react.development.js":
/*!***************************************************************!*\
  !*** ../../../../node_modules/react/cjs/react.development.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_1216395__) => {

"use strict";
/** @license React v17.0.2
 * react.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var _assign = __nested_webpack_require_1216395__(/*! object-assign */ "../../../../node_modules/object-assign/index.js");

// TODO: this is special because it gets imported during build.
var ReactVersion = '17.0.2';

// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
exports.Fragment = 0xeacb;
exports.StrictMode = 0xeacc;
exports.Profiler = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
exports.Suspense = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_BLOCK_TYPE = 0xead9;
var REACT_SERVER_BLOCK_TYPE = 0xeada;
var REACT_FUNDAMENTAL_TYPE = 0xead5;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;

if (typeof Symbol === 'function' && Symbol.for) {
  var symbolFor = Symbol.for;
  REACT_ELEMENT_TYPE = symbolFor('react.element');
  REACT_PORTAL_TYPE = symbolFor('react.portal');
  exports.Fragment = symbolFor('react.fragment');
  exports.StrictMode = symbolFor('react.strict_mode');
  exports.Profiler = symbolFor('react.profiler');
  REACT_PROVIDER_TYPE = symbolFor('react.provider');
  REACT_CONTEXT_TYPE = symbolFor('react.context');
  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
  exports.Suspense = symbolFor('react.suspense');
  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
  REACT_MEMO_TYPE = symbolFor('react.memo');
  REACT_LAZY_TYPE = symbolFor('react.lazy');
  REACT_BLOCK_TYPE = symbolFor('react.block');
  REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
  REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
  REACT_SCOPE_TYPE = symbolFor('react.scope');
  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
}

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }

  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];

  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }

  return null;
}

/**
 * Keeps track of the current dispatcher.
 */
var ReactCurrentDispatcher = {
  /**
   * @internal
   * @type {ReactComponent}
   */
  current: null
};

/**
 * Keeps track of the current batch's configuration such as how long an update
 * should suspend for if it needs to.
 */
var ReactCurrentBatchConfig = {
  transition: 0
};

/**
 * Keeps track of the current owner.
 *
 * The current owner is the component who should own any components that are
 * currently being constructed.
 */
var ReactCurrentOwner = {
  /**
   * @internal
   * @type {ReactComponent}
   */
  current: null
};

var ReactDebugCurrentFrame = {};
var currentExtraStackFrame = null;
function setExtraStackFrame(stack) {
  {
    currentExtraStackFrame = stack;
  }
}

{
  ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
    {
      currentExtraStackFrame = stack;
    }
  }; // Stack implementation injected by the current renderer.


  ReactDebugCurrentFrame.getCurrentStack = null;

  ReactDebugCurrentFrame.getStackAddendum = function () {
    var stack = ''; // Add an extra top frame while an element is being validated

    if (currentExtraStackFrame) {
      stack += currentExtraStackFrame;
    } // Delegate to the injected renderer-specific implementation


    var impl = ReactDebugCurrentFrame.getCurrentStack;

    if (impl) {
      stack += impl() || '';
    }

    return stack;
  };
}

/**
 * Used by act() to track whether you're inside an act() scope.
 */
var IsSomeRendererActing = {
  current: false
};

var ReactSharedInternals = {
  ReactCurrentDispatcher: ReactCurrentDispatcher,
  ReactCurrentBatchConfig: ReactCurrentBatchConfig,
  ReactCurrentOwner: ReactCurrentOwner,
  IsSomeRendererActing: IsSomeRendererActing,
  // Used by renderers to avoid bundling object-assign twice in UMD bundles:
  assign: _assign
};

{
  ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
}

// by calls to these methods by a Babel plugin.
//
// In PROD (or in packages without access to React internals),
// they are left as they are instead.

function warn(format) {
  {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    printWarning('warn', format, args);
  }
}
function error(format) {
  {
    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      args[_key2 - 1] = arguments[_key2];
    }

    printWarning('error', format, args);
  }
}

function printWarning(level, format, args) {
  // When changing this logic, you might want to also
  // update consoleWithStackDev.www.js as well.
  {
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();

    if (stack !== '') {
      format += '%s';
      args = args.concat([stack]);
    }

    var argsWithFormat = args.map(function (item) {
      return '' + item;
    }); // Careful: RN currently depends on this prefix

    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
    // breaks IE9: https://github.com/facebook/react/issues/13610
    // eslint-disable-next-line react-internal/no-production-logging

    Function.prototype.apply.call(console[level], console, argsWithFormat);
  }
}

var didWarnStateUpdateForUnmountedComponent = {};

function warnNoop(publicInstance, callerName) {
  {
    var _constructor = publicInstance.constructor;
    var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
    var warningKey = componentName + "." + callerName;

    if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
      return;
    }

    error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);

    didWarnStateUpdateForUnmountedComponent[warningKey] = true;
  }
}
/**
 * This is the abstract API for an update queue.
 */


var ReactNoopUpdateQueue = {
  /**
   * Checks whether or not this composite component is mounted.
   * @param {ReactClass} publicInstance The instance we want to test.
   * @return {boolean} True if mounted, false otherwise.
   * @protected
   * @final
   */
  isMounted: function (publicInstance) {
    return false;
  },

  /**
   * Forces an update. This should only be invoked when it is known with
   * certainty that we are **not** in a DOM transaction.
   *
   * You may want to call this when you know that some deeper aspect of the
   * component's state has changed but `setState` was not called.
   *
   * This will not invoke `shouldComponentUpdate`, but it will invoke
   * `componentWillUpdate` and `componentDidUpdate`.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {?function} callback Called after component is updated.
   * @param {?string} callerName name of the calling function in the public API.
   * @internal
   */
  enqueueForceUpdate: function (publicInstance, callback, callerName) {
    warnNoop(publicInstance, 'forceUpdate');
  },

  /**
   * Replaces all of the state. Always use this or `setState` to mutate state.
   * You should treat `this.state` as immutable.
   *
   * There is no guarantee that `this.state` will be immediately updated, so
   * accessing `this.state` after calling this method may return the old value.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {object} completeState Next state.
   * @param {?function} callback Called after component is updated.
   * @param {?string} callerName name of the calling function in the public API.
   * @internal
   */
  enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
    warnNoop(publicInstance, 'replaceState');
  },

  /**
   * Sets a subset of the state. This only exists because _pendingState is
   * internal. This provides a merging strategy that is not available to deep
   * properties which is confusing. TODO: Expose pendingState or don't use it
   * during the merge.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {object} partialState Next partial state to be merged with state.
   * @param {?function} callback Called after component is updated.
   * @param {?string} Name of the calling function in the public API.
   * @internal
   */
  enqueueSetState: function (publicInstance, partialState, callback, callerName) {
    warnNoop(publicInstance, 'setState');
  }
};

var emptyObject = {};

{
  Object.freeze(emptyObject);
}
/**
 * Base class helpers for the updating state of a component.
 */


function Component(props, context, updater) {
  this.props = props;
  this.context = context; // If a component has string refs, we will assign a different object later.

  this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
  // renderer.

  this.updater = updater || ReactNoopUpdateQueue;
}

Component.prototype.isReactComponent = {};
/**
 * Sets a subset of the state. Always use this to mutate
 * state. You should treat `this.state` as immutable.
 *
 * There is no guarantee that `this.state` will be immediately updated, so
 * accessing `this.state` after calling this method may return the old value.
 *
 * There is no guarantee that calls to `setState` will run synchronously,
 * as they may eventually be batched together.  You can provide an optional
 * callback that will be executed when the call to setState is actually
 * completed.
 *
 * When a function is provided to setState, it will be called at some point in
 * the future (not synchronously). It will be called with the up to date
 * component arguments (state, props, context). These values can be different
 * from this.* because your function may be called after receiveProps but before
 * shouldComponentUpdate, and this new state, props, and context will not yet be
 * assigned to this.
 *
 * @param {object|function} partialState Next partial state or function to
 *        produce next partial state to be merged with current state.
 * @param {?function} callback Called after state is updated.
 * @final
 * @protected
 */

Component.prototype.setState = function (partialState, callback) {
  if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
    {
      throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
    }
  }

  this.updater.enqueueSetState(this, partialState, callback, 'setState');
};
/**
 * Forces an update. This should only be invoked when it is known with
 * certainty that we are **not** in a DOM transaction.
 *
 * You may want to call this when you know that some deeper aspect of the
 * component's state has changed but `setState` was not called.
 *
 * This will not invoke `shouldComponentUpdate`, but it will invoke
 * `componentWillUpdate` and `componentDidUpdate`.
 *
 * @param {?function} callback Called after update is complete.
 * @final
 * @protected
 */


Component.prototype.forceUpdate = function (callback) {
  this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
};
/**
 * Deprecated APIs. These APIs used to exist on classic React classes but since
 * we would like to deprecate them, we're not going to move them over to this
 * modern base class. Instead, we define a getter that warns if it's accessed.
 */


{
  var deprecatedAPIs = {
    isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
    replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  };

  var defineDeprecationWarning = function (methodName, info) {
    Object.defineProperty(Component.prototype, methodName, {
      get: function () {
        warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);

        return undefined;
      }
    });
  };

  for (var fnName in deprecatedAPIs) {
    if (deprecatedAPIs.hasOwnProperty(fnName)) {
      defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
    }
  }
}

function ComponentDummy() {}

ComponentDummy.prototype = Component.prototype;
/**
 * Convenience component with default shallow equality check for sCU.
 */

function PureComponent(props, context, updater) {
  this.props = props;
  this.context = context; // If a component has string refs, we will assign a different object later.

  this.refs = emptyObject;
  this.updater = updater || ReactNoopUpdateQueue;
}

var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.

_assign(pureComponentPrototype, Component.prototype);

pureComponentPrototype.isPureReactComponent = true;

// an immutable object with a single mutable value
function createRef() {
  var refObject = {
    current: null
  };

  {
    Object.seal(refObject);
  }

  return refObject;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
}

function getContextName(type) {
  return type.displayName || 'Context';
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }

  {
    if (typeof type.tag === 'number') {
      error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }

  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }

  if (typeof type === 'string') {
    return type;
  }

  switch (type) {
    case exports.Fragment:
      return 'Fragment';

    case REACT_PORTAL_TYPE:
      return 'Portal';

    case exports.Profiler:
      return 'Profiler';

    case exports.StrictMode:
      return 'StrictMode';

    case exports.Suspense:
      return 'Suspense';

    case REACT_SUSPENSE_LIST_TYPE:
      return 'SuspenseList';
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        var context = type;
        return getContextName(context) + '.Consumer';

      case REACT_PROVIDER_TYPE:
        var provider = type;
        return getContextName(provider._context) + '.Provider';

      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');

      case REACT_MEMO_TYPE:
        return getComponentName(type.type);

      case REACT_BLOCK_TYPE:
        return getComponentName(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            return getComponentName(init(payload));
          } catch (x) {
            return null;
          }
        }
    }
  }

  return null;
}

var hasOwnProperty = Object.prototype.hasOwnProperty;
var RESERVED_PROPS = {
  key: true,
  ref: true,
  __self: true,
  __source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;

{
  didWarnAboutStringRefs = {};
}

function hasValidRef(config) {
  {
    if (hasOwnProperty.call(config, 'ref')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.ref !== undefined;
}

function hasValidKey(config) {
  {
    if (hasOwnProperty.call(config, 'key')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.key !== undefined;
}

function defineKeyPropWarningGetter(props, displayName) {
  var warnAboutAccessingKey = function () {
    {
      if (!specialPropKeyWarningShown) {
        specialPropKeyWarningShown = true;

        error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    }
  };

  warnAboutAccessingKey.isReactWarning = true;
  Object.defineProperty(props, 'key', {
    get: warnAboutAccessingKey,
    configurable: true
  });
}

function defineRefPropWarningGetter(props, displayName) {
  var warnAboutAccessingRef = function () {
    {
      if (!specialPropRefWarningShown) {
        specialPropRefWarningShown = true;

        error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    }
  };

  warnAboutAccessingRef.isReactWarning = true;
  Object.defineProperty(props, 'ref', {
    get: warnAboutAccessingRef,
    configurable: true
  });
}

function warnIfStringRefCannotBeAutoConverted(config) {
  {
    if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
      var componentName = getComponentName(ReactCurrentOwner.current.type);

      if (!didWarnAboutStringRefs[componentName]) {
        error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);

        didWarnAboutStringRefs[componentName] = true;
      }
    }
  }
}
/**
 * Factory method to create a new React element. This no longer adheres to
 * the class pattern, so do not use new to call it. Also, instanceof check
 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
 * if something is a React Element.
 *
 * @param {*} type
 * @param {*} props
 * @param {*} key
 * @param {string|object} ref
 * @param {*} owner
 * @param {*} self A *temporary* helper to detect places where `this` is
 * different from the `owner` when React.createElement is called, so that we
 * can warn. We want to get rid of owner and replace string `ref`s with arrow
 * functions, and as long as `this` and owner are the same, there will be no
 * change in behavior.
 * @param {*} source An annotation object (added by a transpiler or otherwise)
 * indicating filename, line number, and/or other information.
 * @internal
 */


var ReactElement = function (type, key, ref, self, source, owner, props) {
  var element = {
    // This tag allows us to uniquely identify this as a React Element
    $$typeof: REACT_ELEMENT_TYPE,
    // Built-in properties that belong on the element
    type: type,
    key: key,
    ref: ref,
    props: props,
    // Record the component responsible for creating this element.
    _owner: owner
  };

  {
    // The validation flag is currently mutative. We put it on
    // an external backing store so that we can freeze the whole object.
    // This can be replaced with a WeakMap once they are implemented in
    // commonly used development environments.
    element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
    // the validation flag non-enumerable (where possible, which should
    // include every environment we run tests in), so the test framework
    // ignores it.

    Object.defineProperty(element._store, 'validated', {
      configurable: false,
      enumerable: false,
      writable: true,
      value: false
    }); // self and source are DEV only properties.

    Object.defineProperty(element, '_self', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: self
    }); // Two elements created in two different places should be considered
    // equal for testing purposes and therefore we hide it from enumeration.

    Object.defineProperty(element, '_source', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: source
    });

    if (Object.freeze) {
      Object.freeze(element.props);
      Object.freeze(element);
    }
  }

  return element;
};
/**
 * Create and return a new ReactElement of the given type.
 * See https://reactjs.org/docs/react-api.html#createelement
 */

function createElement(type, config, children) {
  var propName; // Reserved names are extracted

  var props = {};
  var key = null;
  var ref = null;
  var self = null;
  var source = null;

  if (config != null) {
    if (hasValidRef(config)) {
      ref = config.ref;

      {
        warnIfStringRefCannotBeAutoConverted(config);
      }
    }

    if (hasValidKey(config)) {
      key = '' + config.key;
    }

    self = config.__self === undefined ? null : config.__self;
    source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object

    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        props[propName] = config[propName];
      }
    }
  } // Children can be more than one argument, and those are transferred onto
  // the newly allocated props object.


  var childrenLength = arguments.length - 2;

  if (childrenLength === 1) {
    props.children = children;
  } else if (childrenLength > 1) {
    var childArray = Array(childrenLength);

    for (var i = 0; i < childrenLength; i++) {
      childArray[i] = arguments[i + 2];
    }

    {
      if (Object.freeze) {
        Object.freeze(childArray);
      }
    }

    props.children = childArray;
  } // Resolve default props


  if (type && type.defaultProps) {
    var defaultProps = type.defaultProps;

    for (propName in defaultProps) {
      if (props[propName] === undefined) {
        props[propName] = defaultProps[propName];
      }
    }
  }

  {
    if (key || ref) {
      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;

      if (key) {
        defineKeyPropWarningGetter(props, displayName);
      }

      if (ref) {
        defineRefPropWarningGetter(props, displayName);
      }
    }
  }

  return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
}
function cloneAndReplaceKey(oldElement, newKey) {
  var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
  return newElement;
}
/**
 * Clone and return a new ReactElement using element as the starting point.
 * See https://reactjs.org/docs/react-api.html#cloneelement
 */

function cloneElement(element, config, children) {
  if (!!(element === null || element === undefined)) {
    {
      throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
    }
  }

  var propName; // Original props are copied

  var props = _assign({}, element.props); // Reserved names are extracted


  var key = element.key;
  var ref = element.ref; // Self is preserved since the owner is preserved.

  var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
  // transpiler, and the original source is probably a better indicator of the
  // true owner.

  var source = element._source; // Owner will be preserved, unless ref is overridden

  var owner = element._owner;

  if (config != null) {
    if (hasValidRef(config)) {
      // Silently steal the ref from the parent.
      ref = config.ref;
      owner = ReactCurrentOwner.current;
    }

    if (hasValidKey(config)) {
      key = '' + config.key;
    } // Remaining properties override existing props


    var defaultProps;

    if (element.type && element.type.defaultProps) {
      defaultProps = element.type.defaultProps;
    }

    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        if (config[propName] === undefined && defaultProps !== undefined) {
          // Resolve default props
          props[propName] = defaultProps[propName];
        } else {
          props[propName] = config[propName];
        }
      }
    }
  } // Children can be more than one argument, and those are transferred onto
  // the newly allocated props object.


  var childrenLength = arguments.length - 2;

  if (childrenLength === 1) {
    props.children = children;
  } else if (childrenLength > 1) {
    var childArray = Array(childrenLength);

    for (var i = 0; i < childrenLength; i++) {
      childArray[i] = arguments[i + 2];
    }

    props.children = childArray;
  }

  return ReactElement(element.type, key, ref, self, source, owner, props);
}
/**
 * Verifies the object is a ReactElement.
 * See https://reactjs.org/docs/react-api.html#isvalidelement
 * @param {?object} object
 * @return {boolean} True if `object` is a ReactElement.
 * @final
 */

function isValidElement(object) {
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}

var SEPARATOR = '.';
var SUBSEPARATOR = ':';
/**
 * Escape and wrap key so it is safe to use as a reactid
 *
 * @param {string} key to be escaped.
 * @return {string} the escaped key.
 */

function escape(key) {
  var escapeRegex = /[=:]/g;
  var escaperLookup = {
    '=': '=0',
    ':': '=2'
  };
  var escapedString = key.replace(escapeRegex, function (match) {
    return escaperLookup[match];
  });
  return '$' + escapedString;
}
/**
 * TODO: Test that a single child and an array with one item have the same key
 * pattern.
 */


var didWarnAboutMaps = false;
var userProvidedKeyEscapeRegex = /\/+/g;

function escapeUserProvidedKey(text) {
  return text.replace(userProvidedKeyEscapeRegex, '$&/');
}
/**
 * Generate a key string that identifies a element within a set.
 *
 * @param {*} element A element that could contain a manual key.
 * @param {number} index Index that is used if a manual key is not provided.
 * @return {string}
 */


function getElementKey(element, index) {
  // Do some typechecking here since we call this blindly. We want to ensure
  // that we don't block potential future ES APIs.
  if (typeof element === 'object' && element !== null && element.key != null) {
    // Explicit key
    return escape('' + element.key);
  } // Implicit key determined by the index in the set


  return index.toString(36);
}

function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
  var type = typeof children;

  if (type === 'undefined' || type === 'boolean') {
    // All of the above are perceived as null.
    children = null;
  }

  var invokeCallback = false;

  if (children === null) {
    invokeCallback = true;
  } else {
    switch (type) {
      case 'string':
      case 'number':
        invokeCallback = true;
        break;

      case 'object':
        switch (children.$$typeof) {
          case REACT_ELEMENT_TYPE:
          case REACT_PORTAL_TYPE:
            invokeCallback = true;
        }

    }
  }

  if (invokeCallback) {
    var _child = children;
    var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
    // so that it's consistent if the number of children grows:

    var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;

    if (Array.isArray(mappedChild)) {
      var escapedChildKey = '';

      if (childKey != null) {
        escapedChildKey = escapeUserProvidedKey(childKey) + '/';
      }

      mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
        return c;
      });
    } else if (mappedChild != null) {
      if (isValidElement(mappedChild)) {
        mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
        // traverseAllChildren used to do for objects as children
        escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
        mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
        escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
      }

      array.push(mappedChild);
    }

    return 1;
  }

  var child;
  var nextName;
  var subtreeCount = 0; // Count of children found in the current subtree.

  var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;

  if (Array.isArray(children)) {
    for (var i = 0; i < children.length; i++) {
      child = children[i];
      nextName = nextNamePrefix + getElementKey(child, i);
      subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
    }
  } else {
    var iteratorFn = getIteratorFn(children);

    if (typeof iteratorFn === 'function') {
      var iterableChildren = children;

      {
        // Warn about using Maps as children
        if (iteratorFn === iterableChildren.entries) {
          if (!didWarnAboutMaps) {
            warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
          }

          didWarnAboutMaps = true;
        }
      }

      var iterator = iteratorFn.call(iterableChildren);
      var step;
      var ii = 0;

      while (!(step = iterator.next()).done) {
        child = step.value;
        nextName = nextNamePrefix + getElementKey(child, ii++);
        subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
      }
    } else if (type === 'object') {
      var childrenString = '' + children;

      {
        {
          throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." );
        }
      }
    }
  }

  return subtreeCount;
}

/**
 * Maps children that are typically specified as `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenmap
 *
 * The provided mapFunction(child, index) will be called for each
 * leaf child.
 *
 * @param {?*} children Children tree container.
 * @param {function(*, int)} func The map function.
 * @param {*} context Context for mapFunction.
 * @return {object} Object containing the ordered map of results.
 */
function mapChildren(children, func, context) {
  if (children == null) {
    return children;
  }

  var result = [];
  var count = 0;
  mapIntoArray(children, result, '', '', function (child) {
    return func.call(context, child, count++);
  });
  return result;
}
/**
 * Count the number of children that are typically specified as
 * `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrencount
 *
 * @param {?*} children Children tree container.
 * @return {number} The number of children.
 */


function countChildren(children) {
  var n = 0;
  mapChildren(children, function () {
    n++; // Don't return anything
  });
  return n;
}

/**
 * Iterates through children that are typically specified as `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
 *
 * The provided forEachFunc(child, index) will be called for each
 * leaf child.
 *
 * @param {?*} children Children tree container.
 * @param {function(*, int)} forEachFunc
 * @param {*} forEachContext Context for forEachContext.
 */
function forEachChildren(children, forEachFunc, forEachContext) {
  mapChildren(children, function () {
    forEachFunc.apply(this, arguments); // Don't return anything.
  }, forEachContext);
}
/**
 * Flatten a children object (typically specified as `props.children`) and
 * return an array with appropriately re-keyed children.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
 */


function toArray(children) {
  return mapChildren(children, function (child) {
    return child;
  }) || [];
}
/**
 * Returns the first child in a collection of children and verifies that there
 * is only one child in the collection.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenonly
 *
 * The current implementation of this function assumes that a single child gets
 * passed without a wrapper, but the purpose of this helper function is to
 * abstract away the particular structure of children.
 *
 * @param {?object} children Child collection structure.
 * @return {ReactElement} The first and only `ReactElement` contained in the
 * structure.
 */


function onlyChild(children) {
  if (!isValidElement(children)) {
    {
      throw Error( "React.Children.only expected to receive a single React element child." );
    }
  }

  return children;
}

function createContext(defaultValue, calculateChangedBits) {
  if (calculateChangedBits === undefined) {
    calculateChangedBits = null;
  } else {
    {
      if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
        error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
      }
    }
  }

  var context = {
    $$typeof: REACT_CONTEXT_TYPE,
    _calculateChangedBits: calculateChangedBits,
    // As a workaround to support multiple concurrent renderers, we categorize
    // some renderers as primary and others as secondary. We only expect
    // there to be two concurrent renderers at most: React Native (primary) and
    // Fabric (secondary); React DOM (primary) and React ART (secondary).
    // Secondary renderers store their context values on separate fields.
    _currentValue: defaultValue,
    _currentValue2: defaultValue,
    // Used to track how many concurrent renderers this context currently
    // supports within in a single renderer. Such as parallel server rendering.
    _threadCount: 0,
    // These are circular
    Provider: null,
    Consumer: null
  };
  context.Provider = {
    $$typeof: REACT_PROVIDER_TYPE,
    _context: context
  };
  var hasWarnedAboutUsingNestedContextConsumers = false;
  var hasWarnedAboutUsingConsumerProvider = false;
  var hasWarnedAboutDisplayNameOnConsumer = false;

  {
    // A separate object, but proxies back to the original context object for
    // backwards compatibility. It has a different $$typeof, so we can properly
    // warn for the incorrect usage of Context as a Consumer.
    var Consumer = {
      $$typeof: REACT_CONTEXT_TYPE,
      _context: context,
      _calculateChangedBits: context._calculateChangedBits
    }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here

    Object.defineProperties(Consumer, {
      Provider: {
        get: function () {
          if (!hasWarnedAboutUsingConsumerProvider) {
            hasWarnedAboutUsingConsumerProvider = true;

            error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
          }

          return context.Provider;
        },
        set: function (_Provider) {
          context.Provider = _Provider;
        }
      },
      _currentValue: {
        get: function () {
          return context._currentValue;
        },
        set: function (_currentValue) {
          context._currentValue = _currentValue;
        }
      },
      _currentValue2: {
        get: function () {
          return context._currentValue2;
        },
        set: function (_currentValue2) {
          context._currentValue2 = _currentValue2;
        }
      },
      _threadCount: {
        get: function () {
          return context._threadCount;
        },
        set: function (_threadCount) {
          context._threadCount = _threadCount;
        }
      },
      Consumer: {
        get: function () {
          if (!hasWarnedAboutUsingNestedContextConsumers) {
            hasWarnedAboutUsingNestedContextConsumers = true;

            error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
          }

          return context.Consumer;
        }
      },
      displayName: {
        get: function () {
          return context.displayName;
        },
        set: function (displayName) {
          if (!hasWarnedAboutDisplayNameOnConsumer) {
            warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);

            hasWarnedAboutDisplayNameOnConsumer = true;
          }
        }
      }
    }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty

    context.Consumer = Consumer;
  }

  {
    context._currentRenderer = null;
    context._currentRenderer2 = null;
  }

  return context;
}

var Uninitialized = -1;
var Pending = 0;
var Resolved = 1;
var Rejected = 2;

function lazyInitializer(payload) {
  if (payload._status === Uninitialized) {
    var ctor = payload._result;
    var thenable = ctor(); // Transition to the next state.

    var pending = payload;
    pending._status = Pending;
    pending._result = thenable;
    thenable.then(function (moduleObject) {
      if (payload._status === Pending) {
        var defaultExport = moduleObject.default;

        {
          if (defaultExport === undefined) {
            error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n  ' + // Break up imports to avoid accidentally parsing them as dependencies.
            'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
          }
        } // Transition to the next state.


        var resolved = payload;
        resolved._status = Resolved;
        resolved._result = defaultExport;
      }
    }, function (error) {
      if (payload._status === Pending) {
        // Transition to the next state.
        var rejected = payload;
        rejected._status = Rejected;
        rejected._result = error;
      }
    });
  }

  if (payload._status === Resolved) {
    return payload._result;
  } else {
    throw payload._result;
  }
}

function lazy(ctor) {
  var payload = {
    // We use these fields to store the result.
    _status: -1,
    _result: ctor
  };
  var lazyType = {
    $$typeof: REACT_LAZY_TYPE,
    _payload: payload,
    _init: lazyInitializer
  };

  {
    // In production, this would just set it on the object.
    var defaultProps;
    var propTypes; // $FlowFixMe

    Object.defineProperties(lazyType, {
      defaultProps: {
        configurable: true,
        get: function () {
          return defaultProps;
        },
        set: function (newDefaultProps) {
          error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');

          defaultProps = newDefaultProps; // Match production behavior more closely:
          // $FlowFixMe

          Object.defineProperty(lazyType, 'defaultProps', {
            enumerable: true
          });
        }
      },
      propTypes: {
        configurable: true,
        get: function () {
          return propTypes;
        },
        set: function (newPropTypes) {
          error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');

          propTypes = newPropTypes; // Match production behavior more closely:
          // $FlowFixMe

          Object.defineProperty(lazyType, 'propTypes', {
            enumerable: true
          });
        }
      }
    });
  }

  return lazyType;
}

function forwardRef(render) {
  {
    if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
      error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
    } else if (typeof render !== 'function') {
      error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
    } else {
      if (render.length !== 0 && render.length !== 2) {
        error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
      }
    }

    if (render != null) {
      if (render.defaultProps != null || render.propTypes != null) {
        error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
      }
    }
  }

  var elementType = {
    $$typeof: REACT_FORWARD_REF_TYPE,
    render: render
  };

  {
    var ownName;
    Object.defineProperty(elementType, 'displayName', {
      enumerable: false,
      configurable: true,
      get: function () {
        return ownName;
      },
      set: function (name) {
        ownName = name;

        if (render.displayName == null) {
          render.displayName = name;
        }
      }
    });
  }

  return elementType;
}

// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.

var enableScopeAPI = false; // Experimental Create Event Handle API.

function isValidElementType(type) {
  if (typeof type === 'string' || typeof type === 'function') {
    return true;
  } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).


  if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
    return true;
  }

  if (typeof type === 'object' && type !== null) {
    if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
      return true;
    }
  }

  return false;
}

function memo(type, compare) {
  {
    if (!isValidElementType(type)) {
      error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
    }
  }

  var elementType = {
    $$typeof: REACT_MEMO_TYPE,
    type: type,
    compare: compare === undefined ? null : compare
  };

  {
    var ownName;
    Object.defineProperty(elementType, 'displayName', {
      enumerable: false,
      configurable: true,
      get: function () {
        return ownName;
      },
      set: function (name) {
        ownName = name;

        if (type.displayName == null) {
          type.displayName = name;
        }
      }
    });
  }

  return elementType;
}

function resolveDispatcher() {
  var dispatcher = ReactCurrentDispatcher.current;

  if (!(dispatcher !== null)) {
    {
      throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
    }
  }

  return dispatcher;
}

function useContext(Context, unstable_observedBits) {
  var dispatcher = resolveDispatcher();

  {
    if (unstable_observedBits !== undefined) {
      error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : '');
    } // TODO: add a more generic warning for invalid values.


    if (Context._context !== undefined) {
      var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
      // and nobody should be using this in existing code.

      if (realContext.Consumer === Context) {
        error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
      } else if (realContext.Provider === Context) {
        error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
      }
    }
  }

  return dispatcher.useContext(Context, unstable_observedBits);
}
function useState(initialState) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useState(initialState);
}
function useReducer(reducer, initialArg, init) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useReducer(reducer, initialArg, init);
}
function useRef(initialValue) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useRef(initialValue);
}
function useEffect(create, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useEffect(create, deps);
}
function useLayoutEffect(create, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useLayoutEffect(create, deps);
}
function useCallback(callback, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useCallback(callback, deps);
}
function useMemo(create, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useMemo(create, deps);
}
function useImperativeHandle(ref, create, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useImperativeHandle(ref, create, deps);
}
function useDebugValue(value, formatterFn) {
  {
    var dispatcher = resolveDispatcher();
    return dispatcher.useDebugValue(value, formatterFn);
  }
}

// Helpers to patch console.logs to avoid logging during side-effect free
// replaying on render function. This currently only patches the object
// lazily which won't cover if the log function was extracted eagerly.
// We could also eagerly patch the method.
var disabledDepth = 0;
var prevLog;
var prevInfo;
var prevWarn;
var prevError;
var prevGroup;
var prevGroupCollapsed;
var prevGroupEnd;

function disabledLog() {}

disabledLog.__reactDisabledLog = true;
function disableLogs() {
  {
    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      prevLog = console.log;
      prevInfo = console.info;
      prevWarn = console.warn;
      prevError = console.error;
      prevGroup = console.group;
      prevGroupCollapsed = console.groupCollapsed;
      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099

      var props = {
        configurable: true,
        enumerable: true,
        value: disabledLog,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        info: props,
        log: props,
        warn: props,
        error: props,
        group: props,
        groupCollapsed: props,
        groupEnd: props
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    disabledDepth++;
  }
}
function reenableLogs() {
  {
    disabledDepth--;

    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      var props = {
        configurable: true,
        enumerable: true,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        log: _assign({}, props, {
          value: prevLog
        }),
        info: _assign({}, props, {
          value: prevInfo
        }),
        warn: _assign({}, props, {
          value: prevWarn
        }),
        error: _assign({}, props, {
          value: prevError
        }),
        group: _assign({}, props, {
          value: prevGroup
        }),
        groupCollapsed: _assign({}, props, {
          value: prevGroupCollapsed
        }),
        groupEnd: _assign({}, props, {
          value: prevGroupEnd
        })
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    if (disabledDepth < 0) {
      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
    }
  }
}

var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name, source, ownerFn) {
  {
    if (prefix === undefined) {
      // Extract the VM specific prefix used by each line.
      try {
        throw Error();
      } catch (x) {
        var match = x.stack.trim().match(/\n( *(at )?)/);
        prefix = match && match[1] || '';
      }
    } // We use the prefix to ensure our stacks line up with native stack frames.


    return '\n' + prefix + name;
  }
}
var reentry = false;
var componentFrameCache;

{
  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
  componentFrameCache = new PossiblyWeakMap();
}

function describeNativeComponentFrame(fn, construct) {
  // If something asked for a stack inside a fake render, it should get ignored.
  if (!fn || reentry) {
    return '';
  }

  {
    var frame = componentFrameCache.get(fn);

    if (frame !== undefined) {
      return frame;
    }
  }

  var control;
  reentry = true;
  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.

  Error.prepareStackTrace = undefined;
  var previousDispatcher;

  {
    previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
    // for warnings.

    ReactCurrentDispatcher$1.current = null;
    disableLogs();
  }

  try {
    // This should throw.
    if (construct) {
      // Something should be setting the props in the constructor.
      var Fake = function () {
        throw Error();
      }; // $FlowFixMe


      Object.defineProperty(Fake.prototype, 'props', {
        set: function () {
          // We use a throwing setter instead of frozen or non-writable props
          // because that won't throw in a non-strict mode function.
          throw Error();
        }
      });

      if (typeof Reflect === 'object' && Reflect.construct) {
        // We construct a different control for this case to include any extra
        // frames added by the construct call.
        try {
          Reflect.construct(Fake, []);
        } catch (x) {
          control = x;
        }

        Reflect.construct(fn, [], Fake);
      } else {
        try {
          Fake.call();
        } catch (x) {
          control = x;
        }

        fn.call(Fake.prototype);
      }
    } else {
      try {
        throw Error();
      } catch (x) {
        control = x;
      }

      fn();
    }
  } catch (sample) {
    // This is inlined manually because closure doesn't do it for us.
    if (sample && control && typeof sample.stack === 'string') {
      // This extracts the first frame from the sample that isn't also in the control.
      // Skipping one frame that we assume is the frame that calls the two.
      var sampleLines = sample.stack.split('\n');
      var controlLines = control.stack.split('\n');
      var s = sampleLines.length - 1;
      var c = controlLines.length - 1;

      while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
        // We expect at least one stack frame to be shared.
        // Typically this will be the root most one. However, stack frames may be
        // cut off due to maximum stack limits. In this case, one maybe cut off
        // earlier than the other. We assume that the sample is longer or the same
        // and there for cut off earlier. So we should find the root most frame in
        // the sample somewhere in the control.
        c--;
      }

      for (; s >= 1 && c >= 0; s--, c--) {
        // Next we find the first one that isn't the same which should be the
        // frame that called our sample function and the control.
        if (sampleLines[s] !== controlLines[c]) {
          // In V8, the first line is describing the message but other VMs don't.
          // If we're about to return the first line, and the control is also on the same
          // line, that's a pretty good indicator that our sample threw at same line as
          // the control. I.e. before we entered the sample frame. So we ignore this result.
          // This can happen if you passed a class to function component, or non-function.
          if (s !== 1 || c !== 1) {
            do {
              s--;
              c--; // We may still have similar intermediate frames from the construct call.
              // The next one that isn't the same should be our match though.

              if (c < 0 || sampleLines[s] !== controlLines[c]) {
                // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
                var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');

                {
                  if (typeof fn === 'function') {
                    componentFrameCache.set(fn, _frame);
                  }
                } // Return the line we found.


                return _frame;
              }
            } while (s >= 1 && c >= 0);
          }

          break;
        }
      }
    }
  } finally {
    reentry = false;

    {
      ReactCurrentDispatcher$1.current = previousDispatcher;
      reenableLogs();
    }

    Error.prepareStackTrace = previousPrepareStackTrace;
  } // Fallback to just using the name if we couldn't make it throw.


  var name = fn ? fn.displayName || fn.name : '';
  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';

  {
    if (typeof fn === 'function') {
      componentFrameCache.set(fn, syntheticFrame);
    }
  }

  return syntheticFrame;
}
function describeFunctionComponentFrame(fn, source, ownerFn) {
  {
    return describeNativeComponentFrame(fn, false);
  }
}

function shouldConstruct(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {

  if (type == null) {
    return '';
  }

  if (typeof type === 'function') {
    {
      return describeNativeComponentFrame(type, shouldConstruct(type));
    }
  }

  if (typeof type === 'string') {
    return describeBuiltInComponentFrame(type);
  }

  switch (type) {
    case exports.Suspense:
      return describeBuiltInComponentFrame('Suspense');

    case REACT_SUSPENSE_LIST_TYPE:
      return describeBuiltInComponentFrame('SuspenseList');
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_FORWARD_REF_TYPE:
        return describeFunctionComponentFrame(type.render);

      case REACT_MEMO_TYPE:
        // Memo may contain any component type so we recursively resolve it.
        return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);

      case REACT_BLOCK_TYPE:
        return describeFunctionComponentFrame(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            // Lazy may contain any component type so we recursively resolve it.
            return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
          } catch (x) {}
        }
    }
  }

  return '';
}

var loggedTypeFailures = {};
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame$1.setExtraStackFrame(null);
    }
  }
}

function checkPropTypes(typeSpecs, values, location, componentName, element) {
  {
    // $FlowFixMe This is okay but Flow doesn't know it.
    var has = Function.call.bind(Object.prototype.hasOwnProperty);

    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.

        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
            err.name = 'Invariant Violation';
            throw err;
          }

          error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
        } catch (ex) {
          error$1 = ex;
        }

        if (error$1 && !(error$1 instanceof Error)) {
          setCurrentlyValidatingElement(element);

          error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);

          setCurrentlyValidatingElement(null);
        }

        if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error$1.message] = true;
          setCurrentlyValidatingElement(element);

          error('Failed %s type: %s', location, error$1.message);

          setCurrentlyValidatingElement(null);
        }
      }
    }
  }
}

function setCurrentlyValidatingElement$1(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      setExtraStackFrame(stack);
    } else {
      setExtraStackFrame(null);
    }
  }
}

var propTypesMisspellWarningShown;

{
  propTypesMisspellWarningShown = false;
}

function getDeclarationErrorAddendum() {
  if (ReactCurrentOwner.current) {
    var name = getComponentName(ReactCurrentOwner.current.type);

    if (name) {
      return '\n\nCheck the render method of `' + name + '`.';
    }
  }

  return '';
}

function getSourceInfoErrorAddendum(source) {
  if (source !== undefined) {
    var fileName = source.fileName.replace(/^.*[\\\/]/, '');
    var lineNumber = source.lineNumber;
    return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
  }

  return '';
}

function getSourceInfoErrorAddendumForProps(elementProps) {
  if (elementProps !== null && elementProps !== undefined) {
    return getSourceInfoErrorAddendum(elementProps.__source);
  }

  return '';
}
/**
 * Warn if there's no key explicitly set on dynamic arrays of children or
 * object keys are not valid. This allows us to keep track of children between
 * updates.
 */


var ownerHasKeyUseWarning = {};

function getCurrentComponentErrorInfo(parentType) {
  var info = getDeclarationErrorAddendum();

  if (!info) {
    var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;

    if (parentName) {
      info = "\n\nCheck the top-level render call using <" + parentName + ">.";
    }
  }

  return info;
}
/**
 * Warn if the element doesn't have an explicit key assigned to it.
 * This element is in an array. The array could grow and shrink or be
 * reordered. All children that haven't already been validated are required to
 * have a "key" property assigned to it. Error statuses are cached so a warning
 * will only be shown once.
 *
 * @internal
 * @param {ReactElement} element Element that requires a key.
 * @param {*} parentType element's parent's type.
 */


function validateExplicitKey(element, parentType) {
  if (!element._store || element._store.validated || element.key != null) {
    return;
  }

  element._store.validated = true;
  var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);

  if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
    return;
  }

  ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
  // property, it may be the creator of the child that's responsible for
  // assigning it a key.

  var childOwner = '';

  if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
    // Give the component that originally created this child.
    childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
  }

  {
    setCurrentlyValidatingElement$1(element);

    error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);

    setCurrentlyValidatingElement$1(null);
  }
}
/**
 * Ensure that every element either is passed in a static location, in an
 * array with an explicit keys property defined, or in an object literal
 * with valid key property.
 *
 * @internal
 * @param {ReactNode} node Statically passed child of any type.
 * @param {*} parentType node's parent's type.
 */


function validateChildKeys(node, parentType) {
  if (typeof node !== 'object') {
    return;
  }

  if (Array.isArray(node)) {
    for (var i = 0; i < node.length; i++) {
      var child = node[i];

      if (isValidElement(child)) {
        validateExplicitKey(child, parentType);
      }
    }
  } else if (isValidElement(node)) {
    // This element was passed in a valid location.
    if (node._store) {
      node._store.validated = true;
    }
  } else if (node) {
    var iteratorFn = getIteratorFn(node);

    if (typeof iteratorFn === 'function') {
      // Entry iterators used to provide implicit keys,
      // but now we print a separate warning for them later.
      if (iteratorFn !== node.entries) {
        var iterator = iteratorFn.call(node);
        var step;

        while (!(step = iterator.next()).done) {
          if (isValidElement(step.value)) {
            validateExplicitKey(step.value, parentType);
          }
        }
      }
    }
  }
}
/**
 * Given an element, validate that its props follow the propTypes definition,
 * provided by the type.
 *
 * @param {ReactElement} element
 */


function validatePropTypes(element) {
  {
    var type = element.type;

    if (type === null || type === undefined || typeof type === 'string') {
      return;
    }

    var propTypes;

    if (typeof type === 'function') {
      propTypes = type.propTypes;
    } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
    // Inner props are checked in the reconciler.
    type.$$typeof === REACT_MEMO_TYPE)) {
      propTypes = type.propTypes;
    } else {
      return;
    }

    if (propTypes) {
      // Intentionally inside to avoid triggering lazy initializers:
      var name = getComponentName(type);
      checkPropTypes(propTypes, element.props, 'prop', name, element);
    } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
      propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:

      var _name = getComponentName(type);

      error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
    }

    if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
      error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
    }
  }
}
/**
 * Given a fragment, validate that it can only be provided with fragment props
 * @param {ReactElement} fragment
 */


function validateFragmentProps(fragment) {
  {
    var keys = Object.keys(fragment.props);

    for (var i = 0; i < keys.length; i++) {
      var key = keys[i];

      if (key !== 'children' && key !== 'key') {
        setCurrentlyValidatingElement$1(fragment);

        error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);

        setCurrentlyValidatingElement$1(null);
        break;
      }
    }

    if (fragment.ref !== null) {
      setCurrentlyValidatingElement$1(fragment);

      error('Invalid attribute `ref` supplied to `React.Fragment`.');

      setCurrentlyValidatingElement$1(null);
    }
  }
}
function createElementWithValidation(type, props, children) {
  var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
  // succeed and there will likely be errors in render.

  if (!validType) {
    var info = '';

    if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
      info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
    }

    var sourceInfo = getSourceInfoErrorAddendumForProps(props);

    if (sourceInfo) {
      info += sourceInfo;
    } else {
      info += getDeclarationErrorAddendum();
    }

    var typeString;

    if (type === null) {
      typeString = 'null';
    } else if (Array.isArray(type)) {
      typeString = 'array';
    } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
      typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
      info = ' Did you accidentally export a JSX literal instead of a component?';
    } else {
      typeString = typeof type;
    }

    {
      error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
    }
  }

  var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
  // TODO: Drop this when these are no longer allowed as the type argument.

  if (element == null) {
    return element;
  } // Skip key warning if the type isn't valid since our key validation logic
  // doesn't expect a non-string/function type and can throw confusing errors.
  // We don't want exception behavior to differ between dev and prod.
  // (Rendering will throw with a helpful message and as soon as the type is
  // fixed, the key warnings will appear.)


  if (validType) {
    for (var i = 2; i < arguments.length; i++) {
      validateChildKeys(arguments[i], type);
    }
  }

  if (type === exports.Fragment) {
    validateFragmentProps(element);
  } else {
    validatePropTypes(element);
  }

  return element;
}
var didWarnAboutDeprecatedCreateFactory = false;
function createFactoryWithValidation(type) {
  var validatedFactory = createElementWithValidation.bind(null, type);
  validatedFactory.type = type;

  {
    if (!didWarnAboutDeprecatedCreateFactory) {
      didWarnAboutDeprecatedCreateFactory = true;

      warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
    } // Legacy hook: remove it


    Object.defineProperty(validatedFactory, 'type', {
      enumerable: false,
      get: function () {
        warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');

        Object.defineProperty(this, 'type', {
          value: type
        });
        return type;
      }
    });
  }

  return validatedFactory;
}
function cloneElementWithValidation(element, props, children) {
  var newElement = cloneElement.apply(this, arguments);

  for (var i = 2; i < arguments.length; i++) {
    validateChildKeys(arguments[i], newElement.type);
  }

  validatePropTypes(newElement);
  return newElement;
}

{

  try {
    var frozenObject = Object.freeze({});
    /* eslint-disable no-new */

    new Map([[frozenObject, null]]);
    new Set([frozenObject]);
    /* eslint-enable no-new */
  } catch (e) {
  }
}

var createElement$1 =  createElementWithValidation ;
var cloneElement$1 =  cloneElementWithValidation ;
var createFactory =  createFactoryWithValidation ;
var Children = {
  map: mapChildren,
  forEach: forEachChildren,
  count: countChildren,
  toArray: toArray,
  only: onlyChild
};

exports.Children = Children;
exports.Component = Component;
exports.PureComponent = PureComponent;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
exports.cloneElement = cloneElement$1;
exports.createContext = createContext;
exports.createElement = createElement$1;
exports.createFactory = createFactory;
exports.createRef = createRef;
exports.forwardRef = forwardRef;
exports.isValidElement = isValidElement;
exports.lazy = lazy;
exports.memo = memo;
exports.useCallback = useCallback;
exports.useContext = useContext;
exports.useDebugValue = useDebugValue;
exports.useEffect = useEffect;
exports.useImperativeHandle = useImperativeHandle;
exports.useLayoutEffect = useLayoutEffect;
exports.useMemo = useMemo;
exports.useReducer = useReducer;
exports.useRef = useRef;
exports.useState = useState;
exports.version = ReactVersion;
  })();
}


/***/ }),

/***/ "../../../../node_modules/react/index.js":
/*!***********************************************!*\
  !*** ../../../../node_modules/react/index.js ***!
  \***********************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1288860__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_1288860__(/*! ./cjs/react.development.js */ "../../../../node_modules/react/cjs/react.development.js");
}


/***/ }),

/***/ "../../../../node_modules/react/jsx-runtime.js":
/*!*****************************************************!*\
  !*** ../../../../node_modules/react/jsx-runtime.js ***!
  \*****************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1289345__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_1289345__(/*! ./cjs/react-jsx-runtime.development.js */ "../../../../node_modules/react/cjs/react-jsx-runtime.development.js");
}


/***/ }),

/***/ "../../../../node_modules/scheduler/cjs/scheduler-tracing.development.js":
/*!*******************************************************************************!*\
  !*** ../../../../node_modules/scheduler/cjs/scheduler-tracing.development.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
/** @license React v0.20.2
 * scheduler-tracing.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.

var interactionIDCounter = 0;
var threadIDCounter = 0; // Set of currently traced interactions.
// Interactions "stack"–
// Meaning that newly traced interactions are appended to the previously active set.
// When an interaction goes out of scope, the previous set (if any) is restored.

exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.

exports.__subscriberRef = null;

{
  exports.__interactionsRef = {
    current: new Set()
  };
  exports.__subscriberRef = {
    current: null
  };
}
function unstable_clear(callback) {

  var prevInteractions = exports.__interactionsRef.current;
  exports.__interactionsRef.current = new Set();

  try {
    return callback();
  } finally {
    exports.__interactionsRef.current = prevInteractions;
  }
}
function unstable_getCurrent() {
  {
    return exports.__interactionsRef.current;
  }
}
function unstable_getThreadID() {
  return ++threadIDCounter;
}
function unstable_trace(name, timestamp, callback) {
  var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;

  var interaction = {
    __count: 1,
    id: interactionIDCounter++,
    name: name,
    timestamp: timestamp
  };
  var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.
  // To do that, clone the current interactions.
  // The previous set will be restored upon completion.

  var interactions = new Set(prevInteractions);
  interactions.add(interaction);
  exports.__interactionsRef.current = interactions;
  var subscriber = exports.__subscriberRef.current;
  var returnValue;

  try {
    if (subscriber !== null) {
      subscriber.onInteractionTraced(interaction);
    }
  } finally {
    try {
      if (subscriber !== null) {
        subscriber.onWorkStarted(interactions, threadID);
      }
    } finally {
      try {
        returnValue = callback();
      } finally {
        exports.__interactionsRef.current = prevInteractions;

        try {
          if (subscriber !== null) {
            subscriber.onWorkStopped(interactions, threadID);
          }
        } finally {
          interaction.__count--; // If no async work was scheduled for this interaction,
          // Notify subscribers that it's completed.

          if (subscriber !== null && interaction.__count === 0) {
            subscriber.onInteractionScheduledWorkCompleted(interaction);
          }
        }
      }
    }
  }

  return returnValue;
}
function unstable_wrap(callback) {
  var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;

  var wrappedInteractions = exports.__interactionsRef.current;
  var subscriber = exports.__subscriberRef.current;

  if (subscriber !== null) {
    subscriber.onWorkScheduled(wrappedInteractions, threadID);
  } // Update the pending async work count for the current interactions.
  // Update after calling subscribers in case of error.


  wrappedInteractions.forEach(function (interaction) {
    interaction.__count++;
  });
  var hasRun = false;

  function wrapped() {
    var prevInteractions = exports.__interactionsRef.current;
    exports.__interactionsRef.current = wrappedInteractions;
    subscriber = exports.__subscriberRef.current;

    try {
      var returnValue;

      try {
        if (subscriber !== null) {
          subscriber.onWorkStarted(wrappedInteractions, threadID);
        }
      } finally {
        try {
          returnValue = callback.apply(undefined, arguments);
        } finally {
          exports.__interactionsRef.current = prevInteractions;

          if (subscriber !== null) {
            subscriber.onWorkStopped(wrappedInteractions, threadID);
          }
        }
      }

      return returnValue;
    } finally {
      if (!hasRun) {
        // We only expect a wrapped function to be executed once,
        // But in the event that it's executed more than once–
        // Only decrement the outstanding interaction counts once.
        hasRun = true; // Update pending async counts for all wrapped interactions.
        // If this was the last scheduled async work for any of them,
        // Mark them as completed.

        wrappedInteractions.forEach(function (interaction) {
          interaction.__count--;

          if (subscriber !== null && interaction.__count === 0) {
            subscriber.onInteractionScheduledWorkCompleted(interaction);
          }
        });
      }
    }
  }

  wrapped.cancel = function cancel() {
    subscriber = exports.__subscriberRef.current;

    try {
      if (subscriber !== null) {
        subscriber.onWorkCanceled(wrappedInteractions, threadID);
      }
    } finally {
      // Update pending async counts for all wrapped interactions.
      // If this was the last scheduled async work for any of them,
      // Mark them as completed.
      wrappedInteractions.forEach(function (interaction) {
        interaction.__count--;

        if (subscriber && interaction.__count === 0) {
          subscriber.onInteractionScheduledWorkCompleted(interaction);
        }
      });
    }
  };

  return wrapped;
}

var subscribers = null;

{
  subscribers = new Set();
}

function unstable_subscribe(subscriber) {
  {
    subscribers.add(subscriber);

    if (subscribers.size === 1) {
      exports.__subscriberRef.current = {
        onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,
        onInteractionTraced: onInteractionTraced,
        onWorkCanceled: onWorkCanceled,
        onWorkScheduled: onWorkScheduled,
        onWorkStarted: onWorkStarted,
        onWorkStopped: onWorkStopped
      };
    }
  }
}
function unstable_unsubscribe(subscriber) {
  {
    subscribers.delete(subscriber);

    if (subscribers.size === 0) {
      exports.__subscriberRef.current = null;
    }
  }
}

function onInteractionTraced(interaction) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onInteractionTraced(interaction);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onInteractionScheduledWorkCompleted(interaction) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onInteractionScheduledWorkCompleted(interaction);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkScheduled(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkScheduled(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkStarted(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkStarted(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkStopped(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkStopped(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkCanceled(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkCanceled(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

exports.unstable_clear = unstable_clear;
exports.unstable_getCurrent = unstable_getCurrent;
exports.unstable_getThreadID = unstable_getThreadID;
exports.unstable_subscribe = unstable_subscribe;
exports.unstable_trace = unstable_trace;
exports.unstable_unsubscribe = unstable_unsubscribe;
exports.unstable_wrap = unstable_wrap;
  })();
}


/***/ }),

/***/ "../../../../node_modules/scheduler/cjs/scheduler.development.js":
/*!***********************************************************************!*\
  !*** ../../../../node_modules/scheduler/cjs/scheduler.development.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
/** @license React v0.20.2
 * scheduler.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var enableSchedulerDebugging = false;
var enableProfiling = false;

var requestHostCallback;
var requestHostTimeout;
var cancelHostTimeout;
var requestPaint;
var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';

if (hasPerformanceNow) {
  var localPerformance = performance;

  exports.unstable_now = function () {
    return localPerformance.now();
  };
} else {
  var localDate = Date;
  var initialTime = localDate.now();

  exports.unstable_now = function () {
    return localDate.now() - initialTime;
  };
}

if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive
// implementation using setTimeout.
typeof window === 'undefined' || // Check if MessageChannel is supported, too.
typeof MessageChannel !== 'function') {
  // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,
  // fallback to a naive implementation.
  var _callback = null;
  var _timeoutID = null;

  var _flushCallback = function () {
    if (_callback !== null) {
      try {
        var currentTime = exports.unstable_now();
        var hasRemainingTime = true;

        _callback(hasRemainingTime, currentTime);

        _callback = null;
      } catch (e) {
        setTimeout(_flushCallback, 0);
        throw e;
      }
    }
  };

  requestHostCallback = function (cb) {
    if (_callback !== null) {
      // Protect against re-entrancy.
      setTimeout(requestHostCallback, 0, cb);
    } else {
      _callback = cb;
      setTimeout(_flushCallback, 0);
    }
  };

  requestHostTimeout = function (cb, ms) {
    _timeoutID = setTimeout(cb, ms);
  };

  cancelHostTimeout = function () {
    clearTimeout(_timeoutID);
  };

  exports.unstable_shouldYield = function () {
    return false;
  };

  requestPaint = exports.unstable_forceFrameRate = function () {};
} else {
  // Capture local references to native APIs, in case a polyfill overrides them.
  var _setTimeout = window.setTimeout;
  var _clearTimeout = window.clearTimeout;

  if (typeof console !== 'undefined') {
    // TODO: Scheduler no longer requires these methods to be polyfilled. But
    // maybe we want to continue warning if they don't exist, to preserve the
    // option to rely on it in the future?
    var requestAnimationFrame = window.requestAnimationFrame;
    var cancelAnimationFrame = window.cancelAnimationFrame;

    if (typeof requestAnimationFrame !== 'function') {
      // Using console['error'] to evade Babel and ESLint
      console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
    }

    if (typeof cancelAnimationFrame !== 'function') {
      // Using console['error'] to evade Babel and ESLint
      console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
    }
  }

  var isMessageLoopRunning = false;
  var scheduledHostCallback = null;
  var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
  // thread, like user events. By default, it yields multiple times per frame.
  // It does not attempt to align with frame boundaries, since most tasks don't
  // need to be frame aligned; for those that do, use requestAnimationFrame.

  var yieldInterval = 5;
  var deadline = 0; // TODO: Make this configurable

  {
    // `isInputPending` is not available. Since we have no way of knowing if
    // there's pending input, always yield at the end of the frame.
    exports.unstable_shouldYield = function () {
      return exports.unstable_now() >= deadline;
    }; // Since we yield every frame regardless, `requestPaint` has no effect.


    requestPaint = function () {};
  }

  exports.unstable_forceFrameRate = function (fps) {
    if (fps < 0 || fps > 125) {
      // Using console['error'] to evade Babel and ESLint
      console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
      return;
    }

    if (fps > 0) {
      yieldInterval = Math.floor(1000 / fps);
    } else {
      // reset the framerate
      yieldInterval = 5;
    }
  };

  var performWorkUntilDeadline = function () {
    if (scheduledHostCallback !== null) {
      var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync
      // cycle. This means there's always time remaining at the beginning of
      // the message event.

      deadline = currentTime + yieldInterval;
      var hasTimeRemaining = true;

      try {
        var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);

        if (!hasMoreWork) {
          isMessageLoopRunning = false;
          scheduledHostCallback = null;
        } else {
          // If there's more work, schedule the next message event at the end
          // of the preceding one.
          port.postMessage(null);
        }
      } catch (error) {
        // If a scheduler task throws, exit the current browser task so the
        // error can be observed.
        port.postMessage(null);
        throw error;
      }
    } else {
      isMessageLoopRunning = false;
    } // Yielding to the browser will give it a chance to paint, so we can
  };

  var channel = new MessageChannel();
  var port = channel.port2;
  channel.port1.onmessage = performWorkUntilDeadline;

  requestHostCallback = function (callback) {
    scheduledHostCallback = callback;

    if (!isMessageLoopRunning) {
      isMessageLoopRunning = true;
      port.postMessage(null);
    }
  };

  requestHostTimeout = function (callback, ms) {
    taskTimeoutID = _setTimeout(function () {
      callback(exports.unstable_now());
    }, ms);
  };

  cancelHostTimeout = function () {
    _clearTimeout(taskTimeoutID);

    taskTimeoutID = -1;
  };
}

function push(heap, node) {
  var index = heap.length;
  heap.push(node);
  siftUp(heap, node, index);
}
function peek(heap) {
  var first = heap[0];
  return first === undefined ? null : first;
}
function pop(heap) {
  var first = heap[0];

  if (first !== undefined) {
    var last = heap.pop();

    if (last !== first) {
      heap[0] = last;
      siftDown(heap, last, 0);
    }

    return first;
  } else {
    return null;
  }
}

function siftUp(heap, node, i) {
  var index = i;

  while (true) {
    var parentIndex = index - 1 >>> 1;
    var parent = heap[parentIndex];

    if (parent !== undefined && compare(parent, node) > 0) {
      // The parent is larger. Swap positions.
      heap[parentIndex] = node;
      heap[index] = parent;
      index = parentIndex;
    } else {
      // The parent is smaller. Exit.
      return;
    }
  }
}

function siftDown(heap, node, i) {
  var index = i;
  var length = heap.length;

  while (index < length) {
    var leftIndex = (index + 1) * 2 - 1;
    var left = heap[leftIndex];
    var rightIndex = leftIndex + 1;
    var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.

    if (left !== undefined && compare(left, node) < 0) {
      if (right !== undefined && compare(right, left) < 0) {
        heap[index] = right;
        heap[rightIndex] = node;
        index = rightIndex;
      } else {
        heap[index] = left;
        heap[leftIndex] = node;
        index = leftIndex;
      }
    } else if (right !== undefined && compare(right, node) < 0) {
      heap[index] = right;
      heap[rightIndex] = node;
      index = rightIndex;
    } else {
      // Neither child is smaller. Exit.
      return;
    }
  }
}

function compare(a, b) {
  // Compare sort index first, then task id.
  var diff = a.sortIndex - b.sortIndex;
  return diff !== 0 ? diff : a.id - b.id;
}

// TODO: Use symbols?
var ImmediatePriority = 1;
var UserBlockingPriority = 2;
var NormalPriority = 3;
var LowPriority = 4;
var IdlePriority = 5;

function markTaskErrored(task, ms) {
}

/* eslint-disable no-var */
// Math.pow(2, 30) - 1
// 0b111111111111111111111111111111

var maxSigned31BitInt = 1073741823; // Times out immediately

var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out

var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
var NORMAL_PRIORITY_TIMEOUT = 5000;
var LOW_PRIORITY_TIMEOUT = 10000; // Never times out

var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap

var taskQueue = [];
var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.

var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
var currentTask = null;
var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.

var isPerformingWork = false;
var isHostCallbackScheduled = false;
var isHostTimeoutScheduled = false;

function advanceTimers(currentTime) {
  // Check for tasks that are no longer delayed and add them to the queue.
  var timer = peek(timerQueue);

  while (timer !== null) {
    if (timer.callback === null) {
      // Timer was cancelled.
      pop(timerQueue);
    } else if (timer.startTime <= currentTime) {
      // Timer fired. Transfer to the task queue.
      pop(timerQueue);
      timer.sortIndex = timer.expirationTime;
      push(taskQueue, timer);
    } else {
      // Remaining timers are pending.
      return;
    }

    timer = peek(timerQueue);
  }
}

function handleTimeout(currentTime) {
  isHostTimeoutScheduled = false;
  advanceTimers(currentTime);

  if (!isHostCallbackScheduled) {
    if (peek(taskQueue) !== null) {
      isHostCallbackScheduled = true;
      requestHostCallback(flushWork);
    } else {
      var firstTimer = peek(timerQueue);

      if (firstTimer !== null) {
        requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
      }
    }
  }
}

function flushWork(hasTimeRemaining, initialTime) {


  isHostCallbackScheduled = false;

  if (isHostTimeoutScheduled) {
    // We scheduled a timeout but it's no longer needed. Cancel it.
    isHostTimeoutScheduled = false;
    cancelHostTimeout();
  }

  isPerformingWork = true;
  var previousPriorityLevel = currentPriorityLevel;

  try {
    if (enableProfiling) {
      try {
        return workLoop(hasTimeRemaining, initialTime);
      } catch (error) {
        if (currentTask !== null) {
          var currentTime = exports.unstable_now();
          markTaskErrored(currentTask, currentTime);
          currentTask.isQueued = false;
        }

        throw error;
      }
    } else {
      // No catch in prod code path.
      return workLoop(hasTimeRemaining, initialTime);
    }
  } finally {
    currentTask = null;
    currentPriorityLevel = previousPriorityLevel;
    isPerformingWork = false;
  }
}

function workLoop(hasTimeRemaining, initialTime) {
  var currentTime = initialTime;
  advanceTimers(currentTime);
  currentTask = peek(taskQueue);

  while (currentTask !== null && !(enableSchedulerDebugging )) {
    if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || exports.unstable_shouldYield())) {
      // This currentTask hasn't expired, and we've reached the deadline.
      break;
    }

    var callback = currentTask.callback;

    if (typeof callback === 'function') {
      currentTask.callback = null;
      currentPriorityLevel = currentTask.priorityLevel;
      var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;

      var continuationCallback = callback(didUserCallbackTimeout);
      currentTime = exports.unstable_now();

      if (typeof continuationCallback === 'function') {
        currentTask.callback = continuationCallback;
      } else {

        if (currentTask === peek(taskQueue)) {
          pop(taskQueue);
        }
      }

      advanceTimers(currentTime);
    } else {
      pop(taskQueue);
    }

    currentTask = peek(taskQueue);
  } // Return whether there's additional work


  if (currentTask !== null) {
    return true;
  } else {
    var firstTimer = peek(timerQueue);

    if (firstTimer !== null) {
      requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
    }

    return false;
  }
}

function unstable_runWithPriority(priorityLevel, eventHandler) {
  switch (priorityLevel) {
    case ImmediatePriority:
    case UserBlockingPriority:
    case NormalPriority:
    case LowPriority:
    case IdlePriority:
      break;

    default:
      priorityLevel = NormalPriority;
  }

  var previousPriorityLevel = currentPriorityLevel;
  currentPriorityLevel = priorityLevel;

  try {
    return eventHandler();
  } finally {
    currentPriorityLevel = previousPriorityLevel;
  }
}

function unstable_next(eventHandler) {
  var priorityLevel;

  switch (currentPriorityLevel) {
    case ImmediatePriority:
    case UserBlockingPriority:
    case NormalPriority:
      // Shift down to normal priority
      priorityLevel = NormalPriority;
      break;

    default:
      // Anything lower than normal priority should remain at the current level.
      priorityLevel = currentPriorityLevel;
      break;
  }

  var previousPriorityLevel = currentPriorityLevel;
  currentPriorityLevel = priorityLevel;

  try {
    return eventHandler();
  } finally {
    currentPriorityLevel = previousPriorityLevel;
  }
}

function unstable_wrapCallback(callback) {
  var parentPriorityLevel = currentPriorityLevel;
  return function () {
    // This is a fork of runWithPriority, inlined for performance.
    var previousPriorityLevel = currentPriorityLevel;
    currentPriorityLevel = parentPriorityLevel;

    try {
      return callback.apply(this, arguments);
    } finally {
      currentPriorityLevel = previousPriorityLevel;
    }
  };
}

function unstable_scheduleCallback(priorityLevel, callback, options) {
  var currentTime = exports.unstable_now();
  var startTime;

  if (typeof options === 'object' && options !== null) {
    var delay = options.delay;

    if (typeof delay === 'number' && delay > 0) {
      startTime = currentTime + delay;
    } else {
      startTime = currentTime;
    }
  } else {
    startTime = currentTime;
  }

  var timeout;

  switch (priorityLevel) {
    case ImmediatePriority:
      timeout = IMMEDIATE_PRIORITY_TIMEOUT;
      break;

    case UserBlockingPriority:
      timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
      break;

    case IdlePriority:
      timeout = IDLE_PRIORITY_TIMEOUT;
      break;

    case LowPriority:
      timeout = LOW_PRIORITY_TIMEOUT;
      break;

    case NormalPriority:
    default:
      timeout = NORMAL_PRIORITY_TIMEOUT;
      break;
  }

  var expirationTime = startTime + timeout;
  var newTask = {
    id: taskIdCounter++,
    callback: callback,
    priorityLevel: priorityLevel,
    startTime: startTime,
    expirationTime: expirationTime,
    sortIndex: -1
  };

  if (startTime > currentTime) {
    // This is a delayed task.
    newTask.sortIndex = startTime;
    push(timerQueue, newTask);

    if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
      // All tasks are delayed, and this is the task with the earliest delay.
      if (isHostTimeoutScheduled) {
        // Cancel an existing timeout.
        cancelHostTimeout();
      } else {
        isHostTimeoutScheduled = true;
      } // Schedule a timeout.


      requestHostTimeout(handleTimeout, startTime - currentTime);
    }
  } else {
    newTask.sortIndex = expirationTime;
    push(taskQueue, newTask);
    // wait until the next time we yield.


    if (!isHostCallbackScheduled && !isPerformingWork) {
      isHostCallbackScheduled = true;
      requestHostCallback(flushWork);
    }
  }

  return newTask;
}

function unstable_pauseExecution() {
}

function unstable_continueExecution() {

  if (!isHostCallbackScheduled && !isPerformingWork) {
    isHostCallbackScheduled = true;
    requestHostCallback(flushWork);
  }
}

function unstable_getFirstCallbackNode() {
  return peek(taskQueue);
}

function unstable_cancelCallback(task) {
  // remove from the queue because you can't remove arbitrary nodes from an
  // array based heap, only the first one.)


  task.callback = null;
}

function unstable_getCurrentPriorityLevel() {
  return currentPriorityLevel;
}

var unstable_requestPaint = requestPaint;
var unstable_Profiling =  null;

exports.unstable_IdlePriority = IdlePriority;
exports.unstable_ImmediatePriority = ImmediatePriority;
exports.unstable_LowPriority = LowPriority;
exports.unstable_NormalPriority = NormalPriority;
exports.unstable_Profiling = unstable_Profiling;
exports.unstable_UserBlockingPriority = UserBlockingPriority;
exports.unstable_cancelCallback = unstable_cancelCallback;
exports.unstable_continueExecution = unstable_continueExecution;
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
exports.unstable_next = unstable_next;
exports.unstable_pauseExecution = unstable_pauseExecution;
exports.unstable_requestPaint = unstable_requestPaint;
exports.unstable_runWithPriority = unstable_runWithPriority;
exports.unstable_scheduleCallback = unstable_scheduleCallback;
exports.unstable_wrapCallback = unstable_wrapCallback;
  })();
}


/***/ }),

/***/ "../../../../node_modules/scheduler/index.js":
/*!***************************************************!*\
  !*** ../../../../node_modules/scheduler/index.js ***!
  \***************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1317102__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_1317102__(/*! ./cjs/scheduler.development.js */ "../../../../node_modules/scheduler/cjs/scheduler.development.js");
}


/***/ }),

/***/ "../../../../node_modules/scheduler/tracing.js":
/*!*****************************************************!*\
  !*** ../../../../node_modules/scheduler/tracing.js ***!
  \*****************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1317599__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_1317599__(/*! ./cjs/scheduler-tracing.development.js */ "../../../../node_modules/scheduler/cjs/scheduler-tracing.development.js");
}


/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
/*!**************************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  \**************************************************************************************/
/***/ ((module) => {

"use strict";


var stylesInDOM = [];
function getIndexByIdentifier(identifier) {
  var result = -1;
  for (var i = 0; i < stylesInDOM.length; i++) {
    if (stylesInDOM[i].identifier === identifier) {
      result = i;
      break;
    }
  }
  return result;
}
function modulesToDom(list, options) {
  var idCountMap = {};
  var identifiers = [];
  for (var i = 0; i < list.length; i++) {
    var item = list[i];
    var id = options.base ? item[0] + options.base : item[0];
    var count = idCountMap[id] || 0;
    var identifier = "".concat(id, " ").concat(count);
    idCountMap[id] = count + 1;
    var indexByIdentifier = getIndexByIdentifier(identifier);
    var obj = {
      css: item[1],
      media: item[2],
      sourceMap: item[3],
      supports: item[4],
      layer: item[5]
    };
    if (indexByIdentifier !== -1) {
      stylesInDOM[indexByIdentifier].references++;
      stylesInDOM[indexByIdentifier].updater(obj);
    } else {
      var updater = addElementStyle(obj, options);
      options.byIndex = i;
      stylesInDOM.splice(i, 0, {
        identifier: identifier,
        updater: updater,
        references: 1
      });
    }
    identifiers.push(identifier);
  }
  return identifiers;
}
function addElementStyle(obj, options) {
  var api = options.domAPI(options);
  api.update(obj);
  var updater = function updater(newObj) {
    if (newObj) {
      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
        return;
      }
      api.update(obj = newObj);
    } else {
      api.remove();
    }
  };
  return updater;
}
module.exports = function (list, options) {
  options = options || {};
  list = list || [];
  var lastIdentifiers = modulesToDom(list, options);
  return function update(newList) {
    newList = newList || [];
    for (var i = 0; i < lastIdentifiers.length; i++) {
      var identifier = lastIdentifiers[i];
      var index = getIndexByIdentifier(identifier);
      stylesInDOM[index].references--;
    }
    var newLastIdentifiers = modulesToDom(newList, options);
    for (var _i = 0; _i < lastIdentifiers.length; _i++) {
      var _identifier = lastIdentifiers[_i];
      var _index = getIndexByIdentifier(_identifier);
      if (stylesInDOM[_index].references === 0) {
        stylesInDOM[_index].updater();
        stylesInDOM.splice(_index, 1);
      }
    }
    lastIdentifiers = newLastIdentifiers;
  };
};

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js":
/*!******************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/insertBySelector.js ***!
  \******************************************************************************/
/***/ ((module) => {

"use strict";


var memo = {};

/* istanbul ignore next  */
function getTarget(target) {
  if (typeof memo[target] === "undefined") {
    var styleTarget = document.querySelector(target);

    // Special case to return head of iframe instead of iframe itself
    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
      try {
        // This will throw an exception if access to iframe is blocked
        // due to cross-origin restrictions
        styleTarget = styleTarget.contentDocument.head;
      } catch (e) {
        // istanbul ignore next
        styleTarget = null;
      }
    }
    memo[target] = styleTarget;
  }
  return memo[target];
}

/* istanbul ignore next  */
function insertBySelector(insert, style) {
  var target = getTarget(insert);
  if (!target) {
    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  }
  target.appendChild(style);
}
module.exports = insertBySelector;

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js":
/*!********************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
  \********************************************************************************/
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function insertStyleElement(options) {
  var element = document.createElement("style");
  options.setAttributes(element, options.attributes);
  options.insert(element, options.options);
  return element;
}
module.exports = insertStyleElement;

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":
/*!********************************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
  \********************************************************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1323177__) => {

"use strict";


/* istanbul ignore next  */
function setAttributesWithoutAttributes(styleElement) {
  var nonce =   true ? __nested_webpack_require_1323177__.nc : 0;
  if (nonce) {
    styleElement.setAttribute("nonce", nonce);
  }
}
module.exports = setAttributesWithoutAttributes;

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js":
/*!*************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
  \*************************************************************************/
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function apply(styleElement, options, obj) {
  var css = "";
  if (obj.supports) {
    css += "@supports (".concat(obj.supports, ") {");
  }
  if (obj.media) {
    css += "@media ".concat(obj.media, " {");
  }
  var needLayer = typeof obj.layer !== "undefined";
  if (needLayer) {
    css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  }
  css += obj.css;
  if (needLayer) {
    css += "}";
  }
  if (obj.media) {
    css += "}";
  }
  if (obj.supports) {
    css += "}";
  }
  var sourceMap = obj.sourceMap;
  if (sourceMap && typeof btoa !== "undefined") {
    css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  }

  // For old IE
  /* istanbul ignore if  */
  options.styleTagTransform(css, styleElement, options.options);
}
function removeStyleElement(styleElement) {
  // istanbul ignore if
  if (styleElement.parentNode === null) {
    return false;
  }
  styleElement.parentNode.removeChild(styleElement);
}

/* istanbul ignore next  */
function domAPI(options) {
  if (typeof document === "undefined") {
    return {
      update: function update() {},
      remove: function remove() {}
    };
  }
  var styleElement = options.insertStyleElement(options);
  return {
    update: function update(obj) {
      apply(styleElement, options, obj);
    },
    remove: function remove() {
      removeStyleElement(styleElement);
    }
  };
}
module.exports = domAPI;

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js":
/*!*******************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
  \*******************************************************************************/
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function styleTagTransform(css, styleElement) {
  if (styleElement.styleSheet) {
    styleElement.styleSheet.cssText = css;
  } else {
    while (styleElement.firstChild) {
      styleElement.removeChild(styleElement.firstChild);
    }
    styleElement.appendChild(document.createTextNode(css));
  }
}
module.exports = styleTagTransform;

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/colorPicker/colorComponentEntry.js":
/*!*******************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/colorPicker/colorComponentEntry.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1326504__) => {

"use strict";
__nested_webpack_require_1326504__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1326504__.d(__nested_webpack_exports__, {
/* harmony export */   ColorComponentEntry: () => (/* binding */ ColorComponentEntry)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1326504__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1326504__(/*! react */ "../../../../node_modules/react/index.js");


class ColorComponentEntry extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    updateValue(valueString) {
        if (/[^0-9.-]/g.test(valueString)) {
            return;
        }
        let valueAsNumber = parseInt(valueString);
        if (isNaN(valueAsNumber)) {
            return;
        }
        if (this.props.max != undefined && valueAsNumber > this.props.max) {
            valueAsNumber = this.props.max;
        }
        if (this.props.min != undefined && valueAsNumber < this.props.min) {
            valueAsNumber = this.props.min;
        }
        this.props.onChange(valueAsNumber);
    }
    lock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = true;
        }
    }
    unlock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-component", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-component-value", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", step: 1, className: "numeric-input", value: this.props.value, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (evt) => this.updateValue(evt.target.value), disabled: this.props.disabled }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-component-label", children: this.props.label })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1329049__) => {

"use strict";
__nested_webpack_require_1329049__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1329049__.d(__nested_webpack_exports__, {
/* harmony export */   ColorPicker: () => (/* binding */ ColorPicker)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1329049__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1329049__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1329049__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1329049__.n(core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1329049__(/*! ./colorComponentEntry */ "../../../dev/sharedUiComponents/dist/colorPicker/colorComponentEntry.js");
/* harmony import */ var _hexColor__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1329049__(/*! ./hexColor */ "../../../dev/sharedUiComponents/dist/colorPicker/hexColor.js");
/* harmony import */ var _colorPicker_scss__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1329049__(/*! ./colorPicker.scss */ "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss");







/**
 * Class used to create a color picker
 */
class ColorPicker extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        if (this.props.color instanceof core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4) {
            this.state = { color: new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3(this.props.color.r, this.props.color.g, this.props.color.b), alpha: this.props.color.a };
        }
        else {
            this.state = { color: this.props.color.clone(), alpha: 1 };
        }
        this._saturationRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._hueRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    shouldComponentUpdate(nextProps, nextState) {
        return nextProps.color.toHexString() !== this.props.color.toHexString() || nextState.color.toHexString() !== this.props.color.toHexString();
    }
    onSaturationPointerDown(evt) {
        this._evaluateSaturation(evt);
        this._isSaturationPointerDown = true;
        evt.currentTarget.setPointerCapture(evt.pointerId);
    }
    onSaturationPointerUp(evt) {
        this._isSaturationPointerDown = false;
        evt.currentTarget.releasePointerCapture(evt.pointerId);
    }
    onSaturationPointerMove(evt) {
        if (!this._isSaturationPointerDown) {
            return;
        }
        this._evaluateSaturation(evt);
    }
    onHuePointerDown(evt) {
        this._evaluateHue(evt);
        this._isHuePointerDown = true;
        evt.currentTarget.setPointerCapture(evt.pointerId);
    }
    onHuePointerUp(evt) {
        this._isHuePointerDown = false;
        evt.currentTarget.releasePointerCapture(evt.pointerId);
    }
    onHuePointerMove(evt) {
        if (!this._isHuePointerDown) {
            return;
        }
        this._evaluateHue(evt);
    }
    _evaluateSaturation(evt) {
        const left = evt.nativeEvent.offsetX;
        const top = evt.nativeEvent.offsetY;
        const saturation = Math.min(1, Math.max(0.0001, left / this._saturationRef.current.clientWidth));
        const value = Math.min(1, Math.max(0.0001, 1 - top / this._saturationRef.current.clientHeight));
        if (this.props.debugMode) {
            core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Logger.Log("Saturation: " + saturation);
            core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Logger.Log("Value: " + value);
        }
        const hsv = this.state.color.toHSV();
        core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.HSVtoRGBToRef(hsv.r, saturation, value, this.state.color);
        if (this.state.alpha === 0) {
            this.setState({ alpha: 1 });
        }
        this.setState({ color: this.state.color });
    }
    _evaluateHue(evt) {
        const left = evt.nativeEvent.offsetX;
        const hue = 360 * Math.min(0.9999, Math.max(0.0001, left / this._hueRef.current.clientWidth));
        if (this.props.debugMode) {
            core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Logger.Log("Hue: " + hue);
        }
        const hsv = this.state.color.toHSV();
        core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.HSVtoRGBToRef(hue, Math.max(hsv.g, 0.01), Math.max(hsv.b, 0.01), this.state.color);
        this.setState({ color: this.state.color });
    }
    componentDidUpdate() {
        this.raiseOnColorChanged();
    }
    raiseOnColorChanged() {
        if (!this.props.onColorChanged) {
            return;
        }
        if (this.props.color instanceof core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4) {
            const newColor4 = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4.FromColor3(this.state.color, this.state.alpha);
            this.props.onColorChanged(newColor4);
            return;
        }
        this.props.onColorChanged(this.state.color.clone());
    }
    render() {
        const color4 = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4.FromColor3(this.state.color);
        color4.a = this.state.alpha;
        const colorHex = color4.toHexString();
        const hsv = this.state.color.toHSV();
        const colorRef = new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3();
        core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.HSVtoRGBToRef(hsv.r, 1, 1, colorRef);
        const colorHexRef = colorRef.toHexString();
        const hasAlpha = this.props.color instanceof core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-container" + (this.props.linearhint ? " with-hints" : ""), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-saturation", onPointerMove: (e) => this.onSaturationPointerMove(e), onPointerDown: (e) => this.onSaturationPointerDown(e), onPointerUp: (e) => this.onSaturationPointerUp(e), ref: this._saturationRef, style: {
                        background: colorHexRef,
                    }, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-saturation-white" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-saturation-black" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-saturation-cursor", style: {
                                top: `${-(hsv.b * 100) + 100}%`,
                                left: `${hsv.g * 100}%`,
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-hue", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hue-color", style: {
                                background: colorHex,
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hue-slider", ref: this._hueRef, onPointerMove: (e) => this.onHuePointerMove(e), onPointerDown: (e) => this.onHuePointerDown(e), onPointerUp: (e) => this.onHuePointerUp(e), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hue-cursor", style: {
                                    left: `${(hsv.r / 360.0) * 100}%`,
                                    border: `1px solid ` + colorHexRef,
                                } }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-alpha" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-rgb", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "red", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__.ColorComponentEntry, { lockObject: this.props.lockObject, label: "R", min: 0, max: 255, value: Math.round(this.state.color.r * 255), onChange: (value) => {
                                    this.state.color.r = value / 255.0;
                                    this.forceUpdate();
                                } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "green", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__.ColorComponentEntry, { lockObject: this.props.lockObject, label: "G", min: 0, max: 255, value: Math.round(this.state.color.g * 255), onChange: (value) => {
                                    this.state.color.g = value / 255.0;
                                    this.forceUpdate();
                                } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "blue", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__.ColorComponentEntry, { lockObject: this.props.lockObject, label: "B", min: 0, max: 255, value: Math.round(this.state.color.b * 255), onChange: (value) => {
                                    this.state.color.b = value / 255.0;
                                    this.forceUpdate();
                                } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "alpha" + (hasAlpha ? "" : " grayed"), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__.ColorComponentEntry, { lockObject: this.props.lockObject, label: "A", min: 0, max: 255, value: Math.round(this.state.alpha * 255), onChange: (value) => {
                                    this.setState({ alpha: value / 255.0 });
                                    this.forceUpdate();
                                } }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-hex", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hex-label", children: "Hex" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hex-value", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_hexColor__WEBPACK_IMPORTED_MODULE_4__.HexColor, { lockObject: this.props.lockObject, expectedLength: hasAlpha ? 8 : 6, value: colorHex, onChange: (value) => {
                                    if (hasAlpha) {
                                        const color4 = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4.FromHexString(value);
                                        this.setState({ color: new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3(color4.r, color4.g, color4.b), alpha: color4.a });
                                    }
                                    else {
                                        this.setState({ color: core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.FromHexString(value) });
                                    }
                                } }) })] }), this.props.linearhint && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-warning", children: "(Note: color is stored in linear mode and was converted to gamma to be displayed here (toGammaSpace() / toLinearSpace()))" }))] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/colorPicker/hexColor.js":
/*!********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/colorPicker/hexColor.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1341098__) => {

"use strict";
__nested_webpack_require_1341098__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1341098__.d(__nested_webpack_exports__, {
/* harmony export */   HexColor: () => (/* binding */ HexColor)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1341098__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1341098__(/*! react */ "../../../../node_modules/react/index.js");


class HexColor extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { hex: this.props.value.replace("#", "") };
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (nextProps.value !== this.props.value) {
            nextState.hex = nextProps.value.replace("#", "");
        }
        return true;
    }
    lock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = true;
        }
    }
    unlock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    updateHexValue(valueString) {
        if (valueString != "" && /^[0-9A-Fa-f]+$/g.test(valueString) == false) {
            return;
        }
        this.setState({ hex: valueString });
        if (valueString.length !== this.props.expectedLength) {
            if (this.props.expectedLength === 8 && valueString.length === 6) {
                valueString = valueString + "FF";
            }
            else if (this.props.expectedLength === 6 && valueString.length === 8) {
                valueString = valueString.substring(0, 6);
            }
            else {
                return;
            }
        }
        this.props.onChange("#" + valueString);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "string", className: "hex-input", value: this.state.hex, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (evt) => this.updateHexValue(evt.target.value) }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/Button.js":
/*!*****************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/Button.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1343574__) => {

"use strict";
__nested_webpack_require_1343574__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1343574__.d(__nested_webpack_exports__, {
/* harmony export */   Button: () => (/* binding */ Button)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1343574__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _Button_module_scss__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1343574__(/*! ./Button.module.scss */ "../../../dev/sharedUiComponents/dist/components/Button.module.scss");
/* harmony import */ var _classNames__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1343574__(/*! ./classNames */ "../../../dev/sharedUiComponents/dist/components/classNames.js");



const Button = ({ disabled, active, onClick, children, color, size, title, backgroundColor }) => {
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: (0,_classNames__WEBPACK_IMPORTED_MODULE_2__.ClassNames)({ button: true, active, wide: size === "wide", small: size === "small", smaller: size === "smaller", light: color === "light", dark: color === "dark" }, _Button_module_scss__WEBPACK_IMPORTED_MODULE_1__), disabled: disabled, onClick: onClick, title: title, style: { backgroundColor }, children: children }));
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/Icon.js":
/*!***************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/Icon.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1345245__) => {

"use strict";
__nested_webpack_require_1345245__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1345245__.d(__nested_webpack_exports__, {
/* harmony export */   Icon: () => (/* binding */ Icon)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1345245__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _classNames__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1345245__(/*! ./classNames */ "../../../dev/sharedUiComponents/dist/components/classNames.js");
/* harmony import */ var _Icon_module_scss__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1345245__(/*! ./Icon.module.scss */ "../../../dev/sharedUiComponents/dist/components/Icon.module.scss");



const Icon = ({ color = "dark", icon }) => {
    return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: icon, style: { width: "100%", height: "100%" }, className: (0,_classNames__WEBPACK_IMPORTED_MODULE_1__.ClassNames)({ light: color === "light" }, _Icon_module_scss__WEBPACK_IMPORTED_MODULE_2__) });
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/MessageDialog.js":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/MessageDialog.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1346711__) => {

"use strict";
__nested_webpack_require_1346711__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1346711__.d(__nested_webpack_exports__, {
/* harmony export */   MessageDialog: () => (/* binding */ MessageDialog)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1346711__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1346711__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _classNames__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1346711__(/*! ./classNames */ "../../../dev/sharedUiComponents/dist/components/classNames.js");
/* harmony import */ var _MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1346711__(/*! ./MessageDialog.module.scss */ "../../../dev/sharedUiComponents/dist/components/MessageDialog.module.scss");

/* eslint-disable @typescript-eslint/naming-convention */



const MessageDialog = (props) => {
    const [message, setMessage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(props.message);
    const [isError, setIsError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(props.isError);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
        setMessage(props.message);
        setIsError(props.isError);
    }, [props]);
    const onClick = () => {
        setMessage("");
        if (props.onClose) {
            props.onClose();
        }
    };
    if (!message) {
        return null;
    }
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_3__["dialog-container"], children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: _MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_3__.dialog, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_3__["dialog-message"], children: message }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_3__["dialog-buttons"], children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: (0,_classNames__WEBPACK_IMPORTED_MODULE_2__.ClassNames)({ "dialog-button-ok": true, error: isError }, _MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_3__), onClick: onClick, children: "OK" }) })] }) }));
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.js":
/*!******************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1349615__) => {

"use strict";
__nested_webpack_require_1349615__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1349615__.d(__nested_webpack_exports__, {
/* harmony export */   TextInputWithSubmit: () => (/* binding */ TextInputWithSubmit)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1349615__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1349615__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1349615__(/*! ./Button */ "../../../dev/sharedUiComponents/dist/components/Button.js");
/* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1349615__(/*! ./Icon */ "../../../dev/sharedUiComponents/dist/components/Icon.js");
/* harmony import */ var _TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1349615__(/*! ./TextInputWithSubmit.module.scss */ "../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.module.scss");
/* harmony import */ var _imgs_confirmGridElementDark_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1349615__(/*! ../imgs/confirmGridElementDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/confirmGridElementDark.svg");
/* harmony import */ var _imgs_deleteGridElementDark_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1349615__(/*! ../imgs/deleteGridElementDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/deleteGridElementDark.svg");
/* harmony import */ var _classNames__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1349615__(/*! ./classNames */ "../../../dev/sharedUiComponents/dist/components/classNames.js");








/**
 * This component represents a text input that can be submitted or cancelled on buttons
 * @param props properties
 * @returns TextInputWithSubmit element
 */
const TextInputWithSubmit = (props) => {
    const [value, setValue] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    const [valid, setValid] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(props.validateValue ? props.validateValue(value) : true);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
        setValid(props.validateValue ? props.validateValue(value) : true);
    }, [value]);
    const onChange = (event) => {
        setValue(event.target.value);
    };
    const onClickSubmit = () => {
        props.submitValue(value);
    };
    const onClickCancel = () => {
        props.cancelSubmit?.();
        setValue("");
    };
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: (0,_classNames__WEBPACK_IMPORTED_MODULE_5__.ClassNames)({ line: true, valid, invalid: !valid }, _TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_4__), children: [props.label && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { children: props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { className: _TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_4__.input, type: "text", placeholder: props.placeholder, value: value, onChange: onChange }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.Button, { color: "light", size: "smaller", backgroundColor: "inherit", onClick: onClickSubmit, disabled: !valid, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Icon__WEBPACK_IMPORTED_MODULE_3__.Icon, { icon: _imgs_confirmGridElementDark_svg__WEBPACK_IMPORTED_MODULE_6__, color: "dark" }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.Button, { color: "light", size: "smaller", backgroundColor: "inherit", onClick: onClickCancel, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Icon__WEBPACK_IMPORTED_MODULE_3__.Icon, { icon: _imgs_deleteGridElementDark_svg__WEBPACK_IMPORTED_MODULE_7__, color: "dark" }) })] })] }));
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/classNames.js":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/classNames.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1354021__) => {

"use strict";
__nested_webpack_require_1354021__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1354021__.d(__nested_webpack_exports__, {
/* harmony export */   ClassNames: () => (/* binding */ ClassNames),
/* harmony export */   JoinClassNames: () => (/* binding */ JoinClassNames)
/* harmony export */ });
function ClassNames(names, styleObject) {
    let string = "";
    for (const name in names) {
        if (names[name]) {
            string += styleObject[name] + " ";
        }
    }
    return string;
}
function JoinClassNames(styleObject, ...names) {
    let string = "";
    for (const name of names) {
        if (name && styleObject[name]) {
            string += styleObject[name] + " ";
        }
    }
    return string;
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.js":
/*!*************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1355201__) => {

"use strict";
__nested_webpack_require_1355201__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1355201__.d(__nested_webpack_exports__, {
/* harmony export */   OptionsLineComponent: () => (/* binding */ OptionsLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1355201__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1355201__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _TextInputWithSubmit__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1355201__(/*! ../TextInputWithSubmit */ "../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.js");
/* harmony import */ var _OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1355201__(/*! ./OptionsLineComponent.module.scss */ "../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.module.scss");




/**
 * We have two possible states. The user starts in the Default option, and can choose to
 * add a new option.
 */
var OptionStates;
(function (OptionStates) {
    OptionStates[OptionStates["Default"] = 0] = "Default";
    OptionStates[OptionStates["Adding"] = 1] = "Adding";
})(OptionStates || (OptionStates = {}));
const _OptionAddKey = "addCustomOption";
const OptionsLineComponent = (props) => {
    const [optionState, setOptionState] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(OptionStates.Default); // State of the component
    const onOptionChange = (evt) => {
        if (evt.target.value === _OptionAddKey) {
            setOptionState(OptionStates.Adding);
        }
        else {
            props.onOptionSelected(evt.target.value);
        }
    };
    const onOptionAdd = (value) => {
        const newOptionText = value;
        const newOption = { label: newOptionText, value: newOptionText, id: Date.now().toString() };
        props.onOptionAdded?.(newOption);
        props.onOptionSelected(newOption.value);
        setOptionState(OptionStates.Default);
    };
    const onCancelOptionAdd = () => {
        setOptionState(OptionStates.Default);
    };
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: _OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_3__.optionsLine, children: [optionState === OptionStates.Adding && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_TextInputWithSubmit__WEBPACK_IMPORTED_MODULE_2__.TextInputWithSubmit, { submitValue: onOptionAdd, placeholder: props.addOptionPlaceholder, validateValue: props.validateNewOptionValue, cancelSubmit: onCancelOptionAdd })), optionState === OptionStates.Default && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { className: _OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_3__.optionsSelect, onChange: onOptionChange, value: props.selectedOptionValue, children: [props.onOptionAdded && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: _OptionAddKey, children: props.addOptionText ?? "Custom" }, _OptionAddKey)), props.options.map((option) => ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: option.value, children: option.label }, option.id)))] }))] }));
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1358881__) => {

"use strict";
__nested_webpack_require_1358881__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1358881__.d(__nested_webpack_exports__, {
/* harmony export */   copyCommandToClipboard: () => (/* binding */ copyCommandToClipboard),
/* harmony export */   getClassNameWithNamespace: () => (/* binding */ getClassNameWithNamespace)
/* harmony export */ });
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1358881__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1358881__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_0__);

// Check if BABYLON namespace exists
let babylonNamespace = "";
const globalObject = typeof __nested_webpack_require_1358881__.g !== "undefined" ? __nested_webpack_require_1358881__.g : typeof window !== "undefined" ? window : undefined;
if (typeof globalObject !== "undefined") {
    if (typeof globalObject.BABYLON !== "undefined") {
        babylonNamespace = "BABYLON.";
    }
}
// Inspired by previous copyToClipboard() function which was copying Color3
// Copies strCommand to clipboard
function copyCommandToClipboard(strCommand) {
    const element = document.createElement("div");
    element.textContent = strCommand;
    document.body.appendChild(element);
    if (window.getSelection) {
        const range = document.createRange();
        range.selectNode(element);
        window.getSelection().removeAllRanges();
        window.getSelection().addRange(range);
    }
    document.execCommand("copy");
    element.remove();
}
// Return the class name of the considered target
// babylonNamespace is either "" (ES6) or "BABYLON."
function getClassNameWithNamespace(obj) {
    let className = (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_0__.GetClassName)(obj);
    if (className.includes("BABYLON.")) {
        className = className.split("BABYLON.")[1];
    }
    return { className, babylonNamespace };
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js":
/*!***************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1361246__) => {

"use strict";
__nested_webpack_require_1361246__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1361246__.d(__nested_webpack_exports__, {
/* harmony export */   CheckBoxLineComponent: () => (/* binding */ CheckBoxLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1361246__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1361246__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1361246__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1361246__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _targetsProxy__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1361246__(/*! ./targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1361246__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");
/* harmony import */ var _imgs_toggleOnIcon_40px_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1361246__(/*! ../imgs/toggleOnIcon_40px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_40px.svg");
/* harmony import */ var _imgs_toggleOffIcon_40px_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1361246__(/*! ../imgs/toggleOffIcon_40px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_40px.svg");
/* harmony import */ var _imgs_toggleOnIcon_30px_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1361246__(/*! ../imgs/toggleOnIcon_30px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_30px.svg");
/* harmony import */ var _imgs_toggleMixedIcon_30px_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1361246__(/*! ../imgs/toggleMixedIcon_30px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleMixedIcon_30px.svg");
/* harmony import */ var _imgs_toggleOffIcon_30px_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1361246__(/*! ../imgs/toggleOffIcon_30px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_30px.svg");











const Icons = {
    size30: {
        on: _imgs_toggleOnIcon_30px_svg__WEBPACK_IMPORTED_MODULE_5__,
        mixed: _imgs_toggleMixedIcon_30px_svg__WEBPACK_IMPORTED_MODULE_6__,
        off: _imgs_toggleOffIcon_30px_svg__WEBPACK_IMPORTED_MODULE_7__,
    },
    size40: {
        on: _imgs_toggleOnIcon_40px_svg__WEBPACK_IMPORTED_MODULE_8__,
        mixed: "", // unneeded
        off: _imgs_toggleOffIcon_40px_svg__WEBPACK_IMPORTED_MODULE_9__,
    },
};
class CheckBoxLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        if (this.props.isSelected) {
            this.state = { isSelected: this.props.isSelected(), isConflict: false };
        }
        else {
            this.state = {
                isSelected: this.props.target[this.props.propertyName] === true,
                isConflict: this.props.target[this.props.propertyName] === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder,
            };
        }
        if (this.props.disabled) {
            this.state = { ...this.state, isDisabled: this.props.disabled };
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        let selected;
        if (nextProps.isSelected) {
            selected = nextProps.isSelected();
        }
        else {
            selected = nextProps.target[nextProps.propertyName] === true;
            if (nextProps.target[nextProps.propertyName] === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder) {
                nextState.isConflict = true;
            }
        }
        if (selected !== nextState.isSelected || this._localChange) {
            nextState.isSelected = selected;
            this._localChange = false;
            return true;
        }
        if (nextProps.disabled !== nextState.isDisabled) {
            return true;
        }
        return nextProps.label !== this.props.label || nextProps.target !== this.props.target || nextState.isConflict !== this.state.isConflict;
    }
    onChange() {
        this._localChange = true;
        if (this.props.onSelect) {
            this.props.onSelect(!this.state.isSelected);
        }
        else {
            if (this.props.onPropertyChangedObservable) {
                this.props.onPropertyChangedObservable.notifyObservers({
                    object: this.props.target,
                    property: this.props.propertyName,
                    value: !this.state.isSelected,
                    initialValue: this.state.isSelected,
                });
            }
            if (this.props.target && this.props.propertyName) {
                this.props.target[this.props.propertyName] = !this.state.isSelected;
            }
        }
        if (this.props.onValueChanged) {
            this.props.onValueChanged();
        }
        this.setState({ isSelected: !this.state.isSelected, isConflict: false });
    }
    // Copy to clipboard the code this checkbox actually does
    // Example : mesh.checkCollisions = true;
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const strCommand = targetName + "." + targetProperty + " = " + value + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        const icons = this.props.large ? Icons.size40 : Icons.size30;
        const icon = this.state.isConflict ? icons.mixed : this.state.isSelected ? icons.on : icons.off;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "checkBoxLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), this.props.label && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.iconLabel, children: this.props.label })), this.props.faIcons && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_3__.FontAwesomeIcon, { className: `cbx ${this.props.disabled ? "disabled" : ""}`, icon: this.state.isSelected ? this.props.faIcons.enabled : this.props.faIcons.disabled, onClick: () => !this.props.disabled && this.onChange() })), !this.props.faIcons && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "checkBox", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: `container lbl${this.props.disabled ? " disabled" : ""} ${this.state.isSelected ? "checked" : ""}`, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", className: `cbx hidden ${this.state.isConflict ? "conflict" : ""}`, checked: this.state.isSelected, onChange: () => this.onChange(), disabled: !!this.props.disabled }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "icon", src: icon, alt: this.props.label })] }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_10__, alt: "Copy" }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1369925__) => {

"use strict";
__nested_webpack_require_1369925__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1369925__.d(__nested_webpack_exports__, {
/* harmony export */   ColorLine: () => (/* binding */ ColorLine)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1369925__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1369925__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1369925__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1369925__.n(core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _numericInputComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1369925__(/*! ./numericInputComponent */ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1369925__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1369925__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1369925__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var _colorPickerComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1369925__(/*! ./colorPickerComponent */ "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js");
/* harmony import */ var _targetsProxy__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1369925__(/*! ./targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1369925__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");










const emptyColor = new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(0, 0, 0, 0);
class ColorLine extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isExpanded: false, color: this.getValue() };
        const target = this.props.target;
        target._isLinearColor = props.isLinear; // so that replayRecorder can append toLinearSpace() as appropriate
    }
    shouldComponentUpdate(nextProps, nextState) {
        const stateColor = nextState.color;
        const propsColor = this.getValue(nextProps);
        if (stateColor !== this.state.color) {
            nextState.color = stateColor;
            return true;
        }
        if (propsColor !== this.state.color) {
            nextState.color = propsColor;
            return true;
        }
        if (nextState.isExpanded !== this.state.isExpanded) {
            return true;
        }
        return false;
    }
    getValue(props = this.props) {
        const target = props.target;
        const property = target[props.propertyName];
        if (!property)
            return emptyColor;
        if (typeof property === "string") {
            if (property === _targetsProxy__WEBPACK_IMPORTED_MODULE_7__.conflictingValuesPlaceholder) {
                return emptyColor;
            }
            return this._convertToColor(property);
        }
        else {
            if (props.isLinear) {
                return property.toGammaSpace();
            }
            return property.clone();
        }
    }
    setColorFromString(colorString) {
        const color = this._convertToColor(colorString);
        this.setColor(color);
    }
    setColor(newColor) {
        this.setState({ color: newColor.clone() });
        if (this.props.isLinear) {
            newColor.toLinearSpaceToRef(newColor);
        }
        // whether to set properties to color3 or color4
        const setColor = this.props.disableAlpha ? this._toColor3(newColor) : newColor;
        const target = this.props.target;
        const initialValue = target[this.props.propertyName];
        const value = typeof target[this.props.propertyName] === "string" ? setColor.toHexString() : setColor;
        // make the change
        target[this.props.propertyName] = value;
        // notify observers
        if (this.props.onPropertyChangedObservable) {
            this.props.onPropertyChangedObservable.notifyObservers({
                object: target,
                property: this.props.propertyName,
                value,
                initialValue,
            });
        }
        if (this.props.onChange) {
            this.props.onChange();
        }
    }
    switchExpandState() {
        this.setState({ isExpanded: !this.state.isExpanded });
    }
    updateStateR(value) {
        this.setColor(new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(value, this.state.color.g, this.state.color.b, this.state.color.a));
    }
    updateStateG(value) {
        this.setColor(new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(this.state.color.r, value, this.state.color.b, this.state.color.a));
    }
    updateStateB(value) {
        this.setColor(new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(this.state.color.r, this.state.color.g, value, this.state.color.a));
    }
    updateStateA(value) {
        if (this.props.disableAlpha) {
            return;
        }
        this.setColor(new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(this.state.color.r, this.state.color.g, this.state.color.b, value));
    }
    _convertToColor(color) {
        if (color === "" || color === "transparent") {
            return emptyColor;
        }
        if (color.substring(0, 1) !== "#" || (color.length !== 7 && color.length !== 9)) {
            const d = document.createElement("div");
            d.style.color = color;
            document.body.append(d);
            const rgb = window.getComputedStyle(d).color;
            document.body.removeChild(d);
            const rgbArray = rgb
                .substring(4, rgb.length - 1)
                .replace(/ /g, "")
                .split(",");
            const alpha = rgbArray.length > 3 ? parseInt(rgbArray[3]) / 255 : 1.0;
            return new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(parseInt(rgbArray[0]) / 255, parseInt(rgbArray[1]) / 255, parseInt(rgbArray[2]) / 255, alpha);
        }
        if (this.props.disableAlpha) {
            const color3 = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.FromHexString(color);
            return new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(color3.r, color3.g, color3.b, 1.0);
        }
        return core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4.FromHexString(color);
    }
    _toColor3(color) {
        return new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3(color.r, color.g, color.b);
    }
    // Copy to clipboard the code this Color3 actually does
    // Example : material.diffuseColor = new BABYLON.Vector3(0,1,0);
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const hex = this.state.color.toHexString();
            let strColor;
            if (value.a) {
                strColor = "new " + babylonNamespace + "Color4(" + value.r + ", " + value.g + ", " + value.b + ", " + value.a + ")";
            }
            else {
                strColor = "new " + babylonNamespace + "Color3(" + value.r + ", " + value.g + ", " + value.b + ")";
            }
            strColor += ";// (HEX : " + hex;
            const strCommand = targetName + "." + targetProperty + " = " + strColor + " , debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        const chevron = this.state.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faMinus }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faPlus });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color3Line", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "firstLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color3", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorPickerComponent__WEBPACK_IMPORTED_MODULE_6__.ColorPickerLine, { lockObject: this.props.lockObject, linearHint: this.props.isLinear, value: this.props.disableAlpha ? this._toColor3(this.state.color) : this.state.color, onColorChanged: (colorString) => {
                                    this.setColorFromString(colorString);
                                } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: chevron }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_9__, alt: "Copy" }) })] }), this.state.isExpanded && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "r", labelTooltip: "Red", value: this.state.color.r, onChange: (value) => this.updateStateR(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "g", labelTooltip: "Green", value: this.state.color.g, onChange: (value) => this.updateStateG(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "b", labelTooltip: "Blue", value: this.state.color.b, onChange: (value) => this.updateStateB(value) }), this.props.disableAlpha || ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "a", labelTooltip: "Alpha", value: this.state.color.a, onChange: (value) => this.updateStateA(value) }))] }))] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1382216__) => {

"use strict";
__nested_webpack_require_1382216__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1382216__.d(__nested_webpack_exports__, {
/* harmony export */   ColorPickerLine: () => (/* binding */ ColorPickerLine)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1382216__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1382216__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _colorPicker_colorPicker__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1382216__(/*! ../colorPicker/colorPicker */ "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js");



class ColorPickerLine extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { pickerEnabled: false, color: this.props.value, hex: this.getHexString(props) };
        this._floatRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._floatHostRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    syncPositions() {
        const div = this._floatRef.current;
        const host = this._floatHostRef.current;
        if (!div || !host) {
            return;
        }
        let top = host.getBoundingClientRect().top;
        const height = div.getBoundingClientRect().height;
        if (top + height + 10 > window.innerHeight) {
            top = window.innerHeight - height - 10;
        }
        div.style.top = top + "px";
        if (!this.props.shouldPopRight) {
            div.style.left = host.getBoundingClientRect().left - div.getBoundingClientRect().width + "px";
        }
        else {
            div.style.left = host.getBoundingClientRect().left + "px";
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        const diffProps = this.getHexString(nextProps) !== this.getHexString();
        if (diffProps) {
            nextState.color = nextProps.value;
            nextState.hex = this.getHexString(nextProps);
        }
        return diffProps || nextState.hex !== this.state.hex || nextState.pickerEnabled !== this.state.pickerEnabled;
    }
    getHexString(props = this.props) {
        return props.value.toHexString();
    }
    componentDidUpdate() {
        this.syncPositions();
    }
    componentDidMount() {
        this.syncPositions();
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-rect-background", ref: this._floatHostRef, onClick: () => this.setState({ pickerEnabled: true }), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-rect", style: { background: this.state.hex } }) }), this.state.pickerEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-cover", onClick: (evt) => {
                            if (evt.target !== this._floatRef.current?.ownerDocument?.querySelector(".color-picker-cover")) {
                                return;
                            }
                            this.setState({ pickerEnabled: false });
                        }, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-float", ref: this._floatRef, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorPicker_colorPicker__WEBPACK_IMPORTED_MODULE_2__.ColorPicker, { lockObject: this.props.lockObject || {}, color: this.state.color, linearhint: this.props.linearHint, onColorChanged: (color) => {
                                    const hex = color.toHexString();
                                    this.setState({ hex, color });
                                    this.props.onColorChanged(hex);
                                } }) }) }) }))] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js":
/*!*****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1386925__) => {

"use strict";
__nested_webpack_require_1386925__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1386925__.d(__nested_webpack_exports__, {
/* harmony export */   FileButtonLine: () => (/* binding */ FileButtonLine)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1386925__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1386925__(/*! react */ "../../../../node_modules/react/index.js");


class FileButtonLine extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._id = FileButtonLine._IDGenerator++;
        this._uploadInputRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    onChange(evt) {
        const files = evt.target.files;
        if (files && files.length) {
            this.props.onClick(files[0]);
        }
        evt.target.value = "";
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "buttonLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: "file-upload" + this._id, className: "file-upload", children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: this._uploadInputRef, id: "file-upload" + this._id, type: "file", accept: this.props.accept, onChange: (evt) => this.onChange(evt) })] }));
    }
}
FileButtonLine._IDGenerator = 0;


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1389030__) => {

"use strict";
__nested_webpack_require_1389030__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1389030__.d(__nested_webpack_exports__, {
/* harmony export */   FloatLineComponent: () => (/* binding */ FloatLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1389030__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1389030__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1389030__(/*! ./sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1389030__(/*! core/Misc/tools */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1389030__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _targetsProxy__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1389030__(/*! ./targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _inputArrowsComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1389030__(/*! ./inputArrowsComponent */ "../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1389030__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1389030__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");








class FloatLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        const currentValue = this.props.target[this.props.propertyName];
        this.state = { value: this.getValueString(currentValue, this.props), dragging: false };
        this._store = currentValue;
    }
    componentWillUnmount() {
        this.unlock();
    }
    getValueString(value, props) {
        if (value) {
            if (value === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder) {
                return _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder;
            }
            else if (props.isInteger) {
                return value.toFixed(0);
            }
            else {
                return value.toFixed(props.digits || 4);
            }
        }
        return "0";
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (this._localChange) {
            this._localChange = false;
            return true;
        }
        const newValue = nextProps.target[nextProps.propertyName];
        const newValueString = this.getValueString(newValue, nextProps);
        if (newValueString !== nextState.value) {
            nextState.value = newValueString;
            return true;
        }
        if (nextState.dragging != this.state.dragging || nextProps.unit !== this.props.unit || nextProps.isInteger !== this.props.isInteger) {
            return true;
        }
        return false;
    }
    raiseOnPropertyChanged(newValue, previousValue) {
        if (this.props.onChange) {
            this.props.onChange(newValue);
        }
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName,
            value: newValue,
            initialValue: previousValue,
        });
    }
    updateValue(valueString) {
        if (/[^0-9.-]/g.test(valueString)) {
            return;
        }
        let valueAsNumber;
        if (this.props.isInteger) {
            valueAsNumber = parseInt(valueString);
        }
        else {
            valueAsNumber = parseFloat(valueString);
        }
        if (!isNaN(valueAsNumber)) {
            if (this.props.min !== undefined) {
                if (valueAsNumber < this.props.min) {
                    valueAsNumber = this.props.min;
                    valueString = valueAsNumber.toString();
                }
            }
            if (this.props.max !== undefined) {
                if (valueAsNumber > this.props.max) {
                    valueAsNumber = this.props.max;
                    valueString = valueAsNumber.toString();
                }
            }
        }
        else if (this.props.defaultValue != null) {
            valueAsNumber = this.props.defaultValue;
        }
        this._localChange = true;
        this.setState({ value: valueString });
        if (isNaN(valueAsNumber)) {
            return;
        }
        this.props.target[this.props.propertyName] = valueAsNumber;
        this.raiseOnPropertyChanged(valueAsNumber, this._store);
        this._store = valueAsNumber;
    }
    lock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = true;
        }
    }
    unlock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    incrementValue(amount, processStep = true) {
        if (processStep && this.props.step) {
            amount *= parseFloat(this.props.step);
        }
        let currentValue = parseFloat(this.state.value);
        if (isNaN(currentValue)) {
            currentValue = 0;
        }
        this.updateValue((currentValue + amount).toFixed(2));
    }
    onKeyDown(event) {
        const step = parseFloat(this.props.step || this.props.isInteger ? "1" : "0.01");
        const handleArrowKey = (sign) => {
            if (event.shiftKey) {
                sign *= 10;
                if (event.ctrlKey || event.metaKey) {
                    sign *= 10;
                }
            }
            this.incrementValue(sign * step, false);
            event.preventDefault();
        };
        if (event.key === "ArrowUp") {
            handleArrowKey(1);
        }
        else if (event.key === "ArrowDown") {
            handleArrowKey(-1);
        }
        if (event.key === "Enter" && this.props.onEnter) {
            this.props.onEnter(this._store);
        }
    }
    // Copy to clipboard the code this slider actually does
    // Example : BaseParticleSystem.minScaleX = 1.0;
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const strCommand = targetName + "." + targetProperty + " = " + value + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        let valueAsNumber;
        if (this.props.isInteger) {
            valueAsNumber = parseInt(this.state.value);
        }
        else {
            valueAsNumber = parseFloat(this.state.value);
        }
        let className = this.props.smallUI ? "short" : "value";
        if (this.state.dragging) {
            className += " dragging";
        }
        if (this.props.arrows) {
            className += " hasArrows";
        }
        const value = this.state.value === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder ? "" : this.state.value;
        const placeholder = this.state.value === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder ? _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder : "";
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [!this.props.useEuler && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: this.props.additionalClass ? this.props.additionalClass + " floatLine" : "floatLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (!this.props.icon || this.props.label != "") && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: className, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", step: this.props.step || this.props.isInteger ? "1" : "0.01", className: "numeric-input", onKeyDown: (evt) => this.onKeyDown(evt), value: value, onBlur: () => {
                                        this.unlock();
                                        if (this.props.onEnter) {
                                            this.props.onEnter(this._store);
                                        }
                                    }, placeholder: placeholder, onFocus: () => this.lock(), onChange: (evt) => this.updateValue(evt.target.value), disabled: this.props.disabled }), this.props.arrows && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_inputArrowsComponent__WEBPACK_IMPORTED_MODULE_5__.InputArrowsComponent, { incrementValue: (amount) => this.incrementValue(amount), setDragging: (newDragging) => {
                                        const currentDragging = this.state.dragging;
                                        // drag stopped
                                        if (!currentDragging && newDragging && this.props.onDragStart) {
                                            this.props.onDragStart(valueAsNumber);
                                        }
                                        else if (currentDragging && !newDragging && this.props.onDragStop) {
                                            this.props.onDragStop(valueAsNumber);
                                        }
                                        this.setState({ dragging: newDragging });
                                    } }))] }), this.props.unit, (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_7__, alt: "Copy" }) })] })), this.props.useEuler && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: this.props.label, minimum: 0, maximum: 360, step: 0.1, directValue: core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__.Tools.ToDegrees(valueAsNumber), onChange: (value) => this.updateValue(core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__.Tools.ToRadians(value).toString()) }))] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/iconComponent.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1400771__) => {

"use strict";
__nested_webpack_require_1400771__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1400771__.d(__nested_webpack_exports__, {
/* harmony export */   IconComponent: () => (/* binding */ IconComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1400771__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1400771__(/*! react */ "../../../../node_modules/react/index.js");


class IconComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    render() {
        return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.label, alt: this.props.label, color: "black", className: "icon", onDragStart: (evt) => evt.preventDefault() });
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1402042__) => {

"use strict";
__nested_webpack_require_1402042__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1402042__.d(__nested_webpack_exports__, {
/* harmony export */   InputArrowsComponent: () => (/* binding */ InputArrowsComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1402042__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1402042__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _valueUpArrowIcon_svg__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1402042__(/*! ./valueUpArrowIcon.svg */ "../../../dev/sharedUiComponents/dist/lines/valueUpArrowIcon.svg");
/* harmony import */ var _valueDownArrowIcon_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1402042__(/*! ./valueDownArrowIcon.svg */ "../../../dev/sharedUiComponents/dist/lines/valueDownArrowIcon.svg");




class InputArrowsComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor() {
        super(...arguments);
        this._arrowsRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._drag = (event) => {
            this.props.incrementValue(-event.movementY);
        };
        this._releaseListener = () => {
            this.props.setDragging(false);
            this._arrowsRef.current?.ownerDocument.exitPointerLock();
            this._arrowsRef.current?.ownerDocument.defaultView.removeEventListener("pointerup", this._releaseListener);
            this._arrowsRef.current?.ownerDocument.removeEventListener("pointerlockchange", this._lockChangeListener);
            this._arrowsRef.current?.ownerDocument.defaultView.removeEventListener("mousemove", this._drag);
        };
        this._lockChangeListener = () => {
            if (this._arrowsRef.current?.ownerDocument.pointerLockElement !== this._arrowsRef.current) {
                this._releaseListener();
            }
        };
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "arrows", ref: this._arrowsRef, onPointerDown: () => {
                this._arrowsRef.current?.ownerDocument.addEventListener("pointerlockchange", this._lockChangeListener);
                this._arrowsRef.current?.ownerDocument.defaultView.addEventListener("pointerup", this._releaseListener);
                this._arrowsRef.current?.ownerDocument.defaultView.addEventListener("mousemove", this._drag);
                this.props.setDragging(true);
                this._arrowsRef.current?.requestPointerLock();
            }, onDragStart: (evt) => evt.preventDefault(), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "upArrowIcon", src: _valueUpArrowIcon_svg__WEBPACK_IMPORTED_MODULE_2__, alt: "Increase Value" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "downArrowIcon", src: _valueDownArrowIcon_svg__WEBPACK_IMPORTED_MODULE_3__, alt: "Increase Value" })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js":
/*!***************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1405496__) => {

"use strict";
__nested_webpack_require_1405496__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1405496__.d(__nested_webpack_exports__, {
/* harmony export */   NumericInput: () => (/* binding */ NumericInput)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1405496__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1405496__(/*! react */ "../../../../node_modules/react/index.js");


class NumericInput extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        this.state = { value: this.props.value.toFixed(this.props.precision !== undefined ? this.props.precision : 3) };
    }
    componentWillUnmount() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (this._localChange) {
            this._localChange = false;
            return true;
        }
        if (nextProps.value.toString() !== nextState.value) {
            nextState.value = nextProps.value.toFixed(this.props.precision !== undefined ? this.props.precision : 3);
            return true;
        }
        return false;
    }
    updateValue(valueString) {
        if (/[^0-9.-]/g.test(valueString)) {
            return;
        }
        const valueAsNumber = parseFloat(valueString);
        this._localChange = true;
        this.setState({ value: valueString });
        if (isNaN(valueAsNumber)) {
            return;
        }
        this.props.onChange(valueAsNumber);
    }
    onBlur() {
        this._localChange = false;
        const valueAsNumber = parseFloat(this.state.value);
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
        if (isNaN(valueAsNumber)) {
            this.props.onChange(this.props.value);
            return;
        }
        this.props.onChange(valueAsNumber);
    }
    incrementValue(amount) {
        let currentValue = parseFloat(this.state.value);
        if (isNaN(currentValue)) {
            currentValue = 0;
        }
        this.updateValue((currentValue + amount).toFixed(this.props.precision !== undefined ? this.props.precision : 3));
    }
    onKeyDown(evt) {
        const step = this.props.step || 1;
        const handleArrowKey = (sign) => {
            if (evt.shiftKey) {
                sign *= 10;
                if (evt.ctrlKey || evt.metaKey) {
                    sign *= 10;
                }
            }
            this.incrementValue(sign * step);
            evt.preventDefault();
        };
        if (evt.key === "ArrowUp") {
            handleArrowKey(1);
        }
        else if (evt.key === "ArrowDown") {
            handleArrowKey(-1);
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "numeric", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), this.props.label && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "numeric-label", title: this.props.labelTooltip ?? this.props.label, children: `${this.props.label}: ` })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", step: this.props.step, className: "numeric-input", value: this.state.value, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => this.onKeyDown(evt), onFocus: () => {
                        if (this.props.lockObject) {
                            this.props.lockObject.lock = true;
                        }
                    }, onBlur: () => this.onBlur() })] }));
    }
}
// eslint-disable-next-line @typescript-eslint/naming-convention
NumericInput.defaultProps = {
    step: 1,
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1409918__) => {

"use strict";
__nested_webpack_require_1409918__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1409918__.d(__nested_webpack_exports__, {
/* harmony export */   Null_Value: () => (/* binding */ Null_Value),
/* harmony export */   OptionsLine: () => (/* binding */ OptionsLine)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1409918__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1409918__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1409918__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1409918__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");




// eslint-disable-next-line @typescript-eslint/naming-convention
const Null_Value = Number.MAX_SAFE_INTEGER;
class OptionsLine extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    _remapValueIn(value) {
        return this.props.allowNullValue && value === null ? Null_Value : value;
    }
    _remapValueOut(value) {
        return this.props.allowNullValue && value === Null_Value ? null : value;
    }
    _getValue(props) {
        if (props.extractValue) {
            return props.extractValue(props.target);
        }
        return props.target && props.propertyName ? props.target[props.propertyName] : props.options[props.defaultIfNull || 0];
    }
    constructor(props) {
        super(props);
        this._localChange = false;
        this.state = { value: this._remapValueIn(this._getValue(props)) };
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (this._localChange) {
            this._localChange = false;
            return true;
        }
        const newValue = this._remapValueIn(nextProps.extractValue ? nextProps.extractValue(this.props.target) : nextProps.target[nextProps.propertyName]);
        if (newValue != null && newValue !== nextState.value) {
            nextState.value = newValue;
            return true;
        }
        return false;
    }
    raiseOnPropertyChanged(newValue, previousValue) {
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName,
            value: newValue,
            initialValue: previousValue,
            allowNullValue: this.props.allowNullValue,
        });
    }
    setValue(value) {
        this.setState({ value: value });
    }
    updateValue(valueString) {
        const value = this.props.valuesAreStrings ? valueString : parseInt(valueString);
        this._localChange = true;
        const store = this.props.extractValue ? this.props.extractValue(this.props.target) : this.props.target[this.props.propertyName];
        if (!this.props.noDirectUpdate) {
            this.props.target[this.props.propertyName] = this._remapValueOut(value);
        }
        this.setState({ value: value });
        if (this.props.onSelect) {
            this.props.onSelect(value);
        }
        const newValue = this.props.extractValue ? this.props.extractValue(this.props.target) : this.props.target[this.props.propertyName];
        this.raiseOnPropertyChanged(newValue, store);
    }
    // Copy to clipboard the code this option actually does
    // Example : material.sideOrientation = 1;
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.extractValue ? this.props.extractValue(this.props.target) : this.props.target[this.props.propertyName];
            const strCommand = targetName + "." + targetProperty + " = " + value + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "listLine" + (this.props.className ? " " + this.props.className : ""), children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, color: "black", className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "options", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { onChange: (evt) => this.updateValue(evt.target.value), value: this.state.value ?? "", children: this.props.options.map((option, i) => {
                            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { selected: option.selected, value: option.value, title: option.label, children: option.label }, option.label + i));
                        }) }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_3__, alt: "Copy" }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1416227__) => {

"use strict";
__nested_webpack_require_1416227__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1416227__.d(__nested_webpack_exports__, {
/* harmony export */   SliderLineComponent: () => (/* binding */ SliderLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1416227__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1416227__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1416227__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1416227__(/*! core/Misc/tools */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1416227__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1416227__(/*! ./floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1416227__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");






class SliderLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        if (this.props.directValue !== undefined) {
            this.state = {
                value: this.props.directValue,
            };
        }
        else {
            let value = this.props.target[this.props.propertyName];
            if (value === undefined) {
                value = this.props.maximum;
            }
            this.state = { value: value };
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (nextProps.directValue !== undefined) {
            nextState.value = nextProps.directValue;
            return true;
        }
        if (nextProps.label !== this.props.label) {
            return true;
        }
        let currentState = nextProps.target[nextProps.propertyName];
        if (currentState === undefined) {
            currentState = nextProps.maximum;
        }
        if (currentState !== nextState.value || this._localChange || nextProps.maximum !== this.props.maximum || nextProps.minimum !== this.props.minimum) {
            nextState.value = currentState;
            this._localChange = false;
            return true;
        }
        if (nextProps.unit !== this.props.unit) {
            return true;
        }
        return false;
    }
    onChange(newValueString) {
        if (newValueString === "—")
            return;
        this._localChange = true;
        let newValue = parseFloat(newValueString);
        if (this.props.useEuler) {
            newValue = core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__.Tools.ToRadians(newValue);
        }
        if (this.props.target) {
            if (this.props.onPropertyChangedObservable) {
                this.props.onPropertyChangedObservable.notifyObservers({
                    object: this.props.target,
                    property: this.props.propertyName,
                    value: newValue,
                    initialValue: this.state.value,
                });
            }
            this.props.target[this.props.propertyName] = newValue;
        }
        if (this.props.onChange) {
            this.props.onChange(newValue);
        }
        this.setState({ value: newValue });
    }
    onInput(newValueString) {
        const newValue = parseFloat(newValueString);
        if (this.props.onInput) {
            this.props.onInput(newValue);
        }
    }
    prepareDataToRead(value) {
        if (value === null) {
            value = 0;
        }
        if (this.props.useEuler) {
            return core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__.Tools.ToDegrees(value);
        }
        return value;
    }
    // Copy to clipboard the code this slider actually does
    // Example : ImageProcessingConfiguration.contrast = 1;
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const strCommand = targetName + "." + targetProperty + " = " + value + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "sliderLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (!this.props.icon || this.props.label != "") && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.props.margin ? "label withMargins" : "label", title: this.props.label, children: this.props.label })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, isInteger: this.props.decimalCount === 0, smallUI: true, label: "", target: this.state, digits: this.props.decimalCount === undefined ? 4 : this.props.decimalCount, propertyName: "value", min: this.props.allowOverflow ? undefined : this.props.minimum, max: this.props.allowOverflow ? undefined : this.props.maximum, onEnter: () => {
                        const changed = this.prepareDataToRead(this.state.value);
                        this.onChange(changed);
                    }, onChange: () => {
                        const changed = this.prepareDataToRead(this.state.value);
                        this.onChange(changed);
                    }, onPropertyChangedObservable: this.props.onPropertyChangedObservable, unit: this.props.unit }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "slider", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { className: "range" + (this.props.allowOverflow && (this.state.value > this.props.maximum || this.state.value < this.props.minimum) ? " overflow" : ""), type: "range", step: this.props.step, min: this.prepareDataToRead(this.props.minimum), max: this.prepareDataToRead(this.props.maximum), value: this.prepareDataToRead(this.state.value), onInput: (evt) => this.onInput(evt.target.value), onChange: (evt) => this.onChange(evt.target.value) }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_5__, alt: "Copy" }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js":
/*!******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/targetsProxy.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1424047__) => {

"use strict";
__nested_webpack_require_1424047__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1424047__.d(__nested_webpack_exports__, {
/* harmony export */   conflictingValuesPlaceholder: () => (/* binding */ conflictingValuesPlaceholder),
/* harmony export */   makeTargetsProxy: () => (/* binding */ makeTargetsProxy)
/* harmony export */ });
const conflictingValuesPlaceholder = "—";
/**
 *
 * @param targets a list of selected targets
 * @param onPropertyChangedObservable
 * @param getProperty
 * @returns a proxy object that can be passed as a target into the input
 */
function makeTargetsProxy(targets, onPropertyChangedObservable, getProperty = (target, property) => target[property]) {
    return new Proxy({}, {
        get(_, name) {
            const property = name;
            if (targets.length === 0)
                return conflictingValuesPlaceholder;
            const firstValue = getProperty(targets[0], property);
            for (const target of targets) {
                if (getProperty(target, property) !== firstValue) {
                    return conflictingValuesPlaceholder;
                }
            }
            return firstValue;
        },
        set(_, name, value) {
            if (value === "—")
                return true;
            const property = name;
            for (const target of targets) {
                const initialValue = target[property];
                target[property] = value;
                if (onPropertyChangedObservable) {
                    onPropertyChangedObservable.notifyObservers({
                        object: target,
                        property: name,
                        value: target[property],
                        initialValue,
                    });
                }
            }
            return true;
        },
    });
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js":
/*!****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1426286__) => {

"use strict";
__nested_webpack_require_1426286__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1426286__.d(__nested_webpack_exports__, {
/* harmony export */   TextInputLineComponent: () => (/* binding */ TextInputLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1426286__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1426286__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _targetsProxy__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1426286__(/*! ./targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _inputArrowsComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1426286__(/*! ./inputArrowsComponent */ "../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js");




let throttleTimerId = -1;
class TextInputLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        const emptyValue = this.props.numeric ? "0" : "";
        this.state = {
            value: (this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName]) || emptyValue,
            dragging: false,
        };
    }
    componentWillUnmount() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (this._localChange) {
            this._localChange = false;
            return true;
        }
        const newValue = nextProps.value !== undefined ? nextProps.value : nextProps.target[nextProps.propertyName];
        if (newValue !== nextState.value) {
            nextState.value = newValue || "";
            return true;
        }
        if (nextState.dragging != this.state.dragging || nextProps.unit !== this.props.unit) {
            return true;
        }
        return false;
    }
    raiseOnPropertyChanged(newValue, previousValue) {
        if (this.props.onChange) {
            this.props.onChange(newValue);
            return;
        }
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName,
            value: newValue,
            initialValue: previousValue,
        });
    }
    getCurrentNumericValue(value) {
        const numeric = parseFloat(value);
        if (!isNaN(numeric)) {
            return numeric;
        }
        if (this.props.placeholder !== undefined) {
            const placeholderNumeric = parseFloat(this.props.placeholder);
            if (!isNaN(placeholderNumeric)) {
                return placeholderNumeric;
            }
        }
        return 0;
    }
    updateValue(value, valueToValidate) {
        if (this.props.disabled) {
            return;
        }
        if (this.props.numbersOnly) {
            if (/[^0-9.px%-]/g.test(value)) {
                return;
            }
            if (!value) {
                value = "0";
            }
            //Removing starting zero if there is a number of a minus after it.
            if (value.search(/0+[0-9-]/g) === 0) {
                value = value.substring(1);
            }
        }
        if (this.props.numeric) {
            let numericValue = this.getCurrentNumericValue(value);
            if (this.props.roundValues) {
                numericValue = Math.round(numericValue);
            }
            if (this.props.min !== undefined) {
                numericValue = Math.max(this.props.min, numericValue);
            }
            if (this.props.max !== undefined) {
                numericValue = Math.min(this.props.max, numericValue);
            }
            value = numericValue.toString();
        }
        this._localChange = true;
        const store = this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName];
        if (this.props.validator && valueToValidate) {
            if (this.props.validator(valueToValidate) == false) {
                value = store;
            }
        }
        this.setState({ value: value });
        if (this.props.propertyName && !this.props.delayInput) {
            this.props.target[this.props.propertyName] = value;
        }
        if (this.props.throttlePropertyChangedNotification) {
            if (throttleTimerId >= 0) {
                window.clearTimeout(throttleTimerId);
            }
            throttleTimerId = window.setTimeout(() => {
                this.raiseOnPropertyChanged(value, store);
            }, this.props.throttlePropertyChangedNotificationDelay ?? 200);
        }
        else {
            this.raiseOnPropertyChanged(value, store);
        }
    }
    incrementValue(amount) {
        if (this.props.step) {
            amount *= this.props.step;
        }
        if (this.props.arrowsIncrement) {
            this.props.arrowsIncrement(amount);
            return;
        }
        const currentValue = this.getCurrentNumericValue(this.state.value);
        this.updateValue((currentValue + amount).toFixed(2));
    }
    onKeyDown(event) {
        if (!this.props.disabled && this.props.arrows) {
            if (event.key === "ArrowUp") {
                this.incrementValue(1);
                event.preventDefault();
            }
            if (event.key === "ArrowDown") {
                this.incrementValue(-1);
                event.preventDefault();
            }
        }
    }
    render() {
        const value = this.state.value === _targetsProxy__WEBPACK_IMPORTED_MODULE_2__.conflictingValuesPlaceholder ? "" : this.state.value;
        const placeholder = this.state.value === _targetsProxy__WEBPACK_IMPORTED_MODULE_2__.conflictingValuesPlaceholder ? _targetsProxy__WEBPACK_IMPORTED_MODULE_2__.conflictingValuesPlaceholder : this.props.placeholder || "";
        const step = this.props.step || (this.props.roundValues ? 1 : 0.01);
        const className = this.props.multilines ? "textInputArea" : this.props.unit !== undefined ? "textInputLine withUnits" : "textInputLine";
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: className, children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, color: "black", className: "icon" }), this.props.label !== undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label })), this.props.multilines && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { className: this.props.disabled ? "disabled" : "", value: this.state.value, onFocus: () => {
                            if (this.props.lockObject) {
                                this.props.lockObject.lock = true;
                            }
                        }, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => {
                            if (evt.keyCode !== 13) {
                                return;
                            }
                            this.updateValue(this.state.value);
                        }, onBlur: (evt) => {
                            this.updateValue(evt.target.value, evt.target.value);
                            if (this.props.lockObject) {
                                this.props.lockObject.lock = false;
                            }
                        }, disabled: this.props.disabled }) })), !this.props.multilines && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: `value${this.props.noUnderline === true ? " noUnderline" : ""}${this.props.arrows ? " hasArrows" : ""}${this.state.dragging ? " dragging" : ""}`, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { className: this.props.disabled ? "disabled" : "", value: value, onBlur: (evt) => {
                                if (this.props.lockObject) {
                                    this.props.lockObject.lock = false;
                                }
                                this.updateValue((this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName]) || "", evt.target.value);
                            }, onFocus: () => {
                                if (this.props.lockObject) {
                                    this.props.lockObject.lock = true;
                                }
                            }, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => this.onKeyDown(evt), placeholder: placeholder, type: this.props.numeric ? "number" : "text", step: step, disabled: this.props.disabled }), this.props.arrows && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_inputArrowsComponent__WEBPACK_IMPORTED_MODULE_3__.InputArrowsComponent, { incrementValue: (amount) => this.incrementValue(amount), setDragging: (dragging) => this.setState({ dragging }) }))] })), this.props.unit] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/textLineComponent.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1436096__) => {

"use strict";
__nested_webpack_require_1436096__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1436096__.d(__nested_webpack_exports__, {
/* harmony export */   TextLineComponent: () => (/* binding */ TextLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1436096__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1436096__(/*! react */ "../../../../node_modules/react/index.js");


class TextLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onLink() {
        if (this.props.url) {
            window.open(this.props.url, "_blank");
            return;
        }
        if (!this.props.onLink) {
            return;
        }
        this.props.onLink();
    }
    renderContent() {
        if (this.props.ignoreValue) {
            return null;
        }
        if (this.props.onLink || this.props.url) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "link-value", title: this.props.tooltip ?? this.props.label ?? "", onClick: () => this.onLink(), children: this.props.url ? "doc" : this.props.value || "no name" }));
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "value", title: this.props.tooltip ?? this.props.label ?? "", style: { color: this.props.color ? this.props.color : "" }, children: this.props.value || "no name" }));
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: this.props.underline ? "textLine underline" : "textLine" + (this.props.additionalClass ? " " + this.props.additionalClass : ""), children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.tooltip ?? this.props.label ?? "", children: this.props.label ?? "" }), this.renderContent()] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/unitButton.js":
/*!****************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/unitButton.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1438684__) => {

"use strict";
__nested_webpack_require_1438684__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1438684__.d(__nested_webpack_exports__, {
/* harmony export */   UnitButton: () => (/* binding */ UnitButton)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1438684__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");

function UnitButton(props) {
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "unit", onClick: () => {
            if (props.onClick && !props.locked)
                props.onClick(props.unit || "");
        }, disabled: props.locked, children: props.unit }));
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/popupHelper.js":
/*!***********************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/popupHelper.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1439724__) => {

"use strict";
__nested_webpack_require_1439724__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1439724__.d(__nested_webpack_exports__, {
/* harmony export */   CreatePopup: () => (/* binding */ CreatePopup)
/* harmony export */ });
/* harmony import */ var _styleHelper__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1439724__(/*! ./styleHelper */ "../../../dev/sharedUiComponents/dist/styleHelper.js");

/**
 * Create a popup window
 * @param title default title for the popup
 * @param options options for the popup
 * @returns the parent control of the popup
 */
function CreatePopup(title, options) {
    const localOptions = {
        width: 300,
        height: 800,
        ...options,
    };
    const windowCreationOptionsList = {
        width: localOptions.width,
        height: localOptions.height,
        top: (window.innerHeight - localOptions.width) / 2 + window.screenY,
        left: (window.innerWidth - localOptions.height) / 2 + window.screenX,
    };
    const windowCreationOptions = Object.keys(windowCreationOptionsList)
        .map((key) => key + "=" + windowCreationOptionsList[key])
        .join(",");
    const popupWindow = window.open("", title, windowCreationOptions);
    if (!popupWindow) {
        return null;
    }
    const parentDocument = popupWindow.document;
    // Font
    const newLinkEl = parentDocument.createElement("link");
    newLinkEl.rel = "stylesheet";
    newLinkEl.href = "https://use.typekit.net/cta4xsb.css";
    parentDocument.head.appendChild(newLinkEl);
    parentDocument.title = title;
    parentDocument.body.style.width = "100%";
    parentDocument.body.style.height = "100%";
    parentDocument.body.style.margin = "0";
    parentDocument.body.style.padding = "0";
    const parentControl = parentDocument.createElement("div");
    parentControl.style.width = "100%";
    parentControl.style.height = "100%";
    parentControl.style.margin = "0";
    parentControl.style.padding = "0";
    if (localOptions.onParentControlCreateCallback) {
        localOptions.onParentControlCreateCallback(parentControl);
    }
    popupWindow.document.body.appendChild(parentControl);
    (0,_styleHelper__WEBPACK_IMPORTED_MODULE_0__.CopyStyles)(window.document, parentDocument);
    setTimeout(() => {
        // need this for late bindings
        (0,_styleHelper__WEBPACK_IMPORTED_MODULE_0__.CopyStyles)(window.document, parentDocument);
    }, 0);
    if (localOptions.onWindowCreateCallback) {
        localOptions.onWindowCreateCallback(popupWindow);
    }
    return parentControl;
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/stringTools.js":
/*!***********************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/stringTools.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1442600__) => {

"use strict";
__nested_webpack_require_1442600__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1442600__.d(__nested_webpack_exports__, {
/* harmony export */   StringTools: () => (/* binding */ StringTools)
/* harmony export */ });
class StringTools {
    /*
     * Based on FileSaver.js
     * A saveAs() FileSaver implementation.
     *
     * By Eli Grey, http://eligrey.com
     *
     * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)
     * source  : http://purl.eligrey.com/github/FileSaver.js
     */
    static _SaveAs(blob, name, document) {
        if ("download" in HTMLAnchorElement.prototype) {
            const URL = window.URL || window.webkitURL;
            const a = document.createElement("a");
            a.download = name;
            a.rel = "noopener"; // tabnabbing
            a.href = URL.createObjectURL(blob);
            setTimeout(() => {
                URL.revokeObjectURL(a.href);
            }, 4e4); // 40s
            setTimeout(() => {
                this._Click(a, document);
            }, 0);
            return;
        }
        // Open a popup immediately do go around popup blocker
        // Mostly only available on user interaction and the fileReader is async so...
        let popup = open("", "_blank");
        if (popup) {
            popup.document.title = popup.document.body.innerText = "downloading...";
        }
        const force = blob.type === "application/octet-stream";
        const isSafari = /constructor/i.test(window.HTMLElement) || window.safari;
        const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
        if ((isChromeIOS || (force && isSafari)) && typeof FileReader !== "undefined") {
            // Safari doesn't allow downloading of blob URLs
            const reader = new FileReader();
            reader.onloadend = () => {
                let url = reader.result;
                url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, "data:attachment/file;");
                if (popup) {
                    popup.location.href = url;
                }
                else {
                    location.href = url;
                }
                popup = null;
            };
            reader.readAsDataURL(blob);
        }
        else {
            const URL = window.URL || window.webkitURL;
            const url = URL.createObjectURL(blob);
            if (popup) {
                popup.location.href = url;
            }
            else {
                location.href = url;
            }
            popup = null;
            setTimeout(function () {
                URL.revokeObjectURL(url);
            }, 4e4);
        }
    }
    static _Click(node, document) {
        try {
            node.dispatchEvent(new MouseEvent("click"));
        }
        catch (e) {
            const evt = document.createEvent("MouseEvents");
            evt.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
            node.dispatchEvent(evt);
        }
    }
    /**
     * Download a string into a file that will be saved locally by the browser
     * @param document
     * @param content defines the string to download locally as a file
     * @param filename
     */
    static DownloadAsFile(document, content, filename) {
        const blob = new Blob([content], {
            type: "application/octet-stream",
        });
        this._SaveAs(blob, filename, document);
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/styleHelper.js":
/*!***********************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/styleHelper.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1446407__) => {

"use strict";
__nested_webpack_require_1446407__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1446407__.d(__nested_webpack_exports__, {
/* harmony export */   CopyStyles: () => (/* binding */ CopyStyles)
/* harmony export */ });
/**
 * Copy all styles from a document to another document or shadow root
 * @param source document to copy styles from
 * @param target document or shadow root to copy styles to
 */
function CopyStyles(source, target) {
    // Copy all <style> elements
    Array.from(source.querySelectorAll("style")).forEach((style) => {
        const newStyle = target.createElement("style");
        newStyle.textContent = style.textContent;
        target.head.appendChild(newStyle);
    });
    // Copy all <link> elements for stylesheets
    Array.from(source.querySelectorAll('link[rel="stylesheet"]')).forEach((link) => {
        const newLink = target.createElement("link");
        newLink.rel = "stylesheet";
        newLink.href = link.href;
        target.head.appendChild(newLink);
    });
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js":
/*!*****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1447836__) => {

"use strict";
__nested_webpack_require_1447836__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1447836__.d(__nested_webpack_exports__, {
/* harmony export */   LockObject: () => (/* binding */ LockObject)
/* harmony export */ });
/**
 * Class used to provide lock mechanism
 */
class LockObject {
    constructor() {
        /**
         * Gets or set if the lock is engaged
         */
        this.lock = false;
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/commandBarComponent.js":
/*!***********************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/commandBarComponent.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1448642__) => {

"use strict";
__nested_webpack_require_1448642__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1448642__.d(__nested_webpack_exports__, {
/* harmony export */   CommandBarComponent: () => (/* binding */ CommandBarComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1448642__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1448642__(/*! core/Misc/dataStorage */ "core/Misc/observable");
/* harmony import */ var core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1448642__.n(core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1448642__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1448642__(/*! ../globalState */ "../../../tools/guiEditor/dist/globalState.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1448642__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1448642__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1448642__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var _commandButtonComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1448642__(/*! ./commandButtonComponent */ "../../../tools/guiEditor/dist/components/commandButtonComponent.js");
/* harmony import */ var _commandDropdownComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1448642__(/*! ./commandDropdownComponent */ "../../../tools/guiEditor/dist/components/commandDropdownComponent.js");
/* harmony import */ var shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1448642__(/*! shared-ui-components/lines/colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1448642__(/*! shared-ui-components/tabs/propertyGrids/lockObject */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js");
/* harmony import */ var _imgs_hamburgerIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1448642__(/*! ../imgs/hamburgerIcon.svg */ "../../../tools/guiEditor/dist/imgs/hamburgerIcon.svg");
/* harmony import */ var _imgs_pointerIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1448642__(/*! ../imgs/pointerIcon.svg */ "../../../tools/guiEditor/dist/imgs/pointerIcon.svg");
/* harmony import */ var _imgs_handIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1448642__(/*! ../imgs/handIcon.svg */ "../../../tools/guiEditor/dist/imgs/handIcon.svg");
/* harmony import */ var _imgs_zoomIcon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1448642__(/*! ../imgs/zoomIcon.svg */ "../../../tools/guiEditor/dist/imgs/zoomIcon.svg");
/* harmony import */ var _imgs_guidesIcon_svg__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1448642__(/*! ../imgs/guidesIcon.svg */ "../../../tools/guiEditor/dist/imgs/guidesIcon.svg");
/* harmony import */ var _imgs_babylonLogo_svg__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1448642__(/*! ../imgs/babylonLogo.svg */ "../../../tools/guiEditor/dist/imgs/babylonLogo.svg");
/* harmony import */ var _imgs_canvasFitIcon_svg__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1448642__(/*! ../imgs/canvasFitIcon.svg */ "../../../tools/guiEditor/dist/imgs/canvasFitIcon.svg");
/* harmony import */ var _imgs_buttonbar_copyIcon_svg__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_1448642__(/*! ../imgs/buttonbar_copyIcon.svg */ "../../../tools/guiEditor/dist/imgs/buttonbar_copyIcon.svg");
/* harmony import */ var _imgs_buttonbar_pasteIcon_svg__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_1448642__(/*! ../imgs/buttonbar_pasteIcon.svg */ "../../../tools/guiEditor/dist/imgs/buttonbar_pasteIcon.svg");
/* harmony import */ var _imgs_buttonBar_deleteIcon_svg__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_1448642__(/*! ../imgs/buttonBar_deleteIcon.svg */ "../../../tools/guiEditor/dist/imgs/buttonBar_deleteIcon.svg");
/* harmony import */ var _imgs_buttonbar_copyIcon_disabled_svg__WEBPACK_IMPORTED_MODULE_21__ = __nested_webpack_require_1448642__(/*! ../imgs/buttonbar_copyIcon_disabled.svg */ "../../../tools/guiEditor/dist/imgs/buttonbar_copyIcon_disabled.svg");
/* harmony import */ var _imgs_buttonbar_pasteIcon_disabled_svg__WEBPACK_IMPORTED_MODULE_22__ = __nested_webpack_require_1448642__(/*! ../imgs/buttonbar_pasteIcon_disabled.svg */ "../../../tools/guiEditor/dist/imgs/buttonbar_pasteIcon_disabled.svg");
/* harmony import */ var _imgs_buttonBar_deleteIcon_disabled_svg__WEBPACK_IMPORTED_MODULE_23__ = __nested_webpack_require_1448642__(/*! ../imgs/buttonBar_deleteIcon_disabled.svg */ "../../../tools/guiEditor/dist/imgs/buttonBar_deleteIcon_disabled.svg");
/* harmony import */ var _scss_commandBar_scss__WEBPACK_IMPORTED_MODULE_24__ = __nested_webpack_require_1448642__(/*! ../scss/commandBar.scss */ "../../../tools/guiEditor/dist/scss/commandBar.scss");

























const _sizeValues = [
    { width: 1920, height: 1080 },
    { width: 1366, height: 768 },
    { width: 1280, height: 800 },
    { width: 3840, height: 2160 },
    { width: 750, height: 1334 },
    { width: 1125, height: 2436 },
    { width: 1170, height: 2532 },
    { width: 1284, height: 2778 },
    { width: 1080, height: 2220 },
    { width: 1080, height: 2340 },
    { width: 1024, height: 1024 },
    { width: 2048, height: 2048 },
];
const _sizeOptions = [
    { label: "Web (1920)", value: 0 },
    { label: "Web (1366)", value: 1 },
    { label: "Web (1280)", value: 2 },
    { label: "Web (3840)", value: 3 },
    { label: "iPhone 8 (750)", value: 4 },
    { label: "iPhone X, 11 (1125)", value: 5 },
    { label: "iPhone 12 (1170)", value: 6 },
    { label: "iPhone Pro Max (1284)", value: 7 },
    { label: "Google Pixel 4 (1080)", value: 8 },
    { label: "Google Pixel 5 (1080)", value: 9 },
    { label: "Square (1024)", value: 10 },
    { label: "Square (2048)", value: 11 },
];
// eslint-disable-next-line @typescript-eslint/naming-convention
const MAX_TEXTURE_SIZE = 16384; //2^14
class CommandBarComponent extends react__WEBPACK_IMPORTED_MODULE_2__.Component {
    constructor(props) {
        super(props);
        this._sizeOption = 0;
        this._stopUpdating = false;
        this._lockObject = new shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_10__.LockObject();
        props.globalState.onToolChangeObservable.add(() => {
            this.forceUpdate();
        });
        props.globalState.onOutlineChangedObservable.add(() => {
            this.forceUpdate();
        });
        props.globalState.onResizeObservable.add(() => {
            this.forceUpdate();
        });
        props.globalState.onSelectionChangedObservable.add(() => {
            this.forceUpdate();
        });
        props.globalState.onWindowResizeObservable.add(() => {
            this.forceUpdate();
        });
    }
    render() {
        const isPasteDisabled = this.props.globalState.workbench ? this.props.globalState.workbench.pasteDisabled : true;
        const size = this.props.globalState.workbench ? { ...this.props.globalState.workbench.guiSize } : { width: 0, height: 0 };
        const copyyIcon = this.props.globalState.selectedControls.length === 0 ? _imgs_buttonbar_copyIcon_disabled_svg__WEBPACK_IMPORTED_MODULE_21__ : _imgs_buttonbar_copyIcon_svg__WEBPACK_IMPORTED_MODULE_18__;
        const deleteeIcon = this.props.globalState.selectedControls.length === 0 ? _imgs_buttonBar_deleteIcon_disabled_svg__WEBPACK_IMPORTED_MODULE_23__ : _imgs_buttonBar_deleteIcon_svg__WEBPACK_IMPORTED_MODULE_20__;
        const pasteeIcon = isPasteDisabled ? _imgs_buttonbar_pasteIcon_disabled_svg__WEBPACK_IMPORTED_MODULE_22__ : _imgs_buttonbar_pasteIcon_svg__WEBPACK_IMPORTED_MODULE_19__;
        const responsiveUI = this.props.globalState.fromPG ? core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.ReadBoolean("responsiveUI", true) : core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.ReadBoolean("Responsive", true);
        this._sizeOption = _sizeValues.findIndex((value) => value.width == size.width && value.height == size.height);
        if (this._sizeOption < 0) {
            this.props.globalState.onResponsiveChangeObservable.notifyObservers(false);
            core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteBoolean("Responsive", false);
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-commands", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "commands-left", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_babylonLogo_svg__WEBPACK_IMPORTED_MODULE_16__, color: "white", className: "active", draggable: false }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandDropdownComponent__WEBPACK_IMPORTED_MODULE_8__.CommandDropdownComponent, { globalState: this.props.globalState, toRight: true, icon: _imgs_hamburgerIcon_svg__WEBPACK_IMPORTED_MODULE_11__, tooltip: "Options", items: [
                                        {
                                            label: "Save",
                                            onClick: () => {
                                                this.props.globalState.onSaveObservable.notifyObservers();
                                            },
                                        },
                                        {
                                            label: "Load",
                                            fileButton: true,
                                        },
                                        {
                                            label: "Save to snippet",
                                            onClick: () => {
                                                this.props.globalState.onSnippetSaveObservable.notifyObservers();
                                            },
                                        },
                                        {
                                            label: "Load from snippet",
                                            onClick: () => {
                                                this.props.globalState.onSnippetLoadObservable.notifyObservers();
                                            },
                                        },
                                        {
                                            label: "Save selected control",
                                            onClick: () => {
                                                this.props.globalState.onSaveSelectedControl.notifyObservers();
                                            },
                                        },
                                        {
                                            label: "Load control",
                                            fileButton: true,
                                            loadControlButton: true,
                                        },
                                        {
                                            label: "Help",
                                            onClick: () => {
                                                window.open("https://doc.babylonjs.com/toolsAndResources/tools/guiEditor", "_blank");
                                            },
                                        },
                                        {
                                            label: "Give feedback",
                                            onClick: () => {
                                                window.open("https://forum.babylonjs.com/t/introducing-the-gui-editor-beta/28943", "_blank");
                                            },
                                        },
                                    ] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_7__.CommandButtonComponent, { tooltip: "Select", icon: _imgs_pointerIcon_svg__WEBPACK_IMPORTED_MODULE_12__, shortcut: "S", isActive: this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_3__.GUIEditorTool.SELECT, onClick: () => {
                                        this.props.globalState.tool = _globalState__WEBPACK_IMPORTED_MODULE_3__.GUIEditorTool.SELECT;
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_7__.CommandButtonComponent, { tooltip: "Pan", icon: _imgs_handIcon_svg__WEBPACK_IMPORTED_MODULE_13__, shortcut: "P", isActive: this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_3__.GUIEditorTool.PAN, onClick: () => {
                                        this.props.globalState.tool = _globalState__WEBPACK_IMPORTED_MODULE_3__.GUIEditorTool.PAN;
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_7__.CommandButtonComponent, { tooltip: "Zoom", shortcut: "Z", icon: _imgs_zoomIcon_svg__WEBPACK_IMPORTED_MODULE_14__, isActive: this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_3__.GUIEditorTool.ZOOM, onClick: () => {
                                        this.props.globalState.tool = _globalState__WEBPACK_IMPORTED_MODULE_3__.GUIEditorTool.ZOOM;
                                    } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_7__.CommandButtonComponent, { tooltip: "Copy Selected", shortcut: "Ctrl + C", icon: copyyIcon, isActive: false, copyDeleteDisabled: this.props.globalState.selectedControls.length === 0, onClick: () => {
                                        this.props.globalState.onCopyObservable.notifyObservers((content) => this.props.globalState.hostWindow.navigator.clipboard.writeText(content));
                                        this.forceUpdate();
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_7__.CommandButtonComponent, { tooltip: "Paste", shortcut: "Ctrl + V", icon: pasteeIcon, isActive: false, pasteDisabled: isPasteDisabled, onClick: async () => {
                                        this.props.globalState.onPasteObservable.notifyObservers(await this.props.globalState.hostWindow.navigator.clipboard.readText());
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_7__.CommandButtonComponent, { tooltip: "Delete", shortcut: "Delete", icon: deleteeIcon, isActive: false, copyDeleteDisabled: this.props.globalState.selectedControls.length === 0, onClick: () => {
                                        this.props.globalState.selectedControls.forEach((guiNode) => {
                                            if (guiNode != this.props.globalState.guiTexture.getChildren()[0]) {
                                                this.props.globalState.guiTexture.removeControl(guiNode);
                                                this.props.globalState.liveGuiTexture?.removeControl(guiNode);
                                                guiNode.dispose();
                                            }
                                        });
                                        this.props.globalState.setSelection([]);
                                    } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_7__.CommandButtonComponent, { tooltip: "Fit to Window", shortcut: "F", icon: _imgs_canvasFitIcon_svg__WEBPACK_IMPORTED_MODULE_17__, isActive: false, onClick: () => {
                                        this.props.globalState.onFitControlsToWindowObservable.notifyObservers();
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_7__.CommandButtonComponent, { tooltip: "Toggle Guides", shortcut: "G", icon: _imgs_guidesIcon_svg__WEBPACK_IMPORTED_MODULE_15__, isActive: this.props.globalState.outlines, onClick: () => (this.props.globalState.outlines = !this.props.globalState.outlines) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divider padded", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_9__.ColorLine, { lockObject: this._lockObject, label: "Artboard:", target: this.props.globalState, propertyName: "backgroundColor", disableAlpha: true }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "divider padded", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Responsive:", iconLabel: "Responsive GUIs will resize the UI layout and reflow controls to accommodate different device screen sizes", isSelected: () => core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.ReadBoolean("Responsive", true), onSelect: (value) => {
                                        this.props.globalState.onResponsiveChangeObservable.notifyObservers(value);
                                        core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteBoolean("Responsive", value);
                                        core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteBoolean("responsiveUI", value);
                                        this._sizeOption = _sizeOptions.length;
                                        if (value) {
                                            this._sizeOption = 0;
                                            this.props.globalState.workbench.guiSize = _sizeValues[this._sizeOption];
                                            core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteNumber("width", this.props.globalState.workbench.guiSize.width);
                                            core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteNumber("height", this.props.globalState.workbench.guiSize.height);
                                        }
                                        this.forceUpdate();
                                    }, large: true }), responsiveUI && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__.OptionsLine, { label: "", iconLabel: "Size", options: _sizeOptions, target: this, propertyName: "_sizeOption", noDirectUpdate: true, onSelect: (value) => {
                                        this._sizeOption = value;
                                        if (this._sizeOption !== _sizeOptions.length) {
                                            const newSize = _sizeValues[this._sizeOption];
                                            this.props.globalState.workbench.guiSize = newSize;
                                            core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteNumber("width", this.props.globalState.workbench.guiSize.width);
                                            core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteNumber("height", this.props.globalState.workbench.guiSize.height);
                                        }
                                        this.forceUpdate();
                                    } })), !responsiveUI && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this._lockObject, label: "W", target: size, propertyName: "width", min: 1, max: MAX_TEXTURE_SIZE, onChange: (newValue) => {
                                                if (!this._stopUpdating) {
                                                    this.props.globalState.workbench.guiSize = { width: newValue, height: size.height };
                                                    core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteNumber("width", this.props.globalState.workbench.guiSize.width);
                                                }
                                            }, onDragStart: () => {
                                                this._stopUpdating = true;
                                            }, onDragStop: (newValue) => {
                                                this._stopUpdating = false;
                                                this.props.globalState.workbench.guiSize = { width: newValue, height: size.height };
                                                core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteNumber("width", this.props.globalState.workbench.guiSize.width);
                                            }, arrows: true, isInteger: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this._lockObject, label: "H", target: size, propertyName: "height", min: 1, max: MAX_TEXTURE_SIZE, onChange: (newValue) => {
                                                if (!this._stopUpdating) {
                                                    this.props.globalState.workbench.guiSize = { width: size.width, height: newValue };
                                                    core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteNumber("height", this.props.globalState.workbench.guiSize.width);
                                                }
                                            }, onDragStart: () => {
                                                this._stopUpdating = true;
                                            }, onDragStop: (newValue) => {
                                                this._stopUpdating = false;
                                                this.props.globalState.workbench.guiSize = { width: size.width, height: newValue };
                                                core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteNumber("height", this.props.globalState.workbench.guiSize.width);
                                            }, arrows: true, isInteger: true })] }))] })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "commands-right" })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/commandButtonComponent.js":
/*!**************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/commandButtonComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1472674__) => {

"use strict";
__nested_webpack_require_1472674__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1472674__.d(__nested_webpack_exports__, {
/* harmony export */   CommandButtonComponent: () => (/* binding */ CommandButtonComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1472674__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1472674__(/*! react */ "../../../../node_modules/react/index.js");


class CommandButtonComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        let divClassName = this.props.altStyle ? `command-button-alt${this.props.disabled ? "-disabled" : ""}${this.props.isActive ? "-" : ""}` : `command-button`;
        let iconClassName = `command-button-icon `;
        if (this.props.isActive) {
            divClassName += " active";
            iconClassName += " active";
        }
        if (this.props.disabled) {
            divClassName += " disabled";
        }
        else if (this.props.copyDeleteDisabled) {
            divClassName += " copyAndDeleteDisabled";
        }
        else if (this.props.pasteDisabled) {
            divClassName += " pasteDisabled";
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: divClassName, onClick: this.props.onClick, title: `${this.props.tooltip} ${this.props.shortcut ? " (" + this.props.shortcut + ")" : ""}`, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: iconClassName, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: this.props.isActive ? "active" : "", draggable: false }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "command-label", children: this.props.tooltip })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/commandDropdownComponent.js":
/*!****************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/commandDropdownComponent.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1475128__) => {

"use strict";
__nested_webpack_require_1475128__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1475128__.d(__nested_webpack_exports__, {
/* harmony export */   CommandDropdownComponent: () => (/* binding */ CommandDropdownComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1475128__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1475128__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1475128__(/*! shared-ui-components/lines/fileButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js");



class CommandDropdownComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isExpanded: false, activeState: "" };
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [this.state.isExpanded && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "command-dropdown-blocker", onClick: () => {
                        this.setState({ isExpanded: false });
                    } })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "command-dropdown-root", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "command-dropdown" + (this.state.isExpanded ? " activated" : ""), title: this.props.tooltip, onClick: () => {
                                this.setState({ isExpanded: false });
                                const newState = !this.state.isExpanded;
                                const pgHost = document.getElementById("embed-host");
                                if (pgHost) {
                                    pgHost.style.zIndex = newState ? "0" : "10";
                                }
                                this.setState({ isExpanded: newState });
                            }, children: [this.props.icon && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "command-dropdown-icon", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon }) })), !this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "command-dropdown-active" })] }), this.state.isExpanded && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "command-dropdown-content sub1" + (this.props.toRight ? " toRight" : ""), children: this.props.items.map((m) => {
                                if (!m.fileButton) {
                                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "command-dropdown-label" + (m.isActive ? " active" : ""), onClick: () => {
                                            if (!m.onClick) {
                                                this.forceUpdate();
                                                return;
                                            }
                                            if (!m.subItems) {
                                                m.onClick();
                                                this.setState({ isExpanded: false, activeState: m.label });
                                            }
                                        }, title: m.label, children: [!m.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "command-dropdown-label-text", children: (m.isActive ? "> " : "") + m.label }), m.icon && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "command-dropdown-icon", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: m.icon }) })), m.onCheck && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkBox", className: "command-dropdown-label-check", onChange: (evt) => {
                                                    this.forceUpdate();
                                                    m.onCheck(evt.target.checked);
                                                }, checked: false })), m.subItems && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "command-dropdown-arrow", children: ">" }), m.subItems && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sub-items ", children: m.subItems.map((s) => {
                                                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sub-item", onClick: () => {
                                                            m.onClick();
                                                            this.setState({ isExpanded: false });
                                                        }, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sub-item-label", children: s }) }, s));
                                                }) }))] }, m.label));
                                }
                                else {
                                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_2__.FileButtonLine, { label: !m.loadControlButton ? "Load" : "Load control", onClick: (file) => this.props.globalState[!m.loadControlButton ? "onLoadObservable" : "onControlLoadObservable"].notifyObservers(file), accept: ".json" }, m.label));
                                }
                            }) }))] })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/log/logComponent.js":
/*!********************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/log/logComponent.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1481316__) => {

"use strict";
__nested_webpack_require_1481316__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1481316__.d(__nested_webpack_exports__, {
/* harmony export */   LogComponent: () => (/* binding */ LogComponent),
/* harmony export */   LogEntry: () => (/* binding */ LogEntry)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1481316__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1481316__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1481316__(/*! react-dom */ "../../../../node_modules/react-dom/index.js");
/* harmony import */ var _log_scss__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1481316__(/*! ./log.scss */ "../../../tools/guiEditor/dist/components/log/log.scss");




class LogEntry {
    constructor(message, isError) {
        this.message = message;
        this.isError = isError;
    }
}
class LogComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { logs: [] };
    }
    componentDidMount() {
        this.props.globalState.onLogRequiredObservable.add((log) => {
            const newLogArray = this.state.logs.map((number) => number);
            newLogArray.push(log);
            this.setState({ logs: newLogArray });
        });
    }
    componentDidUpdate() {
        const logConsole = react_dom__WEBPACK_IMPORTED_MODULE_2__.findDOMNode(this.refs["log-console"]);
        if (!logConsole) {
            return;
        }
        logConsole.scrollTop = logConsole.scrollHeight;
    }
    render() {
        const today = new Date();
        const h = today.getHours();
        const m = today.getMinutes();
        const s = today.getSeconds();
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "log-console", ref: "log-console", children: this.state.logs.map((l, i) => {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "log" + (l.isError ? " error" : ""), children: h + ":" + m + ":" + s + ": " + l.message }, i));
            }) }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/parentingPropertyGridComponent.js":
/*!**********************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/parentingPropertyGridComponent.js ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1484023__) => {

"use strict";
__nested_webpack_require_1484023__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1484023__.d(__nested_webpack_exports__, {
/* harmony export */   ParentingPropertyGridComponent: () => (/* binding */ ParentingPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1484023__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1484023__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1484023__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1484023__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1484023__(/*! ../tools */ "../../../tools/guiEditor/dist/tools.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1484023__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_1484023__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_5__);






class ParentingPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    updateGridPosition() {
        const grid = this.props.control.parent;
        if (grid) {
            this._changeCell(grid, this.props.control, new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_5__.Vector2(this._rowNumber, this._columnNumber));
        }
    }
    getCellInfo() {
        const cellInfo = _tools__WEBPACK_IMPORTED_MODULE_4__.Tools.GetCellInfo(this.props.control.parent, this.props.control);
        this._rowNumber = cellInfo.x;
        this._columnNumber = cellInfo.y;
    }
    _changeCell(grid, draggedControl, newCell) {
        const index = grid.children.indexOf(draggedControl);
        grid.removeControl(draggedControl);
        _tools__WEBPACK_IMPORTED_MODULE_4__.Tools.ReorderGrid(grid, index, draggedControl, newCell);
    }
    render() {
        this.getCellInfo();
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", { className: "ge" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { tooltip: "", label: "GRID PARENTING", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Row #", target: this, propertyName: "_rowNumber", isInteger: true, min: 0, onChange: () => {
                                this.updateGridPosition();
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Column #", target: this, propertyName: "_columnNumber", isInteger: true, min: 0, onChange: () => {
                                this.updateGridPosition();
                            } })] })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/buttonPropertyGridComponent.js":
/*!*************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/buttonPropertyGridComponent.js ***!
  \*************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1488348__) => {

"use strict";
__nested_webpack_require_1488348__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1488348__.d(__nested_webpack_exports__, {
/* harmony export */   ButtonPropertyGridComponent: () => (/* binding */ ButtonPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1488348__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1488348__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1488348__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1488348__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1488348__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1488348__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");
/* harmony import */ var _commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1488348__(/*! ../../../commandButtonComponent */ "../../../tools/guiEditor/dist/components/commandButtonComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1488348__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _containerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1488348__(/*! ./containerPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/containerPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_imgs_conerRadiusIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1488348__(/*! shared-ui-components/imgs/conerRadiusIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/conerRadiusIcon.svg");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1488348__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_addImageButtonIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1488348__(/*! shared-ui-components/imgs/addImageButtonIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/addImageButtonIcon.svg");
/* harmony import */ var shared_ui_components_imgs_addTextButtonIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1488348__(/*! shared-ui-components/imgs/addTextButtonIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/addTextButtonIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1488348__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");














class ButtonPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const { rectangles, lockObject, onPropertyChangedObservable, onAddComponent } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(rectangles, onPropertyChangedObservable);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: lockObject, controls: rectangles, onPropertyChangedObservable: onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "BUTTON", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Add TextBlock", icon: shared_ui_components_imgs_addTextButtonIcon_svg__WEBPACK_IMPORTED_MODULE_10__, shortcut: "", isActive: false, onClick: () => {
                                onAddComponent("Text");
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Add Image", icon: shared_ui_components_imgs_addImageButtonIcon_svg__WEBPACK_IMPORTED_MODULE_11__, shortcut: "", isActive: false, onClick: () => {
                                onAddComponent("ButtonImage");
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Stroke Weight" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "thickness", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_5__.UnitButton, { unit: "PX", locked: true }), min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_conerRadiusIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Corner Radius" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "cornerRadius", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_5__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_containerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__.ContainerPropertyGridComponent, { containers: rectangles, onPropertyChangedObservable: onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/checkboxPropertyGridComponent.js":
/*!***************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/checkboxPropertyGridComponent.js ***!
  \***************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1496245__) => {

"use strict";
__nested_webpack_require_1496245__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1496245__.d(__nested_webpack_exports__, {
/* harmony export */   CheckboxPropertyGridComponent: () => (/* binding */ CheckboxPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1496245__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1496245__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1496245__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1496245__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1496245__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1496245__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1496245__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_checkboxIconDark_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1496245__(/*! shared-ui-components/imgs/checkboxIconDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/checkboxIconDark.svg");
/* harmony import */ var shared_ui_components_imgs_sizeIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1496245__(/*! shared-ui-components/imgs/sizeIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/sizeIcon.svg");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1496245__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1496245__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1496245__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");












class CheckboxPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const checkboxes = this.props.checkboxes;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: checkboxes, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "CHECKBOX", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_sizeIcon_svg__WEBPACK_IMPORTED_MODULE_9__, label: "Check Size Ratio" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: " ", target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(checkboxes, this.props.onPropertyChangedObservable), propertyName: "checkSizeRatio", min: 0, max: 1, arrows: true, step: "0.01", digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_checkboxIconDark_svg__WEBPACK_IMPORTED_MODULE_10__, label: "Is Checkbox Checked" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { label: "CHECKED", target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(checkboxes, this.props.onPropertyChangedObservable), propertyName: "isChecked", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_11__, label: "Thickness" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(checkboxes, this.props.onPropertyChangedObservable), propertyName: "thickness", label: "", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/colorPickerPropertyGridComponent.js":
/*!******************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/colorPickerPropertyGridComponent.js ***!
  \******************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1503303__) => {

"use strict";
__nested_webpack_require_1503303__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1503303__.d(__nested_webpack_exports__, {
/* harmony export */   ColorPickerPropertyGridComponent: () => (/* binding */ ColorPickerPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1503303__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1503303__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1503303__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1503303__(/*! shared-ui-components/lines/colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1503303__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1503303__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1503303__(/*! shared-ui-components/imgs/fillColorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fillColorIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1503303__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");








class ColorPickerPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const colorPickers = this.props.colorPickers;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: colorPickers, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "COLOR PICKER", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_6__.IconComponent, { icon: shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_7__, label: "Color Picker Value" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_3__.ColorLine, { label: "", target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_5__.makeTargetsProxy)(colorPickers, this.props.onPropertyChangedObservable), propertyName: "value", disableAlpha: true, lockObject: this.props.lockObject })] })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js":
/*!********************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js ***!
  \********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1507588__) => {

"use strict";
__nested_webpack_require_1507588__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1507588__.d(__nested_webpack_exports__, {
/* harmony export */   CommonControlPropertyGridComponent: () => (/* binding */ CommonControlPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1507588__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1507588__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1507588__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1507588__(/*! gui/2D/valueAndUnit */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1507588__.n(gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1507588__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1507588__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1507588__(/*! ../../../commandButtonComponent */ "../../../tools/guiEditor/dist/components/commandButtonComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1507588__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1507588__(/*! shared-ui-components/lines/colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1507588__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1507588__(/*! ../../../../diagram/coordinateHelper */ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js");
/* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1507588__(/*! core/Maths/math */ "core/Misc/observable");
/* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__nested_webpack_require_1507588__.n(core_Maths_math__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1507588__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_components_lines_OptionsLineComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1507588__(/*! shared-ui-components/components/lines/OptionsLineComponent */ "../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.js");
/* harmony import */ var shared_ui_components_imgs_sizeIcon_svg__WEBPACK_IMPORTED_MODULE_27__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/sizeIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/sizeIcon.svg");
/* harmony import */ var shared_ui_components_imgs_verticalMarginIcon_svg__WEBPACK_IMPORTED_MODULE_28__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/verticalMarginIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/verticalMarginIcon.svg");
/* harmony import */ var shared_ui_components_imgs_positionIcon_svg__WEBPACK_IMPORTED_MODULE_26__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/positionIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/positionIcon.svg");
/* harmony import */ var shared_ui_components_imgs_fontFamilyIcon_svg__WEBPACK_IMPORTED_MODULE_41__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/fontFamilyIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fontFamilyIcon.svg");
/* harmony import */ var shared_ui_components_imgs_alphaIcon_svg__WEBPACK_IMPORTED_MODULE_37__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/alphaIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/alphaIcon.svg");
/* harmony import */ var shared_ui_components_imgs_fontSizeIcon_svg__WEBPACK_IMPORTED_MODULE_44__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/fontSizeIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fontSizeIcon.svg");
/* harmony import */ var shared_ui_components_imgs_fontStyleIcon_svg__WEBPACK_IMPORTED_MODULE_43__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/fontStyleIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fontStyleIcon.svg");
/* harmony import */ var shared_ui_components_imgs_fontWeightIcon_svg__WEBPACK_IMPORTED_MODULE_42__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/fontWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fontWeightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_rotationIcon_svg__WEBPACK_IMPORTED_MODULE_34__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/rotationIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/rotationIcon.svg");
/* harmony import */ var shared_ui_components_imgs_pivotIcon_svg__WEBPACK_IMPORTED_MODULE_33__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/pivotIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/pivotIcon.svg");
/* harmony import */ var shared_ui_components_imgs_scaleIcon_svg__WEBPACK_IMPORTED_MODULE_32__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/scaleIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/scaleIcon.svg");
/* harmony import */ var shared_ui_components_imgs_shadowBlurIcon_svg__WEBPACK_IMPORTED_MODULE_40__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/shadowBlurIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/shadowBlurIcon.svg");
/* harmony import */ var shared_ui_components_imgs_horizontalMarginIcon_svg__WEBPACK_IMPORTED_MODULE_29__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/horizontalMarginIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/horizontalMarginIcon.svg");
/* harmony import */ var shared_ui_components_imgs_shadowColorIcon_svg__WEBPACK_IMPORTED_MODULE_38__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/shadowColorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/shadowColorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_shadowOffsetXIcon_svg__WEBPACK_IMPORTED_MODULE_39__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/shadowOffsetXIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/shadowOffsetXIcon.svg");
/* harmony import */ var shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_35__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/colorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/colorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_36__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/fillColorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fillColorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_linkedMeshOffsetIcon_svg__WEBPACK_IMPORTED_MODULE_31__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/linkedMeshOffsetIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/linkedMeshOffsetIcon.svg");
/* harmony import */ var _imgs_visibilityActiveIcon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1507588__(/*! ../../../../imgs/visibilityActiveIcon.svg */ "../../../tools/guiEditor/dist/imgs/visibilityActiveIcon.svg");
/* harmony import */ var shared_ui_components_imgs_addGridElementDark_svg__WEBPACK_IMPORTED_MODULE_45__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/addGridElementDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/addGridElementDark.svg");
/* harmony import */ var shared_ui_components_imgs_deleteGridElementDark_svg__WEBPACK_IMPORTED_MODULE_46__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/deleteGridElementDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/deleteGridElementDark.svg");
/* harmony import */ var _imgs_adtIcon_svg__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1507588__(/*! ../../../../imgs/adtIcon.svg */ "../../../tools/guiEditor/dist/imgs/adtIcon.svg");
/* harmony import */ var shared_ui_components_imgs_hAlignCenterIcon_svg__WEBPACK_IMPORTED_MODULE_21__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/hAlignCenterIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/hAlignCenterIcon.svg");
/* harmony import */ var shared_ui_components_imgs_hAlignLeftIcon_svg__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/hAlignLeftIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/hAlignLeftIcon.svg");
/* harmony import */ var shared_ui_components_imgs_hAlignRightIcon_svg__WEBPACK_IMPORTED_MODULE_22__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/hAlignRightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/hAlignRightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_vAlignCenterIcon_svg__WEBPACK_IMPORTED_MODULE_24__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/vAlignCenterIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/vAlignCenterIcon.svg");
/* harmony import */ var shared_ui_components_imgs_vAlignTopIcon_svg__WEBPACK_IMPORTED_MODULE_23__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/vAlignTopIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/vAlignTopIcon.svg");
/* harmony import */ var shared_ui_components_imgs_vAlignBottomIcon_svg__WEBPACK_IMPORTED_MODULE_25__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/vAlignBottomIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/vAlignBottomIcon.svg");
/* harmony import */ var shared_ui_components_imgs_descendantsOnlyPaddingIcon_svg__WEBPACK_IMPORTED_MODULE_30__ = __nested_webpack_require_1507588__(/*! shared-ui-components/imgs/descendantsOnlyPaddingIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/descendantsOnlyPaddingIcon.svg");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1507588__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1507588__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");
/* harmony import */ var _diagram_workbench__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_1507588__(/*! ../../../../diagram/workbench */ "../../../tools/guiEditor/dist/diagram/workbench.js");
/* harmony import */ var _guiEditor__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_1507588__(/*! ../../../../guiEditor */ "../../../tools/guiEditor/dist/guiEditor.js");

















































class CommonControlPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._onControlVisibilityChangedObservers = [];
        this.state = {
            fontFamilyOptions: JSON.parse(String(window.sessionStorage.getItem("fonts"))) ?? [
                { label: "Arial", value: 1 },
                { label: "Verdana", value: 2 },
                { label: "Helvetica", value: 3 },
                { label: "Trebuchet MS", value: 4 },
                { label: "Times New Roman", value: 5 },
                { label: "Georgia", value: 6 },
                { label: "Garamond", value: 7 },
                { label: "Courier New", value: 8 },
                { label: "Brush Script MT", value: 9 },
            ],
        };
        const controls = this.props.controls;
        for (const control of controls) {
            const transformed = this._getTransformedReferenceCoordinate(control);
            if (!control.metadata) {
                control.metadata = {};
            }
            control.metadata._previousCenter = transformed;
            const visibilityObserver = control.onIsVisibleChangedObservable.add(() => {
                this.forceUpdate();
            });
            this._onControlVisibilityChangedObservers.push(visibilityObserver);
        }
        this._onFontsParsedObserver = this.props.onFontsParsedObservable?.add(() => {
            this._checkFontsInLayout();
        });
        this._onPropertyChangedObserver = this.props.onPropertyChangedObservable?.add((event) => {
            const isTransformEvent = event.property === "transformCenterX" || event.property === "transformCenterY";
            for (const control of controls) {
                let transformed = this._getTransformedReferenceCoordinate(control);
                if (isTransformEvent && control.metadata._previousCenter) {
                    // Calculate the difference between current center and previous center
                    const diff = transformed.subtract(control.metadata._previousCenter);
                    control.leftInPixels -= diff.x;
                    control.topInPixels -= diff.y;
                    // Update center in reference to left and top positions
                    transformed = this._getTransformedReferenceCoordinate(control);
                }
                control.metadata._previousCenter = transformed;
                if (control.getClassName() === "TextBlock" && (event.property === "width" || event.property === "height")) {
                    control.resizeToFit = false;
                }
            }
        });
    }
    componentWillMount() {
        this._checkFontsInLayout();
    }
    _checkFontsInLayout() {
        const correctFonts = [];
        for (const font of this.state.fontFamilyOptions.values()) {
            if (document.fonts.check(`12px "${font.label}"`) && font.label != "Custom Font") {
                correctFonts.push(font);
            }
        }
        const moreFonts = _diagram_workbench__WEBPACK_IMPORTED_MODULE_18__.WorkbenchComponent.addedFonts;
        for (let i = 0; i < moreFonts.length; i++) {
            const fontName = moreFonts[i].trim();
            correctFonts.push({ label: fontName, value: fontName });
        }
        this.setState({
            fontFamilyOptions: correctFonts,
        });
        window.sessionStorage.setItem("fonts", JSON.stringify(correctFonts));
    }
    _addFont(fontValue) {
        const fontName = fontValue.trim();
        if (fontName.length > 0) {
            if (!this.state.fontFamilyOptions.find(({ value }) => value === fontValue)) {
                this.setState((state) => {
                    state.fontFamilyOptions.push({ label: fontName, value: fontName });
                    return state;
                }, this._checkFontsInLayout);
            }
        }
    }
    _getTransformedReferenceCoordinate(control) {
        const nodeMatrix = _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_10__.CoordinateHelper.GetNodeMatrix(control);
        const transformed = new core_Maths_math__WEBPACK_IMPORTED_MODULE_11__.Vector2(1, 1);
        nodeMatrix.transformCoordinates(1, 1, transformed);
        return transformed;
    }
    _updateAlignment(alignment, value) {
        for (const control of this.props.controls) {
            if (control.typeName === "TextBlock" && control.resizeToFit === false) {
                control["text" + alignment.charAt(0).toUpperCase() + alignment.slice(1)] = value;
            }
            else {
                control[alignment] = value;
            }
        }
        this.forceUpdate();
    }
    _checkAndUpdateValues(propertyName, value) {
        for (const control of this.props.controls) {
            // checking the previous value unit to see what it was.
            const vau = control["_" + propertyName];
            let percentage = vau.isPercentage;
            // now checking if the new string contains either a px or a % sign in case we need to change the unit.
            const negative = value.charAt(0) === "-";
            if (value.charAt(value.length - 1) === "%") {
                percentage = true;
            }
            else if (value.charAt(value.length - 1) === "x" && value.charAt(value.length - 2) === "p") {
                percentage = false;
            }
            if (control.parent?.typeName === "StackPanel") {
                percentage = false;
            }
            let newValue = value.match(/([\d.,]+)/g)?.[0];
            if (!newValue) {
                newValue = "0";
            }
            newValue = (negative ? "-" : "") + newValue;
            newValue += percentage ? "%" : "px";
            const initialValue = control[propertyName];
            control[propertyName] = newValue;
            this.props.onPropertyChangedObservable?.notifyObservers({
                object: control,
                property: propertyName,
                initialValue: initialValue,
                value: control[propertyName],
            });
        }
    }
    _addOrUpdateMetadata(options) {
        for (const control of this.props.controls) {
            const initialValue = control.metadata;
            // Convert strings to their proper types
            for (const key in options) {
                const v = options[key];
                if (!isNaN(v) && !isNaN(parseFloat(v))) {
                    options[key] = parseFloat(v);
                }
                else if (v.trim() === "true") {
                    options[key] = true;
                }
                else if (v.trim() === "false") {
                    options[key] = false;
                }
            }
            const newValue = Object.assign({}, control.metadata, options);
            control.metadata = newValue;
            this.props.onPropertyChangedObservable?.notifyObservers({
                object: control,
                property: "metadata",
                initialValue: initialValue,
                value: newValue,
            });
        }
    }
    _removeFromMetadata(key) {
        for (const control of this.props.controls) {
            const initialValue = Object.assign({}, control.metadata);
            delete control.metadata[key];
            this.props.onPropertyChangedObservable?.notifyObservers({
                object: control,
                property: "metadata",
                initialValue: initialValue,
                value: control.metadata,
            });
        }
    }
    _getCommonPropertyKeys(objects) {
        objects = objects.filter((x) => !!x);
        if (objects.length === 0)
            return [];
        if (objects.length === 1) {
            return Object.keys(objects[0]);
        }
        const [firstObject, ...restObjects] = objects;
        return Object.keys(firstObject).filter((property) => {
            return restObjects.every((obj) => property in obj);
        });
    }
    _markChildrenAsDirty() {
        for (const control of this.props.controls) {
            if (control instanceof gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Container)
                control._children.forEach((child) => {
                    child._markAsDirty();
                });
        }
    }
    componentWillUnmount() {
        if (this._onPropertyChangedObserver) {
            this.props.onPropertyChangedObservable?.remove(this._onPropertyChangedObserver);
        }
        if (this._onFontsParsedObserver) {
            this.props.onFontsParsedObservable?.remove(this._onFontsParsedObserver);
        }
        for (let i = 0; i < this._onControlVisibilityChangedObservers.length; i++) {
            this.props.controls[i].onIsVisibleChangedObservable.remove(this._onControlVisibilityChangedObservers[i]);
        }
    }
    _filterFontDuplicates(array) {
        const seen = new Set();
        return array.filter((item) => {
            const val = item.value;
            const duplicate = seen.has(val);
            seen.add(val);
            return !duplicate;
        });
    }
    render() {
        const controls = this.props.controls;
        const firstControl = controls[0];
        let horizontalAlignment = firstControl.horizontalAlignment;
        let verticalAlignment = firstControl.verticalAlignment;
        for (const control of controls) {
            if (control.horizontalAlignment !== horizontalAlignment) {
                horizontalAlignment = gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_CENTER;
            }
            if (control.verticalAlignment !== verticalAlignment) {
                verticalAlignment = gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_CENTER;
            }
        }
        if (controls.every((control) => control.typeName === "TextBlock" && control.resizeToFit === false)) {
            horizontalAlignment = firstControl.textHorizontalAlignment;
            verticalAlignment = firstControl.textVerticalAlignment;
        }
        const showTextProperties = firstControl instanceof gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Container || firstControl.typeName === "TextBlock" || firstControl.typeName === "InputText" || firstControl.typeName === "InputPassword";
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable);
        const getValue = (propertyName) => {
            const values = controls.map((control) => control[propertyName]._value);
            const firstValue = values[0];
            if (values.every((value) => value === firstValue)) {
                const units = getUnitString(propertyName);
                if (units === "%") {
                    return (firstValue * 100).toFixed(2);
                }
                else if (units === "PX") {
                    return firstValue.toFixed(2);
                }
                else {
                    return shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.conflictingValuesPlaceholder;
                }
            }
            else {
                return shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.conflictingValuesPlaceholder;
            }
        };
        const getUnitString = (propertyName) => {
            const units = controls.map((control) => control[propertyName]._unit);
            const firstUnit = units[0];
            if (units.every((unit) => unit === firstUnit)) {
                if (firstUnit === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PIXEL) {
                    return "PX";
                }
                else {
                    return "%";
                }
            }
            else {
                return shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.conflictingValuesPlaceholder;
            }
        };
        const increment = (propertyName, amount, minimum, maximum) => {
            for (const control of controls) {
                const initialValue = control[propertyName];
                const initialUnit = control["_" + propertyName]._unit;
                let newValue = control[`${propertyName}InPixels`] + amount;
                if (minimum !== undefined && newValue < minimum)
                    newValue = minimum;
                if (maximum !== undefined && newValue > maximum)
                    newValue = maximum;
                control[`${propertyName}InPixels`] = newValue;
                if (initialUnit === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PERCENTAGE) {
                    _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_10__.CoordinateHelper.ConvertToPercentage(control, [propertyName]);
                }
                this.props.onPropertyChangedObservable?.notifyObservers({
                    object: control,
                    property: propertyName,
                    initialValue: initialValue,
                    value: control[propertyName],
                });
            }
        };
        const convertUnits = (unit, property) => {
            for (const control of controls) {
                if (unit === "PX") {
                    _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_10__.CoordinateHelper.ConvertToPercentage(control, [property], this.props.onPropertyChangedObservable);
                }
                else {
                    _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_10__.CoordinateHelper.ConvertToPixels(control, [property], this.props.onPropertyChangedObservable);
                }
            }
        };
        const fontStyleOptions = [
            { label: "normal", value: "normal", id: "0" },
            { label: "italic", value: "italic", id: "1" },
            { label: "oblique", value: "oblique", id: "2" },
        ];
        let horizontalDisabled = false, verticalDisabled = false, widthUnitsLocked = false, heightUnitsLocked = false;
        const parent = controls[0].parent;
        const fonts = this._filterFontDuplicates(this.state.fontFamilyOptions.filter(({ label }) => label !== "Custom Font").map(({ label, value }) => ({ label, value: label, id: value.toString() })));
        if (parent?.getClassName() === "StackPanel" || parent?.getClassName() === "VirtualKeyboard") {
            if (parent.isVertical) {
                verticalDisabled = true;
                heightUnitsLocked = true;
            }
            else {
                horizontalDisabled = true;
                widthUnitsLocked = true;
            }
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [!this.props.hideDimensions && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider alignment-bar", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Left", icon: shared_ui_components_imgs_hAlignLeftIcon_svg__WEBPACK_IMPORTED_MODULE_20__, shortcut: "", isActive: horizontalAlignment === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT, onClick: () => {
                                        this._updateAlignment("horizontalAlignment", gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT);
                                    }, disabled: horizontalDisabled }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Center", icon: shared_ui_components_imgs_hAlignCenterIcon_svg__WEBPACK_IMPORTED_MODULE_21__, shortcut: "", isActive: horizontalAlignment === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_CENTER, onClick: () => {
                                        this._updateAlignment("horizontalAlignment", gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_CENTER);
                                    }, disabled: horizontalDisabled }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Right", icon: shared_ui_components_imgs_hAlignRightIcon_svg__WEBPACK_IMPORTED_MODULE_22__, shortcut: "", isActive: horizontalAlignment === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_RIGHT, onClick: () => {
                                        this._updateAlignment("horizontalAlignment", gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_RIGHT);
                                    }, disabled: horizontalDisabled }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Top", icon: shared_ui_components_imgs_vAlignTopIcon_svg__WEBPACK_IMPORTED_MODULE_23__, shortcut: "", isActive: verticalAlignment === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP, onClick: () => {
                                        this._updateAlignment("verticalAlignment", gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP);
                                    }, disabled: verticalDisabled }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Center", icon: shared_ui_components_imgs_vAlignCenterIcon_svg__WEBPACK_IMPORTED_MODULE_24__, shortcut: "", isActive: verticalAlignment === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_CENTER, onClick: () => {
                                        this._updateAlignment("verticalAlignment", gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_CENTER);
                                    }, disabled: verticalDisabled }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Bottom", icon: shared_ui_components_imgs_vAlignBottomIcon_svg__WEBPACK_IMPORTED_MODULE_25__, shortcut: "", isActive: verticalAlignment === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_BOTTOM, onClick: () => {
                                        this._updateAlignment("verticalAlignment", gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_BOTTOM);
                                    }, disabled: verticalDisabled })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_positionIcon_svg__WEBPACK_IMPORTED_MODULE_26__, label: "Position" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "X", delayInput: true, value: getValue("_left"), onChange: (newValue) => this._checkAndUpdateValues("left", newValue), unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_left"), onClick: (unit) => convertUnits(unit, "left") }), arrows: true, arrowsIncrement: (amount) => increment("left", amount) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "Y", delayInput: true, value: getValue("_top"), onChange: (newValue) => this._checkAndUpdateValues("top", newValue), unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_top"), onClick: (unit) => convertUnits(unit, "top") }), arrows: true, arrowsIncrement: (amount) => increment("top", amount) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_sizeIcon_svg__WEBPACK_IMPORTED_MODULE_27__, label: "Size" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "W", delayInput: true, value: getValue("_width"), onChange: (newValue) => {
                                        for (const control of controls) {
                                            if (control.typeName === "Image") {
                                                control.autoScale = false;
                                            }
                                            else if (control instanceof gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Container) {
                                                control.adaptWidthToChildren = false;
                                            }
                                            else if (control.typeName === "ColorPicker") {
                                                if (newValue === "0" || newValue === "-") {
                                                    newValue = "1";
                                                }
                                            }
                                        }
                                        this._checkAndUpdateValues("width", newValue);
                                    }, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_width"), locked: widthUnitsLocked, onClick: (unit) => convertUnits(unit, "width") }), arrows: true, arrowsIncrement: (amount) => increment("width", amount) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "H", delayInput: true, value: getValue("_height"), onChange: (newValue) => {
                                        for (const control of controls) {
                                            if (control.typeName === "Image") {
                                                control.autoScale = false;
                                            }
                                            else if (control instanceof gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Container) {
                                                control.adaptHeightToChildren = false;
                                            }
                                            else if (control.typeName === "ColorPicker") {
                                                if (newValue === "0" || newValue === "-") {
                                                    newValue = "1";
                                                }
                                            }
                                        }
                                        this._checkAndUpdateValues("height", newValue);
                                    }, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_height"), locked: heightUnitsLocked, onClick: (unit) => convertUnits(unit, "height") }), arrows: true, arrowsIncrement: (amount) => increment("height", amount) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_verticalMarginIcon_svg__WEBPACK_IMPORTED_MODULE_28__, label: "Vertical Padding" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "T", delayInput: true, value: getValue("_paddingTop"), onChange: (newValue) => {
                                        this._checkAndUpdateValues("paddingTop", newValue);
                                        this._markChildrenAsDirty();
                                    }, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_paddingTop"), onClick: (unit) => convertUnits(unit, "paddingTop") }), arrows: true, arrowsIncrement: (amount) => increment("paddingTop", amount, 0) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "B", delayInput: true, value: getValue("_paddingBottom"), onChange: (newValue) => {
                                        this._checkAndUpdateValues("paddingBottom", newValue);
                                        this._markChildrenAsDirty();
                                    }, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_paddingBottom"), onClick: (unit) => convertUnits(unit, "paddingBottom") }), arrows: true, arrowsIncrement: (amount) => increment("paddingBottom", amount, 0) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_horizontalMarginIcon_svg__WEBPACK_IMPORTED_MODULE_29__, label: "Horizontal Padding" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "L", delayInput: true, value: getValue("_paddingLeft"), onChange: (newValue) => {
                                        this._checkAndUpdateValues("paddingLeft", newValue);
                                        this._markChildrenAsDirty();
                                    }, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_paddingLeft"), onClick: (unit) => convertUnits(unit, "paddingLeft") }), arrows: true, arrowsIncrement: (amount) => increment("paddingLeft", amount) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "R", delayInput: true, value: getValue("_paddingRight"), onChange: (newValue) => {
                                        this._checkAndUpdateValues("paddingRight", newValue);
                                        this._markChildrenAsDirty();
                                    }, onPropertyChangedObservable: this.props.onPropertyChangedObservable, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_paddingRight"), onClick: (unit) => convertUnits(unit, "paddingRight") }), arrows: true, arrowsIncrement: (amount) => increment("paddingRight", amount) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_descendantsOnlyPaddingIcon_svg__WEBPACK_IMPORTED_MODULE_30__, label: "Makes padding affect only the descendants of this control" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__.CheckBoxLineComponent, { label: "ONLY PAD DESCENDANTS", target: proxy, propertyName: "descendentsOnlyPadding" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", { className: "ge" })] })), parent?.name === "root" && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "LINK OFFSET", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_linkedMeshOffsetIcon_svg__WEBPACK_IMPORTED_MODULE_31__, label: "Link offset" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "X", delayInput: true, value: getValue("_linkOffsetX"), onChange: (newValue) => this._checkAndUpdateValues("linkOffsetX", newValue), unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_linkOffsetX"), onClick: (unit) => convertUnits(unit, "linkOffsetX") }), arrows: true, arrowsIncrement: (amount) => increment("linkOffsetX", amount) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: true, lockObject: this.props.lockObject, label: "Y", delayInput: true, value: getValue("_linkOffsetY"), onChange: (newValue) => this._checkAndUpdateValues("linkOffsetY", newValue), unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_linkOffsetY"), onClick: (unit) => convertUnits(unit, "linkOffsetY") }), arrows: true, arrowsIncrement: (amount) => increment("linkOffsetY", amount) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", { className: "ge" })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { tooltip: "", label: "SERIALIZATION", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: _imgs_adtIcon_svg__WEBPACK_IMPORTED_MODULE_15__, label: "Serializable" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__.CheckBoxLineComponent, { label: "ISSERIALIZABLE", target: proxy, propertyName: "isSerializable" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { tooltip: "", label: "VISIBILITY", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: _imgs_visibilityActiveIcon_svg__WEBPACK_IMPORTED_MODULE_14__, label: "Visible" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__.CheckBoxLineComponent, { label: "ISVISIBLE", target: proxy, propertyName: "isVisible", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { tooltip: "", label: "TRANSFORMATION", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_scaleIcon_svg__WEBPACK_IMPORTED_MODULE_32__, label: "Scale" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_16__.FloatLineComponent, { lockObject: this.props.lockObject, label: "X", target: proxy, propertyName: "scaleX", arrows: true, digits: 2, step: "0.0005" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_16__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Y", target: proxy, propertyName: "scaleY", arrows: true, digits: 2, step: "0.0005" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_pivotIcon_svg__WEBPACK_IMPORTED_MODULE_33__, label: "Transform Center" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_16__.FloatLineComponent, { lockObject: this.props.lockObject, label: "X", target: proxy, propertyName: "transformCenterX", arrows: true, digits: 2, step: "0.0005" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_16__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Y", target: proxy, propertyName: "transformCenterY", arrows: true, digits: 2, step: "0.0005" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_rotationIcon_svg__WEBPACK_IMPORTED_MODULE_34__, label: "Rotation" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { iconLabel: "Rotation", lockObject: this.props.lockObject, label: "", target: proxy, decimalCount: 2, propertyName: "rotation", minimum: 0, maximum: 2 * Math.PI, step: 0.01, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: "RAD", locked: true }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", { className: "ge" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { tooltip: "", label: "APPEARANCE", value: " ", color: "grey" }), controls.every((control) => control.color !== undefined && control.typeName !== "Image" && control.typeName !== "ImageBasedSlider" && control.typeName !== "ColorPicker") && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_35__, label: "Outline Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_8__.ColorLine, { lockObject: this.props.lockObject, label: "Outline Color", target: proxy, propertyName: "color" })] })), controls.every((control) => control.background !== undefined) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_36__, label: "Background Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_8__.ColorLine, { lockObject: this.props.lockObject, label: "Background Color", target: proxy, propertyName: "background" })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_alphaIcon_svg__WEBPACK_IMPORTED_MODULE_37__, label: "Alpha" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "alpha", minimum: 0, maximum: 1, step: 0.01 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_shadowColorIcon_svg__WEBPACK_IMPORTED_MODULE_38__, label: "Shadow Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_8__.ColorLine, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "shadowColor" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_shadowOffsetXIcon_svg__WEBPACK_IMPORTED_MODULE_39__, label: "Shadow Offset" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_16__.FloatLineComponent, { lockObject: this.props.lockObject, label: "X", target: proxy, propertyName: "shadowOffsetX", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: "PX", locked: true }), arrows: true, step: "0.1", digits: 2 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_16__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Y", target: proxy, propertyName: "shadowOffsetY", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: "PX", locked: true }), arrows: true, step: "0.1", digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_shadowBlurIcon_svg__WEBPACK_IMPORTED_MODULE_40__, label: "Shadow Blur" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_16__.FloatLineComponent, { lockObject: this.props.lockObject, label: " ", target: proxy, propertyName: "shadowBlur", arrows: true, min: 0, digits: 2 })] }), showTextProperties && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", { className: "ge" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { tooltip: "", label: "FONT STYLE", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_fontFamilyIcon_svg__WEBPACK_IMPORTED_MODULE_41__, label: "Font Family" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_components_lines_OptionsLineComponent__WEBPACK_IMPORTED_MODULE_13__.OptionsLineComponent, { options: fonts, selectedOptionValue: proxy.fontFamily, onOptionSelected: (selectedFontValue) => {
                                        proxy.fontFamily = selectedFontValue;
                                    }, onOptionAdded: ({ value }) => {
                                        this._addFont(value);
                                    }, addOptionPlaceholder: "Add new font...", validateNewOptionValue: (newFontValue) => {
                                        if (newFontValue.length > 0 && !fonts.find((f) => f.label === newFontValue)) {
                                            return document.fonts.check(`12px ${newFontValue}`);
                                        }
                                        return false;
                                    } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_fontWeightIcon_svg__WEBPACK_IMPORTED_MODULE_42__, label: "Font Weight" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "fontWeight" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_fontStyleIcon_svg__WEBPACK_IMPORTED_MODULE_43__, label: "Font Style" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_components_lines_OptionsLineComponent__WEBPACK_IMPORTED_MODULE_13__.OptionsLineComponent, { options: fontStyleOptions, selectedOptionValue: proxy.fontStyle, onOptionSelected: (value) => {
                                        proxy.fontStyle = value;
                                    } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_12__.IconComponent, { icon: shared_ui_components_imgs_fontSizeIcon_svg__WEBPACK_IMPORTED_MODULE_44__, label: "Font Size" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "", numbersOnly: true, value: getValue("_fontSize"), onChange: (newValue) => this._checkAndUpdateValues("fontSize", newValue), unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_17__.UnitButton, { unit: getUnitString("_fontSize"), onClick: (unit) => convertUnits(unit, "fontSize") }), arrows: true, arrowsIncrement: (amount) => increment("fontSize", amount, 0) })] })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", { className: "ge" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { tooltip: "", label: "METADATA", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Add", icon: shared_ui_components_imgs_addGridElementDark_svg__WEBPACK_IMPORTED_MODULE_45__, isActive: false, onClick: () => {
                                const w = _guiEditor__WEBPACK_IMPORTED_MODULE_19__.GUIEditor._PopupWindow ?? window;
                                const input = w.prompt("Enter new key name for metadata value", "newKey");
                                if (input === null || input.trim() === "") {
                                    return;
                                }
                                let keyName = input;
                                let num = 1;
                                while (controls.some((x) => keyName in x.metadata)) {
                                    num++;
                                    keyName = input + num;
                                }
                                this._addOrUpdateMetadata({ [keyName]: "" });
                            } })] }), this._getCommonPropertyKeys(controls.map((x) => x.metadata)).map((metaKey) => {
                    if (metaKey === "guiEditor" || metaKey.startsWith("_") || metaKey === "editorUniqueId") {
                        return;
                    }
                    const firstControl = controls.find((x) => !!x.metadata);
                    if (!firstControl) {
                        return;
                    }
                    let value = firstControl.metadata[metaKey];
                    const isNotEditableValue = typeof value === "object";
                    const allValues = controls.map((x) => x.metadata[metaKey]);
                    if (!allValues.every((x) => x === value)) {
                        value = shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.conflictingValuesPlaceholder;
                    }
                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: false, lockObject: this.props.lockObject, label: "", delayInput: true, value: metaKey, disabled: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { numbersOnly: false, lockObject: this.props.lockObject, label: ":", delayInput: true, disabled: isNotEditableValue, value: typeof value === "string" ? value : JSON.stringify(value), onChange: (x) => this._addOrUpdateMetadata({ [metaKey]: x }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_6__.CommandButtonComponent, { tooltip: "Remove", icon: shared_ui_components_imgs_deleteGridElementDark_svg__WEBPACK_IMPORTED_MODULE_46__, isActive: false, onClick: () => this._removeFromMetadata(metaKey) })] }) }, metaKey));
                })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/containerPropertyGridComponent.js":
/*!****************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/containerPropertyGridComponent.js ***!
  \****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1567853__) => {

"use strict";
__nested_webpack_require_1567853__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1567853__.d(__nested_webpack_exports__, {
/* harmony export */   ContainerPropertyGridComponent: () => (/* binding */ ContainerPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1567853__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1567853__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1567853__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1567853__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_clipContentsIcon_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1567853__(/*! shared-ui-components/imgs/clipContentsIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/clipContentsIcon.svg");
/* harmony import */ var shared_ui_components_imgs_clipChildrenIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1567853__(/*! shared-ui-components/imgs/clipChildrenIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/clipChildrenIcon.svg");
/* harmony import */ var shared_ui_components_imgs_autoStretchWidthIcon_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1567853__(/*! shared-ui-components/imgs/autoStretchWidthIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/autoStretchWidthIcon.svg");
/* harmony import */ var shared_ui_components_imgs_autoStretchHeightIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1567853__(/*! shared-ui-components/imgs/autoStretchHeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/autoStretchHeightIcon.svg");
/* harmony import */ var _imgs_adtIcon_svg__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1567853__(/*! ../../../../imgs/adtIcon.svg */ "../../../tools/guiEditor/dist/imgs/adtIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1567853__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");










class ContainerPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    render() {
        const { containers, onPropertyChangedObservable } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_3__.makeTargetsProxy)(containers, onPropertyChangedObservable);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_5__.IconComponent, { icon: shared_ui_components_imgs_clipContentsIcon_svg__WEBPACK_IMPORTED_MODULE_6__, label: "Clips content outside the bounding box of this control" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "CLIP CONTENT", target: proxy, propertyName: "clipContent" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_5__.IconComponent, { icon: shared_ui_components_imgs_clipChildrenIcon_svg__WEBPACK_IMPORTED_MODULE_7__, label: "Clips child controls to this control's shape" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "CLIP CHILDREN", target: proxy, propertyName: "clipChildren" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_5__.IconComponent, { icon: shared_ui_components_imgs_autoStretchWidthIcon_svg__WEBPACK_IMPORTED_MODULE_8__, label: "Makes the container's width automatically adapt to its children" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "ADAPT WIDTH TO CHILDREN", target: proxy, propertyName: "adaptWidthToChildren" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_5__.IconComponent, { icon: shared_ui_components_imgs_autoStretchHeightIcon_svg__WEBPACK_IMPORTED_MODULE_9__, label: "Makes the container's height automatically adapt to its children" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "ADAPT HEIGHT TO CHILDREN", target: proxy, propertyName: "adaptHeightToChildren" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_5__.IconComponent, { icon: _imgs_adtIcon_svg__WEBPACK_IMPORTED_MODULE_4__, label: "Delegates picking to children controls" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "DELEGATE PICKING TO CHILDREN", target: proxy, propertyName: "delegatePickingToChildren" })] })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/controlPropertyGridComponent.js":
/*!**************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/controlPropertyGridComponent.js ***!
  \**************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1574538__) => {

"use strict";
__nested_webpack_require_1574538__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1574538__.d(__nested_webpack_exports__, {
/* harmony export */   ControlPropertyGridComponent: () => (/* binding */ ControlPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1574538__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1574538__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1574538__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");



class ControlPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const controls = this.props.controls;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "pane", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: controls, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }) }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/displayGridPropertyGridComponent.js":
/*!******************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/displayGridPropertyGridComponent.js ***!
  \******************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1576661__) => {

"use strict";
__nested_webpack_require_1576661__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1576661__.d(__nested_webpack_exports__, {
/* harmony export */   DisplayGridPropertyGridComponent: () => (/* binding */ DisplayGridPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1576661__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1576661__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1576661__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1576661__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1576661__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1576661__(/*! shared-ui-components/lines/colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1576661__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_sizeIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1576661__(/*! shared-ui-components/imgs/sizeIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/sizeIcon.svg");
/* harmony import */ var shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1576661__(/*! shared-ui-components/imgs/colorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/colorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1576661__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_displayGridLine1Icon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1576661__(/*! shared-ui-components/imgs/displayGridLine1Icon.svg */ "../../../dev/sharedUiComponents/dist/imgs/displayGridLine1Icon.svg");
/* harmony import */ var shared_ui_components_imgs_frequencyIcon_svg__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1576661__(/*! shared-ui-components/imgs/frequencyIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/frequencyIcon.svg");
/* harmony import */ var shared_ui_components_imgs_displayGridLine2Icon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1576661__(/*! shared-ui-components/imgs/displayGridLine2Icon.svg */ "../../../dev/sharedUiComponents/dist/imgs/displayGridLine2Icon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1576661__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1576661__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1576661__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
















class DisplayGridPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const { displayGrids, lockObject, onPropertyChangedObservable } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(displayGrids, onPropertyChangedObservable);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: lockObject, controls: displayGrids, onPropertyChangedObservable: onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "DISPLAY GRID", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_sizeIcon_svg__WEBPACK_IMPORTED_MODULE_10__, label: "Cell Size" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { min: 1, isInteger: true, lockObject: lockObject, label: "W", target: proxy, propertyName: "cellWidth", onPropertyChangedObservable: onPropertyChangedObservable, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { locked: true, unit: "PX" }), arrows: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { min: 1, isInteger: true, lockObject: lockObject, label: "H", target: proxy, propertyName: "cellHeight", onPropertyChangedObservable: onPropertyChangedObservable, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { locked: true, unit: "PX" }), arrows: true })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_displayGridLine1Icon_svg__WEBPACK_IMPORTED_MODULE_11__, label: "Show Minor Lines" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__.CheckBoxLineComponent, { label: "SHOW MINOR LINES", onValueChanged: () => this.forceUpdate(), target: proxy, propertyName: "_displayMinorLines" })] }), proxy._displayMinorLines && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Minor Line Tickness" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { min: 1, isInteger: true, lockObject: lockObject, label: "", target: proxy, propertyName: "minorLineTickness", onPropertyChangedObservable: onPropertyChangedObservable, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { locked: true, unit: "PX" }), arrows: true })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Minor Line Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_5__.ColorLine, { lockObject: lockObject, label: "", target: proxy, propertyName: "minorLineColor", onPropertyChangedObservable: onPropertyChangedObservable })] })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_displayGridLine2Icon_svg__WEBPACK_IMPORTED_MODULE_14__, label: "Show Major Lines" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__.CheckBoxLineComponent, { label: "SHOW MAJOR LINES", onValueChanged: () => this.forceUpdate(), target: proxy, propertyName: "_displayMajorLines" })] }), proxy._displayMajorLines && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Major Line Tickness" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { min: 1, isInteger: true, lockObject: lockObject, label: "", target: proxy, propertyName: "majorLineTickness", onPropertyChangedObservable: onPropertyChangedObservable, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { locked: true, unit: "PX" }), arrows: true })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Major Line Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_5__.ColorLine, { lockObject: lockObject, label: "", target: proxy, propertyName: "majorLineColor", onPropertyChangedObservable: onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_frequencyIcon_svg__WEBPACK_IMPORTED_MODULE_15__, label: "Major Line Frequency" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { min: 1, isInteger: true, lockObject: lockObject, label: "", target: proxy, propertyName: "majorLineFrequency", onPropertyChangedObservable: onPropertyChangedObservable, arrows: true })] })] }))] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/ellipsePropertyGridComponent.js":
/*!**************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/ellipsePropertyGridComponent.js ***!
  \**************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1589053__) => {

"use strict";
__nested_webpack_require_1589053__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1589053__.d(__nested_webpack_exports__, {
/* harmony export */   EllipsePropertyGridComponent: () => (/* binding */ EllipsePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1589053__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1589053__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1589053__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1589053__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1589053__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1589053__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _containerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1589053__(/*! ./containerPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/containerPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1589053__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1589053__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1589053__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");










class EllipsePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const { ellipses, onPropertyChangedObservable, lockObject } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_5__.makeTargetsProxy)(ellipses, onPropertyChangedObservable);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: lockObject, controls: ellipses, onPropertyChangedObservable: onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "ELLIPSE", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_9__, label: "Stroke Weight" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "thickness", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_containerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__.ContainerPropertyGridComponent, { containers: ellipses, onPropertyChangedObservable: onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/gridPropertyGridComponent.js":
/*!***********************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/gridPropertyGridComponent.js ***!
  \***********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1594282__) => {

"use strict";
__nested_webpack_require_1594282__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1594282__.d(__nested_webpack_exports__, {
/* harmony export */   GridPropertyGridComponent: () => (/* binding */ GridPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1594282__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1594282__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1594282__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1594282__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1594282__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1594282__(/*! ../../../commandButtonComponent */ "../../../tools/guiEditor/dist/components/commandButtonComponent.js");
/* harmony import */ var shared_ui_components_imgs_gridColumnIconDark_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1594282__(/*! shared-ui-components/imgs/gridColumnIconDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/gridColumnIconDark.svg");
/* harmony import */ var shared_ui_components_imgs_gridRowIconDark_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1594282__(/*! shared-ui-components/imgs/gridRowIconDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/gridRowIconDark.svg");
/* harmony import */ var shared_ui_components_imgs_confirmGridElementDark_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1594282__(/*! shared-ui-components/imgs/confirmGridElementDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/confirmGridElementDark.svg");
/* harmony import */ var shared_ui_components_imgs_subtractGridElementDark_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1594282__(/*! shared-ui-components/imgs/subtractGridElementDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/subtractGridElementDark.svg");
/* harmony import */ var shared_ui_components_imgs_addGridElementDark_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1594282__(/*! shared-ui-components/imgs/addGridElementDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/addGridElementDark.svg");
/* harmony import */ var shared_ui_components_imgs_cancelGridElementDark_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1594282__(/*! shared-ui-components/imgs/cancelGridElementDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/cancelGridElementDark.svg");
/* harmony import */ var shared_ui_components_imgs_valueChangedGridDark_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1594282__(/*! shared-ui-components/imgs/valueChangedGridDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/valueChangedGridDark.svg");
/* harmony import */ var shared_ui_components_imgs_deleteGridElementDark_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1594282__(/*! shared-ui-components/imgs/deleteGridElementDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/deleteGridElementDark.svg");
/* harmony import */ var gui_2D_math2D__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1594282__(/*! gui/2D/math2D */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_math2D__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_1594282__.n(gui_2D_math2D__WEBPACK_IMPORTED_MODULE_6__);















class GridPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._previousGrid = null;
        this._rowDefinitions = [];
        this._rowEditFlags = [];
        this._columnEditFlags = [];
        this._columnDefinitions = [];
        this._editedRow = false;
        this._editedColumn = false;
        this._rowChild = false;
        this._columnChild = false;
        this.state = { removingColumn: false, removingRow: false };
    }
    renderRows() {
        return this._rowDefinitions.map((rd, i) => {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.removingRow && i === this._rowEditFlags.length - 1 ? "ge-grid-remove" : this._rowEditFlags[i] ? "ge-grid-edit" : "ge-grid", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-grid-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "", icon: shared_ui_components_imgs_gridRowIconDark_svg__WEBPACK_IMPORTED_MODULE_7__, iconLabel: `Row ${i}`, value: rd, numbersOnly: true, onChange: (newValue) => {
                                if (newValue === this._rowDefinitions[i]) {
                                    return;
                                }
                                this._rowDefinitions[i] = newValue;
                                this._rowEditFlags[i] = true;
                                this._editedRow = true;
                                this._rowChild = false;
                                this.setState({ removingRow: false });
                            }, disabled: this.state.removingRow }, `rText${i}-${this.state.removingRow}`), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { tooltip: "", label: `[${i}]`, value: "", color: "grey" }), this.state.removingRow && i === this._rowEditFlags.length - 1 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { icon: shared_ui_components_imgs_deleteGridElementDark_svg__WEBPACK_IMPORTED_MODULE_8__, label: " ", value: " ", color: "grey" })), this._rowEditFlags[i] && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { icon: shared_ui_components_imgs_valueChangedGridDark_svg__WEBPACK_IMPORTED_MODULE_9__, label: " ", value: " ", color: "grey" })] }) }, `r${i}`));
        });
    }
    setRowValues() {
        const grid = this.props.grids[0];
        this._rowDefinitions = [];
        this._rowEditFlags = [];
        this._editedRow = false;
        for (let index = 0; index < grid.rowCount; index++) {
            const value = grid.getRowDefinition(index);
            if (value) {
                this._rowDefinitions.push(value.toString(grid._host, 2));
                this._rowEditFlags.push(false);
            }
        }
    }
    setColumnValues() {
        const grid = this.props.grids[0];
        this._columnDefinitions = [];
        this._columnEditFlags = [];
        this._editedColumn = false;
        for (let index = 0; index < grid.columnCount; index++) {
            const value = grid.getColumnDefinition(index);
            if (value) {
                this._columnDefinitions.push(value.toString(grid._host, 2));
                this._columnEditFlags.push(false);
            }
        }
    }
    renderColumns() {
        return this._columnDefinitions.map((cd, i) => {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.removingColumn && i === this._columnEditFlags.length - 1 ? "ge-grid-remove" : this._columnEditFlags[i] ? "ge-grid-edit" : "ge-grid", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-grid-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "", icon: shared_ui_components_imgs_gridColumnIconDark_svg__WEBPACK_IMPORTED_MODULE_10__, iconLabel: `Column ${i}`, value: cd, numbersOnly: true, onChange: (newValue) => {
                                if (newValue === this._columnDefinitions[i]) {
                                    return;
                                }
                                this._columnDefinitions[i] = newValue;
                                this._columnEditFlags[i] = true;
                                this._editedColumn = true;
                                this._columnChild = false;
                                this.setState({ removingColumn: false });
                            }, disabled: this.state.removingColumn }, `ctext${i}-${this.state.removingColumn}`), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { tooltip: "", label: `[${i}]`, value: "", color: "grey" }), this.state.removingColumn && i === this._columnEditFlags.length - 1 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { icon: shared_ui_components_imgs_deleteGridElementDark_svg__WEBPACK_IMPORTED_MODULE_8__, label: " ", value: " ", color: "grey" })), this._columnEditFlags[i] && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { icon: shared_ui_components_imgs_valueChangedGridDark_svg__WEBPACK_IMPORTED_MODULE_9__, label: " ", value: " ", color: "grey" })] }) }, `c${i}`));
        });
    }
    parsePercentage(value) {
        let floatResult;
        if (value.trim().at(-1) === "%") {
            floatResult = parseFloat(value.replace("%", "")) / 100;
        }
        else {
            floatResult = parseFloat(value);
        }
        return gui_2D_math2D__WEBPACK_IMPORTED_MODULE_6__.MathTools.Round(floatResult, 10000);
    }
    isCloseTo(value, expected, epsilon = 0.001) {
        return Math.abs(value - expected) < epsilon;
    }
    adjustPercentages(definitions, editFlags) {
        let percentageTotal = 0;
        let modifiedEntriesPercentageTotal = 0;
        const cellValues = [];
        for (let i = 0; i < definitions.length; ++i) {
            let value = definitions[i];
            const percent = this.checkPercentage(value);
            if (editFlags[i]) {
                value = this.checkValue(value, percent);
            }
            if (percent) {
                percentageTotal += this.parsePercentage(value);
                if (editFlags[i]) {
                    modifiedEntriesPercentageTotal += this.parsePercentage(value);
                }
            }
            cellValues.push(value);
        }
        let modifiedCellValues = [];
        // If the total percentage is not 100% we need to adjust the values based on the remaining percentage that was not modified by the user;
        // If the remaining percentage is 0% we need to resize the modified entries to fit the remaining space
        if (this.isCloseTo(percentageTotal, 1)) {
            modifiedCellValues = cellValues;
        }
        else {
            const absoluteRemainingPercentage = 1 - modifiedEntriesPercentageTotal;
            const magnitudeRemainingPercentage = Math.abs(absoluteRemainingPercentage);
            const unmodifiedEntriesPercentage = percentageTotal - modifiedEntriesPercentageTotal;
            const resizeModifiedEntries = this.isCloseTo(unmodifiedEntriesPercentage, 0);
            for (let i = 0; i < cellValues.length; ++i) {
                const value = cellValues[i];
                const percent = this.checkPercentage(value);
                if ((percent && !editFlags[i]) || (editFlags[i] && resizeModifiedEntries)) {
                    const parsedValue = this.parsePercentage(value);
                    const entryWeight = parsedValue / (resizeModifiedEntries ? percentageTotal : unmodifiedEntriesPercentage);
                    const newEntryValue = entryWeight * (resizeModifiedEntries ? 1 : magnitudeRemainingPercentage);
                    modifiedCellValues.push(`${newEntryValue * 100}%`);
                }
                else {
                    modifiedCellValues.push(value);
                }
            }
        }
        return modifiedCellValues;
    }
    resizeRow() {
        const grid = this.props.grids[0];
        const modifiedRowValues = this.adjustPercentages(this._rowDefinitions, this._rowEditFlags);
        for (let i = 0; i < modifiedRowValues.length; ++i) {
            grid.setRowDefinition(i, this.parsePercentage(modifiedRowValues[i]), !this.checkPercentage(modifiedRowValues[i]));
        }
        this.setRowValues();
    }
    resizeColumn() {
        const grid = this.props.grids[0];
        const columnValues = this.adjustPercentages(this._columnDefinitions, this._columnEditFlags);
        for (let i = 0; i < columnValues.length; ++i) {
            grid.setColumnDefinition(i, this.parsePercentage(columnValues[i]), !this.checkPercentage(this._columnDefinitions[i]));
        }
        this.setColumnValues();
    }
    checkValue(value, percent) {
        let newValue = value.match(/([0-9.,]+)/g)?.[0];
        if (!newValue) {
            newValue = "0";
        }
        newValue += percent ? "%" : "px";
        return newValue;
    }
    checkPercentage(value) {
        const toSearch = "px";
        return value.substring(value.length - toSearch.length, value.length) !== toSearch;
    }
    resetValues() {
        const grid = this.props.grids[0];
        this._columnChild = false;
        this._rowChild = false;
        this._previousGrid = grid;
        this.setRowValues();
        this.setColumnValues();
        this.resizeColumn();
        this.resizeRow();
        this.setState({ removingColumn: false, removingRow: false });
    }
    render() {
        const grids = this.props.grids;
        const grid = this.props.grids[0];
        if (grid !== this._previousGrid) {
            this.resetValues();
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: grids, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", { className: "ge" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { tooltip: "", label: "GRID", value: " ", color: "grey" }), this.renderRows(), this.props.grids.length === 1 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ge-gridLine", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-grid-button-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Add Row", icon: shared_ui_components_imgs_addGridElementDark_svg__WEBPACK_IMPORTED_MODULE_11__, shortcut: "", isActive: false, disabled: this.state.removingRow || this._editedRow, onClick: () => {
                                            let total = 0;
                                            let count = 0;
                                            for (let i = 0; i < grid.rowCount; ++i) {
                                                const rd = grid.getRowDefinition(i);
                                                if (rd?.isPercentage) {
                                                    total += rd?.getValue(grid.host);
                                                    count++;
                                                }
                                            }
                                            grid.addRowDefinition(total / count, false);
                                            this.resetValues();
                                            this.forceUpdate();
                                        } }), " ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Remove Row", icon: shared_ui_components_imgs_subtractGridElementDark_svg__WEBPACK_IMPORTED_MODULE_12__, shortcut: "", isActive: false, disabled: this.state.removingRow || grid.rowCount <= 1 || this._editedRow, onClick: () => {
                                            let hasChild = false;
                                            for (let i = 0; i < grid.columnCount; ++i) {
                                                const child = grid.cells[grid.rowCount - 1 + ":" + i];
                                                if (child?.children.length) {
                                                    hasChild = true;
                                                    break;
                                                }
                                            }
                                            this.resetValues();
                                            if (hasChild) {
                                                this._rowChild = true;
                                            }
                                            this.setState({ removingRow: true });
                                        } }), this._editedRow && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [" ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Confirm", icon: shared_ui_components_imgs_confirmGridElementDark_svg__WEBPACK_IMPORTED_MODULE_13__, shortcut: "", isActive: false, onClick: () => {
                                                    this.resizeRow();
                                                    this.forceUpdate();
                                                } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Cancel", icon: shared_ui_components_imgs_cancelGridElementDark_svg__WEBPACK_IMPORTED_MODULE_14__, shortcut: "", isActive: false, onClick: () => {
                                                    this.resetValues();
                                                    this.forceUpdate();
                                                } })] })), this.state.removingRow && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Confirm", icon: shared_ui_components_imgs_confirmGridElementDark_svg__WEBPACK_IMPORTED_MODULE_13__, shortcut: "", isActive: false, onClick: () => {
                                                    grid.removeRowDefinition(grid.rowCount - 1);
                                                    this.setRowValues();
                                                    this.resizeRow();
                                                    this.setState({ removingRow: false });
                                                    this._rowChild = false;
                                                    this.props.onUpdateRequiredObservable?.notifyObservers();
                                                } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Cancel", icon: shared_ui_components_imgs_cancelGridElementDark_svg__WEBPACK_IMPORTED_MODULE_14__, shortcut: "", isActive: false, onClick: () => {
                                                    this.setState({ removingRow: false });
                                                    this._rowChild = false;
                                                    this.forceUpdate();
                                                } })] }))] }) }), this._rowChild && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { tooltip: "", label: "This row is not empty. Removing it will delete all contained controls. Do you want to remove this row and delete all controls within?", value: " ", color: "grey" }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", { className: "ge" }), this.renderColumns(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-grid-button-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Add Column", icon: shared_ui_components_imgs_addGridElementDark_svg__WEBPACK_IMPORTED_MODULE_11__, shortcut: "", isActive: false, disabled: this.state.removingColumn || this._editedColumn, onClick: () => {
                                        let total = 0;
                                        let count = 0;
                                        for (let i = 0; i < grid.columnCount; ++i) {
                                            const cd = grid.getColumnDefinition(i);
                                            if (cd?.isPercentage) {
                                                total += cd?.getValue(grid.host);
                                                count++;
                                            }
                                        }
                                        grid.addColumnDefinition(total / count, false);
                                        this.resetValues();
                                        this.forceUpdate();
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Remove Column", icon: shared_ui_components_imgs_subtractGridElementDark_svg__WEBPACK_IMPORTED_MODULE_12__, shortcut: "", isActive: false, disabled: this.state.removingColumn || this._editedColumn || grid.columnCount <= 1, onClick: () => {
                                        let hasChild = false;
                                        for (let i = 0; i < grid.rowCount; ++i) {
                                            const child = grid.cells[i + ":" + (grid.columnCount - 1)];
                                            if (child?.children.length) {
                                                hasChild = true;
                                                break;
                                            }
                                        }
                                        this.resetValues();
                                        if (hasChild) {
                                            this._columnChild = true;
                                        }
                                        this.setState({ removingColumn: true });
                                    } }), this._editedColumn && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Confirm", icon: shared_ui_components_imgs_confirmGridElementDark_svg__WEBPACK_IMPORTED_MODULE_13__, shortcut: "", isActive: false, onClick: () => {
                                                this.resizeColumn();
                                                this.forceUpdate();
                                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Cancel", icon: shared_ui_components_imgs_cancelGridElementDark_svg__WEBPACK_IMPORTED_MODULE_14__, shortcut: "", isActive: false, onClick: () => {
                                                this.resetValues();
                                                this.forceUpdate();
                                            } })] })), this.state.removingColumn && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Confirm", icon: shared_ui_components_imgs_confirmGridElementDark_svg__WEBPACK_IMPORTED_MODULE_13__, shortcut: "", isActive: false, onClick: () => {
                                                grid.removeColumnDefinition(grid.columnCount - 1);
                                                this.setColumnValues();
                                                this.resizeColumn();
                                                this.setState({ removingColumn: false });
                                                this._columnChild = false;
                                                this.props.onUpdateRequiredObservable?.notifyObservers();
                                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commandButtonComponent__WEBPACK_IMPORTED_MODULE_5__.CommandButtonComponent, { altStyle: true, tooltip: "Cancel", icon: shared_ui_components_imgs_cancelGridElementDark_svg__WEBPACK_IMPORTED_MODULE_14__, shortcut: "", isActive: false, onClick: () => {
                                                this.setState({ removingColumn: false });
                                                this._columnChild = false;
                                            } })] })), " "] }), this._columnChild && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { tooltip: "", label: "This column is not empty. Removing it will delete all contained controls. Do you want to remove this column and delete all controls within?", value: " ", color: "grey" }) }))] }))] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js":
/*!***********************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js ***!
  \***********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1622172__) => {

"use strict";
__nested_webpack_require_1622172__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1622172__.d(__nested_webpack_exports__, {
/* harmony export */   ImageBasedSliderPropertyGridComponent: () => (/* binding */ ImageBasedSliderPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1622172__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1622172__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1622172__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1622172__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1622172__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var _sliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1622172__(/*! ./sliderPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/sliderPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1622172__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_thumbImageLinkIcon_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1622172__(/*! shared-ui-components/imgs/thumbImageLinkIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/thumbImageLinkIcon.svg");
/* harmony import */ var shared_ui_components_imgs_valueBarImageLinkIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1622172__(/*! shared-ui-components/imgs/valueBarImageLinkIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/valueBarImageLinkIcon.svg");
/* harmony import */ var shared_ui_components_imgs_sliderBackgroundImageIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1622172__(/*! shared-ui-components/imgs/sliderBackgroundImageIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/sliderBackgroundImageIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1622172__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");











class ImageBasedSliderPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const imageBasedSliders = this.props.imageBasedSliders;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: imageBasedSliders, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "IMAGE LINKS", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_thumbImageLinkIcon_svg__WEBPACK_IMPORTED_MODULE_8__, label: "Thumb Image Link" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: this.props.lockObject, target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(imageBasedSliders.map((slider) => slider.thumbImage), this.props.onPropertyChangedObservable), label: "", propertyName: "source" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_valueBarImageLinkIcon_svg__WEBPACK_IMPORTED_MODULE_9__, label: "Value Bar Image Link" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: this.props.lockObject, target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(imageBasedSliders.map((slider) => slider.valueBarImage), this.props.onPropertyChangedObservable), label: "", propertyName: "source", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_sliderBackgroundImageIcon_svg__WEBPACK_IMPORTED_MODULE_10__, label: "Background Image Link" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: this.props.lockObject, target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(imageBasedSliders.map((slider) => slider.backgroundImage), this.props.onPropertyChangedObservable), label: "", propertyName: "source", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_sliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__.SliderPropertyGridComponent, { sliders: imageBasedSliders, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/imagePropertyGridComponent.js":
/*!************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/imagePropertyGridComponent.js ***!
  \************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1629394__) => {

"use strict";
__nested_webpack_require_1629394__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1629394__.d(__nested_webpack_exports__, {
/* harmony export */   ImagePropertyGridComponent: () => (/* binding */ ImagePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1629394__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1629394__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1629394__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1629394__(/*! gui/2D/controls/image */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1629394__.n(gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1629394__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1629394__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1629394__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1629394__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1629394__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1629394__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_stretchFillIcon_svg__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1629394__(/*! shared-ui-components/imgs/stretchFillIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/stretchFillIcon.svg");
/* harmony import */ var shared_ui_components_imgs_imageLinkIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1629394__(/*! shared-ui-components/imgs/imageLinkIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/imageLinkIcon.svg");
/* harmony import */ var shared_ui_components_imgs_cropIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1629394__(/*! shared-ui-components/imgs/cropIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/cropIcon.svg");
/* harmony import */ var shared_ui_components_imgs_cellIDIcon_svg__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1629394__(/*! shared-ui-components/imgs/cellIDIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/cellIDIcon.svg");
/* harmony import */ var shared_ui_components_imgs_autoResizeIcon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1629394__(/*! shared-ui-components/imgs/autoResizeIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/autoResizeIcon.svg");
/* harmony import */ var shared_ui_components_imgs_sizeIcon_svg__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_1629394__(/*! shared-ui-components/imgs/sizeIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/sizeIcon.svg");
/* harmony import */ var shared_ui_components_imgs_animationSheetIcon_svg__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1629394__(/*! shared-ui-components/imgs/animationSheetIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/animationSheetIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1629394__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1629394__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");



















class ImagePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._observers = new Map();
        this.updateObservers([], props.images);
    }
    shouldComponentUpdate(nextProps) {
        this.updateObservers(this.props.images, nextProps.images);
        return true;
    }
    updateObservers(oldImages, newImages) {
        for (const image of newImages) {
            if (!oldImages.includes(image)) {
                this._observers.set(image, image.onImageLoadedObservable.add(() => this.forceUpdate()));
            }
        }
        for (const image of oldImages) {
            if (!newImages.includes(image)) {
                image.onImageLoadedObservable.remove(this._observers.get(image));
                this._observers.delete(image);
            }
        }
    }
    componentWillUnmount() {
        this.updateObservers(this.props.images, []);
    }
    toggleAnimations(on) {
        for (const image of this.props.images) {
            if (on) {
                image.cellId = 0;
                image.cellWidth = image.imageWidth;
                image.cellHeight = image.imageHeight;
            }
            else {
                image.cellId = -1;
            }
        }
    }
    getMaxCells() {
        let maxCells = Number.MAX_SAFE_INTEGER;
        for (const image of this.props.images) {
            if (image.cellWidth === 0 || image.cellHeight === 0)
                continue;
            const cols = Math.ceil(image.imageWidth / image.cellWidth);
            const rows = Math.ceil(image.imageHeight / image.cellHeight);
            const max = cols * rows - 1;
            if (max < maxCells)
                maxCells = max;
        }
        return maxCells;
    }
    updateCellSize() {
        const maxCells = this.getMaxCells();
        for (const image of this.props.images) {
            if (image.cellId > maxCells) {
                image.cellId = maxCells;
            }
        }
        this.forceUpdate();
    }
    render() {
        const images = this.props.images;
        const image = images[0]; // for nine slice
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(images, this.props.onPropertyChangedObservable);
        const stretchOptions = [
            { label: "None", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_3__.Image.STRETCH_NONE },
            { label: "Fill", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_3__.Image.STRETCH_FILL },
            { label: "Uniform", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_3__.Image.STRETCH_UNIFORM },
            { label: "Extend", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_3__.Image.STRETCH_EXTEND },
            { label: "NinePatch", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_3__.Image.STRETCH_NINE_PATCH },
        ];
        const animationSheet = images.every((image) => image.cellId !== -1);
        const maxCells = this.getMaxCells();
        const maxCellWidth = Math.max(...images.map((image) => image.imageWidth));
        const maxCellHeight = Math.max(...images.map((image) => image.imageHeight));
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: images, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__.TextLineComponent, { label: "IMAGE", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_imageLinkIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Source" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: " ", target: proxy, propertyName: "source" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_cropIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Crop" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "L", target: proxy, propertyName: "sourceLeft", numeric: true, arrows: true, min: 0, placeholder: "0", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__.UnitButton, { unit: "PX", locked: true }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "T", target: proxy, propertyName: "sourceTop", numeric: true, arrows: true, min: 0, placeholder: "0", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__.UnitButton, { unit: "PX", locked: true }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_cropIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Crop" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "W", target: proxy, propertyName: "sourceWidth", numeric: true, arrows: true, min: 0, placeholder: Math.max(...images.map((image) => image.imageWidth)).toString(), unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__.UnitButton, { unit: "PX", locked: true }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "H", target: proxy, propertyName: "sourceHeight", numeric: true, arrows: true, min: 0, placeholder: Math.max(...images.map((image) => image.imageHeight)).toString(), unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__.UnitButton, { unit: "PX", locked: true }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_autoResizeIcon_svg__WEBPACK_IMPORTED_MODULE_14__, label: "Autoscale" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "AUTOSCALE", target: proxy, propertyName: "autoScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_stretchFillIcon_svg__WEBPACK_IMPORTED_MODULE_15__, label: "Stretch" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__.OptionsLine, { label: " ", options: stretchOptions, target: proxy, propertyName: "stretch", onSelect: (value) => this.setState({ mode: value }) })] }), images.length === 1 && image.stretch === gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_3__.Image.STRETCH_NINE_PATCH && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_cropIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Slice Horizontal" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "L", target: image, propertyName: "sliceLeft", onChange: () => {
                                        image.populateNinePatchSlicesFromImage = false;
                                        this.forceUpdate();
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "R", target: image, propertyName: "sliceRight", onChange: () => {
                                        image.populateNinePatchSlicesFromImage = false;
                                        this.forceUpdate();
                                    } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_cropIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Slice Vertical" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "T", target: image, propertyName: "sliceTop", onChange: () => {
                                        image.populateNinePatchSlicesFromImage = false;
                                        this.forceUpdate();
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "B", target: image, propertyName: "sliceBottom", onChange: () => {
                                        image.populateNinePatchSlicesFromImage = false;
                                        this.forceUpdate();
                                    } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_autoResizeIcon_svg__WEBPACK_IMPORTED_MODULE_14__, label: "Populate Nine Patch Slices From Image" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "SLICE FROM IMAGE", target: image, propertyName: "populateNinePatchSlicesFromImage", onValueChanged: () => {
                                        this.forceUpdate();
                                        image._markAsDirty();
                                    } })] })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { iconLabel: "animationSheet", icon: shared_ui_components_imgs_animationSheetIcon_svg__WEBPACK_IMPORTED_MODULE_16__, label: "ANIMATION SHEET", target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(images, this.props.onPropertyChangedObservable, (target) => target.cellId !== -1), onValueChanged: () => {
                        this.toggleAnimations(!animationSheet);
                        this.forceUpdate();
                    } }), animationSheet && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ge-divider double", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { iconLabel: "Cell Id", icon: shared_ui_components_imgs_cellIDIcon_svg__WEBPACK_IMPORTED_MODULE_17__, lockObject: this.props.lockObject, label: "", isInteger: true, target: proxy, propertyName: "cellId", min: 0, max: maxCells }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { icon: shared_ui_components_imgs_sizeIcon_svg__WEBPACK_IMPORTED_MODULE_18__, lockObject: this.props.lockObject, label: "W", target: proxy, propertyName: "cellWidth", isInteger: true, onChange: () => this.updateCellSize(), min: 1, max: maxCellWidth }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "H", target: proxy, propertyName: "cellHeight", isInteger: true, onChange: () => this.updateCellSize(), min: 1, max: maxCellHeight })] })] }))] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/inputTextPropertyGridComponent.js":
/*!****************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/inputTextPropertyGridComponent.js ***!
  \****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1649078__) => {

"use strict";
__nested_webpack_require_1649078__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1649078__.d(__nested_webpack_exports__, {
/* harmony export */   InputTextPropertyGridComponent: () => (/* binding */ InputTextPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1649078__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1649078__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1649078__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1649078__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1649078__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1649078__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1649078__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1649078__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1649078__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1649078__(/*! shared-ui-components/lines/colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");
/* harmony import */ var shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_21__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/fillColorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fillColorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_widthIcon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/widthIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/widthIcon.svg");
/* harmony import */ var shared_ui_components_imgs_alphaIcon_svg__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/alphaIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/alphaIcon.svg");
/* harmony import */ var shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_23__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/colorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/colorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_textIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/textIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/textIcon.svg");
/* harmony import */ var shared_ui_components_imgs_textInputIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/textInputIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/textInputIcon.svg");
/* harmony import */ var shared_ui_components_imgs_autoStretchWidthIcon_svg__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/autoStretchWidthIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/autoStretchWidthIcon.svg");
/* harmony import */ var shared_ui_components_imgs_marginsIcon_svg__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/marginsIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/marginsIcon.svg");
/* harmony import */ var shared_ui_components_imgs_selectAllIcon_svg__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/selectAllIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/selectAllIcon.svg");
/* harmony import */ var shared_ui_components_imgs_highlightIcon_svg__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/highlightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/highlightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_textPlaceholderIcon_svg__WEBPACK_IMPORTED_MODULE_22__ = __nested_webpack_require_1649078__(/*! shared-ui-components/imgs/textPlaceholderIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/textPlaceholderIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1649078__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1649078__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");
























class InputTextPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const { inputTexts, onPropertyChangedObservable, lockObject } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_8__.makeTargetsProxy)(inputTexts, onPropertyChangedObservable);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: lockObject, controls: inputTexts, onPropertyChangedObservable: onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextLineComponent, { label: "INPUT TEXT", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_textIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Text" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "text" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_textInputIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Prompt Text" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "promptMessage" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_widthIcon_svg__WEBPACK_IMPORTED_MODULE_14__, label: "Max Width" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "maxWidth" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_marginsIcon_svg__WEBPACK_IMPORTED_MODULE_15__, label: "Margins" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "margin" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_16__, label: "Border Thickness" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "thickness", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_autoStretchWidthIcon_svg__WEBPACK_IMPORTED_MODULE_17__, label: "Automatically Stretch Width" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "AUTO STRETCH", target: proxy, propertyName: "autoStretchWidth" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_selectAllIcon_svg__WEBPACK_IMPORTED_MODULE_18__, label: "When Input is Focus, Select All" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "ON FOCUS, SELECT ALL", target: proxy, propertyName: "onFocusSelectAll" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_highlightIcon_svg__WEBPACK_IMPORTED_MODULE_19__, label: "Highlight Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_9__.ColorLine, { lockObject: lockObject, label: "", target: proxy, propertyName: "textHighlightColor" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_alphaIcon_svg__WEBPACK_IMPORTED_MODULE_20__, label: "Highlight Opacity" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: lockObject, label: "", minimum: 0, maximum: 1, step: 0.01, target: proxy, propertyName: "highligherOpacity" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_21__, label: "Background Color when Focused" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_9__.ColorLine, { lockObject: lockObject, label: "", target: proxy, propertyName: "focusedBackground" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_textPlaceholderIcon_svg__WEBPACK_IMPORTED_MODULE_22__, label: "Placeholder Text" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "placeholderText" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_10__.IconComponent, { icon: shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_23__, label: "Placeholder Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_9__.ColorLine, { lockObject: lockObject, label: "", target: proxy, propertyName: "placeholderColor" })] })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/linePropertyGridComponent.js":
/*!***********************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/linePropertyGridComponent.js ***!
  \***********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1664043__) => {

"use strict";
__nested_webpack_require_1664043__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1664043__.d(__nested_webpack_exports__, {
/* harmony export */   LinePropertyGridComponent: () => (/* binding */ LinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1664043__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1664043__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1664043__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1664043__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1664043__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1664043__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1664043__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1664043__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_linePoint1Icon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1664043__(/*! shared-ui-components/imgs/linePoint1Icon.svg */ "../../../dev/sharedUiComponents/dist/imgs/linePoint1Icon.svg");
/* harmony import */ var shared_ui_components_imgs_linePoint2Icon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1664043__(/*! shared-ui-components/imgs/linePoint2Icon.svg */ "../../../dev/sharedUiComponents/dist/imgs/linePoint2Icon.svg");
/* harmony import */ var shared_ui_components_imgs_lineDashIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1664043__(/*! shared-ui-components/imgs/lineDashIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/lineDashIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1664043__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1664043__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");













class LinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onDashChange(value) {
        const split = value.split(",");
        for (const line of this.props.lines) {
            line.dash = [];
            split.forEach((v) => {
                const int = parseInt(v);
                if (isNaN(int)) {
                    return;
                }
                line.dash.push(int);
            });
        }
        this.forceUpdate();
    }
    render() {
        const { lines, onPropertyChangedObservable, lockObject } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(lines, onPropertyChangedObservable);
        let dashes = lines[0].dash;
        for (const line of lines) {
            if (dashes.length === 0)
                break;
            if (line.dash.length !== dashes.length) {
                dashes = [];
            }
            dashes.forEach((dash, index) => {
                if (line.dash[index] !== dash) {
                    dashes = [];
                }
            });
        }
        const dashString = dashes.join(",");
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "LINE", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_linePoint1Icon_svg__WEBPACK_IMPORTED_MODULE_9__, label: "Position 1" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: lockObject, label: "X", target: proxy, propertyName: "x1" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: lockObject, label: "Y", target: proxy, propertyName: "y1" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_linePoint2Icon_svg__WEBPACK_IMPORTED_MODULE_10__, label: "Position 2" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: lockObject, label: "X", target: proxy, propertyName: "x2" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: lockObject, label: "Y", target: proxy, propertyName: "y2" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_11__, label: "Line Width" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "lineWidth", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), min: 0, arrows: true })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_lineDashIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Dash Pattern" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: lockObject, label: "", target: proxy, value: dashString, onChange: (newValue) => this.onDashChange(newValue) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { hideDimensions: true, lockObject: lockObject, controls: lines, onPropertyChangedObservable: onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/radioButtonPropertyGridComponent.js":
/*!******************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/radioButtonPropertyGridComponent.js ***!
  \******************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1672901__) => {

"use strict";
__nested_webpack_require_1672901__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1672901__.d(__nested_webpack_exports__, {
/* harmony export */   RadioButtonPropertyGridComponent: () => (/* binding */ RadioButtonPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1672901__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1672901__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1672901__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1672901__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1672901__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1672901__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1672901__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1672901__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1672901__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_checkboxIconDark_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1672901__(/*! shared-ui-components/imgs/checkboxIconDark.svg */ "../../../dev/sharedUiComponents/dist/imgs/checkboxIconDark.svg");
/* harmony import */ var shared_ui_components_imgs_scaleIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1672901__(/*! shared-ui-components/imgs/scaleIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/scaleIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1672901__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1672901__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");













class RadioButtonPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const radioButtons = this.props.radioButtons;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: radioButtons, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "RADIO BUTTON", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_10__, label: "Stroke Weight" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(radioButtons, this.props.onPropertyChangedObservable), propertyName: "thickness", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_9__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_scaleIcon_svg__WEBPACK_IMPORTED_MODULE_11__, label: "Check Size Ratio" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(radioButtons, this.props.onPropertyChangedObservable), propertyName: "checkSizeRatio", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_9__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_10__, label: "Name of Group" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "", target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(radioButtons, this.props.onPropertyChangedObservable), propertyName: "group" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_checkboxIconDark_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Is Checked" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "CHECKED", target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(radioButtons, this.props.onPropertyChangedObservable), propertyName: "isChecked" })] })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/rectanglePropertyGridComponent.js":
/*!****************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/rectanglePropertyGridComponent.js ***!
  \****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1681063__) => {

"use strict";
__nested_webpack_require_1681063__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1681063__.d(__nested_webpack_exports__, {
/* harmony export */   RectanglePropertyGridComponent: () => (/* binding */ RectanglePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1681063__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1681063__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1681063__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1681063__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1681063__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1681063__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _containerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1681063__(/*! ./containerPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/containerPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_imgs_conerRadiusIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1681063__(/*! shared-ui-components/imgs/conerRadiusIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/conerRadiusIcon.svg");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1681063__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1681063__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1681063__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");











class RectanglePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const { rectangles, lockObject, onPropertyChangedObservable } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_5__.makeTargetsProxy)(rectangles, onPropertyChangedObservable);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: lockObject, controls: rectangles, onPropertyChangedObservable: onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "RECTANGLE", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_9__, label: "Stroke Weight" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "thickness", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_conerRadiusIcon_svg__WEBPACK_IMPORTED_MODULE_10__, label: "Corner Radius" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: lockObject, label: "", target: proxy, propertyName: "cornerRadius", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider quad", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: lockObject, label: "X", target: proxy, propertyName: "cornerRadiusX", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: lockObject, label: "Y", target: proxy, propertyName: "cornerRadiusY", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: lockObject, label: "Z", target: proxy, propertyName: "cornerRadiusZ", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: lockObject, label: "W", target: proxy, propertyName: "cornerRadiusW", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_containerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__.ContainerPropertyGridComponent, { containers: rectangles, onPropertyChangedObservable: onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/scrollViewerPropertyGridComponent.js":
/*!*******************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/scrollViewerPropertyGridComponent.js ***!
  \*******************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1689271__) => {

"use strict";
__nested_webpack_require_1689271__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1689271__.d(__nested_webpack_exports__, {
/* harmony export */   ScrollViewerPropertyGridComponent: () => (/* binding */ ScrollViewerPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1689271__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1689271__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1689271__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1689271__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1689271__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1689271__(/*! shared-ui-components/lines/colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1689271__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1689271__(/*! shared-ui-components/imgs/colorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/colorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1689271__(/*! shared-ui-components/imgs/fillColorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fillColorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_widthIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1689271__(/*! shared-ui-components/imgs/widthIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/widthIcon.svg");
/* harmony import */ var shared_ui_components_imgs_conerRadiusIcon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1689271__(/*! shared-ui-components/imgs/conerRadiusIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/conerRadiusIcon.svg");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1689271__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_scrollViewerPrecisionIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1689271__(/*! shared-ui-components/imgs/scrollViewerPrecisionIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/scrollViewerPrecisionIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1689271__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1689271__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");









 // TODO: replace


 // TODO: replace


class ScrollViewerPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const { scrollViewers, onPropertyChangedObservable, lockObject } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(scrollViewers, onPropertyChangedObservable);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: lockObject, controls: scrollViewers, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "SCROLLVIEWER", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_scrollViewerPrecisionIcon_svg__WEBPACK_IMPORTED_MODULE_9__, label: "Wheel Precision" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "wheelPrecision", arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_widthIcon_svg__WEBPACK_IMPORTED_MODULE_10__, label: "Bar Size" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "barSize", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "e-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_11__, label: "Bar Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_5__.ColorLine, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "barColor" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Bar Background Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_5__.ColorLine, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "barBackground" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Stroke Weight" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "thickness", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_7__.IconComponent, { icon: shared_ui_components_imgs_conerRadiusIcon_svg__WEBPACK_IMPORTED_MODULE_14__, label: "Corner Radius" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: lockObject, label: "", target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_6__.makeTargetsProxy)(scrollViewers, onPropertyChangedObservable), propertyName: "cornerRadius", unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_8__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0, digits: 2 })] })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/sliderGenericPropertyGridComponent.js":
/*!********************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/sliderGenericPropertyGridComponent.js ***!
  \********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1699135__) => {

"use strict";
__nested_webpack_require_1699135__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1699135__.d(__nested_webpack_exports__, {
/* harmony export */   SliderGenericPropertyGridComponent: () => (/* binding */ SliderGenericPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1699135__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1699135__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1699135__(/*! ./commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _sliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1699135__(/*! ./sliderPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/sliderPropertyGridComponent.js");




class SliderGenericPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const sliders = this.props.sliders;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: sliders, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_sliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_3__.SliderPropertyGridComponent, { sliders: sliders, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/sliderPropertyGridComponent.js":
/*!*************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/sliderPropertyGridComponent.js ***!
  \*************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1701761__) => {

"use strict";
__nested_webpack_require_1701761__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1701761__.d(__nested_webpack_exports__, {
/* harmony export */   SliderPropertyGridComponent: () => (/* binding */ SliderPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1701761__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1701761__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1701761__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1701761__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1701761__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1701761__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1701761__(/*! shared-ui-components/lines/colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1701761__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/colorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/colorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_verticalSliderIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/verticalSliderIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/verticalSliderIcon.svg");
/* harmony import */ var shared_ui_components_imgs_sliderValueIcon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/sliderValueIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/sliderValueIcon.svg");
/* harmony import */ var shared_ui_components_imgs_sliderValueMaximumIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/sliderValueMaximumIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/sliderValueMaximumIcon.svg");
/* harmony import */ var shared_ui_components_imgs_sliderValueMinimumIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/sliderValueMinimumIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/sliderValueMinimumIcon.svg");
/* harmony import */ var shared_ui_components_imgs_widthIcon_svg__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/widthIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/widthIcon.svg");
/* harmony import */ var shared_ui_components_imgs_clampSliderValueIcon_svg__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/clampSliderValueIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/clampSliderValueIcon.svg");
/* harmony import */ var shared_ui_components_imgs_showThumbIcon_svg__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/showThumbIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/showThumbIcon.svg");
/* harmony import */ var shared_ui_components_imgs_barOffsetIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/barOffsetIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/barOffsetIcon.svg");
/* harmony import */ var shared_ui_components_imgs_thumbCircleIcon_svg__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1701761__(/*! shared-ui-components/imgs/thumbCircleIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/thumbCircleIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1701761__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");



















class SliderPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const { sliders, onPropertyChangedObservable } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(sliders, onPropertyChangedObservable);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "SLIDER", value: " ", color: "grey" }), sliders.every((slider) => slider.typeName === "Slider") && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_colorIcon_svg__WEBPACK_IMPORTED_MODULE_9__, label: "Border Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_6__.ColorLine, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "borderColor" })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_verticalSliderIcon_svg__WEBPACK_IMPORTED_MODULE_10__, label: "Vertical" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "VERTICAL", target: proxy, propertyName: "isVertical" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_barOffsetIcon_svg__WEBPACK_IMPORTED_MODULE_11__, label: "Bar Offset" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "barOffset" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_sliderValueMinimumIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Minimum Value" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_2__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "minimum", arrows: true })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_sliderValueMaximumIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Maximum Value" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_2__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "maximum", arrows: true })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_sliderValueIcon_svg__WEBPACK_IMPORTED_MODULE_14__, label: "Initial Value" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_2__.FloatLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "value", arrows: true })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "THUMB", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_showThumbIcon_svg__WEBPACK_IMPORTED_MODULE_15__, label: "Display Thumb" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "DISPLAY THUMB", target: proxy, propertyName: "displayThumb", onValueChanged: () => this.forceUpdate() })] }), proxy.displayThumb && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_thumbCircleIcon_svg__WEBPACK_IMPORTED_MODULE_16__, label: "Thumb Circular" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "CIRCULAR", target: proxy, propertyName: "isThumbCircle" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_clampSliderValueIcon_svg__WEBPACK_IMPORTED_MODULE_17__, label: "Thumb Clamped to Edges" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "CLAMPED", target: proxy, propertyName: "isThumbClamped" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_8__.IconComponent, { icon: shared_ui_components_imgs_widthIcon_svg__WEBPACK_IMPORTED_MODULE_18__, label: "Width" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "", target: proxy, propertyName: "thumbWidth" })] })] }))] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/stackPanelPropertyGridComponent.js":
/*!*****************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/stackPanelPropertyGridComponent.js ***!
  \*****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1714327__) => {

"use strict";
__nested_webpack_require_1714327__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1714327__.d(__nested_webpack_exports__, {
/* harmony export */   StackPanelPropertyGridComponent: () => (/* binding */ StackPanelPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1714327__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1714327__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1714327__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var gui_2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1714327__(/*! gui/2D/valueAndUnit */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1714327__.n(gui_2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1714327__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1714327__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1714327__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1714327__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _containerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1714327__(/*! ./containerPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/containerPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_imgs_alignVerticalIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1714327__(/*! shared-ui-components/imgs/alignVerticalIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/alignVerticalIcon.svg");
/* harmony import */ var shared_ui_components_imgs_stackPanelSpacingIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1714327__(/*! shared-ui-components/imgs/stackPanelSpacingIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/stackPanelSpacingIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1714327__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1714327__(/*! ../../../../diagram/coordinateHelper */ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1714327__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");















class StackPanelPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const { stackPanels, lockObject, onPropertyChangedObservable } = this.props;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(stackPanels, onPropertyChangedObservable);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: lockObject, controls: stackPanels, onPropertyChangedObservable: onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "STACKPANEL", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_alignVerticalIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Determines if children are stacked horizontally or vertically" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { label: proxy.isVertical ? "ALIGNMENT: VERTICAL" : "ALIGNMENT: HORIZONTAL", target: proxy, propertyName: "isVertical", onValueChanged: () => {
                                for (const panel of stackPanels) {
                                    for (const child of panel.children) {
                                        if (proxy.isVertical) {
                                            child.horizontalAlignment = gui_2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_3__.StackPanel.HORIZONTAL_ALIGNMENT_CENTER;
                                            child._left.value = 0;
                                            if (child._height.unit === gui_2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PERCENTAGE) {
                                                _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_10__.CoordinateHelper.ConvertToPixels(child, ["height"]);
                                            }
                                        }
                                        else {
                                            child.verticalAlignment = gui_2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_3__.StackPanel.VERTICAL_ALIGNMENT_CENTER;
                                            child._top.value = 0;
                                            if (child._width.unit === gui_2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PERCENTAGE) {
                                                _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_10__.CoordinateHelper.ConvertToPixels(child, ["width"]);
                                            }
                                        }
                                    }
                                }
                                this.forceUpdate();
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_stackPanelSpacingIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Spacing between children" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: lockObject, label: " ", target: proxy, propertyName: "spacing", onChange: () => stackPanels.forEach((panel) => panel._markAsDirty()), unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__.UnitButton, { unit: "PX", locked: true }), arrows: true, min: 0 })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_containerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__.ContainerPropertyGridComponent, { containers: stackPanels, onPropertyChangedObservable: onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/textBlockPropertyGridComponent.js":
/*!****************************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/textBlockPropertyGridComponent.js ***!
  \****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1723148__) => {

"use strict";
__nested_webpack_require_1723148__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1723148__.d(__nested_webpack_exports__, {
/* harmony export */   TextBlockPropertyGridComponent: () => (/* binding */ TextBlockPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1723148__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1723148__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1723148__(/*! ../gui/commonControlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1723148__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1723148__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1723148__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1723148__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1723148__(/*! shared-ui-components/lines/colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1723148__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1723148__(/*! shared-ui-components/imgs/fillColorIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fillColorIcon.svg");
/* harmony import */ var shared_ui_components_imgs_fontFamilyIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1723148__(/*! shared-ui-components/imgs/fontFamilyIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/fontFamilyIcon.svg");
/* harmony import */ var shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1723148__(/*! shared-ui-components/imgs/strokeWeightIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg");
/* harmony import */ var shared_ui_components_imgs_resizeToFitIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1723148__(/*! shared-ui-components/imgs/resizeToFitIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/resizeToFitIcon.svg");
/* harmony import */ var shared_ui_components_imgs_wordWrapIcon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1723148__(/*! shared-ui-components/imgs/wordWrapIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/wordWrapIcon.svg");
/* harmony import */ var shared_ui_components_imgs_LineSpacingIcon_svg__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1723148__(/*! shared-ui-components/imgs/LineSpacingIcon.svg */ "../../../dev/sharedUiComponents/dist/imgs/LineSpacingIcon.svg");
/* harmony import */ var shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1723148__(/*! shared-ui-components/lines/iconComponent */ "../../../dev/sharedUiComponents/dist/lines/iconComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1723148__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1723148__(/*! shared-ui-components/lines/unitButton */ "../../../dev/sharedUiComponents/dist/lines/unitButton.js");


















class TextBlockPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const { onPropertyChangedObservable } = this.props;
        const textBlocks = this.props.textBlocks;
        const proxy = (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_8__.makeTargetsProxy)(textBlocks, onPropertyChangedObservable);
        const wrappingOptions = [
            { label: "Clip", value: 0 /* TextWrapping.Clip */ },
            { label: "Ellipsis", value: 2 /* TextWrapping.Ellipsis */ },
            { label: "Word wrap", value: 1 /* TextWrapping.WordWrap */ },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: textBlocks, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onFontsParsedObservable: this.props.onFontsParsedObservable, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "TEXTBLOCK", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_fontFamilyIcon_svg__WEBPACK_IMPORTED_MODULE_12__, label: "Text" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: this.props.lockObject, label: " ", target: proxy, propertyName: "text" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_resizeToFitIcon_svg__WEBPACK_IMPORTED_MODULE_13__, label: "Automatically resize the text block to fit the size of the text" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "RESIZE TO FIT", target: proxy, propertyName: "resizeToFit" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_wordWrapIcon_svg__WEBPACK_IMPORTED_MODULE_14__, label: "Text Wrapping" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_4__.OptionsLine, { label: " ", options: wrappingOptions, target: proxy, propertyName: "textWrapping" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_LineSpacingIcon_svg__WEBPACK_IMPORTED_MODULE_15__, label: "Line Spacing" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: this.props.lockObject, label: " ", target: proxy, propertyName: "lineSpacing" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("hr", {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "OUTLINE", value: " ", color: "grey" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider double", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_strokeWeightIcon_svg__WEBPACK_IMPORTED_MODULE_16__, label: "Outline Width" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_10__.FloatLineComponent, { lockObject: this.props.lockObject, label: " ", target: proxy, propertyName: "outlineWidth", arrows: true, min: 0, unit: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_unitButton__WEBPACK_IMPORTED_MODULE_11__.UnitButton, { unit: "PX", locked: true }), step: "0.01" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "ge-divider", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_iconComponent__WEBPACK_IMPORTED_MODULE_9__.IconComponent, { icon: shared_ui_components_imgs_fillColorIcon_svg__WEBPACK_IMPORTED_MODULE_17__, label: "Outline Color" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorLineComponent__WEBPACK_IMPORTED_MODULE_7__.ColorLine, { lockObject: this.props.lockObject, label: " ", target: proxy, propertyName: "outlineColor" })] })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyTabComponent.js":
/*!************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyTabComponent.js ***!
  \************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1733632__) => {

"use strict";
__nested_webpack_require_1733632__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1733632__.d(__nested_webpack_exports__, {
/* harmony export */   PropertyTabComponent: () => (/* binding */ PropertyTabComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1733632__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1733632__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1733632__(/*! core/Misc/stringTools */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1733632__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_stringTools__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1733632__(/*! shared-ui-components/stringTools */ "../../../dev/sharedUiComponents/dist/stringTools.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1733632__(/*! shared-ui-components/tabs/propertyGrids/lockObject */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js");
/* harmony import */ var _propertyGrids_gui_sliderGenericPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/sliderGenericPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/sliderGenericPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_linePropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/linePropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/linePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_radioButtonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/radioButtonPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/radioButtonPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_textBlockPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/textBlockPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/textBlockPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_inputTextPropertyGridComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/inputTextPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/inputTextPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_colorPickerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/colorPickerPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/colorPickerPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_imagePropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/imagePropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/imagePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_imageBasedSliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/imageBasedSliderPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_rectanglePropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/rectanglePropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/rectanglePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_stackPanelPropertyGridComponent__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/stackPanelPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/stackPanelPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_gridPropertyGridComponent__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/gridPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/gridPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_scrollViewerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/scrollViewerPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/scrollViewerPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_ellipsePropertyGridComponent__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/ellipsePropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/ellipsePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_checkboxPropertyGridComponent__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/checkboxPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/checkboxPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_controlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/controlPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/controlPropertyGridComponent.js");
/* harmony import */ var gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_1733632__(/*! gui/2D/advancedDynamicTexture */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__nested_webpack_require_1733632__.n(gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_20__);
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_21__ = __nested_webpack_require_1733632__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _parentingPropertyGridComponent__WEBPACK_IMPORTED_MODULE_22__ = __nested_webpack_require_1733632__(/*! ../parentingPropertyGridComponent */ "../../../tools/guiEditor/dist/components/parentingPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_displayGridPropertyGridComponent__WEBPACK_IMPORTED_MODULE_23__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/displayGridPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/displayGridPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_gui_buttonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_24__ = __nested_webpack_require_1733632__(/*! ./propertyGrids/gui/buttonPropertyGridComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyGrids/gui/buttonPropertyGridComponent.js");
/* harmony import */ var _guiNodeTools__WEBPACK_IMPORTED_MODULE_25__ = __nested_webpack_require_1733632__(/*! ../../guiNodeTools */ "../../../tools/guiEditor/dist/guiNodeTools.js");
/* harmony import */ var shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_26__ = __nested_webpack_require_1733632__(/*! shared-ui-components/lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _propertyTab_scss__WEBPACK_IMPORTED_MODULE_27__ = __nested_webpack_require_1733632__(/*! ./propertyTab.scss */ "../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss");
/* harmony import */ var _imgs_adtIcon_svg__WEBPACK_IMPORTED_MODULE_28__ = __nested_webpack_require_1733632__(/*! ../../imgs/adtIcon.svg */ "../../../tools/guiEditor/dist/imgs/adtIcon.svg");
/* harmony import */ var _controlTypes__WEBPACK_IMPORTED_MODULE_29__ = __nested_webpack_require_1733632__(/*! ../../controlTypes */ "../../../tools/guiEditor/dist/controlTypes.js");































class PropertyTabComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.saveLocally = () => {
            try {
                const json = JSON.stringify(this.props.globalState.guiTexture.serializeContent());
                shared_ui_components_stringTools__WEBPACK_IMPORTED_MODULE_3__.StringTools.DownloadAsFile(this.props.globalState.hostDocument, json, "guiTexture.json");
            }
            catch (error) {
                this.props.globalState.hostWindow.alert("Unable to save your GUI");
                core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Tools.Error("Unable to save your GUI");
            }
        };
        /**
         * Save the selected control as Json with file name of guiControl
         */
        this.saveSelectedControlLocally = () => {
            try {
                const serializationObject = {
                    controls: [],
                };
                for (const control of this.props.globalState.selectedControls) {
                    const controlSerializationObject = {};
                    control.serialize(controlSerializationObject);
                    serializationObject.controls.push(controlSerializationObject);
                }
                const json = JSON.stringify(serializationObject);
                shared_ui_components_stringTools__WEBPACK_IMPORTED_MODULE_3__.StringTools.DownloadAsFile(this.props.globalState.hostDocument, json, "guiControl.json");
            }
            catch (error) {
                this.props.globalState.hostWindow.alert("Unable to save your selected Control");
                core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Tools.Error("Unable to save your selected Control");
            }
        };
        this.saveToSnippetServerHelper = (content, adt) => {
            return new Promise((resolve, reject) => {
                const xmlHttp = new XMLHttpRequest();
                xmlHttp.onreadystatechange = () => {
                    if (xmlHttp.readyState == 4) {
                        if (xmlHttp.status == 200) {
                            const snippet = JSON.parse(xmlHttp.responseText);
                            const oldId = adt.snippetId;
                            adt.snippetId = snippet.id;
                            if (snippet.version && snippet.version != "0") {
                                adt.snippetId += "#" + snippet.version;
                            }
                            const windowAsAny = window;
                            if (windowAsAny.Playground && oldId) {
                                windowAsAny.Playground.onRequestCodeChangeObservable.notifyObservers({
                                    regex: new RegExp(oldId, "g"),
                                    replace: adt.snippetId,
                                });
                            }
                            resolve(adt.snippetId);
                        }
                        else {
                            reject("Unable to save your GUI");
                        }
                    }
                };
                // Check if we need to encode it to store the unicode characters (same approach as PR #12391)
                const encoder = new TextEncoder();
                const buffer = encoder.encode(content);
                let testData = "";
                for (let i = 0; i < buffer.length; i++) {
                    testData += String.fromCharCode(buffer[i]);
                }
                const isUnicode = testData !== content;
                const objToSend = {
                    gui: content,
                    encodedGui: isUnicode ? (0,core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.EncodeArrayBufferToBase64)(buffer) : undefined,
                };
                xmlHttp.open("POST", gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_20__.AdvancedDynamicTexture.SnippetUrl + (adt.snippetId ? "/" + adt.snippetId : ""), true);
                xmlHttp.setRequestHeader("Content-Type", "application/json");
                const dataToSend = {
                    payload: JSON.stringify(objToSend),
                    name: "",
                    description: "",
                    tags: "",
                };
                xmlHttp.send(JSON.stringify(dataToSend));
            });
        };
        this.saveToSnippetServer = async () => {
            const adt = this.props.globalState.guiTexture;
            const content = JSON.stringify(adt.serializeContent());
            const savePromise = this.props.globalState.customSave?.action || this.saveToSnippetServerHelper;
            savePromise(content, adt)
                .then((snippetId) => {
                adt.snippetId = snippetId;
                const alertMessage = `GUI saved with ID:  ${adt.snippetId}`;
                if (this.props.globalState.hostWindow.navigator.clipboard) {
                    this.props.globalState.hostWindow.navigator.clipboard
                        .writeText(adt.snippetId)
                        .then(() => {
                        this.props.globalState.hostWindow.alert(`${alertMessage}. The ID was copied to your clipboard.`);
                    })
                        .catch(() => {
                        this.props.globalState.hostWindow.alert(alertMessage);
                    });
                }
                else {
                    this.props.globalState.hostWindow.alert(alertMessage);
                }
                this.props.globalState.onBuiltObservable.notifyObservers();
            })
                .catch((err) => {
                this.props.globalState.hostWindow.alert(err);
            });
            this.forceUpdate();
        };
        this._lockObject = new shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_4__.LockObject();
        this.props.globalState.lockObject = this._lockObject;
        this.props.globalState.onSaveObservable.add(() => {
            this.save(this.saveLocally);
        });
        this.props.globalState.onSaveSelectedControl.add(() => {
            this.save(this.saveSelectedControlLocally);
        });
        this.props.globalState.onSnippetSaveObservable.add(() => {
            this.save(this.saveToSnippetServer);
        });
        this.props.globalState.onSnippetLoadObservable.add(() => {
            this.loadFromSnippet();
        });
        this.props.globalState.onPropertyGridUpdateRequiredObservable.add(() => {
            this.forceUpdate();
        });
        this.props.globalState.onLoadObservable.add((file) => this.load(file));
        this.props.globalState.onControlLoadObservable.add((file) => this.loadControl(file));
    }
    componentDidMount() {
        this.props.globalState.onSelectionChangedObservable.add(() => {
            this.forceUpdate();
        });
        this.props.globalState.onResizeObservable.add(() => {
            this.forceUpdate();
        });
        this._onBuiltObserver = this.props.globalState.onBuiltObservable.add(() => {
            this.forceUpdate();
        });
        this.props.globalState.onPropertyChangedObservable.add(() => this.forceUpdate());
    }
    componentWillUnmount() {
        window.clearInterval(this._timerIntervalId);
        this.props.globalState.onBuiltObservable.remove(this._onBuiltObserver);
    }
    load(file) {
        core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Tools.ReadFile(file, (data) => {
            const decoder = new TextDecoder("utf-8");
            this.props.globalState.workbench.loadFromJson(JSON.parse(decoder.decode(data)));
            this.props.globalState.setSelection([]);
        }, undefined, true);
    }
    /**
     * Read loaded file
     * @param file
     */
    loadControl(file) {
        core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Tools.ReadFile(file, (data) => {
            const decoder = new TextDecoder("utf-8");
            this.props.globalState.workbench.loadControlFromJson(JSON.parse(decoder.decode(data)));
        }, undefined, true);
    }
    save(saveCallback) {
        this.props.globalState.workbench.removeEditorTransformation();
        const allControls = this.props.globalState.guiTexture.rootContainer.getDescendants();
        for (const control of allControls) {
            this.props.globalState.workbench.removeEditorBehavior(control);
        }
        const size = this.props.globalState.workbench.guiSize;
        this.props.globalState.guiTexture.scaleTo(size.width, size.height);
        saveCallback();
        for (const control of allControls) {
            this.props.globalState.workbench.addEditorBehavior(control);
        }
    }
    loadFromSnippet() {
        const snippedId = this.props.globalState.hostWindow.prompt("Please enter the snippet ID to use");
        if (!snippedId) {
            return;
        }
        this.props.globalState.workbench.loadFromSnippet(snippedId);
    }
    renderNode(nodes) {
        const node = nodes[0];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "header", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { id: "logo", src: this.renderControlIcon(nodes) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "title", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_21__.TextInputLineComponent, { noUnderline: true, lockObject: this._lockObject, target: (0,shared_ui_components_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_26__.makeTargetsProxy)(nodes, this.props.globalState.onPropertyChangedObservable), propertyName: "name", onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable }) })] }), this.renderProperties(nodes), node?.parent?.typeName === "Grid" && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_parentingPropertyGridComponent__WEBPACK_IMPORTED_MODULE_22__.ParentingPropertyGridComponent, { control: node, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, lockObject: this._lockObject }))] }));
    }
    /**
     * returns the class name of a list of controls if they share a class, or an empty string if not
     * @param nodes the list of controls to check
     * @returns the class name of a list of controls if they share a class, or an empty string if not
     */
    getControlsCommonClassName(nodes) {
        if (nodes.length === 0)
            return "";
        const firstNode = nodes[0];
        const firstClass = firstNode.getClassName();
        for (const node of nodes) {
            if (node.getClassName() !== firstClass) {
                return "";
            }
        }
        return firstClass;
    }
    renderProperties(nodes) {
        if (nodes.length === 0)
            return;
        const className = this.getControlsCommonClassName(nodes);
        switch (className) {
            case "TextBlock": {
                const textBlocks = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_textBlockPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__.TextBlockPropertyGridComponent, { textBlocks: textBlocks, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "InputText": {
                const inputTexts = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_inputTextPropertyGridComponent__WEBPACK_IMPORTED_MODULE_9__.InputTextPropertyGridComponent, { inputTexts: inputTexts, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "ColorPicker": {
                const colorPickers = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_colorPickerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__.ColorPickerPropertyGridComponent, { colorPickers: colorPickers, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "Image": {
                const images = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_imagePropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__.ImagePropertyGridComponent, { images: images, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "Slider": {
                const sliders = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_sliderGenericPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__.SliderGenericPropertyGridComponent, { sliders: sliders, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "ImageBasedSlider": {
                const imageBasedSliders = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_imageBasedSliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_12__.ImageBasedSliderPropertyGridComponent, { imageBasedSliders: imageBasedSliders, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "Rectangle": {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_rectanglePropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__.RectanglePropertyGridComponent, { rectangles: nodes, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable }));
            }
            case "StackPanel": {
                const stackPanels = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_stackPanelPropertyGridComponent__WEBPACK_IMPORTED_MODULE_14__.StackPanelPropertyGridComponent, { stackPanels: stackPanels, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "Grid": {
                const grids = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_gridPropertyGridComponent__WEBPACK_IMPORTED_MODULE_15__.GridPropertyGridComponent, { grids: grids, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "ScrollViewer": {
                const scrollViewers = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_scrollViewerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_16__.ScrollViewerPropertyGridComponent, { scrollViewers: scrollViewers, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "Ellipse": {
                const ellipses = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_ellipsePropertyGridComponent__WEBPACK_IMPORTED_MODULE_17__.EllipsePropertyGridComponent, { ellipses: ellipses, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "Checkbox": {
                const checkboxes = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_checkboxPropertyGridComponent__WEBPACK_IMPORTED_MODULE_18__.CheckboxPropertyGridComponent, { checkboxes: checkboxes, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "RadioButton": {
                const radioButtons = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_radioButtonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__.RadioButtonPropertyGridComponent, { radioButtons: radioButtons, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "Line": {
                const lines = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_linePropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__.LinePropertyGridComponent, { lines: lines, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "DisplayGrid": {
                const displayGrids = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_displayGridPropertyGridComponent__WEBPACK_IMPORTED_MODULE_23__.DisplayGridPropertyGridComponent, { displayGrids: displayGrids, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
            }
            case "Button": {
                const buttons = nodes;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_buttonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_24__.ButtonPropertyGridComponent, { rectangles: buttons, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onAddComponent: (value) => {
                        for (const button of buttons) {
                            const guiElement = _guiNodeTools__WEBPACK_IMPORTED_MODULE_25__.GUINodeTools.CreateControlFromString(value);
                            this.props.globalState.workbench.addEditorBehavior(guiElement);
                            button.addControl(guiElement);
                            this.props.globalState.select(guiElement);
                        }
                    }, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }, "buttonMenu"));
            }
        }
        const controls = nodes;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_gui_controlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_19__.ControlPropertyGridComponent, { controls: controls, lockObject: this._lockObject, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable, onFontsParsedObservable: this.props.globalState.onFontsParsedObservable, globalState: this.props.globalState }));
    }
    renderControlIcon(nodes) {
        const node = nodes[0];
        const className = node.getClassName();
        for (const node of nodes) {
            if (node.getClassName() !== className) {
                return _imgs_adtIcon_svg__WEBPACK_IMPORTED_MODULE_28__;
            }
        }
        const type = _controlTypes__WEBPACK_IMPORTED_MODULE_29__.ControlTypes.find((control) => control.className === className);
        return type ? type.icon : _imgs_adtIcon_svg__WEBPACK_IMPORTED_MODULE_28__;
    }
    render() {
        if (this.props.globalState.guiTexture == undefined)
            return null;
        const nodesToRender = this.props.globalState.selectedControls.length > 0 ? this.props.globalState.selectedControls : [this.props.globalState.workbench.trueRootContainer];
        return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "ge-propertyTab", children: this.renderNode(nodesToRender) });
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/sceneExplorer/entities/gui/controlTreeItemComponent.js":
/*!*******************************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/sceneExplorer/entities/gui/controlTreeItemComponent.js ***!
  \*******************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1763674__) => {

"use strict";
__nested_webpack_require_1763674__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1763674__.d(__nested_webpack_exports__, {
/* harmony export */   ControlTreeItemComponent: () => (/* binding */ ControlTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1763674__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1763674__(/*! ../../treeItemLabelComponent */ "../../../tools/guiEditor/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1763674__(/*! ../../extensionsComponent */ "../../../tools/guiEditor/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1763674__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1763674__(/*! ../../../../globalState */ "../../../tools/guiEditor/dist/globalState.js");
/* harmony import */ var gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1763674__(/*! gui/2D/controls/container */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_1763674__.n(gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _controlTypes__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1763674__(/*! ../../../../controlTypes */ "../../../tools/guiEditor/dist/controlTypes.js");
/* harmony import */ var _imgs_visibilityNotActiveIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1763674__(/*! ../../../../imgs/visibilityNotActiveIcon.svg */ "../../../tools/guiEditor/dist/imgs/visibilityNotActiveIcon.svg");
/* harmony import */ var _imgs_visibilityActiveIcon_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1763674__(/*! ../../../../imgs/visibilityActiveIcon.svg */ "../../../tools/guiEditor/dist/imgs/visibilityActiveIcon.svg");
/* harmony import */ var _imgs_makeComponentIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1763674__(/*! ../../../../imgs/makeComponentIcon.svg */ "../../../tools/guiEditor/dist/imgs/makeComponentIcon.svg");
/* harmony import */ var _imgs_makeChildOfContainerIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1763674__(/*! ../../../../imgs/makeChildOfContainerIcon.svg */ "../../../tools/guiEditor/dist/imgs/makeChildOfContainerIcon.svg");











class ControlTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
        const control = this.props.control;
        this.state = { isActive: control.isHighlighted, isVisible: control.isVisible, isRenaming: false };
        this._onIsVisibleChangedObserver = control.onIsVisibleChangedObservable.add((isVisible) => {
            this.setState({ isVisible });
        });
    }
    componentWillUnmount() {
        if (this._onIsVisibleChangedObserver) {
            this.props.control.onIsVisibleChangedObservable.remove(this._onIsVisibleChangedObserver);
        }
    }
    highlight() {
        const control = this.props.control;
        control.isHighlighted = !control.isHighlighted;
        this.setState({ isActive: control.isHighlighted });
    }
    switchVisibility() {
        const newState = !this.state.isVisible;
        this.setState({ isVisible: newState });
        this.props.control.isVisible = newState;
    }
    onRename(name) {
        this.props.control.name = name;
        this.props.globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
    }
    render() {
        const control = this.props.control;
        let bracket = "";
        if (control.parent?.typeName === "Grid") {
            bracket = control.parent.getChildCellInfo(this.props.control);
        }
        const draggingSelf = this.props.globalState.draggedControl === control;
        const controlType = _controlTypes__WEBPACK_IMPORTED_MODULE_6__.ControlTypes.find((type) => type.className === control.getClassName());
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "controlTools", children: [controlType && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "controlType icon", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: controlType.icon, alt: controlType.className }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: control.name, bracket: bracket, onClick: () => this.props.onClick(), onChange: (name) => this.onRename(name), setRenaming: (renaming) => {
                        this.setState({ isRenaming: renaming });
                        this.props.onRenamingStateChanged(renaming);
                    }, renaming: this.state.isRenaming }), !draggingSelf && this.props.isDragOver && this.props.dragOverLocation == _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.CENTER && control instanceof gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_5__.Container && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "makeChild icon", onClick: () => this.highlight(), title: "Make Child", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_makeChildOfContainerIcon_svg__WEBPACK_IMPORTED_MODULE_10__ }) }) })), !this.state.isRenaming && this.props.isHovered && this.props.globalState.draggedControl === null && this.props.dragOverLocation == _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.NONE && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "addComponent icon", onClick: () => this.highlight(), title: "Add component (Not Implemented)", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_makeComponentIcon_svg__WEBPACK_IMPORTED_MODULE_9__ }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "visibility icon", onClick: () => this.switchVisibility(), title: "Set isVisible", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.state.isVisible ? _imgs_visibilityActiveIcon_svg__WEBPACK_IMPORTED_MODULE_8__ : _imgs_visibilityNotActiveIcon_svg__WEBPACK_IMPORTED_MODULE_7__ }) })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: control, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/sceneExplorer/extensionsComponent.js":
/*!*************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/sceneExplorer/extensionsComponent.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1771046__) => {

"use strict";
__nested_webpack_require_1771046__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1771046__.d(__nested_webpack_exports__, {
/* harmony export */   ExtensionsComponent: () => (/* binding */ ExtensionsComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1771046__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1771046__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1771046__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1771046__(/*! react */ "../../../../node_modules/react/index.js");




class ExtensionsComponent extends react__WEBPACK_IMPORTED_MODULE_2__.Component {
    constructor(props) {
        super(props);
        this.state = { popupVisible: false };
        this._extensionRef = react__WEBPACK_IMPORTED_MODULE_2__.createRef();
    }
    showPopup() {
        this.setState({ popupVisible: true });
    }
    componentDidMount() {
        if (!this._popup) {
            return;
        }
        this._popup.focus();
    }
    componentDidUpdate() {
        if (!this._popup) {
            return;
        }
        this._popup.focus();
    }
    render() {
        if (!this.props.extensibilityGroups) {
            return null;
        }
        const options = [];
        for (const group of this.props.extensibilityGroups) {
            if (group.predicate(this.props.target)) {
                options.push(...group.entries);
            }
        }
        if (options.length === 0) {
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { ref: this._extensionRef, className: "extensions", onClick: () => this.showPopup(), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { title: "Additional options", className: "icon", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faEllipsisH }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: (input) => {
                        this._popup = input;
                    }, tabIndex: -1, className: this.state.popupVisible ? "popup show" : "popup", onBlur: () => this.setState({ popupVisible: false }), children: options.map((extensibility) => {
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "popupMenu", onClick: () => extensibility.action(this.props.target), children: extensibility.label }, extensibility.label));
                    }) })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorerComponent.js":
/*!****************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorerComponent.js ***!
  \****************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1774563__) => {

"use strict";
__nested_webpack_require_1774563__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1774563__.d(__nested_webpack_exports__, {
/* harmony export */   SceneExplorerComponent: () => (/* binding */ SceneExplorerComponent),
/* harmony export */   SceneExplorerFilterComponent: () => (/* binding */ SceneExplorerFilterComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1774563__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1774563__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _treeItemComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1774563__(/*! ./treeItemComponent */ "../../../tools/guiEditor/dist/components/sceneExplorer/treeItemComponent.js");
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1774563__(/*! ../../tools */ "../../../tools/guiEditor/dist/tools.js");
/* harmony import */ var _sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1774563__(/*! ./sceneExplorer.scss */ "../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1774563__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_1774563__.n(core_Misc_logger__WEBPACK_IMPORTED_MODULE_5__);






class SceneExplorerFilterComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "filter", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", placeholder: "Filter", onChange: (evt) => this.props.onFilter(evt.target.value) }) }));
    }
}
class SceneExplorerComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { filter: null, selectedEntity: null, scene: this.props.scene ? this.props.scene : null };
        this._onNewSceneObserver = this.props.globalState.onNewSceneObservable.add((scene) => {
            this.setState({
                scene,
            });
        });
        this._onPropertyChangedObservable = this.props.globalState.onPropertyChangedObservable.add((event) => {
            if (event.property === "name" || event.property === "_columnNumber" || event.property === "_rowNumber") {
                this.forceUpdate();
            }
        });
        this._onUpdateRequiredObserver = this.props.globalState.onUpdateRequiredObservable.add(() => {
            this.forceUpdate();
        });
    }
    componentDidMount() {
        this._onSelectionChangeObserver = this.props.globalState.onSelectionChangedObservable.add((entity) => {
            if (this.state.selectedEntity !== entity) {
                this.setState({ selectedEntity: entity });
            }
        });
        this.props.globalState.onSelectionChangedObservable.add(() => {
            this.forceUpdate();
        });
        this._onParrentingChangeObserver = this.props.globalState.onParentingChangeObservable.add(() => {
            this.forceUpdate();
        });
    }
    componentWillUnmount() {
        if (this._onSelectionChangeObserver) {
            this.props.globalState.onSelectionChangedObservable.remove(this._onSelectionChangeObserver);
        }
        if (this._onNewSceneObserver) {
            this.props.globalState.onNewSceneObservable.remove(this._onNewSceneObserver);
        }
        if (this._onParrentingChangeObserver) {
            this.props.globalState.onParentingChangeObservable.remove(this._onParrentingChangeObserver);
        }
        if (this._onPropertyChangedObservable) {
            this.props.globalState.onPropertyChangedObservable.remove(this._onPropertyChangedObservable);
        }
        if (this._onUpdateRequiredObserver) {
            this.props.globalState.onUpdateRequiredObservable.remove(this._onUpdateRequiredObserver);
        }
    }
    filterContent(filter) {
        this.setState({ filter: filter });
    }
    findSiblings(parent, items, target, goNext, data) {
        if (!items) {
            return false;
        }
        const sortedItems = _tools__WEBPACK_IMPORTED_MODULE_3__.Tools.SortAndFilter(parent, items);
        if (!items || sortedItems.length === 0) {
            return false;
        }
        for (const item of sortedItems) {
            if (item === target) {
                // found the current selection!
                data.found = true;
                if (!goNext) {
                    if (data.previousOne) {
                        this.props.globalState.select(data.previousOne);
                    }
                    return true;
                }
            }
            else {
                if (data.found) {
                    this.props.globalState.select(item);
                    return true;
                }
                data.previousOne = item;
            }
            if (item.getChildren && item.reservedDataStore && item.reservedDataStore.isExpanded) {
                if (this.findSiblings(item, item.getChildren(), target, goNext, data)) {
                    return true;
                }
            }
        }
        return false;
    }
    processKeys(keyEvent) {
        // if typing inside a text box, don't process keys
        if (keyEvent.target.localName === "input")
            return;
        const scene = this.state.scene;
        let search = false;
        let goNext = false;
        switch (keyEvent.key) {
            case "ArrowUp":
                search = true;
                break;
            case "ArrowDown":
                goNext = true;
                search = true;
                break;
            case "Enter":
            case "ArrowRight":
                this.props.globalState.selectedControls.forEach((node) => {
                    const reservedDataStore = node.reservedDataStore;
                    if (reservedDataStore && reservedDataStore.setExpandedState) {
                        reservedDataStore.setExpandedState(true);
                    }
                });
                keyEvent.preventDefault();
                this.forceUpdate();
                return;
            case "ArrowLeft":
                this.props.globalState.selectedControls.forEach((node) => {
                    const reservedDataStore = node.reservedDataStore;
                    core_Misc_logger__WEBPACK_IMPORTED_MODULE_5__.Logger.Log(reservedDataStore);
                    if (reservedDataStore && reservedDataStore.setExpandedState) {
                        reservedDataStore.setExpandedState(false);
                    }
                });
                keyEvent.preventDefault();
                this.forceUpdate();
                return;
            case "Delete":
            case "Backspace":
                this.props.globalState.deleteSelectedNodes();
                this.forceUpdate();
                break;
        }
        if (!search) {
            return;
        }
        keyEvent.preventDefault();
        if (scene) {
            const selectedEntity = this.props.globalState.selectedControls[this.props.globalState.selectedControls.length - 1];
            const data = {};
            if (!this.findSiblings(null, scene.rootNodes, selectedEntity, goNext, data)) {
                if (!this.findSiblings(null, scene.materials, selectedEntity, goNext, data)) {
                    this.findSiblings(null, scene.textures, selectedEntity, goNext, data);
                }
            }
        }
    }
    renderContent() {
        const scene = this.state.scene;
        if (!scene) {
            return null;
        }
        const guiElements = [this.props.globalState.guiTexture];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "tree", onDrop: () => {
                this.props.globalState.onDropObservable.notifyObservers();
                this.props.globalState.onParentingChangeObservable.notifyObservers(null);
            }, onDragOver: (event) => {
                event.preventDefault();
            }, onClick: () => {
                if (!this.props.globalState.selectionLock) {
                    this.props.globalState.setSelection([]);
                }
                else {
                    this.props.globalState.selectionLock = false;
                }
            }, onContextMenu: (ev) => ev.preventDefault(), children: guiElements && guiElements.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_2__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntities: this.props.globalState.selectedControls, items: guiElements, label: "GUI", offset: 1, filter: this.state.filter })) }));
    }
    onClose() {
        if (!this.props.onClose) {
            return;
        }
        this.props.onClose();
    }
    onPopup() {
        if (!this.props.onPopup) {
            return;
        }
        this.props.onPopup();
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "ge-sceneExplorer", tabIndex: 0, onKeyDown: (keyEvent) => this.processKeys(keyEvent), children: [this.props.children, this.renderContent()] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/sceneExplorer/treeItemComponent.js":
/*!***********************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/sceneExplorer/treeItemComponent.js ***!
  \***********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1784584__) => {

"use strict";
__nested_webpack_require_1784584__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1784584__.d(__nested_webpack_exports__, {
/* harmony export */   TreeItemComponent: () => (/* binding */ TreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1784584__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1784584__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1784584__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1784584__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemSelectableComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1784584__(/*! ./treeItemSelectableComponent */ "../../../tools/guiEditor/dist/components/sceneExplorer/treeItemSelectableComponent.js");
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1784584__(/*! ../../tools */ "../../../tools/guiEditor/dist/tools.js");
/* harmony import */ var react_contextmenu__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1784584__(/*! react-contextmenu */ "../../../../node_modules/react-contextmenu/es6/index.js");
/* harmony import */ var _imgs_expandedIcon_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1784584__(/*! ../../imgs/expandedIcon.svg */ "../../../tools/guiEditor/dist/imgs/expandedIcon.svg");
/* harmony import */ var _imgs_collapsedIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1784584__(/*! ../../imgs/collapsedIcon.svg */ "../../../tools/guiEditor/dist/imgs/collapsedIcon.svg");









class TreeItemExpandableHeaderComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    expandAll() {
        this.props.onExpandAll(!this.props.isExpanded);
    }
    render() {
        const chevron = this.props.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_expandedIcon_svg__WEBPACK_IMPORTED_MODULE_6__, className: "icon" }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_collapsedIcon_svg__WEBPACK_IMPORTED_MODULE_7__, className: "icon" });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "expandableHeader", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "arrow icon", onClick: () => this.props.onClick(), children: chevron }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-value", children: this.props.label })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expandAll icon", onClick: () => this.expandAll(), title: this.props.isExpanded ? "Collapse all" : "Expand all", children: chevron })] }));
    }
}
class TreeItemRootHeaderComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expandableHeader", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "arrow icon", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faBan }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-value", children: this.props.label })] }) }));
    }
}
class TreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isExpanded: true, mustExpand: true };
    }
    switchExpandedState() {
        this.setState({ isExpanded: !this.state.isExpanded, mustExpand: false });
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (!nextState.isExpanded && this.state.isExpanded) {
            return true;
        }
        const items = nextProps.items;
        if (items && items.length) {
            for (const item of items) {
                if (_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.LookForItems(item, nextProps.selectedEntities)) {
                    nextState.isExpanded = true;
                    return true;
                }
            }
        }
        return true;
    }
    expandAll(expand) {
        this.setState({ isExpanded: expand, mustExpand: expand });
    }
    renderContextMenu() {
        if (!this.props.contextMenuItems) {
            TreeItemComponent._ContextMenuUniqueIdGenerator++;
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__.ContextMenu, { id: "contextmenu#" + TreeItemComponent._ContextMenuUniqueIdGenerator++, className: "context-menu", children: this.props.contextMenuItems.map((c) => {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__.MenuItem, { onClick: () => c.action(), children: c.label }, c.label));
            }) }));
    }
    render() {
        let items = this.props.items;
        const marginStyle = {
            paddingLeft: 10 * (this.props.offset + 0.5) + "px",
        };
        if (!items) {
            if (this.props.forceSubitems) {
                items = [];
            }
            else {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "groupContainer", style: marginStyle, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: this.props.label }) }));
            }
        }
        if (!items.length) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "groupContainer", style: marginStyle, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__.ContextMenuTrigger, { id: "contextmenu#" + TreeItemComponent._ContextMenuUniqueIdGenerator, children: [this.renderContextMenu(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TreeItemRootHeaderComponent, { label: this.props.label })] }) }));
        }
        if (!this.state.isExpanded) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "groupContainer", style: marginStyle, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__.ContextMenuTrigger, { id: "contextmenu#" + TreeItemComponent._ContextMenuUniqueIdGenerator, children: [this.renderContextMenu(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TreeItemExpandableHeaderComponent, { isExpanded: false, label: this.props.label, onClick: () => this.switchExpandedState(), onExpandAll: (expand) => this.expandAll(expand) })] }) }));
        }
        const sortedItems = _tools__WEBPACK_IMPORTED_MODULE_4__.Tools.SortAndFilter(null, items)[0].getChildren();
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: sortedItems.map((item) => {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemSelectableComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemSelectableComponent, { extensibilityGroups: this.props.extensibilityGroups, offset: this.props.offset + 1, selectedEntities: this.props.selectedEntities, entity: item, globalState: this.props.globalState, filter: this.props.filter }, item.uniqueId !== undefined && item.uniqueId !== null ? item.uniqueId : item.name));
            }) }));
    }
}
TreeItemComponent._ContextMenuUniqueIdGenerator = 0;


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/sceneExplorer/treeItemLabelComponent.js":
/*!****************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/sceneExplorer/treeItemLabelComponent.js ***!
  \****************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1793232__) => {

"use strict";
__nested_webpack_require_1793232__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1793232__.d(__nested_webpack_exports__, {
/* harmony export */   TreeItemLabelComponent: () => (/* binding */ TreeItemLabelComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1793232__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1793232__(/*! react */ "../../../../node_modules/react/index.js");


class TreeItemLabelComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = {
            value: "",
        };
    }
    onClick() {
        if (!this.props.onClick || this.props.renaming) {
            return;
        }
        this.props.onClick();
    }
    onBlur() {
        this.props.setRenaming(false);
    }
    render() {
        // if editing, overwrite string with local value
        const label = this.props.renaming ? this.state.value : this.props.label || "No Name";
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "title", onClick: () => this.onClick(), children: this.props.renaming ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", onBlur: () => this.onBlur(), autoFocus: true, value: label, onChange: (ev) => {
                    this.props.onChange(ev.target.value);
                    this.setState({ value: ev.target.value });
                }, onKeyDown: (ev) => {
                    if (ev.key === "Enter")
                        this.onBlur();
                }, className: "titleText" })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "titleText", onDoubleClick: () => {
                    this.props.setRenaming(true);
                    this.setState({ value: label });
                }, children: label })) }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/sceneExplorer/treeItemSelectableComponent.js":
/*!*********************************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/sceneExplorer/treeItemSelectableComponent.js ***!
  \*********************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1795711__) => {

"use strict";
__nested_webpack_require_1795711__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1795711__.d(__nested_webpack_exports__, {
/* harmony export */   TreeItemSelectableComponent: () => (/* binding */ TreeItemSelectableComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1795711__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1795711__(/*! ../../tools */ "../../../tools/guiEditor/dist/tools.js");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1795711__(/*! react-dom */ "../../../../node_modules/react-dom/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1795711__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1795711__(/*! ../../globalState */ "../../../tools/guiEditor/dist/globalState.js");
/* harmony import */ var _entities_gui_controlTreeItemComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1795711__(/*! ./entities/gui/controlTreeItemComponent */ "../../../tools/guiEditor/dist/components/sceneExplorer/entities/gui/controlTreeItemComponent.js");
/* harmony import */ var gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1795711__(/*! gui/2D/controls/container */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_1795711__.n(gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _imgs_expandedIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1795711__(/*! ../../imgs/expandedIcon.svg */ "../../../tools/guiEditor/dist/imgs/expandedIcon.svg");
/* harmony import */ var _imgs_collapsedIcon_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1795711__(/*! ../../imgs/collapsedIcon.svg */ "../../../tools/guiEditor/dist/imgs/collapsedIcon.svg");









// eslint-disable-next-line @typescript-eslint/naming-convention
const CONTROL_HEIGHT = 32;
class TreeItemSelectableComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
        /** flag flipped onDragEnter if dragOver is already true
         * prevents dragLeave from immediately setting dragOver to false
         * required to make dragging work as expected
         * see: see: https://github.com/transformation-dev/matrx/tree/master/packages/dragster
         */
        this._secondDragEnter = false;
        this.state = {
            expand: true,
            dragOver: false,
            dragOverLocation: _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.NONE,
            isHovered: false,
            isSelected: this.props.selectedEntities.includes(this.props.entity),
            blockDrag: false,
        };
        this._onSelectionChangedObservable = props.globalState.onSelectionChangedObservable.add(() => {
            this.setState({ isSelected: this.props.globalState.selectedControls.includes(this.props.entity) });
        });
        this._onDraggingEndObservable = props.globalState.onDraggingEndObservable.add(() => {
            this.setState({ dragOverLocation: _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.NONE });
        });
        this._onDraggingStartObservable = props.globalState.onDraggingStartObservable.add(() => {
            this.forceUpdate();
        });
    }
    switchExpandedState() {
        this.props.entity.reservedDataStore.setExpandedState(!this.props.entity.reservedDataStore.isExpanded);
        this.setState({ expand: !this.state.expand });
    }
    shouldComponentUpdate(nextProps, nextState) {
        //if the next entity is going to be selected then we want to highlight it so update
        if (nextProps.selectedEntities.includes(nextProps.entity)) {
            nextState.isSelected = true;
            return true;
        }
        else {
            nextState.isSelected = false;
        }
        if (_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.LookForItems(nextProps.entity, nextProps.selectedEntities)) {
            return true;
        }
        return true;
    }
    scrollIntoView() {
        const element = react_dom__WEBPACK_IMPORTED_MODULE_2__.findDOMNode(this);
        if (element) {
            element.scrollIntoView(false);
        }
    }
    componentWillUnmount() {
        this.props.globalState.onSelectionChangedObservable.remove(this._onSelectionChangedObservable);
        this.props.globalState.onDraggingEndObservable.remove(this._onDraggingEndObservable);
        this.props.globalState.onDraggingStartObservable.remove(this._onDraggingStartObservable);
    }
    onSelect() {
        const entity = this.props.entity;
        this.props.globalState.select(entity);
        this.props.globalState.selectionLock = true;
    }
    renderChildren(isExpanded, offset = true) {
        const entity = this.props.entity;
        if ((!entity.getChildren && !entity.children) || !isExpanded) {
            return null;
        }
        const children = _tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SortAndFilter(entity, entity.getChildren ? entity.getChildren() : entity.children);
        if (entity.typeName === "StackPanel" || entity.typeName === "VirtualKeyboard") {
            children.reverse();
        }
        return children.map((item, i) => {
            if (item.name == "Art-Board-Background") {
                return null;
            }
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TreeItemSelectableComponent, { globalState: this.props.globalState, mustExpand: this.props.mustExpand, extensibilityGroups: this.props.extensibilityGroups, selectedEntities: this.props.selectedEntities, offset: this.props.offset + (offset ? 2 : 0), entity: item, filter: this.props.filter }, i));
        });
    }
    render() {
        if (this.props.entity === this.props.globalState.workbench.trueRootContainer ||
            this.props.entity === this.props.globalState.workbench.visibleRegionContainer ||
            this.props.entity === this.props.globalState.workbench.panAndZoomContainer) {
            return this.renderChildren(true, false);
        }
        const marginStyle = {
            paddingLeft: 10 * (this.props.offset + 0.5) - 20 + "px",
        };
        const lineMarginStyle = {
            marginLeft: 10 * (this.props.offset + 0.5) - 20 + "px",
        };
        let entity = this.props.entity;
        if (!entity.reservedDataStore) {
            entity.reservedDataStore = {
                isExpanded: true,
                setExpandedState: (expanded) => (entity.reservedDataStore.isExpanded = expanded),
            };
        }
        const isExpanded = entity.reservedDataStore.isExpanded || _tools__WEBPACK_IMPORTED_MODULE_1__.Tools.LookForItems(this.props.entity, this.props.selectedEntities);
        entity.reservedDataStore.isExpanded = isExpanded;
        const chevron = isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_expandedIcon_svg__WEBPACK_IMPORTED_MODULE_7__, className: "icon" }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_collapsedIcon_svg__WEBPACK_IMPORTED_MODULE_8__, className: "icon" });
        let children = entity.getClassName() === "MultiMaterial" ? [] : _tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SortAndFilter(entity, entity.getChildren ? entity.getChildren() : entity.children);
        let hasChildren = children.length > 0;
        if (this.props.filter) {
            const lowerCaseFilter = this.props.filter.toLowerCase();
            if (!entity.name || entity.name.toLowerCase().indexOf(lowerCaseFilter) === -1) {
                if (!hasChildren) {
                    return null;
                }
                if (entity.getDescendants) {
                    if (entity.getDescendants(false, (n) => {
                        return n.name && n.name.toLowerCase().indexOf(lowerCaseFilter) !== -1;
                    }).length === 0) {
                        return null;
                    }
                }
            }
        }
        let className = "itemContainer"; //setting class name plus whatever extras based on states
        className += this.state.isSelected && this.props.globalState.draggedControl === null ? " selected" : "";
        className += this.state.isHovered && this.props.globalState.draggedControl === null ? " hover" : "";
        className += this.state.dragOver && this.state.dragOverLocation == _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.CENTER && entity instanceof gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_6__.Container ? " parent" : "";
        className += this.props.globalState.draggedControl === this.props.entity ? " dragged" : "";
        className += this.state.dragOver && this.state.dragOverLocation == _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.ABOVE && entity.parent ? " seAbove" : "";
        className += this.state.dragOver && this.state.dragOverLocation == _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.BELOW && entity.parent ? " seBelow" : "";
        const styleName = className === "itemContainer seAbove" || className === "itemContainer seBelow" ? lineMarginStyle : marginStyle;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: className, style: styleName, onPointerUp: () => {
                        this.onSelect();
                    }, onPointerEnter: () => this.setState({ isHovered: true }), onPointerLeave: () => this.setState({ isHovered: false }), onDragStart: () => {
                        this.props.globalState.draggedControl = this.props.entity;
                        this.props.globalState.onDraggingStartObservable.notifyObservers();
                    }, onDragEnd: () => {
                        this.props.globalState.onDraggingEndObservable.notifyObservers();
                    }, draggable: entity.parent && !this.state.blockDrag, onDrop: (event) => {
                        this.drop();
                        event.preventDefault();
                    }, onDragEnter: (event) => {
                        event.preventDefault();
                        this.dragOver(event);
                    }, onDragOver: (event) => this.updateDragOverLocation(event), onDragLeave: () => {
                        // don't immediately set dragOver to false
                        if (this._secondDragEnter) {
                            this._secondDragEnter = false;
                        }
                        else {
                            this.setState({ dragOver: false });
                        }
                    }, children: [hasChildren && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "arrow icon", onClick: (event) => {
                                this.switchExpandedState();
                                if (event.shiftKey) {
                                    while (hasChildren) {
                                        this.renderChildren(true);
                                        entity = entity.children[0];
                                        children =
                                            entity.getClassName() === "MultiMaterial"
                                                ? []
                                                : _tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SortAndFilter(entity, entity.getChildren ? entity.getChildren() : entity.children);
                                        hasChildren = children.length > 0;
                                        entity.reservedDataStore.isExpanded = true;
                                    }
                                }
                            }, children: chevron })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_gui_controlTreeItemComponent__WEBPACK_IMPORTED_MODULE_5__.ControlTreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, control: entity, onClick: () => { }, isHovered: this.state.isHovered, isDragOver: this.state.dragOver, dragOverLocation: this.state.dragOverLocation, onRenamingStateChanged: (isRenaming) => {
                                this.setState({ blockDrag: isRenaming });
                            } })] }), this.renderChildren(isExpanded)] }));
    }
    dragOver(event) {
        this.updateDragOverLocation(event);
        // if we've already hovered the element, record a new drag event
        if (this.state.dragOver) {
            this._secondDragEnter = true;
        }
        else {
            this.setState({ dragOver: true });
        }
    }
    updateDragOverLocation(event) {
        //check the positions of the mouse cursor.
        const target = event.target;
        const rect = target.getBoundingClientRect();
        const y = event.clientY - rect.top;
        if (this.props.entity instanceof gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_6__.Container) {
            if (y < CONTROL_HEIGHT / 5) {
                //split in fifths
                this.setState({ dragOverLocation: _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.ABOVE });
            }
            else if (y > (4 * CONTROL_HEIGHT) / 5) {
                this.setState({ dragOverLocation: _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.BELOW });
            }
            else {
                this.setState({ dragOverLocation: _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.CENTER });
            }
        }
        else {
            if (y < CONTROL_HEIGHT / 2) {
                //split in half
                this.setState({ dragOverLocation: _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.ABOVE });
            }
            else {
                this.setState({ dragOverLocation: _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.BELOW });
            }
        }
    }
    drop() {
        this.props.globalState.onDropObservable.notifyObservers();
        const control = this.props.entity;
        if (this.props.globalState.draggedControl != control) {
            this.props.globalState.draggedControlDirection = this.state.dragOverLocation;
            this.props.globalState.onParentingChangeObservable.notifyObservers(this.props.entity);
        }
        this.props.globalState.draggedControl = null;
        this.setState({ dragOverLocation: _globalState__WEBPACK_IMPORTED_MODULE_4__.DragOverLocation.NONE, dragOver: false });
        this._secondDragEnter = false;
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/controlTypes.js":
/*!*****************************************************!*\
  !*** ../../../tools/guiEditor/dist/controlTypes.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1810782__) => {

"use strict";
__nested_webpack_require_1810782__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1810782__.d(__nested_webpack_exports__, {
/* harmony export */   ControlTypes: () => (/* binding */ ControlTypes)
/* harmony export */ });
/* harmony import */ var _imgs_rectangleIcon_svg__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1810782__(/*! ./imgs/rectangleIcon.svg */ "../../../tools/guiEditor/dist/imgs/rectangleIcon.svg");
/* harmony import */ var _imgs_ellipseIcon_svg__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1810782__(/*! ./imgs/ellipseIcon.svg */ "../../../tools/guiEditor/dist/imgs/ellipseIcon.svg");
/* harmony import */ var _imgs_gridIcon_svg__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1810782__(/*! ./imgs/gridIcon.svg */ "../../../tools/guiEditor/dist/imgs/gridIcon.svg");
/* harmony import */ var _imgs_stackPanelIcon_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1810782__(/*! ./imgs/stackPanelIcon.svg */ "../../../tools/guiEditor/dist/imgs/stackPanelIcon.svg");
/* harmony import */ var _imgs_textBoxIcon_svg__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1810782__(/*! ./imgs/textBoxIcon.svg */ "../../../tools/guiEditor/dist/imgs/textBoxIcon.svg");
/* harmony import */ var _imgs_sliderIcon_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1810782__(/*! ./imgs/sliderIcon.svg */ "../../../tools/guiEditor/dist/imgs/sliderIcon.svg");
/* harmony import */ var _imgs_imageSliderIcon_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1810782__(/*! ./imgs/imageSliderIcon.svg */ "../../../tools/guiEditor/dist/imgs/imageSliderIcon.svg");
/* harmony import */ var _imgs_buttonIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1810782__(/*! ./imgs/buttonIcon.svg */ "../../../tools/guiEditor/dist/imgs/buttonIcon.svg");
/* harmony import */ var _imgs_passwordFieldIcon_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1810782__(/*! ./imgs/passwordFieldIcon.svg */ "../../../tools/guiEditor/dist/imgs/passwordFieldIcon.svg");
/* harmony import */ var _imgs_checkboxIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1810782__(/*! ./imgs/checkboxIcon.svg */ "../../../tools/guiEditor/dist/imgs/checkboxIcon.svg");
/* harmony import */ var _imgs_imageIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1810782__(/*! ./imgs/imageIcon.svg */ "../../../tools/guiEditor/dist/imgs/imageIcon.svg");
/* harmony import */ var _imgs_keyboardIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1810782__(/*! ./imgs/keyboardIcon.svg */ "../../../tools/guiEditor/dist/imgs/keyboardIcon.svg");
/* harmony import */ var _imgs_inputFieldIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1810782__(/*! ./imgs/inputFieldIcon.svg */ "../../../tools/guiEditor/dist/imgs/inputFieldIcon.svg");
/* harmony import */ var _imgs_lineIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1810782__(/*! ./imgs/lineIcon.svg */ "../../../tools/guiEditor/dist/imgs/lineIcon.svg");
/* harmony import */ var _imgs_displaygridIcon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1810782__(/*! ./imgs/displaygridIcon.svg */ "../../../tools/guiEditor/dist/imgs/displaygridIcon.svg");
/* harmony import */ var _imgs_colorPickerIcon_svg__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1810782__(/*! ./imgs/colorPickerIcon.svg */ "../../../tools/guiEditor/dist/imgs/colorPickerIcon.svg");
/* harmony import */ var _imgs_scrollbarIcon_svg__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1810782__(/*! ./imgs/scrollbarIcon.svg */ "../../../tools/guiEditor/dist/imgs/scrollbarIcon.svg");
/* harmony import */ var _imgs_radioButtonIcon_svg__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1810782__(/*! ./imgs/radioButtonIcon.svg */ "../../../tools/guiEditor/dist/imgs/radioButtonIcon.svg");


















const ControlTypes = [
    {
        className: "Rectangle",
        icon: _imgs_rectangleIcon_svg__WEBPACK_IMPORTED_MODULE_0__,
    },
    {
        className: "Ellipse",
        icon: _imgs_ellipseIcon_svg__WEBPACK_IMPORTED_MODULE_1__,
    },
    {
        className: "StackPanel",
        icon: _imgs_stackPanelIcon_svg__WEBPACK_IMPORTED_MODULE_3__,
    },
    {
        className: "Grid",
        icon: _imgs_gridIcon_svg__WEBPACK_IMPORTED_MODULE_2__,
    },
    {
        className: "ScrollViewer",
        icon: _imgs_scrollbarIcon_svg__WEBPACK_IMPORTED_MODULE_16__,
    },
    {
        className: "Line",
        icon: _imgs_lineIcon_svg__WEBPACK_IMPORTED_MODULE_13__,
    },
    {
        className: "TextBlock",
        icon: _imgs_textBoxIcon_svg__WEBPACK_IMPORTED_MODULE_4__,
    },
    {
        className: "InputText",
        icon: _imgs_inputFieldIcon_svg__WEBPACK_IMPORTED_MODULE_12__,
    },
    {
        className: "InputPassword",
        icon: _imgs_passwordFieldIcon_svg__WEBPACK_IMPORTED_MODULE_8__,
    },
    {
        className: "Image",
        icon: _imgs_imageIcon_svg__WEBPACK_IMPORTED_MODULE_10__,
    },
    {
        className: "DisplayGrid",
        icon: _imgs_displaygridIcon_svg__WEBPACK_IMPORTED_MODULE_14__,
    },
    {
        className: "Button",
        icon: _imgs_buttonIcon_svg__WEBPACK_IMPORTED_MODULE_7__,
    },
    {
        className: "Checkbox",
        icon: _imgs_checkboxIcon_svg__WEBPACK_IMPORTED_MODULE_9__,
    },
    {
        className: "RadioButton",
        icon: _imgs_radioButtonIcon_svg__WEBPACK_IMPORTED_MODULE_17__,
    },
    {
        className: "Slider",
        icon: _imgs_sliderIcon_svg__WEBPACK_IMPORTED_MODULE_5__,
    },
    {
        className: "ImageBasedSlider",
        icon: _imgs_imageSliderIcon_svg__WEBPACK_IMPORTED_MODULE_6__,
    },
    {
        className: "VirtualKeyboard",
        icon: _imgs_keyboardIcon_svg__WEBPACK_IMPORTED_MODULE_11__,
    },
    {
        className: "ColorPicker",
        icon: _imgs_colorPickerIcon_svg__WEBPACK_IMPORTED_MODULE_15__,
    },
];


/***/ }),

/***/ "../../../tools/guiEditor/dist/diagram/artBoard.js":
/*!*********************************************************!*\
  !*** ../../../tools/guiEditor/dist/diagram/artBoard.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1816796__) => {

"use strict";
__nested_webpack_require_1816796__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1816796__.d(__nested_webpack_exports__, {
/* harmony export */   ArtBoardComponent: () => (/* binding */ ArtBoardComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1816796__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1816796__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _coordinateHelper__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1816796__(/*! ./coordinateHelper */ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js");



class ArtBoardComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = {
            bounds: new _coordinateHelper__WEBPACK_IMPORTED_MODULE_2__.Rect(0, 0, 0, 0),
        };
        this.props.globalState.onArtBoardUpdateRequiredObservable.add(() => this.update());
    }
    update() {
        const visibleRegion = this.props.globalState.workbench.visibleRegionContainer;
        if (!visibleRegion)
            return;
        const localBounds = _coordinateHelper__WEBPACK_IMPORTED_MODULE_2__.CoordinateHelper.ComputeLocalBounds(visibleRegion);
        const topLeftRTT = _coordinateHelper__WEBPACK_IMPORTED_MODULE_2__.CoordinateHelper.NodeToRTTSpace(visibleRegion, localBounds.left, localBounds.top, undefined);
        const topLeftCanvas = _coordinateHelper__WEBPACK_IMPORTED_MODULE_2__.CoordinateHelper.RttToCanvasSpace(topLeftRTT.x, topLeftRTT.y);
        const bottomRightRTT = _coordinateHelper__WEBPACK_IMPORTED_MODULE_2__.CoordinateHelper.NodeToRTTSpace(visibleRegion, localBounds.right, localBounds.bottom, undefined);
        const bottomRightCanvas = _coordinateHelper__WEBPACK_IMPORTED_MODULE_2__.CoordinateHelper.RttToCanvasSpace(bottomRightRTT.x, bottomRightRTT.y);
        this.setState({
            bounds: new _coordinateHelper__WEBPACK_IMPORTED_MODULE_2__.Rect(topLeftCanvas.x, topLeftCanvas.y, bottomRightCanvas.x, bottomRightCanvas.y),
        });
    }
    render() {
        const style = {
            top: `${this.state.bounds.top}px`,
            left: `${this.state.bounds.left}px`,
            width: `${this.state.bounds.width}px`,
            height: `${this.state.bounds.height}px`,
        };
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "artboard-stroke", style: style }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "artboard-background", style: style })] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js":
/*!*****************************************************************!*\
  !*** ../../../tools/guiEditor/dist/diagram/coordinateHelper.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1819979__) => {

"use strict";
__nested_webpack_require_1819979__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1819979__.d(__nested_webpack_exports__, {
/* harmony export */   CoordinateHelper: () => (/* binding */ CoordinateHelper),
/* harmony export */   Rect: () => (/* binding */ Rect)
/* harmony export */ });
/* harmony import */ var gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1819979__(/*! gui/2D/measure */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1819979__.n(gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1819979__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1819979__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);





class Rect {
    constructor(left, top, right, bottom) {
        this.left = left;
        this.top = top;
        this.right = right;
        this.bottom = bottom;
    }
    clone() {
        return new Rect(this.left, this.top, this.right, this.bottom);
    }
    get center() {
        const topLeft = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector2(this.left, this.top);
        return topLeft.addInPlace(new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector2(this.right, this.bottom).subtractInPlace(topLeft).multiplyByFloats(0.5, 0.5));
    }
    get width() {
        return this.right - this.left;
    }
    get height() {
        return this.bottom - this.top;
    }
}
const roundFactor = 100;
const round = (value) => Math.round(value * roundFactor) / roundFactor;
class CoordinateHelper {
    /**
     * Get the scaling of a specific GUI control
     * @param node the node for which we are getting the scaling
     * @param relative should we return only the relative scaling (relative to the parent)
     * @returns an X,Y vector of the scaling
     */
    static GetScale(node, relative) {
        let x = node.scaleX;
        let y = node.scaleY;
        if (relative) {
            return new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector2(x, y);
        }
        let parent = node.parent;
        while (parent) {
            x *= parent.scaleX;
            y *= parent.scaleY;
            parent = parent.parent;
        }
        return new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector2(x, y);
    }
    static GetRotation(node, relative) {
        // Gets rotate of a control account for all of it's parents rotations
        let rotation = node.rotation;
        if (relative) {
            return rotation;
        }
        let parent = node.parent;
        while (parent) {
            rotation += parent.rotation;
            parent = parent.parent;
        }
        return rotation;
    }
    static GetParentSizes(guiControl) {
        const parentMeasure = new gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Measure(0, 0, 0, 0);
        if (guiControl.parent) {
            parentMeasure.copyFrom(guiControl.parent._currentMeasure);
            if (guiControl.parent.typeName === "Grid") {
                const cellInfo = guiControl.parent.getChildCellInfo(guiControl);
                const cell = guiControl.parent.cells[cellInfo];
                if (cell) {
                    parentMeasure.width = cell.widthInPixels;
                    parentMeasure.height = cell.heightInPixels;
                }
            }
        }
        return parentMeasure;
    }
    /**
     * This function calculates a local matrix for a node, including it's full transformation and pivot point
     *
     * @param node the node to calculate the matrix for
     * @param storedValues should the stored (cached) values be used to calculate the matrix
     * @returns a new matrix for the control
     */
    static GetNodeMatrix(node, storedValues) {
        const size = this.GlobalState.guiTexture.getSize();
        // parent should always be defined, but stay safe
        let parentWidth, parentHeight;
        if (node.parent) {
            const parentSizes = CoordinateHelper.GetParentSizes(node);
            parentWidth = parentSizes.width;
            parentHeight = parentSizes.height;
        }
        else {
            parentWidth = size.width;
            parentHeight = size.height;
        }
        let x = 0;
        let y = 0;
        const width = storedValues ? storedValues.width : node.widthInPixels;
        const height = storedValues ? storedValues.height : node.heightInPixels;
        const left = storedValues ? storedValues.left : node.leftInPixels;
        const top = storedValues ? storedValues.top : node.topInPixels;
        switch (node.horizontalAlignment) {
            case gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Control.HORIZONTAL_ALIGNMENT_LEFT:
                x = -(parentWidth - width) / 2;
                break;
            case gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Control.HORIZONTAL_ALIGNMENT_RIGHT:
                x = (parentWidth - width) / 2;
                break;
            case gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Control.HORIZONTAL_ALIGNMENT_CENTER:
                x = 0;
                break;
        }
        switch (node.verticalAlignment) {
            case gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Control.VERTICAL_ALIGNMENT_TOP:
                y = -(parentHeight - height) / 2;
                break;
            case gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Control.VERTICAL_ALIGNMENT_BOTTOM:
                y = (parentHeight - height) / 2;
                break;
            case gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Control.VERTICAL_ALIGNMENT_CENTER:
                y = 0;
                break;
        }
        this._ResetMatrixArray();
        const m2d = this._MatrixCache[0];
        const translateTo = this._MatrixCache[1];
        // as this is used later it needs to persist
        const resultMatrix = gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Matrix2D.Identity();
        // the pivot point around which the object transforms
        let offsetX = width * node.transformCenterX - width / 2;
        let offsetY = height * node.transformCenterY - height / 2;
        // pivot changes this point's position! but only in legacy pivot mode
        if (!node.descendantsOnlyPadding) {
            // TODO - padding needs to also take scaling into account?
            offsetX -= ((node.paddingRightInPixels - node.paddingLeftInPixels) * 1) / 2;
            offsetY -= ((node.paddingBottomInPixels - node.paddingTopInPixels) * 1) / 2;
        }
        // Set the translation
        gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Matrix2D.TranslationToRef(x + left, y + top, translateTo);
        // without parents scaling and rotation, calculate world matrix for each
        const rotation = this.GetRotation(node, true);
        const scaling = this.GetScale(node, true);
        // COmpose doesn't actually translate, but creates a form of pivot in a specific position
        gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Matrix2D.ComposeToRef(-offsetX, -offsetY, rotation, scaling.x, scaling.y, null, m2d);
        // actually compose the matrix
        resultMatrix.multiplyToRef(m2d, resultMatrix);
        resultMatrix.multiplyToRef(translateTo, resultMatrix);
        return resultMatrix;
    }
    /**
     * Using the node's tree, calculate its world matrix and return it
     * @param node the node to calculate the matrix for
     * @param storedValues used stored valued (cached when pointer down is clicked)
     * @param stopAt stop looking when this node is found
     * @returns the world matrix for this node
     */
    static NodeToRTTWorldMatrix(node, storedValues, stopAt) {
        const listOfNodes = [node];
        let parent = node.parent;
        let child = node;
        while (parent && child !== stopAt) {
            if (parent.typeName === "Grid") {
                const cellInfo = parent.getChildCellInfo(child);
                const cell = parent.cells[cellInfo];
                listOfNodes.push(cell);
            }
            listOfNodes.push(parent);
            child = parent;
            parent = parent.parent;
        }
        this._ResetMatrixArray();
        const matrices = listOfNodes.map((node, index) => this.GetNodeMatrix(node, index === 0 ? storedValues : undefined));
        return matrices.reduce((acc, cur) => {
            acc.multiplyToRef(cur, acc);
            return acc;
        }, this._MatrixCache[2]);
    }
    static NodeToRTTSpace(node, x, y, reference = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector2(), storedValues, stopAt) {
        const worldMatrix = this.NodeToRTTWorldMatrix(node, storedValues, stopAt);
        worldMatrix.transformCoordinates(x, y, reference);
        // round
        reference.x = round(reference.x);
        reference.y = round(reference.y);
        return reference;
    }
    static RttToLocalNodeSpace(node, x, y, reference = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector2(), storedValues) {
        const worldMatrix = this.NodeToRTTWorldMatrix(node, storedValues);
        const inv = this._MatrixCache[3];
        worldMatrix.invertToRef(inv);
        inv.transformCoordinates(x, y, reference);
        // round
        reference.x = round(reference.x);
        reference.y = round(reference.y);
        return reference;
    }
    static RttToCanvasSpace(x, y) {
        const engine = this.GlobalState.workbench._scene.getEngine();
        return new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector2(x + engine.getRenderWidth() / 2, y + engine.getRenderHeight() / 2);
    }
    static MousePointerToRTTSpace(_node, x, y) {
        const scene = this.GlobalState.workbench._scene;
        const engine = scene.getEngine();
        return new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector2((x || scene.pointerX) - engine.getRenderWidth() / 2, (y || scene.pointerY) - engine.getRenderHeight() / 2);
    }
    static _ResetMatrixArray() {
        this._MatrixCache.forEach((matrix) => {
            gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Matrix2D.IdentityToRef(matrix);
        });
    }
    static ComputeLocalBounds(node) {
        return new Rect(-node.widthInPixels * 0.5, -node.heightInPixels * 0.5, node.widthInPixels * 0.5, node.heightInPixels * 0.5);
    }
    /**
     * converts a node's dimensions to percentage, properties can be specified as a list, or can convert all
     * @param guiControl
     * @param properties
     * @param onPropertyChangedObservable
     */
    static ConvertToPercentage(guiControl, properties = ["left", "top", "width", "height"], onPropertyChangedObservable) {
        let ratioX = 1;
        let ratioY = 1;
        if (guiControl.parent) {
            if (guiControl.parent.typeName === "Grid") {
                const cellInfo = guiControl.parent.getChildCellInfo(guiControl);
                const cell = guiControl.parent.cells[cellInfo];
                ratioX = cell.widthInPixels;
                ratioY = cell.heightInPixels;
            }
            else if (guiControl.parent.typeName === "Rectangle" || guiControl.parent.typeName === "Button") {
                const thickness = guiControl.parent.thickness * 2;
                ratioX = guiControl.parent._currentMeasure.width - thickness;
                ratioY = guiControl.parent._currentMeasure.height - thickness;
            }
            else {
                ratioX = guiControl.parent._currentMeasure.width;
                ratioY = guiControl.parent._currentMeasure.height;
            }
        }
        for (const property of properties) {
            const initialValue = guiControl[property];
            const ratio = property === "left" || property === "width" || property === "paddingLeft" || property === "paddingRight" ? ratioX : ratioY;
            const newValue = (guiControl[`${property}InPixels`] * 100) / ratio;
            guiControl[property] = `${newValue.toFixed(2)}%`;
            onPropertyChangedObservable?.notifyObservers({
                object: guiControl,
                initialValue,
                value: guiControl[property],
                property,
            });
        }
    }
    static Round(value) {
        return Math.floor(value * 100) / 100;
    }
    static ConvertToPixels(guiControl, properties = ["left", "top", "width", "height"], onPropertyChangedObservable) {
        // make sure we are using the latest measures for the control
        const parentMeasure = CoordinateHelper.GetParentSizes(guiControl);
        guiControl._processMeasures(parentMeasure, guiControl.host.getContext());
        for (const property of properties) {
            const initialValue = guiControl[property];
            guiControl[`_${property}`] = new gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.ValueAndUnit(this.Round(guiControl[`${property}InPixels`]), gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.ValueAndUnit.UNITMODE_PIXEL);
            onPropertyChangedObservable?.notifyObservers({
                object: guiControl,
                initialValue,
                value: guiControl[property],
                property,
            });
        }
    }
}
CoordinateHelper._MatrixCache = [gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Matrix2D.Identity(), gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Matrix2D.Identity(), gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Matrix2D.Identity(), gui_2D_valueAndUnit__WEBPACK_IMPORTED_MODULE_0__.Matrix2D.Identity()];


/***/ }),

/***/ "../../../tools/guiEditor/dist/diagram/gizmoGeneric.js":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/diagram/gizmoGeneric.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1834025__) => {

"use strict";
__nested_webpack_require_1834025__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1834025__.d(__nested_webpack_exports__, {
/* harmony export */   GizmoGeneric: () => (/* binding */ GizmoGeneric)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1834025__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1834025__(/*! gui/2D/math2D */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1834025__.n(gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1834025__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1834025__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1834025__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1834025__(/*! ./coordinateHelper */ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js");
/* harmony import */ var _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1834025__(/*! ./gizmoScalePoint */ "../../../tools/guiEditor/dist/diagram/gizmoScalePoint.js");








const roundFactor = 100;
const round = (value) => Math.round(value * roundFactor) / roundFactor;
const modulo = (dividend, divisor) => ((dividend % divisor) + divisor) % divisor;
// this defines the lines that link the corners, making up the bounding box
const lines = [
    [0, 2],
    [0, 6],
    [2, 8],
    [6, 8],
];
// used to calculate which cursor icon we should display for the scalepoints
const defaultScalePointRotations = [315, 0, 45, 270, 0, 90, 225, 180, 135];
class GizmoGeneric extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
        this._onUp = (evt) => {
            // if left is still pressed, don't release
            if (evt && evt.buttons & 1) {
                return;
            }
            // cleanup on pointer up
            this.setState({ scalePointDragging: -1, isRotating: false });
        };
        this._onMove = () => {
            const scene = this.props.globalState.workbench._scene;
            if (this.state.scalePointDragging !== -1) {
                const node = this.props.control;
                const inRTT = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.MousePointerToRTTSpace(node, scene.pointerX, scene.pointerY);
                const inNodeSpace = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.RttToLocalNodeSpace(node, inRTT.x, inRTT.y, undefined, this._storedValues);
                this._dragLocalBounds(inNodeSpace, this.props.globalState.shiftKeyPressed);
                this._updateNodeFromLocalBounds();
                this.props.globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
            }
            if (this.state.isRotating) {
                const angle = Math.atan2(scene.pointerY - this._rotation.pivot.y, scene.pointerX - this._rotation.pivot.x);
                for (const control of this.props.globalState.selectedControls) {
                    control.rotation += angle - this._rotation.initialAngleToPivot;
                }
                this._rotation.initialAngleToPivot = angle;
                this.props.globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
            }
        };
        this._beginDraggingScalePoint = (scalePointIndex) => {
            this.setState({ scalePointDragging: scalePointIndex });
            const node = this.props.control;
            this._localBounds = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.ComputeLocalBounds(node);
            this._storedValues = new _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.Rect(node.leftInPixels, node.topInPixels, node.leftInPixels + node.widthInPixels, node.topInPixels + node.heightInPixels);
            for (const node of this.props.globalState.selectedControls) {
                node.metadata.localBounds = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.ComputeLocalBounds(node);
                node.metadata.storedValues = new _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.Rect(node.leftInPixels, node.topInPixels, node.leftInPixels + node.widthInPixels, node.topInPixels + node.heightInPixels);
            }
        };
        this._beginRotate = () => {
            const scene = this.props.globalState.workbench._scene;
            const node = this.props.control;
            const nodeSpace = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector2(node.transformCenterX, node.transformCenterY);
            const rtt = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.NodeToRTTSpace(node, nodeSpace.x, nodeSpace.y, undefined);
            const canvas = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.RttToCanvasSpace(rtt.x, rtt.y);
            const pivot = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector2(canvas.x, canvas.y);
            const initialAngleToPivot = Math.atan2(scene.pointerY - pivot.y, scene.pointerX - pivot.x);
            this._rotation = {
                pivot,
                initialAngleToPivot,
            };
            this.setState({ isRotating: true });
        };
        const scalePoints = [];
        for (let vertical = _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Top; vertical <= _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Bottom; vertical++) {
            for (let horizontal = _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Left; horizontal <= _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Right; horizontal++) {
                const isPivot = horizontal === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Center && vertical === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Center;
                scalePoints.push({
                    position: new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector2(),
                    horizontalPosition: horizontal,
                    verticalPosition: vertical,
                    rotation: 0,
                    isPivot,
                    defaultRotation: defaultScalePointRotations[scalePoints.length],
                });
            }
        }
        this._localBounds = new _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.Rect(0, 0, 0, 0);
        this.state = {
            canvasBounds: new _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.Rect(0, 0, 0, 0),
            scalePoints,
            scalePointDragging: -1,
            isRotating: false,
        };
        this._gizmoUpdateObserver = this.props.globalState.onGizmoUpdateRequireObservable.add(() => {
            this.updateGizmo();
        });
        this._pointerUpObserver = this.props.globalState.onPointerUpObservable.add((evt) => this._onUp(evt));
        this._pointerMoveObserver = this.props.globalState.onPointerMoveObservable.add(() => this._onMove());
    }
    componentDidMount() {
        this.updateGizmo();
    }
    componentWillUnmount() {
        this.props.globalState.onGizmoUpdateRequireObservable.remove(this._gizmoUpdateObserver);
        this.props.globalState.onPointerUpObservable.remove(this._pointerUpObserver);
        this.props.globalState.onPointerMoveObservable.remove(this._pointerMoveObserver);
    }
    /**
     * Update the gizmo's positions
     */
    updateGizmo() {
        const node = this.props.control;
        // Calculating the offsets for each scale point.
        const canvasBounds = new _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.Rect(Number.MAX_VALUE, Number.MAX_VALUE, 0, 0);
        const localBounds = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.ComputeLocalBounds(node);
        const totalPadding = {
            left: 0,
            right: 0,
            top: 0,
            bottom: 0,
        };
        let current = node.parent;
        while (current !== null && current !== undefined) {
            totalPadding.left += current.paddingLeftInPixels;
            totalPadding.right += current.paddingRightInPixels;
            totalPadding.top += current.paddingTopInPixels;
            totalPadding.bottom += current.paddingBottomInPixels;
            current = current.parent;
        }
        const horizontalAdjustment = (totalPadding.left - totalPadding.right) * 0.5;
        localBounds.left += horizontalAdjustment;
        localBounds.right += horizontalAdjustment;
        const verticalAdjustment = (totalPadding.top - totalPadding.bottom) * 0.5;
        localBounds.top += verticalAdjustment;
        localBounds.bottom += verticalAdjustment;
        const updatedPoints = this.state.scalePoints.map((scalePoint) => {
            const nodeSpace = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector2();
            switch (scalePoint.horizontalPosition) {
                case _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Left:
                    nodeSpace.x = localBounds.left;
                    break;
                case _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Center:
                    nodeSpace.x = localBounds.center.x;
                    break;
                case _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Right:
                    nodeSpace.x = localBounds.right;
                    break;
            }
            switch (scalePoint.verticalPosition) {
                case _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Top:
                    nodeSpace.y = localBounds.top;
                    break;
                case _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Center:
                    nodeSpace.y = localBounds.center.y;
                    break;
                case _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Bottom:
                    nodeSpace.y = localBounds.bottom;
                    break;
            }
            if (scalePoint.isPivot) {
                // Calculate the pivot point
                const pivotX = node.transformCenterX - 0.5;
                const pivotY = node.transformCenterY - 0.5;
                nodeSpace.x = node.widthInPixels * pivotX;
                nodeSpace.y = node.heightInPixels * pivotY;
            }
            const rtt = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.NodeToRTTSpace(node, nodeSpace.x, nodeSpace.y, undefined);
            const canvas = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.RttToCanvasSpace(rtt.x, rtt.y);
            if (canvas.x < canvasBounds.left) {
                canvasBounds.left = canvas.x;
            }
            if (canvas.x > canvasBounds.right) {
                canvasBounds.right = canvas.x;
            }
            if (canvas.y < canvasBounds.top) {
                canvasBounds.top = canvas.y;
            }
            if (canvas.y > canvasBounds.bottom) {
                canvasBounds.bottom = canvas.y;
            }
            // edges, and rotate based on the rotation of the control
            scalePoint.position.x = canvas.x;
            scalePoint.position.y = canvas.y;
            scalePoint.rotation = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.GetRotation(node) * (180 / Math.PI);
            return scalePoint;
        });
        this.setState({
            canvasBounds,
            scalePoints: [...updatedPoints],
        });
    }
    _rotate(x, y, centerX, centerY, angle) {
        return {
            x: (x - centerX) * Math.cos(angle) - (y - centerY) * Math.sin(angle) + centerX,
            y: (x - centerX) * Math.sin(angle) + (y - centerY) * Math.cos(angle) + centerY,
        };
    }
    _dragLocalBounds(toPosition, preserveAspectRatio = false) {
        const scalePoint = this.state.scalePoints[this.state.scalePointDragging];
        const newBounds = this._localBounds.clone();
        const currentAspectRatio = gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_1__.MathTools.Round(this._localBounds.width / this._localBounds.height);
        if (scalePoint.horizontalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Left) {
            newBounds.left = Math.min(this._localBounds.right - 1, toPosition.x);
        }
        if (scalePoint.verticalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Top) {
            newBounds.top = Math.min(this._localBounds.bottom - 1, toPosition.y);
        }
        if (scalePoint.horizontalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Right) {
            newBounds.right = Math.max(this._localBounds.left + 1, toPosition.x);
        }
        if (scalePoint.verticalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Bottom) {
            newBounds.bottom = Math.max(this._localBounds.top + 1, toPosition.y);
        }
        if (preserveAspectRatio) {
            const deltaWidth = newBounds.width - this._localBounds.width;
            const deltaHeight = newBounds.height - this._localBounds.height;
            const signInverted = scalePoint.horizontalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Center || scalePoint.verticalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Center;
            const comparison = Math.abs(deltaWidth) > Math.abs(deltaHeight);
            if (signInverted ? comparison : !comparison) {
                const aspectRatioDeltaHeight = deltaWidth / currentAspectRatio;
                if (scalePoint.verticalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Top) {
                    newBounds.top = this._localBounds.top - aspectRatioDeltaHeight;
                }
                else if (scalePoint.verticalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Bottom) {
                    newBounds.bottom = this._localBounds.bottom + aspectRatioDeltaHeight;
                }
                else {
                    newBounds.top = this._localBounds.top - aspectRatioDeltaHeight / 2;
                    newBounds.bottom = this._localBounds.bottom + aspectRatioDeltaHeight / 2;
                }
            }
            else {
                const aspectRatioDeltaWidth = deltaHeight * currentAspectRatio;
                if (scalePoint.horizontalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Left) {
                    newBounds.left = this._localBounds.left - aspectRatioDeltaWidth;
                }
                else if (scalePoint.horizontalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Right) {
                    newBounds.right = this._localBounds.right + aspectRatioDeltaWidth;
                }
                else {
                    newBounds.left = this._localBounds.left - aspectRatioDeltaWidth / 2;
                    newBounds.right = this._localBounds.right + aspectRatioDeltaWidth / 2;
                }
            }
        }
        // apply bounds changes to all controls
        const edges = ["left", "top", "right", "bottom"];
        for (const node of this.props.globalState.selectedControls) {
            const initialBounds = node.metadata.localBounds;
            const nb = initialBounds.clone();
            // account for rotation: if other control is rotated 90 degrees
            // relative to primary control, we should modify top instead of left
            const rotationModifier = (modulo(this.props.control.rotation - node.rotation, Math.PI * 2) / Math.PI) * 2;
            edges.forEach((edge, index) => {
                const modifiedIndex = Math.round(index + rotationModifier) % 4;
                const flipSign = index < 2 === modifiedIndex < 2 ? 1 : -1;
                nb[edges[modifiedIndex]] += (newBounds[edge] - this._localBounds[edge]) * flipSign;
            });
            nb.left = Math.min(initialBounds.right - 1, nb.left);
            nb.top = Math.min(initialBounds.bottom - 1, nb.top);
            nb.right = Math.max(initialBounds.left + 1, nb.right);
            nb.bottom = Math.max(initialBounds.top + 1, nb.bottom);
            node.metadata.localBounds = nb;
        }
        this._localBounds = newBounds;
    }
    _updateNodeFromLocalBounds() {
        const scalePoint = this.state.scalePoints[this.state.scalePointDragging];
        const left = scalePoint.horizontalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Left && scalePoint.verticalPosition !== _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Center;
        const top = scalePoint.verticalPosition === _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Top && scalePoint.horizontalPosition !== _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.ScalePointPosition.Center;
        for (const selectedControl of this.props.globalState.selectedControls) {
            const width = selectedControl.metadata.localBounds.right - selectedControl.metadata.localBounds.left;
            const height = selectedControl.metadata.localBounds.bottom - selectedControl.metadata.localBounds.top;
            // calculate the center point
            const localRotation = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.GetRotation(selectedControl, true);
            const localScaling = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.GetScale(selectedControl, true);
            const absoluteCenter = selectedControl.metadata.localBounds.center;
            const center = absoluteCenter.clone();
            // move to pivot
            center.multiplyInPlace(localScaling);
            const cosRotation = Math.cos(localRotation);
            const sinRotation = Math.sin(localRotation);
            const cosRotation180 = Math.cos(localRotation + Math.PI);
            const sinRotation180 = Math.sin(localRotation + Math.PI);
            const widthDelta = (selectedControl.metadata.storedValues.width - width) * 0.5;
            const heightDelta = (selectedControl.metadata.storedValues.height - height) * 0.5;
            // alignment compensation
            switch (selectedControl.horizontalAlignment) {
                case gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_1__.Control.HORIZONTAL_ALIGNMENT_LEFT:
                    center.x += (left ? widthDelta : -absoluteCenter.x) * cosRotation;
                    center.y += (left ? -widthDelta : absoluteCenter.x) * sinRotation;
                    break;
                case gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_1__.Control.HORIZONTAL_ALIGNMENT_RIGHT:
                    center.x += (left ? -widthDelta : absoluteCenter.x) * cosRotation;
                    center.y += (left ? widthDelta : -absoluteCenter.x) * sinRotation;
                    break;
            }
            switch (selectedControl.verticalAlignment) {
                case gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_1__.Control.VERTICAL_ALIGNMENT_TOP:
                    center.y += (top ? -heightDelta : absoluteCenter.y) * cosRotation180;
                    center.x += (top ? -heightDelta : absoluteCenter.y) * sinRotation180;
                    break;
                case gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_1__.Control.VERTICAL_ALIGNMENT_BOTTOM:
                    center.y += (top ? heightDelta : -absoluteCenter.y) * cosRotation180;
                    center.x += (top ? heightDelta : -absoluteCenter.y) * sinRotation180;
                    break;
            }
            // rotate the center around 0,0
            const rotatedCenter = this._rotate(center.x, center.y, 0, 0, localRotation);
            const properties = ["left", "top", "width", "height"];
            for (const property of properties) {
                let newPixels = 0;
                switch (property) {
                    case "left":
                        newPixels = round(selectedControl.metadata.storedValues.left + rotatedCenter.x);
                        break;
                    case "top":
                        newPixels = round(selectedControl.metadata.storedValues.top + rotatedCenter.y);
                        break;
                    case "width":
                        newPixels = round(width);
                        break;
                    case "height":
                        newPixels = round(height);
                        break;
                }
                // compute real change in property
                const initialUnit = selectedControl[`_${property}`].unit;
                selectedControl[`${property}InPixels`] = newPixels;
                if (initialUnit === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_1__.ValueAndUnit.UNITMODE_PERCENTAGE) {
                    _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.ConvertToPercentage(selectedControl, [property]);
                }
            }
            if (selectedControl.typeName === "Image") {
                selectedControl.autoScale = false;
            }
            else if (selectedControl.typeName === "TextBlock") {
                selectedControl.resizeToFit = false;
            }
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "gizmo", children: [lines.map((line, index) => {
                    const start = this.state.scalePoints[line[0]];
                    const end = this.state.scalePoints[line[1]];
                    // the vector between start and end
                    const delta = end.position.subtract(start.position);
                    const angle = Math.atan2(delta.y, delta.x);
                    const length = delta.length();
                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bounding-box-line", style: {
                            left: `${start.position.x + delta.x / 2}px`,
                            top: `${start.position.y + delta.y / 2}px`,
                            width: `${length}px`,
                            transform: `translate(-50%, -50%) rotate(${angle}rad)`,
                        } }, index));
                }), this.state.scalePoints.map((scalePoint, index) => ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gizmoScalePoint__WEBPACK_IMPORTED_MODULE_5__.GizmoScalePoint, { clickable: this.state.scalePointDragging === -1 && !scalePoint.isPivot && !this.state.isRotating, scalePoint: scalePoint, onDrag: () => this._beginDraggingScalePoint(index), onRotate: () => this._beginRotate(), onUp: () => this._onUp(), canRotate: true }, index)))] }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/diagram/gizmoLine.js":
/*!**********************************************************!*\
  !*** ../../../tools/guiEditor/dist/diagram/gizmoLine.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1857555__) => {

"use strict";
__nested_webpack_require_1857555__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1857555__.d(__nested_webpack_exports__, {
/* harmony export */   GizmoLine: () => (/* binding */ GizmoLine)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1857555__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1857555__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1857555__(/*! ./gizmoScalePoint */ "../../../tools/guiEditor/dist/diagram/gizmoScalePoint.js");
/* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1857555__(/*! core/Maths/math */ "core/Misc/observable");
/* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1857555__.n(core_Maths_math__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1857555__(/*! ./coordinateHelper */ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js");
/* harmony import */ var gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1857555__(/*! gui/2D/math2D */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_1857555__.n(gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__);






function getPivotToRef(x1, y1, x2, y2, centerX, centerY, ref) {
    const minX = Math.min(x1, x2);
    const minY = Math.min(y1, y2);
    const maxX = Math.max(x1, x2);
    const maxY = Math.max(y1, y2);
    const width = maxX - minX;
    const height = maxY - minY;
    // Get pivot
    const xm = minX + width * centerX;
    const ym = minY + height * centerY;
    ref.x = xm;
    ref.y = ym;
}
const TmpVectors = [new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(), new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(), new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2()];
/**
 * This class represents the gizmo drawn on a line Control.
 * It is used to scale and rotate the control around a pivot point
 * @param props the properties of the gizmo
 * @returns a gizmo line
 */
function GizmoLine(props) {
    const { control, globalState } = props;
    const isPivotMoving = react__WEBPACK_IMPORTED_MODULE_1__.useRef(false);
    const isDragging = react__WEBPACK_IMPORTED_MODULE_1__.useRef(false);
    const isRotating = react__WEBPACK_IMPORTED_MODULE_1__.useRef(false);
    const movedScalePoint = react__WEBPACK_IMPORTED_MODULE_1__.useRef();
    const lastCursor = react__WEBPACK_IMPORTED_MODULE_1__.useRef(new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2());
    const pivot = react__WEBPACK_IMPORTED_MODULE_1__.useRef(new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2());
    const [scalePoints, setScalePoints] = react__WEBPACK_IMPORTED_MODULE_1__.useState([
        {
            position: new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(),
            horizontalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Left,
            verticalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Top,
            rotation: 0,
            isPivot: false,
            defaultRotation: 0,
            id: 0,
        },
        {
            position: new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(),
            horizontalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Center,
            verticalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Center,
            rotation: 0,
            isPivot: true,
            defaultRotation: 0,
            id: 1,
        },
        {
            position: new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(),
            horizontalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Right,
            verticalPosition: _gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.ScalePointPosition.Bottom,
            rotation: 0,
            isPivot: false,
            defaultRotation: 0,
            id: 2,
        },
    ]);
    react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
        // setup
        const gizmoUpdateObserver = globalState.onGizmoUpdateRequireObservable.add(() => {
            update();
        });
        return () => {
            // cleanup
            globalState.onGizmoUpdateRequireObservable.remove(gizmoUpdateObserver);
        };
    }, []);
    const update = () => {
        const line = control;
        const x1 = line._cachedParentMeasure.left + line._x1.getValue(line._host);
        const y1 = line._cachedParentMeasure.top + line._y1.getValue(line._host);
        const x2 = line._cachedParentMeasure.left + line._effectiveX2;
        const y2 = line._cachedParentMeasure.top + line._effectiveY2;
        const v1 = TmpVectors[0].set(x1, y1);
        const v2 = TmpVectors[1].set(x2, y2);
        const vm = TmpVectors[2];
        getPivotToRef(x1, y1, x2, y2, line.transformCenterX, line.transformCenterY, vm);
        const matrix = line._transformMatrix;
        matrix.transformCoordinates(v1.x, v1.y, v1);
        matrix.transformCoordinates(v2.x, v2.y, v2);
        matrix.transformCoordinates(vm.x, vm.y, vm);
        pivot.current = vm;
        const positions = [v1, vm, v2];
        setScalePoints(scalePoints.map((point, index) => {
            const position = positions[index];
            return {
                ...point,
                position,
                rotation: line.rotation,
            };
        }));
    };
    const _getAddAndRound = (value, host, delta) => {
        return gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(value.getValue(host) + delta);
    };
    const _getDeltasToRef = (currentPointer, ref) => {
        // We have to compute the difference in movement in the local node
        // coordintes, so that it accounts for zoom
        const rttClientCoords = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.MousePointerToRTTSpace(control, currentPointer.x, currentPointer.y);
        const localClientCoords = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.RttToLocalNodeSpace(control, rttClientCoords.x, rttClientCoords.y);
        const rttLastCoordinates = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.MousePointerToRTTSpace(control, lastCursor.current.x, lastCursor.current.y);
        const localLastCoordinates = _coordinateHelper__WEBPACK_IMPORTED_MODULE_4__.CoordinateHelper.RttToLocalNodeSpace(control, rttLastCoordinates.x, rttLastCoordinates.y);
        const delta = TmpVectors[0];
        localClientCoords.subtractToRef(localLastCoordinates, delta);
        const rotatedDelta = TmpVectors[1];
        delta.rotateToRef(control.rotation, rotatedDelta);
        ref.x = rotatedDelta.x;
        ref.y = rotatedDelta.y;
    };
    const _dragPivot = (currentPointer) => {
        const deltas = TmpVectors[0];
        _getDeltasToRef(currentPointer, deltas);
        control.x1 = _getAddAndRound(control._x1, control._host, deltas.x);
        control.y1 = _getAddAndRound(control._y1, control._host, deltas.y);
        control.x2 = _getAddAndRound(control._x2, control._host, deltas.x);
        control.y2 = _getAddAndRound(control._y2, control._host, deltas.y);
        globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
    };
    const _dragEndpoint = (currentPointer) => {
        const deltas = TmpVectors[0];
        _getDeltasToRef(currentPointer, deltas);
        // Move only the scale point that was touched
        const movedPointIndex = movedScalePoint.current;
        if (movedPointIndex === 0) {
            // Moved first point, (x1, y1)
            control.x1 = _getAddAndRound(control._x1, control._host, deltas.x);
            control.y1 = _getAddAndRound(control._y1, control._host, deltas.y);
        }
        else if (movedPointIndex === 2) {
            // Moved second point, (x2, y2)
            control.x2 = _getAddAndRound(control._x2, control._host, deltas.x);
            control.y2 = _getAddAndRound(control._y2, control._host, deltas.y);
        }
        globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
    };
    const _rotateEndpoint = (currentPointer) => {
        const currentToPivot = currentPointer.subtract(pivot.current);
        currentToPivot.normalize();
        const lastToPivot = lastCursor.current.subtract(pivot.current);
        lastToPivot.normalize();
        const dotProd = core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2.Dot(currentToPivot, lastToPivot);
        const angle = Math.acos(dotProd);
        const direction = -Math.sign(currentToPivot.x * lastToPivot.y - currentToPivot.y * lastToPivot.x);
        if (!isNaN(angle)) {
            control.rotation += direction * angle;
            control.rotation = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(control.rotation);
            globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
        }
    };
    const onMove = () => {
        const scene = globalState.workbench._scene;
        const currentPointer = new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(scene.pointerX, scene.pointerY);
        if (isDragging.current && isPivotMoving.current) {
            _dragPivot(currentPointer);
        }
        else if (isDragging.current) {
            _dragEndpoint(currentPointer);
        }
        else if (isRotating.current) {
            _rotateEndpoint(currentPointer);
        }
        lastCursor.current = currentPointer;
    };
    const onUp = () => {
        isDragging.current = false;
        isRotating.current = false;
    };
    react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
        const pointerMoveObserver = props.globalState.onPointerMoveObservable.add(onMove);
        const pointerUpObserver = props.globalState.onPointerUpObservable.add(onUp);
        return () => {
            props.globalState.onPointerMoveObservable.remove(pointerMoveObserver);
            props.globalState.onPointerUpObservable.remove(pointerUpObserver);
        };
    }, []);
    const onDrag = (event, scalePoint) => {
        if (event && scalePoint) {
            const scene = globalState.workbench._scene;
            lastCursor.current = new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(scene.pointerX, scene.pointerY);
            isPivotMoving.current = scalePoint.isPivot;
            // If the control has any rotation, reset the
            // rotation, modifying the so the scale behave as expected
            if (!scalePoint.isPivot && control.rotation) {
                const line = control;
                const x1 = line._x1.getValue(line._host);
                const y1 = line._y1.getValue(line._host);
                const x2 = line._x2.getValue(line._host);
                const y2 = line._y2.getValue(line._host);
                const v1 = TmpVectors[0].set(x1, y1);
                const v2 = TmpVectors[1].set(x2, y2);
                const vm = TmpVectors[2];
                getPivotToRef(x1, y1, x2, y2, line.transformCenterX, line.transformCenterY, vm);
                const finalTransform = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.Identity();
                const currentTransform = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.Identity();
                gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.TranslationToRef(-vm.x, -vm.y, currentTransform);
                finalTransform.multiplyToRef(currentTransform, finalTransform);
                gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.RotationToRef(control.rotation, currentTransform);
                finalTransform.multiplyToRef(currentTransform, finalTransform);
                gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.Matrix2D.TranslationToRef(vm.x, vm.y, currentTransform);
                finalTransform.multiplyToRef(currentTransform, finalTransform);
                finalTransform.transformCoordinates(v1.x, v1.y, v1);
                finalTransform.transformCoordinates(v2.x, v2.y, v2);
                control.rotation = 0;
                control.x1 = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(v1.x);
                control.y1 = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(v1.y);
                control.x2 = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(v2.x);
                control.y2 = gui_2D_math2D__WEBPACK_IMPORTED_MODULE_5__.MathTools.Round(v2.y);
                globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
            }
            isDragging.current = true;
            isRotating.current = false;
            movedScalePoint.current = scalePoint.id;
        }
    };
    const onRotate = (event) => {
        if (event) {
            isRotating.current = true;
            isDragging.current = false;
            const scene = globalState.workbench._scene;
            lastCursor.current = new core_Maths_math__WEBPACK_IMPORTED_MODULE_3__.Vector2(scene.pointerX, scene.pointerY);
        }
    };
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "gizmo", children: scalePoints.map((point, index) => ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gizmoScalePoint__WEBPACK_IMPORTED_MODULE_2__.GizmoScalePoint, { scalePoint: point, allowClickOnPivot: true, clickable: true, onDrag: onDrag, onRotate: onRotate, onUp: onUp, canRotate: true }, index))) }));
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/diagram/gizmoScalePoint.js":
/*!****************************************************************!*\
  !*** ../../../tools/guiEditor/dist/diagram/gizmoScalePoint.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1871554__) => {

"use strict";
__nested_webpack_require_1871554__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1871554__.d(__nested_webpack_exports__, {
/* harmony export */   GizmoScalePoint: () => (/* binding */ GizmoScalePoint),
/* harmony export */   ScalePointPosition: () => (/* binding */ ScalePointPosition)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1871554__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _imgs_gizmoPivotIcon_svg__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1871554__(/*! ../imgs/gizmoPivotIcon.svg */ "../../../tools/guiEditor/dist/imgs/gizmoPivotIcon.svg");
/* harmony import */ var _imgs_cursor_scaleDiagonalLeft_svg__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_scaleDiagonalLeft.svg */ "../../../tools/guiEditor/dist/imgs/cursor_scaleDiagonalLeft.svg");
/* harmony import */ var _imgs_cursor_scaleDiagonalRight_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_scaleDiagonalRight.svg */ "../../../tools/guiEditor/dist/imgs/cursor_scaleDiagonalRight.svg");
/* harmony import */ var _imgs_cursor_scaleHorizontal_svg__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_scaleHorizontal.svg */ "../../../tools/guiEditor/dist/imgs/cursor_scaleHorizontal.svg");
/* harmony import */ var _imgs_cursor_scaleVertical_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_scaleVertical.svg */ "../../../tools/guiEditor/dist/imgs/cursor_scaleVertical.svg");
/* harmony import */ var _imgs_cursor_rotate0_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_rotate0.svg */ "../../../tools/guiEditor/dist/imgs/cursor_rotate0.svg");
/* harmony import */ var _imgs_cursor_rotate1_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_rotate1.svg */ "../../../tools/guiEditor/dist/imgs/cursor_rotate1.svg");
/* harmony import */ var _imgs_cursor_rotate2_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_rotate2.svg */ "../../../tools/guiEditor/dist/imgs/cursor_rotate2.svg");
/* harmony import */ var _imgs_cursor_rotate3_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_rotate3.svg */ "../../../tools/guiEditor/dist/imgs/cursor_rotate3.svg");
/* harmony import */ var _imgs_cursor_rotate4_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_rotate4.svg */ "../../../tools/guiEditor/dist/imgs/cursor_rotate4.svg");
/* harmony import */ var _imgs_cursor_rotate5_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_rotate5.svg */ "../../../tools/guiEditor/dist/imgs/cursor_rotate5.svg");
/* harmony import */ var _imgs_cursor_rotate6_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_rotate6.svg */ "../../../tools/guiEditor/dist/imgs/cursor_rotate6.svg");
/* harmony import */ var _imgs_cursor_rotate7_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1871554__(/*! ../imgs/cursor_rotate7.svg */ "../../../tools/guiEditor/dist/imgs/cursor_rotate7.svg");

// which side of the bounding box are we on?
var ScalePointPosition;
(function (ScalePointPosition) {
    ScalePointPosition[ScalePointPosition["Top"] = -1] = "Top";
    ScalePointPosition[ScalePointPosition["Left"] = -1] = "Left";
    ScalePointPosition[ScalePointPosition["Center"] = 0] = "Center";
    ScalePointPosition[ScalePointPosition["Right"] = 1] = "Right";
    ScalePointPosition[ScalePointPosition["Bottom"] = 1] = "Bottom";
})(ScalePointPosition || (ScalePointPosition = {}));

// load in custom cursor icons












// load in custom cursor icons
const cursorScaleDiagonaLeft = `url("${_imgs_cursor_scaleDiagonalLeft_svg__WEBPACK_IMPORTED_MODULE_2__}") 12 12, nwse-resize`;
const cursorScaleDiagonalRight = `url("${_imgs_cursor_scaleDiagonalRight_svg__WEBPACK_IMPORTED_MODULE_3__}") 12 12, nesw-resize`;
const cursorScaleHorizontal = `url("${_imgs_cursor_scaleHorizontal_svg__WEBPACK_IMPORTED_MODULE_4__}") 12 12, pointer`;
const cursorScaleVertical = `url("${_imgs_cursor_scaleVertical_svg__WEBPACK_IMPORTED_MODULE_5__}") 12 12, ns-resize`;
const scalePointCursors = [
    cursorScaleVertical,
    cursorScaleDiagonalRight,
    cursorScaleHorizontal,
    cursorScaleDiagonaLeft,
    cursorScaleVertical,
    cursorScaleDiagonalRight,
    cursorScaleHorizontal,
    cursorScaleDiagonaLeft,
];
const rotateCursors = [_imgs_cursor_rotate0_svg__WEBPACK_IMPORTED_MODULE_6__, _imgs_cursor_rotate1_svg__WEBPACK_IMPORTED_MODULE_7__, _imgs_cursor_rotate2_svg__WEBPACK_IMPORTED_MODULE_8__, _imgs_cursor_rotate3_svg__WEBPACK_IMPORTED_MODULE_9__, _imgs_cursor_rotate4_svg__WEBPACK_IMPORTED_MODULE_10__, _imgs_cursor_rotate5_svg__WEBPACK_IMPORTED_MODULE_11__, _imgs_cursor_rotate6_svg__WEBPACK_IMPORTED_MODULE_12__, _imgs_cursor_rotate7_svg__WEBPACK_IMPORTED_MODULE_13__].map((cursor) => `url("${cursor}") 12 12, pointer`);
const modulo = (dividend, divisor) => ((dividend % divisor) + divisor) % divisor;
function GizmoScalePoint(props) {
    const { scalePoint, clickable, onDrag, onRotate, onUp, overrideCursor, canRotate, allowClickOnPivot } = props;
    const style = {
        left: `${scalePoint.position.x}px`,
        top: `${scalePoint.position.y}px`,
        transform: "translate(-50%, -50%) rotate(" + scalePoint.rotation + "deg)",
        pointerEvents: clickable ? "auto" : "none",
    };
    if (scalePoint.isPivot) {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "pivot-point", src: _imgs_gizmoPivotIcon_svg__WEBPACK_IMPORTED_MODULE_1__, style: style, onDragStart: (evt) => evt.preventDefault(), onPointerDown: (event) => {
                if (allowClickOnPivot) {
                    onDrag(event, scalePoint);
                }
            }, onPointerUp: () => {
                if (allowClickOnPivot) {
                    onUp();
                }
            } }));
    }
    // compute which cursor icon to use on hover
    const angleOfCursor = scalePoint.defaultRotation + scalePoint.rotation;
    const angleAdjusted = modulo(angleOfCursor, 360);
    const increment = 45;
    const cursorIndex = Math.round(angleAdjusted / increment) % 8;
    const cursor = overrideCursor || scalePointCursors[cursorIndex];
    const scalePointContainerSize = 30; // .scale-point-container width/height in px
    const rotateClickAreaSize = 20; // .rotate-click-area width/height
    const rotateClickAreaOffset = 7; // how much to offset the invisible rotate click area from the center
    const rotateClickAreaStyle = {
        top: (scalePointContainerSize - rotateClickAreaSize) / 2 + rotateClickAreaOffset * scalePoint.verticalPosition,
        left: (scalePointContainerSize - rotateClickAreaSize) / 2 + rotateClickAreaOffset * scalePoint.horizontalPosition,
        cursor: rotateCursors[cursorIndex],
    };
    const scaleClickAreaSize = 20; // .scale-click-area width/height
    const scaleClickAreaOffset = 5; // how much to offset the invisible scale click area from the center
    const scaleClickAreaStyle = {
        top: (scalePointContainerSize - scaleClickAreaSize) / 2 - scaleClickAreaOffset * scalePoint.verticalPosition,
        left: (scalePointContainerSize - scaleClickAreaSize) / 2 - scaleClickAreaOffset * scalePoint.horizontalPosition,
        cursor,
    };
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { style: style, className: "scale-point-container", children: [canRotate && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rotate-click-area", onPointerDown: (event) => {
                    onRotate(event, scalePoint);
                }, style: rotateClickAreaStyle })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "scale-click-area", draggable: true, onDragStart: (evt) => evt.preventDefault(), onPointerDown: (event) => {
                    // if left mouse button down
                    if (event.buttons & 1) {
                        onDrag(event, scalePoint);
                    }
                }, onPointerUp: onUp, style: scaleClickAreaStyle }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "scale-point", draggable: true, onDragStart: (evt) => evt.preventDefault(), onPointerDown: (event) => {
                    if (event.buttons & 1) {
                        onDrag(event, scalePoint);
                    }
                }, onPointerUp: onUp, style: { cursor } })] }));
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/diagram/gizmoWrapper.js":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/diagram/gizmoWrapper.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1880421__) => {

"use strict";
__nested_webpack_require_1880421__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1880421__.d(__nested_webpack_exports__, {
/* harmony export */   GizmoWrapper: () => (/* binding */ GizmoWrapper)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1880421__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1880421__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _gizmoGeneric__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1880421__(/*! ./gizmoGeneric */ "../../../tools/guiEditor/dist/diagram/gizmoGeneric.js");
/* harmony import */ var _gizmoLine__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1880421__(/*! ./gizmoLine */ "../../../tools/guiEditor/dist/diagram/gizmoLine.js");




class GizmoWrapper extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    componentWillMount() {
        this.observer = this.props.globalState.onSelectionChangedObservable.add(() => this.forceUpdate());
    }
    componentWillUnmount() {
        this.props.globalState.onSelectionChangedObservable.remove(this.observer);
    }
    render() {
        const controls = this.props.globalState.selectedControls;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: controls.map((control) => control.getClassName() === "Line" ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gizmoLine__WEBPACK_IMPORTED_MODULE_3__.GizmoLine, { globalState: this.props.globalState, control: control }, control.uniqueId)) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gizmoGeneric__WEBPACK_IMPORTED_MODULE_2__.GizmoGeneric, { globalState: this.props.globalState, control: control }, control.uniqueId))) }));
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/diagram/workbench.js":
/*!**********************************************************!*\
  !*** ../../../tools/guiEditor/dist/diagram/workbench.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1882637__) => {

"use strict";
__nested_webpack_require_1882637__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1882637__.d(__nested_webpack_exports__, {
/* harmony export */   ConstraintDirection: () => (/* binding */ ConstraintDirection),
/* harmony export */   WorkbenchComponent: () => (/* binding */ WorkbenchComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1882637__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1882637__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1882637__(/*! ../globalState */ "../../../tools/guiEditor/dist/globalState.js");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1882637__(/*! gui/2D/valueAndUnit */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1882637__.n(gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1882637__(/*! core/Misc/dataStorage */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_1882637__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1882637__(/*! ../tools */ "../../../tools/guiEditor/dist/tools.js");
/* harmony import */ var _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1882637__(/*! ./coordinateHelper */ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js");
/* harmony import */ var _workbenchCanvas_scss__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1882637__(/*! ./workbenchCanvas.scss */ "../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss");

/* eslint-disable @typescript-eslint/naming-convention */






















var ConstraintDirection;
(function (ConstraintDirection) {
    ConstraintDirection[ConstraintDirection["NONE"] = 0] = "NONE";
    ConstraintDirection[ConstraintDirection["X"] = 2] = "X";
    ConstraintDirection[ConstraintDirection["Y"] = 3] = "Y";
})(ConstraintDirection || (ConstraintDirection = {}));
/**
 * This function will throttle calls to functions.
 *
 * @param callback callback to call.
 * @param time time to wait between calls in ms.
 * @returns callback function.
 */
function throttle(callback, time) {
    let lastCalledTime = 0;
    return function (...args) {
        const now = Date.now();
        if (now - lastCalledTime < time) {
            return;
        }
        lastCalledTime = now;
        callback(...args);
    };
}
const ARROW_KEY_MOVEMENT_SMALL = 1; // px
const ARROW_KEY_MOVEMENT_LARGE = 5; // px
const MAX_POINTER_TRAVEL_DISTANCE = 5; //px^2. determines how far the pointer can move to be treated as a drag vs. a click
const CONTROL_OFFSET = 10; //offset in pixels for when a control is added to editor
class WorkbenchComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    static get addedFonts() {
        return this._addedFonts;
    }
    get visibleRegionContainer() {
        return this._visibleRegionContainer;
    }
    get panAndZoomContainer() {
        return this._panAndZoomContainer;
    }
    set trueRootContainer(value) {
        if (value === this._trueRootContainer)
            return;
        this._visibleRegionContainer.children.forEach((child) => this._visibleRegionContainer.removeControl(child));
        this._visibleRegionContainer.addControl(value);
        this._trueRootContainer = value;
        value._host = this.props.globalState.guiTexture;
    }
    get trueRootContainer() {
        return this._trueRootContainer;
    }
    get guiSize() {
        return this._guiSize;
    }
    get pasteDisabled() {
        return this._pasteDisabled;
    }
    // sets the size of the GUI and makes all necessary adjustments
    set guiSize(value) {
        this._guiSize = { ...value };
        this._visibleRegionContainer.widthInPixels = this._guiSize.width;
        this._visibleRegionContainer.heightInPixels = this._guiSize.height;
        this.props.globalState.onResizeObservable.notifyObservers(this._guiSize);
        this.props.globalState.onReframeWindowObservable.notifyObservers();
        this.props.globalState.onWindowResizeObservable.notifyObservers();
    }
    applyEditorTransformation() {
        const adt = this.props.globalState.guiTexture;
        if (adt._rootContainer != this._panAndZoomContainer) {
            adt._rootContainer = this._panAndZoomContainer;
            this._visibleRegionContainer.addControl(this._trueRootContainer);
            this.props.globalState.guiTexture.markAsDirty();
        }
        if (adt.getSize().width !== this._engine.getRenderWidth() || adt.getSize().height !== this._engine.getRenderHeight()) {
            adt.scaleTo(this._engine.getRenderWidth(), this._engine.getRenderHeight());
        }
        if (adt.getSize().width !== this._engine.getRenderWidth() || adt.getSize().height !== this._engine.getRenderHeight()) {
            adt.scaleTo(this._engine.getRenderWidth(), this._engine.getRenderHeight());
        }
        this._trueRootContainer.clipContent = false;
        this._trueRootContainer.clipChildren = false;
    }
    removeEditorTransformation() {
        const adt = this.props.globalState.guiTexture;
        if (adt._rootContainer != this._trueRootContainer) {
            this._visibleRegionContainer.removeControl(this._trueRootContainer);
            adt._rootContainer = this._trueRootContainer;
        }
        this._trueRootContainer.clipContent = true;
        this._trueRootContainer.clipChildren = true;
    }
    _reframeWindow() {
        this._panningOffset = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(0, 0);
        const xFactor = this._engine.getRenderWidth() / this.guiSize.width;
        const yFactor = this._engine.getRenderHeight() / this.guiSize.height;
        this._zoomFactor = Math.min(xFactor, yFactor) * 0.9;
    }
    constructor(props) {
        super(props);
        this._setConstraintDirection = false;
        this._mouseStartPoint = null;
        this._constraintDirection = ConstraintDirection.NONE;
        this._isOverGUINode = [];
        this._doubleClick = null;
        this._currLeft = 0;
        this._currTop = 0;
        this._controlsHit = [];
        this._pointerTravelDistance = 0;
        this._processSelectionOnUp = false;
        this._centerZoomMousePosition = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(0, 0);
        this._hasPerformedDragZoom = false;
        this._defaultGUISize = { width: 1024, height: 1024 };
        this._initialPanningOffset = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(0, 0);
        this._panningOffset = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(0, 0);
        this._zoomFactor = 1;
        this._zoomModeIncrement = 0.2;
        this._guiSize = this._defaultGUISize;
        this._pasteDisabled = true;
        this.keyEvent = (evt) => {
            if (evt.target.nodeName === "INPUT")
                return;
            if (evt.shiftKey) {
                this._setConstraintDirection = this._constraintDirection === ConstraintDirection.NONE;
            }
            else {
                this._setConstraintDirection = false;
                this._constraintDirection = ConstraintDirection.NONE;
            }
            this.props.globalState.shiftKeyPressed = evt.shiftKey && evt.type === "keydown";
            if (evt.key === "Delete" || evt.key === "Backspace") {
                if (!this.props.globalState.lockObject.lock) {
                    this.props.globalState.deleteSelectedNodes();
                }
            }
            if (this.props.globalState.keys.isKeyDown("control") && !this.props.globalState.lockObject.lock) {
                if (evt.key === "a") {
                    evt.preventDefault();
                    this.props.globalState.setSelection(this.trueRootContainer.children);
                }
            }
        };
        this.blurEvent = () => {
            this._constraintDirection = ConstraintDirection.NONE;
            this.props.globalState.onPointerUpObservable.notifyObservers(null);
        };
        this._controlToLinkedMeshMap = new Map();
        this._observersMap = {
            onPointerDownObservable: new Map(),
            onPointerUpObservable: new Map(),
            onPointerMoveObservable: new Map(),
            onPointerEnterObservable: new Map(),
            onPointerOutObservable: new Map(),
            onPointerClickObservable: new Map(),
            onDisposeObservable: new Map(),
            onIsVisibleChangedObservable: new Map(),
            onBeforeDrawObservable: new Map(),
            onAfterDrawObservable: new Map(),
            onWheelObservable: new Map(),
        };
        const { globalState } = props;
        this._rootContainer = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        globalState.onSelectionChangedObservable.add(() => this.updateNodeOutlines());
        globalState.onToolChangeObservable.add(() => {
            this.forceUpdate();
        });
        // Get the canvas element from the DOM.
        globalState.onFitControlsToWindowObservable.add(() => {
            if (globalState.selectedControls.length) {
                let minX = Number.MAX_SAFE_INTEGER;
                let minY = Number.MAX_SAFE_INTEGER;
                let maxX = -Number.MAX_SAFE_INTEGER;
                let maxY = -Number.MAX_SAFE_INTEGER;
                // Find bounding box of selected controls
                for (const selectedControl of globalState.selectedControls) {
                    const left = -selectedControl.widthInPixels / 2;
                    const top = -selectedControl.heightInPixels / 2;
                    const right = left + selectedControl.widthInPixels;
                    const bottom = top + selectedControl.heightInPixels;
                    // Compute all four corners of the control in root space
                    const leftTopRS = _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.NodeToRTTSpace(selectedControl, left, top, new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(), undefined, this.trueRootContainer);
                    const rightBottomRS = _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.NodeToRTTSpace(selectedControl, right, bottom, new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(), undefined, this.trueRootContainer);
                    const leftBottomRS = _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.NodeToRTTSpace(selectedControl, left, bottom, new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(), undefined, this.trueRootContainer);
                    const rightTopRS = _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.NodeToRTTSpace(selectedControl, right, top, new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(), undefined, this.trueRootContainer);
                    minX = Math.min(minX, leftTopRS.x, rightBottomRS.x, leftBottomRS.x, rightTopRS.x);
                    minY = Math.min(minY, leftTopRS.y, rightBottomRS.y, leftBottomRS.y, rightTopRS.y);
                    maxX = Math.max(maxX, leftTopRS.x, rightBottomRS.x, leftBottomRS.x, rightTopRS.x);
                    maxY = Math.max(maxY, leftTopRS.y, rightBottomRS.y, leftBottomRS.y, rightTopRS.y);
                }
                // Find width and height of bounding box
                const width = maxX - minX;
                const height = maxY - minY;
                // Calculate the offset on the center of the bounding box
                const centerX = (minX + maxX) / 2;
                const centerY = (minY + maxY) / 2;
                this._panningOffset = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(-centerX, centerY);
                // Calculate the zoom factors based on width and height
                const xFactor = this._engine.getRenderWidth() / width;
                const yFactor = this._engine.getRenderHeight() / height;
                this._zoomFactor = Math.min(xFactor, yFactor) * 0.9;
            }
            else {
                this._reframeWindow();
            }
        });
        globalState.onReframeWindowObservable.add(() => {
            this._reframeWindow();
        });
        globalState.onOutlineChangedObservable.add(() => {
            this.updateNodeOutlines();
        });
        globalState.onSelectionChangedObservable.add(() => {
            this.updateNodeOutlines();
        });
        globalState.onParentingChangeObservable.add((control) => {
            this.parent(control);
        });
        globalState.hostDocument.addEventListener("keyup", this.keyEvent, false);
        // Hotkey shortcuts
        globalState.hostDocument.addEventListener("keydown", this.keyEvent, false);
        globalState.hostDocument.defaultView.addEventListener("blur", this.blurEvent, false);
        let framesToUpdate = 1;
        globalState.onWindowResizeObservable.add(() => {
            // update the size for the next 5 frames
            framesToUpdate += 5;
        });
        globalState.onNewSceneObservable.add((scene) => {
            scene &&
                scene.onBeforeRenderObservable.add(() => {
                    if (framesToUpdate > 0) {
                        framesToUpdate--;
                        globalState.onGizmoUpdateRequireObservable.notifyObservers();
                        this._engine.resize();
                        globalState.onArtBoardUpdateRequiredObservable.notifyObservers();
                    }
                });
        });
        globalState.onCopyObservable.add((copyFn) => this.copyToClipboard(copyFn));
        globalState.onCutObservable.add((copyFn) => this.cutToClipboard(copyFn));
        globalState.onPasteObservable.add((content) => this.pasteFromClipboard(content));
        globalState.workbench = this;
        globalState.onResizeObservable.notifyObservers(this._guiSize);
        globalState.onPopupClosedObservable.add(() => {
            this.dispose();
        });
    }
    copyToClipboard(copyFn) {
        this._pasteDisabled = false;
        const controlList = [];
        for (const control of this.props.globalState.selectedControls) {
            // For grid controls, have to save current position in it
            if (control.parent?.getClassName() === "Grid") {
                const cellInfo = control.parent.getChildCellInfo(control);
                const [row, column] = cellInfo.split(":");
                control.metadata = { ...control.metadata, _cellInfo: { row, column } };
            }
            const obj = {};
            control.serialize(obj);
            controlList.push(obj);
            this._currLeft = control.leftInPixels;
            this._currTop = control.topInPixels;
        }
        copyFn(JSON.stringify({
            GUIClipboard: true,
            controls: controlList,
        }));
    }
    cutToClipboard(copyFn) {
        this.copyToClipboard(copyFn);
        this.props.globalState.deleteSelectedNodes();
    }
    pasteFromClipboard(clipboardContents) {
        try {
            const parsed = JSON.parse(clipboardContents);
            if (parsed.GUIClipboard) {
                const newSelection = [];
                for (const control of parsed.controls) {
                    newSelection.push(gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.Parse(control, this.props.globalState.guiTexture));
                }
                if (newSelection[0].parent?.typeName != "StackPanel") {
                    this._currLeft += CONTROL_OFFSET;
                    this._currTop += CONTROL_OFFSET;
                }
                newSelection[0].leftInPixels = this._currLeft;
                newSelection[0].topInPixels = this._currTop;
                const newGuiNode = this.props.globalState.workbench.appendBlock(newSelection[0]);
                if (newGuiNode.parent?.typeName === "Grid" && newGuiNode.metadata?._cellInfo) {
                    const { row, column } = newGuiNode.metadata._cellInfo;
                    const gridParent = newGuiNode.parent;
                    gridParent.removeControl(newGuiNode);
                    gridParent.addControl(newGuiNode, parseInt(row), parseInt(column));
                }
                this.props.globalState.setSelection([newGuiNode]);
                return true;
            }
        }
        catch {
            // don't need an error message
        }
        core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Logger.Warn("Paste attempted, but clipboard content was invalid.");
        return false;
    }
    CopyGUIControl(original) {
        const serializationObject = {};
        original.serialize(serializationObject);
        const newControl = gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.Parse(serializationObject, this.props.globalState.guiTexture);
        if (newControl) {
            //insert the new control into the adt or parent container
            this.props.globalState.workbench.appendBlock(newControl);
            this.props.globalState.guiTexture.removeControl(newControl);
            if (original.parent?.typeName === "Grid") {
                const cell = _tools__WEBPACK_IMPORTED_MODULE_5__.Tools.GetCellInfo(original.parent, original);
                original.parent.addControl(newControl, cell.x, cell.y);
            }
            else {
                original.parent?.addControl(newControl);
            }
            let index = 1;
            while (this.props.globalState.guiTexture.getDescendants(false).filter(
            //search if there are any copies
            (control) => control.name === `${newControl.name} Copy ${index}`).length) {
                index++;
            }
            newControl.name = `${newControl.name} Copy ${index}`;
            this.props.globalState.select(newControl);
        }
    }
    /**
     * Adds editor observers to control and stores old data in metadata
     * @param guiControl
     */
    addEditorBehavior(guiControl) {
        guiControl.onPointerUpObservable.add(() => {
            this.clicked = false;
        });
        guiControl.onPointerDownObservable.add((evt) => {
            if (evt.buttonIndex > 0 || this.props.globalState.tool !== _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.SELECT)
                return;
            this._controlsHit.push(guiControl);
        });
        guiControl.onPointerEnterObservable.add(() => {
            if (this._isOverGUINode.indexOf(guiControl) === -1) {
                this._isOverGUINode.push(guiControl);
            }
        });
        guiControl.onPointerOutObservable.add(() => {
            const index = this._isOverGUINode.indexOf(guiControl);
            if (index !== -1) {
                this._isOverGUINode.splice(index, 1);
            }
        });
        guiControl.onDisposeObservable.add(() => {
            const index = this._isOverGUINode.indexOf(guiControl);
            if (index !== -1) {
                this._isOverGUINode.splice(index, 1);
            }
        });
        guiControl.metadata = {
            ...guiControl.metadata,
            guiEditor: true,
        };
    }
    /**
     * Removes editor behavior (observables, metadata) from control
     * @param control
     */
    removeEditorBehavior(control) {
        if (!control.metadata || !control.metadata.guiEditor) {
            return;
        }
        delete control.metadata.guiEditor;
        delete control.metadata.editorUniqueId;
    }
    dispose() {
        this.props.globalState.hostDocument.removeEventListener("keyup", this.keyEvent);
        this.props.globalState.hostDocument.removeEventListener("keydown", this.keyEvent);
        this.props.globalState.hostDocument.defaultView.removeEventListener("blur", this.blurEvent);
        if (this._guiRenderObserver) {
            this.props.globalState.guiTexture.onEndRenderObservable.remove(this._guiRenderObserver);
        }
        this._engine.dispose();
    }
    loadFromJson(serializationObject) {
        this.removeEditorTransformation();
        this.props.globalState.setSelection([]);
        if (this.props.globalState.liveGuiTexture) {
            this.props.globalState.liveGuiTexture?.parseContent(serializationObject, true);
            this.synchronizeLiveGUI();
        }
        else {
            this.props.globalState.guiTexture.parseContent(serializationObject, true);
        }
        this.trueRootContainer = this.props.globalState.guiTexture._rootContainer;
        this.guiSize = this.props.globalState.guiTexture.getSize();
        this.loadToEditor();
    }
    /**
     * Load Control from Json then select loaded Control
     * @param serializationObject
     */
    loadControlFromJson(serializationObject) {
        const newControls = [];
        for (const control of serializationObject.controls) {
            const newControl = gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.Parse(control, this.props.globalState.guiTexture);
            newControls.push(newControl);
            const newGuiNode = this.props.globalState.workbench.appendBlock(newControl);
            if (newGuiNode.parent?.typeName === "Grid" && newGuiNode.metadata?._cellInfo) {
                const { row, column } = newGuiNode.metadata._cellInfo;
                const gridParent = newGuiNode.parent;
                gridParent.removeControl(newGuiNode);
                gridParent.addControl(newGuiNode, parseInt(row), parseInt(column));
            }
        }
        this.props.globalState.setSelection(newControls);
    }
    async loadFromSnippet(snippetId) {
        this.removeEditorTransformation();
        this.props.globalState.setSelection([]);
        if (this.props.globalState.liveGuiTexture) {
            await this.props.globalState.liveGuiTexture?.parseFromSnippetAsync(snippetId, true);
            this.synchronizeLiveGUI();
        }
        else {
            await this.props.globalState.guiTexture.parseFromSnippetAsync(snippetId, true);
        }
        this.trueRootContainer = this.props.globalState.guiTexture._rootContainer;
        this.guiSize = this.props.globalState.guiTexture.getSize();
        this.loadToEditor();
        if (this.props.globalState.customLoad) {
            this.props.globalState.customLoad.action(snippetId).catch(() => {
                alert("Unable to load your GUI");
            });
        }
    }
    loadToEditor() {
        this.props.globalState.guiTexture.rootContainer.getDescendants().forEach((guiElement) => {
            const fontName = guiElement.fontFamily.trim().toLowerCase();
            if (WorkbenchComponent._addedFonts.indexOf(fontName) === -1) {
                WorkbenchComponent._addedFonts.push(guiElement.fontFamily);
            }
            this.addEditorBehavior(guiElement);
        });
        this._isOverGUINode = [];
        this.props.globalState.setSelection([]);
        this.props.globalState.onFitControlsToWindowObservable.notifyObservers();
        this.props.globalState.onFontsParsedObservable.notifyObservers();
    }
    updateNodeOutlines() {
        for (const guiControl of this._trueRootContainer.getDescendants()) {
            guiControl.isHighlighted = guiControl.getClassName() === "Grid" && (this.props.globalState.outlines || this.props.globalState.selectedControls.includes(guiControl));
            guiControl.highlightLineWidth = 5;
        }
    }
    appendBlock(guiElement) {
        this.addEditorBehavior(guiElement);
        guiElement.getDescendants(true).forEach((desc) => this.addEditorBehavior(desc));
        if (this.props.globalState.selectedControls.length != 0) {
            this.props.globalState.selectedControls[0].parent?.addControl(guiElement);
        }
        else {
            this.trueRootContainer.addControl(guiElement);
        }
        return guiElement;
    }
    parent(dropLocationControl) {
        const draggedControl = this.props.globalState.draggedControl;
        const draggedControlParent = draggedControl?.parent;
        if (draggedControlParent && draggedControl) {
            if (this._isNotChildInsert(dropLocationControl, draggedControl)) {
                //checking to make sure the element is not being inserted into a child
                if (dropLocationControl != null) {
                    //the control you are dragging onto top
                    if (dropLocationControl instanceof gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Container && //dropping inside a container control
                        this.props.globalState.draggedControlDirection === _globalState__WEBPACK_IMPORTED_MODULE_2__.DragOverLocation.CENTER) {
                        draggedControlParent.removeControl(draggedControl);
                        dropLocationControl.addControl(draggedControl);
                    }
                    else if (dropLocationControl.parent) {
                        //dropping inside the controls parent container
                        if (dropLocationControl.parent.typeName !== "Grid") {
                            draggedControlParent.removeControl(draggedControl);
                            let index = dropLocationControl.parent.children.indexOf(dropLocationControl);
                            const reverse = dropLocationControl.parent.typeName === "StackPanel" || dropLocationControl.parent.typeName === "VirtualKeyboard";
                            index = this._adjustParentingIndex(index, reverse); //adjusting index to be before or after based on where the control is over
                            dropLocationControl.parent.children.splice(index, 0, draggedControl);
                            draggedControl.parent = dropLocationControl.parent;
                        }
                        else if (dropLocationControl.parent === draggedControlParent) {
                            //special case for grid
                            this._reorderGrid(dropLocationControl.parent, draggedControl, dropLocationControl);
                        }
                        else {
                            draggedControlParent.removeControl(draggedControl);
                            dropLocationControl.parent.addControl(draggedControl);
                            this._reorderGrid(dropLocationControl.parent, draggedControl, dropLocationControl);
                        }
                    }
                    else {
                        draggedControlParent.removeControl(draggedControl);
                        this.trueRootContainer.addControl(draggedControl);
                    }
                }
                else {
                    draggedControlParent.removeControl(draggedControl);
                    this.trueRootContainer.addControl(draggedControl);
                    this.trueRootContainer.children.pop();
                    this.trueRootContainer.children.splice(0, 0, draggedControl);
                }
            }
        }
        if (draggedControl) {
            const newParent = draggedControl.parent;
            if (newParent) {
                if (newParent.typeName === "StackPanel" || newParent.typeName === "VirtualKeyboard") {
                    const isVertical = newParent.isVertical;
                    if (draggedControl._width.unit === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PERCENTAGE && !isVertical) {
                        _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.ConvertToPixels(draggedControl, ["width"]);
                        this.props.globalState.hostWindow.alert("Warning: Parenting to horizontal stack panel converts width to pixel values");
                    }
                    if (draggedControl._height.unit === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PERCENTAGE && isVertical) {
                        _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.ConvertToPixels(draggedControl, ["height"]);
                        this.props.globalState.hostWindow.alert("Warning: Parenting to vertical stack panel converts height to pixel values");
                    }
                }
                // Force containers to re-render if we added a new child
                newParent.markAsDirty();
            }
        }
        this.props.globalState.draggedControl = null;
    }
    _canClone() {
        return this.props.globalState.liveGuiTexture && this.props.globalState.guiTexture && this.trueRootContainer;
    }
    _saveObservables(root) {
        root.getDescendants().forEach((control) => {
            if (control.linkedMesh) {
                this._controlToLinkedMeshMap.set(control.metadata.editorUniqueId, control.linkedMesh);
            }
            Object.keys(this._observersMap).forEach((key) => {
                const observable = control[key];
                if (observable.hasObservers()) {
                    this._observersMap[key].set(control.metadata.editorUniqueId, observable);
                }
            });
        });
    }
    _restoreObservables(root) {
        root.getDescendants().forEach((control) => {
            if (this._controlToLinkedMeshMap.has(control.metadata?.editorUniqueId)) {
                const linkedMesh = this._controlToLinkedMeshMap.get(control.metadata.editorUniqueId);
                if (linkedMesh) {
                    control.linkWithMesh(linkedMesh);
                }
            }
            Object.keys(this._observersMap).forEach((key) => {
                const savedObservable = this._observersMap[key].get(control.metadata?.editorUniqueId);
                if (savedObservable) {
                    control[key] = savedObservable;
                }
            });
        });
        this._controlToLinkedMeshMap.clear();
        Object.keys(this._observersMap).forEach((key) => {
            this._observersMap[key].clear();
        });
    }
    _copyEditorGUIToLiveGUI() {
        if (this._canClone()) {
            // Before cloning, save all of the live GUI controls that have a linked mesh
            const liveRoot = this.props.globalState.liveGuiTexture.rootContainer;
            this._saveObservables(liveRoot);
            liveRoot.clearControls();
            const originalToCloneMap = new Map();
            const updatedRootChildren = this.trueRootContainer.children.slice(0);
            for (const child of updatedRootChildren) {
                const clone = child.clone(this.props.globalState.liveGuiTexture);
                originalToCloneMap.set(child, clone);
                liveRoot.addControl(clone);
            }
            // Relink all meshes
            this._restoreObservables(liveRoot);
            this._syncConnectedLines(updatedRootChildren, originalToCloneMap);
        }
    }
    _reorderGrid(grid, draggedControl, dropLocationControl) {
        const cellInfo = _tools__WEBPACK_IMPORTED_MODULE_5__.Tools.GetCellInfo(grid, draggedControl);
        grid.removeControl(draggedControl);
        let index = grid.children.indexOf(dropLocationControl);
        index = this._adjustParentingIndex(index);
        _tools__WEBPACK_IMPORTED_MODULE_5__.Tools.ReorderGrid(grid, index, draggedControl, cellInfo);
    }
    _isNotChildInsert(control, draggedControl) {
        while (control?.parent) {
            if (control.parent == draggedControl) {
                return false;
            }
            control = control.parent;
        }
        return true;
    }
    _adjustParentingIndex(index, reversed = false) {
        switch (this.props.globalState.draggedControlDirection) {
            case _globalState__WEBPACK_IMPORTED_MODULE_2__.DragOverLocation.ABOVE:
                return reversed ? index : index + 1;
            case _globalState__WEBPACK_IMPORTED_MODULE_2__.DragOverLocation.BELOW:
            case _globalState__WEBPACK_IMPORTED_MODULE_2__.DragOverLocation.CENTER:
                return reversed ? index + 1 : index;
        }
        return index;
    }
    isSelected(value, guiNode) {
        this.props.globalState.select(guiNode);
    }
    _onMove(guiControl, evt, startPos) {
        const toConvert = [];
        if (guiControl._top.unit === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PERCENTAGE) {
            toConvert.push("top");
        }
        if (guiControl._left.unit === gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PERCENTAGE) {
            toConvert.push("left");
        }
        let newX = evt.x - startPos.x;
        let newY = evt.y - startPos.y;
        if (this._setConstraintDirection) {
            this._setConstraintDirection = false;
            this._constraintDirection = Math.abs(newX) >= Math.abs(newY) ? ConstraintDirection.X : ConstraintDirection.Y;
        }
        if (this._constraintDirection === ConstraintDirection.X) {
            newY = 0;
        }
        else if (this._constraintDirection === ConstraintDirection.Y) {
            newX = 0;
        }
        const referenceAxis = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(newX, newY);
        if (guiControl.typeName === "Line") {
            const line = guiControl;
            const x1 = line.x1.substring(0, line.x1.length - 2); //removing the 'px'
            const x2 = line.x2.substring(0, line.x2.length - 2);
            const y1 = line.y1.substring(0, line.y1.length - 2);
            const y2 = line.y2.substring(0, line.y2.length - 2);
            line.x1 = (Number(x1) + newX).toFixed(2);
            line.x2 = (Number(x2) + newX).toFixed(2);
            line.y1 = (Number(y1) + newY).toFixed(2);
            line.y2 = (Number(y2) + newY).toFixed(2);
            this.props.globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
            return;
        }
        let totalRotation = 0;
        let currentControl = guiControl.parent;
        while (currentControl) {
            totalRotation += currentControl.rotation;
            currentControl = currentControl.parent;
        }
        const rotatedReferenceAxis = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(0, 0);
        // Rotate the reference axis by the total rotation of the control
        const sinR = Math.sin(-totalRotation);
        const cosR = Math.cos(-totalRotation);
        rotatedReferenceAxis.x = cosR * referenceAxis.x - sinR * referenceAxis.y;
        rotatedReferenceAxis.y = sinR * referenceAxis.x + cosR * referenceAxis.y;
        // Apply the amount of change
        guiControl.leftInPixels += rotatedReferenceAxis.x;
        guiControl.topInPixels += rotatedReferenceAxis.y;
        _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.ConvertToPercentage(guiControl, toConvert);
        this.props.globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
    }
    onMove(evt) {
        const pos = this.getScaledPointerPosition();
        // Move or guiNodes
        if (this._mouseStartPoint != null && !this._panning) {
            this.props.globalState.selectedControls.forEach((element) => {
                if (pos) {
                    this._onMove(element, pos, this._mouseStartPoint);
                }
            });
            this._mouseStartPoint = pos ? pos : this._mouseStartPoint;
        }
        this._pointerTravelDistance += evt.movementX * evt.movementX + evt.movementY * evt.movementY;
        if (this._panning) {
            this.panning();
        }
    }
    _screenToTexturePosition(screenPos) {
        const zoomVector = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(this._zoomFactor, this._zoomFactor);
        return screenPos.divideInPlace(zoomVector).add(this._panningOffset);
    }
    getScaledPointerPosition() {
        return this._screenToTexturePosition(new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(this._scene.pointerX, this._scene.pointerY));
    }
    startPanning() {
        this._panning = true;
        this._initialPanningOffset = this.getScaledPointerPosition();
    }
    endPanning() {
        this._panning = false;
    }
    processSelection() {
        // if hit nothing, deselect all
        if (this.props.globalState.usePrevSelected) {
            this.props.globalState.usePrevSelected = false;
            return;
        }
        if (this._controlsHit.length === 0) {
            this.props.globalState.setSelection([]);
            return;
        }
        // if child of selected control -> select on double click
        for (const control of this._controlsHit) {
            if (this.props.globalState.selectedControls.includes(control.parent)) {
                if (this._doubleClick === control) {
                    this.props.globalState.select(control);
                    return;
                }
                else {
                    this._doubleClick = control;
                    window.setTimeout(() => {
                        this._doubleClick = null;
                    }, 300);
                }
            }
        }
        // if control or sibling of control already selected -> select
        for (const control of this._controlsHit) {
            for (const selected of this.props.globalState.selectedControls) {
                if (selected.parent === control.parent) {
                    this.props.globalState.select(control);
                    return;
                }
                break; // we don't need to check any more since it's guaranteed that all selected controls have same parent
            }
        }
        // if control is child of root -> select
        for (const control of this._controlsHit) {
            if (control.parent === this._trueRootContainer) {
                this.props.globalState.select(control);
            }
        }
    }
    onDown(evt) {
        this._pointerTravelDistance = 0;
        this._rootContainer.current?.setPointerCapture(evt.pointerId);
        if (this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.SELECT) {
            this._mouseStartPoint = this.getScaledPointerPosition();
        }
        if (this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.ZOOM) {
            this._centerZoomMousePosition.set(this._scene.pointerX, this._scene.pointerY);
        }
        if (evt.buttons & 4 || this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.PAN) {
            this.startPanning();
        }
        else {
            this.endPanning();
            // process selection
            if (this.props.globalState.selectedControls.length !== 0) {
                this._processSelectionOnUp = true;
            }
            this._scene.onAfterRenderObservable.addOnce(() => {
                // if we didn't hit any selected controls, immediately process new selection
                if (!this._processSelectionOnUp || this._controlsHit.filter((control) => this.props.globalState.selectedControls.includes(control)).length === 0) {
                    this.processSelection();
                    this._controlsHit = [];
                    this._processSelectionOnUp = false;
                }
            });
        }
    }
    onUp(evt) {
        if (this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.ZOOM && !this._hasPerformedDragZoom) {
            this._panZoomToCenter(1000 * this._zoomModeIncrement, new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(this._scene.pointerX, this._scene.pointerY));
            this.zooming(1.0 + (this.props.globalState.keys.isKeyDown("alt") ? -this._zoomModeIncrement : this._zoomModeIncrement));
        }
        this._hasPerformedDragZoom = false;
        this._mouseStartPoint = null;
        this._centerZoomMousePosition.set(0, 0);
        this._constraintDirection = ConstraintDirection.NONE;
        this._rootContainer.current?.releasePointerCapture(evt.pointerId);
        this._panning = false;
        if (this._processSelectionOnUp) {
            if (Math.sqrt(this._pointerTravelDistance) <= MAX_POINTER_TRAVEL_DISTANCE) {
                this.processSelection();
            }
            this._controlsHit = [];
            this._processSelectionOnUp = false;
        }
    }
    _syncConnectedLines(controlList, originalToCloneMap) {
        for (const control of controlList) {
            if (control.getClassName() === "Line") {
                const lineControl = control;
                if (lineControl.connectedControl) {
                    const connectedControl = lineControl.connectedControl;
                    const clonedLine = originalToCloneMap.get(lineControl);
                    const clonedConnectedControl = originalToCloneMap.get(connectedControl);
                    if (clonedLine && clonedConnectedControl) {
                        clonedLine.connectedControl = clonedConnectedControl;
                    }
                }
            }
        }
    }
    _copyLiveGUIToEditorGUI() {
        if (this.props.globalState.liveGuiTexture && this.trueRootContainer) {
            // Create special IDs that will allow us to know which cloned control corresponds to its original
            this.props.globalState.liveGuiTexture.rootContainer.getDescendants().forEach((control) => {
                control.metadata = { ...(control.metadata ?? {}), editorUniqueId: (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.RandomGUID)() };
            });
            this.trueRootContainer.clearControls();
            const originalToCloneMap = new Map();
            for (const control of this.props.globalState.liveGuiTexture.rootContainer.children) {
                const cloned = control.clone(this.props.globalState.guiTexture);
                originalToCloneMap.set(control, cloned);
                this.appendBlock(cloned);
            }
            // Synchronize existing connectedControls
            this._syncConnectedLines(this.props.globalState.liveGuiTexture.rootContainer.children, originalToCloneMap);
        }
    }
    createGUICanvas(embed) {
        // Get the canvas element from the DOM.
        const canvas = this._rootContainer.current;
        // Associate a Babylon Engine to it.
        this._engine = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Engine(canvas);
        // Create our first scene.
        this._scene = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Scene(this._engine);
        this._scene.clearColor = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Color4(0, 0, 0, 0);
        const light = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.HemisphericLight("light1", core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Axis.Y, this._scene);
        light.intensity = 0.9;
        if (this.props.globalState.liveGuiTexture) {
            this._guiSize.width = this.props.globalState.liveGuiTexture.getSize().width;
            this._guiSize.height = this.props.globalState.liveGuiTexture.getSize().height;
            canvas.width = this._guiSize.width;
            canvas.height = this._guiSize.height;
        }
        else {
            this._guiSize.width = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.DataStorage.ReadNumber("GUIEditorWidth", 1024);
            this._guiSize.height = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.DataStorage.ReadNumber("GUIEditorHeight", 1024);
        }
        this._panAndZoomContainer = new gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Container("panAndZoom");
        this._panAndZoomContainer.clipContent = false;
        this._panAndZoomContainer.clipChildren = false;
        this._visibleRegionContainer = new gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Container("visibleRegion");
        this._visibleRegionContainer.clipChildren = false;
        this._visibleRegionContainer.clipContent = false;
        this._visibleRegionContainer.widthInPixels = this.guiSize.width;
        this._visibleRegionContainer.heightInPixels = this.guiSize.height;
        this._panAndZoomContainer.addControl(this._visibleRegionContainer);
        const adt = (this.props.globalState.guiTexture =
            this._visibleRegionContainer._host =
                this._panAndZoomContainer._host =
                    gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.AdvancedDynamicTexture.CreateFullscreenUI("guiTexture", true, this._scene, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Texture.NEAREST_NEAREST_MIPNEAREST, false));
        adt.useInvalidateRectOptimization = false;
        this.trueRootContainer = adt.rootContainer;
        adt.onEndRenderObservable.add(() => this.props.globalState.onGizmoUpdateRequireObservable.notifyObservers());
        this._copyLiveGUIToEditorGUI();
        new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.ArcRotateCamera("Camera", 0, 0, 0, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector3.Zero(), this._scene);
        // This attaches the mouse controls
        this.addControls(this._scene);
        this._scene.getEngine().onCanvasPointerOutObservable.clear();
        this._scene.doNotHandleCursors = true;
        // Watch for browser/canvas resize events
        this.props.globalState.hostWindow.addEventListener("resize", () => {
            this.props.globalState.onWindowResizeObservable.notifyObservers();
            this._scene.onBeforeRenderObservable.addOnce(() => {
                this.props.globalState.onWindowResizeObservable.notifyObservers();
            });
        });
        this.props.globalState.onWindowResizeObservable.notifyObservers();
        this.props.globalState.guiTexture.onBeginRenderObservable.add(() => {
            this.applyEditorTransformation();
        });
        this.props.globalState.onPropertyChangedObservable.add((ev) => {
            ev.object.markAsDirty(false);
            this.props.globalState.onWindowResizeObservable.notifyObservers();
        });
        const throttledSynchronization = throttle(() => {
            this._copyEditorGUIToLiveGUI();
        }, 33);
        if (this.props.globalState.liveGuiTexture) {
            this._guiRenderObserver = this.props.globalState.guiTexture.onEndRenderObservable.add(throttledSynchronization);
        }
        this._engine.runRenderLoop(() => {
            this._scene.render();
        });
        this.props.globalState.onNewSceneObservable.notifyObservers(this.props.globalState.guiTexture.getScene());
        this.props.globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
        this.props.globalState.onFitControlsToWindowObservable.notifyObservers();
    }
    // removes all controls from both GUIs, and re-adds the controls from the original to the GUI editor
    synchronizeLiveGUI() {
        if (this.props.globalState.liveGuiTexture) {
            this._trueRootContainer.getDescendants().forEach((desc) => desc.dispose());
            this.props.globalState.liveGuiTexture.rootContainer.getDescendants(true).forEach((desc) => {
                this.props.globalState.liveGuiTexture?.removeControl(desc);
                this.appendBlock(desc);
            });
            this.props.globalState.guiTexture.snippetId = this.props.globalState.liveGuiTexture.snippetId;
        }
    }
    //Add zoom and pan controls
    addControls(scene) {
        scene.onKeyboardObservable.add((k) => {
            switch (k.event.key) {
                case "ArrowUp": // move up
                    this.moveControls(false, k.event.shiftKey ? -ARROW_KEY_MOVEMENT_LARGE : -ARROW_KEY_MOVEMENT_SMALL);
                    break;
                case "ArrowDown": // move down
                    this.moveControls(false, k.event.shiftKey ? ARROW_KEY_MOVEMENT_LARGE : ARROW_KEY_MOVEMENT_SMALL);
                    break;
                case "ArrowLeft": // move left
                    this.moveControls(true, k.event.shiftKey ? -ARROW_KEY_MOVEMENT_LARGE : -ARROW_KEY_MOVEMENT_SMALL);
                    break;
                case "ArrowRight": // move right
                    this.moveControls(true, k.event.shiftKey ? ARROW_KEY_MOVEMENT_LARGE : ARROW_KEY_MOVEMENT_SMALL);
                    break;
            }
        }, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.KeyboardEventTypes.KEYDOWN);
        scene.onBeforeRenderObservable.add(() => {
            if (this._panAndZoomContainer.scaleX !== this._zoomFactor) {
                this._panAndZoomContainer.scaleX = this._zoomFactor;
                this._panAndZoomContainer.scaleY = this._zoomFactor;
                this.props.globalState.onArtBoardUpdateRequiredObservable.notifyObservers();
                this.props.globalState.onGizmoUpdateRequireObservable.notifyObservers();
            }
            const left = this._zoomFactor * this._panningOffset.x;
            const top = this._zoomFactor * -this._panningOffset.y;
            if (this._panAndZoomContainer.leftInPixels !== left || this._panAndZoomContainer.topInPixels !== top) {
                this._panAndZoomContainer.leftInPixels = left;
                this._panAndZoomContainer.topInPixels = top;
                this.props.globalState.onArtBoardUpdateRequiredObservable.notifyObservers();
                this.props.globalState.onGizmoUpdateRequireObservable.notifyObservers();
            }
        });
    }
    //Return offsets for inertial panning given initial and current pointer positions
    panning() {
        const panningDelta = this.getScaledPointerPosition().subtract(this._initialPanningOffset).multiplyByFloats(1, -1);
        this._panningOffset = this._panningOffset.add(panningDelta);
        this._initialPanningOffset = this.getScaledPointerPosition();
        this.props.globalState.onWindowResizeObservable.notifyObservers();
    }
    // Move the selected controls. Can be either on horizontal (leftInPixels) or
    // vertical (topInPixels) direction
    moveControls(moveHorizontal, amount) {
        for (const selectedControl of this.props.globalState.selectedControls) {
            if (moveHorizontal) {
                // move horizontal
                const prevValue = selectedControl.leftInPixels;
                selectedControl.leftInPixels += amount;
                this.props.globalState.onPropertyChangedObservable.notifyObservers({
                    object: selectedControl,
                    property: "leftInPixels",
                    value: selectedControl.leftInPixels,
                    initialValue: prevValue,
                });
                this.props.globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
            }
            else {
                // move vertical
                const prevValue = selectedControl.topInPixels;
                selectedControl.topInPixels += amount;
                this.props.globalState.onPropertyChangedObservable.notifyObservers({
                    object: selectedControl,
                    property: "topInPixels",
                    value: selectedControl.topInPixels,
                    initialValue: prevValue,
                });
                this.props.globalState.onPropertyGridUpdateRequiredObservable.notifyObservers();
            }
        }
    }
    //Get the wheel delta
    zoomWheel(event) {
        let delta = 0;
        if (event.deltaY) {
            delta = -event.deltaY;
        }
        else if (event.detail) {
            delta = -event.detail;
        }
        const mouseCenter = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Vector2(this._scene.pointerX, this._scene.pointerY);
        this._panZoomToCenter(delta, mouseCenter);
        this.zooming(1 + delta / 1000);
    }
    _panZoomToCenter(delta, mouseCenter) {
        const mouseToRtt = _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.MousePointerToRTTSpace(this.trueRootContainer, mouseCenter.x, mouseCenter.y);
        const rttToLocal = _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.RttToLocalNodeSpace(this.trueRootContainer, mouseToRtt.x, mouseToRtt.y);
        const centerToRtt = _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.MousePointerToRTTSpace(this.trueRootContainer, this._engine.getRenderWidth() / 2, this._engine.getRenderHeight() / 2);
        const centerToLocal = _coordinateHelper__WEBPACK_IMPORTED_MODULE_6__.CoordinateHelper.RttToLocalNodeSpace(this.trueRootContainer, centerToRtt.x, centerToRtt.y);
        const panScale = -delta / 1000;
        const deltaCenter = rttToLocal.subtract(centerToLocal).scale(panScale).multiplyByFloats(1, -1);
        this._panningOffset.addInPlace(deltaCenter);
    }
    zoomDrag(event) {
        let delta = 0;
        if (event.movementY !== 0) {
            delta = -event.movementY;
        }
        this._hasPerformedDragZoom = true;
        this._panZoomToCenter(delta, this._centerZoomMousePosition);
        this.zooming(1 + delta / 1000);
    }
    //Zoom to pointer position. Zoom amount determined by delta
    zooming(delta) {
        this._zoomFactor *= delta;
    }
    //Sets x y or z of passed in vector to zero if less than Epsilon
    zeroIfClose(vec) {
        if (Math.abs(vec.x) < core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Epsilon) {
            vec.x = 0;
        }
        if (Math.abs(vec.y) < core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Epsilon) {
            vec.y = 0;
        }
        if (Math.abs(vec.z) < core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_4__.Epsilon) {
            vec.z = 0;
        }
    }
    render() {
        let cursor = "default";
        if (this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.PAN) {
            cursor = "grab";
        }
        else if (this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.ZOOM) {
            cursor = this.props.globalState.keys.isKeyDown("alt") ? "zoom-out" : "zoom-in";
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("canvas", { id: "workbench-canvas", onPointerMove: (evt) => {
                if (this._mouseDown && this.props.globalState.tool === _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.ZOOM) {
                    this.zoomDrag(evt);
                }
                if (this.props.globalState.guiTexture) {
                    this.onMove(evt);
                }
                this.props.globalState.onPointerMoveObservable.notifyObservers(evt);
            }, onPointerDown: (evt) => {
                this.onDown(evt);
                if (this._controlsHit.length === 0) {
                    this._mouseDown = true;
                }
                else {
                    this._mouseDown = false;
                }
            }, onPointerUp: (evt) => {
                this.onUp(evt);
                this.props.globalState.onPointerUpObservable.notifyObservers(evt);
                this._mouseDown = false;
            }, onWheel: (evt) => this.zoomWheel(evt), onContextMenu: (evt) => evt.preventDefault(), ref: this._rootContainer, style: { cursor } }));
    }
}
WorkbenchComponent._addedFonts = [];


/***/ }),

/***/ "../../../tools/guiEditor/dist/globalState.js":
/*!****************************************************!*\
  !*** ../../../tools/guiEditor/dist/globalState.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1938429__) => {

"use strict";
__nested_webpack_require_1938429__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1938429__.d(__nested_webpack_exports__, {
/* harmony export */   DragOverLocation: () => (/* binding */ DragOverLocation),
/* harmony export */   GUIEditorTool: () => (/* binding */ GUIEditorTool),
/* harmony export */   GlobalState: () => (/* binding */ GlobalState)
/* harmony export */ });
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1938429__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1938429__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1938429__(/*! shared-ui-components/tabs/propertyGrids/lockObject */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js");
/* harmony import */ var _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1938429__(/*! ./diagram/coordinateHelper */ "../../../tools/guiEditor/dist/diagram/coordinateHelper.js");
/* harmony import */ var gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1938429__(/*! gui/2D/controls/container */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1938429__.n(gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _keyboardManager__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1938429__(/*! ./keyboardManager */ "../../../tools/guiEditor/dist/keyboardManager.js");







var DragOverLocation;
(function (DragOverLocation) {
    DragOverLocation[DragOverLocation["ABOVE"] = 0] = "ABOVE";
    DragOverLocation[DragOverLocation["BELOW"] = 1] = "BELOW";
    DragOverLocation[DragOverLocation["CENTER"] = 2] = "CENTER";
    DragOverLocation[DragOverLocation["NONE"] = 3] = "NONE";
})(DragOverLocation || (DragOverLocation = {}));
var GUIEditorTool;
(function (GUIEditorTool) {
    GUIEditorTool[GUIEditorTool["SELECT"] = 0] = "SELECT";
    GUIEditorTool[GUIEditorTool["PAN"] = 1] = "PAN";
    GUIEditorTool[GUIEditorTool["ZOOM"] = 2] = "ZOOM";
})(GUIEditorTool || (GUIEditorTool = {}));
class GlobalState {
    get tool() {
        if (this._tool === GUIEditorTool.ZOOM) {
            return GUIEditorTool.ZOOM;
        }
        else if (this._tool === GUIEditorTool.PAN) {
            return GUIEditorTool.PAN;
        }
        else {
            return GUIEditorTool.SELECT;
        }
    }
    set tool(newTool) {
        if (this._tool === newTool)
            return;
        this._prevTool = this._tool;
        this._tool = newTool;
        this.onToolChangeObservable.notifyObservers();
    }
    get usePrevSelected() {
        return this._usePrevSelected;
    }
    set usePrevSelected(val) {
        this._usePrevSelected = val;
    }
    restorePreviousTool() {
        if (this._tool !== this._prevTool) {
            this._tool = this._prevTool;
            this.onToolChangeObservable.notifyObservers();
        }
    }
    constructor() {
        this.selectedControls = [];
        this.onSelectionChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onResizeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onBuiltObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onResetRequiredObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onUpdateRequiredObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onLogRequiredObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onErrorMessageDialogRequiredObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onIsLoadingChanged = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onSelectionBoxMoved = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onNewSceneObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onGuiNodeRemovalObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onPopupClosedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this._outlines = false;
        /** DO NOT USE: in the process of removing */
        this.blockKeyboardEvents = false;
        this.onOutlineChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onPropertyChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this._tool = GUIEditorTool.SELECT;
        this._prevTool = this._tool;
        this.onToolChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onFitControlsToWindowObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onReframeWindowObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onLoadObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onSaveObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onSaveSelectedControl = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onSnippetLoadObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onSnippetSaveObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onControlLoadObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onResponsiveChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onParentingChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onDropObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onPropertyGridUpdateRequiredObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onDraggingEndObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onDraggingStartObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onWindowResizeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onGizmoUpdateRequireObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onArtBoardUpdateRequiredObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onBackgroundColorChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onFontsParsedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onPointerMoveObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onPointerUpObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.draggedControl = null;
        this.onCopyObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onCutObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onPasteObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.isSaving = false;
        this.lockObject = new shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_1__.LockObject();
        this.shiftKeyPressed = false;
        this.controlCamera = core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.ReadBoolean("ControlCamera", true);
        const defaultBrightness = 204 / 255.0;
        const r = core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.ReadNumber("BackgroundColorR", defaultBrightness);
        const g = core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.ReadNumber("BackgroundColorG", defaultBrightness);
        const b = core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.ReadNumber("BackgroundColorB", defaultBrightness);
        this.backgroundColor = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Color3(r, g, b);
        this.onBackgroundColorChangeObservable.notifyObservers();
        _diagram_coordinateHelper__WEBPACK_IMPORTED_MODULE_2__.CoordinateHelper.GlobalState = this;
    }
    /** adds copy, cut and paste listeners to the host window */
    registerEventListeners() {
        const isElementEditable = (element) => {
            return element.isContentEditable || element.tagName === "INPUT" || element.tagName === "TEXTAREA";
        };
        this.hostDocument.addEventListener("copy", (event) => {
            if (!isElementEditable(event.target)) {
                this.onCopyObservable.notifyObservers((content) => event.clipboardData?.setData("text/plain", content));
                event.preventDefault();
            }
        });
        this.hostDocument.addEventListener("cut", (event) => {
            if (!isElementEditable(event.target)) {
                this.onCutObservable.notifyObservers((content) => event.clipboardData?.setData("text/plain", content));
                event.preventDefault();
            }
        });
        this.hostDocument.addEventListener("paste", (event) => {
            if (!isElementEditable(event.target)) {
                this.onPasteObservable.notifyObservers(event.clipboardData?.getData("text") || "");
                event.preventDefault();
            }
        });
        this.keys = new _keyboardManager__WEBPACK_IMPORTED_MODULE_4__.KeyboardManager(this.hostDocument);
        this.keys.onKeyPressedObservable.add(() => {
            // trigger a tool update (in case space is now pressed)
            // we should really have a state management system to handle this for us
            this.onToolChangeObservable.notifyObservers();
        });
    }
    get backgroundColor() {
        return this._backgroundColor;
    }
    get fromPG() {
        return this._fromPG;
    }
    set fromPG(value) {
        this._fromPG = value;
    }
    set backgroundColor(value) {
        this._backgroundColor = value;
        this.onBackgroundColorChangeObservable.notifyObservers();
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.WriteNumber("BackgroundColorR", value.r);
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.WriteNumber("BackgroundColorG", value.g);
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.WriteNumber("BackgroundColorB", value.b);
    }
    get outlines() {
        return this._outlines;
    }
    set outlines(value) {
        this._outlines = value;
        this.onOutlineChangedObservable.notifyObservers();
    }
    select(control) {
        if (this.keys.isKeyDown("control") && this.isMultiSelectable(control)) {
            const index = this.selectedControls.indexOf(control);
            if (index === -1) {
                this.setSelection([...this.selectedControls, control]);
            }
            else {
                this.setSelection(this.selectedControls.filter((node) => node !== control));
            }
        }
        else {
            this.setSelection([control]);
        }
    }
    setSelection(controls) {
        this.selectedControls = [...controls];
        this.onSelectionChangedObservable.notifyObservers();
    }
    _findParentControlInTexture(texture, searchedControl) {
        const searchList = [texture.rootContainer];
        while (searchList.length > 0) {
            const current = searchList.splice(0, 1)[0];
            const children = current.children;
            if (children.indexOf(searchedControl) !== -1) {
                return current;
            }
            for (const child of children) {
                if (child instanceof gui_2D_controls_container__WEBPACK_IMPORTED_MODULE_3__.Container) {
                    searchList.push(child);
                }
            }
        }
        return null;
    }
    deleteSelectedNodes() {
        for (const control of this.selectedControls) {
            const guiTextureParent = this._findParentControlInTexture(this.guiTexture, control);
            guiTextureParent?.removeControl(control);
            if (this.liveGuiTexture) {
                const allDescendants = control.getDescendants();
                for (const descendant of allDescendants) {
                    const liveGuiTextureDescendantParent = this._findParentControlInTexture(this.liveGuiTexture, descendant);
                    liveGuiTextureDescendantParent?.removeControl(descendant);
                    descendant.dispose();
                }
                const liveGuiTextureParent = this._findParentControlInTexture(this.liveGuiTexture, control);
                liveGuiTextureParent?.removeControl(control);
            }
            control.dispose();
        }
        this.setSelection([]);
    }
    isMultiSelectable(control) {
        if (this.selectedControls.length === 0)
            return true;
        if (this.selectedControls[0].parent === control.parent)
            return true;
        return false;
    }
    dispose() {
        this.keys.dispose();
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/guiEditor.js":
/*!**************************************************!*\
  !*** ../../../tools/guiEditor/dist/guiEditor.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1952274__) => {

"use strict";
__nested_webpack_require_1952274__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1952274__.d(__nested_webpack_exports__, {
/* harmony export */   GUIEditor: () => (/* binding */ GUIEditor)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1952274__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1952274__(/*! react-dom */ "../../../../node_modules/react-dom/index.js");
/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1952274__(/*! ./globalState */ "../../../tools/guiEditor/dist/globalState.js");
/* harmony import */ var _workbenchEditor__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1952274__(/*! ./workbenchEditor */ "../../../tools/guiEditor/dist/workbenchEditor.js");
/* harmony import */ var shared_ui_components_popupHelper__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1952274__(/*! shared-ui-components/popupHelper */ "../../../dev/sharedUiComponents/dist/popupHelper.js");





/**
 * Class used to create a gui editor
 */
class GUIEditor {
    /**
     * Show the gui editor
     * @param options defines the options to use to configure the gui editor
     * @param embed defines whether editor is being opened from the Playground
     */
    static async Show(options, embed) {
        let hostElement = options.hostElement;
        // if we are in a standalone window and we have some current state, just load the GUI from the snippet server, don't do anything else
        if (this._CurrentState && hostElement) {
            if (options.currentSnippetToken) {
                try {
                    this._CurrentState.workbench.loadFromSnippet(options.currentSnippetToken);
                }
                catch (error) {
                    //swallow and continue
                }
            }
            return;
        }
        if (!hostElement) {
            if (this._PopupWindow) {
                this._PopupWindow.close();
            }
            hostElement = (0,shared_ui_components_popupHelper__WEBPACK_IMPORTED_MODULE_4__.CreatePopup)("BABYLON.JS GUI EDITOR", { onWindowCreateCallback: (w) => (this._PopupWindow = w), width: 1200, height: 800 });
        }
        const globalState = new _globalState__WEBPACK_IMPORTED_MODULE_2__.GlobalState();
        if (options.liveGuiTexture) {
            globalState.liveGuiTexture = options.liveGuiTexture;
        }
        globalState.hostElement = hostElement;
        globalState.hostDocument = hostElement.ownerDocument;
        globalState.customSave = options.customSave;
        globalState.customLoad = options.customLoad;
        globalState.hostWindow = hostElement.ownerDocument.defaultView;
        globalState.registerEventListeners();
        const graphEditor = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_workbenchEditor__WEBPACK_IMPORTED_MODULE_3__.WorkbenchEditor, {
            globalState: globalState,
        });
        react_dom__WEBPACK_IMPORTED_MODULE_1__.render(graphEditor, hostElement);
        // create the middle workbench canvas
        if (!globalState.guiTexture) {
            globalState.workbench.createGUICanvas(embed);
            if (options.currentSnippetToken) {
                try {
                    await globalState.workbench.loadFromSnippet(options.currentSnippetToken);
                }
                catch (error) {
                    //swallow and continue
                }
            }
        }
        if (options.customLoadObservable) {
            options.customLoadObservable.add(() => {
                globalState.onResetRequiredObservable.notifyObservers();
                globalState.onBuiltObservable.notifyObservers();
            });
        }
        this._CurrentState = globalState;
        // Close the popup window when the page is refreshed or scene is disposed
        if (this._PopupWindow) {
            window.onbeforeunload = () => {
                if (this._PopupWindow) {
                    this._PopupWindow.close();
                }
            };
        }
        globalState.hostWindow.addEventListener("beforeunload", () => {
            globalState.onPopupClosedObservable.notifyObservers();
            globalState.dispose();
        });
    }
}
/** @internal */
GUIEditor._PopupWindow = null;


/***/ }),

/***/ "../../../tools/guiEditor/dist/guiNodeTools.js":
/*!*****************************************************!*\
  !*** ../../../tools/guiEditor/dist/guiNodeTools.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1956935__) => {

"use strict";
__nested_webpack_require_1956935__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1956935__.d(__nested_webpack_exports__, {
/* harmony export */   GUINodeTools: () => (/* binding */ GUINodeTools)
/* harmony export */ });
/* harmony import */ var gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1956935__(/*! gui/2D/controls/sliders/imageBasedSlider */ "gui/2D/controls/container");
/* harmony import */ var gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1956935__.n(gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__);


















class GUINodeTools {
    static CreateControlFromString(data) {
        let element;
        switch (data) {
            case "Slider":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Slider("Slider");
                element.isPointerBlocker = true;
                element.width = "120px";
                element.height = "30px";
                return element;
            case "Checkbox":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Checkbox("Checkbox");
                element.width = "20px";
                element.height = "20px";
                element.color = "#cccccc";
                return element;
            case "ColorPicker":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.ColorPicker("ColorPicker");
                element.isPointerBlocker = true;
                element.width = "10%";
                element.height = "10%";
                return element;
            case "Ellipse":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Ellipse("Ellipse");
                element.color = "#000000";
                element.background = "#cccccc";
                element.isPointerBlocker = true;
                element.thickness = 1;
                return element;
            case "Rectangle":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Rectangle("Rectangle");
                element.color = "#000000";
                element.background = "#cccccc";
                element.isPointerBlocker = true;
                element.thickness = 1;
                return element;
            case "Line":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Line("Line");
                element.x1 = 0;
                element.y1 = 1024;
                element.y2 = 512;
                element.x2 = 512;
                element.lineWidth = 2;
                element.isPointerBlocker = true;
                element.isHitTestVisible = true;
                element.color = "#000000";
                return element;
            case "TextBlock":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.TextBlock("Textblock");
                element.text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sed.";
                element.color = "#000000";
                element.fontSize = 20;
                element.resizeToFit = true;
                element.isPointerBlocker = true;
                return element;
            case "ImageButton":
                element = gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Button.CreateImageButton("Button", "Click Me", GUINodeTools.ImageControlDefaultUrl);
                element.background = "#333333";
                element.color = "#ffffff";
                element.isPointerBlocker = true;
                element.width = "120px";
                element.height = "40px";
                return element;
            case "VirtualKeyboard":
                element = gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.VirtualKeyboard.CreateDefaultLayout("VirtualKeyboard");
                element.addKeysRow(["1", "2", "3", "\u2190"]);
                return element;
            case "Image":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Image("Image", GUINodeTools.ImageControlDefaultUrl);
                element.width = "512px";
                element.height = "512px";
                element.autoScale = true;
                element.color = "transparent";
                element.isPointerBlocker = true;
                return element;
            case "ButtonImage":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Image("Image", GUINodeTools.ImageControlDefaultUrl);
                element.width = "100%";
                element.height = "100%";
                element.color = "transparent";
                element.isPointerBlocker = true;
                return element;
            case "InputText":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.InputText("InputText");
                element.maxWidth = 0.6;
                element.text = "Input Text";
                element.background = "#333333";
                element.color = "#ffffff";
                element.isPointerBlocker = true;
                element.width = "160px";
                element.height = "40px";
                return element;
            case "InputPassword":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.InputPassword("InputPassword");
                element.maxWidth = 0.6;
                element.text = "Password";
                element.background = "#333333";
                element.color = "#ffffff";
                element.isPointerBlocker = true;
                element.width = "160px";
                element.height = "40px";
                return element;
            case "Grid":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Grid("Grid");
                element.addColumnDefinition(1.0, false);
                element.addRowDefinition(1.0, false);
                element.isPointerBlocker = true;
                return element;
            case "DisplayGrid":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.DisplayGrid("DisplayGrid");
                return element;
            case "StackPanel":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.StackPanel("StackPanel");
                element.width = "100%";
                element.height = "100%";
                return element;
            case "ScrollViewer":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.ScrollViewer("ScrollViewer");
                element.width = 0.4;
                element.height = 0.4;
                element.background = "#CCCCCC";
                return element;
            case "ImageBasedSlider":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.ImageBasedSlider("ImageBasedSlider");
                element.isPointerBlocker = true;
                element.width = "120px";
                element.height = "30px";
                element.isThumbClamped = true;
                element.displayThumb = true;
                element.backgroundImage = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Image("Image", "https://playground.babylonjs.com/textures/gui/backgroundImage.png");
                element.valueBarImage = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Image("Image", "https://playground.babylonjs.com/textures/gui/valueImage.png");
                element.thumbImage = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Image("Image", "https://playground.babylonjs.com/textures/gui/thumb.png");
                return element;
            case "RadioButton":
                element = new gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.RadioButton("RadioButton");
                element.isPointerBlocker = true;
                element.width = "20px";
                element.height = "20px";
                element.color = "#CCCCCC";
                element.background = "#333333";
                return element;
            case "Button":
                element = gui_2D_controls_button__WEBPACK_IMPORTED_MODULE_0__.Button.CreateSimpleButton("Button", "Click Me");
                element.background = "#333333";
                element.color = "#ffffff";
                element.isPointerBlocker = true;
                element.width = "120px";
                element.height = "40px";
                return element;
            default:
                // eslint-disable-next-line no-throw-literal
                throw "Error: control type not recognized";
        }
    }
}
GUINodeTools.ImageControlDefaultUrl = "https://assets.babylonjs.com/textures/Checker_albedo.png";


/***/ }),

/***/ "../../../tools/guiEditor/dist/index.js":
/*!**********************************************!*\
  !*** ../../../tools/guiEditor/dist/index.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1965916__) => {

"use strict";
__nested_webpack_require_1965916__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1965916__.d(__nested_webpack_exports__, {
/* harmony export */   GUIEditor: () => (/* reexport safe */ _guiEditor__WEBPACK_IMPORTED_MODULE_0__.GUIEditor)
/* harmony export */ });
/* harmony import */ var _guiEditor__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1965916__(/*! ./guiEditor */ "../../../tools/guiEditor/dist/guiEditor.js");



/***/ }),

/***/ "../../../tools/guiEditor/dist/keyboardManager.js":
/*!********************************************************!*\
  !*** ../../../tools/guiEditor/dist/keyboardManager.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1966668__) => {

"use strict";
__nested_webpack_require_1966668__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1966668__.d(__nested_webpack_exports__, {
/* harmony export */   KeyboardManager: () => (/* binding */ KeyboardManager)
/* harmony export */ });
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1966668__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1966668__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);

class KeyboardManager {
    constructor(hostElement) {
        this._kdListener = (evt) => this._keyEvent(evt, true);
        this._kuListener = (evt) => this._keyEvent(evt, false);
        this._moveListener = (evt) => this._updateModifierKeys(evt);
        this._focusOutListener = () => this._clearKeys();
        this._keys = new Set();
        this._hostElement = hostElement;
        hostElement.addEventListener("keydown", this._kdListener);
        hostElement.addEventListener("keypress", this._kdListener);
        hostElement.addEventListener("keyup", this._kuListener);
        hostElement.addEventListener("mousemove", this._moveListener);
        hostElement.addEventListener("focusout", this._focusOutListener);
        this.onKeyPressedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
    }
    _keyEvent(event, isDown) {
        this._updateModifierKeys(event);
        switch (event.key) {
            case " ":
                this._setKeyDown("space", isDown);
                break;
        }
    }
    _updateModifierKeys(event) {
        this._setKeyDown("control", event.ctrlKey);
        this._setKeyDown("alt", event.altKey);
        this._setKeyDown("shift", event.shiftKey);
        this._setKeyDown("meta", event.metaKey);
    }
    _setKeyDown(key, down) {
        const isDown = this._keys.has(key);
        if (isDown !== down) {
            if (!down) {
                this._keys.delete(key);
            }
            else {
                this._keys.add(key);
            }
            this.onKeyPressedObservable.notifyObservers(key);
        }
    }
    _clearKeys() {
        for (const key of this._keys) {
            this._keys.delete(key);
            this.onKeyPressedObservable.notifyObservers(key);
        }
    }
    isKeyDown(key) {
        return this._keys.has(key);
    }
    dispose() {
        this._hostElement.removeEventListener("keydown", this._kdListener);
        this._hostElement.removeEventListener("keypress", this._kdListener);
        this._hostElement.removeEventListener("keyup", this._kuListener);
        this._hostElement.removeEventListener("mousemove", this._moveListener);
        this._hostElement.removeEventListener("focusout", this._focusOutListener);
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/legacy/legacy.js":
/*!******************************************************!*\
  !*** ../../../tools/guiEditor/dist/legacy/legacy.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1969818__) => {

"use strict";
__nested_webpack_require_1969818__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1969818__.d(__nested_webpack_exports__, {
/* harmony export */   GUIEditor: () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.GUIEditor)
/* harmony export */ });
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1969818__(/*! ../index */ "../../../tools/guiEditor/dist/index.js");
/* eslint-disable import/no-internal-modules */

const globalObject = typeof __nested_webpack_require_1969818__.g !== "undefined" ? __nested_webpack_require_1969818__.g : typeof window !== "undefined" ? window : undefined;
if (typeof globalObject !== "undefined") {
    globalObject.BABYLON = globalObject.BABYLON || {};
    globalObject.BABYLON.GuiEditor = _index__WEBPACK_IMPORTED_MODULE_0__.GUIEditor;
    globalObject.BABYLON.GUIEditor = _index__WEBPACK_IMPORTED_MODULE_0__.GUIEditor;
    // eslint-disable-next-line @typescript-eslint/naming-convention
    globalObject.GUIEDITOR = { GUIEditor: _index__WEBPACK_IMPORTED_MODULE_0__.GUIEditor };
}



/***/ }),

/***/ "../../../tools/guiEditor/dist/portal.js":
/*!***********************************************!*\
  !*** ../../../tools/guiEditor/dist/portal.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1971140__) => {

"use strict";
__nested_webpack_require_1971140__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1971140__.d(__nested_webpack_exports__, {
/* harmony export */   Portal: () => (/* binding */ Portal)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1971140__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1971140__(/*! react-dom */ "../../../../node_modules/react-dom/index.js");


class Portal extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
    render() {
        return react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal(this.props.children, this.props.globalState.hostElement);
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/tools.js":
/*!**********************************************!*\
  !*** ../../../tools/guiEditor/dist/tools.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1972154__) => {

"use strict";
__nested_webpack_require_1972154__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1972154__.d(__nested_webpack_exports__, {
/* harmony export */   Tools: () => (/* binding */ Tools)
/* harmony export */ });
/* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1972154__(/*! core/Maths/math */ "core/Misc/observable");
/* harmony import */ var core_Maths_math__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1972154__.n(core_Maths_math__WEBPACK_IMPORTED_MODULE_0__);

class Tools {
    static LookForItems(item, selectedEntities, firstIteration = true) {
        if (selectedEntities.length == 0) {
            return false;
        }
        if (!firstIteration && selectedEntities.includes(item)) {
            return true;
        }
        const children = item.getChildren ? item.getChildren() : item.children;
        if (children) {
            for (const child of children) {
                if (Tools.LookForItems(child, selectedEntities, false)) {
                    return true;
                }
            }
        }
        return false;
    }
    static _RecursiveRemoveHiddenMeshesAndHoistChildren(items) {
        const result = [];
        for (const i of items) {
            // If the mesh is hidden, add it's children that are not hidden, this will handle the case of bounding box parenting for bounding box gizmo
            if (i.reservedDataStore && i.reservedDataStore.hidden && i.getChildMeshes) {
                Tools._RecursiveRemoveHiddenMeshesAndHoistChildren(i.getChildMeshes()).forEach((m) => {
                    result.push(m);
                });
            }
            else if (!i.reservedDataStore || !i.reservedDataStore.hidden) {
                result.push(i);
            }
        }
        return result;
    }
    static SortAndFilter(parent, items) {
        if (!items) {
            return [];
        }
        const finalArray = Tools._RecursiveRemoveHiddenMeshesAndHoistChildren(items);
        if (parent && parent.reservedDataStore && parent.reservedDataStore.detachedChildren) {
            finalArray.push(...parent.reservedDataStore.detachedChildren);
        }
        return finalArray.reverse();
    }
    static GetCellInfo(grid, control) {
        const cellInfo = grid.getChildCellInfo(control);
        let rowNumber = parseInt(cellInfo.substring(0, cellInfo.search(":")));
        if (isNaN(rowNumber)) {
            rowNumber = 0;
        }
        let columnNumber = parseInt(cellInfo.substring(cellInfo.search(":") + 1));
        if (isNaN(columnNumber)) {
            columnNumber = 0;
        }
        return new core_Maths_math__WEBPACK_IMPORTED_MODULE_0__.Vector2(rowNumber, columnNumber);
    }
    static ReorderGrid(grid, index, control, cell) {
        const tags = [];
        const controls = [];
        const length = grid.children.length;
        for (let i = index; i < length; ++i) {
            const control = grid.children[index];
            controls.push(control);
            tags.push(Tools.GetCellInfo(grid, control));
            grid.removeControl(control);
        }
        grid.addControl(control, cell.x, cell.y);
        for (let i = 0; i < controls.length; ++i) {
            grid.addControl(controls[i], tags[i].x, tags[i].y);
        }
    }
}


/***/ }),

/***/ "../../../tools/guiEditor/dist/workbenchEditor.js":
/*!********************************************************!*\
  !*** ../../../tools/guiEditor/dist/workbenchEditor.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1975785__) => {

"use strict";
__nested_webpack_require_1975785__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1975785__.d(__nested_webpack_exports__, {
/* harmony export */   WorkbenchEditor: () => (/* binding */ WorkbenchEditor)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1975785__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1975785__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1975785__(/*! ./globalState */ "../../../tools/guiEditor/dist/globalState.js");
/* harmony import */ var _components_propertyTab_propertyTabComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1975785__(/*! ./components/propertyTab/propertyTabComponent */ "../../../tools/guiEditor/dist/components/propertyTab/propertyTabComponent.js");
/* harmony import */ var _portal__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1975785__(/*! ./portal */ "../../../tools/guiEditor/dist/portal.js");
/* harmony import */ var _components_log_logComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1975785__(/*! ./components/log/logComponent */ "../../../tools/guiEditor/dist/components/log/logComponent.js");
/* harmony import */ var core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1975785__(/*! core/Misc/dataStorage */ "core/Misc/observable");
/* harmony import */ var core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_1975785__.n(core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _guiNodeTools__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1975785__(/*! ./guiNodeTools */ "../../../tools/guiEditor/dist/guiNodeTools.js");
/* harmony import */ var _diagram_workbench__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1975785__(/*! ./diagram/workbench */ "../../../tools/guiEditor/dist/diagram/workbench.js");
/* harmony import */ var shared_ui_components_components_MessageDialog__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1975785__(/*! shared-ui-components/components/MessageDialog */ "../../../dev/sharedUiComponents/dist/components/MessageDialog.js");
/* harmony import */ var _components_sceneExplorer_sceneExplorerComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1975785__(/*! ./components/sceneExplorer/sceneExplorerComponent */ "../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorerComponent.js");
/* harmony import */ var _components_commandBarComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1975785__(/*! ./components/commandBarComponent */ "../../../tools/guiEditor/dist/components/commandBarComponent.js");
/* harmony import */ var _diagram_gizmoWrapper__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1975785__(/*! ./diagram/gizmoWrapper */ "../../../tools/guiEditor/dist/diagram/gizmoWrapper.js");
/* harmony import */ var _diagram_artBoard__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1975785__(/*! ./diagram/artBoard */ "../../../tools/guiEditor/dist/diagram/artBoard.js");
/* harmony import */ var _controlTypes__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1975785__(/*! ./controlTypes */ "../../../tools/guiEditor/dist/controlTypes.js");
/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1975785__(/*! ./main.scss */ "../../../tools/guiEditor/dist/main.scss");
/* harmony import */ var _scss_header_scss__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1975785__(/*! ./scss/header.scss */ "../../../tools/guiEditor/dist/scss/header.scss");
/* harmony import */ var _imgs_toolbarExpandIcon_svg__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1975785__(/*! ./imgs/toolbarExpandIcon.svg */ "../../../tools/guiEditor/dist/imgs/toolbarExpandIcon.svg");
/* harmony import */ var _imgs_toolbarCollapseIcon_svg__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_1975785__(/*! ./imgs/toolbarCollapseIcon.svg */ "../../../tools/guiEditor/dist/imgs/toolbarCollapseIcon.svg");



















class WorkbenchEditor extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    componentDidMount() {
        if (navigator.userAgent.indexOf("Mobile") !== -1) {
            (this.props.globalState.hostDocument || document).querySelector(".blocker").style.visibility = "visible";
        }
        document.addEventListener("keydown", this.addToolControls);
        document.addEventListener("keyup", this.removePressToolControls);
    }
    componentWillUnmount() {
        document.removeEventListener("keydown", this.addToolControls);
        document.removeEventListener("keyup", this.removePressToolControls);
        if (this._onErrorMessageObserver) {
            this.props.globalState.onErrorMessageDialogRequiredObservable.remove(this._onErrorMessageObserver);
        }
    }
    constructor(props) {
        super(props);
        this._leftWidth = core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__.DataStorage.ReadNumber("LeftWidth", 200);
        this._rightWidth = core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__.DataStorage.ReadNumber("RightWidth", 300);
        this.addToolControls = (evt) => {
            // If the event target is a text input, we're currently focused on it, and the user
            // just wants to type normal text
            if (evt.target && evt.target instanceof HTMLInputElement && evt.target.type === "text") {
                return;
            }
            switch (evt.key) {
                case "s": //select
                case "S":
                    this.props.globalState.tool = _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.SELECT;
                    break;
                case "p": //pan
                case "P":
                case " ":
                    this.props.globalState.tool = _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.PAN;
                    break;
                case "z": //zoom
                case "Z":
                    this.props.globalState.tool = _globalState__WEBPACK_IMPORTED_MODULE_2__.GUIEditorTool.ZOOM;
                    break;
                case "g": //outlines
                case "G":
                    this.props.globalState.outlines = !this.props.globalState.outlines;
                    break;
                case "f": //fit to window
                case "F":
                    this.props.globalState.onFitControlsToWindowObservable.notifyObservers();
                    break;
            }
        };
        this.removePressToolControls = (evt) => {
            if (evt.key === " ") {
                this.props.globalState.restorePreviousTool();
            }
        };
        this.handlePopUp = () => {
            this.setState({
                showPreviewPopUp: true,
            });
            this.props.globalState.hostWindow.addEventListener("beforeunload", this.handleClosingPopUp);
        };
        this.handleClosingPopUp = () => {
            this._popUpWindow.close();
        };
        this._rootRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this.state = {
            showPreviewPopUp: false,
            toolbarExpand: true,
            message: "",
        };
        this.props.globalState.onBackgroundColorChangeObservable.add(() => this.forceUpdate());
        this.props.globalState.onDropObservable.add(() => {
            if (this._draggedItem != null) {
                this.props.globalState.draggedControl = this.onCreate(this._draggedItem);
            }
            this._draggedItem = null;
        });
        this._onErrorMessageObserver = this.props.globalState.onErrorMessageDialogRequiredObservable.add((message) => {
            this.setState({ message });
        });
    }
    showWaitScreen() {
        this.props.globalState.hostDocument.querySelector(".wait-screen")?.classList.remove("hidden");
    }
    hideWaitScreen() {
        this.props.globalState.hostDocument.querySelector(".wait-screen")?.classList.add("hidden");
    }
    onPointerDown(evt) {
        if (evt.button !== 0)
            return;
        this._moveInProgress = true;
        evt.currentTarget.setPointerCapture(evt.pointerId);
    }
    onPointerUp(evt) {
        if (evt.button !== 0)
            return;
        this._moveInProgress = false;
        evt.currentTarget.releasePointerCapture(evt.pointerId);
    }
    resizeColumns(evt, forLeft = true) {
        if (!this._moveInProgress) {
            return;
        }
        const rootElement = evt.currentTarget.ownerDocument.getElementById("gui-editor-workbench-root");
        const maxWidth = this.props.globalState.hostWindow.innerWidth;
        if (forLeft) {
            this._leftWidth = Math.max(150, Math.min(maxWidth - this._rightWidth, evt.clientX - this._rootRef.current.clientLeft));
            core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__.DataStorage.WriteNumber("LeftWidth", this._leftWidth);
        }
        else {
            this._rightWidth = Math.max(250, Math.min(maxWidth - this._leftWidth, this._rootRef.current.clientLeft + this._rootRef.current.clientWidth - evt.clientX));
            core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_6__.DataStorage.WriteNumber("RightWidth", this._rightWidth);
        }
        rootElement.style.gridTemplateColumns = this.buildColumnLayout();
        this.props.globalState.onWindowResizeObservable.notifyObservers();
    }
    buildColumnLayout() {
        return `${this._leftWidth}px 1fr ${this._rightWidth}px`;
    }
    switchExpandedState() {
        this.setState({ toolbarExpand: !this.state.toolbarExpand });
        if (!this.state.toolbarExpand) {
            this._leftWidth = this._leftWidth - 50;
        }
        else {
            this._leftWidth = this._leftWidth + 50;
        }
    }
    render() {
        const classForElement = this.state.toolbarExpand ? "left-panel" : "left-panel expand";
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_portal__WEBPACK_IMPORTED_MODULE_4__.Portal, { globalState: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "ge-header", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "command-bar", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_commandBarComponent__WEBPACK_IMPORTED_MODULE_11__.CommandBarComponent, { globalState: this.props.globalState }) }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "gui-editor-workbench-root", style: {
                        gridTemplateColumns: this.buildColumnLayout(),
                    }, onMouseDown: (evt) => {
                        if (evt.target.nodeName === "INPUT") {
                            return;
                        }
                    }, ref: this._rootRef, onPointerUp: (evt) => this.onPointerUp(evt), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: classForElement, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_sceneExplorer_sceneExplorerComponent__WEBPACK_IMPORTED_MODULE_10__.SceneExplorerComponent, { globalState: this.props.globalState, noExpand: true }), this.createToolbar(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "leftGrab", onPointerDown: (evt) => this.onPointerDown(evt), onPointerMove: (evt) => this.resizeColumns(evt) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_sceneExplorer_sceneExplorerComponent__WEBPACK_IMPORTED_MODULE_10__.SceneExplorerComponent, { globalState: this.props.globalState, noExpand: true }), this.createToolbar(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "diagram-container", onDrop: (event) => {
                                event.preventDefault();
                                this.props.globalState.onDropObservable.notifyObservers();
                                this.props.globalState.onParentingChangeObservable.notifyObservers(null);
                            }, onDragOver: (event) => {
                                event.preventDefault();
                            }, style: {
                                backgroundColor: this.props.globalState.backgroundColor.toHexString(),
                            }, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_diagram_artBoard__WEBPACK_IMPORTED_MODULE_13__.ArtBoardComponent, { globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_diagram_workbench__WEBPACK_IMPORTED_MODULE_8__.WorkbenchComponent, { ref: "workbenchCanvas", globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_diagram_gizmoWrapper__WEBPACK_IMPORTED_MODULE_12__.GizmoWrapper, { globalState: this.props.globalState })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "right-panel", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "rightGrab", onPointerDown: (evt) => this.onPointerDown(evt), onPointerMove: (evt) => this.resizeColumns(evt, false) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_propertyTab_propertyTabComponent__WEBPACK_IMPORTED_MODULE_3__.PropertyTabComponent, { globalState: this.props.globalState })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_log_logComponent__WEBPACK_IMPORTED_MODULE_5__.LogComponent, { globalState: this.props.globalState })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_components_MessageDialog__WEBPACK_IMPORTED_MODULE_9__.MessageDialog, { message: this.state.message, isError: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "blocker", children: "GUI Editor runs only on desktop" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "wait-screen hidden", children: "Processing...please wait" })] }));
    }
    onCreate(value) {
        const guiElement = _guiNodeTools__WEBPACK_IMPORTED_MODULE_7__.GUINodeTools.CreateControlFromString(value);
        const newGuiNode = this.props.globalState.workbench.appendBlock(guiElement);
        this.props.globalState.setSelection([newGuiNode]);
        this.props.globalState.onPointerUpObservable.notifyObservers(null);
        this.forceUpdate();
        return newGuiNode;
    }
    createBlackLine() {
        const icon = this.state.toolbarExpand ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_toolbarExpandIcon_svg__WEBPACK_IMPORTED_MODULE_17__, className: "icon" }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_toolbarCollapseIcon_svg__WEBPACK_IMPORTED_MODULE_18__, className: "icon" });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "blackLine", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "arrow", onClick: () => this.switchExpandedState(), children: icon }) }));
    }
    createToolbarHelper(ct) {
        return ct.map((type) => {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "toolbar-label", onDragStart: () => {
                    this._draggedItem = type.className;
                }, onClick: () => {
                    this.onCreate(type.className);
                }, title: type.className, children: type.icon && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "toolbar-icon", draggable: true, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: type.icon, alt: type.className, width: "40px", height: "40px" }) })) }, type.className));
        });
    }
    createToolbar() {
        if (this.state.toolbarExpand) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "toolbarGrab", children: [this.createBlackLine(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "toolbar-content-sub1", children: this.createToolbarHelper(_controlTypes__WEBPACK_IMPORTED_MODULE_14__.ControlTypes) })] }) }));
        }
        else {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "toolbarGrab expanded", children: [this.createBlackLine(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "toolbar-content-sub1", children: [this.createToolbarHelper(_controlTypes__WEBPACK_IMPORTED_MODULE_14__.ControlTypes.slice(0, Math.ceil(_controlTypes__WEBPACK_IMPORTED_MODULE_14__.ControlTypes.length / 2))), this.createToolbarHelper(_controlTypes__WEBPACK_IMPORTED_MODULE_14__.ControlTypes.slice(Math.ceil(_controlTypes__WEBPACK_IMPORTED_MODULE_14__.ControlTypes.length / 2)))] })] }) }));
        }
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1993155__) => {

"use strict";
__nested_webpack_require_1993155__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1993155__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1993155__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1993155__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1993155__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1993155__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1993155__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1993155__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1993155__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1993155__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1993155__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_1993155__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1993155__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_1993155__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1993155__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./colorPicker.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/log/log.scss":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/log/log.scss ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1999420__) => {

"use strict";
__nested_webpack_require_1999420__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1999420__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1999420__(/*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1999420__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1999420__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1999420__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1999420__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1999420__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1999420__(/*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1999420__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1999420__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_1999420__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1999420__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_1999420__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_log_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1999420__(/*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./log.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/log/log.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_log_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_log_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_log_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_log_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss":
/*!*****************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2005713__) => {

"use strict";
__nested_webpack_require_2005713__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2005713__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2005713__(/*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2005713__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2005713__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2005713__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2005713__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2005713__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2005713__(/*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2005713__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2005713__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2005713__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2005713__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2005713__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_propertyTab_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2005713__(/*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./propertyTab.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_propertyTab_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_propertyTab_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_propertyTab_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_propertyTab_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss":
/*!*********************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2012086__) => {

"use strict";
__nested_webpack_require_2012086__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2012086__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2012086__(/*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2012086__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2012086__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2012086__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2012086__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2012086__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2012086__(/*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2012086__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2012086__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2012086__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2012086__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2012086__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2012086__(/*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./sceneExplorer.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss":
/*!******************************************************************!*\
  !*** ../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2018415__) => {

"use strict";
__nested_webpack_require_2018415__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2018415__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2018415__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2018415__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2018415__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2018415__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2018415__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2018415__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2018415__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2018415__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2018415__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2018415__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2018415__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2018415__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_workbenchCanvas_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2018415__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./workbenchCanvas.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_workbenchCanvas_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_workbenchCanvas_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_workbenchCanvas_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_workbenchCanvas_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../tools/guiEditor/dist/main.scss":
/*!***********************************************!*\
  !*** ../../../tools/guiEditor/dist/main.scss ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2024641__) => {

"use strict";
__nested_webpack_require_2024641__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2024641__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2024641__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2024641__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2024641__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2024641__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2024641__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2024641__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2024641__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2024641__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2024641__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2024641__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2024641__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2024641__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_main_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2024641__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./main.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/main.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_main_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_main_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_main_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_main_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../tools/guiEditor/dist/scss/commandBar.scss":
/*!**********************************************************!*\
  !*** ../../../tools/guiEditor/dist/scss/commandBar.scss ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2030802__) => {

"use strict";
__nested_webpack_require_2030802__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2030802__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2030802__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2030802__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2030802__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2030802__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2030802__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2030802__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2030802__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2030802__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2030802__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2030802__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2030802__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2030802__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_commandBar_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2030802__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./commandBar.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/commandBar.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_commandBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_commandBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_commandBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_commandBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../tools/guiEditor/dist/scss/header.scss":
/*!******************************************************!*\
  !*** ../../../tools/guiEditor/dist/scss/header.scss ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2037018__) => {

"use strict";
__nested_webpack_require_2037018__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2037018__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2037018__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2037018__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2037018__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2037018__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2037018__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2037018__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2037018__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2037018__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2037018__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2037018__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2037018__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2037018__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_header_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2037018__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./header.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/header.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_header_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_header_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_header_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_header_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/Button.module.scss":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/Button.module.scss ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2043286__) => {

"use strict";
__nested_webpack_require_2043286__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2043286__.d(__nested_webpack_exports__, {
/* harmony export */   active: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__.active),
/* harmony export */   button: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__.button),
/* harmony export */   dark: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__.dark),
/* harmony export */   "dark-active-background": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["dark-active-background"]),
/* harmony export */   "dark-background": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["dark-background"]),
/* harmony export */   "dark-color": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["dark-color"]),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   light: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__.light),
/* harmony export */   "light-active-background": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["light-active-background"]),
/* harmony export */   "light-background": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["light-background"]),
/* harmony export */   "light-color": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["light-color"]),
/* harmony export */   "light-disabled-background": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["light-disabled-background"]),
/* harmony export */   small: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__.small),
/* harmony export */   smaller: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__.smaller),
/* harmony export */   wide: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__.wide)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2043286__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2043286__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2043286__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2043286__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2043286__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2043286__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2043286__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2043286__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2043286__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2043286__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2043286__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2043286__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2043286__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./Button.module.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Button.module.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Button_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/Icon.module.scss":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/Icon.module.scss ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2053111__) => {

"use strict";
__nested_webpack_require_2053111__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2053111__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   light: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Icon_module_scss__WEBPACK_IMPORTED_MODULE_6__.light)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2053111__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2053111__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2053111__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2053111__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2053111__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2053111__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2053111__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2053111__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2053111__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2053111__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2053111__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2053111__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Icon_module_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2053111__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./Icon.module.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Icon.module.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Icon_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Icon_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Icon_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_Icon_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/MessageDialog.module.scss":
/*!*********************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/MessageDialog.module.scss ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2059688__) => {

"use strict";
__nested_webpack_require_2059688__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2059688__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   dialog: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__.dialog),
/* harmony export */   "dialog-button-ok": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__["dialog-button-ok"]),
/* harmony export */   "dialog-buttons": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__["dialog-buttons"]),
/* harmony export */   "dialog-container": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__["dialog-container"]),
/* harmony export */   "dialog-message": () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__["dialog-message"]),
/* harmony export */   error: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__.error)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2059688__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2059688__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2059688__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2059688__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2059688__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2059688__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2059688__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2059688__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2059688__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2059688__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2059688__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2059688__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2059688__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./MessageDialog.module.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/MessageDialog.module.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_MessageDialog_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.module.scss":
/*!***************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.module.scss ***!
  \***************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2067673__) => {

"use strict";
__nested_webpack_require_2067673__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2067673__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   input: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_6__.input),
/* harmony export */   invalid: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_6__.invalid),
/* harmony export */   line: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_6__.line),
/* harmony export */   valid: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_6__.valid)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2067673__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2067673__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2067673__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2067673__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2067673__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2067673__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2067673__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2067673__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2067673__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2067673__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2067673__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2067673__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2067673__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./TextInputWithSubmit.module.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.module.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_TextInputWithSubmit_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.module.scss":
/*!**********************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.module.scss ***!
  \**********************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2075168__) => {

"use strict";
__nested_webpack_require_2075168__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2075168__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   optionsLine: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_6__.optionsLine),
/* harmony export */   optionsSelect: () => (/* reexport safe */ _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_6__.optionsSelect)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2075168__(/*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2075168__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2075168__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2075168__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2075168__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2075168__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2075168__(/*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2075168__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2075168__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2075168__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2075168__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2075168__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2075168__(/*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./OptionsLineComponent.module.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.module.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_4_use_2_OptionsLineComponent_module_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/LineSpacingIcon.svg":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/LineSpacingIcon.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMjEuMjEsNy44OCwyMi44Myw5LjVhLjYxLjYxLDAsMCwxLS44Ni44NmwtLjU4LS41OHYzLjhhLjYxLjYxLDAsMCwxLS42MS42MS42MS42MSwwLDAsMS0uNjEtLjYxVjkuNzhsLS41OC41OGEuNjEuNjEsMCwwLDEtLjg2LS44NmwxLjYyLTEuNjJhLjYuNiwwLDAsMSwuNDMtLjE4aDBhLjU5LjU5LDAsMCwxLC4yMywwQS42My42MywwLDAsMSwyMS4yMSw3Ljg4WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik03LDkuOTNhLjYxLjYxLDAsMCwxLC42MS0uNjFoNi44OWEuNjEuNjEsMCwwLDEsLjYxLjYxLjYxLjYxLDAsMCwxLS42MS42MUg3LjZBLjYxLjYxLDAsMCwxLDcsOS45M1oiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNNywxNS4yYS42MS42MSwwLDAsMSwuNjEtLjYxaDkuMzNhLjYxLjYxLDAsMCwxLC42LjYxLjYuNiwwLDAsMS0uNi42MUg3LjZBLjYxLjYxLDAsMCwxLDcsMTUuMloiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNNy42LDE5Ljg3YS42MS42MSwwLDEsMCwwLDEuMjFoNi44OWEuNjEuNjEsMCwxLDAsMC0xLjIxWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0yMC4xNywyMC4yMnYtMy44YS42MS42MSwwLDAsMSwuNjEtLjYxLjYxLjYxLDAsMCwxLC42MS42MXYzLjhsLjU4LS41OGEuNjEuNjEsMCwwLDEsLjg2Ljg2bC0xLjYyLDEuNjJhLjYzLjYzLDAsMCwxLS4yLjEzLjY1LjY1LDAsMCwxLS4yLjA1aDBhLjU5LjU5LDAsMCwxLS4yMy0uMDUuNTMuNTMsMCwwLDEtLjItLjEzTDE4LjczLDIwLjVhLjYxLjYxLDAsMCwxLC44Ni0uODZaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/addGridElementDark.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/addGridElementDark.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsNi45MUE4LjA5LDguMDksMCwxLDEsNi45MSwxNSw4LjA5LDguMDksMCwwLDEsMTUsNi45MVptMCwxLjIyQTYuODcsNi44NywwLDEsMCwyMS44NywxNSw2Ljg2LDYuODYsMCwwLDAsMTUsOC4xM1pNMTUsMTFhLjYxLjYxLDAsMCwxLC42MS42djIuODNoMi44M2EuNjEuNjEsMCwwLDEsMCwxLjIySDE1LjYxdjIuODNhLjYxLjYxLDAsMCwxLTEuMjIsMFYxNS42MUgxMS41NmEuNjEuNjEsMCwwLDEsMC0xLjIyaDIuODNWMTEuNTZBLjYxLjYxLDAsMCwxLDE1LDExWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/addImageButtonIcon.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/addImageButtonIcon.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTguNzQsMTUuNDNhNC40Nyw0LjQ3LDAsMSwxLTQuNDgsNC40N0E0LjQ3LDQuNDcsMCwwLDEsMTguNzQsMTUuNDNabTAsMS42MmgtLjA4YS40MS40MSwwLDAsMC0uMzIuMzJ2Mi4xMUgxNi4yMmEuNDEuNDEsMCwwLDAtLjMyLjMyVjIwYS40LjQsMCwwLDAsLjMyLjMzaDIuMTF2Mi4xMWEuNC40LDAsMCwwLC4zMy4zM2guMTRhLjQuNCwwLDAsMCwuMzMtLjMzVjIwLjNoMi4xMWEuNC40LDAsMCwwLC4zMy0uMzN2LS4xNWEuNC40LDAsMCwwLS4zMy0uMzJIMTkuMTRWMTcuMzhhLjQuNCwwLDAsMC0uMzMtLjMyWm0tMi04LjU3YTEuODQsMS44NCwwLDEsMCwxLjg0LDEuODRBMS44MywxLjgzLDAsMCwwLDE2Ljc3LDguNDhabTAsMi40NWEuNjEuNjEsMCwwLDEtLjYxLS42MS42Mi42MiwwLDEsMSwxLjIzLDBBLjYxLjYxLDAsMCwxLDE2Ljc3LDEwLjkzWm0tMy41MSw5YTUuNDQsNS40NCwwLDAsMSwuMDctLjgySDkuNDRBMS4yOCwxLjI4LDAsMCwxLDksMTlsNC44LTQuNjlhLjYyLjYyLDAsMCwxLC43OS4wNmwxLjA3LDEuMDVhNS4zNiw1LjM2LDAsMCwxLDEuMTMtLjYxbC0xLjM0LTEuMzEtLjExLS4xYTEuODMsMS44MywwLDAsMC0yLjQ2LjFMOC4xLDE4LjEzQTEuMjgsMS4yOCwwLDAsMSw4LDE3LjY1VjguMjhBMS40MywxLjQzLDAsMCwxLDkuNDQsNi44NWg5LjM3YTEuNDMsMS40MywwLDAsMSwxLjQzLDEuNDN2Ni4zNmE1LjI3LDUuMjcsMCwwLDEsMS4yMi41MlY4LjI4YTIuNjUsMi42NSwwLDAsMC0yLjY1LTIuNjVIOS40NEEyLjY1LDIuNjUsMCwwLDAsNi43OSw4LjI4djkuMzdBMi42NSwyLjY1LDAsMCwwLDkuNDQsMjAuM2gzLjg1QzEzLjI4LDIwLjE3LDEzLjI2LDIwLDEzLjI2LDE5LjlaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/addTextButtonIcon.svg":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/addTextButtonIcon.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTguMjMsMTQuNTdhNC40OCw0LjQ4LDAsMSwxLTQuNDcsNC40OEE0LjQ4LDQuNDgsMCwwLDEsMTguMjMsMTQuNTdabTAsMS42M2gtLjA3YS40LjQsMCwwLDAtLjMzLjMydjIuMTFIMTUuNzFhLjQxLjQxLDAsMCwwLS4zMi4zMnYuMTVhLjQyLjQyLDAsMCwwLC4zMi4zM2gyLjExdjIuMTFhLjQuNCwwLDAsMCwuMzMuMzNoLjE0YS40LjQsMCwwLDAsLjMzLS4zM1YxOS40NWgyLjExYS40Mi40MiwwLDAsMCwuMzItLjMzVjE5YS40MS40MSwwLDAsMC0uMzItLjMySDE4LjY0VjE2LjUzYS40LjQsMCwwLDAtLjMzLS4zMlptLTUuNDcsMi44NWE1LjQ0LDUuNDQsMCwwLDEsLjgyLTIuODhWNy43aDMuODV2MWEuNjEuNjEsMCwwLDAsMS4yMiwwVjcuMDlBLjYxLjYxLDAsMCwwLDE4LDYuNDhINy45MWEuNjEuNjEsMCwwLDAtLjYxLjYxVjguNzFhLjYxLjYxLDAsMSwwLDEuMjEsMHYtMWgzLjg1VjE4LjI0SDExLjE1YS42MS42MSwwLDEsMCwwLDEuMjFoMS42M0MxMi43NywxOS4zMiwxMi43NiwxOS4xOCwxMi43NiwxOS4wNVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/alignVerticalIcon.svg":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/alignVerticalIcon.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE0LjM3LDIyLjcydi0xLjA0aC0yLjA5Yy0xLjA0LDAtMS44OC0uODQtMS44OC0xLjg4di0yLjA5YzAtMS4wNCwuODQtMS44OCwxLjg4LTEuODhoMi4wOXYtMS42N2gtMy43NmMtMS4wNCwwLTEuODgtLjg0LTEuODgtMS44OHYtMi4wOWMwLTEuMDQsLjg0LTEuODgsMS44OC0xLjg4aDMuNzZ2LTEuMDRjMC0uMzUsLjI4LS42MywuNjMtLjYzcy42MywuMjgsLjYzLC42M3YxLjA0aDMuNzZjMS4wNCwwLDEuODgsLjg0LDEuODgsMS44OHYyLjA5YzAsMS4wNC0uODQsMS44OC0xLjg4LDEuODhoLTMuNzZ2MS42N2gyLjA5YzEuMDQsMCwxLjg4LC44NCwxLjg4LDEuODh2Mi4wOWMwLDEuMDQtLjg0LDEuODgtMS44OCwxLjg4aC0yLjA5djEuMDRjMCwuMzUtLjI4LC42My0uNjMsLjYzcy0uNjMtLjI4LS42My0uNjNabTMuMzQtMi4zYy4zNSwwLC42My0uMjgsLjYzLS42M3YtMi4wOWMwLS4zNS0uMjgtLjYzLS42My0uNjNoLTUuNDNjLS4zNSwwLS42MywuMjgtLjYzLC42M3YyLjA5YzAsLjM1LC4yOCwuNjMsLjYzLC42M2g1LjQzWm0xLjY3LTcuNTJjLjM1LDAsLjYzLS4yOCwuNjMtLjYzdi0yLjA5YzAtLjM1LS4yOC0uNjMtLjYzLS42M0gxMC42MmMtLjM1LDAtLjYzLC4yOC0uNjMsLjYzdjIuMDljMCwuMzUsLjI4LC42MywuNjMsLjYzaDguNzdaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/alphaIcon.svg":
/*!***************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/alphaIcon.svg ***!
  \***************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNNywxNC40YTgsOCwwLDAsMSwxNiwwaDBWMTVBOCw4LDAsMCwxLDcsMTV2LS42Wm04LTYuMjFBNi44LDYuOCwwLDAsMCw4LjIyLDE0LjRIMjEuNzhBNi44LDYuOCwwLDAsMCwxNSw4LjE5WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/animationSheetIcon.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/animationSheetIcon.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiB2aWV3Qm94PSIwIDAgMzAgMzAiPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik04LjU2LDguNTZoOC44NUExLjYxLDEuNjEsMCwwLDEsMTksMTAuMTdWMTUuOGExLjYxLDEuNjEsMCwwLDEtMS42MSwxLjYxSDguNTZBMS42MSwxLjYxLDAsMCwxLDcsMTUuOFYxMC4xN0ExLjYxLDEuNjEsMCwwLDEsOC41Niw4LjU2Wm04Ljg1LDEuMjFIOC41NmEuNC40LDAsMCwwLS40LjRWMTUuOGEuNC40LDAsMCwwLC40LjQxaDguODVhLjQxLjQxLDAsMCwwLC40MS0uNDFWMTAuMTdBLjQuNCwwLDAsMCwxNy40MSw5Ljc3Wk05LDE4LjIyYTEuNjIsMS42MiwwLDAsMCwxLjU2LDEuMjFoNy4yNUEzLjIyLDMuMjIsMCwwLDAsMjEsMTYuMjF2LTRhMS42MiwxLjYyLDAsMCwwLTEuMjEtMS41NnY1LjU5YTIsMiwwLDAsMS0yLDJabTIsMmExLjYxLDEuNjEsMCwwLDAsMS41NiwxLjIxaDUuODNhNC42Myw0LjYzLDAsMCwwLDQuNjMtNC42M1YxNC4yYTEuNiwxLjYsMCwwLDAtMS4yMS0xLjU2djQuMTdhMy40MiwzLjQyLDAsMCwxLTMuNDIsMy40MloiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/autoResizeIcon.svg":
/*!********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/autoResizeIcon.svg ***!
  \********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuNzIsNy42N2gtNS4zYS42Mi42MiwwLDAsMC0uNjEuNjEuNjEuNjEsMCwwLDAsLjYxLjYxaDMuODJMMTYsMTMuMTRhLjYyLjYyLDAsMCwwLC44Ny44N2w0LjI1LTQuMjV2My44MmEuNjEuNjEsMCwwLDAsLjYxLjYxLjYyLjYyLDAsMCwwLC42MS0uNjFWOC4yOEEuNjIuNjIsMCwwLDAsMjEuNzIsNy42N1oiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0yMS43MiwxNS44MWEuNjEuNjEsMCwwLDAtLjYxLjYydjMuMjVhMS40MywxLjQzLDAsMCwxLTEuNDMsMS40M0gxNVYxNy4yNEEyLjI0LDIuMjQsMCwwLDAsMTIuNzYsMTVIOC44OVYxMC4zMmExLjQzLDEuNDMsMCwwLDEsMS40My0xLjQzaDMuMjVhLjYxLjYxLDAsMCwwLC42Mi0uNjEuNjIuNjIsMCwwLDAtLjYyLS42MUgxMC4zMmEyLjY1LDIuNjUsMCwwLDAtMi42NSwyLjY1djkuMzZhMi42NSwyLjY1LDAsMCwwLDIuNjUsMi42NWg5LjM2YTIuNjUsMi42NSwwLDAsMCwyLjY1LTIuNjVWMTYuNDNBLjYyLjYyLDAsMCwwLDIxLjcyLDE1LjgxWm0tNy45NCw1LjNIMTAuMzJhMS40MywxLjQzLDAsMCwxLTEuNDMtMS40M1YxNi4yMmgzLjg3YTEsMSwwLDAsMSwxLDFaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/autoStretchHeightIcon.svg":
/*!***************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/autoStretchHeightIcon.svg ***!
  \***************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTEyLjE1LDEyLjEzYy0uMi0uMi0uMi0uNTEsMC0uNzFsMi41LTIuNWMuMi0uMiwuNTEtLjIsLjcxLDBsMi41LDIuNWMuMiwuMiwuMiwuNTEsMCwuNzEtLjIsLjItLjUxLC4yLS43MSwwbC0xLjY1LTEuNjV2My4zNmMwLC4yOC0uMjIsLjUtLjUsLjVzLS41LS4yMi0uNS0uNXYtMy4zNmwtMS42NSwxLjY1Yy0uMiwuMi0uNTEsLjItLjcxLDBabS0zLjAzLDEwLjQ2YzAtLjI2LC4xOS0uNDcsLjQ0LS41aDEwLjgxYy4yOCwwLC41LC4yMiwuNSwuNXMtLjE5LC40Ny0uNDQsLjVIOS42M2MtLjI4LDAtLjUtLjIyLS41LS41Wm0wLTE1LjE3YzAtLjI2LC4xOS0uNDcsLjQ0LS41aDEwLjgxYy4yOCwwLC41LC4yMiwuNSwuNSwwLC4yNi0uMTksLjQ3LS40NCwuNUg5LjYzYy0uMjgsMC0uNS0uMjItLjUtLjVabTMuNzMsMTAuNTZsMS42NSwxLjY1di0zLjM2YzAtLjI4LC4yMi0uNSwuNS0uNXMuNSwuMjIsLjUsLjV2My4zNmwxLjY1LTEuNjVjLjItLjIsLjUxLS4yLC43MSwwLC4yLC4yLC4yLC41MSwwLC43MWwtMi41LDIuNWMtLjIsLjItLjUxLC4yLS43MSwwbC0yLjUtMi41Yy0uMi0uMi0uMi0uNTEsMC0uNzEsLjItLjIsLjUxLS4yLC43MSwwWiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/autoStretchWidthIcon.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/autoStretchWidthIcon.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE3Ljg3LDEyLjE1Yy4yLS4yLC41MS0uMiwuNzEsMGwyLjUsMi41Yy4yLC4yLC4yLC41MSwwLC43MWwtMi41LDIuNWMtLjIsLjItLjUxLC4yLS43MSwwLS4yLS4yLS4yLS41MSwwLS43MWwxLjY1LTEuNjVoLTMuMzZjLS4yOCwwLS41LS4yMi0uNS0uNXMuMjItLjUsLjUtLjVoMy4zNmwtMS42NS0xLjY1Yy0uMi0uMi0uMi0uNTEsMC0uNzFabS0xMC40Ni0zLjAzYy4yNiwwLC40NywuMTksLjUsLjQ0djEwLjgxYzAsLjI4LS4yMiwuNS0uNSwuNS0uMjYsMC0uNDctLjE5LS41LS40NFY5LjYzYzAtLjI4LC4yMi0uNSwuNS0uNVptMTUuMTcsMGMuMjYsMCwuNDcsLjE5LC41LC40NHYxMC44MWMwLC4yOC0uMjIsLjUtLjUsLjUtLjI2LDAtLjQ3LS4xOS0uNS0uNDRWOS42M2MwLS4yOCwuMjItLjUsLjUtLjVabS0xMC41NiwzLjczbC0xLjY1LDEuNjVoMy4zNmMuMjgsMCwuNSwuMjIsLjUsLjUsMCwuMjgtLjIyLC41LS41LC41aC0zLjM2bDEuNjUsMS42NWMuMiwuMiwuMiwuNTEsMCwuNzEtLjIsLjItLjUxLC4yLS43MSwwbC0yLjUtMi41Yy0uMi0uMi0uMi0uNTEsMC0uNzFsMi41LTIuNWMuMi0uMiwuNTEtLjIsLjcxLDAsLjIsLjIsLjIsLjUxLDAsLjcxWiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/barOffsetIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/barOffsetIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNOS4xNSwxMi40MmExLjQyLDEuNDIsMCwwLDAtMS40MSwxLjQydjIuMzJhMS40MiwxLjQyLDAsMCwwLDEuNDEsMS40MmgxMS43YTEuNDIsMS40MiwwLDAsMCwxLjQxLTEuNDJWMTMuODRhMS40MiwxLjQyLDAsMCwwLTEuNDEtMS40MlpNOSwxMy44NGEuMjEuMjEsMCwwLDEsLjItLjIxaDExLjdhLjIxLjIxLDAsMCwxLC4yLjIxdjIuMzJhLjIxLjIxLDAsMCwxLS4yLjIxSDkuMTVhLjIxLjIxLDAsMCwxLS4yLS4yMVptNy42Ni01LjQ5QS42LjYsMCwwLDEsMTYsOUgxNGEuNjEuNjEsMCwwLDEsMC0xLjIxaDJBLjYuNiwwLDAsMSwxNi42MSw4LjM1Wk0xNiwyMi4yNmEuNjEuNjEsMCwwLDAsMC0xLjIxSDE0YS42MS42MSwwLDAsMCwwLDEuMjFaTTExLDguMzVhLjYxLjYxLDAsMCwwLS42MS0uNjFIMTBBMi4yMSwyLjIxLDAsMCwwLDcuNzQsMTB2LjRhLjYxLjYxLDAsMSwwLDEuMjEsMFYxMGExLDEsMCwwLDEsMS0xaC40QS42LjYsMCwwLDAsMTEsOC4zNVptOC42Ny0uNjFhLjYxLjYxLDAsMSwwLDAsMS4yMUgyMGExLDEsMCwwLDEsMSwxdi40YS42MS42MSwwLDEsMCwxLjIxLDBWMTBBMi4yMSwyLjIxLDAsMCwwLDIwLDcuNzRaTTExLDIxLjY1YS42MS42MSwwLDAsMS0uNjEuNjFIMTBBMi4yMSwyLjIxLDAsMCwxLDcuNzQsMjB2LS40YS42MS42MSwwLDEsMSwxLjIxLDBWMjBhMSwxLDAsMCwwLDEsMWguNEEuNi42LDAsMCwxLDExLDIxLjY1Wm04LjY3LjYxYS42MS42MSwwLDEsMSwwLTEuMjFIMjBhMSwxLDAsMCwwLDEtMXYtLjRhLjYxLjYxLDAsMSwxLDEuMjEsMFYyMEEyLjIxLDIuMjEsMCwwLDEsMjAsMjIuMjZaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/cancelGridElementDark.svg":
/*!***************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/cancelGridElementDark.svg ***!
  \***************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsNi44OEE4LjEyLDguMTIsMCwxLDEsNi44OCwxNSw4LjEzLDguMTMsMCwwLDEsMTUsNi44OFpNMTUsOC4xQTYuOSw2LjksMCwxLDAsMjEuOSwxNSw2LjksNi45LDAsMCwwLDE1LDguMVptMi44LDQsLjA3LjA1YS42Mi42MiwwLDAsMSwuMDUuOGwtLjA1LjA3LTIsMiwyLDJhLjYyLjYyLDAsMCwxLC4wNS44bC0uMDUuMDdhLjYyLjYyLDAsMCwxLS44LjA1TDE3LDE3Ljg3bC0yLTItMiwyYS42Mi42MiwwLDAsMS0uOC4wNWwtLjA3LS4wNWEuNjIuNjIsMCwwLDEtLjA1LS44bC4wNS0uMDcsMi0yLTItMmEuNjIuNjIsMCwwLDEtLjA1LS44bC4wNS0uMDdhLjYyLjYyLDAsMCwxLC44LS4wNWwuMDcuMDUsMiwyLDItMkEuNjIuNjIsMCwwLDEsMTcuOCwxMi4wOFoiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/cellIDIcon.svg":
/*!****************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/cellIDIcon.svg ***!
  \****************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTQuMTEsMTEuMzlhLjYyLjYyLDAsMCwxLC40OC43MWwtLjE4Ljg5aDJsLjIyLTEuMTJhLjYxLjYxLDAsMCwxLC43MS0uNDguNi42LDAsMCwxLC40Ny43MWwtLjE3Ljg5aC43OWEuNjEuNjEsMCwwLDEsMCwxLjIxaC0xbC0uMzMsMS42aDFBLjYxLjYxLDAsMCwxLDE4LDE3aC0xLjJsLS4yMiwxLjEzYS42Mi42MiwwLDAsMS0uNzEuNDcuNjEuNjEsMCwwLDEtLjQ4LS43MWwuMTgtLjg5aC0ybC0uMjIsMS4xM2EuNjEuNjEsMCwwLDEtLjcxLjQ3LjYuNiwwLDAsMS0uNDctLjcxbC4xNy0uODloLS43OWEuNjEuNjEsMCwwLDEsMC0xLjIxaDFsLjMzLTEuNkgxMkEuNjEuNjEsMCwwLDEsMTIsMTNoMS4ybC4yMi0xLjEyQS42Mi42MiwwLDAsMSwxNC4xMSwxMS4zOVptLS4yNiw0LjQxaDJsLjMyLTEuNmgtMlpNNy43NiwxMC4zN2EyLjYxLDIuNjEsMCwwLDEsMi42MS0yLjYxaDkuMjZhMi42MSwyLjYxLDAsMCwxLDIuNjEsMi42MXY5LjI2YTIuNjEsMi42MSwwLDAsMS0yLjYxLDIuNjFIMTAuMzdhMi42MSwyLjYxLDAsMCwxLTIuNjEtMi42MVpNMTAuMzcsOUExLjQsMS40LDAsMCwwLDksMTAuMzd2OS4yNmExLjQsMS40LDAsMCwwLDEuNCwxLjRoOS4yNmExLjQsMS40LDAsMCwwLDEuNC0xLjRWMTAuMzdBMS40LDEuNCwwLDAsMCwxOS42Myw5WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/checkboxIconDark.svg":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/checkboxIconDark.svg ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjUsMTIuNzZBMi4yMSwyLjIxLDAsMCwxLDI3LjI0LDE1VjI1QTIuMjEsMi4yMSwwLDAsMSwyNSwyNy4yNEgxNUEyLjIxLDIuMjEsMCwwLDEsMTIuNzYsMjVWMTVBMi4yMSwyLjIxLDAsMCwxLDE1LDEyLjc2Wk0yNSwxNEgxNWExLDEsMCwwLDAtMSwxVjI1YTEsMSwwLDAsMCwxLDFIMjVhMSwxLDAsMCwwLDEtMVYxNUExLDEsMCwwLDAsMjUsMTRabS02LjY0LDgsNS4yMS01LjJhLjU5LjU5LDAsMCwxLC44NSwwLC42MS42MSwwLDAsMSwuMDYuNzhsLS4wNi4wNy01LjYzLDUuNjNhLjYuNiwwLDAsMS0uNzkuMDZMMTgsMjMuMjRsLTIuNDEtMi40MWEuNjEuNjEsMCwwLDEsMC0uODUuNi42LDAsMCwxLC43OS0uMDZsLjA2LjA2LDIsMiw1LjIxLTUuMloiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/clampSliderValueIcon.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/clampSliderValueIcon.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMjEyMTIxO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE5LjQ3LDIwLjNjLjUxLDAsMS42OS0uMjEsMS42OS0yLjEycy0xLjE4LTIuMTItMS42OS0yLjEyaC0uOTZ2LS44OGguMDljLjM0LDAsLjYyLS4yOCwuNjItLjYycy0uMjgtLjYyLS42Mi0uNjJoLTEuNDZjLS4zNCwwLS42MiwuMjgtLjYyLC42MnMuMjgsLjYyLC42MiwuNjJoLjEydi44OGgtNC4xN3YtNi4wMmg2LjA4Yy41MSwwLDEuNjgtLjIxLDEuNjgtMi4xMnMtMS4xOC0yLjEyLTEuNjgtMi4xMmgtNi4yYy0yLjI3LDAtNC4xMiwxLjg1LTQuMTIsNC4xMnY2LjI3YzAsMi4yNywxLjg1LDQuMTIsNC4xMiw0LjEyaDQuM3YyLjY3aC0uNzhjLS4zNCwwLS42MiwuMjgtLjYyLC42MnMuMjgsLjYyLC42MiwuNjJoMi44MWMuMzQsMCwuNjItLjI4LC42Mi0uNjJzLS4yOC0uNjItLjYyLS42MmgtLjc4di0yLjY3aC45NlptLTkuMzgtNC4xMnYtNi4yN2MwLTEuNTksMS4yOS0yLjg4LDIuODgtMi44OGg2LjJjLjE3LDAsLjQzLDAsLjQzLC44OHMtLjI2LC44OC0uNDMsLjg4aC02LjJjLS42MiwwLTEuMTIsLjUtMS4xMiwxLjEydjYuMjdjMCwuNjIsLjUsMS4xMiwxLjEyLDEuMTJoNi41Yy4xNywwLC40NCwwLC40NCwuODhzLS4yNiwuODgtLjQ0LC44OGgtNi41Yy0xLjU4LDAtMi44OC0xLjI5LTIuODgtMi44OFoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/clipChildrenIcon.svg":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/clipChildrenIcon.svg ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTIyLjE4LDEyLjgzaC02LjVjLTEuNDUsMC0yLjYyLDEuMTgtMi42MiwyLjYydjYuMzVjMCwxLjQ1LDEuMTgsMi42MiwyLjYyLDIuNjJoNi41YzEuNDUsMCwyLjYyLTEuMTgsMi42Mi0yLjYydi02LjM1YzAtMS40NS0xLjE4LTIuNjItMi42Mi0yLjYyWm0xLjM4LDguOTdjMCwuNzYtLjYyLDEuMzgtMS4zOCwxLjM4aC02LjVjLS43NiwwLTEuMzgtLjYyLTEuMzgtMS4zOHYtNi4zNWMwLS43NiwuNjItMS4zOCwxLjM4LTEuMzhoNi41Yy43NiwwLDEuMzgsLjYyLDEuMzgsMS4zOHY2LjM1WiIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNMTMuNzcsOC4yNmMwLTEuNDUtMS4xOC0yLjYyLTIuNjItMi42MmgtMy4xNGMtMS40NSwwLTIuNjIsMS4xOC0yLjYyLDIuNjJ2My4wM2MwLDEuNDUsMS4xOCwyLjYyLDIuNjIsMi42MmgzLjE0YzEuNDUsMCwyLjYyLTEuMTgsMi42Mi0yLjYydi0zLjAzWm0tMi4yNy0xLjMybC00Ljc5LDQuNzljLS4wNS0uMTQtLjA4LS4yOC0uMDgtLjQ0di0uODVsMy41NS0zLjU1aC45NmMuMTIsMCwuMjQsLjAyLC4zNiwuMDVabS0zLjQ5LS4wNWguNDFsLTEuNzksMS43OXYtLjQxYzAtLjc2LC42Mi0xLjM4LDEuMzgtMS4zOFptLS40LDUuNzJsNC44Mi00LjgyYy4wNiwuMTUsLjA5LC4zMSwuMDksLjQ4di44NWwtMy41NSwzLjU1aC0uOTZjLS4xNCwwLS4yNy0uMDMtLjQtLjA3Wm0zLjU0LC4wN2gtLjQxbDEuNzgtMS43OHYuNDFjMCwuNzYtLjYyLDEuMzgtMS4zOCwxLjM4WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/clipContentsIcon.svg":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/clipContentsIcon.svg ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMjAuNDgsMTEuMzVIMTguNjVWOS41MmExLjkzLDEuOTMsMCwwLDAsMC0uMjQsMi41MywyLjUzLDAsMCwwLS4zOC0xLjE1TDE4LjIsOGEyLjYyLDIuNjIsMCwwLDAtMS45NC0xLjE1SDkuNTJBMi42NCwyLjY0LDAsMCwwLDYuODgsOS41MlYxNmEyLDIsMCwwLDAsMCwuMjUsMi42NiwyLjY2LDAsMCwwLC4zOCwxLjE0bC4wNi4wOWEyLjY3LDIuNjcsMCwwLDAsLjguNzcsMi41MywyLjUzLDAsMCwwLDEuMTUuMzhoMi4wN3YxLjgzQTIuNjQsMi42NCwwLDAsMCwxNCwyMy4xMmg2LjVhMi42NCwyLjY0LDAsMCwwLDIuNjQtMi42NFYxNEEyLjY0LDIuNjQsMCwwLDAsMjAuNDgsMTEuMzVabS0zLTEuODN2MWwtLjg3Ljg3SDE1LjA1TDE3LjM1LDlBMS4yOCwxLjI4LDAsMCwxLDE3LjQ0LDkuNTJabTAsM1YxNkExLjQzLDEuNDMsMCwwLDEsMTYsMTcuNDRIMTIuNTZWMTRBMS40MywxLjQzLDAsMCwxLDE0LDEyLjU2Wm0tOS4zNC0zQTEuNDEsMS40MSwwLDAsMSw5LjUyLDguMWguNTZsLTIsMlptMCwyLjI4LDMuNy0zLjdoMS41M0w4LjEsMTMuMzNabTMuMjUsNC43Ny0uODcuODdoLTFBMS4yOCwxLjI4LDAsMCwxLDksMTcuMzVsMi4zMS0yLjNabS4xMS0zLjM2TDguMTgsMTYuNDlBMS41MSwxLjUxLDAsMCwxLDguMSwxNnYtMWw3LTdoMWExLjUsMS41LDAsMCwxLC40Ny4wOGwtMy4yOCwzLjI4QTIuNjgsMi42OCwwLDAsMCwxMS40NiwxMy4yMVpNMjEuOSwyMC40OGExLjQxLDEuNDEsMCwwLDEtMS40MiwxLjQySDE0YTEuNDIsMS40MiwwLDAsMS0xLjQyLTEuNDJWMTguNjVIMTZBMi42NCwyLjY0LDAsMCwwLDE4LjY1LDE2VjEyLjU2aDEuODNBMS40MiwxLjQyLDAsMCwxLDIxLjksMTRaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/colorIcon.svg":
/*!***************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/colorIcon.svg ***!
  \***************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNOC4zMSwxMC4zNGE4LjM0LDguMzQsMCwwLDEsMTQuMjUsOC4zNGMtMS4zNSwzLjctNC45MSw1LjE2LTcuNDcsMy4zYTMuODIsMy44MiwwLDAsMS0xLjUyLTNsLS4wOC0uODEsMC0uMzJjLS4xLS43Ni0uMjYtMS4xLS41OC0xLjI4YTEuMjcsMS4yNywwLDAsMC0xLjMsMGwtLjI4LjEyLS4xNS4wNmEzLjEyLDMuMTIsMCwwLDEtMi4wNy4zNEw4LjksMTdsLS4xMywwQzYuNDksMTYuMjksNi4xNSwxMy4yLDguMzEsMTAuMzRabS44LDUuNDguMSwwLC4xMSwwYTEuODEsMS44MSwwLDAsMCwxLjE3LS4xOWwuNDktLjIxYTIuNDcsMi40NywwLDAsMSwzLjY4LDIuMjFsMCwuMzcuMDUuNDQsMCwuMzRhMi43NSwyLjc1LDAsMCwwLDEsMi4xNmMxLjg2LDEuMzUsNC41Mi4yNSw1LjYxLTIuNzNBNy4xMSw3LjExLDAsMCwwLDkuMjksMTEuMDdDNy41OSwxMy4zMyw3LjgsMTUuMzgsOS4xMSwxNS44MlptOS4xNi0xLjYzYTEsMSwwLDAsMSwyLS41MywxLDEsMCwxLDEtMiwuNTNaTTE4LjY4LDE3YTEsMSwwLDEsMSwxLjI0LjcyQTEsMSwwLDAsMSwxOC42OCwxN1ptLTItNS4zYTEsMSwwLDAsMSwuNzItMS4yNSwxLDEsMCwxLDEsLjUzLDJBMSwxLDAsMCwxLDE2LjY2LDExLjc0Wm0wLDcuMzVhMSwxLDAsMCwxLC43Mi0xLjI1LDEsMSwwLDAsMSwuNTMsMkExLDEsMCwwLDEsMTYuNjMsMTkuMDlaTTEzLjc4LDExYTEsMSwwLDEsMSwxLjI1LjcyQTEsMSwwLDAsMSwxMy43OCwxMVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/conerRadiusIcon.svg":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/conerRadiusIcon.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMjAuNDIsMjIuMjFIOS41N2ExLjc4LDEuNzgsMCwwLDEtMS43OC0xLjc4VjkuNThhMS44LDEuOCwwLDAsMSwyLTEuNzhBMTMuODYsMTMuODYsMCwwLDEsMjIuMiwyMC4yNWgwYTEuOCwxLjgsMCwwLDEtMS43OCwyWk05LjU4LDlhLjUyLjUyLDAsMCwwLS4zNi4xNC41Mi41MiwwLDAsMC0uMTguNFYyMC40M2EuNTMuNTMsMCwwLDAsLjUzLjUzSDIwLjQyYS41Mi41MiwwLDAsMCwuNC0uMTguNTYuNTYsMCwwLDAsLjE0LS40MUExMi42MiwxMi42MiwwLDAsMCw5LjYzLDlaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/confirmGridElementDark.svg":
/*!****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/confirmGridElementDark.svg ***!
  \****************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsNi44OUE4LjExLDguMTEsMCwxLDEsNi44OSwxNSw4LjExLDguMTEsMCwwLDEsMTUsNi44OVptMCwxLjIyQTYuODksNi44OSwwLDEsMCwyMS44OSwxNSw2Ljg4LDYuODgsMCwwLDAsMTUsOC4xMVptLTEsOC4wNiwzLjYyLTMuNjNhLjYxLjYxLDAsMCwxLC45Mi43OWwtLjA2LjA3LTQsNC4wNmEuNjQuNjQsMCwwLDEtLjguMDZsLS4wNi0uMDYtMi0yYS42LjYsMCwwLDEsMC0uODYuNi42LDAsMCwxLC43OS0uMDZsLjA3LjA2LDEuNiwxLjYsMy42Mi0zLjYzWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/copy.svg":
/*!**********************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/copy.svg ***!
  \**********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5jb3B5PC90aXRsZT48ZyBpZD0iVUlfRWxlbWVudHMiIGRhdGEtbmFtZT0iVUkgRWxlbWVudHMiPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTI0LDE0Ljg5SDIyLjc2bC0zLTNIMTIuNDNWMjYuNTloNC4yNnYzaDExLjVWMTlabS4zLDEuNzEsMi4xNCwyLjEzSDI0LjM0Wm0tMTAuOTEsOVYxMi45M2g1LjkzbDIsMkgxNi42OXYxMC43Wm00LjI2LDNWMTUuODloNS42NXYzLjg0aDMuODV2OC44M1oiLz48L2c+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/cropIcon.svg":
/*!**************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/cropIcon.svg ***!
  \**************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjIuNDMsMTlhLjYuNiwwLDAsMSwuMDksMS4yaC0yLjN2Mi4yMWEuNi42LDAsMCwxLS42LjYxLjYxLjYxLDAsMCwxLS42LS41MnYtMi4zSDEyLjM5YTIuNjEsMi42MSwwLDAsMS0yLjYxLTIuNDZWMTFINy41NmEuNi42LDAsMCwxLS4wOC0xLjJIOS43N1Y3LjU3YS42LjYsMCwwLDEsLjYtLjYxLjYxLjYxLDAsMCwxLC42LjUydjIuM2gwVjExaDB2Ni42M0ExLjQsMS40LDAsMCwwLDEyLjI3LDE5SDIyLjQzWk0xMS43OCw5Ljc4aDUuODNhMi42MiwyLjYyLDAsMCwxLDIuNjEsMi40NnY2SDE5VjEyLjM5QTEuNCwxLjQsMCwwLDAsMTcuNzMsMTFoLTZaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/deleteGridElementDark.svg":
/*!***************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/deleteGridElementDark.svg ***!
  \***************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsOC43MWEyLDIsMCwwLDEsMiwxLjkxdi4xMWgzLjI2YS40Ny40NywwLDAsMSwuMDYuOTNoLS41NkwxOSwxOS43NWExLjcsMS43LDAsMCwxLTEuNTksMS41M0gxMi43MUExLjcxLDEuNzEsMCwwLDEsMTEsMTkuODVsMC0uMS0uNzktOC4wOWgtLjVhLjQ2LjQ2LDAsMCwxLS40Ni0uNFYxMS4yYS40Ni40NiwwLDAsMSwuNC0uNDZIMTNBMiwyLDAsMCwxLDE1LDguNzFabTMuODUsMi45NWgtNy43bC43OSw4YS43OC43OCwwLDAsMCwuNjkuN2g0LjY2YS43Ny43NywwLDAsMCwuNzYtLjYydi0uMDhabS0yLjc2LDEuNzFhLjQ3LjQ3LDAsMCwxLC40Ni40djQuNDFhLjQ2LjQ2LDAsMCwxLS45Mi4wNnYtNC40QS40Ny40NywwLDAsMSwxNi4wOSwxMy4zN1ptLTIuMTgsMGEuNDYuNDYsMCwwLDEsLjQ2LjR2NC40MWEuNDcuNDcsMCwwLDEtLjkzLjA2di00LjRBLjQ3LjQ3LDAsMCwxLDEzLjkxLDEzLjM3Wk0xNSw5LjY1YTEuMDcsMS4wNywwLDAsMC0xLjA4LDF2LjA5aDIuMThBMS4wOCwxLjA4LDAsMCwwLDE1LDkuNjVaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/descendantsOnlyPaddingIcon.svg":
/*!********************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/descendantsOnlyPaddingIcon.svg ***!
  \********************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjMuMTEsOS4zMmEyLjIzLDIuMjMsMCwwLDEtMi4yMywyLjI0SDkuMTJhMi4yNCwyLjI0LDAsMCwxLDAtNC40N0gyMC44OEEyLjIzLDIuMjMsMCwwLDEsMjMuMTEsOS4zMlpNMjEuNDksMTVhMi4yMywyLjIzLDAsMCwxLTIuMjMsMi4yM0gxMC43NGEyLjIzLDIuMjMsMCwwLDEsMC00LjQ2aDguNTJBMi4yMywyLjIzLDAsMCwxLDIxLjQ5LDE1Wm0tMi40NCw1LjY4YTIuMjMsMi4yMywwLDAsMS0yLjIzLDIuMjNIMTMuMThhMi4yNCwyLjI0LDAsMCwxLDAtNC40N2gzLjY0QTIuMjMsMi4yMywwLDAsMSwxOS4wNSwyMC42OFpNMjEuODksOS4zMmExLDEsMCwwLDAtMS0xSDkuMTJhMSwxLDAsMCwwLDAsMkgyMC44OEExLDEsMCwwLDAsMjEuODksOS4zMlpNMjAuMjcsMTVhMSwxLDAsMCwwLTEtMUgxMC43NGExLDEsMCwwLDAsMCwyaDguNTJBMSwxLDAsMCwwLDIwLjI3LDE1Wm0tMi40Myw1LjY4YTEsMSwwLDAsMC0xLTFIMTMuMThhMSwxLDAsMSwwLDAsMmgzLjY0QTEsMSwwLDAsMCwxNy44NCwyMC42OFoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/displayGridLine1Icon.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/displayGridLine1Icon.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHN0eWxlPi5ie2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImIiIGQ9Ik03LjczLDkuOTVjMC0xLjIzLC45OS0yLjIyLDIuMjItMi4yMmgxMC4wOWMxLjIzLDAsMi4yMiwuOTksMi4yMiwyLjIydjEwLjA5YzAsMS4yMy0uOTksMi4yMi0yLjIyLDIuMjJIOS45NWMtMS4yMywwLTIuMjItLjk5LTIuMjItMi4yMlY5Ljk1Wm0yLjIyLTEuMDFjLS41NiwwLTEuMDEsLjQ1LTEuMDEsMS4wMXYxMC4wOWMwLC41NiwuNDUsMS4wMSwxLjAxLDEuMDFoMTAuMDljLjU2LDAsMS4wMS0uNDUsMS4wMS0xLjAxVjkuOTVjMC0uNTYtLjQ1LTEuMDEtMS4wMS0xLjAxSDkuOTVaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0xNS44NCwxMS45MnY2LjU0YzAsLjMtLjIzLC41My0uNTMsLjUzcy0uNTMtLjIzLS41My0uNTN2LTUuODhsLTEuMDcsLjQyYy0uMDksLjAzLS4yLC4wNy0uMjgsLjA3LS4yNiwwLS40Ny0uMjEtLjQ3LS40NywwLS4xNSwuMDctLjM1LC4zMy0uNDZsMS42NC0uNjZjLjA5LS4wMiwuMjItLjEsLjM3LS4xLC4zMSwwLC41MywuMjMsLjUzLC41NVoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/displayGridLine2Icon.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/displayGridLine2Icon.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHN0eWxlPi5ie2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImIiIGQ9Ik03LjczLDkuOTVjMC0xLjIzLC45OS0yLjIyLDIuMjItMi4yMmgxMC4wOWMxLjIzLDAsMi4yMiwuOTksMi4yMiwyLjIydjEwLjA5YzAsMS4yMy0uOTksMi4yMi0yLjIyLDIuMjJIOS45NWMtMS4yMywwLTIuMjItLjk5LTIuMjItMi4yMlY5Ljk1Wm0yLjIyLTEuMDFjLS41NiwwLTEuMDEsLjQ1LTEuMDEsMS4wMXYxMC4wOWMwLC41NiwuNDUsMS4wMSwxLjAxLDEuMDFoMTAuMDljLjU2LDAsMS4wMS0uNDUsMS4wMS0xLjAxVjkuOTVjMC0uNTYtLjQ1LTEuMDEtMS4wMS0xLjAxSDkuOTVaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0xNy42MywxOC40NGMwLC4zMS0uMjMsLjUxLS41MiwuNTFoLTMuOTNjLS4zMiwwLS41NS0uMjEtLjU1LS41NSwwLS4yMywuMDktLjQxLC4zMS0uNjRsMi4yNS0yLjM0Yy41OC0uNTksLjk0LTEuMiwuOTQtMS44NiwwLS43LS41MS0xLjE3LTEuMi0xLjE3LS42MywwLTEuMDIsLjM0LTEuMjksLjY5LS4xLC4xMi0uMjIsLjI0LS40NSwuMjQtLjI4LDAtLjUtLjE4LS41MS0uNDUsMC0uMTUsLjA1LS4zLC4xMy0uNDIsLjMzLS41NywxLjA4LTEuMTEsMi4xNi0xLjExLDEuNDMsMCwyLjI4LC45NSwyLjI4LDIuMTcsMCwuODYtLjQsMS42Mi0xLjIxLDIuNDZsLTEuODgsMS45NmgyLjk1Yy4yOSwwLC41MiwuMiwuNTIsLjUxWiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/fillColorIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/fillColorIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNNy4zMSwxNi41NHY0LjFhMiwyLDAsMCwwLDIsMkgyMS40MmEyLDIsMCwwLDAsMi0yVjExLjc4YTIsMiwwLDAsMC0yLTJIMTQuMjFMMTUuNDIsMTFoNmEuOC44LDAsMCwxLC44LjgxdjguODZhLjguOCwwLDAsMS0uOC44MUg5LjMzYS44MS44MSwwLDAsMS0uODEtLjgxVjE3Ljc1WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0xMC41NCw4YS42LjYsMCwxLDEsMS4yLDBWOWExLjU3LDEuNTcsMCwwLDEsMSwuNDZsMi44NSwyLjg1YTEuNjEsMS42MSwwLDAsMSwwLDIuMjhMMTIuMTcsMThhMS42MSwxLjYxLDAsMCwxLTIuMjgsMEw3LDE1LjEzYTEuNjEsMS42MSwwLDAsMSwwLTIuMjhsMy40Mi0zLjQyLjA4LS4wN1ptMCwzLjYydi0uNUw4LjIxLDEzLjRoNi42NGEuMzQuMzQsMCwwLDAtLjEyLS4yNmwtMi44NS0yLjg1YS4zNC4zNCwwLDAsMC0uMTQtLjA5djEuMzdhLjYuNiwwLDEsMS0xLjIsMFptLTIuMzIsMywyLjUyLDIuNTJhLjQyLjQyLDAsMCwwLC41NywwbDIuNTMtMi41MloiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMTQuNTcsMTcuMzJhMi43NiwyLjc2LDAsMCwxLC4yNy0xLjEyLDUuMzMsNS4zMywwLDAsMSwuNTQtLjkxYy4yLS4yNy4zOS0uNDkuNTMtLjY1bC4yNC0uMjZoMGEuNi42LDAsMCwxLC44NiwwbC4yNC4yN2E2LDYsMCwwLDEsLjUzLjY1LDUuMzMsNS4zMywwLDAsMSwuNTQuOTEsMi43NiwyLjc2LDAsMCwxLC4yOCwxLjEyLDIsMiwwLDEsMS00LDBaTTE2LjM3LDE2YTQuMTUsNC4xNSwwLDAsMC0uNDMuNzIsMS41NywxLjU3LDAsMCwwLS4xNy42MS44MS44MSwwLDEsMCwxLjYyLDAsMS41NywxLjU3LDAsMCwwLS4xNy0uNjEsNC4xNSw0LjE1LDAsMCwwLS40My0uNzJsLS4yMS0uMjhaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/fontFamilyIcon.svg":
/*!********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/fontFamilyIcon.svg ***!
  \********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTAuOTIsNi44M2EuNjEuNjEsMCwwLDEsLjU3LjRsMi40MSw2LjUydjBsLjE4LjQ5TDEzLjQyLDE2bC0uNTEtMS4zOGgtNEw4LDE3LjA1YS42MS42MSwwLDAsMS0uNzkuMzYuNjIuNjIsMCwwLDEtLjM2LS43OWwxLTIuODR2MGwyLjQxLTYuNTJBLjYyLjYyLDAsMCwxLDEwLjkyLDYuODNaTTkuMzgsMTMuMzdoMy4wN0wxMC45Miw5LjIxWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0xNi40OCwxMC40OGEuNi42LDAsMCwxLC41Ny0uMzguNTkuNTksMCwwLDEsLjU2LjM5bDQuNTQsMTEuNDVoLjRhLjYyLjYyLDAsMSwxLDAsMS4yM2gtMmEuNjIuNjIsMCwwLDEsMC0xLjIzaC4zMmwtMS0yLjQ1SDE0LjIybC0xLDIuNDVoLjMyYS42Mi42MiwwLDAsMSwwLDEuMjNoLTJhLjYyLjYyLDAsMCwxLDAtMS4yM2guNFptMi45LDcuNzhMMTcsMTIuMzdsLTIuMzMsNS44OVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/fontSizeIcon.svg":
/*!******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/fontSizeIcon.svg ***!
  \******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTMuNTYsMTkuNTNsMy45LTExYS42MS42MSwwLDAsMSwxLjEtLjA5bDAsLjA5TDIzLDIxLjA1YS42Mi42MiwwLDAsMS0uMzcuNzguNi42LDAsMCwxLS43NC0uM2wwLS4wNy0xLjI5LTMuNjRIMTUuNDVsLTEuMjgsMy42YS41Ny41NywwLDAsMS0uMjkuMzZsLS4wNywwYS42MS42MSwwLDAsMS0uNzUtLjI3bDAtLjA3LS44LTJIOC45bC0uOCwyYS42MS42MSwwLDAsMS0uNzEuMzdsLS4wOCwwYS41OS41OSwwLDAsMS0uMzYtLjdMNywyMWwzLTcuNjdhLjYxLjYxLDAsMCwxLDEuMDktLjA4bDAsLjA5LDIuNDMsNi4xNiwzLjktMTFabS0zLTQuMjktMS4xOCwzaDIuMzZaTTE4LDEwLjU1bC0yLjE2LDYuMDZoNC4zMVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/fontStyleIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/fontStyleIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMjEuNCwxOS42NWwwLDBhMi40NSwyLjQ1LDAsMCwxLC4xMS43MSwyLDIsMCwwLDEtMiwyLDIsMiwwLDAsMS0xLjEyLS4zNGwtLjA1LDAtLjA1LDBhMi4zMywyLjMzLDAsMCwxLS42NC0uODR2MGwtLjc5LTEuODhIMTNsLS43NSwxLjgzYTIsMiwwLDAsMS0uNzQsMUEyLDIsMCwwLDEsOSwyMS44N2ExLjg4LDEuODgsMCwwLDEtLjU1LTEuMzgsMy4zNywzLjM3LDAsMCwxLDAtLjQ4bDAtLjEzLDQuNTUtMTFoMGEyLjI3LDIuMjcsMCwwLDEsLjc2LS45NCwxLjk0LDEuOTQsMCwwLDEsMS4yNi0uMzIsMiwyLDAsMCwxLDEuODIsMS4zMVpNMTUuODEsOS4zNGEuNzkuNzksMCwwLDAtLjMtLjQxLjgzLjgzLDAsMCwwLS40MS0uMTNIMTVhMS4xMSwxLjExLDAsMCwwLS4yNiwwLC42NC42NCwwLDAsMC0uMjUuMTIuODUuODUsMCwwLDAtLjM0LjQyTDkuNzEsMjAuMjFhMS40OCwxLjQ4LDAsMCwwLDAsLjI4LjcyLjcyLDAsMCwwLC4xOS41My43Ny43NywwLDAsMCwuNTcuMTkuNy43LDAsMCwwLC40NC0uMTQuNzYuNzYsMCwwLDAsLjMtLjRsMS4wNy0yLjYxaDUuNDNsMS4wOSwyLjU5YTEuMTcsMS4xNywwLDAsMCwuMzIuNDIuNzYuNzYsMCwwLDAsLjQ2LjE0LjcuNywwLDAsMCwuNTQtLjIzLjczLjczLDAsMCwwLC4yNS0uNTgsMS4yLDEuMiwwLDAsMCwwLS4zM1pNMTcsMTYuNDYsMTUsMTEuNTRsLTIsNC45MlptLTIuMzEtMS4yaC41bC0uMjUtLjZaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/fontWeightIcon.svg":
/*!********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/fontWeightIcon.svg ***!
  \********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiB2aWV3Qm94PSIwIDAgMzAgMzAiPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0yNC4zNSwyMC40NSwyMC4yMiw4LjgxbDAtLjEyYTEuMDcsMS4wNywwLDAsMC0xLjk0LjE1TDE0Ljc3LDE4LjYsMTEuMiw4LjU0bDAtLjA5YS42MS42MSwwLDAsMC0xLjEuMDlMNS42MiwyMS4wNWEuNjEuNjEsMCwwLDAsMS4xMS40OGwwLS4wNywxLjI5LTMuNjNoNS4xNmwxLjI5LDMuNjMsMCwuMDdhLjYxLjYxLDAsMCwwLC41My4zM2gwYTEuMDcsMS4wNywwLDAsMCwxLS42bDEuMTItMy4xNGg0LjA5bDEuMDgsMy4wNy4wNS4xYTEuMDcsMS4wNywwLDAsMCwuOTUuNTcsMS4xMiwxLjEyLDAsMCwwLC4zNS0uMDZBMS4wNSwxLjA1LDAsMCwwLDI0LjM1LDIwLjQ1Wk04LjQ4LDE2LjYxbDIuMTUtNi4wNiwyLjE1LDYuMDZaTTE4LDE2bDEuMjgtMy42M0wyMC41MiwxNloiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/frequencyIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/frequencyIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHN0eWxlPi5ie2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImIiIGQ9Ik05LjU2LDIwLjQxYzAsLjMzLC4yNywuNjEsLjYxLC42MXMuNjEtLjI3LC42MS0uNjFWOC42MmMwLS4zMy0uMjctLjYxLS42MS0uNjFzLS42MSwuMjctLjYxLC42MXYxMS43OVoiLz48cGF0aCBjbGFzcz0iYiIgZD0iTTYuMzQsMTcuNTNjMCwuMzMsLjI3LC42MSwuNjEsLjYxcy42MS0uMjcsLjYxLS42MXYtMy45YzAtLjMzLS4yNy0uNjEtLjYxLS42MXMtLjYxLC4yNy0uNjEsLjYxdjMuOVoiLz48cGF0aCBjbGFzcz0iYiIgZD0iTTIyLjQ0LDE3LjUzYzAsLjMzLC4yNywuNjEsLjYxLC42MXMuNjEtLjI3LC42MS0uNjF2LTMuOWMwLS4zMy0uMjctLjYxLS42MS0uNjFzLS42MSwuMjctLjYxLC42MXYzLjlaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0xMi43OCwxOC4wMWMwLC4zMywuMjcsLjYxLC42MSwuNjFzLjYxLS4yNywuNjEtLjYxVjYuMjJjMC0uMzMtLjI3LS42MS0uNjEtLjYxcy0uNjEsLjI3LS42MSwuNjF2MTEuNzlaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0xNiwyMy43OGMwLC4zMywuMjcsLjYxLC42MSwuNjFzLjYxLS4yNywuNjEtLjYxVjExLjk5YzAtLjMzLS4yNy0uNjEtLjYxLS42MXMtLjYxLC4yNy0uNjEsLjYxdjExLjc5WiIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNMTkuMjIsMjEuMzhjMCwuMzMsLjI3LC42MSwuNjEsLjYxcy42MS0uMjcsLjYxLS42MVY5LjU5YzAtLjMzLS4yNy0uNjEtLjYxLS42MXMtLjYxLC4yNy0uNjEsLjYxdjExLjc5WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/gridColumnIconDark.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/gridColumnIconDark.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJpY29ucyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMzMzM7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0ibTEyLjU3LDE3LjgzdjIuNjNjMCwuMzQuMjcuNjEuNjEuNjFoMy42NGMuMzQsMCwuNjEtLjI3LjYxLS42MXYtMi42M2gtNC44NlptNC4yNS0xMC4xMmMxLjAxLDAsMS44Mi44MiwxLjgyLDEuODJ2MTAuOTNjMCwxLjAxLS44MiwxLjgyLTEuODIsMS44MmgtMy42NGMtMS4wMSwwLTEuODItLjgyLTEuODItMS44MnYtMTAuOTNjMC0xLjAxLjgyLTEuODIsMS44Mi0xLjgyaDMuNjRabS42MSwxLjgyYzAtLjM0LS4yNy0uNjEtLjYxLS42MWgtMy42NGMtLjM0LDAtLjYxLjI3LS42MS42MXYyLjYzaDQuODZ2LTIuNjNabS00Ljg2LDcuMDhoNC44NnYtMy4yNGgtNC44NnYzLjI0WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/gridRowIconDark.svg":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/gridRowIconDark.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJpY29ucyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMzMzM7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0ibTcuNzQsMTMuMThjMC0xLC44MS0xLjgyLDEuODItMS44MmgxMC44OWMxLDAsMS44Mi44MSwxLjgyLDEuODJ2My42M2MwLDEtLjgxLDEuODItMS44MiwxLjgyaC0xMC44OWMtMSwwLTEuODItLjgxLTEuODItMS44MnYtMy42M1ptMS44Mi0uNjFjLS4zMywwLS42MS4yNy0uNjEuNjF2My42M2MwLC4zMy4yNy42MS42MS42MWgyLjYydi00Ljg0aC0yLjYyWm03LjA2LDQuODR2LTQuODRoLTMuMjN2NC44NGgzLjIzWm0xLjIxLDBoMi42MmMuMzMsMCwuNjEtLjI3LjYxLS42MXYtMy42M2MwLS4zMy0uMjctLjYxLS42MS0uNjFoLTIuNjJ2NC44NFoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/hAlignCenterIcon.svg":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/hAlignCenterIcon.svg ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMjIuMyw5LjkzQTIuMjMsMi4yMywwLDAsMCwyMC4wNyw3LjdIOS45M0EyLjIzLDIuMjMsMCwwLDAsNy43LDkuOTNWMjAuMDdBMi4yMywyLjIzLDAsMCwwLDkuOTMsMjIuM0gyMC4wN2EyLjIzLDIuMjMsMCwwLDAsMi4yMy0yLjIzWm0tMTIuMzctMUgyMC4wN2ExLDEsMCwwLDEsMSwxVjIwLjA3YTEsMSwwLDAsMS0xLDFIOS45M2ExLDEsMCwwLDEtMS0xVjkuOTNBMSwxLDAsMCwxLDkuOTMsOC45MVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMTAuNzYsMTMuMzloOC40NmEuNi42LDAsMCwxLC4wOCwxLjJIMTAuNzZhLjYuNiwwLDAsMS0uMDgtMS4yWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0xMi4zLDE1LjgyaDUuNGEuNi42LDAsMCwxLC4wOSwxLjJIMTIuM2EuNi42LDAsMCwxLS4wOS0xLjJaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/hAlignLeftIcon.svg":
/*!********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/hAlignLeftIcon.svg ***!
  \********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMjIuMyw5LjkzQTIuMjMsMi4yMywwLDAsMCwyMC4wNyw3LjdIOS45M0EyLjIzLDIuMjMsMCwwLDAsNy43LDkuOTNWMjAuMDdBMi4yMywyLjIzLDAsMCwwLDkuOTMsMjIuM0gyMC4wN2EyLjIzLDIuMjMsMCwwLDAsMi4yMy0yLjIzWm0tMTIuMzctMUgyMC4wN2ExLDEsMCwwLDEsMSwxVjIwLjA3YTEsMSwwLDAsMS0xLDFIOS45M2ExLDEsMCwwLDEtMS0xVjkuOTNBMSwxLDAsMCwxLDkuOTMsOC45MVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMTAuNzYsMTMuMzloOC40NmEuNi42LDAsMCwxLC4wOCwxLjJIMTAuNzZhLjYuNiwwLDAsMS0uMDgtMS4yWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0xMC43NiwxNS44Mmg1LjQxYS42LjYsMCwwLDEsLjA4LDEuMkgxMC43NmEuNi42LDAsMCwxLS4wOC0xLjJaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/hAlignRightIcon.svg":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/hAlignRightIcon.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMjIuMyw5LjkzQTIuMjMsMi4yMywwLDAsMCwyMC4wNyw3LjdIOS45M0EyLjIzLDIuMjMsMCwwLDAsNy43LDkuOTNWMjAuMDdBMi4yMywyLjIzLDAsMCwwLDkuOTMsMjIuM0gyMC4wN2EyLjIzLDIuMjMsMCwwLDAsMi4yMy0yLjIzWm0tMTIuMzctMUgyMC4wN2ExLDEsMCwwLDEsMSwxVjIwLjA3YTEsMSwwLDAsMS0xLDFIOS45M2ExLDEsMCwwLDEtMS0xVjkuOTNBMSwxLDAsMCwxLDkuOTMsOC45MVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMTAuNzYsMTMuMzloOC40NmEuNi42LDAsMCwxLC4wOCwxLjJIMTAuNzZhLjYuNiwwLDAsMS0uMDgtMS4yWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0xMy44MSwxNS44Mmg1LjQxQS42LjYsMCwwLDEsMTkuMywxN0gxMy44MWEuNi42LDAsMCwxLS4wOC0xLjJaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/highlightIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/highlightIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTIxLjc3LDYuOGMuMzEsMCwuNTcsLjIzLC42MSwuNTN2My43N2MwLC45NS0uNzIsMS43My0xLjY0LDEuODN2MS44NWMwLC45OC0uNzYsMS43OC0xLjcyLDEuODRoLS4zM3YyLjI5YzAsLjY3LS4zNiwxLjI4LS45NCwxLjZsLS4xMywuMDctNS40NCwyLjU1Yy0uMzgsLjE4LS44Mi0uMDctLjg3LS40N3YtNi4wM2gtLjIxYy0uOTgsMC0xLjc3LS43Ni0xLjg0LTEuNzJ2LTEuOThjLS44OC0uMS0xLjU3LS44MS0xLjY0LTEuN3YtMy44MmMwLS4zNCwuMjctLjYxLC42MS0uNjEsLjMxLDAsLjU3LC4yMywuNjEsLjUzdjMuNzdjMCwuMzEsLjI0LC41NywuNTQsLjYxaDExLjE1Yy4zMSwwLC41Ny0uMjMsLjYxLS41M3YtMy43N2MwLS4zNCwuMjgtLjYxLC42Mi0uNjFabS00LjMxLDkuODNoLTQuOTJ2NC45OGw0LjU2LTIuMTRjLjE5LS4wOSwuMzItLjI3LC4zNS0uNDd2LTIuMzhabTIuMDYtMy42OEgxMC40OXYxLjg0YzAsLjMxLC4yMywuNTcsLjUzLC42MWg3Ljg3Yy4zMSwwLC41Ny0uMjMsLjYxLS41M3YtMS45MloiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/horizontalMarginIcon.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/horizontalMarginIcon.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNOSw4LjM3YS42LjYsMCwxLDAtMS4yLDBWMjEuNjNhLjYuNiwwLDEsMCwxLjIsMFoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMjIuMjMsOC4zN2EuNi42LDAsMSwwLTEuMiwwVjIxLjYzYS42LjYsMCwxLDAsMS4yLDBaIiBzdHlsZT0iZmlsbDojMzMzIi8+PHBhdGggZD0iTTExLjc5LDE5LjIyYTEuNDEsMS40MSwwLDAsMCwxLjQsMS40MWgzLjYyYTEuNDEsMS40MSwwLDAsMCwxLjQtMS40MVYxMC43OGExLjQxLDEuNDEsMCwwLDAtMS40LTEuNDFIMTMuMTlhMS40MSwxLjQxLDAsMCwwLTEuNCwxLjQxWm0xLjQuMmEuMi4yLDAsMCwxLS4yLS4yVjEwLjc4YS4yLjIsMCwwLDEsLjItLjJoMy42MmEuMi4yLDAsMCwxLC4yLjJ2OC40NGEuMi4yLDAsMCwxLS4yLjJaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/imageLinkIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/imageLinkIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTIuNzgsMTFhLjYuNiwwLDAsMSwuMDksMS4ySDExYTIuODIsMi44MiwwLDAsMC0uMTcsNS42NGgyYS42MS42MSwwLDAsMSwuNjEuNjEuNjIuNjIsMCwwLDEtLjUyLjZIMTFhNCw0LDAsMCwxLS4yLTguMDZoMlpNMTksMTFhNCw0LDAsMCwxLC4yLDguMDZoLTJhLjYuNiwwLDAsMS0uMDktMS4ySDE5YTIuODIsMi44MiwwLDAsMCwuMTctNS42NGgtMmEuNjEuNjEsMCwwLDEtLjYxLS42MS42Mi42MiwwLDAsMSwuNTItLjZIMTlaTTExLDE0LjRIMTlhLjYuNiwwLDAsMSwuMDgsMS4ySDExYS42LjYsMCwwLDEtLjA4LTEuMloiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/lineDashIcon.svg":
/*!******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/lineDashIcon.svg ***!
  \******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHN0eWxlPi5ie2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PGc+PHBhdGggY2xhc3M9ImIiIGQ9Ik0xNi40Nyw4Ljk1aC0yLjk4Yy0uMzMsMC0uNi0uMjctLjYtLjZzLjI3LS42LC42LS42aDIuOThjLjMzLDAsLjYsLjI3LC42LC42cy0uMjcsLjYtLjYsLjZaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik04LjMsMTEuNmMtLjMzLDAtLjYtLjI3LS42LS42di0xYzAtMS4yNCwxLjAxLTIuMjUsMi4yNS0yLjI1aDFjLjMzLDAsLjYsLjI3LC42LC42cy0uMjcsLjYtLjYsLjZoLTFjLS41OCwwLTEuMDUsLjQ3LTEuMDUsMS4wNXYxYzAsLjMzLS4yNywuNi0uNiwuNloiLz48cGF0aCBjbGFzcz0iYiIgZD0iTTIxLjcsMTEuNmMtLjMzLDAtLjYtLjI3LS42LS42di0xYzAtLjU4LS40Ny0xLjA1LTEuMDUtMS4wNWgtMWMtLjMzLDAtLjYtLjI3LS42LS42cy4yNy0uNiwuNi0uNmgxYzEuMjQsMCwyLjI1LDEuMDEsMi4yNSwyLjI1djFjMCwuMzMtLjI3LC42LS42LC42WiIvPjwvZz48Zz48cGF0aCBjbGFzcz0iYiIgZD0iTTguMzUsMTcuMTFjLS4zMywwLS42LS4yNy0uNi0uNnYtMi45OGMwLS4zMywuMjctLjYsLjYtLjZzLjYsLjI3LC42LC42djIuOThjMCwuMzMtLjI3LC42LS42LC42WiIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNMTEsMjIuM2gtMWMtMS4yNCwwLTIuMjUtMS4wMS0yLjI1LTIuMjV2LTFjMC0uMzMsLjI3LS42LC42LS42cy42LC4yNywuNiwuNnYxYzAsLjU4LC40NywxLjA1LDEuMDUsMS4wNWgxYy4zMywwLC42LC4yNywuNiwuNnMtLjI3LC42LS42LC42WiIvPjwvZz48Zz48cGF0aCBjbGFzcz0iYiIgZD0iTTE2LjUxLDIyLjI1aC0yLjk4Yy0uMzMsMC0uNi0uMjctLjYtLjZzLjI3LS42LC42LS42aDIuOThjLjMzLDAsLjYsLjI3LC42LC42cy0uMjcsLjYtLjYsLjZaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0yMC4wNSwyMi4yNWgtMWMtLjMzLDAtLjYtLjI3LS42LS42cy4yNy0uNiwuNi0uNmgxYy41OCwwLDEuMDUtLjQ3LDEuMDUtMS4wNXYtMWMwLS4zMywuMjctLjYsLjYtLjZzLjYsLjI3LC42LC42djFjMCwxLjI0LTEuMDEsMi4yNS0yLjI1LDIuMjVaIi8+PC9nPjxwYXRoIGNsYXNzPSJiIiBkPSJNMjEuNjUsMTcuMDdjLS4zMywwLS42LS4yNy0uNi0uNnYtMi45OGMwLS4zMywuMjctLjYsLjYtLjZzLjYsLjI3LC42LC42djIuOThjMCwuMzMtLjI3LC42LS42LC42WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/linePoint1Icon.svg":
/*!********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/linePoint1Icon.svg ***!
  \********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHN0eWxlPi5ie2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImIiIGQ9Ik0yMS4yMyw0Ljc5djUuODhjMCwuMjctLjIxLC40OC0uNDgsLjQ4cy0uNDctLjIxLS40Ny0uNDhWNS4zOWwtLjk2LC4zOGMtLjA4LC4wMy0uMTgsLjA2LS4yNSwuMDYtLjI0LDAtLjQzLS4xOS0uNDMtLjQzLDAtLjE0LC4wNi0uMzIsLjMtLjQybDEuNDctLjU5Yy4wOC0uMDIsLjItLjA5LC4zNC0uMDksLjI4LDAsLjQ4LC4yMSwuNDgsLjQ5WiIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNMTYuNTEsMTUuMDFjMCwuMzMsLjI3LC42MSwuNjEsLjYxaDQuNTlsLS41OCwuNThjLS4yNCwuMjQtLjI0LC42MiwwLC44NiwuMjQsLjI0LC42MiwuMjQsLjg2LDBsMS42MS0xLjYxYy4yNC0uMjQsLjI0LS42MiwwLS44NmwtMS42MS0xLjYxYy0uMjQtLjI0LS42Mi0uMjQtLjg2LDAtLjI0LC4yNC0uMjQsLjYyLDAsLjg2bC41OCwuNThoLTQuNTljLS4zMywwLS42MSwuMjctLjYxLC42MVptLTMuNjMtLjYxaC00LjU5bC41OC0uNThjLjI0LS4yNCwuMjQtLjYyLDAtLjg2LS4yNC0uMjQtLjYyLS4yNC0uODYsMGwtMS42MSwxLjYxYy0uMjQsLjI0LS4yNCwuNjIsMCwuODZsMS42MSwxLjYxYy4yNCwuMjQsLjYyLC4yNCwuODYsMCwuMjQtLjI0LC4yNC0uNjIsMC0uODZsLS41OC0uNThoNC41OWMuMzMsMCwuNjEtLjI3LC42MS0uNjEsMC0uMzMtLjI3LS42MS0uNjEtLjYxWm0yLjA5LS45MmMuMzMsMCwuNjEtLjI3LC42MS0uNjF2LTQuNTlsLjU4LC41OGMuMjQsLjI0LC42MiwuMjQsLjg2LDAsLjI0LS4yNCwuMjQtLjYyLDAtLjg2bC0xLjYxLTEuNjFjLS4yNC0uMjQtLjYyLS4yNC0uODYsMGwtMS42MSwxLjYxYy0uMjQsLjI0LS4yNCwuNjIsMCwuODYsLjI0LC4yNCwuNjIsLjI0LC44NiwwbC41OC0uNTh2NC41OWMwLC4zMywuMjcsLjYxLC42MSwuNjFabS0uNjEsMy42M3Y0LjU5bC0uNTgtLjU4Yy0uMjQtLjI0LS42Mi0uMjQtLjg2LDAtLjI0LC4yNC0uMjQsLjYyLDAsLjg2bDEuNjEsMS42MWMuMjQsLjI0LC42MiwuMjQsLjg2LDBsMS42MS0xLjYxYy4yNC0uMjQsLjI0LS42MiwwLS44Ni0uMjQtLjI0LS42Mi0uMjQtLjg2LDBsLS41OCwuNTh2LTQuNTljMC0uMzMtLjI3LS42MS0uNjEtLjYxcy0uNjEsLjI3LS42MSwuNjFaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/linePoint2Icon.svg":
/*!********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/linePoint2Icon.svg ***!
  \********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHN0eWxlPi5ie2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImIiIGQ9Ik0yMy42NSwxMC44YzAsLjI4LS4yMSwuNDYtLjQ2LC40NmgtMy41M2MtLjI5LDAtLjUtLjE5LS41LS41LDAtLjIxLC4wOC0uMzcsLjI4LS41N2wyLjAzLTIuMTFjLjUyLS41MywuODQtMS4wOCwuODQtMS42NywwLS42My0uNDYtMS4wNS0xLjA4LTEuMDUtLjU2LDAtLjkyLC4zMS0xLjE2LC42Mi0uMDksLjExLS4yLC4yMi0uNDEsLjIyLS4yNSwwLS40NS0uMTYtLjQ2LS40MSwwLS4xNCwuMDUtLjI3LC4xMi0uMzgsLjMtLjUyLC45Ny0xLDEuOTQtMSwxLjI5LDAsMi4wNSwuODUsMi4wNSwxLjk1LDAsLjc3LS4zNiwxLjQ2LTEuMDksMi4yMmwtMS42OSwxLjc2aDIuNjVjLjI2LDAsLjQ2LC4xOCwuNDYsLjQ2WiIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNMTYuNTEsMTUuMDFjMCwuMzMsLjI3LC42MSwuNjEsLjYxaDQuNTlsLS41OCwuNThjLS4yNCwuMjQtLjI0LC42MiwwLC44NiwuMjQsLjI0LC42MiwuMjQsLjg2LDBsMS42MS0xLjYxYy4yNC0uMjQsLjI0LS42MiwwLS44NmwtMS42MS0xLjYxYy0uMjQtLjI0LS42Mi0uMjQtLjg2LDAtLjI0LC4yNC0uMjQsLjYyLDAsLjg2bC41OCwuNThoLTQuNTljLS4zMywwLS42MSwuMjctLjYxLC42MVptLTMuNjMtLjYxaC00LjU5bC41OC0uNThjLjI0LS4yNCwuMjQtLjYyLDAtLjg2LS4yNC0uMjQtLjYyLS4yNC0uODYsMGwtMS42MSwxLjYxYy0uMjQsLjI0LS4yNCwuNjIsMCwuODZsMS42MSwxLjYxYy4yNCwuMjQsLjYyLC4yNCwuODYsMCwuMjQtLjI0LC4yNC0uNjIsMC0uODZsLS41OC0uNThoNC41OWMuMzMsMCwuNjEtLjI3LC42MS0uNjEsMC0uMzMtLjI3LS42MS0uNjEtLjYxWm0yLjA5LS45MmMuMzMsMCwuNjEtLjI3LC42MS0uNjF2LTQuNTlsLjU4LC41OGMuMjQsLjI0LC42MiwuMjQsLjg2LDAsLjI0LS4yNCwuMjQtLjYyLDAtLjg2bC0xLjYxLTEuNjFjLS4yNC0uMjQtLjYyLS4yNC0uODYsMGwtMS42MSwxLjYxYy0uMjQsLjI0LS4yNCwuNjIsMCwuODYsLjI0LC4yNCwuNjIsLjI0LC44NiwwbC41OC0uNTh2NC41OWMwLC4zMywuMjcsLjYxLC42MSwuNjFabS0uNjEsMy42M3Y0LjU5bC0uNTgtLjU4Yy0uMjQtLjI0LS42Mi0uMjQtLjg2LDAtLjI0LC4yNC0uMjQsLjYyLDAsLjg2bDEuNjEsMS42MWMuMjQsLjI0LC42MiwuMjQsLjg2LDBsMS42MS0xLjYxYy4yNC0uMjQsLjI0LS42MiwwLS44Ni0uMjQtLjI0LS42Mi0uMjQtLjg2LDBsLS41OCwuNTh2LTQuNTljMC0uMzMtLjI3LS42MS0uNjEtLjYxcy0uNjEsLjI3LS42MSwuNjFaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/linkedMeshOffsetIcon.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/linkedMeshOffsetIcon.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJpY29ucyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMzMzM7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE4LjE3LDE4LjUxYy0xLjIxLDAtMi4xOSwuOTgtMi4xOSwyLjE5cy45OCwyLjE5LDIuMTksMi4xOWguNDRjLjI0LDAsLjQ0LS4yLC40NC0uNDRzLS4yLS40NC0uNDQtLjQ0aC0uNDRjLS43MywwLTEuMzItLjU5LTEuMzItMS4zMnMuNTktMS4zMiwxLjMyLTEuMzJoLjQ0Yy4yNCwwLC40NC0uMiwuNDQtLjQ0cy0uMi0uNDQtLjQ0LS40NGgtLjQ0Wm0zLjA3LDBjLS4yNCwwLS40NCwuMi0uNDQsLjQ0cy4yLC40NCwuNDQsLjQ0aC40NGMuNzMsMCwxLjMyLC41OSwxLjMyLDEuMzJzLS41OSwxLjMyLTEuMzIsMS4zMmgtLjQ0Yy0uMjQsMC0uNDQsLjItLjQ0LC40NHMuMiwuNDQsLjQ0LC40NGguNDRjMS4yMSwwLDIuMTktLjk4LDIuMTktMi4xOXMtLjk4LTIuMTktMi4xOS0yLjE5aC0uNDRabS0zLjA3LDEuNzZjLS4yNCwwLS40NCwuMi0uNDQsLjQ0cy4yLC40NCwuNDQsLjQ0aDMuNTFjLjI0LDAsLjQ0LS4yLC40NC0uNDRzLS4yLS40NC0uNDQtLjQ0aC0zLjUxWiIvPjxnPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTIxLjYxLDE0LjRoLTQuNTljLS4zMywwLS42MSwuMjctLjYxLC42MXMuMjcsLjYxLC42MSwuNjFoNC41OWwtLjU4LC41OGMtLjI0LC4yNC0uMjQsLjYyLDAsLjg2LC4yNCwuMjQsLjYyLC4yNCwuODYsMGwxLjYxLTEuNjFjLjI0LS4yNCwuMjQtLjYyLDAtLjg2bC0xLjYxLTEuNjFjLS4yNC0uMjQtLjYyLS4yNC0uODYsMC0uMjQsLjI0LS4yNCwuNjIsMCwuODZsLjU4LC41OFoiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xNS4wMSwyMC43MWMwLS41NywuMTgtMS4wOSwuNDctMS41NHYtMi4wNWMwLS4zMy0uMjctLjYxLS42MS0uNjFzLS42LC4yNy0uNiwuNjF2NC41OWwtLjU4LS41OGMtLjI0LS4yNC0uNjItLjI0LS44NiwwLS4yNCwuMjQtLjI0LC42MiwwLC44NmwxLjYxLDEuNjFjLjI0LC4yNCwuNjIsLjI0LC44NiwwbC43Mi0uNzJjLS42Mi0uNTQtMS4wMS0xLjMxLTEuMDEtMi4xN1oiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xMy42OCw4Ljg3bC41OC0uNTh2NC41OWMwLC4zMywuMjcsLjYxLC42LC42MXMuNjEtLjI3LC42MS0uNjF2LTQuNTlsLjU4LC41OGMuMjQsLjI0LC42MiwuMjQsLjg2LDAsLjI0LS4yNCwuMjQtLjYyLDAtLjg2bC0xLjYxLTEuNjFjLS4yNC0uMjQtLjYyLS4yNC0uODYsMGwtMS42MSwxLjYxYy0uMjQsLjI0LS4yNCwuNjIsMCwuODYsLjI0LC4yNCwuNjIsLjI0LC44NiwwWiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTguMTksMTUuNjFoNC41OWMuMzMsMCwuNjEtLjI3LC42MS0uNjFzLS4yNy0uNjEtLjYxLS42MWgtNC41OWwuNTgtLjU4Yy4yNC0uMjQsLjI0LS42MiwwLS44Ni0uMjQtLjI0LS42Mi0uMjQtLjg2LDBsLTEuNjEsMS42MWMtLjI0LC4yNC0uMjQsLjYyLDAsLjg2bDEuNjEsMS42MWMuMjQsLjI0LC42MiwuMjQsLjg2LDAsLjI0LS4yNCwuMjQtLjYyLDAtLjg2bC0uNTgtLjU4WiIvPjwvZz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/marginsIcon.svg":
/*!*****************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/marginsIcon.svg ***!
  \*****************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTIwLjM4LDguNjJjLjQyLDAsLjgxLC4wOCwxLjE5LC4yNXMuNzEsLjM5LDEsLjY4LC41MiwuNjIsLjY4LDFjLjE3LC4zOCwuMjUsLjc4LC4yNiwxLjJ2Ni41MWMwLC40Mi0uMDgsLjgxLS4yNSwxLjE5cy0uMzksLjcxLS42OCwxLS42MiwuNTItMSwuNjgtLjc4LC4yNS0xLjIsLjI2SDkuMTVjLS4zNSwwLS42OS0uMDctMS4wMS0uMnMtLjYtLjMyLS44NS0uNTYtLjQ0LS41Mi0uNTgtLjgzYy0uMTQtLjMyLS4yMi0uNjUtLjIyLTEuMDF2LTcuNTZjMC0uMzUsLjA3LS42OCwuMjEtMSwuMTQtLjMyLC4zMy0uNTksLjU2LS44MnMuNTItLjQyLC44My0uNTYsLjY1LS4yMiwxLS4yMmgxMS4yOVptLS4wNywyLjEzdi0xLjA2SDkuNjh2MS4wNmgxMC42M1ptLTExLjctLjk3Yy0uMjMsLjA4LS40MiwuMi0uNTksLjM3cy0uMjksLjM3LS4zOCwuNmguOTd2LS45N1ptMTMuNTQsLjk3Yy0uMTktLjMzLS40NS0uNTktLjc4LS43OHYuNzhoLjc4Wm0tMTMuNTQsMS4wNmgtMS4wNnY2LjM4aDEuMDZ2LTYuMzhabTExLjcsMEg5LjY4djYuMzhoMTAuNjN2LTYuMzhabTIuMTMsMGgtMS4wNnY2LjM4aDEuMDZ2LTYuMzhabS0xNC44LDcuNDRjLjA4LC4yMywuMjEsLjQzLC4zNywuNnMuMzcsLjMsLjYsLjM3di0uOTdoLS45N1ptMi4wNCwwdjEuMDZoMTAuNjN2LTEuMDZIOS42OFptMTEuNywuNzhjLjMzLS4xOSwuNTktLjQ1LC43OC0uNzhoLS43OHYuNzhaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/pivotIcon.svg":
/*!***************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/pivotIcon.svg ***!
  \***************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsNi45QTguMSw4LjEsMCwxLDAsMjMuMSwxNSw4LjEsOC4xLDAsMCwwLDE1LDYuOVptNi44Niw3LjQ5SDE1LjYzVjguMTRBNi44OSw2Ljg5LDAsMCwxLDIxLjg2LDE0LjM5Wk0xNC40MSw4LjE0djYuMjVIOC4xNEE2Ljg5LDYuODksMCwwLDEsMTQuNDEsOC4xNFpNOC4xNCwxNS42MWg2LjI3djYuMjVBNi44OSw2Ljg5LDAsMCwxLDguMTQsMTUuNjFabTcuNDksNi4yNVYxNS42MWg2LjIzQTYuODksNi44OSwwLDAsMSwxNS42MywyMS44NloiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/positionIcon.svg":
/*!******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/positionIcon.svg ***!
  \******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTYuNTEsMTVhLjYxLjYxLDAsMCwwLC42MS42aDQuNTlsLS41OC41OGEuNi42LDAsMCwwLDAsLjg2LjU5LjU5LDAsMCwwLC44NSwwbDEuNjItMS42MWEuNjIuNjIsMCwwLDAsMC0uODZMMjIsMTNhLjYuNiwwLDEsMC0uODUuODVsLjU4LjU4SDE3LjEyQS42MS42MSwwLDAsMCwxNi41MSwxNVptLTMuNjMtLjYxSDguMjlsLjU4LS41OEEuNi42LDAsMSwwLDgsMTNMNi40LDE0LjU4YS42Mi42MiwwLDAsMCwwLC44Nkw4LDE3LjA1YS41OS41OSwwLDAsMCwuODUsMCwuNi42LDAsMCwwLDAtLjg2bC0uNTgtLjU4aDQuNTlhLjYxLjYxLDAsMSwwLDAtMS4yMVpNMTUsMTMuNDlhLjYxLjYxLDAsMCwwLC42LS42MVY4LjI5bC41OC41OGEuNi42LDAsMCwwLC44NiwwQS42MS42MSwwLDAsMCwxNyw4TDE1LjM5LDYuNGEuNjEuNjEsMCwwLDAtLjg1LDBMMTIuOTIsOGEuNjEuNjEsMCwwLDAsMCwuODUuNi42LDAsMCwwLC44NiwwbC41OC0uNTh2NC41OUEuNjEuNjEsMCwwLDAsMTUsMTMuNDlabS0uNjEsMy42M3Y0LjU5bC0uNTgtLjU4YS42LjYsMCwwLDAtLjg2LDAsLjYxLjYxLDAsMCwwLDAsLjg1bDEuNjIsMS42MmEuNjEuNjEsMCwwLDAsLjg1LDBMMTcsMjJhLjYxLjYxLDAsMCwwLDAtLjg1LjYuNiwwLDAsMC0uODYsMGwtLjU4LjU4VjE3LjEyYS42MS42MSwwLDEsMC0xLjIxLDBaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/resizeToFitIcon.svg":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/resizeToFitIcon.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTAuMzUsOC45M2ExLjQzLDEuNDMsMCwwLDAtMS40MiwxLjQydjEuMjFhLjYxLjYxLDAsMSwxLTEuMjEsMFYxMC4zNWEyLjYzLDIuNjMsMCwwLDEsMi42My0yLjYzaDEuMjFhLjYxLjYxLDAsMSwxLDAsMS4yMVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMjEuMDcsMTAuMzVhMS40MywxLjQzLDAsMCwwLTEuNDItMS40MkgxOC40NGEuNjEuNjEsMCwxLDEsMC0xLjIxaDEuMjFhMi42MywyLjYzLDAsMCwxLDIuNjMsMi42M3YxLjIxYS42MS42MSwwLDEsMS0xLjIxLDBaIiBzdHlsZT0iZmlsbDojMzMzIi8+PHBhdGggZD0iTTIxLjA3LDE5LjY1YTEuNDMsMS40MywwLDAsMS0xLjQyLDEuNDJIMTguNDRhLjYxLjYxLDAsMSwwLDAsMS4yMWgxLjIxYTIuNjMsMi42MywwLDAsMCwyLjYzLTIuNjNWMTguNDRhLjYxLjYxLDAsMSwwLTEuMjEsMFoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNOC45MywxOS42NWExLjQzLDEuNDMsMCwwLDAsMS40MiwxLjQyaDEuMjFhLjYxLjYxLDAsMSwxLDAsMS4yMUgxMC4zNWEyLjYzLDIuNjMsMCwwLDEtMi42My0yLjYzVjE4LjQ0YS42MS42MSwwLDEsMSwxLjIxLDBaIiBzdHlsZT0iZmlsbDojMzMzIi8+PHBhdGggZD0iTTEyLDEwLjE1QTEuODEsMS44MSwwLDAsMCwxMC4xNSwxMlYxOEExLjgxLDEuODEsMCwwLDAsMTIsMTkuODVIMThBMS44MSwxLjgxLDAsMCwwLDE5Ljg1LDE4VjEyQTEuODEsMS44MSwwLDAsMCwxOCwxMC4xNVpNMTEuMzYsMTJhLjYxLjYxLDAsMCwxLC42MS0uNjFIMThhLjYxLjYxLDAsMCwxLC42MS42MVYxOGEuNjEuNjEsMCwwLDEtLjYxLjYxSDEyYS42MS42MSwwLDAsMS0uNjEtLjYxWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/rotationIcon.svg":
/*!******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/rotationIcon.svg ***!
  \******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsNy43M2E3LjI3LDcuMjcsMCwwLDEsNCwxMy4zM2gxLjQzYS42MS42MSwwLDAsMSwuNjEuNjEuNjEuNjEsMCwwLDEtLjUyLjZIMTcuMjJhLjYxLjYxLDAsMCwxLS42LS41MlYxOC40M2EuNi42LDAsMCwxLDEuMi0uMDh2MkE2LjA2LDYuMDYsMCwxLDAsOC45NCwxNWEuNjEuNjEsMCwxLDEtMS4yMSwwQTcuMjYsNy4yNiwwLDAsMSwxNSw3LjczWm0wLDVBMi4yMiwyLjIyLDAsMSwxLDEyLjc4LDE1LDIuMjEsMi4yMSwwLDAsMSwxNSwxMi43OFpNMTUsMTRhMSwxLDAsMSwwLDEsMUExLDEsMCwwLDAsMTUsMTRaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/scaleIcon.svg":
/*!***************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/scaleIcon.svg ***!
  \***************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTAuMTYsMTAuNzZhLjYuNiwwLDAsMSwuNi0uNmgyYS42MS42MSwwLDEsMSwwLDEuMjFoLS41NmwxLjM5LDEuMzlhLjYuNiwwLDAsMS0uODUuODVsLTEuMzktMS4zOXYuNTZhLjYxLjYxLDAsMSwxLTEuMjEsMFoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMTkuMjQsMTkuODVhLjY0LjY0LDAsMCwwLC40My0uMTguNjMuNjMsMCwwLDAsLjE3LS40M3YtMmEuNjEuNjEsMCwxLDAtMS4yMSwwdi41NmwtMS4zOS0xLjM5YS42LjYsMCwxLDAtLjg1Ljg1bDEuMzksMS4zOWgtLjU2YS42MS42MSwwLDAsMCwwLDEuMjJaIiBzdHlsZT0iZmlsbDojMzMzIi8+PHBhdGggZD0iTTE5LjY3LDEwLjMzYS42My42MywwLDAsMSwuMTcuNDN2MmEuNjEuNjEsMCwxLDEtMS4yMSwwdi0uNTZsLTEuMzksMS4zOWEuNi42LDAsMSwxLS44NS0uODVsMS4zOS0xLjM5aC0uNTZhLjYxLjYxLDAsMSwxLDAtMS4yMWgyQS42My42MywwLDAsMSwxOS42NywxMC4zM1oiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMTAuMTYsMTkuMjRhLjU4LjU4LDAsMCwwLC42LjZoMmEuNjEuNjEsMCwxLDAsMC0xLjIxaC0uNTZsMS4zOS0xLjM5YS42LjYsMCwxLDAtLjg1LS44NWwtMS4zOSwxLjM5di0uNTZhLjYxLjYxLDAsMCwwLTEuMjEsMFoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNNy43Myw5LjU1QTEuODMsMS44MywwLDAsMSw5LjU1LDcuNzNoMTAuOWExLjgzLDEuODMsMCwwLDEsMS44MiwxLjgydjEwLjlhMS44MywxLjgzLDAsMCwxLTEuODIsMS44Mkg5LjU1YTEuODMsMS44MywwLDAsMS0xLjgyLTEuODJabTEuODItLjYxYS42Mi42MiwwLDAsMC0uNjEuNjF2MTAuOWEuNjIuNjIsMCwwLDAsLjYxLjYxaDEwLjlhLjYyLjYyLDAsMCwwLC42MS0uNjFWOS41NWEuNjIuNjIsMCwwLDAtLjYxLS42MVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/scrollViewerPrecisionIcon.svg":
/*!*******************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/scrollViewerPrecisionIcon.svg ***!
  \*******************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE0LjIyLDkuNTZ2MS4xM2MwLC40MywuMzUsLjc4LC43OCwuNzhzLjc4LS4zNSwuNzgtLjc4di0xLjEzYzMuMDUsLjM2LDUuNDcsMi43OCw1LjgzLDUuODNoLTEuMTNjLS40MywwLS43OCwuMzUtLjc4LC43OHMuMzUsLjc4LC43OCwuNzhoMS4xM2MtLjE3LDEuNDItLjgyLDIuNy0xLjc1LDMuNzEtLjIyLC4yNC0uMjEsLjYxLC4wMywuODMsLjI0LC4yMiwuNjEsLjIxLC44My0uMDMsMS4yOS0xLjM5LDIuMTEtMy4yMywyLjExLTUuMjksMC00LjMzLTMuNTEtNy44My03LjgzLTcuODNzLTcuODMsMy41MS03LjgzLDcuODNjMCwyLjA2LC44MywzLjkxLDIuMTEsNS4yOSwuMjIsLjI0LC41OSwuMjUsLjgzLC4wMywuMjQtLjIyLC4yNS0uNTksLjAzLS44My0uOTQtMS4wMS0xLjU4LTIuMjktMS43NS0zLjcxaDEuMTNjLjQzLDAsLjc4LS4zNSwuNzgtLjc4cy0uMzUtLjc4LS43OC0uNzhoLTEuMTNjLjE1LTEuMjUsLjY0LTIuNCwxLjM4LTMuMzRsLjc2LC43NmMuMzEsLjMxLC44LC4zMSwxLjExLDAsLjMxLS4zMSwuMzEtLjgsMC0xLjExbC0uNzYtLjc2Yy45NC0uNzQsMi4wOS0xLjI0LDMuMzQtMS4zOFptNC41MSwyLjQxYy0uMTktLjE0LS40NS0uMTQtLjYzLC4wMWwtLjE3LC4xNGMtLjExLC4wOS0uMjYsLjIyLS40NSwuMzgtLjM3LC4zMi0uODgsLjc0LTEuMzksMS4xOC0uNTEsLjQ0LTEuMDQsLjg5LTEuNDYsMS4yNi0uMjEsLjE5LS4zOSwuMzUtLjU0LC40OS0uMTMsLjEzLS4yNiwuMjUtLjMzLC4zMy0uNTEsLjYzLS40LDEuNTUsLjI0LDIuMDUsLjY1LC41LDEuNTksLjM5LDIuMS0uMjQsLjA3LS4wOCwuMTYtLjIzLC4yNS0uMzksLjEtLjE3LC4yMi0uMzgsLjM2LS42MywuMjctLjQ4LC42LTEuMDksLjkyLTEuNjgsLjMyLS41OSwuNjMtMS4xNywuODUtMS42LC4xMS0uMjEsLjIxLS4zOSwuMjctLjUybC4xLS4xOWMuMTEtLjIxLC4wNS0uNDYtLjEzLS42WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/selectAllIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/selectAllIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTIxLjk1LDkuNzhjLjcyLC4yNSwxLjIzLC45MywxLjIzLDEuNzR2OC4xOGMwLDEuOTItMS41NiwzLjQ4LTMuNDgsMy40OEgxMS41MmMtLjgsMC0xLjQ5LS41MS0xLjc0LTEuMjNoOS45MmMxLjI0LDAsMi4yNS0xLDIuMjUtMi4yNVY5Ljc4Wm0tMi42Ni0yLjk3YzEuMDIsMCwxLjg0LC44MiwxLjg0LDEuODR2MTAuNjRjMCwxLjAyLS44MiwxLjg0LTEuODQsMS44NEg4LjY2Yy0xLjAyLDAtMS44NC0uODItMS44NC0xLjg0VjguNjZjMC0xLjAyLC44Mi0xLjg0LDEuODQtMS44NGgxMC42NFptMCwxLjIzSDguNjZjLS4zNCwwLS42MSwuMjctLjYxLC42MXYxMC42NGMwLC4zNCwuMjcsLjYxLC42MSwuNjFoMTAuNjRjLjM0LDAsLjYxLS4yNywuNjEtLjYxVjguNjZjMC0uMzQtLjI3LS42MS0uNjEtLjYxWm0tNi4yNyw2LjQzbDMuMTgtMy4xOGMuMjQtLjI0LC42My0uMjQsLjg3LDAsLjIyLC4yMiwuMjQsLjU2LC4wNiwuOGwtLjA2LC4wNy0zLjY4LDMuNjhjLS4yNCwuMjQtLjYzLC4yNC0uODYsMGwtLjA2LS4wNy0xLjIzLTEuNjRjLS4yLS4yNy0uMTUtLjY2LC4xMi0uODYsLjI1LS4xOCwuNTktLjE2LC44LC4wNWwuMDYsLjA3LC44LDEuMDcsMy4xOC0zLjE4LTMuMTgsMy4xOFoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/shadowBlurIcon.svg":
/*!********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/shadowBlurIcon.svg ***!
  \********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNNy43OSwxNUE3LjIxLDcuMjEsMCwwLDEsMTksOUgxNWE2LDYsMCwwLDAsMCwxMlYxOS44aDUuMzdBNy4yLDcuMiwwLDAsMSw3Ljc5LDE1WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0yMCw5LjhIMTVWMTFoNkE2Ljg0LDYuODQsMCwwLDAsMjAsOS44WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0xNSwxMS44aDYuNDZhNi45Miw2LjkyLDAsMCwxLC40NiwxLjJIMTVaIiBzdHlsZT0iZmlsbDojMzMzIi8+PHBhdGggZD0iTTIyLjExLDEzLjhIMTVWMTVoNy4yMUE3Ljg4LDcuODgsMCwwLDAsMjIuMTEsMTMuOFoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMTUsMTUuOGg3LjE2YTYuMDgsNi4wOCwwLDAsMS0uMjQsMS4ySDE1WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0yMS42NCwxNy44SDE1VjE5aDZBNy4yOSw3LjI5LDAsMCwwLDIxLjY0LDE3LjhaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/shadowColorIcon.svg":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/shadowColorIcon.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNNy43MywxMEEyLjIzLDIuMjMsMCwwLDEsMTAsNy43M2gxMC4xQTIuMjMsMi4yMywwLDAsMSwyMi4yNywxMHYxMC4xYTIuMjMsMi4yMywwLDAsMS0yLjIyLDIuMjJIMTBhMi4yMywyLjIzLDAsMCwxLTIuMjItMi4yMlptMi4yMi0xYTEsMSwwLDAsMC0xLDF2MTAuMWExLDEsMCwwLDAsMSwxaDEwLjFhMSwxLDAsMCwwLDEtMVYxMGExLDEsMCwwLDAtMS0xWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0xOS45MywyMC4wNWwuMTItMTIuMzJBMi4yMywyLjIzLDAsMCwxLDIyLjI3LDEwdjEwLjFhMi4yMywyLjIzLDAsMCwxLTIuMjIsMi4yMkgxMGEyLjIzLDIuMjMsMCwwLDEtMi4yMi0yLjIyWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/shadowOffsetXIcon.svg":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/shadowOffsetXIcon.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTkuMTgsMTEuNzJhLjc3Ljc3LDAsMCwwLS41Ni0uMjUuNzguNzgsMCwwLDAtLjUuMTkuNzUuNzUsMCwwLDAtLjA2LDEuMDZsLjg5LDFIMTYuMTJhLjc1Ljc1LDAsMSwwLDAsMS41SDE5bC0uODksMWEuNzUuNzUsMCwwLDAsLjA2LDEuMDYuNzUuNzUsMCwwLDAsMS4wNi0uMDZsMi0yLjI1YS43Ni43NiwwLDAsMCwwLTFaIiBzdHlsZT0iZmlsbDojMzMzIi8+PHBhdGggZD0iTTIxLjM1LDguNDhhMi4yLDIuMiwwLDAsMC0yLjA2LTEuNDFIOS4yQTIuMjEsMi4yMSwwLDAsMCw3LDkuMjlWMTkuMzhhMi4yMSwyLjIxLDAsMCwwLDEuNjcsMi4xNCwyLjIsMi4yLDAsMCwwLDIuMDYsMS40MUgyMC44QTIuMjEsMi4yMSwwLDAsMCwyMywyMC43MVYxMC42MkEyLjIxLDIuMjEsMCwwLDAsMjEuMzUsOC40OFptLjU4LDcuMTZMMjAuMywxNy40N3YxLjkxYTEsMSwwLDAsMS0xLDFIOS4yYTEsMSwwLDAsMS0xLTFWOS4yOWExLDEsMCwwLDEsMS0xSDE5LjI5YTEsMSwwLDAsMSwxLDF2Mi4xOWwxLjYzLDEuODNBMS43NSwxLjc1LDAsMCwxLDIxLjkzLDE1LjY0WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/showThumbIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/showThumbIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjAuMzMsMTguMDV2MGExLjQzLDEuNDMsMCwwLDAsMS4yMi4zOXYyLjlhMS44NSwxLjg1LDAsMCwxLTEuNzIsMS44NEgxMC4yOGExLjg1LDEuODUsMCwwLDEtMS44NC0xLjcydi0zYTEuNDIsMS40MiwwLDAsMCwxLjEyLS4zbC4xMS0uMXYzLjNhLjYyLjYyLDAsMCwwLC41My42MWg5LjUyYS42Mi42MiwwLDAsMCwuNjEtLjUzVjE4LjA1Wk05LjA4LDEyLjUxYS42MS42MSwwLDAsMSwuMDYuOGwtLjA2LjA3LTEsMWgzLjFhLjU4LjU4LDAsMCwxLC41NC42Mi41OS41OSwwLDAsMS0uNDcuNjFIOC4wOGwxLDFhLjYxLjYxLDAsMCwxLC4wNi44bC0uMDYuMDdhLjYyLjYyLDAsMCwxLS44LjA1bC0uMDctLjA1TDYuMjcsMTUuNTRhLjY1LjY1LDAsMCwxLDAtMS4wOGwxLjk0LTJBLjYyLjYyLDAsMCwxLDkuMDgsMTIuNTFabTExLjg0LDBhLjYxLjYxLDAsMCwxLC44LS4wNmwuMDcuMDYsMS45NCwxLjk0QS42My42MywwLDAsMSwyNCwxNWEuNjcuNjcsMCwwLDEtLjIyLjVsLS4wNywwLTEuOTQsMS45NC0uMDcuMDZhLjYyLjYyLDAsMCwxLS43MiwwbC0uMDgtLjA3LS4wNi0uMDdhLjYuNiwwLDAsMSwwLS43MmwuMDYtLjA4LDEtMUgxOC43NWEuNTkuNTksMCwwLDEtLjQ3LS42MS41OC41OCwwLDAsMSwuNDctLjYxaDMuMTdsLTEtMS0uMDYtLjA3QS42MS42MSwwLDAsMSwyMC45MiwxMi41MVpNMTkuNzIsNi44YTEuODUsMS44NSwwLDAsMSwxLjg0LDEuNzJ2M2ExLjQ0LDEuNDQsMCwwLDAtMS4xMi4zMWwtLjExLjFWOC42NEEuNjIuNjIsMCwwLDAsMTkuOCw4SDEwLjI4YS42Mi42MiwwLDAsMC0uNjEuNTN2My4zOGgwYTEuNDQsMS40NCwwLDAsMC0xLjIyLS40VjguNjRBMS44NSwxLjg1LDAsMCwxLDEwLjE2LDYuOGg5LjU2WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/sizeIcon.svg":
/*!**************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/sizeIcon.svg ***!
  \**************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTAsN2EzLDMsMCwwLDAtMywzdjMuNWEuNS41LDAsMCwwLDEsMFYxMGEyLDIsMCwwLDEsMi0yaDMuNWEuNS41LDAsMCwwLDAtMVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMTYuNSw3YS41LjUsMCwwLDAsMCwxSDIwYTIsMiwwLDAsMSwyLDJ2My41YS41LjUsMCwwLDAsMSwwVjEwYTMsMywwLDAsMC0zLTNaIiBzdHlsZT0iZmlsbDojMzMzIi8+PHBhdGggZD0iTTcuNSwxNmEuNS41LDAsMCwxLC41LjVWMjBhMiwyLDAsMCwwLDIsMmgzLjVhLjUuNSwwLDAsMSwwLDFIMTBhMywzLDAsMCwxLTMtM1YxNi41QS41LjUsMCwwLDEsNy41LDE2WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0yMywxNi41YS41LjUsMCwwLDAtMSwwVjIwYTIsMiwwLDAsMS0yLDJIMTYuNWEuNS41LDAsMCwwLDAsMUgyMGEzLDMsMCwwLDAsMy0zWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/sliderBackgroundImageIcon.svg":
/*!*******************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/sliderBackgroundImageIcon.svg ***!
  \*******************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTUuODEsMTEuNzdBMS44MiwxLjgyLDAsMSwwLDE3LjYzLDEwLDEuODEsMS44MSwwLDAsMCwxNS44MSwxMS43N1ptMS44Mi0uNjFhLjYxLjYxLDAsMSwxLS42MS42MUEuNjEuNjEsMCwwLDEsMTcuNjMsMTEuMTZaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuMDYsOS4zNEgxOC40M2EyLjU1LDIuNTUsMCwwLDEsMS40NSwxLjIxaDEuMThBMi40MywyLjQzLDAsMCwxLDIzLjQ5LDEzVjE3YTIuNDMsMi40MywwLDAsMS0yLjQzLDIuNDJIMjAuOWwtNC42My00LjUzLS4xLS4xYTEuODIsMS44MiwwLDAsMC0yLjQ0LjFMOS4xLDE5LjQ1SDguOTRBMi40MywyLjQzLDAsMCwxLDYuNTEsMTdWMTNhMi40MywyLjQzLDAsMCwxLDIuNDMtMi40Mmg2LjQ0YTIuNTQsMi41NCwwLDAsMSwxLjQ2LTEuMjFIOC45NEEzLjY0LDMuNjQsMCwwLDAsNS4zLDEzVjE3YTMuNjQsMy42NCwwLDAsMCwzLjY0LDMuNjNIMjEuMDZBMy42NCwzLjY0LDAsMCwwLDI0LjcsMTdWMTNBMy42NCwzLjY0LDAsMCwwLDIxLjA2LDkuMzRabS02LjQ4LDYuNDUuMDYtLjA2YS42MS42MSwwLDAsMSwuNzguMDZsMy43NSwzLjY2SDEwLjgzWiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/sliderValueIcon.svg":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/sliderValueIcon.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTQuMTgsNy42NEEuNjEuNjEsMCwwLDAsMTMsNy40MWwtLjgyLDQuMzZIOC4zM2EuNjEuNjEsMCwwLDAsMCwxLjIxaDMuNmwtLjc3LDRINy41M2EuNjEuNjEsMCwxLDAsMCwxLjIxSDExbC0uNzksNC4xM2EuNjEuNjEsMCwwLDAsLjQ5LjcxLjYuNiwwLDAsMCwuNy0uNDhsLjgzLTQuMzZIMTYuNmwtLjc4LDQuMTNhLjYxLjYxLDAsMSwwLDEuMTkuMjNsLjgyLTQuMzZoMy44NGEuNjEuNjEsMCwwLDAsMC0xLjIxaC0zLjZsLjc3LTRoMy42NGEuNjEuNjEsMCwxLDAsMC0xLjIxSDE5LjA2bC43OC00LjEyYS42MS42MSwwLDAsMC0uNDktLjcxLjYuNiwwLDAsMC0uNy40OGwtLjgzLDQuMzVIMTMuNFptLTEsNS4zNGg0LjQybC0uNzYsNEgxMi40MVoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/sliderValueMaximumIcon.svg":
/*!****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/sliderValueMaximumIcon.svg ***!
  \****************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTMuNzgsNy4yNGEuNjEuNjEsMCwwLDAtLjQ5LS43MS42LjYsMCwwLDAtLjcuNDhsLS44Myw0LjM1SDcuOTNhLjYyLjYyLDAsMCwwLS42LjYxLjYuNiwwLDAsMCwuNi42MWgzLjZsLS43Niw0SDcuMTJhLjYxLjYxLDAsMCwwLDAsMS4yMWgzLjQyTDkuNzYsMjJhLjYxLjYxLDAsMSwwLDEuMTkuMjJsLjgyLTQuMzVoMi4xNmE1LjE4LDUuMTgsMCwwLDEsLjQ1LTEuMjFIMTJsLjc3LTRoNC40MmwtLjMyLDEuNjlhNC44Niw0Ljg2LDAsMCwxLDEuMzEtLjRsLjI0LTEuMjloMy42NWEuNjEuNjEsMCwwLDAsMC0xLjIxSDE4LjY1bC43OC00LjEyQS42MS42MSwwLDAsMCwxOC4yNCw3bC0uODIsNC4zNUgxM1pNMTksMTQuNkE0LjQ0LDQuNDQsMCwxLDEsMTQuNiwxOSw0LjQ0LDQuNDQsMCwwLDEsMTksMTQuNlptLjEsMS42My0uMDcsMGgtLjEzbC0uMDcsMC0uMDYsMCwwLDAtMiwyLDAsLjA2YS4zOS4zOSwwLDAsMCwwLC40NmwwLC4wNS4wNiwwYS40My40MywwLDAsMCwuNDYsMGwuMDYsMCwxLjMyLTEuMzN2NC4zNWEuNC40LDAsMCwwLC4zMy4zMmguMTRhLjQuNCwwLDAsMCwuMzMtLjMyVjE3LjU5bDEuMzMsMS4zMy4wNiwwYS40LjQsMCwwLDAsLjU2LS41NmwtLjA1LS4wNkwxOS4yOSwxNi4zbDAsMC0uMDYsMFoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/sliderValueMinimumIcon.svg":
/*!****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/sliderValueMinimumIcon.svg ***!
  \****************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTMuNzgsNy4yNGEuNjEuNjEsMCwwLDAtLjQ5LS43MS42LjYsMCwwLDAtLjcuNDhsLS44Myw0LjM1SDcuOTNhLjYyLjYyLDAsMCwwLS42LjYxLjYuNiwwLDAsMCwuNi42MWgzLjZsLS43Niw0SDcuMTJhLjYxLjYxLDAsMCwwLDAsMS4yMWgzLjQyTDkuNzYsMjJhLjYxLjYxLDAsMSwwLDEuMTkuMjJsLjgyLTQuMzVoMi4xNmE1LjE4LDUuMTgsMCwwLDEsLjQ1LTEuMjFIMTJsLjc3LTRoNC40MmwtLjMyLDEuNjlhNC44Niw0Ljg2LDAsMCwxLDEuMzEtLjRsLjI0LTEuMjloMy42NWEuNjEuNjEsMCwwLDAsMC0xLjIxSDE4LjY1bC43OC00LjEyQS42MS42MSwwLDAsMCwxOC4yNCw3bC0uODIsNC4zNUgxM1pNMTQuNiwxOUE0LjQ0LDQuNDQsMCwxLDEsMTksMjMuNDgsNC40NCw0LjQ0LDAsMCwxLDE0LjYsMTlabTQuNTksMi44LjA2LDAsMCwwLDIuMDUtMi4wNS4wNS0uMDZhLjQuNCwwLDAsMC0uNTYtLjU2bC0uMDYuMDUtMS4zMywxLjMzVjE2LjE0YS40LjQsMCwwLDAtLjMzLS4zM0gxOWEuNC40LDAsMCwwLS4zMy4zM3Y0LjM1bC0xLjMyLTEuMzMtLjA2LS4wNWEuNDMuNDMsMCwwLDAtLjQ2LDBsLS4wNi4wNSwwLC4wNWEuMzkuMzksMCwwLDAsMCwuNDZsMCwuMDYsMiwyLDAsMCwuMDYsMCwuMDcsMGguMTNsLjA3LDBaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/stackPanelSpacingIcon.svg":
/*!***************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/stackPanelSpacingIcon.svg ***!
  \***************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTIxLjA1LDExLjQ1djIuMzJjMCwuMzYtLjI5LC42NS0uNjUsLjY1cy0uNjUtLjI5LS42NS0uNjV2LTIuMzJsLS4xOSwuMTljLS4yNSwuMjUtLjY2LC4yNS0uOTIsMC0uMjUtLjI1LS4yNS0uNjYsMC0uOTJsMS4zLTEuM2MuMDYtLjA2LC4xMy0uMTEsLjIxLS4xNCwuMDgtLjAzLC4xNi0uMDUsLjI1LS4wNXMuMTcsLjAyLC4yNSwuMDVjLjA4LC4wMywuMTUsLjA4LC4yMSwuMTRsMS4zLDEuM2MuMjUsLjI1LC4yNSwuNjYsMCwuOTItLjI1LC4yNS0uNjYsLjI1LS45MiwwbC0uMTktLjE5Wm0wLDQuOTJ2Mi4zMmwuMTktLjE5Yy4yNS0uMjUsLjY2LS4yNSwuOTIsMCwuMjUsLjI1LC4yNSwuNjYsMCwuOTJsLTEuMywxLjNjLS4yNSwuMjUtLjY2LC4yNS0uOTIsMGwtMS4zLTEuM2MtLjI1LS4yNS0uMjUtLjY2LDAtLjkyLC4yNS0uMjUsLjY2LS4yNSwuOTIsMGwuMTksLjE5di0yLjMyYzAtLjM2LC4yOS0uNjUsLjY1LS42NXMuNjUsLjI5LC42NSwuNjVaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0xNC41NiwxNC4zMmgtNC4yOGMtMS40NSwwLTIuNjItMS4xOC0yLjYyLTIuNjJ2LTMuNTVjMC0xLjQ1LDEuMTgtMi42MiwyLjYyLTIuNjJoNC4yOGMxLjQ1LDAsMi42MiwxLjE4LDIuNjIsMi42MnYzLjU1YzAsMS40NS0xLjE4LDIuNjItMi42MiwyLjYyWm0tNC4yOC03LjU1Yy0uNzYsMC0xLjM4LC42Mi0xLjM4LDEuMzh2My41NWMwLC43NiwuNjIsMS4zOCwxLjM4LDEuMzhoNC4yOGMuNzYsMCwxLjM4LS42MiwxLjM4LTEuMzh2LTMuNTVjMC0uNzYtLjYyLTEuMzgtMS4zOC0xLjM4aC00LjI4WiIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNMTQuNTYsMjQuNDhoLTQuMjhjLTEuNDUsMC0yLjYyLTEuMTgtMi42Mi0yLjYydi0zLjU1YzAtMS40NSwxLjE4LTIuNjIsMi42Mi0yLjYyaDQuMjhjMS40NSwwLDIuNjIsMS4xOCwyLjYyLDIuNjJ2My41NWMwLDEuNDUtMS4xOCwyLjYyLTIuNjIsMi42MlptLTQuMjgtNy41NWMtLjc2LDAtMS4zOCwuNjItMS4zOCwxLjM4djMuNTVjMCwuNzYsLjYyLDEuMzgsMS4zOCwxLjM4aDQuMjhjLjc2LDAsMS4zOC0uNjIsMS4zOC0xLjM4di0zLjU1YzAtLjc2LS42Mi0xLjM4LTEuMzgtMS4zOGgtNC4yOFoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/stretchFillIcon.svg":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/stretchFillIcon.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTEuNzcsMTIuOTNhLjYxLjYxLDAsMCwxLC4wNi44NmwtLjU0LjYxSDEzLjZhLjYuNiwwLDAsMSwwLDEuMkgxMS4yOWwuNTQuNjFhLjYxLjYxLDAsMCwxLS45Mi44TDkuNSwxNS40YS42MS42MSwwLDAsMSwwLS44TDEwLjkxLDEzQS42MS42MSwwLDAsMSwxMS43NywxMi45M1ptNi40Mi44NmEuNjEuNjEsMCwxLDEsLjkxLS44bDEuNDEsMS42MWEuNjEuNjEsMCwwLDEsMCwuOEwxOS4xLDE3YS42MS42MSwwLDEsMS0uOTEtLjhsLjUzLS42MUgxNi40MWEuNi42LDAsMCwxLDAtMS4yaDIuMzFaTTYuOTMsMTAuMzZBMS44MiwxLjgyLDAsMCwxLDguNzUsOC41NWgxMi41YTEuODEsMS44MSwwLDAsMSwxLjgxLDEuODF2OS4yOGExLjgxLDEuODEsMCwwLDEtMS44MSwxLjgxSDguNzVhMS44MiwxLjgyLDAsMCwxLTEuODItMS44MVptMS44Mi0uNmEuNi42LDAsMCwwLS42MS42djkuMjhhLjYuNiwwLDAsMCwuNjEuNmgxMi41YS42LjYsMCwwLDAsLjYtLjZWMTAuMzZhLjYuNiwwLDAsMC0uNi0uNloiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/strokeWeightIcon.svg ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNNy43MywxMEEyLjIzLDIuMjMsMCwwLDEsMTAsNy43M2gxMC4xQTIuMjMsMi4yMywwLDAsMSwyMi4yNywxMHYxMC4xYTIuMjMsMi4yMywwLDAsMS0yLjIyLDIuMjJIMTBhMi4yMywyLjIzLDAsMCwxLTIuMjItMi4yMlptMi4yMi0xYTEsMSwwLDAsMC0xLDF2MTAuMWExLDEsMCwwLDAsMSwxaDEwLjFhMSwxLDAsMCwwLDEtMVYxMGExLDEsMCwwLDAtMS0xWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/subtractGridElementDark.svg":
/*!*****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/subtractGridElementDark.svg ***!
  \*****************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsNi45NEE4LjA2LDguMDYsMCwxLDEsNi45NCwxNSw4LjA2LDguMDYsMCwwLDEsMTUsNi45NFptMCwxLjIxQTYuODUsNi44NSwwLDEsMCwyMS44NSwxNSw2Ljg0LDYuODQsMCwwLDAsMTUsOC4xNVptMy40Myw2LjI1YS42LjYsMCwxLDEsMCwxLjJIMTEuNTdhLjYuNiwwLDAsMSwwLTEuMloiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/textIcon.svg":
/*!**************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/textIcon.svg ***!
  \**************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE2LjU1LDExLjk2Yy0uMiwwLS4zOSwuMDgtLjUzLC4yMi0uMTQsLjE0LS4yMiwuMzMtLjIyLC41M3MuMDgsLjM5LC4yMiwuNTNjLjE0LC4xNCwuMzMsLjIyLC41MywuMjJoMS41NXY0Ljk5YzAsMS42OCwxLjM3LDMuMDQsMy4wNCwzLjA0aDEuMTVjLjQxLDAsLjc1LS4zMywuNzUtLjc1cy0uMzMtLjc1LS43NS0uNzVoLTEuMTVjLS44NSwwLTEuNTUtLjctMS41NS0xLjU1di00Ljk5aDIuN2MuMiwwLC4zOS0uMDgsLjUzLS4yMiwuMTQtLjE0LC4yMi0uMzMsLjIyLS41M3MtLjA4LS4zOS0uMjItLjUzYy0uMTQtLjE0LS4zMy0uMjItLjUzLS4yMmgtMi43di0yLjdjMC0uNDEtLjMzLS43NS0uNzUtLjc1cy0uNzUsLjMzLS43NSwuNzV2Mi43aC0xLjU1Wm0tOC44My0zLjQ0Yy0uNDEsMC0uNzUsLjMzLS43NSwuNzVzLjMzLC43NSwuNzUsLjc1aDIuN3YxMC43M2MwLC40MSwuMzMsLjc1LC43NSwuNzVzLjc1LS4zMywuNzUtLjc1VjEwLjAxaDIuN2MuNDEsMCwuNzUtLjMzLC43NS0uNzVzLS4zMy0uNzUtLjc1LS43NUg3LjcxWiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/textInputIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/textInputIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE1LjY1LDEzLjQ1Yy4yLDAsLjM5LS4wOCwuNTMtLjIyLC4xNC0uMTQsLjIyLS4zMywuMjItLjUzcy0uMDgtLjM5LS4yMi0uNTNjLS4xNC0uMTQtLjMzLS4yMi0uNTMtLjIyaC0yLjd2LTIuN2MwLS40MS0uMzMtLjc1LS43NS0uNzVzLS43NSwuMzMtLjc1LC43NXYyLjdoLTEuNTVjLS4yLDAtLjM5LC4wOC0uNTMsLjIyLS4xNCwuMTQtLjIyLC4zMy0uMjIsLjUzcy4wOCwuMzksLjIyLC41M2MuMTQsLjE0LC4zMywuMjIsLjUzLC4yMmgxLjU1djQuOTljMCwxLjY4LDEuMzcsMy4wNCwzLjA0LDMuMDRoMS4xNWMuNDEsMCwuNzUtLjMzLC43NS0uNzVzLS4zMy0uNzUtLjc1LS43NWgtMS4xNWMtLjg1LDAtMS41NS0uNy0xLjU1LTEuNTV2LTQuOTloMi43WiIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNMjAuMjEsNC44MmMtLjM0LDAtLjYyLC4yOC0uNjIsLjYyVjI0LjU1YzAsLjM0LC4yOCwuNjIsLjYyLC42MnMuNjItLjI4LC42Mi0uNjJWNS40NWMwLS4zNC0uMjgtLjYyLS42Mi0uNjJaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/textPlaceholderIcon.svg":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/textPlaceholderIcon.svg ***!
  \*************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTEyLjI3LDcuNDJINS4zOGMtLjQxLDAtLjc1LC4zMy0uNzUsLjc1cy4zMywuNzUsLjc1LC43NWgyLjd2MTAuNzNjMCwuNDEsLjMzLC43NSwuNzUsLjc1cy43NS0uMzMsLjc1LS43NVY4LjkxaDIuN2MuNDEsMCwuNzUtLjMzLC43NS0uNzVzLS4zMy0uNzUtLjc1LS43NVoiLz48cGF0aCBjbGFzcz0iYiIgZD0iTTE3LjI1LDEyLjM1aDIuN2MuMiwwLC4zOS0uMDgsLjUzLS4yMiwuMTQtLjE0LC4yMi0uMzMsLjIyLS41M3MtLjA4LS4zOS0uMjItLjUzYy0uMTQtLjE0LS4zMy0uMjItLjUzLS4yMmgtMi43di0yLjdjMC0uNDEtLjMzLS43NS0uNzUtLjc1cy0uNzUsLjMzLS43NSwuNzV2Mi43aC0xLjU1Yy0uMiwwLS4zOSwuMDgtLjUzLC4yMi0uMTQsLjE0LS4yMiwuMzMtLjIyLC41M3MuMDgsLjM5LC4yMiwuNTNjLjE0LC4xNCwuMzMsLjIyLC41MywuMjJoMS41NXY0Ljk5YzAsLjUsLjE0LC45NywuMzUsMS4zOSwuMjMtLjc1LC42Mi0xLjQzLDEuMTQtMnYtNC4zOVoiLz48cGF0aCBjbGFzcz0iYiIgZD0iTTIyLjIxLDIwLjEzaC0xLjA3di0xLjQ5YzAtLjM0LS4yOC0uNjItLjYyLS42MnMtLjYyLC4yOC0uNjIsLjYydjIuMTJjMCwuMzQsLjI4LC42MiwuNjIsLjYyaDEuNjljLjM0LDAsLjYyLS4yOCwuNjItLjYycy0uMjgtLjYyLS42Mi0uNjJaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0yMS4wNCwxNS45M2MtMi4zOSwwLTQuMzMsMS45NC00LjMzLDQuMzNzMS45NCw0LjMzLDQuMzMsNC4zMyw0LjMzLTEuOTQsNC4zMy00LjMzLTEuOTQtNC4zMy00LjMzLTQuMzNabTAsNy40Yy0xLjcsMC0zLjA4LTEuMzgtMy4wOC0zLjA4czEuMzgtMy4wOCwzLjA4LTMuMDgsMy4wOCwxLjM4LDMuMDgsMy4wOC0xLjM4LDMuMDgtMy4wOCwzLjA4WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/thumbCircleIcon.svg":
/*!*********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/thumbCircleIcon.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTUsOC4xM0E2Ljg3LDYuODcsMCwxLDAsMjEuODcsMTUsNi44Niw2Ljg2LDAsMCwwLDE1LDguMTNaTTYuOTEsMTVBOC4wOSw4LjA5LDAsMSwxLDE1LDIzLjA5LDguMDksOC4wOSwwLDAsMSw2LjkxLDE1WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/thumbImageLinkIcon.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/thumbImageLinkIcon.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTUsNi45MUE4LjA5LDguMDksMCwxLDAsMjMuMDksMTUsOC4wOSw4LjA5LDAsMCwwLDE1LDYuOTFabTAsMS4yMkE2Ljg3LDYuODcsMCwwLDEsMjAuNTksMTlsLTQuMzItNC4yMy0uMTEtLjA5YTEuOCwxLjgsMCwwLDAtMi40My4wOUw5LjQxLDE5QTYuODcsNi44NywwLDAsMSwxNSw4LjEzWk0xMC4yLDE5LjkxbDQuMzgtNC4yOS4wNywwYS41OC41OCwwLDAsMSwuNzcsMGw0LjM4LDQuMjlhNi44Niw2Ljg2LDAsMCwxLTkuNiwwWiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE3LjYyLDEzLjQ0YTEuODEsMS44MSwwLDEsMC0xLjgyLTEuODFBMS44MSwxLjgxLDAsMCwwLDE3LjYyLDEzLjQ0Wm0wLTIuNDFhLjYxLjYxLDAsMSwxLS42MS42QS42LjYsMCwwLDEsMTcuNjIsMTFaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleMixedIcon_30px.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleMixedIcon_30px.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTIwLDIwSDEwYy0yLjc2LDAtNS0yLjI0LTUtNSwwLTIuNzYsMi4yNC01LDUtNWgxMGMyLjc2LDAsNSwyLjI0LDUsNSwwLDIuNzYtMi4yNCw1LTUsNVpNMTAsMTEuNWMtMS45MywwLTMuNSwxLjU3LTMuNSwzLjVzMS41NywzLjUsMy41LDMuNWgxMGMxLjkzLDAsMy41LTEuNTcsMy41LTMuNXMtMS41Ny0zLjUtMy41LTMuNUgxMFoiLz48cmVjdCBjbGFzcz0iYiIgeD0iMTEuMDMiIHk9IjE0LjI1IiB3aWR0aD0iNy45NCIgaGVpZ2h0PSIxLjUiIHJ4PSIuNzUiIHJ5PSIuNzUiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_30px.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_30px.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTAuMjUsMTcuNWEyLjUsMi41LDAsMSwxLDIuNS0yLjVBMi41LDIuNSwwLDAsMSwxMC4yNSwxNy41WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0yMCwyMEgxMGE1LDUsMCwwLDEsMC0xMEgyMGE1LDUsMCwwLDEsMCwxMFpNMTAsMTEuNWEzLjUsMy41LDAsMCwwLDAsN0gyMGEzLjUsMy41LDAsMCwwLDAtN1oiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_40px.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_40px.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE1LjI1LDIyLjVjLTEuMzgsMC0yLjUtMS4xMi0yLjUtMi41LDAtMS4zOCwxLjEyLTIuNSwyLjUtMi41czIuNSwxLjEyLDIuNSwyLjVjMCwxLjM4LTEuMTIsMi41LTIuNSwyLjVaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0yNSwyNUgxNWMtMi43NiwwLTUtMi4yNC01LTUsMC0yLjc2LDIuMjQtNSw1LTVoMTBjMi43NiwwLDUsMi4yNCw1LDUsMCwyLjc2LTIuMjQsNS01LDVabS0xMC04LjVjLTEuOTMsMC0zLjUsMS41Ny0zLjUsMy41czEuNTcsMy41LDMuNSwzLjVoMTBjMS45MywwLDMuNS0xLjU3LDMuNS0zLjVzLTEuNTctMy41LTMuNS0zLjVIMTVaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_30px.svg":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_30px.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTkuNzUsMTcuNWEyLjUsMi41LDAsMSwwLTIuNS0yLjVBMi41LDIuNSwwLDAsMCwxOS43NSwxNy41WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik01LDE1YTUsNSwwLDAsMSw1LTVIMjBhNSw1LDAsMCwxLDAsMTBIMTBBNSw1LDAsMCwxLDUsMTVabTUtMy41YTMuNSwzLjUsMCwwLDAsMCw3SDIwYTMuNSwzLjUsMCwwLDAsMC03WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_40px.svg":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_40px.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTI0Ljc1LDIyLjVjMS4zOCwwLDIuNS0xLjEyLDIuNS0yLjVzLTEuMTItMi41LTIuNS0yLjUtMi41LDEuMTItMi41LDIuNSwxLjEyLDIuNSwyLjUsMi41WiIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNMTAsMjBjMC0yLjc2LDIuMjQtNSw1LTVoMTBjMi43NiwwLDUsMi4yNCw1LDVzLTIuMjQsNS01LDVIMTVjLTIuNzYsMC01LTIuMjQtNS01Wm01LTMuNWMtMS45MywwLTMuNSwxLjU3LTMuNSwzLjVzMS41NywzLjUsMy41LDMuNWgxMGMxLjkzLDAsMy41LTEuNTcsMy41LTMuNXMtMS41Ny0zLjUtMy41LTMuNUgxNVoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/vAlignBottomIcon.svg":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/vAlignBottomIcon.svg ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTAuNzcsMTYuMjFoOC40NmEuNi42LDAsMCwxLC4wOCwxLjJIMTAuNzdhLjYxLjYxLDAsMCwxLS4wOC0xLjIxWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0xOS4yMywxOC42M0gxMC42OWEuNi42LDAsMCwwLC4wOCwxLjJoOC41NGEuNi42LDAsMCwwLS4wOC0xLjJaIiBzdHlsZT0iZmlsbDojMzMzIi8+PHBhdGggZD0iTTIyLjI1LDEwQTIuMjEsMi4yMSwwLDAsMCwyMCw3Ljc1SDEwQTIuMjEsMi4yMSwwLDAsMCw3Ljc1LDEwVjIwQTIuMjEsMi4yMSwwLDAsMCwxMCwyMi4yNUgyMEEyLjIxLDIuMjEsMCwwLDAsMjIuMjUsMjBaTTEwLDlIMjBhMSwxLDAsMCwxLDEsMVYyMGExLDEsMCwwLDEtMSwxSDEwYTEsMSwwLDAsMS0xLTFWMTBBMSwxLDAsMCwxLDEwLDlaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/vAlignCenterIcon.svg":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/vAlignCenterIcon.svg ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTEsMTMuMzloOGEuNzIuNzIsMCwwLDEsLjguNjEuNjkuNjksMCwwLDEtLjY5LjU5SDExYy0uNDQsMC0uOC0uMjctLjgtLjZhLjY5LjY5LDAsMCwxLC42OS0uNloiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMTksMTUuOEgxMC44N2EuNjkuNjksMCwwLDAtLjY5LjZjMCwuMzMuMzYuNi44LjZoOC4xNWEuNjkuNjksMCwwLDAsLjY5LS41OUEuNzIuNzIsMCwwLDAsMTksMTUuOFoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMjIuMjMsMTBBMi4yMSwyLjIxLDAsMCwwLDIwLDcuNzdIMTBBMi4yMSwyLjIxLDAsMCwwLDcuNzcsMTBWMjBBMi4yMSwyLjIxLDAsMCwwLDEwLDIyLjIzSDIwQTIuMjEsMi4yMSwwLDAsMCwyMi4yMywyMFpNMTAsOUgyMGExLDEsMCwwLDEsMSwxVjIwYTEsMSwwLDAsMS0xLDFIMTBhMSwxLDAsMCwxLTEtMVYxMEExLDEsMCwwLDEsMTAsOVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/vAlignTopIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/vAlignTopIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMjIuMjksOS45NGEyLjIzLDIuMjMsMCwwLDAtMi4yMy0yLjIzSDkuOTRBMi4yMywyLjIzLDAsMCwwLDcuNzEsOS45NFYyMC4wNmEyLjIzLDIuMjMsMCwwLDAsMi4yMywyLjIzSDIwLjA2YTIuMjMsMi4yMywwLDAsMCwyLjIzLTIuMjNabS0xMi4zNS0xSDIwLjA2YTEsMSwwLDAsMSwxLDFWMjAuMDZhMSwxLDAsMCwxLTEsMUg5Ljk0YTEsMSwwLDAsMS0xLTFWOS45NEExLDEsMCwwLDEsOS45NCw4LjkyWm0uODEsMi40M2g4LjVhLjYxLjYxLDAsMCwxLC42MS42MS42LjYsMCwwLDEtLjUyLjZIMTAuNzVhLjYxLjYxLDAsMCwxLS4wOS0xLjIxWm04LjUsMi40M0gxMC42NkEuNjEuNjEsMCwwLDAsMTAuNzUsMTVoOC41OWEuNi42LDAsMCwwLC41Mi0uNkEuNjEuNjEsMCwwLDAsMTkuMjUsMTMuNzhaIiBzdHlsZT0iZmlsbDojMzMzIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/valueBarImageLinkIcon.svg":
/*!***************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/valueBarImageLinkIcon.svg ***!
  \***************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTcuNjIsMTAuNTRBMS44MSwxLjgxLDAsMSwwLDE1LjgsOC43MywxLjgxLDEuODEsMCwwLDAsMTcuNjIsMTAuNTRabTAtMi40MWEuNi42LDAsMCwxLC42LjYuNjEuNjEsMCwxLDEtMS4yMSwwQS42LjYsMCwwLDEsMTcuNjIsOC4xM1oiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0yMS43NSwxOC41OEg4LjI1YTIuMjUsMi4yNSwwLDAsMCwwLDQuNWgxMy41YTIuMjUsMi4yNSwwLDAsMCwwLTQuNVptMCwzSDguMjVhLjc1Ljc1LDAsMCwxLDAtMS41aDEzLjVhLjc1Ljc1LDAsMCwxLDAsMS41WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTcuMjIsMTcuMzhIMjIuNTVhLjUuNSwwLDAsMCwuNDQtLjUuNTEuNTEsMCwwLDAtLjUxLS41SDIwLjg3bC00LjYtNC41MS0uMTEtLjA5YTEuOCwxLjgsMCwwLDAtMi40My4wOWwtNC42LDQuNTFoLTJhLjUxLjUxLDAsMCwwLS40My41QS41LjUsMCwwLDAsNy4yMiwxNy4zOFptNy4zNi00LjY2LjA3LS4wNmEuNTkuNTksMCwwLDEsLjc3LjA2bDMuNzMsMy42NWgtOC4zWiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/valueChangedGridDark.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/valueChangedGridDark.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTQuMjEsNmEuNjIuNjIsMCwwLDAtLjg2LDAsLjYyLjYyLDAsMCwwLDAsLjg3bDEuNCwxLjRhNy45MSw3LjkxLDAsMSwwLDguMTcsNy45MXYwYS41OC41OCwwLDAsMC0uNTktLjU2aDBhLjU5LjU5LDAsMCwwLS41OC42MSw2LjcsNi43LDAsMSwxLTctNi43bC0xLjM5LDEuNGEuNi42LDAsMCwwLDAsLjg2LjYyLjYyLDAsMCwwLC44NiwwbDIuNDQtMi40NGEuNi42LDAsMCwwLDAtLjg2Wm00Ljg3LDcuMzFhLjYuNiwwLDAsMSwwLC44NmwtMy42NSwzLjY2YS42Mi42MiwwLDAsMS0uODYsMEwxMi43NCwxNmEuNjEuNjEsMCwwLDEsLjg2LS44NkwxNSwxNi41N2wzLjIyLTMuMjJBLjYuNiwwLDAsMSwxOS4wOCwxMy4zNVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/verticalMarginIcon.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/verticalMarginIcon.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMjEuNjMsOWEuNi42LDAsMCwwLDAtMS4ySDguMzdhLjYuNiwwLDAsMCwwLDEuMloiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNMjEuNjMsMjIuMjNhLjYuNiwwLDAsMCwwLTEuMkg4LjM3YS42LjYsMCwwLDAsMCwxLjJaIiBzdHlsZT0iZmlsbDojMzMzIi8+PHBhdGggZD0iTTEwLjc4LDExLjc5YTEuNDEsMS40MSwwLDAsMC0xLjQxLDEuNHYzLjYyYTEuNDEsMS40MSwwLDAsMCwxLjQxLDEuNGg4LjQ0YTEuNDEsMS40MSwwLDAsMCwxLjQxLTEuNFYxMy4xOWExLjQxLDEuNDEsMCwwLDAtMS40MS0xLjRabS0uMiwxLjRhLjIuMiwwLDAsMSwuMi0uMmg4LjQ0YS4yLjIsMCwwLDEsLjIuMnYzLjYyYS4yLjIsMCwwLDEtLjIuMkgxMC43OGEuMi4yLDAsMCwxLS4yLS4yWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/verticalSliderIcon.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/verticalSliderIcon.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTguMDgsNi43OWExLjg1LDEuODUsMCwwLDEsMS44NSwxLjg1VjIxLjM2YTEuODUsMS44NSwwLDAsMS0xLjg1LDEuODVIMTEuOTJhMS44NSwxLjg1LDAsMCwxLTEuODUtMS44NVY4LjY0YTEuODUsMS44NSwwLDAsMSwxLjg1LTEuODVabTAsMS4yM0gxMS45MmEuNjEuNjEsMCwwLDAtLjYxLjYyVjIxLjM2YS42MS42MSwwLDAsMCwuNjEuNjJoNi4xNmEuNjEuNjEsMCwwLDAsLjYxLS42MlY4LjY0QS42MS42MSwwLDAsMCwxOC4wOCw4Wm0tLjgsOC4xOGEuNjIuNjIsMCwwLDEsLjA3LjhsLS4wNi4wN0wxNS40NCwxOWEuNjIuNjIsMCwwLDEtLjgxLjA2TDE0LjU2LDE5bC0xLjg1LTEuODlhLjYxLjYxLDAsMCwxLC44MS0uOTJsLjA3LjA2TDE1LDE3LjY1bDEuNDEtMS40NEEuNjIuNjIsMCwwLDEsMTcuMjgsMTYuMlptLTEuODQtNS4xMkwxNy4yOSwxM2EuNjQuNjQsMCwwLDEsMCwuODguNjMuNjMsMCwwLDEtLjg3LDBMMTUsMTIuMzlsLTEuNDEsMS40NGEuNjIuNjIsMCwxLDEtLjg4LS44N2wxLjg1LTEuODhBLjYxLjYxLDAsMCwxLDE1LjQ0LDExLjA4WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/widthIcon.svg":
/*!***************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/widthIcon.svg ***!
  \***************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTIxLjU2LDEwLjQ5YzAtMS4wMi0uODMtMS44NC0xLjg0LTEuODRIMTAuMjljLTEuMDIsMC0xLjg0LC44My0xLjg0LDEuODR2My4yOGMwLC4zNCwuMjgsLjYxLC42MSwuNjFzLjYxLS4yOCwuNjEtLjYxdi0zLjI4YzAtLjM0LC4yOC0uNjEsLjYxLS42MWg5LjQzYy4zNCwwLC42MSwuMjgsLjYxLC42MXYzLjI4YzAsLjM0LC4yOCwuNjEsLjYxLC42MXMuNjEtLjI4LC42MS0uNjF2LTMuMjhabS0yLjI4LDUuNzJjLjIyLS4yMiwuNTYtLjI0LC44LS4wNmwuMDcsLjA2LDEuOTQsMS45NGMuMTcsLjEsLjI5LC4zMSwuMjksLjU0LDAsLjIxLS4wOSwuMzktLjIzLC41bC0uMDYsLjA0LTEuOTQsMS45NC0uMDcsLjA2Yy0uMjEsLjE2LS41MSwuMTYtLjcyLDBsLS4wOC0uMDctLjA2LS4wN2MtLjE2LS4yMS0uMTYtLjUxLDAtLjcybC4wNy0uMDgsMS0xaC0zLjE4Yy0uMjYtLjA1LS40Ni0uMy0uNDYtLjYxcy4yLS41NywuNDctLjYxaDMuMThsLTEtMS4wMS0uMDYtLjA3Yy0uMTgtLjI0LS4xNi0uNTgsLjA2LS44Wm0tOC41NiwwYy4yMiwuMjIsLjI0LC41NiwuMDYsLjhsLS4wNiwuMDctMSwxaDMuMWMuMywwLC41NCwuMjgsLjU0LC42MSwwLC4zMS0uMiwuNTctLjQ2LC42MWgtMy4xOGwxLDEuMDFjLjIyLC4yMiwuMjQsLjU2LC4wNiwuOGwtLjA2LC4wN2MtLjIyLC4yMi0uNTYsLjI0LS44LC4wNmwtLjA3LS4wNi0xLjk0LTEuOTRjLS4xNy0uMS0uMjktLjMxLS4yOS0uNTRzLjEyLS40NCwuMjktLjU0bDEuOTQtMS45NGMuMjQtLjI0LC42My0uMjQsLjg3LDBaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/wordWrapIcon.svg":
/*!******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/wordWrapIcon.svg ***!
  \******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNNy4xMyw4LjM0YS42MS42MSwwLDEsMCwwLDEuMjFIMjIuMDZhLjYxLjYxLDAsMSwwLDAtMS4yMVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNNy4xMywxMy41OWEuNjEuNjEsMCwxLDAsMCwxLjIxSDIwLjI1YTIsMiwwLDAsMSwwLDRIMTYuNjZsLjU4LS41OWEuNi42LDAsMCwwLS44NS0uODVMMTQuNzcsMTlhLjYyLjYyLDAsMCwwLDAsLjg2bDEuNjIsMS42MWEuNi42LDAsMCwwLC44NS0uODVsLS41OC0uNThoMy41OWEzLjIzLDMuMjMsMCwwLDAsMC02LjQ2WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik02LjUyLDE5LjQ0YS42LjYsMCwwLDEsLjYxLS42aDUuMjVhLjYxLjYxLDAsMCwxLDAsMS4yMUg3LjEzQS42MS42MSwwLDAsMSw2LjUyLDE5LjQ0WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/valueDownArrowIcon.svg":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/valueDownArrowIcon.svg ***!
  \*************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDE1IDE1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNC4wOSw1LjU1YS42MS42MSwwLDAsMSwuODUsMGwyLDJWMS43OWEuNi42LDAsMSwxLDEuMiwwVjcuNTJsMi0yYS42MS42MSwwLDAsMSwuODUsMCwuNi42LDAsMCwxLDAsLjg0bC0zLDNhLjYuNiwwLDAsMS0uODQsMGwtMy0zQS42LjYsMCwwLDEsNC4wOSw1LjU1WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/valueUpArrowIcon.svg":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/valueUpArrowIcon.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDE1IDE1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNC4wOSw5LjQ1YS42LjYsMCwwLDEsMC0uODRsMy0zYS42LjYsMCwwLDEsLjg0LDBsMywzYS42LjYsMCwwLDEsMCwuODQuNjEuNjEsMCwwLDEtLjg1LDBsLTItMnY1LjczYS42LjYsMCwwLDEtMS4yLDBWNy40OGwtMiwyQS42MS42MSwwLDAsMSw0LjA5LDkuNDVaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/adtIcon.svg":
/*!******************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/adtIcon.svg ***!
  \******************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjUuMjksMjYuNTFhLjQxLjQxLDAsMCwxLS40MS40MUgxNS4xMmEuNDEuNDEsMCwwLDEtLjQxLS40MXYtMTNhLjQxLjQxLDAsMCwxLC40MS0uNDFIMjB2My42NmExLjYzLDEuNjMsMCwwLDAsMS42MywxLjYzaDMuNjZaTTIxLjIyLDE0bDMuMTYsMy4xNkgyMS42M2EuNDEuNDEsMCwwLDEtLjQxLS40MVpNMjYsMTcuMDhsLTQuNzUtNC43NC0uMDctLjA2TDIxLDEyLjEzbC0uMS0uMDUtLjE4LS4xYTEuNzIsMS43MiwwLDAsMC0uNTEtLjExSDE1LjEyYTEuNjMsMS42MywwLDAsMC0xLjYzLDEuNjN2MTNhMS42MywxLjYzLDAsMCwwLDEuNjMsMS42M2g5Ljc2YTEuNjMsMS42MywwLDAsMCwxLjYzLTEuNjNWMTguMjNBMS42NSwxLjY1LDAsMCwwLDI2LDE3LjA4WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/babylonLogo.svg":
/*!**********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/babylonLogo.svg ***!
  \**********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cG9seWdvbiBwb2ludHM9IjI5LjM5IDE0LjU4IDI2LjQ1IDEyLjg4IDIzLjYzIDE0LjUxIDI2LjU3IDE2LjIxIDI5LjM5IDE0LjU4IiBzdHlsZT0iZmlsbDojZTA2ODRiIi8+PHBvbHlnb24gcG9pbnRzPSIxMy40MyAxNi4yMSAyMi44MyAxMC43OSAyMCA5LjE1IDEwLjYxIDE0LjU4IDEzLjQzIDE2LjIxIiBzdHlsZT0iZmlsbDojZTA2ODRiIi8+PHBvbHlnb24gcG9pbnRzPSIxNy4wNiAyMS43IDIwIDIzLjM5IDIyLjk0IDIxLjcgMjAgMjAgMTcuMDYgMjEuNyIgc3R5bGU9ImZpbGw6I2UwNjg0YiIvPjxwb2x5Z29uIHBvaW50cz0iMjYuNTcgMTYuMjEgMjYuNTcgMjMuNzkgMjAgMjcuNTggMTMuNDMgMjMuNzkgMTMuNDMgMTYuMjEgMTAuNjEgMTQuNTggMTAuNjEgMjUuNDIgMjAgMzAuODUgMjkuMzkgMjUuNDIgMjkuMzkgMTQuNTggMjYuNTcgMTYuMjEiIHN0eWxlPSJmaWxsOiNiYjQ2NGIiLz48cG9seWdvbiBwb2ludHM9IjIwIDE2LjYxIDE3LjA2IDE4LjMgMTcuMDYgMjEuNyAyMCAyMCAyMi45NCAyMS43IDIyLjk0IDE4LjMgMjAgMTYuNjEiIHN0eWxlPSJmaWxsOiNiYjQ2NGIiLz48cG9seWdvbiBwb2ludHM9IjI2LjU3IDE2LjIxIDIyLjk0IDE4LjMgMjIuOTQgMjEuNyAyMCAyMy4zOSAyMCAyNy41OCAyNi41NyAyMy43OSAyNi41NyAxNi4yMSIgc3R5bGU9ImZpbGw6I2UwZGVkOCIvPjxwb2x5Z29uIHBvaW50cz0iMTMuNDMgMTYuMjEgMTcuMDYgMTguMyAxNy4wNiAyMS43IDIwIDIzLjM5IDIwIDI3LjU4IDEzLjQzIDIzLjc5IDEzLjQzIDE2LjIxIiBzdHlsZT0iZmlsbDojZDVkMmNhIi8+PHBvbHlnb24gcG9pbnRzPSIyMi44MyAxMC43OSAyNi40NSAxMi44OCAyMy42MyAxNC41MSAyNi41NyAxNi4yMSAyMi45NCAxOC4zIDIwIDE2LjYxIDE3LjA2IDE4LjMgMTMuNDMgMTYuMjEgMjIuODMgMTAuNzkiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/buttonBar_deleteIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/buttonBar_deleteIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJpY29ucyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE4LjM5LDE0LjU0aDMuMjRjMC0uODktLjcyLTEuNjItMS42Mi0xLjYycy0xLjYyLC43Mi0xLjYyLDEuNjJabS0xLjIxLDBjMC0xLjU2LDEuMjctMi44MywyLjgzLTIuODNzMi44MywxLjI3LDIuODMsMi44M2g0LjY1Yy4zNCwwLC42MSwuMjcsLjYxLC42MXMtLjI3LC42MS0uNjEsLjYxaC0xLjA3bC0uOTUsOS44Yy0uMTUsMS41Ni0xLjQ2LDIuNzQtMy4wMiwyLjc0aC00LjljLTEuNTYsMC0yLjg3LTEuMTktMy4wMi0yLjc0bC0uOTUtOS44aC0xLjA3Yy0uMzQsMC0uNjEtLjI3LS42MS0uNjFzLjI3LS42MSwuNjEtLjYxaDQuNjVabTEuNjIsMy44NGMwLS4zNC0uMjctLjYxLS42MS0uNjFzLS42MSwuMjctLjYxLC42MXY2LjA3YzAsLjM0LC4yNywuNjEsLjYxLC42MXMuNjEtLjI3LC42MS0uNjF2LTYuMDdabTMuMDQtLjYxYy4zNCwwLC42MSwuMjcsLjYxLC42MXY2LjA3YzAsLjM0LS4yNywuNjEtLjYxLC42MXMtLjYxLS4yNy0uNjEtLjYxdi02LjA3YzAtLjM0LC4yNy0uNjEsLjYxLS42MVptLTYuMDgsNy42NmMuMDksLjkzLC44NywxLjY1LDEuODEsMS42NWg0LjljLjk0LDAsMS43Mi0uNzEsMS44MS0xLjY1bC45NC05LjY5SDE0LjgxbC45NCw5LjY5WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/buttonBar_deleteIcon_disabled.svg":
/*!****************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/buttonBar_deleteIcon_disabled.svg ***!
  \****************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJpY29ucyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiM3Nzc3Nzc7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE4LjM5LDE0LjU0aDMuMjRjMC0uODktLjcyLTEuNjItMS42Mi0xLjYycy0xLjYyLC43Mi0xLjYyLDEuNjJabS0xLjIxLDBjMC0xLjU2LDEuMjctMi44MywyLjgzLTIuODNzMi44MywxLjI3LDIuODMsMi44M2g0LjY1Yy4zNCwwLC42MSwuMjcsLjYxLC42MXMtLjI3LC42MS0uNjEsLjYxaC0xLjA3bC0uOTUsOS44Yy0uMTUsMS41Ni0xLjQ2LDIuNzQtMy4wMiwyLjc0aC00LjljLTEuNTYsMC0yLjg3LTEuMTktMy4wMi0yLjc0bC0uOTUtOS44aC0xLjA3Yy0uMzQsMC0uNjEtLjI3LS42MS0uNjFzLjI3LS42MSwuNjEtLjYxaDQuNjVabTEuNjIsMy44NGMwLS4zNC0uMjctLjYxLS42MS0uNjFzLS42MSwuMjctLjYxLC42MXY2LjA3YzAsLjM0LC4yNywuNjEsLjYxLC42MXMuNjEtLjI3LC42MS0uNjF2LTYuMDdabTMuMDQtLjYxYy4zNCwwLC42MSwuMjcsLjYxLC42MXY2LjA3YzAsLjM0LS4yNywuNjEtLjYxLC42MXMtLjYxLS4yNy0uNjEtLjYxdi02LjA3YzAtLjM0LC4yNy0uNjEsLjYxLS42MVptLTYuMDgsNy42NmMuMDksLjkzLC44NywxLjY1LDEuODEsMS42NWg0LjljLjk0LDAsMS43Mi0uNzEsMS44MS0xLjY1bC45NC05LjY5SDE0LjgxbC45NCw5LjY5WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/buttonIcon.svg":
/*!*********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/buttonIcon.svg ***!
  \*********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjYuMDgsMTIuN0gxMy45MmEyLDIsMCwwLDAtMiwyVjIyYTIsMiwwLDAsMCwyLDJoMy42NVYyMi44NEgxMy45MmEuODEuODEsMCwwLDEtLjgxLS44MXYtNy4zYS44MS44MSwwLDAsMSwuODEtLjgxSDI2LjA4YS44MS44MSwwLDAsMSwuODEuODFWMjJhLjgxLjgxLDAsMCwxLS44MS44MWgtLjQ1bC4yOC4yN2ExLjQ1LDEuNDUsMCwwLDEsLjU2LjkxLDIsMiwwLDAsMCwxLjY0LTJ2LTcuM0EyLDIsMCwwLDAsMjYuMDgsMTIuN1oiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMTkuNDIsMTcuNzVhLjYyLjYyLDAsMCwwLS42Ny0uMTQuNjMuNjMsMCwwLDAtLjM3LjU3djguNTFhLjYuNiwwLDAsMCwuNDMuNTguNjEuNjEsMCwwLDAsLjY4LS4yNGwyLTIuOTEsMy40NS43M2EuNjEuNjEsMCwwLDAsLjU2LTFabTEuOTIsNS4xYS42LjYsMCwwLDAtLjYyLjI1bC0xLjEzLDEuNjNWMTkuNjRsMy42LDMuNloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/buttonbar_copyIcon.svg":
/*!*****************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/buttonbar_copyIcon.svg ***!
  \*****************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJpY29ucyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE0Ljc2LDE0LjA2djEwLjI3YzAsMS40NiwxLjE4LDIuNjQsMi42NCwyLjY0aDcuMDFjLS4yNSwuNzEtLjkzLDEuMjItMS43MywxLjIyaC01LjI4Yy0yLjEzLDAtMy44Ni0xLjczLTMuODYtMy44NlYxNS43OGMwLS44LC41MS0xLjQ4LDEuMjItMS43M1ptOS45Ni0yLjE0YzEuMDEsMCwxLjgzLC44MiwxLjgzLDEuODN2MTAuNTdjMCwxLjAxLS44MiwxLjgzLTEuODMsMS44M2gtNy4zMmMtMS4wMSwwLTEuODMtLjgyLTEuODMtMS44M1YxMy43NWMwLTEuMDEsLjgyLTEuODMsMS44My0xLjgzaDcuMzJabTAsMS4yMmgtNy4zMmMtLjM0LDAtLjYxLC4yNy0uNjEsLjYxdjEwLjU3YzAsLjM0LC4yNywuNjEsLjYxLC42MWg3LjMyYy4zNCwwLC42MS0uMjcsLjYxLS42MVYxMy43NWMwLS4zNC0uMjctLjYxLS42MS0uNjFaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/buttonbar_copyIcon_disabled.svg":
/*!**************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/buttonbar_copyIcon_disabled.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJpY29ucyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiM3Nzc3Nzc7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE0Ljc2LDE0LjA2djEwLjI3YzAsMS40NiwxLjE4LDIuNjQsMi42NCwyLjY0aDcuMDFjLS4yNSwuNzEtLjkzLDEuMjItMS43MywxLjIyaC01LjI4Yy0yLjEzLDAtMy44Ni0xLjczLTMuODYtMy44NlYxNS43OGMwLS44LC41MS0xLjQ4LDEuMjItMS43M1ptOS45Ni0yLjE0YzEuMDEsMCwxLjgzLC44MiwxLjgzLDEuODN2MTAuNTdjMCwxLjAxLS44MiwxLjgzLTEuODMsMS44M2gtNy4zMmMtMS4wMSwwLTEuODMtLjgyLTEuODMtMS44M1YxMy43NWMwLTEuMDEsLjgyLTEuODMsMS44My0xLjgzaDcuMzJabTAsMS4yMmgtNy4zMmMtLjM0LDAtLjYxLC4yNy0uNjEsLjYxdjEwLjU3YzAsLjM0LC4yNywuNjEsLjYxLC42MWg3LjMyYy4zNCwwLC42MS0uMjcsLjYxLS42MVYxMy43NWMwLS4zNC0uMjctLjYxLS42MS0uNjFaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/buttonbar_pasteIcon.svg":
/*!******************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/buttonbar_pasteIcon.svg ***!
  \******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJpY29ucyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTIwLjYxLDEyLjA3Yy45NCwwLDEuNzEsLjcxLDEuODEsMS42MmgxLjQzYy45NywwLDEuNzYsLjc1LDEuODIsMS43di4xM2MwLC4zMS0uMjIsLjU2LS41MiwuNmgtLjA4Yy0uMzEsMC0uNTYtLjIyLS42LS41MnYtLjA4YzAtLjMxLS4yMy0uNTYtLjUzLS42aC0xLjgxYy0uMzMsLjQ4LS44OCwuOC0xLjUxLC44aC0yLjg1Yy0uNjMsMC0xLjE5LS4zMi0xLjUxLS44MWgtMS43M2MtLjMxLDAtLjU2LC4yMy0uNiwuNTN2MTEuMDVjMCwuMzEsLjIyLC41NiwuNTIsLjZoMi41MmMuMzEsMCwuNTYsLjIzLC42LC41M3YuMDhjMCwuMzQtLjI3LC42MS0uNiwuNjFoLTIuNDRjLS45NywwLTEuNzYtLjc1LTEuODItMS43VjE1LjUzYzAtLjk3LC43NS0xLjc2LDEuNy0xLjgyaDEuNTZjLjEtLjkyLC44Ny0xLjYzLDEuODEtMS42M2gyLjg1Wm00Ljg3LDQuODdjLjk3LDAsMS43NiwuNzUsMS44MiwxLjd2Ny44NGMwLC45Ny0uNzUsMS43Ni0xLjcsMS44MmgtNS40Yy0uOTcsMC0xLjc2LS43NS0xLjgyLTEuN3YtNy44NGMwLS45NywuNzUtMS43NiwxLjctMS44Mmg1LjRabTAsMS4yMWgtNS4yOGMtLjMxLDAtLjU2LC4yMy0uNiwuNTN2Ny44YzAsLjMxLC4yMiwuNTYsLjUyLC42aDUuMzZjLjMxLDAsLjU2LS4yMiwuNi0uNTJ2LTcuOGMwLS4zMS0uMjItLjU2LS41Mi0uNmgtLjA4Wm0tNC44Ny00Ljg4aC0yLjg1Yy0uMzMsMC0uNjEsLjI3LS42MSwuNjFzLjI3LC42MSwuNjEsLjYxaDIuODVjLjMzLDAsLjYxLS4yNywuNjEtLjYxcy0uMjctLjYxLS42MS0uNjFaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/buttonbar_pasteIcon_disabled.svg":
/*!***************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/buttonbar_pasteIcon_disabled.svg ***!
  \***************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJpY29ucyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiM3Nzc3Nzc7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTIwLjYxLDEyLjA3Yy45NCwwLDEuNzEsLjcxLDEuODEsMS42MmgxLjQzYy45NywwLDEuNzYsLjc1LDEuODIsMS43di4xM2MwLC4zMS0uMjIsLjU2LS41MiwuNmgtLjA4Yy0uMzEsMC0uNTYtLjIyLS42LS41MnYtLjA4YzAtLjMxLS4yMy0uNTYtLjUzLS42aC0xLjgxYy0uMzMsLjQ4LS44OCwuOC0xLjUxLC44aC0yLjg1Yy0uNjMsMC0xLjE5LS4zMi0xLjUxLS44MWgtMS43M2MtLjMxLDAtLjU2LC4yMy0uNiwuNTN2MTEuMDVjMCwuMzEsLjIyLC41NiwuNTIsLjZoMi41MmMuMzEsMCwuNTYsLjIzLC42LC41M3YuMDhjMCwuMzQtLjI3LC42MS0uNiwuNjFoLTIuNDRjLS45NywwLTEuNzYtLjc1LTEuODItMS43VjE1LjUzYzAtLjk3LC43NS0xLjc2LDEuNy0xLjgyaDEuNTZjLjEtLjkyLC44Ny0xLjYzLDEuODEtMS42M2gyLjg1Wm00Ljg3LDQuODdjLjk3LDAsMS43NiwuNzUsMS44MiwxLjd2Ny44NGMwLC45Ny0uNzUsMS43Ni0xLjcsMS44MmgtNS40Yy0uOTcsMC0xLjc2LS43NS0xLjgyLTEuN3YtNy44NGMwLS45NywuNzUtMS43NiwxLjctMS44Mmg1LjRabTAsMS4yMWgtNS4yOGMtLjMxLDAtLjU2LC4yMy0uNiwuNTN2Ny44YzAsLjMxLC4yMiwuNTYsLjUyLC42aDUuMzZjLjMxLDAsLjU2LS4yMiwuNi0uNTJ2LTcuOGMwLS4zMS0uMjItLjU2LS41Mi0uNmgtLjA4Wm0tNC44Ny00Ljg4aC0yLjg1Yy0uMzMsMC0uNjEsLjI3LS42MSwuNjFzLjI3LC42MSwuNjEsLjYxaDIuODVjLjMzLDAsLjYxLS4yNywuNjEtLjYxcy0uMjctLjYxLS42MS0uNjFaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/canvasFitIcon.svg":
/*!************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/canvasFitIcon.svg ***!
  \************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjUuMDUsMTMuNTRhMywzLDAsMCwxLDMsM3Y2Ljg2YTMsMywwLDAsMS0zLDNIMTVhMywzLDAsMCwxLTMtM1YxNi41N2EzLDMsMCwwLDEsMy0zWm0wLDEuMjFIMTVhMS44MiwxLjgyLDAsMCwwLTEuODIsMS44MnY2Ljg2QTEuODIsMS44MiwwLDAsMCwxNSwyNS4yNWgxMC4xYTEuODIsMS44MiwwLDAsMCwxLjgyLTEuODJWMTYuNTdBMS44MiwxLjgyLDAsMCwwLDI1LjA1LDE0Ljc1Wm0wLDYuMDZhLjYxLjYxLDAsMCwxLC42MS42djFBMS42MiwxLjYyLDAsMCwxLDI0LDI0SDIzYS42MS42MSwwLDEsMSwwLTEuMjFoMWEuNC40LDAsMCwwLC40LS40MXYtMUEuNi42LDAsMCwxLDI1LjA1LDIwLjgxWm0tMTAuMSwwYS42LjYsMCwwLDEsLjYxLjZ2MWEuNC40LDAsMCwwLC40LjQxaDFBLjYxLjYxLDAsMSwxLDE3LDI0SDE2YTEuNjIsMS42MiwwLDAsMS0xLjYyLTEuNjJ2LTFBLjYxLjYxLDAsMCwxLDE1LDIwLjgxWk0xNiwxNmgxYS42MS42MSwwLDAsMSwuNjEuNjEuNjEuNjEsMCwwLDEtLjUzLjZIMTZhLjQyLjQyLDAsMCwwLS40LjMzdjEuMDlhLjYxLjYxLDAsMCwxLTEuMjEuMDhWMTcuNThBMS42MywxLjYzLDAsMCwxLDE1Ljg0LDE2Wk0yNCwxNmExLjYyLDEuNjIsMCwwLDEsMS42MiwxLjYydjFhLjYxLjYxLDAsMCwxLS42MS42LjYuNiwwLDAsMS0uNjEtLjZ2LTFhLjQuNCwwLDAsMC0uNC0uNDFIMjNBLjYxLjYxLDAsMSwxLDIzLDE2WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/checkboxIcon.svg":
/*!***********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/checkboxIcon.svg ***!
  \***********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjUsMTIuNzZBMi4yMSwyLjIxLDAsMCwxLDI3LjI0LDE1VjI1QTIuMjEsMi4yMSwwLDAsMSwyNSwyNy4yNEgxNUEyLjIxLDIuMjEsMCwwLDEsMTIuNzYsMjVWMTVBMi4yMSwyLjIxLDAsMCwxLDE1LDEyLjc2Wk0yNSwxNEgxNWExLDEsMCwwLDAtMSwxVjI1YTEsMSwwLDAsMCwxLDFIMjVhMSwxLDAsMCwwLDEtMVYxNUExLDEsMCwwLDAsMjUsMTRabS02LjY0LDgsNS4yMS01LjJhLjU5LjU5LDAsMCwxLC44NSwwLC42MS42MSwwLDAsMSwuMDYuNzhsLS4wNi4wNy01LjYzLDUuNjNhLjYuNiwwLDAsMS0uNzkuMDZMMTgsMjMuMjRsLTIuNDEtMi40MWEuNjEuNjEsMCwwLDEsMC0uODUuNi42LDAsMCwxLC43OS0uMDZsLjA2LjA2LDIsMiw1LjIxLTUuMloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/collapsedIcon.svg":
/*!************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/collapsedIcon.svg ***!
  \************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDE1IDMwIj48cGF0aCBkPSJNOS4xMywxNS40bC0yLjY2LDJhLjUuNSwwLDAsMS0uOC0uNFYxM2EuNS41LDAsMCwxLC44LS40bDIuNjYsMkEuNS41LDAsMCwxLDkuMTMsMTUuNFoiIHN0eWxlPSJmaWxsOiM4ZThlOGUiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/colorPickerIcon.svg":
/*!**************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/colorPickerIcon.svg ***!
  \**************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTMuMzEsMTUuMzRhOC4zNCw4LjM0LDAsMCwxLDE0LjI1LDguMzRjLTEuMzUsMy43LTQuOTEsNS4xNi03LjQ3LDMuM2EzLjgyLDMuODIsMCwwLDEtMS41Mi0zbC0uMDgtLjgxLDAtLjMyYy0uMS0uNzYtLjI2LTEuMS0uNTgtMS4yOGExLjI3LDEuMjcsMCwwLDAtMS4zLDBsLS4yOC4xMi0uMTUuMDZhMy4xMiwzLjEyLDAsMCwxLTIuMDcuMzRsLS4xNywwLS4xMywwQzExLjQ5LDIxLjI5LDExLjE1LDE4LjIsMTMuMzEsMTUuMzRabS44LDUuNDguMSwwLC4xMSwwYTEuODEsMS44MSwwLDAsMCwxLjE3LS4xOWwuNDktLjIxYTIuNDcsMi40NywwLDAsMSwzLjY4LDIuMjFsMCwuMzcuMDUuNDQsMCwuMzRhMi43NSwyLjc1LDAsMCwwLDEsMi4xNmMxLjg2LDEuMzUsNC41Mi4yNSw1LjYxLTIuNzNhNy4xMSw3LjExLDAsMCwwLTEyLjEyLTcuMTlDMTIuNTksMTguMzMsMTIuOCwyMC4zOCwxNC4xMSwyMC44MlptOS4xNi0xLjYzYTEsMSwwLDEsMSwyLS41MywxLDEsMCwwLDEtMiwuNTNaTTIzLjY4LDIyYTEsMSwwLDEsMSwxLjI0LjcyQTEsMSwwLDAsMSwyMy42OCwyMlptLTItNS4zYTEsMSwwLDAsMSwuNzItMS4yNSwxLDEsMCwxLDEsLjUzLDJBMSwxLDAsMCwxLDIxLjY2LDE2Ljc0Wm0wLDcuMzVhMSwxLDAsMCwxLC43Mi0xLjI1LDEsMSwwLDAsMSwuNTMsMkExLDEsMCwwLDEsMjEuNjMsMjQuMDlaTTE4Ljc4LDE2YTEsMSwwLDEsMSwxLjI1LjcyQTEsMSwwLDAsMSwxOC43OCwxNloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_rotate0.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_rotate0.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgd2lkdGg9IjI1IiBoZWlnaHQ9IjI1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTE4LjkxLDEyLjExbC0uNjYtLjY2YTguMTQsOC4xNCwwLDAsMC0xMS41LDBsLS42Ni42Nkw0LjY4LDEwLjcsMy4zOSwxNS41MWw0LjgyLTEuMjlMNi44LDEyLjgxbC42NS0uNjVhNy4xNiw3LjE2LDAsMCwxLDEwLjEsMGwuNjUuNjUtMS40MSwxLjQxLDQuODIsMS4yOUwyMC4zMiwxMC43WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTEyLjUsOS4wN2E4LjEzLDguMTMsMCwwLDEsNS43NSwyLjM4bC42Ni42NiwxLjQxLTEuNDEsMS4yOSw0LjgxLTQuODItMS4yOSwxLjQxLTEuNDEtLjY1LS42NWE3LjE1LDcuMTUsMCwwLDAtMTAuMSwwbC0uNjUuNjUsMS40MSwxLjQxTDMuMzksMTUuNTEsNC42OCwxMC43bDEuNDEsMS40MS42Ni0uNjZBOC4xMyw4LjEzLDAsMCwxLDEyLjUsOS4wN20wLTFhOS4wOCw5LjA4LDAsMCwwLTYuNDEsMi42MmwtLjctLjdMNC4xNiw4Ljc3bC0uNDQsMS42N0wyLjQzLDE1LjI1LDIsMTYuOTNsMS42Ny0uNDUsNC44Mi0xLjI5LDEuNjctLjQ1TDguOTEsMTMuNTJsLS43LS43MWE2LjE2LDYuMTYsMCwwLDEsOC41OCwwbC0uNzEuNzEtMS4yMiwxLjIyLDEuNjcuNDUsNC44MiwxLjI5LDEuNjcuNDUtLjQ1LTEuNjgtMS4yOS00LjgxLS40NC0xLjY3TDE5LjYxLDEwbC0uNy43QTkuMDgsOS4wOCwwLDAsMCwxMi41LDguMDdaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_rotate1.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_rotate1.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgd2lkdGg9IjI1IiBoZWlnaHQ9IjI1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTE4LjMzLDE1Ljc0di0uOTNhOC4xNSw4LjE1LDAsMCwwLTguMTQtOC4xNEg5LjI2di0yTDUsNy4xN2w0LjMxLDIuNXYtMmguOTNhNy4xNCw3LjE0LDAsMCwxLDcuMTQsNy4xNHYuOTNoLTJsMi41LDQuMzEsMi40OS00LjMxWiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTkuMjYsNC42OHYyaC45M2E4LjE1LDguMTUsMCwwLDEsOC4xNCw4LjE0di45M2gybC0yLjQ5LDQuMzEtMi41LTQuMzFoMnYtLjkzYTcuMTQsNy4xNCwwLDAsMC03LjE0LTcuMTRIOS4yNnYyTDUsNy4xNyw5LjI2LDQuNjhtMS0xLjczLTEuNS44Nkw0LjQ1LDYuMzEsMyw3LjE3LDQuNDUsOGw0LjMxLDIuNDksMS41Ljg3VjguNjdhNi4xNSw2LjE1LDAsMCwxLDYuMDcsNi4wN0gxMy42bC44NywxLjVMMTcsMjAuNTVsLjg3LDEuNS44Ni0xLjUsMi41LTQuMzEuODYtMS41SDE5LjMzYTkuMTYsOS4xNiwwLDAsMC05LjA3LTkuMDdWM1oiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_rotate2.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_rotate2.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgd2lkdGg9IjI1IiBoZWlnaHQ9IjI1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTEyLjg5LDE4LjkxbC42Ni0uNjZhOC4xNCw4LjE0LDAsMCwwLDAtMTEuNWwtLjY2LS42NkwxNC4zLDQuNjgsOS40OSwzLjM5bDEuMjksNC44MkwxMi4xOSw2LjhsLjY1LjY1YTcuMTYsNy4xNiwwLDAsMSwwLDEwLjFsLS42NS42NS0xLjQxLTEuNDFMOS40OSwyMS42MWw0LjgxLTEuMjlaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNOS40OSwzLjM5LDE0LjMsNC42OCwxMi44OSw2LjA5bC42Ni42NmE4LjE0LDguMTQsMCwwLDEsMCwxMS41bC0uNjYuNjYsMS40MSwxLjQxTDkuNDksMjEuNjFsMS4yOS00LjgyLDEuNDEsMS40MS42NS0uNjVhNy4xNiw3LjE2LDAsMCwwLDAtMTAuMWwtLjY1LS42NUwxMC43OCw4LjIxLDkuNDksMy4zOU04LjA3LDJsLjQ1LDEuNjdMOS44MSw4LjQ3bC40NSwxLjY3LDEuMjItMS4yMy43MS0uN2E2LjE2LDYuMTYsMCwwLDEsMCw4LjU4bC0uNzEtLjctMS4yMi0xLjIzLS40NSwxLjY3TDguNTIsMjEuMzUsOC4wNywyM2wxLjY4LS40NSw0LjgxLTEuMjksMS42Ny0uNDRMMTUsMTkuNjFsLS43LS43YTkuMTUsOS4xNSwwLDAsMCwwLTEyLjgybC43LS43LDEuMjItMS4yMy0xLjY3LS40NEw5Ljc1LDIuNDMsOC4wNywyWiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_rotate3.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_rotate3.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgd2lkdGg9IjI1IiBoZWlnaHQ9IjI1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTkuMjYsMTguMzNoLjkzYTguMTUsOC4xNSwwLDAsMCw4LjE0LTguMTRWOS4yNmgyTDE3LjgzLDVsLTIuNSw0LjMxaDJ2LjkzYTcuMTQsNy4xNCwwLDAsMS03LjE0LDcuMTRIOS4yNnYtMkw1LDE3LjgzbDQuMzEsMi40OVoiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xNy44Myw1bDIuNDksNC4zMWgtMnYuOTNhOC4xNSw4LjE1LDAsMCwxLTguMTQsOC4xNEg5LjI2djJMNSwxNy44M2w0LjMxLTIuNXYyaC45M2E3LjE0LDcuMTQsMCwwLDAsNy4xNC03LjE0VjkuMjZoLTJMMTcuODMsNW0wLTJMMTcsNC40NSwxNC40Nyw4Ljc2bC0uODcsMS41aDIuNzNhNi4xNSw2LjE1LDAsMCwxLTYuMDcsNi4wN1YxMy42bC0xLjUuODdMNC40NSwxNywzLDE3LjgzbDEuNS44Niw0LjMxLDIuNSwxLjUuODZWMTkuMzNhOS4xNiw5LjE2LDAsMCwwLDkuMDctOS4wN2gyLjcybC0uODYtMS41LTIuNS00LjMxTDE3LjgzLDNaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_rotate4.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_rotate4.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgd2lkdGg9IjI1IiBoZWlnaHQ9IjI1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTYuMDksMTIuODlsLjY2LjY2YTguMTQsOC4xNCwwLDAsMCwxMS41LDBsLjY2LS42NiwxLjQxLDEuNDEsMS4yOS00LjgxLTQuODIsMS4yOSwxLjQxLDEuNDEtLjY1LjY1YTcuMTYsNy4xNiwwLDAsMS0xMC4xLDBsLS42NS0uNjUsMS40MS0xLjQxTDMuMzksOS40OSw0LjY4LDE0LjNaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuNjEsOS40OSwyMC4zMiwxNC4zbC0xLjQxLTEuNDEtLjY2LjY2YTguMTQsOC4xNCwwLDAsMS0xMS41LDBsLS42Ni0uNjZMNC42OCwxNC4zLDMuMzksOS40OWw0LjgyLDEuMjlMNi44LDEyLjE5bC42NS42NWE3LjE1LDcuMTUsMCwwLDAsMTAuMSwwbC42NS0uNjUtMS40MS0xLjQxLDQuODItMS4yOU0yMyw4LjA3bC0xLjY3LjQ1TDE2LjUzLDkuODFsLTEuNjcuNDUsMS4yMywxLjIyLjcuNzFhNi4xNiw2LjE2LDAsMCwxLTguNTgsMGwuNy0uNzEsMS4yMy0xLjIyTDguNDcsOS44MSwzLjY1LDguNTIsMiw4LjA3bC40NSwxLjY4LDEuMjksNC44MS40NCwxLjY3TDUuMzksMTVsLjctLjdhOS4xNSw5LjE1LDAsMCwwLDEyLjgyLDBsLjcuNywxLjIzLDEuMjIuNDQtMS42NywxLjI5LTQuODFMMjMsOC4wN1oiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_rotate5.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_rotate5.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgd2lkdGg9IjI1IiBoZWlnaHQ9IjI1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTYuNjcsOS4yNnYuOTNhOC4xNSw4LjE1LDAsMCwwLDguMTQsOC4xNGguOTN2Mmw0LjMxLTIuNDktNC4zMS0yLjV2MmgtLjkzYTcuMTQsNy4xNCwwLDAsMS03LjE0LTcuMTRWOS4yNmgyTDcuMTcsNSw0LjY4LDkuMjZaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNy4xNyw1bDIuNSw0LjMxaC0ydi45M2E3LjE0LDcuMTQsMCwwLDAsNy4xNCw3LjE0aC45M3YtMmw0LjMxLDIuNS00LjMxLDIuNDl2LTJoLS45M2E4LjE1LDguMTUsMCwwLDEtOC4xNC04LjE0VjkuMjZoLTJMNy4xNyw1bTAtMi0uODYsMS41TDMuODEsOC43NiwzLDEwLjI2SDUuNjdhOS4xNiw5LjE2LDAsMCwwLDkuMDcsOS4wN3YyLjcybDEuNS0uODYsNC4zMS0yLjUsMS41LS44NkwyMC41NSwxN2wtNC4zMS0yLjQ5LTEuNS0uODd2Mi43M2E2LjE1LDYuMTUsMCwwLDEtNi4wNy02LjA3SDExLjRsLS44Ny0xLjVMOCw0LjQ1LDcuMTcsM1oiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_rotate6.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_rotate6.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgd2lkdGg9IjI1IiBoZWlnaHQ9IjI1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTEyLjExLDYuMDlsLS42Ni42NmE4LjE0LDguMTQsMCwwLDAsMCwxMS41bC42Ni42NkwxMC43LDIwLjMybDQuODEsMS4yOS0xLjI5LTQuODJMMTIuODEsMTguMmwtLjY1LS42NWE3LjE2LDcuMTYsMCwwLDEsMC0xMC4xbC42NS0uNjUsMS40MSwxLjQxLDEuMjktNC44MkwxMC43LDQuNjhaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTUuNTEsMy4zOSwxNC4yMiw4LjIxLDEyLjgxLDYuOGwtLjY1LjY1YTcuMTYsNy4xNiwwLDAsMCwwLDEwLjFsLjY1LjY1LDEuNDEtMS40MSwxLjI5LDQuODJMMTAuNywyMC4zMmwxLjQxLTEuNDEtLjY2LS42NmE4LjE0LDguMTQsMCwwLDEsMC0xMS41bC42Ni0uNjZMMTAuNyw0LjY4bDQuODEtMS4yOU0xNi45MywybC0xLjY4LjQ1TDEwLjQ0LDMuNzJsLTEuNjcuNDRMMTAsNS4zOWwuNy43YTkuMTUsOS4xNSwwLDAsMCwwLDEyLjgybC0uNy43TDguNzcsMjAuODRsMS42Ny40NCw0LjgxLDEuMjksMS42OC40NS0uNDUtMS42Ny0xLjI5LTQuODItLjQ1LTEuNjctMS4yMiwxLjIzLS43MS43YTYuMTYsNi4xNiwwLDAsMSwwLTguNThsLjcxLjcsMS4yMiwxLjIzLjQ1LTEuNjcsMS4yOS00LjgyTDE2LjkzLDJaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_rotate7.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_rotate7.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgd2lkdGg9IjI1IiBoZWlnaHQ9IjI1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTE1Ljc0LDYuNjdoLS45M2E4LjE1LDguMTUsMCwwLDAtOC4xNCw4LjE0di45M2gtMmwyLjQ5LDQuMzEsMi41LTQuMzFoLTJ2LS45M2E3LjE0LDcuMTQsMCwwLDEsNy4xNC03LjE0aC45M3YybDQuMzEtMi41TDE1Ljc0LDQuNjhaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTUuNzQsNC42OGw0LjMxLDIuNDktNC4zMSwyLjV2LTJoLS45M2E3LjE0LDcuMTQsMCwwLDAtNy4xNCw3LjE0di45M2gybC0yLjUsNC4zMUw0LjY4LDE1Ljc0aDJ2LS45M2E4LjE1LDguMTUsMCwwLDEsOC4xNC04LjE0aC45M3YtMk0xNC43NCwzVjUuNjdhOS4xNiw5LjE2LDAsMCwwLTkuMDcsOS4wN0gzbC44NiwxLjUsMi41LDQuMzEuODYsMS41TDgsMjAuNTVsMi40OS00LjMxLjg3LTEuNUg4LjY3YTYuMTUsNi4xNSwwLDAsMSw2LjA3LTYuMDdWMTEuNGwxLjUtLjg3TDIwLjU1LDhsMS41LS44Ny0xLjUtLjg2LTQuMzEtMi41TDE0Ljc0LDNaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_scaleDiagonalLeft.svg":
/*!***********************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_scaleDiagonalLeft.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgIHdpZHRoPSIyNSIgaGVpZ2h0PSIyNSI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxwb2x5Z29uIHBvaW50cz0iNy41MSAxMS4wNCA2LjIyIDYuMjIgMTEuMDQgNy41MSA5LjYzIDguOTIgMTYuMDggMTUuMzcgMTcuNDggMTMuOTYgMTguNzcgMTguNzcgMTMuOTYgMTcuNDggMTUuMzcgMTYuMDggOC45MiA5LjYzIDcuNTEgMTEuMDQiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik02LjIyLDYuMjIsMTEsNy41MSw5LjYzLDguOTJsNi40NSw2LjQ1TDE3LjQ5LDE0bDEuMjksNC44MkwxNCwxNy40OWwxLjQxLTEuNDFMOC45Miw5LjYzLDcuNTEsMTEsNi4yMiw2LjIyTTQuODEsNC44MWwuNDUsMS42N0w2LjU1LDExLjMsNywxM2wxLjIyLTEuMjIuNy0uNyw1LDUtLjcuN0wxMiwxOGwxLjY3LjQ1LDQuODIsMS4yOSwxLjY3LjQ1LS40NS0xLjY3TDE4LjQ1LDEzLjcsMTgsMTJsLTEuMjIsMS4yMi0uNy43LTUtNSwuNy0uN0wxMyw3LDExLjMsNi41NSw2LjQ4LDUuMjYsNC44MSw0LjgxWiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_scaleDiagonalRight.svg":
/*!************************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_scaleDiagonalRight.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgd2lkdGg9IjI1IiBoZWlnaHQ9IjI1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBvbHlnb24gcG9pbnRzPSIxNy40OCAxMS4wNCAxOC43NyA2LjIyIDEzLjk2IDcuNTEgMTUuMzcgOC45MiA4LjkyIDE1LjM3IDcuNTEgMTMuOTYgNi4yMiAxOC43NyAxMS4wNCAxNy40OCA5LjYzIDE2LjA4IDE2LjA4IDkuNjMgMTcuNDggMTEuMDQiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xOC43OCw2LjIyLDE3LjQ5LDExLDE2LjA4LDkuNjMsOS42MywxNi4wOCwxMSwxNy40OSw2LjIyLDE4Ljc4LDcuNTEsMTRsMS40MSwxLjQxLDYuNDUtNi40NUwxNCw3LjUxbDQuODItMS4yOW0xLjQxLTEuNDEtMS42Ny40NUwxMy43LDYuNTUsMTIsN2wxLjIyLDEuMjIuNy43LTUsNS0uNy0uN0w3LDEyLDYuNTUsMTMuNyw1LjI2LDE4LjUybC0uNDUsMS42NywxLjY3LS40NSw0LjgyLTEuMjlMMTMsMThsLTEuMjItMS4yMi0uNy0uNyw1LTUsLjcuN0wxOCwxM2wuNDUtMS42NywxLjI5LTQuODIuNDUtMS42N1oiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_scaleHorizontal.svg":
/*!*********************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_scaleHorizontal.svg ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgIHdpZHRoPSIyNSIgaGVpZ2h0PSIyNSI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxwb2x5Z29uIHBvaW50cz0iNy45NCAxMC4wMSAzLjYzIDEyLjUgNy45NCAxNC45OSA3Ljk0IDEzIDE3LjA2IDEzIDE3LjA2IDE0Ljk5IDIxLjM4IDEyLjUgMTcuMDYgMTAuMDEgMTcuMDYgMTIgNy45NCAxMiA3Ljk0IDEwLjAxIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNy45NCwxMHYyaDkuMTJWMTBsNC4zMSwyLjQ5TDE3LjA2LDE1VjEzSDcuOTR2MkwzLjYzLDEyLjUsNy45NCwxMG0xLTEuNzQtMS41Ljg3TDMuMTMsMTEuNjNsLTEuNS44NywxLjUuODcsNC4zMSwyLjQ5LDEuNS44N1YxNGg3LjEydjIuNzNsMS41LS44Nyw0LjMxLTIuNDksMS41LS44Ny0xLjUtLjg3TDE3LjU2LDkuMTRsLTEuNS0uODdWMTFIOC45NFY4LjI3WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/cursor_scaleVertical.svg":
/*!*******************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/cursor_scaleVertical.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNSAyNSIgIHdpZHRoPSIyNSIgaGVpZ2h0PSIyNSI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxwb2x5Z29uIHBvaW50cz0iMTQuOTkgNy45NCAxMi41IDMuNjMgMTAuMDEgNy45NCAxMiA3Ljk0IDEyIDE3LjA2IDEwLjAxIDE3LjA2IDEyLjUgMjEuMzggMTQuOTkgMTcuMDYgMTMgMTcuMDYgMTMgNy45NCAxNC45OSA3Ljk0Ii8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTIuNSwzLjYzLDE1LDcuOTRIMTN2OS4xMmgyTDEyLjUsMjEuMzcsMTAsMTcuMDZoMlY3Ljk0SDEwTDEyLjUsMy42M20wLTItLjg3LDEuNUw5LjE0LDcuNDRsLS44NywxLjVIMTF2Ny4xMkg4LjI3bC44NywxLjUsMi40OSw0LjMxLjg3LDEuNS44Ny0xLjUsMi40OS00LjMxLjg3LTEuNUgxNFY4Ljk0aDIuNzNsLS44Ny0xLjVMMTMuMzcsMy4xM2wtLjg3LTEuNVoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/displaygridIcon.svg":
/*!**************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/displaygridIcon.svg ***!
  \**************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTcuMzksMjAuOGExLjgxLDEuODEsMCwwLDEsMS44MSwxLjgxdjIuODFhMS44MSwxLjgxLDAsMCwxLTEuODEsMS44MUgxNC41OGExLjgxLDEuODEsMCwwLDEtMS44MS0xLjgxVjIyLjYxYTEuODEsMS44MSwwLDAsMSwxLjgxLTEuODFabTgsMGExLjgxLDEuODEsMCwwLDEsMS44MSwxLjgxdjIuODFhMS44MSwxLjgxLDAsMCwxLTEuODEsMS44MUgyMi42MWExLjgxLDEuODEsMCwwLDEtMS44MS0xLjgxVjIyLjYxYTEuODEsMS44MSwwLDAsMSwxLjgxLTEuODFabS04LDEuMjFIMTQuNThhLjYuNiwwLDAsMC0uNi42djIuODFhLjYuNiwwLDAsMCwuNi42aDIuODFhLjYuNiwwLDAsMCwuNi0uNlYyMi42MUEuNi42LDAsMCwwLDE3LjM5LDIyWm04LDBIMjIuNjFhLjYuNiwwLDAsMC0uNi42djIuODFhLjYuNiwwLDAsMCwuNi42aDIuODFhLjYuNiwwLDAsMCwuNi0uNlYyMi42MUEuNi42LDAsMCwwLDI1LjQyLDIyWm0tOC05LjI0YTEuODEsMS44MSwwLDAsMSwxLjgxLDEuODF2Mi44MWExLjgxLDEuODEsMCwwLDEtMS44MSwxLjgxSDE0LjU4YTEuODEsMS44MSwwLDAsMS0xLjgxLTEuODFWMTQuNThhMS44MSwxLjgxLDAsMCwxLDEuODEtMS44MVptOCwwYTEuODEsMS44MSwwLDAsMSwxLjgxLDEuODF2Mi44MWExLjgxLDEuODEsMCwwLDEtMS44MSwxLjgxSDIyLjYxYTEuODEsMS44MSwwLDAsMS0xLjgxLTEuODFWMTQuNThhMS44MSwxLjgxLDAsMCwxLDEuODEtMS44MVptLTgsMS4yMUgxNC41OGEuNi42LDAsMCwwLS42LjZ2Mi44MWEuNi42LDAsMCwwLC42LjZoMi44MWEuNi42LDAsMCwwLC42LS42VjE0LjU4QS42LjYsMCwwLDAsMTcuMzksMTRabTgsMEgyMi42MWEuNi42LDAsMCwwLS42LjZ2Mi44MWEuNi42LDAsMCwwLC42LjZoMi44MWEuNi42LDAsMCwwLC42LS42VjE0LjU4QS42LjYsMCwwLDAsMjUuNDIsMTRaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/ellipseIcon.svg":
/*!**********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/ellipseIcon.svg ***!
  \**********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjAsMTMuMTdBNi44Myw2LjgzLDAsMSwwLDI2LjgzLDIwLDYuODMsNi44MywwLDAsMCwyMCwxMy4xN1pNMTIsMjBhOCw4LDAsMSwxLDgsOEE4LDgsMCwwLDEsMTIsMjBaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/expandedIcon.svg":
/*!***********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/expandedIcon.svg ***!
  \***********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDE1IDMwIj48cGF0aCBkPSJNNy4xLDE2LjYzLDUuMSwxNGEuNS41LDAsMCwxLC40LS44aDRhLjUuNSwwLDAsMSwuNC44bC0yLDIuNjZBLjUuNSwwLDAsMSw3LjEsMTYuNjNaIiBzdHlsZT0iZmlsbDojOGU4ZThlIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/gizmoPivotIcon.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/gizmoPivotIcon.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PGNpcmNsZSBjbGFzcz0iY2xzLTEiIGN4PSIxNSIgY3k9IjE1IiByPSI4Ljk4Ii8+PHBhdGggZD0iTTE1LDYuOUE4LjEsOC4xLDAsMSwwLDIzLjEsMTUsOC4xLDguMSwwLDAsMCwxNSw2LjlabTYuODYsNy40OUgxNS42M1Y4LjE0QTYuODksNi44OSwwLDAsMSwyMS44NiwxNC4zOVpNMTQuNDEsOC4xNHY2LjI1SDguMTRBNi44OSw2Ljg5LDAsMCwxLDE0LjQxLDguMTRaTTguMTQsMTUuNjFoNi4yN3Y2LjI1QTYuODksNi44OSwwLDAsMSw4LjE0LDE1LjYxWm03LjQ5LDYuMjVWMTUuNjFoNi4yM0E2Ljg5LDYuODksMCwwLDEsMTUuNjMsMjEuODZaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/gridIcon.svg":
/*!*******************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/gridIcon.svg ***!
  \*******************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTIuNzQsMTUuMzZhMi42MiwyLjYyLDAsMCwxLDIuNjItMi42Mmg5LjI4YTIuNjIsMi42MiwwLDAsMSwyLjYyLDIuNjJ2OS4yOGEyLjYyLDIuNjIsMCwwLDEtMi42MiwyLjYySDE1LjM2YTIuNjIsMi42MiwwLDAsMS0yLjYyLTIuNjJaTTE1LjM2LDE0QTEuNDEsMS40MSwwLDAsMCwxNCwxNS4zNnYxLjgyaDMuMjNWMTRaTTE0LDE4LjM5djMuMjJoMy4yM1YxOC4zOVptNC40NCwwdjMuMjJoMy4yMlYxOC4zOVptNC40MywwdjMuMjJoMy4yM1YxOC4zOVptLTEuMjEsNC40M0gxOC4zOXYzLjIzaDMuMjJabTEuMjEsMy4yM2gxLjgyYTEuNDEsMS40MSwwLDAsMCwxLjQxLTEuNDFWMjIuODJIMjIuODJabTAtOC44N2gzLjIzVjE1LjM2QTEuNDEsMS40MSwwLDAsMCwyNC42NCwxNEgyMi44MlpNMjEuNjEsMTRIMTguMzl2My4yM2gzLjIyWk0xNCwyMi44MnYxLjgyYTEuNDEsMS40MSwwLDAsMCwxLjQxLDEuNDFoMS44MlYyMi44MloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/guidesIcon.svg":
/*!*********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/guidesIcon.svg ***!
  \*********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjEuNiwxMy4zOGEuNi42LDAsMCwxLS42LjZIMTlhLjYuNiwwLDEsMSwwLTEuMmgyQS42LjYsMCwwLDEsMjEuNiwxMy4zOFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMTQsMTlhLjYuNiwwLDAsMC0xLjIsMHYyQS42LjYsMCwwLDAsMTQsMjFaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI2LDE5YS42LjYsMCwwLDEsMS4yLDB2MkEuNi42LDAsMCwxLDI2LDIxWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0yMSwyNy4yMkEuNi42LDAsMCwwLDIxLDI2SDE5YS42LjYsMCwxLDAsMCwxLjJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTE2LDEzLjM4YS42LjYsMCwwLDAtLjYtLjZIMTVhMi4yMSwyLjIxLDAsMCwwLTIuMiwyLjJ2LjQxYS42LjYsMCwwLDAsMS4yLDBWMTVhMSwxLDAsMCwxLDEtMWguNDFBLjYuNiwwLDAsMCwxNiwxMy4zOFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjQuNjEsMTIuNzhhLjYuNiwwLDEsMCwwLDEuMkgyNWExLDEsMCwwLDEsMSwxdi40MWEuNi42LDAsMSwwLDEuMiwwVjE1YTIuMjEsMi4yMSwwLDAsMC0yLjItMi4yWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0xNiwyNi42MmEuNi42LDAsMCwxLS42LjZIMTVhMi4yMSwyLjIxLDAsMCwxLTIuMi0yLjJ2LS40MWEuNi42LDAsMCwxLDEuMiwwVjI1YTEsMSwwLDAsMCwxLDFoLjQxQS42LjYsMCwwLDEsMTYsMjYuNjJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI0LjYxLDI3LjIyYS42LjYsMCwwLDEsMC0xLjJIMjVhMSwxLDAsMCwwLDEtMXYtLjQxYS42LjYsMCwwLDEsMS4yLDBWMjVhMi4yMSwyLjIxLDAsMCwxLTIuMiwyLjJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/hamburgerIcon.svg":
/*!************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/hamburgerIcon.svg ***!
  \************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTIuNDYsMTUuMzFIMjcuNjJhLjYyLjYyLDAsMCwwLC41My0uNjEuNjEuNjEsMCwwLDAtLjYxLS42MUgxMi4zOGEuNjEuNjEsMCwwLDAsLjA4LDEuMjFaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI3LjU0LDE5LjM5SDEyLjM4YS42MS42MSwwLDAsMCwuMDgsMS4yMUgyNy42MmEuNjIuNjIsMCwwLDAsLjUzLS42MUEuNjEuNjEsMCwwLDAsMjcuNTQsMTkuMzlaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI3LjU0LDI0LjY5SDEyLjM4YS42Mi42MiwwLDAsMC0uNTMuNjEuNjEuNjEsMCwwLDAsLjYxLjYxSDI3LjYyYS42MS42MSwwLDAsMC0uMDgtMS4yMVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/handIcon.svg":
/*!*******************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/handIcon.svg ***!
  \*******************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTkuMzksMTMuNTF2NS4wN2EuNjEuNjEsMCwwLDAsLjYxLjYxLjYxLjYxLDAsMCwwLC42MS0uNjFWMTQuNTFhLjM5LjM5LDAsMCwxLC40LS4zOS40My40MywwLDAsMSwuNDEuNDF2Ni4wOGEuNjEuNjEsMCwwLDAsMSwuNDJoMGwwLDAsLjA4LS4wN2MuMDgtLjA3LjE5LS4xNi4zMy0uMjZBMi42NiwyLjY2LDAsMCwxLDI0LDIwLjJhMS44NiwxLjg2LDAsMCwxLDEuMTMuMTEuNjguNjgsMCwwLDEsLjM2LjQzbC0xLjM1LDFMMjQsMjEuOGwtMS43NiwxLjc2YTEwLDEwLDAsMCwwLTEuODcsMi41OSwxLjM1LDEuMzUsMCwwLDEtMS4yLjc0SDE3YTEuMjEsMS4yMSwwLDAsMS0xLjA3LS41OCw5LDksMCwwLDEtMS4zOS00LjA4VjE2YS40MS40MSwwLDEsMSwuODEsMHYyLjgzYS42MS42MSwwLDAsMCwuNjEuNjEuNjEuNjEsMCwwLDAsLjYxLS42MVYxNC41M2EuNC40LDAsMCwxLC40LS40MS40MS40MSwwLDAsMSwuNDEuNDF2NGEuNjEuNjEsMCwxLDAsMS4yMSwwVjEzLjUxYS40MS40MSwwLDAsMSwuODEsMFpNMjAuNTIsMTNBMS42MywxLjYzLDAsMCwwLDE5LDExLjg5LDEuNiwxLjYsMCwwLDAsMTcuNDYsMTNhMS42MywxLjYzLDAsMCwwLS41LS4wNywxLjYxLDEuNjEsMCwwLDAtMS42MSwxLjQ3LDEuODQsMS44NCwwLDAsMC0uNDEtLjA1QTEuNjIsMS42MiwwLDAsMCwxMy4zMSwxNnY2LjI4YTEwLjIsMTAuMiwwLDAsMCwxLjU2LDQuN0EyLjQ0LDIuNDQsMCwwLDAsMTcsMjguMTFIMTkuMmEyLjU4LDIuNTgsMCwwLDAsMi4yOS0xLjQxLDguNzksOC43OSwwLDAsMSwxLjYzLTIuMjhsMS43NC0xLjczLDEuNTgtMS4xOWEuNjEuNjEsMCwwLDAsLjI1LS40OSwxLjksMS45LDAsMCwwLTEuMDYtMS43OEEzLDMsMCwwLDAsMjMuNzQsMTlhMy42NCwzLjY0LDAsMCwwLTEuMTEuNFYxNC41M0ExLjYzLDEuNjMsMCwwLDAsMjEsMTIuOTEsMS41MSwxLjUxLDAsMCwwLDIwLjUyLDEzWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/imageIcon.svg":
/*!********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/imageIcon.svg ***!
  \********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDQwIDQwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjMuODYsMTEuODZhMi42NSwyLjY1LDAsMCwxLDIuNjUsMi42NXY5LjM2YTIuNjUsMi42NSwwLDAsMS0yLjY1LDIuNjVIMTQuNWEyLjY1LDIuNjUsMCwwLDEtMi42NS0yLjY1VjE0LjUxYTIuNjUsMi42NSwwLDAsMSwyLjY1LTIuNjVabS40NywxMy4zNi00LjcyLTQuNjNhLjYyLjYyLDAsMCwwLS43OS0uMDZsLS4wNy4wNkwxNCwyNS4yMmExLjQsMS40LDAsMCwwLC40Ny4wOGg5LjM2YTEuNCwxLjQsMCwwLDAsLjQ3LS4wOGwtNC43Mi00LjYzWm0tLjQ3LTEyLjEzSDE0LjVhMS40MiwxLjQyLDAsMCwwLTEuNDMsMS40MnY5LjM2YTEuMzMsMS4zMywwLDAsMCwuMDkuNDlsNC43NC00LjY1YTEuODQsMS44NCwwLDAsMSwyLjQ2LS4wOWwuMS4wOSw0Ljc0LDQuNjVhMS4zMywxLjMzLDAsMCwwLC4wOS0uNDlWMTQuNTFBMS40MiwxLjQyLDAsMCwwLDIzLjg2LDEzLjA5Wm0tMiwxLjYyQTEuODQsMS44NCwwLDEsMSwyMCwxNi41NSwxLjgzLDEuODMsMCwwLDEsMjEuODMsMTQuNzFabTAsMS4yMmEuNjEuNjEsMCwwLDAtLjYxLjYyLjYxLjYxLDAsMCwwLDEuMjIsMEEuNjEuNjEsMCwwLDAsMjEuODMsMTUuOTNaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/imageSliderIcon.svg":
/*!**************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/imageSliderIcon.svg ***!
  \**************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjYuMDYsMTQuMzRIMTMuOTRBMy42NCwzLjY0LDAsMCwwLDEwLjMsMThWMjJhMy42NCwzLjY0LDAsMCwwLDMuNjQsMy42M0gyNi4wNkEzLjY0LDMuNjQsMCwwLDAsMjkuNywyMlYxOEEzLjY0LDMuNjQsMCwwLDAsMjYuMDYsMTQuMzRabTAsMTAuMTFIMTMuOTRhMi40MiwyLjQyLDAsMCwxLS44MS0uMTVsMS40MS0xLjM5YTMuMjQsMy4yNCwwLDAsMCwxLjQ1LjM2QTMuMjgsMy4yOCwwLDAsMCwxOS4yNiwyMGEzLjE4LDMuMTgsMCwwLDAtLjM1LTEuNDNsLjY0LS42M2EuNTQuNTQsMCwwLDEsLjc0LDBMMjcsMjQuMjZBMi40MywyLjQzLDAsMCwxLDI2LjA2LDI0LjQ1Wk0xNCwyMGEyLDIsMCwxLDEsMiwyQTIsMiwwLDAsMSwxNCwyMFptMTQuNTIsMmEyLjQxLDIuNDEsMCwwLDEtLjQxLDEuMzRsLTYuODQtNi40NGExLjkxLDEuOTEsMCwwLDAtMi42NywwbC0uNTMuNTJhMy4yMiwzLjIyLDAsMCwwLTItLjc1QTMuMjgsMy4yOCwwLDAsMCwxMi43MiwyMGEzLjIzLDMuMjMsMCwwLDAsLjczLDJMMTIsMjMuNDdBMi40LDIuNCwwLDAsMSwxMS41MSwyMlYxOGEyLjQzLDIuNDMsMCwwLDEsMi40My0yLjQySDI2LjA2QTIuNDMsMi40MywwLDAsMSwyOC40OSwxOFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/inputFieldIcon.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/inputFieldIcon.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjIuNDMsMTcuMTdIMjAuNjF2NS42NkgyMWEuNjEuNjEsMCwwLDEsLjYxLjYxLjYxLjYxLDAsMCwxLS42MS42MUgxOWEuNjEuNjEsMCwwLDEtLjYxLS42MS42MS42MSwwLDAsMSwuNjEtLjYxaC40VjE3LjE3SDE3LjU3di42YS42MS42MSwwLDEsMS0xLjIxLDBWMTYuNTZBLjYuNiwwLDAsMSwxNywxNkgyM2EuNi42LDAsMCwxLC42LjYxdjEuMjFhLjYxLjYxLDAsMSwxLTEuMjEsMFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMTQuOTQsMTMuNTJhMywzLDAsMCwwLTMsM3Y2Ljg4YTMsMywwLDAsMCwzLDNIMjUuMDZhMywzLDAsMCwwLDMtM1YxNi41NmEzLDMsMCwwLDAtMy0zWm0tMS44MiwzYTEuODEsMS44MSwwLDAsMSwxLjgyLTEuODJIMjUuMDZhMS44MSwxLjgxLDAsMCwxLDEuODIsMS44MnY2Ljg4YTEuODEsMS44MSwwLDAsMS0xLjgyLDEuODJIMTQuOTRhMS44MSwxLjgxLDAsMCwxLTEuODItMS44MloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/keyboardIcon.svg":
/*!***********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/keyboardIcon.svg ***!
  \***********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjYuMzEsMTQuM2ExLjgzLDEuODMsMCwwLDEsMS44MywxLjgzdjcuNzRhMS44MywxLjgzLDAsMCwxLTEuODMsMS44M0gxMy42OWExLjgzLDEuODMsMCwwLDEtMS44My0xLjgzVjE2LjEzYTEuODMsMS44MywwLDAsMSwxLjgzLTEuODNabTAsMS4yMkgxMy42OWEuNjEuNjEsMCwwLDAtLjYxLjYxdjcuNzRhLjYxLjYxLDAsMCwwLC42MS42MUgyNi4zMWEuNjEuNjEsMCwwLDAsLjYxLS42MVYxNi4xM0EuNjEuNjEsMCwwLDAsMjYuMzEsMTUuNTJaTTE1LjczLDIyaDguNTVhLjYxLjYxLDAsMCwxLC4wOCwxLjIySDE1LjczQS42MS42MSwwLDAsMSwxNS42NSwyMlptNy45My0yLjg1YS44Mi44MiwwLDAsMSwuODIuODIuODIuODIsMCwxLDEtLjgyLS44MlptLTQuODgsMGEuODIuODIsMCwwLDEsLjgyLjgyLjgyLjgyLDAsMSwxLS44Mi0uODJabS0yLjQ0LDBhLjgyLjgyLDAsMCwxLC44Mi44Mi44Mi44MiwwLDAsMS0uODIuODEuODEuODEsMCwwLDEtLjgxLS44MUEuODIuODIsMCwwLDEsMTYuMzQsMTkuMThabTQuODksMEEuODIuODIsMCwwLDEsMjIsMjBhLjgxLjgxLDAsMCwxLS44MS44MS44Mi44MiwwLDAsMS0uODItLjgxQS44Mi44MiwwLDAsMSwyMS4yMywxOS4xOFptLTYuMTEtMi40NGEuODIuODIsMCwwLDEsLjgxLjgyLjgxLjgxLDAsMCwxLS44MS44MS44Mi44MiwwLDAsMS0uODItLjgxQS44Mi44MiwwLDAsMSwxNS4xMiwxNi43NFptMi40NCwwYS44Mi44MiwwLDAsMSwuODEuODIuODEuODEsMCwwLDEtLjgxLjgxLjgyLjgyLDAsMCwxLS44Mi0uODFBLjgyLjgyLDAsMCwxLDE3LjU2LDE2Ljc0Wm0yLjQ0LDBhLjgyLjgyLDAsMCwxLC44MS44Mi44MS44MSwwLDAsMS0uODEuODEuODIuODIsMCwwLDEtLjgyLS44MUEuODIuODIsMCwwLDEsMjAsMTYuNzRabTIuNDQsMGEuODIuODIsMCwwLDEsLjgxLjgyLjgxLjgxLDAsMSwxLTEuNjIsMEEuODIuODIsMCwwLDEsMjIuNDQsMTYuNzRabTIuNDQsMGEuODIuODIsMCwwLDEsLjgyLjgyLjgyLjgyLDAsMCwxLS44Mi44MS44MS44MSwwLDAsMS0uODEtLjgxQS44Mi44MiwwLDAsMSwyNC44OCwxNi43NFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/lineIcon.svg":
/*!*******************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/lineIcon.svg ***!
  \*******************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTAuMywyMGEuNjEuNjEsMCwwLDEsLjYxLS42MUgyOS4wOWEuNjEuNjEsMCwxLDEsMCwxLjIySDEwLjkxQS42MS42MSwwLDAsMSwxMC4zLDIwWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/makeChildOfContainerIcon.svg":
/*!***********************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/makeChildOfContainerIcon.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTguNjcsMTQuNzdsLS4wNywwYS42MS42MSwwLDAsMC0uNzksMEwxNS42MSwxN1YxMS40OEEuNi42LDAsMCwwLDE1LDExaC0uMDhhLjYuNiwwLDAsMC0uNTMuNlYxN2wtMi4yLTIuMjEtLjA3LS4wNmEuNjEuNjEsMCwwLDAtLjc5LjkybDMuMjQsMy4yNC4wNy4wNmEuNjIuNjIsMCwwLDAsLjc5LS4wNmwzLjI0LTMuMjQsMC0uMDdBLjYxLjYxLDAsMCwwLDE4LjY3LDE0Ljc3WiIgc3R5bGU9ImZpbGw6IzIxMjEyMSIvPjxwYXRoIGQ9Ik0xMC4zNSw3LjcyYTIuNjIsMi42MiwwLDAsMC0yLjYzLDIuNjN2OS4zYTIuNjIsMi42MiwwLDAsMCwyLjYzLDIuNjNoOS4zYTIuNjIsMi42MiwwLDAsMCwyLjYzLTIuNjN2LTkuM2EyLjYyLDIuNjIsMCwwLDAtMi42My0yLjYzWk04LjkzLDEwLjM1YTEuNDMsMS40MywwLDAsMSwxLjQyLTEuNDJoOS4zYTEuNDMsMS40MywwLDAsMSwxLjQyLDEuNDJ2OS4zYTEuNDMsMS40MywwLDAsMS0xLjQyLDEuNDJoLTkuM2ExLjQzLDEuNDMsMCwwLDEtMS40Mi0xLjQyWiIgc3R5bGU9ImZpbGw6IzIxMjEyMSIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/makeComponentIcon.svg":
/*!****************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/makeComponentIcon.svg ***!
  \****************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsMTFhLjYxLjYxLDAsMCwxLC42MS42MXYyLjgzaDIuODNhLjYxLjYxLDAsMCwxLDAsMS4yMkgxNS42MXYyLjgzYS42MS42MSwwLDAsMS0xLjIyLDBWMTUuNjFIMTEuNTZhLjYxLjYxLDAsMSwxLDAtMS4yMmgyLjgzVjExLjU2QS42MS42MSwwLDAsMSwxNSwxMVoiIHN0eWxlPSJmaWxsOiMzMzMiLz48cGF0aCBkPSJNNy43MSwxMC4zNGEyLjYzLDIuNjMsMCwwLDEsMi42My0yLjYzaDkuMzJhMi42MywyLjYzLDAsMCwxLDIuNjMsMi42M3Y5LjMyYTIuNjMsMi42MywwLDAsMS0yLjYzLDIuNjNIMTAuMzRhMi42MywyLjYzLDAsMCwxLTIuNjMtMi42M1ptMi42My0xLjQxYTEuNDEsMS40MSwwLDAsMC0xLjQxLDEuNDF2OS4zMmExLjQxLDEuNDEsMCwwLDAsMS40MSwxLjQxaDkuMzJhMS40MSwxLjQxLDAsMCwwLDEuNDEtMS40MVYxMC4zNGExLjQxLDEuNDEsMCwwLDAtMS40MS0xLjQxWiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/passwordFieldIcon.svg":
/*!****************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/passwordFieldIcon.svg ***!
  \****************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTkuODIsMTguNTVhLjYyLjYyLDAsMCwwLS44NiwwLC42Mi42MiwwLDAsMCwwLC44N2wuNTguNTgtLjU4LjU4YS42Mi42MiwwLDAsMCwwLC44Ny42Mi42MiwwLDAsMCwuODYsMGwuNTktLjU5LjU4LjU5YS42MS42MSwwLDAsMCwuODYsMCwuNi42LDAsMCwwLDAtLjg2TDIxLjI3LDIwbC41OC0uNThhLjYyLjYyLDAsMCwwLDAtLjg3LjYyLjYyLDAsMCwwLS44NiwwbC0uNTguNTlaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTE0LjQ5LDE4LjU1YS42Mi42MiwwLDAsMSwuODYsMGwuNTkuNTkuNTgtLjU5YS42Mi42MiwwLDAsMSwuODcuODdMMTYuOCwyMGwuNTkuNThhLjYyLjYyLDAsMCwxLS44Ny44N2wtLjU4LS41OS0uNTkuNTlhLjYyLjYyLDAsMCwxLS44NiwwLC42My42MywwLDAsMSwwLS44N2wuNTktLjU4LS41OS0uNThBLjYzLjYzLDAsMCwxLDE0LjQ5LDE4LjU1WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0yMy42NSwyMS4yMmEuNi42LDAsMCwwLS42LjYxLjYxLjYxLDAsMCwwLC42LjYxaDEuNDNhLjYxLjYxLDAsMCwwLC42LS42MS42LjYsMCwwLDAtLjYtLjYxWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0xNC41MiwxNC4zMkEyLjY0LDIuNjQsMCwwLDAsMTEuODgsMTd2Ni4xYTIuNjQsMi42NCwwLDAsMCwyLjY0LDIuNjNoMTFhMi42NCwyLjY0LDAsMCwwLDIuNjQtMi42M1YxN2EyLjY0LDIuNjQsMCwwLDAtMi42NC0yLjYzWk0xMy4xLDE3YTEuNDIsMS40MiwwLDAsMSwxLjQyLTEuNDJoMTFBMS40MiwxLjQyLDAsMCwxLDI2LjksMTd2Ni4xYTEuNDIsMS40MiwwLDAsMS0xLjQyLDEuNDJoLTExYTEuNDIsMS40MiwwLDAsMS0xLjQyLTEuNDJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/pointerIcon.svg":
/*!**********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/pointerIcon.svg ***!
  \**********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjYuMDksMjAuNjUsMTUuMzcsMTIuMzFhMS4xOSwxLjE5LDAsMCwwLTEuOTIuOTR2MTMuNWExLjE5LDEuMTksMCwwLDAsMi4xMi43NGwzLjMzLTQuMjFhMS4zLDEuMywwLDAsMSwxLS41aDUuNDRBMS4xOSwxLjE5LDAsMCwwLDI2LjA5LDIwLjY1Wm0tNi4xNy45NGEyLjUxLDIuNTEsMCwwLDAtMiwuOTVsLTMuMzIsNC4yMVYxMy4yNWwxMC43Miw4LjM0WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/radioButtonIcon.svg":
/*!**************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/radioButtonIcon.svg ***!
  \**************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjAsMjQuODZBNC44Niw0Ljg2LDAsMSwwLDE1LjE0LDIwLDQuODcsNC44NywwLDAsMCwyMCwyNC44NloiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjAsMTEuOUE4LjEsOC4xLDAsMSwwLDI4LjEsMjAsOC4xLDguMSwwLDAsMCwyMCwxMS45Wk0xMy4xMiwyMEE2Ljg4LDYuODgsMCwxLDEsMjAsMjYuODgsNi44OCw2Ljg4LDAsMCwxLDEzLjEyLDIwWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/rectangleIcon.svg":
/*!************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/rectangleIcon.svg ***!
  \************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTAuMywxNi4zNmEzLjY0LDMuNjQsMCwwLDEsMy42NC0zLjY0SDI2LjA2YTMuNjQsMy42NCwwLDAsMSwzLjY0LDMuNjR2Ny4yOGEzLjY0LDMuNjQsMCwwLDEtMy42NCwzLjY0SDEzLjk0YTMuNjQsMy42NCwwLDAsMS0zLjY0LTMuNjRabTMuNjQtMi40MmEyLjQyLDIuNDIsMCwwLDAtMi40MywyLjQydjcuMjhhMi40MiwyLjQyLDAsMCwwLDIuNDMsMi40MkgyNi4wNmEyLjQyLDIuNDIsMCwwLDAsMi40My0yLjQyVjE2LjM2YTIuNDIsMi40MiwwLDAsMC0yLjQzLTIuNDJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/scrollbarIcon.svg":
/*!************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/scrollbarIcon.svg ***!
  \************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjIuMjUsMTMuMThWMjYuOTFIMjFWMTMuMThabTEuMTYsMy4zNHY0LjE5aDEuMjJWMTYuNTJabS42MS0uNjFhLjYxLjYxLDAsMSwwLC42MS42MUEuNjEuNjEsMCwwLDAsMjQsMTUuOTFabTAsNC4xOWEuNjEuNjEsMCwxLDAsLjYxLjYxQS42MS42MSwwLDAsMCwyNCwyMC4xWk0xMi43NCwyNC42NGEyLjYyLDIuNjIsMCwwLDAsMi42MiwyLjYyaDkuMjhhMi42MiwyLjYyLDAsMCwwLDIuNjItMi42MlYxNS4zNmEyLjYyLDIuNjIsMCwwLDAtMi42Mi0yLjYySDE1LjM2YTIuNjIsMi42MiwwLDAsMC0yLjYyLDIuNjJaTTE0LDE1LjM2QTEuNDEsMS40MSwwLDAsMSwxNS4zNiwxNGg5LjI4YTEuNDEsMS40MSwwLDAsMSwxLjQxLDEuNDF2OS4yOGExLjQxLDEuNDEsMCwwLDEtMS40MSwxLjQxSDE1LjM2QTEuNDEsMS40MSwwLDAsMSwxNCwyNC42NFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/sliderIcon.svg":
/*!*********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/sliderIcon.svg ***!
  \*********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTAuMywxOGEzLjY0LDMuNjQsMCwwLDEsMy42NC0zLjYzSDI2LjA2QTMuNjQsMy42NCwwLDAsMSwyOS43LDE4VjIyYTMuNjQsMy42NCwwLDAsMS0zLjY0LDMuNjNIMTMuOTRBMy42NCwzLjY0LDAsMCwxLDEwLjMsMjJabTMuNjQtMi40MkEyLjQzLDIuNDMsMCwwLDAsMTEuNTEsMThWMjJhMi40MywyLjQzLDAsMCwwLDIuNDMsMi40MkgyNi4wNkEyLjQzLDIuNDMsMCwwLDAsMjguNDksMjJWMThhMi40MywyLjQzLDAsMCwwLTIuNDMtMi40MloiIHN0eWxlPSJmaWxsOiNmZmYiLz48Y2lyY2xlIGN4PSIxNS45OSIgY3k9IjIwIiByPSIyLjY0IiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/stackPanelIcon.svg":
/*!*************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/stackPanelIcon.svg ***!
  \*************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTIuNzQsMTUuMzVhMi42MiwyLjYyLDAsMCwxLDIuNjItMi42M2g5LjI4YTIuNjIsMi42MiwwLDAsMSwyLjYyLDIuNjN2OS4yOGEyLjYyLDIuNjIsMCwwLDEtMi42MiwyLjYySDE1LjM2YTIuNjIsMi42MiwwLDAsMS0yLjYyLTIuNjJaTTI2LjA1LDIxLjZWMTguMzdIMTRWMjEuNlptMC00LjQ0VjE1LjM1YTEuNDEsMS40MSwwLDAsMC0xLjQxLTEuNDFIMTUuMzZBMS40MSwxLjQxLDAsMCwwLDE0LDE1LjM1djEuODFaTTI0LjY0LDI2YTEuNDEsMS40MSwwLDAsMCwxLjQxLTEuNDFWMjIuODFIMTR2MS44MkExLjQxLDEuNDEsMCwwLDAsMTUuMzYsMjZaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/textBoxIcon.svg":
/*!**********************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/textBoxIcon.svg ***!
  \**********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTQuMzMsMTQuMTJhLjYxLjYxLDAsMCwxLC42LS42MUgyNS4wN2EuNjEuNjEsMCwwLDEsLjYuNjF2MS42MmEuNjEuNjEsMCwxLDEtMS4yMSwwdi0xSDIwLjYxVjI1LjI3aDEuMjFhLjYxLjYxLDAsMCwxLC42MS42MS42MS42MSwwLDAsMS0uNjEuNjFIMTguMThhLjYxLjYxLDAsMCwxLS42MS0uNjEuNjEuNjEsMCwwLDEsLjYxLS42MWgxLjIxVjE0LjczSDE1LjU0djFhLjYxLjYxLDAsMSwxLTEuMjEsMFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/toolbarCollapseIcon.svg":
/*!******************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/toolbarCollapseIcon.svg ***!
  \******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojZmZmO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTguMzQsMTEuODZjLS4xMywuMTMtLjM0LC4xMy0uNDcsMGwtMy42MS0zLjZjLS4xNC0uMTQtLjE0LS4zNywwLS41MWwzLjYxLTMuNmMuMTMtLjEzLC4zNC0uMTMsLjQ3LDAsLjEzLC4xMywuMTMsLjM0LDAsLjQ3bC0zLjQsMy4zOSwzLjQsMy4zOWMuMTMsLjEzLC4xMywuMzQsMCwuNDdabTIuNjMsMGMtLjEzLC4xMy0uMzQsLjEzLS40NywwbC0zLjYxLTMuNmMtLjE0LS4xNC0uMTQtLjM3LDAtLjUxbDMuNjEtMy42Yy4xMy0uMTMsLjM0LS4xMywuNDcsMCwuMTMsLjEzLC4xMywuMzQsMCwuNDdsLTMuNCwzLjM5LDMuNCwzLjM5Yy4xMywuMTMsLjEzLC4zNCwwLC40N1oiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/toolbarExpandIcon.svg":
/*!****************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/toolbarExpandIcon.svg ***!
  \****************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojZmZmO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTcuNjYsMTEuMzlsMy40LTMuMzktMy40LTMuMzljLS4xMy0uMTMtLjEzLS4zNCwwLS40NywuMTMtLjEzLC4zNC0uMTMsLjQ3LDBsMy42MSwzLjZjLjE0LC4xNCwuMTQsLjM3LDAsLjUxbC0zLjYxLDMuNmMtLjEzLC4xMy0uMzQsLjEzLS40NywwLS4xMy0uMTMtLjEzLS4zNCwwLS40N1ptLTIuNjMsMGwzLjQtMy4zOS0zLjQtMy4zOWMtLjEzLS4xMy0uMTMtLjM0LDAtLjQ3LC4xMy0uMTMsLjM0LS4xMywuNDcsMGwzLjYxLDMuNmMuMTQsLjE0LC4xNCwuMzcsMCwuNTFsLTMuNjEsMy42Yy0uMTMsLjEzLS4zNCwuMTMtLjQ3LDAtLjEzLS4xMy0uMTMtLjM0LDAtLjQ3WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/visibilityActiveIcon.svg":
/*!*******************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/visibilityActiveIcon.svg ***!
  \*******************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsMTMuMTlhMy4yMywzLjIzLDAsMSwxLTMuMjIsMy4yMkEzLjIyLDMuMjIsMCwwLDEsMTUsMTMuMTlabTAsMS4yMWEyLDIsMCwxLDAsMiwyQTIsMiwwLDAsMCwxNSwxNC40Wm0wLTRhOC4wNiw4LjA2LDAsMCwxLDcuODIsNi4xLjYxLjYxLDAsMCwxLTEuMTguMjksNi44NCw2Ljg0LDAsMCwwLTEzLjI4LDAsLjYxLjYxLDAsMCwxLTEuMTgtLjNBOC4wNyw4LjA3LDAsMCwxLDE1LDEwLjM2WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/visibilityNotActiveIcon.svg":
/*!**********************************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/visibilityNotActiveIcon.svg ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTUsMTMuMTlhMy4yMywzLjIzLDAsMSwxLTMuMjIsMy4yMkEzLjIyLDMuMjIsMCwwLDEsMTUsMTMuMTlabTAsMS4yMWEyLDIsMCwxLDAsMiwyQTIsMiwwLDAsMCwxNSwxNC40Wm0wLTRhOC4wNiw4LjA2LDAsMCwxLDcuODIsNi4xLjYxLjYxLDAsMCwxLTEuMTguMjksNi44NCw2Ljg0LDAsMCwwLTEzLjI4LDAsLjYxLjYxLDAsMCwxLTEuMTgtLjNBOC4wNyw4LjA3LDAsMCwxLDE1LDEwLjM2WiIgc3R5bGU9ImZpbGw6Izg4OCIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../tools/guiEditor/dist/imgs/zoomIcon.svg":
/*!*******************************************************!*\
  !*** ../../../tools/guiEditor/dist/imgs/zoomIcon.svg ***!
  \*******************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjcuMSwyNi4yNGwtNC00YTUuODYsNS44NiwwLDEsMC0uODYuODZsNCw0LC4wNy4wNmEuNjIuNjIsMCwwLDAsLjc5LS4wNkEuNi42LDAsMCwwLDI3LjEsMjYuMjRabS04LjUxLTNhNC42NSw0LjY1LDAsMSwxLDQuNjQtNC42NEE0LjY1LDQuNjUsMCwwLDEsMTguNTksMjMuMjNaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

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

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_core_Misc_observable__;

/***/ }),

/***/ "gui/2D/controls/container":
/*!***************************************************************************************************************************!*\
  !*** external {"root":["BABYLON","GUI"],"commonjs":"@babylonjs/gui","commonjs2":"@babylonjs/gui","amd":"@babylonjs/gui"} ***!
  \***************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_gui_2D_controls_container__;

/***/ }),

/***/ "../../../../node_modules/classnames/index.js":
/*!****************************************************!*\
  !*** ../../../../node_modules/classnames/index.js ***!
  \****************************************************/
/***/ ((module, exports) => {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
/* global define */

(function () {
	'use strict';

	var hasOwn = {}.hasOwnProperty;

	function classNames () {
		var classes = '';

		for (var i = 0; i < arguments.length; i++) {
			var arg = arguments[i];
			if (arg) {
				classes = appendClass(classes, parseValue(arg));
			}
		}

		return classes;
	}

	function parseValue (arg) {
		if (typeof arg === 'string' || typeof arg === 'number') {
			return arg;
		}

		if (typeof arg !== 'object') {
			return '';
		}

		if (Array.isArray(arg)) {
			return classNames.apply(null, arg);
		}

		if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
			return arg.toString();
		}

		var classes = '';

		for (var key in arg) {
			if (hasOwn.call(arg, key) && arg[key]) {
				classes = appendClass(classes, key);
			}
		}

		return classes;
	}

	function appendClass (value, newClass) {
		if (!newClass) {
			return value;
		}
	
		if (value) {
			return value + ' ' + newClass;
		}
	
		return value + newClass;
	}

	if (  true && module.exports) {
		classNames.default = classNames;
		module.exports = classNames;
	} else if (true) {
		// register as 'classnames', consistent with npm package name
		!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
			return classNames;
		}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	} else {}
}());


/***/ }),

/***/ "../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs":
/*!****************************************************************************!*\
  !*** ../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs ***!
  \****************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_2258426__) => {

"use strict";
__nested_webpack_require_2258426__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2258426__.d(__nested_webpack_exports__, {
/* harmony export */   api: () => (/* binding */ api),
/* harmony export */   config: () => (/* binding */ config$1),
/* harmony export */   counter: () => (/* binding */ counter),
/* harmony export */   dom: () => (/* binding */ dom$1),
/* harmony export */   findIconDefinition: () => (/* binding */ findIconDefinition$1),
/* harmony export */   icon: () => (/* binding */ icon),
/* harmony export */   layer: () => (/* binding */ layer),
/* harmony export */   library: () => (/* binding */ library$1),
/* harmony export */   noAuto: () => (/* binding */ noAuto$1),
/* harmony export */   parse: () => (/* binding */ parse$1),
/* harmony export */   text: () => (/* binding */ text),
/* harmony export */   toHtml: () => (/* binding */ toHtml$1)
/* harmony export */ });
/*!
 * Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com
 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
 * Copyright 2024 Fonticons, Inc.
 */
function _defineProperty(e, r, t) {
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}
function _inherits(t, e) {
  if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
  t.prototype = Object.create(e && e.prototype, {
    constructor: {
      value: t,
      writable: !0,
      configurable: !0
    }
  }), Object.defineProperty(t, "prototype", {
    writable: !1
  }), e && _setPrototypeOf(t, e);
}
function ownKeys(e, r) {
  var t = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    r && (o = o.filter(function (r) {
      return Object.getOwnPropertyDescriptor(e, r).enumerable;
    })), t.push.apply(t, o);
  }
  return t;
}
function _objectSpread2(e) {
  for (var r = 1; r < arguments.length; r++) {
    var t = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
      _defineProperty(e, r, t[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
    });
  }
  return e;
}
function _setPrototypeOf(t, e) {
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
    return t.__proto__ = e, t;
  }, _setPrototypeOf(t, e);
}
function _toPrimitive(t, r) {
  if ("object" != typeof t || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != typeof i) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
  var i = _toPrimitive(t, "string");
  return "symbol" == typeof i ? i : i + "";
}
function _wrapRegExp() {
  _wrapRegExp = function (e, r) {
    return new BabelRegExp(e, void 0, r);
  };
  var e = RegExp.prototype,
    r = new WeakMap();
  function BabelRegExp(e, t, p) {
    var o = RegExp(e, t);
    return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype);
  }
  function buildGroups(e, t) {
    var p = r.get(t);
    return Object.keys(p).reduce(function (r, t) {
      var o = p[t];
      if ("number" == typeof o) r[t] = e[o];else {
        for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++;
        r[t] = e[o[i]];
      }
      return r;
    }, Object.create(null));
  }
  return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {
    var t = e.exec.call(this, r);
    if (t) {
      t.groups = buildGroups(t, this);
      var p = t.indices;
      p && (p.groups = buildGroups(p, this));
    }
    return t;
  }, BabelRegExp.prototype[Symbol.replace] = function (t, p) {
    if ("string" == typeof p) {
      var o = r.get(this);
      return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) {
        var t = o[r];
        return "$" + (Array.isArray(t) ? t.join("$") : t);
      }));
    }
    if ("function" == typeof p) {
      var i = this;
      return e[Symbol.replace].call(this, t, function () {
        var e = arguments;
        return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e);
      });
    }
    return e[Symbol.replace].call(this, t, p);
  }, _wrapRegExp.apply(this, arguments);
}

const noop = () => {};
let _WINDOW = {};
let _DOCUMENT = {};
let _MUTATION_OBSERVER = null;
let _PERFORMANCE = {
  mark: noop,
  measure: noop
};
try {
  if (typeof window !== 'undefined') _WINDOW = window;
  if (typeof document !== 'undefined') _DOCUMENT = document;
  if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
  if (typeof performance !== 'undefined') _PERFORMANCE = performance;
} catch (e) {}
const {
  userAgent = ''
} = _WINDOW.navigator || {};
const WINDOW = _WINDOW;
const DOCUMENT = _DOCUMENT;
const MUTATION_OBSERVER = _MUTATION_OBSERVER;
const PERFORMANCE = _PERFORMANCE;
const IS_BROWSER = !!WINDOW.document;
const IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
const IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');

var p = /fa(s|r|l|t|d|dr|dl|dt|b|k|kd|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,
  g = /Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;
var S = {
    classic: {
      fa: "solid",
      fas: "solid",
      "fa-solid": "solid",
      far: "regular",
      "fa-regular": "regular",
      fal: "light",
      "fa-light": "light",
      fat: "thin",
      "fa-thin": "thin",
      fab: "brands",
      "fa-brands": "brands"
    },
    duotone: {
      fa: "solid",
      fad: "solid",
      "fa-solid": "solid",
      "fa-duotone": "solid",
      fadr: "regular",
      "fa-regular": "regular",
      fadl: "light",
      "fa-light": "light",
      fadt: "thin",
      "fa-thin": "thin"
    },
    sharp: {
      fa: "solid",
      fass: "solid",
      "fa-solid": "solid",
      fasr: "regular",
      "fa-regular": "regular",
      fasl: "light",
      "fa-light": "light",
      fast: "thin",
      "fa-thin": "thin"
    },
    "sharp-duotone": {
      fa: "solid",
      fasds: "solid",
      "fa-solid": "solid",
      fasdr: "regular",
      "fa-regular": "regular",
      fasdl: "light",
      "fa-light": "light",
      fasdt: "thin",
      "fa-thin": "thin"
    }
  },
  A = {
    GROUP: "duotone-group",
    SWAP_OPACITY: "swap-opacity",
    PRIMARY: "primary",
    SECONDARY: "secondary"
  },
  P = ["fa-classic", "fa-duotone", "fa-sharp", "fa-sharp-duotone"];
var s = "classic",
  t = "duotone",
  r = "sharp",
  o = "sharp-duotone",
  L = [s, t, r, o];
var G = {
    classic: {
      900: "fas",
      400: "far",
      normal: "far",
      300: "fal",
      100: "fat"
    },
    duotone: {
      900: "fad",
      400: "fadr",
      300: "fadl",
      100: "fadt"
    },
    sharp: {
      900: "fass",
      400: "fasr",
      300: "fasl",
      100: "fast"
    },
    "sharp-duotone": {
      900: "fasds",
      400: "fasdr",
      300: "fasdl",
      100: "fasdt"
    }
  };
var lt = {
    "Font Awesome 6 Free": {
      900: "fas",
      400: "far"
    },
    "Font Awesome 6 Pro": {
      900: "fas",
      400: "far",
      normal: "far",
      300: "fal",
      100: "fat"
    },
    "Font Awesome 6 Brands": {
      400: "fab",
      normal: "fab"
    },
    "Font Awesome 6 Duotone": {
      900: "fad",
      400: "fadr",
      normal: "fadr",
      300: "fadl",
      100: "fadt"
    },
    "Font Awesome 6 Sharp": {
      900: "fass",
      400: "fasr",
      normal: "fasr",
      300: "fasl",
      100: "fast"
    },
    "Font Awesome 6 Sharp Duotone": {
      900: "fasds",
      400: "fasdr",
      normal: "fasdr",
      300: "fasdl",
      100: "fasdt"
    }
  };
var pt = new Map([["classic", {
    defaultShortPrefixId: "fas",
    defaultStyleId: "solid",
    styleIds: ["solid", "regular", "light", "thin", "brands"],
    futureStyleIds: [],
    defaultFontWeight: 900
  }], ["sharp", {
    defaultShortPrefixId: "fass",
    defaultStyleId: "solid",
    styleIds: ["solid", "regular", "light", "thin"],
    futureStyleIds: [],
    defaultFontWeight: 900
  }], ["duotone", {
    defaultShortPrefixId: "fad",
    defaultStyleId: "solid",
    styleIds: ["solid", "regular", "light", "thin"],
    futureStyleIds: [],
    defaultFontWeight: 900
  }], ["sharp-duotone", {
    defaultShortPrefixId: "fasds",
    defaultStyleId: "solid",
    styleIds: ["solid", "regular", "light", "thin"],
    futureStyleIds: [],
    defaultFontWeight: 900
  }]]),
  xt = {
    classic: {
      solid: "fas",
      regular: "far",
      light: "fal",
      thin: "fat",
      brands: "fab"
    },
    duotone: {
      solid: "fad",
      regular: "fadr",
      light: "fadl",
      thin: "fadt"
    },
    sharp: {
      solid: "fass",
      regular: "fasr",
      light: "fasl",
      thin: "fast"
    },
    "sharp-duotone": {
      solid: "fasds",
      regular: "fasdr",
      light: "fasdl",
      thin: "fasdt"
    }
  };
var Ft = ["fak", "fa-kit", "fakd", "fa-kit-duotone"],
  St = {
    kit: {
      fak: "kit",
      "fa-kit": "kit"
    },
    "kit-duotone": {
      fakd: "kit-duotone",
      "fa-kit-duotone": "kit-duotone"
    }
  },
  At = ["kit"];
var Ct = {
  kit: {
    "fa-kit": "fak"
  },
  "kit-duotone": {
    "fa-kit-duotone": "fakd"
  }
};
var Lt = ["fak", "fakd"],
  Wt = {
    kit: {
      fak: "fa-kit"
    },
    "kit-duotone": {
      fakd: "fa-kit-duotone"
    }
  };
var Et = {
    kit: {
      kit: "fak"
    },
    "kit-duotone": {
      "kit-duotone": "fakd"
    }
  };

var t$1 = {
    GROUP: "duotone-group",
    SWAP_OPACITY: "swap-opacity",
    PRIMARY: "primary",
    SECONDARY: "secondary"
  },
  r$1 = ["fa-classic", "fa-duotone", "fa-sharp", "fa-sharp-duotone"];
var bt$1 = ["fak", "fa-kit", "fakd", "fa-kit-duotone"];
var Yt = {
    "Font Awesome Kit": {
      400: "fak",
      normal: "fak"
    },
    "Font Awesome Kit Duotone": {
      400: "fakd",
      normal: "fakd"
    }
  };
var po = {
    classic: {
      "fa-brands": "fab",
      "fa-duotone": "fad",
      "fa-light": "fal",
      "fa-regular": "far",
      "fa-solid": "fas",
      "fa-thin": "fat"
    },
    duotone: {
      "fa-regular": "fadr",
      "fa-light": "fadl",
      "fa-thin": "fadt"
    },
    sharp: {
      "fa-solid": "fass",
      "fa-regular": "fasr",
      "fa-light": "fasl",
      "fa-thin": "fast"
    },
    "sharp-duotone": {
      "fa-solid": "fasds",
      "fa-regular": "fasdr",
      "fa-light": "fasdl",
      "fa-thin": "fasdt"
    }
  },
  I$1 = {
    classic: ["fas", "far", "fal", "fat", "fad"],
    duotone: ["fadr", "fadl", "fadt"],
    sharp: ["fass", "fasr", "fasl", "fast"],
    "sharp-duotone": ["fasds", "fasdr", "fasdl", "fasdt"]
  },
  co = {
    classic: {
      fab: "fa-brands",
      fad: "fa-duotone",
      fal: "fa-light",
      far: "fa-regular",
      fas: "fa-solid",
      fat: "fa-thin"
    },
    duotone: {
      fadr: "fa-regular",
      fadl: "fa-light",
      fadt: "fa-thin"
    },
    sharp: {
      fass: "fa-solid",
      fasr: "fa-regular",
      fasl: "fa-light",
      fast: "fa-thin"
    },
    "sharp-duotone": {
      fasds: "fa-solid",
      fasdr: "fa-regular",
      fasdl: "fa-light",
      fasdt: "fa-thin"
    }
  },
  x = ["fa-solid", "fa-regular", "fa-light", "fa-thin", "fa-duotone", "fa-brands"],
  xo = ["fa", "fas", "far", "fal", "fat", "fad", "fadr", "fadl", "fadt", "fab", "fass", "fasr", "fasl", "fast", "fasds", "fasdr", "fasdl", "fasdt", ...r$1, ...x],
  m$1 = ["solid", "regular", "light", "thin", "duotone", "brands"],
  c$1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
  F$1 = c$1.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]),
  Fo = [...Object.keys(I$1), ...m$1, "2xs", "xs", "sm", "lg", "xl", "2xl", "beat", "border", "fade", "beat-fade", "bounce", "flip-both", "flip-horizontal", "flip-vertical", "flip", "fw", "inverse", "layers-counter", "layers-text", "layers", "li", "pull-left", "pull-right", "pulse", "rotate-180", "rotate-270", "rotate-90", "rotate-by", "shake", "spin-pulse", "spin-reverse", "spin", "stack-1x", "stack-2x", "stack", "ul", t$1.GROUP, t$1.SWAP_OPACITY, t$1.PRIMARY, t$1.SECONDARY].concat(c$1.map(o => "".concat(o, "x"))).concat(F$1.map(o => "w-".concat(o)));
var ko = {
    "Font Awesome 5 Free": {
      900: "fas",
      400: "far"
    },
    "Font Awesome 5 Pro": {
      900: "fas",
      400: "far",
      normal: "far",
      300: "fal"
    },
    "Font Awesome 5 Brands": {
      400: "fab",
      normal: "fab"
    },
    "Font Awesome 5 Duotone": {
      900: "fad"
    }
  };

const NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
const UNITS_IN_GRID = 16;
const DEFAULT_CSS_PREFIX = 'fa';
const DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
const DATA_FA_I2SVG = 'data-fa-i2svg';
const DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
const DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
const DATA_PREFIX = 'data-prefix';
const DATA_ICON = 'data-icon';
const HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
const MUTATION_APPROACH_ASYNC = 'async';
const TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
const PRODUCTION = (() => {
  try {
    return "development" === 'production';
  } catch (e$$1) {
    return false;
  }
})();
function familyProxy(obj) {
  // Defaults to the classic family if family is not available
  return new Proxy(obj, {
    get(target, prop) {
      return prop in target ? target[prop] : target[s];
    }
  });
}
const _PREFIX_TO_STYLE = _objectSpread2({}, S);

// We changed FACSSClassesToStyleId in the icons repo to be canonical and as such, "classic" family does not have any
// duotone styles.  But we do still need duotone in _PREFIX_TO_STYLE below, so we are manually adding
// {'fa-duotone': 'duotone'}
_PREFIX_TO_STYLE[s] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
  'fa-duotone': 'duotone'
}), S[s]), St['kit']), St['kit-duotone']);
const PREFIX_TO_STYLE = familyProxy(_PREFIX_TO_STYLE);
const _STYLE_TO_PREFIX = _objectSpread2({}, xt);

// We changed FAStyleIdToShortPrefixId in the icons repo to be canonical and as such, "classic" family does not have any
// duotone styles.  But we do still need duotone in _STYLE_TO_PREFIX below, so we are manually adding {duotone: 'fad'}
_STYLE_TO_PREFIX[s] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
  duotone: 'fad'
}), _STYLE_TO_PREFIX[s]), Et['kit']), Et['kit-duotone']);
const STYLE_TO_PREFIX = familyProxy(_STYLE_TO_PREFIX);
const _PREFIX_TO_LONG_STYLE = _objectSpread2({}, co);
_PREFIX_TO_LONG_STYLE[s] = _objectSpread2(_objectSpread2({}, _PREFIX_TO_LONG_STYLE[s]), Wt['kit']);
const PREFIX_TO_LONG_STYLE = familyProxy(_PREFIX_TO_LONG_STYLE);
const _LONG_STYLE_TO_PREFIX = _objectSpread2({}, po);
_LONG_STYLE_TO_PREFIX[s] = _objectSpread2(_objectSpread2({}, _LONG_STYLE_TO_PREFIX[s]), Ct['kit']);
const LONG_STYLE_TO_PREFIX = familyProxy(_LONG_STYLE_TO_PREFIX);
const ICON_SELECTION_SYNTAX_PATTERN = p; // eslint-disable-line no-useless-escape

const LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
const FONT_FAMILY_PATTERN = g;
const _FONT_WEIGHT_TO_PREFIX = _objectSpread2({}, G);
const FONT_WEIGHT_TO_PREFIX = familyProxy(_FONT_WEIGHT_TO_PREFIX);
const ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
const DUOTONE_CLASSES = A;
const RESERVED_CLASSES = [...At, ...Fo];

const initial = WINDOW.FontAwesomeConfig || {};
function getAttrConfig(attr) {
  var element = DOCUMENT.querySelector('script[' + attr + ']');
  if (element) {
    return element.getAttribute(attr);
  }
}
function coerce(val) {
  // Getting an empty string will occur if the attribute is set on the HTML tag but without a value
  // We'll assume that this is an indication that it should be toggled to true
  if (val === '') return true;
  if (val === 'false') return false;
  if (val === 'true') return true;
  return val;
}
if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
  const attrs = [['data-family-prefix', 'familyPrefix'], ['data-css-prefix', 'cssPrefix'], ['data-family-default', 'familyDefault'], ['data-style-default', 'styleDefault'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];
  attrs.forEach(_ref => {
    let [attr, key] = _ref;
    const val = coerce(getAttrConfig(attr));
    if (val !== undefined && val !== null) {
      initial[key] = val;
    }
  });
}
const _default = {
  styleDefault: 'solid',
  familyDefault: s,
  cssPrefix: DEFAULT_CSS_PREFIX,
  replacementClass: DEFAULT_REPLACEMENT_CLASS,
  autoReplaceSvg: true,
  autoAddCss: true,
  autoA11y: true,
  searchPseudoElements: false,
  observeMutations: true,
  mutateApproach: 'async',
  keepOriginalSource: true,
  measurePerformance: false,
  showMissingIcons: true
};

// familyPrefix is deprecated but we must still support it if present
if (initial.familyPrefix) {
  initial.cssPrefix = initial.familyPrefix;
}
const _config = _objectSpread2(_objectSpread2({}, _default), initial);
if (!_config.autoReplaceSvg) _config.observeMutations = false;
const config = {};
Object.keys(_default).forEach(key => {
  Object.defineProperty(config, key, {
    enumerable: true,
    set: function (val) {
      _config[key] = val;
      _onChangeCb.forEach(cb => cb(config));
    },
    get: function () {
      return _config[key];
    }
  });
});

// familyPrefix is deprecated as of 6.2.0 and should be removed in 7.0.0
Object.defineProperty(config, 'familyPrefix', {
  enumerable: true,
  set: function (val) {
    _config.cssPrefix = val;
    _onChangeCb.forEach(cb => cb(config));
  },
  get: function () {
    return _config.cssPrefix;
  }
});
WINDOW.FontAwesomeConfig = config;
const _onChangeCb = [];
function onChange(cb) {
  _onChangeCb.push(cb);
  return () => {
    _onChangeCb.splice(_onChangeCb.indexOf(cb), 1);
  };
}

const d$2 = UNITS_IN_GRID;
const meaninglessTransform = {
  size: 16,
  x: 0,
  y: 0,
  rotate: 0,
  flipX: false,
  flipY: false
};
function insertCss(css) {
  if (!css || !IS_DOM) {
    return;
  }
  const style = DOCUMENT.createElement('style');
  style.setAttribute('type', 'text/css');
  style.innerHTML = css;
  const headChildren = DOCUMENT.head.childNodes;
  let beforeChild = null;
  for (let i = headChildren.length - 1; i > -1; i--) {
    const child = headChildren[i];
    const tagName = (child.tagName || '').toUpperCase();
    if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
      beforeChild = child;
    }
  }
  DOCUMENT.head.insertBefore(style, beforeChild);
  return css;
}
const idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
function nextUniqueId() {
  let size = 12;
  let id = '';
  while (size-- > 0) {
    id += idPool[Math.random() * 62 | 0];
  }
  return id;
}
function toArray(obj) {
  const array = [];
  for (let i = (obj || []).length >>> 0; i--;) {
    array[i] = obj[i];
  }
  return array;
}
function classArray(node) {
  if (node.classList) {
    return toArray(node.classList);
  } else {
    return (node.getAttribute('class') || '').split(' ').filter(i => i);
  }
}
function htmlEscape(str) {
  return "".concat(str).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
function joinAttributes(attributes) {
  return Object.keys(attributes || {}).reduce((acc, attributeName) => {
    return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
  }, '').trim();
}
function joinStyles(styles) {
  return Object.keys(styles || {}).reduce((acc, styleName) => {
    return acc + "".concat(styleName, ": ").concat(styles[styleName].trim(), ";");
  }, '');
}
function transformIsMeaningful(transform) {
  return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
}
function transformForSvg(_ref) {
  let {
    transform,
    containerWidth,
    iconWidth
  } = _ref;
  const outer = {
    transform: "translate(".concat(containerWidth / 2, " 256)")
  };
  const innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
  const innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
  const innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
  const inner = {
    transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
  };
  const path = {
    transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
  };
  return {
    outer,
    inner,
    path
  };
}
function transformForCss(_ref2) {
  let {
    transform,
    width = UNITS_IN_GRID,
    height = UNITS_IN_GRID,
    startCentered = false
  } = _ref2;
  let val = '';
  if (startCentered && IS_IE) {
    val += "translate(".concat(transform.x / d$2 - width / 2, "em, ").concat(transform.y / d$2 - height / 2, "em) ");
  } else if (startCentered) {
    val += "translate(calc(-50% + ".concat(transform.x / d$2, "em), calc(-50% + ").concat(transform.y / d$2, "em)) ");
  } else {
    val += "translate(".concat(transform.x / d$2, "em, ").concat(transform.y / d$2, "em) ");
  }
  val += "scale(".concat(transform.size / d$2 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d$2 * (transform.flipY ? -1 : 1), ") ");
  val += "rotate(".concat(transform.rotate, "deg) ");
  return val;
}

var baseStyles = ":root, :host {\n  --fa-font-solid: normal 900 1em/1 \"Font Awesome 6 Free\";\n  --fa-font-regular: normal 400 1em/1 \"Font Awesome 6 Free\";\n  --fa-font-light: normal 300 1em/1 \"Font Awesome 6 Pro\";\n  --fa-font-thin: normal 100 1em/1 \"Font Awesome 6 Pro\";\n  --fa-font-duotone: normal 900 1em/1 \"Font Awesome 6 Duotone\";\n  --fa-font-duotone-regular: normal 400 1em/1 \"Font Awesome 6 Duotone\";\n  --fa-font-duotone-light: normal 300 1em/1 \"Font Awesome 6 Duotone\";\n  --fa-font-duotone-thin: normal 100 1em/1 \"Font Awesome 6 Duotone\";\n  --fa-font-brands: normal 400 1em/1 \"Font Awesome 6 Brands\";\n  --fa-font-sharp-solid: normal 900 1em/1 \"Font Awesome 6 Sharp\";\n  --fa-font-sharp-regular: normal 400 1em/1 \"Font Awesome 6 Sharp\";\n  --fa-font-sharp-light: normal 300 1em/1 \"Font Awesome 6 Sharp\";\n  --fa-font-sharp-thin: normal 100 1em/1 \"Font Awesome 6 Sharp\";\n  --fa-font-sharp-duotone-solid: normal 900 1em/1 \"Font Awesome 6 Sharp Duotone\";\n  --fa-font-sharp-duotone-regular: normal 400 1em/1 \"Font Awesome 6 Sharp Duotone\";\n  --fa-font-sharp-duotone-light: normal 300 1em/1 \"Font Awesome 6 Sharp Duotone\";\n  --fa-font-sharp-duotone-thin: normal 100 1em/1 \"Font Awesome 6 Sharp Duotone\";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n  overflow: visible;\n  box-sizing: content-box;\n}\n\n.svg-inline--fa {\n  display: var(--fa-display, inline-block);\n  height: 1em;\n  overflow: visible;\n  vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n  vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n  vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n  vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n  vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n  vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n  vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n  margin-right: var(--fa-pull-margin, 0.3em);\n  width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n  margin-left: var(--fa-pull-margin, 0.3em);\n  width: auto;\n}\n.svg-inline--fa.fa-li {\n  width: var(--fa-li-width, 2em);\n  top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n  width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n  display: inline-block;\n  position: absolute;\n  text-align: center;\n}\n\n.fa-layers {\n  display: inline-block;\n  height: 1em;\n  position: relative;\n  text-align: center;\n  vertical-align: -0.125em;\n  width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n  transform-origin: center center;\n}\n\n.fa-layers-text {\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  transform-origin: center center;\n}\n\n.fa-layers-counter {\n  background-color: var(--fa-counter-background-color, #ff253a);\n  border-radius: var(--fa-counter-border-radius, 1em);\n  box-sizing: border-box;\n  color: var(--fa-inverse, #fff);\n  line-height: var(--fa-counter-line-height, 1);\n  max-width: var(--fa-counter-max-width, 5em);\n  min-width: var(--fa-counter-min-width, 1.5em);\n  overflow: hidden;\n  padding: var(--fa-counter-padding, 0.25em 0.5em);\n  right: var(--fa-right, 0);\n  text-overflow: ellipsis;\n  top: var(--fa-top, 0);\n  transform: scale(var(--fa-counter-scale, 0.25));\n  transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n  bottom: var(--fa-bottom, 0);\n  right: var(--fa-right, 0);\n  top: auto;\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n  bottom: var(--fa-bottom, 0);\n  left: var(--fa-left, 0);\n  right: auto;\n  top: auto;\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n  top: var(--fa-top, 0);\n  right: var(--fa-right, 0);\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: top right;\n}\n\n.fa-layers-top-left {\n  left: var(--fa-left, 0);\n  right: auto;\n  top: var(--fa-top, 0);\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: top left;\n}\n\n.fa-1x {\n  font-size: 1em;\n}\n\n.fa-2x {\n  font-size: 2em;\n}\n\n.fa-3x {\n  font-size: 3em;\n}\n\n.fa-4x {\n  font-size: 4em;\n}\n\n.fa-5x {\n  font-size: 5em;\n}\n\n.fa-6x {\n  font-size: 6em;\n}\n\n.fa-7x {\n  font-size: 7em;\n}\n\n.fa-8x {\n  font-size: 8em;\n}\n\n.fa-9x {\n  font-size: 9em;\n}\n\n.fa-10x {\n  font-size: 10em;\n}\n\n.fa-2xs {\n  font-size: 0.625em;\n  line-height: 0.1em;\n  vertical-align: 0.225em;\n}\n\n.fa-xs {\n  font-size: 0.75em;\n  line-height: 0.0833333337em;\n  vertical-align: 0.125em;\n}\n\n.fa-sm {\n  font-size: 0.875em;\n  line-height: 0.0714285718em;\n  vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n  font-size: 1.25em;\n  line-height: 0.05em;\n  vertical-align: -0.075em;\n}\n\n.fa-xl {\n  font-size: 1.5em;\n  line-height: 0.0416666682em;\n  vertical-align: -0.125em;\n}\n\n.fa-2xl {\n  font-size: 2em;\n  line-height: 0.03125em;\n  vertical-align: -0.1875em;\n}\n\n.fa-fw {\n  text-align: center;\n  width: 1.25em;\n}\n\n.fa-ul {\n  list-style-type: none;\n  margin-left: var(--fa-li-margin, 2.5em);\n  padding-left: 0;\n}\n.fa-ul > li {\n  position: relative;\n}\n\n.fa-li {\n  left: calc(-1 * var(--fa-li-width, 2em));\n  position: absolute;\n  text-align: center;\n  width: var(--fa-li-width, 2em);\n  line-height: inherit;\n}\n\n.fa-border {\n  border-color: var(--fa-border-color, #eee);\n  border-radius: var(--fa-border-radius, 0.1em);\n  border-style: var(--fa-border-style, solid);\n  border-width: var(--fa-border-width, 0.08em);\n  padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n  float: left;\n  margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n  float: right;\n  margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n  animation-name: fa-beat;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n  animation-name: fa-bounce;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n  animation-name: fa-fade;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n  animation-name: fa-beat-fade;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n  animation-name: fa-flip;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n  animation-name: fa-shake;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n  animation-name: fa-spin;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 2s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n  --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n  animation-name: fa-spin;\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n    animation-delay: -1ms;\n    animation-duration: 1ms;\n    animation-iteration-count: 1;\n    transition-delay: 0s;\n    transition-duration: 0s;\n  }\n}\n@keyframes fa-beat {\n  0%, 90% {\n    transform: scale(1);\n  }\n  45% {\n    transform: scale(var(--fa-beat-scale, 1.25));\n  }\n}\n@keyframes fa-bounce {\n  0% {\n    transform: scale(1, 1) translateY(0);\n  }\n  10% {\n    transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n  }\n  30% {\n    transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n  }\n  50% {\n    transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n  }\n  57% {\n    transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n  }\n  64% {\n    transform: scale(1, 1) translateY(0);\n  }\n  100% {\n    transform: scale(1, 1) translateY(0);\n  }\n}\n@keyframes fa-fade {\n  50% {\n    opacity: var(--fa-fade-opacity, 0.4);\n  }\n}\n@keyframes fa-beat-fade {\n  0%, 100% {\n    opacity: var(--fa-beat-fade-opacity, 0.4);\n    transform: scale(1);\n  }\n  50% {\n    opacity: 1;\n    transform: scale(var(--fa-beat-fade-scale, 1.125));\n  }\n}\n@keyframes fa-flip {\n  50% {\n    transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n  }\n}\n@keyframes fa-shake {\n  0% {\n    transform: rotate(-15deg);\n  }\n  4% {\n    transform: rotate(15deg);\n  }\n  8%, 24% {\n    transform: rotate(-18deg);\n  }\n  12%, 28% {\n    transform: rotate(18deg);\n  }\n  16% {\n    transform: rotate(-22deg);\n  }\n  20% {\n    transform: rotate(22deg);\n  }\n  32% {\n    transform: rotate(-12deg);\n  }\n  36% {\n    transform: rotate(12deg);\n  }\n  40%, 100% {\n    transform: rotate(0deg);\n  }\n}\n@keyframes fa-spin {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n.fa-rotate-90 {\n  transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n  transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n  transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n  transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n  transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n  transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n  transform: rotate(var(--fa-rotate-angle, 0));\n}\n\n.fa-stack {\n  display: inline-block;\n  vertical-align: middle;\n  height: 2em;\n  position: relative;\n  width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n  z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n  height: 1em;\n  width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n  height: 2em;\n  width: 2.5em;\n}\n\n.fa-inverse {\n  color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n  fill: var(--fa-primary-color, currentColor);\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n  fill: var(--fa-secondary-color, currentColor);\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n  fill: black;\n}";

function css() {
  const dcp = DEFAULT_CSS_PREFIX;
  const drc = DEFAULT_REPLACEMENT_CLASS;
  const fp = config.cssPrefix;
  const rc = config.replacementClass;
  let s = baseStyles;
  if (fp !== dcp || rc !== drc) {
    const dPatt = new RegExp("\\.".concat(dcp, "\\-"), 'g');
    const customPropPatt = new RegExp("\\--".concat(dcp, "\\-"), 'g');
    const rPatt = new RegExp("\\.".concat(drc), 'g');
    s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
  }
  return s;
}
let _cssInserted = false;
function ensureCss() {
  if (config.autoAddCss && !_cssInserted) {
    insertCss(css());
    _cssInserted = true;
  }
}
var InjectCSS = {
  mixout() {
    return {
      dom: {
        css,
        insertCss: ensureCss
      }
    };
  },
  hooks() {
    return {
      beforeDOMElementCreation() {
        ensureCss();
      },
      beforeI2svg() {
        ensureCss();
      }
    };
  }
};

const w = WINDOW || {};
if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
var namespace = w[NAMESPACE_IDENTIFIER];

const functions = [];
const listener = function () {
  DOCUMENT.removeEventListener('DOMContentLoaded', listener);
  loaded = 1;
  functions.map(fn => fn());
};
let loaded = false;
if (IS_DOM) {
  loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
  if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
}
function domready (fn) {
  if (!IS_DOM) return;
  loaded ? setTimeout(fn, 0) : functions.push(fn);
}

function toHtml(abstractNodes) {
  const {
    tag,
    attributes = {},
    children = []
  } = abstractNodes;
  if (typeof abstractNodes === 'string') {
    return htmlEscape(abstractNodes);
  } else {
    return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
  }
}

function iconFromMapping(mapping, prefix, iconName) {
  if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
    return {
      prefix,
      iconName,
      icon: mapping[prefix][iconName]
    };
  }
}

/**
 * Internal helper to bind a function known to have 4 arguments
 * to a given context.
 */
var bindInternal4 = function bindInternal4(func, thisContext) {
  return function (a, b, c, d) {
    return func.call(thisContext, a, b, c, d);
  };
};

/**
 * # Reduce
 *
 * A fast object `.reduce()` implementation.
 *
 * @param  {Object}   subject      The object to reduce over.
 * @param  {Function} fn           The reducer function.
 * @param  {mixed}    initialValue The initial value for the reducer, defaults to subject[0].
 * @param  {Object}   thisContext  The context for the reducer.
 * @return {mixed}                 The final result.
 */
var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
  var keys = Object.keys(subject),
    length = keys.length,
    iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
    i,
    key,
    result;
  if (initialValue === undefined) {
    i = 1;
    result = subject[keys[0]];
  } else {
    i = 0;
    result = initialValue;
  }
  for (; i < length; i++) {
    key = keys[i];
    result = iterator(result, subject[key], key, subject);
  }
  return result;
};

/**
 * ucs2decode() and codePointAt() are both works of Mathias Bynens and licensed under MIT
 *
 * Copyright Mathias Bynens <https://mathiasbynens.be/>

 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:

 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

function ucs2decode(string) {
  const output = [];
  let counter = 0;
  const length = string.length;
  while (counter < length) {
    const value = string.charCodeAt(counter++);
    if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
      const extra = string.charCodeAt(counter++);
      if ((extra & 0xFC00) == 0xDC00) {
        // eslint-disable-line eqeqeq
        output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
      } else {
        output.push(value);
        counter--;
      }
    } else {
      output.push(value);
    }
  }
  return output;
}
function toHex(unicode) {
  const decoded = ucs2decode(unicode);
  return decoded.length === 1 ? decoded[0].toString(16) : null;
}
function codePointAt(string, index) {
  const size = string.length;
  let first = string.charCodeAt(index);
  let second;
  if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
    second = string.charCodeAt(index + 1);
    if (second >= 0xDC00 && second <= 0xDFFF) {
      return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
    }
  }
  return first;
}

function normalizeIcons(icons) {
  return Object.keys(icons).reduce((acc, iconName) => {
    const icon = icons[iconName];
    const expanded = !!icon.icon;
    if (expanded) {
      acc[icon.iconName] = icon.icon;
    } else {
      acc[iconName] = icon;
    }
    return acc;
  }, {});
}
function defineIcons(prefix, icons) {
  let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  const {
    skipHooks = false
  } = params;
  const normalized = normalizeIcons(icons);
  if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
    namespace.hooks.addPack(prefix, normalizeIcons(icons));
  } else {
    namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), normalized);
  }

  /**
   * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
   * of new styles we needed to differentiate between them. Prefix `fa` is now an alias
   * for `fas` so we'll ease the upgrade process for our users by automatically defining
   * this as well.
   */
  if (prefix === 'fas') {
    defineIcons('fa', icons);
  }
}

const duotonePathRe = [/*#__PURE__*/_wrapRegExp(/path d="([^"]+)".*path d="([^"]+)"/, {
  d1: 1,
  d2: 2
}), /*#__PURE__*/_wrapRegExp(/path class="([^"]+)".*d="([^"]+)".*path class="([^"]+)".*d="([^"]+)"/, {
  cls1: 1,
  d1: 2,
  cls2: 3,
  d2: 4
}), /*#__PURE__*/_wrapRegExp(/path class="([^"]+)".*d="([^"]+)"/, {
  cls1: 1,
  d1: 2
})];

const {
  styles,
  shims
} = namespace;
const FAMILY_NAMES = Object.keys(PREFIX_TO_LONG_STYLE);
const PREFIXES_FOR_FAMILY = FAMILY_NAMES.reduce((acc, familyId) => {
  acc[familyId] = Object.keys(PREFIX_TO_LONG_STYLE[familyId]);
  return acc;
}, {});
let _defaultUsablePrefix = null;
let _byUnicode = {};
let _byLigature = {};
let _byOldName = {};
let _byOldUnicode = {};
let _byAlias = {};
function isReserved(name) {
  return ~RESERVED_CLASSES.indexOf(name);
}
function getIconName(cssPrefix, cls) {
  const parts = cls.split('-');
  const prefix = parts[0];
  const iconName = parts.slice(1).join('-');
  if (prefix === cssPrefix && iconName !== '' && !isReserved(iconName)) {
    return iconName;
  } else {
    return null;
  }
}
const build = () => {
  const lookup = reducer => {
    return reduce(styles, (o$$1, style, prefix) => {
      o$$1[prefix] = reduce(style, reducer, {});
      return o$$1;
    }, {});
  };
  _byUnicode = lookup((acc, icon, iconName) => {
    if (icon[3]) {
      acc[icon[3]] = iconName;
    }
    if (icon[2]) {
      const aliases = icon[2].filter(a$$1 => {
        return typeof a$$1 === 'number';
      });
      aliases.forEach(alias => {
        acc[alias.toString(16)] = iconName;
      });
    }
    return acc;
  });
  _byLigature = lookup((acc, icon, iconName) => {
    acc[iconName] = iconName;
    if (icon[2]) {
      const aliases = icon[2].filter(a$$1 => {
        return typeof a$$1 === 'string';
      });
      aliases.forEach(alias => {
        acc[alias] = iconName;
      });
    }
    return acc;
  });
  _byAlias = lookup((acc, icon, iconName) => {
    const aliases = icon[2];
    acc[iconName] = iconName;
    aliases.forEach(alias => {
      acc[alias] = iconName;
    });
    return acc;
  });

  // If we have a Kit, we can't determine if regular is available since we
  // could be auto-fetching it. We'll have to assume that it is available.
  const hasRegular = 'far' in styles || config.autoFetchSvg;
  const shimLookups = reduce(shims, (acc, shim) => {
    const maybeNameMaybeUnicode = shim[0];
    let prefix = shim[1];
    const iconName = shim[2];
    if (prefix === 'far' && !hasRegular) {
      prefix = 'fas';
    }
    if (typeof maybeNameMaybeUnicode === 'string') {
      acc.names[maybeNameMaybeUnicode] = {
        prefix,
        iconName
      };
    }
    if (typeof maybeNameMaybeUnicode === 'number') {
      acc.unicodes[maybeNameMaybeUnicode.toString(16)] = {
        prefix,
        iconName
      };
    }
    return acc;
  }, {
    names: {},
    unicodes: {}
  });
  _byOldName = shimLookups.names;
  _byOldUnicode = shimLookups.unicodes;
  _defaultUsablePrefix = getCanonicalPrefix(config.styleDefault, {
    family: config.familyDefault
  });
};
onChange(c$$1 => {
  _defaultUsablePrefix = getCanonicalPrefix(c$$1.styleDefault, {
    family: config.familyDefault
  });
});
build();
function byUnicode(prefix, unicode) {
  return (_byUnicode[prefix] || {})[unicode];
}
function byLigature(prefix, ligature) {
  return (_byLigature[prefix] || {})[ligature];
}
function byAlias(prefix, alias) {
  return (_byAlias[prefix] || {})[alias];
}
function byOldName(name) {
  return _byOldName[name] || {
    prefix: null,
    iconName: null
  };
}
function byOldUnicode(unicode) {
  const oldUnicode = _byOldUnicode[unicode];
  const newUnicode = byUnicode('fas', unicode);
  return oldUnicode || (newUnicode ? {
    prefix: 'fas',
    iconName: newUnicode
  } : null) || {
    prefix: null,
    iconName: null
  };
}
function getDefaultUsablePrefix() {
  return _defaultUsablePrefix;
}
const emptyCanonicalIcon = () => {
  return {
    prefix: null,
    iconName: null,
    rest: []
  };
};
function getFamilyId(values) {
  let family = s;
  const famProps = FAMILY_NAMES.reduce((acc, familyId) => {
    acc[familyId] = "".concat(config.cssPrefix, "-").concat(familyId);
    return acc;
  }, {});
  L.forEach(familyId => {
    if (values.includes(famProps[familyId]) || values.some(v$$1 => PREFIXES_FOR_FAMILY[familyId].includes(v$$1))) {
      family = familyId;
    }
  });
  return family;
}
function getCanonicalPrefix(styleOrPrefix) {
  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  const {
    family = s
  } = params;
  const style = PREFIX_TO_STYLE[family][styleOrPrefix];

  // handles the exception of passing in only a family of 'duotone' with no style
  if (family === t && !styleOrPrefix) {
    return 'fad';
  }
  const prefix = STYLE_TO_PREFIX[family][styleOrPrefix] || STYLE_TO_PREFIX[family][style];
  const defined = styleOrPrefix in namespace.styles ? styleOrPrefix : null;
  const result = prefix || defined || null;
  return result;
}
function moveNonFaClassesToRest(classNames) {
  let rest = [];
  let iconName = null;
  classNames.forEach(cls => {
    const result = getIconName(config.cssPrefix, cls);
    if (result) {
      iconName = result;
    } else if (cls) {
      rest.push(cls);
    }
  });
  return {
    iconName,
    rest
  };
}
function sortedUniqueValues(arr) {
  return arr.sort().filter((value, index, arr) => {
    return arr.indexOf(value) === index;
  });
}
function getCanonicalIcon(values) {
  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  const {
    skipLookups = false
  } = params;
  let givenPrefix = null;
  const faCombinedClasses = xo.concat(bt$1);
  const faStyleOrFamilyClasses = sortedUniqueValues(values.filter(cls => faCombinedClasses.includes(cls)));
  const nonStyleOrFamilyClasses = sortedUniqueValues(values.filter(cls => !xo.includes(cls)));
  const faStyles = faStyleOrFamilyClasses.filter(cls => {
    givenPrefix = cls;
    return !P.includes(cls);
  });
  const [styleFromValues = null] = faStyles;
  const family = getFamilyId(faStyleOrFamilyClasses);
  const canonical = _objectSpread2(_objectSpread2({}, moveNonFaClassesToRest(nonStyleOrFamilyClasses)), {}, {
    prefix: getCanonicalPrefix(styleFromValues, {
      family
    })
  });
  return _objectSpread2(_objectSpread2(_objectSpread2({}, canonical), getDefaultCanonicalPrefix({
    values,
    family,
    styles,
    config,
    canonical,
    givenPrefix
  })), applyShimAndAlias(skipLookups, givenPrefix, canonical));
}
function applyShimAndAlias(skipLookups, givenPrefix, canonical) {
  let {
    prefix,
    iconName
  } = canonical;
  if (skipLookups || !prefix || !iconName) {
    return {
      prefix,
      iconName
    };
  }
  const shim = givenPrefix === 'fa' ? byOldName(iconName) : {};
  const aliasIconName = byAlias(prefix, iconName);
  iconName = shim.iconName || aliasIconName || iconName;
  prefix = shim.prefix || prefix;
  if (prefix === 'far' && !styles['far'] && styles['fas'] && !config.autoFetchSvg) {
    // Allow a fallback from the regular style to solid if regular is not available
    // but only if we aren't auto-fetching SVGs
    prefix = 'fas';
  }
  return {
    prefix,
    iconName
  };
}
const newCanonicalFamilies = L.filter(familyId => {
  return familyId !== s || familyId !== t;
});
const newCanonicalStyles = Object.keys(co).filter(key => key !== s).map(key => Object.keys(co[key])).flat();
function getDefaultCanonicalPrefix(prefixOptions) {
  const {
    values,
    family,
    canonical,
    givenPrefix = '',
    styles = {},
    config: config$$1 = {}
  } = prefixOptions;
  const isDuotoneFamily = family === t;
  const valuesHasDuotone = values.includes('fa-duotone') || values.includes('fad');
  const defaultFamilyIsDuotone = config$$1.familyDefault === 'duotone';
  const canonicalPrefixIsDuotone = canonical.prefix === 'fad' || canonical.prefix === 'fa-duotone';
  if (!isDuotoneFamily && (valuesHasDuotone || defaultFamilyIsDuotone || canonicalPrefixIsDuotone)) {
    canonical.prefix = 'fad';
  }
  if (values.includes('fa-brands') || values.includes('fab')) {
    canonical.prefix = 'fab';
  }
  if (!canonical.prefix && newCanonicalFamilies.includes(family)) {
    const validPrefix = Object.keys(styles).find(key => newCanonicalStyles.includes(key));
    if (validPrefix || config$$1.autoFetchSvg) {
      const defaultPrefix = pt.get(family).defaultShortPrefixId;
      canonical.prefix = defaultPrefix;
      canonical.iconName = byAlias(canonical.prefix, canonical.iconName) || canonical.iconName;
    }
  }
  if (canonical.prefix === 'fa' || givenPrefix === 'fa') {
    // The fa prefix is not canonical. So if it has made it through until this point
    // we will shift it to the correct prefix.
    canonical.prefix = getDefaultUsablePrefix() || 'fas';
  }
  return canonical;
}

class Library {
  constructor() {
    this.definitions = {};
  }
  add() {
    for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
      definitions[_key] = arguments[_key];
    }
    const additions = definitions.reduce(this._pullDefinitions, {});
    Object.keys(additions).forEach(key => {
      this.definitions[key] = _objectSpread2(_objectSpread2({}, this.definitions[key] || {}), additions[key]);
      defineIcons(key, additions[key]);

      // TODO can we stop doing this? We can't get the icons by 'fa-solid' any longer so this probably needs to change
      const longPrefix = PREFIX_TO_LONG_STYLE[s][key];
      if (longPrefix) defineIcons(longPrefix, additions[key]);
      build();
    });
  }
  reset() {
    this.definitions = {};
  }
  _pullDefinitions(additions, definition) {
    const normalized = definition.prefix && definition.iconName && definition.icon ? {
      0: definition
    } : definition;
    Object.keys(normalized).map(key => {
      const {
        prefix,
        iconName,
        icon
      } = normalized[key];
      const aliases = icon[2];
      if (!additions[prefix]) additions[prefix] = {};
      if (aliases.length > 0) {
        aliases.forEach(alias => {
          if (typeof alias === 'string') {
            additions[prefix][alias] = icon;
          }
        });
      }
      additions[prefix][iconName] = icon;
    });
    return additions;
  }
}

let _plugins = [];
let _hooks = {};
const providers = {};
const defaultProviderKeys = Object.keys(providers);
function registerPlugins(nextPlugins, _ref) {
  let {
    mixoutsTo: obj
  } = _ref;
  _plugins = nextPlugins;
  _hooks = {};
  Object.keys(providers).forEach(k => {
    if (defaultProviderKeys.indexOf(k) === -1) {
      delete providers[k];
    }
  });
  _plugins.forEach(plugin => {
    const mixout = plugin.mixout ? plugin.mixout() : {};
    Object.keys(mixout).forEach(tk => {
      if (typeof mixout[tk] === 'function') {
        obj[tk] = mixout[tk];
      }
      if (typeof mixout[tk] === 'object') {
        Object.keys(mixout[tk]).forEach(sk => {
          if (!obj[tk]) {
            obj[tk] = {};
          }
          obj[tk][sk] = mixout[tk][sk];
        });
      }
    });
    if (plugin.hooks) {
      const hooks = plugin.hooks();
      Object.keys(hooks).forEach(hook => {
        if (!_hooks[hook]) {
          _hooks[hook] = [];
        }
        _hooks[hook].push(hooks[hook]);
      });
    }
    if (plugin.provides) {
      plugin.provides(providers);
    }
  });
  return obj;
}
function chainHooks(hook, accumulator) {
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    args[_key - 2] = arguments[_key];
  }
  const hookFns = _hooks[hook] || [];
  hookFns.forEach(hookFn => {
    accumulator = hookFn.apply(null, [accumulator, ...args]); // eslint-disable-line no-useless-call
  });
  return accumulator;
}
function callHooks(hook) {
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
    args[_key2 - 1] = arguments[_key2];
  }
  const hookFns = _hooks[hook] || [];
  hookFns.forEach(hookFn => {
    hookFn.apply(null, args);
  });
  return undefined;
}
function callProvided() {
  const hook = arguments[0];
  const args = Array.prototype.slice.call(arguments, 1);
  return providers[hook] ? providers[hook].apply(null, args) : undefined;
}

function findIconDefinition(iconLookup) {
  if (iconLookup.prefix === 'fa') {
    iconLookup.prefix = 'fas';
  }
  let {
    iconName
  } = iconLookup;
  const prefix = iconLookup.prefix || getDefaultUsablePrefix();
  if (!iconName) return;
  iconName = byAlias(prefix, iconName) || iconName;
  return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
}
const library = new Library();
const noAuto = () => {
  config.autoReplaceSvg = false;
  config.observeMutations = false;
  callHooks('noAuto');
};
const dom = {
  i2svg: function () {
    let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    if (IS_DOM) {
      callHooks('beforeI2svg', params);
      callProvided('pseudoElements2svg', params);
      return callProvided('i2svg', params);
    } else {
      return Promise.reject(new Error('Operation requires a DOM of some kind.'));
    }
  },
  watch: function () {
    let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    const {
      autoReplaceSvgRoot
    } = params;
    if (config.autoReplaceSvg === false) {
      config.autoReplaceSvg = true;
    }
    config.observeMutations = true;
    domready(() => {
      autoReplace({
        autoReplaceSvgRoot
      });
      callHooks('watch', params);
    });
  }
};
const parse = {
  icon: icon => {
    if (icon === null) {
      return null;
    }
    if (typeof icon === 'object' && icon.prefix && icon.iconName) {
      return {
        prefix: icon.prefix,
        iconName: byAlias(icon.prefix, icon.iconName) || icon.iconName
      };
    }
    if (Array.isArray(icon) && icon.length === 2) {
      const iconName = icon[1].indexOf('fa-') === 0 ? icon[1].slice(3) : icon[1];
      const prefix = getCanonicalPrefix(icon[0]);
      return {
        prefix,
        iconName: byAlias(prefix, iconName) || iconName
      };
    }
    if (typeof icon === 'string' && (icon.indexOf("".concat(config.cssPrefix, "-")) > -1 || icon.match(ICON_SELECTION_SYNTAX_PATTERN))) {
      const canonicalIcon = getCanonicalIcon(icon.split(' '), {
        skipLookups: true
      });
      return {
        prefix: canonicalIcon.prefix || getDefaultUsablePrefix(),
        iconName: byAlias(canonicalIcon.prefix, canonicalIcon.iconName) || canonicalIcon.iconName
      };
    }
    if (typeof icon === 'string') {
      const prefix = getDefaultUsablePrefix();
      return {
        prefix,
        iconName: byAlias(prefix, icon) || icon
      };
    }
  }
};
const api = {
  noAuto,
  config,
  dom,
  parse,
  library,
  findIconDefinition,
  toHtml
};
const autoReplace = function () {
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const {
    autoReplaceSvgRoot = DOCUMENT
  } = params;
  if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({
    node: autoReplaceSvgRoot
  });
};

function domVariants(val, abstractCreator) {
  Object.defineProperty(val, 'abstract', {
    get: abstractCreator
  });
  Object.defineProperty(val, 'html', {
    get: function () {
      return val.abstract.map(a => toHtml(a));
    }
  });
  Object.defineProperty(val, 'node', {
    get: function () {
      if (!IS_DOM) return;
      const container = DOCUMENT.createElement('div');
      container.innerHTML = val.html;
      return container.children;
    }
  });
  return val;
}

function asIcon (_ref) {
  let {
    children,
    main,
    mask,
    attributes,
    styles,
    transform
  } = _ref;
  if (transformIsMeaningful(transform) && main.found && !mask.found) {
    const {
      width,
      height
    } = main;
    const offset = {
      x: width / height / 2,
      y: 0.5
    };
    attributes['style'] = joinStyles(_objectSpread2(_objectSpread2({}, styles), {}, {
      'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
    }));
  }
  return [{
    tag: 'svg',
    attributes,
    children
  }];
}

function asSymbol (_ref) {
  let {
    prefix,
    iconName,
    children,
    attributes,
    symbol
  } = _ref;
  const id = symbol === true ? "".concat(prefix, "-").concat(config.cssPrefix, "-").concat(iconName) : symbol;
  return [{
    tag: 'svg',
    attributes: {
      style: 'display: none;'
    },
    children: [{
      tag: 'symbol',
      attributes: _objectSpread2(_objectSpread2({}, attributes), {}, {
        id
      }),
      children
    }]
  }];
}

function makeInlineSvgAbstract(params) {
  const {
    icons: {
      main,
      mask
    },
    prefix,
    iconName,
    transform,
    symbol,
    title,
    maskId,
    titleId,
    extra,
    watchable = false
  } = params;
  const {
    width,
    height
  } = mask.found ? mask : main;
  const isUploadedIcon = Lt.includes(prefix);
  const attrClass = [config.replacementClass, iconName ? "".concat(config.cssPrefix, "-").concat(iconName) : ''].filter(c$$1 => extra.classes.indexOf(c$$1) === -1).filter(c$$1 => c$$1 !== '' || !!c$$1).concat(extra.classes).join(' ');
  let content = {
    children: [],
    attributes: _objectSpread2(_objectSpread2({}, extra.attributes), {}, {
      'data-prefix': prefix,
      'data-icon': iconName,
      'class': attrClass,
      'role': extra.attributes.role || 'img',
      'xmlns': 'http://www.w3.org/2000/svg',
      'viewBox': "0 0 ".concat(width, " ").concat(height)
    })
  };
  const uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
    width: "".concat(width / height * 16 * 0.0625, "em")
  } : {};
  if (watchable) {
    content.attributes[DATA_FA_I2SVG] = '';
  }
  if (title) {
    content.children.push({
      tag: 'title',
      attributes: {
        id: content.attributes['aria-labelledby'] || "title-".concat(titleId || nextUniqueId())
      },
      children: [title]
    });
    delete content.attributes.title;
  }
  const args = _objectSpread2(_objectSpread2({}, content), {}, {
    prefix,
    iconName,
    main,
    mask,
    maskId,
    transform,
    symbol,
    styles: _objectSpread2(_objectSpread2({}, uploadedIconWidthStyle), extra.styles)
  });
  const {
    children,
    attributes
  } = mask.found && main.found ? callProvided('generateAbstractMask', args) || {
    children: [],
    attributes: {}
  } : callProvided('generateAbstractIcon', args) || {
    children: [],
    attributes: {}
  };
  args.children = children;
  args.attributes = attributes;
  if (symbol) {
    return asSymbol(args);
  } else {
    return asIcon(args);
  }
}
function makeLayersTextAbstract(params) {
  const {
    content,
    width,
    height,
    transform,
    title,
    extra,
    watchable = false
  } = params;
  const attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
    'title': title
  } : {}), {}, {
    'class': extra.classes.join(' ')
  });
  if (watchable) {
    attributes[DATA_FA_I2SVG] = '';
  }
  const styles = _objectSpread2({}, extra.styles);
  if (transformIsMeaningful(transform)) {
    styles['transform'] = transformForCss({
      transform,
      startCentered: true,
      width,
      height
    });
    styles['-webkit-transform'] = styles['transform'];
  }
  const styleString = joinStyles(styles);
  if (styleString.length > 0) {
    attributes['style'] = styleString;
  }
  const val = [];
  val.push({
    tag: 'span',
    attributes,
    children: [content]
  });
  if (title) {
    val.push({
      tag: 'span',
      attributes: {
        class: 'sr-only'
      },
      children: [title]
    });
  }
  return val;
}
function makeLayersCounterAbstract(params) {
  const {
    content,
    title,
    extra
  } = params;
  const attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
    'title': title
  } : {}), {}, {
    'class': extra.classes.join(' ')
  });
  const styleString = joinStyles(extra.styles);
  if (styleString.length > 0) {
    attributes['style'] = styleString;
  }
  const val = [];
  val.push({
    tag: 'span',
    attributes,
    children: [content]
  });
  if (title) {
    val.push({
      tag: 'span',
      attributes: {
        class: 'sr-only'
      },
      children: [title]
    });
  }
  return val;
}

const {
  styles: styles$1
} = namespace;
function asFoundIcon(icon) {
  const width = icon[0];
  const height = icon[1];
  const [vectorData] = icon.slice(4);
  let element = null;
  if (Array.isArray(vectorData)) {
    element = {
      tag: 'g',
      attributes: {
        class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
      },
      children: [{
        tag: 'path',
        attributes: {
          class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
          fill: 'currentColor',
          d: vectorData[0]
        }
      }, {
        tag: 'path',
        attributes: {
          class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
          fill: 'currentColor',
          d: vectorData[1]
        }
      }]
    };
  } else {
    element = {
      tag: 'path',
      attributes: {
        fill: 'currentColor',
        d: vectorData
      }
    };
  }
  return {
    found: true,
    width,
    height,
    icon: element
  };
}
const missingIconResolutionMixin = {
  found: false,
  width: 512,
  height: 512
};
function maybeNotifyMissing(iconName, prefix) {
  if (!PRODUCTION && !config.showMissingIcons && iconName) {
    console.error("Icon with name \"".concat(iconName, "\" and prefix \"").concat(prefix, "\" is missing."));
  }
}
function findIcon(iconName, prefix) {
  let givenPrefix = prefix;
  if (prefix === 'fa' && config.styleDefault !== null) {
    prefix = getDefaultUsablePrefix();
  }
  return new Promise((resolve, reject) => {
    if (givenPrefix === 'fa') {
      const shim = byOldName(iconName) || {};
      iconName = shim.iconName || iconName;
      prefix = shim.prefix || prefix;
    }
    if (iconName && prefix && styles$1[prefix] && styles$1[prefix][iconName]) {
      const icon = styles$1[prefix][iconName];
      return resolve(asFoundIcon(icon));
    }
    maybeNotifyMissing(iconName, prefix);
    resolve(_objectSpread2(_objectSpread2({}, missingIconResolutionMixin), {}, {
      icon: config.showMissingIcons && iconName ? callProvided('missingIconAbstract') || {} : {}
    }));
  });
}

const noop$1 = () => {};
const p$2 = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
  mark: noop$1,
  measure: noop$1
};
const preamble = "FA \"6.7.1\"";
const begin = name => {
  p$2.mark("".concat(preamble, " ").concat(name, " begins"));
  return () => end(name);
};
const end = name => {
  p$2.mark("".concat(preamble, " ").concat(name, " ends"));
  p$2.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));
};
var perf = {
  begin,
  end
};

const noop$2 = () => {};
function isWatched(node) {
  const i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
  return typeof i2svg === 'string';
}
function hasPrefixAndIcon(node) {
  const prefix = node.getAttribute ? node.getAttribute(DATA_PREFIX) : null;
  const icon = node.getAttribute ? node.getAttribute(DATA_ICON) : null;
  return prefix && icon;
}
function hasBeenReplaced(node) {
  return node && node.classList && node.classList.contains && node.classList.contains(config.replacementClass);
}
function getMutator() {
  if (config.autoReplaceSvg === true) {
    return mutators.replace;
  }
  const mutator = mutators[config.autoReplaceSvg];
  return mutator || mutators.replace;
}
function createElementNS(tag) {
  return DOCUMENT.createElementNS('http://www.w3.org/2000/svg', tag);
}
function createElement(tag) {
  return DOCUMENT.createElement(tag);
}
function convertSVG(abstractObj) {
  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  const {
    ceFn = abstractObj.tag === 'svg' ? createElementNS : createElement
  } = params;
  if (typeof abstractObj === 'string') {
    return DOCUMENT.createTextNode(abstractObj);
  }
  const tag = ceFn(abstractObj.tag);
  Object.keys(abstractObj.attributes || []).forEach(function (key) {
    tag.setAttribute(key, abstractObj.attributes[key]);
  });
  const children = abstractObj.children || [];
  children.forEach(function (child) {
    tag.appendChild(convertSVG(child, {
      ceFn
    }));
  });
  return tag;
}
function nodeAsComment(node) {
  let comment = " ".concat(node.outerHTML, " ");
  /* BEGIN.ATTRIBUTION */
  comment = "".concat(comment, "Font Awesome fontawesome.com ");
  /* END.ATTRIBUTION */
  return comment;
}
const mutators = {
  replace: function (mutation) {
    const node = mutation[0];
    if (node.parentNode) {
      mutation[1].forEach(abstract => {
        node.parentNode.insertBefore(convertSVG(abstract), node);
      });
      if (node.getAttribute(DATA_FA_I2SVG) === null && config.keepOriginalSource) {
        let comment = DOCUMENT.createComment(nodeAsComment(node));
        node.parentNode.replaceChild(comment, node);
      } else {
        node.remove();
      }
    }
  },
  nest: function (mutation) {
    const node = mutation[0];
    const abstract = mutation[1];

    // If we already have a replaced node we do not want to continue nesting within it.
    // Short-circuit to the standard replacement
    if (~classArray(node).indexOf(config.replacementClass)) {
      return mutators.replace(mutation);
    }
    const forSvg = new RegExp("".concat(config.cssPrefix, "-.*"));
    delete abstract[0].attributes.id;
    if (abstract[0].attributes.class) {
      const splitClasses = abstract[0].attributes.class.split(' ').reduce((acc, cls) => {
        if (cls === config.replacementClass || cls.match(forSvg)) {
          acc.toSvg.push(cls);
        } else {
          acc.toNode.push(cls);
        }
        return acc;
      }, {
        toNode: [],
        toSvg: []
      });
      abstract[0].attributes.class = splitClasses.toSvg.join(' ');
      if (splitClasses.toNode.length === 0) {
        node.removeAttribute('class');
      } else {
        node.setAttribute('class', splitClasses.toNode.join(' '));
      }
    }
    const newInnerHTML = abstract.map(a => toHtml(a)).join('\n');
    node.setAttribute(DATA_FA_I2SVG, '');
    node.innerHTML = newInnerHTML;
  }
};
function performOperationSync(op) {
  op();
}
function perform(mutations, callback) {
  const callbackFunction = typeof callback === 'function' ? callback : noop$2;
  if (mutations.length === 0) {
    callbackFunction();
  } else {
    let frame = performOperationSync;
    if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {
      frame = WINDOW.requestAnimationFrame || performOperationSync;
    }
    frame(() => {
      const mutator = getMutator();
      const mark = perf.begin('mutate');
      mutations.map(mutator);
      mark();
      callbackFunction();
    });
  }
}
let disabled = false;
function disableObservation() {
  disabled = true;
}
function enableObservation() {
  disabled = false;
}
let mo$1 = null;
function observe(options) {
  if (!MUTATION_OBSERVER) {
    return;
  }
  if (!config.observeMutations) {
    return;
  }
  const {
    treeCallback = noop$2,
    nodeCallback = noop$2,
    pseudoElementsCallback = noop$2,
    observeMutationsRoot = DOCUMENT
  } = options;
  mo$1 = new MUTATION_OBSERVER(objects => {
    if (disabled) return;
    const defaultPrefix = getDefaultUsablePrefix();
    toArray(objects).forEach(mutationRecord => {
      if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {
        if (config.searchPseudoElements) {
          pseudoElementsCallback(mutationRecord.target);
        }
        treeCallback(mutationRecord.target);
      }
      if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
        pseudoElementsCallback(mutationRecord.target.parentNode);
      }
      if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {
        if (mutationRecord.attributeName === 'class' && hasPrefixAndIcon(mutationRecord.target)) {
          const {
            prefix,
            iconName
          } = getCanonicalIcon(classArray(mutationRecord.target));
          mutationRecord.target.setAttribute(DATA_PREFIX, prefix || defaultPrefix);
          if (iconName) mutationRecord.target.setAttribute(DATA_ICON, iconName);
        } else if (hasBeenReplaced(mutationRecord.target)) {
          nodeCallback(mutationRecord.target);
        }
      }
    });
  });
  if (!IS_DOM) return;
  mo$1.observe(observeMutationsRoot, {
    childList: true,
    attributes: true,
    characterData: true,
    subtree: true
  });
}
function disconnect() {
  if (!mo$1) return;
  mo$1.disconnect();
}

function styleParser (node) {
  const style = node.getAttribute('style');
  let val = [];
  if (style) {
    val = style.split(';').reduce((acc, style) => {
      const styles = style.split(':');
      const prop = styles[0];
      const value = styles.slice(1);
      if (prop && value.length > 0) {
        acc[prop] = value.join(':').trim();
      }
      return acc;
    }, {});
  }
  return val;
}

function classParser (node) {
  const existingPrefix = node.getAttribute('data-prefix');
  const existingIconName = node.getAttribute('data-icon');
  const innerText = node.innerText !== undefined ? node.innerText.trim() : '';
  let val = getCanonicalIcon(classArray(node));
  if (!val.prefix) {
    val.prefix = getDefaultUsablePrefix();
  }
  if (existingPrefix && existingIconName) {
    val.prefix = existingPrefix;
    val.iconName = existingIconName;
  }
  if (val.iconName && val.prefix) {
    return val;
  }
  if (val.prefix && innerText.length > 0) {
    val.iconName = byLigature(val.prefix, node.innerText) || byUnicode(val.prefix, toHex(node.innerText));
  }
  if (!val.iconName && config.autoFetchSvg && node.firstChild && node.firstChild.nodeType === Node.TEXT_NODE) {
    val.iconName = node.firstChild.data;
  }
  return val;
}

function attributesParser (node) {
  const extraAttributes = toArray(node.attributes).reduce((acc, attr) => {
    if (acc.name !== 'class' && acc.name !== 'style') {
      acc[attr.name] = attr.value;
    }
    return acc;
  }, {});
  const title = node.getAttribute('title');
  const titleId = node.getAttribute('data-fa-title-id');
  if (config.autoA11y) {
    if (title) {
      extraAttributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
    } else {
      extraAttributes['aria-hidden'] = 'true';
      extraAttributes['focusable'] = 'false';
    }
  }
  return extraAttributes;
}

function blankMeta() {
  return {
    iconName: null,
    title: null,
    titleId: null,
    prefix: null,
    transform: meaninglessTransform,
    symbol: false,
    mask: {
      iconName: null,
      prefix: null,
      rest: []
    },
    maskId: null,
    extra: {
      classes: [],
      styles: {},
      attributes: {}
    }
  };
}
function parseMeta(node) {
  let parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
    styleParser: true
  };
  const {
    iconName,
    prefix,
    rest: extraClasses
  } = classParser(node);
  const extraAttributes = attributesParser(node);
  const pluginMeta = chainHooks('parseNodeAttributes', {}, node);
  let extraStyles = parser.styleParser ? styleParser(node) : [];
  return _objectSpread2({
    iconName,
    title: node.getAttribute('title'),
    titleId: node.getAttribute('data-fa-title-id'),
    prefix,
    transform: meaninglessTransform,
    mask: {
      iconName: null,
      prefix: null,
      rest: []
    },
    maskId: null,
    symbol: false,
    extra: {
      classes: extraClasses,
      styles: extraStyles,
      attributes: extraAttributes
    }
  }, pluginMeta);
}

const {
  styles: styles$2
} = namespace;
function generateMutation(node) {
  const nodeMeta = config.autoReplaceSvg === 'nest' ? parseMeta(node, {
    styleParser: false
  }) : parseMeta(node);
  if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
    return callProvided('generateLayersText', node, nodeMeta);
  } else {
    return callProvided('generateSvgReplacementMutation', node, nodeMeta);
  }
}
function getKnownPrefixes() {
  return [...Ft, ...xo];
}
function onTree(root) {
  let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  if (!IS_DOM) return Promise.resolve();
  const htmlClassList = DOCUMENT.documentElement.classList;
  const hclAdd = suffix => htmlClassList.add("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
  const hclRemove = suffix => htmlClassList.remove("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
  const prefixes = config.autoFetchSvg ? getKnownPrefixes() : P.concat(Object.keys(styles$2));
  if (!prefixes.includes('fa')) {
    prefixes.push('fa');
  }
  const prefixesDomQuery = [".".concat(LAYERS_TEXT_CLASSNAME, ":not([").concat(DATA_FA_I2SVG, "])")].concat(prefixes.map(p$$1 => ".".concat(p$$1, ":not([").concat(DATA_FA_I2SVG, "])"))).join(', ');
  if (prefixesDomQuery.length === 0) {
    return Promise.resolve();
  }
  let candidates = [];
  try {
    candidates = toArray(root.querySelectorAll(prefixesDomQuery));
  } catch (e$$1) {
    // noop
  }
  if (candidates.length > 0) {
    hclAdd('pending');
    hclRemove('complete');
  } else {
    return Promise.resolve();
  }
  const mark = perf.begin('onTree');
  const mutations = candidates.reduce((acc, node) => {
    try {
      const mutation = generateMutation(node);
      if (mutation) {
        acc.push(mutation);
      }
    } catch (e$$1) {
      if (!PRODUCTION) {
        if (e$$1.name === 'MissingIcon') {
          console.error(e$$1);
        }
      }
    }
    return acc;
  }, []);
  return new Promise((resolve, reject) => {
    Promise.all(mutations).then(resolvedMutations => {
      perform(resolvedMutations, () => {
        hclAdd('active');
        hclAdd('complete');
        hclRemove('pending');
        if (typeof callback === 'function') callback();
        mark();
        resolve();
      });
    }).catch(e$$1 => {
      mark();
      reject(e$$1);
    });
  });
}
function onNode(node) {
  let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  generateMutation(node).then(mutation => {
    if (mutation) {
      perform([mutation], callback);
    }
  });
}
function resolveIcons(next) {
  return function (maybeIconDefinition) {
    let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    const iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
    let {
      mask
    } = params;
    if (mask) {
      mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
    }
    return next(iconDefinition, _objectSpread2(_objectSpread2({}, params), {}, {
      mask
    }));
  };
}
const render = function (iconDefinition) {
  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  const {
    transform = meaninglessTransform,
    symbol = false,
    mask = null,
    maskId = null,
    title = null,
    titleId = null,
    classes = [],
    attributes = {},
    styles = {}
  } = params;
  if (!iconDefinition) return;
  const {
    prefix,
    iconName,
    icon
  } = iconDefinition;
  return domVariants(_objectSpread2({
    type: 'icon'
  }, iconDefinition), () => {
    callHooks('beforeDOMElementCreation', {
      iconDefinition,
      params
    });
    if (config.autoA11y) {
      if (title) {
        attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
      } else {
        attributes['aria-hidden'] = 'true';
        attributes['focusable'] = 'false';
      }
    }
    return makeInlineSvgAbstract({
      icons: {
        main: asFoundIcon(icon),
        mask: mask ? asFoundIcon(mask.icon) : {
          found: false,
          width: null,
          height: null,
          icon: {}
        }
      },
      prefix,
      iconName,
      transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
      symbol,
      title,
      maskId,
      titleId,
      extra: {
        attributes,
        styles,
        classes
      }
    });
  });
};
var ReplaceElements = {
  mixout() {
    return {
      icon: resolveIcons(render)
    };
  },
  hooks() {
    return {
      mutationObserverCallbacks(accumulator) {
        accumulator.treeCallback = onTree;
        accumulator.nodeCallback = onNode;
        return accumulator;
      }
    };
  },
  provides(providers$$1) {
    providers$$1.i2svg = function (params) {
      const {
        node = DOCUMENT,
        callback = () => {}
      } = params;
      return onTree(node, callback);
    };
    providers$$1.generateSvgReplacementMutation = function (node, nodeMeta) {
      const {
        iconName,
        title,
        titleId,
        prefix,
        transform,
        symbol,
        mask,
        maskId,
        extra
      } = nodeMeta;
      return new Promise((resolve, reject) => {
        Promise.all([findIcon(iconName, prefix), mask.iconName ? findIcon(mask.iconName, mask.prefix) : Promise.resolve({
          found: false,
          width: 512,
          height: 512,
          icon: {}
        })]).then(_ref => {
          let [main, mask] = _ref;
          resolve([node, makeInlineSvgAbstract({
            icons: {
              main,
              mask
            },
            prefix,
            iconName,
            transform,
            symbol,
            maskId,
            title,
            titleId,
            extra,
            watchable: true
          })]);
        }).catch(reject);
      });
    };
    providers$$1.generateAbstractIcon = function (_ref2) {
      let {
        children,
        attributes,
        main,
        transform,
        styles
      } = _ref2;
      const styleString = joinStyles(styles);
      if (styleString.length > 0) {
        attributes['style'] = styleString;
      }
      let nextChild;
      if (transformIsMeaningful(transform)) {
        nextChild = callProvided('generateAbstractTransformGrouping', {
          main,
          transform,
          containerWidth: main.width,
          iconWidth: main.width
        });
      }
      children.push(nextChild || main.icon);
      return {
        children,
        attributes
      };
    };
  }
};

var Layers = {
  mixout() {
    return {
      layer(assembler) {
        let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
        const {
          classes = []
        } = params;
        return domVariants({
          type: 'layer'
        }, () => {
          callHooks('beforeDOMElementCreation', {
            assembler,
            params
          });
          let children = [];
          assembler(args => {
            Array.isArray(args) ? args.map(a => {
              children = children.concat(a.abstract);
            }) : children = children.concat(args.abstract);
          });
          return [{
            tag: 'span',
            attributes: {
              class: ["".concat(config.cssPrefix, "-layers"), ...classes].join(' ')
            },
            children
          }];
        });
      }
    };
  }
};

var LayersCounter = {
  mixout() {
    return {
      counter(content) {
        let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
        const {
          title = null,
          classes = [],
          attributes = {},
          styles = {}
        } = params;
        return domVariants({
          type: 'counter',
          content
        }, () => {
          callHooks('beforeDOMElementCreation', {
            content,
            params
          });
          return makeLayersCounterAbstract({
            content: content.toString(),
            title,
            extra: {
              attributes,
              styles,
              classes: ["".concat(config.cssPrefix, "-layers-counter"), ...classes]
            }
          });
        });
      }
    };
  }
};

var LayersText = {
  mixout() {
    return {
      text(content) {
        let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
        const {
          transform = meaninglessTransform,
          title = null,
          classes = [],
          attributes = {},
          styles = {}
        } = params;
        return domVariants({
          type: 'text',
          content
        }, () => {
          callHooks('beforeDOMElementCreation', {
            content,
            params
          });
          return makeLayersTextAbstract({
            content,
            transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
            title,
            extra: {
              attributes,
              styles,
              classes: ["".concat(config.cssPrefix, "-layers-text"), ...classes]
            }
          });
        });
      }
    };
  },
  provides(providers$$1) {
    providers$$1.generateLayersText = function (node, nodeMeta) {
      const {
        title,
        transform,
        extra
      } = nodeMeta;
      let width = null;
      let height = null;
      if (IS_IE) {
        const computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
        const boundingClientRect = node.getBoundingClientRect();
        width = boundingClientRect.width / computedFontSize;
        height = boundingClientRect.height / computedFontSize;
      }
      if (config.autoA11y && !title) {
        extra.attributes['aria-hidden'] = 'true';
      }
      return Promise.resolve([node, makeLayersTextAbstract({
        content: node.innerHTML,
        width,
        height,
        transform,
        title,
        extra,
        watchable: true
      })]);
    };
  }
};

const CLEAN_CONTENT_PATTERN = new RegExp('\u{22}', 'ug');
const SECONDARY_UNICODE_RANGE = [1105920, 1112319];
const _FONT_FAMILY_WEIGHT_TO_PREFIX = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
  FontAwesome: {
    normal: 'fas',
    400: 'fas'
  }
}), lt), ko), Yt);
const FONT_FAMILY_WEIGHT_TO_PREFIX = Object.keys(_FONT_FAMILY_WEIGHT_TO_PREFIX).reduce((acc, key) => {
  acc[key.toLowerCase()] = _FONT_FAMILY_WEIGHT_TO_PREFIX[key];
  return acc;
}, {});
const FONT_FAMILY_WEIGHT_FALLBACK = Object.keys(FONT_FAMILY_WEIGHT_TO_PREFIX).reduce((acc, fontFamily) => {
  const weights = FONT_FAMILY_WEIGHT_TO_PREFIX[fontFamily];
  acc[fontFamily] = weights[900] || [...Object.entries(weights)][0][1];
  return acc;
}, {});
function hexValueFromContent(content) {
  const cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
  const codePoint = codePointAt(cleaned, 0);
  const isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
  const isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
  return {
    value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
    isSecondary: isPrependTen || isDoubled
  };
}
function getPrefix(fontFamily, fontWeight) {
  const fontFamilySanitized = fontFamily.replace(/^['"]|['"]$/g, '').toLowerCase();
  const fontWeightInteger = parseInt(fontWeight);
  const fontWeightSanitized = isNaN(fontWeightInteger) ? 'normal' : fontWeightInteger;
  return (FONT_FAMILY_WEIGHT_TO_PREFIX[fontFamilySanitized] || {})[fontWeightSanitized] || FONT_FAMILY_WEIGHT_FALLBACK[fontFamilySanitized];
}
function replaceForPosition(node, position) {
  const pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
  return new Promise((resolve, reject) => {
    if (node.getAttribute(pendingAttribute) !== null) {
      // This node is already being processed
      return resolve();
    }
    const children = toArray(node.children);
    const alreadyProcessedPseudoElement = children.filter(c$$1 => c$$1.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position)[0];
    const styles = WINDOW.getComputedStyle(node, position);
    const fontFamily = styles.getPropertyValue('font-family');
    const fontFamilyMatch = fontFamily.match(FONT_FAMILY_PATTERN);
    const fontWeight = styles.getPropertyValue('font-weight');
    const content = styles.getPropertyValue('content');
    if (alreadyProcessedPseudoElement && !fontFamilyMatch) {
      // If we've already processed it but the current computed style does not result in a font-family,
      // that probably means that a class name that was previously present to make the icon has been
      // removed. So we now should delete the icon.
      node.removeChild(alreadyProcessedPseudoElement);
      return resolve();
    } else if (fontFamilyMatch && content !== 'none' && content !== '') {
      const content = styles.getPropertyValue('content');
      let prefix = getPrefix(fontFamily, fontWeight);
      const {
        value: hexValue,
        isSecondary
      } = hexValueFromContent(content);
      const isV4 = fontFamilyMatch[0].startsWith('FontAwesome');
      let iconName = byUnicode(prefix, hexValue);
      let iconIdentifier = iconName;
      if (isV4) {
        const iconName4 = byOldUnicode(hexValue);
        if (iconName4.iconName && iconName4.prefix) {
          iconName = iconName4.iconName;
          prefix = iconName4.prefix;
        }
      }

      // Only convert the pseudo element in this ::before/::after position into an icon if we haven't
      // already done so with the same prefix and iconName
      if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
        node.setAttribute(pendingAttribute, iconIdentifier);
        if (alreadyProcessedPseudoElement) {
          // Delete the old one, since we're replacing it with a new one
          node.removeChild(alreadyProcessedPseudoElement);
        }
        const meta = blankMeta();
        const {
          extra
        } = meta;
        extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
        findIcon(iconName, prefix).then(main => {
          const abstract = makeInlineSvgAbstract(_objectSpread2(_objectSpread2({}, meta), {}, {
            icons: {
              main,
              mask: emptyCanonicalIcon()
            },
            prefix,
            iconName: iconIdentifier,
            extra,
            watchable: true
          }));
          const element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');
          if (position === '::before') {
            node.insertBefore(element, node.firstChild);
          } else {
            node.appendChild(element);
          }
          element.outerHTML = abstract.map(a$$1 => toHtml(a$$1)).join('\n');
          node.removeAttribute(pendingAttribute);
          resolve();
        }).catch(reject);
      } else {
        resolve();
      }
    } else {
      resolve();
    }
  });
}
function replace(node) {
  return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
}
function processable(node) {
  return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');
}
function searchPseudoElements(root) {
  if (!IS_DOM) return;
  return new Promise((resolve, reject) => {
    const operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
    const end = perf.begin('searchPseudoElements');
    disableObservation();
    Promise.all(operations).then(() => {
      end();
      enableObservation();
      resolve();
    }).catch(() => {
      end();
      enableObservation();
      reject();
    });
  });
}
var PseudoElements = {
  hooks() {
    return {
      mutationObserverCallbacks(accumulator) {
        accumulator.pseudoElementsCallback = searchPseudoElements;
        return accumulator;
      }
    };
  },
  provides(providers) {
    providers.pseudoElements2svg = function (params) {
      const {
        node = DOCUMENT
      } = params;
      if (config.searchPseudoElements) {
        searchPseudoElements(node);
      }
    };
  }
};

let _unwatched = false;
var MutationObserver$1 = {
  mixout() {
    return {
      dom: {
        unwatch() {
          disableObservation();
          _unwatched = true;
        }
      }
    };
  },
  hooks() {
    return {
      bootstrap() {
        observe(chainHooks('mutationObserverCallbacks', {}));
      },
      noAuto() {
        disconnect();
      },
      watch(params) {
        const {
          observeMutationsRoot
        } = params;
        if (_unwatched) {
          enableObservation();
        } else {
          observe(chainHooks('mutationObserverCallbacks', {
            observeMutationsRoot
          }));
        }
      }
    };
  }
};

const parseTransformString = transformString => {
  let transform = {
    size: 16,
    x: 0,
    y: 0,
    flipX: false,
    flipY: false,
    rotate: 0
  };
  return transformString.toLowerCase().split(' ').reduce((acc, n) => {
    const parts = n.toLowerCase().split('-');
    const first = parts[0];
    let rest = parts.slice(1).join('-');
    if (first && rest === 'h') {
      acc.flipX = true;
      return acc;
    }
    if (first && rest === 'v') {
      acc.flipY = true;
      return acc;
    }
    rest = parseFloat(rest);
    if (isNaN(rest)) {
      return acc;
    }
    switch (first) {
      case 'grow':
        acc.size = acc.size + rest;
        break;
      case 'shrink':
        acc.size = acc.size - rest;
        break;
      case 'left':
        acc.x = acc.x - rest;
        break;
      case 'right':
        acc.x = acc.x + rest;
        break;
      case 'up':
        acc.y = acc.y - rest;
        break;
      case 'down':
        acc.y = acc.y + rest;
        break;
      case 'rotate':
        acc.rotate = acc.rotate + rest;
        break;
    }
    return acc;
  }, transform);
};
var PowerTransforms = {
  mixout() {
    return {
      parse: {
        transform: transformString => {
          return parseTransformString(transformString);
        }
      }
    };
  },
  hooks() {
    return {
      parseNodeAttributes(accumulator, node) {
        const transformString = node.getAttribute('data-fa-transform');
        if (transformString) {
          accumulator.transform = parseTransformString(transformString);
        }
        return accumulator;
      }
    };
  },
  provides(providers) {
    providers.generateAbstractTransformGrouping = function (_ref) {
      let {
        main,
        transform,
        containerWidth,
        iconWidth
      } = _ref;
      const outer = {
        transform: "translate(".concat(containerWidth / 2, " 256)")
      };
      const innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
      const innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
      const innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
      const inner = {
        transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
      };
      const path = {
        transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
      };
      const operations = {
        outer,
        inner,
        path
      };
      return {
        tag: 'g',
        attributes: _objectSpread2({}, operations.outer),
        children: [{
          tag: 'g',
          attributes: _objectSpread2({}, operations.inner),
          children: [{
            tag: main.icon.tag,
            children: main.icon.children,
            attributes: _objectSpread2(_objectSpread2({}, main.icon.attributes), operations.path)
          }]
        }]
      };
    };
  }
};

const ALL_SPACE = {
  x: 0,
  y: 0,
  width: '100%',
  height: '100%'
};
function fillBlack(abstract) {
  let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  if (abstract.attributes && (abstract.attributes.fill || force)) {
    abstract.attributes.fill = 'black';
  }
  return abstract;
}
function deGroup(abstract) {
  if (abstract.tag === 'g') {
    return abstract.children;
  } else {
    return [abstract];
  }
}
var Masks = {
  hooks() {
    return {
      parseNodeAttributes(accumulator, node) {
        const maskData = node.getAttribute('data-fa-mask');
        const mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(i => i.trim()));
        if (!mask.prefix) {
          mask.prefix = getDefaultUsablePrefix();
        }
        accumulator.mask = mask;
        accumulator.maskId = node.getAttribute('data-fa-mask-id');
        return accumulator;
      }
    };
  },
  provides(providers) {
    providers.generateAbstractMask = function (_ref) {
      let {
        children,
        attributes,
        main,
        mask,
        maskId: explicitMaskId,
        transform
      } = _ref;
      const {
        width: mainWidth,
        icon: mainPath
      } = main;
      const {
        width: maskWidth,
        icon: maskPath
      } = mask;
      const trans = transformForSvg({
        transform,
        containerWidth: maskWidth,
        iconWidth: mainWidth
      });
      const maskRect = {
        tag: 'rect',
        attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
          fill: 'white'
        })
      };
      const maskInnerGroupChildrenMixin = mainPath.children ? {
        children: mainPath.children.map(fillBlack)
      } : {};
      const maskInnerGroup = {
        tag: 'g',
        attributes: _objectSpread2({}, trans.inner),
        children: [fillBlack(_objectSpread2({
          tag: mainPath.tag,
          attributes: _objectSpread2(_objectSpread2({}, mainPath.attributes), trans.path)
        }, maskInnerGroupChildrenMixin))]
      };
      const maskOuterGroup = {
        tag: 'g',
        attributes: _objectSpread2({}, trans.outer),
        children: [maskInnerGroup]
      };
      const maskId = "mask-".concat(explicitMaskId || nextUniqueId());
      const clipId = "clip-".concat(explicitMaskId || nextUniqueId());
      const maskTag = {
        tag: 'mask',
        attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
          id: maskId,
          maskUnits: 'userSpaceOnUse',
          maskContentUnits: 'userSpaceOnUse'
        }),
        children: [maskRect, maskOuterGroup]
      };
      const defs = {
        tag: 'defs',
        children: [{
          tag: 'clipPath',
          attributes: {
            id: clipId
          },
          children: deGroup(maskPath)
        }, maskTag]
      };
      children.push(defs, {
        tag: 'rect',
        attributes: _objectSpread2({
          fill: 'currentColor',
          'clip-path': "url(#".concat(clipId, ")"),
          mask: "url(#".concat(maskId, ")")
        }, ALL_SPACE)
      });
      return {
        children,
        attributes
      };
    };
  }
};

var MissingIconIndicator = {
  provides(providers) {
    let reduceMotion = false;
    if (WINDOW.matchMedia) {
      reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
    }
    providers.missingIconAbstract = function () {
      const gChildren = [];
      const FILL = {
        fill: 'currentColor'
      };
      const ANIMATION_BASE = {
        attributeType: 'XML',
        repeatCount: 'indefinite',
        dur: '2s'
      };

      // Ring
      gChildren.push({
        tag: 'path',
        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
          d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'
        })
      });
      const OPACITY_ANIMATE = _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
        attributeName: 'opacity'
      });
      const dot = {
        tag: 'circle',
        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
          cx: '256',
          cy: '364',
          r: '28'
        }),
        children: []
      };
      if (!reduceMotion) {
        dot.children.push({
          tag: 'animate',
          attributes: _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
            attributeName: 'r',
            values: '28;14;28;28;14;28;'
          })
        }, {
          tag: 'animate',
          attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
            values: '1;0;1;1;0;1;'
          })
        });
      }
      gChildren.push(dot);
      gChildren.push({
        tag: 'path',
        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
          opacity: '1',
          d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'
        }),
        children: reduceMotion ? [] : [{
          tag: 'animate',
          attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
            values: '1;0;0;0;0;1;'
          })
        }]
      });
      if (!reduceMotion) {
        // Exclamation
        gChildren.push({
          tag: 'path',
          attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
            opacity: '0',
            d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'
          }),
          children: [{
            tag: 'animate',
            attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
              values: '0;0;1;1;0;0;'
            })
          }]
        });
      }
      return {
        tag: 'g',
        attributes: {
          'class': 'missing'
        },
        children: gChildren
      };
    };
  }
};

var SvgSymbols = {
  hooks() {
    return {
      parseNodeAttributes(accumulator, node) {
        const symbolData = node.getAttribute('data-fa-symbol');
        const symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
        accumulator['symbol'] = symbol;
        return accumulator;
      }
    };
  }
};

var plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];

registerPlugins(plugins, {
  mixoutsTo: api
});
const noAuto$1 = api.noAuto;
const config$1 = api.config;
const library$1 = api.library;
const dom$1 = api.dom;
const parse$1 = api.parse;
const findIconDefinition$1 = api.findIconDefinition;
const toHtml$1 = api.toHtml;
const icon = api.icon;
const layer = api.layer;
const text = api.text;
const counter = api.counter;




/***/ }),

/***/ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs":
/*!****************************************************************************!*\
  !*** ../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs ***!
  \****************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_2361980__) => {

"use strict";
__nested_webpack_require_2361980__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2361980__.d(__nested_webpack_exports__, {
/* harmony export */   fa0: () => (/* binding */ fa0),
/* harmony export */   fa1: () => (/* binding */ fa1),
/* harmony export */   fa2: () => (/* binding */ fa2),
/* harmony export */   fa3: () => (/* binding */ fa3),
/* harmony export */   fa4: () => (/* binding */ fa4),
/* harmony export */   fa5: () => (/* binding */ fa5),
/* harmony export */   fa6: () => (/* binding */ fa6),
/* harmony export */   fa7: () => (/* binding */ fa7),
/* harmony export */   fa8: () => (/* binding */ fa8),
/* harmony export */   fa9: () => (/* binding */ fa9),
/* harmony export */   faA: () => (/* binding */ faA),
/* harmony export */   faAd: () => (/* binding */ faAd),
/* harmony export */   faAdd: () => (/* binding */ faAdd),
/* harmony export */   faAddressBook: () => (/* binding */ faAddressBook),
/* harmony export */   faAddressCard: () => (/* binding */ faAddressCard),
/* harmony export */   faAdjust: () => (/* binding */ faAdjust),
/* harmony export */   faAirFreshener: () => (/* binding */ faAirFreshener),
/* harmony export */   faAlignCenter: () => (/* binding */ faAlignCenter),
/* harmony export */   faAlignJustify: () => (/* binding */ faAlignJustify),
/* harmony export */   faAlignLeft: () => (/* binding */ faAlignLeft),
/* harmony export */   faAlignRight: () => (/* binding */ faAlignRight),
/* harmony export */   faAllergies: () => (/* binding */ faAllergies),
/* harmony export */   faAmbulance: () => (/* binding */ faAmbulance),
/* harmony export */   faAmericanSignLanguageInterpreting: () => (/* binding */ faAmericanSignLanguageInterpreting),
/* harmony export */   faAnchor: () => (/* binding */ faAnchor),
/* harmony export */   faAnchorCircleCheck: () => (/* binding */ faAnchorCircleCheck),
/* harmony export */   faAnchorCircleExclamation: () => (/* binding */ faAnchorCircleExclamation),
/* harmony export */   faAnchorCircleXmark: () => (/* binding */ faAnchorCircleXmark),
/* harmony export */   faAnchorLock: () => (/* binding */ faAnchorLock),
/* harmony export */   faAngleDoubleDown: () => (/* binding */ faAngleDoubleDown),
/* harmony export */   faAngleDoubleLeft: () => (/* binding */ faAngleDoubleLeft),
/* harmony export */   faAngleDoubleRight: () => (/* binding */ faAngleDoubleRight),
/* harmony export */   faAngleDoubleUp: () => (/* binding */ faAngleDoubleUp),
/* harmony export */   faAngleDown: () => (/* binding */ faAngleDown),
/* harmony export */   faAngleLeft: () => (/* binding */ faAngleLeft),
/* harmony export */   faAngleRight: () => (/* binding */ faAngleRight),
/* harmony export */   faAngleUp: () => (/* binding */ faAngleUp),
/* harmony export */   faAnglesDown: () => (/* binding */ faAnglesDown),
/* harmony export */   faAnglesLeft: () => (/* binding */ faAnglesLeft),
/* harmony export */   faAnglesRight: () => (/* binding */ faAnglesRight),
/* harmony export */   faAnglesUp: () => (/* binding */ faAnglesUp),
/* harmony export */   faAngry: () => (/* binding */ faAngry),
/* harmony export */   faAnkh: () => (/* binding */ faAnkh),
/* harmony export */   faAppleAlt: () => (/* binding */ faAppleAlt),
/* harmony export */   faAppleWhole: () => (/* binding */ faAppleWhole),
/* harmony export */   faArchive: () => (/* binding */ faArchive),
/* harmony export */   faArchway: () => (/* binding */ faArchway),
/* harmony export */   faAreaChart: () => (/* binding */ faAreaChart),
/* harmony export */   faArrowAltCircleDown: () => (/* binding */ faArrowAltCircleDown),
/* harmony export */   faArrowAltCircleLeft: () => (/* binding */ faArrowAltCircleLeft),
/* harmony export */   faArrowAltCircleRight: () => (/* binding */ faArrowAltCircleRight),
/* harmony export */   faArrowAltCircleUp: () => (/* binding */ faArrowAltCircleUp),
/* harmony export */   faArrowCircleDown: () => (/* binding */ faArrowCircleDown),
/* harmony export */   faArrowCircleLeft: () => (/* binding */ faArrowCircleLeft),
/* harmony export */   faArrowCircleRight: () => (/* binding */ faArrowCircleRight),
/* harmony export */   faArrowCircleUp: () => (/* binding */ faArrowCircleUp),
/* harmony export */   faArrowDown: () => (/* binding */ faArrowDown),
/* harmony export */   faArrowDown19: () => (/* binding */ faArrowDown19),
/* harmony export */   faArrowDown91: () => (/* binding */ faArrowDown91),
/* harmony export */   faArrowDownAZ: () => (/* binding */ faArrowDownAZ),
/* harmony export */   faArrowDownLong: () => (/* binding */ faArrowDownLong),
/* harmony export */   faArrowDownShortWide: () => (/* binding */ faArrowDownShortWide),
/* harmony export */   faArrowDownUpAcrossLine: () => (/* binding */ faArrowDownUpAcrossLine),
/* harmony export */   faArrowDownUpLock: () => (/* binding */ faArrowDownUpLock),
/* harmony export */   faArrowDownWideShort: () => (/* binding */ faArrowDownWideShort),
/* harmony export */   faArrowDownZA: () => (/* binding */ faArrowDownZA),
/* harmony export */   faArrowLeft: () => (/* binding */ faArrowLeft),
/* harmony export */   faArrowLeftLong: () => (/* binding */ faArrowLeftLong),
/* harmony export */   faArrowLeftRotate: () => (/* binding */ faArrowLeftRotate),
/* harmony export */   faArrowPointer: () => (/* binding */ faArrowPointer),
/* harmony export */   faArrowRight: () => (/* binding */ faArrowRight),
/* harmony export */   faArrowRightArrowLeft: () => (/* binding */ faArrowRightArrowLeft),
/* harmony export */   faArrowRightFromBracket: () => (/* binding */ faArrowRightFromBracket),
/* harmony export */   faArrowRightFromFile: () => (/* binding */ faArrowRightFromFile),
/* harmony export */   faArrowRightLong: () => (/* binding */ faArrowRightLong),
/* harmony export */   faArrowRightRotate: () => (/* binding */ faArrowRightRotate),
/* harmony export */   faArrowRightToBracket: () => (/* binding */ faArrowRightToBracket),
/* harmony export */   faArrowRightToCity: () => (/* binding */ faArrowRightToCity),
/* harmony export */   faArrowRightToFile: () => (/* binding */ faArrowRightToFile),
/* harmony export */   faArrowRotateBack: () => (/* binding */ faArrowRotateBack),
/* harmony export */   faArrowRotateBackward: () => (/* binding */ faArrowRotateBackward),
/* harmony export */   faArrowRotateForward: () => (/* binding */ faArrowRotateForward),
/* harmony export */   faArrowRotateLeft: () => (/* binding */ faArrowRotateLeft),
/* harmony export */   faArrowRotateRight: () => (/* binding */ faArrowRotateRight),
/* harmony export */   faArrowTrendDown: () => (/* binding */ faArrowTrendDown),
/* harmony export */   faArrowTrendUp: () => (/* binding */ faArrowTrendUp),
/* harmony export */   faArrowTurnDown: () => (/* binding */ faArrowTurnDown),
/* harmony export */   faArrowTurnUp: () => (/* binding */ faArrowTurnUp),
/* harmony export */   faArrowUp: () => (/* binding */ faArrowUp),
/* harmony export */   faArrowUp19: () => (/* binding */ faArrowUp19),
/* harmony export */   faArrowUp91: () => (/* binding */ faArrowUp91),
/* harmony export */   faArrowUpAZ: () => (/* binding */ faArrowUpAZ),
/* harmony export */   faArrowUpFromBracket: () => (/* binding */ faArrowUpFromBracket),
/* harmony export */   faArrowUpFromGroundWater: () => (/* binding */ faArrowUpFromGroundWater),
/* harmony export */   faArrowUpFromWaterPump: () => (/* binding */ faArrowUpFromWaterPump),
/* harmony export */   faArrowUpLong: () => (/* binding */ faArrowUpLong),
/* harmony export */   faArrowUpRightDots: () => (/* binding */ faArrowUpRightDots),
/* harmony export */   faArrowUpRightFromSquare: () => (/* binding */ faArrowUpRightFromSquare),
/* harmony export */   faArrowUpShortWide: () => (/* binding */ faArrowUpShortWide),
/* harmony export */   faArrowUpWideShort: () => (/* binding */ faArrowUpWideShort),
/* harmony export */   faArrowUpZA: () => (/* binding */ faArrowUpZA),
/* harmony export */   faArrows: () => (/* binding */ faArrows),
/* harmony export */   faArrowsAlt: () => (/* binding */ faArrowsAlt),
/* harmony export */   faArrowsAltH: () => (/* binding */ faArrowsAltH),
/* harmony export */   faArrowsAltV: () => (/* binding */ faArrowsAltV),
/* harmony export */   faArrowsDownToLine: () => (/* binding */ faArrowsDownToLine),
/* harmony export */   faArrowsDownToPeople: () => (/* binding */ faArrowsDownToPeople),
/* harmony export */   faArrowsH: () => (/* binding */ faArrowsH),
/* harmony export */   faArrowsLeftRight: () => (/* binding */ faArrowsLeftRight),
/* harmony export */   faArrowsLeftRightToLine: () => (/* binding */ faArrowsLeftRightToLine),
/* harmony export */   faArrowsRotate: () => (/* binding */ faArrowsRotate),
/* harmony export */   faArrowsSpin: () => (/* binding */ faArrowsSpin),
/* harmony export */   faArrowsSplitUpAndLeft: () => (/* binding */ faArrowsSplitUpAndLeft),
/* harmony export */   faArrowsToCircle: () => (/* binding */ faArrowsToCircle),
/* harmony export */   faArrowsToDot: () => (/* binding */ faArrowsToDot),
/* harmony export */   faArrowsToEye: () => (/* binding */ faArrowsToEye),
/* harmony export */   faArrowsTurnRight: () => (/* binding */ faArrowsTurnRight),
/* harmony export */   faArrowsTurnToDots: () => (/* binding */ faArrowsTurnToDots),
/* harmony export */   faArrowsUpDown: () => (/* binding */ faArrowsUpDown),
/* harmony export */   faArrowsUpDownLeftRight: () => (/* binding */ faArrowsUpDownLeftRight),
/* harmony export */   faArrowsUpToLine: () => (/* binding */ faArrowsUpToLine),
/* harmony export */   faArrowsV: () => (/* binding */ faArrowsV),
/* harmony export */   faAslInterpreting: () => (/* binding */ faAslInterpreting),
/* harmony export */   faAssistiveListeningSystems: () => (/* binding */ faAssistiveListeningSystems),
/* harmony export */   faAsterisk: () => (/* binding */ faAsterisk),
/* harmony export */   faAt: () => (/* binding */ faAt),
/* harmony export */   faAtlas: () => (/* binding */ faAtlas),
/* harmony export */   faAtom: () => (/* binding */ faAtom),
/* harmony export */   faAudioDescription: () => (/* binding */ faAudioDescription),
/* harmony export */   faAustralSign: () => (/* binding */ faAustralSign),
/* harmony export */   faAutomobile: () => (/* binding */ faAutomobile),
/* harmony export */   faAward: () => (/* binding */ faAward),
/* harmony export */   faB: () => (/* binding */ faB),
/* harmony export */   faBaby: () => (/* binding */ faBaby),
/* harmony export */   faBabyCarriage: () => (/* binding */ faBabyCarriage),
/* harmony export */   faBackspace: () => (/* binding */ faBackspace),
/* harmony export */   faBackward: () => (/* binding */ faBackward),
/* harmony export */   faBackwardFast: () => (/* binding */ faBackwardFast),
/* harmony export */   faBackwardStep: () => (/* binding */ faBackwardStep),
/* harmony export */   faBacon: () => (/* binding */ faBacon),
/* harmony export */   faBacteria: () => (/* binding */ faBacteria),
/* harmony export */   faBacterium: () => (/* binding */ faBacterium),
/* harmony export */   faBagShopping: () => (/* binding */ faBagShopping),
/* harmony export */   faBahai: () => (/* binding */ faBahai),
/* harmony export */   faBahtSign: () => (/* binding */ faBahtSign),
/* harmony export */   faBalanceScale: () => (/* binding */ faBalanceScale),
/* harmony export */   faBalanceScaleLeft: () => (/* binding */ faBalanceScaleLeft),
/* harmony export */   faBalanceScaleRight: () => (/* binding */ faBalanceScaleRight),
/* harmony export */   faBan: () => (/* binding */ faBan),
/* harmony export */   faBanSmoking: () => (/* binding */ faBanSmoking),
/* harmony export */   faBandAid: () => (/* binding */ faBandAid),
/* harmony export */   faBandage: () => (/* binding */ faBandage),
/* harmony export */   faBangladeshiTakaSign: () => (/* binding */ faBangladeshiTakaSign),
/* harmony export */   faBank: () => (/* binding */ faBank),
/* harmony export */   faBarChart: () => (/* binding */ faBarChart),
/* harmony export */   faBarcode: () => (/* binding */ faBarcode),
/* harmony export */   faBars: () => (/* binding */ faBars),
/* harmony export */   faBarsProgress: () => (/* binding */ faBarsProgress),
/* harmony export */   faBarsStaggered: () => (/* binding */ faBarsStaggered),
/* harmony export */   faBaseball: () => (/* binding */ faBaseball),
/* harmony export */   faBaseballBall: () => (/* binding */ faBaseballBall),
/* harmony export */   faBaseballBatBall: () => (/* binding */ faBaseballBatBall),
/* harmony export */   faBasketShopping: () => (/* binding */ faBasketShopping),
/* harmony export */   faBasketball: () => (/* binding */ faBasketball),
/* harmony export */   faBasketballBall: () => (/* binding */ faBasketballBall),
/* harmony export */   faBath: () => (/* binding */ faBath),
/* harmony export */   faBathtub: () => (/* binding */ faBathtub),
/* harmony export */   faBattery: () => (/* binding */ faBattery),
/* harmony export */   faBattery0: () => (/* binding */ faBattery0),
/* harmony export */   faBattery2: () => (/* binding */ faBattery2),
/* harmony export */   faBattery3: () => (/* binding */ faBattery3),
/* harmony export */   faBattery4: () => (/* binding */ faBattery4),
/* harmony export */   faBattery5: () => (/* binding */ faBattery5),
/* harmony export */   faBatteryCar: () => (/* binding */ faBatteryCar),
/* harmony export */   faBatteryEmpty: () => (/* binding */ faBatteryEmpty),
/* harmony export */   faBatteryFull: () => (/* binding */ faBatteryFull),
/* harmony export */   faBatteryHalf: () => (/* binding */ faBatteryHalf),
/* harmony export */   faBatteryQuarter: () => (/* binding */ faBatteryQuarter),
/* harmony export */   faBatteryThreeQuarters: () => (/* binding */ faBatteryThreeQuarters),
/* harmony export */   faBed: () => (/* binding */ faBed),
/* harmony export */   faBedPulse: () => (/* binding */ faBedPulse),
/* harmony export */   faBeer: () => (/* binding */ faBeer),
/* harmony export */   faBeerMugEmpty: () => (/* binding */ faBeerMugEmpty),
/* harmony export */   faBell: () => (/* binding */ faBell),
/* harmony export */   faBellConcierge: () => (/* binding */ faBellConcierge),
/* harmony export */   faBellSlash: () => (/* binding */ faBellSlash),
/* harmony export */   faBezierCurve: () => (/* binding */ faBezierCurve),
/* harmony export */   faBible: () => (/* binding */ faBible),
/* harmony export */   faBicycle: () => (/* binding */ faBicycle),
/* harmony export */   faBiking: () => (/* binding */ faBiking),
/* harmony export */   faBinoculars: () => (/* binding */ faBinoculars),
/* harmony export */   faBiohazard: () => (/* binding */ faBiohazard),
/* harmony export */   faBirthdayCake: () => (/* binding */ faBirthdayCake),
/* harmony export */   faBitcoinSign: () => (/* binding */ faBitcoinSign),
/* harmony export */   faBlackboard: () => (/* binding */ faBlackboard),
/* harmony export */   faBlender: () => (/* binding */ faBlender),
/* harmony export */   faBlenderPhone: () => (/* binding */ faBlenderPhone),
/* harmony export */   faBlind: () => (/* binding */ faBlind),
/* harmony export */   faBlog: () => (/* binding */ faBlog),
/* harmony export */   faBold: () => (/* binding */ faBold),
/* harmony export */   faBolt: () => (/* binding */ faBolt),
/* harmony export */   faBoltLightning: () => (/* binding */ faBoltLightning),
/* harmony export */   faBomb: () => (/* binding */ faBomb),
/* harmony export */   faBone: () => (/* binding */ faBone),
/* harmony export */   faBong: () => (/* binding */ faBong),
/* harmony export */   faBook: () => (/* binding */ faBook),
/* harmony export */   faBookAtlas: () => (/* binding */ faBookAtlas),
/* harmony export */   faBookBible: () => (/* binding */ faBookBible),
/* harmony export */   faBookBookmark: () => (/* binding */ faBookBookmark),
/* harmony export */   faBookDead: () => (/* binding */ faBookDead),
/* harmony export */   faBookJournalWhills: () => (/* binding */ faBookJournalWhills),
/* harmony export */   faBookMedical: () => (/* binding */ faBookMedical),
/* harmony export */   faBookOpen: () => (/* binding */ faBookOpen),
/* harmony export */   faBookOpenReader: () => (/* binding */ faBookOpenReader),
/* harmony export */   faBookQuran: () => (/* binding */ faBookQuran),
/* harmony export */   faBookReader: () => (/* binding */ faBookReader),
/* harmony export */   faBookSkull: () => (/* binding */ faBookSkull),
/* harmony export */   faBookTanakh: () => (/* binding */ faBookTanakh),
/* harmony export */   faBookmark: () => (/* binding */ faBookmark),
/* harmony export */   faBorderAll: () => (/* binding */ faBorderAll),
/* harmony export */   faBorderNone: () => (/* binding */ faBorderNone),
/* harmony export */   faBorderStyle: () => (/* binding */ faBorderStyle),
/* harmony export */   faBorderTopLeft: () => (/* binding */ faBorderTopLeft),
/* harmony export */   faBoreHole: () => (/* binding */ faBoreHole),
/* harmony export */   faBottleDroplet: () => (/* binding */ faBottleDroplet),
/* harmony export */   faBottleWater: () => (/* binding */ faBottleWater),
/* harmony export */   faBowlFood: () => (/* binding */ faBowlFood),
/* harmony export */   faBowlRice: () => (/* binding */ faBowlRice),
/* harmony export */   faBowlingBall: () => (/* binding */ faBowlingBall),
/* harmony export */   faBox: () => (/* binding */ faBox),
/* harmony export */   faBoxArchive: () => (/* binding */ faBoxArchive),
/* harmony export */   faBoxOpen: () => (/* binding */ faBoxOpen),
/* harmony export */   faBoxTissue: () => (/* binding */ faBoxTissue),
/* harmony export */   faBoxes: () => (/* binding */ faBoxes),
/* harmony export */   faBoxesAlt: () => (/* binding */ faBoxesAlt),
/* harmony export */   faBoxesPacking: () => (/* binding */ faBoxesPacking),
/* harmony export */   faBoxesStacked: () => (/* binding */ faBoxesStacked),
/* harmony export */   faBraille: () => (/* binding */ faBraille),
/* harmony export */   faBrain: () => (/* binding */ faBrain),
/* harmony export */   faBrazilianRealSign: () => (/* binding */ faBrazilianRealSign),
/* harmony export */   faBreadSlice: () => (/* binding */ faBreadSlice),
/* harmony export */   faBridge: () => (/* binding */ faBridge),
/* harmony export */   faBridgeCircleCheck: () => (/* binding */ faBridgeCircleCheck),
/* harmony export */   faBridgeCircleExclamation: () => (/* binding */ faBridgeCircleExclamation),
/* harmony export */   faBridgeCircleXmark: () => (/* binding */ faBridgeCircleXmark),
/* harmony export */   faBridgeLock: () => (/* binding */ faBridgeLock),
/* harmony export */   faBridgeWater: () => (/* binding */ faBridgeWater),
/* harmony export */   faBriefcase: () => (/* binding */ faBriefcase),
/* harmony export */   faBriefcaseClock: () => (/* binding */ faBriefcaseClock),
/* harmony export */   faBriefcaseMedical: () => (/* binding */ faBriefcaseMedical),
/* harmony export */   faBroadcastTower: () => (/* binding */ faBroadcastTower),
/* harmony export */   faBroom: () => (/* binding */ faBroom),
/* harmony export */   faBroomBall: () => (/* binding */ faBroomBall),
/* harmony export */   faBrush: () => (/* binding */ faBrush),
/* harmony export */   faBucket: () => (/* binding */ faBucket),
/* harmony export */   faBug: () => (/* binding */ faBug),
/* harmony export */   faBugSlash: () => (/* binding */ faBugSlash),
/* harmony export */   faBugs: () => (/* binding */ faBugs),
/* harmony export */   faBuilding: () => (/* binding */ faBuilding),
/* harmony export */   faBuildingCircleArrowRight: () => (/* binding */ faBuildingCircleArrowRight),
/* harmony export */   faBuildingCircleCheck: () => (/* binding */ faBuildingCircleCheck),
/* harmony export */   faBuildingCircleExclamation: () => (/* binding */ faBuildingCircleExclamation),
/* harmony export */   faBuildingCircleXmark: () => (/* binding */ faBuildingCircleXmark),
/* harmony export */   faBuildingColumns: () => (/* binding */ faBuildingColumns),
/* harmony export */   faBuildingFlag: () => (/* binding */ faBuildingFlag),
/* harmony export */   faBuildingLock: () => (/* binding */ faBuildingLock),
/* harmony export */   faBuildingNgo: () => (/* binding */ faBuildingNgo),
/* harmony export */   faBuildingShield: () => (/* binding */ faBuildingShield),
/* harmony export */   faBuildingUn: () => (/* binding */ faBuildingUn),
/* harmony export */   faBuildingUser: () => (/* binding */ faBuildingUser),
/* harmony export */   faBuildingWheat: () => (/* binding */ faBuildingWheat),
/* harmony export */   faBullhorn: () => (/* binding */ faBullhorn),
/* harmony export */   faBullseye: () => (/* binding */ faBullseye),
/* harmony export */   faBurger: () => (/* binding */ faBurger),
/* harmony export */   faBurn: () => (/* binding */ faBurn),
/* harmony export */   faBurst: () => (/* binding */ faBurst),
/* harmony export */   faBus: () => (/* binding */ faBus),
/* harmony export */   faBusAlt: () => (/* binding */ faBusAlt),
/* harmony export */   faBusSimple: () => (/* binding */ faBusSimple),
/* harmony export */   faBusinessTime: () => (/* binding */ faBusinessTime),
/* harmony export */   faC: () => (/* binding */ faC),
/* harmony export */   faCab: () => (/* binding */ faCab),
/* harmony export */   faCableCar: () => (/* binding */ faCableCar),
/* harmony export */   faCake: () => (/* binding */ faCake),
/* harmony export */   faCakeCandles: () => (/* binding */ faCakeCandles),
/* harmony export */   faCalculator: () => (/* binding */ faCalculator),
/* harmony export */   faCalendar: () => (/* binding */ faCalendar),
/* harmony export */   faCalendarAlt: () => (/* binding */ faCalendarAlt),
/* harmony export */   faCalendarCheck: () => (/* binding */ faCalendarCheck),
/* harmony export */   faCalendarDay: () => (/* binding */ faCalendarDay),
/* harmony export */   faCalendarDays: () => (/* binding */ faCalendarDays),
/* harmony export */   faCalendarMinus: () => (/* binding */ faCalendarMinus),
/* harmony export */   faCalendarPlus: () => (/* binding */ faCalendarPlus),
/* harmony export */   faCalendarTimes: () => (/* binding */ faCalendarTimes),
/* harmony export */   faCalendarWeek: () => (/* binding */ faCalendarWeek),
/* harmony export */   faCalendarXmark: () => (/* binding */ faCalendarXmark),
/* harmony export */   faCamera: () => (/* binding */ faCamera),
/* harmony export */   faCameraAlt: () => (/* binding */ faCameraAlt),
/* harmony export */   faCameraRetro: () => (/* binding */ faCameraRetro),
/* harmony export */   faCameraRotate: () => (/* binding */ faCameraRotate),
/* harmony export */   faCampground: () => (/* binding */ faCampground),
/* harmony export */   faCancel: () => (/* binding */ faCancel),
/* harmony export */   faCandyCane: () => (/* binding */ faCandyCane),
/* harmony export */   faCannabis: () => (/* binding */ faCannabis),
/* harmony export */   faCapsules: () => (/* binding */ faCapsules),
/* harmony export */   faCar: () => (/* binding */ faCar),
/* harmony export */   faCarAlt: () => (/* binding */ faCarAlt),
/* harmony export */   faCarBattery: () => (/* binding */ faCarBattery),
/* harmony export */   faCarBurst: () => (/* binding */ faCarBurst),
/* harmony export */   faCarCrash: () => (/* binding */ faCarCrash),
/* harmony export */   faCarOn: () => (/* binding */ faCarOn),
/* harmony export */   faCarRear: () => (/* binding */ faCarRear),
/* harmony export */   faCarSide: () => (/* binding */ faCarSide),
/* harmony export */   faCarTunnel: () => (/* binding */ faCarTunnel),
/* harmony export */   faCaravan: () => (/* binding */ faCaravan),
/* harmony export */   faCaretDown: () => (/* binding */ faCaretDown),
/* harmony export */   faCaretLeft: () => (/* binding */ faCaretLeft),
/* harmony export */   faCaretRight: () => (/* binding */ faCaretRight),
/* harmony export */   faCaretSquareDown: () => (/* binding */ faCaretSquareDown),
/* harmony export */   faCaretSquareLeft: () => (/* binding */ faCaretSquareLeft),
/* harmony export */   faCaretSquareRight: () => (/* binding */ faCaretSquareRight),
/* harmony export */   faCaretSquareUp: () => (/* binding */ faCaretSquareUp),
/* harmony export */   faCaretUp: () => (/* binding */ faCaretUp),
/* harmony export */   faCarriageBaby: () => (/* binding */ faCarriageBaby),
/* harmony export */   faCarrot: () => (/* binding */ faCarrot),
/* harmony export */   faCartArrowDown: () => (/* binding */ faCartArrowDown),
/* harmony export */   faCartFlatbed: () => (/* binding */ faCartFlatbed),
/* harmony export */   faCartFlatbedSuitcase: () => (/* binding */ faCartFlatbedSuitcase),
/* harmony export */   faCartPlus: () => (/* binding */ faCartPlus),
/* harmony export */   faCartShopping: () => (/* binding */ faCartShopping),
/* harmony export */   faCashRegister: () => (/* binding */ faCashRegister),
/* harmony export */   faCat: () => (/* binding */ faCat),
/* harmony export */   faCediSign: () => (/* binding */ faCediSign),
/* harmony export */   faCentSign: () => (/* binding */ faCentSign),
/* harmony export */   faCertificate: () => (/* binding */ faCertificate),
/* harmony export */   faChain: () => (/* binding */ faChain),
/* harmony export */   faChainBroken: () => (/* binding */ faChainBroken),
/* harmony export */   faChainSlash: () => (/* binding */ faChainSlash),
/* harmony export */   faChair: () => (/* binding */ faChair),
/* harmony export */   faChalkboard: () => (/* binding */ faChalkboard),
/* harmony export */   faChalkboardTeacher: () => (/* binding */ faChalkboardTeacher),
/* harmony export */   faChalkboardUser: () => (/* binding */ faChalkboardUser),
/* harmony export */   faChampagneGlasses: () => (/* binding */ faChampagneGlasses),
/* harmony export */   faChargingStation: () => (/* binding */ faChargingStation),
/* harmony export */   faChartArea: () => (/* binding */ faChartArea),
/* harmony export */   faChartBar: () => (/* binding */ faChartBar),
/* harmony export */   faChartColumn: () => (/* binding */ faChartColumn),
/* harmony export */   faChartDiagram: () => (/* binding */ faChartDiagram),
/* harmony export */   faChartGantt: () => (/* binding */ faChartGantt),
/* harmony export */   faChartLine: () => (/* binding */ faChartLine),
/* harmony export */   faChartPie: () => (/* binding */ faChartPie),
/* harmony export */   faChartSimple: () => (/* binding */ faChartSimple),
/* harmony export */   faCheck: () => (/* binding */ faCheck),
/* harmony export */   faCheckCircle: () => (/* binding */ faCheckCircle),
/* harmony export */   faCheckDouble: () => (/* binding */ faCheckDouble),
/* harmony export */   faCheckSquare: () => (/* binding */ faCheckSquare),
/* harmony export */   faCheckToSlot: () => (/* binding */ faCheckToSlot),
/* harmony export */   faCheese: () => (/* binding */ faCheese),
/* harmony export */   faChess: () => (/* binding */ faChess),
/* harmony export */   faChessBishop: () => (/* binding */ faChessBishop),
/* harmony export */   faChessBoard: () => (/* binding */ faChessBoard),
/* harmony export */   faChessKing: () => (/* binding */ faChessKing),
/* harmony export */   faChessKnight: () => (/* binding */ faChessKnight),
/* harmony export */   faChessPawn: () => (/* binding */ faChessPawn),
/* harmony export */   faChessQueen: () => (/* binding */ faChessQueen),
/* harmony export */   faChessRook: () => (/* binding */ faChessRook),
/* harmony export */   faChevronCircleDown: () => (/* binding */ faChevronCircleDown),
/* harmony export */   faChevronCircleLeft: () => (/* binding */ faChevronCircleLeft),
/* harmony export */   faChevronCircleRight: () => (/* binding */ faChevronCircleRight),
/* harmony export */   faChevronCircleUp: () => (/* binding */ faChevronCircleUp),
/* harmony export */   faChevronDown: () => (/* binding */ faChevronDown),
/* harmony export */   faChevronLeft: () => (/* binding */ faChevronLeft),
/* harmony export */   faChevronRight: () => (/* binding */ faChevronRight),
/* harmony export */   faChevronUp: () => (/* binding */ faChevronUp),
/* harmony export */   faChild: () => (/* binding */ faChild),
/* harmony export */   faChildCombatant: () => (/* binding */ faChildCombatant),
/* harmony export */   faChildDress: () => (/* binding */ faChildDress),
/* harmony export */   faChildReaching: () => (/* binding */ faChildReaching),
/* harmony export */   faChildRifle: () => (/* binding */ faChildRifle),
/* harmony export */   faChildren: () => (/* binding */ faChildren),
/* harmony export */   faChurch: () => (/* binding */ faChurch),
/* harmony export */   faCircle: () => (/* binding */ faCircle),
/* harmony export */   faCircleArrowDown: () => (/* binding */ faCircleArrowDown),
/* harmony export */   faCircleArrowLeft: () => (/* binding */ faCircleArrowLeft),
/* harmony export */   faCircleArrowRight: () => (/* binding */ faCircleArrowRight),
/* harmony export */   faCircleArrowUp: () => (/* binding */ faCircleArrowUp),
/* harmony export */   faCircleCheck: () => (/* binding */ faCircleCheck),
/* harmony export */   faCircleChevronDown: () => (/* binding */ faCircleChevronDown),
/* harmony export */   faCircleChevronLeft: () => (/* binding */ faCircleChevronLeft),
/* harmony export */   faCircleChevronRight: () => (/* binding */ faCircleChevronRight),
/* harmony export */   faCircleChevronUp: () => (/* binding */ faCircleChevronUp),
/* harmony export */   faCircleDollarToSlot: () => (/* binding */ faCircleDollarToSlot),
/* harmony export */   faCircleDot: () => (/* binding */ faCircleDot),
/* harmony export */   faCircleDown: () => (/* binding */ faCircleDown),
/* harmony export */   faCircleExclamation: () => (/* binding */ faCircleExclamation),
/* harmony export */   faCircleH: () => (/* binding */ faCircleH),
/* harmony export */   faCircleHalfStroke: () => (/* binding */ faCircleHalfStroke),
/* harmony export */   faCircleInfo: () => (/* binding */ faCircleInfo),
/* harmony export */   faCircleLeft: () => (/* binding */ faCircleLeft),
/* harmony export */   faCircleMinus: () => (/* binding */ faCircleMinus),
/* harmony export */   faCircleNodes: () => (/* binding */ faCircleNodes),
/* harmony export */   faCircleNotch: () => (/* binding */ faCircleNotch),
/* harmony export */   faCirclePause: () => (/* binding */ faCirclePause),
/* harmony export */   faCirclePlay: () => (/* binding */ faCirclePlay),
/* harmony export */   faCirclePlus: () => (/* binding */ faCirclePlus),
/* harmony export */   faCircleQuestion: () => (/* binding */ faCircleQuestion),
/* harmony export */   faCircleRadiation: () => (/* binding */ faCircleRadiation),
/* harmony export */   faCircleRight: () => (/* binding */ faCircleRight),
/* harmony export */   faCircleStop: () => (/* binding */ faCircleStop),
/* harmony export */   faCircleUp: () => (/* binding */ faCircleUp),
/* harmony export */   faCircleUser: () => (/* binding */ faCircleUser),
/* harmony export */   faCircleXmark: () => (/* binding */ faCircleXmark),
/* harmony export */   faCity: () => (/* binding */ faCity),
/* harmony export */   faClapperboard: () => (/* binding */ faClapperboard),
/* harmony export */   faClinicMedical: () => (/* binding */ faClinicMedical),
/* harmony export */   faClipboard: () => (/* binding */ faClipboard),
/* harmony export */   faClipboardCheck: () => (/* binding */ faClipboardCheck),
/* harmony export */   faClipboardList: () => (/* binding */ faClipboardList),
/* harmony export */   faClipboardQuestion: () => (/* binding */ faClipboardQuestion),
/* harmony export */   faClipboardUser: () => (/* binding */ faClipboardUser),
/* harmony export */   faClock: () => (/* binding */ faClock),
/* harmony export */   faClockFour: () => (/* binding */ faClockFour),
/* harmony export */   faClockRotateLeft: () => (/* binding */ faClockRotateLeft),
/* harmony export */   faClone: () => (/* binding */ faClone),
/* harmony export */   faClose: () => (/* binding */ faClose),
/* harmony export */   faClosedCaptioning: () => (/* binding */ faClosedCaptioning),
/* harmony export */   faCloud: () => (/* binding */ faCloud),
/* harmony export */   faCloudArrowDown: () => (/* binding */ faCloudArrowDown),
/* harmony export */   faCloudArrowUp: () => (/* binding */ faCloudArrowUp),
/* harmony export */   faCloudBolt: () => (/* binding */ faCloudBolt),
/* harmony export */   faCloudDownload: () => (/* binding */ faCloudDownload),
/* harmony export */   faCloudDownloadAlt: () => (/* binding */ faCloudDownloadAlt),
/* harmony export */   faCloudMeatball: () => (/* binding */ faCloudMeatball),
/* harmony export */   faCloudMoon: () => (/* binding */ faCloudMoon),
/* harmony export */   faCloudMoonRain: () => (/* binding */ faCloudMoonRain),
/* harmony export */   faCloudRain: () => (/* binding */ faCloudRain),
/* harmony export */   faCloudShowersHeavy: () => (/* binding */ faCloudShowersHeavy),
/* harmony export */   faCloudShowersWater: () => (/* binding */ faCloudShowersWater),
/* harmony export */   faCloudSun: () => (/* binding */ faCloudSun),
/* harmony export */   faCloudSunRain: () => (/* binding */ faCloudSunRain),
/* harmony export */   faCloudUpload: () => (/* binding */ faCloudUpload),
/* harmony export */   faCloudUploadAlt: () => (/* binding */ faCloudUploadAlt),
/* harmony export */   faClover: () => (/* binding */ faClover),
/* harmony export */   faCny: () => (/* binding */ faCny),
/* harmony export */   faCocktail: () => (/* binding */ faCocktail),
/* harmony export */   faCode: () => (/* binding */ faCode),
/* harmony export */   faCodeBranch: () => (/* binding */ faCodeBranch),
/* harmony export */   faCodeCommit: () => (/* binding */ faCodeCommit),
/* harmony export */   faCodeCompare: () => (/* binding */ faCodeCompare),
/* harmony export */   faCodeFork: () => (/* binding */ faCodeFork),
/* harmony export */   faCodeMerge: () => (/* binding */ faCodeMerge),
/* harmony export */   faCodePullRequest: () => (/* binding */ faCodePullRequest),
/* harmony export */   faCoffee: () => (/* binding */ faCoffee),
/* harmony export */   faCog: () => (/* binding */ faCog),
/* harmony export */   faCogs: () => (/* binding */ faCogs),
/* harmony export */   faCoins: () => (/* binding */ faCoins),
/* harmony export */   faColonSign: () => (/* binding */ faColonSign),
/* harmony export */   faColumns: () => (/* binding */ faColumns),
/* harmony export */   faComment: () => (/* binding */ faComment),
/* harmony export */   faCommentAlt: () => (/* binding */ faCommentAlt),
/* harmony export */   faCommentDollar: () => (/* binding */ faCommentDollar),
/* harmony export */   faCommentDots: () => (/* binding */ faCommentDots),
/* harmony export */   faCommentMedical: () => (/* binding */ faCommentMedical),
/* harmony export */   faCommentNodes: () => (/* binding */ faCommentNodes),
/* harmony export */   faCommentSlash: () => (/* binding */ faCommentSlash),
/* harmony export */   faCommentSms: () => (/* binding */ faCommentSms),
/* harmony export */   faCommenting: () => (/* binding */ faCommenting),
/* harmony export */   faComments: () => (/* binding */ faComments),
/* harmony export */   faCommentsDollar: () => (/* binding */ faCommentsDollar),
/* harmony export */   faCompactDisc: () => (/* binding */ faCompactDisc),
/* harmony export */   faCompass: () => (/* binding */ faCompass),
/* harmony export */   faCompassDrafting: () => (/* binding */ faCompassDrafting),
/* harmony export */   faCompress: () => (/* binding */ faCompress),
/* harmony export */   faCompressAlt: () => (/* binding */ faCompressAlt),
/* harmony export */   faCompressArrowsAlt: () => (/* binding */ faCompressArrowsAlt),
/* harmony export */   faComputer: () => (/* binding */ faComputer),
/* harmony export */   faComputerMouse: () => (/* binding */ faComputerMouse),
/* harmony export */   faConciergeBell: () => (/* binding */ faConciergeBell),
/* harmony export */   faContactBook: () => (/* binding */ faContactBook),
/* harmony export */   faContactCard: () => (/* binding */ faContactCard),
/* harmony export */   faCookie: () => (/* binding */ faCookie),
/* harmony export */   faCookieBite: () => (/* binding */ faCookieBite),
/* harmony export */   faCopy: () => (/* binding */ faCopy),
/* harmony export */   faCopyright: () => (/* binding */ faCopyright),
/* harmony export */   faCouch: () => (/* binding */ faCouch),
/* harmony export */   faCow: () => (/* binding */ faCow),
/* harmony export */   faCreditCard: () => (/* binding */ faCreditCard),
/* harmony export */   faCreditCardAlt: () => (/* binding */ faCreditCardAlt),
/* harmony export */   faCrop: () => (/* binding */ faCrop),
/* harmony export */   faCropAlt: () => (/* binding */ faCropAlt),
/* harmony export */   faCropSimple: () => (/* binding */ faCropSimple),
/* harmony export */   faCross: () => (/* binding */ faCross),
/* harmony export */   faCrosshairs: () => (/* binding */ faCrosshairs),
/* harmony export */   faCrow: () => (/* binding */ faCrow),
/* harmony export */   faCrown: () => (/* binding */ faCrown),
/* harmony export */   faCrutch: () => (/* binding */ faCrutch),
/* harmony export */   faCruzeiroSign: () => (/* binding */ faCruzeiroSign),
/* harmony export */   faCube: () => (/* binding */ faCube),
/* harmony export */   faCubes: () => (/* binding */ faCubes),
/* harmony export */   faCubesStacked: () => (/* binding */ faCubesStacked),
/* harmony export */   faCut: () => (/* binding */ faCut),
/* harmony export */   faCutlery: () => (/* binding */ faCutlery),
/* harmony export */   faD: () => (/* binding */ faD),
/* harmony export */   faDashboard: () => (/* binding */ faDashboard),
/* harmony export */   faDatabase: () => (/* binding */ faDatabase),
/* harmony export */   faDeaf: () => (/* binding */ faDeaf),
/* harmony export */   faDeafness: () => (/* binding */ faDeafness),
/* harmony export */   faDedent: () => (/* binding */ faDedent),
/* harmony export */   faDeleteLeft: () => (/* binding */ faDeleteLeft),
/* harmony export */   faDemocrat: () => (/* binding */ faDemocrat),
/* harmony export */   faDesktop: () => (/* binding */ faDesktop),
/* harmony export */   faDesktopAlt: () => (/* binding */ faDesktopAlt),
/* harmony export */   faDharmachakra: () => (/* binding */ faDharmachakra),
/* harmony export */   faDiagnoses: () => (/* binding */ faDiagnoses),
/* harmony export */   faDiagramNext: () => (/* binding */ faDiagramNext),
/* harmony export */   faDiagramPredecessor: () => (/* binding */ faDiagramPredecessor),
/* harmony export */   faDiagramProject: () => (/* binding */ faDiagramProject),
/* harmony export */   faDiagramSuccessor: () => (/* binding */ faDiagramSuccessor),
/* harmony export */   faDiamond: () => (/* binding */ faDiamond),
/* harmony export */   faDiamondTurnRight: () => (/* binding */ faDiamondTurnRight),
/* harmony export */   faDice: () => (/* binding */ faDice),
/* harmony export */   faDiceD20: () => (/* binding */ faDiceD20),
/* harmony export */   faDiceD6: () => (/* binding */ faDiceD6),
/* harmony export */   faDiceFive: () => (/* binding */ faDiceFive),
/* harmony export */   faDiceFour: () => (/* binding */ faDiceFour),
/* harmony export */   faDiceOne: () => (/* binding */ faDiceOne),
/* harmony export */   faDiceSix: () => (/* binding */ faDiceSix),
/* harmony export */   faDiceThree: () => (/* binding */ faDiceThree),
/* harmony export */   faDiceTwo: () => (/* binding */ faDiceTwo),
/* harmony export */   faDigging: () => (/* binding */ faDigging),
/* harmony export */   faDigitalTachograph: () => (/* binding */ faDigitalTachograph),
/* harmony export */   faDirections: () => (/* binding */ faDirections),
/* harmony export */   faDisease: () => (/* binding */ faDisease),
/* harmony export */   faDisplay: () => (/* binding */ faDisplay),
/* harmony export */   faDivide: () => (/* binding */ faDivide),
/* harmony export */   faDizzy: () => (/* binding */ faDizzy),
/* harmony export */   faDna: () => (/* binding */ faDna),
/* harmony export */   faDog: () => (/* binding */ faDog),
/* harmony export */   faDollar: () => (/* binding */ faDollar),
/* harmony export */   faDollarSign: () => (/* binding */ faDollarSign),
/* harmony export */   faDolly: () => (/* binding */ faDolly),
/* harmony export */   faDollyBox: () => (/* binding */ faDollyBox),
/* harmony export */   faDollyFlatbed: () => (/* binding */ faDollyFlatbed),
/* harmony export */   faDonate: () => (/* binding */ faDonate),
/* harmony export */   faDongSign: () => (/* binding */ faDongSign),
/* harmony export */   faDoorClosed: () => (/* binding */ faDoorClosed),
/* harmony export */   faDoorOpen: () => (/* binding */ faDoorOpen),
/* harmony export */   faDotCircle: () => (/* binding */ faDotCircle),
/* harmony export */   faDove: () => (/* binding */ faDove),
/* harmony export */   faDownLeftAndUpRightToCenter: () => (/* binding */ faDownLeftAndUpRightToCenter),
/* harmony export */   faDownLong: () => (/* binding */ faDownLong),
/* harmony export */   faDownload: () => (/* binding */ faDownload),
/* harmony export */   faDraftingCompass: () => (/* binding */ faDraftingCompass),
/* harmony export */   faDragon: () => (/* binding */ faDragon),
/* harmony export */   faDrawPolygon: () => (/* binding */ faDrawPolygon),
/* harmony export */   faDriversLicense: () => (/* binding */ faDriversLicense),
/* harmony export */   faDroplet: () => (/* binding */ faDroplet),
/* harmony export */   faDropletSlash: () => (/* binding */ faDropletSlash),
/* harmony export */   faDrum: () => (/* binding */ faDrum),
/* harmony export */   faDrumSteelpan: () => (/* binding */ faDrumSteelpan),
/* harmony export */   faDrumstickBite: () => (/* binding */ faDrumstickBite),
/* harmony export */   faDumbbell: () => (/* binding */ faDumbbell),
/* harmony export */   faDumpster: () => (/* binding */ faDumpster),
/* harmony export */   faDumpsterFire: () => (/* binding */ faDumpsterFire),
/* harmony export */   faDungeon: () => (/* binding */ faDungeon),
/* harmony export */   faE: () => (/* binding */ faE),
/* harmony export */   faEarDeaf: () => (/* binding */ faEarDeaf),
/* harmony export */   faEarListen: () => (/* binding */ faEarListen),
/* harmony export */   faEarth: () => (/* binding */ faEarth),
/* harmony export */   faEarthAfrica: () => (/* binding */ faEarthAfrica),
/* harmony export */   faEarthAmerica: () => (/* binding */ faEarthAmerica),
/* harmony export */   faEarthAmericas: () => (/* binding */ faEarthAmericas),
/* harmony export */   faEarthAsia: () => (/* binding */ faEarthAsia),
/* harmony export */   faEarthEurope: () => (/* binding */ faEarthEurope),
/* harmony export */   faEarthOceania: () => (/* binding */ faEarthOceania),
/* harmony export */   faEdit: () => (/* binding */ faEdit),
/* harmony export */   faEgg: () => (/* binding */ faEgg),
/* harmony export */   faEject: () => (/* binding */ faEject),
/* harmony export */   faElevator: () => (/* binding */ faElevator),
/* harmony export */   faEllipsis: () => (/* binding */ faEllipsis),
/* harmony export */   faEllipsisH: () => (/* binding */ faEllipsisH),
/* harmony export */   faEllipsisV: () => (/* binding */ faEllipsisV),
/* harmony export */   faEllipsisVertical: () => (/* binding */ faEllipsisVertical),
/* harmony export */   faEnvelope: () => (/* binding */ faEnvelope),
/* harmony export */   faEnvelopeCircleCheck: () => (/* binding */ faEnvelopeCircleCheck),
/* harmony export */   faEnvelopeOpen: () => (/* binding */ faEnvelopeOpen),
/* harmony export */   faEnvelopeOpenText: () => (/* binding */ faEnvelopeOpenText),
/* harmony export */   faEnvelopeSquare: () => (/* binding */ faEnvelopeSquare),
/* harmony export */   faEnvelopesBulk: () => (/* binding */ faEnvelopesBulk),
/* harmony export */   faEquals: () => (/* binding */ faEquals),
/* harmony export */   faEraser: () => (/* binding */ faEraser),
/* harmony export */   faEthernet: () => (/* binding */ faEthernet),
/* harmony export */   faEur: () => (/* binding */ faEur),
/* harmony export */   faEuro: () => (/* binding */ faEuro),
/* harmony export */   faEuroSign: () => (/* binding */ faEuroSign),
/* harmony export */   faExchange: () => (/* binding */ faExchange),
/* harmony export */   faExchangeAlt: () => (/* binding */ faExchangeAlt),
/* harmony export */   faExclamation: () => (/* binding */ faExclamation),
/* harmony export */   faExclamationCircle: () => (/* binding */ faExclamationCircle),
/* harmony export */   faExclamationTriangle: () => (/* binding */ faExclamationTriangle),
/* harmony export */   faExpand: () => (/* binding */ faExpand),
/* harmony export */   faExpandAlt: () => (/* binding */ faExpandAlt),
/* harmony export */   faExpandArrowsAlt: () => (/* binding */ faExpandArrowsAlt),
/* harmony export */   faExplosion: () => (/* binding */ faExplosion),
/* harmony export */   faExternalLink: () => (/* binding */ faExternalLink),
/* harmony export */   faExternalLinkAlt: () => (/* binding */ faExternalLinkAlt),
/* harmony export */   faExternalLinkSquare: () => (/* binding */ faExternalLinkSquare),
/* harmony export */   faExternalLinkSquareAlt: () => (/* binding */ faExternalLinkSquareAlt),
/* harmony export */   faEye: () => (/* binding */ faEye),
/* harmony export */   faEyeDropper: () => (/* binding */ faEyeDropper),
/* harmony export */   faEyeDropperEmpty: () => (/* binding */ faEyeDropperEmpty),
/* harmony export */   faEyeLowVision: () => (/* binding */ faEyeLowVision),
/* harmony export */   faEyeSlash: () => (/* binding */ faEyeSlash),
/* harmony export */   faEyedropper: () => (/* binding */ faEyedropper),
/* harmony export */   faF: () => (/* binding */ faF),
/* harmony export */   faFaceAngry: () => (/* binding */ faFaceAngry),
/* harmony export */   faFaceDizzy: () => (/* binding */ faFaceDizzy),
/* harmony export */   faFaceFlushed: () => (/* binding */ faFaceFlushed),
/* harmony export */   faFaceFrown: () => (/* binding */ faFaceFrown),
/* harmony export */   faFaceFrownOpen: () => (/* binding */ faFaceFrownOpen),
/* harmony export */   faFaceGrimace: () => (/* binding */ faFaceGrimace),
/* harmony export */   faFaceGrin: () => (/* binding */ faFaceGrin),
/* harmony export */   faFaceGrinBeam: () => (/* binding */ faFaceGrinBeam),
/* harmony export */   faFaceGrinBeamSweat: () => (/* binding */ faFaceGrinBeamSweat),
/* harmony export */   faFaceGrinHearts: () => (/* binding */ faFaceGrinHearts),
/* harmony export */   faFaceGrinSquint: () => (/* binding */ faFaceGrinSquint),
/* harmony export */   faFaceGrinSquintTears: () => (/* binding */ faFaceGrinSquintTears),
/* harmony export */   faFaceGrinStars: () => (/* binding */ faFaceGrinStars),
/* harmony export */   faFaceGrinTears: () => (/* binding */ faFaceGrinTears),
/* harmony export */   faFaceGrinTongue: () => (/* binding */ faFaceGrinTongue),
/* harmony export */   faFaceGrinTongueSquint: () => (/* binding */ faFaceGrinTongueSquint),
/* harmony export */   faFaceGrinTongueWink: () => (/* binding */ faFaceGrinTongueWink),
/* harmony export */   faFaceGrinWide: () => (/* binding */ faFaceGrinWide),
/* harmony export */   faFaceGrinWink: () => (/* binding */ faFaceGrinWink),
/* harmony export */   faFaceKiss: () => (/* binding */ faFaceKiss),
/* harmony export */   faFaceKissBeam: () => (/* binding */ faFaceKissBeam),
/* harmony export */   faFaceKissWinkHeart: () => (/* binding */ faFaceKissWinkHeart),
/* harmony export */   faFaceLaugh: () => (/* binding */ faFaceLaugh),
/* harmony export */   faFaceLaughBeam: () => (/* binding */ faFaceLaughBeam),
/* harmony export */   faFaceLaughSquint: () => (/* binding */ faFaceLaughSquint),
/* harmony export */   faFaceLaughWink: () => (/* binding */ faFaceLaughWink),
/* harmony export */   faFaceMeh: () => (/* binding */ faFaceMeh),
/* harmony export */   faFaceMehBlank: () => (/* binding */ faFaceMehBlank),
/* harmony export */   faFaceRollingEyes: () => (/* binding */ faFaceRollingEyes),
/* harmony export */   faFaceSadCry: () => (/* binding */ faFaceSadCry),
/* harmony export */   faFaceSadTear: () => (/* binding */ faFaceSadTear),
/* harmony export */   faFaceSmile: () => (/* binding */ faFaceSmile),
/* harmony export */   faFaceSmileBeam: () => (/* binding */ faFaceSmileBeam),
/* harmony export */   faFaceSmileWink: () => (/* binding */ faFaceSmileWink),
/* harmony export */   faFaceSurprise: () => (/* binding */ faFaceSurprise),
/* harmony export */   faFaceTired: () => (/* binding */ faFaceTired),
/* harmony export */   faFan: () => (/* binding */ faFan),
/* harmony export */   faFastBackward: () => (/* binding */ faFastBackward),
/* harmony export */   faFastForward: () => (/* binding */ faFastForward),
/* harmony export */   faFaucet: () => (/* binding */ faFaucet),
/* harmony export */   faFaucetDrip: () => (/* binding */ faFaucetDrip),
/* harmony export */   faFax: () => (/* binding */ faFax),
/* harmony export */   faFeather: () => (/* binding */ faFeather),
/* harmony export */   faFeatherAlt: () => (/* binding */ faFeatherAlt),
/* harmony export */   faFeatherPointed: () => (/* binding */ faFeatherPointed),
/* harmony export */   faFeed: () => (/* binding */ faFeed),
/* harmony export */   faFemale: () => (/* binding */ faFemale),
/* harmony export */   faFerry: () => (/* binding */ faFerry),
/* harmony export */   faFighterJet: () => (/* binding */ faFighterJet),
/* harmony export */   faFile: () => (/* binding */ faFile),
/* harmony export */   faFileAlt: () => (/* binding */ faFileAlt),
/* harmony export */   faFileArchive: () => (/* binding */ faFileArchive),
/* harmony export */   faFileArrowDown: () => (/* binding */ faFileArrowDown),
/* harmony export */   faFileArrowUp: () => (/* binding */ faFileArrowUp),
/* harmony export */   faFileAudio: () => (/* binding */ faFileAudio),
/* harmony export */   faFileCircleCheck: () => (/* binding */ faFileCircleCheck),
/* harmony export */   faFileCircleExclamation: () => (/* binding */ faFileCircleExclamation),
/* harmony export */   faFileCircleMinus: () => (/* binding */ faFileCircleMinus),
/* harmony export */   faFileCirclePlus: () => (/* binding */ faFileCirclePlus),
/* harmony export */   faFileCircleQuestion: () => (/* binding */ faFileCircleQuestion),
/* harmony export */   faFileCircleXmark: () => (/* binding */ faFileCircleXmark),
/* harmony export */   faFileClipboard: () => (/* binding */ faFileClipboard),
/* harmony export */   faFileCode: () => (/* binding */ faFileCode),
/* harmony export */   faFileContract: () => (/* binding */ faFileContract),
/* harmony export */   faFileCsv: () => (/* binding */ faFileCsv),
/* harmony export */   faFileDownload: () => (/* binding */ faFileDownload),
/* harmony export */   faFileEdit: () => (/* binding */ faFileEdit),
/* harmony export */   faFileExcel: () => (/* binding */ faFileExcel),
/* harmony export */   faFileExport: () => (/* binding */ faFileExport),
/* harmony export */   faFileFragment: () => (/* binding */ faFileFragment),
/* harmony export */   faFileHalfDashed: () => (/* binding */ faFileHalfDashed),
/* harmony export */   faFileImage: () => (/* binding */ faFileImage),
/* harmony export */   faFileImport: () => (/* binding */ faFileImport),
/* harmony export */   faFileInvoice: () => (/* binding */ faFileInvoice),
/* harmony export */   faFileInvoiceDollar: () => (/* binding */ faFileInvoiceDollar),
/* harmony export */   faFileLines: () => (/* binding */ faFileLines),
/* harmony export */   faFileMedical: () => (/* binding */ faFileMedical),
/* harmony export */   faFileMedicalAlt: () => (/* binding */ faFileMedicalAlt),
/* harmony export */   faFilePdf: () => (/* binding */ faFilePdf),
/* harmony export */   faFilePen: () => (/* binding */ faFilePen),
/* harmony export */   faFilePowerpoint: () => (/* binding */ faFilePowerpoint),
/* harmony export */   faFilePrescription: () => (/* binding */ faFilePrescription),
/* harmony export */   faFileShield: () => (/* binding */ faFileShield),
/* harmony export */   faFileSignature: () => (/* binding */ faFileSignature),
/* harmony export */   faFileText: () => (/* binding */ faFileText),
/* harmony export */   faFileUpload: () => (/* binding */ faFileUpload),
/* harmony export */   faFileVideo: () => (/* binding */ faFileVideo),
/* harmony export */   faFileWaveform: () => (/* binding */ faFileWaveform),
/* harmony export */   faFileWord: () => (/* binding */ faFileWord),
/* harmony export */   faFileZipper: () => (/* binding */ faFileZipper),
/* harmony export */   faFill: () => (/* binding */ faFill),
/* harmony export */   faFillDrip: () => (/* binding */ faFillDrip),
/* harmony export */   faFilm: () => (/* binding */ faFilm),
/* harmony export */   faFilter: () => (/* binding */ faFilter),
/* harmony export */   faFilterCircleDollar: () => (/* binding */ faFilterCircleDollar),
/* harmony export */   faFilterCircleXmark: () => (/* binding */ faFilterCircleXmark),
/* harmony export */   faFingerprint: () => (/* binding */ faFingerprint),
/* harmony export */   faFire: () => (/* binding */ faFire),
/* harmony export */   faFireAlt: () => (/* binding */ faFireAlt),
/* harmony export */   faFireBurner: () => (/* binding */ faFireBurner),
/* harmony export */   faFireExtinguisher: () => (/* binding */ faFireExtinguisher),
/* harmony export */   faFireFlameCurved: () => (/* binding */ faFireFlameCurved),
/* harmony export */   faFireFlameSimple: () => (/* binding */ faFireFlameSimple),
/* harmony export */   faFirstAid: () => (/* binding */ faFirstAid),
/* harmony export */   faFish: () => (/* binding */ faFish),
/* harmony export */   faFishFins: () => (/* binding */ faFishFins),
/* harmony export */   faFistRaised: () => (/* binding */ faFistRaised),
/* harmony export */   faFlag: () => (/* binding */ faFlag),
/* harmony export */   faFlagCheckered: () => (/* binding */ faFlagCheckered),
/* harmony export */   faFlagUsa: () => (/* binding */ faFlagUsa),
/* harmony export */   faFlask: () => (/* binding */ faFlask),
/* harmony export */   faFlaskVial: () => (/* binding */ faFlaskVial),
/* harmony export */   faFloppyDisk: () => (/* binding */ faFloppyDisk),
/* harmony export */   faFlorinSign: () => (/* binding */ faFlorinSign),
/* harmony export */   faFlushed: () => (/* binding */ faFlushed),
/* harmony export */   faFolder: () => (/* binding */ faFolder),
/* harmony export */   faFolderBlank: () => (/* binding */ faFolderBlank),
/* harmony export */   faFolderClosed: () => (/* binding */ faFolderClosed),
/* harmony export */   faFolderMinus: () => (/* binding */ faFolderMinus),
/* harmony export */   faFolderOpen: () => (/* binding */ faFolderOpen),
/* harmony export */   faFolderPlus: () => (/* binding */ faFolderPlus),
/* harmony export */   faFolderTree: () => (/* binding */ faFolderTree),
/* harmony export */   faFont: () => (/* binding */ faFont),
/* harmony export */   faFontAwesome: () => (/* binding */ faFontAwesome),
/* harmony export */   faFontAwesomeFlag: () => (/* binding */ faFontAwesomeFlag),
/* harmony export */   faFontAwesomeLogoFull: () => (/* binding */ faFontAwesomeLogoFull),
/* harmony export */   faFootball: () => (/* binding */ faFootball),
/* harmony export */   faFootballBall: () => (/* binding */ faFootballBall),
/* harmony export */   faForward: () => (/* binding */ faForward),
/* harmony export */   faForwardFast: () => (/* binding */ faForwardFast),
/* harmony export */   faForwardStep: () => (/* binding */ faForwardStep),
/* harmony export */   faFrancSign: () => (/* binding */ faFrancSign),
/* harmony export */   faFrog: () => (/* binding */ faFrog),
/* harmony export */   faFrown: () => (/* binding */ faFrown),
/* harmony export */   faFrownOpen: () => (/* binding */ faFrownOpen),
/* harmony export */   faFunnelDollar: () => (/* binding */ faFunnelDollar),
/* harmony export */   faFutbol: () => (/* binding */ faFutbol),
/* harmony export */   faFutbolBall: () => (/* binding */ faFutbolBall),
/* harmony export */   faG: () => (/* binding */ faG),
/* harmony export */   faGamepad: () => (/* binding */ faGamepad),
/* harmony export */   faGasPump: () => (/* binding */ faGasPump),
/* harmony export */   faGauge: () => (/* binding */ faGauge),
/* harmony export */   faGaugeHigh: () => (/* binding */ faGaugeHigh),
/* harmony export */   faGaugeMed: () => (/* binding */ faGaugeMed),
/* harmony export */   faGaugeSimple: () => (/* binding */ faGaugeSimple),
/* harmony export */   faGaugeSimpleHigh: () => (/* binding */ faGaugeSimpleHigh),
/* harmony export */   faGaugeSimpleMed: () => (/* binding */ faGaugeSimpleMed),
/* harmony export */   faGavel: () => (/* binding */ faGavel),
/* harmony export */   faGbp: () => (/* binding */ faGbp),
/* harmony export */   faGear: () => (/* binding */ faGear),
/* harmony export */   faGears: () => (/* binding */ faGears),
/* harmony export */   faGem: () => (/* binding */ faGem),
/* harmony export */   faGenderless: () => (/* binding */ faGenderless),
/* harmony export */   faGhost: () => (/* binding */ faGhost),
/* harmony export */   faGift: () => (/* binding */ faGift),
/* harmony export */   faGifts: () => (/* binding */ faGifts),
/* harmony export */   faGlassCheers: () => (/* binding */ faGlassCheers),
/* harmony export */   faGlassMartini: () => (/* binding */ faGlassMartini),
/* harmony export */   faGlassMartiniAlt: () => (/* binding */ faGlassMartiniAlt),
/* harmony export */   faGlassWater: () => (/* binding */ faGlassWater),
/* harmony export */   faGlassWaterDroplet: () => (/* binding */ faGlassWaterDroplet),
/* harmony export */   faGlassWhiskey: () => (/* binding */ faGlassWhiskey),
/* harmony export */   faGlasses: () => (/* binding */ faGlasses),
/* harmony export */   faGlobe: () => (/* binding */ faGlobe),
/* harmony export */   faGlobeAfrica: () => (/* binding */ faGlobeAfrica),
/* harmony export */   faGlobeAmericas: () => (/* binding */ faGlobeAmericas),
/* harmony export */   faGlobeAsia: () => (/* binding */ faGlobeAsia),
/* harmony export */   faGlobeEurope: () => (/* binding */ faGlobeEurope),
/* harmony export */   faGlobeOceania: () => (/* binding */ faGlobeOceania),
/* harmony export */   faGolfBall: () => (/* binding */ faGolfBall),
/* harmony export */   faGolfBallTee: () => (/* binding */ faGolfBallTee),
/* harmony export */   faGopuram: () => (/* binding */ faGopuram),
/* harmony export */   faGraduationCap: () => (/* binding */ faGraduationCap),
/* harmony export */   faGreaterThan: () => (/* binding */ faGreaterThan),
/* harmony export */   faGreaterThanEqual: () => (/* binding */ faGreaterThanEqual),
/* harmony export */   faGrimace: () => (/* binding */ faGrimace),
/* harmony export */   faGrin: () => (/* binding */ faGrin),
/* harmony export */   faGrinAlt: () => (/* binding */ faGrinAlt),
/* harmony export */   faGrinBeam: () => (/* binding */ faGrinBeam),
/* harmony export */   faGrinBeamSweat: () => (/* binding */ faGrinBeamSweat),
/* harmony export */   faGrinHearts: () => (/* binding */ faGrinHearts),
/* harmony export */   faGrinSquint: () => (/* binding */ faGrinSquint),
/* harmony export */   faGrinSquintTears: () => (/* binding */ faGrinSquintTears),
/* harmony export */   faGrinStars: () => (/* binding */ faGrinStars),
/* harmony export */   faGrinTears: () => (/* binding */ faGrinTears),
/* harmony export */   faGrinTongue: () => (/* binding */ faGrinTongue),
/* harmony export */   faGrinTongueSquint: () => (/* binding */ faGrinTongueSquint),
/* harmony export */   faGrinTongueWink: () => (/* binding */ faGrinTongueWink),
/* harmony export */   faGrinWink: () => (/* binding */ faGrinWink),
/* harmony export */   faGrip: () => (/* binding */ faGrip),
/* harmony export */   faGripHorizontal: () => (/* binding */ faGripHorizontal),
/* harmony export */   faGripLines: () => (/* binding */ faGripLines),
/* harmony export */   faGripLinesVertical: () => (/* binding */ faGripLinesVertical),
/* harmony export */   faGripVertical: () => (/* binding */ faGripVertical),
/* harmony export */   faGroupArrowsRotate: () => (/* binding */ faGroupArrowsRotate),
/* harmony export */   faGuaraniSign: () => (/* binding */ faGuaraniSign),
/* harmony export */   faGuitar: () => (/* binding */ faGuitar),
/* harmony export */   faGun: () => (/* binding */ faGun),
/* harmony export */   faH: () => (/* binding */ faH),
/* harmony export */   faHSquare: () => (/* binding */ faHSquare),
/* harmony export */   faHamburger: () => (/* binding */ faHamburger),
/* harmony export */   faHammer: () => (/* binding */ faHammer),
/* harmony export */   faHamsa: () => (/* binding */ faHamsa),
/* harmony export */   faHand: () => (/* binding */ faHand),
/* harmony export */   faHandBackFist: () => (/* binding */ faHandBackFist),
/* harmony export */   faHandDots: () => (/* binding */ faHandDots),
/* harmony export */   faHandFist: () => (/* binding */ faHandFist),
/* harmony export */   faHandHolding: () => (/* binding */ faHandHolding),
/* harmony export */   faHandHoldingDollar: () => (/* binding */ faHandHoldingDollar),
/* harmony export */   faHandHoldingDroplet: () => (/* binding */ faHandHoldingDroplet),
/* harmony export */   faHandHoldingHand: () => (/* binding */ faHandHoldingHand),
/* harmony export */   faHandHoldingHeart: () => (/* binding */ faHandHoldingHeart),
/* harmony export */   faHandHoldingMedical: () => (/* binding */ faHandHoldingMedical),
/* harmony export */   faHandHoldingUsd: () => (/* binding */ faHandHoldingUsd),
/* harmony export */   faHandHoldingWater: () => (/* binding */ faHandHoldingWater),
/* harmony export */   faHandLizard: () => (/* binding */ faHandLizard),
/* harmony export */   faHandMiddleFinger: () => (/* binding */ faHandMiddleFinger),
/* harmony export */   faHandPaper: () => (/* binding */ faHandPaper),
/* harmony export */   faHandPeace: () => (/* binding */ faHandPeace),
/* harmony export */   faHandPointDown: () => (/* binding */ faHandPointDown),
/* harmony export */   faHandPointLeft: () => (/* binding */ faHandPointLeft),
/* harmony export */   faHandPointRight: () => (/* binding */ faHandPointRight),
/* harmony export */   faHandPointUp: () => (/* binding */ faHandPointUp),
/* harmony export */   faHandPointer: () => (/* binding */ faHandPointer),
/* harmony export */   faHandRock: () => (/* binding */ faHandRock),
/* harmony export */   faHandScissors: () => (/* binding */ faHandScissors),
/* harmony export */   faHandSparkles: () => (/* binding */ faHandSparkles),
/* harmony export */   faHandSpock: () => (/* binding */ faHandSpock),
/* harmony export */   faHandcuffs: () => (/* binding */ faHandcuffs),
/* harmony export */   faHands: () => (/* binding */ faHands),
/* harmony export */   faHandsAmericanSignLanguageInterpreting: () => (/* binding */ faHandsAmericanSignLanguageInterpreting),
/* harmony export */   faHandsAslInterpreting: () => (/* binding */ faHandsAslInterpreting),
/* harmony export */   faHandsBound: () => (/* binding */ faHandsBound),
/* harmony export */   faHandsBubbles: () => (/* binding */ faHandsBubbles),
/* harmony export */   faHandsClapping: () => (/* binding */ faHandsClapping),
/* harmony export */   faHandsHelping: () => (/* binding */ faHandsHelping),
/* harmony export */   faHandsHolding: () => (/* binding */ faHandsHolding),
/* harmony export */   faHandsHoldingChild: () => (/* binding */ faHandsHoldingChild),
/* harmony export */   faHandsHoldingCircle: () => (/* binding */ faHandsHoldingCircle),
/* harmony export */   faHandsPraying: () => (/* binding */ faHandsPraying),
/* harmony export */   faHandsWash: () => (/* binding */ faHandsWash),
/* harmony export */   faHandshake: () => (/* binding */ faHandshake),
/* harmony export */   faHandshakeAlt: () => (/* binding */ faHandshakeAlt),
/* harmony export */   faHandshakeAltSlash: () => (/* binding */ faHandshakeAltSlash),
/* harmony export */   faHandshakeAngle: () => (/* binding */ faHandshakeAngle),
/* harmony export */   faHandshakeSimple: () => (/* binding */ faHandshakeSimple),
/* harmony export */   faHandshakeSimpleSlash: () => (/* binding */ faHandshakeSimpleSlash),
/* harmony export */   faHandshakeSlash: () => (/* binding */ faHandshakeSlash),
/* harmony export */   faHanukiah: () => (/* binding */ faHanukiah),
/* harmony export */   faHardDrive: () => (/* binding */ faHardDrive),
/* harmony export */   faHardHat: () => (/* binding */ faHardHat),
/* harmony export */   faHardOfHearing: () => (/* binding */ faHardOfHearing),
/* harmony export */   faHashtag: () => (/* binding */ faHashtag),
/* harmony export */   faHatCowboy: () => (/* binding */ faHatCowboy),
/* harmony export */   faHatCowboySide: () => (/* binding */ faHatCowboySide),
/* harmony export */   faHatHard: () => (/* binding */ faHatHard),
/* harmony export */   faHatWizard: () => (/* binding */ faHatWizard),
/* harmony export */   faHaykal: () => (/* binding */ faHaykal),
/* harmony export */   faHdd: () => (/* binding */ faHdd),
/* harmony export */   faHeadSideCough: () => (/* binding */ faHeadSideCough),
/* harmony export */   faHeadSideCoughSlash: () => (/* binding */ faHeadSideCoughSlash),
/* harmony export */   faHeadSideMask: () => (/* binding */ faHeadSideMask),
/* harmony export */   faHeadSideVirus: () => (/* binding */ faHeadSideVirus),
/* harmony export */   faHeader: () => (/* binding */ faHeader),
/* harmony export */   faHeading: () => (/* binding */ faHeading),
/* harmony export */   faHeadphones: () => (/* binding */ faHeadphones),
/* harmony export */   faHeadphonesAlt: () => (/* binding */ faHeadphonesAlt),
/* harmony export */   faHeadphonesSimple: () => (/* binding */ faHeadphonesSimple),
/* harmony export */   faHeadset: () => (/* binding */ faHeadset),
/* harmony export */   faHeart: () => (/* binding */ faHeart),
/* harmony export */   faHeartBroken: () => (/* binding */ faHeartBroken),
/* harmony export */   faHeartCircleBolt: () => (/* binding */ faHeartCircleBolt),
/* harmony export */   faHeartCircleCheck: () => (/* binding */ faHeartCircleCheck),
/* harmony export */   faHeartCircleExclamation: () => (/* binding */ faHeartCircleExclamation),
/* harmony export */   faHeartCircleMinus: () => (/* binding */ faHeartCircleMinus),
/* harmony export */   faHeartCirclePlus: () => (/* binding */ faHeartCirclePlus),
/* harmony export */   faHeartCircleXmark: () => (/* binding */ faHeartCircleXmark),
/* harmony export */   faHeartCrack: () => (/* binding */ faHeartCrack),
/* harmony export */   faHeartMusicCameraBolt: () => (/* binding */ faHeartMusicCameraBolt),
/* harmony export */   faHeartPulse: () => (/* binding */ faHeartPulse),
/* harmony export */   faHeartbeat: () => (/* binding */ faHeartbeat),
/* harmony export */   faHelicopter: () => (/* binding */ faHelicopter),
/* harmony export */   faHelicopterSymbol: () => (/* binding */ faHelicopterSymbol),
/* harmony export */   faHelmetSafety: () => (/* binding */ faHelmetSafety),
/* harmony export */   faHelmetUn: () => (/* binding */ faHelmetUn),
/* harmony export */   faHexagonNodes: () => (/* binding */ faHexagonNodes),
/* harmony export */   faHexagonNodesBolt: () => (/* binding */ faHexagonNodesBolt),
/* harmony export */   faHighlighter: () => (/* binding */ faHighlighter),
/* harmony export */   faHiking: () => (/* binding */ faHiking),
/* harmony export */   faHillAvalanche: () => (/* binding */ faHillAvalanche),
/* harmony export */   faHillRockslide: () => (/* binding */ faHillRockslide),
/* harmony export */   faHippo: () => (/* binding */ faHippo),
/* harmony export */   faHistory: () => (/* binding */ faHistory),
/* harmony export */   faHockeyPuck: () => (/* binding */ faHockeyPuck),
/* harmony export */   faHollyBerry: () => (/* binding */ faHollyBerry),
/* harmony export */   faHome: () => (/* binding */ faHome),
/* harmony export */   faHomeAlt: () => (/* binding */ faHomeAlt),
/* harmony export */   faHomeLg: () => (/* binding */ faHomeLg),
/* harmony export */   faHomeLgAlt: () => (/* binding */ faHomeLgAlt),
/* harmony export */   faHomeUser: () => (/* binding */ faHomeUser),
/* harmony export */   faHorse: () => (/* binding */ faHorse),
/* harmony export */   faHorseHead: () => (/* binding */ faHorseHead),
/* harmony export */   faHospital: () => (/* binding */ faHospital),
/* harmony export */   faHospitalAlt: () => (/* binding */ faHospitalAlt),
/* harmony export */   faHospitalSymbol: () => (/* binding */ faHospitalSymbol),
/* harmony export */   faHospitalUser: () => (/* binding */ faHospitalUser),
/* harmony export */   faHospitalWide: () => (/* binding */ faHospitalWide),
/* harmony export */   faHotTub: () => (/* binding */ faHotTub),
/* harmony export */   faHotTubPerson: () => (/* binding */ faHotTubPerson),
/* harmony export */   faHotdog: () => (/* binding */ faHotdog),
/* harmony export */   faHotel: () => (/* binding */ faHotel),
/* harmony export */   faHourglass: () => (/* binding */ faHourglass),
/* harmony export */   faHourglass1: () => (/* binding */ faHourglass1),
/* harmony export */   faHourglass2: () => (/* binding */ faHourglass2),
/* harmony export */   faHourglass3: () => (/* binding */ faHourglass3),
/* harmony export */   faHourglassEmpty: () => (/* binding */ faHourglassEmpty),
/* harmony export */   faHourglassEnd: () => (/* binding */ faHourglassEnd),
/* harmony export */   faHourglassHalf: () => (/* binding */ faHourglassHalf),
/* harmony export */   faHourglassStart: () => (/* binding */ faHourglassStart),
/* harmony export */   faHouse: () => (/* binding */ faHouse),
/* harmony export */   faHouseChimney: () => (/* binding */ faHouseChimney),
/* harmony export */   faHouseChimneyCrack: () => (/* binding */ faHouseChimneyCrack),
/* harmony export */   faHouseChimneyMedical: () => (/* binding */ faHouseChimneyMedical),
/* harmony export */   faHouseChimneyUser: () => (/* binding */ faHouseChimneyUser),
/* harmony export */   faHouseChimneyWindow: () => (/* binding */ faHouseChimneyWindow),
/* harmony export */   faHouseCircleCheck: () => (/* binding */ faHouseCircleCheck),
/* harmony export */   faHouseCircleExclamation: () => (/* binding */ faHouseCircleExclamation),
/* harmony export */   faHouseCircleXmark: () => (/* binding */ faHouseCircleXmark),
/* harmony export */   faHouseCrack: () => (/* binding */ faHouseCrack),
/* harmony export */   faHouseDamage: () => (/* binding */ faHouseDamage),
/* harmony export */   faHouseFire: () => (/* binding */ faHouseFire),
/* harmony export */   faHouseFlag: () => (/* binding */ faHouseFlag),
/* harmony export */   faHouseFloodWater: () => (/* binding */ faHouseFloodWater),
/* harmony export */   faHouseFloodWaterCircleArrowRight: () => (/* binding */ faHouseFloodWaterCircleArrowRight),
/* harmony export */   faHouseLaptop: () => (/* binding */ faHouseLaptop),
/* harmony export */   faHouseLock: () => (/* binding */ faHouseLock),
/* harmony export */   faHouseMedical: () => (/* binding */ faHouseMedical),
/* harmony export */   faHouseMedicalCircleCheck: () => (/* binding */ faHouseMedicalCircleCheck),
/* harmony export */   faHouseMedicalCircleExclamation: () => (/* binding */ faHouseMedicalCircleExclamation),
/* harmony export */   faHouseMedicalCircleXmark: () => (/* binding */ faHouseMedicalCircleXmark),
/* harmony export */   faHouseMedicalFlag: () => (/* binding */ faHouseMedicalFlag),
/* harmony export */   faHouseSignal: () => (/* binding */ faHouseSignal),
/* harmony export */   faHouseTsunami: () => (/* binding */ faHouseTsunami),
/* harmony export */   faHouseUser: () => (/* binding */ faHouseUser),
/* harmony export */   faHryvnia: () => (/* binding */ faHryvnia),
/* harmony export */   faHryvniaSign: () => (/* binding */ faHryvniaSign),
/* harmony export */   faHurricane: () => (/* binding */ faHurricane),
/* harmony export */   faI: () => (/* binding */ faI),
/* harmony export */   faICursor: () => (/* binding */ faICursor),
/* harmony export */   faIceCream: () => (/* binding */ faIceCream),
/* harmony export */   faIcicles: () => (/* binding */ faIcicles),
/* harmony export */   faIcons: () => (/* binding */ faIcons),
/* harmony export */   faIdBadge: () => (/* binding */ faIdBadge),
/* harmony export */   faIdCard: () => (/* binding */ faIdCard),
/* harmony export */   faIdCardAlt: () => (/* binding */ faIdCardAlt),
/* harmony export */   faIdCardClip: () => (/* binding */ faIdCardClip),
/* harmony export */   faIgloo: () => (/* binding */ faIgloo),
/* harmony export */   faIls: () => (/* binding */ faIls),
/* harmony export */   faImage: () => (/* binding */ faImage),
/* harmony export */   faImagePortrait: () => (/* binding */ faImagePortrait),
/* harmony export */   faImages: () => (/* binding */ faImages),
/* harmony export */   faInbox: () => (/* binding */ faInbox),
/* harmony export */   faIndent: () => (/* binding */ faIndent),
/* harmony export */   faIndianRupee: () => (/* binding */ faIndianRupee),
/* harmony export */   faIndianRupeeSign: () => (/* binding */ faIndianRupeeSign),
/* harmony export */   faIndustry: () => (/* binding */ faIndustry),
/* harmony export */   faInfinity: () => (/* binding */ faInfinity),
/* harmony export */   faInfo: () => (/* binding */ faInfo),
/* harmony export */   faInfoCircle: () => (/* binding */ faInfoCircle),
/* harmony export */   faInr: () => (/* binding */ faInr),
/* harmony export */   faInstitution: () => (/* binding */ faInstitution),
/* harmony export */   faItalic: () => (/* binding */ faItalic),
/* harmony export */   faJ: () => (/* binding */ faJ),
/* harmony export */   faJar: () => (/* binding */ faJar),
/* harmony export */   faJarWheat: () => (/* binding */ faJarWheat),
/* harmony export */   faJedi: () => (/* binding */ faJedi),
/* harmony export */   faJetFighter: () => (/* binding */ faJetFighter),
/* harmony export */   faJetFighterUp: () => (/* binding */ faJetFighterUp),
/* harmony export */   faJoint: () => (/* binding */ faJoint),
/* harmony export */   faJournalWhills: () => (/* binding */ faJournalWhills),
/* harmony export */   faJpy: () => (/* binding */ faJpy),
/* harmony export */   faJugDetergent: () => (/* binding */ faJugDetergent),
/* harmony export */   faK: () => (/* binding */ faK),
/* harmony export */   faKaaba: () => (/* binding */ faKaaba),
/* harmony export */   faKey: () => (/* binding */ faKey),
/* harmony export */   faKeyboard: () => (/* binding */ faKeyboard),
/* harmony export */   faKhanda: () => (/* binding */ faKhanda),
/* harmony export */   faKipSign: () => (/* binding */ faKipSign),
/* harmony export */   faKiss: () => (/* binding */ faKiss),
/* harmony export */   faKissBeam: () => (/* binding */ faKissBeam),
/* harmony export */   faKissWinkHeart: () => (/* binding */ faKissWinkHeart),
/* harmony export */   faKitMedical: () => (/* binding */ faKitMedical),
/* harmony export */   faKitchenSet: () => (/* binding */ faKitchenSet),
/* harmony export */   faKiwiBird: () => (/* binding */ faKiwiBird),
/* harmony export */   faKrw: () => (/* binding */ faKrw),
/* harmony export */   faL: () => (/* binding */ faL),
/* harmony export */   faLadderWater: () => (/* binding */ faLadderWater),
/* harmony export */   faLandMineOn: () => (/* binding */ faLandMineOn),
/* harmony export */   faLandmark: () => (/* binding */ faLandmark),
/* harmony export */   faLandmarkAlt: () => (/* binding */ faLandmarkAlt),
/* harmony export */   faLandmarkDome: () => (/* binding */ faLandmarkDome),
/* harmony export */   faLandmarkFlag: () => (/* binding */ faLandmarkFlag),
/* harmony export */   faLanguage: () => (/* binding */ faLanguage),
/* harmony export */   faLaptop: () => (/* binding */ faLaptop),
/* harmony export */   faLaptopCode: () => (/* binding */ faLaptopCode),
/* harmony export */   faLaptopFile: () => (/* binding */ faLaptopFile),
/* harmony export */   faLaptopHouse: () => (/* binding */ faLaptopHouse),
/* harmony export */   faLaptopMedical: () => (/* binding */ faLaptopMedical),
/* harmony export */   faLariSign: () => (/* binding */ faLariSign),
/* harmony export */   faLaugh: () => (/* binding */ faLaugh),
/* harmony export */   faLaughBeam: () => (/* binding */ faLaughBeam),
/* harmony export */   faLaughSquint: () => (/* binding */ faLaughSquint),
/* harmony export */   faLaughWink: () => (/* binding */ faLaughWink),
/* harmony export */   faLayerGroup: () => (/* binding */ faLayerGroup),
/* harmony export */   faLeaf: () => (/* binding */ faLeaf),
/* harmony export */   faLeftLong: () => (/* binding */ faLeftLong),
/* harmony export */   faLeftRight: () => (/* binding */ faLeftRight),
/* harmony export */   faLegal: () => (/* binding */ faLegal),
/* harmony export */   faLemon: () => (/* binding */ faLemon),
/* harmony export */   faLessThan: () => (/* binding */ faLessThan),
/* harmony export */   faLessThanEqual: () => (/* binding */ faLessThanEqual),
/* harmony export */   faLevelDown: () => (/* binding */ faLevelDown),
/* harmony export */   faLevelDownAlt: () => (/* binding */ faLevelDownAlt),
/* harmony export */   faLevelUp: () => (/* binding */ faLevelUp),
/* harmony export */   faLevelUpAlt: () => (/* binding */ faLevelUpAlt),
/* harmony export */   faLifeRing: () => (/* binding */ faLifeRing),
/* harmony export */   faLightbulb: () => (/* binding */ faLightbulb),
/* harmony export */   faLineChart: () => (/* binding */ faLineChart),
/* harmony export */   faLinesLeaning: () => (/* binding */ faLinesLeaning),
/* harmony export */   faLink: () => (/* binding */ faLink),
/* harmony export */   faLinkSlash: () => (/* binding */ faLinkSlash),
/* harmony export */   faLiraSign: () => (/* binding */ faLiraSign),
/* harmony export */   faList: () => (/* binding */ faList),
/* harmony export */   faList12: () => (/* binding */ faList12),
/* harmony export */   faListAlt: () => (/* binding */ faListAlt),
/* harmony export */   faListCheck: () => (/* binding */ faListCheck),
/* harmony export */   faListDots: () => (/* binding */ faListDots),
/* harmony export */   faListNumeric: () => (/* binding */ faListNumeric),
/* harmony export */   faListOl: () => (/* binding */ faListOl),
/* harmony export */   faListSquares: () => (/* binding */ faListSquares),
/* harmony export */   faListUl: () => (/* binding */ faListUl),
/* harmony export */   faLitecoinSign: () => (/* binding */ faLitecoinSign),
/* harmony export */   faLocation: () => (/* binding */ faLocation),
/* harmony export */   faLocationArrow: () => (/* binding */ faLocationArrow),
/* harmony export */   faLocationCrosshairs: () => (/* binding */ faLocationCrosshairs),
/* harmony export */   faLocationDot: () => (/* binding */ faLocationDot),
/* harmony export */   faLocationPin: () => (/* binding */ faLocationPin),
/* harmony export */   faLocationPinLock: () => (/* binding */ faLocationPinLock),
/* harmony export */   faLock: () => (/* binding */ faLock),
/* harmony export */   faLockOpen: () => (/* binding */ faLockOpen),
/* harmony export */   faLocust: () => (/* binding */ faLocust),
/* harmony export */   faLongArrowAltDown: () => (/* binding */ faLongArrowAltDown),
/* harmony export */   faLongArrowAltLeft: () => (/* binding */ faLongArrowAltLeft),
/* harmony export */   faLongArrowAltRight: () => (/* binding */ faLongArrowAltRight),
/* harmony export */   faLongArrowAltUp: () => (/* binding */ faLongArrowAltUp),
/* harmony export */   faLongArrowDown: () => (/* binding */ faLongArrowDown),
/* harmony export */   faLongArrowLeft: () => (/* binding */ faLongArrowLeft),
/* harmony export */   faLongArrowRight: () => (/* binding */ faLongArrowRight),
/* harmony export */   faLongArrowUp: () => (/* binding */ faLongArrowUp),
/* harmony export */   faLowVision: () => (/* binding */ faLowVision),
/* harmony export */   faLuggageCart: () => (/* binding */ faLuggageCart),
/* harmony export */   faLungs: () => (/* binding */ faLungs),
/* harmony export */   faLungsVirus: () => (/* binding */ faLungsVirus),
/* harmony export */   faM: () => (/* binding */ faM),
/* harmony export */   faMagic: () => (/* binding */ faMagic),
/* harmony export */   faMagicWandSparkles: () => (/* binding */ faMagicWandSparkles),
/* harmony export */   faMagnet: () => (/* binding */ faMagnet),
/* harmony export */   faMagnifyingGlass: () => (/* binding */ faMagnifyingGlass),
/* harmony export */   faMagnifyingGlassArrowRight: () => (/* binding */ faMagnifyingGlassArrowRight),
/* harmony export */   faMagnifyingGlassChart: () => (/* binding */ faMagnifyingGlassChart),
/* harmony export */   faMagnifyingGlassDollar: () => (/* binding */ faMagnifyingGlassDollar),
/* harmony export */   faMagnifyingGlassLocation: () => (/* binding */ faMagnifyingGlassLocation),
/* harmony export */   faMagnifyingGlassMinus: () => (/* binding */ faMagnifyingGlassMinus),
/* harmony export */   faMagnifyingGlassPlus: () => (/* binding */ faMagnifyingGlassPlus),
/* harmony export */   faMailBulk: () => (/* binding */ faMailBulk),
/* harmony export */   faMailForward: () => (/* binding */ faMailForward),
/* harmony export */   faMailReply: () => (/* binding */ faMailReply),
/* harmony export */   faMailReplyAll: () => (/* binding */ faMailReplyAll),
/* harmony export */   faMale: () => (/* binding */ faMale),
/* harmony export */   faManatSign: () => (/* binding */ faManatSign),
/* harmony export */   faMap: () => (/* binding */ faMap),
/* harmony export */   faMapLocation: () => (/* binding */ faMapLocation),
/* harmony export */   faMapLocationDot: () => (/* binding */ faMapLocationDot),
/* harmony export */   faMapMarked: () => (/* binding */ faMapMarked),
/* harmony export */   faMapMarkedAlt: () => (/* binding */ faMapMarkedAlt),
/* harmony export */   faMapMarker: () => (/* binding */ faMapMarker),
/* harmony export */   faMapMarkerAlt: () => (/* binding */ faMapMarkerAlt),
/* harmony export */   faMapPin: () => (/* binding */ faMapPin),
/* harmony export */   faMapSigns: () => (/* binding */ faMapSigns),
/* harmony export */   faMarker: () => (/* binding */ faMarker),
/* harmony export */   faMars: () => (/* binding */ faMars),
/* harmony export */   faMarsAndVenus: () => (/* binding */ faMarsAndVenus),
/* harmony export */   faMarsAndVenusBurst: () => (/* binding */ faMarsAndVenusBurst),
/* harmony export */   faMarsDouble: () => (/* binding */ faMarsDouble),
/* harmony export */   faMarsStroke: () => (/* binding */ faMarsStroke),
/* harmony export */   faMarsStrokeH: () => (/* binding */ faMarsStrokeH),
/* harmony export */   faMarsStrokeRight: () => (/* binding */ faMarsStrokeRight),
/* harmony export */   faMarsStrokeUp: () => (/* binding */ faMarsStrokeUp),
/* harmony export */   faMarsStrokeV: () => (/* binding */ faMarsStrokeV),
/* harmony export */   faMartiniGlass: () => (/* binding */ faMartiniGlass),
/* harmony export */   faMartiniGlassCitrus: () => (/* binding */ faMartiniGlassCitrus),
/* harmony export */   faMartiniGlassEmpty: () => (/* binding */ faMartiniGlassEmpty),
/* harmony export */   faMask: () => (/* binding */ faMask),
/* harmony export */   faMaskFace: () => (/* binding */ faMaskFace),
/* harmony export */   faMaskVentilator: () => (/* binding */ faMaskVentilator),
/* harmony export */   faMasksTheater: () => (/* binding */ faMasksTheater),
/* harmony export */   faMattressPillow: () => (/* binding */ faMattressPillow),
/* harmony export */   faMaximize: () => (/* binding */ faMaximize),
/* harmony export */   faMedal: () => (/* binding */ faMedal),
/* harmony export */   faMedkit: () => (/* binding */ faMedkit),
/* harmony export */   faMeh: () => (/* binding */ faMeh),
/* harmony export */   faMehBlank: () => (/* binding */ faMehBlank),
/* harmony export */   faMehRollingEyes: () => (/* binding */ faMehRollingEyes),
/* harmony export */   faMemory: () => (/* binding */ faMemory),
/* harmony export */   faMenorah: () => (/* binding */ faMenorah),
/* harmony export */   faMercury: () => (/* binding */ faMercury),
/* harmony export */   faMessage: () => (/* binding */ faMessage),
/* harmony export */   faMeteor: () => (/* binding */ faMeteor),
/* harmony export */   faMicrochip: () => (/* binding */ faMicrochip),
/* harmony export */   faMicrophone: () => (/* binding */ faMicrophone),
/* harmony export */   faMicrophoneAlt: () => (/* binding */ faMicrophoneAlt),
/* harmony export */   faMicrophoneAltSlash: () => (/* binding */ faMicrophoneAltSlash),
/* harmony export */   faMicrophoneLines: () => (/* binding */ faMicrophoneLines),
/* harmony export */   faMicrophoneLinesSlash: () => (/* binding */ faMicrophoneLinesSlash),
/* harmony export */   faMicrophoneSlash: () => (/* binding */ faMicrophoneSlash),
/* harmony export */   faMicroscope: () => (/* binding */ faMicroscope),
/* harmony export */   faMillSign: () => (/* binding */ faMillSign),
/* harmony export */   faMinimize: () => (/* binding */ faMinimize),
/* harmony export */   faMinus: () => (/* binding */ faMinus),
/* harmony export */   faMinusCircle: () => (/* binding */ faMinusCircle),
/* harmony export */   faMinusSquare: () => (/* binding */ faMinusSquare),
/* harmony export */   faMitten: () => (/* binding */ faMitten),
/* harmony export */   faMobile: () => (/* binding */ faMobile),
/* harmony export */   faMobileAlt: () => (/* binding */ faMobileAlt),
/* harmony export */   faMobileAndroid: () => (/* binding */ faMobileAndroid),
/* harmony export */   faMobileAndroidAlt: () => (/* binding */ faMobileAndroidAlt),
/* harmony export */   faMobileButton: () => (/* binding */ faMobileButton),
/* harmony export */   faMobilePhone: () => (/* binding */ faMobilePhone),
/* harmony export */   faMobileRetro: () => (/* binding */ faMobileRetro),
/* harmony export */   faMobileScreen: () => (/* binding */ faMobileScreen),
/* harmony export */   faMobileScreenButton: () => (/* binding */ faMobileScreenButton),
/* harmony export */   faMoneyBill: () => (/* binding */ faMoneyBill),
/* harmony export */   faMoneyBill1: () => (/* binding */ faMoneyBill1),
/* harmony export */   faMoneyBill1Wave: () => (/* binding */ faMoneyBill1Wave),
/* harmony export */   faMoneyBillAlt: () => (/* binding */ faMoneyBillAlt),
/* harmony export */   faMoneyBillTransfer: () => (/* binding */ faMoneyBillTransfer),
/* harmony export */   faMoneyBillTrendUp: () => (/* binding */ faMoneyBillTrendUp),
/* harmony export */   faMoneyBillWave: () => (/* binding */ faMoneyBillWave),
/* harmony export */   faMoneyBillWaveAlt: () => (/* binding */ faMoneyBillWaveAlt),
/* harmony export */   faMoneyBillWheat: () => (/* binding */ faMoneyBillWheat),
/* harmony export */   faMoneyBills: () => (/* binding */ faMoneyBills),
/* harmony export */   faMoneyCheck: () => (/* binding */ faMoneyCheck),
/* harmony export */   faMoneyCheckAlt: () => (/* binding */ faMoneyCheckAlt),
/* harmony export */   faMoneyCheckDollar: () => (/* binding */ faMoneyCheckDollar),
/* harmony export */   faMonument: () => (/* binding */ faMonument),
/* harmony export */   faMoon: () => (/* binding */ faMoon),
/* harmony export */   faMortarBoard: () => (/* binding */ faMortarBoard),
/* harmony export */   faMortarPestle: () => (/* binding */ faMortarPestle),
/* harmony export */   faMosque: () => (/* binding */ faMosque),
/* harmony export */   faMosquito: () => (/* binding */ faMosquito),
/* harmony export */   faMosquitoNet: () => (/* binding */ faMosquitoNet),
/* harmony export */   faMotorcycle: () => (/* binding */ faMotorcycle),
/* harmony export */   faMound: () => (/* binding */ faMound),
/* harmony export */   faMountain: () => (/* binding */ faMountain),
/* harmony export */   faMountainCity: () => (/* binding */ faMountainCity),
/* harmony export */   faMountainSun: () => (/* binding */ faMountainSun),
/* harmony export */   faMouse: () => (/* binding */ faMouse),
/* harmony export */   faMousePointer: () => (/* binding */ faMousePointer),
/* harmony export */   faMugHot: () => (/* binding */ faMugHot),
/* harmony export */   faMugSaucer: () => (/* binding */ faMugSaucer),
/* harmony export */   faMultiply: () => (/* binding */ faMultiply),
/* harmony export */   faMuseum: () => (/* binding */ faMuseum),
/* harmony export */   faMusic: () => (/* binding */ faMusic),
/* harmony export */   faN: () => (/* binding */ faN),
/* harmony export */   faNairaSign: () => (/* binding */ faNairaSign),
/* harmony export */   faNavicon: () => (/* binding */ faNavicon),
/* harmony export */   faNetworkWired: () => (/* binding */ faNetworkWired),
/* harmony export */   faNeuter: () => (/* binding */ faNeuter),
/* harmony export */   faNewspaper: () => (/* binding */ faNewspaper),
/* harmony export */   faNotEqual: () => (/* binding */ faNotEqual),
/* harmony export */   faNotdef: () => (/* binding */ faNotdef),
/* harmony export */   faNoteSticky: () => (/* binding */ faNoteSticky),
/* harmony export */   faNotesMedical: () => (/* binding */ faNotesMedical),
/* harmony export */   faO: () => (/* binding */ faO),
/* harmony export */   faObjectGroup: () => (/* binding */ faObjectGroup),
/* harmony export */   faObjectUngroup: () => (/* binding */ faObjectUngroup),
/* harmony export */   faOilCan: () => (/* binding */ faOilCan),
/* harmony export */   faOilWell: () => (/* binding */ faOilWell),
/* harmony export */   faOm: () => (/* binding */ faOm),
/* harmony export */   faOtter: () => (/* binding */ faOtter),
/* harmony export */   faOutdent: () => (/* binding */ faOutdent),
/* harmony export */   faP: () => (/* binding */ faP),
/* harmony export */   faPager: () => (/* binding */ faPager),
/* harmony export */   faPaintBrush: () => (/* binding */ faPaintBrush),
/* harmony export */   faPaintRoller: () => (/* binding */ faPaintRoller),
/* harmony export */   faPaintbrush: () => (/* binding */ faPaintbrush),
/* harmony export */   faPalette: () => (/* binding */ faPalette),
/* harmony export */   faPallet: () => (/* binding */ faPallet),
/* harmony export */   faPanorama: () => (/* binding */ faPanorama),
/* harmony export */   faPaperPlane: () => (/* binding */ faPaperPlane),
/* harmony export */   faPaperclip: () => (/* binding */ faPaperclip),
/* harmony export */   faParachuteBox: () => (/* binding */ faParachuteBox),
/* harmony export */   faParagraph: () => (/* binding */ faParagraph),
/* harmony export */   faParking: () => (/* binding */ faParking),
/* harmony export */   faPassport: () => (/* binding */ faPassport),
/* harmony export */   faPastafarianism: () => (/* binding */ faPastafarianism),
/* harmony export */   faPaste: () => (/* binding */ faPaste),
/* harmony export */   faPause: () => (/* binding */ faPause),
/* harmony export */   faPauseCircle: () => (/* binding */ faPauseCircle),
/* harmony export */   faPaw: () => (/* binding */ faPaw),
/* harmony export */   faPeace: () => (/* binding */ faPeace),
/* harmony export */   faPen: () => (/* binding */ faPen),
/* harmony export */   faPenAlt: () => (/* binding */ faPenAlt),
/* harmony export */   faPenClip: () => (/* binding */ faPenClip),
/* harmony export */   faPenFancy: () => (/* binding */ faPenFancy),
/* harmony export */   faPenNib: () => (/* binding */ faPenNib),
/* harmony export */   faPenRuler: () => (/* binding */ faPenRuler),
/* harmony export */   faPenSquare: () => (/* binding */ faPenSquare),
/* harmony export */   faPenToSquare: () => (/* binding */ faPenToSquare),
/* harmony export */   faPencil: () => (/* binding */ faPencil),
/* harmony export */   faPencilAlt: () => (/* binding */ faPencilAlt),
/* harmony export */   faPencilRuler: () => (/* binding */ faPencilRuler),
/* harmony export */   faPencilSquare: () => (/* binding */ faPencilSquare),
/* harmony export */   faPeopleArrows: () => (/* binding */ faPeopleArrows),
/* harmony export */   faPeopleArrowsLeftRight: () => (/* binding */ faPeopleArrowsLeftRight),
/* harmony export */   faPeopleCarry: () => (/* binding */ faPeopleCarry),
/* harmony export */   faPeopleCarryBox: () => (/* binding */ faPeopleCarryBox),
/* harmony export */   faPeopleGroup: () => (/* binding */ faPeopleGroup),
/* harmony export */   faPeopleLine: () => (/* binding */ faPeopleLine),
/* harmony export */   faPeoplePulling: () => (/* binding */ faPeoplePulling),
/* harmony export */   faPeopleRobbery: () => (/* binding */ faPeopleRobbery),
/* harmony export */   faPeopleRoof: () => (/* binding */ faPeopleRoof),
/* harmony export */   faPepperHot: () => (/* binding */ faPepperHot),
/* harmony export */   faPercent: () => (/* binding */ faPercent),
/* harmony export */   faPercentage: () => (/* binding */ faPercentage),
/* harmony export */   faPerson: () => (/* binding */ faPerson),
/* harmony export */   faPersonArrowDownToLine: () => (/* binding */ faPersonArrowDownToLine),
/* harmony export */   faPersonArrowUpFromLine: () => (/* binding */ faPersonArrowUpFromLine),
/* harmony export */   faPersonBiking: () => (/* binding */ faPersonBiking),
/* harmony export */   faPersonBooth: () => (/* binding */ faPersonBooth),
/* harmony export */   faPersonBreastfeeding: () => (/* binding */ faPersonBreastfeeding),
/* harmony export */   faPersonBurst: () => (/* binding */ faPersonBurst),
/* harmony export */   faPersonCane: () => (/* binding */ faPersonCane),
/* harmony export */   faPersonChalkboard: () => (/* binding */ faPersonChalkboard),
/* harmony export */   faPersonCircleCheck: () => (/* binding */ faPersonCircleCheck),
/* harmony export */   faPersonCircleExclamation: () => (/* binding */ faPersonCircleExclamation),
/* harmony export */   faPersonCircleMinus: () => (/* binding */ faPersonCircleMinus),
/* harmony export */   faPersonCirclePlus: () => (/* binding */ faPersonCirclePlus),
/* harmony export */   faPersonCircleQuestion: () => (/* binding */ faPersonCircleQuestion),
/* harmony export */   faPersonCircleXmark: () => (/* binding */ faPersonCircleXmark),
/* harmony export */   faPersonDigging: () => (/* binding */ faPersonDigging),
/* harmony export */   faPersonDotsFromLine: () => (/* binding */ faPersonDotsFromLine),
/* harmony export */   faPersonDress: () => (/* binding */ faPersonDress),
/* harmony export */   faPersonDressBurst: () => (/* binding */ faPersonDressBurst),
/* harmony export */   faPersonDrowning: () => (/* binding */ faPersonDrowning),
/* harmony export */   faPersonFalling: () => (/* binding */ faPersonFalling),
/* harmony export */   faPersonFallingBurst: () => (/* binding */ faPersonFallingBurst),
/* harmony export */   faPersonHalfDress: () => (/* binding */ faPersonHalfDress),
/* harmony export */   faPersonHarassing: () => (/* binding */ faPersonHarassing),
/* harmony export */   faPersonHiking: () => (/* binding */ faPersonHiking),
/* harmony export */   faPersonMilitaryPointing: () => (/* binding */ faPersonMilitaryPointing),
/* harmony export */   faPersonMilitaryRifle: () => (/* binding */ faPersonMilitaryRifle),
/* harmony export */   faPersonMilitaryToPerson: () => (/* binding */ faPersonMilitaryToPerson),
/* harmony export */   faPersonPraying: () => (/* binding */ faPersonPraying),
/* harmony export */   faPersonPregnant: () => (/* binding */ faPersonPregnant),
/* harmony export */   faPersonRays: () => (/* binding */ faPersonRays),
/* harmony export */   faPersonRifle: () => (/* binding */ faPersonRifle),
/* harmony export */   faPersonRunning: () => (/* binding */ faPersonRunning),
/* harmony export */   faPersonShelter: () => (/* binding */ faPersonShelter),
/* harmony export */   faPersonSkating: () => (/* binding */ faPersonSkating),
/* harmony export */   faPersonSkiing: () => (/* binding */ faPersonSkiing),
/* harmony export */   faPersonSkiingNordic: () => (/* binding */ faPersonSkiingNordic),
/* harmony export */   faPersonSnowboarding: () => (/* binding */ faPersonSnowboarding),
/* harmony export */   faPersonSwimming: () => (/* binding */ faPersonSwimming),
/* harmony export */   faPersonThroughWindow: () => (/* binding */ faPersonThroughWindow),
/* harmony export */   faPersonWalking: () => (/* binding */ faPersonWalking),
/* harmony export */   faPersonWalkingArrowLoopLeft: () => (/* binding */ faPersonWalkingArrowLoopLeft),
/* harmony export */   faPersonWalkingArrowRight: () => (/* binding */ faPersonWalkingArrowRight),
/* harmony export */   faPersonWalkingDashedLineArrowRight: () => (/* binding */ faPersonWalkingDashedLineArrowRight),
/* harmony export */   faPersonWalkingLuggage: () => (/* binding */ faPersonWalkingLuggage),
/* harmony export */   faPersonWalkingWithCane: () => (/* binding */ faPersonWalkingWithCane),
/* harmony export */   faPesetaSign: () => (/* binding */ faPesetaSign),
/* harmony export */   faPesoSign: () => (/* binding */ faPesoSign),
/* harmony export */   faPhone: () => (/* binding */ faPhone),
/* harmony export */   faPhoneAlt: () => (/* binding */ faPhoneAlt),
/* harmony export */   faPhoneFlip: () => (/* binding */ faPhoneFlip),
/* harmony export */   faPhoneSlash: () => (/* binding */ faPhoneSlash),
/* harmony export */   faPhoneSquare: () => (/* binding */ faPhoneSquare),
/* harmony export */   faPhoneSquareAlt: () => (/* binding */ faPhoneSquareAlt),
/* harmony export */   faPhoneVolume: () => (/* binding */ faPhoneVolume),
/* harmony export */   faPhotoFilm: () => (/* binding */ faPhotoFilm),
/* harmony export */   faPhotoVideo: () => (/* binding */ faPhotoVideo),
/* harmony export */   faPieChart: () => (/* binding */ faPieChart),
/* harmony export */   faPiggyBank: () => (/* binding */ faPiggyBank),
/* harmony export */   faPills: () => (/* binding */ faPills),
/* harmony export */   faPingPongPaddleBall: () => (/* binding */ faPingPongPaddleBall),
/* harmony export */   faPizzaSlice: () => (/* binding */ faPizzaSlice),
/* harmony export */   faPlaceOfWorship: () => (/* binding */ faPlaceOfWorship),
/* harmony export */   faPlane: () => (/* binding */ faPlane),
/* harmony export */   faPlaneArrival: () => (/* binding */ faPlaneArrival),
/* harmony export */   faPlaneCircleCheck: () => (/* binding */ faPlaneCircleCheck),
/* harmony export */   faPlaneCircleExclamation: () => (/* binding */ faPlaneCircleExclamation),
/* harmony export */   faPlaneCircleXmark: () => (/* binding */ faPlaneCircleXmark),
/* harmony export */   faPlaneDeparture: () => (/* binding */ faPlaneDeparture),
/* harmony export */   faPlaneLock: () => (/* binding */ faPlaneLock),
/* harmony export */   faPlaneSlash: () => (/* binding */ faPlaneSlash),
/* harmony export */   faPlaneUp: () => (/* binding */ faPlaneUp),
/* harmony export */   faPlantWilt: () => (/* binding */ faPlantWilt),
/* harmony export */   faPlateWheat: () => (/* binding */ faPlateWheat),
/* harmony export */   faPlay: () => (/* binding */ faPlay),
/* harmony export */   faPlayCircle: () => (/* binding */ faPlayCircle),
/* harmony export */   faPlug: () => (/* binding */ faPlug),
/* harmony export */   faPlugCircleBolt: () => (/* binding */ faPlugCircleBolt),
/* harmony export */   faPlugCircleCheck: () => (/* binding */ faPlugCircleCheck),
/* harmony export */   faPlugCircleExclamation: () => (/* binding */ faPlugCircleExclamation),
/* harmony export */   faPlugCircleMinus: () => (/* binding */ faPlugCircleMinus),
/* harmony export */   faPlugCirclePlus: () => (/* binding */ faPlugCirclePlus),
/* harmony export */   faPlugCircleXmark: () => (/* binding */ faPlugCircleXmark),
/* harmony export */   faPlus: () => (/* binding */ faPlus),
/* harmony export */   faPlusCircle: () => (/* binding */ faPlusCircle),
/* harmony export */   faPlusMinus: () => (/* binding */ faPlusMinus),
/* harmony export */   faPlusSquare: () => (/* binding */ faPlusSquare),
/* harmony export */   faPodcast: () => (/* binding */ faPodcast),
/* harmony export */   faPoll: () => (/* binding */ faPoll),
/* harmony export */   faPollH: () => (/* binding */ faPollH),
/* harmony export */   faPoo: () => (/* binding */ faPoo),
/* harmony export */   faPooBolt: () => (/* binding */ faPooBolt),
/* harmony export */   faPooStorm: () => (/* binding */ faPooStorm),
/* harmony export */   faPoop: () => (/* binding */ faPoop),
/* harmony export */   faPortrait: () => (/* binding */ faPortrait),
/* harmony export */   faPoundSign: () => (/* binding */ faPoundSign),
/* harmony export */   faPowerOff: () => (/* binding */ faPowerOff),
/* harmony export */   faPray: () => (/* binding */ faPray),
/* harmony export */   faPrayingHands: () => (/* binding */ faPrayingHands),
/* harmony export */   faPrescription: () => (/* binding */ faPrescription),
/* harmony export */   faPrescriptionBottle: () => (/* binding */ faPrescriptionBottle),
/* harmony export */   faPrescriptionBottleAlt: () => (/* binding */ faPrescriptionBottleAlt),
/* harmony export */   faPrescriptionBottleMedical: () => (/* binding */ faPrescriptionBottleMedical),
/* harmony export */   faPrint: () => (/* binding */ faPrint),
/* harmony export */   faProcedures: () => (/* binding */ faProcedures),
/* harmony export */   faProjectDiagram: () => (/* binding */ faProjectDiagram),
/* harmony export */   faPumpMedical: () => (/* binding */ faPumpMedical),
/* harmony export */   faPumpSoap: () => (/* binding */ faPumpSoap),
/* harmony export */   faPuzzlePiece: () => (/* binding */ faPuzzlePiece),
/* harmony export */   faQ: () => (/* binding */ faQ),
/* harmony export */   faQrcode: () => (/* binding */ faQrcode),
/* harmony export */   faQuestion: () => (/* binding */ faQuestion),
/* harmony export */   faQuestionCircle: () => (/* binding */ faQuestionCircle),
/* harmony export */   faQuidditch: () => (/* binding */ faQuidditch),
/* harmony export */   faQuidditchBroomBall: () => (/* binding */ faQuidditchBroomBall),
/* harmony export */   faQuoteLeft: () => (/* binding */ faQuoteLeft),
/* harmony export */   faQuoteLeftAlt: () => (/* binding */ faQuoteLeftAlt),
/* harmony export */   faQuoteRight: () => (/* binding */ faQuoteRight),
/* harmony export */   faQuoteRightAlt: () => (/* binding */ faQuoteRightAlt),
/* harmony export */   faQuran: () => (/* binding */ faQuran),
/* harmony export */   faR: () => (/* binding */ faR),
/* harmony export */   faRadiation: () => (/* binding */ faRadiation),
/* harmony export */   faRadiationAlt: () => (/* binding */ faRadiationAlt),
/* harmony export */   faRadio: () => (/* binding */ faRadio),
/* harmony export */   faRainbow: () => (/* binding */ faRainbow),
/* harmony export */   faRandom: () => (/* binding */ faRandom),
/* harmony export */   faRankingStar: () => (/* binding */ faRankingStar),
/* harmony export */   faReceipt: () => (/* binding */ faReceipt),
/* harmony export */   faRecordVinyl: () => (/* binding */ faRecordVinyl),
/* harmony export */   faRectangleAd: () => (/* binding */ faRectangleAd),
/* harmony export */   faRectangleList: () => (/* binding */ faRectangleList),
/* harmony export */   faRectangleTimes: () => (/* binding */ faRectangleTimes),
/* harmony export */   faRectangleXmark: () => (/* binding */ faRectangleXmark),
/* harmony export */   faRecycle: () => (/* binding */ faRecycle),
/* harmony export */   faRedo: () => (/* binding */ faRedo),
/* harmony export */   faRedoAlt: () => (/* binding */ faRedoAlt),
/* harmony export */   faRefresh: () => (/* binding */ faRefresh),
/* harmony export */   faRegistered: () => (/* binding */ faRegistered),
/* harmony export */   faRemove: () => (/* binding */ faRemove),
/* harmony export */   faRemoveFormat: () => (/* binding */ faRemoveFormat),
/* harmony export */   faReorder: () => (/* binding */ faReorder),
/* harmony export */   faRepeat: () => (/* binding */ faRepeat),
/* harmony export */   faReply: () => (/* binding */ faReply),
/* harmony export */   faReplyAll: () => (/* binding */ faReplyAll),
/* harmony export */   faRepublican: () => (/* binding */ faRepublican),
/* harmony export */   faRestroom: () => (/* binding */ faRestroom),
/* harmony export */   faRetweet: () => (/* binding */ faRetweet),
/* harmony export */   faRibbon: () => (/* binding */ faRibbon),
/* harmony export */   faRightFromBracket: () => (/* binding */ faRightFromBracket),
/* harmony export */   faRightLeft: () => (/* binding */ faRightLeft),
/* harmony export */   faRightLong: () => (/* binding */ faRightLong),
/* harmony export */   faRightToBracket: () => (/* binding */ faRightToBracket),
/* harmony export */   faRing: () => (/* binding */ faRing),
/* harmony export */   faRmb: () => (/* binding */ faRmb),
/* harmony export */   faRoad: () => (/* binding */ faRoad),
/* harmony export */   faRoadBarrier: () => (/* binding */ faRoadBarrier),
/* harmony export */   faRoadBridge: () => (/* binding */ faRoadBridge),
/* harmony export */   faRoadCircleCheck: () => (/* binding */ faRoadCircleCheck),
/* harmony export */   faRoadCircleExclamation: () => (/* binding */ faRoadCircleExclamation),
/* harmony export */   faRoadCircleXmark: () => (/* binding */ faRoadCircleXmark),
/* harmony export */   faRoadLock: () => (/* binding */ faRoadLock),
/* harmony export */   faRoadSpikes: () => (/* binding */ faRoadSpikes),
/* harmony export */   faRobot: () => (/* binding */ faRobot),
/* harmony export */   faRocket: () => (/* binding */ faRocket),
/* harmony export */   faRodAsclepius: () => (/* binding */ faRodAsclepius),
/* harmony export */   faRodSnake: () => (/* binding */ faRodSnake),
/* harmony export */   faRotate: () => (/* binding */ faRotate),
/* harmony export */   faRotateBack: () => (/* binding */ faRotateBack),
/* harmony export */   faRotateBackward: () => (/* binding */ faRotateBackward),
/* harmony export */   faRotateForward: () => (/* binding */ faRotateForward),
/* harmony export */   faRotateLeft: () => (/* binding */ faRotateLeft),
/* harmony export */   faRotateRight: () => (/* binding */ faRotateRight),
/* harmony export */   faRouble: () => (/* binding */ faRouble),
/* harmony export */   faRoute: () => (/* binding */ faRoute),
/* harmony export */   faRss: () => (/* binding */ faRss),
/* harmony export */   faRssSquare: () => (/* binding */ faRssSquare),
/* harmony export */   faRub: () => (/* binding */ faRub),
/* harmony export */   faRuble: () => (/* binding */ faRuble),
/* harmony export */   faRubleSign: () => (/* binding */ faRubleSign),
/* harmony export */   faRug: () => (/* binding */ faRug),
/* harmony export */   faRuler: () => (/* binding */ faRuler),
/* harmony export */   faRulerCombined: () => (/* binding */ faRulerCombined),
/* harmony export */   faRulerHorizontal: () => (/* binding */ faRulerHorizontal),
/* harmony export */   faRulerVertical: () => (/* binding */ faRulerVertical),
/* harmony export */   faRunning: () => (/* binding */ faRunning),
/* harmony export */   faRupee: () => (/* binding */ faRupee),
/* harmony export */   faRupeeSign: () => (/* binding */ faRupeeSign),
/* harmony export */   faRupiahSign: () => (/* binding */ faRupiahSign),
/* harmony export */   faS: () => (/* binding */ faS),
/* harmony export */   faSackDollar: () => (/* binding */ faSackDollar),
/* harmony export */   faSackXmark: () => (/* binding */ faSackXmark),
/* harmony export */   faSadCry: () => (/* binding */ faSadCry),
/* harmony export */   faSadTear: () => (/* binding */ faSadTear),
/* harmony export */   faSailboat: () => (/* binding */ faSailboat),
/* harmony export */   faSatellite: () => (/* binding */ faSatellite),
/* harmony export */   faSatelliteDish: () => (/* binding */ faSatelliteDish),
/* harmony export */   faSave: () => (/* binding */ faSave),
/* harmony export */   faScaleBalanced: () => (/* binding */ faScaleBalanced),
/* harmony export */   faScaleUnbalanced: () => (/* binding */ faScaleUnbalanced),
/* harmony export */   faScaleUnbalancedFlip: () => (/* binding */ faScaleUnbalancedFlip),
/* harmony export */   faSchool: () => (/* binding */ faSchool),
/* harmony export */   faSchoolCircleCheck: () => (/* binding */ faSchoolCircleCheck),
/* harmony export */   faSchoolCircleExclamation: () => (/* binding */ faSchoolCircleExclamation),
/* harmony export */   faSchoolCircleXmark: () => (/* binding */ faSchoolCircleXmark),
/* harmony export */   faSchoolFlag: () => (/* binding */ faSchoolFlag),
/* harmony export */   faSchoolLock: () => (/* binding */ faSchoolLock),
/* harmony export */   faScissors: () => (/* binding */ faScissors),
/* harmony export */   faScrewdriver: () => (/* binding */ faScrewdriver),
/* harmony export */   faScrewdriverWrench: () => (/* binding */ faScrewdriverWrench),
/* harmony export */   faScroll: () => (/* binding */ faScroll),
/* harmony export */   faScrollTorah: () => (/* binding */ faScrollTorah),
/* harmony export */   faSdCard: () => (/* binding */ faSdCard),
/* harmony export */   faSearch: () => (/* binding */ faSearch),
/* harmony export */   faSearchDollar: () => (/* binding */ faSearchDollar),
/* harmony export */   faSearchLocation: () => (/* binding */ faSearchLocation),
/* harmony export */   faSearchMinus: () => (/* binding */ faSearchMinus),
/* harmony export */   faSearchPlus: () => (/* binding */ faSearchPlus),
/* harmony export */   faSection: () => (/* binding */ faSection),
/* harmony export */   faSeedling: () => (/* binding */ faSeedling),
/* harmony export */   faServer: () => (/* binding */ faServer),
/* harmony export */   faShapes: () => (/* binding */ faShapes),
/* harmony export */   faShare: () => (/* binding */ faShare),
/* harmony export */   faShareAlt: () => (/* binding */ faShareAlt),
/* harmony export */   faShareAltSquare: () => (/* binding */ faShareAltSquare),
/* harmony export */   faShareFromSquare: () => (/* binding */ faShareFromSquare),
/* harmony export */   faShareNodes: () => (/* binding */ faShareNodes),
/* harmony export */   faShareSquare: () => (/* binding */ faShareSquare),
/* harmony export */   faSheetPlastic: () => (/* binding */ faSheetPlastic),
/* harmony export */   faShekel: () => (/* binding */ faShekel),
/* harmony export */   faShekelSign: () => (/* binding */ faShekelSign),
/* harmony export */   faSheqel: () => (/* binding */ faSheqel),
/* harmony export */   faSheqelSign: () => (/* binding */ faSheqelSign),
/* harmony export */   faShield: () => (/* binding */ faShield),
/* harmony export */   faShieldAlt: () => (/* binding */ faShieldAlt),
/* harmony export */   faShieldBlank: () => (/* binding */ faShieldBlank),
/* harmony export */   faShieldCat: () => (/* binding */ faShieldCat),
/* harmony export */   faShieldDog: () => (/* binding */ faShieldDog),
/* harmony export */   faShieldHalved: () => (/* binding */ faShieldHalved),
/* harmony export */   faShieldHeart: () => (/* binding */ faShieldHeart),
/* harmony export */   faShieldVirus: () => (/* binding */ faShieldVirus),
/* harmony export */   faShip: () => (/* binding */ faShip),
/* harmony export */   faShippingFast: () => (/* binding */ faShippingFast),
/* harmony export */   faShirt: () => (/* binding */ faShirt),
/* harmony export */   faShoePrints: () => (/* binding */ faShoePrints),
/* harmony export */   faShop: () => (/* binding */ faShop),
/* harmony export */   faShopLock: () => (/* binding */ faShopLock),
/* harmony export */   faShopSlash: () => (/* binding */ faShopSlash),
/* harmony export */   faShoppingBag: () => (/* binding */ faShoppingBag),
/* harmony export */   faShoppingBasket: () => (/* binding */ faShoppingBasket),
/* harmony export */   faShoppingCart: () => (/* binding */ faShoppingCart),
/* harmony export */   faShower: () => (/* binding */ faShower),
/* harmony export */   faShrimp: () => (/* binding */ faShrimp),
/* harmony export */   faShuffle: () => (/* binding */ faShuffle),
/* harmony export */   faShuttleSpace: () => (/* binding */ faShuttleSpace),
/* harmony export */   faShuttleVan: () => (/* binding */ faShuttleVan),
/* harmony export */   faSign: () => (/* binding */ faSign),
/* harmony export */   faSignHanging: () => (/* binding */ faSignHanging),
/* harmony export */   faSignIn: () => (/* binding */ faSignIn),
/* harmony export */   faSignInAlt: () => (/* binding */ faSignInAlt),
/* harmony export */   faSignLanguage: () => (/* binding */ faSignLanguage),
/* harmony export */   faSignOut: () => (/* binding */ faSignOut),
/* harmony export */   faSignOutAlt: () => (/* binding */ faSignOutAlt),
/* harmony export */   faSignal: () => (/* binding */ faSignal),
/* harmony export */   faSignal5: () => (/* binding */ faSignal5),
/* harmony export */   faSignalPerfect: () => (/* binding */ faSignalPerfect),
/* harmony export */   faSignature: () => (/* binding */ faSignature),
/* harmony export */   faSigning: () => (/* binding */ faSigning),
/* harmony export */   faSignsPost: () => (/* binding */ faSignsPost),
/* harmony export */   faSimCard: () => (/* binding */ faSimCard),
/* harmony export */   faSink: () => (/* binding */ faSink),
/* harmony export */   faSitemap: () => (/* binding */ faSitemap),
/* harmony export */   faSkating: () => (/* binding */ faSkating),
/* harmony export */   faSkiing: () => (/* binding */ faSkiing),
/* harmony export */   faSkiingNordic: () => (/* binding */ faSkiingNordic),
/* harmony export */   faSkull: () => (/* binding */ faSkull),
/* harmony export */   faSkullCrossbones: () => (/* binding */ faSkullCrossbones),
/* harmony export */   faSlash: () => (/* binding */ faSlash),
/* harmony export */   faSleigh: () => (/* binding */ faSleigh),
/* harmony export */   faSliders: () => (/* binding */ faSliders),
/* harmony export */   faSlidersH: () => (/* binding */ faSlidersH),
/* harmony export */   faSmile: () => (/* binding */ faSmile),
/* harmony export */   faSmileBeam: () => (/* binding */ faSmileBeam),
/* harmony export */   faSmileWink: () => (/* binding */ faSmileWink),
/* harmony export */   faSmog: () => (/* binding */ faSmog),
/* harmony export */   faSmoking: () => (/* binding */ faSmoking),
/* harmony export */   faSmokingBan: () => (/* binding */ faSmokingBan),
/* harmony export */   faSms: () => (/* binding */ faSms),
/* harmony export */   faSnowboarding: () => (/* binding */ faSnowboarding),
/* harmony export */   faSnowflake: () => (/* binding */ faSnowflake),
/* harmony export */   faSnowman: () => (/* binding */ faSnowman),
/* harmony export */   faSnowplow: () => (/* binding */ faSnowplow),
/* harmony export */   faSoap: () => (/* binding */ faSoap),
/* harmony export */   faSoccerBall: () => (/* binding */ faSoccerBall),
/* harmony export */   faSocks: () => (/* binding */ faSocks),
/* harmony export */   faSolarPanel: () => (/* binding */ faSolarPanel),
/* harmony export */   faSort: () => (/* binding */ faSort),
/* harmony export */   faSortAlphaAsc: () => (/* binding */ faSortAlphaAsc),
/* harmony export */   faSortAlphaDesc: () => (/* binding */ faSortAlphaDesc),
/* harmony export */   faSortAlphaDown: () => (/* binding */ faSortAlphaDown),
/* harmony export */   faSortAlphaDownAlt: () => (/* binding */ faSortAlphaDownAlt),
/* harmony export */   faSortAlphaUp: () => (/* binding */ faSortAlphaUp),
/* harmony export */   faSortAlphaUpAlt: () => (/* binding */ faSortAlphaUpAlt),
/* harmony export */   faSortAmountAsc: () => (/* binding */ faSortAmountAsc),
/* harmony export */   faSortAmountDesc: () => (/* binding */ faSortAmountDesc),
/* harmony export */   faSortAmountDown: () => (/* binding */ faSortAmountDown),
/* harmony export */   faSortAmountDownAlt: () => (/* binding */ faSortAmountDownAlt),
/* harmony export */   faSortAmountUp: () => (/* binding */ faSortAmountUp),
/* harmony export */   faSortAmountUpAlt: () => (/* binding */ faSortAmountUpAlt),
/* harmony export */   faSortAsc: () => (/* binding */ faSortAsc),
/* harmony export */   faSortDesc: () => (/* binding */ faSortDesc),
/* harmony export */   faSortDown: () => (/* binding */ faSortDown),
/* harmony export */   faSortNumericAsc: () => (/* binding */ faSortNumericAsc),
/* harmony export */   faSortNumericDesc: () => (/* binding */ faSortNumericDesc),
/* harmony export */   faSortNumericDown: () => (/* binding */ faSortNumericDown),
/* harmony export */   faSortNumericDownAlt: () => (/* binding */ faSortNumericDownAlt),
/* harmony export */   faSortNumericUp: () => (/* binding */ faSortNumericUp),
/* harmony export */   faSortNumericUpAlt: () => (/* binding */ faSortNumericUpAlt),
/* harmony export */   faSortUp: () => (/* binding */ faSortUp),
/* harmony export */   faSpa: () => (/* binding */ faSpa),
/* harmony export */   faSpaceShuttle: () => (/* binding */ faSpaceShuttle),
/* harmony export */   faSpaghettiMonsterFlying: () => (/* binding */ faSpaghettiMonsterFlying),
/* harmony export */   faSpellCheck: () => (/* binding */ faSpellCheck),
/* harmony export */   faSpider: () => (/* binding */ faSpider),
/* harmony export */   faSpinner: () => (/* binding */ faSpinner),
/* harmony export */   faSplotch: () => (/* binding */ faSplotch),
/* harmony export */   faSpoon: () => (/* binding */ faSpoon),
/* harmony export */   faSprayCan: () => (/* binding */ faSprayCan),
/* harmony export */   faSprayCanSparkles: () => (/* binding */ faSprayCanSparkles),
/* harmony export */   faSprout: () => (/* binding */ faSprout),
/* harmony export */   faSquare: () => (/* binding */ faSquare),
/* harmony export */   faSquareArrowUpRight: () => (/* binding */ faSquareArrowUpRight),
/* harmony export */   faSquareBinary: () => (/* binding */ faSquareBinary),
/* harmony export */   faSquareCaretDown: () => (/* binding */ faSquareCaretDown),
/* harmony export */   faSquareCaretLeft: () => (/* binding */ faSquareCaretLeft),
/* harmony export */   faSquareCaretRight: () => (/* binding */ faSquareCaretRight),
/* harmony export */   faSquareCaretUp: () => (/* binding */ faSquareCaretUp),
/* harmony export */   faSquareCheck: () => (/* binding */ faSquareCheck),
/* harmony export */   faSquareEnvelope: () => (/* binding */ faSquareEnvelope),
/* harmony export */   faSquareFull: () => (/* binding */ faSquareFull),
/* harmony export */   faSquareH: () => (/* binding */ faSquareH),
/* harmony export */   faSquareMinus: () => (/* binding */ faSquareMinus),
/* harmony export */   faSquareNfi: () => (/* binding */ faSquareNfi),
/* harmony export */   faSquareParking: () => (/* binding */ faSquareParking),
/* harmony export */   faSquarePen: () => (/* binding */ faSquarePen),
/* harmony export */   faSquarePersonConfined: () => (/* binding */ faSquarePersonConfined),
/* harmony export */   faSquarePhone: () => (/* binding */ faSquarePhone),
/* harmony export */   faSquarePhoneFlip: () => (/* binding */ faSquarePhoneFlip),
/* harmony export */   faSquarePlus: () => (/* binding */ faSquarePlus),
/* harmony export */   faSquarePollHorizontal: () => (/* binding */ faSquarePollHorizontal),
/* harmony export */   faSquarePollVertical: () => (/* binding */ faSquarePollVertical),
/* harmony export */   faSquareRootAlt: () => (/* binding */ faSquareRootAlt),
/* harmony export */   faSquareRootVariable: () => (/* binding */ faSquareRootVariable),
/* harmony export */   faSquareRss: () => (/* binding */ faSquareRss),
/* harmony export */   faSquareShareNodes: () => (/* binding */ faSquareShareNodes),
/* harmony export */   faSquareUpRight: () => (/* binding */ faSquareUpRight),
/* harmony export */   faSquareVirus: () => (/* binding */ faSquareVirus),
/* harmony export */   faSquareXmark: () => (/* binding */ faSquareXmark),
/* harmony export */   faStaffAesculapius: () => (/* binding */ faStaffAesculapius),
/* harmony export */   faStaffSnake: () => (/* binding */ faStaffSnake),
/* harmony export */   faStairs: () => (/* binding */ faStairs),
/* harmony export */   faStamp: () => (/* binding */ faStamp),
/* harmony export */   faStapler: () => (/* binding */ faStapler),
/* harmony export */   faStar: () => (/* binding */ faStar),
/* harmony export */   faStarAndCrescent: () => (/* binding */ faStarAndCrescent),
/* harmony export */   faStarHalf: () => (/* binding */ faStarHalf),
/* harmony export */   faStarHalfAlt: () => (/* binding */ faStarHalfAlt),
/* harmony export */   faStarHalfStroke: () => (/* binding */ faStarHalfStroke),
/* harmony export */   faStarOfDavid: () => (/* binding */ faStarOfDavid),
/* harmony export */   faStarOfLife: () => (/* binding */ faStarOfLife),
/* harmony export */   faStepBackward: () => (/* binding */ faStepBackward),
/* harmony export */   faStepForward: () => (/* binding */ faStepForward),
/* harmony export */   faSterlingSign: () => (/* binding */ faSterlingSign),
/* harmony export */   faStethoscope: () => (/* binding */ faStethoscope),
/* harmony export */   faStickyNote: () => (/* binding */ faStickyNote),
/* harmony export */   faStop: () => (/* binding */ faStop),
/* harmony export */   faStopCircle: () => (/* binding */ faStopCircle),
/* harmony export */   faStopwatch: () => (/* binding */ faStopwatch),
/* harmony export */   faStopwatch20: () => (/* binding */ faStopwatch20),
/* harmony export */   faStore: () => (/* binding */ faStore),
/* harmony export */   faStoreAlt: () => (/* binding */ faStoreAlt),
/* harmony export */   faStoreAltSlash: () => (/* binding */ faStoreAltSlash),
/* harmony export */   faStoreSlash: () => (/* binding */ faStoreSlash),
/* harmony export */   faStream: () => (/* binding */ faStream),
/* harmony export */   faStreetView: () => (/* binding */ faStreetView),
/* harmony export */   faStrikethrough: () => (/* binding */ faStrikethrough),
/* harmony export */   faStroopwafel: () => (/* binding */ faStroopwafel),
/* harmony export */   faSubscript: () => (/* binding */ faSubscript),
/* harmony export */   faSubtract: () => (/* binding */ faSubtract),
/* harmony export */   faSubway: () => (/* binding */ faSubway),
/* harmony export */   faSuitcase: () => (/* binding */ faSuitcase),
/* harmony export */   faSuitcaseMedical: () => (/* binding */ faSuitcaseMedical),
/* harmony export */   faSuitcaseRolling: () => (/* binding */ faSuitcaseRolling),
/* harmony export */   faSun: () => (/* binding */ faSun),
/* harmony export */   faSunPlantWilt: () => (/* binding */ faSunPlantWilt),
/* harmony export */   faSuperscript: () => (/* binding */ faSuperscript),
/* harmony export */   faSurprise: () => (/* binding */ faSurprise),
/* harmony export */   faSwatchbook: () => (/* binding */ faSwatchbook),
/* harmony export */   faSwimmer: () => (/* binding */ faSwimmer),
/* harmony export */   faSwimmingPool: () => (/* binding */ faSwimmingPool),
/* harmony export */   faSynagogue: () => (/* binding */ faSynagogue),
/* harmony export */   faSync: () => (/* binding */ faSync),
/* harmony export */   faSyncAlt: () => (/* binding */ faSyncAlt),
/* harmony export */   faSyringe: () => (/* binding */ faSyringe),
/* harmony export */   faT: () => (/* binding */ faT),
/* harmony export */   faTShirt: () => (/* binding */ faTShirt),
/* harmony export */   faTable: () => (/* binding */ faTable),
/* harmony export */   faTableCells: () => (/* binding */ faTableCells),
/* harmony export */   faTableCellsColumnLock: () => (/* binding */ faTableCellsColumnLock),
/* harmony export */   faTableCellsLarge: () => (/* binding */ faTableCellsLarge),
/* harmony export */   faTableCellsRowLock: () => (/* binding */ faTableCellsRowLock),
/* harmony export */   faTableCellsRowUnlock: () => (/* binding */ faTableCellsRowUnlock),
/* harmony export */   faTableColumns: () => (/* binding */ faTableColumns),
/* harmony export */   faTableList: () => (/* binding */ faTableList),
/* harmony export */   faTableTennis: () => (/* binding */ faTableTennis),
/* harmony export */   faTableTennisPaddleBall: () => (/* binding */ faTableTennisPaddleBall),
/* harmony export */   faTablet: () => (/* binding */ faTablet),
/* harmony export */   faTabletAlt: () => (/* binding */ faTabletAlt),
/* harmony export */   faTabletAndroid: () => (/* binding */ faTabletAndroid),
/* harmony export */   faTabletButton: () => (/* binding */ faTabletButton),
/* harmony export */   faTabletScreenButton: () => (/* binding */ faTabletScreenButton),
/* harmony export */   faTablets: () => (/* binding */ faTablets),
/* harmony export */   faTachographDigital: () => (/* binding */ faTachographDigital),
/* harmony export */   faTachometer: () => (/* binding */ faTachometer),
/* harmony export */   faTachometerAlt: () => (/* binding */ faTachometerAlt),
/* harmony export */   faTachometerAltAverage: () => (/* binding */ faTachometerAltAverage),
/* harmony export */   faTachometerAltFast: () => (/* binding */ faTachometerAltFast),
/* harmony export */   faTachometerAverage: () => (/* binding */ faTachometerAverage),
/* harmony export */   faTachometerFast: () => (/* binding */ faTachometerFast),
/* harmony export */   faTag: () => (/* binding */ faTag),
/* harmony export */   faTags: () => (/* binding */ faTags),
/* harmony export */   faTanakh: () => (/* binding */ faTanakh),
/* harmony export */   faTape: () => (/* binding */ faTape),
/* harmony export */   faTarp: () => (/* binding */ faTarp),
/* harmony export */   faTarpDroplet: () => (/* binding */ faTarpDroplet),
/* harmony export */   faTasks: () => (/* binding */ faTasks),
/* harmony export */   faTasksAlt: () => (/* binding */ faTasksAlt),
/* harmony export */   faTaxi: () => (/* binding */ faTaxi),
/* harmony export */   faTeeth: () => (/* binding */ faTeeth),
/* harmony export */   faTeethOpen: () => (/* binding */ faTeethOpen),
/* harmony export */   faTeletype: () => (/* binding */ faTeletype),
/* harmony export */   faTelevision: () => (/* binding */ faTelevision),
/* harmony export */   faTemperature0: () => (/* binding */ faTemperature0),
/* harmony export */   faTemperature1: () => (/* binding */ faTemperature1),
/* harmony export */   faTemperature2: () => (/* binding */ faTemperature2),
/* harmony export */   faTemperature3: () => (/* binding */ faTemperature3),
/* harmony export */   faTemperature4: () => (/* binding */ faTemperature4),
/* harmony export */   faTemperatureArrowDown: () => (/* binding */ faTemperatureArrowDown),
/* harmony export */   faTemperatureArrowUp: () => (/* binding */ faTemperatureArrowUp),
/* harmony export */   faTemperatureDown: () => (/* binding */ faTemperatureDown),
/* harmony export */   faTemperatureEmpty: () => (/* binding */ faTemperatureEmpty),
/* harmony export */   faTemperatureFull: () => (/* binding */ faTemperatureFull),
/* harmony export */   faTemperatureHalf: () => (/* binding */ faTemperatureHalf),
/* harmony export */   faTemperatureHigh: () => (/* binding */ faTemperatureHigh),
/* harmony export */   faTemperatureLow: () => (/* binding */ faTemperatureLow),
/* harmony export */   faTemperatureQuarter: () => (/* binding */ faTemperatureQuarter),
/* harmony export */   faTemperatureThreeQuarters: () => (/* binding */ faTemperatureThreeQuarters),
/* harmony export */   faTemperatureUp: () => (/* binding */ faTemperatureUp),
/* harmony export */   faTenge: () => (/* binding */ faTenge),
/* harmony export */   faTengeSign: () => (/* binding */ faTengeSign),
/* harmony export */   faTent: () => (/* binding */ faTent),
/* harmony export */   faTentArrowDownToLine: () => (/* binding */ faTentArrowDownToLine),
/* harmony export */   faTentArrowLeftRight: () => (/* binding */ faTentArrowLeftRight),
/* harmony export */   faTentArrowTurnLeft: () => (/* binding */ faTentArrowTurnLeft),
/* harmony export */   faTentArrowsDown: () => (/* binding */ faTentArrowsDown),
/* harmony export */   faTents: () => (/* binding */ faTents),
/* harmony export */   faTerminal: () => (/* binding */ faTerminal),
/* harmony export */   faTextHeight: () => (/* binding */ faTextHeight),
/* harmony export */   faTextSlash: () => (/* binding */ faTextSlash),
/* harmony export */   faTextWidth: () => (/* binding */ faTextWidth),
/* harmony export */   faTh: () => (/* binding */ faTh),
/* harmony export */   faThLarge: () => (/* binding */ faThLarge),
/* harmony export */   faThList: () => (/* binding */ faThList),
/* harmony export */   faTheaterMasks: () => (/* binding */ faTheaterMasks),
/* harmony export */   faThermometer: () => (/* binding */ faThermometer),
/* harmony export */   faThermometer0: () => (/* binding */ faThermometer0),
/* harmony export */   faThermometer1: () => (/* binding */ faThermometer1),
/* harmony export */   faThermometer2: () => (/* binding */ faThermometer2),
/* harmony export */   faThermometer3: () => (/* binding */ faThermometer3),
/* harmony export */   faThermometer4: () => (/* binding */ faThermometer4),
/* harmony export */   faThermometerEmpty: () => (/* binding */ faThermometerEmpty),
/* harmony export */   faThermometerFull: () => (/* binding */ faThermometerFull),
/* harmony export */   faThermometerHalf: () => (/* binding */ faThermometerHalf),
/* harmony export */   faThermometerQuarter: () => (/* binding */ faThermometerQuarter),
/* harmony export */   faThermometerThreeQuarters: () => (/* binding */ faThermometerThreeQuarters),
/* harmony export */   faThumbTack: () => (/* binding */ faThumbTack),
/* harmony export */   faThumbTackSlash: () => (/* binding */ faThumbTackSlash),
/* harmony export */   faThumbsDown: () => (/* binding */ faThumbsDown),
/* harmony export */   faThumbsUp: () => (/* binding */ faThumbsUp),
/* harmony export */   faThumbtack: () => (/* binding */ faThumbtack),
/* harmony export */   faThumbtackSlash: () => (/* binding */ faThumbtackSlash),
/* harmony export */   faThunderstorm: () => (/* binding */ faThunderstorm),
/* harmony export */   faTicket: () => (/* binding */ faTicket),
/* harmony export */   faTicketAlt: () => (/* binding */ faTicketAlt),
/* harmony export */   faTicketSimple: () => (/* binding */ faTicketSimple),
/* harmony export */   faTimeline: () => (/* binding */ faTimeline),
/* harmony export */   faTimes: () => (/* binding */ faTimes),
/* harmony export */   faTimesCircle: () => (/* binding */ faTimesCircle),
/* harmony export */   faTimesRectangle: () => (/* binding */ faTimesRectangle),
/* harmony export */   faTimesSquare: () => (/* binding */ faTimesSquare),
/* harmony export */   faTint: () => (/* binding */ faTint),
/* harmony export */   faTintSlash: () => (/* binding */ faTintSlash),
/* harmony export */   faTired: () => (/* binding */ faTired),
/* harmony export */   faToggleOff: () => (/* binding */ faToggleOff),
/* harmony export */   faToggleOn: () => (/* binding */ faToggleOn),
/* harmony export */   faToilet: () => (/* binding */ faToilet),
/* harmony export */   faToiletPaper: () => (/* binding */ faToiletPaper),
/* harmony export */   faToiletPaperSlash: () => (/* binding */ faToiletPaperSlash),
/* harmony export */   faToiletPortable: () => (/* binding */ faToiletPortable),
/* harmony export */   faToiletsPortable: () => (/* binding */ faToiletsPortable),
/* harmony export */   faToolbox: () => (/* binding */ faToolbox),
/* harmony export */   faTools: () => (/* binding */ faTools),
/* harmony export */   faTooth: () => (/* binding */ faTooth),
/* harmony export */   faTorah: () => (/* binding */ faTorah),
/* harmony export */   faToriiGate: () => (/* binding */ faToriiGate),
/* harmony export */   faTornado: () => (/* binding */ faTornado),
/* harmony export */   faTowerBroadcast: () => (/* binding */ faTowerBroadcast),
/* harmony export */   faTowerCell: () => (/* binding */ faTowerCell),
/* harmony export */   faTowerObservation: () => (/* binding */ faTowerObservation),
/* harmony export */   faTractor: () => (/* binding */ faTractor),
/* harmony export */   faTrademark: () => (/* binding */ faTrademark),
/* harmony export */   faTrafficLight: () => (/* binding */ faTrafficLight),
/* harmony export */   faTrailer: () => (/* binding */ faTrailer),
/* harmony export */   faTrain: () => (/* binding */ faTrain),
/* harmony export */   faTrainSubway: () => (/* binding */ faTrainSubway),
/* harmony export */   faTrainTram: () => (/* binding */ faTrainTram),
/* harmony export */   faTram: () => (/* binding */ faTram),
/* harmony export */   faTransgender: () => (/* binding */ faTransgender),
/* harmony export */   faTransgenderAlt: () => (/* binding */ faTransgenderAlt),
/* harmony export */   faTrash: () => (/* binding */ faTrash),
/* harmony export */   faTrashAlt: () => (/* binding */ faTrashAlt),
/* harmony export */   faTrashArrowUp: () => (/* binding */ faTrashArrowUp),
/* harmony export */   faTrashCan: () => (/* binding */ faTrashCan),
/* harmony export */   faTrashCanArrowUp: () => (/* binding */ faTrashCanArrowUp),
/* harmony export */   faTrashRestore: () => (/* binding */ faTrashRestore),
/* harmony export */   faTrashRestoreAlt: () => (/* binding */ faTrashRestoreAlt),
/* harmony export */   faTree: () => (/* binding */ faTree),
/* harmony export */   faTreeCity: () => (/* binding */ faTreeCity),
/* harmony export */   faTriangleCircleSquare: () => (/* binding */ faTriangleCircleSquare),
/* harmony export */   faTriangleExclamation: () => (/* binding */ faTriangleExclamation),
/* harmony export */   faTrophy: () => (/* binding */ faTrophy),
/* harmony export */   faTrowel: () => (/* binding */ faTrowel),
/* harmony export */   faTrowelBricks: () => (/* binding */ faTrowelBricks),
/* harmony export */   faTruck: () => (/* binding */ faTruck),
/* harmony export */   faTruckArrowRight: () => (/* binding */ faTruckArrowRight),
/* harmony export */   faTruckDroplet: () => (/* binding */ faTruckDroplet),
/* harmony export */   faTruckFast: () => (/* binding */ faTruckFast),
/* harmony export */   faTruckField: () => (/* binding */ faTruckField),
/* harmony export */   faTruckFieldUn: () => (/* binding */ faTruckFieldUn),
/* harmony export */   faTruckFront: () => (/* binding */ faTruckFront),
/* harmony export */   faTruckLoading: () => (/* binding */ faTruckLoading),
/* harmony export */   faTruckMedical: () => (/* binding */ faTruckMedical),
/* harmony export */   faTruckMonster: () => (/* binding */ faTruckMonster),
/* harmony export */   faTruckMoving: () => (/* binding */ faTruckMoving),
/* harmony export */   faTruckPickup: () => (/* binding */ faTruckPickup),
/* harmony export */   faTruckPlane: () => (/* binding */ faTruckPlane),
/* harmony export */   faTruckRampBox: () => (/* binding */ faTruckRampBox),
/* harmony export */   faTry: () => (/* binding */ faTry),
/* harmony export */   faTshirt: () => (/* binding */ faTshirt),
/* harmony export */   faTty: () => (/* binding */ faTty),
/* harmony export */   faTurkishLira: () => (/* binding */ faTurkishLira),
/* harmony export */   faTurkishLiraSign: () => (/* binding */ faTurkishLiraSign),
/* harmony export */   faTurnDown: () => (/* binding */ faTurnDown),
/* harmony export */   faTurnUp: () => (/* binding */ faTurnUp),
/* harmony export */   faTv: () => (/* binding */ faTv),
/* harmony export */   faTvAlt: () => (/* binding */ faTvAlt),
/* harmony export */   faU: () => (/* binding */ faU),
/* harmony export */   faUmbrella: () => (/* binding */ faUmbrella),
/* harmony export */   faUmbrellaBeach: () => (/* binding */ faUmbrellaBeach),
/* harmony export */   faUnderline: () => (/* binding */ faUnderline),
/* harmony export */   faUndo: () => (/* binding */ faUndo),
/* harmony export */   faUndoAlt: () => (/* binding */ faUndoAlt),
/* harmony export */   faUniversalAccess: () => (/* binding */ faUniversalAccess),
/* harmony export */   faUniversity: () => (/* binding */ faUniversity),
/* harmony export */   faUnlink: () => (/* binding */ faUnlink),
/* harmony export */   faUnlock: () => (/* binding */ faUnlock),
/* harmony export */   faUnlockAlt: () => (/* binding */ faUnlockAlt),
/* harmony export */   faUnlockKeyhole: () => (/* binding */ faUnlockKeyhole),
/* harmony export */   faUnsorted: () => (/* binding */ faUnsorted),
/* harmony export */   faUpDown: () => (/* binding */ faUpDown),
/* harmony export */   faUpDownLeftRight: () => (/* binding */ faUpDownLeftRight),
/* harmony export */   faUpLong: () => (/* binding */ faUpLong),
/* harmony export */   faUpRightAndDownLeftFromCenter: () => (/* binding */ faUpRightAndDownLeftFromCenter),
/* harmony export */   faUpRightFromSquare: () => (/* binding */ faUpRightFromSquare),
/* harmony export */   faUpload: () => (/* binding */ faUpload),
/* harmony export */   faUsd: () => (/* binding */ faUsd),
/* harmony export */   faUser: () => (/* binding */ faUser),
/* harmony export */   faUserAlt: () => (/* binding */ faUserAlt),
/* harmony export */   faUserAltSlash: () => (/* binding */ faUserAltSlash),
/* harmony export */   faUserAstronaut: () => (/* binding */ faUserAstronaut),
/* harmony export */   faUserCheck: () => (/* binding */ faUserCheck),
/* harmony export */   faUserCircle: () => (/* binding */ faUserCircle),
/* harmony export */   faUserClock: () => (/* binding */ faUserClock),
/* harmony export */   faUserCog: () => (/* binding */ faUserCog),
/* harmony export */   faUserDoctor: () => (/* binding */ faUserDoctor),
/* harmony export */   faUserEdit: () => (/* binding */ faUserEdit),
/* harmony export */   faUserFriends: () => (/* binding */ faUserFriends),
/* harmony export */   faUserGear: () => (/* binding */ faUserGear),
/* harmony export */   faUserGraduate: () => (/* binding */ faUserGraduate),
/* harmony export */   faUserGroup: () => (/* binding */ faUserGroup),
/* harmony export */   faUserInjured: () => (/* binding */ faUserInjured),
/* harmony export */   faUserLarge: () => (/* binding */ faUserLarge),
/* harmony export */   faUserLargeSlash: () => (/* binding */ faUserLargeSlash),
/* harmony export */   faUserLock: () => (/* binding */ faUserLock),
/* harmony export */   faUserMd: () => (/* binding */ faUserMd),
/* harmony export */   faUserMinus: () => (/* binding */ faUserMinus),
/* harmony export */   faUserNinja: () => (/* binding */ faUserNinja),
/* harmony export */   faUserNurse: () => (/* binding */ faUserNurse),
/* harmony export */   faUserPen: () => (/* binding */ faUserPen),
/* harmony export */   faUserPlus: () => (/* binding */ faUserPlus),
/* harmony export */   faUserSecret: () => (/* binding */ faUserSecret),
/* harmony export */   faUserShield: () => (/* binding */ faUserShield),
/* harmony export */   faUserSlash: () => (/* binding */ faUserSlash),
/* harmony export */   faUserTag: () => (/* binding */ faUserTag),
/* harmony export */   faUserTie: () => (/* binding */ faUserTie),
/* harmony export */   faUserTimes: () => (/* binding */ faUserTimes),
/* harmony export */   faUserXmark: () => (/* binding */ faUserXmark),
/* harmony export */   faUsers: () => (/* binding */ faUsers),
/* harmony export */   faUsersBetweenLines: () => (/* binding */ faUsersBetweenLines),
/* harmony export */   faUsersCog: () => (/* binding */ faUsersCog),
/* harmony export */   faUsersGear: () => (/* binding */ faUsersGear),
/* harmony export */   faUsersLine: () => (/* binding */ faUsersLine),
/* harmony export */   faUsersRays: () => (/* binding */ faUsersRays),
/* harmony export */   faUsersRectangle: () => (/* binding */ faUsersRectangle),
/* harmony export */   faUsersSlash: () => (/* binding */ faUsersSlash),
/* harmony export */   faUsersViewfinder: () => (/* binding */ faUsersViewfinder),
/* harmony export */   faUtensilSpoon: () => (/* binding */ faUtensilSpoon),
/* harmony export */   faUtensils: () => (/* binding */ faUtensils),
/* harmony export */   faV: () => (/* binding */ faV),
/* harmony export */   faVanShuttle: () => (/* binding */ faVanShuttle),
/* harmony export */   faVault: () => (/* binding */ faVault),
/* harmony export */   faVcard: () => (/* binding */ faVcard),
/* harmony export */   faVectorSquare: () => (/* binding */ faVectorSquare),
/* harmony export */   faVenus: () => (/* binding */ faVenus),
/* harmony export */   faVenusDouble: () => (/* binding */ faVenusDouble),
/* harmony export */   faVenusMars: () => (/* binding */ faVenusMars),
/* harmony export */   faVest: () => (/* binding */ faVest),
/* harmony export */   faVestPatches: () => (/* binding */ faVestPatches),
/* harmony export */   faVial: () => (/* binding */ faVial),
/* harmony export */   faVialCircleCheck: () => (/* binding */ faVialCircleCheck),
/* harmony export */   faVialVirus: () => (/* binding */ faVialVirus),
/* harmony export */   faVials: () => (/* binding */ faVials),
/* harmony export */   faVideo: () => (/* binding */ faVideo),
/* harmony export */   faVideoCamera: () => (/* binding */ faVideoCamera),
/* harmony export */   faVideoSlash: () => (/* binding */ faVideoSlash),
/* harmony export */   faVihara: () => (/* binding */ faVihara),
/* harmony export */   faVirus: () => (/* binding */ faVirus),
/* harmony export */   faVirusCovid: () => (/* binding */ faVirusCovid),
/* harmony export */   faVirusCovidSlash: () => (/* binding */ faVirusCovidSlash),
/* harmony export */   faVirusSlash: () => (/* binding */ faVirusSlash),
/* harmony export */   faViruses: () => (/* binding */ faViruses),
/* harmony export */   faVoicemail: () => (/* binding */ faVoicemail),
/* harmony export */   faVolcano: () => (/* binding */ faVolcano),
/* harmony export */   faVolleyball: () => (/* binding */ faVolleyball),
/* harmony export */   faVolleyballBall: () => (/* binding */ faVolleyballBall),
/* harmony export */   faVolumeControlPhone: () => (/* binding */ faVolumeControlPhone),
/* harmony export */   faVolumeDown: () => (/* binding */ faVolumeDown),
/* harmony export */   faVolumeHigh: () => (/* binding */ faVolumeHigh),
/* harmony export */   faVolumeLow: () => (/* binding */ faVolumeLow),
/* harmony export */   faVolumeMute: () => (/* binding */ faVolumeMute),
/* harmony export */   faVolumeOff: () => (/* binding */ faVolumeOff),
/* harmony export */   faVolumeTimes: () => (/* binding */ faVolumeTimes),
/* harmony export */   faVolumeUp: () => (/* binding */ faVolumeUp),
/* harmony export */   faVolumeXmark: () => (/* binding */ faVolumeXmark),
/* harmony export */   faVoteYea: () => (/* binding */ faVoteYea),
/* harmony export */   faVrCardboard: () => (/* binding */ faVrCardboard),
/* harmony export */   faW: () => (/* binding */ faW),
/* harmony export */   faWalkieTalkie: () => (/* binding */ faWalkieTalkie),
/* harmony export */   faWalking: () => (/* binding */ faWalking),
/* harmony export */   faWallet: () => (/* binding */ faWallet),
/* harmony export */   faWandMagic: () => (/* binding */ faWandMagic),
/* harmony export */   faWandMagicSparkles: () => (/* binding */ faWandMagicSparkles),
/* harmony export */   faWandSparkles: () => (/* binding */ faWandSparkles),
/* harmony export */   faWarehouse: () => (/* binding */ faWarehouse),
/* harmony export */   faWarning: () => (/* binding */ faWarning),
/* harmony export */   faWater: () => (/* binding */ faWater),
/* harmony export */   faWaterLadder: () => (/* binding */ faWaterLadder),
/* harmony export */   faWaveSquare: () => (/* binding */ faWaveSquare),
/* harmony export */   faWebAwesome: () => (/* binding */ faWebAwesome),
/* harmony export */   faWeight: () => (/* binding */ faWeight),
/* harmony export */   faWeightHanging: () => (/* binding */ faWeightHanging),
/* harmony export */   faWeightScale: () => (/* binding */ faWeightScale),
/* harmony export */   faWheatAlt: () => (/* binding */ faWheatAlt),
/* harmony export */   faWheatAwn: () => (/* binding */ faWheatAwn),
/* harmony export */   faWheatAwnCircleExclamation: () => (/* binding */ faWheatAwnCircleExclamation),
/* harmony export */   faWheelchair: () => (/* binding */ faWheelchair),
/* harmony export */   faWheelchairAlt: () => (/* binding */ faWheelchairAlt),
/* harmony export */   faWheelchairMove: () => (/* binding */ faWheelchairMove),
/* harmony export */   faWhiskeyGlass: () => (/* binding */ faWhiskeyGlass),
/* harmony export */   faWifi: () => (/* binding */ faWifi),
/* harmony export */   faWifi3: () => (/* binding */ faWifi3),
/* harmony export */   faWifiStrong: () => (/* binding */ faWifiStrong),
/* harmony export */   faWind: () => (/* binding */ faWind),
/* harmony export */   faWindowClose: () => (/* binding */ faWindowClose),
/* harmony export */   faWindowMaximize: () => (/* binding */ faWindowMaximize),
/* harmony export */   faWindowMinimize: () => (/* binding */ faWindowMinimize),
/* harmony export */   faWindowRestore: () => (/* binding */ faWindowRestore),
/* harmony export */   faWineBottle: () => (/* binding */ faWineBottle),
/* harmony export */   faWineGlass: () => (/* binding */ faWineGlass),
/* harmony export */   faWineGlassAlt: () => (/* binding */ faWineGlassAlt),
/* harmony export */   faWineGlassEmpty: () => (/* binding */ faWineGlassEmpty),
/* harmony export */   faWon: () => (/* binding */ faWon),
/* harmony export */   faWonSign: () => (/* binding */ faWonSign),
/* harmony export */   faWorm: () => (/* binding */ faWorm),
/* harmony export */   faWrench: () => (/* binding */ faWrench),
/* harmony export */   faX: () => (/* binding */ faX),
/* harmony export */   faXRay: () => (/* binding */ faXRay),
/* harmony export */   faXmark: () => (/* binding */ faXmark),
/* harmony export */   faXmarkCircle: () => (/* binding */ faXmarkCircle),
/* harmony export */   faXmarkSquare: () => (/* binding */ faXmarkSquare),
/* harmony export */   faXmarksLines: () => (/* binding */ faXmarksLines),
/* harmony export */   faY: () => (/* binding */ faY),
/* harmony export */   faYen: () => (/* binding */ faYen),
/* harmony export */   faYenSign: () => (/* binding */ faYenSign),
/* harmony export */   faYinYang: () => (/* binding */ faYinYang),
/* harmony export */   faZ: () => (/* binding */ faZ),
/* harmony export */   faZap: () => (/* binding */ faZap),
/* harmony export */   fas: () => (/* binding */ icons),
/* harmony export */   prefix: () => (/* binding */ prefix)
/* harmony export */ });
/*!
 * Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com
 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
 * Copyright 2024 Fonticons, Inc.
 */
const prefix = "fas";
const fa0 = {
  prefix: 'fas',
  iconName: '0',
  icon: [320, 512, [], "30", "M0 192C0 103.6 71.6 32 160 32s160 71.6 160 160l0 128c0 88.4-71.6 160-160 160S0 408.4 0 320L0 192zM160 96c-53 0-96 43-96 96l0 128c0 53 43 96 96 96s96-43 96-96l0-128c0-53-43-96-96-96z"]
};
const fa1 = {
  prefix: 'fas',
  iconName: '1',
  icon: [256, 512, [], "31", "M160 64c0-11.8-6.5-22.6-16.9-28.2s-23-5-32.8 1.6l-96 64C-.5 111.2-4.4 131 5.4 145.8s29.7 18.7 44.4 8.9L96 123.8 96 416l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-352z"]
};
const fa2 = {
  prefix: 'fas',
  iconName: '2',
  icon: [320, 512, [], "32", "M142.9 96c-21.5 0-42.2 8.5-57.4 23.8L54.6 150.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L40.2 74.5C67.5 47.3 104.4 32 142.9 32C223 32 288 97 288 177.1c0 38.5-15.3 75.4-42.5 102.6L109.3 416 288 416c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L200.2 234.5c15.2-15.2 23.8-35.9 23.8-57.4c0-44.8-36.3-81.1-81.1-81.1z"]
};
const fa3 = {
  prefix: 'fas',
  iconName: '3',
  icon: [320, 512, [], "33", "M0 64C0 46.3 14.3 32 32 32l240 0c13.2 0 25 8.1 29.8 20.4s1.5 26.3-8.2 35.2L162.3 208l21.7 0c75.1 0 136 60.9 136 136s-60.9 136-136 136l-78.6 0C63 480 24.2 456 5.3 418.1l-1.9-3.8c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l1.9 3.8c8.1 16.3 24.8 26.5 42.9 26.5l78.6 0c39.8 0 72-32.2 72-72s-32.2-72-72-72L80 272c-13.2 0-25-8.1-29.8-20.4s-1.5-26.3 8.2-35.2L189.7 96 32 96C14.3 96 0 81.7 0 64z"]
};
const fa4 = {
  prefix: 'fas',
  iconName: '4',
  icon: [384, 512, [], "34", "M189 77.6c7.5-16 .7-35.1-15.3-42.6s-35.1-.7-42.6 15.3L3 322.4c-4.7 9.9-3.9 21.5 1.9 30.8S21 368 32 368l224 0 0 80c0 17.7 14.3 32 32 32s32-14.3 32-32l0-80 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-144c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L82.4 304 189 77.6z"]
};
const fa5 = {
  prefix: 'fas',
  iconName: '5',
  icon: [320, 512, [], "35", "M32.5 58.3C35.3 43.1 48.5 32 64 32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L90.7 96 70.3 208 184 208c75.1 0 136 60.9 136 136s-60.9 136-136 136l-83.5 0c-39.4 0-75.4-22.3-93-57.5l-4.1-8.2c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l4.1 8.2c6.8 13.6 20.6 22.1 35.8 22.1l83.5 0c39.8 0 72-32.2 72-72s-32.2-72-72-72L32 272c-9.5 0-18.5-4.2-24.6-11.5s-8.6-16.9-6.9-26.2l32-176z"]
};
const fa6 = {
  prefix: 'fas',
  iconName: '6',
  icon: [320, 512, [], "36", "M232.4 84.7c11.4-13.5 9.7-33.7-3.8-45.1s-33.7-9.7-45.1 3.8L38.6 214.7C14.7 242.9 1.1 278.4 .1 315.2c0 1.4-.1 2.9-.1 4.3l0 .5c0 88.4 71.6 160 160 160s160-71.6 160-160c0-85.5-67.1-155.4-151.5-159.8l63.9-75.6zM256 320A96 96 0 1 1 64 320a96 96 0 1 1 192 0z"]
};
const fa7 = {
  prefix: 'fas',
  iconName: '7',
  icon: [320, 512, [], "37", "M0 64C0 46.3 14.3 32 32 32l256 0c11.5 0 22 6.1 27.7 16.1s5.7 22.2-.1 32.1l-224 384c-8.9 15.3-28.5 20.4-43.8 11.5s-20.4-28.5-11.5-43.8L232.3 96 32 96C14.3 96 0 81.7 0 64z"]
};
const fa8 = {
  prefix: 'fas',
  iconName: '8',
  icon: [320, 512, [], "38", "M304 160c0-70.7-57.3-128-128-128l-32 0C73.3 32 16 89.3 16 160c0 34.6 13.7 66 36 89C20.5 272.3 0 309.8 0 352c0 70.7 57.3 128 128 128l64 0c70.7 0 128-57.3 128-128c0-42.2-20.5-79.7-52-103c22.3-23 36-54.4 36-89zM176.1 288l15.9 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64s28.7-64 64-64l15.9 0c0 0 .1 0 .1 0l32 0c0 0 .1 0 .1 0zm0-64c0 0 0 0 0 0l-32 0c0 0 0 0 0 0c-35.3 0-64-28.7-64-64c0-35.3 28.7-64 64-64l32 0c35.3 0 64 28.7 64 64c0 35.3-28.6 64-64 64z"]
};
const fa9 = {
  prefix: 'fas',
  iconName: '9',
  icon: [320, 512, [], "39", "M64 192a96 96 0 1 0 192 0A96 96 0 1 0 64 192zm87.5 159.8C67.1 347.4 0 277.5 0 192C0 103.6 71.6 32 160 32s160 71.6 160 160c0 2.6-.1 5.3-.2 7.9c-1.7 35.7-15.2 70-38.4 97.4l-145 171.4c-11.4 13.5-31.6 15.2-45.1 3.8s-15.2-31.6-3.8-45.1l63.9-75.6z"]
};
const faFillDrip = {
  prefix: 'fas',
  iconName: 'fill-drip',
  icon: [576, 512, [], "f576", "M41.4 9.4C53.9-3.1 74.1-3.1 86.6 9.4L168 90.7l53.1-53.1c28.1-28.1 73.7-28.1 101.8 0L474.3 189.1c28.1 28.1 28.1 73.7 0 101.8L283.9 481.4c-37.5 37.5-98.3 37.5-135.8 0L30.6 363.9c-37.5-37.5-37.5-98.3 0-135.8L122.7 136 41.4 54.6c-12.5-12.5-12.5-32.8 0-45.3zm176 221.3L168 181.3 75.9 273.4c-4.2 4.2-7 9.3-8.4 14.6l319.2 0 42.3-42.3c3.1-3.1 3.1-8.2 0-11.3L277.7 82.9c-3.1-3.1-8.2-3.1-11.3 0L213.3 136l49.4 49.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0zM512 512c-35.3 0-64-28.7-64-64c0-25.2 32.6-79.6 51.2-108.7c6-9.4 19.5-9.4 25.5 0C543.4 368.4 576 422.8 576 448c0 35.3-28.7 64-64 64z"]
};
const faArrowsToCircle = {
  prefix: 'fas',
  iconName: 'arrows-to-circle',
  icon: [640, 512, [], "e4bd", "M9.4 9.4C21.9-3.1 42.1-3.1 54.6 9.4L160 114.7 160 96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96c0 4.3-.9 8.5-2.4 12.2c-1.6 3.7-3.8 7.3-6.9 10.3l-.1 .1c-3.1 3-6.6 5.3-10.3 6.9c-3.8 1.6-7.9 2.4-12.2 2.4l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.7 0L9.4 54.6C-3.1 42.1-3.1 21.9 9.4 9.4zM256 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM114.7 352L96 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0s0 0 0 0l.1 0c8.8 0 16.7 3.6 22.5 9.3l.1 .1c3 3.1 5.3 6.6 6.9 10.3c1.6 3.8 2.4 7.9 2.4 12.2l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.7L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L114.7 352zM416 96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 18.7L585.4 9.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L525.3 160l18.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-8.8 0-16.8-3.6-22.6-9.3l-.1-.1c-3-3.1-5.3-6.6-6.9-10.3s-2.4-7.8-2.4-12.2l0-.1s0 0 0 0l0-96zM525.3 352L630.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L480 397.3l0 18.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96s0 0 0 0l0-.1c0-4.3 .9-8.4 2.4-12.2c1.6-3.8 3.9-7.3 6.9-10.4c5.8-5.8 13.7-9.3 22.5-9.4l.1 0s0 0 0 0l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.7 0z"]
};
const faCircleChevronRight = {
  prefix: 'fas',
  iconName: 'circle-chevron-right',
  icon: [512, 512, ["chevron-circle-right"], "f138", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM241 377c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l87-87-87-87c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L345 239c9.4 9.4 9.4 24.6 0 33.9L241 377z"]
};
const faChevronCircleRight = faCircleChevronRight;
const faAt = {
  prefix: 'fas',
  iconName: 'at',
  icon: [512, 512, [61946], "40", "M256 64C150 64 64 150 64 256s86 192 192 192c17.7 0 32 14.3 32 32s-14.3 32-32 32C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256l0 32c0 53-43 96-96 96c-29.3 0-55.6-13.2-73.2-33.9C320 371.1 289.5 384 256 384c-70.7 0-128-57.3-128-128s57.3-128 128-128c27.9 0 53.7 8.9 74.7 24.1c5.7-5 13.1-8.1 21.3-8.1c17.7 0 32 14.3 32 32l0 80 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32c0-106-86-192-192-192zm64 192a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faTrashCan = {
  prefix: 'fas',
  iconName: 'trash-can',
  icon: [448, 512, [61460, "trash-alt"], "f2ed", "M135.2 17.7C140.6 6.8 151.7 0 163.8 0L284.2 0c12.1 0 23.2 6.8 28.6 17.7L320 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 7.2-14.3zM32 128l384 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-320zm96 64c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16z"]
};
const faTrashAlt = faTrashCan;
const faTextHeight = {
  prefix: 'fas',
  iconName: 'text-height',
  icon: [576, 512, [], "f034", "M64 128l0-32 64 0 0 320-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-320 64 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48c0-26.5-21.5-48-48-48L160 32 48 32C21.5 32 0 53.5 0 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32zM502.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 192-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0 0-192 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z"]
};
const faUserXmark = {
  prefix: 'fas',
  iconName: 'user-xmark',
  icon: [640, 512, ["user-times"], "f235", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM471 143c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faUserTimes = faUserXmark;
const faStethoscope = {
  prefix: 'fas',
  iconName: 'stethoscope',
  icon: [576, 512, [129658], "f0f1", "M142.4 21.9c5.6 16.8-3.5 34.9-20.2 40.5L96 71.1 96 192c0 53 43 96 96 96s96-43 96-96l0-120.9-26.1-8.7c-16.8-5.6-25.8-23.7-20.2-40.5s23.7-25.8 40.5-20.2l26.1 8.7C334.4 19.1 352 43.5 352 71.1L352 192c0 77.2-54.6 141.6-127.3 156.7C231 404.6 278.4 448 336 448c61.9 0 112-50.1 112-112l0-70.7c-28.3-12.3-48-40.5-48-73.3c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3l0 70.7c0 97.2-78.8 176-176 176c-92.9 0-168.9-71.9-175.5-163.1C87.2 334.2 32 269.6 32 192L32 71.1c0-27.5 17.6-52 43.8-60.7l26.1-8.7c16.8-5.6 34.9 3.5 40.5 20.2zM480 224a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faMessage = {
  prefix: 'fas',
  iconName: 'message',
  icon: [512, 512, ["comment-alt"], "f27a", "M64 0C28.7 0 0 28.7 0 64L0 352c0 35.3 28.7 64 64 64l96 0 0 80c0 6.1 3.4 11.6 8.8 14.3s11.9 2.1 16.8-1.5L309.3 416 448 416c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64L64 0z"]
};
const faCommentAlt = faMessage;
const faInfo = {
  prefix: 'fas',
  iconName: 'info',
  icon: [192, 512, [], "f129", "M48 80a48 48 0 1 1 96 0A48 48 0 1 1 48 80zM0 224c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 224 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-192-32 0c-17.7 0-32-14.3-32-32z"]
};
const faDownLeftAndUpRightToCenter = {
  prefix: 'fas',
  iconName: 'down-left-and-up-right-to-center',
  icon: [512, 512, ["compress-alt"], "f422", "M439 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39L439 7zM72 272l144 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39L73 505c-9.4 9.4-24.6 9.4-33.9 0L7 473c-9.4-9.4-9.4-24.6 0-33.9l87-87L55 313c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8z"]
};
const faCompressAlt = faDownLeftAndUpRightToCenter;
const faExplosion = {
  prefix: 'fas',
  iconName: 'explosion',
  icon: [576, 512, [], "e4e9", "M499.6 11.3c6.7-10.7 20.5-14.5 31.7-8.5s15.8 19.5 10.6 31L404.8 338.6c2.2 2.3 4.3 4.7 6.3 7.1l97.2-54.7c10.5-5.9 23.6-3.1 30.9 6.4s6.3 23-2.2 31.5l-87 87-71.4 0c-13.2-37.3-48.7-64-90.5-64s-77.4 26.7-90.5 64l-79.6 0L42.3 363.7c-9.7-6.7-13.1-19.6-7.9-30.3s17.4-15.9 28.7-12.4l97.2 30.4c3-3.9 6.1-7.7 9.4-11.3L107.4 236.3c-6.1-10.1-3.9-23.1 5.1-30.7s22.2-7.5 31.1 .1L246 293.6c1.5-.4 3-.8 4.5-1.1l13.6-142.7c1.2-12.3 11.5-21.7 23.9-21.7s22.7 9.4 23.9 21.7l13.5 141.9L499.6 11.3zM64 448s0 0 0 0l448 0s0 0 0 0l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0zM288 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24z"]
};
const faFileLines = {
  prefix: 'fas',
  iconName: 'file-lines',
  icon: [384, 512, [128441, 128462, 61686, "file-alt", "file-text"], "f15c", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM112 256l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faFileAlt = faFileLines;
const faFileText = faFileLines;
const faWaveSquare = {
  prefix: 'fas',
  iconName: 'wave-square',
  icon: [640, 512, [], "f83e", "M128 64c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 352 96 0 0-160c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0 0 160c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-352-96 0 0 160c0 17.7-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0 0-160z"]
};
const faRing = {
  prefix: 'fas',
  iconName: 'ring',
  icon: [512, 512, [], "f70b", "M64 208c0 7.8 4.4 18.7 17.1 30.3C126.5 214.1 188.9 200 256 200s129.5 14.1 174.9 38.3C443.6 226.7 448 215.8 448 208c0-12.3-10.8-32-47.9-50.6C364.9 139.8 314 128 256 128s-108.9 11.8-144.1 29.4C74.8 176 64 195.7 64 208zm192 40c-47 0-89.3 7.6-122.9 19.7C166.3 280.2 208.8 288 256 288s89.7-7.8 122.9-20.3C345.3 255.6 303 248 256 248zM0 208c0-49.6 39.4-85.8 83.3-107.8C129.1 77.3 190.3 64 256 64s126.9 13.3 172.7 36.2c43.9 22 83.3 58.2 83.3 107.8l0 96c0 49.6-39.4 85.8-83.3 107.8C382.9 434.7 321.7 448 256 448s-126.9-13.3-172.7-36.2C39.4 389.8 0 353.6 0 304l0-96z"]
};
const faBuildingUn = {
  prefix: 'fas',
  iconName: 'building-un',
  icon: [384, 512, [], "e4d9", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c26.5 0 48-21.5 48-48l0-416c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM237.3 71.1l34.7 52L272 80c0-8.8 7.2-16 16-16s16 7.2 16 16l0 96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52 0 43.2c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM112 80l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faDiceThree = {
  prefix: 'fas',
  iconName: 'dice-three',
  icon: [448, 512, [9858], "f527", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm128 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faCalendarDays = {
  prefix: 'fas',
  iconName: 'calendar-days',
  icon: [448, 512, ["calendar-alt"], "f073", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm64 80l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 400l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faCalendarAlt = faCalendarDays;
const faAnchorCircleCheck = {
  prefix: 'fas',
  iconName: 'anchor-circle-check',
  icon: [640, 512, [], "e4aa", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c8.2 0 16.3-.6 24.2-1.8c-22.2-16.2-40.4-37.5-53-62.2L320 448l0-80 0-128 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faBuildingCircleArrowRight = {
  prefix: 'fas',
  iconName: 'building-circle-arrow-right',
  icon: [640, 512, [], "e4d1", "M0 48C0 21.5 21.5 0 48 0L336 0c26.5 0 48 21.5 48 48l0 184.2c-39.1 32.3-64 81.1-64 135.8c0 49.5 20.4 94.2 53.3 126.2C364.5 505.1 351.1 512 336 512l-96 0 0-80c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 80-96 0c-26.5 0-48-21.5-48-48L0 48zM80 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm112-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L80 96c-8.8 0-16 7.2-16 16zM176 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm96 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm140.7-67.3c-6.2 6.2-6.2 16.4 0 22.6L521.4 352 432 352c-8.8 0-16 7.2-16 16s7.2 16 16 16l89.4 0-28.7 28.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l56-56c6.2-6.2 6.2-16.4 0-22.6l-56-56c-6.2-6.2-16.4-6.2-22.6 0z"]
};
const faVolleyball = {
  prefix: 'fas',
  iconName: 'volleyball',
  icon: [512, 512, [127952, "volleyball-ball"], "f45f", "M511.8 267.4c-26.1 8.7-53.4 13.8-81 15.1c9.2-105.3-31.5-204.2-103.2-272.4C434.1 41.1 512 139.5 512 256c0 3.8-.1 7.6-.2 11.4zm-3.9 34.7c-5.8 32-17.6 62-34.2 88.7c-97.5 48.5-217.7 42.6-311.9-24.5c23.7-36.2 55.4-67.7 94.5-91.8c79.9 43.2 170.1 50.8 251.6 27.6zm-236-55.5c-2.5-90.9-41.1-172.7-101.9-231.7C196.8 5.2 225.8 0 256 0c2.7 0 5.3 0 7.9 .1c90.8 60.2 145.7 167.2 134.7 282.3c-43.1-2.4-86.4-14.1-126.8-35.9zM138 28.8c20.6 18.3 38.7 39.4 53.7 62.6C95.9 136.1 30.6 220.8 7.3 316.9C2.5 297.4 0 277 0 256C0 157.2 56 71.5 138 28.8zm69.6 90.5c19.5 38.6 31 81.9 32.3 127.7C162.5 294.6 110.9 368.9 90.2 451C66 430.4 45.6 405.4 30.4 377.2c6.7-108.7 71.9-209.9 177.1-257.9zM256 512c-50.7 0-98-14.7-137.8-40.2c5.6-27 14.8-53.1 27.4-77.7C232.2 454.6 338.1 468.8 433 441c-46 44-108.3 71-177 71z"]
};
const faVolleyballBall = faVolleyball;
const faArrowsUpToLine = {
  prefix: 'fas',
  iconName: 'arrows-up-to-line',
  icon: [576, 512, [], "e4c2", "M32 96l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96zM9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 237.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0l-96 96zm320 45.3c12.5 12.5 32.8 12.5 45.3 0L416 237.3 416 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3z"]
};
const faSortDown = {
  prefix: 'fas',
  iconName: 'sort-down',
  icon: [320, 512, ["sort-desc"], "f0dd", "M182.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l256 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128z"]
};
const faSortDesc = faSortDown;
const faCircleMinus = {
  prefix: 'fas',
  iconName: 'circle-minus',
  icon: [512, 512, ["minus-circle"], "f056", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faMinusCircle = faCircleMinus;
const faDoorOpen = {
  prefix: 'fas',
  iconName: 'door-open',
  icon: [576, 512, [], "f52b", "M320 32c0-9.9-4.5-19.2-12.3-25.2S289.8-1.4 280.2 1l-179.9 45C79 51.3 64 70.5 64 92.5L64 448l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 192 0 32 0 0-32 0-448zM256 256c0 17.7-10.7 32-24 32s-24-14.3-24-32s10.7-32 24-32s24 14.3 24 32zm96-128l96 0 0 352c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-320c0-35.3-28.7-64-64-64l-96 0 0 64z"]
};
const faRightFromBracket = {
  prefix: 'fas',
  iconName: 'right-from-bracket',
  icon: [512, 512, ["sign-out-alt"], "f2f5", "M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]
};
const faSignOutAlt = faRightFromBracket;
const faAtom = {
  prefix: 'fas',
  iconName: 'atom',
  icon: [512, 512, [9883], "f5d2", "M256 398.8c-11.8 5.1-23.4 9.7-34.9 13.5c16.7 33.8 31 35.7 34.9 35.7s18.1-1.9 34.9-35.7c-11.4-3.9-23.1-8.4-34.9-13.5zM446 256c33 45.2 44.3 90.9 23.6 128c-20.2 36.3-62.5 49.3-115.2 43.2c-22 52.1-55.6 84.8-98.4 84.8s-76.4-32.7-98.4-84.8c-52.7 6.1-95-6.8-115.2-43.2C21.7 346.9 33 301.2 66 256c-33-45.2-44.3-90.9-23.6-128c20.2-36.3 62.5-49.3 115.2-43.2C179.6 32.7 213.2 0 256 0s76.4 32.7 98.4 84.8c52.7-6.1 95 6.8 115.2 43.2c20.7 37.1 9.4 82.8-23.6 128zm-65.8 67.4c-1.7 14.2-3.9 28-6.7 41.2c31.8 1.4 38.6-8.7 40.2-11.7c2.3-4.2 7-17.9-11.9-48.1c-6.8 6.3-14 12.5-21.6 18.6zm-6.7-175.9c2.8 13.1 5 26.9 6.7 41.2c7.6 6.1 14.8 12.3 21.6 18.6c18.9-30.2 14.2-44 11.9-48.1c-1.6-2.9-8.4-13-40.2-11.7zM290.9 99.7C274.1 65.9 259.9 64 256 64s-18.1 1.9-34.9 35.7c11.4 3.9 23.1 8.4 34.9 13.5c11.8-5.1 23.4-9.7 34.9-13.5zm-159 88.9c1.7-14.3 3.9-28 6.7-41.2c-31.8-1.4-38.6 8.7-40.2 11.7c-2.3 4.2-7 17.9 11.9 48.1c6.8-6.3 14-12.5 21.6-18.6zM110.2 304.8C91.4 335 96 348.7 98.3 352.9c1.6 2.9 8.4 13 40.2 11.7c-2.8-13.1-5-26.9-6.7-41.2c-7.6-6.1-14.8-12.3-21.6-18.6zM336 256a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zm-80-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSoap = {
  prefix: 'fas',
  iconName: 'soap',
  icon: [512, 512, [129532], "e06e", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM320 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM416 32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0 160c0 27.6-11.7 52.5-30.4 70.1C422.1 275.7 448 310.8 448 352c0 53-43 96-96 96l-192 0c-53 0-96-43-96-96s43-96 96-96l88.4 0c-15.2-17-24.4-39.4-24.4-64L96 192c-53 0-96 43-96 96L0 416c0 53 43 96 96 96l320 0c53 0 96-43 96-96l0-128c0-53-43-96-96-96zM160 288c-35.3 0-64 28.7-64 64s28.7 64 64 64l192 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-160 0z"]
};
const faIcons = {
  prefix: 'fas',
  iconName: 'icons',
  icon: [512, 512, ["heart-music-camera-bolt"], "f86d", "M500.3 7.3C507.7 13.3 512 22.4 512 32l0 144c0 26.5-28.7 48-64 48s-64-21.5-64-48s28.7-48 64-48l0-57L352 90.2 352 208c0 26.5-28.7 48-64 48s-64-21.5-64-48s28.7-48 64-48l0-96c0-15.3 10.8-28.4 25.7-31.4l160-32c9.4-1.9 19.1 .6 26.6 6.6zM74.7 304l11.8-17.8c5.9-8.9 15.9-14.2 26.6-14.2l61.7 0c10.7 0 20.7 5.3 26.6 14.2L213.3 304l26.7 0c26.5 0 48 21.5 48 48l0 112c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 352c0-26.5 21.5-48 48-48l26.7 0zM192 408a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM478.7 278.3L440.3 368l55.7 0c6.7 0 12.6 4.1 15 10.4s.6 13.3-4.4 17.7l-128 112c-5.6 4.9-13.9 5.3-19.9 .9s-8.2-12.4-5.3-19.2L391.7 400 336 400c-6.7 0-12.6-4.1-15-10.4s-.6-13.3 4.4-17.7l128-112c5.6-4.9 13.9-5.3 19.9-.9s8.2 12.4 5.3 19.2zm-339-59.2c-6.5 6.5-17 6.5-23 0L19.9 119.2c-28-29-26.5-76.9 5-103.9c27-23.5 68.4-19 93.4 6.5l10 10.5 9.5-10.5c25-25.5 65.9-30 93.9-6.5c31 27 32.5 74.9 4.5 103.9l-96.4 99.9z"]
};
const faHeartMusicCameraBolt = faIcons;
const faMicrophoneLinesSlash = {
  prefix: 'fas',
  iconName: 'microphone-lines-slash',
  icon: [640, 512, ["microphone-alt-slash"], "f539", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c15.2-26 23.9-56.3 23.9-88.7l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24 0 16c0 21.2-5.1 41.1-14.2 58.7L416 300.8l0-44.8-57.1 0-34.5-27c2.9-3.1 7-5 11.6-5l80 0 0-32-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-32-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0c0-53-43-96-96-96s-96 43-96 96l0 54.3L38.8 5.1zm362.5 407l-43.1-33.9C346.1 382 333.3 384 320 384c-70.7 0-128-57.3-128-128l0-8.7L144.7 210c-.5 1.9-.7 3.9-.7 6l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c20.4-2.8 39.7-9.1 57.3-18.2z"]
};
const faMicrophoneAltSlash = faMicrophoneLinesSlash;
const faBridgeCircleCheck = {
  prefix: 'fas',
  iconName: 'bridge-circle-check',
  icon: [640, 512, [], "e4c9", "M64 32C46.3 32 32 46.3 32 64s14.3 32 32 32l40 0 0 64-72 0 0 128c53 0 96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96c6.3 0 12.4 .6 18.3 1.7C367.1 231.8 426.9 192 496 192c42.5 0 81.6 15.1 112 40.2l0-72.2-72 0 0-64 40 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32zM488 96l0 64-80 0 0-64 80 0zM360 96l0 64-80 0 0-64 80 0zM232 96l0 64-80 0 0-64 80 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faPumpMedical = {
  prefix: 'fas',
  iconName: 'pump-medical',
  icon: [448, 512, [], "e06a", "M128 32l0 96 128 0 0-32 60.1 0c4.2 0 8.3 1.7 11.3 4.7l33.9 33.9c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L372.7 55.4c-15-15-35.4-23.4-56.6-23.4L256 32c0-17.7-14.3-32-32-32L160 0c-17.7 0-32 14.3-32 32zM117.4 160c-33.3 0-61 25.5-63.8 58.7L35 442.7C31.9 480 61.3 512 98.8 512l186.4 0c37.4 0 66.9-32 63.8-69.3l-18.7-224c-2.8-33.2-30.5-58.7-63.8-58.7l-149.1 0zM216 280l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faFingerprint = {
  prefix: 'fas',
  iconName: 'fingerprint',
  icon: [512, 512, [], "f577", "M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256l0 24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"]
};
const faHandPointRight = {
  prefix: 'fas',
  iconName: 'hand-point-right',
  icon: [512, 512, [], "f0a4", "M480 96c17.7 0 32 14.3 32 32s-14.3 32-32 32l-208 0 0-64 208 0zM320 288c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0zm64-64c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l48 0c17.7 0 32 14.3 32 32zM288 384c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0zm-88-96l.6 0c-5.4 9.4-8.6 20.3-8.6 32c0 13.2 4 25.4 10.8 35.6C177.9 364.3 160 388.1 160 416c0 11.7 3.1 22.6 8.6 32l-8.6 0C71.6 448 0 376.4 0 288l0-61.7c0-42.4 16.9-83.1 46.9-113.1l11.6-11.6C82.5 77.5 115.1 64 149 64l27 0c35.3 0 64 28.7 64 64l0 88c0 22.1-17.9 40-40 40s-40-17.9-40-40l0-56c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 56c0 39.8 32.2 72 72 72z"]
};
const faMagnifyingGlassLocation = {
  prefix: 'fas',
  iconName: 'magnifying-glass-location',
  icon: [512, 512, ["search-location"], "f689", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM288 176c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 48.8 46.5 111.6 68.6 138.6c6 7.3 16.8 7.3 22.7 0c22.1-27 68.6-89.8 68.6-138.6zm-112 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faSearchLocation = faMagnifyingGlassLocation;
const faForwardStep = {
  prefix: 'fas',
  iconName: 'forward-step',
  icon: [320, 512, ["step-forward"], "f051", "M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416L0 96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4l192 160L256 241l0-145c0-17.7 14.3-32 32-32s32 14.3 32 32l0 320c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-145-11.5 9.6-192 160z"]
};
const faStepForward = faForwardStep;
const faFaceSmileBeam = {
  prefix: 'fas',
  iconName: 'face-smile-beam',
  icon: [512, 512, [128522, "smile-beam"], "f5b8", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zm53.5-96.7s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faSmileBeam = faFaceSmileBeam;
const faFlagCheckered = {
  prefix: 'fas',
  iconName: 'flag-checkered',
  icon: [448, 512, [127937], "f11e", "M32 0C49.7 0 64 14.3 64 32l0 16 69-17.2c38.1-9.5 78.3-5.1 113.5 12.5c46.3 23.2 100.8 23.2 147.1 0l9.6-4.8C423.8 28.1 448 43.1 448 66.1l0 279.7c0 13.3-8.3 25.3-20.8 30l-34.7 13c-46.2 17.3-97.6 14.6-141.7-7.4c-37.9-19-81.3-23.7-122.5-13.4L64 384l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-80 0-66L0 64 0 32C0 14.3 14.3 0 32 0zM64 187.1l64-13.9 0 65.5L64 252.6 64 318l48.8-12.2c5.1-1.3 10.1-2.4 15.2-3.3l0-63.9 38.9-8.4c8.3-1.8 16.7-2.5 25.1-2.1l0-64c13.6 .4 27.2 2.6 40.4 6.4l23.6 6.9 0 66.7-41.7-12.3c-7.3-2.1-14.8-3.4-22.3-3.8l0 71.4c21.8 1.9 43.3 6.7 64 14.4l0-69.8 22.7 6.7c13.5 4 27.3 6.4 41.3 7.4l0-64.2c-7.8-.8-15.6-2.3-23.2-4.5l-40.8-12 0-62c-13-3.8-25.8-8.8-38.2-15c-8.2-4.1-16.9-7-25.8-8.8l0 72.4c-13-.4-26 .8-38.7 3.6L128 173.2 128 98 64 114l0 73.1zM320 335.7c16.8 1.5 33.9-.7 50-6.8l14-5.2 0-71.7-7.9 1.8c-18.4 4.3-37.3 5.7-56.1 4.5l0 77.4zm64-149.4l0-70.8c-20.9 6.1-42.4 9.1-64 9.1l0 69.4c13.9 1.4 28 .5 41.7-2.6l22.3-5.2z"]
};
const faFootball = {
  prefix: 'fas',
  iconName: 'football',
  icon: [512, 512, [127944, "football-ball"], "f44e", "M247.5 25.4c-13.5 3.3-26.4 7.2-38.6 11.7C142.9 61.6 96.7 103.6 66 153.6C47.8 183.4 35.1 215.9 26.9 249L264.5 486.6c13.5-3.3 26.4-7.2 38.6-11.7c66-24.5 112.2-66.5 142.9-116.5c18.3-29.8 30.9-62.3 39.1-95.3L247.5 25.4zM495.2 205.3c6.1-56.8 1.4-112.2-7.7-156.4c-2.7-12.9-13-22.9-26.1-25.1c-58.2-9.7-109.9-12-155.6-7.9L495.2 205.3zM206.1 496L16.8 306.7c-6.1 56.8-1.4 112.2 7.7 156.4c2.7 12.9 13 22.9 26.1 25.1c58.2 9.7 109.9 12 155.6 7.9zm54.6-331.3c6.2-6.2 16.4-6.2 22.6 0l64 64c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-64-64c-6.2-6.2-6.2-16.4 0-22.6zm-48 48c6.2-6.2 16.4-6.2 22.6 0l64 64c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-64-64c-6.2-6.2-6.2-16.4 0-22.6zm-48 48c6.2-6.2 16.4-6.2 22.6 0l64 64c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-64-64c-6.2-6.2-6.2-16.4 0-22.6z"]
};
const faFootballBall = faFootball;
const faSchoolCircleExclamation = {
  prefix: 'fas',
  iconName: 'school-circle-exclamation',
  icon: [640, 512, [], "e56c", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l272 0s0 0 0 0l-64 0 0-96c0-35.3 28.7-64 64-64l.3 0 .5 0c3.4-37.7 18.7-72.1 42.2-99.1C350.2 260 335.6 264 320 264c-48.6 0-88-39.4-88-88s39.4-88 88-88s88 39.4 88 88c0 18.3-5.6 35.3-15.1 49.4c29-21 64.6-33.4 103.1-33.4c59.5 0 112.1 29.6 144 74.8L640 144c0-26.5-21.5-48-48-48L473.7 96 337.8 5.4zM96 192l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm0 128l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zM320 128c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16c0-8.8-7.2-16-16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faCrop = {
  prefix: 'fas',
  iconName: 'crop',
  icon: [512, 512, [], "f125", "M448 109.3l54.6-54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L402.7 64 160 64l0 64 178.7 0L128 338.7 128 32c0-17.7-14.3-32-32-32S64 14.3 64 32l0 32L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l32 0 0 256c0 35.3 28.7 64 64 64l224 0 0-64-178.7 0L384 173.3 384 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-274.7z"]
};
const faAnglesDown = {
  prefix: 'fas',
  iconName: 'angles-down',
  icon: [448, 512, ["angle-double-down"], "f103", "M246.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L224 402.7 361.4 265.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-160 160zm160-352l-160 160c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L224 210.7 361.4 73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3z"]
};
const faAngleDoubleDown = faAnglesDown;
const faUsersRectangle = {
  prefix: 'fas',
  iconName: 'users-rectangle',
  icon: [640, 512, [], "e594", "M96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96l448 0c53 0 96-43 96-96l0-320c0-53-43-96-96-96L96 0zM64 96c0-17.7 14.3-32 32-32l448 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32L64 96zm159.8 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM96 309.3c0 14.7 11.9 26.7 26.7 26.7l56.1 0c8-34.1 32.8-61.7 65.2-73.6c-7.5-4.1-16.2-6.4-25.3-6.4l-69.3 0C119.9 256 96 279.9 96 309.3zM461.2 336l56.1 0c14.7 0 26.7-11.9 26.7-26.7c0-29.5-23.9-53.3-53.3-53.3l-69.3 0c-9.2 0-17.8 2.3-25.3 6.4c32.4 11.9 57.2 39.5 65.2 73.6zM372 289c-3.9-.7-7.9-1-12-1l-80 0c-4.1 0-8.1 .3-12 1c-26 4.4-47.3 22.7-55.9 47c-2.7 7.5-4.1 15.6-4.1 24c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24c0-8.4-1.4-16.5-4.1-24c-8.6-24.3-29.9-42.6-55.9-47zM512 176a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM320 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128z"]
};
const faPeopleRoof = {
  prefix: 'fas',
  iconName: 'people-roof',
  icon: [640, 512, [], "e537", "M335.5 4l288 160c15.4 8.6 21 28.1 12.4 43.5s-28.1 21-43.5 12.4L320 68.6 47.5 220c-15.4 8.6-34.9 3-43.5-12.4s-3-34.9 12.4-43.5L304.5 4c9.7-5.4 21.4-5.4 31.1 0zM320 160a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM144 256a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm312 40a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM226.9 491.4L200 441.5l0 38.5c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32l0-38.5L61.1 491.4c-6.3 11.7-20.8 16-32.5 9.8s-16-20.8-9.8-32.5l37.9-70.3c15.3-28.5 45.1-46.3 77.5-46.3l19.5 0c16.3 0 31.9 4.5 45.4 12.6l33.6-62.3c15.3-28.5 45.1-46.3 77.5-46.3l19.5 0c32.4 0 62.1 17.8 77.5 46.3l33.6 62.3c13.5-8.1 29.1-12.6 45.4-12.6l19.5 0c32.4 0 62.1 17.8 77.5 46.3l37.9 70.3c6.3 11.7 1.9 26.2-9.8 32.5s-26.2 1.9-32.5-9.8L552 441.5l0 38.5c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32l0-38.5-26.9 49.9c-6.3 11.7-20.8 16-32.5 9.8s-16-20.8-9.8-32.5l36.3-67.5c-1.7-1.7-3.2-3.6-4.3-5.8L376 345.5l0 54.5c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32l0-54.5-26.9 49.9c-1.2 2.2-2.6 4.1-4.3 5.8l36.3 67.5c6.3 11.7 1.9 26.2-9.8 32.5s-26.2 1.9-32.5-9.8z"]
};
const faPeopleLine = {
  prefix: 'fas',
  iconName: 'people-line',
  icon: [640, 512, [], "e534", "M360 72a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zM144 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416zM496 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM200 313.5l26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-36.3-67.5c1.7-1.7 3.2-3.6 4.3-5.8L264 217.5l0 54.5c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-54.5 26.9 49.9c1.2 2.2 2.6 4.1 4.3 5.8l-36.3 67.5c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L440 313.5l0 38.5c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-38.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-16.3 0-31.9 4.5-45.4 12.6l-33.6-62.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3l-33.6 62.3c-13.5-8.1-29.1-12.6-45.4-12.6l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3L18.9 340.6c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L88 313.5 88 352c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-38.5z"]
};
const faBeerMugEmpty = {
  prefix: 'fas',
  iconName: 'beer-mug-empty',
  icon: [512, 512, ["beer"], "f0fc", "M32 64c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32l0 32 51.2 0c42.4 0 76.8 34.4 76.8 76.8l0 102.1c0 30.4-17.9 57.9-45.6 70.2L384 381.7l0 34.3c0 35.3-28.7 64-64 64L96 480c-35.3 0-64-28.7-64-64L32 64zM384 311.6l56.4-25.1c4.6-2.1 7.6-6.6 7.6-11.7l0-102.1c0-7.1-5.7-12.8-12.8-12.8L384 160l0 151.6zM160 144c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224zm64 0c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224zm64 0c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224z"]
};
const faBeer = faBeerMugEmpty;
const faDiagramPredecessor = {
  prefix: 'fas',
  iconName: 'diagram-predecessor',
  icon: [512, 512, [], "e477", "M448 416l0-64L64 352l0 64 384 0zm0 64L64 480c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64zM288 160c0 35.3-28.7 64-64 64L64 224c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l144 0 16 0 144 0c44.2 0 80 35.8 80 80l0 16 38.1 0c21.4 0 32.1 25.9 17 41L433 239c-9.4 9.4-24.6 9.4-33.9 0L329 169c-15.1-15.1-4.4-41 17-41l38.1 0 0-16c0-8.8-7.2-16-16-16l-80 0 0 64z"]
};
const faArrowUpLong = {
  prefix: 'fas',
  iconName: 'arrow-up-long',
  icon: [384, 512, ["long-arrow-up"], "f176", "M214.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-370.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128z"]
};
const faLongArrowUp = faArrowUpLong;
const faFireFlameSimple = {
  prefix: 'fas',
  iconName: 'fire-flame-simple',
  icon: [384, 512, ["burn"], "f46a", "M372.5 256.5l-.7-1.9C337.8 160.8 282 76.5 209.1 8.5l-3.3-3C202.1 2 197.1 0 192 0s-10.1 2-13.8 5.5l-3.3 3C102 76.5 46.2 160.8 12.2 254.6l-.7 1.9C3.9 277.3 0 299.4 0 321.6C0 426.7 86.8 512 192 512s192-85.3 192-190.4c0-22.2-3.9-44.2-11.5-65.1zm-90.8 49.5c4.1 9.3 6.2 19.4 6.2 29.5c0 53-43 96.5-96 96.5s-96-43.5-96-96.5c0-10.1 2.1-20.3 6.2-29.5l1.9-4.3c15.8-35.4 37.9-67.7 65.3-95.1l8.9-8.9c3.6-3.6 8.5-5.6 13.6-5.6s10 2 13.6 5.6l8.9 8.9c27.4 27.4 49.6 59.7 65.3 95.1l1.9 4.3z"]
};
const faBurn = faFireFlameSimple;
const faPerson = {
  prefix: 'fas',
  iconName: 'person',
  icon: [320, 512, [129485, "male"], "f183", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l58.3 97c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0z"]
};
const faMale = faPerson;
const faLaptop = {
  prefix: 'fas',
  iconName: 'laptop',
  icon: [640, 512, [128187], "f109", "M128 32C92.7 32 64 60.7 64 96l0 256 64 0 0-256 384 0 0 256 64 0 0-256c0-35.3-28.7-64-64-64L128 32zM19.2 384C8.6 384 0 392.6 0 403.2C0 445.6 34.4 480 76.8 480l486.4 0c42.4 0 76.8-34.4 76.8-76.8c0-10.6-8.6-19.2-19.2-19.2L19.2 384z"]
};
const faFileCsv = {
  prefix: 'fas',
  iconName: 'file-csv',
  icon: [512, 512, [], "f6dd", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 144-208 0c-35.3 0-64 28.7-64 64l0 144-48 0c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM200 352l16 0c22.1 0 40 17.9 40 40l0 8c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-8c0-4.4-3.6-8-8-8l-16 0c-4.4 0-8 3.6-8 8l0 80c0 4.4 3.6 8 8 8l16 0c4.4 0 8-3.6 8-8l0-8c0-8.8 7.2-16 16-16s16 7.2 16 16l0 8c0 22.1-17.9 40-40 40l-16 0c-22.1 0-40-17.9-40-40l0-80c0-22.1 17.9-40 40-40zm133.1 0l34.9 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-34.9 0c-7.2 0-13.1 5.9-13.1 13.1c0 5.2 3 9.9 7.8 12l37.4 16.6c16.3 7.2 26.8 23.4 26.8 41.2c0 24.9-20.2 45.1-45.1 45.1L304 512c-8.8 0-16-7.2-16-16s7.2-16 16-16l42.9 0c7.2 0 13.1-5.9 13.1-13.1c0-5.2-3-9.9-7.8-12l-37.4-16.6c-16.3-7.2-26.8-23.4-26.8-41.2c0-24.9 20.2-45.1 45.1-45.1zm98.9 0c8.8 0 16 7.2 16 16l0 31.6c0 23 5.5 45.6 16 66c10.5-20.3 16-42.9 16-66l0-31.6c0-8.8 7.2-16 16-16s16 7.2 16 16l0 31.6c0 34.7-10.3 68.7-29.6 97.6l-5.1 7.7c-3 4.5-8 7.1-13.3 7.1s-10.3-2.7-13.3-7.1l-5.1-7.7c-19.3-28.9-29.6-62.9-29.6-97.6l0-31.6c0-8.8 7.2-16 16-16z"]
};
const faMenorah = {
  prefix: 'fas',
  iconName: 'menorah',
  icon: [640, 512, [], "f676", "M20.8 7.4C22.8 2.9 27.1 0 32 0s9.2 2.9 11.2 7.4L61.3 49.7c1.8 4.1 2.7 8.6 2.7 13.1L64 64c0 17.7-14.3 32-32 32S0 81.7 0 64l0-1.2c0-4.5 .9-8.9 2.7-13.1L20.8 7.4zm96 0C118.8 2.9 123.1 0 128 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1L116.8 7.4zm77.8 42.4L212.8 7.4C214.8 2.9 219.1 0 224 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1zM308.8 7.4C310.8 2.9 315.1 0 320 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1L308.8 7.4zm77.8 42.4L404.8 7.4C406.8 2.9 411.1 0 416 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1zM500.8 7.4C502.8 2.9 507.1 0 512 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1L500.8 7.4zm77.8 42.4L596.8 7.4C598.8 2.9 603.1 0 608 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1zM32 128c17.7 0 32 14.3 32 32l0 128c0 17.7 14.3 32 32 32l192 0 0-160c0-17.7 14.3-32 32-32s32 14.3 32 32l0 160 192 0c17.7 0 32-14.3 32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 53-43 96-96 96l-192 0 0 64 128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0-160 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l128 0 0-64L96 384c-53 0-96-43-96-96L0 160c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 96 0 32-64 0 0-32 0-96c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 96 0 32-64 0 0-32 0-96c0-17.7 14.3-32 32-32zm192 0c17.7 0 32 14.3 32 32l0 96 0 32-64 0 0-32 0-96c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 96 0 32-64 0 0-32 0-96c0-17.7 14.3-32 32-32z"]
};
const faTruckPlane = {
  prefix: 'fas',
  iconName: 'truck-plane',
  icon: [640, 512, [], "e58f", "M200 0c-30.6 0-56 54.7-56 86.1l0 106.5L7.8 274.3C2.9 277.2 0 282.4 0 288l0 64c0 5.1 2.4 9.8 6.4 12.8s9.3 3.9 14.1 2.5l123.4-37 0 81.2-50 40c-3.8 3-6 7.6-6 12.5l0 32c0 5.1 2.5 10 6.6 13s9.5 3.8 14.4 2.2L200 480.9 290.4 511c-1.6-4.7-2.4-9.8-2.4-15l0-32.6c-18.2-10.5-30.7-29.7-31.9-51.8l-.1-.1 0-3.5 0-82.5L256 184l0-1.1s0 0 0 0l0-96.9C256 54.7 231.5 0 200 0zm88 176l0 224c0 20.9 13.4 38.7 32 45.3l0 42.7c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-40 160 0 0 40c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-42.7c18.6-6.6 32-24.4 32-45.3l0-224c0-26.5-21.5-48-48-48l-256 0c-26.5 0-48 21.5-48 48zm79.8 78.7c3.3-8.7 11.2-14.7 20.5-14.7l151.4 0c9.2 0 17.2 6 20.5 14.7L576 304l-224 0 15.8-49.3zM568 352a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM336 376a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faRecordVinyl = {
  prefix: 'fas',
  iconName: 'record-vinyl',
  icon: [512, 512, [], "f8d9", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm0 224a128 128 0 1 0 0-256 128 128 0 1 0 0 256zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faFaceGrinStars = {
  prefix: 'fas',
  iconName: 'face-grin-stars',
  icon: [512, 512, [129321, "grin-stars"], "f587", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm407.4 75.5c5-11.8-7-22.5-19.3-18.7c-39.7 12.2-84.5 19-131.8 19s-92.1-6.8-131.8-19c-12.3-3.8-24.3 6.9-19.3 18.7c25 59.1 83.2 100.5 151.1 100.5s126.2-41.4 151.1-100.5zM160 120c-3.1 0-5.9 1.8-7.2 4.6l-16.6 34.7-38.1 5c-3.1 .4-5.6 2.5-6.6 5.5s-.1 6.2 2.1 8.3l27.9 26.5-7 37.8c-.6 3 .7 6.1 3.2 7.9s5.8 2 8.5 .6L160 232.5l33.8 18.3c2.7 1.5 6 1.3 8.5-.6s3.7-4.9 3.2-7.9l-7-37.8L226.4 178c2.2-2.1 3.1-5.3 2.1-8.3s-3.5-5.1-6.6-5.5l-38.1-5-16.6-34.7c-1.3-2.8-4.1-4.6-7.2-4.6zm192 0c-3.1 0-5.9 1.8-7.2 4.6l-16.6 34.7-38.1 5c-3.1 .4-5.6 2.5-6.6 5.5s-.1 6.2 2.1 8.3l27.9 26.5-7 37.8c-.6 3 .7 6.1 3.2 7.9s5.8 2 8.5 .6L352 232.5l33.8 18.3c2.7 1.5 6 1.3 8.5-.6s3.7-4.9 3.2-7.9l-7-37.8L418.4 178c2.2-2.1 3.1-5.3 2.1-8.3s-3.5-5.1-6.6-5.5l-38.1-5-16.6-34.7c-1.3-2.8-4.1-4.6-7.2-4.6z"]
};
const faGrinStars = faFaceGrinStars;
const faBong = {
  prefix: 'fas',
  iconName: 'bong',
  icon: [448, 512, [], "f55c", "M160 208.5c0 29.1-15.6 53.9-37.2 67.8c-17.2 11.1-31.5 26.1-41.7 43.7l221.8 0c-10.2-17.6-24.5-32.6-41.7-43.7c-21.6-13.9-37.2-38.7-37.2-67.8L224 64l-64 0 0 144.5zM288 64l0 144.5c0 5.7 3.1 10.9 7.9 14c11.2 7.2 21.5 15.5 30.9 24.8L366.1 208l-7-7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l24 24 24 24c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-7-7-43.3 43.3C374 314.1 384 347.9 384 384c0 39.4-11.9 76.1-32.2 106.5c-9.6 14.4-26.5 21.5-43.8 21.5L76.1 512c-17.3 0-34.2-7.1-43.8-21.5C11.9 460.1 0 423.4 0 384c0-67.8 35.1-127.3 88.1-161.5c4.8-3.1 7.9-8.3 7.9-14L96 64C78.3 64 64 49.7 64 32S78.3 0 96 0l16 0L272 0l16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]
};
const faSpaghettiMonsterFlying = {
  prefix: 'fas',
  iconName: 'spaghetti-monster-flying',
  icon: [640, 512, ["pastafarianism"], "f67b", "M208 64a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 0c0 16.2-6 31.1-16 42.3l15.6 31.2c18.7-6 39.9-9.5 64.4-9.5s45.8 3.5 64.4 9.5L400 106.3C390 95.1 384 80.2 384 64c0-35.3 28.7-64 64-64s64 28.7 64 64s-28.7 64-64 64c-1.7 0-3.4-.1-5.1-.2L427.8 158c21.1 13.6 37.7 30.2 51.4 46.4c7.1 8.3 13.5 16.6 19.3 24l1.4 1.8c6.3 8.1 11.6 14.8 16.7 20.4C527.3 262.3 532.7 264 536 264c2.5 0 4.3-.6 7.1-3.3c3.7-3.5 7.1-8.8 12.5-17.4l.6-.9c4.6-7.4 11-17.6 19.4-25.7c9.7-9.3 22.9-16.7 40.4-16.7c13.3 0 24 10.7 24 24s-10.7 24-24 24c-2.5 0-4.3 .6-7.1 3.3c-3.7 3.5-7.1 8.8-12.5 17.4l-.6 .9c-4.6 7.4-11 17.6-19.4 25.7c-9.7 9.3-22.9 16.7-40.4 16.7c-18.5 0-32.9-8.5-44.3-18.6c-3.1 4-6.6 8.3-10.5 12.7c1.4 4.3 2.8 8.5 4 12.5c.9 3 1.8 5.8 2.6 8.6c3 9.8 5.5 18.2 8.6 25.9c3.9 9.8 7.4 15.4 10.8 18.5c2.6 2.4 5.9 4.3 12.8 4.3c8.7 0 16.9-4.2 33.7-13.2c15-8 35.7-18.8 62.3-18.8c13.3 0 24 10.7 24 24s-10.7 24-24 24c-13.4 0-24.7 5.2-39.7 13.2c-1 .6-2.1 1.1-3.2 1.7C559.9 414 541.4 424 520 424c-18.4 0-33.6-6.1-45.5-17.2c-11.1-10.3-17.9-23.7-22.7-36c-3.6-9-6.7-19.1-9.5-28.5c-16.4 12.3-36.1 23.6-58.9 31.3c3.6 10.8 8.4 23.5 14.4 36.2c7.5 15.9 16.2 30.4 25.8 40.5C433 460.5 441.2 464 448 464c13.3 0 24 10.7 24 24s-10.7 24-24 24c-25.2 0-45-13.5-59.5-28.8c-14.5-15.4-25.7-34.9-34.2-53c-8-17-14.1-33.8-18.3-46.9c-5.2 .4-10.6 .6-16 .6s-10.8-.2-16-.6c-4.2 13-10.3 29.9-18.3 46.9c-8.5 18.1-19.8 37.6-34.2 53C237 498.5 217.2 512 192 512c-13.3 0-24-10.7-24-24s10.7-24 24-24c6.8 0 15-3.5 24.5-13.7c9.5-10.1 18.3-24.6 25.8-40.5c5.9-12.6 10.7-25.4 14.4-36.2c-22.8-7.7-42.5-19-58.9-31.3c-2.9 9.4-6 19.5-9.5 28.5c-4.8 12.2-11.6 25.6-22.7 36C153.6 417.9 138.4 424 120 424c-21.4 0-39.9-10-53.1-17.1c0 0 0 0 0 0c-1.1-.6-2.2-1.2-3.2-1.7c-15-8-26.3-13.2-39.7-13.2c-13.3 0-24-10.7-24-24s10.7-24 24-24c26.6 0 47.3 10.8 62.3 18.8c16.8 9 25 13.2 33.7 13.2c6.8 0 10.2-1.9 12.8-4.3c3.4-3.2 7-8.8 10.8-18.5c3-7.7 5.6-16.1 8.6-25.9c.8-2.7 1.7-5.6 2.6-8.6c1.2-4 2.6-8.2 4-12.5c-3.9-4.5-7.4-8.8-10.5-12.7C136.9 303.5 122.5 312 104 312c-17.5 0-30.7-7.4-40.4-16.7c-8.4-8.1-14.8-18.3-19.4-25.7l-.6-.9c-5.4-8.6-8.8-13.9-12.5-17.4c-2.8-2.7-4.6-3.3-7.1-3.3c-13.3 0-24-10.7-24-24s10.7-24 24-24c17.5 0 30.7 7.4 40.4 16.7c8.4 8.1 14.8 18.3 19.4 25.7l.6 .9c5.4 8.6 8.8 13.9 12.5 17.4c2.8 2.7 4.6 3.3 7.1 3.3c3.3 0 8.7-1.7 19.4-13.4c5.1-5.6 10.4-12.3 16.7-20.4l1.4-1.8c5.8-7.4 12.2-15.7 19.3-24c13.8-16.2 30.3-32.8 51.4-46.4l-15.1-30.2c-1.7 .1-3.4 .2-5.1 .2c-35.3 0-64-28.7-64-64s28.7-64 64-64s64 28.7 64 64zm208 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faPastafarianism = faSpaghettiMonsterFlying;
const faArrowDownUpAcrossLine = {
  prefix: 'fas',
  iconName: 'arrow-down-up-across-line',
  icon: [576, 512, [], "e4af", "M137.4 502.6c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7 192 288l352 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0 0-114.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L384 109.3 384 224l-192 0-64 0-96 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 0 114.7L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96zM128 192l64 0 0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 128zM448 320l-64 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128z"]
};
const faSpoon = {
  prefix: 'fas',
  iconName: 'spoon',
  icon: [512, 512, [129348, 61873, "utensil-spoon"], "f2e5", "M245.8 220.9c-14.5-17.6-21.8-39.2-21.8-60.8C224 80 320 0 416 0c53 0 96 43 96 96c0 96-80 192-160.2 192c-21.6 0-43.2-7.3-60.8-21.8L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L245.8 220.9z"]
};
const faUtensilSpoon = faSpoon;
const faJarWheat = {
  prefix: 'fas',
  iconName: 'jar-wheat',
  icon: [320, 512, [], "e517", "M32 32C32 14.3 46.3 0 64 0L256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 64C46.3 64 32 49.7 32 32zM0 160c0-35.3 28.7-64 64-64l192 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 160zm112 0l-42.2 0c-3.2 0-5.8 2.6-5.8 5.8C64 198 90 224 122.2 224l21.8 0 32 0 21.8 0c32.1 0 58.2-26 58.2-58.2c0-3.2-2.6-5.8-5.8-5.8L208 160c-19.1 0-36.3 8.4-48 21.7c-11.7-13.3-28.9-21.7-48-21.7zm48 117.7c-11.7-13.3-28.9-21.7-48-21.7l-42.2 0c-3.2 0-5.8 2.6-5.8 5.8C64 294 90 320 122.2 320l21.8 0 32 0 21.8 0c32.1 0 58.2-26 58.2-58.2c0-3.2-2.6-5.8-5.8-5.8L208 256c-19.1 0-36.3 8.4-48 21.7zM112 352l-42.2 0c-3.2 0-5.8 2.6-5.8 5.8C64 390 90 416 122.2 416l21.8 0 0 32c0 8.8 7.2 16 16 16s16-7.2 16-16l0-32 21.8 0c32.1 0 58.2-26 58.2-58.2c0-3.2-2.6-5.8-5.8-5.8L208 352c-19.1 0-36.3 8.4-48 21.7c-11.7-13.3-28.9-21.7-48-21.7z"]
};
const faEnvelopesBulk = {
  prefix: 'fas',
  iconName: 'envelopes-bulk',
  icon: [640, 512, ["mail-bulk"], "f674", "M128 0C110.3 0 96 14.3 96 32l0 192 96 0 0-32c0-35.3 28.7-64 64-64l224 0 0-96c0-17.7-14.3-32-32-32L128 0zM256 160c-17.7 0-32 14.3-32 32l0 32 96 0c35.3 0 64 28.7 64 64l0 128 192 0c17.7 0 32-14.3 32-32l0-192c0-17.7-14.3-32-32-32l-320 0zm240 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM64 256c-17.7 0-32 14.3-32 32l0 13L187.1 415.9c1.4 1 3.1 1.6 4.9 1.6s3.5-.6 4.9-1.6L352 301l0-13c0-17.7-14.3-32-32-32L64 256zm288 84.8L216 441.6c-6.9 5.1-15.3 7.9-24 7.9s-17-2.8-24-7.9L32 340.8 32 480c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32l0-139.2z"]
};
const faMailBulk = faEnvelopesBulk;
const faFileCircleExclamation = {
  prefix: 'fas',
  iconName: 'file-circle-exclamation',
  icon: [576, 512, [], "e4eb", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z"]
};
const faCircleH = {
  prefix: 'fas',
  iconName: 'circle-h',
  icon: [512, 512, [9405, "hospital-symbol"], "f47e", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM368 152l0 104 0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-80-128 0 0 80c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-208c0-13.3 10.7-24 24-24s24 10.7 24 24l0 80 128 0 0-80c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faHospitalSymbol = faCircleH;
const faPager = {
  prefix: 'fas',
  iconName: 'pager',
  icon: [512, 512, [128223], "f815", "M0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zm64 32l0 64c0 17.7 14.3 32 32 32l320 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L96 128c-17.7 0-32 14.3-32 32zM80 320c-13.3 0-24 10.7-24 24s10.7 24 24 24l56 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-56 0zm136 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0z"]
};
const faAddressBook = {
  prefix: 'fas',
  iconName: 'address-book',
  icon: [512, 512, [62138, "contact-book"], "f2b9", "M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L96 0zM208 288l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM512 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64zM496 192c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8-7.2-16-16-16zm16 144c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64z"]
};
const faContactBook = faAddressBook;
const faStrikethrough = {
  prefix: 'fas',
  iconName: 'strikethrough',
  icon: [512, 512, [], "f0cc", "M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-209.9 0-.4-.1-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3c0 0 0 0 0 0s0 0 0 0c24.9 8.5 63.6 21.7 87.6 25.6c0 0 0 0 0 0l.2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1l-75.7 0c7 5.6 11.4 11.2 13.9 17.2z"]
};
const faK = {
  prefix: 'fas',
  iconName: 'k',
  icon: [320, 512, [107], "4b", "M311 86.3c12.3-12.7 12-32.9-.7-45.2s-32.9-12-45.2 .7l-155.2 160L64 249 64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 328 0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-107 64.7-66.7 133 192c10.1 14.5 30 18.1 44.5 8.1s18.1-30 8.1-44.5L174.1 227.4 311 86.3z"]
};
const faLandmarkFlag = {
  prefix: 'fas',
  iconName: 'landmark-flag',
  icon: [512, 512, [], "e51c", "M272 0l80 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-80 0 0 32 192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L48 192c-17.7 0-32-14.3-32-32s14.3-32 32-32l192 0 0-112c0-8.8 7.2-16 16-16l16 0zM64 224l64 0 0 192 40 0 0-192 64 0 0 192 48 0 0-192 64 0 0 192 40 0 0-192 64 0 0 196.3c.6 .3 1.2 .7 1.8 1.1l48 32c11.7 7.8 17 22.4 12.9 35.9S494.1 512 480 512L32 512c-14.1 0-26.5-9.2-30.6-22.7s1.1-28.1 12.9-35.9l48-32c.6-.4 1.2-.7 1.8-1.1L64 224z"]
};
const faPencil = {
  prefix: 'fas',
  iconName: 'pencil',
  icon: [512, 512, [9999, 61504, "pencil-alt"], "f303", "M410.3 231l11.3-11.3-33.9-33.9-62.1-62.1L291.7 89.8l-11.3 11.3-22.6 22.6L58.6 322.9c-10.4 10.4-18 23.3-22.2 37.4L1 480.7c-2.5 8.4-.2 17.5 6.1 23.7s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L387.7 253.7 410.3 231zM160 399.4l-9.1 22.7c-4 3.1-8.5 5.4-13.3 6.9L59.4 452l23-78.1c1.4-4.9 3.8-9.4 6.9-13.3l22.7-9.1 0 32c0 8.8 7.2 16 16 16l32 0zM362.7 18.7L348.3 33.2 325.7 55.8 314.3 67.1l33.9 33.9 62.1 62.1 33.9 33.9 11.3-11.3 22.6-22.6 14.5-14.5c25-25 25-65.5 0-90.5L453.3 18.7c-25-25-65.5-25-90.5 0zm-47.4 168l-144 144c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l144-144c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faPencilAlt = faPencil;
const faBackward = {
  prefix: 'fas',
  iconName: 'backward',
  icon: [512, 512, [9194], "f04a", "M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-320c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3l0 41.7 0 41.7L459.5 440.6zM256 352l0-96 0-128 0-32c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-64z"]
};
const faCaretRight = {
  prefix: 'fas',
  iconName: 'caret-right',
  icon: [256, 512, [], "f0da", "M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"]
};
const faComments = {
  prefix: 'fas',
  iconName: 'comments',
  icon: [640, 512, [128490, 61670], "f086", "M208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 38.6 14.7 74.3 39.6 103.4c-3.5 9.4-8.7 17.7-14.2 24.7c-4.8 6.2-9.7 11-13.3 14.3c-1.8 1.6-3.3 2.9-4.3 3.7c-.5 .4-.9 .7-1.1 .8l-.2 .2s0 0 0 0s0 0 0 0C1 327.2-1.4 334.4 .8 340.9S9.1 352 16 352c21.8 0 43.8-5.6 62.1-12.5c9.2-3.5 17.8-7.4 25.2-11.4C134.1 343.3 169.8 352 208 352zM448 176c0 112.3-99.1 196.9-216.5 207C255.8 457.4 336.4 512 432 512c38.2 0 73.9-8.7 104.7-23.9c7.5 4 16 7.9 25.2 11.4c18.3 6.9 40.3 12.5 62.1 12.5c6.9 0 13.1-4.5 15.2-11.1c2.1-6.6-.2-13.8-5.8-17.9c0 0 0 0 0 0s0 0 0 0l-.2-.2c-.2-.2-.6-.4-1.1-.8c-1-.8-2.5-2-4.3-3.7c-3.6-3.3-8.5-8.1-13.3-14.3c-5.5-7-10.7-15.4-14.2-24.7c24.9-29 39.6-64.7 39.6-103.4c0-92.8-84.9-168.9-192.6-175.5c.4 5.1 .6 10.3 .6 15.5z"]
};
const faPaste = {
  prefix: 'fas',
  iconName: 'paste',
  icon: [512, 512, ["file-clipboard"], "f0ea", "M160 0c-23.7 0-44.4 12.9-55.4 32L48 32C21.5 32 0 53.5 0 80L0 400c0 26.5 21.5 48 48 48l144 0 0-272c0-44.2 35.8-80 80-80l48 0 0-16c0-26.5-21.5-48-48-48l-56.6 0C204.4 12.9 183.7 0 160 0zM272 128c-26.5 0-48 21.5-48 48l0 272 0 16c0 26.5 21.5 48 48 48l192 0c26.5 0 48-21.5 48-48l0-220.1c0-12.7-5.1-24.9-14.1-33.9l-67.9-67.9c-9-9-21.2-14.1-33.9-14.1L320 128l-48 0zM160 40a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faFileClipboard = faPaste;
const faCodePullRequest = {
  prefix: 'fas',
  iconName: 'code-pull-request',
  icon: [512, 512, [], "e13c", "M305.8 2.1C314.4 5.9 320 14.5 320 24l0 40 16 0c70.7 0 128 57.3 128 128l0 166.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3L400 192c0-35.3-28.7-64-64-64l-16 0 0 40c0 9.5-5.6 18.1-14.2 21.9s-18.8 2.3-25.8-4.1l-80-72c-5.1-4.6-7.9-11-7.9-17.8s2.9-13.3 7.9-17.8l80-72c7-6.3 17.2-7.9 25.8-4.1zM104 80A24 24 0 1 0 56 80a24 24 0 1 0 48 0zm8 73.3l0 205.3c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3l0-205.3C19.7 141 0 112.8 0 80C0 35.8 35.8 0 80 0s80 35.8 80 80c0 32.8-19.7 61-48 73.3zM104 432a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm328 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faClipboardList = {
  prefix: 'fas',
  iconName: 'clipboard-list',
  icon: [384, 512, [], "f46d", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM72 272a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm104-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zM72 368a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm88 0c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16z"]
};
const faTruckRampBox = {
  prefix: 'fas',
  iconName: 'truck-ramp-box',
  icon: [640, 512, ["truck-loading"], "f4de", "M640 0l0 400c0 61.9-50.1 112-112 112c-61 0-110.5-48.7-112-109.3L48.4 502.9c-17.1 4.6-34.6-5.4-39.3-22.5s5.4-34.6 22.5-39.3L352 353.8 352 64c0-35.3 28.7-64 64-64L640 0zM576 400a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM23.1 207.7c-4.6-17.1 5.6-34.6 22.6-39.2l46.4-12.4 20.7 77.3c2.3 8.5 11.1 13.6 19.6 11.3l30.9-8.3c8.5-2.3 13.6-11.1 11.3-19.6l-20.7-77.3 46.4-12.4c17.1-4.6 34.6 5.6 39.2 22.6l41.4 154.5c4.6 17.1-5.6 34.6-22.6 39.2L103.7 384.9c-17.1 4.6-34.6-5.6-39.2-22.6L23.1 207.7z"]
};
const faTruckLoading = faTruckRampBox;
const faUserCheck = {
  prefix: 'fas',
  iconName: 'user-check',
  icon: [640, 512, [], "f4fc", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM625 177L497 305c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L591 143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faVialVirus = {
  prefix: 'fas',
  iconName: 'vial-virus',
  icon: [512, 512, [], "e597", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l0 288c0 53 43 96 96 96c28.6 0 54.2-12.5 71.8-32.3c.1-14.2 5.6-28.3 16.4-39.1c.2-.2 .1-.6-.2-.6c-30.9 0-56-25.1-56-56s25.1-56 56-56c.3 0 .4-.4 .2-.6c-21.9-21.9-21.9-57.3 0-79.2c2.4-2.4 5-4.6 7.8-6.5L224 96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0L96 32 32 32zM96 192l0-96 64 0 0 96-64 0zM216 376c28.8 0 43.2 34.8 22.9 55.2c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0c20.4-20.4 55.2-5.9 55.2 22.9c0 13.3 10.7 24 24 24s24-10.7 24-24c0-28.8 34.8-43.2 55.2-22.9c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9C444.8 410.8 459.2 376 488 376c13.3 0 24-10.7 24-24s-10.7-24-24-24c-28.8 0-43.2-34.8-22.9-55.2c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0C410.8 259.2 376 244.8 376 216c0-13.3-10.7-24-24-24s-24 10.7-24 24c0 28.8-34.8 43.2-55.2 22.9c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9c20.4 20.4 5.9 55.2-22.9 55.2c-13.3 0-24 10.7-24 24s10.7 24 24 24zm104-88a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm40 96a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faSheetPlastic = {
  prefix: 'fas',
  iconName: 'sheet-plastic',
  icon: [384, 512, [], "e571", "M0 448c0 35.3 28.7 64 64 64l160 0 0-128c0-17.7 14.3-32 32-32l128 0 0-288c0-35.3-28.7-64-64-64L64 0C28.7 0 0 28.7 0 64L0 448zM171.3 75.3l-96 96c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l96-96c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6zm96 32l-160 160c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l160-160c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6zM384 384l-128 0 0 128L384 384z"]
};
const faBlog = {
  prefix: 'fas',
  iconName: 'blog',
  icon: [512, 512, [], "f781", "M192 32c0 17.7 14.3 32 32 32c123.7 0 224 100.3 224 224c0 17.7 14.3 32 32 32s32-14.3 32-32C512 128.9 383.1 0 224 0c-17.7 0-32 14.3-32 32zm0 96c0 17.7 14.3 32 32 32c70.7 0 128 57.3 128 128c0 17.7 14.3 32 32 32s32-14.3 32-32c0-106-86-192-192-192c-17.7 0-32 14.3-32 32zM96 144c0-26.5-21.5-48-48-48S0 117.5 0 144L0 368c0 79.5 64.5 144 144 144s144-64.5 144-144s-64.5-144-144-144l-16 0 0 96 16 0c26.5 0 48 21.5 48 48s-21.5 48-48 48s-48-21.5-48-48l0-224z"]
};
const faUserNinja = {
  prefix: 'fas',
  iconName: 'user-ninja',
  icon: [448, 512, [129399], "f504", "M224 256c-57.2 0-105.6-37.5-122-89.3c-1.1 1.3-2.2 2.6-3.5 3.8c-15.8 15.8-38.8 20.7-53.6 22.1c-8.1 .8-14.6-5.7-13.8-13.8c1.4-14.7 6.3-37.8 22.1-53.6c5.8-5.8 12.6-10.1 19.6-13.4c-7-3.2-13.8-7.6-19.6-13.4C37.4 82.7 32.6 59.7 31.1 44.9c-.8-8.1 5.7-14.6 13.8-13.8c14.7 1.4 37.8 6.3 53.6 22.1c4.8 4.8 8.7 10.4 11.7 16.1C131.4 28.2 174.4 0 224 0c70.7 0 128 57.3 128 128s-57.3 128-128 128zM0 482.3C0 399.5 56.4 330 132.8 309.9c6-1.6 12.2 .9 15.9 5.8l62.5 83.3c6.4 8.5 19.2 8.5 25.6 0l62.5-83.3c3.7-4.9 9.9-7.4 15.9-5.8C391.6 330 448 399.5 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM160 96c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L160 96z"]
};
const faPersonArrowUpFromLine = {
  prefix: 'fas',
  iconName: 'person-arrow-up-from-line',
  icon: [640, 512, [], "e539", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 352l0-96 16 0 0 96-16 0zm-64 0l-88 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l120 0 80 0 376 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-344 0 0-191.1 28.6 47.5c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-58.3-97c-17.4-28.9-48.6-46.6-82.3-46.6l-29.7 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9 120 448zM598.6 121.4l-80-80c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L464 141.3 464 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-242.7 25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z"]
};
const faScrollTorah = {
  prefix: 'fas',
  iconName: 'scroll-torah',
  icon: [640, 512, ["torah"], "f6a0", "M96 480L96 32C96 14.3 74.5 0 48 0S0 14.3 0 32L0 480c0 17.7 21.5 32 48 32s48-14.3 48-32zM512 32L128 32l0 448 384 0 0-448zM592 0c-26.5 0-48 14.3-48 32l0 448c0 17.7 21.5 32 48 32s48-14.3 48-32l0-448c0-17.7-21.5-32-48-32zM196 313.7c0-3.2 .9-6.4 2.5-9.2L226.7 256l-28.3-48.5c-1.6-2.8-2.5-6-2.5-9.2c0-10.1 8.2-18.3 18.3-18.3l56.7 0 31.4-53.9c3.6-6.3 10.3-10.1 17.6-10.1s13.9 3.8 17.6 10.1L369 180l56.7 0c10.1 0 18.3 8.2 18.3 18.3c0 3.2-.9 6.4-2.5 9.2L413.3 256l28.3 48.5c1.6 2.8 2.5 6 2.5 9.2c0 10.1-8.2 18.3-18.3 18.3L369 332l-31.4 53.9c-3.6 6.3-10.3 10.1-17.6 10.1s-13.9-3.8-17.6-10.1L271 332l-56.7 0c-10.1 0-18.3-8.2-18.3-18.3zm124 54.7L341.2 332l-42.4 0L320 368.4zM254.5 256l30.3 52 70.4 0 30.3-52-30.3-52-70.4 0-30.3 52zm144.9 23.8L383 308l32.8 0-16.4-28.2zM415.8 204L383 204l16.4 28.2L415.8 204zM320 143.6L298.8 180l42.4 0L320 143.6zM224.2 204l16.4 28.2L257 204l-32.8 0zM257 308l-16.4-28.2L224.2 308l32.8 0z"]
};
const faTorah = faScrollTorah;
const faBroomBall = {
  prefix: 'fas',
  iconName: 'broom-ball',
  icon: [576, 512, ["quidditch", "quidditch-broom-ball"], "f458", "M566.6 9.4c12.5 12.5 12.5 32.8 0 45.3l-192 192 34.7 34.7c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6l-29.1 0L256 211.7l0-29.1c0-12.5 10.1-22.6 22.6-22.6c6 0 11.8 2.4 16 6.6l34.7 34.7 192-192c12.5-12.5 32.8-12.5 45.3 0zm-344 225.5L341.1 353.4c3.7 42.7-11.7 85.2-42.3 115.8C271.4 496.6 234.2 512 195.5 512L22.1 512C9.9 512 0 502.1 0 489.9c0-6.3 2.7-12.3 7.3-16.5L133.7 359.7c4.2-3.7-.4-10.4-5.4-7.9L77.2 377.4c-6.1 3-13.2-1.4-13.2-8.2c0-31.5 12.5-61.7 34.8-84l8-8c30.6-30.6 73.1-45.9 115.8-42.3zM464 352a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faQuidditch = faBroomBall;
const faQuidditchBroomBall = faBroomBall;
const faToggleOff = {
  prefix: 'fas',
  iconName: 'toggle-off',
  icon: [576, 512, [], "f204", "M384 128c70.7 0 128 57.3 128 128s-57.3 128-128 128l-192 0c-70.7 0-128-57.3-128-128s57.3-128 128-128l192 0zM576 256c0-106-86-192-192-192L192 64C86 64 0 150 0 256S86 448 192 448l192 0c106 0 192-86 192-192zM192 352a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"]
};
const faBoxArchive = {
  prefix: 'fas',
  iconName: 'box-archive',
  icon: [512, 512, ["archive"], "f187", "M32 32l448 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96L0 64C0 46.3 14.3 32 32 32zm0 128l448 0 0 256c0 35.3-28.7 64-64 64L96 480c-35.3 0-64-28.7-64-64l0-256zm128 80c0 8.8 7.2 16 16 16l160 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-160 0c-8.8 0-16 7.2-16 16z"]
};
const faArchive = faBoxArchive;
const faPersonDrowning = {
  prefix: 'fas',
  iconName: 'person-drowning',
  icon: [576, 512, [], "e545", "M192 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32.2c0 54.1 23.5 104 62.2 138.3l-21 146.7c7.8 2.1 15.5 3.3 22.8 3.3c21.1 0 42-8.5 59.2-20.3c22.1-15.5 51.6-15.5 73.7 0c12.4 8.5 26.1 14.8 39.7 18l17.7-97.6c10.7-1.2 21.3-3.1 31.9-5.5l105-23.9c17.2-3.9 28-21.1 24.1-38.3s-21.1-28-38.3-24.1L400 216.6c-41 9.3-83.7 7.5-123.7-5.2c-50.2-16-84.3-62.6-84.3-115.3L192 64zM320 192a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM306.5 389.9c-11.1-7.9-25.9-7.9-37 0C247 405.4 219.5 416 192 416c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 469.7 159 480 192 480c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 405.2 410.9 416 384 416c-27.5 0-55-10.6-77.5-26.1z"]
};
const faArrowDown91 = {
  prefix: 'fas',
  iconName: 'arrow-down-9-1',
  icon: [576, 512, ["sort-numeric-desc", "sort-numeric-down-alt"], "f886", "M160 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L192 365.7 192 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 301.7L95.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C142.5 476.2 151 480 160 480zM450.7 294c-8.3-6-19.1-7.7-28.8-4.4l-48 16c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l5.9-2 0 51.6-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l48 0 48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-96c0-10.3-4.9-19.9-13.3-26zM418.3 91a32 32 0 1 1 27.4 57.9A32 32 0 1 1 418.3 91zM405.1 203.8l-6.8 9.2c-10.5 14.2-7.5 34.2 6.7 44.8s34.2 7.5 44.8-6.7l48.8-65.8c14-18.9 21.5-41.7 21.5-65.2c0-48.6-39.4-88-88-88s-88 39.4-88 88c0 39.2 25.6 72.4 61.1 83.8z"]
};
const faSortNumericDesc = faArrowDown91;
const faSortNumericDownAlt = faArrowDown91;
const faFaceGrinTongueSquint = {
  prefix: 'fas',
  iconName: 'face-grin-tongue-squint',
  icon: [512, 512, [128541, "grin-tongue-squint"], "f58a", "M0 256C0 368.9 73.1 464.7 174.5 498.8C165.3 484 160 466.6 160 448l0-47.3c-24-17.5-43.1-41.4-54.8-69.2c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19c12.3-3.8 24.3 6.9 19.3 18.7c-11.8 28-31.1 52-55.4 69.6l0 46.9c0 18.6-5.3 36-14.5 50.8C438.9 464.7 512 368.9 512 256C512 114.6 397.4 0 256 0S0 114.6 0 256zM116 141.1c0-9 9.6-14.7 17.5-10.5l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6zm262.5-10.5c7.9-4.2 17.5 1.5 17.5 10.5c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9zM320 448l0-45.4c0-14.7-11.9-26.6-26.6-26.6l-2 0c-11.3 0-21.1 7.9-23.6 18.9c-2.8 12.6-20.8 12.6-23.6 0c-2.5-11.1-12.3-18.9-23.6-18.9l-2 0c-14.7 0-26.6 11.9-26.6 26.6l0 45.4c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faGrinTongueSquint = faFaceGrinTongueSquint;
const faSprayCan = {
  prefix: 'fas',
  iconName: 'spray-can',
  icon: [512, 512, [], "f5bd", "M128 0l64 0c17.7 0 32 14.3 32 32l0 96L96 128l0-96c0-17.7 14.3-32 32-32zM0 256c0-53 43-96 96-96l128 0c53 0 96 43 96 96l0 208c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 256zm240 80A80 80 0 1 0 80 336a80 80 0 1 0 160 0zM256 64a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM384 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM448 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM384 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faTruckMonster = {
  prefix: 'fas',
  iconName: 'truck-monster',
  icon: [640, 512, [], "f63b", "M288 64l0 64 128 0L368 64l-80 0zM419.2 25.6L496 128l80 0c17.7 0 32 14.3 32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32c-29.2-38.9-75.7-64-128-64s-98.8 25.1-128 64l-64 0c-29.2-38.9-75.7-64-128-64s-98.8 25.1-128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c0-17.7 14.3-32 32-32l160 0 0-80c0-26.5 21.5-48 48-48l96 0c20.1 0 39.1 9.5 51.2 25.6zM152 256l16 0c12.1 0 22.1 8.9 23.8 20.6c7.6 2.2 14.9 5.3 21.7 9c9.4-7 22.8-6.3 31.3 2.3l11.3 11.3c8.6 8.6 9.3 21.9 2.3 31.3c3.7 6.8 6.8 14.1 9 21.7c11.6 1.7 20.6 11.7 20.6 23.8l0 16c0 12.1-8.9 22.1-20.6 23.8c-2.2 7.6-5.3 14.9-9 21.7c7 9.4 6.3 22.8-2.3 31.3l-11.3 11.3c-8.6 8.6-21.9 9.3-31.3 2.2c-6.8 3.7-14.1 6.8-21.7 9C190.1 503.1 180.1 512 168 512l-16 0c-12.1 0-22.1-8.9-23.8-20.6c-7.6-2.2-14.9-5.3-21.7-9c-9.4 7.1-22.8 6.3-31.3-2.2L63.8 468.9c-8.6-8.6-9.3-21.9-2.3-31.3c-3.7-6.9-6.8-14.1-9-21.8C40.9 414.1 32 404.1 32 392l0-16c0-12.1 8.9-22.1 20.6-23.8c2.2-7.6 5.3-14.9 9-21.8c-7-9.4-6.3-22.8 2.3-31.3l11.3-11.3c8.6-8.6 21.9-9.3 31.3-2.3c6.8-3.7 14.1-6.8 21.7-9c1.7-11.6 11.7-20.6 23.8-20.6zm8 176a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM448.2 276.6c1.7-11.6 11.7-20.6 23.8-20.6l16 0c12.1 0 22.1 8.9 23.8 20.6c7.6 2.2 14.9 5.3 21.8 9c9.4-7 22.8-6.3 31.3 2.3l11.3 11.3c8.6 8.6 9.3 21.9 2.2 31.3c3.7 6.8 6.8 14.1 9 21.7c11.6 1.7 20.6 11.7 20.6 23.8l0 16c0 12.1-8.9 22.1-20.6 23.8c-2.2 7.6-5.3 14.9-9 21.7c7 9.4 6.3 22.8-2.2 31.3l-11.3 11.3c-8.6 8.6-21.9 9.3-31.3 2.2c-6.9 3.7-14.1 6.8-21.8 9C510.1 503.1 500.1 512 488 512l-16 0c-12.1 0-22.1-8.9-23.8-20.6c-7.6-2.2-14.9-5.3-21.7-9c-9.4 7.1-22.8 6.3-31.3-2.2l-11.3-11.3c-8.6-8.6-9.3-21.9-2.2-31.3c-3.7-6.9-6.8-14.1-9-21.8C360.9 414.1 352 404.1 352 392l0-16c0-12.1 8.9-22.1 20.6-23.8c2.2-7.6 5.3-14.9 9-21.8c-7-9.4-6.3-22.8 2.2-31.3l11.3-11.3c8.6-8.6 21.9-9.3 31.3-2.3c6.8-3.7 14.1-6.8 21.7-9zM528 384a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faW = {
  prefix: 'fas',
  iconName: 'w',
  icon: [576, 512, [119], "57", "M20.8 34c16.5-6.2 35 2.2 41.2 18.7l110.2 294L257.3 55c4-13.7 16.5-23 30.7-23s26.7 9.4 30.7 23l85.1 291.7L514 52.8c6.2-16.5 24.6-24.9 41.2-18.7s24.9 24.7 18.7 41.2l-144 384c-4.8 12.9-17.4 21.3-31.2 20.7s-25.7-9.8-29.5-23L288 178.3 206.7 457c-3.9 13.2-15.8 22.5-29.5 23s-26.3-7.8-31.2-20.7L2 75.2C-4.2 58.7 4.2 40.2 20.8 34z"]
};
const faEarthAfrica = {
  prefix: 'fas',
  iconName: 'earth-africa',
  icon: [512, 512, [127757, "globe-africa"], "f57c", "M177.8 63.2l10 17.4c2.8 4.8 4.2 10.3 4.2 15.9l0 41.4c0 3.9 1.6 7.7 4.3 10.4c6.2 6.2 16.5 5.7 22-1.2l13.6-17c4.7-5.9 12.9-7.7 19.6-4.3l15.2 7.6c3.4 1.7 7.2 2.6 11 2.6c6.5 0 12.8-2.6 17.4-7.2l3.9-3.9c2.9-2.9 7.3-3.6 11-1.8l29.2 14.6c7.8 3.9 12.6 11.8 12.6 20.5c0 10.5-7.1 19.6-17.3 22.2l-35.4 8.8c-7.4 1.8-15.1 1.5-22.4-.9l-32-10.7c-3.3-1.1-6.7-1.7-10.2-1.7c-7 0-13.8 2.3-19.4 6.5L176 212c-10.1 7.6-16 19.4-16 32l0 28c0 26.5 21.5 48 48 48l32 0c8.8 0 16 7.2 16 16l0 48c0 17.7 14.3 32 32 32c10.1 0 19.6-4.7 25.6-12.8l25.6-34.1c8.3-11.1 12.8-24.6 12.8-38.4l0-12.1c0-3.9 2.6-7.3 6.4-8.2l5.3-1.3c11.9-3 20.3-13.7 20.3-26c0-7.1-2.8-13.9-7.8-18.9l-33.5-33.5c-3.7-3.7-3.7-9.7 0-13.4c5.7-5.7 14.1-7.7 21.8-5.1l14.1 4.7c12.3 4.1 25.7-1.5 31.5-13c3.5-7 11.2-10.8 18.9-9.2l27.4 5.5C432 112.4 351.5 48 256 48c-27.7 0-54 5.4-78.2 15.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faGlobeAfrica = faEarthAfrica;
const faRainbow = {
  prefix: 'fas',
  iconName: 'rainbow',
  icon: [640, 512, [127752], "f75b", "M320 96C178.6 96 64 210.6 64 352l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96C0 175.3 143.3 32 320 32s320 143.3 320 320l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96C576 210.6 461.4 96 320 96zm0 192c-35.3 0-64 28.7-64 64l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-70.7 57.3-128 128-128s128 57.3 128 128l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-35.3-28.7-64-64-64zM160 352l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-123.7 100.3-224 224-224s224 100.3 224 224l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-88.4-71.6-160-160-160s-160 71.6-160 160z"]
};
const faCircleNotch = {
  prefix: 'fas',
  iconName: 'circle-notch',
  icon: [512, 512, [], "f1ce", "M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z"]
};
const faTabletScreenButton = {
  prefix: 'fas',
  iconName: 'tablet-screen-button',
  icon: [448, 512, ["tablet-alt"], "f3fa", "M0 64C0 28.7 28.7 0 64 0L384 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM256 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM384 64L64 64l0 320 320 0 0-320z"]
};
const faTabletAlt = faTabletScreenButton;
const faPaw = {
  prefix: 'fas',
  iconName: 'paw',
  icon: [512, 512, [], "f1b0", "M226.5 92.9c14.3 42.9-.3 86.2-32.6 96.8s-70.1-15.6-84.4-58.5s.3-86.2 32.6-96.8s70.1 15.6 84.4 58.5zM100.4 198.6c18.9 32.4 14.3 70.1-10.2 84.1s-59.7-.9-78.5-33.3S-2.7 179.3 21.8 165.3s59.7 .9 78.5 33.3zM69.2 401.2C121.6 259.9 214.7 224 256 224s134.4 35.9 186.8 177.2c3.6 9.7 5.2 20.1 5.2 30.5l0 1.6c0 25.8-20.9 46.7-46.7 46.7c-11.5 0-22.9-1.4-34-4.2l-88-22c-15.3-3.8-31.3-3.8-46.6 0l-88 22c-11.1 2.8-22.5 4.2-34 4.2C84.9 480 64 459.1 64 433.3l0-1.6c0-10.4 1.6-20.8 5.2-30.5zM421.8 282.7c-24.5-14-29.1-51.7-10.2-84.1s54-47.3 78.5-33.3s29.1 51.7 10.2 84.1s-54 47.3-78.5 33.3zM310.1 189.7c-32.3-10.6-46.9-53.9-32.6-96.8s52.1-69.1 84.4-58.5s46.9 53.9 32.6 96.8s-52.1 69.1-84.4 58.5z"]
};
const faCloud = {
  prefix: 'fas',
  iconName: 'cloud',
  icon: [640, 512, [9729], "f0c2", "M0 336c0 79.5 64.5 144 144 144l368 0c70.7 0 128-57.3 128-128c0-61.9-44-113.6-102.4-125.4c4.1-10.7 6.4-22.4 6.4-34.6c0-53-43-96-96-96c-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32C167.6 32 96 103.6 96 192c0 2.7 .1 5.4 .2 8.1C40.2 219.8 0 273.2 0 336z"]
};
const faTrowelBricks = {
  prefix: 'fas',
  iconName: 'trowel-bricks',
  icon: [512, 512, [], "e58a", "M240.8 4.8C250.3 10.6 256 20.9 256 32l0 72 89 0c3.6-13.8 16.1-24 31-24l88 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-88 0c-14.9 0-27.4-10.2-31-24l-89 0 0 72c0 11.1-5.7 21.4-15.2 27.2s-21.2 6.4-31.1 1.4l-192-96C6.8 151.2 0 140.1 0 128s6.8-23.2 17.7-28.6l192-96c9.9-5 21.7-4.4 31.1 1.4zM288 256c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-64zM32 384l96 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm192 0l256 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32z"]
};
const faFaceFlushed = {
  prefix: 'fas',
  iconName: 'face-flushed',
  icon: [512, 512, [128563, "flushed"], "f579", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM176 384c0 8.8 7.2 16 16 16l128 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-128 0c-8.8 0-16 7.2-16 16zm-16-88a72 72 0 1 0 0-144 72 72 0 1 0 0 144zm264-72a72 72 0 1 0 -144 0 72 72 0 1 0 144 0zm-288 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm192 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faFlushed = faFaceFlushed;
const faHospitalUser = {
  prefix: 'fas',
  iconName: 'hospital-user',
  icon: [576, 512, [], "f80d", "M48 0C21.5 0 0 21.5 0 48L0 256l144 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L0 288l0 64 144 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L0 384l0 80c0 26.5 21.5 48 48 48l217.9 0c-6.3-10.2-9.9-22.2-9.9-35.1c0-46.9 25.8-87.8 64-109.2l0-95.9L320 48c0-26.5-21.5-48-48-48L48 0zM152 64l16 0c8.8 0 16 7.2 16 16l0 24 24 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-24 0 0 24c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-24-24 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16l24 0 0-24c0-8.8 7.2-16 16-16zM512 272a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM288 477.1c0 19.3 15.6 34.9 34.9 34.9l218.2 0c19.3 0 34.9-15.6 34.9-34.9c0-51.4-41.7-93.1-93.1-93.1l-101.8 0c-51.4 0-93.1 41.7-93.1 93.1z"]
};
const faTentArrowLeftRight = {
  prefix: 'fas',
  iconName: 'tent-arrow-left-right',
  icon: [576, 512, [], "e57f", "M488.1 6.2c-9.9-8.9-25-8.1-33.9 1.8s-8.1 25 1.8 33.9L489.5 72 86.5 72l33.5-30.2c9.9-8.9 10.7-24 1.8-33.9S97.8-2.7 87.9 6.2l-80 72C2.9 82.7 0 89.2 0 96s2.9 13.3 7.9 17.8l80 72c9.9 8.9 25 8.1 33.9-1.8s8.1-25-1.8-33.9L86.5 120l402.9 0-33.5 30.2c-9.9 8.9-10.7 24-1.8 33.9s24 10.7 33.9 1.8l80-72c5.1-4.6 7.9-11 7.9-17.8s-2.9-13.3-7.9-17.8l-80-72zM307.4 166.5c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S86.7 512 96 512l144 0 16 0c17.7 0 32-14.3 32-32l0-118.1c0-5.5 4.4-9.9 9.9-9.9c3.7 0 7.2 2.1 8.8 5.5l68.4 136.8c5.4 10.8 16.5 17.7 28.6 17.7l60.2 0 16 0c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
};
const faGavel = {
  prefix: 'fas',
  iconName: 'gavel',
  icon: [512, 512, ["legal"], "f0e3", "M318.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-120 120c-12.5 12.5-12.5 32.8 0 45.3l16 16c12.5 12.5 32.8 12.5 45.3 0l4-4L325.4 293.4l-4 4c-12.5 12.5-12.5 32.8 0 45.3l16 16c12.5 12.5 32.8 12.5 45.3 0l120-120c12.5-12.5 12.5-32.8 0-45.3l-16-16c-12.5-12.5-32.8-12.5-45.3 0l-4 4L330.6 74.6l4-4c12.5-12.5 12.5-32.8 0-45.3l-16-16zm-152 288c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l48 48c12.5 12.5 32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-1.4-1.4L272 285.3 226.7 240 168 298.7l-1.4-1.4z"]
};
const faLegal = faGavel;
const faBinoculars = {
  prefix: 'fas',
  iconName: 'binoculars',
  icon: [512, 512, [], "f1e5", "M128 32l32 0c17.7 0 32 14.3 32 32l0 32L96 96l0-32c0-17.7 14.3-32 32-32zm64 96l0 320c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32l0-59.1c0-34.6 9.4-68.6 27.2-98.3C40.9 267.8 49.7 242.4 53 216L60.5 156c2-16 15.6-28 31.8-28l99.8 0zm227.8 0c16.1 0 29.8 12 31.8 28L459 216c3.3 26.4 12.1 51.8 25.8 74.6c17.8 29.7 27.2 63.7 27.2 98.3l0 59.1c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-320 99.8 0zM320 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 32-96 0 0-32zm-32 64l0 160-64 0 0-160 64 0z"]
};
const faMicrophoneSlash = {
  prefix: 'fas',
  iconName: 'microphone-slash',
  icon: [640, 512, [], "f131", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c15.2-26 23.9-56.3 23.9-88.7l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 21.2-5.1 41.1-14.2 58.7L416 300.8 416 96c0-53-43-96-96-96s-96 43-96 96l0 54.3L38.8 5.1zM344 430.4c20.4-2.8 39.7-9.1 57.3-18.2l-43.1-33.9C346.1 382 333.3 384 320 384c-70.7 0-128-57.3-128-128l0-8.7L144.7 210c-.5 1.9-.7 3.9-.7 6l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6z"]
};
const faBoxTissue = {
  prefix: 'fas',
  iconName: 'box-tissue',
  icon: [512, 512, [], "e05b", "M92.5 0L208 0c40 0 52 24 64 48s24 48 64 48l85.2 0C436 96 448 108 448 122.8c0 3.4-.7 6.8-1.9 10L409.6 224 384 288l-256 0-16-64L64.9 35.4c-.6-2.3-.9-4.6-.9-6.9C64 12.8 76.8 0 92.5 0zM79 224l16 64-15 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 256 0 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-13.5 0 25.6-64 19.9 0c26.5 0 48 21.5 48 48l0 112L0 384 0 272c0-26.5 21.5-48 48-48l31 0zM0 416l512 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48l0-48z"]
};
const faMotorcycle = {
  prefix: 'fas',
  iconName: 'motorcycle',
  icon: [640, 512, [127949], "f21c", "M280 32c-13.3 0-24 10.7-24 24s10.7 24 24 24l57.7 0 16.4 30.3L256 192l-45.3-45.3c-12-12-28.3-18.7-45.3-18.7L64 128c-17.7 0-32 14.3-32 32l0 32 96 0c88.4 0 160 71.6 160 160c0 11-1.1 21.7-3.2 32l70.4 0c-2.1-10.3-3.2-21-3.2-32c0-52.2 25-98.6 63.7-127.8l15.4 28.6C402.4 276.3 384 312 384 352c0 70.7 57.3 128 128 128s128-57.3 128-128s-57.3-128-128-128c-13.5 0-26.5 2.1-38.7 6L418.2 128l61.8 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-20.4 0c-7.5 0-14.7 2.6-20.5 7.4L391.7 78.9l-14-26c-7-12.9-20.5-21-35.2-21L280 32zM462.7 311.2l28.2 52.2c6.3 11.7 20.9 16 32.5 9.7s16-20.9 9.7-32.5l-28.2-52.2c2.3-.3 4.7-.4 7.1-.4c35.3 0 64 28.7 64 64s-28.7 64-64 64s-64-28.7-64-64c0-15.5 5.5-29.7 14.7-40.8zM187.3 376c-9.5 23.5-32.5 40-59.3 40c-35.3 0-64-28.7-64-64s28.7-64 64-64c26.9 0 49.9 16.5 59.3 40l66.4 0C242.5 268.8 190.5 224 128 224C57.3 224 0 281.3 0 352s57.3 128 128 128c62.5 0 114.5-44.8 125.8-104l-66.4 0zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faBellConcierge = {
  prefix: 'fas',
  iconName: 'bell-concierge',
  icon: [512, 512, [128718, "concierge-bell"], "f562", "M216 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0 0 33.3C119.6 157.2 32 252.4 32 368l448 0c0-115.6-87.6-210.8-200-222.7l0-33.3 16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0-40 0zM24 400c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 400z"]
};
const faConciergeBell = faBellConcierge;
const faPenRuler = {
  prefix: 'fas',
  iconName: 'pen-ruler',
  icon: [512, 512, ["pencil-ruler"], "f5ae", "M469.3 19.3l23.4 23.4c25 25 25 65.5 0 90.5l-56.4 56.4L322.3 75.7l56.4-56.4c25-25 65.5-25 90.5 0zM44.9 353.2L299.7 98.3 413.7 212.3 158.8 467.1c-6.7 6.7-15.1 11.6-24.2 14.2l-104 29.7c-8.4 2.4-17.4 .1-23.6-6.1s-8.5-15.2-6.1-23.6l29.7-104c2.6-9.2 7.5-17.5 14.2-24.2zM249.4 103.4L103.4 249.4 16 161.9c-18.7-18.7-18.7-49.1 0-67.9L94.1 16c18.7-18.7 49.1-18.7 67.9 0l19.8 19.8c-.3 .3-.7 .6-1 .9l-64 64c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l64-64c.3-.3 .6-.7 .9-1l45.1 45.1zM408.6 262.6l45.1 45.1c-.3 .3-.7 .6-1 .9l-64 64c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l64-64c.3-.3 .6-.7 .9-1L496 350.1c18.7 18.7 18.7 49.1 0 67.9L417.9 496c-18.7 18.7-49.1 18.7-67.9 0l-87.4-87.4L408.6 262.6z"]
};
const faPencilRuler = faPenRuler;
const faPeopleArrows = {
  prefix: 'fas',
  iconName: 'people-arrows',
  icon: [640, 512, ["people-arrows-left-right"], "e068", "M64 64a64 64 0 1 1 128 0A64 64 0 1 1 64 64zM25.9 233.4C29.3 191.9 64 160 105.6 160l44.8 0c27 0 51 13.4 65.5 34.1c-2.7 1.9-5.2 4-7.5 6.3l-64 64c-21.9 21.9-21.9 57.3 0 79.2L192 391.2l0 72.8c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-115.7c-26.5-9.5-44.7-35.8-42.2-65.6l4.1-49.3zM448 64a64 64 0 1 1 128 0A64 64 0 1 1 448 64zM431.6 200.4c-2.3-2.3-4.9-4.4-7.5-6.3c14.5-20.7 38.6-34.1 65.5-34.1l44.8 0c41.6 0 76.3 31.9 79.7 73.4l4.1 49.3c2.5 29.8-15.7 56.1-42.2 65.6L576 464c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-72.8 47.6-47.6c21.9-21.9 21.9-57.3 0-79.2l-64-64zM272 240l0 32 96 0 0-32c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l64 64c9.4 9.4 9.4 24.6 0 33.9l-64 64c-6.9 6.9-17.2 8.9-26.2 5.2s-14.8-12.5-14.8-22.2l0-32-96 0 0 32c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-64-64c-9.4-9.4-9.4-24.6 0-33.9l64-64c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2z"]
};
const faPeopleArrowsLeftRight = faPeopleArrows;
const faMarsAndVenusBurst = {
  prefix: 'fas',
  iconName: 'mars-and-venus-burst',
  icon: [640, 512, [], "e523", "M504 0c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l39 39-22.2 22.2C475.9 78.4 439.6 64 400 64c-88.4 0-160 71.6-160 160c0 80.2 59.1 146.7 136.1 158.2c0 .6-.1 1.2-.1 1.8l0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .3 0 .4 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3-24 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1c0 0 0 .1 0 .1s0 .1 0 .1l0 .1c0 0 0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0l24 0-24 0c0 13.3 10.7 24 24 24s24-10.7 24-24l-24 0 24 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1l0-.1c0 0 0-.1 0-.1s0-.1 0-.1l0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 24 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-24 0 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.4 0-.3 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4c0-.6 0-1.2-.1-1.8c77-11.6 136.1-78 136.1-158.2c0-31.4-9-60.7-24.7-85.4L560 113.9l39 39c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-112c0-13.3-10.7-24-24-24L504 0zM400 128a96 96 0 1 1 0 192 96 96 0 1 1 0-192zM190.9 18.1C188.4 12 182.6 8 176 8s-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L176 286.1l58.6 53.9c4.1 3.8 9.9 5.1 15.2 3.6C223.6 310.8 208 269.2 208 224c0-60.8 28.3-115 72.4-150.2L220.3 92.1l-29.4-74z"]
};
const faSquareCaretRight = {
  prefix: 'fas',
  iconName: 'square-caret-right',
  icon: [448, 512, ["caret-square-right"], "f152", "M448 96c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320zM320 256c0 6.7-2.8 13-7.7 17.6l-112 104c-7 6.5-17.2 8.2-25.9 4.4s-14.4-12.5-14.4-22l0-208c0-9.5 5.7-18.2 14.4-22s18.9-2.1 25.9 4.4l112 104c4.9 4.5 7.7 10.9 7.7 17.6z"]
};
const faCaretSquareRight = faSquareCaretRight;
const faScissors = {
  prefix: 'fas',
  iconName: 'scissors',
  icon: [512, 512, [9984, 9986, 9988, "cut"], "f0c4", "M256 192l-39.5-39.5c4.9-12.6 7.5-26.2 7.5-40.5C224 50.1 173.9 0 112 0S0 50.1 0 112s50.1 112 112 112c14.3 0 27.9-2.7 40.5-7.5L192 256l-39.5 39.5c-12.6-4.9-26.2-7.5-40.5-7.5C50.1 288 0 338.1 0 400s50.1 112 112 112s112-50.1 112-112c0-14.3-2.7-27.9-7.5-40.5L499.2 76.8c7.1-7.1 7.1-18.5 0-25.6c-28.3-28.3-74.1-28.3-102.4 0L256 192zm22.6 150.6L396.8 460.8c28.3 28.3 74.1 28.3 102.4 0c7.1-7.1 7.1-18.5 0-25.6L342.6 278.6l-64 64zM64 112a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm48 240a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faCut = faScissors;
const faSunPlantWilt = {
  prefix: 'fas',
  iconName: 'sun-plant-wilt',
  icon: [640, 512, [], "e57a", "M160 0c-6.3 0-12 3.7-14.6 9.5L120.6 64.9 63.9 43.2c-5.9-2.3-12.6-.8-17 3.6s-5.9 11.1-3.6 17l21.7 56.7L9.5 145.4C3.7 148 0 153.7 0 160s3.7 12 9.5 14.6l55.4 24.8L43.2 256.1c-2.3 5.9-.8 12.6 3.6 17s11.1 5.9 17 3.6l56.7-21.7 24.8 55.4c2.6 5.8 8.3 9.5 14.6 9.5s12-3.7 14.6-9.5l24.8-55.4 56.7 21.7c5.9 2.3 12.6 .8 17-3.6s5.9-11.1 3.6-17l-21.7-56.7 55.4-24.8c5.8-2.6 9.5-8.3 9.5-14.6s-3.7-12-9.5-14.6l-55.4-24.8 21.7-56.7c2.3-5.9 .8-12.6-3.6-17s-11.1-5.9-17-3.6L199.4 64.9 174.6 9.5C172 3.7 166.3 0 160 0zm0 96a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm312 16c0-17.7 14.3-32 32-32s32 14.3 32 32l0 53.4c-14.8 7.7-24 23.1-24 44.6c0 16.8 16 44 37.4 67.2c5.8 6.2 15.5 6.2 21.2 0C624 318 640 290.7 640 274c0-21.5-9.2-37-24-44.6l0-53.4c0-44.2-35.8-80-80-80s-80 35.8-80 80l0 22.7c-9.8-4.3-20.6-6.7-32-6.7c-44.2 0-80 35.8-80 80l0 21.4c-14.8 7.7-24 23.1-24 44.6c0 16.8 16 44 37.4 67.2c5.8 6.2 15.5 6.2 21.2 0C400 382 416 354.7 416 338c0-21.5-9.2-37-24-44.6l0-21.4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 8 0 168L32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-104 0 0-168 0-8 0-96z"]
};
const faToiletsPortable = {
  prefix: 'fas',
  iconName: 'toilets-portable',
  icon: [576, 512, [], "e584", "M32 0L224 0c17.7 0 32 14.3 32 32l0 32L0 64 0 32C0 14.3 14.3 0 32 0zM0 96l24 0 208 0 24 0 0 24 0 368c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8L48 480l0 8c0 13.3-10.7 24-24 24s-24-10.7-24-24L0 120 0 96zM192 224c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8-7.2-16-16-16zM352 0L544 0c17.7 0 32 14.3 32 32l0 32L320 64l0-32c0-17.7 14.3-32 32-32zM320 96l24 0 208 0 24 0 0 24 0 368c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8-160 0 0 8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-368 0-24zM512 224c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8-7.2-16-16-16z"]
};
const faHockeyPuck = {
  prefix: 'fas',
  iconName: 'hockey-puck',
  icon: [512, 512, [], "f453", "M256 256C114.6 256 0 213 0 160s114.6-96 256-96s256 43 256 96s-114.6 96-256 96zm192.3 1.8c24.7-9.3 46.9-21 63.7-35.6L512 352c0 53-114.6 96-256 96S0 405 0 352L0 222.3c16.8 14.6 39 26.3 63.7 35.6C114.5 276.9 182.5 288 256 288s141.5-11.1 192.3-30.2z"]
};
const faTable = {
  prefix: 'fas',
  iconName: 'table',
  icon: [512, 512, [], "f0ce", "M64 256l0-96 160 0 0 96L64 256zm0 64l160 0 0 96L64 416l0-96zm224 96l0-96 160 0 0 96-160 0zM448 256l-160 0 0-96 160 0 0 96zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"]
};
const faMagnifyingGlassArrowRight = {
  prefix: 'fas',
  iconName: 'magnifying-glass-arrow-right',
  icon: [512, 512, [], "e521", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM241 119c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31L120 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l118.1 0-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9l-72-72z"]
};
const faTachographDigital = {
  prefix: 'fas',
  iconName: 'tachograph-digital',
  icon: [640, 512, ["digital-tachograph"], "f566", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l512 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm32 64l224 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L96 256c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zM64 368c0-8.8 7.2-16 16-16l256 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 384c-8.8 0-16-7.2-16-16zm320 0c0-8.8 7.2-16 16-16l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16zM80 288a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm80-16a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm80-16a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faDigitalTachograph = faTachographDigital;
const faUsersSlash = {
  prefix: 'fas',
  iconName: 'users-slash',
  icon: [640, 512, [], "e073", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L440.6 320l178.1 0c11.8 0 21.3-9.6 21.3-21.3C640 239.8 592.2 192 533.3 192l-42.7 0c-15.9 0-31 3.5-44.6 9.7c1.3 7.2 1.9 14.7 1.9 22.3c0 30.2-10.5 58-28 79.9l-25.2-19.7C408.1 267.7 416 246.8 416 224c0-53-43-96-96-96c-31.1 0-58.7 14.8-76.3 37.7l-40.6-31.8c13-14.2 20.9-33.1 20.9-53.9c0-44.2-35.8-80-80-80C116.3 0 91.9 14.1 77.5 35.5L38.8 5.1zM106.7 192C47.8 192 0 239.8 0 298.7C0 310.4 9.6 320 21.3 320l213.3 0c.2 0 .4 0 .7 0c-20.6-18.2-35.2-42.8-40.8-70.8L121.8 192l-15.2 0zM261.3 352C187.7 352 128 411.7 128 485.3c0 14.7 11.9 26.7 26.7 26.7l330.7 0c10.5 0 19.5-6 23.9-14.8L324.9 352l-63.6 0zM512 160A80 80 0 1 0 512 0a80 80 0 1 0 0 160z"]
};
const faClover = {
  prefix: 'fas',
  iconName: 'clover',
  icon: [448, 512, [], "e139", "M216.6 49.9C205.1 38.5 189.5 32 173.3 32C139.4 32 112 59.4 112 93.3l0 4.9c0 12 3.3 23.7 9.4 34l18.8 31.3c1.1 1.8 1.2 3.1 1 4.2c-.2 1.2-.8 2.5-2 3.6s-2.4 1.8-3.6 2c-1 .2-2.4 .1-4.2-1l-31.3-18.8c-10.3-6.2-22-9.4-34-9.4l-4.9 0C27.4 144 0 171.4 0 205.3c0 16.2 6.5 31.8 17.9 43.3l1.2 1.2c3.4 3.4 3.4 9 0 12.4l-1.2 1.2C6.5 274.9 0 290.5 0 306.7C0 340.6 27.4 368 61.3 368l4.9 0c12 0 23.7-3.3 34-9.4l31.3-18.8c1.8-1.1 3.1-1.2 4.2-1c1.2 .2 2.5 .8 3.6 2s1.8 2.4 2 3.6c.2 1 .1 2.4-1 4.2l-18.8 31.3c-6.2 10.3-9.4 22-9.4 34l0 4.9c0 33.8 27.4 61.3 61.3 61.3c16.2 0 31.8-6.5 43.3-17.9l1.2-1.2c3.4-3.4 9-3.4 12.4 0l1.2 1.2c11.5 11.5 27.1 17.9 43.3 17.9c33.8 0 61.3-27.4 61.3-61.3l0-4.9c0-12-3.3-23.7-9.4-34l-18.8-31.3c-1.1-1.8-1.2-3.1-1-4.2c.2-1.2 .8-2.5 2-3.6s2.4-1.8 3.6-2c1-.2 2.4-.1 4.2 1l31.3 18.8c10.3 6.2 22 9.4 34 9.4l4.9 0c33.8 0 61.3-27.4 61.3-61.3c0-16.2-6.5-31.8-17.9-43.3l-1.2-1.2c-3.4-3.4-3.4-9 0-12.4l1.2-1.2c11.5-11.5 17.9-27.1 17.9-43.3c0-33.8-27.4-61.3-61.3-61.3l-4.9 0c-12 0-23.7 3.3-34 9.4l-31.3 18.8c-1.8 1.1-3.1 1.2-4.2 1c-1.2-.2-2.5-.8-3.6-2s-1.8-2.4-2-3.6c-.2-1-.1-2.4 1-4.2l18.8-31.3c6.2-10.3 9.4-22 9.4-34l0-4.9C336 59.4 308.6 32 274.7 32c-16.2 0-31.8 6.5-43.3 17.9l-1.2 1.2c-3.4 3.4-9 3.4-12.4 0l-1.2-1.2z"]
};
const faReply = {
  prefix: 'fas',
  iconName: 'reply',
  icon: [512, 512, [61714, "mail-reply"], "f3e5", "M205 34.8c11.5 5.1 19 16.6 19 29.2l0 64 112 0c97.2 0 176 78.8 176 176c0 113.3-81.5 163.9-100.2 174.1c-2.5 1.4-5.3 1.9-8.1 1.9c-10.9 0-19.7-8.9-19.7-19.7c0-7.5 4.3-14.4 9.8-19.5c9.4-8.8 22.2-26.4 22.2-56.7c0-53-43-96-96-96l-96 0 0 64c0 12.6-7.4 24.1-19 29.2s-25 3-34.4-5.4l-160-144C3.9 225.7 0 217.1 0 208s3.9-17.7 10.6-23.8l160-144c9.4-8.5 22.9-10.6 34.4-5.4z"]
};
const faMailReply = faReply;
const faStarAndCrescent = {
  prefix: 'fas',
  iconName: 'star-and-crescent',
  icon: [512, 512, [9770], "f699", "M0 256C0 114.6 114.6 0 256 0c33 0 64.6 6.3 93.6 17.7c7.4 2.9 11.5 10.7 9.8 18.4s-8.8 13-16.7 12.4c-4.8-.3-9.7-.5-14.6-.5c-114.9 0-208 93.1-208 208s93.1 208 208 208c4.9 0 9.8-.2 14.6-.5c7.9-.5 15 4.7 16.7 12.4s-2.4 15.5-9.8 18.4C320.6 505.7 289 512 256 512C114.6 512 0 397.4 0 256zM375.4 137.4c3.5-7.1 13.7-7.1 17.2 0l31.5 63.8c1.4 2.8 4.1 4.8 7.2 5.3l70.4 10.2c7.9 1.1 11 10.8 5.3 16.4l-50.9 49.6c-2.3 2.2-3.3 5.4-2.8 8.5l12 70.1c1.3 7.8-6.9 13.8-13.9 10.1l-63-33.1c-2.8-1.5-6.1-1.5-8.9 0l-63 33.1c-7 3.7-15.3-2.3-13.9-10.1l12-70.1c.5-3.1-.5-6.3-2.8-8.5L261 233.1c-5.7-5.6-2.6-15.2 5.3-16.4l70.4-10.2c3.1-.5 5.8-2.4 7.2-5.3l31.5-63.8z"]
};
const faHouseFire = {
  prefix: 'fas',
  iconName: 'house-fire',
  icon: [640, 512, [], "e50c", "M288 350.1l0 1.9-32 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L447.3 128.1c-12.3-1-25 3-34.8 11.7c-35.4 31.6-65.6 67.7-87.3 102.8C304.3 276.5 288 314.9 288 350.1zM480 512c-88.4 0-160-71.6-160-160c0-76.7 62.5-144.7 107.2-179.4c5-3.9 10.9-5.8 16.8-5.8c7.9-.1 16 3.1 22 9.2l46 46 11.3-11.3c11.7-11.7 30.6-12.7 42.3-1C624.5 268 640 320.2 640 352c0 88.4-71.6 160-160 160zm64-111.8c0-36.5-37-73-54.8-88.4c-5.4-4.7-13.1-4.7-18.5 0C453 327.1 416 363.6 416 400.2c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faSquareMinus = {
  prefix: 'fas',
  iconName: 'square-minus',
  icon: [448, 512, [61767, "minus-square"], "f146", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm88 200l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faMinusSquare = faSquareMinus;
const faHelicopter = {
  prefix: 'fas',
  iconName: 'helicopter',
  icon: [640, 512, [128641], "f533", "M128 32c0-17.7 14.3-32 32-32L544 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L384 64l0 64 32 0c88.4 0 160 71.6 160 160l0 64c0 17.7-14.3 32-32 32l-160 0-64 0c-20.1 0-39.1-9.5-51.2-25.6l-71.4-95.2c-3.5-4.7-8.3-8.3-13.7-10.5L47.2 198.1c-9.5-3.8-16.7-12-19.2-22L5 83.9C2.4 73.8 10.1 64 20.5 64L48 64c10.1 0 19.6 4.7 25.6 12.8L112 128l208 0 0-64L160 64c-17.7 0-32-14.3-32-32zM384 320l128 0 0-32c0-53-43-96-96-96l-32 0 0 128zM630.6 425.4c12.5 12.5 12.5 32.8 0 45.3l-3.9 3.9c-24 24-56.6 37.5-90.5 37.5L256 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l280.2 0c17 0 33.3-6.7 45.3-18.7l3.9-3.9c12.5-12.5 32.8-12.5 45.3 0z"]
};
const faCompass = {
  prefix: 'fas',
  iconName: 'compass',
  icon: [512, 512, [129517], "f14e", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm50.7-186.9L162.4 380.6c-19.4 7.5-38.5-11.6-31-31l55.5-144.3c3.3-8.5 9.9-15.1 18.4-18.4l144.3-55.5c19.4-7.5 38.5 11.6 31 31L325.1 306.7c-3.2 8.5-9.9 15.1-18.4 18.4zM288 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faSquareCaretDown = {
  prefix: 'fas',
  iconName: 'square-caret-down',
  icon: [448, 512, ["caret-square-down"], "f150", "M384 480c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0zM224 352c-6.7 0-13-2.8-17.6-7.7l-104-112c-6.5-7-8.2-17.2-4.4-25.9s12.5-14.4 22-14.4l208 0c9.5 0 18.2 5.7 22 14.4s2.1 18.9-4.4 25.9l-104 112c-4.5 4.9-10.9 7.7-17.6 7.7z"]
};
const faCaretSquareDown = faSquareCaretDown;
const faFileCircleQuestion = {
  prefix: 'fas',
  iconName: 'file-circle-question',
  icon: [576, 512, [], "e4ef", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM368 321.6l0 6.4c0 8.8 7.2 16 16 16s16-7.2 16-16l0-6.4c0-5.3 4.3-9.6 9.6-9.6l40.5 0c7.7 0 13.9 6.2 13.9 13.9c0 5.2-2.9 9.9-7.4 12.3l-32 16.8c-5.3 2.8-8.6 8.2-8.6 14.2l0 14.8c0 8.8 7.2 16 16 16s16-7.2 16-16l0-5.1 23.5-12.3c15.1-7.9 24.5-23.6 24.5-40.6c0-25.4-20.6-45.9-45.9-45.9l-40.5 0c-23 0-41.6 18.6-41.6 41.6z"]
};
const faLaptopCode = {
  prefix: 'fas',
  iconName: 'laptop-code',
  icon: [640, 512, [], "f5fc", "M64 96c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 256-64 0 0-256L128 96l0 256-64 0L64 96zM0 403.2C0 392.6 8.6 384 19.2 384l601.6 0c10.6 0 19.2 8.6 19.2 19.2c0 42.4-34.4 76.8-76.8 76.8L76.8 480C34.4 480 0 445.6 0 403.2zM281 209l-31 31 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-48-48c-9.4-9.4-9.4-24.6 0-33.9l48-48c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM393 175l48 48c9.4 9.4 9.4 24.6 0 33.9l-48 48c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"]
};
const faSwatchbook = {
  prefix: 'fas',
  iconName: 'swatchbook',
  icon: [512, 512, [], "f5c3", "M0 32C0 14.3 14.3 0 32 0L160 0c17.7 0 32 14.3 32 32l0 384c0 53-43 96-96 96s-96-43-96-96L0 32zM223.6 425.9c.3-3.3 .4-6.6 .4-9.9l0-262 75.4-75.4c12.5-12.5 32.8-12.5 45.3 0l90.5 90.5c12.5 12.5 12.5 32.8 0 45.3L223.6 425.9zM182.8 512l192-192L480 320c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-297.2 0zM128 64L64 64l0 64 64 0 0-64zM64 192l0 64 64 0 0-64-64 0zM96 440a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faPrescriptionBottle = {
  prefix: 'fas',
  iconName: 'prescription-bottle',
  icon: [384, 512, [], "f485", "M0 32C0 14.3 14.3 0 32 0L352 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64L0 32zm32 96l320 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-32 112 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L32 384l0-64 112 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L32 288l0-64 112 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L32 192l0-64z"]
};
const faBars = {
  prefix: 'fas',
  iconName: 'bars',
  icon: [448, 512, ["navicon"], "f0c9", "M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
};
const faNavicon = faBars;
const faPeopleGroup = {
  prefix: 'fas',
  iconName: 'people-group',
  icon: [640, 512, [], "e533", "M72 88a56 56 0 1 1 112 0A56 56 0 1 1 72 88zM64 245.7C54 256.9 48 271.8 48 288s6 31.1 16 42.3l0-84.7zm144.4-49.3C178.7 222.7 160 261.2 160 304c0 34.3 12 65.8 32 90.5l0 21.5c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-26.8C26.2 371.2 0 332.7 0 288c0-61.9 50.1-112 112-112l32 0c24 0 46.2 7.5 64.4 20.3zM448 416l0-21.5c20-24.7 32-56.2 32-90.5c0-42.8-18.7-81.3-48.4-107.7C449.8 183.5 472 176 496 176l32 0c61.9 0 112 50.1 112 112c0 44.7-26.2 83.2-64 101.2l0 26.8c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32zm8-328a56 56 0 1 1 112 0A56 56 0 1 1 456 88zM576 245.7l0 84.7c10-11.3 16-26.1 16-42.3s-6-31.1-16-42.3zM320 32a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM240 304c0 16.2 6 31 16 42.3l0-84.7c-10 11.3-16 26.1-16 42.3zm144-42.3l0 84.7c10-11.3 16-26.1 16-42.3s-6-31.1-16-42.3zM448 304c0 44.7-26.2 83.2-64 101.2l0 42.8c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-42.8c-37.8-18-64-56.5-64-101.2c0-61.9 50.1-112 112-112l32 0c61.9 0 112 50.1 112 112z"]
};
const faHourglassEnd = {
  prefix: 'fas',
  iconName: 'hourglass-end',
  icon: [384, 512, [8987, "hourglass-3"], "f253", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1L146.7 256 78.9 323.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 256 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1L237.3 256l67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32s-14.3-32-32-32L320 0 64 0 32 0zM96 75l0-11 192 0 0 11c0 25.5-10.1 49.9-28.1 67.9L192 210.7l-67.9-67.9C106.1 124.9 96 100.4 96 75z"]
};
const faHourglass3 = faHourglassEnd;
const faHeartCrack = {
  prefix: 'fas',
  iconName: 'heart-crack',
  icon: [512, 512, [128148, "heart-broken"], "f7a9", "M119.4 44.1c23.3-3.9 46.8-1.9 68.6 5.3l49.8 77.5-75.4 75.4c-1.5 1.5-2.4 3.6-2.3 5.8s1 4.2 2.6 5.7l112 104c2.9 2.7 7.4 2.9 10.5 .3s3.8-7 1.7-10.4l-60.4-98.1 90.7-75.6c2.6-2.1 3.5-5.7 2.4-8.8L296.8 61.8c28.5-16.7 62.4-23.2 95.7-17.6C461.5 55.6 512 115.2 512 185.1l0 5.8c0 41.5-17.2 81.2-47.6 109.5L283.7 469.1c-7.5 7-17.4 10.9-27.7 10.9s-20.2-3.9-27.7-10.9L47.6 300.4C17.2 272.1 0 232.4 0 190.9l0-5.8c0-69.9 50.5-129.5 119.4-141z"]
};
const faHeartBroken = faHeartCrack;
const faSquareUpRight = {
  prefix: 'fas',
  iconName: 'square-up-right',
  icon: [448, 512, [8599, "external-link-square-alt"], "f360", "M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM160 160c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l40 40-71 71C114 302 112 306.9 112 312s2 10 5.7 13.7l36.7 36.7c3.6 3.6 8.5 5.7 13.7 5.7s10-2 13.7-5.7l71-71 40 40c4.6 4.6 11.5 5.9 17.4 3.5s9.9-8.3 9.9-14.8l0-144c0-8.8-7.2-16-16-16l-144 0z"]
};
const faExternalLinkSquareAlt = faSquareUpRight;
const faFaceKissBeam = {
  prefix: 'fas',
  iconName: 'face-kiss-beam',
  icon: [512, 512, [128537, "kiss-beam"], "f597", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm48.7-198.3c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C274.7 443.1 257.4 448 240 448c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1 .3-.2 .6-.4c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.4-.3-.5-.3-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4zm-87.1-84.9s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faKissBeam = faFaceKissBeam;
const faFilm = {
  prefix: 'fas',
  iconName: 'film',
  icon: [512, 512, [127902], "f008", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM48 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm368-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM48 240l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm368-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM48 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L64 96c-8.8 0-16 7.2-16 16zM416 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM160 128l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L192 96c-17.7 0-32 14.3-32 32zm32 160c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-128 0z"]
};
const faRulerHorizontal = {
  prefix: 'fas',
  iconName: 'ruler-horizontal',
  icon: [640, 512, [], "f547", "M0 336c0 26.5 21.5 48 48 48l544 0c26.5 0 48-21.5 48-48l0-160c0-26.5-21.5-48-48-48l-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0c-26.5 0-48 21.5-48 48L0 336z"]
};
const faPeopleRobbery = {
  prefix: 'fas',
  iconName: 'people-robbery',
  icon: [576, 512, [], "e536", "M488.2 59.1C478.1 99.6 441.7 128 400 128s-78.1-28.4-88.2-68.9L303 24.2C298.8 7.1 281.4-3.3 264.2 1S236.7 22.6 241 39.8l8.7 34.9c11 44 40.2 79.6 78.3 99.6L328 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-305.7c38.1-20 67.3-55.6 78.3-99.6L559 39.8c4.3-17.1-6.1-34.5-23.3-38.8S501.2 7.1 497 24.2l-8.7 34.9zM400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM80 96A48 48 0 1 0 80 0a48 48 0 1 0 0 96zm-8 32c-35.3 0-64 28.7-64 64l0 96 0 .6L8 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-227.3 13 20.5c5.9 9.2 16.1 14.9 27 14.9l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-30.4 0-37.4-58.9C157.6 142 132.1 128 104.7 128L72 128z"]
};
const faLightbulb = {
  prefix: 'fas',
  iconName: 'lightbulb',
  icon: [384, 512, [128161], "f0eb", "M272 384c9.6-31.9 29.5-59.1 49.2-86.2c0 0 0 0 0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C368 78.8 289.2 0 192 0S16 78.8 16 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4c0 0 0 0 0 0c19.8 27.1 39.7 54.4 49.2 86.2l160 0zM192 512c44.2 0 80-35.8 80-80l0-16-160 0 0 16c0 44.2 35.8 80 80 80zM112 176c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80z"]
};
const faCaretLeft = {
  prefix: 'fas',
  iconName: 'caret-left',
  icon: [256, 512, [], "f0d9", "M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"]
};
const faCircleExclamation = {
  prefix: 'fas',
  iconName: 'circle-exclamation',
  icon: [512, 512, ["exclamation-circle"], "f06a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faExclamationCircle = faCircleExclamation;
const faSchoolCircleXmark = {
  prefix: 'fas',
  iconName: 'school-circle-xmark',
  icon: [640, 512, [], "e56d", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l272 0s0 0 0 0l-64 0 0-96c0-35.3 28.7-64 64-64l.3 0 .5 0c3.4-37.7 18.7-72.1 42.2-99.1C350.2 260 335.6 264 320 264c-48.6 0-88-39.4-88-88s39.4-88 88-88s88 39.4 88 88c0 18.3-5.6 35.3-15.1 49.4c29-21 64.6-33.4 103.1-33.4c59.5 0 112.1 29.6 144 74.8L640 144c0-26.5-21.5-48-48-48L473.7 96 337.8 5.4zM96 192l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm0 128l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zM320 128c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16c0-8.8-7.2-16-16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm22.6-144l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L518.6 368z"]
};
const faArrowRightFromBracket = {
  prefix: 'fas',
  iconName: 'arrow-right-from-bracket',
  icon: [512, 512, ["sign-out"], "f08b", "M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 192 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128zM160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0z"]
};
const faSignOut = faArrowRightFromBracket;
const faCircleChevronDown = {
  prefix: 'fas',
  iconName: 'circle-chevron-down',
  icon: [512, 512, ["chevron-circle-down"], "f13a", "M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM135 241c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l87 87 87-87c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 345c-9.4 9.4-24.6 9.4-33.9 0L135 241z"]
};
const faChevronCircleDown = faCircleChevronDown;
const faUnlockKeyhole = {
  prefix: 'fas',
  iconName: 'unlock-keyhole',
  icon: [448, 512, ["unlock-alt"], "f13e", "M224 64c-44.2 0-80 35.8-80 80l0 48 240 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0 0-48C80 64.5 144.5 0 224 0c57.5 0 107 33.7 130.1 82.3c7.6 16 .8 35.1-15.2 42.6s-35.1 .8-42.6-15.2C283.4 82.6 255.9 64 224 64zm32 320c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0z"]
};
const faUnlockAlt = faUnlockKeyhole;
const faCloudShowersHeavy = {
  prefix: 'fas',
  iconName: 'cloud-showers-heavy',
  icon: [512, 512, [], "f740", "M96 320c-53 0-96-43-96-96c0-42.5 27.6-78.6 65.9-91.2C64.7 126.1 64 119.1 64 112C64 50.1 114.1 0 176 0c43.1 0 80.5 24.3 99.2 60c14.7-17.1 36.5-28 60.8-28c44.2 0 80 35.8 80 80c0 5.5-.6 10.8-1.6 16c.5 0 1.1 0 1.6 0c53 0 96 43 96 96s-43 96-96 96L96 320zM81.5 353.9c12.2 5.2 17.8 19.3 12.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6S-3.3 490.7 1.9 478.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6zm120 0c12.2 5.2 17.8 19.3 12.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6s-17.8-19.3-12.6-31.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6zm244.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6s-17.8-19.3-12.6-31.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6s17.8 19.3 12.6 31.5zM313.5 353.9c12.2 5.2 17.8 19.3 12.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6s-17.8-19.3-12.6-31.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6z"]
};
const faHeadphonesSimple = {
  prefix: 'fas',
  iconName: 'headphones-simple',
  icon: [512, 512, ["headphones-alt"], "f58f", "M256 80C141.1 80 48 173.1 48 288l0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24L0 288C0 146.6 114.6 32 256 32s256 114.6 256 256l0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-104c0-114.9-93.1-208-208-208zM80 352c0-35.3 28.7-64 64-64l16 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-16 0c-35.3 0-64-28.7-64-64l0-64zm288-64c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-16 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l16 0z"]
};
const faHeadphonesAlt = faHeadphonesSimple;
const faSitemap = {
  prefix: 'fas',
  iconName: 'sitemap',
  icon: [576, 512, [], "f0e8", "M208 80c0-26.5 21.5-48 48-48l64 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-8 0 0 40 152 0c30.9 0 56 25.1 56 56l0 32 8 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-64 0c-26.5 0-48-21.5-48-48l0-64c0-26.5 21.5-48 48-48l8 0 0-32c0-4.4-3.6-8-8-8l-152 0 0 40 8 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-64 0c-26.5 0-48-21.5-48-48l0-64c0-26.5 21.5-48 48-48l8 0 0-40-152 0c-4.4 0-8 3.6-8 8l0 32 8 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-64 0c-26.5 0-48-21.5-48-48l0-64c0-26.5 21.5-48 48-48l8 0 0-32c0-30.9 25.1-56 56-56l152 0 0-40-8 0c-26.5 0-48-21.5-48-48l0-64z"]
};
const faCircleDollarToSlot = {
  prefix: 'fas',
  iconName: 'circle-dollar-to-slot',
  icon: [512, 512, ["donate"], "f4b9", "M326.7 403.7c-22.1 8-45.9 12.3-70.7 12.3s-48.7-4.4-70.7-12.3l-.8-.3c-30-11-56.8-28.7-78.6-51.4C70 314.6 48 263.9 48 208C48 93.1 141.1 0 256 0S464 93.1 464 208c0 55.9-22 106.6-57.9 144c-1 1-2 2.1-3 3.1c-21.4 21.4-47.4 38.1-76.3 48.6zM256 91.9c-11.1 0-20.1 9-20.1 20.1l0 6c-5.6 1.2-10.9 2.9-15.9 5.1c-15 6.8-27.9 19.4-31.1 37.7c-1.8 10.2-.8 20 3.4 29c4.2 8.8 10.7 15 17.3 19.5c11.6 7.9 26.9 12.5 38.6 16l2.2 .7c13.9 4.2 23.4 7.4 29.3 11.7c2.5 1.8 3.4 3.2 3.7 4c.3 .8 .9 2.6 .2 6.7c-.6 3.5-2.5 6.4-8 8.8c-6.1 2.6-16 3.9-28.8 1.9c-6-1-16.7-4.6-26.2-7.9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-2.2-.7-4.3-1.5-6.4-2.1c-10.5-3.5-21.8 2.2-25.3 12.7s2.2 21.8 12.7 25.3c1.2 .4 2.7 .9 4.4 1.5c7.9 2.7 20.3 6.9 29.8 9.1l0 6.4c0 11.1 9 20.1 20.1 20.1s20.1-9 20.1-20.1l0-5.5c5.3-1 10.5-2.5 15.4-4.6c15.7-6.7 28.4-19.7 31.6-38.7c1.8-10.4 1-20.3-3-29.4c-3.9-9-10.2-15.6-16.9-20.5c-12.2-8.8-28.3-13.7-40.4-17.4l-.8-.2c-14.2-4.3-23.8-7.3-29.9-11.4c-2.6-1.8-3.4-3-3.6-3.5c-.2-.3-.7-1.6-.1-5c.3-1.9 1.9-5.2 8.2-8.1c6.4-2.9 16.4-4.5 28.6-2.6c4.3 .7 17.9 3.3 21.7 4.3c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-4.4-1.2-14.4-3.2-21-4.4l0-6.3c0-11.1-9-20.1-20.1-20.1zM48 352l16 0c19.5 25.9 44 47.7 72.2 64L64 416l0 32 192 0 192 0 0-32-72.2 0c28.2-16.3 52.8-38.1 72.2-64l16 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48l0-64c0-26.5 21.5-48 48-48z"]
};
const faDonate = faCircleDollarToSlot;
const faMemory = {
  prefix: 'fas',
  iconName: 'memory',
  icon: [576, 512, [], "f538", "M64 64C28.7 64 0 92.7 0 128l0 7.4c0 6.8 4.4 12.6 10.1 16.3C23.3 160.3 32 175.1 32 192s-8.7 31.7-21.9 40.3C4.4 236 0 241.8 0 248.6L0 320l576 0 0-71.4c0-6.8-4.4-12.6-10.1-16.3C552.7 223.7 544 208.9 544 192s8.7-31.7 21.9-40.3c5.7-3.7 10.1-9.5 10.1-16.3l0-7.4c0-35.3-28.7-64-64-64L64 64zM576 352L0 352l0 64c0 17.7 14.3 32 32 32l48 0 0-32c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 96 0 0-32c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 96 0 0-32c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 96 0 0-32c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 48 0c17.7 0 32-14.3 32-32l0-64zM192 160l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faRoadSpikes = {
  prefix: 'fas',
  iconName: 'road-spikes',
  icon: [640, 512, [], "e568", "M64 116.8c0-15.8 20.5-22 29.3-8.9L192 256l0-139.2c0-15.8 20.5-22 29.3-8.9L320 256l0-139.2c0-15.8 20.5-22 29.3-8.9L448 256l0-139.2c0-15.8 20.5-22 29.3-8.9L606.8 302.2c14.2 21.3-1.1 49.7-26.6 49.7L512 352l-64 0-64 0-64 0-64 0-64 0L64 352l0-235.2zM32 384l576 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faFireBurner = {
  prefix: 'fas',
  iconName: 'fire-burner',
  icon: [640, 512, [], "e4f1", "M345.7 48.3L358 34.5c5.4-6.1 13.3-8.8 20.9-8.9c7.2 0 14.3 2.6 19.9 7.8c19.7 18.3 39.8 43.2 55 70.6C469 131.2 480 162.2 480 192.2C480 280.8 408.7 352 320 352c-89.6 0-160-71.3-160-159.8c0-37.3 16-73.4 36.8-104.5c20.9-31.3 47.5-59 70.9-80.2C273.4 2.3 280.7-.2 288 0c14.1 .3 23.8 11.4 32.7 21.6c0 0 0 0 0 0c2 2.3 4 4.6 6 6.7l19 19.9zM384 240.2c0-36.5-37-73-54.8-88.4c-5.4-4.7-13.1-4.7-18.5 0C293 167.1 256 203.6 256 240.2c0 35.3 28.7 64 64 64s64-28.7 64-64zM32 288c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 64 448 0 0-64c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 96c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l0-96zM320 480a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm160-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM192 480a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faFlag = {
  prefix: 'fas',
  iconName: 'flag',
  icon: [448, 512, [127988, 61725], "f024", "M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32L0 64 0 368 0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 64.3-16.1c41.1-10.3 84.6-5.5 122.5 13.4c44.2 22.1 95.5 24.8 141.7 7.4l34.7-13c12.5-4.7 20.8-16.6 20.8-30l0-247.7c0-23-24.2-38-44.8-27.7l-9.6 4.8c-46.3 23.2-100.8 23.2-147.1 0c-35.1-17.6-75.4-22-113.5-12.5L64 48l0-16z"]
};
const faHanukiah = {
  prefix: 'fas',
  iconName: 'hanukiah',
  icon: [640, 512, [128334], "f6e6", "M314.2 3.3C309.1 12.1 296 36.6 296 56c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7C324.6 1.2 322.4 0 320 0s-4.6 1.2-5.8 3.3zm-288 48C21.1 60.1 8 84.6 8 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7C36.6 49.2 34.4 48 32 48s-4.6 1.2-5.8 3.3zM88 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C101.1 60.1 88 84.6 88 104zm82.2-52.7C165.1 60.1 152 84.6 152 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM216 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C229.1 60.1 216 84.6 216 104zM394.2 51.3C389.1 60.1 376 84.6 376 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM440 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C453.1 60.1 440 84.6 440 104zm82.2-52.7C517.1 60.1 504 84.6 504 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM584 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C597.1 60.1 584 84.6 584 104zM112 160c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm160 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zM352 144c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176L96 320c-17.7 0-32-14.3-32-32l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 53 43 96 96 96l192 0 0 64-128 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-128 0 0-64 192 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32l-192 0 0-176z"]
};
const faFeather = {
  prefix: 'fas',
  iconName: 'feather',
  icon: [512, 512, [129718], "f52d", "M278.5 215.6L23 471c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l57-57 68 0c49.7 0 97.9-14.4 139-41c11.1-7.2 5.5-23-7.8-23c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l81-24.3c2.5-.8 4.8-2.1 6.7-4l22.4-22.4c10.1-10.1 2.9-27.3-11.3-27.3l-32.2 0c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l112-33.6c4-1.2 7.4-3.9 9.3-7.7C506.4 207.6 512 184.1 512 160c0-41-16.3-80.3-45.3-109.3l-5.5-5.5C432.3 16.3 393 0 352 0s-80.3 16.3-109.3 45.3L139 149C91 197 64 262.1 64 330l0 55.3L253.6 195.8c6.2-6.2 16.4-6.2 22.6 0c5.4 5.4 6.1 13.6 2.2 19.8z"]
};
const faVolumeLow = {
  prefix: 'fas',
  iconName: 'volume-low',
  icon: [448, 512, [128264, "volume-down"], "f027", "M301.1 34.8C312.6 40 320 51.4 320 64l0 384c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352 64 352c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l67.8 0L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM412.6 181.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5z"]
};
const faVolumeDown = faVolumeLow;
const faCommentSlash = {
  prefix: 'fas',
  iconName: 'comment-slash',
  icon: [640, 512, [], "f4b3", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L512.9 376.7C552.2 340.2 576 292.3 576 240C576 125.1 461.4 32 320 32c-67.7 0-129.3 21.4-175.1 56.3L38.8 5.1zm385.2 425L82.9 161.3C70.7 185.6 64 212.2 64 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9c37 0 72.3-6.4 104.1-17.9z"]
};
const faCloudSunRain = {
  prefix: 'fas',
  iconName: 'cloud-sun-rain',
  icon: [640, 512, [127782], "f743", "M294.2 1.2c5.1 2.1 8.7 6.7 9.6 12.1l10.4 62.4c-23.3 10.8-42.9 28.4-56 50.3c-14.6-9-31.8-14.1-50.2-14.1c-53 0-96 43-96 96c0 35.5 19.3 66.6 48 83.2c.8 31.8 13.2 60.7 33.1 82.7l-56 39.2c-4.5 3.2-10.3 3.8-15.4 1.6s-8.7-6.7-9.6-12.1L98.1 317.9 13.4 303.8c-5.4-.9-10-4.5-12.1-9.6s-1.5-10.9 1.6-15.4L52.5 208 2.9 137.2c-3.2-4.5-3.8-10.3-1.6-15.4s6.7-8.7 12.1-9.6L98.1 98.1l14.1-84.7c.9-5.4 4.5-10 9.6-12.1s10.9-1.5 15.4 1.6L208 52.5 278.8 2.9c4.5-3.2 10.3-3.8 15.4-1.6zM208 144c13.8 0 26.7 4.4 37.1 11.9c-1.2 4.1-2.2 8.3-3 12.6c-37.9 14.6-67.2 46.6-77.8 86.4C151.8 243.1 144 226.5 144 208c0-35.3 28.7-64 64-64zm69.4 276c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm96 0c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm96 0c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm96 0c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm74.5-116.1c0 44.2-35.8 80-80 80l-271.9 0c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]
};
const faCompress = {
  prefix: 'fas',
  iconName: 'compress',
  icon: [448, 512, [], "f066", "M160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 320c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0z"]
};
const faWheatAwn = {
  prefix: 'fas',
  iconName: 'wheat-awn',
  icon: [512, 512, ["wheat-alt"], "e2cd", "M505 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L383 95c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l88-88zM305.5 27.3c-6.2-6.2-16.4-6.2-22.6 0L271.5 38.6c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0l-11.3 11.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8L101.8 231c-6.2-6.2-16.4-6.2-22.6 0L67.9 242.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4L9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l68.9-68.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-21.8-21.8-49.6-34.1-78.1-36.9l31.9-31.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-21.8-21.8-49.6-34.1-78.1-36.9l31.9-31.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0L486.5 231c6.2-6.2 6.2-16.4 0-22.6L475.2 197c-5.2-5.2-10.6-9.8-16.4-13.9L505 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-59.4 59.4c-20.6-4.4-42-3.7-62.3 2.1c6.1-21.3 6.6-43.8 1.4-65.3L409 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L329.1 52.9c-3.7-5-7.8-9.8-12.4-14.3L305.5 27.3z"]
};
const faWheatAlt = faWheatAwn;
const faAnkh = {
  prefix: 'fas',
  iconName: 'ankh',
  icon: [320, 512, [9765], "f644", "M96 128c0-35.3 28.7-64 64-64s64 28.7 64 64c0 41.6-20.7 76.6-46.6 104.1c-5.9 6.2-11.8 11.8-17.4 16.7c-5.6-4.9-11.5-10.5-17.4-16.7C116.7 204.6 96 169.6 96 128zM160 0C89.3 0 32 57.3 32 128c0 52.4 21.5 95.5 46.8 128L32 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-46.8 0c25.4-32.5 46.8-75.6 46.8-128C288 57.3 230.7 0 160 0z"]
};
const faHandsHoldingChild = {
  prefix: 'fas',
  iconName: 'hands-holding-child',
  icon: [640, 512, [], "e4fa", "M320 0a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm44.7 164.3L375.8 253c1.6 13.2-7.7 25.1-20.8 26.8s-25.1-7.7-26.8-20.8l-4.4-35-7.6 0-4.4 35c-1.6 13.2-13.6 22.5-26.8 20.8s-22.5-13.6-20.8-26.8l11.1-88.8L255.5 181c-10.1 8.6-25.3 7.3-33.8-2.8s-7.3-25.3 2.8-33.8l27.9-23.6C271.3 104.8 295.3 96 320 96s48.7 8.8 67.6 24.7l27.9 23.6c10.1 8.6 11.4 23.7 2.8 33.8s-23.7 11.4-33.8 2.8l-19.8-16.7zM40 64c22.1 0 40 17.9 40 40l0 40 0 80 0 40.2c0 17 6.7 33.3 18.7 45.3l51.1 51.1c8.3 8.3 21.3 9.6 31 3.1c12.9-8.6 14.7-26.9 3.7-37.8l-15.2-15.2-32-32c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l32 32 15.2 15.2c0 0 0 0 0 0l25.3 25.3c21 21 32.8 49.5 32.8 79.2l0 78.9c0 26.5-21.5 48-48 48l-66.7 0c-17 0-33.3-6.7-45.3-18.7L28.1 393.4C10.1 375.4 0 351 0 325.5L0 224l0-64 0-56C0 81.9 17.9 64 40 64zm560 0c22.1 0 40 17.9 40 40l0 56 0 64 0 101.5c0 25.5-10.1 49.9-28.1 67.9L512 493.3c-12 12-28.3 18.7-45.3 18.7L400 512c-26.5 0-48-21.5-48-48l0-78.9c0-29.7 11.8-58.2 32.8-79.2l25.3-25.3c0 0 0 0 0 0l15.2-15.2 32-32c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-32 32-15.2 15.2c-11 11-9.2 29.2 3.7 37.8c9.7 6.5 22.7 5.2 31-3.1l51.1-51.1c12-12 18.7-28.3 18.7-45.3l0-40.2 0-80 0-40c0-22.1 17.9-40 40-40z"]
};
const faAsterisk = {
  prefix: 'fas',
  iconName: 'asterisk',
  icon: [384, 512, [10033, 61545], "2a", "M192 32c17.7 0 32 14.3 32 32l0 135.5 111.5-66.9c15.2-9.1 34.8-4.2 43.9 11s4.2 34.8-11 43.9L254.2 256l114.3 68.6c15.2 9.1 20.1 28.7 11 43.9s-28.7 20.1-43.9 11L224 312.5 224 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-135.5L48.5 379.4c-15.2 9.1-34.8 4.2-43.9-11s-4.2-34.8 11-43.9L129.8 256 15.5 187.4c-15.2-9.1-20.1-28.7-11-43.9s28.7-20.1 43.9-11L160 199.5 160 64c0-17.7 14.3-32 32-32z"]
};
const faSquareCheck = {
  prefix: 'fas',
  iconName: 'square-check',
  icon: [448, 512, [9745, 9989, 61510, "check-square"], "f14a", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faCheckSquare = faSquareCheck;
const faPesetaSign = {
  prefix: 'fas',
  iconName: 'peseta-sign',
  icon: [384, 512, [], "e221", "M64 32C46.3 32 32 46.3 32 64l0 96c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 96 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 96 0c77.4 0 142-55 156.8-128l3.2 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-3.2 0C334 87 269.4 32 192 32L64 32zM282.5 160L96 160l0-64 96 0c41.8 0 77.4 26.7 90.5 64zM96 224l186.5 0c-13.2 37.3-48.7 64-90.5 64l-96 0 0-64z"]
};
const faHeading = {
  prefix: 'fas',
  iconName: 'heading',
  icon: [448, 512, ["header"], "f1dc", "M0 64C0 46.3 14.3 32 32 32l48 0 48 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 112 224 0 0-112-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l48 0 48 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 144 0 176 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-144-224 0 0 144 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-176L48 96 32 96C14.3 96 0 81.7 0 64z"]
};
const faHeader = faHeading;
const faGhost = {
  prefix: 'fas',
  iconName: 'ghost',
  icon: [384, 512, [128123], "f6e2", "M40.1 467.1l-11.2 9c-3.2 2.5-7.1 3.9-11.1 3.9C8 480 0 472 0 462.2L0 192C0 86 86 0 192 0S384 86 384 192l0 270.2c0 9.8-8 17.8-17.8 17.8c-4 0-7.9-1.4-11.1-3.9l-11.2-9c-13.4-10.7-32.8-9-44.1 3.9L269.3 506c-3.3 3.8-8.2 6-13.3 6s-9.9-2.2-13.3-6l-26.6-30.5c-12.7-14.6-35.4-14.6-48.2 0L141.3 506c-3.3 3.8-8.2 6-13.3 6s-9.9-2.2-13.3-6L84.2 471c-11.3-12.9-30.7-14.6-44.1-3.9zM160 192a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faList = {
  prefix: 'fas',
  iconName: 'list',
  icon: [512, 512, ["list-squares"], "f03a", "M40 48C26.7 48 16 58.7 16 72l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24L40 48zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM16 232l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0z"]
};
const faListSquares = faList;
const faSquarePhoneFlip = {
  prefix: 'fas',
  iconName: 'square-phone-flip',
  icon: [448, 512, ["phone-square-alt"], "f87b", "M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zm-90.7 96.7c-9.7-2.6-19.9 2.3-23.7 11.6l-20 48c-3.4 8.2-1 17.6 5.8 23.2L280 231.7c-16.6 35.2-45.1 63.7-80.3 80.3l-20.2-24.7c-5.6-6.8-15-9.2-23.2-5.8l-48 20c-9.3 3.9-14.2 14-11.6 23.7l12 44C111.1 378 119 384 128 384c123.7 0 224-100.3 224-224c0-9-6-16.9-14.7-19.3l-44-12z"]
};
const faPhoneSquareAlt = faSquarePhoneFlip;
const faCartPlus = {
  prefix: 'fas',
  iconName: 'cart-plus',
  icon: [576, 512, [], "f217", "M0 24C0 10.7 10.7 0 24 0L69.5 0c22 0 41.5 12.8 50.6 32l411 0c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3l-288.5 0 5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5L488 336c13.3 0 24 10.7 24 24s-10.7 24-24 24l-288.3 0c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5L24 48C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM252 160c0 11 9 20 20 20l44 0 0 44c0 11 9 20 20 20s20-9 20-20l0-44 44 0c11 0 20-9 20-20s-9-20-20-20l-44 0 0-44c0-11-9-20-20-20s-20 9-20 20l0 44-44 0c-11 0-20 9-20 20z"]
};
const faGamepad = {
  prefix: 'fas',
  iconName: 'gamepad',
  icon: [640, 512, [], "f11b", "M192 64C86 64 0 150 0 256S86 448 192 448l256 0c106 0 192-86 192-192s-86-192-192-192L192 64zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32z"]
};
const faCircleDot = {
  prefix: 'fas',
  iconName: 'circle-dot',
  icon: [512, 512, [128280, "dot-circle"], "f192", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faDotCircle = faCircleDot;
const faFaceDizzy = {
  prefix: 'fas',
  iconName: 'face-dizzy',
  icon: [512, 512, ["dizzy"], "f567", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-224a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM100.7 132.7c6.2-6.2 16.4-6.2 22.6 0L160 169.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L182.6 192l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L160 214.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L137.4 192l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6zm192 0c6.2-6.2 16.4-6.2 22.6 0L352 169.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L374.6 192l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L352 214.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L329.4 192l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6z"]
};
const faDizzy = faFaceDizzy;
const faEgg = {
  prefix: 'fas',
  iconName: 'egg',
  icon: [384, 512, [129370], "f7fb", "M192 496C86 496 0 394 0 288C0 176 64 16 192 16s192 160 192 272c0 106-86 208-192 208zM154.8 134c6.5-6 7-16.1 1-22.6s-16.1-7-22.6-1c-23.9 21.8-41.1 52.7-52.3 84.2C69.7 226.1 64 259.7 64 288c0 8.8 7.2 16 16 16s16-7.2 16-16c0-24.5 5-54.4 15.1-82.8c10.1-28.5 25-54.1 43.7-71.2z"]
};
const faHouseMedicalCircleXmark = {
  prefix: 'fas',
  iconName: 'house-medical-circle-xmark',
  icon: [640, 512, [], "e513", "M320 368c0 59.5 29.5 112.1 74.8 144l-266.7 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L522.1 193.9c-8.5-1.3-17.3-1.9-26.1-1.9c-54.7 0-103.5 24.9-135.8 64L320 256l0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm22.6 144l36.7-36.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L496 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L473.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L496 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L518.6 368z"]
};
const faCampground = {
  prefix: 'fas',
  iconName: 'campground',
  icon: [576, 512, [9978], "f6bb", "M377 52c11-13.8 8.8-33.9-5-45s-33.9-8.8-45 5L288 60.8 249 12c-11-13.8-31.2-16-45-5s-16 31.2-5 45l48 60L12.3 405.4C4.3 415.4 0 427.7 0 440.4L0 464c0 26.5 21.5 48 48 48l240 0 240 0c26.5 0 48-21.5 48-48l0-23.6c0-12.7-4.3-25.1-12.3-35L329 112l48-60zM288 448l-119.5 0L288 291.7 407.5 448 288 448z"]
};
const faFolderPlus = {
  prefix: 'fas',
  iconName: 'folder-plus',
  icon: [512, 512, [], "f65e", "M512 416c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l128 0c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8l160 0c35.3 0 64 28.7 64 64l0 256zM232 376c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64 64 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-64 0 0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 64-64 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l64 0 0 64z"]
};
const faFutbol = {
  prefix: 'fas',
  iconName: 'futbol',
  icon: [512, 512, [9917, "futbol-ball", "soccer-ball"], "f1e3", "M417.3 360.1l-71.6-4.8c-5.2-.3-10.3 1.1-14.5 4.2s-7.2 7.4-8.4 12.5l-17.6 69.6C289.5 445.8 273 448 256 448s-33.5-2.2-49.2-6.4L189.2 372c-1.3-5-4.3-9.4-8.4-12.5s-9.3-4.5-14.5-4.2l-71.6 4.8c-17.6-27.2-28.5-59.2-30.4-93.6L125 228.3c4.4-2.8 7.6-7 9.2-11.9s1.4-10.2-.5-15l-26.7-66.6C128 109.2 155.3 89 186.7 76.9l55.2 46c4 3.3 9 5.1 14.1 5.1s10.2-1.8 14.1-5.1l55.2-46c31.3 12.1 58.7 32.3 79.6 57.9l-26.7 66.6c-1.9 4.8-2.1 10.1-.5 15s4.9 9.1 9.2 11.9l60.7 38.2c-1.9 34.4-12.8 66.4-30.4 93.6zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm14.1-325.7c-8.4-6.1-19.8-6.1-28.2 0L194 221c-8.4 6.1-11.9 16.9-8.7 26.8l18.3 56.3c3.2 9.9 12.4 16.6 22.8 16.6l59.2 0c10.4 0 19.6-6.7 22.8-16.6l18.3-56.3c3.2-9.9-.3-20.7-8.7-26.8l-47.9-34.8z"]
};
const faFutbolBall = faFutbol;
const faSoccerBall = faFutbol;
const faPaintbrush = {
  prefix: 'fas',
  iconName: 'paintbrush',
  icon: [576, 512, [128396, "paint-brush"], "f1fc", "M339.3 367.1c27.3-3.9 51.9-19.4 67.2-42.9L568.2 74.1c12.6-19.5 9.4-45.3-7.6-61.2S517.7-4.4 499.1 9.6L262.4 187.2c-24 18-38.2 46.1-38.4 76.1L339.3 367.1zm-19.6 25.4l-116-104.4C143.9 290.3 96 339.6 96 400c0 3.9 .2 7.8 .6 11.6C98.4 429.1 86.4 448 68.8 448L64 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0c61.9 0 112-50.1 112-112c0-2.5-.1-5-.2-7.5z"]
};
const faPaintBrush = faPaintbrush;
const faLock = {
  prefix: 'fas',
  iconName: 'lock',
  icon: [448, 512, [128274], "f023", "M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"]
};
const faGasPump = {
  prefix: 'fas',
  iconName: 'gas-pump',
  icon: [512, 512, [9981], "f52f", "M32 64C32 28.7 60.7 0 96 0L256 0c35.3 0 64 28.7 64 64l0 192 8 0c48.6 0 88 39.4 88 88l0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-154c-27.6-7.1-48-32.2-48-62l0-64L384 64c-8.8-8.8-8.8-23.2 0-32s23.2-8.8 32 0l77.3 77.3c12 12 18.7 28.3 18.7 45.3l0 13.5 0 24 0 32 0 152c0 39.8-32.2 72-72 72s-72-32.2-72-72l0-32c0-22.1-17.9-40-40-40l-8 0 0 144c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32L32 64zM96 80l0 96c0 8.8 7.2 16 16 16l128 0c8.8 0 16-7.2 16-16l0-96c0-8.8-7.2-16-16-16L112 64c-8.8 0-16 7.2-16 16z"]
};
const faHotTubPerson = {
  prefix: 'fas',
  iconName: 'hot-tub-person',
  icon: [512, 512, ["hot-tub"], "f593", "M272 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 5.2c0 34 14.4 66.4 39.7 89.2l16.4 14.8c15.2 13.7 23.8 33.1 23.8 53.5l0 13.2c0 13.3 10.7 24 24 24s24-10.7 24-24l0-13.2c0-34-14.4-66.4-39.7-89.2L295.8 82.8C280.7 69.1 272 49.7 272 29.2l0-5.2zM0 320l0 16L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-128c0-35.3-28.7-64-64-64l-170.7 0c-13.8 0-27.3-4.5-38.4-12.8l-85.3-64C137 166.7 116.8 160 96 160c-53 0-96 43-96 96l0 64zm128 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16s16 7.2 16 16zm80-16c8.8 0 16 7.2 16 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16zm112 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16s16 7.2 16 16zm80-16c8.8 0 16 7.2 16 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16zM360 0c-13.3 0-24 10.7-24 24l0 5.2c0 34 14.4 66.4 39.7 89.2l16.4 14.8c15.2 13.7 23.8 33.1 23.8 53.5l0 13.2c0 13.3 10.7 24 24 24s24-10.7 24-24l0-13.2c0-34-14.4-66.4-39.7-89.2L407.8 82.8C392.7 69.1 384 49.7 384 29.2l0-5.2c0-13.3-10.7-24-24-24zM64 128A64 64 0 1 0 64 0a64 64 0 1 0 0 128z"]
};
const faHotTub = faHotTubPerson;
const faMapLocation = {
  prefix: 'fas',
  iconName: 'map-location',
  icon: [576, 512, ["map-marked"], "f59f", "M302.8 312C334.9 271.9 408 174.6 408 120C408 53.7 354.3 0 288 0S168 53.7 168 120c0 54.6 73.1 151.9 105.2 192c7.7 9.6 22 9.6 29.6 0zM416 503l144.9-58c9.1-3.6 15.1-12.5 15.1-22.3L576 152c0-17-17.1-28.6-32.9-22.3l-116 46.4c-.5 1.2-1 2.5-1.5 3.7c-2.9 6.8-6.1 13.7-9.6 20.6L416 503zM15.1 187.3C6 191 0 199.8 0 209.6L0 480.4c0 17 17.1 28.6 32.9 22.3L160 451.8l0-251.4c-3.5-6.9-6.7-13.8-9.6-20.6c-5.6-13.2-10.4-27.4-12.8-41.5l-122.6 49zM384 255c-20.5 31.3-42.3 59.6-56.2 77c-20.5 25.6-59.1 25.6-79.6 0c-13.9-17.4-35.7-45.7-56.2-77l0 194.4 192 54.9L384 255z"]
};
const faMapMarked = faMapLocation;
const faHouseFloodWater = {
  prefix: 'fas',
  iconName: 'house-flood-water',
  icon: [576, 512, [], "e50e", "M306.8 6.1C295.6-2 280.4-2 269.2 6.1l-176 128c-11.2 8.2-15.9 22.6-11.6 35.8S98.1 192 112 192l16 0 0 73c1.7 1 3.3 2 4.9 3.1c18 12.4 40.1 20.3 59.2 20.3c21.1 0 42-8.5 59.2-20.3c22.1-15.5 51.6-15.5 73.7 0c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c1.5-1 3-2 4.5-2.9l-.3-73.2 16.6 0c13.9 0 26.1-8.9 30.4-22.1s-.4-27.6-11.6-35.8l-176-128zM269.5 309.9C247 325.4 219.5 336 192 336c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 389.7 159 400 192 400c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.5-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 325.2 410.9 336 384 336c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0zM384 448c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 437.2 410.9 448 384 448z"]
};
const faTree = {
  prefix: 'fas',
  iconName: 'tree',
  icon: [448, 512, [127794], "f1bb", "M210.6 5.9L62 169.4c-3.9 4.2-6 9.8-6 15.5C56 197.7 66.3 208 79.1 208l24.9 0L30.6 281.4c-4.2 4.2-6.6 10-6.6 16C24 309.9 34.1 320 46.6 320L80 320 5.4 409.5C1.9 413.7 0 419 0 424.5c0 13 10.5 23.5 23.5 23.5L192 448l0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 168.5 0c13 0 23.5-10.5 23.5-23.5c0-5.5-1.9-10.8-5.4-15L368 320l33.4 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L344 208l24.9 0c12.7 0 23.1-10.3 23.1-23.1c0-5.7-2.1-11.3-6-15.5L237.4 5.9C234 2.1 229.1 0 224 0s-10 2.1-13.4 5.9z"]
};
const faBridgeLock = {
  prefix: 'fas',
  iconName: 'bridge-lock',
  icon: [640, 512, [], "e4cc", "M32 64c0-17.7 14.3-32 32-32l512 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-40 0 0 64-8 0c-61.9 0-112 50.1-112 112l0 24.6c-9.9 5.8-18.2 14.1-23.8 24.1c-17.6-20-43.4-32.7-72.2-32.7c-53 0-96 43-96 96l0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64c0-53-43-96-96-96l0-128 72 0 0-64L64 96C46.3 96 32 81.7 32 64zM408 96l0 64 80 0 0-64-80 0zm-48 64l0-64-80 0 0 64 80 0zM152 96l0 64 80 0 0-64-80 0zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faSackDollar = {
  prefix: 'fas',
  iconName: 'sack-dollar',
  icon: [512, 512, [128176], "f81d", "M320 96L192 96 144.6 24.9C137.5 14.2 145.1 0 157.9 0L354.1 0c12.8 0 20.4 14.2 13.3 24.9L320 96zM192 128l128 0c3.8 2.5 8.1 5.3 13 8.4C389.7 172.7 512 250.9 512 416c0 53-43 96-96 96L96 512c-53 0-96-43-96-96C0 250.9 122.3 172.7 179 136.4c0 0 0 0 0 0s0 0 0 0c4.8-3.1 9.2-5.9 13-8.4zm84 88c0-11-9-20-20-20s-20 9-20 20l0 14c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1c0 0 0 0 0 0s0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4l0 14.6c0 11 9 20 20 20s20-9 20-20l0-13.8c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15c0 0 0 0 0 0l-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7l0-13.9z"]
};
const faPenToSquare = {
  prefix: 'fas',
  iconName: 'pen-to-square',
  icon: [512, 512, ["edit"], "f044", "M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 64z"]
};
const faEdit = faPenToSquare;
const faCarSide = {
  prefix: 'fas',
  iconName: 'car-side',
  icon: [640, 512, [128663], "f5e4", "M171.3 96L224 96l0 96-112.7 0 30.4-75.9C146.5 104 158.2 96 171.3 96zM272 192l0-96 81.2 0c9.7 0 18.9 4.4 25 12l67.2 84L272 192zm256.2 1L428.2 68c-18.2-22.8-45.8-36-75-36L171.3 32c-39.3 0-74.6 23.9-89.1 60.3L40.6 196.4C16.8 205.8 0 228.9 0 256L0 368c0 17.7 14.3 32 32 32l33.3 0c7.6 45.4 47.1 80 94.7 80s87.1-34.6 94.7-80l130.7 0c7.6 45.4 47.1 80 94.7 80s87.1-34.6 94.7-80l33.3 0c17.7 0 32-14.3 32-32l0-48c0-65.2-48.8-119-111.8-127zM434.7 368a48 48 0 1 1 90.5 32 48 48 0 1 1 -90.5-32zM160 336a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faShareNodes = {
  prefix: 'fas',
  iconName: 'share-nodes',
  icon: [448, 512, ["share-alt"], "f1e0", "M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z"]
};
const faShareAlt = faShareNodes;
const faHeartCircleMinus = {
  prefix: 'fas',
  iconName: 'heart-circle-minus',
  icon: [576, 512, [], "e4ff", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-64 0c0 8.8-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l128 0c8.8 0 16 7.2 16 16z"]
};
const faHourglassHalf = {
  prefix: 'fas',
  iconName: 'hourglass-half',
  icon: [384, 512, ["hourglass-2"], "f252", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1L146.7 256 78.9 323.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 256 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1L237.3 256l67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32s-14.3-32-32-32L320 0 64 0 32 0zM96 75l0-11 192 0 0 11c0 19-5.6 37.4-16 53L112 128c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9L192 301.3l67.9 67.9c4.6 4.6 8.6 9.6 12.1 14.9L112 384z"]
};
const faHourglass2 = faHourglassHalf;
const faMicroscope = {
  prefix: 'fas',
  iconName: 'microscope',
  icon: [512, 512, [128300], "f610", "M160 32c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32c17.7 0 32 14.3 32 32l0 224c0 17.7-14.3 32-32 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32c-17.7 0-32-14.3-32-32l0-224c0-17.7 14.3-32 32-32zM32 448l288 0c70.7 0 128-57.3 128-128s-57.3-128-128-128l0-64c106 0 192 86 192 192c0 49.2-18.5 94-48.9 128l16.9 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32zm80-64l192 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faSink = {
  prefix: 'fas',
  iconName: 'sink',
  icon: [512, 512, [], "e06d", "M288 96c0-17.7 14.3-32 32-32s32 14.3 32 32s14.3 32 32 32s32-14.3 32-32c0-53-43-96-96-96s-96 43-96 96l0 192-64 0 0-24c0-30.9-25.1-56-56-56l-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c4.4 0 8 3.6 8 8l0 24-80 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0 224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 0-24c0-4.4 3.6-8 8-8l56 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-56 0c-30.9 0-56 25.1-56 56l0 24-64 0 0-192zM480 416l0-32L32 384l0 32c0 53 43 96 96 96l256 0c53 0 96-43 96-96z"]
};
const faBagShopping = {
  prefix: 'fas',
  iconName: 'bag-shopping',
  icon: [448, 512, ["shopping-bag"], "f290", "M160 112c0-35.3 28.7-64 64-64s64 28.7 64 64l0 48-128 0 0-48zm-48 48l-64 0c-26.5 0-48 21.5-48 48L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-208c0-26.5-21.5-48-48-48l-64 0 0-48C336 50.1 285.9 0 224 0S112 50.1 112 112l0 48zm24 48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm152 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faShoppingBag = faBagShopping;
const faArrowDownZA = {
  prefix: 'fas',
  iconName: 'arrow-down-z-a',
  icon: [576, 512, ["sort-alpha-desc", "sort-alpha-down-alt"], "f881", "M183.6 469.6C177.5 476.2 169 480 160 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L128 365.7 128 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 64c0-17.7 14.3-32 32-32l128 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L429.3 160l50.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L402.7 96 352 96c-17.7 0-32-14.3-32-32zm96 192c12.1 0 23.2 6.8 28.6 17.7l64 128 16 32c7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3L460.2 448l-88.4 0-7.2 14.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l16-32 64-128c5.4-10.8 16.5-17.7 28.6-17.7zM395.8 400l40.4 0L416 359.6 395.8 400z"]
};
const faSortAlphaDesc = faArrowDownZA;
const faSortAlphaDownAlt = faArrowDownZA;
const faMitten = {
  prefix: 'fas',
  iconName: 'mitten',
  icon: [448, 512, [], "f7b5", "M352 384L64 384 5.4 178.9C1.8 166.4 0 153.4 0 140.3C0 62.8 62.8 0 140.3 0l3.4 0c66 0 123.5 44.9 139.5 108.9l31.4 125.8 17.6-20.1C344.8 200.2 362.9 192 382 192l2.8 0c34.9 0 63.3 28.3 63.3 63.3c0 15.9-6 31.2-16.8 42.9L352 384zM32 448c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L64 512c-17.7 0-32-14.3-32-32l0-32z"]
};
const faPersonRays = {
  prefix: 'fas',
  iconName: 'person-rays',
  icon: [512, 512, [], "e54d", "M208 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1-28.6 47.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l58.3 97c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9L328 256.9 328 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM7 7C16.4-2.3 31.6-2.3 41 7l80 80c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 41C-2.3 31.6-2.3 16.4 7 7zM471 7c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-80 80c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L471 7zM7 505c-9.4-9.4-9.4-24.6 0-33.9l80-80c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L41 505c-9.4 9.4-24.6 9.4-33.9 0zm464 0l-80-80c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l80 80c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0z"]
};
const faUsers = {
  prefix: 'fas',
  iconName: 'users',
  icon: [640, 512, [], "f0c0", "M144 0a80 80 0 1 1 0 160A80 80 0 1 1 144 0zM512 0a80 80 0 1 1 0 160A80 80 0 1 1 512 0zM0 298.7C0 239.8 47.8 192 106.7 192l42.7 0c15.9 0 31 3.5 44.6 9.7c-1.3 7.2-1.9 14.7-1.9 22.3c0 38.2 16.8 72.5 43.3 96c-.2 0-.4 0-.7 0L21.3 320C9.6 320 0 310.4 0 298.7zM405.3 320c-.2 0-.4 0-.7 0c26.6-23.5 43.3-57.8 43.3-96c0-7.6-.7-15-1.9-22.3c13.6-6.3 28.7-9.7 44.6-9.7l42.7 0C592.2 192 640 239.8 640 298.7c0 11.8-9.6 21.3-21.3 21.3l-213.3 0zM224 224a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zM128 485.3C128 411.7 187.7 352 261.3 352l117.3 0C452.3 352 512 411.7 512 485.3c0 14.7-11.9 26.7-26.7 26.7l-330.7 0c-14.7 0-26.7-11.9-26.7-26.7z"]
};
const faEyeSlash = {
  prefix: 'fas',
  iconName: 'eye-slash',
  icon: [640, 512, [], "f070", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"]
};
const faFlaskVial = {
  prefix: 'fas',
  iconName: 'flask-vial',
  icon: [640, 512, [], "e4f3", "M175 389.4c-9.8 16-15 34.3-15 53.1c-10 3.5-20.8 5.5-32 5.5c-53 0-96-43-96-96L32 64C14.3 64 0 49.7 0 32S14.3 0 32 0L96 0l64 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 245.9-49 79.6zM96 64l0 96 64 0 0-96L96 64zM352 0L480 0l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 150.9L629.7 406.2c6.7 10.9 10.3 23.5 10.3 36.4c0 38.3-31.1 69.4-69.4 69.4l-309.2 0c-38.3 0-69.4-31.1-69.4-69.4c0-12.8 3.6-25.4 10.3-36.4L320 214.9 320 64c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0zm32 64l0 160c0 5.9-1.6 11.7-4.7 16.8L330.5 320l171 0-48.8-79.2c-3.1-5-4.7-10.8-4.7-16.8l0-160-64 0z"]
};
const faHand = {
  prefix: 'fas',
  iconName: 'hand',
  icon: [512, 512, [129306, 9995, "hand-paper"], "f256", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 272c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L124.8 448c43.1 41.1 100.4 64 160 64l19.2 0c97.2 0 176-78.8 176-176l0-208c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208z"]
};
const faHandPaper = faHand;
const faOm = {
  prefix: 'fas',
  iconName: 'om',
  icon: [512, 512, [128329], "f679", "M379.3 4.7c-6.2-6.2-16.4-6.2-22.6 0l-16 16c-6.2 6.2-6.2 16.4 0 22.6l16 16c6.2 6.2 16.4 6.2 22.6 0l16-16c6.2-6.2 6.2-16.4 0-22.6l-16-16zM281 66.7c-2.2-1.5-4.9-2.5-7.7-2.7c-.6 0-1.3-.1-1.9 0c-3.9 .2-7.4 1.7-10.1 4.2c-.9 .8-1.6 1.7-2.3 2.6c-1.7 2.4-2.7 5.3-2.9 8.5c0 .7 0 1.4 0 2.1c.2 2.2 .9 4.3 1.9 6.2l.3 .6c.3 .6 .8 1.4 1.4 2.4c1.2 2 2.9 4.8 5.1 8.2c4.4 6.7 11.1 15.5 20 24.4C302.4 141.1 330.3 160 368 160c31.2 0 56.6-10.4 73.9-20.2c8.7-5 15.6-9.9 20.4-13.8c2.4-1.9 4.3-3.6 5.7-4.9c.7-.6 1.3-1.2 1.7-1.6l.6-.5 .1-.1 .1-.1s0 0 0 0s0 0 0 0c5.9-5.8 9.5-13.9 9.5-22.8c0-17.7-14.3-32-32-32c-8.7 0-16.7 3.5-22.4 9.2c-.1 .1-.2 .2-.5 .4c-.5 .5-1.5 1.3-2.8 2.4c-2.7 2.2-6.8 5.2-12.1 8.2C399.4 90.4 384.8 96 368 96c-20.8 0-42.4-7-59.5-14.6c-8.4-3.7-15.4-7.5-20.3-10.3c-2.4-1.4-4.3-2.5-5.6-3.3c-.6-.4-1.1-.7-1.4-.9l-.3-.2zM115.2 169.6c8-6 17.9-9.6 28.8-9.6c26.5 0 48 21.5 48 48s-21.5 48-48 48l-34.2 0c-7.6 0-13.8 6.2-13.8 13.8c0 1.5 .2 2.9 .7 4.4l8 24c4.4 13.1 16.6 21.9 30.4 21.9l8.9 0 16 0c35.3 0 64 28.7 64 64s-28.7 64-64 64c-50.8 0-82.7-21.5-102.2-42.8c-9.9-10.8-16.6-21.6-20.9-29.7c-2.1-4-3.6-7.3-4.5-9.6c-.5-1.1-.8-2-1-2.5l-.2-.5c-.3-.9-.7-1.8-1.1-2.6c-1.2-2.2-2.8-4-4.7-5.4c-1.9-1.4-4.1-2.3-6.5-2.8c-1.4-.3-2.9-.3-4.4-.2c-2.5 .2-4.8 1-6.8 2.3c-1.1 .7-2.2 1.5-3.1 2.5c-2.4 2.5-4.1 5.8-4.5 9.5c-.1 .6-.1 1.1-.1 1.7c0 0 0 0 0 0c0 .8 .1 1.7 .2 2.5l0 .1c0 .3 .1 .8 .2 1.3c.2 1.1 .4 2.7 .8 4.6c.8 3.9 2 9.4 3.9 15.9c3.8 13 10.3 30.4 21.3 48C48.7 476.2 89.4 512 160 512c70.7 0 128-57.3 128-128c0-23.3-6.2-45.2-17.1-64l22.6 0c25.5 0 49.9-10.1 67.9-28.1l26.5-26.5c6-6 14.1-9.4 22.6-9.4l5.5 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32c-25.7 0-41.4-12.5-51.2-25.6c-5-6.7-8.4-13.4-10.5-18.6c-1.1-2.5-1.8-4.6-2.2-6c-.2-.7-.4-1.2-.5-1.5l-.1-.2c-.3-1.3-.8-2.6-1.5-3.8c-1.1-2-2.6-3.8-4.4-5.1c-2.7-2-6-3.2-9.6-3.2l-.2 0c-8 .1-14.6 6.1-15.6 13.9c0 0 0 0 0 0c0 .3-.1 .6-.2 1.1c-.1 .9-.3 2.1-.4 3.6c-.3 3-.6 7.3-.6 12.4c0 10.1 1.1 23.9 5.8 38.1c4.8 14.3 13.4 29.3 28.6 40.7C368.7 473.3 389.3 480 416 480c53 0 96-43 96-96l0-96c0-53-43-96-96-96l-5.5 0c-25.5 0-49.9 10.1-67.9 28.1l-26.5 26.5c-6 6-14.1 9.4-22.6 9.4l-48.3 0c6.9-14.5 10.8-30.8 10.8-48c0-61.9-50.1-112-112-112c-25.2 0-48.5 8.3-67.2 22.4c-14.1 10.6-17 30.7-6.4 44.8s30.7 17 44.8 6.4z"]
};
const faWorm = {
  prefix: 'fas',
  iconName: 'worm',
  icon: [512, 512, [], "e599", "M256 96c0-53 43-96 96-96l38.4 0C439.9 0 480 40.1 480 89.6l0 86.4 0 16 0 184c0 75.1-60.9 136-136 136s-136-60.9-136-136l0-80c0-22.1-17.9-40-40-40s-40 17.9-40 40l0 168c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-168c0-75.1 60.9-136 136-136s136 60.9 136 136l0 80c0 22.1 17.9 40 40 40s40-17.9 40-40l0-184-32 0c-53 0-96-43-96-96zm144-8a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faHouseCircleXmark = {
  prefix: 'fas',
  iconName: 'house-circle-xmark',
  icon: [640, 512, [], "e50b", "M320.7 352c8.1-89.7 83.5-160 175.3-160c8.9 0 17.6 .7 26.1 1.9L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 69.7c-.1 .9-.1 1.8-.1 2.8l0 112c0 22.1 17.9 40 40 40l16 0c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2l31.9 0 24 0c22.1 0 40-17.9 40-40l0-24 0-64c0-17.7 14.3-32 32-32l64 0 .7 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faPlug = {
  prefix: 'fas',
  iconName: 'plug',
  icon: [384, 512, [128268], "f1e6", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2C297 398 352 333.4 352 256l0-32c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z"]
};
const faChevronUp = {
  prefix: 'fas',
  iconName: 'chevron-up',
  icon: [512, 512, [], "f077", "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]
};
const faHandSpock = {
  prefix: 'fas',
  iconName: 'hand-spock',
  icon: [576, 512, [128406], "f259", "M246.9 23.7C242.3 6.6 224.8-3.5 207.7 1.1s-27.2 22.1-22.6 39.2L238 237.8c2.5 9.2-4.5 18.2-14 18.2c-6.4 0-12-4.2-13.9-10.3L166.6 102.7c-5.1-16.9-23-26.4-39.9-21.3s-26.4 23-21.3 39.9l62.8 206.4c2.4 7.9-7.2 13.8-13.2 8.1L99.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L156.8 448c43.1 41.1 100.4 64 160 64l10.9 0 8.2 0c.1 0 .1-.1 .1-.1s.1-.1 .1-.1c58.3-3.5 108.6-43.2 125.3-99.7l81.2-275c5-16.9-4.7-34.7-21.6-39.8s-34.7 4.7-39.8 21.6L443.5 247.1c-1.6 5.3-6.4 8.9-12 8.9c-7.9 0-13.8-7.3-12.2-15.1l36-170.3c3.7-17.3-7.4-34.3-24.7-37.9s-34.3 7.4-37.9 24.7L355.1 235.1c-2.6 12.2-13.3 20.9-25.8 20.9c-11.9 0-22.4-8-25.4-19.5l-57-212.8z"]
};
const faStopwatch = {
  prefix: 'fas',
  iconName: 'stopwatch',
  icon: [448, 512, [9201], "f2f2", "M176 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 34.4C92.3 113.8 16 200 16 304c0 114.9 93.1 208 208 208s208-93.1 208-208c0-41.8-12.3-80.7-33.5-113.2l24.1-24.1c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L355.7 143c-28.1-23-62.2-38.8-99.7-44.6L256 64l16 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L224 0 176 0zm72 192l0 128c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-128c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faFaceKiss = {
  prefix: 'fas',
  iconName: 'face-kiss',
  icon: [512, 512, [128535, "kiss"], "f596", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm48.7-198.3c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C274.7 443.1 257.4 448 240 448c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1 .3-.2 .6-.4c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.4-.3-.5-.3-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faKiss = faFaceKiss;
const faBridgeCircleXmark = {
  prefix: 'fas',
  iconName: 'bridge-circle-xmark',
  icon: [640, 512, [], "e4cb", "M64 32C46.3 32 32 46.3 32 64s14.3 32 32 32l40 0 0 64-72 0 0 128c53 0 96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96c6.3 0 12.4 .6 18.3 1.7C367.1 231.8 426.9 192 496 192c42.5 0 81.6 15.1 112 40.2l0-72.2-72 0 0-64 40 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32zM488 96l0 64-80 0 0-64 80 0zM360 96l0 64-80 0 0-64 80 0zM232 96l0 64-80 0 0-64 80 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faFaceGrinTongue = {
  prefix: 'fas',
  iconName: 'face-grin-tongue',
  icon: [512, 512, [128539, "grin-tongue"], "f589", "M0 256C0 368.9 73.1 464.7 174.5 498.8C165.3 484 160 466.6 160 448l0-47.3c-24-17.5-43.1-41.4-54.8-69.2c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19c12.3-3.8 24.3 6.9 19.3 18.7c-11.8 28-31.1 52-55.4 69.6l0 46.9c0 18.6-5.3 36-14.5 50.8C438.9 464.7 512 368.9 512 256C512 114.6 397.4 0 256 0S0 114.6 0 256zm176.4-80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 448l0-45.4c0-14.7-11.9-26.6-26.6-26.6l-2 0c-11.3 0-21.1 7.9-23.6 18.9c-2.8 12.6-20.8 12.6-23.6 0c-2.5-11.1-12.3-18.9-23.6-18.9l-2 0c-14.7 0-26.6 11.9-26.6 26.6l0 45.4c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faGrinTongue = faFaceGrinTongue;
const faChessBishop = {
  prefix: 'fas',
  iconName: 'chess-bishop',
  icon: [320, 512, [9821], "f43a", "M128 0C110.3 0 96 14.3 96 32c0 16.1 11.9 29.4 27.4 31.7C78.4 106.8 8 190 8 288c0 47.4 30.8 72.3 56 84.7L64 400l192 0 0-27.3c25.2-12.5 56-37.4 56-84.7c0-37.3-10.2-72.4-25.3-104.1l-99.4 99.4c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L270.8 154.6c-23.2-38.1-51.8-69.5-74.2-90.9C212.1 61.4 224 48.1 224 32c0-17.7-14.3-32-32-32L128 0zM48 432L6.6 473.4c-4.2 4.2-6.6 10-6.6 16C0 501.9 10.1 512 22.6 512l274.7 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L272 432 48 432z"]
};
const faFaceGrinWink = {
  prefix: 'fas',
  iconName: 'face-grin-wink',
  icon: [512, 512, ["grin-wink"], "f58c", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zm-16.9-79.2c-17.6-23.5-52.8-23.5-70.4 0c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGrinWink = faFaceGrinWink;
const faEarDeaf = {
  prefix: 'fas',
  iconName: 'ear-deaf',
  icon: [512, 512, ["deaf", "deafness", "hard-of-hearing"], "f2a4", "M502.6 54.6l-40 40c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l40-40c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zm-320 320l-128 128c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM240 128c-57.6 0-105.1 43.6-111.3 99.5c-1.9 17.6-17.8 30.2-35.3 28.3s-30.2-17.8-28.3-35.3C74.8 132.5 149.4 64 240 64c97.2 0 176 78.8 176 176c0 46-17.7 87.9-46.6 119.3c-12 13-17.4 24.8-17.4 34.7l0 6.1c0 61.9-50.1 112-112 112c-17.7 0-32-14.3-32-32s14.3-32 32-32c26.5 0 48-21.5 48-48l0-6.1c0-32.9 17.4-59.6 34.4-78c18.4-20 29.6-46.6 29.6-75.9c0-61.9-50.1-112-112-112zm0 80c-17.7 0-32 14.3-32 32c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-44.2 35.8-80 80-80s80 35.8 80 80c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-17.7-14.3-32-32-32z"]
};
const faDeaf = faEarDeaf;
const faDeafness = faEarDeaf;
const faHardOfHearing = faEarDeaf;
const faRoadCircleCheck = {
  prefix: 'fas',
  iconName: 'road-circle-check',
  icon: [640, 512, [], "e564", "M213.2 32L288 32l0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 74.8 0c27.1 0 51.3 17.1 60.3 42.6l42.7 120.6c-10.9-2.1-22.2-3.2-33.8-3.2c-59.5 0-112.1 29.6-144 74.8l0-42.8c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32c2.3 0 4.6-.3 6.8-.7c-4.5 15.5-6.8 31.8-6.8 48.7c0 5.4 .2 10.7 .7 16l-.7 0c-17.7 0-32 14.3-32 32l0 64L86.6 480C56.5 480 32 455.5 32 425.4c0-6.2 1.1-12.4 3.1-18.2L152.9 74.6C162 49.1 186.1 32 213.2 32zM352 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L480 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faDiceFive = {
  prefix: 'fas',
  iconName: 'dice-five',
  icon: [448, 512, [9860], "f523", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM96 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM224 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64-64a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 160a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSquareRss = {
  prefix: 'fas',
  iconName: 'square-rss',
  icon: [448, 512, ["rss-square"], "f143", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM96 136c0-13.3 10.7-24 24-24c137 0 248 111 248 248c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-110.5-89.5-200-200-200c-13.3 0-24-10.7-24-24zm0 96c0-13.3 10.7-24 24-24c83.9 0 152 68.1 152 152c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-57.4-46.6-104-104-104c-13.3 0-24-10.7-24-24zm0 120a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faRssSquare = faSquareRss;
const faLandMineOn = {
  prefix: 'fas',
  iconName: 'land-mine-on',
  icon: [640, 512, [], "e51b", "M344 24l0 144c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-144c0-13.3 10.7-24 24-24s24 10.7 24 24zM192 320c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32l0 32-256 0 0-32zm-77.3 90.5c8.1-16.3 24.8-26.5 42.9-26.5l324.7 0c18.2 0 34.8 10.3 42.9 26.5l27.6 55.2C563.5 487 548 512 524.2 512l-408.4 0c-23.8 0-39.3-25-28.6-46.3l27.6-55.2zM36.3 138.3c7.5-10.9 22.5-13.6 33.4-6.1l104 72c10.9 7.5 13.6 22.5 6.1 33.4s-22.5 13.6-33.4 6.1l-104-72c-10.9-7.5-13.6-22.5-6.1-33.4zm534.1-6.1c10.9-7.5 25.8-4.8 33.4 6.1s4.8 25.8-6.1 33.4l-104 72c-10.9 7.5-25.8 4.8-33.4-6.1s-4.8-25.8 6.1-33.4l104-72z"]
};
const faICursor = {
  prefix: 'fas',
  iconName: 'i-cursor',
  icon: [256, 512, [], "f246", "M.1 29.3C-1.4 47 11.7 62.4 29.3 63.9l8 .7C70.5 67.3 96 95 96 128.3L96 224l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 95.7c0 33.3-25.5 61-58.7 63.8l-8 .7C11.7 449.6-1.4 465 .1 482.7s16.9 30.7 34.5 29.2l8-.7c34.1-2.8 64.2-18.9 85.4-42.9c21.2 24 51.2 40 85.4 42.9l8 .7c17.6 1.5 33.1-11.6 34.5-29.2s-11.6-33.1-29.2-34.5l-8-.7C185.5 444.7 160 417 160 383.7l0-95.7 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-95.7c0-33.3 25.5-61 58.7-63.8l8-.7c17.6-1.5 30.7-16.9 29.2-34.5S239-1.4 221.3 .1l-8 .7C179.2 3.6 149.2 19.7 128 43.7c-21.2-24-51.2-40-85.4-42.9l-8-.7C17-1.4 1.6 11.7 .1 29.3z"]
};
const faStamp = {
  prefix: 'fas',
  iconName: 'stamp',
  icon: [512, 512, [], "f5bf", "M312 201.8c0-17.4 9.2-33.2 19.9-47C344.5 138.5 352 118.1 352 96c0-53-43-96-96-96s-96 43-96 96c0 22.1 7.5 42.5 20.1 58.8c10.7 13.8 19.9 29.6 19.9 47c0 29.9-24.3 54.2-54.2 54.2L112 256C50.1 256 0 306.1 0 368c0 20.9 13.4 38.7 32 45.3L32 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-50.7c18.6-6.6 32-24.4 32-45.3c0-61.9-50.1-112-112-112l-33.8 0c-29.9 0-54.2-24.3-54.2-54.2zM416 416l0 32L96 448l0-32 320 0z"]
};
const faStairs = {
  prefix: 'fas',
  iconName: 'stairs',
  icon: [576, 512, [], "e289", "M384 64c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0 0 96c0 17.7-14.3 32-32 32l-96 0 0 96c0 17.7-14.3 32-32 32l-96 0 0 96c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0 0-96c0-17.7 14.3-32 32-32l96 0 0-96c0-17.7 14.3-32 32-32l96 0 0-96z"]
};
const faI = {
  prefix: 'fas',
  iconName: 'i',
  icon: [320, 512, [105], "49", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l96 0 0 320-96 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0 0-320 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L160 32 32 32z"]
};
const faHryvniaSign = {
  prefix: 'fas',
  iconName: 'hryvnia-sign',
  icon: [384, 512, [8372, "hryvnia"], "f6f2", "M121.9 116.2C138.3 103.1 158.7 96 179.6 96L223 96c27.1 0 49 21.9 49 49c0 11.5-4 22.4-11.1 31L32 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l123.5 0-50.6 28.9c-1.7 1-3.4 2-5.1 3.1L32 272c-17.7 0-32 14.3-32 32s14.3 32 32 32l20.3 0c-2.8 9.9-4.3 20.4-4.3 31c0 62.4 50.6 113 113 113l43.4 0c35.5 0 70-12.1 97.7-34.3L308 441c13.8-11 16-31.2 5-45s-31.2-16-45-5l-5.9 4.7c-16.4 13.1-36.7 20.2-57.7 20.2L161 416c-27.1 0-49-21.9-49-49c0-11.5 4-22.4 11.1-31L352 336c17.7 0 32-14.3 32-32s-14.3-32-32-32l-123.5 0 50.6-28.9c1.7-1 3.4-2 5.1-3.1l67.8 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-20.3 0c2.8-10 4.3-20.4 4.3-31c0-62.4-50.6-113-113-113l-43.4 0c-35.5 0-70 12.1-97.7 34.3L76 71c-13.8 11-16 31.2-5 45s31.2 16 45 5l5.9-4.7z"]
};
const faHryvnia = faHryvniaSign;
const faPills = {
  prefix: 'fas',
  iconName: 'pills',
  icon: [576, 512, [], "f484", "M112 96c-26.5 0-48 21.5-48 48l0 112 96 0 0-112c0-26.5-21.5-48-48-48zM0 144C0 82.1 50.1 32 112 32s112 50.1 112 112l0 224c0 61.9-50.1 112-112 112S0 429.9 0 368L0 144zM554.9 399.4c-7.1 12.3-23.7 13.1-33.8 3.1L333.5 214.9c-10-10-9.3-26.7 3.1-33.8C360 167.7 387.1 160 416 160c88.4 0 160 71.6 160 160c0 28.9-7.7 56-21.1 79.4zm-59.5 59.5C472 472.3 444.9 480 416 480c-88.4 0-160-71.6-160-160c0-28.9 7.7-56 21.1-79.4c7.1-12.3 23.7-13.1 33.8-3.1L498.5 425.1c10 10 9.3 26.7-3.1 33.8z"]
};
const faFaceGrinWide = {
  prefix: 'fas',
  iconName: 'face-grin-wide',
  icon: [512, 512, [128515, "grin-alt"], "f581", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM208 192c0 35.3-14.3 64-32 64s-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64zm128 64c-17.7 0-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64s-14.3 64-32 64z"]
};
const faGrinAlt = faFaceGrinWide;
const faTooth = {
  prefix: 'fas',
  iconName: 'tooth',
  icon: [448, 512, [129463], "f5c9", "M186.1 52.1C169.3 39.1 148.7 32 127.5 32C74.7 32 32 74.7 32 127.5l0 6.2c0 15.8 3.7 31.3 10.7 45.5l23.5 47.1c4.5 8.9 7.6 18.4 9.4 28.2l36.7 205.8c2 11.2 11.6 19.4 22.9 19.8s21.4-7.4 24-18.4l28.9-121.3C192.2 323.7 207 312 224 312s31.8 11.7 35.8 28.3l28.9 121.3c2.6 11.1 12.7 18.8 24 18.4s20.9-8.6 22.9-19.8l36.7-205.8c1.8-9.8 4.9-19.3 9.4-28.2l23.5-47.1c7.1-14.1 10.7-29.7 10.7-45.5l0-2.1c0-55-44.6-99.6-99.6-99.6c-24.1 0-47.4 8.8-65.6 24.6l-3.2 2.8 19.5 15.2c7 5.4 8.2 15.5 2.8 22.5s-15.5 8.2-22.5 2.8l-24.4-19-37-28.8z"]
};
const faV = {
  prefix: 'fas',
  iconName: 'v',
  icon: [384, 512, [118], "56", "M19.7 34.5c16.3-6.8 35 .9 41.8 17.2L192 364.8 322.5 51.7c6.8-16.3 25.5-24 41.8-17.2s24 25.5 17.2 41.8l-160 384c-5 11.9-16.6 19.7-29.5 19.7s-24.6-7.8-29.5-19.7L2.5 76.3c-6.8-16.3 .9-35 17.2-41.8z"]
};
const faBangladeshiTakaSign = {
  prefix: 'fas',
  iconName: 'bangladeshi-taka-sign',
  icon: [384, 512, [], "e2e6", "M36 32.3C18.4 30.1 2.4 42.5 .2 60S10.5 93.6 28 95.8l7.9 1c16 2 28 15.6 28 31.8L64 160l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 160c0 53 43 96 96 96l32 0c106 0 192-86 192-192l0-32c0-53-43-96-96-96l-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0c17.7 0 32 14.3 32 32l0 32c0 70.7-57.3 128-128 128l-32 0c-17.7 0-32-14.3-32-32l0-160 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-31.5c0-48.4-36.1-89.3-84.1-95.3l-7.9-1z"]
};
const faBicycle = {
  prefix: 'fas',
  iconName: 'bicycle',
  icon: [640, 512, [128690], "f206", "M312 32c-13.3 0-24 10.7-24 24s10.7 24 24 24l25.7 0 34.6 64-149.4 0-27.4-38C191 99.7 183.7 96 176 96l-56 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l43.7 0 22.1 30.7-26.6 53.1c-10-2.5-20.5-3.8-31.2-3.8C57.3 224 0 281.3 0 352s57.3 128 128 128c65.3 0 119.1-48.9 127-112l49 0c8.5 0 16.3-4.5 20.7-11.8l84.8-143.5 21.7 40.1C402.4 276.3 384 312 384 352c0 70.7 57.3 128 128 128s128-57.3 128-128s-57.3-128-128-128c-13.5 0-26.5 2.1-38.7 6L375.4 48.8C369.8 38.4 359 32 347.2 32L312 32zM458.6 303.7l32.3 59.7c6.3 11.7 20.9 16 32.5 9.7s16-20.9 9.7-32.5l-32.3-59.7c3.6-.6 7.4-.9 11.2-.9c39.8 0 72 32.2 72 72s-32.2 72-72 72s-72-32.2-72-72c0-18.6 7-35.5 18.6-48.3zM133.2 368l65 0c-7.3 32.1-36 56-70.2 56c-39.8 0-72-32.2-72-72s32.2-72 72-72c1.7 0 3.4 .1 5.1 .2l-24.2 48.5c-9 18.1 4.1 39.4 24.3 39.4zm33.7-48l50.7-101.3 72.9 101.2-.1 .1-123.5 0zm90.6-128l108.5 0L317 274.8 257.4 192z"]
};
const faStaffSnake = {
  prefix: 'fas',
  iconName: 'staff-snake',
  icon: [384, 512, ["rod-asclepius", "rod-snake", "staff-aesculapius"], "e579", "M222.6 43.2l-.1 4.8L288 48c53 0 96 43 96 96s-43 96-96 96l-40 0 0-80 40 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-40 0-28 0-4.5 144 40.5 0c53 0 96 43 96 96s-43 96-96 96l-16 0 0-80 16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-43 0-3.1 99.5L208.5 495l0 1c-.3 8.9-7.6 16-16.5 16s-16.2-7.1-16.5-16l0-1-1-31L136 464c-22.1 0-40-17.9-40-40s17.9-40 40-40l36 0-1-32-19 0c-53 0-96-43-96-96c0-47.6 34.6-87.1 80-94.7l0 94.7c0 8.8 7.2 16 16 16l16.5 0L164 128l-28 0-13.4 0c-9 18.9-28.3 32-50.6 32l-16 0c-30.9 0-56-25.1-56-56S25.1 48 56 48l8 0 8 0 89.5 0-.1-4.8L161 32c0-.7 0-1.3 0-1.9c.5-16.6 14.1-30 31-30s30.5 13.4 31 30c0 .6 0 1.3 0 1.9l-.4 11.2zM64 112a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faRodAsclepius = faStaffSnake;
const faRodSnake = faStaffSnake;
const faStaffAesculapius = faStaffSnake;
const faHeadSideCoughSlash = {
  prefix: 'fas',
  iconName: 'head-side-cough-slash',
  icon: [640, 512, [], "e062", "M448 325.8l44 34.5c8.1 1.4 14.8 6.8 18 14.1L552.9 408c10.6 .4 19.5 7.6 22.2 17.4l39.1 30.6c.6 0 1.2-.1 1.8-.1c11.1 0 20.4 7.5 23.2 17.8l-3.9 0c6.2 8.5 6.4 20.4-.4 29c-8.2 10.4-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2S28.4-3.1 38.8 5.1L89.6 44.9C127 16.7 173.5 0 224 0l24 0c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8L448 320s0 0 0 0l0 5.8zM0 224.2c0-38.7 9.8-75.1 27.1-106.9L341.8 365.3l-2.5 .3c-11 1.4-19.2 10.7-19.2 21.8c0 11.6 9 21.2 20.6 21.9l62 3.9 43 33.9C439.3 466.2 421.2 480 400 480l-80 0 0 8c0 13.3-10.7 24-24 24l-40 0s0 0 0 0L96 512c-17.7 0-32-14.3-32-32l0-72.7c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zM616 360a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm-64-48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40-24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faTruckMedical = {
  prefix: 'fas',
  iconName: 'truck-medical',
  icon: [640, 512, [128657, "ambulance"], "f0f9", "M0 48C0 21.5 21.5 0 48 0L368 0c26.5 0 48 21.5 48 48l0 48 50.7 0c17 0 33.3 6.7 45.3 18.7L589.3 192c12 12 18.7 28.3 18.7 45.3l0 18.7 0 32 0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-26.5 0-48-21.5-48-48L0 48zM416 256l128 0 0-18.7L466.7 160 416 160l0 96zM160 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM176 80l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faAmbulance = faTruckMedical;
const faWheatAwnCircleExclamation = {
  prefix: 'fas',
  iconName: 'wheat-awn-circle-exclamation',
  icon: [640, 512, [], "e598", "M505 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L383 95c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l88-88zM305.5 27.3c-6.2-6.2-16.4-6.2-22.6 0L271.5 38.6c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0l-11.3 11.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8L101.8 231c-6.2-6.2-16.4-6.2-22.6 0L67.9 242.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4L9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l68.9-68.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-21.8-21.8-49.6-34.1-78.1-36.9l31.9-31.9 12.2 12.2c22.5 22.5 53.3 31.5 82.4 27c0-1 0-2.1 0-3.1c0-33.1 9.1-64.1 25-90.6c-15.5-8.7-32.5-13.8-49.8-15.5l31.9-31.9 12.2 12.2c6 6 12.6 11.1 19.7 15.2c27.5-34 67.3-57.5 112.6-63.8c-4.1-3.8-8.4-7.3-12.9-10.5L505 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-59.4 59.4c-20.6-4.4-42-3.7-62.3 2.1c6.1-21.3 6.6-43.8 1.4-65.3L409 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L329.1 52.9c-3.7-5-7.8-9.8-12.4-14.3L305.5 27.3zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faSnowman = {
  prefix: 'fas',
  iconName: 'snowman',
  icon: [512, 512, [9731, 9924], "f7d0", "M341.1 140.6c-2 3.9-1.6 8.6 1.2 12c7 8.5 12.9 18.1 17.2 28.4L408 160.2l0-40.2c0-13.3 10.7-24 24-24s24 10.7 24 24l0 19.6 22.5-9.7c12.2-5.2 26.3 .4 31.5 12.6s-.4 26.3-12.6 31.5l-56 24-73.6 31.5c-.5 9.5-2.1 18.6-4.8 27.3c-1.2 3.8-.1 8 2.8 10.8C396.7 296.9 416 338.2 416 384c0 44.7-18.3 85-47.8 114.1c-9.9 9.7-23.7 13.9-37.5 13.9l-149.3 0c-13.9 0-27.7-4.2-37.5-13.9C114.3 469 96 428.7 96 384c0-45.8 19.3-87.1 50.1-116.3c2.9-2.8 4-6.9 2.8-10.8c-2.7-8.7-4.3-17.9-4.8-27.3L70.5 198.1l-56-24C2.4 168.8-3.3 154.7 1.9 142.5s19.3-17.8 31.5-12.6L56 139.6 56 120c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40.2L152.6 181c4.3-10.3 10.1-19.9 17.2-28.4c2.8-3.4 3.3-8.1 1.2-12C164 127.2 160 112.1 160 96c0-53 43-96 96-96s96 43 96 96c0 16.1-4 31.2-10.9 44.6zM224 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm48 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-16 80a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm16 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zM288 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-48 24l0 3.2c0 3.2 .8 6.3 2.3 9l9 16.9c.9 1.7 2.7 2.8 4.7 2.8s3.8-1.1 4.7-2.8l9-16.9c1.5-2.8 2.3-5.9 2.3-9l0-3.2c0-8.8-7.2-16-16-16s-16 7.2-16 16z"]
};
const faMortarPestle = {
  prefix: 'fas',
  iconName: 'mortar-pestle',
  icon: [512, 512, [], "f5a7", "M504.3 11.1C493.3-1.6 474.5-3.7 461 6.2L252.3 160l144.9 0L502.6 54.6c11.8-11.8 12.6-30.8 1.6-43.5zM32 192c-17.7 0-32 14.3-32 32s14.3 32 32 32c0 82.5 43.4 147.7 123.9 176.2c-11.1 13.9-19.4 30.3-23.9 48.1C127.6 497.4 142.3 512 160 512l192 0c17.7 0 32.4-14.6 28.1-31.7c-4.5-17.8-12.8-34.1-23.9-48.1C436.6 403.7 480 338.5 480 256c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 192z"]
};
const faRoadBarrier = {
  prefix: 'fas',
  iconName: 'road-barrier',
  icon: [640, 512, [], "e562", "M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-181.7L149.2 96 64 96l0-32c0-17.7-14.3-32-32-32zM405.2 96l-74.3 0-5.4 10.7L234.8 288l74.3 0 5.4-10.7L405.2 96zM362.8 288l74.3 0 5.4-10.7L533.2 96l-74.3 0-5.4 10.7L362.8 288zM202.8 96l-5.4 10.7L106.8 288l74.3 0 5.4-10.7L277.2 96l-74.3 0zm288 192l85.2 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 53.7L490.8 288z"]
};
const faSchool = {
  prefix: 'fas',
  iconName: 'school',
  icon: [640, 512, [127979], "f549", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l208 0 0-96c0-35.3 28.7-64 64-64s64 28.7 64 64l0 96 208 0c26.5 0 48-21.5 48-48l0-320c0-26.5-21.5-48-48-48L473.7 96 337.8 5.4zM96 192l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm400 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64zM96 320l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm400 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64zM232 176a88 88 0 1 1 176 0 88 88 0 1 1 -176 0zm88-48c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16c0-8.8-7.2-16-16-16z"]
};
const faIgloo = {
  prefix: 'fas',
  iconName: 'igloo',
  icon: [576, 512, [], "f7ae", "M320 33.8L320 160 48.5 160C100.2 82.8 188.1 32 288 32c10.8 0 21.5 .6 32 1.8zM352 160l0-120.9C424.9 55.7 487.2 99.8 527.5 160L352 160zM29.9 192L96 192l0 128L0 320c0-46 10.8-89.4 29.9-128zM192 320l-64 0 0-128 320 0 0 128-64 0 0 32 192 0 0 80c0 26.5-21.5 48-48 48l-176 0 0-128c0-35.3-28.7-64-64-64s-64 28.7-64 64l0 128L48 480c-26.5 0-48-21.5-48-48l0-80 192 0 0-32zm288 0l0-128 66.1 0c19.2 38.6 29.9 82 29.9 128l-96 0z"]
};
const faJoint = {
  prefix: 'fas',
  iconName: 'joint',
  icon: [640, 512, [], "f595", "M448 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 11c0 55.2 21.9 108.1 60.9 147.1l21 21c9 9 14.1 21.2 14.1 33.9l0 11c0 17.7 14.3 32 32 32s32-14.3 32-32l0-11c0-29.7-11.8-58.2-32.8-79.2l-21-21C463.2 117.8 448 81.2 448 43l0-11zM576 256c0 17.7 14.3 32 32 32s32-14.3 32-32l0-11c0-55.2-21.9-108.1-60.9-147.1l-21-21c-9-9-14.1-21.2-14.1-33.9l0-11c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 11c0 29.7 11.8 58.2 32.8 79.2l21 21c27 27 42.2 63.6 42.2 101.8l0 11zM229.8 360c-4.7-2.3-10-2.7-15.2-2c-37.8 5.6-75.2 14.3-106.9 22.8C81.3 388 58.3 395.1 42 400.4c-8.2 2.7-14.7 4.9-19.2 6.5c-2.3 .8-4 1.4-5.2 1.8l-1.3 .5C6.8 412.5 0 421.4 0 432s6.8 19.5 16.3 22.7l1.3 .5c1.2 .4 3 1.1 5.2 1.8c4.5 1.6 11 3.8 19.2 6.5c16.3 5.4 39.2 12.5 65.7 19.6C160.3 497.3 228.8 512 288 512l67.3 0c4.1 0 6.3-5.1 3.6-8.3L256.5 380.8c-7.4-8.9-16.5-15.9-26.7-20.8zM445 512l19 0 51.3 0c4.1 0 6.3-5.1 3.6-8.3L416.5 380.8C401.3 362.5 378.8 352 355 352l-19 0-48 0c-1.1 0-2.3 0-3.4 0c-4.1 0-6.2 5.1-3.5 8.3L383.5 483.2C398.7 501.5 421.2 512 445 512zm-3.9-151.7L543.5 483.2c14.6 17.5 35.9 27.9 58.6 28.7c21.1-1.1 37.9-18.6 37.9-39.9l0-80c0-22.1-17.9-40-40-40l-155.3 0c-4.1 0-6.3 5.1-3.6 8.3z"]
};
const faAngleRight = {
  prefix: 'fas',
  iconName: 'angle-right',
  icon: [320, 512, [8250], "f105", "M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"]
};
const faHorse = {
  prefix: 'fas',
  iconName: 'horse',
  icon: [576, 512, [128014], "f6f0", "M448 238.1l0-78.1 16 0 9.8 19.6c12.5 25.1 42.2 36.4 68.3 26c20.5-8.2 33.9-28 33.9-50.1L576 80c0-19.1-8.4-36.3-21.7-48l5.7 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L480 0 448 0C377.3 0 320 57.3 320 128l-96 0-20.8 0-54.4 0c-30.7 0-57.6 16.3-72.5 40.8C33.2 174.5 0 211.4 0 256l0 56c0 13.3 10.7 24 24 24s24-10.7 24-24l0-56c0-13.4 6.6-25.2 16.7-32.5c1.6 13 6.3 25.4 13.6 36.4l28.2 42.4c8.3 12.4 6.4 28.7-1.2 41.6c-16.5 28-20.6 62.2-10 93.9l17.5 52.4c4.4 13.1 16.6 21.9 30.4 21.9l33.7 0c21.8 0 37.3-21.4 30.4-42.1l-20.8-62.5c-2.1-6.4-.5-13.4 4.3-18.2l12.7-12.7c13.2-13.2 20.6-31.1 20.6-49.7c0-2.3-.1-4.6-.3-6.9l84 24c4.1 1.2 8.2 2.1 12.3 2.8L320 480c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-164.3c19.2-19.2 31.5-45.7 32-75.7c0 0 0 0 0 0l0-1.9zM496 64a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faQ = {
  prefix: 'fas',
  iconName: 'q',
  icon: [448, 512, [113], "51", "M64 256c0 88.4 71.6 160 160 160c28.9 0 56-7.7 79.4-21.1l-72-86.4c-11.3-13.6-9.5-33.8 4.1-45.1s33.8-9.5 45.1 4.1l70.9 85.1C371.9 325.8 384 292.3 384 256c0-88.4-71.6-160-160-160S64 167.6 64 256zM344.9 444.6C310 467 268.5 480 224 480C100.3 480 0 379.7 0 256S100.3 32 224 32s224 100.3 224 224c0 56.1-20.6 107.4-54.7 146.7l47.3 56.8c11.3 13.6 9.5 33.8-4.1 45.1s-33.8 9.5-45.1-4.1l-46.6-55.9z"]
};
const faG = {
  prefix: 'fas',
  iconName: 'g',
  icon: [448, 512, [103], "47", "M224 96C135.6 96 64 167.6 64 256s71.6 160 160 160c77.4 0 142-55 156.8-128L256 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l144 0c25.8 0 49.6 21.4 47.2 50.6C437.8 389.6 341.4 480 224 480C100.3 480 0 379.7 0 256S100.3 32 224 32c57.4 0 109.7 21.6 149.3 57c13.2 11.8 14.3 32 2.5 45.2s-32 14.3-45.2 2.5C302.3 111.4 265 96 224 96z"]
};
const faNotesMedical = {
  prefix: 'fas',
  iconName: 'notes-medical',
  icon: [512, 512, [], "f481", "M96 352L96 96c0-35.3 28.7-64 64-64l256 0c35.3 0 64 28.7 64 64l0 197.5c0 17-6.7 33.3-18.7 45.3l-58.5 58.5c-12 12-28.3 18.7-45.3 18.7L160 416c-35.3 0-64-28.7-64-64zM272 128c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0zm24 336c13.3 0 24 10.7 24 24s-10.7 24-24 24l-160 0C60.9 512 0 451.1 0 376L0 152c0-13.3 10.7-24 24-24s24 10.7 24 24l0 224c0 48.6 39.4 88 88 88l160 0z"]
};
const faTemperatureHalf = {
  prefix: 'fas',
  iconName: 'temperature-half',
  icon: [320, 512, [127777, "temperature-2", "thermometer-2", "thermometer-half"], "f2c9", "M160 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L208 112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L48 112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3L144 208c0-8.8 7.2-16 16-16s16 7.2 16 16l0 114.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faTemperature2 = faTemperatureHalf;
const faThermometer2 = faTemperatureHalf;
const faThermometerHalf = faTemperatureHalf;
const faDongSign = {
  prefix: 'fas',
  iconName: 'dong-sign',
  icon: [384, 512, [], "e169", "M288 32c-17.7 0-32 14.3-32 32l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 49.1c-18.8-10.9-40.7-17.1-64-17.1c-70.7 0-128 57.3-128 128s57.3 128 128 128c24.5 0 47.4-6.9 66.8-18.8c5 11.1 16.2 18.8 29.2 18.8c17.7 0 32-14.3 32-32l0-96 0-160c17.7 0 32-14.3 32-32s-14.3-32-32-32c0-17.7-14.3-32-32-32zM128 288a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 448z"]
};
const faCapsules = {
  prefix: 'fas',
  iconName: 'capsules',
  icon: [576, 512, [], "f46b", "M64 144c0-26.5 21.5-48 48-48s48 21.5 48 48l0 112-96 0 0-112zM0 144L0 368c0 61.9 50.1 112 112 112s112-50.1 112-112l0-178.4c1.8 19.1 8.2 38 19.8 54.8L372.3 431.7c35.5 51.7 105.3 64.3 156 28.1s63-107.5 27.5-159.2L427.3 113.3C391.8 61.5 321.9 49 271.3 85.2c-28 20-44.3 50.8-47.3 83l0-24.2c0-61.9-50.1-112-112-112S0 82.1 0 144zm296.6 64.2c-16-23.3-10-55.3 11.9-71c21.2-15.1 50.5-10.3 66 12.2l67 97.6L361.6 303l-65-94.8zM491 407.7c-.8 .6-1.6 1.1-2.4 1.6l4-2.8c-.5 .4-1 .8-1.6 1.2z"]
};
const faPooStorm = {
  prefix: 'fas',
  iconName: 'poo-storm',
  icon: [448, 512, ["poo-bolt"], "f75a", "M236.9 .2c-5.5-.7-11 1.4-14.5 5.7s-4.6 10.1-2.8 15.3c2.8 8.2 4.3 16.9 4.3 26.1c0 21.7-8.5 37.2-21.9 47.6c-13.8 10.8-34 17-57.8 17L128 112c-35.3 0-64 28.7-64 64c0 12.2 3.4 23.5 9.3 33.2C31.7 216.2 0 252.4 0 296c0 40.9 28 75.4 65.8 85.2c-5.3-18.5 1-38.5 16.2-50.7l160-128c17.6-14.1 42.6-14 60.2 .2s22.8 38.6 12.8 58.8L285.7 320l18.3 0c20.4 0 38.5 12.9 45.3 32.1c3.7 10.6 3.5 21.8 0 31.9l10.7 0c48.6 0 88-39.4 88-88c0-43.6-31.7-79.8-73.3-86.8c5.9-9.7 9.3-21.1 9.3-33.2c0-35.3-28.7-64-64-64l-1.4 0c.9-5.4 1.4-10.9 1.4-16.6c0-48.7-36.1-88.9-83.1-95.2zm45.1 227.4c-5.8-4.7-14.2-4.7-20.1-.1l-160 128c-5.3 4.2-7.4 11.4-5.1 17.8s8.3 10.7 15.1 10.7l70.1 0L129.7 488.8c-3.4 6.7-1.6 14.9 4.3 19.6s14.2 4.7 20.1 .1l160-128c5.3-4.2 7.4-11.4 5.1-17.8s-8.3-10.7-15.1-10.7l-70.1 0 52.4-104.8c3.4-6.7 1.6-14.9-4.3-19.6z"]
};
const faPooBolt = faPooStorm;
const faFaceFrownOpen = {
  prefix: 'fas',
  iconName: 'face-frown-open',
  icon: [512, 512, [128550, "frown-open"], "f57a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-122 174.5c-12.4 5.2-26.5-4.1-21.1-16.4c16-36.6 52.4-62.1 94.8-62.1s78.8 25.6 94.8 62.1c5.4 12.3-8.7 21.6-21.1 16.4c-22.4-9.5-47.4-14.8-73.7-14.8s-51.3 5.3-73.7 14.8z"]
};
const faFrownOpen = faFaceFrownOpen;
const faHandPointUp = {
  prefix: 'fas',
  iconName: 'hand-point-up',
  icon: [384, 512, [9757], "f0a6", "M32 32C32 14.3 46.3 0 64 0S96 14.3 96 32l0 208-64 0L32 32zM224 192c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm-64-64c17.7 0 32 14.3 32 32l0 48c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-48c0-17.7 14.3-32 32-32zm160 96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm-96 88l0-.6c9.4 5.4 20.3 8.6 32 8.6c13.2 0 25.4-4 35.6-10.8c8.7 24.9 32.5 42.8 60.4 42.8c11.7 0 22.6-3.1 32-8.6l0 8.6c0 88.4-71.6 160-160 160l-61.7 0c-42.4 0-83.1-16.9-113.1-46.9L37.5 453.5C13.5 429.5 0 396.9 0 363l0-27c0-35.3 28.7-64 64-64l88 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-56 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l56 0c39.8 0 72-32.2 72-72z"]
};
const faMoneyBill = {
  prefix: 'fas',
  iconName: 'money-bill',
  icon: [576, 512, [], "f0d6", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm64 320l-64 0 0-64c35.3 0 64 28.7 64 64zM64 192l0-64 64 0c0 35.3-28.7 64-64 64zM448 384c0-35.3 28.7-64 64-64l0 64-64 0zm64-192c-35.3 0-64-28.7-64-64l64 0 0 64zM288 160a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faBookmark = {
  prefix: 'fas',
  iconName: 'bookmark',
  icon: [384, 512, [128278, 61591], "f02e", "M0 48V487.7C0 501.1 10.9 512 24.3 512c5 0 9.9-1.5 14-4.4L192 400 345.7 507.6c4.1 2.9 9 4.4 14 4.4c13.4 0 24.3-10.9 24.3-24.3V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48z"]
};
const faAlignJustify = {
  prefix: 'fas',
  iconName: 'align-justify',
  icon: [448, 512, [], "f039", "M448 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32L32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32z"]
};
const faUmbrellaBeach = {
  prefix: 'fas',
  iconName: 'umbrella-beach',
  icon: [576, 512, [127958], "f5ca", "M346.3 271.8l-60.1-21.9L214 448 32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-261.9 0 64.1-176.2zm121.1-.2l-3.3 9.1 67.7 24.6c18.1 6.6 38-4.2 39.6-23.4c6.5-78.5-23.9-155.5-80.8-208.5c2 8 3.2 16.3 3.4 24.8l.2 6c1.8 57-7.3 113.8-26.8 167.4zM462 99.1c-1.1-34.4-22.5-64.8-54.4-77.4c-.9-.4-1.9-.7-2.8-1.1c-33-11.7-69.8-2.4-93.1 23.8l-4 4.5C272.4 88.3 245 134.2 226.8 184l-3.3 9.1L434 269.7l3.3-9.1c18.1-49.8 26.6-102.5 24.9-155.5l-.2-6zM107.2 112.9c-11.1 15.7-2.8 36.8 15.3 43.4l71 25.8 3.3-9.1c19.5-53.6 49.1-103 87.1-145.5l4-4.5c6.2-6.9 13.1-13 20.5-18.2c-79.6 2.5-154.7 42.2-201.2 108z"]
};
const faHelmetUn = {
  prefix: 'fas',
  iconName: 'helmet-un',
  icon: [512, 512, [], "e503", "M479.5 224C471.2 98.9 367.2 0 240 0C107.5 0 0 107.5 0 240l0 56.3C0 344.8 39.2 384 87.7 384L200 384l14.9 0L343.5 505.4c4.5 4.2 10.4 6.6 16.5 6.6l96 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-86.5 0-1.5-1.5L368 288l80 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-.5 0zM320 417.2l-78-73.7L274.4 288l45.6 0 0 129.2zM285.3 103.1l34.7 52 0-43.2c0-8.8 7.2-16 16-16s16 7.2 16 16l0 96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52 0 43.2c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM160 112l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faBullseye = {
  prefix: 'fas',
  iconName: 'bullseye',
  icon: [512, 512, [], "f140", "M448 256A192 192 0 1 0 64 256a192 192 0 1 0 384 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 80a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zM224 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faBacon = {
  prefix: 'fas',
  iconName: 'bacon',
  icon: [576, 512, [129363], "f7e5", "M439.2 1.2c11.2-3.2 23.2-.1 31.4 8.1L518 56.7l-26.5 7.9c-58 16.6-98.1 39.6-129.6 67.4c-31.2 27.5-53.2 59.1-75.1 90.9l-2.3 3.3C241.6 288.7 195 356.6 72.8 417.7L37.9 435.2 9.4 406.6c-7.3-7.3-10.6-17.6-9-27.8s8.1-18.9 17.3-23.5C136.1 296.2 180.9 231 223.3 169.3l2.3-3.4c21.8-31.8 44.9-64.9 77.7-93.9c33.4-29.5 75.8-53.6 135.9-70.8zM61.8 459l25.4-12.7c129.5-64.7 179.9-138.1 223.8-202l2.2-3.3c22.1-32.1 42.1-60.5 69.9-85.1c27.5-24.3 63.4-45.2 117.3-60.6c0 0 0 0 0 0l.2-.1 43.1-12.9 23 23c8 8 11.2 19.7 8.3 30.7s-11.3 19.6-22.2 22.7c-51.9 14.8-85.6 34.7-111.1 57.2c-26.1 23-45.1 49.9-67.3 82.1l-2.2 3.2C327.8 365.9 275.5 442 142.3 508.6c-12.3 6.2-27.2 3.7-36.9-6L61.8 459z"]
};
const faHandPointDown = {
  prefix: 'fas',
  iconName: 'hand-point-down',
  icon: [384, 512, [], "f0a7", "M32 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-208-64 0 0 208zM224 320c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64zm-64 64c17.7 0 32-14.3 32-32l0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c0 17.7 14.3 32 32 32zm160-96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64zm-96-88l0 .6c9.4-5.4 20.3-8.6 32-8.6c13.2 0 25.4 4 35.6 10.8c8.7-24.9 32.5-42.8 60.4-42.8c11.7 0 22.6 3.1 32 8.6l0-8.6C384 71.6 312.4 0 224 0L162.3 0C119.8 0 79.1 16.9 49.1 46.9L37.5 58.5C13.5 82.5 0 115.1 0 149l0 27c0 35.3 28.7 64 64 64l88 0c22.1 0 40-17.9 40-40s-17.9-40-40-40l-56 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l56 0c39.8 0 72 32.2 72 72z"]
};
const faArrowUpFromBracket = {
  prefix: 'fas',
  iconName: 'arrow-up-from-bracket',
  icon: [448, 512, [], "e09a", "M246.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 109.3 192 320c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-64z"]
};
const faFolder = {
  prefix: 'fas',
  iconName: 'folder',
  icon: [512, 512, [128193, 128447, 61716, "folder-blank"], "f07b", "M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H288c-10.1 0-19.6-4.7-25.6-12.8L243.2 57.6C231.1 41.5 212.1 32 192 32H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64z"]
};
const faFolderBlank = faFolder;
const faFileWaveform = {
  prefix: 'fas',
  iconName: 'file-waveform',
  icon: [448, 512, ["file-medical-alt"], "f478", "M96 0C60.7 0 32 28.7 32 64l0 224 112 0c6.1 0 11.6 3.4 14.3 8.8L176 332.2l49.7-99.4c2.7-5.4 8.3-8.8 14.3-8.8s11.6 3.4 14.3 8.8L281.9 288l70.1 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-80 0c-6.1 0-11.6-3.4-14.3-8.8L240 275.8l-49.7 99.4c-2.7 5.4-8.3 8.8-14.3 8.8s-11.6-3.4-14.3-8.8L134.1 320 32 320l0 128c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L256 0 96 0zM288 0l0 128 128 0L288 0z"]
};
const faFileMedicalAlt = faFileWaveform;
const faRadiation = {
  prefix: 'fas',
  iconName: 'radiation',
  icon: [512, 512, [], "f7b9", "M216 186.7c-23.9 13.8-40 39.7-40 69.3L32 256C14.3 256-.2 241.6 2 224.1C10.7 154 47.8 92.7 101.3 52c14.1-10.7 33.8-5.3 42.7 10l72 124.7zM256 336c14.6 0 28.2-3.9 40-10.7l72 124.8c8.8 15.3 3.7 35.1-12.6 41.9c-30.6 12.9-64.2 20-99.4 20s-68.9-7.1-99.4-20c-16.3-6.9-21.4-26.6-12.6-41.9l72-124.8c11.8 6.8 25.4 10.7 40 10.7zm224-80l-144 0c0-29.6-16.1-55.5-40-69.3L368 62c8.8-15.3 28.6-20.7 42.7-10c53.6 40.7 90.6 102 99.4 172.1c2.2 17.5-12.4 31.9-30 31.9zM256 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faChartSimple = {
  prefix: 'fas',
  iconName: 'chart-simple',
  icon: [448, 512, [], "e473", "M160 80c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-352zM0 272c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48L0 272zM368 96l32 0c26.5 0 48 21.5 48 48l0 288c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48z"]
};
const faMarsStroke = {
  prefix: 'fas',
  iconName: 'mars-stroke',
  icon: [512, 512, [9894], "f229", "M376 0c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l33.4 33.4L370.3 96.4 345 71c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l25.4 25.4L307.8 159c-28.4-19.5-62.7-31-99.8-31c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176c0-37-11.4-71.4-31-99.8l28.6-28.6L407 201c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-25.4-25.4 22.1-22.1L471 153c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-112c0-13.3-10.7-24-24-24L376 0zm88 48s0 0 0 0s0 0 0 0s0 0 0 0zM96 304a112 112 0 1 1 224 0A112 112 0 1 1 96 304z"]
};
const faVial = {
  prefix: 'fas',
  iconName: 'vial',
  icon: [512, 512, [129514], "f492", "M342.6 9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4L28.1 342.6C10.1 360.6 0 385 0 410.5L0 416c0 53 43 96 96 96l5.5 0c25.5 0 49.9-10.1 67.9-28.1L448 205.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-32-32-96-96-32-32zM205.3 256L352 109.3 402.7 160l-96 96-101.5 0z"]
};
const faGauge = {
  prefix: 'fas',
  iconName: 'gauge',
  icon: [512, 512, ["dashboard", "gauge-med", "tachometer-alt-average"], "f624", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-26.9-16.5-49.9-40-59.3L280 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 204.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64s64-28.7 64-64zM144 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm-16 80a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM400 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faDashboard = faGauge;
const faGaugeMed = faGauge;
const faTachometerAltAverage = faGauge;
const faWandMagicSparkles = {
  prefix: 'fas',
  iconName: 'wand-magic-sparkles',
  icon: [576, 512, ["magic-wand-sparkles"], "e2ca", "M234.7 42.7L197 56.8c-3 1.1-5 4-5 7.2s2 6.1 5 7.2l37.7 14.1L248.8 123c1.1 3 4 5 7.2 5s6.1-2 7.2-5l14.1-37.7L315 71.2c3-1.1 5-4 5-7.2s-2-6.1-5-7.2L277.3 42.7 263.2 5c-1.1-3-4-5-7.2-5s-6.1 2-7.2 5L234.7 42.7zM46.1 395.4c-18.7 18.7-18.7 49.1 0 67.9l34.6 34.6c18.7 18.7 49.1 18.7 67.9 0L529.9 116.5c18.7-18.7 18.7-49.1 0-67.9L495.3 14.1c-18.7-18.7-49.1-18.7-67.9 0L46.1 395.4zM484.6 82.6l-105 105-23.3-23.3 105-105 23.3 23.3zM7.5 117.2C3 118.9 0 123.2 0 128s3 9.1 7.5 10.8L64 160l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L128 160l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L128 96 106.8 39.5C105.1 35 100.8 32 96 32s-9.1 3-10.8 7.5L64 96 7.5 117.2zm352 256c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L416 416l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L480 416l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L480 352l-21.2-56.5c-1.7-4.5-6-7.5-10.8-7.5s-9.1 3-10.8 7.5L416 352l-56.5 21.2z"]
};
const faMagicWandSparkles = faWandMagicSparkles;
const faE = {
  prefix: 'fas',
  iconName: 'e',
  icon: [320, 512, [101], "45", "M64 32C28.7 32 0 60.7 0 96L0 256 0 416c0 35.3 28.7 64 64 64l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 416l0-128 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 224 64 96l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32z"]
};
const faPenClip = {
  prefix: 'fas',
  iconName: 'pen-clip',
  icon: [512, 512, ["pen-alt"], "f305", "M453.3 19.3l39.4 39.4c25 25 25 65.5 0 90.5l-52.1 52.1s0 0 0 0l-1-1s0 0 0 0l-16-16-96-96-17-17 52.1-52.1c25-25 65.5-25 90.5 0zM241 114.9c-9.4-9.4-24.6-9.4-33.9 0L105 217c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L173.1 81c28.1-28.1 73.7-28.1 101.8 0L288 94.1l17 17 96 96 16 16 1 1-17 17L229.5 412.5c-48 48-109.2 80.8-175.8 94.1l-25 5c-7.9 1.6-16-.9-21.7-6.6s-8.1-13.8-6.6-21.7l5-25c13.3-66.6 46.1-127.8 94.1-175.8L254.1 128 241 114.9z"]
};
const faPenAlt = faPenClip;
const faBridgeCircleExclamation = {
  prefix: 'fas',
  iconName: 'bridge-circle-exclamation',
  icon: [640, 512, [], "e4ca", "M64 32C46.3 32 32 46.3 32 64s14.3 32 32 32l40 0 0 64-72 0 0 128c53 0 96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96c6.3 0 12.4 .6 18.3 1.7C367.1 231.8 426.9 192 496 192c42.5 0 81.6 15.1 112 40.2l0-72.2-72 0 0-64 40 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32zM488 96l0 64-80 0 0-64 80 0zM360 96l0 64-80 0 0-64 80 0zM232 96l0 64-80 0 0-64 80 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faUser = {
  prefix: 'fas',
  iconName: 'user',
  icon: [448, 512, [128100, 62144], "f007", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z"]
};
const faSchoolCircleCheck = {
  prefix: 'fas',
  iconName: 'school-circle-check',
  icon: [640, 512, [], "e56b", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l272 0s0 0 0 0l-64 0 0-96c0-35.3 28.7-64 64-64l.3 0 .5 0c3.4-37.7 18.7-72.1 42.2-99.1C350.2 260 335.6 264 320 264c-48.6 0-88-39.4-88-88s39.4-88 88-88s88 39.4 88 88c0 18.3-5.6 35.3-15.1 49.4c29-21 64.6-33.4 103.1-33.4c59.5 0 112.1 29.6 144 74.8L640 144c0-26.5-21.5-48-48-48L473.7 96 337.8 5.4zM96 192l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm0 128l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zM320 128c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16c0-8.8-7.2-16-16-16zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-99.3-43.3c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7z"]
};
const faDumpster = {
  prefix: 'fas',
  iconName: 'dumpster',
  icon: [576, 512, [], "f793", "M49.7 32c-10.5 0-19.8 6.9-22.9 16.9L.9 133c-.6 2-.9 4.1-.9 6.1C0 150.7 9.3 160 20.9 160l94 0L140.5 32 49.7 32zM272 160l0-128-98.9 0L147.5 160 272 160zm32 0l124.5 0L402.9 32 304 32l0 128zm157.1 0l94 0c11.5 0 20.9-9.3 20.9-20.9c0-2.1-.3-4.1-.9-6.1L549.2 48.9C546.1 38.9 536.8 32 526.3 32l-90.8 0 25.6 128zM32 192l4 32-4 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l12 0L64 448c0 17.7 14.3 32 32 32s32-14.3 32-32l320 0c0 17.7 14.3 32 32 32s32-14.3 32-32l20-160 12 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-4 0 4-32L32 192z"]
};
const faVanShuttle = {
  prefix: 'fas',
  iconName: 'van-shuttle',
  icon: [640, 512, [128656, "shuttle-van"], "f5b6", "M64 104l0 88 96 0 0-96L72 96c-4.4 0-8 3.6-8 8zm482 88L465.1 96 384 96l0 96 162 0zm-226 0l0-96-96 0 0 96 96 0zM592 384l-16 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-26.5 0-48-21.5-48-48L0 104C0 64.2 32.2 32 72 32l120 0 160 0 113.1 0c18.9 0 36.8 8.3 49 22.8L625 186.5c9.7 11.5 15 26.1 15 41.2L640 336c0 26.5-21.5 48-48 48zm-64 0a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM160 432a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faShuttleVan = faVanShuttle;
const faBuildingUser = {
  prefix: 'fas',
  iconName: 'building-user',
  icon: [640, 512, [], "e4da", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 89.9 0c-6.3-10.2-9.9-22.2-9.9-35.1c0-46.9 25.8-87.8 64-109.2l0-95.9L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM576 272a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM352 477.1c0 19.3 15.6 34.9 34.9 34.9l218.2 0c19.3 0 34.9-15.6 34.9-34.9c0-51.4-41.7-93.1-93.1-93.1l-101.8 0c-51.4 0-93.1 41.7-93.1 93.1z"]
};
const faSquareCaretLeft = {
  prefix: 'fas',
  iconName: 'square-caret-left',
  icon: [448, 512, ["caret-square-left"], "f191", "M0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416zM128 256c0-6.7 2.8-13 7.7-17.6l112-104c7-6.5 17.2-8.2 25.9-4.4s14.4 12.5 14.4 22l0 208c0 9.5-5.7 18.2-14.4 22s-18.9 2.1-25.9-4.4l-112-104c-4.9-4.5-7.7-10.9-7.7-17.6z"]
};
const faCaretSquareLeft = faSquareCaretLeft;
const faHighlighter = {
  prefix: 'fas',
  iconName: 'highlighter',
  icon: [576, 512, [], "f591", "M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5s0 0 0 0l0-71.7c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5L224 416l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7L24 512c-13.3 0-24-10.7-24-24l0-4.7c0-6.4 2.5-12.5 7-17z"]
};
const faKey = {
  prefix: 'fas',
  iconName: 'key',
  icon: [512, 512, [128273], "f084", "M336 352c97.2 0 176-78.8 176-176S433.2 0 336 0S160 78.8 160 176c0 18.7 2.9 36.8 8.3 53.7L7 391c-4.5 4.5-7 10.6-7 17l0 80c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-40 40 0c13.3 0 24-10.7 24-24l0-40 40 0c6.4 0 12.5-2.5 17-7l33.3-33.3c16.9 5.4 35 8.3 53.7 8.3zM376 96a40 40 0 1 1 0 80 40 40 0 1 1 0-80z"]
};
const faBullhorn = {
  prefix: 'fas',
  iconName: 'bullhorn',
  icon: [512, 512, [128226, 128363], "f0a1", "M480 32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9L381.7 53c-48 48-113.1 75-181 75l-8.7 0-32 0-96 0c-35.3 0-64 28.7-64 64l0 96c0 35.3 28.7 64 64 64l0 128c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-128 8.7 0c67.9 0 133 27 181 75l43.6 43.6c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-147.6c18.6-8.8 32-32.5 32-60.4s-13.4-51.6-32-60.4L480 32zm-64 76.7L416 240l0 131.3C357.2 317.8 280.5 288 200.7 288l-8.7 0 0-96 8.7 0c79.8 0 156.5-29.8 215.3-83.3z"]
};
const faGlobe = {
  prefix: 'fas',
  iconName: 'globe',
  icon: [512, 512, [127760], "f0ac", "M352 256c0 22.2-1.2 43.6-3.3 64l-185.3 0c-2.2-20.4-3.3-41.8-3.3-64s1.2-43.6 3.3-64l185.3 0c2.2 20.4 3.3 41.8 3.3 64zm28.8-64l123.1 0c5.3 20.5 8.1 41.9 8.1 64s-2.8 43.5-8.1 64l-123.1 0c2.1-20.6 3.2-42 3.2-64s-1.1-43.4-3.2-64zm112.6-32l-116.7 0c-10-63.9-29.8-117.4-55.3-151.6c78.3 20.7 142 77.5 171.9 151.6zm-149.1 0l-176.6 0c6.1-36.4 15.5-68.6 27-94.7c10.5-23.6 22.2-40.7 33.5-51.5C239.4 3.2 248.7 0 256 0s16.6 3.2 27.8 13.8c11.3 10.8 23 27.9 33.5 51.5c11.6 26 20.9 58.2 27 94.7zm-209 0L18.6 160C48.6 85.9 112.2 29.1 190.6 8.4C165.1 42.6 145.3 96.1 135.3 160zM8.1 192l123.1 0c-2.1 20.6-3.2 42-3.2 64s1.1 43.4 3.2 64L8.1 320C2.8 299.5 0 278.1 0 256s2.8-43.5 8.1-64zM194.7 446.6c-11.6-26-20.9-58.2-27-94.6l176.6 0c-6.1 36.4-15.5 68.6-27 94.6c-10.5 23.6-22.2 40.7-33.5 51.5C272.6 508.8 263.3 512 256 512s-16.6-3.2-27.8-13.8c-11.3-10.8-23-27.9-33.5-51.5zM135.3 352c10 63.9 29.8 117.4 55.3 151.6C112.2 482.9 48.6 426.1 18.6 352l116.7 0zm358.1 0c-30 74.1-93.6 130.9-171.9 151.6c25.5-34.2 45.2-87.7 55.3-151.6l116.7 0z"]
};
const faSynagogue = {
  prefix: 'fas',
  iconName: 'synagogue',
  icon: [640, 512, [128333], "f69b", "M309.8 3.7c5.9-4.9 14.6-4.9 20.5 0l121 100.8C469.5 119.7 480 142.2 480 166l0 114.1L480 512l-16 0-112 0 0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96-112 0-16 0 0-231.9L160 166c0-23.7 10.5-46.3 28.8-61.5L309.8 3.7zM512 512l0-267.5 28.1-31.2c3-3.4 7.4-5.3 11.9-5.3s8.9 1.9 11.9 5.3l63.8 70.9c7.9 8.8 12.3 20.3 12.3 32.1L640 448c0 35.3-28.7 64-64 64l-64 0zM128 244.5L128 512l-64 0c-35.3 0-64-28.7-64-64L0 316.3c0-11.9 4.4-23.3 12.3-32.1l63.8-70.9c3-3.4 7.4-5.3 11.9-5.3s8.9 1.9 11.9 5.3L128 244.5zM327 124.3c-3.1-5.4-10.9-5.4-13.9 0l-15.9 28.1-32.3-.3c-6.2-.1-10.1 6.7-7 12.1L274.3 192l-16.4 27.8c-3.2 5.4 .7 12.1 7 12.1l32.3-.3L313 259.7c3.1 5.4 10.9 5.4 13.9 0l15.9-28.1 32.3 .3c6.2 .1 10.1-6.7 7-12.1L365.7 192l16.4-27.8c3.2-5.4-.7-12.1-7-12.1l-32.3 .3L327 124.3z"]
};
const faPersonHalfDress = {
  prefix: 'fas',
  iconName: 'person-half-dress',
  icon: [320, 512, [], "e548", "M160 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm8 352l0-224 6.9 0c33.7 0 64.9 17.7 82.3 46.6l58.3 97c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128s0 0 0 0zM58.2 182.3c19.9-33.1 55.3-53.5 93.8-54.3l0 256s0 0 0 0l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-17.8 0c-10.9 0-18.6-10.7-15.2-21.1L93.3 248.1 59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l53.6-89.2z"]
};
const faRoadBridge = {
  prefix: 'fas',
  iconName: 'road-bridge',
  icon: [640, 512, [], "e563", "M352 0L608 0c17.7 0 32 14.3 32 32l0 448c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-448c0-17.7 14.3-32 32-32zM480 200c-13.3 0-24 10.7-24 24l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64c0-13.3-10.7-24-24-24zm24 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64zM480 40c-13.3 0-24 10.7-24 24l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64c0-13.3-10.7-24-24-24zM32 96l256 0 0 64-40 0 0 64 40 0 0 96c-53 0-96 43-96 96l0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64c0-53-43-96-96-96l0-96 72 0 0-64-40 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm168 64l-80 0 0 64 80 0 0-64z"]
};
const faLocationArrow = {
  prefix: 'fas',
  iconName: 'location-arrow',
  icon: [448, 512, [], "f124", "M429.6 92.1c4.9-11.9 2.1-25.6-7-34.7s-22.8-11.9-34.7-7l-352 144c-14.2 5.8-22.2 20.8-19.3 35.8s16.1 25.8 31.4 25.8l176 0 0 176c0 15.3 10.8 28.4 25.8 31.4s30-5.1 35.8-19.3l144-352z"]
};
const faC = {
  prefix: 'fas',
  iconName: 'c',
  icon: [384, 512, [99], "43", "M329.1 142.9c-62.5-62.5-155.8-62.5-218.3 0s-62.5 163.8 0 226.3s155.8 62.5 218.3 0c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3c-87.5 87.5-221.3 87.5-308.8 0s-87.5-229.3 0-316.8s221.3-87.5 308.8 0c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0z"]
};
const faTabletButton = {
  prefix: 'fas',
  iconName: 'tablet-button',
  icon: [448, 512, [], "f10a", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM224 400a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBuildingLock = {
  prefix: 'fas',
  iconName: 'building-lock',
  icon: [576, 512, [], "e4d6", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 88.6 0c-5.4-9.4-8.6-20.3-8.6-32l0-128c0-23.7 12.9-44.4 32-55.4l0-24.6c0-30.5 12.2-58.2 32-78.4L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM464 240c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faPizzaSlice = {
  prefix: 'fas',
  iconName: 'pizza-slice',
  icon: [512, 512, [], "f818", "M169.7 .9c-22.8-1.6-41.9 14-47.5 34.7L110.4 80c.5 0 1.1 0 1.6 0c176.7 0 320 143.3 320 320c0 .5 0 1.1 0 1.6l44.4-11.8c20.8-5.5 36.3-24.7 34.7-47.5C498.5 159.5 352.5 13.5 169.7 .9zM399.8 410.2c.1-3.4 .2-6.8 .2-10.2c0-159.1-128.9-288-288-288c-3.4 0-6.8 .1-10.2 .2L.5 491.9c-1.5 5.5 .1 11.4 4.1 15.4s9.9 5.6 15.4 4.1L399.8 410.2zM176 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM96 384a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faMoneyBillWave = {
  prefix: 'fas',
  iconName: 'money-bill-wave',
  icon: [576, 512, [], "f53a", "M0 112.5L0 422.3c0 18 10.1 35 27 41.3c87 32.5 174 10.3 261-11.9c79.8-20.3 159.6-40.7 239.3-18.9c23 6.3 48.7-9.5 48.7-33.4l0-309.9c0-18-10.1-35-27-41.3C462 15.9 375 38.1 288 60.3C208.2 80.6 128.4 100.9 48.7 79.1C25.6 72.8 0 88.6 0 112.5zM288 352c-44.2 0-80-43-80-96s35.8-96 80-96s80 43 80 96s-35.8 96-80 96zM64 352c35.3 0 64 28.7 64 64l-64 0 0-64zm64-208c0 35.3-28.7 64-64 64l0-64 64 0zM512 304l0 64-64 0c0-35.3 28.7-64 64-64zM448 96l64 0 0 64c-35.3 0-64-28.7-64-64z"]
};
const faChartArea = {
  prefix: 'fas',
  iconName: 'chart-area',
  icon: [512, 512, ["area-chart"], "f1fe", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm96 288l288 0c17.7 0 32-14.3 32-32l0-68.2c0-7.6-2.7-15-7.7-20.8l-65.8-76.8c-12.1-14.2-33.7-15-46.9-1.8l-21 21c-10 10-26.4 9.2-35.4-1.6l-39.2-47c-12.6-15.1-35.7-15.4-48.7-.6L135.9 215c-5.1 5.8-7.9 13.3-7.9 21.1l0 84c0 17.7 14.3 32 32 32z"]
};
const faAreaChart = faChartArea;
const faHouseFlag = {
  prefix: 'fas',
  iconName: 'house-flag',
  icon: [640, 512, [], "e50d", "M480 0c-17.7 0-32 14.3-32 32l0 160 0 320 64 0 0-320 112 0c8.8 0 16-7.2 16-16l0-128c0-8.8-7.2-16-16-16L512 32c0-17.7-14.3-32-32-32zM416 159L276.8 39.7c-12-10.3-29.7-10.3-41.7 0l-224 192C1 240.4-2.7 254.5 2 267.1S18.6 288 32 288l32 0 0 192c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-96c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 96c0 17.7 14.3 32 32 32l64.7 0 .2 0-1 0 0-353z"]
};
const faPersonCircleMinus = {
  prefix: 'fas',
  iconName: 'person-circle-minus',
  icon: [576, 512, [], "e540", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zm136 16a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm224 0c0-8.8-7.2-16-16-16l-128 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16z"]
};
const faBan = {
  prefix: 'fas',
  iconName: 'ban',
  icon: [512, 512, [128683, "cancel"], "f05e", "M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faCancel = faBan;
const faCameraRotate = {
  prefix: 'fas',
  iconName: 'camera-rotate',
  icon: [640, 512, [], "e0d8", "M213.1 64.8L202.7 96 128 96c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L426.9 64.8C420.4 45.2 402.1 32 381.4 32L258.6 32c-20.7 0-39 13.2-45.5 32.8zM448 256c0 8.8-7.2 16-16 16l-76.7 0c-6.2 0-11.3-5.1-11.3-11.3c0-3 1.2-5.9 3.3-8L371 229c-13.6-13.4-31.9-21-51-21c-19.2 0-37.7 7.6-51.3 21.3L249 249c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l19.7-19.7C257.4 172.7 288 160 320 160c31.8 0 62.4 12.6 85 35l23.7-23.7c2.1-2.1 5-3.3 8-3.3c6.2 0 11.3 5.1 11.3 11.3l0 76.7zM192 320c0-8.8 7.2-16 16-16l76.7 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8L269 347c13.6 13.4 31.9 21 51 21c19.2 0 37.7-7.6 51.3-21.3L391 327c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-19.7 19.7C382.6 403.3 352 416 320 416c-31.8 0-62.4-12.6-85-35l-23.7 23.7c-2.1 2.1-5 3.3-8 3.3c-6.2 0-11.3-5.1-11.3-11.3l0-76.7z"]
};
const faSprayCanSparkles = {
  prefix: 'fas',
  iconName: 'spray-can-sparkles',
  icon: [512, 512, ["air-freshener"], "f5d0", "M96 32l0 96 128 0 0-96c0-17.7-14.3-32-32-32L128 0C110.3 0 96 14.3 96 32zm0 128c-53 0-96 43-96 96L0 464c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-208c0-53-43-96-96-96L96 160zm64 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM384 48c0-1.4-1-3-2.2-3.6L352 32 339.6 2.2C339 1 337.4 0 336 0s-3 1-3.6 2.2L320 32 290.2 44.4C289 45 288 46.6 288 48c0 1.4 1 3 2.2 3.6L320 64l12.4 29.8C333 95 334.6 96 336 96s3-1 3.6-2.2L352 64l29.8-12.4C383 51 384 49.4 384 48zm76.4 45.8C461 95 462.6 96 464 96s3-1 3.6-2.2L480 64l29.8-12.4C511 51 512 49.4 512 48c0-1.4-1-3-2.2-3.6L480 32 467.6 2.2C467 1 465.4 0 464 0s-3 1-3.6 2.2L448 32 418.2 44.4C417 45 416 46.6 416 48c0 1.4 1 3 2.2 3.6L448 64l12.4 29.8zm7.2 100.4c-.6-1.2-2.2-2.2-3.6-2.2s-3 1-3.6 2.2L448 224l-29.8 12.4c-1.2 .6-2.2 2.2-2.2 3.6c0 1.4 1 3 2.2 3.6L448 256l12.4 29.8c.6 1.2 2.2 2.2 3.6 2.2s3-1 3.6-2.2L480 256l29.8-12.4c1.2-.6 2.2-2.2 2.2-3.6c0-1.4-1-3-2.2-3.6L480 224l-12.4-29.8zM448 144c0-1.4-1-3-2.2-3.6L416 128 403.6 98.2C403 97 401.4 96 400 96s-3 1-3.6 2.2L384 128l-29.8 12.4c-1.2 .6-2.2 2.2-2.2 3.6c0 1.4 1 3 2.2 3.6L384 160l12.4 29.8c.6 1.2 2.2 2.2 3.6 2.2s3-1 3.6-2.2L416 160l29.8-12.4c1.2-.6 2.2-2.2 2.2-3.6z"]
};
const faAirFreshener = faSprayCanSparkles;
const faStar = {
  prefix: 'fas',
  iconName: 'star',
  icon: [576, 512, [11088, 61446], "f005", "M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"]
};
const faRepeat = {
  prefix: 'fas',
  iconName: 'repeat',
  icon: [512, 512, [128257], "f363", "M0 224c0 17.7 14.3 32 32 32s32-14.3 32-32c0-53 43-96 96-96l160 0 0 32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9S320 19.1 320 32l0 32L160 64C71.6 64 0 135.6 0 224zm512 64c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 53-43 96-96 96l-160 0 0-32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-32 160 0c88.4 0 160-71.6 160-160z"]
};
const faCross = {
  prefix: 'fas',
  iconName: 'cross',
  icon: [384, 512, [128327, 10013], "f654", "M176 0c-26.5 0-48 21.5-48 48l0 80-80 0c-26.5 0-48 21.5-48 48l0 32c0 26.5 21.5 48 48 48l80 0 0 208c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-208 80 0c26.5 0 48-21.5 48-48l0-32c0-26.5-21.5-48-48-48l-80 0 0-80c0-26.5-21.5-48-48-48L176 0z"]
};
const faBox = {
  prefix: 'fas',
  iconName: 'box',
  icon: [448, 512, [128230], "f466", "M50.7 58.5L0 160l208 0 0-128L93.7 32C75.5 32 58.9 42.3 50.7 58.5zM240 160l208 0L397.3 58.5C389.1 42.3 372.5 32 354.3 32L240 32l0 128zm208 32L0 192 0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-224z"]
};
const faVenusMars = {
  prefix: 'fas',
  iconName: 'venus-mars',
  icon: [640, 512, [9892], "f228", "M176 288a112 112 0 1 0 0-224 112 112 0 1 0 0 224zM352 176c0 86.3-62.1 158.1-144 173.1l0 34.9 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-34.9C62.1 334.1 0 262.3 0 176C0 78.8 78.8 0 176 0s176 78.8 176 176zM271.9 360.6c19.3-10.1 36.9-23.1 52.1-38.4c20 18.5 46.7 29.8 76.1 29.8c61.9 0 112-50.1 112-112s-50.1-112-112-112c-7.2 0-14.3 .7-21.1 2c-4.9-21.5-13-41.7-24-60.2C369.3 66 384.4 64 400 64c37 0 71.4 11.4 99.8 31l20.6-20.6L487 41c-6.9-6.9-8.9-17.2-5.2-26.2S494.3 0 504 0L616 0c13.3 0 24 10.7 24 24l0 112c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-33.4-33.4L545 140.2c19.5 28.4 31 62.7 31 99.8c0 97.2-78.8 176-176 176c-50.5 0-96-21.3-128.1-55.4z"]
};
const faArrowPointer = {
  prefix: 'fas',
  iconName: 'arrow-pointer',
  icon: [320, 512, ["mouse-pointer"], "f245", "M0 55.2L0 426c0 12.2 9.9 22 22 22c6.3 0 12.4-2.7 16.6-7.5L121.2 346l58.1 116.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9L179.8 320l118.1 0c12.2 0 22.1-9.9 22.1-22.1c0-6.3-2.7-12.3-7.4-16.5L38.6 37.9C34.3 34.1 28.9 32 23.2 32C10.4 32 0 42.4 0 55.2z"]
};
const faMousePointer = faArrowPointer;
const faMaximize = {
  prefix: 'fas',
  iconName: 'maximize',
  icon: [512, 512, ["expand-arrows-alt"], "f31e", "M200 32L56 32C42.7 32 32 42.7 32 56l0 144c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l40-40 79 79-79 79L73 295c-6.9-6.9-17.2-8.9-26.2-5.2S32 302.3 32 312l0 144c0 13.3 10.7 24 24 24l144 0c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-40-40 79-79 79 79-40 40c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l144 0c13.3 0 24-10.7 24-24l0-144c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2l-40 40-79-79 79-79 40 40c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-144c0-13.3-10.7-24-24-24L312 32c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l40 40-79 79-79-79 40-40c6.9-6.9 8.9-17.2 5.2-26.2S209.7 32 200 32z"]
};
const faExpandArrowsAlt = faMaximize;
const faChargingStation = {
  prefix: 'fas',
  iconName: 'charging-station',
  icon: [576, 512, [], "f5e7", "M96 0C60.7 0 32 28.7 32 64l0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-144 16 0c22.1 0 40 17.9 40 40l0 32c0 39.8 32.2 72 72 72s72-32.2 72-72l0-123.7c32.5-10.2 56-40.5 56-76.3l0-32c0-8.8-7.2-16-16-16l-16 0 0-48c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-32 0 0-48c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-16 0c-8.8 0-16 7.2-16 16l0 32c0 35.8 23.5 66.1 56 76.3L472 376c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32c0-48.6-39.4-88-88-88l-16 0 0-192c0-35.3-28.7-64-64-64L96 0zM216.9 82.7c6 4 8.5 11.5 6.3 18.3l-25 74.9 57.8 0c6.7 0 12.7 4.2 15 10.4s.5 13.3-4.6 17.7l-112 96c-5.5 4.7-13.4 5.1-19.3 1.1s-8.5-11.5-6.3-18.3l25-74.9L96 208c-6.7 0-12.7-4.2-15-10.4s-.5-13.3 4.6-17.7l112-96c5.5-4.7 13.4-5.1 19.3-1.1z"]
};
const faShapes = {
  prefix: 'fas',
  iconName: 'shapes',
  icon: [512, 512, ["triangle-circle-square"], "f61f", "M315.4 15.5C309.7 5.9 299.2 0 288 0s-21.7 5.9-27.4 15.5l-96 160c-5.9 9.9-6.1 22.2-.4 32.2s16.3 16.2 27.8 16.2l192 0c11.5 0 22.2-6.2 27.8-16.2s5.5-22.3-.4-32.2l-96-160zM288 312l0 144c0 22.1 17.9 40 40 40l144 0c22.1 0 40-17.9 40-40l0-144c0-22.1-17.9-40-40-40l-144 0c-22.1 0-40 17.9-40 40zM128 512a128 128 0 1 0 0-256 128 128 0 1 0 0 256z"]
};
const faTriangleCircleSquare = faShapes;
const faShuffle = {
  prefix: 'fas',
  iconName: 'shuffle',
  icon: [512, 512, [128256, "random"], "f074", "M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"]
};
const faRandom = faShuffle;
const faPersonRunning = {
  prefix: 'fas',
  iconName: 'person-running',
  icon: [448, 512, [127939, "running"], "f70c", "M320 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM125.7 175.5c9.9-9.9 23.4-15.5 37.5-15.5c1.9 0 3.8 .1 5.6 .3L137.6 254c-9.3 28 1.7 58.8 26.8 74.5l86.2 53.9-25.4 88.8c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l28.7-100.4c5.9-20.6-2.6-42.6-20.7-53.9L238 299l30.9-82.4 5.1 12.3C289 264.7 323.9 288 362.7 288l21.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-21.3 0c-12.9 0-24.6-7.8-29.5-19.7l-6.3-15c-14.6-35.1-44.1-61.9-80.5-73.1l-48.7-15c-11.1-3.4-22.7-5.2-34.4-5.2c-31 0-60.8 12.3-82.7 34.3L57.4 153.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l23.1-23.1zM91.2 352L32 352c-17.7 0-32 14.3-32 32s14.3 32 32 32l69.6 0c19 0 36.2-11.2 43.9-28.5L157 361.6l-9.5-6c-17.5-10.9-30.5-26.8-37.9-44.9L91.2 352z"]
};
const faRunning = faPersonRunning;
const faMobileRetro = {
  prefix: 'fas',
  iconName: 'mobile-retro',
  icon: [320, 512, [], "e527", "M0 64C0 28.7 28.7 0 64 0L256 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm64 96l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L96 128c-17.7 0-32 14.3-32 32zM80 352a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm56-56a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm56-56a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM128 48c-8.8 0-16 7.2-16 16s7.2 16 16 16l64 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0z"]
};
const faGripLinesVertical = {
  prefix: 'fas',
  iconName: 'grip-lines-vertical',
  icon: [192, 512, [], "f7a5", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32L64 64zm128 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384z"]
};
const faSpider = {
  prefix: 'fas',
  iconName: 'spider',
  icon: [512, 512, [128375], "f717", "M158.4 32.6c4.8-12.4-1.4-26.3-13.8-31s-26.3 1.4-31 13.8L81.1 100c-7.9 20.7-3 44.1 12.7 59.7l57.4 57.4L70.8 190.3c-2.4-.8-4.3-2.7-5.1-5.1L46.8 128.4C42.6 115.8 29 109 16.4 113.2S-3 131 1.2 143.6l18.9 56.8c5.6 16.7 18.7 29.8 35.4 35.4L116.1 256 55.6 276.2c-16.7 5.6-29.8 18.7-35.4 35.4L1.2 368.4C-3 381 3.8 394.6 16.4 398.8s26.2-2.6 30.4-15.2l18.9-56.8c.8-2.4 2.7-4.3 5.1-5.1l80.4-26.8L93.7 352.3C78.1 368 73.1 391.4 81.1 412l32.5 84.6c4.8 12.4 18.6 18.5 31 13.8s18.5-18.6 13.8-31l-32.5-84.6c-1.1-3-.4-6.3 1.8-8.5L160 353.9c1 52.1 43.6 94.1 96 94.1s95-41.9 96-94.1l32.3 32.3c2.2 2.2 2.9 5.6 1.8 8.5l-32.5 84.6c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8L430.9 412c7.9-20.7 3-44.1-12.7-59.7l-57.4-57.4 80.4 26.8c2.4 .8 4.3 2.7 5.1 5.1l18.9 56.8c4.2 12.6 17.8 19.4 30.4 15.2s19.4-17.8 15.2-30.4l-18.9-56.8c-5.6-16.7-18.7-29.8-35.4-35.4L395.9 256l60.5-20.2c16.7-5.6 29.8-18.7 35.4-35.4l18.9-56.8c4.2-12.6-2.6-26.2-15.2-30.4s-26.2 2.6-30.4 15.2l-18.9 56.8c-.8 2.4-2.7 4.3-5.1 5.1l-80.4 26.8 57.4-57.4c15.6-15.6 20.6-39 12.7-59.7L398.4 15.4C393.6 3 379.8-3.2 367.4 1.6s-18.5 18.6-13.8 31l32.5 84.6c1.1 3 .4 6.3-1.8 8.5L336 174.1l0-14.1c0-31.8-18.6-59.3-45.5-72.2c-9.1-4.4-18.5 3.3-18.5 13.4l0 10.8c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-10.8c0-10.1-9.4-17.7-18.5-13.4C194.6 100.7 176 128.2 176 160l0 14.1-48.3-48.3c-2.2-2.2-2.9-5.6-1.8-8.5l32.5-84.6z"]
};
const faHandsBound = {
  prefix: 'fas',
  iconName: 'hands-bound',
  icon: [640, 512, [], "e4f9", "M96 32C96 14.3 81.7 0 64 0S32 14.3 32 32l0 64 0 59.1 0 .7L32 192l0 21.9c0 14.2 5.1 27.9 14.3 38.7L131.6 352l-3.6 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 128 0 64 0 128 0 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-3.6 0 85.3-99.5c9.2-10.8 14.3-24.5 14.3-38.7l0-21.9 0-36.2 0-.7L608 96l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64 0 48.8-69.3 92.4c-5.7 7.6-16.1 9.6-24.2 4.8c-9.7-5.7-12.1-18.7-5.1-27.5L473 180c10.8-13.5 8.9-33.3-4.4-44.5s-33-9.8-44.5 3.2l-46.7 52.5C361 209.7 352 233.4 352 258.1l0 61.9 0 32-64 0 0-32 0-61.9c0-24.6-9-48.4-25.4-66.8l-46.7-52.5c-11.5-13-31.3-14.4-44.5-3.2s-15.2 30.9-4.4 44.5l27.6 34.5c7 8.8 4.7 21.8-5.1 27.5c-8.1 4.8-18.6 2.7-24.2-4.8L96 144.8 96 96l0-64zm64 448l0 32 128 0 0-32 64 0 0 32 128 0 0-32 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0-128 0-64 0-128 0-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0z"]
};
const faFileInvoiceDollar = {
  prefix: 'fas',
  iconName: 'file-invoice-dollar',
  icon: [384, 512, [], "f571", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM64 80c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 96c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16zm128 72c8.8 0 16 7.2 16 16l0 17.3c8.5 1.2 16.7 3.1 24.1 5.1c8.5 2.3 13.6 11 11.3 19.6s-11 13.6-19.6 11.3c-11.1-3-22-5.2-32.1-5.3c-8.4-.1-17.4 1.8-23.6 5.5c-5.7 3.4-8.1 7.3-8.1 12.8c0 3.7 1.3 6.5 7.3 10.1c6.9 4.1 16.6 7.1 29.2 10.9l.5 .1s0 0 0 0s0 0 0 0c11.3 3.4 25.3 7.6 36.3 14.6c12.1 7.6 22.4 19.7 22.7 38.2c.3 19.3-9.6 33.3-22.9 41.6c-7.7 4.8-16.4 7.6-25.1 9.1l0 17.1c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-17.8c-11.2-2.1-21.7-5.7-30.9-8.9c0 0 0 0 0 0c-2.1-.7-4.2-1.4-6.2-2.1c-8.4-2.8-12.9-11.9-10.1-20.2s11.9-12.9 20.2-10.1c2.5 .8 4.8 1.6 7.1 2.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c13.6 4.6 24.6 8.4 36.3 8.7c9.1 .3 17.9-1.7 23.7-5.3c5.1-3.2 7.9-7.3 7.8-14c-.1-4.6-1.8-7.8-7.7-11.6c-6.8-4.3-16.5-7.4-29-11.2l-1.6-.5s0 0 0 0c-11-3.3-24.3-7.3-34.8-13.7c-12-7.2-22.6-18.9-22.7-37.3c-.1-19.4 10.8-32.8 23.8-40.5c7.5-4.4 15.8-7.2 24.1-8.7l0-17.3c0-8.8 7.2-16 16-16z"]
};
const faPlaneCircleExclamation = {
  prefix: 'fas',
  iconName: 'plane-circle-exclamation',
  icon: [640, 512, [], "e556", "M256 0c-35 0-64 59.5-64 93.7l0 84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9l0 65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8l0 42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3l0-84.6C320 59.5 292 0 256 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faXRay = {
  prefix: 'fas',
  iconName: 'x-ray',
  icon: [512, 512, [], "f497", "M0 64C0 46.3 14.3 32 32 32l448 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 320c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32L32 96C14.3 96 0 81.7 0 64zM256 96c-8.8 0-16 7.2-16 16l0 32-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 48-112 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l112 0 0 70.6L189.1 307c-5.2-2-10.6-3-16.2-3l-2.1 0c-23.6 0-42.8 19.2-42.8 42.8c0 9.6 3.2 18.9 9.1 26.4l18.2 23.2c9.7 12.4 24.6 19.6 40.3 19.6l120.8 0c15.7 0 30.6-7.2 40.3-19.6l18.2-23.2c5.9-7.5 9.1-16.8 9.1-26.4c0-23.6-19.2-42.8-42.8-42.8l-2.2 0c-5.5 0-11 1-16.2 3L272 326.6l0-70.6 112 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-112 0 0-48 80 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-80 0 0-32c0-8.8-7.2-16-16-16zM208 352a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm80 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faSpellCheck = {
  prefix: 'fas',
  iconName: 'spell-check',
  icon: [576, 512, [], "f891", "M112 0C99.1 0 87.4 7.8 82.5 19.7l-66.7 160-13.3 32c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L66.7 224l90.7 0 5.1 12.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8l-13.3-32-66.7-160C136.6 7.8 124.9 0 112 0zm18.7 160l-37.3 0L112 115.2 130.7 160zM256 32l0 96 0 96c0 17.7 14.3 32 32 32l80 0c44.2 0 80-35.8 80-80c0-23.1-9.8-43.8-25.4-58.4c6-11.2 9.4-24 9.4-37.6c0-44.2-35.8-80-80-80L288 0c-17.7 0-32 14.3-32 32zm96 64l-32 0 0-32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16zm-32 64l32 0 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0 0-32zM566.6 310.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L352 434.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l192-192z"]
};
const faSlash = {
  prefix: 'fas',
  iconName: 'slash',
  icon: [640, 512, [], "f715", "M5.1 9.2C13.3-1.2 28.4-3.1 38.8 5.1l592 464c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2z"]
};
const faComputerMouse = {
  prefix: 'fas',
  iconName: 'computer-mouse',
  icon: [384, 512, [128433, "mouse"], "f8cc", "M0 192l176 0L176 0 160 0C71.6 0 0 71.6 0 160l0 32zm0 32L0 352c0 88.4 71.6 160 160 160l64 0c88.4 0 160-71.6 160-160l0-128-192 0L0 224zm384-32l0-32C384 71.6 312.4 0 224 0L208 0l0 192 176 0z"]
};
const faMouse = faComputerMouse;
const faArrowRightToBracket = {
  prefix: 'fas',
  iconName: 'arrow-right-to-bracket',
  icon: [512, 512, ["sign-in"], "f090", "M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]
};
const faSignIn = faArrowRightToBracket;
const faShopSlash = {
  prefix: 'fas',
  iconName: 'shop-slash',
  icon: [640, 512, ["store-alt-slash"], "e070", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-54.8-43L576 224l-64 0 0 152L384 275.7l0-51.7-64 0 0 1.5L277.2 192l325.9 0c20.3 0 36.8-16.5 36.8-36.8c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0L121.7 0c-16 0-31 8-39.9 21.4L74.1 32.8 38.8 5.1zM36.8 192l85 0L21 112.5 6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM320 384l-192 0 0-160-64 0 0 160 0 80c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-65.5-64-50.4 0 35.9z"]
};
const faStoreAltSlash = faShopSlash;
const faServer = {
  prefix: 'fas',
  iconName: 'server',
  icon: [512, 512, [], "f233", "M64 32C28.7 32 0 60.7 0 96l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 32zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm48 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 288zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm56 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faVirusCovidSlash = {
  prefix: 'fas',
  iconName: 'virus-covid-slash',
  icon: [640, 512, [], "e4a9", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c11.4-19.5 19.1-41.4 22.3-64.7l33.6 0 0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-80c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16-33.6 0c-4.2-30.7-16.3-58.8-34.1-82.3L484 125.9l11.3 11.3c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L472.7 46.7c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9L450.1 92l-23.8 23.8C402.8 97.9 374.7 85.8 344 81.6L344 48l16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L280 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0 0 33.6c-30.7 4.2-58.8 16.3-82.3 34.1L189.9 92l11.3-11.3c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L134.1 79.8 38.8 5.1zM149.2 213.5c-1.5 6-2.7 12.2-3.5 18.5L112 232l0-16c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16 33.6 0c4.2 30.7 16.3 58.8 34.1 82.3L156 386.1l-11.3-11.3c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l56.6 56.6c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L189.9 420l23.8-23.8c23.5 17.9 51.7 29.9 82.3 34.1l0 33.6-16 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0-33.6c20.4-2.8 39.7-9.1 57.3-18.2L149.2 213.5z"]
};
const faShopLock = {
  prefix: 'fas',
  iconName: 'shop-lock',
  icon: [640, 512, [], "e4a5", "M36.8 192l412.8 0c20.2-19.8 47.9-32 78.4-32c30.5 0 58.1 12.2 78.3 31.9c18.9-1.6 33.7-17.4 33.7-36.7c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0L121.7 0c-16 0-31 8-39.9 21.4L6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM384 224l-64 0 0 160-192 0 0-160-64 0 0 160 0 80c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-80 0-32 0-128zm144 16c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faHourglassStart = {
  prefix: 'fas',
  iconName: 'hourglass-start',
  icon: [384, 512, ["hourglass-1"], "f251", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1L146.7 256 78.9 323.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 256 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1L237.3 256l67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32s-14.3-32-32-32L320 0 64 0 32 0zM288 437l0 11L96 448l0-11c0-25.5 10.1-49.9 28.1-67.9L192 301.3l67.9 67.9c18 18 28.1 42.4 28.1 67.9z"]
};
const faHourglass1 = faHourglassStart;
const faBlenderPhone = {
  prefix: 'fas',
  iconName: 'blender-phone',
  icon: [576, 512, [], "f6b6", "M224 352L196.8 52.3C194.2 24.2 216.3 0 244.6 0L534.1 0c21.1 0 36.4 20.1 30.9 40.4L558.5 64 400 64c-8.8 0-16 7.2-16 16s7.2 16 16 16l149.8 0-17.5 64L400 160c-8.8 0-16 7.2-16 16s7.2 16 16 16l123.6 0-17.5 64L400 256c-8.8 0-16 7.2-16 16s7.2 16 16 16l97.5 0L480 352l-256 0zm-16 32l288 0c26.5 0 48 21.5 48 48l0 32c0 26.5-21.5 48-48 48l-288 0c-26.5 0-48-21.5-48-48l0-32c0-26.5 21.5-48 48-48zm144 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM147.5 30.7c10.8 6.7 15.3 21 10.6 33.4l-22 57.8c-4.2 10.9-14.5 17.6-25.3 16.4l-33.3-3.6c-13.6 42.2-13.6 88.4 0 130.7l33.3-3.6c10.9-1.2 21.2 5.5 25.3 16.4l22 57.8c4.7 12.4 .2 26.7-10.6 33.4l-44 27.2c-9.7 6-21.9 4.2-29.8-4.3C-24.6 286-24.6 114 73.7 7.8C81.6-.7 93.8-2.5 103.5 3.5l44 27.2z"]
};
const faBuildingWheat = {
  prefix: 'fas',
  iconName: 'building-wheat',
  icon: [640, 512, [], "e4db", "M0 48C0 21.5 21.5 0 48 0L336 0c26.5 0 48 21.5 48 48l0 416c0 26.5-21.5 48-48 48l-96 0 0-80c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 80-96 0c-26.5 0-48-21.5-48-48L0 48zM80 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm112-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L80 96c-8.8 0-16 7.2-16 16zM176 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm384 80l0 16c0 44.2-35.8 80-80 80l-16 0 0-16c0-44.2 35.8-80 80-80l16 0zm0 128c0 44.2-35.8 80-80 80l-16 0 0-16c0-44.2 35.8-80 80-80l16 0 0 16zm0 112c0 44.2-35.8 80-80 80l-16 0 0-16c0-44.2 35.8-80 80-80l16 0 0 16zM512 496l0 16-16 0c-44.2 0-80-35.8-80-80l0-16 16 0c44.2 0 80 35.8 80 80zm0-96l-16 0c-44.2 0-80-35.8-80-80l0-16 16 0c44.2 0 80 35.8 80 80l0 16zm0-128l0 16-16 0c-44.2 0-80-35.8-80-80l0-16 16 0c44.2 0 80 35.8 80 80zM528 32c13.3 0 24 10.7 24 24l0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-104c0-13.3 10.7-24 24-24zm96 64l0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32c0-13.3 10.7-24 24-24s24 10.7 24 24zM456 72c13.3 0 24 10.7 24 24l0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32c0-13.3 10.7-24 24-24z"]
};
const faPersonBreastfeeding = {
  prefix: 'fas',
  iconName: 'person-breastfeeding',
  icon: [448, 512, [], "e53a", "M224 0a80 80 0 1 1 0 160A80 80 0 1 1 224 0zM436.8 382.8L373.5 462c-16.6 20.7-46.8 24.1-67.5 7.5c-17.6-14.1-22.7-38.1-13.5-57.7l-.8-.1c-38.9-5.6-74.3-25.1-99.7-54.8l0-36.8c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c0 .8 0 1.6 .1 2.4l101.4 50.7c23.7 11.9 33.3 40.7 21.5 64.4s-40.7 33.3-64.4 21.5L27.2 427.3c-1.1-.5-2.2-1.1-3.3-1.7c-4.9-2.8-9.2-6.4-12.6-10.6c-4.6-5.4-7.8-11.7-9.6-18.4c-3.3-12-1.9-25.2 4.8-36.6c.6-1.1 1.3-2.2 2-3.2L75.6 256.1c26.7-40.1 71.7-64.1 119.8-64.1l75.2 0c46.5 0 90.1 22.5 117.2 60.3l50.7 70.9c2.2 3 4 6.1 5.5 9.4c2.9 6.7 4.3 13.8 4 20.8c-.3 10.6-4.2 21-11.2 29.4zM320 332a44 44 0 1 0 -88 0 44 44 0 1 0 88 0z"]
};
const faRightToBracket = {
  prefix: 'fas',
  iconName: 'right-to-bracket',
  icon: [512, 512, ["sign-in-alt"], "f2f6", "M217.9 105.9L340.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L217.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1L32 320c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM352 416l64 0c17.7 0 32-14.3 32-32l0-256c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c53 0 96 43 96 96l0 256c0 53-43 96-96 96l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faSignInAlt = faRightToBracket;
const faVenus = {
  prefix: 'fas',
  iconName: 'venus',
  icon: [384, 512, [9792], "f221", "M80 176a112 112 0 1 1 224 0A112 112 0 1 1 80 176zM224 349.1c81.9-15 144-86.8 144-173.1C368 78.8 289.2 0 192 0S16 78.8 16 176c0 86.3 62.1 158.1 144 173.1l0 34.9-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-34.9z"]
};
const faPassport = {
  prefix: 'fas',
  iconName: 'passport',
  icon: [448, 512, [], "f5ab", "M0 64C0 28.7 28.7 0 64 0L384 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM183 278.8c-27.9-13.2-48.4-39.4-53.7-70.8l39.1 0c1.6 30.4 7.7 53.8 14.6 70.8zm41.3 9.2l-.3 0-.3 0c-2.4-3.5-5.7-8.9-9.1-16.5c-6-13.6-12.4-34.3-14.2-63.5l47.1 0c-1.8 29.2-8.1 49.9-14.2 63.5c-3.4 7.6-6.7 13-9.1 16.5zm40.7-9.2c6.8-17.1 12.9-40.4 14.6-70.8l39.1 0c-5.3 31.4-25.8 57.6-53.7 70.8zM279.6 176c-1.6-30.4-7.7-53.8-14.6-70.8c27.9 13.2 48.4 39.4 53.7 70.8l-39.1 0zM223.7 96l.3 0 .3 0c2.4 3.5 5.7 8.9 9.1 16.5c6 13.6 12.4 34.3 14.2 63.5l-47.1 0c1.8-29.2 8.1-49.9 14.2-63.5c3.4-7.6 6.7-13 9.1-16.5zM183 105.2c-6.8 17.1-12.9 40.4-14.6 70.8l-39.1 0c5.3-31.4 25.8-57.6 53.7-70.8zM352 192A128 128 0 1 0 96 192a128 128 0 1 0 256 0zM112 384c-8.8 0-16 7.2-16 16s7.2 16 16 16l224 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-224 0z"]
};
const faThumbtackSlash = {
  prefix: 'fas',
  iconName: 'thumbtack-slash',
  icon: [640, 512, ["thumb-tack-slash"], "e68f", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L481.4 352c9.8-.4 18.9-5.3 24.6-13.3c6-8.3 7.7-19.1 4.4-28.8l-1-3c-13.8-41.5-42.8-74.8-79.5-94.7L418.5 64 448 64c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l29.5 0-6.1 79.5L38.8 5.1zM324.9 352L177.1 235.6c-20.9 18.9-37.2 43.3-46.5 71.3l-1 3c-3.3 9.8-1.6 20.5 4.4 28.8s15.7 13.3 26 13.3l164.9 0zM288 384l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96-64 0z"]
};
const faThumbTackSlash = faThumbtackSlash;
const faHeartPulse = {
  prefix: 'fas',
  iconName: 'heart-pulse',
  icon: [512, 512, ["heartbeat"], "f21e", "M228.3 469.1L47.6 300.4c-4.2-3.9-8.2-8.1-11.9-12.4l87 0c22.6 0 43-13.6 51.7-34.5l10.5-25.2 49.3 109.5c3.8 8.5 12.1 14 21.4 14.1s17.8-5 22-13.3L320 253.7l1.7 3.4c9.5 19 28.9 31 50.1 31l104.5 0c-3.7 4.3-7.7 8.5-11.9 12.4L283.7 469.1c-7.5 7-17.4 10.9-27.7 10.9s-20.2-3.9-27.7-10.9zM503.7 240l-132 0c-3 0-5.8-1.7-7.2-4.4l-23.2-46.3c-4.1-8.1-12.4-13.3-21.5-13.3s-17.4 5.1-21.5 13.3l-41.4 82.8L205.9 158.2c-3.9-8.7-12.7-14.3-22.2-14.1s-18.1 5.9-21.8 14.8l-31.8 76.3c-1.2 3-4.2 4.9-7.4 4.9L16 240c-2.6 0-5 .4-7.3 1.1C3 225.2 0 208.2 0 190.9l0-5.8c0-69.9 50.5-129.5 119.4-141C165 36.5 211.4 51.4 244 84l12 12 12-12c32.6-32.6 79-47.5 124.6-39.9C461.5 55.6 512 115.2 512 185.1l0 5.8c0 16.9-2.8 33.5-8.3 49.1z"]
};
const faHeartbeat = faHeartPulse;
const faPeopleCarryBox = {
  prefix: 'fas',
  iconName: 'people-carry-box',
  icon: [640, 512, ["people-carry"], "f4ce", "M80 48a48 48 0 1 1 96 0A48 48 0 1 1 80 48zm64 193.7l0 65.1 51 51c7.1 7.1 11.8 16.2 13.4 26.1l15.2 90.9c2.9 17.4-8.9 33.9-26.3 36.8s-33.9-8.9-36.8-26.3l-14.3-85.9L66.8 320C54.8 308 48 291.7 48 274.7l0-88.1c0-32.4 26.2-58.6 58.6-58.6c24.1 0 46.5 12 59.9 32l47.4 71.1 10.1 5 0-76.2c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32l0 76.2 10.1-5L473.5 160c13.3-20 35.8-32 59.9-32c32.4 0 58.6 26.2 58.6 58.6l0 88.1c0 17-6.7 33.3-18.7 45.3l-79.4 79.4-14.3 85.9c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l15.2-90.9c1.6-9.9 6.3-19 13.4-26.1l51-51 0-65.1-19 28.5c-4.6 7-11 12.6-18.5 16.3l-59.6 29.8c-2.4 1.3-4.9 2.2-7.6 2.8c-2.6 .6-5.3 .9-7.9 .8l-126.7 0c-2.5 .1-5-.2-7.5-.7c-2.9-.6-5.6-1.6-8.1-3l-59.5-29.8c-7.5-3.7-13.8-9.4-18.5-16.3l-19-28.5zM2.3 468.1L50.1 348.6l49.2 49.2-37.6 94c-6.6 16.4-25.2 24.4-41.6 17.8S-4.3 484.5 2.3 468.1zM512 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm77.9 348.6l47.8 119.5c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8l-37.6-94 49.2-49.2z"]
};
const faPeopleCarry = faPeopleCarryBox;
const faTemperatureHigh = {
  prefix: 'fas',
  iconName: 'temperature-high',
  icon: [512, 512, [], "f769", "M416 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 128A96 96 0 1 0 416 0a96 96 0 1 0 0 192zM96 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 164.5c0 17.3 7.1 31.9 15.3 42.5C217.8 332.6 224 349.5 224 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9C88.9 308.4 96 293.8 96 276.5L96 112zM144 0C82.1 0 32 50.2 32 112l0 164.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C11.2 304.2 0 334.8 0 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6L256 112C256 50.2 205.9 0 144 0zm0 416c26.5 0 48-21.5 48-48c0-20.9-13.4-38.7-32-45.3L160 112c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 210.7c-18.6 6.6-32 24.4-32 45.3c0 26.5 21.5 48 48 48z"]
};
const faMicrochip = {
  prefix: 'fas',
  iconName: 'microchip',
  icon: [512, 512, [], "f2db", "M176 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c-35.3 0-64 28.7-64 64l-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0 0 56-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0 0 56-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0c0 35.3 28.7 64 64 64l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40 56 0 0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40 56 0 0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c35.3 0 64-28.7 64-64l40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0 0-56 40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0 0-56 40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0c0-35.3-28.7-64-64-64l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40-56 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40-56 0 0-40zM160 128l192 0c17.7 0 32 14.3 32 32l0 192c0 17.7-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32l0-192c0-17.7 14.3-32 32-32zm192 32l-192 0 0 192 192 0 0-192z"]
};
const faCrown = {
  prefix: 'fas',
  iconName: 'crown',
  icon: [576, 512, [128081], "f521", "M309 106c11.4-7 19-19.7 19-34c0-22.1-17.9-40-40-40s-40 17.9-40 40c0 14.4 7.6 27 19 34L209.7 220.6c-9.1 18.2-32.7 23.4-48.6 10.7L72 160c5-6.7 8-15 8-24c0-22.1-17.9-40-40-40S0 113.9 0 136s17.9 40 40 40c.2 0 .5 0 .7 0L86.4 427.4c5.5 30.4 32 52.6 63 52.6l277.2 0c30.9 0 57.4-22.1 63-52.6L535.3 176c.2 0 .5 0 .7 0c22.1 0 40-17.9 40-40s-17.9-40-40-40s-40 17.9-40 40c0 9 3 17.3 8 24l-89.1 71.3c-15.9 12.7-39.5 7.5-48.6-10.7L309 106z"]
};
const faWeightHanging = {
  prefix: 'fas',
  iconName: 'weight-hanging',
  icon: [512, 512, [], "f5cd", "M224 96a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm122.5 32c3.5-10 5.5-20.8 5.5-32c0-53-43-96-96-96s-96 43-96 96c0 11.2 1.9 22 5.5 32L120 128c-22 0-41.2 15-46.6 36.4l-72 288c-3.6 14.3-.4 29.5 8.7 41.2S33.2 512 48 512l416 0c14.8 0 28.7-6.8 37.8-18.5s12.3-26.8 8.7-41.2l-72-288C433.2 143 414 128 392 128l-45.5 0z"]
};
const faXmarksLines = {
  prefix: 'fas',
  iconName: 'xmarks-lines',
  icon: [640, 512, [], "e59a", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zm0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416zM7 167c-9.4 9.4-9.4 24.6 0 33.9l55 55L7 311c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55L41 167c-9.4-9.4-24.6-9.4-33.9 0zM265 167c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55zM455 167c-9.4 9.4-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55c-9.4-9.4-24.6-9.4-33.9 0z"]
};
const faFilePrescription = {
  prefix: 'fas',
  iconName: 'file-prescription',
  icon: [384, 512, [], "f572", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM104 196l72 0c33.1 0 60 26.9 60 60c0 25.5-15.9 47.2-38.3 55.9l43 40.3 33.8-31c8.1-7.5 20.8-6.9 28.3 1.2s6.9 20.8-1.2 28.3L270 379.7l31.7 29.7c8.1 7.6 8.5 20.2 .9 28.3s-20.2 8.5-28.3 .9l-33.9-31.8-34.9 32c-8.1 7.5-20.8 6.9-28.3-1.2s-6.9-20.8 1.2-28.3l32.6-29.9-64.8-60.8c-.9-.8-1.6-1.7-2.3-2.6l-20 0 0 44c0 11-9 20-20 20s-20-9-20-20l0-64 0-80c0-11 9-20 20-20zm72 80c11 0 20-9 20-20s-9-20-20-20l-52 0 0 40 52 0z"]
};
const faWeightScale = {
  prefix: 'fas',
  iconName: 'weight-scale',
  icon: [512, 512, ["weight"], "f496", "M128 176a128 128 0 1 1 256 0 128 128 0 1 1 -256 0zM391.8 64C359.5 24.9 310.7 0 256 0S152.5 24.9 120.2 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-56.2 0zM296 224c0-10.6-4.1-20.2-10.9-27.4l33.6-78.3c3.5-8.1-.3-17.5-8.4-21s-17.5 .3-21 8.4L255.7 184c-22 .1-39.7 18-39.7 40c0 22.1 17.9 40 40 40s40-17.9 40-40z"]
};
const faWeight = faWeightScale;
const faUserGroup = {
  prefix: 'fas',
  iconName: 'user-group',
  icon: [640, 512, [128101, "user-friends"], "f500", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM609.3 512l-137.8 0c5.4-9.4 8.6-20.3 8.6-32l0-8c0-60.7-27.1-115.2-69.8-151.8c2.4-.1 4.7-.2 7.1-.2l61.4 0C567.8 320 640 392.2 640 481.3c0 17-13.8 30.7-30.7 30.7zM432 256c-31 0-59-12.6-79.3-32.9C372.4 196.5 384 163.6 384 128c0-26.8-6.6-52.1-18.3-74.3C384.3 40.1 407.2 32 432 32c61.9 0 112 50.1 112 112s-50.1 112-112 112z"]
};
const faUserFriends = faUserGroup;
const faArrowUpAZ = {
  prefix: 'fas',
  iconName: 'arrow-up-a-z',
  icon: [576, 512, ["sort-alpha-up"], "f15e", "M183.6 42.4C177.5 35.8 169 32 160 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L128 146.3 128 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 320c0 17.7 14.3 32 32 32l50.7 0-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-50.7 0 73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-128 0c-17.7 0-32 14.3-32 32zM416 32c-12.1 0-23.2 6.8-28.6 17.7l-64 128-16 32c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3 88.4 0 7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9l-16-32-64-128C439.2 38.8 428.1 32 416 32zM395.8 176L416 135.6 436.2 176l-40.4 0z"]
};
const faSortAlphaUp = faArrowUpAZ;
const faChessKnight = {
  prefix: 'fas',
  iconName: 'chess-knight',
  icon: [448, 512, [9822], "f441", "M96 48L82.7 61.3C70.7 73.3 64 89.5 64 106.5l0 132.4c0 10.7 5.3 20.7 14.2 26.6l10.6 7c14.3 9.6 32.7 10.7 48.1 3l3.2-1.6c2.6-1.3 5-2.8 7.3-4.5l49.4-37c6.6-5 15.7-5 22.3 0c10.2 7.7 9.9 23.1-.7 30.3L90.4 350C73.9 361.3 64 380 64 400l320 0 28.9-159c2.1-11.3 3.1-22.8 3.1-34.3l0-14.7C416 86 330 0 224 0L83.8 0C72.9 0 64 8.9 64 19.8c0 7.5 4.2 14.3 10.9 17.7L96 48zm24 68a20 20 0 1 1 40 0 20 20 0 1 1 -40 0zM22.6 473.4c-4.2 4.2-6.6 10-6.6 16C16 501.9 26.1 512 38.6 512l370.7 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L384 432 64 432 22.6 473.4z"]
};
const faFaceLaughSquint = {
  prefix: 'fas',
  iconName: 'face-laugh-squint',
  icon: [512, 512, ["laugh-squint"], "f59b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1l275.2 0c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zm36.7-199.4l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 125.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
};
const faLaughSquint = faFaceLaughSquint;
const faWheelchair = {
  prefix: 'fas',
  iconName: 'wheelchair',
  icon: [512, 512, [], "f193", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM120.5 247.2c12.4-4.7 18.7-18.5 14-30.9s-18.5-18.7-30.9-14C43.1 225.1 0 283.5 0 352c0 88.4 71.6 160 160 160c61.2 0 114.3-34.3 141.2-84.7c6.2-11.7 1.8-26.2-9.9-32.5s-26.2-1.8-32.5 9.9C240 440 202.8 464 160 464C98.1 464 48 413.9 48 352c0-47.9 30.1-88.8 72.5-104.8zM259.8 176l-1.9-9.7c-4.5-22.3-24-38.3-46.8-38.3c-30.1 0-52.7 27.5-46.8 57l23.1 115.5c6 29.9 32.2 51.4 62.8 51.4l5.1 0c.4 0 .8 0 1.3 0l94.1 0c6.7 0 12.6 4.1 15 10.4L402 459.2c6 16.1 23.8 24.6 40.1 19.1l48-16c16.8-5.6 25.8-23.7 20.2-40.5s-23.7-25.8-40.5-20.2l-18.7 6.2-25.5-68c-11.7-31.2-41.6-51.9-74.9-51.9l-68.5 0-9.6-48 63.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-76.2 0z"]
};
const faCircleArrowUp = {
  prefix: 'fas',
  iconName: 'circle-arrow-up',
  icon: [512, 512, ["arrow-circle-up"], "f0aa", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM385 215c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-71-71L280 392c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-214.1-71 71c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 103c9.4-9.4 24.6-9.4 33.9 0L385 215z"]
};
const faArrowCircleUp = faCircleArrowUp;
const faToggleOn = {
  prefix: 'fas',
  iconName: 'toggle-on',
  icon: [576, 512, [], "f205", "M192 64C86 64 0 150 0 256S86 448 192 448l192 0c106 0 192-86 192-192s-86-192-192-192L192 64zm192 96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faPersonWalking = {
  prefix: 'fas',
  iconName: 'person-walking',
  icon: [320, 512, [128694, "walking"], "f554", "M160 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM126.5 199.3c-1 .4-1.9 .8-2.9 1.2l-8 3.5c-16.4 7.3-29 21.2-34.7 38.2l-2.6 7.8c-5.6 16.8-23.7 25.8-40.5 20.2s-25.8-23.7-20.2-40.5l2.6-7.8c11.4-34.1 36.6-61.9 69.4-76.5l8-3.5c20.8-9.2 43.3-14 66.1-14c44.6 0 84.8 26.8 101.9 67.9L281 232.7l21.4 10.7c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3L247 287.3c-10.3-5.2-18.4-13.8-22.8-24.5l-9.6-23-19.3 65.5 49.5 54c5.4 5.9 9.2 13 11.2 20.8l23 92.1c4.3 17.1-6.1 34.5-23.3 38.8s-34.5-6.1-38.8-23.3l-22-88.1-70.7-77.1c-14.8-16.1-20.3-38.6-14.7-59.7l16.9-63.5zM68.7 398l25-62.4c2.1 3 4.5 5.8 7 8.6l40.7 44.4-14.5 36.2c-2.4 6-6 11.5-10.6 16.1L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L68.7 398z"]
};
const faWalking = faPersonWalking;
const faL = {
  prefix: 'fas',
  iconName: 'l',
  icon: [320, 512, [108], "4c", "M64 32c17.7 0 32 14.3 32 32l0 352 192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 480c-17.7 0-32-14.3-32-32L32 64c0-17.7 14.3-32 32-32z"]
};
const faFire = {
  prefix: 'fas',
  iconName: 'fire',
  icon: [448, 512, [128293], "f06d", "M159.3 5.4c7.8-7.3 19.9-7.2 27.7 .1c27.6 25.9 53.5 53.8 77.7 84c11-14.4 23.5-30.1 37-42.9c7.9-7.4 20.1-7.4 28 .1c34.6 33 63.9 76.6 84.5 118c20.3 40.8 33.8 82.5 33.8 111.9C448 404.2 348.2 512 224 512C98.4 512 0 404.1 0 276.5c0-38.4 17.8-85.3 45.4-131.7C73.3 97.7 112.7 48.6 159.3 5.4zM225.7 416c25.3 0 47.7-7 68.8-21c42.1-29.4 53.4-88.2 28.1-134.4c-4.5-9-16-9.6-22.5-2l-25.2 29.3c-6.6 7.6-18.5 7.4-24.7-.5c-16.5-21-46-58.5-62.8-79.8c-6.3-8-18.3-8.1-24.7-.1c-33.8 42.5-50.8 69.3-50.8 99.4C112 375.4 162.6 416 225.7 416z"]
};
const faBedPulse = {
  prefix: 'fas',
  iconName: 'bed-pulse',
  icon: [640, 512, ["procedures"], "f487", "M483.2 9.6L524 64l92 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-104 0c-7.6 0-14.7-3.6-19.2-9.6L468.7 70.3l-47 99.9c-3.7 7.8-11.3 13.1-19.9 13.7s-16.9-3.4-21.7-10.6L339.2 112 216 112c-13.3 0-24-10.7-24-24s10.7-24 24-24l136 0c8 0 15.5 4 20 10.7l24.4 36.6 45.9-97.5C445.9 6.2 453.2 1 461.6 .1s16.6 2.7 21.6 9.5zM320 160l12.7 0 20.7 31.1c11.2 16.8 30.6 26.3 50.7 24.8s37.9-13.7 46.5-32L461.9 160l82.1 0c53 0 96 43 96 96l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-224 0-32 0L64 448l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 96C0 78.3 14.3 64 32 64s32 14.3 32 32l0 256 224 0 0-160c0-17.7 14.3-32 32-32zm-144 0a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faProcedures = faBedPulse;
const faShuttleSpace = {
  prefix: 'fas',
  iconName: 'shuttle-space',
  icon: [640, 512, ["space-shuttle"], "f197", "M130 480c40.6 0 80.4-11 115.2-31.9L352 384l-224 0 0 96 2 0zM352 128L245.2 63.9C210.4 43 170.6 32 130 32l-2 0 0 96 224 0zM96 128l0-96L80 32C53.5 32 32 53.5 32 80l0 48 8 0c-22.1 0-40 17.9-40 40l0 16L0 328l0 16c0 22.1 17.9 40 40 40l-8 0 0 48c0 26.5 21.5 48 48 48l16 0 0-96 8 0c26.2 0 49.4-12.6 64-32l288 0c69.3 0 135-22.7 179.2-81.6c6.4-8.5 6.4-20.3 0-28.8C591 182.7 525.3 160 456 160l-288 0c-14.6-19.4-37.8-32-64-32l-8 0zM512 243.6l0 24.9c0 19.6-15.9 35.6-35.6 35.6c-2.5 0-4.4-2-4.4-4.4l0-87.1c0-2.5 2-4.4 4.4-4.4c19.6 0 35.6 15.9 35.6 35.6z"]
};
const faSpaceShuttle = faShuttleSpace;
const faFaceLaugh = {
  prefix: 'fas',
  iconName: 'face-laugh',
  icon: [512, 512, ["laugh"], "f599", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1l275.2 0c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zM144.4 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faLaugh = faFaceLaugh;
const faFolderOpen = {
  prefix: 'fas',
  iconName: 'folder-open',
  icon: [576, 512, [128194, 128449, 61717], "f07c", "M88.7 223.8L0 375.8 0 96C0 60.7 28.7 32 64 32l117.5 0c17 0 33.3 6.7 45.3 18.7l26.5 26.5c12 12 28.3 18.7 45.3 18.7L416 96c35.3 0 64 28.7 64 64l0 32-336 0c-22.8 0-43.8 12.1-55.3 31.8zm27.6 16.1C122.1 230 132.6 224 144 224l400 0c11.5 0 22 6.1 27.7 16.1s5.7 22.2-.1 32.1l-112 192C453.9 474 443.4 480 432 480L32 480c-11.5 0-22-6.1-27.7-16.1s-5.7-22.2 .1-32.1l112-192z"]
};
const faHeartCirclePlus = {
  prefix: 'fas',
  iconName: 'heart-circle-plus',
  icon: [576, 512, [], "e500", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm16-208l0 48 48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l48 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faCodeFork = {
  prefix: 'fas',
  iconName: 'code-fork',
  icon: [448, 512, [], "e13b", "M80 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm80-24c0 32.8-19.7 61-48 73.3l0 38.7c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-38.7C307.7 141 288 112.8 288 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3l0 38.7c0 53-43 96-96 96l-48 0 0 70.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3l0-70.7-48 0c-53 0-96-43-96-96l0-38.7C19.7 141 0 112.8 0 80C0 35.8 35.8 0 80 0s80 35.8 80 80zm208 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM248 432a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faCity = {
  prefix: 'fas',
  iconName: 'city',
  icon: [640, 512, [127961], "f64f", "M480 48c0-26.5-21.5-48-48-48L336 0c-26.5 0-48 21.5-48 48l0 48-64 0 0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-64 0 0-72c0-13.3-10.7-24-24-24S64 10.7 64 24l0 72L48 96C21.5 96 0 117.5 0 144l0 96L0 464c0 26.5 21.5 48 48 48l256 0 32 0 96 0 160 0c26.5 0 48-21.5 48-48l0-224c0-26.5-21.5-48-48-48l-112 0 0-144zm96 320l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zM240 416l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16zM128 400c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32zM560 256c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0zM256 176l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zM112 160c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0zM256 304c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32zM112 320l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16zm304-48l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zM400 64c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0zm16 112l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16z"]
};
const faMicrophoneLines = {
  prefix: 'fas',
  iconName: 'microphone-lines',
  icon: [384, 512, [127897, "microphone-alt"], "f3c9", "M96 96l0 160c0 53 43 96 96 96s96-43 96-96l-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-32-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-32-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0c0-53-43-96-96-96S96 43 96 96zM320 240l0 16c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24z"]
};
const faMicrophoneAlt = faMicrophoneLines;
const faPepperHot = {
  prefix: 'fas',
  iconName: 'pepper-hot',
  icon: [512, 512, [127798], "f816", "M428.3 3c11.6-6.4 26.2-2.3 32.6 9.3l4.8 8.7c19.3 34.7 19.8 75.7 3.4 110C495.8 159.6 512 197.9 512 240c0 18.5-3.1 36.3-8.9 52.8c-6.1 17.3-28.5 16.3-36.8-.1l-11.7-23.4c-4.1-8.1-12.4-13.3-21.5-13.3L360 256c-13.3 0-24-10.7-24-24l0-80c0-13.3-10.7-24-24-24l-17.1 0c-21.3 0-30-23.9-10.8-32.9C304.7 85.4 327.7 80 352 80c28.3 0 54.8 7.3 77.8 20.2c5.5-18.2 3.7-38.4-6-55.8L419 35.7c-6.4-11.6-2.3-26.2 9.3-32.6zM171.2 345.5L264 160l40 0 0 80c0 26.5 21.5 48 48 48l76.2 0 23.9 47.8C372.3 443.9 244.3 512 103.2 512l-58.8 0C19.9 512 0 492.1 0 467.6c0-20.8 14.5-38.8 34.8-43.3l49.8-11.1c37.6-8.4 69.5-33.2 86.7-67.7z"]
};
const faUnlock = {
  prefix: 'fas',
  iconName: 'unlock',
  icon: [448, 512, [128275], "f09c", "M144 144c0-44.2 35.8-80 80-80c31.9 0 59.4 18.6 72.3 45.7c7.6 16 26.7 22.8 42.6 15.2s22.8-26.7 15.2-42.6C331 33.7 281.5 0 224 0C144.5 0 80 64.5 80 144l0 48-16 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-240 0 0-48z"]
};
const faColonSign = {
  prefix: 'fas',
  iconName: 'colon-sign',
  icon: [384, 512, [], "e140", "M255 39.8c4.3-17.1-6.1-34.5-23.3-38.8S197.2 7.1 193 24.2L181.9 68.6C96.1 87.8 32 164.4 32 256c0 58.1 25.8 110.2 66.7 145.4L81 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l13-52.1c9 3.4 18.4 6.2 28 8.2L177 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l10.4-41.4c33.4-4.4 64.1-17.4 89.8-36.7c14.1-10.6 17-30.7 6.4-44.8s-30.7-17-44.8-6.4c-10.2 7.7-21.7 13.9-34 18.3L321 160c9.4-.3 18.5-4.7 24.6-12.8c10.6-14.1 7.8-34.2-6.4-44.8c-1.1-.8-2.2-1.6-3.3-2.4L351 39.8c4.3-17.1-6.1-34.5-23.3-38.8S293.2 7.1 289 24.2L277.2 71.5c-9.3-2.7-18.8-4.6-28.6-5.9L255 39.8zM163.2 143.3L117.3 326.8C103.9 306.5 96 282.2 96 256c0-48.7 27.2-91 67.2-112.7zm8.6 229.5l61.1-244.6c9.9 .7 19.5 2.5 28.7 5.3l-62 248.1c-9.7-1.9-19-4.8-27.8-8.8z"]
};
const faHeadset = {
  prefix: 'fas',
  iconName: 'headset',
  icon: [512, 512, [], "f590", "M256 48C141.1 48 48 141.1 48 256l0 40c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-40C0 114.6 114.6 0 256 0S512 114.6 512 256l0 144.1c0 48.6-39.4 88-88.1 88L313.6 488c-8.3 14.3-23.8 24-41.6 24l-32 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l32 0c17.8 0 33.3 9.7 41.6 24l110.4 .1c22.1 0 40-17.9 40-40L464 256c0-114.9-93.1-208-208-208zM144 208l16 0c17.7 0 32 14.3 32 32l0 112c0 17.7-14.3 32-32 32l-16 0c-35.3 0-64-28.7-64-64l0-48c0-35.3 28.7-64 64-64zm224 0c35.3 0 64 28.7 64 64l0 48c0 35.3-28.7 64-64 64l-16 0c-17.7 0-32-14.3-32-32l0-112c0-17.7 14.3-32 32-32l16 0z"]
};
const faStoreSlash = {
  prefix: 'fas',
  iconName: 'store-slash',
  icon: [640, 512, [], "e071", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-86.8-68 0-17.1 0-131.4c-4 1-8 1.8-12.3 2.3c0 0 0 0-.1 0c-5.3 .7-10.7 1.1-16.2 1.1c-12.4 0-24.3-1.9-35.4-5.3l0 100.3L301.2 210.7c7-4.4 13.3-9.7 18.8-15.7c15.9 17.6 39.1 29 65.2 29c26.2 0 49.3-11.4 65.2-29c16 17.6 39.1 29 65.2 29c4.1 0 8.1-.3 12.1-.8c55.5-7.4 81.8-72.5 52.1-119.4L522.3 13.1C517.2 5 508.1 0 498.4 0L141.6 0c-9.7 0-18.8 5-23.9 13.1l-22.7 36L38.8 5.1zm73.4 218.1c4 .5 8.1 .8 12.1 .8c11 0 21.4-2 31-5.6L48.9 134.5c-6.1 40.6 19.5 82.8 63.3 88.7zM160 384l0-133.4c-11.2 3.5-23.2 5.4-35.6 5.4c-5.5 0-11-.4-16.3-1.1l-.1 0c-4.1-.6-8.1-1.3-12-2.3L96 384l0 64c0 35.3 28.7 64 64 64l320 0c12.9 0 24.8-3.8 34.9-10.3L365.5 384 160 384z"]
};
const faRoadCircleXmark = {
  prefix: 'fas',
  iconName: 'road-circle-xmark',
  icon: [640, 512, [], "e566", "M213.2 32L288 32l0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 74.8 0c27.1 0 51.3 17.1 60.3 42.6l42.7 120.6c-10.9-2.1-22.2-3.2-33.8-3.2c-59.5 0-112.1 29.6-144 74.8l0-42.8c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32c2.3 0 4.6-.3 6.8-.7c-4.5 15.5-6.8 31.8-6.8 48.7c0 5.4 .2 10.7 .7 16l-.7 0c-17.7 0-32 14.3-32 32l0 64L86.6 480C56.5 480 32 455.5 32 425.4c0-6.2 1.1-12.4 3.1-18.2L152.9 74.6C162 49.1 186.1 32 213.2 32zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm22.6 144l36.7-36.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L496 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L473.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L496 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L518.6 368z"]
};
const faUserMinus = {
  prefix: 'fas',
  iconName: 'user-minus',
  icon: [640, 512, [], "f503", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM472 200l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faMarsStrokeUp = {
  prefix: 'fas',
  iconName: 'mars-stroke-up',
  icon: [320, 512, [9896, "mars-stroke-v"], "f22a", "M148.7 4.7c6.2-6.2 16.4-6.2 22.6 0l64 64c4.6 4.6 5.9 11.5 3.5 17.4s-8.3 9.9-14.8 9.9l-40 0 0 24 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 24c0 .6 0 1.2-.1 1.8c77 11.6 136.1 78 136.1 158.2c0 88.4-71.6 160-160 160S0 440.4 0 352c0-80.2 59.1-146.7 136.1-158.2c0-.6-.1-1.2-.1-1.8l0-24-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-24L96 96c-6.5 0-12.3-3.9-14.8-9.9s-1.1-12.9 3.5-17.4l64-64zM256 352A96 96 0 1 0 64 352a96 96 0 1 0 192 0z"]
};
const faMarsStrokeV = faMarsStrokeUp;
const faChampagneGlasses = {
  prefix: 'fas',
  iconName: 'champagne-glasses',
  icon: [640, 512, [129346, "glass-cheers"], "f79f", "M155.6 17.3C163 3 179.9-3.6 195 1.9L320 47.5l125-45.6c15.1-5.5 32 1.1 39.4 15.4l78.8 152.9c28.8 55.8 10.3 122.3-38.5 156.6L556.1 413l41-15c16.6-6 35 2.5 41 19.1s-2.5 35-19.1 41l-71.1 25.9L476.8 510c-16.6 6.1-35-2.5-41-19.1s2.5-35 19.1-41l41-15-31.3-86.2c-59.4 5.2-116.2-34-130-95.2L320 188.8l-14.6 64.7c-13.8 61.3-70.6 100.4-130 95.2l-31.3 86.2 41 15c16.6 6 25.2 24.4 19.1 41s-24.4 25.2-41 19.1L92.2 484.1 21.1 458.2c-16.6-6.1-25.2-24.4-19.1-41s24.4-25.2 41-19.1l41 15 31.3-86.2C66.5 292.5 48.1 226 76.9 170.2L155.6 17.3zm44 54.4l-27.2 52.8L261.6 157l13.1-57.9L199.6 71.7zm240.9 0L365.4 99.1 378.5 157l89.2-32.5L440.5 71.7z"]
};
const faGlassCheers = faChampagneGlasses;
const faClipboard = {
  prefix: 'fas',
  iconName: 'clipboard',
  icon: [384, 512, [128203], "f328", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM112 192l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faHouseCircleExclamation = {
  prefix: 'fas',
  iconName: 'house-circle-exclamation',
  icon: [640, 512, [], "e50a", "M320.7 352c8.1-89.7 83.5-160 175.3-160c8.9 0 17.6 .7 26.1 1.9L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 69.7c-.1 .9-.1 1.8-.1 2.8l0 112c0 22.1 17.9 40 40 40l16 0c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2l31.9 0 24 0c22.1 0 40-17.9 40-40l0-24 0-64c0-17.7 14.3-32 32-32l64 0 .7 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faFileArrowUp = {
  prefix: 'fas',
  iconName: 'file-arrow-up',
  icon: [384, 512, ["file-upload"], "f574", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM216 408c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-102.1-31 31c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l72-72c9.4-9.4 24.6-9.4 33.9 0l72 72c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-31-31L216 408z"]
};
const faFileUpload = faFileArrowUp;
const faWifi = {
  prefix: 'fas',
  iconName: 'wifi',
  icon: [640, 512, ["wifi-3", "wifi-strong"], "f1eb", "M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faWifi3 = faWifi;
const faWifiStrong = faWifi;
const faBath = {
  prefix: 'fas',
  iconName: 'bath',
  icon: [512, 512, [128705, "bathtub"], "f2cd", "M96 77.3c0-7.3 5.9-13.3 13.3-13.3c3.5 0 6.9 1.4 9.4 3.9l14.9 14.9C130 91.8 128 101.7 128 112c0 19.9 7.2 38 19.2 52c-5.3 9.2-4 21.1 3.8 29c9.4 9.4 24.6 9.4 33.9 0L289 89c9.4-9.4 9.4-24.6 0-33.9c-7.9-7.9-19.8-9.1-29-3.8C246 39.2 227.9 32 208 32c-10.3 0-20.2 2-29.2 5.5L163.9 22.6C149.4 8.1 129.7 0 109.3 0C66.6 0 32 34.6 32 77.3L32 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 256 96 77.3zM32 352l0 16c0 28.4 12.4 54 32 71.6L64 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-16 256 0 0 16c0 17.7 14.3 32 32 32s32-14.3 32-32l0-40.4c19.6-17.6 32-43.1 32-71.6l0-16L32 352z"]
};
const faBathtub = faBath;
const faUnderline = {
  prefix: 'fas',
  iconName: 'underline',
  icon: [448, 512, [], "f0cd", "M16 64c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 53 43 96 96 96s96-43 96-96l0-128-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 88.4-71.6 160-160 160s-160-71.6-160-160L64 96 48 96C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32z"]
};
const faUserPen = {
  prefix: 'fas',
  iconName: 'user-pen',
  icon: [640, 512, ["user-edit"], "f4ff", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l293.1 0c-3.1-8.8-3.7-18.4-1.4-27.8l15-60.1c2.8-11.3 8.6-21.5 16.8-29.7l40.3-40.3c-32.1-31-75.7-50.1-123.9-50.1l-91.4 0zm435.5-68.3c-15.6-15.6-40.9-15.6-56.6 0l-29.4 29.4 71 71 29.4-29.4c15.6-15.6 15.6-40.9 0-56.6l-14.4-14.4zM375.9 417c-4.1 4.1-7 9.2-8.4 14.9l-15 60.1c-1.4 5.5 .2 11.2 4.2 15.2s9.7 5.6 15.2 4.2l60.1-15c5.6-1.4 10.8-4.3 14.9-8.4L576.1 358.7l-71-71L375.9 417z"]
};
const faUserEdit = faUserPen;
const faSignature = {
  prefix: 'fas',
  iconName: 'signature',
  icon: [640, 512, [], "f5b7", "M192 128c0-17.7 14.3-32 32-32s32 14.3 32 32l0 7.8c0 27.7-2.4 55.3-7.1 82.5l-84.4 25.3c-40.6 12.2-68.4 49.6-68.4 92l0 71.9c0 40 32.5 72.5 72.5 72.5c26 0 50-13.9 62.9-36.5l13.9-24.3c26.8-47 46.5-97.7 58.4-150.5l94.4-28.3-12.5 37.5c-3.3 9.8-1.6 20.5 4.4 28.8s15.7 13.3 26 13.3l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-83.6 0 18-53.9c3.8-11.3 .9-23.8-7.4-32.4s-20.7-11.8-32.2-8.4L316.4 198.1c2.4-20.7 3.6-41.4 3.6-62.3l0-7.8c0-53-43-96-96-96s-96 43-96 96l0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32zm-9.2 177l49-14.7c-10.4 33.8-24.5 66.4-42.1 97.2l-13.9 24.3c-1.5 2.6-4.3 4.3-7.4 4.3c-4.7 0-8.5-3.8-8.5-8.5l0-71.9c0-14.1 9.3-26.6 22.8-30.7zM24 368c-13.3 0-24 10.7-24 24s10.7 24 24 24l40.3 0c-.2-2.8-.3-5.6-.3-8.5L64 368l-40 0zm592 48c13.3 0 24-10.7 24-24s-10.7-24-24-24l-310.1 0c-6.7 16.3-14.2 32.3-22.3 48L616 416z"]
};
const faStroopwafel = {
  prefix: 'fas',
  iconName: 'stroopwafel',
  icon: [512, 512, [], "f551", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM312.6 63.7c-6.2-6.2-16.4-6.2-22.6 0L256 97.6 222.1 63.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l33.9 33.9-45.3 45.3-56.6-56.6c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l56.6 56.6-45.3 45.3L86.3 199.4c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L97.6 256 63.7 289.9c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l33.9-33.9 45.3 45.3-56.6 56.6c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l56.6-56.6 45.3 45.3-33.9 33.9c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L256 414.4l33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-33.9-33.9 45.3-45.3 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 45.3-45.3 33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L414.4 256l33.9-33.9c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-33.9 33.9-45.3-45.3 56.6-56.6c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-56.6 56.6-45.3-45.3 33.9-33.9c6.2-6.2 6.2-16.4 0-22.6zM142.9 256l45.3-45.3L233.4 256l-45.3 45.3L142.9 256zm67.9 67.9L256 278.6l45.3 45.3L256 369.1l-45.3-45.3zM278.6 256l45.3-45.3L369.1 256l-45.3 45.3L278.6 256zm22.6-67.9L256 233.4l-45.3-45.3L256 142.9l45.3 45.3z"]
};
const faBold = {
  prefix: 'fas',
  iconName: 'bold',
  icon: [384, 512, [], "f032", "M0 64C0 46.3 14.3 32 32 32l48 0 16 0 128 0c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128L96 480l-16 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-160L48 96 32 96C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64L112 96l0 128 112 0zM112 288l0 128 144 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-112 0z"]
};
const faAnchorLock = {
  prefix: 'fas',
  iconName: 'anchor-lock',
  icon: [640, 512, [], "e4ad", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c8 0 15.9-.6 23.6-1.7c-4.8-9-7.6-19.3-7.6-30.3l0-33.3c-5.2 .9-10.5 1.3-16 1.3l-48 0 0-208 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0zM528 240c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faBuildingNgo = {
  prefix: 'fas',
  iconName: 'building-ngo',
  icon: [384, 512, [], "e4d7", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c26.5 0 48-21.5 48-48l0-416c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM168 64l48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 64 16 0 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 24c0 13.3-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24l0-88c0-8.8 7.2-16 16-16zM304 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16s16-7.2 16-16l0-32c0-8.8-7.2-16-16-16zm-48 16c0-26.5 21.5-48 48-48s48 21.5 48 48l0 32c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-32zM61.3 71.1l34.7 52L96 80c0-8.8 7.2-16 16-16s16 7.2 16 16l0 96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4L64 132.8 64 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4z"]
};
const faManatSign = {
  prefix: 'fas',
  iconName: 'manat-sign',
  icon: [384, 512, [], "e1d5", "M192 32c-17.7 0-32 14.3-32 32l0 34.7C69.2 113.9 0 192.9 0 288L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-59.6 40.8-109.8 96-124l0 284c0 17.7 14.3 32 32 32s32-14.3 32-32l0-284c55.2 14.2 96 64.3 96 124l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-95.1-69.2-174.1-160-189.3L224 64c0-17.7-14.3-32-32-32z"]
};
const faNotEqual = {
  prefix: 'fas',
  iconName: 'not-equal',
  icon: [448, 512, [], "f53e", "M369.8 37.4c14.7 9.8 18.7 29.7 8.9 44.4L337.1 144l62.9 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-105.5 0-64 96L400 304c17.7 0 32 14.3 32 32s-14.3 32-32 32l-212.2 0-65.2 97.7c-9.8 14.7-29.7 18.7-44.4 8.9s-18.7-29.7-8.9-44.4L110.9 368 48 368c-17.7 0-32-14.3-32-32s14.3-32 32-32l105.5 0 64-96L48 208c-17.7 0-32-14.3-32-32s14.3-32 32-32l212.2 0 65.2-97.7c9.8-14.7 29.7-18.7 44.4-8.9z"]
};
const faBorderTopLeft = {
  prefix: 'fas',
  iconName: 'border-top-left',
  icon: [448, 512, ["border-style"], "f853", "M0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-336c0-8.8 7.2-16 16-16l336 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32C35.8 32 0 67.8 0 112L0 448zm160 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm192 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm-96 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm192 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm0 32a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faBorderStyle = faBorderTopLeft;
const faMapLocationDot = {
  prefix: 'fas',
  iconName: 'map-location-dot',
  icon: [576, 512, ["map-marked-alt"], "f5a0", "M408 120c0 54.6-73.1 151.9-105.2 192c-7.7 9.6-22 9.6-29.6 0C241.1 271.9 168 174.6 168 120C168 53.7 221.7 0 288 0s120 53.7 120 120zm8 80.4c3.5-6.9 6.7-13.8 9.6-20.6c.5-1.2 1-2.5 1.5-3.7l116-46.4C558.9 123.4 576 135 576 152l0 270.8c0 9.8-6 18.6-15.1 22.3L416 503l0-302.6zM137.6 138.3c2.4 14.1 7.2 28.3 12.8 41.5c2.9 6.8 6.1 13.7 9.6 20.6l0 251.4L32.9 502.7C17.1 509 0 497.4 0 480.4L0 209.6c0-9.8 6-18.6 15.1-22.3l122.6-49zM327.8 332c13.9-17.4 35.7-45.7 56.2-77l0 249.3L192 449.4 192 255c20.5 31.3 42.3 59.6 56.2 77c20.5 25.6 59.1 25.6 79.6 0zM288 152a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faMapMarkedAlt = faMapLocationDot;
const faJedi = {
  prefix: 'fas',
  iconName: 'jedi',
  icon: [576, 512, [], "f669", "M246 315.7l-21.2-31.9c-2.1-3.2-1.7-7.4 1-10.1s6.9-3.1 10.1-1l29.5 19.7c2.1 1.4 4.9 0 5-2.6L279.7 8c.1-4.5 3.8-8 8.3-8s8.1 3.5 8.3 8l9.4 281.9c.1 2.5 2.9 3.9 5 2.6l29.5-19.7c3.2-2.1 7.4-1.7 10.1 1s3.1 6.9 1 10.1L330 315.7c-1.3 1.9-.2 4.5 2 4.9l37.6 7.5c3.7 .7 6.4 4 6.4 7.8s-2.7 7.1-6.4 7.8L332 351.4c-2.2 .4-3.3 3-2 4.9l21.2 31.9c2.1 3.2 1.7 7.4-1 10.1s-6.9 3.1-10.1 1l-26.3-17.6c-2.2-1.4-5.1 .2-5 2.8l2.1 61.5C370.6 435.2 416 382.9 416 320c0-37-15.7-70.4-40.8-93.7c-7-6.5-6.5-18.6 1-24.4C410.1 175.5 432 134.3 432 88c0-16.8-2.9-33-8.2-48c-4.6-13 10.2-30 21.4-22c53.5 38 92.7 94.8 107.8 160.7c.5 2.1-.2 4.3-1.7 5.9l-28.4 28.4c-4 4-1.2 10.9 4.5 10.9l26 0c3.4 0 6.2 2.6 6.3 6c.1 3.3 .2 6.6 .2 10c0 17.5-1.7 34.7-4.8 51.3c-.2 1.2-.9 2.4-1.7 3.3l-46.5 46.5c-4 4-1.2 10.9 4.5 10.9l14.6 0c4.6 0 7.7 4.8 5.7 9C487.2 450.5 394.8 512 288 512S88.8 450.5 44.3 361c-2.1-4.2 1-9 5.7-9l14.6 0c5.7 0 8.6-6.9 4.5-10.9L22.6 294.6c-.9-.9-1.5-2-1.7-3.3C17.7 274.7 16 257.5 16 240c0-3.3 .1-6.7 .2-10c.1-3.4 2.9-6 6.3-6l26 0c5.7 0 8.6-6.9 4.5-10.9L24.6 184.6c-1.5-1.5-2.2-3.8-1.7-5.9C38.1 112.8 77.3 56 130.8 18c11.3-8 26 8.9 21.4 22c-5.3 15-8.2 31.2-8.2 48c0 46.3 21.9 87.5 55.8 113.9c7.5 5.8 8 17.9 1 24.4C175.7 249.6 160 283 160 320c0 62.9 45.4 115.2 105.1 126l2.1-61.5c.1-2.6-2.8-4.2-5-2.8l-26.3 17.6c-3.2 2.1-7.4 1.7-10.1-1s-3.1-6.9-1-10.1L246 356.3c1.3-1.9 .2-4.5-2-4.9l-37.6-7.5c-3.7-.7-6.4-4-6.4-7.8s2.7-7.1 6.4-7.8l37.6-7.5c2.2-.4 3.3-3 2-4.9z"]
};
const faSquarePollVertical = {
  prefix: 'fas',
  iconName: 'square-poll-vertical',
  icon: [448, 512, ["poll"], "f681", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 192c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32zm64-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 192c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-192zM320 288c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32z"]
};
const faPoll = faSquarePollVertical;
const faMugHot = {
  prefix: 'fas',
  iconName: 'mug-hot',
  icon: [512, 512, [9749], "f7b6", "M88 0C74.7 0 64 10.7 64 24c0 38.9 23.4 59.4 39.1 73.1l1.1 1C120.5 112.3 128 119.9 128 136c0 13.3 10.7 24 24 24s24-10.7 24-24c0-38.9-23.4-59.4-39.1-73.1l-1.1-1C119.5 47.7 112 40.1 112 24c0-13.3-10.7-24-24-24zM32 192c-17.7 0-32 14.3-32 32L0 416c0 53 43 96 96 96l192 0c53 0 96-43 96-96l16 0c61.9 0 112-50.1 112-112s-50.1-112-112-112l-48 0L32 192zm352 64l16 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-16 0 0-96zM224 24c0-13.3-10.7-24-24-24s-24 10.7-24 24c0 38.9 23.4 59.4 39.1 73.1l1.1 1C232.5 112.3 240 119.9 240 136c0 13.3 10.7 24 24 24s24-10.7 24-24c0-38.9-23.4-59.4-39.1-73.1l-1.1-1C231.5 47.7 224 40.1 224 24z"]
};
const faCarBattery = {
  prefix: 'fas',
  iconName: 'car-battery',
  icon: [512, 512, ["battery-car"], "f5df", "M80 96c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l96 0c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l16 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 160c0-35.3 28.7-64 64-64l16 0zm304 96c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 32-32 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0 0 32c0 8.8 7.2 16 16 16s16-7.2 16-16l0-32 32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0-32zM80 240c0 8.8 7.2 16 16 16l96 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-96 0c-8.8 0-16 7.2-16 16z"]
};
const faBatteryCar = faCarBattery;
const faGift = {
  prefix: 'fas',
  iconName: 'gift',
  icon: [512, 512, [127873], "f06b", "M190.5 68.8L225.3 128l-1.3 0-72 0c-22.1 0-40-17.9-40-40s17.9-40 40-40l2.2 0c14.9 0 28.8 7.9 36.3 20.8zM64 88c0 14.4 3.5 28 9.6 40L32 128c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l448 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-41.6 0c6.1-12 9.6-25.6 9.6-40c0-48.6-39.4-88-88-88l-2.2 0c-31.9 0-61.5 16.9-77.7 44.4L256 85.5l-24.1-41C215.7 16.9 186.1 0 154.2 0L152 0C103.4 0 64 39.4 64 88zm336 0c0 22.1-17.9 40-40 40l-72 0-1.3 0 34.8-59.2C329.1 55.9 342.9 48 357.8 48l2.2 0c22.1 0 40 17.9 40 40zM32 288l0 176c0 26.5 21.5 48 48 48l144 0 0-224L32 288zM288 512l144 0c26.5 0 48-21.5 48-48l0-176-192 0 0 224z"]
};
const faDiceTwo = {
  prefix: 'fas',
  iconName: 'dice-two',
  icon: [448, 512, [9857], "f528", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM352 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faChessQueen = {
  prefix: 'fas',
  iconName: 'chess-queen',
  icon: [512, 512, [9819], "f445", "M256 0a56 56 0 1 1 0 112A56 56 0 1 1 256 0zM134.1 143.8c3.3-13 15-23.8 30.2-23.8c12.3 0 22.6 7.2 27.7 17c12 23.2 36.2 39 64 39s52-15.8 64-39c5.1-9.8 15.4-17 27.7-17c15.3 0 27 10.8 30.2 23.8c7 27.8 32.2 48.3 62.1 48.3c10.8 0 21-2.7 29.8-7.4c8.4-4.4 18.9-4.5 27.6 .9c13 8 17.1 25 9.2 38L399.7 400 384 400l-40.4 0-175.1 0L128 400l-15.7 0L5.4 223.6c-7.9-13-3.8-30 9.2-38c8.7-5.3 19.2-5.3 27.6-.9c8.9 4.7 19 7.4 29.8 7.4c29.9 0 55.1-20.5 62.1-48.3zM256 224s0 0 0 0s0 0 0 0s0 0 0 0zM112 432l288 0 41.4 41.4c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6L86.6 512C74.1 512 64 501.9 64 489.4c0-6 2.4-11.8 6.6-16L112 432z"]
};
const faGlasses = {
  prefix: 'fas',
  iconName: 'glasses',
  icon: [576, 512, [], "f530", "M118.6 80c-11.5 0-21.4 7.9-24 19.1L57 260.3c20.5-6.2 48.3-12.3 78.7-12.3c32.3 0 61.8 6.9 82.8 13.5c10.6 3.3 19.3 6.7 25.4 9.2c3.1 1.3 5.5 2.4 7.3 3.2c.9 .4 1.6 .7 2.1 1l.6 .3 .2 .1c0 0 .1 0 .1 0c0 0 0 0 0 0s0 0 0 0L247.9 288s0 0 0 0l6.3-12.7c5.8 2.9 10.4 7.3 13.5 12.7l40.6 0c3.1-5.3 7.7-9.8 13.5-12.7l6.3 12.7s0 0 0 0c-6.3-12.7-6.3-12.7-6.3-12.7s0 0 0 0s0 0 0 0c0 0 .1 0 .1 0l.2-.1 .6-.3c.5-.2 1.2-.6 2.1-1c1.8-.8 4.2-1.9 7.3-3.2c6.1-2.6 14.8-5.9 25.4-9.2c21-6.6 50.4-13.5 82.8-13.5c30.4 0 58.2 6.1 78.7 12.3L481.4 99.1c-2.6-11.2-12.6-19.1-24-19.1c-3.1 0-6.2 .6-9.2 1.8L416.9 94.3c-12.3 4.9-26.3-1.1-31.2-13.4s1.1-26.3 13.4-31.2l31.3-12.5c8.6-3.4 17.7-5.2 27-5.2c33.8 0 63.1 23.3 70.8 56.2l43.9 188c1.7 7.3 2.9 14.7 3.5 22.1c.3 1.9 .5 3.8 .5 5.7l0 6.7 0 41.3 0 16c0 61.9-50.1 112-112 112l-44.3 0c-59.4 0-108.5-46.4-111.8-105.8L306.6 352l-37.2 0-1.2 22.2C264.9 433.6 215.8 480 156.3 480L112 480C50.1 480 0 429.9 0 368l0-16 0-41.3L0 304c0-1.9 .2-3.8 .5-5.7c.6-7.4 1.8-14.8 3.5-22.1l43.9-188C55.5 55.3 84.8 32 118.6 32c9.2 0 18.4 1.8 27 5.2l31.3 12.5c12.3 4.9 18.3 18.9 13.4 31.2s-18.9 18.3-31.2 13.4L127.8 81.8c-2.9-1.2-6-1.8-9.2-1.8zM64 325.4L64 368c0 26.5 21.5 48 48 48l44.3 0c25.5 0 46.5-19.9 47.9-45.3l2.5-45.6c-2.3-.8-4.9-1.7-7.5-2.5c-17.2-5.4-39.9-10.5-63.6-10.5c-23.7 0-46.2 5.1-63.2 10.5c-3.1 1-5.9 1.9-8.5 2.9zM512 368l0-42.6c-2.6-.9-5.5-1.9-8.5-2.9c-17-5.4-39.5-10.5-63.2-10.5c-23.7 0-46.4 5.1-63.6 10.5c-2.7 .8-5.2 1.7-7.5 2.5l2.5 45.6c1.4 25.4 22.5 45.3 47.9 45.3l44.3 0c26.5 0 48-21.5 48-48z"]
};
const faChessBoard = {
  prefix: 'fas',
  iconName: 'chess-board',
  icon: [448, 512, [], "f43c", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 64l0 64 64 0 0-64 64 0 0 64 64 0 0-64 64 0 0 64-64 0 0 64 64 0 0 64-64 0 0 64 64 0 0 64-64 0 0-64-64 0 0 64-64 0 0-64-64 0 0 64-64 0 0-64 64 0 0-64-64 0 0-64 64 0 0-64-64 0 0-64 64 0zm64 128l64 0 0-64-64 0 0 64zm0 64l0-64-64 0 0 64 64 0zm64 0l-64 0 0 64 64 0 0-64zm0 0l64 0 0-64-64 0 0 64z"]
};
const faBuildingCircleCheck = {
  prefix: 'fas',
  iconName: 'building-circle-check',
  icon: [640, 512, [], "e4d2", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c15.1 0 28.5-6.9 37.3-17.8C340.4 462.2 320 417.5 320 368c0-54.7 24.9-103.5 64-135.8L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faPersonChalkboard = {
  prefix: 'fas',
  iconName: 'person-chalkboard',
  icon: [640, 512, [], "e53d", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 384l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-288 56 0 64 0 16 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-64 192 0 0 192-192 0 0-32-64 0 0 48c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-224c0-26.5-21.5-48-48-48L368 0c-26.5 0-48 21.5-48 48l0 80-76.9 0-65.9 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9 120 480c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
};
const faMarsStrokeRight = {
  prefix: 'fas',
  iconName: 'mars-stroke-right',
  icon: [640, 512, [9897, "mars-stroke-h"], "f22b", "M208 368a112 112 0 1 0 0-224 112 112 0 1 0 0 224zm174.4-88C370.7 365.8 297.1 432 208 432c-97.2 0-176-78.8-176-176s78.8-176 176-176c89.1 0 162.7 66.2 174.4 152l33.6 0 0-56c0-13.3 10.7-24 24-24s24 10.7 24 24l0 56 32 0 0-56c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l80 80c9.4 9.4 9.4 24.6 0 33.9l-80 80c-6.9 6.9-17.2 8.9-26.2 5.2s-14.8-12.5-14.8-22.2l0-56-32 0 0 56c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-56-33.6 0z"]
};
const faMarsStrokeH = faMarsStrokeRight;
const faHandBackFist = {
  prefix: 'fas',
  iconName: 'hand-back-fist',
  icon: [448, 512, ["hand-rock"], "f255", "M144 0C117.5 0 96 21.5 96 48l0 48 0 28.5L96 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-26.7-9 7.5C40.4 169 32 187 32 206L32 244c0 38 16.9 74 46.1 98.3L128 384l0 96c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-105.3c46.9-19 80-65 80-118.7l0-80 0-16 0-16c0-26.5-21.5-48-48-48c-12.4 0-23.6 4.7-32.1 12.3C350 83.5 329.3 64 304 64c-12.4 0-23.6 4.7-32.1 12.3C270 51.5 249.3 32 224 32c-12.4 0-23.6 4.7-32.1 12.3C190 19.5 169.3 0 144 0z"]
};
const faHandRock = faHandBackFist;
const faSquareCaretUp = {
  prefix: 'fas',
  iconName: 'square-caret-up',
  icon: [448, 512, ["caret-square-up"], "f151", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM224 160c6.7 0 13 2.8 17.6 7.7l104 112c6.5 7 8.2 17.2 4.4 25.9s-12.5 14.4-22 14.4l-208 0c-9.5 0-18.2-5.7-22-14.4s-2.1-18.9 4.4-25.9l104-112c4.5-4.9 10.9-7.7 17.6-7.7z"]
};
const faCaretSquareUp = faSquareCaretUp;
const faCloudShowersWater = {
  prefix: 'fas',
  iconName: 'cloud-showers-water',
  icon: [576, 512, [], "e4e4", "M224 0c38.6 0 71.9 22.8 87.2 55.7C325.7 41.1 345.8 32 368 32c38.7 0 71 27.5 78.4 64l1.6 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64s28.7-64 64-64c0-53 43-96 96-96zM140.6 292.3l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15.1-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2s15.1 21.6 8.2 32.9zm327.8-32.9c11.4 6.8 15 21.6 8.2 32.9l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2zM252.6 292.3l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15.1-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2s15.1 21.6 8.2 32.9zm103.8-32.9c11.4 6.8 15 21.6 8.2 32.9l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15.1-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2zM306.5 421.9C329 437.4 356.5 448 384 448c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 501.7 417 512 384 512c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 437.2 165.1 448 192 448c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faChartBar = {
  prefix: 'fas',
  iconName: 'chart-bar',
  icon: [512, 512, ["bar-chart"], "f080", "M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zm96 96c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 64l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 96l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faBarChart = faChartBar;
const faHandsBubbles = {
  prefix: 'fas',
  iconName: 'hands-bubbles',
  icon: [576, 512, ["hands-wash"], "e05e", "M416 64a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm96 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM160 464a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM32 160l.1 72.6c.1 52.2 24 101 64 133.1c-.1-1.9-.1-3.8-.1-5.7l0-8c0-71.8 37-138.6 97.9-176.7l60.2-37.6c8.6-5.4 17.9-8.4 27.3-9.4l45.9-79.5c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8l-78 135.1c-3.3 5.7-10.7 7.7-16.4 4.4s-7.7-10.7-4.4-16.4l62-107.4c6.6-11.5 2.7-26.2-8.8-32.8S214 5 207.4 16.5l-68 117.8s0 0 0 0s0 0 0 0l-43.3 75L96 160c0-17.7-14.4-32-32-32s-32 14.4-32 32zM332.1 88.5L307.5 131c13.9 4.5 26.4 13.7 34.7 27c.9 1.5 1.8 2.9 2.5 4.4l28.9-50c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8zm46.4 63.7l-26.8 46.4c-.6 6-2.1 11.8-4.3 17.4l4.7 0 13.3 0s0 0 0 0l31.8 0 23-39.8c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8zM315.1 175c-9.4-15-29.1-19.5-44.1-10.2l-60.2 37.6C159.3 234.7 128 291.2 128 352l0 8c0 8.9 .8 17.6 2.2 26.1c35.4 8.2 61.8 40 61.8 77.9c0 6.3-.7 12.5-2.1 18.4C215.1 501 246.3 512 280 512l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-92 0c-6.6 0-12-5.4-12-12s5.4-12 12-12l124 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-124 0c-6.6 0-12-5.4-12-12s5.4-12 12-12l156 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-156 0c-6.6 0-12-5.4-12-12s5.4-12 12-12l124 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-136 0s0 0 0 0s0 0 0 0l-93.2 0L305 219.1c15-9.4 19.5-29.1 10.2-44.1z"]
};
const faHandsWash = faHandsBubbles;
const faLessThanEqual = {
  prefix: 'fas',
  iconName: 'less-than-equal',
  icon: [448, 512, [], "f537", "M395.9 93.7c16.4-6.6 24.4-25.2 17.8-41.6s-25.2-24.4-41.6-17.8l-320 128C40 167.1 32 178.9 32 192s8 24.9 20.1 29.7l320 128c16.4 6.6 35-1.4 41.6-17.8s-1.4-35-17.8-41.6L150.2 192 395.9 93.7zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416z"]
};
const faTrain = {
  prefix: 'fas',
  iconName: 'train',
  icon: [448, 512, [128646], "f238", "M96 0C43 0 0 43 0 96L0 352c0 48 35.2 87.7 81.1 94.9l-46 46C28.1 499.9 33.1 512 43 512l39.7 0c8.5 0 16.6-3.4 22.6-9.4L160 448l128 0 54.6 54.6c6 6 14.1 9.4 22.6 9.4l39.7 0c10 0 15-12.1 7.9-19.1l-46-46c46-7.1 81.1-46.9 81.1-94.9l0-256c0-53-43-96-96-96L96 0zM64 96c0-17.7 14.3-32 32-32l256 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32L96 224c-17.7 0-32-14.3-32-32l0-96zM224 288a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faEyeLowVision = {
  prefix: 'fas',
  iconName: 'eye-low-vision',
  icon: [640, 512, ["low-vision"], "f2a8", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223 149.5c48.6-44.3 123-50.8 179.3-11.7c60.8 42.4 78.9 123.2 44.2 186.9L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3L223 149.5zm223.1 298L83.1 161.5c-11 14.4-20.5 28.7-28.4 42.2l339 265.7c18.7-5.5 36.2-13 52.6-21.8zM34.5 268.3c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c3.1 0 6.1-.1 9.2-.2L33.1 247.8c-1.8 6.8-1.3 14 1.4 20.5z"]
};
const faLowVision = faEyeLowVision;
const faCrow = {
  prefix: 'fas',
  iconName: 'crow',
  icon: [640, 512, [], "f520", "M456 0c-48.6 0-88 39.4-88 88l0 29.2L12.5 390.6c-14 10.8-16.6 30.9-5.9 44.9s30.9 16.6 44.9 5.9L126.1 384l133.1 0 46.6 113.1c5 12.3 19.1 18.1 31.3 13.1s18.1-19.1 13.1-31.3L311.1 384l40.9 0c1.1 0 2.1 0 3.2 0l46.6 113.2c5 12.3 19.1 18.1 31.3 13.1s18.1-19.1 13.1-31.3l-42-102C484.9 354.1 544 280 544 192l0-64 0-8 80.5-20.1c8.6-2.1 13.8-10.8 11.6-19.4C629 52 603.4 32 574 32l-50.1 0C507.7 12.5 483.3 0 456 0zm0 64a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faSailboat = {
  prefix: 'fas',
  iconName: 'sailboat',
  icon: [576, 512, [], "e445", "M256 16c0-7 4.5-13.2 11.2-15.3s13.9 .4 17.9 6.1l224 320c3.4 4.9 3.8 11.3 1.1 16.6s-8.2 8.6-14.2 8.6l-224 0c-8.8 0-16-7.2-16-16l0-320zM212.1 96.5c7 1.9 11.9 8.2 11.9 15.5l0 224c0 8.8-7.2 16-16 16L80 352c-5.7 0-11-3-13.8-8s-2.9-11-.1-16l128-224c3.6-6.3 11-9.4 18-7.5zM5.7 404.3C2.8 394.1 10.5 384 21.1 384l533.8 0c10.6 0 18.3 10.1 15.4 20.3l-4 14.3C550.7 473.9 500.4 512 443 512L133 512C75.6 512 25.3 473.9 9.7 418.7l-4-14.3z"]
};
const faWindowRestore = {
  prefix: 'fas',
  iconName: 'window-restore',
  icon: [512, 512, [], "f2d2", "M432 64L208 64c-8.8 0-16 7.2-16 16l0 16-64 0 0-16c0-44.2 35.8-80 80-80L432 0c44.2 0 80 35.8 80 80l0 224c0 44.2-35.8 80-80 80l-16 0 0-64 16 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zM0 192c0-35.3 28.7-64 64-64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192zm64 32c0 17.7 14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 192c-17.7 0-32 14.3-32 32z"]
};
const faSquarePlus = {
  prefix: 'fas',
  iconName: 'square-plus',
  icon: [448, 512, [61846, "plus-square"], "f0fe", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM200 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
};
const faPlusSquare = faSquarePlus;
const faToriiGate = {
  prefix: 'fas',
  iconName: 'torii-gate',
  icon: [512, 512, [9961], "f6a1", "M0 80c0 26.5 21.5 48 48 48l16 0 0 64 64 0 0-64 96 0 0 64 64 0 0-64 96 0 0 64 64 0 0-64 16 0c26.5 0 48-21.5 48-48l0-66.6C512 6 506 0 498.6 0c-1.7 0-3.4 .3-5 1l-49 19.6C425.7 28.1 405.5 32 385.2 32L126.8 32c-20.4 0-40.5-3.9-59.4-11.4L18.4 1c-1.6-.6-3.3-1-5-1C6 0 0 6 0 13.4L0 80zM64 288l0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192 256 0 0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0z"]
};
const faFrog = {
  prefix: 'fas',
  iconName: 'frog',
  icon: [576, 512, [], "f52e", "M368 32c41.7 0 75.9 31.8 79.7 72.5l85.6 26.3c25.4 7.8 42.8 31.3 42.8 57.9c0 21.8-11.7 41.9-30.7 52.7L400.8 323.5 493.3 416l50.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-8.5 0-16.6-3.4-22.6-9.4L346.9 360.2c11.7-36 3.2-77.1-25.4-105.7c-40.6-40.6-106.3-40.6-146.9-.1L101 324.4c-6.4 6.1-6.7 16.2-.6 22.6s16.2 6.6 22.6 .6l73.8-70.2 .1-.1 .1-.1c3.5-3.5 7.3-6.6 11.3-9.2c27.9-18.5 65.9-15.4 90.5 9.2c24.7 24.7 27.7 62.9 9 90.9c-2.6 3.8-5.6 7.5-9 10.9L261.8 416l90.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 480c-35.3 0-64-28.7-64-64C0 249.6 127 112.9 289.3 97.5C296.2 60.2 328.8 32 368 32zm0 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faBucket = {
  prefix: 'fas',
  iconName: 'bucket',
  icon: [448, 512, [], "e4cf", "M96 152l0 8-48 0 0-8C48 68.1 116.1 0 200 0l48 0c83.9 0 152 68.1 152 152l0 8-48 0 0-8c0-57.4-46.6-104-104-104l-48 0C142.6 48 96 94.6 96 152zM0 224c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-5.1 0L388.5 469c-2.6 24.4-23.2 43-47.7 43l-233.6 0c-24.6 0-45.2-18.5-47.7-43L37.1 256 32 256c-17.7 0-32-14.3-32-32z"]
};
const faImage = {
  prefix: 'fas',
  iconName: 'image',
  icon: [512, 512, [], "f03e", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faMicrophone = {
  prefix: 'fas',
  iconName: 'microphone',
  icon: [384, 512, [], "f130", "M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z"]
};
const faCow = {
  prefix: 'fas',
  iconName: 'cow',
  icon: [640, 512, [128004], "f6c8", "M96 224l0 32 0 160c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-88.2c9.9 6.6 20.6 12 32 16.1l0 24.2c0 8.8 7.2 16 16 16s16-7.2 16-16l0-16.9c5.3 .6 10.6 .9 16 .9s10.7-.3 16-.9l0 16.9c0 8.8 7.2 16 16 16s16-7.2 16-16l0-24.2c11.4-4 22.1-9.4 32-16.1l0 88.2c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-160 32 32 0 49.5c0 9.5 2.8 18.7 8.1 26.6L530 427c8.8 13.1 23.5 21 39.3 21c22.5 0 41.9-15.9 46.3-38l20.3-101.6c2.6-13-.3-26.5-8-37.3l-3.9-5.5 0-81.6c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 14.4-52.9-74.1C496 86.5 452.4 64 405.9 64L272 64l-16 0-64 0-48 0C77.7 64 24 117.7 24 184l0 54C9.4 249.8 0 267.8 0 288l0 17.6c0 8 6.4 14.4 14.4 14.4C46.2 320 72 294.2 72 262.4l0-6.4 0-32 0-40c0-24.3 12.1-45.8 30.5-58.9C98.3 135.9 96 147.7 96 160l0 64zM560 336a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM166.6 166.6c-4.2-4.2-6.6-10-6.6-16c0-12.5 10.1-22.6 22.6-22.6l178.7 0c12.5 0 22.6 10.1 22.6 22.6c0 6-2.4 11.8-6.6 16l-23.4 23.4C332.2 211.8 302.7 224 272 224s-60.2-12.2-81.9-33.9l-23.4-23.4z"]
};
const faCaretUp = {
  prefix: 'fas',
  iconName: 'caret-up',
  icon: [320, 512, [], "f0d8", "M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]
};
const faScrewdriver = {
  prefix: 'fas',
  iconName: 'screwdriver',
  icon: [512, 512, [129691], "f54a", "M465 7c-8.5-8.5-22-9.4-31.6-2.1l-104 80c-5.9 4.5-9.4 11.6-9.4 19l0 54.1-85.6 85.6c6.7 4.2 13 9.3 18.8 15.1s10.9 12.2 15.1 18.8L353.9 192l54.1 0c7.5 0 14.5-3.5 19-9.4l80-104c7.4-9.6 6.5-23.1-2.1-31.6L465 7zM121.4 281.4l-112 112c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l112-112c30.2-30.2 30.2-79.1 0-109.3s-79.1-30.2-109.3 0z"]
};
const faFolderClosed = {
  prefix: 'fas',
  iconName: 'folder-closed',
  icon: [512, 512, [], "e185", "M448 480L64 480c-35.3 0-64-28.7-64-64L0 192l512 0 0 224c0 35.3-28.7 64-64 64zm64-320L0 160 0 96C0 60.7 28.7 32 64 32l128 0c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8l160 0c35.3 0 64 28.7 64 64z"]
};
const faHouseTsunami = {
  prefix: 'fas',
  iconName: 'house-tsunami',
  icon: [576, 512, [], "e515", "M80.8 136.5C104.9 93.8 152.6 64 209 64c16.9 0 33.1 2.7 48.2 7.7c16.8 5.5 34.9-3.6 40.4-20.4s-3.6-34.9-20.4-40.4C255.8 3.8 232.8 0 209 0C95.2 0 0 88 0 200c0 91.6 53.5 172.1 142.2 194.1c13.4 3.8 27.5 5.9 42.2 5.9c.7 0 1.4 0 2.1-.1c1.8 0 3.7 .1 5.5 .1c0 0 0 0 0 0c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.5-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 325.2 410.9 336 384 336c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0c-22.4 15.5-49.9 26.1-77.4 26.1c0 0-.1 0-.1 0c-12.4 0-24-1.5-34.9-4.3C121.6 320.2 96 287 96 248c0-48.5 39.5-88 88.4-88c13.5 0 26.1 3 37.5 8.3c16 7.5 35.1 .6 42.5-15.5s.6-35.1-15.5-42.5C229.3 101.1 207.4 96 184.4 96c-40 0-76.4 15.4-103.6 40.5zm252-18.1c-8.1 6-12.8 15.5-12.8 25.6l0 121c1.6 1 3.3 2 4.8 3.1c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.3 78.1 3.4c10.6 8.8 24.2 15.6 37.3 18.6c5.8 1.4 11.2 3.4 16.2 6.2c.7-2.7 1.1-5.5 1.1-8.4l-.4-144c0-10-4.7-19.4-12.7-25.5l-95.5-72c-11.4-8.6-27.1-8.6-38.5 0l-96 72zM384 448c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 437.2 410.9 448 384 448z"]
};
const faSquareNfi = {
  prefix: 'fas',
  iconName: 'square-nfi',
  icon: [448, 512, [], "e576", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm75.7 64.6C68.8 162.5 64 168.8 64 176l0 160c0 8.8 7.2 16 16 16s16-7.2 16-16l0-102.2 66.3 110.5c3.7 6.2 11.1 9.1 18 7.2s11.7-8.2 11.7-15.4l0-160c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 102.2L93.7 167.8c-3.7-6.2-11.1-9.1-18-7.2zM224 176l0 64 0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0 0-32 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zm160 0c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 160c0 8.8 7.2 16 16 16s16-7.2 16-16l0-160z"]
};
const faArrowUpFromGroundWater = {
  prefix: 'fas',
  iconName: 'arrow-up-from-ground-water',
  icon: [576, 512, [], "e4b5", "M288 352c17.7 0 32-14.3 32-32l0-210.7 25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-80-80c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L256 109.3 256 320c0 17.7 14.3 32 32 32zm-18.5 69.9C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 437.2 410.9 448 384 448c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0zM192 192L48 192c-26.5 0-48 21.5-48 48L0 425c5.3-3.1 11.2-5.4 17.5-6.9c13.1-3.1 26.7-9.8 37.3-18.6c22.2-18.7 54.3-20.1 78.1-3.4c18 12.4 40.1 20.3 59.1 20.3L192 192zm384 48c0-26.5-21.5-48-48-48l-144 0 0 224.5s0 0 0 0c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.4 78.1 3.4c10.6 8.8 24.2 15.6 37.3 18.6c6.3 1.5 12.1 3.8 17.5 6.9l0-185z"]
};
const faMartiniGlass = {
  prefix: 'fas',
  iconName: 'martini-glass',
  icon: [512, 512, [127864, "glass-martini-alt"], "f57b", "M32 0C19.1 0 7.4 7.8 2.4 19.8s-2.2 25.7 6.9 34.9L224 269.3 224 448l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-178.7L502.6 54.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 0 480 0L32 0zM173.3 128l-64-64 293.5 0-64 64-165.5 0z"]
};
const faGlassMartiniAlt = faMartiniGlass;
const faSquareBinary = {
  prefix: 'fas',
  iconName: 'square-binary',
  icon: [448, 512, [], "e69b", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm144 4c-24.3 0-44 19.7-44 44l0 48c0 24.3 19.7 44 44 44l32 0c24.3 0 44-19.7 44-44l0-48c0-24.3-19.7-44-44-44l-32 0zm-4 44c0-2.2 1.8-4 4-4l32 0c2.2 0 4 1.8 4 4l0 48c0 2.2-1.8 4-4 4l-32 0c-2.2 0-4-1.8-4-4l0-48zm140-44c-11 0-20 9-20 20c0 9.7 6.9 17.7 16 19.6l0 76.4c0 11 9 20 20 20s20-9 20-20l0-96c0-11-9-20-20-20l-16 0zM132 296c0 9.7 6.9 17.7 16 19.6l0 76.4c0 11 9 20 20 20s20-9 20-20l0-96c0-11-9-20-20-20l-16 0c-11 0-20 9-20 20zm96 24l0 48c0 24.3 19.7 44 44 44l32 0c24.3 0 44-19.7 44-44l0-48c0-24.3-19.7-44-44-44l-32 0c-24.3 0-44 19.7-44 44zm44-4l32 0c2.2 0 4 1.8 4 4l0 48c0 2.2-1.8 4-4 4l-32 0c-2.2 0-4-1.8-4-4l0-48c0-2.2 1.8-4 4-4z"]
};
const faRotateLeft = {
  prefix: 'fas',
  iconName: 'rotate-left',
  icon: [512, 512, ["rotate-back", "rotate-backward", "undo-alt"], "f2ea", "M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"]
};
const faRotateBack = faRotateLeft;
const faRotateBackward = faRotateLeft;
const faUndoAlt = faRotateLeft;
const faTableColumns = {
  prefix: 'fas',
  iconName: 'table-columns',
  icon: [512, 512, ["columns"], "f0db", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 160 0 0-256L64 160zm384 0l-160 0 0 256 160 0 0-256z"]
};
const faColumns = faTableColumns;
const faLemon = {
  prefix: 'fas',
  iconName: 'lemon',
  icon: [448, 512, [127819], "f094", "M448 96c0-35.3-28.7-64-64-64c-6.6 0-13 1-19 2.9c-22.5 7-48.1 14.9-71 9c-75.2-19.1-156.4 11-213.7 68.3S-7.2 250.8 11.9 326c5.8 22.9-2 48.4-9 71C1 403 0 409.4 0 416c0 35.3 28.7 64 64 64c6.6 0 13-1 19.1-2.9c22.5-7 48.1-14.9 71-9c75.2 19.1 156.4-11 213.7-68.3s87.5-138.5 68.3-213.7c-5.8-22.9 2-48.4 9-71c1.9-6 2.9-12.4 2.9-19.1zM212.5 127.4c-54.6 16-101.1 62.5-117.1 117.1C92.9 253 84 257.8 75.5 255.4S62.2 244 64.6 235.5c19.1-65.1 73.7-119.8 138.9-138.9c8.5-2.5 17.4 2.4 19.9 10.9s-2.4 17.4-10.9 19.9z"]
};
const faHeadSideMask = {
  prefix: 'fas',
  iconName: 'head-side-mask',
  icon: [576, 512, [], "e063", "M32 224.2c0-22.2 3.2-43.6 9.2-63.9L262.2 321c-4 9.5-6.2 20-6.2 31l0 160-128 0c-17.7 0-32-14.3-32-32l0-72.7c0-16.7-6.9-32.5-17.1-45.8C48.6 322.4 32 274.1 32 224.2zm248.3 70.4L53 129.3C88.7 53 166.2 0 256 0l24 0c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c5.4 6.7 8.6 14.8 9.4 23.2L336 272c-21.7 0-41.3 8.6-55.7 22.6zM336 304l198 0s0 0 0 0l10 0-19.7 64L368 368c-8.8 0-16 7.2-16 16s7.2 16 16 16l146.5 0-9.8 32L368 432c-8.8 0-16 7.2-16 16s7.2 16 16 16l126.8 0-.9 2.8c-8.3 26.9-33.1 45.2-61.2 45.2L288 512l0-160c0-14 6-26.7 15.6-35.4c0 0 0 0 0 0c8.5-7.8 19.9-12.6 32.4-12.6zm48-80a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faHandshake = {
  prefix: 'fas',
  iconName: 'handshake',
  icon: [640, 512, [], "f2b5", "M323.4 85.2l-96.8 78.4c-16.1 13-19.2 36.4-7 53.1c12.9 17.8 38 21.3 55.3 7.8l99.3-77.2c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L512 316.8 512 128l-.7 0-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2zm22.8 124.4l-51.7 40.2C263 274.4 217.3 268 193.7 235.6c-22.2-30.5-16.6-73.1 12.7-96.8l83.2-67.3c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-72 48 0 224 28.2 0 91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c4.5-4.9 7.8-10.6 9.9-16.5c19.4 13 45.8 10.3 62.1-7.5c17.9-19.5 16.6-49.9-2.9-67.8l-134.2-123zM16 128c-8.8 0-16 7.2-16 16L0 352c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-224-80 0zM48 320a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM544 128l0 224c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-208c0-8.8-7.2-16-16-16l-80 0zm32 208a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faGem = {
  prefix: 'fas',
  iconName: 'gem',
  icon: [512, 512, [128142], "f3a5", "M116.7 33.8c4.5-6.1 11.7-9.8 19.3-9.8l240 0c7.6 0 14.8 3.6 19.3 9.8l112 152c6.8 9.2 6.1 21.9-1.5 30.4l-232 256c-4.5 5-11 7.9-17.8 7.9s-13.2-2.9-17.8-7.9l-232-256c-7.7-8.5-8.3-21.2-1.5-30.4l112-152zm38.5 39.8c-3.3 2.5-4.2 7-2.1 10.5l57.4 95.6L63.3 192c-4.1 .3-7.3 3.8-7.3 8s3.2 7.6 7.3 8l192 16c.4 0 .9 0 1.3 0l192-16c4.1-.3 7.3-3.8 7.3-8s-3.2-7.6-7.3-8L301.5 179.8l57.4-95.6c2.1-3.5 1.2-8.1-2.1-10.5s-7.9-2-10.7 1L256 172.2 165.9 74.6c-2.8-3-7.4-3.4-10.7-1z"]
};
const faDolly = {
  prefix: 'fas',
  iconName: 'dolly',
  icon: [576, 512, ["dolly-box"], "f472", "M0 32C0 14.3 14.3 0 32 0l72.9 0c27.5 0 52 17.6 60.7 43.8L257.7 320c30.1 .5 56.8 14.9 74 37l202.1-67.4c16.8-5.6 34.9 3.5 40.5 20.2s-3.5 34.9-20.2 40.5L352 417.7c-.9 52.2-43.5 94.3-96 94.3c-53 0-96-43-96-96c0-30.8 14.5-58.2 37-75.8L104.9 64 32 64C14.3 64 0 49.7 0 32zM244.8 134.5c-5.5-16.8 3.7-34.9 20.5-40.3L311 79.4l19.8 60.9 60.9-19.8L371.8 59.6l45.7-14.8c16.8-5.5 34.9 3.7 40.3 20.5l49.4 152.2c5.5 16.8-3.7 34.9-20.5 40.3L334.5 307.2c-16.8 5.5-34.9-3.7-40.3-20.5L244.8 134.5z"]
};
const faDollyBox = faDolly;
const faSmoking = {
  prefix: 'fas',
  iconName: 'smoking',
  icon: [640, 512, [128684], "f48d", "M448 32l0 11c0 38.2 15.2 74.8 42.2 101.8l21 21c21 21 32.8 49.5 32.8 79.2l0 11c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-11c0-12.7-5.1-24.9-14.1-33.9l-21-21C405.9 151.1 384 98.1 384 43l0-11c0-17.7 14.3-32 32-32s32 14.3 32 32zM576 256l0-11c0-38.2-15.2-74.8-42.2-101.8l-21-21c-21-21-32.8-49.5-32.8-79.2l0-11c0-17.7 14.3-32 32-32s32 14.3 32 32l0 11c0 12.7 5.1 24.9 14.1 33.9l21 21c39 39 60.9 91.9 60.9 147.1l0 11c0 17.7-14.3 32-32 32s-32-14.3-32-32zM0 416c0-35.3 28.7-64 64-64l352 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32L64 512c-35.3 0-64-28.7-64-64l0-32zm224 0l0 32 160 0 0-32-160 0zm288-64c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32z"]
};
const faMinimize = {
  prefix: 'fas',
  iconName: 'minimize',
  icon: [512, 512, ["compress-arrows-alt"], "f78c", "M456 224l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l40 40L442.3 5.7C446 2 450.9 0 456 0s10 2 13.7 5.7l36.7 36.7C510 46 512 50.9 512 56s-2 10-5.7 13.7L433 143l40 40c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8zm0 64c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-40 40 73.4 73.4c3.6 3.6 5.7 8.5 5.7 13.7s-2 10-5.7 13.7l-36.7 36.7C466 510 461.1 512 456 512s-10-2-13.7-5.7L369 433l-40 40c-6.9 6.9-17.2 8.9-26.2 5.2s-14.8-12.5-14.8-22.2l0-144c0-13.3 10.7-24 24-24l144 0zm-256 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-40-40L69.7 506.3C66 510 61.1 512 56 512s-10-2-13.7-5.7L5.7 469.7C2 466 0 461.1 0 456s2-10 5.7-13.7L79 369 39 329c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8l144 0zM56 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l40-40L5.7 69.7C2 66 0 61.1 0 56s2-10 5.7-13.7L42.3 5.7C46 2 50.9 0 56 0s10 2 13.7 5.7L143 79l40-40c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 144c0 13.3-10.7 24-24 24L56 224z"]
};
const faCompressArrowsAlt = faMinimize;
const faMonument = {
  prefix: 'fas',
  iconName: 'monument',
  icon: [384, 512, [], "f5a6", "M180.7 4.7c6.2-6.2 16.4-6.2 22.6 0l80 80c2.5 2.5 4.1 5.8 4.6 9.3l40.2 322L55.9 416 96.1 94c.4-3.5 2-6.8 4.6-9.3l80-80zM152 272c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zM32 448l320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faSnowplow = {
  prefix: 'fas',
  iconName: 'snowplow',
  icon: [640, 512, [], "f7d2", "M298.9 64l68.6 160L256 224l-64-64 0-96 106.9 0zM445.1 242.7l-87.4-204C347.6 15.3 324.5 0 298.9 0L176 0c-26.5 0-48 21.5-48 48l0 112-32 0c-17.7 0-32 14.3-32 32l0 106.8C26.2 316.8 0 355.3 0 400c0 61.9 50.1 112 112 112l256 0c61.9 0 112-50.1 112-112c0-17.2-3.9-33.5-10.8-48l42.8 0 0 50.7c0 17 6.7 33.3 18.7 45.3l54.6 54.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L576 402.7l0-82.7 0-84.8L633 164c11-13.8 8.8-33.9-5-45s-33.9-8.8-45 5l-57 71.2c-9.1 11.3-14 25.4-14 40l0 52.8-64 0 0-31.3c.1-2.4-.2-4.8-.6-7.1s-1.2-4.7-2.2-6.8zM368 352c26.5 0 48 21.5 48 48s-21.5 48-48 48l-256 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l256 0zM144 400a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm216 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm-56-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM200 424a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faAnglesRight = {
  prefix: 'fas',
  iconName: 'angles-right',
  icon: [512, 512, [187, "angle-double-right"], "f101", "M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"]
};
const faAngleDoubleRight = faAnglesRight;
const faCannabis = {
  prefix: 'fas',
  iconName: 'cannabis',
  icon: [512, 512, [], "f55f", "M256 0c5.3 0 10.3 2.7 13.3 7.1c15.8 23.5 36.7 63.7 49.2 109c7.2 26.4 11.8 55.2 10.4 84c11.5-8.8 23.7-16.7 35.8-23.6c41-23.3 84.4-36.9 112.2-42.5c5.2-1 10.7 .6 14.4 4.4s5.4 9.2 4.4 14.5c-5.6 27.7-19.3 70.9-42.7 111.7c-9.1 15.9-19.9 31.7-32.4 46.3c27.8 6.6 52.4 17.3 67.2 25.5c5.1 2.8 8.2 8.2 8.2 14s-3.2 11.2-8.2 14c-15.2 8.4-40.9 19.5-69.8 26.1c-20.2 4.6-42.9 7.2-65.2 4.6l8.3 33.1c1.5 6.1-.6 12.4-5.5 16.4s-11.6 4.6-17.2 1.9L280 417.2l0 70.8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-70.8-58.5 29.1c-5.6 2.8-12.3 2.1-17.2-1.9s-7-10.3-5.5-16.4l8.3-33.1c-22.2 2.6-45 0-65.2-4.6c-28.9-6.6-54.6-17.6-69.8-26.1c-5.1-2.8-8.2-8.2-8.2-14s3.2-11.2 8.2-14c14.8-8.2 39.4-18.8 67.2-25.5C78.9 296.3 68.1 280.5 59 264.6c-23.4-40.8-37.1-84-42.7-111.7c-1.1-5.2 .6-10.7 4.4-14.5s9.2-5.4 14.4-4.4c27.9 5.5 71.2 19.2 112.2 42.5c12.1 6.9 24.3 14.7 35.8 23.6c-1.4-28.7 3.1-57.6 10.4-84c12.5-45.3 33.4-85.5 49.2-109c3-4.4 8-7.1 13.3-7.1z"]
};
const faCirclePlay = {
  prefix: 'fas',
  iconName: 'circle-play',
  icon: [512, 512, [61469, "play-circle"], "f144", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"]
};
const faPlayCircle = faCirclePlay;
const faTablets = {
  prefix: 'fas',
  iconName: 'tablets',
  icon: [640, 512, [], "f490", "M614.3 247c-5.2 7.9-16.2 8.5-22.9 1.8L391.2 48.6c-6.7-6.7-6.2-17.8 1.8-22.9C418.1 9.4 447.9 0 480 0c88.4 0 160 71.6 160 160c0 32.1-9.4 61.9-25.7 87zM567 294.3c-25 16.3-54.9 25.7-87 25.7c-88.4 0-160-71.6-160-160c0-32.1 9.4-61.9 25.7-87c5.2-7.9 16.2-8.5 22.9-1.8L568.8 271.4c6.7 6.7 6.2 17.8-1.8 22.9zM301.5 368c9.5 0 16.9 8.2 15 17.5C301.1 457.8 236.9 512 160 512S18.9 457.8 3.5 385.5c-2-9.3 5.5-17.5 15-17.5l283.1 0zm0-32L18.5 336c-9.5 0-16.9-8.2-15-17.5C18.9 246.2 83.1 192 160 192s141.1 54.2 156.5 126.5c2 9.3-5.5 17.5-15 17.5z"]
};
const faEthernet = {
  prefix: 'fas',
  iconName: 'ethernet',
  icon: [512, 512, [], "f796", "M0 224L0 416c0 17.7 14.3 32 32 32l64 0 0-112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112 64 0 0-112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112 64 0 0-112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112 64 0 0-112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112 64 0c17.7 0 32-14.3 32-32l0-192c0-17.7-14.3-32-32-32l-32 0 0-32c0-17.7-14.3-32-32-32l-32 0 0-32c0-17.7-14.3-32-32-32L160 64c-17.7 0-32 14.3-32 32l0 32-32 0c-17.7 0-32 14.3-32 32l0 32-32 0c-17.7 0-32 14.3-32 32z"]
};
const faEuroSign = {
  prefix: 'fas',
  iconName: 'euro-sign',
  icon: [320, 512, [8364, "eur", "euro"], "f153", "M48.1 240c-.1 2.7-.1 5.3-.1 8l0 16c0 2.7 0 5.3 .1 8L32 272c-17.7 0-32 14.3-32 32s14.3 32 32 32l28.3 0C89.9 419.9 170 480 264 480l24 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-24 0c-57.9 0-108.2-32.4-133.9-80L256 336c17.7 0 32-14.3 32-32s-14.3-32-32-32l-143.8 0c-.1-2.6-.2-5.3-.2-8l0-16c0-2.7 .1-5.4 .2-8L256 240c17.7 0 32-14.3 32-32s-14.3-32-32-32l-125.9 0c25.7-47.6 76-80 133.9-80l24 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-24 0C170 32 89.9 92.1 60.3 176L32 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l16.1 0z"]
};
const faEur = faEuroSign;
const faEuro = faEuroSign;
const faChair = {
  prefix: 'fas',
  iconName: 'chair',
  icon: [448, 512, [129681], "f6c0", "M248 48l0 208 48 0 0-197.3c23.9 13.8 40 39.7 40 69.3l0 128 48 0 0-128C384 57.3 326.7 0 256 0L192 0C121.3 0 64 57.3 64 128l0 128 48 0 0-128c0-29.6 16.1-55.5 40-69.3L152 256l48 0 0-208 48 0zM48 288c-12.1 0-23.2 6.8-28.6 17.7l-16 32c-5 9.9-4.4 21.7 1.4 31.1S20.9 384 32 384l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 256 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c11.1 0 21.4-5.7 27.2-15.2s6.4-21.2 1.4-31.1l-16-32C423.2 294.8 412.1 288 400 288L48 288z"]
};
const faCircleCheck = {
  prefix: 'fas',
  iconName: 'circle-check',
  icon: [512, 512, [61533, "check-circle"], "f058", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faCheckCircle = faCircleCheck;
const faCircleStop = {
  prefix: 'fas',
  iconName: 'circle-stop',
  icon: [512, 512, [62094, "stop-circle"], "f28d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 160l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z"]
};
const faStopCircle = faCircleStop;
const faCompassDrafting = {
  prefix: 'fas',
  iconName: 'compass-drafting',
  icon: [512, 512, ["drafting-compass"], "f568", "M352 96c0 14.3-3.1 27.9-8.8 40.2L396 227.4c-23.7 25.3-54.2 44.1-88.5 53.6L256 192c0 0 0 0 0 0s0 0 0 0l-68 117.5c21.5 6.8 44.3 10.5 68.1 10.5c70.7 0 133.8-32.7 174.9-84c11.1-13.8 31.2-16 45-5s16 31.2 5 45C428.1 341.8 347 384 256 384c-35.4 0-69.4-6.4-100.7-18.1L98.7 463.7C94 471.8 87 478.4 78.6 482.6L23.2 510.3c-5 2.5-10.9 2.2-15.6-.7S0 501.5 0 496l0-55.4c0-8.4 2.2-16.7 6.5-24.1l60-103.7C53.7 301.6 41.8 289.3 31.2 276c-11.1-13.8-8.8-33.9 5-45s33.9-8.8 45 5c5.7 7.1 11.8 13.8 18.2 20.1l69.4-119.9c-5.6-12.2-8.8-25.8-8.8-40.2c0-53 43-96 96-96s96 43 96 96zm21 297.9c32.6-12.8 62.5-30.8 88.9-52.9l43.7 75.5c4.2 7.3 6.5 15.6 6.5 24.1l0 55.4c0 5.5-2.9 10.7-7.6 13.6s-10.6 3.2-15.6 .7l-55.4-27.7c-8.4-4.2-15.4-10.8-20.1-18.9L373 393.9zM256 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faDraftingCompass = faCompassDrafting;
const faPlateWheat = {
  prefix: 'fas',
  iconName: 'plate-wheat',
  icon: [512, 512, [], "e55a", "M176 32c44.2 0 80 35.8 80 80l0 16c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80l0-16c0-8.8 7.2-16 16-16zM56 64l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM24 136l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 96c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zM272 48c0-8.8 7.2-16 16-16c44.2 0 80 35.8 80 80l0 16c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80l0-16zM400 32c44.2 0 80 35.8 80 80l0 16c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80l0-16c0-8.8 7.2-16 16-16zm80 160l0 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM352 176c8.8 0 16 7.2 16 16l0 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80zm-96 16l0 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM3.5 347.6C1.6 332.9 13 320 27.8 320l456.4 0c14.8 0 26.2 12.9 24.4 27.6C502.3 397.8 464.2 437 416 446l0 2c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-2c-48.2-9-86.3-48.2-92.5-98.4z"]
};
const faIcicles = {
  prefix: 'fas',
  iconName: 'icicles',
  icon: [512, 512, [], "f7ad", "M75.8 304.8L1 35.7c-.7-2.5-1-5-1-7.5C0 12.6 12.6 0 28.2 0H482.4C498.8 0 512 13.2 512 29.6c0 1.6-.1 3.3-.4 4.9L434.6 496.1c-1.5 9.2-9.5 15.9-18.8 15.9c-9.2 0-17.1-6.6-18.7-15.6L336 160 307.2 303.9c-1.9 9.3-10.1 16.1-19.6 16.1c-9.2 0-17.2-6.2-19.4-15.1L240 192 210.6 368.2c-1.5 9.1-9.4 15.8-18.6 15.8s-17.1-6.7-18.6-15.8L144 192 115.9 304.3c-2.3 9.2-10.6 15.7-20.1 15.7c-9.3 0-17.5-6.2-20-15.2z"]
};
const faPersonShelter = {
  prefix: 'fas',
  iconName: 'person-shelter',
  icon: [512, 512, [], "e54f", "M271.9 4.2c-9.8-5.6-21.9-5.6-31.8 0l-224 128C6.2 137.9 0 148.5 0 160L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.4L256 68.9 448 178.6 448 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-11.5-6.2-22.1-16.1-27.8l-224-128zM256 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zm-8 280l0-88 16 0 0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-174.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3l-37.9 70.3c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L200 313.5 200 488c0 13.3 10.7 24 24 24s24-10.7 24-24z"]
};
const faNeuter = {
  prefix: 'fas',
  iconName: 'neuter',
  icon: [384, 512, [9906], "f22c", "M80 176a112 112 0 1 1 224 0A112 112 0 1 1 80 176zM224 349.1c81.9-15 144-86.8 144-173.1C368 78.8 289.2 0 192 0S16 78.8 16 176c0 86.3 62.1 158.1 144 173.1L160 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-130.9z"]
};
const faIdBadge = {
  prefix: 'fas',
  iconName: 'id-badge',
  icon: [384, 512, [], "f2c1", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zm96 320l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L96 416c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM144 64l96 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faMarker = {
  prefix: 'fas',
  iconName: 'marker',
  icon: [512, 512, [], "f5a1", "M481 31C445.1-4.8 386.9-4.8 351 31l-15 15L322.9 33C294.8 4.9 249.2 4.9 221.1 33L135 119c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L255 66.9c9.4-9.4 24.6-9.4 33.9 0L302.1 80 186.3 195.7 316.3 325.7 481 161c35.9-35.9 35.9-94.1 0-129.9zM293.7 348.3L163.7 218.3 99.5 282.5c-48 48-80.8 109.2-94.1 175.8l-5 25c-1.6 7.9 .9 16 6.6 21.7s13.8 8.1 21.7 6.6l25-5c66.6-13.3 127.8-46.1 175.8-94.1l64.2-64.2z"]
};
const faFaceLaughBeam = {
  prefix: 'fas',
  iconName: 'face-laugh-beam',
  icon: [512, 512, [128513, "laugh-beam"], "f59a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1l275.2 0c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zM217.6 212.8s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faLaughBeam = faFaceLaughBeam;
const faHelicopterSymbol = {
  prefix: 'fas',
  iconName: 'helicopter-symbol',
  icon: [512, 512, [], "e502", "M445.3 224l64.7 0C495.6 108.2 403.8 16.4 288 2l0 64.7C368.4 80.1 431.9 143.6 445.3 224zM510 288l-64.7 0C431.9 368.4 368.4 431.9 288 445.3l0 64.7c115.8-14.4 207.6-106.2 222-222zM2 288C16.4 403.8 108.2 495.6 224 510l0-64.7C143.6 431.9 80.1 368.4 66.7 288L2 288zm0-64l64.7 0C80.1 143.6 143.6 80.1 224 66.7L224 2C108.2 16.4 16.4 108.2 2 224zm206-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 96 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-96 0 0-64z"]
};
const faUniversalAccess = {
  prefix: 'fas',
  iconName: 'universal-access',
  icon: [512, 512, [], "f29a", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm161.5-86.1c-12.2-5.2-26.3 .4-31.5 12.6s.4 26.3 12.6 31.5l11.9 5.1c17.3 7.4 35.2 12.9 53.6 16.3l0 50.1c0 4.3-.7 8.6-2.1 12.6l-28.7 86.1c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l24.4-73.2c1.3-3.8 4.8-6.4 8.8-6.4s7.6 2.6 8.8 6.4l24.4 73.2c4.2 12.6 17.8 19.4 30.4 15.2s19.4-17.8 15.2-30.4l-28.7-86.1c-1.4-4.1-2.1-8.3-2.1-12.6l0-50.1c18.4-3.5 36.3-8.9 53.6-16.3l11.9-5.1c12.2-5.2 17.8-19.3 12.6-31.5s-19.3-17.8-31.5-12.6L338.7 175c-26.1 11.2-54.2 17-82.7 17s-56.5-5.8-82.7-17l-11.9-5.1zM256 160a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faCircleChevronUp = {
  prefix: 'fas',
  iconName: 'circle-chevron-up',
  icon: [512, 512, ["chevron-circle-up"], "f139", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM377 271c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-87-87-87 87c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 167c9.4-9.4 24.6-9.4 33.9 0L377 271z"]
};
const faChevronCircleUp = faCircleChevronUp;
const faLariSign = {
  prefix: 'fas',
  iconName: 'lari-sign',
  icon: [384, 512, [], "e1c8", "M144 32c17.7 0 32 14.3 32 32l0 32.7c5.3-.4 10.6-.7 16-.7s10.7 .2 16 .7L208 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 49.4c54.9 25.2 95.8 75.5 108.2 136.2c3.5 17.3-7.7 34.2-25 37.7s-34.2-7.7-37.7-25c-6.1-29.9-22.5-55.9-45.4-74.3l0 67.9c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-95c-5.2-.7-10.6-1-16-1s-10.8 .3-16 1l0 95c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-67.9C82.7 211.5 64 247.6 64 288c0 70.7 57.3 128 128 128l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l16.9 0C18.5 382 0 337.2 0 288c0-77.5 45.9-144.3 112-174.6L112 64c0-17.7 14.3-32 32-32z"]
};
const faVolcano = {
  prefix: 'fas',
  iconName: 'volcano',
  icon: [512, 512, [127755], "f770", "M160 144c-35.3 0-64-28.7-64-64s28.7-64 64-64c15.7 0 30 5.6 41.2 15C212.4 12.4 232.7 0 256 0s43.6 12.4 54.8 31C322 21.6 336.3 16 352 16c35.3 0 64 28.7 64 64s-28.7 64-64 64c-14.7 0-28.3-5-39.1-13.3l-32 48C275.3 187 266 192 256 192s-19.3-5-24.9-13.3l-32-48C188.3 139 174.7 144 160 144zM144 352l48.4-24.2c10.2-5.1 21.6-7.8 33-7.8c19.6 0 38.4 7.8 52.2 21.6l32.5 32.5c6.3 6.3 14.9 9.9 23.8 9.9c11.3 0 21.8-5.6 28-15l9.7-14.6-58.9-66.3c-9.1-10.2-22.2-16.1-35.9-16.1l-41.8 0c-13.7 0-26.8 5.9-35.9 16.1l-59.9 67.4L144 352zm19.4-95.8c18.2-20.5 44.3-32.2 71.8-32.2l41.8 0c27.4 0 53.5 11.7 71.8 32.2l150.2 169c8.5 9.5 13.2 21.9 13.2 34.7c0 28.8-23.4 52.2-52.2 52.2L52.2 512C23.4 512 0 488.6 0 459.8c0-12.8 4.7-25.1 13.2-34.7l150.2-169z"]
};
const faPersonWalkingDashedLineArrowRight = {
  prefix: 'fas',
  iconName: 'person-walking-dashed-line-arrow-right',
  icon: [640, 512, [], "e553", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224 384 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l146.7 0-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80zM392 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48c0-13.3-10.7-24-24-24zm24 152c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16zM392 320c-13.3 0-24 10.7-24 24l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16c0-13.3-10.7-24-24-24zm24 120c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48z"]
};
const faSterlingSign = {
  prefix: 'fas',
  iconName: 'sterling-sign',
  icon: [320, 512, [163, "gbp", "pound-sign"], "f154", "M112 160.4c0-35.5 28.8-64.4 64.4-64.4c6.9 0 13.8 1.1 20.4 3.3l81.2 27.1c16.8 5.6 34.9-3.5 40.5-20.2s-3.5-34.9-20.2-40.5L217 38.6c-13.1-4.4-26.8-6.6-40.6-6.6C105.5 32 48 89.5 48 160.4L48 224l-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 44.5c0 17.4-4.7 34.5-13.7 49.4L4.6 431.5c-5.9 9.9-6.1 22.2-.4 32.2S20.5 480 32 480l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L88.5 416l.7-1.1C104.1 390 112 361.5 112 332.5l0-44.5 112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0 0-63.6z"]
};
const faGbp = faSterlingSign;
const faPoundSign = faSterlingSign;
const faViruses = {
  prefix: 'fas',
  iconName: 'viruses',
  icon: [640, 512, [], "e076", "M192 0c13.3 0 24 10.7 24 24l0 13.5c0 35.6 43.1 53.5 68.3 28.3l9.5-9.5c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-9.5 9.5C293 124.9 310.9 168 346.5 168l13.5 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-13.5 0c-35.6 0-53.5 43.1-28.3 68.3l9.5 9.5c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-9.5-9.5C259.1 293 216 310.9 216 346.5l0 13.5c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-13.5c0-35.6-43.1-53.5-68.3-28.3l-9.5 9.5c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l9.5-9.5C91 259.1 73.1 216 37.5 216L24 216c-13.3 0-24-10.7-24-24s10.7-24 24-24l13.5 0c35.6 0 53.5-43.1 28.3-68.3l-9.5-9.5c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l9.5 9.5C124.9 91 168 73.1 168 37.5L168 24c0-13.3 10.7-24 24-24zm48 224a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-48-64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm320 80c0 33 39.9 49.5 63.2 26.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6C574.5 312.1 591 352 624 352c8.8 0 16 7.2 16 16s-7.2 16-16 16c-33 0-49.5 39.9-26.2 63.2c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0C551.9 446.5 512 463 512 496c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-33-39.9-49.5-63.2-26.2c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6C417.5 423.9 401 384 368 384c-8.8 0-16-7.2-16-16s7.2-16 16-16c33 0 49.5-39.9 26.2-63.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0C440.1 289.5 480 273 480 240c0-8.8 7.2-16 16-16s16 7.2 16 16zm0 112a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faSquarePersonConfined = {
  prefix: 'fas',
  iconName: 'square-person-confined',
  icon: [448, 512, [], "e577", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm96 112a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm80 104c0-30.9 25.1-56 56-56s56 25.1 56 56l0 102.1c0 36.4-29.5 65.9-65.9 65.9c-17.5 0-34.3-6.9-46.6-19.3L184.8 342l-28.1 56.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l48-96c4.6-9.2 13.3-15.6 23.5-17.3s20.5 1.7 27.8 9L240 306.7l0-58.7z"]
};
const faUserTie = {
  prefix: 'fas',
  iconName: 'user-tie',
  icon: [448, 512, [], "f508", "M96 128a128 128 0 1 0 256 0A128 128 0 1 0 96 128zm94.5 200.2l18.6 31L175.8 483.1l-36-146.9c-2-8.1-9.8-13.4-17.9-11.3C51.9 342.4 0 405.8 0 481.3c0 17 13.8 30.7 30.7 30.7l131.7 0c0 0 0 0 .1 0l5.5 0 112 0 5.5 0c0 0 0 0 .1 0l131.7 0c17 0 30.7-13.8 30.7-30.7c0-75.5-51.9-138.9-121.9-156.4c-8.1-2-15.9 3.3-17.9 11.3l-36 146.9L238.9 359.2l18.6-31c6.4-10.7-1.3-24.2-13.7-24.2L224 304l-19.7 0c-12.4 0-20.1 13.6-13.7 24.2z"]
};
const faArrowDownLong = {
  prefix: 'fas',
  iconName: 'arrow-down-long',
  icon: [384, 512, ["long-arrow-down"], "f175", "M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 402.7 224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 370.7L86.6 329.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128z"]
};
const faLongArrowDown = faArrowDownLong;
const faTentArrowDownToLine = {
  prefix: 'fas',
  iconName: 'tent-arrow-down-to-line',
  icon: [640, 512, [], "e57e", "M241.8 111.9c8.9 9.9 8.1 25-1.8 33.9l-80 72c-9.1 8.2-23 8.2-32.1 0l-80-72c-9.9-8.9-10.7-24-1.8-33.9s24-10.7 33.9-1.8l39.9 36L120 24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 122.1 39.9-36c9.9-8.9 25-8.1 33.9 1.8zm122.8 22.6c11.5-8.7 27.3-8.7 38.8 0l168 128c6.6 5 11 12.5 12.3 20.7l24 160 .7 4.7c17.5 .2 31.6 14.4 31.6 32c0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l127.6 0 .7-4.7 24-160c1.2-8.2 5.6-15.7 12.3-20.7l168-128zM384 448l80 0L402.7 325.5c-1.7-3.4-5.1-5.5-8.8-5.5c-5.5 0-9.9 4.4-9.9 9.9L384 448z"]
};
const faCertificate = {
  prefix: 'fas',
  iconName: 'certificate',
  icon: [512, 512, [], "f0a3", "M211 7.3C205 1 196-1.4 187.6 .8s-14.9 8.9-17.1 17.3L154.7 80.6l-62-17.5c-8.4-2.4-17.4 0-23.5 6.1s-8.5 15.1-6.1 23.5l17.5 62L18.1 170.6c-8.4 2.1-15 8.7-17.3 17.1S1 205 7.3 211l46.2 45L7.3 301C1 307-1.4 316 .8 324.4s8.9 14.9 17.3 17.1l62.5 15.8-17.5 62c-2.4 8.4 0 17.4 6.1 23.5s15.1 8.5 23.5 6.1l62-17.5 15.8 62.5c2.1 8.4 8.7 15 17.1 17.3s17.3-.2 23.4-6.4l45-46.2 45 46.2c6.1 6.2 15 8.7 23.4 6.4s14.9-8.9 17.1-17.3l15.8-62.5 62 17.5c8.4 2.4 17.4 0 23.5-6.1s8.5-15.1 6.1-23.5l-17.5-62 62.5-15.8c8.4-2.1 15-8.7 17.3-17.1s-.2-17.4-6.4-23.4l-46.2-45 46.2-45c6.2-6.1 8.7-15 6.4-23.4s-8.9-14.9-17.3-17.1l-62.5-15.8 17.5-62c2.4-8.4 0-17.4-6.1-23.5s-15.1-8.5-23.5-6.1l-62 17.5L341.4 18.1c-2.1-8.4-8.7-15-17.1-17.3S307 1 301 7.3L256 53.5 211 7.3z"]
};
const faReplyAll = {
  prefix: 'fas',
  iconName: 'reply-all',
  icon: [576, 512, ["mail-reply-all"], "f122", "M209.4 39.5c-9.1-9.6-24.3-10-33.9-.9L33.8 173.2c-19.9 18.9-19.9 50.7 0 69.6L175.5 377.4c9.6 9.1 24.8 8.7 33.9-.9s8.7-24.8-.9-33.9L66.8 208 208.5 73.4c9.6-9.1 10-24.3 .9-33.9zM352 64c0-12.6-7.4-24.1-19-29.2s-25-3-34.4 5.4l-160 144c-6.7 6.1-10.6 14.7-10.6 23.8s3.9 17.7 10.6 23.8l160 144c9.4 8.5 22.9 10.6 34.4 5.4s19-16.6 19-29.2l0-64 32 0c53 0 96 43 96 96c0 30.4-12.8 47.9-22.2 56.7c-5.5 5.1-9.8 12-9.8 19.5c0 10.9 8.8 19.7 19.7 19.7c2.8 0 5.6-.6 8.1-1.9C494.5 467.9 576 417.3 576 304c0-97.2-78.8-176-176-176l-48 0 0-64z"]
};
const faMailReplyAll = faReplyAll;
const faSuitcase = {
  prefix: 'fas',
  iconName: 'suitcase',
  icon: [512, 512, [129523], "f0f2", "M176 56l0 40 160 0 0-40c0-4.4-3.6-8-8-8L184 48c-4.4 0-8 3.6-8 8zM128 96l0-40c0-30.9 25.1-56 56-56L328 0c30.9 0 56 25.1 56 56l0 40 0 32 0 352-256 0 0-352 0-32zM64 96l32 0 0 384-32 0c-35.3 0-64-28.7-64-64L0 160c0-35.3 28.7-64 64-64zM448 480l-32 0 0-384 32 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64z"]
};
const faPersonSkating = {
  prefix: 'fas',
  iconName: 'person-skating',
  icon: [448, 512, ["skating"], "f7c5", "M352 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM128 128c0-17.7 14.3-32 32-32l159.4 0c43.6 0 64.6 53.4 32.8 83.1l-74.4 69.4 60.2 60.2c9 9 14.1 21.2 14.1 33.9l0 73.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-66.7-77.9-77.8c-26.6-26.6-24.6-70.3 4.3-94.4l20.4-17L160 160c-17.7 0-32-14.3-32-32zM81.4 353.4l86.9-86.9c4.6 10 11 19.3 19.3 27.5l21.8 21.8-82.7 82.7c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3zm322.5 95.1c8.6 2.1 13.8 10.8 11.6 19.4l-.4 1.7c-6.2 24.9-28.6 42.4-54.3 42.4L272 512c-8.8 0-16-7.2-16-16s7.2-16 16-16l88.8 0c11 0 20.6-7.5 23.3-18.2l.4-1.7c2.1-8.6 10.8-13.8 19.4-11.6zM135.2 478.3l-6.2 3.1c-21.6 10.8-47.6 6.6-64.6-10.5L4.7 411.3c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l59.6 59.6c7.3 7.3 18.5 9.1 27.7 4.5l6.2-3.1c7.9-4 17.5-.7 21.5 7.2s.7 17.5-7.2 21.5z"]
};
const faSkating = faPersonSkating;
const faFilterCircleDollar = {
  prefix: 'fas',
  iconName: 'filter-circle-dollar',
  icon: [576, 512, ["funnel-dollar"], "f662", "M3.9 22.9C10.5 8.9 24.5 0 40 0L472 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L396.4 195.6C316.2 212.1 256 283 256 368c0 27.4 6.3 53.4 17.5 76.5c-1.6-.8-3.2-1.8-4.7-2.9l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 65.3C-.7 53.4-2.8 36.8 3.9 22.9zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm120.8-32.6c.6-.9 1.8-2.1 4.2-3.4c5.1-2.7 12.5-4.1 18.7-4c8.2 .1 17.1 1.8 26.4 4.1c8.6 2.1 17.3-3.1 19.4-11.7s-3.1-17.3-11.7-19.4c-5.6-1.4-11.6-2.7-17.9-3.7l0-9.4c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 9.5c-6.1 1.2-12.3 3.2-18 6.3c-11.8 6.3-23 18.4-21.8 37.2c1 16 11.7 25.3 21.6 30.7c8.8 4.7 19.7 7.8 28.6 10.3l1.8 .5c10.3 2.9 17.9 5.2 23.2 8.3c4.5 2.7 4.7 4.2 4.7 5.6c.1 2.4-.5 3.7-1 4.5c-.6 1-1.8 2.2-4 3.3c-4.7 2.5-11.8 3.8-18.5 3.6c-9.5-.3-18.5-3.1-29.9-6.8c-1.9-.6-3.8-1.2-5.8-1.8c-8.4-2.6-17.4 2.1-20 10.5s2.1 17.4 10.5 20c1.6 .5 3.3 1 5 1.6c0 0 0 0 0 0s0 0 0 0c7 2.3 15.1 4.8 23.7 6.6l0 11.4c0 8.8 7.2 16 16 16s16-7.2 16-16l0-10.8c6.2-1.1 12.5-3.1 18.3-6.2c12.1-6.5 22.3-18.7 21.7-36.9c-.5-16.2-10.3-26.3-20.5-32.3c-9.4-5.6-21.2-8.9-30.5-11.5l-.2 0c-10.4-2.9-18.3-5.2-23.9-8.2c-4.8-2.6-4.8-4-4.8-4.5c0 0 0 0 0-.1c-.1-1.9 .3-2.9 .8-3.6z"]
};
const faFunnelDollar = faFilterCircleDollar;
const faCameraRetro = {
  prefix: 'fas',
  iconName: 'camera-retro',
  icon: [512, 512, [128247], "f083", "M220.6 121.2L271.1 96 448 96l0 96-114.8 0c-21.9-15.1-48.5-24-77.2-24s-55.2 8.9-77.2 24L64 192l0-64 128 0c9.9 0 19.7-2.3 28.6-6.8zM0 128L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L271.1 32c-9.9 0-19.7 2.3-28.6 6.8L192 64l-32 0 0-16c0-8.8-7.2-16-16-16L80 32c-8.8 0-16 7.2-16 16l0 16C28.7 64 0 92.7 0 128zM168 304a88 88 0 1 1 176 0 88 88 0 1 1 -176 0z"]
};
const faCircleArrowDown = {
  prefix: 'fas',
  iconName: 'circle-arrow-down',
  icon: [512, 512, ["arrow-circle-down"], "f0ab", "M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM127 297c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l71 71L232 120c0-13.3 10.7-24 24-24s24 10.7 24 24l0 214.1 71-71c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 409c-9.4 9.4-24.6 9.4-33.9 0L127 297z"]
};
const faArrowCircleDown = faCircleArrowDown;
const faFileImport = {
  prefix: 'fas',
  iconName: 'file-import',
  icon: [512, 512, ["arrow-right-to-file"], "f56f", "M128 64c0-35.3 28.7-64 64-64L352 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64l-256 0c-35.3 0-64-28.7-64-64l0-112 174.1 0-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39L128 288l0-224zm0 224l0 48L24 336c-13.3 0-24-10.7-24-24s10.7-24 24-24l104 0zM512 128l-128 0L384 0 512 128z"]
};
const faArrowRightToFile = faFileImport;
const faSquareArrowUpRight = {
  prefix: 'fas',
  iconName: 'square-arrow-up-right',
  icon: [448, 512, ["external-link-square"], "f14c", "M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM160 144c-13.3 0-24 10.7-24 24s10.7 24 24 24l94.1 0L119 327c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135L288 328c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24l-152 0z"]
};
const faExternalLinkSquare = faSquareArrowUpRight;
const faBoxOpen = {
  prefix: 'fas',
  iconName: 'box-open',
  icon: [640, 512, [], "f49e", "M58.9 42.1c3-6.1 9.6-9.6 16.3-8.7L320 64 564.8 33.4c6.7-.8 13.3 2.7 16.3 8.7l41.7 83.4c9 17.9-.6 39.6-19.8 45.1L439.6 217.3c-13.9 4-28.8-1.9-36.2-14.3L320 64 236.6 203c-7.4 12.4-22.3 18.3-36.2 14.3L37.1 170.6c-19.3-5.5-28.8-27.2-19.8-45.1L58.9 42.1zM321.1 128l54.9 91.4c14.9 24.8 44.6 36.6 72.5 28.6L576 211.6l0 167c0 22-15 41.2-36.4 46.6l-204.1 51c-10.2 2.6-20.9 2.6-31 0l-204.1-51C79 419.7 64 400.5 64 378.5l0-167L191.6 248c27.8 8 57.6-3.8 72.5-28.6L318.9 128l2.2 0z"]
};
const faScroll = {
  prefix: 'fas',
  iconName: 'scroll',
  icon: [576, 512, [128220], "f70e", "M0 80l0 48c0 17.7 14.3 32 32 32l16 0 48 0 0-80c0-26.5-21.5-48-48-48S0 53.5 0 80zM112 32c10 13.4 16 30 16 48l0 304c0 35.3 28.7 64 64 64s64-28.7 64-64l0-5.3c0-32.4 26.3-58.7 58.7-58.7L480 320l0-192c0-53-43-96-96-96L112 32zM464 480c61.9 0 112-50.1 112-112c0-8.8-7.2-16-16-16l-245.3 0c-14.7 0-26.7 11.9-26.7 26.7l0 5.3c0 53-43 96-96 96l176 0 96 0z"]
};
const faSpa = {
  prefix: 'fas',
  iconName: 'spa',
  icon: [576, 512, [], "f5bb", "M183.1 235.3c33.7 20.7 62.9 48.1 85.8 80.5c7 9.9 13.4 20.3 19.1 31c5.7-10.8 12.1-21.1 19.1-31c22.9-32.4 52.1-59.8 85.8-80.5C437.6 207.8 490.1 192 546 192l9.9 0c11.1 0 20.1 9 20.1 20.1C576 360.1 456.1 480 308.1 480L288 480l-20.1 0C119.9 480 0 360.1 0 212.1C0 201 9 192 20.1 192l9.9 0c55.9 0 108.4 15.8 153.1 43.3zM301.5 37.6c15.7 16.9 61.1 71.8 84.4 164.6c-38 21.6-71.4 50.8-97.9 85.6c-26.5-34.8-59.9-63.9-97.9-85.6c23.2-92.8 68.6-147.7 84.4-164.6C278 33.9 282.9 32 288 32s10 1.9 13.5 5.6z"]
};
const faLocationPinLock = {
  prefix: 'fas',
  iconName: 'location-pin-lock',
  icon: [512, 512, [], "e51f", "M215.7 499.2c11-13.8 25.1-31.7 40.3-52.3l0-94.8c0-23.7 12.9-44.4 32-55.4l0-24.6c0-55.6 40.5-101.7 93.6-110.5C367 70 287.7 0 192 0C86 0 0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM400 240c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faPause = {
  prefix: 'fas',
  iconName: 'pause',
  icon: [320, 512, [9208], "f04c", "M48 64C21.5 64 0 85.5 0 112L0 400c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48L48 64zm192 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-32 0z"]
};
const faHillAvalanche = {
  prefix: 'fas',
  iconName: 'hill-avalanche',
  icon: [576, 512, [], "e507", "M439.7 401.9c34.2 23.1 81.1 19.5 111.4-10.8c34.4-34.4 34.4-90.1 0-124.4c-27.8-27.8-69.5-33.1-102.6-16c-11.8 6.1-16.4 20.6-10.3 32.3s20.6 16.4 32.3 10.3c15.1-7.8 34-5.3 46.6 7.3c15.6 15.6 15.6 40.9 0 56.6s-40.9 15.6-56.6 0l-81.7-81.7C401.2 261.3 416 236.4 416 208c0-33.9-21.1-62.9-50.9-74.5c1.9-6.8 2.9-14 2.9-21.5c0-44.2-35.8-80-80-80c-27.3 0-51.5 13.7-65.9 34.6C216.3 46.6 197.9 32 176 32c-26.5 0-48 21.5-48 48c0 4 .5 7.9 1.4 11.6L439.7 401.9zM480 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM68.3 87C43.1 61.8 0 79.7 0 115.3L0 432c0 44.2 35.8 80 80 80l316.7 0c35.6 0 53.5-43.1 28.3-68.3L68.3 87z"]
};
const faTemperatureEmpty = {
  prefix: 'fas',
  iconName: 'temperature-empty',
  icon: [320, 512, ["temperature-0", "thermometer-0", "thermometer-empty"], "f2cb", "M112 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 164.5c0 17.3 7.1 31.9 15.3 42.5C233.8 332.6 240 349.5 240 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9c8.2-10.6 15.3-25.2 15.3-42.5L112 112zM160 0C98.1 0 48 50.2 48 112l0 164.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C27.2 304.2 16 334.8 16 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6L272 112C272 50.2 221.9 0 160 0zm0 416a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faTemperature0 = faTemperatureEmpty;
const faThermometer0 = faTemperatureEmpty;
const faThermometerEmpty = faTemperatureEmpty;
const faBomb = {
  prefix: 'fas',
  iconName: 'bomb',
  icon: [512, 512, [128163], "f1e2", "M459.1 52.4L442.6 6.5C440.7 2.6 436.5 0 432.1 0s-8.5 2.6-10.4 6.5L405.2 52.4l-46 16.8c-4.3 1.6-7.3 5.9-7.2 10.4c0 4.5 3 8.7 7.2 10.2l45.7 16.8 16.8 45.8c1.5 4.4 5.8 7.5 10.4 7.5s8.9-3.1 10.4-7.5l16.5-45.8 45.7-16.8c4.2-1.5 7.2-5.7 7.2-10.2c0-4.6-3-8.9-7.2-10.4L459.1 52.4zm-132.4 53c-12.5-12.5-32.8-12.5-45.3 0l-2.9 2.9C256.5 100.3 232.7 96 208 96C93.1 96 0 189.1 0 304S93.1 512 208 512s208-93.1 208-208c0-24.7-4.3-48.5-12.2-70.5l2.9-2.9c12.5-12.5 12.5-32.8 0-45.3l-80-80zM200 192c-57.4 0-104 46.6-104 104l0 8c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-8c0-75.1 60.9-136 136-136l8 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-8 0z"]
};
const faRegistered = {
  prefix: 'fas',
  iconName: 'registered',
  icon: [512, 512, [174], "f25d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM160 152c0-13.3 10.7-24 24-24l88 0c44.2 0 80 35.8 80 80c0 28-14.4 52.7-36.3 67l34.1 75.1c5.5 12.1 .1 26.3-11.9 31.8s-26.3 .1-31.8-11.9L268.9 288 208 288l0 72c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-96 0-112zm48 88l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0 64z"]
};
const faAddressCard = {
  prefix: 'fas',
  iconName: 'address-card',
  icon: [576, 512, [62140, "contact-card", "vcard"], "f2bb", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm80 256l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L80 384c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm256-32l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faContactCard = faAddressCard;
const faVcard = faAddressCard;
const faScaleUnbalancedFlip = {
  prefix: 'fas',
  iconName: 'scale-unbalanced-flip',
  icon: [640, 512, ["balance-scale-right"], "f516", "M117.9 62.4c-16.8-5.6-25.8-23.7-20.2-40.5s23.7-25.8 40.5-20.2l113 37.7C265 15.8 290.7 0 320 0c44.2 0 80 35.8 80 80c0 3-.2 5.9-.5 8.8l122.6 40.9c16.8 5.6 25.8 23.7 20.2 40.5s-23.7 25.8-40.5 20.2L366.4 145.2c-4.5 3.2-9.3 5.9-14.4 8.2L352 480c0 17.7-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0 0-294.7c-21-9.2-37.2-27-44.2-49l-125.9-42zM200.4 288L128 163.8 55.6 288l144.9 0zM128 384C65.1 384 12.8 350 2 305.1c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1C243.2 350 190.9 384 128 384zm382.8-92.2L438.4 416l144.9 0L510.8 291.8zm126 141.3C626 478 573.7 512 510.8 512s-115.2-34-126-78.9c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1z"]
};
const faBalanceScaleRight = faScaleUnbalancedFlip;
const faSubscript = {
  prefix: 'fas',
  iconName: 'subscript',
  icon: [512, 512, [], "f12c", "M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64zM480 320c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 361.5 404.3 368 416 368l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128z"]
};
const faDiamondTurnRight = {
  prefix: 'fas',
  iconName: 'diamond-turn-right',
  icon: [512, 512, ["directions"], "f5eb", "M227.7 11.7c15.6-15.6 40.9-15.6 56.6 0l216 216c15.6 15.6 15.6 40.9 0 56.6l-216 216c-15.6 15.6-40.9 15.6-56.6 0l-216-216c-15.6-15.6-15.6-40.9 0-56.6l216-216zm87.6 137c-4.6-4.6-11.5-5.9-17.4-3.5s-9.9 8.3-9.9 14.8l0 56-64 0c-35.3 0-64 28.7-64 64l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48c0-8.8 7.2-16 16-16l64 0 0 56c0 6.5 3.9 12.3 9.9 14.8s12.9 1.1 17.4-3.5l80-80c6.2-6.2 6.2-16.4 0-22.6l-80-80z"]
};
const faDirections = faDiamondTurnRight;
const faBurst = {
  prefix: 'fas',
  iconName: 'burst',
  icon: [512, 512, [], "e4dc", "M37.6 4.2C28-2.3 15.2-1.1 7 7s-9.4 21-2.8 30.5l112 163.3L16.6 233.2C6.7 236.4 0 245.6 0 256s6.7 19.6 16.6 22.8l103.1 33.4L66.8 412.8c-4.9 9.3-3.2 20.7 4.3 28.1s18.8 9.2 28.1 4.3l100.6-52.9 33.4 103.1c3.2 9.9 12.4 16.6 22.8 16.6s19.6-6.7 22.8-16.6l33.4-103.1 100.6 52.9c9.3 4.9 20.7 3.2 28.1-4.3s9.2-18.8 4.3-28.1L392.3 312.2l103.1-33.4c9.9-3.2 16.6-12.4 16.6-22.8s-6.7-19.6-16.6-22.8L388.9 198.7l25.7-70.4c3.2-8.8 1-18.6-5.6-25.2s-16.4-8.8-25.2-5.6l-70.4 25.7L278.8 16.6C275.6 6.7 266.4 0 256 0s-19.6 6.7-22.8 16.6l-32.3 99.6L37.6 4.2z"]
};
const faHouseLaptop = {
  prefix: 'fas',
  iconName: 'house-laptop',
  icon: [640, 512, ["laptop-house"], "e066", "M218.3 8.5c12.3-11.3 31.2-11.3 43.4 0l208 192c6.7 6.2 10.3 14.8 10.3 23.5l-144 0c-19.1 0-36.3 8.4-48 21.7l0-37.7c0-8.8-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l64 0 0 128-160 0c-26.5 0-48-21.5-48-48l0-112-32 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8.1-35.2l208-192zM352 304l0 144 192 0 0-144-192 0zm-48-16c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32l0 160 32 0c8.8 0 16 7.2 16 16c0 26.5-21.5 48-48 48l-48 0-192 0-48 0c-26.5 0-48-21.5-48-48c0-8.8 7.2-16 16-16l32 0 0-160z"]
};
const faLaptopHouse = faHouseLaptop;
const faFaceTired = {
  prefix: 'fas',
  iconName: 'face-tired',
  icon: [512, 512, [128555, "tired"], "f5c8", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.7 328.7c22-22 53.9-40.7 91.3-40.7s69.3 18.7 91.3 40.7c11.1 11.1 20.1 23.4 26.4 35.4c6.2 11.7 10.3 24.4 10.3 35.9c0 5.2-2.6 10.2-6.9 13.2s-9.8 3.7-14.7 1.8l-20.5-7.7c-26.9-10.1-55.5-15.3-84.3-15.3l-3.2 0c-28.8 0-57.3 5.2-84.3 15.3L149.6 415c-4.9 1.8-10.4 1.2-14.7-1.8s-6.9-7.9-6.9-13.2c0-11.6 4.2-24.2 10.3-35.9c6.3-12 15.3-24.3 26.4-35.4zm-31.2-182l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 157.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
};
const faTired = faFaceTired;
const faMoneyBills = {
  prefix: 'fas',
  iconName: 'money-bills',
  icon: [640, 512, [], "e1f3", "M96 96l0 224c0 35.3 28.7 64 64 64l416 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32c-35.3 0-64 28.7-64 64zm64 160c35.3 0 64 28.7 64 64l-64 0 0-64zM224 96c0 35.3-28.7 64-64 64l0-64 64 0zM576 256l0 64-64 0c0-35.3 28.7-64 64-64zM512 96l64 0 0 64c-35.3 0-64-28.7-64-64zM288 208a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 360c0 66.3 53.7 120 120 120l400 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-400 0c-39.8 0-72-32.2-72-72l0-240z"]
};
const faSmog = {
  prefix: 'fas',
  iconName: 'smog',
  icon: [640, 512, [], "f75f", "M32 144c0 79.5 64.5 144 144 144l123.3 0c22.6 19.9 52.2 32 84.7 32s62.1-12.1 84.7-32l27.3 0c61.9 0 112-50.1 112-112s-50.1-112-112-112c-10.7 0-21 1.5-30.8 4.3C443.8 27.7 401.1 0 352 0c-32.6 0-62.4 12.2-85.1 32.3C242.1 12.1 210.5 0 176 0C96.5 0 32 64.5 32 144zM616 368l-336 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24zm-64 96l-112 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24zm-192 0L24 464c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24zM224 392c0-13.3-10.7-24-24-24L96 368c-13.3 0-24 10.7-24 24s10.7 24 24 24l104 0c13.3 0 24-10.7 24-24z"]
};
const faCrutch = {
  prefix: 'fas',
  iconName: 'crutch',
  icon: [512, 512, [], "f7f7", "M297.4 9.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0zm-96 144l-34.8 34.8c-12.9 12.9-21.9 29.2-25.8 47.1L116.8 342.9c-1.3 5.9-4.3 11.4-8.6 15.7L9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l98.8-98.8c4.3-4.3 9.7-7.3 15.7-8.6l107.6-23.9c17.8-4 34.1-12.9 47.1-25.8l34.7-34.7c0 0 .1-.1 .1-.1s.1-.1 .1-.1l74.6-74.6-45.3-45.3L336 242.7 269.3 176l52.1-52.1L276.1 78.6l-74.7 74.7zM224 221.3L290.7 288l-12.2 12.2c-4.3 4.3-9.7 7.3-15.7 8.6l-76.7 17 17-76.7c1.3-5.9 4.3-11.4 8.6-15.7L224 221.3z"]
};
const faFontAwesome = {
  prefix: 'fas',
  iconName: 'font-awesome',
  icon: [512, 512, [62501, 62694, "font-awesome-flag", "font-awesome-logo-full"], "f2b4", "M91.7 96C106.3 86.8 116 70.5 116 52C116 23.3 92.7 0 64 0S12 23.3 12 52c0 16.7 7.8 31.5 20 41l0 3 0 352 0 64 64 0 0-64 373.6 0c14.6 0 26.4-11.8 26.4-26.4c0-3.7-.8-7.3-2.3-10.7L432 272l61.7-138.9c1.5-3.4 2.3-7 2.3-10.7c0-14.6-11.8-26.4-26.4-26.4L91.7 96z"]
};
const faFontAwesomeFlag = faFontAwesome;
const faFontAwesomeLogoFull = faFontAwesome;
const faCloudArrowUp = {
  prefix: 'fas',
  iconName: 'cloud-arrow-up',
  icon: [640, 512, [62338, "cloud-upload", "cloud-upload-alt"], "f0ee", "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-217c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39L296 392c0 13.3 10.7 24 24 24s24-10.7 24-24l0-134.1 39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0l-80 80z"]
};
const faCloudUpload = faCloudArrowUp;
const faCloudUploadAlt = faCloudArrowUp;
const faPalette = {
  prefix: 'fas',
  iconName: 'palette',
  icon: [512, 512, [127912], "f53f", "M512 256c0 .9 0 1.8 0 2.7c-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48c0 3.4 .4 6.7 1 9.9c2.1 10.2 6.5 20 10.8 29.9c6.1 13.8 12.1 27.5 12.1 42c0 31.8-21.6 60.7-53.4 62c-3.5 .1-7 .2-10.6 .2C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faArrowsTurnRight = {
  prefix: 'fas',
  iconName: 'arrows-turn-right',
  icon: [448, 512, [], "e4c0", "M297.4 9.4c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L338.7 160 128 160c-35.3 0-64 28.7-64 64l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32C0 153.3 57.3 96 128 96l210.7 0L297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3zm-96 256c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 416 96 416c-17.7 0-32 14.3-32 32l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-53 43-96 96-96l146.7 0-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3z"]
};
const faVest = {
  prefix: 'fas',
  iconName: 'vest',
  icon: [448, 512, [], "e085", "M207.1 237.4L151.2 69.7C168.6 79.7 192.6 88 224 88s55.4-8.3 72.8-18.3L226.5 280.6c-1.6 4.9-2.5 10-2.5 15.2L224 464c0 26.5 21.5 48 48 48l128 0c26.5 0 48-21.5 48-48l0-193.5c0-9.5-2.8-18.7-8.1-26.6l-47.9-71.8c-5.3-7.9-8.1-17.1-8.1-26.6l0-17.5 0-73.7 0-6.3c0-26.5-21.5-48-48-48l-4.5 0c-.2 0-.4 0-.6 0c-.4 0-.8 0-1.2 0C311 0 295.7 9.7 285.7 18.8C276.4 27.2 257.2 40 224 40s-52.4-12.8-61.7-21.2C152.3 9.7 137 0 118.3 0c-.4 0-.8 0-1.2 0c-.2 0-.4 0-.6 0L112 0C85.5 0 64 21.5 64 48l0 6.3L64 128l0 17.5c0 9.5-2.8 18.7-8.1 26.6L8.1 243.9C2.8 251.8 0 261.1 0 270.5L0 464c0 26.5 21.5 48 48 48l128 0c9.9 0 19-3 26.7-8.1C195.9 492.2 192 478.5 192 464l0-168.2c0-8.6 1.4-17.1 4.1-25.3l11-33.1zM347.3 356.7l48 48c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-48-48c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0zm-294.6 48l48-48c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-48 48c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6z"]
};
const faFerry = {
  prefix: 'fas',
  iconName: 'ferry',
  icon: [576, 512, [], "e4ea", "M224 0L352 0c17.7 0 32 14.3 32 32l75.1 0c20.6 0 31.6 24.3 18.1 39.8L456 96 120 96 98.8 71.8C85.3 56.3 96.3 32 116.9 32L192 32c0-17.7 14.3-32 32-32zM96 128l384 0c17.7 0 32 14.3 32 32l0 123.5c0 13.3-4.2 26.3-11.9 37.2l-51.4 71.9c-1.9 1.1-3.7 2.2-5.5 3.5c-15.5 10.7-34 18-51 19.9l-16.5 0c-17.1-1.8-35-9-50.8-19.9c-22.1-15.5-51.6-15.5-73.7 0c-14.8 10.2-32.5 18-50.6 19.9l-16.6 0c-17-1.8-35.6-9.2-51-19.9c-1.8-1.3-3.7-2.4-5.6-3.5L75.9 320.7C68.2 309.8 64 296.8 64 283.5L64 160c0-17.7 14.3-32 32-32zm32 64l0 96 320 0 0-96-320 0zM306.5 421.9C329 437.4 356.5 448 384 448c26.9 0 55.3-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 501.7 417 512 384 512c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 437.2 165.1 448 192 448c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faArrowsDownToPeople = {
  prefix: 'fas',
  iconName: 'arrows-down-to-people',
  icon: [640, 512, [], "e4b9", "M144 0c-13.3 0-24 10.7-24 24l0 118.1L97 119c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0l64-64c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-23 23L168 24c0-13.3-10.7-24-24-24zM360 200a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zM184 296a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm312 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM200 441.5l26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-36.3-67.5c1.7-1.7 3.2-3.6 4.3-5.8L264 345.5l0 54.5c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-54.5 26.9 49.9c1.2 2.2 2.6 4.1 4.3 5.8l-36.3 67.5c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L440 441.5l0 38.5c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-38.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-16.3 0-31.9 4.5-45.4 12.6l-33.6-62.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3l-33.6 62.3c-13.5-8.1-29.1-12.6-45.4-12.6l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3L18.9 468.6c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L88 441.5 88 480c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-38.5zM415 153l64 64c9.4 9.4 24.6 9.4 33.9 0l64-64c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-23 23L520 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 118.1-23-23c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z"]
};
const faSeedling = {
  prefix: 'fas',
  iconName: 'seedling',
  icon: [512, 512, [127793, "sprout"], "f4d8", "M512 32c0 113.6-84.6 207.5-194.2 222c-7.1-53.4-30.6-101.6-65.3-139.3C290.8 46.3 364 0 448 0l32 0c17.7 0 32 14.3 32 32zM0 96C0 78.3 14.3 64 32 64l32 0c123.7 0 224 100.3 224 224l0 32 0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160C100.3 320 0 219.7 0 96z"]
};
const faSprout = faSeedling;
const faLeftRight = {
  prefix: 'fas',
  iconName: 'left-right',
  icon: [512, 512, [8596, "arrows-alt-h"], "f337", "M504.3 273.6c4.9-4.5 7.7-10.9 7.7-17.6s-2.8-13-7.7-17.6l-112-104c-7-6.5-17.2-8.2-25.9-4.4s-14.4 12.5-14.4 22l0 56-192 0 0-56c0-9.5-5.7-18.2-14.4-22s-18.9-2.1-25.9 4.4l-112 104C2.8 243 0 249.3 0 256s2.8 13 7.7 17.6l112 104c7 6.5 17.2 8.2 25.9 4.4s14.4-12.5 14.4-22l0-56 192 0 0 56c0 9.5 5.7 18.2 14.4 22s18.9 2.1 25.9-4.4l112-104z"]
};
const faArrowsAltH = faLeftRight;
const faBoxesPacking = {
  prefix: 'fas',
  iconName: 'boxes-packing',
  icon: [640, 512, [], "e4c7", "M256 48c0-26.5 21.5-48 48-48L592 0c26.5 0 48 21.5 48 48l0 416c0 26.5-21.5 48-48 48l-210.7 0c1.8-5 2.7-10.4 2.7-16l0-242.7c18.6-6.6 32-24.4 32-45.3l0-32c0-26.5-21.5-48-48-48l-112 0 0-80zM571.3 347.3c6.2-6.2 6.2-16.4 0-22.6l-64-64c-6.2-6.2-16.4-6.2-22.6 0l-64 64c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L480 310.6 480 432c0 8.8 7.2 16 16 16s16-7.2 16-16l0-121.4 36.7 36.7c6.2 6.2 16.4 6.2 22.6 0zM0 176c0-8.8 7.2-16 16-16l352 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16L16 224c-8.8 0-16-7.2-16-16l0-32zm352 80l0 224c0 17.7-14.3 32-32 32L64 512c-17.7 0-32-14.3-32-32l0-224 320 0zM144 320c-8.8 0-16 7.2-16 16s7.2 16 16 16l96 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-96 0z"]
};
const faCircleArrowLeft = {
  prefix: 'fas',
  iconName: 'circle-arrow-left',
  icon: [512, 512, ["arrow-circle-left"], "f0a8", "M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM215 127c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-71 71L392 232c13.3 0 24 10.7 24 24s-10.7 24-24 24l-214.1 0 71 71c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L103 273c-9.4-9.4-9.4-24.6 0-33.9L215 127z"]
};
const faArrowCircleLeft = faCircleArrowLeft;
const faGroupArrowsRotate = {
  prefix: 'fas',
  iconName: 'group-arrows-rotate',
  icon: [512, 512, [], "e4f6", "M201.1 71.9c16.9-5 26.6-22.9 21.5-39.8s-22.9-26.6-39.8-21.5c-21.5 6.4-41.8 15.5-60.6 27C114.3 34 105.4 32 96 32C60.7 32 32 60.7 32 96c0 9.4 2 18.3 5.6 26.3c-11.5 18.7-20.6 39-27 60.6c-5 16.9 4.6 34.8 21.5 39.8s34.8-4.6 39.8-21.5c4.3-14.6 10.4-28.5 17.9-41.4c2 .2 4.1 .3 6.1 .3c35.3 0 64-28.7 64-64c0-2.1-.1-4.1-.3-6.1c12.9-7.5 26.8-13.6 41.4-17.9zm128-61.3c-16.9-5-34.8 4.6-39.8 21.5s4.6 34.8 21.5 39.8c14.6 4.3 28.5 10.4 41.4 17.9c-.2 2-.3 4.1-.3 6.1c0 35.3 28.7 64 64 64c2.1 0 4.1-.1 6.2-.3c7.5 12.9 13.6 26.8 17.9 41.4c5 16.9 22.9 26.6 39.8 21.5s26.6-22.9 21.5-39.8c-6.4-21.5-15.5-41.8-27-60.6c3.6-8 5.6-16.9 5.6-26.3c0-35.3-28.7-64-64-64c-9.4 0-18.3 2-26.3 5.6c-18.7-11.5-39-20.6-60.6-27zM71.9 310.9c-5-16.9-22.9-26.6-39.8-21.5s-26.6 22.9-21.5 39.8c6.4 21.5 15.5 41.8 27 60.6C34 397.7 32 406.6 32 416c0 35.3 28.7 64 64 64c9.4 0 18.3-2 26.3-5.6c18.7 11.5 39 20.6 60.6 27c16.9 5 34.8-4.6 39.8-21.5s-4.6-34.8-21.5-39.8c-14.6-4.3-28.5-10.4-41.4-17.9c.2-2 .3-4.1 .3-6.2c0-35.3-28.7-64-64-64c-2.1 0-4.1 .1-6.2 .3c-7.5-12.9-13.6-26.8-17.9-41.4zm429.4 18.3c5-16.9-4.6-34.8-21.5-39.8s-34.8 4.6-39.8 21.5c-4.3 14.6-10.4 28.5-17.9 41.4c-2-.2-4.1-.3-6.2-.3c-35.3 0-64 28.7-64 64c0 2.1 .1 4.1 .3 6.2c-12.9 7.5-26.8 13.6-41.4 17.9c-16.9 5-26.6 22.9-21.5 39.8s22.9 26.6 39.8 21.5c21.5-6.4 41.8-15.5 60.6-27c8 3.6 16.9 5.6 26.3 5.6c35.3 0 64-28.7 64-64c0-9.4-2-18.3-5.6-26.3c11.5-18.7 20.6-39 27-60.6zM192.8 256.8c0-15.6 5.6-29.9 14.9-41.1L223 231c6.6 6.6 17.8 1.9 17.8-7.4l0-60.5c0-5.7-4.7-10.4-10.4-10.4l-60.5 0c-9.3 0-13.9 11.2-7.4 17.8l11.2 11.2c-17.9 19.8-28.9 46.2-28.9 75.1c0 43.6 24.9 81.3 61.1 99.8c11.8 6 26.3 1.4 32.3-10.4s1.4-26.3-10.4-32.3c-20.8-10.6-34.9-32.2-34.9-57zm93.1-58.6c20.8 10.6 34.9 32.2 34.9 57c0 15.6-5.6 29.9-14.9 41.1L290.6 281c-6.6-6.6-17.8-1.9-17.8 7.4l0 60.5c0 5.7 4.7 10.4 10.4 10.4l60.5 0c9.3 0 13.9-11.2 7.4-17.8l-11.2-11.2c17.9-19.8 28.9-46.2 28.9-75.1c0-43.6-24.9-81.3-61.1-99.8c-11.8-6-26.3-1.4-32.3 10.4s-1.4 26.3 10.4 32.3z"]
};
const faBowlFood = {
  prefix: 'fas',
  iconName: 'bowl-food',
  icon: [512, 512, [], "e4c6", "M0 192c0-35.3 28.7-64 64-64c.5 0 1.1 0 1.6 0C73 91.5 105.3 64 144 64c15 0 29 4.1 40.9 11.2C198.2 49.6 225.1 32 256 32s57.8 17.6 71.1 43.2C339 68.1 353 64 368 64c38.7 0 71 27.5 78.4 64c.5 0 1.1 0 1.6 0c35.3 0 64 28.7 64 64c0 11.7-3.1 22.6-8.6 32L8.6 224C3.1 214.6 0 203.7 0 192zm0 91.4C0 268.3 12.3 256 27.4 256l457.1 0c15.1 0 27.4 12.3 27.4 27.4c0 70.5-44.4 130.7-106.7 154.1L403.5 452c-2 16-15.6 28-31.8 28l-231.5 0c-16.1 0-29.8-12-31.8-28l-1.8-14.4C44.4 414.1 0 353.9 0 283.4z"]
};
const faCandyCane = {
  prefix: 'fas',
  iconName: 'candy-cane',
  icon: [512, 512, [], "f786", "M348.8 131.5c3.7-2.3 7.9-3.5 12.2-3.5c12.7 0 23 10.3 23 23l0 5.6c0 9.9-5.1 19.1-13.5 24.3L30.1 393.7C.1 412.5-9 451.9 9.7 481.9s58.2 39.1 88.2 20.4L438.4 289.5c45.8-28.6 73.6-78.8 73.6-132.8l0-5.6C512 67.6 444.4 0 361 0c-28.3 0-56 8-80.1 23L254.1 39.7c-30 18.7-39.1 58.2-20.4 88.2s58.2 39.1 88.2 20.4l26.8-16.8zM298.4 49.8c9.2-5.7 19.1-10.1 29.4-13.1L348 97.5c-5.7 1.4-11.2 3.7-16.3 6.8l-12.6 7.9L298.4 49.8zm88.5 52.7l46.2-46.2c8.5 6.5 16.1 14.1 22.6 22.6l-46.2 46.2c-5.1-9.6-13-17.5-22.6-22.6zm28.9 59.3l61.6 20.5c-2.2 10.5-5.8 20.7-10.5 30.2l-62-20.7c6.2-8.8 10.1-19.1 11-30.1zm-86.1 82.5l60.4 37.7-30.2 18.9-60.4-37.7 30.2-18.9zm-107.2 67l60.4 37.7-30.2 18.9-60.4-37.7 30.2-18.9zM119.3 375.7l60.4 37.7-30.2 18.9L89.1 394.6l30.2-18.9z"]
};
const faArrowDownWideShort = {
  prefix: 'fas',
  iconName: 'arrow-down-wide-short',
  icon: [576, 512, ["sort-amount-asc", "sort-amount-down"], "f160", "M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L320 96z"]
};
const faSortAmountAsc = faArrowDownWideShort;
const faSortAmountDown = faArrowDownWideShort;
const faCloudBolt = {
  prefix: 'fas',
  iconName: 'cloud-bolt',
  icon: [512, 512, [127785, "thunderstorm"], "f76c", "M0 224c0 53 43 96 96 96l47.2 0L290 202.5c17.6-14.1 42.6-14 60.2 .2s22.8 38.6 12.8 58.8L333.7 320l18.3 0 64 0c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0c1.1-5.2 1.6-10.5 1.6-16c0-44.2-35.8-80-80-80c-24.3 0-46.1 10.9-60.8 28C256.5 24.3 219.1 0 176 0C114.1 0 64 50.1 64 112c0 7.1 .7 14.1 1.9 20.8C27.6 145.4 0 181.5 0 224zm330.1 3.6c-5.8-4.7-14.2-4.7-20.1-.1l-160 128c-5.3 4.2-7.4 11.4-5.1 17.8s8.3 10.7 15.1 10.7l70.1 0L177.7 488.8c-3.4 6.7-1.6 14.9 4.3 19.6s14.2 4.7 20.1 .1l160-128c5.3-4.2 7.4-11.4 5.1-17.8s-8.3-10.7-15.1-10.7l-70.1 0 52.4-104.8c3.4-6.7 1.6-14.9-4.2-19.6z"]
};
const faThunderstorm = faCloudBolt;
const faTextSlash = {
  prefix: 'fas',
  iconName: 'text-slash',
  icon: [640, 512, ["remove-format"], "f87d", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L355.7 253.5 400.2 96 503 96 497 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C577.6 61.3 554.7 32 523.5 32L376.1 32l-.3 0L204.5 32c-22 0-41.2 15-46.6 36.4l-6.3 25.2L38.8 5.1zm168 131.7c.1-.3 .2-.7 .3-1L217 96l116.7 0L301.3 210.8l-94.5-74.1zM243.3 416L192 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-42.2 0 17.6-62.1L272.9 311 243.3 416z"]
};
const faRemoveFormat = faTextSlash;
const faFaceSmileWink = {
  prefix: 'fas',
  iconName: 'face-smile-wink',
  icon: [512, 512, [128521, "smile-wink"], "f4da", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm156.4 25.6c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2c-17.6-23.5-52.8-23.5-70.4 0z"]
};
const faSmileWink = faFaceSmileWink;
const faFileWord = {
  prefix: 'fas',
  iconName: 'file-word',
  icon: [384, 512, [], "f1c2", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM111 257.1l26.8 89.2 31.6-90.3c3.4-9.6 12.5-16.1 22.7-16.1s19.3 6.4 22.7 16.1l31.6 90.3L273 257.1c3.8-12.7 17.2-19.9 29.9-16.1s19.9 17.2 16.1 29.9l-48 160c-3 10-12 16.9-22.4 17.1s-19.8-6.2-23.2-16.1L192 336.6l-33.3 95.3c-3.4 9.8-12.8 16.3-23.2 16.1s-19.5-7.1-22.4-17.1l-48-160c-3.8-12.7 3.4-26.1 16.1-29.9s26.1 3.4 29.9 16.1z"]
};
const faFilePowerpoint = {
  prefix: 'fas',
  iconName: 'file-powerpoint',
  icon: [384, 512, [], "f1c4", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM136 240l68 0c42 0 76 34 76 76s-34 76-76 76l-44 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-56 0-104c0-13.3 10.7-24 24-24zm68 104c15.5 0 28-12.5 28-28s-12.5-28-28-28l-44 0 0 56 44 0z"]
};
const faArrowsLeftRight = {
  prefix: 'fas',
  iconName: 'arrows-left-right',
  icon: [512, 512, ["arrows-h"], "f07e", "M406.6 374.6l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224l-293.5 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288l293.5 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"]
};
const faArrowsH = faArrowsLeftRight;
const faHouseLock = {
  prefix: 'fas',
  iconName: 'house-lock',
  icon: [640, 512, [], "e510", "M384 480c0 11.7 3.1 22.6 8.6 32l-.6 0c-22.1 0-40-17.9-40-40l0-24 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L490.7 166.3C447.2 181.7 416 223.2 416 272l0 24.6c-19.1 11.1-32 31.7-32 55.4l0 128zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faCloudArrowDown = {
  prefix: 'fas',
  iconName: 'cloud-arrow-down',
  icon: [640, 512, [62337, "cloud-download", "cloud-download-alt"], "f0ed", "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z"]
};
const faCloudDownload = faCloudArrowDown;
const faCloudDownloadAlt = faCloudArrowDown;
const faChildren = {
  prefix: 'fas',
  iconName: 'children',
  icon: [640, 512, [], "e4e1", "M160 0a64 64 0 1 1 0 128A64 64 0 1 1 160 0zM88 480l0-80-17.8 0c-10.9 0-18.6-10.7-15.2-21.1l31.1-93.4L57.5 323.3c-10.7 14.1-30.8 16.8-44.8 6.2s-16.8-30.7-6.2-44.8L65.4 207c22.4-29.6 57.5-47 94.6-47s72.2 17.4 94.6 47l58.9 77.7c10.7 14.1 7.9 34.2-6.2 44.8s-34.2 7.9-44.8-6.2l-28.6-37.8L265 378.9c3.5 10.4-4.3 21.1-15.2 21.1L232 400l0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-80-16 0 0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32zM480 0a64 64 0 1 1 0 128A64 64 0 1 1 480 0zm-8 384l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-179.5L395.1 321c-9.4 15-29.2 19.4-44.1 10s-19.4-29.2-10-44.1l51.7-82.1c17.6-27.9 48.3-44.9 81.2-44.9l12.3 0c33 0 63.7 16.9 81.2 44.9L619.1 287c9.4 15 4.9 34.7-10 44.1s-34.7 4.9-44.1-10L552 300.5 552 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-16 0z"]
};
const faChalkboard = {
  prefix: 'fas',
  iconName: 'chalkboard',
  icon: [576, 512, ["blackboard"], "f51b", "M96 32C60.7 32 32 60.7 32 96l0 288 64 0L96 96l384 0 0 288 64 0 0-288c0-35.3-28.7-64-64-64L96 32zM224 384l0 32L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-128 0 0-32c0-17.7-14.3-32-32-32l-128 0c-17.7 0-32 14.3-32 32z"]
};
const faBlackboard = faChalkboard;
const faUserLargeSlash = {
  prefix: 'fas',
  iconName: 'user-large-slash',
  icon: [640, 512, ["user-alt-slash"], "f4fa", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L381.9 274c48.5-23.2 82.1-72.7 82.1-130C464 64.5 399.5 0 320 0C250.4 0 192.4 49.3 178.9 114.9L38.8 5.1zM545.5 512L528 512 284.3 320l-59 0C136.2 320 64 392.2 64 481.3c0 17 13.8 30.7 30.7 30.7l450.6 0 .3 0z"]
};
const faUserAltSlash = faUserLargeSlash;
const faEnvelopeOpen = {
  prefix: 'fas',
  iconName: 'envelope-open',
  icon: [512, 512, [62135], "f2b6", "M64 208.1L256 65.9 448 208.1l0 47.4L289.5 373c-9.7 7.2-21.4 11-33.5 11s-23.8-3.9-33.5-11L64 255.5l0-47.4zM256 0c-12.1 0-23.8 3.9-33.5 11L25.9 156.7C9.6 168.8 0 187.8 0 208.1L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-239.9c0-20.3-9.6-39.4-25.9-51.4L289.5 11C279.8 3.9 268.1 0 256 0z"]
};
const faHandshakeSimpleSlash = {
  prefix: 'fas',
  iconName: 'handshake-simple-slash',
  icon: [640, 512, ["handshake-alt-slash"], "e05f", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-135-105.8c-1.1-11.4-6.3-22.3-15.3-30.7l-134.2-123-23.4 18.2-26-20.3 77.2-60.1c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L550.2 352l41.8 0c26.5 0 48-21.5 48-48l0-128c0-26.5-21.5-48-48-48l-76 0-4 0-.7 0-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2l-89.7 72.6-25.8-20.3 81.8-66.2c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-35.5 23.7L38.8 5.1zM0 176L0 304c0 26.5 21.5 48 48 48l108.2 0 91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c.8-.8 1.5-1.7 2.2-2.6L41.2 128.5C17.9 131.8 0 151.8 0 176z"]
};
const faHandshakeAltSlash = faHandshakeSimpleSlash;
const faMattressPillow = {
  prefix: 'fas',
  iconName: 'mattress-pillow',
  icon: [640, 512, [], "e525", "M256 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l192 0 0-384zm32 384l288 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L288 64l0 384zM64 160c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 192c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-192z"]
};
const faGuaraniSign = {
  prefix: 'fas',
  iconName: 'guarani-sign',
  icon: [384, 512, [], "e19a", "M192 0c-17.7 0-32 14.3-32 32l0 34.7C69.2 81.9 0 160.9 0 256s69.2 174.1 160 189.3l0 34.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-34.7c90.8-15.2 160-94.2 160-189.3c0-17.7-14.3-32-32-32l-128 0 0-92c22.1 5.7 41.8 17.1 57.6 32.6c12.6 12.4 32.9 12.2 45.3-.4s12.2-32.9-.5-45.3C299 92 263.5 73.3 224 66.7L224 32c0-17.7-14.3-32-32-32zM160 132L160 380c-55.2-14.2-96-64.3-96-124s40.8-109.8 96-124zM224 380l0-92 92 0c-11.6 45-47 80.4-92 92z"]
};
const faArrowsRotate = {
  prefix: 'fas',
  iconName: 'arrows-rotate',
  icon: [512, 512, [128472, "refresh", "sync"], "f021", "M105.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L386.3 160 352 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l111.5 0c0 0 0 0 0 0l.4 0c17.7 0 32-14.3 32-32l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 35.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM39 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1L16 432c0 17.7 14.3 32 32 32s32-14.3 32-32l0-35.1 17.6 17.5c0 0 0 0 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.8c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L125.6 352l34.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48.4 288c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"]
};
const faRefresh = faArrowsRotate;
const faSync = faArrowsRotate;
const faFireExtinguisher = {
  prefix: 'fas',
  iconName: 'fire-extinguisher',
  icon: [512, 512, [129519], "f134", "M500.3 7.3C507.7 13.3 512 22.4 512 32l0 96c0 9.6-4.3 18.7-11.7 24.7s-17.2 8.5-26.6 6.6l-160-32C301.5 124.9 292 115.7 289 104l-65 0 0 34.8c37.8 18 64 56.5 64 101.2l0 144L64 384l0-144c0-44.7 26.2-83.2 64-101.2l0-28.8c-36.2 11.1-66 36.9-82.3 70.5c-5.8 11.9-20.2 16.9-32.1 11.1S-3.3 171.4 2.5 159.5C26.7 109.8 72.7 72.6 128 60.4L128 32c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 24 65 0c3-11.7 12.5-20.9 24.7-23.4l160-32c9.4-1.9 19.1 .6 26.6 6.6zM288 416l0 32c0 35.3-28.7 64-64 64l-96 0c-35.3 0-64-28.7-64-64l0-32 224 0zM176 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faCruzeiroSign = {
  prefix: 'fas',
  iconName: 'cruzeiro-sign',
  icon: [448, 512, [], "e152", "M96 256c0-88.4 71.6-160 160-160c41 0 78.3 15.4 106.7 40.7c13.2 11.8 33.4 10.7 45.2-2.5s10.7-33.4-2.5-45.2c-39.6-35.5-92-57-149.3-57C132.3 32 32 132.3 32 256s100.3 224 224 224c57.4 0 109.7-21.6 149.3-57c13.2-11.8 14.3-32 2.5-45.2s-32-14.3-45.2-2.5C334.3 400.6 297 416 256 416l0-96 0-8.7c0-12.8 10.4-23.3 23.3-23.3c4.6 0 9.1 1.4 12.9 3.9l10.1 6.7c14.7 9.8 34.6 5.8 44.4-8.9s5.8-34.6-8.9-44.4l-10.1-6.7c-14.3-9.6-31.2-14.7-48.4-14.7c-12.4 0-24.2 2.6-34.9 7.3c-5.5-4.5-12.6-7.3-20.3-7.3c-17.7 0-32 14.3-32 32l0 55.3 0 8.7 0 82.7C135.5 378 96 321.6 96 256z"]
};
const faGreaterThanEqual = {
  prefix: 'fas',
  iconName: 'greater-than-equal',
  icon: [448, 512, [], "f532", "M52.1 93.7C35.7 87.1 27.7 68.5 34.3 52.1s25.2-24.4 41.6-17.8l320 128C408 167.1 416 178.9 416 192s-8 24.9-20.1 29.7l-320 128c-16.4 6.6-35-1.4-41.6-17.8s1.4-35 17.8-41.6L297.8 192 52.1 93.7zM416 416c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0z"]
};
const faShieldHalved = {
  prefix: 'fas',
  iconName: 'shield-halved',
  icon: [512, 512, ["shield-alt"], "f3ed", "M256 0c4.6 0 9.2 1 13.4 2.9L457.7 82.8c22 9.3 38.4 31 38.3 57.2c-.5 99.2-41.3 280.7-213.6 363.2c-16.7 8-36.1 8-52.8 0C57.3 420.7 16.5 239.2 16 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.8 1 251.4 0 256 0zm0 66.8l0 378.1C394 378 431.1 230.1 432 141.4L256 66.8s0 0 0 0z"]
};
const faShieldAlt = faShieldHalved;
const faBookAtlas = {
  prefix: 'fas',
  iconName: 'book-atlas',
  icon: [448, 512, ["atlas"], "f558", "M0 96C0 43 43 0 96 0L384 0l32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32zM247.4 283.8c-3.7 3.7-6.2 4.2-7.4 4.2s-3.7-.5-7.4-4.2c-3.8-3.7-8-10-11.8-18.9c-6.2-14.5-10.8-34.3-12.2-56.9l63 0c-1.5 22.6-6 42.4-12.2 56.9c-3.8 8.9-8 15.2-11.8 18.9zm42.7-9.9c7.3-18.3 12-41.1 13.4-65.9l31.1 0c-4.7 27.9-21.4 51.7-44.5 65.9zm0-163.8c23.2 14.2 39.9 38 44.5 65.9l-31.1 0c-1.4-24.7-6.1-47.5-13.4-65.9zM368 192a128 128 0 1 0 -256 0 128 128 0 1 0 256 0zM145.3 208l31.1 0c1.4 24.7 6.1 47.5 13.4 65.9c-23.2-14.2-39.9-38-44.5-65.9zm31.1-32l-31.1 0c4.7-27.9 21.4-51.7 44.5-65.9c-7.3 18.3-12 41.1-13.4 65.9zm56.1-75.8c3.7-3.7 6.2-4.2 7.4-4.2s3.7 .5 7.4 4.2c3.8 3.7 8 10 11.8 18.9c6.2 14.5 10.8 34.3 12.2 56.9l-63 0c1.5-22.6 6-42.4 12.2-56.9c3.8-8.9 8-15.2 11.8-18.9z"]
};
const faAtlas = faBookAtlas;
const faVirus = {
  prefix: 'fas',
  iconName: 'virus',
  icon: [512, 512, [], "e074", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 11.5c0 49.9-60.3 74.9-95.6 39.6L120.2 75C107.7 62.5 87.5 62.5 75 75s-12.5 32.8 0 45.3l8.2 8.2C118.4 163.7 93.4 224 43.5 224L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l11.5 0c49.9 0 74.9 60.3 39.6 95.6L75 391.8c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l8.2-8.2c35.3-35.3 95.6-10.3 95.6 39.6l0 11.5c0 17.7 14.3 32 32 32s32-14.3 32-32l0-11.5c0-49.9 60.3-74.9 95.6-39.6l8.2 8.2c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-8.2-8.2c-35.3-35.3-10.3-95.6 39.6-95.6l11.5 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-11.5 0c-49.9 0-74.9-60.3-39.6-95.6l8.2-8.2c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-8.2 8.2C348.3 118.4 288 93.4 288 43.5L288 32zM176 224a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm128 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faEnvelopeCircleCheck = {
  prefix: 'fas',
  iconName: 'envelope-circle-check',
  icon: [640, 512, [], "e4e8", "M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0l57.4-43c23.9-59.8 79.7-103.3 146.3-109.8l13.9-10.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176 0 384c0 35.3 28.7 64 64 64l296.2 0C335.1 417.6 320 378.5 320 336c0-5.6 .3-11.1 .8-16.6l-26.4 19.8zM640 336a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 353.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faLayerGroup = {
  prefix: 'fas',
  iconName: 'layer-group',
  icon: [576, 512, [], "f5fd", "M264.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 149.8C37.4 145.8 32 137.3 32 128s5.4-17.9 13.9-21.8L264.5 5.2zM476.9 209.6l53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 277.8C37.4 273.8 32 265.3 32 256s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0l152-70.2zm-152 198.2l152-70.2 53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 405.8C37.4 401.8 32 393.3 32 384s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0z"]
};
const faArrowsToDot = {
  prefix: 'fas',
  iconName: 'arrows-to-dot',
  icon: [512, 512, [], "e4be", "M256 0c17.7 0 32 14.3 32 32l0 32 32 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-64-64c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l32 0 0-32c0-17.7 14.3-32 32-32zM169.4 393.4l64-64c12.5-12.5 32.8-12.5 45.3 0l64 64c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9zM32 224l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c12.5 12.5 12.5 32.8 0 45.3l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3l64-64c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 32 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-64-64zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faArchway = {
  prefix: 'fas',
  iconName: 'archway',
  icon: [512, 512, [], "f557", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zm0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 64 0 0-128c0-53 43-96 96-96s96 43 96 96l0 128 64 0 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-288L32 128l0 288z"]
};
const faHeartCircleCheck = {
  prefix: 'fas',
  iconName: 'heart-circle-check',
  icon: [576, 512, [], "e4fd", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L416 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faHouseChimneyCrack = {
  prefix: 'fas',
  iconName: 'house-chimney-crack',
  icon: [576, 512, ["house-damage"], "f6f1", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c.2 35.5-28.5 64.3-64 64.3l-122.1 0L288 448l80.8-67.3c7.8-6.5 7.6-18.6-.4-24.9L250.6 263.2c-14.6-11.5-33.8 7-22.8 22L288 368l-85.5 71.2c-6.1 5-7.5 13.8-3.5 20.5L230.4 512l-102.3 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7 416 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 121 52.8 46.4c8 7 12 15 11 24z"]
};
const faHouseDamage = faHouseChimneyCrack;
const faFileZipper = {
  prefix: 'fas',
  iconName: 'file-zipper',
  icon: [384, 512, ["file-archive"], "f1c6", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM96 48c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zm-6.3 71.8c3.7-14 16.4-23.8 30.9-23.8l14.8 0c14.5 0 27.2 9.7 30.9 23.8l23.5 88.2c1.4 5.4 2.1 10.9 2.1 16.4c0 35.2-28.8 63.7-64 63.7s-64-28.5-64-63.7c0-5.5 .7-11.1 2.1-16.4l23.5-88.2zM112 336c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0z"]
};
const faFileArchive = faFileZipper;
const faSquare = {
  prefix: 'fas',
  iconName: 'square',
  icon: [448, 512, [9632, 9723, 9724, 61590], "f0c8", "M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96z"]
};
const faMartiniGlassEmpty = {
  prefix: 'fas',
  iconName: 'martini-glass-empty',
  icon: [512, 512, ["glass-martini"], "f000", "M32 0C19.1 0 7.4 7.8 2.4 19.8s-2.2 25.7 6.9 34.9L224 269.3 224 448l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-178.7L502.6 54.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 0 480 0L32 0zM256 210.7L109.3 64l293.5 0L256 210.7z"]
};
const faGlassMartini = faMartiniGlassEmpty;
const faCouch = {
  prefix: 'fas',
  iconName: 'couch',
  icon: [640, 512, [], "f4b8", "M64 160C64 89.3 121.3 32 192 32l256 0c70.7 0 128 57.3 128 128l0 33.6c-36.5 7.4-64 39.7-64 78.4l0 48-384 0 0-48c0-38.7-27.5-71-64-78.4L64 160zM544 272c0-20.9 13.4-38.7 32-45.3c5-1.8 10.4-2.7 16-2.7c26.5 0 48 21.5 48 48l0 176c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32L96 448c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32L0 272c0-26.5 21.5-48 48-48c5.6 0 11 1 16 2.7c18.6 6.6 32 24.4 32 45.3l0 48 0 32 32 0 384 0 32 0 0-32 0-48z"]
};
const faCediSign = {
  prefix: 'fas',
  iconName: 'cedi-sign',
  icon: [384, 512, [], "e0df", "M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 34.7C101.2 81.9 32 160.9 32 256s69.2 174.1 160 189.3l0 34.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-34.7c30.9-5.2 59.2-17.7 83.2-35.8c14.1-10.6 17-30.7 6.4-44.8s-30.7-17-44.8-6.4c-13.2 9.9-28.3 17.3-44.8 21.6L256 132c16.4 4.2 31.6 11.6 44.8 21.6c14.1 10.6 34.2 7.8 44.8-6.4s7.8-34.2-6.4-44.8c-24-18-52.4-30.6-83.2-35.8L256 32zM192 132L192 380c-55.2-14.2-96-64.3-96-124s40.8-109.8 96-124z"]
};
const faItalic = {
  prefix: 'fas',
  iconName: 'italic',
  icon: [384, 512, [], "f033", "M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0L160 416l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0L224 96l-64 0c-17.7 0-32-14.3-32-32z"]
};
const faTableCellsColumnLock = {
  prefix: 'fas',
  iconName: 'table-cells-column-lock',
  icon: [640, 512, [], "e678", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 65.1c-37.8 5.4-69.4 29.6-85.2 62.9L360 224l0 64 56 0 0 8.6c-19.1 11.1-32 31.7-32 55.4l-24 0 0 64 24 0 0 64L64 480c-35.3 0-64-28.7-64-64L0 96zm208 0l0 64 88 0 0-64-88 0zm240 0l-88 0 0 64 88 0 0-64zM208 224l0 64 88 0 0-64-88 0zm0 128l0 64 88 0 0-64-88 0zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faChurch = {
  prefix: 'fas',
  iconName: 'church',
  icon: [640, 512, [9962], "f51d", "M344 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 46.4L183.3 210c-14.5 8.7-23.3 24.3-23.3 41.2L160 512l96 0 0-96c0-35.3 28.7-64 64-64s64 28.7 64 64l0 96 96 0 0-260.8c0-16.9-8.8-32.5-23.3-41.2L344 142.4 344 96l32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0 0-24zM24.9 330.3C9.5 338.8 0 354.9 0 372.4L0 464c0 26.5 21.5 48 48 48l80 0 0-238.4L24.9 330.3zM592 512c26.5 0 48-21.5 48-48l0-91.6c0-17.5-9.5-33.6-24.9-42.1L512 273.6 512 512l80 0z"]
};
const faCommentsDollar = {
  prefix: 'fas',
  iconName: 'comments-dollar',
  icon: [640, 512, [], "f653", "M416 176c0 97.2-93.1 176-208 176c-38.2 0-73.9-8.7-104.7-23.9c-7.5 4-16 7.9-25.2 11.4C59.8 346.4 37.8 352 16 352c-6.9 0-13.1-4.5-15.2-11.1s.2-13.8 5.8-17.9c0 0 0 0 0 0s0 0 0 0l.2-.2c.2-.2 .6-.4 1.1-.8c1-.8 2.5-2 4.3-3.7c3.6-3.3 8.5-8.1 13.3-14.3c5.5-7 10.7-15.4 14.2-24.7C14.7 250.3 0 214.6 0 176C0 78.8 93.1 0 208 0S416 78.8 416 176zM231.5 383C348.9 372.9 448 288.3 448 176c0-5.2-.2-10.4-.6-15.5C555.1 167.1 640 243.2 640 336c0 38.6-14.7 74.3-39.6 103.4c3.5 9.4 8.7 17.7 14.2 24.7c4.8 6.2 9.7 11 13.3 14.3c1.8 1.6 3.3 2.9 4.3 3.7c.5 .4 .9 .7 1.1 .8l.2 .2s0 0 0 0s0 0 0 0c5.6 4.1 7.9 11.3 5.8 17.9c-2.1 6.6-8.3 11.1-15.2 11.1c-21.8 0-43.8-5.6-62.1-12.5c-9.2-3.5-17.8-7.4-25.2-11.4C505.9 503.3 470.2 512 432 512c-95.6 0-176.2-54.6-200.5-129zM228 72c0-11-9-20-20-20s-20 9-20 20l0 14c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1c0 0 0 0 0 0s0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4l0 14.6c0 11 9 20 20 20s20-9 20-20l0-13.8c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15l-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7L228 72z"]
};
const faDemocrat = {
  prefix: 'fas',
  iconName: 'democrat',
  icon: [640, 512, [], "f747", "M64 32c0-8.9 3.8-20.9 6.2-27.3C71.2 1.8 74 0 77 0c1.9 0 3.8 .7 5.2 2.1L128 45.7 173.8 2.1C175.2 .7 177.1 0 179 0c3 0 5.8 1.8 6.8 4.7c2.4 6.5 6.2 18.4 6.2 27.3c0 26.5-21.9 42-29.5 46.6l76.2 72.6c6 5.7 13.9 8.8 22.1 8.8L480 160l32 0c40.3 0 78.2 19 102.4 51.2l19.2 25.6c10.6 14.1 7.7 34.2-6.4 44.8s-34.2 7.7-44.8-6.4l-19.2-25.6c-5.3-7-11.8-12.8-19.2-17l0 87.4-352 0-40.4-94.3c-3.9-9.2-15.3-12.6-23.6-7l-42.1 28c-9.1 6.1-19.7 9.3-30.7 9.3l-2 0C23.9 256 0 232.1 0 202.7c0-12.1 4.1-23.8 11.7-33.3L87.6 74.6C78.1 67.4 64 53.2 64 32zM448 352l96 0 0 64 0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64-160 0 0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64 0-64 96 0 160 0zM260.9 210.9c-.9-1.8-2.8-2.9-4.8-2.9s-3.9 1.1-4.8 2.9l-10.5 20.5-23.5 3.3c-2 .3-3.7 1.6-4.3 3.5s-.1 3.9 1.3 5.3l17 16-4 22.6c-.3 1.9 .5 3.9 2.1 5s3.8 1.3 5.6 .4l21-10.7 21 10.7c1.8 .9 4 .8 5.6-.4s2.5-3.1 2.1-5l-4-22.6 17-16c1.5-1.4 2-3.4 1.3-5.3s-2.3-3.2-4.3-3.5l-23.5-3.3-10.5-20.5zM368.1 208c-2 0-3.9 1.1-4.8 2.9l-10.5 20.5-23.5 3.3c-2 .3-3.7 1.6-4.3 3.5s-.1 3.9 1.3 5.3l17 16-4 22.6c-.3 1.9 .5 3.9 2.1 5s3.8 1.3 5.6 .4l21-10.7 21 10.7c1.8 .9 4 .8 5.6-.4s2.5-3.1 2.1-5l-4-22.6 17-16c1.5-1.4 2-3.4 1.4-5.3s-2.3-3.2-4.3-3.5l-23.5-3.3-10.5-20.5c-.9-1.8-2.8-2.9-4.8-2.9zm116.8 2.9c-.9-1.8-2.8-2.9-4.8-2.9s-3.9 1.1-4.8 2.9l-10.5 20.5-23.5 3.3c-2 .3-3.7 1.6-4.3 3.5s-.1 3.9 1.3 5.3l17 16-4 22.6c-.3 1.9 .5 3.9 2.1 5s3.8 1.3 5.6 .4l21-10.7 21 10.7c1.8 .9 4 .8 5.6-.4s2.5-3.1 2.1-5l-4-22.6 17-16c1.5-1.4 2-3.4 1.4-5.3s-2.3-3.2-4.3-3.5l-23.5-3.3-10.5-20.5z"]
};
const faZ = {
  prefix: 'fas',
  iconName: 'z',
  icon: [384, 512, [122], "5a", "M0 64C0 46.3 14.3 32 32 32l320 0c12.4 0 23.7 7.2 29 18.4s3.6 24.5-4.4 34.1L100.3 416 352 416c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-12.4 0-23.7-7.2-29-18.4s-3.6-24.5 4.4-34.1L283.7 96 32 96C14.3 96 0 81.7 0 64z"]
};
const faPersonSkiing = {
  prefix: 'fas',
  iconName: 'person-skiing',
  icon: [512, 512, [9975, "skiing"], "f7c9", "M380.7 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM2.7 268.9c6.1-11.8 20.6-16.3 32.4-10.2L232.7 361.3l46.2-69.2-75.1-75.1c-14.6-14.6-20.4-33.9-18.4-52.1l108.8 52 39.3 39.3c16.2 16.2 18.7 41.5 6 60.6L289.8 391l128.7 66.8c13.6 7.1 29.8 7.2 43.6 .3l15.2-7.6c11.9-5.9 26.3-1.1 32.2 10.7s1.1 26.3-10.7 32.2l-15.2 7.6c-27.5 13.7-59.9 13.5-87.2-.7L12.9 301.3C1.2 295.2-3.4 280.7 2.7 268.9zM118.9 65.6L137 74.2l8.7-17.4c4-7.9 13.6-11.1 21.5-7.2s11.1 13.6 7.2 21.5l-8.5 16.9 54.7 26.2c1.5-.7 3.1-1.4 4.7-2.1l83.4-33.4c34.2-13.7 72.8 4.2 84.5 39.2l17.1 51.2 52.1 26.1c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3l-58.1-29c-11.4-5.7-20-15.7-24.1-27.8l-5.8-17.3-27.3 12.1-6.8 3-6.7-3.2L151.5 116.7l-9.2 18.4c-4 7.9-13.6 11.1-21.5 7.2s-11.1-13.6-7.2-21.5l9-18-17.6-8.4c-8-3.8-11.3-13.4-7.5-21.3s13.4-11.3 21.3-7.5z"]
};
const faSkiing = faPersonSkiing;
const faRoadLock = {
  prefix: 'fas',
  iconName: 'road-lock',
  icon: [640, 512, [], "e567", "M288 32l-74.8 0c-27.1 0-51.3 17.1-60.3 42.6L35.1 407.2c-2.1 5.9-3.1 12-3.1 18.2C32 455.5 56.5 480 86.6 480L288 480l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64 32 0 0-128c0-23.7 12.9-44.4 32-55.4l0-24.6c0-58.3 44.6-106.2 101.5-111.5L487.1 74.6C478 49.1 453.9 32 426.8 32L352 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm64 192l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32zm176 16c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faA = {
  prefix: 'fas',
  iconName: 'a',
  icon: [384, 512, [97], "41", "M221.5 51.7C216.6 39.8 204.9 32 192 32s-24.6 7.8-29.5 19.7l-120 288-40 96c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L93.3 384l197.3 0 31.8 76.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8l-40-96-120-288zM264 320l-144 0 72-172.8L264 320z"]
};
const faTemperatureArrowDown = {
  prefix: 'fas',
  iconName: 'temperature-arrow-down',
  icon: [576, 512, ["temperature-down"], "e03f", "M128 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 164.5c0 17.3 7.1 31.9 15.3 42.5C249.8 332.6 256 349.5 256 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9c8.2-10.6 15.3-25.2 15.3-42.5L128 112zM176 0C114.1 0 64 50.1 64 112l0 164.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C43.2 304.2 32 334.8 32 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6L288 112C288 50.1 237.9 0 176 0zm0 416c26.5 0 48-21.5 48-48c0-20.9-13.4-38.7-32-45.3l0-50.7c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 50.7c-18.6 6.6-32 24.4-32 45.3c0 26.5 21.5 48 48 48zm336-64l-32 0 0-288c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 288-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c6 6 14.1 9.4 22.6 9.4s16.6-3.4 22.6-9.4l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8z"]
};
const faTemperatureDown = faTemperatureArrowDown;
const faFeatherPointed = {
  prefix: 'fas',
  iconName: 'feather-pointed',
  icon: [512, 512, ["feather-alt"], "f56b", "M278.5 215.6L23 471c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l74.8-74.8c7.4 4.6 15.3 8.2 23.8 10.5C200.3 452.8 270 454.5 338 409.4c12.2-8.1 5.8-25.4-8.8-25.4l-16.1 0c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l97.7-29.3c3.4-1 6.4-3.1 8.4-6.1c4.4-6.4 8.6-12.9 12.6-19.6c6.2-10.3-1.5-23-13.5-23l-38.6 0c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l80.9-24.3c4.6-1.4 8.4-4.8 10.2-9.3C494.5 163 507.8 86.1 511.9 36.8c.8-9.9-3-19.6-10-26.6s-16.7-10.8-26.6-10C391.5 7 228.5 40.5 137.4 131.6C57.3 211.7 56.7 302.3 71.3 356.4c2.1 7.9 12 9.6 17.8 3.8L253.6 195.8c6.2-6.2 16.4-6.2 22.6 0c5.4 5.4 6.1 13.6 2.2 19.8z"]
};
const faFeatherAlt = faFeatherPointed;
const faP = {
  prefix: 'fas',
  iconName: 'p',
  icon: [320, 512, [112], "50", "M0 96C0 60.7 28.7 32 64 32l96 0c88.4 0 160 71.6 160 160s-71.6 160-160 160l-96 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 320 0 96zM64 288l96 0c53 0 96-43 96-96s-43-96-96-96L64 96l0 192z"]
};
const faSnowflake = {
  prefix: 'fas',
  iconName: 'snowflake',
  icon: [448, 512, [10052, 10054], "f2dc", "M224 0c17.7 0 32 14.3 32 32l0 30.1 15-15c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-49 49 0 70.3 61.4-35.8 17.7-66.1c3.4-12.8 16.6-20.4 29.4-17s20.4 16.6 17 29.4l-5.2 19.3 23.6-13.8c15.3-8.9 34.9-3.7 43.8 11.5s3.8 34.9-11.5 43.8l-25.3 14.8 21.7 5.8c12.8 3.4 20.4 16.6 17 29.4s-16.6 20.4-29.4 17l-67.7-18.1L287.5 256l60.9 35.5 67.7-18.1c12.8-3.4 26 4.2 29.4 17s-4.2 26-17 29.4l-21.7 5.8 25.3 14.8c15.3 8.9 20.4 28.5 11.5 43.8s-28.5 20.4-43.8 11.5l-23.6-13.8 5.2 19.3c3.4 12.8-4.2 26-17 29.4s-26-4.2-29.4-17l-17.7-66.1L256 311.7l0 70.3 49 49c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-15-15 0 30.1c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-30.1-15 15c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l49-49 0-70.3-61.4 35.8-17.7 66.1c-3.4 12.8-16.6 20.4-29.4 17s-20.4-16.6-17-29.4l5.2-19.3L48.1 395.6c-15.3 8.9-34.9 3.7-43.8-11.5s-3.7-34.9 11.5-43.8l25.3-14.8-21.7-5.8c-12.8-3.4-20.4-16.6-17-29.4s16.6-20.4 29.4-17l67.7 18.1L160.5 256 99.6 220.5 31.9 238.6c-12.8 3.4-26-4.2-29.4-17s4.2-26 17-29.4l21.7-5.8L15.9 171.6C.6 162.7-4.5 143.1 4.4 127.9s28.5-20.4 43.8-11.5l23.6 13.8-5.2-19.3c-3.4-12.8 4.2-26 17-29.4s26 4.2 29.4 17l17.7 66.1L192 200.3l0-70.3L143 81c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l15 15L192 32c0-17.7 14.3-32 32-32z"]
};
const faNewspaper = {
  prefix: 'fas',
  iconName: 'newspaper',
  icon: [512, 512, [128240], "f1ea", "M96 96c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L80 480c-44.2 0-80-35.8-80-80L0 128c0-17.7 14.3-32 32-32s32 14.3 32 32l0 272c0 8.8 7.2 16 16 16s16-7.2 16-16L96 96zm64 24l0 80c0 13.3 10.7 24 24 24l112 0c13.3 0 24-10.7 24-24l0-80c0-13.3-10.7-24-24-24L184 96c-13.3 0-24 10.7-24 24zm208-8c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0c-8.8 0-16 7.2-16 16zM160 304c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-256 0c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-256 0c-8.8 0-16 7.2-16 16z"]
};
const faRectangleAd = {
  prefix: 'fas',
  iconName: 'rectangle-ad',
  icon: [576, 512, ["ad"], "f641", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM229.5 173.3l72 144c5.9 11.9 1.1 26.3-10.7 32.2s-26.3 1.1-32.2-10.7L253.2 328l-90.3 0-5.4 10.7c-5.9 11.9-20.3 16.7-32.2 10.7s-16.7-20.3-10.7-32.2l72-144c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3zM208 237.7L186.8 280l42.3 0L208 237.7zM392 256a24 24 0 1 0 0 48 24 24 0 1 0 0-48zm24-43.9l0-28.1c0-13.3 10.7-24 24-24s24 10.7 24 24l0 96 0 48c0 13.3-10.7 24-24 24c-6.6 0-12.6-2.7-17-7c-9.4 4.5-19.9 7-31 7c-39.8 0-72-32.2-72-72s32.2-72 72-72c8.4 0 16.5 1.4 24 4.1z"]
};
const faAd = faRectangleAd;
const faCircleArrowRight = {
  prefix: 'fas',
  iconName: 'circle-arrow-right',
  icon: [512, 512, ["arrow-circle-right"], "f0a9", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM297 385c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l71-71L120 280c-13.3 0-24-10.7-24-24s10.7-24 24-24l214.1 0-71-71c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L409 239c9.4 9.4 9.4 24.6 0 33.9L297 385z"]
};
const faArrowCircleRight = faCircleArrowRight;
const faFilterCircleXmark = {
  prefix: 'fas',
  iconName: 'filter-circle-xmark',
  icon: [576, 512, [], "e17b", "M3.9 22.9C10.5 8.9 24.5 0 40 0L472 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L396.4 195.6C316.2 212.1 256 283 256 368c0 27.4 6.3 53.4 17.5 76.5c-1.6-.8-3.2-1.8-4.7-2.9l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 65.3C-.7 53.4-2.8 36.8 3.9 22.9zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L432 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L409.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L432 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L454.6 368l36.7-36.7z"]
};
const faLocust = {
  prefix: 'fas',
  iconName: 'locust',
  icon: [576, 512, [], "e520", "M312 32c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0c98.7 0 180.6 71.4 197 165.4c-9-3.5-18.8-5.4-29-5.4l-64.2 0-41.8-97.5c-3.4-7.9-10.8-13.4-19.3-14.4s-17 2.7-22.1 9.6l-40.9 55.5-21.7-50.7c-3.3-7.8-10.5-13.2-18.9-14.3s-16.7 2.3-22 8.9l-240 304c-8.2 10.4-6.4 25.5 4 33.7s25.5 6.4 33.7-4l79.4-100.5 43 16.4-40.5 55c-7.9 10.7-5.6 25.7 5.1 33.6s25.7 5.6 33.6-5.1L215.1 400l74.5 0-29.3 42.3c-7.5 10.9-4.8 25.8 6.1 33.4s25.8 4.8 33.4-6.1L348 400l80.4 0 38.8 67.9c6.6 11.5 21.2 15.5 32.7 8.9s15.5-21.2 8.9-32.7L483.6 400l12.4 0c44.1 0 79.8-35.7 80-79.7c0-.1 0-.2 0-.3l0-40C576 143 465 32 328 32l-16 0zm50.5 168l17.1 40L333 240l29.5-40zm-87.7 38.1l-1.4 1.9-48.2 0 32.7-41.5 16.9 39.5zM88.8 240C57.4 240 32 265.4 32 296.8c0 15.5 6.3 30 16.9 40.4L126.7 240l-37.9 0zM496 288a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faSort = {
  prefix: 'fas',
  iconName: 'sort',
  icon: [320, 512, ["unsorted"], "f0dc", "M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8L32 224c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l256 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z"]
};
const faUnsorted = faSort;
const faListOl = {
  prefix: 'fas',
  iconName: 'list-ol',
  icon: [512, 512, ["list-1-2", "list-numeric"], "f0cb", "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faList12 = faListOl;
const faListNumeric = faListOl;
const faPersonDressBurst = {
  prefix: 'fas',
  iconName: 'person-dress-burst',
  icon: [640, 512, [], "e544", "M528 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM390.2 384l17.8 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 16 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 17.8 0c10.9 0 18.6-10.7 15.2-21.1L546.7 248.1l33.9 56.3c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-53.6-89.2c-20.2-33.7-56.7-54.3-96-54.3l-11.6 0c-39.3 0-75.7 20.6-96 54.3l-53.6 89.2c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9l33.9-56.3L375 362.9c-3.5 10.4 4.3 21.1 15.2 21.1zM190.9 18.1C188.4 12 182.6 8 176 8s-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L176 286.1l58.6 53.9c4.8 4.4 11.9 5.5 17.8 2.6s9.5-9 9-15.5l-5.6-79.4 50.5-7.8 24.4-40.5-55.2-38L315 92.2c3.3-5.7 2.7-12.8-1.4-17.9s-10.9-7.2-17.2-5.3L220.3 92.1l-29.4-74z"]
};
const faMoneyCheckDollar = {
  prefix: 'fas',
  iconName: 'money-check-dollar',
  icon: [576, 512, ["money-check-alt"], "f53d", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zM272 192l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zM256 304c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16zM164 152l0 13.9c7.5 1.2 14.6 2.9 21.1 4.7c10.7 2.8 17 13.8 14.2 24.5s-13.8 17-24.5 14.2c-11-2.9-21.6-5-31.2-5.2c-7.9-.1-16 1.8-21.5 5c-4.8 2.8-6.2 5.6-6.2 9.3c0 1.8 .1 3.5 5.3 6.7c6.3 3.8 15.5 6.7 28.3 10.5l.7 .2c11.2 3.4 25.6 7.7 37.1 15c12.9 8.1 24.3 21.3 24.6 41.6c.3 20.9-10.5 36.1-24.8 45c-7.2 4.5-15.2 7.3-23.2 9l0 13.8c0 11-9 20-20 20s-20-9-20-20l0-14.6c-10.3-2.2-20-5.5-28.2-8.4c0 0 0 0 0 0s0 0 0 0c-2.1-.7-4.1-1.4-6.1-2.1c-10.5-3.5-16.1-14.8-12.6-25.3s14.8-16.1 25.3-12.6c2.5 .8 4.9 1.7 7.2 2.4c13.6 4.6 24 8.1 35.1 8.5c8.6 .3 16.5-1.6 21.4-4.7c4.1-2.5 6-5.5 5.9-10.5c0-2.9-.8-5-5.9-8.2c-6.3-4-15.4-6.9-28-10.7l-1.7-.5c-10.9-3.3-24.6-7.4-35.6-14c-12.7-7.7-24.6-20.5-24.7-40.7c-.1-21.1 11.8-35.7 25.8-43.9c6.9-4.1 14.5-6.8 22.2-8.5l0-14c0-11 9-20 20-20s20 9 20 20z"]
};
const faMoneyCheckAlt = faMoneyCheckDollar;
const faVectorSquare = {
  prefix: 'fas',
  iconName: 'vector-square',
  icon: [448, 512, [], "f5cb", "M368 80l32 0 0 32-32 0 0-32zM352 32c-17.7 0-32 14.3-32 32L128 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64l0 64c0 17.7 14.3 32 32 32l0 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l192 0c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-192c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0zM96 160c17.7 0 32-14.3 32-32l192 0c0 17.7 14.3 32 32 32l0 192c-17.7 0-32 14.3-32 32l-192 0c0-17.7-14.3-32-32-32l0-192zM48 400l32 0 0 32-32 0 0-32zm320 32l0-32 32 0 0 32-32 0zM48 112l0-32 32 0 0 32-32 0z"]
};
const faBreadSlice = {
  prefix: 'fas',
  iconName: 'bread-slice',
  icon: [512, 512, [], "f7ec", "M256 32C192 32 0 64 0 192c0 35.3 28.7 64 64 64V432c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V256c35.3 0 64-28.7 64-64C512 64 320 32 256 32z"]
};
const faLanguage = {
  prefix: 'fas',
  iconName: 'language',
  icon: [640, 512, [], "f1ab", "M0 128C0 92.7 28.7 64 64 64l192 0 48 0 16 0 256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64l-256 0-16 0-48 0L64 448c-35.3 0-64-28.7-64-64L0 128zm320 0l0 256 256 0 0-256-256 0zM178.3 175.9c-3.2-7.2-10.4-11.9-18.3-11.9s-15.1 4.7-18.3 11.9l-64 144c-4.5 10.1 .1 21.9 10.2 26.4s21.9-.1 26.4-10.2l8.9-20.1 73.6 0 8.9 20.1c4.5 10.1 16.3 14.6 26.4 10.2s14.6-16.3 10.2-26.4l-64-144zM160 233.2L179 276l-38 0 19-42.8zM448 164c11 0 20 9 20 20l0 4 44 0 16 0c11 0 20 9 20 20s-9 20-20 20l-2 0-1.6 4.5c-8.9 24.4-22.4 46.6-39.6 65.4c.9 .6 1.8 1.1 2.7 1.6l18.9 11.3c9.5 5.7 12.5 18 6.9 27.4s-18 12.5-27.4 6.9l-18.9-11.3c-4.5-2.7-8.8-5.5-13.1-8.5c-10.6 7.5-21.9 14-34 19.4l-3.6 1.6c-10.1 4.5-21.9-.1-26.4-10.2s.1-21.9 10.2-26.4l3.6-1.6c6.4-2.9 12.6-6.1 18.5-9.8l-12.2-12.2c-7.8-7.8-7.8-20.5 0-28.3s20.5-7.8 28.3 0l14.6 14.6 .5 .5c12.4-13.1 22.5-28.3 29.8-45L448 228l-72 0c-11 0-20-9-20-20s9-20 20-20l52 0 0-4c0-11 9-20 20-20z"]
};
const faFaceKissWinkHeart = {
  prefix: 'fas',
  iconName: 'face-kiss-wink-heart',
  icon: [512, 512, [128536, "kiss-wink-heart"], "f598", "M498 339.7c9.1-26.2 14-54.4 14-83.7C512 114.6 397.4 0 256 0S0 114.6 0 256S114.6 512 256 512c35.4 0 69.1-7.2 99.7-20.2c-4.8-5.5-8.5-12.2-10.4-19.7l-22.9-89.3c-10-39 11.8-80.9 51.8-92.1c37.2-10.4 73.8 10.1 87.5 44c12.7-1.6 25.1 .4 36.2 5zM296 332c0 6.9-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C258.7 443.1 241.4 448 224 448c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.6-.4-.3-.2-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm194.8 57.6c-17.6-23.5-52.8-23.5-70.4 0c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2zM434 352.3c-6-23.2-28.8-37-51.1-30.8s-35.4 30.1-29.5 53.4l22.9 89.3c2.2 8.7 11.2 13.9 19.8 11.4l84.9-23.8c22.2-6.2 35.4-30.1 29.5-53.4s-28.8-37-51.1-30.8l-20.2 5.6-5.4-21z"]
};
const faKissWinkHeart = faFaceKissWinkHeart;
const faFilter = {
  prefix: 'fas',
  iconName: 'filter',
  icon: [512, 512, [], "f0b0", "M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"]
};
const faQuestion = {
  prefix: 'fas',
  iconName: 'question',
  icon: [320, 512, [10067, 10068, 61736], "3f", "M80 160c0-35.3 28.7-64 64-64l32 0c35.3 0 64 28.7 64 64l0 3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74l0 1.4c0 17.7 14.3 32 32 32s32-14.3 32-32l0-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7l0-3.6c0-70.7-57.3-128-128-128l-32 0C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faFileSignature = {
  prefix: 'fas',
  iconName: 'file-signature',
  icon: [576, 512, [], "f573", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-19.3c-2.7 1.1-5.4 2-8.2 2.7l-60.1 15c-3 .7-6 1.2-9 1.4c-.9 .1-1.8 .2-2.7 .2l-64 0c-6.1 0-11.6-3.4-14.3-8.8l-8.8-17.7c-1.7-3.4-5.1-5.5-8.8-5.5s-7.2 2.1-8.8 5.5l-8.8 17.7c-2.9 5.9-9.2 9.4-15.7 8.8s-12.1-5.1-13.9-11.3L144 381l-9.8 32.8c-6.1 20.3-24.8 34.2-46 34.2L80 448c-8.8 0-16-7.2-16-16s7.2-16 16-16l8.2 0c7.1 0 13.3-4.6 15.3-11.4l14.9-49.5c3.4-11.3 13.8-19.1 25.6-19.1s22.2 7.8 25.6 19.1l11.6 38.6c7.4-6.2 16.8-9.7 26.8-9.7c15.9 0 30.4 9 37.5 23.2l4.4 8.8 8.9 0c-3.1-8.8-3.7-18.4-1.4-27.8l15-60.1c2.8-11.3 8.6-21.5 16.8-29.7L384 203.6l0-43.6-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM549.8 139.7c-15.6-15.6-40.9-15.6-56.6 0l-29.4 29.4 71 71 29.4-29.4c15.6-15.6 15.6-40.9 0-56.6l-14.4-14.4zM311.9 321c-4.1 4.1-7 9.2-8.4 14.9l-15 60.1c-1.4 5.5 .2 11.2 4.2 15.2s9.7 5.6 15.2 4.2l60.1-15c5.6-1.4 10.8-4.3 14.9-8.4L512.1 262.7l-71-71L311.9 321z"]
};
const faUpDownLeftRight = {
  prefix: 'fas',
  iconName: 'up-down-left-right',
  icon: [512, 512, ["arrows-alt"], "f0b2", "M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 96-96 0 0-32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-32 96 0 0 96-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0 0-96 96 0 0 32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 32-96 0 0-96 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z"]
};
const faArrowsAlt = faUpDownLeftRight;
const faHouseChimneyUser = {
  prefix: 'fas',
  iconName: 'house-chimney-user',
  icon: [576, 512, [], "e065", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L512 185l0-121c0-17.7-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32l0 36.7L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 160.4c0 35.3 28.7 64 64 64l320.4 0c35.5 0 64.2-28.8 64-64.3l-.7-160.2 32 0zM288 160a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM176 400c0-44.2 35.8-80 80-80l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16z"]
};
const faHandHoldingHeart = {
  prefix: 'fas',
  iconName: 'hand-holding-heart',
  icon: [576, 512, [], "f4be", "M163.9 136.9c-29.4-29.8-29.4-78.2 0-108s77-29.8 106.4 0l17.7 18 17.7-18c29.4-29.8 77-29.8 106.4 0s29.4 78.2 0 108L310.5 240.1c-6.2 6.3-14.3 9.4-22.5 9.4s-16.3-3.1-22.5-9.4L163.9 136.9zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5L192 512 32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l36.8 0 44.9-36c22.7-18.2 50.9-28 80-28l78.3 0 16 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l120.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384c0 0 0 0 0 0l-.9 0c.3 0 .6 0 .9 0z"]
};
const faPuzzlePiece = {
  prefix: 'fas',
  iconName: 'puzzle-piece',
  icon: [512, 512, [129513], "f12e", "M192 104.8c0-9.2-5.8-17.3-13.2-22.8C167.2 73.3 160 61.3 160 48c0-26.5 28.7-48 64-48s64 21.5 64 48c0 13.3-7.2 25.3-18.8 34c-7.4 5.5-13.2 13.6-13.2 22.8c0 12.8 10.4 23.2 23.2 23.2l56.8 0c26.5 0 48 21.5 48 48l0 56.8c0 12.8 10.4 23.2 23.2 23.2c9.2 0 17.3-5.8 22.8-13.2c8.7-11.6 20.7-18.8 34-18.8c26.5 0 48 28.7 48 64s-21.5 64-48 64c-13.3 0-25.3-7.2-34-18.8c-5.5-7.4-13.6-13.2-22.8-13.2c-12.8 0-23.2 10.4-23.2 23.2L384 464c0 26.5-21.5 48-48 48l-56.8 0c-12.8 0-23.2-10.4-23.2-23.2c0-9.2 5.8-17.3 13.2-22.8c11.6-8.7 18.8-20.7 18.8-34c0-26.5-28.7-48-64-48s-64 21.5-64 48c0 13.3 7.2 25.3 18.8 34c7.4 5.5 13.2 13.6 13.2 22.8c0 12.8-10.4 23.2-23.2 23.2L48 512c-26.5 0-48-21.5-48-48L0 343.2C0 330.4 10.4 320 23.2 320c9.2 0 17.3 5.8 22.8 13.2C54.7 344.8 66.7 352 80 352c26.5 0 48-28.7 48-64s-21.5-64-48-64c-13.3 0-25.3 7.2-34 18.8C40.5 250.2 32.4 256 23.2 256C10.4 256 0 245.6 0 232.8L0 176c0-26.5 21.5-48 48-48l120.8 0c12.8 0 23.2-10.4 23.2-23.2z"]
};
const faMoneyCheck = {
  prefix: 'fas',
  iconName: 'money-check',
  icon: [576, 512, [], "f53c", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm48 160l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zM96 336c0-8.8 7.2-16 16-16l352 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-352 0c-8.8 0-16-7.2-16-16zM376 160l80 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24z"]
};
const faStarHalfStroke = {
  prefix: 'fas',
  iconName: 'star-half-stroke',
  icon: [576, 512, ["star-half-alt"], "f5c0", "M288 376.4l.1-.1 26.4 14.1 85.2 45.5-16.5-97.6-4.8-28.7 20.7-20.5 70.1-69.3-96.1-14.2-29.3-4.3-12.9-26.6L288.1 86.9l-.1 .3 0 289.2zm175.1 98.3c2 12-3 24.2-12.9 31.3s-23 8-33.8 2.3L288.1 439.8 159.8 508.3C149 514 135.9 513.1 126 506s-14.9-19.3-12.9-31.3L137.8 329 33.6 225.9c-8.6-8.5-11.7-21.2-7.9-32.7s13.7-19.9 25.7-21.7L195 150.3 259.4 18c5.4-11 16.5-18 28.8-18s23.4 7 28.8 18l64.3 132.3 143.6 21.2c12 1.8 22 10.2 25.7 21.7s.7 24.2-7.9 32.7L438.5 329l24.6 145.7z"]
};
const faStarHalfAlt = faStarHalfStroke;
const faCode = {
  prefix: 'fas',
  iconName: 'code',
  icon: [640, 512, [], "f121", "M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"]
};
const faWhiskeyGlass = {
  prefix: 'fas',
  iconName: 'whiskey-glass',
  icon: [512, 512, [129347, "glass-whiskey"], "f7a0", "M32 32c-9.3 0-18.1 4-24.2 11.1S-1 59.4 .3 68.6l50 342.9c5.7 39.3 39.4 68.5 79.2 68.5l253 0c39.7 0 73.4-29.1 79.2-68.5l50-342.9c1.3-9.2-1.4-18.5-7.5-25.5S489.3 32 480 32L32 32zM87.7 224L69 96l374 0L424.3 224 87.7 224z"]
};
const faGlassWhiskey = faWhiskeyGlass;
const faBuildingCircleExclamation = {
  prefix: 'fas',
  iconName: 'building-circle-exclamation',
  icon: [640, 512, [], "e4d3", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c15.1 0 28.5-6.9 37.3-17.8C340.4 462.2 320 417.5 320 368c0-54.7 24.9-103.5 64-135.8L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faMagnifyingGlassChart = {
  prefix: 'fas',
  iconName: 'magnifying-glass-chart',
  icon: [512, 512, [], "e522", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zm-312 8l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80-96l0 160c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80 64l0 96c0 13.3 10.7 24 24 24s24-10.7 24-24l0-96c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
};
const faArrowUpRightFromSquare = {
  prefix: 'fas',
  iconName: 'arrow-up-right-from-square',
  icon: [512, 512, ["external-link"], "f08e", "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]
};
const faExternalLink = faArrowUpRightFromSquare;
const faCubesStacked = {
  prefix: 'fas',
  iconName: 'cubes-stacked',
  icon: [448, 512, [], "e4e6", "M192 64l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32zM82.7 207c-15.3 8.8-20.5 28.4-11.7 43.7l32 55.4c8.8 15.3 28.4 20.5 43.7 11.7l55.4-32c15.3-8.8 20.5-28.4 11.7-43.7l-32-55.4c-8.8-15.3-28.4-20.5-43.7-11.7L82.7 207zM288 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0zm64 160c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0zM160 384l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32zM32 352c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0z"]
};
const faWonSign = {
  prefix: 'fas',
  iconName: 'won-sign',
  icon: [512, 512, [8361, "krw", "won"], "f159", "M62.4 53.9C56.8 37.1 38.6 28.1 21.9 33.6S-3.9 57.4 1.6 74.1L51.6 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l40.9 0 56.7 170.1c4.5 13.5 17.4 22.4 31.6 21.9s26.4-10.4 29.8-24.2L233 288l46 0L321 455.8c3.4 13.8 15.6 23.7 29.8 24.2s27.1-8.4 31.6-21.9L439.1 288l40.9 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-19.6 0 50-149.9c5.6-16.8-3.5-34.9-20.2-40.5s-34.9 3.5-40.5 20.2L392.9 224l-64 0L287 56.2C283.5 42 270.7 32 256 32s-27.5 10-31 24.2L183 224l-64 0L62.4 53.9zm78 234.1l26.6 0-11.4 45.6L140.4 288zM249 224l7-28.1 7 28.1-14 0zm96 64l26.6 0-15.2 45.6L345 288z"]
};
const faKrw = faWonSign;
const faWon = faWonSign;
const faVirusCovid = {
  prefix: 'fas',
  iconName: 'virus-covid',
  icon: [512, 512, [], "e4a8", "M192 24c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 33.6c30.7 4.2 58.8 16.3 82.3 34.1L386.1 92 374.8 80.6c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l56.6 56.6c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L420 125.9l-23.8 23.8c17.9 23.5 29.9 51.7 34.1 82.3l33.6 0 0-16c0-13.3 10.7-24 24-24s24 10.7 24 24l0 80c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-33.6 0c-4.2 30.7-16.3 58.8-34.1 82.3L420 386.1l11.3-11.3c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-56.6 56.6c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L386.1 420l-23.8-23.8c-23.5 17.9-51.7 29.9-82.3 34.1l0 33.6 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-33.6c-30.7-4.2-58.8-16.3-82.3-34.1L125.9 420l11.3 11.3c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L46.7 408.7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L92 386.1l23.8-23.8C97.9 338.8 85.8 310.7 81.6 280L48 280l0 16c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-80c0-13.3 10.7-24 24-24s24 10.7 24 24l0 16 33.6 0c4.2-30.7 16.3-58.8 34.1-82.3L92 125.9 80.6 137.2c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l56.6-56.6c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L125.9 92l23.8 23.8c23.5-17.9 51.7-29.9 82.3-34.1L232 48l-16 0c-13.3 0-24-10.7-24-24zm48 200a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm64 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faAustralSign = {
  prefix: 'fas',
  iconName: 'austral-sign',
  icon: [448, 512, [], "e0a9", "M253.5 51.7C248.6 39.8 236.9 32 224 32s-24.6 7.8-29.5 19.7L122.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0L82.7 320 32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l24 0L34.5 435.7c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L125.3 384l197.3 0 31.8 76.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8L392 384l24 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-50.7 0L352 288l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-90.7 0L253.5 51.7zM256 224l-64 0 32-76.8L256 224zm-90.7 64l117.3 0L296 320l-144 0 13.3-32z"]
};
const faF = {
  prefix: 'fas',
  iconName: 'f',
  icon: [320, 512, [102], "46", "M64 32C28.7 32 0 60.7 0 96L0 256 0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 224 64 96l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32z"]
};
const faLeaf = {
  prefix: 'fas',
  iconName: 'leaf',
  icon: [512, 512, [], "f06c", "M272 96c-78.6 0-145.1 51.5-167.7 122.5c33.6-17 71.5-26.5 111.7-26.5l88 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0-72 0s0 0 0 0c-16.6 0-32.7 1.9-48.3 5.4c-25.9 5.9-49.9 16.4-71.4 30.7c0 0 0 0 0 0C38.3 298.8 0 364.9 0 440l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16c0-48.7 20.7-92.5 53.8-123.2C121.6 392.3 190.3 448 272 448l1 0c132.1-.7 239-130.9 239-291.4c0-42.6-7.5-83.1-21.1-119.6c-2.6-6.9-12.7-6.6-16.2-.1C455.9 72.1 418.7 96 376 96L272 96z"]
};
const faRoad = {
  prefix: 'fas',
  iconName: 'road',
  icon: [576, 512, [128739], "f018", "M256 32l-74.8 0c-27.1 0-51.3 17.1-60.3 42.6L3.1 407.2C1.1 413 0 419.2 0 425.4C0 455.5 24.5 480 54.6 480L256 480l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64 201.4 0c30.2 0 54.6-24.5 54.6-54.6c0-6.2-1.1-12.4-3.1-18.2L455.1 74.6C446 49.1 421.9 32 394.8 32L320 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm64 192l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faTaxi = {
  prefix: 'fas',
  iconName: 'taxi',
  icon: [512, 512, [128662, "cab"], "f1ba", "M192 0c-17.7 0-32 14.3-32 32l0 32 0 .2c-38.6 2.2-72.3 27.3-85.2 64.1L39.6 228.8C16.4 238.4 0 261.3 0 288L0 432l0 48c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-48 320 0 0 48c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-48 0-144c0-26.7-16.4-49.6-39.6-59.2L437.2 128.3c-12.9-36.8-46.6-62-85.2-64.1l0-.2 0-32c0-17.7-14.3-32-32-32L192 0zM165.4 128l181.2 0c13.6 0 25.7 8.6 30.2 21.4L402.9 224l-293.8 0 26.1-74.6c4.5-12.8 16.6-21.4 30.2-21.4zM96 288a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm288 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faCab = faTaxi;
const faPersonCirclePlus = {
  prefix: 'fas',
  iconName: 'person-circle-plus',
  icon: [576, 512, [], "e541", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm16 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0 0-48z"]
};
const faChartPie = {
  prefix: 'fas',
  iconName: 'chart-pie',
  icon: [576, 512, ["pie-chart"], "f200", "M304 240l0-223.4c0-9 7-16.6 16-16.6C443.7 0 544 100.3 544 224c0 9-7.6 16-16.6 16L304 240zM32 272C32 150.7 122.1 50.3 239 34.3c9.2-1.3 17 6.1 17 15.4L256 288 412.5 444.5c6.7 6.7 6.2 17.7-1.5 23.1C371.8 495.6 323.8 512 272 512C139.5 512 32 404.6 32 272zm526.4 16c9.3 0 16.6 7.8 15.4 17c-7.7 55.9-34.6 105.6-73.9 142.3c-6 5.6-15.4 5.2-21.2-.7L320 288l238.4 0z"]
};
const faPieChart = faChartPie;
const faBoltLightning = {
  prefix: 'fas',
  iconName: 'bolt-lightning',
  icon: [384, 512, [], "e0b7", "M0 256L28.5 28c2-16 15.6-28 31.8-28H228.9c15 0 27.1 12.1 27.1 27.1c0 3.2-.6 6.5-1.7 9.5L208 160H347.3c20.2 0 36.7 16.4 36.7 36.7c0 7.4-2.2 14.6-6.4 20.7l-192.2 281c-5.9 8.6-15.6 13.7-25.9 13.7h-2.9c-15.7 0-28.5-12.8-28.5-28.5c0-2.3 .3-4.6 .9-6.9L176 288H32c-17.7 0-32-14.3-32-32z"]
};
const faSackXmark = {
  prefix: 'fas',
  iconName: 'sack-xmark',
  icon: [512, 512, [], "e56a", "M192 96l128 0 47.4-71.1C374.5 14.2 366.9 0 354.1 0L157.9 0c-12.8 0-20.4 14.2-13.3 24.9L192 96zm128 32l-128 0c-3.8 2.5-8.1 5.3-13 8.4c0 0 0 0 0 0s0 0 0 0C122.3 172.7 0 250.9 0 416c0 53 43 96 96 96l320 0c53 0 96-43 96-96c0-165.1-122.3-243.3-179-279.6c-4.8-3.1-9.2-5.9-13-8.4zM289.9 336l47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47z"]
};
const faFileExcel = {
  prefix: 'fas',
  iconName: 'file-excel',
  icon: [384, 512, [], "f1c3", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM155.7 250.2L192 302.1l36.3-51.9c7.6-10.9 22.6-13.5 33.4-5.9s13.5 22.6 5.9 33.4L221.3 344l46.4 66.2c7.6 10.9 5 25.8-5.9 33.4s-25.8 5-33.4-5.9L192 385.8l-36.3 51.9c-7.6 10.9-22.6 13.5-33.4 5.9s-13.5-22.6-5.9-33.4L162.7 344l-46.4-66.2c-7.6-10.9-5-25.8 5.9-33.4s25.8-5 33.4 5.9z"]
};
const faFileContract = {
  prefix: 'fas',
  iconName: 'file-contract',
  icon: [384, 512, [], "f56c", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM80 64l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 96c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm54.2 253.8c-6.1 20.3-24.8 34.2-46 34.2L80 416c-8.8 0-16-7.2-16-16s7.2-16 16-16l8.2 0c7.1 0 13.3-4.6 15.3-11.4l14.9-49.5c3.4-11.3 13.8-19.1 25.6-19.1s22.2 7.7 25.6 19.1l11.6 38.6c7.4-6.2 16.8-9.7 26.8-9.7c15.9 0 30.4 9 37.5 23.2l4.4 8.8 54.1 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-6.1 0-11.6-3.4-14.3-8.8l-8.8-17.7c-1.7-3.4-5.1-5.5-8.8-5.5s-7.2 2.1-8.8 5.5l-8.8 17.7c-2.9 5.9-9.2 9.4-15.7 8.8s-12.1-5.1-13.9-11.3L144 349l-9.8 32.8z"]
};
const faFishFins = {
  prefix: 'fas',
  iconName: 'fish-fins',
  icon: [576, 512, [], "e4f2", "M275.2 38.4c-10.6-8-25-8.5-36.3-1.5S222 57.3 224.6 70.3l9.7 48.6c-19.4 9-36.9 19.9-52.4 31.5c-15.3 11.5-29 23.9-40.7 36.3L48.1 132.4c-12.5-7.3-28.4-5.3-38.6 4.9S-3 163.3 4.2 175.9L50 256 4.2 336.1c-7.2 12.6-5 28.4 5.3 38.6s26.1 12.2 38.6 4.9l93.1-54.3c11.8 12.3 25.4 24.8 40.7 36.3c15.5 11.6 33 22.5 52.4 31.5l-9.7 48.6c-2.6 13 3.1 26.3 14.3 33.3s25.6 6.5 36.3-1.5l77.6-58.2c54.9-4 101.5-27 137.2-53.8c39.2-29.4 67.2-64.7 81.6-89.5c5.8-9.9 5.8-22.2 0-32.1c-14.4-24.8-42.5-60.1-81.6-89.5c-35.8-26.8-82.3-49.8-137.2-53.8L275.2 38.4zM384 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faBuildingFlag = {
  prefix: 'fas',
  iconName: 'building-flag',
  icon: [640, 512, [], "e4d5", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c26.5 0 48-21.5 48-48l0-416c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM448 0c-17.7 0-32 14.3-32 32l0 480 64 0 0-320 144 0c8.8 0 16-7.2 16-16l0-128c0-8.8-7.2-16-16-16L480 32c0-17.7-14.3-32-32-32z"]
};
const faFaceGrinBeam = {
  prefix: 'fas',
  iconName: 'face-grin-beam',
  icon: [512, 512, [128516, "grin-beam"], "f582", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zm-170.5-84s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faGrinBeam = faFaceGrinBeam;
const faObjectUngroup = {
  prefix: 'fas',
  iconName: 'object-ungroup',
  icon: [640, 512, [], "f248", "M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32l209.1 0C339.6 12.9 360.3 0 384 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4l0 113.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32l-209.1 0c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4l0-113.1zM119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4l0 113.1c9.7 5.6 17.8 13.7 23.4 23.4l209.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-113.1c-9.7-5.6-17.8-13.7-23.4-23.4L119.4 96zm192 384c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4l0-40.6 64 0 0 40.6c9.7 5.6 17.8 13.7 23.4 23.4l209.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-113.1c-9.7-5.6-17.8-13.7-23.4-23.4l-46 0c-5.4-15.4-14.6-28.9-26.5-39.6l0-24.4 72.6 0c11.1-19.1 31.7-32 55.4-32c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4l0 113.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32l-209.1 0z"]
};
const faPoop = {
  prefix: 'fas',
  iconName: 'poop',
  icon: [512, 512, [], "f619", "M254.4 6.6c3.5-4.3 9-6.5 14.5-5.7C315.8 7.2 352 47.4 352 96c0 11.2-1.9 22-5.5 32l5.5 0c35.3 0 64 28.7 64 64c0 19.1-8.4 36.3-21.7 48l13.7 0c39.8 0 72 32.2 72 72c0 23.2-11 43.8-28 57c34.1 5.7 60 35.3 60 71c0 39.8-32.2 72-72 72L72 512c-39.8 0-72-32.2-72-72c0-35.7 25.9-65.3 60-71c-17-13.2-28-33.8-28-57c0-39.8 32.2-72 72-72l13.7 0C104.4 228.3 96 211.1 96 192c0-35.3 28.7-64 64-64l16.2 0c44.1-.1 79.8-35.9 79.8-80c0-9.2-1.5-17.9-4.3-26.1c-1.8-5.2-.8-11.1 2.8-15.4z"]
};
const faLocationPin = {
  prefix: 'fas',
  iconName: 'location-pin',
  icon: [384, 512, ["map-marker"], "f041", "M384 192c0 87.4-117 243-168.3 307.2c-12.3 15.3-35.1 15.3-47.4 0C117 435 0 279.4 0 192C0 86 86 0 192 0S384 86 384 192z"]
};
const faMapMarker = faLocationPin;
const faKaaba = {
  prefix: 'fas',
  iconName: 'kaaba',
  icon: [576, 512, [128331], "f66b", "M60 120l228 71.2L516 120 288 48.8 60 120zM278.5 1.5c6.2-1.9 12.9-1.9 19.1 0l256 80C566.9 85.6 576 98 576 112l0 16s0 0 0 0l0 21.2L292.8 237.7c-3.1 1-6.4 1-9.5 0L0 149.2 0 128l0-16C0 98 9.1 85.6 22.5 81.5l256-80zm23.9 266.8L576 182.8l0 46.5-52.8 16.5c-8.4 2.6-13.1 11.6-10.5 20s11.6 13.1 20 10.5L576 262.8 576 400c0 14-9.1 26.4-22.5 30.5l-256 80c-6.2 1.9-12.9 1.9-19.1 0l-256-80C9.1 426.4 0 414 0 400L0 262.8l43.2 13.5c8.4 2.6 17.4-2.1 20-10.5s-2.1-17.4-10.5-20L0 229.2l0-46.5 273.7 85.5c9.3 2.9 19.3 2.9 28.6 0zm-185.5-2.6c-8.4-2.6-17.4 2.1-20 10.5s2.1 17.4 10.5 20l64 20c8.4 2.6 17.4-2.1 20-10.5s-2.1-17.4-10.5-20l-64-20zm352 30.5c8.4-2.6 13.1-11.6 10.5-20s-11.6-13.1-20-10.5l-64 20c-8.4 2.6-13.1 11.6-10.5 20s11.6 13.1 20 10.5l64-20zm-224 9.5c-8.4-2.6-17.4 2.1-20 10.5s2.1 17.4 10.5 20l38.5 12c9.3 2.9 19.3 2.9 28.6 0l38.5-12c8.4-2.6 13.1-11.6 10.5-20s-11.6-13.1-20-10.5l-38.5 12c-3.1 1-6.4 1-9.5 0l-38.5-12z"]
};
const faToiletPaper = {
  prefix: 'fas',
  iconName: 'toilet-paper',
  icon: [640, 512, [129531], "f71e", "M444.2 0C397.2 49.6 384 126.5 384 192c0 158.8-27.3 247-42.7 283.9c-10 24-33.2 36.1-55.4 36.1L48 512c-11.5 0-22.2-6.2-27.8-16.2s-5.6-22.3 .4-32.2c9.8-17.7 15.4-38.2 20.5-57.7C52.3 362.8 64 293.5 64 192C64 86 107 0 160 0L444.2 0zM512 384c-53 0-96-86-96-192S459 0 512 0s96 86 96 192s-43 192-96 192zm0-128c17.7 0 32-28.7 32-64s-14.3-64-32-64s-32 28.7-32 64s14.3 64 32 64zM144 208a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm64 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm80-16a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faHelmetSafety = {
  prefix: 'fas',
  iconName: 'helmet-safety',
  icon: [576, 512, ["hard-hat", "hat-hard"], "f807", "M256 32c-17.7 0-32 14.3-32 32l0 2.3 0 99.6c0 5.6-4.5 10.1-10.1 10.1c-3.6 0-7-1.9-8.8-5.1L157.1 87C83 123.5 32 199.8 32 288l0 64 512 0 0-66.4c-.9-87.2-51.7-162.4-125.1-198.6l-48 83.9c-1.8 3.2-5.2 5.1-8.8 5.1c-5.6 0-10.1-4.5-10.1-10.1l0-99.6 0-2.3c0-17.7-14.3-32-32-32l-64 0zM16.6 384C7.4 384 0 391.4 0 400.6c0 4.7 2 9.2 5.8 11.9C27.5 428.4 111.8 480 288 480s260.5-51.6 282.2-67.5c3.8-2.8 5.8-7.2 5.8-11.9c0-9.2-7.4-16.6-16.6-16.6L16.6 384z"]
};
const faHardHat = faHelmetSafety;
const faHatHard = faHelmetSafety;
const faEject = {
  prefix: 'fas',
  iconName: 'eject',
  icon: [448, 512, [9167], "f052", "M224 32c13.5 0 26.3 5.6 35.4 15.6l176 192c12.9 14 16.2 34.3 8.6 51.8S419 320 400 320L48 320c-19 0-36.3-11.2-43.9-28.7s-4.3-37.7 8.6-51.8l176-192C197.7 37.6 210.5 32 224 32zM0 432c0-26.5 21.5-48 48-48l352 0c26.5 0 48 21.5 48 48s-21.5 48-48 48L48 480c-26.5 0-48-21.5-48-48z"]
};
const faCircleRight = {
  prefix: 'fas',
  iconName: 'circle-right',
  icon: [512, 512, [61838, "arrow-alt-circle-right"], "f35a", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm395.3 11.3l-112 112c-4.6 4.6-11.5 5.9-17.4 3.5s-9.9-8.3-9.9-14.8l0-64-96 0c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32l96 0 0-64c0-6.5 3.9-12.3 9.9-14.8s12.9-1.1 17.4 3.5l112 112c6.2 6.2 6.2 16.4 0 22.6z"]
};
const faArrowAltCircleRight = faCircleRight;
const faPlaneCircleCheck = {
  prefix: 'fas',
  iconName: 'plane-circle-check',
  icon: [640, 512, [], "e555", "M256 0c-35 0-64 59.5-64 93.7l0 84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9l0 65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8l0 42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3l0-84.6C320 59.5 292 0 256 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faFaceRollingEyes = {
  prefix: 'fas',
  iconName: 'face-rolling-eyes',
  icon: [512, 512, [128580, "meh-rolling-eyes"], "f5a5", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 368l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm32-144c0 35.3-28.7 64-64 64s-64-28.7-64-64c0-26 15.5-48.4 37.8-58.4c-3.7 5.2-5.8 11.6-5.8 18.4c0 17.7 14.3 32 32 32s32-14.3 32-32c0-6.9-2.2-13.2-5.8-18.4C208.5 175.6 224 198 224 224zm128 64c-35.3 0-64-28.7-64-64c0-26 15.5-48.4 37.8-58.4c-3.7 5.2-5.8 11.6-5.8 18.4c0 17.7 14.3 32 32 32s32-14.3 32-32c0-6.9-2.2-13.2-5.8-18.4C400.5 175.6 416 198 416 224c0 35.3-28.7 64-64 64z"]
};
const faMehRollingEyes = faFaceRollingEyes;
const faObjectGroup = {
  prefix: 'fas',
  iconName: 'object-group',
  icon: [576, 512, [], "f247", "M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32l337.1 0C467.6 12.9 488.3 0 512 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4l0 273.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32l-337.1 0c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4l0-273.1zM456.6 96L119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4l0 273.1c9.7 5.6 17.8 13.7 23.4 23.4l337.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-273.1c-9.7-5.6-17.8-13.7-23.4-23.4zM128 160c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-96zM256 320l32 0c35.3 0 64-28.7 64-64l0-32 64 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-32z"]
};
const faChartLine = {
  prefix: 'fas',
  iconName: 'chart-line',
  icon: [512, 512, ["line-chart"], "f201", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L240 221.3l57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z"]
};
const faLineChart = faChartLine;
const faMaskVentilator = {
  prefix: 'fas',
  iconName: 'mask-ventilator',
  icon: [640, 512, [], "e524", "M159.1 176C139.4 219.2 128 264.7 128 300.8c0 15.9 2.2 31.4 6.3 46l-31.8-7.9C70.5 330.9 48 302.1 48 269l0-85c0-4.4 3.6-8 8-8l103.1 0zm26-48L56 128c-30.9 0-56 25.1-56 56l0 85c0 55.1 37.5 103.1 90.9 116.4l71.3 17.8c22.7 30.5 55.4 54.1 93.8 66.6l0-76.6c-19.7-16.4-32-40.3-32-66.9c0-49.5 43-134.4 96-134.4c52.5 0 96 84.9 96 134.4c0 26.7-12.4 50.4-32 66.8l0 76.6c38-12.6 70.6-36 93.5-66.4l71.6-17.9C602.5 372.1 640 324.1 640 269l0-85c0-30.9-25.1-56-56-56l-129.5 0C419.7 73.8 372.1 32 320 32c-52.6 0-100.2 41.8-134.9 96zm295.6 48L584 176c4.4 0 8 3.6 8 8l0 85c0 33-22.5 61.8-54.5 69.9l-31.8 8c4.2-14.7 6.4-30.1 6.4-46.1c0-36.1-11.6-81.6-31.3-124.8zM288 320l0 192 64 0 0-192c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faArrowRight = {
  prefix: 'fas',
  iconName: 'arrow-right',
  icon: [448, 512, [8594], "f061", "M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]
};
const faSignsPost = {
  prefix: 'fas',
  iconName: 'signs-post',
  icon: [512, 512, ["map-signs"], "f277", "M224 32L64 32C46.3 32 32 46.3 32 64l0 64c0 17.7 14.3 32 32 32l377.4 0c4.2 0 8.3-1.7 11.3-4.7l48-48c6.2-6.2 6.2-16.4 0-22.6l-48-48c-3-3-7.1-4.7-11.3-4.7L288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32zM480 256c0-17.7-14.3-32-32-32l-160 0 0-32-64 0 0 32L70.6 224c-4.2 0-8.3 1.7-11.3 4.7l-48 48c-6.2 6.2-6.2 16.4 0 22.6l48 48c3 3 7.1 4.7 11.3 4.7L448 352c17.7 0 32-14.3 32-32l0-64zM288 480l0-96-64 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
};
const faMapSigns = faSignsPost;
const faCashRegister = {
  prefix: 'fas',
  iconName: 'cash-register',
  icon: [512, 512, [], "f788", "M64 0C46.3 0 32 14.3 32 32l0 64c0 17.7 14.3 32 32 32l80 0 0 32-57 0c-31.6 0-58.5 23.1-63.3 54.4L1.1 364.1C.4 368.8 0 373.6 0 378.4L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-69.6c0-4.8-.4-9.6-1.1-14.4L488.2 214.4C483.5 183.1 456.6 160 425 160l-217 0 0-32 80 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L64 0zM96 48l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L96 80c-8.8 0-16-7.2-16-16s7.2-16 16-16zM64 432c0-8.8 7.2-16 16-16l352 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16zm48-168a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm120-24a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM160 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM328 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM256 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM424 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM352 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48z"]
};
const faPersonCircleQuestion = {
  prefix: 'fas',
  iconName: 'person-circle-question',
  icon: [576, 512, [], "e542", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM368 321.6l0 6.4c0 8.8 7.2 16 16 16s16-7.2 16-16l0-6.4c0-5.3 4.3-9.6 9.6-9.6l40.5 0c7.7 0 13.9 6.2 13.9 13.9c0 5.2-2.9 9.9-7.4 12.3l-32 16.8c-5.3 2.8-8.6 8.2-8.6 14.2l0 14.8c0 8.8 7.2 16 16 16s16-7.2 16-16l0-5.1 23.5-12.3c15.1-7.9 24.5-23.6 24.5-40.6c0-25.4-20.6-45.9-45.9-45.9l-40.5 0c-23 0-41.6 18.6-41.6 41.6z"]
};
const faH = {
  prefix: 'fas',
  iconName: 'h',
  icon: [384, 512, [104], "48", "M320 256l0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224 0-160c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 128L64 192 64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192 256 0z"]
};
const faTarp = {
  prefix: 'fas',
  iconName: 'tarp',
  icon: [576, 512, [], "e57b", "M576 128c0-35.3-28.7-64-64-64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l352 0 0-128c0-17.7 14.3-32 32-32l128 0 0-160zM448 448L576 320l-128 0 0 128zM96 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faScrewdriverWrench = {
  prefix: 'fas',
  iconName: 'screwdriver-wrench',
  icon: [512, 512, ["tools"], "f7d9", "M78.6 5C69.1-2.4 55.6-1.5 47 7L7 47c-8.5 8.5-9.4 22-2.1 31.6l80 104c4.5 5.9 11.6 9.4 19 9.4l54.1 0 109 109c-14.7 29-10 65.4 14.3 89.6l112 112c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-112-112c-24.2-24.2-60.6-29-89.6-14.3l-109-109 0-54.1c0-7.5-3.5-14.5-9.4-19L78.6 5zM19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L233.7 374.3c-7.8-20.9-9-43.6-3.6-65.1l-61.7-61.7L19.9 396.1zM512 144c0-10.5-1.1-20.7-3.2-30.5c-2.4-11.2-16.1-14.1-24.2-6l-63.9 63.9c-3 3-7.1 4.7-11.3 4.7L352 176c-8.8 0-16-7.2-16-16l0-57.4c0-4.2 1.7-8.3 4.7-11.3l63.9-63.9c8.1-8.1 5.2-21.8-6-24.2C388.7 1.1 378.5 0 368 0C288.5 0 224 64.5 224 144l0 .8 85.3 85.3c36-9.1 75.8 .5 104 28.7L429 274.5c49-23 83-72.8 83-130.5zM56 432a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faTools = faScrewdriverWrench;
const faArrowsToEye = {
  prefix: 'fas',
  iconName: 'arrows-to-eye',
  icon: [640, 512, [], "e4bf", "M15 15C24.4 5.7 39.6 5.7 49 15l63 63L112 40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 96c0 13.3-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l38.1 0L15 49C5.7 39.6 5.7 24.4 15 15zM133.5 243.9C158.6 193.6 222.7 112 320 112s161.4 81.6 186.5 131.9c3.8 7.6 3.8 16.5 0 24.2C481.4 318.4 417.3 400 320 400s-161.4-81.6-186.5-131.9c-3.8-7.6-3.8-16.5 0-24.2zM320 320a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM591 15c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-63 63 38.1 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24s24 10.7 24 24l0 38.1 63-63zM15 497c-9.4-9.4-9.4-24.6 0-33.9l63-63L40 400c-13.3 0-24-10.7-24-24s10.7-24 24-24l96 0c13.3 0 24 10.7 24 24l0 96c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-38.1L49 497c-9.4 9.4-24.6 9.4-33.9 0zm576 0l-63-63 0 38.1c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24l96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-38.1 0 63 63c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0z"]
};
const faPlugCircleBolt = {
  prefix: 'fas',
  iconName: 'plug-circle-bolt',
  icon: [576, 512, [], "e55b", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm47.9-225c4.3 3.7 5.4 9.9 2.6 14.9L452.4 356l35.6 0c5.2 0 9.8 3.3 11.4 8.2s-.1 10.3-4.2 13.4l-96 72c-4.5 3.4-10.8 3.2-15.1-.6s-5.4-9.9-2.6-14.9L411.6 380 376 380c-5.2 0-9.8-3.3-11.4-8.2s.1-10.3 4.2-13.4l96-72c4.5-3.4 10.8-3.2 15.1 .6z"]
};
const faHeart = {
  prefix: 'fas',
  iconName: 'heart',
  icon: [512, 512, [128153, 128154, 128155, 128156, 128420, 129293, 129294, 129505, 9829, 10084, 61578], "f004", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"]
};
const faMarsAndVenus = {
  prefix: 'fas',
  iconName: 'mars-and-venus',
  icon: [512, 512, [9893], "f224", "M337.8 14.8C341.5 5.8 350.3 0 360 0L472 0c13.3 0 24 10.7 24 24l0 112c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-24.7 24.7C407 163.3 416 192.6 416 224c0 80.2-59 146.6-136 158.2l0 25.8 24 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-24 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-25.8C155 370.6 96 304.2 96 224c0-88.4 71.6-160 160-160c39.6 0 75.9 14.4 103.8 38.2L382.1 80 343 41c-6.9-6.9-8.9-17.2-5.2-26.2zM448 48s0 0 0 0s0 0 0 0s0 0 0 0zM352 224a96 96 0 1 0 -192 0 96 96 0 1 0 192 0z"]
};
const faHouseUser = {
  prefix: 'fas',
  iconName: 'house-user',
  icon: [576, 512, ["home-user"], "e1b0", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c.2 35.5-28.5 64.3-64 64.3l-320.4 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24zM352 224a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zm-96 96c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80l-64 0z"]
};
const faHomeUser = faHouseUser;
const faDumpsterFire = {
  prefix: 'fas',
  iconName: 'dumpster-fire',
  icon: [640, 512, [], "f794", "M49.7 32l90.8 0L114.9 160l-94 0C9.3 160 0 150.7 0 139.1c0-2.1 .3-4.1 .9-6.1L26.8 48.9C29.9 38.9 39.2 32 49.7 32zM272 160l-124.5 0L173.1 32 272 32l0 128zm32 0l0-128 98.9 0 14.4 72.1c-1.7 1.1-3.3 2.4-4.8 3.8c-18.4 16.4-35.4 34-50.5 52.1l-58 0zm209.9-23.7c-1.7 1.6-3.4 3.2-5 4.8C498 129.6 486.7 118.6 475 108c-7.6-6.9-17-10.8-26.6-11.8L435.5 32l90.8 0c10.5 0 19.8 6.9 22.9 16.9L575.1 133c.2 .7 .4 1.4 .5 2.1c-17.8-15-44.3-14.6-61.7 1.2zM325.2 210.7C304.3 244.5 288 282.9 288 318.1c0 49.3 18.6 95.2 49.6 129.9L128 448c0 17.7-14.3 32-32 32s-32-14.3-32-32L44 288l-12 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l4 0-4-32 305.5 0c-4.4 6.2-8.5 12.5-12.3 18.7zm180.6-34.5L518 162.5c5.4-6.1 13.3-8.8 20.9-8.9c7.2 0 14.3 2.6 19.9 7.8c19.7 18.3 39.8 43.2 55 70.6C629 259.2 640 290.2 640 320.2C640 408.8 568.7 480 480 480c-89.6 0-160-71.3-160-159.8c0-37.3 16-73.4 36.8-104.5c20.9-31.3 47.5-59 70.9-80.2c5.7-5.2 13.1-7.7 20.3-7.5c14.1 .3 23.8 11.4 32.7 21.6c0 0 0 0 0 0c2 2.3 4 4.6 6 6.7l19 19.9zM544 368.2c0-36.5-37-73-54.8-88.4c-5.4-4.7-13.1-4.7-18.5 0C453 295.1 416 331.6 416 368.2c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faHouseCrack = {
  prefix: 'fas',
  iconName: 'house-crack',
  icon: [576, 512, [], "e3b1", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 160.4c0 35.3 28.7 64 64 64l102.3 0-31.3-52.2c-4.1-6.8-2.6-15.5 3.5-20.5L288 368l-60.2-82.8c-10.9-15 8.2-33.5 22.8-22l117.9 92.6c8 6.3 8.2 18.4 .4 24.9L288 448l38.4 64 122.1 0c35.5 0 64.2-28.8 64-64.3l-.7-160.2 32 0z"]
};
const faMartiniGlassCitrus = {
  prefix: 'fas',
  iconName: 'martini-glass-citrus',
  icon: [576, 512, ["cocktail"], "f561", "M432 240c53 0 96-43 96-96s-43-96-96-96c-35.5 0-66.6 19.3-83.2 48l-52.6 0C316 40.1 369.3 0 432 0c79.5 0 144 64.5 144 144s-64.5 144-144 144c-27.7 0-53.5-7.8-75.5-21.3l35.4-35.4c12.2 5.6 25.8 8.7 40.1 8.7zM1.8 142.8C5.5 133.8 14.3 128 24 128l368 0c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-177 177L232 464l64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0-88 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-118.1L7 169c-6.9-6.9-8.9-17.2-5.2-26.2z"]
};
const faCocktail = faMartiniGlassCitrus;
const faFaceSurprise = {
  prefix: 'fas',
  iconName: 'face-surprise',
  icon: [512, 512, [128558, "surprise"], "f5c2", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM256 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faSurprise = faFaceSurprise;
const faBottleWater = {
  prefix: 'fas',
  iconName: 'bottle-water',
  icon: [320, 512, [], "e4c5", "M120 0l80 0c13.3 0 24 10.7 24 24l0 40L96 64l0-40c0-13.3 10.7-24 24-24zM32 167.5c0-19.5 10-37.6 26.6-47.9l15.8-9.9C88.7 100.7 105.2 96 122.1 96l75.8 0c16.9 0 33.4 4.7 47.7 13.7l15.8 9.9C278 129.9 288 148 288 167.5c0 17-7.5 32.3-19.4 42.6C280.6 221.7 288 238 288 256c0 19.1-8.4 36.3-21.7 48c13.3 11.7 21.7 28.9 21.7 48s-8.4 36.3-21.7 48c13.3 11.7 21.7 28.9 21.7 48c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64c0-19.1 8.4-36.3 21.7-48C40.4 388.3 32 371.1 32 352s8.4-36.3 21.7-48C40.4 292.3 32 275.1 32 256c0-18 7.4-34.3 19.4-45.9C39.5 199.7 32 184.5 32 167.5zM96 240c0 8.8 7.2 16 16 16l96 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-96 0c-8.8 0-16 7.2-16 16zm16 112c-8.8 0-16 7.2-16 16s7.2 16 16 16l96 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-96 0z"]
};
const faCirclePause = {
  prefix: 'fas',
  iconName: 'circle-pause',
  icon: [512, 512, [62092, "pause-circle"], "f28b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM224 192l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faPauseCircle = faCirclePause;
const faToiletPaperSlash = {
  prefix: 'fas',
  iconName: 'toilet-paper-slash',
  icon: [640, 512, [], "e072", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-109.7-86C569.9 374 608 291.9 608 192C608 86 565 0 512 0s-96 86-96 192c0 49.1 9.2 93.9 24.4 127.9l-59-46.2c1.6-24.8 2.6-52 2.6-81.6c0-65.5 13.2-142.4 60.2-192L160 0c-24.8 0-47.4 18.8-64.4 49.6L38.8 5.1zM367.3 385.4L66.5 148.4C64.9 162.4 64 177 64 192c0 101.5-11.7 170.8-23 213.9c-5.1 19.4-10.7 39.9-20.5 57.7c-5.9 9.9-6.1 22.1-.4 32.2S36.5 512 48 512l237.9 0c22.3 0 45.4-12.1 55.4-36.1c7.4-17.7 17.5-47.2 26-90.6zM544 192c0 35.3-14.3 64-32 64s-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64z"]
};
const faAppleWhole = {
  prefix: 'fas',
  iconName: 'apple-whole',
  icon: [448, 512, [127822, 127823, "apple-alt"], "f5d1", "M224 112c-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80l16 0c8.8 0 16 7.2 16 16l0 16c0 44.2-35.8 80-80 80l-16 0zM0 288c0-76.3 35.7-160 112-160c27.3 0 59.7 10.3 82.7 19.3c18.8 7.3 39.9 7.3 58.7 0c22.9-8.9 55.4-19.3 82.7-19.3c76.3 0 112 83.7 112 160c0 128-80 224-160 224c-16.5 0-38.1-6.6-51.5-11.3c-8.1-2.8-16.9-2.8-25 0c-13.4 4.7-35 11.3-51.5 11.3C80 512 0 416 0 288z"]
};
const faAppleAlt = faAppleWhole;
const faKitchenSet = {
  prefix: 'fas',
  iconName: 'kitchen-set',
  icon: [576, 512, [], "e51a", "M240 144A96 96 0 1 0 48 144a96 96 0 1 0 192 0zm44.4 32C269.9 240.1 212.5 288 144 288C64.5 288 0 223.5 0 144S64.5 0 144 0c68.5 0 125.9 47.9 140.4 112l71.8 0c8.8-9.8 21.6-16 35.8-16l104 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-104 0c-14.2 0-27-6.2-35.8-16l-71.8 0zM144 80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM400 240c13.3 0 24 10.7 24 24l0 8 96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-240 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l96 0 0-8c0-13.3 10.7-24 24-24zM288 464l0-112 224 0 0 112c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48zM48 320l80 0 16 0 32 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-16 0c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-80c0-8.8 7.2-16 16-16zm128 64c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0 32 16 0zM24 464l176 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faR = {
  prefix: 'fas',
  iconName: 'r',
  icon: [320, 512, [114], "52", "M64 32C28.7 32 0 60.7 0 96L0 288 0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 95.3 0L261.8 466.4c10.1 14.5 30.1 18 44.6 7.9s18-30.1 7.9-44.6L230.1 309.5C282.8 288.1 320 236.4 320 176c0-79.5-64.5-144-144-144L64 32zM176 256L64 256 64 96l112 0c44.2 0 80 35.8 80 80s-35.8 80-80 80z"]
};
const faTemperatureQuarter = {
  prefix: 'fas',
  iconName: 'temperature-quarter',
  icon: [320, 512, ["temperature-1", "thermometer-1", "thermometer-quarter"], "f2ca", "M160 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L208 112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L48 112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3l0-50.7c0-8.8 7.2-16 16-16s16 7.2 16 16l0 50.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faTemperature1 = faTemperatureQuarter;
const faThermometer1 = faTemperatureQuarter;
const faThermometerQuarter = faTemperatureQuarter;
const faCube = {
  prefix: 'fas',
  iconName: 'cube',
  icon: [512, 512, [], "f1b2", "M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6l0 242.9c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4L0 134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1 0-188L288 246.6l0 188z"]
};
const faBitcoinSign = {
  prefix: 'fas',
  iconName: 'bitcoin-sign',
  icon: [320, 512, [], "e0b4", "M48 32C48 14.3 62.3 0 80 0s32 14.3 32 32l0 32 32 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32c0 1.5-.1 3.1-.3 4.5C254.1 82.2 288 125.1 288 176c0 24.2-7.7 46.6-20.7 64.9c31.7 19.8 52.7 55 52.7 95.1c0 61.9-50.1 112-112 112l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-6.3 0C18.7 448 0 429.3 0 406.3L0 288l0-22.3L0 224 0 101.6C0 80.8 16.8 64 37.6 64L48 64l0-32zM64 224l112 0c26.5 0 48-21.5 48-48s-21.5-48-48-48L64 128l0 96zm112 64L64 288l0 96 144 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-32 0z"]
};
const faShieldDog = {
  prefix: 'fas',
  iconName: 'shield-dog',
  icon: [512, 512, [], "e573", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM160.9 286.2c4.8 1.2 9.9 1.8 15.1 1.8c35.3 0 64-28.7 64-64l0-64 44.2 0c12.1 0 23.2 6.8 28.6 17.7L320 192l64 0c8.8 0 16 7.2 16 16l0 32c0 44.2-35.8 80-80 80l-48 0 0 50.7c0 7.3-5.9 13.3-13.3 13.3c-1.8 0-3.6-.4-5.2-1.1l-98.7-42.3c-6.6-2.8-10.8-9.3-10.8-16.4c0-2.8 .6-5.5 1.9-8l15-30zM160 160l40 0 8 0 0 32 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-48c0-8.8 7.2-16 16-16zm128 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faSolarPanel = {
  prefix: 'fas',
  iconName: 'solar-panel',
  icon: [640, 512, [], "f5ba", "M122.2 0C91.7 0 65.5 21.5 59.5 51.4L8.3 307.4C.4 347 30.6 384 71 384l217 0 0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64 217 0c40.4 0 70.7-36.9 62.8-76.6l-51.2-256C574.5 21.5 548.3 0 517.8 0L122.2 0zM260.9 64l118.2 0 10.4 104-139 0L260.9 64zM202.3 168l-100.8 0L122.2 64l90.4 0L202.3 168zM91.8 216l105.6 0L187.1 320 71 320 91.8 216zm153.9 0l148.6 0 10.4 104-169.4 0 10.4-104zm196.8 0l105.6 0L569 320l-116 0L442.5 216zm96-48l-100.8 0L427.3 64l90.4 0 31.4-6.3L517.8 64l20.8 104z"]
};
const faLockOpen = {
  prefix: 'fas',
  iconName: 'lock-open',
  icon: [576, 512, [], "f3c1", "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z"]
};
const faElevator = {
  prefix: 'fas',
  iconName: 'elevator',
  icon: [512, 512, [], "e16d", "M132.7 4.7l-64 64c-4.6 4.6-5.9 11.5-3.5 17.4s8.3 9.9 14.8 9.9l128 0c6.5 0 12.3-3.9 14.8-9.9s1.1-12.9-3.5-17.4l-64-64c-6.2-6.2-16.4-6.2-22.6 0zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 128zm96 96a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM80 400c0-26.5 21.5-48 48-48l64 0c26.5 0 48 21.5 48 48l0 16c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-16zm192 0c0-26.5 21.5-48 48-48l64 0c26.5 0 48 21.5 48 48l0 16c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-16zm32-128a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM356.7 91.3c6.2 6.2 16.4 6.2 22.6 0l64-64c4.6-4.6 5.9-11.5 3.5-17.4S438.5 0 432 0L304 0c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l64 64z"]
};
const faMoneyBillTransfer = {
  prefix: 'fas',
  iconName: 'money-bill-transfer',
  icon: [640, 512, [], "e528", "M535 41c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l64 64c4.5 4.5 7 10.6 7 17s-2.5 12.5-7 17l-64 64c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l23-23L384 112c-13.3 0-24-10.7-24-24s10.7-24 24-24l174.1 0L535 41zM105 377l-23 23L256 400c13.3 0 24 10.7 24 24s-10.7 24-24 24L81.9 448l23 23c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 441c-4.5-4.5-7-10.6-7-17s2.5-12.5 7-17l64-64c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM96 64l241.9 0c-3.7 7.2-5.9 15.3-5.9 24c0 28.7 23.3 52 52 52l117.4 0c-4 17 .6 35.5 13.8 48.8c20.3 20.3 53.2 20.3 73.5 0L608 169.5 608 384c0 35.3-28.7 64-64 64l-241.9 0c3.7-7.2 5.9-15.3 5.9-24c0-28.7-23.3-52-52-52l-117.4 0c4-17-.6-35.5-13.8-48.8c-20.3-20.3-53.2-20.3-73.5 0L32 342.5 32 128c0-35.3 28.7-64 64-64zm64 64l-64 0 0 64c35.3 0 64-28.7 64-64zM544 320c-35.3 0-64 28.7-64 64l64 0 0-64zM320 352a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"]
};
const faMoneyBillTrendUp = {
  prefix: 'fas',
  iconName: 'money-bill-trend-up',
  icon: [512, 512, [], "e529", "M470.7 9.4c3 3.1 5.3 6.6 6.9 10.3s2.4 7.8 2.4 12.2c0 0 0 .1 0 .1c0 0 0 0 0 0l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.7L310.6 214.6c-11.8 11.8-30.8 12.6-43.5 1.7L176 138.1 84.8 216.3c-13.4 11.5-33.6 9.9-45.1-3.5s-9.9-33.6 3.5-45.1l112-96c12-10.3 29.7-10.3 41.7 0l89.5 76.7L370.7 64 352 64c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0s0 0 0 0c8.8 0 16.8 3.6 22.6 9.3l.1 .1zM0 304c0-26.5 21.5-48 48-48l416 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 304zM48 416l0 48 48 0c0-26.5-21.5-48-48-48zM96 304l-48 0 0 48c26.5 0 48-21.5 48-48zM464 416c-26.5 0-48 21.5-48 48l48 0 0-48zM416 304c0 26.5 21.5 48 48 48l0-48-48 0zm-96 80a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faHouseFloodWaterCircleArrowRight = {
  prefix: 'fas',
  iconName: 'house-flood-water-circle-arrow-right',
  icon: [640, 512, [], "e50f", "M288 144A144 144 0 1 0 0 144a144 144 0 1 0 288 0zM140.7 76.7c6.2-6.2 16.4-6.2 22.6 0l56 56c6.2 6.2 6.2 16.4 0 22.6l-56 56c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L169.4 160 80 160c-8.8 0-16-7.2-16-16s7.2-16 16-16l89.4 0L140.7 99.3c-6.2-6.2-6.2-16.4 0-22.6zM320 144c0 57.3-27.4 108.2-69.8 140.3c11.8-3.6 23-9.4 33-16.2c22.1-15.5 51.6-15.5 73.7 0c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.4 78.1 3.4c2.1 1.7 4.2 3.3 6.5 4.9l-.3-84.4 16.6 0c13.9 0 26.1-8.9 30.4-22.1s-.4-27.6-11.6-35.8l-176-128C407.6-2 392.4-2 381.2 6.1L301 64.4c12.1 23.9 19 50.9 19 79.6zm18.5 165.9c-11.1-7.9-25.9-7.9-37 0C279 325.4 251.5 336 224 336c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C158.5 389.7 191 400 224 400c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.6 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.5-27.3-10.1-39.2-1.7c0 0 0 0 0 0C471.4 325.2 442.9 336 416 336c-27.5 0-55-10.6-77.5-26.1zm0 112c-11.1-7.9-25.9-7.9-37 0C279 437.4 251.5 448 224 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C158.5 501.7 191 512 224 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.6 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C471.4 437.2 442.9 448 416 448c-27.5 0-55-10.6-77.5-26.1z"]
};
const faSquarePollHorizontal = {
  prefix: 'fas',
  iconName: 'square-poll-horizontal',
  icon: [448, 512, ["poll-h"], "f682", "M448 96c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320zM256 160c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32zm64 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l192 0zM192 352c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32z"]
};
const faPollH = faSquarePollHorizontal;
const faCircle = {
  prefix: 'fas',
  iconName: 'circle',
  icon: [512, 512, [128308, 128309, 128992, 128993, 128994, 128995, 128996, 9679, 9898, 9899, 11044, 61708, 61915], "f111", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"]
};
const faBackwardFast = {
  prefix: 'fas',
  iconName: 'backward-fast',
  icon: [512, 512, [9198, "fast-backward"], "f049", "M493.6 445c-11.2 5.3-24.5 3.6-34.1-4.4L288 297.7 288 416c0 12.4-7.2 23.7-18.4 29s-24.5 3.6-34.1-4.4L64 297.7 64 416c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 96C0 78.3 14.3 64 32 64s32 14.3 32 32l0 118.3L235.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S288 83.6 288 96l0 118.3L459.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S512 83.6 512 96l0 320c0 12.4-7.2 23.7-18.4 29z"]
};
const faFastBackward = faBackwardFast;
const faRecycle = {
  prefix: 'fas',
  iconName: 'recycle',
  icon: [512, 512, [9842, 9850, 9851], "f1b8", "M174.7 45.1C192.2 17 223 0 256 0s63.8 17 81.3 45.1l38.6 61.7 27-15.6c8.4-4.9 18.9-4.2 26.6 1.7s11.1 15.9 8.6 25.3l-23.4 87.4c-3.4 12.8-16.6 20.4-29.4 17l-87.4-23.4c-9.4-2.5-16.3-10.4-17.6-20s3.4-19.1 11.8-23.9l28.4-16.4L283 79c-5.8-9.3-16-15-27-15s-21.2 5.7-27 15l-17.5 28c-9.2 14.8-28.6 19.5-43.6 10.5c-15.3-9.2-20.2-29.2-10.7-44.4l17.5-28zM429.5 251.9c15-9 34.4-4.3 43.6 10.5l24.4 39.1c9.4 15.1 14.4 32.4 14.6 50.2c.3 53.1-42.7 96.4-95.8 96.4L320 448l0 32c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-64-64c-9.4-9.4-9.4-24.6 0-33.9l64-64c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 32 96.2 0c17.6 0 31.9-14.4 31.8-32c0-5.9-1.7-11.7-4.8-16.7l-24.4-39.1c-9.5-15.2-4.7-35.2 10.7-44.4zm-364.6-31L36 204.2c-8.4-4.9-13.1-14.3-11.8-23.9s8.2-17.5 17.6-20l87.4-23.4c12.8-3.4 26 4.2 29.4 17L182 241.2c2.5 9.4-.9 19.3-8.6 25.3s-18.2 6.6-26.6 1.7l-26.5-15.3L68.8 335.3c-3.1 5-4.8 10.8-4.8 16.7c-.1 17.6 14.2 32 31.8 32l32.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32.2 0C42.7 448-.3 404.8 0 351.6c.1-17.8 5.1-35.1 14.6-50.2l50.3-80.5z"]
};
const faUserAstronaut = {
  prefix: 'fas',
  iconName: 'user-astronaut',
  icon: [448, 512, [], "f4fb", "M370.7 96.1C346.1 39.5 289.7 0 224 0S101.9 39.5 77.3 96.1C60.9 97.5 48 111.2 48 128l0 64c0 16.8 12.9 30.5 29.3 31.9C101.9 280.5 158.3 320 224 320s122.1-39.5 146.7-96.1c16.4-1.4 29.3-15.1 29.3-31.9l0-64c0-16.8-12.9-30.5-29.3-31.9zM336 144l0 16c0 53-43 96-96 96l-32 0c-53 0-96-43-96-96l0-16c0-26.5 21.5-48 48-48l128 0c26.5 0 48 21.5 48 48zM189.3 162.7l-6-21.2c-.9-3.3-3.9-5.5-7.3-5.5s-6.4 2.2-7.3 5.5l-6 21.2-21.2 6c-3.3 .9-5.5 3.9-5.5 7.3s2.2 6.4 5.5 7.3l21.2 6 6 21.2c.9 3.3 3.9 5.5 7.3 5.5s6.4-2.2 7.3-5.5l6-21.2 21.2-6c3.3-.9 5.5-3.9 5.5-7.3s-2.2-6.4-5.5-7.3l-21.2-6zM112.7 316.5C46.7 342.6 0 407 0 482.3C0 498.7 13.3 512 29.7 512l98.3 0 0-64c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32l0 64 98.3 0c16.4 0 29.7-13.3 29.7-29.7c0-75.3-46.7-139.7-112.7-165.8C303.9 338.8 265.5 352 224 352s-79.9-13.2-111.3-35.5zM176 448c-8.8 0-16 7.2-16 16l0 48 32 0 0-48c0-8.8-7.2-16-16-16zm96 32a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faPlaneSlash = {
  prefix: 'fas',
  iconName: 'plane-slash',
  icon: [640, 512, [], "e069", "M514.3 192c34.2 0 93.7 29 93.7 64c0 36-59.5 64-93.7 64l-73.8 0L630.8 469.1c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2S28.4-3.1 38.8 5.1L238.1 161.3 197.8 20.4C194.9 10.2 202.6 0 213.2 0l56.2 0c11.5 0 22.1 6.2 27.8 16.1L397.7 192l116.6 0zM41.5 128.7l321 252.9L297.2 495.9c-5.7 10-16.3 16.1-27.8 16.1l-56.2 0c-10.6 0-18.3-10.2-15.4-20.4l49-171.6L144 320l-43.2 57.6c-3 4-7.8 6.4-12.8 6.4l-42 0c-7.8 0-14-6.3-14-14c0-1.3 .2-2.6 .5-3.9L64 256 32.5 145.9c-.4-1.3-.5-2.6-.5-3.9c0-6.2 4-11.4 9.5-13.3z"]
};
const faTrademark = {
  prefix: 'fas',
  iconName: 'trademark',
  icon: [640, 512, [8482], "f25c", "M345.6 108.8c-8.3-11-22.7-15.5-35.7-11.2S288 114.2 288 128l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 86.4 115.2c6 8.1 15.5 12.8 25.6 12.8s19.6-4.7 25.6-12.8L576 224l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-256c0-13.8-8.8-26-21.9-30.4s-27.5 .1-35.7 11.2L464 266.7 345.6 108.8zM0 128c0 17.7 14.3 32 32 32l64 0 0 224c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 96C14.3 96 0 110.3 0 128z"]
};
const faBasketball = {
  prefix: 'fas',
  iconName: 'basketball',
  icon: [512, 512, [127936, "basketball-ball"], "f434", "M86.6 64l85.2 85.2C194.5 121.7 208 86.4 208 48c0-14.7-2-28.9-5.7-42.4C158.6 15 119 35.5 86.6 64zM64 86.6C35.5 119 15 158.6 5.6 202.3C19.1 206 33.3 208 48 208c38.4 0 73.7-13.5 101.3-36.1L64 86.6zM256 0c-7.3 0-14.6 .3-21.8 .9C238 16 240 31.8 240 48c0 47.3-17.1 90.5-45.4 124L256 233.4 425.4 64C380.2 24.2 320.9 0 256 0zM48 240c-16.2 0-32-2-47.1-5.8C.3 241.4 0 248.7 0 256c0 64.9 24.2 124.2 64 169.4L233.4 256 172 194.6C138.5 222.9 95.3 240 48 240zm463.1 37.8c.6-7.2 .9-14.5 .9-21.8c0-64.9-24.2-124.2-64-169.4L278.6 256 340 317.4c33.4-28.3 76.7-45.4 124-45.4c16.2 0 32 2 47.1 5.8zm-4.7 31.9C492.9 306 478.7 304 464 304c-38.4 0-73.7 13.5-101.3 36.1L448 425.4c28.5-32.3 49.1-71.9 58.4-115.7zM340.1 362.7C317.5 390.3 304 425.6 304 464c0 14.7 2 28.9 5.7 42.4C353.4 497 393 476.5 425.4 448l-85.2-85.2zM317.4 340L256 278.6 86.6 448c45.1 39.8 104.4 64 169.4 64c7.3 0 14.6-.3 21.8-.9C274 496 272 480.2 272 464c0-47.3 17.1-90.5 45.4-124z"]
};
const faBasketballBall = faBasketball;
const faSatelliteDish = {
  prefix: 'fas',
  iconName: 'satellite-dish',
  icon: [512, 512, [128225], "f7c0", "M192 32c0-17.7 14.3-32 32-32C383.1 0 512 128.9 512 288c0 17.7-14.3 32-32 32s-32-14.3-32-32C448 164.3 347.7 64 224 64c-17.7 0-32-14.3-32-32zM60.6 220.6L164.7 324.7l28.4-28.4c-.7-2.6-1.1-5.4-1.1-8.3c0-17.7 14.3-32 32-32s32 14.3 32 32s-14.3 32-32 32c-2.9 0-5.6-.4-8.3-1.1l-28.4 28.4L291.4 451.4c14.5 14.5 11.8 38.8-7.3 46.3C260.5 506.9 234.9 512 208 512C93.1 512 0 418.9 0 304c0-26.9 5.1-52.5 14.4-76.1c7.5-19 31.8-21.8 46.3-7.3zM224 96c106 0 192 86 192 192c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-70.7-57.3-128-128-128c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faCircleUp = {
  prefix: 'fas',
  iconName: 'circle-up',
  icon: [512, 512, [61467, "arrow-alt-circle-up"], "f35b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm11.3-395.3l112 112c4.6 4.6 5.9 11.5 3.5 17.4s-8.3 9.9-14.8 9.9l-64 0 0 96c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-96-64 0c-6.5 0-12.3-3.9-14.8-9.9s-1.1-12.9 3.5-17.4l112-112c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faArrowAltCircleUp = faCircleUp;
const faMobileScreenButton = {
  prefix: 'fas',
  iconName: 'mobile-screen-button',
  icon: [384, 512, ["mobile-alt"], "f3cd", "M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM224 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM304 64L80 64l0 320 224 0 0-320z"]
};
const faMobileAlt = faMobileScreenButton;
const faVolumeHigh = {
  prefix: 'fas',
  iconName: 'volume-high',
  icon: [640, 512, [128266, "volume-up"], "f028", "M533.6 32.5C598.5 85.2 640 165.8 640 256s-41.5 170.7-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64l0 384c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352 64 352c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l67.8 0L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z"]
};
const faVolumeUp = faVolumeHigh;
const faUsersRays = {
  prefix: 'fas',
  iconName: 'users-rays',
  icon: [640, 512, [], "e593", "M41 7C31.6-2.3 16.4-2.3 7 7S-2.3 31.6 7 41l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L41 7zM599 7L527 79c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0zM7 505c9.4 9.4 24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L7 471c-9.4 9.4-9.4 24.6 0 33.9zm592 0c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-72-72c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72zM320 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM212.1 336c-2.7 7.5-4.1 15.6-4.1 24c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24c0-8.4-1.4-16.5-4.1-24c-.5-1.4-1-2.7-1.6-4c-9.4-22.3-29.8-38.9-54.3-43c-3.9-.7-7.9-1-12-1l-80 0c-4.1 0-8.1 .3-12 1c-.8 .1-1.7 .3-2.5 .5c-24.9 5.1-45.1 23-53.4 46.5zM175.8 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-26.5 32C119.9 256 96 279.9 96 309.3c0 14.7 11.9 26.7 26.7 26.7l56.1 0c8-34.1 32.8-61.7 65.2-73.6c-7.5-4.1-16.2-6.4-25.3-6.4l-69.3 0zm368 80c14.7 0 26.7-11.9 26.7-26.7c0-29.5-23.9-53.3-53.3-53.3l-69.3 0c-9.2 0-17.8 2.3-25.3 6.4c32.4 11.9 57.2 39.5 65.2 73.6l56.1 0zM464 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faWallet = {
  prefix: 'fas',
  iconName: 'wallet',
  icon: [512, 512, [], "f555", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L80 128c-8.8 0-16-7.2-16-16s7.2-16 16-16l368 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32zM416 272a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faClipboardCheck = {
  prefix: 'fas',
  iconName: 'clipboard-check',
  icon: [384, 512, [], "f46c", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faFileAudio = {
  prefix: 'fas',
  iconName: 'file-audio',
  icon: [384, 512, [], "f1c7", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zm2 226.3c37.1 22.4 62 63.1 62 109.7s-24.9 87.3-62 109.7c-7.6 4.6-17.4 2.1-22-5.4s-2.1-17.4 5.4-22C269.4 401.5 288 370.9 288 336s-18.6-65.5-46.5-82.3c-7.6-4.6-10-14.4-5.4-22s14.4-10 22-5.4zm-91.9 30.9c6 2.5 9.9 8.3 9.9 14.8l0 128c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5L113.4 376 80 376c-8.8 0-16-7.2-16-16l0-48c0-8.8 7.2-16 16-16l33.4 0 35.3-35.3c4.6-4.6 11.5-5.9 17.4-3.5zm51 34.9c6.6-5.9 16.7-5.3 22.6 1.3C249.8 304.6 256 319.6 256 336s-6.2 31.4-16.3 42.7c-5.9 6.6-16 7.1-22.6 1.3s-7.1-16-1.3-22.6c5.1-5.7 8.1-13.1 8.1-21.3s-3.1-15.7-8.1-21.3c-5.9-6.6-5.3-16.7 1.3-22.6z"]
};
const faBurger = {
  prefix: 'fas',
  iconName: 'burger',
  icon: [512, 512, ["hamburger"], "f805", "M61.1 224C45 224 32 211 32 194.9c0-1.9 .2-3.7 .6-5.6C37.9 168.3 78.8 32 256 32s218.1 136.3 223.4 157.3c.5 1.9 .6 3.7 .6 5.6c0 16.1-13 29.1-29.1 29.1L61.1 224zM144 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm240 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32zM272 96a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zM16 304c0-26.5 21.5-48 48-48l384 0c26.5 0 48 21.5 48 48s-21.5 48-48 48L64 352c-26.5 0-48-21.5-48-48zm16 96c0-8.8 7.2-16 16-16l416 0c8.8 0 16 7.2 16 16l0 16c0 35.3-28.7 64-64 64L96 480c-35.3 0-64-28.7-64-64l0-16z"]
};
const faHamburger = faBurger;
const faWrench = {
  prefix: 'fas',
  iconName: 'wrench',
  icon: [512, 512, [128295], "f0ad", "M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7L336 192c-8.8 0-16-7.2-16-16l0-57.4c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-21.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faBugs = {
  prefix: 'fas',
  iconName: 'bugs',
  icon: [576, 512, [], "e4d0", "M164.5 107.4l33.4-73.5c5.5-12.1 .1-26.3-11.9-31.8s-26.3-.1-31.8 11.9L128 71.7 101.9 14.1C96.4 2 82.1-3.3 70.1 2.1S52.7 21.9 58.1 33.9l33.4 73.5c-10.2 7.1-18.2 17-22.9 28.6l-17 0-4.1-20.7c-2.6-13-15.2-21.4-28.2-18.8S-2.1 111.7 .5 124.7l8 40C10.7 175.9 20.6 184 32 184l32 0 0 23.3-37.8 9.5c-9.5 2.4-16.6 10.2-17.9 19.9l-8 56c-1.9 13.1 7.2 25.3 20.4 27.2s25.3-7.2 27.2-20.4l5.7-40 18.4-4.6C82.7 274.6 103.8 288 128 288s45.3-13.4 56.1-33.2l18.4 4.6 5.7 40c1.9 13.1 14 22.2 27.2 20.4s22.2-14 20.4-27.2l-8-56c-1.4-9.7-8.5-17.5-17.9-19.9L192 207.3l0-23.3 32 0c11.4 0 21.3-8.1 23.5-19.3l8-40c2.6-13-5.8-25.6-18.8-28.2s-25.6 5.8-28.2 18.8L204.3 136l-17 0c-4.7-11.6-12.7-21.5-22.9-28.6zM496 286.5l65.6-47c10.8-7.7 13.3-22.7 5.6-33.5s-22.7-13.3-33.5-5.6l-51.4 36.8 6.1-62.9c1.3-13.2-8.4-24.9-21.6-26.2s-24.9 8.4-26.2 21.6L432.8 250c-12.3 1-24.2 5.6-34.1 13.3L384 254.8l6.8-20c4.2-12.6-2.5-26.2-15-30.4s-26.2 2.5-30.4 15l-13.1 38.6c-3.7 10.8 .8 22.8 10.7 28.5l27.7 16L359 322.7 321.5 312c-9.4-2.7-19.5 .6-25.5 8.3l-34.9 44.5c-8.2 10.4-6.4 25.5 4.1 33.7s25.5 6.4 33.7-4.1l25-31.8 18.2 5.2c-.5 22.6 11 44.7 32 56.8s45.9 11 65.2-.7l13.6 13.2-15.1 37.5c-4.9 12.3 1 26.3 13.3 31.2s26.3-1 31.2-13.3L503.5 440c3.6-9.1 1.4-19.4-5.6-26.2l-28-27.1 11.6-20.1 27.7 16c9.9 5.7 22.5 3.7 30-4.9L566.2 347c8.7-10 7.8-25.1-2.2-33.9s-25.1-7.8-33.9 2.2l-13.9 15.9-14.7-8.5c1.7-12.4-.2-25-5.5-36.2z"]
};
const faRupeeSign = {
  prefix: 'fas',
  iconName: 'rupee-sign',
  icon: [448, 512, [8360, "rupee"], "f156", "M0 64C0 46.3 14.3 32 32 32l80 0c79.5 0 144 64.5 144 144c0 58.8-35.2 109.3-85.7 131.7l51.4 128.4c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8L106.3 320 64 320l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 288 0 64zM64 256l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80L64 96l0 160zm256.5 16.4c-.9 6 0 8.7 .4 9.8c.4 1.1 1.4 2.6 4.2 4.9c7.2 5.7 18.7 10 37.9 16.8l1.3 .5c16 5.6 38.7 13.6 55.7 28.1c9.5 8.1 17.9 18.6 23.1 32.3c5.1 13.7 6.1 28.5 3.8 44c-4.2 28.1-20.5 49.3-43.8 60.9c-22.1 11-48.1 12.5-73.2 8l-.2 0s0 0 0 0c-9.3-1.8-20.5-5.7-29.3-9c-6-2.3-12.6-4.9-17.7-6.9c0 0 0 0 0 0c-2.5-1-4.6-1.8-6.3-2.5c-16.5-6.4-24.6-25-18.2-41.4s24.9-24.6 41.4-18.2c2.6 1 5.2 2 7.9 3.1c0 0 0 0 0 0c4.8 1.9 9.8 3.9 15.4 6c8.8 3.3 15.3 5.4 18.7 6c15.7 2.8 26.7 .8 32.9-2.3c5-2.5 8-6 9.1-13c1-6.9 .2-10.5-.5-12.3c-.6-1.7-1.8-3.6-4.5-5.9c-6.9-5.8-18.2-10.4-36.9-17l-3-1.1c-15.5-5.4-37-13-53.3-25.9c-9.5-7.5-18.3-17.6-23.7-31c-5.5-13.4-6.6-28-4.4-43.2c8.4-57.1 67-78 116.9-68.9c6.9 1.3 27.3 5.8 35.4 8.4c16.9 5.2 26.3 23.2 21.1 40.1s-23.2 26.3-40.1 21.1c-4.7-1.4-22.3-5.5-27.9-6.5c-14.6-2.7-25.8-.4-32.6 3.2c-6.3 3.3-8.9 7.6-9.5 12z"]
};
const faRupee = faRupeeSign;
const faFileImage = {
  prefix: 'fas',
  iconName: 'file-image',
  icon: [384, 512, [128443], "f1c5", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM64 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm152 32c5.3 0 10.2 2.6 13.2 6.9l88 128c3.4 4.9 3.7 11.3 1 16.5s-8.2 8.6-14.2 8.6l-88 0-40 0-48 0-48 0c-5.8 0-11.1-3.1-13.9-8.1s-2.8-11.2 .2-16.1l48-80c2.9-4.8 8.1-7.8 13.7-7.8s10.8 2.9 13.7 7.8l12.8 21.4 48.3-70.2c3-4.3 7.9-6.9 13.2-6.9z"]
};
const faCircleQuestion = {
  prefix: 'fas',
  iconName: 'circle-question',
  icon: [512, 512, [62108, "question-circle"], "f059", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faQuestionCircle = faCircleQuestion;
const faPlaneDeparture = {
  prefix: 'fas',
  iconName: 'plane-departure',
  icon: [640, 512, [128747], "f5b0", "M381 114.9L186.1 41.8c-16.7-6.2-35.2-5.3-51.1 2.7L89.1 67.4C78 73 77.2 88.5 87.6 95.2l146.9 94.5L136 240 77.8 214.1c-8.7-3.9-18.8-3.7-27.3 .6L18.3 230.8c-9.3 4.7-11.8 16.8-5 24.7l73.1 85.3c6.1 7.1 15 11.2 24.3 11.2l137.7 0c5 0 9.9-1.2 14.3-3.4L535.6 212.2c46.5-23.3 82.5-63.3 100.8-112C645.9 75 627.2 48 600.2 48l-57.4 0c-20.2 0-40.2 4.8-58.2 14L381 114.9zM0 480c0 17.7 14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 448c-17.7 0-32 14.3-32 32z"]
};
const faHandshakeSlash = {
  prefix: 'fas',
  iconName: 'handshake-slash',
  icon: [640, 512, [], "e060", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-135-105.8c-1.1-11.4-6.3-22.3-15.3-30.7l-134.2-123-23.4 18.2-26-20.3 77.2-60.1c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L512 316.8 512 128l-.7 0-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2l-89.7 72.6-25.8-20.3 81.8-66.2c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-35.5 23.7L38.8 5.1zM96 171.6L40.6 128 0 128 0 352c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-180.4zM413.6 421.9L128 196.9 128 352l28.2 0 91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c.8-.8 1.5-1.7 2.2-2.6zM48 320a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM544 128l0 224c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-224-96 0zm32 208a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faBookBookmark = {
  prefix: 'fas',
  iconName: 'book-bookmark',
  icon: [448, 512, [], "e0bb", "M0 96C0 43 43 0 96 0l96 0 0 190.7c0 13.4 15.5 20.9 26 12.5L272 160l54 43.2c10.5 8.4 26 .9 26-12.5L352 0l32 0 32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32z"]
};
const faCodeBranch = {
  prefix: 'fas',
  iconName: 'code-branch',
  icon: [448, 512, [], "f126", "M80 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm80-24c0 32.8-19.7 61-48 73.3l0 87.8c18.8-10.9 40.7-17.1 64-17.1l96 0c35.3 0 64-28.7 64-64l0-6.7C307.7 141 288 112.8 288 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3l0 6.7c0 70.7-57.3 128-128 128l-96 0c-35.3 0-64 28.7-64 64l0 6.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3l0-6.7 0-198.7C19.7 141 0 112.8 0 80C0 35.8 35.8 0 80 0s80 35.8 80 80zm232 0a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM80 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faHatCowboy = {
  prefix: 'fas',
  iconName: 'hat-cowboy',
  icon: [640, 512, [], "f8c0", "M320 64c14.4 0 22.3-7 30.8-14.4C360.4 41.1 370.7 32 392 32c49.3 0 84.4 152.2 97.9 221.9C447.8 272.1 390.9 288 320 288s-127.8-15.9-169.9-34.1C163.6 184.2 198.7 32 248 32c21.3 0 31.6 9.1 41.2 17.6C297.7 57 305.6 64 320 64zM111.1 270.7c47.2 24.5 117.5 49.3 209 49.3s161.8-24.8 208.9-49.3c24.8-12.9 49.8-28.3 70.1-47.7c7.9-7.9 20.2-9.2 29.6-3.3c9.5 5.9 13.5 17.9 9.9 28.5c-13.5 37.7-38.4 72.3-66.1 100.6C523.7 398.9 443.6 448 320 448s-203.6-49.1-252.5-99.2C39.8 320.4 14.9 285.8 1.4 248.1c-3.6-10.6 .4-22.6 9.9-28.5c9.5-5.9 21.7-4.5 29.6 3.3c20.4 19.4 45.3 34.8 70.1 47.7z"]
};
const faBridge = {
  prefix: 'fas',
  iconName: 'bridge',
  icon: [576, 512, [], "e4c8", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l40 0 0 64L0 160 0 288c53 0 96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96s96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96l0-128-72 0 0-64 40 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM456 96l0 64-80 0 0-64 80 0zM328 96l0 64-80 0 0-64 80 0zM200 96l0 64-80 0 0-64 80 0z"]
};
const faPhoneFlip = {
  prefix: 'fas',
  iconName: 'phone-flip',
  icon: [512, 512, [128381, "phone-alt"], "f879", "M347.1 24.6c7.7-18.6 28-28.5 47.4-23.2l88 24C499.9 30.2 512 46 512 64c0 247.4-200.6 448-448 448c-18 0-33.8-12.1-38.6-29.5l-24-88c-5.3-19.4 4.6-39.7 23.2-47.4l96-40c16.3-6.8 35.2-2.1 46.3 11.6L207.3 368c70.4-33.3 127.4-90.3 160.7-160.7L318.7 167c-13.7-11.2-18.4-30-11.6-46.3l40-96z"]
};
const faPhoneAlt = faPhoneFlip;
const faTruckFront = {
  prefix: 'fas',
  iconName: 'truck-front',
  icon: [512, 512, [], "e2b7", "M0 80C0 35.8 35.8 0 80 0L432 0c44.2 0 80 35.8 80 80l0 288c0 26.2-12.6 49.4-32 64l0 48c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-256 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-48C12.6 417.4 0 394.2 0 368L0 80zm129.9 72.2L112 224l288 0-17.9-71.8C378.5 138 365.7 128 351 128l-190 0c-14.7 0-27.5 10-31 24.2zM128 320a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faCat = {
  prefix: 'fas',
  iconName: 'cat',
  icon: [576, 512, [128008], "f6be", "M320 192l17.1 0c22.1 38.3 63.5 64 110.9 64c11 0 21.8-1.4 32-4l0 4 0 32 0 192c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-140.8L280 448l56 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-144 0c-53 0-96-43-96-96l0-223.5c0-16.1-12-29.8-28-31.8l-7.9-1c-17.5-2.2-30-18.2-27.8-35.7s18.2-30 35.7-27.8l7.9 1c48 6 84.1 46.8 84.1 95.3l0 85.3c34.4-51.7 93.2-85.8 160-85.8zm160 26.5s0 0 0 0c-10 3.5-20.8 5.5-32 5.5c-28.4 0-54-12.4-71.6-32c0 0 0 0 0 0c-3.7-4.1-7-8.5-9.9-13.2C357.3 164 352 146.6 352 128c0 0 0 0 0 0l0-96 0-20 0-1.3C352 4.8 356.7 .1 362.6 0l.2 0c3.3 0 6.4 1.6 8.4 4.2c0 0 0 0 0 .1L384 21.3l27.2 36.3L416 64l64 0 4.8-6.4L512 21.3 524.8 4.3c0 0 0 0 0-.1c2-2.6 5.1-4.2 8.4-4.2l.2 0C539.3 .1 544 4.8 544 10.7l0 1.3 0 20 0 96c0 17.3-4.6 33.6-12.6 47.6c-11.3 19.8-29.6 35.2-51.4 42.9zM432 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faAnchorCircleExclamation = {
  prefix: 'fas',
  iconName: 'anchor-circle-exclamation',
  icon: [640, 512, [], "e4ab", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c8.2 0 16.3-.6 24.2-1.8c-22.2-16.2-40.4-37.5-53-62.2L320 448l0-80 0-128 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faTruckField = {
  prefix: 'fas',
  iconName: 'truck-field',
  icon: [640, 512, [], "e58d", "M32 96c0-35.3 28.7-64 64-64l224 0c23.7 0 44.4 12.9 55.4 32l51.8 0c25.3 0 48.2 14.9 58.5 38l52.8 118.8c.5 1.1 .9 2.1 1.3 3.2l4.2 0c35.3 0 64 28.7 64 64l0 32c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-32c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32l0-32zM384 224l85.9 0-42.7-96L384 128l0 96zM160 432a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faRoute = {
  prefix: 'fas',
  iconName: 'route',
  icon: [512, 512, [], "f4d7", "M512 96c0 50.2-59.1 125.1-84.6 155c-3.8 4.4-9.4 6.1-14.5 5L320 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96 43 96 96s-43 96-96 96l-276.4 0c8.7-9.9 19.3-22.6 30-36.8c6.3-8.4 12.8-17.6 19-27.2L416 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c-53 0-96-43-96-96s43-96 96-96l39.8 0c-21-31.5-39.8-67.7-39.8-96c0-53 43-96 96-96s96 43 96 96zM117.1 489.1c-3.8 4.3-7.2 8.1-10.1 11.3l-1.8 2-.2-.2c-6 4.6-14.6 4-20-1.8C59.8 473 0 402.5 0 352c0-53 43-96 96-96s96 43 96 96c0 30-21.1 67-43.5 97.9c-10.7 14.7-21.7 28-30.8 38.5l-.6 .7zM128 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faClipboardQuestion = {
  prefix: 'fas',
  iconName: 'clipboard-question',
  icon: [384, 512, [], "e4e3", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM105.8 229.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L216 328.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM160 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faPanorama = {
  prefix: 'fas',
  iconName: 'panorama',
  icon: [640, 512, [], "e209", "M45.6 32C20.4 32 0 52.4 0 77.6L0 434.4C0 459.6 20.4 480 45.6 480c5.1 0 10-.8 14.7-2.4C74.6 472.8 177.6 440 320 440s245.4 32.8 259.6 37.6c4.7 1.6 9.7 2.4 14.7 2.4c25.2 0 45.6-20.4 45.6-45.6l0-356.7C640 52.4 619.6 32 594.4 32c-5 0-10 .8-14.7 2.4C565.4 39.2 462.4 72 320 72S74.6 39.2 60.4 34.4C55.6 32.8 50.7 32 45.6 32zM96 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm272 0c7.9 0 15.4 3.9 19.8 10.5L512.3 353c5.4 8 5.6 18.4 .4 26.5s-14.7 12.3-24.2 10.7C442.7 382.4 385.2 376 320 376c-65.6 0-123.4 6.5-169.3 14.4c-9.8 1.7-19.7-2.9-24.7-11.5s-4.3-19.4 1.9-27.2L197.3 265c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l26.4 33.1 87-127.6c4.5-6.6 11.9-10.5 19.8-10.5z"]
};
const faCommentMedical = {
  prefix: 'fas',
  iconName: 'comment-medical',
  icon: [512, 512, [], "f7f5", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM224 160c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faTeethOpen = {
  prefix: 'fas',
  iconName: 'teeth-open',
  icon: [576, 512, [], "f62f", "M96 32C43 32 0 75 0 128l0 64c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-64c0-53-43-96-96-96L96 32zM224 96c26.5 0 48 21.5 48 48l0 56c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-56c0-26.5 21.5-48 48-48zm80 48c0-26.5 21.5-48 48-48s48 21.5 48 48l0 56c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-56zM96 128c26.5 0 48 21.5 48 48l0 24c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-24c0-26.5 21.5-48 48-48zm336 48c0-26.5 21.5-48 48-48s48 21.5 48 48l0 24c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-24zM96 480l384 0c53 0 96-43 96-96l0-32c0-35.3-28.7-64-64-64L64 288c-35.3 0-64 28.7-64 64l0 32c0 53 43 96 96 96zm0-64c-26.5 0-48-21.5-48-48l0-24c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 24c0 26.5-21.5 48-48 48zm80-48l0-24c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 24c0 26.5-21.5 48-48 48s-48-21.5-48-48zm176 48c-26.5 0-48-21.5-48-48l0-24c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 24c0 26.5-21.5 48-48 48zm80-48l0-24c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 24c0 26.5-21.5 48-48 48s-48-21.5-48-48z"]
};
const faFileCircleMinus = {
  prefix: 'fas',
  iconName: 'file-circle-minus',
  icon: [576, 512, [], "e4ed", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm224 0c0-8.8-7.2-16-16-16l-128 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16z"]
};
const faTags = {
  prefix: 'fas',
  iconName: 'tags',
  icon: [512, 512, [], "f02c", "M345 39.1L472.8 168.4c52.4 53 52.4 138.2 0 191.2L360.8 472.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L438.6 325.9c33.9-34.3 33.9-89.4 0-123.7L310.9 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM0 229.5L0 80C0 53.5 21.5 32 48 32l149.5 0c17 0 33.3 6.7 45.3 18.7l168 168c25 25 25 65.5 0 90.5L277.3 442.7c-25 25-65.5 25-90.5 0l-168-168C6.7 262.7 0 246.5 0 229.5zM144 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faWineGlass = {
  prefix: 'fas',
  iconName: 'wine-glass',
  icon: [320, 512, [127863], "f4e3", "M32.1 29.3C33.5 12.8 47.4 0 64 0L256 0c16.6 0 30.5 12.8 31.9 29.3l14 168.4c6 72-42.5 135.2-109.9 150.6l0 99.6 48 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-80 0-80 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l48 0 0-99.6C60.6 333 12.1 269.8 18.1 197.8l14-168.4zm56 98.7l143.8 0-5.3-64L93.4 64l-5.3 64z"]
};
const faForwardFast = {
  prefix: 'fas',
  iconName: 'forward-fast',
  icon: [512, 512, [9197, "fast-forward"], "f050", "M18.4 445c11.2 5.3 24.5 3.6 34.1-4.4L224 297.7 224 416c0 12.4 7.2 23.7 18.4 29s24.5 3.6 34.1-4.4L448 297.7 448 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 118.3L276.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S224 83.6 224 96l0 118.3L52.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S0 83.6 0 96L0 416c0 12.4 7.2 23.7 18.4 29z"]
};
const faFastForward = faForwardFast;
const faFaceMehBlank = {
  prefix: 'fas',
  iconName: 'face-meh-blank',
  icon: [512, 512, [128566, "meh-blank"], "f5a4", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm208.4-48a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm128 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faMehBlank = faFaceMehBlank;
const faSquareParking = {
  prefix: 'fas',
  iconName: 'square-parking',
  icon: [448, 512, [127359, "parking"], "f540", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM192 256l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-48 0 0 64zm48 64l-48 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64 0-120c0-22.1 17.9-40 40-40l72 0c53 0 96 43 96 96s-43 96-96 96z"]
};
const faParking = faSquareParking;
const faHouseSignal = {
  prefix: 'fas',
  iconName: 'house-signal',
  icon: [576, 512, [], "e012", "M357.7 8.5c-12.3-11.3-31.2-11.3-43.4 0l-208 192c-9.4 8.6-12.7 22-8.5 34c87.1 25.3 155.6 94.2 180.3 181.6L464 416c26.5 0 48-21.5 48-48l0-112 32 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8.1-35.2l-208-192zM288 208c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16l0-64zM24 256c-13.3 0-24 10.7-24 24s10.7 24 24 24c101.6 0 184 82.4 184 184c0 13.3 10.7 24 24 24s24-10.7 24-24c0-128.1-103.9-232-232-232zm8 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM0 376c0 13.3 10.7 24 24 24c48.6 0 88 39.4 88 88c0 13.3 10.7 24 24 24s24-10.7 24-24c0-75.1-60.9-136-136-136c-13.3 0-24 10.7-24 24z"]
};
const faBarsProgress = {
  prefix: 'fas',
  iconName: 'bars-progress',
  icon: [512, 512, ["tasks-alt"], "f828", "M448 160l-128 0 0-32 128 0 0 32zM48 64C21.5 64 0 85.5 0 112l0 64c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48L48 64zM448 352l0 32-256 0 0-32 256 0zM48 288c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48L48 288z"]
};
const faTasksAlt = faBarsProgress;
const faFaucetDrip = {
  prefix: 'fas',
  iconName: 'faucet-drip',
  icon: [512, 512, [128688], "e006", "M224 0c17.7 0 32 14.3 32 32l0 12 96-12c17.7 0 32 14.3 32 32s-14.3 32-32 32L256 84l-31-3.9-1-.1-1 .1L192 84 96 96C78.3 96 64 81.7 64 64s14.3-32 32-32l96 12 0-12c0-17.7 14.3-32 32-32zM0 224c0-17.7 14.3-32 32-32l96 0 22.6-22.6c6-6 14.1-9.4 22.6-9.4l18.7 0 0-43.8 32-4 32 4 0 43.8 18.7 0c8.5 0 16.6 3.4 22.6 9.4L320 192l32 0c88.4 0 160 71.6 160 160c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s-14.3-32-32-32l-36.1 0c-20.2 29-53.9 48-91.9 48s-71.7-19-91.9-48L32 320c-17.7 0-32-14.3-32-32l0-64zM436.8 423.4c1.9-4.5 6.3-7.4 11.2-7.4s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1l18.2-42.4z"]
};
const faCartFlatbed = {
  prefix: 'fas',
  iconName: 'cart-flatbed',
  icon: [640, 512, ["dolly-flatbed"], "f474", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l16 0c8.8 0 16 7.2 16 16l0 288c0 44.2 35.8 80 80 80l18.7 0c-1.8 5-2.7 10.4-2.7 16c0 26.5 21.5 48 48 48s48-21.5 48-48c0-5.6-1-11-2.7-16l197.5 0c-1.8 5-2.7 10.4-2.7 16c0 26.5 21.5 48 48 48s48-21.5 48-48c0-5.6-1-11-2.7-16l66.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-464 0c-8.8 0-16-7.2-16-16l0-288C128 35.8 92.2 0 48 0L32 0zM192 80l0 192c0 26.5 21.5 48 48 48l320 0c26.5 0 48-21.5 48-48l0-192c0-26.5-21.5-48-48-48l-96 0 0 144c0 5.9-3.2 11.3-8.5 14.1s-11.5 2.5-16.4-.8L400 163.2l-39.1 26.1c-4.9 3.3-11.2 3.6-16.4 .8s-8.5-8.2-8.5-14.1l0-144-96 0c-26.5 0-48 21.5-48 48z"]
};
const faDollyFlatbed = faCartFlatbed;
const faBanSmoking = {
  prefix: 'fas',
  iconName: 'ban-smoking',
  icon: [512, 512, [128685, "smoking-ban"], "f54d", "M99.5 144.8L178.7 224l96 96 92.5 92.5C335.9 434.9 297.5 448 256 448C150 448 64 362 64 256c0-41.5 13.1-79.9 35.5-111.2zM333.3 288l-32-32 82.7 0 0 32-50.7 0zm32 32l34.7 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-130.7 0L144.8 99.5C176.1 77.1 214.5 64 256 64c106 0 192 86 192 192c0 41.5-13.1 79.9-35.5 111.2L365.3 320zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM272 96c-8.8 0-16 7.2-16 16c0 26.5 21.5 48 48 48l32 0c8.8 0 16 7.2 16 16s7.2 16 16 16s16-7.2 16-16c0-26.5-21.5-48-48-48l-32 0c-8.8 0-16-7.2-16-16s-7.2-16-16-16zM229.5 320l-96-96L112 224c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l117.5 0z"]
};
const faSmokingBan = faBanSmoking;
const faTerminal = {
  prefix: 'fas',
  iconName: 'terminal',
  icon: [576, 512, [], "f120", "M9.4 86.6C-3.1 74.1-3.1 53.9 9.4 41.4s32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 9.4 86.6zM256 416l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faMobileButton = {
  prefix: 'fas',
  iconName: 'mobile-button',
  icon: [384, 512, [], "f10b", "M80 0C44.7 0 16 28.7 16 64l0 384c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L80 0zM192 400a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faHouseMedicalFlag = {
  prefix: 'fas',
  iconName: 'house-medical-flag',
  icon: [640, 512, [], "e514", "M480 0c17.7 0 32 14.3 32 32l112 0c8.8 0 16 7.2 16 16l0 128c0 8.8-7.2 16-16 16l-112 0 0 320-64 0 0-320 0-160c0-17.7 14.3-32 32-32zM276.8 39.7L416 159l0 353 1 0-.2 0L96 512c-17.7 0-32-14.3-32-32l0-192-32 0c-13.4 0-25.4-8.3-30-20.9s-1-26.7 9.2-35.4l224-192c12-10.3 29.7-10.3 41.7 0zM224 208l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faBasketShopping = {
  prefix: 'fas',
  iconName: 'basket-shopping',
  icon: [576, 512, ["shopping-basket"], "f291", "M253.3 35.1c6.1-11.8 1.5-26.3-10.2-32.4s-26.3-1.5-32.4 10.2L117.6 192 32 192c-17.7 0-32 14.3-32 32s14.3 32 32 32L83.9 463.5C91 492 116.6 512 146 512L430 512c29.4 0 55-20 62.1-48.5L544 256c17.7 0 32-14.3 32-32s-14.3-32-32-32l-85.6 0L365.3 12.9C359.2 1.2 344.7-3.4 332.9 2.7s-16.3 20.6-10.2 32.4L404.3 192l-232.6 0L253.3 35.1zM192 304l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16s16 7.2 16 16zm96-16c8.8 0 16 7.2 16 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16zm128 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faShoppingBasket = faBasketShopping;
const faTape = {
  prefix: 'fas',
  iconName: 'tape',
  icon: [576, 512, [], "f4db", "M380.8 416c41.5-40.7 67.2-97.3 67.2-160C448 132.3 347.7 32 224 32S0 132.3 0 256S100.3 480 224 480l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-163.2 0zM224 160a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm64 96a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faBusSimple = {
  prefix: 'fas',
  iconName: 'bus-simple',
  icon: [448, 512, ["bus-alt"], "f55e", "M224 0C348.8 0 448 35.2 448 80l0 16 0 320c0 17.7-14.3 32-32 32l0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-192 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32c-17.7 0-32-14.3-32-32L0 96 0 80C0 35.2 99.2 0 224 0zM64 128l0 128c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32L96 96c-17.7 0-32 14.3-32 32zM80 400a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm288 0a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faBusAlt = faBusSimple;
const faEye = {
  prefix: 'fas',
  iconName: 'eye',
  icon: [576, 512, [128065], "f06e", "M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"]
};
const faFaceSadCry = {
  prefix: 'fas',
  iconName: 'face-sad-cry',
  icon: [512, 512, [128557, "sad-cry"], "f5b3", "M352 493.4c-29.6 12-62.1 18.6-96 18.6s-66.4-6.6-96-18.6L160 288c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 189.8C51.5 433.5 0 350.8 0 256C0 114.6 114.6 0 256 0S512 114.6 512 256c0 94.8-51.5 177.5-128 221.8L384 288c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 205.4zM195.2 233.6c5.3 7.1 15.3 8.5 22.4 3.2s8.5-15.3 3.2-22.4c-30.4-40.5-91.2-40.5-121.6 0c-5.3 7.1-3.9 17.1 3.2 22.4s17.1 3.9 22.4-3.2c17.6-23.5 52.8-23.5 70.4 0zm121.6 0c17.6-23.5 52.8-23.5 70.4 0c5.3 7.1 15.3 8.5 22.4 3.2s8.5-15.3 3.2-22.4c-30.4-40.5-91.2-40.5-121.6 0c-5.3 7.1-3.9 17.1 3.2 22.4s17.1 3.9 22.4-3.2zM208 336l0 32c0 26.5 21.5 48 48 48s48-21.5 48-48l0-32c0-26.5-21.5-48-48-48s-48 21.5-48 48z"]
};
const faSadCry = faFaceSadCry;
const faAudioDescription = {
  prefix: 'fas',
  iconName: 'audio-description',
  icon: [576, 512, [], "f29e", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM213.5 173.3l72 144c5.9 11.9 1.1 26.3-10.7 32.2s-26.3 1.1-32.2-10.7l-9.4-18.9-82.2 0-9.4 18.9c-5.9 11.9-20.3 16.7-32.2 10.7s-16.7-20.3-10.7-32.2l72-144c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3zm-.4 106.6L192 237.7l-21.1 42.2 42.2 0zM304 184c0-13.3 10.7-24 24-24l56 0c53 0 96 43 96 96s-43 96-96 96l-56 0c-13.3 0-24-10.7-24-24l0-144zm48 24l0 96 32 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-32 0z"]
};
const faPersonMilitaryToPerson = {
  prefix: 'fas',
  iconName: 'person-military-to-person',
  icon: [512, 512, [], "e54c", "M71 12.5c-8.6 1-15 8.2-15 16.8c0 9.3 7.5 16.8 16.7 16.9l111.4 0c8.8-.1 15.9-7.2 15.9-16L200 16c0-9.5-8.3-17-17.8-15.9L71 12.5zM189.5 78.1l-122.9 0C64.9 83.8 64 89.8 64 96c0 35.3 28.7 64 64 64s64-28.7 64-64c0-6.2-.9-12.2-2.5-17.9zM32 256l0 32c0 17.7 14.3 32 32 32l128 0c1.8 0 3.5-.1 5.2-.4L53 208.6C40.1 220.3 32 237.2 32 256zm190.2 42.5c1.1-3.3 1.8-6.8 1.8-10.5l0-32c0-35.3-28.7-64-64-64l-64 0c-3.7 0-7.4 .3-10.9 .9L222.2 298.5zM384 160a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-35.3 0-64 28.7-64 64l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32c0-35.3-28.7-64-64-64l-64 0zM215.8 450.1c5.2-4.6 8.2-11.1 8.2-18.1s-3-13.5-8.2-18.1l-64-56c-7.1-6.2-17.1-7.7-25.7-3.8S112 366.6 112 376l0 32-88 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l88 0 0 32c0 9.4 5.5 18 14.1 21.9s18.6 2.4 25.7-3.8l64-56zM288 431.9c0 6.9 2.9 13.5 8.1 18.1l64 56.4c7.1 6.2 17.1 7.8 25.7 3.9s14.1-12.4 14.1-21.9l0-32.4 88 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-88 0 0-32c0-9.4-5.5-18-14.1-21.9s-18.6-2.4-25.7 3.8l-64 56c-5.2 4.5-8.2 11.1-8.2 18z"]
};
const faFileShield = {
  prefix: 'fas',
  iconName: 'file-shield',
  icon: [576, 512, [], "e4f0", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 47-92.8 37.1c-21.3 8.5-35.2 29.1-35.2 52c0 56.6 18.9 148 94.2 208.3c-9 4.8-19.3 7.6-30.2 7.6L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm39.1 97.7c5.7-2.3 12.1-2.3 17.8 0l120 48C570 277.4 576 286.2 576 296c0 63.3-25.9 168.8-134.8 214.2c-5.9 2.5-12.6 2.5-18.5 0C313.9 464.8 288 359.3 288 296c0-9.8 6-18.6 15.1-22.3l120-48zM527.4 312L432 273.8l0 187.8c68.2-33 91.5-99 95.4-149.7z"]
};
const faUserSlash = {
  prefix: 'fas',
  iconName: 'user-slash',
  icon: [640, 512, [], "f506", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L353.3 251.6C407.9 237 448 187.2 448 128C448 57.3 390.7 0 320 0C250.2 0 193.5 55.8 192 125.2L38.8 5.1zM264.3 304.3C170.5 309.4 96 387.2 96 482.3c0 16.4 13.3 29.7 29.7 29.7l388.6 0c3.9 0 7.6-.7 11-2.1l-261-205.6z"]
};
const faPen = {
  prefix: 'fas',
  iconName: 'pen',
  icon: [512, 512, [128394], "f304", "M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"]
};
const faTowerObservation = {
  prefix: 'fas',
  iconName: 'tower-observation',
  icon: [512, 512, [], "e586", "M241.7 3.4c9-4.5 19.6-4.5 28.6 0l160 80c15.8 7.9 22.2 27.1 14.3 42.9C439 137.5 427.7 144 416 144l0 80c0 17.7-14.3 32-32 32l-4.9 0 32 192 68.9 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-95.5 0c-.4 0-.8 0-1.1 0l-254.8 0c-.4 0-.8 0-1.1 0L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l68.9 0 32-192-4.9 0c-17.7 0-32-14.3-32-32l0-80c-11.7 0-23-6.5-28.6-17.7c-7.9-15.8-1.5-35 14.3-42.9l160-80zM314.5 448L256 399.2 197.5 448l117 0zM197.8 256l-4.7 28.3L256 336.8l62.9-52.5L314.2 256l-116.5 0zm-13.9 83.2l-11.2 67L218.5 368l-34.6-28.8zM293.5 368l45.8 38.1-11.2-67L293.5 368zM176 128c-8.8 0-16 7.2-16 16s7.2 16 16 16l160 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-160 0z"]
};
const faFileCode = {
  prefix: 'fas',
  iconName: 'file-code',
  icon: [384, 512, [], "f1c9", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM153 289l-31 31 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L71 337c-9.4-9.4-9.4-24.6 0-33.9l48-48c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM265 255l48 48c9.4 9.4 9.4 24.6 0 33.9l-48 48c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"]
};
const faSignal = {
  prefix: 'fas',
  iconName: 'signal',
  icon: [640, 512, [128246, "signal-5", "signal-perfect"], "f012", "M576 0c17.7 0 32 14.3 32 32l0 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-448c0-17.7 14.3-32 32-32zM448 96c17.7 0 32 14.3 32 32l0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352c0-17.7 14.3-32 32-32zM352 224l0 256c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32s32 14.3 32 32zM192 288c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32zM96 416l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faSignal5 = faSignal;
const faSignalPerfect = faSignal;
const faBus = {
  prefix: 'fas',
  iconName: 'bus',
  icon: [576, 512, [128653], "f207", "M288 0C422.4 0 512 35.2 512 80l0 16 0 32c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l0 160c0 17.7-14.3 32-32 32l0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-192 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32c-17.7 0-32-14.3-32-32l0-160c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32c0 0 0 0 0 0l0-32s0 0 0 0l0-16C64 35.2 153.6 0 288 0zM128 160l0 96c0 17.7 14.3 32 32 32l112 0 0-160-112 0c-17.7 0-32 14.3-32 32zM304 288l112 0c17.7 0 32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-112 0 0 160zM144 400a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm288 0a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM384 80c0-8.8-7.2-16-16-16L208 64c-8.8 0-16 7.2-16 16s7.2 16 16 16l160 0c8.8 0 16-7.2 16-16z"]
};
const faHeartCircleXmark = {
  prefix: 'fas',
  iconName: 'heart-circle-xmark',
  icon: [576, 512, [], "e501", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L454.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L432 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L409.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L432 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faHouseChimney = {
  prefix: 'fas',
  iconName: 'house-chimney',
  icon: [576, 512, [63499, "home-lg"], "e3af", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L512 185l0-121c0-17.7-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32l0 36.7L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 69.7c-.1 .9-.1 1.8-.1 2.8l0 112c0 22.1 17.9 40 40 40l16 0c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2l31.9 0 24 0c22.1 0 40-17.9 40-40l0-24 0-64c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 64 0 24c0 22.1 17.9 40 40 40l24 0 32.5 0c1.4 0 2.8 0 4.2-.1c1.1 .1 2.2 .1 3.3 .1l16 0c22.1 0 40-17.9 40-40l0-16.2c.3-2.6 .5-5.3 .5-8.1l-.7-160.2 32 0z"]
};
const faHomeLg = faHouseChimney;
const faWindowMaximize = {
  prefix: 'fas',
  iconName: 'window-maximize',
  icon: [512, 512, [128470], "f2d0", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM96 96l320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L96 160c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faFaceFrown = {
  prefix: 'fas',
  iconName: 'face-frown',
  icon: [512, 512, [9785, "frown"], "f119", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM159.3 388.7c-2.6 8.4-11.6 13.2-20 10.5s-13.2-11.6-10.5-20C145.2 326.1 196.3 288 256 288s110.8 38.1 127.3 91.3c2.6 8.4-2.1 17.4-10.5 20s-17.4-2.1-20-10.5C340.5 349.4 302.1 320 256 320s-84.5 29.4-96.7 68.7zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faFrown = faFaceFrown;
const faPrescription = {
  prefix: 'fas',
  iconName: 'prescription',
  icon: [448, 512, [], "f5b1", "M32 0C14.3 0 0 14.3 0 32L0 192l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 50.7 0 128 128L137.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L288 397.3 393.4 502.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L333.3 352 438.6 246.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 306.7l-85.8-85.8C251.4 209.1 288 164.8 288 112C288 50.1 237.9 0 176 0L32 0zM176 160L64 160l0-96 112 0c26.5 0 48 21.5 48 48s-21.5 48-48 48z"]
};
const faShop = {
  prefix: 'fas',
  iconName: 'shop',
  icon: [640, 512, ["store-alt"], "f54f", "M36.8 192l566.3 0c20.3 0 36.8-16.5 36.8-36.8c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0L121.7 0c-16 0-31 8-39.9 21.4L6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM64 224l0 160 0 80c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-80 0-160-64 0 0 160-192 0 0-160-64 0zm448 0l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32l0-256-64 0z"]
};
const faStoreAlt = faShop;
const faFloppyDisk = {
  prefix: 'fas',
  iconName: 'floppy-disk',
  icon: [448, 512, [128190, 128426, "save"], "f0c7", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-242.7c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32L64 32zm0 96c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L96 224c-17.7 0-32-14.3-32-32l0-64zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faSave = faFloppyDisk;
const faVihara = {
  prefix: 'fas',
  iconName: 'vihara',
  icon: [640, 512, [], "f6a7", "M281 22L305.8 4.7c1.3-.9 2.7-1.8 4.1-2.4C313.1 .7 316.6 0 320 0s6.9 .7 10.1 2.2c1.4 .7 2.8 1.5 4.1 2.4L359 22C393 45.8 430.8 63.5 470.8 74.4l23 6.3c1.8 .5 3.6 1.1 5.2 2c3.2 1.7 5.9 4 8.1 6.8c3.8 4.9 5.6 11.3 4.7 17.8c-.4 2.8-1.2 5.4-2.5 7.8c-1.7 3.2-4 5.9-6.8 8.1c-4.3 3.2-9.6 5.1-15.1 4.9l-7.5 0 0 56.1 6.4 5.1 5.2 4.1c21.1 16.7 45 29.6 70.5 38.1l28.9 9.6c1.6 .5 3.2 1.2 4.6 2c3.1 1.7 5.8 4.1 7.8 6.9s3.5 6.1 4.1 9.6c.5 2.7 .6 5.5 .1 8.3s-1.4 5.4-2.7 7.8c-1.7 3.1-4.1 5.8-6.9 7.8s-6.1 3.5-9.6 4.1c-1.6 .3-3.3 .4-5 .4L544 288l0 65.9c20.5 22.8 47.4 39.2 77.4 46.7C632 403 640 412.6 640 424c0 13.3-10.7 24-24 24l-40 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-160 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-160 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-40 0c-13.3 0-24-10.7-24-24c0-11.4 8-21 18.6-23.4c30-7.6 56.9-23.9 77.4-46.7L96 288l-39.4 0c-1.7 0-3.4-.1-5-.4c-3.5-.7-6.8-2.1-9.6-4.1s-5.2-4.7-7-7.8c-1.3-2.4-2.3-5-2.7-7.8s-.4-5.6 .1-8.3c.7-3.5 2.1-6.8 4.1-9.6s4.7-5.2 7.8-6.9c1.4-.8 3-1.5 4.6-2l28.9-9.6c25.5-8.5 49.4-21.4 70.5-38.1l5.2-4.1 6.4-5.1 0-8.1 0-48-7.5 0c-5.5 .1-10.8-1.7-15.1-4.9c-2.8-2.1-5.1-4.8-6.8-8.1c-1.2-2.4-2.1-5-2.5-7.8c-.9-6.5 .9-12.8 4.7-17.8c2.1-2.8 4.8-5.1 8.1-6.8c1.6-.8 3.4-1.5 5.2-2l23-6.3C209.2 63.5 247 45.8 281 22zM416 128l-96 0-96 0 0 64 72 0 48 0 72 0 0-64zM160 288l0 64 136 0 24 0 24 0 136 0 0-64-136 0-24 0s0 0 0 0l-24 0-136 0z"]
};
const faScaleUnbalanced = {
  prefix: 'fas',
  iconName: 'scale-unbalanced',
  icon: [640, 512, ["balance-scale-left"], "f515", "M522.1 62.4c16.8-5.6 25.8-23.7 20.2-40.5S518.6-3.9 501.9 1.6l-113 37.7C375 15.8 349.3 0 320 0c-44.2 0-80 35.8-80 80c0 3 .2 5.9 .5 8.8L117.9 129.6c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l135.5-45.2c4.5 3.2 9.3 5.9 14.4 8.2L288 480c0 17.7 14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-294.7c21-9.2 37.2-27 44.2-49l125.9-42zM439.6 288L512 163.8 584.4 288l-144.9 0zM512 384c62.9 0 115.2-34 126-78.9c2.6-11-1-22.3-6.7-32.1L536.1 109.8c-5-8.6-14.2-13.8-24.1-13.8s-19.1 5.3-24.1 13.8L392.7 273.1c-5.7 9.8-9.3 21.1-6.7 32.1C396.8 350 449.1 384 512 384zM129.2 291.8L201.6 416 56.7 416l72.4-124.2zM3.2 433.1C14 478 66.3 512 129.2 512s115.2-34 126-78.9c2.6-11-1-22.3-6.7-32.1L153.2 237.8c-5-8.6-14.2-13.8-24.1-13.8s-19.1 5.3-24.1 13.8L9.9 401.1c-5.7 9.8-9.3 21.1-6.7 32.1z"]
};
const faBalanceScaleLeft = faScaleUnbalanced;
const faSortUp = {
  prefix: 'fas',
  iconName: 'sort-up',
  icon: [320, 512, ["sort-asc"], "f0de", "M182.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]
};
const faSortAsc = faSortUp;
const faCommentDots = {
  prefix: 'fas',
  iconName: 'comment-dots',
  icon: [512, 512, [128172, 62075, "commenting"], "f4ad", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM128 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faCommenting = faCommentDots;
const faPlantWilt = {
  prefix: 'fas',
  iconName: 'plant-wilt',
  icon: [512, 512, [], "e5aa", "M288 120c0-30.9 25.1-56 56-56s56 25.1 56 56l0 13c-29.3 10-48 34.5-48 70.1c0 27.9 25.3 74.8 66 111.6c3.8 3.5 8.9 5.3 14 5.3s10.2-1.8 14-5.3c40.7-36.8 66-83.7 66-111.6c0-35.6-18.7-60.2-48-70.1l0-13C464 53.7 410.3 0 344 0S224 53.7 224 120l0 21.8C207.3 133 188.2 128 168 128c-66.3 0-120 53.7-120 120l0 13c-29.3 10-48 34.5-48 70.1C0 359 25.3 405.9 66 442.7c3.8 3.5 8.9 5.3 14 5.3s10.2-1.8 14-5.3c40.7-36.8 66-83.7 66-111.6c0-35.6-18.7-60.2-48-70.1l0-13c0-30.9 25.1-56 56-56s56 25.1 56 56l0 32 0 200c0 17.7 14.3 32 32 32s32-14.3 32-32l0-200 0-32 0-128z"]
};
const faDiamond = {
  prefix: 'fas',
  iconName: 'diamond',
  icon: [512, 512, [9830], "f219", "M284.3 11.7c-15.6-15.6-40.9-15.6-56.6 0l-216 216c-15.6 15.6-15.6 40.9 0 56.6l216 216c15.6 15.6 40.9 15.6 56.6 0l216-216c15.6-15.6 15.6-40.9 0-56.6l-216-216z"]
};
const faFaceGrinSquint = {
  prefix: 'fas',
  iconName: 'face-grin-squint',
  icon: [512, 512, [128518, "grin-squint"], "f585", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM133.5 146.7l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 157.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
};
const faGrinSquint = faFaceGrinSquint;
const faHandHoldingDollar = {
  prefix: 'fas',
  iconName: 'hand-holding-dollar',
  icon: [576, 512, ["hand-holding-usd"], "f4c0", "M312 24l0 10.5c6.4 1.2 12.6 2.7 18.2 4.2c12.8 3.4 20.4 16.6 17 29.4s-16.6 20.4-29.4 17c-10.9-2.9-21.1-4.9-30.2-5c-7.3-.1-14.7 1.7-19.4 4.4c-2.1 1.3-3.1 2.4-3.5 3c-.3 .5-.7 1.2-.7 2.8c0 .3 0 .5 0 .6c.2 .2 .9 1.2 3.3 2.6c5.8 3.5 14.4 6.2 27.4 10.1l.9 .3s0 0 0 0c11.1 3.3 25.9 7.8 37.9 15.3c13.7 8.6 26.1 22.9 26.4 44.9c.3 22.5-11.4 38.9-26.7 48.5c-6.7 4.1-13.9 7-21.3 8.8l0 10.6c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-11.4c-9.5-2.3-18.2-5.3-25.6-7.8c-2.1-.7-4.1-1.4-6-2c-12.6-4.2-19.4-17.8-15.2-30.4s17.8-19.4 30.4-15.2c2.6 .9 5 1.7 7.3 2.5c13.6 4.6 23.4 7.9 33.9 8.3c8 .3 15.1-1.6 19.2-4.1c1.9-1.2 2.8-2.2 3.2-2.9c.4-.6 .9-1.8 .8-4.1l0-.2c0-1 0-2.1-4-4.6c-5.7-3.6-14.3-6.4-27.1-10.3l-1.9-.6c-10.8-3.2-25-7.5-36.4-14.4c-13.5-8.1-26.5-22-26.6-44.1c-.1-22.9 12.9-38.6 27.7-47.4c6.4-3.8 13.3-6.4 20.2-8.2L264 24c0-13.3 10.7-24 24-24s24 10.7 24 24zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5L192 512 32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l36.8 0 44.9-36c22.7-18.2 50.9-28 80-28l78.3 0 16 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l120.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384c0 0 0 0 0 0l-.9 0c.3 0 .6 0 .9 0z"]
};
const faHandHoldingUsd = faHandHoldingDollar;
const faChartDiagram = {
  prefix: 'fas',
  iconName: 'chart-diagram',
  icon: [512, 512, [], "e695", "M80 32C53.5 32 32 53.5 32 80s21.5 48 48 48l152 0 0 40-48 48-56 0c-48.6 0-88 39.4-88 88l0 48-8 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-8 0 0-48c0-22.1 17.9-40 40-40l56 0 48 48 0 40-8 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-8 0 0-40 48-48 56 0c22.1 0 40 17.9 40 40l0 48-8 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-8 0 0-48c0-48.6-39.4-88-88-88l-56 0-48-48 0-40 152 0c26.5 0 48-21.5 48-48s-21.5-48-48-48L80 32z"]
};
const faBacterium = {
  prefix: 'fas',
  iconName: 'bacterium',
  icon: [512, 512, [], "e05a", "M423.1 30.6c3.6-12.7-3.7-26-16.5-29.7s-26 3.7-29.7 16.5l-4.2 14.7c-9.8-.4-19.9 .5-29.9 2.8c-12.1 2.8-23.7 5.9-34.9 9.4l-5.9-13.7c-5.2-12.2-19.3-17.8-31.5-12.6s-17.8 19.3-12.6 31.5l4.9 11.3c-22 9.4-42 20.1-60.2 31.8L196 82.7c-7.4-11-22.3-14-33.3-6.7s-14 22.3-6.7 33.3l7.8 11.6c-18 15-33.7 30.8-47.3 47.1L103 157.3c-10.4-8.3-25.5-6.6-33.7 3.7s-6.6 25.5 3.7 33.7l15 12c-2.1 3.2-4.1 6.5-6 9.7c-9.4 15.7-17 31-23.2 45.3l-9.9-3.9c-12.3-4.9-26.3 1.1-31.2 13.4s1.1 26.3 13.4 31.2l11.6 4.6c-.3 1.1-.6 2.1-.9 3.1c-3.5 12.5-5.7 23.2-7.1 31.3c-.7 4.1-1.2 7.5-1.6 10.3c-.2 1.4-.3 2.6-.4 3.6l-.1 1.4-.1 .6 0 .3 0 .1c0 0 0 .1 39.2 3.7c0 0 0 0 0 0l-39.2-3.6c-.5 5-.6 10-.4 14.9l-14.7 4.2C4.7 380.6-2.7 393.8 .9 406.6s16.9 20.1 29.7 16.5l13.8-3.9c10.6 20.7 27.6 37.8 48.5 48.5l-3.9 13.7c-3.6 12.7 3.7 26 16.5 29.7s26-3.7 29.7-16.5l4.2-14.7c23.8 1 46.3-5.5 65.1-17.6L215 473c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-10.6-10.6c9.1-14.1 15.1-30.5 17-48.3l.1-.8c.3-1.7 1-5.1 2.3-9.8l.2-.8 12.6 5.4c12.2 5.2 26.3-.4 31.5-12.6s-.4-26.3-12.6-31.5l-11.3-4.8c9.9-14.9 24.9-31.6 48.6-46l2.1 7.5c3.6 12.7 16.9 20.1 29.7 16.5s20.1-16.9 16.5-29.7L371 259.2c6.9-2.2 14.3-4.3 22.2-6.1c12.9-3 24.7-8 35.2-14.8L439 249c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-10.6-10.6c12.2-19 18.6-41.6 17.6-65.1l14.7-4.2c12.7-3.6 20.1-16.9 16.5-29.7s-16.9-20.1-29.7-16.5l-13.7 3.9c-10.8-21.2-28-38-48.5-48.5l3.9-13.8zM92.1 363.3s0 0 0 0L144 368l-51.9-4.7zM112 320a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM240 184a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faHandPointer = {
  prefix: 'fas',
  iconName: 'hand-pointer',
  icon: [448, 512, [], "f25a", "M128 40c0-22.1 17.9-40 40-40s40 17.9 40 40l0 148.2c8.5-7.6 19.7-12.2 32-12.2c20.6 0 38.2 13 45 31.2c8.8-9.3 21.2-15.2 35-15.2c25.3 0 46 19.5 47.9 44.3c8.5-7.7 19.8-12.3 32.1-12.3c26.5 0 48 21.5 48 48l0 48 0 16 0 48c0 70.7-57.3 128-128 128l-16 0-64 0-.1 0-5.2 0c-5 0-9.9-.3-14.7-1c-55.3-5.6-106.2-34-140-79L8 336c-13.3-17.7-9.7-42.7 8-56s42.7-9.7 56 8l56 74.7L128 40zM240 304c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96zm48-16c-8.8 0-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96z"]
};
const faDrumSteelpan = {
  prefix: 'fas',
  iconName: 'drum-steelpan',
  icon: [576, 512, [], "f56a", "M288 32c159.1 0 288 48 288 128l0 192c0 80-128.9 128-288 128S0 432 0 352L0 160C0 80 128.9 32 288 32zM528 160c0-9.9-8-29.9-55-49.8c-18.6-7.9-40.9-14.4-66-19.4l-27.8 43.6c-7.3 11.5-11.2 24.8-11.2 38.4c0 17.5 6.4 34.4 18.1 47.5l9.8 11c29.8-5.2 55.9-12.5 77.2-21.5c47.1-19.9 55-39.9 55-49.8zM349.2 237.3c-8-26.2-32.4-45.3-61.2-45.3s-53.3 19.1-61.2 45.3c19.4 1.7 39.9 2.7 61.2 2.7s41.8-.9 61.2-2.7zM169 90.8c-25.2 5-47.4 11.6-66 19.4C56 130.1 48 150.1 48 160s8 29.9 55 49.8c21.3 9 47.4 16.3 77.2 21.5l9.8-11c11.6-13.1 18.1-30 18.1-47.5c0-13.6-3.9-26.9-11.2-38.4L169 90.8zm56.3-8C224.5 87 224 91.5 224 96c0 35.3 28.7 64 64 64s64-28.7 64-64c0-4.5-.5-9-1.4-13.2C330.8 81 309.8 80 288 80s-42.8 1-62.6 2.8z"]
};
const faHandScissors = {
  prefix: 'fas',
  iconName: 'hand-scissors',
  icon: [512, 512, [], "f257", "M40 208c-22.1 0-40 17.9-40 40s17.9 40 40 40l180.2 0c-7.6 8.5-12.2 19.7-12.2 32c0 25.3 19.5 46 44.3 47.9c-7.7 8.5-12.3 19.8-12.3 32.1c0 26.5 21.5 48 48 48l32 0 64 0c70.7 0 128-57.3 128-128l0-113.1c0-40.2-16-78.8-44.4-107.3C444.8 76.8 413.9 64 381.7 64L336 64c-21.3 0-39.3 13.9-45.6 33.1l74.5 23.7c8.4 2.7 13.1 11.7 10.4 20.1s-11.7 13.1-20.1 10.4L288 129.9c0 0 0 .1 0 .1L84 65.8C62.9 59.2 40.5 70.9 33.8 92s5.1 43.5 26.2 50.2L269.5 208 40 208z"]
};
const faHandsPraying = {
  prefix: 'fas',
  iconName: 'hands-praying',
  icon: [640, 512, ["praying-hands"], "f684", "M351.2 4.8c3.2-2 6.6-3.3 10-4.1c4.7-1 9.6-.9 14.1 .1c7.7 1.8 14.8 6.5 19.4 13.6L514.6 194.2c8.8 13.1 13.4 28.6 13.4 44.4l0 73.5c0 6.9 4.4 13 10.9 15.2l79.2 26.4C631.2 358 640 370.2 640 384l0 96c0 9.9-4.6 19.3-12.5 25.4s-18.1 8.1-27.7 5.5L431 465.9c-56-14.9-95-65.7-95-123.7L336 224c0-17.7 14.3-32 32-32s32 14.3 32 32l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-84.9c0-7-1.8-13.8-5.3-19.8L340.3 48.1c-1.7-3-2.9-6.1-3.6-9.3c-1-4.7-1-9.6 .1-14.1c1.9-8 6.8-15.2 14.3-19.9zm-62.4 0c7.5 4.6 12.4 11.9 14.3 19.9c1.1 4.6 1.2 9.4 .1 14.1c-.7 3.2-1.9 6.3-3.6 9.3L213.3 199.3c-3.5 6-5.3 12.9-5.3 19.8l0 84.9c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-17.7 14.3-32 32-32s32 14.3 32 32l0 118.2c0 58-39 108.7-95 123.7l-168.7 45c-9.6 2.6-19.9 .5-27.7-5.5S0 490 0 480l0-96c0-13.8 8.8-26 21.9-30.4l79.2-26.4c6.5-2.2 10.9-8.3 10.9-15.2l0-73.5c0-15.8 4.7-31.2 13.4-44.4L245.2 14.5c4.6-7.1 11.7-11.8 19.4-13.6c4.6-1.1 9.4-1.2 14.1-.1c3.5 .8 6.9 2.1 10 4.1z"]
};
const faPrayingHands = faHandsPraying;
const faArrowRotateRight = {
  prefix: 'fas',
  iconName: 'arrow-rotate-right',
  icon: [512, 512, [8635, "arrow-right-rotate", "arrow-rotate-forward", "redo"], "f01e", "M386.3 160L336 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0s-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3s163.8-62.5 226.3 0L386.3 160z"]
};
const faArrowRightRotate = faArrowRotateRight;
const faArrowRotateForward = faArrowRotateRight;
const faRedo = faArrowRotateRight;
const faWebAwesome = {
  prefix: 'fas',
  iconName: 'web-awesome',
  icon: [640, 512, [], "e682", "M372.2 52c0 20.9-12.4 39-30.2 47.2L448 192l104.4-20.9c-5.3-7.7-8.4-17.1-8.4-27.1c0-26.5 21.5-48 48-48s48 21.5 48 48c0 26-20.6 47.1-46.4 48L481 442.3c-10.3 23-33.2 37.7-58.4 37.7l-205.2 0c-25.2 0-48-14.8-58.4-37.7L46.4 192C20.6 191.1 0 170 0 144c0-26.5 21.5-48 48-48s48 21.5 48 48c0 10.1-3.1 19.4-8.4 27.1L192 192 298.1 99.1c-17.7-8.3-30-26.3-30-47.1c0-28.7 23.3-52 52-52s52 23.3 52 52z"]
};
const faBiohazard = {
  prefix: 'fas',
  iconName: 'biohazard',
  icon: [576, 512, [9763], "f780", "M173.2 0c-1.8 0-3.5 .7-4.8 2C138.5 32.3 120 74 120 120c0 26.2 6 50.9 16.6 73c-22 2.4-43.8 9.1-64.2 20.5C37.9 232.8 13.3 262.4 .4 296c-.7 1.7-.5 3.7 .5 5.2c2.2 3.7 7.4 4.3 10.6 1.3C64.2 254.3 158 245.1 205 324s-8.1 153.1-77.6 173.2c-4.2 1.2-6.3 5.9-4.1 9.6c1 1.6 2.6 2.7 4.5 3c36.5 5.9 75.2 .1 109.7-19.2c20.4-11.4 37.4-26.5 50.5-43.8c13.1 17.3 30.1 32.4 50.5 43.8c34.5 19.3 73.3 25.2 109.7 19.2c1.9-.3 3.5-1.4 4.5-3c2.2-3.7 .1-8.4-4.1-9.6C379.1 477.1 324 403 371 324s140.7-69.8 193.5-21.4c3.2 2.9 8.4 2.3 10.6-1.3c1-1.6 1.1-3.5 .5-5.2c-12.9-33.6-37.5-63.2-72.1-82.5c-20.4-11.4-42.2-18.1-64.2-20.5C450 170.9 456 146.2 456 120c0-46-18.5-87.7-48.4-118c-1.3-1.3-3-2-4.8-2c-5 0-8.4 5.2-6.7 9.9C421.7 80.5 385.6 176 288 176S154.3 80.5 179.9 9.9c1.7-4.7-1.6-9.9-6.7-9.9zM240 272a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM181.7 417.6c6.3-11.8 9.8-25.1 8.6-39.8c-19.5-18-34-41.4-41.2-67.8c-12.5-8.1-26.2-11.8-40-12.4c-9-.4-18.1 .6-27.1 2.7c7.8 57.1 38.7 106.8 82.9 139.4c6.8-6.7 12.6-14.1 16.8-22.1zM288 64c-28.8 0-56.3 5.9-81.2 16.5c2 8.3 5 16.2 9 23.5c6.8 12.4 16.7 23.1 30.1 30.3c13.3-4.1 27.5-6.3 42.2-6.3s28.8 2.2 42.2 6.3c13.4-7.2 23.3-17.9 30.1-30.3c4-7.3 7-15.2 9-23.5C344.3 69.9 316.8 64 288 64zM426.9 310c-7.2 26.4-21.7 49.7-41.2 67.8c-1.2 14.7 2.2 28.1 8.6 39.8c4.3 8 10 15.4 16.8 22.1c44.3-32.6 75.2-82.3 82.9-139.4c-9-2.2-18.1-3.1-27.1-2.7c-13.8 .6-27.5 4.4-40 12.4z"]
};
const faLocationCrosshairs = {
  prefix: 'fas',
  iconName: 'location-crosshairs',
  icon: [512, 512, ["location"], "f601", "M256 0c17.7 0 32 14.3 32 32l0 34.7C368.4 80.1 431.9 143.6 445.3 224l34.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-34.7 0C431.9 368.4 368.4 431.9 288 445.3l0 34.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-34.7C143.6 431.9 80.1 368.4 66.7 288L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l34.7 0C80.1 143.6 143.6 80.1 224 66.7L224 32c0-17.7 14.3-32 32-32zM128 256a128 128 0 1 0 256 0 128 128 0 1 0 -256 0zm128-80a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faLocation = faLocationCrosshairs;
const faMarsDouble = {
  prefix: 'fas',
  iconName: 'mars-double',
  icon: [640, 512, [9891], "f227", "M312 32c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l33.4 33.4L275.8 159c-28.4-19.5-62.7-31-99.8-31C78.8 128 0 206.8 0 304s78.8 176 176 176s176-78.8 176-176c0-37-11.4-71.4-31-99.8l52.6-52.6L407 185c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-112c0-13.3-10.7-24-24-24L312 32zm88 48s0 0 0 0s0 0 0 0s0 0 0 0zM64 304a112 112 0 1 1 224 0A112 112 0 1 1 64 304zM368 480c97.2 0 176-78.8 176-176c0-37-11.4-71.4-31-99.8l52.6-52.6L599 185c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-112c0-13.3-10.7-24-24-24L504 32c-9.7 0-18.5 5.8-22.2 14.8c-1.2 2.9-1.8 6-1.8 9l0 .2 0 .2c0 6.2 2.5 12.2 7 16.8l33.4 33.4L480 146.7l0 21.3c0 22.6-13.6 43.1-34.6 51.7c-.8 .3-1.7 .7-2.5 1C465.7 241.2 480 270.9 480 304c0 61.9-50.1 112-112 112c-5.4 0-10.8-.4-16-1.1c-12.9 20.4-29.1 38.3-48.1 53.1c19.8 7.8 41.4 12 64 12z"]
};
const faChildDress = {
  prefix: 'fas',
  iconName: 'child-dress',
  icon: [320, 512, [], "e59c", "M224 64A64 64 0 1 0 96 64a64 64 0 1 0 128 0zM88 400l0 80c0 17.7 14.3 32 32 32s32-14.3 32-32l0-80 16 0 0 80c0 17.7 14.3 32 32 32s32-14.3 32-32l0-80 17.8 0c10.9 0 18.6-10.7 15.2-21.1l-31.1-93.4 28.6 37.8c10.7 14.1 30.8 16.8 44.8 6.2s16.8-30.7 6.2-44.8L254.6 207c-22.4-29.6-57.5-47-94.6-47s-72.2 17.4-94.6 47L6.5 284.7c-10.7 14.1-7.9 34.2 6.2 44.8s34.2 7.9 44.8-6.2l28.7-37.8L55 378.9C51.6 389.3 59.3 400 70.2 400L88 400z"]
};
const faUsersBetweenLines = {
  prefix: 'fas',
  iconName: 'users-between-lines',
  icon: [640, 512, [], "e591", "M0 24C0 10.7 10.7 0 24 0L616 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 48C10.7 48 0 37.3 0 24zM0 488c0-13.3 10.7-24 24-24l592 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24zM83.2 160a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM32 320c0-35.3 28.7-64 64-64l96 0c12.2 0 23.7 3.4 33.4 9.4c-37.2 15.1-65.6 47.2-75.8 86.6L64 352c-17.7 0-32-14.3-32-32zm461.6 32c-10.3-40.1-39.6-72.6-77.7-87.4c9.4-5.5 20.4-8.6 32.1-8.6l96 0c35.3 0 64 28.7 64 64c0 17.7-14.3 32-32 32l-82.4 0zM391.2 290.4c32.1 7.4 58.1 30.9 68.9 61.6c3.5 10 5.5 20.8 5.5 32c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32c0-11.2 1.9-22 5.5-32c10.5-29.7 35.3-52.8 66.1-60.9c7.8-2.1 16-3.1 24.5-3.1l96 0c7.4 0 14.7 .8 21.6 2.4zm44-130.4a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM321.6 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faLungsVirus = {
  prefix: 'fas',
  iconName: 'lungs-virus',
  icon: [640, 512, [], "e067", "M320 0c17.7 0 32 14.3 32 32l0 124.2c-8.5-7.6-19.7-12.2-32-12.2s-23.5 4.6-32 12.2L288 32c0-17.7 14.3-32 32-32zM444.5 195.5c-16.4-16.4-41.8-18.5-60.5-6.1l0-24.1C384 127 415 96 453.3 96c21.7 0 42.8 10.2 55.8 28.8c15.4 22.1 44.3 65.4 71 116.9c26.5 50.9 52.4 112.5 59.6 170.3c.2 1.3 .2 2.6 .2 4l0 7c0 49.1-39.8 89-89 89c-7.3 0-14.5-.9-21.6-2.7l-72.7-18.2c-20.9-5.2-38.7-17.1-51.5-32.9c14 1.5 28.5-3 39.2-13.8l-22.6-22.6 22.6 22.6c18.7-18.7 18.7-49.1 0-67.9c-1.1-1.1-1.4-2-1.5-2.5c-.1-.8-.1-1.8 .4-2.9s1.2-1.9 1.8-2.3c.5-.3 1.3-.8 2.9-.8c26.5 0 48-21.5 48-48s-21.5-48-48-48c-1.6 0-2.4-.4-2.9-.8c-.6-.4-1.3-1.2-1.8-2.3s-.5-2.2-.4-2.9c.1-.6 .4-1.4 1.5-2.5c18.7-18.7 18.7-49.1 0-67.9zM421.8 421.8c-6.2 6.2-16.4 6.2-22.6 0C375.9 398.5 336 415 336 448c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-33-39.9-49.5-63.2-26.2c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6C241.5 375.9 225 336 192 336c-8.8 0-16-7.2-16-16s7.2-16 16-16c33 0 49.5-39.9 26.2-63.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0C264.1 241.5 304 225 304 192c0-8.8 7.2-16 16-16s16 7.2 16 16c0 33 39.9 49.5 63.2 26.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6C398.5 264.1 415 304 448 304c8.8 0 16 7.2 16 16s-7.2 16-16 16c-33 0-49.5 39.9-26.2 63.2c6.2 6.2 6.2 16.4 0 22.6zM183.3 491.2l-72.7 18.2c-7.1 1.8-14.3 2.7-21.6 2.7c-49.1 0-89-39.8-89-89l0-7c0-1.3 .1-2.7 .2-4c7.2-57.9 33.1-119.4 59.6-170.3c26.8-51.5 55.6-94.8 71-116.9c13-18.6 34-28.8 55.8-28.8C225 96 256 127 256 165.3l0 24.1c-18.6-12.4-44-10.3-60.5 6.1c-18.7 18.7-18.7 49.1 0 67.9c1.1 1.1 1.4 2 1.5 2.5c.1 .8 .1 1.8-.4 2.9s-1.2 1.9-1.8 2.3c-.5 .3-1.3 .8-2.9 .8c-26.5 0-48 21.5-48 48s21.5 48 48 48c1.6 0 2.4 .4 2.9 .8c.6 .4 1.3 1.2 1.8 2.3s.5 2.2 .4 2.9c-.1 .6-.4 1.4-1.5 2.5c-18.7 18.7-18.7 49.1 0 67.9c10.7 10.7 25.3 15.3 39.2 13.8c-12.8 15.9-30.6 27.7-51.5 32.9zM296 320a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm72 32a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faFaceGrinTears = {
  prefix: 'fas',
  iconName: 'face-grin-tears',
  icon: [640, 512, [128514, "grin-tears"], "f588", "M548.6 371.4C506.4 454.8 419.9 512 320 512s-186.4-57.2-228.6-140.6c4.5-2.9 8.7-6.3 12.7-10.3c8.1-8.1 13.2-18.6 16.5-26.6c3.6-8.8 6.5-18.4 8.8-27.5c4.6-18.2 7.7-37 9.3-48.2c3.9-26.5-18.8-49.2-45.2-45.4c-6.8 .9-16.2 2.4-26.6 4.4C85.3 94.5 191.6 0 320 0S554.7 94.5 573.2 217.7c-10.3-2-19.8-3.5-26.6-4.4c-26.5-3.9-49.2 18.8-45.2 45.4c1.6 11.3 4.6 30 9.3 48.2c2.3 9.1 5.2 18.8 8.8 27.5c3.3 8.1 8.4 18.5 16.5 26.6c3.9 3.9 8.2 7.4 12.7 10.3zM107 254.1c-3.1 21.5-11.4 70.2-25.5 84.4c-.9 1-1.9 1.8-2.9 2.7C60 356.7 32 355.5 14.3 337.7c-18.7-18.7-19.1-48.8-.7-67.2c8.6-8.6 30.1-15.1 50.5-19.6c13-2.8 25.5-4.8 33.9-6c5.4-.8 9.9 3.7 9 9zm454.5 87.1c-.8-.6-1.5-1.3-2.3-2c-.2-.2-.5-.4-.7-.7c-14.1-14.1-22.5-62.9-25.5-84.4c-.8-5.4 3.7-9.9 9-9c1 .1 2.2 .3 3.3 .5c8.2 1.2 19.2 3 30.6 5.5c20.4 4.4 41.9 10.9 50.5 19.6c18.4 18.4 18 48.5-.7 67.2c-17.7 17.7-45.7 19-64.2 3.4zm-90.1-9.7c5-11.8-7-22.5-19.3-18.7c-39.7 12.2-84.5 19-131.8 19s-92.1-6.8-131.8-19c-12.3-3.8-24.3 6.9-19.3 18.7c25 59.1 83.2 100.5 151.1 100.5s126.2-41.4 151.1-100.5zM281.6 228.8s0 0 0 0s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C190.7 188.4 184 206.1 184 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0zm160 0s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C350.7 188.4 344 206.1 344 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0c0 0 0 0 0 0z"]
};
const faGrinTears = faFaceGrinTears;
const faPhone = {
  prefix: 'fas',
  iconName: 'phone',
  icon: [512, 512, [128222, 128379], "f095", "M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"]
};
const faCalendarXmark = {
  prefix: 'fas',
  iconName: 'calendar-xmark',
  icon: [448, 512, ["calendar-times"], "f273", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM305 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47z"]
};
const faCalendarTimes = faCalendarXmark;
const faChildReaching = {
  prefix: 'fas',
  iconName: 'child-reaching',
  icon: [384, 512, [], "e59d", "M256 64A64 64 0 1 0 128 64a64 64 0 1 0 128 0zM152.9 169.3c-23.7-8.4-44.5-24.3-58.8-45.8L74.6 94.2C64.8 79.5 45 75.6 30.2 85.4s-18.7 29.7-8.9 44.4L40.9 159c18.1 27.1 42.8 48.4 71.1 62.4L112 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 32 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-258.4c29.1-14.2 54.4-36.2 72.7-64.2l18.2-27.9c9.6-14.8 5.4-34.6-9.4-44.3s-34.6-5.5-44.3 9.4L291 122.4c-21.8 33.4-58.9 53.6-98.8 53.6c-12.6 0-24.9-2-36.6-5.8c-.9-.3-1.8-.7-2.7-.9z"]
};
const faHeadSideVirus = {
  prefix: 'fas',
  iconName: 'head-side-virus',
  icon: [512, 512, [], "e064", "M0 224.2C0 100.6 100.2 0 224 0l24 0c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8L448 320l0 64c0 35.3-28.7 64-64 64l-64 0 0 32c0 17.7-14.3 32-32 32L96 512c-17.7 0-32-14.3-32-32l0-72.7c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zM224 64c-8.8 0-16 7.2-16 16c0 33-39.9 49.5-63.2 26.2c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6C145.5 152.1 129 192 96 192c-8.8 0-16 7.2-16 16s7.2 16 16 16c33 0 49.5 39.9 26.2 63.2c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0C168.1 286.5 208 303 208 336c0 8.8 7.2 16 16 16s16-7.2 16-16c0-33 39.9-49.5 63.2-26.2c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6C302.5 263.9 319 224 352 224c8.8 0 16-7.2 16-16s-7.2-16-16-16c-33 0-49.5-39.9-26.2-63.2c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0C279.9 129.5 240 113 240 80c0-8.8-7.2-16-16-16zm-24 96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40 80a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faUserGear = {
  prefix: 'fas',
  iconName: 'user-gear',
  icon: [640, 512, ["user-cog"], "f4fe", "M224 0a128 128 0 1 1 0 256A128 128 0 1 1 224 0zM178.3 304l91.4 0c11.8 0 23.4 1.2 34.5 3.3c-2.1 18.5 7.4 35.6 21.8 44.8c-16.6 10.6-26.7 31.6-20 53.3c4 12.9 9.4 25.5 16.4 37.6s15.2 23.1 24.4 33c15.7 16.9 39.6 18.4 57.2 8.7l0 .9c0 9.2 2.7 18.5 7.9 26.3L29.7 512C13.3 512 0 498.7 0 482.3C0 383.8 79.8 304 178.3 304zM436 218.2c0-7 4.5-13.3 11.3-14.8c10.5-2.4 21.5-3.7 32.7-3.7s22.2 1.3 32.7 3.7c6.8 1.5 11.3 7.8 11.3 14.8l0 30.6c7.9 3.4 15.4 7.7 22.3 12.8l24.9-14.3c6.1-3.5 13.7-2.7 18.5 2.4c7.6 8.1 14.3 17.2 20.1 27.2s10.3 20.4 13.5 31c2.1 6.7-1.1 13.7-7.2 17.2l-25 14.4c.4 4 .7 8.1 .7 12.3s-.2 8.2-.7 12.3l25 14.4c6.1 3.5 9.2 10.5 7.2 17.2c-3.3 10.6-7.8 21-13.5 31s-12.5 19.1-20.1 27.2c-4.8 5.1-12.5 5.9-18.5 2.4l-24.9-14.3c-6.9 5.1-14.3 9.4-22.3 12.8l0 30.6c0 7-4.5 13.3-11.3 14.8c-10.5 2.4-21.5 3.7-32.7 3.7s-22.2-1.3-32.7-3.7c-6.8-1.5-11.3-7.8-11.3-14.8l0-30.5c-8-3.4-15.6-7.7-22.5-12.9l-24.7 14.3c-6.1 3.5-13.7 2.7-18.5-2.4c-7.6-8.1-14.3-17.2-20.1-27.2s-10.3-20.4-13.5-31c-2.1-6.7 1.1-13.7 7.2-17.2l24.8-14.3c-.4-4.1-.7-8.2-.7-12.4s.2-8.3 .7-12.4L343.8 325c-6.1-3.5-9.2-10.5-7.2-17.2c3.3-10.6 7.7-21 13.5-31s12.5-19.1 20.1-27.2c4.8-5.1 12.4-5.9 18.5-2.4l24.8 14.3c6.9-5.1 14.5-9.4 22.5-12.9l0-30.5zm92.1 133.5a48.1 48.1 0 1 0 -96.1 0 48.1 48.1 0 1 0 96.1 0z"]
};
const faUserCog = faUserGear;
const faArrowUp19 = {
  prefix: 'fas',
  iconName: 'arrow-up-1-9',
  icon: [576, 512, ["sort-numeric-up"], "f163", "M450.7 38c8.3 6 13.3 15.7 13.3 26l0 96 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-51.6-5.9 2c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5l48-16c9.8-3.3 20.5-1.6 28.8 4.4zM160 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L192 146.3 192 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-301.7L95.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C142.5 35.8 151 32 160 32zM445.7 364.9A32 32 0 1 0 418.3 307a32 32 0 1 0 27.4 57.9zm-40.7 54.9C369.6 408.4 344 375.2 344 336c0-48.6 39.4-88 88-88s88 39.4 88 88c0 23.5-7.5 46.3-21.5 65.2L449.7 467c-10.5 14.2-30.6 17.2-44.8 6.7s-17.2-30.6-6.7-44.8l6.8-9.2z"]
};
const faSortNumericUp = faArrowUp19;
const faDoorClosed = {
  prefix: 'fas',
  iconName: 'door-closed',
  icon: [576, 512, [128682], "f52a", "M96 64c0-35.3 28.7-64 64-64L416 0c35.3 0 64 28.7 64 64l0 384 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-112 0-288 0L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0L96 64zM384 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faShieldVirus = {
  prefix: 'fas',
  iconName: 'shield-virus',
  icon: [512, 512, [], "e06c", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM256 112c8.8 0 16 7.2 16 16c0 33 39.9 49.5 63.2 26.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6C334.5 200.1 351 240 384 240c8.8 0 16 7.2 16 16s-7.2 16-16 16c-33 0-49.5 39.9-26.2 63.2c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0C311.9 334.5 272 351 272 384c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-33-39.9-49.5-63.2-26.2c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6C177.5 311.9 161 272 128 272c-8.8 0-16-7.2-16-16s7.2-16 16-16c33 0 49.5-39.9 26.2-63.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0C200.1 177.5 240 161 240 128c0-8.8 7.2-16 16-16zM232 256a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm72 32a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faDiceSix = {
  prefix: 'fas',
  iconName: 'dice-six',
  icon: [448, 512, [9861], "f526", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm160 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faMosquitoNet = {
  prefix: 'fas',
  iconName: 'mosquito-net',
  icon: [640, 512, [], "e52c", "M168.8 462.3c-7.9-4-11.1-13.6-7.2-21.5L192 380.2l0-44.2c0-4.2 1.7-8.3 4.7-11.3L256 265.4l0-23.1L139.2 344C87.8 395.3 0 358.9 0 286.3c0-41.1 30.6-75.8 71.4-80.9l159.9-23.9-49.6-41.3c-5.1-4.2-7-11.1-4.9-17.4l13.9-41.7-29-58.1c-4-7.9-.7-17.5 7.2-21.5s17.5-.7 21.5 7.2l32 64c1.9 3.8 2.2 8.2 .9 12.2l-12.5 37.6L256 160.5l0-22.6c0-14.9 10.1-27.3 23.8-31l0-43.3c0-4.5 3.7-8.2 8.2-8.2s8.2 3.7 8.2 8.2l0 43.3c13.7 3.6 23.8 16.1 23.8 31l0 22.6 45.4-37.8L352.8 85.1c-1.3-4-1-8.4 .9-12.2l32-64c4-7.9 13.6-11.1 21.5-7.2s11.1 13.6 7.2 21.5l-29 58.1 13.9 41.7c2.1 6.2 .1 13.1-4.9 17.4l-49.6 41.3 159.9 23.9c22.5 2.8 41.8 14.6 54.7 31.4c-2.7 2.6-5.2 5.4-7.3 8.6c-8.6-12.9-23.3-21.5-40-21.5s-31.4 8.5-40 21.5c-8.6-12.9-23.3-21.5-40-21.5c-21.7 0-40 14.3-45.9 34.1c-10.7 3.2-19.8 10.1-25.9 19.2l-40.2-35 0 23.1 32.4 32.4c-.3 2-.4 4.1-.4 6.2c0 16.7 8.5 31.4 21.5 40c-4 2.6-7.5 5.9-10.6 9.5L320 310.6l0 50c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-50-32 32 0 41.4c0 2.5-.6 4.9-1.7 7.2l-32 64c-4 7.9-13.6 11.1-21.5 7.2zM512 256c8.8 0 16 7.2 16 16l0 16 48 0 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 16 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0 0 48 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0 0 48 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-16-48 0 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-16-48 0 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-16-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 0-48-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 0-48-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 16 48 0 0-16c0-8.8 7.2-16 16-16zm16 112l48 0 0-48-48 0 0 48zm0 80l48 0 0-48-48 0 0 48zM448 320l0 48 48 0 0-48-48 0zm0 80l0 48 48 0 0-48-48 0z"]
};
const faFileFragment = {
  prefix: 'fas',
  iconName: 'file-fragment',
  icon: [384, 512, [], "e697", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64l-128 0 0-128c0-35.3-28.7-64-64-64L0 320 0 64zm384 64l-128 0L256 0 384 128zM32 352l96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32z"]
};
const faBridgeWater = {
  prefix: 'fas',
  iconName: 'bridge-water',
  icon: [576, 512, [], "e4ce", "M0 96C0 78.3 14.3 64 32 64l512 0c17.7 0 32 14.3 32 32l0 35.6c0 15.7-12.7 28.4-28.4 28.4c-37.3 0-67.6 30.2-67.6 67.6l0 124.9c-12.9 0-25.8 3.9-36.8 11.7c-18 12.4-40.1 20.3-59.2 20.3c0 0 0 0 0 0l0-.5 0-128c0-53-43-96-96-96s-96 43-96 96l0 128 0 .5c-19 0-41.2-7.9-59.1-20.3c-11.1-7.8-24-11.7-36.9-11.7l0-124.9C96 190.2 65.8 160 28.4 160C12.7 160 0 147.3 0 131.6L0 96zM306.5 389.9C329 405.4 356.5 416 384 416c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 469.7 417 480 384 480c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 405.2 165.1 416 192 416c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faPersonBooth = {
  prefix: 'fas',
  iconName: 'person-booth',
  icon: [576, 512, [], "f756", "M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160 64 0 0-160zm320 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-448zM224 512c17.7 0 32-14.3 32-32l0-160-64 0 0 160c0 17.7 14.3 32 32 32zM320 0c-9.3 0-18.1 4-24.2 11s-8.8 16.3-7.5 25.5l31.2 218.6L288.6 409.7c-3.5 17.3 7.8 34.2 25.1 37.7s34.2-7.8 37.7-25.1l.7-3.6c1.3 16.4 15.1 29.4 31.9 29.4c17.7 0 32-14.3 32-32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32L320 0zM112 80A48 48 0 1 0 16 80a48 48 0 1 0 96 0zm0 261.3l0-72.1 4.7 4.7c9 9 21.2 14.1 33.9 14.1l73.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-66.7 0-41.6-41.6c-14.3-14.3-33.8-22.4-54-22.4C27.6 160 0 187.6 0 221.6l0 55.7 0 .9L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 32 42.7L96 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-58.7c0-10.4-3.4-20.5-9.6-28.8L112 341.3z"]
};
const faTextWidth = {
  prefix: 'fas',
  iconName: 'text-width',
  icon: [448, 512, [], "f035", "M64 128l0-32 128 0 0 128-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-128 128 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48c0-26.5-21.5-48-48-48L224 32 48 32C21.5 32 0 53.5 0 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32zM9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-32 192 0 0 32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 32-192 0 0-32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64z"]
};
const faHatWizard = {
  prefix: 'fas',
  iconName: 'hat-wizard',
  icon: [512, 512, [], "f6e8", "M64 416L168.6 180.7c15.3-34.4 40.3-63.5 72-83.7l146.9-94c3-1.9 6.5-2.9 10-2.9C407.7 0 416 8.3 416 18.6l0 1.6c0 2.6-.5 5.1-1.4 7.5L354.8 176.9c-1.9 4.7-2.8 9.7-2.8 14.7c0 5.5 1.2 11 3.4 16.1L448 416l-207.1 0 11.8-35.4 40.4-13.5c6.5-2.2 10.9-8.3 10.9-15.2s-4.4-13-10.9-15.2l-40.4-13.5-13.5-40.4C237 276.4 230.9 272 224 272s-13 4.4-15.2 10.9l-13.5 40.4-40.4 13.5C148.4 339 144 345.1 144 352s4.4 13 10.9 15.2l40.4 13.5L207.1 416 64 416zM279.6 141.5c-1.1-3.3-4.1-5.5-7.6-5.5s-6.5 2.2-7.6 5.5l-6.7 20.2-20.2 6.7c-3.3 1.1-5.5 4.1-5.5 7.6s2.2 6.5 5.5 7.6l20.2 6.7 6.7 20.2c1.1 3.3 4.1 5.5 7.6 5.5s6.5-2.2 7.6-5.5l6.7-20.2 20.2-6.7c3.3-1.1 5.5-4.1 5.5-7.6s-2.2-6.5-5.5-7.6l-20.2-6.7-6.7-20.2zM32 448l448 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faPenFancy = {
  prefix: 'fas',
  iconName: 'pen-fancy',
  icon: [512, 512, [128395, 10002], "f5ac", "M373.5 27.1C388.5 9.9 410.2 0 433 0c43.6 0 79 35.4 79 79c0 22.8-9.9 44.6-27.1 59.6L277.7 319l-10.3-10.3-64-64L193 234.3 373.5 27.1zM170.3 256.9l10.4 10.4 64 64 10.4 10.4-19.2 83.4c-3.9 17.1-16.9 30.7-33.8 35.4L24.3 510.3l95.4-95.4c2.6 .7 5.4 1.1 8.3 1.1c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32c0 2.9 .4 5.6 1.1 8.3L1.7 487.6 51.5 310c4.7-16.9 18.3-29.9 35.4-33.8l83.4-19.2z"]
};
const faPersonDigging = {
  prefix: 'fas',
  iconName: 'person-digging',
  icon: [576, 512, ["digging"], "f85e", "M208 64a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM9.8 214.8c5.1-12.2 19.1-18 31.4-12.9L60.7 210l22.9-38.1C99.9 144.6 129.3 128 161 128c51.4 0 97 32.9 113.3 81.7l34.6 103.7 79.3 33.1 34.2-45.6c6.4-8.5 16.6-13.3 27.2-12.8s20.3 6.4 25.8 15.5l96 160c5.9 9.9 6.1 22.2 .4 32.2s-16.3 16.2-27.8 16.2l-256 0c-11.1 0-21.4-5.7-27.2-15.2s-6.4-21.2-1.4-31.1l16-32c5.4-10.8 16.5-17.7 28.6-17.7l32 0 22.5-30L22.8 246.2c-12.2-5.1-18-19.1-12.9-31.4zm82.8 91.8l112 48c11.8 5 19.4 16.6 19.4 29.4l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-74.9-60.6-26-37 111c-5.6 16.8-23.7 25.8-40.5 20.2S-3.9 486.6 1.6 469.9l48-144 11-33 32 13.7z"]
};
const faDigging = faPersonDigging;
const faTrash = {
  prefix: 'fas',
  iconName: 'trash',
  icon: [448, 512, [], "f1f8", "M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"]
};
const faGaugeSimple = {
  prefix: 'fas',
  iconName: 'gauge-simple',
  icon: [512, 512, ["gauge-simple-med", "tachometer-average"], "f629", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-26.9-16.5-49.9-40-59.3L280 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 204.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faGaugeSimpleMed = faGaugeSimple;
const faTachometerAverage = faGaugeSimple;
const faBookMedical = {
  prefix: 'fas',
  iconName: 'book-medical',
  icon: [448, 512, [], "f7e6", "M0 96C0 43 43 0 96 0L384 0l32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32zM208 112l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faPoo = {
  prefix: 'fas',
  iconName: 'poo',
  icon: [512, 512, [128169], "f2fe", "M268.9 .9c-5.5-.7-11 1.4-14.5 5.7s-4.6 10.1-2.8 15.4c2.8 8.2 4.3 16.9 4.3 26.1c0 44.1-35.7 79.9-79.8 80L160 128c-35.3 0-64 28.7-64 64c0 19.1 8.4 36.3 21.7 48L104 240c-39.8 0-72 32.2-72 72c0 23.2 11 43.8 28 57c-34.1 5.7-60 35.3-60 71c0 39.8 32.2 72 72 72l368 0c39.8 0 72-32.2 72-72c0-35.7-25.9-65.3-60-71c17-13.2 28-33.8 28-57c0-39.8-32.2-72-72-72l-13.7 0c13.3-11.7 21.7-28.9 21.7-48c0-35.3-28.7-64-64-64l-5.5 0c3.5-10 5.5-20.8 5.5-32c0-48.6-36.2-88.8-83.1-95.1zM192 256a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm64 108.3c0 2.4-.7 4.8-2.2 6.7c-8.2 10.5-39.5 45-93.8 45s-85.6-34.6-93.8-45c-1.5-1.9-2.2-4.3-2.2-6.7c0-6.8 5.5-12.3 12.3-12.3l167.4 0c6.8 0 12.3 5.5 12.3 12.3z"]
};
const faQuoteRight = {
  prefix: 'fas',
  iconName: 'quote-right',
  icon: [448, 512, [8221, "quote-right-alt"], "f10e", "M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"]
};
const faQuoteRightAlt = faQuoteRight;
const faShirt = {
  prefix: 'fas',
  iconName: 'shirt',
  icon: [640, 512, [128085, "t-shirt", "tshirt"], "f553", "M211.8 0c7.8 0 14.3 5.7 16.7 13.2C240.8 51.9 277.1 80 320 80s79.2-28.1 91.5-66.8C413.9 5.7 420.4 0 428.2 0l12.6 0c22.5 0 44.2 7.9 61.5 22.3L628.5 127.4c6.6 5.5 10.7 13.5 11.4 22.1s-2.1 17.1-7.8 23.6l-56 64c-11.4 13.1-31.2 14.6-44.6 3.5L480 197.7 480 448c0 35.3-28.7 64-64 64l-192 0c-35.3 0-64-28.7-64-64l0-250.3-51.5 42.9c-13.3 11.1-33.1 9.6-44.6-3.5l-56-64c-5.7-6.5-8.5-15-7.8-23.6s4.8-16.6 11.4-22.1L137.7 22.3C155 7.9 176.7 0 199.2 0l12.6 0z"]
};
const faTShirt = faShirt;
const faTshirt = faShirt;
const faCubes = {
  prefix: 'fas',
  iconName: 'cubes',
  icon: [576, 512, [], "f1b3", "M290.8 48.6l78.4 29.7L288 109.5 206.8 78.3l78.4-29.7c1.8-.7 3.8-.7 5.7 0zM136 92.5l0 112.2c-1.3 .4-2.6 .8-3.9 1.3l-96 36.4C14.4 250.6 0 271.5 0 294.7L0 413.9c0 22.2 13.1 42.3 33.5 51.3l96 42.2c14.4 6.3 30.7 6.3 45.1 0L288 457.5l113.5 49.9c14.4 6.3 30.7 6.3 45.1 0l96-42.2c20.3-8.9 33.5-29.1 33.5-51.3l0-119.1c0-23.3-14.4-44.1-36.1-52.4l-96-36.4c-1.3-.5-2.6-.9-3.9-1.3l0-112.2c0-23.3-14.4-44.1-36.1-52.4l-96-36.4c-12.8-4.8-26.9-4.8-39.7 0l-96 36.4C150.4 48.4 136 69.3 136 92.5zM392 210.6l-82.4 31.2 0-89.2L392 121l0 89.6zM154.8 250.9l78.4 29.7L152 311.7 70.8 280.6l78.4-29.7c1.8-.7 3.8-.7 5.7 0zm18.8 204.4l0-100.5L256 323.2l0 95.9-82.4 36.2zM421.2 250.9c1.8-.7 3.8-.7 5.7 0l78.4 29.7L424 311.7l-81.2-31.1 78.4-29.7zM523.2 421.2l-77.6 34.1 0-100.5L528 323.2l0 90.7c0 3.2-1.9 6-4.8 7.3z"]
};
const faDivide = {
  prefix: 'fas',
  iconName: 'divide',
  icon: [448, 512, [10135, 247], "f529", "M272 96a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 320a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM400 288c17.7 0 32-14.3 32-32s-14.3-32-32-32L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l352 0z"]
};
const faTengeSign = {
  prefix: 'fas',
  iconName: 'tenge-sign',
  icon: [384, 512, [8376, "tenge"], "f7d7", "M0 64C0 46.3 14.3 32 32 32l320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM0 192c0-17.7 14.3-32 32-32l160 0 160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0 0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-224L32 224c-17.7 0-32-14.3-32-32z"]
};
const faTenge = faTengeSign;
const faHeadphones = {
  prefix: 'fas',
  iconName: 'headphones',
  icon: [512, 512, [127911], "f025", "M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48c-44.2 0-80-35.8-80-80l0-16 0-48 0-48C0 146.6 114.6 32 256 32s256 114.6 256 256l0 48 0 48 0 16c0 44.2-35.8 80-80 80c-26.5 0-48-21.5-48-48l0-128c0-26.5 21.5-48 48-48c10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80z"]
};
const faHandsHolding = {
  prefix: 'fas',
  iconName: 'hands-holding',
  icon: [640, 512, [], "f4c2", "M80 104c0-22.1-17.9-40-40-40S0 81.9 0 104l0 56 0 64L0 325.5c0 25.5 10.1 49.9 28.1 67.9L128 493.3c12 12 28.3 18.7 45.3 18.7l66.7 0c26.5 0 48-21.5 48-48l0-78.9c0-29.7-11.8-58.2-32.8-79.2l-25.3-25.3c0 0 0 0 0 0l-15.2-15.2-32-32c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l32 32 15.2 15.2c11 11 9.2 29.2-3.7 37.8c-9.7 6.5-22.7 5.2-31-3.1L98.7 309.5c-12-12-18.7-28.3-18.7-45.3L80 224l0-80 0-40zm480 0l0 40 0 80 0 40.2c0 17-6.7 33.3-18.7 45.3l-51.1 51.1c-8.3 8.3-21.3 9.6-31 3.1c-12.9-8.6-14.7-26.9-3.7-37.8l15.2-15.2 32-32c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-32 32-15.2 15.2c0 0 0 0 0 0l-25.3 25.3c-21 21-32.8 49.5-32.8 79.2l0 78.9c0 26.5 21.5 48 48 48l66.7 0c17 0 33.3-6.7 45.3-18.7l99.9-99.9c18-18 28.1-42.4 28.1-67.9L640 224l0-64 0-56c0-22.1-17.9-40-40-40s-40 17.9-40 40z"]
};
const faHandsClapping = {
  prefix: 'fas',
  iconName: 'hands-clapping',
  icon: [512, 512, [], "e1a8", "M336 16l0 64c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16zm-98.7 7.1l32 48c4.9 7.4 2.9 17.3-4.4 22.2s-17.3 2.9-22.2-4.4l-32-48c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4zM135 119c9.4-9.4 24.6-9.4 33.9 0L292.7 242.7c10.1 10.1 27.3 2.9 27.3-11.3l0-39.4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 153.6c0 57.1-30 110-78.9 139.4c-64 38.4-145.8 28.3-198.5-24.4L7 361c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l53 53c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1L23 265c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l93 93c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1L55 185c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l117 117c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1l-93-93c-9.4-9.4-9.4-24.6 0-33.9zM433.1 484.9c-24.2 14.5-50.9 22.1-77.7 23.1c48.1-39.6 76.6-99 76.6-162.4l0-98.1c8.2-.1 16-6.4 16-16l0-39.4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 153.6c0 57.1-30 110-78.9 139.4zM424.9 18.7c7.4 4.9 9.3 14.8 4.4 22.2l-32 48c-4.9 7.4-14.8 9.3-22.2 4.4s-9.3-14.8-4.4-22.2l32-48c4.9-7.4 14.8-9.3 22.2-4.4z"]
};
const faRepublican = {
  prefix: 'fas',
  iconName: 'republican',
  icon: [640, 512, [], "f75e", "M0 192C0 103.6 71.6 32 160 32l224 0c88.4 0 160 71.6 160 160l0 64L0 256l0-64zm415.9-64c-2.4 0-4.7 1.3-5.7 3.4l-12.6 24.6-28.2 4c-2.4 .3-4.4 2-5.2 4.2s-.1 4.7 1.6 6.3l20.4 19.2-4.8 27.1c-.4 2.3 .6 4.7 2.5 6s4.6 1.6 6.7 .5l25.2-12.8 25.2 12.8c2.2 1.1 4.8 .9 6.7-.5s3-3.7 2.5-6l-4.8-27.1L466 170.5c1.7-1.6 2.4-4.1 1.6-6.3s-2.8-3.9-5.2-4.2l-28.2-4-12.6-24.6c-1.1-2.1-3.3-3.4-5.7-3.4zm-138.3 3.4c-1.1-2.1-3.3-3.4-5.7-3.4s-4.7 1.3-5.7 3.4l-12.6 24.6-28.2 4c-2.4 .3-4.4 2-5.2 4.2s-.1 4.7 1.6 6.3l20.4 19.2-4.8 27.1c-.4 2.3 .6 4.7 2.5 6s4.6 1.6 6.7 .5l25.2-12.8 25.2 12.8c2.2 1.1 4.8 .9 6.7-.5s3-3.7 2.5-6l-4.8-27.1L322 170.5c1.7-1.6 2.4-4.1 1.6-6.3s-2.8-3.9-5.2-4.2l-28.2-4-12.6-24.6zM127.9 128c-2.4 0-4.7 1.3-5.7 3.4l-12.6 24.6-28.2 4c-2.4 .3-4.4 2-5.2 4.2s-.1 4.7 1.6 6.3l20.4 19.2-4.8 27.1c-.4 2.3 .6 4.7 2.5 6s4.6 1.6 6.7 .5l25.2-12.8 25.2 12.8c2.2 1.1 4.8 .9 6.7-.5s3-3.7 2.5-6l-4.8-27.1L178 170.5c1.7-1.6 2.4-4.1 1.6-6.3s-2.8-3.9-5.2-4.2l-28.2-4-12.6-24.6c-1.1-2.1-3.3-3.4-5.7-3.4zm.1 160l192 0 96 0 32 0 64 0 32 0 0 32 0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48c0-17.7 14.3-32 32-32s32 14.3 32 32l0 48c0 44.2-35.8 80-80 80s-80-35.8-80-80l0-48-32 0 0 32 0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64-192 0 0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64 0-96 128 0z"]
};
const faArrowLeft = {
  prefix: 'fas',
  iconName: 'arrow-left',
  icon: [448, 512, [8592], "f060", "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]
};
const faPersonCircleXmark = {
  prefix: 'fas',
  iconName: 'person-circle-xmark',
  icon: [576, 512, [], "e543", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L432 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L409.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L432 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L454.6 368l36.7-36.7z"]
};
const faRuler = {
  prefix: 'fas',
  iconName: 'ruler',
  icon: [512, 512, [128207], "f545", "M177.9 494.1c-18.7 18.7-49.1 18.7-67.9 0L17.9 401.9c-18.7-18.7-18.7-49.1 0-67.9l50.7-50.7 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 50.7-50.7c18.7-18.7 49.1-18.7 67.9 0l92.1 92.1c18.7 18.7 18.7 49.1 0 67.9L177.9 494.1z"]
};
const faAlignLeft = {
  prefix: 'fas',
  iconName: 'align-left',
  icon: [448, 512, [], "f036", "M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
};
const faDiceD6 = {
  prefix: 'fas',
  iconName: 'dice-d6',
  icon: [448, 512, [], "f6d1", "M201 10.3c14.3-7.8 31.6-7.8 46 0L422.3 106c5.1 2.8 8.3 8.2 8.3 14s-3.2 11.2-8.3 14L231.7 238c-4.8 2.6-10.5 2.6-15.3 0L25.7 134c-5.1-2.8-8.3-8.2-8.3-14s3.2-11.2 8.3-14L201 10.3zM23.7 170l176 96c5.1 2.8 8.3 8.2 8.3 14l0 216c0 5.6-3 10.9-7.8 13.8s-10.9 3-15.8 .3L25 423.1C9.6 414.7 0 398.6 0 381L0 184c0-5.6 3-10.9 7.8-13.8s10.9-3 15.8-.3zm400.7 0c5-2.7 11-2.6 15.8 .3s7.8 8.1 7.8 13.8l0 197c0 17.6-9.6 33.7-25 42.1L263.7 510c-5 2.7-11 2.6-15.8-.3s-7.8-8.1-7.8-13.8l0-216c0-5.9 3.2-11.2 8.3-14l176-96z"]
};
const faRestroom = {
  prefix: 'fas',
  iconName: 'restroom',
  icon: [640, 512, [], "f7bd", "M80 48a48 48 0 1 1 96 0A48 48 0 1 1 80 48zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-154.8c-8.1 9.2-21.1 13.2-33.5 9.4c-16.9-5.3-26.3-23.2-21-40.1l30.9-99.1C44.9 155.3 82 128 124 128l8 0c42 0 79.1 27.3 91.6 67.4l30.9 99.1c5.3 16.9-4.1 34.8-21 40.1c-12.4 3.9-25.4-.2-33.5-9.4L200 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM320 0c13.3 0 24 10.7 24 24l0 464c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-464c0-13.3 10.7-24 24-24zM464 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM440 480l0-96-17.8 0c-10.9 0-18.6-10.7-15.2-21.1l9-26.9c-3.2 0-6.4-.5-9.5-1.5c-16.9-5.3-26.3-23.2-21-40.1l29.7-95.2C428.4 156.9 467.6 128 512 128s83.6 28.9 96.8 71.2l29.7 95.2c5.3 16.9-4.1 34.8-21 40.1c-3.2 1-6.4 1.5-9.5 1.5l9 26.9c3.5 10.4-4.3 21.1-15.2 21.1L584 384l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-16 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32z"]
};
const faJ = {
  prefix: 'fas',
  iconName: 'j',
  icon: [320, 512, [106], "4a", "M288 32c17.7 0 32 14.3 32 32l0 256c0 88.4-71.6 160-160 160S0 408.4 0 320l0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32c0 53 43 96 96 96s96-43 96-96l0-256c0-17.7 14.3-32 32-32z"]
};
const faUsersViewfinder = {
  prefix: 'fas',
  iconName: 'users-viewfinder',
  icon: [640, 512, [], "e595", "M48 48l88 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L32 0C14.3 0 0 14.3 0 32L0 136c0 13.3 10.7 24 24 24s24-10.7 24-24l0-88zM175.8 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-26.5 32C119.9 256 96 279.9 96 309.3c0 14.7 11.9 26.7 26.7 26.7l56.1 0c8-34.1 32.8-61.7 65.2-73.6c-7.5-4.1-16.2-6.4-25.3-6.4l-69.3 0zm368 80c14.7 0 26.7-11.9 26.7-26.7c0-29.5-23.9-53.3-53.3-53.3l-69.3 0c-9.2 0-17.8 2.3-25.3 6.4c32.4 11.9 57.2 39.5 65.2 73.6l56.1 0zm-89.4 0c-8.6-24.3-29.9-42.6-55.9-47c-3.9-.7-7.9-1-12-1l-80 0c-4.1 0-8.1 .3-12 1c-26 4.4-47.3 22.7-55.9 47c-2.7 7.5-4.1 15.6-4.1 24c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24c0-8.4-1.4-16.5-4.1-24zM464 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-80-32a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM504 48l88 0 0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-104c0-17.7-14.3-32-32-32L504 0c-13.3 0-24 10.7-24 24s10.7 24 24 24zM48 464l0-88c0-13.3-10.7-24-24-24s-24 10.7-24 24L0 480c0 17.7 14.3 32 32 32l104 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-88 0zm456 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l104 0c17.7 0 32-14.3 32-32l0-104c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 88-88 0z"]
};
const faFileVideo = {
  prefix: 'fas',
  iconName: 'file-video',
  icon: [384, 512, [], "f1c8", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM64 288c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-96zM300.9 397.9L256 368l0-64 44.9-29.9c2-1.3 4.4-2.1 6.8-2.1c6.8 0 12.3 5.5 12.3 12.3l0 103.4c0 6.8-5.5 12.3-12.3 12.3c-2.4 0-4.8-.7-6.8-2.1z"]
};
const faUpRightFromSquare = {
  prefix: 'fas',
  iconName: 'up-right-from-square',
  icon: [512, 512, ["external-link-alt"], "f35d", "M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-128c0-17.7-14.3-32-32-32L352 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]
};
const faExternalLinkAlt = faUpRightFromSquare;
const faTableCells = {
  prefix: 'fas',
  iconName: 'table-cells',
  icon: [512, 512, ["th"], "f00a", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm88 64l0 64-88 0 0-64 88 0zm56 0l88 0 0 64-88 0 0-64zm240 0l0 64-88 0 0-64 88 0zM64 224l88 0 0 64-88 0 0-64zm232 0l0 64-88 0 0-64 88 0zm64 0l88 0 0 64-88 0 0-64zM152 352l0 64-88 0 0-64 88 0zm56 0l88 0 0 64-88 0 0-64zm240 0l0 64-88 0 0-64 88 0z"]
};
const faTh = faTableCells;
const faFilePdf = {
  prefix: 'fas',
  iconName: 'file-pdf',
  icon: [512, 512, [], "f1c1", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 144-208 0c-35.3 0-64 28.7-64 64l0 144-48 0c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM176 352l32 0c30.9 0 56 25.1 56 56s-25.1 56-56 56l-16 0 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-80c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0 48 16 0zm96-80l32 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16l0-128c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-16 0 0 96 16 0zm80-112c0-8.8 7.2-16 16-16l48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64 0-64z"]
};
const faBookBible = {
  prefix: 'fas',
  iconName: 'book-bible',
  icon: [448, 512, ["bible"], "f647", "M96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96l288 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64c17.7 0 32-14.3 32-32l0-320c0-17.7-14.3-32-32-32L384 0 96 0zm0 384l256 0 0 64L96 448c-17.7 0-32-14.3-32-32s14.3-32 32-32zM208 80c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 112c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-112-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faBible = faBookBible;
const faO = {
  prefix: 'fas',
  iconName: 'o',
  icon: [448, 512, [111], "4f", "M224 96a160 160 0 1 0 0 320 160 160 0 1 0 0-320zM448 256A224 224 0 1 1 0 256a224 224 0 1 1 448 0z"]
};
const faSuitcaseMedical = {
  prefix: 'fas',
  iconName: 'suitcase-medical',
  icon: [512, 512, ["medkit"], "f0fa", "M184 48l144 0c4.4 0 8 3.6 8 8l0 40L176 96l0-40c0-4.4 3.6-8 8-8zm-56 8l0 40 0 32 0 352 256 0 0-352 0-32 0-40c0-30.9-25.1-56-56-56L184 0c-30.9 0-56 25.1-56 56zM96 96L64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l32 0L96 96zM416 480l32 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-32 0 0 384zM224 208c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faMedkit = faSuitcaseMedical;
const faUserSecret = {
  prefix: 'fas',
  iconName: 'user-secret',
  icon: [448, 512, [128373], "f21b", "M224 16c-6.7 0-10.8-2.8-15.5-6.1C201.9 5.4 194 0 176 0c-30.5 0-52 43.7-66 89.4C62.7 98.1 32 112.2 32 128c0 14.3 25 27.1 64.6 35.9c-.4 4-.6 8-.6 12.1c0 17 3.3 33.2 9.3 48l-59.9 0C38 224 32 230 32 237.4c0 1.7 .3 3.4 1 5l38.8 96.9C28.2 371.8 0 423.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7c0-58.5-28.2-110.4-71.7-143L415 242.4c.6-1.6 1-3.3 1-5c0-7.4-6-13.4-13.4-13.4l-59.9 0c6-14.8 9.3-31 9.3-48c0-4.1-.2-8.1-.6-12.1C391 155.1 416 142.3 416 128c0-15.8-30.7-29.9-78-38.6C324 43.7 302.5 0 272 0c-18 0-25.9 5.4-32.5 9.9c-4.8 3.3-8.8 6.1-15.5 6.1zm56 208l-12.4 0c-16.5 0-31.1-10.6-36.3-26.2c-2.3-7-12.2-7-14.5 0c-5.2 15.6-19.9 26.2-36.3 26.2L168 224c-22.1 0-40-17.9-40-40l0-14.4c28.2 4.1 61 6.4 96 6.4s67.8-2.3 96-6.4l0 14.4c0 22.1-17.9 40-40 40zm-88 96l16 32L176 480 128 288l64 32zm128-32L272 480 240 352l16-32 64-32z"]
};
const faOtter = {
  prefix: 'fas',
  iconName: 'otter',
  icon: [640, 512, [129446], "f700", "M181.5 197.1l12.9 6.4c5.9 3 12.4 4.5 19.1 4.5c23.5 0 42.6-19.1 42.6-42.6l0-21.4c0-35.3-28.7-64-64-64l-64 0c-35.3 0-64 28.7-64 64l0 21.4c0 23.5 19.1 42.6 42.6 42.6c6.6 0 13.1-1.5 19.1-4.5l12.9-6.4 8.4-4.2L135.1 185c-4.5-3-7.1-8-7.1-13.3l0-3.7c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24l0 3.7c0 5.3-2.7 10.3-7.1 13.3l-11.8 7.9 8.4 4.2zm-8.6 49.4L160 240l-12.9 6.4c-12.6 6.3-26.5 9.6-40.5 9.6c-3.6 0-7.1-.2-10.6-.6l0 .6c0 35.3 28.7 64 64 64l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l160 0 0-48 0-16c0-23.7 12.9-44.4 32-55.4c9.4-5.4 20.3-8.6 32-8.6l0-16c0-26.5 21.5-48 48-48c8.8 0 16 7.2 16 16l0 32 0 16 0 48c0 8.8 7.2 16 16 16s16-7.2 16-16l0-99.7c0-48.2-30.8-91-76.6-106.3l-8.5-2.8c-8-2.7-12.6-11.1-10.4-19.3s10.3-13.2 18.6-11.6l19.9 4C576 86.1 640 164.2 640 254.9l0 1.1s0 0 0 0c0 123.7-100.3 224-224 224l-1.1 0L256 480l-.6 0C132 480 32 380 32 256.6l0-.6 0-39.2c-10.1-14.6-16-32.3-16-51.4L16 144l0-1.4C6.7 139.3 0 130.5 0 120c0-13.3 10.7-24 24-24l2.8 0C44.8 58.2 83.3 32 128 32l64 0c44.7 0 83.2 26.2 101.2 64l2.8 0c13.3 0 24 10.7 24 24c0 10.5-6.7 19.3-16 22.6l0 1.4 0 21.4c0 1.4 0 2.8-.1 4.3c12-6.2 25.7-9.6 40.1-9.6l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-13.3 0-24 10.7-24 24l0 8 56.4 0c-15.2 17-24.4 39.4-24.4 64l-32 0c-42.3 0-78.2-27.4-91-65.3c-5.1 .9-10.3 1.3-15.6 1.3c-14.1 0-27.9-3.3-40.5-9.6zM96 128a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm112 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faPersonDress = {
  prefix: 'fas',
  iconName: 'person-dress',
  icon: [320, 512, ["female"], "f182", "M160 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM88 384l-17.8 0c-10.9 0-18.6-10.7-15.2-21.1L93.3 248.1 59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l53.6-89.2c20.3-33.7 56.7-54.3 96-54.3l11.6 0c39.3 0 75.7 20.6 96 54.3l53.6 89.2c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9l-33.9-56.3L265 362.9c3.5 10.4-4.3 21.1-15.2 21.1L232 384l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-16 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96z"]
};
const faFemale = faPersonDress;
const faCommentDollar = {
  prefix: 'fas',
  iconName: 'comment-dollar',
  icon: [512, 512, [], "f651", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zm20-312l0 13.9c7.5 1.2 14.6 2.9 21.1 4.7c10.7 2.8 17 13.8 14.2 24.5s-13.8 17-24.5 14.2c-11-2.9-21.6-5-31.2-5.2c-7.9-.1-16 1.8-21.5 5c-4.8 2.8-6.2 5.6-6.2 9.3c0 1.8 .1 3.5 5.3 6.7c6.3 3.8 15.5 6.7 28.3 10.5l.7 .2c11.2 3.4 25.6 7.7 37.1 15c12.9 8.1 24.3 21.3 24.6 41.6c.3 20.9-10.5 36.1-24.8 45c-7.2 4.5-15.2 7.3-23.2 9l0 13.8c0 11-9 20-20 20s-20-9-20-20l0-14.6c-10.3-2.2-20-5.5-28.2-8.4c0 0 0 0 0 0s0 0 0 0c-2.1-.7-4.1-1.4-6.1-2.1c-10.5-3.5-16.1-14.8-12.6-25.3s14.8-16.1 25.3-12.6c2.5 .8 4.9 1.7 7.2 2.4c0 0 0 0 0 0c13.6 4.6 24 8.1 35.1 8.5c8.6 .3 16.5-1.6 21.4-4.7c4.1-2.5 6-5.5 5.9-10.5c0-2.9-.8-5-5.9-8.2c-6.3-4-15.4-6.9-28-10.7l-1.7-.5c-10.9-3.3-24.6-7.4-35.6-14c-12.7-7.7-24.6-20.5-24.7-40.7c-.1-21.1 11.8-35.7 25.8-43.9c6.9-4.1 14.5-6.8 22.2-8.5l0-14c0-11 9-20 20-20s20 9 20 20z"]
};
const faBusinessTime = {
  prefix: 'fas',
  iconName: 'business-time',
  icon: [640, 512, ["briefcase-clock"], "f64a", "M184 48l144 0c4.4 0 8 3.6 8 8l0 40L176 96l0-40c0-4.4 3.6-8 8-8zm-56 8l0 40L64 96C28.7 96 0 124.7 0 160l0 96 192 0 160 0 8.2 0c32.3-39.1 81.1-64 135.8-64c5.4 0 10.7 .2 16 .7l0-32.7c0-35.3-28.7-64-64-64l-64 0 0-40c0-30.9-25.1-56-56-56L184 0c-30.9 0-56 25.1-56 56zM320 352l-96 0c-17.7 0-32-14.3-32-32l0-32L0 288 0 416c0 35.3 28.7 64 64 64l296.2 0C335.1 449.6 320 410.5 320 368c0-5.4 .2-10.7 .7-16l-.7 0zm320 16a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 288c8.8 0 16 7.2 16 16l0 48 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16z"]
};
const faBriefcaseClock = faBusinessTime;
const faTableCellsLarge = {
  prefix: 'fas',
  iconName: 'table-cells-large',
  icon: [512, 512, ["th-large"], "f009", "M448 96l0 128-160 0 0-128 160 0zm0 192l0 128-160 0 0-128 160 0zM224 224L64 224 64 96l160 0 0 128zM64 288l160 0 0 128L64 416l0-128zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"]
};
const faThLarge = faTableCellsLarge;
const faBookTanakh = {
  prefix: 'fas',
  iconName: 'book-tanakh',
  icon: [448, 512, ["tanakh"], "f827", "M352 0c53 0 96 43 96 96l0 320c0 53-43 96-96 96L64 512l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0L64 0 352 0zm0 384L96 384l0 64 256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32zM138.7 208l13.9 24-27.7 0 13.9-24zm-13.9-24L97.1 232c-6.2 10.7 1.5 24 13.9 24l55.4 0 27.7 48c6.2 10.7 21.6 10.7 27.7 0l27.7-48 55.4 0c12.3 0 20-13.3 13.9-24l-27.7-48 27.7-48c6.2-10.7-1.5-24-13.9-24l-55.4 0L221.9 64c-6.2-10.7-21.6-10.7-27.7 0l-27.7 48L111 112c-12.3 0-20 13.3-13.9 24l27.7 48zm27.7 0l27.7-48 55.4 0 27.7 48-27.7 48-55.4 0-27.7-48zm0-48l-13.9 24-13.9-24 27.7 0zm41.6-24L208 88l13.9 24-27.7 0zm69.3 24l27.7 0-13.9 24-13.9-24zm13.9 72l13.9 24-27.7 0 13.9-24zm-55.4 48L208 280l-13.9-24 27.7 0z"]
};
const faTanakh = faBookTanakh;
const faPhoneVolume = {
  prefix: 'fas',
  iconName: 'phone-volume',
  icon: [512, 512, ["volume-control-phone"], "f2a0", "M280 0C408.1 0 512 103.9 512 232c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-101.6-82.4-184-184-184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm-32-72c0-13.3 10.7-24 24-24c75.1 0 136 60.9 136 136c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-48.6-39.4-88-88-88c-13.3 0-24-10.7-24-24zM117.5 1.4c19.4-5.3 39.7 4.6 47.4 23.2l40 96c6.8 16.3 2.1 35.2-11.6 46.3L144 207.3c33.3 70.4 90.3 127.4 160.7 160.7L345 318.7c11.2-13.7 30-18.4 46.3-11.6l96 40c18.6 7.7 28.5 28 23.2 47.4l-24 88C481.8 499.9 466 512 448 512C200.6 512 0 311.4 0 64C0 46 12.1 30.2 29.5 25.4l88-24z"]
};
const faVolumeControlPhone = faPhoneVolume;
const faHatCowboySide = {
  prefix: 'fas',
  iconName: 'hat-cowboy-side',
  icon: [640, 512, [], "f8c1", "M152.7 135.9l-10.4 57.2c6.8-.7 13.6-1.1 20.5-1.1l10.7 0c39.4 0 77.8 12.1 110.1 34.7L562.4 421.8l35.1 24.6c24.4-6 42.5-28.1 42.5-54.4c0-75.8-94.7-126.6-134.6-144.7L474 83.9C468.2 53.8 441.8 32 411.1 32l-2.7 0c-5.6 0-11.1 .7-16.5 2.2L199.2 85.5c-23.9 6.4-42 26-46.5 50.4zM0 384c0 35.3 28.7 64 64 64l480 0L265.3 252.9c-26.9-18.8-58.9-28.9-91.8-28.9l-10.7 0c-60.6 0-116 34.2-143.1 88.4L13.5 325C4.6 342.7 0 362.3 0 382.2L0 384z"]
};
const faClipboardUser = {
  prefix: 'fas',
  iconName: 'clipboard-user',
  icon: [384, 512, [], "f7f3", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM128 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM80 432c0-44.2 35.8-80 80-80l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L96 448c-8.8 0-16-7.2-16-16z"]
};
const faChild = {
  prefix: 'fas',
  iconName: 'child',
  icon: [320, 512, [], "f1ae", "M96 64a64 64 0 1 1 128 0A64 64 0 1 1 96 64zm48 320l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-192.2L59.1 321c-9.4 15-29.2 19.4-44.1 10S-4.5 301.9 4.9 287l39.9-63.3C69.7 184 113.2 160 160 160s90.3 24 115.2 63.6L315.1 287c9.4 15 4.9 34.7-10 44.1s-34.7 4.9-44.1-10L240 287.8 240 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-32 0z"]
};
const faLiraSign = {
  prefix: 'fas',
  iconName: 'lira-sign',
  icon: [320, 512, [8356], "f195", "M112 160.4c0-35.5 28.8-64.4 64.4-64.4c6.9 0 13.8 1.1 20.4 3.3l81.2 27.1c16.8 5.6 34.9-3.5 40.5-20.2s-3.5-34.9-20.2-40.5L217 38.6c-13.1-4.4-26.8-6.6-40.6-6.6C105.5 32 48 89.5 48 160.4L48 192l-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 32-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l14 0c-2.2 10.5-6.1 20.6-11.7 29.9L4.6 431.5c-5.9 9.9-6.1 22.2-.4 32.2S20.5 480 32 480l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L88.5 416l.7-1.1c11.6-19.3 18.9-40.7 21.6-62.9L224 352c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0 0-32 112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0 0-31.6z"]
};
const faSatellite = {
  prefix: 'fas',
  iconName: 'satellite',
  icon: [512, 512, [128752], "f7bf", "M233 7c-9.4-9.4-24.6-9.4-33.9 0l-96 96c-9.4 9.4-9.4 24.6 0 33.9l89.4 89.4-15.5 15.5C152.3 230.4 124.9 224 96 224c-31.7 0-61.5 7.7-87.8 21.2c-9 4.7-10.3 16.7-3.1 23.8L112.7 376.7 96.3 393.1c-2.6-.7-5.4-1.1-8.3-1.1c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32c0-2.9-.4-5.6-1.1-8.3l16.4-16.4L242.9 506.9c7.2 7.2 19.2 5.9 23.8-3.1C280.3 477.5 288 447.7 288 416c0-28.9-6.4-56.3-17.8-80.9l15.5-15.5L375 409c9.4 9.4 24.6 9.4 33.9 0l96-96c9.4-9.4 9.4-24.6 0-33.9l-89.4-89.4 55-55c12.5-12.5 12.5-32.8 0-45.3l-48-48c-12.5-12.5-32.8-12.5-45.3 0l-55 55L233 7zm159 351l-72.4-72.4 62.1-62.1L454.1 296 392 358.1zM226.3 192.4L153.9 120 216 57.9l72.4 72.4-62.1 62.1z"]
};
const faPlaneLock = {
  prefix: 'fas',
  iconName: 'plane-lock',
  icon: [640, 512, [], "e558", "M192 93.7C192 59.5 221 0 256 0c36 0 64 59.5 64 93.7l0 84.6 101.8 58.2C418 247.6 416 259.6 416 272l0 24.6c-17.9 10.4-30.3 29.1-31.8 50.9L320 329.1l0 70.9 57.6 43.2c4 3 6.4 7.8 6.4 12.8l0 24 0 18c0 7.8-6.3 14-14 14c-1.3 0-2.6-.2-3.9-.5L256 480 145.9 511.5c-1.3 .4-2.6 .5-3.9 .5c-7.8 0-14-6.3-14-14l0-42c0-5 2.4-9.8 6.4-12.8L192 400l0-70.9-171.6 49C10.2 381.1 0 373.4 0 362.8l0-65.5c0-5.7 3.1-11 8.1-13.9L192 178.3l0-84.6zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faTag = {
  prefix: 'fas',
  iconName: 'tag',
  icon: [448, 512, [127991], "f02b", "M0 80L0 229.5c0 17 6.7 33.3 18.7 45.3l176 176c25 25 65.5 25 90.5 0L418.7 317.3c25-25 25-65.5 0-90.5l-176-176c-12-12-28.3-18.7-45.3-18.7L48 32C21.5 32 0 53.5 0 80zm112 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faComment = {
  prefix: 'fas',
  iconName: 'comment',
  icon: [512, 512, [128489, 61669], "f075", "M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"]
};
const faCakeCandles = {
  prefix: 'fas',
  iconName: 'cake-candles',
  icon: [448, 512, [127874, "birthday-cake", "cake"], "f1fd", "M86.4 5.5L61.8 47.6C58 54.1 56 61.6 56 69.2L56 72c0 22.1 17.9 40 40 40s40-17.9 40-40l0-2.8c0-7.6-2-15-5.8-21.6L105.6 5.5C103.6 2.1 100 0 96 0s-7.6 2.1-9.6 5.5zm128 0L189.8 47.6c-3.8 6.5-5.8 14-5.8 21.6l0 2.8c0 22.1 17.9 40 40 40s40-17.9 40-40l0-2.8c0-7.6-2-15-5.8-21.6L233.6 5.5C231.6 2.1 228 0 224 0s-7.6 2.1-9.6 5.5zM317.8 47.6c-3.8 6.5-5.8 14-5.8 21.6l0 2.8c0 22.1 17.9 40 40 40s40-17.9 40-40l0-2.8c0-7.6-2-15-5.8-21.6L361.6 5.5C359.6 2.1 356 0 352 0s-7.6 2.1-9.6 5.5L317.8 47.6zM128 176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c-35.3 0-64 28.7-64 64l0 71c8.3 5.2 18.1 9 28.8 9c13.5 0 27.2-6.1 38.4-13.4c5.4-3.5 9.9-7.1 13-9.7c1.5-1.3 2.7-2.4 3.5-3.1c.4-.4 .7-.6 .8-.8l.1-.1s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c3.1-3.2 7.4-4.9 11.9-4.8s8.6 2.1 11.6 5.4c0 0 0 0 0 0s0 0 0 0l.1 .1c.1 .1 .4 .4 .7 .7c.7 .7 1.7 1.7 3.1 3c2.8 2.6 6.8 6.1 11.8 9.5c10.2 7.1 23 13.1 36.3 13.1s26.1-6 36.3-13.1c5-3.5 9-6.9 11.8-9.5c1.4-1.3 2.4-2.3 3.1-3c.3-.3 .6-.6 .7-.7l.1-.1c3-3.5 7.4-5.4 12-5.4s9 2 12 5.4l.1 .1c.1 .1 .4 .4 .7 .7c.7 .7 1.7 1.7 3.1 3c2.8 2.6 6.8 6.1 11.8 9.5c10.2 7.1 23 13.1 36.3 13.1s26.1-6 36.3-13.1c5-3.5 9-6.9 11.8-9.5c1.4-1.3 2.4-2.3 3.1-3c.3-.3 .6-.6 .7-.7l.1-.1c2.9-3.4 7.1-5.3 11.6-5.4s8.7 1.6 11.9 4.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0l.1 .1c.2 .2 .4 .4 .8 .8c.8 .7 1.9 1.8 3.5 3.1c3.1 2.6 7.5 6.2 13 9.7c11.2 7.3 24.9 13.4 38.4 13.4c10.7 0 20.5-3.9 28.8-9l0-71c0-35.3-28.7-64-64-64l0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48-64 0 0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48-64 0 0-48zM448 394.6c-8.5 3.3-18.2 5.4-28.8 5.4c-22.5 0-42.4-9.9-55.8-18.6c-4.1-2.7-7.8-5.4-10.9-7.8c-2.8 2.4-6.1 5-9.8 7.5C329.8 390 310.6 400 288 400s-41.8-10-54.6-18.9c-3.5-2.4-6.7-4.9-9.4-7.2c-2.7 2.3-5.9 4.7-9.4 7.2C201.8 390 182.6 400 160 400s-41.8-10-54.6-18.9c-3.7-2.6-7-5.2-9.8-7.5c-3.1 2.4-6.8 5.1-10.9 7.8C71.2 390.1 51.3 400 28.8 400c-10.6 0-20.3-2.2-28.8-5.4L0 480c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32l0-85.4z"]
};
const faBirthdayCake = faCakeCandles;
const faCake = faCakeCandles;
const faEnvelope = {
  prefix: 'fas',
  iconName: 'envelope',
  icon: [512, 512, [128386, 9993, 61443], "f0e0", "M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"]
};
const faAnglesUp = {
  prefix: 'fas',
  iconName: 'angles-up',
  icon: [448, 512, ["angle-double-up"], "f102", "M246.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 109.3 361.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160zm160 352l-160-160c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 301.3 361.4 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z"]
};
const faAngleDoubleUp = faAnglesUp;
const faPaperclip = {
  prefix: 'fas',
  iconName: 'paperclip',
  icon: [448, 512, [128206], "f0c6", "M364.2 83.8c-24.4-24.4-64-24.4-88.4 0l-184 184c-42.1 42.1-42.1 110.3 0 152.4s110.3 42.1 152.4 0l152-152c10.9-10.9 28.7-10.9 39.6 0s10.9 28.7 0 39.6l-152 152c-64 64-167.6 64-231.6 0s-64-167.6 0-231.6l184-184c46.3-46.3 121.3-46.3 167.6 0s46.3 121.3 0 167.6l-176 176c-28.6 28.6-75 28.6-103.6 0s-28.6-75 0-103.6l144-144c10.9-10.9 28.7-10.9 39.6 0s10.9 28.7 0 39.6l-144 144c-6.7 6.7-6.7 17.7 0 24.4s17.7 6.7 24.4 0l176-176c24.4-24.4 24.4-64 0-88.4z"]
};
const faArrowRightToCity = {
  prefix: 'fas',
  iconName: 'arrow-right-to-city',
  icon: [640, 512, [], "e4b3", "M288 48c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 144 40 0 0-72c0-13.3 10.7-24 24-24s24 10.7 24 24l0 72 24 0c26.5 0 48 21.5 48 48l0 224c0 26.5-21.5 48-48 48l-160 0-96 0c-26.5 0-48-21.5-48-48l0-416zm64 32l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM352 272l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm176-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM512 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM166.6 153.4l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L146.7 288 32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l114.7 0-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0z"]
};
const faRibbon = {
  prefix: 'fas',
  iconName: 'ribbon',
  icon: [448, 512, [127895], "f4d6", "M333.2 322.8s0 0 0 0l-133.9-146s0 0 0 0L146 118.6c7.8-5.1 37-22.6 78-22.6s70.2 17.4 78 22.6L245.7 180l85.6 93.4 27.4-29.8c16.3-17.7 25.3-40.9 25.3-65l0-29.5c0-19-5.6-37.5-16.1-53.3L327.8 35.6C312.9 13.4 287.9 0 261.2 0l-76 0c-25.8 0-50.1 12.5-65.1 33.5L81.9 87C70.3 103.2 64 122.8 64 142.8L64 164c0 23.2 8.4 45.6 23.6 63.1l56 64.2s0 0 0 0l83.3 95.6s0 0 0 0l91.8 105.3c10 11.5 26.8 14.3 40 6.8l54.5-31.1c17.8-10.2 21.6-34.3 7.7-49.4l-87.7-95.7zM205.2 410.6l-83.3-95.6L27.1 418.5c-13.9 15.1-10.1 39.2 7.7 49.4l55.1 31.5c13 7.4 29.3 4.9 39.4-6.1l75.9-82.6z"]
};
const faLungs = {
  prefix: 'fas',
  iconName: 'lungs',
  icon: [640, 512, [129729], "f604", "M320 0c17.7 0 32 14.3 32 32l0 132.1c0 16.4 8.4 31.7 22.2 40.5l9.8 6.2 0-45.5C384 127 415 96 453.3 96c21.7 0 42.8 10.2 55.8 28.8c15.4 22.1 44.3 65.4 71 116.9c26.5 50.9 52.4 112.5 59.6 170.3c.2 1.3 .2 2.6 .2 4l0 7c0 49.1-39.8 89-89 89c-7.3 0-14.5-.9-21.6-2.7l-72.7-18.2C414 480.5 384 442.1 384 398l0-73 90.5 57.6c7.5 4.7 17.3 2.5 22.1-4.9s2.5-17.3-4.9-22.1L384 287.1l0-.4-44.1-28.1c-7.3-4.6-13.9-10.1-19.9-16.1c-5.9 6-12.6 11.5-19.9 16.1L256 286.7 161.2 347l-13.5 8.6c0 0 0 0-.1 0c-7.4 4.8-9.6 14.6-4.8 22.1c4.7 7.5 14.6 9.7 22.1 4.9l91.1-58 0 73.4c0 44.1-30 82.5-72.7 93.1l-72.7 18.2c-7.1 1.8-14.3 2.7-21.6 2.7c-49.1 0-89-39.8-89-89l0-7c0-1.3 .1-2.7 .2-4c7.2-57.9 33.1-119.4 59.6-170.3c26.8-51.5 55.6-94.8 71-116.9c13-18.6 34-28.8 55.8-28.8C225 96 256 127 256 165.3l0 45.5 9.8-6.2c13.8-8.8 22.2-24.1 22.2-40.5L288 32c0-17.7 14.3-32 32-32z"]
};
const faArrowUp91 = {
  prefix: 'fas',
  iconName: 'arrow-up-9-1',
  icon: [576, 512, ["sort-numeric-up-alt"], "f887", "M160 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L192 146.3 192 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-301.7L95.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C142.5 35.8 151 32 160 32zM450.7 294c8.3 6 13.3 15.7 13.3 26l0 96 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-51.6-5.9 2c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5l48-16c9.8-3.3 20.5-1.6 28.8 4.4zm-5-145.1A32 32 0 1 0 418.3 91a32 32 0 1 0 27.4 57.9zm-40.7 54.9C369.6 192.4 344 159.2 344 120c0-48.6 39.4-88 88-88s88 39.4 88 88c0 23.5-7.5 46.3-21.5 65.2L449.7 251c-10.5 14.2-30.6 17.2-44.8 6.7s-17.2-30.6-6.7-44.8l6.8-9.2z"]
};
const faSortNumericUpAlt = faArrowUp91;
const faLitecoinSign = {
  prefix: 'fas',
  iconName: 'litecoin-sign',
  icon: [384, 512, [], "e1d3", "M128 64c0-17.7-14.3-32-32-32S64 46.3 64 64l0 149.6L23.2 225.2c-17 4.9-26.8 22.6-22 39.6s22.6 26.8 39.6 22L64 280.1 64 448c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0 0-154.1 136.8-39.1c17-4.9 26.8-22.6 22-39.6s-22.6-26.8-39.6-22L128 195.3 128 64z"]
};
const faBorderNone = {
  prefix: 'fas',
  iconName: 'border-none',
  icon: [448, 512, [], "f850", "M32 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm96-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM320 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-320a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM224 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0-448a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 96a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 288a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm192 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 320a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM416 192a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"]
};
const faCircleNodes = {
  prefix: 'fas',
  iconName: 'circle-nodes',
  icon: [512, 512, [], "e4e2", "M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"]
};
const faParachuteBox = {
  prefix: 'fas',
  iconName: 'parachute-box',
  icon: [512, 512, [], "f4cd", "M383.5 192c.3-5.3 .5-10.6 .5-16c0-51-15.9-96-40.2-127.6C319.5 16.9 288.2 0 256 0s-63.5 16.9-87.8 48.4C143.9 80 128 125 128 176c0 5.4 .2 10.7 .5 16L240 192l0 128-32 0c-7 0-13.7 1.5-19.7 4.2L68.2 192l28.3 0c-.3-5.3-.5-10.6-.5-16c0-64 22.2-121.2 57.1-159.3C62 49.3 18.6 122.6 4.2 173.6C1.5 183.1 9 192 18.9 192l6 0L165.2 346.3c-3.3 6.5-5.2 13.9-5.2 21.7l0 96c0 26.5 21.5 48 48 48l96 0c26.5 0 48-21.5 48-48l0-96c0-7.8-1.9-15.2-5.2-21.7L487.1 192l6 0c9.9 0 17.4-8.9 14.7-18.4C493.4 122.6 450 49.3 358.9 16.7C393.8 54.8 416 112.1 416 176c0 5.4-.2 10.7-.5 16l28.3 0L323.7 324.2c-6-2.7-12.7-4.2-19.7-4.2l-32 0 0-128 111.5 0z"]
};
const faIndent = {
  prefix: 'fas',
  iconName: 'indent',
  icon: [448, 512, [], "f03c", "M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3L0 176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"]
};
const faTruckFieldUn = {
  prefix: 'fas',
  iconName: 'truck-field-un',
  icon: [640, 512, [], "e58e", "M96 32C60.7 32 32 60.7 32 96l0 32c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l0 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c0 53 43 96 96 96s96-43 96-96l128 0c0 53 43 96 96 96s96-43 96-96l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-32c0-35.3-28.7-64-64-64l-4.2 0c-.4-1.1-.9-2.1-1.3-3.2L485.7 102c-10.3-23.1-33.2-38-58.5-38l-51.8 0C364.4 44.9 343.7 32 320 32L96 32zm288 96l43.2 0 42.7 96L384 224l0-96zM112 384a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm368-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM253.3 135.1l34.7 52 0-43.2c0-8.8 7.2-16 16-16s16 7.2 16 16l0 96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52 0 43.2c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM128 144l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faHourglass = {
  prefix: 'fas',
  iconName: 'hourglass',
  icon: [384, 512, [9203, 62032, "hourglass-empty"], "f254", "M0 32C0 14.3 14.3 0 32 0L64 0 320 0l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 11c0 42.4-16.9 83.1-46.9 113.1L237.3 256l67.9 67.9c30 30 46.9 70.7 46.9 113.1l0 11c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L64 512l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-11c0-42.4 16.9-83.1 46.9-113.1L146.7 256 78.9 188.1C48.9 158.1 32 117.4 32 75l0-11C14.3 64 0 49.7 0 32zM96 64l0 11c0 25.5 10.1 49.9 28.1 67.9L192 210.7l67.9-67.9c18-18 28.1-42.4 28.1-67.9l0-11L96 64zm0 384l192 0 0-11c0-25.5-10.1-49.9-28.1-67.9L192 301.3l-67.9 67.9c-18 18-28.1 42.4-28.1 67.9l0 11z"]
};
const faHourglassEmpty = faHourglass;
const faMountain = {
  prefix: 'fas',
  iconName: 'mountain',
  icon: [512, 512, [127956], "f6fc", "M256 32c12.5 0 24.1 6.4 30.8 17L503.4 394.4c5.6 8.9 8.6 19.2 8.6 29.7c0 30.9-25 55.9-55.9 55.9L55.9 480C25 480 0 455 0 424.1c0-10.5 3-20.8 8.6-29.7L225.2 49c6.6-10.6 18.3-17 30.8-17zm65 192L256 120.4 176.9 246.5l18.3 24.4c6.4 8.5 19.2 8.5 25.6 0l25.6-34.1c6-8.1 15.5-12.8 25.6-12.8l49 0z"]
};
const faUserDoctor = {
  prefix: 'fas',
  iconName: 'user-doctor',
  icon: [448, 512, ["user-md"], "f0f0", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-96 55.2C54 332.9 0 401.3 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7c0-81-54-149.4-128-171.1l0 50.8c27.6 7.1 48 32.2 48 62l0 40c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l0-24c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 24c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-40c0-29.8 20.4-54.9 48-62l0-57.1c-6-.6-12.1-.9-18.3-.9l-91.4 0c-6.2 0-12.3 .3-18.3 .9l0 65.4c23.1 6.9 40 28.3 40 53.7c0 30.9-25.1 56-56 56s-56-25.1-56-56c0-25.4 16.9-46.8 40-53.7l0-59.1zM144 448a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faUserMd = faUserDoctor;
const faCircleInfo = {
  prefix: 'fas',
  iconName: 'circle-info',
  icon: [512, 512, ["info-circle"], "f05a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faInfoCircle = faCircleInfo;
const faCloudMeatball = {
  prefix: 'fas',
  iconName: 'cloud-meatball',
  icon: [512, 512, [], "f73b", "M0 224c0 53 43 96 96 96l44.7 0c9.5-23.5 32.5-40 59.3-40c2 0 3.9 .1 5.8 .3C217.6 265.5 235.7 256 256 256s38.4 9.5 50.2 24.3c1.9-.2 3.9-.3 5.8-.3c26.9 0 49.9 16.5 59.3 40l44.7 0c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0c1.1-5.2 1.6-10.5 1.6-16c0-44.2-35.8-80-80-80c-24.3 0-46.1 10.9-60.8 28C256.5 24.3 219.1 0 176 0C114.1 0 64 50.1 64 112c0 7.1 .7 14.1 1.9 20.8C27.6 145.4 0 181.5 0 224zm288 96c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 1 .1 2.1 .1 3.1c-.7-.8-1.4-1.6-2.1-2.3c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3c.7 .7 1.5 1.4 2.3 2.1c-1-.1-2.1-.1-3.1-.1c-17.7 0-32 14.3-32 32s14.3 32 32 32c1 0 2.1-.1 3.1-.1c-.8 .7-1.6 1.3-2.3 2.1c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0c.7-.7 1.4-1.5 2.1-2.3c-.1 1-.1 2.1-.1 3.1c0 17.7 14.3 32 32 32s32-14.3 32-32c0-1-.1-2.1-.1-3.1c.7 .8 1.3 1.6 2.1 2.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3c-.7-.7-1.5-1.4-2.3-2.1c1 .1 2.1 .1 3.1 .1c17.7 0 32-14.3 32-32s-14.3-32-32-32c-1 0-2.1 .1-3.1 .1c.8-.7 1.6-1.3 2.3-2.1c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-.7 .7-1.4 1.5-2.1 2.3c.1-1 .1-2.1 .1-3.1zM48 448a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm416 0a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faCamera = {
  prefix: 'fas',
  iconName: 'camera',
  icon: [512, 512, [62258, "camera-alt"], "f030", "M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L362.9 64.8C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faCameraAlt = faCamera;
const faSquareVirus = {
  prefix: 'fas',
  iconName: 'square-virus',
  icon: [448, 512, [], "e578", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM223.8 93.7c13.3 0 24 10.7 24 24c0 29.3 35.4 43.9 56.1 23.2c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-20.7 20.7-6 56.1 23.2 56.1c13.3 0 24 10.7 24 24s-10.7 24-24 24c-29.3 0-43.9 35.4-23.2 56.1c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-20.7-20.7-56.1-6-56.1 23.2c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-29.3-35.4-43.9-56.1-23.2c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9c20.7-20.7 6-56.1-23.2-56.1c-13.3 0-24-10.7-24-24s10.7-24 24-24c29.3 0 43.9-35.4 23.2-56.1c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0c20.7 20.7 56.1 6 56.1-23.2c0-13.3 10.7-24 24-24zM192 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm88 32a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faMeteor = {
  prefix: 'fas',
  iconName: 'meteor',
  icon: [512, 512, [9732], "f753", "M493.7 .9L299.4 75.6l2.3-29.3c1-12.8-12.8-21.5-24-15.1L101.3 133.4C38.6 169.7 0 236.6 0 309C0 421.1 90.9 512 203 512c72.4 0 139.4-38.6 175.7-101.3L480.8 234.3c6.5-11.1-2.2-25-15.1-24l-29.3 2.3L511.1 18.3c.6-1.5 .9-3.2 .9-4.8C512 6 506 0 498.5 0c-1.7 0-3.3 .3-4.8 .9zM192 192a128 128 0 1 1 0 256 128 128 0 1 1 0-256zm0 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm16 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faCarOn = {
  prefix: 'fas',
  iconName: 'car-on',
  icon: [512, 512, [], "e4dd", "M280 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-80zM185.8 224l140.3 0c6.8 0 12.8 4.3 15.1 10.6L360.3 288l-208.6 0 19.1-53.4c2.3-6.4 8.3-10.6 15.1-10.6zm-75.3-10.9L82.2 292.4C62.1 300.9 48 320.8 48 344l0 40 0 64 0 32c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-32 256 0 0 32c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-32 0-64 0-40c0-23.2-14.1-43.1-34.2-51.6l-28.3-79.3C390.1 181.3 360 160 326.2 160l-140.3 0c-33.8 0-64 21.3-75.3 53.1zM128 344a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm232 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM39 39c-9.4 9.4-9.4 24.6 0 33.9l48 48c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L73 39c-9.4-9.4-24.6-9.4-33.9 0zm400 0L391 87c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0z"]
};
const faSleigh = {
  prefix: 'fas',
  iconName: 'sleigh',
  icon: [640, 512, [], "f7cc", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l0 160c0 53 43 96 96 96l0 32 64 0 0-32 192 0 0 32 64 0 0-32c53 0 96-43 96-96l0-96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0-32 0c-17.7 0-32 14.3-32 32l0 41.3c0 30.2-24.5 54.7-54.7 54.7c-75.5 0-145.6-38.9-185.6-102.9l-4.3-6.9C174.2 67.6 125 37.6 70.7 32.7c-2.2-.5-4.4-.7-6.7-.7l-9 0L32 32zM640 384c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 8c0 13.3-10.7 24-24 24L64 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l488 0c48.6 0 88-39.4 88-88l0-8z"]
};
const faArrowDown19 = {
  prefix: 'fas',
  iconName: 'arrow-down-1-9',
  icon: [576, 512, ["sort-numeric-asc", "sort-numeric-down"], "f162", "M450.7 38c-8.3-6-19.1-7.7-28.8-4.4l-48 16c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l5.9-2 0 51.6-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l48 0 48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-96c0-10.3-4.9-19.9-13.3-26zM160 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L192 365.7 192 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 301.7L95.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C142.5 476.2 151 480 160 480zM418.3 307a32 32 0 1 1 27.4 57.9A32 32 0 1 1 418.3 307zM405.1 419.8l-6.8 9.2c-10.5 14.2-7.5 34.2 6.7 44.8s34.2 7.5 44.8-6.7l48.8-65.8c14-18.9 21.5-41.7 21.5-65.2c0-48.6-39.4-88-88-88s-88 39.4-88 88c0 39.2 25.6 72.4 61.1 83.8z"]
};
const faSortNumericAsc = faArrowDown19;
const faSortNumericDown = faArrowDown19;
const faHandHoldingDroplet = {
  prefix: 'fas',
  iconName: 'hand-holding-droplet',
  icon: [576, 512, ["hand-holding-water"], "f4c1", "M275.5 6.6C278.3 2.5 283 0 288 0s9.7 2.5 12.5 6.6L366.8 103C378 119.3 384 138.6 384 158.3l0 1.7c0 53-43 96-96 96s-96-43-96-96l0-1.7c0-19.8 6-39 17.2-55.3L275.5 6.6zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5L192 512 32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l36.8 0 44.9-36c22.7-18.2 50.9-28 80-28l78.3 0 16 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l120.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384c0 0 0 0 0 0l-.9 0c.3 0 .6 0 .9 0z"]
};
const faHandHoldingWater = faHandHoldingDroplet;
const faWater = {
  prefix: 'fas',
  iconName: 'water',
  icon: [576, 512, [], "f773", "M269.5 69.9c11.1-7.9 25.9-7.9 37 0C329 85.4 356.5 96 384 96c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 149.7 417 160 384 160c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4C42.8 92.6 61 83.5 75.3 71.6c11.1-9.5 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 85.2 165.1 96 192 96c27.5 0 55-10.6 77.5-26.1zm37 288C329 373.4 356.5 384 384 384c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 437.7 417 448 384 448c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 373.2 165.1 384 192 384c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0zm0-144C329 229.4 356.5 240 384 240c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 293.7 417 304 384 304c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.5 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 229.2 165.1 240 192 240c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faCalendarCheck = {
  prefix: 'fas',
  iconName: 'calendar-check',
  icon: [448, 512, [], "f274", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM329 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-95 95-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L329 305z"]
};
const faBraille = {
  prefix: 'fas',
  iconName: 'braille',
  icon: [640, 512, [], "f2a1", "M0 96a64 64 0 1 1 128 0A64 64 0 1 1 0 96zM224 272a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm0-80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM80 416a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zM0 416a64 64 0 1 1 128 0A64 64 0 1 1 0 416zm240 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM64 192a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM224 32a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM352 96a64 64 0 1 1 128 0A64 64 0 1 1 352 96zm240 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0A64 64 0 1 1 512 96zm64 176a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm0-80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm16 224a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM416 272a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm0-80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm16 224a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"]
};
const faPrescriptionBottleMedical = {
  prefix: 'fas',
  iconName: 'prescription-bottle-medical',
  icon: [384, 512, ["prescription-bottle-alt"], "f486", "M0 32C0 14.3 14.3 0 32 0L352 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64L0 32zm32 96l320 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-320zM160 240l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faPrescriptionBottleAlt = faPrescriptionBottleMedical;
const faLandmark = {
  prefix: 'fas',
  iconName: 'landmark',
  icon: [512, 512, [127963], "f66f", "M240.1 4.2c9.8-5.6 21.9-5.6 31.8 0l171.8 98.1L448 104l0 .9 47.9 27.4c12.6 7.2 18.8 22 15.1 36s-16.4 23.8-30.9 23.8L32 192c-14.5 0-27.2-9.8-30.9-23.8s2.5-28.8 15.1-36L64 104.9l0-.9 4.4-1.6L240.1 4.2zM64 224l64 0 0 192 40 0 0-192 64 0 0 192 48 0 0-192 64 0 0 192 40 0 0-192 64 0 0 196.3c.6 .3 1.2 .7 1.8 1.1l48 32c11.7 7.8 17 22.4 12.9 35.9S494.1 512 480 512L32 512c-14.1 0-26.5-9.2-30.6-22.7s1.1-28.1 12.9-35.9l48-32c.6-.4 1.2-.7 1.8-1.1L64 224z"]
};
const faTruck = {
  prefix: 'fas',
  iconName: 'truck',
  icon: [640, 512, [128666, 9951], "f0d1", "M48 0C21.5 0 0 21.5 0 48L0 368c0 26.5 21.5 48 48 48l16 0c0 53 43 96 96 96s96-43 96-96l128 0c0 53 43 96 96 96s96-43 96-96l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64 0-32 0-18.7c0-17-6.7-33.3-18.7-45.3L512 114.7c-12-12-28.3-18.7-45.3-18.7L416 96l0-48c0-26.5-21.5-48-48-48L48 0zM416 160l50.7 0L544 237.3l0 18.7-128 0 0-96zM112 416a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm368-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faCrosshairs = {
  prefix: 'fas',
  iconName: 'crosshairs',
  icon: [512, 512, [], "f05b", "M256 0c17.7 0 32 14.3 32 32l0 10.4c93.7 13.9 167.7 88 181.6 181.6l10.4 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-10.4 0c-13.9 93.7-88 167.7-181.6 181.6l0 10.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-10.4C130.3 455.7 56.3 381.7 42.4 288L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l10.4 0C56.3 130.3 130.3 56.3 224 42.4L224 32c0-17.7 14.3-32 32-32zM107.4 288c12.5 58.3 58.4 104.1 116.6 116.6l0-20.6c0-17.7 14.3-32 32-32s32 14.3 32 32l0 20.6c58.3-12.5 104.1-58.4 116.6-116.6L384 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l20.6 0C392.1 165.7 346.3 119.9 288 107.4l0 20.6c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-20.6C165.7 119.9 119.9 165.7 107.4 224l20.6 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-20.6 0zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faPersonCane = {
  prefix: 'fas',
  iconName: 'person-cane',
  icon: [448, 512, [], "e53c", "M272 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm-8 187.3l47.4 57.1c11.3 13.6 31.5 15.5 45.1 4.2s15.5-31.5 4.2-45.1l-73.7-88.9c-18.2-22-45.3-34.7-73.9-34.7l-35.9 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9 120 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-244.7zM352 376c0-4.4 3.6-8 8-8s8 3.6 8 8l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-30.9-25.1-56-56-56s-56 25.1-56 56l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8z"]
};
const faTent = {
  prefix: 'fas',
  iconName: 'tent',
  icon: [576, 512, [], "e57d", "M269.4 6C280.5-2 295.5-2 306.6 6l224 160c7.4 5.3 12.2 13.5 13.2 22.5l32 288c1 9-1.9 18.1-8 24.9s-14.7 10.7-23.8 10.7l-80 0-28.2 0c-12.1 0-23.2-6.8-28.6-17.7L306.7 293.5c-1.7-3.4-5.1-5.5-8.8-5.5c-5.5 0-9.9 4.4-9.9 9.9L288 480c0 17.7-14.3 32-32 32l-16 0L32 512c-9.1 0-17.8-3.9-23.8-10.7s-9-15.8-8-24.9l32-288c1-9 5.8-17.2 13.2-22.5L269.4 6z"]
};
const faVestPatches = {
  prefix: 'fas',
  iconName: 'vest-patches',
  icon: [448, 512, [], "e086", "M151.2 69.7l55.9 167.7-11 33.1c-2.7 8.2-4.1 16.7-4.1 25.3L192 464c0 14.5 3.9 28.2 10.7 39.9C195 509 185.9 512 176 512L48 512c-26.5 0-48-21.5-48-48L0 270.5c0-9.5 2.8-18.7 8.1-26.6l47.9-71.8c5.3-7.9 8.1-17.1 8.1-26.6L64 128l0-73.7L64 48C64 21.5 85.5 0 112 0l4.5 0c.2 0 .4 0 .6 0c.4 0 .8 0 1.2 0c18.8 0 34.1 9.7 44.1 18.8C171.6 27.2 190.8 40 224 40s52.4-12.8 61.7-21.2C295.7 9.7 311 0 329.7 0c.4 0 .8 0 1.2 0c.2 0 .4 0 .6 0L336 0c26.5 0 48 21.5 48 48l0 6.3 0 73.7 0 17.5c0 9.5 2.8 18.7 8.1 26.6l47.9 71.8c5.3 7.9 8.1 17.1 8.1 26.6L448 464c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-168.2c0-5.2 .8-10.3 2.5-15.2L296.8 69.7C279.4 79.7 255.4 88 224 88s-55.4-8.3-72.8-18.3zM96 456a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM63.5 255.5c-4.7 4.7-4.7 12.3 0 17L79 288 63.5 303.5c-4.7 4.7-4.7 12.3 0 17s12.3 4.7 17 0L96 305l15.5 15.5c4.7 4.7 12.3 4.7 17 0s4.7-12.3 0-17L113 288l15.5-15.5c4.7-4.7 4.7-12.3 0-17s-12.3-4.7-17 0L96 271 80.5 255.5c-4.7-4.7-12.3-4.7-17 0zM304 280l0 8 0 32c0 8.8 7.2 16 16 16l32 0 8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-8c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
};
const faCheckDouble = {
  prefix: 'fas',
  iconName: 'check-double',
  icon: [448, 512, [], "f560", "M342.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 178.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l80 80c12.5 12.5 32.8 12.5 45.3 0l160-160zm96 128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 402.7 54.6 297.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l256-256z"]
};
const faArrowDownAZ = {
  prefix: 'fas',
  iconName: 'arrow-down-a-z',
  icon: [576, 512, ["sort-alpha-asc", "sort-alpha-down"], "f15d", "M183.6 469.6C177.5 476.2 169 480 160 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L128 365.7 128 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 320c0-17.7 14.3-32 32-32l128 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L429.3 416l50.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L402.7 352 352 352c-17.7 0-32-14.3-32-32zM416 32c12.1 0 23.2 6.8 28.6 17.7l64 128 16 32c7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3L460.2 224l-88.4 0-7.2 14.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l16-32 64-128C392.8 38.8 403.9 32 416 32zM395.8 176l40.4 0L416 135.6 395.8 176z"]
};
const faSortAlphaAsc = faArrowDownAZ;
const faSortAlphaDown = faArrowDownAZ;
const faMoneyBillWheat = {
  prefix: 'fas',
  iconName: 'money-bill-wheat',
  icon: [512, 512, [], "e52a", "M176 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80c0-8.8 7.2-16 16-16zM56 16l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L56 64C42.7 64 32 53.3 32 40s10.7-24 24-24zM24 88l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 136c-13.3 0-24-10.7-24-24S10.7 88 24 88zm8 96c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zM272 16c0-8.8 7.2-16 16-16c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80zM400 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80c0-8.8 7.2-16 16-16zm80 144c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM352 128c8.8 0 16 7.2 16 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-96 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM0 304c0-26.5 21.5-48 48-48l416 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 304zM48 416l0 48 48 0c0-26.5-21.5-48-48-48zM96 304l-48 0 0 48c26.5 0 48-21.5 48-48zM464 416c-26.5 0-48 21.5-48 48l48 0 0-48zM416 304c0 26.5 21.5 48 48 48l0-48-48 0zm-96 80a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faCookie = {
  prefix: 'fas',
  iconName: 'cookie',
  icon: [512, 512, [127850], "f563", "M247.2 17c-22.1-3.1-44.6 .9-64.4 11.4l-74 39.5C89.1 78.4 73.2 94.9 63.4 115L26.7 190.6c-9.8 20.1-13 42.9-9.1 64.9l14.5 82.8c3.9 22.1 14.6 42.3 30.7 57.9l60.3 58.4c16.1 15.6 36.6 25.6 58.7 28.7l83 11.7c22.1 3.1 44.6-.9 64.4-11.4l74-39.5c19.7-10.5 35.6-27 45.4-47.2l36.7-75.5c9.8-20.1 13-42.9 9.1-64.9l-14.6-82.8c-3.9-22.1-14.6-42.3-30.7-57.9L388.9 57.5c-16.1-15.6-36.6-25.6-58.7-28.7L247.2 17zM208 144a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM144 336a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm224-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faArrowRotateLeft = {
  prefix: 'fas',
  iconName: 'arrow-rotate-left',
  icon: [512, 512, [8634, "arrow-left-rotate", "arrow-rotate-back", "arrow-rotate-backward", "undo"], "f0e2", "M125.7 160l50.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L48 224c-17.7 0-32-14.3-32-32L16 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"]
};
const faArrowLeftRotate = faArrowRotateLeft;
const faArrowRotateBack = faArrowRotateLeft;
const faArrowRotateBackward = faArrowRotateLeft;
const faUndo = faArrowRotateLeft;
const faHardDrive = {
  prefix: 'fas',
  iconName: 'hard-drive',
  icon: [512, 512, [128436, "hdd"], "f0a0", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 184.4c-17-15.2-39.4-24.4-64-24.4L64 256c-24.6 0-47 9.2-64 24.4L0 96zM64 288l384 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64zM320 416a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm128-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faHdd = faHardDrive;
const faFaceGrinSquintTears = {
  prefix: 'fas',
  iconName: 'face-grin-squint-tears',
  icon: [512, 512, [129315, "grin-squint-tears"], "f586", "M426.8 14.2C446-5 477.5-4.6 497.1 14.9s20 51 .7 70.3c-6.8 6.8-21.4 12.4-37.4 16.7c-16.3 4.4-34.1 7.5-46.3 9.3c-1.6 .2-3.1 .5-4.6 .6c-4.9 .8-9.1-2.8-9.5-7.4c-.1-.7 0-1.4 .1-2.1c1.6-11.2 4.6-29.6 9-47c.3-1.3 .7-2.6 1-3.9c4.3-15.9 9.8-30.5 16.7-37.4zm-44.7 19c-1.5 4.8-2.9 9.6-4.1 14.3c-4.8 18.9-8 38.5-9.7 50.3c-4 26.8 18.9 49.7 45.7 45.8c11.9-1.6 31.5-4.8 50.4-9.7c4.7-1.2 9.5-2.5 14.3-4.1C534.2 227.5 520.2 353.8 437 437c-83.2 83.2-209.5 97.2-307.2 41.8c1.5-4.8 2.8-9.6 4-14.3c4.8-18.9 8-38.5 9.7-50.3c4-26.8-18.9-49.7-45.7-45.8c-11.9 1.6-31.5 4.8-50.4 9.7c-4.7 1.2-9.5 2.5-14.3 4.1C-22.2 284.5-8.2 158.2 75 75C158.2-8.3 284.5-22.2 382.2 33.2zM51.5 410.1c18.5-5 38.8-8.3 50.9-10c.4-.1 .7-.1 1-.1c5.1-.2 9.2 4.3 8.4 9.6c-1.7 12.1-5 32.4-10 50.9C97.6 476.4 92 491 85.2 497.8C66 517 34.5 516.6 14.9 497.1s-20-51-.7-70.3c6.8-6.8 21.4-12.4 37.4-16.7zM416.9 209c-4.7-11.9-20.8-11-26.8 .3c-19 35.5-45 70.8-77.5 103.3S244.8 371.1 209.3 390c-11.3 6-12.2 22.1-.3 26.8c57.6 22.9 125.8 11 172.3-35.5s58.4-114.8 35.5-172.3zM87.1 285.1c2 2 4.6 3.2 7.3 3.4l56.1 5.1 5.1 56.1c.3 2.8 1.5 5.4 3.4 7.3c6.3 6.3 17.2 3.6 19.8-4.9l29.7-97.4c3.5-11.6-7.3-22.5-19-19L92 265.3c-8.6 2.6-11.3 13.4-4.9 19.8zM265.3 92l-29.7 97.4c-3.5 11.6 7.3 22.5 19 19l97.4-29.7c8.6-2.6 11.3-13.4 4.9-19.8c-2-2-4.6-3.2-7.3-3.4l-56.1-5.1-5.1-56.1c-.3-2.8-1.5-5.4-3.4-7.3c-6.3-6.3-17.2-3.6-19.8 4.9z"]
};
const faGrinSquintTears = faFaceGrinSquintTears;
const faDumbbell = {
  prefix: 'fas',
  iconName: 'dumbbell',
  icon: [640, 512, [], "f44b", "M96 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 160 0 64 0 160c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64-32 0c-17.7 0-32-14.3-32-32l0-64c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c0-17.7 14.3-32 32-32l32 0 0-64zm448 0l0 64 32 0c17.7 0 32 14.3 32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 64c0 17.7-14.3 32-32 32l-32 0 0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-160 0-64 0-160c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32zM416 224l0 64-192 0 0-64 192 0z"]
};
const faRectangleList = {
  prefix: 'fas',
  iconName: 'rectangle-list',
  icon: [576, 512, ["list-alt"], "f022", "M0 96C0 60.7 28.7 32 64 32l448 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM128 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32-128a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm96-248c-13.3 0-24 10.7-24 24s10.7 24 24 24l224 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-224 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l224 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-224 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l224 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-224 0z"]
};
const faListAlt = faRectangleList;
const faTarpDroplet = {
  prefix: 'fas',
  iconName: 'tarp-droplet',
  icon: [576, 512, [], "e57c", "M288 160c-35.3 0-64-26.9-64-60c0-24 33.7-70.1 52.2-93.5c6.1-7.7 17.5-7.7 23.6 0C318.3 29.9 352 76 352 100c0 33.1-28.7 60-64 60zM64 128l133.5 0c13.2 37.3 48.7 64 90.5 64s77.4-26.7 90.5-64L512 128c35.3 0 64 28.7 64 64l0 160-128 0c-17.7 0-32 14.3-32 32l0 128L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zM448 512l0-128 128 0L448 512zM96 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faHouseMedicalCircleCheck = {
  prefix: 'fas',
  iconName: 'house-medical-circle-check',
  icon: [640, 512, [], "e511", "M320 368c0 59.5 29.5 112.1 74.8 144l-266.7 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L522.1 193.9c-8.5-1.3-17.3-1.9-26.1-1.9c-54.7 0-103.5 24.9-135.8 64L320 256l0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zm32 0a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L480 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faPersonSkiingNordic = {
  prefix: 'fas',
  iconName: 'person-skiing-nordic',
  icon: [576, 512, ["skiing-nordic"], "f7ca", "M336 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM227.2 160c1.9 0 3.8 .1 5.6 .3L201.6 254c-9.3 28 1.7 58.8 26.8 74.5l86.2 53.9L291.3 464l-88.5 0 41.1-88.1-32.4-20.3c-7.8-4.9-14.7-10.7-20.6-17.3L132.2 464l-32.4 0 54.2-257.6c4.6-1.5 9-4.1 12.7-7.8l23.1-23.1c9.9-9.9 23.4-15.5 37.5-15.5zM121.4 198.6c.4 .4 .8 .8 1.3 1.2L67 464l-43 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l135.3 0c.5 0 .9 0 1.4 0l158.6 0c.5 0 1 0 1.4 0L504 512c39.8 0 72-32.2 72-72l0-8c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 8c0 13.3-10.7 24-24 24l-69.4 0 27.6-179.3c10.5-5.2 17.8-16.1 17.8-28.7c0-17.7-14.3-32-32-32l-21.3 0c-12.9 0-24.6-7.8-29.5-19.7l-6.3-15c-14.6-35.1-44.1-61.9-80.5-73.1l-48.7-15c-11.1-3.4-22.7-5.2-34.4-5.2c-31 0-60.8 12.3-82.7 34.3l-23.1 23.1c-12.5 12.5-12.5 32.8 0 45.3zm308 89.4L402.3 464l-44.4 0 21.6-75.6c5.9-20.6-2.6-42.6-20.7-53.9L302 299l30.9-82.4 5.1 12.3C353 264.7 387.9 288 426.7 288l2.7 0z"]
};
const faSkiingNordic = faPersonSkiingNordic;
const faCalendarPlus = {
  prefix: 'fas',
  iconName: 'calendar-plus',
  icon: [448, 512, [], "f271", "M96 32l0 32L48 64C21.5 64 0 85.5 0 112l0 48 448 0 0-48c0-26.5-21.5-48-48-48l-48 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L160 64l0-32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192L0 192 0 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-272zM224 248c13.3 0 24 10.7 24 24l0 56 56 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-56 0 0 56c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-56-56 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l56 0 0-56c0-13.3 10.7-24 24-24z"]
};
const faPlaneArrival = {
  prefix: 'fas',
  iconName: 'plane-arrival',
  icon: [640, 512, [128748], "f5af", "M.3 166.9L0 68C0 57.7 9.5 50.1 19.5 52.3l35.6 7.9c10.6 2.3 19.2 9.9 23 20L96 128l127.3 37.6L181.8 20.4C178.9 10.2 186.6 0 197.2 0l40.1 0c11.6 0 22.2 6.2 27.9 16.3l109 193.8 107.2 31.7c15.9 4.7 30.8 12.5 43.7 22.8l34.4 27.6c24 19.2 18.1 57.3-10.7 68.2c-41.2 15.6-86.2 18.1-128.8 7L121.7 289.8c-11.1-2.9-21.2-8.7-29.3-16.9L9.5 189.4c-5.9-6-9.3-14.1-9.3-22.5zM32 448l576 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32zm96-80a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm128-16a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faCircleLeft = {
  prefix: 'fas',
  iconName: 'circle-left',
  icon: [512, 512, [61840, "arrow-alt-circle-left"], "f359", "M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM116.7 244.7l112-112c4.6-4.6 11.5-5.9 17.4-3.5s9.9 8.3 9.9 14.8l0 64 96 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32l-96 0 0 64c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5l-112-112c-6.2-6.2-6.2-16.4 0-22.6z"]
};
const faArrowAltCircleLeft = faCircleLeft;
const faTrainSubway = {
  prefix: 'fas',
  iconName: 'train-subway',
  icon: [448, 512, ["subway"], "f239", "M96 0C43 0 0 43 0 96L0 352c0 48 35.2 87.7 81.1 94.9l-46 46C28.1 499.9 33.1 512 43 512l39.7 0c8.5 0 16.6-3.4 22.6-9.4L160 448l128 0 54.6 54.6c6 6 14.1 9.4 22.6 9.4l39.7 0c10 0 15-12.1 7.9-19.1l-46-46c46-7.1 81.1-46.9 81.1-94.9l0-256c0-53-43-96-96-96L96 0zM64 128c0-17.7 14.3-32 32-32l80 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-80 0c-17.7 0-32-14.3-32-32l0-96zM272 96l80 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-80 0c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32zM64 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm288-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSubway = faTrainSubway;
const faChartGantt = {
  prefix: 'fas',
  iconName: 'chart-gantt',
  icon: [512, 512, [], "e0e4", "M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zm96 96c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32zm96 64l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm160 96l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faIndianRupeeSign = {
  prefix: 'fas',
  iconName: 'indian-rupee-sign',
  icon: [320, 512, ["indian-rupee", "inr"], "e1bc", "M0 64C0 46.3 14.3 32 32 32l64 0 16 0 176 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-56.2 0c9.6 14.4 16.7 30.6 20.7 48l35.6 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-35.6 0c-13.2 58.3-61.9 103.2-122.2 110.9L274.6 422c14.4 10.3 17.7 30.3 7.4 44.6s-30.3 17.7-44.6 7.4L13.4 314C2.1 306-2.7 291.5 1.5 278.2S18.1 256 32 256l80 0c32.8 0 61-19.7 73.3-48L32 208c-17.7 0-32-14.3-32-32s14.3-32 32-32l153.3 0C173 115.7 144.8 96 112 96L96 96 32 96C14.3 96 0 81.7 0 64z"]
};
const faIndianRupee = faIndianRupeeSign;
const faInr = faIndianRupeeSign;
const faCropSimple = {
  prefix: 'fas',
  iconName: 'crop-simple',
  icon: [512, 512, ["crop-alt"], "f565", "M128 32c0-17.7-14.3-32-32-32S64 14.3 64 32l0 32L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l32 0 0 256c0 35.3 28.7 64 64 64l224 0 0-64-224 0 0-352zM384 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-256c0-35.3-28.7-64-64-64L160 64l0 64 224 0 0 352z"]
};
const faCropAlt = faCropSimple;
const faMoneyBill1 = {
  prefix: 'fas',
  iconName: 'money-bill-1',
  icon: [576, 512, ["money-bill-alt"], "f3d1", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm64 320l-64 0 0-64c35.3 0 64 28.7 64 64zM64 192l0-64 64 0c0 35.3-28.7 64-64 64zM448 384c0-35.3 28.7-64 64-64l0 64-64 0zm64-192c-35.3 0-64-28.7-64-64l64 0 0 64zM176 256a112 112 0 1 1 224 0 112 112 0 1 1 -224 0zm76-48c0 9.7 6.9 17.7 16 19.6l0 48.4-4 0c-11 0-20 9-20 20s9 20 20 20l24 0 24 0c11 0 20-9 20-20s-9-20-20-20l-4 0 0-68c0-11-9-20-20-20l-16 0c-11 0-20 9-20 20z"]
};
const faMoneyBillAlt = faMoneyBill1;
const faLeftLong = {
  prefix: 'fas',
  iconName: 'left-long',
  icon: [512, 512, ["long-arrow-alt-left"], "f30a", "M177.5 414c-8.8 3.8-19 2-26-4.6l-144-136C2.7 268.9 0 262.6 0 256s2.7-12.9 7.5-17.4l144-136c7-6.6 17.2-8.4 26-4.6s14.5 12.5 14.5 22l0 72 288 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-288 0 0 72c0 9.6-5.7 18.2-14.5 22z"]
};
const faLongArrowAltLeft = faLeftLong;
const faDna = {
  prefix: 'fas',
  iconName: 'dna',
  icon: [448, 512, [129516], "f471", "M416 0c17.7 0 32 14.3 32 32c0 59.8-30.3 107.5-69.4 146.6c-28 28-62.5 53.5-97.3 77.4l-2.5 1.7c-11.9 8.1-23.8 16.1-35.5 23.9c0 0 0 0 0 0s0 0 0 0s0 0 0 0l-1.6 1c-6 4-11.9 7.9-17.8 11.9c-20.9 14-40.8 27.7-59.3 41.5l118.5 0c-9.8-7.4-20.1-14.7-30.7-22.1l7-4.7 3-2c15.1-10.1 30.9-20.6 46.7-31.6c25 18.1 48.9 37.3 69.4 57.7C417.7 372.5 448 420.2 448 480c0 17.7-14.3 32-32 32s-32-14.3-32-32L64 480c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-59.8 30.3-107.5 69.4-146.6c28-28 62.5-53.5 97.3-77.4c-34.8-23.9-69.3-49.3-97.3-77.4C30.3 139.5 0 91.8 0 32C0 14.3 14.3 0 32 0S64 14.3 64 32l320 0c0-17.7 14.3-32 32-32zM338.6 384l-229.2 0c-10.1 10.6-18.6 21.3-25.5 32l280.2 0c-6.8-10.7-15.3-21.4-25.5-32zM109.4 128l229.2 0c10.1-10.7 18.6-21.3 25.5-32L83.9 96c6.8 10.7 15.3 21.3 25.5 32zm55.4 48c18.4 13.8 38.4 27.5 59.3 41.5c20.9-14 40.8-27.7 59.3-41.5l-118.5 0z"]
};
const faVirusSlash = {
  prefix: 'fas',
  iconName: 'virus-slash',
  icon: [640, 512, [], "e075", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-154.3-121c-2-30.1 20.8-60.1 56-60.1l11.5 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-11.5 0c-49.9 0-74.9-60.3-39.6-95.6l8.2-8.2c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-8.2 8.2C412.3 118.4 352 93.4 352 43.5L352 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 11.5c0 49.9-60.3 74.9-95.6 39.6L184.2 75c-12.5-12.5-32.8-12.5-45.3 0c-1.6 1.6-3.1 3.4-4.3 5.3L38.8 5.1zm225.8 177c6.9-3.9 14.9-6.1 23.4-6.1c26.5 0 48 21.5 48 48c0 4.4-.6 8.7-1.7 12.7l-69.7-54.6zM402 412.7L144.7 210c-9.5 8.5-22.2 14-37.2 14L96 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l11.5 0c49.9 0 74.9 60.3 39.6 95.6l-8.2 8.2c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l8.2-8.2c35.3-35.3 95.6-10.3 95.6 39.6l0 11.5c0 17.7 14.3 32 32 32s32-14.3 32-32l0-11.5c0-31.2 23.6-52.7 50-55.7z"]
};
const faMinus = {
  prefix: 'fas',
  iconName: 'minus',
  icon: [448, 512, [8211, 8722, 10134, "subtract"], "f068", "M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"]
};
const faSubtract = faMinus;
const faChess = {
  prefix: 'fas',
  iconName: 'chess',
  icon: [512, 512, [], "f439", "M144 16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 16L96 32c-8.8 0-16 7.2-16 16s7.2 16 16 16l16 0 0 32L60.2 96C49.1 96 40 105.1 40 116.2c0 2.5 .5 4.9 1.3 7.3L73.8 208 72 208c-13.3 0-24 10.7-24 24s10.7 24 24 24l4 0L60 384l136 0L180 256l4 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-1.8 0 32.5-84.5c.9-2.3 1.3-4.8 1.3-7.3c0-11.2-9.1-20.2-20.2-20.2L144 96l0-32 16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16zM48 416L4.8 473.6C1.7 477.8 0 482.8 0 488c0 13.3 10.7 24 24 24l208 0c13.3 0 24-10.7 24-24c0-5.2-1.7-10.2-4.8-14.4L208 416 48 416zm288 0l-43.2 57.6c-3.1 4.2-4.8 9.2-4.8 14.4c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24c0-5.2-1.7-10.2-4.8-14.4L464 416l-128 0zM304 208l0 51.9c0 7.8 2.8 15.3 8 21.1L339.2 312 337 384l125.5 0-3.3-72 28.3-30.8c5.4-5.9 8.5-13.6 8.5-21.7l0-51.5c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16l0 16-24 0 0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16l0 16-24 0 0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16zm80 96c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32-32 0 0-32z"]
};
const faArrowLeftLong = {
  prefix: 'fas',
  iconName: 'arrow-left-long',
  icon: [512, 512, ["long-arrow-left"], "f177", "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 73.4-73.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-128 128z"]
};
const faLongArrowLeft = faArrowLeftLong;
const faPlugCircleCheck = {
  prefix: 'fas',
  iconName: 'plug-circle-check',
  icon: [576, 512, [], "e55c", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L416 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faStreetView = {
  prefix: 'fas',
  iconName: 'street-view',
  icon: [512, 512, [], "f21d", "M320 64A64 64 0 1 0 192 64a64 64 0 1 0 128 0zm-96 96c-35.3 0-64 28.7-64 64l0 48c0 17.7 14.3 32 32 32l1.8 0 11.1 99.5c1.8 16.2 15.5 28.5 31.8 28.5l38.7 0c16.3 0 30-12.3 31.8-28.5L318.2 304l1.8 0c17.7 0 32-14.3 32-32l0-48c0-35.3-28.7-64-64-64l-64 0zM132.3 394.2c13-2.4 21.7-14.9 19.3-27.9s-14.9-21.7-27.9-19.3c-32.4 5.9-60.9 14.2-82 24.8c-10.5 5.3-20.3 11.7-27.8 19.6C6.4 399.5 0 410.5 0 424c0 21.4 15.5 36.1 29.1 45c14.7 9.6 34.3 17.3 56.4 23.4C130.2 504.7 190.4 512 256 512s125.8-7.3 170.4-19.6c22.1-6.1 41.8-13.8 56.4-23.4c13.7-8.9 29.1-23.6 29.1-45c0-13.5-6.4-24.5-14-32.6c-7.5-7.9-17.3-14.3-27.8-19.6c-21-10.6-49.5-18.9-82-24.8c-13-2.4-25.5 6.3-27.9 19.3s6.3 25.5 19.3 27.9c30.2 5.5 53.7 12.8 69 20.5c3.2 1.6 5.8 3.1 7.9 4.5c3.6 2.4 3.6 7.2 0 9.6c-8.8 5.7-23.1 11.8-43 17.3C374.3 457 318.5 464 256 464s-118.3-7-157.7-17.9c-19.9-5.5-34.2-11.6-43-17.3c-3.6-2.4-3.6-7.2 0-9.6c2.1-1.4 4.8-2.9 7.9-4.5c15.3-7.7 38.8-14.9 69-20.5z"]
};
const faFrancSign = {
  prefix: 'fas',
  iconName: 'franc-sign',
  icon: [320, 512, [], "e18f", "M80 32C62.3 32 48 46.3 48 64l0 160 0 96-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 0-64 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-96 176 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]
};
const faVolumeOff = {
  prefix: 'fas',
  iconName: 'volume-off',
  icon: [320, 512, [], "f026", "M320 64c0-12.6-7.4-24-18.9-29.2s-25-3.1-34.4 5.3L131.8 160 64 160c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l67.8 0L266.7 471.9c9.4 8.4 22.9 10.4 34.4 5.3S320 460.6 320 448l0-384z"]
};
const faHandsAslInterpreting = {
  prefix: 'fas',
  iconName: 'hands-asl-interpreting',
  icon: [640, 512, ["american-sign-language-interpreting", "asl-interpreting", "hands-american-sign-language-interpreting"], "f2a3", "M156.6 46.3c7.9-15.8 1.5-35-14.3-42.9s-35-1.5-42.9 14.3L13.5 189.4C4.6 207.2 0 226.8 0 246.7L0 256c0 70.7 57.3 128 128 128l72 0 8 0 0-.3c35.2-2.7 65.4-22.8 82.1-51.7c8.8-15.3 3.6-34.9-11.7-43.7s-34.9-3.6-43.7 11.7c-7 12-19.9 20-34.7 20c-22.1 0-40-17.9-40-40s17.9-40 40-40c14.8 0 27.7 8 34.7 20c8.8 15.3 28.4 20.5 43.7 11.7s20.5-28.4 11.7-43.7c-12.8-22.1-33.6-39.1-58.4-47.1l80.8-22c17-4.6 27.1-22.2 22.5-39.3s-22.2-27.1-39.3-22.5L194.9 124.6l81.6-68c13.6-11.3 15.4-31.5 4.1-45.1S249.1-3.9 235.5 7.4L133.6 92.3l23-46zM483.4 465.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l85.9-171.7c8.9-17.8 13.5-37.4 13.5-57.2l0-9.3c0-70.7-57.3-128-128-128l-72 0-8 0 0 .3c-35.2 2.7-65.4 22.8-82.1 51.7c-8.9 15.3-3.6 34.9 11.7 43.7s34.9 3.6 43.7-11.7c7-12 19.9-20 34.7-20c22.1 0 40 17.9 40 40s-17.9 40-40 40c-14.8 0-27.7-8-34.7-20c-8.9-15.3-28.4-20.5-43.7-11.7s-20.5 28.4-11.7 43.7c12.8 22.1 33.6 39.1 58.4 47.1l-80.8 22c-17.1 4.7-27.1 22.2-22.5 39.3s22.2 27.1 39.3 22.5l100.7-27.5-81.6 68c-13.6 11.3-15.4 31.5-4.1 45.1s31.5 15.4 45.1 4.1l101.9-84.9-23 46z"]
};
const faAmericanSignLanguageInterpreting = faHandsAslInterpreting;
const faAslInterpreting = faHandsAslInterpreting;
const faHandsAmericanSignLanguageInterpreting = faHandsAslInterpreting;
const faGear = {
  prefix: 'fas',
  iconName: 'gear',
  icon: [512, 512, [9881, "cog"], "f013", "M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]
};
const faCog = faGear;
const faDropletSlash = {
  prefix: 'fas',
  iconName: 'droplet-slash',
  icon: [640, 512, ["tint-slash"], "f5c7", "M320 512c53.2 0 101.4-21.6 136.1-56.6l-298.3-235C140 257.1 128 292.3 128 320c0 106 86 192 192 192zM505.2 370.7c4.4-16.2 6.8-33.1 6.8-50.7c0-91.2-130.2-262.3-166.6-308.3C339.4 4.2 330.5 0 320.9 0l-1.8 0c-9.6 0-18.5 4.2-24.5 11.7C277.8 33 240.7 81.3 205.8 136L38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L505.2 370.7zM224 336c0 44.2 35.8 80 80 80c8.8 0 16 7.2 16 16s-7.2 16-16 16c-61.9 0-112-50.1-112-112c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faTintSlash = faDropletSlash;
const faMosque = {
  prefix: 'fas',
  iconName: 'mosque',
  icon: [640, 512, [128332], "f678", "M400 0c5 0 9.8 2.4 12.8 6.4c34.7 46.3 78.1 74.9 133.5 111.5c0 0 0 0 0 0s0 0 0 0c5.2 3.4 10.5 7 16 10.6c28.9 19.2 45.7 51.7 45.7 86.1c0 28.6-11.3 54.5-29.8 73.4l-356.4 0c-18.4-19-29.8-44.9-29.8-73.4c0-34.4 16.7-66.9 45.7-86.1c5.4-3.6 10.8-7.1 16-10.6c0 0 0 0 0 0s0 0 0 0C309.1 81.3 352.5 52.7 387.2 6.4c3-4 7.8-6.4 12.8-6.4zM288 512l0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-48 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l416 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-48 0 0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-64 0 0-58c0-19-8.4-37-23-49.2L400 384l-25 20.8C360.4 417 352 435 352 454l0 58-64 0zM70.4 5.2c5.7-4.3 13.5-4.3 19.2 0l16 12C139.8 42.9 160 83.2 160 126l0 2L0 128l0-2C0 83.2 20.2 42.9 54.4 17.2l16-12zM0 160l160 0 0 136.6c-19.1 11.1-32 31.7-32 55.4l0 128c0 9.6 2.1 18.6 5.8 26.8c-6.6 3.4-14 5.2-21.8 5.2l-64 0c-26.5 0-48-21.5-48-48L0 176l0-16z"]
};
const faMosquito = {
  prefix: 'fas',
  iconName: 'mosquito',
  icon: [640, 512, [], "e52b", "M463.7 505.9c9.8-8.9 10.7-24.3 2.1-34.3l-42.1-49 0-54.7c0-5.5-1.8-10.8-5.1-15.1L352 266.3l0-.3L485.4 387.8C542.4 447.6 640 405.2 640 320.6c0-47.9-34-88.3-79.4-94.2l-153-23.9 40.8-40.9c7.8-7.8 9.4-20.1 3.9-29.8L428.5 90.1l38.2-50.9c8-10.6 6.1-25.9-4.3-34.1s-25.2-6.3-33.2 4.4l-48 63.9c-5.9 7.9-6.6 18.6-1.7 27.2L402.2 140 352 190.3l0-38.2c0-14.9-10.2-27.4-24-31l0-57.2c0-4.4-3.6-8-8-8s-8 3.6-8 8l0 57.2c-13.8 3.6-24 16.1-24 31l0 38.1L237.8 140l22.6-39.5c4.9-8.6 4.2-19.3-1.7-27.2l-48-63.9c-8-10.6-22.8-12.6-33.2-4.4s-12.2 23.5-4.3 34.1l38.2 50.9-23.9 41.7c-5.5 9.7-3.9 22 3.9 29.8l40.8 40.9-153 23.9C34 232.3 0 272.7 0 320.6c0 84.6 97.6 127 154.6 67.1L288 266l0 .3-66.5 86.4c-3.3 4.3-5.1 9.6-5.1 15.1l0 54.7-42.1 49c-8.6 10.1-7.7 25.5 2.1 34.3s24.7 7.9 33.4-2.1l48-55.9c3.8-4.4 5.9-10.2 5.9-16.1l0-55.4L288 344.7l0 63.1c0 17.7 14.3 32 32 32s32-14.3 32-32l0-63.1 24.3 31.6 0 55.4c0 5.9 2.1 11.7 5.9 16.1l48 55.9c8.6 10.1 23.6 11 33.4 2.1z"]
};
const faStarOfDavid = {
  prefix: 'fas',
  iconName: 'star-of-david',
  icon: [512, 512, [10017], "f69a", "M404.2 309.5L383.1 344l42.3 0-21.1-34.5zM371.4 256l-54-88-122.8 0-54 88 54 88 122.8 0 54-88zm65.7 0l53.4 87c3.6 5.9 5.5 12.7 5.5 19.6c0 20.7-16.8 37.4-37.4 37.4l-109.8 0-56.2 91.5C284.8 504.3 270.9 512 256 512s-28.8-7.7-36.6-20.5L163.3 400 53.4 400C32.8 400 16 383.2 16 362.6c0-6.9 1.9-13.7 5.5-19.6l53.4-87L21.5 169c-3.6-5.9-5.5-12.7-5.5-19.6C16 128.8 32.8 112 53.4 112l109.8 0 56.2-91.5C227.2 7.7 241.1 0 256 0s28.8 7.7 36.6 20.5L348.7 112l109.8 0c20.7 0 37.4 16.8 37.4 37.4c0 6.9-1.9 13.7-5.5 19.6l-53.4 87zm-54-88l21.1 34.5L425.4 168l-42.3 0zM283 112L256 68l-27 44 54 0zM128.9 168l-42.3 0 21.1 34.5L128.9 168zM107.8 309.5L86.6 344l42.3 0-21.1-34.5zM229 400l27 44 27-44-54 0z"]
};
const faPersonMilitaryRifle = {
  prefix: 'fas',
  iconName: 'person-military-rifle',
  icon: [512, 512, [], "e54b", "M160 39c0-13 10-23.8 22.9-24.9L334.7 1.4C344 .7 352 8 352 17.4L352 48c0 8.8-7.2 16-16 16L185 64c-13.8 0-25-11.2-25-25zm17.6 57l156.8 0c1 5.2 1.6 10.5 1.6 16c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-5.5 .6-10.8 1.6-16zm228 364.3L352 369.7 352 480c0 1.3-.1 2.5-.2 3.8L177.5 234.9c16.6-7.1 34.6-10.9 53.3-10.9l50.4 0c15.9 0 31.3 2.8 45.8 7.9L421.9 67.7c-7.7-4.4-10.3-14.2-5.9-21.9s14.2-10.3 21.9-5.9l13.9 8 13.9 8c7.7 4.4 10.3 14.2 5.9 21.9L416 173.9l1.6 .9c15.3 8.8 20.6 28.4 11.7 43.7L392.6 282c2 2.8 3.9 5.8 5.7 8.8l76.1 128.8c11.2 19 4.9 43.5-14.1 54.8s-43.5 4.9-54.8-14.1zM320 512l-128 0c-17.7 0-32-14.3-32-32l0-110.3-53.6 90.6c-11.2 19-35.8 25.3-54.8 14.1s-25.3-35.8-14.1-54.8l76.1-128.8c9.4-15.8 21.7-29.3 36-40L331.1 510c-3.5 1.3-7.2 2-11.1 2zM296 320a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faCartShopping = {
  prefix: 'fas',
  iconName: 'cart-shopping',
  icon: [576, 512, [128722, "shopping-cart"], "f07a", "M0 24C0 10.7 10.7 0 24 0L69.5 0c22 0 41.5 12.8 50.6 32l411 0c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3l-288.5 0 5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5L488 336c13.3 0 24 10.7 24 24s-10.7 24-24 24l-288.3 0c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5L24 48C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faShoppingCart = faCartShopping;
const faVials = {
  prefix: 'fas',
  iconName: 'vials',
  icon: [512, 512, [], "f493", "M0 64C0 46.3 14.3 32 32 32l56 0 48 0 56 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 304c0 44.2-35.8 80-80 80s-80-35.8-80-80L32 96C14.3 96 0 81.7 0 64zM136 96L88 96l0 160 48 0 0-160zM288 64c0-17.7 14.3-32 32-32l56 0 48 0 56 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 304c0 44.2-35.8 80-80 80s-80-35.8-80-80l0-304c-17.7 0-32-14.3-32-32zM424 96l-48 0 0 160 48 0 0-160z"]
};
const faPlugCirclePlus = {
  prefix: 'fas',
  iconName: 'plug-circle-plus',
  icon: [576, 512, [], "e55f", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm16-208l0 48 48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l48 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faPlaceOfWorship = {
  prefix: 'fas',
  iconName: 'place-of-worship',
  icon: [640, 512, [], "f67f", "M224 109.3l0 108.3L183.3 242c-14.5 8.7-23.3 24.3-23.3 41.2L160 512l96 0 0-96c0-35.3 28.7-64 64-64s64 28.7 64 64l0 96 96 0 0-228.8c0-16.9-8.8-32.5-23.3-41.2L416 217.6l0-108.3c0-8.5-3.4-16.6-9.4-22.6L331.3 11.3c-6.2-6.2-16.4-6.2-22.6 0L233.4 86.6c-6 6-9.4 14.1-9.4 22.6zM24.9 330.3C9.5 338.8 0 354.9 0 372.4L0 464c0 26.5 21.5 48 48 48l80 0 0-238.4L24.9 330.3zM592 512c26.5 0 48-21.5 48-48l0-91.6c0-17.5-9.5-33.6-24.9-42.1L512 273.6 512 512l80 0z"]
};
const faGripVertical = {
  prefix: 'fas',
  iconName: 'grip-vertical',
  icon: [320, 512, [], "f58e", "M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z"]
};
const faHexagonNodes = {
  prefix: 'fas',
  iconName: 'hexagon-nodes',
  icon: [448, 512, [], "e699", "M248 106.6c18.9-9 32-28.3 32-50.6c0-30.9-25.1-56-56-56s-56 25.1-56 56c0 22.3 13.1 41.6 32 50.6l0 98.8c-2.8 1.3-5.5 2.9-8 4.7l-80.1-45.8c1.6-20.8-8.6-41.6-27.9-52.8C57.2 96 23 105.2 7.5 132S1.2 193 28 208.5c1.3 .8 2.6 1.5 4 2.1l0 90.8c-1.3 .6-2.7 1.3-4 2.1C1.2 319-8 353.2 7.5 380S57.2 416 84 400.5c19.3-11.1 29.4-32 27.8-52.8l50.5-28.9c-11.5-11.2-19.9-25.6-23.8-41.7L88 306.1c-2.6-1.8-5.2-3.3-8-4.7l0-90.8c2.8-1.3 5.5-2.9 8-4.7l80.1 45.8c-.1 1.4-.2 2.8-.2 4.3c0 22.3 13.1 41.6 32 50.6l0 98.8c-18.9 9-32 28.3-32 50.6c0 30.9 25.1 56 56 56s56-25.1 56-56c0-22.3-13.1-41.6-32-50.6l0-98.8c2.8-1.3 5.5-2.9 8-4.7l80.1 45.8c-1.6 20.8 8.6 41.6 27.8 52.8c26.8 15.5 61 6.3 76.5-20.5s6.3-61-20.5-76.5c-1.3-.8-2.7-1.5-4-2.1l0-90.8c1.4-.6 2.7-1.3 4-2.1c26.8-15.5 36-49.7 20.5-76.5S390.8 96 364 111.5c-19.3 11.1-29.4 32-27.8 52.8l-50.6 28.9c11.5 11.2 19.9 25.6 23.8 41.7L360 205.9c2.6 1.8 5.2 3.3 8 4.7l0 90.8c-2.8 1.3-5.5 2.9-8 4.6l-80.1-45.8c.1-1.4 .2-2.8 .2-4.3c0-22.3-13.1-41.6-32-50.6l0-98.8z"]
};
const faArrowTurnUp = {
  prefix: 'fas',
  iconName: 'arrow-turn-up',
  icon: [384, 512, ["level-up"], "f148", "M32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96-43 96-96l0-306.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 416c0 17.7-14.3 32-32 32l-96 0z"]
};
const faLevelUp = faArrowTurnUp;
const faU = {
  prefix: 'fas',
  iconName: 'u',
  icon: [384, 512, [117], "55", "M32 32c17.7 0 32 14.3 32 32l0 224c0 70.7 57.3 128 128 128s128-57.3 128-128l0-224c0-17.7 14.3-32 32-32s32 14.3 32 32l0 224c0 106-86 192-192 192S0 394 0 288L0 64C0 46.3 14.3 32 32 32z"]
};
const faSquareRootVariable = {
  prefix: 'fas',
  iconName: 'square-root-variable',
  icon: [576, 512, ["square-root-alt"], "f698", "M282.6 78.1c8-27.3 33-46.1 61.4-46.1l200 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L344 96 238.7 457c-3.6 12.3-14.1 21.2-26.8 22.8s-25.1-4.6-31.5-15.6L77.6 288 32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l45.6 0c22.8 0 43.8 12.1 55.3 31.8l65.2 111.8L282.6 78.1zM393.4 233.4c12.5-12.5 32.8-12.5 45.3 0L480 274.7l41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L525.3 320l41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L480 365.3l-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L434.7 320l-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3z"]
};
const faSquareRootAlt = faSquareRootVariable;
const faClock = {
  prefix: 'fas',
  iconName: 'clock',
  icon: [512, 512, [128339, "clock-four"], "f017", "M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
};
const faClockFour = faClock;
const faBackwardStep = {
  prefix: 'fas',
  iconName: 'backward-step',
  icon: [320, 512, ["step-backward"], "f048", "M267.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-320c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160L64 241 64 96c0-17.7-14.3-32-32-32S0 78.3 0 96L0 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-145 11.5 9.6 192 160z"]
};
const faStepBackward = faBackwardStep;
const faPallet = {
  prefix: 'fas',
  iconName: 'pallet',
  icon: [640, 512, [], "f482", "M32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 64-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 224 0 224 0 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-64 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0-224 0L96 320l-64 0zm96 64l160 0 0 64-160 0 0-64zm224 0l160 0 0 64-160 0 0-64z"]
};
const faFaucet = {
  prefix: 'fas',
  iconName: 'faucet',
  icon: [512, 512, [], "e005", "M192 96l0 12L96 96c-17.7 0-32 14.3-32 32s14.3 32 32 32l96-12 31-3.9 1-.1 1 .1 31 3.9 96 12c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 12 0-12c0-17.7-14.3-32-32-32s-32 14.3-32 32zM32 256c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l100.1 0c20.2 29 53.9 48 91.9 48s71.7-19 91.9-48l36.1 0c17.7 0 32 14.3 32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32c0-88.4-71.6-160-160-160l-32 0-22.6-22.6c-6-6-14.1-9.4-22.6-9.4L256 224l0-43.8-32-4-32 4 0 43.8-18.7 0c-8.5 0-16.6 3.4-22.6 9.4L128 256l-96 0z"]
};
const faBaseballBatBall = {
  prefix: 'fas',
  iconName: 'baseball-bat-ball',
  icon: [512, 512, [], "f432", "M424 0c-12.4 0-24.2 4.9-33 13.7L233.5 171.2c-10.5 10.5-19.8 22.1-27.7 34.6L132.7 321.6c-7.3 11.5-15.8 22.2-25.5 31.9L69.9 390.7l51.3 51.3 37.3-37.3c9.6-9.6 20.3-18.2 31.9-25.5l115.8-73.1c12.5-7.9 24.1-17.2 34.6-27.7L498.3 121c8.7-8.7 13.7-20.6 13.7-33s-4.9-24.2-13.7-33L457 13.7C448.2 4.9 436.4 0 424 0zm88 432a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM15 399c-9.4 9.4-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L49 399c-9.4-9.4-24.6-9.4-33.9 0z"]
};
const faS = {
  prefix: 'fas',
  iconName: 's',
  icon: [320, 512, [115], "53", "M99.1 105.4C79 114 68.2 127.2 65.2 144.8c-2.4 14.1-.7 23.2 2 29.4c2.8 6.3 7.9 12.4 16.7 18.6c19.2 13.4 48.3 22.1 84.9 32.5c1 .3 1.9 .6 2.9 .8c32.7 9.3 72 20.6 100.9 40.7c15.7 10.9 29.9 25.5 38.6 45.1c8.8 19.8 10.8 42 6.6 66.3c-7.3 42.5-35.3 71.7-71.8 87.3c-35.4 15.2-79.1 17.9-123.7 10.9l-.2 0s0 0 0 0c-24-3.9-62.7-17.1-87.6-25.6c-4.8-1.7-9.2-3.1-12.8-4.3C5.1 440.8-3.9 422.7 1.6 405.9s23.7-25.8 40.5-20.3c4.9 1.6 10.2 3.4 15.9 5.4c25.4 8.6 56.4 19.2 74.4 22.1c36.8 5.7 67.5 2.5 88.5-6.5c20.1-8.6 30.8-21.8 33.9-39.4c2.4-14.1 .7-23.2-2-29.4c-2.8-6.3-7.9-12.4-16.7-18.6c-19.2-13.4-48.3-22.1-84.9-32.5c-1-.3-1.9-.6-2.9-.8c-32.7-9.3-72-20.6-100.9-40.7c-15.7-10.9-29.9-25.5-38.6-45.1c-8.8-19.8-10.8-42-6.6-66.3l31.5 5.5L2.1 133.9C9.4 91.4 37.4 62.2 73.9 46.6c35.4-15.2 79.1-17.9 123.7-10.9c13 2 52.4 9.6 66.6 13.4c17.1 4.5 27.2 22.1 22.7 39.2s-22.1 27.2-39.2 22.7c-11.2-3-48.1-10.2-60.1-12l4.9-31.5-4.9 31.5c-36.9-5.8-67.5-2.5-88.6 6.5z"]
};
const faTimeline = {
  prefix: 'fas',
  iconName: 'timeline',
  icon: [640, 512, [], "e29c", "M128 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm32 97.3c28.3-12.3 48-40.5 48-73.3c0-44.2-35.8-80-80-80S48 51.8 48 96c0 32.8 19.7 61 48 73.3L96 224l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0 0 54.7c-28.3 12.3-48 40.5-48 73.3c0 44.2 35.8 80 80 80s80-35.8 80-80c0-32.8-19.7-61-48-73.3l0-54.7 256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-54.7c28.3-12.3 48-40.5 48-73.3c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 32.8 19.7 61 48 73.3l0 54.7-320 0 0-54.7zM488 96a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM320 392a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faKeyboard = {
  prefix: 'fas',
  iconName: 'keyboard',
  icon: [576, 512, [9000], "f11c", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm16 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80-176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM160 336c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-32zM272 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM256 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM368 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM352 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM464 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM448 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]
};
const faCaretDown = {
  prefix: 'fas',
  iconName: 'caret-down',
  icon: [320, 512, [], "f0d7", "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"]
};
const faHouseChimneyMedical = {
  prefix: 'fas',
  iconName: 'house-chimney-medical',
  icon: [576, 512, ["clinic-medical"], "f7f2", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c.2 35.5-28.5 64.3-64 64.3l-320.4 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7 416 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 121 52.8 46.4c8 7 12 15 11 24zM272 192c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0z"]
};
const faClinicMedical = faHouseChimneyMedical;
const faTemperatureThreeQuarters = {
  prefix: 'fas',
  iconName: 'temperature-three-quarters',
  icon: [320, 512, ["temperature-3", "thermometer-3", "thermometer-three-quarters"], "f2c8", "M160 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L208 112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L48 112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3L144 144c0-8.8 7.2-16 16-16s16 7.2 16 16l0 178.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faTemperature3 = faTemperatureThreeQuarters;
const faThermometer3 = faTemperatureThreeQuarters;
const faThermometerThreeQuarters = faTemperatureThreeQuarters;
const faMobileScreen = {
  prefix: 'fas',
  iconName: 'mobile-screen',
  icon: [384, 512, ["mobile-android-alt"], "f3cf", "M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM144 448c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zM304 64L80 64l0 320 224 0 0-320z"]
};
const faMobileAndroidAlt = faMobileScreen;
const faPlaneUp = {
  prefix: 'fas',
  iconName: 'plane-up',
  icon: [512, 512, [], "e22d", "M192 93.7C192 59.5 221 0 256 0c36 0 64 59.5 64 93.7l0 66.3L497.8 278.5c8.9 5.9 14.2 15.9 14.2 26.6l0 56.7c0 10.9-10.7 18.6-21.1 15.2L320 320l0 80 57.6 43.2c4 3 6.4 7.8 6.4 12.8l0 42c0 7.8-6.3 14-14 14c-1.3 0-2.6-.2-3.9-.5L256 480 145.9 511.5c-1.3 .4-2.6 .5-3.9 .5c-7.8 0-14-6.3-14-14l0-42c0-5 2.4-9.8 6.4-12.8L192 400l0-80L21.1 377C10.7 380.4 0 372.7 0 361.8l0-56.7c0-10.7 5.3-20.7 14.2-26.6L192 160l0-66.3z"]
};
const faPiggyBank = {
  prefix: 'fas',
  iconName: 'piggy-bank',
  icon: [576, 512, [], "f4d3", "M400 96l0 .7c-5.3-.4-10.6-.7-16-.7L256 96c-16.5 0-32.5 2.1-47.8 6c-.1-2-.2-4-.2-6c0-53 43-96 96-96s96 43 96 96zm-16 32c3.5 0 7 .1 10.4 .3c4.2 .3 8.4 .7 12.6 1.3C424.6 109.1 450.8 96 480 96l11.5 0c10.4 0 18 9.8 15.5 19.9l-13.8 55.2c15.8 14.8 28.7 32.8 37.5 52.9l13.3 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-32 0c-9.1 12.1-19.9 22.9-32 32l0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-128 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64c-34.9-26.2-58.7-66.3-63.2-112L68 304c-37.6 0-68-30.4-68-68s30.4-68 68-68l4 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-4 0c-11 0-20 9-20 20s9 20 20 20l31.2 0c12.1-59.8 57.7-107.5 116.3-122.8c12.9-3.4 26.5-5.2 40.5-5.2l128 0zm64 136a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faBatteryHalf = {
  prefix: 'fas',
  iconName: 'battery-half',
  icon: [576, 512, ["battery-3"], "f242", "M464 160c8.8 0 16 7.2 16 16l0 160c0 8.8-7.2 16-16 16L80 352c-8.8 0-16-7.2-16-16l0-160c0-8.8 7.2-16 16-16l384 0zM80 96C35.8 96 0 131.8 0 176L0 336c0 44.2 35.8 80 80 80l384 0c44.2 0 80-35.8 80-80l0-16c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-16c0-44.2-35.8-80-80-80L80 96zm208 96L96 192l0 128 192 0 0-128z"]
};
const faBattery3 = faBatteryHalf;
const faMountainCity = {
  prefix: 'fas',
  iconName: 'mountain-city',
  icon: [640, 512, [], "e52e", "M336 0c-26.5 0-48 21.5-48 48l0 92.1 71.4 118.4c2.5-1.6 5.4-2.5 8.6-2.5l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-3.5 0 73.8 122.4c12.4 20.6 12.9 46.3 1.2 67.3c-.4 .8-.9 1.6-1.4 2.3L592 512c26.5 0 48-21.5 48-48l0-224c0-26.5-21.5-48-48-48l-24 0 0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-40 0 0-144c0-26.5-21.5-48-48-48L336 0zm32 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM352 176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm160 96c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM224 188.9L283.8 288 223 288l-48 64-24.6-41.2L224 188.9zm29.4-44.2C247.1 134.3 236 128 224 128s-23.1 6.3-29.4 16.7L5.1 458.9c-6.5 10.8-6.7 24.3-.7 35.3S22 512 34.5 512l379.1 0c12.5 0 24-6.8 30.1-17.8s5.8-24.5-.7-35.3L253.4 144.7z"]
};
const faCoins = {
  prefix: 'fas',
  iconName: 'coins',
  icon: [512, 512, [], "f51e", "M512 80c0 18-14.3 34.6-38.4 48c-29.1 16.1-72.5 27.5-122.3 30.9c-3.7-1.8-7.4-3.5-11.3-5C300.6 137.4 248.2 128 192 128c-8.3 0-16.4 .2-24.5 .6l-1.1-.6C142.3 114.6 128 98 128 80c0-44.2 86-80 192-80S512 35.8 512 80zM160.7 161.1c10.2-.7 20.7-1.1 31.3-1.1c62.2 0 117.4 12.3 152.5 31.4C369.3 204.9 384 221.7 384 240c0 4-.7 7.9-2.1 11.7c-4.6 13.2-17 25.3-35 35.5c0 0 0 0 0 0c-.1 .1-.3 .1-.4 .2c0 0 0 0 0 0s0 0 0 0c-.3 .2-.6 .3-.9 .5c-35 19.4-90.8 32-153.6 32c-59.6 0-112.9-11.3-148.2-29.1c-1.9-.9-3.7-1.9-5.5-2.9C14.3 274.6 0 258 0 240c0-34.8 53.4-64.5 128-75.4c10.5-1.5 21.4-2.7 32.7-3.5zM416 240c0-21.9-10.6-39.9-24.1-53.4c28.3-4.4 54.2-11.4 76.2-20.5c16.3-6.8 31.5-15.2 43.9-25.5l0 35.4c0 19.3-16.5 37.1-43.8 50.9c-14.6 7.4-32.4 13.7-52.4 18.5c.1-1.8 .2-3.5 .2-5.3zm-32 96c0 18-14.3 34.6-38.4 48c-1.8 1-3.6 1.9-5.5 2.9C304.9 404.7 251.6 416 192 416c-62.8 0-118.6-12.6-153.6-32C14.3 370.6 0 354 0 336l0-35.4c12.5 10.3 27.6 18.7 43.9 25.5C83.4 342.6 135.8 352 192 352s108.6-9.4 148.1-25.9c7.8-3.2 15.3-6.9 22.4-10.9c6.1-3.4 11.8-7.2 17.2-11.2c1.5-1.1 2.9-2.3 4.3-3.4l0 3.4 0 5.7 0 26.3zm32 0l0-32 0-25.9c19-4.2 36.5-9.5 52.1-16c16.3-6.8 31.5-15.2 43.9-25.5l0 35.4c0 10.5-5 21-14.9 30.9c-16.3 16.3-45 29.7-81.3 38.4c.1-1.7 .2-3.5 .2-5.3zM192 448c56.2 0 108.6-9.4 148.1-25.9c16.3-6.8 31.5-15.2 43.9-25.5l0 35.4c0 44.2-86 80-192 80S0 476.2 0 432l0-35.4c12.5 10.3 27.6 18.7 43.9 25.5C83.4 438.6 135.8 448 192 448z"]
};
const faKhanda = {
  prefix: 'fas',
  iconName: 'khanda',
  icon: [512, 512, [9772], "f66d", "M245.8 3.7c5.9-4.9 14.6-4.9 20.5 0l48 40c5.9 4.9 7.5 13.2 3.8 19.9c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0l-.1 .1-.3 .6c-.3 .5-.7 1.3-1.2 2.3c-1 2-2.6 5-4.4 8.6c-.5 .9-.9 1.9-1.4 2.9C344.9 97.4 368 134 368 176s-23.1 78.6-57.3 97.8c.5 1 1 2 1.4 2.9c1.8 3.7 3.3 6.6 4.4 8.6c.5 1 .9 1.8 1.2 2.3l.3 .6 .1 .1s0 0 0 0s0 0 0 0c3.6 6.7 2 15-3.8 19.9L272 343.5l0 19.8 35.6-24.5 41.1-28.2c42.8-29.4 68.4-78 68.4-130c0-31.1-9.2-61.6-26.5-87.5l-2.8-4.2c-4-6-3.5-14 1.3-19.5s12.7-7 19.2-3.7L401.1 80c7.2-14.3 7.2-14.3 7.2-14.3s0 0 0 0s0 0 0 0l.1 0 .3 .2 1 .5c.8 .4 2 1.1 3.5 1.9c2.9 1.7 7 4.1 11.8 7.3c9.6 6.4 22.5 16.1 35.4 29c25.7 25.7 52.7 65.6 52.7 119.3c0 53.1-26.4 100.5-51.2 133.6c-12.6 16.7-25.1 30.3-34.5 39.7c-4.7 4.7-8.7 8.4-11.5 10.9c-1.4 1.3-2.5 2.2-3.3 2.9l-.9 .8-.3 .2-.1 .1c0 0 0 0 0 0s0 0 0 0L401.1 400l10.2 12.3c-5.1 4.3-12.4 4.9-18.2 1.6l-75.6-43-32.7 22.5 45.5 31.3c1.8-.4 3.7-.7 5.7-.7c13.3 0 24 10.7 24 24s-10.7 24-24 24c-12.2 0-22.3-9.1-23.8-21L272 423.4l0 28.9c9.6 5.5 16 15.9 16 27.7c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-11.8 6.4-22.2 16-27.7l0-28.1-40.3 27.7C197.8 463.3 187.9 472 176 472c-13.3 0-24-10.7-24-24s10.7-24 24-24c2.2 0 4.4 .3 6.5 .9l45.8-31.5-32.7-22.5-75.6 43c-5.8 3.3-13 2.7-18.2-1.6L112 400c-10.2 12.3-10.2 12.3-10.3 12.3s0 0 0 0s0 0 0 0l-.1-.1-.3-.2-.9-.8c-.8-.7-1.9-1.7-3.3-2.9c-2.8-2.5-6.7-6.2-11.5-10.9c-9.4-9.4-21.9-23-34.5-39.7C26.4 324.5 0 277.1 0 224c0-53.7 26.9-93.6 52.7-119.3c12.9-12.9 25.8-22.6 35.4-29C93 72.5 97 70 99.9 68.4c1.5-.8 2.6-1.5 3.5-1.9l1-.5 .3-.2 .1 0c0 0 0 0 0 0s0 0 0 0L112 80l-7.2-14.3c6.5-3.2 14.3-1.7 19.2 3.7s5.3 13.4 1.3 19.5l-2.8 4.2C105.2 119 96 149.5 96 180.6c0 51.9 25.6 100.6 68.4 130l41.1 28.2L240 362.6l0-19.1-42.2-35.2c-5.9-4.9-7.5-13.2-3.8-19.9c0 0 0 0 0 0s0 0 0 0s0 0 0 0l.1-.1 .3-.6c.3-.5 .7-1.3 1.2-2.3c1-2 2.6-5 4.4-8.6c.5-.9 .9-1.9 1.4-2.9C167.1 254.6 144 218 144 176s23.1-78.6 57.3-97.8c-.5-1-1-2-1.4-2.9c-1.8-3.7-3.3-6.6-4.4-8.6c-.5-1-.9-1.8-1.2-2.3l-.3-.6-.1-.1s0 0 0 0s0 0 0 0s0 0 0 0c-3.6-6.7-2-15 3.8-19.9l48-40zM220.2 122.9c-17 11.5-28.2 31-28.2 53.1s11.2 41.6 28.2 53.1C227 210.2 232 190.9 232 176s-5-34.2-11.8-53.1zm71.5 106.2c17-11.5 28.2-31 28.2-53.1s-11.2-41.6-28.2-53.1C285 141.8 280 161.1 280 176s5 34.2 11.8 53.1z"]
};
const faSliders = {
  prefix: 'fas',
  iconName: 'sliders',
  icon: [512, 512, ["sliders-h"], "f1de", "M0 416c0 17.7 14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384c-17.7 0-32 14.3-32 32zm128 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32-80c-32.8 0-61 19.7-73.3 48L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm73.3-64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64z"]
};
const faSlidersH = faSliders;
const faFolderTree = {
  prefix: 'fas',
  iconName: 'folder-tree',
  icon: [576, 512, [], "f802", "M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32l0 96L0 384c0 35.3 28.7 64 64 64l192 0 0-64L64 384l0-224 192 0 0-64L64 96l0-64zM288 192c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4L409.4 9.4c-6-6-14.1-9.4-22.6-9.4L320 0c-17.7 0-32 14.3-32 32l0 160zm0 288c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4l-13.3-13.3c-6-6-14.1-9.4-22.6-9.4L320 288c-17.7 0-32 14.3-32 32l0 160z"]
};
const faNetworkWired = {
  prefix: 'fas',
  iconName: 'network-wired',
  icon: [640, 512, [], "f6ff", "M256 64l128 0 0 64-128 0 0-64zM240 0c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48l48 0 0 32L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 0 32-48 0c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48l160 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-48 0 0-32 256 0 0 32-48 0c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48l160 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-48 0 0-32 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-256 0 0-32 48 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48L240 0zM96 448l0-64 128 0 0 64L96 448zm320-64l128 0 0 64-128 0 0-64z"]
};
const faMapPin = {
  prefix: 'fas',
  iconName: 'map-pin',
  icon: [320, 512, [128205], "f276", "M16 144a144 144 0 1 1 288 0A144 144 0 1 1 16 144zM160 80c8.8 0 16-7.2 16-16s-7.2-16-16-16c-53 0-96 43-96 96c0 8.8 7.2 16 16 16s16-7.2 16-16c0-35.3 28.7-64 64-64zM128 480l0-162.9c10.4 1.9 21.1 2.9 32 2.9s21.6-1 32-2.9L192 480c0 17.7-14.3 32-32 32s-32-14.3-32-32z"]
};
const faHamsa = {
  prefix: 'fas',
  iconName: 'hamsa',
  icon: [512, 512, [], "f665", "M34.6 288L80 288c8.8 0 16-7.2 16-16L96 72c0-22.1 17.9-40 40-40s40 17.9 40 40l0 132c0 11 9 20 20 20s20-9 20-20l0-164c0-22.1 17.9-40 40-40s40 17.9 40 40l0 164c0 11 9 20 20 20s20-9 20-20l0-132c0-22.1 17.9-40 40-40s40 17.9 40 40l0 200c0 8.8 7.2 16 16 16l45.4 0c19.1 0 34.6 15.5 34.6 34.6c0 8.6-3.2 16.9-9 23.3L416.6 441c-41.1 45.2-99.4 71-160.6 71s-119.4-25.8-160.6-71L9 345.9c-5.8-6.4-9-14.7-9-23.3C0 303.5 15.5 288 34.6 288zM256 288c-38.4 0-76.8 35.8-90.6 50.2c-3.6 3.7-5.4 8.7-5.4 13.8s1.8 10.1 5.4 13.8C179.2 380.2 217.6 416 256 416s76.8-35.8 90.6-50.2c3.6-3.7 5.4-8.7 5.4-13.8s-1.8-10.1-5.4-13.8C332.8 323.8 294.4 288 256 288zm0 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faCentSign = {
  prefix: 'fas',
  iconName: 'cent-sign',
  icon: [384, 512, [], "e3f5", "M224 0c17.7 0 32 14.3 32 32l0 34.7c30.9 5.2 59.2 17.7 83.2 35.8c14.1 10.6 17 30.7 6.4 44.8s-30.7 17-44.8 6.4C279.4 137.5 252.9 128 224 128c-70.7 0-128 57.3-128 128s57.3 128 128 128c28.9 0 55.4-9.5 76.8-25.6c14.1-10.6 34.2-7.8 44.8 6.4s7.8 34.2-6.4 44.8c-24 18-52.4 30.6-83.2 35.8l0 34.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-34.7C101.2 430.1 32 351.1 32 256s69.2-174.1 160-189.3L192 32c0-17.7 14.3-32 32-32z"]
};
const faFlask = {
  prefix: 'fas',
  iconName: 'flask',
  icon: [448, 512, [], "f0c3", "M288 0L160 0 128 0C110.3 0 96 14.3 96 32s14.3 32 32 32l0 132.8c0 11.8-3.3 23.5-9.5 33.5L10.3 406.2C3.6 417.2 0 429.7 0 442.6C0 480.9 31.1 512 69.4 512l309.2 0c38.3 0 69.4-31.1 69.4-69.4c0-12.8-3.6-25.4-10.3-36.4L329.5 230.4c-6.2-10.1-9.5-21.7-9.5-33.5L320 64c17.7 0 32-14.3 32-32s-14.3-32-32-32L288 0zM192 196.8L192 64l64 0 0 132.8c0 23.7 6.6 46.9 19 67.1L309.5 320l-171 0L173 263.9c12.4-20.2 19-43.4 19-67.1z"]
};
const faPersonPregnant = {
  prefix: 'fas',
  iconName: 'person-pregnant',
  icon: [384, 512, [], "e31e", "M192 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM120 383c-13.8-3.6-24-16.1-24-31l0-55.1-4.6 7.6c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c15-24.9 40.3-41.5 68.7-45.6c4.1-.6 8.2-1 12.5-1l1.1 0 12.5 0 2.4 0c1.4 0 2.8 .1 4.1 .3c35.7 2.9 65.4 29.3 72.1 65l6.1 32.5c44.3 8.6 77.7 47.5 77.7 94.3l0 32c0 17.7-14.3 32-32 32l-16 0-40 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-8 0-8 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-97z"]
};
const faWandSparkles = {
  prefix: 'fas',
  iconName: 'wand-sparkles',
  icon: [512, 512, [], "f72b", "M464 6.1c9.5-8.5 24-8.1 33 .9l8 8c9 9 9.4 23.5 .9 33l-85.8 95.9c-2.6 2.9-4.1 6.7-4.1 10.7l0 21.4c0 8.8-7.2 16-16 16l-15.8 0c-4.6 0-8.9 1.9-11.9 5.3L100.7 500.9C94.3 508 85.3 512 75.8 512c-8.8 0-17.3-3.5-23.5-9.8L9.7 459.7C3.5 453.4 0 445 0 436.2c0-9.5 4-18.5 11.1-24.8l111.6-99.8c3.4-3 5.3-7.4 5.3-11.9l0-27.6c0-8.8 7.2-16 16-16l34.6 0c3.9 0 7.7-1.5 10.7-4.1L464 6.1zM432 288c3.6 0 6.7 2.4 7.7 5.8l14.8 51.7 51.7 14.8c3.4 1 5.8 4.1 5.8 7.7s-2.4 6.7-5.8 7.7l-51.7 14.8-14.8 51.7c-1 3.4-4.1 5.8-7.7 5.8s-6.7-2.4-7.7-5.8l-14.8-51.7-51.7-14.8c-3.4-1-5.8-4.1-5.8-7.7s2.4-6.7 5.8-7.7l51.7-14.8 14.8-51.7c1-3.4 4.1-5.8 7.7-5.8zM87.7 69.8l14.8 51.7 51.7 14.8c3.4 1 5.8 4.1 5.8 7.7s-2.4 6.7-5.8 7.7l-51.7 14.8L87.7 218.2c-1 3.4-4.1 5.8-7.7 5.8s-6.7-2.4-7.7-5.8L57.5 166.5 5.8 151.7c-3.4-1-5.8-4.1-5.8-7.7s2.4-6.7 5.8-7.7l51.7-14.8L72.3 69.8c1-3.4 4.1-5.8 7.7-5.8s6.7 2.4 7.7 5.8zM208 0c3.7 0 6.9 2.5 7.8 6.1l6.8 27.3 27.3 6.8c3.6 .9 6.1 4.1 6.1 7.8s-2.5 6.9-6.1 7.8l-27.3 6.8-6.8 27.3c-.9 3.6-4.1 6.1-7.8 6.1s-6.9-2.5-7.8-6.1l-6.8-27.3-27.3-6.8c-3.6-.9-6.1-4.1-6.1-7.8s2.5-6.9 6.1-7.8l27.3-6.8 6.8-27.3c.9-3.6 4.1-6.1 7.8-6.1z"]
};
const faEllipsisVertical = {
  prefix: 'fas',
  iconName: 'ellipsis-vertical',
  icon: [128, 512, ["ellipsis-v"], "f142", "M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"]
};
const faEllipsisV = faEllipsisVertical;
const faTicket = {
  prefix: 'fas',
  iconName: 'ticket',
  icon: [576, 512, [127903], "f145", "M64 64C28.7 64 0 92.7 0 128l0 64c0 8.8 7.4 15.7 15.7 18.6C34.5 217.1 48 235 48 256s-13.5 38.9-32.3 45.4C7.4 304.3 0 311.2 0 320l0 64c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-64c0-8.8-7.4-15.7-15.7-18.6C541.5 294.9 528 277 528 256s13.5-38.9 32.3-45.4c8.3-2.9 15.7-9.8 15.7-18.6l0-64c0-35.3-28.7-64-64-64L64 64zm64 112l0 160c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16l0-160c0-8.8-7.2-16-16-16l-288 0c-8.8 0-16 7.2-16 16zM96 160c0-17.7 14.3-32 32-32l320 0c17.7 0 32 14.3 32 32l0 192c0 17.7-14.3 32-32 32l-320 0c-17.7 0-32-14.3-32-32l0-192z"]
};
const faPowerOff = {
  prefix: 'fas',
  iconName: 'power-off',
  icon: [512, 512, [9211], "f011", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 224c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224zM143.5 120.6c13.6-11.3 15.4-31.5 4.1-45.1s-31.5-15.4-45.1-4.1C49.7 115.4 16 181.8 16 256c0 132.5 107.5 240 240 240s240-107.5 240-240c0-74.2-33.8-140.6-86.6-184.6c-13.6-11.3-33.8-9.4-45.1 4.1s-9.4 33.8 4.1 45.1c38.9 32.3 63.5 81 63.5 135.4c0 97.2-78.8 176-176 176s-176-78.8-176-176c0-54.4 24.7-103.1 63.5-135.4z"]
};
const faRightLong = {
  prefix: 'fas',
  iconName: 'right-long',
  icon: [512, 512, ["long-arrow-alt-right"], "f30b", "M334.5 414c8.8 3.8 19 2 26-4.6l144-136c4.8-4.5 7.5-10.8 7.5-17.4s-2.7-12.9-7.5-17.4l-144-136c-7-6.6-17.2-8.4-26-4.6s-14.5 12.5-14.5 22l0 72L32 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l288 0 0 72c0 9.6 5.7 18.2 14.5 22z"]
};
const faLongArrowAltRight = faRightLong;
const faFlagUsa = {
  prefix: 'fas',
  iconName: 'flag-usa',
  icon: [448, 512, [], "f74d", "M32 0C49.7 0 64 14.3 64 32l0 16 69-17.2c38.1-9.5 78.3-5.1 113.5 12.5c46.3 23.2 100.8 23.2 147.1 0l9.6-4.8C423.8 28.1 448 43.1 448 66.1l0 36.1-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-20.3-9-41.8-14.7-63.6-16.9l0 32.2c17.4 2.1 34.4 6.7 50.6 13.9l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4L448 136.3l0 62-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-40.2-17.9-85-22.5-128.1-13.3L64 203.1l0 32.7 70.2-15.1c36.4-7.8 74.3-3.9 108.4 11.3l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4L448 232.3l0 62-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-40.2-17.9-85-22.5-128.1-13.3L64 299.1l0 32.7 70.2-15.1c36.4-7.8 74.3-3.9 108.4 11.3l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4L448 328.3l0 33.5c0 13.3-8.3 25.3-20.8 30l-34.7 13c-46.2 17.3-97.6 14.6-141.7-7.4c-37.9-19-81.3-23.7-122.5-13.4L64 400l0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64 0-70.5 0-32.7 0-63.3 0-32.7 0-63.3 0-32.7L0 64 0 32C0 14.3 14.3 0 32 0zm80 96A16 16 0 1 0 80 96a16 16 0 1 0 32 0zm32 0a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-32 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm32 0a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faLaptopFile = {
  prefix: 'fas',
  iconName: 'laptop-file',
  icon: [640, 512, [], "e51d", "M128 0C92.7 0 64 28.7 64 64l0 224-44.8 0C8.6 288 0 296.6 0 307.2C0 349.6 34.4 384 76.8 384L320 384l0-96-192 0 0-224 320 0 0 32 64 0 0-32c0-35.3-28.7-64-64-64L128 0zM512 128l-112 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l192 0c26.5 0 48-21.5 48-48l0-208-96 0c-17.7 0-32-14.3-32-32l0-96zm32 0l0 96 96 0-96-96z"]
};
const faTty = {
  prefix: 'fas',
  iconName: 'tty',
  icon: [512, 512, ["teletype"], "f1e4", "M38.3 241.3L15.1 200.6c-9.2-16.2-8.4-36.5 4.5-50C61.4 106.8 144.7 48 256 48s194.6 58.8 236.4 102.6c12.9 13.5 13.7 33.8 4.5 50l-23.1 40.7c-7.5 13.2-23.3 19.3-37.8 14.6l-81.1-26.6c-13.1-4.3-22-16.6-22-30.4l0-54.8c-49.6-18.1-104-18.1-153.6 0l0 54.8c0 13.8-8.9 26.1-22 30.4L76.1 255.8c-14.5 4.7-30.3-1.4-37.8-14.6zM32 336c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm0 96c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM144 320l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM128 432c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-32z"]
};
const faTeletype = faTty;
const faDiagramNext = {
  prefix: 'fas',
  iconName: 'diagram-next',
  icon: [512, 512, [], "e476", "M512 160c0 35.3-28.7 64-64 64l-168 0 0 64 46.1 0c21.4 0 32.1 25.9 17 41L273 399c-9.4 9.4-24.6 9.4-33.9 0L169 329c-15.1-15.1-4.4-41 17-41l46.1 0 0-64L64 224c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 64zM448 416l0-64-82.7 0 .4-.4c18.4-18.4 20.4-43.7 11-63.6l71.3 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l71.3 0c-9.4 19.9-7.4 45.2 11 63.6l.4 .4L64 352l0 64 146.7 0 5.7 5.7c21.9 21.9 57.3 21.9 79.2 0l5.7-5.7L448 416z"]
};
const faPersonRifle = {
  prefix: 'fas',
  iconName: 'person-rifle',
  icon: [576, 512, [], "e54e", "M265.2 192c25.4 0 49.8 7.1 70.8 19.9L336 512l-192 0 0-174.3L90.4 428.3c-11.2 19-35.8 25.3-54.8 14.1s-25.3-35.8-14.1-54.8L97.7 258.8c24.5-41.4 69-66.8 117.1-66.8l50.4 0zM160 80a80 80 0 1 1 160 0A80 80 0 1 1 160 80zM448 0c8.8 0 16 7.2 16 16l0 116.3c9.6 5.5 16 15.9 16 27.7l0 109.3 16-5.3 0-56c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 84.5c0 6.9-4.4 13-10.9 15.2L480 325.3l0 26.7 48 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-44 0 23 92.1c2.5 10.1-5.1 19.9-15.5 19.9L432 512c-8.8 0-16-7.2-16-16l0-96-16 0c-17.7 0-32-14.3-32-32l0-144c0-17.7 14.3-32 32-32l0-32c0-11.8 6.4-22.2 16-27.7L416 32c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 16 0z"]
};
const faHouseMedicalCircleExclamation = {
  prefix: 'fas',
  iconName: 'house-medical-circle-exclamation',
  icon: [640, 512, [], "e512", "M320 368c0 59.5 29.5 112.1 74.8 144l-266.7 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L522.1 193.9c-8.5-1.3-17.3-1.9-26.1-1.9c-54.7 0-103.5 24.9-135.8 64L320 256l0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z"]
};
const faClosedCaptioning = {
  prefix: 'fas',
  iconName: 'closed-captioning',
  icon: [576, 512, [], "f20a", "M0 96C0 60.7 28.7 32 64 32l448 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM200 208c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48s21.5-48 48-48zm144 48c0-26.5 21.5-48 48-48c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48z"]
};
const faPersonHiking = {
  prefix: 'fas',
  iconName: 'person-hiking',
  icon: [384, 512, ["hiking"], "f6ec", "M192 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm51.3 182.7L224.2 307l49.7 49.7c9 9 14.1 21.2 14.1 33.9l0 89.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-82.7-73.9-73.9c-15.8-15.8-22.2-38.6-16.9-60.3l20.4-84c8.3-34.1 42.7-54.9 76.7-46.4c19 4.8 35.6 16.4 46.4 32.7L305.1 208l30.9 0 0-24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 55.8c0 .1 0 .2 0 .2s0 .2 0 .2L384 488c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-216-39.4 0c-16 0-31-8-39.9-21.4l-13.3-20zM81.1 471.9L117.3 334c3 4.2 6.4 8.2 10.1 11.9l41.9 41.9L142.9 488.1c-4.5 17.1-22 27.3-39.1 22.8s-27.3-22-22.8-39.1zm55.5-346L101.4 266.5c-3 12.1-14.9 19.9-27.2 17.9l-47.9-8c-14-2.3-22.9-16.3-19.2-30L31.9 155c9.5-34.8 41.1-59 77.2-59l4.2 0c15.6 0 27.1 14.7 23.3 29.8z"]
};
const faHiking = faPersonHiking;
const faVenusDouble = {
  prefix: 'fas',
  iconName: 'venus-double',
  icon: [640, 512, [9890], "f226", "M192 288a112 112 0 1 0 0-224 112 112 0 1 0 0 224zM368 176c0 86.3-62.1 158.1-144 173.1l0 34.9 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-34.9C78.1 334.1 16 262.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176zM344 318c14.6-15.6 26.8-33.4 36-53c18.8 14.4 42.4 23 68 23c61.9 0 112-50.1 112-112s-50.1-112-112-112c-25.6 0-49.1 8.6-68 23c-9.3-19.5-21.5-37.4-36-53C373.1 12.6 409.1 0 448 0c97.2 0 176 78.8 176 176c0 86.3-62.1 158.1-144 173.1l0 34.9 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-34.9c-26.6-4.9-51.1-15.7-72-31.1z"]
};
const faImages = {
  prefix: 'fas',
  iconName: 'images',
  icon: [576, 512, [], "f302", "M160 32c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32zM396 138.7l96 144c4.9 7.4 5.4 16.8 1.2 24.6S480.9 320 472 320l-144 0-48 0-80 0c-9.2 0-17.6-5.3-21.6-13.6s-2.9-18.2 2.9-25.4l64-80c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l17.3 21.6 56-84C360.5 132 368 128 376 128s15.5 4 20 10.7zM192 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 344c0 75.1 60.9 136 136 136l320 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-320 0c-48.6 0-88-39.4-88-88l0-224z"]
};
const faCalculator = {
  prefix: 'fas',
  iconName: 'calculator',
  icon: [384, 512, [128425], "f1ec", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM96 64l192 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L96 160c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32zm32 160a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zM96 352a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM64 416c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32zM192 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm32 64a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm64-64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm32 64a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zM288 448a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"]
};
const faPeoplePulling = {
  prefix: 'fas',
  iconName: 'people-pulling',
  icon: [576, 512, [], "e535", "M80 96A48 48 0 1 0 80 0a48 48 0 1 0 0 96zM64 128c-35.3 0-64 28.7-64 64L0 320c0 17.7 14.3 32 32 32c9.8 0 18.5-4.4 24.4-11.2L80.4 485.3c2.9 17.4 19.4 29.2 36.8 26.3s29.2-19.4 26.3-36.8L123.1 352l15.7 0 30 134.9c3.8 17.3 20.9 28.1 38.2 24.3s28.1-20.9 24.3-38.2l-57.3-258 116.3 53.8c.5 .3 1.1 .5 1.6 .7c8.6 3.6 18 3.1 25.9-.7c3.4-1.6 6.6-3.9 9.3-6.7c3.1-3.2 5.5-7 7.1-11.4c.1-.3 .2-.7 .3-1l2.5-7.5c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L537 232.7l-15.3-36.8C504.5 154.8 464.3 128 419.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-24.4 10.9-44.6 29-58.1 51.6L157.3 136.9C144.7 131 130.9 128 117 128l-53 0zM464 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM349.7 335.6l-25 62.4-59.4 59.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L372.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6z"]
};
const faN = {
  prefix: 'fas',
  iconName: 'n',
  icon: [384, 512, [110], "4e", "M21.1 33.9c12.7-4.6 26.9-.7 35.5 9.6L320 359.6 320 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 384c0 13.5-8.4 25.5-21.1 30.1s-26.9 .7-35.5-9.6L64 152.4 64 448c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 64C0 50.5 8.4 38.5 21.1 33.9z"]
};
const faCableCar = {
  prefix: 'fas',
  iconName: 'cable-car',
  icon: [512, 512, [128673, 57551, "tram"], "f7da", "M288 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM160 56a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM32 288c0-35.3 28.7-64 64-64l136 0 0-66.5-203.1 42c-13 2.7-25.7-5.7-28.4-18.6s5.7-25.7 18.6-28.4l232-48 232-48c13-2.7 25.7 5.7 28.4 18.6s-5.7 25.7-18.6 28.4L280 147.5l0 76.5 136 0c35.3 0 64 28.7 64 64l0 160c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-160zm64 0c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-64 0zm112 16l0 64c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-64 0z"]
};
const faTram = faCableCar;
const faCloudRain = {
  prefix: 'fas',
  iconName: 'cloud-rain',
  icon: [512, 512, [127783, 9926], "f73d", "M96 320c-53 0-96-43-96-96c0-42.5 27.6-78.6 65.9-91.2C64.7 126.1 64 119.1 64 112C64 50.1 114.1 0 176 0c43.1 0 80.5 24.3 99.2 60c14.7-17.1 36.5-28 60.8-28c44.2 0 80 35.8 80 80c0 5.5-.6 10.8-1.6 16c.5 0 1.1 0 1.6 0c53 0 96 43 96 96s-43 96-96 96L96 320zm-6.8 52c1.3-2.5 3.9-4 6.8-4s5.4 1.5 6.8 4l35.1 64.6c4.1 7.5 6.2 15.8 6.2 24.3l0 3c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-3c0-8.5 2.1-16.9 6.2-24.3L89.2 372zm160 0c1.3-2.5 3.9-4 6.8-4s5.4 1.5 6.8 4l35.1 64.6c4.1 7.5 6.2 15.8 6.2 24.3l0 3c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-3c0-8.5 2.1-16.9 6.2-24.3L249.2 372zm124.9 64.6L409.2 372c1.3-2.5 3.9-4 6.8-4s5.4 1.5 6.8 4l35.1 64.6c4.1 7.5 6.2 15.8 6.2 24.3l0 3c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-3c0-8.5 2.1-16.9 6.2-24.3z"]
};
const faBuildingCircleXmark = {
  prefix: 'fas',
  iconName: 'building-circle-xmark',
  icon: [640, 512, [], "e4d4", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c15.1 0 28.5-6.9 37.3-17.8C340.4 462.2 320 417.5 320 368c0-54.7 24.9-103.5 64-135.8L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faShip = {
  prefix: 'fas',
  iconName: 'ship',
  icon: [576, 512, [128674], "f21a", "M192 32c0-17.7 14.3-32 32-32L352 0c17.7 0 32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 128 44.4 14.8c23.1 7.7 29.5 37.5 11.5 53.9l-101 92.6c-16.2 9.4-34.7 15.1-50.9 15.1c-19.6 0-40.8-7.7-59.2-20.3c-22.1-15.5-51.6-15.5-73.7 0c-17.1 11.8-38 20.3-59.2 20.3c-16.2 0-34.7-5.7-50.9-15.1l-101-92.6c-18-16.5-11.6-46.2 11.5-53.9L96 240l0-128c0-26.5 21.5-48 48-48l48 0 0-32zM160 218.7l107.8-35.9c13.1-4.4 27.3-4.4 40.5 0L416 218.7l0-90.7-256 0 0 90.7zM306.5 421.9C329 437.4 356.5 448 384 448c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 501.7 417 512 384 512c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 437.2 165.1 448 192 448c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faArrowsDownToLine = {
  prefix: 'fas',
  iconName: 'arrows-down-to-line',
  icon: [576, 512, [], "e4b8", "M544 416L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32zm22.6-137.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L480 274.7 480 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7-41.4-41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96zm-320-45.3c-12.5-12.5-32.8-12.5-45.3 0L160 274.7 160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7L54.6 233.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3z"]
};
const faDownload = {
  prefix: 'fas',
  iconName: 'download',
  icon: [512, 512, [], "f019", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faFaceGrin = {
  prefix: 'fas',
  iconName: 'face-grin',
  icon: [512, 512, [128512, "grin"], "f580", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGrin = faFaceGrin;
const faDeleteLeft = {
  prefix: 'fas',
  iconName: 'delete-left',
  icon: [576, 512, [9003, "backspace"], "f55a", "M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faBackspace = faDeleteLeft;
const faEyeDropper = {
  prefix: 'fas',
  iconName: 'eye-dropper',
  icon: [512, 512, ["eye-dropper-empty", "eyedropper"], "f1fb", "M341.6 29.2L240.1 130.8l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4L482.8 170.4c39-39 39-102.2 0-141.1s-102.2-39-141.1 0zM55.4 323.3c-15 15-23.4 35.4-23.4 56.6l0 42.4L5.4 462.2c-8.5 12.7-6.8 29.6 4 40.4s27.7 12.5 40.4 4L89.7 480l42.4 0c21.2 0 41.6-8.4 56.6-23.4L309.4 335.9l-45.3-45.3L143.4 411.3c-3 3-7.1 4.7-11.3 4.7L96 416l0-36.1c0-4.2 1.7-8.3 4.7-11.3L221.4 247.9l-45.3-45.3L55.4 323.3z"]
};
const faEyeDropperEmpty = faEyeDropper;
const faEyedropper = faEyeDropper;
const faFileCircleCheck = {
  prefix: 'fas',
  iconName: 'file-circle-check',
  icon: [576, 512, [], "e5a0", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L416 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faForward = {
  prefix: 'fas',
  iconName: 'forward',
  icon: [512, 512, [9193], "f04e", "M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416L0 96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3l0 41.7 0 41.7L52.5 440.6zM256 352l0-96 0-128 0-32c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29l0-64z"]
};
const faMobile = {
  prefix: 'fas',
  iconName: 'mobile',
  icon: [384, 512, [128241, "mobile-android", "mobile-phone"], "f3ce", "M80 0C44.7 0 16 28.7 16 64l0 384c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L80 0zm80 432l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faMobileAndroid = faMobile;
const faMobilePhone = faMobile;
const faFaceMeh = {
  prefix: 'fas',
  iconName: 'face-meh',
  icon: [512, 512, [128528, "meh"], "f11a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM160 336l192 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faMeh = faFaceMeh;
const faAlignCenter = {
  prefix: 'fas',
  iconName: 'align-center',
  icon: [448, 512, [], "f037", "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"]
};
const faBookSkull = {
  prefix: 'fas',
  iconName: 'book-skull',
  icon: [448, 512, ["book-dead"], "f6b7", "M0 96C0 43 43 0 96 0L384 0l32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32zM320 112c0-35.3-35.8-64-80-64s-80 28.7-80 64c0 20.9 12.6 39.5 32 51.2l0 12.8c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-12.8c19.4-11.7 32-30.3 32-51.2zM208 96a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM134.3 209.3c-8.1-3.5-17.5 .3-21 8.4s.3 17.5 8.4 21L199.4 272l-77.7 33.3c-8.1 3.5-11.9 12.9-8.4 21s12.9 11.9 21 8.4L240 289.4l105.7 45.3c8.1 3.5 17.5-.3 21-8.4s-.3-17.5-8.4-21L280.6 272l77.7-33.3c8.1-3.5 11.9-12.9 8.4-21s-12.9-11.9-21-8.4L240 254.6 134.3 209.3z"]
};
const faBookDead = faBookSkull;
const faIdCard = {
  prefix: 'fas',
  iconName: 'id-card',
  icon: [576, 512, [62147, "drivers-license"], "f2c2", "M0 96l576 0c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96zm0 32L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-288L0 128zM64 405.3c0-29.5 23.9-53.3 53.3-53.3l117.3 0c29.5 0 53.3 23.9 53.3 53.3c0 5.9-4.8 10.7-10.7 10.7L74.7 416c-5.9 0-10.7-4.8-10.7-10.7zM176 192a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm176 16c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16z"]
};
const faDriversLicense = faIdCard;
const faOutdent = {
  prefix: 'fas',
  iconName: 'outdent',
  icon: [448, 512, ["dedent"], "f03b", "M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM.2 268.6c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6l0 158.6c0 13.3-15.3 20.8-25.8 12.6L.2 268.6z"]
};
const faDedent = faOutdent;
const faHeartCircleExclamation = {
  prefix: 'fas',
  iconName: 'heart-circle-exclamation',
  icon: [576, 512, [], "e4fe", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faHouse = {
  prefix: 'fas',
  iconName: 'house',
  icon: [576, 512, [127968, 63498, 63500, "home", "home-alt", "home-lg-alt"], "f015", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c0 2.7-.2 5.4-.5 8.1l0 16.2c0 22.1-17.9 40-40 40l-16 0c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1L416 512l-24 0c-22.1 0-40-17.9-40-40l0-24 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"]
};
const faHome = faHouse;
const faHomeAlt = faHouse;
const faHomeLgAlt = faHouse;
const faCalendarWeek = {
  prefix: 'fas',
  iconName: 'calendar-week',
  icon: [448, 512, [], "f784", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm80 64c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16L80 256z"]
};
const faLaptopMedical = {
  prefix: 'fas',
  iconName: 'laptop-medical',
  icon: [640, 512, [], "f812", "M64 96c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 256-64 0 0-256L128 96l0 256-64 0L64 96zM0 403.2C0 392.6 8.6 384 19.2 384l601.6 0c10.6 0 19.2 8.6 19.2 19.2c0 42.4-34.4 76.8-76.8 76.8L76.8 480C34.4 480 0 445.6 0 403.2zM288 160c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faB = {
  prefix: 'fas',
  iconName: 'b',
  icon: [320, 512, [98], "42", "M64 32C28.7 32 0 60.7 0 96L0 256 0 416c0 35.3 28.7 64 64 64l128 0c70.7 0 128-57.3 128-128c0-46.5-24.8-87.3-62-109.7c18.7-22.3 30-51 30-82.3c0-70.7-57.3-128-128-128L64 32zm96 192l-96 0L64 96l96 0c35.3 0 64 28.7 64 64s-28.7 64-64 64zM64 288l96 0 32 0c35.3 0 64 28.7 64 64s-28.7 64-64 64L64 416l0-128z"]
};
const faFileMedical = {
  prefix: 'fas',
  iconName: 'file-medical',
  icon: [384, 512, [], "f477", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM160 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faDiceOne = {
  prefix: 'fas',
  iconName: 'dice-one',
  icon: [448, 512, [9856], "f525", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM224 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faKiwiBird = {
  prefix: 'fas',
  iconName: 'kiwi-bird',
  icon: [576, 512, [], "f535", "M291.2 388.4c31.2-18.8 64.7-36.4 101.1-36.4l55.7 0c4.6 0 9.1-.2 13.6-.7l85.3 121.9c4 5.7 11.3 8.2 17.9 6.1s11.2-8.3 11.2-15.3l0-240c0-70.7-57.3-128-128-128l-55.7 0c-36.4 0-69.9-17.6-101.1-36.4C262.3 42.1 228.3 32 192 32C86 32 0 118 0 224c0 71.1 38.6 133.1 96 166.3L96 456c0 13.3 10.7 24 24 24s24-10.7 24-24l0-46c15.3 3.9 31.4 6 48 6c5.4 0 10.7-.2 16-.7l0 40.7c0 13.3 10.7 24 24 24s24-10.7 24-24l0-50.9c12.4-4.4 24.2-10 35.2-16.7zM448 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faArrowRightArrowLeft = {
  prefix: 'fas',
  iconName: 'arrow-right-arrow-left',
  icon: [448, 512, [8644, "exchange"], "f0ec", "M438.6 150.6c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.7 96 32 96C14.3 96 0 110.3 0 128s14.3 32 32 32l306.7 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l96-96zm-333.3 352c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 416 416 416c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96z"]
};
const faExchange = faArrowRightArrowLeft;
const faRotateRight = {
  prefix: 'fas',
  iconName: 'rotate-right',
  icon: [512, 512, ["redo-alt", "rotate-forward"], "f2f9", "M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"]
};
const faRedoAlt = faRotateRight;
const faRotateForward = faRotateRight;
const faUtensils = {
  prefix: 'fas',
  iconName: 'utensils',
  icon: [448, 512, [127860, 61685, "cutlery"], "f2e7", "M416 0C400 0 288 32 288 176l0 112c0 35.3 28.7 64 64 64l32 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 0-112 0-208c0-17.7-14.3-32-32-32zM64 16C64 7.8 57.9 1 49.7 .1S34.2 4.6 32.4 12.5L2.1 148.8C.7 155.1 0 161.5 0 167.9c0 45.9 35.1 83.6 80 87.7L80 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224.4c44.9-4.1 80-41.8 80-87.7c0-6.4-.7-12.8-2.1-19.1L191.6 12.5c-1.8-8-9.3-13.3-17.4-12.4S160 7.8 160 16l0 134.2c0 5.4-4.4 9.8-9.8 9.8c-5.1 0-9.3-3.9-9.8-9L127.9 14.6C127.2 6.3 120.3 0 112 0s-15.2 6.3-15.9 14.6L83.7 151c-.5 5.1-4.7 9-9.8 9c-5.4 0-9.8-4.4-9.8-9.8L64 16zm48.3 152l-.3 0-.3 0 .3-.7 .3 .7z"]
};
const faCutlery = faUtensils;
const faArrowUpWideShort = {
  prefix: 'fas',
  iconName: 'arrow-up-wide-short',
  icon: [576, 512, ["sort-amount-up"], "f161", "M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 480l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32z"]
};
const faSortAmountUp = faArrowUpWideShort;
const faMillSign = {
  prefix: 'fas',
  iconName: 'mill-sign',
  icon: [384, 512, [], "e1ed", "M302.1 42.8c5.9-16.6-2.7-35-19.4-40.9s-35 2.7-40.9 19.4L208 116.1c-5.7 4-11.1 8.5-16 13.5C171.7 108.9 143.3 96 112 96c-19.5 0-37.8 5-53.7 13.7C52.5 101.4 42.9 96 32 96C14.3 96 0 110.3 0 128l0 80L0 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-208c0-26.5 21.5-48 48-48s48 21.5 48 48l0 42.5L81.9 469.2c-5.9 16.6 2.7 35 19.4 40.9s35-2.7 40.9-19.4l21.4-60C168.9 441 179.6 448 192 448c17.7 0 32-14.3 32-32l0-154.5 35.7-100c3.9-1 8.1-1.6 12.3-1.6c26.5 0 48 21.5 48 48l0 208c0 17.7 14.3 32 32 32s32-14.3 32-32l0-208c0-58.2-44.3-106-101.1-111.5l19.2-53.8z"]
};
const faBowlRice = {
  prefix: 'fas',
  iconName: 'bowl-rice',
  icon: [512, 512, [], "e2eb", "M176 56c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm24 48l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM56 176l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM0 283.4C0 268.3 12.3 256 27.4 256l457.1 0c15.1 0 27.4 12.3 27.4 27.4c0 70.5-44.4 130.7-106.7 154.1L403.5 452c-2 16-15.6 28-31.8 28l-231.5 0c-16.1 0-29.8-12-31.8-28l-1.8-14.4C44.4 414.1 0 353.9 0 283.4zM224 200c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm-96 0c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm-24-96l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm216 96c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm-24-96l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm120 96c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm-24-96l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM296 32l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faSkull = {
  prefix: 'fas',
  iconName: 'skull',
  icon: [512, 512, [128128], "f54c", "M416 398.9c58.5-41.1 96-104.1 96-174.9C512 100.3 397.4 0 256 0S0 100.3 0 224c0 70.7 37.5 133.8 96 174.9c0 .4 0 .7 0 1.1l0 64c0 26.5 21.5 48 48 48l48 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16l0 48 64 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16l0 48 48 0c26.5 0 48-21.5 48-48l0-64c0-.4 0-.7 0-1.1zM96 256a64 64 0 1 1 128 0A64 64 0 1 1 96 256zm256-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faTowerBroadcast = {
  prefix: 'fas',
  iconName: 'tower-broadcast',
  icon: [576, 512, ["broadcast-tower"], "f519", "M80.3 44C69.8 69.9 64 98.2 64 128s5.8 58.1 16.3 84c6.6 16.4-1.3 35-17.7 41.7s-35-1.3-41.7-17.7C7.4 202.6 0 166.1 0 128S7.4 53.4 20.9 20C27.6 3.6 46.2-4.3 62.6 2.3S86.9 27.6 80.3 44zM555.1 20C568.6 53.4 576 89.9 576 128s-7.4 74.6-20.9 108c-6.6 16.4-25.3 24.3-41.7 17.7S489.1 228.4 495.7 212c10.5-25.9 16.3-54.2 16.3-84s-5.8-58.1-16.3-84C489.1 27.6 497 9 513.4 2.3s35 1.3 41.7 17.7zM352 128c0 23.7-12.9 44.4-32 55.4L320 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-296.6c-19.1-11.1-32-31.7-32-55.4c0-35.3 28.7-64 64-64s64 28.7 64 64zM170.6 76.8C163.8 92.4 160 109.7 160 128s3.8 35.6 10.6 51.2c7.1 16.2-.3 35.1-16.5 42.1s-35.1-.3-42.1-16.5c-10.3-23.6-16-49.6-16-76.8s5.7-53.2 16-76.8c7.1-16.2 25.9-23.6 42.1-16.5s23.6 25.9 16.5 42.1zM464 51.2c10.3 23.6 16 49.6 16 76.8s-5.7 53.2-16 76.8c-7.1 16.2-25.9 23.6-42.1 16.5s-23.6-25.9-16.5-42.1c6.8-15.6 10.6-32.9 10.6-51.2s-3.8-35.6-10.6-51.2c-7.1-16.2 .3-35.1 16.5-42.1s35.1 .3 42.1 16.5z"]
};
const faBroadcastTower = faTowerBroadcast;
const faTruckPickup = {
  prefix: 'fas',
  iconName: 'truck-pickup',
  icon: [640, 512, [128763], "f63c", "M368.6 96l76.8 96L288 192l0-96 80.6 0zM224 80l0 112L64 192c-17.7 0-32 14.3-32 32l0 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l33.1 0c-.7 5.2-1.1 10.6-1.1 16c0 61.9 50.1 112 112 112s112-50.1 112-112c0-5.4-.4-10.8-1.1-16l66.3 0c-.7 5.2-1.1 10.6-1.1 16c0 61.9 50.1 112 112 112s112-50.1 112-112c0-5.4-.4-10.8-1.1-16l33.1 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64c0-17.7-14.3-32-32-32l-48.6 0L418.6 56c-12.1-15.2-30.5-24-50-24L272 32c-26.5 0-48 21.5-48 48zm0 288a48 48 0 1 1 -96 0 48 48 0 1 1 96 0zm288 0a48 48 0 1 1 -96 0 48 48 0 1 1 96 0z"]
};
const faUpLong = {
  prefix: 'fas',
  iconName: 'up-long',
  icon: [320, 512, ["long-arrow-alt-up"], "f30c", "M318 177.5c3.8-8.8 2-19-4.6-26l-136-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-136 144c-6.6 7-8.4 17.2-4.6 26S14.4 192 24 192l72 0 0 288c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"]
};
const faLongArrowAltUp = faUpLong;
const faStop = {
  prefix: 'fas',
  iconName: 'stop',
  icon: [384, 512, [9209], "f04d", "M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"]
};
const faCodeMerge = {
  prefix: 'fas',
  iconName: 'code-merge',
  icon: [448, 512, [], "f387", "M80 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm32.4 97.2c28-12.4 47.6-40.5 47.6-73.2c0-44.2-35.8-80-80-80S0 35.8 0 80c0 32.8 19.7 61 48 73.3l0 205.3C19.7 371 0 399.2 0 432c0 44.2 35.8 80 80 80s80-35.8 80-80c0-32.8-19.7-61-48-73.3l0-86.6c26.7 20.1 60 32 96 32l86.7 0c12.3 28.3 40.5 48 73.3 48c44.2 0 80-35.8 80-80s-35.8-80-80-80c-32.8 0-61 19.7-73.3 48L208 240c-49.9 0-91-38.1-95.6-86.8zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM344 272a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faUpload = {
  prefix: 'fas',
  iconName: 'upload',
  icon: [512, 512, [], "f093", "M288 109.3L288 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-242.7-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352l128 0c0 35.3 28.7 64 64 64s64-28.7 64-64l128 0c35.3 0 64 28.7 64 64l0 32c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64l0-32c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faHurricane = {
  prefix: 'fas',
  iconName: 'hurricane',
  icon: [384, 512, [], "f751", "M0 208C0 104.4 75.7 18.5 174.9 2.6C184 1.2 192 8.6 192 17.9l0 63.3c0 8.4 6.5 15.3 14.7 16.5C307 112.5 384 199 384 303.4c0 103.6-75.7 189.5-174.9 205.4c-9.2 1.5-17.1-5.9-17.1-15.2l0-63.3c0-8.4-6.5-15.3-14.7-16.5C77 398.9 0 312.4 0 208zm288 48A96 96 0 1 0 96 256a96 96 0 1 0 192 0zm-96-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faMound = {
  prefix: 'fas',
  iconName: 'mound',
  icon: [576, 512, [], "e52d", "M144.1 179.2C173.8 127.7 228.6 96 288 96s114.2 31.7 143.9 83.2L540.4 368c12.3 21.3-3.1 48-27.7 48H63.3c-24.6 0-40-26.6-27.7-48L144.1 179.2z"]
};
const faToiletPortable = {
  prefix: 'fas',
  iconName: 'toilet-portable',
  icon: [320, 512, [], "e583", "M0 32L0 64l320 0 0-32c0-17.7-14.3-32-32-32L32 0C14.3 0 0 14.3 0 32zM24 96L0 96l0 24L0 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8 224 0 0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-368 0-24-24 0L24 96zM256 240l0 64c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faCompactDisc = {
  prefix: 'fas',
  iconName: 'compact-disc',
  icon: [512, 512, [128191, 128192, 128440], "f51f", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 32a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm-96-32a96 96 0 1 0 192 0 96 96 0 1 0 -192 0zM96 240c0-35 17.5-71.1 45.2-98.8S205 96 240 96c8.8 0 16-7.2 16-16s-7.2-16-16-16c-45.4 0-89.2 22.3-121.5 54.5S64 194.6 64 240c0 8.8 7.2 16 16 16s16-7.2 16-16z"]
};
const faFileArrowDown = {
  prefix: 'fas',
  iconName: 'file-arrow-down',
  icon: [384, 512, ["file-download"], "f56d", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM216 232l0 102.1 31-31c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-72 72c-9.4 9.4-24.6 9.4-33.9 0l-72-72c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l31 31L168 232c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faFileDownload = faFileArrowDown;
const faCaravan = {
  prefix: 'fas',
  iconName: 'caravan',
  icon: [640, 512, [], "f8ff", "M0 112C0 67.8 35.8 32 80 32l336 0c88.4 0 160 71.6 160 160l0 160 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0-288 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-44.2 0-80-35.8-80-80L0 112zM320 352l128 0 0-96-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l32 0 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 192zM96 128c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L96 128zm96 336a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faShieldCat = {
  prefix: 'fas',
  iconName: 'shield-cat',
  icon: [512, 512, [], "e572", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM160 154.4c0-5.8 4.7-10.4 10.4-10.4l.2 0c3.4 0 6.5 1.6 8.5 4.3l40 53.3c3 4 7.8 6.4 12.8 6.4l48 0c5 0 9.8-2.4 12.8-6.4l40-53.3c2-2.7 5.2-4.3 8.5-4.3l.2 0c5.8 0 10.4 4.7 10.4 10.4L352 272c0 53-43 96-96 96s-96-43-96-96l0-117.6zM216 288a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm96-16a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faBolt = {
  prefix: 'fas',
  iconName: 'bolt',
  icon: [448, 512, [9889, "zap"], "f0e7", "M349.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.9 1.8l-256 224c-10 8.8-13.6 22.9-8.9 35.3S50.7 288 64 288l111.5 0L98.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.9-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7l-111.5 0L349.4 44.6z"]
};
const faZap = faBolt;
const faGlassWater = {
  prefix: 'fas',
  iconName: 'glass-water',
  icon: [384, 512, [], "e4f4", "M32 0C23.1 0 14.6 3.7 8.6 10.2S-.6 25.4 .1 34.3L28.9 437.7c3 41.9 37.8 74.3 79.8 74.3l166.6 0c42 0 76.8-32.4 79.8-74.3L383.9 34.3c.6-8.9-2.4-17.6-8.5-24.1S360.9 0 352 0L32 0zM73 156.5L66.4 64l251.3 0L311 156.5l-24.2 12.1c-19.4 9.7-42.2 9.7-61.6 0c-20.9-10.4-45.5-10.4-66.4 0c-19.4 9.7-42.2 9.7-61.6 0L73 156.5z"]
};
const faOilWell = {
  prefix: 'fas',
  iconName: 'oil-well',
  icon: [576, 512, [], "e532", "M528.3 61.3c-11.4-42.7-55.3-68-98-56.6L414.9 8.8C397.8 13.4 387.7 31 392.3 48l24.5 91.4L308.5 167.5l-6.3-18.1C297.7 136.6 285.6 128 272 128s-25.7 8.6-30.2 21.4l-13.6 39L96 222.6 96 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 264-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-137.3 0L340 257.5l-62.2 16.1L305.3 352l-66.6 0L265 277l-74.6 19.3L137.3 448 96 448l0-159.2 337.4-87.5 25.2 94c4.6 17.1 22.1 27.2 39.2 22.6l15.5-4.1c42.7-11.4 68-55.3 56.6-98L528.3 61.3zM205.1 448l11.2-32 111.4 0 11.2 32-133.8 0z"]
};
const faVault = {
  prefix: 'fas',
  iconName: 'vault',
  icon: [576, 512, [], "e2c5", "M64 0C28.7 0 0 28.7 0 64L0 416c0 35.3 28.7 64 64 64l16 0 16 32 64 0 16-32 224 0 16 32 64 0 16-32 16 0c35.3 0 64-28.7 64-64l0-352c0-35.3-28.7-64-64-64L64 0zM224 320a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-240a160 160 0 1 1 0 320 160 160 0 1 1 0-320zM480 221.3L480 336c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-114.7c-18.6-6.6-32-24.4-32-45.3c0-26.5 21.5-48 48-48s48 21.5 48 48c0 20.9-13.4 38.7-32 45.3z"]
};
const faMars = {
  prefix: 'fas',
  iconName: 'mars',
  icon: [448, 512, [9794], "f222", "M289.8 46.8c3.7-9 12.5-14.8 22.2-14.8l112 0c13.3 0 24 10.7 24 24l0 112c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-33.4-33.4L321 204.2c19.5 28.4 31 62.7 31 99.8c0 97.2-78.8 176-176 176S0 401.2 0 304s78.8-176 176-176c37 0 71.4 11.4 99.8 31l52.6-52.6L295 73c-6.9-6.9-8.9-17.2-5.2-26.2zM400 80s0 0 0 0s0 0 0 0s0 0 0 0zM176 416a112 112 0 1 0 0-224 112 112 0 1 0 0 224z"]
};
const faToilet = {
  prefix: 'fas',
  iconName: 'toilet',
  icon: [448, 512, [128701], "f7d8", "M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48l8 0 0 148.9c-1.9 1.4-3.8 2.9-5.6 4.4C10.9 214.5 0 232.9 0 256c0 46.9 14.3 84.1 37 112.5c14.2 17.7 31.1 31.3 48.5 41.8L65.6 469.9c-3.3 9.8-1.6 20.5 4.4 28.8s15.7 13.3 26 13.3l256 0c10.3 0 19.9-4.9 26-13.3s7.7-19.1 4.4-28.8l-19.8-59.5c17.4-10.5 34.3-24.1 48.5-41.8c22.7-28.4 37-65.5 37-112.5c0-23.1-10.9-41.5-26.4-54.6c-1.8-1.5-3.7-3-5.6-4.4L416 48l8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 0zM384 256.3c0 1-.3 2.6-3.8 5.6c-4.8 4.1-14 9-29.3 13.4C320.5 284 276.1 288 224 288s-96.5-4-126.9-12.8c-15.3-4.4-24.5-9.3-29.3-13.4c-3.5-3-3.8-4.6-3.8-5.6l0-.3c0 0 0-.1 0-.1c0-1 0-2.5 3.8-5.8c4.8-4.1 14-9 29.3-13.4C127.5 228 171.9 224 224 224s96.5 4 126.9 12.8c15.3 4.4 24.5 9.3 29.3 13.4c3.8 3.2 3.8 4.8 3.8 5.8c0 0 0 .1 0 .1l0 .3zM328.2 384l-.2 .5 0-.5 .2 0zM112 64l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faPlaneCircleXmark = {
  prefix: 'fas',
  iconName: 'plane-circle-xmark',
  icon: [640, 512, [], "e557", "M256 0c-35 0-64 59.5-64 93.7l0 84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9l0 65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8l0 42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3l0-84.6C320 59.5 292 0 256 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faYenSign = {
  prefix: 'fas',
  iconName: 'yen-sign',
  icon: [320, 512, [165, "cny", "jpy", "rmb", "yen"], "f157", "M58.6 46.3C48.8 31.5 29 27.6 14.2 37.4S-4.4 67 5.4 81.8L100.2 224 48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0 0 32-80 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 0-32 80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-52.2 0L314.6 81.8c9.8-14.7 5.8-34.6-8.9-44.4s-34.6-5.8-44.4 8.9L160 198.3 58.6 46.3z"]
};
const faCny = faYenSign;
const faJpy = faYenSign;
const faRmb = faYenSign;
const faYen = faYenSign;
const faRubleSign = {
  prefix: 'fas',
  iconName: 'ruble-sign',
  icon: [384, 512, [8381, "rouble", "rub", "ruble"], "f158", "M96 32C78.3 32 64 46.3 64 64l0 192-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-32 112 0c79.5 0 144-64.5 144-144s-64.5-144-144-144L96 32zM240 256l-112 0 0-160 112 0c44.2 0 80 35.8 80 80s-35.8 80-80 80z"]
};
const faRouble = faRubleSign;
const faRub = faRubleSign;
const faRuble = faRubleSign;
const faSun = {
  prefix: 'fas',
  iconName: 'sun',
  icon: [512, 512, [9728], "f185", "M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM160 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"]
};
const faGuitar = {
  prefix: 'fas',
  iconName: 'guitar',
  icon: [512, 512, [], "f7a6", "M465 7c-9.4-9.4-24.6-9.4-33.9 0L383 55c-2.4 2.4-4.3 5.3-5.5 8.5l-15.4 41-77.5 77.6c-45.1-29.4-99.3-30.2-131 1.6c-11 11-18 24.6-21.4 39.6c-3.7 16.6-19.1 30.7-36.1 31.6c-25.6 1.3-49.3 10.7-67.3 28.6C-16 328.4-7.6 409.4 47.5 464.5s136.1 63.5 180.9 18.7c17.9-17.9 27.4-41.7 28.6-67.3c.9-17 15-32.3 31.6-36.1c15-3.4 28.6-10.5 39.6-21.4c31.8-31.8 31-85.9 1.6-131l77.6-77.6 41-15.4c3.2-1.2 6.1-3.1 8.5-5.5l48-48c9.4-9.4 9.4-24.6 0-33.9L465 7zM208 256a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faFaceLaughWink = {
  prefix: 'fas',
  iconName: 'face-laugh-wink',
  icon: [512, 512, ["laugh-wink"], "f59c", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1l275.2 0c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zM144.4 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm156.4 25.6c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2c-17.6-23.5-52.8-23.5-70.4 0z"]
};
const faLaughWink = faFaceLaughWink;
const faHorseHead = {
  prefix: 'fas',
  iconName: 'horse-head',
  icon: [640, 512, [], "f7ab", "M64 464l0-147.1c0-108.4 68.3-205.1 170.5-241.3L404.2 15.5C425.6 7.9 448 23.8 448 46.4c0 11-5.5 21.2-14.6 27.3L400 96c48.1 0 91.2 29.8 108.1 74.9l48.6 129.5c11.8 31.4 4.1 66.8-19.6 90.5c-16 16-37.8 25.1-60.5 25.1l-3.4 0c-26.1 0-50.9-11.6-67.6-31.7l-32.3-38.7c-11.7 4.1-24.2 6.4-37.3 6.4c0 0 0 0-.1 0c0 0 0 0 0 0c-6.3 0-12.5-.5-18.6-1.5c-3.6-.6-7.2-1.4-10.7-2.3c0 0 0 0 0 0c-28.9-7.8-53.1-26.8-67.8-52.2c-4.4-7.6-14.2-10.3-21.9-5.8s-10.3 14.2-5.8 21.9c24 41.5 68.3 70 119.3 71.9l47.2 70.8c4 6.1 6.2 13.2 6.2 20.4c0 20.3-16.5 36.8-36.8 36.8L112 512c-26.5 0-48-21.5-48-48zM392 224a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faBoreHole = {
  prefix: 'fas',
  iconName: 'bore-hole',
  icon: [512, 512, [], "e4c3", "M256 0c-17.7 0-32 14.3-32 32l0 264.6c-19.1 11.1-32 31.7-32 55.4c0 35.3 28.7 64 64 64s64-28.7 64-64c0-23.7-12.9-44.4-32-55.4L288 32c0-17.7-14.3-32-32-32zM48 128c-26.5 0-48 21.5-48 48L0 464c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-80 0c-17.7 0-32 14.3-32 32l0 192c0 53-43 96-96 96s-96-43-96-96l0-192c0-17.7-14.3-32-32-32l-80 0z"]
};
const faIndustry = {
  prefix: 'fas',
  iconName: 'industry',
  icon: [576, 512, [], "f275", "M64 32C46.3 32 32 46.3 32 64l0 240 0 48 0 80c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-128 0-151.8c0-18.2-19.4-29.7-35.4-21.1L352 215.4l0-63.2c0-18.2-19.4-29.7-35.4-21.1L160 215.4 160 64c0-17.7-14.3-32-32-32L64 32z"]
};
const faCircleDown = {
  prefix: 'fas',
  iconName: 'circle-down',
  icon: [512, 512, [61466, "arrow-alt-circle-down"], "f358", "M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM244.7 395.3l-112-112c-4.6-4.6-5.9-11.5-3.5-17.4s8.3-9.9 14.8-9.9l64 0 0-96c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 96 64 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-112 112c-6.2 6.2-16.4 6.2-22.6 0z"]
};
const faArrowAltCircleDown = faCircleDown;
const faArrowsTurnToDots = {
  prefix: 'fas',
  iconName: 'arrows-turn-to-dots',
  icon: [512, 512, [], "e4c1", "M249.4 25.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L269.3 96 416 96c53 0 96 43 96 96l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-17.7-14.3-32-32-32l-146.7 0 25.4 25.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3l80-80zm13.3 256l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 416 96 416c-17.7 0-32 14.3-32 32l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-53 43-96 96-96l146.7 0-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0zM384 384a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM64 192A64 64 0 1 1 64 64a64 64 0 1 1 0 128z"]
};
const faFlorinSign = {
  prefix: 'fas',
  iconName: 'florin-sign',
  icon: [384, 512, [], "e184", "M314.7 32c-38.8 0-73.7 23.3-88.6 59.1L170.7 224 64 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0L98.9 396.3c-5 11.9-16.6 19.7-29.5 19.7L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l37.3 0c38.8 0 73.7-23.3 88.6-59.1L213.3 288 320 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 45.1-108.3c5-11.9 16.6-19.7 29.5-19.7L352 96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-37.3 0z"]
};
const faArrowDownShortWide = {
  prefix: 'fas',
  iconName: 'arrow-down-short-wide',
  icon: [576, 512, ["sort-amount-desc", "sort-amount-down-alt"], "f884", "M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faSortAmountDesc = faArrowDownShortWide;
const faSortAmountDownAlt = faArrowDownShortWide;
const faLessThan = {
  prefix: 'fas',
  iconName: 'less-than',
  icon: [384, 512, [62774], "3c", "M380.6 81.7c7.9 15.8 1.5 35-14.3 42.9L103.6 256 366.3 387.4c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3l-320-160C6.8 279.2 0 268.1 0 256s6.8-23.2 17.7-28.6l320-160c15.8-7.9 35-1.5 42.9 14.3z"]
};
const faAngleDown = {
  prefix: 'fas',
  iconName: 'angle-down',
  icon: [448, 512, [8964], "f107", "M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]
};
const faCarTunnel = {
  prefix: 'fas',
  iconName: 'car-tunnel',
  icon: [512, 512, [], "e4de", "M256 0C114.6 0 0 114.6 0 256L0 448c0 35.3 28.7 64 64 64l42.8 0c-6.6-5.9-10.8-14.4-10.8-24l0-112c0-20.8 11.3-38.9 28.1-48.6l21-64.7c7.5-23.1 29-38.7 53.3-38.7l115.2 0c24.3 0 45.8 15.6 53.3 38.7l21 64.7c16.8 9.7 28.2 27.8 28.2 48.6l0 112c0 9.6-4.2 18.1-10.8 24l42.8 0c35.3 0 64-28.7 64-64l0-192C512 114.6 397.4 0 256 0zM362.8 512c-6.6-5.9-10.8-14.4-10.8-24l0-40-192 0 0 40c0 9.6-4.2 18.1-10.8 24l213.7 0zM190.8 277.5L177 320l158 0-13.8-42.5c-1.1-3.3-4.1-5.5-7.6-5.5l-115.2 0c-3.5 0-6.5 2.2-7.6 5.5zM168 408a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm200-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faHeadSideCough = {
  prefix: 'fas',
  iconName: 'head-side-cough',
  icon: [640, 512, [], "e061", "M0 224.2C0 100.6 100.2 0 224 0l24 0c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8L448 320s0 0 0 0l0 32L339.2 365.6c-11 1.4-19.2 10.7-19.2 21.8c0 11.6 9 21.2 20.6 21.9L448 416l0 16c0 26.5-21.5 48-48 48l-80 0 0 8c0 13.3-10.7 24-24 24l-40 0s0 0 0 0L96 512c-17.7 0-32-14.3-32-32l0-72.7c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zm352-.2a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM464 384a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm152-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM592 480a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM552 312a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40-24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM552 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faGripLines = {
  prefix: 'fas',
  iconName: 'grip-lines',
  icon: [448, 512, [], "f7a4", "M32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 288zm0-128c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z"]
};
const faThumbsDown = {
  prefix: 'fas',
  iconName: 'thumbs-down',
  icon: [512, 512, [128078, 61576], "f165", "M313.4 479.1c26-5.2 42.9-30.5 37.7-56.5l-2.3-11.4c-5.3-26.7-15.1-52.1-28.8-75.2l144 0c26.5 0 48-21.5 48-48c0-18.5-10.5-34.6-25.9-42.6C497 236.6 504 223.1 504 208c0-23.4-16.8-42.9-38.9-47.1c4.4-7.3 6.9-15.8 6.9-24.9c0-21.3-13.9-39.4-33.1-45.6c.7-3.3 1.1-6.8 1.1-10.4c0-26.5-21.5-48-48-48l-97.5 0c-19 0-37.5 5.6-53.3 16.1L202.7 73.8C176 91.6 160 121.6 160 153.7l0 38.3 0 48 0 24.9c0 29.2 13.3 56.7 36 75l7.4 5.9c26.5 21.2 44.6 51 51.2 84.2l2.3 11.4c5.2 26 30.5 42.9 56.5 37.7zM32 384l64 0c17.7 0 32-14.3 32-32l0-224c0-17.7-14.3-32-32-32L32 96C14.3 96 0 110.3 0 128L0 352c0 17.7 14.3 32 32 32z"]
};
const faUserLock = {
  prefix: 'fas',
  iconName: 'user-lock',
  icon: [640, 512, [], "f502", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l362.8 0c-5.4-9.4-8.6-20.3-8.6-32l0-128c0-2.1 .1-4.2 .3-6.3c-31-26-71-41.7-114.6-41.7l-91.4 0zM528 240c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faArrowRightLong = {
  prefix: 'fas',
  iconName: 'arrow-right-long',
  icon: [512, 512, ["long-arrow-right"], "f178", "M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]
};
const faLongArrowRight = faArrowRightLong;
const faAnchorCircleXmark = {
  prefix: 'fas',
  iconName: 'anchor-circle-xmark',
  icon: [640, 512, [], "e4ac", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c8.2 0 16.3-.6 24.2-1.8c-22.2-16.2-40.4-37.5-53-62.2L320 448l0-80 0-128 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faEllipsis = {
  prefix: 'fas',
  iconName: 'ellipsis',
  icon: [448, 512, ["ellipsis-h"], "f141", "M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"]
};
const faEllipsisH = faEllipsis;
const faChessPawn = {
  prefix: 'fas',
  iconName: 'chess-pawn',
  icon: [320, 512, [9823], "f443", "M215.5 224c29.2-18.4 48.5-50.9 48.5-88c0-57.4-46.6-104-104-104S56 78.6 56 136c0 37.1 19.4 69.6 48.5 88L96 224c-17.7 0-32 14.3-32 32c0 16.5 12.5 30 28.5 31.8L80 400l160 0L227.5 287.8c16-1.8 28.5-15.3 28.5-31.8c0-17.7-14.3-32-32-32l-8.5 0zM22.6 473.4c-4.2 4.2-6.6 10-6.6 16C16 501.9 26.1 512 38.6 512l242.7 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L256 432 64 432 22.6 473.4z"]
};
const faKitMedical = {
  prefix: 'fas',
  iconName: 'kit-medical',
  icon: [576, 512, ["first-aid"], "f479", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l32 0L96 32 64 32zm64 0l0 448 320 0 0-448L128 32zM512 480c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-32 0 0 448 32 0zM256 176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faFirstAid = faKitMedical;
const faPersonThroughWindow = {
  prefix: 'fas',
  iconName: 'person-through-window',
  icon: [640, 512, [], "e5a9", "M64 64l224 0 0 9.8c0 39-23.7 74-59.9 88.4C167.6 186.5 128 245 128 310.2l0 73.8s0 0 0 0l-64 0L64 64zm288 0l224 0 0 320-67.7 0-3.7-4.5-75.2-90.2c-9.1-10.9-22.6-17.3-36.9-17.3l-71.1 0-41-63.1c-.3-.5-.6-1-1-1.4c44.7-29 72.5-79 72.5-133.6l0-9.8zm73 320l-45.8 0 42.7 64L592 448c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48L48 0C21.5 0 0 21.5 0 48L0 400c0 26.5 21.5 48 48 48l260.2 0 33.2 49.8c9.8 14.7 29.7 18.7 44.4 8.9s18.7-29.7 8.9-44.4L310.5 336l74.6 0 40 48zm-159.5 0L192 384s0 0 0 0l0-73.8c0-10.2 1.6-20.1 4.7-29.5L265.5 384zM192 128a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faToolbox = {
  prefix: 'fas',
  iconName: 'toolbox',
  icon: [512, 512, [129520], "f552", "M176 88l0 40 160 0 0-40c0-4.4-3.6-8-8-8L184 80c-4.4 0-8 3.6-8 8zm-48 40l0-40c0-30.9 25.1-56 56-56l144 0c30.9 0 56 25.1 56 56l0 40 28.1 0c12.7 0 24.9 5.1 33.9 14.1l51.9 51.9c9 9 14.1 21.2 14.1 33.9l0 92.1-128 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32-128 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L0 320l0-92.1c0-12.7 5.1-24.9 14.1-33.9l51.9-51.9c9-9 21.2-14.1 33.9-14.1l28.1 0zM0 416l0-64 128 0c0 17.7 14.3 32 32 32s32-14.3 32-32l128 0c0 17.7 14.3 32 32 32s32-14.3 32-32l128 0 0 64c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64z"]
};
const faHandsHoldingCircle = {
  prefix: 'fas',
  iconName: 'hands-holding-circle',
  icon: [640, 512, [], "e4fb", "M320 0a128 128 0 1 1 0 256A128 128 0 1 1 320 0zM40 64c22.1 0 40 17.9 40 40l0 40 0 80 0 40.2c0 17 6.7 33.3 18.7 45.3l51.1 51.1c8.3 8.3 21.3 9.6 31 3.1c12.9-8.6 14.7-26.9 3.7-37.8l-15.2-15.2-32-32c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l32 32 15.2 15.2c0 0 0 0 0 0l25.3 25.3c21 21 32.8 49.5 32.8 79.2l0 78.9c0 26.5-21.5 48-48 48l-66.7 0c-17 0-33.3-6.7-45.3-18.7L28.1 393.4C10.1 375.4 0 351 0 325.5L0 224l0-64 0-56C0 81.9 17.9 64 40 64zm560 0c22.1 0 40 17.9 40 40l0 56 0 64 0 101.5c0 25.5-10.1 49.9-28.1 67.9L512 493.3c-12 12-28.3 18.7-45.3 18.7L400 512c-26.5 0-48-21.5-48-48l0-78.9c0-29.7 11.8-58.2 32.8-79.2l25.3-25.3c0 0 0 0 0 0l15.2-15.2 32-32c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-32 32-15.2 15.2c-11 11-9.2 29.2 3.7 37.8c9.7 6.5 22.7 5.2 31-3.1l51.1-51.1c12-12 18.7-28.3 18.7-45.3l0-40.2 0-80 0-40c0-22.1 17.9-40 40-40z"]
};
const faBug = {
  prefix: 'fas',
  iconName: 'bug',
  icon: [512, 512, [], "f188", "M256 0c53 0 96 43 96 96l0 3.6c0 15.7-12.7 28.4-28.4 28.4l-135.1 0c-15.7 0-28.4-12.7-28.4-28.4l0-3.6c0-53 43-96 96-96zM41.4 105.4c12.5-12.5 32.8-12.5 45.3 0l64 64c.7 .7 1.3 1.4 1.9 2.1c14.2-7.3 30.4-11.4 47.5-11.4l112 0c17.1 0 33.2 4.1 47.5 11.4c.6-.7 1.2-1.4 1.9-2.1l64-64c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-64 64c-.7 .7-1.4 1.3-2.1 1.9c6.2 12 10.1 25.3 11.1 39.5l64.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c0 24.6-5.5 47.8-15.4 68.6c2.2 1.3 4.2 2.9 6 4.8l64 64c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-63.1-63.1c-24.5 21.8-55.8 36.2-90.3 39.6L272 240c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 239.2c-34.5-3.4-65.8-17.8-90.3-39.6L86.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l64-64c1.9-1.9 3.9-3.4 6-4.8C101.5 367.8 96 344.6 96 320l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64.3 0c1.1-14.1 5-27.5 11.1-39.5c-.7-.6-1.4-1.2-2.1-1.9l-64-64c-12.5-12.5-12.5-32.8 0-45.3z"]
};
const faCreditCard = {
  prefix: 'fas',
  iconName: 'credit-card',
  icon: [576, 512, [128179, 62083, "credit-card-alt"], "f09d", "M64 32C28.7 32 0 60.7 0 96l0 32 576 0 0-32c0-35.3-28.7-64-64-64L64 32zM576 224L0 224 0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-192zM112 352l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm112 16c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16z"]
};
const faCreditCardAlt = faCreditCard;
const faCar = {
  prefix: 'fas',
  iconName: 'car',
  icon: [512, 512, [128664, "automobile"], "f1b9", "M135.2 117.4L109.1 192l293.8 0-26.1-74.6C372.3 104.6 360.2 96 346.6 96L165.4 96c-13.6 0-25.7 8.6-30.2 21.4zM39.6 196.8L74.8 96.3C88.3 57.8 124.6 32 165.4 32l181.2 0c40.8 0 77.1 25.8 90.6 64.3l35.2 100.5c23.2 9.6 39.6 32.5 39.6 59.2l0 144 0 48c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-48L96 400l0 48c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-48L0 256c0-26.7 16.4-49.6 39.6-59.2zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faAutomobile = faCar;
const faHandHoldingHand = {
  prefix: 'fas',
  iconName: 'hand-holding-hand',
  icon: [576, 512, [], "e4f7", "M7.8 207.7c-13.1-17.8-9.3-42.8 8.5-55.9L142.9 58.5C166.2 41.3 194.5 32 223.5 32L384 32l160 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-36.8 0-44.9 36c-22.7 18.2-50.9 28-80 28L304 224l-16 0-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0 16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-120.6 0L63.7 216.2c-17.8 13.1-42.8 9.3-55.9-8.5zM382.4 160c0 0 0 0 0 0l.9 0c-.3 0-.6 0-.9 0zM568.2 304.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 453.5c-23.4 17.2-51.6 26.5-80.7 26.5L192 480 32 480c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l36.8 0 44.9-36c22.7-18.2 50.9-28 80-28l78.3 0 16 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l120.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 352c0 0 0 0 0 0l-.9 0c.3 0 .6 0 .9 0z"]
};
const faBookOpenReader = {
  prefix: 'fas',
  iconName: 'book-open-reader',
  icon: [512, 512, ["book-reader"], "f5da", "M160 96a96 96 0 1 1 192 0A96 96 0 1 1 160 96zm80 152l0 264-48.4-24.2c-20.9-10.4-43.5-17-66.8-19.3l-96-9.6C12.5 457.2 0 443.5 0 427L0 224c0-17.7 14.3-32 32-32l30.3 0c63.6 0 125.6 19.6 177.7 56zm32 264l0-264c52.1-36.4 114.1-56 177.7-56l30.3 0c17.7 0 32 14.3 32 32l0 203c0 16.4-12.5 30.2-28.8 31.8l-96 9.6c-23.2 2.3-45.9 8.9-66.8 19.3L272 512z"]
};
const faBookReader = faBookOpenReader;
const faMountainSun = {
  prefix: 'fas',
  iconName: 'mountain-sun',
  icon: [640, 512, [], "e52f", "M560 160A80 80 0 1 0 560 0a80 80 0 1 0 0 160zM55.9 512l325.2 0 75 0 122.8 0c33.8 0 61.1-27.4 61.1-61.1c0-11.2-3.1-22.2-8.9-31.8l-132-216.3C495 196.1 487.8 192 480 192s-15 4.1-19.1 10.7l-48.2 79L286.8 81c-6.6-10.6-18.3-17-30.8-17s-24.1 6.4-30.8 17L8.6 426.4C3 435.3 0 445.6 0 456.1C0 487 25 512 55.9 512z"]
};
const faArrowsLeftRightToLine = {
  prefix: 'fas',
  iconName: 'arrows-left-right-to-line',
  icon: [640, 512, [], "e4ba", "M32 64c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 96C0 78.3 14.3 64 32 64zm214.6 73.4c12.5 12.5 12.5 32.8 0 45.3L205.3 224l229.5 0-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L434.7 288l-229.5 0 41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0zM640 96l0 320c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-320c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faDiceD20 = {
  prefix: 'fas',
  iconName: 'dice-d20',
  icon: [512, 512, [], "f6cf", "M48.7 125.8l53.2 31.9c7.8 4.7 17.8 2 22.2-5.9L201.6 12.1c3-5.4-.9-12.1-7.1-12.1c-1.6 0-3.2 .5-4.6 1.4L47.9 98.8c-9.6 6.6-9.2 20.9 .8 26.9zM16 171.7l0 123.5c0 8 10.4 11 14.7 4.4l60-92c5-7.6 2.6-17.8-5.2-22.5L40.2 158C29.6 151.6 16 159.3 16 171.7zM310.4 12.1l77.6 139.6c4.4 7.9 14.5 10.6 22.2 5.9l53.2-31.9c10-6 10.4-20.3 .8-26.9L322.1 1.4c-1.4-.9-3-1.4-4.6-1.4c-6.2 0-10.1 6.7-7.1 12.1zM496 171.7c0-12.4-13.6-20.1-24.2-13.7l-45.3 27.2c-7.8 4.7-10.1 14.9-5.2 22.5l60 92c4.3 6.7 14.7 3.6 14.7-4.4l0-123.5zm-49.3 246L286.1 436.6c-8.1 .9-14.1 7.8-14.1 15.9l0 52.8c0 3.7 3 6.8 6.8 6.8c.8 0 1.6-.1 2.4-.4l172.7-64c6.1-2.2 10.1-8 10.1-14.5c0-9.3-8.1-16.5-17.3-15.4zM233.2 512c3.7 0 6.8-3 6.8-6.8l0-52.6c0-8.1-6.1-14.9-14.1-15.9l-160.6-19c-9.2-1.1-17.3 6.1-17.3 15.4c0 6.5 4 12.3 10.1 14.5l172.7 64c.8 .3 1.6 .4 2.4 .4zM41.7 382.9l170.9 20.2c7.8 .9 13.4-7.5 9.5-14.3l-85.7-150c-5.9-10.4-20.7-10.8-27.3-.8L30.2 358.2c-6.5 9.9-.3 23.3 11.5 24.7zm439.6-24.8L402.9 238.1c-6.5-10-21.4-9.6-27.3 .8L290.2 388.5c-3.9 6.8 1.6 15.2 9.5 14.3l170.1-20c11.8-1.4 18-14.7 11.5-24.6zm-216.9 11l78.4-137.2c6.1-10.7-1.6-23.9-13.9-23.9l-145.7 0c-12.3 0-20 13.3-13.9 23.9l78.4 137.2c3.7 6.4 13 6.4 16.7 0zM174.4 176l163.2 0c12.2 0 19.9-13.1 14-23.8l-80-144c-2.8-5.1-8.2-8.2-14-8.2l-3.2 0c-5.8 0-11.2 3.2-14 8.2l-80 144c-5.9 10.7 1.8 23.8 14 23.8z"]
};
const faTruckDroplet = {
  prefix: 'fas',
  iconName: 'truck-droplet',
  icon: [640, 512, [], "e58c", "M0 48C0 21.5 21.5 0 48 0L368 0c26.5 0 48 21.5 48 48l0 48 50.7 0c17 0 33.3 6.7 45.3 18.7L589.3 192c12 12 18.7 28.3 18.7 45.3l0 18.7 0 32 0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-26.5 0-48-21.5-48-48L0 48zM416 256l128 0 0-18.7L466.7 160 416 160l0 96zM160 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM208 272c39.8 0 72-29.6 72-66c0-27-39.4-82.9-59.9-110.3c-6.1-8.2-18.1-8.2-24.2 0C175.4 123 136 179 136 206c0 36.5 32.2 66 72 66z"]
};
const faFileCircleXmark = {
  prefix: 'fas',
  iconName: 'file-circle-xmark',
  icon: [576, 512, [], "e5a1", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L432 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L409.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L432 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L454.6 368l36.7-36.7z"]
};
const faTemperatureArrowUp = {
  prefix: 'fas',
  iconName: 'temperature-arrow-up',
  icon: [576, 512, ["temperature-up"], "e040", "M128 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 164.5c0 17.3 7.1 31.9 15.3 42.5C249.8 332.6 256 349.5 256 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9c8.2-10.6 15.3-25.2 15.3-42.5L128 112zM176 0C114.1 0 64 50.1 64 112l0 164.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C43.2 304.2 32 334.8 32 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6L288 112C288 50.1 237.9 0 176 0zm0 416c26.5 0 48-21.5 48-48c0-20.9-13.4-38.7-32-45.3L192 112c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 210.7c-18.6 6.6-32 24.4-32 45.3c0 26.5 21.5 48 48 48zM480 160l32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 288c0 17.7 14.3 32 32 32s32-14.3 32-32l0-288z"]
};
const faTemperatureUp = faTemperatureArrowUp;
const faMedal = {
  prefix: 'fas',
  iconName: 'medal',
  icon: [512, 512, [127941], "f5a2", "M4.1 38.2C1.4 34.2 0 29.4 0 24.6C0 11 11 0 24.6 0L133.9 0c11.2 0 21.7 5.9 27.4 15.5l68.5 114.1c-48.2 6.1-91.3 28.6-123.4 61.9L4.1 38.2zm503.7 0L405.6 191.5c-32.1-33.3-75.2-55.8-123.4-61.9L350.7 15.5C356.5 5.9 366.9 0 378.1 0L487.4 0C501 0 512 11 512 24.6c0 4.8-1.4 9.6-4.1 13.6zM80 336a176 176 0 1 1 352 0A176 176 0 1 1 80 336zm184.4-94.9c-3.4-7-13.3-7-16.8 0l-22.4 45.4c-1.4 2.8-4 4.7-7 5.1L168 298.9c-7.7 1.1-10.7 10.5-5.2 16l36.3 35.4c2.2 2.2 3.2 5.2 2.7 8.3l-8.6 49.9c-1.3 7.6 6.7 13.5 13.6 9.9l44.8-23.6c2.7-1.4 6-1.4 8.7 0l44.8 23.6c6.9 3.6 14.9-2.2 13.6-9.9l-8.6-49.9c-.5-3 .5-6.1 2.7-8.3l36.3-35.4c5.6-5.4 2.5-14.8-5.2-16l-50.1-7.3c-3-.4-5.7-2.4-7-5.1l-22.4-45.4z"]
};
const faBed = {
  prefix: 'fas',
  iconName: 'bed',
  icon: [640, 512, [128716], "f236", "M32 32c17.7 0 32 14.3 32 32l0 256 224 0 0-160c0-17.7 14.3-32 32-32l224 0c53 0 96 43 96 96l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-224 0-32 0L64 416l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 64C0 46.3 14.3 32 32 32zm144 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faSquareH = {
  prefix: 'fas',
  iconName: 'square-h',
  icon: [448, 512, ["h-square"], "f0fd", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM336 152l0 104 0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-80-128 0 0 80c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-208c0-13.3 10.7-24 24-24s24 10.7 24 24l0 80 128 0 0-80c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faHSquare = faSquareH;
const faPodcast = {
  prefix: 'fas',
  iconName: 'podcast',
  icon: [448, 512, [], "f2ce", "M319.4 372c48.5-31.3 80.6-85.9 80.6-148c0-97.2-78.8-176-176-176S48 126.8 48 224c0 62.1 32.1 116.6 80.6 148c1.2 17.3 4 38 7.2 57.1l.2 1C56 395.8 0 316.5 0 224C0 100.3 100.3 0 224 0S448 100.3 448 224c0 92.5-56 171.9-136 206.1l.2-1.1c3.1-19.2 6-39.8 7.2-57zm-2.3-38.1c-1.6-5.7-3.9-11.1-7-16.2c-5.8-9.7-13.5-17-21.9-22.4c19.5-17.6 31.8-43 31.8-71.3c0-53-43-96-96-96s-96 43-96 96c0 28.3 12.3 53.8 31.8 71.3c-8.4 5.4-16.1 12.7-21.9 22.4c-3.1 5.1-5.4 10.5-7 16.2C99.8 307.5 80 268 80 224c0-79.5 64.5-144 144-144s144 64.5 144 144c0 44-19.8 83.5-50.9 109.9zM224 312c32.9 0 64 8.6 64 43.8c0 33-12.9 104.1-20.6 132.9c-5.1 19-24.5 23.4-43.4 23.4s-38.2-4.4-43.4-23.4c-7.8-28.5-20.6-99.7-20.6-132.8c0-35.1 31.1-43.8 64-43.8zm0-144a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"]
};
const faTemperatureFull = {
  prefix: 'fas',
  iconName: 'temperature-full',
  icon: [320, 512, ["temperature-4", "thermometer-4", "thermometer-full"], "f2c7", "M160 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L208 112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L48 112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3L144 112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 210.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faTemperature4 = faTemperatureFull;
const faThermometer4 = faTemperatureFull;
const faThermometerFull = faTemperatureFull;
const faBell = {
  prefix: 'fas',
  iconName: 'bell',
  icon: [448, 512, [128276, 61602], "f0f3", "M224 0c-17.7 0-32 14.3-32 32l0 19.2C119 66 64 130.6 64 208l0 18.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S19.4 416 32 416l384 0c12.6 0 24-7.4 29.2-18.9s3.1-25-5.3-34.4l-7.4-8.3C401.3 319.2 384 273.9 384 226.8l0-18.8c0-77.4-55-142-128-156.8L256 32c0-17.7-14.3-32-32-32zm45.3 493.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"]
};
const faSuperscript = {
  prefix: 'fas',
  iconName: 'superscript',
  icon: [512, 512, [], "f12b", "M480 32c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 73.5 404.3 80 416 80l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128zM32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64z"]
};
const faPlugCircleXmark = {
  prefix: 'fas',
  iconName: 'plug-circle-xmark',
  icon: [576, 512, [], "e560", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L454.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L432 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L409.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L432 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faStarOfLife = {
  prefix: 'fas',
  iconName: 'star-of-life',
  icon: [512, 512, [], "f621", "M208 32c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 140.9 122-70.4c15.3-8.8 34.9-3.6 43.7 11.7l16 27.7c8.8 15.3 3.6 34.9-11.7 43.7L352 256l122 70.4c15.3 8.8 20.6 28.4 11.7 43.7l-16 27.7c-8.8 15.3-28.4 20.6-43.7 11.7L304 339.1 304 480c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-140.9L86 409.6c-15.3 8.8-34.9 3.6-43.7-11.7l-16-27.7c-8.8-15.3-3.6-34.9 11.7-43.7L160 256 38 185.6c-15.3-8.8-20.5-28.4-11.7-43.7l16-27.7C51.1 98.8 70.7 93.6 86 102.4l122 70.4L208 32z"]
};
const faPhoneSlash = {
  prefix: 'fas',
  iconName: 'phone-slash',
  icon: [640, 512, [], "f3dd", "M228.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C76.1 30.2 64 46 64 64c0 107.4 37.8 206 100.8 283.1L9.2 469.1c-10.4 8.2-12.3 23.3-4.1 33.7s23.3 12.3 33.7 4.1l592-464c10.4-8.2 12.3-23.3 4.1-33.7s-23.3-12.3-33.7-4.1L253 278c-17.8-21.5-32.9-45.2-45-70.7L257.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96zm96.8 319l-91.3 72C310.7 476 407.1 512 512 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L368.7 368c-15-7.1-29.3-15.2-43-24.3z"]
};
const faPaintRoller = {
  prefix: 'fas',
  iconName: 'paint-roller',
  icon: [512, 512, [], "f5aa", "M0 64C0 28.7 28.7 0 64 0L352 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 192c-35.3 0-64-28.7-64-64L0 64zM160 352c0-17.7 14.3-32 32-32l0-16c0-44.2 35.8-80 80-80l144 0c17.7 0 32-14.3 32-32l0-32 0-90.5c37.3 13.2 64 48.7 64 90.5l0 32c0 53-43 96-96 96l-144 0c-8.8 0-16 7.2-16 16l0 16c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-128z"]
};
const faHandshakeAngle = {
  prefix: 'fas',
  iconName: 'handshake-angle',
  icon: [640, 512, ["hands-helping"], "f4c4", "M544 248l0 3.3 69.7-69.7c21.9-21.9 21.9-57.3 0-79.2L535.6 24.4c-21.9-21.9-57.3-21.9-79.2 0L416.3 64.5c-2.7-.3-5.5-.5-8.3-.5L296 64c-37.1 0-67.6 28-71.6 64l-.4 0 0 120c0 22.1 17.9 40 40 40s40-17.9 40-40l0-72c0 0 0-.1 0-.1l0-15.9 16 0 136 0c0 0 0 0 .1 0l7.9 0c44.2 0 80 35.8 80 80l0 8zM336 192l0 56c0 39.8-32.2 72-72 72s-72-32.2-72-72l0-118.6c-35.9 6.2-65.8 32.3-76 68.2L99.5 255.2 26.3 328.4c-21.9 21.9-21.9 57.3 0 79.2l78.1 78.1c21.9 21.9 57.3 21.9 79.2 0l37.7-37.7c.9 0 1.8 .1 2.7 .1l160 0c26.5 0 48-21.5 48-48c0-5.6-1-11-2.7-16l2.7 0c26.5 0 48-21.5 48-48c0-12.8-5-24.4-13.2-33c25.7-5 45.1-27.6 45.2-54.8l0-.4c-.1-30.8-25.1-55.8-56-55.8c0 0 0 0 0 0l-120 0z"]
};
const faHandsHelping = faHandshakeAngle;
const faLocationDot = {
  prefix: 'fas',
  iconName: 'location-dot',
  icon: [384, 512, ["map-marker-alt"], "f3c5", "M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faMapMarkerAlt = faLocationDot;
const faFile = {
  prefix: 'fas',
  iconName: 'file',
  icon: [384, 512, [128196, 128459, 61462], "f15b", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128z"]
};
const faGreaterThan = {
  prefix: 'fas',
  iconName: 'greater-than',
  icon: [384, 512, [62769], "3e", "M3.4 81.7c-7.9 15.8-1.5 35 14.3 42.9L280.5 256 17.7 387.4C1.9 395.3-4.5 414.5 3.4 430.3s27.1 22.2 42.9 14.3l320-160c10.8-5.4 17.7-16.5 17.7-28.6s-6.8-23.2-17.7-28.6l-320-160c-15.8-7.9-35-1.5-42.9 14.3z"]
};
const faPersonSwimming = {
  prefix: 'fas',
  iconName: 'person-swimming',
  icon: [576, 512, [127946, "swimmer"], "f5c4", "M309.5 178.4L447.9 297.1c-1.6 .9-3.2 2-4.8 3c-18 12.4-40.1 20.3-59.2 20.3c-19.6 0-40.8-7.7-59.2-20.3c-22.1-15.5-51.6-15.5-73.7 0c-17.1 11.8-38 20.3-59.2 20.3c-10.1 0-21.1-2.2-31.9-6.2C163.1 193.2 262.2 96 384 96l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-26.9 0-52.3 6.6-74.5 18.4zM160 160A64 64 0 1 1 32 160a64 64 0 1 1 128 0zM306.5 325.9C329 341.4 356.5 352 384 352c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 405.7 417 416 384 416c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 341.2 165.1 352 192 352c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faSwimmer = faPersonSwimming;
const faArrowDown = {
  prefix: 'fas',
  iconName: 'arrow-down',
  icon: [384, 512, [8595], "f063", "M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 370.8 224 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]
};
const faDroplet = {
  prefix: 'fas',
  iconName: 'droplet',
  icon: [384, 512, [128167, "tint"], "f043", "M192 512C86 512 0 426 0 320C0 228.8 130.2 57.7 166.6 11.7C172.6 4.2 181.5 0 191.1 0l1.8 0c9.6 0 18.5 4.2 24.5 11.7C253.8 57.7 384 228.8 384 320c0 106-86 192-192 192zM96 336c0-8.8-7.2-16-16-16s-16 7.2-16 16c0 61.9 50.1 112 112 112c8.8 0 16-7.2 16-16s-7.2-16-16-16c-44.2 0-80-35.8-80-80z"]
};
const faTint = faDroplet;
const faEraser = {
  prefix: 'fas',
  iconName: 'eraser',
  icon: [576, 512, [], "f12d", "M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7L288 480l9.4 0L512 480c17.7 0 32-14.3 32-32s-14.3-32-32-32l-124.1 0L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416l-9.4 0-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"]
};
const faEarthAmericas = {
  prefix: 'fas',
  iconName: 'earth-americas',
  icon: [512, 512, [127758, "earth", "earth-america", "globe-americas"], "f57d", "M57.7 193l9.4 16.4c8.3 14.5 21.9 25.2 38 29.8L163 255.7c17.2 4.9 29 20.6 29 38.5l0 39.9c0 11 6.2 21 16 25.9s16 14.9 16 25.9l0 39c0 15.6 14.9 26.9 29.9 22.6c16.1-4.6 28.6-17.5 32.7-33.8l2.8-11.2c4.2-16.9 15.2-31.4 30.3-40l8.1-4.6c15-8.5 24.2-24.5 24.2-41.7l0-8.3c0-12.7-5.1-24.9-14.1-33.9l-3.9-3.9c-9-9-21.2-14.1-33.9-14.1L257 256c-11.1 0-22.1-2.9-31.8-8.4l-34.5-19.7c-4.3-2.5-7.6-6.5-9.2-11.2c-3.2-9.6 1.1-20 10.2-24.5l5.9-3c6.6-3.3 14.3-3.9 21.3-1.5l23.2 7.7c8.2 2.7 17.2-.4 21.9-7.5c4.7-7 4.2-16.3-1.2-22.8l-13.6-16.3c-10-12-9.9-29.5 .3-41.3l15.7-18.3c8.8-10.3 10.2-25 3.5-36.7l-2.4-4.2c-3.5-.2-6.9-.3-10.4-.3C163.1 48 84.4 108.9 57.7 193zM464 256c0-36.8-9.6-71.4-26.4-101.5L412 164.8c-15.7 6.3-23.8 23.8-18.5 39.8l16.9 50.7c3.5 10.4 12 18.3 22.6 20.9l29.1 7.3c1.2-9 1.8-18.2 1.8-27.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faEarth = faEarthAmericas;
const faEarthAmerica = faEarthAmericas;
const faGlobeAmericas = faEarthAmericas;
const faPersonBurst = {
  prefix: 'fas',
  iconName: 'person-burst',
  icon: [640, 512, [], "e53b", "M480 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 384l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-223.1 28.6 47.5c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-58.3-97c-17.4-28.9-48.6-46.6-82.3-46.6l-29.7 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L408 256.9 408 480c0 17.7 14.3 32 32 32s32-14.3 32-32zM190.9 18.1C188.4 12 182.6 8 176 8s-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L176 286.1l58.6 53.9c4.8 4.4 11.9 5.5 17.8 2.6s9.5-9 9-15.5l-5.6-79.4 50.5-7.8 24.3-40.5-55.2-38L315 92.2c3.3-5.7 2.7-12.8-1.4-17.9s-10.9-7.2-17.2-5.3L220.3 92.1l-29.4-74z"]
};
const faDove = {
  prefix: 'fas',
  iconName: 'dove',
  icon: [512, 512, [128330], "f4ba", "M160.8 96.5c14 17 31 30.9 49.5 42.2c25.9 15.8 53.7 25.9 77.7 31.6l0-31.5C265.8 108.5 250 71.5 248.6 28c-.4-11.3-7.5-21.5-18.4-24.4c-7.6-2-15.8-.2-21 5.8c-13.3 15.4-32.7 44.6-48.4 87.2zM320 144l0 30.6s0 0 0 0l0 1.3s0 0 0 0l0 32.1c-60.8-5.1-185-43.8-219.3-157.2C97.4 40 87.9 32 76.6 32c-7.9 0-15.3 3.9-18.8 11C46.8 65.9 32 112.1 32 176c0 116.9 80.1 180.5 118.4 202.8L11.8 416.6C6.7 418 2.6 421.8 .9 426.8s-.8 10.6 2.3 14.8C21.7 466.2 77.3 512 160 512c3.6 0 7.2-1.2 10-3.5L245.6 448l74.4 0c88.4 0 160-71.6 160-160l0-160 29.9-44.9c1.3-2 2.1-4.4 2.1-6.8c0-6.8-5.5-12.3-12.3-12.3L400 64c-44.2 0-80 35.8-80 80zm80-16a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faBatteryEmpty = {
  prefix: 'fas',
  iconName: 'battery-empty',
  icon: [576, 512, ["battery-0"], "f244", "M80 160c-8.8 0-16 7.2-16 16l0 160c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-160c0-8.8-7.2-16-16-16L80 160zM0 176c0-44.2 35.8-80 80-80l384 0c44.2 0 80 35.8 80 80l0 16c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l0 16c0 44.2-35.8 80-80 80L80 416c-44.2 0-80-35.8-80-80L0 176z"]
};
const faBattery0 = faBatteryEmpty;
const faSocks = {
  prefix: 'fas',
  iconName: 'socks',
  icon: [512, 512, [129510], "f696", "M175.2 476.6c-9.7-18-15.2-38.7-15.2-60.6c0-40.3 19-78.2 51.2-102.4l64-48c8.1-6 12.8-15.5 12.8-25.6l0-144L128 96l0 144c0 20.1-9.5 39.1-25.6 51.2l-64 48C14.2 357.3 0 385.8 0 416c0 53 43 96 96 96c20.8 0 41-6.7 57.6-19.2l21.6-16.2zM128 64l160 0 0-16c0-14.5 3.9-28.2 10.7-39.9C291 3 281.9 0 272 0L176 0c-26.5 0-48 21.5-48 48l0 16zM320 96l0 144c0 20.1-9.5 39.1-25.6 51.2l-64 48C206.2 357.3 192 385.8 192 416c0 53 43 96 96 96c20.8 0 41-6.7 57.6-19.2l115.2-86.4C493 382.2 512 344.3 512 304l0-208L320 96zM512 64l0-16c0-26.5-21.5-48-48-48L368 0c-26.5 0-48 21.5-48 48l0 16 192 0z"]
};
const faInbox = {
  prefix: 'fas',
  iconName: 'inbox',
  icon: [512, 512, [], "f01c", "M121 32C91.6 32 66 52 58.9 80.5L1.9 308.4C.6 313.5 0 318.7 0 323.9L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-92.1c0-5.2-.6-10.4-1.9-15.5l-57-227.9C446 52 420.4 32 391 32L121 32zm0 64l270 0 48 192-51.2 0c-12.1 0-23.2 6.8-28.6 17.7l-14.3 28.6c-5.4 10.8-16.5 17.7-28.6 17.7l-120.4 0c-12.1 0-23.2-6.8-28.6-17.7l-14.3-28.6c-5.4-10.8-16.5-17.7-28.6-17.7L73 288 121 96z"]
};
const faSection = {
  prefix: 'fas',
  iconName: 'section',
  icon: [256, 512, [], "e447", "M64.9 96C67.1 84.4 73.7 76.2 86 70.6c13.8-6.2 34.8-8.9 61.2-4.5c8.8 1.4 36.1 7.1 44.1 9.3c17 4.8 34.7-5.1 39.5-22.2s-5.1-34.7-22.2-39.5c-11.1-3.1-41-9.2-50.9-10.8C123-2.7 88.3-.6 59.7 12.3C29.9 25.8 7.5 50.9 1.6 86.5c-.1 .5-.2 1.1-.2 1.6c-2.2 19.7 .3 37.9 8.1 54.1c7.7 16.1 19.4 28 32 36.9c.6 .5 1.3 .9 2 1.4C22.3 194.2 6.5 215.1 1.7 243c-.1 .6-.2 1.1-.2 1.7c-2.3 19.3 .4 37.1 8.4 53c7.9 15.6 19.8 27 32.3 35.5c22.4 15.2 51.9 24 75.4 31c0 0 0 0 0 0l3.7 1.1c27.2 8.2 46.9 14.6 59.4 23.8c5.5 4 8.2 7.6 9.5 10.9c1.3 3.2 2.6 8.6 .9 18.1c-1.7 10.1-7.7 18-20.7 23.5c-14 6-35.4 8.5-62 4.4c-12.8-2.1-35.1-9.7-54.1-16.2c0 0 0 0 0 0c-4.3-1.5-8.5-2.9-12.3-4.2C25.3 420 7.2 429.1 1.6 445.8s3.5 34.9 20.3 40.5c2.6 .8 5.7 1.9 9.2 3.1c18.6 6.3 48.5 16.6 67.3 19.6c0 0 0 0 0 0l.2 0c34.5 5.4 68.8 3.4 97.2-8.7c29.4-12.6 52.5-36.5 58.5-71.5c3.3-19.3 1.9-37.4-5-53.9c-6.3-15-16.4-26.4-27.6-35.2c16.5-13.9 28.5-33.2 32.6-58.2c3.2-19.8 1.9-38.3-4.8-55.1c-6.7-16.8-17.8-29.4-30.2-39c-22.8-17.6-53.6-27.4-77.7-35l-1.4-.5c-27.4-8.7-47.8-15.3-61.5-25c-6.1-4.4-9.5-8.5-11.4-12.4c-1.8-3.7-3.2-9.3-2.3-18.5zm76.7 208.5l-.6-.2-1.4-.4c-27.4-8.2-47.9-14.5-61.7-23.8c-6.2-4.2-9.3-7.9-11-11.3c-1.5-3-2.9-7.7-2.1-15.7c1.9-9.7 7.9-17.3 20.5-22.7c14-6 35.4-8.5 62.1-4.3l16.4 2.6c6.3 2.9 11.7 6 16.2 9.5c5.5 4.2 8.4 8.2 10 12.2c1.6 4 2.8 10.4 1.1 20.9c-2.4 14.7-12.8 26.4-37.1 31l-12.4 2.3z"]
};
const faGaugeHigh = {
  prefix: 'fas',
  iconName: 'gauge-high',
  icon: [512, 512, [62461, "tachometer-alt", "tachometer-alt-fast"], "f625", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM256 416c35.3 0 64-28.7 64-64c0-17.4-6.9-33.1-18.1-44.6L366 161.7c5.3-12.1-.2-26.3-12.3-31.6s-26.3 .2-31.6 12.3L257.9 288c-.6 0-1.3 0-1.9 0c-35.3 0-64 28.7-64 64s28.7 64 64 64zM176 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM96 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm352-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faTachometerAlt = faGaugeHigh;
const faTachometerAltFast = faGaugeHigh;
const faEnvelopeOpenText = {
  prefix: 'fas',
  iconName: 'envelope-open-text',
  icon: [512, 512, [], "f658", "M215.4 96L144 96l-36.2 0L96 96l0 8.8L96 144l0 40.4 0 89L.2 202.5c1.6-18.1 10.9-34.9 25.7-45.8L48 140.3 48 96c0-26.5 21.5-48 48-48l76.6 0 49.9-36.9C232.2 3.9 243.9 0 256 0s23.8 3.9 33.5 11L339.4 48 416 48c26.5 0 48 21.5 48 48l0 44.3 22.1 16.4c14.8 10.9 24.1 27.7 25.7 45.8L416 273.4l0-89 0-40.4 0-39.2 0-8.8-11.8 0L368 96l-71.4 0-81.3 0zM0 448L0 242.1 217.6 403.3c11.1 8.2 24.6 12.7 38.4 12.7s27.3-4.4 38.4-12.7L512 242.1 512 448s0 0 0 0c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64c0 0 0 0 0 0zM176 160l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faHospital = {
  prefix: 'fas',
  iconName: 'hospital',
  icon: [640, 512, [127973, 62589, "hospital-alt", "hospital-wide"], "f0f8", "M192 48c0-26.5 21.5-48 48-48L400 0c26.5 0 48 21.5 48 48l0 464-80 0 0-80c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 80-80 0 0-464zM48 96l112 0 0 416L48 512c-26.5 0-48-21.5-48-48L0 320l80 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L0 288l0-64 80 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L0 192l0-48c0-26.5 21.5-48 48-48zm544 0c26.5 0 48 21.5 48 48l0 48-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 64-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 144c0 26.5-21.5 48-48 48l-112 0 0-416 112 0zM312 64c-8.8 0-16 7.2-16 16l0 24-24 0c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l24 0 0 24c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-24 24 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-24 0 0-24c0-8.8-7.2-16-16-16l-16 0z"]
};
const faHospitalAlt = faHospital;
const faHospitalWide = faHospital;
const faWineBottle = {
  prefix: 'fas',
  iconName: 'wine-bottle',
  icon: [512, 512, [], "f72f", "M393.4 9.4c12.5-12.5 32.8-12.5 45.3 0l64 64c12.5 12.5 12.5 32.8 0 45.3c-11.8 11.8-30.7 12.5-43.2 1.9l-9.5 9.5-48.8 48.8c-9.2 9.2-11.5 22.9-8.6 35.6c9.4 40.9-1.9 85.6-33.8 117.5L197.3 493.3c-25 25-65.5 25-90.5 0l-88-88c-25-25-25-65.5 0-90.5L180.2 153.3c31.9-31.9 76.6-43.1 117.5-33.8c12.6 2.9 26.4 .5 35.5-8.6l48.8-48.8 9.5-9.5c-10.6-12.6-10-31.4 1.9-43.2zM99.3 347.3l65.4 65.4c6.2 6.2 16.4 6.2 22.6 0l97.4-97.4c6.2-6.2 6.2-16.4 0-22.6l-65.4-65.4c-6.2-6.2-16.4-6.2-22.6 0L99.3 324.7c-6.2 6.2-6.2 16.4 0 22.6z"]
};
const faChessRook = {
  prefix: 'fas',
  iconName: 'chess-rook',
  icon: [448, 512, [9820], "f447", "M32 192L32 48c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 40c0 4.4 3.6 8 8 8l32 0c4.4 0 8-3.6 8-8l0-40c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 40c0 4.4 3.6 8 8 8l32 0c4.4 0 8-3.6 8-8l0-40c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 144c0 10.1-4.7 19.6-12.8 25.6L352 256l16 144L80 400 96 256 44.8 217.6C36.7 211.6 32 202.1 32 192zm176 96l32 0c8.8 0 16-7.2 16-16l0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c0 8.8 7.2 16 16 16zM22.6 473.4L64 432l320 0 41.4 41.4c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6L38.6 512C26.1 512 16 501.9 16 489.4c0-6 2.4-11.8 6.6-16z"]
};
const faBarsStaggered = {
  prefix: 'fas',
  iconName: 'bars-staggered',
  icon: [512, 512, ["reorder", "stream"], "f550", "M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM64 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L96 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
};
const faReorder = faBarsStaggered;
const faStream = faBarsStaggered;
const faDharmachakra = {
  prefix: 'fas',
  iconName: 'dharmachakra',
  icon: [512, 512, [9784], "f655", "M337.8 205.7l48.6-42.5c13.8 19.3 23.4 41.9 27.4 66.2l-64.4 4.3c-2.4-10.1-6.4-19.5-11.6-28zm140.1 19.5c-5.3-38.8-20.6-74.5-43.2-104.3l.8-.7C449 108.4 449.7 87.6 437 75s-33.4-12-45.2 1.5l-.7 .8c-29.8-22.6-65.5-37.9-104.3-43.2l.1-1.1c1.2-17.9-13-33-30.9-33s-32.1 15.2-30.9 33l.1 1.1c-38.8 5.3-74.5 20.6-104.3 43.2l-.7-.8C108.4 63 87.6 62.3 75 75s-12 33.4 1.5 45.2l.8 .7c-22.6 29.8-37.9 65.5-43.2 104.3l-1.1-.1c-17.9-1.2-33 13-33 30.9s15.2 32.1 33 30.9l1.1-.1c5.3 38.8 20.6 74.5 43.2 104.3l-.8 .7C63 403.6 62.3 424.4 75 437s33.4 12 45.2-1.5l.7-.8c29.8 22.6 65.5 37.9 104.3 43.2l-.1 1.1c-1.2 17.9 13 33 30.9 33s32.1-15.2 30.9-33l-.1-1.1c38.8-5.3 74.5-20.6 104.3-43.2l.7 .8c11.8 13.5 32.5 14.2 45.2 1.5s12-33.4-1.5-45.2l-.8-.7c22.6-29.8 37.9-65.5 43.2-104.3l1.1 .1c17.9 1.2 33-13 33-30.9s-15.2-32.1-33-30.9l-1.1 .1zM163.2 125.6c19.3-13.8 41.9-23.4 66.2-27.5l4.3 64.4c-10 2.4-19.5 6.4-28 11.6l-42.5-48.6zm-65 103.8c4.1-24.4 13.7-46.9 27.5-66.2l48.6 42.5c-5.3 8.5-9.2 18-11.6 28l-64.4-4.3zm27.5 119.4c-13.8-19.3-23.4-41.9-27.5-66.2l64.4-4.3c2.4 10 6.4 19.5 11.6 28l-48.6 42.5zm103.8 65c-24.4-4.1-46.9-13.7-66.2-27.4l42.5-48.6c8.5 5.3 18 9.2 28 11.6l-4.3 64.4zm119.4-27.4c-19.3 13.8-41.9 23.4-66.2 27.4l-4.3-64.4c10-2.4 19.5-6.4 28-11.6l42.5 48.6zm65-103.8c-4.1 24.4-13.7 46.9-27.4 66.2l-48.6-42.5c5.3-8.5 9.2-18 11.6-28l64.4 4.3zm-65-156.9l-42.5 48.6c-8.5-5.3-18-9.2-28-11.6l4.3-64.4c24.4 4.1 46.9 13.7 66.2 27.5zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faHotdog = {
  prefix: 'fas',
  iconName: 'hotdog',
  icon: [512, 512, [127789], "f80f", "M488.6 23.4c31.2 31.2 31.2 81.9 0 113.1l-352 352c-31.2 31.2-81.9 31.2-113.1 0s-31.2-81.9 0-113.1l352-352c31.2-31.2 81.9-31.2 113.1 0zM443.3 92.7c-6.2-6.2-16.4-6.2-22.6 0c-12.5 12.5-23.8 15.1-37.5 17.6l-2.5 .4c-13.8 2.5-31.6 5.6-48 22c-16.7 16.7-20.9 36-24.1 50.9c0 0 0 0 0 0s0 0 0 0l-.2 1c-3.4 15.6-6 26.4-15.7 36.1s-20.5 12.3-36.1 15.7l-1 .2c-14.9 3.2-34.2 7.4-50.9 24.1s-20.9 36-24.1 50.9l-.2 1c-3.4 15.6-6 26.4-15.7 36.1c-9.2 9.2-18 10.8-32.7 13.4c0 0 0 0 0 0l-.9 .2c-15.6 2.8-34.9 6.9-54.4 26.4c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0c12.5-12.5 23.8-15.1 37.5-17.6l2.5-.4c13.8-2.5 31.6-5.6 48-22c16.7-16.7 20.9-36 24.1-50.9l.2-1c3.4-15.6 6-26.4 15.7-36.1s20.5-12.3 36.1-15.7l1-.2c14.9-3.2 34.2-7.4 50.9-24.1s20.9-36 24.1-50.9l.2-1c3.4-15.6 6-26.4 15.7-36.1c9.2-9.2 18-10.8 32.7-13.4l.9-.2c15.6-2.8 34.9-6.9 54.4-26.4c6.2-6.2 6.2-16.4 0-22.6zM191.2 479.2l288-288L495 207c10.9 10.9 17 25.6 17 41s-6.1 30.1-17 41L289 495c-10.9 10.9-25.6 17-41 17s-30.1-6.1-41-17l-15.8-15.8zM17 305C6.1 294.1 0 279.4 0 264s6.1-30.1 17-41L223 17C233.9 6.1 248.6 0 264 0s30.1 6.1 41 17l15.8 15.8-288 288L17 305z"]
};
const faPersonWalkingWithCane = {
  prefix: 'fas',
  iconName: 'person-walking-with-cane',
  icon: [512, 512, ["blind"], "f29d", "M176 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8.4 32c-36.4 0-69.6 20.5-85.9 53.1L35.4 273.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3L128 231.6l0 43.2c0 17 6.7 33.3 18.7 45.3L224 397.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-89.4c0-12.7-5.1-24.9-14.1-33.9L224 306.7l0-93.4 70.4 93.9c10.6 14.1 30.7 17 44.8 6.4s17-30.7 6.4-44.8L268.8 166.4C250.7 142.2 222.2 128 192 128l-24.4 0zM128.3 346.8L97 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l22-88.2-52.8-52.8zM450.8 505.1c5 7.3 15 9.1 22.3 4s9.1-15 4-22.3L358.9 316.1c-2.8 3.8-6.1 7.3-10.1 10.3c-5 3.8-10.5 6.4-16.2 7.9L450.8 505.1z"]
};
const faBlind = faPersonWalkingWithCane;
const faDrum = {
  prefix: 'fas',
  iconName: 'drum',
  icon: [512, 512, [129345], "f569", "M501.2 76.1c11.1-7.3 14.2-22.1 6.9-33.2s-22.1-14.2-33.2-6.9L370.2 104.5C335.8 98.7 297 96 256 96C114.6 96 0 128 0 208L0 368c0 31.3 27.4 58.8 72 78.7L72 344c0-13.3 10.7-24 24-24s24 10.7 24 24l0 119.4c33 8.9 71.1 14.5 112 16.1L232 376c0-13.3 10.7-24 24-24s24 10.7 24 24l0 103.5c40.9-1.6 79-7.2 112-16.1L392 344c0-13.3 10.7-24 24-24s24 10.7 24 24l0 102.7c44.6-19.9 72-47.4 72-78.7l0-160c0-41.1-30.2-69.5-78.8-87.4l67.9-44.5zM307.4 145.6l-64.6 42.3c-11.1 7.3-14.2 22.1-6.9 33.2s22.1 14.2 33.2 6.9l111.1-72.8c14.7 3.2 27.9 7 39.4 11.5C458.4 181.8 464 197.4 464 208c0 .8-2.7 17.2-46 35.9C379.1 260.7 322 272 256 272s-123.1-11.3-162-28.1C50.7 225.2 48 208.8 48 208c0-10.6 5.6-26.2 44.4-41.3C130.6 151.9 187.8 144 256 144c18 0 35.1 .5 51.4 1.6z"]
};
const faIceCream = {
  prefix: 'fas',
  iconName: 'ice-cream',
  icon: [448, 512, [127848], "f810", "M367.1 160c.6-5.3 .9-10.6 .9-16C368 64.5 303.5 0 224 0S80 64.5 80 144c0 5.4 .3 10.7 .9 16l-.9 0c-26.5 0-48 21.5-48 48s21.5 48 48 48l53.5 0 181 0 53.5 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-.9 0zM96 288L200.8 497.7c4.4 8.8 13.3 14.3 23.2 14.3s18.8-5.5 23.2-14.3L352 288 96 288z"]
};
const faHeartCircleBolt = {
  prefix: 'fas',
  iconName: 'heart-circle-bolt',
  icon: [576, 512, [], "e4fc", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm47.9-225c4.3 3.7 5.4 9.9 2.6 14.9L452.4 356l35.6 0c5.2 0 9.8 3.3 11.4 8.2s-.1 10.3-4.2 13.4l-96 72c-4.5 3.4-10.8 3.2-15.1-.6s-5.4-9.9-2.6-14.9L411.6 380 376 380c-5.2 0-9.8-3.3-11.4-8.2s.1-10.3 4.2-13.4l96-72c4.5-3.4 10.8-3.2 15.1 .6z"]
};
const faFax = {
  prefix: 'fas',
  iconName: 'fax',
  icon: [512, 512, [128224, 128439], "f1ac", "M128 64l0 96 64 0 0-96 194.7 0L416 93.3l0 66.7 64 0 0-66.7c0-17-6.7-33.3-18.7-45.3L432 18.7C420 6.7 403.7 0 386.7 0L192 0c-35.3 0-64 28.7-64 64zM0 160L0 480c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-320c0-17.7-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32zm480 32l-352 0 0 288c0 17.7 14.3 32 32 32l320 0c17.7 0 32-14.3 32-32l0-256c0-17.7-14.3-32-32-32zM256 256a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM224 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faParagraph = {
  prefix: 'fas',
  iconName: 'paragraph',
  icon: [448, 512, [182], "f1dd", "M192 32l64 0 160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352-32 0 0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-32 0c-88.4 0-160-71.6-160-160s71.6-160 160-160z"]
};
const faCheckToSlot = {
  prefix: 'fas',
  iconName: 'check-to-slot',
  icon: [576, 512, ["vote-yea"], "f772", "M96 80c0-26.5 21.5-48 48-48l288 0c26.5 0 48 21.5 48 48l0 304L96 384 96 80zm313 47c-9.4-9.4-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L409 161c9.4-9.4 9.4-24.6 0-33.9zM0 336c0-26.5 21.5-48 48-48l16 0 0 128 448 0 0-128 16 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48L48 480c-26.5 0-48-21.5-48-48l0-96z"]
};
const faVoteYea = faCheckToSlot;
const faStarHalf = {
  prefix: 'fas',
  iconName: 'star-half',
  icon: [576, 512, [61731], "f089", "M288 0c-12.2 .1-23.3 7-28.6 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3L288 439.8 288 0zM429.9 512c1.1 .1 2.1 .1 3.2 0l-3.2 0z"]
};
const faBoxesStacked = {
  prefix: 'fas',
  iconName: 'boxes-stacked',
  icon: [576, 512, [62625, "boxes", "boxes-alt"], "f468", "M248 0L208 0c-26.5 0-48 21.5-48 48l0 112c0 35.3 28.7 64 64 64l128 0c35.3 0 64-28.7 64-64l0-112c0-26.5-21.5-48-48-48L328 0l0 80c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-80zM64 256c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l160 0c35.3 0 64-28.7 64-64l0-128c0-35.3-28.7-64-64-64l-40 0 0 80c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-80-40 0zM352 512l160 0c35.3 0 64-28.7 64-64l0-128c0-35.3-28.7-64-64-64l-40 0 0 80c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-80-40 0c-15 0-28.8 5.1-39.7 13.8c4.9 10.4 7.7 22 7.7 34.2l0 160c0 12.2-2.8 23.8-7.7 34.2C323.2 506.9 337 512 352 512z"]
};
const faBoxes = faBoxesStacked;
const faBoxesAlt = faBoxesStacked;
const faLink = {
  prefix: 'fas',
  iconName: 'link',
  icon: [640, 512, [128279, "chain"], "f0c1", "M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"]
};
const faChain = faLink;
const faEarListen = {
  prefix: 'fas',
  iconName: 'ear-listen',
  icon: [512, 512, ["assistive-listening-systems"], "f2a2", "M398.3 3.4c-15.8-7.9-35-1.5-42.9 14.3c-7.9 15.8-1.5 34.9 14.2 42.9l.4 .2c.4 .2 1.1 .6 2.1 1.2c2 1.2 5 3 8.7 5.6c7.5 5.2 17.6 13.2 27.7 24.2C428.5 113.4 448 146 448 192c0 17.7 14.3 32 32 32s32-14.3 32-32c0-66-28.5-113.4-56.5-143.7C441.6 33.2 427.7 22.2 417.3 15c-5.3-3.7-9.7-6.4-13-8.3c-1.6-1-3-1.7-4-2.2c-.5-.3-.9-.5-1.2-.7l-.4-.2-.2-.1c0 0 0 0-.1 0c0 0 0 0 0 0L384 32 398.3 3.4zM128.7 227.5c6.2-56 53.7-99.5 111.3-99.5c61.9 0 112 50.1 112 112c0 29.3-11.2 55.9-29.6 75.9c-17 18.4-34.4 45.1-34.4 78l0 6.1c0 26.5-21.5 48-48 48c-17.7 0-32 14.3-32 32s14.3 32 32 32c61.9 0 112-50.1 112-112l0-6.1c0-9.8 5.4-21.7 17.4-34.7C398.3 327.9 416 286 416 240c0-97.2-78.8-176-176-176C149.4 64 74.8 132.5 65.1 220.5c-1.9 17.6 10.7 33.4 28.3 35.3s33.4-10.7 35.3-28.3zM32 512a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM192 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0zM208 240c0-17.7 14.3-32 32-32s32 14.3 32 32c0 13.3 10.7 24 24 24s24-10.7 24-24c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 13.3 10.7 24 24 24s24-10.7 24-24z"]
};
const faAssistiveListeningSystems = faEarListen;
const faTreeCity = {
  prefix: 'fas',
  iconName: 'tree-city',
  icon: [640, 512, [], "e587", "M288 48c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 144 40 0 0-72c0-13.3 10.7-24 24-24s24 10.7 24 24l0 72 24 0c26.5 0 48 21.5 48 48l0 224c0 26.5-21.5 48-48 48l-160 0-96 0c-26.5 0-48-21.5-48-48l0-416zm64 32l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM352 272l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm176-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM512 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM224 160c0 6-1 11-2 16c20 14 34 38 34 64c0 45-36 80-80 80l-16 0 0 160c0 18-15 32-32 32c-18 0-32-14-32-32l0-160-16 0c-45 0-80-35-80-80c0-26 13-50 33-64c-1-5-1-10-1-16c0-53 42-96 96-96c53 0 96 43 96 96z"]
};
const faPlay = {
  prefix: 'fas',
  iconName: 'play',
  icon: [384, 512, [9654], "f04b", "M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"]
};
const faFont = {
  prefix: 'fas',
  iconName: 'font',
  icon: [448, 512, [], "f031", "M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z"]
};
const faTableCellsRowLock = {
  prefix: 'fas',
  iconName: 'table-cells-row-lock',
  icon: [640, 512, [], "e67a", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 65.1c-37.8 5.4-69.4 29.6-85.2 62.9L360 224l0 64 56 0 0 8.6c-19.1 11.1-32 31.7-32 55.4l-24 0 0 64 24 0 0 64L64 480c-35.3 0-64-28.7-64-64L0 96zM64 224l0 64 88 0 0-64-88 0zm232 0l-88 0 0 64 88 0 0-64zM152 352l-88 0 0 64 88 0 0-64zm56 0l0 64 88 0 0-64-88 0zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faRupiahSign = {
  prefix: 'fas',
  iconName: 'rupiah-sign',
  icon: [512, 512, [], "e23d", "M0 64C0 46.3 14.3 32 32 32l80 0c79.5 0 144 64.5 144 144c0 58.8-35.2 109.3-85.7 131.7l51.4 128.4c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8L106.3 320 64 320l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 288 0 64zM64 256l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80L64 96l0 160zm256-96l80 0c61.9 0 112 50.1 112 112s-50.1 112-112 112l-48 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128 0-160c0-17.7 14.3-32 32-32zm80 160c26.5 0 48-21.5 48-48s-21.5-48-48-48l-48 0 0 96 48 0z"]
};
const faMagnifyingGlass = {
  prefix: 'fas',
  iconName: 'magnifying-glass',
  icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
};
const faSearch = faMagnifyingGlass;
const faTableTennisPaddleBall = {
  prefix: 'fas',
  iconName: 'table-tennis-paddle-ball',
  icon: [512, 512, [127955, "ping-pong-paddle-ball", "table-tennis"], "f45d", "M416 288c-50.1 0-93.6 28.8-114.6 70.8L68.9 126.3l.6-.6 60.1-60.1c87.5-87.5 229.3-87.5 316.8 0c67.1 67.1 82.7 166.3 46.8 248.3C471.8 297.6 445 288 416 288zM49.3 151.9L290.1 392.7c-1.4 7.5-2.1 15.3-2.1 23.3c0 23.2 6.2 44.9 16.9 63.7c-3 .2-6.1 .3-9.2 .3l-2.7 0c-33.9 0-66.5-13.5-90.5-37.5l-9.8-9.8c-13.1-13.1-34.6-12.4-46.8 1.7L88.2 501c-5.8 6.7-14.2 10.7-23 11s-17.5-3.1-23.8-9.4l-32-32C3.1 464.3-.3 455.7 0 446.9s4.3-17.2 11-23l66.6-57.7c14-12.2 14.8-33.7 1.7-46.8l-9.8-9.8C45.5 285.5 32 252.9 32 219l0-2.7c0-22.8 6.1-44.9 17.3-64.3zM416 320a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faPingPongPaddleBall = faTableTennisPaddleBall;
const faTableTennis = faTableTennisPaddleBall;
const faPersonDotsFromLine = {
  prefix: 'fas',
  iconName: 'person-dots-from-line',
  icon: [576, 512, ["diagnoses"], "f470", "M288 176A88 88 0 1 0 288 0a88 88 0 1 0 0 176zM78.7 372.9c15-12.5 50-34.4 97.3-50.1L176 432l224 0 0-109.3c47.3 15.8 82.3 37.7 97.3 50.1c20.4 17 50.6 14.2 67.6-6.1s14.2-50.6-6.1-67.6c-12-10-30.1-22.5-53.2-35C497.2 278.4 481.7 288 464 288c-26.5 0-48-21.5-48-48c0-4.3 .6-8.4 1.6-12.4C379.1 215.9 335.3 208 288 208c-60.2 0-114.9 12.9-160 29.9c0 .7 0 1.4 0 2.1c0 26.5-21.5 48-48 48c-11.8 0-22.7-4.3-31-11.4c-13.1 8.1-23.7 15.9-31.7 22.5c-20.4 17-23.1 47.2-6.1 67.6s47.2 23.1 67.6 6.1zM24 464c-13.3 0-24 10.7-24 24s10.7 24 24 24l528 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 464zM224 280a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm104 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM96 240a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm368 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faDiagnoses = faPersonDotsFromLine;
const faTrashCanArrowUp = {
  prefix: 'fas',
  iconName: 'trash-can-arrow-up',
  icon: [448, 512, ["trash-restore-alt"], "f82a", "M163.8 0L284.2 0c12.1 0 23.2 6.8 28.6 17.7L320 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 7.2-14.3C140.6 6.8 151.7 0 163.8 0zM32 128l384 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-320zm192 64c-6.4 0-12.5 2.5-17 7l-80 80c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39L200 408c0 13.3 10.7 24 24 24s24-10.7 24-24l0-134.1 39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-4.5-4.5-10.6-7-17-7z"]
};
const faTrashRestoreAlt = faTrashCanArrowUp;
const faNairaSign = {
  prefix: 'fas',
  iconName: 'naira-sign',
  icon: [448, 512, [], "e1f6", "M122.6 46.3c-7.8-11.7-22.4-17-35.9-12.9S64 49.9 64 64l0 192-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 100.2 0 97.2 145.8c7.8 11.7 22.4 17 35.9 12.9s22.7-16.5 22.7-30.6l0-128 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-192c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 192-57.5 0L122.6 46.3zM305.1 320l14.9 0 0 22.3L305.1 320zM185.5 256L128 256l0-86.3L185.5 256z"]
};
const faCartArrowDown = {
  prefix: 'fas',
  iconName: 'cart-arrow-down',
  icon: [576, 512, [], "f218", "M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48l45.5 0c3.8 0 7.1 2.7 7.9 6.5l51.6 271c6.5 34 36.2 58.5 70.7 58.5L488 384c13.3 0 24-10.7 24-24s-10.7-24-24-24l-288.3 0c-11.5 0-21.4-8.2-23.6-19.5L170.7 288l288.5 0c32.6 0 61.1-21.8 69.5-53.3l41-152.3C576.6 57 557.4 32 531.1 32L360 32l0 102.1 23-23c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-64 64c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l23 23L312 32 120.1 32C111 12.8 91.6 0 69.5 0L24 0zM176 512a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm336-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faWalkieTalkie = {
  prefix: 'fas',
  iconName: 'walkie-talkie',
  icon: [384, 512, [], "f8ef", "M112 24c0-13.3-10.7-24-24-24S64 10.7 64 24l0 72L48 96C21.5 96 0 117.5 0 144L0 300.1c0 12.7 5.1 24.9 14.1 33.9l3.9 3.9c9 9 14.1 21.2 14.1 33.9L32 464c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-92.1c0-12.7 5.1-24.9 14.1-33.9l3.9-3.9c9-9 14.1-21.2 14.1-33.9L384 144c0-26.5-21.5-48-48-48l-16 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l-32 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l-48 0 0-72zm0 136l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faFilePen = {
  prefix: 'fas',
  iconName: 'file-pen',
  icon: [576, 512, [128221, "file-edit"], "f31c", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 125.7-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"]
};
const faFileEdit = faFilePen;
const faReceipt = {
  prefix: 'fas',
  iconName: 'receipt',
  icon: [384, 512, [129534], "f543", "M14 2.2C22.5-1.7 32.5-.3 39.6 5.8L80 40.4 120.4 5.8c9-7.7 22.3-7.7 31.2 0L192 40.4 232.4 5.8c9-7.7 22.3-7.7 31.2 0L304 40.4 344.4 5.8c7.1-6.1 17.1-7.5 25.6-3.6s14 12.4 14 21.8l0 464c0 9.4-5.5 17.9-14 21.8s-18.5 2.5-25.6-3.6L304 471.6l-40.4 34.6c-9 7.7-22.3 7.7-31.2 0L192 471.6l-40.4 34.6c-9 7.7-22.3 7.7-31.2 0L80 471.6 39.6 506.2c-7.1 6.1-17.1 7.5-25.6 3.6S0 497.4 0 488L0 24C0 14.6 5.5 6.1 14 2.2zM96 144c-8.8 0-16 7.2-16 16s7.2 16 16 16l192 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L96 144zM80 352c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L96 336c-8.8 0-16 7.2-16 16zM96 240c-8.8 0-16 7.2-16 16s7.2 16 16 16l192 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L96 240z"]
};
const faSquarePen = {
  prefix: 'fas',
  iconName: 'square-pen',
  icon: [448, 512, ["pen-square", "pencil-square"], "f14b", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM325.8 139.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-21.4 21.4-71-71 21.4-21.4c15.6-15.6 40.9-15.6 56.6 0zM119.9 289L225.1 183.8l71 71L190.9 359.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"]
};
const faPenSquare = faSquarePen;
const faPencilSquare = faSquarePen;
const faSuitcaseRolling = {
  prefix: 'fas',
  iconName: 'suitcase-rolling',
  icon: [384, 512, [], "f5c1", "M144 56c0-4.4 3.6-8 8-8l80 0c4.4 0 8 3.6 8 8l0 72-96 0 0-72zm176 72l-32 0 0-72c0-30.9-25.1-56-56-56L152 0C121.1 0 96 25.1 96 56l0 72-32 0c-35.3 0-64 28.7-64 64L0 416c0 35.3 28.7 64 64 64c0 17.7 14.3 32 32 32s32-14.3 32-32l128 0c0 17.7 14.3 32 32 32s32-14.3 32-32c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64zM112 224l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 128l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faPersonCircleExclamation = {
  prefix: 'fas',
  iconName: 'person-circle-exclamation',
  icon: [576, 512, [], "e53f", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z"]
};
const faChevronDown = {
  prefix: 'fas',
  iconName: 'chevron-down',
  icon: [512, 512, [], "f078", "M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]
};
const faBatteryFull = {
  prefix: 'fas',
  iconName: 'battery-full',
  icon: [576, 512, [128267, "battery", "battery-5"], "f240", "M464 160c8.8 0 16 7.2 16 16l0 160c0 8.8-7.2 16-16 16L80 352c-8.8 0-16-7.2-16-16l0-160c0-8.8 7.2-16 16-16l384 0zM80 96C35.8 96 0 131.8 0 176L0 336c0 44.2 35.8 80 80 80l384 0c44.2 0 80-35.8 80-80l0-16c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-16c0-44.2-35.8-80-80-80L80 96zm368 96L96 192l0 128 352 0 0-128z"]
};
const faBattery = faBatteryFull;
const faBattery5 = faBatteryFull;
const faSkullCrossbones = {
  prefix: 'fas',
  iconName: 'skull-crossbones',
  icon: [448, 512, [128369, 9760], "f714", "M368 128c0 44.4-25.4 83.5-64 106.4l0 21.6c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-21.6c-38.6-23-64-62.1-64-106.4C80 57.3 144.5 0 224 0s144 57.3 144 128zM168 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM3.4 273.7c7.9-15.8 27.1-22.2 42.9-14.3L224 348.2l177.7-88.8c15.8-7.9 35-1.5 42.9 14.3s1.5 35-14.3 42.9L295.6 384l134.8 67.4c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3L224 419.8 46.3 508.6c-15.8 7.9-35 1.5-42.9-14.3s-1.5-35 14.3-42.9L152.4 384 17.7 316.6C1.9 308.7-4.5 289.5 3.4 273.7z"]
};
const faCodeCompare = {
  prefix: 'fas',
  iconName: 'code-compare',
  icon: [512, 512, [], "e13a", "M320 488c0 9.5-5.6 18.1-14.2 21.9s-18.8 2.3-25.8-4.1l-80-72c-5.1-4.6-7.9-11-7.9-17.8s2.9-13.3 7.9-17.8l80-72c7-6.3 17.2-7.9 25.8-4.1s14.2 12.4 14.2 21.9l0 40 16 0c35.3 0 64-28.7 64-64l0-166.7C371.7 141 352 112.8 352 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3L464 320c0 70.7-57.3 128-128 128l-16 0 0 40zM456 80a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM192 24c0-9.5 5.6-18.1 14.2-21.9s18.8-2.3 25.8 4.1l80 72c5.1 4.6 7.9 11 7.9 17.8s-2.9 13.3-7.9 17.8l-80 72c-7 6.3-17.2 7.9-25.8 4.1s-14.2-12.4-14.2-21.9l0-40-16 0c-35.3 0-64 28.7-64 64l0 166.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3L48 192c0-70.7 57.3-128 128-128l16 0 0-40zM56 432a24 24 0 1 0 48 0 24 24 0 1 0 -48 0z"]
};
const faListUl = {
  prefix: 'fas',
  iconName: 'list-ul',
  icon: [512, 512, ["list-dots"], "f0ca", "M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faListDots = faListUl;
const faSchoolLock = {
  prefix: 'fas',
  iconName: 'school-lock',
  icon: [640, 512, [], "e56f", "M302.2 5.4c10.7-7.2 24.8-7.2 35.5 0L473.7 96 592 96c26.5 0 48 21.5 48 48l0 128c0-61.9-50.1-112-112-112s-112 50.1-112 112l0 24.6c-19.1 11.1-32 31.7-32 55.4l-63.7 0-.3 0c-35.3 0-64 28.7-64 64l0 96 64 0s0 0 0 0L48 512c-26.5 0-48-21.5-48-48L0 144c0-26.5 21.5-48 48-48l118.3 0L302.2 5.4zM80 208l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm0 128l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm240-72a88 88 0 1 0 0-176 88 88 0 1 0 0 176zm16-120l0 16 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16s16 7.2 16 16zm192 96c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faTowerCell = {
  prefix: 'fas',
  iconName: 'tower-cell',
  icon: [576, 512, [], "e585", "M62.6 2.3C46.2-4.3 27.6 3.6 20.9 20C7.4 53.4 0 89.9 0 128s7.4 74.6 20.9 108c6.6 16.4 25.3 24.3 41.7 17.7S86.9 228.4 80.3 212C69.8 186.1 64 157.8 64 128s5.8-58.1 16.3-84C86.9 27.6 79 9 62.6 2.3zm450.8 0C497 9 489.1 27.6 495.7 44C506.2 69.9 512 98.2 512 128s-5.8 58.1-16.3 84c-6.6 16.4 1.3 35 17.7 41.7s35-1.3 41.7-17.7c13.5-33.4 20.9-69.9 20.9-108s-7.4-74.6-20.9-108C548.4 3.6 529.8-4.3 513.4 2.3zM340.1 165.2c7.5-10.5 11.9-23.3 11.9-37.2c0-35.3-28.7-64-64-64s-64 28.7-64 64c0 13.9 4.4 26.7 11.9 37.2L98.9 466.8c-7.3 16.1-.2 35.1 15.9 42.4s35.1 .2 42.4-15.9L177.7 448l220.6 0 20.6 45.2c7.3 16.1 26.3 23.2 42.4 15.9s23.2-26.3 15.9-42.4L340.1 165.2zM369.2 384l-162.4 0 14.5-32 133.3 0 14.5 32zM288 205.3L325.6 288l-75.2 0L288 205.3zM163.3 73.6c5.3-12.1-.2-26.3-12.4-31.6s-26.3 .2-31.6 12.4C109.5 77 104 101.9 104 128s5.5 51 15.3 73.6c5.3 12.1 19.5 17.7 31.6 12.4s17.7-19.5 12.4-31.6C156 165.8 152 147.4 152 128s4-37.8 11.3-54.4zM456.7 54.4c-5.3-12.1-19.5-17.7-31.6-12.4s-17.7 19.5-12.4 31.6C420 90.2 424 108.6 424 128s-4 37.8-11.3 54.4c-5.3 12.1 .2 26.3 12.4 31.6s26.3-.2 31.6-12.4C466.5 179 472 154.1 472 128s-5.5-51-15.3-73.6z"]
};
const faDownLong = {
  prefix: 'fas',
  iconName: 'down-long',
  icon: [320, 512, ["long-arrow-alt-down"], "f309", "M2 334.5c-3.8 8.8-2 19 4.6 26l136 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l136-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L128 0C110.3 0 96 14.3 96 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"]
};
const faLongArrowAltDown = faDownLong;
const faRankingStar = {
  prefix: 'fas',
  iconName: 'ranking-star',
  icon: [640, 512, [], "e561", "M353.8 54.1L330.2 6.3c-3.9-8.3-16.1-8.6-20.4 0L286.2 54.1l-52.3 7.5c-9.3 1.4-13.3 12.9-6.4 19.8l38 37-9 52.1c-1.4 9.3 8.2 16.5 16.8 12.2l46.9-24.8 46.6 24.4c8.6 4.3 18.3-2.9 16.8-12.2l-9-52.1 38-36.6c6.8-6.8 2.9-18.3-6.4-19.8l-52.3-7.5zM256 256c-17.7 0-32 14.3-32 32l0 192c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-192c0-17.7-14.3-32-32-32l-128 0zM32 320c-17.7 0-32 14.3-32 32L0 480c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32L32 320zm416 96l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-128 0c-17.7 0-32 14.3-32 32z"]
};
const faChessKing = {
  prefix: 'fas',
  iconName: 'chess-king',
  icon: [448, 512, [9818], "f43f", "M224 0c17.7 0 32 14.3 32 32l0 16 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 48 152 0c22.1 0 40 17.9 40 40c0 5.3-1 10.5-3.1 15.4L368 400 80 400 3.1 215.4C1 210.5 0 205.3 0 200c0-22.1 17.9-40 40-40l152 0 0-48-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-16c0-17.7 14.3-32 32-32zM38.6 473.4L80 432l288 0 41.4 41.4c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6L54.6 512C42.1 512 32 501.9 32 489.4c0-6 2.4-11.8 6.6-16z"]
};
const faPersonHarassing = {
  prefix: 'fas',
  iconName: 'person-harassing',
  icon: [576, 512, [], "e549", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM59.4 304.5L88 256.9 88 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-244.7 47.4 57.1c11.3 13.6 31.5 15.5 45.1 4.2s15.5-31.5 4.2-45.1l-73.7-88.9c-18.2-22-45.3-34.7-73.9-34.7l-35.9 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9zM480 240a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM464 344l0 58.7-41.4-41.4c-7.3-7.3-17.6-10.6-27.8-9s-18.9 8.1-23.5 17.3l-48 96c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3L408.8 438l54.7 54.7c12.4 12.4 29.1 19.3 46.6 19.3c36.4 0 65.9-29.5 65.9-65.9L576 344c0-30.9-25.1-56-56-56s-56 25.1-56 56zM288 48c0 8.8 7.2 16 16 16l56 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-56 0c-8.8 0-16 7.2-16 16zm-.8 49.7c-7.9-4-17.5-.7-21.5 7.2s-.7 17.5 7.2 21.5l48 24c7.9 4 17.5 .7 21.5-7.2s.7-17.5-7.2-21.5l-48-24z"]
};
const faBrazilianRealSign = {
  prefix: 'fas',
  iconName: 'brazilian-real-sign',
  icon: [512, 512, [], "e46c", "M400 0c17.7 0 32 14.3 32 32l0 18.2c12.5 2.3 24.7 6.4 36.2 12.1l10.1 5.1c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3l-10.2-5.1c-9.9-5-20.9-7.5-32-7.5l-1.7 0c-29.8 0-53.9 24.1-53.9 53.9c0 22 13.4 41.8 33.9 50l52 20.8c44.7 17.9 74.1 61.2 74.1 109.4l0 3.4c0 51.2-33.6 94.6-80 109.2l0 21.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-19.4c-15-3.5-29.4-9.7-42.3-18.3l-23.4-15.6c-14.7-9.8-18.7-29.7-8.9-44.4s29.7-18.7 44.4-8.9L361.2 389c10.8 7.2 23.4 11 36.3 11c27.9 0 50.5-22.6 50.5-50.5l0-3.4c0-22-13.4-41.8-33.9-50l-52-20.8C317.3 257.4 288 214.1 288 165.9C288 114 321.5 70 368 54.2L368 32c0-17.7 14.3-32 32-32zM0 64C0 46.3 14.3 32 32 32l80 0c79.5 0 144 64.5 144 144c0 58.8-35.2 109.3-85.7 131.7l51.4 128.4c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8L106.3 320 64 320l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 288 0 64zM64 256l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80L64 96l0 160z"]
};
const faLandmarkDome = {
  prefix: 'fas',
  iconName: 'landmark-dome',
  icon: [512, 512, ["landmark-alt"], "f752", "M248 0l16 0c13.3 0 24 10.7 24 24l0 10.7C368.4 48.1 431.9 111.6 445.3 192l2.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 256c-17.7 0-32-14.3-32-32s14.3-32 32-32l2.7 0C80.1 111.6 143.6 48.1 224 34.7L224 24c0-13.3 10.7-24 24-24zM64 288l64 0 0 128 40 0 0-128 64 0 0 128 48 0 0-128 64 0 0 128 40 0 0-128 64 0 0 132.3c.6 .3 1.2 .7 1.8 1.1l48 32c11.7 7.8 17 22.4 12.9 35.9S494.1 512 480 512L32 512c-14.1 0-26.5-9.2-30.6-22.7s1.1-28.1 12.9-35.9l48-32c.6-.4 1.2-.7 1.8-1.1L64 288z"]
};
const faLandmarkAlt = faLandmarkDome;
const faArrowUp = {
  prefix: 'fas',
  iconName: 'arrow-up',
  icon: [384, 512, [8593], "f062", "M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"]
};
const faTv = {
  prefix: 'fas',
  iconName: 'tv',
  icon: [640, 512, [63717, "television", "tv-alt"], "f26c", "M64 64l0 288 512 0 0-288L64 64zM0 64C0 28.7 28.7 0 64 0L576 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 416c-35.3 0-64-28.7-64-64L0 64zM128 448l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-384 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faTelevision = faTv;
const faTvAlt = faTv;
const faShrimp = {
  prefix: 'fas',
  iconName: 'shrimp',
  icon: [512, 512, [129424], "e448", "M64 32C28.7 32 0 60.7 0 96s28.7 64 64 64l1 0c3.7 88.9 77 160 167 160l56 0 0-192-24 0L88.8 128 64 128c-17.7 0-32-14.3-32-32s14.3-32 32-32l400 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L64 32zM224 456c0 13.3 10.7 24 24 24l72 0 0-72.2-64.1-22.4c-12.5-4.4-26.2 2.2-30.6 14.7s2.2 26.2 14.7 30.6l4.5 1.6C233 433.9 224 443.9 224 456zm128 23.3c36.4-3.3 69.5-17.6 96.1-39.6l-86.5-34.6c-3 1.8-6.2 3.2-9.6 4.3l0 69.9zM472.6 415c24.6-30.3 39.4-68.9 39.4-111c0-12.3-1.3-24.3-3.7-35.9L382.8 355.1c.8 3.4 1.2 7 1.2 10.6c0 4.6-.7 9-1.9 13.1L472.6 415zM336 128l-16 0 0 192 18.3 0c9.9 0 19.1 3.2 26.6 8.5l133.5-92.4C471.8 172.6 409.1 128 336 128zM168 192a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faListCheck = {
  prefix: 'fas',
  iconName: 'list-check',
  icon: [512, 512, ["tasks"], "f0ae", "M152.1 38.2c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 113C-2.3 103.6-2.3 88.4 7 79s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zm0 160c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM48 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faTasks = faListCheck;
const faJugDetergent = {
  prefix: 'fas',
  iconName: 'jug-detergent',
  icon: [384, 512, [], "e519", "M96 24c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24l0 24 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 96C74.7 96 64 85.3 64 72s10.7-24 24-24l8 0 0-24zM0 256c0-70.7 57.3-128 128-128l128 0c70.7 0 128 57.3 128 128l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256zm256 0l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faCircleUser = {
  prefix: 'fas',
  iconName: 'circle-user',
  icon: [512, 512, [62142, "user-circle"], "f2bd", "M399 384.2C376.9 345.8 335.4 320 288 320l-64 0c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z"]
};
const faUserCircle = faCircleUser;
const faUserShield = {
  prefix: 'fas',
  iconName: 'user-shield',
  icon: [640, 512, [], "f505", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c1.8 0 3.5-.2 5.3-.5c-76.3-55.1-99.8-141-103.1-200.2c-16.1-4.8-33.1-7.3-50.7-7.3l-91.4 0zm308.8-78.3l-120 48C358 277.4 352 286.2 352 296c0 63.3 25.9 168.8 134.8 214.2c5.9 2.5 12.6 2.5 18.5 0C614.1 464.8 640 359.3 640 296c0-9.8-6-18.6-15.1-22.3l-120-48c-5.7-2.3-12.1-2.3-17.8 0zM591.4 312c-3.9 50.7-27.2 116.7-95.4 149.7l0-187.8L591.4 312z"]
};
const faWind = {
  prefix: 'fas',
  iconName: 'wind',
  icon: [512, 512, [], "f72e", "M288 32c0 17.7 14.3 32 32 32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c53 0 96-43 96-96s-43-96-96-96L320 0c-17.7 0-32 14.3-32 32zm64 352c0 17.7 14.3 32 32 32l32 0c53 0 96-43 96-96s-43-96-96-96L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32 14.3-32 32zM128 512l32 0c53 0 96-43 96-96s-43-96-96-96L32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32z"]
};
const faCarBurst = {
  prefix: 'fas',
  iconName: 'car-burst',
  icon: [640, 512, ["car-crash"], "f5e1", "M176 8c-6.6 0-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6l35.3-32.5 9.5-35.4 10.4-38.6c8-29.9 30.5-52.1 57.9-60.9l41-59.2c11.3-16.3 26.4-28.9 43.5-37.2c-.4-.6-.8-1.2-1.3-1.8c-4.1-5.1-10.9-7.2-17.2-5.3L220.3 92.1l-29.4-74C188.4 12 182.6 8 176 8zM367.7 161.5l135.6 36.3c6.5 1.8 11.3 7.4 11.8 14.2l4.6 56.5-201.5-54 32.2-46.6c3.8-5.6 10.8-8.1 17.3-6.4zm-69.9-30l-47.9 69.3c-21.6 3-40.3 18.6-46.3 41l-10.4 38.6-16.6 61.8-8.3 30.9c-4.6 17.1 5.6 34.6 22.6 39.2l15.5 4.1c17.1 4.6 34.6-5.6 39.2-22.6l8.3-30.9 247.3 66.3-8.3 30.9c-4.6 17.1 5.6 34.6 22.6 39.2l15.5 4.1c17.1 4.6 34.6-5.6 39.2-22.6l8.3-30.9L595 388l10.4-38.6c6-22.4-2.5-45.2-19.6-58.7l-6.8-84c-2.7-33.7-26.4-62-59-70.8L384.2 99.7c-32.7-8.8-67.3 4-86.5 31.8zm-17 131a24 24 0 1 1 -12.4 46.4 24 24 0 1 1 12.4-46.4zm217.9 83.2A24 24 0 1 1 545 358.1a24 24 0 1 1 -46.4-12.4z"]
};
const faCarCrash = faCarBurst;
const faY = {
  prefix: 'fas',
  iconName: 'y',
  icon: [384, 512, [121], "59", "M58 45.4C47.8 31 27.8 27.7 13.4 38S-4.3 68.2 6 82.6L160 298.3 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-149.7L378 82.6c10.3-14.4 6.9-34.4-7.4-44.6S336.2 31 326 45.4L192 232.9 58 45.4z"]
};
const faPersonSnowboarding = {
  prefix: 'fas',
  iconName: 'person-snowboarding',
  icon: [512, 512, [127938, "snowboarding"], "f7ce", "M209.7 3.4c15.8-7.9 35-1.5 42.9 14.3l25 50 42.4 8.5c19.5 3.9 37.8 12.3 53.5 24.5l126.1 98.1c14 10.9 16.5 31 5.6 44.9s-31 16.5-44.9 5.6l-72.1-56.1-71.5 31.8 33.1 27.6c23.2 19.3 33.5 50 26.7 79.4l-17.4 75.2c-2.2 9.4-8.2 16.8-16.1 21l86.5 33.1c4.6 1.8 9.4 2.6 14.3 2.6l28.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-28.2 0c-10.8 0-21.4-2-31.5-5.8L60.1 371.3c-11.5-4.4-22-11.2-30.8-20L7 329c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.4 22.4c4 4 8.7 7.1 14 9.1l22.4 8.6c-.8-1.6-1.5-3.2-2.1-4.9c-5.6-16.8 3.5-34.9 20.2-40.5L192 264.9l0-53.2c0-24.2 13.7-46.4 35.4-57.2l45.2-22.6-7.5-1.5c-19.4-3.9-35.9-16.5-44.7-34.1l-25-50c-7.9-15.8-1.5-35 14.3-42.9zM139 350.1l159 60.9c-2.1-5.6-2.6-11.9-1.1-18.2l17.4-75.2c1.4-5.9-.7-12-5.3-15.9l-52.8-44 0 18.8c0 20.7-13.2 39-32.8 45.5L139 350.1zM432 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faSnowboarding = faPersonSnowboarding;
const faTruckFast = {
  prefix: 'fas',
  iconName: 'truck-fast',
  icon: [640, 512, ["shipping-fast"], "f48b", "M112 0C85.5 0 64 21.5 64 48l0 48L16 96c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 208 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L64 160l-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l16 0 176 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L64 224l-48 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 144 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L64 288l0 128c0 53 43 96 96 96s96-43 96-96l128 0c0 53 43 96 96 96s96-43 96-96l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64 0-32 0-18.7c0-17-6.7-33.3-18.7-45.3L512 114.7c-12-12-28.3-18.7-45.3-18.7L416 96l0-48c0-26.5-21.5-48-48-48L112 0zM544 237.3l0 18.7-128 0 0-96 50.7 0L544 237.3zM160 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm272 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
};
const faShippingFast = faTruckFast;
const faFish = {
  prefix: 'fas',
  iconName: 'fish',
  icon: [576, 512, [128031], "f578", "M180.5 141.5C219.7 108.5 272.6 80 336 80s116.3 28.5 155.5 61.5c39.1 33 66.9 72.4 81 99.8c4.7 9.2 4.7 20.1 0 29.3c-14.1 27.4-41.9 66.8-81 99.8C452.3 403.5 399.4 432 336 432s-116.3-28.5-155.5-61.5c-16.2-13.7-30.5-28.5-42.7-43.1L48.1 379.6c-12.5 7.3-28.4 5.3-38.7-4.9S-3 348.7 4.2 336.1L50 256 4.2 175.9c-7.2-12.6-5-28.4 5.3-38.6s26.1-12.2 38.7-4.9l89.7 52.3c12.2-14.6 26.5-29.4 42.7-43.1zM448 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faUserGraduate = {
  prefix: 'fas',
  iconName: 'user-graduate',
  icon: [448, 512, [], "f501", "M219.3 .5c3.1-.6 6.3-.6 9.4 0l200 40C439.9 42.7 448 52.6 448 64s-8.1 21.3-19.3 23.5L352 102.9l0 57.1c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-57.1L48 93.3l0 65.1 15.7 78.4c.9 4.7-.3 9.6-3.3 13.3s-7.6 5.9-12.4 5.9l-32 0c-4.8 0-9.3-2.1-12.4-5.9s-4.3-8.6-3.3-13.3L16 158.4l0-71.8C6.5 83.3 0 74.3 0 64C0 52.6 8.1 42.7 19.3 40.5l200-40zM111.9 327.7c10.5-3.4 21.8 .4 29.4 8.5l71 75.5c6.3 6.7 17 6.7 23.3 0l71-75.5c7.6-8.1 18.9-11.9 29.4-8.5C401 348.6 448 409.4 448 481.3c0 17-13.8 30.7-30.7 30.7L30.7 512C13.8 512 0 498.2 0 481.3c0-71.9 47-132.7 111.9-153.6z"]
};
const faCircleHalfStroke = {
  prefix: 'fas',
  iconName: 'circle-half-stroke',
  icon: [512, 512, [9680, "adjust"], "f042", "M448 256c0-106-86-192-192-192l0 384c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faAdjust = faCircleHalfStroke;
const faClapperboard = {
  prefix: 'fas',
  iconName: 'clapperboard',
  icon: [512, 512, [], "e131", "M448 32l-86.1 0-1 1-127 127 92.1 0 1-1L453.8 32.3c-1.9-.2-3.8-.3-5.8-.3zm64 128l0-64c0-15.1-5.3-29.1-14-40l-104 104L512 160zM294.1 32l-92.1 0-1 1L73.9 160l92.1 0 1-1 127-127zM64 32C28.7 32 0 60.7 0 96l0 64 6.1 0 1-1 127-127L64 32zM512 192L0 192 0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224z"]
};
const faCircleRadiation = {
  prefix: 'fas',
  iconName: 'circle-radiation',
  icon: [512, 512, [9762, "radiation-alt"], "f7ba", "M256 64a192 192 0 1 1 0 384 192 192 0 1 1 0-384zm0 448A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM200 256c0-20.7 11.3-38.8 28-48.5l-36-62.3c-8.8-15.3-28.7-20.8-42-9c-25.6 22.6-43.9 53.3-50.9 88.1C95.7 241.5 110.3 256 128 256l72 0zm28 48.5l-36 62.4c-8.8 15.3-3.6 35.2 13.1 40.8c16 5.4 33.1 8.3 50.9 8.3s34.9-2.9 50.9-8.3c16.7-5.6 21.9-25.5 13.1-40.8l-36-62.4c-8.2 4.8-17.8 7.5-28 7.5s-19.8-2.7-28-7.5zM312 256l72 0c17.7 0 32.3-14.5 28.8-31.8c-7-34.8-25.3-65.5-50.9-88.1c-13.2-11.7-33.1-6.3-42 9l-36 62.3c16.7 9.7 28 27.8 28 48.5zm-56 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faRadiationAlt = faCircleRadiation;
const faBaseball = {
  prefix: 'fas',
  iconName: 'baseball',
  icon: [512, 512, [129358, 9918, "baseball-ball"], "f433", "M62.7 223.4c-4.8 .4-9.7 .6-14.7 .6c-15.6 0-30.8-2-45.2-5.9C19.2 107.1 107.1 19.2 218.1 2.8C222 17.2 224 32.4 224 48c0 4.9-.2 9.8-.6 14.7c-.7 8.8 5.8 16.5 14.6 17.3s16.5-5.8 17.3-14.6c.5-5.7 .7-11.5 .7-17.3c0-16.5-1.9-32.6-5.6-47.9c1.8 0 3.7-.1 5.6-.1C397.4 0 512 114.6 512 256c0 1.9 0 3.7-.1 5.6c-15.4-3.6-31.4-5.6-47.9-5.6c-5.8 0-11.6 .2-17.3 .7c-8.8 .7-15.4 8.5-14.6 17.3s8.5 15.4 17.3 14.6c4.8-.4 9.7-.6 14.7-.6c15.6 0 30.8 2 45.2 5.9C492.8 404.9 404.9 492.8 293.9 509.2C290 494.8 288 479.6 288 464c0-4.9 .2-9.8 .6-14.7c.7-8.8-5.8-16.5-14.6-17.3s-16.5 5.8-17.3 14.6c-.5 5.7-.7 11.5-.7 17.3c0 16.5 1.9 32.6 5.6 47.9c-1.8 0-3.7 .1-5.6 .1C114.6 512 0 397.4 0 256c0-1.9 0-3.7 .1-5.6C15.4 254.1 31.5 256 48 256c5.8 0 11.6-.2 17.3-.7c8.8-.7 15.4-8.5 14.6-17.3s-8.5-15.4-17.3-14.6zM121.3 208c-8 3.7-11.6 13.2-7.9 21.2s13.2 11.6 21.2 7.9c45.2-20.8 81.7-57.2 102.5-102.5c3.7-8 .2-17.5-7.9-21.2s-17.5-.2-21.2 7.9c-17.6 38.3-48.5 69.2-86.7 86.7zm277.2 74.7c-3.7-8-13.2-11.6-21.2-7.9c-45.2 20.8-81.7 57.2-102.5 102.5c-3.7 8-.2 17.5 7.9 21.2s17.5 .2 21.2-7.9c17.6-38.3 48.5-69.2 86.7-86.7c8-3.7 11.6-13.2 7.9-21.2z"]
};
const faBaseballBall = faBaseball;
const faJetFighterUp = {
  prefix: 'fas',
  iconName: 'jet-fighter-up',
  icon: [512, 512, [], "e518", "M270.7 9.7C268.2 3.8 262.4 0 256 0s-12.2 3.8-14.7 9.7L197.2 112.6c-3.4 8-5.2 16.5-5.2 25.2l0 77-144 84L48 280c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 56 0 32 0 24c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8 144 0 0 32.7L133.5 468c-3.5 3-5.5 7.4-5.5 12l0 16c0 8.8 7.2 16 16 16l96 0 0-64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64 96 0c8.8 0 16-7.2 16-16l0-16c0-4.6-2-9-5.5-12L320 416.7l0-32.7 144 0 0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-24 0-32 0-56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 18.8-144-84 0-77c0-8.7-1.8-17.2-5.2-25.2L270.7 9.7z"]
};
const faDiagramProject = {
  prefix: 'fas',
  iconName: 'diagram-project',
  icon: [576, 512, ["project-diagram"], "f542", "M0 80C0 53.5 21.5 32 48 32l96 0c26.5 0 48 21.5 48 48l0 16 192 0 0-16c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-16-192 0 0 16c0 1.7-.1 3.4-.3 5L272 288l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96c0-1.7 .1-3.4 .3-5L144 224l-96 0c-26.5 0-48-21.5-48-48L0 80z"]
};
const faProjectDiagram = faDiagramProject;
const faCopy = {
  prefix: 'fas',
  iconName: 'copy',
  icon: [448, 512, [], "f0c5", "M208 0L332.1 0c12.7 0 24.9 5.1 33.9 14.1l67.9 67.9c9 9 14.1 21.2 14.1 33.9L448 336c0 26.5-21.5 48-48 48l-192 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48zM48 128l80 0 0 64-64 0 0 256 192 0 0-32 64 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 176c0-26.5 21.5-48 48-48z"]
};
const faVolumeXmark = {
  prefix: 'fas',
  iconName: 'volume-xmark',
  icon: [576, 512, ["volume-mute", "volume-times"], "f6a9", "M301.1 34.8C312.6 40 320 51.4 320 64l0 384c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352 64 352c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l67.8 0L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM425 167l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"]
};
const faVolumeMute = faVolumeXmark;
const faVolumeTimes = faVolumeXmark;
const faHandSparkles = {
  prefix: 'fas',
  iconName: 'hand-sparkles',
  icon: [640, 512, [], "e05d", "M320 0c17.7 0 32 14.3 32 32l0 208c0 8.8 7.2 16 16 16s16-7.2 16-16l0-176c0-17.7 14.3-32 32-32s32 14.3 32 32l0 176c0 8.8 7.2 16 16 16s16-7.2 16-16l0-112c0-17.7 14.3-32 32-32s32 14.3 32 32l0 195.1c-11.9 4.8-21.3 14.9-25 27.8l-8.9 31.2L478.9 391C460.6 396.3 448 413 448 432c0 18.9 12.5 35.6 30.6 40.9C448.4 497.4 409.9 512 368 512l-19.2 0c-59.6 0-116.9-22.9-160-64L76.4 341c-16-15.2-16.6-40.6-1.4-56.6s40.6-16.6 56.6-1.4l60.5 57.6c0-1.5-.1-3.1-.1-4.6l0-272c0-17.7 14.3-32 32-32s32 14.3 32 32l0 176c0 8.8 7.2 16 16 16s16-7.2 16-16l0-208c0-17.7 14.3-32 32-32zm-7.3 326.6c-1.1-3.9-4.7-6.6-8.7-6.6s-7.6 2.7-8.7 6.6L288 352l-25.4 7.3c-3.9 1.1-6.6 4.7-6.6 8.7s2.7 7.6 6.6 8.7L288 384l7.3 25.4c1.1 3.9 4.7 6.6 8.7 6.6s7.6-2.7 8.7-6.6L320 384l25.4-7.3c3.9-1.1 6.6-4.7 6.6-8.7s-2.7-7.6-6.6-8.7L320 352l-7.3-25.4zM104 120l48.3 13.8c4.6 1.3 7.7 5.5 7.7 10.2s-3.1 8.9-7.7 10.2L104 168 90.2 216.3c-1.3 4.6-5.5 7.7-10.2 7.7s-8.9-3.1-10.2-7.7L56 168 7.7 154.2C3.1 152.9 0 148.7 0 144s3.1-8.9 7.7-10.2L56 120 69.8 71.7C71.1 67.1 75.3 64 80 64s8.9 3.1 10.2 7.7L104 120zM584 408l48.3 13.8c4.6 1.3 7.7 5.5 7.7 10.2s-3.1 8.9-7.7 10.2L584 456l-13.8 48.3c-1.3 4.6-5.5 7.7-10.2 7.7s-8.9-3.1-10.2-7.7L536 456l-48.3-13.8c-4.6-1.3-7.7-5.5-7.7-10.2s3.1-8.9 7.7-10.2L536 408l13.8-48.3c1.3-4.6 5.5-7.7 10.2-7.7s8.9 3.1 10.2 7.7L584 408z"]
};
const faGrip = {
  prefix: 'fas',
  iconName: 'grip',
  icon: [448, 512, ["grip-horizontal"], "f58d", "M128 136c0-22.1-17.9-40-40-40L40 96C17.9 96 0 113.9 0 136l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zm0 192c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zm32-192l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM288 328c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zm32-192l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM448 328c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48z"]
};
const faGripHorizontal = faGrip;
const faShareFromSquare = {
  prefix: 'fas',
  iconName: 'share-from-square',
  icon: [576, 512, [61509, "share-square"], "f14d", "M352 224l-46.5 0c-45 0-81.5 36.5-81.5 81.5c0 22.3 10.3 34.3 19.2 40.5c6.8 4.7 12.8 12 12.8 20.3c0 9.8-8 17.8-17.8 17.8l-2.5 0c-2.4 0-4.8-.4-7.1-1.4C210.8 374.8 128 333.4 128 240c0-79.5 64.5-144 144-144l80 0 0-61.3C352 15.5 367.5 0 386.7 0c8.6 0 16.8 3.2 23.2 8.9L548.1 133.3c7.6 6.8 11.9 16.5 11.9 26.7s-4.3 19.9-11.9 26.7l-139 125.1c-5.9 5.3-13.5 8.2-21.4 8.2l-3.7 0c-17.7 0-32-14.3-32-32l0-64zM80 96c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-48c0-17.7 14.3-32 32-32s32 14.3 32 32l0 48c0 44.2-35.8 80-80 80L80 512c-44.2 0-80-35.8-80-80L0 112C0 67.8 35.8 32 80 32l48 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 96z"]
};
const faShareSquare = faShareFromSquare;
const faChildCombatant = {
  prefix: 'fas',
  iconName: 'child-combatant',
  icon: [576, 512, ["child-rifle"], "e4e0", "M176 128A64 64 0 1 0 176 0a64 64 0 1 0 0 128zm-8 352l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-179.5L260.9 321c9.4 15 29.2 19.4 44.1 10s19.4-29.2 10-44.1l-51.7-82.1c-17.6-27.9-48.3-44.9-81.2-44.9l-12.3 0c-33 0-63.7 16.9-81.2 44.9L36.9 287c-9.4 15-4.9 34.7 10 44.1s34.7 4.9 44.1-10L104 300.5 104 480c0 17.7 14.3 32 32 32s32-14.3 32-32zM448 0L432 0 416 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l0 100.3c-9.6 5.5-16 15.9-16 27.7l0 32c-17.7 0-32 14.3-32 32l0 144c0 17.7 14.3 32 32 32l16 0 0 96c0 8.8 7.2 16 16 16l59.5 0c10.4 0 18-9.8 15.5-19.9L484 400l44 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-48 0 0-26.7 53.1-17.7c6.5-2.2 10.9-8.3 10.9-15.2l0-84.5c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16l0 56-16 5.3L480 160c0-11.8-6.4-22.2-16-27.7L464 16c0-8.8-7.2-16-16-16z"]
};
const faChildRifle = faChildCombatant;
const faGun = {
  prefix: 'fas',
  iconName: 'gun',
  icon: [576, 512, [], "e19b", "M528 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 8L32 64C14.3 64 0 78.3 0 96L0 208c0 17.7 14.3 32 32 32l10 0c20.8 0 36.1 19.6 31 39.8L33 440.2c-2.4 9.6-.2 19.7 5.8 27.5S54.1 480 64 480l96 0c14.7 0 27.5-10 31-24.2L217 352l104.5 0c23.7 0 44.8-14.9 52.7-37.2L400.9 240l31.1 0c8.5 0 16.6-3.4 22.6-9.4L477.3 208l66.7 0c17.7 0 32-14.3 32-32l0-80c0-17.7-14.3-32-32-32l-16 0 0-8zM321.4 304L229 304l16-64 105 0-21 58.7c-1.1 3.2-4.2 5.3-7.5 5.3zM80 128l384 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 160c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faSquarePhone = {
  prefix: 'fas',
  iconName: 'square-phone',
  icon: [448, 512, ["phone-square"], "f098", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm90.7 96.7c9.7-2.6 19.9 2.3 23.7 11.6l20 48c3.4 8.2 1 17.6-5.8 23.2L168 231.7c16.6 35.2 45.1 63.7 80.3 80.3l20.2-24.7c5.6-6.8 15-9.2 23.2-5.8l48 20c9.3 3.9 14.2 14 11.6 23.7l-12 44C336.9 378 329 384 320 384C196.3 384 96 283.7 96 160c0-9 6-16.9 14.7-19.3l44-12z"]
};
const faPhoneSquare = faSquarePhone;
const faPlus = {
  prefix: 'fas',
  iconName: 'plus',
  icon: [448, 512, [10133, 61543, "add"], "2b", "M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]
};
const faAdd = faPlus;
const faExpand = {
  prefix: 'fas',
  iconName: 'expand',
  icon: [448, 512, [], "f065", "M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"]
};
const faComputer = {
  prefix: 'fas',
  iconName: 'computer',
  icon: [640, 512, [], "e4e5", "M384 96l0 224L64 320 64 96l320 0zM64 32C28.7 32 0 60.7 0 96L0 320c0 35.3 28.7 64 64 64l117.3 0-10.7 32L96 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-74.7 0-10.7-32L384 384c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L64 32zm464 0c-26.5 0-48 21.5-48 48l0 352c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48l-64 0zm16 64l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm-16 80c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zm32 160a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faXmark = {
  prefix: 'fas',
  iconName: 'xmark',
  icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]
};
const faClose = faXmark;
const faMultiply = faXmark;
const faRemove = faXmark;
const faTimes = faXmark;
const faArrowsUpDownLeftRight = {
  prefix: 'fas',
  iconName: 'arrows-up-down-left-right',
  icon: [512, 512, ["arrows"], "f047", "M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4L224 224l-114.7 0 9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4L224 288l0 114.7-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4L288 288l114.7 0-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4L288 224l0-114.7 9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z"]
};
const faArrows = faArrowsUpDownLeftRight;
const faChalkboardUser = {
  prefix: 'fas',
  iconName: 'chalkboard-user',
  icon: [640, 512, ["chalkboard-teacher"], "f51c", "M160 64c0-35.3 28.7-64 64-64L576 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64l-239.2 0c-11.8-25.5-29.9-47.5-52.4-64l99.6 0 0-32c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 32 64 0 0-288L224 64l0 49.1C205.2 102.2 183.3 96 160 96l0-32zm0 64a96 96 0 1 1 0 192 96 96 0 1 1 0-192zM133.3 352l53.3 0C260.3 352 320 411.7 320 485.3c0 14.7-11.9 26.7-26.7 26.7L26.7 512C11.9 512 0 500.1 0 485.3C0 411.7 59.7 352 133.3 352z"]
};
const faChalkboardTeacher = faChalkboardUser;
const faPesoSign = {
  prefix: 'fas',
  iconName: 'peso-sign',
  icon: [384, 512, [], "e222", "M64 32C46.3 32 32 46.3 32 64l0 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 64 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 80 0c68.4 0 127.7-39 156.8-96l19.2 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-.7 0c.5-5.3 .7-10.6 .7-16s-.2-10.7-.7-16l.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-19.2 0C303.7 71 244.4 32 176 32L64 32zm190.4 96L96 128l0-32 80 0c30.5 0 58.2 12.2 78.4 32zM96 192l190.9 0c.7 5.2 1.1 10.6 1.1 16s-.4 10.8-1.1 16L96 224l0-32zm158.4 96c-20.2 19.8-47.9 32-78.4 32l-80 0 0-32 158.4 0z"]
};
const faBuildingShield = {
  prefix: 'fas',
  iconName: 'building-shield',
  icon: [576, 512, [], "e4d8", "M0 48C0 21.5 21.5 0 48 0L336 0c26.5 0 48 21.5 48 48l0 159-42.4 17L304 224l-32 0c-8.8 0-16 7.2-16 16l0 32 0 24.2 0 7.8c0 .9 .1 1.7 .2 2.6c2.3 58.1 24.1 144.8 98.7 201.5c-5.8 2.5-12.2 3.9-18.9 3.9l-96 0 0-80c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 80-96 0c-26.5 0-48-21.5-48-48L0 48zM80 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM64 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L80 96c-8.8 0-16 7.2-16 16zM176 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM423.1 225.7c5.7-2.3 12.1-2.3 17.8 0l120 48C570 277.4 576 286.2 576 296c0 63.3-25.9 168.8-134.8 214.2c-5.9 2.5-12.6 2.5-18.5 0C313.9 464.8 288 359.3 288 296c0-9.8 6-18.6 15.1-22.3l120-48zM527.4 312L432 273.8l0 187.8c68.2-33 91.5-99 95.4-149.7z"]
};
const faBaby = {
  prefix: 'fas',
  iconName: 'baby',
  icon: [448, 512, [], "f77c", "M152 88a72 72 0 1 1 144 0A72 72 0 1 1 152 88zM39.7 144.5c13-17.9 38-21.8 55.9-8.8L131.8 162c26.8 19.5 59.1 30 92.2 30s65.4-10.5 92.2-30l36.2-26.4c17.9-13 42.9-9 55.9 8.8s9 42.9-8.8 55.9l-36.2 26.4c-13.6 9.9-28.1 18.2-43.3 25l0 36.3-192 0 0-36.3c-15.2-6.7-29.7-15.1-43.3-25L48.5 200.3c-17.9-13-21.8-38-8.8-55.9zm89.8 184.8l60.6 53-26 37.2 24.3 24.3c15.6 15.6 15.6 40.9 0 56.6s-40.9 15.6-56.6 0l-48-48C70 438.6 68.1 417 79.2 401.1l50.2-71.8zm128.5 53l60.6-53 50.2 71.8c11.1 15.9 9.2 37.5-4.5 51.2l-48 48c-15.6 15.6-40.9 15.6-56.6 0s-15.6-40.9 0-56.6L284 419.4l-26-37.2z"]
};
const faUsersLine = {
  prefix: 'fas',
  iconName: 'users-line',
  icon: [640, 512, [], "e592", "M211.2 96a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM32 256c0 17.7 14.3 32 32 32l85.6 0c10.1-39.4 38.6-71.5 75.8-86.6c-9.7-6-21.2-9.4-33.4-9.4l-96 0c-35.3 0-64 28.7-64 64zm461.6 32l82.4 0c17.7 0 32-14.3 32-32c0-35.3-28.7-64-64-64l-96 0c-11.7 0-22.7 3.1-32.1 8.6c38.1 14.8 67.4 47.3 77.7 87.4zM391.2 226.4c-6.9-1.6-14.2-2.4-21.6-2.4l-96 0c-8.5 0-16.7 1.1-24.5 3.1c-30.8 8.1-55.6 31.1-66.1 60.9c-3.5 10-5.5 20.8-5.5 32c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32c0-11.2-1.9-22-5.5-32c-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM321.6 192a80 80 0 1 0 0-160 80 80 0 1 0 0 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416z"]
};
const faQuoteLeft = {
  prefix: 'fas',
  iconName: 'quote-left',
  icon: [448, 512, [8220, "quote-left-alt"], "f10d", "M0 216C0 149.7 53.7 96 120 96l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-32 0-32 0-72zm256 0c0-66.3 53.7-120 120-120l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-32 0-32 0-72z"]
};
const faQuoteLeftAlt = faQuoteLeft;
const faTractor = {
  prefix: 'fas',
  iconName: 'tractor',
  icon: [640, 512, [128668], "f722", "M96 64c0-35.3 28.7-64 64-64L266.3 0c26.2 0 49.7 15.9 59.4 40.2L373.7 160 480 160l0-33.8c0-24.8 5.8-49.3 16.9-71.6l2.5-5c7.9-15.8 27.1-22.2 42.9-14.3s22.2 27.1 14.3 42.9l-2.5 5c-6.7 13.3-10.1 28-10.1 42.9l0 33.8 56 0c22.1 0 40 17.9 40 40l0 45.4c0 16.5-8.5 31.9-22.6 40.7l-43.3 27.1c-14.2-5.9-29.8-9.2-46.1-9.2c-39.3 0-74.1 18.9-96 48l-80 0c0 17.7-14.3 32-32 32l-8.2 0c-1.7 4.8-3.7 9.5-5.8 14.1l5.8 5.8c12.5 12.5 12.5 32.8 0 45.3l-22.6 22.6c-12.5 12.5-32.8 12.5-45.3 0l-5.8-5.8c-4.6 2.2-9.3 4.1-14.1 5.8l0 8.2c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-8.2c-4.8-1.7-9.5-3.7-14.1-5.8l-5.8 5.8c-12.5 12.5-32.8 12.5-45.3 0L40.2 449.1c-12.5-12.5-12.5-32.8 0-45.3l5.8-5.8c-2.2-4.6-4.1-9.3-5.8-14.1L32 384c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32l8.2 0c1.7-4.8 3.7-9.5 5.8-14.1l-5.8-5.8c-12.5-12.5-12.5-32.8 0-45.3l22.6-22.6c9-9 21.9-11.5 33.1-7.6l0-.6 0-32 0-96zm170.3 0L160 64l0 96 32 0 112.7 0L266.3 64zM176 256a80 80 0 1 0 0 160 80 80 0 1 0 0-160zM528 448a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0 64c-48.6 0-88-39.4-88-88c0-29.8 14.8-56.1 37.4-72c14.3-10.1 31.8-16 50.6-16c2.7 0 5.3 .1 7.9 .3c44.9 4 80.1 41.7 80.1 87.7c0 48.6-39.4 88-88 88z"]
};
const faTrashArrowUp = {
  prefix: 'fas',
  iconName: 'trash-arrow-up',
  icon: [448, 512, ["trash-restore"], "f829", "M163.8 0L284.2 0c12.1 0 23.2 6.8 28.6 17.7L320 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 7.2-14.3C140.6 6.8 151.7 0 163.8 0zM32 128l384 0L394.8 467c-1.6 25.3-22.6 45-47.9 45l-245.8 0c-25.3 0-46.3-19.7-47.9-45L32 128zm192 64c-6.4 0-12.5 2.5-17 7l-80 80c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39L200 408c0 13.3 10.7 24 24 24s24-10.7 24-24l0-134.1 39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-4.5-4.5-10.6-7-17-7z"]
};
const faTrashRestore = faTrashArrowUp;
const faArrowDownUpLock = {
  prefix: 'fas',
  iconName: 'arrow-down-up-lock',
  icon: [640, 512, [], "e4b0", "M150.6 502.6l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 402.7 160 288l256 0 0-16c0-17.2 3.9-33.5 10.8-48L352 224l0-114.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-6-6-14.1-9.4-22.6-9.4s-16.6 3.4-22.6 9.4l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L288 109.3 288 224l-128 0-64 0-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 114.7L54.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0zM160 192l0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 128 64 0zM288 320l0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128-64 0zm240-80c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faLinesLeaning = {
  prefix: 'fas',
  iconName: 'lines-leaning',
  icon: [384, 512, [], "e51e", "M190.4 74.1c5.6-16.8-3.5-34.9-20.2-40.5s-34.9 3.5-40.5 20.2l-128 384c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l128-384zm70.9-41.7c-17.4-2.9-33.9 8.9-36.8 26.3l-64 384c-2.9 17.4 8.9 33.9 26.3 36.8s33.9-8.9 36.8-26.3l64-384c2.9-17.4-8.9-33.9-26.3-36.8zM352 32c-17.7 0-32 14.3-32 32l0 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32z"]
};
const faRulerCombined = {
  prefix: 'fas',
  iconName: 'ruler-combined',
  icon: [512, 512, [], "f546", "M.2 468.9C2.7 493.1 23.1 512 48 512l96 0 320 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-48 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-64-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-64-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-48c0-26.5-21.5-48-48-48L48 0C21.5 0 0 21.5 0 48L0 368l0 96c0 1.7 .1 3.3 .2 4.9z"]
};
const faCopyright = {
  prefix: 'fas',
  iconName: 'copyright',
  icon: [512, 512, [169], "f1f9", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM199.4 312.6c31.2 31.2 81.9 31.2 113.1 0c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-50 50-131 50-181 0s-50-131 0-181s131-50 181 0c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-31.2-31.2-81.9-31.2-113.1 0s-31.2 81.9 0 113.1z"]
};
const faEquals = {
  prefix: 'fas',
  iconName: 'equals',
  icon: [448, 512, [62764], "3d", "M48 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l352 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48 128zm0 192c-17.7 0-32 14.3-32 32s14.3 32 32 32l352 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48 320z"]
};
const faBlender = {
  prefix: 'fas',
  iconName: 'blender',
  icon: [512, 512, [], "f517", "M0 64C0 28.7 28.7 0 64 0l64 0 32 0L470.1 0c21.1 0 36.4 20.1 30.9 40.4L494.5 64 336 64c-8.8 0-16 7.2-16 16s7.2 16 16 16l149.8 0-17.5 64L336 160c-8.8 0-16 7.2-16 16s7.2 16 16 16l123.6 0-17.5 64L336 256c-8.8 0-16 7.2-16 16s7.2 16 16 16l97.5 0L416 352l-256 0-8.7-96L64 256c-35.3 0-64-28.7-64-64L0 64zM145.5 192L133.8 64 64 64l0 128 81.5 0zM144 384l288 0c26.5 0 48 21.5 48 48l0 32c0 26.5-21.5 48-48 48l-288 0c-26.5 0-48-21.5-48-48l0-32c0-26.5 21.5-48 48-48zm144 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faTeeth = {
  prefix: 'fas',
  iconName: 'teeth',
  icon: [576, 512, [], "f62e", "M0 128C0 75 43 32 96 32l384 0c53 0 96 43 96 96l0 256c0 53-43 96-96 96L96 480c-53 0-96-43-96-96L0 128zm176 48l0 56c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-56c0-26.5-21.5-48-48-48s-48 21.5-48 48zm176-48c-26.5 0-48 21.5-48 48l0 56c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-56c0-26.5-21.5-48-48-48zM48 208l0 24c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-24c0-26.5-21.5-48-48-48s-48 21.5-48 48zM96 384c26.5 0 48-21.5 48-48l0-24c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24l0 24c0 26.5 21.5 48 48 48zm80-48c0 26.5 21.5 48 48 48s48-21.5 48-48l0-24c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24l0 24zm176 48c26.5 0 48-21.5 48-48l0-24c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24l0 24c0 26.5 21.5 48 48 48zm80-176l0 24c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-24c0-26.5-21.5-48-48-48s-48 21.5-48 48zm48 176c26.5 0 48-21.5 48-48l0-24c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24l0 24c0 26.5 21.5 48 48 48z"]
};
const faShekelSign = {
  prefix: 'fas',
  iconName: 'shekel-sign',
  icon: [448, 512, [8362, "ils", "shekel", "sheqel", "sheqel-sign"], "f20b", "M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32L64 96l128 0c35.3 0 64 28.7 64 64l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-70.7-57.3-128-128-128L32 32zM320 480c70.7 0 128-57.3 128-128l0-288c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 288c0 35.3-28.7 64-64 64l-128 0 0-224c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l160 0z"]
};
const faIls = faShekelSign;
const faShekel = faShekelSign;
const faSheqel = faShekelSign;
const faSheqelSign = faShekelSign;
const faMap = {
  prefix: 'fas',
  iconName: 'map',
  icon: [576, 512, [128506, 62072], "f279", "M384 476.1L192 421.2l0-385.3L384 90.8l0 385.3zm32-1.2l0-386.5L543.1 37.5c15.8-6.3 32.9 5.3 32.9 22.3l0 334.8c0 9.8-6 18.6-15.1 22.3L416 474.8zM15.1 95.1L160 37.2l0 386.5L32.9 474.5C17.1 480.8 0 469.2 0 452.2L0 117.4c0-9.8 6-18.6 15.1-22.3z"]
};
const faRocket = {
  prefix: 'fas',
  iconName: 'rocket',
  icon: [512, 512, [], "f135", "M156.6 384.9L125.7 354c-8.5-8.5-11.5-20.8-7.7-32.2c3-8.9 7-20.5 11.8-33.8L24 288c-8.6 0-16.6-4.6-20.9-12.1s-4.2-16.7 .2-24.1l52.5-88.5c13-21.9 36.5-35.3 61.9-35.3l82.3 0c2.4-4 4.8-7.7 7.2-11.3C289.1-4.1 411.1-8.1 483.9 5.3c11.6 2.1 20.6 11.2 22.8 22.8c13.4 72.9 9.3 194.8-111.4 276.7c-3.5 2.4-7.3 4.8-11.3 7.2l0 82.3c0 25.4-13.4 49-35.3 61.9l-88.5 52.5c-7.4 4.4-16.6 4.5-24.1 .2s-12.1-12.2-12.1-20.9l0-107.2c-14.1 4.9-26.4 8.9-35.7 11.9c-11.2 3.6-23.4 .5-31.8-7.8zM384 168a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faPhotoFilm = {
  prefix: 'fas',
  iconName: 'photo-film',
  icon: [640, 512, ["photo-video"], "f87c", "M256 0L576 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64l0-224c0-35.3 28.7-64 64-64zM476 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84L362.7 169c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l80 0 48 0 144 0c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6l-96-144zM336 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM64 128l96 0 0 256 0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32 160 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zm8 64c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm336 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z"]
};
const faPhotoVideo = faPhotoFilm;
const faFolderMinus = {
  prefix: 'fas',
  iconName: 'folder-minus',
  icon: [512, 512, [], "f65d", "M448 480L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l128 0c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8l160 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64zM184 272c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]
};
const faHexagonNodesBolt = {
  prefix: 'fas',
  iconName: 'hexagon-nodes-bolt',
  icon: [576, 512, [], "e69a", "M248 106.6c18.9-9 32-28.3 32-50.6c0-30.9-25.1-56-56-56s-56 25.1-56 56c0 22.3 13.1 41.6 32 50.6l0 98.8c-2.8 1.3-5.5 2.9-8 4.7l-80.1-45.8c1.6-20.8-8.6-41.6-27.9-52.8C57.2 96 23 105.2 7.5 132S1.2 193 28 208.5c1.3 .8 2.6 1.5 4 2.1l0 90.8c-1.3 .6-2.7 1.3-4 2.1C1.2 319-8 353.2 7.5 380S57.2 416 84 400.5c19.3-11.1 29.4-32 27.8-52.8l50.5-28.9c-11.5-11.2-19.9-25.6-23.8-41.7L88 306.1c-2.6-1.8-5.2-3.3-8-4.7l0-90.8c2.8-1.3 5.5-2.9 8-4.7l80.1 45.8c-.1 1.4-.2 2.8-.2 4.3c0 22.3 13.1 41.6 32 50.6l0 98.8c-18.9 9-32 28.3-32 50.6c0 30.9 25.1 56 56 56c30.7 0 55.6-24.7 56-55.2c-7.5-12.9-13.5-26.8-17.6-41.5c-4.2-4-9.1-7.3-14.4-9.9l0-98.8c2.8-1.3 5.5-2.9 8-4.7l10.5 6c5.5-15.3 13.1-29.5 22.4-42.5l-9.1-5.2c.1-1.4 .2-2.8 .2-4.3c0-22.3-13.1-41.6-32-50.6l0-98.8zM440.5 132C425 105.2 390.8 96 364 111.5c-19.3 11.1-29.4 32-27.8 52.8l-50.6 28.9c11.5 11.2 19.9 25.6 23.8 41.7L360 205.9c.4 .3 .8 .6 1.3 .9c21.7-9.5 45.6-14.8 70.8-14.8c2 0 4 0 5.9 .1c12.1-17.3 13.8-40.6 2.6-60.1zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm47.9-225c4.3 3.7 5.4 9.9 2.6 14.9L452.4 356l35.6 0c5.2 0 9.8 3.3 11.4 8.2s-.1 10.3-4.2 13.4l-96 72c-4.5 3.4-10.8 3.2-15.1-.6s-5.4-9.9-2.6-14.9L411.6 380 376 380c-5.2 0-9.8-3.3-11.4-8.2s.1-10.3 4.2-13.4l96-72c4.5-3.4 10.8-3.2 15.1 .6z"]
};
const faStore = {
  prefix: 'fas',
  iconName: 'store',
  icon: [576, 512, [], "f54e", "M547.6 103.8L490.3 13.1C485.2 5 476.1 0 466.4 0L109.6 0C99.9 0 90.8 5 85.7 13.1L28.3 103.8c-29.6 46.8-3.4 111.9 51.9 119.4c4 .5 8.1 .8 12.1 .8c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.2 0 49.3-11.4 65.2-29c16 17.6 39.1 29 65.2 29c4.1 0 8.1-.3 12.1-.8c55.5-7.4 81.8-72.5 52.1-119.4zM499.7 254.9c0 0 0 0-.1 0c-5.3 .7-10.7 1.1-16.2 1.1c-12.4 0-24.3-1.9-35.4-5.3L448 384l-320 0 0-133.4c-11.2 3.5-23.2 5.4-35.6 5.4c-5.5 0-11-.4-16.3-1.1l-.1 0c-4.1-.6-8.1-1.3-12-2.3L64 384l0 64c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-64 0-131.4c-4 1-8 1.8-12.3 2.3z"]
};
const faArrowTrendUp = {
  prefix: 'fas',
  iconName: 'arrow-trend-up',
  icon: [576, 512, [], "e098", "M384 160c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-82.7L342.6 374.6c-12.5 12.5-32.8 12.5-45.3 0L192 269.3 54.6 406.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160c12.5-12.5 32.8-12.5 45.3 0L320 306.7 466.7 160 384 160z"]
};
const faPlugCircleMinus = {
  prefix: 'fas',
  iconName: 'plug-circle-minus',
  icon: [576, 512, [], "e55e", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-64 0c0 8.8-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l128 0c8.8 0 16 7.2 16 16z"]
};
const faSignHanging = {
  prefix: 'fas',
  iconName: 'sign-hanging',
  icon: [512, 512, ["sign"], "f4d9", "M96 0c17.7 0 32 14.3 32 32l0 32 352 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-352 0 0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352-32 0C14.3 128 0 113.7 0 96S14.3 64 32 64l32 0 0-32C64 14.3 78.3 0 96 0zm96 160l256 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32z"]
};
const faSign = faSignHanging;
const faBezierCurve = {
  prefix: 'fas',
  iconName: 'bezier-curve',
  icon: [640, 512, [], "f55b", "M296 136l0-48 48 0 0 48-48 0zM288 32c-26.5 0-48 21.5-48 48l0 4L121.6 84C111.2 62.7 89.3 48 64 48C28.7 48 0 76.7 0 112s28.7 64 64 64c25.3 0 47.2-14.7 57.6-36l66.9 0c-58.9 39.6-98.9 105-104 180L80 320c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-3.3 0c5.9-67 48.5-123.4 107.5-149.1c8.6 12.7 23.2 21.1 39.8 21.1l64 0c16.6 0 31.1-8.4 39.8-21.1c59 25.7 101.6 82.1 107.5 149.1l-3.3 0c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-4.5 0c-5-75-45.1-140.4-104-180l66.9 0c10.4 21.3 32.3 36 57.6 36c35.3 0 64-28.7 64-64s-28.7-64-64-64c-25.3 0-47.2 14.7-57.6 36L400 84l0-4c0-26.5-21.5-48-48-48l-64 0zM88 376l48 0 0 48-48 0 0-48zm416 48l0-48 48 0 0 48-48 0z"]
};
const faBellSlash = {
  prefix: 'fas',
  iconName: 'bell-slash',
  icon: [640, 512, [128277, 61943], "f1f6", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-90.2-70.7c.2-.4 .4-.9 .6-1.3c5.2-11.5 3.1-25-5.3-34.4l-7.4-8.3C497.3 319.2 480 273.9 480 226.8l0-18.8c0-77.4-55-142-128-156.8L352 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 19.2c-42.6 8.6-79 34.2-102 69.3L38.8 5.1zM406.2 416L160 222.1l0 4.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S115.4 416 128 416l278.2 0zm-40.9 77.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"]
};
const faTablet = {
  prefix: 'fas',
  iconName: 'tablet',
  icon: [448, 512, ["tablet-android"], "f3fb", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM176 432l96 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faTabletAndroid = faTablet;
const faSchoolFlag = {
  prefix: 'fas',
  iconName: 'school-flag',
  icon: [576, 512, [], "e56e", "M288 0L400 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-79.3 0 89.6 64L512 160c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-176 0 0-112c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 112L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l101.7 0L256 95.5 256 32c0-17.7 14.3-32 32-32zm48 240a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM80 224c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0zm368 16l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM80 352c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0zm384 0c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0z"]
};
const faFill = {
  prefix: 'fas',
  iconName: 'fill',
  icon: [512, 512, [], "f575", "M86.6 9.4C74.1-3.1 53.9-3.1 41.4 9.4s-12.5 32.8 0 45.3L122.7 136 30.6 228.1c-37.5 37.5-37.5 98.3 0 135.8L148.1 481.4c37.5 37.5 98.3 37.5 135.8 0L474.3 290.9c28.1-28.1 28.1-73.7 0-101.8L322.9 37.7c-28.1-28.1-73.7-28.1-101.8 0L168 90.7 86.6 9.4zM168 181.3l49.4 49.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L213.3 136l53.1-53.1c3.1-3.1 8.2-3.1 11.3 0L429.1 234.3c3.1 3.1 3.1 8.2 0 11.3L386.7 288 67.5 288c1.4-5.4 4.2-10.4 8.4-14.6L168 181.3z"]
};
const faAngleUp = {
  prefix: 'fas',
  iconName: 'angle-up',
  icon: [448, 512, [8963], "f106", "M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"]
};
const faDrumstickBite = {
  prefix: 'fas',
  iconName: 'drumstick-bite',
  icon: [512, 512, [], "f6d7", "M160 265.2c0 8.5-3.4 16.6-9.4 22.6l-26.8 26.8c-12.3 12.3-32.5 11.4-49.4 7.2C69.8 320.6 65 320 60 320c-33.1 0-60 26.9-60 60s26.9 60 60 60c6.3 0 12 5.7 12 12c0 33.1 26.9 60 60 60s60-26.9 60-60c0-5-.6-9.8-1.8-14.5c-4.2-16.9-5.2-37.1 7.2-49.4l26.8-26.8c6-6 14.1-9.4 22.6-9.4l89.2 0c6.3 0 12.4-.3 18.5-1c11.9-1.2 16.4-15.5 10.8-26c-8.5-15.8-13.3-33.8-13.3-53c0-61.9 50.1-112 112-112c8 0 15.7 .8 23.2 2.4c11.7 2.5 24.1-5.9 22-17.6C494.5 62.5 422.5 0 336 0C238.8 0 160 78.8 160 176l0 89.2z"]
};
const faHollyBerry = {
  prefix: 'fas',
  iconName: 'holly-berry',
  icon: [512, 512, [], "f7aa", "M256 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-80 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM276.8 383.8c1 .1 2.1 .2 3.2 .2c39.8 0 72 32.2 72 72l0 22.7c0 16.4 16 27.9 31.6 22.8l12.8-4.3c18-6 37.3-6.5 55.6-1.5l19.4 5.3c17.9 4.9 34.4-11.6 29.5-29.5L495.6 452c-5-18.3-4.4-37.6 1.5-55.6l4.3-12.8c5.2-15.5-6.4-31.6-22.8-31.6c-34.6 0-62.7-28.1-62.7-62.7l0-32c0-16.4-16-27.9-31.6-22.8l-12.8 4.3c-18 6-37.3 6.5-55.6 1.5l-29.6-8.1c-2.9-.8-5.9-1-8.7-.7c4.2 9.7 5.8 20.8 3.7 32.3L275 298.7c-1.5 8.4-1.4 17 .5 25.3l5.3 23.9c2.8 12.7 1.1 25.2-4 35.9zM127.6 234.5c-15.5-5.2-31.6 6.4-31.6 22.8l0 32C96 323.9 67.9 352 33.3 352c-16.4 0-27.9 16-22.8 31.6l4.3 12.8c6 18 6.5 37.3 1.5 55.6l-5.3 19.4C6.2 489.4 22.6 505.8 40.5 501L60 495.6c18.3-5 37.6-4.5 55.6 1.5l12.8 4.3c15.5 5.2 31.6-6.4 31.6-22.8l0-32c0-34.6 28.1-62.7 62.7-62.7c16.4 0 27.9-16 22.8-31.6l-4.3-12.8c-6-18-6.5-37.3-1.5-55.6l5.3-19.4c4.9-17.9-11.6-34.4-29.5-29.5L196 240.4c-18.3 5-37.6 4.4-55.6-1.5l-12.8-4.3zM384 144a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faChevronLeft = {
  prefix: 'fas',
  iconName: 'chevron-left',
  icon: [320, 512, [9001], "f053", "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]
};
const faBacteria = {
  prefix: 'fas',
  iconName: 'bacteria',
  icon: [640, 512, [], "e059", "M304.9 .7c-9.6-2.7-19.5 2.8-22.3 12.4l-4.3 15.2c-8.3-.6-16.8 0-25.2 1.9c-7.3 1.7-14.3 3.5-21.1 5.5l-5.5-12.7c-3.9-9.1-14.5-13.4-23.6-9.5s-13.4 14.5-9.5 23.6l4.4 10.4c-16.6 6.7-31.7 14.4-45.4 22.8L147 62c-5.5-8.3-16.7-10.5-25-5s-10.5 16.7-5 25l6 9c-13.7 11-25.5 22.8-35.8 34.9l-10-8c-7.8-6.2-19.1-5-25.3 2.8s-5 19.1 2.8 25.3L65.9 155c-1.8 2.8-3.5 5.7-5.1 8.5c-6.6 11.4-11.8 22.6-16 33l-8-3.2c-9.2-3.7-19.7 .8-23.4 10s.8 19.7 10 23.4l10.4 4.2c-.2 .8-.4 1.5-.5 2.3c-2.2 9.3-3.4 17.3-4.1 23.4c-.4 3.1-.6 5.7-.8 7.8c-.1 1.1-.1 2-.2 2.8l-.1 1.1 0 .5 0 .2 0 .1c0 0 0 .1 29.1 1c0 0 0 0-.1 0L28 269.3c-.1 3.1 0 6.1 .2 9.1l-15.2 4.3C3.5 285.4-2 295.4 .7 304.9s12.7 15.1 22.3 12.4l15.6-4.5c7.6 13.6 18.9 25 32.6 32.6L66.7 361c-2.7 9.6 2.8 19.5 12.4 22.3s19.5-2.8 22.3-12.4l4.3-15.2c1.2 .1 2.4 .2 3.6 .2c15.6 .5 30.3-3.3 43-10.2l9 9c7 7 18.4 7 25.5 0s7-18.4 0-25.5l-7.2-7.2c9.3-12.6 15.2-27.8 16.3-44.5l7.1 3c9.1 3.9 19.7-.3 23.6-9.5s-.3-19.7-9.5-23.6l-8.6-3.7c6.4-9.9 17.3-22.4 36.9-33.3l1.3 4.4c2.7 9.6 12.7 15.1 22.3 12.4s15.1-12.7 12.4-22.3l-2.3-8.1c3.8-1.1 7.7-2.1 11.9-3.1c11.6-2.7 22.1-7.7 31.1-14.4l7.2 7.2c7 7 18.4 7 25.5 0s7-18.4 0-25.5l-9-9c7.6-13.9 11.3-30.1 10.1-46.6l15.2-4.3c9.6-2.7 15.1-12.7 12.4-22.3S370.6 64 361 66.7l-15.6 4.5c-7.7-13.9-19.1-25.1-32.6-32.6l4.5-15.6c2.7-9.6-2.8-19.5-12.4-22.3zM112 272l-48-1.5c0 0 0 0 0 0c11.7 .4 27.3 .9 48 1.6zm16-80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64-48a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM322.7 489c-2.7 9.6 2.8 19.5 12.4 22.3s19.5-2.8 22.2-12.4l4.3-15.2c8.3 .6 16.8 0 25.2-1.9c7.3-1.7 14.3-3.5 21.1-5.5l5.5 12.7c3.9 9.1 14.5 13.4 23.6 9.5s13.4-14.5 9.5-23.6l-4.4-10.4c16.6-6.7 31.7-14.4 45.4-22.8L493 450c5.5 8.3 16.7 10.5 25 5s10.5-16.7 5-25l-6-9c13.7-11 25.5-22.8 35.8-34.9l10 8c7.8 6.2 19.1 5 25.3-2.8s5-19.1-2.8-25.3L574.1 357c1.8-2.8 3.5-5.7 5.1-8.5c6.6-11.4 11.8-22.6 16-33l8 3.2c9.2 3.7 19.7-.8 23.4-10s-.8-19.7-10-23.4l-10.4-4.2c.2-.8 .4-1.5 .5-2.3c2.2-9.3 3.4-17.3 4.1-23.4c.4-3.1 .6-5.7 .8-7.8c.1-1.1 .1-2 .2-2.8l.1-1.1 0-.5 0-.2 0-.1c0 0 0-.1-29.1-1c0 0 0 0 .1 0l29.1 .9c.1-3.1 0-6.1-.2-9.1l15.2-4.3c9.6-2.7 15.1-12.7 12.4-22.3s-12.7-15.1-22.3-12.4l-15.6 4.5c-7.6-13.6-18.9-25-32.6-32.6l4.5-15.6c2.7-9.6-2.8-19.5-12.4-22.3s-19.5 2.8-22.3 12.4l-4.3 15.2c-1.2-.1-2.4-.2-3.6-.2c-15.6-.5-30.3 3.3-43 10.2l-9-9c-7-7-18.4-7-25.5 0s-7 18.4 0 25.5l7.2 7.2c-9.3 12.6-15.2 27.8-16.3 44.5l-7.1-3c-9.1-3.9-19.7 .3-23.6 9.5s.3 19.7 9.5 23.6l8.6 3.7c-6.4 9.9-17.3 22.4-36.9 33.3l-1.3-4.4c-2.7-9.6-12.7-15.1-22.3-12.4s-15.1 12.7-12.4 22.3l2.3 8.1c-3.8 1.1-7.7 2.1-11.9 3.1c-11.6 2.7-22.1 7.7-31.1 14.4l-7.2-7.2c-7-7-18.4-7-25.5 0s-7 18.4 0 25.5l9 9c-7.6 13.9-11.3 30.1-10.1 46.6l-15.2 4.3c-9.6 2.7-15.1 12.7-12.4 22.2s12.7 15.1 22.3 12.4l15.6-4.5c7.7 13.9 19.1 25.1 32.6 32.6L322.7 489zM576 241.5c0 0 0 0 0 0c-11.7-.4-27.3-.9-48-1.6l48 1.5zM448 384a32 32 0 1 1 -64 0 32 32 0 1 1 64 0z"]
};
const faHandLizard = {
  prefix: 'fas',
  iconName: 'hand-lizard',
  icon: [512, 512, [], "f258", "M0 112C0 85.5 21.5 64 48 64l112 0 80 0 46.5 0c36.8 0 71.2 18 92.1 48.2l113.5 164c13 18.7 19.9 41 19.9 63.8l0 12 0 16 0 48c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-13.8L273.9 352 240 352l-80 0-48 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l48 0 80 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-80 0L48 160c-26.5 0-48-21.5-48-48z"]
};
const faNotdef = {
  prefix: 'fas',
  iconName: 'notdef',
  icon: [384, 512, [], "e1fe", "M64 390.3L153.5 256 64 121.7l0 268.6zM102.5 448l179.1 0L192 313.7 102.5 448zm128-192L320 390.3l0-268.6L230.5 256zM281.5 64L102.5 64 192 198.3 281.5 64zM0 48C0 21.5 21.5 0 48 0L336 0c26.5 0 48 21.5 48 48l0 416c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 48z"]
};
const faDisease = {
  prefix: 'fas',
  iconName: 'disease',
  icon: [512, 512, [], "f7fa", "M236.4 61.4L227 75.5c-21.3 32-59.4 48.5-97.3 42.1l-59.6-9.9C33.4 101.6 0 129.9 .1 167.1c0 15.9 6.4 31.2 17.6 42.5l29.2 29.2c11 11 17.2 25.9 17.2 41.5c0 15.8-6.4 30.9-17.7 42L33.3 335.1C22.2 345.9 16 360.7 16 376.2c0 36.8 34.1 64.2 70.1 56.2l62.3-13.8c7.7-1.7 15.7-2.6 23.6-2.6l10 0c27.2 0 53.7 9.3 75 26.3L287.8 467c10.5 8.4 23.6 13 37 13c32.7 0 59.3-26.5 59.3-59.3l0-25.2c0-34.9 21.4-66.2 53.9-78.8l36.9-14.3c22.4-8.7 37.2-30.3 37.2-54.3c0-28.1-20.1-52.3-47.8-57.3l-28-5.1c-36.5-6.7-65.4-34.5-73.6-70.7l-7.1-31.5C348.9 53.4 322.1 32 291.3 32c-22 0-42.6 11-54.9 29.4zM160 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm0 80a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBriefcaseMedical = {
  prefix: 'fas',
  iconName: 'briefcase-medical',
  icon: [512, 512, [], "f469", "M184 48l144 0c4.4 0 8 3.6 8 8l0 40L176 96l0-40c0-4.4 3.6-8 8-8zm-56 8l0 40L64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-64 0 0-40c0-30.9-25.1-56-56-56L184 0c-30.9 0-56 25.1-56 56zm96 152c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faGenderless = {
  prefix: 'fas',
  iconName: 'genderless',
  icon: [384, 512, [], "f22d", "M192 144a112 112 0 1 1 0 224 112 112 0 1 1 0-224zm0 288a176 176 0 1 0 0-352 176 176 0 1 0 0 352z"]
};
const faChevronRight = {
  prefix: 'fas',
  iconName: 'chevron-right',
  icon: [320, 512, [9002], "f054", "M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]
};
const faRetweet = {
  prefix: 'fas',
  iconName: 'retweet',
  icon: [576, 512, [], "f079", "M272 416c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0c-17.7 0-32-14.3-32-32l0-128 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 128c0 53 43 96 96 96l112 0zM304 96c-17.7 0-32 14.3-32 32s14.3 32 32 32l112 0c17.7 0 32 14.3 32 32l0 128-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0 0-128c0-53-43-96-96-96L304 96z"]
};
const faCarRear = {
  prefix: 'fas',
  iconName: 'car-rear',
  icon: [512, 512, ["car-alt"], "f5de", "M165.4 96l181.2 0c13.6 0 25.7 8.6 30.2 21.4L402.9 192l-293.8 0 26.1-74.6c4.5-12.8 16.6-21.4 30.2-21.4zm-90.6 .3L39.6 196.8C16.4 206.4 0 229.3 0 256l0 80c0 23.7 12.9 44.4 32 55.4L32 448c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-48 256 0 0 48c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-56.6c19.1-11.1 32-31.7 32-55.4l0-80c0-26.7-16.4-49.6-39.6-59.2L437.2 96.3C423.7 57.8 387.4 32 346.6 32L165.4 32c-40.8 0-77.1 25.8-90.6 64.3zM208 272l96 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM48 280c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24zm360-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faCarAlt = faCarRear;
const faPumpSoap = {
  prefix: 'fas',
  iconName: 'pump-soap',
  icon: [448, 512, [], "e06b", "M128 32l0 96 128 0 0-32 60.1 0c4.2 0 8.3 1.7 11.3 4.7l33.9 33.9c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L372.7 55.4c-15-15-35.4-23.4-56.6-23.4L256 32c0-17.7-14.3-32-32-32L160 0c-17.7 0-32 14.3-32 32zM117.4 160c-33.3 0-61 25.5-63.8 58.7L35 442.7C31.9 480 61.3 512 98.8 512l186.4 0c37.4 0 66.9-32 63.8-69.3l-18.7-224c-2.8-33.2-30.5-58.7-63.8-58.7l-149.1 0zM256 360c0 35.3-28.7 56-64 56s-64-20.7-64-56c0-32.5 37-80.9 50.9-97.9c3.2-3.9 8.1-6.1 13.1-6.1s9.9 2.2 13.1 6.1C219 279.1 256 327.5 256 360z"]
};
const faVideoSlash = {
  prefix: 'fas',
  iconName: 'video-slash',
  icon: [640, 512, [], "f4e2", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-86.4-67.7 13.8 9.2c9.8 6.5 22.4 7.2 32.9 1.6s16.9-16.4 16.9-28.2l0-256c0-11.8-6.5-22.6-16.9-28.2s-23-5-32.9 1.6l-96 64L448 174.9l0 17.1 0 128 0 5.8-32-25.1L416 128c0-35.3-28.7-64-64-64L113.9 64 38.8 5.1zM407 416.7L32.3 121.5c-.2 2.1-.3 4.3-.3 6.5l0 256c0 35.3 28.7 64 64 64l256 0c23.4 0 43.9-12.6 55-31.3z"]
};
const faBatteryQuarter = {
  prefix: 'fas',
  iconName: 'battery-quarter',
  icon: [576, 512, ["battery-2"], "f243", "M464 160c8.8 0 16 7.2 16 16l0 160c0 8.8-7.2 16-16 16L80 352c-8.8 0-16-7.2-16-16l0-160c0-8.8 7.2-16 16-16l384 0zM80 96C35.8 96 0 131.8 0 176L0 336c0 44.2 35.8 80 80 80l384 0c44.2 0 80-35.8 80-80l0-16c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-16c0-44.2-35.8-80-80-80L80 96zm112 96l-96 0 0 128 96 0 0-128z"]
};
const faBattery2 = faBatteryQuarter;
const faRadio = {
  prefix: 'fas',
  iconName: 'radio',
  icon: [512, 512, [128251], "f8d7", "M494.8 47c12.7-3.7 20-17.1 16.3-29.8S494-2.8 481.2 1L51.7 126.9c-9.4 2.7-17.9 7.3-25.1 13.2C10.5 151.7 0 170.6 0 192l0 4L0 304 0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-229.5 0L494.8 47zM368 240a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM80 256c0-8.8 7.2-16 16-16l96 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16zM64 320c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 336c-8.8 0-16-7.2-16-16zm16 64c0-8.8 7.2-16 16-16l96 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16z"]
};
const faBabyCarriage = {
  prefix: 'fas',
  iconName: 'baby-carriage',
  icon: [512, 512, ["carriage-baby"], "f77d", "M256 192L.1 192C2.7 117.9 41.3 52.9 99 14.1c13.3-8.9 30.8-4.3 39.9 8.8L256 192zm128-32c0-35.3 28.7-64 64-64l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 64c0 25.2-5.8 50.2-17 73.5s-27.8 44.5-48.6 62.3s-45.5 32-72.7 41.6S253.4 416 224 416s-58.5-5-85.7-14.6s-51.9-23.8-72.7-41.6s-37.3-39-48.6-62.3S0 249.2 0 224l224 0 160 0 0-64zM80 416a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm240 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
};
const faCarriageBaby = faBabyCarriage;
const faTrafficLight = {
  prefix: 'fas',
  iconName: 'traffic-light',
  icon: [320, 512, [128678], "f637", "M64 0C28.7 0 0 28.7 0 64L0 352c0 88.4 71.6 160 160 160s160-71.6 160-160l0-288c0-35.3-28.7-64-64-64L64 0zm96 416a48 48 0 1 1 0-96 48 48 0 1 1 0 96zm48-176a48 48 0 1 1 -96 0 48 48 0 1 1 96 0zm-48-80a48 48 0 1 1 0-96 48 48 0 1 1 0 96z"]
};
const faThermometer = {
  prefix: 'fas',
  iconName: 'thermometer',
  icon: [512, 512, [], "f491", "M96 382.1l0-88.8c0-14.9 5.9-29.1 16.4-39.6l27.3-27.3 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 41.4-41.4 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 41.4-41.4 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 45.5-45.5C355.2 10.9 381.4 0 408.8 0C465.8 0 512 46.2 512 103.2c0 27.4-10.9 53.6-30.2 73L258.3 399.6c-10.5 10.5-24.7 16.4-39.6 16.4l-88.8 0L41 505c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l89-89z"]
};
const faVrCardboard = {
  prefix: 'fas',
  iconName: 'vr-cardboard',
  icon: [640, 512, [], "f729", "M576 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l120.4 0c24.2 0 46.4-13.7 57.2-35.4l32-64c8.8-17.5 26.7-28.6 46.3-28.6s37.5 11.1 46.3 28.6l32 64c10.8 21.7 33 35.4 57.2 35.4L576 448c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64zM96 240a64 64 0 1 1 128 0A64 64 0 1 1 96 240zm384-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faHandMiddleFinger = {
  prefix: 'fas',
  iconName: 'hand-middle-finger',
  icon: [448, 512, [128405], "f806", "M232 0c-22.1 0-40 17.9-40 40l0 164.2c-8.5-7.6-19.7-12.2-32-12.2c-26.5 0-48 21.5-48 48l0 7 0 73c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-55.7c-2 1.4-3.9 3-5.8 4.5L55 284.8C40.4 297 32 315 32 334L32 372c0 38 16.9 74 46.1 98.3l5.4 4.5c28.8 24 65 37.1 102.4 37.1L304 512c70.7 0 128-57.3 128-128l0-64 0-32c0-26.5-21.5-48-48-48c-12.4 0-23.6 4.7-32.1 12.3C350 227.5 329.3 208 304 208c-12.3 0-23.5 4.6-32 12.2L272 40c0-22.1-17.9-40-40-40z"]
};
const faPercent = {
  prefix: 'fas',
  iconName: 'percent',
  icon: [384, 512, [62101, 62785, "percentage"], "25", "M374.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-320 320c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l320-320zM128 128A64 64 0 1 0 0 128a64 64 0 1 0 128 0zM384 384a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faPercentage = faPercent;
const faTruckMoving = {
  prefix: 'fas',
  iconName: 'truck-moving',
  icon: [640, 512, [], "f4df", "M64 32C28.7 32 0 60.7 0 96L0 304l0 80 0 16c0 44.2 35.8 80 80 80c26.2 0 49.4-12.6 64-32c14.6 19.4 37.8 32 64 32c44.2 0 80-35.8 80-80c0-5.5-.6-10.8-1.6-16L416 384l33.6 0c-1 5.2-1.6 10.5-1.6 16c0 44.2 35.8 80 80 80s80-35.8 80-80c0-5.5-.6-10.8-1.6-16l1.6 0c17.7 0 32-14.3 32-32l0-64 0-16 0-10.3c0-9.2-3.2-18.2-9-25.3l-58.8-71.8c-10.6-13-26.5-20.5-43.3-20.5L480 144l0-48c0-35.3-28.7-64-64-64L64 32zM585 256l-105 0 0-64 48.8 0c2.4 0 4.7 1.1 6.2 2.9L585 256zM528 368a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM176 400a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM80 368a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGlassWaterDroplet = {
  prefix: 'fas',
  iconName: 'glass-water-droplet',
  icon: [384, 512, [], "e4f5", "M32 0C23.1 0 14.6 3.7 8.6 10.2S-.6 25.4 .1 34.3L28.9 437.7c3 41.9 37.8 74.3 79.8 74.3l166.6 0c42 0 76.8-32.4 79.8-74.3L383.9 34.3c.6-8.9-2.4-17.6-8.5-24.1S360.9 0 352 0L32 0zM83 297.5L66.4 64l251.3 0L301 297.5 288 304c-20.1 10.1-43.9 10.1-64 0s-43.9-10.1-64 0s-43.9 10.1-64 0l-13-6.5zM256 196c0-24-33.7-70.1-52.2-93.5c-6.1-7.7-17.5-7.7-23.6 0C161.7 125.9 128 172 128 196c0 33.1 28.7 60 64 60s64-26.9 64-60z"]
};
const faDisplay = {
  prefix: 'fas',
  iconName: 'display',
  icon: [576, 512, [], "e163", "M64 0C28.7 0 0 28.7 0 64L0 352c0 35.3 28.7 64 64 64l176 0-10.7 32L160 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-69.3 0L336 416l176 0c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64L64 0zM512 64l0 288L64 352 64 64l448 0z"]
};
const faFaceSmile = {
  prefix: 'fas',
  iconName: 'face-smile',
  icon: [512, 512, [128578, "smile"], "f118", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSmile = faFaceSmile;
const faThumbtack = {
  prefix: 'fas',
  iconName: 'thumbtack',
  icon: [384, 512, [128204, 128392, "thumb-tack"], "f08d", "M32 32C32 14.3 46.3 0 64 0L320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-29.5 0 11.4 148.2c36.7 19.9 65.7 53.2 79.5 94.7l1 3c3.3 9.8 1.6 20.5-4.4 28.8s-15.7 13.3-26 13.3L32 352c-10.3 0-19.9-4.9-26-13.3s-7.7-19.1-4.4-28.8l1-3c13.8-41.5 42.8-74.8 79.5-94.7L93.5 64 64 64C46.3 64 32 49.7 32 32zM160 384l64 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96z"]
};
const faThumbTack = faThumbtack;
const faTrophy = {
  prefix: 'fas',
  iconName: 'trophy',
  icon: [576, 512, [127942], "f091", "M400 0L176 0c-26.5 0-48.1 21.8-47.1 48.2c.2 5.3 .4 10.6 .7 15.8L24 64C10.7 64 0 74.7 0 88c0 92.6 33.5 157 78.5 200.7c44.3 43.1 98.3 64.8 138.1 75.8c23.4 6.5 39.4 26 39.4 45.6c0 20.9-17 37.9-37.9 37.9L192 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-26.1 0C337 448 320 431 320 410.1c0-19.6 15.9-39.2 39.4-45.6c39.9-11 93.9-32.7 138.2-75.8C542.5 245 576 180.6 576 88c0-13.3-10.7-24-24-24L446.4 64c.3-5.2 .5-10.4 .7-15.8C448.1 21.8 426.5 0 400 0zM48.9 112l84.4 0c9.1 90.1 29.2 150.3 51.9 190.6c-24.9-11-50.8-26.5-73.2-48.3c-32-31.1-58-76-63-142.3zM464.1 254.3c-22.4 21.8-48.3 37.3-73.2 48.3c22.7-40.3 42.8-100.5 51.9-190.6l84.4 0c-5.1 66.3-31.1 111.2-63 142.3z"]
};
const faPersonPraying = {
  prefix: 'fas',
  iconName: 'person-praying',
  icon: [448, 512, [128720, "pray"], "f683", "M352 64A64 64 0 1 0 224 64a64 64 0 1 0 128 0zM232.7 264l22.9 31.5c6.5 8.9 16.3 14.7 27.2 16.1s21.9-1.7 30.4-8.7l88-72c17.1-14 19.6-39.2 5.6-56.3s-39.2-19.6-56.3-5.6l-55.2 45.2-26.2-36C253.6 156.7 228.6 144 202 144c-30.9 0-59.2 17.1-73.6 44.4L79.8 280.9c-20.2 38.5-9.4 85.9 25.6 111.8L158.6 432 72 432c-22.1 0-40 17.9-40 40s17.9 40 40 40l208 0c17.3 0 32.6-11.1 38-27.5s-.3-34.4-14.2-44.7L187.7 354l45-90z"]
};
const faPray = faPersonPraying;
const faHammer = {
  prefix: 'fas',
  iconName: 'hammer',
  icon: [576, 512, [128296], "f6e3", "M413.5 237.5c-28.2 4.8-58.2-3.6-80-25.4l-38.1-38.1C280.4 159 272 138.8 272 117.6l0-12.1L192.3 62c-5.3-2.9-8.6-8.6-8.3-14.7s3.9-11.5 9.5-14l47.2-21C259.1 4.2 279 0 299.2 0l18.1 0c36.7 0 72 14 98.7 39.1l44.6 42c24.2 22.8 33.2 55.7 26.6 86L503 183l8-8c9.4-9.4 24.6-9.4 33.9 0l24 24c9.4 9.4 9.4 24.6 0 33.9l-88 88c-9.4 9.4-24.6 9.4-33.9 0l-24-24c-9.4-9.4-9.4-24.6 0-33.9l8-8-17.5-17.5zM27.4 377.1L260.9 182.6c3.5 4.9 7.5 9.6 11.8 14l38.1 38.1c6 6 12.4 11.2 19.2 15.7L134.9 484.6c-14.5 17.4-36 27.4-58.6 27.4C34.1 512 0 477.8 0 435.7c0-22.6 10.1-44.1 27.4-58.6z"]
};
const faHandPeace = {
  prefix: 'fas',
  iconName: 'hand-peace',
  icon: [512, 512, [9996], "f25b", "M224 0c17.7 0 32 14.3 32 32l0 208-64 0 0-208c0-17.7 14.3-32 32-32zm96 160c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm64 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zM93.3 51.2L175.9 240l-69.9 0L34.7 76.8C27.6 60.6 35 41.8 51.2 34.7s35.1 .3 42.1 16.5zm27 221.3l-.2-.5 69.9 0 26.1 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-56 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l56 0c39.8 0 72-32.2 72-72l0-.6c9.4 5.4 20.3 8.6 32 8.6c13.2 0 25.4-4 35.6-10.8c8.7 24.9 32.5 42.8 60.4 42.8c11.7 0 22.6-3.1 32-8.6l0 8.6c0 88.4-71.6 160-160 160l-61.7 0c-42.4 0-83.1-16.9-113.1-46.9l-11.6-11.6C77.5 429.5 64 396.9 64 363l0-27c0-32.7 24.6-59.7 56.3-63.5z"]
};
const faRotate = {
  prefix: 'fas',
  iconName: 'rotate',
  icon: [512, 512, [128260, "sync-alt"], "f2f1", "M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z"]
};
const faSyncAlt = faRotate;
const faSpinner = {
  prefix: 'fas',
  iconName: 'spinner',
  icon: [512, 512, [], "f110", "M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"]
};
const faRobot = {
  prefix: 'fas',
  iconName: 'robot',
  icon: [640, 512, [129302], "f544", "M320 0c17.7 0 32 14.3 32 32l0 64 120 0c39.8 0 72 32.2 72 72l0 272c0 39.8-32.2 72-72 72l-304 0c-39.8 0-72-32.2-72-72l0-272c0-39.8 32.2-72 72-72l120 0 0-64c0-17.7 14.3-32 32-32zM208 384c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0zM264 256a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm152 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM48 224l16 0 0 192-16 0c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48zm544 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-16 0 0-192 16 0z"]
};
const faPeace = {
  prefix: 'fas',
  iconName: 'peace',
  icon: [512, 512, [9774], "f67c", "M224 445.3l0-121.8-94.3 77.1c26.1 22.8 58.5 38.7 94.3 44.7zM89.2 351.1L224 240.8l0-174.2C133.2 81.9 64 160.9 64 256c0 34.6 9.2 67.1 25.2 95.1zm293.1 49.5L288 323.5l0 121.8c35.7-6 68.1-21.9 94.3-44.7zm40.6-49.5c16-28 25.2-60.5 25.2-95.1c0-95.1-69.2-174.1-160-189.3l0 174.2L422.8 351.1zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faGears = {
  prefix: 'fas',
  iconName: 'gears',
  icon: [640, 512, ["cogs"], "f085", "M308.5 135.3c7.1-6.3 9.9-16.2 6.2-25c-2.3-5.3-4.8-10.5-7.6-15.5L304 89.4c-3-5-6.3-9.9-9.8-14.6c-5.7-7.6-15.7-10.1-24.7-7.1l-28.2 9.3c-10.7-8.8-23-16-36.2-20.9L199 27.1c-1.9-9.3-9.1-16.7-18.5-17.8C173.9 8.4 167.2 8 160.4 8l-.7 0c-6.8 0-13.5 .4-20.1 1.2c-9.4 1.1-16.6 8.6-18.5 17.8L115 56.1c-13.3 5-25.5 12.1-36.2 20.9L50.5 67.8c-9-3-19-.5-24.7 7.1c-3.5 4.7-6.8 9.6-9.9 14.6l-3 5.3c-2.8 5-5.3 10.2-7.6 15.6c-3.7 8.7-.9 18.6 6.2 25l22.2 19.8C32.6 161.9 32 168.9 32 176s.6 14.1 1.7 20.9L11.5 216.7c-7.1 6.3-9.9 16.2-6.2 25c2.3 5.3 4.8 10.5 7.6 15.6l3 5.2c3 5.1 6.3 9.9 9.9 14.6c5.7 7.6 15.7 10.1 24.7 7.1l28.2-9.3c10.7 8.8 23 16 36.2 20.9l6.1 29.1c1.9 9.3 9.1 16.7 18.5 17.8c6.7 .8 13.5 1.2 20.4 1.2s13.7-.4 20.4-1.2c9.4-1.1 16.6-8.6 18.5-17.8l6.1-29.1c13.3-5 25.5-12.1 36.2-20.9l28.2 9.3c9 3 19 .5 24.7-7.1c3.5-4.7 6.8-9.5 9.8-14.6l3.1-5.4c2.8-5 5.3-10.2 7.6-15.5c3.7-8.7 .9-18.6-6.2-25l-22.2-19.8c1.1-6.8 1.7-13.8 1.7-20.9s-.6-14.1-1.7-20.9l22.2-19.8zM112 176a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM504.7 500.5c6.3 7.1 16.2 9.9 25 6.2c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-8.7-3.7-18.6-.9-25 6.2l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-6.3-7.1-16.2-9.9-25-6.2c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4s.4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c8.7 3.7 18.6 .9 25-6.2l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2zM464 304a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faCogs = faGears;
const faWarehouse = {
  prefix: 'fas',
  iconName: 'warehouse',
  icon: [640, 512, [], "f494", "M0 488L0 171.3c0-26.2 15.9-49.7 40.2-59.4L308.1 4.8c7.6-3.1 16.1-3.1 23.8 0L599.8 111.9c24.3 9.7 40.2 33.3 40.2 59.4L640 488c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-264c0-17.7-14.3-32-32-32l-384 0c-17.7 0-32 14.3-32 32l0 264c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zm488 24l-336 0c-13.3 0-24-10.7-24-24l0-56 384 0 0 56c0 13.3-10.7 24-24 24zM128 400l0-64 384 0 0 64-384 0zm0-96l0-80 384 0 0 80-384 0z"]
};
const faArrowUpRightDots = {
  prefix: 'fas',
  iconName: 'arrow-up-right-dots',
  icon: [576, 512, [], "e4b7", "M160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l50.7 0L9.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L256 109.3l0 50.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128c0-17.7-14.3-32-32-32L160 0zM576 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM448 208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM400 384a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm128 0a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM272 384a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM144 512a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM576 336a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm-48-80a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faSplotch = {
  prefix: 'fas',
  iconName: 'splotch',
  icon: [512, 512, [], "f5bc", "M208.5 62.3l28.1-36.9C248.8 9.4 267.8 0 288 0c28.5 0 53.6 18.7 61.8 46l17.8 59.4c10.3 34.4 36.1 62 69.8 74.6l39.8 14.9c20.9 7.9 34.8 27.9 34.8 50.2c0 16.9-7.9 32.8-21.5 42.9l-67.3 50.5c-24.3 18.2-37.2 47.9-33.8 78.1l2.5 22.7c4.3 38.7-26 72.6-65 72.6c-14.8 0-29.3-5.1-40.8-14.3l-55.4-44.3c-4.5-3.6-9.3-6.7-14.5-9.2c-15.8-7.9-33.7-10.4-51-7.3L82.4 451.9C47.8 458.2 16 431.6 16 396.5c0-13.2 4.7-26 13.1-36.2l11.2-13.4c14.6-17.4 22.6-39.4 22.6-62.1c0-18.8-5.5-37.2-15.8-53L8.8 173.5C3.1 164.7 0 154.4 0 143.9c0-33.4 30.1-58.8 63-53.2l51.3 8.7c35.9 6.1 72.2-8.2 94.2-37.1z"]
};
const faFaceGrinHearts = {
  prefix: 'fas',
  iconName: 'face-grin-hearts',
  icon: [512, 512, [128525, "grin-hearts"], "f584", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM199.3 129.1c17.8 4.8 28.4 23.1 23.6 40.8l-17.4 65c-2.3 8.5-11.1 13.6-19.6 11.3l-65.1-17.4c-17.8-4.8-28.4-23.1-23.6-40.8s23.1-28.4 40.8-23.6l16.1 4.3 4.3-16.1c4.8-17.8 23.1-28.4 40.8-23.6zm154.3 23.6l4.3 16.1 16.1-4.3c17.8-4.8 36.1 5.8 40.8 23.6s-5.8 36.1-23.6 40.8l-65.1 17.4c-8.5 2.3-17.3-2.8-19.6-11.3l-17.4-65c-4.8-17.8 5.8-36.1 23.6-40.8s36.1 5.8 40.9 23.6z"]
};
const faGrinHearts = faFaceGrinHearts;
const faDiceFour = {
  prefix: 'fas',
  iconName: 'dice-four',
  icon: [448, 512, [9859], "f524", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm160 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM352 160a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faSimCard = {
  prefix: 'fas',
  iconName: 'sim-card',
  icon: [384, 512, [], "f7c4", "M64 0L242.7 0c17 0 33.3 6.7 45.3 18.7L365.3 96c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64C0 28.7 28.7 0 64 0zM96 192c-17.7 0-32 14.3-32 32l0 32 64 0 0-64-32 0zM64 352l80 0 96 0 80 0 0-64-80 0-96 0-80 0 0 64zM320 224c0-17.7-14.3-32-32-32l-32 0 0 64 64 0 0-32zM160 192l0 64 64 0 0-64-64 0zM288 448c17.7 0 32-14.3 32-32l0-32-64 0 0 64 32 0zM160 384l0 64 64 0 0-64-64 0zM64 416c0 17.7 14.3 32 32 32l32 0 0-64-64 0 0 32z"]
};
const faTransgender = {
  prefix: 'fas',
  iconName: 'transgender',
  icon: [512, 512, [9895, "transgender-alt"], "f225", "M112 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-31 31L112 78.1l7-7c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-7 7 15.2 15.2C187.7 107.6 220.5 96 256 96s68.3 11.6 94.9 31.2l68.8-68.8-31-31c-4.6-4.6-5.9-11.5-3.5-17.4s8.3-9.9 14.8-9.9l96 0c8.8 0 16 7.2 16 16l0 96c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5l-31-31-68.8 68.8C404.4 187.7 416 220.5 416 256c0 80.2-59 146.6-136 158.2l0 17.8 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-17.8C155 402.6 96 336.2 96 256c0-35.5 11.6-68.3 31.2-94.9L112 145.9l-7 7c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l7-7L58.3 92.3l-31 31c-4.6 4.6-11.5 5.9-17.4 3.5S0 118.5 0 112L0 16C0 7.2 7.2 0 16 0l96 0zM352 256a96 96 0 1 0 -192 0 96 96 0 1 0 192 0z"]
};
const faTransgenderAlt = faTransgender;
const faMercury = {
  prefix: 'fas',
  iconName: 'mercury',
  icon: [384, 512, [9791], "f223", "M72.1 7C85.8-4 106-1.8 117 12c17.6 22 44.7 36 75 36s57.3-14 75-36c11.1-13.8 31.2-16 45-5s16 31.2 5 45c-7.8 9.7-16.6 18.4-26.4 26.1C337.3 109.7 368 163.3 368 224c0 89.1-66.2 162.7-152 174.4l0 25.6 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 16c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-25.6C82.2 386.7 16 313.1 16 224c0-60.7 30.7-114.3 77.5-145.9C83.7 70.5 74.9 61.7 67.1 52c-11.1-13.8-8.8-33.9 5-45zM80 224a112 112 0 1 0 224 0A112 112 0 1 0 80 224z"]
};
const faArrowTurnDown = {
  prefix: 'fas',
  iconName: 'arrow-turn-down',
  icon: [384, 512, ["level-down"], "f149", "M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z"]
};
const faLevelDown = faArrowTurnDown;
const faPersonFallingBurst = {
  prefix: 'fas',
  iconName: 'person-falling-burst',
  icon: [640, 512, [], "e547", "M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 9.8c0 39-23.7 74-59.9 88.4C71.6 154.5 32 213 32 278.2L32 352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-73.8c0-10 1.6-19.8 4.5-29L261.1 497.4c9.6 14.8 29.4 19.1 44.3 9.5s19.1-29.4 9.5-44.3L222.6 320l1.4 0 80 0 38.4 51.2c10.6 14.1 30.7 17 44.8 6.4s17-30.7 6.4-44.8l-43.2-57.6C341.3 263.1 327.1 256 312 256l-71.5 0-56.8-80.2-.2-.3c44.7-29 72.5-79 72.5-133.6l0-9.8zM96 80A48 48 0 1 0 0 80a48 48 0 1 0 96 0zM464 286.1l58.6 53.9c4.8 4.4 11.9 5.5 17.8 2.6s9.5-9 9-15.5l-5.6-79.4 78.7-12.2c6.5-1 11.7-5.9 13.1-12.2s-1.1-13-6.5-16.7l-65.6-45.1L603 92.2c3.3-5.7 2.7-12.8-1.4-17.9s-10.9-7.2-17.2-5.3L508.3 92.1l-29.4-74C476.4 12 470.6 8 464 8s-12.4 4-14.9 10.1l-29.4 74L343.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1-65.6 45.1c-5.4 3.7-8 10.3-6.5 16.7c.1 .3 .1 .6 .2 .8l19.4 0c20.1 0 39.2 7.5 53.8 20.8l18.4 2.9L383 265.3l36.2 48.3c2.1 2.8 3.9 5.7 5.5 8.6L464 286.1z"]
};
const faAward = {
  prefix: 'fas',
  iconName: 'award',
  icon: [384, 512, [], "f559", "M173.8 5.5c11-7.3 25.4-7.3 36.4 0L228 17.2c6 3.9 13 5.8 20.1 5.4l21.3-1.3c13.2-.8 25.6 6.4 31.5 18.2l9.6 19.1c3.2 6.4 8.4 11.5 14.7 14.7L344.5 83c11.8 5.9 19 18.3 18.2 31.5l-1.3 21.3c-.4 7.1 1.5 14.2 5.4 20.1l11.8 17.8c7.3 11 7.3 25.4 0 36.4L366.8 228c-3.9 6-5.8 13-5.4 20.1l1.3 21.3c.8 13.2-6.4 25.6-18.2 31.5l-19.1 9.6c-6.4 3.2-11.5 8.4-14.7 14.7L301 344.5c-5.9 11.8-18.3 19-31.5 18.2l-21.3-1.3c-7.1-.4-14.2 1.5-20.1 5.4l-17.8 11.8c-11 7.3-25.4 7.3-36.4 0L156 366.8c-6-3.9-13-5.8-20.1-5.4l-21.3 1.3c-13.2 .8-25.6-6.4-31.5-18.2l-9.6-19.1c-3.2-6.4-8.4-11.5-14.7-14.7L39.5 301c-11.8-5.9-19-18.3-18.2-31.5l1.3-21.3c.4-7.1-1.5-14.2-5.4-20.1L5.5 210.2c-7.3-11-7.3-25.4 0-36.4L17.2 156c3.9-6 5.8-13 5.4-20.1l-1.3-21.3c-.8-13.2 6.4-25.6 18.2-31.5l19.1-9.6C65 70.2 70.2 65 73.4 58.6L83 39.5c5.9-11.8 18.3-19 31.5-18.2l21.3 1.3c7.1 .4 14.2-1.5 20.1-5.4L173.8 5.5zM272 192a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM1.3 441.8L44.4 339.3c.2 .1 .3 .2 .4 .4l9.6 19.1c11.7 23.2 36 37.3 62 35.8l21.3-1.3c.2 0 .5 0 .7 .2l17.8 11.8c5.1 3.3 10.5 5.9 16.1 7.7l-37.6 89.3c-2.3 5.5-7.4 9.2-13.3 9.7s-11.6-2.2-14.8-7.2L74.4 455.5l-56.1 8.3c-5.7 .8-11.4-1.5-15-6s-4.3-10.7-2.1-16zm248 60.4L211.7 413c5.6-1.8 11-4.3 16.1-7.7l17.8-11.8c.2-.1 .4-.2 .7-.2l21.3 1.3c26 1.5 50.3-12.6 62-35.8l9.6-19.1c.1-.2 .2-.3 .4-.4l43.2 102.5c2.2 5.3 1.4 11.4-2.1 16s-9.3 6.9-15 6l-56.1-8.3-32.2 49.2c-3.2 5-8.9 7.7-14.8 7.2s-11-4.3-13.3-9.7z"]
};
const faTicketSimple = {
  prefix: 'fas',
  iconName: 'ticket-simple',
  icon: [576, 512, ["ticket-alt"], "f3ff", "M0 128C0 92.7 28.7 64 64 64l448 0c35.3 0 64 28.7 64 64l0 64c0 8.8-7.4 15.7-15.7 18.6C541.5 217.1 528 235 528 256s13.5 38.9 32.3 45.4c8.3 2.9 15.7 9.8 15.7 18.6l0 64c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64l0-64c0-8.8 7.4-15.7 15.7-18.6C34.5 294.9 48 277 48 256s-13.5-38.9-32.3-45.4C7.4 207.7 0 200.8 0 192l0-64z"]
};
const faTicketAlt = faTicketSimple;
const faBuilding = {
  prefix: 'fas',
  iconName: 'building',
  icon: [384, 512, [127970, 61687], "f1ad", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c26.5 0 48-21.5 48-48l0-416c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]
};
const faAnglesLeft = {
  prefix: 'fas',
  iconName: 'angles-left',
  icon: [512, 512, [171, "angle-double-left"], "f100", "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"]
};
const faAngleDoubleLeft = faAnglesLeft;
const faQrcode = {
  prefix: 'fas',
  iconName: 'qrcode',
  icon: [448, 512, [], "f029", "M0 80C0 53.5 21.5 32 48 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48L0 80zM64 96l0 64 64 0 0-64L64 96zM0 336c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96zm64 16l0 64 64 0 0-64-64 0zM304 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48zm80 64l-64 0 0 64 64 0 0-64zM256 304c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s7.2-16 16-16s16 7.2 16 16l0 96c0 8.8-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-160zM368 480a16 16 0 1 1 0-32 16 16 0 1 1 0 32zm64 0a16 16 0 1 1 0-32 16 16 0 1 1 0 32z"]
};
const faClockRotateLeft = {
  prefix: 'fas',
  iconName: 'clock-rotate-left',
  icon: [512, 512, ["history"], "f1da", "M75 75L41 41C25.9 25.9 0 36.6 0 57.9L0 168c0 13.3 10.7 24 24 24l110.1 0c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1c0-13.3-10.7-24-24-24z"]
};
const faHistory = faClockRotateLeft;
const faFaceGrinBeamSweat = {
  prefix: 'fas',
  iconName: 'face-grin-beam-sweat',
  icon: [512, 512, [128517, "grin-beam-sweat"], "f583", "M476.8 126.3c-4.1 1.1-8.4 1.7-12.8 1.7c-26.5 0-48-21-48-47c0-5 1.8-11.3 4.6-18.1c.3-.7 .6-1.4 .9-2.1c9-20.2 26.5-44.9 36-57.5c3.2-4.4 9.6-4.4 12.8 0C483.4 20.6 512 61 512 81c0 21.7-14.9 39.8-35.2 45.3zM256 0c51.4 0 99.3 15.2 139.4 41.2c-1.5 3.1-3 6.2-4.3 9.3c-3.4 8-7.1 19-7.1 30.5c0 44.3 36.6 79 80 79c9.6 0 18.8-1.7 27.4-4.8c13.3 30.9 20.6 65 20.6 100.8c0 141.4-114.6 256-256 256S0 397.4 0 256S114.6 0 256 0zM383.8 317.8C345.3 329.4 301.9 336 256 336s-89.3-6.6-127.8-18.2c-12.3-3.7-24.3 7-19.2 18.7c24.5 56.9 81.1 96.7 147 96.7s122.5-39.8 147-96.7c5.1-11.8-6.9-22.4-19.2-18.7zm-166.2-89s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C126.7 188.4 120 206.1 120 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0c0 0 0 0 0 0zm160 0s0 0 0 0s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C286.7 188.4 280 206.1 280 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0z"]
};
const faGrinBeamSweat = faFaceGrinBeamSweat;
const faFileExport = {
  prefix: 'fas',
  iconName: 'file-export',
  icon: [576, 512, ["arrow-right-from-file"], "f56e", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 128-168 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l168 0 0 112c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM384 336l0-48 110.1 0-39-39c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l80 80c9.4 9.4 9.4 24.6 0 33.9l-80 80c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l39-39L384 336zm0-208l-128 0L256 0 384 128z"]
};
const faArrowRightFromFile = faFileExport;
const faShield = {
  prefix: 'fas',
  iconName: 'shield',
  icon: [512, 512, [128737, "shield-blank"], "f132", "M256 0c4.6 0 9.2 1 13.4 2.9L457.7 82.8c22 9.3 38.4 31 38.3 57.2c-.5 99.2-41.3 280.7-213.6 363.2c-16.7 8-36.1 8-52.8 0C57.3 420.7 16.5 239.2 16 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.8 1 251.4 0 256 0z"]
};
const faShieldBlank = faShield;
const faArrowUpShortWide = {
  prefix: 'fas',
  iconName: 'arrow-up-short-wide',
  icon: [576, 512, ["sort-amount-up-alt"], "f885", "M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0z"]
};
const faSortAmountUpAlt = faArrowUpShortWide;
const faCommentNodes = {
  prefix: 'fas',
  iconName: 'comment-nodes',
  icon: [640, 512, [], "e696", "M256 448c10.8 0 21.5-.5 32-1.6c.3-15.8 4.4-31.7 12.9-46.4c16-27.7 43.7-44.4 73.2-47.5l16.7-29.2c-4.3-11-6.7-22.9-6.7-35.4c0-53 43-96 96-96c9.1 0 17.8 1.3 26.2 3.6C481.1 102.1 378.6 32 256 32C114.6 32 0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.2 .3-.4 .5-.6 .7c-.3 .3-.5 .5-.6 .7l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zm72.6-32c-17.7 30.6-7.2 69.7 23.4 87.4s69.7 7.2 87.4-23.4c1.5-2.6 2.8-5.3 3.9-8l73.3 0c1.1 2.7 2.4 5.4 3.9 8c17.7 30.6 56.8 41.1 87.4 23.4s41.1-56.8 23.4-87.4c-13.4-23.2-39.1-34.8-64-31.4l-17.6-30.7c-11 11.7-25 20.6-40.6 25.6l16.5 28.9c-3.8 4.8-6.8 10-9 15.6l-73.4 0c-2.2-5.6-5.3-10.8-9-15.6l33-57.7c4.1 .8 8.4 1.3 12.8 1.3c35.3 0 64-28.7 64-64s-28.7-64-64-64s-64 28.7-64 64c0 13.4 4.1 25.8 11.2 36.1l-34.6 60.5c-25-3.4-50.6 8.3-64 31.4z"]
};
const faHouseMedical = {
  prefix: 'fas',
  iconName: 'house-medical',
  icon: [576, 512, [], "e3b2", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 160.4c0 35.3 28.7 64 64 64l320.4 0c35.5 0 64.2-28.8 64-64.3l-.7-160.2 32 0zM256 208c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faGolfBallTee = {
  prefix: 'fas',
  iconName: 'golf-ball-tee',
  icon: [384, 512, ["golf-ball"], "f450", "M384 192c0 66.8-34.1 125.6-85.8 160L85.8 352C34.1 317.6 0 258.8 0 192C0 86 86 0 192 0S384 86 384 192zM242.1 256.6c0 18.5-15 33.5-33.5 33.5c-4.9 0-9.1 5.1-5.4 8.4c5.9 5.2 13.7 8.4 22.1 8.4c18.5 0 33.5-15 33.5-33.5c0-8.5-3.2-16.2-8.4-22.1c-3.3-3.7-8.4 .5-8.4 5.4zm-52.3-49.3c-4.9 0-9.1 5.1-5.4 8.4c5.9 5.2 13.7 8.4 22.1 8.4c18.5 0 33.5-15 33.5-33.5c0-8.5-3.2-16.2-8.4-22.1c-3.3-3.7-8.4 .5-8.4 5.4c0 18.5-15 33.5-33.5 33.5zm113.5-17.5c0 18.5-15 33.5-33.5 33.5c-4.9 0-9.1 5.1-5.4 8.4c5.9 5.2 13.7 8.4 22.1 8.4c18.5 0 33.5-15 33.5-33.5c0-8.5-3.2-16.2-8.4-22.1c-3.3-3.7-8.4 .5-8.4 5.4zM96 416c0-17.7 14.3-32 32-32l64 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0c-8.8 0-16 7.2-16 16l0 16c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-16c0-8.8-7.2-16-16-16l-16 0c-17.7 0-32-14.3-32-32z"]
};
const faGolfBall = faGolfBallTee;
const faCircleChevronLeft = {
  prefix: 'fas',
  iconName: 'circle-chevron-left',
  icon: [512, 512, ["chevron-circle-left"], "f137", "M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM271 135c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-87 87 87 87c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L167 273c-9.4-9.4-9.4-24.6 0-33.9L271 135z"]
};
const faChevronCircleLeft = faCircleChevronLeft;
const faHouseChimneyWindow = {
  prefix: 'fas',
  iconName: 'house-chimney-window',
  icon: [576, 512, [], "e00d", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c.2 35.5-28.5 64.3-64 64.3l-320.4 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7 416 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 121 52.8 46.4c8 7 12 15 11 24zM248 192c-13.3 0-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-80c0-13.3-10.7-24-24-24l-80 0z"]
};
const faPenNib = {
  prefix: 'fas',
  iconName: 'pen-nib',
  icon: [512, 512, [10001], "f5ad", "M368.4 18.3L312.7 74.1 437.9 199.3l55.7-55.7c21.9-21.9 21.9-57.3 0-79.2L447.6 18.3c-21.9-21.9-57.3-21.9-79.2 0zM288 94.6l-9.2 2.8L134.7 140.6c-19.9 6-35.7 21.2-42.3 41L3.8 445.8c-3.8 11.3-1 23.9 7.3 32.4L164.7 324.7c-3-6.3-4.7-13.3-4.7-20.7c0-26.5 21.5-48 48-48s48 21.5 48 48s-21.5 48-48 48c-7.4 0-14.4-1.7-20.7-4.7L33.7 500.9c8.6 8.3 21.1 11.2 32.4 7.3l264.3-88.6c19.7-6.6 35-22.4 41-42.3l43.2-144.1 2.7-9.2L288 94.6z"]
};
const faTentArrowTurnLeft = {
  prefix: 'fas',
  iconName: 'tent-arrow-turn-left',
  icon: [576, 512, [], "e580", "M120.1 41.8c9.9-8.9 10.7-24 1.8-33.9S97.8-2.7 87.9 6.2l-80 72C2.9 82.7 0 89.2 0 96s2.9 13.3 7.9 17.8l80 72c9.9 8.9 25 8.1 33.9-1.8s8.1-25-1.8-33.9L86.5 120 456 120c39.8 0 72 32.2 72 72l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-66.3-53.7-120-120-120L86.5 72l33.5-30.2zM307.4 166.5c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S86.7 512 96 512l144 0 16 0c17.7 0 32-14.3 32-32l0-118.1c0-5.5 4.4-9.9 9.9-9.9c3.7 0 7.2 2.1 8.8 5.5l68.4 136.8c5.4 10.8 16.5 17.7 28.6 17.7l60.2 0 16 0c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
};
const faTents = {
  prefix: 'fas',
  iconName: 'tents',
  icon: [640, 512, [], "e582", "M396.6 6.5L235.8 129.1c9.6 1.8 18.9 5.8 27 12l168 128c13.2 10.1 22 24.9 24.5 41.4l6.2 41.5L608 352c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128c-11.5-8.7-27.3-8.7-38.8 0zm-153.2 160c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S22.7 512 32 512l144 0 16 0c17.7 0 32-14.3 32-32l0-118.1c0-5.5 4.4-9.9 9.9-9.9c3.7 0 7.2 2.1 8.8 5.5l68.4 136.8c5.4 10.8 16.5 17.7 28.6 17.7l60.2 0 16 0c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
};
const faWandMagic = {
  prefix: 'fas',
  iconName: 'wand-magic',
  icon: [512, 512, ["magic"], "f0d0", "M14.1 463.3c-18.7-18.7-18.7-49.1 0-67.9L395.4 14.1c18.7-18.7 49.1-18.7 67.9 0l34.6 34.6c18.7 18.7 18.7 49.1 0 67.9L116.5 497.9c-18.7 18.7-49.1 18.7-67.9 0L14.1 463.3zM347.6 187.6l105-105L429.4 59.3l-105 105 23.3 23.3z"]
};
const faMagic = faWandMagic;
const faDog = {
  prefix: 'fas',
  iconName: 'dog',
  icon: [576, 512, [128021], "f6d3", "M309.6 158.5L332.7 19.8C334.6 8.4 344.5 0 356.1 0c7.5 0 14.5 3.5 19 9.5L392 32l52.1 0c12.7 0 24.9 5.1 33.9 14.1L496 64l56 0c13.3 0 24 10.7 24 24l0 24c0 44.2-35.8 80-80 80l-32 0-16 0-21.3 0-5.1 30.5-112-64zM416 256.1L416 480c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-115.2c-24 12.3-51.2 19.2-80 19.2s-56-6.9-80-19.2L160 480c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-230.2c-28.8-10.9-51.4-35.3-59.2-66.5L1 167.8c-4.3-17.1 6.1-34.5 23.3-38.8s34.5 6.1 38.8 23.3l3.9 15.5C70.5 182 83.3 192 98 192l30 0 16 0 159.8 0L416 256.1zM464 80a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faCarrot = {
  prefix: 'fas',
  iconName: 'carrot',
  icon: [512, 512, [129365], "f787", "M346.7 6C337.6 17 320 42.3 320 72c0 40 15.3 55.3 40 80s40 40 80 40c29.7 0 55-17.6 66-26.7c4-3.3 6-8.2 6-13.3s-2-10-6-13.2c-11.4-9.1-38.3-26.8-74-26.8c-32 0-40 8-40 8s8-8 8-40c0-35.7-17.7-62.6-26.8-74C370 2 365.1 0 360 0s-10 2-13.3 6zM244.6 136c-40 0-77.1 18.1-101.7 48.2l60.5 60.5c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-55.3-55.3 0 .1L2.2 477.9C-2 487-.1 497.8 7 505s17.9 9 27.1 4.8l134.7-62.4-52.1-52.1c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L199.7 433l100.2-46.4c46.4-21.5 76.2-68 76.2-119.2C376 194.8 317.2 136 244.6 136z"]
};
const faMoon = {
  prefix: 'fas',
  iconName: 'moon',
  icon: [384, 512, [127769, 9214], "f186", "M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z"]
};
const faWineGlassEmpty = {
  prefix: 'fas',
  iconName: 'wine-glass-empty',
  icon: [320, 512, ["wine-glass-alt"], "f5ce", "M64 0C47.4 0 33.5 12.8 32.1 29.3l-14 168.4c-6 72 42.5 135.2 109.9 150.6l0 99.6-48 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0 80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-48 0 0-99.6c67.4-15.4 115.9-78.6 109.9-150.6l-14-168.4C286.5 12.8 272.6 0 256 0L64 0zM81.9 203.1L93.4 64l133.1 0 11.6 139.1C242 248.8 205.9 288 160 288s-82-39.2-78.1-84.9z"]
};
const faWineGlassAlt = faWineGlassEmpty;
const faCheese = {
  prefix: 'fas',
  iconName: 'cheese',
  icon: [512, 512, [], "f7ef", "M512 240.2l0 15.8L0 256c0-20 10-38.7 26.6-49.8L274.9 40.7c8.6-5.7 18.6-8.7 28.9-8.7C418.8 32 512 125.2 512 240.2zm0 47.8l0 128c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 288l512 0z"]
};
const faYinYang = {
  prefix: 'fas',
  iconName: 'yin-yang',
  icon: [512, 512, [9775], "f6ad", "M256 64c53 0 96 43 96 96s-43 96-96 96s-96 43-96 96s43 96 96 96C150 448 64 362 64 256S150 64 256 64zm0 448A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm32-352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faMusic = {
  prefix: 'fas',
  iconName: 'music',
  icon: [512, 512, [127925], "f001", "M499.1 6.3c8.1 6 12.9 15.6 12.9 25.7l0 72 0 264c0 44.2-43 80-96 80s-96-35.8-96-80s43-80 96-80c11.2 0 22 1.6 32 4.6L448 147 192 223.8 192 432c0 44.2-43 80-96 80s-96-35.8-96-80s43-80 96-80c11.2 0 22 1.6 32 4.6L128 200l0-72c0-14.1 9.3-26.6 22.8-30.7l320-96c9.7-2.9 20.2-1.1 28.3 5z"]
};
const faCodeCommit = {
  prefix: 'fas',
  iconName: 'code-commit',
  icon: [640, 512, [], "f386", "M320 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm156.8-48C462 361 397.4 416 320 416s-142-55-156.8-128L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l131.2 0C178 151 242.6 96 320 96s142 55 156.8 128L608 224c17.7 0 32 14.3 32 32s-14.3 32-32 32l-131.2 0z"]
};
const faTemperatureLow = {
  prefix: 'fas',
  iconName: 'temperature-low',
  icon: [512, 512, [], "f76b", "M448 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 96a96 96 0 1 1 192 0A96 96 0 1 1 320 96zM144 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C70.2 332.6 64 349.5 64 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L192 112c0-26.5-21.5-48-48-48zM32 112C32 50.2 82.1 0 144 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S0 447.5 0 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L32 112zM192 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3l0-50.7c0-8.8 7.2-16 16-16s16 7.2 16 16l0 50.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faPersonBiking = {
  prefix: 'fas',
  iconName: 'person-biking',
  icon: [640, 512, [128692, "biking"], "f84a", "M400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm27.2 64l-61.8-48.8c-17.3-13.6-41.7-13.8-59.1-.3l-83.1 64.2c-30.7 23.8-28.5 70.8 4.3 91.6L288 305.1 288 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128c0-10.7-5.3-20.7-14.2-26.6L295 232.9l60.3-48.5L396 217c5.7 4.5 12.7 7 20 7l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-52.8 0zM56 384a72 72 0 1 1 144 0A72 72 0 1 1 56 384zm200 0A128 128 0 1 0 0 384a128 128 0 1 0 256 0zm184 0a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zm200 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"]
};
const faBiking = faPersonBiking;
const faBroom = {
  prefix: 'fas',
  iconName: 'broom',
  icon: [576, 512, [129529], "f51a", "M566.6 54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192-34.7-34.7c-4.2-4.2-10-6.6-16-6.6c-12.5 0-22.6 10.1-22.6 22.6l0 29.1L364.3 320l29.1 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16l-34.7-34.7 192-192zM341.1 353.4L222.6 234.9c-42.7-3.7-85.2 11.7-115.8 42.3l-8 8C76.5 307.5 64 337.7 64 369.2c0 6.8 7.1 11.2 13.2 8.2l51.1-25.5c5-2.5 9.5 4.1 5.4 7.9L7.3 473.4C2.7 477.6 0 483.6 0 489.9C0 502.1 9.9 512 22.1 512l173.3 0c38.8 0 75.9-15.4 103.4-42.8c30.6-30.6 45.9-73.1 42.3-115.8z"]
};
const faShieldHeart = {
  prefix: 'fas',
  iconName: 'shield-heart',
  icon: [512, 512, [], "e574", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM144 221.3c0-33.8 27.4-61.3 61.3-61.3c16.2 0 31.8 6.5 43.3 17.9l7.4 7.4 7.4-7.4c11.5-11.5 27.1-17.9 43.3-17.9c33.8 0 61.3 27.4 61.3 61.3c0 16.2-6.5 31.8-17.9 43.3l-82.7 82.7c-6.2 6.2-16.4 6.2-22.6 0l-82.7-82.7c-11.5-11.5-17.9-27.1-17.9-43.3z"]
};
const faGopuram = {
  prefix: 'fas',
  iconName: 'gopuram',
  icon: [512, 512, [], "f664", "M120 0c13.3 0 24 10.7 24 24l0 8 40 0 0-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 8 48 0 0-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 8 40 0 0-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 8 0 32 0 64c17.7 0 32 14.3 32 32l0 64c17.7 0 32 14.3 32 32l0 96c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-64 0 0-160-32 0 0-128-32 0 0-96-32 0 0 96 32 0 0 128 32 0 0 160-80 0 0-48c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 48-80 0 0-160 32 0 0-128 32 0 0-96-32 0 0 96-32 0 0 128-32 0 0 160-64 0c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32l0-96c0-17.7 14.3-32 32-32l0-64c0-17.7 14.3-32 32-32l0-64 0-32 0-8c0-13.3 10.7-24 24-24zM256 272c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-32-80l0 32 64 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faEarthOceania = {
  prefix: 'fas',
  iconName: 'earth-oceania',
  icon: [512, 512, ["globe-oceania"], "e47b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM208.6 357.3l-39-13.5c-6.5-2.2-13.6-2.3-20.1-.3l-15.3 4.9c-18.5 5.9-38.5-2.4-47.5-19.5l-3.3-6.2c-10.6-20.1-2.3-45 18.2-54.7l35.3-16.8c2.3-1.1 4.4-2.8 5.9-4.8l5.3-7c7.2-9.6 18.6-15.3 30.6-15.3s23.4 5.7 30.6 15.3l4.6 6.1c2 2.6 4.9 4.5 8.1 5.1c7.8 1.6 15.7-1.5 20.4-7.9l10.4-14.2c2-2.8 5.3-4.4 8.7-4.4c4.4 0 8.4 2.7 10 6.8l10.1 25.9c2.8 7.2 6.7 14 11.5 20.2L311 299.8c5.8 7.4 9 16.6 9 26s-3.2 18.6-9 26L299 367.2c-8.3 10.6-21 16.8-34.4 16.8c-8.4 0-16.6-2.4-23.7-7l-25.4-16.4c-2.2-1.4-4.5-2.5-6.9-3.4zm65.2-214.8L296 164.7c10.1 10.1 2.9 27.3-11.3 27.3l-29.9 0c-5.6 0-11.1-1.2-16.2-3.4l-42.8-19c-14.3-6.3-11.9-27.3 3.4-30.3l38.5-7.7c13.1-2.6 26.7 1.5 36.1 10.9zM248 432c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16zM431.2 298.9l8 24c2.8 8.4-1.7 17.4-10.1 20.2s-17.4-1.7-20.2-10.1l-8-24c-2.8-8.4 1.7-17.4 10.1-20.2s17.4 1.7 20.2 10.1zm-19.9 80.4l-32 32c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l32-32c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faGlobeOceania = faEarthOceania;
const faSquareXmark = {
  prefix: 'fas',
  iconName: 'square-xmark',
  icon: [448, 512, [10062, "times-square", "xmark-square"], "f2d3", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm79 143c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faTimesSquare = faSquareXmark;
const faXmarkSquare = faSquareXmark;
const faHashtag = {
  prefix: 'fas',
  iconName: 'hashtag',
  icon: [448, 512, [62098], "23", "M181.3 32.4c17.4 2.9 29.2 19.4 26.3 36.8L197.8 128l95.1 0 11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3s29.2 19.4 26.3 36.8L357.8 128l58.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-68.9 0L325.8 320l58.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-68.9 0-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l9.8-58.7-95.1 0-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8L90.2 384 32 384c-17.7 0-32-14.3-32-32s14.3-32 32-32l68.9 0 21.3-128L64 192c-17.7 0-32-14.3-32-32s14.3-32 32-32l68.9 0 11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3zM187.1 192L165.8 320l95.1 0 21.3-128-95.1 0z"]
};
const faUpRightAndDownLeftFromCenter = {
  prefix: 'fas',
  iconName: 'up-right-and-down-left-from-center',
  icon: [512, 512, ["expand-alt"], "f424", "M344 0L488 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87L327 41c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512L24 512c-13.3 0-24-10.7-24-24L0 344c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8z"]
};
const faExpandAlt = faUpRightAndDownLeftFromCenter;
const faOilCan = {
  prefix: 'fas',
  iconName: 'oil-can',
  icon: [640, 512, [], "f613", "M320 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32-80 0-48 0-48 0c-26.5 0-48 21.5-48 48l0 64.8c0 19 11.2 36.2 28.5 43.9l67.5 30L96 368c0 26.5 21.5 48 48 48l259.1 0c18.4 0 35.8-7.9 48-21.7L633.5 187.7c12.3-13.9-.3-35.4-18.4-31.5L448 192l-50.5-25.2c-8.9-4.4-18.7-6.8-28.6-6.8L288 160l0-32 32 0zM96 208l0 86.1L48 272.8 48 208l48 0z"]
};
const faT = {
  prefix: 'fas',
  iconName: 't',
  icon: [384, 512, [116], "54", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l128 0 0 352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-352 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 32 32 32z"]
};
const faHippo = {
  prefix: 'fas',
  iconName: 'hippo',
  icon: [640, 512, [129435], "f6ed", "M407 47c9.4-9.4 24.6-9.4 33.9 0l17.2 17.2c1.9-.1 3.9-.2 5.8-.2l32 0c11.2 0 21.9 2.3 31.6 6.5L543 55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L564 101.9c7.6 12.2 12 26.7 12 42.1c0 10.2 7.4 18.8 16.7 23c27.9 12.5 47.3 40.5 47.3 73c0 26.2-12.6 49.4-32 64l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-16-64 0 0 16c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-17.6c-11.8-2.4-22.7-7.4-32-14.4c-1.5-1.1-2.9-2.3-4.3-3.5c-17-14.7-27.7-36.4-27.7-60.5c0-8.8-7.2-16-16-16s-16 7.2-16 16c0 44.7 26.2 83.2 64 101.2l0 10.8c0 17.7 14.3 32 32 32l32 0 0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-76c-19.8 7.7-41.4 12-64 12s-44.2-4.3-64-12l0 76c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-118.9L45.9 369.7c-5.4 12.1-19.6 17.6-31.7 12.2S-3.3 362.4 2.1 350.3L24 300.9c5.3-11.9 8-24.7 8-37.7C32 155.7 117.2 68 223.8 64.1l.2-.1 7.2 0L256 64l32 0c41.7 0 83.4 12.1 117.2 25.7c1.7-1.8 3.5-3.6 5.3-5.2L407 81c-9.4-9.4-9.4-24.6 0-33.9zm73 185a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm88 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM480 144a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faChartColumn = {
  prefix: 'fas',
  iconName: 'chart-column',
  icon: [512, 512, [], "e0e3", "M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zM160 224c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm128-64l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32s32 14.3 32 32zm64 32c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32zM480 96l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-224c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faInfinity = {
  prefix: 'fas',
  iconName: 'infinity',
  icon: [640, 512, [8734, 9854], "f534", "M0 241.1C0 161 65 96 145.1 96c38.5 0 75.4 15.3 102.6 42.5L320 210.7l72.2-72.2C419.5 111.3 456.4 96 494.9 96C575 96 640 161 640 241.1l0 29.7C640 351 575 416 494.9 416c-38.5 0-75.4-15.3-102.6-42.5L320 301.3l-72.2 72.2C220.5 400.7 183.6 416 145.1 416C65 416 0 351 0 270.9l0-29.7zM274.7 256l-72.2-72.2c-15.2-15.2-35.9-23.8-57.4-23.8C100.3 160 64 196.3 64 241.1l0 29.7c0 44.8 36.3 81.1 81.1 81.1c21.5 0 42.2-8.5 57.4-23.8L274.7 256zm90.5 0l72.2 72.2c15.2 15.2 35.9 23.8 57.4 23.8c44.8 0 81.1-36.3 81.1-81.1l0-29.7c0-44.8-36.3-81.1-81.1-81.1c-21.5 0-42.2 8.5-57.4 23.8L365.3 256z"]
};
const faVialCircleCheck = {
  prefix: 'fas',
  iconName: 'vial-circle-check',
  icon: [512, 512, [], "e596", "M0 64C0 46.3 14.3 32 32 32l64 0 64 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 170.8c-20.2 28.6-32 63.5-32 101.2c0 25.2 5.3 49.1 14.8 70.8C189.5 463.7 160.6 480 128 480c-53 0-96-43-96-96L32 96C14.3 96 0 81.7 0 64zM96 96l0 96 64 0 0-96L96 96zM224 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L352 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faPersonArrowDownToLine = {
  prefix: 'fas',
  iconName: 'person-arrow-down-to-line',
  icon: [640, 512, [], "e538", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 352l0-96 16 0 0 96-16 0zm-64 0l-88 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l120 0 80 0 376 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-344 0 0-191.1 28.6 47.5c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-58.3-97c-17.4-28.9-48.6-46.6-82.3-46.6l-29.7 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9 120 448zM464 64l0 242.7-25.4-25.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l80 80c12.5 12.5 32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L528 306.7 528 64c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faVoicemail = {
  prefix: 'fas',
  iconName: 'voicemail',
  icon: [640, 512, [], "f897", "M144 320a80 80 0 1 1 0-160 80 80 0 1 1 0 160zm119.8 0c15.3-22.9 24.2-50.4 24.2-80c0-79.5-64.5-144-144-144S0 160.5 0 240s64.5 144 144 144l352 0c79.5 0 144-64.5 144-144s-64.5-144-144-144s-144 64.5-144 144c0 29.6 8.9 57.1 24.2 80l-112.5 0zM496 160a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faFan = {
  prefix: 'fas',
  iconName: 'fan',
  icon: [512, 512, [], "f863", "M258.6 0c-1.7 0-3.4 .1-5.1 .5C168 17 115.6 102.3 130.5 189.3c2.9 17 8.4 32.9 15.9 47.4L32 224l-2.6 0C13.2 224 0 237.2 0 253.4c0 1.7 .1 3.4 .5 5.1C17 344 102.3 396.4 189.3 381.5c17-2.9 32.9-8.4 47.4-15.9L224 480l0 2.6c0 16.2 13.2 29.4 29.4 29.4c1.7 0 3.4-.1 5.1-.5C344 495 396.4 409.7 381.5 322.7c-2.9-17-8.4-32.9-15.9-47.4L480 288l2.6 0c16.2 0 29.4-13.2 29.4-29.4c0-1.7-.1-3.4-.5-5.1C495 168 409.7 115.6 322.7 130.5c-17 2.9-32.9 8.4-47.4 15.9L288 32l0-2.6C288 13.2 274.8 0 258.6 0zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faPersonWalkingLuggage = {
  prefix: 'fas',
  iconName: 'person-walking-luggage',
  icon: [576, 512, [], "e554", "M432 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM347.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L505 232.7l-15.3-36.8C472.5 154.8 432.3 128 387.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1l-25 62.4-59.4 59.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L340.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM256 274.1c-7.7-4.4-17.4-1.8-21.9 5.9l-32 55.4L147.7 304c-15.3-8.8-34.9-3.6-43.7 11.7L40 426.6c-8.8 15.3-3.6 34.9 11.7 43.7l55.4 32c15.3 8.8 34.9 3.6 43.7-11.7l64-110.9c1.5-2.6 2.6-5.2 3.3-8L261.9 296c4.4-7.7 1.8-17.4-5.9-21.9z"]
};
const faUpDown = {
  prefix: 'fas',
  iconName: 'up-down',
  icon: [256, 512, [8597, 11021, "arrows-alt-v"], "f338", "M145.6 7.7C141 2.8 134.7 0 128 0s-13 2.8-17.6 7.7l-104 112c-6.5 7-8.2 17.2-4.4 25.9S14.5 160 24 160l56 0 0 192-56 0c-9.5 0-18.2 5.7-22 14.4s-2.1 18.9 4.4 25.9l104 112c4.5 4.9 10.9 7.7 17.6 7.7s13-2.8 17.6-7.7l104-112c6.5-7 8.2-17.2 4.4-25.9s-12.5-14.4-22-14.4l-56 0 0-192 56 0c9.5 0 18.2-5.7 22-14.4s2.1-18.9-4.4-25.9l-104-112z"]
};
const faArrowsAltV = faUpDown;
const faCloudMoonRain = {
  prefix: 'fas',
  iconName: 'cloud-moon-rain',
  icon: [576, 512, [], "f73c", "M481.2 0C417 0 363.5 46.5 353.7 107.6c35.4 17.6 60.2 53.3 62.1 95.1c23.2 11 42 29.7 53.1 52.7c4 .4 8.1 .6 12.3 .6c34.9 0 66.7-13.8 89.9-36.1c5.1-4.9 6.4-12.5 3.2-18.7s-10.1-9.7-17-8.6c-4.9 .8-10 1.3-15.2 1.3c-49 0-88.4-39.3-88.4-87.4c0-32.6 18-61.1 44.9-76.1c6.1-3.4 9.3-10.5 7.8-17.4s-7.3-12-14.3-12.6c-3.6-.3-7.3-.5-10.9-.5zM367.9 383.9c44.2 0 80-35.8 80-80c0-39.3-28.4-72.1-65.8-78.7c1.2-5.6 1.9-11.3 1.9-17.2c0-44.2-35.8-80-80-80c-17 0-32.8 5.3-45.8 14.4C241.3 114.6 210.8 96 176 96c-53 0-96 43-96 96l0 1.3c-45.4 7.6-80 47.1-80 94.6c0 53 43 96 96 96l271.9 0zM85.4 420.1c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3zm96 0c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3zm96 0c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3zm96 0c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3z"]
};
const faCalendar = {
  prefix: 'fas',
  iconName: 'calendar',
  icon: [448, 512, [128197, 128198], "f133", "M96 32l0 32L48 64C21.5 64 0 85.5 0 112l0 48 448 0 0-48c0-26.5-21.5-48-48-48l-48 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L160 64l0-32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192L0 192 0 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-272z"]
};
const faTrailer = {
  prefix: 'fas',
  iconName: 'trailer',
  icon: [640, 512, [], "e041", "M48 32C21.5 32 0 53.5 0 80L0 336c0 26.5 21.5 48 48 48l17.1 0c7.8-54.3 54.4-96 110.9-96s103.1 41.7 110.9 96L488 384l8 0 112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-240c0-26.5-21.5-48-48-48L48 32zM80 96c8.8 0 16 7.2 16 16l0 131.2c-11.4 5.9-22.2 12.9-32 21L64 112c0-8.8 7.2-16 16-16zm96 128c-5.4 0-10.7 .2-16 .7L160 112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112.7c-5.3-.5-10.6-.7-16-.7zm80 19.2L256 112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 152.2c-9.8-8.1-20.6-15.2-32-21zM368 96c8.8 0 16 7.2 16 16l0 192c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-192c0-8.8 7.2-16 16-16zm112 16l0 192c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-192c0-8.8 7.2-16 16-16s16 7.2 16 16zM176 480a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-112a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBahai = {
  prefix: 'fas',
  iconName: 'bahai',
  icon: [576, 512, ["haykal"], "f666", "M288 0c14.5 0 27.2 9.7 30.9 23.8l23.9 89.6 75.9-53.3c11.9-8.3 27.8-7.6 39 1.7s14.6 24.9 8.4 38.1l-39.3 84 92.4 8c14.4 1.2 26.2 12 28.8 26.3s-4.9 28.5-18 34.6l-84.1 39.1 65.7 65.5c10.3 10.2 12.4 26.1 5.1 38.7s-22 18.7-36 14.9L391 386.8l8.2 92.4c1.3 14.4-7.3 27.9-20.9 32.9s-28.9 .1-37.2-11.7l-53.1-76-53.1 76c-8.3 11.9-23.6 16.7-37.2 11.7s-22.2-18.5-20.9-32.9l8.2-92.4L95.4 410.9c-14 3.8-28.8-2.3-36-14.9s-5.2-28.4 5.1-38.7l65.7-65.5L46 252.7c-13.1-6.1-20.5-20.3-18-34.6s14.3-25.1 28.8-26.3l92.4-8-39.3-84c-6.1-13.1-2.7-28.8 8.4-38.1s27.1-10 39-1.7l75.9 53.3 23.9-89.6C260.8 9.7 273.5 0 288 0zm0 156.2l-4.8 18c-2.7 10.1-10.2 18.2-20 21.8s-20.8 2.1-29.3-3.9l-15.2-10.7 7.9 16.8c4.4 9.5 4 20.5-1.3 29.6s-14.5 15-25 15.9l-18.5 1.6 16.8 7.8c9.5 4.4 16.2 13.2 18 23.5s-1.5 20.8-8.9 28.2l-13.2 13.1 17.9-4.8c10.1-2.7 20.9-.3 28.9 6.4s12.2 16.9 11.3 27.3l-1.6 18.5 10.6-15.2c6-8.6 15.8-13.7 26.2-13.7s20.2 5.1 26.2 13.7l10.6 15.2-1.6-18.5c-.9-10.4 3.3-20.6 11.3-27.3s18.8-9.1 28.9-6.4l17.9 4.8-13.2-13.1c-7.4-7.4-10.7-17.9-8.9-28.2s8.5-19.1 18-23.5l16.8-7.8-18.5-1.6c-10.4-.9-19.7-6.8-25-15.9s-5.7-20.1-1.3-29.6l7.9-16.8-15.2 10.7c-8.6 6-19.5 7.5-29.3 3.9s-17.3-11.7-20-21.8l-4.8-18z"]
};
const faHaykal = faBahai;
const faSdCard = {
  prefix: 'fas',
  iconName: 'sd-card',
  icon: [384, 512, [], "f7c2", "M320 0L141.3 0C124.3 0 108 6.7 96 18.7L18.7 96C6.7 108 0 124.3 0 141.3L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64zM160 88l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24zm80 0l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24zm80 0l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faDragon = {
  prefix: 'fas',
  iconName: 'dragon',
  icon: [640, 512, [128009], "f6d5", "M352 124.5l-51.9-13c-6.5-1.6-11.3-7.1-12-13.8s2.8-13.1 8.7-16.1l40.8-20.4L294.4 28.8c-5.5-4.1-7.8-11.3-5.6-17.9S297.1 0 304 0L416 0l32 0 16 0c30.2 0 58.7 14.2 76.8 38.4l57.6 76.8c6.2 8.3 9.6 18.4 9.6 28.8c0 26.5-21.5 48-48 48l-21.5 0c-17 0-33.3-6.7-45.3-18.7L480 160l-32 0 0 21.5c0 24.8 12.8 47.9 33.8 61.1l106.6 66.6c32.1 20.1 51.6 55.2 51.6 93.1C640 462.9 590.9 512 530.2 512L496 512l-64 0L32.3 512c-3.3 0-6.6-.4-9.6-1.4C13.5 507.8 6 501 2.4 492.1C1 488.7 .2 485.2 0 481.4c-.2-3.7 .3-7.3 1.3-10.7c2.8-9.2 9.6-16.7 18.6-20.4c3-1.2 6.2-2 9.5-2.2L433.3 412c8.3-.7 14.7-7.7 14.7-16.1c0-4.3-1.7-8.4-4.7-11.4l-44.4-44.4c-30-30-46.9-70.7-46.9-113.1l0-45.5 0-57zM512 72.3c0-.1 0-.2 0-.3s0-.2 0-.3l0 .6zm-1.3 7.4L464.3 68.1c-.2 1.3-.3 2.6-.3 3.9c0 13.3 10.7 24 24 24c10.6 0 19.5-6.8 22.7-16.3zM130.9 116.5c16.3-14.5 40.4-16.2 58.5-4.1l130.6 87 0 27.5c0 32.8 8.4 64.8 24 93l-232 0c-6.7 0-12.7-4.2-15-10.4s-.5-13.3 4.6-17.7L171 232.3 18.4 255.8c-7 1.1-13.9-2.6-16.9-9s-1.5-14.1 3.8-18.8L130.9 116.5z"]
};
const faShoePrints = {
  prefix: 'fas',
  iconName: 'shoe-prints',
  icon: [640, 512, [], "f54b", "M416 0C352.3 0 256 32 256 32l0 128c48 0 76 16 104 32s56 32 104 32c56.4 0 176-16 176-96S512 0 416 0zM128 96c0 35.3 28.7 64 64 64l32 0 0-128-32 0c-35.3 0-64 28.7-64 64zM288 512c96 0 224-48 224-128s-119.6-96-176-96c-48 0-76 16-104 32s-56 32-104 32l0 128s96.3 32 160 32zM0 416c0 35.3 28.7 64 64 64l32 0 0-128-32 0c-35.3 0-64 28.7-64 64z"]
};
const faCirclePlus = {
  prefix: 'fas',
  iconName: 'circle-plus',
  icon: [512, 512, ["plus-circle"], "f055", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
};
const faPlusCircle = faCirclePlus;
const faFaceGrinTongueWink = {
  prefix: 'fas',
  iconName: 'face-grin-tongue-wink',
  icon: [512, 512, [128540, "grin-tongue-wink"], "f58b", "M174.5 498.8C73.1 464.7 0 368.9 0 256C0 114.6 114.6 0 256 0S512 114.6 512 256c0 112.9-73.1 208.7-174.5 242.8C346.7 484 352 466.6 352 448l0-46.9c24.3-17.5 43.6-41.6 55.4-69.6c5-11.8-7-22.5-19.3-18.7c-39.7 12.2-84.5 19-131.8 19s-92.1-6.8-131.8-19c-12.3-3.8-24.3 6.9-19.3 18.7c11.7 27.8 30.8 51.7 54.8 69.2l0 47.3c0 18.6 5.3 36 14.5 50.8zm20.7-265.2c5.3 7.1 15.3 8.5 22.4 3.2s8.5-15.3 3.2-22.4c-30.4-40.5-91.2-40.5-121.6 0c-5.3 7.1-3.9 17.1 3.2 22.4s17.1 3.9 22.4-3.2c17.6-23.5 52.8-23.5 70.4 0zM336 272a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM320 402.6l0 45.4c0 35.3-28.7 64-64 64s-64-28.7-64-64l0-45.4c0-14.7 11.9-26.6 26.6-26.6l2 0c11.3 0 21.1 7.9 23.6 18.9c2.8 12.6 20.8 12.6 23.6 0c2.5-11.1 12.3-18.9 23.6-18.9l2 0c14.7 0 26.6 11.9 26.6 26.6zM336 184a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faGrinTongueWink = faFaceGrinTongueWink;
const faHandHolding = {
  prefix: 'fas',
  iconName: 'hand-holding',
  icon: [576, 512, [], "f4bd", "M559.7 392.2c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416 272 416c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0-16 0-78.3 0c-29.1 0-57.3 9.9-80 28L68.8 384 32 384c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l160 0 160.5 0c29 0 57.3-9.3 80.7-26.5l126.6-93.3zm-367-8.2c.3 0 .6 0 .9 0c0 0 0 0 0 0c-.3 0-.6 0-.9 0z"]
};
const faPlugCircleExclamation = {
  prefix: 'fas',
  iconName: 'plug-circle-exclamation',
  icon: [576, 512, [], "e55d", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faLinkSlash = {
  prefix: 'fas',
  iconName: 'link-slash',
  icon: [640, 512, ["chain-broken", "chain-slash", "unlink"], "f127", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L489.3 358.2l90.5-90.5c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114l-96 96-31.9-25C430.9 239.6 420.1 175.1 377 132c-52.2-52.3-134.5-56.2-191.3-11.7L38.8 5.1zM239 162c30.1-14.9 67.7-9.9 92.8 15.3c20 20 27.5 48.3 21.7 74.5L239 162zM406.6 416.4L220.9 270c-2.1 39.8 12.2 80.1 42.2 110c38.9 38.9 94.4 51 143.6 36.3zm-290-228.5L60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5l61.8-61.8-50.6-39.9z"]
};
const faChainBroken = faLinkSlash;
const faChainSlash = faLinkSlash;
const faUnlink = faLinkSlash;
const faClone = {
  prefix: 'fas',
  iconName: 'clone',
  icon: [512, 512, [], "f24d", "M288 448L64 448l0-224 64 0 0-64-64 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-64-64 0 0 64zm-64-96l224 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L224 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64z"]
};
const faPersonWalkingArrowLoopLeft = {
  prefix: 'fas',
  iconName: 'person-walking-arrow-loop-left',
  icon: [640, 512, [], "e551", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zm347.7 119c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L461.3 384l18.7 0c88.4 0 160-71.6 160-160s-71.6-160-160-160L352 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c53 0 96 43 96 96s-43 96-96 96l-18.7 0 25.4-25.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3l80 80z"]
};
const faArrowUpZA = {
  prefix: 'fas',
  iconName: 'arrow-up-z-a',
  icon: [576, 512, ["sort-alpha-up-alt"], "f882", "M183.6 42.4C177.5 35.8 169 32 160 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L128 146.3 128 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 64c0 17.7 14.3 32 32 32l50.7 0-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-50.7 0 73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L352 32c-17.7 0-32 14.3-32 32zm96 192c-12.1 0-23.2 6.8-28.6 17.7l-64 128-16 32c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3 88.4 0 7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9l-16-32-64-128C439.2 262.8 428.1 256 416 256zM395.8 400L416 359.6 436.2 400l-40.4 0z"]
};
const faSortAlphaUpAlt = faArrowUpZA;
const faFireFlameCurved = {
  prefix: 'fas',
  iconName: 'fire-flame-curved',
  icon: [384, 512, ["fire-alt"], "f7e4", "M153.6 29.9l16-21.3C173.6 3.2 180 0 186.7 0C198.4 0 208 9.6 208 21.3V43.5c0 13.1 5.4 25.7 14.9 34.7L307.6 159C356.4 205.6 384 270.2 384 337.7C384 434 306 512 209.7 512H192C86 512 0 426 0 320v-3.8c0-48.8 19.4-95.6 53.9-130.1l3.5-3.5c4.2-4.2 10-6.6 16-6.6C85.9 176 96 186.1 96 198.6V288c0 35.3 28.7 64 64 64s64-28.7 64-64v-3.9c0-18-7.2-35.3-19.9-48l-38.6-38.6c-24-24-37.5-56.7-37.5-90.7c0-27.7 9-54.8 25.6-76.9z"]
};
const faFireAlt = faFireFlameCurved;
const faTornado = {
  prefix: 'fas',
  iconName: 'tornado',
  icon: [448, 512, [127786], "f76f", "M0 32L0 45.6C0 62.7 1.7 79.6 5 96l352.8 0c3.2-6.9 7.5-13.3 13-18.8l38.6-38.6c4.2-4.2 6.6-10 6.6-16C416 10.1 405.9 0 393.4 0L32 0C14.3 0 0 14.3 0 32zm352.2 96L13.6 128c12.2 35.9 32.3 68.7 58.8 96L412 224l-47.2-62.9c-7.3-9.7-11.6-21.2-12.6-33.1zm-226 138.2l116.4 68.5c8.2 4.8 15.8 10.7 22.5 17.3L445 352c2-9.8 3-19.9 3-30.1c0-23-5.3-45.5-15.3-65.9l-322.5 0c5.2 3.6 10.5 7 16 10.2zM288 384c10.3 21.4 13.8 45.5 9.9 69l-5.9 35.7c-2 12.2 7.4 23.4 19.8 23.4c5.3 0 10.4-2.1 14.2-5.9l78.2-78.2c12.8-12.8 23.1-27.7 30.4-43.9L288 384z"]
};
const faFileCirclePlus = {
  prefix: 'fas',
  iconName: 'file-circle-plus',
  icon: [576, 512, [58606], "e494", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm16 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0 0-48z"]
};
const faBookQuran = {
  prefix: 'fas',
  iconName: 'book-quran',
  icon: [448, 512, ["quran"], "f687", "M352 0c53 0 96 43 96 96l0 320c0 53-43 96-96 96L64 512l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0L64 0 352 0zm0 384L96 384l0 64 256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32zM274.1 150.2l-8.9 21.4-23.1 1.9c-5.7 .5-8 7.5-3.7 11.2L256 199.8l-5.4 22.6c-1.3 5.5 4.7 9.9 9.6 6.9L280 217.2l19.8 12.1c4.9 3 10.9-1.4 9.6-6.9L304 199.8l17.6-15.1c4.3-3.7 2-10.8-3.7-11.2l-23.1-1.9-8.9-21.4c-2.2-5.3-9.6-5.3-11.8 0zM96 192c0 70.7 57.3 128 128 128c25.6 0 49.5-7.5 69.5-20.5c3.2-2.1 4.5-6.2 3.1-9.7s-5.2-5.6-9-4.8c-6.1 1.2-12.5 1.9-19 1.9c-52.4 0-94.9-42.5-94.9-94.9s42.5-94.9 94.9-94.9c6.5 0 12.8 .7 19 1.9c3.8 .8 7.5-1.3 9-4.8s.2-7.6-3.1-9.7C273.5 71.5 249.6 64 224 64C153.3 64 96 121.3 96 192z"]
};
const faQuran = faBookQuran;
const faAnchor = {
  prefix: 'fas',
  iconName: 'anchor',
  icon: [576, 512, [9875], "f13d", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c88.4 0 160-71.6 160-160l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-56-56c-9.4-9.4-24.6-9.4-33.9 0l-56 56c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 53-43 96-96 96l-48 0 0-208 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0z"]
};
const faBorderAll = {
  prefix: 'fas',
  iconName: 'border-all',
  icon: [448, 512, [], "f84c", "M384 96l0 128-128 0 0-128 128 0zm0 192l0 128-128 0 0-128 128 0zM192 224L64 224 64 96l128 0 0 128zM64 288l128 0 0 128L64 416l0-128zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"]
};
const faFaceAngry = {
  prefix: 'fas',
  iconName: 'face-angry',
  icon: [512, 512, [128544, "angry"], "f556", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM338.7 395.9c6.6-5.9 7.1-16 1.2-22.6C323.8 355.4 295.7 336 256 336s-67.8 19.4-83.9 37.3c-5.9 6.6-5.4 16.7 1.2 22.6s16.7 5.4 22.6-1.2c11.7-13 31.6-26.7 60.1-26.7s48.4 13.7 60.1 26.7c5.9 6.6 16 7.1 22.6 1.2zM176.4 272c17.7 0 32-14.3 32-32c0-1.5-.1-3-.3-4.4l10.9 3.6c8.4 2.8 17.4-1.7 20.2-10.1s-1.7-17.4-10.1-20.2l-96-32c-8.4-2.8-17.4 1.7-20.2 10.1s1.7 17.4 10.1 20.2l30.7 10.2c-5.8 5.8-9.3 13.8-9.3 22.6c0 17.7 14.3 32 32 32zm192-32c0-8.9-3.6-17-9.5-22.8l30.2-10.1c8.4-2.8 12.9-11.9 10.1-20.2s-11.9-12.9-20.2-10.1l-96 32c-8.4 2.8-12.9 11.9-10.1 20.2s11.9 12.9 20.2 10.1l11.7-3.9c-.2 1.5-.3 3.1-.3 4.7c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
};
const faAngry = faFaceAngry;
const faCookieBite = {
  prefix: 'fas',
  iconName: 'cookie-bite',
  icon: [512, 512, [], "f564", "M257.5 27.6c-.8-5.4-4.9-9.8-10.3-10.6c-22.1-3.1-44.6 .9-64.4 11.4l-74 39.5C89.1 78.4 73.2 94.9 63.4 115L26.7 190.6c-9.8 20.1-13 42.9-9.1 64.9l14.5 82.8c3.9 22.1 14.6 42.3 30.7 57.9l60.3 58.4c16.1 15.6 36.6 25.6 58.7 28.7l83 11.7c22.1 3.1 44.6-.9 64.4-11.4l74-39.5c19.7-10.5 35.6-27 45.4-47.2l36.7-75.5c9.8-20.1 13-42.9 9.1-64.9c-.9-5.3-5.3-9.3-10.6-10.1c-51.5-8.2-92.8-47.1-104.5-97.4c-1.8-7.6-8-13.4-15.7-14.6c-54.6-8.7-97.7-52-106.2-106.8zM208 144a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM144 336a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm224-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faArrowTrendDown = {
  prefix: 'fas',
  iconName: 'arrow-trend-down',
  icon: [576, 512, [], "e097", "M384 352c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-160c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 82.7L342.6 137.4c-12.5-12.5-32.8-12.5-45.3 0L192 242.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0L320 205.3 466.7 352 384 352z"]
};
const faRss = {
  prefix: 'fas',
  iconName: 'rss',
  icon: [448, 512, ["feed"], "f09e", "M0 64C0 46.3 14.3 32 32 32c229.8 0 416 186.2 416 416c0 17.7-14.3 32-32 32s-32-14.3-32-32C384 253.6 226.4 96 32 96C14.3 96 0 81.7 0 64zM0 416a64 64 0 1 1 128 0A64 64 0 1 1 0 416zM32 160c159.1 0 288 128.9 288 288c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-123.7-100.3-224-224-224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faFeed = faRss;
const faDrawPolygon = {
  prefix: 'fas',
  iconName: 'draw-polygon',
  icon: [448, 512, [], "f5ee", "M96 151.4l0 209.1c9.7 5.6 17.8 13.7 23.4 23.4l209.1 0c0-.1 .1-.2 .1-.3l-4.5-7.9-32-56s0 0 0 0c-1.4 .1-2.8 .1-4.2 .1c-35.3 0-64-28.7-64-64s28.7-64 64-64c1.4 0 2.8 0 4.2 .1c0 0 0 0 0 0l32-56 4.5-7.9-.1-.3-209.1 0c-5.6 9.7-13.7 17.8-23.4 23.4zM384.3 352c35.2 .2 63.7 28.7 63.7 64c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32l-209.1 0c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4l0-209.1C12.9 140.4 0 119.7 0 96C0 60.7 28.7 32 64 32c23.7 0 44.4 12.9 55.4 32l209.1 0c11.1-19.1 31.7-32 55.4-32c35.3 0 64 28.7 64 64c0 35.3-28.5 63.8-63.7 64l-4.5 7.9-32 56-2.3 4c4.2 8.5 6.5 18 6.5 28.1s-2.3 19.6-6.5 28.1l2.3 4 32 56 4.5 7.9z"]
};
const faScaleBalanced = {
  prefix: 'fas',
  iconName: 'scale-balanced',
  icon: [640, 512, [9878, "balance-scale"], "f24e", "M384 32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L398.4 96c-5.2 25.8-22.9 47.1-46.4 57.3L352 448l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0 0-294.7c-23.5-10.3-41.2-31.6-46.4-57.3L128 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l128 0c14.6-19.4 37.8-32 64-32s49.4 12.6 64 32zm55.6 288l144.9 0L512 195.8 439.6 320zM512 416c-62.9 0-115.2-34-126-78.9c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1C627.2 382 574.9 416 512 416zM126.8 195.8L54.4 320l144.9 0L126.8 195.8zM.9 337.1c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1C242 382 189.7 416 126.8 416S11.7 382 .9 337.1z"]
};
const faBalanceScale = faScaleBalanced;
const faGaugeSimpleHigh = {
  prefix: 'fas',
  iconName: 'gauge-simple-high',
  icon: [512, 512, [61668, "tachometer", "tachometer-fast"], "f62a", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-15.9-5.8-30.4-15.3-41.6l76.6-147.4c6.1-11.8 1.5-26.3-10.2-32.4s-26.2-1.5-32.4 10.2L262.1 288.3c-2-.2-4-.3-6.1-.3c-35.3 0-64 28.7-64 64s28.7 64 64 64s64-28.7 64-64z"]
};
const faTachometer = faGaugeSimpleHigh;
const faTachometerFast = faGaugeSimpleHigh;
const faShower = {
  prefix: 'fas',
  iconName: 'shower',
  icon: [512, 512, [128703], "f2cc", "M64 131.9C64 112.1 80.1 96 99.9 96c9.5 0 18.6 3.8 25.4 10.5l16.2 16.2c-21 38.9-17.4 87.5 10.9 123L151 247c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L345 121c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-1.3 1.3c-35.5-28.3-84.2-31.9-123-10.9L170.5 61.3C151.8 42.5 126.4 32 99.9 32C44.7 32 0 76.7 0 131.9L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-316.1zM256 352a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm32-32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faDesktop = {
  prefix: 'fas',
  iconName: 'desktop',
  icon: [576, 512, [128421, 61704, "desktop-alt"], "f390", "M64 0C28.7 0 0 28.7 0 64L0 352c0 35.3 28.7 64 64 64l176 0-10.7 32L160 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-69.3 0L336 416l176 0c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64L64 0zM512 64l0 224L64 288 64 64l448 0z"]
};
const faDesktopAlt = faDesktop;
const faM = {
  prefix: 'fas',
  iconName: 'm',
  icon: [448, 512, [109], "4d", "M22.7 33.4c13.5-4.1 28.1 1.1 35.9 12.9L224 294.3 389.4 46.3c7.8-11.7 22.4-17 35.9-12.9S448 49.9 448 64l0 384c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-278.3L250.6 369.8c-5.9 8.9-15.9 14.2-26.6 14.2s-20.7-5.3-26.6-14.2L64 169.7 64 448c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 64C0 49.9 9.2 37.5 22.7 33.4z"]
};
const faTableList = {
  prefix: 'fas',
  iconName: 'table-list',
  icon: [512, 512, ["th-list"], "f00b", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 0l0 64 64 0 0-64L64 96zm384 0L192 96l0 64 256 0 0-64zM64 224l0 64 64 0 0-64-64 0zm384 0l-256 0 0 64 256 0 0-64zM64 352l0 64 64 0 0-64-64 0zm384 0l-256 0 0 64 256 0 0-64z"]
};
const faThList = faTableList;
const faCommentSms = {
  prefix: 'fas',
  iconName: 'comment-sms',
  icon: [512, 512, ["sms"], "f7cd", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM96 212.8c0-20.3 16.5-36.8 36.8-36.8l19.2 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-19.2 0c-2.7 0-4.8 2.2-4.8 4.8c0 1.6 .8 3.1 2.2 4l29.4 19.6c10.3 6.8 16.4 18.3 16.4 30.7c0 20.3-16.5 36.8-36.8 36.8L112 304c-8.8 0-16-7.2-16-16s7.2-16 16-16l27.2 0c2.7 0 4.8-2.2 4.8-4.8c0-1.6-.8-3.1-2.2-4l-29.4-19.6C102.2 236.7 96 225.2 96 212.8zM372.8 176l19.2 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-19.2 0c-2.7 0-4.8 2.2-4.8 4.8c0 1.6 .8 3.1 2.2 4l29.4 19.6c10.2 6.8 16.4 18.3 16.4 30.7c0 20.3-16.5 36.8-36.8 36.8L352 304c-8.8 0-16-7.2-16-16s7.2-16 16-16l27.2 0c2.7 0 4.8-2.2 4.8-4.8c0-1.6-.8-3.1-2.2-4l-29.4-19.6c-10.2-6.8-16.4-18.3-16.4-30.7c0-20.3 16.5-36.8 36.8-36.8zm-152 6.4L256 229.3l35.2-46.9c4.1-5.5 11.3-7.8 17.9-5.6s10.9 8.3 10.9 15.2l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48-19.2 25.6c-3 4-7.8 6.4-12.8 6.4s-9.8-2.4-12.8-6.4L224 240l0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-6.9 4.4-13 10.9-15.2s13.7 .1 17.9 5.6z"]
};
const faSms = faCommentSms;
const faBook = {
  prefix: 'fas',
  iconName: 'book',
  icon: [448, 512, [128212], "f02d", "M96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96l288 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64c17.7 0 32-14.3 32-32l0-320c0-17.7-14.3-32-32-32L384 0 96 0zm0 384l256 0 0 64L96 448c-17.7 0-32-14.3-32-32s14.3-32 32-32zm32-240c0-8.8 7.2-16 16-16l192 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16zm16 48l192 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faUserPlus = {
  prefix: 'fas',
  iconName: 'user-plus',
  icon: [640, 512, [], "f234", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM504 312l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
};
const faCheck = {
  prefix: 'fas',
  iconName: 'check',
  icon: [448, 512, [10003, 10004], "f00c", "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"]
};
const faBatteryThreeQuarters = {
  prefix: 'fas',
  iconName: 'battery-three-quarters',
  icon: [576, 512, ["battery-4"], "f241", "M464 160c8.8 0 16 7.2 16 16l0 160c0 8.8-7.2 16-16 16L80 352c-8.8 0-16-7.2-16-16l0-160c0-8.8 7.2-16 16-16l384 0zM80 96C35.8 96 0 131.8 0 176L0 336c0 44.2 35.8 80 80 80l384 0c44.2 0 80-35.8 80-80l0-16c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-16c0-44.2-35.8-80-80-80L80 96zm272 96L96 192l0 128 256 0 0-128z"]
};
const faBattery4 = faBatteryThreeQuarters;
const faHouseCircleCheck = {
  prefix: 'fas',
  iconName: 'house-circle-check',
  icon: [640, 512, [], "e509", "M320.7 352c8.1-89.7 83.5-160 175.3-160c8.9 0 17.6 .7 26.1 1.9L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 69.7c-.1 .9-.1 1.8-.1 2.8l0 112c0 22.1 17.9 40 40 40l16 0c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2l31.9 0 24 0c22.1 0 40-17.9 40-40l0-24 0-64c0-17.7 14.3-32 32-32l64 0 .7 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faAngleLeft = {
  prefix: 'fas',
  iconName: 'angle-left',
  icon: [320, 512, [8249], "f104", "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]
};
const faDiagramSuccessor = {
  prefix: 'fas',
  iconName: 'diagram-successor',
  icon: [512, 512, [], "e47a", "M512 416l0-64c0-35.3-28.7-64-64-64L64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64zM64 160l0-64 144 0 16 0 0 64L64 160zm224 0l0-64 80 0c8.8 0 16 7.2 16 16l0 16-38.1 0c-21.4 0-32.1 25.9-17 41L399 239c9.4 9.4 24.6 9.4 33.9 0L503 169c15.1-15.1 4.4-41-17-41L448 128l0-16c0-44.2-35.8-80-80-80L224 32l-16 0L64 32C28.7 32 0 60.7 0 96l0 64c0 35.3 28.7 64 64 64l160 0c35.3 0 64-28.7 64-64z"]
};
const faTruckArrowRight = {
  prefix: 'fas',
  iconName: 'truck-arrow-right',
  icon: [640, 512, [], "e58b", "M0 48C0 21.5 21.5 0 48 0L368 0c26.5 0 48 21.5 48 48l0 48 50.7 0c17 0 33.3 6.7 45.3 18.7L589.3 192c12 12 18.7 28.3 18.7 45.3l0 18.7 0 32 0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-26.5 0-48-21.5-48-48L0 48zM416 256l128 0 0-18.7L466.7 160 416 160l0 96zM160 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM257 95c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39L96 168c-13.3 0-24 10.7-24 24s10.7 24 24 24l166.1 0-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9L257 95z"]
};
const faArrowsSplitUpAndLeft = {
  prefix: 'fas',
  iconName: 'arrows-split-up-and-left',
  icon: [512, 512, [], "e4bc", "M246.6 150.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L352 109.3 352 384c0 35.3 28.7 64 64 64l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-70.7 0-128-57.3-128-128c0-35.3-28.7-64-64-64l-114.7 0 41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L109.3 256 224 256c23.3 0 45.2 6.2 64 17.1l0-163.9-41.4 41.4z"]
};
const faHandFist = {
  prefix: 'fas',
  iconName: 'hand-fist',
  icon: [448, 512, [9994, "fist-raised"], "f6de", "M192 0c17.7 0 32 14.3 32 32l0 112-64 0 0-112c0-17.7 14.3-32 32-32zM64 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 80-64 0 0-80zm192 0c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96zm96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm-96 88l0-.6c9.4 5.4 20.3 8.6 32 8.6c13.2 0 25.4-4 35.6-10.8c8.7 24.9 32.5 42.8 60.4 42.8c11.7 0 22.6-3.1 32-8.6l0 8.6c0 52.3-25.1 98.8-64 128l0 96c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-78.4c-17.3-7.9-33.2-18.8-46.9-32.5L69.5 357.5C45.5 333.5 32 300.9 32 267l0-27c0-35.3 28.7-64 64-64l88 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-56 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l56 0c39.8 0 72-32.2 72-72z"]
};
const faFistRaised = faHandFist;
const faCloudMoon = {
  prefix: 'fas',
  iconName: 'cloud-moon',
  icon: [640, 512, [], "f6c3", "M495.8 0c5.5 0 10.9 .2 16.3 .7c7 .6 12.8 5.7 14.3 12.5s-1.6 13.9-7.7 17.3c-44.4 25.2-74.4 73-74.4 127.8c0 81 65.5 146.6 146.2 146.6c8.6 0 17-.7 25.1-2.1c6.9-1.2 13.8 2.2 17 8.5s1.9 13.8-3.1 18.7c-34.5 33.6-81.7 54.4-133.6 54.4c-9.3 0-18.4-.7-27.4-1.9c-11.2-22.6-29.8-40.9-52.6-51.7c-2.7-58.5-50.3-105.3-109.2-106.7c-1.7-10.4-2.6-21-2.6-31.8C304 86.1 389.8 0 495.8 0zM447.9 431.9c0 44.2-35.8 80-80 80L96 511.9c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]
};
const faBriefcase = {
  prefix: 'fas',
  iconName: 'briefcase',
  icon: [512, 512, [128188], "f0b1", "M184 48l144 0c4.4 0 8 3.6 8 8l0 40L176 96l0-40c0-4.4 3.6-8 8-8zm-56 8l0 40L64 96C28.7 96 0 124.7 0 160l0 96 192 0 128 0 192 0 0-96c0-35.3-28.7-64-64-64l-64 0 0-40c0-30.9-25.1-56-56-56L184 0c-30.9 0-56 25.1-56 56zM512 288l-192 0 0 32c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-32L0 288 0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-128z"]
};
const faPersonFalling = {
  prefix: 'fas',
  iconName: 'person-falling',
  icon: [512, 512, [], "e546", "M288 0c17.7 0 32 14.3 32 32l0 9.8c0 54.6-27.9 104.6-72.5 133.6l.2 .3L304.5 256l87.5 0c15.1 0 29.3 7.1 38.4 19.2l43.2 57.6c10.6 14.1 7.7 34.2-6.4 44.8s-34.2 7.7-44.8-6.4L384 320l-96 0-1.4 0 92.3 142.6c9.6 14.8 5.4 34.6-9.5 44.3s-34.6 5.4-44.3-9.5L164.5 249.2c-2.9 9.2-4.5 19-4.5 29l0 73.8c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-73.8c0-65.1 39.6-123.7 100.1-147.9C232.3 115.8 256 80.8 256 41.8l0-9.8c0-17.7 14.3-32 32-32zM112 32a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faImagePortrait = {
  prefix: 'fas',
  iconName: 'image-portrait',
  icon: [384, 512, ["portrait"], "f3e0", "M384 64c0-35.3-28.7-64-64-64L64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384zM128 192a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM80 356.6c0-37.9 30.7-68.6 68.6-68.6l86.9 0c37.9 0 68.6 30.7 68.6 68.6c0 15.1-12.3 27.4-27.4 27.4l-169.1 0C92.3 384 80 371.7 80 356.6z"]
};
const faPortrait = faImagePortrait;
const faUserTag = {
  prefix: 'fas',
  iconName: 'user-tag',
  icon: [640, 512, [], "f507", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c10 0 18.8-4.9 24.2-12.5l-99.2-99.2c-14.9-14.9-23.3-35.1-23.3-56.1l0-33c-15.9-4.7-32.8-7.2-50.3-7.2l-91.4 0zM384 224c-17.7 0-32 14.3-32 32l0 82.7c0 17 6.7 33.3 18.7 45.3L478.1 491.3c18.7 18.7 49.1 18.7 67.9 0l73.4-73.4c18.7-18.7 18.7-49.1 0-67.9L512 242.7c-12-12-28.3-18.7-45.3-18.7L384 224zm24 80a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faRug = {
  prefix: 'fas',
  iconName: 'rug',
  icon: [640, 512, [], "e569", "M24 64l32 0 24 0 0 24 0 88 0 80 0 80 0 88 0 24-24 0-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-40-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-32-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-32-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-40-8 0C10.7 112 0 101.3 0 88S10.7 64 24 64zm88 0l416 0 0 384-416 0 0-384zM640 88c0 13.3-10.7 24-24 24l-8 0 0 40 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 32 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 32 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 40 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0-24 0 0-24 0-88 0-80 0-80 0-88 0-24 24 0 32 0c13.3 0 24 10.7 24 24z"]
};
const faEarthEurope = {
  prefix: 'fas',
  iconName: 'earth-europe',
  icon: [512, 512, ["globe-europe"], "f7a2", "M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1l0 9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1l1 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24l0 4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6l29.4 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-20.7 0c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3l11.3 0c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16l7.3 0c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4l-20.9 0c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3l0 3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3l21.3 0c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faGlobeEurope = faEarthEurope;
const faCartFlatbedSuitcase = {
  prefix: 'fas',
  iconName: 'cart-flatbed-suitcase',
  icon: [640, 512, ["luggage-cart"], "f59d", "M0 32C0 14.3 14.3 0 32 0L48 0c44.2 0 80 35.8 80 80l0 288c0 8.8 7.2 16 16 16l464 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-66.7 0c1.8 5 2.7 10.4 2.7 16c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-5.6 1-11 2.7-16l-197.5 0c1.8 5 2.7 10.4 2.7 16c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-5.6 1-11 2.7-16L144 448c-44.2 0-80-35.8-80-80L64 80c0-8.8-7.2-16-16-16L32 64C14.3 64 0 49.7 0 32zM432 96l0-40c0-4.4-3.6-8-8-8l-80 0c-4.4 0-8 3.6-8 8l0 40 96 0zM288 96l0-40c0-30.9 25.1-56 56-56l80 0c30.9 0 56 25.1 56 56l0 40 0 224-192 0 0-224zM512 320l0-224 16 0c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48l-16 0zM240 96l16 0 0 224-16 0c-26.5 0-48-21.5-48-48l0-128c0-26.5 21.5-48 48-48z"]
};
const faLuggageCart = faCartFlatbedSuitcase;
const faRectangleXmark = {
  prefix: 'fas',
  iconName: 'rectangle-xmark',
  icon: [512, 512, [62164, "rectangle-times", "times-rectangle", "window-close"], "f410", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faRectangleTimes = faRectangleXmark;
const faTimesRectangle = faRectangleXmark;
const faWindowClose = faRectangleXmark;
const faBahtSign = {
  prefix: 'fas',
  iconName: 'baht-sign',
  icon: [320, 512, [], "e0ac", "M144 0c-17.7 0-32 14.3-32 32l0 32L37.6 64C16.8 64 0 80.8 0 101.6L0 224l0 41.7L0 288 0 406.3c0 23 18.7 41.7 41.7 41.7l70.3 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c61.9 0 112-50.1 112-112c0-40.1-21.1-75.3-52.7-95.1C280.3 222.6 288 200.2 288 176c0-61.9-50.1-112-112-112l0-32c0-17.7-14.3-32-32-32zM112 128l0 96-48 0 0-96 48 0zm64 96l0-96c26.5 0 48 21.5 48 48s-21.5 48-48 48zm-64 64l0 96-48 0 0-96 48 0zm64 96l0-96 32 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-32 0z"]
};
const faBookOpen = {
  prefix: 'fas',
  iconName: 'book-open',
  icon: [576, 512, [128214, 128366], "f518", "M249.6 471.5c10.8 3.8 22.4-4.1 22.4-15.5l0-377.4c0-4.2-1.6-8.4-5-11C247.4 52 202.4 32 144 32C93.5 32 46.3 45.3 18.1 56.1C6.8 60.5 0 71.7 0 83.8L0 454.1c0 11.9 12.8 20.2 24.1 16.5C55.6 460.1 105.5 448 144 448c33.9 0 79 14 105.6 23.5zm76.8 0C353 462 398.1 448 432 448c38.5 0 88.4 12.1 119.9 22.6c11.3 3.8 24.1-4.6 24.1-16.5l0-370.3c0-12.1-6.8-23.3-18.1-27.6C529.7 45.3 482.5 32 432 32c-58.4 0-103.4 20-123 35.6c-3.3 2.6-5 6.8-5 11L304 456c0 11.4 11.7 19.3 22.4 15.5z"]
};
const faBookJournalWhills = {
  prefix: 'fas',
  iconName: 'book-journal-whills',
  icon: [448, 512, ["journal-whills"], "f66a", "M0 96C0 43 43 0 96 0L384 0l32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32zm90.4-234.4l-21.2-21.2c-3 10.1-5.1 20.6-5.1 31.6c0 .2 0 .5 .1 .8s.1 .5 .1 .8L165.2 226c2.5 2.1 3.4 5.8 2.3 8.9c-1.3 3-4.1 5.1-7.5 5.1c-1.9-.1-3.8-.8-5.2-2l-23.6-20.6C142.8 267 186.9 304 240 304s97.3-37 108.9-86.6L325.3 238c-1.4 1.2-3.3 2-5.3 2c-2.2-.1-4.4-1.1-6-2.8c-1.2-1.5-1.9-3.4-2-5.2c.1-2.2 1.1-4.4 2.8-6l37.1-32.5c0-.3 0-.5 .1-.8s.1-.5 .1-.8c0-11-2.1-21.5-5.1-31.6l-21.2 21.2c-3.1 3.1-8.1 3.1-11.3 0s-3.1-8.1 0-11.2l26.4-26.5c-8.2-17-20.5-31.7-35.9-42.6c-2.7-1.9-6.2 1.4-5 4.5c8.5 22.4 3.6 48-13 65.6c-3.2 3.4-3.6 8.9-.9 12.7c9.8 14 12.7 31.9 7.5 48.5c-5.9 19.4-22 34.1-41.9 38.3l-1.4-34.3 12.6 8.6c.6 .4 1.5 .6 2.3 .6c1.5 0 2.7-.8 3.5-2s.6-2.8-.1-4L260 225.4l18-3.6c1.8-.4 3.1-2.1 3.1-4s-1.4-3.5-3.1-3.9l-18-3.7 8.5-14.3c.8-1.2 .9-2.9 .1-4.1s-2-2-3.5-2l-.1 0c-.7 .1-1.5 .3-2.1 .7l-14.1 9.6L244 87.9c-.1-2.2-1.9-3.9-4-3.9s-3.9 1.6-4 3.9l-4.6 110.8-12-8.1c-1.5-1.1-3.6-.9-5 .4s-1.6 3.4-.8 5l8.6 14.3-18 3.7c-1.8 .4-3.1 2-3.1 3.9s1.4 3.6 3.1 4l18 3.8-8.6 14.2c-.2 .6-.5 1.4-.5 2c0 1.1 .5 2.1 1.2 3c.8 .6 1.8 1 2.8 1c.7 0 1.6-.2 2.2-.6l10.4-7.1-1.4 32.8c-19.9-4.1-36-18.9-41.9-38.3c-5.1-16.6-2.2-34.4 7.6-48.5c2.7-3.9 2.3-9.3-.9-12.7c-16.6-17.5-21.6-43.1-13.1-65.5c1.2-3.1-2.3-6.4-5-4.5c-15.3 10.9-27.6 25.6-35.8 42.6l26.4 26.5c3.1 3.1 3.1 8.1 0 11.2s-8.1 3.1-11.2 0z"]
};
const faJournalWhills = faBookJournalWhills;
const faHandcuffs = {
  prefix: 'fas',
  iconName: 'handcuffs',
  icon: [640, 512, [], "e4f8", "M240 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM192 48a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm-32 80c17.7 0 32 14.3 32 32l8 0c13.3 0 24 10.7 24 24l0 16c0 1.7-.2 3.4-.5 5.1C280.3 229.6 320 286.2 320 352c0 88.4-71.6 160-160 160S0 440.4 0 352c0-65.8 39.7-122.4 96.5-146.9c-.4-1.6-.5-3.3-.5-5.1l0-16c0-13.3 10.7-24 24-24l8 0c0-17.7 14.3-32 32-32zm0 320a96 96 0 1 0 0-192 96 96 0 1 0 0 192zm192-96c0-25.9-5.1-50.5-14.4-73.1c16.9-32.9 44.8-59.1 78.9-73.9c-.4-1.6-.5-3.3-.5-5.1l0-16c0-13.3 10.7-24 24-24l8 0c0-17.7 14.3-32 32-32s32 14.3 32 32l8 0c13.3 0 24 10.7 24 24l0 16c0 1.7-.2 3.4-.5 5.1C600.3 229.6 640 286.2 640 352c0 88.4-71.6 160-160 160c-62 0-115.8-35.3-142.4-86.9c9.3-22.5 14.4-47.2 14.4-73.1zm224 0a96 96 0 1 0 -192 0 96 96 0 1 0 192 0zM368 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm80 48a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faTriangleExclamation = {
  prefix: 'fas',
  iconName: 'triangle-exclamation',
  icon: [512, 512, [9888, "exclamation-triangle", "warning"], "f071", "M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faExclamationTriangle = faTriangleExclamation;
const faWarning = faTriangleExclamation;
const faDatabase = {
  prefix: 'fas',
  iconName: 'database',
  icon: [448, 512, [], "f1c0", "M448 80l0 48c0 44.2-100.3 80-224 80S0 172.2 0 128L0 80C0 35.8 100.3 0 224 0S448 35.8 448 80zM393.2 214.7c20.8-7.4 39.9-16.9 54.8-28.6L448 288c0 44.2-100.3 80-224 80S0 332.2 0 288L0 186.1c14.9 11.8 34 21.2 54.8 28.6C99.7 230.7 159.5 240 224 240s124.3-9.3 169.2-25.3zM0 346.1c14.9 11.8 34 21.2 54.8 28.6C99.7 390.7 159.5 400 224 400s124.3-9.3 169.2-25.3c20.8-7.4 39.9-16.9 54.8-28.6l0 85.9c0 44.2-100.3 80-224 80S0 476.2 0 432l0-85.9z"]
};
const faShare = {
  prefix: 'fas',
  iconName: 'share',
  icon: [512, 512, ["mail-forward"], "f064", "M307 34.8c-11.5 5.1-19 16.6-19 29.2l0 64-112 0C78.8 128 0 206.8 0 304C0 417.3 81.5 467.9 100.2 478.1c2.5 1.4 5.3 1.9 8.1 1.9c10.9 0 19.7-8.9 19.7-19.7c0-7.5-4.3-14.4-9.8-19.5C108.8 431.9 96 414.4 96 384c0-53 43-96 96-96l96 0 0 64c0 12.6 7.4 24.1 19 29.2s25 3 34.4-5.4l160-144c6.7-6.1 10.6-14.7 10.6-23.8s-3.8-17.7-10.6-23.8l-160-144c-9.4-8.5-22.9-10.6-34.4-5.4z"]
};
const faMailForward = faShare;
const faBottleDroplet = {
  prefix: 'fas',
  iconName: 'bottle-droplet',
  icon: [320, 512, [], "e4c4", "M96 0C82.7 0 72 10.7 72 24s10.7 24 24 24c4.4 0 8 3.6 8 8l0 64.9c0 12.2-7.2 23.1-17.2 30.1C53.7 174.1 32 212.5 32 256l0 192c0 35.3 28.7 64 64 64l128 0c35.3 0 64-28.7 64-64l0-192c0-43.5-21.7-81.9-54.8-105c-10-7-17.2-17.9-17.2-30.1L216 56c0-4.4 3.6-8 8-8c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0s0 0 0 0s0 0 0 0L104 0s0 0 0 0s0 0 0 0L96 0zm64 382c-26.5 0-48-20.1-48-45c0-16.8 22.1-48.1 36.3-66.4c6-7.8 17.5-7.8 23.5 0C185.9 288.9 208 320.2 208 337c0 24.9-21.5 45-48 45z"]
};
const faMaskFace = {
  prefix: 'fas',
  iconName: 'mask-face',
  icon: [640, 512, [], "e1d7", "M320 64c-27.2 0-53.8 8-76.4 23.1l-37.1 24.8c-15.8 10.5-34.3 16.1-53.3 16.1l-9.2 0-16 0-72 0c-30.9 0-56 25.1-56 56l0 85c0 55.1 37.5 103.1 90.9 116.4l108 27C233.8 435 275.4 448 320 448s86.2-13 121.1-35.5l108-27C602.5 372.1 640 324.1 640 269l0-85c0-30.9-25.1-56-56-56l-72 0-16 0-9.2 0c-19 0-37.5-5.6-53.3-16.1L396.4 87.1C373.8 72 347.2 64 320 64zM132.3 346.3l-29.8-7.4C70.5 330.9 48 302.1 48 269l0-85c0-4.4 3.6-8 8-8l40 0 0 48c0 45.1 13.4 87.2 36.3 122.3zm405.1-7.4l-29.8 7.4c23-35.2 36.3-77.2 36.3-122.3l0-48 40 0c4.4 0 8 3.6 8 8l0 85c0 33-22.5 61.8-54.5 69.9zM192 208c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16zm16 48l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm16 80c0-8.8 7.2-16 16-16l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16z"]
};
const faHillRockslide = {
  prefix: 'fas',
  iconName: 'hill-rockslide',
  icon: [576, 512, [], "e508", "M252.4 103.8l27 48c2.8 5 8.2 8.2 13.9 8.2l53.3 0c5.8 0 11.1-3.1 13.9-8.2l27-48c2.7-4.9 2.7-10.8 0-15.7l-27-48c-2.8-5-8.2-8.2-13.9-8.2l-53.3 0c-5.8 0-11.1 3.1-13.9 8.2l-27 48c-2.7 4.9-2.7 10.8 0 15.7zM68.3 87C43.1 61.8 0 79.7 0 115.3L0 432c0 44.2 35.8 80 80 80l316.7 0c35.6 0 53.5-43.1 28.3-68.3L68.3 87zM504.2 403.6c4.9 2.7 10.8 2.7 15.7 0l48-27c5-2.8 8.2-8.2 8.2-13.9l0-53.3c0-5.8-3.1-11.1-8.2-13.9l-48-27c-4.9-2.7-10.8-2.7-15.7 0l-48 27c-5 2.8-8.2 8.2-8.2 13.9l0 53.3c0 5.8 3.1 11.1 8.2 13.9l48 27zM192 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM384 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faRightLeft = {
  prefix: 'fas',
  iconName: 'right-left',
  icon: [512, 512, ["exchange-alt"], "f362", "M32 96l320 0 0-64c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l96 96c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-96 96c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-64L32 160c-17.7 0-32-14.3-32-32s14.3-32 32-32zM480 352c17.7 0 32 14.3 32 32s-14.3 32-32 32l-320 0 0 64c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-96-96c-6-6-9.4-14.1-9.4-22.6s3.4-16.6 9.4-22.6l96-96c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 64 320 0z"]
};
const faExchangeAlt = faRightLeft;
const faPaperPlane = {
  prefix: 'fas',
  iconName: 'paper-plane',
  icon: [512, 512, [61913], "f1d8", "M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480l0-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"]
};
const faRoadCircleExclamation = {
  prefix: 'fas',
  iconName: 'road-circle-exclamation',
  icon: [640, 512, [], "e565", "M213.2 32L288 32l0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 74.8 0c27.1 0 51.3 17.1 60.3 42.6l42.7 120.6c-10.9-2.1-22.2-3.2-33.8-3.2c-59.5 0-112.1 29.6-144 74.8l0-42.8c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32c2.3 0 4.6-.3 6.8-.7c-4.5 15.5-6.8 31.8-6.8 48.7c0 5.4 .2 10.7 .7 16l-.7 0c-17.7 0-32 14.3-32 32l0 64L86.6 480C56.5 480 32 455.5 32 425.4c0-6.2 1.1-12.4 3.1-18.2L152.9 74.6C162 49.1 186.1 32 213.2 32zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z"]
};
const faDungeon = {
  prefix: 'fas',
  iconName: 'dungeon',
  icon: [512, 512, [], "f6d9", "M336.6 156.5c1.3 1.1 2.7 2.2 3.9 3.3c9.3 8.2 23 10.5 33.4 3.6l67.6-45.1c11.4-7.6 14.2-23.2 5.1-33.4C430 66.6 410.9 50.6 389.7 37.6c-11.9-7.3-26.9-1.4-32.1 11.6l-30.5 76.2c-4.5 11.1 .2 23.6 9.5 31.2zM328 36.8c5.1-12.8-1.6-27.4-15-30.5C294.7 2.2 275.6 0 256 0s-38.7 2.2-57 6.4C185.5 9.4 178.8 24 184 36.8l30.3 75.8c4.5 11.3 16.8 17.2 29 16c4.2-.4 8.4-.6 12.7-.6s8.6 .2 12.7 .6c12.1 1.2 24.4-4.7 29-16L328 36.8zM65.5 85c-9.1 10.2-6.3 25.8 5.1 33.4l67.6 45.1c10.3 6.9 24.1 4.6 33.4-3.6c1.3-1.1 2.6-2.3 4-3.3c9.3-7.5 13.9-20.1 9.5-31.2L154.4 49.2c-5.2-12.9-20.3-18.8-32.1-11.6C101.1 50.6 82 66.6 65.5 85zm314 137.1c.9 3.3 1.7 6.6 2.3 10c2.5 13 13 23.9 26.2 23.9l80 0c13.3 0 24.1-10.8 22.9-24c-2.5-27.2-9.3-53.2-19.7-77.3c-5.5-12.9-21.4-16.6-33.1-8.9l-68.6 45.7c-9.8 6.5-13.2 19.2-10 30.5zM53.9 145.8c-11.6-7.8-27.6-4-33.1 8.9C10.4 178.8 3.6 204.8 1.1 232c-1.2 13.2 9.6 24 22.9 24l80 0c13.3 0 23.8-10.8 26.2-23.9c.6-3.4 1.4-6.7 2.3-10c3.1-11.4-.2-24-10-30.5L53.9 145.8zM104 288l-80 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24zm304 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-80 0zM24 416c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-80 0zm384 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-80 0zM272 192c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 272c0 8.8 7.2 16 16 16s16-7.2 16-16l0-272zm-64 32c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 240c0 8.8 7.2 16 16 16s16-7.2 16-16l0-240zm128 0c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 240c0 8.8 7.2 16 16 16s16-7.2 16-16l0-240z"]
};
const faAlignRight = {
  prefix: 'fas',
  iconName: 'align-right',
  icon: [448, 512, [], "f038", "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
};
const faMoneyBill1Wave = {
  prefix: 'fas',
  iconName: 'money-bill-1-wave',
  icon: [576, 512, ["money-bill-wave-alt"], "f53b", "M0 112.5L0 422.3c0 18 10.1 35 27 41.3c87 32.5 174 10.3 261-11.9c79.8-20.3 159.6-40.7 239.3-18.9c23 6.3 48.7-9.5 48.7-33.4l0-309.9c0-18-10.1-35-27-41.3C462 15.9 375 38.1 288 60.3C208.2 80.6 128.4 100.9 48.7 79.1C25.6 72.8 0 88.6 0 112.5zM128 416l-64 0 0-64c35.3 0 64 28.7 64 64zM64 224l0-64 64 0c0 35.3-28.7 64-64 64zM448 352c0-35.3 28.7-64 64-64l0 64-64 0zm64-192c-35.3 0-64-28.7-64-64l64 0 0 64zM384 256c0 61.9-43 112-96 112s-96-50.1-96-112s43-112 96-112s96 50.1 96 112zM252 208c0 9.7 6.9 17.7 16 19.6l0 48.4-4 0c-11 0-20 9-20 20s9 20 20 20l24 0 24 0c11 0 20-9 20-20s-9-20-20-20l-4 0 0-68c0-11-9-20-20-20l-16 0c-11 0-20 9-20 20z"]
};
const faMoneyBillWaveAlt = faMoneyBill1Wave;
const faLifeRing = {
  prefix: 'fas',
  iconName: 'life-ring',
  icon: [512, 512, [], "f1cd", "M367.2 412.5C335.9 434.9 297.5 448 256 448s-79.9-13.1-111.2-35.5l58-58c15.8 8.6 34 13.5 53.3 13.5s37.4-4.9 53.3-13.5l58 58zm90.7 .8c33.8-43.4 54-98 54-157.3s-20.2-113.9-54-157.3c9-12.5 7.9-30.1-3.4-41.3S425.8 45 413.3 54C369.9 20.2 315.3 0 256 0S142.1 20.2 98.7 54c-12.5-9-30.1-7.9-41.3 3.4S45 86.2 54 98.7C20.2 142.1 0 196.7 0 256s20.2 113.9 54 157.3c-9 12.5-7.9 30.1 3.4 41.3S86.2 467 98.7 458c43.4 33.8 98 54 157.3 54s113.9-20.2 157.3-54c12.5 9 30.1 7.9 41.3-3.4s12.4-28.8 3.4-41.3zm-45.5-46.1l-58-58c8.6-15.8 13.5-34 13.5-53.3s-4.9-37.4-13.5-53.3l58-58C434.9 176.1 448 214.5 448 256s-13.1 79.9-35.5 111.2zM367.2 99.5l-58 58c-15.8-8.6-34-13.5-53.3-13.5s-37.4 4.9-53.3 13.5l-58-58C176.1 77.1 214.5 64 256 64s79.9 13.1 111.2 35.5zM157.5 309.3l-58 58C77.1 335.9 64 297.5 64 256s13.1-79.9 35.5-111.2l58 58c-8.6 15.8-13.5 34-13.5 53.3s4.9 37.4 13.5 53.3zM208 256a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
};
const faHands = {
  prefix: 'fas',
  iconName: 'hands',
  icon: [576, 512, ["sign-language", "signing"], "f2a7", "M544 160l-.1 72.6c-.1 52.2-24 101-64 133.1c.1-1.9 .1-3.8 .1-5.7l0-8c0-71.8-37-138.6-97.9-176.7l-60.2-37.6c-8.6-5.4-17.9-8.4-27.3-9.4L248.7 48.8c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8l78 135.1c3.3 5.7 10.7 7.7 16.4 4.4s7.7-10.7 4.4-16.4l-62-107.4c-6.6-11.5-2.7-26.2 8.8-32.8S362 5 368.6 16.5l68 117.8s0 0 0 0s0 0 0 0l43.3 75L480 160c0-17.7 14.4-32 32-32s32 14.4 32 32zM243.9 88.5L268.5 131c-13.9 4.5-26.4 13.7-34.7 27c-.9 1.4-1.7 2.9-2.5 4.4l-28.9-50c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8zm-46.4 63.7l26.8 46.4c.6 6 2.1 11.8 4.3 17.4l-4.7 0-13.3 0s0 0 0 0L179 216l-23-39.8c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8zM260.9 175c9.4-15 29.1-19.5 44.1-10.2l60.2 37.6C416.7 234.7 448 291.2 448 352l0 8c0 83.9-68.1 152-152 152l-176 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l92 0c6.6 0 12-5.4 12-12s-5.4-12-12-12L88 440c-13.3 0-24-10.7-24-24s10.7-24 24-24l124 0c6.6 0 12-5.4 12-12s-5.4-12-12-12L56 368c-13.3 0-24-10.7-24-24s10.7-24 24-24l156 0c6.6 0 12-5.4 12-12s-5.4-12-12-12L88 296c-13.3 0-24-10.7-24-24s10.7-24 24-24l136 0s0 0 0 0s0 0 0 0l93.2 0L271 219.1c-15-9.4-19.5-29.1-10.2-44.1z"]
};
const faSignLanguage = faHands;
const faSigning = faHands;
const faCalendarDay = {
  prefix: 'fas',
  iconName: 'calendar-day',
  icon: [448, 512, [], "f783", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm80 64c-8.8 0-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16l96 0c8.8 0 16-7.2 16-16l0-96c0-8.8-7.2-16-16-16l-96 0z"]
};
const faWaterLadder = {
  prefix: 'fas',
  iconName: 'water-ladder',
  icon: [576, 512, ["ladder-water", "swimming-pool"], "f5c5", "M128 127.7C128 74.9 170.9 32 223.7 32c48.3 0 89 36 95 83.9l1 8.2c2.2 17.5-10.2 33.5-27.8 35.7s-33.5-10.2-35.7-27.8l-1-8.2c-2-15.9-15.5-27.8-31.5-27.8c-17.5 0-31.7 14.2-31.7 31.7l0 96.3 192 0 0-96.3C384 74.9 426.9 32 479.7 32c48.3 0 89 36 95 83.9l1 8.2c2.2 17.5-10.2 33.5-27.8 35.7s-33.5-10.2-35.7-27.8l-1-8.2c-2-15.9-15.5-27.8-31.5-27.8c-17.5 0-31.7 14.2-31.7 31.7L448 361c-1.6 1-3.3 2-4.8 3.1c-18 12.4-40.1 20.3-59.2 20.3c0 0 0 0 0 0l0-96.5-192 0 0 96.5c-19 0-41.2-7.9-59.1-20.3c-1.6-1.1-3.2-2.2-4.9-3.1l0-233.3zM306.5 389.9C329 405.4 356.5 416 384 416c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 469.7 417 480 384 480c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 405.2 165.1 416 192 416c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faLadderWater = faWaterLadder;
const faSwimmingPool = faWaterLadder;
const faArrowsUpDown = {
  prefix: 'fas',
  iconName: 'arrows-up-down',
  icon: [320, 512, ["arrows-v"], "f07d", "M182.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L128 109.3l0 293.5L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7l0-293.5 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z"]
};
const faArrowsV = faArrowsUpDown;
const faFaceGrimace = {
  prefix: 'fas',
  iconName: 'face-grimace',
  icon: [512, 512, [128556, "grimace"], "f57f", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm96-112l-8 0 0-40 55.3 0c-3.8 22.7-23.6 40-47.3 40zm47.3-56L344 344l0-40 8 0c23.8 0 43.5 17.3 47.3 40zM328 344l-64 0 0-40 64 0 0 40zm0 56l-64 0 0-40 64 0 0 40zm-80-96l0 40-64 0 0-40 64 0zm0 56l0 40-64 0 0-40 64 0zm-80-16l-55.3 0c3.8-22.7 23.6-40 47.3-40l8 0 0 40zm0 56l-8 0c-23.8 0-43.5-17.3-47.3-40l55.3 0 0 40zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGrimace = faFaceGrimace;
const faWheelchairMove = {
  prefix: 'fas',
  iconName: 'wheelchair-move',
  icon: [448, 512, ["wheelchair-alt"], "e2ce", "M320 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM204.5 121.3c-5.4-2.5-11.7-1.9-16.4 1.7l-40.9 30.7c-14.1 10.6-34.2 7.7-44.8-6.4s-7.7-34.2 6.4-44.8l40.9-30.7c23.7-17.8 55.3-21 82.1-8.4l90.4 42.5c29.1 13.7 36.8 51.6 15.2 75.5L299.1 224l97.4 0c30.3 0 53 27.7 47.1 57.4L415.4 422.3c-3.5 17.3-20.3 28.6-37.7 25.1s-28.6-20.3-25.1-37.7L377 288l-70.3 0c8.6 19.6 13.3 41.2 13.3 64c0 88.4-71.6 160-160 160S0 440.4 0 352s71.6-160 160-160c11.1 0 22 1.1 32.4 3.3l54.2-54.2-42.1-19.8zM160 448a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"]
};
const faWheelchairAlt = faWheelchairMove;
const faTurnDown = {
  prefix: 'fas',
  iconName: 'turn-down',
  icon: [384, 512, [10549, "level-down-alt"], "f3be", "M350 334.5c3.8 8.8 2 19-4.6 26l-136 144c-4.5 4.8-10.8 7.5-17.4 7.5s-12.9-2.7-17.4-7.5l-136-144c-6.6-7-8.4-17.2-4.6-26s12.5-14.5 22-14.5l88 0 0-192c0-17.7-14.3-32-32-32L32 96C14.3 96 0 81.7 0 64L0 32C0 14.3 14.3 0 32 0l80 0c70.7 0 128 57.3 128 128l0 192 88 0c9.6 0 18.2 5.7 22 14.5z"]
};
const faLevelDownAlt = faTurnDown;
const faPersonWalkingArrowRight = {
  prefix: 'fas',
  iconName: 'person-walking-arrow-right',
  icon: [640, 512, [], "e552", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224 384 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l146.7 0-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80z"]
};
const faSquareEnvelope = {
  prefix: 'fas',
  iconName: 'square-envelope',
  icon: [448, 512, ["envelope-square"], "f199", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM218 271.7L64.2 172.4C66 156.4 79.5 144 96 144l256 0c16.5 0 30 12.4 31.8 28.4L230 271.7c-1.8 1.2-3.9 1.8-6 1.8s-4.2-.6-6-1.8zm29.4 26.9L384 210.4 384 336c0 17.7-14.3 32-32 32L96 368c-17.7 0-32-14.3-32-32l0-125.6 136.6 88.2c7 4.5 15.1 6.9 23.4 6.9s16.4-2.4 23.4-6.9z"]
};
const faEnvelopeSquare = faSquareEnvelope;
const faDice = {
  prefix: 'fas',
  iconName: 'dice',
  icon: [640, 512, [127922], "f522", "M274.9 34.3c-28.1-28.1-73.7-28.1-101.8 0L34.3 173.1c-28.1 28.1-28.1 73.7 0 101.8L173.1 413.7c28.1 28.1 73.7 28.1 101.8 0L413.7 274.9c28.1-28.1 28.1-73.7 0-101.8L274.9 34.3zM200 224a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM96 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM224 376a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM352 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM224 120a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm96 328c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-114.3 0c11.6 36 3.1 77-25.4 105.5L320 413.8l0 34.2zM480 328a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faBowlingBall = {
  prefix: 'fas',
  iconName: 'bowling-ball',
  icon: [512, 512, [], "f436", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM240 80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM208 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-64-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBrain = {
  prefix: 'fas',
  iconName: 'brain',
  icon: [512, 512, [129504], "f5dc", "M184 0c30.9 0 56 25.1 56 56l0 400c0 30.9-25.1 56-56 56c-28.9 0-52.7-21.9-55.7-50.1c-5.2 1.4-10.7 2.1-16.3 2.1c-35.3 0-64-28.7-64-64c0-7.4 1.3-14.6 3.6-21.2C21.4 367.4 0 338.2 0 304c0-31.9 18.7-59.5 45.8-72.3C37.1 220.8 32 207 32 192c0-30.7 21.6-56.3 50.4-62.6C80.8 123.9 80 118 80 112c0-29.9 20.6-55.1 48.3-62.1C131.3 21.9 155.1 0 184 0zM328 0c28.9 0 52.6 21.9 55.7 49.9c27.8 7 48.3 32.1 48.3 62.1c0 6-.8 11.9-2.4 17.4c28.8 6.2 50.4 31.9 50.4 62.6c0 15-5.1 28.8-13.8 39.7C493.3 244.5 512 272.1 512 304c0 34.2-21.4 63.4-51.6 74.8c2.3 6.6 3.6 13.8 3.6 21.2c0 35.3-28.7 64-64 64c-5.6 0-11.1-.7-16.3-2.1c-3 28.2-26.8 50.1-55.7 50.1c-30.9 0-56-25.1-56-56l0-400c0-30.9 25.1-56 56-56z"]
};
const faBandage = {
  prefix: 'fas',
  iconName: 'bandage',
  icon: [640, 512, [129657, "band-aid"], "f462", "M480 416l96 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-96 0 0 320zM448 96L192 96l0 320 256 0 0-320zM64 96C28.7 96 0 124.7 0 160L0 352c0 35.3 28.7 64 64 64l96 0 0-320L64 96zM248 208a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM248 304a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faBandAid = faBandage;
const faCalendarMinus = {
  prefix: 'fas',
  iconName: 'calendar-minus',
  icon: [448, 512, [], "f272", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM312 376c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0z"]
};
const faCircleXmark = {
  prefix: 'fas',
  iconName: 'circle-xmark',
  icon: [512, 512, [61532, "times-circle", "xmark-circle"], "f057", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faTimesCircle = faCircleXmark;
const faXmarkCircle = faCircleXmark;
const faGifts = {
  prefix: 'fas',
  iconName: 'gifts',
  icon: [640, 512, [], "f79c", "M200.6 32C205 19.5 198.5 5.8 186 1.4S159.8 3.5 155.4 16L144.7 46.2l-9.9-29.8C130.6 3.8 117-3 104.4 1.2S85 19 89.2 31.6l8.3 25-27.4-20c-10.7-7.8-25.7-5.4-33.5 5.3s-5.4 25.7 5.3 33.5L70.2 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l152.6 0c-5.4-9.4-8.6-20.3-8.6-32l0-224c0-29.9 20.5-55 48.2-62c1.8-31 17.1-58.2 40.1-76.1C271.7 104.7 256.9 96 240 96l-22.2 0 28.3-20.6c10.7-7.8 13.1-22.8 5.3-33.5s-22.8-13.1-33.5-5.3L192.5 55.1 200.6 32zM363.5 185.5L393.1 224 344 224c-13.3 0-24-10.7-24-24c0-13.1 10.8-24 24.2-24c7.6 0 14.7 3.5 19.3 9.5zM272 200c0 8.4 1.4 16.5 4.1 24l-4.1 0c-26.5 0-48 21.5-48 48l0 80 192 0 0-96 32 0 0 96 192 0 0-80c0-26.5-21.5-48-48-48l-4.1 0c2.7-7.5 4.1-15.6 4.1-24c0-39.9-32.5-72-72.2-72c-22.4 0-43.6 10.4-57.3 28.2L432 195.8l-30.5-39.6c-13.7-17.8-35-28.2-57.3-28.2c-39.7 0-72.2 32.1-72.2 72zM224 464c0 26.5 21.5 48 48 48l144 0 0-128-192 0 0 80zm224 48l144 0c26.5 0 48-21.5 48-48l0-80-192 0 0 128zm96-312c0 13.3-10.7 24-24 24l-49.1 0 29.6-38.5c4.6-5.9 11.7-9.5 19.3-9.5c13.4 0 24.2 10.9 24.2 24z"]
};
const faHotel = {
  prefix: 'fas',
  iconName: 'hotel',
  icon: [512, 512, [127976], "f594", "M0 32C0 14.3 14.3 0 32 0L480 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 384c17.7 0 32 14.3 32 32s-14.3 32-32 32l-176 0 0-48c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 48L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32L32 64C14.3 64 0 49.7 0 32zm96 80l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM240 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM112 192c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM328 384c13.3 0 24.3-10.9 21-23.8c-10.6-41.5-48.2-72.2-93-72.2s-82.5 30.7-93 72.2c-3.3 12.8 7.8 23.8 21 23.8l144 0z"]
};
const faEarthAsia = {
  prefix: 'fas',
  iconName: 'earth-asia',
  icon: [512, 512, [127759, "globe-asia"], "f57e", "M51.7 295.1l31.7 6.3c7.9 1.6 16-.9 21.7-6.6l15.4-15.4c11.6-11.6 31.1-8.4 38.4 6.2l9.3 18.5c4.8 9.6 14.6 15.7 25.4 15.7c15.2 0 26.1-14.6 21.7-29.2l-6-19.9c-4.6-15.4 6.9-30.9 23-30.9l2.3 0c13.4 0 25.9-6.7 33.3-17.8l10.7-16.1c5.6-8.5 5.3-19.6-.8-27.7l-16.1-21.5c-10.3-13.7-3.3-33.5 13.4-37.7l17-4.3c7.5-1.9 13.6-7.2 16.5-14.4l16.4-40.9C303.4 52.1 280.2 48 256 48C141.1 48 48 141.1 48 256c0 13.4 1.3 26.5 3.7 39.1zm407.7 4.6c-3-.3-6-.1-9 .8l-15.8 4.4c-6.7 1.9-13.8-.9-17.5-6.7l-2-3.1c-6-9.4-16.4-15.1-27.6-15.1s-21.6 5.7-27.6 15.1l-6.1 9.5c-1.4 2.2-3.4 4.1-5.7 5.3L312 330.1c-18.1 10.1-25.5 32.4-17 51.3l5.5 12.4c8.6 19.2 30.7 28.5 50.5 21.1l2.6-1c10-3.7 21.3-2.2 29.9 4.1l1.5 1.1c37.2-29.5 64.1-71.4 74.4-119.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm144.5 92.1c-2.1 8.6 3.1 17.3 11.6 19.4l32 8c8.6 2.1 17.3-3.1 19.4-11.6s-3.1-17.3-11.6-19.4l-32-8c-8.6-2.1-17.3 3.1-19.4 11.6zm92-20c-2.1 8.6 3.1 17.3 11.6 19.4s17.3-3.1 19.4-11.6l8-32c2.1-8.6-3.1-17.3-11.6-19.4s-17.3 3.1-19.4 11.6l-8 32zM343.2 113.7c-7.9-4-17.5-.7-21.5 7.2l-16 32c-4 7.9-.7 17.5 7.2 21.5s17.5 .7 21.5-7.2l16-32c4-7.9 .7-17.5-7.2-21.5z"]
};
const faGlobeAsia = faEarthAsia;
const faIdCardClip = {
  prefix: 'fas',
  iconName: 'id-card-clip',
  icon: [576, 512, ["id-card-alt"], "f47f", "M256 0l64 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zM64 64l128 0 0 48c0 26.5 21.5 48 48 48l96 0c26.5 0 48-21.5 48-48l0-48 128 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64zM176 437.3c0 5.9 4.8 10.7 10.7 10.7l202.7 0c5.9 0 10.7-4.8 10.7-10.7c0-29.5-23.9-53.3-53.3-53.3l-117.3 0c-29.5 0-53.3 23.9-53.3 53.3zM288 352a64 64 0 1 0 0-128 64 64 0 1 0 0 128z"]
};
const faIdCardAlt = faIdCardClip;
const faMagnifyingGlassPlus = {
  prefix: 'fas',
  iconName: 'magnifying-glass-plus',
  icon: [512, 512, ["search-plus"], "f00e", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM184 296c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64 64 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-64 0 0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 64-64 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l64 0 0 64z"]
};
const faSearchPlus = faMagnifyingGlassPlus;
const faThumbsUp = {
  prefix: 'fas',
  iconName: 'thumbs-up',
  icon: [512, 512, [128077, 61575], "f164", "M313.4 32.9c26 5.2 42.9 30.5 37.7 56.5l-2.3 11.4c-5.3 26.7-15.1 52.1-28.8 75.2l144 0c26.5 0 48 21.5 48 48c0 18.5-10.5 34.6-25.9 42.6C497 275.4 504 288.9 504 304c0 23.4-16.8 42.9-38.9 47.1c4.4 7.3 6.9 15.8 6.9 24.9c0 21.3-13.9 39.4-33.1 45.6c.7 3.3 1.1 6.8 1.1 10.4c0 26.5-21.5 48-48 48l-97.5 0c-19 0-37.5-5.6-53.3-16.1l-38.5-25.7C176 420.4 160 390.4 160 358.3l0-38.3 0-48 0-24.9c0-29.2 13.3-56.7 36-75l7.4-5.9c26.5-21.2 44.6-51 51.2-84.2l2.3-11.4c5.2-26 30.5-42.9 56.5-37.7zM32 192l64 0c17.7 0 32 14.3 32 32l0 224c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32L0 224c0-17.7 14.3-32 32-32z"]
};
const faUserClock = {
  prefix: 'fas',
  iconName: 'user-clock',
  icon: [640, 512, [], "f4fd", "M224 0a128 128 0 1 1 0 256A128 128 0 1 1 224 0zM178.3 304l91.4 0c20.6 0 40.4 3.5 58.8 9.9C323 331 320 349.1 320 368c0 59.5 29.5 112.1 74.8 144L29.7 512C13.3 512 0 498.7 0 482.3C0 383.8 79.8 304 178.3 304zM352 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-80c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0-48c0-8.8-7.2-16-16-16z"]
};
const faHandDots = {
  prefix: 'fas',
  iconName: 'hand-dots',
  icon: [512, 512, ["allergies"], "f461", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 272c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L124.8 448c43.1 41.1 100.4 64 160 64l19.2 0c97.2 0 176-78.8 176-176l0-208c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208zM240 336a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm80 16a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48-16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm-16 80a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM240 432a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm-48-48a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faAllergies = faHandDots;
const faFileInvoice = {
  prefix: 'fas',
  iconName: 'file-invoice',
  icon: [384, 512, [], "f570", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM80 64l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 96c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm16 96l192 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L96 352c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm0 32l0 64 192 0 0-64L96 256zM240 416l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faWindowMinimize = {
  prefix: 'fas',
  iconName: 'window-minimize',
  icon: [512, 512, [128469], "f2d1", "M32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416z"]
};
const faMugSaucer = {
  prefix: 'fas',
  iconName: 'mug-saucer',
  icon: [640, 512, ["coffee"], "f0f4", "M96 64c0-17.7 14.3-32 32-32l320 0 64 0c70.7 0 128 57.3 128 128s-57.3 128-128 128l-32 0c0 53-43 96-96 96l-192 0c-53 0-96-43-96-96L96 64zM480 224l32 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0 0 128zM32 416l512 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faCoffee = faMugSaucer;
const faBrush = {
  prefix: 'fas',
  iconName: 'brush',
  icon: [384, 512, [], "f55d", "M162.4 6c-1.5-3.6-5-6-8.9-6l-19 0c-3.9 0-7.5 2.4-8.9 6L104.9 57.7c-3.2 8-14.6 8-17.8 0L66.4 6c-1.5-3.6-5-6-8.9-6L48 0C21.5 0 0 21.5 0 48L0 224l0 22.4L0 256l9.6 0 364.8 0 9.6 0 0-9.6 0-22.4 0-176c0-26.5-21.5-48-48-48L230.5 0c-3.9 0-7.5 2.4-8.9 6L200.9 57.7c-3.2 8-14.6 8-17.8 0L162.4 6zM0 288l0 32c0 35.3 28.7 64 64 64l64 0 0 64c0 35.3 28.7 64 64 64s64-28.7 64-64l0-64 64 0c35.3 0 64-28.7 64-64l0-32L0 288zM192 432a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faFileHalfDashed = {
  prefix: 'fas',
  iconName: 'file-half-dashed',
  icon: [384, 512, [], "e698", "M64 0C28.7 0 0 28.7 0 64L0 320l384 0 0-160-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM0 416l64 0 0-64L0 352l0 64zm288 32l-80 0 0 64 80 0 0-64zm-112 0l-80 0 0 64 80 0 0-64zM64 448L0 448c0 35.3 28.7 64 64 64l0-64zm256 0l0 64c35.3 0 64-28.7 64-64l-64 0zm64-32l0-64-64 0 0 64 64 0z"]
};
const faMask = {
  prefix: 'fas',
  iconName: 'mask',
  icon: [576, 512, [], "f6fa", "M288 64C64 64 0 160 0 272S80 448 176 448l8.4 0c24.2 0 46.4-13.7 57.2-35.4l23.2-46.3c4.4-8.8 13.3-14.3 23.2-14.3s18.8 5.5 23.2 14.3l23.2 46.3c10.8 21.7 33 35.4 57.2 35.4l8.4 0c96 0 176-64 176-176s-64-208-288-208zM96 256a64 64 0 1 1 128 0A64 64 0 1 1 96 256zm320-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faMagnifyingGlassMinus = {
  prefix: 'fas',
  iconName: 'magnifying-glass-minus',
  icon: [512, 512, ["search-minus"], "f010", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]
};
const faSearchMinus = faMagnifyingGlassMinus;
const faRulerVertical = {
  prefix: 'fas',
  iconName: 'ruler-vertical',
  icon: [256, 512, [], "f548", "M0 48C0 21.5 21.5 0 48 0L208 0c26.5 0 48 21.5 48 48l0 48-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 64-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 64-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 64-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 48z"]
};
const faUserLarge = {
  prefix: 'fas',
  iconName: 'user-large',
  icon: [512, 512, ["user-alt"], "f406", "M256 288A144 144 0 1 0 256 0a144 144 0 1 0 0 288zm-94.7 32C72.2 320 0 392.2 0 481.3c0 17 13.8 30.7 30.7 30.7l450.6 0c17 0 30.7-13.8 30.7-30.7C512 392.2 439.8 320 350.7 320l-189.4 0z"]
};
const faUserAlt = faUserLarge;
const faTrainTram = {
  prefix: 'fas',
  iconName: 'train-tram',
  icon: [448, 512, [128650], "e5b4", "M86.8 48c-12.2 0-23.6 5.5-31.2 15L42.7 79C34.5 89.3 19.4 91 9 82.7S-3 59.4 5.3 49L18 33C34.7 12.2 60 0 86.8 0L361.2 0c26.7 0 52 12.2 68.7 33l12.8 16c8.3 10.4 6.6 25.5-3.8 33.7s-25.5 6.6-33.7-3.7L392.5 63c-7.6-9.5-19.1-15-31.2-15L248 48l0 48 40 0c53 0 96 43 96 96l0 160c0 30.6-14.3 57.8-36.6 75.4l65.5 65.5c7.1 7.1 2.1 19.1-7.9 19.1l-39.7 0c-8.5 0-16.6-3.4-22.6-9.4L288 448l-128 0-54.6 54.6c-6 6-14.1 9.4-22.6 9.4L43 512c-10 0-15-12.1-7.9-19.1l65.5-65.5C78.3 409.8 64 382.6 64 352l0-160c0-53 43-96 96-96l40 0 0-48L86.8 48zM160 160c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-128 0zm32 192a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faUserNurse = {
  prefix: 'fas',
  iconName: 'user-nurse',
  icon: [448, 512, [], "f82f", "M96 128l0-57.8c0-13.3 8.3-25.3 20.8-30l96-36c7.2-2.7 15.2-2.7 22.5 0l96 36c12.5 4.7 20.8 16.6 20.8 30l0 57.8-.3 0c.2 2.6 .3 5.3 .3 8l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40c0-2.7 .1-5.4 .3-8l-.3 0zm48 48c0 44.2 35.8 80 80 80s80-35.8 80-80l0-16-160 0 0 16zM111.9 327.7c10.5-3.4 21.8 .4 29.4 8.5l71 75.5c6.3 6.7 17 6.7 23.3 0l71-75.5c7.6-8.1 18.9-11.9 29.4-8.5C401 348.6 448 409.4 448 481.3c0 17-13.8 30.7-30.7 30.7L30.7 512C13.8 512 0 498.2 0 481.3c0-71.9 47-132.7 111.9-153.6zM208 48l0 16-16 0c-4.4 0-8 3.6-8 8l0 16c0 4.4 3.6 8 8 8l16 0 0 16c0 4.4 3.6 8 8 8l16 0c4.4 0 8-3.6 8-8l0-16 16 0c4.4 0 8-3.6 8-8l0-16c0-4.4-3.6-8-8-8l-16 0 0-16c0-4.4-3.6-8-8-8l-16 0c-4.4 0-8 3.6-8 8z"]
};
const faSyringe = {
  prefix: 'fas',
  iconName: 'syringe',
  icon: [512, 512, [128137], "f48e", "M441 7l32 32 32 32c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-15-15L417.9 128l55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-72-72L295 73c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l55 55L422.1 56 407 41c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0zM210.3 155.7l61.1-61.1c.3 .3 .6 .7 1 1l16 16 56 56 56 56 16 16c.3 .3 .6 .6 1 1l-191 191c-10.5 10.5-24.7 16.4-39.6 16.4l-88.8 0L41 505c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l57-57 0-88.8c0-14.9 5.9-29.1 16.4-39.6l43.3-43.3 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 41.4-41.4 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57z"]
};
const faCloudSun = {
  prefix: 'fas',
  iconName: 'cloud-sun',
  icon: [640, 512, [9925], "f6c4", "M294.2 1.2c5.1 2.1 8.7 6.7 9.6 12.1l14.1 84.7 84.7 14.1c5.4 .9 10 4.5 12.1 9.6s1.5 10.9-1.6 15.4l-38.5 55c-2.2-.1-4.4-.2-6.7-.2c-23.3 0-45.1 6.2-64 17.1l0-1.1c0-53-43-96-96-96s-96 43-96 96s43 96 96 96c8.1 0 15.9-1 23.4-2.9c-36.6 18.1-63.3 53.1-69.8 94.9l-24.4 17c-4.5 3.2-10.3 3.8-15.4 1.6s-8.7-6.7-9.6-12.1L98.1 317.9 13.4 303.8c-5.4-.9-10-4.5-12.1-9.6s-1.5-10.9 1.6-15.4L52.5 208 2.9 137.2c-3.2-4.5-3.8-10.3-1.6-15.4s6.7-8.7 12.1-9.6L98.1 98.1l14.1-84.7c.9-5.4 4.5-10 9.6-12.1s10.9-1.5 15.4 1.6L208 52.5 278.8 2.9c4.5-3.2 10.3-3.8 15.4-1.6zM144 208a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM639.9 431.9c0 44.2-35.8 80-80 80l-271.9 0c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]
};
const faStopwatch20 = {
  prefix: 'fas',
  iconName: 'stopwatch-20',
  icon: [448, 512, [], "e06f", "M176 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 34.4C92.3 113.8 16 200 16 304c0 114.9 93.1 208 208 208s208-93.1 208-208c0-41.8-12.3-80.7-33.5-113.2l24.1-24.1c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L355.7 143c-28.1-23-62.2-38.8-99.7-44.6L256 64l16 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L176 0zM288 204c28.7 0 52 23.3 52 52l0 96c0 28.7-23.3 52-52 52s-52-23.3-52-52l0-96c0-28.7 23.3-52 52-52zm-12 52l0 96c0 6.6 5.4 12 12 12s12-5.4 12-12l0-96c0-6.6-5.4-12-12-12s-12 5.4-12 12zM159.5 244c-5.4 0-10.2 3.5-11.9 8.6l-.6 1.7c-3.5 10.5-14.8 16.1-25.3 12.6s-16.1-14.8-12.6-25.3l.6-1.7c7.2-21.5 27.2-35.9 49.8-35.9c29 0 52.5 23.5 52.5 52.5l0 2.2c0 13.4-4.9 26.4-13.8 36.4l-39 43.9c-6.2 7-10 15.7-10.9 24.9l43.8 0c11 0 20 9 20 20s-9 20-20 20l-64 0c-11 0-20-9-20-20l0-15.7c0-20.6 7.5-40.4 21.2-55.8l39-43.9c2.4-2.7 3.7-6.2 3.7-9.8l0-2.2c0-6.9-5.6-12.5-12.5-12.5z"]
};
const faSquareFull = {
  prefix: 'fas',
  iconName: 'square-full',
  icon: [512, 512, [128997, 128998, 128999, 129000, 129001, 129002, 129003, 11035, 11036], "f45c", "M0 0H512V512H0V0z"]
};
const faMagnet = {
  prefix: 'fas',
  iconName: 'magnet',
  icon: [448, 512, [129522], "f076", "M0 160l0 96C0 379.7 100.3 480 224 480s224-100.3 224-224l0-96-128 0 0 96c0 53-43 96-96 96s-96-43-96-96l0-96L0 160zm0-32l128 0 0-64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64l0 64zm320 0l128 0 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64z"]
};
const faJar = {
  prefix: 'fas',
  iconName: 'jar',
  icon: [320, 512, [], "e516", "M32 32C32 14.3 46.3 0 64 0L256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 64C46.3 64 32 49.7 32 32zM0 160c0-35.3 28.7-64 64-64l192 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 160zm96 64c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-96c0-17.7-14.3-32-32-32L96 224z"]
};
const faNoteSticky = {
  prefix: 'fas',
  iconName: 'note-sticky',
  icon: [448, 512, [62026, "sticky-note"], "f249", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l224 0 0-112c0-26.5 21.5-48 48-48l112 0 0-224c0-35.3-28.7-64-64-64L64 32zM448 352l-45.3 0L336 352c-8.8 0-16 7.2-16 16l0 66.7 0 45.3 32-32 64-64 32-32z"]
};
const faStickyNote = faNoteSticky;
const faBugSlash = {
  prefix: 'fas',
  iconName: 'bug-slash',
  icon: [640, 512, [], "e490", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L477.4 348.9c1.7-9.4 2.6-19 2.6-28.9l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64.3 0c-1.1-14.1-5-27.5-11.1-39.5c.7-.6 1.4-1.2 2.1-1.9l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-.7 .7-1.3 1.4-1.9 2.1C409.2 164.1 393.1 160 376 160l-112 0c-8.3 0-16.3 1-24 2.8L38.8 5.1zM320 0c-53 0-96 43-96 96l0 3.6c0 15.7 12.7 28.4 28.4 28.4l135.1 0c15.7 0 28.4-12.7 28.4-28.4l0-3.6c0-53-43-96-96-96zM160.3 256L96 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c0 24.6 5.5 47.8 15.4 68.6c-2.2 1.3-4.2 2.9-6 4.8l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l63.1-63.1c24.5 21.8 55.8 36.2 90.3 39.6l0-143.7L166.7 227.3c-3.4 9-5.6 18.7-6.4 28.7zM336 479.2c36.6-3.6 69.7-19.6 94.8-43.8L336 360.7l0 118.5z"]
};
const faArrowUpFromWaterPump = {
  prefix: 'fas',
  iconName: 'arrow-up-from-water-pump',
  icon: [576, 512, [], "e4b6", "M112 0C85.5 0 64 21.5 64 48l0 208-16 0c-26.5 0-48 21.5-48 48l0 96c0 8 2 15.6 5.4 22.2c3.8-1.7 7.8-3.1 12-4.1c13.1-3.1 26.7-9.8 37.3-18.6c22.2-18.7 54.3-20.1 78.1-3.4c18 12.4 40.1 20.3 59.2 20.3c21.1 0 42-8.5 59.2-20.3c22.1-15.5 51.6-15.5 73.7 0c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.3 78.1 3.4c10.6 8.8 24.2 15.6 37.3 18.6c4.2 1 8.2 2.4 12 4.1C574 415.6 576 408 576 400l0-96c0-26.5-21.5-48-48-48l-48 0 0-146.7 25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-80-80c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 109.3 416 256l-128 0 0-208c0-26.5-21.5-48-48-48L112 0zM306.5 421.9c-11.1-7.9-25.9-7.9-37 0C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 437.2 410.9 448 384 448c-27.5 0-55-10.6-77.5-26.1z"]
};
const faBone = {
  prefix: 'fas',
  iconName: 'bone',
  icon: [576, 512, [129460], "f5d7", "M153.7 144.8c6.9 16.3 20.6 31.2 38.3 31.2l192 0c17.7 0 31.4-14.9 38.3-31.2C434.4 116.1 462.9 96 496 96c44.2 0 80 35.8 80 80c0 30.4-17 56.9-42 70.4c-3.6 1.9-6 5.5-6 9.6s2.4 7.7 6 9.6c25 13.5 42 40 42 70.4c0 44.2-35.8 80-80 80c-33.1 0-61.6-20.1-73.7-48.8C415.4 350.9 401.7 336 384 336l-192 0c-17.7 0-31.4 14.9-38.3 31.2C141.6 395.9 113.1 416 80 416c-44.2 0-80-35.8-80-80c0-30.4 17-56.9 42-70.4c3.6-1.9 6-5.5 6-9.6s-2.4-7.7-6-9.6C17 232.9 0 206.4 0 176c0-44.2 35.8-80 80-80c33.1 0 61.6 20.1 73.7 48.8z"]
};
const faTableCellsRowUnlock = {
  prefix: 'fas',
  iconName: 'table-cells-row-unlock',
  icon: [640, 512, [], "e691", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 65.1c-37.8 5.4-69.4 29.6-85.2 62.9L360 224l0 64 56 0 0 8.6c-19.1 11.1-32 31.7-32 55.4l-24 0 0 64 24 0 0 64L64 480c-35.3 0-64-28.7-64-64L0 96zM64 224l0 64 88 0 0-64-88 0zm232 0l-88 0 0 64 88 0 0-64zM152 352l-88 0 0 64 88 0 0-64zm56 0l0 64 88 0 0-64-88 0zm288-80l0 48 32 0 32 0 48 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48c0-44.2 35.8-80 80-80s80 35.8 80 80l-48 0c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faUserInjured = {
  prefix: 'fas',
  iconName: 'user-injured',
  icon: [448, 512, [], "f728", "M240 80l102.7 0c-7.9-19.5-20.4-36.5-36.2-49.9L240 80zm37.7-68.2C261.3 4.2 243.2 0 224 0c-53.7 0-99.7 33.1-118.7 80l81.4 0 91-68.2zM224 256c70.7 0 128-57.3 128-128c0-5.4-.3-10.8-1-16L97 112c-.7 5.2-1 10.6-1 16c0 70.7 57.3 128 128 128zM124 312.4c-9.7 3.1-19.1 7-28 11.7L96 512l147.7 0L181.5 408.2 124 312.4zm33-7.2L204.3 384l67.7 0c44.2 0 80 35.8 80 80c0 18-6 34.6-16 48l82.3 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0c-7.2 0-14.3 .4-21.3 1.3zM0 482.3C0 498.7 13.3 512 29.7 512L64 512l0-166.6C24.9 378.1 0 427.3 0 482.3zM320 464c0-26.5-21.5-48-48-48l-48.5 0 57.1 95.2C303 507.2 320 487.6 320 464z"]
};
const faFaceSadTear = {
  prefix: 'fas',
  iconName: 'face-sad-tear',
  icon: [512, 512, [128546, "sad-tear"], "f5b4", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm240 80c0-8.8 7.2-16 16-16c45 0 85.6 20.5 115.7 53.1c6 6.5 5.6 16.6-.9 22.6s-16.6 5.6-22.6-.9c-25-27.1-57.4-42.9-92.3-42.9c-8.8 0-16-7.2-16-16zm-80 80c-26.5 0-48-21-48-47c0-20 28.6-60.4 41.6-77.7c3.2-4.4 9.6-4.4 12.8 0C179.6 308.6 208 349 208 369c0 26-21.5 47-48 47zM367.6 208a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm-192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSadTear = faFaceSadTear;
const faPlane = {
  prefix: 'fas',
  iconName: 'plane',
  icon: [576, 512, [], "f072", "M482.3 192c34.2 0 93.7 29 93.7 64c0 36-59.5 64-93.7 64l-116.6 0L265.2 495.9c-5.7 10-16.3 16.1-27.8 16.1l-56.2 0c-10.6 0-18.3-10.2-15.4-20.4l49-171.6L112 320 68.8 377.6c-3 4-7.8 6.4-12.8 6.4l-42 0c-7.8 0-14-6.3-14-14c0-1.3 .2-2.6 .5-3.9L32 256 .5 145.9c-.4-1.3-.5-2.6-.5-3.9c0-7.8 6.3-14 14-14l42 0c5 0 9.8 2.4 12.8 6.4L112 192l102.9 0-49-171.6C162.9 10.2 170.6 0 181.2 0l56.2 0c11.5 0 22.1 6.2 27.8 16.1L365.7 192l116.6 0z"]
};
const faTentArrowsDown = {
  prefix: 'fas',
  iconName: 'tent-arrows-down',
  icon: [576, 512, [], "e581", "M209.8 111.9c-8.9-9.9-24-10.7-33.9-1.8l-39.9 36L136 24c0-13.3-10.7-24-24-24S88 10.7 88 24l0 122.1-39.9-36c-9.9-8.9-25-8.1-33.9 1.8s-8.1 25 1.8 33.9l80 72c9.1 8.2 23 8.2 32.1 0l80-72c9.9-8.9 10.7-24 1.8-33.9zm352 0c-8.9-9.9-24-10.7-33.9-1.8l-39.9 36L488 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 122.1-39.9-36c-9.9-8.9-25-8.1-33.9 1.8s-8.1 25 1.8 33.9l80 72c9.1 8.2 23 8.2 32.1 0l80-72c9.9-8.9 10.7-24 1.8-33.9zM307.4 166.5c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S86.7 512 96 512l144 0 16 0c17.7 0 32-14.3 32-32l0-118.1c0-5.5 4.4-9.9 9.9-9.9c3.7 0 7.2 2.1 8.8 5.5l68.4 136.8c5.4 10.8 16.5 17.7 28.6 17.7l60.2 0 16 0c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
};
const faExclamation = {
  prefix: 'fas',
  iconName: 'exclamation',
  icon: [128, 512, [10069, 10071, 61738], "21", "M96 64c0-17.7-14.3-32-32-32S32 46.3 32 64l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32L96 64zM64 480a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faArrowsSpin = {
  prefix: 'fas',
  iconName: 'arrows-spin',
  icon: [512, 512, [], "e4bb", "M256 96c38.4 0 73.7 13.5 101.3 36.1l-32.6 32.6c-4.6 4.6-5.9 11.5-3.5 17.4s8.3 9.9 14.8 9.9l112 0c8.8 0 16-7.2 16-16l0-112c0-6.5-3.9-12.3-9.9-14.8s-12.9-1.1-17.4 3.5l-34 34C363.4 52.6 312.1 32 256 32c-10.9 0-21.5 .8-32 2.3l0 64.9c10.3-2.1 21-3.2 32-3.2zM132.1 154.7l32.6 32.6c4.6 4.6 11.5 5.9 17.4 3.5s9.9-8.3 9.9-14.8l0-112c0-8.8-7.2-16-16-16L64 48c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l34 34C52.6 148.6 32 199.9 32 256c0 10.9 .8 21.5 2.3 32l64.9 0c-2.1-10.3-3.2-21-3.2-32c0-38.4 13.5-73.7 36.1-101.3zM477.7 224l-64.9 0c2.1 10.3 3.2 21 3.2 32c0 38.4-13.5 73.7-36.1 101.3l-32.6-32.6c-4.6-4.6-11.5-5.9-17.4-3.5s-9.9 8.3-9.9 14.8l0 112c0 8.8 7.2 16 16 16l112 0c6.5 0 12.3-3.9 14.8-9.9s1.1-12.9-3.5-17.4l-34-34C459.4 363.4 480 312.1 480 256c0-10.9-.8-21.5-2.3-32zM256 416c-38.4 0-73.7-13.5-101.3-36.1l32.6-32.6c4.6-4.6 5.9-11.5 3.5-17.4s-8.3-9.9-14.8-9.9L64 320c-8.8 0-16 7.2-16 16l0 112c0 6.5 3.9 12.3 9.9 14.8s12.9 1.1 17.4-3.5l34-34C148.6 459.4 199.9 480 256 480c10.9 0 21.5-.8 32-2.3l0-64.9c-10.3 2.1-21 3.2-32 3.2z"]
};
const faPrint = {
  prefix: 'fas',
  iconName: 'print',
  icon: [512, 512, [128424, 128438, 9113], "f02f", "M128 0C92.7 0 64 28.7 64 64l0 96 64 0 0-96 226.7 0L384 93.3l0 66.7 64 0 0-66.7c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0L128 0zM384 352l0 32 0 64-256 0 0-64 0-16 0-16 256 0zm64 32l32 0c17.7 0 32-14.3 32-32l0-96c0-35.3-28.7-64-64-64L64 192c-35.3 0-64 28.7-64 64l0 96c0 17.7 14.3 32 32 32l32 0 0 64c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-64zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faTurkishLiraSign = {
  prefix: 'fas',
  iconName: 'turkish-lira-sign',
  icon: [384, 512, ["try", "turkish-lira"], "e2bb", "M96 32c17.7 0 32 14.3 32 32l0 35.3L247.2 65.2c17-4.9 34.7 5 39.6 22s-5 34.7-22 39.6L128 165.9l0 29.4 119.2-34.1c17-4.9 34.7 5 39.6 22s-5 34.7-22 39.6L128 261.9 128 416l63.8 0c68.2 0 124.4-53.5 127.8-121.6l.4-8c.9-17.7 15.9-31.2 33.6-30.4s31.2 15.9 30.4 33.6l-.4 8C378.5 399.8 294.1 480 191.8 480L96 480c-17.7 0-32-14.3-32-32l0-167.9-23.2 6.6c-17 4.9-34.7-5-39.6-22s5-34.7 22-39.6L64 213.6l0-29.4-23.2 6.6c-17 4.9-34.7-5-39.6-22s5-34.7 22-39.6L64 117.6 64 64c0-17.7 14.3-32 32-32z"]
};
const faTry = faTurkishLiraSign;
const faTurkishLira = faTurkishLiraSign;
const faDollarSign = {
  prefix: 'fas',
  iconName: 'dollar-sign',
  icon: [320, 512, [128178, 61781, "dollar", "usd"], "24", "M160 0c17.7 0 32 14.3 32 32l0 35.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11l0 33.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-34.9c-.4-.1-.9-.1-1.3-.2l-.2 0s0 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7s0 0 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11L128 32c0-17.7 14.3-32 32-32z"]
};
const faDollar = faDollarSign;
const faUsd = faDollarSign;
const faX = {
  prefix: 'fas',
  iconName: 'x',
  icon: [384, 512, [120], "58", "M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"]
};
const faMagnifyingGlassDollar = {
  prefix: 'fas',
  iconName: 'magnifying-glass-dollar',
  icon: [512, 512, ["search-dollar"], "f688", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM228 104c0-11-9-20-20-20s-20 9-20 20l0 14c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1c0 0 0 0 0 0s0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4l0 14.6c0 11 9 20 20 20s20-9 20-20l0-13.8c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15l-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7l0-13.9z"]
};
const faSearchDollar = faMagnifyingGlassDollar;
const faUsersGear = {
  prefix: 'fas',
  iconName: 'users-gear',
  icon: [640, 512, ["users-cog"], "f509", "M144 160A80 80 0 1 0 144 0a80 80 0 1 0 0 160zm368 0A80 80 0 1 0 512 0a80 80 0 1 0 0 160zM0 298.7C0 310.4 9.6 320 21.3 320l213.3 0c.2 0 .4 0 .7 0c-26.6-23.5-43.3-57.8-43.3-96c0-7.6 .7-15 1.9-22.3c-13.6-6.3-28.7-9.7-44.6-9.7l-42.7 0C47.8 192 0 239.8 0 298.7zM320 320c24 0 45.9-8.8 62.7-23.3c2.5-3.7 5.2-7.3 8-10.7c2.7-3.3 5.7-6.1 9-8.3C410 262.3 416 243.9 416 224c0-53-43-96-96-96s-96 43-96 96s43 96 96 96zm65.4 60.2c-10.3-5.9-18.1-16.2-20.8-28.2l-103.2 0C187.7 352 128 411.7 128 485.3c0 14.7 11.9 26.7 26.7 26.7l300.6 0c-2.1-5.2-3.2-10.9-3.2-16.4l0-3c-1.3-.7-2.7-1.5-4-2.3l-2.6 1.5c-16.8 9.7-40.5 8-54.7-9.7c-4.5-5.6-8.6-11.5-12.4-17.6l-.1-.2-.1-.2-2.4-4.1-.1-.2-.1-.2c-3.4-6.2-6.4-12.6-9-19.3c-8.2-21.2 2.2-42.6 19-52.3l2.7-1.5c0-.8 0-1.5 0-2.3s0-1.5 0-2.3l-2.7-1.5zM533.3 192l-42.7 0c-15.9 0-31 3.5-44.6 9.7c1.3 7.2 1.9 14.7 1.9 22.3c0 17.4-3.5 33.9-9.7 49c2.5 .9 4.9 2 7.1 3.3l2.6 1.5c1.3-.8 2.6-1.6 4-2.3l0-3c0-19.4 13.3-39.1 35.8-42.6c7.9-1.2 16-1.9 24.2-1.9s16.3 .6 24.2 1.9c22.5 3.5 35.8 23.2 35.8 42.6l0 3c1.3 .7 2.7 1.5 4 2.3l2.6-1.5c16.8-9.7 40.5-8 54.7 9.7c2.3 2.8 4.5 5.8 6.6 8.7c-2.1-57.1-49-102.7-106.6-102.7zm91.3 163.9c6.3-3.6 9.5-11.1 6.8-18c-2.1-5.5-4.6-10.8-7.4-15.9l-2.3-4c-3.1-5.1-6.5-9.9-10.2-14.5c-4.6-5.7-12.7-6.7-19-3l-2.9 1.7c-9.2 5.3-20.4 4-29.6-1.3s-16.1-14.5-16.1-25.1l0-3.4c0-7.3-4.9-13.8-12.1-14.9c-6.5-1-13.1-1.5-19.9-1.5s-13.4 .5-19.9 1.5c-7.2 1.1-12.1 7.6-12.1 14.9l0 3.4c0 10.6-6.9 19.8-16.1 25.1s-20.4 6.6-29.6 1.3l-2.9-1.7c-6.3-3.6-14.4-2.6-19 3c-3.7 4.6-7.1 9.5-10.2 14.6l-2.3 3.9c-2.8 5.1-5.3 10.4-7.4 15.9c-2.6 6.8 .5 14.3 6.8 17.9l2.9 1.7c9.2 5.3 13.7 15.8 13.7 26.4s-4.5 21.1-13.7 26.4l-3 1.7c-6.3 3.6-9.5 11.1-6.8 17.9c2.1 5.5 4.6 10.7 7.4 15.8l2.4 4.1c3 5.1 6.4 9.9 10.1 14.5c4.6 5.7 12.7 6.7 19 3l2.9-1.7c9.2-5.3 20.4-4 29.6 1.3s16.1 14.5 16.1 25.1l0 3.4c0 7.3 4.9 13.8 12.1 14.9c6.5 1 13.1 1.5 19.9 1.5s13.4-.5 19.9-1.5c7.2-1.1 12.1-7.6 12.1-14.9l0-3.4c0-10.6 6.9-19.8 16.1-25.1s20.4-6.6 29.6-1.3l2.9 1.7c6.3 3.6 14.4 2.6 19-3c3.7-4.6 7.1-9.4 10.1-14.5l2.4-4.2c2.8-5.1 5.3-10.3 7.4-15.8c2.6-6.8-.5-14.3-6.8-17.9l-3-1.7c-9.2-5.3-13.7-15.8-13.7-26.4s4.5-21.1 13.7-26.4l3-1.7zM472 384a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z"]
};
const faUsersCog = faUsersGear;
const faPersonMilitaryPointing = {
  prefix: 'fas',
  iconName: 'person-military-pointing',
  icon: [576, 512, [], "e54a", "M246.9 14.1C234 15.2 224 26 224 39c0 13.8 11.2 25 25 25l151 0c8.8 0 16-7.2 16-16l0-30.6C416 8 408 .7 398.7 1.4L246.9 14.1zM240 112c0 44.2 35.8 80 80 80s80-35.8 80-80c0-5.5-.6-10.8-1.6-16L241.6 96c-1 5.2-1.6 10.5-1.6 16zM72 224c-22.1 0-40 17.9-40 40s17.9 40 40 40l152 0 0 89.4L386.8 230.5c-13.3-4.3-27.3-6.5-41.6-6.5L240 224 72 224zm345.7 20.9L246.6 416 416 416l0-46.3 53.6 90.6c11.2 19 35.8 25.3 54.8 14.1s25.3-35.8 14.1-54.8L462.3 290.8c-11.2-18.9-26.6-34.5-44.6-45.9zM224 448l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32-192 0z"]
};
const faBuildingColumns = {
  prefix: 'fas',
  iconName: 'building-columns',
  icon: [512, 512, ["bank", "institution", "museum", "university"], "f19c", "M243.4 2.6l-224 96c-14 6-21.8 21-18.7 35.8S16.8 160 32 160l0 8c0 13.3 10.7 24 24 24l400 0c13.3 0 24-10.7 24-24l0-8c15.2 0 28.3-10.7 31.3-25.6s-4.8-29.9-18.7-35.8l-224-96c-8-3.4-17.2-3.4-25.2 0zM128 224l-64 0 0 196.3c-.6 .3-1.2 .7-1.8 1.1l-48 32c-11.7 7.8-17 22.4-12.9 35.9S17.9 512 32 512l448 0c14.1 0 26.5-9.2 30.6-22.7s-1.1-28.1-12.9-35.9l-48-32c-.6-.4-1.2-.7-1.8-1.1L448 224l-64 0 0 192-40 0 0-192-64 0 0 192-48 0 0-192-64 0 0 192-40 0 0-192zM256 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBank = faBuildingColumns;
const faInstitution = faBuildingColumns;
const faMuseum = faBuildingColumns;
const faUniversity = faBuildingColumns;
const faUmbrella = {
  prefix: 'fas',
  iconName: 'umbrella',
  icon: [576, 512, [], "f0e9", "M288 0c17.7 0 32 14.3 32 32l0 17.7C451.8 63.4 557.7 161 573.9 285.9c2 15.6-17.3 24.4-27.8 12.7C532.1 283 504.8 272 480 272c-38.7 0-71 27.5-78.4 64.1c-1.7 8.7-8.7 15.9-17.6 15.9s-15.8-7.2-17.6-15.9C359 299.5 326.7 272 288 272s-71 27.5-78.4 64.1c-1.7 8.7-8.7 15.9-17.6 15.9s-15.8-7.2-17.6-15.9C167 299.5 134.7 272 96 272c-24.8 0-52.1 11-66.1 26.7C19.4 310.4 .1 301.5 2.1 285.9C18.3 161 124.2 63.4 256 49.7L256 32c0-17.7 14.3-32 32-32zm0 304c12.3 0 23.5 4.6 32 12.2l0 114.3c0 45-36.5 81.4-81.4 81.4c-30.8 0-59-17.4-72.8-45l-2.3-4.7c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l2.3 4.7c3 5.9 9 9.6 15.6 9.6c9.6 0 17.4-7.8 17.4-17.4l0-114.3c8.5-7.6 19.7-12.2 32-12.2z"]
};
const faTrowel = {
  prefix: 'fas',
  iconName: 'trowel',
  icon: [512, 512, [], "e589", "M343.9 213.4L245.3 312l65.4 65.4c7.9 7.9 11.1 19.4 8.4 30.3s-10.8 19.6-21.5 22.9l-256 80c-11.4 3.5-23.8 .5-32.2-7.9S-2.1 481.8 1.5 470.5l80-256c3.3-10.7 12-18.9 22.9-21.5s22.4 .5 30.3 8.4L200 266.7l98.6-98.6c-14.3-14.6-14.2-38 .3-52.5l95.4-95.4c26.9-26.9 70.5-26.9 97.5 0s26.9 70.5 0 97.5l-95.4 95.4c-14.5 14.5-37.9 14.6-52.5 .3z"]
};
const faD = {
  prefix: 'fas',
  iconName: 'd',
  icon: [384, 512, [100], "44", "M0 96C0 60.7 28.7 32 64 32l96 0c123.7 0 224 100.3 224 224s-100.3 224-224 224l-96 0c-35.3 0-64-28.7-64-64L0 96zm160 0L64 96l0 320 96 0c88.4 0 160-71.6 160-160s-71.6-160-160-160z"]
};
const faStapler = {
  prefix: 'fas',
  iconName: 'stapler',
  icon: [640, 512, [], "e5af", "M640 299.3l0 4.7 0 128c0 26.5-21.5 48-48 48l-80 0-64 0L64 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0 0-48L96 368c-17.7 0-32-14.3-32-32l0-116.6L33.8 214C14.2 210.5 0 193.5 0 173.7c0-8.9 2.9-17.5 8.2-24.6l35.6-47.5C76.7 57.8 128.2 32 182.9 32c27 0 53.6 6.3 77.8 18.4L586.9 213.5C619.5 229.7 640 263 640 299.3zM448 304l0-16L128 230.9l0 73.1 320 0z"]
};
const faMasksTheater = {
  prefix: 'fas',
  iconName: 'masks-theater',
  icon: [640, 512, [127917, "theater-masks"], "f630", "M74.6 373.2c41.7 36.1 108 82.5 166.1 73.7c6.1-.9 12.1-2.5 18-4.5c-9.2-12.3-17.3-24.4-24.2-35.4c-21.9-35-28.8-75.2-25.9-113.6c-20.6 4.1-39.2 13-54.7 25.4c-6.5 5.2-16.3 1.3-14.8-7c6.4-33.5 33-60.9 68.2-66.3c2.6-.4 5.3-.7 7.9-.8l19.4-131.3c2-13.8 8-32.7 25-45.9C278.2 53.2 310.5 37 363.2 32.2c-.8-.7-1.6-1.4-2.4-2.1C340.6 14.5 288.4-11.5 175.7 5.6S20.5 63 5.7 83.9C0 91.9-.8 102 .6 111.8L24.8 276.1c5.5 37.3 21.5 72.6 49.8 97.2zm87.7-219.6c4.4-3.1 10.8-2 11.8 3.3c.1 .5 .2 1.1 .3 1.6c3.2 21.8-11.6 42-33.1 45.3s-41.5-11.8-44.7-33.5c-.1-.5-.1-1.1-.2-1.6c-.6-5.4 5.2-8.4 10.3-6.7c9 3 18.8 3.9 28.7 2.4s19.1-5.3 26.8-10.8zM261.6 390c29.4 46.9 79.5 110.9 137.6 119.7s124.5-37.5 166.1-73.7c28.3-24.5 44.3-59.8 49.8-97.2l24.2-164.3c1.4-9.8 .6-19.9-5.1-27.9c-14.8-20.9-57.3-61.2-170-78.3S299.4 77.2 279.2 92.8c-7.8 6-11.5 15.4-12.9 25.2L242.1 282.3c-5.5 37.3-.4 75.8 19.6 107.7zM404.5 235.3c-7.7-5.5-16.8-9.3-26.8-10.8s-19.8-.6-28.7 2.4c-5.1 1.7-10.9-1.3-10.3-6.7c.1-.5 .1-1.1 .2-1.6c3.2-21.8 23.2-36.8 44.7-33.5s36.3 23.5 33.1 45.3c-.1 .5-.2 1.1-.3 1.6c-1 5.3-7.4 6.4-11.8 3.3zm136.2 15.5c-1 5.3-7.4 6.4-11.8 3.3c-7.7-5.5-16.8-9.3-26.8-10.8s-19.8-.6-28.7 2.4c-5.1 1.7-10.9-1.3-10.3-6.7c.1-.5 .1-1.1 .2-1.6c3.2-21.8 23.2-36.8 44.7-33.5s36.3 23.5 33.1 45.3c-.1 .5-.2 1.1-.3 1.6zM530 350.2c-19.6 44.7-66.8 72.5-116.8 64.9s-87.1-48.2-93-96.7c-1-8.3 8.9-12.1 15.2-6.7c23.9 20.8 53.6 35.3 87 40.3s66.1 .1 94.9-12.8c7.6-3.4 16 3.2 12.6 10.9z"]
};
const faTheaterMasks = faMasksTheater;
const faKipSign = {
  prefix: 'fas',
  iconName: 'kip-sign',
  icon: [384, 512, [], "e1c4", "M340.8 88.3c13.4-11.5 15-31.7 3.5-45.1s-31.7-15-45.1-3.5L128 186.4 128 64c0-17.7-14.3-32-32-32S64 46.3 64 64l0 160-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-122.4L299.2 472.3c13.4 11.5 33.6 9.9 45.1-3.5s9.9-33.6-3.5-45.1L182.5 288 352 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-169.5 0L340.8 88.3z"]
};
const faHandPointLeft = {
  prefix: 'fas',
  iconName: 'hand-point-left',
  icon: [512, 512, [], "f0a5", "M32 96C14.3 96 0 110.3 0 128s14.3 32 32 32l208 0 0-64L32 96zM192 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0zm-64-64c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-48 0c-17.7 0-32 14.3-32 32zm96 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0zm88-96l-.6 0c5.4 9.4 8.6 20.3 8.6 32c0 13.2-4 25.4-10.8 35.6c24.9 8.7 42.8 32.5 42.8 60.4c0 11.7-3.1 22.6-8.6 32l8.6 0c88.4 0 160-71.6 160-160l0-61.7c0-42.4-16.9-83.1-46.9-113.1l-11.6-11.6C429.5 77.5 396.9 64 363 64l-27 0c-35.3 0-64 28.7-64 64l0 88c0 22.1 17.9 40 40 40s40-17.9 40-40l0-56c0-8.8 7.2-16 16-16s16 7.2 16 16l0 56c0 39.8-32.2 72-72 72z"]
};
const faHandshakeSimple = {
  prefix: 'fas',
  iconName: 'handshake-simple',
  icon: [640, 512, [129309, "handshake-alt"], "f4c6", "M323.4 85.2l-96.8 78.4c-16.1 13-19.2 36.4-7 53.1c12.9 17.8 38 21.3 55.3 7.8l99.3-77.2c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L550.2 352l41.8 0c26.5 0 48-21.5 48-48l0-128c0-26.5-21.5-48-48-48l-76 0-4 0-.7 0-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2zm22.8 124.4l-51.7 40.2C263 274.4 217.3 268 193.7 235.6c-22.2-30.5-16.6-73.1 12.7-96.8l83.2-67.3c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-72 48-80 0c-26.5 0-48 21.5-48 48L0 304c0 26.5 21.5 48 48 48l108.2 0 91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c4.5-4.9 7.8-10.6 9.9-16.5c19.4 13 45.8 10.3 62.1-7.5c17.9-19.5 16.6-49.9-2.9-67.8l-134.2-123z"]
};
const faHandshakeAlt = faHandshakeSimple;
const faJetFighter = {
  prefix: 'fas',
  iconName: 'jet-fighter',
  icon: [640, 512, ["fighter-jet"], "f0fb", "M160 24c0-13.3 10.7-24 24-24L296 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0L384 192l116.4 0c7.7 0 15.3 1.4 22.5 4.1L625 234.4c9 3.4 15 12 15 21.6s-6 18.2-15 21.6L522.9 315.9c-7.2 2.7-14.8 4.1-22.5 4.1L384 320 280 464l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-112 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-144-32 0-54.6 54.6c-6 6-14.1 9.4-22.6 9.4L64 384c-17.7 0-32-14.3-32-32l0-64c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c0-17.7 14.3-32 32-32l18.7 0c8.5 0 16.6 3.4 22.6 9.4L160 192l32 0 0-144-8 0c-13.3 0-24-10.7-24-24zM80 240c-8.8 0-16 7.2-16 16s7.2 16 16 16l64 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0z"]
};
const faFighterJet = faJetFighter;
const faSquareShareNodes = {
  prefix: 'fas',
  iconName: 'square-share-nodes',
  icon: [448, 512, ["share-alt-square"], "f1e1", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM384 160c0 35.3-28.7 64-64 64c-15.4 0-29.5-5.4-40.6-14.5L194.1 256l85.3 46.5c11-9.1 25.2-14.5 40.6-14.5c35.3 0 64 28.7 64 64s-28.7 64-64 64s-64-28.7-64-64c0-2.5 .1-4.9 .4-7.3L174.5 300c-11.7 12.3-28.2 20-46.5 20c-35.3 0-64-28.7-64-64s28.7-64 64-64c18.3 0 34.8 7.7 46.5 20l81.9-44.7c-.3-2.4-.4-4.9-.4-7.3c0-35.3 28.7-64 64-64s64 28.7 64 64z"]
};
const faShareAltSquare = faSquareShareNodes;
const faBarcode = {
  prefix: 'fas',
  iconName: 'barcode',
  icon: [512, 512, [], "f02a", "M24 32C10.7 32 0 42.7 0 56L0 456c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24L64 56c0-13.3-10.7-24-24-24L24 32zm88 0c-8.8 0-16 7.2-16 16l0 416c0 8.8 7.2 16 16 16s16-7.2 16-16l0-416c0-8.8-7.2-16-16-16zm72 0c-13.3 0-24 10.7-24 24l0 400c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-400c0-13.3-10.7-24-24-24l-16 0zm96 0c-13.3 0-24 10.7-24 24l0 400c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-400c0-13.3-10.7-24-24-24l-16 0zM448 56l0 400c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-400c0-13.3-10.7-24-24-24l-16 0c-13.3 0-24 10.7-24 24zm-64-8l0 416c0 8.8 7.2 16 16 16s16-7.2 16-16l0-416c0-8.8-7.2-16-16-16s-16 7.2-16 16z"]
};
const faPlusMinus = {
  prefix: 'fas',
  iconName: 'plus-minus',
  icon: [384, 512, [], "e43c", "M224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112L48 144c-17.7 0-32 14.3-32 32s14.3 32 32 32l112 0 0 112c0 17.7 14.3 32 32 32s32-14.3 32-32l0-112 112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0 0-112zM0 480c0 17.7 14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 448c-17.7 0-32 14.3-32 32z"]
};
const faVideo = {
  prefix: 'fas',
  iconName: 'video',
  icon: [576, 512, ["video-camera"], "f03d", "M0 128C0 92.7 28.7 64 64 64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2l0 256c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1l0-17.1 0-128 0-17.1 14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]
};
const faVideoCamera = faVideo;
const faGraduationCap = {
  prefix: 'fas',
  iconName: 'graduation-cap',
  icon: [640, 512, [127891, "mortar-board"], "f19d", "M320 32c-8.1 0-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6l57.9 20.9C57.3 229.3 48 259.8 48 291.9l0 28.1c0 28.4-10.8 57.7-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7C90.3 344.3 86 329.8 80 316.5l0-24.6c0-30.2 10.2-58.7 27.9-81.5c12.9-15.5 29.6-28 49.2-35.7l157-61.7c8.2-3.2 17.5 .8 20.7 9s-.8 17.5-9 20.7l-157 61.7c-12.4 4.9-23.3 12.4-32.2 21.6l159.6 57.6c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1L624.2 182.6c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1C336.1 33.4 328.1 32 320 32zM128 408c0 35.3 86 72 192 72s192-36.7 192-72L496.7 262.6 354.5 314c-11.1 4-22.8 6-34.5 6s-23.5-2-34.5-6L143.3 262.6 128 408z"]
};
const faMortarBoard = faGraduationCap;
const faHandHoldingMedical = {
  prefix: 'fas',
  iconName: 'hand-holding-medical',
  icon: [576, 512, [], "e05c", "M224 24l0 56-56 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l56 0 0 56c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-56 56 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-56 0 0-56c0-13.3-10.7-24-24-24L248 0c-13.3 0-24 10.7-24 24zM559.7 392.2c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416 272 416c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0-16 0-78.3 0c-29.1 0-57.3 9.9-80 28L68.8 384 32 384c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l160 0 160.5 0c29 0 57.3-9.3 80.7-26.5l126.6-93.3zm-367-8.2l.9 0c0 0 0 0 0 0c-.3 0-.6 0-.9 0z"]
};
const faPersonCircleCheck = {
  prefix: 'fas',
  iconName: 'person-circle-check',
  icon: [576, 512, [], "e53e", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zm136 16a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L416 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faTurnUp = {
  prefix: 'fas',
  iconName: 'turn-up',
  icon: [384, 512, [10548, "level-up-alt"], "f3bf", "M350 177.5c3.8-8.8 2-19-4.6-26l-136-144C204.9 2.7 198.6 0 192 0s-12.9 2.7-17.4 7.5l-136 144c-6.6 7-8.4 17.2-4.6 26s12.5 14.5 22 14.5l88 0 0 192c0 17.7-14.3 32-32 32l-80 0c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l80 0c70.7 0 128-57.3 128-128l0-192 88 0c9.6 0 18.2-5.7 22-14.5z"]
};
const faLevelUpAlt = faTurnUp;
var icons = {
  fa0,
  fa1,
  fa2,
  fa3,
  fa4,
  fa5,
  fa6,
  fa7,
  fa8,
  fa9,
  faFillDrip,
  faArrowsToCircle,
  faCircleChevronRight,
  faChevronCircleRight,
  faAt,
  faTrashCan,
  faTrashAlt,
  faTextHeight,
  faUserXmark,
  faUserTimes,
  faStethoscope,
  faMessage,
  faCommentAlt,
  faInfo,
  faDownLeftAndUpRightToCenter,
  faCompressAlt,
  faExplosion,
  faFileLines,
  faFileAlt,
  faFileText,
  faWaveSquare,
  faRing,
  faBuildingUn,
  faDiceThree,
  faCalendarDays,
  faCalendarAlt,
  faAnchorCircleCheck,
  faBuildingCircleArrowRight,
  faVolleyball,
  faVolleyballBall,
  faArrowsUpToLine,
  faSortDown,
  faSortDesc,
  faCircleMinus,
  faMinusCircle,
  faDoorOpen,
  faRightFromBracket,
  faSignOutAlt,
  faAtom,
  faSoap,
  faIcons,
  faHeartMusicCameraBolt,
  faMicrophoneLinesSlash,
  faMicrophoneAltSlash,
  faBridgeCircleCheck,
  faPumpMedical,
  faFingerprint,
  faHandPointRight,
  faMagnifyingGlassLocation,
  faSearchLocation,
  faForwardStep,
  faStepForward,
  faFaceSmileBeam,
  faSmileBeam,
  faFlagCheckered,
  faFootball,
  faFootballBall,
  faSchoolCircleExclamation,
  faCrop,
  faAnglesDown,
  faAngleDoubleDown,
  faUsersRectangle,
  faPeopleRoof,
  faPeopleLine,
  faBeerMugEmpty,
  faBeer,
  faDiagramPredecessor,
  faArrowUpLong,
  faLongArrowUp,
  faFireFlameSimple,
  faBurn,
  faPerson,
  faMale,
  faLaptop,
  faFileCsv,
  faMenorah,
  faTruckPlane,
  faRecordVinyl,
  faFaceGrinStars,
  faGrinStars,
  faBong,
  faSpaghettiMonsterFlying,
  faPastafarianism,
  faArrowDownUpAcrossLine,
  faSpoon,
  faUtensilSpoon,
  faJarWheat,
  faEnvelopesBulk,
  faMailBulk,
  faFileCircleExclamation,
  faCircleH,
  faHospitalSymbol,
  faPager,
  faAddressBook,
  faContactBook,
  faStrikethrough,
  faK,
  faLandmarkFlag,
  faPencil,
  faPencilAlt,
  faBackward,
  faCaretRight,
  faComments,
  faPaste,
  faFileClipboard,
  faCodePullRequest,
  faClipboardList,
  faTruckRampBox,
  faTruckLoading,
  faUserCheck,
  faVialVirus,
  faSheetPlastic,
  faBlog,
  faUserNinja,
  faPersonArrowUpFromLine,
  faScrollTorah,
  faTorah,
  faBroomBall,
  faQuidditch,
  faQuidditchBroomBall,
  faToggleOff,
  faBoxArchive,
  faArchive,
  faPersonDrowning,
  faArrowDown91,
  faSortNumericDesc,
  faSortNumericDownAlt,
  faFaceGrinTongueSquint,
  faGrinTongueSquint,
  faSprayCan,
  faTruckMonster,
  faW,
  faEarthAfrica,
  faGlobeAfrica,
  faRainbow,
  faCircleNotch,
  faTabletScreenButton,
  faTabletAlt,
  faPaw,
  faCloud,
  faTrowelBricks,
  faFaceFlushed,
  faFlushed,
  faHospitalUser,
  faTentArrowLeftRight,
  faGavel,
  faLegal,
  faBinoculars,
  faMicrophoneSlash,
  faBoxTissue,
  faMotorcycle,
  faBellConcierge,
  faConciergeBell,
  faPenRuler,
  faPencilRuler,
  faPeopleArrows,
  faPeopleArrowsLeftRight,
  faMarsAndVenusBurst,
  faSquareCaretRight,
  faCaretSquareRight,
  faScissors,
  faCut,
  faSunPlantWilt,
  faToiletsPortable,
  faHockeyPuck,
  faTable,
  faMagnifyingGlassArrowRight,
  faTachographDigital,
  faDigitalTachograph,
  faUsersSlash,
  faClover,
  faReply,
  faMailReply,
  faStarAndCrescent,
  faHouseFire,
  faSquareMinus,
  faMinusSquare,
  faHelicopter,
  faCompass,
  faSquareCaretDown,
  faCaretSquareDown,
  faFileCircleQuestion,
  faLaptopCode,
  faSwatchbook,
  faPrescriptionBottle,
  faBars,
  faNavicon,
  faPeopleGroup,
  faHourglassEnd,
  faHourglass3,
  faHeartCrack,
  faHeartBroken,
  faSquareUpRight,
  faExternalLinkSquareAlt,
  faFaceKissBeam,
  faKissBeam,
  faFilm,
  faRulerHorizontal,
  faPeopleRobbery,
  faLightbulb,
  faCaretLeft,
  faCircleExclamation,
  faExclamationCircle,
  faSchoolCircleXmark,
  faArrowRightFromBracket,
  faSignOut,
  faCircleChevronDown,
  faChevronCircleDown,
  faUnlockKeyhole,
  faUnlockAlt,
  faCloudShowersHeavy,
  faHeadphonesSimple,
  faHeadphonesAlt,
  faSitemap,
  faCircleDollarToSlot,
  faDonate,
  faMemory,
  faRoadSpikes,
  faFireBurner,
  faFlag,
  faHanukiah,
  faFeather,
  faVolumeLow,
  faVolumeDown,
  faCommentSlash,
  faCloudSunRain,
  faCompress,
  faWheatAwn,
  faWheatAlt,
  faAnkh,
  faHandsHoldingChild,
  faAsterisk,
  faSquareCheck,
  faCheckSquare,
  faPesetaSign,
  faHeading,
  faHeader,
  faGhost,
  faList,
  faListSquares,
  faSquarePhoneFlip,
  faPhoneSquareAlt,
  faCartPlus,
  faGamepad,
  faCircleDot,
  faDotCircle,
  faFaceDizzy,
  faDizzy,
  faEgg,
  faHouseMedicalCircleXmark,
  faCampground,
  faFolderPlus,
  faFutbol,
  faFutbolBall,
  faSoccerBall,
  faPaintbrush,
  faPaintBrush,
  faLock,
  faGasPump,
  faHotTubPerson,
  faHotTub,
  faMapLocation,
  faMapMarked,
  faHouseFloodWater,
  faTree,
  faBridgeLock,
  faSackDollar,
  faPenToSquare,
  faEdit,
  faCarSide,
  faShareNodes,
  faShareAlt,
  faHeartCircleMinus,
  faHourglassHalf,
  faHourglass2,
  faMicroscope,
  faSink,
  faBagShopping,
  faShoppingBag,
  faArrowDownZA,
  faSortAlphaDesc,
  faSortAlphaDownAlt,
  faMitten,
  faPersonRays,
  faUsers,
  faEyeSlash,
  faFlaskVial,
  faHand,
  faHandPaper,
  faOm,
  faWorm,
  faHouseCircleXmark,
  faPlug,
  faChevronUp,
  faHandSpock,
  faStopwatch,
  faFaceKiss,
  faKiss,
  faBridgeCircleXmark,
  faFaceGrinTongue,
  faGrinTongue,
  faChessBishop,
  faFaceGrinWink,
  faGrinWink,
  faEarDeaf,
  faDeaf,
  faDeafness,
  faHardOfHearing,
  faRoadCircleCheck,
  faDiceFive,
  faSquareRss,
  faRssSquare,
  faLandMineOn,
  faICursor,
  faStamp,
  faStairs,
  faI,
  faHryvniaSign,
  faHryvnia,
  faPills,
  faFaceGrinWide,
  faGrinAlt,
  faTooth,
  faV,
  faBangladeshiTakaSign,
  faBicycle,
  faStaffSnake,
  faRodAsclepius,
  faRodSnake,
  faStaffAesculapius,
  faHeadSideCoughSlash,
  faTruckMedical,
  faAmbulance,
  faWheatAwnCircleExclamation,
  faSnowman,
  faMortarPestle,
  faRoadBarrier,
  faSchool,
  faIgloo,
  faJoint,
  faAngleRight,
  faHorse,
  faQ,
  faG,
  faNotesMedical,
  faTemperatureHalf,
  faTemperature2,
  faThermometer2,
  faThermometerHalf,
  faDongSign,
  faCapsules,
  faPooStorm,
  faPooBolt,
  faFaceFrownOpen,
  faFrownOpen,
  faHandPointUp,
  faMoneyBill,
  faBookmark,
  faAlignJustify,
  faUmbrellaBeach,
  faHelmetUn,
  faBullseye,
  faBacon,
  faHandPointDown,
  faArrowUpFromBracket,
  faFolder,
  faFolderBlank,
  faFileWaveform,
  faFileMedicalAlt,
  faRadiation,
  faChartSimple,
  faMarsStroke,
  faVial,
  faGauge,
  faDashboard,
  faGaugeMed,
  faTachometerAltAverage,
  faWandMagicSparkles,
  faMagicWandSparkles,
  faE,
  faPenClip,
  faPenAlt,
  faBridgeCircleExclamation,
  faUser,
  faSchoolCircleCheck,
  faDumpster,
  faVanShuttle,
  faShuttleVan,
  faBuildingUser,
  faSquareCaretLeft,
  faCaretSquareLeft,
  faHighlighter,
  faKey,
  faBullhorn,
  faGlobe,
  faSynagogue,
  faPersonHalfDress,
  faRoadBridge,
  faLocationArrow,
  faC,
  faTabletButton,
  faBuildingLock,
  faPizzaSlice,
  faMoneyBillWave,
  faChartArea,
  faAreaChart,
  faHouseFlag,
  faPersonCircleMinus,
  faBan,
  faCancel,
  faCameraRotate,
  faSprayCanSparkles,
  faAirFreshener,
  faStar,
  faRepeat,
  faCross,
  faBox,
  faVenusMars,
  faArrowPointer,
  faMousePointer,
  faMaximize,
  faExpandArrowsAlt,
  faChargingStation,
  faShapes,
  faTriangleCircleSquare,
  faShuffle,
  faRandom,
  faPersonRunning,
  faRunning,
  faMobileRetro,
  faGripLinesVertical,
  faSpider,
  faHandsBound,
  faFileInvoiceDollar,
  faPlaneCircleExclamation,
  faXRay,
  faSpellCheck,
  faSlash,
  faComputerMouse,
  faMouse,
  faArrowRightToBracket,
  faSignIn,
  faShopSlash,
  faStoreAltSlash,
  faServer,
  faVirusCovidSlash,
  faShopLock,
  faHourglassStart,
  faHourglass1,
  faBlenderPhone,
  faBuildingWheat,
  faPersonBreastfeeding,
  faRightToBracket,
  faSignInAlt,
  faVenus,
  faPassport,
  faThumbtackSlash,
  faThumbTackSlash,
  faHeartPulse,
  faHeartbeat,
  faPeopleCarryBox,
  faPeopleCarry,
  faTemperatureHigh,
  faMicrochip,
  faCrown,
  faWeightHanging,
  faXmarksLines,
  faFilePrescription,
  faWeightScale,
  faWeight,
  faUserGroup,
  faUserFriends,
  faArrowUpAZ,
  faSortAlphaUp,
  faChessKnight,
  faFaceLaughSquint,
  faLaughSquint,
  faWheelchair,
  faCircleArrowUp,
  faArrowCircleUp,
  faToggleOn,
  faPersonWalking,
  faWalking,
  faL,
  faFire,
  faBedPulse,
  faProcedures,
  faShuttleSpace,
  faSpaceShuttle,
  faFaceLaugh,
  faLaugh,
  faFolderOpen,
  faHeartCirclePlus,
  faCodeFork,
  faCity,
  faMicrophoneLines,
  faMicrophoneAlt,
  faPepperHot,
  faUnlock,
  faColonSign,
  faHeadset,
  faStoreSlash,
  faRoadCircleXmark,
  faUserMinus,
  faMarsStrokeUp,
  faMarsStrokeV,
  faChampagneGlasses,
  faGlassCheers,
  faClipboard,
  faHouseCircleExclamation,
  faFileArrowUp,
  faFileUpload,
  faWifi,
  faWifi3,
  faWifiStrong,
  faBath,
  faBathtub,
  faUnderline,
  faUserPen,
  faUserEdit,
  faSignature,
  faStroopwafel,
  faBold,
  faAnchorLock,
  faBuildingNgo,
  faManatSign,
  faNotEqual,
  faBorderTopLeft,
  faBorderStyle,
  faMapLocationDot,
  faMapMarkedAlt,
  faJedi,
  faSquarePollVertical,
  faPoll,
  faMugHot,
  faCarBattery,
  faBatteryCar,
  faGift,
  faDiceTwo,
  faChessQueen,
  faGlasses,
  faChessBoard,
  faBuildingCircleCheck,
  faPersonChalkboard,
  faMarsStrokeRight,
  faMarsStrokeH,
  faHandBackFist,
  faHandRock,
  faSquareCaretUp,
  faCaretSquareUp,
  faCloudShowersWater,
  faChartBar,
  faBarChart,
  faHandsBubbles,
  faHandsWash,
  faLessThanEqual,
  faTrain,
  faEyeLowVision,
  faLowVision,
  faCrow,
  faSailboat,
  faWindowRestore,
  faSquarePlus,
  faPlusSquare,
  faToriiGate,
  faFrog,
  faBucket,
  faImage,
  faMicrophone,
  faCow,
  faCaretUp,
  faScrewdriver,
  faFolderClosed,
  faHouseTsunami,
  faSquareNfi,
  faArrowUpFromGroundWater,
  faMartiniGlass,
  faGlassMartiniAlt,
  faSquareBinary,
  faRotateLeft,
  faRotateBack,
  faRotateBackward,
  faUndoAlt,
  faTableColumns,
  faColumns,
  faLemon,
  faHeadSideMask,
  faHandshake,
  faGem,
  faDolly,
  faDollyBox,
  faSmoking,
  faMinimize,
  faCompressArrowsAlt,
  faMonument,
  faSnowplow,
  faAnglesRight,
  faAngleDoubleRight,
  faCannabis,
  faCirclePlay,
  faPlayCircle,
  faTablets,
  faEthernet,
  faEuroSign,
  faEur,
  faEuro,
  faChair,
  faCircleCheck,
  faCheckCircle,
  faCircleStop,
  faStopCircle,
  faCompassDrafting,
  faDraftingCompass,
  faPlateWheat,
  faIcicles,
  faPersonShelter,
  faNeuter,
  faIdBadge,
  faMarker,
  faFaceLaughBeam,
  faLaughBeam,
  faHelicopterSymbol,
  faUniversalAccess,
  faCircleChevronUp,
  faChevronCircleUp,
  faLariSign,
  faVolcano,
  faPersonWalkingDashedLineArrowRight,
  faSterlingSign,
  faGbp,
  faPoundSign,
  faViruses,
  faSquarePersonConfined,
  faUserTie,
  faArrowDownLong,
  faLongArrowDown,
  faTentArrowDownToLine,
  faCertificate,
  faReplyAll,
  faMailReplyAll,
  faSuitcase,
  faPersonSkating,
  faSkating,
  faFilterCircleDollar,
  faFunnelDollar,
  faCameraRetro,
  faCircleArrowDown,
  faArrowCircleDown,
  faFileImport,
  faArrowRightToFile,
  faSquareArrowUpRight,
  faExternalLinkSquare,
  faBoxOpen,
  faScroll,
  faSpa,
  faLocationPinLock,
  faPause,
  faHillAvalanche,
  faTemperatureEmpty,
  faTemperature0,
  faThermometer0,
  faThermometerEmpty,
  faBomb,
  faRegistered,
  faAddressCard,
  faContactCard,
  faVcard,
  faScaleUnbalancedFlip,
  faBalanceScaleRight,
  faSubscript,
  faDiamondTurnRight,
  faDirections,
  faBurst,
  faHouseLaptop,
  faLaptopHouse,
  faFaceTired,
  faTired,
  faMoneyBills,
  faSmog,
  faCrutch,
  faFontAwesome,
  faFontAwesomeFlag,
  faFontAwesomeLogoFull,
  faCloudArrowUp,
  faCloudUpload,
  faCloudUploadAlt,
  faPalette,
  faArrowsTurnRight,
  faVest,
  faFerry,
  faArrowsDownToPeople,
  faSeedling,
  faSprout,
  faLeftRight,
  faArrowsAltH,
  faBoxesPacking,
  faCircleArrowLeft,
  faArrowCircleLeft,
  faGroupArrowsRotate,
  faBowlFood,
  faCandyCane,
  faArrowDownWideShort,
  faSortAmountAsc,
  faSortAmountDown,
  faCloudBolt,
  faThunderstorm,
  faTextSlash,
  faRemoveFormat,
  faFaceSmileWink,
  faSmileWink,
  faFileWord,
  faFilePowerpoint,
  faArrowsLeftRight,
  faArrowsH,
  faHouseLock,
  faCloudArrowDown,
  faCloudDownload,
  faCloudDownloadAlt,
  faChildren,
  faChalkboard,
  faBlackboard,
  faUserLargeSlash,
  faUserAltSlash,
  faEnvelopeOpen,
  faHandshakeSimpleSlash,
  faHandshakeAltSlash,
  faMattressPillow,
  faGuaraniSign,
  faArrowsRotate,
  faRefresh,
  faSync,
  faFireExtinguisher,
  faCruzeiroSign,
  faGreaterThanEqual,
  faShieldHalved,
  faShieldAlt,
  faBookAtlas,
  faAtlas,
  faVirus,
  faEnvelopeCircleCheck,
  faLayerGroup,
  faArrowsToDot,
  faArchway,
  faHeartCircleCheck,
  faHouseChimneyCrack,
  faHouseDamage,
  faFileZipper,
  faFileArchive,
  faSquare,
  faMartiniGlassEmpty,
  faGlassMartini,
  faCouch,
  faCediSign,
  faItalic,
  faTableCellsColumnLock,
  faChurch,
  faCommentsDollar,
  faDemocrat,
  faZ,
  faPersonSkiing,
  faSkiing,
  faRoadLock,
  faA,
  faTemperatureArrowDown,
  faTemperatureDown,
  faFeatherPointed,
  faFeatherAlt,
  faP,
  faSnowflake,
  faNewspaper,
  faRectangleAd,
  faAd,
  faCircleArrowRight,
  faArrowCircleRight,
  faFilterCircleXmark,
  faLocust,
  faSort,
  faUnsorted,
  faListOl,
  faList12,
  faListNumeric,
  faPersonDressBurst,
  faMoneyCheckDollar,
  faMoneyCheckAlt,
  faVectorSquare,
  faBreadSlice,
  faLanguage,
  faFaceKissWinkHeart,
  faKissWinkHeart,
  faFilter,
  faQuestion,
  faFileSignature,
  faUpDownLeftRight,
  faArrowsAlt,
  faHouseChimneyUser,
  faHandHoldingHeart,
  faPuzzlePiece,
  faMoneyCheck,
  faStarHalfStroke,
  faStarHalfAlt,
  faCode,
  faWhiskeyGlass,
  faGlassWhiskey,
  faBuildingCircleExclamation,
  faMagnifyingGlassChart,
  faArrowUpRightFromSquare,
  faExternalLink,
  faCubesStacked,
  faWonSign,
  faKrw,
  faWon,
  faVirusCovid,
  faAustralSign,
  faF,
  faLeaf,
  faRoad,
  faTaxi,
  faCab,
  faPersonCirclePlus,
  faChartPie,
  faPieChart,
  faBoltLightning,
  faSackXmark,
  faFileExcel,
  faFileContract,
  faFishFins,
  faBuildingFlag,
  faFaceGrinBeam,
  faGrinBeam,
  faObjectUngroup,
  faPoop,
  faLocationPin,
  faMapMarker,
  faKaaba,
  faToiletPaper,
  faHelmetSafety,
  faHardHat,
  faHatHard,
  faEject,
  faCircleRight,
  faArrowAltCircleRight,
  faPlaneCircleCheck,
  faFaceRollingEyes,
  faMehRollingEyes,
  faObjectGroup,
  faChartLine,
  faLineChart,
  faMaskVentilator,
  faArrowRight,
  faSignsPost,
  faMapSigns,
  faCashRegister,
  faPersonCircleQuestion,
  faH,
  faTarp,
  faScrewdriverWrench,
  faTools,
  faArrowsToEye,
  faPlugCircleBolt,
  faHeart,
  faMarsAndVenus,
  faHouseUser,
  faHomeUser,
  faDumpsterFire,
  faHouseCrack,
  faMartiniGlassCitrus,
  faCocktail,
  faFaceSurprise,
  faSurprise,
  faBottleWater,
  faCirclePause,
  faPauseCircle,
  faToiletPaperSlash,
  faAppleWhole,
  faAppleAlt,
  faKitchenSet,
  faR,
  faTemperatureQuarter,
  faTemperature1,
  faThermometer1,
  faThermometerQuarter,
  faCube,
  faBitcoinSign,
  faShieldDog,
  faSolarPanel,
  faLockOpen,
  faElevator,
  faMoneyBillTransfer,
  faMoneyBillTrendUp,
  faHouseFloodWaterCircleArrowRight,
  faSquarePollHorizontal,
  faPollH,
  faCircle,
  faBackwardFast,
  faFastBackward,
  faRecycle,
  faUserAstronaut,
  faPlaneSlash,
  faTrademark,
  faBasketball,
  faBasketballBall,
  faSatelliteDish,
  faCircleUp,
  faArrowAltCircleUp,
  faMobileScreenButton,
  faMobileAlt,
  faVolumeHigh,
  faVolumeUp,
  faUsersRays,
  faWallet,
  faClipboardCheck,
  faFileAudio,
  faBurger,
  faHamburger,
  faWrench,
  faBugs,
  faRupeeSign,
  faRupee,
  faFileImage,
  faCircleQuestion,
  faQuestionCircle,
  faPlaneDeparture,
  faHandshakeSlash,
  faBookBookmark,
  faCodeBranch,
  faHatCowboy,
  faBridge,
  faPhoneFlip,
  faPhoneAlt,
  faTruckFront,
  faCat,
  faAnchorCircleExclamation,
  faTruckField,
  faRoute,
  faClipboardQuestion,
  faPanorama,
  faCommentMedical,
  faTeethOpen,
  faFileCircleMinus,
  faTags,
  faWineGlass,
  faForwardFast,
  faFastForward,
  faFaceMehBlank,
  faMehBlank,
  faSquareParking,
  faParking,
  faHouseSignal,
  faBarsProgress,
  faTasksAlt,
  faFaucetDrip,
  faCartFlatbed,
  faDollyFlatbed,
  faBanSmoking,
  faSmokingBan,
  faTerminal,
  faMobileButton,
  faHouseMedicalFlag,
  faBasketShopping,
  faShoppingBasket,
  faTape,
  faBusSimple,
  faBusAlt,
  faEye,
  faFaceSadCry,
  faSadCry,
  faAudioDescription,
  faPersonMilitaryToPerson,
  faFileShield,
  faUserSlash,
  faPen,
  faTowerObservation,
  faFileCode,
  faSignal,
  faSignal5,
  faSignalPerfect,
  faBus,
  faHeartCircleXmark,
  faHouseChimney,
  faHomeLg,
  faWindowMaximize,
  faFaceFrown,
  faFrown,
  faPrescription,
  faShop,
  faStoreAlt,
  faFloppyDisk,
  faSave,
  faVihara,
  faScaleUnbalanced,
  faBalanceScaleLeft,
  faSortUp,
  faSortAsc,
  faCommentDots,
  faCommenting,
  faPlantWilt,
  faDiamond,
  faFaceGrinSquint,
  faGrinSquint,
  faHandHoldingDollar,
  faHandHoldingUsd,
  faChartDiagram,
  faBacterium,
  faHandPointer,
  faDrumSteelpan,
  faHandScissors,
  faHandsPraying,
  faPrayingHands,
  faArrowRotateRight,
  faArrowRightRotate,
  faArrowRotateForward,
  faRedo,
  faWebAwesome,
  faBiohazard,
  faLocationCrosshairs,
  faLocation,
  faMarsDouble,
  faChildDress,
  faUsersBetweenLines,
  faLungsVirus,
  faFaceGrinTears,
  faGrinTears,
  faPhone,
  faCalendarXmark,
  faCalendarTimes,
  faChildReaching,
  faHeadSideVirus,
  faUserGear,
  faUserCog,
  faArrowUp19,
  faSortNumericUp,
  faDoorClosed,
  faShieldVirus,
  faDiceSix,
  faMosquitoNet,
  faFileFragment,
  faBridgeWater,
  faPersonBooth,
  faTextWidth,
  faHatWizard,
  faPenFancy,
  faPersonDigging,
  faDigging,
  faTrash,
  faGaugeSimple,
  faGaugeSimpleMed,
  faTachometerAverage,
  faBookMedical,
  faPoo,
  faQuoteRight,
  faQuoteRightAlt,
  faShirt,
  faTShirt,
  faTshirt,
  faCubes,
  faDivide,
  faTengeSign,
  faTenge,
  faHeadphones,
  faHandsHolding,
  faHandsClapping,
  faRepublican,
  faArrowLeft,
  faPersonCircleXmark,
  faRuler,
  faAlignLeft,
  faDiceD6,
  faRestroom,
  faJ,
  faUsersViewfinder,
  faFileVideo,
  faUpRightFromSquare,
  faExternalLinkAlt,
  faTableCells,
  faTh,
  faFilePdf,
  faBookBible,
  faBible,
  faO,
  faSuitcaseMedical,
  faMedkit,
  faUserSecret,
  faOtter,
  faPersonDress,
  faFemale,
  faCommentDollar,
  faBusinessTime,
  faBriefcaseClock,
  faTableCellsLarge,
  faThLarge,
  faBookTanakh,
  faTanakh,
  faPhoneVolume,
  faVolumeControlPhone,
  faHatCowboySide,
  faClipboardUser,
  faChild,
  faLiraSign,
  faSatellite,
  faPlaneLock,
  faTag,
  faComment,
  faCakeCandles,
  faBirthdayCake,
  faCake,
  faEnvelope,
  faAnglesUp,
  faAngleDoubleUp,
  faPaperclip,
  faArrowRightToCity,
  faRibbon,
  faLungs,
  faArrowUp91,
  faSortNumericUpAlt,
  faLitecoinSign,
  faBorderNone,
  faCircleNodes,
  faParachuteBox,
  faIndent,
  faTruckFieldUn,
  faHourglass,
  faHourglassEmpty,
  faMountain,
  faUserDoctor,
  faUserMd,
  faCircleInfo,
  faInfoCircle,
  faCloudMeatball,
  faCamera,
  faCameraAlt,
  faSquareVirus,
  faMeteor,
  faCarOn,
  faSleigh,
  faArrowDown19,
  faSortNumericAsc,
  faSortNumericDown,
  faHandHoldingDroplet,
  faHandHoldingWater,
  faWater,
  faCalendarCheck,
  faBraille,
  faPrescriptionBottleMedical,
  faPrescriptionBottleAlt,
  faLandmark,
  faTruck,
  faCrosshairs,
  faPersonCane,
  faTent,
  faVestPatches,
  faCheckDouble,
  faArrowDownAZ,
  faSortAlphaAsc,
  faSortAlphaDown,
  faMoneyBillWheat,
  faCookie,
  faArrowRotateLeft,
  faArrowLeftRotate,
  faArrowRotateBack,
  faArrowRotateBackward,
  faUndo,
  faHardDrive,
  faHdd,
  faFaceGrinSquintTears,
  faGrinSquintTears,
  faDumbbell,
  faRectangleList,
  faListAlt,
  faTarpDroplet,
  faHouseMedicalCircleCheck,
  faPersonSkiingNordic,
  faSkiingNordic,
  faCalendarPlus,
  faPlaneArrival,
  faCircleLeft,
  faArrowAltCircleLeft,
  faTrainSubway,
  faSubway,
  faChartGantt,
  faIndianRupeeSign,
  faIndianRupee,
  faInr,
  faCropSimple,
  faCropAlt,
  faMoneyBill1,
  faMoneyBillAlt,
  faLeftLong,
  faLongArrowAltLeft,
  faDna,
  faVirusSlash,
  faMinus,
  faSubtract,
  faChess,
  faArrowLeftLong,
  faLongArrowLeft,
  faPlugCircleCheck,
  faStreetView,
  faFrancSign,
  faVolumeOff,
  faHandsAslInterpreting,
  faAmericanSignLanguageInterpreting,
  faAslInterpreting,
  faHandsAmericanSignLanguageInterpreting,
  faGear,
  faCog,
  faDropletSlash,
  faTintSlash,
  faMosque,
  faMosquito,
  faStarOfDavid,
  faPersonMilitaryRifle,
  faCartShopping,
  faShoppingCart,
  faVials,
  faPlugCirclePlus,
  faPlaceOfWorship,
  faGripVertical,
  faHexagonNodes,
  faArrowTurnUp,
  faLevelUp,
  faU,
  faSquareRootVariable,
  faSquareRootAlt,
  faClock,
  faClockFour,
  faBackwardStep,
  faStepBackward,
  faPallet,
  faFaucet,
  faBaseballBatBall,
  faS,
  faTimeline,
  faKeyboard,
  faCaretDown,
  faHouseChimneyMedical,
  faClinicMedical,
  faTemperatureThreeQuarters,
  faTemperature3,
  faThermometer3,
  faThermometerThreeQuarters,
  faMobileScreen,
  faMobileAndroidAlt,
  faPlaneUp,
  faPiggyBank,
  faBatteryHalf,
  faBattery3,
  faMountainCity,
  faCoins,
  faKhanda,
  faSliders,
  faSlidersH,
  faFolderTree,
  faNetworkWired,
  faMapPin,
  faHamsa,
  faCentSign,
  faFlask,
  faPersonPregnant,
  faWandSparkles,
  faEllipsisVertical,
  faEllipsisV,
  faTicket,
  faPowerOff,
  faRightLong,
  faLongArrowAltRight,
  faFlagUsa,
  faLaptopFile,
  faTty,
  faTeletype,
  faDiagramNext,
  faPersonRifle,
  faHouseMedicalCircleExclamation,
  faClosedCaptioning,
  faPersonHiking,
  faHiking,
  faVenusDouble,
  faImages,
  faCalculator,
  faPeoplePulling,
  faN,
  faCableCar,
  faTram,
  faCloudRain,
  faBuildingCircleXmark,
  faShip,
  faArrowsDownToLine,
  faDownload,
  faFaceGrin,
  faGrin,
  faDeleteLeft,
  faBackspace,
  faEyeDropper,
  faEyeDropperEmpty,
  faEyedropper,
  faFileCircleCheck,
  faForward,
  faMobile,
  faMobileAndroid,
  faMobilePhone,
  faFaceMeh,
  faMeh,
  faAlignCenter,
  faBookSkull,
  faBookDead,
  faIdCard,
  faDriversLicense,
  faOutdent,
  faDedent,
  faHeartCircleExclamation,
  faHouse,
  faHome,
  faHomeAlt,
  faHomeLgAlt,
  faCalendarWeek,
  faLaptopMedical,
  faB,
  faFileMedical,
  faDiceOne,
  faKiwiBird,
  faArrowRightArrowLeft,
  faExchange,
  faRotateRight,
  faRedoAlt,
  faRotateForward,
  faUtensils,
  faCutlery,
  faArrowUpWideShort,
  faSortAmountUp,
  faMillSign,
  faBowlRice,
  faSkull,
  faTowerBroadcast,
  faBroadcastTower,
  faTruckPickup,
  faUpLong,
  faLongArrowAltUp,
  faStop,
  faCodeMerge,
  faUpload,
  faHurricane,
  faMound,
  faToiletPortable,
  faCompactDisc,
  faFileArrowDown,
  faFileDownload,
  faCaravan,
  faShieldCat,
  faBolt,
  faZap,
  faGlassWater,
  faOilWell,
  faVault,
  faMars,
  faToilet,
  faPlaneCircleXmark,
  faYenSign,
  faCny,
  faJpy,
  faRmb,
  faYen,
  faRubleSign,
  faRouble,
  faRub,
  faRuble,
  faSun,
  faGuitar,
  faFaceLaughWink,
  faLaughWink,
  faHorseHead,
  faBoreHole,
  faIndustry,
  faCircleDown,
  faArrowAltCircleDown,
  faArrowsTurnToDots,
  faFlorinSign,
  faArrowDownShortWide,
  faSortAmountDesc,
  faSortAmountDownAlt,
  faLessThan,
  faAngleDown,
  faCarTunnel,
  faHeadSideCough,
  faGripLines,
  faThumbsDown,
  faUserLock,
  faArrowRightLong,
  faLongArrowRight,
  faAnchorCircleXmark,
  faEllipsis,
  faEllipsisH,
  faChessPawn,
  faKitMedical,
  faFirstAid,
  faPersonThroughWindow,
  faToolbox,
  faHandsHoldingCircle,
  faBug,
  faCreditCard,
  faCreditCardAlt,
  faCar,
  faAutomobile,
  faHandHoldingHand,
  faBookOpenReader,
  faBookReader,
  faMountainSun,
  faArrowsLeftRightToLine,
  faDiceD20,
  faTruckDroplet,
  faFileCircleXmark,
  faTemperatureArrowUp,
  faTemperatureUp,
  faMedal,
  faBed,
  faSquareH,
  faHSquare,
  faPodcast,
  faTemperatureFull,
  faTemperature4,
  faThermometer4,
  faThermometerFull,
  faBell,
  faSuperscript,
  faPlugCircleXmark,
  faStarOfLife,
  faPhoneSlash,
  faPaintRoller,
  faHandshakeAngle,
  faHandsHelping,
  faLocationDot,
  faMapMarkerAlt,
  faFile,
  faGreaterThan,
  faPersonSwimming,
  faSwimmer,
  faArrowDown,
  faDroplet,
  faTint,
  faEraser,
  faEarthAmericas,
  faEarth,
  faEarthAmerica,
  faGlobeAmericas,
  faPersonBurst,
  faDove,
  faBatteryEmpty,
  faBattery0,
  faSocks,
  faInbox,
  faSection,
  faGaugeHigh,
  faTachometerAlt,
  faTachometerAltFast,
  faEnvelopeOpenText,
  faHospital,
  faHospitalAlt,
  faHospitalWide,
  faWineBottle,
  faChessRook,
  faBarsStaggered,
  faReorder,
  faStream,
  faDharmachakra,
  faHotdog,
  faPersonWalkingWithCane,
  faBlind,
  faDrum,
  faIceCream,
  faHeartCircleBolt,
  faFax,
  faParagraph,
  faCheckToSlot,
  faVoteYea,
  faStarHalf,
  faBoxesStacked,
  faBoxes,
  faBoxesAlt,
  faLink,
  faChain,
  faEarListen,
  faAssistiveListeningSystems,
  faTreeCity,
  faPlay,
  faFont,
  faTableCellsRowLock,
  faRupiahSign,
  faMagnifyingGlass,
  faSearch,
  faTableTennisPaddleBall,
  faPingPongPaddleBall,
  faTableTennis,
  faPersonDotsFromLine,
  faDiagnoses,
  faTrashCanArrowUp,
  faTrashRestoreAlt,
  faNairaSign,
  faCartArrowDown,
  faWalkieTalkie,
  faFilePen,
  faFileEdit,
  faReceipt,
  faSquarePen,
  faPenSquare,
  faPencilSquare,
  faSuitcaseRolling,
  faPersonCircleExclamation,
  faChevronDown,
  faBatteryFull,
  faBattery,
  faBattery5,
  faSkullCrossbones,
  faCodeCompare,
  faListUl,
  faListDots,
  faSchoolLock,
  faTowerCell,
  faDownLong,
  faLongArrowAltDown,
  faRankingStar,
  faChessKing,
  faPersonHarassing,
  faBrazilianRealSign,
  faLandmarkDome,
  faLandmarkAlt,
  faArrowUp,
  faTv,
  faTelevision,
  faTvAlt,
  faShrimp,
  faListCheck,
  faTasks,
  faJugDetergent,
  faCircleUser,
  faUserCircle,
  faUserShield,
  faWind,
  faCarBurst,
  faCarCrash,
  faY,
  faPersonSnowboarding,
  faSnowboarding,
  faTruckFast,
  faShippingFast,
  faFish,
  faUserGraduate,
  faCircleHalfStroke,
  faAdjust,
  faClapperboard,
  faCircleRadiation,
  faRadiationAlt,
  faBaseball,
  faBaseballBall,
  faJetFighterUp,
  faDiagramProject,
  faProjectDiagram,
  faCopy,
  faVolumeXmark,
  faVolumeMute,
  faVolumeTimes,
  faHandSparkles,
  faGrip,
  faGripHorizontal,
  faShareFromSquare,
  faShareSquare,
  faChildCombatant,
  faChildRifle,
  faGun,
  faSquarePhone,
  faPhoneSquare,
  faPlus,
  faAdd,
  faExpand,
  faComputer,
  faXmark,
  faClose,
  faMultiply,
  faRemove,
  faTimes,
  faArrowsUpDownLeftRight,
  faArrows,
  faChalkboardUser,
  faChalkboardTeacher,
  faPesoSign,
  faBuildingShield,
  faBaby,
  faUsersLine,
  faQuoteLeft,
  faQuoteLeftAlt,
  faTractor,
  faTrashArrowUp,
  faTrashRestore,
  faArrowDownUpLock,
  faLinesLeaning,
  faRulerCombined,
  faCopyright,
  faEquals,
  faBlender,
  faTeeth,
  faShekelSign,
  faIls,
  faShekel,
  faSheqel,
  faSheqelSign,
  faMap,
  faRocket,
  faPhotoFilm,
  faPhotoVideo,
  faFolderMinus,
  faHexagonNodesBolt,
  faStore,
  faArrowTrendUp,
  faPlugCircleMinus,
  faSignHanging,
  faSign,
  faBezierCurve,
  faBellSlash,
  faTablet,
  faTabletAndroid,
  faSchoolFlag,
  faFill,
  faAngleUp,
  faDrumstickBite,
  faHollyBerry,
  faChevronLeft,
  faBacteria,
  faHandLizard,
  faNotdef,
  faDisease,
  faBriefcaseMedical,
  faGenderless,
  faChevronRight,
  faRetweet,
  faCarRear,
  faCarAlt,
  faPumpSoap,
  faVideoSlash,
  faBatteryQuarter,
  faBattery2,
  faRadio,
  faBabyCarriage,
  faCarriageBaby,
  faTrafficLight,
  faThermometer,
  faVrCardboard,
  faHandMiddleFinger,
  faPercent,
  faPercentage,
  faTruckMoving,
  faGlassWaterDroplet,
  faDisplay,
  faFaceSmile,
  faSmile,
  faThumbtack,
  faThumbTack,
  faTrophy,
  faPersonPraying,
  faPray,
  faHammer,
  faHandPeace,
  faRotate,
  faSyncAlt,
  faSpinner,
  faRobot,
  faPeace,
  faGears,
  faCogs,
  faWarehouse,
  faArrowUpRightDots,
  faSplotch,
  faFaceGrinHearts,
  faGrinHearts,
  faDiceFour,
  faSimCard,
  faTransgender,
  faTransgenderAlt,
  faMercury,
  faArrowTurnDown,
  faLevelDown,
  faPersonFallingBurst,
  faAward,
  faTicketSimple,
  faTicketAlt,
  faBuilding,
  faAnglesLeft,
  faAngleDoubleLeft,
  faQrcode,
  faClockRotateLeft,
  faHistory,
  faFaceGrinBeamSweat,
  faGrinBeamSweat,
  faFileExport,
  faArrowRightFromFile,
  faShield,
  faShieldBlank,
  faArrowUpShortWide,
  faSortAmountUpAlt,
  faCommentNodes,
  faHouseMedical,
  faGolfBallTee,
  faGolfBall,
  faCircleChevronLeft,
  faChevronCircleLeft,
  faHouseChimneyWindow,
  faPenNib,
  faTentArrowTurnLeft,
  faTents,
  faWandMagic,
  faMagic,
  faDog,
  faCarrot,
  faMoon,
  faWineGlassEmpty,
  faWineGlassAlt,
  faCheese,
  faYinYang,
  faMusic,
  faCodeCommit,
  faTemperatureLow,
  faPersonBiking,
  faBiking,
  faBroom,
  faShieldHeart,
  faGopuram,
  faEarthOceania,
  faGlobeOceania,
  faSquareXmark,
  faTimesSquare,
  faXmarkSquare,
  faHashtag,
  faUpRightAndDownLeftFromCenter,
  faExpandAlt,
  faOilCan,
  faT,
  faHippo,
  faChartColumn,
  faInfinity,
  faVialCircleCheck,
  faPersonArrowDownToLine,
  faVoicemail,
  faFan,
  faPersonWalkingLuggage,
  faUpDown,
  faArrowsAltV,
  faCloudMoonRain,
  faCalendar,
  faTrailer,
  faBahai,
  faHaykal,
  faSdCard,
  faDragon,
  faShoePrints,
  faCirclePlus,
  faPlusCircle,
  faFaceGrinTongueWink,
  faGrinTongueWink,
  faHandHolding,
  faPlugCircleExclamation,
  faLinkSlash,
  faChainBroken,
  faChainSlash,
  faUnlink,
  faClone,
  faPersonWalkingArrowLoopLeft,
  faArrowUpZA,
  faSortAlphaUpAlt,
  faFireFlameCurved,
  faFireAlt,
  faTornado,
  faFileCirclePlus,
  faBookQuran,
  faQuran,
  faAnchor,
  faBorderAll,
  faFaceAngry,
  faAngry,
  faCookieBite,
  faArrowTrendDown,
  faRss,
  faFeed,
  faDrawPolygon,
  faScaleBalanced,
  faBalanceScale,
  faGaugeSimpleHigh,
  faTachometer,
  faTachometerFast,
  faShower,
  faDesktop,
  faDesktopAlt,
  faM,
  faTableList,
  faThList,
  faCommentSms,
  faSms,
  faBook,
  faUserPlus,
  faCheck,
  faBatteryThreeQuarters,
  faBattery4,
  faHouseCircleCheck,
  faAngleLeft,
  faDiagramSuccessor,
  faTruckArrowRight,
  faArrowsSplitUpAndLeft,
  faHandFist,
  faFistRaised,
  faCloudMoon,
  faBriefcase,
  faPersonFalling,
  faImagePortrait,
  faPortrait,
  faUserTag,
  faRug,
  faEarthEurope,
  faGlobeEurope,
  faCartFlatbedSuitcase,
  faLuggageCart,
  faRectangleXmark,
  faRectangleTimes,
  faTimesRectangle,
  faWindowClose,
  faBahtSign,
  faBookOpen,
  faBookJournalWhills,
  faJournalWhills,
  faHandcuffs,
  faTriangleExclamation,
  faExclamationTriangle,
  faWarning,
  faDatabase,
  faShare,
  faMailForward,
  faBottleDroplet,
  faMaskFace,
  faHillRockslide,
  faRightLeft,
  faExchangeAlt,
  faPaperPlane,
  faRoadCircleExclamation,
  faDungeon,
  faAlignRight,
  faMoneyBill1Wave,
  faMoneyBillWaveAlt,
  faLifeRing,
  faHands,
  faSignLanguage,
  faSigning,
  faCalendarDay,
  faWaterLadder,
  faLadderWater,
  faSwimmingPool,
  faArrowsUpDown,
  faArrowsV,
  faFaceGrimace,
  faGrimace,
  faWheelchairMove,
  faWheelchairAlt,
  faTurnDown,
  faLevelDownAlt,
  faPersonWalkingArrowRight,
  faSquareEnvelope,
  faEnvelopeSquare,
  faDice,
  faBowlingBall,
  faBrain,
  faBandage,
  faBandAid,
  faCalendarMinus,
  faCircleXmark,
  faTimesCircle,
  faXmarkCircle,
  faGifts,
  faHotel,
  faEarthAsia,
  faGlobeAsia,
  faIdCardClip,
  faIdCardAlt,
  faMagnifyingGlassPlus,
  faSearchPlus,
  faThumbsUp,
  faUserClock,
  faHandDots,
  faAllergies,
  faFileInvoice,
  faWindowMinimize,
  faMugSaucer,
  faCoffee,
  faBrush,
  faFileHalfDashed,
  faMask,
  faMagnifyingGlassMinus,
  faSearchMinus,
  faRulerVertical,
  faUserLarge,
  faUserAlt,
  faTrainTram,
  faUserNurse,
  faSyringe,
  faCloudSun,
  faStopwatch20,
  faSquareFull,
  faMagnet,
  faJar,
  faNoteSticky,
  faStickyNote,
  faBugSlash,
  faArrowUpFromWaterPump,
  faBone,
  faTableCellsRowUnlock,
  faUserInjured,
  faFaceSadTear,
  faSadTear,
  faPlane,
  faTentArrowsDown,
  faExclamation,
  faArrowsSpin,
  faPrint,
  faTurkishLiraSign,
  faTry,
  faTurkishLira,
  faDollarSign,
  faDollar,
  faUsd,
  faX,
  faMagnifyingGlassDollar,
  faSearchDollar,
  faUsersGear,
  faUsersCog,
  faPersonMilitaryPointing,
  faBuildingColumns,
  faBank,
  faInstitution,
  faMuseum,
  faUniversity,
  faUmbrella,
  faTrowel,
  faD,
  faStapler,
  faMasksTheater,
  faTheaterMasks,
  faKipSign,
  faHandPointLeft,
  faHandshakeSimple,
  faHandshakeAlt,
  faJetFighter,
  faFighterJet,
  faSquareShareNodes,
  faShareAltSquare,
  faBarcode,
  faPlusMinus,
  faVideo,
  faVideoCamera,
  faGraduationCap,
  faMortarBoard,
  faHandHoldingMedical,
  faPersonCircleCheck,
  faTurnUp,
  faLevelUpAlt
};




/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __nested_webpack_require_3515437__(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] = {
/******/ 			id: moduleId,
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_3515437__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__nested_webpack_require_3515437__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__nested_webpack_require_3515437__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__nested_webpack_require_3515437__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__nested_webpack_require_3515437__.o(definition, key) && !__nested_webpack_require_3515437__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	(() => {
/******/ 		__nested_webpack_require_3515437__.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 */
/******/ 	(() => {
/******/ 		__nested_webpack_require_3515437__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__nested_webpack_require_3515437__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/nonce */
/******/ 	(() => {
/******/ 		__nested_webpack_require_3515437__.nc = undefined;
/******/ 	})();
/******/ 	
/************************************************************************/
var __nested_webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
/*!**********************!*\
  !*** ./src/index.ts ***!
  \**********************/
__nested_webpack_require_3515437__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3515437__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   guiEditor: () => (/* reexport module object */ gui_editor_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__)
/* harmony export */ });
/* harmony import */ var gui_editor_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3515437__(/*! gui-editor/legacy/legacy */ "../../../tools/guiEditor/dist/legacy/legacy.js");


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

})();

__nested_webpack_exports__ = __nested_webpack_exports__["default"];
/******/ 	return __nested_webpack_exports__;
/******/ })()
;
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64, 

/***/ }),

/***/ 35652:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

(function webpackUniversalModuleDefinition(root, factory) {
	if(true)
		module.exports = factory(__webpack_require__(73776), __webpack_require__(92552), __webpack_require__(73776), __webpack_require__(17159), __webpack_require__(5817), __webpack_require__(45263), __webpack_require__(27635));
	else {}
})((typeof self !== "undefined" ? self : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : this), (__WEBPACK_EXTERNAL_MODULE_core_Misc_observable__, __WEBPACK_EXTERNAL_MODULE_materials_grid_gridMaterial__, __WEBPACK_EXTERNAL_MODULE_core_Debug_physicsViewer__, __WEBPACK_EXTERNAL_MODULE_gui_2D_adtInstrumentation__, __WEBPACK_EXTERNAL_MODULE_gui_editor_guiEditor__, __WEBPACK_EXTERNAL_MODULE_loaders_glTF_index__, __WEBPACK_EXTERNAL_MODULE_serializers_glTF_2_0_index__) => {
return /******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/actionTabs.scss":
/*!**********************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/actionTabs.scss ***!
  \**********************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_2599__) => {

"use strict";
__nested_webpack_require_2599__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2599__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2599__(/*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2599__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2599__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2599__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2599__(/*! ../../../../../../node_modules/css-loader/dist/runtime/getUrl.js */ "../../../../node_modules/css-loader/dist/runtime/getUrl.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2599__.n(_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__);
// Imports



var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __nested_webpack_require_2599__(/*! data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 2 2%27%3E%3Cpath fill=%27rgba%281.0,1.0,1.0,0.3%29%27 fill-rule=%27evenodd%27 d=%27M0 0h1v1H0V0zm1 1h1v1H1V1z%27/%3E%3C/svg%3E */ "data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 2 2%27%3E%3Cpath fill=%27rgba%281.0,1.0,1.0,0.3%29%27 fill-rule=%27evenodd%27 d=%27M0 0h1v1H0V0zm1 1h1v1H1V1z%27/%3E%3C/svg%3E"), __nested_webpack_require_2599__.b);
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___);
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#inspector-host {
  position: absolute;
  right: 0px;
  top: 0px;
  bottom: 0px;
}

#__resizable_base__ {
  display: none;
}

#actionTabs {
  background: #333333;
  height: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  font: 14px "Arial";
  overflow: hidden;
}
#actionTabs .hoverIcon:hover {
  opacity: 0.8;
}
#actionTabs #header {
  height: 30px;
  font-size: 16px;
  color: white;
  background: #222222;
  grid-row: 1;
  text-align: center;
  display: grid;
  grid-template-columns: 30px 1fr 50px;
  user-select: none;
}
#actionTabs #header #logo {
  grid-column: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-self: center;
  justify-self: center;
}
#actionTabs #header #back {
  grid-column: 1;
  display: grid;
  align-self: center;
  justify-self: center;
  cursor: pointer;
}
#actionTabs #header #title {
  grid-column: 2;
  display: grid;
  align-items: center;
  text-align: center;
}
#actionTabs #header #commands {
  grid-column: 3;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 1fr;
}
#actionTabs #header #commands .expand {
  grid-column: 1;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs #header #commands .close {
  grid-column: 2;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu {
  display: grid;
  grid-row: 2;
  grid-template-rows: 40px 1fr;
  font: 14px "Arial";
  overflow: hidden;
}
#actionTabs .tabsMenu .labels {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-items: center;
  border-bottom: 1px solid #ffffff;
  margin: 0;
  padding: 0;
}
#actionTabs .tabsMenu .labels .label {
  font-size: 24px;
  color: white;
  width: 40px;
  display: flex;
  align-content: center;
  justify-content: center;
  border: 1px solid transparent;
  border-bottom: none;
  background: #333333;
  padding: 5px;
  height: 28px;
  cursor: pointer;
}
#actionTabs .tabsMenu .labels .label.active {
  border-color: #ffffff;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
#actionTabs .tabsMenu .panes {
  grid-row: 2;
  display: grid;
  grid-template-rows: 100%;
  overflow: hidden;
}
#actionTabs .tabsMenu .panes .infoMessage {
  opacity: 0.5;
  color: white;
  margin: 15px 5px 0px 5px;
}
#actionTabs .tabsMenu .panes .gradient-step {
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 20px 30px 40px auto 20px 30px;
  padding-top: 5px;
  padding-left: 5px;
  padding-bottom: 5px;
  align-items: center;
}
#actionTabs .tabsMenu .panes .gradient-step .step {
  grid-row: 1;
  grid-column: 1;
}
#actionTabs .tabsMenu .panes .gradient-step .color1 {
  height: 100%;
}
#actionTabs .tabsMenu .panes .gradient-step .color2 {
  height: 100%;
  padding-left: 5px;
}
#actionTabs .tabsMenu .panes .gradient-step .factor1 {
  grid-row: 1;
  grid-column: 2;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .gradient-step .factor2 {
  padding-left: 5px;
  grid-row: 1;
  grid-column: 3;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .gradient-step .factor2 .grayed {
  background: gray;
  border-color: gray;
}
#actionTabs .tabsMenu .panes .gradient-step .numeric-input {
  width: calc(100% - 5px);
}
#actionTabs .tabsMenu .panes .gradient-step .icon {
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .gradient-step .step-value {
  margin-left: 5px;
  grid-row: 1;
  grid-column: 3;
  text-align: right;
  margin-right: 5px;
}
#actionTabs .tabsMenu .panes .gradient-step .step-slider {
  grid-row: 1;
  grid-column: 4;
  display: grid;
  justify-content: stretch;
  align-content: center;
  margin-right: 12px;
}
#actionTabs .tabsMenu .panes .gradient-step .step-slider input {
  width: 100%;
}
#actionTabs .tabsMenu .panes .gradient-step .step-slider .range:hover {
  opacity: 1;
}
#actionTabs .tabsMenu .panes .gradient-step .step-slider .range {
  -webkit-appearance: none;
  height: 6px;
  background: #d3d3d3;
  border-radius: 5px;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
#actionTabs .tabsMenu .panes .gradient-step .step-slider .range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgb(51, 122, 183);
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .gradient-step .step-slider .range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgb(51, 122, 183);
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .gradient-step .gradient-copy {
  grid-row: 1;
  grid-column: 5;
  display: grid;
  align-content: center;
  justify-content: center;
}
#actionTabs .tabsMenu .panes .gradient-step .gradient-copy .img {
  height: 20px;
  width: 20px;
}
#actionTabs .tabsMenu .panes .gradient-step .gradient-copy .img:hover {
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .gradient-step .gradient-delete {
  grid-row: 1;
  grid-column: 6;
  display: grid;
  align-content: center;
  justify-content: center;
}
#actionTabs .tabsMenu .panes .gradient-step .gradient-delete .img {
  height: 20px;
  width: 20px;
}
#actionTabs .tabsMenu .panes .gradient-step .gradient-delete .img:hover {
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane {
  color: white;
  overflow-x: hidden;
  overflow-y: auto;
  height: 100%;
  user-select: none;
}
#actionTabs .tabsMenu .panes .pane .animation-info {
  border-left: greenyellow 3px solid;
  margin-left: 5px;
  padding-left: 5px !important;
}
#actionTabs .tabsMenu .panes .pane .tagContainer {
  display: flex;
  min-height: 20px;
  padding: 4px;
  width: calc(100% - 8px);
  flex-wrap: wrap;
}
#actionTabs .tabsMenu .panes .pane .tagContainer .tag {
  border: 1px solid white;
  border-radius: 6px;
  padding: 1px 4px;
  margin: 2px;
}
#actionTabs .tabsMenu .panes .pane .underline {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.5);
}
#actionTabs .tabsMenu .panes .pane .textureLinkLine {
  display: grid;
  grid-template-columns: auto 1fr;
}
#actionTabs .tabsMenu .panes .pane .textureLinkLine .debug {
  grid-column: 1;
  margin-left: 5px;
  margin-right: 5px;
  display: block;
  align-items: center;
  justify-items: center;
  cursor: pointer;
  opacity: 0.5;
}
#actionTabs .tabsMenu .panes .pane .textureLinkLine .debug.selected {
  opacity: 1;
}
#actionTabs .tabsMenu .panes .pane .textureLinkLine .textLine {
  grid-column: 2;
}
#actionTabs .tabsMenu .panes .pane .textureLinkLine .actionIcon {
  display: inline-block;
  margin-top: 6px;
  margin-right: 4px;
}
#actionTabs .tabsMenu .panes .pane .messageLine {
  text-align: center;
  font-size: 12px;
  font-style: italic;
  opacity: 0.6;
}
#actionTabs .tabsMenu .panes .pane .iconMessageLine {
  padding-left: 2px;
  height: 30px;
  display: grid;
  grid-template-columns: 30px 1fr;
}
#actionTabs .tabsMenu .panes .pane .iconMessageLine .icon {
  grid-column: 1;
  display: grid;
  align-items: center;
  justify-items: center;
}
#actionTabs .tabsMenu .panes .pane .iconMessageLine .value {
  grid-column: 2;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .color-picker {
  height: calc(100% - 8px);
  margin: 4px;
  width: 100%;
}
#actionTabs .tabsMenu .panes .pane .color-picker .color-rect {
  height: calc(100% - 4px);
  border: 2px white solid;
  cursor: pointer;
  min-height: 18px;
}
#actionTabs .tabsMenu .panes .pane .color-picker .color-picker-cover {
  position: fixed;
  top: 0px;
  right: 0px;
  bottom: 0px;
  left: 0px;
  z-index: 100;
}
#actionTabs .tabsMenu .panes .pane .color-picker .color-picker-float {
  position: absolute;
}
#actionTabs .tabsMenu .panes .pane .linkButtonLine {
  padding-left: 2px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto 20px;
}
#actionTabs .tabsMenu .panes .pane .linkButtonLine .link {
  grid-column: 1;
  display: flex;
  align-items: center;
  text-decoration: underline;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button {
  grid-column: 2;
}
#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button button {
  background: #222222;
  border: 1px solid rgb(51, 122, 183);
  margin: 5px 10px 5px 10px;
  color: white;
  padding: 4px 5px;
  opacity: 0.9;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button button:hover {
  opacity: 1;
}
#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button button:active {
  background: #282828;
}
#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-button button:focus {
  border: 1px solid rgb(51, 122, 183);
  outline: 0px;
}
#actionTabs .tabsMenu .panes .pane .linkButtonLine .link-icon {
  grid-column: 3;
  display: grid;
  align-content: center;
}
#actionTabs .tabsMenu .panes .pane .textLine {
  padding-left: 2px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
}
#actionTabs .tabsMenu .panes .pane .textLine.indented {
  grid-template-columns: 100%;
}
#actionTabs .tabsMenu .panes .pane .textLine.indented .link-value {
  grid-column: 1;
  text-align: start;
  margin-left: 20px;
  opacity: 0.6;
  max-width: unset;
}
#actionTabs .tabsMenu .panes .pane .textLine.indented .value {
  grid-column: 1;
  text-align: start;
  margin-left: 20px;
  opacity: 0.6;
  max-width: unset;
}
#actionTabs .tabsMenu .panes .pane .textLine.reduced-opacity {
  opacity: 0.6;
  padding-left: 25px;
}
#actionTabs .tabsMenu .panes .pane .textLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .textLine .link-value {
  grid-column: 2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: end;
  opacity: 0.8;
  margin: 5px;
  margin-top: 7px;
  max-width: 140px;
  text-decoration: underline;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .textLine .value {
  grid-column: 2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: end;
  opacity: 0.8;
  margin: 5px;
  margin-top: 7px;
  max-width: 200px;
  user-select: text;
}
#actionTabs .tabsMenu .panes .pane .textLine .value.check {
  color: green;
}
#actionTabs .tabsMenu .panes .pane .textLine .value.uncheck {
  color: red;
}
#actionTabs .tabsMenu .panes .pane .gradient-container {
  margin-top: 3px;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-label {
  height: 30px;
  display: grid;
  align-content: center;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step {
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 25px 50px 55px 40px auto 20px 5px;
  padding-top: 5px;
  padding-left: 5px;
  padding-bottom: 5px;
  align-items: center;
  border-left: orange 3px solid;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .step {
  grid-row: 1;
  grid-column: 1;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .color1 {
  height: 100%;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .color2 {
  height: 100%;
  padding-left: 5px;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .factor1 {
  grid-row: 1;
  grid-column: 2;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .factor2 {
  padding-left: 5px;
  grid-row: 1;
  grid-column: 3;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .factor2 .grayed {
  background: gray;
  border-color: gray;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .numeric-input {
  width: calc(100% - 5px);
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .step-value {
  margin-left: 5px;
  grid-row: 1;
  grid-column: 4;
  text-align: right;
  margin-right: 5px;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .step-slider {
  grid-row: 1;
  grid-column: 5;
  display: grid;
  justify-content: stretch;
  align-content: center;
  margin-right: 5px;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .step-slider input {
  width: 100%;
}
#actionTabs .tabsMenu .panes .pane .gradient-container .gradient-step .gradient-delete {
  grid-row: 1;
  grid-column: 6;
  display: grid;
  align-content: center;
  justify-content: center;
}
#actionTabs .tabsMenu .panes .pane .textInputLine {
  padding-left: 2px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr 120px;
}
#actionTabs .tabsMenu .panes .pane .textInputLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .textInputLine .value {
  display: flex;
  align-items: center;
  grid-column: 2;
}
#actionTabs .tabsMenu .panes .pane .textInputLine .value input {
  width: 110px;
}
#actionTabs .tabsMenu .panes .pane .buttonLine {
  height: 30px;
  display: grid;
  align-items: center;
  justify-items: stretch;
}
#actionTabs .tabsMenu .panes .pane .buttonLine input[type=file] {
  display: none;
}
#actionTabs .tabsMenu .panes .pane .buttonLine .file-upload {
  background: #222222;
  border: 1px solid rgb(51, 122, 183);
  margin: 5px 10px 5px 10px;
  color: white;
  padding: 4px 5px;
  font-size: 13px;
  opacity: 0.9;
  cursor: pointer;
  text-align: center;
}
#actionTabs .tabsMenu .panes .pane .buttonLine .file-upload:hover {
  opacity: 1;
}
#actionTabs .tabsMenu .panes .pane .buttonLine .file-upload:active {
  transform: scale(0.98);
  transform-origin: 0.5 0.5;
}
#actionTabs .tabsMenu .panes .pane .buttonLine button {
  background: #222222;
  border: 1px solid rgb(51, 122, 183);
  margin: 5px 10px 5px 10px;
  color: white;
  padding: 4px 5px;
  opacity: 0.9;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .buttonLine button:hover {
  opacity: 1;
}
#actionTabs .tabsMenu .panes .pane .buttonLine button:active {
  background: #282828;
}
#actionTabs .tabsMenu .panes .pane .buttonLine button:focus {
  border: 1px solid rgb(51, 122, 183);
  outline: 0px;
}
#actionTabs .tabsMenu .panes .pane .radioLine {
  padding-left: 2px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr 24px;
}
#actionTabs .tabsMenu .panes .pane .radioLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer {
  grid-column: 2;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .radio {
  display: none;
}
#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .radio:checked + label:before {
  border-color: rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .radio:checked + label:after {
  transform: scale(1);
}
#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio {
  display: inline-block;
  height: 14px;
  position: relative;
  padding: 0 24px;
  margin-bottom: 0;
  cursor: pointer;
  vertical-align: bottom;
}
#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio:before, #actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio:after {
  position: absolute;
  content: "";
  border-radius: 50%;
  transition: all 0.3s ease;
  transition-property: transform, border-color;
}
#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio:before {
  left: 0px;
  top: 0;
  width: 16px;
  height: 16px;
  border: 2px solid white;
}
#actionTabs .tabsMenu .panes .pane .radioLine .radioContainer .labelForRadio:after {
  top: 6px;
  left: 6px;
  width: 8px;
  height: 8px;
  transform: scale(0);
  background: rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .radioLine .copy {
  grid-column: 3;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .radioLine .copy img {
  height: 100%;
}
#actionTabs .tabsMenu .panes .pane .vector3Line {
  padding-left: 2px;
  display: grid;
}
#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine {
  display: grid;
  grid-template-columns: 1fr auto 20px;
  height: 30px;
}
#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}
#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .vector {
  grid-column: 2;
  display: flex;
  align-items: center;
  text-align: right;
  opacity: 0.8;
  padding-left: 5px;
}
#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .expand {
  grid-column: 3;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .copy {
  grid-column: 4;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .vector3Line .firstLine .copy img {
  height: 100%;
}
#actionTabs .tabsMenu .panes .pane .vector3Line .secondLine {
  display: grid;
  padding-right: 5px;
  border-left: 1px solid rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .vector3Line .secondLine .numeric {
  display: grid;
  grid-template-columns: 1fr auto;
}
#actionTabs .tabsMenu .panes .pane .vector3Line .secondLine .numeric-label {
  text-align: right;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-self: right;
  margin-right: 10px;
}
#actionTabs .tabsMenu .panes .pane .vector3Line .secondLine .numeric-value {
  width: 120px;
  grid-column: 2;
  display: flex;
  align-items: center;
  border: 1px solid rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine {
  padding-left: 2px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto 20px 10px;
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox {
  grid-column: 2;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl {
  position: relative;
  display: block;
  height: 14px;
  width: 34px;
  margin-right: 5px;
  background: #898989;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl.checked {
  background: rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl:after {
  position: absolute;
  left: 3px;
  top: 2px;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 100px;
  background: #fff;
  box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.05);
  content: "";
  transition: all 0.15s ease;
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl:after.checked {
  left: 20px;
  background: rgb(22, 73, 117);
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl.checked:after {
  position: absolute;
  top: 2px;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 100px;
  background: #fff;
  box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.05);
  content: "";
  transition: all 0.15s ease;
  left: 20px;
  background: rgb(22, 73, 117);
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .lbl:active:after {
  transform: scale(1.15, 0.85);
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .hidden {
  display: none;
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .checkBox .icon {
  display: none;
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .copy {
  grid-column: 3;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .checkBoxLine .copy img {
  height: 100%;
}
#actionTabs .tabsMenu .panes .pane .textureLine {
  display: grid;
  grid-template-rows: 30px auto;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control {
  margin-top: 2px;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr 40px 40px 40px 40px 40px 1fr;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control .red {
  grid-column: 2;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control .green {
  grid-column: 3;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control .blue {
  grid-column: 4;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control .alpha {
  grid-column: 5;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control .all {
  grid-column: 6;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control3D {
  margin-top: 2px;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr 40px 40px 40px 40px 40px 40px 1fr;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control3D .px {
  grid-column: 2;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control3D .nx {
  grid-column: 3;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control3D .py {
  grid-column: 4;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control3D .ny {
  grid-column: 5;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control3D .pz {
  grid-column: 6;
}
#actionTabs .tabsMenu .panes .pane .textureLine .control3D .nz {
  grid-column: 7;
}
#actionTabs .tabsMenu .panes .pane .textureLine .command {
  border: 1px solid transparent;
  background: transparent;
  color: white;
}
#actionTabs .tabsMenu .panes .pane .textureLine .selected {
  border: 1px solid rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .textureLine .preview {
  grid-row: 2;
  display: grid;
  align-self: center;
  justify-self: center;
  height: 256px;
  width: 256px;
  margin-top: 5px;
  margin-bottom: 5px;
  border: 1px solid white;
  background-size: 32px 32px;
  background-color: white;
  background-image: url(${___CSS_LOADER_URL_REPLACEMENT_0___});
}
#actionTabs .tabsMenu .panes .pane .gltf-extension-property {
  margin-left: 30px;
  border-left: 1px solid rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .floatLine {
  padding-left: 2px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr 120px;
}
#actionTabs .tabsMenu .panes .pane .floatLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .floatLine .value {
  grid-column: 2;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .floatLine .value input {
  width: 110px;
}
#actionTabs .tabsMenu .panes .pane .floatLine .copy {
  grid-column: 3;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .floatLine .copy img {
  height: 100%;
}
#actionTabs .tabsMenu .panes .pane .sliderLine {
  padding-left: 2px;
  height: 30px;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 1fr 50px auto;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .withMargins {
  margin-left: 5px;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine {
  padding-left: 2px;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short input {
  width: 35px;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short input::-webkit-outer-spin-button,
#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .short input[type=number] {
  -moz-appearance: textfield;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .slider {
  grid-column: 3;
  grid-row: 1;
  margin-right: 5px;
  width: 90%;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #d3d3d3;
  border-radius: 5px;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range.overflow {
  background-color: red;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range:hover {
  opacity: 1;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgb(51, 122, 183);
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .slider .range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgb(51, 122, 183);
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .floatLine .copy {
  display: none;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .copy {
  grid-column: 4;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .sliderLine .copy img {
  height: 100%;
}
#actionTabs .tabsMenu .panes .pane .color3Line {
  padding-left: 2px;
  display: grid;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine {
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto 20px;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3 {
  grid-column: 2;
  width: 50px;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3 input[type=color] {
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0;
  width: 30px;
  height: 20px;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3 input[type=color]::-webkit-color-swatch-wrapper {
  padding: 0;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3 input[type=color]::-webkit-color-swatch {
  border: none;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .color3 input {
  margin-right: 5px;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .expand {
  grid-column: 3;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .copy {
  grid-column: 4;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .color3Line .firstLine .copy img {
  height: 100%;
}
#actionTabs .tabsMenu .panes .pane .color3Line .secondLine {
  display: grid;
  padding-right: 5px;
  border-left: 1px solid rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .color3Line .secondLine .numeric {
  display: grid;
  grid-template-columns: 1fr auto;
}
#actionTabs .tabsMenu .panes .pane .color3Line .secondLine .numeric-label {
  text-align: right;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-self: right;
  margin-right: 10px;
}
#actionTabs .tabsMenu .panes .pane .color3Line .secondLine .numeric-value {
  width: 120px;
  grid-column: 2;
  display: flex;
  align-items: center;
  border: 1px solid rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .listLine {
  padding-left: 2px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr auto 20px 10px;
}
#actionTabs .tabsMenu .panes .pane .listLine .label {
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .listLine .options {
  grid-column: 2;
  display: flex;
  align-items: center;
  margin-right: 5px;
}
#actionTabs .tabsMenu .panes .pane .listLine .options select {
  width: 115px;
}
#actionTabs .tabsMenu .panes .pane .listLine .copy {
  grid-column: 3;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .listLine .copy img {
  height: 100%;
}
#actionTabs .tabsMenu .panes .pane .paneContainer {
  margin-top: 3px;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneList {
  border-left: 3px solid transparent;
}
#actionTabs .tabsMenu .panes .pane .paneContainer:hover .paneList {
  border-left: 3px solid rgba(51, 122, 183, 0.8);
}
#actionTabs .tabsMenu .panes .pane .paneContainer:hover .paneContainer-content .header .title {
  border-left: 3px solid rgb(51, 122, 183);
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-highlight-border {
  grid-row: 1;
  grid-column: 1;
  opacity: 1;
  border: 3px solid red;
  margin-bottom: -5px;
  z-index: 100;
  transition: opacity 250ms;
  pointer-events: none;
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-highlight-border.transparent {
  opacity: 0;
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content {
  grid-row: 1;
  grid-column: 1;
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .header {
  display: grid;
  grid-template-columns: 1fr auto;
  background: #555555;
  height: 30px;
  padding-right: 5px;
  cursor: pointer;
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .header .title {
  border-left: 3px solid transparent;
  padding-left: 5px;
  grid-column: 1;
  display: flex;
  align-items: center;
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .header .collapse {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-items: center;
  transform-origin: center;
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .header .collapse.closed {
  transform: rotate(180deg);
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .paneList > div:not(:last-child) {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}
#actionTabs .tabsMenu .panes .pane .paneContainer .paneContainer-content .fragment > div:not(:last-child) {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/actionTabs/actionTabs.scss"],"names":[],"mappings":"AAEA;EACI,kBAAA;EACA,UAAA;EACA,QAAA;EACA,WAAA;AADJ;;AAIA;EACI,aAAA;AADJ;;AAIA;EACI,mBAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,aAAA;EACA,4BAAA;EACA,kBAAA;EACA,gBAAA;AADJ;AAGI;EACI,YAAA;AADR;AAII;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,mBAAA;EACA,WAAA;EACA,kBAAA;EACA,aAAA;EACA,oCAAA;EACA,iBAAA;AAFR;AAIQ;EACI,cAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;AAFZ;AAKQ;EACI,cAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;EACA,eAAA;AAHZ;AAMQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;AAJZ;AAOQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,8BAAA;AALZ;AAOY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AALhB;AAQY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AANhB;AAWI;EACI,aAAA;EACA,WAAA;EACA,4BAAA;EACA,kBAAA;EACA,gBAAA;AATR;AAWQ;EACI,WAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,gCAAA;EACA,SAAA;EACA,UAAA;AATZ;AAWY;EACI,eAAA;EACA,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;EACA,6BAAA;EACA,mBAAA;EACA,mBAAA;EACA,YAAA;EACA,YAAA;EACA,eAAA;AAThB;AAWgB;EACI,qBAAA;EACA,oCAAA;EACA,mBAAA;AATpB;AAcQ;EACI,WAAA;EACA,aAAA;EACA,wBAAA;EAEA,gBAAA;AAbZ;AAeY;EACI,YAAA;EACA,YAAA;EACA,wBAAA;AAbhB;AAgBY;EACI,aAAA;EACA,wBAAA;EACA,oDAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;AAdhB;AAgBgB;EACI,WAAA;EACA,cAAA;AAdpB;AAiBgB;EACI,YAAA;AAfpB;AAkBgB;EACI,YAAA;EACA,iBAAA;AAhBpB;AAmBgB;EACI,WAAA;EACA,cAAA;EACA,eAAA;AAjBpB;AAoBgB;EACI,iBAAA;EACA,WAAA;EACA,cAAA;EACA,eAAA;AAlBpB;AAoBoB;EACI,gBAAA;EACA,kBAAA;AAlBxB;AAsBgB;EACI,uBAAA;AApBpB;AAuBgB;EACI,eAAA;AArBpB;AAwBgB;EACI,gBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,iBAAA;AAtBpB;AAyBgB;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,qBAAA;EACA,kBAAA;AAvBpB;AAyBoB;EACI,WAAA;AAvBxB;AAyBoB;EACI,UAAA;AAvBxB;AA0BoB;EACI,wBAAA;EACA,WAAA;EACA,mBAAA;EACA,kBAAA;EACA,aAAA;EACA,YAAA;EACA,wBAAA;AAxBxB;AA2BoB;EACI,wBAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,6BAAA;EACA,eAAA;AAzBxB;AA4BoB;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,6BAAA;EACA,eAAA;AA1BxB;AA8BgB;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AA5BpB;AA8BoB;EACI,YAAA;EACA,WAAA;AA5BxB;AA8BoB;EACI,eAAA;AA5BxB;AA+BgB;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AA7BpB;AA8BoB;EACI,YAAA;EACA,WAAA;AA5BxB;AA8BoB;EACI,eAAA;AA5BxB;AAiCY;EACI,YAAA;EAEA,kBAAA;EACA,gBAAA;EACA,YAAA;EAEA,iBAAA;AAjChB;AAmCgB;EACI,kCAAA;EACA,gBAAA;EACA,4BAAA;AAjCpB;AAoCgB;EACI,aAAA;EACA,gBAAA;EACA,YAAA;EACA,uBAAA;EACA,eAAA;AAlCpB;AAoCoB;EACI,uBAAA;EACA,kBAAA;EACA,gBAAA;EACA,WAAA;AAlCxB;AAsCgB;EACI,mDAAA;AApCpB;AAuCgB;EACI,aAAA;EACA,+BAAA;AArCpB;AAuCoB;EACI,cAAA;EACA,gBAAA;EACA,iBAAA;EACA,cAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;EACA,YAAA;AArCxB;AAuCwB;EACI,UAAA;AArC5B;AAyCoB;EACI,cAAA;AAvCxB;AA0CoB;EACI,qBAAA;EACA,eAAA;EACA,iBAAA;AAxCxB;AA4CgB;EACI,kBAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;AA1CpB;AA6CgB;EACI,iBArVA;EAsVA,YAAA;EACA,aAAA;EACA,+BAAA;AA3CpB;AA6CoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;AA3CxB;AA8CoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA5CxB;AAgDgB;EACI,wBAAA;EACA,WAAA;EACA,WAAA;AA9CpB;AAgDoB;EACI,wBAAA;EACA,uBAAA;EACA,eAAA;EACA,gBAAA;AA9CxB;AAiDoB;EACI,eAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,YAAA;AA/CxB;AAkDoB;EACI,kBAAA;AAhDxB;AAoDgB;EACI,iBAnYA;EAoYA,YAAA;EACA,aAAA;EACA,oCAAA;AAlDpB;AAoDoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,0BAAA;EACA,eAAA;AAlDxB;AAqDoB;EACI,cAAA;AAnDxB;AAqDwB;EACI,mBAAA;EACA,mCAAA;EACA,yBAAA;EACA,YAAA;EACA,gBAAA;EACA,YAAA;EACA,eAAA;AAnD5B;AAsDwB;EACI,UAAA;AApD5B;AAuDwB;EACI,mBAAA;AArD5B;AAwDwB;EACI,mCAAA;EACA,YAAA;AAtD5B;AA0DoB;EACI,cAAA;EACA,aAAA;EACA,qBAAA;AAxDxB;AA4DgB;EACI,iBAnbA;EAobA,YAAA;EACA,aAAA;EACA,+BAAA;AA1DpB;AA4DoB;EACI,2BAAA;AA1DxB;AA4DwB;EACI,cAAA;EACA,iBAAA;EACA,iBAAA;EACA,YAAA;EACA,gBAAA;AA1D5B;AA6DwB;EACI,cAAA;EACA,iBAAA;EACA,iBAAA;EACA,YAAA;EACA,gBAAA;AA3D5B;AA+DoB;EACI,YAAA;EACA,kBAAA;AA7DxB;AAgEoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA9DxB;AAiEoB;EACI,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,0BAAA;EACA,eAAA;AA/DxB;AAkEoB;EACI,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,iBAAA;AAhExB;AAkEwB;EACI,YAAA;AAhE5B;AAmEwB;EACI,UAAA;AAjE5B;AAsEgB;EACI,eAAA;AApEpB;AAsEoB;EACI,YAAA;EACA,aAAA;EACA,qBAAA;AApExB;AAuEoB;EACI,aAAA;EACA,wBAAA;EACA,wDAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;EACA,6BAAA;AArExB;AAuEwB;EACI,WAAA;EACA,cAAA;AArE5B;AAwEwB;EACI,YAAA;AAtE5B;AAyEwB;EACI,YAAA;EACA,iBAAA;AAvE5B;AA0EwB;EACI,WAAA;EACA,cAAA;EACA,eAAA;AAxE5B;AA2EwB;EACI,iBAAA;EACA,WAAA;EACA,cAAA;EACA,eAAA;AAzE5B;AA2E4B;EACI,gBAAA;EACA,kBAAA;AAzEhC;AA6EwB;EACI,uBAAA;AA3E5B;AA8EwB;EACI,gBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,iBAAA;AA5E5B;AA+EwB;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,qBAAA;EACA,iBAAA;AA7E5B;AA+E4B;EACI,WAAA;AA7EhC;AAiFwB;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AA/E5B;AAoFgB;EACI,iBAllBA;EAmlBA,YAAA;EACA,aAAA;EACA,gCAAA;AAlFpB;AAoFoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAlFxB;AAqFoB;EACI,aAAA;EACA,mBAAA;EACA,cAAA;AAnFxB;AAqFwB;EACI,YAAA;AAnF5B;AAwFgB;EACI,YAAA;EACA,aAAA;EACA,mBAAA;EACA,sBAAA;AAtFpB;AAwFoB;EACI,aAAA;AAtFxB;AAyFoB;EACI,mBAAA;EACA,mCAAA;EACA,yBAAA;EACA,YAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;AAvFxB;AA0FoB;EACI,UAAA;AAxFxB;AA2FoB;EACI,sBAAA;EACA,yBAAA;AAzFxB;AA4FoB;EACI,mBAAA;EACA,mCAAA;EACA,yBAAA;EACA,YAAA;EACA,gBAAA;EACA,YAAA;EACA,eAAA;AA1FxB;AA6FoB;EACI,UAAA;AA3FxB;AA8FoB;EACI,mBAAA;AA5FxB;AA+FoB;EACI,mCAAA;EACA,YAAA;AA7FxB;AAiGgB;EACI,iBAhqBA;EAiqBA,YAAA;EACA,aAAA;EACA,+BAAA;AA/FpB;AAiGoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA/FxB;AAkGoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAhGxB;AAkGwB;EACI,aAAA;AAhG5B;AAkG4B;EACI,+BAAA;AAhGhC;AAkG4B;EACI,mBAAA;AAhGhC;AAoGwB;EACI,qBAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;EACA,sBAAA;AAlG5B;AAmG4B;EAEI,kBAAA;EACA,WAAA;EACA,kBAAA;EACA,yBAAA;EACA,4CAAA;AAlGhC;AAoG4B;EACI,SAAA;EACA,MAAA;EACA,WAAA;EACA,YAAA;EACA,uBAAA;AAlGhC;AAoG4B;EACI,QAAA;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,mBAAA;EACA,6BAAA;AAlGhC;AAuGoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AArGxB;AAsGwB;EACI,YAAA;AApG5B;AAyGgB;EACI,iBA1uBA;EA2uBA,aAAA;AAvGpB;AAyGoB;EACI,aAAA;EACA,oCAAA;EACA,YAAA;AAvGxB;AAyGwB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,gBAAA;AAvG5B;AA0GwB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,iBAAA;EACA,YAAA;EACA,iBAAA;AAxG5B;AA2GwB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAzG5B;AA4GwB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AA1G5B;AA2G4B;EACI,YAAA;AAzGhC;AA8GoB;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AA5GxB;AA8GwB;EACI,aAAA;EACA,+BAAA;AA5G5B;AA+GwB;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AA7G5B;AAgHwB;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AA9G5B;AAmHgB;EACI,iBArzBA;EAszBA,YAAA;EACA,aAAA;EACA,yCAAA;AAjHpB;AAmHoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAjHxB;AAoHoB;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;AAnHxB;AAqHwB;EACI,kBAAA;EACA,cAAA;EACA,YAAA;EACA,WAAA;EACA,iBAAA;EACA,mBAAA;EACA,oBAAA;EACA,eAAA;EACA,yBAAA;AAnH5B;AAqH4B;EACI,6BAAA;AAnHhC;AAuHwB;EACI,kBAAA;EACA,SAAA;EACA,QAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,oBAAA;EACA,gBAAA;EACA,2CAAA;EACA,WAAA;EACA,0BAAA;AArH5B;AAuH4B;EACI,UAAA;EACA,4BAAA;AArHhC;AAyHwB;EACI,kBAAA;EACA,QAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,oBAAA;EACA,gBAAA;EACA,2CAAA;EACA,WAAA;EACA,0BAAA;EACA,UAAA;EACA,4BAAA;AAvH5B;AA0HwB;EACI,4BAAA;AAxH5B;AA2HwB;EACI,aAAA;AAzH5B;AA4HwB;EACI,aAAA;AA1H5B;AA8HoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AA5HxB;AA6HwB;EACI,YAAA;AA3H5B;AAgIgB;EACI,aAAA;EACA,6BAAA;AA9HpB;AAgIoB;EACI,eAAA;EACA,WAAA;EACA,aAAA;EACA,uDAAA;AA9HxB;AAgIwB;EACI,cAAA;AA9H5B;AAiIwB;EACI,cAAA;AA/H5B;AAkIwB;EACI,cAAA;AAhI5B;AAmIwB;EACI,cAAA;AAjI5B;AAoIwB;EACI,cAAA;AAlI5B;AAsIoB;EACI,eAAA;EACA,WAAA;EACA,aAAA;EACA,4DAAA;AApIxB;AAsIwB;EACI,cAAA;AApI5B;AAuIwB;EACI,cAAA;AArI5B;AAwIwB;EACI,cAAA;AAtI5B;AAyIwB;EACI,cAAA;AAvI5B;AA0IwB;EACI,cAAA;AAxI5B;AA2IwB;EACI,cAAA;AAzI5B;AA6IoB;EACI,6BAAA;EACA,uBAAA;EACA,YAAA;AA3IxB;AA8IoB;EACI,mCAAA;AA5IxB;AA+IoB;EACI,WAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;EACA,aAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,uBAAA;EACA,0BAAA;EACA,uBAAA;EACA,yDAAA;AA7IxB;AAiJgB;EACI,iBAAA;EACA,wCAAA;AA/IpB;AAkJgB;EACI,iBA/+BA;EAg/BA,YAAA;EACA,aAAA;EACA,gCAAA;AAhJpB;AAkJoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAhJxB;AAmJoB;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;AAlJxB;AAoJwB;EACI,YAAA;AAlJ5B;AAsJoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AApJxB;AAqJwB;EACI,YAAA;AAnJ5B;AAwJgB;EACI,iBAlhCA;EAmhCA,YAAA;EACA,aAAA;EACA,wBAAA;EACA,oCAAA;AAtJpB;AAwJoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAtJxB;AAyJoB;EACI,gBAAA;AAvJxB;AA0JoB;EACI,iBAniCJ;AA24BpB;AA0JwB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAxJ5B;AA0J4B;EACI,WAAA;AAxJhC;AA2J4B;;EAEI,wBAAA;EACA,SAAA;AAzJhC;AA4J4B;EACI,0BAAA;AA1JhC;AA+JoB;EACI,cAAA;EACA,WAAA;EACA,iBAAA;EACA,UAAA;EACA,aAAA;EACA,mBAAA;AA7JxB;AA+JwB;EACI,wBAAA;EACA,WAAA;EACA,WAAA;EACA,mBAAA;EACA,kBAAA;EACA,aAAA;EACA,YAAA;EACA,wBAAA;AA7J5B;AA+J4B;EACI,qBAAA;AA7JhC;AAiKwB;EACI,UAAA;AA/J5B;AAkKwB;EACI,wBAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,6BAAA;EACA,eAAA;AAhK5B;AAmKwB;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,6BAAA;EACA,eAAA;AAjK5B;AAsKwB;EACI,aAAA;AApK5B;AAwKoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAtKxB;AAuKwB;EACI,YAAA;AArK5B;AA0KgB;EACI,iBA3nCA;EA4nCA,aAAA;AAxKpB;AA0KoB;EACI,YAAA;EACA,aAAA;EACA,oCAAA;AAxKxB;AA0KwB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAxK5B;AA2KwB;EACI,cAAA;EACA,WAAA;EAEA,aAAA;EACA,mBAAA;AA1K5B;AA4K4B;EACI,wBAAA;EACA,0CAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;AA1KhC;AA4K4B;EACI,UAAA;AA1KhC;AA4K4B;EACI,YAAA;AA1KhC;AA6K4B;EACI,iBAAA;AA3KhC;AA+KwB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AA7K5B;AAgLwB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AA9K5B;AA+K4B;EACI,YAAA;AA7KhC;AAkLoB;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AAhLxB;AAkLwB;EACI,aAAA;EACA,+BAAA;AAhL5B;AAmLwB;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AAjL5B;AAoLwB;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AAlL5B;AAuLgB;EACI,iBArtCA;EAstCA,YAAA;EACA,aAAA;EACA,yCAAA;AArLpB;AAuLoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AArLxB;AAwLoB;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;EACA,iBAAA;AAvLxB;AAyLwB;EACI,YAAA;AAvL5B;AA2LoB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAzLxB;AA0LwB;EACI,YAAA;AAxL5B;AA6LgB;EACI,eAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;AA3LpB;AA6LoB;EACI,kCAAA;AA3LxB;AA+LwB;EACI,8CAAA;AA7L5B;AAkMgC;EACI,wCAAA;AAhMpC;AAsMoB;EACI,WAAA;EACA,cAAA;EACA,UAAA;EACA,qBAAA;EACA,mBAAA;EACA,YAAA;EACA,yBAAA;EACA,oBAAA;AApMxB;AAsMwB;EACI,UAAA;AApM5B;AAwMoB;EACI,WAAA;EACA,cAAA;AAtMxB;AAwMwB;EACI,aAAA;EACA,+BAAA;EACA,mBAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;AAtM5B;AAwM4B;EACI,kCAAA;EACA,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;AAtMhC;AAyM4B;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,wBAAA;AAvMhC;AAyMgC;EACI,yBAAA;AAvMpC;AA4MwB;EACI,mDAAA;AA1M5B;AA6MwB;EACI,mDAAA;AA3M5B","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/scss/performanceViewer.scss":
/*!*********************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/scss/performanceViewer.scss ***!
  \*********************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_46691__) => {

"use strict";
__nested_webpack_require_46691__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_46691__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_46691__(/*! ../../../../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_46691__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_46691__(/*! ../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_46691__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#performance-viewer {
  display: grid;
  height: 100%;
  width: 100%;
  grid-template-columns: 300px 1fr;
  font-family: "acumin-pro";
}
#performance-viewer .performancePlayheadButton {
  grid-area: liveButton;
  height: 30px;
  width: 100px;
  justify-self: right;
  background-color: #dcdfe1;
  color: #2e3f47;
  outline: 2px #2e3f47;
  margin: 5px;
  position: absolute;
  top: 10px;
  right: 10px;
}
#performance-viewer #performance-viewer-sidebar {
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  border: 2px solid gray;
}
#performance-viewer #performance-viewer-sidebar .sidebar-item {
  display: grid;
  width: 100%;
  height: 30px;
  font-size: 14px;
  padding: 2.5px 0px;
  align-items: center;
}
#performance-viewer #performance-viewer-sidebar .header {
  color: white;
  grid-template-columns: 10px 9fr 1fr 10px;
}
#performance-viewer #performance-viewer-sidebar .header .category {
  grid-column: 2;
}
#performance-viewer #performance-viewer-sidebar .header .value {
  grid-column: 3;
}
#performance-viewer #performance-viewer-sidebar .version-header {
  background-color: #2e3f47;
  color: white;
  grid-template-columns: 10px 1fr 1fr 10px;
  font-size: 14px;
  height: 35px;
}
#performance-viewer #performance-viewer-sidebar .version-header .category {
  grid-column: 2;
}
#performance-viewer #performance-viewer-sidebar .version-header .value {
  grid-column: 3;
  display: flex;
  justify-content: end;
}
#performance-viewer #performance-viewer-sidebar .category-header {
  background-color: #4a5960;
  text-transform: uppercase;
  font-size: 14px;
  height: 30px;
}
#performance-viewer #performance-viewer-sidebar .category-header .checkBoxLine {
  color: #dcdfe1;
}
#performance-viewer #performance-viewer-sidebar .measure {
  color: black;
  grid-template-columns: 18px 6fr 1fr;
  font-family: "acumin-pro-condensed";
}
#performance-viewer #performance-viewer-sidebar .measure .category {
  display: grid;
  grid-template-columns: 18px 7px 18px 10px 1fr;
  grid-column: 2;
  align-items: center;
}
#performance-viewer #performance-viewer-sidebar .measure .category .color-picker {
  grid-column: 3;
}
#performance-viewer #performance-viewer-sidebar .measure .category .sidebar-item-label {
  grid-column: 5;
}
#performance-viewer #performance-viewer-sidebar .measure .value {
  grid-column: 3;
}
#performance-viewer #performance-viewer-sidebar .measure:nth-child(odd) {
  background-color: #dcdfe1;
}
#performance-viewer #performance-viewer-sidebar .measure:nth-child(even) {
  background-color: #ebedee;
}
#performance-viewer #performance-viewer-sidebar .checkBoxLine {
  color: #4a5960;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
#performance-viewer #performance-viewer-sidebar .checkBoxLine .disabled {
  color: lightgray;
}
#performance-viewer #performance-viewer-sidebar .color-picker {
  width: 100%;
}
#performance-viewer #performance-viewer-sidebar .color-picker .color-rect {
  height: 18px;
  width: 18px;
  cursor: pointer;
}
#performance-viewer #performance-viewer-sidebar .color-picker .color-picker-cover {
  position: fixed;
  top: 0px;
  right: 0px;
  bottom: 0px;
  left: 0px;
  z-index: 100;
}
#performance-viewer #performance-viewer-sidebar .color-picker .color-picker-float {
  position: absolute;
}
#performance-viewer #performance-viewer-sidebar .color-picker .color-picker-float .color-picker-container {
  width: 200px;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/scss/performanceViewer.scss"],"names":[],"mappings":"AAGA;EACI,aAAA;EACA,YAAA;EACA,WAAA;EACA,gCAAA;EACA,yBAAA;AAFJ;AAII;EACI,qBAAA;EACA,YAZO;EAaP,YAAA;EACA,mBAAA;EACA,yBAAA;EACA,cAAA;EACA,oBAAA;EACA,WAAA;EACA,kBAAA;EACA,SAAA;EACA,WAAA;AAFR;AAKI;EACI,aAAA;EACA,sBAAA;EACA,kBAAA;EAEA,sBAAA;AAJR;AAMQ;EACI,aAAA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,mBAAA;AAJZ;AAOQ;EACI,YAAA;EACA,wCAAA;AALZ;AAOY;EACI,cAAA;AALhB;AAQY;EACI,cAAA;AANhB;AAUQ;EACI,yBAAA;EACA,YAAA;EACA,wCAAA;EACA,eAAA;EACA,YAAA;AARZ;AAUY;EACI,cAAA;AARhB;AAWY;EACI,cAAA;EACA,aAAA;EACA,oBAAA;AAThB;AAcQ;EACI,yBAAA;EACA,yBAAA;EACA,eAAA;EACA,YAAA;AAZZ;AAcY;EACI,cAAA;AAZhB;AAgBQ;EACI,YAAA;EACA,mCAAA;EACA,mCAAA;AAdZ;AAgBY;EACI,aAAA;EACA,6CAAA;EACA,cAAA;EACA,mBAAA;AAdhB;AAgBgB;EACI,cAAA;AAdpB;AAiBgB;EACI,cAAA;AAfpB;AAmBY;EACI,cAAA;AAjBhB;AAsBQ;EACI,yBAAA;AApBZ;AAwBQ;EACI,yBAAA;AAtBZ;AAyBQ;EACI,cAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,uBAAA;EACA,mBAAA;AAvBZ;AAwBY;EACI,gBAAA;AAtBhB;AA0BQ;EACI,WAAA;AAxBZ;AA0BY;EACI,YArIH;EAsIG,WAtIH;EAuIG,eAAA;AAxBhB;AA2BY;EACI,eAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,YAAA;AAzBhB;AA4BY;EACI,kBAAA;AA1BhB;AA4BgB;EACI,YAAA;AA1BpB","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/bottomBar.scss":
/*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/bottomBar.scss ***!
  \********************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_54175__) => {

"use strict";
__nested_webpack_require_54175__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_54175__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_54175__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_54175__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_54175__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_54175__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#bottom-bar {
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 10px 210px 10px 1fr 10px 61px 10px;
}
#bottom-bar #bottom-bar-total {
  grid-row: 1;
  grid-column: 6;
  color: white;
  background: #222222;
  height: 25px;
  align-self: center;
  font-size: 12pt;
}
#bottom-bar #bottom-bar-total #clip-range {
  width: 100%;
}
#bottom-bar .control-button .control-button-image {
  display: unset;
}
#bottom-bar .control-button .control-button-hover-image {
  display: none;
}
#bottom-bar .control-button:hover {
  cursor: pointer;
}
#bottom-bar .control-button:hover .control-button-image {
  display: none;
}
#bottom-bar .control-button:hover .control-button-hover-image {
  display: unset;
}
#bottom-bar .control-button:active {
  transform-origin: 50% 50%;
  transform: scale(0.96);
}
#bottom-bar #media-player {
  grid-row: 1;
  grid-column: 2;
  display: grid;
  align-self: center;
  justify-self: center;
  grid-template-rows: 100%;
  grid-template-columns: 23px 23px 23px 23px 23px 23px 23px;
}
#bottom-bar #media-player #start-key {
  grid-row: 1;
  grid-column: 1;
}
#bottom-bar #media-player #prev-frame {
  grid-row: 1;
  grid-column: 2;
}
#bottom-bar #media-player #first-key {
  grid-row: 1;
  grid-column: 3;
}
#bottom-bar #media-player #rev-key {
  grid-row: 1;
  grid-column: 4;
}
#bottom-bar #media-player #fwd-key {
  grid-row: 1;
  grid-column: 5;
}
#bottom-bar #media-player #next-key {
  grid-row: 1;
  grid-column: 6;
}
#bottom-bar #media-player #next-frame {
  grid-row: 1;
  grid-column: 7;
}
#bottom-bar #media-player #end-key {
  grid-row: 1;
  grid-column: 8;
}
#bottom-bar #range-selector {
  grid-row: 1;
  grid-column: 4;
  background: #222222;
  width: 100%;
  height: calc(100% - 20px);
  margin: 10px 0;
  position: relative;
}
#bottom-bar #range-selector #range-scrollbar {
  position: absolute;
  left: 2px;
  top: 2px;
  right: 2px;
  bottom: 2px;
  background: #666666;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 20px auto 1fr auto 20px;
  color: #222222;
  font-family: "acumin-pro-condensed";
  font-size: 14px;
  min-width: 70px;
}
#bottom-bar #range-selector #range-scrollbar #left-handle {
  grid-row: 1;
  grid-column: 1;
}
#bottom-bar #range-selector #range-scrollbar #right-handle {
  grid-row: 1;
  grid-column: 5;
}
#bottom-bar #range-selector #range-scrollbar #from-key {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  justify-self: center;
  user-select: none;
  pointer-events: none;
}
#bottom-bar #range-selector #range-scrollbar #to-key {
  grid-row: 1;
  grid-column: 4;
  align-self: center;
  justify-self: center;
  user-select: none;
  pointer-events: none;
}
#bottom-bar #range-selector #range-scrollbar .handle {
  width: 20px;
  align-self: center;
  justify-self: center;
  cursor: pointer;
  user-select: none;
}
#bottom-bar #range-selector #range-scrollbar .handle img {
  pointer-events: none;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/bottomBar.scss"],"names":[],"mappings":"AAAA;EACI,aAAA;EACA,wBAAA;EACA,yDAAA;AACJ;AACI;EACI,WAAA;EACA,cAAA;EACA,YAAA;EACA,mBAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;AACR;AACQ;EACI,WAAA;AACZ;AAIQ;EACI,cAAA;AAFZ;AAKQ;EACI,aAAA;AAHZ;AAMQ;EACI,eAAA;AAJZ;AAMY;EACI,aAAA;AAJhB;AAOY;EACI,cAAA;AALhB;AASQ;EACI,yBAAA;EACA,sBAAA;AAPZ;AAWI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;EACA,wBAAA;EACA,yDAAA;AATR;AAWQ;EACI,WAAA;EACA,cAAA;AATZ;AAYQ;EACI,WAAA;EACA,cAAA;AAVZ;AAaQ;EACI,WAAA;EACA,cAAA;AAXZ;AAcQ;EACI,WAAA;EACA,cAAA;AAZZ;AAeQ;EACI,WAAA;EACA,cAAA;AAbZ;AAgBQ;EACI,WAAA;EACA,cAAA;AAdZ;AAiBQ;EACI,WAAA;EACA,cAAA;AAfZ;AAkBQ;EACI,WAAA;EACA,cAAA;AAhBZ;AAoBI;EACI,WAAA;EACA,cAAA;EACA,mBAAA;EACA,WAAA;EACA,yBAAA;EACA,cAAA;EACA,kBAAA;AAlBR;AAoBQ;EACI,kBAAA;EACA,SAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,mBAAA;EACA,aAAA;EACA,wBAAA;EACA,8CAAA;EACA,cAAA;EACA,mCAAA;EACA,eAAA;EACA,eAAA;AAlBZ;AAoBY;EACI,WAAA;EACA,cAAA;AAlBhB;AAqBY;EACI,WAAA;EACA,cAAA;AAnBhB;AAsBY;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,oBAAA;EACA,iBAAA;EACA,oBAAA;AApBhB;AAuBY;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,oBAAA;EACA,iBAAA;EACA,oBAAA;AArBhB;AAwBY;EACI,WAAA;EACA,kBAAA;EACA,oBAAA;EACA,eAAA;EACA,iBAAA;AAtBhB;AAwBgB;EACI,oBAAA;AAtBpB","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/canvas.scss":
/*!*****************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/canvas.scss ***!
  \*****************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_61212__) => {

"use strict";
__nested_webpack_require_61212__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_61212__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_61212__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_61212__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_61212__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_61212__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#canvas-zone {
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 30px 1fr 10px 40px;
  overflow: hidden;
  position: relative;
}
#canvas-zone #graph {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: 100%;
  background: #222222;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 100%;
  overflow: hidden;
  position: relative;
}
#canvas-zone #graph #svg-graph-grid {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
#canvas-zone #graph #svg-graph-grid:focus {
  outline: none;
}
#canvas-zone #graph #svg-graph-horizontal {
  grid-column: 1;
  grid-row: 1;
  margin-left: 40px;
  width: calc(100% - 40px);
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
#canvas-zone #graph #svg-graph-horizontal:focus {
  outline: none;
}
#canvas-zone #graph #dark-rectangle {
  grid-column: 1;
  grid-row: 1;
  margin-left: 40px;
  width: calc(100% - 40px);
  height: 100%;
  background: #111111;
  opacity: 0.2;
  pointer-events: none;
  position: absolute;
}
#canvas-zone #graph #block-rectangle {
  grid-column: 1;
  grid-row: 1;
  width: 40px;
  height: 100%;
  background: #222222;
  z-index: 1;
}
#canvas-zone #graph #svg-graph-curves {
  grid-column: 1;
  grid-row: 1;
  margin-left: 40px;
  width: calc(100% - 40px);
  height: 100%;
  z-index: 2;
}
#canvas-zone #graph #svg-graph-curves:focus {
  outline: none;
}
#canvas-zone #graph #selection-rectangle {
  grid-column: 1;
  grid-row: 1;
  width: calc(100% - 40px);
  height: 100%;
  pointer-events: none;
  position: absolute;
  left: 40px;
  visibility: hidden;
  border: 1px dashed white;
}
#canvas-zone #range-frame-bar {
  grid-column: 1;
  grid-row: 4;
  width: 100%;
  height: 100%;
  background: #222222;
  pointer-events: none;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
  pointer-events: none;
  user-select: none;
}
#canvas-zone #range-frame-bar #svg-range-frames {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
}
#canvas-zone #frame-bar {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  background: #222222;
  pointer-events: none;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 40px 1fr;
}
#canvas-zone #frame-bar #angle-unit {
  grid-column: 1;
  grid-row: 1;
  background: #111111;
}
#canvas-zone #frame-bar #frames {
  grid-column: 1/3;
  grid-row: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
}
#canvas-zone #frame-bar #frames #svg-frames {
  margin-left: 40px;
  grid-column: 1;
  grid-row: 1;
  width: calc(100% - 40px);
  height: 100%;
}
#canvas-zone #play-head-control {
  grid-column: 1;
  grid-row: 1;
  position: absolute;
  height: 30px;
  left: 40px;
  width: calc(100% - 40px);
}
#canvas-zone #play-head-control-2 {
  grid-column: 1;
  grid-row: 4;
  position: absolute;
  height: 30px;
  left: 0px;
  width: 100%;
}
#canvas-zone #play-head {
  grid-column: 1;
  grid-row: 1/3;
  position: absolute;
  top: 0;
  height: calc(100% - 5px);
  width: 22px;
  margin-left: 40px;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 22px 1fr;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
}
#canvas-zone #play-head #play-head-bar {
  grid-row: 2;
  grid-column: 1;
  justify-self: center;
  width: 1.5px;
  background: #ffffff;
  height: 100%;
  pointer-events: none;
}
#canvas-zone #play-head #play-head-circle {
  grid-row: 1;
  grid-column: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  font-family: "acumin-pro-condensed";
  font-size: 8pt;
  display: grid;
  align-content: center;
  justify-content: center;
  color: #555555;
  cursor: pointer;
}
#canvas-zone #angle-mode {
  grid-column: 1;
  grid-row: 1;
  width: 40px;
  height: 100%;
  z-index: 1;
  background: #222222;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/canvas.scss"],"names":[],"mappings":"AAAA;EACI,aAAA;EACA,2BAAA;EACA,sCAAA;EACA,gBAAA;EACA,kBAAA;AACJ;AACI;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,aAAA;EACA,2BAAA;EACA,wBAAA;EACA,gBAAA;EACA,kBAAA;AACR;AACQ;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,oBAAA;EACA,UAAA;AACZ;AACY;EACI,aAAA;AAChB;AAGQ;EACI,cAAA;EACA,WAAA;EACA,iBAAA;EACA,wBAAA;EACA,YAAA;EACA,oBAAA;EACA,UAAA;AADZ;AAGY;EACI,aAAA;AADhB;AAKQ;EACI,cAAA;EACA,WAAA;EACA,iBAAA;EACA,wBAAA;EACA,YAAA;EACA,mBAAA;EACA,YAAA;EACA,oBAAA;EACA,kBAAA;AAHZ;AAMQ;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,UAAA;AAJZ;AAOQ;EACI,cAAA;EACA,WAAA;EACA,iBAAA;EACA,wBAAA;EACA,YAAA;EACA,UAAA;AALZ;AAOY;EACI,aAAA;AALhB;AASQ;EACI,cAAA;EACA,WAAA;EACA,wBAAA;EACA,YAAA;EACA,oBAAA;EACA,kBAAA;EACA,UAAA;EACA,kBAAA;EAEA,wBAAA;AARZ;AAYI;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,oBAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;EACA,oBAAA;EACA,iBAAA;AAVR;AAYQ;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;AAVZ;AAcI;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,oBAAA;EAEA,aAAA;EACA,wBAAA;EACA,+BAAA;AAbR;AAeQ;EACI,cAAA;EACA,WAAA;EACA,mBAAA;AAbZ;AAgBQ;EACI,gBAAA;EAEA,WAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;AAfZ;AAiBY;EACI,iBAAA;EACA,cAAA;EACA,WAAA;EACA,wBAAA;EACA,YAAA;AAfhB;AAoBI;EACI,cAAA;EACA,WAAA;EACA,kBAAA;EACA,YAAA;EACA,UAAA;EACA,wBAAA;AAlBR;AAqBI;EACI,cAAA;EACA,WAAA;EACA,kBAAA;EACA,YAAA;EACA,SAAA;EACA,WAAA;AAnBR;AAsBI;EACI,cAAA;EACA,aAAA;EACA,kBAAA;EACA,MAAA;EACA,wBAAA;EACA,WAAA;EACA,iBAAA;EACA,aAAA;EACA,2BAAA;EACA,4BAAA;EACA,2BAAA;EACA,oBAAA;EACA,UAAA;AApBR;AAsBQ;EACI,WAAA;EACA,cAAA;EACA,oBAAA;EACA,YAAA;EACA,mBAAA;EACA,YAAA;EACA,oBAAA;AApBZ;AAuBQ;EACI,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,mBAAA;EACA,mCAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;EACA,cAAA;EACA,eAAA;AArBZ;AAyBI;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,mBAAA;AAvBR","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/curveEditor.scss":
/*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/curveEditor.scss ***!
  \**********************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_69911__) => {

"use strict";
__nested_webpack_require_69911__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_69911__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_69911__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_69911__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_69911__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_69911__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#curve-editor {
  background: #333333;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 40px calc(100% - 85px) 45px;
  grid-template-columns: 10px 210px 10px 1fr 10px;
}
#curve-editor #top-bar {
  background: #333333;
  grid-row: 1;
  grid-column: 1/6;
  width: 100%;
  height: 100%;
}
#curve-editor #bottom-bar {
  background: #333333;
  grid-row: 3;
  grid-column: 1/6;
  width: 100%;
  height: 100%;
}
#curve-editor #canvas-zone {
  grid-row: 2;
  grid-column: 4;
  width: 100%;
  height: 100%;
  background: #333333;
}
#curve-editor #sidebar {
  grid-row: 2;
  grid-column: 2;
  width: 100%;
  height: 100%;
  background: #111111;
}
#curve-editor .action-button:hover {
  background: #666666;
  color: white;
  cursor: pointer;
}
#curve-editor .action-button.active {
  background: #111111;
}
#curve-editor .action-button:active {
  transform-origin: 50% 50%;
  transform: scale(0.96);
}
#curve-editor .push-button {
  cursor: pointer;
}
#curve-editor .push-button.active {
  background: #666666;
}
#curve-editor .text-input {
  color: white;
  background: #000000;
  font-family: "acumin-pro-condensed";
  font-size: 11pt;
  border: 0;
  margin: 3px 1px;
  text-align: end;
  padding-right: 4px;
}
#curve-editor .text-input:focus {
  outline: none;
}
#curve-editor .text-input:disabled {
  background: #444444;
  border: #555555 solid 1px;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/curveEditor.scss"],"names":[],"mappings":"AAAA;EACI,mBAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,+CAAA;EACA,+CAAA;AACJ;AACI;EACI,mBAAA;EACA,WAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;AACR;AAEI;EACI,mBAAA;EACA,WAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;AAAR;AAGI;EACI,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;AADR;AAII;EACI,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;AAFR;AAMQ;EACI,mBAAA;EACA,YAAA;EACA,eAAA;AAJZ;AAOQ;EACI,mBAAA;AALZ;AAQQ;EACI,yBAAA;EACA,sBAAA;AANZ;AAUI;EACI,eAAA;AARR;AASQ;EACI,mBAAA;AAPZ;AAWI;EACI,YAAA;EACA,mBAAA;EACA,mCAAA;EACA,eAAA;EACA,SAAA;EACA,eAAA;EACA,eAAA;EACA,kBAAA;AATR;AAWQ;EACI,aAAA;AATZ;AAYQ;EACI,mBAAA;EACA,yBAAA;AAVZ","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/sideBar.scss":
/*!******************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/sideBar.scss ***!
  \******************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_74855__) => {

"use strict";
__nested_webpack_require_74855__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_74855__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_74855__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_74855__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_74855__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_74855__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#sideBar {
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 30px 1fr;
}
#sideBar #menu-bar {
  background: #252525;
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 30px 30px 30px 30px 1fr 52px 3px;
}
#sideBar #menu-bar.small {
  grid-template-columns: 0px 0px 30px 30px 1fr 52px 3px;
}
#sideBar #menu-bar #add-animation {
  grid-row: 1;
  grid-column: 1;
}
#sideBar #menu-bar #load-animation {
  grid-row: 1;
  grid-column: 2;
}
#sideBar #menu-bar #save-animation {
  grid-row: 1;
  grid-column: 3;
}
#sideBar #menu-bar #edit-animation {
  grid-row: 1;
  grid-column: 4;
}
#sideBar #menu-bar #framerate-animation {
  grid-row: 1;
  grid-column: 6;
}
#sideBar .simple-button {
  width: 80px;
  height: 20px;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
  background: #444444;
  border: 0;
  line-height: 12px;
  cursor: pointer;
  align-self: center;
  justify-self: center;
  border-radius: 0;
}
#sideBar .simple-button:active {
  transform-origin: center;
  transform: scale(0.95);
}
#sideBar #save-animation-pane {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 1fr 40px auto;
}
#sideBar #save-animation-pane #save-animation-list {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: 5px;
}
#sideBar #save-animation-pane #save-animation-list .save-animation-list-entry {
  height: 20px;
  margin-left: 10px;
  display: flex;
  align-content: center;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
  line-height: 15px;
}
#sideBar #save-animation-pane #save-animation-buttons {
  grid-row: 2;
  grid-column: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 10px 1fr 10px 1fr 10px;
  align-items: center;
}
#sideBar #save-animation-pane #save-animation-buttons #save-snippet {
  grid-row: 1;
  grid-column: 2;
}
#sideBar #save-animation-pane #save-animation-buttons #save-file {
  grid-row: 1;
  grid-column: 4;
}
#sideBar #save-animation-pane #save-animation-snippet {
  grid-row: 3;
  grid-column: 1;
  width: calc(100% - 31px);
  height: 20px;
  align-content: center;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
  padding-left: 31px;
  background: #252525;
}
#sideBar #load-animation-pane {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 75px 1fr;
  grid-template-rows: 10px 20px 10px 20px 10px 20px 1fr auto;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
}
#sideBar #load-animation-pane #load-animation-snippet-id-label {
  grid-row: 2;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #load-animation-pane #load-animation-local-file-label {
  grid-row: 6;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #load-animation-pane #load-snippet-id {
  grid-row: 2;
  grid-column: 2;
  margin-right: 10px;
  border: 0;
  background: #252525;
  width: 127px;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
}
#sideBar #load-animation-pane #load-snippet {
  grid-row: 4;
  grid-column: 2;
  width: 60px;
  justify-self: left;
}
#sideBar #load-animation-pane input[type=file] {
  display: none;
}
#sideBar #load-animation-pane #file-snippet-label {
  grid-row: 6;
  grid-column: 2;
  width: 60px;
  justify-self: left;
  text-align: center;
  line-height: 18px;
}
#sideBar #load-animation-pane #load-animation-snippet {
  grid-row: 8;
  grid-column: 1/3;
  width: calc(100% - 31px);
  height: 20px;
  align-content: center;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
  padding-left: 31px;
  background: #252525;
}
#sideBar #add-animation-pane {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 75px 1fr;
  grid-template-rows: 10px 20px 10px 20px 10px 20px 10px 20px 10px 20px 10px 20px 1fr;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
}
#sideBar #add-animation-pane .input-text {
  border: 0;
  background: #252525;
  width: 127px;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
}
#sideBar #add-animation-pane .option {
  background: #252525;
  color: white;
  border: 0;
}
#sideBar #add-animation-pane #add-animation-display-name-label {
  grid-row: 2;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #add-animation-pane #add-animation-mode-label {
  grid-row: 4;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #add-animation-pane #add-animation-property-label {
  grid-row: 6;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #add-animation-pane #add-animation-type-label {
  grid-row: 8;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #add-animation-pane #add-animation-loop-mode-label {
  grid-row: 10;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #add-animation-pane #add-animation-name {
  grid-row: 2;
  grid-column: 2;
  margin-right: 10px;
}
#sideBar #add-animation-pane #add-animation-mode {
  grid-row: 4;
  grid-column: 2;
  margin-right: 10px;
  width: calc(100% - 10px);
}
#sideBar #add-animation-pane #add-animation-property {
  grid-row: 6;
  grid-column: 2;
  margin-right: 10px;
  width: calc(100% - 10px);
}
#sideBar #add-animation-pane #add-animation-type {
  grid-row: 8;
  grid-column: 2;
  margin-right: 10px;
}
#sideBar #add-animation-pane #add-animation-loop-mode {
  grid-row: 10;
  grid-column: 2;
  margin-right: 10px;
}
#sideBar #add-animation-pane #add-animation {
  grid-row: 12;
  grid-column: 2;
  justify-self: left;
}
#sideBar #edit-animation-pane {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 75px 1fr;
  grid-template-rows: 10px 20px 10px 20px 10px 20px 10px 20px 1fr;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
  background: #111111;
}
#sideBar #edit-animation-pane .input-text {
  border: 0;
  background: #252525;
  width: 127px;
  color: white;
  font-family: "acumin-pro-condensed";
  font-size: 10pt;
}
#sideBar #edit-animation-pane .option {
  background: #252525;
  color: white;
  border: 0;
}
#sideBar #edit-animation-pane #edit-animation-display-name-label {
  grid-row: 2;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #edit-animation-pane #edit-animation-property-label {
  grid-row: 4;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #edit-animation-pane #edit-animation-loop-mode-label {
  grid-row: 6;
  grid-column: 1;
  justify-self: end;
  margin-right: 10px;
}
#sideBar #edit-animation-pane #edit-animation-name {
  grid-row: 2;
  grid-column: 2;
  margin-right: 10px;
}
#sideBar #edit-animation-pane #edit-animation-property {
  grid-row: 4;
  grid-column: 2;
  margin-right: 10px;
}
#sideBar #edit-animation-pane #edit-animation-loop-mode {
  grid-row: 6;
  grid-column: 2;
  margin-right: 10px;
}
#sideBar #edit-animation-pane #edit-animation {
  grid-row: 8;
  grid-column: 1/3;
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: 100%;
}
#sideBar #edit-animation-pane #edit-animation #edit-animation-ok {
  grid-row: 1;
  grid-column: 1;
}
#sideBar #edit-animation-pane #edit-animation #edit-animation-cancel {
  grid-row: 1;
  grid-column: 2;
}
#sideBar #animation-list {
  background: #111111;
  grid-row: 2;
  grid-column: 1;
  width: 100%;
  height: 100%;
}
#sideBar #animation-list .animation-entry {
  height: 20px;
  display: grid;
  grid-template-columns: 20px 10px 1fr 20px 20px;
  grid-template-rows: 100%;
}
#sideBar #animation-list .animation-entry.isActive {
  background: #444444;
}
#sideBar #animation-list .animation-entry .animation-active-indicator {
  grid-row: 1;
  grid-column: 1;
  display: grid;
  margin: 5px;
  padding-top: 2px;
}
#sideBar #animation-list .animation-entry .animation-chevron {
  grid-row: 1;
  grid-column: 2;
  display: grid;
  align-content: center;
  padding-top: 5px;
  cursor: pointer;
}
#sideBar #animation-list .animation-entry .animation-chevron .animation-chevron-image.collapsed {
  transform-origin: 50% 50%;
  transform: rotateZ(-90deg);
}
#sideBar #animation-list .animation-entry .animation-name {
  cursor: pointer;
  grid-row: 1;
  grid-column: 3;
  font-family: "acumin-pro-condensed";
  font-size: 10.5pt;
  color: white;
  display: grid;
  align-self: center;
  margin-left: 5px;
  user-select: none;
}
#sideBar #animation-list .animation-entry .animation-options {
  grid-row: 1;
  grid-column: 4;
}
#sideBar #animation-list .animation-entry .animation-delete {
  grid-row: 1;
  grid-column: 5;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/sideBar.scss"],"names":[],"mappings":"AAAA;EACI,aAAA;EACA,2BAAA;EACA,4BAAA;AACJ;AACI;EACI,mBAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,wBAAA;EACA,uDAAA;AACR;AACQ;EACI,qDAAA;AACZ;AAEQ;EACI,WAAA;EACA,cAAA;AAAZ;AAGQ;EACI,WAAA;EACA,cAAA;AADZ;AAIQ;EACI,WAAA;EACA,cAAA;AAFZ;AAKQ;EACI,WAAA;EACA,cAAA;AAHZ;AAMQ;EACI,WAAA;EACA,cAAA;AAJZ;AAQI;EACI,WAAA;EACA,YAAA;EACA,YAAA;EACA,mCAAA;EACA,eAAA;EACA,mBAAA;EACA,SAAA;EACA,iBAAA;EACA,eAAA;EACA,kBAAA;EACA,oBAAA;EACA,gBAAA;AANR;AAQQ;EACI,wBAAA;EACA,sBAAA;AANZ;AAUI;EACI,WAAA;EACA,YAAA;EACA,aAAA;EACA,2BAAA;EACA,iCAAA;AARR;AAUQ;EACI,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;EACA,gBAAA;AARZ;AAUY;EACI,YAAA;EACA,iBAAA;EACA,aAAA;EACA,qBAAA;EACA,YAAA;EAEA,mCAAA;EACA,eAAA;EACA,iBAAA;AAThB;AAaQ;EACI,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,wBAAA;EACA,6CAAA;EACA,mBAAA;AAXZ;AAaY;EACI,WAAA;EACA,cAAA;AAXhB;AAcY;EACI,WAAA;EACA,cAAA;AAZhB;AAgBQ;EACI,WAAA;EACA,cAAA;EACA,wBAAA;EACA,YAAA;EACA,qBAAA;EACA,YAAA;EACA,mCAAA;EACA,eAAA;EACA,kBAAA;EACA,mBAAA;AAdZ;AAkBI;EACI,WAAA;EACA,YAAA;EACA,aAAA;EACA,+BAAA;EACA,0DAAA;EACA,YAAA;EACA,mCAAA;EACA,eAAA;AAhBR;AAkBQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AAhBZ;AAmBQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AAjBZ;AAoBQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,SAAA;EACA,mBAAA;EACA,YAAA;EACA,YAAA;EACA,mCAAA;EACA,eAAA;AAlBZ;AAqBQ;EACI,WAAA;EACA,cAAA;EACA,WAAA;EACA,kBAAA;AAnBZ;AAsBQ;EACI,aAAA;AApBZ;AAuBQ;EACI,WAAA;EACA,cAAA;EACA,WAAA;EACA,kBAAA;EACA,kBAAA;EACA,iBAAA;AArBZ;AAwBQ;EACI,WAAA;EACA,gBAAA;EACA,wBAAA;EACA,YAAA;EACA,qBAAA;EACA,YAAA;EACA,mCAAA;EACA,eAAA;EACA,kBAAA;EACA,mBAAA;AAtBZ;AA0BI;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,+BAAA;EACA,mFAAA;EACA,YAAA;EACA,mCAAA;EACA,eAAA;AAxBR;AA0BQ;EACI,SAAA;EACA,mBAAA;EACA,YAAA;EACA,YAAA;EACA,mCAAA;EACA,eAAA;AAxBZ;AA2BQ;EACI,mBAAA;EACA,YAAA;EACA,SAAA;AAzBZ;AA4BQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AA1BZ;AA6BQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AA3BZ;AA8BQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AA5BZ;AA+BQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AA7BZ;AAgCQ;EACI,YAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AA9BZ;AAiCQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;AA/BZ;AAkCQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,wBAAA;AAhCZ;AAmCQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,wBAAA;AAjCZ;AAoCQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;AAlCZ;AAqCQ;EACI,YAAA;EACA,cAAA;EACA,kBAAA;AAnCZ;AAsCQ;EACI,YAAA;EACA,cAAA;EACA,kBAAA;AApCZ;AAwCI;EACI,cAAA;EACA,WAAA;EAEA,WAAA;EACA,YAAA;EACA,aAAA;EACA,+BAAA;EACA,+DAAA;EACA,YAAA;EACA,mCAAA;EACA,eAAA;EACA,mBAAA;AAvCR;AAyCQ;EACI,SAAA;EACA,mBAAA;EACA,YAAA;EACA,YAAA;EACA,mCAAA;EACA,eAAA;AAvCZ;AA0CQ;EACI,mBAAA;EACA,YAAA;EACA,SAAA;AAxCZ;AA2CQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AAzCZ;AA4CQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AA1CZ;AA6CQ;EACI,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AA3CZ;AA8CQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;AA5CZ;AA+CQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;AA7CZ;AAgDQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;AA9CZ;AAiDQ;EACI,WAAA;EACA,gBAAA;EACA,aAAA;EACA,8BAAA;EACA,wBAAA;AA/CZ;AAiDY;EACI,WAAA;EACA,cAAA;AA/ChB;AAkDY;EACI,WAAA;EACA,cAAA;AAhDhB;AAqDI;EACI,mBAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;AAnDR;AAqDQ;EACI,YAAA;EACA,aAAA;EACA,8CAAA;EACA,wBAAA;AAnDZ;AAqDY;EACI,mBAAA;AAnDhB;AAsDY;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,WAAA;EACA,gBAAA;AApDhB;AAuDY;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,gBAAA;EACA,eAAA;AArDhB;AAwDoB;EACI,yBAAA;EACA,0BAAA;AAtDxB;AA2DY;EACI,eAAA;EACA,WAAA;EACA,cAAA;EACA,mCAAA;EACA,iBAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;AAzDhB;AA4DY;EACI,WAAA;EACA,cAAA;AA1DhB;AA6DY;EACI,WAAA;EACA,cAAA;AA3DhB","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/topBar.scss":
/*!*****************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/topBar.scss ***!
  \*****************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_90179__) => {

"use strict";
__nested_webpack_require_90179__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_90179__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_90179__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_90179__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_90179__(/*! ../../../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_90179__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#top-bar {
  display: grid;
  grid-template-columns: 40px 200px 75px 8px 75px 8px 40px 40px 40px 40px 40px 40px 40px 40px 1fr 40px;
  grid-template-rows: 100%;
}
#top-bar .disabled {
  opacity: 20%;
  pointer-events: none;
}
#top-bar #top-bar-logo {
  grid-row: 1;
  grid-column: 1;
}
#top-bar #top-bar-parent-name {
  grid-row: 1;
  grid-column: 2;
  font-family: "acumin-pro-condensed";
  font-size: 15pt;
  color: white;
  display: grid;
  align-content: center;
  padding-bottom: 5px;
}
#top-bar #key-frame {
  grid-row: 1;
  grid-column: 3;
  height: 24px;
  display: grid;
  align-self: center;
}
#top-bar #key-value {
  grid-row: 1;
  grid-column: 5;
  height: 24px;
  display: grid;
  align-self: center;
}
#top-bar #new-key {
  grid-row: 1;
  grid-column: 7;
}
#top-bar #frame-canvas {
  grid-row: 1;
  grid-column: 8;
}
#top-bar #flatten-tangent {
  grid-row: 1;
  grid-column: 9;
}
#top-bar #linear-tangent {
  grid-row: 1;
  grid-column: 10;
}
#top-bar #break-tangent {
  grid-row: 1;
  grid-column: 11;
}
#top-bar #unify-tangent {
  grid-row: 1;
  grid-column: 12;
}
#top-bar #step-tangent {
  grid-row: 1;
  grid-column: 13;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/topBar.scss"],"names":[],"mappings":"AAAA;EACI,aAAA;EACA,oGAAA;EACA,wBAAA;AACJ;AACI;EACI,YAAA;EACA,oBAAA;AACR;AAEI;EACI,WAAA;EACA,cAAA;AAAR;AAGI;EACI,WAAA;EACA,cAAA;EACA,mCAAA;EACA,eAAA;EACA,YAAA;EACA,aAAA;EACA,qBAAA;EACA,mBAAA;AADR;AAII;EACI,WAAA;EACA,cAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;AAFR;AAKI;EACI,WAAA;EACA,cAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;AAHR;AAMI;EACI,WAAA;EACA,cAAA;AAJR;AAOI;EACI,WAAA;EACA,cAAA;AALR;AAQI;EACI,WAAA;EACA,cAAA;AANR;AASI;EACI,WAAA;EACA,eAAA;AAPR;AAUI;EACI,WAAA;EACA,eAAA;AARR;AAWI;EACI,WAAA;EACA,eAAA;AATR;AAYI;EACI,WAAA;EACA,eAAA;AAVR","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss":
/*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss ***!
  \***************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_94808__) => {

"use strict";
__nested_webpack_require_94808__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_94808__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_94808__(/*! ../../../../../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_94808__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_94808__(/*! ../../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_94808__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#texture-editor {
  height: 100%;
  width: 100%;
  color: white;
  background-color: #1e1e1e;
  font-family: "acumin-pro-condensed";
}
#texture-editor .icon {
  width: 40px;
  height: 40px;
}
#texture-editor .icon.button {
  background-color: #333333;
}
#texture-editor .icon.button:hover {
  background-color: #4a4a4a;
  cursor: pointer;
}
#texture-editor .icon.button.active {
  background-color: #666666;
}
#texture-editor .icon.button:active {
  background-color: #837c7c;
}
#texture-editor .has-tooltip {
  display: inline-block;
}
#texture-editor .has-tooltip .tooltip {
  visibility: hidden;
  background-color: rgb(255, 255, 255);
  z-index: 1;
  position: absolute;
  opacity: 0;
  transition: opacity 0.5s;
  line-height: normal;
  font-size: 14px;
  padding: 0px 5px;
  color: black;
}
#texture-editor .has-tooltip:hover .tooltip {
  visibility: visible;
  opacity: 1;
}
#texture-editor #properties {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  font-size: 12px;
  color: white;
  user-select: none;
  background-color: #333333;
}
#texture-editor #properties .tab {
  display: inline-flex;
  line-height: 40px;
  height: 40px;
  flex-shrink: 0;
  flex-grow: 0;
  border-right: 2px solid #1e1e1e;
  background-color: #333333;
}
#texture-editor #properties #left {
  overflow: hidden;
  height: 40px;
  flex-grow: 1;
  flex-shrink: 1;
  display: flex;
  flex-wrap: wrap;
}
#texture-editor #properties #left #dimensions-tab form {
  display: flex;
}
#texture-editor #properties #left #dimensions-tab label {
  margin-left: 15px;
  font-size: 15px;
  color: #afafaf;
}
#texture-editor #properties #left #dimensions-tab label input {
  width: 40px;
  height: 24px;
  background-color: #000000;
  color: #ffffff;
  border: 0;
  font-size: 12px;
  text-align: "left";
  font-family: "acumin-pro-condensed";
  font-size: 15px;
  padding-left: 8px;
}
#texture-editor #properties #left #dimensions-tab label:last-of-type {
  margin-right: 8px;
}
#texture-editor #properties #right-tab {
  margin-right: 0;
  flex-grow: 0;
  flex-shrink: 0;
}
#texture-editor #properties #right-tab input[type=file] {
  display: none;
}
#texture-editor #properties .pixel-data {
  width: 45px;
  color: #afafaf;
  display: flex;
  justify-content: space-between;
  font-size: 15px;
}
#texture-editor #properties .pixel-data:first-of-type {
  margin-left: 15px;
}
#texture-editor #properties .pixel-data:last-of-type {
  padding-right: 15px;
}
#texture-editor #properties .pixel-data .value {
  display: inline-block;
  width: 30px;
  color: white;
}
#texture-editor #toolbar {
  position: absolute;
  top: 60px;
  left: 0;
  width: 40px;
  display: flex;
  flex-direction: column;
  justify-content: left;
}
#texture-editor #toolbar #tools {
  display: flex;
  flex-direction: column;
}
#texture-editor #toolbar #add-tool {
  position: relative;
}
#texture-editor #toolbar #add-tool #add-tool-popup {
  background-color: #333333;
  width: 348px;
  margin-left: 40px;
  position: absolute;
  top: 0px;
  height: 40px;
  padding-left: 4px;
  line-height: 40px;
  user-select: none;
}
#texture-editor #toolbar #add-tool #add-tool-popup button {
  background: #222222;
  border: 1px solid rgb(51, 122, 183);
  margin: 5px 10px 5px 10px;
  color: white;
  padding: 4px 5px;
  opacity: 0.9;
  cursor: pointer;
}
#texture-editor #toolbar #color {
  margin-top: 8px;
}
#texture-editor #toolbar #color #active-color-bg {
  border-radius: 50%;
  width: 20px;
  height: 20px;
  margin: 10px;
  position: relative;
  background-image: linear-gradient(45deg, #808080 25%, transparent 25%), linear-gradient(-45deg, #808080 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #808080 75%), linear-gradient(-45deg, transparent 75%, #808080 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
#texture-editor #toolbar #color #active-color {
  width: 20px;
  height: 20px;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
}
#texture-editor #toolbar #color-picker {
  position: absolute;
  margin-left: 40px;
}
#texture-editor #channels-bar {
  position: absolute;
  top: 60px;
  right: 0;
  width: 80px;
  background: #666666;
  user-select: none;
}
#texture-editor #channels-bar .channel {
  color: white;
  border-bottom: 2px solid #232323;
  width: 80px;
  height: 40px;
  font-size: 16px;
  display: flex;
  align-items: center;
}
#texture-editor #channels-bar .channel.uneditable {
  background: #333333;
}
#texture-editor #channels-bar .channel:hover {
  cursor: pointer;
}
#texture-editor #channels-bar .channel:last-of-type {
  border-bottom: none;
}
#texture-editor #canvas-ui {
  width: 100%;
  height: calc(100% - 70px);
  outline: none;
}
#texture-editor #tool-ui {
  background-color: #333;
  position: absolute;
  right: 0;
  bottom: 30px;
}
#texture-editor #tool-ui label {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#texture-editor #tool-ui input[type=range] {
  background: #d3d3d3;
}
#texture-editor #bottom-bar {
  height: 30px;
  width: 100%;
  background-color: #333333;
  font-size: 14px;
  user-select: none;
  line-height: 30px;
  position: relative;
}
#texture-editor #bottom-bar #file-url {
  left: 30px;
  position: absolute;
}
#texture-editor #bottom-bar #mip-level {
  right: 30px;
  position: absolute;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss"],"names":[],"mappings":"AAAA;EACI,YAAA;EACA,WAAA;EACA,YAAA;EACA,yBAAA;EACA,mCAAA;AACJ;AACI;EACI,WAAA;EACA,YAAA;AACR;AAAQ;EACI,yBAAA;AAEZ;AADY;EACI,yBAAA;EACA,eAAA;AAGhB;AAAY;EACI,yBAAA;AAEhB;AACY;EACI,yBAAA;AAChB;AAII;EACI,qBAAA;AAFR;AAGQ;EACI,kBAAA;EACA,oCAAA;EACA,UAAA;EACA,kBAAA;EACA,UAAA;EACA,wBAAA;EACA,mBAAA;EACA,eAAA;EACA,gBAAA;EACA,YAAA;AADZ;AAIQ;EACI,mBAAA;EACA,UAAA;AAFZ;AAMI;EACI,WAAA;EACA,YAAA;EAEA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,YAAA;EACA,iBAAA;EACA,yBAAA;AALR;AAOQ;EACI,oBAAA;EACA,iBAAA;EACA,YAAA;EACA,cAAA;EACA,YAAA;EACA,+BAAA;EACA,yBAAA;AALZ;AAOQ;EACI,gBAAA;EACA,YAAA;EACA,YAAA;EACA,cAAA;EACA,aAAA;EACA,eAAA;AALZ;AAOgB;EACI,aAAA;AALpB;AAOgB;EACI,iBAAA;EACA,eAAA;EACA,cAAA;AALpB;AAMoB;EACI,WAAA;EACA,YAAA;EACA,yBAAA;EACA,cAAA;EACA,SAAA;EACA,eAAA;EACA,kBAAA;EACA,mCAAA;EACA,eAAA;EACA,iBAAA;AAJxB;AAOoB;EACI,iBAAA;AALxB;AAUQ;EACI,eAAA;EACA,YAAA;EACA,cAAA;AARZ;AAUY;EACI,aAAA;AARhB;AAYQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,8BAAA;EACA,eAAA;AAVZ;AAWY;EACI,iBAAA;AAThB;AAWY;EACI,mBAAA;AAThB;AAWY;EACI,qBAAA;EACA,WAAA;EACA,YAAA;AAThB;AAcI;EACI,kBAAA;EACA,SAAA;EACA,OAAA;EACA,WAAA;EACA,aAAA;EACA,sBAAA;EACA,qBAAA;AAZR;AAcQ;EACI,aAAA;EACA,sBAAA;AAZZ;AAeQ;EACI,kBAAA;AAbZ;AAcY;EACI,yBAAA;EACA,YAAA;EACA,iBAAA;EACA,kBAAA;EACA,QAAA;EACA,YAAA;EACA,iBAAA;EACA,iBAAA;EACA,iBAAA;AAZhB;AAagB;EACI,mBAAA;EACA,mCAAA;EACA,yBAAA;EACA,YAAA;EACA,gBAAA;EACA,YAAA;EACA,eAAA;AAXpB;AAgBQ;EACI,eAAA;AAdZ;AAeY;EACI,kBAAA;EACA,WAAA;EACA,YAAA;EACA,YAAA;EACA,kBAAA;EACA,0OAAA;EAEA,0BAAA;EACA,uDACI;AAfpB;AAoBY;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;EACA,kBAAA;AAlBhB;AAqBQ;EACI,kBAAA;EACA,iBAAA;AAnBZ;AAuBI;EACI,kBAAA;EACA,SAAA;EACA,QAAA;EACA,WAAA;EACA,mBAAA;EACA,iBAAA;AArBR;AAsBQ;EACI,YAAA;EACA,gCAAA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;AApBZ;AAsBY;EACI,mBAAA;AApBhB;AAuBY;EACI,eAAA;AArBhB;AAwBY;EACI,mBAAA;AAtBhB;AA2BI;EACI,WAAA;EACA,yBAAA;EACA,aAAA;AAzBR;AA4BI;EACI,sBAAA;EACA,kBAAA;EACA,QAAA;EACA,YAAA;AA1BR;AA4BQ;EACI,aAAA;EACA,sBAAA;EACA,mBAAA;AA1BZ;AA6BQ;EACI,mBAAA;AA3BZ;AA+BI;EACI,YAAA;EACA,WAAA;EACA,yBAAA;EACA,eAAA;EACA,iBAAA;EACA,iBAAA;EACA,kBAAA;AA7BR;AA8BQ;EACI,UAAA;EACA,kBAAA;AA5BZ;AA8BQ;EACI,WAAA;EACA,kBAAA;AA5BZ","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGrid.scss":
/*!************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGrid.scss ***!
  \************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_105190__) => {

"use strict";
__nested_webpack_require_105190__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_105190__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_105190__(/*! ../../../../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_105190__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_105190__(/*! ../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_105190__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#metadata-container textarea {
  display: block;
  margin: 4px;
  width: calc(100% - 14px);
  min-height: 100px;
  max-height: 500px;
  resize: vertical;
}

.meta-string textarea {
  background: #ffee99;
}

.meta-json textarea {
  background: #99ddff;
}

.meta-object textarea {
  background: #dd99ff;
}

.meta-object-protect textarea {
  background: #b0b0b0;
}

.buttonLine.disabled {
  opacity: 20%;
  pointer-events: none;
}

.copy-root {
  display: grid;
  justify-content: end;
  height: 30px;
}

.copy-container {
  height: 30px;
  width: 30px;
  cursor: pointer;
}

.hoverIcon:hover {
  opacity: 0.8;
}

.type-status {
  padding: 5px 15px;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGrid.scss"],"names":[],"mappings":"AACI;EACI,cAAA;EACA,WAAA;EACA,wBAAA;EACA,iBAAA;EACA,iBAAA;EACA,gBAAA;AAAR;;AAKI;EACI,mBAAA;AAFR;;AAOI;EACI,mBAAA;AAJR;;AASI;EACI,mBAAA;AANR;;AAWI;EACI,mBAAA;AARR;;AAaI;EACI,YAAA;EACA,oBAAA;AAVR;;AAcA;EACI,aAAA;EACA,oBAAA;EACA,YAAA;AAXJ;;AAcA;EACI,YAAA;EACA,WAAA;EACA,eAAA;AAXJ;;AAcA;EACI,YAAA;AAXJ;;AAcA;EACI,iBAAA;AAXJ","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/embedHost/embedHost.scss":
/*!********************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/embedHost/embedHost.scss ***!
  \********************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_108930__) => {

"use strict";
__nested_webpack_require_108930__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_108930__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_108930__(/*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_108930__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_108930__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_108930__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#embed-host {
  position: absolute;
  right: 0px;
  top: 0px;
  bottom: 0px;
  z-index: 10;
}

#__resizable_base__ {
  display: none;
}

#embed {
  background: #333333;
  height: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: 30px 1fr;
  font: 14px "Arial";
  overflow: hidden;
}
#embed #header {
  font-size: 16px;
  color: white;
  background: #222222;
  grid-row: 1;
  text-align: center;
  display: grid;
  grid-template-columns: 30px 1fr 50px;
  user-select: none;
}
#embed #header #logo {
  grid-column: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-self: center;
  justify-self: center;
}
#embed #header #back {
  grid-column: 1;
  display: grid;
  align-self: center;
  justify-self: center;
  cursor: pointer;
}
#embed #header #title {
  grid-column: 2;
  display: grid;
  align-items: center;
  text-align: center;
}
#embed #header #commands {
  grid-column: 3;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 1fr;
}
#embed #header #commands .expand {
  grid-column: 1;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#embed #header #commands .close {
  grid-column: 2;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#embed #split {
  grid-row: 2;
  overflow: hidden;
}
#embed #split.splitPopup {
  display: grid;
  grid-template-rows: 300px 2px 1fr;
}
#embed #split.splitPopup .panes {
  margin-bottom: 1px;
}
#embed #split #topPart {
  grid-row: 1;
  overflow: hidden;
  display: grid;
  grid-auto-rows: 100%;
}
#embed #split #separator {
  grid-row: 2;
  background: white;
  opacity: 0.1;
}
#embed #split #bottomPart {
  overflow: hidden;
  grid-row: 3;
  display: grid;
  grid-auto-rows: 100%;
}
#embed #split .gutter.gutter-vertical {
  background-image: none;
  background: #444444;
  cursor: row-resize;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/embedHost/embedHost.scss"],"names":[],"mappings":"AAAA;EACI,kBAAA;EACA,UAAA;EACA,QAAA;EACA,WAAA;EACA,WAAA;AACJ;;AAEA;EACI,aAAA;AACJ;;AAEA;EACI,mBAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,aAAA;EACA,4BAAA;EACA,kBAAA;EACA,gBAAA;AACJ;AACI;EACI,eAAA;EACA,YAAA;EACA,mBAAA;EACA,WAAA;EACA,kBAAA;EACA,aAAA;EACA,oCAAA;EACA,iBAAA;AACR;AACQ;EACI,cAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;AACZ;AAEQ;EACI,cAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;EACA,eAAA;AAAZ;AAGQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;AADZ;AAIQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,8BAAA;AAFZ;AAIY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAFhB;AAKY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAHhB;AAQI;EACI,WAAA;EACA,gBAAA;AANR;AAQQ;EACI,aAAA;EACA,iCAAA;AANZ;AAQY;EACI,kBAAA;AANhB;AAUQ;EACI,WAAA;EACA,gBAAA;EACA,aAAA;EACA,oBAAA;AARZ;AAWQ;EACI,WAAA;EACA,iBAAA;EACA,YAAA;AATZ;AAYQ;EACI,gBAAA;EACA,WAAA;EACA,aAAA;EACA,oBAAA;AAVZ;AAaQ;EACI,sBAAA;EACA,mBAAA;EACA,kBAAA;AAXZ","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/sceneExplorer/sceneExplorer.scss":
/*!****************************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/sceneExplorer/sceneExplorer.scss ***!
  \****************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_114442__) => {

"use strict";
__nested_webpack_require_114442__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_114442__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_114442__(/*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_114442__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_114442__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_114442__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `#scene-explorer-host {
  position: absolute;
  left: 0px;
  top: 0px;
  bottom: 0px;
}
#scene-explorer-host:focus {
  outline: none;
}

#__resizable_base__ {
  display: none;
}

.context-menu {
  background: #222222;
}
.context-menu .react-contextmenu-item {
  padding: 10px;
  cursor: pointer;
}
.context-menu .react-contextmenu-item:hover {
  background: #555555;
}

.react-contextmenu.context-menu.react-contextmenu--visible {
  z-index: 99;
  transform: scale(1);
}

#sceneExplorer {
  background: #333333;
  height: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  font: 14px "Arial";
}
#sceneExplorer:focus {
  outline: none;
}
#sceneExplorer #header {
  height: 30px;
  font-size: 16px;
  color: white;
  background: #222222;
  grid-row: 1;
  text-align: center;
  display: grid;
  grid-template-columns: 30px 1fr 50px;
  user-select: none;
}
#sceneExplorer #header #logo {
  position: relative;
  grid-column: 1;
  width: 24px;
  height: 24px;
  left: 0;
  display: flex;
  align-self: center;
  justify-self: center;
}
#sceneExplorer #header #title {
  grid-column: 2;
  display: grid;
  align-items: center;
  text-align: center;
}
#sceneExplorer #header #commands {
  grid-column: 3;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 1fr;
}
#sceneExplorer #header #commands .expand {
  grid-column: 1;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#sceneExplorer #header #commands .close {
  grid-column: 2;
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#sceneExplorer #tree {
  grid-row: 2;
  overflow-x: hidden;
  overflow-y: auto;
}
#sceneExplorer .filter {
  display: flex;
  align-items: stretch;
}
#sceneExplorer .filter input {
  width: 100%;
  margin: 10px 40px 5px 40px;
  display: block;
  border: none;
  padding: 0;
  border-bottom: solid 1px rgb(51, 122, 183);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, rgb(51, 122, 183) 4%);
  background-position: -1000px 0;
  background-size: 1000px 100%;
  background-repeat: no-repeat;
  color: white;
}
#sceneExplorer .filter input::placeholder {
  color: lightgray;
}
#sceneExplorer .filter input:focus {
  box-shadow: none;
  outline: none;
  background-position: 0 0;
}
#sceneExplorer .groupContainer {
  margin-left: 0px;
  color: white;
  margin-top: 0px;
  margin-bottom: 0px;
  height: 24px;
  user-select: none;
  align-self: center;
  display: grid;
  align-items: center;
}
#sceneExplorer .groupContainer:hover {
  background: #444444;
}
#sceneExplorer .groupContainer .expandableHeader {
  display: grid;
  grid-template-columns: 1fr 20px;
}
#sceneExplorer .groupContainer .expandableHeader .text {
  grid-column: 1;
  display: grid;
  grid-template-columns: 20px 1fr;
}
#sceneExplorer .groupContainer .expandableHeader .text .arrow {
  grid-column: 1;
  margin-left: 0px;
  color: white;
  cursor: pointer;
  display: inline-block;
  margin-right: 6px;
  opacity: 0.5;
}
#sceneExplorer .groupContainer .expandableHeader .text .text-value {
  grid-column: 2;
  display: flex;
  align-items: center;
}
#sceneExplorer .groupContainer .expandableHeader .expandAll {
  opacity: 0.5;
  grid-column: 2;
  margin-right: 10px;
}
#sceneExplorer .icon {
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#sceneExplorer .itemContainer {
  margin-left: 0px;
  color: white;
  margin-top: 0px;
  margin-bottom: 0px;
  height: 24px;
  user-select: none;
  display: grid;
  grid-template-columns: 20px 1fr;
}
#sceneExplorer .itemContainer:hover {
  background: #444444;
}
#sceneExplorer .itemContainer.selected {
  background: #bbbbbb;
  color: black;
}
#sceneExplorer .itemContainer .isNotActive {
  opacity: 0.3;
}
#sceneExplorer .itemContainer .arrow {
  grid-column: 1;
  color: white;
  opacity: 0.6;
}
#sceneExplorer .itemContainer .popup {
  width: 200px;
  visibility: hidden;
  background-color: #444444;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: absolute;
  z-index: 1;
  margin-left: -180px;
  box-sizing: border-box;
}
#sceneExplorer .itemContainer .popup.show {
  visibility: visible;
}
#sceneExplorer .itemContainer .popup:focus {
  outline: none;
}
#sceneExplorer .itemContainer .popup .popupMenu {
  padding: 6px 5px 5px 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  height: 18px;
}
#sceneExplorer .itemContainer .popup .popupMenu:hover {
  background: white;
  color: #333333;
}
#sceneExplorer .itemContainer .sceneNode {
  grid-column: 2;
  margin-left: -10px;
  display: grid;
  grid-template-columns: 1fr 20px 20px 20px 20px 10px 20px 20px auto 5px;
  align-items: center;
  cursor: pointer;
}
#sceneExplorer .itemContainer .sceneNode .sceneTitle {
  grid-column: 1;
  margin-right: 5px;
  display: flex;
  align-items: center;
  height: 24px;
}
#sceneExplorer .itemContainer .sceneNode .translation {
  grid-column: 2;
  opacity: 0.6;
}
#sceneExplorer .itemContainer .sceneNode .translation.selected {
  opacity: 1;
}
#sceneExplorer .itemContainer .sceneNode .rotation {
  grid-column: 3;
  opacity: 0.6;
}
#sceneExplorer .itemContainer .sceneNode .rotation.selected {
  opacity: 1;
}
#sceneExplorer .itemContainer .sceneNode .scaling {
  grid-column: 4;
  opacity: 0.6;
}
#sceneExplorer .itemContainer .sceneNode .scaling.selected {
  opacity: 1;
}
#sceneExplorer .itemContainer .sceneNode .bounding {
  grid-column: 5;
  opacity: 0.6;
}
#sceneExplorer .itemContainer .sceneNode .bounding.selected {
  opacity: 1;
}
#sceneExplorer .itemContainer .sceneNode .separator {
  grid-column: 6;
  margin-left: 5px;
  width: 5px;
  display: flex;
  align-items: center;
  height: 18px;
  border-left: solid 1px rgb(51, 122, 183);
}
#sceneExplorer .itemContainer .sceneNode .pickingMode {
  grid-column: 7;
  opacity: 0.6;
}
#sceneExplorer .itemContainer .sceneNode .pickingMode.selected {
  opacity: 1;
}
#sceneExplorer .itemContainer .sceneNode .coordinates {
  grid-column: 8;
  opacity: 0.6;
}
#sceneExplorer .itemContainer .sceneNode .coordinates.selected {
  opacity: 1;
}
#sceneExplorer .itemContainer .sceneNode .refresh {
  grid-column: 9;
}
#sceneExplorer .itemContainer .sceneNode .extensions {
  width: 20px;
  grid-column: 10;
}
#sceneExplorer .itemContainer .targetedAnimationTools {
  grid-column: 2;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
  min-width: 0;
}
#sceneExplorer .itemContainer .targetedAnimationTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .animationGroupTools {
  grid-column: 2;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
  min-width: 0;
}
#sceneExplorer .itemContainer .animationGroupTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .soundTools {
  grid-column: 2;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
  min-width: 0;
}
#sceneExplorer .itemContainer .soundTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .meshTools {
  grid-column: 2;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 20px 20px auto 5px;
  align-items: center;
  min-width: 0;
}
#sceneExplorer .itemContainer .meshTools .edit {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .meshTools .bounding-box {
  grid-column: 3;
  opacity: 0.5;
}
#sceneExplorer .itemContainer .meshTools .bounding-box.selected {
  opacity: 1;
}
#sceneExplorer .itemContainer .meshTools .visibility {
  grid-column: 4;
}
#sceneExplorer .itemContainer .meshTools .extensions {
  width: 20px;
  grid-column: 5;
}
#sceneExplorer .itemContainer .cameraTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 20px 20px auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .cameraTools .activeCamera {
  grid-column: 2;
}
#sceneExplorer .itemContainer .cameraTools .enableGizmo {
  grid-column: 3;
}
#sceneExplorer .itemContainer .cameraTools .extensions {
  width: 20px;
  grid-column: 4;
}
#sceneExplorer .itemContainer .lightTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 20px 20px auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .lightTools .visibility {
  grid-column: 2;
}
#sceneExplorer .itemContainer .lightTools .enableGizmo {
  grid-column: 3;
}
#sceneExplorer .itemContainer .lightTools .extensions {
  width: 20px;
  grid-column: 4;
}
#sceneExplorer .itemContainer .spriteTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .spriteTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .spriteManagerTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .spriteManagerTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .materialTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .materialTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .materialTools .icon {
  display: grid;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}
#sceneExplorer .itemContainer .particleSystemTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .particleSystemTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .effectLayerTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .effectLayerTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .postProcessTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .postProcessTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .renderingPipelineTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .renderingPipelineTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .textureTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .textureTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .adtextureTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 20px 20px auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .adtextureTools .edit {
  grid-column: 2;
}
#sceneExplorer .itemContainer .adtextureTools .pickingMode {
  grid-column: 3;
  opacity: 0.6;
}
#sceneExplorer .itemContainer .adtextureTools .pickingMode.selected {
  opacity: 1;
}
#sceneExplorer .itemContainer .adtextureTools .extensions {
  width: 20px;
  grid-column: 3;
}
#sceneExplorer .itemContainer .controlTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 20px 20px auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .controlTools .highlight {
  grid-column: 2;
}
#sceneExplorer .itemContainer .controlTools .visibility {
  grid-column: 3;
}
#sceneExplorer .itemContainer .controlTools .extensions {
  width: 20px;
  grid-column: 4;
}
#sceneExplorer .itemContainer .transformNodeTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .transformNodeTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .skeletonTools {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto 5px;
  align-items: center;
}
#sceneExplorer .itemContainer .skeletonTools .extensions {
  width: 20px;
  grid-column: 2;
}
#sceneExplorer .itemContainer .title {
  grid-column: 1;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  margin-right: 5px;
  display: grid;
  align-items: center;
  grid-template-columns: 25px 1fr;
  height: 24px;
  cursor: pointer;
}
#sceneExplorer .itemContainer .title .titleIcon {
  grid-column: 1;
  display: grid;
  align-items: center;
  justify-items: center;
}
#sceneExplorer .itemContainer .title .titleText {
  grid-column: 2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}`, "",{"version":3,"sources":["webpack://./../../../dev/inspector/dist/components/sceneExplorer/sceneExplorer.scss"],"names":[],"mappings":"AAAA;EACI,kBAAA;EACA,SAAA;EACA,QAAA;EACA,WAAA;AACJ;AACI;EACI,aAAA;AACR;;AAGA;EACI,aAAA;AAAJ;;AAGA;EACI,mBAAA;AAAJ;AAEI;EACI,aAAA;EACA,eAAA;AAAR;AAEQ;EACI,mBAAA;AAAZ;;AAKA;EACI,WAAA;EACA,mBAAA;AAFJ;;AAKA;EACI,mBAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,aAAA;EACA,4BAAA;EACA,kBAAA;AAFJ;AAII;EACI,aAAA;AAFR;AAKI;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,mBAAA;EACA,WAAA;EACA,kBAAA;EACA,aAAA;EACA,oCAAA;EACA,iBAAA;AAHR;AAKQ;EACI,kBAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,OAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;AAHZ;AAMQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;AAJZ;AAOQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,8BAAA;AALZ;AAOY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AALhB;AAQY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AANhB;AAWI;EACI,WAAA;EAEA,kBAAA;EACA,gBAAA;AAVR;AAaI;EACI,aAAA;EACA,oBAAA;AAXR;AAaQ;EACI,WAAA;EACA,0BAAA;EACA,cAAA;EACA,YAAA;EACA,UAAA;EACA,0CAAA;EACA,wFAAA;EACA,8BAAA;EACA,4BAAA;EACA,4BAAA;EACA,YAAA;AAXZ;AAcQ;EACI,gBAAA;AAZZ;AAeQ;EACI,gBAAA;EACA,aAAA;EACA,wBAAA;AAbZ;AAiBI;EACI,gBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;EAEA,iBAAA;EAEA,kBAAA;EACA,aAAA;EACA,mBAAA;AAjBR;AAmBQ;EACI,mBAAA;AAjBZ;AAoBQ;EACI,aAAA;EACA,+BAAA;AAlBZ;AAoBY;EACI,cAAA;EACA,aAAA;EACA,+BAAA;AAlBhB;AAoBgB;EACI,cAAA;EACA,gBAAA;EACA,YAAA;EACA,eAAA;EACA,qBAAA;EACA,iBAAA;EACA,YAAA;AAlBpB;AAqBgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAnBpB;AAuBY;EACI,YAAA;EACA,cAAA;EACA,kBAAA;AArBhB;AA0BI;EACI,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAxBR;AA2BI;EACI,gBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;EACA,iBAAA;EACA,aAAA;EACA,+BAAA;AAzBR;AA2BQ;EACI,mBAAA;AAzBZ;AA4BQ;EACI,mBAAA;EACA,YAAA;AA1BZ;AA6BQ;EACI,YAAA;AA3BZ;AA8BQ;EACI,cAAA;EACA,YAAA;EACA,YAAA;AA5BZ;AA+BQ;EACI,YAAA;EACA,kBAAA;EACA,yBAAA;EACA,WAAA;EACA,0CAAA;EACA,kBAAA;EACA,UAAA;EACA,mBAAA;EACA,sBAAA;AA7BZ;AA+BY;EACI,mBAAA;AA7BhB;AAgCY;EACI,aAAA;AA9BhB;AAiCY;EACI,yBAAA;EACA,gBAAA;EACA,mBAAA;EACA,uBAAA;EACA,YAAA;AA/BhB;AAiCgB;EACI,iBAAA;EACA,cAAA;AA/BpB;AAoCQ;EACI,cAAA;EACA,kBAAA;EACA,aAAA;EACA,sEAAA;EACA,mBAAA;EACA,eAAA;AAlCZ;AAoCY;EACI,cAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;AAlChB;AAqCY;EACI,cAAA;EACA,YAAA;AAnChB;AAqCgB;EACI,UAAA;AAnCpB;AAuCY;EACI,cAAA;EACA,YAAA;AArChB;AAuCgB;EACI,UAAA;AArCpB;AAyCY;EACI,cAAA;EACA,YAAA;AAvChB;AAwCgB;EACI,UAAA;AAtCpB;AA0CY;EACI,cAAA;EACA,YAAA;AAxChB;AAyCgB;EACI,UAAA;AAvCpB;AA2CY;EACI,cAAA;EACA,gBAAA;EACA,UAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;EACA,wCAAA;AAzChB;AA4CY;EACI,cAAA;EACA,YAAA;AA1ChB;AA4CgB;EACI,UAAA;AA1CpB;AA8CY;EACI,cAAA;EACA,YAAA;AA5ChB;AA8CgB;EACI,UAAA;AA5CpB;AAgDY;EACI,cAAA;AA9ChB;AAiDY;EACI,WAAA;EACA,eAAA;AA/ChB;AAmDQ;EACI,cAAA;EACA,WAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;EACA,YAAA;AAjDZ;AAmDY;EACI,WAAA;EACA,cAAA;AAjDhB;AAqDQ;EACI,cAAA;EACA,WAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;EACA,YAAA;AAnDZ;AAqDY;EACI,WAAA;EACA,cAAA;AAnDhB;AAuDQ;EACI,cAAA;EACA,WAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;EACA,YAAA;AArDZ;AAuDY;EACI,WAAA;EACA,cAAA;AArDhB;AAyDQ;EACI,cAAA;EACA,WAAA;EACA,aAAA;EACA,kDAAA;EACA,mBAAA;EACA,YAAA;AAvDZ;AAyDY;EACI,WAAA;EACA,cAAA;AAvDhB;AA0DY;EACI,cAAA;EACA,YAAA;AAxDhB;AA0DgB;EACI,UAAA;AAxDpB;AA4DY;EACI,cAAA;AA1DhB;AA6DY;EACI,WAAA;EACA,cAAA;AA3DhB;AA+DQ;EACI,cAAA;EACA,aAAA;EACA,6CAAA;EACA,mBAAA;AA7DZ;AA+DY;EACI,cAAA;AA7DhB;AAgEY;EACI,cAAA;AA9DhB;AAiEY;EACI,WAAA;EACA,cAAA;AA/DhB;AAmEQ;EACI,cAAA;EACA,aAAA;EACA,6CAAA;EACA,mBAAA;AAjEZ;AAmEY;EACI,cAAA;AAjEhB;AAoEY;EACI,cAAA;AAlEhB;AAqEY;EACI,WAAA;EACA,cAAA;AAnEhB;AAuEQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AArEZ;AAuEY;EACI,WAAA;EACA,cAAA;AArEhB;AAyEQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AAvEZ;AAyEY;EACI,WAAA;EACA,cAAA;AAvEhB;AA2EQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AAzEZ;AA2EY;EACI,WAAA;EACA,cAAA;AAzEhB;AA4EY;EACI,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AA1EhB;AA8EQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AA5EZ;AA8EY;EACI,WAAA;EACA,cAAA;AA5EhB;AAgFQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AA9EZ;AAgFY;EACI,WAAA;EACA,cAAA;AA9EhB;AAkFQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AAhFZ;AAkFY;EACI,WAAA;EACA,cAAA;AAhFhB;AAoFQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AAlFZ;AAoFY;EACI,WAAA;EACA,cAAA;AAlFhB;AAsFQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AApFZ;AAsFY;EACI,WAAA;EACA,cAAA;AApFhB;AAwFQ;EACI,cAAA;EACA,aAAA;EACA,6CAAA;EACA,mBAAA;AAtFZ;AAwFY;EACI,cAAA;AAtFhB;AAyFY;EACI,cAAA;EACA,YAAA;AAvFhB;AAyFgB;EACI,UAAA;AAvFpB;AA2FY;EACI,WAAA;EACA,cAAA;AAzFhB;AA6FQ;EACI,cAAA;EACA,aAAA;EACA,6CAAA;EACA,mBAAA;AA3FZ;AA6FY;EACI,cAAA;AA3FhB;AA8FY;EACI,cAAA;AA5FhB;AA+FY;EACI,WAAA;EACA,cAAA;AA7FhB;AAiGQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AA/FZ;AAiGY;EACI,WAAA;EACA,cAAA;AA/FhB;AAmGQ;EACI,cAAA;EACA,aAAA;EACA,mCAAA;EACA,mBAAA;AAjGZ;AAmGY;EACI,WAAA;EACA,cAAA;AAjGhB;AAqGQ;EACI,cAAA;EACA,uBAAA;EACA,mBAAA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,+BAAA;EACA,YAAA;EACA,eAAA;AAnGZ;AAqGY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;AAnGhB;AAsGY;EACI,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;AApGhB","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss":
/*!**********************************************************************************************************************************************************************************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss ***!
  \**********************************************************************************************************************************************************************************************************************************/
/***/ ((module, __nested_webpack_exports__, __nested_webpack_require_134547__) => {

"use strict";
__nested_webpack_require_134547__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_134547__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_134547__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_134547__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_134547__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../../../node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_134547__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.color-picker-container {
  width: 320px;
  height: 300px;
  background-color: white;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 50% 50px 60px 40px 1fr auto;
  font-family: "acumin-pro-condensed";
  font-weight: normal;
  font-size: 14px;
}
.color-picker-container.with-hints {
  height: 380px;
}
.color-picker-container .color-picker-saturation {
  grid-row: 1;
  grid-column: 1;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 100%;
  position: relative;
  cursor: pointer;
}
.color-picker-container .color-picker-saturation .color-picker-saturation-white {
  grid-row: 1;
  grid-column: 1;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
.color-picker-container .color-picker-saturation .color-picker-saturation-black {
  grid-row: 1;
  grid-column: 1;
  background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));
}
.color-picker-container .color-picker-saturation .color-picker-saturation-cursor {
  pointer-events: none;
  width: 4px;
  height: 4px;
  box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  transform: translate(-2px, -2px);
  position: absolute;
}
.color-picker-container .color-picker-hue {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  margin: 10px;
  grid-template-columns: 24% 76%;
  grid-template-rows: 100%;
}
.color-picker-container .color-picker-hue .color-picker-hue-color {
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  justify-self: center;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  border: 1px solid black;
}
.color-picker-container .color-picker-hue .color-picker-hue-slider {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  height: 16px;
  position: relative;
  cursor: pointer;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.color-picker-container .color-picker-hue .color-picker-hue-slider .color-picker-hue-cursor {
  pointer-events: none;
  width: 8px;
  height: 18px;
  transform: translate(-4px, -2px);
  background-color: rgb(248, 248, 248);
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
  position: absolute;
}
.color-picker-container .color-picker-component {
  display: grid;
  margin: 5px;
  grid-template-columns: 100%;
  grid-template-rows: 50% 50%;
}
.color-picker-container .color-picker-component .color-picker-component-value {
  justify-self: center;
  align-self: center;
  grid-row: 1;
  grid-column: 1;
  margin-bottom: 4px;
}
.color-picker-container .color-picker-component .color-picker-component-value input {
  width: 50px;
}
.color-picker-container .color-picker-component .color-picker-component-label {
  justify-self: center;
  align-self: center;
  grid-row: 2;
  grid-column: 1;
  color: black;
}
.color-picker-container .color-picker-rgb {
  grid-row: 3;
  grid-column: 1;
  display: grid;
  margin: 10px;
  grid-template-columns: 20% 6.66% 20% 6.66% 20% 6.66% 20%;
  grid-template-rows: 100%;
}
.color-picker-container .red {
  grid-row: 1;
  grid-column: 1;
}
.color-picker-container .green {
  grid-row: 1;
  grid-column: 3;
}
.color-picker-container .blue {
  grid-row: 1;
  grid-column: 5;
}
.color-picker-container .alpha {
  grid-row: 1;
  grid-column: 7;
}
.color-picker-container .alpha.grayed {
  opacity: 0.5;
}
.color-picker-container .color-picker-hex {
  grid-row: 4;
  grid-column: 1;
  display: grid;
  grid-template-columns: 20% 80%;
  grid-template-rows: 100%;
}
.color-picker-container .color-picker-hex .color-picker-hex-label {
  justify-self: center;
  align-self: center;
  grid-row: 1;
  grid-column: 1;
  margin-left: 10px;
  color: black;
}
.color-picker-container .color-picker-hex .color-picker-hex-value {
  justify-self: left;
  align-self: center;
  grid-row: 1;
  grid-column: 2;
  margin-left: 10px;
  margin-right: 10px;
}
.color-picker-container .color-picker-hex .color-picker-hex-value input {
  width: 70px;
}
.color-picker-container .color-picker-warning {
  color: black;
  font-size: 11px;
  padding: 4px;
  justify-self: left;
  align-self: center;
  grid-row: 6;
  grid-column: 1;
}`, "",{"version":3,"sources":["webpack://./../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss"],"names":[],"mappings":"AAAA;EACI,YAAA;EACA,aAAA;EACA,uBAAA;EACA,aAAA;EACA,2BAAA;EACA,+CAAA;EACA,mCAAA;EACA,mBAAA;EACA,eAAA;AACJ;AACI;EACI,aAAA;AACR;AAEI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,2BAAA;EACA,wBAAA;EACA,kBAAA;EACA,eAAA;AAAR;AAEQ;EACI,WAAA;EACA,cAAA;EAEA,mEAAA;AADZ;AAIQ;EACI,WAAA;EACA,cAAA;EAEA,2DAAA;AAHZ;AAMQ;EACI,oBAAA;EACA,UAAA;EACA,WAAA;EACA,kGACI;EAGJ,kBAAA;EACA,gCAAA;EACA,kBAAA;AAPZ;AAWI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,YAAA;EACA,8BAAA;EACA,wBAAA;AATR;AAWQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,oBAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,uBAAA;AATZ;AAYQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;EAEA,2GAAA;AAXZ;AAaY;EACI,oBAAA;EACA,UAAA;EACA,YAAA;EACA,gCAAA;EACA,oCAAA;EACA,2CAAA;EACA,kBAAA;AAXhB;AAgBI;EACI,aAAA;EACA,WAAA;EACA,2BAAA;EACA,2BAAA;AAdR;AAgBQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;AAdZ;AAgBY;EACI,WAAA;AAdhB;AAkBQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,YAAA;AAhBZ;AAoBI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,YAAA;EACA,wDAAA;EACA,wBAAA;AAlBR;AAqBI;EACI,WAAA;EACA,cAAA;AAnBR;AAsBI;EACI,WAAA;EACA,cAAA;AApBR;AAuBI;EACI,WAAA;EACA,cAAA;AArBR;AAwBI;EACI,WAAA;EACA,cAAA;AAtBR;AAwBQ;EACI,YAAA;AAtBZ;AA0BI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,8BAAA;EACA,wBAAA;AAxBR;AA0BQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,YAAA;AAxBZ;AA2BQ;EACI,kBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AAzBZ;AA2BY;EACI,WAAA;AAzBhB;AA8BI;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,kBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;AA5BR","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js":
/*!***************************************************************************!*\
  !*** ../../../../node_modules/@fortawesome/react-fontawesome/index.es.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_142283__) => {

"use strict";
__nested_webpack_require_142283__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_142283__.d(__nested_webpack_exports__, {
/* harmony export */   FontAwesomeIcon: () => (/* binding */ FontAwesomeIcon)
/* harmony export */ });
/* harmony import */ var _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_142283__(/*! @fortawesome/fontawesome-svg-core */ "../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_142283__(/*! prop-types */ "../../../../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_142283__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_142283__(/*! react */ "../../../../node_modules/react/index.js");




function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);

  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function (sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys.push.apply(keys, symbols);
  }

  return keys;
}

function _objectSpread2(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = null != arguments[i] ? arguments[i] : {};
    i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
      _defineProperty(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }

  return target;
}

function _typeof(obj) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
    return typeof obj;
  } : function (obj) {
    return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  }, _typeof(obj);
}

function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}

function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;

  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }

  return target;
}

function _objectWithoutProperties(source, excluded) {
  if (source == null) return {};

  var target = _objectWithoutPropertiesLoose(source, excluded);

  var key, i;

  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);

    for (i = 0; i < sourceSymbolKeys.length; i++) {
      key = sourceSymbolKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
      target[key] = source[key];
    }
  }

  return target;
}

function _toConsumableArray(arr) {
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}

function _arrayWithoutHoles(arr) {
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}

function _iterableToArray(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}

function _unsupportedIterableToArray(o, minLen) {
  if (!o) return;
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  var n = Object.prototype.toString.call(o).slice(8, -1);
  if (n === "Object" && o.constructor) n = o.constructor.name;
  if (n === "Map" || n === "Set") return Array.from(o);
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}

function _arrayLikeToArray(arr, len) {
  if (len == null || len > arr.length) len = arr.length;

  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];

  return arr2;
}

function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

// Get CSS class list from a props object
function classList(props) {
  var _classes;

  var beat = props.beat,
      fade = props.fade,
      beatFade = props.beatFade,
      bounce = props.bounce,
      shake = props.shake,
      flash = props.flash,
      spin = props.spin,
      spinPulse = props.spinPulse,
      spinReverse = props.spinReverse,
      pulse = props.pulse,
      fixedWidth = props.fixedWidth,
      inverse = props.inverse,
      border = props.border,
      listItem = props.listItem,
      flip = props.flip,
      size = props.size,
      rotation = props.rotation,
      pull = props.pull; // map of CSS class names to properties

  var classes = (_classes = {
    'fa-beat': beat,
    'fa-fade': fade,
    'fa-beat-fade': beatFade,
    'fa-bounce': bounce,
    'fa-shake': shake,
    'fa-flash': flash,
    'fa-spin': spin,
    'fa-spin-reverse': spinReverse,
    'fa-spin-pulse': spinPulse,
    'fa-pulse': pulse,
    'fa-fw': fixedWidth,
    'fa-inverse': inverse,
    'fa-border': border,
    'fa-li': listItem,
    'fa-flip': flip === true,
    'fa-flip-horizontal': flip === 'horizontal' || flip === 'both',
    'fa-flip-vertical': flip === 'vertical' || flip === 'both'
  }, _defineProperty(_classes, "fa-".concat(size), typeof size !== 'undefined' && size !== null), _defineProperty(_classes, "fa-rotate-".concat(rotation), typeof rotation !== 'undefined' && rotation !== null && rotation !== 0), _defineProperty(_classes, "fa-pull-".concat(pull), typeof pull !== 'undefined' && pull !== null), _defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes); // map over all the keys in the classes object
  // return an array of the keys where the value for the key is not null

  return Object.keys(classes).map(function (key) {
    return classes[key] ? key : null;
  }).filter(function (key) {
    return key;
  });
}

// Camelize taken from humps
// humps is copyright © 2012+ Dom Christie
// Released under the MIT license.
// Performant way to determine if object coerces to a number
function _isNumerical(obj) {
  obj = obj - 0; // eslint-disable-next-line no-self-compare

  return obj === obj;
}

function camelize(string) {
  if (_isNumerical(string)) {
    return string;
  } // eslint-disable-next-line no-useless-escape


  string = string.replace(/[\-_\s]+(.)?/g, function (match, chr) {
    return chr ? chr.toUpperCase() : '';
  }); // Ensure 1st char is always lowercase

  return string.substr(0, 1).toLowerCase() + string.substr(1);
}

var _excluded = ["style"];

function capitalize(val) {
  return val.charAt(0).toUpperCase() + val.slice(1);
}

function styleToObject(style) {
  return style.split(';').map(function (s) {
    return s.trim();
  }).filter(function (s) {
    return s;
  }).reduce(function (acc, pair) {
    var i = pair.indexOf(':');
    var prop = camelize(pair.slice(0, i));
    var value = pair.slice(i + 1).trim();
    prop.startsWith('webkit') ? acc[capitalize(prop)] = value : acc[prop] = value;
    return acc;
  }, {});
}

function convert(createElement, element) {
  var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

  if (typeof element === 'string') {
    return element;
  }

  var children = (element.children || []).map(function (child) {
    return convert(createElement, child);
  });
  /* eslint-disable dot-notation */

  var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {
    var val = element.attributes[key];

    switch (key) {
      case 'class':
        acc.attrs['className'] = val;
        delete element.attributes['class'];
        break;

      case 'style':
        acc.attrs['style'] = styleToObject(val);
        break;

      default:
        if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0) {
          acc.attrs[key.toLowerCase()] = val;
        } else {
          acc.attrs[camelize(key)] = val;
        }

    }

    return acc;
  }, {
    attrs: {}
  });

  var _extraProps$style = extraProps.style,
      existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,
      remaining = _objectWithoutProperties(extraProps, _excluded);

  mixins.attrs['style'] = _objectSpread2(_objectSpread2({}, mixins.attrs['style']), existingStyle);
  /* eslint-enable */

  return createElement.apply(void 0, [element.tag, _objectSpread2(_objectSpread2({}, mixins.attrs), remaining)].concat(_toConsumableArray(children)));
}

var PRODUCTION = false;

try {
  PRODUCTION = "development" === 'production';
} catch (e) {}

function log () {
  if (!PRODUCTION && console && typeof console.error === 'function') {
    var _console;

    (_console = console).error.apply(_console, arguments);
  }
}

function normalizeIconArgs(icon) {
  // this has everything that it needs to be rendered which means it was probably imported
  // directly from an icon svg package
  if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
    return icon;
  }

  if (_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.icon) {
    return _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.icon(icon);
  } // if the icon is null, there's nothing to do


  if (icon === null) {
    return null;
  } // if the icon is an object and has a prefix and an icon name, return it


  if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName) {
    return icon;
  } // if it's an array with length of two


  if (Array.isArray(icon) && icon.length === 2) {
    // use the first item as prefix, second as icon name
    return {
      prefix: icon[0],
      iconName: icon[1]
    };
  } // if it's a string, use it as the icon name


  if (typeof icon === 'string') {
    return {
      prefix: 'fas',
      iconName: icon
    };
  }
}

// creates an object with a key of key
// and a value of value
// if certain conditions are met
function objectWithKey(key, value) {
  // if the value is a non-empty array
  // or it's not an array but it is truthy
  // then create the object with the key and the value
  // if not, return an empty array
  return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
}

var defaultProps = {
  border: false,
  className: '',
  mask: null,
  maskId: null,
  fixedWidth: false,
  inverse: false,
  flip: false,
  icon: null,
  listItem: false,
  pull: null,
  pulse: false,
  rotation: null,
  size: null,
  spin: false,
  spinPulse: false,
  spinReverse: false,
  beat: false,
  fade: false,
  beatFade: false,
  bounce: false,
  shake: false,
  symbol: false,
  title: '',
  titleId: null,
  transform: null,
  swapOpacity: false
};
var FontAwesomeIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(function (props, ref) {
  var allProps = _objectSpread2(_objectSpread2({}, defaultProps), props);

  var iconArgs = allProps.icon,
      maskArgs = allProps.mask,
      symbol = allProps.symbol,
      className = allProps.className,
      title = allProps.title,
      titleId = allProps.titleId,
      maskId = allProps.maskId;
  var iconLookup = normalizeIconArgs(iconArgs);
  var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(allProps)), _toConsumableArray((className || '').split(' '))));
  var transform = objectWithKey('transform', typeof allProps.transform === 'string' ? _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.transform(allProps.transform) : allProps.transform);
  var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
  var renderedIcon = (0,_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.icon)(iconLookup, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, {
    symbol: symbol,
    title: title,
    titleId: titleId,
    maskId: maskId
  }));

  if (!renderedIcon) {
    log('Could not find icon', iconLookup);
    return null;
  }

  var abstract = renderedIcon.abstract;
  var extraProps = {
    ref: ref
  };
  Object.keys(allProps).forEach(function (key) {
    // eslint-disable-next-line no-prototype-builtins
    if (!defaultProps.hasOwnProperty(key)) {
      extraProps[key] = allProps[key];
    }
  });
  return convertCurry(abstract[0], extraProps);
});
FontAwesomeIcon.displayName = 'FontAwesomeIcon';
FontAwesomeIcon.propTypes = {
  beat: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  border: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  beatFade: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  bounce: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  fade: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  flash: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  mask: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().object), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
  maskId: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  fixedWidth: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  inverse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  flip: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf([true, false, 'horizontal', 'vertical', 'both']),
  icon: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().object), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
  listItem: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  pull: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['right', 'left']),
  pulse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  rotation: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf([0, 90, 180, 270]),
  shake: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  size: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
  spin: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  spinPulse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  spinReverse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  symbol: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  titleId: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  transform: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)]),
  swapOpacity: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
};
var convertCurry = convert.bind(null, react__WEBPACK_IMPORTED_MODULE_2__.createElement);




/***/ }),

/***/ "../../../../node_modules/css-loader/dist/runtime/api.js":
/*!***************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/runtime/api.js ***!
  \***************************************************************/
/***/ ((module) => {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
  var list = [];

  // return the list of modules as css string
  list.toString = function toString() {
    return this.map(function (item) {
      var content = "";
      var needLayer = typeof item[5] !== "undefined";
      if (item[4]) {
        content += "@supports (".concat(item[4], ") {");
      }
      if (item[2]) {
        content += "@media ".concat(item[2], " {");
      }
      if (needLayer) {
        content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
      }
      content += cssWithMappingToString(item);
      if (needLayer) {
        content += "}";
      }
      if (item[2]) {
        content += "}";
      }
      if (item[4]) {
        content += "}";
      }
      return content;
    }).join("");
  };

  // import a list of modules into the list
  list.i = function i(modules, media, dedupe, supports, layer) {
    if (typeof modules === "string") {
      modules = [[null, modules, undefined]];
    }
    var alreadyImportedModules = {};
    if (dedupe) {
      for (var k = 0; k < this.length; k++) {
        var id = this[k][0];
        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }
    for (var _k = 0; _k < modules.length; _k++) {
      var item = [].concat(modules[_k]);
      if (dedupe && alreadyImportedModules[item[0]]) {
        continue;
      }
      if (typeof layer !== "undefined") {
        if (typeof item[5] === "undefined") {
          item[5] = layer;
        } else {
          item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
          item[5] = layer;
        }
      }
      if (media) {
        if (!item[2]) {
          item[2] = media;
        } else {
          item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
          item[2] = media;
        }
      }
      if (supports) {
        if (!item[4]) {
          item[4] = "".concat(supports);
        } else {
          item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
          item[4] = supports;
        }
      }
      list.push(item);
    }
  };
  return list;
};

/***/ }),

/***/ "../../../../node_modules/css-loader/dist/runtime/getUrl.js":
/*!******************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/runtime/getUrl.js ***!
  \******************************************************************/
/***/ ((module) => {

"use strict";


module.exports = function (url, options) {
  if (!options) {
    options = {};
  }
  if (!url) {
    return url;
  }
  url = String(url.__esModule ? url.default : url);

  // If url is already wrapped in quotes, remove them
  if (/^['"].*['"]$/.test(url)) {
    url = url.slice(1, -1);
  }
  if (options.hash) {
    url += options.hash;
  }

  // Should url be wrapped?
  // See https://drafts.csswg.org/css-values-3/#urls
  if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
    return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), "\"");
  }
  return url;
};

/***/ }),

/***/ "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js":
/*!**********************************************************************!*\
  !*** ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";


module.exports = function (item) {
  var content = item[1];
  var cssMapping = item[3];
  if (!cssMapping) {
    return content;
  }
  if (typeof btoa === "function") {
    var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
    var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
    var sourceMapping = "/*# ".concat(data, " */");
    return [content].concat([sourceMapping]).join("\n");
  }
  return [content].join("\n");
};

/***/ }),

/***/ "../../../../node_modules/gif.js.optimized/dist/gif.js":
/*!*************************************************************!*\
  !*** ../../../../node_modules/gif.js.optimized/dist/gif.js ***!
  \*************************************************************/
/***/ (function(module) {

!function(t,e){  true?module.exports=e():0}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){var n,r,s,o=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},a={}.hasOwnProperty,h=[].indexOf||function(t){for(var e=0,i=this.length;e<i;e++)if(e in this&&this[e]===t)return e;return-1};n=i(1).EventEmitter,s=i(2),r=function(t){function e(t){var e,n,r;this.running=!1,this.options={},this.frames=[],this.groups=new Map,this.freeWorkers=[],this.activeWorkers=[],this.setOptions(t);for(n in i)r=i[n],null==(e=this.options)[n]&&(e[n]=r)}var i,n;return o(e,t),i={workerScript:"gif.worker.js",workers:2,repeat:0,background:"#fff",quality:10,width:null,height:null,transparent:null,debug:!1},n={delay:500,copy:!1},e.prototype.setOption=function(t,e){if(this.options[t]=e,null!=this._canvas&&("width"===t||"height"===t))return this._canvas[t]=e},e.prototype.setOptions=function(t){var e,i,n;i=[];for(e in t)a.call(t,e)&&(n=t[e],i.push(this.setOption(e,n)));return i},e.prototype.addFrame=function(t,e){var i,r,s;null==e&&(e={}),i={},i.transparent=this.options.transparent;for(s in n)i[s]=e[s]||n[s];if(null==this.options.width&&this.setOption("width",t.width),null==this.options.height&&this.setOption("height",t.height),"undefined"!=typeof ImageData&&null!==ImageData&&t instanceof ImageData)i.data=t.data;else if("undefined"!=typeof CanvasRenderingContext2D&&null!==CanvasRenderingContext2D&&t instanceof CanvasRenderingContext2D||"undefined"!=typeof WebGLRenderingContext&&null!==WebGLRenderingContext&&t instanceof WebGLRenderingContext)e.copy?i.data=this.getContextData(t):i.context=t;else{if(null==t.childNodes)throw new Error("Invalid image");e.copy?i.data=this.getImageData(t):i.image=t}return r=this.frames.length,r>0&&i.data&&(this.groups.has(i.data)?this.groups.get(i.data).push(r):this.groups.set(i.data,[r])),this.frames.push(i)},e.prototype.render=function(){var t,e,i,n;if(this.running)throw new Error("Already running");if(null==this.options.width||null==this.options.height)throw new Error("Width and height must be set prior to rendering");if(this.running=!0,this.nextFrame=0,this.finishedFrames=0,this.imageParts=function(){var e,i,n;for(n=[],t=e=0,i=this.frames.length;0<=i?e<i:e>i;t=0<=i?++e:--e)n.push(null);return n}.call(this),i=this.spawnWorkers(),this.options.globalPalette===!0)this.renderNextFrame();else for(t=e=0,n=i;0<=n?e<n:e>n;t=0<=n?++e:--e)this.renderNextFrame();return this.emit("start"),this.emit("progress",0)},e.prototype.abort=function(){for(var t;;){if(t=this.activeWorkers.shift(),null==t)break;this.log("killing active worker"),t.terminate()}return this.running=!1,this.emit("abort")},e.prototype.spawnWorkers=function(){var t,e,i;return t=Math.min(this.options.workers,this.frames.length),function(){i=[];for(var n=e=this.freeWorkers.length;e<=t?n<t:n>t;e<=t?n++:n--)i.push(n);return i}.apply(this).forEach(function(t){return function(e){var i;return t.log("spawning worker "+e),i=new Worker(t.options.workerScript),i.onmessage=function(e){return t.activeWorkers.splice(t.activeWorkers.indexOf(i),1),t.freeWorkers.push(i),t.frameFinished(e.data,!1)},t.freeWorkers.push(i)}}(this)),t},e.prototype.frameFinished=function(t,e){var i,n,r,s,o;if(this.finishedFrames++,e?(n=this.frames.indexOf(t),r=this.groups.get(t.data)[0],this.log("frame "+(n+1)+" is duplicate of "+r+" - "+this.activeWorkers.length+" active"),this.imageParts[n]={indexOfFirstInGroup:r}):(this.log("frame "+(t.index+1)+" finished - "+this.activeWorkers.length+" active"),this.emit("progress",this.finishedFrames/this.frames.length),this.imageParts[t.index]=t),this.options.globalPalette===!0&&!e&&(this.options.globalPalette=t.globalPalette,this.log("global palette analyzed"),this.frames.length>2))for(i=s=1,o=this.freeWorkers.length;1<=o?s<o:s>o;i=1<=o?++s:--s)this.renderNextFrame();return h.call(this.imageParts,null)>=0?this.renderNextFrame():this.finishRendering()},e.prototype.finishRendering=function(){var t,e,i,n,r,s,o,a,h,l,f,p,u,d,c,g,v,m,y,_;for(v=this.imageParts,r=s=0,l=v.length;s<l;r=++s)e=v[r],e.indexOfFirstInGroup&&(this.imageParts[r]=this.imageParts[e.indexOfFirstInGroup]);for(h=0,m=this.imageParts,o=0,f=m.length;o<f;o++)e=m[o],h+=(e.data.length-1)*e.pageSize+e.cursor;for(h+=e.pageSize-e.cursor,this.log("rendering finished - filesize "+Math.round(h/1e3)+"kb"),t=new Uint8Array(h),c=0,y=this.imageParts,a=0,p=y.length;a<p;a++)for(e=y[a],_=e.data,i=d=0,u=_.length;d<u;i=++d)g=_[i],t.set(g,c),c+=i===e.data.length-1?e.cursor:e.pageSize;return n=new Blob([t],{type:"image/gif"}),this.emit("finished",n,t)},e.prototype.renderNextFrame=function(){var t,e,i,n;if(0===this.freeWorkers.length)throw new Error("No free workers");if(!(this.nextFrame>=this.frames.length))return t=this.frames[this.nextFrame++],e=this.frames.indexOf(t),e>0&&this.groups.has(t.data)&&this.groups.get(t.data)[0]!==e?void setTimeout(function(e){return function(){return e.frameFinished(t,!0)}}(this),0):(n=this.freeWorkers.shift(),i=this.getTask(t),this.log("starting frame "+(i.index+1)+" of "+this.frames.length),this.activeWorkers.push(n),n.postMessage(i))},e.prototype.getContextData=function(t){return t.getImageData(0,0,this.options.width,this.options.height).data},e.prototype.getImageData=function(t){var e;return null==this._canvas&&(this._canvas=document.createElement("canvas"),this._canvas.width=this.options.width,this._canvas.height=this.options.height),e=this._canvas.getContext("2d"),e.setFill=this.options.background,e.fillRect(0,0,this.options.width,this.options.height),e.drawImage(t,0,0),this.getContextData(e)},e.prototype.getTask=function(t){var e,i;if(e=this.frames.indexOf(t),i={index:e,last:e===this.frames.length-1,delay:t.delay,transparent:t.transparent,width:this.options.width,height:this.options.height,quality:this.options.quality,dither:this.options.dither,globalPalette:this.options.globalPalette,repeat:this.options.repeat,canTransfer:!0},null!=t.data)i.data=t.data;else if(null!=t.context)i.data=this.getContextData(t.context);else{if(null==t.image)throw new Error("Invalid frame");i.data=this.getImageData(t.image)}return i},e.prototype.log=function(t){if(this.options.debug)return console.log(t)},e}(n),t.exports=r},function(t,e){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function r(t){return"number"==typeof t}function s(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(t){if(!r(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},i.prototype.emit=function(t){var e,i,r,a,h,l;if(this._events||(this._events={}),"error"===t&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var f=new Error('Uncaught, unspecified "error" event. ('+e+")");throw f.context=e,f}if(i=this._events[t],o(i))return!1;if(n(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),i.apply(this,a)}else if(s(i))for(a=Array.prototype.slice.call(arguments,1),l=i.slice(),r=l.length,h=0;h<r;h++)l[h].apply(this,a);return!0},i.prototype.addListener=function(t,e){var r;if(!n(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?s(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,s(this._events[t])&&!this._events[t].warned&&(r=o(this._maxListeners)?i.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){function i(){this.removeListener(t,i),r||(r=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var r=!1;return i.listener=e,this.on(t,i),this},i.prototype.removeListener=function(t,e){var i,r,o,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(i=this._events[t],o=i.length,r=-1,i===e||n(i.listener)&&i.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(s(i)){for(a=o;a-- >0;)if(i[a]===e||i[a].listener&&i[a].listener===e){r=a;break}if(r<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},i.prototype.removeAllListeners=function(t){var e,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[t],n(i))this.removeListener(t,i);else if(i)for(;i.length;)this.removeListener(t,i[i.length-1]);return delete this._events[t],this},i.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},i.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},i.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e){var i,n,r,s,o;o=navigator.userAgent.toLowerCase(),s=navigator.platform.toLowerCase(),i=o.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0],r="ie"===i[1]&&document.documentMode,n={name:"version"===i[1]?i[3]:i[1],version:r||parseFloat("opera"===i[1]&&i[4]?i[4]:i[2]),platform:{name:o.match(/ip(?:ad|od|hone)/)?"ios":(o.match(/(?:webos|android)/)||s.match(/mac|win|linux/)||["other"])[0]}},n[n.name]=!0,n[n.name+parseInt(n.version,10)]=!0,n.platform[n.platform.name]=!0,t.exports=n}])});


/***/ }),

/***/ "../../../../node_modules/object-assign/index.js":
/*!*******************************************************!*\
  !*** ../../../../node_modules/object-assign/index.js ***!
  \*******************************************************/
/***/ ((module) => {

"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/


/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;

function toObject(val) {
	if (val === null || val === undefined) {
		throw new TypeError('Object.assign cannot be called with null or undefined');
	}

	return Object(val);
}

function shouldUseNative() {
	try {
		if (!Object.assign) {
			return false;
		}

		// Detect buggy property enumeration order in older V8 versions.

		// https://bugs.chromium.org/p/v8/issues/detail?id=4118
		var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
		test1[5] = 'de';
		if (Object.getOwnPropertyNames(test1)[0] === '5') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test2 = {};
		for (var i = 0; i < 10; i++) {
			test2['_' + String.fromCharCode(i)] = i;
		}
		var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
			return test2[n];
		});
		if (order2.join('') !== '0123456789') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test3 = {};
		'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
			test3[letter] = letter;
		});
		if (Object.keys(Object.assign({}, test3)).join('') !==
				'abcdefghijklmnopqrst') {
			return false;
		}

		return true;
	} catch (err) {
		// We don't expect any of the above to throw, but better to be safe.
		return false;
	}
}

module.exports = shouldUseNative() ? Object.assign : function (target, source) {
	var from;
	var to = toObject(target);
	var symbols;

	for (var s = 1; s < arguments.length; s++) {
		from = Object(arguments[s]);

		for (var key in from) {
			if (hasOwnProperty.call(from, key)) {
				to[key] = from[key];
			}
		}

		if (getOwnPropertySymbols) {
			symbols = getOwnPropertySymbols(from);
			for (var i = 0; i < symbols.length; i++) {
				if (propIsEnumerable.call(from, symbols[i])) {
					to[symbols[i]] = from[symbols[i]];
				}
			}
		}
	}

	return to;
};


/***/ }),

/***/ "../../../../node_modules/prop-types/checkPropTypes.js":
/*!*************************************************************!*\
  !*** ../../../../node_modules/prop-types/checkPropTypes.js ***!
  \*************************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_175887__) => {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var printWarning = function() {};

if (true) {
  var ReactPropTypesSecret = __nested_webpack_require_175887__(/*! ./lib/ReactPropTypesSecret */ "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js");
  var loggedTypeFailures = {};
  var has = __nested_webpack_require_175887__(/*! ./lib/has */ "../../../../node_modules/prop-types/lib/has.js");

  printWarning = function(text) {
    var message = 'Warning: ' + text;
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) { /**/ }
  };
}

/**
 * Assert that the values match with the type specs.
 * Error messages are memorized and will only be shown once.
 *
 * @param {object} typeSpecs Map of name to a ReactPropType
 * @param {object} values Runtime values that need to be type-checked
 * @param {string} location e.g. "prop", "context", "child context"
 * @param {string} componentName Name of the component for error messages.
 * @param {?Function} getStack Returns the component stack.
 * @private
 */
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  if (true) {
    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error;
        // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.
        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error(
              (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
              'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
              'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
            );
            err.name = 'Invariant Violation';
            throw err;
          }
          error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
        } catch (ex) {
          error = ex;
        }
        if (error && !(error instanceof Error)) {
          printWarning(
            (componentName || 'React class') + ': type specification of ' +
            location + ' `' + typeSpecName + '` is invalid; the type checker ' +
            'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
            'You may have forgotten to pass an argument to the type checker ' +
            'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
            'shape all require an argument).'
          );
        }
        if (error instanceof Error && !(error.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error.message] = true;

          var stack = getStack ? getStack() : '';

          printWarning(
            'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
          );
        }
      }
    }
  }
}

/**
 * Resets warning cache when testing.
 *
 * @private
 */
checkPropTypes.resetWarningCache = function() {
  if (true) {
    loggedTypeFailures = {};
  }
}

module.exports = checkPropTypes;


/***/ }),

/***/ "../../../../node_modules/prop-types/factoryWithTypeCheckers.js":
/*!**********************************************************************!*\
  !*** ../../../../node_modules/prop-types/factoryWithTypeCheckers.js ***!
  \**********************************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_180187__) => {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var ReactIs = __nested_webpack_require_180187__(/*! react-is */ "../../../../node_modules/prop-types/node_modules/react-is/index.js");
var assign = __nested_webpack_require_180187__(/*! object-assign */ "../../../../node_modules/object-assign/index.js");

var ReactPropTypesSecret = __nested_webpack_require_180187__(/*! ./lib/ReactPropTypesSecret */ "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js");
var has = __nested_webpack_require_180187__(/*! ./lib/has */ "../../../../node_modules/prop-types/lib/has.js");
var checkPropTypes = __nested_webpack_require_180187__(/*! ./checkPropTypes */ "../../../../node_modules/prop-types/checkPropTypes.js");

var printWarning = function() {};

if (true) {
  printWarning = function(text) {
    var message = 'Warning: ' + text;
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };
}

function emptyFunctionThatReturnsNull() {
  return null;
}

module.exports = function(isValidElement, throwOnDirectAccess) {
  /* global Symbol */
  var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.

  /**
   * Returns the iterator method function contained on the iterable object.
   *
   * Be sure to invoke the function with the iterable as context:
   *
   *     var iteratorFn = getIteratorFn(myIterable);
   *     if (iteratorFn) {
   *       var iterator = iteratorFn.call(myIterable);
   *       ...
   *     }
   *
   * @param {?object} maybeIterable
   * @return {?function}
   */
  function getIteratorFn(maybeIterable) {
    var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
    if (typeof iteratorFn === 'function') {
      return iteratorFn;
    }
  }

  /**
   * Collection of methods that allow declaration and validation of props that are
   * supplied to React components. Example usage:
   *
   *   var Props = require('ReactPropTypes');
   *   var MyArticle = React.createClass({
   *     propTypes: {
   *       // An optional string prop named "description".
   *       description: Props.string,
   *
   *       // A required enum prop named "category".
   *       category: Props.oneOf(['News','Photos']).isRequired,
   *
   *       // A prop named "dialog" that requires an instance of Dialog.
   *       dialog: Props.instanceOf(Dialog).isRequired
   *     },
   *     render: function() { ... }
   *   });
   *
   * A more formal specification of how these methods are used:
   *
   *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
   *   decl := ReactPropTypes.{type}(.isRequired)?
   *
   * Each and every declaration produces a function with the same signature. This
   * allows the creation of custom validation functions. For example:
   *
   *  var MyLink = React.createClass({
   *    propTypes: {
   *      // An optional string or URI prop named "href".
   *      href: function(props, propName, componentName) {
   *        var propValue = props[propName];
   *        if (propValue != null && typeof propValue !== 'string' &&
   *            !(propValue instanceof URI)) {
   *          return new Error(
   *            'Expected a string or an URI for ' + propName + ' in ' +
   *            componentName
   *          );
   *        }
   *      }
   *    },
   *    render: function() {...}
   *  });
   *
   * @internal
   */

  var ANONYMOUS = '<<anonymous>>';

  // Important!
  // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
  var ReactPropTypes = {
    array: createPrimitiveTypeChecker('array'),
    bigint: createPrimitiveTypeChecker('bigint'),
    bool: createPrimitiveTypeChecker('boolean'),
    func: createPrimitiveTypeChecker('function'),
    number: createPrimitiveTypeChecker('number'),
    object: createPrimitiveTypeChecker('object'),
    string: createPrimitiveTypeChecker('string'),
    symbol: createPrimitiveTypeChecker('symbol'),

    any: createAnyTypeChecker(),
    arrayOf: createArrayOfTypeChecker,
    element: createElementTypeChecker(),
    elementType: createElementTypeTypeChecker(),
    instanceOf: createInstanceTypeChecker,
    node: createNodeChecker(),
    objectOf: createObjectOfTypeChecker,
    oneOf: createEnumTypeChecker,
    oneOfType: createUnionTypeChecker,
    shape: createShapeTypeChecker,
    exact: createStrictShapeTypeChecker,
  };

  /**
   * inlined Object.is polyfill to avoid requiring consumers ship their own
   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
   */
  /*eslint-disable no-self-compare*/
  function is(x, y) {
    // SameValue algorithm
    if (x === y) {
      // Steps 1-5, 7-10
      // Steps 6.b-6.e: +0 != -0
      return x !== 0 || 1 / x === 1 / y;
    } else {
      // Step 6.a: NaN == NaN
      return x !== x && y !== y;
    }
  }
  /*eslint-enable no-self-compare*/

  /**
   * We use an Error-like object for backward compatibility as people may call
   * PropTypes directly and inspect their output. However, we don't use real
   * Errors anymore. We don't inspect their stack anyway, and creating them
   * is prohibitively expensive if they are created too often, such as what
   * happens in oneOfType() for any type before the one that matched.
   */
  function PropTypeError(message, data) {
    this.message = message;
    this.data = data && typeof data === 'object' ? data: {};
    this.stack = '';
  }
  // Make `instanceof Error` still work for returned errors.
  PropTypeError.prototype = Error.prototype;

  function createChainableTypeChecker(validate) {
    if (true) {
      var manualPropTypeCallCache = {};
      var manualPropTypeWarningCount = 0;
    }
    function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
      componentName = componentName || ANONYMOUS;
      propFullName = propFullName || propName;

      if (secret !== ReactPropTypesSecret) {
        if (throwOnDirectAccess) {
          // New behavior only for users of `prop-types` package
          var err = new Error(
            'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
            'Use `PropTypes.checkPropTypes()` to call them. ' +
            'Read more at http://fb.me/use-check-prop-types'
          );
          err.name = 'Invariant Violation';
          throw err;
        } else if (  true && typeof console !== 'undefined') {
          // Old behavior for people using React.PropTypes
          var cacheKey = componentName + ':' + propName;
          if (
            !manualPropTypeCallCache[cacheKey] &&
            // Avoid spamming the console because they are often not actionable except for lib authors
            manualPropTypeWarningCount < 3
          ) {
            printWarning(
              'You are manually calling a React.PropTypes validation ' +
              'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
              'and will throw in the standalone `prop-types` package. ' +
              'You may be seeing this warning due to a third-party PropTypes ' +
              'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
            );
            manualPropTypeCallCache[cacheKey] = true;
            manualPropTypeWarningCount++;
          }
        }
      }
      if (props[propName] == null) {
        if (isRequired) {
          if (props[propName] === null) {
            return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
          }
          return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
        }
        return null;
      } else {
        return validate(props, propName, componentName, location, propFullName);
      }
    }

    var chainedCheckType = checkType.bind(null, false);
    chainedCheckType.isRequired = checkType.bind(null, true);

    return chainedCheckType;
  }

  function createPrimitiveTypeChecker(expectedType) {
    function validate(props, propName, componentName, location, propFullName, secret) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== expectedType) {
        // `propValue` being instance of, say, date/regexp, pass the 'object'
        // check, but we can offer a more precise error message here rather than
        // 'of type `object`'.
        var preciseType = getPreciseType(propValue);

        return new PropTypeError(
          'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
          {expectedType: expectedType}
        );
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createAnyTypeChecker() {
    return createChainableTypeChecker(emptyFunctionThatReturnsNull);
  }

  function createArrayOfTypeChecker(typeChecker) {
    function validate(props, propName, componentName, location, propFullName) {
      if (typeof typeChecker !== 'function') {
        return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
      }
      var propValue = props[propName];
      if (!Array.isArray(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
      }
      for (var i = 0; i < propValue.length; i++) {
        var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
        if (error instanceof Error) {
          return error;
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createElementTypeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      if (!isValidElement(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createElementTypeTypeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      if (!ReactIs.isValidElementType(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createInstanceTypeChecker(expectedClass) {
    function validate(props, propName, componentName, location, propFullName) {
      if (!(props[propName] instanceof expectedClass)) {
        var expectedClassName = expectedClass.name || ANONYMOUS;
        var actualClassName = getClassName(props[propName]);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createEnumTypeChecker(expectedValues) {
    if (!Array.isArray(expectedValues)) {
      if (true) {
        if (arguments.length > 1) {
          printWarning(
            'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
            'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
          );
        } else {
          printWarning('Invalid argument supplied to oneOf, expected an array.');
        }
      }
      return emptyFunctionThatReturnsNull;
    }

    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      for (var i = 0; i < expectedValues.length; i++) {
        if (is(propValue, expectedValues[i])) {
          return null;
        }
      }

      var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
        var type = getPreciseType(value);
        if (type === 'symbol') {
          return String(value);
        }
        return value;
      });
      return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
    }
    return createChainableTypeChecker(validate);
  }

  function createObjectOfTypeChecker(typeChecker) {
    function validate(props, propName, componentName, location, propFullName) {
      if (typeof typeChecker !== 'function') {
        return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
      }
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
      }
      for (var key in propValue) {
        if (has(propValue, key)) {
          var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
          if (error instanceof Error) {
            return error;
          }
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createUnionTypeChecker(arrayOfTypeCheckers) {
    if (!Array.isArray(arrayOfTypeCheckers)) {
        true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
      return emptyFunctionThatReturnsNull;
    }

    for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
      var checker = arrayOfTypeCheckers[i];
      if (typeof checker !== 'function') {
        printWarning(
          'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
          'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
        );
        return emptyFunctionThatReturnsNull;
      }
    }

    function validate(props, propName, componentName, location, propFullName) {
      var expectedTypes = [];
      for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
        var checker = arrayOfTypeCheckers[i];
        var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
        if (checkerResult == null) {
          return null;
        }
        if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
          expectedTypes.push(checkerResult.data.expectedType);
        }
      }
      var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
      return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
    }
    return createChainableTypeChecker(validate);
  }

  function createNodeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      if (!isNode(props[propName])) {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function invalidValidatorError(componentName, location, propFullName, key, type) {
    return new PropTypeError(
      (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
      'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
    );
  }

  function createShapeTypeChecker(shapeTypes) {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
      }
      for (var key in shapeTypes) {
        var checker = shapeTypes[key];
        if (typeof checker !== 'function') {
          return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
        }
        var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
        if (error) {
          return error;
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createStrictShapeTypeChecker(shapeTypes) {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
      }
      // We need to check all keys in case some are required but missing from props.
      var allKeys = assign({}, props[propName], shapeTypes);
      for (var key in allKeys) {
        var checker = shapeTypes[key];
        if (has(shapeTypes, key) && typeof checker !== 'function') {
          return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
        }
        if (!checker) {
          return new PropTypeError(
            'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
            '\nBad object: ' + JSON.stringify(props[propName], null, '  ') +
            '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, '  ')
          );
        }
        var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
        if (error) {
          return error;
        }
      }
      return null;
    }

    return createChainableTypeChecker(validate);
  }

  function isNode(propValue) {
    switch (typeof propValue) {
      case 'number':
      case 'string':
      case 'undefined':
        return true;
      case 'boolean':
        return !propValue;
      case 'object':
        if (Array.isArray(propValue)) {
          return propValue.every(isNode);
        }
        if (propValue === null || isValidElement(propValue)) {
          return true;
        }

        var iteratorFn = getIteratorFn(propValue);
        if (iteratorFn) {
          var iterator = iteratorFn.call(propValue);
          var step;
          if (iteratorFn !== propValue.entries) {
            while (!(step = iterator.next()).done) {
              if (!isNode(step.value)) {
                return false;
              }
            }
          } else {
            // Iterator will provide entry [k,v] tuples rather than values.
            while (!(step = iterator.next()).done) {
              var entry = step.value;
              if (entry) {
                if (!isNode(entry[1])) {
                  return false;
                }
              }
            }
          }
        } else {
          return false;
        }

        return true;
      default:
        return false;
    }
  }

  function isSymbol(propType, propValue) {
    // Native Symbol.
    if (propType === 'symbol') {
      return true;
    }

    // falsy value can't be a Symbol
    if (!propValue) {
      return false;
    }

    // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
    if (propValue['@@toStringTag'] === 'Symbol') {
      return true;
    }

    // Fallback for non-spec compliant Symbols which are polyfilled.
    if (typeof Symbol === 'function' && propValue instanceof Symbol) {
      return true;
    }

    return false;
  }

  // Equivalent of `typeof` but with special handling for array and regexp.
  function getPropType(propValue) {
    var propType = typeof propValue;
    if (Array.isArray(propValue)) {
      return 'array';
    }
    if (propValue instanceof RegExp) {
      // Old webkits (at least until Android 4.0) return 'function' rather than
      // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
      // passes PropTypes.object.
      return 'object';
    }
    if (isSymbol(propType, propValue)) {
      return 'symbol';
    }
    return propType;
  }

  // This handles more types than `getPropType`. Only used for error messages.
  // See `createPrimitiveTypeChecker`.
  function getPreciseType(propValue) {
    if (typeof propValue === 'undefined' || propValue === null) {
      return '' + propValue;
    }
    var propType = getPropType(propValue);
    if (propType === 'object') {
      if (propValue instanceof Date) {
        return 'date';
      } else if (propValue instanceof RegExp) {
        return 'regexp';
      }
    }
    return propType;
  }

  // Returns a string that is postfixed to a warning about an invalid type.
  // For example, "undefined" or "of type array"
  function getPostfixForTypeWarning(value) {
    var type = getPreciseType(value);
    switch (type) {
      case 'array':
      case 'object':
        return 'an ' + type;
      case 'boolean':
      case 'date':
      case 'regexp':
        return 'a ' + type;
      default:
        return type;
    }
  }

  // Returns class name of the object, if any.
  function getClassName(propValue) {
    if (!propValue.constructor || !propValue.constructor.name) {
      return ANONYMOUS;
    }
    return propValue.constructor.name;
  }

  ReactPropTypes.checkPropTypes = checkPropTypes;
  ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
  ReactPropTypes.PropTypes = ReactPropTypes;

  return ReactPropTypes;
};


/***/ }),

/***/ "../../../../node_modules/prop-types/index.js":
/*!****************************************************!*\
  !*** ../../../../node_modules/prop-types/index.js ***!
  \****************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_203420__) => {

/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

if (true) {
  var ReactIs = __nested_webpack_require_203420__(/*! react-is */ "../../../../node_modules/prop-types/node_modules/react-is/index.js");

  // By explicitly using `prop-types` you are opting into new development behavior.
  // http://fb.me/prop-types-in-prod
  var throwOnDirectAccess = true;
  module.exports = __nested_webpack_require_203420__(/*! ./factoryWithTypeCheckers */ "../../../../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
} else {}


/***/ }),

/***/ "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js":
/*!***********************************************************************!*\
  !*** ../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';

module.exports = ReactPropTypesSecret;


/***/ }),

/***/ "../../../../node_modules/prop-types/lib/has.js":
/*!******************************************************!*\
  !*** ../../../../node_modules/prop-types/lib/has.js ***!
  \******************************************************/
/***/ ((module) => {

module.exports = Function.call.bind(Object.prototype.hasOwnProperty);


/***/ }),

/***/ "../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js":
/*!*********************************************************************************************!*\
  !*** ../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***!
  \*********************************************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
/** @license React v16.13.1
 * react-is.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
// (unstable) APIs that have been removed. Can we remove the symbols?

var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;

function isValidElementType(type) {
  return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
}

function typeOf(object) {
  if (typeof object === 'object' && object !== null) {
    var $$typeof = object.$$typeof;

    switch ($$typeof) {
      case REACT_ELEMENT_TYPE:
        var type = object.type;

        switch (type) {
          case REACT_ASYNC_MODE_TYPE:
          case REACT_CONCURRENT_MODE_TYPE:
          case REACT_FRAGMENT_TYPE:
          case REACT_PROFILER_TYPE:
          case REACT_STRICT_MODE_TYPE:
          case REACT_SUSPENSE_TYPE:
            return type;

          default:
            var $$typeofType = type && type.$$typeof;

            switch ($$typeofType) {
              case REACT_CONTEXT_TYPE:
              case REACT_FORWARD_REF_TYPE:
              case REACT_LAZY_TYPE:
              case REACT_MEMO_TYPE:
              case REACT_PROVIDER_TYPE:
                return $$typeofType;

              default:
                return $$typeof;
            }

        }

      case REACT_PORTAL_TYPE:
        return $$typeof;
    }
  }

  return undefined;
} // AsyncMode is deprecated along with isAsyncMode

var AsyncMode = REACT_ASYNC_MODE_TYPE;
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated

function isAsyncMode(object) {
  {
    if (!hasWarnedAboutDeprecatedIsAsyncMode) {
      hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint

      console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
    }
  }

  return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
}
function isConcurrentMode(object) {
  return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
}
function isContextConsumer(object) {
  return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
  return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
  return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
  return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
  return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
  return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
  return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
  return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
  return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
  return typeOf(object) === REACT_SUSPENSE_TYPE;
}

exports.AsyncMode = AsyncMode;
exports.ConcurrentMode = ConcurrentMode;
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
  })();
}


/***/ }),

/***/ "../../../../node_modules/prop-types/node_modules/react-is/index.js":
/*!**************************************************************************!*\
  !*** ../../../../node_modules/prop-types/node_modules/react-is/index.js ***!
  \**************************************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_212874__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_212874__(/*! ./cjs/react-is.development.js */ "../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js");
}


/***/ }),

/***/ "../../../../node_modules/re-resizable/lib/index.js":
/*!**********************************************************!*\
  !*** ../../../../node_modules/re-resizable/lib/index.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_213424__) => {

"use strict";
__nested_webpack_require_213424__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_213424__.d(__nested_webpack_exports__, {
/* harmony export */   Resizable: () => (/* binding */ Resizable)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_213424__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_213424__(/*! react-dom */ "../../../../node_modules/react-dom/index.js");
/* harmony import */ var _resizer__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_213424__(/*! ./resizer */ "../../../../node_modules/re-resizable/lib/resizer.js");
var __extends = ( false) || (function () {
    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);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = ( false) || function () {
    __assign = Object.assign || function(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);
};



var DEFAULT_SIZE = {
    width: 'auto',
    height: 'auto',
};
var clamp = function (n, min, max) { return Math.max(Math.min(n, max), min); };
var snap = function (n, size, gridGap) {
    var v = Math.round(n / size);
    return v * size + gridGap * (v - 1);
};
var hasDirection = function (dir, target) {
    return new RegExp(dir, 'i').test(target);
};
// INFO: In case of window is a Proxy and does not porxy Events correctly, use isTouchEvent & isMouseEvent to distinguish event type instead of `instanceof`.
var isTouchEvent = function (event) {
    return Boolean(event.touches && event.touches.length);
};
var isMouseEvent = function (event) {
    return Boolean((event.clientX || event.clientX === 0) &&
        (event.clientY || event.clientY === 0));
};
var findClosestSnap = function (n, snapArray, snapGap) {
    if (snapGap === void 0) { snapGap = 0; }
    var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0);
    var gap = Math.abs(snapArray[closestGapIndex] - n);
    return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;
};
var getStringSize = function (n) {
    n = n.toString();
    if (n === 'auto') {
        return n;
    }
    if (n.endsWith('px')) {
        return n;
    }
    if (n.endsWith('%')) {
        return n;
    }
    if (n.endsWith('vh')) {
        return n;
    }
    if (n.endsWith('vw')) {
        return n;
    }
    if (n.endsWith('vmax')) {
        return n;
    }
    if (n.endsWith('vmin')) {
        return n;
    }
    return n + "px";
};
var getPixelSize = function (size, parentSize, innerWidth, innerHeight) {
    if (size && typeof size === 'string') {
        if (size.endsWith('px')) {
            return Number(size.replace('px', ''));
        }
        if (size.endsWith('%')) {
            var ratio = Number(size.replace('%', '')) / 100;
            return parentSize * ratio;
        }
        if (size.endsWith('vw')) {
            var ratio = Number(size.replace('vw', '')) / 100;
            return innerWidth * ratio;
        }
        if (size.endsWith('vh')) {
            var ratio = Number(size.replace('vh', '')) / 100;
            return innerHeight * ratio;
        }
    }
    return size;
};
var calculateNewMax = function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
    maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);
    maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);
    minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight);
    minHeight = getPixelSize(minHeight, parentSize.height, innerWidth, innerHeight);
    return {
        maxWidth: typeof maxWidth === 'undefined' ? undefined : Number(maxWidth),
        maxHeight: typeof maxHeight === 'undefined' ? undefined : Number(maxHeight),
        minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth),
        minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight),
    };
};
/**
 * transform T | [T, T] to [T, T]
 * @param val
 * @returns
 */
// tslint:disable-next-line
var normalizeToPair = function (val) { return (Array.isArray(val) ? val : [val, val]); };
var definedProps = [
    'as',
    'ref',
    'style',
    'className',
    'grid',
    'gridGap',
    'snap',
    'bounds',
    'boundsByDirection',
    'size',
    'defaultSize',
    'minWidth',
    'minHeight',
    'maxWidth',
    'maxHeight',
    'lockAspectRatio',
    'lockAspectRatioExtraWidth',
    'lockAspectRatioExtraHeight',
    'enable',
    'handleStyles',
    'handleClasses',
    'handleWrapperStyle',
    'handleWrapperClass',
    'children',
    'onResizeStart',
    'onResize',
    'onResizeStop',
    'handleComponent',
    'scale',
    'resizeRatio',
    'snapGap',
];
// HACK: This class is used to calculate % size.
var baseClassName = '__resizable_base__';
var Resizable = /** @class */ (function (_super) {
    __extends(Resizable, _super);
    function Resizable(props) {
        var _a, _b, _c, _d;
        var _this = _super.call(this, props) || this;
        _this.ratio = 1;
        _this.resizable = null;
        // For parent boundary
        _this.parentLeft = 0;
        _this.parentTop = 0;
        // For boundary
        _this.resizableLeft = 0;
        _this.resizableRight = 0;
        _this.resizableTop = 0;
        _this.resizableBottom = 0;
        // For target boundary
        _this.targetLeft = 0;
        _this.targetTop = 0;
        _this.appendBase = function () {
            if (!_this.resizable || !_this.window) {
                return null;
            }
            var parent = _this.parentNode;
            if (!parent) {
                return null;
            }
            var element = _this.window.document.createElement('div');
            element.style.width = '100%';
            element.style.height = '100%';
            element.style.position = 'absolute';
            element.style.transform = 'scale(0, 0)';
            element.style.left = '0';
            element.style.flex = '0 0 100%';
            if (element.classList) {
                element.classList.add(baseClassName);
            }
            else {
                element.className += baseClassName;
            }
            parent.appendChild(element);
            return element;
        };
        _this.removeBase = function (base) {
            var parent = _this.parentNode;
            if (!parent) {
                return;
            }
            parent.removeChild(base);
        };
        _this.state = {
            isResizing: false,
            width: (_b = (_a = _this.propsSize) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 'auto',
            height: (_d = (_c = _this.propsSize) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 'auto',
            direction: 'right',
            original: {
                x: 0,
                y: 0,
                width: 0,
                height: 0,
            },
            backgroundStyle: {
                height: '100%',
                width: '100%',
                backgroundColor: 'rgba(0,0,0,0)',
                cursor: 'auto',
                opacity: 0,
                position: 'fixed',
                zIndex: 9999,
                top: '0',
                left: '0',
                bottom: '0',
                right: '0',
            },
            flexBasis: undefined,
        };
        _this.onResizeStart = _this.onResizeStart.bind(_this);
        _this.onMouseMove = _this.onMouseMove.bind(_this);
        _this.onMouseUp = _this.onMouseUp.bind(_this);
        return _this;
    }
    Object.defineProperty(Resizable.prototype, "parentNode", {
        get: function () {
            if (!this.resizable) {
                return null;
            }
            return this.resizable.parentNode;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Resizable.prototype, "window", {
        get: function () {
            if (!this.resizable) {
                return null;
            }
            if (!this.resizable.ownerDocument) {
                return null;
            }
            return this.resizable.ownerDocument.defaultView;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Resizable.prototype, "propsSize", {
        get: function () {
            return this.props.size || this.props.defaultSize || DEFAULT_SIZE;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Resizable.prototype, "size", {
        get: function () {
            var width = 0;
            var height = 0;
            if (this.resizable && this.window) {
                var orgWidth = this.resizable.offsetWidth;
                var orgHeight = this.resizable.offsetHeight;
                // HACK: Set position `relative` to get parent size.
                //       This is because when re-resizable set `absolute`, I can not get base width correctly.
                var orgPosition = this.resizable.style.position;
                if (orgPosition !== 'relative') {
                    this.resizable.style.position = 'relative';
                }
                // INFO: Use original width or height if set auto.
                width = this.resizable.style.width !== 'auto' ? this.resizable.offsetWidth : orgWidth;
                height = this.resizable.style.height !== 'auto' ? this.resizable.offsetHeight : orgHeight;
                // Restore original position
                this.resizable.style.position = orgPosition;
            }
            return { width: width, height: height };
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Resizable.prototype, "sizeStyle", {
        get: function () {
            var _this = this;
            var size = this.props.size;
            var getSize = function (key) {
                var _a;
                if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {
                    return 'auto';
                }
                if (_this.propsSize && _this.propsSize[key] && ((_a = _this.propsSize[key]) === null || _a === void 0 ? void 0 : _a.toString().endsWith('%'))) {
                    if (_this.state[key].toString().endsWith('%')) {
                        return _this.state[key].toString();
                    }
                    var parentSize = _this.getParentSize();
                    var value = Number(_this.state[key].toString().replace('px', ''));
                    var percent = (value / parentSize[key]) * 100;
                    return percent + "%";
                }
                return getStringSize(_this.state[key]);
            };
            var width = size && typeof size.width !== 'undefined' && !this.state.isResizing
                ? getStringSize(size.width)
                : getSize('width');
            var height = size && typeof size.height !== 'undefined' && !this.state.isResizing
                ? getStringSize(size.height)
                : getSize('height');
            return { width: width, height: height };
        },
        enumerable: false,
        configurable: true
    });
    Resizable.prototype.getParentSize = function () {
        if (!this.parentNode) {
            if (!this.window) {
                return { width: 0, height: 0 };
            }
            return { width: this.window.innerWidth, height: this.window.innerHeight };
        }
        var base = this.appendBase();
        if (!base) {
            return { width: 0, height: 0 };
        }
        // INFO: To calculate parent width with flex layout
        var wrapChanged = false;
        var wrap = this.parentNode.style.flexWrap;
        if (wrap !== 'wrap') {
            wrapChanged = true;
            this.parentNode.style.flexWrap = 'wrap';
            // HACK: Use relative to get parent padding size
        }
        base.style.position = 'relative';
        base.style.minWidth = '100%';
        base.style.minHeight = '100%';
        var size = {
            width: base.offsetWidth,
            height: base.offsetHeight,
        };
        if (wrapChanged) {
            this.parentNode.style.flexWrap = wrap;
        }
        this.removeBase(base);
        return size;
    };
    Resizable.prototype.bindEvents = function () {
        if (this.window) {
            this.window.addEventListener('mouseup', this.onMouseUp);
            this.window.addEventListener('mousemove', this.onMouseMove);
            this.window.addEventListener('mouseleave', this.onMouseUp);
            this.window.addEventListener('touchmove', this.onMouseMove, {
                capture: true,
                passive: false,
            });
            this.window.addEventListener('touchend', this.onMouseUp);
        }
    };
    Resizable.prototype.unbindEvents = function () {
        if (this.window) {
            this.window.removeEventListener('mouseup', this.onMouseUp);
            this.window.removeEventListener('mousemove', this.onMouseMove);
            this.window.removeEventListener('mouseleave', this.onMouseUp);
            this.window.removeEventListener('touchmove', this.onMouseMove, true);
            this.window.removeEventListener('touchend', this.onMouseUp);
        }
    };
    Resizable.prototype.componentDidMount = function () {
        if (!this.resizable || !this.window) {
            return;
        }
        var computedStyle = this.window.getComputedStyle(this.resizable);
        this.setState({
            width: this.state.width || this.size.width,
            height: this.state.height || this.size.height,
            flexBasis: computedStyle.flexBasis !== 'auto' ? computedStyle.flexBasis : undefined,
        });
    };
    Resizable.prototype.componentWillUnmount = function () {
        if (this.window) {
            this.unbindEvents();
        }
    };
    Resizable.prototype.createSizeForCssProperty = function (newSize, kind) {
        var propsSize = this.propsSize && this.propsSize[kind];
        return this.state[kind] === 'auto' &&
            this.state.original[kind] === newSize &&
            (typeof propsSize === 'undefined' || propsSize === 'auto')
            ? 'auto'
            : newSize;
    };
    Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) {
        var boundsByDirection = this.props.boundsByDirection;
        var direction = this.state.direction;
        var widthByDirection = boundsByDirection && hasDirection('left', direction);
        var heightByDirection = boundsByDirection && hasDirection('top', direction);
        var boundWidth;
        var boundHeight;
        if (this.props.bounds === 'parent') {
            var parent_1 = this.parentNode;
            if (parent_1) {
                boundWidth = widthByDirection
                    ? this.resizableRight - this.parentLeft
                    : parent_1.offsetWidth + (this.parentLeft - this.resizableLeft);
                boundHeight = heightByDirection
                    ? this.resizableBottom - this.parentTop
                    : parent_1.offsetHeight + (this.parentTop - this.resizableTop);
            }
        }
        else if (this.props.bounds === 'window') {
            if (this.window) {
                boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft;
                boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop;
            }
        }
        else if (this.props.bounds) {
            boundWidth = widthByDirection
                ? this.resizableRight - this.targetLeft
                : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft);
            boundHeight = heightByDirection
                ? this.resizableBottom - this.targetTop
                : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop);
        }
        if (boundWidth && Number.isFinite(boundWidth)) {
            maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
        }
        if (boundHeight && Number.isFinite(boundHeight)) {
            maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
        }
        return { maxWidth: maxWidth, maxHeight: maxHeight };
    };
    Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) {
        var scale = this.props.scale || 1;
        var _a = normalizeToPair(this.props.resizeRatio || 1), resizeRatioX = _a[0], resizeRatioY = _a[1];
        var _b = this.state, direction = _b.direction, original = _b.original;
        var _c = this.props, lockAspectRatio = _c.lockAspectRatio, lockAspectRatioExtraHeight = _c.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _c.lockAspectRatioExtraWidth;
        var newWidth = original.width;
        var newHeight = original.height;
        var extraHeight = lockAspectRatioExtraHeight || 0;
        var extraWidth = lockAspectRatioExtraWidth || 0;
        if (hasDirection('right', direction)) {
            newWidth = original.width + ((clientX - original.x) * resizeRatioX) / scale;
            if (lockAspectRatio) {
                newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
            }
        }
        if (hasDirection('left', direction)) {
            newWidth = original.width - ((clientX - original.x) * resizeRatioX) / scale;
            if (lockAspectRatio) {
                newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
            }
        }
        if (hasDirection('bottom', direction)) {
            newHeight = original.height + ((clientY - original.y) * resizeRatioY) / scale;
            if (lockAspectRatio) {
                newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
            }
        }
        if (hasDirection('top', direction)) {
            newHeight = original.height - ((clientY - original.y) * resizeRatioY) / scale;
            if (lockAspectRatio) {
                newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
            }
        }
        return { newWidth: newWidth, newHeight: newHeight };
    };
    Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) {
        var _a = this.props, lockAspectRatio = _a.lockAspectRatio, lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth;
        var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width;
        var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width;
        var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height;
        var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height;
        var extraHeight = lockAspectRatioExtraHeight || 0;
        var extraWidth = lockAspectRatioExtraWidth || 0;
        if (lockAspectRatio) {
            var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth;
            var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth;
            var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight;
            var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight;
            var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth);
            var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth);
            var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight);
            var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight);
            newWidth = clamp(newWidth, lockedMinWidth, lockedMaxWidth);
            newHeight = clamp(newHeight, lockedMinHeight, lockedMaxHeight);
        }
        else {
            newWidth = clamp(newWidth, computedMinWidth, computedMaxWidth);
            newHeight = clamp(newHeight, computedMinHeight, computedMaxHeight);
        }
        return { newWidth: newWidth, newHeight: newHeight };
    };
    Resizable.prototype.setBoundingClientRect = function () {
        var adjustedScale = 1 / (this.props.scale || 1);
        // For parent boundary
        if (this.props.bounds === 'parent') {
            var parent_2 = this.parentNode;
            if (parent_2) {
                var parentRect = parent_2.getBoundingClientRect();
                this.parentLeft = parentRect.left * adjustedScale;
                this.parentTop = parentRect.top * adjustedScale;
            }
        }
        // For target(html element) boundary
        if (this.props.bounds && typeof this.props.bounds !== 'string') {
            var targetRect = this.props.bounds.getBoundingClientRect();
            this.targetLeft = targetRect.left * adjustedScale;
            this.targetTop = targetRect.top * adjustedScale;
        }
        // For boundary
        if (this.resizable) {
            var _a = this.resizable.getBoundingClientRect(), left = _a.left, top_1 = _a.top, right = _a.right, bottom = _a.bottom;
            this.resizableLeft = left * adjustedScale;
            this.resizableRight = right * adjustedScale;
            this.resizableTop = top_1 * adjustedScale;
            this.resizableBottom = bottom * adjustedScale;
        }
    };
    Resizable.prototype.onResizeStart = function (event, direction) {
        if (!this.resizable || !this.window) {
            return;
        }
        var clientX = 0;
        var clientY = 0;
        if (event.nativeEvent && isMouseEvent(event.nativeEvent)) {
            clientX = event.nativeEvent.clientX;
            clientY = event.nativeEvent.clientY;
        }
        else if (event.nativeEvent && isTouchEvent(event.nativeEvent)) {
            clientX = event.nativeEvent.touches[0].clientX;
            clientY = event.nativeEvent.touches[0].clientY;
        }
        if (this.props.onResizeStart) {
            if (this.resizable) {
                var startResize = this.props.onResizeStart(event, direction, this.resizable);
                if (startResize === false) {
                    return;
                }
            }
        }
        // Fix #168
        if (this.props.size) {
            if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) {
                this.setState({ height: this.props.size.height });
            }
            if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) {
                this.setState({ width: this.props.size.width });
            }
        }
        // For lockAspectRatio case
        this.ratio =
            typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height;
        var flexBasis;
        var computedStyle = this.window.getComputedStyle(this.resizable);
        if (computedStyle.flexBasis !== 'auto') {
            var parent_3 = this.parentNode;
            if (parent_3) {
                var dir = this.window.getComputedStyle(parent_3).flexDirection;
                this.flexDir = dir.startsWith('row') ? 'row' : 'column';
                flexBasis = computedStyle.flexBasis;
            }
        }
        // For boundary
        this.setBoundingClientRect();
        this.bindEvents();
        var state = {
            original: {
                x: clientX,
                y: clientY,
                width: this.size.width,
                height: this.size.height,
            },
            isResizing: true,
            backgroundStyle: __assign(__assign({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || 'auto' }),
            direction: direction,
            flexBasis: flexBasis,
        };
        this.setState(state);
    };
    Resizable.prototype.onMouseMove = function (event) {
        var _this = this;
        if (!this.state.isResizing || !this.resizable || !this.window) {
            return;
        }
        if (this.window.TouchEvent && isTouchEvent(event)) {
            try {
                event.preventDefault();
                event.stopPropagation();
            }
            catch (e) {
                // Ignore on fail
            }
        }
        var _a = this.props, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, minWidth = _a.minWidth, minHeight = _a.minHeight;
        var clientX = isTouchEvent(event) ? event.touches[0].clientX : event.clientX;
        var clientY = isTouchEvent(event) ? event.touches[0].clientY : event.clientY;
        var _b = this.state, direction = _b.direction, original = _b.original, width = _b.width, height = _b.height;
        var parentSize = this.getParentSize();
        var max = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight);
        maxWidth = max.maxWidth;
        maxHeight = max.maxHeight;
        minWidth = max.minWidth;
        minHeight = max.minHeight;
        // Calculate new size
        var _c = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c.newHeight, newWidth = _c.newWidth;
        // Calculate max size from boundary settings
        var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight);
        if (this.props.snap && this.props.snap.x) {
            newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
        }
        if (this.props.snap && this.props.snap.y) {
            newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
        }
        // Calculate new size from aspect ratio
        var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight });
        newWidth = newSize.newWidth;
        newHeight = newSize.newHeight;
        if (this.props.grid) {
            var newGridWidth = snap(newWidth, this.props.grid[0], this.props.gridGap ? this.props.gridGap[0] : 0);
            var newGridHeight = snap(newHeight, this.props.grid[1], this.props.gridGap ? this.props.gridGap[1] : 0);
            var gap = this.props.snapGap || 0;
            var w = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;
            var h = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;
            newWidth = w;
            newHeight = h;
        }
        var delta = {
            width: newWidth - original.width,
            height: newHeight - original.height,
        };
        if (width && typeof width === 'string') {
            if (width.endsWith('%')) {
                var percent = (newWidth / parentSize.width) * 100;
                newWidth = percent + "%";
            }
            else if (width.endsWith('vw')) {
                var vw = (newWidth / this.window.innerWidth) * 100;
                newWidth = vw + "vw";
            }
            else if (width.endsWith('vh')) {
                var vh = (newWidth / this.window.innerHeight) * 100;
                newWidth = vh + "vh";
            }
        }
        if (height && typeof height === 'string') {
            if (height.endsWith('%')) {
                var percent = (newHeight / parentSize.height) * 100;
                newHeight = percent + "%";
            }
            else if (height.endsWith('vw')) {
                var vw = (newHeight / this.window.innerWidth) * 100;
                newHeight = vw + "vw";
            }
            else if (height.endsWith('vh')) {
                var vh = (newHeight / this.window.innerHeight) * 100;
                newHeight = vh + "vh";
            }
        }
        var newState = {
            width: this.createSizeForCssProperty(newWidth, 'width'),
            height: this.createSizeForCssProperty(newHeight, 'height'),
        };
        if (this.flexDir === 'row') {
            newState.flexBasis = newState.width;
        }
        else if (this.flexDir === 'column') {
            newState.flexBasis = newState.height;
        }
        var widthChanged = this.state.width !== newState.width;
        var heightChanged = this.state.height !== newState.height;
        var flexBaseChanged = this.state.flexBasis !== newState.flexBasis;
        var changed = widthChanged || heightChanged || flexBaseChanged;
        if (changed) {
            // For v18, update state sync
            (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.flushSync)(function () {
                _this.setState(newState);
            });
        }
        if (this.props.onResize) {
            if (changed) {
                this.props.onResize(event, direction, this.resizable, delta);
            }
        }
    };
    Resizable.prototype.onMouseUp = function (event) {
        var _a, _b;
        var _c = this.state, isResizing = _c.isResizing, direction = _c.direction, original = _c.original;
        if (!isResizing || !this.resizable) {
            return;
        }
        var delta = {
            width: this.size.width - original.width,
            height: this.size.height - original.height,
        };
        if (this.props.onResizeStop) {
            this.props.onResizeStop(event, direction, this.resizable, delta);
        }
        if (this.props.size) {
            this.setState({ width: (_a = this.props.size.width) !== null && _a !== void 0 ? _a : 'auto', height: (_b = this.props.size.height) !== null && _b !== void 0 ? _b : 'auto' });
        }
        this.unbindEvents();
        this.setState({
            isResizing: false,
            backgroundStyle: __assign(__assign({}, this.state.backgroundStyle), { cursor: 'auto' }),
        });
    };
    Resizable.prototype.updateSize = function (size) {
        var _a, _b;
        this.setState({ width: (_a = size.width) !== null && _a !== void 0 ? _a : 'auto', height: (_b = size.height) !== null && _b !== void 0 ? _b : 'auto' });
    };
    Resizable.prototype.renderResizer = function () {
        var _this = this;
        var _a = this.props, enable = _a.enable, handleStyles = _a.handleStyles, handleClasses = _a.handleClasses, handleWrapperStyle = _a.handleWrapperStyle, handleWrapperClass = _a.handleWrapperClass, handleComponent = _a.handleComponent;
        if (!enable) {
            return null;
        }
        var resizers = Object.keys(enable).map(function (dir) {
            if (enable[dir] !== false) {
                return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_resizer__WEBPACK_IMPORTED_MODULE_2__.Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null));
            }
            return null;
        });
        // #93 Wrap the resize box in span (will not break 100% width/height)
        return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers));
    };
    Resizable.prototype.render = function () {
        var _this = this;
        var extendsProps = Object.keys(this.props).reduce(function (acc, key) {
            if (definedProps.indexOf(key) !== -1) {
                return acc;
            }
            acc[key] = _this.props[key];
            return acc;
        }, {});
        var style = __assign(__assign(__assign({ position: 'relative', userSelect: this.state.isResizing ? 'none' : 'auto' }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: 'border-box', flexShrink: 0 });
        if (this.state.flexBasis) {
            style.flexBasis = this.state.flexBasis;
        }
        var Wrapper = this.props.as || 'div';
        return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(Wrapper, __assign({ style: style, className: this.props.className }, extendsProps, { 
            // `ref` is after `extendsProps` to ensure this one wins over a version
            // passed in
            ref: function (c) {
                if (c) {
                    _this.resizable = c;
                }
            } }),
            this.state.isResizing && react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: this.state.backgroundStyle }),
            this.props.children,
            this.renderResizer()));
    };
    Resizable.defaultProps = {
        as: 'div',
        onResizeStart: function () { },
        onResize: function () { },
        onResizeStop: function () { },
        enable: {
            top: true,
            right: true,
            bottom: true,
            left: true,
            topRight: true,
            bottomRight: true,
            bottomLeft: true,
            topLeft: true,
        },
        style: {},
        grid: [1, 1],
        gridGap: [0, 0],
        lockAspectRatio: false,
        lockAspectRatioExtraWidth: 0,
        lockAspectRatioExtraHeight: 0,
        scale: 1,
        resizeRatio: 1,
        snapGap: 0,
    };
    return Resizable;
}(react__WEBPACK_IMPORTED_MODULE_0__.PureComponent));



/***/ }),

/***/ "../../../../node_modules/re-resizable/lib/resizer.js":
/*!************************************************************!*\
  !*** ../../../../node_modules/re-resizable/lib/resizer.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_247925__) => {

"use strict";
__nested_webpack_require_247925__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_247925__.d(__nested_webpack_exports__, {
/* harmony export */   Resizer: () => (/* binding */ Resizer)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_247925__(/*! react */ "../../../../node_modules/react/index.js");
var __extends = ( false) || (function () {
    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);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = ( false) || function () {
    __assign = Object.assign || function(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);
};

var rowSizeBase = {
    width: '100%',
    height: '10px',
    top: '0px',
    left: '0px',
    cursor: 'row-resize',
};
var colSizeBase = {
    width: '10px',
    height: '100%',
    top: '0px',
    left: '0px',
    cursor: 'col-resize',
};
var edgeBase = {
    width: '20px',
    height: '20px',
    position: 'absolute',
};
var styles = {
    top: __assign(__assign({}, rowSizeBase), { top: '-5px' }),
    right: __assign(__assign({}, colSizeBase), { left: undefined, right: '-5px' }),
    bottom: __assign(__assign({}, rowSizeBase), { top: undefined, bottom: '-5px' }),
    left: __assign(__assign({}, colSizeBase), { left: '-5px' }),
    topRight: __assign(__assign({}, edgeBase), { right: '-10px', top: '-10px', cursor: 'ne-resize' }),
    bottomRight: __assign(__assign({}, edgeBase), { right: '-10px', bottom: '-10px', cursor: 'se-resize' }),
    bottomLeft: __assign(__assign({}, edgeBase), { left: '-10px', bottom: '-10px', cursor: 'sw-resize' }),
    topLeft: __assign(__assign({}, edgeBase), { left: '-10px', top: '-10px', cursor: 'nw-resize' }),
};
var Resizer = /** @class */ (function (_super) {
    __extends(Resizer, _super);
    function Resizer() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.onMouseDown = function (e) {
            _this.props.onResizeStart(e, _this.props.direction);
        };
        _this.onTouchStart = function (e) {
            _this.props.onResizeStart(e, _this.props.direction);
        };
        return _this;
    }
    Resizer.prototype.render = function () {
        return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: this.props.className || '', style: __assign(__assign({ position: 'absolute', userSelect: 'none' }, styles[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
    };
    return Resizer;
}(react__WEBPACK_IMPORTED_MODULE_0__.PureComponent));



/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/AbstractMenu.js":
/*!**********************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/AbstractMenu.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_251648__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__nested_webpack_require_251648__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_251648__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _MenuItem = _interopRequireDefault(__nested_webpack_require_251648__(/*! ./MenuItem */ "../../../../node_modules/react-contextmenu/es6/MenuItem.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var AbstractMenu = /*#__PURE__*/function (_Component) {
  _inherits(AbstractMenu, _Component);

  var _super = _createSuper(AbstractMenu);

  function AbstractMenu(_props) {
    var _this;

    _classCallCheck(this, AbstractMenu);

    _this = _super.call(this, _props);

    _defineProperty(_assertThisInitialized(_this), "handleKeyNavigation", function (e) {
      // check for isVisible strictly here as it might be undefined when this code executes in the context of SubMenu
      // but we only need to check when it runs in the ContextMenu context
      if (_this.state.isVisible === false) {
        return;
      }

      switch (e.keyCode) {
        case 37: // left arrow

        case 27:
          // escape
          e.preventDefault();

          _this.hideMenu(e);

          break;

        case 38:
          // up arrow
          e.preventDefault();

          _this.selectChildren(true);

          break;

        case 40:
          // down arrow
          e.preventDefault();

          _this.selectChildren(false);

          break;

        case 39:
          // right arrow
          _this.tryToOpenSubMenu(e);

          break;

        case 13:
          // enter
          e.preventDefault();

          _this.tryToOpenSubMenu(e);

          {
            // determine the selected item is disabled or not
            var disabled = _this.seletedItemRef && _this.seletedItemRef.props && _this.seletedItemRef.props.disabled;

            if (_this.seletedItemRef && _this.seletedItemRef.ref instanceof HTMLElement && !disabled) {
              _this.seletedItemRef.ref.click();
            } else {
              _this.hideMenu(e);
            }
          }
          break;

        default: // do nothing

      }
    });

    _defineProperty(_assertThisInitialized(_this), "handleForceClose", function () {
      _this.setState({
        forceSubMenuOpen: false
      });
    });

    _defineProperty(_assertThisInitialized(_this), "tryToOpenSubMenu", function (e) {
      if (_this.state.selectedItem && _this.state.selectedItem.type === _this.getSubMenuType()) {
        e.preventDefault();

        _this.setState({
          forceSubMenuOpen: true
        });
      }
    });

    _defineProperty(_assertThisInitialized(_this), "selectChildren", function (forward) {
      var selectedItem = _this.state.selectedItem;
      var children = [];
      var disabledChildrenCount = 0;
      var disabledChildIndexes = {};

      var childCollector = function childCollector(child, index) {
        // child can be empty in case you do conditional rendering of components, in which
        // case it should not be accounted for as a real child
        if (!child) {
          return;
        }

        if ([_MenuItem["default"], _this.getSubMenuType()].indexOf(child.type) < 0) {
          // Maybe the MenuItem or SubMenu is capsuled in a wrapper div or something else
          _react["default"].Children.forEach(child.props.children, childCollector);
        } else if (!child.props.divider) {
          if (child.props.disabled) {
            ++disabledChildrenCount;
            disabledChildIndexes[index] = true;
          }

          children.push(child);
        }
      };

      _react["default"].Children.forEach(_this.props.children, childCollector);

      if (disabledChildrenCount === children.length) {
        // All menu items are disabled, so none can be selected, don't do anything
        return;
      }

      function findNextEnabledChildIndex(currentIndex) {
        var i = currentIndex;

        var incrementCounter = function incrementCounter() {
          if (forward) {
            --i;
          } else {
            ++i;
          }

          if (i < 0) {
            i = children.length - 1;
          } else if (i >= children.length) {
            i = 0;
          }
        };

        do {
          incrementCounter();
        } while (i !== currentIndex && disabledChildIndexes[i]);

        return i === currentIndex ? null : i;
      }

      var currentIndex = children.indexOf(selectedItem);
      var nextEnabledChildIndex = findNextEnabledChildIndex(currentIndex);

      if (nextEnabledChildIndex !== null) {
        _this.setState({
          selectedItem: children[nextEnabledChildIndex],
          forceSubMenuOpen: false
        });
      }
    });

    _defineProperty(_assertThisInitialized(_this), "onChildMouseMove", function (child) {
      if (_this.state.selectedItem !== child) {
        _this.setState({
          selectedItem: child,
          forceSubMenuOpen: false
        });
      }
    });

    _defineProperty(_assertThisInitialized(_this), "onChildMouseLeave", function () {
      _this.setState({
        selectedItem: null,
        forceSubMenuOpen: false
      });
    });

    _defineProperty(_assertThisInitialized(_this), "renderChildren", function (children) {
      return _react["default"].Children.map(children, function (child) {
        var props = {};
        if (! /*#__PURE__*/_react["default"].isValidElement(child)) return child;

        if ([_MenuItem["default"], _this.getSubMenuType()].indexOf(child.type) < 0) {
          // Maybe the MenuItem or SubMenu is capsuled in a wrapper div or something else
          props.children = _this.renderChildren(child.props.children);
          return /*#__PURE__*/_react["default"].cloneElement(child, props);
        }

        props.onMouseLeave = _this.onChildMouseLeave.bind(_assertThisInitialized(_this));

        if (child.type === _this.getSubMenuType()) {
          // special props for SubMenu only
          props.forceOpen = _this.state.forceSubMenuOpen && _this.state.selectedItem === child;
          props.forceClose = _this.handleForceClose;
          props.parentKeyNavigationHandler = _this.handleKeyNavigation;
        }

        if (!child.props.divider && _this.state.selectedItem === child) {
          // special props for selected item only
          props.selected = true;

          props.ref = function (ref) {
            _this.seletedItemRef = ref;
          };

          return /*#__PURE__*/_react["default"].cloneElement(child, props);
        } // onMouseMove is only needed for non selected items


        props.onMouseMove = function () {
          return _this.onChildMouseMove(child);
        };

        return /*#__PURE__*/_react["default"].cloneElement(child, props);
      });
    });

    _this.seletedItemRef = null;
    _this.state = {
      selectedItem: null,
      forceSubMenuOpen: false
    };
    return _this;
  }

  return _createClass(AbstractMenu);
}(_react.Component);

exports["default"] = AbstractMenu;

_defineProperty(AbstractMenu, "propTypes", {
  children: _propTypes["default"].node.isRequired
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/ContextMenu.js":
/*!*********************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/ContextMenu.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_263854__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireDefault(__nested_webpack_require_263854__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_263854__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _classnames = _interopRequireDefault(__nested_webpack_require_263854__(/*! classnames */ "../../../../node_modules/classnames/index.js"));

var _objectAssign = _interopRequireDefault(__nested_webpack_require_263854__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _globalEventListener = _interopRequireDefault(__nested_webpack_require_263854__(/*! ./globalEventListener */ "../../../../node_modules/react-contextmenu/es6/globalEventListener.js"));

var _AbstractMenu2 = _interopRequireDefault(__nested_webpack_require_263854__(/*! ./AbstractMenu */ "../../../../node_modules/react-contextmenu/es6/AbstractMenu.js"));

var _SubMenu = _interopRequireDefault(__nested_webpack_require_263854__(/*! ./SubMenu */ "../../../../node_modules/react-contextmenu/es6/SubMenu.js"));

var _actions = __nested_webpack_require_263854__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _helpers = __nested_webpack_require_263854__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var ContextMenu = /*#__PURE__*/function (_AbstractMenu) {
  _inherits(ContextMenu, _AbstractMenu);

  var _super = _createSuper(ContextMenu);

  function ContextMenu(props) {
    var _this;

    _classCallCheck(this, ContextMenu);

    _this = _super.call(this, props);

    _defineProperty(_assertThisInitialized(_this), "registerHandlers", function () {
      document.addEventListener('mousedown', _this.handleOutsideClick);
      document.addEventListener('touchstart', _this.handleOutsideClick);
      if (!_this.props.preventHideOnScroll) document.addEventListener('scroll', _this.handleHide);
      if (!_this.props.preventHideOnContextMenu) document.addEventListener('contextmenu', _this.handleHide);
      document.addEventListener('keydown', _this.handleKeyNavigation);
      if (!_this.props.preventHideOnResize) window.addEventListener('resize', _this.handleHide);
    });

    _defineProperty(_assertThisInitialized(_this), "unregisterHandlers", function () {
      document.removeEventListener('mousedown', _this.handleOutsideClick);
      document.removeEventListener('touchstart', _this.handleOutsideClick);
      document.removeEventListener('scroll', _this.handleHide);
      document.removeEventListener('contextmenu', _this.handleHide);
      document.removeEventListener('keydown', _this.handleKeyNavigation);
      window.removeEventListener('resize', _this.handleHide);
    });

    _defineProperty(_assertThisInitialized(_this), "handleShow", function (e) {
      if (e.detail.id !== _this.props.id || _this.state.isVisible) return;
      var _e$detail$position = e.detail.position,
          x = _e$detail$position.x,
          y = _e$detail$position.y;

      _this.setState({
        isVisible: true,
        x: x,
        y: y
      });

      _this.registerHandlers();

      (0, _helpers.callIfExists)(_this.props.onShow, e);
    });

    _defineProperty(_assertThisInitialized(_this), "handleHide", function (e) {
      if (_this.state.isVisible && (!e.detail || !e.detail.id || e.detail.id === _this.props.id)) {
        _this.unregisterHandlers();

        _this.setState({
          isVisible: false,
          selectedItem: null,
          forceSubMenuOpen: false
        });

        (0, _helpers.callIfExists)(_this.props.onHide, e);
      }
    });

    _defineProperty(_assertThisInitialized(_this), "handleOutsideClick", function (e) {
      if (!_this.menu.contains(e.target)) (0, _actions.hideMenu)();
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function (event) {
      event.preventDefault();
      (0, _helpers.callIfExists)(_this.props.onMouseLeave, event, (0, _objectAssign["default"])({}, _this.props.data, _helpers.store.data), _helpers.store.target);
      if (_this.props.hideOnLeave) (0, _actions.hideMenu)();
    });

    _defineProperty(_assertThisInitialized(_this), "handleContextMenu", function (e) {
      if (false) {}

      _this.handleHide(e);
    });

    _defineProperty(_assertThisInitialized(_this), "hideMenu", function (e) {
      if (e.keyCode === 27 || e.keyCode === 13) {
        // ECS or enter
        (0, _actions.hideMenu)();
      }
    });

    _defineProperty(_assertThisInitialized(_this), "getMenuPosition", function () {
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var menuStyles = {
        top: y,
        left: x
      };
      if (!_this.menu) return menuStyles;
      var _window = window,
          innerWidth = _window.innerWidth,
          innerHeight = _window.innerHeight;

      var rect = _this.menu.getBoundingClientRect();

      if (y + rect.height > innerHeight) {
        menuStyles.top -= rect.height;
      }

      if (x + rect.width > innerWidth) {
        menuStyles.left -= rect.width;
      }

      if (menuStyles.top < 0) {
        menuStyles.top = rect.height < innerHeight ? (innerHeight - rect.height) / 2 : 0;
      }

      if (menuStyles.left < 0) {
        menuStyles.left = rect.width < innerWidth ? (innerWidth - rect.width) / 2 : 0;
      }

      return menuStyles;
    });

    _defineProperty(_assertThisInitialized(_this), "getRTLMenuPosition", function () {
      var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
      var menuStyles = {
        top: y,
        left: x
      };
      if (!_this.menu) return menuStyles;
      var _window2 = window,
          innerWidth = _window2.innerWidth,
          innerHeight = _window2.innerHeight;

      var rect = _this.menu.getBoundingClientRect(); // Try to position the menu on the left side of the cursor


      menuStyles.left = x - rect.width;

      if (y + rect.height > innerHeight) {
        menuStyles.top -= rect.height;
      }

      if (menuStyles.left < 0) {
        menuStyles.left += rect.width;
      }

      if (menuStyles.top < 0) {
        menuStyles.top = rect.height < innerHeight ? (innerHeight - rect.height) / 2 : 0;
      }

      if (menuStyles.left + rect.width > innerWidth) {
        menuStyles.left = rect.width < innerWidth ? (innerWidth - rect.width) / 2 : 0;
      }

      return menuStyles;
    });

    _defineProperty(_assertThisInitialized(_this), "menuRef", function (c) {
      _this.menu = c;
    });

    _this.state = (0, _objectAssign["default"])({}, _this.state, {
      x: 0,
      y: 0,
      isVisible: false
    });
    return _this;
  }

  _createClass(ContextMenu, [{
    key: "getSubMenuType",
    value: function getSubMenuType() {
      // eslint-disable-line class-methods-use-this
      return _SubMenu["default"];
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      this.listenId = _globalEventListener["default"].register(this.handleShow, this.handleHide);
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate() {
      var _this2 = this;

      var wrapper = window.requestAnimationFrame || setTimeout;

      if (this.state.isVisible) {
        wrapper(function () {
          var _this2$state = _this2.state,
              x = _this2$state.x,
              y = _this2$state.y;

          var _ref = _this2.props.rtl ? _this2.getRTLMenuPosition(x, y) : _this2.getMenuPosition(x, y),
              top = _ref.top,
              left = _ref.left;

          wrapper(function () {
            if (!_this2.menu) return;
            _this2.menu.style.top = "".concat(top, "px");
            _this2.menu.style.left = "".concat(left, "px");
            _this2.menu.style.opacity = 1;
            _this2.menu.style.pointerEvents = 'auto';
          });
        });
      } else {
        wrapper(function () {
          if (!_this2.menu) return;
          _this2.menu.style.opacity = 0;
          _this2.menu.style.pointerEvents = 'none';
        });
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      if (this.listenId) {
        _globalEventListener["default"].unregister(this.listenId);
      }

      this.unregisterHandlers();
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props = this.props,
          children = _this$props.children,
          className = _this$props.className,
          style = _this$props.style;
      var isVisible = this.state.isVisible;
      var inlineStyle = (0, _objectAssign["default"])({}, style, {
        position: 'fixed',
        opacity: 0,
        pointerEvents: 'none'
      });
      var menuClassnames = (0, _classnames["default"])(_helpers.cssClasses.menu, className, _defineProperty({}, _helpers.cssClasses.menuVisible, isVisible));
      return /*#__PURE__*/_react["default"].createElement("nav", {
        role: "menu",
        tabIndex: "-1",
        ref: this.menuRef,
        style: inlineStyle,
        className: menuClassnames,
        onContextMenu: this.handleContextMenu,
        onMouseLeave: this.handleMouseLeave
      }, this.renderChildren(children));
    }
  }]);

  return ContextMenu;
}(_AbstractMenu2["default"]);

exports["default"] = ContextMenu;

_defineProperty(ContextMenu, "propTypes", {
  id: _propTypes["default"].string.isRequired,
  children: _propTypes["default"].node.isRequired,
  data: _propTypes["default"].object,
  className: _propTypes["default"].string,
  hideOnLeave: _propTypes["default"].bool,
  rtl: _propTypes["default"].bool,
  onHide: _propTypes["default"].func,
  onMouseLeave: _propTypes["default"].func,
  onShow: _propTypes["default"].func,
  preventHideOnContextMenu: _propTypes["default"].bool,
  preventHideOnResize: _propTypes["default"].bool,
  preventHideOnScroll: _propTypes["default"].bool,
  style: _propTypes["default"].object
});

_defineProperty(ContextMenu, "defaultProps", {
  className: '',
  data: {},
  hideOnLeave: false,
  rtl: false,
  onHide: function onHide() {
    return null;
  },
  onMouseLeave: function onMouseLeave() {
    return null;
  },
  onShow: function onShow() {
    return null;
  },
  preventHideOnContextMenu: false,
  preventHideOnResize: false,
  preventHideOnScroll: false,
  style: {}
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js":
/*!****************************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_278231__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__nested_webpack_require_278231__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_278231__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _classnames = _interopRequireDefault(__nested_webpack_require_278231__(/*! classnames */ "../../../../node_modules/classnames/index.js"));

var _objectAssign = _interopRequireDefault(__nested_webpack_require_278231__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _actions = __nested_webpack_require_278231__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _helpers = __nested_webpack_require_278231__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var ContextMenuTrigger = /*#__PURE__*/function (_Component) {
  _inherits(ContextMenuTrigger, _Component);

  var _super = _createSuper(ContextMenuTrigger);

  function ContextMenuTrigger() {
    var _this;

    _classCallCheck(this, ContextMenuTrigger);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "touchHandled", false);

    _defineProperty(_assertThisInitialized(_this), "handleMouseDown", function (event) {
      if (_this.props.holdToDisplay >= 0 && event.button === 0) {
        event.persist();
        event.stopPropagation();
        _this.mouseDownTimeoutId = setTimeout(function () {
          return _this.handleContextClick(event);
        }, _this.props.holdToDisplay);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onMouseDown, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseUp", function (event) {
      if (event.button === 0) {
        clearTimeout(_this.mouseDownTimeoutId);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onMouseUp, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseOut", function (event) {
      if (event.button === 0) {
        clearTimeout(_this.mouseDownTimeoutId);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onMouseOut, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleTouchstart", function (event) {
      _this.touchHandled = false;

      if (_this.props.holdToDisplay >= 0) {
        event.persist();
        event.stopPropagation();
        _this.touchstartTimeoutId = setTimeout(function () {
          _this.handleContextClick(event);

          _this.touchHandled = true;
        }, _this.props.holdToDisplay);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onTouchStart, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleTouchEnd", function (event) {
      if (_this.touchHandled) {
        event.preventDefault();
      }

      clearTimeout(_this.touchstartTimeoutId);
      (0, _helpers.callIfExists)(_this.props.attributes.onTouchEnd, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleContextMenu", function (event) {
      if (event.button === _this.props.mouseButton) {
        _this.handleContextClick(event);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onContextMenu, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseClick", function (event) {
      if (event.button === _this.props.mouseButton) {
        _this.handleContextClick(event);
      }

      (0, _helpers.callIfExists)(_this.props.attributes.onClick, event);
    });

    _defineProperty(_assertThisInitialized(_this), "handleContextClick", function (event) {
      if (_this.props.disable) return;
      if (_this.props.disableIfShiftIsPressed && event.shiftKey) return;
      event.preventDefault();
      event.stopPropagation();
      var x = event.clientX || event.touches && event.touches[0].pageX;
      var y = event.clientY || event.touches && event.touches[0].pageY;

      if (_this.props.posX) {
        x -= _this.props.posX;
      }

      if (_this.props.posY) {
        y -= _this.props.posY;
      }

      (0, _actions.hideMenu)();
      var data = (0, _helpers.callIfExists)(_this.props.collect, _this.props);
      var showMenuConfig = {
        position: {
          x: x,
          y: y
        },
        target: _this.elem,
        id: _this.props.id
      };

      if (data && typeof data.then === 'function') {
        // it's promise
        data.then(function (resp) {
          showMenuConfig.data = (0, _objectAssign["default"])({}, resp, {
            target: event.target
          });
          (0, _actions.showMenu)(showMenuConfig);
        });
      } else {
        showMenuConfig.data = (0, _objectAssign["default"])({}, data, {
          target: event.target
        });
        (0, _actions.showMenu)(showMenuConfig);
      }
    });

    _defineProperty(_assertThisInitialized(_this), "elemRef", function (c) {
      _this.elem = c;
    });

    return _this;
  }

  _createClass(ContextMenuTrigger, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          renderTag = _this$props.renderTag,
          attributes = _this$props.attributes,
          children = _this$props.children;
      var newAttrs = (0, _objectAssign["default"])({}, attributes, {
        className: (0, _classnames["default"])(_helpers.cssClasses.menuWrapper, attributes.className),
        onContextMenu: this.handleContextMenu,
        onClick: this.handleMouseClick,
        onMouseDown: this.handleMouseDown,
        onMouseUp: this.handleMouseUp,
        onTouchStart: this.handleTouchstart,
        onTouchEnd: this.handleTouchEnd,
        onMouseOut: this.handleMouseOut,
        ref: this.elemRef
      });
      return /*#__PURE__*/_react["default"].createElement(renderTag, newAttrs, children);
    }
  }]);

  return ContextMenuTrigger;
}(_react.Component);

exports["default"] = ContextMenuTrigger;

_defineProperty(ContextMenuTrigger, "propTypes", {
  id: _propTypes["default"].string.isRequired,
  children: _propTypes["default"].node.isRequired,
  attributes: _propTypes["default"].object,
  collect: _propTypes["default"].func,
  disable: _propTypes["default"].bool,
  holdToDisplay: _propTypes["default"].number,
  posX: _propTypes["default"].number,
  posY: _propTypes["default"].number,
  renderTag: _propTypes["default"].elementType,
  mouseButton: _propTypes["default"].number,
  disableIfShiftIsPressed: _propTypes["default"].bool
});

_defineProperty(ContextMenuTrigger, "defaultProps", {
  attributes: {},
  collect: function collect() {
    return null;
  },
  disable: false,
  holdToDisplay: 1000,
  renderTag: 'div',
  posX: 0,
  posY: 0,
  mouseButton: 2,
  // 0 is left click, 2 is right click
  disableIfShiftIsPressed: false
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/MenuItem.js":
/*!******************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/MenuItem.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_290173__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__nested_webpack_require_290173__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_290173__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _classnames = _interopRequireDefault(__nested_webpack_require_290173__(/*! classnames */ "../../../../node_modules/classnames/index.js"));

var _objectAssign = _interopRequireDefault(__nested_webpack_require_290173__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _actions = __nested_webpack_require_290173__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _helpers = __nested_webpack_require_290173__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var MenuItem = /*#__PURE__*/function (_Component) {
  _inherits(MenuItem, _Component);

  var _super = _createSuper(MenuItem);

  function MenuItem() {
    var _this;

    _classCallCheck(this, MenuItem);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
      if (event.button !== 0 && event.button !== 1) {
        event.preventDefault();
      }

      if (_this.props.disabled || _this.props.divider) return;
      (0, _helpers.callIfExists)(_this.props.onClick, event, (0, _objectAssign["default"])({}, _this.props.data, _helpers.store.data), _helpers.store.target);
      if (_this.props.preventClose) return;
      (0, _actions.hideMenu)();
    });

    return _this;
  }

  _createClass(MenuItem, [{
    key: "render",
    value: function render() {
      var _cx,
          _this2 = this;

      var _this$props = this.props,
          attributes = _this$props.attributes,
          children = _this$props.children,
          className = _this$props.className,
          disabled = _this$props.disabled,
          divider = _this$props.divider,
          selected = _this$props.selected;
      var menuItemClassNames = (0, _classnames["default"])(className, _helpers.cssClasses.menuItem, attributes.className, (_cx = {}, _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemDisabled, attributes.disabledClassName), disabled), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemDivider, attributes.dividerClassName), divider), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemSelected, attributes.selectedClassName), selected), _cx));
      return /*#__PURE__*/_react["default"].createElement("div", _extends({}, attributes, {
        className: menuItemClassNames,
        role: "menuitem",
        tabIndex: "-1",
        "aria-disabled": disabled ? 'true' : 'false',
        "aria-orientation": divider ? 'horizontal' : null,
        ref: function ref(_ref) {
          _this2.ref = _ref;
        },
        onMouseMove: this.props.onMouseMove,
        onMouseLeave: this.props.onMouseLeave,
        onTouchEnd: this.handleClick,
        onClick: this.handleClick
      }), divider ? null : children);
    }
  }]);

  return MenuItem;
}(_react.Component);

exports["default"] = MenuItem;

_defineProperty(MenuItem, "propTypes", {
  attributes: _propTypes["default"].object,
  children: _propTypes["default"].node,
  className: _propTypes["default"].string,
  data: _propTypes["default"].object,
  disabled: _propTypes["default"].bool,
  divider: _propTypes["default"].bool,
  onClick: _propTypes["default"].func,
  onMouseLeave: _propTypes["default"].func,
  onMouseMove: _propTypes["default"].func,
  preventClose: _propTypes["default"].bool,
  selected: _propTypes["default"].bool
});

_defineProperty(MenuItem, "defaultProps", {
  attributes: {},
  children: null,
  className: '',
  data: {},
  disabled: false,
  divider: false,
  onClick: function onClick() {
    return null;
  },
  onMouseMove: function onMouseMove() {
    return null;
  },
  onMouseLeave: function onMouseLeave() {
    return null;
  },
  preventClose: false,
  selected: false
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/SubMenu.js":
/*!*****************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/SubMenu.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_299699__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireDefault(__nested_webpack_require_299699__(/*! react */ "../../../../node_modules/react/index.js"));

var _propTypes = _interopRequireDefault(__nested_webpack_require_299699__(/*! prop-types */ "../../../../node_modules/prop-types/index.js"));

var _classnames = _interopRequireDefault(__nested_webpack_require_299699__(/*! classnames */ "../../../../node_modules/classnames/index.js"));

var _objectAssign = _interopRequireDefault(__nested_webpack_require_299699__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _actions = __nested_webpack_require_299699__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _AbstractMenu2 = _interopRequireDefault(__nested_webpack_require_299699__(/*! ./AbstractMenu */ "../../../../node_modules/react-contextmenu/es6/AbstractMenu.js"));

var _helpers = __nested_webpack_require_299699__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

var _globalEventListener = _interopRequireDefault(__nested_webpack_require_299699__(/*! ./globalEventListener */ "../../../../node_modules/react-contextmenu/es6/globalEventListener.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var SubMenu = /*#__PURE__*/function (_AbstractMenu) {
  _inherits(SubMenu, _AbstractMenu);

  var _super = _createSuper(SubMenu);

  function SubMenu(props) {
    var _this;

    _classCallCheck(this, SubMenu);

    _this = _super.call(this, props);

    _defineProperty(_assertThisInitialized(_this), "getMenuPosition", function () {
      var _window = window,
          innerWidth = _window.innerWidth,
          innerHeight = _window.innerHeight;

      var rect = _this.subMenu.getBoundingClientRect();

      var position = {};

      if (rect.bottom > innerHeight) {
        position.bottom = 0;
      } else {
        position.top = 0;
      }

      if (rect.right < innerWidth) {
        position.left = '100%';
      } else {
        position.right = '100%';
      }

      return position;
    });

    _defineProperty(_assertThisInitialized(_this), "getRTLMenuPosition", function () {
      var _window2 = window,
          innerHeight = _window2.innerHeight;

      var rect = _this.subMenu.getBoundingClientRect();

      var position = {};

      if (rect.bottom > innerHeight) {
        position.bottom = 0;
      } else {
        position.top = 0;
      }

      if (rect.left < 0) {
        position.left = '100%';
      } else {
        position.right = '100%';
      }

      return position;
    });

    _defineProperty(_assertThisInitialized(_this), "hideMenu", function (e) {
      e.preventDefault();

      _this.hideSubMenu(e);
    });

    _defineProperty(_assertThisInitialized(_this), "hideSubMenu", function (e) {
      // avoid closing submenus of a different menu tree
      if (e.detail && e.detail.id && _this.menu && e.detail.id !== _this.menu.id) {
        return;
      }

      if (_this.props.forceOpen) {
        _this.props.forceClose();
      }

      _this.setState({
        visible: false,
        selectedItem: null
      });

      _this.unregisterHandlers();
    });

    _defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
      event.preventDefault();
      if (_this.props.disabled) return;
      (0, _helpers.callIfExists)(_this.props.onClick, event, (0, _objectAssign["default"])({}, _this.props.data, _helpers.store.data), _helpers.store.target);
      if (!_this.props.onClick || _this.props.preventCloseOnClick) return;
      (0, _actions.hideMenu)();
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function () {
      if (_this.closetimer) clearTimeout(_this.closetimer);
      if (_this.props.disabled || _this.state.visible) return;
      _this.opentimer = setTimeout(function () {
        return _this.setState({
          visible: true,
          selectedItem: null
        });
      }, _this.props.hoverDelay);
    });

    _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function () {
      if (_this.opentimer) clearTimeout(_this.opentimer);
      if (!_this.state.visible) return;
      _this.closetimer = setTimeout(function () {
        return _this.setState({
          visible: false,
          selectedItem: null
        });
      }, _this.props.hoverDelay);
    });

    _defineProperty(_assertThisInitialized(_this), "menuRef", function (c) {
      _this.menu = c;
    });

    _defineProperty(_assertThisInitialized(_this), "subMenuRef", function (c) {
      _this.subMenu = c;
    });

    _defineProperty(_assertThisInitialized(_this), "registerHandlers", function () {
      document.removeEventListener('keydown', _this.props.parentKeyNavigationHandler);
      document.addEventListener('keydown', _this.handleKeyNavigation);
    });

    _defineProperty(_assertThisInitialized(_this), "unregisterHandlers", function (dismounting) {
      document.removeEventListener('keydown', _this.handleKeyNavigation);

      if (!dismounting) {
        document.addEventListener('keydown', _this.props.parentKeyNavigationHandler);
      }
    });

    _this.state = (0, _objectAssign["default"])({}, _this.state, {
      visible: false
    });
    return _this;
  }

  _createClass(SubMenu, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.listenId = _globalEventListener["default"].register(function () {}, this.hideSubMenu);
    }
  }, {
    key: "getSubMenuType",
    value: function getSubMenuType() {
      // eslint-disable-line class-methods-use-this
      return SubMenu;
    }
  }, {
    key: "shouldComponentUpdate",
    value: function shouldComponentUpdate(nextProps, nextState) {
      this.isVisibilityChange = (this.state.visible !== nextState.visible || this.props.forceOpen !== nextProps.forceOpen) && !(this.state.visible && nextProps.forceOpen) && !(this.props.forceOpen && nextState.visible);
      return true;
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate() {
      var _this2 = this;

      if (!this.isVisibilityChange) return;

      if (this.props.forceOpen || this.state.visible) {
        var wrapper = window.requestAnimationFrame || setTimeout;
        wrapper(function () {
          var styles = _this2.props.rtl ? _this2.getRTLMenuPosition() : _this2.getMenuPosition();

          _this2.subMenu.style.removeProperty('top');

          _this2.subMenu.style.removeProperty('bottom');

          _this2.subMenu.style.removeProperty('left');

          _this2.subMenu.style.removeProperty('right');

          if ((0, _helpers.hasOwnProp)(styles, 'top')) _this2.subMenu.style.top = styles.top;
          if ((0, _helpers.hasOwnProp)(styles, 'left')) _this2.subMenu.style.left = styles.left;
          if ((0, _helpers.hasOwnProp)(styles, 'bottom')) _this2.subMenu.style.bottom = styles.bottom;
          if ((0, _helpers.hasOwnProp)(styles, 'right')) _this2.subMenu.style.right = styles.right;

          _this2.subMenu.classList.add(_helpers.cssClasses.menuVisible);

          _this2.registerHandlers();

          _this2.setState({
            selectedItem: null
          });
        });
      } else {
        var cleanup = function cleanup() {
          _this2.subMenu.removeEventListener('transitionend', cleanup);

          _this2.subMenu.style.removeProperty('bottom');

          _this2.subMenu.style.removeProperty('right');

          _this2.subMenu.style.top = 0;
          _this2.subMenu.style.left = '100%';

          _this2.unregisterHandlers();
        };

        this.subMenu.addEventListener('transitionend', cleanup);
        this.subMenu.classList.remove(_helpers.cssClasses.menuVisible);
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      if (this.listenId) {
        _globalEventListener["default"].unregister(this.listenId);
      }

      if (this.opentimer) clearTimeout(this.opentimer);
      if (this.closetimer) clearTimeout(this.closetimer);
      this.unregisterHandlers(true);
    }
  }, {
    key: "render",
    value: function render() {
      var _cx;

      var _this$props = this.props,
          children = _this$props.children,
          attributes = _this$props.attributes,
          disabled = _this$props.disabled,
          title = _this$props.title,
          selected = _this$props.selected;
      var visible = this.state.visible;
      var menuProps = {
        ref: this.menuRef,
        onMouseEnter: this.handleMouseEnter,
        onMouseLeave: this.handleMouseLeave,
        className: (0, _classnames["default"])(_helpers.cssClasses.menuItem, _helpers.cssClasses.subMenu, attributes.listClassName),
        style: {
          position: 'relative'
        }
      };
      var menuItemProps = {
        className: (0, _classnames["default"])(_helpers.cssClasses.menuItem, attributes.className, (_cx = {}, _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemDisabled, attributes.disabledClassName), disabled), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemActive, attributes.visibleClassName), visible), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemSelected, attributes.selectedClassName), selected), _cx)),
        onMouseMove: this.props.onMouseMove,
        onMouseOut: this.props.onMouseOut,
        onClick: this.handleClick
      };
      var subMenuProps = {
        ref: this.subMenuRef,
        style: {
          position: 'absolute',
          transition: 'opacity 1ms',
          // trigger transitionend event
          top: 0,
          left: '100%'
        },
        className: (0, _classnames["default"])(_helpers.cssClasses.menu, this.props.className)
      };
      return /*#__PURE__*/_react["default"].createElement("nav", _extends({}, menuProps, {
        role: "menuitem",
        tabIndex: "-1",
        "aria-haspopup": "true"
      }), /*#__PURE__*/_react["default"].createElement("div", _extends({}, attributes, menuItemProps), title), /*#__PURE__*/_react["default"].createElement("nav", _extends({}, subMenuProps, {
        role: "menu",
        tabIndex: "-1"
      }), this.renderChildren(children)));
    }
  }]);

  return SubMenu;
}(_AbstractMenu2["default"]);

exports["default"] = SubMenu;

_defineProperty(SubMenu, "propTypes", {
  children: _propTypes["default"].node.isRequired,
  attributes: _propTypes["default"].object,
  title: _propTypes["default"].node.isRequired,
  className: _propTypes["default"].string,
  disabled: _propTypes["default"].bool,
  hoverDelay: _propTypes["default"].number,
  rtl: _propTypes["default"].bool,
  selected: _propTypes["default"].bool,
  onMouseMove: _propTypes["default"].func,
  onMouseOut: _propTypes["default"].func,
  forceOpen: _propTypes["default"].bool,
  forceClose: _propTypes["default"].func,
  parentKeyNavigationHandler: _propTypes["default"].func
});

_defineProperty(SubMenu, "defaultProps", {
  disabled: false,
  hoverDelay: 500,
  attributes: {},
  className: '',
  rtl: false,
  selected: false,
  onMouseMove: function onMouseMove() {
    return null;
  },
  onMouseOut: function onMouseOut() {
    return null;
  },
  forceOpen: false,
  forceClose: function forceClose() {
    return null;
  },
  parentKeyNavigationHandler: function parentKeyNavigationHandler() {
    return null;
  }
});

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/actions.js":
/*!*****************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/actions.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_315156__) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.MENU_SHOW = exports.MENU_HIDE = void 0;
exports.dispatchGlobalEvent = dispatchGlobalEvent;
exports.hideMenu = hideMenu;
exports.showMenu = showMenu;

var _objectAssign = _interopRequireDefault(__nested_webpack_require_315156__(/*! object-assign */ "../../../../node_modules/object-assign/index.js"));

var _helpers = __nested_webpack_require_315156__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var MENU_SHOW = 'REACT_CONTEXTMENU_SHOW';
exports.MENU_SHOW = MENU_SHOW;
var MENU_HIDE = 'REACT_CONTEXTMENU_HIDE';
exports.MENU_HIDE = MENU_HIDE;

function dispatchGlobalEvent(eventName, opts) {
  var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window;
  // Compatibale with IE
  // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
  var event;

  if (typeof window.CustomEvent === 'function') {
    event = new window.CustomEvent(eventName, {
      detail: opts
    });
  } else {
    event = document.createEvent('CustomEvent');
    event.initCustomEvent(eventName, false, true, opts);
  }

  if (target) {
    target.dispatchEvent(event);
    (0, _objectAssign["default"])(_helpers.store, opts);
  }
}

function showMenu() {
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var target = arguments.length > 1 ? arguments[1] : undefined;
  dispatchGlobalEvent(MENU_SHOW, (0, _objectAssign["default"])({}, opts, {
    type: MENU_SHOW
  }), target);
}

function hideMenu() {
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var target = arguments.length > 1 ? arguments[1] : undefined;
  dispatchGlobalEvent(MENU_HIDE, (0, _objectAssign["default"])({}, opts, {
    type: MENU_HIDE
  }), target);
}

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/connectMenu.js":
/*!*********************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/connectMenu.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_317487__) => {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = _default;

var _react = _interopRequireWildcard(__nested_webpack_require_317487__(/*! react */ "../../../../node_modules/react/index.js"));

var _ContextMenuTrigger = _interopRequireDefault(__nested_webpack_require_317487__(/*! ./ContextMenuTrigger */ "../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js"));

var _globalEventListener = _interopRequireDefault(__nested_webpack_require_317487__(/*! ./globalEventListener */ "../../../../node_modules/react-contextmenu/es6/globalEventListener.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

// collect ContextMenuTrigger's expected props to NOT pass them on as part of the context
var ignoredTriggerProps = [].concat(_toConsumableArray(Object.keys(_ContextMenuTrigger["default"].propTypes)), ['children']); // expect the id of the menu to be responsible for as outer parameter

function _default(menuId) {
  // expect menu component to connect as inner parameter
  // <Child/> is presumably a wrapper of <ContextMenu/>
  return function connect(Child) {
    // return wrapper for <Child/> that forwards the ContextMenuTrigger's additional props
    return /*#__PURE__*/function (_Component) {
      _inherits(ConnectMenu, _Component);

      var _super = _createSuper(ConnectMenu);

      function ConnectMenu(props) {
        var _this;

        _classCallCheck(this, ConnectMenu);

        _this = _super.call(this, props);

        _defineProperty(_assertThisInitialized(_this), "handleShow", function (e) {
          if (e.detail.id !== menuId) return; // the onShow event's detail.data object holds all ContextMenuTrigger props

          var data = e.detail.data;
          var filteredData = {};

          for (var key in data) {
            // exclude props the ContextMenuTrigger is expecting itself
            if (!ignoredTriggerProps.includes(key)) {
              filteredData[key] = data[key];
            }
          }

          _this.setState({
            trigger: filteredData
          });
        });

        _defineProperty(_assertThisInitialized(_this), "handleHide", function () {
          _this.setState({
            trigger: null
          });
        });

        _this.state = {
          trigger: null
        };
        return _this;
      }

      _createClass(ConnectMenu, [{
        key: "componentDidMount",
        value: function componentDidMount() {
          this.listenId = _globalEventListener["default"].register(this.handleShow, this.handleHide);
        }
      }, {
        key: "componentWillUnmount",
        value: function componentWillUnmount() {
          if (this.listenId) {
            _globalEventListener["default"].unregister(this.listenId);
          }
        }
      }, {
        key: "render",
        value: function render() {
          return /*#__PURE__*/_react["default"].createElement(Child, _extends({}, this.props, {
            id: menuId,
            trigger: this.state.trigger
          }));
        }
      }]);

      return ConnectMenu;
    }(_react.Component);
  };
}

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/globalEventListener.js":
/*!*****************************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/globalEventListener.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_327061__) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _actions = __nested_webpack_require_327061__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

var _helpers = __nested_webpack_require_327061__(/*! ./helpers */ "../../../../node_modules/react-contextmenu/es6/helpers.js");

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var GlobalEventListener = /*#__PURE__*/_createClass(function GlobalEventListener() {
  var _this = this;

  _classCallCheck(this, GlobalEventListener);

  _defineProperty(this, "handleShowEvent", function (event) {
    for (var id in _this.callbacks) {
      if ((0, _helpers.hasOwnProp)(_this.callbacks, id)) _this.callbacks[id].show(event);
    }
  });

  _defineProperty(this, "handleHideEvent", function (event) {
    for (var id in _this.callbacks) {
      if ((0, _helpers.hasOwnProp)(_this.callbacks, id)) _this.callbacks[id].hide(event);
    }
  });

  _defineProperty(this, "register", function (showCallback, hideCallback) {
    var id = (0, _helpers.uniqueId)();
    _this.callbacks[id] = {
      show: showCallback,
      hide: hideCallback
    };
    return id;
  });

  _defineProperty(this, "unregister", function (id) {
    if (id && _this.callbacks[id]) {
      delete _this.callbacks[id];
    }
  });

  this.callbacks = {};

  if (_helpers.canUseDOM) {
    window.addEventListener(_actions.MENU_SHOW, this.handleShowEvent);
    window.addEventListener(_actions.MENU_HIDE, this.handleHideEvent);
  }
});

var _default = new GlobalEventListener();

exports["default"] = _default;

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/helpers.js":
/*!*****************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/helpers.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.callIfExists = callIfExists;
exports.cssClasses = exports.canUseDOM = void 0;
exports.hasOwnProp = hasOwnProp;
exports.store = void 0;
exports.uniqueId = uniqueId;

function callIfExists(func) {
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    args[_key - 1] = arguments[_key];
  }

  return typeof func === 'function' && func.apply(void 0, args);
}

function hasOwnProp(obj, prop) {
  return Object.prototype.hasOwnProperty.call(obj, prop);
}

function uniqueId() {
  return Math.random().toString(36).substring(7);
}

var cssClasses = {
  menu: 'react-contextmenu',
  menuVisible: 'react-contextmenu--visible',
  menuWrapper: 'react-contextmenu-wrapper',
  menuItem: 'react-contextmenu-item',
  menuItemActive: 'react-contextmenu-item--active',
  menuItemDisabled: 'react-contextmenu-item--disabled',
  menuItemDivider: 'react-contextmenu-item--divider',
  menuItemSelected: 'react-contextmenu-item--selected',
  subMenu: 'react-contextmenu-submenu'
};
exports.cssClasses = cssClasses;
var store = {};
exports.store = store;
var canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
exports.canUseDOM = canUseDOM;

/***/ }),

/***/ "../../../../node_modules/react-contextmenu/es6/index.js":
/*!***************************************************************!*\
  !*** ../../../../node_modules/react-contextmenu/es6/index.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_331588__) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
Object.defineProperty(exports, "ContextMenu", ({
  enumerable: true,
  get: function get() {
    return _ContextMenu["default"];
  }
}));
Object.defineProperty(exports, "ContextMenuTrigger", ({
  enumerable: true,
  get: function get() {
    return _ContextMenuTrigger["default"];
  }
}));
Object.defineProperty(exports, "MenuItem", ({
  enumerable: true,
  get: function get() {
    return _MenuItem["default"];
  }
}));
Object.defineProperty(exports, "SubMenu", ({
  enumerable: true,
  get: function get() {
    return _SubMenu["default"];
  }
}));
Object.defineProperty(exports, "connectMenu", ({
  enumerable: true,
  get: function get() {
    return _connectMenu["default"];
  }
}));
Object.defineProperty(exports, "hideMenu", ({
  enumerable: true,
  get: function get() {
    return _actions.hideMenu;
  }
}));
Object.defineProperty(exports, "showMenu", ({
  enumerable: true,
  get: function get() {
    return _actions.showMenu;
  }
}));

var _ContextMenu = _interopRequireDefault(__nested_webpack_require_331588__(/*! ./ContextMenu */ "../../../../node_modules/react-contextmenu/es6/ContextMenu.js"));

var _ContextMenuTrigger = _interopRequireDefault(__nested_webpack_require_331588__(/*! ./ContextMenuTrigger */ "../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js"));

var _MenuItem = _interopRequireDefault(__nested_webpack_require_331588__(/*! ./MenuItem */ "../../../../node_modules/react-contextmenu/es6/MenuItem.js"));

var _SubMenu = _interopRequireDefault(__nested_webpack_require_331588__(/*! ./SubMenu */ "../../../../node_modules/react-contextmenu/es6/SubMenu.js"));

var _connectMenu = _interopRequireDefault(__nested_webpack_require_331588__(/*! ./connectMenu */ "../../../../node_modules/react-contextmenu/es6/connectMenu.js"));

var _actions = __nested_webpack_require_331588__(/*! ./actions */ "../../../../node_modules/react-contextmenu/es6/actions.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

/***/ }),

/***/ "../../../../node_modules/react-dom/cjs/react-dom.development.js":
/*!***********************************************************************!*\
  !*** ../../../../node_modules/react-dom/cjs/react-dom.development.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_333972__) => {

"use strict";
/** @license React v17.0.2
 * react-dom.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var React = __nested_webpack_require_333972__(/*! react */ "../../../../node_modules/react/index.js");
var _assign = __nested_webpack_require_333972__(/*! object-assign */ "../../../../node_modules/object-assign/index.js");
var Scheduler = __nested_webpack_require_333972__(/*! scheduler */ "../../../../node_modules/scheduler/index.js");
var tracing = __nested_webpack_require_333972__(/*! scheduler/tracing */ "../../../../node_modules/scheduler/tracing.js");

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

// by calls to these methods by a Babel plugin.
//
// In PROD (or in packages without access to React internals),
// they are left as they are instead.

function warn(format) {
  {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    printWarning('warn', format, args);
  }
}
function error(format) {
  {
    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      args[_key2 - 1] = arguments[_key2];
    }

    printWarning('error', format, args);
  }
}

function printWarning(level, format, args) {
  // When changing this logic, you might want to also
  // update consoleWithStackDev.www.js as well.
  {
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();

    if (stack !== '') {
      format += '%s';
      args = args.concat([stack]);
    }

    var argsWithFormat = args.map(function (item) {
      return '' + item;
    }); // Careful: RN currently depends on this prefix

    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
    // breaks IE9: https://github.com/facebook/react/issues/13610
    // eslint-disable-next-line react-internal/no-production-logging

    Function.prototype.apply.call(console[level], console, argsWithFormat);
  }
}

if (!React) {
  {
    throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." );
  }
}

var FunctionComponent = 0;
var ClassComponent = 1;
var IndeterminateComponent = 2; // Before we know whether it is function or class

var HostRoot = 3; // Root of a host tree. Could be nested inside another node.

var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.

var HostComponent = 5;
var HostText = 6;
var Fragment = 7;
var Mode = 8;
var ContextConsumer = 9;
var ContextProvider = 10;
var ForwardRef = 11;
var Profiler = 12;
var SuspenseComponent = 13;
var MemoComponent = 14;
var SimpleMemoComponent = 15;
var LazyComponent = 16;
var IncompleteClassComponent = 17;
var DehydratedFragment = 18;
var SuspenseListComponent = 19;
var FundamentalComponent = 20;
var ScopeComponent = 21;
var Block = 22;
var OffscreenComponent = 23;
var LegacyHiddenComponent = 24;

// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.

var enableProfilerTimer = true; // Record durations for commit and passive effects phases.

var enableFundamentalAPI = false; // Experimental Scope support.
var enableNewReconciler = false; // Errors that are thrown while unmounting (or after in the case of passive effects)
var warnAboutStringRefs = false;

var allNativeEvents = new Set();
/**
 * Mapping from registration name to event name
 */


var registrationNameDependencies = {};
/**
 * Mapping from lowercase registration names to the properly cased version,
 * used to warn in the case of missing event handlers. Available
 * only in true.
 * @type {Object}
 */

var possibleRegistrationNames =  {} ; // Trust the developer to only use possibleRegistrationNames in true

function registerTwoPhaseEvent(registrationName, dependencies) {
  registerDirectEvent(registrationName, dependencies);
  registerDirectEvent(registrationName + 'Capture', dependencies);
}
function registerDirectEvent(registrationName, dependencies) {
  {
    if (registrationNameDependencies[registrationName]) {
      error('EventRegistry: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName);
    }
  }

  registrationNameDependencies[registrationName] = dependencies;

  {
    var lowerCasedName = registrationName.toLowerCase();
    possibleRegistrationNames[lowerCasedName] = registrationName;

    if (registrationName === 'onDoubleClick') {
      possibleRegistrationNames.ondblclick = registrationName;
    }
  }

  for (var i = 0; i < dependencies.length; i++) {
    allNativeEvents.add(dependencies[i]);
  }
}

var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');

// A reserved attribute.
// It is handled by React separately and shouldn't be written to the DOM.
var RESERVED = 0; // A simple string attribute.
// Attributes that aren't in the filter are presumed to have this type.

var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
// "enumerated" attributes with "true" and "false" as possible values.
// When true, it should be set to a "true" string.
// When false, it should be set to a "false" string.

var BOOLEANISH_STRING = 2; // A real boolean attribute.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.

var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
// For any other value, should be present with that value.

var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
// When falsy, it should be removed.

var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
// When falsy, it should be removed.

var POSITIVE_NUMERIC = 6;

/* eslint-disable max-len */
var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
/* eslint-enable max-len */

var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
var hasOwnProperty = Object.prototype.hasOwnProperty;
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};
function isAttributeNameSafe(attributeName) {
  if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
    return true;
  }

  if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
    return false;
  }

  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
    validatedAttributeNameCache[attributeName] = true;
    return true;
  }

  illegalAttributeNameCache[attributeName] = true;

  {
    error('Invalid attribute name: `%s`', attributeName);
  }

  return false;
}
function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null) {
    return propertyInfo.type === RESERVED;
  }

  if (isCustomComponentTag) {
    return false;
  }

  if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
    return true;
  }

  return false;
}
function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null && propertyInfo.type === RESERVED) {
    return false;
  }

  switch (typeof value) {
    case 'function': // $FlowIssue symbol is perfectly valid here

    case 'symbol':
      // eslint-disable-line
      return true;

    case 'boolean':
      {
        if (isCustomComponentTag) {
          return false;
        }

        if (propertyInfo !== null) {
          return !propertyInfo.acceptsBooleans;
        } else {
          var prefix = name.toLowerCase().slice(0, 5);
          return prefix !== 'data-' && prefix !== 'aria-';
        }
      }

    default:
      return false;
  }
}
function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
  if (value === null || typeof value === 'undefined') {
    return true;
  }

  if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
    return true;
  }

  if (isCustomComponentTag) {
    return false;
  }

  if (propertyInfo !== null) {

    switch (propertyInfo.type) {
      case BOOLEAN:
        return !value;

      case OVERLOADED_BOOLEAN:
        return value === false;

      case NUMERIC:
        return isNaN(value);

      case POSITIVE_NUMERIC:
        return isNaN(value) || value < 1;
    }
  }

  return false;
}
function getPropertyInfo(name) {
  return properties.hasOwnProperty(name) ? properties[name] : null;
}

function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
  this.attributeName = attributeName;
  this.attributeNamespace = attributeNamespace;
  this.mustUseProperty = mustUseProperty;
  this.propertyName = name;
  this.type = type;
  this.sanitizeURL = sanitizeURL;
  this.removeEmptyString = removeEmptyString;
} // When adding attributes to this list, be sure to also add them to
// the `possibleStandardNames` module to ensure casing and incorrect
// name warnings.


var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.

var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
// elements (not just inputs). Now that ReactDOMInput assigns to the
// defaultValue property -- do we need this?
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
reservedProps.forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // A few React string attributes have a different name.
// This is a mapping from React prop names to the attribute names.

[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
  var name = _ref[0],
      attributeName = _ref[1];
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are "enumerated" HTML attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).

['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are "enumerated" SVG attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
// Since these are SVG attributes, their attribute names are case-sensitive.

['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are HTML boolean attributes.

['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
// on the client side because the browsers are inconsistent. Instead we call focus().
'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
'itemScope'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are the few React props that we set as DOM properties
// rather than attributes. These are all booleans.

['checked', // Note: `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`. We have special logic for handling this.
'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are HTML attributes that are "overloaded booleans": they behave like
// booleans, but can also accept a string value.

['capture', 'download' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are HTML attributes that must be positive numbers.

['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
  name, // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These are HTML attributes that must be numbers.

['rowSpan', 'start'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
});
var CAMELIZE = /[\-\:]([a-z])/g;

var capitalize = function (token) {
  return token[1].toUpperCase();
}; // This is a list of all SVG attributes that need special casing, namespacing,
// or boolean value assignment. Regular attributes that just accept strings
// and have the same names are omitted, just like in the HTML attribute filter.
// Some of these attributes can be hard to find. This list was created by
// scraping the MDN documentation.


['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // String SVG attributes with the xlink namespace.

['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL
  false);
}); // String SVG attributes with the xml namespace.

['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL
  false);
}); // These attribute exists both in HTML and SVG.
// The attribute name is case-sensitive in SVG so we can't just use
// the React name like we do for attributes that exist only in HTML.

['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  attributeName.toLowerCase(), // attributeName
  null, // attributeNamespace
  false, // sanitizeURL
  false);
}); // These attributes accept URLs. These must not allow javascript: URLS.
// These will also need to accept Trusted Types object in the future.

var xlinkHref = 'xlinkHref';
properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL
false);
['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  attributeName.toLowerCase(), // attributeName
  null, // attributeNamespace
  true, // sanitizeURL
  true);
});

// and any newline or tab are filtered out as if they're not part of the URL.
// https://url.spec.whatwg.org/#url-parsing
// Tab or newline are defined as \r\n\t:
// https://infra.spec.whatwg.org/#ascii-tab-or-newline
// A C0 control is a code point in the range \u0000 NULL to \u001F
// INFORMATION SEPARATOR ONE, inclusive:
// https://infra.spec.whatwg.org/#c0-control-or-space

/* eslint-disable max-len */

var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
var didWarn = false;

function sanitizeURL(url) {
  {
    if (!didWarn && isJavaScriptProtocol.test(url)) {
      didWarn = true;

      error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
    }
  }
}

/**
 * Get the value for a property on a node. Only used in DEV for SSR validation.
 * The "expected" argument is used as a hint of what the expected value is.
 * Some properties have multiple equivalent values.
 */
function getValueForProperty(node, name, expected, propertyInfo) {
  {
    if (propertyInfo.mustUseProperty) {
      var propertyName = propertyInfo.propertyName;
      return node[propertyName];
    } else {
      if ( propertyInfo.sanitizeURL) {
        // If we haven't fully disabled javascript: URLs, and if
        // the hydration is successful of a javascript: URL, we
        // still want to warn on the client.
        sanitizeURL('' + expected);
      }

      var attributeName = propertyInfo.attributeName;
      var stringValue = null;

      if (propertyInfo.type === OVERLOADED_BOOLEAN) {
        if (node.hasAttribute(attributeName)) {
          var value = node.getAttribute(attributeName);

          if (value === '') {
            return true;
          }

          if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
            return value;
          }

          if (value === '' + expected) {
            return expected;
          }

          return value;
        }
      } else if (node.hasAttribute(attributeName)) {
        if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
          // We had an attribute but shouldn't have had one, so read it
          // for the error message.
          return node.getAttribute(attributeName);
        }

        if (propertyInfo.type === BOOLEAN) {
          // If this was a boolean, it doesn't matter what the value is
          // the fact that we have it is the same as the expected.
          return expected;
        } // Even if this property uses a namespace we use getAttribute
        // because we assume its namespaced name is the same as our config.
        // To use getAttributeNS we need the local name which we don't have
        // in our config atm.


        stringValue = node.getAttribute(attributeName);
      }

      if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
        return stringValue === null ? expected : stringValue;
      } else if (stringValue === '' + expected) {
        return expected;
      } else {
        return stringValue;
      }
    }
  }
}
/**
 * Get the value for a attribute on a node. Only used in DEV for SSR validation.
 * The third argument is used as a hint of what the expected value is. Some
 * attributes have multiple equivalent values.
 */

function getValueForAttribute(node, name, expected) {
  {
    if (!isAttributeNameSafe(name)) {
      return;
    } // If the object is an opaque reference ID, it's expected that
    // the next prop is different than the server value, so just return
    // expected


    if (isOpaqueHydratingObject(expected)) {
      return expected;
    }

    if (!node.hasAttribute(name)) {
      return expected === undefined ? undefined : null;
    }

    var value = node.getAttribute(name);

    if (value === '' + expected) {
      return expected;
    }

    return value;
  }
}
/**
 * Sets the value for a property on a node.
 *
 * @param {DOMElement} node
 * @param {string} name
 * @param {*} value
 */

function setValueForProperty(node, name, value, isCustomComponentTag) {
  var propertyInfo = getPropertyInfo(name);

  if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
    return;
  }

  if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
    value = null;
  } // If the prop isn't in the special list, treat it as a simple attribute.


  if (isCustomComponentTag || propertyInfo === null) {
    if (isAttributeNameSafe(name)) {
      var _attributeName = name;

      if (value === null) {
        node.removeAttribute(_attributeName);
      } else {
        node.setAttribute(_attributeName,  '' + value);
      }
    }

    return;
  }

  var mustUseProperty = propertyInfo.mustUseProperty;

  if (mustUseProperty) {
    var propertyName = propertyInfo.propertyName;

    if (value === null) {
      var type = propertyInfo.type;
      node[propertyName] = type === BOOLEAN ? false : '';
    } else {
      // Contrary to `setAttribute`, object properties are properly
      // `toString`ed by IE8/9.
      node[propertyName] = value;
    }

    return;
  } // The rest are treated as attributes with special cases.


  var attributeName = propertyInfo.attributeName,
      attributeNamespace = propertyInfo.attributeNamespace;

  if (value === null) {
    node.removeAttribute(attributeName);
  } else {
    var _type = propertyInfo.type;
    var attributeValue;

    if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
      // If attribute type is boolean, we know for sure it won't be an execution sink
      // and we won't require Trusted Type here.
      attributeValue = '';
    } else {
      // `setAttribute` with objects becomes only `[object]` in IE8/9,
      // ('' + value) makes it output the correct toString()-value.
      {
        attributeValue = '' + value;
      }

      if (propertyInfo.sanitizeURL) {
        sanitizeURL(attributeValue.toString());
      }
    }

    if (attributeNamespace) {
      node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
    } else {
      node.setAttribute(attributeName, attributeValue);
    }
  }
}

// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
var REACT_FRAGMENT_TYPE = 0xeacb;
var REACT_STRICT_MODE_TYPE = 0xeacc;
var REACT_PROFILER_TYPE = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
var REACT_SUSPENSE_TYPE = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_BLOCK_TYPE = 0xead9;
var REACT_SERVER_BLOCK_TYPE = 0xeada;
var REACT_FUNDAMENTAL_TYPE = 0xead5;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;

if (typeof Symbol === 'function' && Symbol.for) {
  var symbolFor = Symbol.for;
  REACT_ELEMENT_TYPE = symbolFor('react.element');
  REACT_PORTAL_TYPE = symbolFor('react.portal');
  REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
  REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
  REACT_PROFILER_TYPE = symbolFor('react.profiler');
  REACT_PROVIDER_TYPE = symbolFor('react.provider');
  REACT_CONTEXT_TYPE = symbolFor('react.context');
  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
  REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
  REACT_MEMO_TYPE = symbolFor('react.memo');
  REACT_LAZY_TYPE = symbolFor('react.lazy');
  REACT_BLOCK_TYPE = symbolFor('react.block');
  REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
  REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
  REACT_SCOPE_TYPE = symbolFor('react.scope');
  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
}

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }

  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];

  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }

  return null;
}

// Helpers to patch console.logs to avoid logging during side-effect free
// replaying on render function. This currently only patches the object
// lazily which won't cover if the log function was extracted eagerly.
// We could also eagerly patch the method.
var disabledDepth = 0;
var prevLog;
var prevInfo;
var prevWarn;
var prevError;
var prevGroup;
var prevGroupCollapsed;
var prevGroupEnd;

function disabledLog() {}

disabledLog.__reactDisabledLog = true;
function disableLogs() {
  {
    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      prevLog = console.log;
      prevInfo = console.info;
      prevWarn = console.warn;
      prevError = console.error;
      prevGroup = console.group;
      prevGroupCollapsed = console.groupCollapsed;
      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099

      var props = {
        configurable: true,
        enumerable: true,
        value: disabledLog,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        info: props,
        log: props,
        warn: props,
        error: props,
        group: props,
        groupCollapsed: props,
        groupEnd: props
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    disabledDepth++;
  }
}
function reenableLogs() {
  {
    disabledDepth--;

    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      var props = {
        configurable: true,
        enumerable: true,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        log: _assign({}, props, {
          value: prevLog
        }),
        info: _assign({}, props, {
          value: prevInfo
        }),
        warn: _assign({}, props, {
          value: prevWarn
        }),
        error: _assign({}, props, {
          value: prevError
        }),
        group: _assign({}, props, {
          value: prevGroup
        }),
        groupCollapsed: _assign({}, props, {
          value: prevGroupCollapsed
        }),
        groupEnd: _assign({}, props, {
          value: prevGroupEnd
        })
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    if (disabledDepth < 0) {
      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
    }
  }
}

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name, source, ownerFn) {
  {
    if (prefix === undefined) {
      // Extract the VM specific prefix used by each line.
      try {
        throw Error();
      } catch (x) {
        var match = x.stack.trim().match(/\n( *(at )?)/);
        prefix = match && match[1] || '';
      }
    } // We use the prefix to ensure our stacks line up with native stack frames.


    return '\n' + prefix + name;
  }
}
var reentry = false;
var componentFrameCache;

{
  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
  componentFrameCache = new PossiblyWeakMap();
}

function describeNativeComponentFrame(fn, construct) {
  // If something asked for a stack inside a fake render, it should get ignored.
  if (!fn || reentry) {
    return '';
  }

  {
    var frame = componentFrameCache.get(fn);

    if (frame !== undefined) {
      return frame;
    }
  }

  var control;
  reentry = true;
  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.

  Error.prepareStackTrace = undefined;
  var previousDispatcher;

  {
    previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
    // for warnings.

    ReactCurrentDispatcher.current = null;
    disableLogs();
  }

  try {
    // This should throw.
    if (construct) {
      // Something should be setting the props in the constructor.
      var Fake = function () {
        throw Error();
      }; // $FlowFixMe


      Object.defineProperty(Fake.prototype, 'props', {
        set: function () {
          // We use a throwing setter instead of frozen or non-writable props
          // because that won't throw in a non-strict mode function.
          throw Error();
        }
      });

      if (typeof Reflect === 'object' && Reflect.construct) {
        // We construct a different control for this case to include any extra
        // frames added by the construct call.
        try {
          Reflect.construct(Fake, []);
        } catch (x) {
          control = x;
        }

        Reflect.construct(fn, [], Fake);
      } else {
        try {
          Fake.call();
        } catch (x) {
          control = x;
        }

        fn.call(Fake.prototype);
      }
    } else {
      try {
        throw Error();
      } catch (x) {
        control = x;
      }

      fn();
    }
  } catch (sample) {
    // This is inlined manually because closure doesn't do it for us.
    if (sample && control && typeof sample.stack === 'string') {
      // This extracts the first frame from the sample that isn't also in the control.
      // Skipping one frame that we assume is the frame that calls the two.
      var sampleLines = sample.stack.split('\n');
      var controlLines = control.stack.split('\n');
      var s = sampleLines.length - 1;
      var c = controlLines.length - 1;

      while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
        // We expect at least one stack frame to be shared.
        // Typically this will be the root most one. However, stack frames may be
        // cut off due to maximum stack limits. In this case, one maybe cut off
        // earlier than the other. We assume that the sample is longer or the same
        // and there for cut off earlier. So we should find the root most frame in
        // the sample somewhere in the control.
        c--;
      }

      for (; s >= 1 && c >= 0; s--, c--) {
        // Next we find the first one that isn't the same which should be the
        // frame that called our sample function and the control.
        if (sampleLines[s] !== controlLines[c]) {
          // In V8, the first line is describing the message but other VMs don't.
          // If we're about to return the first line, and the control is also on the same
          // line, that's a pretty good indicator that our sample threw at same line as
          // the control. I.e. before we entered the sample frame. So we ignore this result.
          // This can happen if you passed a class to function component, or non-function.
          if (s !== 1 || c !== 1) {
            do {
              s--;
              c--; // We may still have similar intermediate frames from the construct call.
              // The next one that isn't the same should be our match though.

              if (c < 0 || sampleLines[s] !== controlLines[c]) {
                // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
                var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');

                {
                  if (typeof fn === 'function') {
                    componentFrameCache.set(fn, _frame);
                  }
                } // Return the line we found.


                return _frame;
              }
            } while (s >= 1 && c >= 0);
          }

          break;
        }
      }
    }
  } finally {
    reentry = false;

    {
      ReactCurrentDispatcher.current = previousDispatcher;
      reenableLogs();
    }

    Error.prepareStackTrace = previousPrepareStackTrace;
  } // Fallback to just using the name if we couldn't make it throw.


  var name = fn ? fn.displayName || fn.name : '';
  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';

  {
    if (typeof fn === 'function') {
      componentFrameCache.set(fn, syntheticFrame);
    }
  }

  return syntheticFrame;
}

function describeClassComponentFrame(ctor, source, ownerFn) {
  {
    return describeNativeComponentFrame(ctor, true);
  }
}
function describeFunctionComponentFrame(fn, source, ownerFn) {
  {
    return describeNativeComponentFrame(fn, false);
  }
}

function shouldConstruct(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {

  if (type == null) {
    return '';
  }

  if (typeof type === 'function') {
    {
      return describeNativeComponentFrame(type, shouldConstruct(type));
    }
  }

  if (typeof type === 'string') {
    return describeBuiltInComponentFrame(type);
  }

  switch (type) {
    case REACT_SUSPENSE_TYPE:
      return describeBuiltInComponentFrame('Suspense');

    case REACT_SUSPENSE_LIST_TYPE:
      return describeBuiltInComponentFrame('SuspenseList');
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_FORWARD_REF_TYPE:
        return describeFunctionComponentFrame(type.render);

      case REACT_MEMO_TYPE:
        // Memo may contain any component type so we recursively resolve it.
        return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);

      case REACT_BLOCK_TYPE:
        return describeFunctionComponentFrame(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            // Lazy may contain any component type so we recursively resolve it.
            return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
          } catch (x) {}
        }
    }
  }

  return '';
}

function describeFiber(fiber) {
  var owner =  fiber._debugOwner ? fiber._debugOwner.type : null ;
  var source =  fiber._debugSource ;

  switch (fiber.tag) {
    case HostComponent:
      return describeBuiltInComponentFrame(fiber.type);

    case LazyComponent:
      return describeBuiltInComponentFrame('Lazy');

    case SuspenseComponent:
      return describeBuiltInComponentFrame('Suspense');

    case SuspenseListComponent:
      return describeBuiltInComponentFrame('SuspenseList');

    case FunctionComponent:
    case IndeterminateComponent:
    case SimpleMemoComponent:
      return describeFunctionComponentFrame(fiber.type);

    case ForwardRef:
      return describeFunctionComponentFrame(fiber.type.render);

    case Block:
      return describeFunctionComponentFrame(fiber.type._render);

    case ClassComponent:
      return describeClassComponentFrame(fiber.type);

    default:
      return '';
  }
}

function getStackByFiberInDevAndProd(workInProgress) {
  try {
    var info = '';
    var node = workInProgress;

    do {
      info += describeFiber(node);
      node = node.return;
    } while (node);

    return info;
  } catch (x) {
    return '\nError generating stack: ' + x.message + '\n' + x.stack;
  }
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
}

function getContextName(type) {
  return type.displayName || 'Context';
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }

  {
    if (typeof type.tag === 'number') {
      error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }

  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }

  if (typeof type === 'string') {
    return type;
  }

  switch (type) {
    case REACT_FRAGMENT_TYPE:
      return 'Fragment';

    case REACT_PORTAL_TYPE:
      return 'Portal';

    case REACT_PROFILER_TYPE:
      return 'Profiler';

    case REACT_STRICT_MODE_TYPE:
      return 'StrictMode';

    case REACT_SUSPENSE_TYPE:
      return 'Suspense';

    case REACT_SUSPENSE_LIST_TYPE:
      return 'SuspenseList';
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        var context = type;
        return getContextName(context) + '.Consumer';

      case REACT_PROVIDER_TYPE:
        var provider = type;
        return getContextName(provider._context) + '.Provider';

      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');

      case REACT_MEMO_TYPE:
        return getComponentName(type.type);

      case REACT_BLOCK_TYPE:
        return getComponentName(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            return getComponentName(init(payload));
          } catch (x) {
            return null;
          }
        }
    }
  }

  return null;
}

var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var current = null;
var isRendering = false;
function getCurrentFiberOwnerNameInDevOrNull() {
  {
    if (current === null) {
      return null;
    }

    var owner = current._debugOwner;

    if (owner !== null && typeof owner !== 'undefined') {
      return getComponentName(owner.type);
    }
  }

  return null;
}

function getCurrentFiberStackInDev() {
  {
    if (current === null) {
      return '';
    } // Safe because if current fiber exists, we are reconciling,
    // and it is guaranteed to be the work-in-progress version.


    return getStackByFiberInDevAndProd(current);
  }
}

function resetCurrentFiber() {
  {
    ReactDebugCurrentFrame.getCurrentStack = null;
    current = null;
    isRendering = false;
  }
}
function setCurrentFiber(fiber) {
  {
    ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
    current = fiber;
    isRendering = false;
  }
}
function setIsRendering(rendering) {
  {
    isRendering = rendering;
  }
}
function getIsRendering() {
  {
    return isRendering;
  }
}

// Flow does not allow string concatenation of most non-string types. To work
// around this limitation, we use an opaque type that can only be obtained by
// passing the value through getToStringValue first.
function toString(value) {
  return '' + value;
}
function getToStringValue(value) {
  switch (typeof value) {
    case 'boolean':
    case 'number':
    case 'object':
    case 'string':
    case 'undefined':
      return value;

    default:
      // function, symbol are assigned as empty strings
      return '';
  }
}

var hasReadOnlyValue = {
  button: true,
  checkbox: true,
  image: true,
  hidden: true,
  radio: true,
  reset: true,
  submit: true
};
function checkControlledValueProps(tagName, props) {
  {
    if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
      error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    }

    if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
      error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    }
  }
}

function isCheckable(elem) {
  var type = elem.type;
  var nodeName = elem.nodeName;
  return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
}

function getTracker(node) {
  return node._valueTracker;
}

function detachTracker(node) {
  node._valueTracker = null;
}

function getValueFromNode(node) {
  var value = '';

  if (!node) {
    return value;
  }

  if (isCheckable(node)) {
    value = node.checked ? 'true' : 'false';
  } else {
    value = node.value;
  }

  return value;
}

function trackValueOnNode(node) {
  var valueField = isCheckable(node) ? 'checked' : 'value';
  var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
  var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail
  // and don't track value will cause over reporting of changes,
  // but it's better then a hard failure
  // (needed for certain tests that spyOn input values and Safari)

  if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
    return;
  }

  var get = descriptor.get,
      set = descriptor.set;
  Object.defineProperty(node, valueField, {
    configurable: true,
    get: function () {
      return get.call(this);
    },
    set: function (value) {
      currentValue = '' + value;
      set.call(this, value);
    }
  }); // We could've passed this the first time
  // but it triggers a bug in IE11 and Edge 14/15.
  // Calling defineProperty() again should be equivalent.
  // https://github.com/facebook/react/issues/11768

  Object.defineProperty(node, valueField, {
    enumerable: descriptor.enumerable
  });
  var tracker = {
    getValue: function () {
      return currentValue;
    },
    setValue: function (value) {
      currentValue = '' + value;
    },
    stopTracking: function () {
      detachTracker(node);
      delete node[valueField];
    }
  };
  return tracker;
}

function track(node) {
  if (getTracker(node)) {
    return;
  } // TODO: Once it's just Fiber we can move this to node._wrapperState


  node._valueTracker = trackValueOnNode(node);
}
function updateValueIfChanged(node) {
  if (!node) {
    return false;
  }

  var tracker = getTracker(node); // if there is no tracker at this point it's unlikely
  // that trying again will succeed

  if (!tracker) {
    return true;
  }

  var lastValue = tracker.getValue();
  var nextValue = getValueFromNode(node);

  if (nextValue !== lastValue) {
    tracker.setValue(nextValue);
    return true;
  }

  return false;
}

function getActiveElement(doc) {
  doc = doc || (typeof document !== 'undefined' ? document : undefined);

  if (typeof doc === 'undefined') {
    return null;
  }

  try {
    return doc.activeElement || doc.body;
  } catch (e) {
    return doc.body;
  }
}

var didWarnValueDefaultValue = false;
var didWarnCheckedDefaultChecked = false;
var didWarnControlledToUncontrolled = false;
var didWarnUncontrolledToControlled = false;

function isControlled(props) {
  var usesChecked = props.type === 'checkbox' || props.type === 'radio';
  return usesChecked ? props.checked != null : props.value != null;
}
/**
 * Implements an <input> host component that allows setting these optional
 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
 *
 * If `checked` or `value` are not supplied (or null/undefined), user actions
 * that affect the checked state or value will trigger updates to the element.
 *
 * If they are supplied (and not null/undefined), the rendered element will not
 * trigger updates to the element. Instead, the props must change in order for
 * the rendered element to be updated.
 *
 * The rendered element will be initialized as unchecked (or `defaultChecked`)
 * with an empty value (or `defaultValue`).
 *
 * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
 */


function getHostProps(element, props) {
  var node = element;
  var checked = props.checked;

  var hostProps = _assign({}, props, {
    defaultChecked: undefined,
    defaultValue: undefined,
    value: undefined,
    checked: checked != null ? checked : node._wrapperState.initialChecked
  });

  return hostProps;
}
function initWrapperState(element, props) {
  {
    checkControlledValueProps('input', props);

    if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
      error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);

      didWarnCheckedDefaultChecked = true;
    }

    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
      error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);

      didWarnValueDefaultValue = true;
    }
  }

  var node = element;
  var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
  node._wrapperState = {
    initialChecked: props.checked != null ? props.checked : props.defaultChecked,
    initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
    controlled: isControlled(props)
  };
}
function updateChecked(element, props) {
  var node = element;
  var checked = props.checked;

  if (checked != null) {
    setValueForProperty(node, 'checked', checked, false);
  }
}
function updateWrapper(element, props) {
  var node = element;

  {
    var controlled = isControlled(props);

    if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
      error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by the value changing from undefined to ' + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');

      didWarnUncontrolledToControlled = true;
    }

    if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
      error('A component is changing a controlled input to be uncontrolled. ' + 'This is likely caused by the value changing from a defined to ' + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');

      didWarnControlledToUncontrolled = true;
    }
  }

  updateChecked(element, props);
  var value = getToStringValue(props.value);
  var type = props.type;

  if (value != null) {
    if (type === 'number') {
      if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.
      // eslint-disable-next-line
      node.value != value) {
        node.value = toString(value);
      }
    } else if (node.value !== toString(value)) {
      node.value = toString(value);
    }
  } else if (type === 'submit' || type === 'reset') {
    // Submit/reset inputs need the attribute removed completely to avoid
    // blank-text buttons.
    node.removeAttribute('value');
    return;
  }

  {
    // When syncing the value attribute, the value comes from a cascade of
    // properties:
    //  1. The value React property
    //  2. The defaultValue React property
    //  3. Otherwise there should be no change
    if (props.hasOwnProperty('value')) {
      setDefaultValue(node, props.type, value);
    } else if (props.hasOwnProperty('defaultValue')) {
      setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
    }
  }

  {
    // When syncing the checked attribute, it only changes when it needs
    // to be removed, such as transitioning from a checkbox into a text input
    if (props.checked == null && props.defaultChecked != null) {
      node.defaultChecked = !!props.defaultChecked;
    }
  }
}
function postMountWrapper(element, props, isHydrating) {
  var node = element; // Do not assign value if it is already set. This prevents user text input
  // from being lost during SSR hydration.

  if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
    var type = props.type;
    var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the
    // default value provided by the browser. See: #12872

    if (isButton && (props.value === undefined || props.value === null)) {
      return;
    }

    var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input
    // from being lost during SSR hydration.

    if (!isHydrating) {
      {
        // When syncing the value attribute, the value property should use
        // the wrapperState._initialValue property. This uses:
        //
        //   1. The value React property when present
        //   2. The defaultValue React property when present
        //   3. An empty string
        if (initialValue !== node.value) {
          node.value = initialValue;
        }
      }
    }

    {
      // Otherwise, the value attribute is synchronized to the property,
      // so we assign defaultValue to the same thing as the value property
      // assignment step above.
      node.defaultValue = initialValue;
    }
  } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
  // this is needed to work around a chrome bug where setting defaultChecked
  // will sometimes influence the value of checked (even after detachment).
  // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
  // We need to temporarily unset name to avoid disrupting radio button groups.


  var name = node.name;

  if (name !== '') {
    node.name = '';
  }

  {
    // When syncing the checked attribute, both the checked property and
    // attribute are assigned at the same time using defaultChecked. This uses:
    //
    //   1. The checked React property when present
    //   2. The defaultChecked React property when present
    //   3. Otherwise, false
    node.defaultChecked = !node.defaultChecked;
    node.defaultChecked = !!node._wrapperState.initialChecked;
  }

  if (name !== '') {
    node.name = name;
  }
}
function restoreControlledState(element, props) {
  var node = element;
  updateWrapper(node, props);
  updateNamedCousins(node, props);
}

function updateNamedCousins(rootNode, props) {
  var name = props.name;

  if (props.type === 'radio' && name != null) {
    var queryRoot = rootNode;

    while (queryRoot.parentNode) {
      queryRoot = queryRoot.parentNode;
    } // If `rootNode.form` was non-null, then we could try `form.elements`,
    // but that sometimes behaves strangely in IE8. We could also try using
    // `form.getElementsByName`, but that will only return direct children
    // and won't include inputs that use the HTML5 `form=` attribute. Since
    // the input might not even be in a form. It might not even be in the
    // document. Let's just use the local `querySelectorAll` to ensure we don't
    // miss anything.


    var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');

    for (var i = 0; i < group.length; i++) {
      var otherNode = group[i];

      if (otherNode === rootNode || otherNode.form !== rootNode.form) {
        continue;
      } // This will throw if radio buttons rendered by different copies of React
      // and the same name are rendered into the same form (same as #1939).
      // That's probably okay; we don't support it just as we don't support
      // mixing React radio buttons with non-React ones.


      var otherProps = getFiberCurrentPropsFromNode(otherNode);

      if (!otherProps) {
        {
          throw Error( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." );
        }
      } // We need update the tracked value on the named cousin since the value
      // was changed but the input saw no event or value set


      updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that
      // was previously checked to update will cause it to be come re-checked
      // as appropriate.

      updateWrapper(otherNode, otherProps);
    }
  }
} // In Chrome, assigning defaultValue to certain input types triggers input validation.
// For number inputs, the display value loses trailing decimal points. For email inputs,
// Chrome raises "The specified value <x> is not a valid email address".
//
// Here we check to see if the defaultValue has actually changed, avoiding these problems
// when the user is inputting text
//
// https://github.com/facebook/react/issues/7253


function setDefaultValue(node, type, value) {
  if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
  type !== 'number' || getActiveElement(node.ownerDocument) !== node) {
    if (value == null) {
      node.defaultValue = toString(node._wrapperState.initialValue);
    } else if (node.defaultValue !== toString(value)) {
      node.defaultValue = toString(value);
    }
  }
}

var didWarnSelectedSetOnOption = false;
var didWarnInvalidChild = false;

function flattenChildren(children) {
  var content = ''; // Flatten children. We'll warn if they are invalid
  // during validateProps() which runs for hydration too.
  // Note that this would throw on non-element objects.
  // Elements are stringified (which is normally irrelevant
  // but matters for <fbt>).

  React.Children.forEach(children, function (child) {
    if (child == null) {
      return;
    }

    content += child; // Note: we don't warn about invalid children here.
    // Instead, this is done separately below so that
    // it happens during the hydration code path too.
  });
  return content;
}
/**
 * Implements an <option> host component that warns when `selected` is set.
 */


function validateProps(element, props) {
  {
    // This mirrors the code path above, but runs for hydration too.
    // Warn about invalid children here so that client and hydration are consistent.
    // TODO: this seems like it could cause a DEV-only throw for hydration
    // if children contains a non-element object. We should try to avoid that.
    if (typeof props.children === 'object' && props.children !== null) {
      React.Children.forEach(props.children, function (child) {
        if (child == null) {
          return;
        }

        if (typeof child === 'string' || typeof child === 'number') {
          return;
        }

        if (typeof child.type !== 'string') {
          return;
        }

        if (!didWarnInvalidChild) {
          didWarnInvalidChild = true;

          error('Only strings and numbers are supported as <option> children.');
        }
      });
    } // TODO: Remove support for `selected` in <option>.


    if (props.selected != null && !didWarnSelectedSetOnOption) {
      error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');

      didWarnSelectedSetOnOption = true;
    }
  }
}
function postMountWrapper$1(element, props) {
  // value="" should make a value attribute (#6219)
  if (props.value != null) {
    element.setAttribute('value', toString(getToStringValue(props.value)));
  }
}
function getHostProps$1(element, props) {
  var hostProps = _assign({
    children: undefined
  }, props);

  var content = flattenChildren(props.children);

  if (content) {
    hostProps.children = content;
  }

  return hostProps;
}

var didWarnValueDefaultValue$1;

{
  didWarnValueDefaultValue$1 = false;
}

function getDeclarationErrorAddendum() {
  var ownerName = getCurrentFiberOwnerNameInDevOrNull();

  if (ownerName) {
    return '\n\nCheck the render method of `' + ownerName + '`.';
  }

  return '';
}

var valuePropNames = ['value', 'defaultValue'];
/**
 * Validation function for `value` and `defaultValue`.
 */

function checkSelectPropTypes(props) {
  {
    checkControlledValueProps('select', props);

    for (var i = 0; i < valuePropNames.length; i++) {
      var propName = valuePropNames[i];

      if (props[propName] == null) {
        continue;
      }

      var isArray = Array.isArray(props[propName]);

      if (props.multiple && !isArray) {
        error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
      } else if (!props.multiple && isArray) {
        error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
      }
    }
  }
}

function updateOptions(node, multiple, propValue, setDefaultSelected) {
  var options = node.options;

  if (multiple) {
    var selectedValues = propValue;
    var selectedValue = {};

    for (var i = 0; i < selectedValues.length; i++) {
      // Prefix to avoid chaos with special keys.
      selectedValue['$' + selectedValues[i]] = true;
    }

    for (var _i = 0; _i < options.length; _i++) {
      var selected = selectedValue.hasOwnProperty('$' + options[_i].value);

      if (options[_i].selected !== selected) {
        options[_i].selected = selected;
      }

      if (selected && setDefaultSelected) {
        options[_i].defaultSelected = true;
      }
    }
  } else {
    // Do not set `select.value` as exact behavior isn't consistent across all
    // browsers for all cases.
    var _selectedValue = toString(getToStringValue(propValue));

    var defaultSelected = null;

    for (var _i2 = 0; _i2 < options.length; _i2++) {
      if (options[_i2].value === _selectedValue) {
        options[_i2].selected = true;

        if (setDefaultSelected) {
          options[_i2].defaultSelected = true;
        }

        return;
      }

      if (defaultSelected === null && !options[_i2].disabled) {
        defaultSelected = options[_i2];
      }
    }

    if (defaultSelected !== null) {
      defaultSelected.selected = true;
    }
  }
}
/**
 * Implements a <select> host component that allows optionally setting the
 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
 * stringable. If `multiple` is true, the prop must be an array of stringables.
 *
 * If `value` is not supplied (or null/undefined), user actions that change the
 * selected option will trigger updates to the rendered options.
 *
 * If it is supplied (and not null/undefined), the rendered options will not
 * update in response to user actions. Instead, the `value` prop must change in
 * order for the rendered options to update.
 *
 * If `defaultValue` is provided, any options with the supplied values will be
 * selected.
 */


function getHostProps$2(element, props) {
  return _assign({}, props, {
    value: undefined
  });
}
function initWrapperState$1(element, props) {
  var node = element;

  {
    checkSelectPropTypes(props);
  }

  node._wrapperState = {
    wasMultiple: !!props.multiple
  };

  {
    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
      error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components');

      didWarnValueDefaultValue$1 = true;
    }
  }
}
function postMountWrapper$2(element, props) {
  var node = element;
  node.multiple = !!props.multiple;
  var value = props.value;

  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  } else if (props.defaultValue != null) {
    updateOptions(node, !!props.multiple, props.defaultValue, true);
  }
}
function postUpdateWrapper(element, props) {
  var node = element;
  var wasMultiple = node._wrapperState.wasMultiple;
  node._wrapperState.wasMultiple = !!props.multiple;
  var value = props.value;

  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  } else if (wasMultiple !== !!props.multiple) {
    // For simplicity, reapply `defaultValue` if `multiple` is toggled.
    if (props.defaultValue != null) {
      updateOptions(node, !!props.multiple, props.defaultValue, true);
    } else {
      // Revert the select back to its default unselected state.
      updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
    }
  }
}
function restoreControlledState$1(element, props) {
  var node = element;
  var value = props.value;

  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  }
}

var didWarnValDefaultVal = false;

/**
 * Implements a <textarea> host component that allows setting `value`, and
 * `defaultValue`. This differs from the traditional DOM API because value is
 * usually set as PCDATA children.
 *
 * If `value` is not supplied (or null/undefined), user actions that affect the
 * value will trigger updates to the element.
 *
 * If `value` is supplied (and not null/undefined), the rendered element will
 * not trigger updates to the element. Instead, the `value` prop must change in
 * order for the rendered element to be updated.
 *
 * The rendered element will be initialized with an empty value, the prop
 * `defaultValue` if specified, or the children content (deprecated).
 */
function getHostProps$3(element, props) {
  var node = element;

  if (!(props.dangerouslySetInnerHTML == null)) {
    {
      throw Error( "`dangerouslySetInnerHTML` does not make sense on <textarea>." );
    }
  } // Always set children to the same thing. In IE9, the selection range will
  // get reset if `textContent` is mutated.  We could add a check in setTextContent
  // to only set the value if/when the value differs from the node value (which would
  // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
  // solution. The value can be a boolean or object so that's why it's forced
  // to be a string.


  var hostProps = _assign({}, props, {
    value: undefined,
    defaultValue: undefined,
    children: toString(node._wrapperState.initialValue)
  });

  return hostProps;
}
function initWrapperState$2(element, props) {
  var node = element;

  {
    checkControlledValueProps('textarea', props);

    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
      error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');

      didWarnValDefaultVal = true;
    }
  }

  var initialValue = props.value; // Only bother fetching default value if we're going to use it

  if (initialValue == null) {
    var children = props.children,
        defaultValue = props.defaultValue;

    if (children != null) {
      {
        error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
      }

      {
        if (!(defaultValue == null)) {
          {
            throw Error( "If you supply `defaultValue` on a <textarea>, do not pass children." );
          }
        }

        if (Array.isArray(children)) {
          if (!(children.length <= 1)) {
            {
              throw Error( "<textarea> can only have at most one child." );
            }
          }

          children = children[0];
        }

        defaultValue = children;
      }
    }

    if (defaultValue == null) {
      defaultValue = '';
    }

    initialValue = defaultValue;
  }

  node._wrapperState = {
    initialValue: getToStringValue(initialValue)
  };
}
function updateWrapper$1(element, props) {
  var node = element;
  var value = getToStringValue(props.value);
  var defaultValue = getToStringValue(props.defaultValue);

  if (value != null) {
    // Cast `value` to a string to ensure the value is set correctly. While
    // browsers typically do this as necessary, jsdom doesn't.
    var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed

    if (newValue !== node.value) {
      node.value = newValue;
    }

    if (props.defaultValue == null && node.defaultValue !== newValue) {
      node.defaultValue = newValue;
    }
  }

  if (defaultValue != null) {
    node.defaultValue = toString(defaultValue);
  }
}
function postMountWrapper$3(element, props) {
  var node = element; // This is in postMount because we need access to the DOM node, which is not
  // available until after the component has mounted.

  var textContent = node.textContent; // Only set node.value if textContent is equal to the expected
  // initial value. In IE10/IE11 there is a bug where the placeholder attribute
  // will populate textContent as well.
  // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/

  if (textContent === node._wrapperState.initialValue) {
    if (textContent !== '' && textContent !== null) {
      node.value = textContent;
    }
  }
}
function restoreControlledState$2(element, props) {
  // DOM component is still mounted; update
  updateWrapper$1(element, props);
}

var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
var Namespaces = {
  html: HTML_NAMESPACE,
  mathml: MATH_NAMESPACE,
  svg: SVG_NAMESPACE
}; // Assumes there is no parent namespace.

function getIntrinsicNamespace(type) {
  switch (type) {
    case 'svg':
      return SVG_NAMESPACE;

    case 'math':
      return MATH_NAMESPACE;

    default:
      return HTML_NAMESPACE;
  }
}
function getChildNamespace(parentNamespace, type) {
  if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
    // No (or default) parent namespace: potential entry point.
    return getIntrinsicNamespace(type);
  }

  if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
    // We're leaving SVG.
    return HTML_NAMESPACE;
  } // By default, pass namespace below.


  return parentNamespace;
}

/* globals MSApp */

/**
 * Create a function which has 'unsafe' privileges (required by windows8 apps)
 */
var createMicrosoftUnsafeLocalFunction = function (func) {
  if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
    return function (arg0, arg1, arg2, arg3) {
      MSApp.execUnsafeLocalFunction(function () {
        return func(arg0, arg1, arg2, arg3);
      });
    };
  } else {
    return func;
  }
};

var reusableSVGContainer;
/**
 * Set the innerHTML property of a node
 *
 * @param {DOMElement} node
 * @param {string} html
 * @internal
 */

var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
  if (node.namespaceURI === Namespaces.svg) {

    if (!('innerHTML' in node)) {
      // IE does not have innerHTML for SVG nodes, so instead we inject the
      // new markup in a temp node and then move the child nodes across into
      // the target node
      reusableSVGContainer = reusableSVGContainer || document.createElement('div');
      reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';
      var svgNode = reusableSVGContainer.firstChild;

      while (node.firstChild) {
        node.removeChild(node.firstChild);
      }

      while (svgNode.firstChild) {
        node.appendChild(svgNode.firstChild);
      }

      return;
    }
  }

  node.innerHTML = html;
});

/**
 * HTML nodeType values that represent the type of the node
 */
var ELEMENT_NODE = 1;
var TEXT_NODE = 3;
var COMMENT_NODE = 8;
var DOCUMENT_NODE = 9;
var DOCUMENT_FRAGMENT_NODE = 11;

/**
 * Set the textContent property of a node. For text updates, it's faster
 * to set the `nodeValue` of the Text node directly instead of using
 * `.textContent` which will remove the existing node and create a new one.
 *
 * @param {DOMElement} node
 * @param {string} text
 * @internal
 */

var setTextContent = function (node, text) {
  if (text) {
    var firstChild = node.firstChild;

    if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
      firstChild.nodeValue = text;
      return;
    }
  }

  node.textContent = text;
};

// List derived from Gecko source code:
// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
var shorthandToLonghand = {
  animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
  background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
  backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
  border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
  borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
  borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
  borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
  borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
  borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
  borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
  borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
  borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
  borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
  borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
  borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
  columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
  columns: ['columnCount', 'columnWidth'],
  flex: ['flexBasis', 'flexGrow', 'flexShrink'],
  flexFlow: ['flexDirection', 'flexWrap'],
  font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
  fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
  gap: ['columnGap', 'rowGap'],
  grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
  gridColumn: ['gridColumnEnd', 'gridColumnStart'],
  gridColumnGap: ['columnGap'],
  gridGap: ['columnGap', 'rowGap'],
  gridRow: ['gridRowEnd', 'gridRowStart'],
  gridRowGap: ['rowGap'],
  gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
  margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
  marker: ['markerEnd', 'markerMid', 'markerStart'],
  mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
  maskPosition: ['maskPositionX', 'maskPositionY'],
  outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
  overflow: ['overflowX', 'overflowY'],
  padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
  placeContent: ['alignContent', 'justifyContent'],
  placeItems: ['alignItems', 'justifyItems'],
  placeSelf: ['alignSelf', 'justifySelf'],
  textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
  textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
  transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
  wordWrap: ['overflowWrap']
};

/**
 * CSS properties which accept numbers but are not in units of "px".
 */
var isUnitlessNumber = {
  animationIterationCount: true,
  borderImageOutset: true,
  borderImageSlice: true,
  borderImageWidth: true,
  boxFlex: true,
  boxFlexGroup: true,
  boxOrdinalGroup: true,
  columnCount: true,
  columns: true,
  flex: true,
  flexGrow: true,
  flexPositive: true,
  flexShrink: true,
  flexNegative: true,
  flexOrder: true,
  gridArea: true,
  gridRow: true,
  gridRowEnd: true,
  gridRowSpan: true,
  gridRowStart: true,
  gridColumn: true,
  gridColumnEnd: true,
  gridColumnSpan: true,
  gridColumnStart: true,
  fontWeight: true,
  lineClamp: true,
  lineHeight: true,
  opacity: true,
  order: true,
  orphans: true,
  tabSize: true,
  widows: true,
  zIndex: true,
  zoom: true,
  // SVG-related properties
  fillOpacity: true,
  floodOpacity: true,
  stopOpacity: true,
  strokeDasharray: true,
  strokeDashoffset: true,
  strokeMiterlimit: true,
  strokeOpacity: true,
  strokeWidth: true
};
/**
 * @param {string} prefix vendor-specific prefix, eg: Webkit
 * @param {string} key style name, eg: transitionDuration
 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
 * WebkitTransitionDuration
 */

function prefixKey(prefix, key) {
  return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}
/**
 * Support style names that may come passed in prefixed by adding permutations
 * of vendor prefixes.
 */


var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
// infinite loop, because it iterates over the newly added props too.

Object.keys(isUnitlessNumber).forEach(function (prop) {
  prefixes.forEach(function (prefix) {
    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  });
});

/**
 * Convert a value into the proper css writable value. The style name `name`
 * should be logical (no hyphens), as specified
 * in `CSSProperty.isUnitlessNumber`.
 *
 * @param {string} name CSS property name such as `topMargin`.
 * @param {*} value CSS property value such as `10px`.
 * @return {string} Normalized style value with dimensions applied.
 */

function dangerousStyleValue(name, value, isCustomProperty) {
  // Note that we've removed escapeTextForBrowser() calls here since the
  // whole string will be escaped when the attribute is injected into
  // the markup. If you provide unsafe user data here they can inject
  // arbitrary CSS which may be problematic (I couldn't repro this):
  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  // This is not an XSS hole but instead a potential CSS injection issue
  // which has lead to a greater discussion about how we're going to
  // trust URLs moving forward. See #2115901
  var isEmpty = value == null || typeof value === 'boolean' || value === '';

  if (isEmpty) {
    return '';
  }

  if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
  }

  return ('' + value).trim();
}

var uppercasePattern = /([A-Z])/g;
var msPattern = /^ms-/;
/**
 * Hyphenates a camelcased CSS property name, for example:
 *
 *   > hyphenateStyleName('backgroundColor')
 *   < "background-color"
 *   > hyphenateStyleName('MozTransition')
 *   < "-moz-transition"
 *   > hyphenateStyleName('msTransition')
 *   < "-ms-transition"
 *
 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
 * is converted to `-ms-`.
 */

function hyphenateStyleName(name) {
  return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
}

var warnValidStyle = function () {};

{
  // 'msTransform' is correct, but the other prefixes should be capitalized
  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  var msPattern$1 = /^-ms-/;
  var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon

  var badStyleValueWithSemicolonPattern = /;\s*$/;
  var warnedStyleNames = {};
  var warnedStyleValues = {};
  var warnedForNaNValue = false;
  var warnedForInfinityValue = false;

  var camelize = function (string) {
    return string.replace(hyphenPattern, function (_, character) {
      return character.toUpperCase();
    });
  };

  var warnHyphenatedStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;

    error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
    // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
    // is converted to lowercase `ms`.
    camelize(name.replace(msPattern$1, 'ms-')));
  };

  var warnBadVendoredStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;

    error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
  };

  var warnStyleValueWithSemicolon = function (name, value) {
    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
      return;
    }

    warnedStyleValues[value] = true;

    error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
  };

  var warnStyleValueIsNaN = function (name, value) {
    if (warnedForNaNValue) {
      return;
    }

    warnedForNaNValue = true;

    error('`NaN` is an invalid value for the `%s` css style property.', name);
  };

  var warnStyleValueIsInfinity = function (name, value) {
    if (warnedForInfinityValue) {
      return;
    }

    warnedForInfinityValue = true;

    error('`Infinity` is an invalid value for the `%s` css style property.', name);
  };

  warnValidStyle = function (name, value) {
    if (name.indexOf('-') > -1) {
      warnHyphenatedStyleName(name);
    } else if (badVendoredStyleNamePattern.test(name)) {
      warnBadVendoredStyleName(name);
    } else if (badStyleValueWithSemicolonPattern.test(value)) {
      warnStyleValueWithSemicolon(name, value);
    }

    if (typeof value === 'number') {
      if (isNaN(value)) {
        warnStyleValueIsNaN(name, value);
      } else if (!isFinite(value)) {
        warnStyleValueIsInfinity(name, value);
      }
    }
  };
}

var warnValidStyle$1 = warnValidStyle;

/**
 * Operations for dealing with CSS properties.
 */

/**
 * This creates a string that is expected to be equivalent to the style
 * attribute generated by server-side rendering. It by-passes warnings and
 * security checks so it's not safe to use this value for anything other than
 * comparison. It is only used in DEV for SSR validation.
 */

function createDangerousStringForStyles(styles) {
  {
    var serialized = '';
    var delimiter = '';

    for (var styleName in styles) {
      if (!styles.hasOwnProperty(styleName)) {
        continue;
      }

      var styleValue = styles[styleName];

      if (styleValue != null) {
        var isCustomProperty = styleName.indexOf('--') === 0;
        serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';
        serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
        delimiter = ';';
      }
    }

    return serialized || null;
  }
}
/**
 * Sets the value for multiple styles on a node.  If a value is specified as
 * '' (empty string), the corresponding style property will be unset.
 *
 * @param {DOMElement} node
 * @param {object} styles
 */

function setValueForStyles(node, styles) {
  var style = node.style;

  for (var styleName in styles) {
    if (!styles.hasOwnProperty(styleName)) {
      continue;
    }

    var isCustomProperty = styleName.indexOf('--') === 0;

    {
      if (!isCustomProperty) {
        warnValidStyle$1(styleName, styles[styleName]);
      }
    }

    var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);

    if (styleName === 'float') {
      styleName = 'cssFloat';
    }

    if (isCustomProperty) {
      style.setProperty(styleName, styleValue);
    } else {
      style[styleName] = styleValue;
    }
  }
}

function isValueEmpty(value) {
  return value == null || typeof value === 'boolean' || value === '';
}
/**
 * Given {color: 'red', overflow: 'hidden'} returns {
 *   color: 'color',
 *   overflowX: 'overflow',
 *   overflowY: 'overflow',
 * }. This can be read as "the overflowY property was set by the overflow
 * shorthand". That is, the values are the property that each was derived from.
 */


function expandShorthandMap(styles) {
  var expanded = {};

  for (var key in styles) {
    var longhands = shorthandToLonghand[key] || [key];

    for (var i = 0; i < longhands.length; i++) {
      expanded[longhands[i]] = key;
    }
  }

  return expanded;
}
/**
 * When mixing shorthand and longhand property names, we warn during updates if
 * we expect an incorrect result to occur. In particular, we warn for:
 *
 * Updating a shorthand property (longhand gets overwritten):
 *   {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
 *   becomes .style.font = 'baz'
 * Removing a shorthand property (longhand gets lost too):
 *   {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
 *   becomes .style.font = ''
 * Removing a longhand property (should revert to shorthand; doesn't):
 *   {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
 *   becomes .style.fontVariant = ''
 */


function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
  {
    if (!nextStyles) {
      return;
    }

    var expandedUpdates = expandShorthandMap(styleUpdates);
    var expandedStyles = expandShorthandMap(nextStyles);
    var warnedAbout = {};

    for (var key in expandedUpdates) {
      var originalKey = expandedUpdates[key];
      var correctOriginalKey = expandedStyles[key];

      if (correctOriginalKey && originalKey !== correctOriginalKey) {
        var warningKey = originalKey + ',' + correctOriginalKey;

        if (warnedAbout[warningKey]) {
          continue;
        }

        warnedAbout[warningKey] = true;

        error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
      }
    }
  }
}

// For HTML, certain tags should omit their close tag. We keep a list for
// those special-case tags.
var omittedCloseTags = {
  area: true,
  base: true,
  br: true,
  col: true,
  embed: true,
  hr: true,
  img: true,
  input: true,
  keygen: true,
  link: true,
  meta: true,
  param: true,
  source: true,
  track: true,
  wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.

};

// `omittedCloseTags` except that `menuitem` should still have its closing tag.

var voidElementTags = _assign({
  menuitem: true
}, omittedCloseTags);

var HTML = '__html';

function assertValidProps(tag, props) {
  if (!props) {
    return;
  } // Note the use of `==` which checks for null or undefined.


  if (voidElementTags[tag]) {
    if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
      {
        throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." );
      }
    }
  }

  if (props.dangerouslySetInnerHTML != null) {
    if (!(props.children == null)) {
      {
        throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." );
      }
    }

    if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
      {
        throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information." );
      }
    }
  }

  {
    if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
      error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');
    }
  }

  if (!(props.style == null || typeof props.style === 'object')) {
    {
      throw Error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." );
    }
  }
}

function isCustomComponent(tagName, props) {
  if (tagName.indexOf('-') === -1) {
    return typeof props.is === 'string';
  }

  switch (tagName) {
    // These are reserved SVG and MathML elements.
    // We don't mind this list too much because we expect it to never grow.
    // The alternative is to track the namespace in a few places which is convoluted.
    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
    case 'annotation-xml':
    case 'color-profile':
    case 'font-face':
    case 'font-face-src':
    case 'font-face-uri':
    case 'font-face-format':
    case 'font-face-name':
    case 'missing-glyph':
      return false;

    default:
      return true;
  }
}

// When adding attributes to the HTML or SVG allowed attribute list, be sure to
// also add them to this module to ensure casing and incorrect name
// warnings.
var possibleStandardNames = {
  // HTML
  accept: 'accept',
  acceptcharset: 'acceptCharset',
  'accept-charset': 'acceptCharset',
  accesskey: 'accessKey',
  action: 'action',
  allowfullscreen: 'allowFullScreen',
  alt: 'alt',
  as: 'as',
  async: 'async',
  autocapitalize: 'autoCapitalize',
  autocomplete: 'autoComplete',
  autocorrect: 'autoCorrect',
  autofocus: 'autoFocus',
  autoplay: 'autoPlay',
  autosave: 'autoSave',
  capture: 'capture',
  cellpadding: 'cellPadding',
  cellspacing: 'cellSpacing',
  challenge: 'challenge',
  charset: 'charSet',
  checked: 'checked',
  children: 'children',
  cite: 'cite',
  class: 'className',
  classid: 'classID',
  classname: 'className',
  cols: 'cols',
  colspan: 'colSpan',
  content: 'content',
  contenteditable: 'contentEditable',
  contextmenu: 'contextMenu',
  controls: 'controls',
  controlslist: 'controlsList',
  coords: 'coords',
  crossorigin: 'crossOrigin',
  dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
  data: 'data',
  datetime: 'dateTime',
  default: 'default',
  defaultchecked: 'defaultChecked',
  defaultvalue: 'defaultValue',
  defer: 'defer',
  dir: 'dir',
  disabled: 'disabled',
  disablepictureinpicture: 'disablePictureInPicture',
  disableremoteplayback: 'disableRemotePlayback',
  download: 'download',
  draggable: 'draggable',
  enctype: 'encType',
  enterkeyhint: 'enterKeyHint',
  for: 'htmlFor',
  form: 'form',
  formmethod: 'formMethod',
  formaction: 'formAction',
  formenctype: 'formEncType',
  formnovalidate: 'formNoValidate',
  formtarget: 'formTarget',
  frameborder: 'frameBorder',
  headers: 'headers',
  height: 'height',
  hidden: 'hidden',
  high: 'high',
  href: 'href',
  hreflang: 'hrefLang',
  htmlfor: 'htmlFor',
  httpequiv: 'httpEquiv',
  'http-equiv': 'httpEquiv',
  icon: 'icon',
  id: 'id',
  innerhtml: 'innerHTML',
  inputmode: 'inputMode',
  integrity: 'integrity',
  is: 'is',
  itemid: 'itemID',
  itemprop: 'itemProp',
  itemref: 'itemRef',
  itemscope: 'itemScope',
  itemtype: 'itemType',
  keyparams: 'keyParams',
  keytype: 'keyType',
  kind: 'kind',
  label: 'label',
  lang: 'lang',
  list: 'list',
  loop: 'loop',
  low: 'low',
  manifest: 'manifest',
  marginwidth: 'marginWidth',
  marginheight: 'marginHeight',
  max: 'max',
  maxlength: 'maxLength',
  media: 'media',
  mediagroup: 'mediaGroup',
  method: 'method',
  min: 'min',
  minlength: 'minLength',
  multiple: 'multiple',
  muted: 'muted',
  name: 'name',
  nomodule: 'noModule',
  nonce: 'nonce',
  novalidate: 'noValidate',
  open: 'open',
  optimum: 'optimum',
  pattern: 'pattern',
  placeholder: 'placeholder',
  playsinline: 'playsInline',
  poster: 'poster',
  preload: 'preload',
  profile: 'profile',
  radiogroup: 'radioGroup',
  readonly: 'readOnly',
  referrerpolicy: 'referrerPolicy',
  rel: 'rel',
  required: 'required',
  reversed: 'reversed',
  role: 'role',
  rows: 'rows',
  rowspan: 'rowSpan',
  sandbox: 'sandbox',
  scope: 'scope',
  scoped: 'scoped',
  scrolling: 'scrolling',
  seamless: 'seamless',
  selected: 'selected',
  shape: 'shape',
  size: 'size',
  sizes: 'sizes',
  span: 'span',
  spellcheck: 'spellCheck',
  src: 'src',
  srcdoc: 'srcDoc',
  srclang: 'srcLang',
  srcset: 'srcSet',
  start: 'start',
  step: 'step',
  style: 'style',
  summary: 'summary',
  tabindex: 'tabIndex',
  target: 'target',
  title: 'title',
  type: 'type',
  usemap: 'useMap',
  value: 'value',
  width: 'width',
  wmode: 'wmode',
  wrap: 'wrap',
  // SVG
  about: 'about',
  accentheight: 'accentHeight',
  'accent-height': 'accentHeight',
  accumulate: 'accumulate',
  additive: 'additive',
  alignmentbaseline: 'alignmentBaseline',
  'alignment-baseline': 'alignmentBaseline',
  allowreorder: 'allowReorder',
  alphabetic: 'alphabetic',
  amplitude: 'amplitude',
  arabicform: 'arabicForm',
  'arabic-form': 'arabicForm',
  ascent: 'ascent',
  attributename: 'attributeName',
  attributetype: 'attributeType',
  autoreverse: 'autoReverse',
  azimuth: 'azimuth',
  basefrequency: 'baseFrequency',
  baselineshift: 'baselineShift',
  'baseline-shift': 'baselineShift',
  baseprofile: 'baseProfile',
  bbox: 'bbox',
  begin: 'begin',
  bias: 'bias',
  by: 'by',
  calcmode: 'calcMode',
  capheight: 'capHeight',
  'cap-height': 'capHeight',
  clip: 'clip',
  clippath: 'clipPath',
  'clip-path': 'clipPath',
  clippathunits: 'clipPathUnits',
  cliprule: 'clipRule',
  'clip-rule': 'clipRule',
  color: 'color',
  colorinterpolation: 'colorInterpolation',
  'color-interpolation': 'colorInterpolation',
  colorinterpolationfilters: 'colorInterpolationFilters',
  'color-interpolation-filters': 'colorInterpolationFilters',
  colorprofile: 'colorProfile',
  'color-profile': 'colorProfile',
  colorrendering: 'colorRendering',
  'color-rendering': 'colorRendering',
  contentscripttype: 'contentScriptType',
  contentstyletype: 'contentStyleType',
  cursor: 'cursor',
  cx: 'cx',
  cy: 'cy',
  d: 'd',
  datatype: 'datatype',
  decelerate: 'decelerate',
  descent: 'descent',
  diffuseconstant: 'diffuseConstant',
  direction: 'direction',
  display: 'display',
  divisor: 'divisor',
  dominantbaseline: 'dominantBaseline',
  'dominant-baseline': 'dominantBaseline',
  dur: 'dur',
  dx: 'dx',
  dy: 'dy',
  edgemode: 'edgeMode',
  elevation: 'elevation',
  enablebackground: 'enableBackground',
  'enable-background': 'enableBackground',
  end: 'end',
  exponent: 'exponent',
  externalresourcesrequired: 'externalResourcesRequired',
  fill: 'fill',
  fillopacity: 'fillOpacity',
  'fill-opacity': 'fillOpacity',
  fillrule: 'fillRule',
  'fill-rule': 'fillRule',
  filter: 'filter',
  filterres: 'filterRes',
  filterunits: 'filterUnits',
  floodopacity: 'floodOpacity',
  'flood-opacity': 'floodOpacity',
  floodcolor: 'floodColor',
  'flood-color': 'floodColor',
  focusable: 'focusable',
  fontfamily: 'fontFamily',
  'font-family': 'fontFamily',
  fontsize: 'fontSize',
  'font-size': 'fontSize',
  fontsizeadjust: 'fontSizeAdjust',
  'font-size-adjust': 'fontSizeAdjust',
  fontstretch: 'fontStretch',
  'font-stretch': 'fontStretch',
  fontstyle: 'fontStyle',
  'font-style': 'fontStyle',
  fontvariant: 'fontVariant',
  'font-variant': 'fontVariant',
  fontweight: 'fontWeight',
  'font-weight': 'fontWeight',
  format: 'format',
  from: 'from',
  fx: 'fx',
  fy: 'fy',
  g1: 'g1',
  g2: 'g2',
  glyphname: 'glyphName',
  'glyph-name': 'glyphName',
  glyphorientationhorizontal: 'glyphOrientationHorizontal',
  'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
  glyphorientationvertical: 'glyphOrientationVertical',
  'glyph-orientation-vertical': 'glyphOrientationVertical',
  glyphref: 'glyphRef',
  gradienttransform: 'gradientTransform',
  gradientunits: 'gradientUnits',
  hanging: 'hanging',
  horizadvx: 'horizAdvX',
  'horiz-adv-x': 'horizAdvX',
  horizoriginx: 'horizOriginX',
  'horiz-origin-x': 'horizOriginX',
  ideographic: 'ideographic',
  imagerendering: 'imageRendering',
  'image-rendering': 'imageRendering',
  in2: 'in2',
  in: 'in',
  inlist: 'inlist',
  intercept: 'intercept',
  k1: 'k1',
  k2: 'k2',
  k3: 'k3',
  k4: 'k4',
  k: 'k',
  kernelmatrix: 'kernelMatrix',
  kernelunitlength: 'kernelUnitLength',
  kerning: 'kerning',
  keypoints: 'keyPoints',
  keysplines: 'keySplines',
  keytimes: 'keyTimes',
  lengthadjust: 'lengthAdjust',
  letterspacing: 'letterSpacing',
  'letter-spacing': 'letterSpacing',
  lightingcolor: 'lightingColor',
  'lighting-color': 'lightingColor',
  limitingconeangle: 'limitingConeAngle',
  local: 'local',
  markerend: 'markerEnd',
  'marker-end': 'markerEnd',
  markerheight: 'markerHeight',
  markermid: 'markerMid',
  'marker-mid': 'markerMid',
  markerstart: 'markerStart',
  'marker-start': 'markerStart',
  markerunits: 'markerUnits',
  markerwidth: 'markerWidth',
  mask: 'mask',
  maskcontentunits: 'maskContentUnits',
  maskunits: 'maskUnits',
  mathematical: 'mathematical',
  mode: 'mode',
  numoctaves: 'numOctaves',
  offset: 'offset',
  opacity: 'opacity',
  operator: 'operator',
  order: 'order',
  orient: 'orient',
  orientation: 'orientation',
  origin: 'origin',
  overflow: 'overflow',
  overlineposition: 'overlinePosition',
  'overline-position': 'overlinePosition',
  overlinethickness: 'overlineThickness',
  'overline-thickness': 'overlineThickness',
  paintorder: 'paintOrder',
  'paint-order': 'paintOrder',
  panose1: 'panose1',
  'panose-1': 'panose1',
  pathlength: 'pathLength',
  patterncontentunits: 'patternContentUnits',
  patterntransform: 'patternTransform',
  patternunits: 'patternUnits',
  pointerevents: 'pointerEvents',
  'pointer-events': 'pointerEvents',
  points: 'points',
  pointsatx: 'pointsAtX',
  pointsaty: 'pointsAtY',
  pointsatz: 'pointsAtZ',
  prefix: 'prefix',
  preservealpha: 'preserveAlpha',
  preserveaspectratio: 'preserveAspectRatio',
  primitiveunits: 'primitiveUnits',
  property: 'property',
  r: 'r',
  radius: 'radius',
  refx: 'refX',
  refy: 'refY',
  renderingintent: 'renderingIntent',
  'rendering-intent': 'renderingIntent',
  repeatcount: 'repeatCount',
  repeatdur: 'repeatDur',
  requiredextensions: 'requiredExtensions',
  requiredfeatures: 'requiredFeatures',
  resource: 'resource',
  restart: 'restart',
  result: 'result',
  results: 'results',
  rotate: 'rotate',
  rx: 'rx',
  ry: 'ry',
  scale: 'scale',
  security: 'security',
  seed: 'seed',
  shaperendering: 'shapeRendering',
  'shape-rendering': 'shapeRendering',
  slope: 'slope',
  spacing: 'spacing',
  specularconstant: 'specularConstant',
  specularexponent: 'specularExponent',
  speed: 'speed',
  spreadmethod: 'spreadMethod',
  startoffset: 'startOffset',
  stddeviation: 'stdDeviation',
  stemh: 'stemh',
  stemv: 'stemv',
  stitchtiles: 'stitchTiles',
  stopcolor: 'stopColor',
  'stop-color': 'stopColor',
  stopopacity: 'stopOpacity',
  'stop-opacity': 'stopOpacity',
  strikethroughposition: 'strikethroughPosition',
  'strikethrough-position': 'strikethroughPosition',
  strikethroughthickness: 'strikethroughThickness',
  'strikethrough-thickness': 'strikethroughThickness',
  string: 'string',
  stroke: 'stroke',
  strokedasharray: 'strokeDasharray',
  'stroke-dasharray': 'strokeDasharray',
  strokedashoffset: 'strokeDashoffset',
  'stroke-dashoffset': 'strokeDashoffset',
  strokelinecap: 'strokeLinecap',
  'stroke-linecap': 'strokeLinecap',
  strokelinejoin: 'strokeLinejoin',
  'stroke-linejoin': 'strokeLinejoin',
  strokemiterlimit: 'strokeMiterlimit',
  'stroke-miterlimit': 'strokeMiterlimit',
  strokewidth: 'strokeWidth',
  'stroke-width': 'strokeWidth',
  strokeopacity: 'strokeOpacity',
  'stroke-opacity': 'strokeOpacity',
  suppresscontenteditablewarning: 'suppressContentEditableWarning',
  suppresshydrationwarning: 'suppressHydrationWarning',
  surfacescale: 'surfaceScale',
  systemlanguage: 'systemLanguage',
  tablevalues: 'tableValues',
  targetx: 'targetX',
  targety: 'targetY',
  textanchor: 'textAnchor',
  'text-anchor': 'textAnchor',
  textdecoration: 'textDecoration',
  'text-decoration': 'textDecoration',
  textlength: 'textLength',
  textrendering: 'textRendering',
  'text-rendering': 'textRendering',
  to: 'to',
  transform: 'transform',
  typeof: 'typeof',
  u1: 'u1',
  u2: 'u2',
  underlineposition: 'underlinePosition',
  'underline-position': 'underlinePosition',
  underlinethickness: 'underlineThickness',
  'underline-thickness': 'underlineThickness',
  unicode: 'unicode',
  unicodebidi: 'unicodeBidi',
  'unicode-bidi': 'unicodeBidi',
  unicoderange: 'unicodeRange',
  'unicode-range': 'unicodeRange',
  unitsperem: 'unitsPerEm',
  'units-per-em': 'unitsPerEm',
  unselectable: 'unselectable',
  valphabetic: 'vAlphabetic',
  'v-alphabetic': 'vAlphabetic',
  values: 'values',
  vectoreffect: 'vectorEffect',
  'vector-effect': 'vectorEffect',
  version: 'version',
  vertadvy: 'vertAdvY',
  'vert-adv-y': 'vertAdvY',
  vertoriginx: 'vertOriginX',
  'vert-origin-x': 'vertOriginX',
  vertoriginy: 'vertOriginY',
  'vert-origin-y': 'vertOriginY',
  vhanging: 'vHanging',
  'v-hanging': 'vHanging',
  videographic: 'vIdeographic',
  'v-ideographic': 'vIdeographic',
  viewbox: 'viewBox',
  viewtarget: 'viewTarget',
  visibility: 'visibility',
  vmathematical: 'vMathematical',
  'v-mathematical': 'vMathematical',
  vocab: 'vocab',
  widths: 'widths',
  wordspacing: 'wordSpacing',
  'word-spacing': 'wordSpacing',
  writingmode: 'writingMode',
  'writing-mode': 'writingMode',
  x1: 'x1',
  x2: 'x2',
  x: 'x',
  xchannelselector: 'xChannelSelector',
  xheight: 'xHeight',
  'x-height': 'xHeight',
  xlinkactuate: 'xlinkActuate',
  'xlink:actuate': 'xlinkActuate',
  xlinkarcrole: 'xlinkArcrole',
  'xlink:arcrole': 'xlinkArcrole',
  xlinkhref: 'xlinkHref',
  'xlink:href': 'xlinkHref',
  xlinkrole: 'xlinkRole',
  'xlink:role': 'xlinkRole',
  xlinkshow: 'xlinkShow',
  'xlink:show': 'xlinkShow',
  xlinktitle: 'xlinkTitle',
  'xlink:title': 'xlinkTitle',
  xlinktype: 'xlinkType',
  'xlink:type': 'xlinkType',
  xmlbase: 'xmlBase',
  'xml:base': 'xmlBase',
  xmllang: 'xmlLang',
  'xml:lang': 'xmlLang',
  xmlns: 'xmlns',
  'xml:space': 'xmlSpace',
  xmlnsxlink: 'xmlnsXlink',
  'xmlns:xlink': 'xmlnsXlink',
  xmlspace: 'xmlSpace',
  y1: 'y1',
  y2: 'y2',
  y: 'y',
  ychannelselector: 'yChannelSelector',
  z: 'z',
  zoomandpan: 'zoomAndPan'
};

var ariaProperties = {
  'aria-current': 0,
  // state
  'aria-details': 0,
  'aria-disabled': 0,
  // state
  'aria-hidden': 0,
  // state
  'aria-invalid': 0,
  // state
  'aria-keyshortcuts': 0,
  'aria-label': 0,
  'aria-roledescription': 0,
  // Widget Attributes
  'aria-autocomplete': 0,
  'aria-checked': 0,
  'aria-expanded': 0,
  'aria-haspopup': 0,
  'aria-level': 0,
  'aria-modal': 0,
  'aria-multiline': 0,
  'aria-multiselectable': 0,
  'aria-orientation': 0,
  'aria-placeholder': 0,
  'aria-pressed': 0,
  'aria-readonly': 0,
  'aria-required': 0,
  'aria-selected': 0,
  'aria-sort': 0,
  'aria-valuemax': 0,
  'aria-valuemin': 0,
  'aria-valuenow': 0,
  'aria-valuetext': 0,
  // Live Region Attributes
  'aria-atomic': 0,
  'aria-busy': 0,
  'aria-live': 0,
  'aria-relevant': 0,
  // Drag-and-Drop Attributes
  'aria-dropeffect': 0,
  'aria-grabbed': 0,
  // Relationship Attributes
  'aria-activedescendant': 0,
  'aria-colcount': 0,
  'aria-colindex': 0,
  'aria-colspan': 0,
  'aria-controls': 0,
  'aria-describedby': 0,
  'aria-errormessage': 0,
  'aria-flowto': 0,
  'aria-labelledby': 0,
  'aria-owns': 0,
  'aria-posinset': 0,
  'aria-rowcount': 0,
  'aria-rowindex': 0,
  'aria-rowspan': 0,
  'aria-setsize': 0
};

var warnedProperties = {};
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;

function validateProperty(tagName, name) {
  {
    if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
      return true;
    }

    if (rARIACamel.test(name)) {
      var ariaName = 'aria-' + name.slice(4).toLowerCase();
      var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
      // DOM properties, then it is an invalid aria-* attribute.

      if (correctName == null) {
        error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);

        warnedProperties[name] = true;
        return true;
      } // aria-* attributes should be lowercase; suggest the lowercase version.


      if (name !== correctName) {
        error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);

        warnedProperties[name] = true;
        return true;
      }
    }

    if (rARIA.test(name)) {
      var lowerCasedName = name.toLowerCase();
      var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
      // DOM properties, then it is an invalid aria-* attribute.

      if (standardName == null) {
        warnedProperties[name] = true;
        return false;
      } // aria-* attributes should be lowercase; suggest the lowercase version.


      if (name !== standardName) {
        error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);

        warnedProperties[name] = true;
        return true;
      }
    }
  }

  return true;
}

function warnInvalidARIAProps(type, props) {
  {
    var invalidProps = [];

    for (var key in props) {
      var isValid = validateProperty(type, key);

      if (!isValid) {
        invalidProps.push(key);
      }
    }

    var unknownPropString = invalidProps.map(function (prop) {
      return '`' + prop + '`';
    }).join(', ');

    if (invalidProps.length === 1) {
      error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);
    } else if (invalidProps.length > 1) {
      error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);
    }
  }
}

function validateProperties(type, props) {
  if (isCustomComponent(type, props)) {
    return;
  }

  warnInvalidARIAProps(type, props);
}

var didWarnValueNull = false;
function validateProperties$1(type, props) {
  {
    if (type !== 'input' && type !== 'textarea' && type !== 'select') {
      return;
    }

    if (props != null && props.value === null && !didWarnValueNull) {
      didWarnValueNull = true;

      if (type === 'select' && props.multiple) {
        error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
      } else {
        error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
      }
    }
  }
}

var validateProperty$1 = function () {};

{
  var warnedProperties$1 = {};
  var _hasOwnProperty = Object.prototype.hasOwnProperty;
  var EVENT_NAME_REGEX = /^on./;
  var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
  var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');

  validateProperty$1 = function (tagName, name, value, eventRegistry) {
    if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
      return true;
    }

    var lowerCasedName = name.toLowerCase();

    if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
      error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');

      warnedProperties$1[name] = true;
      return true;
    } // We can't rely on the event system being injected on the server.


    if (eventRegistry != null) {
      var registrationNameDependencies = eventRegistry.registrationNameDependencies,
          possibleRegistrationNames = eventRegistry.possibleRegistrationNames;

      if (registrationNameDependencies.hasOwnProperty(name)) {
        return true;
      }

      var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;

      if (registrationName != null) {
        error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);

        warnedProperties$1[name] = true;
        return true;
      }

      if (EVENT_NAME_REGEX.test(name)) {
        error('Unknown event handler property `%s`. It will be ignored.', name);

        warnedProperties$1[name] = true;
        return true;
      }
    } else if (EVENT_NAME_REGEX.test(name)) {
      // If no event plugins have been injected, we are in a server environment.
      // So we can't tell if the event name is correct for sure, but we can filter
      // out known bad ones like `onclick`. We can't suggest a specific replacement though.
      if (INVALID_EVENT_NAME_REGEX.test(name)) {
        error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
      }

      warnedProperties$1[name] = true;
      return true;
    } // Let the ARIA attribute hook validate ARIA attributes


    if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
      return true;
    }

    if (lowerCasedName === 'innerhtml') {
      error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');

      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'aria') {
      error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');

      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
      error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);

      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'number' && isNaN(value)) {
      error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);

      warnedProperties$1[name] = true;
      return true;
    }

    var propertyInfo = getPropertyInfo(name);
    var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.

    if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
      var standardName = possibleStandardNames[lowerCasedName];

      if (standardName !== name) {
        error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);

        warnedProperties$1[name] = true;
        return true;
      }
    } else if (!isReserved && name !== lowerCasedName) {
      // Unknown attributes should have lowercase casing since that's how they
      // will be cased anyway with server rendering.
      error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);

      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      if (value) {
        error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
      } else {
        error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
      }

      warnedProperties$1[name] = true;
      return true;
    } // Now that we've validated casing, do not validate
    // data types for reserved props


    if (isReserved) {
      return true;
    } // Warn when a known attribute is a bad type


    if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      warnedProperties$1[name] = true;
      return false;
    } // Warn when passing the strings 'false' or 'true' into a boolean prop


    if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
      error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);

      warnedProperties$1[name] = true;
      return true;
    }

    return true;
  };
}

var warnUnknownProperties = function (type, props, eventRegistry) {
  {
    var unknownProps = [];

    for (var key in props) {
      var isValid = validateProperty$1(type, key, props[key], eventRegistry);

      if (!isValid) {
        unknownProps.push(key);
      }
    }

    var unknownPropString = unknownProps.map(function (prop) {
      return '`' + prop + '`';
    }).join(', ');

    if (unknownProps.length === 1) {
      error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);
    } else if (unknownProps.length > 1) {
      error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);
    }
  }
};

function validateProperties$2(type, props, eventRegistry) {
  if (isCustomComponent(type, props)) {
    return;
  }

  warnUnknownProperties(type, props, eventRegistry);
}

var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
var IS_NON_DELEGATED = 1 << 1;
var IS_CAPTURE_PHASE = 1 << 2;
var IS_REPLAYED = 1 << 4;
// set to LEGACY_FB_SUPPORT. LEGACY_FB_SUPPORT only gets set when
// we call willDeferLaterForLegacyFBSupport, thus not bailing out
// will result in endless cycles like an infinite loop.
// We also don't want to defer during event replaying.

var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;

/**
 * Gets the target node from a native browser event by accounting for
 * inconsistencies in browser DOM APIs.
 *
 * @param {object} nativeEvent Native browser event.
 * @return {DOMEventTarget} Target node.
 */

function getEventTarget(nativeEvent) {
  // Fallback to nativeEvent.srcElement for IE9
  // https://github.com/facebook/react/issues/12506
  var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963

  if (target.correspondingUseElement) {
    target = target.correspondingUseElement;
  } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
  // @see http://www.quirksmode.org/js/events_properties.html


  return target.nodeType === TEXT_NODE ? target.parentNode : target;
}

var restoreImpl = null;
var restoreTarget = null;
var restoreQueue = null;

function restoreStateOfTarget(target) {
  // We perform this translation at the end of the event loop so that we
  // always receive the correct fiber here
  var internalInstance = getInstanceFromNode(target);

  if (!internalInstance) {
    // Unmounted
    return;
  }

  if (!(typeof restoreImpl === 'function')) {
    {
      throw Error( "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue." );
    }
  }

  var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted.

  if (stateNode) {
    var _props = getFiberCurrentPropsFromNode(stateNode);

    restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
  }
}

function setRestoreImplementation(impl) {
  restoreImpl = impl;
}
function enqueueStateRestore(target) {
  if (restoreTarget) {
    if (restoreQueue) {
      restoreQueue.push(target);
    } else {
      restoreQueue = [target];
    }
  } else {
    restoreTarget = target;
  }
}
function needsStateRestore() {
  return restoreTarget !== null || restoreQueue !== null;
}
function restoreStateIfNeeded() {
  if (!restoreTarget) {
    return;
  }

  var target = restoreTarget;
  var queuedTargets = restoreQueue;
  restoreTarget = null;
  restoreQueue = null;
  restoreStateOfTarget(target);

  if (queuedTargets) {
    for (var i = 0; i < queuedTargets.length; i++) {
      restoreStateOfTarget(queuedTargets[i]);
    }
  }
}

// the renderer. Such as when we're dispatching events or if third party
// libraries need to call batchedUpdates. Eventually, this API will go away when
// everything is batched by default. We'll then have a similar API to opt-out of
// scheduled work and instead do synchronous work.
// Defaults

var batchedUpdatesImpl = function (fn, bookkeeping) {
  return fn(bookkeeping);
};

var discreteUpdatesImpl = function (fn, a, b, c, d) {
  return fn(a, b, c, d);
};

var flushDiscreteUpdatesImpl = function () {};

var batchedEventUpdatesImpl = batchedUpdatesImpl;
var isInsideEventHandler = false;
var isBatchingEventUpdates = false;

function finishEventHandler() {
  // Here we wait until all updates have propagated, which is important
  // when using controlled components within layers:
  // https://github.com/facebook/react/issues/1698
  // Then we restore state of any controlled component.
  var controlledComponentsHavePendingUpdates = needsStateRestore();

  if (controlledComponentsHavePendingUpdates) {
    // If a controlled event was fired, we may need to restore the state of
    // the DOM node back to the controlled value. This is necessary when React
    // bails out of the update without touching the DOM.
    flushDiscreteUpdatesImpl();
    restoreStateIfNeeded();
  }
}

function batchedUpdates(fn, bookkeeping) {
  if (isInsideEventHandler) {
    // If we are currently inside another batch, we need to wait until it
    // fully completes before restoring state.
    return fn(bookkeeping);
  }

  isInsideEventHandler = true;

  try {
    return batchedUpdatesImpl(fn, bookkeeping);
  } finally {
    isInsideEventHandler = false;
    finishEventHandler();
  }
}
function batchedEventUpdates(fn, a, b) {
  if (isBatchingEventUpdates) {
    // If we are currently inside another batch, we need to wait until it
    // fully completes before restoring state.
    return fn(a, b);
  }

  isBatchingEventUpdates = true;

  try {
    return batchedEventUpdatesImpl(fn, a, b);
  } finally {
    isBatchingEventUpdates = false;
    finishEventHandler();
  }
}
function discreteUpdates(fn, a, b, c, d) {
  var prevIsInsideEventHandler = isInsideEventHandler;
  isInsideEventHandler = true;

  try {
    return discreteUpdatesImpl(fn, a, b, c, d);
  } finally {
    isInsideEventHandler = prevIsInsideEventHandler;

    if (!isInsideEventHandler) {
      finishEventHandler();
    }
  }
}
function flushDiscreteUpdatesIfNeeded(timeStamp) {
  {
    if (!isInsideEventHandler) {
      flushDiscreteUpdatesImpl();
    }
  }
}
function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
  batchedUpdatesImpl = _batchedUpdatesImpl;
  discreteUpdatesImpl = _discreteUpdatesImpl;
  flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
  batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
}

function isInteractive(tag) {
  return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
}

function shouldPreventMouseEvent(name, type, props) {
  switch (name) {
    case 'onClick':
    case 'onClickCapture':
    case 'onDoubleClick':
    case 'onDoubleClickCapture':
    case 'onMouseDown':
    case 'onMouseDownCapture':
    case 'onMouseMove':
    case 'onMouseMoveCapture':
    case 'onMouseUp':
    case 'onMouseUpCapture':
    case 'onMouseEnter':
      return !!(props.disabled && isInteractive(type));

    default:
      return false;
  }
}
/**
 * @param {object} inst The instance, which is the source of events.
 * @param {string} registrationName Name of listener (e.g. `onClick`).
 * @return {?function} The stored callback.
 */


function getListener(inst, registrationName) {
  var stateNode = inst.stateNode;

  if (stateNode === null) {
    // Work in progress (ex: onload events in incremental mode).
    return null;
  }

  var props = getFiberCurrentPropsFromNode(stateNode);

  if (props === null) {
    // Work in progress.
    return null;
  }

  var listener = props[registrationName];

  if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
    return null;
  }

  if (!(!listener || typeof listener === 'function')) {
    {
      throw Error( "Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type." );
    }
  }

  return listener;
}

var passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support

if (canUseDOM) {
  try {
    var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value

    Object.defineProperty(options, 'passive', {
      get: function () {
        passiveBrowserEventsSupported = true;
      }
    });
    window.addEventListener('test', options, options);
    window.removeEventListener('test', options, options);
  } catch (e) {
    passiveBrowserEventsSupported = false;
  }
}

function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {
  var funcArgs = Array.prototype.slice.call(arguments, 3);

  try {
    func.apply(context, funcArgs);
  } catch (error) {
    this.onError(error);
  }
}

var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;

{
  // In DEV mode, we swap out invokeGuardedCallback for a special version
  // that plays more nicely with the browser's DevTools. The idea is to preserve
  // "Pause on exceptions" behavior. Because React wraps all user-provided
  // functions in invokeGuardedCallback, and the production version of
  // invokeGuardedCallback uses a try-catch, all user exceptions are treated
  // like caught exceptions, and the DevTools won't pause unless the developer
  // takes the extra step of enabling pause on caught exceptions. This is
  // unintuitive, though, because even though React has caught the error, from
  // the developer's perspective, the error is uncaught.
  //
  // To preserve the expected "Pause on exceptions" behavior, we don't use a
  // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
  // DOM node, and call the user-provided callback from inside an event handler
  // for that fake event. If the callback throws, the error is "captured" using
  // a global event handler. But because the error happens in a different
  // event loop context, it does not interrupt the normal program flow.
  // Effectively, this gives us try-catch behavior without actually using
  // try-catch. Neat!
  // Check that the browser supports the APIs we need to implement our special
  // DEV version of invokeGuardedCallback
  if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
    var fakeNode = document.createElement('react');

    invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {
      // If document doesn't exist we know for sure we will crash in this method
      // when we call document.createEvent(). However this can cause confusing
      // errors: https://github.com/facebookincubator/create-react-app/issues/3482
      // So we preemptively throw with a better message instead.
      if (!(typeof document !== 'undefined')) {
        {
          throw Error( "The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous." );
        }
      }

      var evt = document.createEvent('Event');
      var didCall = false; // Keeps track of whether the user-provided callback threw an error. We
      // set this to true at the beginning, then set it to false right after
      // calling the function. If the function errors, `didError` will never be
      // set to false. This strategy works even if the browser is flaky and
      // fails to call our global error handler, because it doesn't rely on
      // the error event at all.

      var didError = true; // Keeps track of the value of window.event so that we can reset it
      // during the callback to let user code access window.event in the
      // browsers that support it.

      var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event
      // dispatching: https://github.com/facebook/react/issues/13688

      var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');

      function restoreAfterDispatch() {
        // We immediately remove the callback from event listeners so that
        // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
        // nested call would trigger the fake event handlers of any call higher
        // in the stack.
        fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the
        // window.event assignment in both IE <= 10 as they throw an error
        // "Member not found" in strict mode, and in Firefox which does not
        // support window.event.

        if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
          window.event = windowEvent;
        }
      } // Create an event handler for our fake event. We will synchronously
      // dispatch our fake event using `dispatchEvent`. Inside the handler, we
      // call the user-provided callback.


      var funcArgs = Array.prototype.slice.call(arguments, 3);

      function callCallback() {
        didCall = true;
        restoreAfterDispatch();
        func.apply(context, funcArgs);
        didError = false;
      } // Create a global error event handler. We use this to capture the value
      // that was thrown. It's possible that this error handler will fire more
      // than once; for example, if non-React code also calls `dispatchEvent`
      // and a handler for that event throws. We should be resilient to most of
      // those cases. Even if our error event handler fires more than once, the
      // last error event is always used. If the callback actually does error,
      // we know that the last error event is the correct one, because it's not
      // possible for anything else to have happened in between our callback
      // erroring and the code that follows the `dispatchEvent` call below. If
      // the callback doesn't error, but the error event was fired, we know to
      // ignore it because `didError` will be false, as described above.


      var error; // Use this to track whether the error event is ever called.

      var didSetError = false;
      var isCrossOriginError = false;

      function handleWindowError(event) {
        error = event.error;
        didSetError = true;

        if (error === null && event.colno === 0 && event.lineno === 0) {
          isCrossOriginError = true;
        }

        if (event.defaultPrevented) {
          // Some other error handler has prevented default.
          // Browsers silence the error report if this happens.
          // We'll remember this to later decide whether to log it or not.
          if (error != null && typeof error === 'object') {
            try {
              error._suppressLogging = true;
            } catch (inner) {// Ignore.
            }
          }
        }
      } // Create a fake event type.


      var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers

      window.addEventListener('error', handleWindowError);
      fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function
      // errors, it will trigger our global error handler.

      evt.initEvent(evtType, false, false);
      fakeNode.dispatchEvent(evt);

      if (windowEventDescriptor) {
        Object.defineProperty(window, 'event', windowEventDescriptor);
      }

      if (didCall && didError) {
        if (!didSetError) {
          // The callback errored, but the error event never fired.
          error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
        } else if (isCrossOriginError) {
          error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://reactjs.org/link/crossorigin-error for more information.');
        }

        this.onError(error);
      } // Remove our event listeners


      window.removeEventListener('error', handleWindowError);

      if (!didCall) {
        // Something went really wrong, and our event was not dispatched.
        // https://github.com/facebook/react/issues/16734
        // https://github.com/facebook/react/issues/16585
        // Fall back to the production implementation.
        restoreAfterDispatch();
        return invokeGuardedCallbackProd.apply(this, arguments);
      }
    };
  }
}

var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;

var hasError = false;
var caughtError = null; // Used by event system to capture/rethrow the first error.

var hasRethrowError = false;
var rethrowError = null;
var reporter = {
  onError: function (error) {
    hasError = true;
    caughtError = error;
  }
};
/**
 * Call a function while guarding against errors that happens within it.
 * Returns an error if it throws, otherwise null.
 *
 * In production, this is implemented using a try-catch. The reason we don't
 * use a try-catch directly is so that we can swap out a different
 * implementation in DEV mode.
 *
 * @param {String} name of the guard to use for logging or debugging
 * @param {Function} func The function to invoke
 * @param {*} context The context to use when calling the function
 * @param {...*} args Arguments for function
 */

function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
  hasError = false;
  caughtError = null;
  invokeGuardedCallbackImpl$1.apply(reporter, arguments);
}
/**
 * Same as invokeGuardedCallback, but instead of returning an error, it stores
 * it in a global so it can be rethrown by `rethrowCaughtError` later.
 * TODO: See if caughtError and rethrowError can be unified.
 *
 * @param {String} name of the guard to use for logging or debugging
 * @param {Function} func The function to invoke
 * @param {*} context The context to use when calling the function
 * @param {...*} args Arguments for function
 */

function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
  invokeGuardedCallback.apply(this, arguments);

  if (hasError) {
    var error = clearCaughtError();

    if (!hasRethrowError) {
      hasRethrowError = true;
      rethrowError = error;
    }
  }
}
/**
 * During execution of guarded functions we will capture the first error which
 * we will rethrow to be handled by the top level error handler.
 */

function rethrowCaughtError() {
  if (hasRethrowError) {
    var error = rethrowError;
    hasRethrowError = false;
    rethrowError = null;
    throw error;
  }
}
function hasCaughtError() {
  return hasError;
}
function clearCaughtError() {
  if (hasError) {
    var error = caughtError;
    hasError = false;
    caughtError = null;
    return error;
  } else {
    {
      {
        throw Error( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." );
      }
    }
  }
}

/**
 * `ReactInstanceMap` maintains a mapping from a public facing stateful
 * instance (key) and the internal representation (value). This allows public
 * methods to accept the user facing instance as an argument and map them back
 * to internal methods.
 *
 * Note that this module is currently shared and assumed to be stateless.
 * If this becomes an actual Map, that will break.
 */
function get(key) {
  return key._reactInternals;
}
function has(key) {
  return key._reactInternals !== undefined;
}
function set(key, value) {
  key._reactInternals = value;
}

// Don't change these two values. They're used by React Dev Tools.
var NoFlags =
/*                      */
0;
var PerformedWork =
/*                */
1; // You can change the rest (and add more).

var Placement =
/*                    */
2;
var Update =
/*                       */
4;
var PlacementAndUpdate =
/*           */
6;
var Deletion =
/*                     */
8;
var ContentReset =
/*                 */
16;
var Callback =
/*                     */
32;
var DidCapture =
/*                   */
64;
var Ref =
/*                          */
128;
var Snapshot =
/*                     */
256;
var Passive =
/*                      */
512; // TODO (effects) Remove this bit once the new reconciler is synced to the old.

var PassiveUnmountPendingDev =
/*     */
8192;
var Hydrating =
/*                    */
1024;
var HydratingAndUpdate =
/*           */
1028; // Passive & Update & Callback & Ref & Snapshot

var LifecycleEffectMask =
/*          */
932; // Union of all host effects

var HostEffectMask =
/*               */
2047; // These are not really side effects, but we still reuse this field.

var Incomplete =
/*                   */
2048;
var ShouldCapture =
/*                */
4096;
var ForceUpdateForLegacySuspense =
/* */
16384; // Static tags describe aspects of a fiber that are not specific to a render,

var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
function getNearestMountedFiber(fiber) {
  var node = fiber;
  var nearestMounted = fiber;

  if (!fiber.alternate) {
    // If there is no alternate, this might be a new tree that isn't inserted
    // yet. If it is, then it will have a pending insertion effect on it.
    var nextNode = node;

    do {
      node = nextNode;

      if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
        // This is an insertion or in-progress hydration. The nearest possible
        // mounted fiber is the parent but we need to continue to figure out
        // if that one is still mounted.
        nearestMounted = node.return;
      }

      nextNode = node.return;
    } while (nextNode);
  } else {
    while (node.return) {
      node = node.return;
    }
  }

  if (node.tag === HostRoot) {
    // TODO: Check if this was a nested HostRoot when used with
    // renderContainerIntoSubtree.
    return nearestMounted;
  } // If we didn't hit the root, that means that we're in an disconnected tree
  // that has been unmounted.


  return null;
}
function getSuspenseInstanceFromFiber(fiber) {
  if (fiber.tag === SuspenseComponent) {
    var suspenseState = fiber.memoizedState;

    if (suspenseState === null) {
      var current = fiber.alternate;

      if (current !== null) {
        suspenseState = current.memoizedState;
      }
    }

    if (suspenseState !== null) {
      return suspenseState.dehydrated;
    }
  }

  return null;
}
function getContainerFromFiber(fiber) {
  return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
}
function isFiberMounted(fiber) {
  return getNearestMountedFiber(fiber) === fiber;
}
function isMounted(component) {
  {
    var owner = ReactCurrentOwner.current;

    if (owner !== null && owner.tag === ClassComponent) {
      var ownerFiber = owner;
      var instance = ownerFiber.stateNode;

      if (!instance._warnedAboutRefsInRender) {
        error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component');
      }

      instance._warnedAboutRefsInRender = true;
    }
  }

  var fiber = get(component);

  if (!fiber) {
    return false;
  }

  return getNearestMountedFiber(fiber) === fiber;
}

function assertIsMounted(fiber) {
  if (!(getNearestMountedFiber(fiber) === fiber)) {
    {
      throw Error( "Unable to find node on an unmounted component." );
    }
  }
}

function findCurrentFiberUsingSlowPath(fiber) {
  var alternate = fiber.alternate;

  if (!alternate) {
    // If there is no alternate, then we only need to check if it is mounted.
    var nearestMounted = getNearestMountedFiber(fiber);

    if (!(nearestMounted !== null)) {
      {
        throw Error( "Unable to find node on an unmounted component." );
      }
    }

    if (nearestMounted !== fiber) {
      return null;
    }

    return fiber;
  } // If we have two possible branches, we'll walk backwards up to the root
  // to see what path the root points to. On the way we may hit one of the
  // special cases and we'll deal with them.


  var a = fiber;
  var b = alternate;

  while (true) {
    var parentA = a.return;

    if (parentA === null) {
      // We're at the root.
      break;
    }

    var parentB = parentA.alternate;

    if (parentB === null) {
      // There is no alternate. This is an unusual case. Currently, it only
      // happens when a Suspense component is hidden. An extra fragment fiber
      // is inserted in between the Suspense fiber and its children. Skip
      // over this extra fragment fiber and proceed to the next parent.
      var nextParent = parentA.return;

      if (nextParent !== null) {
        a = b = nextParent;
        continue;
      } // If there's no parent, we're at the root.


      break;
    } // If both copies of the parent fiber point to the same child, we can
    // assume that the child is current. This happens when we bailout on low
    // priority: the bailed out fiber's child reuses the current child.


    if (parentA.child === parentB.child) {
      var child = parentA.child;

      while (child) {
        if (child === a) {
          // We've determined that A is the current branch.
          assertIsMounted(parentA);
          return fiber;
        }

        if (child === b) {
          // We've determined that B is the current branch.
          assertIsMounted(parentA);
          return alternate;
        }

        child = child.sibling;
      } // We should never have an alternate for any mounting node. So the only
      // way this could possibly happen is if this was unmounted, if at all.


      {
        {
          throw Error( "Unable to find node on an unmounted component." );
        }
      }
    }

    if (a.return !== b.return) {
      // The return pointer of A and the return pointer of B point to different
      // fibers. We assume that return pointers never criss-cross, so A must
      // belong to the child set of A.return, and B must belong to the child
      // set of B.return.
      a = parentA;
      b = parentB;
    } else {
      // The return pointers point to the same fiber. We'll have to use the
      // default, slow path: scan the child sets of each parent alternate to see
      // which child belongs to which set.
      //
      // Search parent A's child set
      var didFindChild = false;
      var _child = parentA.child;

      while (_child) {
        if (_child === a) {
          didFindChild = true;
          a = parentA;
          b = parentB;
          break;
        }

        if (_child === b) {
          didFindChild = true;
          b = parentA;
          a = parentB;
          break;
        }

        _child = _child.sibling;
      }

      if (!didFindChild) {
        // Search parent B's child set
        _child = parentB.child;

        while (_child) {
          if (_child === a) {
            didFindChild = true;
            a = parentB;
            b = parentA;
            break;
          }

          if (_child === b) {
            didFindChild = true;
            b = parentB;
            a = parentA;
            break;
          }

          _child = _child.sibling;
        }

        if (!didFindChild) {
          {
            throw Error( "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." );
          }
        }
      }
    }

    if (!(a.alternate === b)) {
      {
        throw Error( "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." );
      }
    }
  } // If the root is not a host container, we're in a disconnected tree. I.e.
  // unmounted.


  if (!(a.tag === HostRoot)) {
    {
      throw Error( "Unable to find node on an unmounted component." );
    }
  }

  if (a.stateNode.current === a) {
    // We've determined that A is the current branch.
    return fiber;
  } // Otherwise B has to be current branch.


  return alternate;
}
function findCurrentHostFiber(parent) {
  var currentParent = findCurrentFiberUsingSlowPath(parent);

  if (!currentParent) {
    return null;
  } // Next we'll drill down this component to find the first HostComponent/Text.


  var node = currentParent;

  while (true) {
    if (node.tag === HostComponent || node.tag === HostText) {
      return node;
    } else if (node.child) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === currentParent) {
      return null;
    }

    while (!node.sibling) {
      if (!node.return || node.return === currentParent) {
        return null;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  } // Flow needs the return null here, but ESLint complains about it.
  // eslint-disable-next-line no-unreachable


  return null;
}
function findCurrentHostFiberWithNoPortals(parent) {
  var currentParent = findCurrentFiberUsingSlowPath(parent);

  if (!currentParent) {
    return null;
  } // Next we'll drill down this component to find the first HostComponent/Text.


  var node = currentParent;

  while (true) {
    if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI ) {
      return node;
    } else if (node.child && node.tag !== HostPortal) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === currentParent) {
      return null;
    }

    while (!node.sibling) {
      if (!node.return || node.return === currentParent) {
        return null;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  } // Flow needs the return null here, but ESLint complains about it.
  // eslint-disable-next-line no-unreachable


  return null;
}
function doesFiberContain(parentFiber, childFiber) {
  var node = childFiber;
  var parentFiberAlternate = parentFiber.alternate;

  while (node !== null) {
    if (node === parentFiber || node === parentFiberAlternate) {
      return true;
    }

    node = node.return;
  }

  return false;
}

var attemptUserBlockingHydration;
function setAttemptUserBlockingHydration(fn) {
  attemptUserBlockingHydration = fn;
}
var attemptContinuousHydration;
function setAttemptContinuousHydration(fn) {
  attemptContinuousHydration = fn;
}
var attemptHydrationAtCurrentPriority;
function setAttemptHydrationAtCurrentPriority(fn) {
  attemptHydrationAtCurrentPriority = fn;
}
var attemptHydrationAtPriority;
function setAttemptHydrationAtPriority(fn) {
  attemptHydrationAtPriority = fn;
} // TODO: Upgrade this definition once we're on a newer version of Flow that
var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.

var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.
// if the last target was dehydrated.

var queuedFocus = null;
var queuedDrag = null;
var queuedMouse = null; // For pointer events there can be one latest event per pointerId.

var queuedPointers = new Map();
var queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.

var queuedExplicitHydrationTargets = [];
function hasQueuedDiscreteEvents() {
  return queuedDiscreteEvents.length > 0;
}
var discreteReplayableEvents = ['mousedown', 'mouseup', 'touchcancel', 'touchend', 'touchstart', 'auxclick', 'dblclick', 'pointercancel', 'pointerdown', 'pointerup', 'dragend', 'dragstart', 'drop', 'compositionend', 'compositionstart', 'keydown', 'keypress', 'keyup', 'input', 'textInput', // Intentionally camelCase
'copy', 'cut', 'paste', 'click', 'change', 'contextmenu', 'reset', 'submit'];
function isReplayableDiscreteEvent(eventType) {
  return discreteReplayableEvents.indexOf(eventType) > -1;
}

function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  return {
    blockedOn: blockedOn,
    domEventName: domEventName,
    eventSystemFlags: eventSystemFlags | IS_REPLAYED,
    nativeEvent: nativeEvent,
    targetContainers: [targetContainer]
  };
}

function queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
  queuedDiscreteEvents.push(queuedEvent);
} // Resets the replaying for this type of continuous event to no event.

function clearIfContinuousEvent(domEventName, nativeEvent) {
  switch (domEventName) {
    case 'focusin':
    case 'focusout':
      queuedFocus = null;
      break;

    case 'dragenter':
    case 'dragleave':
      queuedDrag = null;
      break;

    case 'mouseover':
    case 'mouseout':
      queuedMouse = null;
      break;

    case 'pointerover':
    case 'pointerout':
      {
        var pointerId = nativeEvent.pointerId;
        queuedPointers.delete(pointerId);
        break;
      }

    case 'gotpointercapture':
    case 'lostpointercapture':
      {
        var _pointerId = nativeEvent.pointerId;
        queuedPointerCaptures.delete(_pointerId);
        break;
      }
  }
}

function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
    var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);

    if (blockedOn !== null) {
      var _fiber2 = getInstanceFromNode(blockedOn);

      if (_fiber2 !== null) {
        // Attempt to increase the priority of this target.
        attemptContinuousHydration(_fiber2);
      }
    }

    return queuedEvent;
  } // If we have already queued this exact event, then it's because
  // the different event systems have different DOM event listeners.
  // We can accumulate the flags, and the targetContainers, and
  // store a single event to be replayed.


  existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
  var targetContainers = existingQueuedEvent.targetContainers;

  if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
    targetContainers.push(targetContainer);
  }

  return existingQueuedEvent;
}

function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  // These set relatedTarget to null because the replayed event will be treated as if we
  // moved from outside the window (no target) onto the target once it hydrates.
  // Instead of mutating we could clone the event.
  switch (domEventName) {
    case 'focusin':
      {
        var focusEvent = nativeEvent;
        queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
        return true;
      }

    case 'dragenter':
      {
        var dragEvent = nativeEvent;
        queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
        return true;
      }

    case 'mouseover':
      {
        var mouseEvent = nativeEvent;
        queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
        return true;
      }

    case 'pointerover':
      {
        var pointerEvent = nativeEvent;
        var pointerId = pointerEvent.pointerId;
        queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
        return true;
      }

    case 'gotpointercapture':
      {
        var _pointerEvent = nativeEvent;
        var _pointerId2 = _pointerEvent.pointerId;
        queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
        return true;
      }
  }

  return false;
} // Check if this target is unblocked. Returns true if it's unblocked.

function attemptExplicitHydrationTarget(queuedTarget) {
  // TODO: This function shares a lot of logic with attemptToDispatchEvent.
  // Try to unify them. It's a bit tricky since it would require two return
  // values.
  var targetInst = getClosestInstanceFromNode(queuedTarget.target);

  if (targetInst !== null) {
    var nearestMounted = getNearestMountedFiber(targetInst);

    if (nearestMounted !== null) {
      var tag = nearestMounted.tag;

      if (tag === SuspenseComponent) {
        var instance = getSuspenseInstanceFromFiber(nearestMounted);

        if (instance !== null) {
          // We're blocked on hydrating this boundary.
          // Increase its priority.
          queuedTarget.blockedOn = instance;
          attemptHydrationAtPriority(queuedTarget.lanePriority, function () {
            Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {
              attemptHydrationAtCurrentPriority(nearestMounted);
            });
          });
          return;
        }
      } else if (tag === HostRoot) {
        var root = nearestMounted.stateNode;

        if (root.hydrate) {
          queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of
          // a root other than sync.

          return;
        }
      }
    }
  }

  queuedTarget.blockedOn = null;
}

function attemptReplayContinuousQueuedEvent(queuedEvent) {
  if (queuedEvent.blockedOn !== null) {
    return false;
  }

  var targetContainers = queuedEvent.targetContainers;

  while (targetContainers.length > 0) {
    var targetContainer = targetContainers[0];
    var nextBlockedOn = attemptToDispatchEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);

    if (nextBlockedOn !== null) {
      // We're still blocked. Try again later.
      var _fiber3 = getInstanceFromNode(nextBlockedOn);

      if (_fiber3 !== null) {
        attemptContinuousHydration(_fiber3);
      }

      queuedEvent.blockedOn = nextBlockedOn;
      return false;
    } // This target container was successfully dispatched. Try the next.


    targetContainers.shift();
  }

  return true;
}

function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
  if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
    map.delete(key);
  }
}

function replayUnblockedEvents() {
  hasScheduledReplayAttempt = false; // First replay discrete events.

  while (queuedDiscreteEvents.length > 0) {
    var nextDiscreteEvent = queuedDiscreteEvents[0];

    if (nextDiscreteEvent.blockedOn !== null) {
      // We're still blocked.
      // Increase the priority of this boundary to unblock
      // the next discrete event.
      var _fiber4 = getInstanceFromNode(nextDiscreteEvent.blockedOn);

      if (_fiber4 !== null) {
        attemptUserBlockingHydration(_fiber4);
      }

      break;
    }

    var targetContainers = nextDiscreteEvent.targetContainers;

    while (targetContainers.length > 0) {
      var targetContainer = targetContainers[0];
      var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.domEventName, nextDiscreteEvent.eventSystemFlags, targetContainer, nextDiscreteEvent.nativeEvent);

      if (nextBlockedOn !== null) {
        // We're still blocked. Try again later.
        nextDiscreteEvent.blockedOn = nextBlockedOn;
        break;
      } // This target container was successfully dispatched. Try the next.


      targetContainers.shift();
    }

    if (nextDiscreteEvent.blockedOn === null) {
      // We've successfully replayed the first event. Let's try the next one.
      queuedDiscreteEvents.shift();
    }
  } // Next replay any continuous events.


  if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
    queuedFocus = null;
  }

  if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
    queuedDrag = null;
  }

  if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
    queuedMouse = null;
  }

  queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
  queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
}

function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
  if (queuedEvent.blockedOn === unblocked) {
    queuedEvent.blockedOn = null;

    if (!hasScheduledReplayAttempt) {
      hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are
      // now unblocked. This first might not actually be unblocked yet.
      // We could check it early to avoid scheduling an unnecessary callback.

      Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
    }
  }
}

function retryIfBlockedOn(unblocked) {
  // Mark anything that was blocked on this as no longer blocked
  // and eligible for a replay.
  if (queuedDiscreteEvents.length > 0) {
    scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's
    // worth it because we expect very few discrete events to queue up and once
    // we are actually fully unblocked it will be fast to replay them.

    for (var i = 1; i < queuedDiscreteEvents.length; i++) {
      var queuedEvent = queuedDiscreteEvents[i];

      if (queuedEvent.blockedOn === unblocked) {
        queuedEvent.blockedOn = null;
      }
    }
  }

  if (queuedFocus !== null) {
    scheduleCallbackIfUnblocked(queuedFocus, unblocked);
  }

  if (queuedDrag !== null) {
    scheduleCallbackIfUnblocked(queuedDrag, unblocked);
  }

  if (queuedMouse !== null) {
    scheduleCallbackIfUnblocked(queuedMouse, unblocked);
  }

  var unblock = function (queuedEvent) {
    return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
  };

  queuedPointers.forEach(unblock);
  queuedPointerCaptures.forEach(unblock);

  for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
    var queuedTarget = queuedExplicitHydrationTargets[_i];

    if (queuedTarget.blockedOn === unblocked) {
      queuedTarget.blockedOn = null;
    }
  }

  while (queuedExplicitHydrationTargets.length > 0) {
    var nextExplicitTarget = queuedExplicitHydrationTargets[0];

    if (nextExplicitTarget.blockedOn !== null) {
      // We're still blocked.
      break;
    } else {
      attemptExplicitHydrationTarget(nextExplicitTarget);

      if (nextExplicitTarget.blockedOn === null) {
        // We're unblocked.
        queuedExplicitHydrationTargets.shift();
      }
    }
  }
}

var DiscreteEvent = 0;
var UserBlockingEvent = 1;
var ContinuousEvent = 2;

/**
 * Generate a mapping of standard vendor prefixes using the defined style property and event name.
 *
 * @param {string} styleProp
 * @param {string} eventName
 * @returns {object}
 */

function makePrefixMap(styleProp, eventName) {
  var prefixes = {};
  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  prefixes['Webkit' + styleProp] = 'webkit' + eventName;
  prefixes['Moz' + styleProp] = 'moz' + eventName;
  return prefixes;
}
/**
 * A list of event names to a configurable list of vendor prefixes.
 */


var vendorPrefixes = {
  animationend: makePrefixMap('Animation', 'AnimationEnd'),
  animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
  animationstart: makePrefixMap('Animation', 'AnimationStart'),
  transitionend: makePrefixMap('Transition', 'TransitionEnd')
};
/**
 * Event names that have already been detected and prefixed (if applicable).
 */

var prefixedEventNames = {};
/**
 * Element to check for prefixes on.
 */

var style = {};
/**
 * Bootstrap if a DOM exists.
 */

if (canUseDOM) {
  style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,
  // the un-prefixed "animation" and "transition" properties are defined on the
  // style object but the events that fire will still be prefixed, so we need
  // to check if the un-prefixed events are usable, and if not remove them from the map.

  if (!('AnimationEvent' in window)) {
    delete vendorPrefixes.animationend.animation;
    delete vendorPrefixes.animationiteration.animation;
    delete vendorPrefixes.animationstart.animation;
  } // Same as above


  if (!('TransitionEvent' in window)) {
    delete vendorPrefixes.transitionend.transition;
  }
}
/**
 * Attempts to determine the correct vendor prefixed event name.
 *
 * @param {string} eventName
 * @returns {string}
 */


function getVendorPrefixedEventName(eventName) {
  if (prefixedEventNames[eventName]) {
    return prefixedEventNames[eventName];
  } else if (!vendorPrefixes[eventName]) {
    return eventName;
  }

  var prefixMap = vendorPrefixes[eventName];

  for (var styleProp in prefixMap) {
    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
      return prefixedEventNames[eventName] = prefixMap[styleProp];
    }
  }

  return eventName;
}

var ANIMATION_END = getVendorPrefixedEventName('animationend');
var ANIMATION_ITERATION = getVendorPrefixedEventName('animationiteration');
var ANIMATION_START = getVendorPrefixedEventName('animationstart');
var TRANSITION_END = getVendorPrefixedEventName('transitionend');

var topLevelEventsToReactNames = new Map();
var eventPriorities = new Map(); // We store most of the events in this module in pairs of two strings so we can re-use
// the code required to apply the same logic for event prioritization and that of the
// SimpleEventPlugin. This complicates things slightly, but the aim is to reduce code
// duplication (for which there would be quite a bit). For the events that are not needed
// for the SimpleEventPlugin (otherDiscreteEvents) we process them separately as an
// array of top level events.
// Lastly, we ignore prettier so we can keep the formatting sane.
// prettier-ignore

var discreteEventPairsForSimpleEventPlugin = ['cancel', 'cancel', 'click', 'click', 'close', 'close', 'contextmenu', 'contextMenu', 'copy', 'copy', 'cut', 'cut', 'auxclick', 'auxClick', 'dblclick', 'doubleClick', // Careful!
'dragend', 'dragEnd', 'dragstart', 'dragStart', 'drop', 'drop', 'focusin', 'focus', // Careful!
'focusout', 'blur', // Careful!
'input', 'input', 'invalid', 'invalid', 'keydown', 'keyDown', 'keypress', 'keyPress', 'keyup', 'keyUp', 'mousedown', 'mouseDown', 'mouseup', 'mouseUp', 'paste', 'paste', 'pause', 'pause', 'play', 'play', 'pointercancel', 'pointerCancel', 'pointerdown', 'pointerDown', 'pointerup', 'pointerUp', 'ratechange', 'rateChange', 'reset', 'reset', 'seeked', 'seeked', 'submit', 'submit', 'touchcancel', 'touchCancel', 'touchend', 'touchEnd', 'touchstart', 'touchStart', 'volumechange', 'volumeChange'];
var otherDiscreteEvents = ['change', 'selectionchange', 'textInput', 'compositionstart', 'compositionend', 'compositionupdate'];


var userBlockingPairsForSimpleEventPlugin = ['drag', 'drag', 'dragenter', 'dragEnter', 'dragexit', 'dragExit', 'dragleave', 'dragLeave', 'dragover', 'dragOver', 'mousemove', 'mouseMove', 'mouseout', 'mouseOut', 'mouseover', 'mouseOver', 'pointermove', 'pointerMove', 'pointerout', 'pointerOut', 'pointerover', 'pointerOver', 'scroll', 'scroll', 'toggle', 'toggle', 'touchmove', 'touchMove', 'wheel', 'wheel']; // prettier-ignore

var continuousPairsForSimpleEventPlugin = ['abort', 'abort', ANIMATION_END, 'animationEnd', ANIMATION_ITERATION, 'animationIteration', ANIMATION_START, 'animationStart', 'canplay', 'canPlay', 'canplaythrough', 'canPlayThrough', 'durationchange', 'durationChange', 'emptied', 'emptied', 'encrypted', 'encrypted', 'ended', 'ended', 'error', 'error', 'gotpointercapture', 'gotPointerCapture', 'load', 'load', 'loadeddata', 'loadedData', 'loadedmetadata', 'loadedMetadata', 'loadstart', 'loadStart', 'lostpointercapture', 'lostPointerCapture', 'playing', 'playing', 'progress', 'progress', 'seeking', 'seeking', 'stalled', 'stalled', 'suspend', 'suspend', 'timeupdate', 'timeUpdate', TRANSITION_END, 'transitionEnd', 'waiting', 'waiting'];
/**
 * Turns
 * ['abort', ...]
 *
 * into
 *
 * topLevelEventsToReactNames = new Map([
 *   ['abort', 'onAbort'],
 * ]);
 *
 * and registers them.
 */

function registerSimplePluginEventsAndSetTheirPriorities(eventTypes, priority) {
  // As the event types are in pairs of two, we need to iterate
  // through in twos. The events are in pairs of two to save code
  // and improve init perf of processing this array, as it will
  // result in far fewer object allocations and property accesses
  // if we only use three arrays to process all the categories of
  // instead of tuples.
  for (var i = 0; i < eventTypes.length; i += 2) {
    var topEvent = eventTypes[i];
    var event = eventTypes[i + 1];
    var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
    var reactName = 'on' + capitalizedEvent;
    eventPriorities.set(topEvent, priority);
    topLevelEventsToReactNames.set(topEvent, reactName);
    registerTwoPhaseEvent(reactName, [topEvent]);
  }
}

function setEventPriorities(eventTypes, priority) {
  for (var i = 0; i < eventTypes.length; i++) {
    eventPriorities.set(eventTypes[i], priority);
  }
}

function getEventPriorityForPluginSystem(domEventName) {
  var priority = eventPriorities.get(domEventName); // Default to a ContinuousEvent. Note: we might
  // want to warn if we can't detect the priority
  // for the event.

  return priority === undefined ? ContinuousEvent : priority;
}
function registerSimpleEvents() {
  registerSimplePluginEventsAndSetTheirPriorities(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);
  registerSimplePluginEventsAndSetTheirPriorities(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);
  registerSimplePluginEventsAndSetTheirPriorities(continuousPairsForSimpleEventPlugin, ContinuousEvent);
  setEventPriorities(otherDiscreteEvents, DiscreteEvent);
}

var Scheduler_now = Scheduler.unstable_now;

{
  // Provide explicit error message when production+profiling bundle of e.g.
  // react-dom is used with production (non-profiling) bundle of
  // scheduler/tracing
  if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
    {
      throw Error( "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" );
    }
  }
}
// ascending numbers so we can compare them like numbers. They start at 90 to
// avoid clashing with Scheduler's priorities.

var ImmediatePriority = 99;
var UserBlockingPriority = 98;
var NormalPriority = 97;
var LowPriority = 96;
var IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.

var NoPriority = 90;
var initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.

var SyncLanePriority = 15;
var SyncBatchedLanePriority = 14;
var InputDiscreteHydrationLanePriority = 13;
var InputDiscreteLanePriority = 12;
var InputContinuousHydrationLanePriority = 11;
var InputContinuousLanePriority = 10;
var DefaultHydrationLanePriority = 9;
var DefaultLanePriority = 8;
var TransitionHydrationPriority = 7;
var TransitionPriority = 6;
var RetryLanePriority = 5;
var SelectiveHydrationLanePriority = 4;
var IdleHydrationLanePriority = 3;
var IdleLanePriority = 2;
var OffscreenLanePriority = 1;
var NoLanePriority = 0;
var TotalLanes = 31;
var NoLanes =
/*                        */
0;
var NoLane =
/*                          */
0;
var SyncLane =
/*                        */
1;
var SyncBatchedLane =
/*                 */
2;
var InputDiscreteHydrationLane =
/*      */
4;
var InputDiscreteLanes =
/*                    */
24;
var InputContinuousHydrationLane =
/*           */
32;
var InputContinuousLanes =
/*                  */
192;
var DefaultHydrationLane =
/*            */
256;
var DefaultLanes =
/*                   */
3584;
var TransitionHydrationLane =
/*                */
4096;
var TransitionLanes =
/*                       */
4186112;
var RetryLanes =
/*                            */
62914560;
var SomeRetryLane =
/*                  */
33554432;
var SelectiveHydrationLane =
/*          */
67108864;
var NonIdleLanes =
/*                                 */
134217727;
var IdleHydrationLane =
/*               */
134217728;
var IdleLanes =
/*                             */
805306368;
var OffscreenLane =
/*                   */
1073741824;
var NoTimestamp = -1;
function setCurrentUpdateLanePriority(newLanePriority) {
} // "Registers" used to "return" multiple values
// Used by getHighestPriorityLanes and getNextLanes:

var return_highestLanePriority = DefaultLanePriority;

function getHighestPriorityLanes(lanes) {
  if ((SyncLane & lanes) !== NoLanes) {
    return_highestLanePriority = SyncLanePriority;
    return SyncLane;
  }

  if ((SyncBatchedLane & lanes) !== NoLanes) {
    return_highestLanePriority = SyncBatchedLanePriority;
    return SyncBatchedLane;
  }

  if ((InputDiscreteHydrationLane & lanes) !== NoLanes) {
    return_highestLanePriority = InputDiscreteHydrationLanePriority;
    return InputDiscreteHydrationLane;
  }

  var inputDiscreteLanes = InputDiscreteLanes & lanes;

  if (inputDiscreteLanes !== NoLanes) {
    return_highestLanePriority = InputDiscreteLanePriority;
    return inputDiscreteLanes;
  }

  if ((lanes & InputContinuousHydrationLane) !== NoLanes) {
    return_highestLanePriority = InputContinuousHydrationLanePriority;
    return InputContinuousHydrationLane;
  }

  var inputContinuousLanes = InputContinuousLanes & lanes;

  if (inputContinuousLanes !== NoLanes) {
    return_highestLanePriority = InputContinuousLanePriority;
    return inputContinuousLanes;
  }

  if ((lanes & DefaultHydrationLane) !== NoLanes) {
    return_highestLanePriority = DefaultHydrationLanePriority;
    return DefaultHydrationLane;
  }

  var defaultLanes = DefaultLanes & lanes;

  if (defaultLanes !== NoLanes) {
    return_highestLanePriority = DefaultLanePriority;
    return defaultLanes;
  }

  if ((lanes & TransitionHydrationLane) !== NoLanes) {
    return_highestLanePriority = TransitionHydrationPriority;
    return TransitionHydrationLane;
  }

  var transitionLanes = TransitionLanes & lanes;

  if (transitionLanes !== NoLanes) {
    return_highestLanePriority = TransitionPriority;
    return transitionLanes;
  }

  var retryLanes = RetryLanes & lanes;

  if (retryLanes !== NoLanes) {
    return_highestLanePriority = RetryLanePriority;
    return retryLanes;
  }

  if (lanes & SelectiveHydrationLane) {
    return_highestLanePriority = SelectiveHydrationLanePriority;
    return SelectiveHydrationLane;
  }

  if ((lanes & IdleHydrationLane) !== NoLanes) {
    return_highestLanePriority = IdleHydrationLanePriority;
    return IdleHydrationLane;
  }

  var idleLanes = IdleLanes & lanes;

  if (idleLanes !== NoLanes) {
    return_highestLanePriority = IdleLanePriority;
    return idleLanes;
  }

  if ((OffscreenLane & lanes) !== NoLanes) {
    return_highestLanePriority = OffscreenLanePriority;
    return OffscreenLane;
  }

  {
    error('Should have found matching lanes. This is a bug in React.');
  } // This shouldn't be reachable, but as a fallback, return the entire bitmask.


  return_highestLanePriority = DefaultLanePriority;
  return lanes;
}

function schedulerPriorityToLanePriority(schedulerPriorityLevel) {
  switch (schedulerPriorityLevel) {
    case ImmediatePriority:
      return SyncLanePriority;

    case UserBlockingPriority:
      return InputContinuousLanePriority;

    case NormalPriority:
    case LowPriority:
      // TODO: Handle LowSchedulerPriority, somehow. Maybe the same lane as hydration.
      return DefaultLanePriority;

    case IdlePriority:
      return IdleLanePriority;

    default:
      return NoLanePriority;
  }
}
function lanePriorityToSchedulerPriority(lanePriority) {
  switch (lanePriority) {
    case SyncLanePriority:
    case SyncBatchedLanePriority:
      return ImmediatePriority;

    case InputDiscreteHydrationLanePriority:
    case InputDiscreteLanePriority:
    case InputContinuousHydrationLanePriority:
    case InputContinuousLanePriority:
      return UserBlockingPriority;

    case DefaultHydrationLanePriority:
    case DefaultLanePriority:
    case TransitionHydrationPriority:
    case TransitionPriority:
    case SelectiveHydrationLanePriority:
    case RetryLanePriority:
      return NormalPriority;

    case IdleHydrationLanePriority:
    case IdleLanePriority:
    case OffscreenLanePriority:
      return IdlePriority;

    case NoLanePriority:
      return NoPriority;

    default:
      {
        {
          throw Error( "Invalid update priority: " + lanePriority + ". This is a bug in React." );
        }
      }

  }
}
function getNextLanes(root, wipLanes) {
  // Early bailout if there's no pending work left.
  var pendingLanes = root.pendingLanes;

  if (pendingLanes === NoLanes) {
    return_highestLanePriority = NoLanePriority;
    return NoLanes;
  }

  var nextLanes = NoLanes;
  var nextLanePriority = NoLanePriority;
  var expiredLanes = root.expiredLanes;
  var suspendedLanes = root.suspendedLanes;
  var pingedLanes = root.pingedLanes; // Check if any work has expired.

  if (expiredLanes !== NoLanes) {
    nextLanes = expiredLanes;
    nextLanePriority = return_highestLanePriority = SyncLanePriority;
  } else {
    // Do not work on any idle work until all the non-idle work has finished,
    // even if the work is suspended.
    var nonIdlePendingLanes = pendingLanes & NonIdleLanes;

    if (nonIdlePendingLanes !== NoLanes) {
      var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;

      if (nonIdleUnblockedLanes !== NoLanes) {
        nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
        nextLanePriority = return_highestLanePriority;
      } else {
        var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;

        if (nonIdlePingedLanes !== NoLanes) {
          nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
          nextLanePriority = return_highestLanePriority;
        }
      }
    } else {
      // The only remaining work is Idle.
      var unblockedLanes = pendingLanes & ~suspendedLanes;

      if (unblockedLanes !== NoLanes) {
        nextLanes = getHighestPriorityLanes(unblockedLanes);
        nextLanePriority = return_highestLanePriority;
      } else {
        if (pingedLanes !== NoLanes) {
          nextLanes = getHighestPriorityLanes(pingedLanes);
          nextLanePriority = return_highestLanePriority;
        }
      }
    }
  }

  if (nextLanes === NoLanes) {
    // This should only be reachable if we're suspended
    // TODO: Consider warning in this path if a fallback timer is not scheduled.
    return NoLanes;
  } // If there are higher priority lanes, we'll include them even if they
  // are suspended.


  nextLanes = pendingLanes & getEqualOrHigherPriorityLanes(nextLanes); // If we're already in the middle of a render, switching lanes will interrupt
  // it and we'll lose our progress. We should only do this if the new lanes are
  // higher priority.

  if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't
  // bother waiting until the root is complete.
  (wipLanes & suspendedLanes) === NoLanes) {
    getHighestPriorityLanes(wipLanes);
    var wipLanePriority = return_highestLanePriority;

    if (nextLanePriority <= wipLanePriority) {
      return wipLanes;
    } else {
      return_highestLanePriority = nextLanePriority;
    }
  } // Check for entangled lanes and add them to the batch.
  //
  // A lane is said to be entangled with another when it's not allowed to render
  // in a batch that does not also include the other lane. Typically we do this
  // when multiple updates have the same source, and we only want to respond to
  // the most recent event from that source.
  //
  // Note that we apply entanglements *after* checking for partial work above.
  // This means that if a lane is entangled during an interleaved event while
  // it's already rendering, we won't interrupt it. This is intentional, since
  // entanglement is usually "best effort": we'll try our best to render the
  // lanes in the same batch, but it's not worth throwing out partially
  // completed work in order to do it.
  //
  // For those exceptions where entanglement is semantically important, like
  // useMutableSource, we should ensure that there is no partial work at the
  // time we apply the entanglement.


  var entangledLanes = root.entangledLanes;

  if (entangledLanes !== NoLanes) {
    var entanglements = root.entanglements;
    var lanes = nextLanes & entangledLanes;

    while (lanes > 0) {
      var index = pickArbitraryLaneIndex(lanes);
      var lane = 1 << index;
      nextLanes |= entanglements[index];
      lanes &= ~lane;
    }
  }

  return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
  var eventTimes = root.eventTimes;
  var mostRecentEventTime = NoTimestamp;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    var eventTime = eventTimes[index];

    if (eventTime > mostRecentEventTime) {
      mostRecentEventTime = eventTime;
    }

    lanes &= ~lane;
  }

  return mostRecentEventTime;
}

function computeExpirationTime(lane, currentTime) {
  // TODO: Expiration heuristic is constant per lane, so could use a map.
  getHighestPriorityLanes(lane);
  var priority = return_highestLanePriority;

  if (priority >= InputContinuousLanePriority) {
    // User interactions should expire slightly more quickly.
    //
    // NOTE: This is set to the corresponding constant as in Scheduler.js. When
    // we made it larger, a product metric in www regressed, suggesting there's
    // a user interaction that's being starved by a series of synchronous
    // updates. If that theory is correct, the proper solution is to fix the
    // starvation. However, this scenario supports the idea that expiration
    // times are an important safeguard when starvation does happen.
    //
    // Also note that, in the case of user input specifically, this will soon no
    // longer be an issue because we plan to make user input synchronous by
    // default (until you enter `startTransition`, of course.)
    //
    // If weren't planning to make these updates synchronous soon anyway, I
    // would probably make this number a configurable parameter.
    return currentTime + 250;
  } else if (priority >= TransitionPriority) {
    return currentTime + 5000;
  } else {
    // Anything idle priority or lower should never expire.
    return NoTimestamp;
  }
}

function markStarvedLanesAsExpired(root, currentTime) {
  // TODO: This gets called every time we yield. We can optimize by storing
  // the earliest expiration time on the root. Then use that to quickly bail out
  // of this function.
  var pendingLanes = root.pendingLanes;
  var suspendedLanes = root.suspendedLanes;
  var pingedLanes = root.pingedLanes;
  var expirationTimes = root.expirationTimes; // Iterate through the pending lanes and check if we've reached their
  // expiration time. If so, we'll assume the update is being starved and mark
  // it as expired to force it to finish.

  var lanes = pendingLanes;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    var expirationTime = expirationTimes[index];

    if (expirationTime === NoTimestamp) {
      // Found a pending lane with no expiration time. If it's not suspended, or
      // if it's pinged, assume it's CPU-bound. Compute a new expiration time
      // using the current time.
      if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
        // Assumes timestamps are monotonically increasing.
        expirationTimes[index] = computeExpirationTime(lane, currentTime);
      }
    } else if (expirationTime <= currentTime) {
      // This lane expired
      root.expiredLanes |= lane;
    }

    lanes &= ~lane;
  }
} // This returns the highest priority pending lanes regardless of whether they
function getLanesToRetrySynchronouslyOnError(root) {
  var everythingButOffscreen = root.pendingLanes & ~OffscreenLane;

  if (everythingButOffscreen !== NoLanes) {
    return everythingButOffscreen;
  }

  if (everythingButOffscreen & OffscreenLane) {
    return OffscreenLane;
  }

  return NoLanes;
}
function returnNextLanesPriority() {
  return return_highestLanePriority;
}
function includesNonIdleWork(lanes) {
  return (lanes & NonIdleLanes) !== NoLanes;
}
function includesOnlyRetries(lanes) {
  return (lanes & RetryLanes) === lanes;
}
function includesOnlyTransitions(lanes) {
  return (lanes & TransitionLanes) === lanes;
} // To ensure consistency across multiple updates in the same event, this should
// be a pure function, so that it always returns the same lane for given inputs.

function findUpdateLane(lanePriority, wipLanes) {
  switch (lanePriority) {
    case NoLanePriority:
      break;

    case SyncLanePriority:
      return SyncLane;

    case SyncBatchedLanePriority:
      return SyncBatchedLane;

    case InputDiscreteLanePriority:
      {
        var _lane = pickArbitraryLane(InputDiscreteLanes & ~wipLanes);

        if (_lane === NoLane) {
          // Shift to the next priority level
          return findUpdateLane(InputContinuousLanePriority, wipLanes);
        }

        return _lane;
      }

    case InputContinuousLanePriority:
      {
        var _lane2 = pickArbitraryLane(InputContinuousLanes & ~wipLanes);

        if (_lane2 === NoLane) {
          // Shift to the next priority level
          return findUpdateLane(DefaultLanePriority, wipLanes);
        }

        return _lane2;
      }

    case DefaultLanePriority:
      {
        var _lane3 = pickArbitraryLane(DefaultLanes & ~wipLanes);

        if (_lane3 === NoLane) {
          // If all the default lanes are already being worked on, look for a
          // lane in the transition range.
          _lane3 = pickArbitraryLane(TransitionLanes & ~wipLanes);

          if (_lane3 === NoLane) {
            // All the transition lanes are taken, too. This should be very
            // rare, but as a last resort, pick a default lane. This will have
            // the effect of interrupting the current work-in-progress render.
            _lane3 = pickArbitraryLane(DefaultLanes);
          }
        }

        return _lane3;
      }

    case TransitionPriority: // Should be handled by findTransitionLane instead

    case RetryLanePriority:
      // Should be handled by findRetryLane instead
      break;

    case IdleLanePriority:
      var lane = pickArbitraryLane(IdleLanes & ~wipLanes);

      if (lane === NoLane) {
        lane = pickArbitraryLane(IdleLanes);
      }

      return lane;
  }

  {
    {
      throw Error( "Invalid update priority: " + lanePriority + ". This is a bug in React." );
    }
  }
} // To ensure consistency across multiple updates in the same event, this should
// be pure function, so that it always returns the same lane for given inputs.

function findTransitionLane(wipLanes, pendingLanes) {
  // First look for lanes that are completely unclaimed, i.e. have no
  // pending work.
  var lane = pickArbitraryLane(TransitionLanes & ~pendingLanes);

  if (lane === NoLane) {
    // If all lanes have pending work, look for a lane that isn't currently
    // being worked on.
    lane = pickArbitraryLane(TransitionLanes & ~wipLanes);

    if (lane === NoLane) {
      // If everything is being worked on, pick any lane. This has the
      // effect of interrupting the current work-in-progress.
      lane = pickArbitraryLane(TransitionLanes);
    }
  }

  return lane;
} // To ensure consistency across multiple updates in the same event, this should
// be pure function, so that it always returns the same lane for given inputs.

function findRetryLane(wipLanes) {
  // This is a fork of `findUpdateLane` designed specifically for Suspense
  // "retries" — a special update that attempts to flip a Suspense boundary
  // from its placeholder state to its primary/resolved state.
  var lane = pickArbitraryLane(RetryLanes & ~wipLanes);

  if (lane === NoLane) {
    lane = pickArbitraryLane(RetryLanes);
  }

  return lane;
}

function getHighestPriorityLane(lanes) {
  return lanes & -lanes;
}

function getLowestPriorityLane(lanes) {
  // This finds the most significant non-zero bit.
  var index = 31 - clz32(lanes);
  return index < 0 ? NoLanes : 1 << index;
}

function getEqualOrHigherPriorityLanes(lanes) {
  return (getLowestPriorityLane(lanes) << 1) - 1;
}

function pickArbitraryLane(lanes) {
  // This wrapper function gets inlined. Only exists so to communicate that it
  // doesn't matter which bit is selected; you can pick any bit without
  // affecting the algorithms where its used. Here I'm using
  // getHighestPriorityLane because it requires the fewest operations.
  return getHighestPriorityLane(lanes);
}

function pickArbitraryLaneIndex(lanes) {
  return 31 - clz32(lanes);
}

function laneToIndex(lane) {
  return pickArbitraryLaneIndex(lane);
}

function includesSomeLane(a, b) {
  return (a & b) !== NoLanes;
}
function isSubsetOfLanes(set, subset) {
  return (set & subset) === subset;
}
function mergeLanes(a, b) {
  return a | b;
}
function removeLanes(set, subset) {
  return set & ~subset;
} // Seems redundant, but it changes the type from a single lane (used for
// updates) to a group of lanes (used for flushing work).

function laneToLanes(lane) {
  return lane;
}
function higherPriorityLane(a, b) {
  // This works because the bit ranges decrease in priority as you go left.
  return a !== NoLane && a < b ? a : b;
}
function createLaneMap(initial) {
  // Intentionally pushing one by one.
  // https://v8.dev/blog/elements-kinds#avoid-creating-holes
  var laneMap = [];

  for (var i = 0; i < TotalLanes; i++) {
    laneMap.push(initial);
  }

  return laneMap;
}
function markRootUpdated(root, updateLane, eventTime) {
  root.pendingLanes |= updateLane; // TODO: Theoretically, any update to any lane can unblock any other lane. But
  // it's not practical to try every single possible combination. We need a
  // heuristic to decide which lanes to attempt to render, and in which batches.
  // For now, we use the same heuristic as in the old ExpirationTimes model:
  // retry any lane at equal or lower priority, but don't try updates at higher
  // priority without also including the lower priority updates. This works well
  // when considering updates across different priority levels, but isn't
  // sufficient for updates within the same priority, since we want to treat
  // those updates as parallel.
  // Unsuspend any update at equal or lower priority.

  var higherPriorityLanes = updateLane - 1; // Turns 0b1000 into 0b0111

  root.suspendedLanes &= higherPriorityLanes;
  root.pingedLanes &= higherPriorityLanes;
  var eventTimes = root.eventTimes;
  var index = laneToIndex(updateLane); // We can always overwrite an existing timestamp because we prefer the most
  // recent event, and we assume time is monotonically increasing.

  eventTimes[index] = eventTime;
}
function markRootSuspended(root, suspendedLanes) {
  root.suspendedLanes |= suspendedLanes;
  root.pingedLanes &= ~suspendedLanes; // The suspended lanes are no longer CPU-bound. Clear their expiration times.

  var expirationTimes = root.expirationTimes;
  var lanes = suspendedLanes;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    expirationTimes[index] = NoTimestamp;
    lanes &= ~lane;
  }
}
function markRootPinged(root, pingedLanes, eventTime) {
  root.pingedLanes |= root.suspendedLanes & pingedLanes;
}
function markDiscreteUpdatesExpired(root) {
  root.expiredLanes |= InputDiscreteLanes & root.pendingLanes;
}
function hasDiscreteLanes(lanes) {
  return (lanes & InputDiscreteLanes) !== NoLanes;
}
function markRootMutableRead(root, updateLane) {
  root.mutableReadLanes |= updateLane & root.pendingLanes;
}
function markRootFinished(root, remainingLanes) {
  var noLongerPendingLanes = root.pendingLanes & ~remainingLanes;
  root.pendingLanes = remainingLanes; // Let's try everything again

  root.suspendedLanes = 0;
  root.pingedLanes = 0;
  root.expiredLanes &= remainingLanes;
  root.mutableReadLanes &= remainingLanes;
  root.entangledLanes &= remainingLanes;
  var entanglements = root.entanglements;
  var eventTimes = root.eventTimes;
  var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work

  var lanes = noLongerPendingLanes;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    entanglements[index] = NoLanes;
    eventTimes[index] = NoTimestamp;
    expirationTimes[index] = NoTimestamp;
    lanes &= ~lane;
  }
}
function markRootEntangled(root, entangledLanes) {
  root.entangledLanes |= entangledLanes;
  var entanglements = root.entanglements;
  var lanes = entangledLanes;

  while (lanes > 0) {
    var index = pickArbitraryLaneIndex(lanes);
    var lane = 1 << index;
    entanglements[index] |= entangledLanes;
    lanes &= ~lane;
  }
}
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros. Only used on lanes, so assume input is an integer.
// Based on:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32

var log = Math.log;
var LN2 = Math.LN2;

function clz32Fallback(lanes) {
  if (lanes === 0) {
    return 32;
  }

  return 31 - (log(lanes) / LN2 | 0) | 0;
}

// Intentionally not named imports because Rollup would use dynamic dispatch for
var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority,
    runWithPriority = Scheduler.unstable_runWithPriority; // TODO: can we stop exporting these?

var _enabled = true; // This is exported in FB builds for use by legacy FB layer infra.
// We'd like to remove this but it's not clear if this is safe.

function setEnabled(enabled) {
  _enabled = !!enabled;
}
function isEnabled() {
  return _enabled;
}
function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
  var eventPriority = getEventPriorityForPluginSystem(domEventName);
  var listenerWrapper;

  switch (eventPriority) {
    case DiscreteEvent:
      listenerWrapper = dispatchDiscreteEvent;
      break;

    case UserBlockingEvent:
      listenerWrapper = dispatchUserBlockingUpdate;
      break;

    case ContinuousEvent:
    default:
      listenerWrapper = dispatchEvent;
      break;
  }

  return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
}

function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
  {
    flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
  }

  discreteUpdates(dispatchEvent, domEventName, eventSystemFlags, container, nativeEvent);
}

function dispatchUserBlockingUpdate(domEventName, eventSystemFlags, container, nativeEvent) {
  {
    runWithPriority(UserBlockingPriority$1, dispatchEvent.bind(null, domEventName, eventSystemFlags, container, nativeEvent));
  }
}

function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  if (!_enabled) {
    return;
  }

  var allowReplay = true;

  {
    // TODO: replaying capture phase events is currently broken
    // because we used to do it during top-level native bubble handlers
    // but now we use different bubble and capture handlers.
    // In eager mode, we attach capture listeners early, so we need
    // to filter them out until we fix the logic to handle them correctly.
    // This could've been outside the flag but I put it inside to reduce risk.
    allowReplay = (eventSystemFlags & IS_CAPTURE_PHASE) === 0;
  }

  if (allowReplay && hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(domEventName)) {
    // If we already have a queue of discrete events, and this is another discrete
    // event, then we can't dispatch it regardless of its target, since they
    // need to dispatch in order.
    queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.
    domEventName, eventSystemFlags, targetContainer, nativeEvent);
    return;
  }

  var blockedOn = attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);

  if (blockedOn === null) {
    // We successfully dispatched this event.
    if (allowReplay) {
      clearIfContinuousEvent(domEventName, nativeEvent);
    }

    return;
  }

  if (allowReplay) {
    if (isReplayableDiscreteEvent(domEventName)) {
      // This this to be replayed later once the target is available.
      queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
      return;
    }

    if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
      return;
    } // We need to clear only if we didn't queue because
    // queueing is accummulative.


    clearIfContinuousEvent(domEventName, nativeEvent);
  } // This is not replayable so we'll invoke it but without a target,
  // in case the event system needs to trace it.


  dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
} // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.

function attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  // TODO: Warn if _enabled is false.
  var nativeEventTarget = getEventTarget(nativeEvent);
  var targetInst = getClosestInstanceFromNode(nativeEventTarget);

  if (targetInst !== null) {
    var nearestMounted = getNearestMountedFiber(targetInst);

    if (nearestMounted === null) {
      // This tree has been unmounted already. Dispatch without a target.
      targetInst = null;
    } else {
      var tag = nearestMounted.tag;

      if (tag === SuspenseComponent) {
        var instance = getSuspenseInstanceFromFiber(nearestMounted);

        if (instance !== null) {
          // Queue the event to be replayed later. Abort dispatching since we
          // don't want this event dispatched twice through the event system.
          // TODO: If this is the first discrete event in the queue. Schedule an increased
          // priority for this boundary.
          return instance;
        } // This shouldn't happen, something went wrong but to avoid blocking
        // the whole system, dispatch the event without a target.
        // TODO: Warn.


        targetInst = null;
      } else if (tag === HostRoot) {
        var root = nearestMounted.stateNode;

        if (root.hydrate) {
          // If this happens during a replay something went wrong and it might block
          // the whole system.
          return getContainerFromFiber(nearestMounted);
        }

        targetInst = null;
      } else if (nearestMounted !== targetInst) {
        // If we get an event (ex: img onload) before committing that
        // component's mount, ignore it for now (that is, treat it as if it was an
        // event on a non-React tree). We might also consider queueing events and
        // dispatching them after the mount.
        targetInst = null;
      }
    }
  }

  dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer); // We're not blocked on anything.

  return null;
}

function addEventBubbleListener(target, eventType, listener) {
  target.addEventListener(eventType, listener, false);
  return listener;
}
function addEventCaptureListener(target, eventType, listener) {
  target.addEventListener(eventType, listener, true);
  return listener;
}
function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {
  target.addEventListener(eventType, listener, {
    capture: true,
    passive: passive
  });
  return listener;
}
function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {
  target.addEventListener(eventType, listener, {
    passive: passive
  });
  return listener;
}

/**
 * These variables store information about text content of a target node,
 * allowing comparison of content before and after a given event.
 *
 * Identify the node where selection currently begins, then observe
 * both its text content and its current position in the DOM. Since the
 * browser may natively replace the target node during composition, we can
 * use its position to find its replacement.
 *
 *
 */
var root = null;
var startText = null;
var fallbackText = null;
function initialize(nativeEventTarget) {
  root = nativeEventTarget;
  startText = getText();
  return true;
}
function reset() {
  root = null;
  startText = null;
  fallbackText = null;
}
function getData() {
  if (fallbackText) {
    return fallbackText;
  }

  var start;
  var startValue = startText;
  var startLength = startValue.length;
  var end;
  var endValue = getText();
  var endLength = endValue.length;

  for (start = 0; start < startLength; start++) {
    if (startValue[start] !== endValue[start]) {
      break;
    }
  }

  var minEnd = startLength - start;

  for (end = 1; end <= minEnd; end++) {
    if (startValue[startLength - end] !== endValue[endLength - end]) {
      break;
    }
  }

  var sliceTail = end > 1 ? 1 - end : undefined;
  fallbackText = endValue.slice(start, sliceTail);
  return fallbackText;
}
function getText() {
  if ('value' in root) {
    return root.value;
  }

  return root.textContent;
}

/**
 * `charCode` represents the actual "character code" and is safe to use with
 * `String.fromCharCode`. As such, only keys that correspond to printable
 * characters produce a valid `charCode`, the only exception to this is Enter.
 * The Tab-key is considered non-printable and does not have a `charCode`,
 * presumably because it does not produce a tab-character in browsers.
 *
 * @param {object} nativeEvent Native browser event.
 * @return {number} Normalized `charCode` property.
 */
function getEventCharCode(nativeEvent) {
  var charCode;
  var keyCode = nativeEvent.keyCode;

  if ('charCode' in nativeEvent) {
    charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.

    if (charCode === 0 && keyCode === 13) {
      charCode = 13;
    }
  } else {
    // IE8 does not implement `charCode`, but `keyCode` has the correct value.
    charCode = keyCode;
  } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
  // report Enter as charCode 10 when ctrl is pressed.


  if (charCode === 10) {
    charCode = 13;
  } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
  // Must not discard the (non-)printable Enter-key.


  if (charCode >= 32 || charCode === 13) {
    return charCode;
  }

  return 0;
}

function functionThatReturnsTrue() {
  return true;
}

function functionThatReturnsFalse() {
  return false;
} // This is intentionally a factory so that we have different returned constructors.
// If we had a single constructor, it would be megamorphic and engines would deopt.


function createSyntheticEvent(Interface) {
  /**
   * Synthetic events are dispatched by event plugins, typically in response to a
   * top-level event delegation handler.
   *
   * These systems should generally use pooling to reduce the frequency of garbage
   * collection. The system should check `isPersistent` to determine whether the
   * event should be released into the pool after being dispatched. Users that
   * need a persisted event should invoke `persist`.
   *
   * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
   * normalizing browser quirks. Subclasses do not necessarily have to implement a
   * DOM interface; custom application-specific events can also subclass this.
   */
  function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
    this._reactName = reactName;
    this._targetInst = targetInst;
    this.type = reactEventType;
    this.nativeEvent = nativeEvent;
    this.target = nativeEventTarget;
    this.currentTarget = null;

    for (var _propName in Interface) {
      if (!Interface.hasOwnProperty(_propName)) {
        continue;
      }

      var normalize = Interface[_propName];

      if (normalize) {
        this[_propName] = normalize(nativeEvent);
      } else {
        this[_propName] = nativeEvent[_propName];
      }
    }

    var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;

    if (defaultPrevented) {
      this.isDefaultPrevented = functionThatReturnsTrue;
    } else {
      this.isDefaultPrevented = functionThatReturnsFalse;
    }

    this.isPropagationStopped = functionThatReturnsFalse;
    return this;
  }

  _assign(SyntheticBaseEvent.prototype, {
    preventDefault: function () {
      this.defaultPrevented = true;
      var event = this.nativeEvent;

      if (!event) {
        return;
      }

      if (event.preventDefault) {
        event.preventDefault(); // $FlowFixMe - flow is not aware of `unknown` in IE
      } else if (typeof event.returnValue !== 'unknown') {
        event.returnValue = false;
      }

      this.isDefaultPrevented = functionThatReturnsTrue;
    },
    stopPropagation: function () {
      var event = this.nativeEvent;

      if (!event) {
        return;
      }

      if (event.stopPropagation) {
        event.stopPropagation(); // $FlowFixMe - flow is not aware of `unknown` in IE
      } else if (typeof event.cancelBubble !== 'unknown') {
        // The ChangeEventPlugin registers a "propertychange" event for
        // IE. This event does not support bubbling or cancelling, and
        // any references to cancelBubble throw "Member not found".  A
        // typeof check of "unknown" circumvents this issue (and is also
        // IE specific).
        event.cancelBubble = true;
      }

      this.isPropagationStopped = functionThatReturnsTrue;
    },

    /**
     * We release all dispatched `SyntheticEvent`s after each event loop, adding
     * them back into the pool. This allows a way to hold onto a reference that
     * won't be added back into the pool.
     */
    persist: function () {// Modern event system doesn't use pooling.
    },

    /**
     * Checks if this event should be released back into the pool.
     *
     * @return {boolean} True if this should not be released, false otherwise.
     */
    isPersistent: functionThatReturnsTrue
  });

  return SyntheticBaseEvent;
}
/**
 * @interface Event
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */


var EventInterface = {
  eventPhase: 0,
  bubbles: 0,
  cancelable: 0,
  timeStamp: function (event) {
    return event.timeStamp || Date.now();
  },
  defaultPrevented: 0,
  isTrusted: 0
};
var SyntheticEvent = createSyntheticEvent(EventInterface);

var UIEventInterface = _assign({}, EventInterface, {
  view: 0,
  detail: 0
});

var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
var lastMovementX;
var lastMovementY;
var lastMouseEvent;

function updateMouseMovementPolyfillState(event) {
  if (event !== lastMouseEvent) {
    if (lastMouseEvent && event.type === 'mousemove') {
      lastMovementX = event.screenX - lastMouseEvent.screenX;
      lastMovementY = event.screenY - lastMouseEvent.screenY;
    } else {
      lastMovementX = 0;
      lastMovementY = 0;
    }

    lastMouseEvent = event;
  }
}
/**
 * @interface MouseEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */


var MouseEventInterface = _assign({}, UIEventInterface, {
  screenX: 0,
  screenY: 0,
  clientX: 0,
  clientY: 0,
  pageX: 0,
  pageY: 0,
  ctrlKey: 0,
  shiftKey: 0,
  altKey: 0,
  metaKey: 0,
  getModifierState: getEventModifierState,
  button: 0,
  buttons: 0,
  relatedTarget: function (event) {
    if (event.relatedTarget === undefined) return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
    return event.relatedTarget;
  },
  movementX: function (event) {
    if ('movementX' in event) {
      return event.movementX;
    }

    updateMouseMovementPolyfillState(event);
    return lastMovementX;
  },
  movementY: function (event) {
    if ('movementY' in event) {
      return event.movementY;
    } // Don't need to call updateMouseMovementPolyfillState() here
    // because it's guaranteed to have already run when movementX
    // was copied.


    return lastMovementY;
  }
});

var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
/**
 * @interface DragEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */

var DragEventInterface = _assign({}, MouseEventInterface, {
  dataTransfer: 0
});

var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
/**
 * @interface FocusEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */

var FocusEventInterface = _assign({}, UIEventInterface, {
  relatedTarget: 0
});

var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
 */

var AnimationEventInterface = _assign({}, EventInterface, {
  animationName: 0,
  elapsedTime: 0,
  pseudoElement: 0
});

var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/clipboard-apis/
 */

var ClipboardEventInterface = _assign({}, EventInterface, {
  clipboardData: function (event) {
    return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
  }
});

var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
 */

var CompositionEventInterface = _assign({}, EventInterface, {
  data: 0
});

var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
 *      /#events-inputevents
 */
// Happens to share the same list for now.

var SyntheticInputEvent = SyntheticCompositionEvent;
/**
 * Normalization of deprecated HTML5 `key` values
 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
 */

var normalizeKey = {
  Esc: 'Escape',
  Spacebar: ' ',
  Left: 'ArrowLeft',
  Up: 'ArrowUp',
  Right: 'ArrowRight',
  Down: 'ArrowDown',
  Del: 'Delete',
  Win: 'OS',
  Menu: 'ContextMenu',
  Apps: 'ContextMenu',
  Scroll: 'ScrollLock',
  MozPrintableKey: 'Unidentified'
};
/**
 * Translation from legacy `keyCode` to HTML5 `key`
 * Only special keys supported, all others depend on keyboard layout or browser
 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
 */

var translateToKey = {
  '8': 'Backspace',
  '9': 'Tab',
  '12': 'Clear',
  '13': 'Enter',
  '16': 'Shift',
  '17': 'Control',
  '18': 'Alt',
  '19': 'Pause',
  '20': 'CapsLock',
  '27': 'Escape',
  '32': ' ',
  '33': 'PageUp',
  '34': 'PageDown',
  '35': 'End',
  '36': 'Home',
  '37': 'ArrowLeft',
  '38': 'ArrowUp',
  '39': 'ArrowRight',
  '40': 'ArrowDown',
  '45': 'Insert',
  '46': 'Delete',
  '112': 'F1',
  '113': 'F2',
  '114': 'F3',
  '115': 'F4',
  '116': 'F5',
  '117': 'F6',
  '118': 'F7',
  '119': 'F8',
  '120': 'F9',
  '121': 'F10',
  '122': 'F11',
  '123': 'F12',
  '144': 'NumLock',
  '145': 'ScrollLock',
  '224': 'Meta'
};
/**
 * @param {object} nativeEvent Native browser event.
 * @return {string} Normalized `key` property.
 */

function getEventKey(nativeEvent) {
  if (nativeEvent.key) {
    // Normalize inconsistent values reported by browsers due to
    // implementations of a working draft specification.
    // FireFox implements `key` but returns `MozPrintableKey` for all
    // printable characters (normalized to `Unidentified`), ignore it.
    var key = normalizeKey[nativeEvent.key] || nativeEvent.key;

    if (key !== 'Unidentified') {
      return key;
    }
  } // Browser does not implement `key`, polyfill as much of it as we can.


  if (nativeEvent.type === 'keypress') {
    var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can
    // thus be captured by `keypress`, no other non-printable key should.

    return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
  }

  if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
    // While user keyboard layout determines the actual meaning of each
    // `keyCode` value, almost all function keys have a universal value.
    return translateToKey[nativeEvent.keyCode] || 'Unidentified';
  }

  return '';
}
/**
 * Translation from modifier key to the associated property in the event.
 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
 */


var modifierKeyToProp = {
  Alt: 'altKey',
  Control: 'ctrlKey',
  Meta: 'metaKey',
  Shift: 'shiftKey'
}; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
// getModifierState. If getModifierState is not supported, we map it to a set of
// modifier keys exposed by the event. In this case, Lock-keys are not supported.

function modifierStateGetter(keyArg) {
  var syntheticEvent = this;
  var nativeEvent = syntheticEvent.nativeEvent;

  if (nativeEvent.getModifierState) {
    return nativeEvent.getModifierState(keyArg);
  }

  var keyProp = modifierKeyToProp[keyArg];
  return keyProp ? !!nativeEvent[keyProp] : false;
}

function getEventModifierState(nativeEvent) {
  return modifierStateGetter;
}
/**
 * @interface KeyboardEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */


var KeyboardEventInterface = _assign({}, UIEventInterface, {
  key: getEventKey,
  code: 0,
  location: 0,
  ctrlKey: 0,
  shiftKey: 0,
  altKey: 0,
  metaKey: 0,
  repeat: 0,
  locale: 0,
  getModifierState: getEventModifierState,
  // Legacy Interface
  charCode: function (event) {
    // `charCode` is the result of a KeyPress event and represents the value of
    // the actual printable character.
    // KeyPress is deprecated, but its replacement is not yet final and not
    // implemented in any major browser. Only KeyPress has charCode.
    if (event.type === 'keypress') {
      return getEventCharCode(event);
    }

    return 0;
  },
  keyCode: function (event) {
    // `keyCode` is the result of a KeyDown/Up event and represents the value of
    // physical keyboard key.
    // The actual meaning of the value depends on the users' keyboard layout
    // which cannot be detected. Assuming that it is a US keyboard layout
    // provides a surprisingly accurate mapping for US and European users.
    // Due to this, it is left to the user to implement at this time.
    if (event.type === 'keydown' || event.type === 'keyup') {
      return event.keyCode;
    }

    return 0;
  },
  which: function (event) {
    // `which` is an alias for either `keyCode` or `charCode` depending on the
    // type of the event.
    if (event.type === 'keypress') {
      return getEventCharCode(event);
    }

    if (event.type === 'keydown' || event.type === 'keyup') {
      return event.keyCode;
    }

    return 0;
  }
});

var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
/**
 * @interface PointerEvent
 * @see http://www.w3.org/TR/pointerevents/
 */

var PointerEventInterface = _assign({}, MouseEventInterface, {
  pointerId: 0,
  width: 0,
  height: 0,
  pressure: 0,
  tangentialPressure: 0,
  tiltX: 0,
  tiltY: 0,
  twist: 0,
  pointerType: 0,
  isPrimary: 0
});

var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
/**
 * @interface TouchEvent
 * @see http://www.w3.org/TR/touch-events/
 */

var TouchEventInterface = _assign({}, UIEventInterface, {
  touches: 0,
  targetTouches: 0,
  changedTouches: 0,
  altKey: 0,
  metaKey: 0,
  ctrlKey: 0,
  shiftKey: 0,
  getModifierState: getEventModifierState
});

var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
/**
 * @interface Event
 * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
 * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
 */

var TransitionEventInterface = _assign({}, EventInterface, {
  propertyName: 0,
  elapsedTime: 0,
  pseudoElement: 0
});

var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
/**
 * @interface WheelEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */

var WheelEventInterface = _assign({}, MouseEventInterface, {
  deltaX: function (event) {
    return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
    'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
  },
  deltaY: function (event) {
    return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
    'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
    'wheelDelta' in event ? -event.wheelDelta : 0;
  },
  deltaZ: 0,
  // Browsers without "deltaMode" is reporting in raw wheel delta where one
  // notch on the scroll is always +/- 120, roughly equivalent to pixels.
  // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
  // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
  deltaMode: 0
});

var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);

var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space

var START_KEYCODE = 229;
var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
var documentMode = null;

if (canUseDOM && 'documentMode' in document) {
  documentMode = document.documentMode;
} // Webkit offers a very useful `textInput` event that can be used to
// directly represent `beforeInput`. The IE `textinput` event is not as
// useful, so we don't use it.


var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied
// by the native compositionend event may be incorrect. Japanese ideographic
// spaces, for instance (\u3000) are not recorded correctly.

var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);

function registerEvents() {
  registerTwoPhaseEvent('onBeforeInput', ['compositionend', 'keypress', 'textInput', 'paste']);
  registerTwoPhaseEvent('onCompositionEnd', ['compositionend', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);
  registerTwoPhaseEvent('onCompositionStart', ['compositionstart', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);
  registerTwoPhaseEvent('onCompositionUpdate', ['compositionupdate', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);
} // Track whether we've ever handled a keypress on the space key.


var hasSpaceKeypress = false;
/**
 * Return whether a native keypress event is assumed to be a command.
 * This is required because Firefox fires `keypress` events for key commands
 * (cut, copy, select-all, etc.) even though no character is inserted.
 */

function isKeypressCommand(nativeEvent) {
  return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
  !(nativeEvent.ctrlKey && nativeEvent.altKey);
}
/**
 * Translate native top level events into event types.
 */


function getCompositionEventType(domEventName) {
  switch (domEventName) {
    case 'compositionstart':
      return 'onCompositionStart';

    case 'compositionend':
      return 'onCompositionEnd';

    case 'compositionupdate':
      return 'onCompositionUpdate';
  }
}
/**
 * Does our fallback best-guess model think this event signifies that
 * composition has begun?
 */


function isFallbackCompositionStart(domEventName, nativeEvent) {
  return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;
}
/**
 * Does our fallback mode think that this event is the end of composition?
 */


function isFallbackCompositionEnd(domEventName, nativeEvent) {
  switch (domEventName) {
    case 'keyup':
      // Command keys insert or clear IME input.
      return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;

    case 'keydown':
      // Expect IME keyCode on each keydown. If we get any other
      // code we must have exited earlier.
      return nativeEvent.keyCode !== START_KEYCODE;

    case 'keypress':
    case 'mousedown':
    case 'focusout':
      // Events are not possible without cancelling IME.
      return true;

    default:
      return false;
  }
}
/**
 * Google Input Tools provides composition data via a CustomEvent,
 * with the `data` property populated in the `detail` object. If this
 * is available on the event object, use it. If not, this is a plain
 * composition event and we have nothing special to extract.
 *
 * @param {object} nativeEvent
 * @return {?string}
 */


function getDataFromCustomEvent(nativeEvent) {
  var detail = nativeEvent.detail;

  if (typeof detail === 'object' && 'data' in detail) {
    return detail.data;
  }

  return null;
}
/**
 * Check if a composition event was triggered by Korean IME.
 * Our fallback mode does not work well with IE's Korean IME,
 * so just use native composition events when Korean IME is used.
 * Although CompositionEvent.locale property is deprecated,
 * it is available in IE, where our fallback mode is enabled.
 *
 * @param {object} nativeEvent
 * @return {boolean}
 */


function isUsingKoreanIME(nativeEvent) {
  return nativeEvent.locale === 'ko';
} // Track the current IME composition status, if any.


var isComposing = false;
/**
 * @return {?object} A SyntheticCompositionEvent.
 */

function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
  var eventType;
  var fallbackData;

  if (canUseCompositionEvent) {
    eventType = getCompositionEventType(domEventName);
  } else if (!isComposing) {
    if (isFallbackCompositionStart(domEventName, nativeEvent)) {
      eventType = 'onCompositionStart';
    }
  } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
    eventType = 'onCompositionEnd';
  }

  if (!eventType) {
    return null;
  }

  if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
    // The current composition is stored statically and must not be
    // overwritten while composition continues.
    if (!isComposing && eventType === 'onCompositionStart') {
      isComposing = initialize(nativeEventTarget);
    } else if (eventType === 'onCompositionEnd') {
      if (isComposing) {
        fallbackData = getData();
      }
    }
  }

  var listeners = accumulateTwoPhaseListeners(targetInst, eventType);

  if (listeners.length > 0) {
    var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
    dispatchQueue.push({
      event: event,
      listeners: listeners
    });

    if (fallbackData) {
      // Inject data generated from fallback path into the synthetic event.
      // This matches the property of native CompositionEventInterface.
      event.data = fallbackData;
    } else {
      var customData = getDataFromCustomEvent(nativeEvent);

      if (customData !== null) {
        event.data = customData;
      }
    }
  }
}

function getNativeBeforeInputChars(domEventName, nativeEvent) {
  switch (domEventName) {
    case 'compositionend':
      return getDataFromCustomEvent(nativeEvent);

    case 'keypress':
      /**
       * If native `textInput` events are available, our goal is to make
       * use of them. However, there is a special case: the spacebar key.
       * In Webkit, preventing default on a spacebar `textInput` event
       * cancels character insertion, but it *also* causes the browser
       * to fall back to its default spacebar behavior of scrolling the
       * page.
       *
       * Tracking at:
       * https://code.google.com/p/chromium/issues/detail?id=355103
       *
       * To avoid this issue, use the keypress event as if no `textInput`
       * event is available.
       */
      var which = nativeEvent.which;

      if (which !== SPACEBAR_CODE) {
        return null;
      }

      hasSpaceKeypress = true;
      return SPACEBAR_CHAR;

    case 'textInput':
      // Record the characters to be added to the DOM.
      var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled
      // it at the keypress level and bail immediately. Android Chrome
      // doesn't give us keycodes, so we need to ignore it.

      if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
        return null;
      }

      return chars;

    default:
      // For other native event types, do nothing.
      return null;
  }
}
/**
 * For browsers that do not provide the `textInput` event, extract the
 * appropriate string to use for SyntheticInputEvent.
 */


function getFallbackBeforeInputChars(domEventName, nativeEvent) {
  // If we are currently composing (IME) and using a fallback to do so,
  // try to extract the composed characters from the fallback object.
  // If composition event is available, we extract a string only at
  // compositionevent, otherwise extract it at fallback events.
  if (isComposing) {
    if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
      var chars = getData();
      reset();
      isComposing = false;
      return chars;
    }

    return null;
  }

  switch (domEventName) {
    case 'paste':
      // If a paste event occurs after a keypress, throw out the input
      // chars. Paste events should not lead to BeforeInput events.
      return null;

    case 'keypress':
      /**
       * As of v27, Firefox may fire keypress events even when no character
       * will be inserted. A few possibilities:
       *
       * - `which` is `0`. Arrow keys, Esc key, etc.
       *
       * - `which` is the pressed key code, but no char is available.
       *   Ex: 'AltGr + d` in Polish. There is no modified character for
       *   this key combination and no character is inserted into the
       *   document, but FF fires the keypress for char code `100` anyway.
       *   No `input` event will occur.
       *
       * - `which` is the pressed key code, but a command combination is
       *   being used. Ex: `Cmd+C`. No character is inserted, and no
       *   `input` event will occur.
       */
      if (!isKeypressCommand(nativeEvent)) {
        // IE fires the `keypress` event when a user types an emoji via
        // Touch keyboard of Windows.  In such a case, the `char` property
        // holds an emoji character like `\uD83D\uDE0A`.  Because its length
        // is 2, the property `which` does not represent an emoji correctly.
        // In such a case, we directly return the `char` property instead of
        // using `which`.
        if (nativeEvent.char && nativeEvent.char.length > 1) {
          return nativeEvent.char;
        } else if (nativeEvent.which) {
          return String.fromCharCode(nativeEvent.which);
        }
      }

      return null;

    case 'compositionend':
      return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;

    default:
      return null;
  }
}
/**
 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
 * `textInput` or fallback behavior.
 *
 * @return {?object} A SyntheticInputEvent.
 */


function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
  var chars;

  if (canUseTextInputEvent) {
    chars = getNativeBeforeInputChars(domEventName, nativeEvent);
  } else {
    chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
  } // If no characters are being inserted, no BeforeInput event should
  // be fired.


  if (!chars) {
    return null;
  }

  var listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput');

  if (listeners.length > 0) {
    var event = new SyntheticInputEvent('onBeforeInput', 'beforeinput', null, nativeEvent, nativeEventTarget);
    dispatchQueue.push({
      event: event,
      listeners: listeners
    });
    event.data = chars;
  }
}
/**
 * Create an `onBeforeInput` event to match
 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
 *
 * This event plugin is based on the native `textInput` event
 * available in Chrome, Safari, Opera, and IE. This event fires after
 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
 *
 * `beforeInput` is spec'd but not implemented in any browsers, and
 * the `input` event does not provide any useful information about what has
 * actually been added, contrary to the spec. Thus, `textInput` is the best
 * available event to identify the characters that have actually been inserted
 * into the target node.
 *
 * This plugin is also responsible for emitting `composition` events, thus
 * allowing us to share composition fallback code for both `beforeInput` and
 * `composition` event types.
 */


function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
  extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
}

/**
 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
 */
var supportedInputTypes = {
  color: true,
  date: true,
  datetime: true,
  'datetime-local': true,
  email: true,
  month: true,
  number: true,
  password: true,
  range: true,
  search: true,
  tel: true,
  text: true,
  time: true,
  url: true,
  week: true
};

function isTextInputElement(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();

  if (nodeName === 'input') {
    return !!supportedInputTypes[elem.type];
  }

  if (nodeName === 'textarea') {
    return true;
  }

  return false;
}

/**
 * Checks if an event is supported in the current execution environment.
 *
 * NOTE: This will not work correctly for non-generic events such as `change`,
 * `reset`, `load`, `error`, and `select`.
 *
 * Borrows from Modernizr.
 *
 * @param {string} eventNameSuffix Event name, e.g. "click".
 * @return {boolean} True if the event is supported.
 * @internal
 * @license Modernizr 3.0.0pre (Custom Build) | MIT
 */

function isEventSupported(eventNameSuffix) {
  if (!canUseDOM) {
    return false;
  }

  var eventName = 'on' + eventNameSuffix;
  var isSupported = (eventName in document);

  if (!isSupported) {
    var element = document.createElement('div');
    element.setAttribute(eventName, 'return;');
    isSupported = typeof element[eventName] === 'function';
  }

  return isSupported;
}

function registerEvents$1() {
  registerTwoPhaseEvent('onChange', ['change', 'click', 'focusin', 'focusout', 'input', 'keydown', 'keyup', 'selectionchange']);
}

function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
  // Flag this event loop as needing state restore.
  enqueueStateRestore(target);
  var listeners = accumulateTwoPhaseListeners(inst, 'onChange');

  if (listeners.length > 0) {
    var event = new SyntheticEvent('onChange', 'change', null, nativeEvent, target);
    dispatchQueue.push({
      event: event,
      listeners: listeners
    });
  }
}
/**
 * For IE shims
 */


var activeElement = null;
var activeElementInst = null;
/**
 * SECTION: handle `change` event
 */

function shouldUseChangeEvent(elem) {
  var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}

function manualDispatchChangeEvent(nativeEvent) {
  var dispatchQueue = [];
  createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the
  // other events and have it go through ReactBrowserEventEmitter. Since it
  // doesn't, we manually listen for the events and so we have to enqueue and
  // process the abstract event manually.
  //
  // Batching is necessary here in order to ensure that all event handlers run
  // before the next rerender (including event handlers attached to ancestor
  // elements instead of directly on the input). Without this, controlled
  // components don't work properly in conjunction with event bubbling because
  // the component is rerendered and the value reverted before all the event
  // handlers can run. See https://github.com/facebook/react/issues/708.

  batchedUpdates(runEventInBatch, dispatchQueue);
}

function runEventInBatch(dispatchQueue) {
  processDispatchQueue(dispatchQueue, 0);
}

function getInstIfValueChanged(targetInst) {
  var targetNode = getNodeFromInstance(targetInst);

  if (updateValueIfChanged(targetNode)) {
    return targetInst;
  }
}

function getTargetInstForChangeEvent(domEventName, targetInst) {
  if (domEventName === 'change') {
    return targetInst;
  }
}
/**
 * SECTION: handle `input` event
 */


var isInputEventSupported = false;

if (canUseDOM) {
  // IE9 claims to support the input event but fails to trigger it when
  // deleting text, so we ignore its input events.
  isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
}
/**
 * (For IE <=9) Starts tracking propertychange events on the passed-in element
 * and override the value property so that we can distinguish user events from
 * value changes in JS.
 */


function startWatchingForValueChange(target, targetInst) {
  activeElement = target;
  activeElementInst = targetInst;
  activeElement.attachEvent('onpropertychange', handlePropertyChange);
}
/**
 * (For IE <=9) Removes the event listeners from the currently-tracked element,
 * if any exists.
 */


function stopWatchingForValueChange() {
  if (!activeElement) {
    return;
  }

  activeElement.detachEvent('onpropertychange', handlePropertyChange);
  activeElement = null;
  activeElementInst = null;
}
/**
 * (For IE <=9) Handles a propertychange event, sending a `change` event if
 * the value of the active element has changed.
 */


function handlePropertyChange(nativeEvent) {
  if (nativeEvent.propertyName !== 'value') {
    return;
  }

  if (getInstIfValueChanged(activeElementInst)) {
    manualDispatchChangeEvent(nativeEvent);
  }
}

function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
  if (domEventName === 'focusin') {
    // In IE9, propertychange fires for most input events but is buggy and
    // doesn't fire when text is deleted, but conveniently, selectionchange
    // appears to fire in all of the remaining cases so we catch those and
    // forward the event if the value has changed
    // In either case, we don't want to call the event handler if the value
    // is changed from JS so we redefine a setter for `.value` that updates
    // our activeElementValue variable, allowing us to ignore those changes
    //
    // stopWatching() should be a noop here but we call it just in case we
    // missed a blur event somehow.
    stopWatchingForValueChange();
    startWatchingForValueChange(target, targetInst);
  } else if (domEventName === 'focusout') {
    stopWatchingForValueChange();
  }
} // For IE8 and IE9.


function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
  if (domEventName === 'selectionchange' || domEventName === 'keyup' || domEventName === 'keydown') {
    // On the selectionchange event, the target is just document which isn't
    // helpful for us so just check activeElement instead.
    //
    // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
    // propertychange on the first input event after setting `value` from a
    // script and fires only keydown, keypress, keyup. Catching keyup usually
    // gets it and catching keydown lets us fire an event for the first
    // keystroke if user does a key repeat (it'll be a little delayed: right
    // before the second keystroke). Other input methods (e.g., paste) seem to
    // fire selectionchange normally.
    return getInstIfValueChanged(activeElementInst);
  }
}
/**
 * SECTION: handle `click` event
 */


function shouldUseClickEvent(elem) {
  // Use the `click` event to detect changes to checkbox and radio inputs.
  // This approach works across all browsers, whereas `change` does not fire
  // until `blur` in IE8.
  var nodeName = elem.nodeName;
  return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
}

function getTargetInstForClickEvent(domEventName, targetInst) {
  if (domEventName === 'click') {
    return getInstIfValueChanged(targetInst);
  }
}

function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
  if (domEventName === 'input' || domEventName === 'change') {
    return getInstIfValueChanged(targetInst);
  }
}

function handleControlledInputBlur(node) {
  var state = node._wrapperState;

  if (!state || !state.controlled || node.type !== 'number') {
    return;
  }

  {
    // If controlled, assign the value attribute to the current value on blur
    setDefaultValue(node, 'number', node.value);
  }
}
/**
 * This plugin creates an `onChange` event that normalizes change events
 * across form elements. This event fires at a time when it's possible to
 * change the element's value without seeing a flicker.
 *
 * Supported elements are:
 * - input (see `isTextInputElement`)
 * - textarea
 * - select
 */


function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
  var getTargetInstFunc, handleEventFunc;

  if (shouldUseChangeEvent(targetNode)) {
    getTargetInstFunc = getTargetInstForChangeEvent;
  } else if (isTextInputElement(targetNode)) {
    if (isInputEventSupported) {
      getTargetInstFunc = getTargetInstForInputOrChangeEvent;
    } else {
      getTargetInstFunc = getTargetInstForInputEventPolyfill;
      handleEventFunc = handleEventsForInputEventPolyfill;
    }
  } else if (shouldUseClickEvent(targetNode)) {
    getTargetInstFunc = getTargetInstForClickEvent;
  }

  if (getTargetInstFunc) {
    var inst = getTargetInstFunc(domEventName, targetInst);

    if (inst) {
      createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
      return;
    }
  }

  if (handleEventFunc) {
    handleEventFunc(domEventName, targetNode, targetInst);
  } // When blurring, set the value attribute for number inputs


  if (domEventName === 'focusout') {
    handleControlledInputBlur(targetNode);
  }
}

function registerEvents$2() {
  registerDirectEvent('onMouseEnter', ['mouseout', 'mouseover']);
  registerDirectEvent('onMouseLeave', ['mouseout', 'mouseover']);
  registerDirectEvent('onPointerEnter', ['pointerout', 'pointerover']);
  registerDirectEvent('onPointerLeave', ['pointerout', 'pointerover']);
}
/**
 * For almost every interaction we care about, there will be both a top-level
 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
 * we do not extract duplicate events. However, moving the mouse into the
 * browser from outside will not fire a `mouseout` event. In this case, we use
 * the `mouseover` top-level event.
 */


function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  var isOverEvent = domEventName === 'mouseover' || domEventName === 'pointerover';
  var isOutEvent = domEventName === 'mouseout' || domEventName === 'pointerout';

  if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0) {
    // If this is an over event with a target, we might have already dispatched
    // the event in the out event of the other target. If this is replayed,
    // then it's because we couldn't dispatch against this target previously
    // so we have to do it now instead.
    var related = nativeEvent.relatedTarget || nativeEvent.fromElement;

    if (related) {
      // If the related node is managed by React, we can assume that we have
      // already dispatched the corresponding events during its mouseout.
      if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
        return;
      }
    }
  }

  if (!isOutEvent && !isOverEvent) {
    // Must not be a mouse or pointer in or out - ignoring.
    return;
  }

  var win; // TODO: why is this nullable in the types but we read from it?

  if (nativeEventTarget.window === nativeEventTarget) {
    // `nativeEventTarget` is probably a window object.
    win = nativeEventTarget;
  } else {
    // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
    var doc = nativeEventTarget.ownerDocument;

    if (doc) {
      win = doc.defaultView || doc.parentWindow;
    } else {
      win = window;
    }
  }

  var from;
  var to;

  if (isOutEvent) {
    var _related = nativeEvent.relatedTarget || nativeEvent.toElement;

    from = targetInst;
    to = _related ? getClosestInstanceFromNode(_related) : null;

    if (to !== null) {
      var nearestMounted = getNearestMountedFiber(to);

      if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
        to = null;
      }
    }
  } else {
    // Moving to a node from outside the window.
    from = null;
    to = targetInst;
  }

  if (from === to) {
    // Nothing pertains to our managed components.
    return;
  }

  var SyntheticEventCtor = SyntheticMouseEvent;
  var leaveEventType = 'onMouseLeave';
  var enterEventType = 'onMouseEnter';
  var eventTypePrefix = 'mouse';

  if (domEventName === 'pointerout' || domEventName === 'pointerover') {
    SyntheticEventCtor = SyntheticPointerEvent;
    leaveEventType = 'onPointerLeave';
    enterEventType = 'onPointerEnter';
    eventTypePrefix = 'pointer';
  }

  var fromNode = from == null ? win : getNodeFromInstance(from);
  var toNode = to == null ? win : getNodeFromInstance(to);
  var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + 'leave', from, nativeEvent, nativeEventTarget);
  leave.target = fromNode;
  leave.relatedTarget = toNode;
  var enter = null; // We should only process this nativeEvent if we are processing
  // the first ancestor. Next time, we will ignore the event.

  var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);

  if (nativeTargetInst === targetInst) {
    var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + 'enter', to, nativeEvent, nativeEventTarget);
    enterEvent.target = toNode;
    enterEvent.relatedTarget = fromNode;
    enter = enterEvent;
  }

  accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
}

/**
 * inlined Object.is polyfill to avoid requiring consumers ship their own
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
 */
function is(x, y) {
  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
  ;
}

var objectIs = typeof Object.is === 'function' ? Object.is : is;

var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
/**
 * Performs equality by iterating through keys on an object and returning false
 * when any key has values which are not strictly equal between the arguments.
 * Returns true when the values of all keys are strictly equal.
 */

function shallowEqual(objA, objB) {
  if (objectIs(objA, objB)) {
    return true;
  }

  if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
    return false;
  }

  var keysA = Object.keys(objA);
  var keysB = Object.keys(objB);

  if (keysA.length !== keysB.length) {
    return false;
  } // Test for A's keys different from B.


  for (var i = 0; i < keysA.length; i++) {
    if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {
      return false;
    }
  }

  return true;
}

/**
 * Given any node return the first leaf node without children.
 *
 * @param {DOMElement|DOMTextNode} node
 * @return {DOMElement|DOMTextNode}
 */

function getLeafNode(node) {
  while (node && node.firstChild) {
    node = node.firstChild;
  }

  return node;
}
/**
 * Get the next sibling within a container. This will walk up the
 * DOM if a node's siblings have been exhausted.
 *
 * @param {DOMElement|DOMTextNode} node
 * @return {?DOMElement|DOMTextNode}
 */


function getSiblingNode(node) {
  while (node) {
    if (node.nextSibling) {
      return node.nextSibling;
    }

    node = node.parentNode;
  }
}
/**
 * Get object describing the nodes which contain characters at offset.
 *
 * @param {DOMElement|DOMTextNode} root
 * @param {number} offset
 * @return {?object}
 */


function getNodeForCharacterOffset(root, offset) {
  var node = getLeafNode(root);
  var nodeStart = 0;
  var nodeEnd = 0;

  while (node) {
    if (node.nodeType === TEXT_NODE) {
      nodeEnd = nodeStart + node.textContent.length;

      if (nodeStart <= offset && nodeEnd >= offset) {
        return {
          node: node,
          offset: offset - nodeStart
        };
      }

      nodeStart = nodeEnd;
    }

    node = getLeafNode(getSiblingNode(node));
  }
}

/**
 * @param {DOMElement} outerNode
 * @return {?object}
 */

function getOffsets(outerNode) {
  var ownerDocument = outerNode.ownerDocument;
  var win = ownerDocument && ownerDocument.defaultView || window;
  var selection = win.getSelection && win.getSelection();

  if (!selection || selection.rangeCount === 0) {
    return null;
  }

  var anchorNode = selection.anchorNode,
      anchorOffset = selection.anchorOffset,
      focusNode = selection.focusNode,
      focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
  // up/down buttons on an <input type="number">. Anonymous divs do not seem to
  // expose properties, triggering a "Permission denied error" if any of its
  // properties are accessed. The only seemingly possible way to avoid erroring
  // is to access a property that typically works for non-anonymous divs and
  // catch any error that may otherwise arise. See
  // https://bugzilla.mozilla.org/show_bug.cgi?id=208427

  try {
    /* eslint-disable no-unused-expressions */
    anchorNode.nodeType;
    focusNode.nodeType;
    /* eslint-enable no-unused-expressions */
  } catch (e) {
    return null;
  }

  return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
}
/**
 * Returns {start, end} where `start` is the character/codepoint index of
 * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
 * `end` is the index of (focusNode, focusOffset).
 *
 * Returns null if you pass in garbage input but we should probably just crash.
 *
 * Exported only for testing.
 */

function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
  var length = 0;
  var start = -1;
  var end = -1;
  var indexWithinAnchor = 0;
  var indexWithinFocus = 0;
  var node = outerNode;
  var parentNode = null;

  outer: while (true) {
    var next = null;

    while (true) {
      if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
        start = length + anchorOffset;
      }

      if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
        end = length + focusOffset;
      }

      if (node.nodeType === TEXT_NODE) {
        length += node.nodeValue.length;
      }

      if ((next = node.firstChild) === null) {
        break;
      } // Moving from `node` to its first child `next`.


      parentNode = node;
      node = next;
    }

    while (true) {
      if (node === outerNode) {
        // If `outerNode` has children, this is always the second time visiting
        // it. If it has no children, this is still the first loop, and the only
        // valid selection is anchorNode and focusNode both equal to this node
        // and both offsets 0, in which case we will have handled above.
        break outer;
      }

      if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
        start = length;
      }

      if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
        end = length;
      }

      if ((next = node.nextSibling) !== null) {
        break;
      }

      node = parentNode;
      parentNode = node.parentNode;
    } // Moving from `node` to its next sibling `next`.


    node = next;
  }

  if (start === -1 || end === -1) {
    // This should never happen. (Would happen if the anchor/focus nodes aren't
    // actually inside the passed-in node.)
    return null;
  }

  return {
    start: start,
    end: end
  };
}
/**
 * In modern non-IE browsers, we can support both forward and backward
 * selections.
 *
 * Note: IE10+ supports the Selection object, but it does not support
 * the `extend` method, which means that even in modern IE, it's not possible
 * to programmatically create a backward selection. Thus, for all IE
 * versions, we use the old IE API to create our selections.
 *
 * @param {DOMElement|DOMTextNode} node
 * @param {object} offsets
 */

function setOffsets(node, offsets) {
  var doc = node.ownerDocument || document;
  var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios.
  // (For instance: TinyMCE editor used in a list component that supports pasting to add more,
  // fails when pasting 100+ items)

  if (!win.getSelection) {
    return;
  }

  var selection = win.getSelection();
  var length = node.textContent.length;
  var start = Math.min(offsets.start, length);
  var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.
  // Flip backward selections, so we can set with a single range.

  if (!selection.extend && start > end) {
    var temp = end;
    end = start;
    start = temp;
  }

  var startMarker = getNodeForCharacterOffset(node, start);
  var endMarker = getNodeForCharacterOffset(node, end);

  if (startMarker && endMarker) {
    if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
      return;
    }

    var range = doc.createRange();
    range.setStart(startMarker.node, startMarker.offset);
    selection.removeAllRanges();

    if (start > end) {
      selection.addRange(range);
      selection.extend(endMarker.node, endMarker.offset);
    } else {
      range.setEnd(endMarker.node, endMarker.offset);
      selection.addRange(range);
    }
  }
}

function isTextNode(node) {
  return node && node.nodeType === TEXT_NODE;
}

function containsNode(outerNode, innerNode) {
  if (!outerNode || !innerNode) {
    return false;
  } else if (outerNode === innerNode) {
    return true;
  } else if (isTextNode(outerNode)) {
    return false;
  } else if (isTextNode(innerNode)) {
    return containsNode(outerNode, innerNode.parentNode);
  } else if ('contains' in outerNode) {
    return outerNode.contains(innerNode);
  } else if (outerNode.compareDocumentPosition) {
    return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  } else {
    return false;
  }
}

function isInDocument(node) {
  return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
}

function isSameOriginFrame(iframe) {
  try {
    // Accessing the contentDocument of a HTMLIframeElement can cause the browser
    // to throw, e.g. if it has a cross-origin src attribute.
    // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
    // iframe.contentDocument.defaultView;
    // A safety way is to access one of the cross origin properties: Window or Location
    // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
    // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl
    return typeof iframe.contentWindow.location.href === 'string';
  } catch (err) {
    return false;
  }
}

function getActiveElementDeep() {
  var win = window;
  var element = getActiveElement();

  while (element instanceof win.HTMLIFrameElement) {
    if (isSameOriginFrame(element)) {
      win = element.contentWindow;
    } else {
      return element;
    }

    element = getActiveElement(win.document);
  }

  return element;
}
/**
 * @ReactInputSelection: React input selection module. Based on Selection.js,
 * but modified to be suitable for react and has a couple of bug fixes (doesn't
 * assume buttons have range selections allowed).
 * Input selection module for React.
 */

/**
 * @hasSelectionCapabilities: we get the element types that support selection
 * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
 * and `selectionEnd` rows.
 */


function hasSelectionCapabilities(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
}
function getSelectionInformation() {
  var focusedElem = getActiveElementDeep();
  return {
    focusedElem: focusedElem,
    selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
  };
}
/**
 * @restoreSelection: If any selection information was potentially lost,
 * restore it. This is useful when performing operations that could remove dom
 * nodes and place them back in, resulting in focus being lost.
 */

function restoreSelection(priorSelectionInformation) {
  var curFocusedElem = getActiveElementDeep();
  var priorFocusedElem = priorSelectionInformation.focusedElem;
  var priorSelectionRange = priorSelectionInformation.selectionRange;

  if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
    if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
      setSelection(priorFocusedElem, priorSelectionRange);
    } // Focusing a node can change the scroll position, which is undesirable


    var ancestors = [];
    var ancestor = priorFocusedElem;

    while (ancestor = ancestor.parentNode) {
      if (ancestor.nodeType === ELEMENT_NODE) {
        ancestors.push({
          element: ancestor,
          left: ancestor.scrollLeft,
          top: ancestor.scrollTop
        });
      }
    }

    if (typeof priorFocusedElem.focus === 'function') {
      priorFocusedElem.focus();
    }

    for (var i = 0; i < ancestors.length; i++) {
      var info = ancestors[i];
      info.element.scrollLeft = info.left;
      info.element.scrollTop = info.top;
    }
  }
}
/**
 * @getSelection: Gets the selection bounds of a focused textarea, input or
 * contentEditable node.
 * -@input: Look up selection bounds of this input
 * -@return {start: selectionStart, end: selectionEnd}
 */

function getSelection(input) {
  var selection;

  if ('selectionStart' in input) {
    // Modern browser with input or textarea.
    selection = {
      start: input.selectionStart,
      end: input.selectionEnd
    };
  } else {
    // Content editable or old IE textarea.
    selection = getOffsets(input);
  }

  return selection || {
    start: 0,
    end: 0
  };
}
/**
 * @setSelection: Sets the selection bounds of a textarea or input and focuses
 * the input.
 * -@input     Set selection bounds of this input or textarea
 * -@offsets   Object of same form that is returned from get*
 */

function setSelection(input, offsets) {
  var start = offsets.start;
  var end = offsets.end;

  if (end === undefined) {
    end = start;
  }

  if ('selectionStart' in input) {
    input.selectionStart = start;
    input.selectionEnd = Math.min(end, input.value.length);
  } else {
    setOffsets(input, offsets);
  }
}

var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;

function registerEvents$3() {
  registerTwoPhaseEvent('onSelect', ['focusout', 'contextmenu', 'dragend', 'focusin', 'keydown', 'keyup', 'mousedown', 'mouseup', 'selectionchange']);
}

var activeElement$1 = null;
var activeElementInst$1 = null;
var lastSelection = null;
var mouseDown = false;
/**
 * Get an object which is a unique representation of the current selection.
 *
 * The return value will not be consistent across nodes or browsers, but
 * two identical selections on the same node will return identical objects.
 */

function getSelection$1(node) {
  if ('selectionStart' in node && hasSelectionCapabilities(node)) {
    return {
      start: node.selectionStart,
      end: node.selectionEnd
    };
  } else {
    var win = node.ownerDocument && node.ownerDocument.defaultView || window;
    var selection = win.getSelection();
    return {
      anchorNode: selection.anchorNode,
      anchorOffset: selection.anchorOffset,
      focusNode: selection.focusNode,
      focusOffset: selection.focusOffset
    };
  }
}
/**
 * Get document associated with the event target.
 */


function getEventTargetDocument(eventTarget) {
  return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
}
/**
 * Poll selection to see whether it's changed.
 *
 * @param {object} nativeEvent
 * @param {object} nativeEventTarget
 * @return {?SyntheticEvent}
 */


function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
  // Ensure we have the right element, and that the user is not dragging a
  // selection (this matches native `select` event behavior). In HTML5, select
  // fires only on input and textarea thus if there's no focused element we
  // won't dispatch.
  var doc = getEventTargetDocument(nativeEventTarget);

  if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
    return;
  } // Only fire when selection has actually changed.


  var currentSelection = getSelection$1(activeElement$1);

  if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
    lastSelection = currentSelection;
    var listeners = accumulateTwoPhaseListeners(activeElementInst$1, 'onSelect');

    if (listeners.length > 0) {
      var event = new SyntheticEvent('onSelect', 'select', null, nativeEvent, nativeEventTarget);
      dispatchQueue.push({
        event: event,
        listeners: listeners
      });
      event.target = activeElement$1;
    }
  }
}
/**
 * This plugin creates an `onSelect` event that normalizes select events
 * across form elements.
 *
 * Supported elements are:
 * - input (see `isTextInputElement`)
 * - textarea
 * - contentEditable
 *
 * This differs from native browser implementations in the following ways:
 * - Fires on contentEditable fields as well as inputs.
 * - Fires for collapsed selection.
 * - Fires after user input.
 */


function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {

  var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;

  switch (domEventName) {
    // Track the input node that has focus.
    case 'focusin':
      if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
        activeElement$1 = targetNode;
        activeElementInst$1 = targetInst;
        lastSelection = null;
      }

      break;

    case 'focusout':
      activeElement$1 = null;
      activeElementInst$1 = null;
      lastSelection = null;
      break;
    // Don't fire the event while the user is dragging. This matches the
    // semantics of the native select event.

    case 'mousedown':
      mouseDown = true;
      break;

    case 'contextmenu':
    case 'mouseup':
    case 'dragend':
      mouseDown = false;
      constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
      break;
    // Chrome and IE fire non-standard event when selection is changed (and
    // sometimes when it hasn't). IE's event fires out of order with respect
    // to key and input events on deletion, so we discard it.
    //
    // Firefox doesn't support selectionchange, so check selection status
    // after each key entry. The selection changes after keydown and before
    // keyup, but we check on keydown as well in the case of holding down a
    // key, when multiple keydown events are fired but only one keyup is.
    // This is also our approach for IE handling, for the reason above.

    case 'selectionchange':
      if (skipSelectionChangeEvent) {
        break;
      }

    // falls through

    case 'keydown':
    case 'keyup':
      constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
  }
}

function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  var reactName = topLevelEventsToReactNames.get(domEventName);

  if (reactName === undefined) {
    return;
  }

  var SyntheticEventCtor = SyntheticEvent;
  var reactEventType = domEventName;

  switch (domEventName) {
    case 'keypress':
      // Firefox creates a keypress event for function keys too. This removes
      // the unwanted keypress events. Enter is however both printable and
      // non-printable. One would expect Tab to be as well (but it isn't).
      if (getEventCharCode(nativeEvent) === 0) {
        return;
      }

    /* falls through */

    case 'keydown':
    case 'keyup':
      SyntheticEventCtor = SyntheticKeyboardEvent;
      break;

    case 'focusin':
      reactEventType = 'focus';
      SyntheticEventCtor = SyntheticFocusEvent;
      break;

    case 'focusout':
      reactEventType = 'blur';
      SyntheticEventCtor = SyntheticFocusEvent;
      break;

    case 'beforeblur':
    case 'afterblur':
      SyntheticEventCtor = SyntheticFocusEvent;
      break;

    case 'click':
      // Firefox creates a click event on right mouse clicks. This removes the
      // unwanted click events.
      if (nativeEvent.button === 2) {
        return;
      }

    /* falls through */

    case 'auxclick':
    case 'dblclick':
    case 'mousedown':
    case 'mousemove':
    case 'mouseup': // TODO: Disabled elements should not respond to mouse events

    /* falls through */

    case 'mouseout':
    case 'mouseover':
    case 'contextmenu':
      SyntheticEventCtor = SyntheticMouseEvent;
      break;

    case 'drag':
    case 'dragend':
    case 'dragenter':
    case 'dragexit':
    case 'dragleave':
    case 'dragover':
    case 'dragstart':
    case 'drop':
      SyntheticEventCtor = SyntheticDragEvent;
      break;

    case 'touchcancel':
    case 'touchend':
    case 'touchmove':
    case 'touchstart':
      SyntheticEventCtor = SyntheticTouchEvent;
      break;

    case ANIMATION_END:
    case ANIMATION_ITERATION:
    case ANIMATION_START:
      SyntheticEventCtor = SyntheticAnimationEvent;
      break;

    case TRANSITION_END:
      SyntheticEventCtor = SyntheticTransitionEvent;
      break;

    case 'scroll':
      SyntheticEventCtor = SyntheticUIEvent;
      break;

    case 'wheel':
      SyntheticEventCtor = SyntheticWheelEvent;
      break;

    case 'copy':
    case 'cut':
    case 'paste':
      SyntheticEventCtor = SyntheticClipboardEvent;
      break;

    case 'gotpointercapture':
    case 'lostpointercapture':
    case 'pointercancel':
    case 'pointerdown':
    case 'pointermove':
    case 'pointerout':
    case 'pointerover':
    case 'pointerup':
      SyntheticEventCtor = SyntheticPointerEvent;
      break;
  }

  var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;

  {
    // Some events don't bubble in the browser.
    // In the past, React has always bubbled them, but this can be surprising.
    // We're going to try aligning closer to the browser behavior by not bubbling
    // them in React either. We'll start by not bubbling onScroll, and then expand.
    var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from
    // nonDelegatedEvents list in DOMPluginEventSystem.
    // Then we can remove this special list.
    // This is a breaking change that can wait until React 18.
    domEventName === 'scroll';

    var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);

    if (_listeners.length > 0) {
      // Intentionally create event lazily.
      var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);

      dispatchQueue.push({
        event: _event,
        listeners: _listeners
      });
    }
  }
}

// TODO: remove top-level side effect.
registerSimpleEvents();
registerEvents$2();
registerEvents$1();
registerEvents$3();
registerEvents();

function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
  // TODO: we should remove the concept of a "SimpleEventPlugin".
  // This is the basic functionality of the event system. All
  // the other plugins are essentially polyfills. So the plugin
  // should probably be inlined somewhere and have its logic
  // be core the to event system. This would potentially allow
  // us to ship builds of React without the polyfilled plugins below.
  extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
  var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0; // We don't process these events unless we are in the
  // event's native "bubble" phase, which means that we're
  // not in the capture phase. That's because we emulate
  // the capture phase here still. This is a trade-off,
  // because in an ideal world we would not emulate and use
  // the phases properly, like we do with the SimpleEvent
  // plugin. However, the plugins below either expect
  // emulation (EnterLeave) or use state localized to that
  // plugin (BeforeInput, Change, Select). The state in
  // these modules complicates things, as you'll essentially
  // get the case where the capture phase event might change
  // state, only for the following bubble event to come in
  // later and not trigger anything as the state now
  // invalidates the heuristics of the event plugin. We
  // could alter all these plugins to work in such ways, but
  // that might cause other unknown side-effects that we
  // can't forsee right now.

  if (shouldProcessPolyfillPlugins) {
    extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
    extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
    extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
    extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
  }
} // List of events that need to be individually attached to media elements.


var mediaEventTypes = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'encrypted', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting']; // We should not delegate these events to the container, but rather
// set them on the actual target element itself. This is primarily
// because these events do not consistently bubble in the DOM.

var nonDelegatedEvents = new Set(['cancel', 'close', 'invalid', 'load', 'scroll', 'toggle'].concat(mediaEventTypes));

function executeDispatch(event, listener, currentTarget) {
  var type = event.type || 'unknown-event';
  event.currentTarget = currentTarget;
  invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
  event.currentTarget = null;
}

function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
  var previousInstance;

  if (inCapturePhase) {
    for (var i = dispatchListeners.length - 1; i >= 0; i--) {
      var _dispatchListeners$i = dispatchListeners[i],
          instance = _dispatchListeners$i.instance,
          currentTarget = _dispatchListeners$i.currentTarget,
          listener = _dispatchListeners$i.listener;

      if (instance !== previousInstance && event.isPropagationStopped()) {
        return;
      }

      executeDispatch(event, listener, currentTarget);
      previousInstance = instance;
    }
  } else {
    for (var _i = 0; _i < dispatchListeners.length; _i++) {
      var _dispatchListeners$_i = dispatchListeners[_i],
          _instance = _dispatchListeners$_i.instance,
          _currentTarget = _dispatchListeners$_i.currentTarget,
          _listener = _dispatchListeners$_i.listener;

      if (_instance !== previousInstance && event.isPropagationStopped()) {
        return;
      }

      executeDispatch(event, _listener, _currentTarget);
      previousInstance = _instance;
    }
  }
}

function processDispatchQueue(dispatchQueue, eventSystemFlags) {
  var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;

  for (var i = 0; i < dispatchQueue.length; i++) {
    var _dispatchQueue$i = dispatchQueue[i],
        event = _dispatchQueue$i.event,
        listeners = _dispatchQueue$i.listeners;
    processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); //  event system doesn't use pooling.
  } // This would be a good time to rethrow if any of the event handlers threw.


  rethrowCaughtError();
}

function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
  var nativeEventTarget = getEventTarget(nativeEvent);
  var dispatchQueue = [];
  extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
  processDispatchQueue(dispatchQueue, eventSystemFlags);
}

function listenToNonDelegatedEvent(domEventName, targetElement) {
  var isCapturePhaseListener = false;
  var listenerSet = getEventListenerSet(targetElement);
  var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);

  if (!listenerSet.has(listenerSetKey)) {
    addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
    listenerSet.add(listenerSetKey);
  }
}
var listeningMarker = '_reactListening' + Math.random().toString(36).slice(2);
function listenToAllSupportedEvents(rootContainerElement) {
  {
    if (rootContainerElement[listeningMarker]) {
      // Performance optimization: don't iterate through events
      // for the same portal container or root node more than once.
      // TODO: once we remove the flag, we may be able to also
      // remove some of the bookkeeping maps used for laziness.
      return;
    }

    rootContainerElement[listeningMarker] = true;
    allNativeEvents.forEach(function (domEventName) {
      if (!nonDelegatedEvents.has(domEventName)) {
        listenToNativeEvent(domEventName, false, rootContainerElement, null);
      }

      listenToNativeEvent(domEventName, true, rootContainerElement, null);
    });
  }
}
function listenToNativeEvent(domEventName, isCapturePhaseListener, rootContainerElement, targetElement) {
  var eventSystemFlags = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
  var target = rootContainerElement; // selectionchange needs to be attached to the document
  // otherwise it won't capture incoming events that are only
  // triggered on the document directly.

  if (domEventName === 'selectionchange' && rootContainerElement.nodeType !== DOCUMENT_NODE) {
    target = rootContainerElement.ownerDocument;
  } // If the event can be delegated (or is capture phase), we can
  // register it to the root container. Otherwise, we should
  // register the event to the target element and mark it as
  // a non-delegated event.


  if (targetElement !== null && !isCapturePhaseListener && nonDelegatedEvents.has(domEventName)) {
    // For all non-delegated events, apart from scroll, we attach
    // their event listeners to the respective elements that their
    // events fire on. That means we can skip this step, as event
    // listener has already been added previously. However, we
    // special case the scroll event because the reality is that any
    // element can scroll.
    // TODO: ideally, we'd eventually apply the same logic to all
    // events from the nonDelegatedEvents list. Then we can remove
    // this special case and use the same logic for all events.
    if (domEventName !== 'scroll') {
      return;
    }

    eventSystemFlags |= IS_NON_DELEGATED;
    target = targetElement;
  }

  var listenerSet = getEventListenerSet(target);
  var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener); // If the listener entry is empty or we should upgrade, then
  // we need to trap an event listener onto the target.

  if (!listenerSet.has(listenerSetKey)) {
    if (isCapturePhaseListener) {
      eventSystemFlags |= IS_CAPTURE_PHASE;
    }

    addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
    listenerSet.add(listenerSetKey);
  }
}

function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
  var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags); // If passive option is not supported, then the event will be
  // active and not passive.

  var isPassiveListener = undefined;

  if (passiveBrowserEventsSupported) {
    // Browsers introduced an intervention, making these events
    // passive by default on document. React doesn't bind them
    // to document anymore, but changing this now would undo
    // the performance wins from the change. So we emulate
    // the existing behavior manually on the roots now.
    // https://github.com/facebook/react/issues/19651
    if (domEventName === 'touchstart' || domEventName === 'touchmove' || domEventName === 'wheel') {
      isPassiveListener = true;
    }
  }

  targetContainer =  targetContainer;
  var unsubscribeListener; // When legacyFBSupport is enabled, it's for when we


  if (isCapturePhaseListener) {
    if (isPassiveListener !== undefined) {
      unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
    } else {
      unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);
    }
  } else {
    if (isPassiveListener !== undefined) {
      unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
    } else {
      unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);
    }
  }
}

function isMatchingRootContainer(grandContainer, targetContainer) {
  return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
}

function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
  var ancestorInst = targetInst;

  if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
    var targetContainerNode = targetContainer; // If we are using the legacy FB support flag, we

    if (targetInst !== null) {
      // The below logic attempts to work out if we need to change
      // the target fiber to a different ancestor. We had similar logic
      // in the legacy event system, except the big difference between
      // systems is that the modern event system now has an event listener
      // attached to each React Root and React Portal Root. Together,
      // the DOM nodes representing these roots are the "rootContainer".
      // To figure out which ancestor instance we should use, we traverse
      // up the fiber tree from the target instance and attempt to find
      // root boundaries that match that of our current "rootContainer".
      // If we find that "rootContainer", we find the parent fiber
      // sub-tree for that root and make that our ancestor instance.
      var node = targetInst;

      mainLoop: while (true) {
        if (node === null) {
          return;
        }

        var nodeTag = node.tag;

        if (nodeTag === HostRoot || nodeTag === HostPortal) {
          var container = node.stateNode.containerInfo;

          if (isMatchingRootContainer(container, targetContainerNode)) {
            break;
          }

          if (nodeTag === HostPortal) {
            // The target is a portal, but it's not the rootContainer we're looking for.
            // Normally portals handle their own events all the way down to the root.
            // So we should be able to stop now. However, we don't know if this portal
            // was part of *our* root.
            var grandNode = node.return;

            while (grandNode !== null) {
              var grandTag = grandNode.tag;

              if (grandTag === HostRoot || grandTag === HostPortal) {
                var grandContainer = grandNode.stateNode.containerInfo;

                if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
                  // This is the rootContainer we're looking for and we found it as
                  // a parent of the Portal. That means we can ignore it because the
                  // Portal will bubble through to us.
                  return;
                }
              }

              grandNode = grandNode.return;
            }
          } // Now we need to find it's corresponding host fiber in the other
          // tree. To do this we can use getClosestInstanceFromNode, but we
          // need to validate that the fiber is a host instance, otherwise
          // we need to traverse up through the DOM till we find the correct
          // node that is from the other tree.


          while (container !== null) {
            var parentNode = getClosestInstanceFromNode(container);

            if (parentNode === null) {
              return;
            }

            var parentTag = parentNode.tag;

            if (parentTag === HostComponent || parentTag === HostText) {
              node = ancestorInst = parentNode;
              continue mainLoop;
            }

            container = container.parentNode;
          }
        }

        node = node.return;
      }
    }
  }

  batchedEventUpdates(function () {
    return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
  });
}

function createDispatchListener(instance, listener, currentTarget) {
  return {
    instance: instance,
    listener: listener,
    currentTarget: currentTarget
  };
}

function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly) {
  var captureName = reactName !== null ? reactName + 'Capture' : null;
  var reactEventName = inCapturePhase ? captureName : reactName;
  var listeners = [];
  var instance = targetFiber;
  var lastHostComponent = null; // Accumulate all instances and listeners via the target -> root path.

  while (instance !== null) {
    var _instance2 = instance,
        stateNode = _instance2.stateNode,
        tag = _instance2.tag; // Handle listeners that are on HostComponents (i.e. <div>)

    if (tag === HostComponent && stateNode !== null) {
      lastHostComponent = stateNode; // createEventHandle listeners


      if (reactEventName !== null) {
        var listener = getListener(instance, reactEventName);

        if (listener != null) {
          listeners.push(createDispatchListener(instance, listener, lastHostComponent));
        }
      }
    } // If we are only accumulating events for the target, then we don't
    // continue to propagate through the React fiber tree to find other
    // listeners.


    if (accumulateTargetOnly) {
      break;
    }

    instance = instance.return;
  }

  return listeners;
} // We should only use this function for:
// - BeforeInputEventPlugin
// - ChangeEventPlugin
// - SelectEventPlugin
// This is because we only process these plugins
// in the bubble phase, so we need to accumulate two
// phase event listeners (via emulation).

function accumulateTwoPhaseListeners(targetFiber, reactName) {
  var captureName = reactName + 'Capture';
  var listeners = [];
  var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.

  while (instance !== null) {
    var _instance3 = instance,
        stateNode = _instance3.stateNode,
        tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)

    if (tag === HostComponent && stateNode !== null) {
      var currentTarget = stateNode;
      var captureListener = getListener(instance, captureName);

      if (captureListener != null) {
        listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
      }

      var bubbleListener = getListener(instance, reactName);

      if (bubbleListener != null) {
        listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
      }
    }

    instance = instance.return;
  }

  return listeners;
}

function getParent(inst) {
  if (inst === null) {
    return null;
  }

  do {
    inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.
    // That is depending on if we want nested subtrees (layers) to bubble
    // events to their parent. We could also go through parentNode on the
    // host node but that wouldn't work for React Native and doesn't let us
    // do the portal feature.
  } while (inst && inst.tag !== HostComponent);

  if (inst) {
    return inst;
  }

  return null;
}
/**
 * Return the lowest common ancestor of A and B, or null if they are in
 * different trees.
 */


function getLowestCommonAncestor(instA, instB) {
  var nodeA = instA;
  var nodeB = instB;
  var depthA = 0;

  for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
    depthA++;
  }

  var depthB = 0;

  for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
    depthB++;
  } // If A is deeper, crawl up.


  while (depthA - depthB > 0) {
    nodeA = getParent(nodeA);
    depthA--;
  } // If B is deeper, crawl up.


  while (depthB - depthA > 0) {
    nodeB = getParent(nodeB);
    depthB--;
  } // Walk in lockstep until we find a match.


  var depth = depthA;

  while (depth--) {
    if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
      return nodeA;
    }

    nodeA = getParent(nodeA);
    nodeB = getParent(nodeB);
  }

  return null;
}

function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
  var registrationName = event._reactName;
  var listeners = [];
  var instance = target;

  while (instance !== null) {
    if (instance === common) {
      break;
    }

    var _instance4 = instance,
        alternate = _instance4.alternate,
        stateNode = _instance4.stateNode,
        tag = _instance4.tag;

    if (alternate !== null && alternate === common) {
      break;
    }

    if (tag === HostComponent && stateNode !== null) {
      var currentTarget = stateNode;

      if (inCapturePhase) {
        var captureListener = getListener(instance, registrationName);

        if (captureListener != null) {
          listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
        }
      } else if (!inCapturePhase) {
        var bubbleListener = getListener(instance, registrationName);

        if (bubbleListener != null) {
          listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
        }
      }
    }

    instance = instance.return;
  }

  if (listeners.length !== 0) {
    dispatchQueue.push({
      event: event,
      listeners: listeners
    });
  }
} // We should only use this function for:
// - EnterLeaveEventPlugin
// This is because we only process this plugin
// in the bubble phase, so we need to accumulate two
// phase event listeners.


function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
  var common = from && to ? getLowestCommonAncestor(from, to) : null;

  if (from !== null) {
    accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
  }

  if (to !== null && enterEvent !== null) {
    accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
  }
}
function getListenerSetKey(domEventName, capture) {
  return domEventName + "__" + (capture ? 'capture' : 'bubble');
}

var didWarnInvalidHydration = false;
var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
var AUTOFOCUS = 'autoFocus';
var CHILDREN = 'children';
var STYLE = 'style';
var HTML$1 = '__html';
var HTML_NAMESPACE$1 = Namespaces.html;
var warnedUnknownTags;
var suppressHydrationWarning;
var validatePropertiesInDevelopment;
var warnForTextDifference;
var warnForPropDifference;
var warnForExtraAttributes;
var warnForInvalidEventListener;
var canDiffStyleForHydrationWarning;
var normalizeMarkupForTextOrAttribute;
var normalizeHTML;

{
  warnedUnknownTags = {
    // There are working polyfills for <dialog>. Let people use it.
    dialog: true,
    // Electron ships a custom <webview> tag to display external web content in
    // an isolated frame and process.
    // This tag is not present in non Electron environments such as JSDom which
    // is often used for testing purposes.
    // @see https://electronjs.org/docs/api/webview-tag
    webview: true
  };

  validatePropertiesInDevelopment = function (type, props) {
    validateProperties(type, props);
    validateProperties$1(type, props);
    validateProperties$2(type, props, {
      registrationNameDependencies: registrationNameDependencies,
      possibleRegistrationNames: possibleRegistrationNames
    });
  }; // IE 11 parses & normalizes the style attribute as opposed to other
  // browsers. It adds spaces and sorts the properties in some
  // non-alphabetical order. Handling that would require sorting CSS
  // properties in the client & server versions or applying
  // `expectedStyle` to a temporary DOM node to read its `style` attribute
  // normalized. Since it only affects IE, we're skipping style warnings
  // in that browser completely in favor of doing all that work.
  // See https://github.com/facebook/react/issues/11807


  canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.
  // It also can turn \u0000 into \uFFFD inside attributes.
  // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream
  // If we have a mismatch, it might be caused by that.
  // We will still patch up in this case but not fire the warning.

  var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
  var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;

  normalizeMarkupForTextOrAttribute = function (markup) {
    var markupString = typeof markup === 'string' ? markup : '' + markup;
    return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
  };

  warnForTextDifference = function (serverText, clientText) {
    if (didWarnInvalidHydration) {
      return;
    }

    var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
    var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);

    if (normalizedServerText === normalizedClientText) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
  };

  warnForPropDifference = function (propName, serverValue, clientValue) {
    if (didWarnInvalidHydration) {
      return;
    }

    var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
    var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);

    if (normalizedServerValue === normalizedClientValue) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
  };

  warnForExtraAttributes = function (attributeNames) {
    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;
    var names = [];
    attributeNames.forEach(function (name) {
      names.push(name);
    });

    error('Extra attributes from the server: %s', names);
  };

  warnForInvalidEventListener = function (registrationName, listener) {
    if (listener === false) {
      error('Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
    } else {
      error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
    }
  }; // Parse the HTML and read it back to normalize the HTML string so that it
  // can be used for comparison.


  normalizeHTML = function (parent, html) {
    // We could have created a separate document here to avoid
    // re-initializing custom elements if they exist. But this breaks
    // how <noscript> is being handled. So we use the same document.
    // See the discussion in https://github.com/facebook/react/pull/11157.
    var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
    testElement.innerHTML = html;
    return testElement.innerHTML;
  };
}

function getOwnerDocumentFromRootContainer(rootContainerElement) {
  return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
}

function noop() {}

function trapClickOnNonInteractiveElement(node) {
  // Mobile Safari does not fire properly bubble click events on
  // non-interactive elements, which means delegated click listeners do not
  // fire. The workaround for this bug involves attaching an empty click
  // listener on the target node.
  // https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  // Just set it using the onclick property so that we don't have to manage any
  // bookkeeping for it. Not sure if we need to clear it when the listener is
  // removed.
  // TODO: Only do this for the relevant Safaris maybe?
  node.onclick = noop;
}

function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
  for (var propKey in nextProps) {
    if (!nextProps.hasOwnProperty(propKey)) {
      continue;
    }

    var nextProp = nextProps[propKey];

    if (propKey === STYLE) {
      {
        if (nextProp) {
          // Freeze the next style object so that we can assume it won't be
          // mutated. We have already warned for this in the past.
          Object.freeze(nextProp);
        }
      } // Relies on `updateStylesByID` not mutating `styleUpdates`.


      setValueForStyles(domElement, nextProp);
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      var nextHtml = nextProp ? nextProp[HTML$1] : undefined;

      if (nextHtml != null) {
        setInnerHTML(domElement, nextHtml);
      }
    } else if (propKey === CHILDREN) {
      if (typeof nextProp === 'string') {
        // Avoid setting initial textContent when the text is empty. In IE11 setting
        // textContent on a <textarea> will cause the placeholder to not
        // show within the <textarea> until it has been focused and blurred again.
        // https://github.com/facebook/react/issues/6731#issuecomment-254874553
        var canSetTextContent = tag !== 'textarea' || nextProp !== '';

        if (canSetTextContent) {
          setTextContent(domElement, nextProp);
        }
      } else if (typeof nextProp === 'number') {
        setTextContent(domElement, '' + nextProp);
      }
    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        if ( typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }

        if (propKey === 'onScroll') {
          listenToNonDelegatedEvent('scroll', domElement);
        }
      }
    } else if (nextProp != null) {
      setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
    }
  }
}

function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
  // TODO: Handle wasCustomComponentTag
  for (var i = 0; i < updatePayload.length; i += 2) {
    var propKey = updatePayload[i];
    var propValue = updatePayload[i + 1];

    if (propKey === STYLE) {
      setValueForStyles(domElement, propValue);
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      setInnerHTML(domElement, propValue);
    } else if (propKey === CHILDREN) {
      setTextContent(domElement, propValue);
    } else {
      setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
    }
  }
}

function createElement(type, props, rootContainerElement, parentNamespace) {
  var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML
  // tags get no namespace.

  var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
  var domElement;
  var namespaceURI = parentNamespace;

  if (namespaceURI === HTML_NAMESPACE$1) {
    namespaceURI = getIntrinsicNamespace(type);
  }

  if (namespaceURI === HTML_NAMESPACE$1) {
    {
      isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to
      // allow <SVG> or <mATH>.

      if (!isCustomComponentTag && type !== type.toLowerCase()) {
        error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);
      }
    }

    if (type === 'script') {
      // Create the script via .innerHTML so its "parser-inserted" flag is
      // set to true and it does not execute
      var div = ownerDocument.createElement('div');

      div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
      // This is guaranteed to yield a script element.

      var firstChild = div.firstChild;
      domElement = div.removeChild(firstChild);
    } else if (typeof props.is === 'string') {
      // $FlowIssue `createElement` should be updated for Web Components
      domElement = ownerDocument.createElement(type, {
        is: props.is
      });
    } else {
      // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
      // See discussion in https://github.com/facebook/react/pull/6896
      // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
      domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`
      // attributes on `select`s needs to be added before `option`s are inserted.
      // This prevents:
      // - a bug where the `select` does not scroll to the correct option because singular
      //  `select` elements automatically pick the first item #13222
      // - a bug where the `select` set the first item as selected despite the `size` attribute #14239
      // See https://github.com/facebook/react/issues/13222
      // and https://github.com/facebook/react/issues/14239

      if (type === 'select') {
        var node = domElement;

        if (props.multiple) {
          node.multiple = true;
        } else if (props.size) {
          // Setting a size greater than 1 causes a select to behave like `multiple=true`, where
          // it is possible that no option is selected.
          //
          // This is only necessary when a select in "single selection mode".
          node.size = props.size;
        }
      }
    }
  } else {
    domElement = ownerDocument.createElementNS(namespaceURI, type);
  }

  {
    if (namespaceURI === HTML_NAMESPACE$1) {
      if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
        warnedUnknownTags[type] = true;

        error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
      }
    }
  }

  return domElement;
}
function createTextNode(text, rootContainerElement) {
  return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
}
function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
  var isCustomComponentTag = isCustomComponent(tag, rawProps);

  {
    validatePropertiesInDevelopment(tag, rawProps);
  } // TODO: Make sure that we check isMounted before firing any of these events.


  var props;

  switch (tag) {
    case 'dialog':
      listenToNonDelegatedEvent('cancel', domElement);
      listenToNonDelegatedEvent('close', domElement);
      props = rawProps;
      break;

    case 'iframe':
    case 'object':
    case 'embed':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the load event.
      listenToNonDelegatedEvent('load', domElement);
      props = rawProps;
      break;

    case 'video':
    case 'audio':
      // We listen to these events in case to ensure emulated bubble
      // listeners still fire for all the media events.
      for (var i = 0; i < mediaEventTypes.length; i++) {
        listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
      }

      props = rawProps;
      break;

    case 'source':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the error event.
      listenToNonDelegatedEvent('error', domElement);
      props = rawProps;
      break;

    case 'img':
    case 'image':
    case 'link':
      // We listen to these events in case to ensure emulated bubble
      // listeners still fire for error and load events.
      listenToNonDelegatedEvent('error', domElement);
      listenToNonDelegatedEvent('load', domElement);
      props = rawProps;
      break;

    case 'details':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the toggle event.
      listenToNonDelegatedEvent('toggle', domElement);
      props = rawProps;
      break;

    case 'input':
      initWrapperState(domElement, rawProps);
      props = getHostProps(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    case 'option':
      validateProps(domElement, rawProps);
      props = getHostProps$1(domElement, rawProps);
      break;

    case 'select':
      initWrapperState$1(domElement, rawProps);
      props = getHostProps$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    case 'textarea':
      initWrapperState$2(domElement, rawProps);
      props = getHostProps$3(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    default:
      props = rawProps;
  }

  assertValidProps(tag, props);
  setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);

  switch (tag) {
    case 'input':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper(domElement, rawProps, false);
      break;

    case 'textarea':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper$3(domElement);
      break;

    case 'option':
      postMountWrapper$1(domElement, rawProps);
      break;

    case 'select':
      postMountWrapper$2(domElement, rawProps);
      break;

    default:
      if (typeof props.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }

      break;
  }
} // Calculate the diff between the two objects.

function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
  {
    validatePropertiesInDevelopment(tag, nextRawProps);
  }

  var updatePayload = null;
  var lastProps;
  var nextProps;

  switch (tag) {
    case 'input':
      lastProps = getHostProps(domElement, lastRawProps);
      nextProps = getHostProps(domElement, nextRawProps);
      updatePayload = [];
      break;

    case 'option':
      lastProps = getHostProps$1(domElement, lastRawProps);
      nextProps = getHostProps$1(domElement, nextRawProps);
      updatePayload = [];
      break;

    case 'select':
      lastProps = getHostProps$2(domElement, lastRawProps);
      nextProps = getHostProps$2(domElement, nextRawProps);
      updatePayload = [];
      break;

    case 'textarea':
      lastProps = getHostProps$3(domElement, lastRawProps);
      nextProps = getHostProps$3(domElement, nextRawProps);
      updatePayload = [];
      break;

    default:
      lastProps = lastRawProps;
      nextProps = nextRawProps;

      if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }

      break;
  }

  assertValidProps(tag, nextProps);
  var propKey;
  var styleName;
  var styleUpdates = null;

  for (propKey in lastProps) {
    if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
      continue;
    }

    if (propKey === STYLE) {
      var lastStyle = lastProps[propKey];

      for (styleName in lastStyle) {
        if (lastStyle.hasOwnProperty(styleName)) {
          if (!styleUpdates) {
            styleUpdates = {};
          }

          styleUpdates[styleName] = '';
        }
      }
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {
      // This is a special case. If any listener updates we need to ensure
      // that the "current" fiber pointer gets updated so we need a commit
      // to update this element.
      if (!updatePayload) {
        updatePayload = [];
      }
    } else {
      // For all other deleted properties we add it to the queue. We use
      // the allowed property list in the commit phase instead.
      (updatePayload = updatePayload || []).push(propKey, null);
    }
  }

  for (propKey in nextProps) {
    var nextProp = nextProps[propKey];
    var lastProp = lastProps != null ? lastProps[propKey] : undefined;

    if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
      continue;
    }

    if (propKey === STYLE) {
      {
        if (nextProp) {
          // Freeze the next style object so that we can assume it won't be
          // mutated. We have already warned for this in the past.
          Object.freeze(nextProp);
        }
      }

      if (lastProp) {
        // Unset styles on `lastProp` but not on `nextProp`.
        for (styleName in lastProp) {
          if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
            if (!styleUpdates) {
              styleUpdates = {};
            }

            styleUpdates[styleName] = '';
          }
        } // Update styles that changed since `lastProp`.


        for (styleName in nextProp) {
          if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
            if (!styleUpdates) {
              styleUpdates = {};
            }

            styleUpdates[styleName] = nextProp[styleName];
          }
        }
      } else {
        // Relies on `updateStylesByID` not mutating `styleUpdates`.
        if (!styleUpdates) {
          if (!updatePayload) {
            updatePayload = [];
          }

          updatePayload.push(propKey, styleUpdates);
        }

        styleUpdates = nextProp;
      }
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      var nextHtml = nextProp ? nextProp[HTML$1] : undefined;
      var lastHtml = lastProp ? lastProp[HTML$1] : undefined;

      if (nextHtml != null) {
        if (lastHtml !== nextHtml) {
          (updatePayload = updatePayload || []).push(propKey, nextHtml);
        }
      }
    } else if (propKey === CHILDREN) {
      if (typeof nextProp === 'string' || typeof nextProp === 'number') {
        (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
      }
    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        // We eagerly listen to this even though we haven't committed yet.
        if ( typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }

        if (propKey === 'onScroll') {
          listenToNonDelegatedEvent('scroll', domElement);
        }
      }

      if (!updatePayload && lastProp !== nextProp) {
        // This is a special case. If any listener updates we need to ensure
        // that the "current" props pointer gets updated so we need a commit
        // to update this element.
        updatePayload = [];
      }
    } else if (typeof nextProp === 'object' && nextProp !== null && nextProp.$$typeof === REACT_OPAQUE_ID_TYPE) {
      // If we encounter useOpaqueReference's opaque object, this means we are hydrating.
      // In this case, call the opaque object's toString function which generates a new client
      // ID so client and server IDs match and throws to rerender.
      nextProp.toString();
    } else {
      // For any other property we always add it to the queue and then we
      // filter it out using the allowed property list during the commit.
      (updatePayload = updatePayload || []).push(propKey, nextProp);
    }
  }

  if (styleUpdates) {
    {
      validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
    }

    (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
  }

  return updatePayload;
} // Apply the diff.

function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
  // Update checked *before* name.
  // In the middle of an update, it is possible to have multiple checked.
  // When a checked radio tries to change name, browser makes another radio's checked false.
  if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
    updateChecked(domElement, nextRawProps);
  }

  var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
  var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.

  updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props
  // changed.

  switch (tag) {
    case 'input':
      // Update the wrapper around inputs *after* updating props. This has to
      // happen after `updateDOMProperties`. Otherwise HTML5 input validations
      // raise warnings and prevent the new value from being assigned.
      updateWrapper(domElement, nextRawProps);
      break;

    case 'textarea':
      updateWrapper$1(domElement, nextRawProps);
      break;

    case 'select':
      // <select> value update needs to occur after <option> children
      // reconciliation
      postUpdateWrapper(domElement, nextRawProps);
      break;
  }
}

function getPossibleStandardName(propName) {
  {
    var lowerCasedName = propName.toLowerCase();

    if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
      return null;
    }

    return possibleStandardNames[lowerCasedName] || null;
  }
}

function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
  var isCustomComponentTag;
  var extraAttributeNames;

  {
    suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;
    isCustomComponentTag = isCustomComponent(tag, rawProps);
    validatePropertiesInDevelopment(tag, rawProps);
  } // TODO: Make sure that we check isMounted before firing any of these events.


  switch (tag) {
    case 'dialog':
      listenToNonDelegatedEvent('cancel', domElement);
      listenToNonDelegatedEvent('close', domElement);
      break;

    case 'iframe':
    case 'object':
    case 'embed':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the load event.
      listenToNonDelegatedEvent('load', domElement);
      break;

    case 'video':
    case 'audio':
      // We listen to these events in case to ensure emulated bubble
      // listeners still fire for all the media events.
      for (var i = 0; i < mediaEventTypes.length; i++) {
        listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
      }

      break;

    case 'source':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the error event.
      listenToNonDelegatedEvent('error', domElement);
      break;

    case 'img':
    case 'image':
    case 'link':
      // We listen to these events in case to ensure emulated bubble
      // listeners still fire for error and load events.
      listenToNonDelegatedEvent('error', domElement);
      listenToNonDelegatedEvent('load', domElement);
      break;

    case 'details':
      // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the toggle event.
      listenToNonDelegatedEvent('toggle', domElement);
      break;

    case 'input':
      initWrapperState(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    case 'option':
      validateProps(domElement, rawProps);
      break;

    case 'select':
      initWrapperState$1(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;

    case 'textarea':
      initWrapperState$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble
      // listeners still fire for the invalid event.

      listenToNonDelegatedEvent('invalid', domElement);

      break;
  }

  assertValidProps(tag, rawProps);

  {
    extraAttributeNames = new Set();
    var attributes = domElement.attributes;

    for (var _i = 0; _i < attributes.length; _i++) {
      var name = attributes[_i].name.toLowerCase();

      switch (name) {
        // Built-in SSR attribute is allowed
        case 'data-reactroot':
          break;
        // Controlled attributes are not validated
        // TODO: Only ignore them on controlled tags.

        case 'value':
          break;

        case 'checked':
          break;

        case 'selected':
          break;

        default:
          // Intentionally use the original name.
          // See discussion in https://github.com/facebook/react/pull/10676.
          extraAttributeNames.add(attributes[_i].name);
      }
    }
  }

  var updatePayload = null;

  for (var propKey in rawProps) {
    if (!rawProps.hasOwnProperty(propKey)) {
      continue;
    }

    var nextProp = rawProps[propKey];

    if (propKey === CHILDREN) {
      // For text content children we compare against textContent. This
      // might match additional HTML that is hidden when we read it using
      // textContent. E.g. "foo" will match "f<span>oo</span>" but that still
      // satisfies our requirement. Our requirement is not to produce perfect
      // HTML and attributes. Ideally we should preserve structure but it's
      // ok not to if the visible content is still enough to indicate what
      // even listeners these nodes might be wired up to.
      // TODO: Warn if there is more than a single textNode as a child.
      // TODO: Should we use domElement.firstChild.nodeValue to compare?
      if (typeof nextProp === 'string') {
        if (domElement.textContent !== nextProp) {
          if ( !suppressHydrationWarning) {
            warnForTextDifference(domElement.textContent, nextProp);
          }

          updatePayload = [CHILDREN, nextProp];
        }
      } else if (typeof nextProp === 'number') {
        if (domElement.textContent !== '' + nextProp) {
          if ( !suppressHydrationWarning) {
            warnForTextDifference(domElement.textContent, nextProp);
          }

          updatePayload = [CHILDREN, '' + nextProp];
        }
      }
    } else if (registrationNameDependencies.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        if ( typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }

        if (propKey === 'onScroll') {
          listenToNonDelegatedEvent('scroll', domElement);
        }
      }
    } else if ( // Convince Flow we've calculated it (it's DEV-only in this method.)
    typeof isCustomComponentTag === 'boolean') {
      // Validate that the properties correspond to their expected values.
      var serverValue = void 0;
      var propertyInfo = getPropertyInfo(propKey);

      if (suppressHydrationWarning) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated
      // TODO: Only ignore them on controlled tags.
      propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
        var serverHTML = domElement.innerHTML;
        var nextHtml = nextProp ? nextProp[HTML$1] : undefined;

        if (nextHtml != null) {
          var expectedHTML = normalizeHTML(domElement, nextHtml);

          if (expectedHTML !== serverHTML) {
            warnForPropDifference(propKey, serverHTML, expectedHTML);
          }
        }
      } else if (propKey === STYLE) {
        // $FlowFixMe - Should be inferred as not undefined.
        extraAttributeNames.delete(propKey);

        if (canDiffStyleForHydrationWarning) {
          var expectedStyle = createDangerousStringForStyles(nextProp);
          serverValue = domElement.getAttribute('style');

          if (expectedStyle !== serverValue) {
            warnForPropDifference(propKey, serverValue, expectedStyle);
          }
        }
      } else if (isCustomComponentTag) {
        // $FlowFixMe - Should be inferred as not undefined.
        extraAttributeNames.delete(propKey.toLowerCase());
        serverValue = getValueForAttribute(domElement, propKey, nextProp);

        if (nextProp !== serverValue) {
          warnForPropDifference(propKey, serverValue, nextProp);
        }
      } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
        var isMismatchDueToBadCasing = false;

        if (propertyInfo !== null) {
          // $FlowFixMe - Should be inferred as not undefined.
          extraAttributeNames.delete(propertyInfo.attributeName);
          serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
        } else {
          var ownNamespace = parentNamespace;

          if (ownNamespace === HTML_NAMESPACE$1) {
            ownNamespace = getIntrinsicNamespace(tag);
          }

          if (ownNamespace === HTML_NAMESPACE$1) {
            // $FlowFixMe - Should be inferred as not undefined.
            extraAttributeNames.delete(propKey.toLowerCase());
          } else {
            var standardName = getPossibleStandardName(propKey);

            if (standardName !== null && standardName !== propKey) {
              // If an SVG prop is supplied with bad casing, it will
              // be successfully parsed from HTML, but will produce a mismatch
              // (and would be incorrectly rendered on the client).
              // However, we already warn about bad casing elsewhere.
              // So we'll skip the misleading extra mismatch warning in this case.
              isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.

              extraAttributeNames.delete(standardName);
            } // $FlowFixMe - Should be inferred as not undefined.


            extraAttributeNames.delete(propKey);
          }

          serverValue = getValueForAttribute(domElement, propKey, nextProp);
        }

        if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
          warnForPropDifference(propKey, serverValue, nextProp);
        }
      }
    }
  }

  {
    // $FlowFixMe - Should be inferred as not undefined.
    if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
      // $FlowFixMe - Should be inferred as not undefined.
      warnForExtraAttributes(extraAttributeNames);
    }
  }

  switch (tag) {
    case 'input':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper(domElement, rawProps, true);
      break;

    case 'textarea':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper$3(domElement);
      break;

    case 'select':
    case 'option':
      // For input and textarea we current always set the value property at
      // post mount to force it to diverge from attributes. However, for
      // option and select we don't quite do the same thing and select
      // is not resilient to the DOM state changing so we don't do that here.
      // TODO: Consider not doing this for input and textarea.
      break;

    default:
      if (typeof rawProps.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }

      break;
  }

  return updatePayload;
}
function diffHydratedText(textNode, text) {
  var isDifferent = textNode.nodeValue !== text;
  return isDifferent;
}
function warnForUnmatchedText(textNode, text) {
  {
    warnForTextDifference(textNode.nodeValue, text);
  }
}
function warnForDeletedHydratableElement(parentNode, child) {
  {
    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
  }
}
function warnForDeletedHydratableText(parentNode, child) {
  {
    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
  }
}
function warnForInsertedHydratedElement(parentNode, tag, props) {
  {
    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
  }
}
function warnForInsertedHydratedText(parentNode, text) {
  {
    if (text === '') {
      // We expect to insert empty text nodes since they're not represented in
      // the HTML.
      // TODO: Remove this special case if we can just avoid inserting empty
      // text nodes.
      return;
    }

    if (didWarnInvalidHydration) {
      return;
    }

    didWarnInvalidHydration = true;

    error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
  }
}
function restoreControlledState$3(domElement, tag, props) {
  switch (tag) {
    case 'input':
      restoreControlledState(domElement, props);
      return;

    case 'textarea':
      restoreControlledState$2(domElement, props);
      return;

    case 'select':
      restoreControlledState$1(domElement, props);
      return;
  }
}

var validateDOMNesting = function () {};

var updatedAncestorInfo = function () {};

{
  // This validation code was written based on the HTML5 parsing spec:
  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  //
  // Note: this does not catch all invalid nesting, nor does it try to (as it's
  // not clear what practical benefit doing so provides); instead, we warn only
  // for cases where the parser will give a parse tree differing from what React
  // intended. For example, <b><div></div></b> is invalid but we don't warn
  // because it still parses correctly; we do warn for other cases like nested
  // <p> tags where the beginning of the second element implicitly closes the
  // first, causing a confusing mess.
  // https://html.spec.whatwg.org/multipage/syntax.html#special
  var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope

  var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
  // TODO: Distinguish by namespace here -- for <title>, including it here
  // errs on the side of fewer warnings
  'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope

  var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags

  var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
  var emptyAncestorInfo = {
    current: null,
    formTag: null,
    aTagInScope: null,
    buttonTagInScope: null,
    nobrTagInScope: null,
    pTagInButtonScope: null,
    listItemTagAutoclosing: null,
    dlItemTagAutoclosing: null
  };

  updatedAncestorInfo = function (oldInfo, tag) {
    var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);

    var info = {
      tag: tag
    };

    if (inScopeTags.indexOf(tag) !== -1) {
      ancestorInfo.aTagInScope = null;
      ancestorInfo.buttonTagInScope = null;
      ancestorInfo.nobrTagInScope = null;
    }

    if (buttonScopeTags.indexOf(tag) !== -1) {
      ancestorInfo.pTagInButtonScope = null;
    } // See rules for 'li', 'dd', 'dt' start tags in
    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody


    if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
      ancestorInfo.listItemTagAutoclosing = null;
      ancestorInfo.dlItemTagAutoclosing = null;
    }

    ancestorInfo.current = info;

    if (tag === 'form') {
      ancestorInfo.formTag = info;
    }

    if (tag === 'a') {
      ancestorInfo.aTagInScope = info;
    }

    if (tag === 'button') {
      ancestorInfo.buttonTagInScope = info;
    }

    if (tag === 'nobr') {
      ancestorInfo.nobrTagInScope = info;
    }

    if (tag === 'p') {
      ancestorInfo.pTagInButtonScope = info;
    }

    if (tag === 'li') {
      ancestorInfo.listItemTagAutoclosing = info;
    }

    if (tag === 'dd' || tag === 'dt') {
      ancestorInfo.dlItemTagAutoclosing = info;
    }

    return ancestorInfo;
  };
  /**
   * Returns whether
   */


  var isTagValidWithParent = function (tag, parentTag) {
    // First, let's check if we're in an unusual parsing mode...
    switch (parentTag) {
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
      case 'select':
        return tag === 'option' || tag === 'optgroup' || tag === '#text';

      case 'optgroup':
        return tag === 'option' || tag === '#text';
      // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
      // but

      case 'option':
        return tag === '#text';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
      // No special behavior since these rules fall back to "in body" mode for
      // all except special table nodes which cause bad parsing behavior anyway.
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr

      case 'tr':
        return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody

      case 'tbody':
      case 'thead':
      case 'tfoot':
        return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup

      case 'colgroup':
        return tag === 'col' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable

      case 'table':
        return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead

      case 'head':
        return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element

      case 'html':
        return tag === 'head' || tag === 'body' || tag === 'frameset';

      case 'frameset':
        return tag === 'frame';

      case '#document':
        return tag === 'html';
    } // Probably in the "in body" parsing mode, so we outlaw only tag combos
    // where the parsing rules cause implicit opens or closes to be added.
    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody


    switch (tag) {
      case 'h1':
      case 'h2':
      case 'h3':
      case 'h4':
      case 'h5':
      case 'h6':
        return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';

      case 'rp':
      case 'rt':
        return impliedEndTags.indexOf(parentTag) === -1;

      case 'body':
      case 'caption':
      case 'col':
      case 'colgroup':
      case 'frameset':
      case 'frame':
      case 'head':
      case 'html':
      case 'tbody':
      case 'td':
      case 'tfoot':
      case 'th':
      case 'thead':
      case 'tr':
        // These tags are only valid with a few parents that have special child
        // parsing rules -- if we're down here, then none of those matched and
        // so we allow it only if we don't know what the parent is, as all other
        // cases are invalid.
        return parentTag == null;
    }

    return true;
  };
  /**
   * Returns whether
   */


  var findInvalidAncestorForTag = function (tag, ancestorInfo) {
    switch (tag) {
      case 'address':
      case 'article':
      case 'aside':
      case 'blockquote':
      case 'center':
      case 'details':
      case 'dialog':
      case 'dir':
      case 'div':
      case 'dl':
      case 'fieldset':
      case 'figcaption':
      case 'figure':
      case 'footer':
      case 'header':
      case 'hgroup':
      case 'main':
      case 'menu':
      case 'nav':
      case 'ol':
      case 'p':
      case 'section':
      case 'summary':
      case 'ul':
      case 'pre':
      case 'listing':
      case 'table':
      case 'hr':
      case 'xmp':
      case 'h1':
      case 'h2':
      case 'h3':
      case 'h4':
      case 'h5':
      case 'h6':
        return ancestorInfo.pTagInButtonScope;

      case 'form':
        return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;

      case 'li':
        return ancestorInfo.listItemTagAutoclosing;

      case 'dd':
      case 'dt':
        return ancestorInfo.dlItemTagAutoclosing;

      case 'button':
        return ancestorInfo.buttonTagInScope;

      case 'a':
        // Spec says something about storing a list of markers, but it sounds
        // equivalent to this check.
        return ancestorInfo.aTagInScope;

      case 'nobr':
        return ancestorInfo.nobrTagInScope;
    }

    return null;
  };

  var didWarn$1 = {};

  validateDOMNesting = function (childTag, childText, ancestorInfo) {
    ancestorInfo = ancestorInfo || emptyAncestorInfo;
    var parentInfo = ancestorInfo.current;
    var parentTag = parentInfo && parentInfo.tag;

    if (childText != null) {
      if (childTag != null) {
        error('validateDOMNesting: when childText is passed, childTag should be null');
      }

      childTag = '#text';
    }

    var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
    var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
    var invalidParentOrAncestor = invalidParent || invalidAncestor;

    if (!invalidParentOrAncestor) {
      return;
    }

    var ancestorTag = invalidParentOrAncestor.tag;
    var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag;

    if (didWarn$1[warnKey]) {
      return;
    }

    didWarn$1[warnKey] = true;
    var tagDisplayName = childTag;
    var whitespaceInfo = '';

    if (childTag === '#text') {
      if (/\S/.test(childText)) {
        tagDisplayName = 'Text nodes';
      } else {
        tagDisplayName = 'Whitespace text nodes';
        whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
      }
    } else {
      tagDisplayName = '<' + childTag + '>';
    }

    if (invalidParent) {
      var info = '';

      if (ancestorTag === 'table' && childTag === 'tr') {
        info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';
      }

      error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);
    } else {
      error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag);
    }
  };
}

var SUPPRESS_HYDRATION_WARNING$1;

{
  SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
}

var SUSPENSE_START_DATA = '$';
var SUSPENSE_END_DATA = '/$';
var SUSPENSE_PENDING_START_DATA = '$?';
var SUSPENSE_FALLBACK_START_DATA = '$!';
var STYLE$1 = 'style';
var eventsEnabled = null;
var selectionInformation = null;

function shouldAutoFocusHostComponent(type, props) {
  switch (type) {
    case 'button':
    case 'input':
    case 'select':
    case 'textarea':
      return !!props.autoFocus;
  }

  return false;
}
function getRootHostContext(rootContainerInstance) {
  var type;
  var namespace;
  var nodeType = rootContainerInstance.nodeType;

  switch (nodeType) {
    case DOCUMENT_NODE:
    case DOCUMENT_FRAGMENT_NODE:
      {
        type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
        var root = rootContainerInstance.documentElement;
        namespace = root ? root.namespaceURI : getChildNamespace(null, '');
        break;
      }

    default:
      {
        var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
        var ownNamespace = container.namespaceURI || null;
        type = container.tagName;
        namespace = getChildNamespace(ownNamespace, type);
        break;
      }
  }

  {
    var validatedTag = type.toLowerCase();
    var ancestorInfo = updatedAncestorInfo(null, validatedTag);
    return {
      namespace: namespace,
      ancestorInfo: ancestorInfo
    };
  }
}
function getChildHostContext(parentHostContext, type, rootContainerInstance) {
  {
    var parentHostContextDev = parentHostContext;
    var namespace = getChildNamespace(parentHostContextDev.namespace, type);
    var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
    return {
      namespace: namespace,
      ancestorInfo: ancestorInfo
    };
  }
}
function getPublicInstance(instance) {
  return instance;
}
function prepareForCommit(containerInfo) {
  eventsEnabled = isEnabled();
  selectionInformation = getSelectionInformation();
  var activeInstance = null;

  setEnabled(false);
  return activeInstance;
}
function resetAfterCommit(containerInfo) {
  restoreSelection(selectionInformation);
  setEnabled(eventsEnabled);
  eventsEnabled = null;
  selectionInformation = null;
}
function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  var parentNamespace;

  {
    // TODO: take namespace into account when validating.
    var hostContextDev = hostContext;
    validateDOMNesting(type, null, hostContextDev.ancestorInfo);

    if (typeof props.children === 'string' || typeof props.children === 'number') {
      var string = '' + props.children;
      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
      validateDOMNesting(null, string, ownAncestorInfo);
    }

    parentNamespace = hostContextDev.namespace;
  }

  var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
  precacheFiberNode(internalInstanceHandle, domElement);
  updateFiberProps(domElement, props);
  return domElement;
}
function appendInitialChild(parentInstance, child) {
  parentInstance.appendChild(child);
}
function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
  setInitialProperties(domElement, type, props, rootContainerInstance);
  return shouldAutoFocusHostComponent(type, props);
}
function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
  {
    var hostContextDev = hostContext;

    if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
      var string = '' + newProps.children;
      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
      validateDOMNesting(null, string, ownAncestorInfo);
    }
  }

  return diffProperties(domElement, type, oldProps, newProps);
}
function shouldSetTextContent(type, props) {
  return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
}
function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
  {
    var hostContextDev = hostContext;
    validateDOMNesting(null, text, hostContextDev.ancestorInfo);
  }

  var textNode = createTextNode(text, rootContainerInstance);
  precacheFiberNode(internalInstanceHandle, textNode);
  return textNode;
}
// if a component just imports ReactDOM (e.g. for findDOMNode).
// Some environments might not have setTimeout or clearTimeout.

var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
var noTimeout = -1; // -------------------
function commitMount(domElement, type, newProps, internalInstanceHandle) {
  // Despite the naming that might imply otherwise, this method only
  // fires if there is an `Update` effect scheduled during mounting.
  // This happens if `finalizeInitialChildren` returns `true` (which it
  // does to implement the `autoFocus` attribute on the client). But
  // there are also other cases when this might happen (such as patching
  // up text content during hydration mismatch). So we'll check this again.
  if (shouldAutoFocusHostComponent(type, newProps)) {
    domElement.focus();
  }
}
function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
  // Update the props handle so that we know which props are the ones with
  // with current event handlers.
  updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.

  updateProperties(domElement, updatePayload, type, oldProps, newProps);
}
function resetTextContent(domElement) {
  setTextContent(domElement, '');
}
function commitTextUpdate(textInstance, oldText, newText) {
  textInstance.nodeValue = newText;
}
function appendChild(parentInstance, child) {
  parentInstance.appendChild(child);
}
function appendChildToContainer(container, child) {
  var parentNode;

  if (container.nodeType === COMMENT_NODE) {
    parentNode = container.parentNode;
    parentNode.insertBefore(child, container);
  } else {
    parentNode = container;
    parentNode.appendChild(child);
  } // This container might be used for a portal.
  // If something inside a portal is clicked, that click should bubble
  // through the React tree. However, on Mobile Safari the click would
  // never bubble through the *DOM* tree unless an ancestor with onclick
  // event exists. So we wouldn't see it and dispatch it.
  // This is why we ensure that non React root containers have inline onclick
  // defined.
  // https://github.com/facebook/react/issues/11918


  var reactRootContainer = container._reactRootContainer;

  if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
    // TODO: This cast may not be sound for SVG, MathML or custom elements.
    trapClickOnNonInteractiveElement(parentNode);
  }
}
function insertBefore(parentInstance, child, beforeChild) {
  parentInstance.insertBefore(child, beforeChild);
}
function insertInContainerBefore(container, child, beforeChild) {
  if (container.nodeType === COMMENT_NODE) {
    container.parentNode.insertBefore(child, beforeChild);
  } else {
    container.insertBefore(child, beforeChild);
  }
}

function removeChild(parentInstance, child) {
  parentInstance.removeChild(child);
}
function removeChildFromContainer(container, child) {
  if (container.nodeType === COMMENT_NODE) {
    container.parentNode.removeChild(child);
  } else {
    container.removeChild(child);
  }
}
function hideInstance(instance) {
  // TODO: Does this work for all element types? What about MathML? Should we
  // pass host context to this method?
  instance = instance;
  var style = instance.style;

  if (typeof style.setProperty === 'function') {
    style.setProperty('display', 'none', 'important');
  } else {
    style.display = 'none';
  }
}
function hideTextInstance(textInstance) {
  textInstance.nodeValue = '';
}
function unhideInstance(instance, props) {
  instance = instance;
  var styleProp = props[STYLE$1];
  var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
  instance.style.display = dangerousStyleValue('display', display);
}
function unhideTextInstance(textInstance, text) {
  textInstance.nodeValue = text;
}
function clearContainer(container) {
  if (container.nodeType === ELEMENT_NODE) {
    container.textContent = '';
  } else if (container.nodeType === DOCUMENT_NODE) {
    var body = container.body;

    if (body != null) {
      body.textContent = '';
    }
  }
} // -------------------
function canHydrateInstance(instance, type, props) {
  if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
    return null;
  } // This has now been refined to an element node.


  return instance;
}
function canHydrateTextInstance(instance, text) {
  if (text === '' || instance.nodeType !== TEXT_NODE) {
    // Empty strings are not parsed by HTML so there won't be a correct match here.
    return null;
  } // This has now been refined to a text node.


  return instance;
}
function isSuspenseInstancePending(instance) {
  return instance.data === SUSPENSE_PENDING_START_DATA;
}
function isSuspenseInstanceFallback(instance) {
  return instance.data === SUSPENSE_FALLBACK_START_DATA;
}

function getNextHydratable(node) {
  // Skip non-hydratable nodes.
  for (; node != null; node = node.nextSibling) {
    var nodeType = node.nodeType;

    if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
      break;
    }
  }

  return node;
}

function getNextHydratableSibling(instance) {
  return getNextHydratable(instance.nextSibling);
}
function getFirstHydratableChild(parentInstance) {
  return getNextHydratable(parentInstance.firstChild);
}
function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
  // get attached.

  updateFiberProps(instance, props);
  var parentNamespace;

  {
    var hostContextDev = hostContext;
    parentNamespace = hostContextDev.namespace;
  }

  return diffHydratedProperties(instance, type, props, parentNamespace);
}
function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
  precacheFiberNode(internalInstanceHandle, textInstance);
  return diffHydratedText(textInstance, text);
}
function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
  var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.
  // There might be nested nodes so we need to keep track of how
  // deep we are and only break out when we're back on top.

  var depth = 0;

  while (node) {
    if (node.nodeType === COMMENT_NODE) {
      var data = node.data;

      if (data === SUSPENSE_END_DATA) {
        if (depth === 0) {
          return getNextHydratableSibling(node);
        } else {
          depth--;
        }
      } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
        depth++;
      }
    }

    node = node.nextSibling;
  } // TODO: Warn, we didn't find the end comment boundary.


  return null;
} // Returns the SuspenseInstance if this node is a direct child of a
// SuspenseInstance. I.e. if its previous sibling is a Comment with
// SUSPENSE_x_START_DATA. Otherwise, null.

function getParentSuspenseInstance(targetInstance) {
  var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.
  // There might be nested nodes so we need to keep track of how
  // deep we are and only break out when we're back on top.

  var depth = 0;

  while (node) {
    if (node.nodeType === COMMENT_NODE) {
      var data = node.data;

      if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
        if (depth === 0) {
          return node;
        } else {
          depth--;
        }
      } else if (data === SUSPENSE_END_DATA) {
        depth++;
      }
    }

    node = node.previousSibling;
  }

  return null;
}
function commitHydratedContainer(container) {
  // Retry if any event replaying was blocked on this.
  retryIfBlockedOn(container);
}
function commitHydratedSuspenseInstance(suspenseInstance) {
  // Retry if any event replaying was blocked on this.
  retryIfBlockedOn(suspenseInstance);
}
function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
  {
    warnForUnmatchedText(textInstance, text);
  }
}
function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
    warnForUnmatchedText(textInstance, text);
  }
}
function didNotHydrateContainerInstance(parentContainer, instance) {
  {
    if (instance.nodeType === ELEMENT_NODE) {
      warnForDeletedHydratableElement(parentContainer, instance);
    } else if (instance.nodeType === COMMENT_NODE) ; else {
      warnForDeletedHydratableText(parentContainer, instance);
    }
  }
}
function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
    if (instance.nodeType === ELEMENT_NODE) {
      warnForDeletedHydratableElement(parentInstance, instance);
    } else if (instance.nodeType === COMMENT_NODE) ; else {
      warnForDeletedHydratableText(parentInstance, instance);
    }
  }
}
function didNotFindHydratableContainerInstance(parentContainer, type, props) {
  {
    warnForInsertedHydratedElement(parentContainer, type);
  }
}
function didNotFindHydratableContainerTextInstance(parentContainer, text) {
  {
    warnForInsertedHydratedText(parentContainer, text);
  }
}
function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
    warnForInsertedHydratedElement(parentInstance, type);
  }
}
function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
    warnForInsertedHydratedText(parentInstance, text);
  }
}
function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ;
}
var clientId = 0;
function makeClientIdInDEV(warnOnAccessInDEV) {
  var id = 'r:' + (clientId++).toString(36);
  return {
    toString: function () {
      warnOnAccessInDEV();
      return id;
    },
    valueOf: function () {
      warnOnAccessInDEV();
      return id;
    }
  };
}
function isOpaqueHydratingObject(value) {
  return value !== null && typeof value === 'object' && value.$$typeof === REACT_OPAQUE_ID_TYPE;
}
function makeOpaqueHydratingObject(attemptToReadValue) {
  return {
    $$typeof: REACT_OPAQUE_ID_TYPE,
    toString: attemptToReadValue,
    valueOf: attemptToReadValue
  };
}
function preparePortalMount(portalInstance) {
  {
    listenToAllSupportedEvents(portalInstance);
  }
}

var randomKey = Math.random().toString(36).slice(2);
var internalInstanceKey = '__reactFiber$' + randomKey;
var internalPropsKey = '__reactProps$' + randomKey;
var internalContainerInstanceKey = '__reactContainer$' + randomKey;
var internalEventHandlersKey = '__reactEvents$' + randomKey;
function precacheFiberNode(hostInst, node) {
  node[internalInstanceKey] = hostInst;
}
function markContainerAsRoot(hostRoot, node) {
  node[internalContainerInstanceKey] = hostRoot;
}
function unmarkContainerAsRoot(node) {
  node[internalContainerInstanceKey] = null;
}
function isContainerMarkedAsRoot(node) {
  return !!node[internalContainerInstanceKey];
} // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.
// If the target node is part of a hydrated or not yet rendered subtree, then
// this may also return a SuspenseComponent or HostRoot to indicate that.
// Conceptually the HostRoot fiber is a child of the Container node. So if you
// pass the Container node as the targetNode, you will not actually get the
// HostRoot back. To get to the HostRoot, you need to pass a child of it.
// The same thing applies to Suspense boundaries.

function getClosestInstanceFromNode(targetNode) {
  var targetInst = targetNode[internalInstanceKey];

  if (targetInst) {
    // Don't return HostRoot or SuspenseComponent here.
    return targetInst;
  } // If the direct event target isn't a React owned DOM node, we need to look
  // to see if one of its parents is a React owned DOM node.


  var parentNode = targetNode.parentNode;

  while (parentNode) {
    // We'll check if this is a container root that could include
    // React nodes in the future. We need to check this first because
    // if we're a child of a dehydrated container, we need to first
    // find that inner container before moving on to finding the parent
    // instance. Note that we don't check this field on  the targetNode
    // itself because the fibers are conceptually between the container
    // node and the first child. It isn't surrounding the container node.
    // If it's not a container, we check if it's an instance.
    targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];

    if (targetInst) {
      // Since this wasn't the direct target of the event, we might have
      // stepped past dehydrated DOM nodes to get here. However they could
      // also have been non-React nodes. We need to answer which one.
      // If we the instance doesn't have any children, then there can't be
      // a nested suspense boundary within it. So we can use this as a fast
      // bailout. Most of the time, when people add non-React children to
      // the tree, it is using a ref to a child-less DOM node.
      // Normally we'd only need to check one of the fibers because if it
      // has ever gone from having children to deleting them or vice versa
      // it would have deleted the dehydrated boundary nested inside already.
      // However, since the HostRoot starts out with an alternate it might
      // have one on the alternate so we need to check in case this was a
      // root.
      var alternate = targetInst.alternate;

      if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
        // Next we need to figure out if the node that skipped past is
        // nested within a dehydrated boundary and if so, which one.
        var suspenseInstance = getParentSuspenseInstance(targetNode);

        while (suspenseInstance !== null) {
          // We found a suspense instance. That means that we haven't
          // hydrated it yet. Even though we leave the comments in the
          // DOM after hydrating, and there are boundaries in the DOM
          // that could already be hydrated, we wouldn't have found them
          // through this pass since if the target is hydrated it would
          // have had an internalInstanceKey on it.
          // Let's get the fiber associated with the SuspenseComponent
          // as the deepest instance.
          var targetSuspenseInst = suspenseInstance[internalInstanceKey];

          if (targetSuspenseInst) {
            return targetSuspenseInst;
          } // If we don't find a Fiber on the comment, it might be because
          // we haven't gotten to hydrate it yet. There might still be a
          // parent boundary that hasn't above this one so we need to find
          // the outer most that is known.


          suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent
          // host component also hasn't hydrated yet. We can return it
          // below since it will bail out on the isMounted check later.
        }
      }

      return targetInst;
    }

    targetNode = parentNode;
    parentNode = targetNode.parentNode;
  }

  return null;
}
/**
 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
 * instance, or null if the node was not rendered by this React.
 */

function getInstanceFromNode(node) {
  var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];

  if (inst) {
    if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
      return inst;
    } else {
      return null;
    }
  }

  return null;
}
/**
 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
 * DOM node.
 */

function getNodeFromInstance(inst) {
  if (inst.tag === HostComponent || inst.tag === HostText) {
    // In Fiber this, is just the state node right now. We assume it will be
    // a host component or host text.
    return inst.stateNode;
  } // Without this first invariant, passing a non-DOM-component triggers the next
  // invariant for a missing parent, which is super confusing.


  {
    {
      throw Error( "getNodeFromInstance: Invalid argument." );
    }
  }
}
function getFiberCurrentPropsFromNode(node) {
  return node[internalPropsKey] || null;
}
function updateFiberProps(node, props) {
  node[internalPropsKey] = props;
}
function getEventListenerSet(node) {
  var elementListenerSet = node[internalEventHandlersKey];

  if (elementListenerSet === undefined) {
    elementListenerSet = node[internalEventHandlersKey] = new Set();
  }

  return elementListenerSet;
}

var loggedTypeFailures = {};
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame$1.setExtraStackFrame(null);
    }
  }
}

function checkPropTypes(typeSpecs, values, location, componentName, element) {
  {
    // $FlowFixMe This is okay but Flow doesn't know it.
    var has = Function.call.bind(Object.prototype.hasOwnProperty);

    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.

        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
            err.name = 'Invariant Violation';
            throw err;
          }

          error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
        } catch (ex) {
          error$1 = ex;
        }

        if (error$1 && !(error$1 instanceof Error)) {
          setCurrentlyValidatingElement(element);

          error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);

          setCurrentlyValidatingElement(null);
        }

        if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error$1.message] = true;
          setCurrentlyValidatingElement(element);

          error('Failed %s type: %s', location, error$1.message);

          setCurrentlyValidatingElement(null);
        }
      }
    }
  }
}

var valueStack = [];
var fiberStack;

{
  fiberStack = [];
}

var index = -1;

function createCursor(defaultValue) {
  return {
    current: defaultValue
  };
}

function pop(cursor, fiber) {
  if (index < 0) {
    {
      error('Unexpected pop.');
    }

    return;
  }

  {
    if (fiber !== fiberStack[index]) {
      error('Unexpected Fiber popped.');
    }
  }

  cursor.current = valueStack[index];
  valueStack[index] = null;

  {
    fiberStack[index] = null;
  }

  index--;
}

function push(cursor, value, fiber) {
  index++;
  valueStack[index] = cursor.current;

  {
    fiberStack[index] = fiber;
  }

  cursor.current = value;
}

var warnedAboutMissingGetChildContext;

{
  warnedAboutMissingGetChildContext = {};
}

var emptyContextObject = {};

{
  Object.freeze(emptyContextObject);
} // A cursor to the current merged context object on the stack.


var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.

var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.
// We use this to get access to the parent context after we have already
// pushed the next context provider, and now need to merge their contexts.

var previousContext = emptyContextObject;

function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
  {
    if (didPushOwnContextIfProvider && isContextProvider(Component)) {
      // If the fiber is a context provider itself, when we read its context
      // we may have already pushed its own child context on the stack. A context
      // provider should not "see" its own child context. Therefore we read the
      // previous (parent) context instead for a context provider.
      return previousContext;
    }

    return contextStackCursor.current;
  }
}

function cacheContext(workInProgress, unmaskedContext, maskedContext) {
  {
    var instance = workInProgress.stateNode;
    instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
    instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
  }
}

function getMaskedContext(workInProgress, unmaskedContext) {
  {
    var type = workInProgress.type;
    var contextTypes = type.contextTypes;

    if (!contextTypes) {
      return emptyContextObject;
    } // Avoid recreating masked context unless unmasked context has changed.
    // Failing to do this will result in unnecessary calls to componentWillReceiveProps.
    // This may trigger infinite loops if componentWillReceiveProps calls setState.


    var instance = workInProgress.stateNode;

    if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
      return instance.__reactInternalMemoizedMaskedChildContext;
    }

    var context = {};

    for (var key in contextTypes) {
      context[key] = unmaskedContext[key];
    }

    {
      var name = getComponentName(type) || 'Unknown';
      checkPropTypes(contextTypes, context, 'context', name);
    } // Cache unmasked context so we can avoid recreating masked context unless necessary.
    // Context is created before the class component is instantiated so check for instance.


    if (instance) {
      cacheContext(workInProgress, unmaskedContext, context);
    }

    return context;
  }
}

function hasContextChanged() {
  {
    return didPerformWorkStackCursor.current;
  }
}

function isContextProvider(type) {
  {
    var childContextTypes = type.childContextTypes;
    return childContextTypes !== null && childContextTypes !== undefined;
  }
}

function popContext(fiber) {
  {
    pop(didPerformWorkStackCursor, fiber);
    pop(contextStackCursor, fiber);
  }
}

function popTopLevelContextObject(fiber) {
  {
    pop(didPerformWorkStackCursor, fiber);
    pop(contextStackCursor, fiber);
  }
}

function pushTopLevelContextObject(fiber, context, didChange) {
  {
    if (!(contextStackCursor.current === emptyContextObject)) {
      {
        throw Error( "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    push(contextStackCursor, context, fiber);
    push(didPerformWorkStackCursor, didChange, fiber);
  }
}

function processChildContext(fiber, type, parentContext) {
  {
    var instance = fiber.stateNode;
    var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future.
    // It has only been added in Fiber to match the (unintentional) behavior in Stack.

    if (typeof instance.getChildContext !== 'function') {
      {
        var componentName = getComponentName(type) || 'Unknown';

        if (!warnedAboutMissingGetChildContext[componentName]) {
          warnedAboutMissingGetChildContext[componentName] = true;

          error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
        }
      }

      return parentContext;
    }

    var childContext = instance.getChildContext();

    for (var contextKey in childContext) {
      if (!(contextKey in childContextTypes)) {
        {
          throw Error( (getComponentName(type) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes." );
        }
      }
    }

    {
      var name = getComponentName(type) || 'Unknown';
      checkPropTypes(childContextTypes, childContext, 'child context', name);
    }

    return _assign({}, parentContext, childContext);
  }
}

function pushContextProvider(workInProgress) {
  {
    var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.
    // If the instance does not exist yet, we will push null at first,
    // and replace it on the stack later when invalidating the context.

    var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.
    // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.

    previousContext = contextStackCursor.current;
    push(contextStackCursor, memoizedMergedChildContext, workInProgress);
    push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
    return true;
  }
}

function invalidateContextProvider(workInProgress, type, didChange) {
  {
    var instance = workInProgress.stateNode;

    if (!instance) {
      {
        throw Error( "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    if (didChange) {
      // Merge parent and own context.
      // Skip this if we're not updating due to sCU.
      // This avoids unnecessarily recomputing memoized values.
      var mergedContext = processChildContext(workInProgress, type, previousContext);
      instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.
      // It is important to unwind the context in the reverse order.

      pop(didPerformWorkStackCursor, workInProgress);
      pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.

      push(contextStackCursor, mergedContext, workInProgress);
      push(didPerformWorkStackCursor, didChange, workInProgress);
    } else {
      pop(didPerformWorkStackCursor, workInProgress);
      push(didPerformWorkStackCursor, didChange, workInProgress);
    }
  }
}

function findCurrentUnmaskedContext(fiber) {
  {
    // Currently this is only used with renderSubtreeIntoContainer; not sure if it
    // makes sense elsewhere
    if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
      {
        throw Error( "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    var node = fiber;

    do {
      switch (node.tag) {
        case HostRoot:
          return node.stateNode.context;

        case ClassComponent:
          {
            var Component = node.type;

            if (isContextProvider(Component)) {
              return node.stateNode.__reactInternalMemoizedMergedChildContext;
            }

            break;
          }
      }

      node = node.return;
    } while (node !== null);

    {
      {
        throw Error( "Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue." );
      }
    }
  }
}

var LegacyRoot = 0;
var BlockingRoot = 1;
var ConcurrentRoot = 2;

var rendererID = null;
var injectedHook = null;
var hasLoggedError = false;
var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';
function injectInternals(internals) {
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
    // No DevTools
    return false;
  }

  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;

  if (hook.isDisabled) {
    // This isn't a real property on the hook, but it can be set to opt out
    // of DevTools integration and associated warnings and logs.
    // https://github.com/facebook/react/issues/3877
    return true;
  }

  if (!hook.supportsFiber) {
    {
      error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://reactjs.org/link/react-devtools');
    } // DevTools exists, even though it doesn't support Fiber.


    return true;
  }

  try {
    rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.

    injectedHook = hook;
  } catch (err) {
    // Catch all errors because it is unsafe to throw during initialization.
    {
      error('React instrumentation encountered an error: %s.', err);
    }
  } // DevTools exists


  return true;
}
function onScheduleRoot(root, children) {
  {
    if (injectedHook && typeof injectedHook.onScheduleFiberRoot === 'function') {
      try {
        injectedHook.onScheduleFiberRoot(rendererID, root, children);
      } catch (err) {
        if ( !hasLoggedError) {
          hasLoggedError = true;

          error('React instrumentation encountered an error: %s', err);
        }
      }
    }
  }
}
function onCommitRoot(root, priorityLevel) {
  if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') {
    try {
      var didError = (root.current.flags & DidCapture) === DidCapture;

      if (enableProfilerTimer) {
        injectedHook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);
      } else {
        injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError);
      }
    } catch (err) {
      {
        if (!hasLoggedError) {
          hasLoggedError = true;

          error('React instrumentation encountered an error: %s', err);
        }
      }
    }
  }
}
function onCommitUnmount(fiber) {
  if (injectedHook && typeof injectedHook.onCommitFiberUnmount === 'function') {
    try {
      injectedHook.onCommitFiberUnmount(rendererID, fiber);
    } catch (err) {
      {
        if (!hasLoggedError) {
          hasLoggedError = true;

          error('React instrumentation encountered an error: %s', err);
        }
      }
    }
  }
}

var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,
    Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,
    Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,
    Scheduler_shouldYield = Scheduler.unstable_shouldYield,
    Scheduler_requestPaint = Scheduler.unstable_requestPaint,
    Scheduler_now$1 = Scheduler.unstable_now,
    Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,
    Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,
    Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,
    Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,
    Scheduler_LowPriority = Scheduler.unstable_LowPriority,
    Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;

{
  // Provide explicit error message when production+profiling bundle of e.g.
  // react-dom is used with production (non-profiling) bundle of
  // scheduler/tracing
  if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
    {
      throw Error( "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" );
    }
  }
}

var fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use
// ascending numbers so we can compare them like numbers. They start at 90 to
// avoid clashing with Scheduler's priorities.

var ImmediatePriority$1 = 99;
var UserBlockingPriority$2 = 98;
var NormalPriority$1 = 97;
var LowPriority$1 = 96;
var IdlePriority$1 = 95; // NoPriority is the absence of priority. Also React-only.

var NoPriority$1 = 90;
var shouldYield = Scheduler_shouldYield;
var requestPaint = // Fall back gracefully if we're running an older version of Scheduler.
Scheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};
var syncQueue = null;
var immediateQueueCallbackNode = null;
var isFlushingSyncQueue = false;
var initialTimeMs$1 = Scheduler_now$1(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.
// This will be the case for modern browsers that support `performance.now`. In
// older browsers, Scheduler falls back to `Date.now`, which returns a Unix
// timestamp. In that case, subtract the module initialization time to simulate
// the behavior of performance.now and keep our times small enough to fit
// within 32 bits.
// TODO: Consider lifting this into Scheduler.

var now = initialTimeMs$1 < 10000 ? Scheduler_now$1 : function () {
  return Scheduler_now$1() - initialTimeMs$1;
};
function getCurrentPriorityLevel() {
  switch (Scheduler_getCurrentPriorityLevel()) {
    case Scheduler_ImmediatePriority:
      return ImmediatePriority$1;

    case Scheduler_UserBlockingPriority:
      return UserBlockingPriority$2;

    case Scheduler_NormalPriority:
      return NormalPriority$1;

    case Scheduler_LowPriority:
      return LowPriority$1;

    case Scheduler_IdlePriority:
      return IdlePriority$1;

    default:
      {
        {
          throw Error( "Unknown priority level." );
        }
      }

  }
}

function reactPriorityToSchedulerPriority(reactPriorityLevel) {
  switch (reactPriorityLevel) {
    case ImmediatePriority$1:
      return Scheduler_ImmediatePriority;

    case UserBlockingPriority$2:
      return Scheduler_UserBlockingPriority;

    case NormalPriority$1:
      return Scheduler_NormalPriority;

    case LowPriority$1:
      return Scheduler_LowPriority;

    case IdlePriority$1:
      return Scheduler_IdlePriority;

    default:
      {
        {
          throw Error( "Unknown priority level." );
        }
      }

  }
}

function runWithPriority$1(reactPriorityLevel, fn) {
  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  return Scheduler_runWithPriority(priorityLevel, fn);
}
function scheduleCallback(reactPriorityLevel, callback, options) {
  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  return Scheduler_scheduleCallback(priorityLevel, callback, options);
}
function scheduleSyncCallback(callback) {
  // Push this callback into an internal queue. We'll flush these either in
  // the next tick, or earlier if something calls `flushSyncCallbackQueue`.
  if (syncQueue === null) {
    syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.

    immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
  } else {
    // Push onto existing queue. Don't need to schedule a callback because
    // we already scheduled one when we created the queue.
    syncQueue.push(callback);
  }

  return fakeCallbackNode;
}
function cancelCallback(callbackNode) {
  if (callbackNode !== fakeCallbackNode) {
    Scheduler_cancelCallback(callbackNode);
  }
}
function flushSyncCallbackQueue() {
  if (immediateQueueCallbackNode !== null) {
    var node = immediateQueueCallbackNode;
    immediateQueueCallbackNode = null;
    Scheduler_cancelCallback(node);
  }

  flushSyncCallbackQueueImpl();
}

function flushSyncCallbackQueueImpl() {
  if (!isFlushingSyncQueue && syncQueue !== null) {
    // Prevent re-entrancy.
    isFlushingSyncQueue = true;
    var i = 0;

    {
      try {
        var _isSync2 = true;
        var _queue = syncQueue;
        runWithPriority$1(ImmediatePriority$1, function () {
          for (; i < _queue.length; i++) {
            var callback = _queue[i];

            do {
              callback = callback(_isSync2);
            } while (callback !== null);
          }
        });
        syncQueue = null;
      } catch (error) {
        // If something throws, leave the remaining callbacks on the queue.
        if (syncQueue !== null) {
          syncQueue = syncQueue.slice(i + 1);
        } // Resume flushing in the next tick


        Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
        throw error;
      } finally {
        isFlushingSyncQueue = false;
      }
    }
  }
}

// TODO: this is special because it gets imported during build.
var ReactVersion = '17.0.2';

var NoMode = 0;
var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root
// tag instead

var BlockingMode = 2;
var ConcurrentMode = 4;
var ProfileMode = 8;
var DebugTracingMode = 16;

var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
var NoTransition = 0;
function requestCurrentTransition() {
  return ReactCurrentBatchConfig.transition;
}

var ReactStrictModeWarnings = {
  recordUnsafeLifecycleWarnings: function (fiber, instance) {},
  flushPendingUnsafeLifecycleWarnings: function () {},
  recordLegacyContextWarning: function (fiber, instance) {},
  flushLegacyContextWarning: function () {},
  discardPendingWarnings: function () {}
};

{
  var findStrictRoot = function (fiber) {
    var maybeStrictRoot = null;
    var node = fiber;

    while (node !== null) {
      if (node.mode & StrictMode) {
        maybeStrictRoot = node;
      }

      node = node.return;
    }

    return maybeStrictRoot;
  };

  var setToSortedString = function (set) {
    var array = [];
    set.forEach(function (value) {
      array.push(value);
    });
    return array.sort().join(', ');
  };

  var pendingComponentWillMountWarnings = [];
  var pendingUNSAFE_ComponentWillMountWarnings = [];
  var pendingComponentWillReceivePropsWarnings = [];
  var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
  var pendingComponentWillUpdateWarnings = [];
  var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.

  var didWarnAboutUnsafeLifecycles = new Set();

  ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
    // Dedup strategy: Warn once per component.
    if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
      return;
    }

    if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.
    instance.componentWillMount.__suppressDeprecationWarning !== true) {
      pendingComponentWillMountWarnings.push(fiber);
    }

    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {
      pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
    }

    if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
      pendingComponentWillReceivePropsWarnings.push(fiber);
    }

    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
      pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
    }

    if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
      pendingComponentWillUpdateWarnings.push(fiber);
    }

    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {
      pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
    }
  };

  ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
    // We do an initial pass to gather component names
    var componentWillMountUniqueNames = new Set();

    if (pendingComponentWillMountWarnings.length > 0) {
      pendingComponentWillMountWarnings.forEach(function (fiber) {
        componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingComponentWillMountWarnings = [];
    }

    var UNSAFE_componentWillMountUniqueNames = new Set();

    if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
      pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {
        UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingUNSAFE_ComponentWillMountWarnings = [];
    }

    var componentWillReceivePropsUniqueNames = new Set();

    if (pendingComponentWillReceivePropsWarnings.length > 0) {
      pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
        componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingComponentWillReceivePropsWarnings = [];
    }

    var UNSAFE_componentWillReceivePropsUniqueNames = new Set();

    if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
      pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {
        UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
    }

    var componentWillUpdateUniqueNames = new Set();

    if (pendingComponentWillUpdateWarnings.length > 0) {
      pendingComponentWillUpdateWarnings.forEach(function (fiber) {
        componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingComponentWillUpdateWarnings = [];
    }

    var UNSAFE_componentWillUpdateUniqueNames = new Set();

    if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
      pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {
        UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutUnsafeLifecycles.add(fiber.type);
      });
      pendingUNSAFE_ComponentWillUpdateWarnings = [];
    } // Finally, we flush all the warnings
    // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'


    if (UNSAFE_componentWillMountUniqueNames.size > 0) {
      var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);

      error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames);
    }

    if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
      var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);

      error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n' + '\nPlease update the following components: %s', _sortedNames);
    }

    if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
      var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);

      error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2);
    }

    if (componentWillMountUniqueNames.size > 0) {
      var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);

      warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3);
    }

    if (componentWillReceivePropsUniqueNames.size > 0) {
      var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);

      warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4);
    }

    if (componentWillUpdateUniqueNames.size > 0) {
      var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);

      warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5);
    }
  };

  var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.

  var didWarnAboutLegacyContext = new Set();

  ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
    var strictRoot = findStrictRoot(fiber);

    if (strictRoot === null) {
      error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');

      return;
    } // Dedup strategy: Warn once per component.


    if (didWarnAboutLegacyContext.has(fiber.type)) {
      return;
    }

    var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);

    if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
      if (warningsForRoot === undefined) {
        warningsForRoot = [];
        pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
      }

      warningsForRoot.push(fiber);
    }
  };

  ReactStrictModeWarnings.flushLegacyContextWarning = function () {
    pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
      if (fiberArray.length === 0) {
        return;
      }

      var firstFiber = fiberArray[0];
      var uniqueNames = new Set();
      fiberArray.forEach(function (fiber) {
        uniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutLegacyContext.add(fiber.type);
      });
      var sortedNames = setToSortedString(uniqueNames);

      try {
        setCurrentFiber(firstFiber);

        error('Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context', sortedNames);
      } finally {
        resetCurrentFiber();
      }
    });
  };

  ReactStrictModeWarnings.discardPendingWarnings = function () {
    pendingComponentWillMountWarnings = [];
    pendingUNSAFE_ComponentWillMountWarnings = [];
    pendingComponentWillReceivePropsWarnings = [];
    pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
    pendingComponentWillUpdateWarnings = [];
    pendingUNSAFE_ComponentWillUpdateWarnings = [];
    pendingLegacyContextWarning = new Map();
  };
}

function resolveDefaultProps(Component, baseProps) {
  if (Component && Component.defaultProps) {
    // Resolve default props. Taken from ReactElement
    var props = _assign({}, baseProps);

    var defaultProps = Component.defaultProps;

    for (var propName in defaultProps) {
      if (props[propName] === undefined) {
        props[propName] = defaultProps[propName];
      }
    }

    return props;
  }

  return baseProps;
}

// Max 31 bit integer. The max integer size in V8 for 32-bit systems.
// Math.pow(2, 30) - 1
// 0b111111111111111111111111111111
var MAX_SIGNED_31_BIT_INT = 1073741823;

var valueCursor = createCursor(null);
var rendererSigil;

{
  // Use this to detect multiple renderers using the same context
  rendererSigil = {};
}

var currentlyRenderingFiber = null;
var lastContextDependency = null;
var lastContextWithAllBitsObserved = null;
var isDisallowedContextReadInDEV = false;
function resetContextDependencies() {
  // This is called right before React yields execution, to ensure `readContext`
  // cannot be called outside the render phase.
  currentlyRenderingFiber = null;
  lastContextDependency = null;
  lastContextWithAllBitsObserved = null;

  {
    isDisallowedContextReadInDEV = false;
  }
}
function enterDisallowedContextReadInDEV() {
  {
    isDisallowedContextReadInDEV = true;
  }
}
function exitDisallowedContextReadInDEV() {
  {
    isDisallowedContextReadInDEV = false;
  }
}
function pushProvider(providerFiber, nextValue) {
  var context = providerFiber.type._context;

  {
    push(valueCursor, context._currentValue, providerFiber);
    context._currentValue = nextValue;

    {
      if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
        error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');
      }

      context._currentRenderer = rendererSigil;
    }
  }
}
function popProvider(providerFiber) {
  var currentValue = valueCursor.current;
  pop(valueCursor, providerFiber);
  var context = providerFiber.type._context;

  {
    context._currentValue = currentValue;
  }
}
function calculateChangedBits(context, newValue, oldValue) {
  if (objectIs(oldValue, newValue)) {
    // No change
    return 0;
  } else {
    var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;

    {
      if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {
        error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);
      }
    }

    return changedBits | 0;
  }
}
function scheduleWorkOnParentPath(parent, renderLanes) {
  // Update the child lanes of all the ancestors, including the alternates.
  var node = parent;

  while (node !== null) {
    var alternate = node.alternate;

    if (!isSubsetOfLanes(node.childLanes, renderLanes)) {
      node.childLanes = mergeLanes(node.childLanes, renderLanes);

      if (alternate !== null) {
        alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);
      }
    } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) {
      alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);
    } else {
      // Neither alternate was updated, which means the rest of the
      // ancestor path already has sufficient priority.
      break;
    }

    node = node.return;
  }
}
function propagateContextChange(workInProgress, context, changedBits, renderLanes) {
  var fiber = workInProgress.child;

  if (fiber !== null) {
    // Set the return pointer of the child to the work-in-progress fiber.
    fiber.return = workInProgress;
  }

  while (fiber !== null) {
    var nextFiber = void 0; // Visit this fiber.

    var list = fiber.dependencies;

    if (list !== null) {
      nextFiber = fiber.child;
      var dependency = list.firstContext;

      while (dependency !== null) {
        // Check if the context matches.
        if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
          // Match! Schedule an update on this fiber.
          if (fiber.tag === ClassComponent) {
            // Schedule a force update on the work-in-progress.
            var update = createUpdate(NoTimestamp, pickArbitraryLane(renderLanes));
            update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the
            // update to the current fiber, too, which means it will persist even if
            // this render is thrown away. Since it's a race condition, not sure it's
            // worth fixing.

            enqueueUpdate(fiber, update);
          }

          fiber.lanes = mergeLanes(fiber.lanes, renderLanes);
          var alternate = fiber.alternate;

          if (alternate !== null) {
            alternate.lanes = mergeLanes(alternate.lanes, renderLanes);
          }

          scheduleWorkOnParentPath(fiber.return, renderLanes); // Mark the updated lanes on the list, too.

          list.lanes = mergeLanes(list.lanes, renderLanes); // Since we already found a match, we can stop traversing the
          // dependency list.

          break;
        }

        dependency = dependency.next;
      }
    } else if (fiber.tag === ContextProvider) {
      // Don't scan deeper if this is a matching provider
      nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
    } else {
      // Traverse down.
      nextFiber = fiber.child;
    }

    if (nextFiber !== null) {
      // Set the return pointer of the child to the work-in-progress fiber.
      nextFiber.return = fiber;
    } else {
      // No child. Traverse to next sibling.
      nextFiber = fiber;

      while (nextFiber !== null) {
        if (nextFiber === workInProgress) {
          // We're back to the root of this subtree. Exit.
          nextFiber = null;
          break;
        }

        var sibling = nextFiber.sibling;

        if (sibling !== null) {
          // Set the return pointer of the sibling to the work-in-progress fiber.
          sibling.return = nextFiber.return;
          nextFiber = sibling;
          break;
        } // No more siblings. Traverse up.


        nextFiber = nextFiber.return;
      }
    }

    fiber = nextFiber;
  }
}
function prepareToReadContext(workInProgress, renderLanes) {
  currentlyRenderingFiber = workInProgress;
  lastContextDependency = null;
  lastContextWithAllBitsObserved = null;
  var dependencies = workInProgress.dependencies;

  if (dependencies !== null) {
    var firstContext = dependencies.firstContext;

    if (firstContext !== null) {
      if (includesSomeLane(dependencies.lanes, renderLanes)) {
        // Context list has a pending update. Mark that this fiber performed work.
        markWorkInProgressReceivedUpdate();
      } // Reset the work-in-progress list


      dependencies.firstContext = null;
    }
  }
}
function readContext(context, observedBits) {
  {
    // This warning would fire if you read context inside a Hook like useMemo.
    // Unlike the class check below, it's not enforced in production for perf.
    if (isDisallowedContextReadInDEV) {
      error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
    }
  }

  if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else {
    var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.

    if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {
      // Observe all updates.
      lastContextWithAllBitsObserved = context;
      resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
    } else {
      resolvedObservedBits = observedBits;
    }

    var contextItem = {
      context: context,
      observedBits: resolvedObservedBits,
      next: null
    };

    if (lastContextDependency === null) {
      if (!(currentlyRenderingFiber !== null)) {
        {
          throw Error( "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." );
        }
      } // This is the first dependency for this component. Create a new list.


      lastContextDependency = contextItem;
      currentlyRenderingFiber.dependencies = {
        lanes: NoLanes,
        firstContext: contextItem,
        responders: null
      };
    } else {
      // Append a new context item.
      lastContextDependency = lastContextDependency.next = contextItem;
    }
  }

  return  context._currentValue ;
}

var UpdateState = 0;
var ReplaceState = 1;
var ForceUpdate = 2;
var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`.
// It should only be read right after calling `processUpdateQueue`, via
// `checkHasForceUpdateAfterProcessing`.

var hasForceUpdate = false;
var didWarnUpdateInsideUpdate;
var currentlyProcessingQueue;

{
  didWarnUpdateInsideUpdate = false;
  currentlyProcessingQueue = null;
}

function initializeUpdateQueue(fiber) {
  var queue = {
    baseState: fiber.memoizedState,
    firstBaseUpdate: null,
    lastBaseUpdate: null,
    shared: {
      pending: null
    },
    effects: null
  };
  fiber.updateQueue = queue;
}
function cloneUpdateQueue(current, workInProgress) {
  // Clone the update queue from current. Unless it's already a clone.
  var queue = workInProgress.updateQueue;
  var currentQueue = current.updateQueue;

  if (queue === currentQueue) {
    var clone = {
      baseState: currentQueue.baseState,
      firstBaseUpdate: currentQueue.firstBaseUpdate,
      lastBaseUpdate: currentQueue.lastBaseUpdate,
      shared: currentQueue.shared,
      effects: currentQueue.effects
    };
    workInProgress.updateQueue = clone;
  }
}
function createUpdate(eventTime, lane) {
  var update = {
    eventTime: eventTime,
    lane: lane,
    tag: UpdateState,
    payload: null,
    callback: null,
    next: null
  };
  return update;
}
function enqueueUpdate(fiber, update) {
  var updateQueue = fiber.updateQueue;

  if (updateQueue === null) {
    // Only occurs if the fiber has been unmounted.
    return;
  }

  var sharedQueue = updateQueue.shared;
  var pending = sharedQueue.pending;

  if (pending === null) {
    // This is the first update. Create a circular list.
    update.next = update;
  } else {
    update.next = pending.next;
    pending.next = update;
  }

  sharedQueue.pending = update;

  {
    if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
      error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');

      didWarnUpdateInsideUpdate = true;
    }
  }
}
function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
  // Captured updates are updates that are thrown by a child during the render
  // phase. They should be discarded if the render is aborted. Therefore,
  // we should only put them on the work-in-progress queue, not the current one.
  var queue = workInProgress.updateQueue; // Check if the work-in-progress queue is a clone.

  var current = workInProgress.alternate;

  if (current !== null) {
    var currentQueue = current.updateQueue;

    if (queue === currentQueue) {
      // The work-in-progress queue is the same as current. This happens when
      // we bail out on a parent fiber that then captures an error thrown by
      // a child. Since we want to append the update only to the work-in
      // -progress queue, we need to clone the updates. We usually clone during
      // processUpdateQueue, but that didn't happen in this case because we
      // skipped over the parent when we bailed out.
      var newFirst = null;
      var newLast = null;
      var firstBaseUpdate = queue.firstBaseUpdate;

      if (firstBaseUpdate !== null) {
        // Loop through the updates and clone them.
        var update = firstBaseUpdate;

        do {
          var clone = {
            eventTime: update.eventTime,
            lane: update.lane,
            tag: update.tag,
            payload: update.payload,
            callback: update.callback,
            next: null
          };

          if (newLast === null) {
            newFirst = newLast = clone;
          } else {
            newLast.next = clone;
            newLast = clone;
          }

          update = update.next;
        } while (update !== null); // Append the captured update the end of the cloned list.


        if (newLast === null) {
          newFirst = newLast = capturedUpdate;
        } else {
          newLast.next = capturedUpdate;
          newLast = capturedUpdate;
        }
      } else {
        // There are no base updates.
        newFirst = newLast = capturedUpdate;
      }

      queue = {
        baseState: currentQueue.baseState,
        firstBaseUpdate: newFirst,
        lastBaseUpdate: newLast,
        shared: currentQueue.shared,
        effects: currentQueue.effects
      };
      workInProgress.updateQueue = queue;
      return;
    }
  } // Append the update to the end of the list.


  var lastBaseUpdate = queue.lastBaseUpdate;

  if (lastBaseUpdate === null) {
    queue.firstBaseUpdate = capturedUpdate;
  } else {
    lastBaseUpdate.next = capturedUpdate;
  }

  queue.lastBaseUpdate = capturedUpdate;
}

function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
  switch (update.tag) {
    case ReplaceState:
      {
        var payload = update.payload;

        if (typeof payload === 'function') {
          // Updater function
          {
            enterDisallowedContextReadInDEV();
          }

          var nextState = payload.call(instance, prevState, nextProps);

          {
            if ( workInProgress.mode & StrictMode) {
              disableLogs();

              try {
                payload.call(instance, prevState, nextProps);
              } finally {
                reenableLogs();
              }
            }

            exitDisallowedContextReadInDEV();
          }

          return nextState;
        } // State object


        return payload;
      }

    case CaptureUpdate:
      {
        workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture;
      }
    // Intentional fallthrough

    case UpdateState:
      {
        var _payload = update.payload;
        var partialState;

        if (typeof _payload === 'function') {
          // Updater function
          {
            enterDisallowedContextReadInDEV();
          }

          partialState = _payload.call(instance, prevState, nextProps);

          {
            if ( workInProgress.mode & StrictMode) {
              disableLogs();

              try {
                _payload.call(instance, prevState, nextProps);
              } finally {
                reenableLogs();
              }
            }

            exitDisallowedContextReadInDEV();
          }
        } else {
          // Partial state object
          partialState = _payload;
        }

        if (partialState === null || partialState === undefined) {
          // Null and undefined are treated as no-ops.
          return prevState;
        } // Merge the partial state and the previous state.


        return _assign({}, prevState, partialState);
      }

    case ForceUpdate:
      {
        hasForceUpdate = true;
        return prevState;
      }
  }

  return prevState;
}

function processUpdateQueue(workInProgress, props, instance, renderLanes) {
  // This is always non-null on a ClassComponent or HostRoot
  var queue = workInProgress.updateQueue;
  hasForceUpdate = false;

  {
    currentlyProcessingQueue = queue.shared;
  }

  var firstBaseUpdate = queue.firstBaseUpdate;
  var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue.

  var pendingQueue = queue.shared.pending;

  if (pendingQueue !== null) {
    queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first
    // and last so that it's non-circular.

    var lastPendingUpdate = pendingQueue;
    var firstPendingUpdate = lastPendingUpdate.next;
    lastPendingUpdate.next = null; // Append pending updates to base queue

    if (lastBaseUpdate === null) {
      firstBaseUpdate = firstPendingUpdate;
    } else {
      lastBaseUpdate.next = firstPendingUpdate;
    }

    lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then
    // we need to transfer the updates to that queue, too. Because the base
    // queue is a singly-linked list with no cycles, we can append to both
    // lists and take advantage of structural sharing.
    // TODO: Pass `current` as argument

    var current = workInProgress.alternate;

    if (current !== null) {
      // This is always non-null on a ClassComponent or HostRoot
      var currentQueue = current.updateQueue;
      var currentLastBaseUpdate = currentQueue.lastBaseUpdate;

      if (currentLastBaseUpdate !== lastBaseUpdate) {
        if (currentLastBaseUpdate === null) {
          currentQueue.firstBaseUpdate = firstPendingUpdate;
        } else {
          currentLastBaseUpdate.next = firstPendingUpdate;
        }

        currentQueue.lastBaseUpdate = lastPendingUpdate;
      }
    }
  } // These values may change as we process the queue.


  if (firstBaseUpdate !== null) {
    // Iterate through the list of updates to compute the result.
    var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes
    // from the original lanes.

    var newLanes = NoLanes;
    var newBaseState = null;
    var newFirstBaseUpdate = null;
    var newLastBaseUpdate = null;
    var update = firstBaseUpdate;

    do {
      var updateLane = update.lane;
      var updateEventTime = update.eventTime;

      if (!isSubsetOfLanes(renderLanes, updateLane)) {
        // Priority is insufficient. Skip this update. If this is the first
        // skipped update, the previous update/state is the new base
        // update/state.
        var clone = {
          eventTime: updateEventTime,
          lane: updateLane,
          tag: update.tag,
          payload: update.payload,
          callback: update.callback,
          next: null
        };

        if (newLastBaseUpdate === null) {
          newFirstBaseUpdate = newLastBaseUpdate = clone;
          newBaseState = newState;
        } else {
          newLastBaseUpdate = newLastBaseUpdate.next = clone;
        } // Update the remaining priority in the queue.


        newLanes = mergeLanes(newLanes, updateLane);
      } else {
        // This update does have sufficient priority.
        if (newLastBaseUpdate !== null) {
          var _clone = {
            eventTime: updateEventTime,
            // This update is going to be committed so we never want uncommit
            // it. Using NoLane works because 0 is a subset of all bitmasks, so
            // this will never be skipped by the check above.
            lane: NoLane,
            tag: update.tag,
            payload: update.payload,
            callback: update.callback,
            next: null
          };
          newLastBaseUpdate = newLastBaseUpdate.next = _clone;
        } // Process this update.


        newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);
        var callback = update.callback;

        if (callback !== null) {
          workInProgress.flags |= Callback;
          var effects = queue.effects;

          if (effects === null) {
            queue.effects = [update];
          } else {
            effects.push(update);
          }
        }
      }

      update = update.next;

      if (update === null) {
        pendingQueue = queue.shared.pending;

        if (pendingQueue === null) {
          break;
        } else {
          // An update was scheduled from inside a reducer. Add the new
          // pending updates to the end of the list and keep processing.
          var _lastPendingUpdate = pendingQueue; // Intentionally unsound. Pending updates form a circular list, but we
          // unravel them when transferring them to the base queue.

          var _firstPendingUpdate = _lastPendingUpdate.next;
          _lastPendingUpdate.next = null;
          update = _firstPendingUpdate;
          queue.lastBaseUpdate = _lastPendingUpdate;
          queue.shared.pending = null;
        }
      }
    } while (true);

    if (newLastBaseUpdate === null) {
      newBaseState = newState;
    }

    queue.baseState = newBaseState;
    queue.firstBaseUpdate = newFirstBaseUpdate;
    queue.lastBaseUpdate = newLastBaseUpdate; // Set the remaining expiration time to be whatever is remaining in the queue.
    // This should be fine because the only two other things that contribute to
    // expiration time are props and context. We're already in the middle of the
    // begin phase by the time we start processing the queue, so we've already
    // dealt with the props. Context in components that specify
    // shouldComponentUpdate is tricky; but we'll have to account for
    // that regardless.

    markSkippedUpdateLanes(newLanes);
    workInProgress.lanes = newLanes;
    workInProgress.memoizedState = newState;
  }

  {
    currentlyProcessingQueue = null;
  }
}

function callCallback(callback, context) {
  if (!(typeof callback === 'function')) {
    {
      throw Error( "Invalid argument passed as callback. Expected a function. Instead received: " + callback );
    }
  }

  callback.call(context);
}

function resetHasForceUpdateBeforeProcessing() {
  hasForceUpdate = false;
}
function checkHasForceUpdateAfterProcessing() {
  return hasForceUpdate;
}
function commitUpdateQueue(finishedWork, finishedQueue, instance) {
  // Commit the effects
  var effects = finishedQueue.effects;
  finishedQueue.effects = null;

  if (effects !== null) {
    for (var i = 0; i < effects.length; i++) {
      var effect = effects[i];
      var callback = effect.callback;

      if (callback !== null) {
        effect.callback = null;
        callCallback(callback, instance);
      }
    }
  }
}

var fakeInternalInstance = {};
var isArray = Array.isArray; // React.Component uses a shared frozen object by default.
// We'll use it to determine whether we need to initialize legacy refs.

var emptyRefsObject = new React.Component().refs;
var didWarnAboutStateAssignmentForComponent;
var didWarnAboutUninitializedState;
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
var didWarnAboutLegacyLifecyclesAndDerivedState;
var didWarnAboutUndefinedDerivedState;
var warnOnUndefinedDerivedState;
var warnOnInvalidCallback;
var didWarnAboutDirectlyAssigningPropsToState;
var didWarnAboutContextTypeAndContextTypes;
var didWarnAboutInvalidateContextType;

{
  didWarnAboutStateAssignmentForComponent = new Set();
  didWarnAboutUninitializedState = new Set();
  didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
  didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
  didWarnAboutDirectlyAssigningPropsToState = new Set();
  didWarnAboutUndefinedDerivedState = new Set();
  didWarnAboutContextTypeAndContextTypes = new Set();
  didWarnAboutInvalidateContextType = new Set();
  var didWarnOnInvalidCallback = new Set();

  warnOnInvalidCallback = function (callback, callerName) {
    if (callback === null || typeof callback === 'function') {
      return;
    }

    var key = callerName + '_' + callback;

    if (!didWarnOnInvalidCallback.has(key)) {
      didWarnOnInvalidCallback.add(key);

      error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
    }
  };

  warnOnUndefinedDerivedState = function (type, partialState) {
    if (partialState === undefined) {
      var componentName = getComponentName(type) || 'Component';

      if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
        didWarnAboutUndefinedDerivedState.add(componentName);

        error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
      }
    }
  }; // This is so gross but it's at least non-critical and can be removed if
  // it causes problems. This is meant to give a nicer error message for
  // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,
  // ...)) which otherwise throws a "_processChildContext is not a function"
  // exception.


  Object.defineProperty(fakeInternalInstance, '_processChildContext', {
    enumerable: false,
    value: function () {
      {
        {
          throw Error( "_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal)." );
        }
      }
    }
  });
  Object.freeze(fakeInternalInstance);
}

function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
  var prevState = workInProgress.memoizedState;

  {
    if ( workInProgress.mode & StrictMode) {
      disableLogs();

      try {
        // Invoke the function an extra time to help detect side-effects.
        getDerivedStateFromProps(nextProps, prevState);
      } finally {
        reenableLogs();
      }
    }
  }

  var partialState = getDerivedStateFromProps(nextProps, prevState);

  {
    warnOnUndefinedDerivedState(ctor, partialState);
  } // Merge the partial state and the previous state.


  var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
  workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the
  // base state.

  if (workInProgress.lanes === NoLanes) {
    // Queue is always non-null for classes
    var updateQueue = workInProgress.updateQueue;
    updateQueue.baseState = memoizedState;
  }
}
var classComponentUpdater = {
  isMounted: isMounted,
  enqueueSetState: function (inst, payload, callback) {
    var fiber = get(inst);
    var eventTime = requestEventTime();
    var lane = requestUpdateLane(fiber);
    var update = createUpdate(eventTime, lane);
    update.payload = payload;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback(callback, 'setState');
      }

      update.callback = callback;
    }

    enqueueUpdate(fiber, update);
    scheduleUpdateOnFiber(fiber, lane, eventTime);
  },
  enqueueReplaceState: function (inst, payload, callback) {
    var fiber = get(inst);
    var eventTime = requestEventTime();
    var lane = requestUpdateLane(fiber);
    var update = createUpdate(eventTime, lane);
    update.tag = ReplaceState;
    update.payload = payload;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback(callback, 'replaceState');
      }

      update.callback = callback;
    }

    enqueueUpdate(fiber, update);
    scheduleUpdateOnFiber(fiber, lane, eventTime);
  },
  enqueueForceUpdate: function (inst, callback) {
    var fiber = get(inst);
    var eventTime = requestEventTime();
    var lane = requestUpdateLane(fiber);
    var update = createUpdate(eventTime, lane);
    update.tag = ForceUpdate;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback(callback, 'forceUpdate');
      }

      update.callback = callback;
    }

    enqueueUpdate(fiber, update);
    scheduleUpdateOnFiber(fiber, lane, eventTime);
  }
};

function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
  var instance = workInProgress.stateNode;

  if (typeof instance.shouldComponentUpdate === 'function') {
    {
      if ( workInProgress.mode & StrictMode) {
        disableLogs();

        try {
          // Invoke the function an extra time to help detect side-effects.
          instance.shouldComponentUpdate(newProps, newState, nextContext);
        } finally {
          reenableLogs();
        }
      }
    }

    var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);

    {
      if (shouldUpdate === undefined) {
        error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component');
      }
    }

    return shouldUpdate;
  }

  if (ctor.prototype && ctor.prototype.isPureReactComponent) {
    return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
  }

  return true;
}

function checkClassInstance(workInProgress, ctor, newProps) {
  var instance = workInProgress.stateNode;

  {
    var name = getComponentName(ctor) || 'Component';
    var renderPresent = instance.render;

    if (!renderPresent) {
      if (ctor.prototype && typeof ctor.prototype.render === 'function') {
        error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
      } else {
        error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
      }
    }

    if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
      error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);
    }

    if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
      error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);
    }

    if (instance.propTypes) {
      error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);
    }

    if (instance.contextType) {
      error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);
    }

    {
      if (instance.contextTypes) {
        error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);
      }

      if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
        didWarnAboutContextTypeAndContextTypes.add(ctor);

        error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
      }
    }

    if (typeof instance.componentShouldUpdate === 'function') {
      error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);
    }

    if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
      error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
    }

    if (typeof instance.componentDidUnmount === 'function') {
      error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);
    }

    if (typeof instance.componentDidReceiveProps === 'function') {
      error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);
    }

    if (typeof instance.componentWillRecieveProps === 'function') {
      error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);
    }

    if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {
      error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);
    }

    var hasMutatedProps = instance.props !== newProps;

    if (instance.props !== undefined && hasMutatedProps) {
      error('%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name);
    }

    if (instance.defaultProps) {
      error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);
    }

    if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
      didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);

      error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
    }

    if (typeof instance.getDerivedStateFromProps === 'function') {
      error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);
    }

    if (typeof instance.getDerivedStateFromError === 'function') {
      error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);
    }

    if (typeof ctor.getSnapshotBeforeUpdate === 'function') {
      error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);
    }

    var _state = instance.state;

    if (_state && (typeof _state !== 'object' || isArray(_state))) {
      error('%s.state: must be set to an object or null', name);
    }

    if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') {
      error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);
    }
  }
}

function adoptClassInstance(workInProgress, instance) {
  instance.updater = classComponentUpdater;
  workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates

  set(instance, workInProgress);

  {
    instance._reactInternalInstance = fakeInternalInstance;
  }
}

function constructClassInstance(workInProgress, ctor, props) {
  var isLegacyContextConsumer = false;
  var unmaskedContext = emptyContextObject;
  var context = emptyContextObject;
  var contextType = ctor.contextType;

  {
    if ('contextType' in ctor) {
      var isValid = // Allow null for conditional declaration
      contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>

      if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
        didWarnAboutInvalidateContextType.add(ctor);
        var addendum = '';

        if (contextType === undefined) {
          addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
        } else if (typeof contextType !== 'object') {
          addendum = ' However, it is set to a ' + typeof contextType + '.';
        } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
          addendum = ' Did you accidentally pass the Context.Provider instead?';
        } else if (contextType._context !== undefined) {
          // <Context.Consumer>
          addendum = ' Did you accidentally pass the Context.Consumer instead?';
        } else {
          addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
        }

        error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);
      }
    }
  }

  if (typeof contextType === 'object' && contextType !== null) {
    context = readContext(contextType);
  } else {
    unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    var contextTypes = ctor.contextTypes;
    isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
    context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
  } // Instantiate twice to help detect side-effects.


  {
    if ( workInProgress.mode & StrictMode) {
      disableLogs();

      try {
        new ctor(props, context); // eslint-disable-line no-new
      } finally {
        reenableLogs();
      }
    }
  }

  var instance = new ctor(props, context);
  var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
  adoptClassInstance(workInProgress, instance);

  {
    if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
      var componentName = getComponentName(ctor) || 'Component';

      if (!didWarnAboutUninitializedState.has(componentName)) {
        didWarnAboutUninitializedState.add(componentName);

        error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);
      }
    } // If new component APIs are defined, "unsafe" lifecycles won't be called.
    // Warn about these lifecycles if they are present.
    // Don't warn about react-lifecycles-compat polyfilled methods though.


    if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
      var foundWillMountName = null;
      var foundWillReceivePropsName = null;
      var foundWillUpdateName = null;

      if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
        foundWillMountName = 'componentWillMount';
      } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
        foundWillMountName = 'UNSAFE_componentWillMount';
      }

      if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
        foundWillReceivePropsName = 'componentWillReceiveProps';
      } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
        foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
      }

      if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
        foundWillUpdateName = 'componentWillUpdate';
      } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
        foundWillUpdateName = 'UNSAFE_componentWillUpdate';
      }

      if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
        var _componentName = getComponentName(ctor) || 'Component';

        var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';

        if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
          didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);

          error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://reactjs.org/link/unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n  " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n  " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n  " + foundWillUpdateName : '');
        }
      }
    }
  } // Cache unmasked context so we can avoid recreating masked context unless necessary.
  // ReactFiberContext usually updates this cache but can't for newly-created instances.


  if (isLegacyContextConsumer) {
    cacheContext(workInProgress, unmaskedContext, context);
  }

  return instance;
}

function callComponentWillMount(workInProgress, instance) {
  var oldState = instance.state;

  if (typeof instance.componentWillMount === 'function') {
    instance.componentWillMount();
  }

  if (typeof instance.UNSAFE_componentWillMount === 'function') {
    instance.UNSAFE_componentWillMount();
  }

  if (oldState !== instance.state) {
    {
      error('%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
    }

    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  }
}

function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
  var oldState = instance.state;

  if (typeof instance.componentWillReceiveProps === 'function') {
    instance.componentWillReceiveProps(newProps, nextContext);
  }

  if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
    instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  }

  if (instance.state !== oldState) {
    {
      var componentName = getComponentName(workInProgress.type) || 'Component';

      if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
        didWarnAboutStateAssignmentForComponent.add(componentName);

        error('%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
      }
    }

    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  }
} // Invokes the mount life-cycles on a previously never rendered instance.


function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
  {
    checkClassInstance(workInProgress, ctor, newProps);
  }

  var instance = workInProgress.stateNode;
  instance.props = newProps;
  instance.state = workInProgress.memoizedState;
  instance.refs = emptyRefsObject;
  initializeUpdateQueue(workInProgress);
  var contextType = ctor.contextType;

  if (typeof contextType === 'object' && contextType !== null) {
    instance.context = readContext(contextType);
  } else {
    var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    instance.context = getMaskedContext(workInProgress, unmaskedContext);
  }

  {
    if (instance.state === newProps) {
      var componentName = getComponentName(ctor) || 'Component';

      if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
        didWarnAboutDirectlyAssigningPropsToState.add(componentName);

        error('%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
      }
    }

    if (workInProgress.mode & StrictMode) {
      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
    }

    {
      ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
    }
  }

  processUpdateQueue(workInProgress, newProps, instance, renderLanes);
  instance.state = workInProgress.memoizedState;
  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    instance.state = workInProgress.memoizedState;
  } // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.


  if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
    callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's
    // process them now.

    processUpdateQueue(workInProgress, newProps, instance, renderLanes);
    instance.state = workInProgress.memoizedState;
  }

  if (typeof instance.componentDidMount === 'function') {
    workInProgress.flags |= Update;
  }
}

function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {
  var instance = workInProgress.stateNode;
  var oldProps = workInProgress.memoizedProps;
  instance.props = oldProps;
  var oldContext = instance.context;
  var contextType = ctor.contextType;
  var nextContext = emptyContextObject;

  if (typeof contextType === 'object' && contextType !== null) {
    nextContext = readContext(contextType);
  } else {
    var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
  // ever the previously attempted to render - not the "current". However,
  // during componentDidUpdate we pass the "current" props.
  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.

  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
    if (oldProps !== newProps || oldContext !== nextContext) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
    }
  }

  resetHasForceUpdateBeforeProcessing();
  var oldState = workInProgress.memoizedState;
  var newState = instance.state = oldState;
  processUpdateQueue(workInProgress, newProps, instance, renderLanes);
  newState = workInProgress.memoizedState;

  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.flags |= Update;
    }

    return false;
  }

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    newState = workInProgress.memoizedState;
  }

  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);

  if (shouldUpdate) {
    // In order to support react-lifecycles-compat polyfilled components,
    // Unsafe lifecycles should not be invoked for components using the new APIs.
    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
      if (typeof instance.componentWillMount === 'function') {
        instance.componentWillMount();
      }

      if (typeof instance.UNSAFE_componentWillMount === 'function') {
        instance.UNSAFE_componentWillMount();
      }
    }

    if (typeof instance.componentDidMount === 'function') {
      workInProgress.flags |= Update;
    }
  } else {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.flags |= Update;
    } // If shouldComponentUpdate returned false, we should still update the
    // memoized state to indicate that this work can be reused.


    workInProgress.memoizedProps = newProps;
    workInProgress.memoizedState = newState;
  } // Update the existing instance's state, props, and context pointers even
  // if shouldComponentUpdate returns false.


  instance.props = newProps;
  instance.state = newState;
  instance.context = nextContext;
  return shouldUpdate;
} // Invokes the update life-cycles and returns false if it shouldn't rerender.


function updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) {
  var instance = workInProgress.stateNode;
  cloneUpdateQueue(current, workInProgress);
  var unresolvedOldProps = workInProgress.memoizedProps;
  var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps);
  instance.props = oldProps;
  var unresolvedNewProps = workInProgress.pendingProps;
  var oldContext = instance.context;
  var contextType = ctor.contextType;
  var nextContext = emptyContextObject;

  if (typeof contextType === 'object' && contextType !== null) {
    nextContext = readContext(contextType);
  } else {
    var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
  // ever the previously attempted to render - not the "current". However,
  // during componentDidUpdate we pass the "current" props.
  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.

  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
    if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
    }
  }

  resetHasForceUpdateBeforeProcessing();
  var oldState = workInProgress.memoizedState;
  var newState = instance.state = oldState;
  processUpdateQueue(workInProgress, newProps, instance, renderLanes);
  newState = workInProgress.memoizedState;

  if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.flags |= Update;
      }
    }

    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.flags |= Snapshot;
      }
    }

    return false;
  }

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    newState = workInProgress.memoizedState;
  }

  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);

  if (shouldUpdate) {
    // In order to support react-lifecycles-compat polyfilled components,
    // Unsafe lifecycles should not be invoked for components using the new APIs.
    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
      if (typeof instance.componentWillUpdate === 'function') {
        instance.componentWillUpdate(newProps, newState, nextContext);
      }

      if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
        instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
      }
    }

    if (typeof instance.componentDidUpdate === 'function') {
      workInProgress.flags |= Update;
    }

    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      workInProgress.flags |= Snapshot;
    }
  } else {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.flags |= Update;
      }
    }

    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.flags |= Snapshot;
      }
    } // If shouldComponentUpdate returned false, we should still update the
    // memoized props/state to indicate that this work can be reused.


    workInProgress.memoizedProps = newProps;
    workInProgress.memoizedState = newState;
  } // Update the existing instance's state, props, and context pointers even
  // if shouldComponentUpdate returns false.


  instance.props = newProps;
  instance.state = newState;
  instance.context = nextContext;
  return shouldUpdate;
}

var didWarnAboutMaps;
var didWarnAboutGenerators;
var didWarnAboutStringRefs;
var ownerHasKeyUseWarning;
var ownerHasFunctionTypeWarning;

var warnForMissingKey = function (child, returnFiber) {};

{
  didWarnAboutMaps = false;
  didWarnAboutGenerators = false;
  didWarnAboutStringRefs = {};
  /**
   * Warn if there's no key explicitly set on dynamic arrays of children or
   * object keys are not valid. This allows us to keep track of children between
   * updates.
   */

  ownerHasKeyUseWarning = {};
  ownerHasFunctionTypeWarning = {};

  warnForMissingKey = function (child, returnFiber) {
    if (child === null || typeof child !== 'object') {
      return;
    }

    if (!child._store || child._store.validated || child.key != null) {
      return;
    }

    if (!(typeof child._store === 'object')) {
      {
        throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    child._store.validated = true;
    var componentName = getComponentName(returnFiber.type) || 'Component';

    if (ownerHasKeyUseWarning[componentName]) {
      return;
    }

    ownerHasKeyUseWarning[componentName] = true;

    error('Each child in a list should have a unique ' + '"key" prop. See https://reactjs.org/link/warning-keys for ' + 'more information.');
  };
}

var isArray$1 = Array.isArray;

function coerceRef(returnFiber, current, element) {
  var mixedRef = element.ref;

  if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
    {
      // TODO: Clean this up once we turn on the string ref warning for
      // everyone, because the strict mode case will no longer be relevant
      if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
      // because these cannot be automatically converted to an arrow function
      // using a codemod. Therefore, we don't have to warn about string refs again.
      !(element._owner && element._self && element._owner.stateNode !== element._self)) {
        var componentName = getComponentName(returnFiber.type) || 'Component';

        if (!didWarnAboutStringRefs[componentName]) {
          {
            error('A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', mixedRef);
          }

          didWarnAboutStringRefs[componentName] = true;
        }
      }
    }

    if (element._owner) {
      var owner = element._owner;
      var inst;

      if (owner) {
        var ownerFiber = owner;

        if (!(ownerFiber.tag === ClassComponent)) {
          {
            throw Error( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref" );
          }
        }

        inst = ownerFiber.stateNode;
      }

      if (!inst) {
        {
          throw Error( "Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue." );
        }
      }

      var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref

      if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {
        return current.ref;
      }

      var ref = function (value) {
        var refs = inst.refs;

        if (refs === emptyRefsObject) {
          // This is a lazy pooled frozen object, so we need to initialize.
          refs = inst.refs = {};
        }

        if (value === null) {
          delete refs[stringRef];
        } else {
          refs[stringRef] = value;
        }
      };

      ref._stringRef = stringRef;
      return ref;
    } else {
      if (!(typeof mixedRef === 'string')) {
        {
          throw Error( "Expected ref to be a function, a string, an object returned by React.createRef(), or null." );
        }
      }

      if (!element._owner) {
        {
          throw Error( "Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information." );
        }
      }
    }
  }

  return mixedRef;
}

function throwOnInvalidObjectType(returnFiber, newChild) {
  if (returnFiber.type !== 'textarea') {
    {
      {
        throw Error( "Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + "). If you meant to render a collection of children, use an array instead." );
      }
    }
  }
}

function warnOnFunctionType(returnFiber) {
  {
    var componentName = getComponentName(returnFiber.type) || 'Component';

    if (ownerHasFunctionTypeWarning[componentName]) {
      return;
    }

    ownerHasFunctionTypeWarning[componentName] = true;

    error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
  }
} // We avoid inlining this to avoid potential deopts from using try/catch.
// to be able to optimize each path individually by branching early. This needs
// a compiler or we can do it manually. Helpers that don't need this branching
// live outside of this function.


function ChildReconciler(shouldTrackSideEffects) {
  function deleteChild(returnFiber, childToDelete) {
    if (!shouldTrackSideEffects) {
      // Noop.
      return;
    } // Deletions are added in reversed order so we add it to the front.
    // At this point, the return fiber's effect list is empty except for
    // deletions, so we can just append the deletion to the list. The remaining
    // effects aren't added until the complete phase. Once we implement
    // resuming, this may not be true.


    var last = returnFiber.lastEffect;

    if (last !== null) {
      last.nextEffect = childToDelete;
      returnFiber.lastEffect = childToDelete;
    } else {
      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
    }

    childToDelete.nextEffect = null;
    childToDelete.flags = Deletion;
  }

  function deleteRemainingChildren(returnFiber, currentFirstChild) {
    if (!shouldTrackSideEffects) {
      // Noop.
      return null;
    } // TODO: For the shouldClone case, this could be micro-optimized a bit by
    // assuming that after the first child we've already added everything.


    var childToDelete = currentFirstChild;

    while (childToDelete !== null) {
      deleteChild(returnFiber, childToDelete);
      childToDelete = childToDelete.sibling;
    }

    return null;
  }

  function mapRemainingChildren(returnFiber, currentFirstChild) {
    // Add the remaining children to a temporary map so that we can find them by
    // keys quickly. Implicit (null) keys get added to this set with their index
    // instead.
    var existingChildren = new Map();
    var existingChild = currentFirstChild;

    while (existingChild !== null) {
      if (existingChild.key !== null) {
        existingChildren.set(existingChild.key, existingChild);
      } else {
        existingChildren.set(existingChild.index, existingChild);
      }

      existingChild = existingChild.sibling;
    }

    return existingChildren;
  }

  function useFiber(fiber, pendingProps) {
    // We currently set sibling to null and index to 0 here because it is easy
    // to forget to do before returning it. E.g. for the single child case.
    var clone = createWorkInProgress(fiber, pendingProps);
    clone.index = 0;
    clone.sibling = null;
    return clone;
  }

  function placeChild(newFiber, lastPlacedIndex, newIndex) {
    newFiber.index = newIndex;

    if (!shouldTrackSideEffects) {
      // Noop.
      return lastPlacedIndex;
    }

    var current = newFiber.alternate;

    if (current !== null) {
      var oldIndex = current.index;

      if (oldIndex < lastPlacedIndex) {
        // This is a move.
        newFiber.flags = Placement;
        return lastPlacedIndex;
      } else {
        // This item can stay in place.
        return oldIndex;
      }
    } else {
      // This is an insertion.
      newFiber.flags = Placement;
      return lastPlacedIndex;
    }
  }

  function placeSingleChild(newFiber) {
    // This is simpler for the single child case. We only need to do a
    // placement for inserting new children.
    if (shouldTrackSideEffects && newFiber.alternate === null) {
      newFiber.flags = Placement;
    }

    return newFiber;
  }

  function updateTextNode(returnFiber, current, textContent, lanes) {
    if (current === null || current.tag !== HostText) {
      // Insert
      var created = createFiberFromText(textContent, returnFiber.mode, lanes);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current, textContent);
      existing.return = returnFiber;
      return existing;
    }
  }

  function updateElement(returnFiber, current, element, lanes) {
    if (current !== null) {
      if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
       isCompatibleFamilyForHotReloading(current, element) )) {
        // Move based on index
        var existing = useFiber(current, element.props);
        existing.ref = coerceRef(returnFiber, current, element);
        existing.return = returnFiber;

        {
          existing._debugSource = element._source;
          existing._debugOwner = element._owner;
        }

        return existing;
      }
    } // Insert


    var created = createFiberFromElement(element, returnFiber.mode, lanes);
    created.ref = coerceRef(returnFiber, current, element);
    created.return = returnFiber;
    return created;
  }

  function updatePortal(returnFiber, current, portal, lanes) {
    if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {
      // Insert
      var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current, portal.children || []);
      existing.return = returnFiber;
      return existing;
    }
  }

  function updateFragment(returnFiber, current, fragment, lanes, key) {
    if (current === null || current.tag !== Fragment) {
      // Insert
      var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current, fragment);
      existing.return = returnFiber;
      return existing;
    }
  }

  function createChild(returnFiber, newChild, lanes) {
    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys. If the previous node is implicitly keyed
      // we can continue to replace it without aborting even if it is not a text
      // node.
      var created = createFiberFromText('' + newChild, returnFiber.mode, lanes);
      created.return = returnFiber;
      return created;
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);

            _created.ref = coerceRef(returnFiber, null, newChild);
            _created.return = returnFiber;
            return _created;
          }

        case REACT_PORTAL_TYPE:
          {
            var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);

            _created2.return = returnFiber;
            return _created2;
          }
      }

      if (isArray$1(newChild) || getIteratorFn(newChild)) {
        var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);

        _created3.return = returnFiber;
        return _created3;
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType(returnFiber);
      }
    }

    return null;
  }

  function updateSlot(returnFiber, oldFiber, newChild, lanes) {
    // Update the fiber if the keys match, otherwise return null.
    var key = oldFiber !== null ? oldFiber.key : null;

    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys. If the previous node is implicitly keyed
      // we can continue to replace it without aborting even if it is not a text
      // node.
      if (key !== null) {
        return null;
      }

      return updateTextNode(returnFiber, oldFiber, '' + newChild, lanes);
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            if (newChild.key === key) {
              if (newChild.type === REACT_FRAGMENT_TYPE) {
                return updateFragment(returnFiber, oldFiber, newChild.props.children, lanes, key);
              }

              return updateElement(returnFiber, oldFiber, newChild, lanes);
            } else {
              return null;
            }
          }

        case REACT_PORTAL_TYPE:
          {
            if (newChild.key === key) {
              return updatePortal(returnFiber, oldFiber, newChild, lanes);
            } else {
              return null;
            }
          }
      }

      if (isArray$1(newChild) || getIteratorFn(newChild)) {
        if (key !== null) {
          return null;
        }

        return updateFragment(returnFiber, oldFiber, newChild, lanes, null);
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType(returnFiber);
      }
    }

    return null;
  }

  function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys, so we neither have to check the old nor
      // new node for the key. If both are text nodes, they match.
      var matchedFiber = existingChildren.get(newIdx) || null;
      return updateTextNode(returnFiber, matchedFiber, '' + newChild, lanes);
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;

            if (newChild.type === REACT_FRAGMENT_TYPE) {
              return updateFragment(returnFiber, _matchedFiber, newChild.props.children, lanes, newChild.key);
            }

            return updateElement(returnFiber, _matchedFiber, newChild, lanes);
          }

        case REACT_PORTAL_TYPE:
          {
            var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;

            return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
          }

      }

      if (isArray$1(newChild) || getIteratorFn(newChild)) {
        var _matchedFiber3 = existingChildren.get(newIdx) || null;

        return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null);
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType(returnFiber);
      }
    }

    return null;
  }
  /**
   * Warns if there is a duplicate or missing key
   */


  function warnOnInvalidKey(child, knownKeys, returnFiber) {
    {
      if (typeof child !== 'object' || child === null) {
        return knownKeys;
      }

      switch (child.$$typeof) {
        case REACT_ELEMENT_TYPE:
        case REACT_PORTAL_TYPE:
          warnForMissingKey(child, returnFiber);
          var key = child.key;

          if (typeof key !== 'string') {
            break;
          }

          if (knownKeys === null) {
            knownKeys = new Set();
            knownKeys.add(key);
            break;
          }

          if (!knownKeys.has(key)) {
            knownKeys.add(key);
            break;
          }

          error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);

          break;
      }
    }

    return knownKeys;
  }

  function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
    // This algorithm can't optimize by searching from both ends since we
    // don't have backpointers on fibers. I'm trying to see how far we can get
    // with that model. If it ends up not being worth the tradeoffs, we can
    // add it later.
    // Even with a two ended optimization, we'd want to optimize for the case
    // where there are few changes and brute force the comparison instead of
    // going for the Map. It'd like to explore hitting that path first in
    // forward-only mode and only go for the Map once we notice that we need
    // lots of look ahead. This doesn't handle reversal as well as two ended
    // search but that's unusual. Besides, for the two ended optimization to
    // work on Iterables, we'd need to copy the whole set.
    // In this first iteration, we'll just live with hitting the bad case
    // (adding everything to a Map) in for every insert/move.
    // If you change this code, also update reconcileChildrenIterator() which
    // uses the same algorithm.
    {
      // First, validate keys.
      var knownKeys = null;

      for (var i = 0; i < newChildren.length; i++) {
        var child = newChildren[i];
        knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
      }
    }

    var resultingFirstChild = null;
    var previousNewFiber = null;
    var oldFiber = currentFirstChild;
    var lastPlacedIndex = 0;
    var newIdx = 0;
    var nextOldFiber = null;

    for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
      if (oldFiber.index > newIdx) {
        nextOldFiber = oldFiber;
        oldFiber = null;
      } else {
        nextOldFiber = oldFiber.sibling;
      }

      var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);

      if (newFiber === null) {
        // TODO: This breaks on empty slots like null children. That's
        // unfortunate because it triggers the slow path all the time. We need
        // a better way to communicate whether this was a miss or null,
        // boolean, undefined, etc.
        if (oldFiber === null) {
          oldFiber = nextOldFiber;
        }

        break;
      }

      if (shouldTrackSideEffects) {
        if (oldFiber && newFiber.alternate === null) {
          // We matched the slot, but we didn't reuse the existing fiber, so we
          // need to delete the existing child.
          deleteChild(returnFiber, oldFiber);
        }
      }

      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);

      if (previousNewFiber === null) {
        // TODO: Move out of the loop. This only happens for the first run.
        resultingFirstChild = newFiber;
      } else {
        // TODO: Defer siblings if we're not at the right index for this slot.
        // I.e. if we had null values before, then we want to defer this
        // for each null value. However, we also don't want to call updateSlot
        // with the previous one.
        previousNewFiber.sibling = newFiber;
      }

      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }

    if (newIdx === newChildren.length) {
      // We've reached the end of the new children. We can delete the rest.
      deleteRemainingChildren(returnFiber, oldFiber);
      return resultingFirstChild;
    }

    if (oldFiber === null) {
      // If we don't have any more existing children we can choose a fast path
      // since the rest will all be insertions.
      for (; newIdx < newChildren.length; newIdx++) {
        var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);

        if (_newFiber === null) {
          continue;
        }

        lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);

        if (previousNewFiber === null) {
          // TODO: Move out of the loop. This only happens for the first run.
          resultingFirstChild = _newFiber;
        } else {
          previousNewFiber.sibling = _newFiber;
        }

        previousNewFiber = _newFiber;
      }

      return resultingFirstChild;
    } // Add all children to a key map for quick lookups.


    var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.

    for (; newIdx < newChildren.length; newIdx++) {
      var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);

      if (_newFiber2 !== null) {
        if (shouldTrackSideEffects) {
          if (_newFiber2.alternate !== null) {
            // The new fiber is a work in progress, but if there exists a
            // current, that means that we reused the fiber. We need to delete
            // it from the child list so that we don't add it to the deletion
            // list.
            existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
          }
        }

        lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);

        if (previousNewFiber === null) {
          resultingFirstChild = _newFiber2;
        } else {
          previousNewFiber.sibling = _newFiber2;
        }

        previousNewFiber = _newFiber2;
      }
    }

    if (shouldTrackSideEffects) {
      // Any existing children that weren't consumed above were deleted. We need
      // to add them to the deletion list.
      existingChildren.forEach(function (child) {
        return deleteChild(returnFiber, child);
      });
    }

    return resultingFirstChild;
  }

  function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
    // This is the same implementation as reconcileChildrenArray(),
    // but using the iterator instead.
    var iteratorFn = getIteratorFn(newChildrenIterable);

    if (!(typeof iteratorFn === 'function')) {
      {
        throw Error( "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." );
      }
    }

    {
      // We don't support rendering Generators because it's a mutation.
      // See https://github.com/facebook/react/issues/12995
      if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag
      newChildrenIterable[Symbol.toStringTag] === 'Generator') {
        if (!didWarnAboutGenerators) {
          error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');
        }

        didWarnAboutGenerators = true;
      } // Warn about using Maps as children


      if (newChildrenIterable.entries === iteratorFn) {
        if (!didWarnAboutMaps) {
          error('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
        }

        didWarnAboutMaps = true;
      } // First, validate keys.
      // We'll get a different iterator later for the main pass.


      var _newChildren = iteratorFn.call(newChildrenIterable);

      if (_newChildren) {
        var knownKeys = null;

        var _step = _newChildren.next();

        for (; !_step.done; _step = _newChildren.next()) {
          var child = _step.value;
          knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
        }
      }
    }

    var newChildren = iteratorFn.call(newChildrenIterable);

    if (!(newChildren != null)) {
      {
        throw Error( "An iterable object provided no iterator." );
      }
    }

    var resultingFirstChild = null;
    var previousNewFiber = null;
    var oldFiber = currentFirstChild;
    var lastPlacedIndex = 0;
    var newIdx = 0;
    var nextOldFiber = null;
    var step = newChildren.next();

    for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
      if (oldFiber.index > newIdx) {
        nextOldFiber = oldFiber;
        oldFiber = null;
      } else {
        nextOldFiber = oldFiber.sibling;
      }

      var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);

      if (newFiber === null) {
        // TODO: This breaks on empty slots like null children. That's
        // unfortunate because it triggers the slow path all the time. We need
        // a better way to communicate whether this was a miss or null,
        // boolean, undefined, etc.
        if (oldFiber === null) {
          oldFiber = nextOldFiber;
        }

        break;
      }

      if (shouldTrackSideEffects) {
        if (oldFiber && newFiber.alternate === null) {
          // We matched the slot, but we didn't reuse the existing fiber, so we
          // need to delete the existing child.
          deleteChild(returnFiber, oldFiber);
        }
      }

      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);

      if (previousNewFiber === null) {
        // TODO: Move out of the loop. This only happens for the first run.
        resultingFirstChild = newFiber;
      } else {
        // TODO: Defer siblings if we're not at the right index for this slot.
        // I.e. if we had null values before, then we want to defer this
        // for each null value. However, we also don't want to call updateSlot
        // with the previous one.
        previousNewFiber.sibling = newFiber;
      }

      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }

    if (step.done) {
      // We've reached the end of the new children. We can delete the rest.
      deleteRemainingChildren(returnFiber, oldFiber);
      return resultingFirstChild;
    }

    if (oldFiber === null) {
      // If we don't have any more existing children we can choose a fast path
      // since the rest will all be insertions.
      for (; !step.done; newIdx++, step = newChildren.next()) {
        var _newFiber3 = createChild(returnFiber, step.value, lanes);

        if (_newFiber3 === null) {
          continue;
        }

        lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);

        if (previousNewFiber === null) {
          // TODO: Move out of the loop. This only happens for the first run.
          resultingFirstChild = _newFiber3;
        } else {
          previousNewFiber.sibling = _newFiber3;
        }

        previousNewFiber = _newFiber3;
      }

      return resultingFirstChild;
    } // Add all children to a key map for quick lookups.


    var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.

    for (; !step.done; newIdx++, step = newChildren.next()) {
      var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);

      if (_newFiber4 !== null) {
        if (shouldTrackSideEffects) {
          if (_newFiber4.alternate !== null) {
            // The new fiber is a work in progress, but if there exists a
            // current, that means that we reused the fiber. We need to delete
            // it from the child list so that we don't add it to the deletion
            // list.
            existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
          }
        }

        lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);

        if (previousNewFiber === null) {
          resultingFirstChild = _newFiber4;
        } else {
          previousNewFiber.sibling = _newFiber4;
        }

        previousNewFiber = _newFiber4;
      }
    }

    if (shouldTrackSideEffects) {
      // Any existing children that weren't consumed above were deleted. We need
      // to add them to the deletion list.
      existingChildren.forEach(function (child) {
        return deleteChild(returnFiber, child);
      });
    }

    return resultingFirstChild;
  }

  function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
    // There's no need to check for keys on text nodes since we don't have a
    // way to define them.
    if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
      // We already have an existing node so let's just update it and delete
      // the rest.
      deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
      var existing = useFiber(currentFirstChild, textContent);
      existing.return = returnFiber;
      return existing;
    } // The existing first child is not a text node so we need to create one
    // and delete the existing ones.


    deleteRemainingChildren(returnFiber, currentFirstChild);
    var created = createFiberFromText(textContent, returnFiber.mode, lanes);
    created.return = returnFiber;
    return created;
  }

  function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
    var key = element.key;
    var child = currentFirstChild;

    while (child !== null) {
      // TODO: If key === null and child.key === null, then this only applies to
      // the first item in the list.
      if (child.key === key) {
        switch (child.tag) {
          case Fragment:
            {
              if (element.type === REACT_FRAGMENT_TYPE) {
                deleteRemainingChildren(returnFiber, child.sibling);
                var existing = useFiber(child, element.props.children);
                existing.return = returnFiber;

                {
                  existing._debugSource = element._source;
                  existing._debugOwner = element._owner;
                }

                return existing;
              }

              break;
            }

          case Block:

          // We intentionally fallthrough here if enableBlocksAPI is not on.
          // eslint-disable-next-lined no-fallthrough

          default:
            {
              if (child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
               isCompatibleFamilyForHotReloading(child, element) )) {
                deleteRemainingChildren(returnFiber, child.sibling);

                var _existing3 = useFiber(child, element.props);

                _existing3.ref = coerceRef(returnFiber, child, element);
                _existing3.return = returnFiber;

                {
                  _existing3._debugSource = element._source;
                  _existing3._debugOwner = element._owner;
                }

                return _existing3;
              }

              break;
            }
        } // Didn't match.


        deleteRemainingChildren(returnFiber, child);
        break;
      } else {
        deleteChild(returnFiber, child);
      }

      child = child.sibling;
    }

    if (element.type === REACT_FRAGMENT_TYPE) {
      var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
      created.return = returnFiber;
      return created;
    } else {
      var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);

      _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
      _created4.return = returnFiber;
      return _created4;
    }
  }

  function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
    var key = portal.key;
    var child = currentFirstChild;

    while (child !== null) {
      // TODO: If key === null and child.key === null, then this only applies to
      // the first item in the list.
      if (child.key === key) {
        if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
          deleteRemainingChildren(returnFiber, child.sibling);
          var existing = useFiber(child, portal.children || []);
          existing.return = returnFiber;
          return existing;
        } else {
          deleteRemainingChildren(returnFiber, child);
          break;
        }
      } else {
        deleteChild(returnFiber, child);
      }

      child = child.sibling;
    }

    var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
    created.return = returnFiber;
    return created;
  } // This API will tag the children with the side-effect of the reconciliation
  // itself. They will be added to the side-effect list as we pass through the
  // children and the parent.


  function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) {
    // This function is not recursive.
    // If the top level item is an array, we treat it as a set of children,
    // not as a fragment. Nested arrays on the other hand will be treated as
    // fragment nodes. Recursion happens at the normal flow.
    // Handle top level unkeyed fragments as if they were arrays.
    // This leads to an ambiguity between <>{[...]}</> and <>...</>.
    // We treat the ambiguous cases above the same.
    var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;

    if (isUnkeyedTopLevelFragment) {
      newChild = newChild.props.children;
    } // Handle object types


    var isObject = typeof newChild === 'object' && newChild !== null;

    if (isObject) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));

        case REACT_PORTAL_TYPE:
          return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));

      }
    }

    if (typeof newChild === 'string' || typeof newChild === 'number') {
      return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, lanes));
    }

    if (isArray$1(newChild)) {
      return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
    }

    if (getIteratorFn(newChild)) {
      return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
    }

    if (isObject) {
      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType(returnFiber);
      }
    }

    if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
      // If the new child is undefined, and the return fiber is a composite
      // component, throw an error. If Fiber return types are disabled,
      // we already threw above.
      switch (returnFiber.tag) {
        case ClassComponent:
          {
            {
              var instance = returnFiber.stateNode;

              if (instance.render._isMockFunction) {
                // We allow auto-mocks to proceed as if they're returning null.
                break;
              }
            }
          }
        // Intentionally fall through to the next case, which handles both
        // functions and classes
        // eslint-disable-next-lined no-fallthrough

        case Block:
        case FunctionComponent:
        case ForwardRef:
        case SimpleMemoComponent:
          {
            {
              {
                throw Error( (getComponentName(returnFiber.type) || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." );
              }
            }
          }
      }
    } // Remaining cases are all treated as empty.


    return deleteRemainingChildren(returnFiber, currentFirstChild);
  }

  return reconcileChildFibers;
}

var reconcileChildFibers = ChildReconciler(true);
var mountChildFibers = ChildReconciler(false);
function cloneChildFibers(current, workInProgress) {
  if (!(current === null || workInProgress.child === current.child)) {
    {
      throw Error( "Resuming work not yet implemented." );
    }
  }

  if (workInProgress.child === null) {
    return;
  }

  var currentChild = workInProgress.child;
  var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
  workInProgress.child = newChild;
  newChild.return = workInProgress;

  while (currentChild.sibling !== null) {
    currentChild = currentChild.sibling;
    newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
    newChild.return = workInProgress;
  }

  newChild.sibling = null;
} // Reset a workInProgress child set to prepare it for a second pass.

function resetChildFibers(workInProgress, lanes) {
  var child = workInProgress.child;

  while (child !== null) {
    resetWorkInProgress(child, lanes);
    child = child.sibling;
  }
}

var NO_CONTEXT = {};
var contextStackCursor$1 = createCursor(NO_CONTEXT);
var contextFiberStackCursor = createCursor(NO_CONTEXT);
var rootInstanceStackCursor = createCursor(NO_CONTEXT);

function requiredContext(c) {
  if (!(c !== NO_CONTEXT)) {
    {
      throw Error( "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." );
    }
  }

  return c;
}

function getRootHostContainer() {
  var rootInstance = requiredContext(rootInstanceStackCursor.current);
  return rootInstance;
}

function pushHostContainer(fiber, nextRootInstance) {
  // Push current root instance onto the stack;
  // This allows us to reset root when portals are popped.
  push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.
  // This enables us to pop only Fibers that provide unique contexts.

  push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.
  // However, we can't just call getRootHostContext() and push it because
  // we'd have a different number of entries on the stack depending on
  // whether getRootHostContext() throws somewhere in renderer code or not.
  // So we push an empty value first. This lets us safely unwind on errors.

  push(contextStackCursor$1, NO_CONTEXT, fiber);
  var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.

  pop(contextStackCursor$1, fiber);
  push(contextStackCursor$1, nextRootContext, fiber);
}

function popHostContainer(fiber) {
  pop(contextStackCursor$1, fiber);
  pop(contextFiberStackCursor, fiber);
  pop(rootInstanceStackCursor, fiber);
}

function getHostContext() {
  var context = requiredContext(contextStackCursor$1.current);
  return context;
}

function pushHostContext(fiber) {
  var rootInstance = requiredContext(rootInstanceStackCursor.current);
  var context = requiredContext(contextStackCursor$1.current);
  var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.

  if (context === nextContext) {
    return;
  } // Track the context and the Fiber that provided it.
  // This enables us to pop only Fibers that provide unique contexts.


  push(contextFiberStackCursor, fiber, fiber);
  push(contextStackCursor$1, nextContext, fiber);
}

function popHostContext(fiber) {
  // Do not pop unless this Fiber provided the current context.
  // pushHostContext() only pushes Fibers that provide unique contexts.
  if (contextFiberStackCursor.current !== fiber) {
    return;
  }

  pop(contextStackCursor$1, fiber);
  pop(contextFiberStackCursor, fiber);
}

var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is
// inherited deeply down the subtree. The upper bits only affect
// this immediate suspense boundary and gets reset each new
// boundary or suspense list.

var SubtreeSuspenseContextMask = 1; // Subtree Flags:
// InvisibleParentSuspenseContext indicates that one of our parent Suspense
// boundaries is not currently showing visible main content.
// Either because it is already showing a fallback or is not mounted at all.
// We can use this to determine if it is desirable to trigger a fallback at
// the parent. If not, then we might need to trigger undesirable boundaries
// and/or suspend the commit to avoid hiding the parent content.

var InvisibleParentSuspenseContext = 1; // Shallow Flags:
// ForceSuspenseFallback can be used by SuspenseList to force newly added
// items into their fallback state during one of the render passes.

var ForceSuspenseFallback = 2;
var suspenseStackCursor = createCursor(DefaultSuspenseContext);
function hasSuspenseContext(parentContext, flag) {
  return (parentContext & flag) !== 0;
}
function setDefaultShallowSuspenseContext(parentContext) {
  return parentContext & SubtreeSuspenseContextMask;
}
function setShallowSuspenseContext(parentContext, shallowContext) {
  return parentContext & SubtreeSuspenseContextMask | shallowContext;
}
function addSubtreeSuspenseContext(parentContext, subtreeContext) {
  return parentContext | subtreeContext;
}
function pushSuspenseContext(fiber, newContext) {
  push(suspenseStackCursor, newContext, fiber);
}
function popSuspenseContext(fiber) {
  pop(suspenseStackCursor, fiber);
}

function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
  // If it was the primary children that just suspended, capture and render the
  // fallback. Otherwise, don't capture and bubble to the next boundary.
  var nextState = workInProgress.memoizedState;

  if (nextState !== null) {
    if (nextState.dehydrated !== null) {
      // A dehydrated boundary always captures.
      return true;
    }

    return false;
  }

  var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.

  if (props.fallback === undefined) {
    return false;
  } // Regular boundaries always capture.


  if (props.unstable_avoidThisFallback !== true) {
    return true;
  } // If it's a boundary we should avoid, then we prefer to bubble up to the
  // parent boundary if it is currently invisible.


  if (hasInvisibleParent) {
    return false;
  } // If the parent is not able to handle it, we must handle it.


  return true;
}
function findFirstSuspended(row) {
  var node = row;

  while (node !== null) {
    if (node.tag === SuspenseComponent) {
      var state = node.memoizedState;

      if (state !== null) {
        var dehydrated = state.dehydrated;

        if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
          return node;
        }
      }
    } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
    // keep track of whether it suspended or not.
    node.memoizedProps.revealOrder !== undefined) {
      var didSuspend = (node.flags & DidCapture) !== NoFlags;

      if (didSuspend) {
        return node;
      }
    } else if (node.child !== null) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === row) {
      return null;
    }

    while (node.sibling === null) {
      if (node.return === null || node.return === row) {
        return null;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  }

  return null;
}

var NoFlags$1 =
/*  */
0; // Represents whether effect should fire.

var HasEffect =
/* */
1; // Represents the phase in which the effect (not the clean-up) fires.

var Layout =
/*    */
2;
var Passive$1 =
/*   */
4;

// This may have been an insertion or a hydration.

var hydrationParentFiber = null;
var nextHydratableInstance = null;
var isHydrating = false;

function enterHydrationState(fiber) {

  var parentInstance = fiber.stateNode.containerInfo;
  nextHydratableInstance = getFirstHydratableChild(parentInstance);
  hydrationParentFiber = fiber;
  isHydrating = true;
  return true;
}

function deleteHydratableInstance(returnFiber, instance) {
  {
    switch (returnFiber.tag) {
      case HostRoot:
        didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
        break;

      case HostComponent:
        didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
        break;
    }
  }

  var childToDelete = createFiberFromHostInstanceForDeletion();
  childToDelete.stateNode = instance;
  childToDelete.return = returnFiber;
  childToDelete.flags = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,
  // these children are not part of the reconciliation list of children.
  // Even if we abort and rereconcile the children, that will try to hydrate
  // again and the nodes are still in the host tree so these will be
  // recreated.

  if (returnFiber.lastEffect !== null) {
    returnFiber.lastEffect.nextEffect = childToDelete;
    returnFiber.lastEffect = childToDelete;
  } else {
    returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
  }
}

function insertNonHydratedInstance(returnFiber, fiber) {
  fiber.flags = fiber.flags & ~Hydrating | Placement;

  {
    switch (returnFiber.tag) {
      case HostRoot:
        {
          var parentContainer = returnFiber.stateNode.containerInfo;

          switch (fiber.tag) {
            case HostComponent:
              var type = fiber.type;
              var props = fiber.pendingProps;
              didNotFindHydratableContainerInstance(parentContainer, type);
              break;

            case HostText:
              var text = fiber.pendingProps;
              didNotFindHydratableContainerTextInstance(parentContainer, text);
              break;
          }

          break;
        }

      case HostComponent:
        {
          var parentType = returnFiber.type;
          var parentProps = returnFiber.memoizedProps;
          var parentInstance = returnFiber.stateNode;

          switch (fiber.tag) {
            case HostComponent:
              var _type = fiber.type;
              var _props = fiber.pendingProps;
              didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);
              break;

            case HostText:
              var _text = fiber.pendingProps;
              didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
              break;

            case SuspenseComponent:
              didNotFindHydratableSuspenseInstance(parentType, parentProps);
              break;
          }

          break;
        }

      default:
        return;
    }
  }
}

function tryHydrate(fiber, nextInstance) {
  switch (fiber.tag) {
    case HostComponent:
      {
        var type = fiber.type;
        var props = fiber.pendingProps;
        var instance = canHydrateInstance(nextInstance, type);

        if (instance !== null) {
          fiber.stateNode = instance;
          return true;
        }

        return false;
      }

    case HostText:
      {
        var text = fiber.pendingProps;
        var textInstance = canHydrateTextInstance(nextInstance, text);

        if (textInstance !== null) {
          fiber.stateNode = textInstance;
          return true;
        }

        return false;
      }

    case SuspenseComponent:
      {

        return false;
      }

    default:
      return false;
  }
}

function tryToClaimNextHydratableInstance(fiber) {
  if (!isHydrating) {
    return;
  }

  var nextInstance = nextHydratableInstance;

  if (!nextInstance) {
    // Nothing to hydrate. Make it an insertion.
    insertNonHydratedInstance(hydrationParentFiber, fiber);
    isHydrating = false;
    hydrationParentFiber = fiber;
    return;
  }

  var firstAttemptedInstance = nextInstance;

  if (!tryHydrate(fiber, nextInstance)) {
    // If we can't hydrate this instance let's try the next one.
    // We use this as a heuristic. It's based on intuition and not data so it
    // might be flawed or unnecessary.
    nextInstance = getNextHydratableSibling(firstAttemptedInstance);

    if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
      // Nothing to hydrate. Make it an insertion.
      insertNonHydratedInstance(hydrationParentFiber, fiber);
      isHydrating = false;
      hydrationParentFiber = fiber;
      return;
    } // We matched the next one, we'll now assume that the first one was
    // superfluous and we'll delete it. Since we can't eagerly delete it
    // we'll have to schedule a deletion. To do that, this node needs a dummy
    // fiber associated with it.


    deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
  }

  hydrationParentFiber = fiber;
  nextHydratableInstance = getFirstHydratableChild(nextInstance);
}

function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {

  var instance = fiber.stateNode;
  var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component.

  fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
  // is a new ref we mark this as an update.

  if (updatePayload !== null) {
    return true;
  }

  return false;
}

function prepareToHydrateHostTextInstance(fiber) {

  var textInstance = fiber.stateNode;
  var textContent = fiber.memoizedProps;
  var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);

  {
    if (shouldUpdate) {
      // We assume that prepareToHydrateHostTextInstance is called in a context where the
      // hydration parent is the parent host component of this host text.
      var returnFiber = hydrationParentFiber;

      if (returnFiber !== null) {
        switch (returnFiber.tag) {
          case HostRoot:
            {
              var parentContainer = returnFiber.stateNode.containerInfo;
              didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
              break;
            }

          case HostComponent:
            {
              var parentType = returnFiber.type;
              var parentProps = returnFiber.memoizedProps;
              var parentInstance = returnFiber.stateNode;
              didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
              break;
            }
        }
      }
    }
  }

  return shouldUpdate;
}

function skipPastDehydratedSuspenseInstance(fiber) {

  var suspenseState = fiber.memoizedState;
  var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;

  if (!suspenseInstance) {
    {
      throw Error( "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." );
    }
  }

  return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
}

function popToNextHostParent(fiber) {
  var parent = fiber.return;

  while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
    parent = parent.return;
  }

  hydrationParentFiber = parent;
}

function popHydrationState(fiber) {

  if (fiber !== hydrationParentFiber) {
    // We're deeper than the current hydration context, inside an inserted
    // tree.
    return false;
  }

  if (!isHydrating) {
    // If we're not currently hydrating but we're in a hydration context, then
    // we were an insertion and now need to pop up reenter hydration of our
    // siblings.
    popToNextHostParent(fiber);
    isHydrating = true;
    return false;
  }

  var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now.
  // We only do this deeper than head and body since they tend to have random
  // other nodes in them. We also ignore components with pure text content in
  // side of them.
  // TODO: Better heuristic.

  if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
    var nextInstance = nextHydratableInstance;

    while (nextInstance) {
      deleteHydratableInstance(fiber, nextInstance);
      nextInstance = getNextHydratableSibling(nextInstance);
    }
  }

  popToNextHostParent(fiber);

  if (fiber.tag === SuspenseComponent) {
    nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
  } else {
    nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
  }

  return true;
}

function resetHydrationState() {

  hydrationParentFiber = null;
  nextHydratableInstance = null;
  isHydrating = false;
}

function getIsHydrating() {
  return isHydrating;
}

// and should be reset before starting a new render.
// This tracks which mutable sources need to be reset after a render.

var workInProgressSources = [];
var rendererSigil$1;

{
  // Used to detect multiple renderers using the same mutable source.
  rendererSigil$1 = {};
}

function markSourceAsDirty(mutableSource) {
  workInProgressSources.push(mutableSource);
}
function resetWorkInProgressVersions() {
  for (var i = 0; i < workInProgressSources.length; i++) {
    var mutableSource = workInProgressSources[i];

    {
      mutableSource._workInProgressVersionPrimary = null;
    }
  }

  workInProgressSources.length = 0;
}
function getWorkInProgressVersion(mutableSource) {
  {
    return mutableSource._workInProgressVersionPrimary;
  }
}
function setWorkInProgressVersion(mutableSource, version) {
  {
    mutableSource._workInProgressVersionPrimary = version;
  }

  workInProgressSources.push(mutableSource);
}
function warnAboutMultipleRenderersDEV(mutableSource) {
  {
    {
      if (mutableSource._currentPrimaryRenderer == null) {
        mutableSource._currentPrimaryRenderer = rendererSigil$1;
      } else if (mutableSource._currentPrimaryRenderer !== rendererSigil$1) {
        error('Detected multiple renderers concurrently rendering the ' + 'same mutable source. This is currently unsupported.');
      }
    }
  }
} // Eager reads the version of a mutable source and stores it on the root.

var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
    ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
var didWarnAboutMismatchedHooksForComponent;
var didWarnAboutUseOpaqueIdentifier;

{
  didWarnAboutUseOpaqueIdentifier = {};
  didWarnAboutMismatchedHooksForComponent = new Set();
}

// These are set right before calling the component.
var renderLanes = NoLanes; // The work-in-progress fiber. I've named it differently to distinguish it from
// the work-in-progress hook.

var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The
// current hook list is the list that belongs to the current fiber. The
// work-in-progress hook list is a new list that will be added to the
// work-in-progress fiber.

var currentHook = null;
var workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This
// does not get reset if we do another render pass; only when we're completely
// finished evaluating this component. This is an optimization so we know
// whether we need to clear render phase updates after a throw.

var didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only during the current render pass. This
// gets reset after each attempt.
// TODO: Maybe there's some way to consolidate this with
// `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`.

var didScheduleRenderPhaseUpdateDuringThisPass = false;
var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook

var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.
// The list stores the order of hooks used during the initial render (mount).
// Subsequent renders (updates) reference this list.

var hookTypesDev = null;
var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore
// the dependencies for Hooks that need them (e.g. useEffect or useMemo).
// When true, such Hooks will always be "remounted". Only used during hot reload.

var ignorePreviousDependencies = false;

function mountHookTypesDev() {
  {
    var hookName = currentHookNameInDev;

    if (hookTypesDev === null) {
      hookTypesDev = [hookName];
    } else {
      hookTypesDev.push(hookName);
    }
  }
}

function updateHookTypesDev() {
  {
    var hookName = currentHookNameInDev;

    if (hookTypesDev !== null) {
      hookTypesUpdateIndexDev++;

      if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
        warnOnHookMismatchInDev(hookName);
      }
    }
  }
}

function checkDepsAreArrayDev(deps) {
  {
    if (deps !== undefined && deps !== null && !Array.isArray(deps)) {
      // Verify deps, but only on mount to avoid extra checks.
      // It's unlikely their type would change as usually you define them inline.
      error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);
    }
  }
}

function warnOnHookMismatchInDev(currentHookName) {
  {
    var componentName = getComponentName(currentlyRenderingFiber$1.type);

    if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
      didWarnAboutMismatchedHooksForComponent.add(componentName);

      if (hookTypesDev !== null) {
        var table = '';
        var secondColumnStart = 30;

        for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
          var oldHookName = hookTypesDev[i];
          var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
          var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up
          // lol @ IE not supporting String#repeat

          while (row.length < secondColumnStart) {
            row += ' ';
          }

          row += newHookName + '\n';
          table += row;
        }

        error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n' + '   Previous render            Next render\n' + '   ------------------------------------------------------\n' + '%s' + '   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
      }
    }
  }
}

function throwInvalidHookError() {
  {
    {
      throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
    }
  }
}

function areHookInputsEqual(nextDeps, prevDeps) {
  {
    if (ignorePreviousDependencies) {
      // Only true when this component is being hot reloaded.
      return false;
    }
  }

  if (prevDeps === null) {
    {
      error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
    }

    return false;
  }

  {
    // Don't bother comparing lengths in prod because these arrays should be
    // passed inline.
    if (nextDeps.length !== prevDeps.length) {
      error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]");
    }
  }

  for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
    if (objectIs(nextDeps[i], prevDeps[i])) {
      continue;
    }

    return false;
  }

  return true;
}

function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) {
  renderLanes = nextRenderLanes;
  currentlyRenderingFiber$1 = workInProgress;

  {
    hookTypesDev = current !== null ? current._debugHookTypes : null;
    hookTypesUpdateIndexDev = -1; // Used for hot reloading:

    ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;
  }

  workInProgress.memoizedState = null;
  workInProgress.updateQueue = null;
  workInProgress.lanes = NoLanes; // The following should have already been reset
  // currentHook = null;
  // workInProgressHook = null;
  // didScheduleRenderPhaseUpdate = false;
  // TODO Warn if no hooks are used at all during mount, then some are used during update.
  // Currently we will identify the update render as a mount because memoizedState === null.
  // This is tricky because it's valid for certain types of components (e.g. React.lazy)
  // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used.
  // Non-stateful hooks (e.g. context) don't get added to memoizedState,
  // so memoizedState would be null during updates and mounts.

  {
    if (current !== null && current.memoizedState !== null) {
      ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
    } else if (hookTypesDev !== null) {
      // This dispatcher handles an edge case where a component is updating,
      // but no stateful hooks have been used.
      // We want to match the production code behavior (which will use HooksDispatcherOnMount),
      // but with the extra DEV validation to ensure hooks ordering hasn't changed.
      // This dispatcher does that.
      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
    } else {
      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
    }
  }

  var children = Component(props, secondArg); // Check if there was a render phase update

  if (didScheduleRenderPhaseUpdateDuringThisPass) {
    // Keep rendering in a loop for as long as render phase updates continue to
    // be scheduled. Use a counter to prevent infinite loops.
    var numberOfReRenders = 0;

    do {
      didScheduleRenderPhaseUpdateDuringThisPass = false;

      if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
        {
          throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." );
        }
      }

      numberOfReRenders += 1;

      {
        // Even when hot reloading, allow dependencies to stabilize
        // after first render to prevent infinite render phase updates.
        ignorePreviousDependencies = false;
      } // Start over from the beginning of the list


      currentHook = null;
      workInProgressHook = null;
      workInProgress.updateQueue = null;

      {
        // Also validate hook order for cascading updates.
        hookTypesUpdateIndexDev = -1;
      }

      ReactCurrentDispatcher$1.current =  HooksDispatcherOnRerenderInDEV ;
      children = Component(props, secondArg);
    } while (didScheduleRenderPhaseUpdateDuringThisPass);
  } // We can assume the previous dispatcher is always this one, since we set it
  // at the beginning of the render phase and there's no re-entrancy.


  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;

  {
    workInProgress._debugHookTypes = hookTypesDev;
  } // This check uses currentHook so that it works the same in DEV and prod bundles.
  // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.


  var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
  renderLanes = NoLanes;
  currentlyRenderingFiber$1 = null;
  currentHook = null;
  workInProgressHook = null;

  {
    currentHookNameInDev = null;
    hookTypesDev = null;
    hookTypesUpdateIndexDev = -1;
  }

  didScheduleRenderPhaseUpdate = false;

  if (!!didRenderTooFewHooks) {
    {
      throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." );
    }
  }

  return children;
}
function bailoutHooks(current, workInProgress, lanes) {
  workInProgress.updateQueue = current.updateQueue;
  workInProgress.flags &= ~(Passive | Update);
  current.lanes = removeLanes(current.lanes, lanes);
}
function resetHooksAfterThrow() {
  // We can assume the previous dispatcher is always this one, since we set it
  // at the beginning of the render phase and there's no re-entrancy.
  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;

  if (didScheduleRenderPhaseUpdate) {
    // There were render phase updates. These are only valid for this render
    // phase, which we are now aborting. Remove the updates from the queues so
    // they do not persist to the next render. Do not remove updates from hooks
    // that weren't processed.
    //
    // Only reset the updates from the queue if it has a clone. If it does
    // not have a clone, that means it wasn't processed, and the updates were
    // scheduled before we entered the render phase.
    var hook = currentlyRenderingFiber$1.memoizedState;

    while (hook !== null) {
      var queue = hook.queue;

      if (queue !== null) {
        queue.pending = null;
      }

      hook = hook.next;
    }

    didScheduleRenderPhaseUpdate = false;
  }

  renderLanes = NoLanes;
  currentlyRenderingFiber$1 = null;
  currentHook = null;
  workInProgressHook = null;

  {
    hookTypesDev = null;
    hookTypesUpdateIndexDev = -1;
    currentHookNameInDev = null;
    isUpdatingOpaqueValueInRenderPhase = false;
  }

  didScheduleRenderPhaseUpdateDuringThisPass = false;
}

function mountWorkInProgressHook() {
  var hook = {
    memoizedState: null,
    baseState: null,
    baseQueue: null,
    queue: null,
    next: null
  };

  if (workInProgressHook === null) {
    // This is the first hook in the list
    currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
  } else {
    // Append to the end of the list
    workInProgressHook = workInProgressHook.next = hook;
  }

  return workInProgressHook;
}

function updateWorkInProgressHook() {
  // This function is used both for updates and for re-renders triggered by a
  // render phase update. It assumes there is either a current hook we can
  // clone, or a work-in-progress hook from a previous render pass that we can
  // use as a base. When we reach the end of the base list, we must switch to
  // the dispatcher used for mounts.
  var nextCurrentHook;

  if (currentHook === null) {
    var current = currentlyRenderingFiber$1.alternate;

    if (current !== null) {
      nextCurrentHook = current.memoizedState;
    } else {
      nextCurrentHook = null;
    }
  } else {
    nextCurrentHook = currentHook.next;
  }

  var nextWorkInProgressHook;

  if (workInProgressHook === null) {
    nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
  } else {
    nextWorkInProgressHook = workInProgressHook.next;
  }

  if (nextWorkInProgressHook !== null) {
    // There's already a work-in-progress. Reuse it.
    workInProgressHook = nextWorkInProgressHook;
    nextWorkInProgressHook = workInProgressHook.next;
    currentHook = nextCurrentHook;
  } else {
    // Clone from the current hook.
    if (!(nextCurrentHook !== null)) {
      {
        throw Error( "Rendered more hooks than during the previous render." );
      }
    }

    currentHook = nextCurrentHook;
    var newHook = {
      memoizedState: currentHook.memoizedState,
      baseState: currentHook.baseState,
      baseQueue: currentHook.baseQueue,
      queue: currentHook.queue,
      next: null
    };

    if (workInProgressHook === null) {
      // This is the first hook in the list.
      currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
    } else {
      // Append to the end of the list.
      workInProgressHook = workInProgressHook.next = newHook;
    }
  }

  return workInProgressHook;
}

function createFunctionComponentUpdateQueue() {
  return {
    lastEffect: null
  };
}

function basicStateReducer(state, action) {
  // $FlowFixMe: Flow doesn't like mixed types
  return typeof action === 'function' ? action(state) : action;
}

function mountReducer(reducer, initialArg, init) {
  var hook = mountWorkInProgressHook();
  var initialState;

  if (init !== undefined) {
    initialState = init(initialArg);
  } else {
    initialState = initialArg;
  }

  hook.memoizedState = hook.baseState = initialState;
  var queue = hook.queue = {
    pending: null,
    dispatch: null,
    lastRenderedReducer: reducer,
    lastRenderedState: initialState
  };
  var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
  return [hook.memoizedState, dispatch];
}

function updateReducer(reducer, initialArg, init) {
  var hook = updateWorkInProgressHook();
  var queue = hook.queue;

  if (!(queue !== null)) {
    {
      throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." );
    }
  }

  queue.lastRenderedReducer = reducer;
  var current = currentHook; // The last rebase update that is NOT part of the base state.

  var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet.

  var pendingQueue = queue.pending;

  if (pendingQueue !== null) {
    // We have new updates that haven't been processed yet.
    // We'll add them to the base queue.
    if (baseQueue !== null) {
      // Merge the pending queue and the base queue.
      var baseFirst = baseQueue.next;
      var pendingFirst = pendingQueue.next;
      baseQueue.next = pendingFirst;
      pendingQueue.next = baseFirst;
    }

    {
      if (current.baseQueue !== baseQueue) {
        // Internal invariant that should never happen, but feasibly could in
        // the future if we implement resuming, or some form of that.
        error('Internal error: Expected work-in-progress queue to be a clone. ' + 'This is a bug in React.');
      }
    }

    current.baseQueue = baseQueue = pendingQueue;
    queue.pending = null;
  }

  if (baseQueue !== null) {
    // We have a queue to process.
    var first = baseQueue.next;
    var newState = current.baseState;
    var newBaseState = null;
    var newBaseQueueFirst = null;
    var newBaseQueueLast = null;
    var update = first;

    do {
      var updateLane = update.lane;

      if (!isSubsetOfLanes(renderLanes, updateLane)) {
        // Priority is insufficient. Skip this update. If this is the first
        // skipped update, the previous update/state is the new base
        // update/state.
        var clone = {
          lane: updateLane,
          action: update.action,
          eagerReducer: update.eagerReducer,
          eagerState: update.eagerState,
          next: null
        };

        if (newBaseQueueLast === null) {
          newBaseQueueFirst = newBaseQueueLast = clone;
          newBaseState = newState;
        } else {
          newBaseQueueLast = newBaseQueueLast.next = clone;
        } // Update the remaining priority in the queue.
        // TODO: Don't need to accumulate this. Instead, we can remove
        // renderLanes from the original lanes.


        currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
        markSkippedUpdateLanes(updateLane);
      } else {
        // This update does have sufficient priority.
        if (newBaseQueueLast !== null) {
          var _clone = {
            // This update is going to be committed so we never want uncommit
            // it. Using NoLane works because 0 is a subset of all bitmasks, so
            // this will never be skipped by the check above.
            lane: NoLane,
            action: update.action,
            eagerReducer: update.eagerReducer,
            eagerState: update.eagerState,
            next: null
          };
          newBaseQueueLast = newBaseQueueLast.next = _clone;
        } // Process this update.


        if (update.eagerReducer === reducer) {
          // If this update was processed eagerly, and its reducer matches the
          // current reducer, we can use the eagerly computed state.
          newState = update.eagerState;
        } else {
          var action = update.action;
          newState = reducer(newState, action);
        }
      }

      update = update.next;
    } while (update !== null && update !== first);

    if (newBaseQueueLast === null) {
      newBaseState = newState;
    } else {
      newBaseQueueLast.next = newBaseQueueFirst;
    } // Mark that the fiber performed work, but only if the new state is
    // different from the current state.


    if (!objectIs(newState, hook.memoizedState)) {
      markWorkInProgressReceivedUpdate();
    }

    hook.memoizedState = newState;
    hook.baseState = newBaseState;
    hook.baseQueue = newBaseQueueLast;
    queue.lastRenderedState = newState;
  }

  var dispatch = queue.dispatch;
  return [hook.memoizedState, dispatch];
}

function rerenderReducer(reducer, initialArg, init) {
  var hook = updateWorkInProgressHook();
  var queue = hook.queue;

  if (!(queue !== null)) {
    {
      throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." );
    }
  }

  queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous
  // work-in-progress hook.

  var dispatch = queue.dispatch;
  var lastRenderPhaseUpdate = queue.pending;
  var newState = hook.memoizedState;

  if (lastRenderPhaseUpdate !== null) {
    // The queue doesn't persist past this render pass.
    queue.pending = null;
    var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
    var update = firstRenderPhaseUpdate;

    do {
      // Process this render phase update. We don't have to check the
      // priority because it will always be the same as the current
      // render's.
      var action = update.action;
      newState = reducer(newState, action);
      update = update.next;
    } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is
    // different from the current state.


    if (!objectIs(newState, hook.memoizedState)) {
      markWorkInProgressReceivedUpdate();
    }

    hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to
    // the base state unless the queue is empty.
    // TODO: Not sure if this is the desired semantics, but it's what we
    // do for gDSFP. I can't remember why.

    if (hook.baseQueue === null) {
      hook.baseState = newState;
    }

    queue.lastRenderedState = newState;
  }

  return [newState, dispatch];
}

function readFromUnsubcribedMutableSource(root, source, getSnapshot) {
  {
    warnAboutMultipleRenderersDEV(source);
  }

  var getVersion = source._getVersion;
  var version = getVersion(source._source); // Is it safe for this component to read from this source during the current render?

  var isSafeToReadFromSource = false; // Check the version first.
  // If this render has already been started with a specific version,
  // we can use it alone to determine if we can safely read from the source.

  var currentRenderVersion = getWorkInProgressVersion(source);

  if (currentRenderVersion !== null) {
    // It's safe to read if the store hasn't been mutated since the last time
    // we read something.
    isSafeToReadFromSource = currentRenderVersion === version;
  } else {
    // If there's no version, then this is the first time we've read from the
    // source during the current render pass, so we need to do a bit more work.
    // What we need to determine is if there are any hooks that already
    // subscribed to the source, and if so, whether there are any pending
    // mutations that haven't been synchronized yet.
    //
    // If there are no pending mutations, then `root.mutableReadLanes` will be
    // empty, and we know we can safely read.
    //
    // If there *are* pending mutations, we may still be able to safely read
    // if the currently rendering lanes are inclusive of the pending mutation
    // lanes, since that guarantees that the value we're about to read from
    // the source is consistent with the values that we read during the most
    // recent mutation.
    isSafeToReadFromSource = isSubsetOfLanes(renderLanes, root.mutableReadLanes);

    if (isSafeToReadFromSource) {
      // If it's safe to read from this source during the current render,
      // store the version in case other components read from it.
      // A changed version number will let those components know to throw and restart the render.
      setWorkInProgressVersion(source, version);
    }
  }

  if (isSafeToReadFromSource) {
    var snapshot = getSnapshot(source._source);

    {
      if (typeof snapshot === 'function') {
        error('Mutable source should not return a function as the snapshot value. ' + 'Functions may close over mutable values and cause tearing.');
      }
    }

    return snapshot;
  } else {
    // This handles the special case of a mutable source being shared between renderers.
    // In that case, if the source is mutated between the first and second renderer,
    // The second renderer don't know that it needs to reset the WIP version during unwind,
    // (because the hook only marks sources as dirty if it's written to their WIP version).
    // That would cause this tear check to throw again and eventually be visible to the user.
    // We can avoid this infinite loop by explicitly marking the source as dirty.
    //
    // This can lead to tearing in the first renderer when it resumes,
    // but there's nothing we can do about that (short of throwing here and refusing to continue the render).
    markSourceAsDirty(source);

    {
      {
        throw Error( "Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue." );
      }
    }
  }
}

function useMutableSource(hook, source, getSnapshot, subscribe) {
  var root = getWorkInProgressRoot();

  if (!(root !== null)) {
    {
      throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." );
    }
  }

  var getVersion = source._getVersion;
  var version = getVersion(source._source);
  var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const

  var _dispatcher$useState = dispatcher.useState(function () {
    return readFromUnsubcribedMutableSource(root, source, getSnapshot);
  }),
      currentSnapshot = _dispatcher$useState[0],
      setSnapshot = _dispatcher$useState[1];

  var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
  // We use it to clear the pending update queue if we have a new source.

  var stateHook = workInProgressHook;
  var memoizedState = hook.memoizedState;
  var refs = memoizedState.refs;
  var prevGetSnapshot = refs.getSnapshot;
  var prevSource = memoizedState.source;
  var prevSubscribe = memoizedState.subscribe;
  var fiber = currentlyRenderingFiber$1;
  hook.memoizedState = {
    refs: refs,
    source: source,
    subscribe: subscribe
  }; // Sync the values needed by our subscription handler after each commit.

  dispatcher.useEffect(function () {
    refs.getSnapshot = getSnapshot; // Normally the dispatch function for a state hook never changes,
    // but this hook recreates the queue in certain cases  to avoid updates from stale sources.
    // handleChange() below needs to reference the dispatch function without re-subscribing,
    // so we use a ref to ensure that it always has the latest version.

    refs.setSnapshot = setSnapshot; // Check for a possible change between when we last rendered now.

    var maybeNewVersion = getVersion(source._source);

    if (!objectIs(version, maybeNewVersion)) {
      var maybeNewSnapshot = getSnapshot(source._source);

      {
        if (typeof maybeNewSnapshot === 'function') {
          error('Mutable source should not return a function as the snapshot value. ' + 'Functions may close over mutable values and cause tearing.');
        }
      }

      if (!objectIs(snapshot, maybeNewSnapshot)) {
        setSnapshot(maybeNewSnapshot);
        var lane = requestUpdateLane(fiber);
        markRootMutableRead(root, lane);
      } // If the source mutated between render and now,
      // there may be state updates already scheduled from the old source.
      // Entangle the updates so that they render in the same batch.


      markRootEntangled(root, root.mutableReadLanes);
    }
  }, [getSnapshot, source, subscribe]); // If we got a new source or subscribe function, re-subscribe in a passive effect.

  dispatcher.useEffect(function () {
    var handleChange = function () {
      var latestGetSnapshot = refs.getSnapshot;
      var latestSetSnapshot = refs.setSnapshot;

      try {
        latestSetSnapshot(latestGetSnapshot(source._source)); // Record a pending mutable source update with the same expiration time.

        var lane = requestUpdateLane(fiber);
        markRootMutableRead(root, lane);
      } catch (error) {
        // A selector might throw after a source mutation.
        // e.g. it might try to read from a part of the store that no longer exists.
        // In this case we should still schedule an update with React.
        // Worst case the selector will throw again and then an error boundary will handle it.
        latestSetSnapshot(function () {
          throw error;
        });
      }
    };

    var unsubscribe = subscribe(source._source, handleChange);

    {
      if (typeof unsubscribe !== 'function') {
        error('Mutable source subscribe function must return an unsubscribe function.');
      }
    }

    return unsubscribe;
  }, [source, subscribe]); // If any of the inputs to useMutableSource change, reading is potentially unsafe.
  //
  // If either the source or the subscription have changed we can't can't trust the update queue.
  // Maybe the source changed in a way that the old subscription ignored but the new one depends on.
  //
  // If the getSnapshot function changed, we also shouldn't rely on the update queue.
  // It's possible that the underlying source was mutated between the when the last "change" event fired,
  // and when the current render (with the new getSnapshot function) is processed.
  //
  // In both cases, we need to throw away pending updates (since they are no longer relevant)
  // and treat reading from the source as we do in the mount case.

  if (!objectIs(prevGetSnapshot, getSnapshot) || !objectIs(prevSource, source) || !objectIs(prevSubscribe, subscribe)) {
    // Create a new queue and setState method,
    // So if there are interleaved updates, they get pushed to the older queue.
    // When this becomes current, the previous queue and dispatch method will be discarded,
    // including any interleaving updates that occur.
    var newQueue = {
      pending: null,
      dispatch: null,
      lastRenderedReducer: basicStateReducer,
      lastRenderedState: snapshot
    };
    newQueue.dispatch = setSnapshot = dispatchAction.bind(null, currentlyRenderingFiber$1, newQueue);
    stateHook.queue = newQueue;
    stateHook.baseQueue = null;
    snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot);
    stateHook.memoizedState = stateHook.baseState = snapshot;
  }

  return snapshot;
}

function mountMutableSource(source, getSnapshot, subscribe) {
  var hook = mountWorkInProgressHook();
  hook.memoizedState = {
    refs: {
      getSnapshot: getSnapshot,
      setSnapshot: null
    },
    source: source,
    subscribe: subscribe
  };
  return useMutableSource(hook, source, getSnapshot, subscribe);
}

function updateMutableSource(source, getSnapshot, subscribe) {
  var hook = updateWorkInProgressHook();
  return useMutableSource(hook, source, getSnapshot, subscribe);
}

function mountState(initialState) {
  var hook = mountWorkInProgressHook();

  if (typeof initialState === 'function') {
    // $FlowFixMe: Flow doesn't like mixed types
    initialState = initialState();
  }

  hook.memoizedState = hook.baseState = initialState;
  var queue = hook.queue = {
    pending: null,
    dispatch: null,
    lastRenderedReducer: basicStateReducer,
    lastRenderedState: initialState
  };
  var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
  return [hook.memoizedState, dispatch];
}

function updateState(initialState) {
  return updateReducer(basicStateReducer);
}

function rerenderState(initialState) {
  return rerenderReducer(basicStateReducer);
}

function pushEffect(tag, create, destroy, deps) {
  var effect = {
    tag: tag,
    create: create,
    destroy: destroy,
    deps: deps,
    // Circular
    next: null
  };
  var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;

  if (componentUpdateQueue === null) {
    componentUpdateQueue = createFunctionComponentUpdateQueue();
    currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
    componentUpdateQueue.lastEffect = effect.next = effect;
  } else {
    var lastEffect = componentUpdateQueue.lastEffect;

    if (lastEffect === null) {
      componentUpdateQueue.lastEffect = effect.next = effect;
    } else {
      var firstEffect = lastEffect.next;
      lastEffect.next = effect;
      effect.next = firstEffect;
      componentUpdateQueue.lastEffect = effect;
    }
  }

  return effect;
}

function mountRef(initialValue) {
  var hook = mountWorkInProgressHook();
  var ref = {
    current: initialValue
  };

  {
    Object.seal(ref);
  }

  hook.memoizedState = ref;
  return ref;
}

function updateRef(initialValue) {
  var hook = updateWorkInProgressHook();
  return hook.memoizedState;
}

function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  currentlyRenderingFiber$1.flags |= fiberFlags;
  hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps);
}

function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var destroy = undefined;

  if (currentHook !== null) {
    var prevEffect = currentHook.memoizedState;
    destroy = prevEffect.destroy;

    if (nextDeps !== null) {
      var prevDeps = prevEffect.deps;

      if (areHookInputsEqual(nextDeps, prevDeps)) {
        pushEffect(hookFlags, create, destroy, nextDeps);
        return;
      }
    }
  }

  currentlyRenderingFiber$1.flags |= fiberFlags;
  hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
}

function mountEffect(create, deps) {
  {
    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
    if ('undefined' !== typeof jest) {
      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
    }
  }

  return mountEffectImpl(Update | Passive, Passive$1, create, deps);
}

function updateEffect(create, deps) {
  {
    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
    if ('undefined' !== typeof jest) {
      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
    }
  }

  return updateEffectImpl(Update | Passive, Passive$1, create, deps);
}

function mountLayoutEffect(create, deps) {
  return mountEffectImpl(Update, Layout, create, deps);
}

function updateLayoutEffect(create, deps) {
  return updateEffectImpl(Update, Layout, create, deps);
}

function imperativeHandleEffect(create, ref) {
  if (typeof ref === 'function') {
    var refCallback = ref;

    var _inst = create();

    refCallback(_inst);
    return function () {
      refCallback(null);
    };
  } else if (ref !== null && ref !== undefined) {
    var refObject = ref;

    {
      if (!refObject.hasOwnProperty('current')) {
        error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');
      }
    }

    var _inst2 = create();

    refObject.current = _inst2;
    return function () {
      refObject.current = null;
    };
  }
}

function mountImperativeHandle(ref, create, deps) {
  {
    if (typeof create !== 'function') {
      error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
    }
  } // TODO: If deps are provided, should we skip comparing the ref itself?


  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
  return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
}

function updateImperativeHandle(ref, create, deps) {
  {
    if (typeof create !== 'function') {
      error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
    }
  } // TODO: If deps are provided, should we skip comparing the ref itself?


  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
  return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
}

function mountDebugValue(value, formatterFn) {// This hook is normally a no-op.
  // The react-debug-hooks package injects its own implementation
  // so that e.g. DevTools can display custom hook values.
}

var updateDebugValue = mountDebugValue;

function mountCallback(callback, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  hook.memoizedState = [callback, nextDeps];
  return callback;
}

function updateCallback(callback, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var prevState = hook.memoizedState;

  if (prevState !== null) {
    if (nextDeps !== null) {
      var prevDeps = prevState[1];

      if (areHookInputsEqual(nextDeps, prevDeps)) {
        return prevState[0];
      }
    }
  }

  hook.memoizedState = [callback, nextDeps];
  return callback;
}

function mountMemo(nextCreate, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var nextValue = nextCreate();
  hook.memoizedState = [nextValue, nextDeps];
  return nextValue;
}

function updateMemo(nextCreate, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var prevState = hook.memoizedState;

  if (prevState !== null) {
    // Assume these are defined. If they're not, areHookInputsEqual will warn.
    if (nextDeps !== null) {
      var prevDeps = prevState[1];

      if (areHookInputsEqual(nextDeps, prevDeps)) {
        return prevState[0];
      }
    }
  }

  var nextValue = nextCreate();
  hook.memoizedState = [nextValue, nextDeps];
  return nextValue;
}

function mountDeferredValue(value) {
  var _mountState = mountState(value),
      prevValue = _mountState[0],
      setValue = _mountState[1];

  mountEffect(function () {
    var prevTransition = ReactCurrentBatchConfig$1.transition;
    ReactCurrentBatchConfig$1.transition = 1;

    try {
      setValue(value);
    } finally {
      ReactCurrentBatchConfig$1.transition = prevTransition;
    }
  }, [value]);
  return prevValue;
}

function updateDeferredValue(value) {
  var _updateState = updateState(),
      prevValue = _updateState[0],
      setValue = _updateState[1];

  updateEffect(function () {
    var prevTransition = ReactCurrentBatchConfig$1.transition;
    ReactCurrentBatchConfig$1.transition = 1;

    try {
      setValue(value);
    } finally {
      ReactCurrentBatchConfig$1.transition = prevTransition;
    }
  }, [value]);
  return prevValue;
}

function rerenderDeferredValue(value) {
  var _rerenderState = rerenderState(),
      prevValue = _rerenderState[0],
      setValue = _rerenderState[1];

  updateEffect(function () {
    var prevTransition = ReactCurrentBatchConfig$1.transition;
    ReactCurrentBatchConfig$1.transition = 1;

    try {
      setValue(value);
    } finally {
      ReactCurrentBatchConfig$1.transition = prevTransition;
    }
  }, [value]);
  return prevValue;
}

function startTransition(setPending, callback) {
  var priorityLevel = getCurrentPriorityLevel();

  {
    runWithPriority$1(priorityLevel < UserBlockingPriority$2 ? UserBlockingPriority$2 : priorityLevel, function () {
      setPending(true);
    });
    runWithPriority$1(priorityLevel > NormalPriority$1 ? NormalPriority$1 : priorityLevel, function () {
      var prevTransition = ReactCurrentBatchConfig$1.transition;
      ReactCurrentBatchConfig$1.transition = 1;

      try {
        setPending(false);
        callback();
      } finally {
        ReactCurrentBatchConfig$1.transition = prevTransition;
      }
    });
  }
}

function mountTransition() {
  var _mountState2 = mountState(false),
      isPending = _mountState2[0],
      setPending = _mountState2[1]; // The `start` method can be stored on a ref, since `setPending`
  // never changes.


  var start = startTransition.bind(null, setPending);
  mountRef(start);
  return [start, isPending];
}

function updateTransition() {
  var _updateState2 = updateState(),
      isPending = _updateState2[0];

  var startRef = updateRef();
  var start = startRef.current;
  return [start, isPending];
}

function rerenderTransition() {
  var _rerenderState2 = rerenderState(),
      isPending = _rerenderState2[0];

  var startRef = updateRef();
  var start = startRef.current;
  return [start, isPending];
}

var isUpdatingOpaqueValueInRenderPhase = false;
function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
  {
    return isUpdatingOpaqueValueInRenderPhase;
  }
}

function warnOnOpaqueIdentifierAccessInDEV(fiber) {
  {
    // TODO: Should warn in effects and callbacks, too
    var name = getComponentName(fiber.type) || 'Unknown';

    if (getIsRendering() && !didWarnAboutUseOpaqueIdentifier[name]) {
      error('The object passed back from useOpaqueIdentifier is meant to be ' + 'passed through to attributes only. Do not read the ' + 'value directly.');

      didWarnAboutUseOpaqueIdentifier[name] = true;
    }
  }
}

function mountOpaqueIdentifier() {
  var makeId =  makeClientIdInDEV.bind(null, warnOnOpaqueIdentifierAccessInDEV.bind(null, currentlyRenderingFiber$1)) ;

  if (getIsHydrating()) {
    var didUpgrade = false;
    var fiber = currentlyRenderingFiber$1;

    var readValue = function () {
      if (!didUpgrade) {
        // Only upgrade once. This works even inside the render phase because
        // the update is added to a shared queue, which outlasts the
        // in-progress render.
        didUpgrade = true;

        {
          isUpdatingOpaqueValueInRenderPhase = true;
          setId(makeId());
          isUpdatingOpaqueValueInRenderPhase = false;
          warnOnOpaqueIdentifierAccessInDEV(fiber);
        }
      }

      {
        {
          throw Error( "The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly." );
        }
      }
    };

    var id = makeOpaqueHydratingObject(readValue);
    var setId = mountState(id)[1];

    if ((currentlyRenderingFiber$1.mode & BlockingMode) === NoMode) {
      currentlyRenderingFiber$1.flags |= Update | Passive;
      pushEffect(HasEffect | Passive$1, function () {
        setId(makeId());
      }, undefined, null);
    }

    return id;
  } else {
    var _id = makeId();

    mountState(_id);
    return _id;
  }
}

function updateOpaqueIdentifier() {
  var id = updateState()[0];
  return id;
}

function rerenderOpaqueIdentifier() {
  var id = rerenderState()[0];
  return id;
}

function dispatchAction(fiber, queue, action) {
  {
    if (typeof arguments[3] === 'function') {
      error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');
    }
  }

  var eventTime = requestEventTime();
  var lane = requestUpdateLane(fiber);
  var update = {
    lane: lane,
    action: action,
    eagerReducer: null,
    eagerState: null,
    next: null
  }; // Append the update to the end of the list.

  var pending = queue.pending;

  if (pending === null) {
    // This is the first update. Create a circular list.
    update.next = update;
  } else {
    update.next = pending.next;
    pending.next = update;
  }

  queue.pending = update;
  var alternate = fiber.alternate;

  if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
    // This is a render phase update. Stash it in a lazily-created map of
    // queue -> linked list of updates. After this render pass, we'll restart
    // and apply the stashed updates on top of the work-in-progress hook.
    didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
  } else {
    if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
      // The queue is currently empty, which means we can eagerly compute the
      // next state before entering the render phase. If the new state is the
      // same as the current state, we may be able to bail out entirely.
      var lastRenderedReducer = queue.lastRenderedReducer;

      if (lastRenderedReducer !== null) {
        var prevDispatcher;

        {
          prevDispatcher = ReactCurrentDispatcher$1.current;
          ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
        }

        try {
          var currentState = queue.lastRenderedState;
          var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute
          // it, on the update object. If the reducer hasn't changed by the
          // time we enter the render phase, then the eager state can be used
          // without calling the reducer again.

          update.eagerReducer = lastRenderedReducer;
          update.eagerState = eagerState;

          if (objectIs(eagerState, currentState)) {
            // Fast path. We can bail out without scheduling React to re-render.
            // It's still possible that we'll need to rebase this update later,
            // if the component re-renders for a different reason and by that
            // time the reducer has changed.
            return;
          }
        } catch (error) {// Suppress the error. It will throw again in the render phase.
        } finally {
          {
            ReactCurrentDispatcher$1.current = prevDispatcher;
          }
        }
      }
    }

    {
      // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
      if ('undefined' !== typeof jest) {
        warnIfNotScopedWithMatchingAct(fiber);
        warnIfNotCurrentlyActingUpdatesInDev(fiber);
      }
    }

    scheduleUpdateOnFiber(fiber, lane, eventTime);
  }
}

var ContextOnlyDispatcher = {
  readContext: readContext,
  useCallback: throwInvalidHookError,
  useContext: throwInvalidHookError,
  useEffect: throwInvalidHookError,
  useImperativeHandle: throwInvalidHookError,
  useLayoutEffect: throwInvalidHookError,
  useMemo: throwInvalidHookError,
  useReducer: throwInvalidHookError,
  useRef: throwInvalidHookError,
  useState: throwInvalidHookError,
  useDebugValue: throwInvalidHookError,
  useDeferredValue: throwInvalidHookError,
  useTransition: throwInvalidHookError,
  useMutableSource: throwInvalidHookError,
  useOpaqueIdentifier: throwInvalidHookError,
  unstable_isNewReconciler: enableNewReconciler
};
var HooksDispatcherOnMountInDEV = null;
var HooksDispatcherOnMountWithHookTypesInDEV = null;
var HooksDispatcherOnUpdateInDEV = null;
var HooksDispatcherOnRerenderInDEV = null;
var InvalidNestedHooksDispatcherOnMountInDEV = null;
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
var InvalidNestedHooksDispatcherOnRerenderInDEV = null;

{
  var warnInvalidContextAccess = function () {
    error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
  };

  var warnInvalidHookAccess = function () {
    error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://reactjs.org/link/rules-of-hooks');
  };

  HooksDispatcherOnMountInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      mountHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      mountHookTypesDev();
      checkDepsAreArrayDev(deps);
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      mountHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      mountHookTypesDev();
      return mountDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      mountHookTypesDev();
      return mountDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      mountHookTypesDev();
      return mountTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      mountHookTypesDev();
      return mountMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      mountHookTypesDev();
      return mountOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  HooksDispatcherOnMountWithHookTypesInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return mountDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      updateHookTypesDev();
      return mountDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      updateHookTypesDev();
      return mountTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      updateHookTypesDev();
      return mountMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      updateHookTypesDev();
      return mountOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  HooksDispatcherOnUpdateInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return updateRef();
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return updateDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      updateHookTypesDev();
      return updateDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      updateHookTypesDev();
      return updateTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      updateHookTypesDev();
      return updateMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      updateHookTypesDev();
      return updateOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  HooksDispatcherOnRerenderInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;

      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;

      try {
        return rerenderReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return updateRef();
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;

      try {
        return rerenderState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return updateDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      updateHookTypesDev();
      return rerenderDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      updateHookTypesDev();
      return rerenderTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      updateHookTypesDev();
      return updateMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      updateHookTypesDev();
      return rerenderOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  InvalidNestedHooksDispatcherOnMountInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;

      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  InvalidNestedHooksDispatcherOnUpdateInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateRef();
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
  InvalidNestedHooksDispatcherOnRerenderInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return rerenderReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateRef();
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;

      try {
        return rerenderState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateDebugValue();
    },
    useDeferredValue: function (value) {
      currentHookNameInDev = 'useDeferredValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return rerenderDeferredValue(value);
    },
    useTransition: function () {
      currentHookNameInDev = 'useTransition';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return rerenderTransition();
    },
    useMutableSource: function (source, getSnapshot, subscribe) {
      currentHookNameInDev = 'useMutableSource';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateMutableSource(source, getSnapshot, subscribe);
    },
    useOpaqueIdentifier: function () {
      currentHookNameInDev = 'useOpaqueIdentifier';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return rerenderOpaqueIdentifier();
    },
    unstable_isNewReconciler: enableNewReconciler
  };
}

var now$1 = Scheduler.unstable_now;
var commitTime = 0;
var profilerStartTime = -1;

function getCommitTime() {
  return commitTime;
}

function recordCommitTime() {

  commitTime = now$1();
}

function startProfilerTimer(fiber) {

  profilerStartTime = now$1();

  if (fiber.actualStartTime < 0) {
    fiber.actualStartTime = now$1();
  }
}

function stopProfilerTimerIfRunning(fiber) {

  profilerStartTime = -1;
}

function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {

  if (profilerStartTime >= 0) {
    var elapsedTime = now$1() - profilerStartTime;
    fiber.actualDuration += elapsedTime;

    if (overrideBaseTime) {
      fiber.selfBaseDuration = elapsedTime;
    }

    profilerStartTime = -1;
  }
}

function transferActualDuration(fiber) {
  // Transfer time spent rendering these children so we don't lose it
  // after we rerender. This is used as a helper in special cases
  // where we should count the work of multiple passes.
  var child = fiber.child;

  while (child) {
    fiber.actualDuration += child.actualDuration;
    child = child.sibling;
  }
}

var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
var didReceiveUpdate = false;
var didWarnAboutBadClass;
var didWarnAboutModulePatternComponent;
var didWarnAboutContextTypeOnFunctionComponent;
var didWarnAboutGetDerivedStateOnFunctionComponent;
var didWarnAboutFunctionRefs;
var didWarnAboutReassigningProps;
var didWarnAboutRevealOrder;
var didWarnAboutTailOptions;

{
  didWarnAboutBadClass = {};
  didWarnAboutModulePatternComponent = {};
  didWarnAboutContextTypeOnFunctionComponent = {};
  didWarnAboutGetDerivedStateOnFunctionComponent = {};
  didWarnAboutFunctionRefs = {};
  didWarnAboutReassigningProps = false;
  didWarnAboutRevealOrder = {};
  didWarnAboutTailOptions = {};
}

function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
  if (current === null) {
    // If this is a fresh new component that hasn't been rendered yet, we
    // won't update its child set by applying minimal side-effects. Instead,
    // we will add them all to the child before it gets rendered. That means
    // we can optimize this reconciliation pass by not tracking side-effects.
    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);
  } else {
    // If the current child is the same as the work in progress, it means that
    // we haven't yet started any work on these children. Therefore, we use
    // the clone algorithm to create a copy of all the current children.
    // If we had any progressed work already, that is invalid at this point so
    // let's throw it out.
    workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes);
  }
}

function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) {
  // This function is fork of reconcileChildren. It's used in cases where we
  // want to reconcile without matching against the existing set. This has the
  // effect of all current children being unmounted; even if the type and key
  // are the same, the old child is unmounted and a new child is created.
  //
  // To do this, we're going to go through the reconcile algorithm twice. In
  // the first pass, we schedule a deletion for all the current children by
  // passing null.
  workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); // In the second pass, we mount the new children. The trick here is that we
  // pass null in place of where we usually pass the current child set. This has
  // the effect of remounting all children regardless of whether their
  // identities match.

  workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);
}

function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) {
  // TODO: current can be non-null here even if the component
  // hasn't yet mounted. This happens after the first render suspends.
  // We'll need to figure out if this is fine or can cause issues.
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;

      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component));
      }
    }
  }

  var render = Component.render;
  var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent

  var nextChildren;
  prepareToReadContext(workInProgress, renderLanes);

  {
    ReactCurrentOwner$1.current = workInProgress;
    setIsRendering(true);
    nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);

    if ( workInProgress.mode & StrictMode) {
      disableLogs();

      try {
        nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);
      } finally {
        reenableLogs();
      }
    }

    setIsRendering(false);
  }

  if (current !== null && !didReceiveUpdate) {
    bailoutHooks(current, workInProgress, renderLanes);
    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) {
  if (current === null) {
    var type = Component.type;

    if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
    Component.defaultProps === undefined) {
      var resolvedType = type;

      {
        resolvedType = resolveFunctionForHotReloading(type);
      } // If this is a plain function component without default props,
      // and with only the default shallow comparison, we upgrade it
      // to a SimpleMemoComponent to allow fast path updates.


      workInProgress.tag = SimpleMemoComponent;
      workInProgress.type = resolvedType;

      {
        validateFunctionComponentInDev(workInProgress, type);
      }

      return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateLanes, renderLanes);
    }

    {
      var innerPropTypes = type.propTypes;

      if (innerPropTypes) {
        // Inner memo component props aren't currently validated in createElement.
        // We could move it there, but we'd still need this for lazy code path.
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(type));
      }
    }

    var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes);
    child.ref = workInProgress.ref;
    child.return = workInProgress;
    workInProgress.child = child;
    return child;
  }

  {
    var _type = Component.type;
    var _innerPropTypes = _type.propTypes;

    if (_innerPropTypes) {
      // Inner memo component props aren't currently validated in createElement.
      // We could move it there, but we'd still need this for lazy code path.
      checkPropTypes(_innerPropTypes, nextProps, // Resolved props
      'prop', getComponentName(_type));
    }
  }

  var currentChild = current.child; // This is always exactly one child

  if (!includesSomeLane(updateLanes, renderLanes)) {
    // This will be the props with resolved defaultProps,
    // unlike current.memoizedProps which will be the unresolved ones.
    var prevProps = currentChild.memoizedProps; // Default to shallow comparison

    var compare = Component.compare;
    compare = compare !== null ? compare : shallowEqual;

    if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {
      return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
    }
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;
  var newChild = createWorkInProgress(currentChild, nextProps);
  newChild.ref = workInProgress.ref;
  newChild.return = workInProgress;
  workInProgress.child = newChild;
  return newChild;
}

function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) {
  // TODO: current can be non-null here even if the component
  // hasn't yet mounted. This happens when the inner render suspends.
  // We'll need to figure out if this is fine or can cause issues.
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var outerMemoType = workInProgress.elementType;

      if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
        // We warn when you define propTypes on lazy()
        // so let's just skip over it to find memo() outer wrapper.
        // Inner props for memo are validated later.
        var lazyComponent = outerMemoType;
        var payload = lazyComponent._payload;
        var init = lazyComponent._init;

        try {
          outerMemoType = init(payload);
        } catch (x) {
          outerMemoType = null;
        } // Inner propTypes will be validated in the function component path.


        var outerPropTypes = outerMemoType && outerMemoType.propTypes;

        if (outerPropTypes) {
          checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)
          'prop', getComponentName(outerMemoType));
        }
      }
    }
  }

  if (current !== null) {
    var prevProps = current.memoizedProps;

    if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload.
     workInProgress.type === current.type )) {
      didReceiveUpdate = false;

      if (!includesSomeLane(renderLanes, updateLanes)) {
        // The pending lanes were cleared at the beginning of beginWork. We're
        // about to bail out, but there might be other lanes that weren't
        // included in the current render. Usually, the priority level of the
        // remaining updates is accumlated during the evaluation of the
        // component (i.e. when processing the update queue). But since since
        // we're bailing out early *without* evaluating the component, we need
        // to account for it here, too. Reset to the value of the current fiber.
        // NOTE: This only applies to SimpleMemoComponent, not MemoComponent,
        // because a MemoComponent fiber does not have hooks or an update queue;
        // rather, it wraps around an inner component, which may or may not
        // contains hooks.
        // TODO: Move the reset at in beginWork out of the common path so that
        // this is no longer necessary.
        workInProgress.lanes = current.lanes;
        return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
      } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
        // This is a special case that only exists for legacy mode.
        // See https://github.com/facebook/react/pull/19216.
        didReceiveUpdate = true;
      }
    }
  }

  return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes);
}

function updateOffscreenComponent(current, workInProgress, renderLanes) {
  var nextProps = workInProgress.pendingProps;
  var nextChildren = nextProps.children;
  var prevState = current !== null ? current.memoizedState : null;

  if (nextProps.mode === 'hidden' || nextProps.mode === 'unstable-defer-without-hiding') {
    if ((workInProgress.mode & ConcurrentMode) === NoMode) {
      // In legacy sync mode, don't defer the subtree. Render it now.
      // TODO: Figure out what we should do in Blocking mode.
      var nextState = {
        baseLanes: NoLanes
      };
      workInProgress.memoizedState = nextState;
      pushRenderLanes(workInProgress, renderLanes);
    } else if (!includesSomeLane(renderLanes, OffscreenLane)) {
      var nextBaseLanes;

      if (prevState !== null) {
        var prevBaseLanes = prevState.baseLanes;
        nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes);
      } else {
        nextBaseLanes = renderLanes;
      } // Schedule this fiber to re-render at offscreen priority. Then bailout.


      {
        markSpawnedWork(OffscreenLane);
      }

      workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane);
      var _nextState = {
        baseLanes: nextBaseLanes
      };
      workInProgress.memoizedState = _nextState; // We're about to bail out, but we need to push this to the stack anyway
      // to avoid a push/pop misalignment.

      pushRenderLanes(workInProgress, nextBaseLanes);
      return null;
    } else {
      // Rendering at offscreen, so we can clear the base lanes.
      var _nextState2 = {
        baseLanes: NoLanes
      };
      workInProgress.memoizedState = _nextState2; // Push the lanes that were skipped when we bailed out.

      var subtreeRenderLanes = prevState !== null ? prevState.baseLanes : renderLanes;
      pushRenderLanes(workInProgress, subtreeRenderLanes);
    }
  } else {
    var _subtreeRenderLanes;

    if (prevState !== null) {
      _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes); // Since we're not hidden anymore, reset the state

      workInProgress.memoizedState = null;
    } else {
      // We weren't previously hidden, and we still aren't, so there's nothing
      // special to do. Need to push to the stack regardless, though, to avoid
      // a push/pop misalignment.
      _subtreeRenderLanes = renderLanes;
    }

    pushRenderLanes(workInProgress, _subtreeRenderLanes);
  }

  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
} // Note: These happen to have identical begin phases, for now. We shouldn't hold
// ourselves to this constraint, though. If the behavior diverges, we should
// fork the function.


var updateLegacyHiddenComponent = updateOffscreenComponent;

function updateFragment(current, workInProgress, renderLanes) {
  var nextChildren = workInProgress.pendingProps;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateMode(current, workInProgress, renderLanes) {
  var nextChildren = workInProgress.pendingProps.children;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateProfiler(current, workInProgress, renderLanes) {
  {
    workInProgress.flags |= Update; // Reset effect durations for the next eventual effect phase.
    // These are reset during render to allow the DevTools commit hook a chance to read them,

    var stateNode = workInProgress.stateNode;
    stateNode.effectDuration = 0;
    stateNode.passiveEffectDuration = 0;
  }

  var nextProps = workInProgress.pendingProps;
  var nextChildren = nextProps.children;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function markRef(current, workInProgress) {
  var ref = workInProgress.ref;

  if (current === null && ref !== null || current !== null && current.ref !== ref) {
    // Schedule a Ref effect
    workInProgress.flags |= Ref;
  }
}

function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) {
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;

      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component));
      }
    }
  }

  var context;

  {
    var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
    context = getMaskedContext(workInProgress, unmaskedContext);
  }

  var nextChildren;
  prepareToReadContext(workInProgress, renderLanes);

  {
    ReactCurrentOwner$1.current = workInProgress;
    setIsRendering(true);
    nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);

    if ( workInProgress.mode & StrictMode) {
      disableLogs();

      try {
        nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);
      } finally {
        reenableLogs();
      }
    }

    setIsRendering(false);
  }

  if (current !== null && !didReceiveUpdate) {
    bailoutHooks(current, workInProgress, renderLanes);
    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) {
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;

      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component));
      }
    }
  } // Push context providers early to prevent context stack mismatches.
  // During mounting we don't know the child context yet as the instance doesn't exist.
  // We will invalidate the child context in finishClassComponent() right after rendering.


  var hasContext;

  if (isContextProvider(Component)) {
    hasContext = true;
    pushContextProvider(workInProgress);
  } else {
    hasContext = false;
  }

  prepareToReadContext(workInProgress, renderLanes);
  var instance = workInProgress.stateNode;
  var shouldUpdate;

  if (instance === null) {
    if (current !== null) {
      // A class component without an instance only mounts if it suspended
      // inside a non-concurrent tree, in an inconsistent state. We want to
      // treat it like a new mount, even though an empty version of it already
      // committed. Disconnect the alternate pointers.
      current.alternate = null;
      workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect

      workInProgress.flags |= Placement;
    } // In the initial pass we might need to construct the instance.


    constructClassInstance(workInProgress, Component, nextProps);
    mountClassInstance(workInProgress, Component, nextProps, renderLanes);
    shouldUpdate = true;
  } else if (current === null) {
    // In a resume, we'll already have an instance we can reuse.
    shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes);
  } else {
    shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes);
  }

  var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes);

  {
    var inst = workInProgress.stateNode;

    if (shouldUpdate && inst.props !== nextProps) {
      if (!didWarnAboutReassigningProps) {
        error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component');
      }

      didWarnAboutReassigningProps = true;
    }
  }

  return nextUnitOfWork;
}

function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) {
  // Refs should update even if shouldComponentUpdate returns false
  markRef(current, workInProgress);
  var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags;

  if (!shouldUpdate && !didCaptureError) {
    // Context providers should defer to sCU for rendering
    if (hasContext) {
      invalidateContextProvider(workInProgress, Component, false);
    }

    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  }

  var instance = workInProgress.stateNode; // Rerender

  ReactCurrentOwner$1.current = workInProgress;
  var nextChildren;

  if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
    // If we captured an error, but getDerivedStateFromError is not defined,
    // unmount all the children. componentDidCatch will schedule an update to
    // re-render a fallback. This is temporary until we migrate everyone to
    // the new API.
    // TODO: Warn in a future release.
    nextChildren = null;

    {
      stopProfilerTimerIfRunning();
    }
  } else {
    {
      setIsRendering(true);
      nextChildren = instance.render();

      if ( workInProgress.mode & StrictMode) {
        disableLogs();

        try {
          instance.render();
        } finally {
          reenableLogs();
        }
      }

      setIsRendering(false);
    }
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;

  if (current !== null && didCaptureError) {
    // If we're recovering from an error, reconcile without reusing any of
    // the existing children. Conceptually, the normal children and the children
    // that are shown on error are two different sets, so we shouldn't reuse
    // normal children even if their identities match.
    forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes);
  } else {
    reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  } // Memoize state using the values we just used to render.
  // TODO: Restructure so we never read values from the instance.


  workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.

  if (hasContext) {
    invalidateContextProvider(workInProgress, Component, true);
  }

  return workInProgress.child;
}

function pushHostRootContext(workInProgress) {
  var root = workInProgress.stateNode;

  if (root.pendingContext) {
    pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
  } else if (root.context) {
    // Should always be set
    pushTopLevelContextObject(workInProgress, root.context, false);
  }

  pushHostContainer(workInProgress, root.containerInfo);
}

function updateHostRoot(current, workInProgress, renderLanes) {
  pushHostRootContext(workInProgress);
  var updateQueue = workInProgress.updateQueue;

  if (!(current !== null && updateQueue !== null)) {
    {
      throw Error( "If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue." );
    }
  }

  var nextProps = workInProgress.pendingProps;
  var prevState = workInProgress.memoizedState;
  var prevChildren = prevState !== null ? prevState.element : null;
  cloneUpdateQueue(current, workInProgress);
  processUpdateQueue(workInProgress, nextProps, null, renderLanes);
  var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property
  // being called "element".

  var nextChildren = nextState.element;

  if (nextChildren === prevChildren) {
    resetHydrationState();
    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
  }

  var root = workInProgress.stateNode;

  if (root.hydrate && enterHydrationState(workInProgress)) {
    // If we don't have any current children this might be the first pass.
    // We always try to hydrate. If this isn't a hydration pass there won't
    // be any children to hydrate which is effectively the same thing as
    // not hydrating.
    {
      var mutableSourceEagerHydrationData = root.mutableSourceEagerHydrationData;

      if (mutableSourceEagerHydrationData != null) {
        for (var i = 0; i < mutableSourceEagerHydrationData.length; i += 2) {
          var mutableSource = mutableSourceEagerHydrationData[i];
          var version = mutableSourceEagerHydrationData[i + 1];
          setWorkInProgressVersion(mutableSource, version);
        }
      }
    }

    var child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);
    workInProgress.child = child;
    var node = child;

    while (node) {
      // Mark each child as hydrating. This is a fast path to know whether this
      // tree is part of a hydrating tree. This is used to determine if a child
      // node has fully mounted yet, and for scheduling event replaying.
      // Conceptually this is similar to Placement in that a new subtree is
      // inserted into the React tree here. It just happens to not need DOM
      // mutations because it already exists.
      node.flags = node.flags & ~Placement | Hydrating;
      node = node.sibling;
    }
  } else {
    // Otherwise reset hydration state in case we aborted and resumed another
    // root.
    reconcileChildren(current, workInProgress, nextChildren, renderLanes);
    resetHydrationState();
  }

  return workInProgress.child;
}

function updateHostComponent(current, workInProgress, renderLanes) {
  pushHostContext(workInProgress);

  if (current === null) {
    tryToClaimNextHydratableInstance(workInProgress);
  }

  var type = workInProgress.type;
  var nextProps = workInProgress.pendingProps;
  var prevProps = current !== null ? current.memoizedProps : null;
  var nextChildren = nextProps.children;
  var isDirectTextChild = shouldSetTextContent(type, nextProps);

  if (isDirectTextChild) {
    // We special case a direct text child of a host node. This is a common
    // case. We won't handle it as a reified child. We will instead handle
    // this in the host environment that also has access to this prop. That
    // avoids allocating another HostText fiber and traversing it.
    nextChildren = null;
  } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
    // If we're switching from a direct text child to a normal child, or to
    // empty, we need to schedule the text content to be reset.
    workInProgress.flags |= ContentReset;
  }

  markRef(current, workInProgress);
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  return workInProgress.child;
}

function updateHostText(current, workInProgress) {
  if (current === null) {
    tryToClaimNextHydratableInstance(workInProgress);
  } // Nothing to do here. This is terminal. We'll do the completion step
  // immediately after.


  return null;
}

function mountLazyComponent(_current, workInProgress, elementType, updateLanes, renderLanes) {
  if (_current !== null) {
    // A lazy component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect

    workInProgress.flags |= Placement;
  }

  var props = workInProgress.pendingProps;
  var lazyComponent = elementType;
  var payload = lazyComponent._payload;
  var init = lazyComponent._init;
  var Component = init(payload); // Store the unwrapped component in the type.

  workInProgress.type = Component;
  var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
  var resolvedProps = resolveDefaultProps(Component, props);
  var child;

  switch (resolvedTag) {
    case FunctionComponent:
      {
        {
          validateFunctionComponentInDev(workInProgress, Component);
          workInProgress.type = Component = resolveFunctionForHotReloading(Component);
        }

        child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes);
        return child;
      }

    case ClassComponent:
      {
        {
          workInProgress.type = Component = resolveClassForHotReloading(Component);
        }

        child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes);
        return child;
      }

    case ForwardRef:
      {
        {
          workInProgress.type = Component = resolveForwardRefForHotReloading(Component);
        }

        child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes);
        return child;
      }

    case MemoComponent:
      {
        {
          if (workInProgress.type !== workInProgress.elementType) {
            var outerPropTypes = Component.propTypes;

            if (outerPropTypes) {
              checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only
              'prop', getComponentName(Component));
            }
          }
        }

        child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
        updateLanes, renderLanes);
        return child;
      }
  }

  var hint = '';

  {
    if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
      hint = ' Did you wrap a component in React.lazy() more than once?';
    }
  } // This message intentionally doesn't mention ForwardRef or MemoComponent
  // because the fact that it's a separate type of work is an
  // implementation detail.


  {
    {
      throw Error( "Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint );
    }
  }
}

function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) {
  if (_current !== null) {
    // An incomplete component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect

    workInProgress.flags |= Placement;
  } // Promote the fiber to a class and try rendering again.


  workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent`
  // Push context providers early to prevent context stack mismatches.
  // During mounting we don't know the child context yet as the instance doesn't exist.
  // We will invalidate the child context in finishClassComponent() right after rendering.

  var hasContext;

  if (isContextProvider(Component)) {
    hasContext = true;
    pushContextProvider(workInProgress);
  } else {
    hasContext = false;
  }

  prepareToReadContext(workInProgress, renderLanes);
  constructClassInstance(workInProgress, Component, nextProps);
  mountClassInstance(workInProgress, Component, nextProps, renderLanes);
  return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);
}

function mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) {
  if (_current !== null) {
    // An indeterminate component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect

    workInProgress.flags |= Placement;
  }

  var props = workInProgress.pendingProps;
  var context;

  {
    var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
    context = getMaskedContext(workInProgress, unmaskedContext);
  }

  prepareToReadContext(workInProgress, renderLanes);
  var value;

  {
    if (Component.prototype && typeof Component.prototype.render === 'function') {
      var componentName = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutBadClass[componentName]) {
        error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);

        didWarnAboutBadClass[componentName] = true;
      }
    }

    if (workInProgress.mode & StrictMode) {
      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
    }

    setIsRendering(true);
    ReactCurrentOwner$1.current = workInProgress;
    value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);
    setIsRendering(false);
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;

  {
    // Support for module components is deprecated and is removed behind a flag.
    // Whether or not it would crash later, we want to show a good message in DEV first.
    if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
      var _componentName = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutModulePatternComponent[_componentName]) {
        error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);

        didWarnAboutModulePatternComponent[_componentName] = true;
      }
    }
  }

  if ( // Run these checks in production only if the flag is off.
  // Eventually we'll delete this branch altogether.
   typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
    {
      var _componentName2 = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutModulePatternComponent[_componentName2]) {
        error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName2, _componentName2, _componentName2);

        didWarnAboutModulePatternComponent[_componentName2] = true;
      }
    } // Proceed under the assumption that this is a class instance


    workInProgress.tag = ClassComponent; // Throw out any hooks that were used.

    workInProgress.memoizedState = null;
    workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches.
    // During mounting we don't know the child context yet as the instance doesn't exist.
    // We will invalidate the child context in finishClassComponent() right after rendering.

    var hasContext = false;

    if (isContextProvider(Component)) {
      hasContext = true;
      pushContextProvider(workInProgress);
    } else {
      hasContext = false;
    }

    workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;
    initializeUpdateQueue(workInProgress);
    var getDerivedStateFromProps = Component.getDerivedStateFromProps;

    if (typeof getDerivedStateFromProps === 'function') {
      applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);
    }

    adoptClassInstance(workInProgress, value);
    mountClassInstance(workInProgress, Component, props, renderLanes);
    return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);
  } else {
    // Proceed under the assumption that this is a function component
    workInProgress.tag = FunctionComponent;

    {

      if ( workInProgress.mode & StrictMode) {
        disableLogs();

        try {
          value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);
        } finally {
          reenableLogs();
        }
      }
    }

    reconcileChildren(null, workInProgress, value, renderLanes);

    {
      validateFunctionComponentInDev(workInProgress, Component);
    }

    return workInProgress.child;
  }
}

function validateFunctionComponentInDev(workInProgress, Component) {
  {
    if (Component) {
      if (Component.childContextTypes) {
        error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');
      }
    }

    if (workInProgress.ref !== null) {
      var info = '';
      var ownerName = getCurrentFiberOwnerNameInDevOrNull();

      if (ownerName) {
        info += '\n\nCheck the render method of `' + ownerName + '`.';
      }

      var warningKey = ownerName || workInProgress._debugID || '';
      var debugSource = workInProgress._debugSource;

      if (debugSource) {
        warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
      }

      if (!didWarnAboutFunctionRefs[warningKey]) {
        didWarnAboutFunctionRefs[warningKey] = true;

        error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);
      }
    }

    if (typeof Component.getDerivedStateFromProps === 'function') {
      var _componentName3 = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
        error('%s: Function components do not support getDerivedStateFromProps.', _componentName3);

        didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
      }
    }

    if (typeof Component.contextType === 'object' && Component.contextType !== null) {
      var _componentName4 = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
        error('%s: Function components do not support contextType.', _componentName4);

        didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
      }
    }
  }
}

var SUSPENDED_MARKER = {
  dehydrated: null,
  retryLane: NoLane
};

function mountSuspenseOffscreenState(renderLanes) {
  return {
    baseLanes: renderLanes
  };
}

function updateSuspenseOffscreenState(prevOffscreenState, renderLanes) {
  return {
    baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes)
  };
} // TODO: Probably should inline this back


function shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) {
  // If we're already showing a fallback, there are cases where we need to
  // remain on that fallback regardless of whether the content has resolved.
  // For example, SuspenseList coordinates when nested content appears.
  if (current !== null) {
    var suspenseState = current.memoizedState;

    if (suspenseState === null) {
      // Currently showing content. Don't hide it, even if ForceSuspenseFallack
      // is true. More precise name might be "ForceRemainSuspenseFallback".
      // Note: This is a factoring smell. Can't remain on a fallback if there's
      // no fallback to remain on.
      return false;
    }
  } // Not currently showing content. Consult the Suspense context.


  return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
}

function getRemainingWorkInPrimaryTree(current, renderLanes) {
  // TODO: Should not remove render lanes that were pinged during this render
  return removeLanes(current.childLanes, renderLanes);
}

function updateSuspenseComponent(current, workInProgress, renderLanes) {
  var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.

  {
    if (shouldSuspend(workInProgress)) {
      workInProgress.flags |= DidCapture;
    }
  }

  var suspenseContext = suspenseStackCursor.current;
  var showFallback = false;
  var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags;

  if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {
    // Something in this boundary's subtree already suspended. Switch to
    // rendering the fallback children.
    showFallback = true;
    workInProgress.flags &= ~DidCapture;
  } else {
    // Attempting the main content
    if (current === null || current.memoizedState !== null) {
      // This is a new mount or this boundary is already showing a fallback state.
      // Mark this subtree context as having at least one invisible parent that could
      // handle the fallback state.
      // Boundaries without fallbacks or should be avoided are not considered since
      // they cannot handle preferred fallback states.
      if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {
        suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
      }
    }
  }

  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  pushSuspenseContext(workInProgress, suspenseContext); // OK, the next part is confusing. We're about to reconcile the Suspense
  // boundary's children. This involves some custom reconcilation logic. Two
  // main reasons this is so complicated.
  //
  // First, Legacy Mode has different semantics for backwards compatibility. The
  // primary tree will commit in an inconsistent state, so when we do the
  // second pass to render the fallback, we do some exceedingly, uh, clever
  // hacks to make that not totally break. Like transferring effects and
  // deletions from hidden tree. In Concurrent Mode, it's much simpler,
  // because we bailout on the primary tree completely and leave it in its old
  // state, no effects. Same as what we do for Offscreen (except that
  // Offscreen doesn't have the first render pass).
  //
  // Second is hydration. During hydration, the Suspense fiber has a slightly
  // different layout, where the child points to a dehydrated fragment, which
  // contains the DOM rendered by the server.
  //
  // Third, even if you set all that aside, Suspense is like error boundaries in
  // that we first we try to render one tree, and if that fails, we render again
  // and switch to a different tree. Like a try/catch block. So we have to track
  // which branch we're currently rendering. Ideally we would model this using
  // a stack.

  if (current === null) {
    // Initial mount
    // If we're currently hydrating, try to hydrate this boundary.
    // But only if this has a fallback.
    if (nextProps.fallback !== undefined) {
      tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.
    }

    var nextPrimaryChildren = nextProps.children;
    var nextFallbackChildren = nextProps.fallback;

    if (showFallback) {
      var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);
      var primaryChildFragment = workInProgress.child;
      primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);
      workInProgress.memoizedState = SUSPENDED_MARKER;
      return fallbackFragment;
    } else if (typeof nextProps.unstable_expectedLoadTime === 'number') {
      // This is a CPU-bound tree. Skip this tree and show a placeholder to
      // unblock the surrounding content. Then immediately retry after the
      // initial commit.
      var _fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);

      var _primaryChildFragment = workInProgress.child;
      _primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);
      workInProgress.memoizedState = SUSPENDED_MARKER; // Since nothing actually suspended, there will nothing to ping this to
      // get it started back up to attempt the next item. While in terms of
      // priority this work has the same priority as this current render, it's
      // not part of the same transition once the transition has committed. If
      // it's sync, we still want to yield so that it can be painted.
      // Conceptually, this is really the same as pinging. We can use any
      // RetryLane even if it's the one currently rendering since we're leaving
      // it behind on this node.

      workInProgress.lanes = SomeRetryLane;

      {
        markSpawnedWork(SomeRetryLane);
      }

      return _fallbackFragment;
    } else {
      return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren, renderLanes);
    }
  } else {
    // This is an update.
    // If the current fiber has a SuspenseState, that means it's already showing
    // a fallback.
    var prevState = current.memoizedState;

    if (prevState !== null) {

      if (showFallback) {
        var _nextFallbackChildren2 = nextProps.fallback;
        var _nextPrimaryChildren2 = nextProps.children;

        var _fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren2, _nextFallbackChildren2, renderLanes);

        var _primaryChildFragment3 = workInProgress.child;
        var prevOffscreenState = current.child.memoizedState;
        _primaryChildFragment3.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes);
        _primaryChildFragment3.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes);
        workInProgress.memoizedState = SUSPENDED_MARKER;
        return _fallbackChildFragment;
      } else {
        var _nextPrimaryChildren3 = nextProps.children;

        var _primaryChildFragment4 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren3, renderLanes);

        workInProgress.memoizedState = null;
        return _primaryChildFragment4;
      }
    } else {
      // The current tree is not already showing a fallback.
      if (showFallback) {
        // Timed out.
        var _nextFallbackChildren3 = nextProps.fallback;
        var _nextPrimaryChildren4 = nextProps.children;

        var _fallbackChildFragment2 = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren4, _nextFallbackChildren3, renderLanes);

        var _primaryChildFragment5 = workInProgress.child;
        var _prevOffscreenState = current.child.memoizedState;
        _primaryChildFragment5.memoizedState = _prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(_prevOffscreenState, renderLanes);
        _primaryChildFragment5.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); // Skip the primary children, and continue working on the
        // fallback children.

        workInProgress.memoizedState = SUSPENDED_MARKER;
        return _fallbackChildFragment2;
      } else {
        // Still haven't timed out. Continue rendering the children, like we
        // normally do.
        var _nextPrimaryChildren5 = nextProps.children;

        var _primaryChildFragment6 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren5, renderLanes);

        workInProgress.memoizedState = null;
        return _primaryChildFragment6;
      }
    }
  }
}

function mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) {
  var mode = workInProgress.mode;
  var primaryChildProps = {
    mode: 'visible',
    children: primaryChildren
  };
  var primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, renderLanes, null);
  primaryChildFragment.return = workInProgress;
  workInProgress.child = primaryChildFragment;
  return primaryChildFragment;
}

function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) {
  var mode = workInProgress.mode;
  var progressedPrimaryFragment = workInProgress.child;
  var primaryChildProps = {
    mode: 'hidden',
    children: primaryChildren
  };
  var primaryChildFragment;
  var fallbackChildFragment;

  if ((mode & BlockingMode) === NoMode && progressedPrimaryFragment !== null) {
    // In legacy mode, we commit the primary tree as if it successfully
    // completed, even though it's in an inconsistent state.
    primaryChildFragment = progressedPrimaryFragment;
    primaryChildFragment.childLanes = NoLanes;
    primaryChildFragment.pendingProps = primaryChildProps;

    if ( workInProgress.mode & ProfileMode) {
      // Reset the durations from the first pass so they aren't included in the
      // final amounts. This seems counterintuitive, since we're intentionally
      // not measuring part of the render phase, but this makes it match what we
      // do in Concurrent Mode.
      primaryChildFragment.actualDuration = 0;
      primaryChildFragment.actualStartTime = -1;
      primaryChildFragment.selfBaseDuration = 0;
      primaryChildFragment.treeBaseDuration = 0;
    }

    fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);
  } else {
    primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, NoLanes, null);
    fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);
  }

  primaryChildFragment.return = workInProgress;
  fallbackChildFragment.return = workInProgress;
  primaryChildFragment.sibling = fallbackChildFragment;
  workInProgress.child = primaryChildFragment;
  return fallbackChildFragment;
}

function createWorkInProgressOffscreenFiber(current, offscreenProps) {
  // The props argument to `createWorkInProgress` is `any` typed, so we use this
  // wrapper function to constrain it.
  return createWorkInProgress(current, offscreenProps);
}

function updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) {
  var currentPrimaryChildFragment = current.child;
  var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
  var primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
    mode: 'visible',
    children: primaryChildren
  });

  if ((workInProgress.mode & BlockingMode) === NoMode) {
    primaryChildFragment.lanes = renderLanes;
  }

  primaryChildFragment.return = workInProgress;
  primaryChildFragment.sibling = null;

  if (currentFallbackChildFragment !== null) {
    // Delete the fallback child fragment
    currentFallbackChildFragment.nextEffect = null;
    currentFallbackChildFragment.flags = Deletion;
    workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChildFragment;
  }

  workInProgress.child = primaryChildFragment;
  return primaryChildFragment;
}

function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) {
  var mode = workInProgress.mode;
  var currentPrimaryChildFragment = current.child;
  var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
  var primaryChildProps = {
    mode: 'hidden',
    children: primaryChildren
  };
  var primaryChildFragment;

  if ( // In legacy mode, we commit the primary tree as if it successfully
  // completed, even though it's in an inconsistent state.
  (mode & BlockingMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was
  // already cloned. In legacy mode, the only case where this isn't true is
  // when DevTools forces us to display a fallback; we skip the first render
  // pass entirely and go straight to rendering the fallback. (In Concurrent
  // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
  // only codepath.)
  workInProgress.child !== currentPrimaryChildFragment) {
    var progressedPrimaryFragment = workInProgress.child;
    primaryChildFragment = progressedPrimaryFragment;
    primaryChildFragment.childLanes = NoLanes;
    primaryChildFragment.pendingProps = primaryChildProps;

    if ( workInProgress.mode & ProfileMode) {
      // Reset the durations from the first pass so they aren't included in the
      // final amounts. This seems counterintuitive, since we're intentionally
      // not measuring part of the render phase, but this makes it match what we
      // do in Concurrent Mode.
      primaryChildFragment.actualDuration = 0;
      primaryChildFragment.actualStartTime = -1;
      primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
      primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
    } // The fallback fiber was added as a deletion effect during the first pass.
    // However, since we're going to remain on the fallback, we no longer want
    // to delete it. So we need to remove it from the list. Deletions are stored
    // on the same list as effects. We want to keep the effects from the primary
    // tree. So we copy the primary child fragment's effect list, which does not
    // include the fallback deletion effect.


    var progressedLastEffect = primaryChildFragment.lastEffect;

    if (progressedLastEffect !== null) {
      workInProgress.firstEffect = primaryChildFragment.firstEffect;
      workInProgress.lastEffect = progressedLastEffect;
      progressedLastEffect.nextEffect = null;
    } else {
      // TODO: Reset this somewhere else? Lol legacy mode is so weird.
      workInProgress.firstEffect = workInProgress.lastEffect = null;
    }
  } else {
    primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
  }

  var fallbackChildFragment;

  if (currentFallbackChildFragment !== null) {
    fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
  } else {
    fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); // Needs a placement effect because the parent (the Suspense boundary) already
    // mounted but this is a new fiber.

    fallbackChildFragment.flags |= Placement;
  }

  fallbackChildFragment.return = workInProgress;
  primaryChildFragment.return = workInProgress;
  primaryChildFragment.sibling = fallbackChildFragment;
  workInProgress.child = primaryChildFragment;
  return fallbackChildFragment;
}

function scheduleWorkOnFiber(fiber, renderLanes) {
  fiber.lanes = mergeLanes(fiber.lanes, renderLanes);
  var alternate = fiber.alternate;

  if (alternate !== null) {
    alternate.lanes = mergeLanes(alternate.lanes, renderLanes);
  }

  scheduleWorkOnParentPath(fiber.return, renderLanes);
}

function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) {
  // Mark any Suspense boundaries with fallbacks as having work to do.
  // If they were previously forced into fallbacks, they may now be able
  // to unblock.
  var node = firstChild;

  while (node !== null) {
    if (node.tag === SuspenseComponent) {
      var state = node.memoizedState;

      if (state !== null) {
        scheduleWorkOnFiber(node, renderLanes);
      }
    } else if (node.tag === SuspenseListComponent) {
      // If the tail is hidden there might not be an Suspense boundaries
      // to schedule work on. In this case we have to schedule it on the
      // list itself.
      // We don't have to traverse to the children of the list since
      // the list will propagate the change when it rerenders.
      scheduleWorkOnFiber(node, renderLanes);
    } else if (node.child !== null) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === workInProgress) {
      return;
    }

    while (node.sibling === null) {
      if (node.return === null || node.return === workInProgress) {
        return;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function findLastContentRow(firstChild) {
  // This is going to find the last row among these children that is already
  // showing content on the screen, as opposed to being in fallback state or
  // new. If a row has multiple Suspense boundaries, any of them being in the
  // fallback state, counts as the whole row being in a fallback state.
  // Note that the "rows" will be workInProgress, but any nested children
  // will still be current since we haven't rendered them yet. The mounted
  // order may not be the same as the new order. We use the new order.
  var row = firstChild;
  var lastContentRow = null;

  while (row !== null) {
    var currentRow = row.alternate; // New rows can't be content rows.

    if (currentRow !== null && findFirstSuspended(currentRow) === null) {
      lastContentRow = row;
    }

    row = row.sibling;
  }

  return lastContentRow;
}

function validateRevealOrder(revealOrder) {
  {
    if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {
      didWarnAboutRevealOrder[revealOrder] = true;

      if (typeof revealOrder === 'string') {
        switch (revealOrder.toLowerCase()) {
          case 'together':
          case 'forwards':
          case 'backwards':
            {
              error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());

              break;
            }

          case 'forward':
          case 'backward':
            {
              error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());

              break;
            }

          default:
            error('"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);

            break;
        }
      } else {
        error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
      }
    }
  }
}

function validateTailOptions(tailMode, revealOrder) {
  {
    if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {
      if (tailMode !== 'collapsed' && tailMode !== 'hidden') {
        didWarnAboutTailOptions[tailMode] = true;

        error('"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode);
      } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {
        didWarnAboutTailOptions[tailMode] = true;

        error('<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode);
      }
    }
  }
}

function validateSuspenseListNestedChild(childSlot, index) {
  {
    var isArray = Array.isArray(childSlot);
    var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';

    if (isArray || isIterable) {
      var type = isArray ? 'array' : 'iterable';

      error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);

      return false;
    }
  }

  return true;
}

function validateSuspenseListChildren(children, revealOrder) {
  {
    if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {
      if (Array.isArray(children)) {
        for (var i = 0; i < children.length; i++) {
          if (!validateSuspenseListNestedChild(children[i], i)) {
            return;
          }
        }
      } else {
        var iteratorFn = getIteratorFn(children);

        if (typeof iteratorFn === 'function') {
          var childrenIterator = iteratorFn.call(children);

          if (childrenIterator) {
            var step = childrenIterator.next();
            var _i = 0;

            for (; !step.done; step = childrenIterator.next()) {
              if (!validateSuspenseListNestedChild(step.value, _i)) {
                return;
              }

              _i++;
            }
          }
        } else {
          error('A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);
        }
      }
    }
  }
}

function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {
  var renderState = workInProgress.memoizedState;

  if (renderState === null) {
    workInProgress.memoizedState = {
      isBackwards: isBackwards,
      rendering: null,
      renderingStartTime: 0,
      last: lastContentRow,
      tail: tail,
      tailMode: tailMode,
      lastEffect: lastEffectBeforeRendering
    };
  } else {
    // We can reuse the existing object from previous renders.
    renderState.isBackwards = isBackwards;
    renderState.rendering = null;
    renderState.renderingStartTime = 0;
    renderState.last = lastContentRow;
    renderState.tail = tail;
    renderState.tailMode = tailMode;
    renderState.lastEffect = lastEffectBeforeRendering;
  }
} // This can end up rendering this component multiple passes.
// The first pass splits the children fibers into two sets. A head and tail.
// We first render the head. If anything is in fallback state, we do another
// pass through beginWork to rerender all children (including the tail) with
// the force suspend context. If the first render didn't have anything in
// in fallback state. Then we render each row in the tail one-by-one.
// That happens in the completeWork phase without going back to beginWork.


function updateSuspenseListComponent(current, workInProgress, renderLanes) {
  var nextProps = workInProgress.pendingProps;
  var revealOrder = nextProps.revealOrder;
  var tailMode = nextProps.tail;
  var newChildren = nextProps.children;
  validateRevealOrder(revealOrder);
  validateTailOptions(tailMode, revealOrder);
  validateSuspenseListChildren(newChildren, revealOrder);
  reconcileChildren(current, workInProgress, newChildren, renderLanes);
  var suspenseContext = suspenseStackCursor.current;
  var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);

  if (shouldForceFallback) {
    suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
    workInProgress.flags |= DidCapture;
  } else {
    var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags;

    if (didSuspendBefore) {
      // If we previously forced a fallback, we need to schedule work
      // on any nested boundaries to let them know to try to render
      // again. This is the same as context updating.
      propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes);
    }

    suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  }

  pushSuspenseContext(workInProgress, suspenseContext);

  if ((workInProgress.mode & BlockingMode) === NoMode) {
    // In legacy mode, SuspenseList doesn't work so we just
    // use make it a noop by treating it as the default revealOrder.
    workInProgress.memoizedState = null;
  } else {
    switch (revealOrder) {
      case 'forwards':
        {
          var lastContentRow = findLastContentRow(workInProgress.child);
          var tail;

          if (lastContentRow === null) {
            // The whole list is part of the tail.
            // TODO: We could fast path by just rendering the tail now.
            tail = workInProgress.child;
            workInProgress.child = null;
          } else {
            // Disconnect the tail rows after the content row.
            // We're going to render them separately later.
            tail = lastContentRow.sibling;
            lastContentRow.sibling = null;
          }

          initSuspenseListRenderState(workInProgress, false, // isBackwards
          tail, lastContentRow, tailMode, workInProgress.lastEffect);
          break;
        }

      case 'backwards':
        {
          // We're going to find the first row that has existing content.
          // At the same time we're going to reverse the list of everything
          // we pass in the meantime. That's going to be our tail in reverse
          // order.
          var _tail = null;
          var row = workInProgress.child;
          workInProgress.child = null;

          while (row !== null) {
            var currentRow = row.alternate; // New rows can't be content rows.

            if (currentRow !== null && findFirstSuspended(currentRow) === null) {
              // This is the beginning of the main content.
              workInProgress.child = row;
              break;
            }

            var nextRow = row.sibling;
            row.sibling = _tail;
            _tail = row;
            row = nextRow;
          } // TODO: If workInProgress.child is null, we can continue on the tail immediately.


          initSuspenseListRenderState(workInProgress, true, // isBackwards
          _tail, null, // last
          tailMode, workInProgress.lastEffect);
          break;
        }

      case 'together':
        {
          initSuspenseListRenderState(workInProgress, false, // isBackwards
          null, // tail
          null, // last
          undefined, workInProgress.lastEffect);
          break;
        }

      default:
        {
          // The default reveal order is the same as not having
          // a boundary.
          workInProgress.memoizedState = null;
        }
    }
  }

  return workInProgress.child;
}

function updatePortalComponent(current, workInProgress, renderLanes) {
  pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  var nextChildren = workInProgress.pendingProps;

  if (current === null) {
    // Portals are special because we don't append the children during mount
    // but at commit. Therefore we need to track insertions which the normal
    // flow doesn't do during mount. This doesn't happen at the root because
    // the root always starts with a "current" with a null child.
    // TODO: Consider unifying this with how the root works.
    workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);
  } else {
    reconcileChildren(current, workInProgress, nextChildren, renderLanes);
  }

  return workInProgress.child;
}

var hasWarnedAboutUsingNoValuePropOnContextProvider = false;

function updateContextProvider(current, workInProgress, renderLanes) {
  var providerType = workInProgress.type;
  var context = providerType._context;
  var newProps = workInProgress.pendingProps;
  var oldProps = workInProgress.memoizedProps;
  var newValue = newProps.value;

  {
    if (!('value' in newProps)) {
      if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
        hasWarnedAboutUsingNoValuePropOnContextProvider = true;

        error('The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?');
      }
    }

    var providerPropTypes = workInProgress.type.propTypes;

    if (providerPropTypes) {
      checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider');
    }
  }

  pushProvider(workInProgress, newValue);

  if (oldProps !== null) {
    var oldValue = oldProps.value;
    var changedBits = calculateChangedBits(context, newValue, oldValue);

    if (changedBits === 0) {
      // No change. Bailout early if children are the same.
      if (oldProps.children === newProps.children && !hasContextChanged()) {
        return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
      }
    } else {
      // The context value changed. Search for matching consumers and schedule
      // them to update.
      propagateContextChange(workInProgress, context, changedBits, renderLanes);
    }
  }

  var newChildren = newProps.children;
  reconcileChildren(current, workInProgress, newChildren, renderLanes);
  return workInProgress.child;
}

var hasWarnedAboutUsingContextAsConsumer = false;

function updateContextConsumer(current, workInProgress, renderLanes) {
  var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In
  // DEV mode, we create a separate object for Context.Consumer that acts
  // like a proxy to Context. This proxy object adds unnecessary code in PROD
  // so we use the old behaviour (Context.Consumer references Context) to
  // reduce size and overhead. The separate object references context via
  // a property called "_context", which also gives us the ability to check
  // in DEV mode if this property exists or not and warn if it does not.

  {
    if (context._context === undefined) {
      // This may be because it's a Context (rather than a Consumer).
      // Or it may be because it's older React where they're the same thing.
      // We only want to warn if we're sure it's a new React.
      if (context !== context.Consumer) {
        if (!hasWarnedAboutUsingContextAsConsumer) {
          hasWarnedAboutUsingContextAsConsumer = true;

          error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
        }
      }
    } else {
      context = context._context;
    }
  }

  var newProps = workInProgress.pendingProps;
  var render = newProps.children;

  {
    if (typeof render !== 'function') {
      error('A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');
    }
  }

  prepareToReadContext(workInProgress, renderLanes);
  var newValue = readContext(context, newProps.unstable_observedBits);
  var newChildren;

  {
    ReactCurrentOwner$1.current = workInProgress;
    setIsRendering(true);
    newChildren = render(newValue);
    setIsRendering(false);
  } // React DevTools reads this flag.


  workInProgress.flags |= PerformedWork;
  reconcileChildren(current, workInProgress, newChildren, renderLanes);
  return workInProgress.child;
}

function markWorkInProgressReceivedUpdate() {
  didReceiveUpdate = true;
}

function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
  if (current !== null) {
    // Reuse previous dependencies
    workInProgress.dependencies = current.dependencies;
  }

  {
    // Don't update "base" render times for bailouts.
    stopProfilerTimerIfRunning();
  }

  markSkippedUpdateLanes(workInProgress.lanes); // Check if the children have any pending work.

  if (!includesSomeLane(renderLanes, workInProgress.childLanes)) {
    // The children don't have any work either. We can skip them.
    // TODO: Once we add back resuming, we should check if the children are
    // a work-in-progress set. If so, we need to transfer their effects.
    return null;
  } else {
    // This fiber doesn't have work, but its subtree does. Clone the child
    // fibers and continue.
    cloneChildFibers(current, workInProgress);
    return workInProgress.child;
  }
}

function remountFiber(current, oldWorkInProgress, newWorkInProgress) {
  {
    var returnFiber = oldWorkInProgress.return;

    if (returnFiber === null) {
      throw new Error('Cannot swap the root fiber.');
    } // Disconnect from the old current.
    // It will get deleted.


    current.alternate = null;
    oldWorkInProgress.alternate = null; // Connect to the new tree.

    newWorkInProgress.index = oldWorkInProgress.index;
    newWorkInProgress.sibling = oldWorkInProgress.sibling;
    newWorkInProgress.return = oldWorkInProgress.return;
    newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.

    if (oldWorkInProgress === returnFiber.child) {
      returnFiber.child = newWorkInProgress;
    } else {
      var prevSibling = returnFiber.child;

      if (prevSibling === null) {
        throw new Error('Expected parent to have a child.');
      }

      while (prevSibling.sibling !== oldWorkInProgress) {
        prevSibling = prevSibling.sibling;

        if (prevSibling === null) {
          throw new Error('Expected to find the previous sibling.');
        }
      }

      prevSibling.sibling = newWorkInProgress;
    } // Delete the old fiber and place the new one.
    // Since the old fiber is disconnected, we have to schedule it manually.


    var last = returnFiber.lastEffect;

    if (last !== null) {
      last.nextEffect = current;
      returnFiber.lastEffect = current;
    } else {
      returnFiber.firstEffect = returnFiber.lastEffect = current;
    }

    current.nextEffect = null;
    current.flags = Deletion;
    newWorkInProgress.flags |= Placement; // Restart work from the new fiber.

    return newWorkInProgress;
  }
}

function beginWork(current, workInProgress, renderLanes) {
  var updateLanes = workInProgress.lanes;

  {
    if (workInProgress._debugNeedsRemount && current !== null) {
      // This will restart the begin phase with a new fiber.
      return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes));
    }
  }

  if (current !== null) {
    var oldProps = current.memoizedProps;
    var newProps = workInProgress.pendingProps;

    if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:
     workInProgress.type !== current.type )) {
      // If props or context changed, mark the fiber as having performed work.
      // This may be unset if the props are determined to be equal later (memo).
      didReceiveUpdate = true;
    } else if (!includesSomeLane(renderLanes, updateLanes)) {
      didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering
      // the begin phase. There's still some bookkeeping we that needs to be done
      // in this optimized path, mostly pushing stuff onto the stack.

      switch (workInProgress.tag) {
        case HostRoot:
          pushHostRootContext(workInProgress);
          resetHydrationState();
          break;

        case HostComponent:
          pushHostContext(workInProgress);
          break;

        case ClassComponent:
          {
            var Component = workInProgress.type;

            if (isContextProvider(Component)) {
              pushContextProvider(workInProgress);
            }

            break;
          }

        case HostPortal:
          pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
          break;

        case ContextProvider:
          {
            var newValue = workInProgress.memoizedProps.value;
            pushProvider(workInProgress, newValue);
            break;
          }

        case Profiler:
          {
            // Profiler should only call onRender when one of its descendants actually rendered.
            var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);

            if (hasChildWork) {
              workInProgress.flags |= Update;
            } // Reset effect durations for the next eventual effect phase.
            // These are reset during render to allow the DevTools commit hook a chance to read them,


            var stateNode = workInProgress.stateNode;
            stateNode.effectDuration = 0;
            stateNode.passiveEffectDuration = 0;
          }

          break;

        case SuspenseComponent:
          {
            var state = workInProgress.memoizedState;

            if (state !== null) {
              // whether to retry the primary children, or to skip over it and
              // go straight to the fallback. Check the priority of the primary
              // child fragment.


              var primaryChildFragment = workInProgress.child;
              var primaryChildLanes = primaryChildFragment.childLanes;

              if (includesSomeLane(renderLanes, primaryChildLanes)) {
                // The primary children have pending work. Use the normal path
                // to attempt to render the primary children again.
                return updateSuspenseComponent(current, workInProgress, renderLanes);
              } else {
                // The primary child fragment does not have pending work marked
                // on it
                pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient
                // priority. Bailout.

                var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);

                if (child !== null) {
                  // The fallback children have pending work. Skip over the
                  // primary children and work on the fallback.
                  return child.sibling;
                } else {
                  return null;
                }
              }
            } else {
              pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
            }

            break;
          }

        case SuspenseListComponent:
          {
            var didSuspendBefore = (current.flags & DidCapture) !== NoFlags;

            var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);

            if (didSuspendBefore) {
              if (_hasChildWork) {
                // If something was in fallback state last time, and we have all the
                // same children then we're still in progressive loading state.
                // Something might get unblocked by state updates or retries in the
                // tree which will affect the tail. So we need to use the normal
                // path to compute the correct tail.
                return updateSuspenseListComponent(current, workInProgress, renderLanes);
              } // If none of the children had any work, that means that none of
              // them got retried so they'll still be blocked in the same way
              // as before. We can fast bail out.


              workInProgress.flags |= DidCapture;
            } // If nothing suspended before and we're rendering the same children,
            // then the tail doesn't matter. Anything new that suspends will work
            // in the "together" mode, so we can continue from the state we had.


            var renderState = workInProgress.memoizedState;

            if (renderState !== null) {
              // Reset to the "together" mode in case we've started a different
              // update in the past but didn't complete it.
              renderState.rendering = null;
              renderState.tail = null;
              renderState.lastEffect = null;
            }

            pushSuspenseContext(workInProgress, suspenseStackCursor.current);

            if (_hasChildWork) {
              break;
            } else {
              // If none of the children had any work, that means that none of
              // them got retried so they'll still be blocked in the same way
              // as before. We can fast bail out.
              return null;
            }
          }

        case OffscreenComponent:
        case LegacyHiddenComponent:
          {
            // Need to check if the tree still needs to be deferred. This is
            // almost identical to the logic used in the normal update path,
            // so we'll just enter that. The only difference is we'll bail out
            // at the next level instead of this one, because the child props
            // have not changed. Which is fine.
            // TODO: Probably should refactor `beginWork` to split the bailout
            // path from the normal path. I'm tempted to do a labeled break here
            // but I won't :)
            workInProgress.lanes = NoLanes;
            return updateOffscreenComponent(current, workInProgress, renderLanes);
          }
      }

      return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
    } else {
      if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
        // This is a special case that only exists for legacy mode.
        // See https://github.com/facebook/react/pull/19216.
        didReceiveUpdate = true;
      } else {
        // An update was scheduled on this fiber, but there are no new props
        // nor legacy context. Set this to false. If an update queue or context
        // consumer produces a changed value, it will set this to true. Otherwise,
        // the component will assume the children have not changed and bail out.
        didReceiveUpdate = false;
      }
    }
  } else {
    didReceiveUpdate = false;
  } // Before entering the begin phase, clear pending update priority.
  // TODO: This assumes that we're about to evaluate the component and process
  // the update queue. However, there's an exception: SimpleMemoComponent
  // sometimes bails out later in the begin phase. This indicates that we should
  // move this assignment out of the common path and into each branch.


  workInProgress.lanes = NoLanes;

  switch (workInProgress.tag) {
    case IndeterminateComponent:
      {
        return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes);
      }

    case LazyComponent:
      {
        var elementType = workInProgress.elementType;
        return mountLazyComponent(current, workInProgress, elementType, updateLanes, renderLanes);
      }

    case FunctionComponent:
      {
        var _Component = workInProgress.type;
        var unresolvedProps = workInProgress.pendingProps;
        var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
        return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderLanes);
      }

    case ClassComponent:
      {
        var _Component2 = workInProgress.type;
        var _unresolvedProps = workInProgress.pendingProps;

        var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);

        return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderLanes);
      }

    case HostRoot:
      return updateHostRoot(current, workInProgress, renderLanes);

    case HostComponent:
      return updateHostComponent(current, workInProgress, renderLanes);

    case HostText:
      return updateHostText(current, workInProgress);

    case SuspenseComponent:
      return updateSuspenseComponent(current, workInProgress, renderLanes);

    case HostPortal:
      return updatePortalComponent(current, workInProgress, renderLanes);

    case ForwardRef:
      {
        var type = workInProgress.type;
        var _unresolvedProps2 = workInProgress.pendingProps;

        var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);

        return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderLanes);
      }

    case Fragment:
      return updateFragment(current, workInProgress, renderLanes);

    case Mode:
      return updateMode(current, workInProgress, renderLanes);

    case Profiler:
      return updateProfiler(current, workInProgress, renderLanes);

    case ContextProvider:
      return updateContextProvider(current, workInProgress, renderLanes);

    case ContextConsumer:
      return updateContextConsumer(current, workInProgress, renderLanes);

    case MemoComponent:
      {
        var _type2 = workInProgress.type;
        var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.

        var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);

        {
          if (workInProgress.type !== workInProgress.elementType) {
            var outerPropTypes = _type2.propTypes;

            if (outerPropTypes) {
              checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only
              'prop', getComponentName(_type2));
            }
          }
        }

        _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
        return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateLanes, renderLanes);
      }

    case SimpleMemoComponent:
      {
        return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateLanes, renderLanes);
      }

    case IncompleteClassComponent:
      {
        var _Component3 = workInProgress.type;
        var _unresolvedProps4 = workInProgress.pendingProps;

        var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);

        return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderLanes);
      }

    case SuspenseListComponent:
      {
        return updateSuspenseListComponent(current, workInProgress, renderLanes);
      }

    case FundamentalComponent:
      {

        break;
      }

    case ScopeComponent:
      {

        break;
      }

    case Block:
      {

        break;
      }

    case OffscreenComponent:
      {
        return updateOffscreenComponent(current, workInProgress, renderLanes);
      }

    case LegacyHiddenComponent:
      {
        return updateLegacyHiddenComponent(current, workInProgress, renderLanes);
      }
  }

  {
    {
      throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function markUpdate(workInProgress) {
  // Tag the fiber with an update effect. This turns a Placement into
  // a PlacementAndUpdate.
  workInProgress.flags |= Update;
}

function markRef$1(workInProgress) {
  workInProgress.flags |= Ref;
}

var appendAllChildren;
var updateHostContainer;
var updateHostComponent$1;
var updateHostText$1;

{
  // Mutation mode
  appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
    // We only have the top Fiber that was created but we need recurse down its
    // children to find all the terminal nodes.
    var node = workInProgress.child;

    while (node !== null) {
      if (node.tag === HostComponent || node.tag === HostText) {
        appendInitialChild(parent, node.stateNode);
      } else if (node.tag === HostPortal) ; else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }

      if (node === workInProgress) {
        return;
      }

      while (node.sibling === null) {
        if (node.return === null || node.return === workInProgress) {
          return;
        }

        node = node.return;
      }

      node.sibling.return = node.return;
      node = node.sibling;
    }
  };

  updateHostContainer = function (workInProgress) {// Noop
  };

  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
    // If we have an alternate, that means this is an update and we need to
    // schedule a side-effect to do the updates.
    var oldProps = current.memoizedProps;

    if (oldProps === newProps) {
      // In mutation mode, this is sufficient for a bailout because
      // we won't touch this node even if children changed.
      return;
    } // If we get updated because one of our children updated, we don't
    // have newProps so we'll have to reuse them.
    // TODO: Split the update API as separate for the props vs. children.
    // Even better would be if children weren't special cased at all tho.


    var instance = workInProgress.stateNode;
    var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host
    // component is hitting the resume path. Figure out why. Possibly
    // related to `hidden`.

    var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.

    workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
    // is a new ref we mark this as an update. All the work is done in commitWork.

    if (updatePayload) {
      markUpdate(workInProgress);
    }
  };

  updateHostText$1 = function (current, workInProgress, oldText, newText) {
    // If the text differs, mark it as an update. All the work in done in commitWork.
    if (oldText !== newText) {
      markUpdate(workInProgress);
    }
  };
}

function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
  if (getIsHydrating()) {
    // If we're hydrating, we should consume as many items as we can
    // so we don't leave any behind.
    return;
  }

  switch (renderState.tailMode) {
    case 'hidden':
      {
        // Any insertions at the end of the tail list after this point
        // should be invisible. If there are already mounted boundaries
        // anything before them are not considered for collapsing.
        // Therefore we need to go through the whole tail to find if
        // there are any.
        var tailNode = renderState.tail;
        var lastTailNode = null;

        while (tailNode !== null) {
          if (tailNode.alternate !== null) {
            lastTailNode = tailNode;
          }

          tailNode = tailNode.sibling;
        } // Next we're simply going to delete all insertions after the
        // last rendered item.


        if (lastTailNode === null) {
          // All remaining items in the tail are insertions.
          renderState.tail = null;
        } else {
          // Detach the insertion after the last node that was already
          // inserted.
          lastTailNode.sibling = null;
        }

        break;
      }

    case 'collapsed':
      {
        // Any insertions at the end of the tail list after this point
        // should be invisible. If there are already mounted boundaries
        // anything before them are not considered for collapsing.
        // Therefore we need to go through the whole tail to find if
        // there are any.
        var _tailNode = renderState.tail;
        var _lastTailNode = null;

        while (_tailNode !== null) {
          if (_tailNode.alternate !== null) {
            _lastTailNode = _tailNode;
          }

          _tailNode = _tailNode.sibling;
        } // Next we're simply going to delete all insertions after the
        // last rendered item.


        if (_lastTailNode === null) {
          // All remaining items in the tail are insertions.
          if (!hasRenderedATailFallback && renderState.tail !== null) {
            // We suspended during the head. We want to show at least one
            // row at the tail. So we'll keep on and cut off the rest.
            renderState.tail.sibling = null;
          } else {
            renderState.tail = null;
          }
        } else {
          // Detach the insertion after the last node that was already
          // inserted.
          _lastTailNode.sibling = null;
        }

        break;
      }
  }
}

function completeWork(current, workInProgress, renderLanes) {
  var newProps = workInProgress.pendingProps;

  switch (workInProgress.tag) {
    case IndeterminateComponent:
    case LazyComponent:
    case SimpleMemoComponent:
    case FunctionComponent:
    case ForwardRef:
    case Fragment:
    case Mode:
    case Profiler:
    case ContextConsumer:
    case MemoComponent:
      return null;

    case ClassComponent:
      {
        var Component = workInProgress.type;

        if (isContextProvider(Component)) {
          popContext(workInProgress);
        }

        return null;
      }

    case HostRoot:
      {
        popHostContainer(workInProgress);
        popTopLevelContextObject(workInProgress);
        resetWorkInProgressVersions();
        var fiberRoot = workInProgress.stateNode;

        if (fiberRoot.pendingContext) {
          fiberRoot.context = fiberRoot.pendingContext;
          fiberRoot.pendingContext = null;
        }

        if (current === null || current.child === null) {
          // If we hydrated, pop so that we can delete any remaining children
          // that weren't hydrated.
          var wasHydrated = popHydrationState(workInProgress);

          if (wasHydrated) {
            // If we hydrated, then we'll need to schedule an update for
            // the commit side-effects on the root.
            markUpdate(workInProgress);
          } else if (!fiberRoot.hydrate) {
            // Schedule an effect to clear this container at the start of the next commit.
            // This handles the case of React rendering into a container with previous children.
            // It's also safe to do for updates too, because current.child would only be null
            // if the previous render was null (so the the container would already be empty).
            workInProgress.flags |= Snapshot;
          }
        }

        updateHostContainer(workInProgress);
        return null;
      }

    case HostComponent:
      {
        popHostContext(workInProgress);
        var rootContainerInstance = getRootHostContainer();
        var type = workInProgress.type;

        if (current !== null && workInProgress.stateNode != null) {
          updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);

          if (current.ref !== workInProgress.ref) {
            markRef$1(workInProgress);
          }
        } else {
          if (!newProps) {
            if (!(workInProgress.stateNode !== null)) {
              {
                throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." );
              }
            } // This can happen when we abort work.


            return null;
          }

          var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
          // "stack" as the parent. Then append children as we go in beginWork
          // or completeWork depending on whether we want to add them top->down or
          // bottom->up. Top->down is faster in IE11.

          var _wasHydrated = popHydrationState(workInProgress);

          if (_wasHydrated) {
            // TODO: Move this and createInstance step into the beginPhase
            // to consolidate.
            if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {
              // If changes to the hydrated node need to be applied at the
              // commit-phase we mark this as such.
              markUpdate(workInProgress);
            }
          } else {
            var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);
            appendAllChildren(instance, workInProgress, false, false);
            workInProgress.stateNode = instance; // Certain renderers require commit-time effects for initial mount.
            // (eg DOM renderer supports auto-focus for certain elements).
            // Make sure such renderers get scheduled for later work.

            if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
              markUpdate(workInProgress);
            }
          }

          if (workInProgress.ref !== null) {
            // If there is a ref on a host node we need to schedule a callback
            markRef$1(workInProgress);
          }
        }

        return null;
      }

    case HostText:
      {
        var newText = newProps;

        if (current && workInProgress.stateNode != null) {
          var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need
          // to schedule a side-effect to do the updates.

          updateHostText$1(current, workInProgress, oldText, newText);
        } else {
          if (typeof newText !== 'string') {
            if (!(workInProgress.stateNode !== null)) {
              {
                throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." );
              }
            } // This can happen when we abort work.

          }

          var _rootContainerInstance = getRootHostContainer();

          var _currentHostContext = getHostContext();

          var _wasHydrated2 = popHydrationState(workInProgress);

          if (_wasHydrated2) {
            if (prepareToHydrateHostTextInstance(workInProgress)) {
              markUpdate(workInProgress);
            }
          } else {
            workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);
          }
        }

        return null;
      }

    case SuspenseComponent:
      {
        popSuspenseContext(workInProgress);
        var nextState = workInProgress.memoizedState;

        if ((workInProgress.flags & DidCapture) !== NoFlags) {
          // Something suspended. Re-render with the fallback children.
          workInProgress.lanes = renderLanes; // Do not reset the effect list.

          if ( (workInProgress.mode & ProfileMode) !== NoMode) {
            transferActualDuration(workInProgress);
          }

          return workInProgress;
        }

        var nextDidTimeout = nextState !== null;
        var prevDidTimeout = false;

        if (current === null) {
          if (workInProgress.memoizedProps.fallback !== undefined) {
            popHydrationState(workInProgress);
          }
        } else {
          var prevState = current.memoizedState;
          prevDidTimeout = prevState !== null;
        }

        if (nextDidTimeout && !prevDidTimeout) {
          // If this subtreee is running in blocking mode we can suspend,
          // otherwise we won't suspend.
          // TODO: This will still suspend a synchronous tree if anything
          // in the concurrent tree already suspended during this render.
          // This is a known bug.
          if ((workInProgress.mode & BlockingMode) !== NoMode) {
            // TODO: Move this back to throwException because this is too late
            // if this is a large tree which is common for initial loads. We
            // don't know if we should restart a render or not until we get
            // this marker, and this is too late.
            // If this render already had a ping or lower pri updates,
            // and this is the first time we know we're going to suspend we
            // should be able to immediately restart from within throwException.
            var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;

            if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
              // If this was in an invisible tree or a new render, then showing
              // this boundary is ok.
              renderDidSuspend();
            } else {
              // Otherwise, we're going to have to hide content so we should
              // suspend for longer if possible.
              renderDidSuspendDelayIfPossible();
            }
          }
        }

        {
          // TODO: Only schedule updates if these values are non equal, i.e. it changed.
          if (nextDidTimeout || prevDidTimeout) {
            // If this boundary just timed out, schedule an effect to attach a
            // retry listener to the promise. This flag is also used to hide the
            // primary children. In mutation mode, we also need the flag to
            // *unhide* children that were previously hidden, so check if this
            // is currently timed out, too.
            workInProgress.flags |= Update;
          }
        }

        return null;
      }

    case HostPortal:
      popHostContainer(workInProgress);
      updateHostContainer(workInProgress);

      if (current === null) {
        preparePortalMount(workInProgress.stateNode.containerInfo);
      }

      return null;

    case ContextProvider:
      // Pop provider fiber
      popProvider(workInProgress);
      return null;

    case IncompleteClassComponent:
      {
        // Same as class component case. I put it down here so that the tags are
        // sequential to ensure this switch is compiled to a jump table.
        var _Component = workInProgress.type;

        if (isContextProvider(_Component)) {
          popContext(workInProgress);
        }

        return null;
      }

    case SuspenseListComponent:
      {
        popSuspenseContext(workInProgress);
        var renderState = workInProgress.memoizedState;

        if (renderState === null) {
          // We're running in the default, "independent" mode.
          // We don't do anything in this mode.
          return null;
        }

        var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags;
        var renderedTail = renderState.rendering;

        if (renderedTail === null) {
          // We just rendered the head.
          if (!didSuspendAlready) {
            // This is the first pass. We need to figure out if anything is still
            // suspended in the rendered set.
            // If new content unsuspended, but there's still some content that
            // didn't. Then we need to do a second pass that forces everything
            // to keep showing their fallbacks.
            // We might be suspended if something in this render pass suspended, or
            // something in the previous committed pass suspended. Otherwise,
            // there's no chance so we can skip the expensive call to
            // findFirstSuspended.
            var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags);

            if (!cannotBeSuspended) {
              var row = workInProgress.child;

              while (row !== null) {
                var suspended = findFirstSuspended(row);

                if (suspended !== null) {
                  didSuspendAlready = true;
                  workInProgress.flags |= DidCapture;
                  cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as
                  // part of the second pass. In that case nothing will subscribe to
                  // its thennables. Instead, we'll transfer its thennables to the
                  // SuspenseList so that it can retry if they resolve.
                  // There might be multiple of these in the list but since we're
                  // going to wait for all of them anyway, it doesn't really matter
                  // which ones gets to ping. In theory we could get clever and keep
                  // track of how many dependencies remain but it gets tricky because
                  // in the meantime, we can add/remove/change items and dependencies.
                  // We might bail out of the loop before finding any but that
                  // doesn't matter since that means that the other boundaries that
                  // we did find already has their listeners attached.

                  var newThennables = suspended.updateQueue;

                  if (newThennables !== null) {
                    workInProgress.updateQueue = newThennables;
                    workInProgress.flags |= Update;
                  } // Rerender the whole list, but this time, we'll force fallbacks
                  // to stay in place.
                  // Reset the effect list before doing the second pass since that's now invalid.


                  if (renderState.lastEffect === null) {
                    workInProgress.firstEffect = null;
                  }

                  workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state.

                  resetChildFibers(workInProgress, renderLanes); // Set up the Suspense Context to force suspense and immediately
                  // rerender the children.

                  pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
                  return workInProgress.child;
                }

                row = row.sibling;
              }
            }

            if (renderState.tail !== null && now() > getRenderTargetTime()) {
              // We have already passed our CPU deadline but we still have rows
              // left in the tail. We'll just give up further attempts to render
              // the main content and only render fallbacks.
              workInProgress.flags |= DidCapture;
              didSuspendAlready = true;
              cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this
              // to get it started back up to attempt the next item. While in terms
              // of priority this work has the same priority as this current render,
              // it's not part of the same transition once the transition has
              // committed. If it's sync, we still want to yield so that it can be
              // painted. Conceptually, this is really the same as pinging.
              // We can use any RetryLane even if it's the one currently rendering
              // since we're leaving it behind on this node.

              workInProgress.lanes = SomeRetryLane;

              {
                markSpawnedWork(SomeRetryLane);
              }
            }
          } else {
            cutOffTailIfNeeded(renderState, false);
          } // Next we're going to render the tail.

        } else {
          // Append the rendered row to the child list.
          if (!didSuspendAlready) {
            var _suspended = findFirstSuspended(renderedTail);

            if (_suspended !== null) {
              workInProgress.flags |= DidCapture;
              didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't
              // get lost if this row ends up dropped during a second pass.

              var _newThennables = _suspended.updateQueue;

              if (_newThennables !== null) {
                workInProgress.updateQueue = _newThennables;
                workInProgress.flags |= Update;
              }

              cutOffTailIfNeeded(renderState, true); // This might have been modified.

              if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate && !getIsHydrating() // We don't cut it if we're hydrating.
              ) {
                  // We need to delete the row we just rendered.
                  // Reset the effect list to what it was before we rendered this
                  // child. The nested children have already appended themselves.
                  var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.

                  if (lastEffect !== null) {
                    lastEffect.nextEffect = null;
                  } // We're done.


                  return null;
                }
            } else if ( // The time it took to render last row is greater than the remaining
            // time we have to render. So rendering one more row would likely
            // exceed it.
            now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes !== OffscreenLane) {
              // We have now passed our CPU deadline and we'll just give up further
              // attempts to render the main content and only render fallbacks.
              // The assumption is that this is usually faster.
              workInProgress.flags |= DidCapture;
              didSuspendAlready = true;
              cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this
              // to get it started back up to attempt the next item. While in terms
              // of priority this work has the same priority as this current render,
              // it's not part of the same transition once the transition has
              // committed. If it's sync, we still want to yield so that it can be
              // painted. Conceptually, this is really the same as pinging.
              // We can use any RetryLane even if it's the one currently rendering
              // since we're leaving it behind on this node.

              workInProgress.lanes = SomeRetryLane;

              {
                markSpawnedWork(SomeRetryLane);
              }
            }
          }

          if (renderState.isBackwards) {
            // The effect list of the backwards tail will have been added
            // to the end. This breaks the guarantee that life-cycles fire in
            // sibling order but that isn't a strong guarantee promised by React.
            // Especially since these might also just pop in during future commits.
            // Append to the beginning of the list.
            renderedTail.sibling = workInProgress.child;
            workInProgress.child = renderedTail;
          } else {
            var previousSibling = renderState.last;

            if (previousSibling !== null) {
              previousSibling.sibling = renderedTail;
            } else {
              workInProgress.child = renderedTail;
            }

            renderState.last = renderedTail;
          }
        }

        if (renderState.tail !== null) {
          // We still have tail rows to render.
          // Pop a row.
          var next = renderState.tail;
          renderState.rendering = next;
          renderState.tail = next.sibling;
          renderState.lastEffect = workInProgress.lastEffect;
          renderState.renderingStartTime = now();
          next.sibling = null; // Restore the context.
          // TODO: We can probably just avoid popping it instead and only
          // setting it the first time we go from not suspended to suspended.

          var suspenseContext = suspenseStackCursor.current;

          if (didSuspendAlready) {
            suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
          } else {
            suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
          }

          pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.

          return next;
        }

        return null;
      }

    case FundamentalComponent:
      {

        break;
      }

    case ScopeComponent:
      {

        break;
      }

    case Block:

      break;

    case OffscreenComponent:
    case LegacyHiddenComponent:
      {
        popRenderLanes(workInProgress);

        if (current !== null) {
          var _nextState = workInProgress.memoizedState;
          var _prevState = current.memoizedState;
          var prevIsHidden = _prevState !== null;
          var nextIsHidden = _nextState !== null;

          if (prevIsHidden !== nextIsHidden && newProps.mode !== 'unstable-defer-without-hiding') {
            workInProgress.flags |= Update;
          }
        }

        return null;
      }
  }

  {
    {
      throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function unwindWork(workInProgress, renderLanes) {
  switch (workInProgress.tag) {
    case ClassComponent:
      {
        var Component = workInProgress.type;

        if (isContextProvider(Component)) {
          popContext(workInProgress);
        }

        var flags = workInProgress.flags;

        if (flags & ShouldCapture) {
          workInProgress.flags = flags & ~ShouldCapture | DidCapture;

          if ( (workInProgress.mode & ProfileMode) !== NoMode) {
            transferActualDuration(workInProgress);
          }

          return workInProgress;
        }

        return null;
      }

    case HostRoot:
      {
        popHostContainer(workInProgress);
        popTopLevelContextObject(workInProgress);
        resetWorkInProgressVersions();
        var _flags = workInProgress.flags;

        if (!((_flags & DidCapture) === NoFlags)) {
          {
            throw Error( "The root failed to unmount after an error. This is likely a bug in React. Please file an issue." );
          }
        }

        workInProgress.flags = _flags & ~ShouldCapture | DidCapture;
        return workInProgress;
      }

    case HostComponent:
      {
        // TODO: popHydrationState
        popHostContext(workInProgress);
        return null;
      }

    case SuspenseComponent:
      {
        popSuspenseContext(workInProgress);

        var _flags2 = workInProgress.flags;

        if (_flags2 & ShouldCapture) {
          workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.

          if ( (workInProgress.mode & ProfileMode) !== NoMode) {
            transferActualDuration(workInProgress);
          }

          return workInProgress;
        }

        return null;
      }

    case SuspenseListComponent:
      {
        popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been
        // caught by a nested boundary. If not, it should bubble through.

        return null;
      }

    case HostPortal:
      popHostContainer(workInProgress);
      return null;

    case ContextProvider:
      popProvider(workInProgress);
      return null;

    case OffscreenComponent:
    case LegacyHiddenComponent:
      popRenderLanes(workInProgress);
      return null;

    default:
      return null;
  }
}

function unwindInterruptedWork(interruptedWork) {
  switch (interruptedWork.tag) {
    case ClassComponent:
      {
        var childContextTypes = interruptedWork.type.childContextTypes;

        if (childContextTypes !== null && childContextTypes !== undefined) {
          popContext(interruptedWork);
        }

        break;
      }

    case HostRoot:
      {
        popHostContainer(interruptedWork);
        popTopLevelContextObject(interruptedWork);
        resetWorkInProgressVersions();
        break;
      }

    case HostComponent:
      {
        popHostContext(interruptedWork);
        break;
      }

    case HostPortal:
      popHostContainer(interruptedWork);
      break;

    case SuspenseComponent:
      popSuspenseContext(interruptedWork);
      break;

    case SuspenseListComponent:
      popSuspenseContext(interruptedWork);
      break;

    case ContextProvider:
      popProvider(interruptedWork);
      break;

    case OffscreenComponent:
    case LegacyHiddenComponent:
      popRenderLanes(interruptedWork);
      break;
  }
}

function createCapturedValue(value, source) {
  // If the value is an error, call this function immediately after it is thrown
  // so the stack is accurate.
  return {
    value: value,
    source: source,
    stack: getStackByFiberInDevAndProd(source)
  };
}

// This module is forked in different environments.
// By default, return `true` to log errors to the console.
// Forks can return `false` if this isn't desirable.
function showErrorDialog(boundary, errorInfo) {
  return true;
}

function logCapturedError(boundary, errorInfo) {
  try {
    var logError = showErrorDialog(boundary, errorInfo); // Allow injected showErrorDialog() to prevent default console.error logging.
    // This enables renderers like ReactNative to better manage redbox behavior.

    if (logError === false) {
      return;
    }

    var error = errorInfo.value;

    if (true) {
      var source = errorInfo.source;
      var stack = errorInfo.stack;
      var componentStack = stack !== null ? stack : ''; // Browsers support silencing uncaught errors by calling
      // `preventDefault()` in window `error` handler.
      // We record this information as an expando on the error.

      if (error != null && error._suppressLogging) {
        if (boundary.tag === ClassComponent) {
          // The error is recoverable and was silenced.
          // Ignore it and don't print the stack addendum.
          // This is handy for testing error boundaries without noise.
          return;
        } // The error is fatal. Since the silencing might have
        // been accidental, we'll surface it anyway.
        // However, the browser would have silenced the original error
        // so we'll print it first, and then print the stack addendum.


        console['error'](error); // Don't transform to our wrapper
        // For a more detailed description of this block, see:
        // https://github.com/facebook/react/pull/13384
      }

      var componentName = source ? getComponentName(source.type) : null;
      var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : 'The above error occurred in one of your React components:';
      var errorBoundaryMessage;
      var errorBoundaryName = getComponentName(boundary.type);

      if (errorBoundaryName) {
        errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
      } else {
        errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.';
      }

      var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.
      // We don't include the original error message and JS stack because the browser
      // has already printed it. Even if the application swallows the error, it is still
      // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.

      console['error'](combinedMessage); // Don't transform to our wrapper
    } else {}
  } catch (e) {
    // This method must not throw, or React internal state will get messed up.
    // If console.error is overridden, or logCapturedError() shows a dialog that throws,
    // we want to report this error outside of the normal stack as a last resort.
    // https://github.com/facebook/react/issues/13188
    setTimeout(function () {
      throw e;
    });
  }
}

var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;

function createRootErrorUpdate(fiber, errorInfo, lane) {
  var update = createUpdate(NoTimestamp, lane); // Unmount the root by rendering null.

  update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property
  // being called "element".

  update.payload = {
    element: null
  };
  var error = errorInfo.value;

  update.callback = function () {
    onUncaughtError(error);
    logCapturedError(fiber, errorInfo);
  };

  return update;
}

function createClassErrorUpdate(fiber, errorInfo, lane) {
  var update = createUpdate(NoTimestamp, lane);
  update.tag = CaptureUpdate;
  var getDerivedStateFromError = fiber.type.getDerivedStateFromError;

  if (typeof getDerivedStateFromError === 'function') {
    var error$1 = errorInfo.value;

    update.payload = function () {
      logCapturedError(fiber, errorInfo);
      return getDerivedStateFromError(error$1);
    };
  }

  var inst = fiber.stateNode;

  if (inst !== null && typeof inst.componentDidCatch === 'function') {
    update.callback = function callback() {
      {
        markFailedErrorBoundaryForHotReloading(fiber);
      }

      if (typeof getDerivedStateFromError !== 'function') {
        // To preserve the preexisting retry behavior of error boundaries,
        // we keep track of which ones already failed during this batch.
        // This gets reset before we yield back to the browser.
        // TODO: Warn in strict mode if getDerivedStateFromError is
        // not defined.
        markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined

        logCapturedError(fiber, errorInfo);
      }

      var error$1 = errorInfo.value;
      var stack = errorInfo.stack;
      this.componentDidCatch(error$1, {
        componentStack: stack !== null ? stack : ''
      });

      {
        if (typeof getDerivedStateFromError !== 'function') {
          // If componentDidCatch is the only error boundary method defined,
          // then it needs to call setState to recover from errors.
          // If no state update is scheduled then the boundary will swallow the error.
          if (!includesSomeLane(fiber.lanes, SyncLane)) {
            error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown');
          }
        }
      }
    };
  } else {
    update.callback = function () {
      markFailedErrorBoundaryForHotReloading(fiber);
    };
  }

  return update;
}

function attachPingListener(root, wakeable, lanes) {
  // Attach a listener to the promise to "ping" the root and retry. But only if
  // one does not already exist for the lanes we're currently rendering (which
  // acts like a "thread ID" here).
  var pingCache = root.pingCache;
  var threadIDs;

  if (pingCache === null) {
    pingCache = root.pingCache = new PossiblyWeakMap$1();
    threadIDs = new Set();
    pingCache.set(wakeable, threadIDs);
  } else {
    threadIDs = pingCache.get(wakeable);

    if (threadIDs === undefined) {
      threadIDs = new Set();
      pingCache.set(wakeable, threadIDs);
    }
  }

  if (!threadIDs.has(lanes)) {
    // Memoize using the thread ID to prevent redundant listeners.
    threadIDs.add(lanes);
    var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes);
    wakeable.then(ping, ping);
  }
}

function throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) {
  // The source fiber did not complete.
  sourceFiber.flags |= Incomplete; // Its effect list is no longer valid.

  sourceFiber.firstEffect = sourceFiber.lastEffect = null;

  if (value !== null && typeof value === 'object' && typeof value.then === 'function') {
    // This is a wakeable.
    var wakeable = value;

    if ((sourceFiber.mode & BlockingMode) === NoMode) {
      // Reset the memoizedState to what it was before we attempted
      // to render it.
      var currentSource = sourceFiber.alternate;

      if (currentSource) {
        sourceFiber.updateQueue = currentSource.updateQueue;
        sourceFiber.memoizedState = currentSource.memoizedState;
        sourceFiber.lanes = currentSource.lanes;
      } else {
        sourceFiber.updateQueue = null;
        sourceFiber.memoizedState = null;
      }
    }

    var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view.

    var _workInProgress = returnFiber;

    do {
      if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
        // Found the nearest boundary.
        // Stash the promise on the boundary fiber. If the boundary times out, we'll
        // attach another listener to flip the boundary back to its normal state.
        var wakeables = _workInProgress.updateQueue;

        if (wakeables === null) {
          var updateQueue = new Set();
          updateQueue.add(wakeable);
          _workInProgress.updateQueue = updateQueue;
        } else {
          wakeables.add(wakeable);
        } // If the boundary is outside of blocking mode, we should *not*
        // suspend the commit. Pretend as if the suspended component rendered
        // null and keep rendering. In the commit phase, we'll schedule a
        // subsequent synchronous update to re-render the Suspense.
        //
        // Note: It doesn't matter whether the component that suspended was
        // inside a blocking mode tree. If the Suspense is outside of it, we
        // should *not* suspend the commit.


        if ((_workInProgress.mode & BlockingMode) === NoMode) {
          _workInProgress.flags |= DidCapture;
          sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.
          // But we shouldn't call any lifecycle methods or callbacks. Remove
          // all lifecycle effect tags.

          sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);

          if (sourceFiber.tag === ClassComponent) {
            var currentSourceFiber = sourceFiber.alternate;

            if (currentSourceFiber === null) {
              // This is a new mount. Change the tag so it's not mistaken for a
              // completed class component. For example, we should not call
              // componentWillUnmount if it is deleted.
              sourceFiber.tag = IncompleteClassComponent;
            } else {
              // When we try rendering again, we should not reuse the current fiber,
              // since it's known to be in an inconsistent state. Use a force update to
              // prevent a bail out.
              var update = createUpdate(NoTimestamp, SyncLane);
              update.tag = ForceUpdate;
              enqueueUpdate(sourceFiber, update);
            }
          } // The source fiber did not complete. Mark it with Sync priority to
          // indicate that it still has pending work.


          sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane); // Exit without suspending.

          return;
        } // Confirmed that the boundary is in a concurrent mode tree. Continue
        // with the normal suspend path.
        //
        // After this we'll use a set of heuristics to determine whether this
        // render pass will run to completion or restart or "suspend" the commit.
        // The actual logic for this is spread out in different places.
        //
        // This first principle is that if we're going to suspend when we complete
        // a root, then we should also restart if we get an update or ping that
        // might unsuspend it, and vice versa. The only reason to suspend is
        // because you think you might want to restart before committing. However,
        // it doesn't make sense to restart only while in the period we're suspended.
        //
        // Restarting too aggressively is also not good because it starves out any
        // intermediate loading state. So we use heuristics to determine when.
        // Suspense Heuristics
        //
        // If nothing threw a Promise or all the same fallbacks are already showing,
        // then don't suspend/restart.
        //
        // If this is an initial render of a new tree of Suspense boundaries and
        // those trigger a fallback, then don't suspend/restart. We want to ensure
        // that we can show the initial loading state as quickly as possible.
        //
        // If we hit a "Delayed" case, such as when we'd switch from content back into
        // a fallback, then we should always suspend/restart. Transitions apply
        // to this case. If none is defined, JND is used instead.
        //
        // If we're already showing a fallback and it gets "retried", allowing us to show
        // another level, but there's still an inner boundary that would show a fallback,
        // then we suspend/restart for 500ms since the last time we showed a fallback
        // anywhere in the tree. This effectively throttles progressive loading into a
        // consistent train of commits. This also gives us an opportunity to restart to
        // get to the completed state slightly earlier.
        //
        // If there's ambiguity due to batching it's resolved in preference of:
        // 1) "delayed", 2) "initial render", 3) "retry".
        //
        // We want to ensure that a "busy" state doesn't get force committed. We want to
        // ensure that new initial loading states can commit as soon as possible.


        attachPingListener(root, wakeable, rootRenderLanes);
        _workInProgress.flags |= ShouldCapture;
        _workInProgress.lanes = rootRenderLanes;
        return;
      } // This boundary already captured during this render. Continue to the next
      // boundary.


      _workInProgress = _workInProgress.return;
    } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode.
    // TODO: Use invariant so the message is stripped in prod?


    value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.');
  } // We didn't find a boundary that could handle this type of exception. Start
  // over and traverse parent path again, this time treating the exception
  // as an error.


  renderDidError();
  value = createCapturedValue(value, sourceFiber);
  var workInProgress = returnFiber;

  do {
    switch (workInProgress.tag) {
      case HostRoot:
        {
          var _errorInfo = value;
          workInProgress.flags |= ShouldCapture;
          var lane = pickArbitraryLane(rootRenderLanes);
          workInProgress.lanes = mergeLanes(workInProgress.lanes, lane);

          var _update = createRootErrorUpdate(workInProgress, _errorInfo, lane);

          enqueueCapturedUpdate(workInProgress, _update);
          return;
        }

      case ClassComponent:
        // Capture and retry
        var errorInfo = value;
        var ctor = workInProgress.type;
        var instance = workInProgress.stateNode;

        if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
          workInProgress.flags |= ShouldCapture;

          var _lane = pickArbitraryLane(rootRenderLanes);

          workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state

          var _update2 = createClassErrorUpdate(workInProgress, errorInfo, _lane);

          enqueueCapturedUpdate(workInProgress, _update2);
          return;
        }

        break;
    }

    workInProgress = workInProgress.return;
  } while (workInProgress !== null);
}

var didWarnAboutUndefinedSnapshotBeforeUpdate = null;

{
  didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
}

var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;

var callComponentWillUnmountWithTimer = function (current, instance) {
  instance.props = current.memoizedProps;
  instance.state = current.memoizedState;

  {
    instance.componentWillUnmount();
  }
}; // Capture errors so they don't interrupt unmounting.


function safelyCallComponentWillUnmount(current, instance) {
  {
    invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);

    if (hasCaughtError()) {
      var unmountError = clearCaughtError();
      captureCommitPhaseError(current, unmountError);
    }
  }
}

function safelyDetachRef(current) {
  var ref = current.ref;

  if (ref !== null) {
    if (typeof ref === 'function') {
      {
        invokeGuardedCallback(null, ref, null, null);

        if (hasCaughtError()) {
          var refError = clearCaughtError();
          captureCommitPhaseError(current, refError);
        }
      }
    } else {
      ref.current = null;
    }
  }
}

function safelyCallDestroy(current, destroy) {
  {
    invokeGuardedCallback(null, destroy, null);

    if (hasCaughtError()) {
      var error = clearCaughtError();
      captureCommitPhaseError(current, error);
    }
  }
}

function commitBeforeMutationLifeCycles(current, finishedWork) {
  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case SimpleMemoComponent:
    case Block:
      {
        return;
      }

    case ClassComponent:
      {
        if (finishedWork.flags & Snapshot) {
          if (current !== null) {
            var prevProps = current.memoizedProps;
            var prevState = current.memoizedState;
            var instance = finishedWork.stateNode; // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.

            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                if (instance.props !== finishedWork.memoizedProps) {
                  error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }

                if (instance.state !== finishedWork.memoizedState) {
                  error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }
              }
            }

            var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);

            {
              var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;

              if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
                didWarnSet.add(finishedWork.type);

                error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));
              }
            }

            instance.__reactInternalSnapshotBeforeUpdate = snapshot;
          }
        }

        return;
      }

    case HostRoot:
      {
        {
          if (finishedWork.flags & Snapshot) {
            var root = finishedWork.stateNode;
            clearContainer(root.containerInfo);
          }
        }

        return;
      }

    case HostComponent:
    case HostText:
    case HostPortal:
    case IncompleteClassComponent:
      // Nothing to do for these component types
      return;
  }

  {
    {
      throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function commitHookEffectListUnmount(tag, finishedWork) {
  var updateQueue = finishedWork.updateQueue;
  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;

  if (lastEffect !== null) {
    var firstEffect = lastEffect.next;
    var effect = firstEffect;

    do {
      if ((effect.tag & tag) === tag) {
        // Unmount
        var destroy = effect.destroy;
        effect.destroy = undefined;

        if (destroy !== undefined) {
          destroy();
        }
      }

      effect = effect.next;
    } while (effect !== firstEffect);
  }
}

function commitHookEffectListMount(tag, finishedWork) {
  var updateQueue = finishedWork.updateQueue;
  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;

  if (lastEffect !== null) {
    var firstEffect = lastEffect.next;
    var effect = firstEffect;

    do {
      if ((effect.tag & tag) === tag) {
        // Mount
        var create = effect.create;
        effect.destroy = create();

        {
          var destroy = effect.destroy;

          if (destroy !== undefined && typeof destroy !== 'function') {
            var addendum = void 0;

            if (destroy === null) {
              addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';
            } else if (typeof destroy.then === 'function') {
              addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + '  async function fetchData() {\n' + '    // You can await here\n' + '    const response = await MyAPI.getData(someId);\n' + '    // ...\n' + '  }\n' + '  fetchData();\n' + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + 'Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching';
            } else {
              addendum = ' You returned: ' + destroy;
            }

            error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s', addendum);
          }
        }
      }

      effect = effect.next;
    } while (effect !== firstEffect);
  }
}

function schedulePassiveEffects(finishedWork) {
  var updateQueue = finishedWork.updateQueue;
  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;

  if (lastEffect !== null) {
    var firstEffect = lastEffect.next;
    var effect = firstEffect;

    do {
      var _effect = effect,
          next = _effect.next,
          tag = _effect.tag;

      if ((tag & Passive$1) !== NoFlags$1 && (tag & HasEffect) !== NoFlags$1) {
        enqueuePendingPassiveHookEffectUnmount(finishedWork, effect);
        enqueuePendingPassiveHookEffectMount(finishedWork, effect);
      }

      effect = next;
    } while (effect !== firstEffect);
  }
}

function commitLifeCycles(finishedRoot, current, finishedWork, committedLanes) {
  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case SimpleMemoComponent:
    case Block:
      {
        // At this point layout effects have already been destroyed (during mutation phase).
        // This is done to prevent sibling component effects from interfering with each other,
        // e.g. a destroy function in one component should never override a ref set
        // by a create function in another component during the same commit.
        {
          commitHookEffectListMount(Layout | HasEffect, finishedWork);
        }

        schedulePassiveEffects(finishedWork);
        return;
      }

    case ClassComponent:
      {
        var instance = finishedWork.stateNode;

        if (finishedWork.flags & Update) {
          if (current === null) {
            // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.
            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                if (instance.props !== finishedWork.memoizedProps) {
                  error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }

                if (instance.state !== finishedWork.memoizedState) {
                  error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }
              }
            }

            {
              instance.componentDidMount();
            }
          } else {
            var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);
            var prevState = current.memoizedState; // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.

            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                if (instance.props !== finishedWork.memoizedProps) {
                  error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }

                if (instance.state !== finishedWork.memoizedState) {
                  error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
                }
              }
            }

            {
              instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
            }
          }
        } // TODO: I think this is now always non-null by the time it reaches the
        // commit phase. Consider removing the type check.


        var updateQueue = finishedWork.updateQueue;

        if (updateQueue !== null) {
          {
            if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
              if (instance.props !== finishedWork.memoizedProps) {
                error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
              }

              if (instance.state !== finishedWork.memoizedState) {
                error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
              }
            }
          } // We could update instance props and state here,
          // but instead we rely on them being set during last render.
          // TODO: revisit this when we implement resuming.


          commitUpdateQueue(finishedWork, updateQueue, instance);
        }

        return;
      }

    case HostRoot:
      {
        // TODO: I think this is now always non-null by the time it reaches the
        // commit phase. Consider removing the type check.
        var _updateQueue = finishedWork.updateQueue;

        if (_updateQueue !== null) {
          var _instance = null;

          if (finishedWork.child !== null) {
            switch (finishedWork.child.tag) {
              case HostComponent:
                _instance = getPublicInstance(finishedWork.child.stateNode);
                break;

              case ClassComponent:
                _instance = finishedWork.child.stateNode;
                break;
            }
          }

          commitUpdateQueue(finishedWork, _updateQueue, _instance);
        }

        return;
      }

    case HostComponent:
      {
        var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted
        // (eg DOM renderer may schedule auto-focus for inputs and form controls).
        // These effects should only be committed when components are first mounted,
        // aka when there is no current/alternate.

        if (current === null && finishedWork.flags & Update) {
          var type = finishedWork.type;
          var props = finishedWork.memoizedProps;
          commitMount(_instance2, type, props);
        }

        return;
      }

    case HostText:
      {
        // We have no life-cycles associated with text.
        return;
      }

    case HostPortal:
      {
        // We have no life-cycles associated with portals.
        return;
      }

    case Profiler:
      {
        {
          var _finishedWork$memoize2 = finishedWork.memoizedProps,
              onCommit = _finishedWork$memoize2.onCommit,
              onRender = _finishedWork$memoize2.onRender;
          var effectDuration = finishedWork.stateNode.effectDuration;
          var commitTime = getCommitTime();

          if (typeof onRender === 'function') {
            {
              onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime, finishedRoot.memoizedInteractions);
            }
          }
        }

        return;
      }

    case SuspenseComponent:
      {
        commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
        return;
      }

    case SuspenseListComponent:
    case IncompleteClassComponent:
    case FundamentalComponent:
    case ScopeComponent:
    case OffscreenComponent:
    case LegacyHiddenComponent:
      return;
  }

  {
    {
      throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function hideOrUnhideAllChildren(finishedWork, isHidden) {
  {
    // We only have the top Fiber that was inserted but we need to recurse down its
    // children to find all the terminal nodes.
    var node = finishedWork;

    while (true) {
      if (node.tag === HostComponent) {
        var instance = node.stateNode;

        if (isHidden) {
          hideInstance(instance);
        } else {
          unhideInstance(node.stateNode, node.memoizedProps);
        }
      } else if (node.tag === HostText) {
        var _instance3 = node.stateNode;

        if (isHidden) {
          hideTextInstance(_instance3);
        } else {
          unhideTextInstance(_instance3, node.memoizedProps);
        }
      } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ; else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }

      if (node === finishedWork) {
        return;
      }

      while (node.sibling === null) {
        if (node.return === null || node.return === finishedWork) {
          return;
        }

        node = node.return;
      }

      node.sibling.return = node.return;
      node = node.sibling;
    }
  }
}

function commitAttachRef(finishedWork) {
  var ref = finishedWork.ref;

  if (ref !== null) {
    var instance = finishedWork.stateNode;
    var instanceToUse;

    switch (finishedWork.tag) {
      case HostComponent:
        instanceToUse = getPublicInstance(instance);
        break;

      default:
        instanceToUse = instance;
    } // Moved outside to ensure DCE works with this flag

    if (typeof ref === 'function') {
      ref(instanceToUse);
    } else {
      {
        if (!ref.hasOwnProperty('current')) {
          error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().', getComponentName(finishedWork.type));
        }
      }

      ref.current = instanceToUse;
    }
  }
}

function commitDetachRef(current) {
  var currentRef = current.ref;

  if (currentRef !== null) {
    if (typeof currentRef === 'function') {
      currentRef(null);
    } else {
      currentRef.current = null;
    }
  }
} // User-originating errors (lifecycles and refs) should not interrupt
// deletion, so don't let them throw. Host-originating errors should
// interrupt deletion, so it's okay


function commitUnmount(finishedRoot, current, renderPriorityLevel) {
  onCommitUnmount(current);

  switch (current.tag) {
    case FunctionComponent:
    case ForwardRef:
    case MemoComponent:
    case SimpleMemoComponent:
    case Block:
      {
        var updateQueue = current.updateQueue;

        if (updateQueue !== null) {
          var lastEffect = updateQueue.lastEffect;

          if (lastEffect !== null) {
            var firstEffect = lastEffect.next;
            var effect = firstEffect;

            do {
              var _effect2 = effect,
                  destroy = _effect2.destroy,
                  tag = _effect2.tag;

              if (destroy !== undefined) {
                if ((tag & Passive$1) !== NoFlags$1) {
                  enqueuePendingPassiveHookEffectUnmount(current, effect);
                } else {
                  {
                    safelyCallDestroy(current, destroy);
                  }
                }
              }

              effect = effect.next;
            } while (effect !== firstEffect);
          }
        }

        return;
      }

    case ClassComponent:
      {
        safelyDetachRef(current);
        var instance = current.stateNode;

        if (typeof instance.componentWillUnmount === 'function') {
          safelyCallComponentWillUnmount(current, instance);
        }

        return;
      }

    case HostComponent:
      {
        safelyDetachRef(current);
        return;
      }

    case HostPortal:
      {
        // TODO: this is recursive.
        // We are also not using this parent because
        // the portal will get pushed immediately.
        {
          unmountHostComponents(finishedRoot, current);
        }

        return;
      }

    case FundamentalComponent:
      {

        return;
      }

    case DehydratedFragment:
      {

        return;
      }

    case ScopeComponent:
      {

        return;
      }
  }
}

function commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {
  // While we're inside a removed host node we don't want to call
  // removeChild on the inner nodes because they're removed by the top
  // call anyway. We also want to call componentWillUnmount on all
  // composites before this host node is removed from the tree. Therefore
  // we do an inner loop while we're still inside the host node.
  var node = root;

  while (true) {
    commitUnmount(finishedRoot, node); // Visit children because they may contain more composite or host nodes.
    // Skip portals because commitUnmount() currently visits them recursively.

    if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.
    // If we don't use mutation we drill down into portals here instead.
     node.tag !== HostPortal)) {
      node.child.return = node;
      node = node.child;
      continue;
    }

    if (node === root) {
      return;
    }

    while (node.sibling === null) {
      if (node.return === null || node.return === root) {
        return;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function detachFiberMutation(fiber) {
  // Cut off the return pointers to disconnect it from the tree. Ideally, we
  // should clear the child pointer of the parent alternate to let this
  // get GC:ed but we don't know which for sure which parent is the current
  // one so we'll settle for GC:ing the subtree of this child. This child
  // itself will be GC:ed when the parent updates the next time.
  // Note: we cannot null out sibling here, otherwise it can cause issues
  // with findDOMNode and how it requires the sibling field to carry out
  // traversal in a later effect. See PR #16820. We now clear the sibling
  // field after effects, see: detachFiberAfterEffects.
  //
  // Don't disconnect stateNode now; it will be detached in detachFiberAfterEffects.
  // It may be required if the current component is an error boundary,
  // and one of its descendants throws while unmounting a passive effect.
  fiber.alternate = null;
  fiber.child = null;
  fiber.dependencies = null;
  fiber.firstEffect = null;
  fiber.lastEffect = null;
  fiber.memoizedProps = null;
  fiber.memoizedState = null;
  fiber.pendingProps = null;
  fiber.return = null;
  fiber.updateQueue = null;

  {
    fiber._debugOwner = null;
  }
}

function getHostParentFiber(fiber) {
  var parent = fiber.return;

  while (parent !== null) {
    if (isHostParent(parent)) {
      return parent;
    }

    parent = parent.return;
  }

  {
    {
      throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function isHostParent(fiber) {
  return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
}

function getHostSibling(fiber) {
  // We're going to search forward into the tree until we find a sibling host
  // node. Unfortunately, if multiple insertions are done in a row we have to
  // search past them. This leads to exponential search for the next sibling.
  // TODO: Find a more efficient way to do this.
  var node = fiber;

  siblings: while (true) {
    // If we didn't find anything, let's try the next sibling.
    while (node.sibling === null) {
      if (node.return === null || isHostParent(node.return)) {
        // If we pop out of the root or hit the parent the fiber we are the
        // last sibling.
        return null;
      }

      node = node.return;
    }

    node.sibling.return = node.return;
    node = node.sibling;

    while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
      // If it is not host node and, we might have a host node inside it.
      // Try to search down until we find one.
      if (node.flags & Placement) {
        // If we don't have a child, try the siblings instead.
        continue siblings;
      } // If we don't have a child, try the siblings instead.
      // We also skip portals because they are not part of this host tree.


      if (node.child === null || node.tag === HostPortal) {
        continue siblings;
      } else {
        node.child.return = node;
        node = node.child;
      }
    } // Check if this host node is stable or about to be placed.


    if (!(node.flags & Placement)) {
      // Found it!
      return node.stateNode;
    }
  }
}

function commitPlacement(finishedWork) {


  var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.

  var parent;
  var isContainer;
  var parentStateNode = parentFiber.stateNode;

  switch (parentFiber.tag) {
    case HostComponent:
      parent = parentStateNode;
      isContainer = false;
      break;

    case HostRoot:
      parent = parentStateNode.containerInfo;
      isContainer = true;
      break;

    case HostPortal:
      parent = parentStateNode.containerInfo;
      isContainer = true;
      break;

    case FundamentalComponent:

    // eslint-disable-next-line-no-fallthrough

    default:
      {
        {
          throw Error( "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." );
        }
      }

  }

  if (parentFiber.flags & ContentReset) {
    // Reset the text content of the parent before doing any insertions
    resetTextContent(parent); // Clear ContentReset from the effect tag

    parentFiber.flags &= ~ContentReset;
  }

  var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its
  // children to find all the terminal nodes.

  if (isContainer) {
    insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);
  } else {
    insertOrAppendPlacementNode(finishedWork, before, parent);
  }
}

function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
  var tag = node.tag;
  var isHost = tag === HostComponent || tag === HostText;

  if (isHost || enableFundamentalAPI ) {
    var stateNode = isHost ? node.stateNode : node.stateNode.instance;

    if (before) {
      insertInContainerBefore(parent, stateNode, before);
    } else {
      appendChildToContainer(parent, stateNode);
    }
  } else if (tag === HostPortal) ; else {
    var child = node.child;

    if (child !== null) {
      insertOrAppendPlacementNodeIntoContainer(child, before, parent);
      var sibling = child.sibling;

      while (sibling !== null) {
        insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
        sibling = sibling.sibling;
      }
    }
  }
}

function insertOrAppendPlacementNode(node, before, parent) {
  var tag = node.tag;
  var isHost = tag === HostComponent || tag === HostText;

  if (isHost || enableFundamentalAPI ) {
    var stateNode = isHost ? node.stateNode : node.stateNode.instance;

    if (before) {
      insertBefore(parent, stateNode, before);
    } else {
      appendChild(parent, stateNode);
    }
  } else if (tag === HostPortal) ; else {
    var child = node.child;

    if (child !== null) {
      insertOrAppendPlacementNode(child, before, parent);
      var sibling = child.sibling;

      while (sibling !== null) {
        insertOrAppendPlacementNode(sibling, before, parent);
        sibling = sibling.sibling;
      }
    }
  }
}

function unmountHostComponents(finishedRoot, current, renderPriorityLevel) {
  // We only have the top Fiber that was deleted but we need to recurse down its
  // children to find all the terminal nodes.
  var node = current; // Each iteration, currentParent is populated with node's host parent if not
  // currentParentIsValid.

  var currentParentIsValid = false; // Note: these two variables *must* always be updated together.

  var currentParent;
  var currentParentIsContainer;

  while (true) {
    if (!currentParentIsValid) {
      var parent = node.return;

      findParent: while (true) {
        if (!(parent !== null)) {
          {
            throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." );
          }
        }

        var parentStateNode = parent.stateNode;

        switch (parent.tag) {
          case HostComponent:
            currentParent = parentStateNode;
            currentParentIsContainer = false;
            break findParent;

          case HostRoot:
            currentParent = parentStateNode.containerInfo;
            currentParentIsContainer = true;
            break findParent;

          case HostPortal:
            currentParent = parentStateNode.containerInfo;
            currentParentIsContainer = true;
            break findParent;

        }

        parent = parent.return;
      }

      currentParentIsValid = true;
    }

    if (node.tag === HostComponent || node.tag === HostText) {
      commitNestedUnmounts(finishedRoot, node); // After all the children have unmounted, it is now safe to remove the
      // node from the tree.

      if (currentParentIsContainer) {
        removeChildFromContainer(currentParent, node.stateNode);
      } else {
        removeChild(currentParent, node.stateNode);
      } // Don't visit children because we already visited them.

    } else if (node.tag === HostPortal) {
      if (node.child !== null) {
        // When we go into a portal, it becomes the parent to remove from.
        // We will reassign it back when we pop the portal on the way up.
        currentParent = node.stateNode.containerInfo;
        currentParentIsContainer = true; // Visit children because portals might contain host components.

        node.child.return = node;
        node = node.child;
        continue;
      }
    } else {
      commitUnmount(finishedRoot, node); // Visit children because we may find more host components below.

      if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
    }

    if (node === current) {
      return;
    }

    while (node.sibling === null) {
      if (node.return === null || node.return === current) {
        return;
      }

      node = node.return;

      if (node.tag === HostPortal) {
        // When we go out of the portal, we need to restore the parent.
        // Since we don't keep a stack of them, we will search for it.
        currentParentIsValid = false;
      }
    }

    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function commitDeletion(finishedRoot, current, renderPriorityLevel) {
  {
    // Recursively delete all host nodes from the parent.
    // Detach refs and call componentWillUnmount() on the whole subtree.
    unmountHostComponents(finishedRoot, current);
  }

  var alternate = current.alternate;
  detachFiberMutation(current);

  if (alternate !== null) {
    detachFiberMutation(alternate);
  }
}

function commitWork(current, finishedWork) {

  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case MemoComponent:
    case SimpleMemoComponent:
    case Block:
      {
        // Layout effects are destroyed during the mutation phase so that all
        // destroy functions for all fibers are called before any create functions.
        // This prevents sibling component effects from interfering with each other,
        // e.g. a destroy function in one component should never override a ref set
        // by a create function in another component during the same commit.
        {
          commitHookEffectListUnmount(Layout | HasEffect, finishedWork);
        }

        return;
      }

    case ClassComponent:
      {
        return;
      }

    case HostComponent:
      {
        var instance = finishedWork.stateNode;

        if (instance != null) {
          // Commit the work prepared earlier.
          var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
          // as the newProps. The updatePayload will contain the real change in
          // this case.

          var oldProps = current !== null ? current.memoizedProps : newProps;
          var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.

          var updatePayload = finishedWork.updateQueue;
          finishedWork.updateQueue = null;

          if (updatePayload !== null) {
            commitUpdate(instance, updatePayload, type, oldProps, newProps);
          }
        }

        return;
      }

    case HostText:
      {
        if (!(finishedWork.stateNode !== null)) {
          {
            throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." );
          }
        }

        var textInstance = finishedWork.stateNode;
        var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
        // as the newProps. The updatePayload will contain the real change in
        // this case.

        var oldText = current !== null ? current.memoizedProps : newText;
        commitTextUpdate(textInstance, oldText, newText);
        return;
      }

    case HostRoot:
      {
        {
          var _root = finishedWork.stateNode;

          if (_root.hydrate) {
            // We've just hydrated. No need to hydrate again.
            _root.hydrate = false;
            commitHydratedContainer(_root.containerInfo);
          }
        }

        return;
      }

    case Profiler:
      {
        return;
      }

    case SuspenseComponent:
      {
        commitSuspenseComponent(finishedWork);
        attachSuspenseRetryListeners(finishedWork);
        return;
      }

    case SuspenseListComponent:
      {
        attachSuspenseRetryListeners(finishedWork);
        return;
      }

    case IncompleteClassComponent:
      {
        return;
      }

    case FundamentalComponent:
      {

        break;
      }

    case ScopeComponent:
      {

        break;
      }

    case OffscreenComponent:
    case LegacyHiddenComponent:
      {
        var newState = finishedWork.memoizedState;
        var isHidden = newState !== null;
        hideOrUnhideAllChildren(finishedWork, isHidden);
        return;
      }
  }

  {
    {
      throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
    }
  }
}

function commitSuspenseComponent(finishedWork) {
  var newState = finishedWork.memoizedState;

  if (newState !== null) {
    markCommitTimeOfFallback();

    {
      // Hide the Offscreen component that contains the primary children. TODO:
      // Ideally, this effect would have been scheduled on the Offscreen fiber
      // itself. That's how unhiding works: the Offscreen component schedules an
      // effect on itself. However, in this case, the component didn't complete,
      // so the fiber was never added to the effect list in the normal path. We
      // could have appended it to the effect list in the Suspense component's
      // second pass, but doing it this way is less complicated. This would be
      // simpler if we got rid of the effect list and traversed the tree, like
      // we're planning to do.
      var primaryChildParent = finishedWork.child;
      hideOrUnhideAllChildren(primaryChildParent, true);
    }
  }
}

function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {

  var newState = finishedWork.memoizedState;

  if (newState === null) {
    var current = finishedWork.alternate;

    if (current !== null) {
      var prevState = current.memoizedState;

      if (prevState !== null) {
        var suspenseInstance = prevState.dehydrated;

        if (suspenseInstance !== null) {
          commitHydratedSuspenseInstance(suspenseInstance);
        }
      }
    }
  }
}

function attachSuspenseRetryListeners(finishedWork) {
  // If this boundary just timed out, then it will have a set of wakeables.
  // For each wakeable, attach a listener so that when it resolves, React
  // attempts to re-render the boundary in the primary (pre-timeout) state.
  var wakeables = finishedWork.updateQueue;

  if (wakeables !== null) {
    finishedWork.updateQueue = null;
    var retryCache = finishedWork.stateNode;

    if (retryCache === null) {
      retryCache = finishedWork.stateNode = new PossiblyWeakSet();
    }

    wakeables.forEach(function (wakeable) {
      // Memoize using the boundary fiber to prevent redundant listeners.
      var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);

      if (!retryCache.has(wakeable)) {
        {
          if (wakeable.__reactDoNotTraceInteractions !== true) {
            retry = tracing.unstable_wrap(retry);
          }
        }

        retryCache.add(wakeable);
        wakeable.then(retry, retry);
      }
    });
  }
} // This function detects when a Suspense boundary goes from visible to hidden.
// It returns false if the boundary is already hidden.
// TODO: Use an effect tag.


function isSuspenseBoundaryBeingHidden(current, finishedWork) {
  if (current !== null) {
    var oldState = current.memoizedState;

    if (oldState === null || oldState.dehydrated !== null) {
      var newState = finishedWork.memoizedState;
      return newState !== null && newState.dehydrated === null;
    }
  }

  return false;
}

function commitResetTextContent(current) {

  resetTextContent(current.stateNode);
}

var COMPONENT_TYPE = 0;
var HAS_PSEUDO_CLASS_TYPE = 1;
var ROLE_TYPE = 2;
var TEST_NAME_TYPE = 3;
var TEXT_TYPE = 4;

if (typeof Symbol === 'function' && Symbol.for) {
  var symbolFor$1 = Symbol.for;
  COMPONENT_TYPE = symbolFor$1('selector.component');
  HAS_PSEUDO_CLASS_TYPE = symbolFor$1('selector.has_pseudo_class');
  ROLE_TYPE = symbolFor$1('selector.role');
  TEST_NAME_TYPE = symbolFor$1('selector.test_id');
  TEXT_TYPE = symbolFor$1('selector.text');
}
var commitHooks = [];
function onCommitRoot$1() {
  {
    commitHooks.forEach(function (commitHook) {
      return commitHook();
    });
  }
}

var ceil = Math.ceil;
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher,
    ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
    IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
var NoContext =
/*             */
0;
var BatchedContext =
/*               */
1;
var EventContext =
/*                 */
2;
var DiscreteEventContext =
/*         */
4;
var LegacyUnbatchedContext =
/*       */
8;
var RenderContext =
/*                */
16;
var CommitContext =
/*                */
32;
var RetryAfterError =
/*       */
64;
var RootIncomplete = 0;
var RootFatalErrored = 1;
var RootErrored = 2;
var RootSuspended = 3;
var RootSuspendedWithDelay = 4;
var RootCompleted = 5; // Describes where we are in the React execution stack

var executionContext = NoContext; // The root we're working on

var workInProgressRoot = null; // The fiber we're working on

var workInProgress = null; // The lanes we're rendering

var workInProgressRootRenderLanes = NoLanes; // Stack that allows components to change the render lanes for its subtree
// This is a superset of the lanes we started working on at the root. The only
// case where it's different from `workInProgressRootRenderLanes` is when we
// enter a subtree that is hidden and needs to be unhidden: Suspense and
// Offscreen component.
//
// Most things in the work loop should deal with workInProgressRootRenderLanes.
// Most things in begin/complete phases should deal with subtreeRenderLanes.

var subtreeRenderLanes = NoLanes;
var subtreeRenderLanesCursor = createCursor(NoLanes); // Whether to root completed, errored, suspended, etc.

var workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown

var workInProgressRootFatalError = null; // "Included" lanes refer to lanes that were worked on during this render. It's
// slightly different than `renderLanes` because `renderLanes` can change as you
// enter and exit an Offscreen tree. This value is the combination of all render
// lanes for the entire render phase.

var workInProgressRootIncludedLanes = NoLanes; // The work left over by components that were visited during this render. Only
// includes unprocessed updates, not work in bailed out children.

var workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render.

var workInProgressRootUpdatedLanes = NoLanes; // Lanes that were pinged (in an interleaved event) during this render.

var workInProgressRootPingedLanes = NoLanes;
var mostRecentlyUpdatedRoot = null; // The most recent time we committed a fallback. This lets us ensure a train
// model where we don't commit new loading states in too quick succession.

var globalMostRecentFallbackTime = 0;
var FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering
// more and prefer CPU suspense heuristics instead.

var workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU
// suspense heuristics and opt out of rendering more content.

var RENDER_TIMEOUT_MS = 500;

function resetRenderTimer() {
  workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;
}

function getRenderTargetTime() {
  return workInProgressRootRenderTargetTime;
}
var nextEffect = null;
var hasUncaughtError = false;
var firstUncaughtError = null;
var legacyErrorBoundariesThatAlreadyFailed = null;
var rootDoesHavePassiveEffects = false;
var rootWithPendingPassiveEffects = null;
var pendingPassiveEffectsRenderPriority = NoPriority$1;
var pendingPassiveEffectsLanes = NoLanes;
var pendingPassiveHookEffectsMount = [];
var pendingPassiveHookEffectsUnmount = [];
var rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates

var NESTED_UPDATE_LIMIT = 50;
var nestedUpdateCount = 0;
var rootWithNestedUpdates = null;
var NESTED_PASSIVE_UPDATE_LIMIT = 50;
var nestedPassiveUpdateCount = 0; // Marks the need to reschedule pending interactions at these lanes
// during the commit phase. This enables them to be traced across components
// that spawn new work during render. E.g. hidden boundaries, suspended SSR
// hydration or SuspenseList.
// TODO: Can use a bitmask instead of an array

var spawnedWorkDuringRender = null; // If two updates are scheduled within the same event, we should treat their
// event times as simultaneous, even if the actual clock time has advanced
// between the first and second call.

var currentEventTime = NoTimestamp;
var currentEventWipLanes = NoLanes;
var currentEventPendingLanes = NoLanes; // Dev only flag that tracks if passive effects are currently being flushed.
// We warn about state updates for unmounted components differently in this case.

var isFlushingPassiveEffects = false;
var focusedInstanceHandle = null;
var shouldFireAfterActiveInstanceBlur = false;
function getWorkInProgressRoot() {
  return workInProgressRoot;
}
function requestEventTime() {
  if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
    // We're inside React, so it's fine to read the actual time.
    return now();
  } // We're not inside React, so we may be in the middle of a browser event.


  if (currentEventTime !== NoTimestamp) {
    // Use the same start time for all updates until we enter React again.
    return currentEventTime;
  } // This is the first update since React yielded. Compute a new start time.


  currentEventTime = now();
  return currentEventTime;
}
function requestUpdateLane(fiber) {
  // Special cases
  var mode = fiber.mode;

  if ((mode & BlockingMode) === NoMode) {
    return SyncLane;
  } else if ((mode & ConcurrentMode) === NoMode) {
    return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
  } // The algorithm for assigning an update to a lane should be stable for all
  // updates at the same priority within the same event. To do this, the inputs
  // to the algorithm must be the same. For example, we use the `renderLanes`
  // to avoid choosing a lane that is already in the middle of rendering.
  //
  // However, the "included" lanes could be mutated in between updates in the
  // same event, like if you perform an update inside `flushSync`. Or any other
  // code path that might call `prepareFreshStack`.
  //
  // The trick we use is to cache the first of each of these inputs within an
  // event. Then reset the cached values once we can be sure the event is over.
  // Our heuristic for that is whenever we enter a concurrent work loop.
  //
  // We'll do the same for `currentEventPendingLanes` below.


  if (currentEventWipLanes === NoLanes) {
    currentEventWipLanes = workInProgressRootIncludedLanes;
  }

  var isTransition = requestCurrentTransition() !== NoTransition;

  if (isTransition) {
    if (currentEventPendingLanes !== NoLanes) {
      currentEventPendingLanes = mostRecentlyUpdatedRoot !== null ? mostRecentlyUpdatedRoot.pendingLanes : NoLanes;
    }

    return findTransitionLane(currentEventWipLanes, currentEventPendingLanes);
  } // TODO: Remove this dependency on the Scheduler priority.
  // To do that, we're replacing it with an update lane priority.


  var schedulerPriority = getCurrentPriorityLevel(); // The old behavior was using the priority level of the Scheduler.
  // This couples React to the Scheduler internals, so we're replacing it
  // with the currentUpdateLanePriority above. As an example of how this
  // could be problematic, if we're not inside `Scheduler.runWithPriority`,
  // then we'll get the priority of the current running Scheduler task,
  // which is probably not what we want.

  var lane;

  if ( // TODO: Temporary. We're removing the concept of discrete updates.
  (executionContext & DiscreteEventContext) !== NoContext && schedulerPriority === UserBlockingPriority$2) {
    lane = findUpdateLane(InputDiscreteLanePriority, currentEventWipLanes);
  } else {
    var schedulerLanePriority = schedulerPriorityToLanePriority(schedulerPriority);

    lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes);
  }

  return lane;
}

function requestRetryLane(fiber) {
  // This is a fork of `requestUpdateLane` designed specifically for Suspense
  // "retries" — a special update that attempts to flip a Suspense boundary
  // from its placeholder state to its primary/resolved state.
  // Special cases
  var mode = fiber.mode;

  if ((mode & BlockingMode) === NoMode) {
    return SyncLane;
  } else if ((mode & ConcurrentMode) === NoMode) {
    return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
  } // See `requestUpdateLane` for explanation of `currentEventWipLanes`


  if (currentEventWipLanes === NoLanes) {
    currentEventWipLanes = workInProgressRootIncludedLanes;
  }

  return findRetryLane(currentEventWipLanes);
}

function scheduleUpdateOnFiber(fiber, lane, eventTime) {
  checkForNestedUpdates();
  warnAboutRenderPhaseUpdatesInDEV(fiber);
  var root = markUpdateLaneFromFiberToRoot(fiber, lane);

  if (root === null) {
    warnAboutUpdateOnUnmountedFiberInDEV(fiber);
    return null;
  } // Mark that the root has a pending update.


  markRootUpdated(root, lane, eventTime);

  if (root === workInProgressRoot) {
    // Received an update to a tree that's in the middle of rendering. Mark
    // that there was an interleaved update work on this root. Unless the
    // `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render
    // phase update. In that case, we don't treat render phase updates as if
    // they were interleaved, for backwards compat reasons.
    {
      workInProgressRootUpdatedLanes = mergeLanes(workInProgressRootUpdatedLanes, lane);
    }

    if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
      // The root already suspended with a delay, which means this render
      // definitely won't finish. Since we have a new update, let's mark it as
      // suspended now, right before marking the incoming update. This has the
      // effect of interrupting the current render and switching to the update.
      // TODO: Make sure this doesn't override pings that happen while we've
      // already started rendering.
      markRootSuspended$1(root, workInProgressRootRenderLanes);
    }
  } // TODO: requestUpdateLanePriority also reads the priority. Pass the
  // priority as an argument to that function and this one.


  var priorityLevel = getCurrentPriorityLevel();

  if (lane === SyncLane) {
    if ( // Check if we're inside unbatchedUpdates
    (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering
    (executionContext & (RenderContext | CommitContext)) === NoContext) {
      // Register pending interactions on the root to avoid losing traced interaction data.
      schedulePendingInteractions(root, lane); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed
      // root inside of batchedUpdates should be synchronous, but layout updates
      // should be deferred until the end of the batch.

      performSyncWorkOnRoot(root);
    } else {
      ensureRootIsScheduled(root, eventTime);
      schedulePendingInteractions(root, lane);

      if (executionContext === NoContext) {
        // Flush the synchronous work now, unless we're already working or inside
        // a batch. This is intentionally inside scheduleUpdateOnFiber instead of
        // scheduleCallbackForFiber to preserve the ability to schedule a callback
        // without immediately flushing it. We only do this for user-initiated
        // updates, to preserve historical behavior of legacy mode.
        resetRenderTimer();
        flushSyncCallbackQueue();
      }
    }
  } else {
    // Schedule a discrete update but only if it's not Sync.
    if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered
    // discrete, even inside a discrete event.
    priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority$1)) {
      // This is the result of a discrete event. Track the lowest priority
      // discrete update per root so we can flush them early, if needed.
      if (rootsWithPendingDiscreteUpdates === null) {
        rootsWithPendingDiscreteUpdates = new Set([root]);
      } else {
        rootsWithPendingDiscreteUpdates.add(root);
      }
    } // Schedule other updates after in case the callback is sync.


    ensureRootIsScheduled(root, eventTime);
    schedulePendingInteractions(root, lane);
  } // We use this when assigning a lane for a transition inside
  // `requestUpdateLane`. We assume it's the same as the root being updated,
  // since in the common case of a single root app it probably is. If it's not
  // the same root, then it's not a huge deal, we just might batch more stuff
  // together more than necessary.


  mostRecentlyUpdatedRoot = root;
} // This is split into a separate function so we can mark a fiber with pending
// work without treating it as a typical update that originates from an event;
// e.g. retrying a Suspense boundary isn't an update, but it does schedule work
// on a fiber.

function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
  // Update the source fiber's lanes
  sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
  var alternate = sourceFiber.alternate;

  if (alternate !== null) {
    alternate.lanes = mergeLanes(alternate.lanes, lane);
  }

  {
    if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
      warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
    }
  } // Walk the parent path to the root and update the child expiration time.


  var node = sourceFiber;
  var parent = sourceFiber.return;

  while (parent !== null) {
    parent.childLanes = mergeLanes(parent.childLanes, lane);
    alternate = parent.alternate;

    if (alternate !== null) {
      alternate.childLanes = mergeLanes(alternate.childLanes, lane);
    } else {
      {
        if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
          warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
        }
      }
    }

    node = parent;
    parent = parent.return;
  }

  if (node.tag === HostRoot) {
    var root = node.stateNode;
    return root;
  } else {
    return null;
  }
} // Use this function to schedule a task for a root. There's only one task per
// root; if a task was already scheduled, we'll check to make sure the priority
// of the existing task is the same as the priority of the next level that the
// root has work on. This function is called on every update, and right before
// exiting a task.


function ensureRootIsScheduled(root, currentTime) {
  var existingCallbackNode = root.callbackNode; // Check if any lanes are being starved by other work. If so, mark them as
  // expired so we know to work on those next.

  markStarvedLanesAsExpired(root, currentTime); // Determine the next lanes to work on, and their priority.

  var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); // This returns the priority level computed during the `getNextLanes` call.

  var newCallbackPriority = returnNextLanesPriority();

  if (nextLanes === NoLanes) {
    // Special case: There's nothing to work on.
    if (existingCallbackNode !== null) {
      cancelCallback(existingCallbackNode);
      root.callbackNode = null;
      root.callbackPriority = NoLanePriority;
    }

    return;
  } // Check if there's an existing task. We may be able to reuse it.


  if (existingCallbackNode !== null) {
    var existingCallbackPriority = root.callbackPriority;

    if (existingCallbackPriority === newCallbackPriority) {
      // The priority hasn't changed. We can reuse the existing task. Exit.
      return;
    } // The priority changed. Cancel the existing callback. We'll schedule a new
    // one below.


    cancelCallback(existingCallbackNode);
  } // Schedule a new callback.


  var newCallbackNode;

  if (newCallbackPriority === SyncLanePriority) {
    // Special case: Sync React callbacks are scheduled on a special
    // internal queue
    newCallbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
  } else if (newCallbackPriority === SyncBatchedLanePriority) {
    newCallbackNode = scheduleCallback(ImmediatePriority$1, performSyncWorkOnRoot.bind(null, root));
  } else {
    var schedulerPriorityLevel = lanePriorityToSchedulerPriority(newCallbackPriority);
    newCallbackNode = scheduleCallback(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root));
  }

  root.callbackPriority = newCallbackPriority;
  root.callbackNode = newCallbackNode;
} // This is the entry point for every concurrent task, i.e. anything that
// goes through Scheduler.


function performConcurrentWorkOnRoot(root) {
  // Since we know we're in a React event, we can clear the current
  // event time. The next update will compute a new event time.
  currentEventTime = NoTimestamp;
  currentEventWipLanes = NoLanes;
  currentEventPendingLanes = NoLanes;

  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
    {
      throw Error( "Should not already be working." );
    }
  } // Flush any pending passive effects before deciding which lanes to work on,
  // in case they schedule additional work.


  var originalCallbackNode = root.callbackNode;
  var didFlushPassiveEffects = flushPassiveEffects();

  if (didFlushPassiveEffects) {
    // Something in the passive effect phase may have canceled the current task.
    // Check if the task node for this root was changed.
    if (root.callbackNode !== originalCallbackNode) {
      // The current task was canceled. Exit. We don't need to call
      // `ensureRootIsScheduled` because the check above implies either that
      // there's a new task, or that there's no remaining work on this root.
      return null;
    }
  } // Determine the next expiration time to work on, using the fields stored
  // on the root.


  var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);

  if (lanes === NoLanes) {
    // Defensive coding. This is never expected to happen.
    return null;
  }

  var exitStatus = renderRootConcurrent(root, lanes);

  if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
    // The render included lanes that were updated during the render phase.
    // For example, when unhiding a hidden tree, we include all the lanes
    // that were previously skipped when the tree was hidden. That set of
    // lanes is a superset of the lanes we started rendering with.
    //
    // So we'll throw out the current work and restart.
    prepareFreshStack(root, NoLanes);
  } else if (exitStatus !== RootIncomplete) {
    if (exitStatus === RootErrored) {
      executionContext |= RetryAfterError; // If an error occurred during hydration,
      // discard server response and fall back to client side render.

      if (root.hydrate) {
        root.hydrate = false;
        clearContainer(root.containerInfo);
      } // If something threw an error, try rendering one more time. We'll render
      // synchronously to block concurrent data mutations, and we'll includes
      // all pending updates are included. If it still fails after the second
      // attempt, we'll give up and commit the resulting tree.


      lanes = getLanesToRetrySynchronouslyOnError(root);

      if (lanes !== NoLanes) {
        exitStatus = renderRootSync(root, lanes);
      }
    }

    if (exitStatus === RootFatalErrored) {
      var fatalError = workInProgressRootFatalError;
      prepareFreshStack(root, NoLanes);
      markRootSuspended$1(root, lanes);
      ensureRootIsScheduled(root, now());
      throw fatalError;
    } // We now have a consistent tree. The next step is either to commit it,
    // or, if something suspended, wait to commit it after a timeout.


    var finishedWork = root.current.alternate;
    root.finishedWork = finishedWork;
    root.finishedLanes = lanes;
    finishConcurrentRender(root, exitStatus, lanes);
  }

  ensureRootIsScheduled(root, now());

  if (root.callbackNode === originalCallbackNode) {
    // The task node scheduled for this root is the same one that's
    // currently executed. Need to return a continuation.
    return performConcurrentWorkOnRoot.bind(null, root);
  }

  return null;
}

function finishConcurrentRender(root, exitStatus, lanes) {
  switch (exitStatus) {
    case RootIncomplete:
    case RootFatalErrored:
      {
        {
          {
            throw Error( "Root did not complete. This is a bug in React." );
          }
        }
      }
    // Flow knows about invariant, so it complains if I add a break
    // statement, but eslint doesn't know about invariant, so it complains
    // if I do. eslint-disable-next-line no-fallthrough

    case RootErrored:
      {
        // We should have already attempted to retry this tree. If we reached
        // this point, it errored again. Commit it.
        commitRoot(root);
        break;
      }

    case RootSuspended:
      {
        markRootSuspended$1(root, lanes); // We have an acceptable loading state. We need to figure out if we
        // should immediately commit it or wait a bit.

        if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope
        !shouldForceFlushFallbacksInDEV()) {
          // This render only included retries, no updates. Throttle committing
          // retries so that we don't show too many loading states too quickly.
          var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.

          if (msUntilTimeout > 10) {
            var nextLanes = getNextLanes(root, NoLanes);

            if (nextLanes !== NoLanes) {
              // There's additional work on this root.
              break;
            }

            var suspendedLanes = root.suspendedLanes;

            if (!isSubsetOfLanes(suspendedLanes, lanes)) {
              // We should prefer to render the fallback of at the last
              // suspended level. Ping the last suspended level to try
              // rendering it again.
              // FIXME: What if the suspended lanes are Idle? Should not restart.
              var eventTime = requestEventTime();
              markRootPinged(root, suspendedLanes);
              break;
            } // The render is suspended, it hasn't timed out, and there's no
            // lower priority work to do. Instead of committing the fallback
            // immediately, wait for more data to arrive.


            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);
            break;
          }
        } // The work expired. Commit immediately.


        commitRoot(root);
        break;
      }

    case RootSuspendedWithDelay:
      {
        markRootSuspended$1(root, lanes);

        if (includesOnlyTransitions(lanes)) {
          // This is a transition, so we should exit without committing a
          // placeholder and without scheduling a timeout. Delay indefinitely
          // until we receive more data.
          break;
        }

        if (!shouldForceFlushFallbacksInDEV()) {
          // This is not a transition, but we did trigger an avoided state.
          // Schedule a placeholder to display after a short delay, using the Just
          // Noticeable Difference.
          // TODO: Is the JND optimization worth the added complexity? If this is
          // the only reason we track the event time, then probably not.
          // Consider removing.
          var mostRecentEventTime = getMostRecentEventTime(root, lanes);
          var eventTimeMs = mostRecentEventTime;
          var timeElapsedMs = now() - eventTimeMs;

          var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.


          if (_msUntilTimeout > 10) {
            // Instead of committing the fallback immediately, wait for more data
            // to arrive.
            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);
            break;
          }
        } // Commit the placeholder.


        commitRoot(root);
        break;
      }

    case RootCompleted:
      {
        // The work completed. Ready to commit.
        commitRoot(root);
        break;
      }

    default:
      {
        {
          {
            throw Error( "Unknown root exit status." );
          }
        }
      }
  }
}

function markRootSuspended$1(root, suspendedLanes) {
  // When suspending, we should always exclude lanes that were pinged or (more
  // rarely, since we try to avoid it) updated during the render phase.
  // TODO: Lol maybe there's a better way to factor this besides this
  // obnoxiously named function :)
  suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
  suspendedLanes = removeLanes(suspendedLanes, workInProgressRootUpdatedLanes);
  markRootSuspended(root, suspendedLanes);
} // This is the entry point for synchronous tasks that don't go
// through Scheduler


function performSyncWorkOnRoot(root) {
  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
    {
      throw Error( "Should not already be working." );
    }
  }

  flushPassiveEffects();
  var lanes;
  var exitStatus;

  if (root === workInProgressRoot && includesSomeLane(root.expiredLanes, workInProgressRootRenderLanes)) {
    // There's a partial tree, and at least one of its lanes has expired. Finish
    // rendering it before rendering the rest of the expired work.
    lanes = workInProgressRootRenderLanes;
    exitStatus = renderRootSync(root, lanes);

    if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
      // The render included lanes that were updated during the render phase.
      // For example, when unhiding a hidden tree, we include all the lanes
      // that were previously skipped when the tree was hidden. That set of
      // lanes is a superset of the lanes we started rendering with.
      //
      // Note that this only happens when part of the tree is rendered
      // concurrently. If the whole tree is rendered synchronously, then there
      // are no interleaved events.
      lanes = getNextLanes(root, lanes);
      exitStatus = renderRootSync(root, lanes);
    }
  } else {
    lanes = getNextLanes(root, NoLanes);
    exitStatus = renderRootSync(root, lanes);
  }

  if (root.tag !== LegacyRoot && exitStatus === RootErrored) {
    executionContext |= RetryAfterError; // If an error occurred during hydration,
    // discard server response and fall back to client side render.

    if (root.hydrate) {
      root.hydrate = false;
      clearContainer(root.containerInfo);
    } // If something threw an error, try rendering one more time. We'll render
    // synchronously to block concurrent data mutations, and we'll includes
    // all pending updates are included. If it still fails after the second
    // attempt, we'll give up and commit the resulting tree.


    lanes = getLanesToRetrySynchronouslyOnError(root);

    if (lanes !== NoLanes) {
      exitStatus = renderRootSync(root, lanes);
    }
  }

  if (exitStatus === RootFatalErrored) {
    var fatalError = workInProgressRootFatalError;
    prepareFreshStack(root, NoLanes);
    markRootSuspended$1(root, lanes);
    ensureRootIsScheduled(root, now());
    throw fatalError;
  } // We now have a consistent tree. Because this is a sync render, we
  // will commit it even if something suspended.


  var finishedWork = root.current.alternate;
  root.finishedWork = finishedWork;
  root.finishedLanes = lanes;
  commitRoot(root); // Before exiting, make sure there's a callback scheduled for the next
  // pending level.

  ensureRootIsScheduled(root, now());
  return null;
}
function flushDiscreteUpdates() {
  // TODO: Should be able to flush inside batchedUpdates, but not inside `act`.
  // However, `act` uses `batchedUpdates`, so there's no way to distinguish
  // those two cases. Need to fix this before exposing flushDiscreteUpdates
  // as a public API.
  if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
    {
      if ((executionContext & RenderContext) !== NoContext) {
        error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');
      }
    } // We're already rendering, so we can't synchronously flush pending work.
    // This is probably a nested event dispatch triggered by a lifecycle/effect,
    // like `el.focus()`. Exit.


    return;
  }

  flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that
  // they fire before the next serial event.

  flushPassiveEffects();
}

function flushPendingDiscreteUpdates() {
  if (rootsWithPendingDiscreteUpdates !== null) {
    // For each root with pending discrete updates, schedule a callback to
    // immediately flush them.
    var roots = rootsWithPendingDiscreteUpdates;
    rootsWithPendingDiscreteUpdates = null;
    roots.forEach(function (root) {
      markDiscreteUpdatesExpired(root);
      ensureRootIsScheduled(root, now());
    });
  } // Now flush the immediate queue.


  flushSyncCallbackQueue();
}

function batchedUpdates$1(fn, a) {
  var prevExecutionContext = executionContext;
  executionContext |= BatchedContext;

  try {
    return fn(a);
  } finally {
    executionContext = prevExecutionContext;

    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      resetRenderTimer();
      flushSyncCallbackQueue();
    }
  }
}
function batchedEventUpdates$1(fn, a) {
  var prevExecutionContext = executionContext;
  executionContext |= EventContext;

  try {
    return fn(a);
  } finally {
    executionContext = prevExecutionContext;

    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      resetRenderTimer();
      flushSyncCallbackQueue();
    }
  }
}
function discreteUpdates$1(fn, a, b, c, d) {
  var prevExecutionContext = executionContext;
  executionContext |= DiscreteEventContext;

  {
    try {
      return runWithPriority$1(UserBlockingPriority$2, fn.bind(null, a, b, c, d));
    } finally {
      executionContext = prevExecutionContext;

      if (executionContext === NoContext) {
        // Flush the immediate callbacks that were scheduled during this batch
        resetRenderTimer();
        flushSyncCallbackQueue();
      }
    }
  }
}
function unbatchedUpdates(fn, a) {
  var prevExecutionContext = executionContext;
  executionContext &= ~BatchedContext;
  executionContext |= LegacyUnbatchedContext;

  try {
    return fn(a);
  } finally {
    executionContext = prevExecutionContext;

    if (executionContext === NoContext) {
      // Flush the immediate callbacks that were scheduled during this batch
      resetRenderTimer();
      flushSyncCallbackQueue();
    }
  }
}
function flushSync(fn, a) {
  var prevExecutionContext = executionContext;

  if ((prevExecutionContext & (RenderContext | CommitContext)) !== NoContext) {
    {
      error('flushSync was called from inside a lifecycle method. React cannot ' + 'flush when React is already rendering. Consider moving this call to ' + 'a scheduler task or micro task.');
    }

    return fn(a);
  }

  executionContext |= BatchedContext;

  {
    try {
      if (fn) {
        return runWithPriority$1(ImmediatePriority$1, fn.bind(null, a));
      } else {
        return undefined;
      }
    } finally {
      executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.
      // Note that this will happen even if batchedUpdates is higher up
      // the stack.

      flushSyncCallbackQueue();
    }
  }
}
function pushRenderLanes(fiber, lanes) {
  push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
  subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
  workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
}
function popRenderLanes(fiber) {
  subtreeRenderLanes = subtreeRenderLanesCursor.current;
  pop(subtreeRenderLanesCursor, fiber);
}

function prepareFreshStack(root, lanes) {
  root.finishedWork = null;
  root.finishedLanes = NoLanes;
  var timeoutHandle = root.timeoutHandle;

  if (timeoutHandle !== noTimeout) {
    // The root previous suspended and scheduled a timeout to commit a fallback
    // state. Now that we have additional work, cancel the timeout.
    root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above

    cancelTimeout(timeoutHandle);
  }

  if (workInProgress !== null) {
    var interruptedWork = workInProgress.return;

    while (interruptedWork !== null) {
      unwindInterruptedWork(interruptedWork);
      interruptedWork = interruptedWork.return;
    }
  }

  workInProgressRoot = root;
  workInProgress = createWorkInProgress(root.current, null);
  workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
  workInProgressRootExitStatus = RootIncomplete;
  workInProgressRootFatalError = null;
  workInProgressRootSkippedLanes = NoLanes;
  workInProgressRootUpdatedLanes = NoLanes;
  workInProgressRootPingedLanes = NoLanes;

  {
    spawnedWorkDuringRender = null;
  }

  {
    ReactStrictModeWarnings.discardPendingWarnings();
  }
}

function handleError(root, thrownValue) {
  do {
    var erroredWork = workInProgress;

    try {
      // Reset module-level state that was set during the render phase.
      resetContextDependencies();
      resetHooksAfterThrow();
      resetCurrentFiber(); // TODO: I found and added this missing line while investigating a
      // separate issue. Write a regression test using string refs.

      ReactCurrentOwner$2.current = null;

      if (erroredWork === null || erroredWork.return === null) {
        // Expected to be working on a non-root fiber. This is a fatal error
        // because there's no ancestor that can handle it; the root is
        // supposed to capture all errors that weren't caught by an error
        // boundary.
        workInProgressRootExitStatus = RootFatalErrored;
        workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next
        // sibling, or the parent if there are no siblings. But since the root
        // has no siblings nor a parent, we set it to null. Usually this is
        // handled by `completeUnitOfWork` or `unwindWork`, but since we're
        // intentionally not calling those, we need set it here.
        // TODO: Consider calling `unwindWork` to pop the contexts.

        workInProgress = null;
        return;
      }

      if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
        // Record the time spent rendering before an error was thrown. This
        // avoids inaccurate Profiler durations in the case of a
        // suspended render.
        stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
      }

      throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
      completeUnitOfWork(erroredWork);
    } catch (yetAnotherThrownValue) {
      // Something in the return path also threw.
      thrownValue = yetAnotherThrownValue;

      if (workInProgress === erroredWork && erroredWork !== null) {
        // If this boundary has already errored, then we had trouble processing
        // the error. Bubble it to the next boundary.
        erroredWork = erroredWork.return;
        workInProgress = erroredWork;
      } else {
        erroredWork = workInProgress;
      }

      continue;
    } // Return to the normal work loop.


    return;
  } while (true);
}

function pushDispatcher() {
  var prevDispatcher = ReactCurrentDispatcher$2.current;
  ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;

  if (prevDispatcher === null) {
    // The React isomorphic package does not include a default dispatcher.
    // Instead the first renderer will lazily attach one, in order to give
    // nicer error messages.
    return ContextOnlyDispatcher;
  } else {
    return prevDispatcher;
  }
}

function popDispatcher(prevDispatcher) {
  ReactCurrentDispatcher$2.current = prevDispatcher;
}

function pushInteractions(root) {
  {
    var prevInteractions = tracing.__interactionsRef.current;
    tracing.__interactionsRef.current = root.memoizedInteractions;
    return prevInteractions;
  }
}

function popInteractions(prevInteractions) {
  {
    tracing.__interactionsRef.current = prevInteractions;
  }
}

function markCommitTimeOfFallback() {
  globalMostRecentFallbackTime = now();
}
function markSkippedUpdateLanes(lane) {
  workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
}
function renderDidSuspend() {
  if (workInProgressRootExitStatus === RootIncomplete) {
    workInProgressRootExitStatus = RootSuspended;
  }
}
function renderDidSuspendDelayIfPossible() {
  if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
    workInProgressRootExitStatus = RootSuspendedWithDelay;
  } // Check if there are updates that we skipped tree that might have unblocked
  // this render.


  if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootUpdatedLanes))) {
    // Mark the current render as suspended so that we switch to working on
    // the updates that were skipped. Usually we only suspend at the end of
    // the render phase.
    // TODO: We should probably always mark the root as suspended immediately
    // (inside this function), since by suspending at the end of the render
    // phase introduces a potential mistake where we suspend lanes that were
    // pinged or updated while we were rendering.
    markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
  }
}
function renderDidError() {
  if (workInProgressRootExitStatus !== RootCompleted) {
    workInProgressRootExitStatus = RootErrored;
  }
} // Called during render to determine if anything has suspended.
// Returns false if we're not sure.

function renderHasNotSuspendedYet() {
  // If something errored or completed, we can't really be sure,
  // so those are false.
  return workInProgressRootExitStatus === RootIncomplete;
}

function renderRootSync(root, lanes) {
  var prevExecutionContext = executionContext;
  executionContext |= RenderContext;
  var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack
  // and prepare a fresh one. Otherwise we'll continue where we left off.

  if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {
    prepareFreshStack(root, lanes);
    startWorkOnPendingInteractions(root, lanes);
  }

  var prevInteractions = pushInteractions(root);

  do {
    try {
      workLoopSync();
      break;
    } catch (thrownValue) {
      handleError(root, thrownValue);
    }
  } while (true);

  resetContextDependencies();

  {
    popInteractions(prevInteractions);
  }

  executionContext = prevExecutionContext;
  popDispatcher(prevDispatcher);

  if (workInProgress !== null) {
    // This is a sync render, so we should have finished the whole tree.
    {
      {
        throw Error( "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." );
      }
    }
  }


  workInProgressRoot = null;
  workInProgressRootRenderLanes = NoLanes;
  return workInProgressRootExitStatus;
} // The work loop is an extremely hot path. Tell Closure not to inline it.

/** @noinline */


function workLoopSync() {
  // Already timed out, so perform work without checking if we need to yield.
  while (workInProgress !== null) {
    performUnitOfWork(workInProgress);
  }
}

function renderRootConcurrent(root, lanes) {
  var prevExecutionContext = executionContext;
  executionContext |= RenderContext;
  var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack
  // and prepare a fresh one. Otherwise we'll continue where we left off.

  if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {
    resetRenderTimer();
    prepareFreshStack(root, lanes);
    startWorkOnPendingInteractions(root, lanes);
  }

  var prevInteractions = pushInteractions(root);

  do {
    try {
      workLoopConcurrent();
      break;
    } catch (thrownValue) {
      handleError(root, thrownValue);
    }
  } while (true);

  resetContextDependencies();

  {
    popInteractions(prevInteractions);
  }

  popDispatcher(prevDispatcher);
  executionContext = prevExecutionContext;


  if (workInProgress !== null) {

    return RootIncomplete;
  } else {


    workInProgressRoot = null;
    workInProgressRootRenderLanes = NoLanes; // Return the final exit status.

    return workInProgressRootExitStatus;
  }
}
/** @noinline */


function workLoopConcurrent() {
  // Perform work until Scheduler asks us to yield
  while (workInProgress !== null && !shouldYield()) {
    performUnitOfWork(workInProgress);
  }
}

function performUnitOfWork(unitOfWork) {
  // The current, flushed, state of this fiber is the alternate. Ideally
  // nothing should rely on this, but relying on it here means that we don't
  // need an additional field on the work in progress.
  var current = unitOfWork.alternate;
  setCurrentFiber(unitOfWork);
  var next;

  if ( (unitOfWork.mode & ProfileMode) !== NoMode) {
    startProfilerTimer(unitOfWork);
    next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
    stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
  } else {
    next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
  }

  resetCurrentFiber();
  unitOfWork.memoizedProps = unitOfWork.pendingProps;

  if (next === null) {
    // If this doesn't spawn new work, complete the current work.
    completeUnitOfWork(unitOfWork);
  } else {
    workInProgress = next;
  }

  ReactCurrentOwner$2.current = null;
}

function completeUnitOfWork(unitOfWork) {
  // Attempt to complete the current unit of work, then move to the next
  // sibling. If there are no more siblings, return to the parent fiber.
  var completedWork = unitOfWork;

  do {
    // The current, flushed, state of this fiber is the alternate. Ideally
    // nothing should rely on this, but relying on it here means that we don't
    // need an additional field on the work in progress.
    var current = completedWork.alternate;
    var returnFiber = completedWork.return; // Check if the work completed or if something threw.

    if ((completedWork.flags & Incomplete) === NoFlags) {
      setCurrentFiber(completedWork);
      var next = void 0;

      if ( (completedWork.mode & ProfileMode) === NoMode) {
        next = completeWork(current, completedWork, subtreeRenderLanes);
      } else {
        startProfilerTimer(completedWork);
        next = completeWork(current, completedWork, subtreeRenderLanes); // Update render duration assuming we didn't error.

        stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
      }

      resetCurrentFiber();

      if (next !== null) {
        // Completing this fiber spawned new work. Work on that next.
        workInProgress = next;
        return;
      }

      resetChildLanes(completedWork);

      if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete
      (returnFiber.flags & Incomplete) === NoFlags) {
        // Append all the effects of the subtree and this fiber onto the effect
        // list of the parent. The completion order of the children affects the
        // side-effect order.
        if (returnFiber.firstEffect === null) {
          returnFiber.firstEffect = completedWork.firstEffect;
        }

        if (completedWork.lastEffect !== null) {
          if (returnFiber.lastEffect !== null) {
            returnFiber.lastEffect.nextEffect = completedWork.firstEffect;
          }

          returnFiber.lastEffect = completedWork.lastEffect;
        } // If this fiber had side-effects, we append it AFTER the children's
        // side-effects. We can perform certain side-effects earlier if needed,
        // by doing multiple passes over the effect list. We don't want to
        // schedule our own side-effect on our own list because if end up
        // reusing children we'll schedule this effect onto itself since we're
        // at the end.


        var flags = completedWork.flags; // Skip both NoWork and PerformedWork tags when creating the effect
        // list. PerformedWork effect is read by React DevTools but shouldn't be
        // committed.

        if (flags > PerformedWork) {
          if (returnFiber.lastEffect !== null) {
            returnFiber.lastEffect.nextEffect = completedWork;
          } else {
            returnFiber.firstEffect = completedWork;
          }

          returnFiber.lastEffect = completedWork;
        }
      }
    } else {
      // This fiber did not complete because something threw. Pop values off
      // the stack without entering the complete phase. If this is a boundary,
      // capture values if possible.
      var _next = unwindWork(completedWork); // Because this fiber did not complete, don't reset its expiration time.


      if (_next !== null) {
        // If completing this work spawned new work, do that next. We'll come
        // back here again.
        // Since we're restarting, remove anything that is not a host effect
        // from the effect tag.
        _next.flags &= HostEffectMask;
        workInProgress = _next;
        return;
      }

      if ( (completedWork.mode & ProfileMode) !== NoMode) {
        // Record the render duration for the fiber that errored.
        stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); // Include the time spent working on failed children before continuing.

        var actualDuration = completedWork.actualDuration;
        var child = completedWork.child;

        while (child !== null) {
          actualDuration += child.actualDuration;
          child = child.sibling;
        }

        completedWork.actualDuration = actualDuration;
      }

      if (returnFiber !== null) {
        // Mark the parent fiber as incomplete and clear its effect list.
        returnFiber.firstEffect = returnFiber.lastEffect = null;
        returnFiber.flags |= Incomplete;
      }
    }

    var siblingFiber = completedWork.sibling;

    if (siblingFiber !== null) {
      // If there is more work to do in this returnFiber, do that next.
      workInProgress = siblingFiber;
      return;
    } // Otherwise, return to the parent


    completedWork = returnFiber; // Update the next thing we're working on in case something throws.

    workInProgress = completedWork;
  } while (completedWork !== null); // We've reached the root.


  if (workInProgressRootExitStatus === RootIncomplete) {
    workInProgressRootExitStatus = RootCompleted;
  }
}

function resetChildLanes(completedWork) {
  if ( // TODO: Move this check out of the hot path by moving `resetChildLanes`
  // to switch statement in `completeWork`.
  (completedWork.tag === LegacyHiddenComponent || completedWork.tag === OffscreenComponent) && completedWork.memoizedState !== null && !includesSomeLane(subtreeRenderLanes, OffscreenLane) && (completedWork.mode & ConcurrentMode) !== NoLanes) {
    // The children of this component are hidden. Don't bubble their
    // expiration times.
    return;
  }

  var newChildLanes = NoLanes; // Bubble up the earliest expiration time.

  if ( (completedWork.mode & ProfileMode) !== NoMode) {
    // In profiling mode, resetChildExpirationTime is also used to reset
    // profiler durations.
    var actualDuration = completedWork.actualDuration;
    var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will
    // only be updated if work is done on the fiber (i.e. it doesn't bailout).
    // When work is done, it should bubble to the parent's actualDuration. If
    // the fiber has not been cloned though, (meaning no work was done), then
    // this value will reflect the amount of time spent working on a previous
    // render. In that case it should not bubble. We determine whether it was
    // cloned by comparing the child pointer.

    var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
    var child = completedWork.child;

    while (child !== null) {
      newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));

      if (shouldBubbleActualDurations) {
        actualDuration += child.actualDuration;
      }

      treeBaseDuration += child.treeBaseDuration;
      child = child.sibling;
    }

    var isTimedOutSuspense = completedWork.tag === SuspenseComponent && completedWork.memoizedState !== null;

    if (isTimedOutSuspense) {
      // Don't count time spent in a timed out Suspense subtree as part of the base duration.
      var primaryChildFragment = completedWork.child;

      if (primaryChildFragment !== null) {
        treeBaseDuration -= primaryChildFragment.treeBaseDuration;
      }
    }

    completedWork.actualDuration = actualDuration;
    completedWork.treeBaseDuration = treeBaseDuration;
  } else {
    var _child = completedWork.child;

    while (_child !== null) {
      newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
      _child = _child.sibling;
    }
  }

  completedWork.childLanes = newChildLanes;
}

function commitRoot(root) {
  var renderPriorityLevel = getCurrentPriorityLevel();
  runWithPriority$1(ImmediatePriority$1, commitRootImpl.bind(null, root, renderPriorityLevel));
  return null;
}

function commitRootImpl(root, renderPriorityLevel) {
  do {
    // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which
    // means `flushPassiveEffects` will sometimes result in additional
    // passive effects. So we need to keep flushing in a loop until there are
    // no more pending effects.
    // TODO: Might be better if `flushPassiveEffects` did not automatically
    // flush synchronous work at the end, to avoid factoring hazards like this.
    flushPassiveEffects();
  } while (rootWithPendingPassiveEffects !== null);

  flushRenderPhaseStrictModeWarningsInDEV();

  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
    {
      throw Error( "Should not already be working." );
    }
  }

  var finishedWork = root.finishedWork;
  var lanes = root.finishedLanes;

  if (finishedWork === null) {

    return null;
  }

  root.finishedWork = null;
  root.finishedLanes = NoLanes;

  if (!(finishedWork !== root.current)) {
    {
      throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." );
    }
  } // commitRoot never returns a continuation; it always finishes synchronously.
  // So we can clear these now to allow a new callback to be scheduled.


  root.callbackNode = null; // Update the first and last pending times on this root. The new first
  // pending time is whatever is left on the root fiber.

  var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
  markRootFinished(root, remainingLanes); // Clear already finished discrete updates in case that a later call of
  // `flushDiscreteUpdates` starts a useless render pass which may cancels
  // a scheduled timeout.

  if (rootsWithPendingDiscreteUpdates !== null) {
    if (!hasDiscreteLanes(remainingLanes) && rootsWithPendingDiscreteUpdates.has(root)) {
      rootsWithPendingDiscreteUpdates.delete(root);
    }
  }

  if (root === workInProgressRoot) {
    // We can reset these now that they are finished.
    workInProgressRoot = null;
    workInProgress = null;
    workInProgressRootRenderLanes = NoLanes;
  } // Get the list of effects.


  var firstEffect;

  if (finishedWork.flags > PerformedWork) {
    // A fiber's effect list consists only of its children, not itself. So if
    // the root has an effect, we need to add it to the end of the list. The
    // resulting list is the set that would belong to the root's parent, if it
    // had one; that is, all the effects in the tree including the root.
    if (finishedWork.lastEffect !== null) {
      finishedWork.lastEffect.nextEffect = finishedWork;
      firstEffect = finishedWork.firstEffect;
    } else {
      firstEffect = finishedWork;
    }
  } else {
    // There is no effect on the root.
    firstEffect = finishedWork.firstEffect;
  }

  if (firstEffect !== null) {

    var prevExecutionContext = executionContext;
    executionContext |= CommitContext;
    var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles

    ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass
    // of the effect list for each phase: all mutation effects come before all
    // layout effects, and so on.
    // The first phase a "before mutation" phase. We use this phase to read the
    // state of the host tree right before we mutate it. This is where
    // getSnapshotBeforeUpdate is called.

    focusedInstanceHandle = prepareForCommit(root.containerInfo);
    shouldFireAfterActiveInstanceBlur = false;
    nextEffect = firstEffect;

    do {
      {
        invokeGuardedCallback(null, commitBeforeMutationEffects, null);

        if (hasCaughtError()) {
          if (!(nextEffect !== null)) {
            {
              throw Error( "Should be working on an effect." );
            }
          }

          var error = clearCaughtError();
          captureCommitPhaseError(nextEffect, error);
          nextEffect = nextEffect.nextEffect;
        }
      }
    } while (nextEffect !== null); // We no longer need to track the active instance fiber


    focusedInstanceHandle = null;

    {
      // Mark the current commit time to be shared by all Profilers in this
      // batch. This enables them to be grouped later.
      recordCommitTime();
    } // The next phase is the mutation phase, where we mutate the host tree.


    nextEffect = firstEffect;

    do {
      {
        invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);

        if (hasCaughtError()) {
          if (!(nextEffect !== null)) {
            {
              throw Error( "Should be working on an effect." );
            }
          }

          var _error = clearCaughtError();

          captureCommitPhaseError(nextEffect, _error);
          nextEffect = nextEffect.nextEffect;
        }
      }
    } while (nextEffect !== null);

    resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after
    // the mutation phase, so that the previous tree is still current during
    // componentWillUnmount, but before the layout phase, so that the finished
    // work is current during componentDidMount/Update.

    root.current = finishedWork; // The next phase is the layout phase, where we call effects that read
    // the host tree after it's been mutated. The idiomatic use case for this is
    // layout, but class component lifecycles also fire here for legacy reasons.

    nextEffect = firstEffect;

    do {
      {
        invokeGuardedCallback(null, commitLayoutEffects, null, root, lanes);

        if (hasCaughtError()) {
          if (!(nextEffect !== null)) {
            {
              throw Error( "Should be working on an effect." );
            }
          }

          var _error2 = clearCaughtError();

          captureCommitPhaseError(nextEffect, _error2);
          nextEffect = nextEffect.nextEffect;
        }
      }
    } while (nextEffect !== null);

    nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an
    // opportunity to paint.

    requestPaint();

    {
      popInteractions(prevInteractions);
    }

    executionContext = prevExecutionContext;
  } else {
    // No effects.
    root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were
    // no effects.
    // TODO: Maybe there's a better way to report this.

    {
      recordCommitTime();
    }
  }

  var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;

  if (rootDoesHavePassiveEffects) {
    // This commit has passive effects. Stash a reference to them. But don't
    // schedule a callback until after flushing layout work.
    rootDoesHavePassiveEffects = false;
    rootWithPendingPassiveEffects = root;
    pendingPassiveEffectsLanes = lanes;
    pendingPassiveEffectsRenderPriority = renderPriorityLevel;
  } else {
    // We are done with the effect chain at this point so let's clear the
    // nextEffect pointers to assist with GC. If we have passive effects, we'll
    // clear this in flushPassiveEffects.
    nextEffect = firstEffect;

    while (nextEffect !== null) {
      var nextNextEffect = nextEffect.nextEffect;
      nextEffect.nextEffect = null;

      if (nextEffect.flags & Deletion) {
        detachFiberAfterEffects(nextEffect);
      }

      nextEffect = nextNextEffect;
    }
  } // Read this again, since an effect might have updated it


  remainingLanes = root.pendingLanes; // Check if there's remaining work on this root

  if (remainingLanes !== NoLanes) {
    {
      if (spawnedWorkDuringRender !== null) {
        var expirationTimes = spawnedWorkDuringRender;
        spawnedWorkDuringRender = null;

        for (var i = 0; i < expirationTimes.length; i++) {
          scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);
        }
      }

      schedulePendingInteractions(root, remainingLanes);
    }
  } else {
    // If there's no remaining work, we can clear the set of already failed
    // error boundaries.
    legacyErrorBoundariesThatAlreadyFailed = null;
  }

  {
    if (!rootDidHavePassiveEffects) {
      // If there are no passive effects, then we can complete the pending interactions.
      // Otherwise, we'll wait until after the passive effects are flushed.
      // Wait to do this until after remaining work has been scheduled,
      // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.
      finishPendingInteractions(root, lanes);
    }
  }

  if (remainingLanes === SyncLane) {
    // Count the number of times the root synchronously re-renders without
    // finishing. If there are too many, it indicates an infinite update loop.
    if (root === rootWithNestedUpdates) {
      nestedUpdateCount++;
    } else {
      nestedUpdateCount = 0;
      rootWithNestedUpdates = root;
    }
  } else {
    nestedUpdateCount = 0;
  }

  onCommitRoot(finishedWork.stateNode, renderPriorityLevel);

  {
    onCommitRoot$1();
  } // Always call this before exiting `commitRoot`, to ensure that any
  // additional work on this root is scheduled.


  ensureRootIsScheduled(root, now());

  if (hasUncaughtError) {
    hasUncaughtError = false;
    var _error3 = firstUncaughtError;
    firstUncaughtError = null;
    throw _error3;
  }

  if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
    // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired
    // synchronously, but layout updates should be deferred until the end
    // of the batch.


    return null;
  } // If layout work was scheduled, flush it now.


  flushSyncCallbackQueue();

  return null;
}

function commitBeforeMutationEffects() {
  while (nextEffect !== null) {
    var current = nextEffect.alternate;

    if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {
      if ((nextEffect.flags & Deletion) !== NoFlags) {
        if (doesFiberContain(nextEffect, focusedInstanceHandle)) {
          shouldFireAfterActiveInstanceBlur = true;
        }
      } else {
        // TODO: Move this out of the hot path using a dedicated effect tag.
        if (nextEffect.tag === SuspenseComponent && isSuspenseBoundaryBeingHidden(current, nextEffect) && doesFiberContain(nextEffect, focusedInstanceHandle)) {
          shouldFireAfterActiveInstanceBlur = true;
        }
      }
    }

    var flags = nextEffect.flags;

    if ((flags & Snapshot) !== NoFlags) {
      setCurrentFiber(nextEffect);
      commitBeforeMutationLifeCycles(current, nextEffect);
      resetCurrentFiber();
    }

    if ((flags & Passive) !== NoFlags) {
      // If there are passive effects, schedule a callback to flush at
      // the earliest opportunity.
      if (!rootDoesHavePassiveEffects) {
        rootDoesHavePassiveEffects = true;
        scheduleCallback(NormalPriority$1, function () {
          flushPassiveEffects();
          return null;
        });
      }
    }

    nextEffect = nextEffect.nextEffect;
  }
}

function commitMutationEffects(root, renderPriorityLevel) {
  // TODO: Should probably move the bulk of this function to commitWork.
  while (nextEffect !== null) {
    setCurrentFiber(nextEffect);
    var flags = nextEffect.flags;

    if (flags & ContentReset) {
      commitResetTextContent(nextEffect);
    }

    if (flags & Ref) {
      var current = nextEffect.alternate;

      if (current !== null) {
        commitDetachRef(current);
      }
    } // The following switch statement is only concerned about placement,
    // updates, and deletions. To avoid needing to add a case for every possible
    // bitmap value, we remove the secondary effects from the effect tag and
    // switch on that value.


    var primaryFlags = flags & (Placement | Update | Deletion | Hydrating);

    switch (primaryFlags) {
      case Placement:
        {
          commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
          // inserted, before any life-cycles like componentDidMount gets called.
          // TODO: findDOMNode doesn't rely on this any more but isMounted does
          // and isMounted is deprecated anyway so we should be able to kill this.

          nextEffect.flags &= ~Placement;
          break;
        }

      case PlacementAndUpdate:
        {
          // Placement
          commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
          // inserted, before any life-cycles like componentDidMount gets called.

          nextEffect.flags &= ~Placement; // Update

          var _current = nextEffect.alternate;
          commitWork(_current, nextEffect);
          break;
        }

      case Hydrating:
        {
          nextEffect.flags &= ~Hydrating;
          break;
        }

      case HydratingAndUpdate:
        {
          nextEffect.flags &= ~Hydrating; // Update

          var _current2 = nextEffect.alternate;
          commitWork(_current2, nextEffect);
          break;
        }

      case Update:
        {
          var _current3 = nextEffect.alternate;
          commitWork(_current3, nextEffect);
          break;
        }

      case Deletion:
        {
          commitDeletion(root, nextEffect);
          break;
        }
    }

    resetCurrentFiber();
    nextEffect = nextEffect.nextEffect;
  }
}

function commitLayoutEffects(root, committedLanes) {


  while (nextEffect !== null) {
    setCurrentFiber(nextEffect);
    var flags = nextEffect.flags;

    if (flags & (Update | Callback)) {
      var current = nextEffect.alternate;
      commitLifeCycles(root, current, nextEffect);
    }

    {
      if (flags & Ref) {
        commitAttachRef(nextEffect);
      }
    }

    resetCurrentFiber();
    nextEffect = nextEffect.nextEffect;
  }
}

function flushPassiveEffects() {
  // Returns whether passive effects were flushed.
  if (pendingPassiveEffectsRenderPriority !== NoPriority$1) {
    var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority$1 ? NormalPriority$1 : pendingPassiveEffectsRenderPriority;
    pendingPassiveEffectsRenderPriority = NoPriority$1;

    {
      return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);
    }
  }

  return false;
}
function enqueuePendingPassiveHookEffectMount(fiber, effect) {
  pendingPassiveHookEffectsMount.push(effect, fiber);

  if (!rootDoesHavePassiveEffects) {
    rootDoesHavePassiveEffects = true;
    scheduleCallback(NormalPriority$1, function () {
      flushPassiveEffects();
      return null;
    });
  }
}
function enqueuePendingPassiveHookEffectUnmount(fiber, effect) {
  pendingPassiveHookEffectsUnmount.push(effect, fiber);

  {
    fiber.flags |= PassiveUnmountPendingDev;
    var alternate = fiber.alternate;

    if (alternate !== null) {
      alternate.flags |= PassiveUnmountPendingDev;
    }
  }

  if (!rootDoesHavePassiveEffects) {
    rootDoesHavePassiveEffects = true;
    scheduleCallback(NormalPriority$1, function () {
      flushPassiveEffects();
      return null;
    });
  }
}

function invokePassiveEffectCreate(effect) {
  var create = effect.create;
  effect.destroy = create();
}

function flushPassiveEffectsImpl() {
  if (rootWithPendingPassiveEffects === null) {
    return false;
  }

  var root = rootWithPendingPassiveEffects;
  var lanes = pendingPassiveEffectsLanes;
  rootWithPendingPassiveEffects = null;
  pendingPassiveEffectsLanes = NoLanes;

  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
    {
      throw Error( "Cannot flush passive effects while already rendering." );
    }
  }

  {
    isFlushingPassiveEffects = true;
  }

  var prevExecutionContext = executionContext;
  executionContext |= CommitContext;
  var prevInteractions = pushInteractions(root); // It's important that ALL pending passive effect destroy functions are called
  // before ANY passive effect create functions are called.
  // Otherwise effects in sibling components might interfere with each other.
  // e.g. a destroy function in one component may unintentionally override a ref
  // value set by a create function in another component.
  // Layout effects have the same constraint.
  // First pass: Destroy stale passive effects.

  var unmountEffects = pendingPassiveHookEffectsUnmount;
  pendingPassiveHookEffectsUnmount = [];

  for (var i = 0; i < unmountEffects.length; i += 2) {
    var _effect = unmountEffects[i];
    var fiber = unmountEffects[i + 1];
    var destroy = _effect.destroy;
    _effect.destroy = undefined;

    {
      fiber.flags &= ~PassiveUnmountPendingDev;
      var alternate = fiber.alternate;

      if (alternate !== null) {
        alternate.flags &= ~PassiveUnmountPendingDev;
      }
    }

    if (typeof destroy === 'function') {
      {
        setCurrentFiber(fiber);

        {
          invokeGuardedCallback(null, destroy, null);
        }

        if (hasCaughtError()) {
          if (!(fiber !== null)) {
            {
              throw Error( "Should be working on an effect." );
            }
          }

          var error = clearCaughtError();
          captureCommitPhaseError(fiber, error);
        }

        resetCurrentFiber();
      }
    }
  } // Second pass: Create new passive effects.


  var mountEffects = pendingPassiveHookEffectsMount;
  pendingPassiveHookEffectsMount = [];

  for (var _i = 0; _i < mountEffects.length; _i += 2) {
    var _effect2 = mountEffects[_i];
    var _fiber = mountEffects[_i + 1];

    {
      setCurrentFiber(_fiber);

      {
        invokeGuardedCallback(null, invokePassiveEffectCreate, null, _effect2);
      }

      if (hasCaughtError()) {
        if (!(_fiber !== null)) {
          {
            throw Error( "Should be working on an effect." );
          }
        }

        var _error4 = clearCaughtError();

        captureCommitPhaseError(_fiber, _error4);
      }

      resetCurrentFiber();
    }
  } // Note: This currently assumes there are no passive effects on the root fiber
  // because the root is not part of its own effect list.
  // This could change in the future.


  var effect = root.current.firstEffect;

  while (effect !== null) {
    var nextNextEffect = effect.nextEffect; // Remove nextEffect pointer to assist GC

    effect.nextEffect = null;

    if (effect.flags & Deletion) {
      detachFiberAfterEffects(effect);
    }

    effect = nextNextEffect;
  }

  {
    popInteractions(prevInteractions);
    finishPendingInteractions(root, lanes);
  }

  {
    isFlushingPassiveEffects = false;
  }

  executionContext = prevExecutionContext;
  flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this
  // exceeds the limit, we'll fire a warning.

  nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
  return true;
}

function isAlreadyFailedLegacyErrorBoundary(instance) {
  return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
}
function markLegacyErrorBoundaryAsFailed(instance) {
  if (legacyErrorBoundariesThatAlreadyFailed === null) {
    legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
  } else {
    legacyErrorBoundariesThatAlreadyFailed.add(instance);
  }
}

function prepareToThrowUncaughtError(error) {
  if (!hasUncaughtError) {
    hasUncaughtError = true;
    firstUncaughtError = error;
  }
}

var onUncaughtError = prepareToThrowUncaughtError;

function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
  var errorInfo = createCapturedValue(error, sourceFiber);
  var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
  enqueueUpdate(rootFiber, update);
  var eventTime = requestEventTime();
  var root = markUpdateLaneFromFiberToRoot(rootFiber, SyncLane);

  if (root !== null) {
    markRootUpdated(root, SyncLane, eventTime);
    ensureRootIsScheduled(root, eventTime);
    schedulePendingInteractions(root, SyncLane);
  }
}

function captureCommitPhaseError(sourceFiber, error) {
  if (sourceFiber.tag === HostRoot) {
    // Error was thrown at the root. There is no parent, so the root
    // itself should capture it.
    captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
    return;
  }

  var fiber = sourceFiber.return;

  while (fiber !== null) {
    if (fiber.tag === HostRoot) {
      captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
      return;
    } else if (fiber.tag === ClassComponent) {
      var ctor = fiber.type;
      var instance = fiber.stateNode;

      if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
        var errorInfo = createCapturedValue(error, sourceFiber);
        var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
        enqueueUpdate(fiber, update);
        var eventTime = requestEventTime();
        var root = markUpdateLaneFromFiberToRoot(fiber, SyncLane);

        if (root !== null) {
          markRootUpdated(root, SyncLane, eventTime);
          ensureRootIsScheduled(root, eventTime);
          schedulePendingInteractions(root, SyncLane);
        } else {
          // This component has already been unmounted.
          // We can't schedule any follow up work for the root because the fiber is already unmounted,
          // but we can still call the log-only boundary so the error isn't swallowed.
          //
          // TODO This is only a temporary bandaid for the old reconciler fork.
          // We can delete this special case once the new fork is merged.
          if (typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
            try {
              instance.componentDidCatch(error, errorInfo);
            } catch (errorToIgnore) {// TODO Ignore this error? Rethrow it?
              // This is kind of an edge case.
            }
          }
        }

        return;
      }
    }

    fiber = fiber.return;
  }
}
function pingSuspendedRoot(root, wakeable, pingedLanes) {
  var pingCache = root.pingCache;

  if (pingCache !== null) {
    // The wakeable resolved, so we no longer need to memoize, because it will
    // never be thrown again.
    pingCache.delete(wakeable);
  }

  var eventTime = requestEventTime();
  markRootPinged(root, pingedLanes);

  if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
    // Received a ping at the same priority level at which we're currently
    // rendering. We might want to restart this render. This should mirror
    // the logic of whether or not a root suspends once it completes.
    // TODO: If we're rendering sync either due to Sync, Batched or expired,
    // we should probably never restart.
    // If we're suspended with delay, or if it's a retry, we'll always suspend
    // so we can always restart.
    if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
      // Restart from the root.
      prepareFreshStack(root, NoLanes);
    } else {
      // Even though we can't restart right now, we might get an
      // opportunity later. So we mark this render as having a ping.
      workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
    }
  }

  ensureRootIsScheduled(root, eventTime);
  schedulePendingInteractions(root, pingedLanes);
}

function retryTimedOutBoundary(boundaryFiber, retryLane) {
  // The boundary fiber (a Suspense component or SuspenseList component)
  // previously was rendered in its fallback state. One of the promises that
  // suspended it has resolved, which means at least part of the tree was
  // likely unblocked. Try rendering again, at a new expiration time.
  if (retryLane === NoLane) {
    retryLane = requestRetryLane(boundaryFiber);
  } // TODO: Special case idle priority?


  var eventTime = requestEventTime();
  var root = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane);

  if (root !== null) {
    markRootUpdated(root, retryLane, eventTime);
    ensureRootIsScheduled(root, eventTime);
    schedulePendingInteractions(root, retryLane);
  }
}
function resolveRetryWakeable(boundaryFiber, wakeable) {
  var retryLane = NoLane; // Default

  var retryCache;

  {
    retryCache = boundaryFiber.stateNode;
  }

  if (retryCache !== null) {
    // The wakeable resolved, so we no longer need to memoize, because it will
    // never be thrown again.
    retryCache.delete(wakeable);
  }

  retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.

function jnd(timeElapsed) {
  return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
}

function checkForNestedUpdates() {
  if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
    nestedUpdateCount = 0;
    rootWithNestedUpdates = null;

    {
      {
        throw Error( "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." );
      }
    }
  }

  {
    if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
      nestedPassiveUpdateCount = 0;

      error('Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');
    }
  }
}

function flushRenderPhaseStrictModeWarningsInDEV() {
  {
    ReactStrictModeWarnings.flushLegacyContextWarning();

    {
      ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
    }
  }
}

var didWarnStateUpdateForNotYetMountedComponent = null;

function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
  {
    if ((executionContext & RenderContext) !== NoContext) {
      // We let the other warning about render phase updates deal with this one.
      return;
    }

    if (!(fiber.mode & (BlockingMode | ConcurrentMode))) {
      return;
    }

    var tag = fiber.tag;

    if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
      // Only warn for user-defined components, not internal ones like Suspense.
      return;
    } // We show the whole stack but dedupe on the top component's name because
    // the problematic code almost always lies inside that component.


    var componentName = getComponentName(fiber.type) || 'ReactComponent';

    if (didWarnStateUpdateForNotYetMountedComponent !== null) {
      if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
        return;
      }

      didWarnStateUpdateForNotYetMountedComponent.add(componentName);
    } else {
      didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]);
    }

    var previousFiber = current;

    try {
      setCurrentFiber(fiber);

      error("Can't perform a React state update on a component that hasn't mounted yet. " + 'This indicates that you have a side-effect in your render function that ' + 'asynchronously later calls tries to update the component. Move this work to ' + 'useEffect instead.');
    } finally {
      if (previousFiber) {
        setCurrentFiber(fiber);
      } else {
        resetCurrentFiber();
      }
    }
  }
}

var didWarnStateUpdateForUnmountedComponent = null;

function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
  {
    var tag = fiber.tag;

    if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
      // Only warn for user-defined components, not internal ones like Suspense.
      return;
    } // If there are pending passive effects unmounts for this Fiber,
    // we can assume that they would have prevented this update.


    if ((fiber.flags & PassiveUnmountPendingDev) !== NoFlags) {
      return;
    } // We show the whole stack but dedupe on the top component's name because
    // the problematic code almost always lies inside that component.


    var componentName = getComponentName(fiber.type) || 'ReactComponent';

    if (didWarnStateUpdateForUnmountedComponent !== null) {
      if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
        return;
      }

      didWarnStateUpdateForUnmountedComponent.add(componentName);
    } else {
      didWarnStateUpdateForUnmountedComponent = new Set([componentName]);
    }

    if (isFlushingPassiveEffects) ; else {
      var previousFiber = current;

      try {
        setCurrentFiber(fiber);

        error("Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function');
      } finally {
        if (previousFiber) {
          setCurrentFiber(fiber);
        } else {
          resetCurrentFiber();
        }
      }
    }
  }
}

var beginWork$1;

{
  var dummyFiber = null;

  beginWork$1 = function (current, unitOfWork, lanes) {
    // If a component throws an error, we replay it again in a synchronously
    // dispatched event, so that the debugger will treat it as an uncaught
    // error See ReactErrorUtils for more information.
    // Before entering the begin phase, copy the work-in-progress onto a dummy
    // fiber. If beginWork throws, we'll use this to reset the state.
    var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);

    try {
      return beginWork(current, unitOfWork, lanes);
    } catch (originalError) {
      if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {
        // Don't replay promises. Treat everything else like an error.
        throw originalError;
      } // Keep this code in sync with handleError; any changes here must have
      // corresponding changes there.


      resetContextDependencies();
      resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the
      // same fiber again.
      // Unwind the failed stack frame

      unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber.

      assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);

      if ( unitOfWork.mode & ProfileMode) {
        // Reset the profiler timer.
        startProfilerTimer(unitOfWork);
      } // Run beginWork again.


      invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes);

      if (hasCaughtError()) {
        var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.
        // Rethrow this error instead of the original one.

        throw replayError;
      } else {
        // This branch is reachable if the render phase is impure.
        throw originalError;
      }
    }
  };
}

var didWarnAboutUpdateInRender = false;
var didWarnAboutUpdateInRenderForAnotherComponent;

{
  didWarnAboutUpdateInRenderForAnotherComponent = new Set();
}

function warnAboutRenderPhaseUpdatesInDEV(fiber) {
  {
    if (isRendering && (executionContext & RenderContext) !== NoContext && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
      switch (fiber.tag) {
        case FunctionComponent:
        case ForwardRef:
        case SimpleMemoComponent:
          {
            var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.

            var dedupeKey = renderingComponentName;

            if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
              didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
              var setStateComponentName = getComponentName(fiber.type) || 'Unknown';

              error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://reactjs.org/link/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);
            }

            break;
          }

        case ClassComponent:
          {
            if (!didWarnAboutUpdateInRender) {
              error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');

              didWarnAboutUpdateInRender = true;
            }

            break;
          }
      }
    }
  }
} // a 'shared' variable that changes when act() opens/closes in tests.


var IsThisRendererActing = {
  current: false
};
function warnIfNotScopedWithMatchingAct(fiber) {
  {
    if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
      var previousFiber = current;

      try {
        setCurrentFiber(fiber);

        error("It looks like you're using the wrong act() around your test interactions.\n" + 'Be sure to use the matching version of act() corresponding to your renderer:\n\n' + '// for react-dom:\n' + // Break up imports to avoid accidentally parsing them as dependencies.
        'import {act} fr' + "om 'react-dom/test-utils';\n" + '// ...\n' + 'act(() => ...);\n\n' + '// for react-test-renderer:\n' + // Break up imports to avoid accidentally parsing them as dependencies.
        'import TestRenderer fr' + "om react-test-renderer';\n" + 'const {act} = TestRenderer;\n' + '// ...\n' + 'act(() => ...);');
      } finally {
        if (previousFiber) {
          setCurrentFiber(fiber);
        } else {
          resetCurrentFiber();
        }
      }
    }
  }
}
function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
  {
    if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
      error('An update to %s ran an effect, but was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + '  /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act', getComponentName(fiber.type));
    }
  }
}

function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
  {
    if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
      var previousFiber = current;

      try {
        setCurrentFiber(fiber);

        error('An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + '  /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act', getComponentName(fiber.type));
      } finally {
        if (previousFiber) {
          setCurrentFiber(fiber);
        } else {
          resetCurrentFiber();
        }
      }
    }
  }
}

var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler.

var didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked
// scheduler is the actual recommendation. The alternative could be a testing build,
// a new lib, or whatever; we dunno just yet. This message is for early adopters
// to get their tests right.

function warnIfUnmockedScheduler(fiber) {
  {
    if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {
      if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
        didWarnAboutUnmockedScheduler = true;

        error('In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + // Break up requires to avoid accidentally parsing them as dependencies.
        "jest.mock('scheduler', () => require" + "('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://reactjs.org/link/mock-scheduler');
      }
    }
  }
}

function computeThreadID(root, lane) {
  // Interaction threads are unique per root and expiration time.
  // NOTE: Intentionally unsound cast. All that matters is that it's a number
  // and it represents a batch of work. Could make a helper function instead,
  // but meh this is fine for now.
  return lane * 1000 + root.interactionThreadID;
}

function markSpawnedWork(lane) {

  if (spawnedWorkDuringRender === null) {
    spawnedWorkDuringRender = [lane];
  } else {
    spawnedWorkDuringRender.push(lane);
  }
}

function scheduleInteractions(root, lane, interactions) {

  if (interactions.size > 0) {
    var pendingInteractionMap = root.pendingInteractionMap;
    var pendingInteractions = pendingInteractionMap.get(lane);

    if (pendingInteractions != null) {
      interactions.forEach(function (interaction) {
        if (!pendingInteractions.has(interaction)) {
          // Update the pending async work count for previously unscheduled interaction.
          interaction.__count++;
        }

        pendingInteractions.add(interaction);
      });
    } else {
      pendingInteractionMap.set(lane, new Set(interactions)); // Update the pending async work count for the current interactions.

      interactions.forEach(function (interaction) {
        interaction.__count++;
      });
    }

    var subscriber = tracing.__subscriberRef.current;

    if (subscriber !== null) {
      var threadID = computeThreadID(root, lane);
      subscriber.onWorkScheduled(interactions, threadID);
    }
  }
}

function schedulePendingInteractions(root, lane) {

  scheduleInteractions(root, lane, tracing.__interactionsRef.current);
}

function startWorkOnPendingInteractions(root, lanes) {
  // we can accurately attribute time spent working on it, And so that cascading
  // work triggered during the render phase will be associated with it.


  var interactions = new Set();
  root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledLane) {
    if (includesSomeLane(lanes, scheduledLane)) {
      scheduledInteractions.forEach(function (interaction) {
        return interactions.add(interaction);
      });
    }
  }); // Store the current set of interactions on the FiberRoot for a few reasons:
  // We can re-use it in hot functions like performConcurrentWorkOnRoot()
  // without having to recalculate it. We will also use it in commitWork() to
  // pass to any Profiler onRender() hooks. This also provides DevTools with a
  // way to access it when the onCommitRoot() hook is called.

  root.memoizedInteractions = interactions;

  if (interactions.size > 0) {
    var subscriber = tracing.__subscriberRef.current;

    if (subscriber !== null) {
      var threadID = computeThreadID(root, lanes);

      try {
        subscriber.onWorkStarted(interactions, threadID);
      } catch (error) {
        // If the subscriber throws, rethrow it in a separate task
        scheduleCallback(ImmediatePriority$1, function () {
          throw error;
        });
      }
    }
  }
}

function finishPendingInteractions(root, committedLanes) {

  var remainingLanesAfterCommit = root.pendingLanes;
  var subscriber;

  try {
    subscriber = tracing.__subscriberRef.current;

    if (subscriber !== null && root.memoizedInteractions.size > 0) {
      // FIXME: More than one lane can finish in a single commit.
      var threadID = computeThreadID(root, committedLanes);
      subscriber.onWorkStopped(root.memoizedInteractions, threadID);
    }
  } catch (error) {
    // If the subscriber throws, rethrow it in a separate task
    scheduleCallback(ImmediatePriority$1, function () {
      throw error;
    });
  } finally {
    // Clear completed interactions from the pending Map.
    // Unless the render was suspended or cascading work was scheduled,
    // In which case– leave pending interactions until the subsequent render.
    var pendingInteractionMap = root.pendingInteractionMap;
    pendingInteractionMap.forEach(function (scheduledInteractions, lane) {
      // Only decrement the pending interaction count if we're done.
      // If there's still work at the current priority,
      // That indicates that we are waiting for suspense data.
      if (!includesSomeLane(remainingLanesAfterCommit, lane)) {
        pendingInteractionMap.delete(lane);
        scheduledInteractions.forEach(function (interaction) {
          interaction.__count--;

          if (subscriber !== null && interaction.__count === 0) {
            try {
              subscriber.onInteractionScheduledWorkCompleted(interaction);
            } catch (error) {
              // If the subscriber throws, rethrow it in a separate task
              scheduleCallback(ImmediatePriority$1, function () {
                throw error;
              });
            }
          }
        });
      }
    });
  }
} // `act` testing API

function shouldForceFlushFallbacksInDEV() {
  // Never force flush in production. This function should get stripped out.
  return  actingUpdatesScopeDepth > 0;
}
// so we can tell if any async act() calls try to run in parallel.


var actingUpdatesScopeDepth = 0;

function detachFiberAfterEffects(fiber) {
  fiber.sibling = null;
  fiber.stateNode = null;
}

var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.

var failedBoundaries = null;
var setRefreshHandler = function (handler) {
  {
    resolveFamily = handler;
  }
};
function resolveFunctionForHotReloading(type) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return type;
    }

    var family = resolveFamily(type);

    if (family === undefined) {
      return type;
    } // Use the latest known implementation.


    return family.current;
  }
}
function resolveClassForHotReloading(type) {
  // No implementation differences.
  return resolveFunctionForHotReloading(type);
}
function resolveForwardRefForHotReloading(type) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return type;
    }

    var family = resolveFamily(type);

    if (family === undefined) {
      // Check if we're dealing with a real forwardRef. Don't want to crash early.
      if (type !== null && type !== undefined && typeof type.render === 'function') {
        // ForwardRef is special because its resolved .type is an object,
        // but it's possible that we only have its inner render function in the map.
        // If that inner render function is different, we'll build a new forwardRef type.
        var currentRender = resolveFunctionForHotReloading(type.render);

        if (type.render !== currentRender) {
          var syntheticType = {
            $$typeof: REACT_FORWARD_REF_TYPE,
            render: currentRender
          };

          if (type.displayName !== undefined) {
            syntheticType.displayName = type.displayName;
          }

          return syntheticType;
        }
      }

      return type;
    } // Use the latest known implementation.


    return family.current;
  }
}
function isCompatibleFamilyForHotReloading(fiber, element) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return false;
    }

    var prevType = fiber.elementType;
    var nextType = element.type; // If we got here, we know types aren't === equal.

    var needsCompareFamilies = false;
    var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;

    switch (fiber.tag) {
      case ClassComponent:
        {
          if (typeof nextType === 'function') {
            needsCompareFamilies = true;
          }

          break;
        }

      case FunctionComponent:
        {
          if (typeof nextType === 'function') {
            needsCompareFamilies = true;
          } else if ($$typeofNextType === REACT_LAZY_TYPE) {
            // We don't know the inner type yet.
            // We're going to assume that the lazy inner type is stable,
            // and so it is sufficient to avoid reconciling it away.
            // We're not going to unwrap or actually use the new lazy type.
            needsCompareFamilies = true;
          }

          break;
        }

      case ForwardRef:
        {
          if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
            needsCompareFamilies = true;
          } else if ($$typeofNextType === REACT_LAZY_TYPE) {
            needsCompareFamilies = true;
          }

          break;
        }

      case MemoComponent:
      case SimpleMemoComponent:
        {
          if ($$typeofNextType === REACT_MEMO_TYPE) {
            // TODO: if it was but can no longer be simple,
            // we shouldn't set this.
            needsCompareFamilies = true;
          } else if ($$typeofNextType === REACT_LAZY_TYPE) {
            needsCompareFamilies = true;
          }

          break;
        }

      default:
        return false;
    } // Check if both types have a family and it's the same one.


    if (needsCompareFamilies) {
      // Note: memo() and forwardRef() we'll compare outer rather than inner type.
      // This means both of them need to be registered to preserve state.
      // If we unwrapped and compared the inner types for wrappers instead,
      // then we would risk falsely saying two separate memo(Foo)
      // calls are equivalent because they wrap the same Foo function.
      var prevFamily = resolveFamily(prevType);

      if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {
        return true;
      }
    }

    return false;
  }
}
function markFailedErrorBoundaryForHotReloading(fiber) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return;
    }

    if (typeof WeakSet !== 'function') {
      return;
    }

    if (failedBoundaries === null) {
      failedBoundaries = new WeakSet();
    }

    failedBoundaries.add(fiber);
  }
}
var scheduleRefresh = function (root, update) {
  {
    if (resolveFamily === null) {
      // Hot reloading is disabled.
      return;
    }

    var staleFamilies = update.staleFamilies,
        updatedFamilies = update.updatedFamilies;
    flushPassiveEffects();
    flushSync(function () {
      scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);
    });
  }
};
var scheduleRoot = function (root, element) {
  {
    if (root.context !== emptyContextObject) {
      // Super edge case: root has a legacy _renderSubtree context
      // but we don't know the parentComponent so we can't pass it.
      // Just ignore. We'll delete this with _renderSubtree code path later.
      return;
    }

    flushPassiveEffects();
    flushSync(function () {
      updateContainer(element, root, null, null);
    });
  }
};

function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
  {
    var alternate = fiber.alternate,
        child = fiber.child,
        sibling = fiber.sibling,
        tag = fiber.tag,
        type = fiber.type;
    var candidateType = null;

    switch (tag) {
      case FunctionComponent:
      case SimpleMemoComponent:
      case ClassComponent:
        candidateType = type;
        break;

      case ForwardRef:
        candidateType = type.render;
        break;
    }

    if (resolveFamily === null) {
      throw new Error('Expected resolveFamily to be set during hot reload.');
    }

    var needsRender = false;
    var needsRemount = false;

    if (candidateType !== null) {
      var family = resolveFamily(candidateType);

      if (family !== undefined) {
        if (staleFamilies.has(family)) {
          needsRemount = true;
        } else if (updatedFamilies.has(family)) {
          if (tag === ClassComponent) {
            needsRemount = true;
          } else {
            needsRender = true;
          }
        }
      }
    }

    if (failedBoundaries !== null) {
      if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
        needsRemount = true;
      }
    }

    if (needsRemount) {
      fiber._debugNeedsRemount = true;
    }

    if (needsRemount || needsRender) {
      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
    }

    if (child !== null && !needsRemount) {
      scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
    }

    if (sibling !== null) {
      scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
    }
  }
}

var findHostInstancesForRefresh = function (root, families) {
  {
    var hostInstances = new Set();
    var types = new Set(families.map(function (family) {
      return family.current;
    }));
    findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);
    return hostInstances;
  }
};

function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
  {
    var child = fiber.child,
        sibling = fiber.sibling,
        tag = fiber.tag,
        type = fiber.type;
    var candidateType = null;

    switch (tag) {
      case FunctionComponent:
      case SimpleMemoComponent:
      case ClassComponent:
        candidateType = type;
        break;

      case ForwardRef:
        candidateType = type.render;
        break;
    }

    var didMatch = false;

    if (candidateType !== null) {
      if (types.has(candidateType)) {
        didMatch = true;
      }
    }

    if (didMatch) {
      // We have a match. This only drills down to the closest host components.
      // There's no need to search deeper because for the purpose of giving
      // visual feedback, "flashing" outermost parent rectangles is sufficient.
      findHostInstancesForFiberShallowly(fiber, hostInstances);
    } else {
      // If there's no match, maybe there will be one further down in the child tree.
      if (child !== null) {
        findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
      }
    }

    if (sibling !== null) {
      findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
    }
  }
}

function findHostInstancesForFiberShallowly(fiber, hostInstances) {
  {
    var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);

    if (foundHostInstances) {
      return;
    } // If we didn't find any host children, fallback to closest host parent.


    var node = fiber;

    while (true) {
      switch (node.tag) {
        case HostComponent:
          hostInstances.add(node.stateNode);
          return;

        case HostPortal:
          hostInstances.add(node.stateNode.containerInfo);
          return;

        case HostRoot:
          hostInstances.add(node.stateNode.containerInfo);
          return;
      }

      if (node.return === null) {
        throw new Error('Expected to reach root first.');
      }

      node = node.return;
    }
  }
}

function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
  {
    var node = fiber;
    var foundHostInstances = false;

    while (true) {
      if (node.tag === HostComponent) {
        // We got a match.
        foundHostInstances = true;
        hostInstances.add(node.stateNode); // There may still be more, so keep searching.
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }

      if (node === fiber) {
        return foundHostInstances;
      }

      while (node.sibling === null) {
        if (node.return === null || node.return === fiber) {
          return foundHostInstances;
        }

        node = node.return;
      }

      node.sibling.return = node.return;
      node = node.sibling;
    }
  }

  return false;
}

var hasBadMapPolyfill;

{
  hasBadMapPolyfill = false;

  try {
    var nonExtensibleObject = Object.preventExtensions({});
    /* eslint-disable no-new */

    new Map([[nonExtensibleObject, null]]);
    new Set([nonExtensibleObject]);
    /* eslint-enable no-new */
  } catch (e) {
    // TODO: Consider warning about bad polyfills
    hasBadMapPolyfill = true;
  }
}

var debugCounter = 1;

function FiberNode(tag, pendingProps, key, mode) {
  // Instance
  this.tag = tag;
  this.key = key;
  this.elementType = null;
  this.type = null;
  this.stateNode = null; // Fiber

  this.return = null;
  this.child = null;
  this.sibling = null;
  this.index = 0;
  this.ref = null;
  this.pendingProps = pendingProps;
  this.memoizedProps = null;
  this.updateQueue = null;
  this.memoizedState = null;
  this.dependencies = null;
  this.mode = mode; // Effects

  this.flags = NoFlags;
  this.nextEffect = null;
  this.firstEffect = null;
  this.lastEffect = null;
  this.lanes = NoLanes;
  this.childLanes = NoLanes;
  this.alternate = null;

  {
    // Note: The following is done to avoid a v8 performance cliff.
    //
    // Initializing the fields below to smis and later updating them with
    // double values will cause Fibers to end up having separate shapes.
    // This behavior/bug has something to do with Object.preventExtension().
    // Fortunately this only impacts DEV builds.
    // Unfortunately it makes React unusably slow for some applications.
    // To work around this, initialize the fields below with doubles.
    //
    // Learn more about this here:
    // https://github.com/facebook/react/issues/14365
    // https://bugs.chromium.org/p/v8/issues/detail?id=8538
    this.actualDuration = Number.NaN;
    this.actualStartTime = Number.NaN;
    this.selfBaseDuration = Number.NaN;
    this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.
    // This won't trigger the performance cliff mentioned above,
    // and it simplifies other profiler code (including DevTools).

    this.actualDuration = 0;
    this.actualStartTime = -1;
    this.selfBaseDuration = 0;
    this.treeBaseDuration = 0;
  }

  {
    // This isn't directly used but is handy for debugging internals:
    this._debugID = debugCounter++;
    this._debugSource = null;
    this._debugOwner = null;
    this._debugNeedsRemount = false;
    this._debugHookTypes = null;

    if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
      Object.preventExtensions(this);
    }
  }
} // This is a constructor function, rather than a POJO constructor, still
// please ensure we do the following:
// 1) Nobody should add any instance methods on this. Instance methods can be
//    more difficult to predict when they get optimized and they are almost
//    never inlined properly in static compilers.
// 2) Nobody should rely on `instanceof Fiber` for type testing. We should
//    always know when it is a fiber.
// 3) We might want to experiment with using numeric keys since they are easier
//    to optimize in a non-JIT environment.
// 4) We can easily go from a constructor to a createFiber object literal if that
//    is faster.
// 5) It should be easy to port this to a C struct and keep a C implementation
//    compatible.


var createFiber = function (tag, pendingProps, key, mode) {
  // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors
  return new FiberNode(tag, pendingProps, key, mode);
};

function shouldConstruct$1(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function isSimpleFunctionComponent(type) {
  return typeof type === 'function' && !shouldConstruct$1(type) && type.defaultProps === undefined;
}
function resolveLazyComponentTag(Component) {
  if (typeof Component === 'function') {
    return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;
  } else if (Component !== undefined && Component !== null) {
    var $$typeof = Component.$$typeof;

    if ($$typeof === REACT_FORWARD_REF_TYPE) {
      return ForwardRef;
    }

    if ($$typeof === REACT_MEMO_TYPE) {
      return MemoComponent;
    }
  }

  return IndeterminateComponent;
} // This is used to create an alternate fiber to do work on.

function createWorkInProgress(current, pendingProps) {
  var workInProgress = current.alternate;

  if (workInProgress === null) {
    // We use a double buffering pooling technique because we know that we'll
    // only ever need at most two versions of a tree. We pool the "other" unused
    // node that we're free to reuse. This is lazily created to avoid allocating
    // extra objects for things that are never updated. It also allow us to
    // reclaim the extra memory if needed.
    workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);
    workInProgress.elementType = current.elementType;
    workInProgress.type = current.type;
    workInProgress.stateNode = current.stateNode;

    {
      // DEV-only fields
      workInProgress._debugID = current._debugID;
      workInProgress._debugSource = current._debugSource;
      workInProgress._debugOwner = current._debugOwner;
      workInProgress._debugHookTypes = current._debugHookTypes;
    }

    workInProgress.alternate = current;
    current.alternate = workInProgress;
  } else {
    workInProgress.pendingProps = pendingProps; // Needed because Blocks store data on type.

    workInProgress.type = current.type; // We already have an alternate.
    // Reset the effect tag.

    workInProgress.flags = NoFlags; // The effect list is no longer valid.

    workInProgress.nextEffect = null;
    workInProgress.firstEffect = null;
    workInProgress.lastEffect = null;

    {
      // We intentionally reset, rather than copy, actualDuration & actualStartTime.
      // This prevents time from endlessly accumulating in new commits.
      // This has the downside of resetting values for different priority renders,
      // But works for yielding (the common case) and should support resuming.
      workInProgress.actualDuration = 0;
      workInProgress.actualStartTime = -1;
    }
  }

  workInProgress.childLanes = current.childLanes;
  workInProgress.lanes = current.lanes;
  workInProgress.child = current.child;
  workInProgress.memoizedProps = current.memoizedProps;
  workInProgress.memoizedState = current.memoizedState;
  workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so
  // it cannot be shared with the current fiber.

  var currentDependencies = current.dependencies;
  workInProgress.dependencies = currentDependencies === null ? null : {
    lanes: currentDependencies.lanes,
    firstContext: currentDependencies.firstContext
  }; // These will be overridden during the parent's reconciliation

  workInProgress.sibling = current.sibling;
  workInProgress.index = current.index;
  workInProgress.ref = current.ref;

  {
    workInProgress.selfBaseDuration = current.selfBaseDuration;
    workInProgress.treeBaseDuration = current.treeBaseDuration;
  }

  {
    workInProgress._debugNeedsRemount = current._debugNeedsRemount;

    switch (workInProgress.tag) {
      case IndeterminateComponent:
      case FunctionComponent:
      case SimpleMemoComponent:
        workInProgress.type = resolveFunctionForHotReloading(current.type);
        break;

      case ClassComponent:
        workInProgress.type = resolveClassForHotReloading(current.type);
        break;

      case ForwardRef:
        workInProgress.type = resolveForwardRefForHotReloading(current.type);
        break;
    }
  }

  return workInProgress;
} // Used to reuse a Fiber for a second pass.

function resetWorkInProgress(workInProgress, renderLanes) {
  // This resets the Fiber to what createFiber or createWorkInProgress would
  // have set the values to before during the first pass. Ideally this wouldn't
  // be necessary but unfortunately many code paths reads from the workInProgress
  // when they should be reading from current and writing to workInProgress.
  // We assume pendingProps, index, key, ref, return are still untouched to
  // avoid doing another reconciliation.
  // Reset the effect tag but keep any Placement tags, since that's something
  // that child fiber is setting, not the reconciliation.
  workInProgress.flags &= Placement; // The effect list is no longer valid.

  workInProgress.nextEffect = null;
  workInProgress.firstEffect = null;
  workInProgress.lastEffect = null;
  var current = workInProgress.alternate;

  if (current === null) {
    // Reset to createFiber's initial values.
    workInProgress.childLanes = NoLanes;
    workInProgress.lanes = renderLanes;
    workInProgress.child = null;
    workInProgress.memoizedProps = null;
    workInProgress.memoizedState = null;
    workInProgress.updateQueue = null;
    workInProgress.dependencies = null;
    workInProgress.stateNode = null;

    {
      // Note: We don't reset the actualTime counts. It's useful to accumulate
      // actual time across multiple render passes.
      workInProgress.selfBaseDuration = 0;
      workInProgress.treeBaseDuration = 0;
    }
  } else {
    // Reset to the cloned values that createWorkInProgress would've.
    workInProgress.childLanes = current.childLanes;
    workInProgress.lanes = current.lanes;
    workInProgress.child = current.child;
    workInProgress.memoizedProps = current.memoizedProps;
    workInProgress.memoizedState = current.memoizedState;
    workInProgress.updateQueue = current.updateQueue; // Needed because Blocks store data on type.

    workInProgress.type = current.type; // Clone the dependencies object. This is mutated during the render phase, so
    // it cannot be shared with the current fiber.

    var currentDependencies = current.dependencies;
    workInProgress.dependencies = currentDependencies === null ? null : {
      lanes: currentDependencies.lanes,
      firstContext: currentDependencies.firstContext
    };

    {
      // Note: We don't reset the actualTime counts. It's useful to accumulate
      // actual time across multiple render passes.
      workInProgress.selfBaseDuration = current.selfBaseDuration;
      workInProgress.treeBaseDuration = current.treeBaseDuration;
    }
  }

  return workInProgress;
}
function createHostRootFiber(tag) {
  var mode;

  if (tag === ConcurrentRoot) {
    mode = ConcurrentMode | BlockingMode | StrictMode;
  } else if (tag === BlockingRoot) {
    mode = BlockingMode | StrictMode;
  } else {
    mode = NoMode;
  }

  if ( isDevToolsPresent) {
    // Always collect profile timings when DevTools are present.
    // This enables DevTools to start capturing timing at any point–
    // Without some nodes in the tree having empty base times.
    mode |= ProfileMode;
  }

  return createFiber(HostRoot, null, null, mode);
}
function createFiberFromTypeAndProps(type, // React$ElementType
key, pendingProps, owner, mode, lanes) {
  var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.

  var resolvedType = type;

  if (typeof type === 'function') {
    if (shouldConstruct$1(type)) {
      fiberTag = ClassComponent;

      {
        resolvedType = resolveClassForHotReloading(resolvedType);
      }
    } else {
      {
        resolvedType = resolveFunctionForHotReloading(resolvedType);
      }
    }
  } else if (typeof type === 'string') {
    fiberTag = HostComponent;
  } else {
    getTag: switch (type) {
      case REACT_FRAGMENT_TYPE:
        return createFiberFromFragment(pendingProps.children, mode, lanes, key);

      case REACT_DEBUG_TRACING_MODE_TYPE:
        fiberTag = Mode;
        mode |= DebugTracingMode;
        break;

      case REACT_STRICT_MODE_TYPE:
        fiberTag = Mode;
        mode |= StrictMode;
        break;

      case REACT_PROFILER_TYPE:
        return createFiberFromProfiler(pendingProps, mode, lanes, key);

      case REACT_SUSPENSE_TYPE:
        return createFiberFromSuspense(pendingProps, mode, lanes, key);

      case REACT_SUSPENSE_LIST_TYPE:
        return createFiberFromSuspenseList(pendingProps, mode, lanes, key);

      case REACT_OFFSCREEN_TYPE:
        return createFiberFromOffscreen(pendingProps, mode, lanes, key);

      case REACT_LEGACY_HIDDEN_TYPE:
        return createFiberFromLegacyHidden(pendingProps, mode, lanes, key);

      case REACT_SCOPE_TYPE:

      // eslint-disable-next-line no-fallthrough

      default:
        {
          if (typeof type === 'object' && type !== null) {
            switch (type.$$typeof) {
              case REACT_PROVIDER_TYPE:
                fiberTag = ContextProvider;
                break getTag;

              case REACT_CONTEXT_TYPE:
                // This is a consumer
                fiberTag = ContextConsumer;
                break getTag;

              case REACT_FORWARD_REF_TYPE:
                fiberTag = ForwardRef;

                {
                  resolvedType = resolveForwardRefForHotReloading(resolvedType);
                }

                break getTag;

              case REACT_MEMO_TYPE:
                fiberTag = MemoComponent;
                break getTag;

              case REACT_LAZY_TYPE:
                fiberTag = LazyComponent;
                resolvedType = null;
                break getTag;

              case REACT_BLOCK_TYPE:
                fiberTag = Block;
                break getTag;
            }
          }

          var info = '';

          {
            if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
              info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
            }

            var ownerName = owner ? getComponentName(owner.type) : null;

            if (ownerName) {
              info += '\n\nCheck the render method of `' + ownerName + '`.';
            }
          }

          {
            {
              throw Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info );
            }
          }
        }
    }
  }

  var fiber = createFiber(fiberTag, pendingProps, key, mode);
  fiber.elementType = type;
  fiber.type = resolvedType;
  fiber.lanes = lanes;

  {
    fiber._debugOwner = owner;
  }

  return fiber;
}
function createFiberFromElement(element, mode, lanes) {
  var owner = null;

  {
    owner = element._owner;
  }

  var type = element.type;
  var key = element.key;
  var pendingProps = element.props;
  var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);

  {
    fiber._debugSource = element._source;
    fiber._debugOwner = element._owner;
  }

  return fiber;
}
function createFiberFromFragment(elements, mode, lanes, key) {
  var fiber = createFiber(Fragment, elements, key, mode);
  fiber.lanes = lanes;
  return fiber;
}

function createFiberFromProfiler(pendingProps, mode, lanes, key) {
  {
    if (typeof pendingProps.id !== 'string') {
      error('Profiler must specify an "id" as a prop');
    }
  }

  var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag.

  fiber.elementType = REACT_PROFILER_TYPE;
  fiber.type = REACT_PROFILER_TYPE;
  fiber.lanes = lanes;

  {
    fiber.stateNode = {
      effectDuration: 0,
      passiveEffectDuration: 0
    };
  }

  return fiber;
}

function createFiberFromSuspense(pendingProps, mode, lanes, key) {
  var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.
  // This needs to be fixed in getComponentName so that it relies on the tag
  // instead.

  fiber.type = REACT_SUSPENSE_TYPE;
  fiber.elementType = REACT_SUSPENSE_TYPE;
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
  var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);

  {
    // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.
    // This needs to be fixed in getComponentName so that it relies on the tag
    // instead.
    fiber.type = REACT_SUSPENSE_LIST_TYPE;
  }

  fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
  var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); // TODO: The OffscreenComponent fiber shouldn't have a type. It has a tag.
  // This needs to be fixed in getComponentName so that it relies on the tag
  // instead.

  {
    fiber.type = REACT_OFFSCREEN_TYPE;
  }

  fiber.elementType = REACT_OFFSCREEN_TYPE;
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromLegacyHidden(pendingProps, mode, lanes, key) {
  var fiber = createFiber(LegacyHiddenComponent, pendingProps, key, mode); // TODO: The LegacyHidden fiber shouldn't have a type. It has a tag.
  // This needs to be fixed in getComponentName so that it relies on the tag
  // instead.

  {
    fiber.type = REACT_LEGACY_HIDDEN_TYPE;
  }

  fiber.elementType = REACT_LEGACY_HIDDEN_TYPE;
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromText(content, mode, lanes) {
  var fiber = createFiber(HostText, content, null, mode);
  fiber.lanes = lanes;
  return fiber;
}
function createFiberFromHostInstanceForDeletion() {
  var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type.

  fiber.elementType = 'DELETED';
  fiber.type = 'DELETED';
  return fiber;
}
function createFiberFromPortal(portal, mode, lanes) {
  var pendingProps = portal.children !== null ? portal.children : [];
  var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
  fiber.lanes = lanes;
  fiber.stateNode = {
    containerInfo: portal.containerInfo,
    pendingChildren: null,
    // Used by persistent updates
    implementation: portal.implementation
  };
  return fiber;
} // Used for stashing WIP properties to replay failed work in DEV.

function assignFiberPropertiesInDEV(target, source) {
  if (target === null) {
    // This Fiber's initial properties will always be overwritten.
    // We only use a Fiber to ensure the same hidden class so DEV isn't slow.
    target = createFiber(IndeterminateComponent, null, null, NoMode);
  } // This is intentionally written as a list of all properties.
  // We tried to use Object.assign() instead but this is called in
  // the hottest path, and Object.assign() was too slow:
  // https://github.com/facebook/react/issues/12502
  // This code is DEV-only so size is not a concern.


  target.tag = source.tag;
  target.key = source.key;
  target.elementType = source.elementType;
  target.type = source.type;
  target.stateNode = source.stateNode;
  target.return = source.return;
  target.child = source.child;
  target.sibling = source.sibling;
  target.index = source.index;
  target.ref = source.ref;
  target.pendingProps = source.pendingProps;
  target.memoizedProps = source.memoizedProps;
  target.updateQueue = source.updateQueue;
  target.memoizedState = source.memoizedState;
  target.dependencies = source.dependencies;
  target.mode = source.mode;
  target.flags = source.flags;
  target.nextEffect = source.nextEffect;
  target.firstEffect = source.firstEffect;
  target.lastEffect = source.lastEffect;
  target.lanes = source.lanes;
  target.childLanes = source.childLanes;
  target.alternate = source.alternate;

  {
    target.actualDuration = source.actualDuration;
    target.actualStartTime = source.actualStartTime;
    target.selfBaseDuration = source.selfBaseDuration;
    target.treeBaseDuration = source.treeBaseDuration;
  }

  target._debugID = source._debugID;
  target._debugSource = source._debugSource;
  target._debugOwner = source._debugOwner;
  target._debugNeedsRemount = source._debugNeedsRemount;
  target._debugHookTypes = source._debugHookTypes;
  return target;
}

function FiberRootNode(containerInfo, tag, hydrate) {
  this.tag = tag;
  this.containerInfo = containerInfo;
  this.pendingChildren = null;
  this.current = null;
  this.pingCache = null;
  this.finishedWork = null;
  this.timeoutHandle = noTimeout;
  this.context = null;
  this.pendingContext = null;
  this.hydrate = hydrate;
  this.callbackNode = null;
  this.callbackPriority = NoLanePriority;
  this.eventTimes = createLaneMap(NoLanes);
  this.expirationTimes = createLaneMap(NoTimestamp);
  this.pendingLanes = NoLanes;
  this.suspendedLanes = NoLanes;
  this.pingedLanes = NoLanes;
  this.expiredLanes = NoLanes;
  this.mutableReadLanes = NoLanes;
  this.finishedLanes = NoLanes;
  this.entangledLanes = NoLanes;
  this.entanglements = createLaneMap(NoLanes);

  {
    this.mutableSourceEagerHydrationData = null;
  }

  {
    this.interactionThreadID = tracing.unstable_getThreadID();
    this.memoizedInteractions = new Set();
    this.pendingInteractionMap = new Map();
  }

  {
    switch (tag) {
      case BlockingRoot:
        this._debugRootType = 'createBlockingRoot()';
        break;

      case ConcurrentRoot:
        this._debugRootType = 'createRoot()';
        break;

      case LegacyRoot:
        this._debugRootType = 'createLegacyRoot()';
        break;
    }
  }
}

function createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {
  var root = new FiberRootNode(containerInfo, tag, hydrate);
  // stateNode is any.


  var uninitializedFiber = createHostRootFiber(tag);
  root.current = uninitializedFiber;
  uninitializedFiber.stateNode = root;
  initializeUpdateQueue(uninitializedFiber);
  return root;
}

// This ensures that the version used for server rendering matches the one
// that is eventually read during hydration.
// If they don't match there's a potential tear and a full deopt render is required.

function registerMutableSourceForHydration(root, mutableSource) {
  var getVersion = mutableSource._getVersion;
  var version = getVersion(mutableSource._source); // TODO Clear this data once all pending hydration work is finished.
  // Retaining it forever may interfere with GC.

  if (root.mutableSourceEagerHydrationData == null) {
    root.mutableSourceEagerHydrationData = [mutableSource, version];
  } else {
    root.mutableSourceEagerHydrationData.push(mutableSource, version);
  }
}

function createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
  var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  return {
    // This tag allow us to uniquely identify this as a React Portal
    $$typeof: REACT_PORTAL_TYPE,
    key: key == null ? null : '' + key,
    children: children,
    containerInfo: containerInfo,
    implementation: implementation
  };
}

var didWarnAboutNestedUpdates;
var didWarnAboutFindNodeInStrictMode;

{
  didWarnAboutNestedUpdates = false;
  didWarnAboutFindNodeInStrictMode = {};
}

function getContextForSubtree(parentComponent) {
  if (!parentComponent) {
    return emptyContextObject;
  }

  var fiber = get(parentComponent);
  var parentContext = findCurrentUnmaskedContext(fiber);

  if (fiber.tag === ClassComponent) {
    var Component = fiber.type;

    if (isContextProvider(Component)) {
      return processChildContext(fiber, Component, parentContext);
    }
  }

  return parentContext;
}

function findHostInstanceWithWarning(component, methodName) {
  {
    var fiber = get(component);

    if (fiber === undefined) {
      if (typeof component.render === 'function') {
        {
          {
            throw Error( "Unable to find node on an unmounted component." );
          }
        }
      } else {
        {
          {
            throw Error( "Argument appears to not be a ReactComponent. Keys: " + Object.keys(component) );
          }
        }
      }
    }

    var hostFiber = findCurrentHostFiber(fiber);

    if (hostFiber === null) {
      return null;
    }

    if (hostFiber.mode & StrictMode) {
      var componentName = getComponentName(fiber.type) || 'Component';

      if (!didWarnAboutFindNodeInStrictMode[componentName]) {
        didWarnAboutFindNodeInStrictMode[componentName] = true;
        var previousFiber = current;

        try {
          setCurrentFiber(hostFiber);

          if (fiber.mode & StrictMode) {
            error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName);
          } else {
            error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName);
          }
        } finally {
          // Ideally this should reset to previous but this shouldn't be called in
          // render and there's another warning for that anyway.
          if (previousFiber) {
            setCurrentFiber(previousFiber);
          } else {
            resetCurrentFiber();
          }
        }
      }
    }

    return hostFiber.stateNode;
  }
}

function createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {
  return createFiberRoot(containerInfo, tag, hydrate);
}
function updateContainer(element, container, parentComponent, callback) {
  {
    onScheduleRoot(container, element);
  }

  var current$1 = container.current;
  var eventTime = requestEventTime();

  {
    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
    if ('undefined' !== typeof jest) {
      warnIfUnmockedScheduler(current$1);
      warnIfNotScopedWithMatchingAct(current$1);
    }
  }

  var lane = requestUpdateLane(current$1);

  var context = getContextForSubtree(parentComponent);

  if (container.context === null) {
    container.context = context;
  } else {
    container.pendingContext = context;
  }

  {
    if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
      didWarnAboutNestedUpdates = true;

      error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
    }
  }

  var update = createUpdate(eventTime, lane); // Caution: React DevTools currently depends on this property
  // being called "element".

  update.payload = {
    element: element
  };
  callback = callback === undefined ? null : callback;

  if (callback !== null) {
    {
      if (typeof callback !== 'function') {
        error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
      }
    }

    update.callback = callback;
  }

  enqueueUpdate(current$1, update);
  scheduleUpdateOnFiber(current$1, lane, eventTime);
  return lane;
}
function getPublicRootInstance(container) {
  var containerFiber = container.current;

  if (!containerFiber.child) {
    return null;
  }

  switch (containerFiber.child.tag) {
    case HostComponent:
      return getPublicInstance(containerFiber.child.stateNode);

    default:
      return containerFiber.child.stateNode;
  }
}

function markRetryLaneImpl(fiber, retryLane) {
  var suspenseState = fiber.memoizedState;

  if (suspenseState !== null && suspenseState.dehydrated !== null) {
    suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
  }
} // Increases the priority of thennables when they resolve within this boundary.


function markRetryLaneIfNotHydrated(fiber, retryLane) {
  markRetryLaneImpl(fiber, retryLane);
  var alternate = fiber.alternate;

  if (alternate) {
    markRetryLaneImpl(alternate, retryLane);
  }
}

function attemptUserBlockingHydration$1(fiber) {
  if (fiber.tag !== SuspenseComponent) {
    // We ignore HostRoots here because we can't increase
    // their priority and they should not suspend on I/O,
    // since you have to wrap anything that might suspend in
    // Suspense.
    return;
  }

  var eventTime = requestEventTime();
  var lane = InputDiscreteHydrationLane;
  scheduleUpdateOnFiber(fiber, lane, eventTime);
  markRetryLaneIfNotHydrated(fiber, lane);
}
function attemptContinuousHydration$1(fiber) {
  if (fiber.tag !== SuspenseComponent) {
    // We ignore HostRoots here because we can't increase
    // their priority and they should not suspend on I/O,
    // since you have to wrap anything that might suspend in
    // Suspense.
    return;
  }

  var eventTime = requestEventTime();
  var lane = SelectiveHydrationLane;
  scheduleUpdateOnFiber(fiber, lane, eventTime);
  markRetryLaneIfNotHydrated(fiber, lane);
}
function attemptHydrationAtCurrentPriority$1(fiber) {
  if (fiber.tag !== SuspenseComponent) {
    // We ignore HostRoots here because we can't increase
    // their priority other than synchronously flush it.
    return;
  }

  var eventTime = requestEventTime();
  var lane = requestUpdateLane(fiber);
  scheduleUpdateOnFiber(fiber, lane, eventTime);
  markRetryLaneIfNotHydrated(fiber, lane);
}
function runWithPriority$2(priority, fn) {

  try {
    setCurrentUpdateLanePriority(priority);
    return fn();
  } finally {
  }
}
function findHostInstanceWithNoPortals(fiber) {
  var hostFiber = findCurrentHostFiberWithNoPortals(fiber);

  if (hostFiber === null) {
    return null;
  }

  if (hostFiber.tag === FundamentalComponent) {
    return hostFiber.stateNode.instance;
  }

  return hostFiber.stateNode;
}

var shouldSuspendImpl = function (fiber) {
  return false;
};

function shouldSuspend(fiber) {
  return shouldSuspendImpl(fiber);
}
var overrideHookState = null;
var overrideHookStateDeletePath = null;
var overrideHookStateRenamePath = null;
var overrideProps = null;
var overridePropsDeletePath = null;
var overridePropsRenamePath = null;
var scheduleUpdate = null;
var setSuspenseHandler = null;

{
  var copyWithDeleteImpl = function (obj, path, index) {
    var key = path[index];
    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);

    if (index + 1 === path.length) {
      if (Array.isArray(updated)) {
        updated.splice(key, 1);
      } else {
        delete updated[key];
      }

      return updated;
    } // $FlowFixMe number or string is fine here


    updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);
    return updated;
  };

  var copyWithDelete = function (obj, path) {
    return copyWithDeleteImpl(obj, path, 0);
  };

  var copyWithRenameImpl = function (obj, oldPath, newPath, index) {
    var oldKey = oldPath[index];
    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);

    if (index + 1 === oldPath.length) {
      var newKey = newPath[index]; // $FlowFixMe number or string is fine here

      updated[newKey] = updated[oldKey];

      if (Array.isArray(updated)) {
        updated.splice(oldKey, 1);
      } else {
        delete updated[oldKey];
      }
    } else {
      // $FlowFixMe number or string is fine here
      updated[oldKey] = copyWithRenameImpl( // $FlowFixMe number or string is fine here
      obj[oldKey], oldPath, newPath, index + 1);
    }

    return updated;
  };

  var copyWithRename = function (obj, oldPath, newPath) {
    if (oldPath.length !== newPath.length) {
      warn('copyWithRename() expects paths of the same length');

      return;
    } else {
      for (var i = 0; i < newPath.length - 1; i++) {
        if (oldPath[i] !== newPath[i]) {
          warn('copyWithRename() expects paths to be the same except for the deepest key');

          return;
        }
      }
    }

    return copyWithRenameImpl(obj, oldPath, newPath, 0);
  };

  var copyWithSetImpl = function (obj, path, index, value) {
    if (index >= path.length) {
      return value;
    }

    var key = path[index];
    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here

    updated[key] = copyWithSetImpl(obj[key], path, index + 1, value);
    return updated;
  };

  var copyWithSet = function (obj, path, value) {
    return copyWithSetImpl(obj, path, 0, value);
  };

  var findHook = function (fiber, id) {
    // For now, the "id" of stateful hooks is just the stateful hook index.
    // This may change in the future with e.g. nested hooks.
    var currentHook = fiber.memoizedState;

    while (currentHook !== null && id > 0) {
      currentHook = currentHook.next;
      id--;
    }

    return currentHook;
  }; // Support DevTools editable values for useState and useReducer.


  overrideHookState = function (fiber, id, path, value) {
    var hook = findHook(fiber, id);

    if (hook !== null) {
      var newState = copyWithSet(hook.memoizedState, path, value);
      hook.memoizedState = newState;
      hook.baseState = newState; // We aren't actually adding an update to the queue,
      // because there is no update we can add for useReducer hooks that won't trigger an error.
      // (There's no appropriate action type for DevTools overrides.)
      // As a result though, React will see the scheduled update as a noop and bailout.
      // Shallow cloning props works as a workaround for now to bypass the bailout check.

      fiber.memoizedProps = _assign({}, fiber.memoizedProps);
      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
    }
  };

  overrideHookStateDeletePath = function (fiber, id, path) {
    var hook = findHook(fiber, id);

    if (hook !== null) {
      var newState = copyWithDelete(hook.memoizedState, path);
      hook.memoizedState = newState;
      hook.baseState = newState; // We aren't actually adding an update to the queue,
      // because there is no update we can add for useReducer hooks that won't trigger an error.
      // (There's no appropriate action type for DevTools overrides.)
      // As a result though, React will see the scheduled update as a noop and bailout.
      // Shallow cloning props works as a workaround for now to bypass the bailout check.

      fiber.memoizedProps = _assign({}, fiber.memoizedProps);
      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
    }
  };

  overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) {
    var hook = findHook(fiber, id);

    if (hook !== null) {
      var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
      hook.memoizedState = newState;
      hook.baseState = newState; // We aren't actually adding an update to the queue,
      // because there is no update we can add for useReducer hooks that won't trigger an error.
      // (There's no appropriate action type for DevTools overrides.)
      // As a result though, React will see the scheduled update as a noop and bailout.
      // Shallow cloning props works as a workaround for now to bypass the bailout check.

      fiber.memoizedProps = _assign({}, fiber.memoizedProps);
      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
    }
  }; // Support DevTools props for function components, forwardRef, memo, host components, etc.


  overrideProps = function (fiber, path, value) {
    fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);

    if (fiber.alternate) {
      fiber.alternate.pendingProps = fiber.pendingProps;
    }

    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
  };

  overridePropsDeletePath = function (fiber, path) {
    fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);

    if (fiber.alternate) {
      fiber.alternate.pendingProps = fiber.pendingProps;
    }

    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
  };

  overridePropsRenamePath = function (fiber, oldPath, newPath) {
    fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);

    if (fiber.alternate) {
      fiber.alternate.pendingProps = fiber.pendingProps;
    }

    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
  };

  scheduleUpdate = function (fiber) {
    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
  };

  setSuspenseHandler = function (newShouldSuspendImpl) {
    shouldSuspendImpl = newShouldSuspendImpl;
  };
}

function findHostInstanceByFiber(fiber) {
  var hostFiber = findCurrentHostFiber(fiber);

  if (hostFiber === null) {
    return null;
  }

  return hostFiber.stateNode;
}

function emptyFindFiberByHostInstance(instance) {
  return null;
}

function getCurrentFiberForDevTools() {
  return current;
}

function injectIntoDevTools(devToolsConfig) {
  var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
  var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
  return injectInternals({
    bundleType: devToolsConfig.bundleType,
    version: devToolsConfig.version,
    rendererPackageName: devToolsConfig.rendererPackageName,
    rendererConfig: devToolsConfig.rendererConfig,
    overrideHookState: overrideHookState,
    overrideHookStateDeletePath: overrideHookStateDeletePath,
    overrideHookStateRenamePath: overrideHookStateRenamePath,
    overrideProps: overrideProps,
    overridePropsDeletePath: overridePropsDeletePath,
    overridePropsRenamePath: overridePropsRenamePath,
    setSuspenseHandler: setSuspenseHandler,
    scheduleUpdate: scheduleUpdate,
    currentDispatcherRef: ReactCurrentDispatcher,
    findHostInstanceByFiber: findHostInstanceByFiber,
    findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
    // React Refresh
    findHostInstancesForRefresh:  findHostInstancesForRefresh ,
    scheduleRefresh:  scheduleRefresh ,
    scheduleRoot:  scheduleRoot ,
    setRefreshHandler:  setRefreshHandler ,
    // Enables DevTools to append owner stacks to error messages in DEV mode.
    getCurrentFiber:  getCurrentFiberForDevTools 
  });
}

function ReactDOMRoot(container, options) {
  this._internalRoot = createRootImpl(container, ConcurrentRoot, options);
}

function ReactDOMBlockingRoot(container, tag, options) {
  this._internalRoot = createRootImpl(container, tag, options);
}

ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children) {
  var root = this._internalRoot;

  {
    if (typeof arguments[1] === 'function') {
      error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');
    }

    var container = root.containerInfo;

    if (container.nodeType !== COMMENT_NODE) {
      var hostInstance = findHostInstanceWithNoPortals(root.current);

      if (hostInstance) {
        if (hostInstance.parentNode !== container) {
          error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + "root.unmount() to empty a root's container.");
        }
      }
    }
  }

  updateContainer(children, root, null, null);
};

ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function () {
  {
    if (typeof arguments[0] === 'function') {
      error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');
    }
  }

  var root = this._internalRoot;
  var container = root.containerInfo;
  updateContainer(null, root, null, function () {
    unmarkContainerAsRoot(container);
  });
};

function createRootImpl(container, tag, options) {
  // Tag is either LegacyRoot or Concurrent Root
  var hydrate = options != null && options.hydrate === true;
  var hydrationCallbacks = options != null && options.hydrationOptions || null;
  var mutableSources = options != null && options.hydrationOptions != null && options.hydrationOptions.mutableSources || null;
  var root = createContainer(container, tag, hydrate);
  markContainerAsRoot(root.current, container);
  var containerNodeType = container.nodeType;

  {
    var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
    listenToAllSupportedEvents(rootContainerElement);
  }

  if (mutableSources) {
    for (var i = 0; i < mutableSources.length; i++) {
      var mutableSource = mutableSources[i];
      registerMutableSourceForHydration(root, mutableSource);
    }
  }

  return root;
}
function createLegacyRoot(container, options) {
  return new ReactDOMBlockingRoot(container, LegacyRoot, options);
}
function isValidContainer(node) {
  return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
}

var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
var topLevelUpdateWarnings;
var warnedAboutHydrateAPI = false;

{
  topLevelUpdateWarnings = function (container) {
    if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
      var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);

      if (hostInstance) {
        if (hostInstance.parentNode !== container) {
          error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');
        }
      }
    }

    var isRootRenderedBySomeReact = !!container._reactRootContainer;
    var rootEl = getReactRootElementInContainer(container);
    var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));

    if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
      error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');
    }

    if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {
      error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');
    }
  };
}

function getReactRootElementInContainer(container) {
  if (!container) {
    return null;
  }

  if (container.nodeType === DOCUMENT_NODE) {
    return container.documentElement;
  } else {
    return container.firstChild;
  }
}

function shouldHydrateDueToLegacyHeuristic(container) {
  var rootElement = getReactRootElementInContainer(container);
  return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
}

function legacyCreateRootFromDOMContainer(container, forceHydrate) {
  var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content.

  if (!shouldHydrate) {
    var warned = false;
    var rootSibling;

    while (rootSibling = container.lastChild) {
      {
        if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
          warned = true;

          error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
        }
      }

      container.removeChild(rootSibling);
    }
  }

  {
    if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
      warnedAboutHydrateAPI = true;

      warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v18. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
    }
  }

  return createLegacyRoot(container, shouldHydrate ? {
    hydrate: true
  } : undefined);
}

function warnOnInvalidCallback$1(callback, callerName) {
  {
    if (callback !== null && typeof callback !== 'function') {
      error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
    }
  }
}

function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
  {
    topLevelUpdateWarnings(container);
    warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');
  } // TODO: Without `any` type, Flow says "Property cannot be accessed on any
  // member of intersection type." Whyyyyyy.


  var root = container._reactRootContainer;
  var fiberRoot;

  if (!root) {
    // Initial mount
    root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
    fiberRoot = root._internalRoot;

    if (typeof callback === 'function') {
      var originalCallback = callback;

      callback = function () {
        var instance = getPublicRootInstance(fiberRoot);
        originalCallback.call(instance);
      };
    } // Initial mount should not be batched.


    unbatchedUpdates(function () {
      updateContainer(children, fiberRoot, parentComponent, callback);
    });
  } else {
    fiberRoot = root._internalRoot;

    if (typeof callback === 'function') {
      var _originalCallback = callback;

      callback = function () {
        var instance = getPublicRootInstance(fiberRoot);

        _originalCallback.call(instance);
      };
    } // Update


    updateContainer(children, fiberRoot, parentComponent, callback);
  }

  return getPublicRootInstance(fiberRoot);
}

function findDOMNode(componentOrElement) {
  {
    var owner = ReactCurrentOwner$3.current;

    if (owner !== null && owner.stateNode !== null) {
      var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;

      if (!warnedAboutRefsInRender) {
        error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component');
      }

      owner.stateNode._warnedAboutRefsInRender = true;
    }
  }

  if (componentOrElement == null) {
    return null;
  }

  if (componentOrElement.nodeType === ELEMENT_NODE) {
    return componentOrElement;
  }

  {
    return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');
  }
}
function hydrate(element, container, callback) {
  if (!isValidContainer(container)) {
    {
      throw Error( "Target container is not a DOM element." );
    }
  }

  {
    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;

    if (isModernRoot) {
      error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');
    }
  } // TODO: throw or warn if we couldn't hydrate?


  return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
}
function render(element, container, callback) {
  if (!isValidContainer(container)) {
    {
      throw Error( "Target container is not a DOM element." );
    }
  }

  {
    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;

    if (isModernRoot) {
      error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');
    }
  }

  return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
}
function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
  if (!isValidContainer(containerNode)) {
    {
      throw Error( "Target container is not a DOM element." );
    }
  }

  if (!(parentComponent != null && has(parentComponent))) {
    {
      throw Error( "parentComponent must be a valid React Component" );
    }
  }

  return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
}
function unmountComponentAtNode(container) {
  if (!isValidContainer(container)) {
    {
      throw Error( "unmountComponentAtNode(...): Target container is not a DOM element." );
    }
  }

  {
    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;

    if (isModernRoot) {
      error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');
    }
  }

  if (container._reactRootContainer) {
    {
      var rootEl = getReactRootElementInContainer(container);
      var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);

      if (renderedByDifferentReact) {
        error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.');
      }
    } // Unmount should not be batched.


    unbatchedUpdates(function () {
      legacyRenderSubtreeIntoContainer(null, null, container, false, function () {
        // $FlowFixMe This should probably use `delete container._reactRootContainer`
        container._reactRootContainer = null;
        unmarkContainerAsRoot(container);
      });
    }); // If you call unmountComponentAtNode twice in quick succession, you'll
    // get `true` twice. That's probably fine?

    return true;
  } else {
    {
      var _rootEl = getReactRootElementInContainer(container);

      var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl)); // Check if the container itself is a React root node.

      var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;

      if (hasNonRootReactChild) {
        error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');
      }
    }

    return false;
  }
}

setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
setAttemptContinuousHydration(attemptContinuousHydration$1);
setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
setAttemptHydrationAtPriority(runWithPriority$2);
var didWarnAboutUnstableCreatePortal = false;

{
  if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype
  Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype
  Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
    error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
  }
}

setRestoreImplementation(restoreControlledState$3);
setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);

function createPortal$1(children, container) {
  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

  if (!isValidContainer(container)) {
    {
      throw Error( "Target container is not a DOM element." );
    }
  } // TODO: pass ReactDOM portal implementation as third argument
  // $FlowFixMe The Flow type is opaque but there's no way to actually create it.


  return createPortal(children, container, null, key);
}

function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {

  return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
}

function unstable_createPortal(children, container) {
  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

  {
    if (!didWarnAboutUnstableCreatePortal) {
      didWarnAboutUnstableCreatePortal = true;

      warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 18+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
    }
  }

  return createPortal$1(children, container, key);
}

var Internals = {
  // Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js.
  // This is an array for better minification.
  Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, flushPassiveEffects, // TODO: This is related to `act`, not events. Move to separate key?
  IsThisRendererActing]
};
var foundDevTools = injectIntoDevTools({
  findFiberByHostInstance: getClosestInstanceFromNode,
  bundleType:  1 ,
  version: ReactVersion,
  rendererPackageName: 'react-dom'
});

{
  if (!foundDevTools && canUseDOM && window.top === window.self) {
    // If we're in Chrome or Firefox, provide a download link if not installed.
    if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
      var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.

      if (/^(https?|file):$/.test(protocol)) {
        // eslint-disable-next-line react-internal/no-production-logging
        console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://reactjs.org/link/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://reactjs.org/link/react-devtools-faq' : ''), 'font-weight:bold');
      }
    }
  }
}

exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = createPortal$1;
exports.findDOMNode = findDOMNode;
exports.flushSync = flushSync;
exports.hydrate = hydrate;
exports.render = render;
exports.unmountComponentAtNode = unmountComponentAtNode;
exports.unstable_batchedUpdates = batchedUpdates$1;
exports.unstable_createPortal = unstable_createPortal;
exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
exports.version = ReactVersion;
  })();
}


/***/ }),

/***/ "../../../../node_modules/react-dom/index.js":
/*!***************************************************!*\
  !*** ../../../../node_modules/react-dom/index.js ***!
  \***************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1228726__) => {

"use strict";


function checkDCE() {
  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  if (
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
  ) {
    return;
  }
  if (true) {
    // This branch is unreachable because this function is only called
    // in production, but the condition is true only in development.
    // Therefore if the branch is still here, dead code elimination wasn't
    // properly applied.
    // Don't change the message. React DevTools relies on it. Also make sure
    // this message doesn't occur elsewhere in this function, or it will cause
    // a false positive.
    throw new Error('^_^');
  }
  try {
    // Verify that the code above has been dead code eliminated (DCE'd).
    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  } catch (err) {
    // DevTools shouldn't crash React, no matter what.
    // We should still report in case we break this code.
    console.error(err);
  }
}

if (false) {} else {
  module.exports = __nested_webpack_require_1228726__(/*! ./cjs/react-dom.development.js */ "../../../../node_modules/react-dom/cjs/react-dom.development.js");
}


/***/ }),

/***/ "../../../../node_modules/react/cjs/react-jsx-runtime.development.js":
/*!***************************************************************************!*\
  !*** ../../../../node_modules/react/cjs/react-jsx-runtime.development.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_1230300__) => {

"use strict";
/** @license React v17.0.2
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var React = __nested_webpack_require_1230300__(/*! react */ "../../../../node_modules/react/index.js");
var _assign = __nested_webpack_require_1230300__(/*! object-assign */ "../../../../node_modules/object-assign/index.js");

// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
exports.Fragment = 0xeacb;
var REACT_STRICT_MODE_TYPE = 0xeacc;
var REACT_PROFILER_TYPE = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
var REACT_SUSPENSE_TYPE = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_BLOCK_TYPE = 0xead9;
var REACT_SERVER_BLOCK_TYPE = 0xeada;
var REACT_FUNDAMENTAL_TYPE = 0xead5;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;

if (typeof Symbol === 'function' && Symbol.for) {
  var symbolFor = Symbol.for;
  REACT_ELEMENT_TYPE = symbolFor('react.element');
  REACT_PORTAL_TYPE = symbolFor('react.portal');
  exports.Fragment = symbolFor('react.fragment');
  REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
  REACT_PROFILER_TYPE = symbolFor('react.profiler');
  REACT_PROVIDER_TYPE = symbolFor('react.provider');
  REACT_CONTEXT_TYPE = symbolFor('react.context');
  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
  REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
  REACT_MEMO_TYPE = symbolFor('react.memo');
  REACT_LAZY_TYPE = symbolFor('react.lazy');
  REACT_BLOCK_TYPE = symbolFor('react.block');
  REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
  REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
  REACT_SCOPE_TYPE = symbolFor('react.scope');
  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
}

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }

  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];

  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }

  return null;
}

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

function error(format) {
  {
    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      args[_key2 - 1] = arguments[_key2];
    }

    printWarning('error', format, args);
  }
}

function printWarning(level, format, args) {
  // When changing this logic, you might want to also
  // update consoleWithStackDev.www.js as well.
  {
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();

    if (stack !== '') {
      format += '%s';
      args = args.concat([stack]);
    }

    var argsWithFormat = args.map(function (item) {
      return '' + item;
    }); // Careful: RN currently depends on this prefix

    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
    // breaks IE9: https://github.com/facebook/react/issues/13610
    // eslint-disable-next-line react-internal/no-production-logging

    Function.prototype.apply.call(console[level], console, argsWithFormat);
  }
}

// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.

var enableScopeAPI = false; // Experimental Create Event Handle API.

function isValidElementType(type) {
  if (typeof type === 'string' || typeof type === 'function') {
    return true;
  } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).


  if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
    return true;
  }

  if (typeof type === 'object' && type !== null) {
    if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
      return true;
    }
  }

  return false;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
}

function getContextName(type) {
  return type.displayName || 'Context';
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }

  {
    if (typeof type.tag === 'number') {
      error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }

  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }

  if (typeof type === 'string') {
    return type;
  }

  switch (type) {
    case exports.Fragment:
      return 'Fragment';

    case REACT_PORTAL_TYPE:
      return 'Portal';

    case REACT_PROFILER_TYPE:
      return 'Profiler';

    case REACT_STRICT_MODE_TYPE:
      return 'StrictMode';

    case REACT_SUSPENSE_TYPE:
      return 'Suspense';

    case REACT_SUSPENSE_LIST_TYPE:
      return 'SuspenseList';
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        var context = type;
        return getContextName(context) + '.Consumer';

      case REACT_PROVIDER_TYPE:
        var provider = type;
        return getContextName(provider._context) + '.Provider';

      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');

      case REACT_MEMO_TYPE:
        return getComponentName(type.type);

      case REACT_BLOCK_TYPE:
        return getComponentName(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            return getComponentName(init(payload));
          } catch (x) {
            return null;
          }
        }
    }
  }

  return null;
}

// Helpers to patch console.logs to avoid logging during side-effect free
// replaying on render function. This currently only patches the object
// lazily which won't cover if the log function was extracted eagerly.
// We could also eagerly patch the method.
var disabledDepth = 0;
var prevLog;
var prevInfo;
var prevWarn;
var prevError;
var prevGroup;
var prevGroupCollapsed;
var prevGroupEnd;

function disabledLog() {}

disabledLog.__reactDisabledLog = true;
function disableLogs() {
  {
    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      prevLog = console.log;
      prevInfo = console.info;
      prevWarn = console.warn;
      prevError = console.error;
      prevGroup = console.group;
      prevGroupCollapsed = console.groupCollapsed;
      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099

      var props = {
        configurable: true,
        enumerable: true,
        value: disabledLog,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        info: props,
        log: props,
        warn: props,
        error: props,
        group: props,
        groupCollapsed: props,
        groupEnd: props
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    disabledDepth++;
  }
}
function reenableLogs() {
  {
    disabledDepth--;

    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      var props = {
        configurable: true,
        enumerable: true,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        log: _assign({}, props, {
          value: prevLog
        }),
        info: _assign({}, props, {
          value: prevInfo
        }),
        warn: _assign({}, props, {
          value: prevWarn
        }),
        error: _assign({}, props, {
          value: prevError
        }),
        group: _assign({}, props, {
          value: prevGroup
        }),
        groupCollapsed: _assign({}, props, {
          value: prevGroupCollapsed
        }),
        groupEnd: _assign({}, props, {
          value: prevGroupEnd
        })
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    if (disabledDepth < 0) {
      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
    }
  }
}

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name, source, ownerFn) {
  {
    if (prefix === undefined) {
      // Extract the VM specific prefix used by each line.
      try {
        throw Error();
      } catch (x) {
        var match = x.stack.trim().match(/\n( *(at )?)/);
        prefix = match && match[1] || '';
      }
    } // We use the prefix to ensure our stacks line up with native stack frames.


    return '\n' + prefix + name;
  }
}
var reentry = false;
var componentFrameCache;

{
  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
  componentFrameCache = new PossiblyWeakMap();
}

function describeNativeComponentFrame(fn, construct) {
  // If something asked for a stack inside a fake render, it should get ignored.
  if (!fn || reentry) {
    return '';
  }

  {
    var frame = componentFrameCache.get(fn);

    if (frame !== undefined) {
      return frame;
    }
  }

  var control;
  reentry = true;
  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.

  Error.prepareStackTrace = undefined;
  var previousDispatcher;

  {
    previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
    // for warnings.

    ReactCurrentDispatcher.current = null;
    disableLogs();
  }

  try {
    // This should throw.
    if (construct) {
      // Something should be setting the props in the constructor.
      var Fake = function () {
        throw Error();
      }; // $FlowFixMe


      Object.defineProperty(Fake.prototype, 'props', {
        set: function () {
          // We use a throwing setter instead of frozen or non-writable props
          // because that won't throw in a non-strict mode function.
          throw Error();
        }
      });

      if (typeof Reflect === 'object' && Reflect.construct) {
        // We construct a different control for this case to include any extra
        // frames added by the construct call.
        try {
          Reflect.construct(Fake, []);
        } catch (x) {
          control = x;
        }

        Reflect.construct(fn, [], Fake);
      } else {
        try {
          Fake.call();
        } catch (x) {
          control = x;
        }

        fn.call(Fake.prototype);
      }
    } else {
      try {
        throw Error();
      } catch (x) {
        control = x;
      }

      fn();
    }
  } catch (sample) {
    // This is inlined manually because closure doesn't do it for us.
    if (sample && control && typeof sample.stack === 'string') {
      // This extracts the first frame from the sample that isn't also in the control.
      // Skipping one frame that we assume is the frame that calls the two.
      var sampleLines = sample.stack.split('\n');
      var controlLines = control.stack.split('\n');
      var s = sampleLines.length - 1;
      var c = controlLines.length - 1;

      while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
        // We expect at least one stack frame to be shared.
        // Typically this will be the root most one. However, stack frames may be
        // cut off due to maximum stack limits. In this case, one maybe cut off
        // earlier than the other. We assume that the sample is longer or the same
        // and there for cut off earlier. So we should find the root most frame in
        // the sample somewhere in the control.
        c--;
      }

      for (; s >= 1 && c >= 0; s--, c--) {
        // Next we find the first one that isn't the same which should be the
        // frame that called our sample function and the control.
        if (sampleLines[s] !== controlLines[c]) {
          // In V8, the first line is describing the message but other VMs don't.
          // If we're about to return the first line, and the control is also on the same
          // line, that's a pretty good indicator that our sample threw at same line as
          // the control. I.e. before we entered the sample frame. So we ignore this result.
          // This can happen if you passed a class to function component, or non-function.
          if (s !== 1 || c !== 1) {
            do {
              s--;
              c--; // We may still have similar intermediate frames from the construct call.
              // The next one that isn't the same should be our match though.

              if (c < 0 || sampleLines[s] !== controlLines[c]) {
                // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
                var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');

                {
                  if (typeof fn === 'function') {
                    componentFrameCache.set(fn, _frame);
                  }
                } // Return the line we found.


                return _frame;
              }
            } while (s >= 1 && c >= 0);
          }

          break;
        }
      }
    }
  } finally {
    reentry = false;

    {
      ReactCurrentDispatcher.current = previousDispatcher;
      reenableLogs();
    }

    Error.prepareStackTrace = previousPrepareStackTrace;
  } // Fallback to just using the name if we couldn't make it throw.


  var name = fn ? fn.displayName || fn.name : '';
  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';

  {
    if (typeof fn === 'function') {
      componentFrameCache.set(fn, syntheticFrame);
    }
  }

  return syntheticFrame;
}
function describeFunctionComponentFrame(fn, source, ownerFn) {
  {
    return describeNativeComponentFrame(fn, false);
  }
}

function shouldConstruct(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {

  if (type == null) {
    return '';
  }

  if (typeof type === 'function') {
    {
      return describeNativeComponentFrame(type, shouldConstruct(type));
    }
  }

  if (typeof type === 'string') {
    return describeBuiltInComponentFrame(type);
  }

  switch (type) {
    case REACT_SUSPENSE_TYPE:
      return describeBuiltInComponentFrame('Suspense');

    case REACT_SUSPENSE_LIST_TYPE:
      return describeBuiltInComponentFrame('SuspenseList');
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_FORWARD_REF_TYPE:
        return describeFunctionComponentFrame(type.render);

      case REACT_MEMO_TYPE:
        // Memo may contain any component type so we recursively resolve it.
        return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);

      case REACT_BLOCK_TYPE:
        return describeFunctionComponentFrame(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            // Lazy may contain any component type so we recursively resolve it.
            return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
          } catch (x) {}
        }
    }
  }

  return '';
}

var loggedTypeFailures = {};
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame.setExtraStackFrame(null);
    }
  }
}

function checkPropTypes(typeSpecs, values, location, componentName, element) {
  {
    // $FlowFixMe This is okay but Flow doesn't know it.
    var has = Function.call.bind(Object.prototype.hasOwnProperty);

    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.

        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
            err.name = 'Invariant Violation';
            throw err;
          }

          error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
        } catch (ex) {
          error$1 = ex;
        }

        if (error$1 && !(error$1 instanceof Error)) {
          setCurrentlyValidatingElement(element);

          error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);

          setCurrentlyValidatingElement(null);
        }

        if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error$1.message] = true;
          setCurrentlyValidatingElement(element);

          error('Failed %s type: %s', location, error$1.message);

          setCurrentlyValidatingElement(null);
        }
      }
    }
  }
}

var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var RESERVED_PROPS = {
  key: true,
  ref: true,
  __self: true,
  __source: true
};
var specialPropKeyWarningShown;
var specialPropRefWarningShown;
var didWarnAboutStringRefs;

{
  didWarnAboutStringRefs = {};
}

function hasValidRef(config) {
  {
    if (hasOwnProperty.call(config, 'ref')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.ref !== undefined;
}

function hasValidKey(config) {
  {
    if (hasOwnProperty.call(config, 'key')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.key !== undefined;
}

function warnIfStringRefCannotBeAutoConverted(config, self) {
  {
    if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
      var componentName = getComponentName(ReactCurrentOwner.current.type);

      if (!didWarnAboutStringRefs[componentName]) {
        error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);

        didWarnAboutStringRefs[componentName] = true;
      }
    }
  }
}

function defineKeyPropWarningGetter(props, displayName) {
  {
    var warnAboutAccessingKey = function () {
      if (!specialPropKeyWarningShown) {
        specialPropKeyWarningShown = true;

        error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    };

    warnAboutAccessingKey.isReactWarning = true;
    Object.defineProperty(props, 'key', {
      get: warnAboutAccessingKey,
      configurable: true
    });
  }
}

function defineRefPropWarningGetter(props, displayName) {
  {
    var warnAboutAccessingRef = function () {
      if (!specialPropRefWarningShown) {
        specialPropRefWarningShown = true;

        error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    };

    warnAboutAccessingRef.isReactWarning = true;
    Object.defineProperty(props, 'ref', {
      get: warnAboutAccessingRef,
      configurable: true
    });
  }
}
/**
 * Factory method to create a new React element. This no longer adheres to
 * the class pattern, so do not use new to call it. Also, instanceof check
 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
 * if something is a React Element.
 *
 * @param {*} type
 * @param {*} props
 * @param {*} key
 * @param {string|object} ref
 * @param {*} owner
 * @param {*} self A *temporary* helper to detect places where `this` is
 * different from the `owner` when React.createElement is called, so that we
 * can warn. We want to get rid of owner and replace string `ref`s with arrow
 * functions, and as long as `this` and owner are the same, there will be no
 * change in behavior.
 * @param {*} source An annotation object (added by a transpiler or otherwise)
 * indicating filename, line number, and/or other information.
 * @internal
 */


var ReactElement = function (type, key, ref, self, source, owner, props) {
  var element = {
    // This tag allows us to uniquely identify this as a React Element
    $$typeof: REACT_ELEMENT_TYPE,
    // Built-in properties that belong on the element
    type: type,
    key: key,
    ref: ref,
    props: props,
    // Record the component responsible for creating this element.
    _owner: owner
  };

  {
    // The validation flag is currently mutative. We put it on
    // an external backing store so that we can freeze the whole object.
    // This can be replaced with a WeakMap once they are implemented in
    // commonly used development environments.
    element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
    // the validation flag non-enumerable (where possible, which should
    // include every environment we run tests in), so the test framework
    // ignores it.

    Object.defineProperty(element._store, 'validated', {
      configurable: false,
      enumerable: false,
      writable: true,
      value: false
    }); // self and source are DEV only properties.

    Object.defineProperty(element, '_self', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: self
    }); // Two elements created in two different places should be considered
    // equal for testing purposes and therefore we hide it from enumeration.

    Object.defineProperty(element, '_source', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: source
    });

    if (Object.freeze) {
      Object.freeze(element.props);
      Object.freeze(element);
    }
  }

  return element;
};
/**
 * https://github.com/reactjs/rfcs/pull/107
 * @param {*} type
 * @param {object} props
 * @param {string} key
 */

function jsxDEV(type, config, maybeKey, source, self) {
  {
    var propName; // Reserved names are extracted

    var props = {};
    var key = null;
    var ref = null; // Currently, key can be spread in as a prop. This causes a potential
    // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
    // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
    // but as an intermediary step, we will use jsxDEV for everything except
    // <div {...props} key="Hi" />, because we aren't currently able to tell if
    // key is explicitly declared to be undefined or not.

    if (maybeKey !== undefined) {
      key = '' + maybeKey;
    }

    if (hasValidKey(config)) {
      key = '' + config.key;
    }

    if (hasValidRef(config)) {
      ref = config.ref;
      warnIfStringRefCannotBeAutoConverted(config, self);
    } // Remaining properties are added to a new props object


    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        props[propName] = config[propName];
      }
    } // Resolve default props


    if (type && type.defaultProps) {
      var defaultProps = type.defaultProps;

      for (propName in defaultProps) {
        if (props[propName] === undefined) {
          props[propName] = defaultProps[propName];
        }
      }
    }

    if (key || ref) {
      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;

      if (key) {
        defineKeyPropWarningGetter(props, displayName);
      }

      if (ref) {
        defineRefPropWarningGetter(props, displayName);
      }
    }

    return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  }
}

var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement$1(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame$1.setExtraStackFrame(null);
    }
  }
}

var propTypesMisspellWarningShown;

{
  propTypesMisspellWarningShown = false;
}
/**
 * Verifies the object is a ReactElement.
 * See https://reactjs.org/docs/react-api.html#isvalidelement
 * @param {?object} object
 * @return {boolean} True if `object` is a ReactElement.
 * @final
 */

function isValidElement(object) {
  {
    return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  }
}

function getDeclarationErrorAddendum() {
  {
    if (ReactCurrentOwner$1.current) {
      var name = getComponentName(ReactCurrentOwner$1.current.type);

      if (name) {
        return '\n\nCheck the render method of `' + name + '`.';
      }
    }

    return '';
  }
}

function getSourceInfoErrorAddendum(source) {
  {
    if (source !== undefined) {
      var fileName = source.fileName.replace(/^.*[\\\/]/, '');
      var lineNumber = source.lineNumber;
      return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
    }

    return '';
  }
}
/**
 * Warn if there's no key explicitly set on dynamic arrays of children or
 * object keys are not valid. This allows us to keep track of children between
 * updates.
 */


var ownerHasKeyUseWarning = {};

function getCurrentComponentErrorInfo(parentType) {
  {
    var info = getDeclarationErrorAddendum();

    if (!info) {
      var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;

      if (parentName) {
        info = "\n\nCheck the top-level render call using <" + parentName + ">.";
      }
    }

    return info;
  }
}
/**
 * Warn if the element doesn't have an explicit key assigned to it.
 * This element is in an array. The array could grow and shrink or be
 * reordered. All children that haven't already been validated are required to
 * have a "key" property assigned to it. Error statuses are cached so a warning
 * will only be shown once.
 *
 * @internal
 * @param {ReactElement} element Element that requires a key.
 * @param {*} parentType element's parent's type.
 */


function validateExplicitKey(element, parentType) {
  {
    if (!element._store || element._store.validated || element.key != null) {
      return;
    }

    element._store.validated = true;
    var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);

    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
      return;
    }

    ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
    // property, it may be the creator of the child that's responsible for
    // assigning it a key.

    var childOwner = '';

    if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
      // Give the component that originally created this child.
      childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
    }

    setCurrentlyValidatingElement$1(element);

    error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);

    setCurrentlyValidatingElement$1(null);
  }
}
/**
 * Ensure that every element either is passed in a static location, in an
 * array with an explicit keys property defined, or in an object literal
 * with valid key property.
 *
 * @internal
 * @param {ReactNode} node Statically passed child of any type.
 * @param {*} parentType node's parent's type.
 */


function validateChildKeys(node, parentType) {
  {
    if (typeof node !== 'object') {
      return;
    }

    if (Array.isArray(node)) {
      for (var i = 0; i < node.length; i++) {
        var child = node[i];

        if (isValidElement(child)) {
          validateExplicitKey(child, parentType);
        }
      }
    } else if (isValidElement(node)) {
      // This element was passed in a valid location.
      if (node._store) {
        node._store.validated = true;
      }
    } else if (node) {
      var iteratorFn = getIteratorFn(node);

      if (typeof iteratorFn === 'function') {
        // Entry iterators used to provide implicit keys,
        // but now we print a separate warning for them later.
        if (iteratorFn !== node.entries) {
          var iterator = iteratorFn.call(node);
          var step;

          while (!(step = iterator.next()).done) {
            if (isValidElement(step.value)) {
              validateExplicitKey(step.value, parentType);
            }
          }
        }
      }
    }
  }
}
/**
 * Given an element, validate that its props follow the propTypes definition,
 * provided by the type.
 *
 * @param {ReactElement} element
 */


function validatePropTypes(element) {
  {
    var type = element.type;

    if (type === null || type === undefined || typeof type === 'string') {
      return;
    }

    var propTypes;

    if (typeof type === 'function') {
      propTypes = type.propTypes;
    } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
    // Inner props are checked in the reconciler.
    type.$$typeof === REACT_MEMO_TYPE)) {
      propTypes = type.propTypes;
    } else {
      return;
    }

    if (propTypes) {
      // Intentionally inside to avoid triggering lazy initializers:
      var name = getComponentName(type);
      checkPropTypes(propTypes, element.props, 'prop', name, element);
    } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
      propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:

      var _name = getComponentName(type);

      error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
    }

    if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
      error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
    }
  }
}
/**
 * Given a fragment, validate that it can only be provided with fragment props
 * @param {ReactElement} fragment
 */


function validateFragmentProps(fragment) {
  {
    var keys = Object.keys(fragment.props);

    for (var i = 0; i < keys.length; i++) {
      var key = keys[i];

      if (key !== 'children' && key !== 'key') {
        setCurrentlyValidatingElement$1(fragment);

        error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);

        setCurrentlyValidatingElement$1(null);
        break;
      }
    }

    if (fragment.ref !== null) {
      setCurrentlyValidatingElement$1(fragment);

      error('Invalid attribute `ref` supplied to `React.Fragment`.');

      setCurrentlyValidatingElement$1(null);
    }
  }
}

function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
  {
    var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
    // succeed and there will likely be errors in render.

    if (!validType) {
      var info = '';

      if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
        info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
      }

      var sourceInfo = getSourceInfoErrorAddendum(source);

      if (sourceInfo) {
        info += sourceInfo;
      } else {
        info += getDeclarationErrorAddendum();
      }

      var typeString;

      if (type === null) {
        typeString = 'null';
      } else if (Array.isArray(type)) {
        typeString = 'array';
      } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
        typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
        info = ' Did you accidentally export a JSX literal instead of a component?';
      } else {
        typeString = typeof type;
      }

      error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
    }

    var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
    // TODO: Drop this when these are no longer allowed as the type argument.

    if (element == null) {
      return element;
    } // Skip key warning if the type isn't valid since our key validation logic
    // doesn't expect a non-string/function type and can throw confusing errors.
    // We don't want exception behavior to differ between dev and prod.
    // (Rendering will throw with a helpful message and as soon as the type is
    // fixed, the key warnings will appear.)


    if (validType) {
      var children = props.children;

      if (children !== undefined) {
        if (isStaticChildren) {
          if (Array.isArray(children)) {
            for (var i = 0; i < children.length; i++) {
              validateChildKeys(children[i], type);
            }

            if (Object.freeze) {
              Object.freeze(children);
            }
          } else {
            error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
          }
        } else {
          validateChildKeys(children, type);
        }
      }
    }

    if (type === exports.Fragment) {
      validateFragmentProps(element);
    } else {
      validatePropTypes(element);
    }

    return element;
  }
} // These two functions exist to still get child warnings in dev
// even with the prod transform. This means that jsxDEV is purely
// opt-in behavior for better messages but that we won't stop
// giving you warnings if you use production apis.

function jsxWithValidationStatic(type, props, key) {
  {
    return jsxWithValidation(type, props, key, true);
  }
}
function jsxWithValidationDynamic(type, props, key) {
  {
    return jsxWithValidation(type, props, key, false);
  }
}

var jsx =  jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
// for now we can ship identical prod functions

var jsxs =  jsxWithValidationStatic ;

exports.jsx = jsx;
exports.jsxs = jsxs;
  })();
}


/***/ }),

/***/ "../../../../node_modules/react/cjs/react.development.js":
/*!***************************************************************!*\
  !*** ../../../../node_modules/react/cjs/react.development.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, exports, __nested_webpack_require_1269099__) => {

"use strict";
/** @license React v17.0.2
 * react.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var _assign = __nested_webpack_require_1269099__(/*! object-assign */ "../../../../node_modules/object-assign/index.js");

// TODO: this is special because it gets imported during build.
var ReactVersion = '17.0.2';

// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
exports.Fragment = 0xeacb;
exports.StrictMode = 0xeacc;
exports.Profiler = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
exports.Suspense = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_BLOCK_TYPE = 0xead9;
var REACT_SERVER_BLOCK_TYPE = 0xeada;
var REACT_FUNDAMENTAL_TYPE = 0xead5;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;

if (typeof Symbol === 'function' && Symbol.for) {
  var symbolFor = Symbol.for;
  REACT_ELEMENT_TYPE = symbolFor('react.element');
  REACT_PORTAL_TYPE = symbolFor('react.portal');
  exports.Fragment = symbolFor('react.fragment');
  exports.StrictMode = symbolFor('react.strict_mode');
  exports.Profiler = symbolFor('react.profiler');
  REACT_PROVIDER_TYPE = symbolFor('react.provider');
  REACT_CONTEXT_TYPE = symbolFor('react.context');
  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
  exports.Suspense = symbolFor('react.suspense');
  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
  REACT_MEMO_TYPE = symbolFor('react.memo');
  REACT_LAZY_TYPE = symbolFor('react.lazy');
  REACT_BLOCK_TYPE = symbolFor('react.block');
  REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
  REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
  REACT_SCOPE_TYPE = symbolFor('react.scope');
  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
}

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }

  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];

  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }

  return null;
}

/**
 * Keeps track of the current dispatcher.
 */
var ReactCurrentDispatcher = {
  /**
   * @internal
   * @type {ReactComponent}
   */
  current: null
};

/**
 * Keeps track of the current batch's configuration such as how long an update
 * should suspend for if it needs to.
 */
var ReactCurrentBatchConfig = {
  transition: 0
};

/**
 * Keeps track of the current owner.
 *
 * The current owner is the component who should own any components that are
 * currently being constructed.
 */
var ReactCurrentOwner = {
  /**
   * @internal
   * @type {ReactComponent}
   */
  current: null
};

var ReactDebugCurrentFrame = {};
var currentExtraStackFrame = null;
function setExtraStackFrame(stack) {
  {
    currentExtraStackFrame = stack;
  }
}

{
  ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
    {
      currentExtraStackFrame = stack;
    }
  }; // Stack implementation injected by the current renderer.


  ReactDebugCurrentFrame.getCurrentStack = null;

  ReactDebugCurrentFrame.getStackAddendum = function () {
    var stack = ''; // Add an extra top frame while an element is being validated

    if (currentExtraStackFrame) {
      stack += currentExtraStackFrame;
    } // Delegate to the injected renderer-specific implementation


    var impl = ReactDebugCurrentFrame.getCurrentStack;

    if (impl) {
      stack += impl() || '';
    }

    return stack;
  };
}

/**
 * Used by act() to track whether you're inside an act() scope.
 */
var IsSomeRendererActing = {
  current: false
};

var ReactSharedInternals = {
  ReactCurrentDispatcher: ReactCurrentDispatcher,
  ReactCurrentBatchConfig: ReactCurrentBatchConfig,
  ReactCurrentOwner: ReactCurrentOwner,
  IsSomeRendererActing: IsSomeRendererActing,
  // Used by renderers to avoid bundling object-assign twice in UMD bundles:
  assign: _assign
};

{
  ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
}

// by calls to these methods by a Babel plugin.
//
// In PROD (or in packages without access to React internals),
// they are left as they are instead.

function warn(format) {
  {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    printWarning('warn', format, args);
  }
}
function error(format) {
  {
    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      args[_key2 - 1] = arguments[_key2];
    }

    printWarning('error', format, args);
  }
}

function printWarning(level, format, args) {
  // When changing this logic, you might want to also
  // update consoleWithStackDev.www.js as well.
  {
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();

    if (stack !== '') {
      format += '%s';
      args = args.concat([stack]);
    }

    var argsWithFormat = args.map(function (item) {
      return '' + item;
    }); // Careful: RN currently depends on this prefix

    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
    // breaks IE9: https://github.com/facebook/react/issues/13610
    // eslint-disable-next-line react-internal/no-production-logging

    Function.prototype.apply.call(console[level], console, argsWithFormat);
  }
}

var didWarnStateUpdateForUnmountedComponent = {};

function warnNoop(publicInstance, callerName) {
  {
    var _constructor = publicInstance.constructor;
    var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
    var warningKey = componentName + "." + callerName;

    if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
      return;
    }

    error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);

    didWarnStateUpdateForUnmountedComponent[warningKey] = true;
  }
}
/**
 * This is the abstract API for an update queue.
 */


var ReactNoopUpdateQueue = {
  /**
   * Checks whether or not this composite component is mounted.
   * @param {ReactClass} publicInstance The instance we want to test.
   * @return {boolean} True if mounted, false otherwise.
   * @protected
   * @final
   */
  isMounted: function (publicInstance) {
    return false;
  },

  /**
   * Forces an update. This should only be invoked when it is known with
   * certainty that we are **not** in a DOM transaction.
   *
   * You may want to call this when you know that some deeper aspect of the
   * component's state has changed but `setState` was not called.
   *
   * This will not invoke `shouldComponentUpdate`, but it will invoke
   * `componentWillUpdate` and `componentDidUpdate`.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {?function} callback Called after component is updated.
   * @param {?string} callerName name of the calling function in the public API.
   * @internal
   */
  enqueueForceUpdate: function (publicInstance, callback, callerName) {
    warnNoop(publicInstance, 'forceUpdate');
  },

  /**
   * Replaces all of the state. Always use this or `setState` to mutate state.
   * You should treat `this.state` as immutable.
   *
   * There is no guarantee that `this.state` will be immediately updated, so
   * accessing `this.state` after calling this method may return the old value.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {object} completeState Next state.
   * @param {?function} callback Called after component is updated.
   * @param {?string} callerName name of the calling function in the public API.
   * @internal
   */
  enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
    warnNoop(publicInstance, 'replaceState');
  },

  /**
   * Sets a subset of the state. This only exists because _pendingState is
   * internal. This provides a merging strategy that is not available to deep
   * properties which is confusing. TODO: Expose pendingState or don't use it
   * during the merge.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {object} partialState Next partial state to be merged with state.
   * @param {?function} callback Called after component is updated.
   * @param {?string} Name of the calling function in the public API.
   * @internal
   */
  enqueueSetState: function (publicInstance, partialState, callback, callerName) {
    warnNoop(publicInstance, 'setState');
  }
};

var emptyObject = {};

{
  Object.freeze(emptyObject);
}
/**
 * Base class helpers for the updating state of a component.
 */


function Component(props, context, updater) {
  this.props = props;
  this.context = context; // If a component has string refs, we will assign a different object later.

  this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
  // renderer.

  this.updater = updater || ReactNoopUpdateQueue;
}

Component.prototype.isReactComponent = {};
/**
 * Sets a subset of the state. Always use this to mutate
 * state. You should treat `this.state` as immutable.
 *
 * There is no guarantee that `this.state` will be immediately updated, so
 * accessing `this.state` after calling this method may return the old value.
 *
 * There is no guarantee that calls to `setState` will run synchronously,
 * as they may eventually be batched together.  You can provide an optional
 * callback that will be executed when the call to setState is actually
 * completed.
 *
 * When a function is provided to setState, it will be called at some point in
 * the future (not synchronously). It will be called with the up to date
 * component arguments (state, props, context). These values can be different
 * from this.* because your function may be called after receiveProps but before
 * shouldComponentUpdate, and this new state, props, and context will not yet be
 * assigned to this.
 *
 * @param {object|function} partialState Next partial state or function to
 *        produce next partial state to be merged with current state.
 * @param {?function} callback Called after state is updated.
 * @final
 * @protected
 */

Component.prototype.setState = function (partialState, callback) {
  if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
    {
      throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
    }
  }

  this.updater.enqueueSetState(this, partialState, callback, 'setState');
};
/**
 * Forces an update. This should only be invoked when it is known with
 * certainty that we are **not** in a DOM transaction.
 *
 * You may want to call this when you know that some deeper aspect of the
 * component's state has changed but `setState` was not called.
 *
 * This will not invoke `shouldComponentUpdate`, but it will invoke
 * `componentWillUpdate` and `componentDidUpdate`.
 *
 * @param {?function} callback Called after update is complete.
 * @final
 * @protected
 */


Component.prototype.forceUpdate = function (callback) {
  this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
};
/**
 * Deprecated APIs. These APIs used to exist on classic React classes but since
 * we would like to deprecate them, we're not going to move them over to this
 * modern base class. Instead, we define a getter that warns if it's accessed.
 */


{
  var deprecatedAPIs = {
    isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
    replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  };

  var defineDeprecationWarning = function (methodName, info) {
    Object.defineProperty(Component.prototype, methodName, {
      get: function () {
        warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);

        return undefined;
      }
    });
  };

  for (var fnName in deprecatedAPIs) {
    if (deprecatedAPIs.hasOwnProperty(fnName)) {
      defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
    }
  }
}

function ComponentDummy() {}

ComponentDummy.prototype = Component.prototype;
/**
 * Convenience component with default shallow equality check for sCU.
 */

function PureComponent(props, context, updater) {
  this.props = props;
  this.context = context; // If a component has string refs, we will assign a different object later.

  this.refs = emptyObject;
  this.updater = updater || ReactNoopUpdateQueue;
}

var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.

_assign(pureComponentPrototype, Component.prototype);

pureComponentPrototype.isPureReactComponent = true;

// an immutable object with a single mutable value
function createRef() {
  var refObject = {
    current: null
  };

  {
    Object.seal(refObject);
  }

  return refObject;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
}

function getContextName(type) {
  return type.displayName || 'Context';
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }

  {
    if (typeof type.tag === 'number') {
      error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }

  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }

  if (typeof type === 'string') {
    return type;
  }

  switch (type) {
    case exports.Fragment:
      return 'Fragment';

    case REACT_PORTAL_TYPE:
      return 'Portal';

    case exports.Profiler:
      return 'Profiler';

    case exports.StrictMode:
      return 'StrictMode';

    case exports.Suspense:
      return 'Suspense';

    case REACT_SUSPENSE_LIST_TYPE:
      return 'SuspenseList';
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        var context = type;
        return getContextName(context) + '.Consumer';

      case REACT_PROVIDER_TYPE:
        var provider = type;
        return getContextName(provider._context) + '.Provider';

      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');

      case REACT_MEMO_TYPE:
        return getComponentName(type.type);

      case REACT_BLOCK_TYPE:
        return getComponentName(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            return getComponentName(init(payload));
          } catch (x) {
            return null;
          }
        }
    }
  }

  return null;
}

var hasOwnProperty = Object.prototype.hasOwnProperty;
var RESERVED_PROPS = {
  key: true,
  ref: true,
  __self: true,
  __source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;

{
  didWarnAboutStringRefs = {};
}

function hasValidRef(config) {
  {
    if (hasOwnProperty.call(config, 'ref')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.ref !== undefined;
}

function hasValidKey(config) {
  {
    if (hasOwnProperty.call(config, 'key')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.key !== undefined;
}

function defineKeyPropWarningGetter(props, displayName) {
  var warnAboutAccessingKey = function () {
    {
      if (!specialPropKeyWarningShown) {
        specialPropKeyWarningShown = true;

        error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    }
  };

  warnAboutAccessingKey.isReactWarning = true;
  Object.defineProperty(props, 'key', {
    get: warnAboutAccessingKey,
    configurable: true
  });
}

function defineRefPropWarningGetter(props, displayName) {
  var warnAboutAccessingRef = function () {
    {
      if (!specialPropRefWarningShown) {
        specialPropRefWarningShown = true;

        error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    }
  };

  warnAboutAccessingRef.isReactWarning = true;
  Object.defineProperty(props, 'ref', {
    get: warnAboutAccessingRef,
    configurable: true
  });
}

function warnIfStringRefCannotBeAutoConverted(config) {
  {
    if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
      var componentName = getComponentName(ReactCurrentOwner.current.type);

      if (!didWarnAboutStringRefs[componentName]) {
        error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);

        didWarnAboutStringRefs[componentName] = true;
      }
    }
  }
}
/**
 * Factory method to create a new React element. This no longer adheres to
 * the class pattern, so do not use new to call it. Also, instanceof check
 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
 * if something is a React Element.
 *
 * @param {*} type
 * @param {*} props
 * @param {*} key
 * @param {string|object} ref
 * @param {*} owner
 * @param {*} self A *temporary* helper to detect places where `this` is
 * different from the `owner` when React.createElement is called, so that we
 * can warn. We want to get rid of owner and replace string `ref`s with arrow
 * functions, and as long as `this` and owner are the same, there will be no
 * change in behavior.
 * @param {*} source An annotation object (added by a transpiler or otherwise)
 * indicating filename, line number, and/or other information.
 * @internal
 */


var ReactElement = function (type, key, ref, self, source, owner, props) {
  var element = {
    // This tag allows us to uniquely identify this as a React Element
    $$typeof: REACT_ELEMENT_TYPE,
    // Built-in properties that belong on the element
    type: type,
    key: key,
    ref: ref,
    props: props,
    // Record the component responsible for creating this element.
    _owner: owner
  };

  {
    // The validation flag is currently mutative. We put it on
    // an external backing store so that we can freeze the whole object.
    // This can be replaced with a WeakMap once they are implemented in
    // commonly used development environments.
    element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
    // the validation flag non-enumerable (where possible, which should
    // include every environment we run tests in), so the test framework
    // ignores it.

    Object.defineProperty(element._store, 'validated', {
      configurable: false,
      enumerable: false,
      writable: true,
      value: false
    }); // self and source are DEV only properties.

    Object.defineProperty(element, '_self', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: self
    }); // Two elements created in two different places should be considered
    // equal for testing purposes and therefore we hide it from enumeration.

    Object.defineProperty(element, '_source', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: source
    });

    if (Object.freeze) {
      Object.freeze(element.props);
      Object.freeze(element);
    }
  }

  return element;
};
/**
 * Create and return a new ReactElement of the given type.
 * See https://reactjs.org/docs/react-api.html#createelement
 */

function createElement(type, config, children) {
  var propName; // Reserved names are extracted

  var props = {};
  var key = null;
  var ref = null;
  var self = null;
  var source = null;

  if (config != null) {
    if (hasValidRef(config)) {
      ref = config.ref;

      {
        warnIfStringRefCannotBeAutoConverted(config);
      }
    }

    if (hasValidKey(config)) {
      key = '' + config.key;
    }

    self = config.__self === undefined ? null : config.__self;
    source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object

    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        props[propName] = config[propName];
      }
    }
  } // Children can be more than one argument, and those are transferred onto
  // the newly allocated props object.


  var childrenLength = arguments.length - 2;

  if (childrenLength === 1) {
    props.children = children;
  } else if (childrenLength > 1) {
    var childArray = Array(childrenLength);

    for (var i = 0; i < childrenLength; i++) {
      childArray[i] = arguments[i + 2];
    }

    {
      if (Object.freeze) {
        Object.freeze(childArray);
      }
    }

    props.children = childArray;
  } // Resolve default props


  if (type && type.defaultProps) {
    var defaultProps = type.defaultProps;

    for (propName in defaultProps) {
      if (props[propName] === undefined) {
        props[propName] = defaultProps[propName];
      }
    }
  }

  {
    if (key || ref) {
      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;

      if (key) {
        defineKeyPropWarningGetter(props, displayName);
      }

      if (ref) {
        defineRefPropWarningGetter(props, displayName);
      }
    }
  }

  return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
}
function cloneAndReplaceKey(oldElement, newKey) {
  var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
  return newElement;
}
/**
 * Clone and return a new ReactElement using element as the starting point.
 * See https://reactjs.org/docs/react-api.html#cloneelement
 */

function cloneElement(element, config, children) {
  if (!!(element === null || element === undefined)) {
    {
      throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
    }
  }

  var propName; // Original props are copied

  var props = _assign({}, element.props); // Reserved names are extracted


  var key = element.key;
  var ref = element.ref; // Self is preserved since the owner is preserved.

  var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
  // transpiler, and the original source is probably a better indicator of the
  // true owner.

  var source = element._source; // Owner will be preserved, unless ref is overridden

  var owner = element._owner;

  if (config != null) {
    if (hasValidRef(config)) {
      // Silently steal the ref from the parent.
      ref = config.ref;
      owner = ReactCurrentOwner.current;
    }

    if (hasValidKey(config)) {
      key = '' + config.key;
    } // Remaining properties override existing props


    var defaultProps;

    if (element.type && element.type.defaultProps) {
      defaultProps = element.type.defaultProps;
    }

    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        if (config[propName] === undefined && defaultProps !== undefined) {
          // Resolve default props
          props[propName] = defaultProps[propName];
        } else {
          props[propName] = config[propName];
        }
      }
    }
  } // Children can be more than one argument, and those are transferred onto
  // the newly allocated props object.


  var childrenLength = arguments.length - 2;

  if (childrenLength === 1) {
    props.children = children;
  } else if (childrenLength > 1) {
    var childArray = Array(childrenLength);

    for (var i = 0; i < childrenLength; i++) {
      childArray[i] = arguments[i + 2];
    }

    props.children = childArray;
  }

  return ReactElement(element.type, key, ref, self, source, owner, props);
}
/**
 * Verifies the object is a ReactElement.
 * See https://reactjs.org/docs/react-api.html#isvalidelement
 * @param {?object} object
 * @return {boolean} True if `object` is a ReactElement.
 * @final
 */

function isValidElement(object) {
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}

var SEPARATOR = '.';
var SUBSEPARATOR = ':';
/**
 * Escape and wrap key so it is safe to use as a reactid
 *
 * @param {string} key to be escaped.
 * @return {string} the escaped key.
 */

function escape(key) {
  var escapeRegex = /[=:]/g;
  var escaperLookup = {
    '=': '=0',
    ':': '=2'
  };
  var escapedString = key.replace(escapeRegex, function (match) {
    return escaperLookup[match];
  });
  return '$' + escapedString;
}
/**
 * TODO: Test that a single child and an array with one item have the same key
 * pattern.
 */


var didWarnAboutMaps = false;
var userProvidedKeyEscapeRegex = /\/+/g;

function escapeUserProvidedKey(text) {
  return text.replace(userProvidedKeyEscapeRegex, '$&/');
}
/**
 * Generate a key string that identifies a element within a set.
 *
 * @param {*} element A element that could contain a manual key.
 * @param {number} index Index that is used if a manual key is not provided.
 * @return {string}
 */


function getElementKey(element, index) {
  // Do some typechecking here since we call this blindly. We want to ensure
  // that we don't block potential future ES APIs.
  if (typeof element === 'object' && element !== null && element.key != null) {
    // Explicit key
    return escape('' + element.key);
  } // Implicit key determined by the index in the set


  return index.toString(36);
}

function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
  var type = typeof children;

  if (type === 'undefined' || type === 'boolean') {
    // All of the above are perceived as null.
    children = null;
  }

  var invokeCallback = false;

  if (children === null) {
    invokeCallback = true;
  } else {
    switch (type) {
      case 'string':
      case 'number':
        invokeCallback = true;
        break;

      case 'object':
        switch (children.$$typeof) {
          case REACT_ELEMENT_TYPE:
          case REACT_PORTAL_TYPE:
            invokeCallback = true;
        }

    }
  }

  if (invokeCallback) {
    var _child = children;
    var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
    // so that it's consistent if the number of children grows:

    var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;

    if (Array.isArray(mappedChild)) {
      var escapedChildKey = '';

      if (childKey != null) {
        escapedChildKey = escapeUserProvidedKey(childKey) + '/';
      }

      mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
        return c;
      });
    } else if (mappedChild != null) {
      if (isValidElement(mappedChild)) {
        mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
        // traverseAllChildren used to do for objects as children
        escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
        mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
        escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
      }

      array.push(mappedChild);
    }

    return 1;
  }

  var child;
  var nextName;
  var subtreeCount = 0; // Count of children found in the current subtree.

  var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;

  if (Array.isArray(children)) {
    for (var i = 0; i < children.length; i++) {
      child = children[i];
      nextName = nextNamePrefix + getElementKey(child, i);
      subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
    }
  } else {
    var iteratorFn = getIteratorFn(children);

    if (typeof iteratorFn === 'function') {
      var iterableChildren = children;

      {
        // Warn about using Maps as children
        if (iteratorFn === iterableChildren.entries) {
          if (!didWarnAboutMaps) {
            warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
          }

          didWarnAboutMaps = true;
        }
      }

      var iterator = iteratorFn.call(iterableChildren);
      var step;
      var ii = 0;

      while (!(step = iterator.next()).done) {
        child = step.value;
        nextName = nextNamePrefix + getElementKey(child, ii++);
        subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
      }
    } else if (type === 'object') {
      var childrenString = '' + children;

      {
        {
          throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." );
        }
      }
    }
  }

  return subtreeCount;
}

/**
 * Maps children that are typically specified as `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenmap
 *
 * The provided mapFunction(child, index) will be called for each
 * leaf child.
 *
 * @param {?*} children Children tree container.
 * @param {function(*, int)} func The map function.
 * @param {*} context Context for mapFunction.
 * @return {object} Object containing the ordered map of results.
 */
function mapChildren(children, func, context) {
  if (children == null) {
    return children;
  }

  var result = [];
  var count = 0;
  mapIntoArray(children, result, '', '', function (child) {
    return func.call(context, child, count++);
  });
  return result;
}
/**
 * Count the number of children that are typically specified as
 * `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrencount
 *
 * @param {?*} children Children tree container.
 * @return {number} The number of children.
 */


function countChildren(children) {
  var n = 0;
  mapChildren(children, function () {
    n++; // Don't return anything
  });
  return n;
}

/**
 * Iterates through children that are typically specified as `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
 *
 * The provided forEachFunc(child, index) will be called for each
 * leaf child.
 *
 * @param {?*} children Children tree container.
 * @param {function(*, int)} forEachFunc
 * @param {*} forEachContext Context for forEachContext.
 */
function forEachChildren(children, forEachFunc, forEachContext) {
  mapChildren(children, function () {
    forEachFunc.apply(this, arguments); // Don't return anything.
  }, forEachContext);
}
/**
 * Flatten a children object (typically specified as `props.children`) and
 * return an array with appropriately re-keyed children.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
 */


function toArray(children) {
  return mapChildren(children, function (child) {
    return child;
  }) || [];
}
/**
 * Returns the first child in a collection of children and verifies that there
 * is only one child in the collection.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenonly
 *
 * The current implementation of this function assumes that a single child gets
 * passed without a wrapper, but the purpose of this helper function is to
 * abstract away the particular structure of children.
 *
 * @param {?object} children Child collection structure.
 * @return {ReactElement} The first and only `ReactElement` contained in the
 * structure.
 */


function onlyChild(children) {
  if (!isValidElement(children)) {
    {
      throw Error( "React.Children.only expected to receive a single React element child." );
    }
  }

  return children;
}

function createContext(defaultValue, calculateChangedBits) {
  if (calculateChangedBits === undefined) {
    calculateChangedBits = null;
  } else {
    {
      if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
        error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
      }
    }
  }

  var context = {
    $$typeof: REACT_CONTEXT_TYPE,
    _calculateChangedBits: calculateChangedBits,
    // As a workaround to support multiple concurrent renderers, we categorize
    // some renderers as primary and others as secondary. We only expect
    // there to be two concurrent renderers at most: React Native (primary) and
    // Fabric (secondary); React DOM (primary) and React ART (secondary).
    // Secondary renderers store their context values on separate fields.
    _currentValue: defaultValue,
    _currentValue2: defaultValue,
    // Used to track how many concurrent renderers this context currently
    // supports within in a single renderer. Such as parallel server rendering.
    _threadCount: 0,
    // These are circular
    Provider: null,
    Consumer: null
  };
  context.Provider = {
    $$typeof: REACT_PROVIDER_TYPE,
    _context: context
  };
  var hasWarnedAboutUsingNestedContextConsumers = false;
  var hasWarnedAboutUsingConsumerProvider = false;
  var hasWarnedAboutDisplayNameOnConsumer = false;

  {
    // A separate object, but proxies back to the original context object for
    // backwards compatibility. It has a different $$typeof, so we can properly
    // warn for the incorrect usage of Context as a Consumer.
    var Consumer = {
      $$typeof: REACT_CONTEXT_TYPE,
      _context: context,
      _calculateChangedBits: context._calculateChangedBits
    }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here

    Object.defineProperties(Consumer, {
      Provider: {
        get: function () {
          if (!hasWarnedAboutUsingConsumerProvider) {
            hasWarnedAboutUsingConsumerProvider = true;

            error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
          }

          return context.Provider;
        },
        set: function (_Provider) {
          context.Provider = _Provider;
        }
      },
      _currentValue: {
        get: function () {
          return context._currentValue;
        },
        set: function (_currentValue) {
          context._currentValue = _currentValue;
        }
      },
      _currentValue2: {
        get: function () {
          return context._currentValue2;
        },
        set: function (_currentValue2) {
          context._currentValue2 = _currentValue2;
        }
      },
      _threadCount: {
        get: function () {
          return context._threadCount;
        },
        set: function (_threadCount) {
          context._threadCount = _threadCount;
        }
      },
      Consumer: {
        get: function () {
          if (!hasWarnedAboutUsingNestedContextConsumers) {
            hasWarnedAboutUsingNestedContextConsumers = true;

            error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
          }

          return context.Consumer;
        }
      },
      displayName: {
        get: function () {
          return context.displayName;
        },
        set: function (displayName) {
          if (!hasWarnedAboutDisplayNameOnConsumer) {
            warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);

            hasWarnedAboutDisplayNameOnConsumer = true;
          }
        }
      }
    }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty

    context.Consumer = Consumer;
  }

  {
    context._currentRenderer = null;
    context._currentRenderer2 = null;
  }

  return context;
}

var Uninitialized = -1;
var Pending = 0;
var Resolved = 1;
var Rejected = 2;

function lazyInitializer(payload) {
  if (payload._status === Uninitialized) {
    var ctor = payload._result;
    var thenable = ctor(); // Transition to the next state.

    var pending = payload;
    pending._status = Pending;
    pending._result = thenable;
    thenable.then(function (moduleObject) {
      if (payload._status === Pending) {
        var defaultExport = moduleObject.default;

        {
          if (defaultExport === undefined) {
            error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n  ' + // Break up imports to avoid accidentally parsing them as dependencies.
            'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
          }
        } // Transition to the next state.


        var resolved = payload;
        resolved._status = Resolved;
        resolved._result = defaultExport;
      }
    }, function (error) {
      if (payload._status === Pending) {
        // Transition to the next state.
        var rejected = payload;
        rejected._status = Rejected;
        rejected._result = error;
      }
    });
  }

  if (payload._status === Resolved) {
    return payload._result;
  } else {
    throw payload._result;
  }
}

function lazy(ctor) {
  var payload = {
    // We use these fields to store the result.
    _status: -1,
    _result: ctor
  };
  var lazyType = {
    $$typeof: REACT_LAZY_TYPE,
    _payload: payload,
    _init: lazyInitializer
  };

  {
    // In production, this would just set it on the object.
    var defaultProps;
    var propTypes; // $FlowFixMe

    Object.defineProperties(lazyType, {
      defaultProps: {
        configurable: true,
        get: function () {
          return defaultProps;
        },
        set: function (newDefaultProps) {
          error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');

          defaultProps = newDefaultProps; // Match production behavior more closely:
          // $FlowFixMe

          Object.defineProperty(lazyType, 'defaultProps', {
            enumerable: true
          });
        }
      },
      propTypes: {
        configurable: true,
        get: function () {
          return propTypes;
        },
        set: function (newPropTypes) {
          error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');

          propTypes = newPropTypes; // Match production behavior more closely:
          // $FlowFixMe

          Object.defineProperty(lazyType, 'propTypes', {
            enumerable: true
          });
        }
      }
    });
  }

  return lazyType;
}

function forwardRef(render) {
  {
    if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
      error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
    } else if (typeof render !== 'function') {
      error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
    } else {
      if (render.length !== 0 && render.length !== 2) {
        error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
      }
    }

    if (render != null) {
      if (render.defaultProps != null || render.propTypes != null) {
        error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
      }
    }
  }

  var elementType = {
    $$typeof: REACT_FORWARD_REF_TYPE,
    render: render
  };

  {
    var ownName;
    Object.defineProperty(elementType, 'displayName', {
      enumerable: false,
      configurable: true,
      get: function () {
        return ownName;
      },
      set: function (name) {
        ownName = name;

        if (render.displayName == null) {
          render.displayName = name;
        }
      }
    });
  }

  return elementType;
}

// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.

var enableScopeAPI = false; // Experimental Create Event Handle API.

function isValidElementType(type) {
  if (typeof type === 'string' || typeof type === 'function') {
    return true;
  } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).


  if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
    return true;
  }

  if (typeof type === 'object' && type !== null) {
    if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
      return true;
    }
  }

  return false;
}

function memo(type, compare) {
  {
    if (!isValidElementType(type)) {
      error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
    }
  }

  var elementType = {
    $$typeof: REACT_MEMO_TYPE,
    type: type,
    compare: compare === undefined ? null : compare
  };

  {
    var ownName;
    Object.defineProperty(elementType, 'displayName', {
      enumerable: false,
      configurable: true,
      get: function () {
        return ownName;
      },
      set: function (name) {
        ownName = name;

        if (type.displayName == null) {
          type.displayName = name;
        }
      }
    });
  }

  return elementType;
}

function resolveDispatcher() {
  var dispatcher = ReactCurrentDispatcher.current;

  if (!(dispatcher !== null)) {
    {
      throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
    }
  }

  return dispatcher;
}

function useContext(Context, unstable_observedBits) {
  var dispatcher = resolveDispatcher();

  {
    if (unstable_observedBits !== undefined) {
      error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : '');
    } // TODO: add a more generic warning for invalid values.


    if (Context._context !== undefined) {
      var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
      // and nobody should be using this in existing code.

      if (realContext.Consumer === Context) {
        error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
      } else if (realContext.Provider === Context) {
        error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
      }
    }
  }

  return dispatcher.useContext(Context, unstable_observedBits);
}
function useState(initialState) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useState(initialState);
}
function useReducer(reducer, initialArg, init) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useReducer(reducer, initialArg, init);
}
function useRef(initialValue) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useRef(initialValue);
}
function useEffect(create, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useEffect(create, deps);
}
function useLayoutEffect(create, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useLayoutEffect(create, deps);
}
function useCallback(callback, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useCallback(callback, deps);
}
function useMemo(create, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useMemo(create, deps);
}
function useImperativeHandle(ref, create, deps) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useImperativeHandle(ref, create, deps);
}
function useDebugValue(value, formatterFn) {
  {
    var dispatcher = resolveDispatcher();
    return dispatcher.useDebugValue(value, formatterFn);
  }
}

// Helpers to patch console.logs to avoid logging during side-effect free
// replaying on render function. This currently only patches the object
// lazily which won't cover if the log function was extracted eagerly.
// We could also eagerly patch the method.
var disabledDepth = 0;
var prevLog;
var prevInfo;
var prevWarn;
var prevError;
var prevGroup;
var prevGroupCollapsed;
var prevGroupEnd;

function disabledLog() {}

disabledLog.__reactDisabledLog = true;
function disableLogs() {
  {
    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      prevLog = console.log;
      prevInfo = console.info;
      prevWarn = console.warn;
      prevError = console.error;
      prevGroup = console.group;
      prevGroupCollapsed = console.groupCollapsed;
      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099

      var props = {
        configurable: true,
        enumerable: true,
        value: disabledLog,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        info: props,
        log: props,
        warn: props,
        error: props,
        group: props,
        groupCollapsed: props,
        groupEnd: props
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    disabledDepth++;
  }
}
function reenableLogs() {
  {
    disabledDepth--;

    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      var props = {
        configurable: true,
        enumerable: true,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        log: _assign({}, props, {
          value: prevLog
        }),
        info: _assign({}, props, {
          value: prevInfo
        }),
        warn: _assign({}, props, {
          value: prevWarn
        }),
        error: _assign({}, props, {
          value: prevError
        }),
        group: _assign({}, props, {
          value: prevGroup
        }),
        groupCollapsed: _assign({}, props, {
          value: prevGroupCollapsed
        }),
        groupEnd: _assign({}, props, {
          value: prevGroupEnd
        })
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    if (disabledDepth < 0) {
      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
    }
  }
}

var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name, source, ownerFn) {
  {
    if (prefix === undefined) {
      // Extract the VM specific prefix used by each line.
      try {
        throw Error();
      } catch (x) {
        var match = x.stack.trim().match(/\n( *(at )?)/);
        prefix = match && match[1] || '';
      }
    } // We use the prefix to ensure our stacks line up with native stack frames.


    return '\n' + prefix + name;
  }
}
var reentry = false;
var componentFrameCache;

{
  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
  componentFrameCache = new PossiblyWeakMap();
}

function describeNativeComponentFrame(fn, construct) {
  // If something asked for a stack inside a fake render, it should get ignored.
  if (!fn || reentry) {
    return '';
  }

  {
    var frame = componentFrameCache.get(fn);

    if (frame !== undefined) {
      return frame;
    }
  }

  var control;
  reentry = true;
  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.

  Error.prepareStackTrace = undefined;
  var previousDispatcher;

  {
    previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
    // for warnings.

    ReactCurrentDispatcher$1.current = null;
    disableLogs();
  }

  try {
    // This should throw.
    if (construct) {
      // Something should be setting the props in the constructor.
      var Fake = function () {
        throw Error();
      }; // $FlowFixMe


      Object.defineProperty(Fake.prototype, 'props', {
        set: function () {
          // We use a throwing setter instead of frozen or non-writable props
          // because that won't throw in a non-strict mode function.
          throw Error();
        }
      });

      if (typeof Reflect === 'object' && Reflect.construct) {
        // We construct a different control for this case to include any extra
        // frames added by the construct call.
        try {
          Reflect.construct(Fake, []);
        } catch (x) {
          control = x;
        }

        Reflect.construct(fn, [], Fake);
      } else {
        try {
          Fake.call();
        } catch (x) {
          control = x;
        }

        fn.call(Fake.prototype);
      }
    } else {
      try {
        throw Error();
      } catch (x) {
        control = x;
      }

      fn();
    }
  } catch (sample) {
    // This is inlined manually because closure doesn't do it for us.
    if (sample && control && typeof sample.stack === 'string') {
      // This extracts the first frame from the sample that isn't also in the control.
      // Skipping one frame that we assume is the frame that calls the two.
      var sampleLines = sample.stack.split('\n');
      var controlLines = control.stack.split('\n');
      var s = sampleLines.length - 1;
      var c = controlLines.length - 1;

      while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
        // We expect at least one stack frame to be shared.
        // Typically this will be the root most one. However, stack frames may be
        // cut off due to maximum stack limits. In this case, one maybe cut off
        // earlier than the other. We assume that the sample is longer or the same
        // and there for cut off earlier. So we should find the root most frame in
        // the sample somewhere in the control.
        c--;
      }

      for (; s >= 1 && c >= 0; s--, c--) {
        // Next we find the first one that isn't the same which should be the
        // frame that called our sample function and the control.
        if (sampleLines[s] !== controlLines[c]) {
          // In V8, the first line is describing the message but other VMs don't.
          // If we're about to return the first line, and the control is also on the same
          // line, that's a pretty good indicator that our sample threw at same line as
          // the control. I.e. before we entered the sample frame. So we ignore this result.
          // This can happen if you passed a class to function component, or non-function.
          if (s !== 1 || c !== 1) {
            do {
              s--;
              c--; // We may still have similar intermediate frames from the construct call.
              // The next one that isn't the same should be our match though.

              if (c < 0 || sampleLines[s] !== controlLines[c]) {
                // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
                var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');

                {
                  if (typeof fn === 'function') {
                    componentFrameCache.set(fn, _frame);
                  }
                } // Return the line we found.


                return _frame;
              }
            } while (s >= 1 && c >= 0);
          }

          break;
        }
      }
    }
  } finally {
    reentry = false;

    {
      ReactCurrentDispatcher$1.current = previousDispatcher;
      reenableLogs();
    }

    Error.prepareStackTrace = previousPrepareStackTrace;
  } // Fallback to just using the name if we couldn't make it throw.


  var name = fn ? fn.displayName || fn.name : '';
  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';

  {
    if (typeof fn === 'function') {
      componentFrameCache.set(fn, syntheticFrame);
    }
  }

  return syntheticFrame;
}
function describeFunctionComponentFrame(fn, source, ownerFn) {
  {
    return describeNativeComponentFrame(fn, false);
  }
}

function shouldConstruct(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {

  if (type == null) {
    return '';
  }

  if (typeof type === 'function') {
    {
      return describeNativeComponentFrame(type, shouldConstruct(type));
    }
  }

  if (typeof type === 'string') {
    return describeBuiltInComponentFrame(type);
  }

  switch (type) {
    case exports.Suspense:
      return describeBuiltInComponentFrame('Suspense');

    case REACT_SUSPENSE_LIST_TYPE:
      return describeBuiltInComponentFrame('SuspenseList');
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_FORWARD_REF_TYPE:
        return describeFunctionComponentFrame(type.render);

      case REACT_MEMO_TYPE:
        // Memo may contain any component type so we recursively resolve it.
        return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);

      case REACT_BLOCK_TYPE:
        return describeFunctionComponentFrame(type._render);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            // Lazy may contain any component type so we recursively resolve it.
            return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
          } catch (x) {}
        }
    }
  }

  return '';
}

var loggedTypeFailures = {};
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame$1.setExtraStackFrame(null);
    }
  }
}

function checkPropTypes(typeSpecs, values, location, componentName, element) {
  {
    // $FlowFixMe This is okay but Flow doesn't know it.
    var has = Function.call.bind(Object.prototype.hasOwnProperty);

    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.

        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
            err.name = 'Invariant Violation';
            throw err;
          }

          error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
        } catch (ex) {
          error$1 = ex;
        }

        if (error$1 && !(error$1 instanceof Error)) {
          setCurrentlyValidatingElement(element);

          error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);

          setCurrentlyValidatingElement(null);
        }

        if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error$1.message] = true;
          setCurrentlyValidatingElement(element);

          error('Failed %s type: %s', location, error$1.message);

          setCurrentlyValidatingElement(null);
        }
      }
    }
  }
}

function setCurrentlyValidatingElement$1(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      setExtraStackFrame(stack);
    } else {
      setExtraStackFrame(null);
    }
  }
}

var propTypesMisspellWarningShown;

{
  propTypesMisspellWarningShown = false;
}

function getDeclarationErrorAddendum() {
  if (ReactCurrentOwner.current) {
    var name = getComponentName(ReactCurrentOwner.current.type);

    if (name) {
      return '\n\nCheck the render method of `' + name + '`.';
    }
  }

  return '';
}

function getSourceInfoErrorAddendum(source) {
  if (source !== undefined) {
    var fileName = source.fileName.replace(/^.*[\\\/]/, '');
    var lineNumber = source.lineNumber;
    return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
  }

  return '';
}

function getSourceInfoErrorAddendumForProps(elementProps) {
  if (elementProps !== null && elementProps !== undefined) {
    return getSourceInfoErrorAddendum(elementProps.__source);
  }

  return '';
}
/**
 * Warn if there's no key explicitly set on dynamic arrays of children or
 * object keys are not valid. This allows us to keep track of children between
 * updates.
 */


var ownerHasKeyUseWarning = {};

function getCurrentComponentErrorInfo(parentType) {
  var info = getDeclarationErrorAddendum();

  if (!info) {
    var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;

    if (parentName) {
      info = "\n\nCheck the top-level render call using <" + parentName + ">.";
    }
  }

  return info;
}
/**
 * Warn if the element doesn't have an explicit key assigned to it.
 * This element is in an array. The array could grow and shrink or be
 * reordered. All children that haven't already been validated are required to
 * have a "key" property assigned to it. Error statuses are cached so a warning
 * will only be shown once.
 *
 * @internal
 * @param {ReactElement} element Element that requires a key.
 * @param {*} parentType element's parent's type.
 */


function validateExplicitKey(element, parentType) {
  if (!element._store || element._store.validated || element.key != null) {
    return;
  }

  element._store.validated = true;
  var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);

  if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
    return;
  }

  ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
  // property, it may be the creator of the child that's responsible for
  // assigning it a key.

  var childOwner = '';

  if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
    // Give the component that originally created this child.
    childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
  }

  {
    setCurrentlyValidatingElement$1(element);

    error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);

    setCurrentlyValidatingElement$1(null);
  }
}
/**
 * Ensure that every element either is passed in a static location, in an
 * array with an explicit keys property defined, or in an object literal
 * with valid key property.
 *
 * @internal
 * @param {ReactNode} node Statically passed child of any type.
 * @param {*} parentType node's parent's type.
 */


function validateChildKeys(node, parentType) {
  if (typeof node !== 'object') {
    return;
  }

  if (Array.isArray(node)) {
    for (var i = 0; i < node.length; i++) {
      var child = node[i];

      if (isValidElement(child)) {
        validateExplicitKey(child, parentType);
      }
    }
  } else if (isValidElement(node)) {
    // This element was passed in a valid location.
    if (node._store) {
      node._store.validated = true;
    }
  } else if (node) {
    var iteratorFn = getIteratorFn(node);

    if (typeof iteratorFn === 'function') {
      // Entry iterators used to provide implicit keys,
      // but now we print a separate warning for them later.
      if (iteratorFn !== node.entries) {
        var iterator = iteratorFn.call(node);
        var step;

        while (!(step = iterator.next()).done) {
          if (isValidElement(step.value)) {
            validateExplicitKey(step.value, parentType);
          }
        }
      }
    }
  }
}
/**
 * Given an element, validate that its props follow the propTypes definition,
 * provided by the type.
 *
 * @param {ReactElement} element
 */


function validatePropTypes(element) {
  {
    var type = element.type;

    if (type === null || type === undefined || typeof type === 'string') {
      return;
    }

    var propTypes;

    if (typeof type === 'function') {
      propTypes = type.propTypes;
    } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
    // Inner props are checked in the reconciler.
    type.$$typeof === REACT_MEMO_TYPE)) {
      propTypes = type.propTypes;
    } else {
      return;
    }

    if (propTypes) {
      // Intentionally inside to avoid triggering lazy initializers:
      var name = getComponentName(type);
      checkPropTypes(propTypes, element.props, 'prop', name, element);
    } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
      propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:

      var _name = getComponentName(type);

      error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
    }

    if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
      error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
    }
  }
}
/**
 * Given a fragment, validate that it can only be provided with fragment props
 * @param {ReactElement} fragment
 */


function validateFragmentProps(fragment) {
  {
    var keys = Object.keys(fragment.props);

    for (var i = 0; i < keys.length; i++) {
      var key = keys[i];

      if (key !== 'children' && key !== 'key') {
        setCurrentlyValidatingElement$1(fragment);

        error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);

        setCurrentlyValidatingElement$1(null);
        break;
      }
    }

    if (fragment.ref !== null) {
      setCurrentlyValidatingElement$1(fragment);

      error('Invalid attribute `ref` supplied to `React.Fragment`.');

      setCurrentlyValidatingElement$1(null);
    }
  }
}
function createElementWithValidation(type, props, children) {
  var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
  // succeed and there will likely be errors in render.

  if (!validType) {
    var info = '';

    if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
      info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
    }

    var sourceInfo = getSourceInfoErrorAddendumForProps(props);

    if (sourceInfo) {
      info += sourceInfo;
    } else {
      info += getDeclarationErrorAddendum();
    }

    var typeString;

    if (type === null) {
      typeString = 'null';
    } else if (Array.isArray(type)) {
      typeString = 'array';
    } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
      typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
      info = ' Did you accidentally export a JSX literal instead of a component?';
    } else {
      typeString = typeof type;
    }

    {
      error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
    }
  }

  var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
  // TODO: Drop this when these are no longer allowed as the type argument.

  if (element == null) {
    return element;
  } // Skip key warning if the type isn't valid since our key validation logic
  // doesn't expect a non-string/function type and can throw confusing errors.
  // We don't want exception behavior to differ between dev and prod.
  // (Rendering will throw with a helpful message and as soon as the type is
  // fixed, the key warnings will appear.)


  if (validType) {
    for (var i = 2; i < arguments.length; i++) {
      validateChildKeys(arguments[i], type);
    }
  }

  if (type === exports.Fragment) {
    validateFragmentProps(element);
  } else {
    validatePropTypes(element);
  }

  return element;
}
var didWarnAboutDeprecatedCreateFactory = false;
function createFactoryWithValidation(type) {
  var validatedFactory = createElementWithValidation.bind(null, type);
  validatedFactory.type = type;

  {
    if (!didWarnAboutDeprecatedCreateFactory) {
      didWarnAboutDeprecatedCreateFactory = true;

      warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
    } // Legacy hook: remove it


    Object.defineProperty(validatedFactory, 'type', {
      enumerable: false,
      get: function () {
        warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');

        Object.defineProperty(this, 'type', {
          value: type
        });
        return type;
      }
    });
  }

  return validatedFactory;
}
function cloneElementWithValidation(element, props, children) {
  var newElement = cloneElement.apply(this, arguments);

  for (var i = 2; i < arguments.length; i++) {
    validateChildKeys(arguments[i], newElement.type);
  }

  validatePropTypes(newElement);
  return newElement;
}

{

  try {
    var frozenObject = Object.freeze({});
    /* eslint-disable no-new */

    new Map([[frozenObject, null]]);
    new Set([frozenObject]);
    /* eslint-enable no-new */
  } catch (e) {
  }
}

var createElement$1 =  createElementWithValidation ;
var cloneElement$1 =  cloneElementWithValidation ;
var createFactory =  createFactoryWithValidation ;
var Children = {
  map: mapChildren,
  forEach: forEachChildren,
  count: countChildren,
  toArray: toArray,
  only: onlyChild
};

exports.Children = Children;
exports.Component = Component;
exports.PureComponent = PureComponent;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
exports.cloneElement = cloneElement$1;
exports.createContext = createContext;
exports.createElement = createElement$1;
exports.createFactory = createFactory;
exports.createRef = createRef;
exports.forwardRef = forwardRef;
exports.isValidElement = isValidElement;
exports.lazy = lazy;
exports.memo = memo;
exports.useCallback = useCallback;
exports.useContext = useContext;
exports.useDebugValue = useDebugValue;
exports.useEffect = useEffect;
exports.useImperativeHandle = useImperativeHandle;
exports.useLayoutEffect = useLayoutEffect;
exports.useMemo = useMemo;
exports.useReducer = useReducer;
exports.useRef = useRef;
exports.useState = useState;
exports.version = ReactVersion;
  })();
}


/***/ }),

/***/ "../../../../node_modules/react/index.js":
/*!***********************************************!*\
  !*** ../../../../node_modules/react/index.js ***!
  \***********************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1341564__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_1341564__(/*! ./cjs/react.development.js */ "../../../../node_modules/react/cjs/react.development.js");
}


/***/ }),

/***/ "../../../../node_modules/react/jsx-runtime.js":
/*!*****************************************************!*\
  !*** ../../../../node_modules/react/jsx-runtime.js ***!
  \*****************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1342049__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_1342049__(/*! ./cjs/react-jsx-runtime.development.js */ "../../../../node_modules/react/cjs/react-jsx-runtime.development.js");
}


/***/ }),

/***/ "../../../../node_modules/scheduler/cjs/scheduler-tracing.development.js":
/*!*******************************************************************************!*\
  !*** ../../../../node_modules/scheduler/cjs/scheduler-tracing.development.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
/** @license React v0.20.2
 * scheduler-tracing.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.

var interactionIDCounter = 0;
var threadIDCounter = 0; // Set of currently traced interactions.
// Interactions "stack"–
// Meaning that newly traced interactions are appended to the previously active set.
// When an interaction goes out of scope, the previous set (if any) is restored.

exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.

exports.__subscriberRef = null;

{
  exports.__interactionsRef = {
    current: new Set()
  };
  exports.__subscriberRef = {
    current: null
  };
}
function unstable_clear(callback) {

  var prevInteractions = exports.__interactionsRef.current;
  exports.__interactionsRef.current = new Set();

  try {
    return callback();
  } finally {
    exports.__interactionsRef.current = prevInteractions;
  }
}
function unstable_getCurrent() {
  {
    return exports.__interactionsRef.current;
  }
}
function unstable_getThreadID() {
  return ++threadIDCounter;
}
function unstable_trace(name, timestamp, callback) {
  var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;

  var interaction = {
    __count: 1,
    id: interactionIDCounter++,
    name: name,
    timestamp: timestamp
  };
  var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.
  // To do that, clone the current interactions.
  // The previous set will be restored upon completion.

  var interactions = new Set(prevInteractions);
  interactions.add(interaction);
  exports.__interactionsRef.current = interactions;
  var subscriber = exports.__subscriberRef.current;
  var returnValue;

  try {
    if (subscriber !== null) {
      subscriber.onInteractionTraced(interaction);
    }
  } finally {
    try {
      if (subscriber !== null) {
        subscriber.onWorkStarted(interactions, threadID);
      }
    } finally {
      try {
        returnValue = callback();
      } finally {
        exports.__interactionsRef.current = prevInteractions;

        try {
          if (subscriber !== null) {
            subscriber.onWorkStopped(interactions, threadID);
          }
        } finally {
          interaction.__count--; // If no async work was scheduled for this interaction,
          // Notify subscribers that it's completed.

          if (subscriber !== null && interaction.__count === 0) {
            subscriber.onInteractionScheduledWorkCompleted(interaction);
          }
        }
      }
    }
  }

  return returnValue;
}
function unstable_wrap(callback) {
  var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;

  var wrappedInteractions = exports.__interactionsRef.current;
  var subscriber = exports.__subscriberRef.current;

  if (subscriber !== null) {
    subscriber.onWorkScheduled(wrappedInteractions, threadID);
  } // Update the pending async work count for the current interactions.
  // Update after calling subscribers in case of error.


  wrappedInteractions.forEach(function (interaction) {
    interaction.__count++;
  });
  var hasRun = false;

  function wrapped() {
    var prevInteractions = exports.__interactionsRef.current;
    exports.__interactionsRef.current = wrappedInteractions;
    subscriber = exports.__subscriberRef.current;

    try {
      var returnValue;

      try {
        if (subscriber !== null) {
          subscriber.onWorkStarted(wrappedInteractions, threadID);
        }
      } finally {
        try {
          returnValue = callback.apply(undefined, arguments);
        } finally {
          exports.__interactionsRef.current = prevInteractions;

          if (subscriber !== null) {
            subscriber.onWorkStopped(wrappedInteractions, threadID);
          }
        }
      }

      return returnValue;
    } finally {
      if (!hasRun) {
        // We only expect a wrapped function to be executed once,
        // But in the event that it's executed more than once–
        // Only decrement the outstanding interaction counts once.
        hasRun = true; // Update pending async counts for all wrapped interactions.
        // If this was the last scheduled async work for any of them,
        // Mark them as completed.

        wrappedInteractions.forEach(function (interaction) {
          interaction.__count--;

          if (subscriber !== null && interaction.__count === 0) {
            subscriber.onInteractionScheduledWorkCompleted(interaction);
          }
        });
      }
    }
  }

  wrapped.cancel = function cancel() {
    subscriber = exports.__subscriberRef.current;

    try {
      if (subscriber !== null) {
        subscriber.onWorkCanceled(wrappedInteractions, threadID);
      }
    } finally {
      // Update pending async counts for all wrapped interactions.
      // If this was the last scheduled async work for any of them,
      // Mark them as completed.
      wrappedInteractions.forEach(function (interaction) {
        interaction.__count--;

        if (subscriber && interaction.__count === 0) {
          subscriber.onInteractionScheduledWorkCompleted(interaction);
        }
      });
    }
  };

  return wrapped;
}

var subscribers = null;

{
  subscribers = new Set();
}

function unstable_subscribe(subscriber) {
  {
    subscribers.add(subscriber);

    if (subscribers.size === 1) {
      exports.__subscriberRef.current = {
        onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,
        onInteractionTraced: onInteractionTraced,
        onWorkCanceled: onWorkCanceled,
        onWorkScheduled: onWorkScheduled,
        onWorkStarted: onWorkStarted,
        onWorkStopped: onWorkStopped
      };
    }
  }
}
function unstable_unsubscribe(subscriber) {
  {
    subscribers.delete(subscriber);

    if (subscribers.size === 0) {
      exports.__subscriberRef.current = null;
    }
  }
}

function onInteractionTraced(interaction) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onInteractionTraced(interaction);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onInteractionScheduledWorkCompleted(interaction) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onInteractionScheduledWorkCompleted(interaction);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkScheduled(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkScheduled(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkStarted(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkStarted(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkStopped(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkStopped(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkCanceled(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;
  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkCanceled(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

exports.unstable_clear = unstable_clear;
exports.unstable_getCurrent = unstable_getCurrent;
exports.unstable_getThreadID = unstable_getThreadID;
exports.unstable_subscribe = unstable_subscribe;
exports.unstable_trace = unstable_trace;
exports.unstable_unsubscribe = unstable_unsubscribe;
exports.unstable_wrap = unstable_wrap;
  })();
}


/***/ }),

/***/ "../../../../node_modules/scheduler/cjs/scheduler.development.js":
/*!***********************************************************************!*\
  !*** ../../../../node_modules/scheduler/cjs/scheduler.development.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
/** @license React v0.20.2
 * scheduler.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



if (true) {
  (function() {
'use strict';

var enableSchedulerDebugging = false;
var enableProfiling = false;

var requestHostCallback;
var requestHostTimeout;
var cancelHostTimeout;
var requestPaint;
var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';

if (hasPerformanceNow) {
  var localPerformance = performance;

  exports.unstable_now = function () {
    return localPerformance.now();
  };
} else {
  var localDate = Date;
  var initialTime = localDate.now();

  exports.unstable_now = function () {
    return localDate.now() - initialTime;
  };
}

if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive
// implementation using setTimeout.
typeof window === 'undefined' || // Check if MessageChannel is supported, too.
typeof MessageChannel !== 'function') {
  // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,
  // fallback to a naive implementation.
  var _callback = null;
  var _timeoutID = null;

  var _flushCallback = function () {
    if (_callback !== null) {
      try {
        var currentTime = exports.unstable_now();
        var hasRemainingTime = true;

        _callback(hasRemainingTime, currentTime);

        _callback = null;
      } catch (e) {
        setTimeout(_flushCallback, 0);
        throw e;
      }
    }
  };

  requestHostCallback = function (cb) {
    if (_callback !== null) {
      // Protect against re-entrancy.
      setTimeout(requestHostCallback, 0, cb);
    } else {
      _callback = cb;
      setTimeout(_flushCallback, 0);
    }
  };

  requestHostTimeout = function (cb, ms) {
    _timeoutID = setTimeout(cb, ms);
  };

  cancelHostTimeout = function () {
    clearTimeout(_timeoutID);
  };

  exports.unstable_shouldYield = function () {
    return false;
  };

  requestPaint = exports.unstable_forceFrameRate = function () {};
} else {
  // Capture local references to native APIs, in case a polyfill overrides them.
  var _setTimeout = window.setTimeout;
  var _clearTimeout = window.clearTimeout;

  if (typeof console !== 'undefined') {
    // TODO: Scheduler no longer requires these methods to be polyfilled. But
    // maybe we want to continue warning if they don't exist, to preserve the
    // option to rely on it in the future?
    var requestAnimationFrame = window.requestAnimationFrame;
    var cancelAnimationFrame = window.cancelAnimationFrame;

    if (typeof requestAnimationFrame !== 'function') {
      // Using console['error'] to evade Babel and ESLint
      console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
    }

    if (typeof cancelAnimationFrame !== 'function') {
      // Using console['error'] to evade Babel and ESLint
      console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
    }
  }

  var isMessageLoopRunning = false;
  var scheduledHostCallback = null;
  var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
  // thread, like user events. By default, it yields multiple times per frame.
  // It does not attempt to align with frame boundaries, since most tasks don't
  // need to be frame aligned; for those that do, use requestAnimationFrame.

  var yieldInterval = 5;
  var deadline = 0; // TODO: Make this configurable

  {
    // `isInputPending` is not available. Since we have no way of knowing if
    // there's pending input, always yield at the end of the frame.
    exports.unstable_shouldYield = function () {
      return exports.unstable_now() >= deadline;
    }; // Since we yield every frame regardless, `requestPaint` has no effect.


    requestPaint = function () {};
  }

  exports.unstable_forceFrameRate = function (fps) {
    if (fps < 0 || fps > 125) {
      // Using console['error'] to evade Babel and ESLint
      console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
      return;
    }

    if (fps > 0) {
      yieldInterval = Math.floor(1000 / fps);
    } else {
      // reset the framerate
      yieldInterval = 5;
    }
  };

  var performWorkUntilDeadline = function () {
    if (scheduledHostCallback !== null) {
      var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync
      // cycle. This means there's always time remaining at the beginning of
      // the message event.

      deadline = currentTime + yieldInterval;
      var hasTimeRemaining = true;

      try {
        var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);

        if (!hasMoreWork) {
          isMessageLoopRunning = false;
          scheduledHostCallback = null;
        } else {
          // If there's more work, schedule the next message event at the end
          // of the preceding one.
          port.postMessage(null);
        }
      } catch (error) {
        // If a scheduler task throws, exit the current browser task so the
        // error can be observed.
        port.postMessage(null);
        throw error;
      }
    } else {
      isMessageLoopRunning = false;
    } // Yielding to the browser will give it a chance to paint, so we can
  };

  var channel = new MessageChannel();
  var port = channel.port2;
  channel.port1.onmessage = performWorkUntilDeadline;

  requestHostCallback = function (callback) {
    scheduledHostCallback = callback;

    if (!isMessageLoopRunning) {
      isMessageLoopRunning = true;
      port.postMessage(null);
    }
  };

  requestHostTimeout = function (callback, ms) {
    taskTimeoutID = _setTimeout(function () {
      callback(exports.unstable_now());
    }, ms);
  };

  cancelHostTimeout = function () {
    _clearTimeout(taskTimeoutID);

    taskTimeoutID = -1;
  };
}

function push(heap, node) {
  var index = heap.length;
  heap.push(node);
  siftUp(heap, node, index);
}
function peek(heap) {
  var first = heap[0];
  return first === undefined ? null : first;
}
function pop(heap) {
  var first = heap[0];

  if (first !== undefined) {
    var last = heap.pop();

    if (last !== first) {
      heap[0] = last;
      siftDown(heap, last, 0);
    }

    return first;
  } else {
    return null;
  }
}

function siftUp(heap, node, i) {
  var index = i;

  while (true) {
    var parentIndex = index - 1 >>> 1;
    var parent = heap[parentIndex];

    if (parent !== undefined && compare(parent, node) > 0) {
      // The parent is larger. Swap positions.
      heap[parentIndex] = node;
      heap[index] = parent;
      index = parentIndex;
    } else {
      // The parent is smaller. Exit.
      return;
    }
  }
}

function siftDown(heap, node, i) {
  var index = i;
  var length = heap.length;

  while (index < length) {
    var leftIndex = (index + 1) * 2 - 1;
    var left = heap[leftIndex];
    var rightIndex = leftIndex + 1;
    var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.

    if (left !== undefined && compare(left, node) < 0) {
      if (right !== undefined && compare(right, left) < 0) {
        heap[index] = right;
        heap[rightIndex] = node;
        index = rightIndex;
      } else {
        heap[index] = left;
        heap[leftIndex] = node;
        index = leftIndex;
      }
    } else if (right !== undefined && compare(right, node) < 0) {
      heap[index] = right;
      heap[rightIndex] = node;
      index = rightIndex;
    } else {
      // Neither child is smaller. Exit.
      return;
    }
  }
}

function compare(a, b) {
  // Compare sort index first, then task id.
  var diff = a.sortIndex - b.sortIndex;
  return diff !== 0 ? diff : a.id - b.id;
}

// TODO: Use symbols?
var ImmediatePriority = 1;
var UserBlockingPriority = 2;
var NormalPriority = 3;
var LowPriority = 4;
var IdlePriority = 5;

function markTaskErrored(task, ms) {
}

/* eslint-disable no-var */
// Math.pow(2, 30) - 1
// 0b111111111111111111111111111111

var maxSigned31BitInt = 1073741823; // Times out immediately

var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out

var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
var NORMAL_PRIORITY_TIMEOUT = 5000;
var LOW_PRIORITY_TIMEOUT = 10000; // Never times out

var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap

var taskQueue = [];
var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.

var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
var currentTask = null;
var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.

var isPerformingWork = false;
var isHostCallbackScheduled = false;
var isHostTimeoutScheduled = false;

function advanceTimers(currentTime) {
  // Check for tasks that are no longer delayed and add them to the queue.
  var timer = peek(timerQueue);

  while (timer !== null) {
    if (timer.callback === null) {
      // Timer was cancelled.
      pop(timerQueue);
    } else if (timer.startTime <= currentTime) {
      // Timer fired. Transfer to the task queue.
      pop(timerQueue);
      timer.sortIndex = timer.expirationTime;
      push(taskQueue, timer);
    } else {
      // Remaining timers are pending.
      return;
    }

    timer = peek(timerQueue);
  }
}

function handleTimeout(currentTime) {
  isHostTimeoutScheduled = false;
  advanceTimers(currentTime);

  if (!isHostCallbackScheduled) {
    if (peek(taskQueue) !== null) {
      isHostCallbackScheduled = true;
      requestHostCallback(flushWork);
    } else {
      var firstTimer = peek(timerQueue);

      if (firstTimer !== null) {
        requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
      }
    }
  }
}

function flushWork(hasTimeRemaining, initialTime) {


  isHostCallbackScheduled = false;

  if (isHostTimeoutScheduled) {
    // We scheduled a timeout but it's no longer needed. Cancel it.
    isHostTimeoutScheduled = false;
    cancelHostTimeout();
  }

  isPerformingWork = true;
  var previousPriorityLevel = currentPriorityLevel;

  try {
    if (enableProfiling) {
      try {
        return workLoop(hasTimeRemaining, initialTime);
      } catch (error) {
        if (currentTask !== null) {
          var currentTime = exports.unstable_now();
          markTaskErrored(currentTask, currentTime);
          currentTask.isQueued = false;
        }

        throw error;
      }
    } else {
      // No catch in prod code path.
      return workLoop(hasTimeRemaining, initialTime);
    }
  } finally {
    currentTask = null;
    currentPriorityLevel = previousPriorityLevel;
    isPerformingWork = false;
  }
}

function workLoop(hasTimeRemaining, initialTime) {
  var currentTime = initialTime;
  advanceTimers(currentTime);
  currentTask = peek(taskQueue);

  while (currentTask !== null && !(enableSchedulerDebugging )) {
    if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || exports.unstable_shouldYield())) {
      // This currentTask hasn't expired, and we've reached the deadline.
      break;
    }

    var callback = currentTask.callback;

    if (typeof callback === 'function') {
      currentTask.callback = null;
      currentPriorityLevel = currentTask.priorityLevel;
      var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;

      var continuationCallback = callback(didUserCallbackTimeout);
      currentTime = exports.unstable_now();

      if (typeof continuationCallback === 'function') {
        currentTask.callback = continuationCallback;
      } else {

        if (currentTask === peek(taskQueue)) {
          pop(taskQueue);
        }
      }

      advanceTimers(currentTime);
    } else {
      pop(taskQueue);
    }

    currentTask = peek(taskQueue);
  } // Return whether there's additional work


  if (currentTask !== null) {
    return true;
  } else {
    var firstTimer = peek(timerQueue);

    if (firstTimer !== null) {
      requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
    }

    return false;
  }
}

function unstable_runWithPriority(priorityLevel, eventHandler) {
  switch (priorityLevel) {
    case ImmediatePriority:
    case UserBlockingPriority:
    case NormalPriority:
    case LowPriority:
    case IdlePriority:
      break;

    default:
      priorityLevel = NormalPriority;
  }

  var previousPriorityLevel = currentPriorityLevel;
  currentPriorityLevel = priorityLevel;

  try {
    return eventHandler();
  } finally {
    currentPriorityLevel = previousPriorityLevel;
  }
}

function unstable_next(eventHandler) {
  var priorityLevel;

  switch (currentPriorityLevel) {
    case ImmediatePriority:
    case UserBlockingPriority:
    case NormalPriority:
      // Shift down to normal priority
      priorityLevel = NormalPriority;
      break;

    default:
      // Anything lower than normal priority should remain at the current level.
      priorityLevel = currentPriorityLevel;
      break;
  }

  var previousPriorityLevel = currentPriorityLevel;
  currentPriorityLevel = priorityLevel;

  try {
    return eventHandler();
  } finally {
    currentPriorityLevel = previousPriorityLevel;
  }
}

function unstable_wrapCallback(callback) {
  var parentPriorityLevel = currentPriorityLevel;
  return function () {
    // This is a fork of runWithPriority, inlined for performance.
    var previousPriorityLevel = currentPriorityLevel;
    currentPriorityLevel = parentPriorityLevel;

    try {
      return callback.apply(this, arguments);
    } finally {
      currentPriorityLevel = previousPriorityLevel;
    }
  };
}

function unstable_scheduleCallback(priorityLevel, callback, options) {
  var currentTime = exports.unstable_now();
  var startTime;

  if (typeof options === 'object' && options !== null) {
    var delay = options.delay;

    if (typeof delay === 'number' && delay > 0) {
      startTime = currentTime + delay;
    } else {
      startTime = currentTime;
    }
  } else {
    startTime = currentTime;
  }

  var timeout;

  switch (priorityLevel) {
    case ImmediatePriority:
      timeout = IMMEDIATE_PRIORITY_TIMEOUT;
      break;

    case UserBlockingPriority:
      timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
      break;

    case IdlePriority:
      timeout = IDLE_PRIORITY_TIMEOUT;
      break;

    case LowPriority:
      timeout = LOW_PRIORITY_TIMEOUT;
      break;

    case NormalPriority:
    default:
      timeout = NORMAL_PRIORITY_TIMEOUT;
      break;
  }

  var expirationTime = startTime + timeout;
  var newTask = {
    id: taskIdCounter++,
    callback: callback,
    priorityLevel: priorityLevel,
    startTime: startTime,
    expirationTime: expirationTime,
    sortIndex: -1
  };

  if (startTime > currentTime) {
    // This is a delayed task.
    newTask.sortIndex = startTime;
    push(timerQueue, newTask);

    if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
      // All tasks are delayed, and this is the task with the earliest delay.
      if (isHostTimeoutScheduled) {
        // Cancel an existing timeout.
        cancelHostTimeout();
      } else {
        isHostTimeoutScheduled = true;
      } // Schedule a timeout.


      requestHostTimeout(handleTimeout, startTime - currentTime);
    }
  } else {
    newTask.sortIndex = expirationTime;
    push(taskQueue, newTask);
    // wait until the next time we yield.


    if (!isHostCallbackScheduled && !isPerformingWork) {
      isHostCallbackScheduled = true;
      requestHostCallback(flushWork);
    }
  }

  return newTask;
}

function unstable_pauseExecution() {
}

function unstable_continueExecution() {

  if (!isHostCallbackScheduled && !isPerformingWork) {
    isHostCallbackScheduled = true;
    requestHostCallback(flushWork);
  }
}

function unstable_getFirstCallbackNode() {
  return peek(taskQueue);
}

function unstable_cancelCallback(task) {
  // remove from the queue because you can't remove arbitrary nodes from an
  // array based heap, only the first one.)


  task.callback = null;
}

function unstable_getCurrentPriorityLevel() {
  return currentPriorityLevel;
}

var unstable_requestPaint = requestPaint;
var unstable_Profiling =  null;

exports.unstable_IdlePriority = IdlePriority;
exports.unstable_ImmediatePriority = ImmediatePriority;
exports.unstable_LowPriority = LowPriority;
exports.unstable_NormalPriority = NormalPriority;
exports.unstable_Profiling = unstable_Profiling;
exports.unstable_UserBlockingPriority = UserBlockingPriority;
exports.unstable_cancelCallback = unstable_cancelCallback;
exports.unstable_continueExecution = unstable_continueExecution;
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
exports.unstable_next = unstable_next;
exports.unstable_pauseExecution = unstable_pauseExecution;
exports.unstable_requestPaint = unstable_requestPaint;
exports.unstable_runWithPriority = unstable_runWithPriority;
exports.unstable_scheduleCallback = unstable_scheduleCallback;
exports.unstable_wrapCallback = unstable_wrapCallback;
  })();
}


/***/ }),

/***/ "../../../../node_modules/scheduler/index.js":
/*!***************************************************!*\
  !*** ../../../../node_modules/scheduler/index.js ***!
  \***************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1369806__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_1369806__(/*! ./cjs/scheduler.development.js */ "../../../../node_modules/scheduler/cjs/scheduler.development.js");
}


/***/ }),

/***/ "../../../../node_modules/scheduler/tracing.js":
/*!*****************************************************!*\
  !*** ../../../../node_modules/scheduler/tracing.js ***!
  \*****************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1370303__) => {

"use strict";


if (false) {} else {
  module.exports = __nested_webpack_require_1370303__(/*! ./cjs/scheduler-tracing.development.js */ "../../../../node_modules/scheduler/cjs/scheduler-tracing.development.js");
}


/***/ }),

/***/ "../../../../node_modules/split.js/dist/split.es.js":
/*!**********************************************************!*\
  !*** ../../../../node_modules/split.js/dist/split.es.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1370848__) => {

"use strict";
__nested_webpack_require_1370848__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1370848__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
// The programming goals of Split.js are to deliver readable, understandable and
// maintainable code, while at the same time manually optimizing for tiny minified file size,
// browser compatibility without additional requirements
// and very few assumptions about the user's page layout.
var global = typeof window !== 'undefined' ? window : null;
var ssr = global === null;
var document = !ssr ? global.document : undefined;

// Save a couple long function names that are used frequently.
// This optimization saves around 400 bytes.
var addEventListener = 'addEventListener';
var removeEventListener = 'removeEventListener';
var getBoundingClientRect = 'getBoundingClientRect';
var gutterStartDragging = '_a';
var aGutterSize = '_b';
var bGutterSize = '_c';
var HORIZONTAL = 'horizontal';
var NOOP = function () { return false; };

// Helper function determines which prefixes of CSS calc we need.
// We only need to do this once on startup, when this anonymous function is called.
//
// Tests -webkit, -moz and -o prefixes. Modified from StackOverflow:
// http://stackoverflow.com/questions/16625140/js-feature-detection-to-detect-the-usage-of-webkit-calc-over-calc/16625167#16625167
var calc = ssr
    ? 'calc'
    : ((['', '-webkit-', '-moz-', '-o-']
          .filter(function (prefix) {
              var el = document.createElement('div');
              el.style.cssText = "width:" + prefix + "calc(9px)";

              return !!el.style.length
          })
          .shift()) + "calc");

// Helper function checks if its argument is a string-like type
var isString = function (v) { return typeof v === 'string' || v instanceof String; };

// Helper function allows elements and string selectors to be used
// interchangeably. In either case an element is returned. This allows us to
// do `Split([elem1, elem2])` as well as `Split(['#id1', '#id2'])`.
var elementOrSelector = function (el) {
    if (isString(el)) {
        var ele = document.querySelector(el);
        if (!ele) {
            throw new Error(("Selector " + el + " did not match a DOM element"))
        }
        return ele
    }

    return el
};

// Helper function gets a property from the properties object, with a default fallback
var getOption = function (options, propName, def) {
    var value = options[propName];
    if (value !== undefined) {
        return value
    }
    return def
};

var getGutterSize = function (gutterSize, isFirst, isLast, gutterAlign) {
    if (isFirst) {
        if (gutterAlign === 'end') {
            return 0
        }
        if (gutterAlign === 'center') {
            return gutterSize / 2
        }
    } else if (isLast) {
        if (gutterAlign === 'start') {
            return 0
        }
        if (gutterAlign === 'center') {
            return gutterSize / 2
        }
    }

    return gutterSize
};

// Default options
var defaultGutterFn = function (i, gutterDirection) {
    var gut = document.createElement('div');
    gut.className = "gutter gutter-" + gutterDirection;
    return gut
};

var defaultElementStyleFn = function (dim, size, gutSize) {
    var style = {};

    if (!isString(size)) {
        style[dim] = calc + "(" + size + "% - " + gutSize + "px)";
    } else {
        style[dim] = size;
    }

    return style
};

var defaultGutterStyleFn = function (dim, gutSize) {
    var obj;

    return (( obj = {}, obj[dim] = (gutSize + "px"), obj ));
};

// The main function to initialize a split. Split.js thinks about each pair
// of elements as an independant pair. Dragging the gutter between two elements
// only changes the dimensions of elements in that pair. This is key to understanding
// how the following functions operate, since each function is bound to a pair.
//
// A pair object is shaped like this:
//
// {
//     a: DOM element,
//     b: DOM element,
//     aMin: Number,
//     bMin: Number,
//     dragging: Boolean,
//     parent: DOM element,
//     direction: 'horizontal' | 'vertical'
// }
//
// The basic sequence:
//
// 1. Set defaults to something sane. `options` doesn't have to be passed at all.
// 2. Initialize a bunch of strings based on the direction we're splitting.
//    A lot of the behavior in the rest of the library is paramatized down to
//    rely on CSS strings and classes.
// 3. Define the dragging helper functions, and a few helpers to go with them.
// 4. Loop through the elements while pairing them off. Every pair gets an
//    `pair` object and a gutter.
// 5. Actually size the pair elements, insert gutters and attach event listeners.
var Split = function (idsOption, options) {
    if ( options === void 0 ) options = {};

    if (ssr) { return {} }

    var ids = idsOption;
    var dimension;
    var clientAxis;
    var position;
    var positionEnd;
    var clientSize;
    var elements;

    // Allow HTMLCollection to be used as an argument when supported
    if (Array.from) {
        ids = Array.from(ids);
    }

    // All DOM elements in the split should have a common parent. We can grab
    // the first elements parent and hope users read the docs because the
    // behavior will be whacky otherwise.
    var firstElement = elementOrSelector(ids[0]);
    var parent = firstElement.parentNode;
    var parentStyle = getComputedStyle ? getComputedStyle(parent) : null;
    var parentFlexDirection = parentStyle ? parentStyle.flexDirection : null;

    // Set default options.sizes to equal percentages of the parent element.
    var sizes = getOption(options, 'sizes') || ids.map(function () { return 100 / ids.length; });

    // Standardize minSize and maxSize to an array if it isn't already.
    // This allows minSize and maxSize to be passed as a number.
    var minSize = getOption(options, 'minSize', 100);
    var minSizes = Array.isArray(minSize) ? minSize : ids.map(function () { return minSize; });
    var maxSize = getOption(options, 'maxSize', Infinity);
    var maxSizes = Array.isArray(maxSize) ? maxSize : ids.map(function () { return maxSize; });

    // Get other options
    var expandToMin = getOption(options, 'expandToMin', false);
    var gutterSize = getOption(options, 'gutterSize', 10);
    var gutterAlign = getOption(options, 'gutterAlign', 'center');
    var snapOffset = getOption(options, 'snapOffset', 30);
    var snapOffsets = Array.isArray(snapOffset) ? snapOffset : ids.map(function () { return snapOffset; });
    var dragInterval = getOption(options, 'dragInterval', 1);
    var direction = getOption(options, 'direction', HORIZONTAL);
    var cursor = getOption(
        options,
        'cursor',
        direction === HORIZONTAL ? 'col-resize' : 'row-resize'
    );
    var gutter = getOption(options, 'gutter', defaultGutterFn);
    var elementStyle = getOption(
        options,
        'elementStyle',
        defaultElementStyleFn
    );
    var gutterStyle = getOption(options, 'gutterStyle', defaultGutterStyleFn);

    // 2. Initialize a bunch of strings based on the direction we're splitting.
    // A lot of the behavior in the rest of the library is paramatized down to
    // rely on CSS strings and classes.
    if (direction === HORIZONTAL) {
        dimension = 'width';
        clientAxis = 'clientX';
        position = 'left';
        positionEnd = 'right';
        clientSize = 'clientWidth';
    } else if (direction === 'vertical') {
        dimension = 'height';
        clientAxis = 'clientY';
        position = 'top';
        positionEnd = 'bottom';
        clientSize = 'clientHeight';
    }

    // 3. Define the dragging helper functions, and a few helpers to go with them.
    // Each helper is bound to a pair object that contains its metadata. This
    // also makes it easy to store references to listeners that that will be
    // added and removed.
    //
    // Even though there are no other functions contained in them, aliasing
    // this to self saves 50 bytes or so since it's used so frequently.
    //
    // The pair object saves metadata like dragging state, position and
    // event listener references.

    function setElementSize(el, size, gutSize, i) {
        // Split.js allows setting sizes via numbers (ideally), or if you must,
        // by string, like '300px'. This is less than ideal, because it breaks
        // the fluid layout that `calc(% - px)` provides. You're on your own if you do that,
        // make sure you calculate the gutter size by hand.
        var style = elementStyle(dimension, size, gutSize, i);

        Object.keys(style).forEach(function (prop) {
            // eslint-disable-next-line no-param-reassign
            el.style[prop] = style[prop];
        });
    }

    function setGutterSize(gutterElement, gutSize, i) {
        var style = gutterStyle(dimension, gutSize, i);

        Object.keys(style).forEach(function (prop) {
            // eslint-disable-next-line no-param-reassign
            gutterElement.style[prop] = style[prop];
        });
    }

    function getSizes() {
        return elements.map(function (element) { return element.size; })
    }

    // Supports touch events, but not multitouch, so only the first
    // finger `touches[0]` is counted.
    function getMousePosition(e) {
        if ('touches' in e) { return e.touches[0][clientAxis] }
        return e[clientAxis]
    }

    // Actually adjust the size of elements `a` and `b` to `offset` while dragging.
    // calc is used to allow calc(percentage + gutterpx) on the whole split instance,
    // which allows the viewport to be resized without additional logic.
    // Element a's size is the same as offset. b's size is total size - a size.
    // Both sizes are calculated from the initial parent percentage,
    // then the gutter size is subtracted.
    function adjust(offset) {
        var a = elements[this.a];
        var b = elements[this.b];
        var percentage = a.size + b.size;

        a.size = (offset / this.size) * percentage;
        b.size = percentage - (offset / this.size) * percentage;

        setElementSize(a.element, a.size, this[aGutterSize], a.i);
        setElementSize(b.element, b.size, this[bGutterSize], b.i);
    }

    // drag, where all the magic happens. The logic is really quite simple:
    //
    // 1. Ignore if the pair is not dragging.
    // 2. Get the offset of the event.
    // 3. Snap offset to min if within snappable range (within min + snapOffset).
    // 4. Actually adjust each element in the pair to offset.
    //
    // ---------------------------------------------------------------------
    // |    | <- a.minSize               ||              b.minSize -> |    |
    // |    |  | <- this.snapOffset      ||     this.snapOffset -> |  |    |
    // |    |  |                         ||                        |  |    |
    // |    |  |                         ||                        |  |    |
    // ---------------------------------------------------------------------
    // | <- this.start                                        this.size -> |
    function drag(e) {
        var offset;
        var a = elements[this.a];
        var b = elements[this.b];

        if (!this.dragging) { return }

        // Get the offset of the event from the first side of the
        // pair `this.start`. Then offset by the initial position of the
        // mouse compared to the gutter size.
        offset =
            getMousePosition(e) -
            this.start +
            (this[aGutterSize] - this.dragOffset);

        if (dragInterval > 1) {
            offset = Math.round(offset / dragInterval) * dragInterval;
        }

        // If within snapOffset of min or max, set offset to min or max.
        // snapOffset buffers a.minSize and b.minSize, so logic is opposite for both.
        // Include the appropriate gutter sizes to prevent overflows.
        if (offset <= a.minSize + a.snapOffset + this[aGutterSize]) {
            offset = a.minSize + this[aGutterSize];
        } else if (
            offset >=
            this.size - (b.minSize + b.snapOffset + this[bGutterSize])
        ) {
            offset = this.size - (b.minSize + this[bGutterSize]);
        }

        if (offset >= a.maxSize - a.snapOffset + this[aGutterSize]) {
            offset = a.maxSize + this[aGutterSize];
        } else if (
            offset <=
            this.size - (b.maxSize - b.snapOffset + this[bGutterSize])
        ) {
            offset = this.size - (b.maxSize + this[bGutterSize]);
        }

        // Actually adjust the size.
        adjust.call(this, offset);

        // Call the drag callback continously. Don't do anything too intensive
        // in this callback.
        getOption(options, 'onDrag', NOOP)(getSizes());
    }

    // Cache some important sizes when drag starts, so we don't have to do that
    // continously:
    //
    // `size`: The total size of the pair. First + second + first gutter + second gutter.
    // `start`: The leading side of the first element.
    //
    // ------------------------------------------------
    // |      aGutterSize -> |||                      |
    // |                     |||                      |
    // |                     |||                      |
    // |                     ||| <- bGutterSize       |
    // ------------------------------------------------
    // | <- start                             size -> |
    function calculateSizes() {
        // Figure out the parent size minus padding.
        var a = elements[this.a].element;
        var b = elements[this.b].element;

        var aBounds = a[getBoundingClientRect]();
        var bBounds = b[getBoundingClientRect]();

        this.size =
            aBounds[dimension] +
            bBounds[dimension] +
            this[aGutterSize] +
            this[bGutterSize];
        this.start = aBounds[position];
        this.end = aBounds[positionEnd];
    }

    function innerSize(element) {
        // Return nothing if getComputedStyle is not supported (< IE9)
        // Or if parent element has no layout yet
        if (!getComputedStyle) { return null }

        var computedStyle = getComputedStyle(element);

        if (!computedStyle) { return null }

        var size = element[clientSize];

        if (size === 0) { return null }

        if (direction === HORIZONTAL) {
            size -=
                parseFloat(computedStyle.paddingLeft) +
                parseFloat(computedStyle.paddingRight);
        } else {
            size -=
                parseFloat(computedStyle.paddingTop) +
                parseFloat(computedStyle.paddingBottom);
        }

        return size
    }

    // When specifying percentage sizes that are less than the computed
    // size of the element minus the gutter, the lesser percentages must be increased
    // (and decreased from the other elements) to make space for the pixels
    // subtracted by the gutters.
    function trimToMin(sizesToTrim) {
        // Try to get inner size of parent element.
        // If it's no supported, return original sizes.
        var parentSize = innerSize(parent);
        if (parentSize === null) {
            return sizesToTrim
        }

        if (minSizes.reduce(function (a, b) { return a + b; }, 0) > parentSize) {
            return sizesToTrim
        }

        // Keep track of the excess pixels, the amount of pixels over the desired percentage
        // Also keep track of the elements with pixels to spare, to decrease after if needed
        var excessPixels = 0;
        var toSpare = [];

        var pixelSizes = sizesToTrim.map(function (size, i) {
            // Convert requested percentages to pixel sizes
            var pixelSize = (parentSize * size) / 100;
            var elementGutterSize = getGutterSize(
                gutterSize,
                i === 0,
                i === sizesToTrim.length - 1,
                gutterAlign
            );
            var elementMinSize = minSizes[i] + elementGutterSize;

            // If element is too smal, increase excess pixels by the difference
            // and mark that it has no pixels to spare
            if (pixelSize < elementMinSize) {
                excessPixels += elementMinSize - pixelSize;
                toSpare.push(0);
                return elementMinSize
            }

            // Otherwise, mark the pixels it has to spare and return it's original size
            toSpare.push(pixelSize - elementMinSize);
            return pixelSize
        });

        // If nothing was adjusted, return the original sizes
        if (excessPixels === 0) {
            return sizesToTrim
        }

        return pixelSizes.map(function (pixelSize, i) {
            var newPixelSize = pixelSize;

            // While there's still pixels to take, and there's enough pixels to spare,
            // take as many as possible up to the total excess pixels
            if (excessPixels > 0 && toSpare[i] - excessPixels > 0) {
                var takenPixels = Math.min(
                    excessPixels,
                    toSpare[i] - excessPixels
                );

                // Subtract the amount taken for the next iteration
                excessPixels -= takenPixels;
                newPixelSize = pixelSize - takenPixels;
            }

            // Return the pixel size adjusted as a percentage
            return (newPixelSize / parentSize) * 100
        })
    }

    // stopDragging is very similar to startDragging in reverse.
    function stopDragging() {
        var self = this;
        var a = elements[self.a].element;
        var b = elements[self.b].element;

        if (self.dragging) {
            getOption(options, 'onDragEnd', NOOP)(getSizes());
        }

        self.dragging = false;

        // Remove the stored event listeners. This is why we store them.
        global[removeEventListener]('mouseup', self.stop);
        global[removeEventListener]('touchend', self.stop);
        global[removeEventListener]('touchcancel', self.stop);
        global[removeEventListener]('mousemove', self.move);
        global[removeEventListener]('touchmove', self.move);

        // Clear bound function references
        self.stop = null;
        self.move = null;

        a[removeEventListener]('selectstart', NOOP);
        a[removeEventListener]('dragstart', NOOP);
        b[removeEventListener]('selectstart', NOOP);
        b[removeEventListener]('dragstart', NOOP);

        a.style.userSelect = '';
        a.style.webkitUserSelect = '';
        a.style.MozUserSelect = '';
        a.style.pointerEvents = '';

        b.style.userSelect = '';
        b.style.webkitUserSelect = '';
        b.style.MozUserSelect = '';
        b.style.pointerEvents = '';

        self.gutter.style.cursor = '';
        self.parent.style.cursor = '';
        document.body.style.cursor = '';
    }

    // startDragging calls `calculateSizes` to store the inital size in the pair object.
    // It also adds event listeners for mouse/touch events,
    // and prevents selection while dragging so avoid the selecting text.
    function startDragging(e) {
        // Right-clicking can't start dragging.
        if ('button' in e && e.button !== 0) {
            return
        }

        // Alias frequently used variables to save space. 200 bytes.
        var self = this;
        var a = elements[self.a].element;
        var b = elements[self.b].element;

        // Call the onDragStart callback.
        if (!self.dragging) {
            getOption(options, 'onDragStart', NOOP)(getSizes());
        }

        // Don't actually drag the element. We emulate that in the drag function.
        e.preventDefault();

        // Set the dragging property of the pair object.
        self.dragging = true;

        // Create two event listeners bound to the same pair object and store
        // them in the pair object.
        self.move = drag.bind(self);
        self.stop = stopDragging.bind(self);

        // All the binding. `window` gets the stop events in case we drag out of the elements.
        global[addEventListener]('mouseup', self.stop);
        global[addEventListener]('touchend', self.stop);
        global[addEventListener]('touchcancel', self.stop);
        global[addEventListener]('mousemove', self.move);
        global[addEventListener]('touchmove', self.move);

        // Disable selection. Disable!
        a[addEventListener]('selectstart', NOOP);
        a[addEventListener]('dragstart', NOOP);
        b[addEventListener]('selectstart', NOOP);
        b[addEventListener]('dragstart', NOOP);

        a.style.userSelect = 'none';
        a.style.webkitUserSelect = 'none';
        a.style.MozUserSelect = 'none';
        a.style.pointerEvents = 'none';

        b.style.userSelect = 'none';
        b.style.webkitUserSelect = 'none';
        b.style.MozUserSelect = 'none';
        b.style.pointerEvents = 'none';

        // Set the cursor at multiple levels
        self.gutter.style.cursor = cursor;
        self.parent.style.cursor = cursor;
        document.body.style.cursor = cursor;

        // Cache the initial sizes of the pair.
        calculateSizes.call(self);

        // Determine the position of the mouse compared to the gutter
        self.dragOffset = getMousePosition(e) - self.end;
    }

    // adjust sizes to ensure percentage is within min size and gutter.
    sizes = trimToMin(sizes);

    // 5. Create pair and element objects. Each pair has an index reference to
    // elements `a` and `b` of the pair (first and second elements).
    // Loop through the elements while pairing them off. Every pair gets a
    // `pair` object and a gutter.
    //
    // Basic logic:
    //
    // - Starting with the second element `i > 0`, create `pair` objects with
    //   `a = i - 1` and `b = i`
    // - Set gutter sizes based on the _pair_ being first/last. The first and last
    //   pair have gutterSize / 2, since they only have one half gutter, and not two.
    // - Create gutter elements and add event listeners.
    // - Set the size of the elements, minus the gutter sizes.
    //
    // -----------------------------------------------------------------------
    // |     i=0     |         i=1         |        i=2       |      i=3     |
    // |             |                     |                  |              |
    // |           pair 0                pair 1             pair 2           |
    // |             |                     |                  |              |
    // -----------------------------------------------------------------------
    var pairs = [];
    elements = ids.map(function (id, i) {
        // Create the element object.
        var element = {
            element: elementOrSelector(id),
            size: sizes[i],
            minSize: minSizes[i],
            maxSize: maxSizes[i],
            snapOffset: snapOffsets[i],
            i: i,
        };

        var pair;

        if (i > 0) {
            // Create the pair object with its metadata.
            pair = {
                a: i - 1,
                b: i,
                dragging: false,
                direction: direction,
                parent: parent,
            };

            pair[aGutterSize] = getGutterSize(
                gutterSize,
                i - 1 === 0,
                false,
                gutterAlign
            );
            pair[bGutterSize] = getGutterSize(
                gutterSize,
                false,
                i === ids.length - 1,
                gutterAlign
            );

            // if the parent has a reverse flex-direction, switch the pair elements.
            if (
                parentFlexDirection === 'row-reverse' ||
                parentFlexDirection === 'column-reverse'
            ) {
                var temp = pair.a;
                pair.a = pair.b;
                pair.b = temp;
            }
        }

        // Determine the size of the current element. IE8 is supported by
        // staticly assigning sizes without draggable gutters. Assigns a string
        // to `size`.
        //
        // Create gutter elements for each pair.
        if (i > 0) {
            var gutterElement = gutter(i, direction, element.element);
            setGutterSize(gutterElement, gutterSize, i);

            // Save bound event listener for removal later
            pair[gutterStartDragging] = startDragging.bind(pair);

            // Attach bound event listener
            gutterElement[addEventListener](
                'mousedown',
                pair[gutterStartDragging]
            );
            gutterElement[addEventListener](
                'touchstart',
                pair[gutterStartDragging]
            );

            parent.insertBefore(gutterElement, element.element);

            pair.gutter = gutterElement;
        }

        setElementSize(
            element.element,
            element.size,
            getGutterSize(
                gutterSize,
                i === 0,
                i === ids.length - 1,
                gutterAlign
            ),
            i
        );

        // After the first iteration, and we have a pair object, append it to the
        // list of pairs.
        if (i > 0) {
            pairs.push(pair);
        }

        return element
    });

    function adjustToMin(element) {
        var isLast = element.i === pairs.length;
        var pair = isLast ? pairs[element.i - 1] : pairs[element.i];

        calculateSizes.call(pair);

        var size = isLast
            ? pair.size - element.minSize - pair[bGutterSize]
            : element.minSize + pair[aGutterSize];

        adjust.call(pair, size);
    }

    elements.forEach(function (element) {
        var computedSize = element.element[getBoundingClientRect]()[dimension];

        if (computedSize < element.minSize) {
            if (expandToMin) {
                adjustToMin(element);
            } else {
                // eslint-disable-next-line no-param-reassign
                element.minSize = computedSize;
            }
        }
    });

    function setSizes(newSizes) {
        var trimmed = trimToMin(newSizes);
        trimmed.forEach(function (newSize, i) {
            if (i > 0) {
                var pair = pairs[i - 1];

                var a = elements[pair.a];
                var b = elements[pair.b];

                a.size = trimmed[i - 1];
                b.size = newSize;

                setElementSize(a.element, a.size, pair[aGutterSize], a.i);
                setElementSize(b.element, b.size, pair[bGutterSize], b.i);
            }
        });
    }

    function destroy(preserveStyles, preserveGutter) {
        pairs.forEach(function (pair) {
            if (preserveGutter !== true) {
                pair.parent.removeChild(pair.gutter);
            } else {
                pair.gutter[removeEventListener](
                    'mousedown',
                    pair[gutterStartDragging]
                );
                pair.gutter[removeEventListener](
                    'touchstart',
                    pair[gutterStartDragging]
                );
            }

            if (preserveStyles !== true) {
                var style = elementStyle(
                    dimension,
                    pair.a.size,
                    pair[aGutterSize]
                );

                Object.keys(style).forEach(function (prop) {
                    elements[pair.a].element.style[prop] = '';
                    elements[pair.b].element.style[prop] = '';
                });
            }
        });
    }

    return {
        setSizes: setSizes,
        getSizes: getSizes,
        collapse: function collapse(i) {
            adjustToMin(elements[i]);
        },
        destroy: destroy,
        parent: parent,
        pairs: pairs,
    }
};

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


/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
/*!**************************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  \**************************************************************************************/
/***/ ((module) => {

"use strict";


var stylesInDOM = [];
function getIndexByIdentifier(identifier) {
  var result = -1;
  for (var i = 0; i < stylesInDOM.length; i++) {
    if (stylesInDOM[i].identifier === identifier) {
      result = i;
      break;
    }
  }
  return result;
}
function modulesToDom(list, options) {
  var idCountMap = {};
  var identifiers = [];
  for (var i = 0; i < list.length; i++) {
    var item = list[i];
    var id = options.base ? item[0] + options.base : item[0];
    var count = idCountMap[id] || 0;
    var identifier = "".concat(id, " ").concat(count);
    idCountMap[id] = count + 1;
    var indexByIdentifier = getIndexByIdentifier(identifier);
    var obj = {
      css: item[1],
      media: item[2],
      sourceMap: item[3],
      supports: item[4],
      layer: item[5]
    };
    if (indexByIdentifier !== -1) {
      stylesInDOM[indexByIdentifier].references++;
      stylesInDOM[indexByIdentifier].updater(obj);
    } else {
      var updater = addElementStyle(obj, options);
      options.byIndex = i;
      stylesInDOM.splice(i, 0, {
        identifier: identifier,
        updater: updater,
        references: 1
      });
    }
    identifiers.push(identifier);
  }
  return identifiers;
}
function addElementStyle(obj, options) {
  var api = options.domAPI(options);
  api.update(obj);
  var updater = function updater(newObj) {
    if (newObj) {
      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
        return;
      }
      api.update(obj = newObj);
    } else {
      api.remove();
    }
  };
  return updater;
}
module.exports = function (list, options) {
  options = options || {};
  list = list || [];
  var lastIdentifiers = modulesToDom(list, options);
  return function update(newList) {
    newList = newList || [];
    for (var i = 0; i < lastIdentifiers.length; i++) {
      var identifier = lastIdentifiers[i];
      var index = getIndexByIdentifier(identifier);
      stylesInDOM[index].references--;
    }
    var newLastIdentifiers = modulesToDom(newList, options);
    for (var _i = 0; _i < lastIdentifiers.length; _i++) {
      var _identifier = lastIdentifiers[_i];
      var _index = getIndexByIdentifier(_identifier);
      if (stylesInDOM[_index].references === 0) {
        stylesInDOM[_index].updater();
        stylesInDOM.splice(_index, 1);
      }
    }
    lastIdentifiers = newLastIdentifiers;
  };
};

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js":
/*!******************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/insertBySelector.js ***!
  \******************************************************************************/
/***/ ((module) => {

"use strict";


var memo = {};

/* istanbul ignore next  */
function getTarget(target) {
  if (typeof memo[target] === "undefined") {
    var styleTarget = document.querySelector(target);

    // Special case to return head of iframe instead of iframe itself
    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
      try {
        // This will throw an exception if access to iframe is blocked
        // due to cross-origin restrictions
        styleTarget = styleTarget.contentDocument.head;
      } catch (e) {
        // istanbul ignore next
        styleTarget = null;
      }
    }
    memo[target] = styleTarget;
  }
  return memo[target];
}

/* istanbul ignore next  */
function insertBySelector(insert, style) {
  var target = getTarget(insert);
  if (!target) {
    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  }
  target.appendChild(style);
}
module.exports = insertBySelector;

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js":
/*!********************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
  \********************************************************************************/
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function insertStyleElement(options) {
  var element = document.createElement("style");
  options.setAttributes(element, options.attributes);
  options.insert(element, options.options);
  return element;
}
module.exports = insertStyleElement;

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":
/*!********************************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
  \********************************************************************************************/
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_1404256__) => {

"use strict";


/* istanbul ignore next  */
function setAttributesWithoutAttributes(styleElement) {
  var nonce =   true ? __nested_webpack_require_1404256__.nc : 0;
  if (nonce) {
    styleElement.setAttribute("nonce", nonce);
  }
}
module.exports = setAttributesWithoutAttributes;

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js":
/*!*************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
  \*************************************************************************/
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function apply(styleElement, options, obj) {
  var css = "";
  if (obj.supports) {
    css += "@supports (".concat(obj.supports, ") {");
  }
  if (obj.media) {
    css += "@media ".concat(obj.media, " {");
  }
  var needLayer = typeof obj.layer !== "undefined";
  if (needLayer) {
    css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  }
  css += obj.css;
  if (needLayer) {
    css += "}";
  }
  if (obj.media) {
    css += "}";
  }
  if (obj.supports) {
    css += "}";
  }
  var sourceMap = obj.sourceMap;
  if (sourceMap && typeof btoa !== "undefined") {
    css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  }

  // For old IE
  /* istanbul ignore if  */
  options.styleTagTransform(css, styleElement, options.options);
}
function removeStyleElement(styleElement) {
  // istanbul ignore if
  if (styleElement.parentNode === null) {
    return false;
  }
  styleElement.parentNode.removeChild(styleElement);
}

/* istanbul ignore next  */
function domAPI(options) {
  if (typeof document === "undefined") {
    return {
      update: function update() {},
      remove: function remove() {}
    };
  }
  var styleElement = options.insertStyleElement(options);
  return {
    update: function update(obj) {
      apply(styleElement, options, obj);
    },
    remove: function remove() {
      removeStyleElement(styleElement);
    }
  };
}
module.exports = domAPI;

/***/ }),

/***/ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js":
/*!*******************************************************************************!*\
  !*** ../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
  \*******************************************************************************/
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function styleTagTransform(css, styleElement) {
  if (styleElement.styleSheet) {
    styleElement.styleSheet.cssText = css;
  } else {
    while (styleElement.firstChild) {
      styleElement.removeChild(styleElement.firstChild);
    }
    styleElement.appendChild(document.createTextNode(css));
  }
}
module.exports = styleTagTransform;

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/actionTabsComponent.js":
/*!********************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/actionTabsComponent.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1407587__) => {

"use strict";
__nested_webpack_require_1407587__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1407587__.d(__nested_webpack_exports__, {
/* harmony export */   ActionTabsComponent: () => (/* binding */ ActionTabsComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1407587__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1407587__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1407587__(/*! ./tabsComponent */ "../../../dev/inspector/dist/components/actionTabs/tabsComponent.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1407587__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _tabs_statisticsTabComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1407587__(/*! ./tabs/statisticsTabComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/statisticsTabComponent.js");
/* harmony import */ var _tabs_debugTabComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1407587__(/*! ./tabs/debugTabComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/debugTabComponent.js");
/* harmony import */ var re_resizable__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1407587__(/*! re-resizable */ "../../../../node_modules/re-resizable/lib/index.js");
/* harmony import */ var _tabs_propertyGridTabComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1407587__(/*! ./tabs/propertyGridTabComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGridTabComponent.js");
/* harmony import */ var _headerComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1407587__(/*! ../headerComponent */ "../../../dev/inspector/dist/components/headerComponent.js");
/* harmony import */ var _tabs_toolsTabComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1407587__(/*! ./tabs/toolsTabComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/toolsTabComponent.js");
/* harmony import */ var _tabs_settingsTabComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1407587__(/*! ./tabs/settingsTabComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/settingsTabComponent.js");
/* harmony import */ var _actionTabs_scss__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1407587__(/*! ./actionTabs.scss */ "../../../dev/inspector/dist/components/actionTabs/actionTabs.scss");












const ResizableCasted = re_resizable__WEBPACK_IMPORTED_MODULE_5__.Resizable;
class ActionTabsComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._once = true;
        let initialIndex = props.initialTab === undefined ? 0 /* DebugLayerTab.Properties */ : props.initialTab;
        if (this.props.globalState) {
            const validationResults = this.props.globalState.validationResults;
            if (validationResults) {
                if (validationResults.issues.numErrors || validationResults.issues.numWarnings) {
                    initialIndex = 3 /* DebugLayerTab.Tools */;
                }
            }
        }
        this.state = { selectedEntity: null, selectedIndex: initialIndex };
    }
    componentDidMount() {
        if (this.props.globalState) {
            this._onSelectionChangeObserver = this.props.globalState.onSelectionChangedObservable.add((entity) => {
                this.setState({ selectedEntity: entity, selectedIndex: 0 /* DebugLayerTab.Properties */ });
            });
            this._onTabChangedObserver = this.props.globalState.onTabChangedObservable.add((index) => {
                this.setState({ selectedIndex: index });
            });
        }
    }
    componentWillUnmount() {
        if (this.props.globalState) {
            if (this._onSelectionChangeObserver) {
                this.props.globalState.onSelectionChangedObservable.remove(this._onSelectionChangeObserver);
            }
            if (this._onTabChangedObserver) {
                this.props.globalState.onTabChangedObservable.remove(this._onTabChangedObserver);
            }
        }
    }
    changeSelectedTab(index) {
        if (this.props.globalState) {
            this.props.globalState.onTabChangedObservable.notifyObservers(index);
        }
    }
    renderContent() {
        if (this.props.globalState && this.props.scene) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_tabsComponent__WEBPACK_IMPORTED_MODULE_2__.TabsComponent, { selectedIndex: this.state.selectedIndex, onSelectedIndexChange: (value) => this.changeSelectedTab(value), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGridTabComponent__WEBPACK_IMPORTED_MODULE_6__.PropertyGridTabComponent, { title: "Properties", icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_11__.faFileAlt, scene: this.props.scene, selectedEntity: this.state.selectedEntity, globalState: this.props.globalState, onSelectionChangedObservable: this.props.globalState.onSelectionChangedObservable, onPropertyChangedObservable: this.props.globalState.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_debugTabComponent__WEBPACK_IMPORTED_MODULE_4__.DebugTabComponent, { title: "Debug", icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_11__.faBug, scene: this.props.scene, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_statisticsTabComponent__WEBPACK_IMPORTED_MODULE_3__.StatisticsTabComponent, { title: "Statistics", icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_11__.faChartBar, scene: this.props.scene, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_toolsTabComponent__WEBPACK_IMPORTED_MODULE_8__.ToolsTabComponent, { title: "Tools", icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_11__.faWrench, scene: this.props.scene, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_settingsTabComponent__WEBPACK_IMPORTED_MODULE_9__.SettingsTabComponent, { title: "Settings", icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_11__.faCog, scene: this.props.scene, globalState: this.props.globalState })] }));
        }
        else {
            return null;
        }
    }
    onClose() {
        if (!this.props.onClose) {
            return;
        }
        this.props.onClose();
    }
    onPopup() {
        if (!this.props.onPopup) {
            return;
        }
        this.props.onPopup();
    }
    render() {
        if (this.props.popupMode) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "actionTabs", children: [!this.props.noHeader && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_headerComponent__WEBPACK_IMPORTED_MODULE_7__.HeaderComponent, { title: "INSPECTOR", handleBack: true, noClose: this.props.noClose, noExpand: this.props.noExpand, noCommands: this.props.noCommands, onClose: () => this.onClose(), onPopup: () => this.onPopup(), onSelectionChangedObservable: this.props.globalState ? this.props.globalState.onSelectionChangedObservable : undefined })), this.renderContent()] }));
        }
        if (this._once) {
            this._once = false;
            // A bit hacky but no other way to force the initial width to 300px and not auto
            setTimeout(() => {
                const element = document.getElementById("actionTabs");
                if (!element) {
                    return;
                }
                element.style.width = "200px";
            }, 150);
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ResizableCasted, { id: "actionTabs", minWidth: 300, maxWidth: 600, defaultSize: { height: "100%" }, minHeight: "100%", enable: { top: false, right: false, bottom: false, left: true, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }, children: [!this.props.noHeader && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_headerComponent__WEBPACK_IMPORTED_MODULE_7__.HeaderComponent, { title: "INSPECTOR", handleBack: true, noClose: this.props.noClose, noExpand: this.props.noExpand, noCommands: this.props.noCommands, onClose: () => this.onClose(), onPopup: () => this.onPopup(), onSelectionChangedObservable: this.props.globalState ? this.props.globalState.onSelectionChangedObservable : undefined })), this.renderContent()] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/lines/meshPickerComponent.js":
/*!**************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/lines/meshPickerComponent.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1416762__) => {

"use strict";
__nested_webpack_require_1416762__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1416762__.d(__nested_webpack_exports__, {
/* harmony export */   MeshPickerComponent: () => (/* binding */ MeshPickerComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1416762__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1416762__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1416762__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");



class MeshPickerComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const meshEmitters = this.props.scene.meshes.filter((m) => !!m.name);
        meshEmitters.sort((a, b) => a.name.localeCompare(b.name));
        const emitterOptions = [{ label: "None", value: -1 }];
        meshEmitters.sort((a, b) => a.name.localeCompare(b.name));
        emitterOptions.push(...meshEmitters.map((v, i) => {
            return { label: v.name, value: i };
        }));
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_2__.OptionsLine, { label: this.props.label, options: emitterOptions, target: this.props.target, propertyName: this.props.property, noDirectUpdate: true, onSelect: (value) => {
                    const currentState = this.props.target[this.props.property];
                    switch (value) {
                        case -1:
                            this.props.target[this.props.property] = null;
                            break;
                        default:
                            this.props.target[this.props.property] = meshEmitters[value];
                    }
                    if (this.props.onPropertyChangedObservable) {
                        this.props.onPropertyChangedObservable.notifyObservers({
                            object: this.props.target,
                            property: this.props.property,
                            value: this.props.target[this.props.property],
                            initialValue: currentState,
                        });
                    }
                    this.forceUpdate();
                }, extractValue: () => {
                    if (!this.props.target[this.props.property]) {
                        return -1;
                    }
                    const meshIndex = meshEmitters.indexOf(this.props.target[this.props.property]);
                    if (meshIndex > -1) {
                        return meshIndex;
                    }
                    return -1;
                } }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/lines/quaternionLineComponent.js":
/*!******************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/lines/quaternionLineComponent.js ***!
  \******************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1420344__) => {

"use strict";
__nested_webpack_require_1420344__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1420344__.d(__nested_webpack_exports__, {
/* harmony export */   QuaternionLineComponent: () => (/* binding */ QuaternionLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1420344__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1420344__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1420344__(/*! shared-ui-components/lines/numericInputComponent */ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1420344__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1420344__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1420344__(/*! core/Misc/tools */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_1420344__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1420344__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1420344__(/*! shared-ui-components/copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var shared_ui_components_imgs_copy_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1420344__(/*! shared-ui-components/imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");









class QuaternionLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        const quat = this.props.target[this.props.propertyName].clone();
        this.state = { isExpanded: false, value: quat, eulerValue: quat.toEulerAngles() };
    }
    _checkRoundCircle(a, b) {
        return Math.abs(core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.ToDegrees(a)) + Math.abs(core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.ToDegrees(b)) === 360;
    }
    shouldComponentUpdate(nextProps, nextState) {
        const nextPropsValue = nextProps.target[nextProps.propertyName];
        if (!nextPropsValue.equals(nextState.value) || this._localChange) {
            nextState.value = nextPropsValue.clone();
            nextState.eulerValue = nextPropsValue.toEulerAngles();
            // Let's make sure we are not going on the opposite (but correct) value
            if (this._checkRoundCircle(nextState.eulerValue.x, this.state.eulerValue.x)) {
                nextState.eulerValue.x = this.state.eulerValue.x;
            }
            if (this._checkRoundCircle(nextState.eulerValue.y, this.state.eulerValue.y)) {
                nextState.eulerValue.y = this.state.eulerValue.y;
            }
            if (this._checkRoundCircle(nextState.eulerValue.z, this.state.eulerValue.z)) {
                nextState.eulerValue.z = this.state.eulerValue.z;
            }
            this._localChange = false;
            return true;
        }
        return false;
    }
    switchExpandState() {
        this._localChange = true;
        this.setState({ isExpanded: !this.state.isExpanded });
    }
    raiseOnPropertyChanged(currentValue, previousValue) {
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName,
            value: currentValue,
            initialValue: previousValue,
        });
    }
    updateQuaternion() {
        const store = this.props.target[this.props.propertyName].clone();
        this.props.target[this.props.propertyName] = this.state.value;
        this.setState({ value: store });
        this.raiseOnPropertyChanged(this.state.value, store);
    }
    updateStateX(value) {
        this._localChange = true;
        this.state.value.x = value;
        this.updateQuaternion();
    }
    updateStateY(value) {
        this._localChange = true;
        this.state.value.y = value;
        this.updateQuaternion();
    }
    updateStateZ(value) {
        this._localChange = true;
        this.state.value.z = value;
        this.updateQuaternion();
    }
    updateStateW(value) {
        this._localChange = true;
        this.state.value.w = value;
        this.updateQuaternion();
    }
    updateQuaternionFromEuler() {
        const quat = this.state.eulerValue.toQuaternion();
        this.state.value.x = quat.x;
        this.state.value.y = quat.y;
        this.state.value.z = quat.z;
        this.state.value.w = quat.w;
        this.updateQuaternion();
    }
    updateStateEulerX(value) {
        this._localChange = true;
        this.state.eulerValue.x = core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.ToRadians(value);
        this.updateQuaternionFromEuler();
    }
    updateStateEulerY(value) {
        this._localChange = true;
        this.state.eulerValue.y = core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.ToRadians(value);
        this.updateQuaternionFromEuler();
    }
    updateStateEulerZ(value) {
        this._localChange = true;
        this.state.eulerValue.z = core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.ToRadians(value);
        this.updateQuaternionFromEuler();
    }
    // Copy to clipboard the code this Quaternion actually does
    // Example : cube.rotationQuaternion = new BABYLON.Quaternion(0,0,0,1)// cube as BABYLON.Mesh;
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,shared_ui_components_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const strVector = "new " + babylonNamespace + "Quaternion(" + value.x + ", " + value.y + ", " + value.z + ", " + value.w + ")";
            const strCommand = targetName + "." + targetProperty + " = " + strVector + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,shared_ui_components_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,shared_ui_components_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        const chevron = this.state.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_3__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faMinus }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_3__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faPlus });
        const quat = this.state.value;
        const eulerDegrees = this.state.eulerValue.clone();
        eulerDegrees.x = core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.ToDegrees(eulerDegrees.x);
        eulerDegrees.y = core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.ToDegrees(eulerDegrees.y);
        eulerDegrees.z = core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.ToDegrees(eulerDegrees.z);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "vector3Line", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "firstLine", title: this.props.label + " (Using Quaternion)", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", children: this.props.label + " (Using Quaternion)" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "vector", children: [!this.props.useEuler && `X: ${quat.x.toFixed(1)}, Y: ${quat.y.toFixed(1)}, Z: ${quat.z.toFixed(1)}, W: ${quat.w.toFixed(1)}`, this.props.useEuler && `X: ${eulerDegrees.x.toFixed(2)}, Y: ${eulerDegrees.y.toFixed(2)}, Z: ${eulerDegrees.z.toFixed(2)}`] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: chevron }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: shared_ui_components_imgs_copy_svg__WEBPACK_IMPORTED_MODULE_8__, alt: "Copy" }) })] }), this.state.isExpanded && !this.props.useEuler && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_2__.NumericInput, { lockObject: this.props.lockObject, label: "x", value: quat.x, onChange: (value) => this.updateStateX(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_2__.NumericInput, { lockObject: this.props.lockObject, label: "y", value: quat.y, onChange: (value) => this.updateStateY(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_2__.NumericInput, { lockObject: this.props.lockObject, label: "z", value: quat.z, onChange: (value) => this.updateStateZ(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_2__.NumericInput, { lockObject: this.props.lockObject, label: "w", value: quat.w, onChange: (value) => this.updateStateW(value) })] })), this.state.isExpanded && this.props.useEuler && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "x", target: eulerDegrees, propertyName: "x", onChange: (value) => {
                                this.updateStateEulerX(value);
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "y", target: eulerDegrees, propertyName: "y", onChange: (value) => {
                                this.updateStateEulerY(value);
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "z", target: eulerDegrees, propertyName: "z", onChange: (value) => {
                                this.updateStateEulerZ(value);
                            } })] }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/lines/textureLineComponent.js":
/*!***************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/lines/textureLineComponent.js ***!
  \***************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1432651__) => {

"use strict";
__nested_webpack_require_1432651__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1432651__.d(__nested_webpack_exports__, {
/* harmony export */   TextureLineComponent: () => (/* binding */ TextureLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1432651__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1432651__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1432651__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var _textureHelper__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1432651__(/*! ../../../textureHelper */ "../../../dev/inspector/dist/textureHelper.js");

/* eslint-disable @typescript-eslint/naming-convention */



class TextureLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = {
            channels: TextureLineComponent._TextureChannelStates.ALL,
            face: 0,
        };
        this._canvasRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    shouldComponentUpdate(nextProps, nextState) {
        return nextProps.texture !== this.props.texture || nextState.channels !== this.state.channels || nextState.face !== this.state.face;
    }
    componentDidMount() {
        this.updatePreview();
    }
    componentDidUpdate() {
        this.updatePreview();
    }
    async updatePreview() {
        const previewCanvas = this._canvasRef.current;
        const texture = this.props.texture;
        const size = texture.getSize();
        const ratio = size.width / size.height;
        let width = this.props.width;
        let height = (width / ratio) | 1;
        const engine = this.props.texture.getScene()?.getEngine();
        if (engine && height > engine.getCaps().maxTextureSize) {
            // the texture.width/texture.height ratio is too small, so use the real width/height dimensions of the texture instead of the canvas width/computed height
            width = this.props.texture.getSize().width;
            height = this.props.texture.getSize().height;
        }
        try {
            const data = await _textureHelper__WEBPACK_IMPORTED_MODULE_3__.TextureHelper.GetTextureDataAsync(texture, width, height, this.state.face, this.state.channels, this.props.globalState);
            previewCanvas.width = width;
            previewCanvas.height = height;
            const context = previewCanvas.getContext("2d");
            if (context) {
                // Copy the pixels to the preview canvas
                const imageData = context.createImageData(width, height);
                const castData = imageData.data;
                castData.set(data);
                context.putImageData(imageData, 0, 0);
            }
            previewCanvas.style.height = height + "px";
        }
        catch (e) {
            previewCanvas.width = width;
            previewCanvas.height = height;
            previewCanvas.style.height = height + "px";
        }
    }
    render() {
        const texture = this.props.texture;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "textureLine", children: [!this.props.hideChannelSelect && texture.isCube && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "control3D", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.face === 0 ? "px command selected" : "px command", onClick: () => this.setState({ face: 0 }), children: "+X" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.face === 1 ? "nx command selected" : "nx command", onClick: () => this.setState({ face: 1 }), children: "-X" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.face === 2 ? "py command selected" : "py command", onClick: () => this.setState({ face: 2 }), children: "+Y" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.face === 3 ? "ny command selected" : "ny command", onClick: () => this.setState({ face: 3 }), children: "-Y" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.face === 4 ? "pz command selected" : "pz command", onClick: () => this.setState({ face: 4 }), children: "+Z" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.face === 5 ? "nz command selected" : "nz command", onClick: () => this.setState({ face: 5 }), children: "-Z" })] })), !this.props.hideChannelSelect && !texture.isCube && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "control", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.channels === TextureLineComponent._TextureChannelStates.R ? "red command selected" : "red command", onClick: () => this.setState({ channels: TextureLineComponent._TextureChannelStates.R }), children: "R" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.channels === TextureLineComponent._TextureChannelStates.G ? "green command selected" : "green command", onClick: () => this.setState({ channels: TextureLineComponent._TextureChannelStates.G }), children: "G" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.channels === TextureLineComponent._TextureChannelStates.B ? "blue command selected" : "blue command", onClick: () => this.setState({ channels: TextureLineComponent._TextureChannelStates.B }), children: "B" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.channels === TextureLineComponent._TextureChannelStates.A ? "alpha command selected" : "alpha command", onClick: () => this.setState({ channels: TextureLineComponent._TextureChannelStates.A }), children: "A" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: this.state.channels === TextureLineComponent._TextureChannelStates.ALL ? "all command selected" : "all command", onClick: () => this.setState({ channels: TextureLineComponent._TextureChannelStates.ALL }), children: "ALL" })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("canvas", { ref: this._canvasRef, className: "preview" })] }), texture.isRenderTarget && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__.ButtonLineComponent, { label: "Refresh", onClick: () => {
                        this.updatePreview();
                    } }))] }));
    }
}
TextureLineComponent._TextureChannelStates = {
    R: { R: true, G: false, B: false, A: false },
    G: { R: false, G: true, B: false, A: false },
    B: { R: false, G: false, B: true, A: false },
    A: { R: false, G: false, B: false, A: true },
    ALL: { R: true, G: true, B: true, A: true },
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js":
/*!*******************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js ***!
  \*******************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1440483__) => {

"use strict";
__nested_webpack_require_1440483__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1440483__.d(__nested_webpack_exports__, {
/* harmony export */   TextureLinkLineComponent: () => (/* binding */ TextureLinkLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1440483__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1440483__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1440483__(/*! core/Materials/Textures/cubeTexture */ "core/Misc/observable");
/* harmony import */ var core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1440483__.n(core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1440483__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1440483__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1440483__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1440483__(/*! shared-ui-components/lines/fileButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js");










class TextureLinkLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        const material = this.props.material;
        const texture = this.props.texture;
        this.state = { isDebugSelected: material && material.reservedDataStore && material.reservedDataStore.debugTexture === texture };
    }
    componentDidMount() {
        if (!this.props.onDebugSelectionChangeObservable) {
            return;
        }
        this._onDebugSelectionChangeObserver = this.props.onDebugSelectionChangeObservable.add((line) => {
            if (line !== this) {
                this.setState({ isDebugSelected: false });
            }
        });
    }
    componentWillUnmount() {
        if (this.props.onDebugSelectionChangeObservable && this._onDebugSelectionChangeObserver) {
            this.props.onDebugSelectionChangeObservable.remove(this._onDebugSelectionChangeObserver);
        }
    }
    debugTexture() {
        if (this.props.customDebugAction) {
            const newState = !this.state.isDebugSelected;
            this.props.customDebugAction(newState);
            this.setState({ isDebugSelected: newState });
            if (this.props.onDebugSelectionChangeObservable) {
                this.props.onDebugSelectionChangeObservable.notifyObservers(this);
            }
            return;
        }
        const texture = this.props.texture;
        const material = this.props.material;
        if (!material || !texture) {
            return;
        }
        const scene = material.getScene();
        if (material.reservedDataStore && material.reservedDataStore.debugTexture === texture) {
            const debugMaterial = material.reservedDataStore.debugMaterial;
            texture.level = material.reservedDataStore.level;
            for (const mesh of scene.meshes) {
                if (mesh.material === debugMaterial) {
                    mesh.material = material;
                }
            }
            debugMaterial.dispose();
            material.reservedDataStore.debugTexture = null;
            material.reservedDataStore.debugMaterial = null;
            this.setState({ isDebugSelected: false });
            return;
        }
        let checkMaterial = material;
        let needToDisposeCheckMaterial = false;
        if (material.reservedDataStore && material.reservedDataStore.debugTexture) {
            checkMaterial = material.reservedDataStore.debugMaterial;
            needToDisposeCheckMaterial = true;
        }
        const debugMaterial = new core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_2__.StandardMaterial("debugMaterial", scene);
        debugMaterial.disableLighting = true;
        debugMaterial.sideOrientation = material.sideOrientation;
        debugMaterial.emissiveTexture = texture;
        debugMaterial.forceDepthWrite = true;
        debugMaterial.reservedDataStore = { hidden: true };
        for (const mesh of scene.meshes) {
            if (mesh.material === checkMaterial) {
                mesh.material = debugMaterial;
            }
        }
        if (!material.reservedDataStore) {
            material.reservedDataStore = {};
        }
        material.reservedDataStore.debugTexture = texture;
        material.reservedDataStore.debugMaterial = debugMaterial;
        material.reservedDataStore.level = texture.level;
        texture.level = 1.0;
        if (this.props.onDebugSelectionChangeObservable) {
            this.props.onDebugSelectionChangeObservable.notifyObservers(this);
        }
        if (needToDisposeCheckMaterial) {
            checkMaterial.dispose();
        }
        this.setState({ isDebugSelected: true });
    }
    onLink() {
        if (!this.props.onSelectionChangedObservable) {
            return;
        }
        const texture = this.props.texture;
        this.props.onSelectionChangedObservable.notifyObservers(texture);
    }
    updateTexture(file) {
        const material = this.props.material ?? this.props.texturedObject;
        if (!material) {
            return;
        }
        core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_2__.Tools.ReadFile(file, (data) => {
            const blob = new Blob([data], { type: "octet/stream" });
            const url = URL.createObjectURL(blob);
            const extension = file.name.split(".").pop()?.toLowerCase();
            const texture = this.props.cubeOnly
                ? new core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_2__.CubeTexture(url, material.getScene(), [], false, undefined, undefined, undefined, undefined, false, extension ? "." + extension : undefined)
                : new core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_2__.Texture(url, material.getScene(), false, false);
            if (this.props.propertyName) {
                material[this.props.propertyName] = texture;
            }
            else if (this.props.onTextureCreated) {
                this.props.onTextureCreated(texture);
            }
            this.forceUpdate();
        }, undefined, true);
    }
    removeTexture() {
        const material = this.props.material ?? this.props.texturedObject;
        if (!material) {
            return;
        }
        if (this.props.propertyName) {
            material[this.props.propertyName] = null;
        }
        else if (this.props.onTextureRemoved) {
            this.props.onTextureRemoved();
        }
        this.forceUpdate();
    }
    render() {
        const texture = this.props.texture;
        if (!texture) {
            if (this.props.propertyName || this.props.onTextureCreated) {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_5__.FileButtonLine, { label: `Add ${this.props.label} texture`, onClick: (file) => this.updateTexture(file), accept: this.props.fileFormats ?? ".jpg, .png, .tga, .dds, .env, .exr" }));
            }
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "textureLinkLine", children: [(!texture.isCube || this.props.cubeOnly) && (this.props.material || this.props.texturedObject) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: this.state.isDebugSelected ? "debug selected" : "debug", children: [this.props.material && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "actionIcon", onClick: () => this.debugTexture(), title: "Render as main texture", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faWrench }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "actionIcon", onClick: () => this.removeTexture(), title: "Remove texture", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faTrash }) })] }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: this.props.label, value: texture.name, onLink: () => this.onLink() })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/paneComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/paneComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1450328__) => {

"use strict";
__nested_webpack_require_1450328__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1450328__.d(__nested_webpack_exports__, {
/* harmony export */   PaneComponent: () => (/* binding */ PaneComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1450328__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1450328__(/*! react */ "../../../../node_modules/react/index.js");


class PaneComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "pane" });
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/debugTabComponent.js":
/*!***********************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/debugTabComponent.js ***!
  \***********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1451558__) => {

"use strict";
__nested_webpack_require_1451558__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1451558__.d(__nested_webpack_exports__, {
/* harmony export */   DebugTabComponent: () => (/* binding */ DebugTabComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1451558__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _paneComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1451558__(/*! ../paneComponent */ "../../../dev/inspector/dist/components/actionTabs/paneComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1451558__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1451558__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _propertyGrids_renderGridPropertyGridComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1451558__(/*! ./propertyGrids/renderGridPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/renderGridPropertyGridComponent.js");
/* harmony import */ var core_Debug_physicsViewer__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1451558__(/*! core/Debug/physicsViewer */ "core/Debug/physicsViewer");
/* harmony import */ var core_Debug_physicsViewer__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_1451558__.n(core_Debug_physicsViewer__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1451558__(/*! core/Physics/v2/physicsEngineComponent */ "core/Misc/observable");
/* harmony import */ var core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_1451558__.n(core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__);











class DebugTabComponent extends _paneComponent__WEBPACK_IMPORTED_MODULE_1__.PaneComponent {
    constructor(props) {
        super(props);
        this._physicsViewersEnabled = false;
        const scene = this.props.scene;
        if (!scene) {
            return;
        }
        if (!scene.reservedDataStore) {
            scene.reservedDataStore = {};
        }
        this._physicsViewersEnabled = scene.reservedDataStore.physicsViewer != null;
    }
    switchPhysicsViewers() {
        this._physicsViewersEnabled = !this._physicsViewersEnabled;
        const scene = this.props.scene;
        if (this._physicsViewersEnabled) {
            const physicsViewer = new core_Debug_physicsViewer__WEBPACK_IMPORTED_MODULE_5__.PhysicsViewer(scene);
            scene.reservedDataStore.physicsViewer = physicsViewer;
            for (const mesh of scene.meshes) {
                if (mesh.physicsImpostor) {
                    const debugMesh = physicsViewer.showImpostor(mesh.physicsImpostor, mesh);
                    if (debugMesh) {
                        debugMesh.reservedDataStore = { hidden: true };
                        debugMesh.material.reservedDataStore = { hidden: true };
                    }
                }
                else if (mesh.physicsBody) {
                    const debugMesh = physicsViewer.showBody(mesh.physicsBody);
                    if (debugMesh) {
                        debugMesh.reservedDataStore = { hidden: true };
                        debugMesh.material.reservedDataStore = { hidden: true };
                    }
                }
            }
            for (const transformNode of scene.transformNodes) {
                if (transformNode.physicsBody) {
                    const debugMesh = physicsViewer.showBody(transformNode.physicsBody);
                    if (debugMesh) {
                        debugMesh.reservedDataStore = { hidden: true };
                        debugMesh.material.reservedDataStore = { hidden: true };
                    }
                }
            }
        }
        else {
            scene.reservedDataStore.physicsViewer.dispose();
            scene.reservedDataStore.physicsViewer = null;
        }
    }
    render() {
        const scene = this.props.scene;
        if (!scene) {
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "HELPERS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_renderGridPropertyGridComponent__WEBPACK_IMPORTED_MODULE_4__.RenderGridPropertyGridComponent, { globalState: this.props.globalState, scene: scene }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Physics", isSelected: () => this._physicsViewersEnabled, onSelect: () => this.switchPhysicsViewers() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "CORE TEXTURE CHANNELS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Diffuse", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.DiffuseTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.DiffuseTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.DiffuseTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Ambient", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.AmbientTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.AmbientTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.AmbientTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Specular", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.SpecularTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.SpecularTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.SpecularTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Emissive", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.EmissiveTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.EmissiveTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.EmissiveTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Bump", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.BumpTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.BumpTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.BumpTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Opacity", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.OpacityTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.OpacityTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.OpacityTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Reflection", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.ReflectionTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.ReflectionTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.ReflectionTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Refraction", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.RefractionTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.RefractionTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.RefractionTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "ColorGrading", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.ColorGradingTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.ColorGradingTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.ColorGradingTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Lightmap", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.LightmapTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.LightmapTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.LightmapTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Fresnel", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.FresnelEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.FresnelEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.StandardMaterial.FresnelEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Detail", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.MaterialFlags.DetailTextureEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.MaterialFlags.DetailTextureEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.MaterialFlags.DetailTextureEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Decal", isSelected: () => core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.MaterialFlags.DecalMapEnabled, onSelect: () => (core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.MaterialFlags.DecalMapEnabled = !core_Materials_standardMaterial__WEBPACK_IMPORTED_MODULE_6__.MaterialFlags.DecalMapEnabled) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "FEATURES", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Animations", isSelected: () => scene.animationsEnabled, onSelect: () => (scene.animationsEnabled = !scene.animationsEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Physics", isSelected: () => scene.physicsEnabled, onSelect: () => (scene.physicsEnabled = !scene.physicsEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Collisions", isSelected: () => scene.collisionsEnabled, onSelect: () => (scene.collisionsEnabled = !scene.collisionsEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Fog", isSelected: () => scene.fogEnabled, onSelect: () => (scene.fogEnabled = !scene.fogEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Lens flares", isSelected: () => scene.lensFlaresEnabled, onSelect: () => (scene.lensFlaresEnabled = !scene.lensFlaresEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Lights", isSelected: () => scene.lightsEnabled, onSelect: () => (scene.lightsEnabled = !scene.lightsEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Particles", isSelected: () => scene.particlesEnabled, onSelect: () => (scene.particlesEnabled = !scene.particlesEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Post-processes", isSelected: () => scene.postProcessesEnabled, onSelect: () => (scene.postProcessesEnabled = !scene.postProcessesEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Probes", isSelected: () => scene.probesEnabled, onSelect: () => (scene.probesEnabled = !scene.probesEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Textures", isSelected: () => scene.texturesEnabled, onSelect: () => (scene.texturesEnabled = !scene.texturesEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Procedural textures", isSelected: () => scene.proceduralTexturesEnabled, onSelect: () => (scene.proceduralTexturesEnabled = !scene.proceduralTexturesEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Render targets", isSelected: () => scene.renderTargetsEnabled, onSelect: () => (scene.renderTargetsEnabled = !scene.renderTargetsEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Shadows", isSelected: () => scene.shadowsEnabled, onSelect: () => (scene.shadowsEnabled = !scene.shadowsEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Skeletons", isSelected: () => scene.skeletonsEnabled, onSelect: () => (scene.skeletonsEnabled = !scene.skeletonsEnabled) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Sprites", isSelected: () => scene.spritesEnabled, onSelect: () => (scene.spritesEnabled = !scene.spritesEnabled) })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/gradientNodePropertyComponent.js":
/*!***********************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/gradientNodePropertyComponent.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1468911__) => {

"use strict";
__nested_webpack_require_1468911__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1468911__.d(__nested_webpack_exports__, {
/* harmony export */   GradientPropertyTabComponent: () => (/* binding */ GradientPropertyTabComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1468911__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1468911__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Materials_Node_Blocks_gradientBlock__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1468911__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Materials_Node_Blocks_gradientBlock__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1468911__.n(core_Materials_Node_Blocks_gradientBlock__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _gradientStepComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1468911__(/*! ./gradientStepComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/gradientStepComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1468911__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");






class GradientPropertyTabComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._gradientBlock = this.props.block;
    }
    forceRebuild() {
        this._gradientBlock.colorStepsUpdated();
        this.forceUpdate();
    }
    deleteStep(step) {
        const index = this._gradientBlock.colorSteps.indexOf(step);
        if (index > -1) {
            this._gradientBlock.colorSteps.splice(index, 1);
            this.forceRebuild();
        }
    }
    copyStep(step) {
        const gradientBlock = this.props.block;
        const newStep = new core_Materials_Node_Blocks_gradientBlock__WEBPACK_IMPORTED_MODULE_2__.GradientBlockColorStep(1.0, step.color);
        gradientBlock.colorSteps.push(newStep);
        gradientBlock.colorStepsUpdated();
        this.forceRebuild();
        this.forceUpdate();
    }
    addNewStep() {
        const newStep = new core_Materials_Node_Blocks_gradientBlock__WEBPACK_IMPORTED_MODULE_2__.GradientBlockColorStep(1.0, core_Materials_Node_Blocks_gradientBlock__WEBPACK_IMPORTED_MODULE_2__.Color3.White());
        this._gradientBlock.colorSteps.push(newStep);
        this.forceRebuild();
    }
    checkForReOrder() {
        this._gradientBlock.colorSteps.sort((a, b) => {
            return a.step - b.step;
        });
        this.forceRebuild();
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__.ButtonLineComponent, { label: "Add new step", onClick: () => this.addNewStep() }), this._gradientBlock.colorSteps.map((c, i) => {
                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gradientStepComponent__WEBPACK_IMPORTED_MODULE_3__.GradientStepComponent, { globalState: this.props.globalState, onCheckForReOrder: () => this.checkForReOrder(), onUpdateStep: () => this.forceRebuild(), lineIndex: i, step: c, onCopy: () => this.copyStep(c), onDelete: () => this.deleteStep(c) }, "step-" + i));
                })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/gradientStepComponent.js":
/*!***************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/gradientStepComponent.js ***!
  \***************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1472947__) => {

"use strict";
__nested_webpack_require_1472947__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1472947__.d(__nested_webpack_exports__, {
/* harmony export */   GradientStepComponent: () => (/* binding */ GradientStepComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1472947__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1472947__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1472947__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1472947__.n(core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_colorPickerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1472947__(/*! shared-ui-components/lines/colorPickerComponent */ "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js");
/* harmony import */ var _lines_delete_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1472947__(/*! ../lines/delete.svg */ "../../../dev/inspector/dist/components/actionTabs/lines/delete.svg");
/* harmony import */ var shared_ui_components_imgs_copyStep_svg__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1472947__(/*! shared-ui-components/imgs/copyStep.svg */ "../../../dev/sharedUiComponents/dist/imgs/copyStep.svg");






class GradientStepComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { gradient: props.step.step };
    }
    updateColor(color) {
        this.props.step.color = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.FromHexString(color);
        this.props.onUpdateStep();
        this.forceUpdate();
    }
    updateStep(gradient) {
        this.props.step.step = gradient;
        this.setState({ gradient: gradient });
        this.props.onUpdateStep();
    }
    onPointerUp() {
        this.props.onCheckForReOrder();
    }
    render() {
        const step = this.props.step;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "gradient-step", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "step", children: `#${this.props.lineIndex}` }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorPickerComponent__WEBPACK_IMPORTED_MODULE_3__.ColorPickerLine, { lockObject: this.props.lockObject, value: step.color, onColorChanged: (color) => {
                            this.updateColor(color);
                        } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "step-value", children: step.step.toFixed(2) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "step-slider slider", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { className: "range", type: "range", step: 0.01, min: 0, max: 1.0, value: step.step, onPointerUp: () => this.onPointerUp(), onChange: (evt) => this.updateStep(parseFloat(evt.target.value)) }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "gradient-copy", onClick: () => {
                        if (this.props.onCopy)
                            this.props.onCopy();
                    }, title: "Copy Step", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "img", src: shared_ui_components_imgs_copyStep_svg__WEBPACK_IMPORTED_MODULE_4__ }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "gradient-delete", onClick: () => this.props.onDelete(), title: "Delete Step", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "img", src: _lines_delete_svg__WEBPACK_IMPORTED_MODULE_5__ }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performancePlayheadButtonComponent.js":
/*!**********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performancePlayheadButtonComponent.js ***!
  \**********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1477629__) => {

"use strict";
__nested_webpack_require_1477629__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1477629__.d(__nested_webpack_exports__, {
/* harmony export */   PerformancePlayheadButtonComponent: () => (/* binding */ PerformancePlayheadButtonComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1477629__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");

const PerformancePlayheadButtonComponent = ({ returnToPlayhead }) => {
    const onReturnToPlayheadClick = () => {
        returnToPlayhead.notifyObservers();
    };
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "performancePlayheadButton", onClick: onReturnToPlayheadClick, title: "Return to Playhead", children: "Return" }));
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performanceViewerComponent.js":
/*!**************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performanceViewerComponent.js ***!
  \**************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1478992__) => {

"use strict";
__nested_webpack_require_1478992__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1478992__.d(__nested_webpack_exports__, {
/* harmony export */   IPerfMetadataCategory: () => (/* binding */ IPerfMetadataCategory),
/* harmony export */   PerformanceViewerComponent: () => (/* binding */ PerformanceViewerComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1478992__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1478992__(/*! core/Misc/pressureObserverWrapper */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1478992__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1478992__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1478992__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1478992__(/*! shared-ui-components/lines/fileButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1478992__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _inspector__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1478992__(/*! ../../../../inspector */ "../../../dev/inspector/dist/inspector.js");
/* harmony import */ var _performanceViewerPopupComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1478992__(/*! ./performanceViewerPopupComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performanceViewerPopupComponent.js");
/* harmony import */ var _scss_performanceViewer_scss__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1478992__(/*! ./scss/performanceViewer.scss */ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/scss/performanceViewer.scss");













// arbitrary window size
const initialWindowSize = { width: 1024, height: 512 };
const initialGraphSize = { width: 724, height: 512 };
var IPerfMetadataCategory;
(function (IPerfMetadataCategory) {
    IPerfMetadataCategory["Count"] = "Count";
    IPerfMetadataCategory["FrameSteps"] = "Frame Steps Duration";
})(IPerfMetadataCategory || (IPerfMetadataCategory = {}));
// list of strategies to add to perf graph automatically.
const defaultStrategiesList = [
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.FpsStrategy() },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.TotalMeshesStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.ActiveMeshesStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.ActiveIndicesStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.ActiveBonesStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.ActiveParticlesStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.DrawCallsStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.TotalLightsStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.TotalVerticesStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.TotalMaterialsStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.TotalTexturesStrategy(), category: IPerfMetadataCategory.Count, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.AbsoluteFpsStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.MeshesSelectionStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.RenderTargetsStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.ParticlesStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.SpritesStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.AnimationsStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.PhysicsStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.RenderStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.FrameTotalStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.InterFrameStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
    { strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.GpuFrameTimeStrategy(), category: IPerfMetadataCategory.FrameSteps, hidden: true },
];
const PerformanceViewerComponent = (props) => {
    const { scene } = props;
    const [isOpen, setIsOpen] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const [isLoadedFromCsv, setIsLoadedFromCsv] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const [performanceCollector, setPerformanceCollector] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)();
    const [layoutObservable] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable());
    const [returnToLiveObservable] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable());
    // do cleanup when the window is closed
    const onClosePerformanceViewer = (window) => {
        if (window) {
            window.close();
        }
        setIsLoadedFromCsv(false);
        setIsOpen(false);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
        if (!isLoadedFromCsv) {
            if (performanceCollector) {
                performanceCollector.stop();
                performanceCollector.clear(false);
                addStrategies(performanceCollector);
            }
        }
    }, [isLoadedFromCsv]);
    const startPerformanceViewerPopup = () => {
        if (performanceCollector) {
            _inspector__WEBPACK_IMPORTED_MODULE_6__.Inspector._CreatePersistentPopup({
                props: {
                    id: "performance-viewer",
                    title: "Realtime Performance Viewer",
                    onClose: onClosePerformanceViewer,
                    onResize: onResize,
                    size: initialWindowSize,
                },
                children: ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_performanceViewerPopupComponent__WEBPACK_IMPORTED_MODULE_7__.PerformanceViewerPopupComponent, { scene: scene, layoutObservable: layoutObservable, returnToLiveObservable: returnToLiveObservable, performanceCollector: performanceCollector, initialGraphSize: initialGraphSize })),
            }, document.body);
        }
    };
    const onPerformanceButtonClick = () => {
        setIsOpen(true);
        performanceCollector?.start(true);
        startPerformanceViewerPopup();
    };
    const onLoadClick = (file) => {
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Tools.ReadFile(file, (data) => {
            // reopen window and load data!
            setIsOpen(false);
            setIsLoadedFromCsv(true);
            performanceCollector?.stop();
            const isValid = performanceCollector?.loadFromFileData(data);
            if (!isValid) {
                // if our data isnt valid we close the window.
                setIsOpen(false);
                performanceCollector?.start(true);
            }
            else {
                startPerformanceViewerPopup();
            }
        });
    };
    const onExportClick = () => {
        performanceCollector?.exportDataToCsv();
    };
    const onResize = (window) => {
        const width = window?.innerWidth ?? 0;
        const height = window?.innerHeight ?? 0;
        layoutObservable.notifyObservers({ width, height });
    };
    const onToggleRecording = () => {
        if (!performanceCollector?.isStarted) {
            performanceCollector?.start(true);
        }
        else {
            performanceCollector?.stop();
        }
    };
    const addStrategies = (perfCollector) => {
        perfCollector.addCollectionStrategies(...defaultStrategiesList);
        if (core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PressureObserverWrapper.IsAvailable) {
            // Do not enable for now as the Pressure API does not
            // report factors at the moment.
            // perfCollector.addCollectionStrategies({
            //     strategyCallback: PerfCollectionStrategy.ThermalStrategy(),
            //     category: IPerfMetadataCategory.FrameSteps,
            //     hidden: true,
            // });
            // perfCollector.addCollectionStrategies({
            //     strategyCallback: PerfCollectionStrategy.PowerSupplyStrategy(),
            //     category: IPerfMetadataCategory.FrameSteps,
            //     hidden: true,
            // });
            perfCollector.addCollectionStrategies({
                strategyCallback: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PerfCollectionStrategy.PressureStrategy(),
                category: IPerfMetadataCategory.FrameSteps,
                hidden: true,
            });
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
        const perfCollector = scene.getPerfCollector();
        addStrategies(perfCollector);
        setPerformanceCollector(perfCollector);
    }, []);
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_5__.LineContainerComponent, { title: "Performance Viewer", children: [!isOpen && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Open Realtime Perf Viewer", onClick: onPerformanceButtonClick }), !isOpen && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_4__.FileButtonLine, { accept: "csv", label: "Load Perf Viewer using CSV", onClick: onLoadClick }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Export Perf to CSV", onClick: onExportClick }), !isOpen && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: performanceCollector?.isStarted ? "Stop Recording" : "Begin Recording", onClick: onToggleRecording })] }));
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performanceViewerPopupComponent.js":
/*!*******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performanceViewerPopupComponent.js ***!
  \*******************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1492254__) => {

"use strict";
__nested_webpack_require_1492254__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1492254__.d(__nested_webpack_exports__, {
/* harmony export */   PerformanceViewerPopupComponent: () => (/* binding */ PerformanceViewerPopupComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1492254__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1492254__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1492254__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1492254__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _performanceViewerSidebarComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1492254__(/*! ./performanceViewerSidebarComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performanceViewerSidebarComponent.js");
/* harmony import */ var _performancePlayheadButtonComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1492254__(/*! ./performancePlayheadButtonComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performancePlayheadButtonComponent.js");
/* harmony import */ var _graph_canvasGraphComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1492254__(/*! ../../../graph/canvasGraphComponent */ "../../../dev/inspector/dist/components/graph/canvasGraphComponent.js");






const PerformanceViewerPopupComponent = (props) => {
    const { scene, layoutObservable, returnToLiveObservable, performanceCollector, initialGraphSize } = props;
    const [onVisibleRangeChangedObservable] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable());
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "performance-viewer", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_performancePlayheadButtonComponent__WEBPACK_IMPORTED_MODULE_4__.PerformancePlayheadButtonComponent, { returnToPlayhead: returnToLiveObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_performanceViewerSidebarComponent__WEBPACK_IMPORTED_MODULE_3__.PerformanceViewerSidebarComponent, { collector: performanceCollector, onVisibleRangeChangedObservable: onVisibleRangeChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_graph_canvasGraphComponent__WEBPACK_IMPORTED_MODULE_5__.CanvasGraphComponent, { id: "performance-viewer-graph", returnToPlayheadObservable: returnToLiveObservable, layoutObservable: layoutObservable, scene: scene, collector: performanceCollector, onVisibleRangeChangedObservable: onVisibleRangeChangedObservable, initialGraphSize: initialGraphSize })] }));
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performanceViewerSidebarComponent.js":
/*!*********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performanceViewerSidebarComponent.js ***!
  \*********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1495807__) => {

"use strict";
__nested_webpack_require_1495807__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1495807__.d(__nested_webpack_exports__, {
/* harmony export */   PerformanceViewerSidebarComponent: () => (/* binding */ PerformanceViewerSidebarComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1495807__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1495807__(/*! core/Engines/engine */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1495807__.n(core_Maths_math_color__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1495807__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_colorPickerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1495807__(/*! shared-ui-components/lines/colorPickerComponent */ "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1495807__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1495807__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");







const PerformanceViewerSidebarComponent = (props) => {
    const { collector, onVisibleRangeChangedObservable } = props;
    // Map from id to IPerfMetadata information
    const [metadataMap, setMetadataMap] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)();
    // Map from category to all the ids belonging to that category
    const [metadataCategoryId, setMetadataCategoryId] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)();
    // Count how many elements are checked for that category
    const [metadataCategoryChecked, setMetadataCategoryChecked] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)();
    // List of ordered categories
    const [metadataCategories, setMetadataCategories] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)();
    // Min/Max/Current values of the ids
    const [valueMap, setValueMap] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)();
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
        if (!onVisibleRangeChangedObservable) {
            return;
        }
        const observer = (props) => {
            setValueMap(props.valueMap);
        };
        onVisibleRangeChangedObservable.add(observer);
        return () => {
            onVisibleRangeChangedObservable.removeCallback(observer);
        };
    }, [onVisibleRangeChangedObservable]);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
        const onUpdateMetadata = (metadata) => {
            const newCategoryIdMap = new Map();
            const newCategoryCheckedMap = new Map();
            metadata.forEach((value, id) => {
                const currentCategory = value.category ?? "";
                const currentIds = newCategoryIdMap.get(currentCategory) ?? [];
                let currentChecked = newCategoryCheckedMap.get(currentCategory) ?? 0;
                currentIds.push(id);
                newCategoryIdMap.set(currentCategory, currentIds);
                if (!value.hidden) {
                    currentChecked += 1;
                }
                newCategoryCheckedMap.set(currentCategory, currentChecked);
            });
            const orderedCategories = Array.from(newCategoryIdMap.keys());
            orderedCategories.sort();
            setMetadataCategoryId(newCategoryIdMap);
            setMetadataCategoryChecked(newCategoryCheckedMap);
            setMetadataMap(metadata);
            setMetadataCategories(orderedCategories);
        };
        collector.metadataObservable.add(onUpdateMetadata);
        return () => {
            collector.metadataObservable.removeCallback(onUpdateMetadata);
        };
    }, []);
    const onCheckChange = (id) => (selected) => {
        collector.updateMetadata(id, "hidden", !selected);
    };
    const onCheckAllChange = (category) => (selected) => {
        const categoryIds = metadataCategoryId?.get(category);
        categoryIds?.forEach((id) => {
            collector.updateMetadata(id, "hidden", !selected);
        });
    };
    const onColorChange = (id) => (color) => {
        collector.updateMetadata(id, "color", color);
    };
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "performance-viewer-sidebar", children: metadataCategories &&
            metadataCategories.map((category) => ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [category ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "category-header header sidebar-item", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "category", children: category }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { isSelected: () => metadataCategoryChecked?.get(category) === metadataCategoryId?.get(category)?.length, onSelect: onCheckAllChange(category), faIcons: { enabled: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faCheckSquare, disabled: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faSquare } })] }, `header-${category}`)) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "version-header sidebar-item", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "category", children: "Version:" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "value", children: core_Maths_math_color__WEBPACK_IMPORTED_MODULE_1__.Engine.Version })] }, "header-version")), metadataCategoryId?.get(category)?.map((id) => {
                        const metadata = metadataMap?.get(id);
                        const range = valueMap?.get(id);
                        return (metadata && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "sidebar-item measure", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "category", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { isSelected: () => !metadata.hidden, onSelect: onCheckChange(id), faIcons: { enabled: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faCheckSquare, disabled: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faSquare } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorPickerComponent__WEBPACK_IMPORTED_MODULE_3__.ColorPickerLine, { value: core_Maths_math_color__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(metadata.color ?? "#000"), onColorChanged: onColorChange(id), shouldPopRight: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "sidebar-item-label", children: id })] }), range && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "value", children: [" ", ((range.min + range.max) / 2).toFixed(2), " "] })] }, `perf-sidebar-item-${id}`)));
                    })] }, `category-${category || "version"}`))) }));
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGridTabComponent.js":
/*!******************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGridTabComponent.js ***!
  \******************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1503968__) => {

"use strict";
__nested_webpack_require_1503968__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1503968__.d(__nested_webpack_exports__, {
/* harmony export */   PropertyGridTabComponent: () => (/* binding */ PropertyGridTabComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1503968__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _paneComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1503968__(/*! ../paneComponent */ "../../../dev/inspector/dist/components/actionTabs/paneComponent.js");
/* harmony import */ var _propertyGrids_materials_materialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/materialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/materialPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_materials_standardMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/standardMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/standardMaterialPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_materials_texturePropertyGridComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/texturePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/texturePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_materials_pbrMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/pbrMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/pbrMaterialPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_scenePropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/scenePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/scenePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_lights_hemisphericLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/lights/hemisphericLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/hemisphericLightPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_lights_pointLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/lights/pointLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/pointLightPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_cameras_freeCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/cameras/freeCameraPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/freeCameraPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_cameras_arcRotateCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/cameras/arcRotateCameraPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/arcRotateCameraPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_meshes_meshPropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/meshes/meshPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_meshes_transformNodePropertyGridComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/meshes/transformNodePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/transformNodePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_materials_backgroundMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/backgroundMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/backgroundMaterialPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_controlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/controlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/controlPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_textBlockPropertyGridComponent__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/textBlockPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_inputTextPropertyGridComponent__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/inputTextPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_colorPickerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/colorPickerPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_animations_animationGroupPropertyGridComponent__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/animations/animationGroupPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationGroupPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/lockObject */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_imagePropertyGridComponent__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/imagePropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/imagePropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_sliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_21__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/sliderPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/sliderPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_imageBasedSliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_22__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_rectanglePropertyGridComponent__WEBPACK_IMPORTED_MODULE_23__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/rectanglePropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_ellipsePropertyGridComponent__WEBPACK_IMPORTED_MODULE_24__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/ellipsePropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_checkboxPropertyGridComponent__WEBPACK_IMPORTED_MODULE_25__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/checkboxPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_radioButtonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_26__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/radioButtonPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_linePropertyGridComponent__WEBPACK_IMPORTED_MODULE_27__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/linePropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/linePropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_scrollViewerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_28__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_gridPropertyGridComponent__WEBPACK_IMPORTED_MODULE_29__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/gridPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/gridPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_materials_pbrMetallicRoughnessMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_30__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/pbrMetallicRoughnessMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/pbrMetallicRoughnessMaterialPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_materials_pbrSpecularGlossinessMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_31__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/pbrSpecularGlossinessMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/pbrSpecularGlossinessMaterialPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_gui_stackPanelPropertyGridComponent__WEBPACK_IMPORTED_MODULE_32__ = __nested_webpack_require_1503968__(/*! shared-ui-components/tabs/propertyGrids/gui/stackPanelPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_postProcesses_postProcessPropertyGridComponent__WEBPACK_IMPORTED_MODULE_33__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/postProcesses/postProcessPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/postProcessPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_postProcesses_renderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_34__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/postProcesses/renderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/renderingPipelinePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_postProcesses_defaultRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_35__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/postProcesses/defaultRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/defaultRenderingPipelinePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_postProcesses_ssaoRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_36__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/postProcesses/ssaoRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/ssaoRenderingPipelinePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_postProcesses_ssao2RenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_37__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/postProcesses/ssao2RenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/ssao2RenderingPipelinePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_postProcesses_iblShadowsRenderPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_38__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/postProcesses/iblShadowsRenderPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/iblShadowsRenderPipelinePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_postProcesses_ssrRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_39__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/postProcesses/ssrRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/ssrRenderingPipelinePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_meshes_skeletonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_40__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/meshes/skeletonPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/skeletonPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_meshes_bonePropertyGridComponent__WEBPACK_IMPORTED_MODULE_41__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/meshes/bonePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/bonePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_lights_directionalLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_42__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/lights/directionalLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/directionalLightPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_lights_spotLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_43__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/lights/spotLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/spotLightPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_postProcesses_lensRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_44__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/postProcesses/lensRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/lensRenderingPipelinePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_materials_nodeMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_45__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/nodeMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/nodeMaterialPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_materials_multiMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_46__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/multiMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/multiMaterialPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_particleSystems_particleSystemPropertyGridComponent__WEBPACK_IMPORTED_MODULE_47__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/particleSystems/particleSystemPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/particleSystemPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_sprites_spriteManagerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_48__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/sprites/spriteManagerPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/sprites/spriteManagerPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_sprites_spritePropertyGridComponent__WEBPACK_IMPORTED_MODULE_49__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/sprites/spritePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/sprites/spritePropertyGridComponent.js");
/* harmony import */ var _propertyGrids_animations_targetedAnimationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_50__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/animations/targetedAnimationPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/targetedAnimationPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_cameras_followCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_51__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/cameras/followCameraPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/followCameraPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_sounds_soundPropertyGridComponent__WEBPACK_IMPORTED_MODULE_52__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/sounds/soundPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/sounds/soundPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_layers_layerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_53__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/layers/layerPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/layers/layerPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_emptyPropertyGridComponent__WEBPACK_IMPORTED_MODULE_54__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/emptyPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/emptyPropertyGridComponent.js");
/* harmony import */ var inspector_components_actionTabs_tabs_propertyGrids_metadata_metadataPropertyGridComponent__WEBPACK_IMPORTED_MODULE_55__ = __nested_webpack_require_1503968__(/*! inspector/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGridComponent.js");
/* harmony import */ var _propertyGrids_materials_skyMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_56__ = __nested_webpack_require_1503968__(/*! ./propertyGrids/materials/skyMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/skyMaterialPropertyGridComponent.js");
/* harmony import */ var core_Misc_tags__WEBPACK_IMPORTED_MODULE_57__ = __nested_webpack_require_1503968__(/*! core/Misc/tags */ "core/Misc/observable");
/* harmony import */ var core_Misc_tags__WEBPACK_IMPORTED_MODULE_57___default = /*#__PURE__*/__nested_webpack_require_1503968__.n(core_Misc_tags__WEBPACK_IMPORTED_MODULE_57__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_58__ = __nested_webpack_require_1503968__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");



























































/**
 *
 */
class PropertyGridTabComponent extends _paneComponent__WEBPACK_IMPORTED_MODULE_1__.PaneComponent {
    constructor(props) {
        super(props);
        this._lockObject = new shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_19__.LockObject();
    }
    timerRefresh() {
        if (!this._lockObject.lock) {
            this.forceUpdate();
        }
    }
    componentDidMount() {
        this._timerIntervalId = window.setInterval(() => this.timerRefresh(), 500);
    }
    componentWillUnmount() {
        window.clearInterval(this._timerIntervalId);
    }
    renderContent() {
        const entity = this.props.selectedEntity;
        if (!entity) {
            return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "infoMessage", children: "Please select an entity in the scene explorer." });
        }
        if (entity.getClassName) {
            const className = entity.getClassName();
            if (className === "Scene") {
                const scene = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_scenePropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__.ScenePropertyGridComponent, { scene: scene, globalState: this.props.globalState, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "Sound") {
                const sound = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_sounds_soundPropertyGridComponent__WEBPACK_IMPORTED_MODULE_52__.SoundPropertyGridComponent, { sound: sound, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "Sprite") {
                const sprite = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_sprites_spritePropertyGridComponent__WEBPACK_IMPORTED_MODULE_49__.SpritePropertyGridComponent, { sprite: sprite, globalState: this.props.globalState, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "SpriteManager") {
                const spriteManager = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_sprites_spriteManagerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_48__.SpriteManagerPropertyGridComponent, { spriteManager: spriteManager, globalState: this.props.globalState, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("Mesh") !== -1) {
                const mesh = entity;
                if (mesh.getTotalVertices() > 0) {
                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_meshes_meshPropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__.MeshPropertyGridComponent, { globalState: this.props.globalState, mesh: mesh, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }) }));
                }
            }
            if (className.indexOf("ParticleSystem") !== -1) {
                const particleSystem = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_particleSystems_particleSystemPropertyGridComponent__WEBPACK_IMPORTED_MODULE_47__.ParticleSystemPropertyGridComponent, { globalState: this.props.globalState, system: particleSystem, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("FreeCamera") !== -1 ||
                className.indexOf("UniversalCamera") !== -1 ||
                className.indexOf("WebXRCamera") !== -1 ||
                className.indexOf("DeviceOrientationCamera") !== -1) {
                const freeCamera = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_cameras_freeCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_9__.FreeCameraPropertyGridComponent, { globalState: this.props.globalState, camera: freeCamera, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("ArcRotateCamera") !== -1) {
                const arcRotateCamera = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_cameras_arcRotateCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__.ArcRotateCameraPropertyGridComponent, { globalState: this.props.globalState, camera: arcRotateCamera, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("FollowCamera") !== -1) {
                const followCamera = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_cameras_followCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_51__.FollowCameraPropertyGridComponent, { globalState: this.props.globalState, camera: followCamera, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "HemisphericLight") {
                const hemisphericLight = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_lights_hemisphericLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__.HemisphericLightPropertyGridComponent, { globalState: this.props.globalState, light: hemisphericLight, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "PointLight") {
                const pointLight = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_lights_pointLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__.PointLightPropertyGridComponent, { globalState: this.props.globalState, light: pointLight, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "DirectionalLight") {
                const pointLight = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_lights_directionalLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_42__.DirectionalLightPropertyGridComponent, { globalState: this.props.globalState, light: pointLight, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "SpotLight") {
                const pointLight = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_lights_spotLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_43__.SpotLightPropertyGridComponent, { globalState: this.props.globalState, light: pointLight, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("TransformNode") !== -1 || className.indexOf("Mesh") !== -1) {
                const transformNode = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_meshes_transformNodePropertyGridComponent__WEBPACK_IMPORTED_MODULE_12__.TransformNodePropertyGridComponent, { transformNode: transformNode, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "MultiMaterial") {
                const material = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_multiMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_46__.MultiMaterialPropertyGridComponent, { globalState: this.props.globalState, material: material, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "StandardMaterial") {
                const material = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_standardMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_3__.StandardMaterialPropertyGridComponent, { globalState: this.props.globalState, material: material, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "NodeMaterial") {
                const material = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_nodeMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_45__.NodeMaterialPropertyGridComponent, { globalState: this.props.globalState, material: material, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "PBRMaterial") {
                const material = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_pbrMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__.PBRMaterialPropertyGridComponent, { globalState: this.props.globalState, material: material, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "PBRMetallicRoughnessMaterial") {
                const material = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_pbrMetallicRoughnessMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_30__.PBRMetallicRoughnessMaterialPropertyGridComponent, { globalState: this.props.globalState, material: material, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "PBRSpecularGlossinessMaterial") {
                const material = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_pbrSpecularGlossinessMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_31__.PBRSpecularGlossinessMaterialPropertyGridComponent, { globalState: this.props.globalState, material: material, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "SkyMaterial") {
                const material = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_skyMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_56__.SkyMaterialPropertyGridComponent, { globalState: this.props.globalState, material: material, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "BackgroundMaterial") {
                const material = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_backgroundMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__.BackgroundMaterialPropertyGridComponent, { globalState: this.props.globalState, material: material, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "AnimationGroup") {
                const animationGroup = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_animations_animationGroupPropertyGridComponent__WEBPACK_IMPORTED_MODULE_18__.AnimationGroupGridComponent, { globalState: this.props.globalState, animationGroup: animationGroup, scene: this.props.scene, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "TargetedAnimation") {
                const targetedAnimation = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_animations_targetedAnimationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_50__.TargetedAnimationGridComponent, { globalState: this.props.globalState, targetedAnimation: targetedAnimation, scene: this.props.scene, lockObject: this._lockObject, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("Material") !== -1) {
                const material = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_materialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.MaterialPropertyGridComponent, { material: material, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("DefaultRenderingPipeline") !== -1) {
                const renderPipeline = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_postProcesses_defaultRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_35__.DefaultRenderingPipelinePropertyGridComponent, { renderPipeline: renderPipeline, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("LensRenderingPipeline") !== -1) {
                const renderPipeline = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_postProcesses_lensRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_44__.LensRenderingPipelinePropertyGridComponent, { renderPipeline: renderPipeline, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("SSAORenderingPipeline") !== -1) {
                const renderPipeline = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_postProcesses_ssaoRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_36__.SSAORenderingPipelinePropertyGridComponent, { renderPipeline: renderPipeline, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("SSAO2RenderingPipeline") !== -1) {
                const renderPipeline = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_postProcesses_ssao2RenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_37__.SSAO2RenderingPipelinePropertyGridComponent, { renderPipeline: renderPipeline, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("SSRRenderingPipeline") !== -1) {
                const renderPipeline = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_postProcesses_ssrRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_39__.SSRRenderingPipelinePropertyGridComponent, { renderPipeline: renderPipeline, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("IBLShadowsRenderPipeline") !== -1) {
                const renderPipeline = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_postProcesses_iblShadowsRenderPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_38__.IblShadowsRenderPipelinePropertyGridComponent, { renderPipeline: renderPipeline, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("RenderingPipeline") !== -1) {
                const renderPipeline = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_postProcesses_renderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_34__.RenderingPipelinePropertyGridComponent, { renderPipeline: renderPipeline, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("PostProcess") !== -1) {
                const postProcess = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_postProcesses_postProcessPropertyGridComponent__WEBPACK_IMPORTED_MODULE_33__.PostProcessPropertyGridComponent, { postProcess: postProcess, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("Layer") !== -1) {
                const layer = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_layers_layerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_53__.LayerPropertyGridComponent, { layer: layer, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("Texture") !== -1) {
                const texture = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_materials_texturePropertyGridComponent__WEBPACK_IMPORTED_MODULE_4__.TexturePropertyGridComponent, { texture: texture, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("Skeleton") !== -1) {
                const skeleton = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_meshes_skeletonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_40__.SkeletonPropertyGridComponent, { skeleton: skeleton, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className.indexOf("Bone") !== -1) {
                const bone = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_meshes_bonePropertyGridComponent__WEBPACK_IMPORTED_MODULE_41__.BonePropertyGridComponent, { bone: bone, globalState: this.props.globalState, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "TextBlock") {
                const textBlock = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_textBlockPropertyGridComponent__WEBPACK_IMPORTED_MODULE_15__.TextBlockPropertyGridComponent, { textBlock: textBlock, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            if (className === "InputText") {
                const inputText = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_inputTextPropertyGridComponent__WEBPACK_IMPORTED_MODULE_16__.InputTextPropertyGridComponent, { inputText: inputText, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            if (className === "ColorPicker") {
                const colorPicker = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_colorPickerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_17__.ColorPickerPropertyGridComponent, { colorPicker: colorPicker, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "Image") {
                const image = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_imagePropertyGridComponent__WEBPACK_IMPORTED_MODULE_20__.ImagePropertyGridComponent, { image: image, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            if (className === "Slider") {
                const slider = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_sliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_21__.SliderPropertyGridComponent, { slider: slider, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            if (className === "ImageBasedSlider") {
                const imageBasedSlider = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_imageBasedSliderPropertyGridComponent__WEBPACK_IMPORTED_MODULE_22__.ImageBasedSliderPropertyGridComponent, { imageBasedSlider: imageBasedSlider, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "Rectangle") {
                const rectangle = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_rectanglePropertyGridComponent__WEBPACK_IMPORTED_MODULE_23__.RectanglePropertyGridComponent, { rectangle: rectangle, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            if (className === "StackPanel") {
                const stackPanel = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_stackPanelPropertyGridComponent__WEBPACK_IMPORTED_MODULE_32__.StackPanelPropertyGridComponent, { stackPanel: stackPanel, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "Grid") {
                const grid = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_gridPropertyGridComponent__WEBPACK_IMPORTED_MODULE_29__.GridPropertyGridComponent, { grid: grid, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            if (className === "ScrollViewer") {
                const scrollViewer = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_scrollViewerPropertyGridComponent__WEBPACK_IMPORTED_MODULE_28__.ScrollViewerPropertyGridComponent, { scrollViewer: scrollViewer, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "Ellipse") {
                const ellipse = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_ellipsePropertyGridComponent__WEBPACK_IMPORTED_MODULE_24__.EllipsePropertyGridComponent, { ellipse: ellipse, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            if (className === "Checkbox") {
                const checkbox = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_checkboxPropertyGridComponent__WEBPACK_IMPORTED_MODULE_25__.CheckboxPropertyGridComponent, { checkbox: checkbox, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            if (className === "RadioButton") {
                const radioButton = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_radioButtonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_26__.RadioButtonPropertyGridComponent, { radioButtons: [radioButton], lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            }
            if (className === "Line") {
                const line = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_linePropertyGridComponent__WEBPACK_IMPORTED_MODULE_27__.LinePropertyGridComponent, { line: line, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            if (entity._host) {
                const control = entity;
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_tabs_propertyGrids_gui_controlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_14__.ControlPropertyGridComponent, { control: control, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
            }
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertyGrids_emptyPropertyGridComponent__WEBPACK_IMPORTED_MODULE_54__.EmptyPropertyGridComponent, { item: entity, lockObject: this._lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable, globalState: this.props.globalState }));
        }
        return null;
    }
    renderTags() {
        const tags = Object.keys(core_Misc_tags__WEBPACK_IMPORTED_MODULE_57__.Tags.GetTags(this.props.selectedEntity, false));
        return tags.map((tag, i) => {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "tag", children: tag }, "tag" + i));
        });
    }
    render() {
        const entity = this.props.selectedEntity || {};
        const entityHasMetadataProp = Object.prototype.hasOwnProperty.call(entity, "metadata");
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [this.renderContent(), core_Misc_tags__WEBPACK_IMPORTED_MODULE_57__.Tags.HasTags(entity) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_58__.LineContainerComponent, { title: "TAGS", selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "tagContainer", children: this.renderTags() }) })), entityHasMetadataProp && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(inspector_components_actionTabs_tabs_propertyGrids_metadata_metadataPropertyGridComponent__WEBPACK_IMPORTED_MODULE_55__.MetadataGridComponent, { globalState: this.props.globalState, entity: entity })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationGroupPropertyGridComponent.js":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationGroupPropertyGridComponent.js ***!
  \******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1552373__) => {

"use strict";
__nested_webpack_require_1552373__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1552373__.d(__nested_webpack_exports__, {
/* harmony export */   AnimationGroupGridComponent: () => (/* binding */ AnimationGroupGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1552373__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1552373__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1552373__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1552373__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1552373__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1552373__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1552373__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _curveEditor_context__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1552373__(/*! ./curveEditor/context */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.js");
/* harmony import */ var _curveEditor_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1552373__(/*! ./curveEditor/animationCurveEditorComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/animationCurveEditorComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1552373__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1552373__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");











class AnimationGroupGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        const animationGroup = this.props.animationGroup;
        this.state = { playButtonText: animationGroup.isPlaying ? "Pause" : "Play", currentFrame: 0 };
        this._timelineRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    componentDidMount() {
        this.connect(this.props.animationGroup);
        this._onBeforeRenderObserver = this.props.scene.onBeforeRenderObservable.add(() => {
            this.updateCurrentFrame(this.props.animationGroup);
        });
    }
    disconnect(animationGroup) {
        if (this._onAnimationGroupPlayObserver) {
            animationGroup.onAnimationGroupPlayObservable.remove(this._onAnimationGroupPlayObserver);
            this._onAnimationGroupPlayObserver = null;
        }
        if (this._onAnimationGroupPauseObserver) {
            animationGroup.onAnimationGroupPauseObservable.remove(this._onAnimationGroupPauseObserver);
            this._onAnimationGroupPauseObserver = null;
        }
    }
    connect(animationGroup) {
        this._onAnimationGroupPlayObserver = animationGroup.onAnimationGroupPlayObservable.add(() => {
            this.forceUpdate();
        });
        this._onAnimationGroupPauseObserver = animationGroup.onAnimationGroupPauseObservable.add(() => {
            this.forceUpdate();
        });
        this.updateCurrentFrame(animationGroup);
    }
    updateCurrentFrame(animationGroup) {
        const targetedAnimations = animationGroup.targetedAnimations;
        if (targetedAnimations.length > 0) {
            const runtimeAnimation = targetedAnimations[0].animation.runtimeAnimations.find((rA) => rA.target === targetedAnimations[0].target);
            if (runtimeAnimation) {
                this.setState({ currentFrame: runtimeAnimation.currentFrame });
            }
            else {
                this.setState({ currentFrame: 0 });
            }
        }
    }
    shouldComponentUpdate(nextProps) {
        if (this.props.animationGroup !== nextProps.animationGroup) {
            this.disconnect(this.props.animationGroup);
            this.connect(nextProps.animationGroup);
        }
        return true;
    }
    componentWillUnmount() {
        this.disconnect(this.props.animationGroup);
        if (this._onBeforeRenderObserver) {
            this.props.scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
            this._onBeforeRenderObserver = null;
        }
    }
    playOrPause() {
        const animationGroup = this.props.animationGroup;
        if (animationGroup.isPlaying) {
            this.setState({ playButtonText: "Play" });
            animationGroup.pause();
        }
        else {
            this.setState({ playButtonText: "Pause" });
            animationGroup.play(true);
        }
    }
    onCurrentFrameChange(value) {
        const animationGroup = this.props.animationGroup;
        if (!animationGroup.isPlaying) {
            animationGroup.play(true);
            animationGroup.goToFrame(value);
            animationGroup.pause();
        }
        else {
            animationGroup.goToFrame(value);
        }
        this.setState({ currentFrame: value });
    }
    render() {
        const animationGroup = this.props.animationGroup;
        const playButtonText = animationGroup.isPlaying ? "Pause" : "Play";
        if (!this._animationCurveEditorContext) {
            this._animationCurveEditorContext = new _curveEditor_context__WEBPACK_IMPORTED_MODULE_7__.Context();
            this._animationCurveEditorContext.title = animationGroup.name || "";
            this._animationCurveEditorContext.animations = animationGroup.targetedAnimations;
            this._animationCurveEditorContext.scene = this.props.scene;
            this._animationCurveEditorContext.useTargetAnimations = true;
            this._animationCurveEditorContext.rootAnimationGroup = animationGroup;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "GENERAL", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Class", value: animationGroup.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: animationGroup, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "CONTROLS", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__.ButtonLineComponent, { label: playButtonText, onClick: () => this.playOrPause() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__.ButtonLineComponent, { label: "Stop", onClick: () => this.props.animationGroup.stop() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Speed ratio", minimum: 0, maximum: 10, step: 0.1, target: animationGroup, propertyName: "speedRatio", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, ref: this._timelineRef, label: "Current frame", minimum: animationGroup.from, maximum: animationGroup.to, step: (animationGroup.to - animationGroup.from) / 1000.0, directValue: this.state.currentFrame, onInput: (value) => this.onCurrentFrameChange(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_10__.CheckBoxLineComponent, { label: "Blending", target: animationGroup, propertyName: "enableBlending", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Blending speed", minimum: 0, maximum: 1, step: 0.01, target: animationGroup, propertyName: "blendingSpeed", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_10__.CheckBoxLineComponent, { label: "Is additive", target: animationGroup, propertyName: "isAdditive", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Weight", target: animationGroup, propertyName: "weight", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Play order", target: animationGroup, propertyName: "playOrder", isInteger: true, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "INFOS", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Animation count", value: animationGroup.targetedAnimations.length.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_curveEditor_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_8__.AnimationCurveEditorComponent, { globalState: this.props.globalState, context: this._animationCurveEditorContext }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "From", value: animationGroup.from.toFixed(2) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "To", value: animationGroup.to.toFixed(2) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Unique ID", value: animationGroup.uniqueId.toString() })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js ***!
  \*************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1565125__) => {

"use strict";
__nested_webpack_require_1565125__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1565125__.d(__nested_webpack_exports__, {
/* harmony export */   AnimationGridComponent: () => (/* binding */ AnimationGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1565125__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1565125__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1565125__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1565125__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1565125__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var core_Animations_animationPropertiesOverride__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1565125__(/*! core/Animations/animationPropertiesOverride */ "core/Misc/observable");
/* harmony import */ var core_Animations_animationPropertiesOverride__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_1565125__.n(core_Animations_animationPropertiesOverride__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1565125__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1565125__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1565125__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var _curveEditor_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1565125__(/*! ./curveEditor/animationCurveEditorComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/animationCurveEditorComponent.js");
/* harmony import */ var _curveEditor_context__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1565125__(/*! ./curveEditor/context */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.js");











class AnimationGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._animations = null;
        this._isPlaying = false;
        this._animationControl = {
            from: 0,
            to: 0,
            loop: false,
            initialized: false,
        };
        this.state = { currentFrame: 0 };
        const animatableAsAny = this.props.animatable;
        this._ranges = animatableAsAny.getAnimationRanges ? animatableAsAny.getAnimationRanges() : [];
        if (animatableAsAny.getAnimatables) {
            const animatables = animatableAsAny.getAnimatables();
            this._animations = new Array();
            animatables.forEach((animatable) => {
                if (animatable.animations) {
                    this._animations.push(...animatable.animations);
                }
            });
            if (animatableAsAny.animations) {
                this._animations.push(...animatableAsAny.animations);
            }
            // Extract from and to
            if (this._animations && this._animations.length) {
                this._animations.forEach((animation) => {
                    const keys = animation.getKeys();
                    if (keys && keys.length > 0) {
                        if (keys[0].frame < this._animationControl.from) {
                            this._animationControl.from = keys[0].frame;
                        }
                        const lastKeyIndex = keys.length - 1;
                        if (keys[lastKeyIndex].frame > this._animationControl.to) {
                            this._animationControl.to = keys[lastKeyIndex].frame;
                        }
                    }
                });
            }
        }
        this._timelineRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    playOrPause() {
        const animatable = this.props.animatable;
        this._isPlaying = this.props.scene.getAllAnimatablesByTarget(animatable).length > 0;
        if (this._isPlaying) {
            this.props.scene.stopAnimation(this.props.animatable);
            this._mainAnimatable = null;
        }
        else {
            this._mainAnimatable = this.props.scene.beginAnimation(this.props.animatable, this._animationControl.from, this._animationControl.to, this._animationControl.loop);
        }
        this.forceUpdate();
    }
    componentDidMount() {
        this._onBeforeRenderObserver = this.props.scene.onBeforeRenderObservable.add(() => {
            if (!this._isPlaying || !this._mainAnimatable) {
                return;
            }
            this.setState({ currentFrame: this._mainAnimatable.masterFrame });
        });
    }
    componentWillUnmount() {
        if (this._onBeforeRenderObserver) {
            this.props.scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
            this._onBeforeRenderObserver = null;
        }
    }
    onCurrentFrameChange(value) {
        if (!this._mainAnimatable) {
            return;
        }
        this._mainAnimatable.goToFrame(value);
        this.setState({ currentFrame: value });
    }
    onChangeFromOrTo() {
        this.playOrPause();
        if (this._isPlaying) {
            this.playOrPause();
        }
    }
    componentDidUpdate(prevProps) {
        const prevId = prevProps.animatable.uniqueId;
        const currId = this.props.animatable.uniqueId;
        if (prevId !== currId) {
            this._animationCurveEditorContext = null;
        }
    }
    render() {
        const animatable = this.props.animatable;
        const animatableAsAny = this.props.animatable;
        const animatablesForTarget = this.props.scene.getAllAnimatablesByTarget(animatable);
        this._isPlaying = animatablesForTarget.length > 0;
        if (this._isPlaying) {
            this._mainAnimatable = animatablesForTarget[0];
            if (this._mainAnimatable) {
                this._animationControl.from = this._mainAnimatable.fromFrame;
                this._animationControl.to = this._mainAnimatable.toFrame;
                this._animationControl.loop = this._mainAnimatable.loopAnimation;
                this._animationControl.initialized = true;
            }
        }
        const animations = animatable.animations;
        if (!this._animationCurveEditorContext) {
            this._animationCurveEditorContext = new _curveEditor_context__WEBPACK_IMPORTED_MODULE_10__.Context();
            this._animationCurveEditorContext.title = this.props.animatable.name || "";
            this._animationCurveEditorContext.animations = animations;
            this._animationCurveEditorContext.target = this.props.animatable;
            this._animationCurveEditorContext.scene = this.props.scene;
            this._animationCurveEditorContext.fromKey = this._animationControl.from;
            this._animationCurveEditorContext.toKey = this._animationControl.to;
            this._animationCurveEditorContext.useExistingPlayRange = this._animationControl.initialized;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [this._ranges.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ANIMATION RANGES", selection: this.props.globalState, children: this._ranges.map((range, i) => {
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__.ButtonLineComponent, { label: range.name, onClick: () => {
                                this._mainAnimatable = null;
                                this.props.scene.beginAnimation(animatable, range.from, range.to, true);
                            } }, range.name + i));
                    }) })), animations && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ANIMATIONS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__.TextLineComponent, { label: "Count", value: animations.length.toString() }), animations.map((anim, i) => {
                                    return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__.TextLineComponent, { label: "#" + i + " >", value: anim.targetProperty }, anim.targetProperty + i);
                                }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_curveEditor_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_9__.AnimationCurveEditorComponent, { globalState: this.props.globalState, context: this._animationCurveEditorContext })] }), animations.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ANIMATION GENERAL CONTROL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this.props.lockObject, isInteger: true, label: "From", target: this._animationControl, propertyName: "from", onChange: () => this.onChangeFromOrTo() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this.props.lockObject, isInteger: true, label: "To", target: this._animationControl, propertyName: "to", onChange: () => this.onChangeFromOrTo() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Loop", onSelect: (value) => {
                                        this._animationControl.loop = value;
                                        animatablesForTarget.forEach((at) => {
                                            at.loopAnimation = value;
                                        });
                                    }, isSelected: () => this._animationControl.loop }), this._isPlaying && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, ref: this._timelineRef, label: "Current frame", minimum: this._animationControl.from, maximum: this._animationControl.to, step: (this._animationControl.to - this._animationControl.from) / 1000.0, directValue: this.state.currentFrame, onInput: (value) => this.onCurrentFrameChange(value) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__.ButtonLineComponent, { label: this._isPlaying ? "Stop" : "Play", onClick: () => this.playOrPause() }), (this._ranges.length > 0 || (this._animations && this._animations.length > 0)) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Enable override", onSelect: (value) => {
                                                if (value) {
                                                    animatableAsAny.animationPropertiesOverride = new core_Animations_animationPropertiesOverride__WEBPACK_IMPORTED_MODULE_5__.AnimationPropertiesOverride();
                                                    animatableAsAny.animationPropertiesOverride.blendingSpeed = 0.05;
                                                }
                                                else {
                                                    animatableAsAny.animationPropertiesOverride = null;
                                                }
                                                this.forceUpdate();
                                            }, isSelected: () => animatableAsAny.animationPropertiesOverride != null, onValueChanged: () => this.forceUpdate() }), animatableAsAny.animationPropertiesOverride != null && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Enable blending", target: animatableAsAny.animationPropertiesOverride, propertyName: "enableBlending", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Blending speed", target: animatableAsAny.animationPropertiesOverride, propertyName: "blendingSpeed", minimum: 0, maximum: 0.1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }))] }))] }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/animationCurveEditorComponent.js":
/*!************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/animationCurveEditorComponent.js ***!
  \************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1580277__) => {

"use strict";
__nested_webpack_require_1580277__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1580277__.d(__nested_webpack_exports__, {
/* harmony export */   AnimationCurveEditorComponent: () => (/* binding */ AnimationCurveEditorComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1580277__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1580277__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1580277__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var _popupComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1580277__(/*! ../../../../../popupComponent */ "../../../dev/inspector/dist/components/popupComponent.js");
/* harmony import */ var _bottomBar_bottomBarComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1580277__(/*! ./bottomBar/bottomBarComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/bottomBarComponent.js");
/* harmony import */ var _topBarComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1580277__(/*! ./topBarComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/topBarComponent.js");
/* harmony import */ var _graph_canvasComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1580277__(/*! ./graph/canvasComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/canvasComponent.js");
/* harmony import */ var _sideBar_sideBarComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1580277__(/*! ./sideBar/sideBarComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/sideBarComponent.js");
/* harmony import */ var _scss_curveEditor_scss__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1580277__(/*! ./scss/curveEditor.scss */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/curveEditor.scss");









class AnimationCurveEditorComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isOpen: false };
    }
    onCloseAnimationCurveEditor(window) {
        if (window !== null) {
            window.close();
        }
        this.setState({ isOpen: false });
        this.props.context.activeAnimations = [];
        this.props.context.onActiveAnimationChanged.notifyObservers({});
    }
    shouldComponentUpdate(newProps, newState) {
        if (newState.isOpen !== this.state.isOpen) {
            if (newState.isOpen) {
                this.props.context.prepare();
                if (this.props.context.animations && this.props.context.animations.length) {
                    setTimeout(() => {
                        this.props.context.activeAnimations.push(this.props.context.useTargetAnimations
                            ? this.props.context.animations[0].animation
                            : this.props.context.animations[0]);
                        this.props.context.onActiveAnimationChanged.notifyObservers({});
                    });
                }
            }
            return true;
        }
        return false;
    }
    _onKeyDown(evt) {
        switch (evt.key) {
            case "Delete":
            case "Backspace":
                if (this.props.context.activeKeyPoints?.length && !this.props.context.focusedInput) {
                    this.props.context.onDeleteKeyActiveKeyPoints.notifyObservers();
                }
                break;
            case " ":
                if (this.props.context.isPlaying) {
                    this.props.context.stop();
                }
                else {
                    this.props.context.play(true);
                }
                break;
            case "a":
                if (evt.ctrlKey) {
                    this.props.context.onSelectAllKeys.notifyObservers();
                    this.props.context.onActiveKeyPointChanged.notifyObservers();
                    evt.preventDefault();
                }
                break;
            case "ArrowLeft":
                if (!this.props.context.focusedInput) {
                    this.props.context.onMoveToFrameRequired.notifyObservers(Math.max(0, this.props.context.activeFrame - 1));
                }
                break;
            case "ArrowRight":
                if (!this.props.context.focusedInput) {
                    this.props.context.onMoveToFrameRequired.notifyObservers(Math.min(this.props.context.clipLength, this.props.context.activeFrame + 1));
                }
                break;
            case "ArrowDown": {
                const prevKey = this.props.context.getPrevKey();
                if (prevKey !== null) {
                    this.props.context.onMoveToFrameRequired.notifyObservers(prevKey);
                }
                break;
            }
            case "ArrowUp": {
                const nextKey = this.props.context.getNextKey();
                if (nextKey !== null) {
                    this.props.context.onMoveToFrameRequired.notifyObservers(nextKey);
                }
            }
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__.ButtonLineComponent, { label: "Edit", onClick: () => {
                        this.setState({ isOpen: true });
                    } }), this.state.isOpen && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_popupComponent__WEBPACK_IMPORTED_MODULE_3__.PopupComponent, { id: "curve-editor", title: "Animation Curve Editor", size: { width: 1024, height: 512 }, onResize: () => this.props.context.onHostWindowResized.notifyObservers(), onClose: (window) => this.onCloseAnimationCurveEditor(window), onKeyDown: (evt) => this._onKeyDown(evt), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "curve-editor", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_topBarComponent__WEBPACK_IMPORTED_MODULE_5__.TopBarComponent, { globalState: this.props.globalState, context: this.props.context }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_sideBar_sideBarComponent__WEBPACK_IMPORTED_MODULE_7__.SideBarComponent, { globalState: this.props.globalState, context: this.props.context }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_graph_canvasComponent__WEBPACK_IMPORTED_MODULE_6__.CanvasComponent, { globalState: this.props.globalState, context: this.props.context }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_bottomBar_bottomBarComponent__WEBPACK_IMPORTED_MODULE_4__.BottomBarComponent, { globalState: this.props.globalState, context: this.props.context })] }) }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/bottomBarComponent.js":
/*!***********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/bottomBarComponent.js ***!
  \***********************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1588136__) => {

"use strict";
__nested_webpack_require_1588136__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1588136__.d(__nested_webpack_exports__, {
/* harmony export */   BottomBarComponent: () => (/* binding */ BottomBarComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1588136__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1588136__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _controls_textInputComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1588136__(/*! ../controls/textInputComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/textInputComponent.js");
/* harmony import */ var _mediaPlayerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1588136__(/*! ./mediaPlayerComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/mediaPlayerComponent.js");
/* harmony import */ var _rangeSelectorComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1588136__(/*! ./rangeSelectorComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/rangeSelectorComponent.js");
/* harmony import */ var _scss_bottomBar_scss__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1588136__(/*! ../scss/bottomBar.scss */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/bottomBar.scss");






class BottomBarComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { clipLength: this.props.context.clipLength ? this.props.context.clipLength.toFixed(0) : this.props.context.referenceMaxFrame.toFixed(0) };
        this._onAnimationsLoadedObserver = this.props.context.onAnimationsLoaded.add(() => {
            this.forceUpdate();
        });
        this._onActiveAnimationChangedObserver = this.props.context.onActiveAnimationChanged.add(() => {
            this.forceUpdate();
        });
        this._onClipLengthIncreasedObserver = this.props.context.onClipLengthIncreased.add((newClipLength) => {
            // New clip length is greater than current clip length: add a key frame at the new clip length location with the same value as the previous frame
            this.props.context.clipLength = newClipLength;
            this.props.context.onMoveToFrameRequired.notifyObservers(newClipLength);
            const keyAlreadyExists = this.props.context.getKeyAtAnyFrameIndex(newClipLength) !== null;
            if (!keyAlreadyExists) {
                this.props.context.onCreateOrUpdateKeyPointRequired.notifyObservers();
            }
            this.setState({ clipLength: newClipLength.toFixed(0) });
        });
        this._onClipLengthIncreasedObserver = this.props.context.onClipLengthDecreased.add((newClipLength) => {
            // New clip length is smaller than current clip length: move the playing range to the new clip length
            this.props.context.clipLength = newClipLength;
            this.props.context.onMoveToFrameRequired.notifyObservers(newClipLength);
            const keyAlreadyExists = this.props.context.getKeyAtAnyFrameIndex(newClipLength) !== null;
            if (!keyAlreadyExists) {
                this.props.context.onCreateOrUpdateKeyPointRequired.notifyObservers();
            }
            this.props.context.toKey = Math.min(this.props.context.toKey, this.props.context.clipLength);
            this.props.context.onRangeUpdated.notifyObservers();
            this.setState({ clipLength: newClipLength.toFixed(0) });
        });
    }
    _changeClipLength(newClipLength) {
        const currClipLength = this.props.context.clipLength || this.props.context.referenceMaxFrame;
        if (currClipLength < newClipLength) {
            this.props.context.onClipLengthIncreased.notifyObservers(newClipLength);
        }
        else if (currClipLength > newClipLength) {
            this.props.context.onClipLengthDecreased.notifyObservers(newClipLength);
        }
        this.setState({ clipLength: newClipLength.toFixed(0) });
    }
    componentWillUnmount() {
        if (this._onAnimationsLoadedObserver) {
            this.props.context.onAnimationsLoaded.remove(this._onAnimationsLoadedObserver);
        }
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
        if (this._onClipLengthDecreasedObserver) {
            this.props.context.onClipLengthDecreased.remove(this._onClipLengthDecreasedObserver);
        }
        if (this._onClipLengthIncreasedObserver) {
            this.props.context.onClipLengthDecreased.remove(this._onClipLengthIncreasedObserver);
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "bottom-bar", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mediaPlayerComponent__WEBPACK_IMPORTED_MODULE_3__.MediaPlayerComponent, { globalState: this.props.globalState, context: this.props.context }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_rangeSelectorComponent__WEBPACK_IMPORTED_MODULE_4__.RangeSelectorComponent, { globalState: this.props.globalState, context: this.props.context }), this.props.context.activeAnimations.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "bottom-bar-total", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_textInputComponent__WEBPACK_IMPORTED_MODULE_2__.TextInputComponent, { isNumber: true, value: this.state.clipLength, tooltip: "Clip Length", id: "clip-range", onValueAsNumberChanged: (newValue, isFocused) => {
                            !isFocused && this._changeClipLength(newValue);
                        }, globalState: this.props.globalState, context: this.props.context }) }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/mediaPlayerComponent.js":
/*!*************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/mediaPlayerComponent.js ***!
  \*************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1594851__) => {

"use strict";
__nested_webpack_require_1594851__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1594851__.d(__nested_webpack_exports__, {
/* harmony export */   MediaPlayerComponent: () => (/* binding */ MediaPlayerComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1594851__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1594851__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1594851__(/*! ../controls/controlButtonComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/controlButtonComponent.js");
/* harmony import */ var _assets_animationLastKeyIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1594851__(/*! ../assets/animationLastKeyIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastKeyIcon.svg");
/* harmony import */ var _assets_animationLastKeyHoverIcon_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1594851__(/*! ../assets/animationLastKeyHoverIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastKeyHoverIcon.svg");
/* harmony import */ var _assets_animationPlayRevIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1594851__(/*! ../assets/animationPlayRevIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayRevIcon.svg");
/* harmony import */ var _assets_animationPlayRevHoverIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1594851__(/*! ../assets/animationPlayRevHoverIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayRevHoverIcon.svg");
/* harmony import */ var _assets_animationPlayFwdIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1594851__(/*! ../assets/animationPlayFwdIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayFwdIcon.svg");
/* harmony import */ var _assets_animationPlayFwdHoverIcon_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1594851__(/*! ../assets/animationPlayFwdHoverIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayFwdHoverIcon.svg");
/* harmony import */ var _assets_animationNextKeyIcon_svg__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1594851__(/*! ../assets/animationNextKeyIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextKeyIcon.svg");
/* harmony import */ var _assets_animationNextKeyHoverIcon_svg__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_1594851__(/*! ../assets/animationNextKeyHoverIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextKeyHoverIcon.svg");
/* harmony import */ var _assets_animationStartIcon_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1594851__(/*! ../assets/animationStartIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStartIcon.svg");
/* harmony import */ var _assets_animationStartHoverIcon_svg__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1594851__(/*! ../assets/animationStartHoverIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStartHoverIcon.svg");
/* harmony import */ var _assets_animationEndIcon_svg__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_1594851__(/*! ../assets/animationEndIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationEndIcon.svg");
/* harmony import */ var _assets_animationEndHoverIcon_svg__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_1594851__(/*! ../assets/animationEndHoverIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationEndHoverIcon.svg");
/* harmony import */ var _assets_animationStopIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1594851__(/*! ../assets/animationStopIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStopIcon.svg");
/* harmony import */ var _assets_animationStopHoverIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1594851__(/*! ../assets/animationStopHoverIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStopHoverIcon.svg");
/* harmony import */ var _assets_animationNextFrameIcon_svg__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_1594851__(/*! ../assets/animationNextFrameIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextFrameIcon.svg");
/* harmony import */ var _assets_animationNextFrameHoverIcon_svg__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_1594851__(/*! ../assets/animationNextFrameHoverIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextFrameHoverIcon.svg");
/* harmony import */ var _assets_animationLastFrameIcon_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1594851__(/*! ../assets/animationLastFrameIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastFrameIcon.svg");
/* harmony import */ var _assets_animationLastFrameHoverIcon_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1594851__(/*! ../assets/animationLastFrameHoverIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastFrameHoverIcon.svg");





















class MediaPlayerComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._isMounted = false;
        this.state = {};
        this.props.context.onAnimationStateChanged.add(() => {
            if (!this._isMounted) {
                return;
            }
            this.forceUpdate();
        });
    }
    componentDidMount() {
        this._isMounted = true;
    }
    componentWillUnmount() {
        this._isMounted = false;
    }
    _onFirstKey() {
        this.props.context.onMoveToFrameRequired.notifyObservers(this.props.context.fromKey);
    }
    _onPrevKey() {
        const prevKey = this.props.context.getPrevKey();
        if (prevKey !== null) {
            this.props.context.onMoveToFrameRequired.notifyObservers(prevKey);
        }
    }
    _onRewind() {
        this.props.context.play(false);
        this.forceUpdate();
    }
    _onForward() {
        this.props.context.play(true);
        this.forceUpdate();
    }
    _onPrevFrame() {
        this.props.context.onMoveToFrameRequired.notifyObservers(Math.max(0, this.props.context.activeFrame - 1));
    }
    _onNextFrame() {
        this.props.context.onMoveToFrameRequired.notifyObservers(this.props.context.activeFrame + 1);
    }
    _onNextKey() {
        const nextKey = this.props.context.getNextKey();
        if (nextKey !== null) {
            this.props.context.onMoveToFrameRequired.notifyObservers(nextKey);
        }
    }
    _onEndKey() {
        this.props.context.onMoveToFrameRequired.notifyObservers(this.props.context.toKey);
    }
    _onStop() {
        this.props.context.stop();
        this.forceUpdate();
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "media-player", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Rewind to the first frame of the selected timeline", id: "start-key", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationStartIcon_svg__WEBPACK_IMPORTED_MODULE_3__, hoverIcon: _assets_animationStartHoverIcon_svg__WEBPACK_IMPORTED_MODULE_4__, onClick: () => this._onFirstKey() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Rewind to the previous frame", id: "prev-frame", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationLastFrameIcon_svg__WEBPACK_IMPORTED_MODULE_5__, hoverIcon: _assets_animationLastFrameHoverIcon_svg__WEBPACK_IMPORTED_MODULE_6__, onClick: () => this._onPrevFrame() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Rewind to the previous key frame", id: "first-key", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationLastKeyIcon_svg__WEBPACK_IMPORTED_MODULE_7__, hoverIcon: _assets_animationLastKeyHoverIcon_svg__WEBPACK_IMPORTED_MODULE_8__, onClick: () => this._onPrevKey() }), ((this.props.context.isPlaying && this.props.context.forwardAnimation) || !this.props.context.isPlaying) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Play backwards", id: "rev-key", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationPlayRevIcon_svg__WEBPACK_IMPORTED_MODULE_9__, hoverIcon: _assets_animationPlayRevHoverIcon_svg__WEBPACK_IMPORTED_MODULE_10__, onClick: () => this._onRewind() })), this.props.context.isPlaying && !this.props.context.forwardAnimation && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Stop", id: "stop-key", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationStopIcon_svg__WEBPACK_IMPORTED_MODULE_11__, hoverIcon: _assets_animationStopHoverIcon_svg__WEBPACK_IMPORTED_MODULE_12__, onClick: () => this._onStop() })), ((this.props.context.isPlaying && !this.props.context.forwardAnimation) || !this.props.context.isPlaying) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Play forwards", id: "fwd-key", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationPlayFwdIcon_svg__WEBPACK_IMPORTED_MODULE_13__, hoverIcon: _assets_animationPlayFwdHoverIcon_svg__WEBPACK_IMPORTED_MODULE_14__, onClick: () => this._onForward() })), this.props.context.isPlaying && this.props.context.forwardAnimation && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Stop", id: "stop-key", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationStopIcon_svg__WEBPACK_IMPORTED_MODULE_11__, hoverIcon: _assets_animationStopHoverIcon_svg__WEBPACK_IMPORTED_MODULE_12__, onClick: () => this._onStop() })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Advance to the next key frame", id: "next-key", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationNextKeyIcon_svg__WEBPACK_IMPORTED_MODULE_15__, hoverIcon: _assets_animationNextKeyHoverIcon_svg__WEBPACK_IMPORTED_MODULE_16__, onClick: () => this._onNextKey() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Advance to the next frame", id: "next-frame", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationNextFrameIcon_svg__WEBPACK_IMPORTED_MODULE_17__, hoverIcon: _assets_animationNextFrameHoverIcon_svg__WEBPACK_IMPORTED_MODULE_18__, onClick: () => this._onNextFrame() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_controlButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ControlButtonComponent, { tooltip: "Advance to the last frame of the selected timeline", id: "end-key", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationEndIcon_svg__WEBPACK_IMPORTED_MODULE_19__, hoverIcon: _assets_animationEndHoverIcon_svg__WEBPACK_IMPORTED_MODULE_20__, onClick: () => this._onEndKey() })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/rangeSelectorComponent.js":
/*!***************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/rangeSelectorComponent.js ***!
  \***************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1608162__) => {

"use strict";
__nested_webpack_require_1608162__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1608162__.d(__nested_webpack_exports__, {
/* harmony export */   RangeSelectorComponent: () => (/* binding */ RangeSelectorComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1608162__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1608162__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _assets_scrollbarHandleIcon_svg__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1608162__(/*! ../assets/scrollbarHandleIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/scrollbarHandleIcon.svg");



class RangeSelectorComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._viewWidth = 748;
        this.state = {};
        this._rangeHost = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._rangeScrollbarHost = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this.props.context.onHostWindowResized.add(() => {
            this._computeSizes();
        });
        this.props.context.onFrameSet.add(() => {
            this.forceUpdate();
        });
        this.props.context.onAnimationsLoaded.add(() => {
            this.forceUpdate();
        });
        this._updateLimits();
    }
    _computeSizes() {
        if (!this._rangeHost.current) {
            return;
        }
        this._viewWidth = this._rangeHost.current.clientWidth - 4;
        this.forceUpdate();
    }
    _onPointerDown(evt) {
        this._bothHandleIsActive = false;
        if (evt.nativeEvent.target.id === "left-handle") {
            this._leftHandleIsActive = true;
        }
        else if (evt.nativeEvent.target.id === "right-handle") {
            this._leftHandleIsActive = false;
        }
        else {
            this._bothHandleIsActive = true;
            this._currentOffset = evt.nativeEvent.clientX;
            this._currentFrom = this.props.context.fromKey;
            this._currentTo = this.props.context.toKey;
        }
        this._pointerIsDown = true;
        evt.currentTarget.setPointerCapture(evt.pointerId);
    }
    _onPointerMove(evt) {
        if (!this._pointerIsDown) {
            return;
        }
        if (!this.props.context.animations || !this.props.context.animations.length) {
            return;
        }
        this._updateLimits();
        let left = evt.nativeEvent.offsetX;
        if (this._bothHandleIsActive) {
            left = evt.nativeEvent.clientX - this._currentOffset;
        }
        let offset = (left / this._viewWidth) * (this._maxFrame - this._minFrame);
        const newValue = Math.min(this._maxFrame, Math.max(this._minFrame, Math.round(this._minFrame + offset)));
        if (this._bothHandleIsActive) {
            if (this._currentTo + offset > this._maxFrame) {
                offset = this._maxFrame - this._currentTo;
            }
            if (this._currentFrom + offset < this._minFrame) {
                offset = this._minFrame - this._currentFrom;
            }
            this.props.context.fromKey = Math.min(this._maxFrame, Math.max(this._minFrame, (this._currentFrom + offset) | 0));
            this.props.context.toKey = Math.min(this._maxFrame, Math.max(this._minFrame, (this._currentTo + offset) | 0));
        }
        else if (this._leftHandleIsActive) {
            this.props.context.fromKey = newValue;
            this.props.context.fromKey = Math.min(this.props.context.toKey - 1, this.props.context.fromKey);
        }
        else {
            this.props.context.toKey = newValue;
            this.props.context.toKey = Math.max(this.props.context.fromKey + 1, this.props.context.toKey);
        }
        this.props.context.onRangeUpdated.notifyObservers();
        this.props.context.stop();
        this.forceUpdate();
    }
    _updateLimits() {
        if (!this.props.context.animations || !this.props.context.animations.length) {
            return;
        }
        let minFrame = Number.MAX_VALUE;
        let maxFrame = -Number.MAX_VALUE;
        for (const animation of this.props.context.animations) {
            const keys = this.props.context.useTargetAnimations ? animation.animation.getKeys() : animation.getKeys();
            minFrame = Math.min(minFrame, keys[0].frame);
            maxFrame = Math.max(maxFrame, keys[keys.length - 1].frame);
        }
        this._minFrame = minFrame;
        this._maxFrame = maxFrame;
    }
    _onPointerUp(evt) {
        this._pointerIsDown = false;
        evt.currentTarget.releasePointerCapture(evt.pointerId);
    }
    render() {
        this._updateLimits();
        const ratio = this._maxFrame - this._minFrame;
        if (this.props.context.toKey > this._maxFrame) {
            this.props.context.toKey = this._maxFrame;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "range-selector", ref: this._rangeHost, onPointerDown: (evt) => this._onPointerDown(evt), onPointerMove: (evt) => this._onPointerMove(evt), onPointerUp: (evt) => this._onPointerUp(evt), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "range-scrollbar", ref: this._rangeScrollbarHost, style: {
                    left: `${2 + ((this.props.context.fromKey - this._minFrame) / ratio) * this._viewWidth}px`,
                    right: `${2 + ((this._maxFrame - this.props.context.toKey) / ratio) * this._viewWidth}px`,
                }, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "left-handle", className: "handle", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _assets_scrollbarHandleIcon_svg__WEBPACK_IMPORTED_MODULE_2__ }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "from-key", children: this.props.context.fromKey | 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "to-key", children: this.props.context.toKey | 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "right-handle", className: "handle", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _assets_scrollbarHandleIcon_svg__WEBPACK_IMPORTED_MODULE_2__ }) })] }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.js":
/*!**************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.js ***!
  \**************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1615162__) => {

"use strict";
__nested_webpack_require_1615162__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1615162__.d(__nested_webpack_exports__, {
/* harmony export */   Context: () => (/* binding */ Context)
/* harmony export */ });
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1615162__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1615162__.n(core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__);


class Context {
    constructor() {
        this.activeAnimations = [];
        this.activeChannels = {};
        this.useExistingPlayRange = false;
        this.forwardAnimation = true;
        this.referenceMinFrame = 0;
        this.referenceMaxFrame = 100;
        this.focusedInput = false;
        this.onActiveAnimationChanged = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onActiveKeyPointChanged = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onHostWindowResized = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onSelectAllKeys = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onActiveKeyFrameChanged = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onFrameSet = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onFrameManuallyEntered = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onMainKeyPointSet = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onMainKeyPointMoved = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onValueSet = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onValueManuallyEntered = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onFrameRequired = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onCreateOrUpdateKeyPointRequired = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onFlattenTangentRequired = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onLinearTangentRequired = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onBreakTangentRequired = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onUnifyTangentRequired = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onStepTangentRequired = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onDeleteAnimation = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onGraphMoved = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onGraphScaled = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onRangeUpdated = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onMoveToFrameRequired = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onAnimationStateChanged = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onDeleteKeyActiveKeyPoints = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onSelectionRectangleMoved = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onAnimationsLoaded = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onEditAnimationRequired = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onEditAnimationUIClosed = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onClipLengthIncreased = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onClipLengthDecreased = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onInterpolationModeSet = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onSelectToActivated = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onRangeFrameBarResized = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.onPlayheadMoved = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.lockLastFrameValue = false;
        this.lockLastFrameFrame = false;
        // value frame inTangent outTangent
        this.onActiveKeyDataChanged = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
    }
    prepare() {
        this.isPlaying = false;
        if (!this.animations || !this.animations.length) {
            return;
        }
        const animation = this.useTargetAnimations ? this.animations[0].animation : this.animations[0];
        const keys = animation.getKeys();
        this.referenceMinFrame = 0;
        this.referenceMaxFrame = keys[keys.length - 1].frame;
        if (!this.useExistingPlayRange) {
            this.fromKey = this.referenceMinFrame;
            this.toKey = this.referenceMaxFrame;
        }
        this.snippetId = animation.snippetId;
        this.clipLength = this.referenceMaxFrame;
        if (!animation || !animation.hasRunningRuntimeAnimations) {
            return;
        }
        this.isPlaying = true;
    }
    play(forward) {
        this.isPlaying = true;
        this.scene.stopAnimation(this.target);
        let animatable;
        if (forward) {
            if (this.rootAnimationGroup) {
                this.rootAnimationGroup.start(true, 1.0, this.fromKey, this.toKey);
            }
            else {
                animatable = this.scene.beginAnimation(this.target, this.fromKey, this.toKey, true);
            }
        }
        else {
            if (this.rootAnimationGroup) {
                this.rootAnimationGroup.start(true, 1.0, this.toKey, this.fromKey);
            }
            else {
                animatable = this.scene.beginAnimation(this.target, this.toKey, this.fromKey, true);
            }
        }
        this.forwardAnimation = forward;
        // Move
        if (this.rootAnimationGroup) {
            this.rootAnimationGroup.goToFrame(this.activeFrame);
        }
        else {
            animatable.goToFrame(this.activeFrame);
        }
        this.onAnimationStateChanged.notifyObservers();
    }
    stop() {
        this.isPlaying = false;
        if (this.rootAnimationGroup) {
            this.rootAnimationGroup.stop();
        }
        else {
            this.scene.stopAnimation(this.target);
        }
        this.onAnimationStateChanged.notifyObservers();
    }
    moveToFrame(frame) {
        if (!this.animations || !this.animations.length) {
            return;
        }
        this.activeFrame = frame;
        if (!this.isPlaying) {
            if (this.rootAnimationGroup) {
                this.rootAnimationGroup.start(false, 1.0, this.fromKey, this.toKey);
            }
            else {
                this.scene.beginAnimation(this.target, this.fromKey, this.toKey, false);
            }
        }
        for (const animationEntry of this.animations) {
            const animation = this.useTargetAnimations ? animationEntry.animation : animationEntry;
            if (!animation.hasRunningRuntimeAnimations) {
                return;
            }
            for (const runtimeAnimation of animation.runtimeAnimations) {
                runtimeAnimation.goToFrame(frame);
            }
        }
        this.stop();
    }
    refreshTarget() {
        if (!this.animations || !this.animations.length) {
            return;
        }
        if (this.isPlaying) {
            return;
        }
        this.moveToFrame(this.activeFrame);
    }
    clearSelection() {
        this.activeKeyPoints = [];
        this.onActiveKeyPointChanged.notifyObservers();
    }
    enableChannel(animation, color) {
        this.activeChannels[animation.uniqueId] = color;
    }
    disableChannel(animation) {
        delete this.activeChannels[animation.uniqueId];
    }
    isChannelEnabled(animation, color) {
        return this.activeChannels[animation.uniqueId] === undefined || this.activeChannels[animation.uniqueId] === color;
    }
    getActiveChannel(animation) {
        return this.activeChannels[animation.uniqueId];
    }
    resetAllActiveChannels() {
        this.clearSelection();
        this.activeChannels = {};
    }
    getAnimationSortIndex(animation) {
        if (!this.animations) {
            return -1;
        }
        for (let index = 0; index < this.animations?.length; index++) {
            if (animation === (this.useTargetAnimations ? this.animations[0].animation : this.animations[index])) {
                return index;
            }
        }
        return -1;
    }
    getPrevKey() {
        if (!this.animations || !this.animations.length || this.activeAnimations.length === 0) {
            return null;
        }
        let prevKey = -Number.MAX_VALUE;
        for (const animation of this.activeAnimations) {
            const keys = animation.getKeys();
            for (const key of keys) {
                if (key.frame < this.activeFrame && key.frame > prevKey) {
                    prevKey = key.frame;
                }
            }
        }
        if (prevKey === -Number.MAX_VALUE) {
            prevKey = this.fromKey;
        }
        return prevKey;
    }
    getNextKey() {
        if (!this.animations || !this.animations.length) {
            return null;
        }
        let nextKey = Number.MAX_VALUE;
        for (const animation of this.activeAnimations) {
            const keys = animation.getKeys();
            for (const key of keys) {
                if (key.frame > this.activeFrame && key.frame < nextKey) {
                    nextKey = key.frame;
                }
            }
        }
        if (nextKey === Number.MAX_VALUE) {
            nextKey = this.toKey;
        }
        return nextKey;
    }
    /**
     * If any current active animation has a key at the received frameNumber,
     * return the index of the animation in the active animation array, and
     * the index of the frame on the animation.
     * @param frameNumber the frame number to look for
     * @returns null if no key was found, or an object with the animation index and key index
     */
    getKeyAtAnyFrameIndex(frameNumber) {
        if (!this.animations || !this.animations.length || !this.activeAnimations || !this.activeAnimations.length) {
            return null;
        }
        let animIdx = 0;
        for (const animation of this.activeAnimations) {
            const keys = animation.getKeys();
            let idx = 0;
            for (const key of keys) {
                if (Math.floor(frameNumber - key.frame) === 0) {
                    return { animationIndex: animIdx, keyIndex: idx };
                }
                idx++;
            }
            animIdx++;
        }
        return null;
    }
    /**
     * @returns true if any active animation has a quaternion animation
     */
    hasActiveQuaternionAnimationKeyPoints() {
        const activeAnimData = this.activeKeyPoints?.map((keyPointComponent) => keyPointComponent.props.curve.animation.dataType);
        const quaternionAnimData = activeAnimData?.filter((type) => type === core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Animation.ANIMATIONTYPE_QUATERNION);
        const hasActiveQuaternionAnimation = (quaternionAnimData?.length || 0) > 0;
        return hasActiveQuaternionAnimation;
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/actionButtonComponent.js":
/*!*************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/actionButtonComponent.js ***!
  \*************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1627701__) => {

"use strict";
__nested_webpack_require_1627701__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1627701__.d(__nested_webpack_exports__, {
/* harmony export */   ActionButtonComponent: () => (/* binding */ ActionButtonComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1627701__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1627701__(/*! react */ "../../../../node_modules/react/index.js");


class ActionButtonComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = {};
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { title: this.props.tooltip, className: "action-button" + (this.props.isActive ? " active" : "") + (this.props.className ? " " + this.props.className : ""), id: this.props.id, onClick: () => this.props.onClick(), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "action-button-image", src: this.props.icon }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/controlButtonComponent.js":
/*!**************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/controlButtonComponent.js ***!
  \**************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1629511__) => {

"use strict";
__nested_webpack_require_1629511__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1629511__.d(__nested_webpack_exports__, {
/* harmony export */   ControlButtonComponent: () => (/* binding */ ControlButtonComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1629511__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1629511__(/*! react */ "../../../../node_modules/react/index.js");


class ControlButtonComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = {};
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { title: this.props.tooltip, className: "control-button" + (this.props.className ? " " + this.props.className : ""), id: this.props.id, onClick: () => this.props.onClick(), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "control-button-image", src: this.props.icon }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "control-button-hover-image", src: this.props.hoverIcon })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/textInputComponent.js":
/*!**********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/textInputComponent.js ***!
  \**********************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1631407__) => {

"use strict";
__nested_webpack_require_1631407__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1631407__.d(__nested_webpack_exports__, {
/* harmony export */   TextInputComponent: () => (/* binding */ TextInputComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1631407__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1631407__(/*! react */ "../../../../node_modules/react/index.js");


class TextInputComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { value: this.props.value, isFocused: false };
    }
    _onChange(value) {
        if (this.props.isNumber) {
            const valueAsNumber = parseFloat(value);
            if (!isNaN(valueAsNumber)) {
                if (this.props.onValueAsNumberChanged) {
                    this.props.onValueAsNumberChanged(valueAsNumber, true);
                }
                this._lastKnownGoodValue = valueAsNumber.toString();
            }
            else if (value !== "-" && value !== "") {
                return;
            }
        }
        this._lastKnownGoodValue = value;
        this.setState({ value: value });
    }
    _onBlur() {
        this.props.context.focusedInput = false;
        if (this.props.isNumber) {
            const valueAsNumber = parseFloat(this.state.value);
            if (!isNaN(valueAsNumber)) {
                if (this.props.onValueAsNumberChanged) {
                    this.props.onValueAsNumberChanged(valueAsNumber, false);
                }
                this.setState({ value: valueAsNumber.toString(), isFocused: false });
            }
            else {
                this.setState({ value: this._lastKnownGoodValue, isFocused: false });
            }
            return;
        }
        this.setState({ isFocused: false });
    }
    _onFocus() {
        this.props.context.focusedInput = true;
        this.setState({ isFocused: true });
    }
    shouldComponentUpdate(newProps, newState) {
        if (newProps !== this.props) {
            newState.value = newProps.value;
        }
        return true;
    }
    _onKeyPress(evt) {
        if (evt.key === "Enter") {
            const valueAsNumber = parseFloat(this.state.value);
            if (!isNaN(valueAsNumber)) {
                if (this.props.onValueAsNumberChanged) {
                    this.props.onValueAsNumberChanged(valueAsNumber, false);
                }
            }
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", title: this.props.tooltip, onFocus: () => this._onFocus(), onBlur: () => this._onBlur(), className: "text-input" + (this.props.className ? " " + this.props.className : ""), onChange: (evt) => this._onChange(this.props.complement ? evt.target.value.replace(this.props.complement, "") : evt.target.value), onKeyPress: (evt) => this._onKeyPress(evt), value: (this.state.value || "") + (!this.state.isFocused && this.props.complement ? this.props.complement : ""), id: this.props.id, disabled: this.props.disabled }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/canvasComponent.js":
/*!****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/canvasComponent.js ***!
  \****************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1635257__) => {

"use strict";
__nested_webpack_require_1635257__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1635257__.d(__nested_webpack_exports__, {
/* harmony export */   CanvasComponent: () => (/* binding */ CanvasComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1635257__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1635257__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _frameBarComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1635257__(/*! ./frameBarComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/frameBarComponent.js");
/* harmony import */ var _graphComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1635257__(/*! ./graphComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/graphComponent.js");
/* harmony import */ var _playHeadComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1635257__(/*! ./playHeadComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/playHeadComponent.js");
/* harmony import */ var _rangeFrameBarComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1635257__(/*! ./rangeFrameBarComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/rangeFrameBarComponent.js");
/* harmony import */ var _scss_canvas_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1635257__(/*! ../scss/canvas.scss */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/canvas.scss");







class CanvasComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = {};
        this._onActiveAnimationChangedObserver = this.props.context.onActiveAnimationChanged.add(() => {
            this.forceUpdate();
        });
    }
    componentWillUnmount() {
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "canvas-zone", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_frameBarComponent__WEBPACK_IMPORTED_MODULE_2__.FrameBarComponent, { globalState: this.props.globalState, context: this.props.context }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_graphComponent__WEBPACK_IMPORTED_MODULE_3__.GraphComponent, { globalState: this.props.globalState, context: this.props.context }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_playHeadComponent__WEBPACK_IMPORTED_MODULE_4__.PlayHeadComponent, { context: this.props.context, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_rangeFrameBarComponent__WEBPACK_IMPORTED_MODULE_5__.RangeFrameBarComponent, { context: this.props.context, globalState: this.props.globalState }), this.props.context.activeAnimations.length > 0 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "angle-mode" })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/curve.js":
/*!******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/curve.js ***!
  \******************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1639145__) => {

"use strict";
__nested_webpack_require_1639145__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1639145__.d(__nested_webpack_exports__, {
/* harmony export */   Curve: () => (/* binding */ Curve)
/* harmony export */ });
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1639145__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1639145__.n(core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__);


class Curve {
    constructor(color, animation, property, tangentBuilder, setDefaultInTangent, setDefaultOutTangent) {
        this.keys = [];
        this.onDataUpdatedObservable = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this.color = color;
        this.animation = animation;
        this.property = property;
        this.tangentBuilder = tangentBuilder;
        this.setDefaultInTangent = setDefaultInTangent;
        this.setDefaultOutTangent = setDefaultOutTangent;
    }
    getPathData(convertX, convertY) {
        const keys = this.keys;
        if (keys.length < 2) {
            return "";
        }
        let pathData = `M${convertX(keys[0].frame)} ${convertY(keys[0].value)}`;
        const dataType = this.animation.dataType;
        for (let keyIndex = 1; keyIndex < keys.length; keyIndex++) {
            const outTangent = keys[keyIndex - 1].outTangent;
            const inTangent = keys[keyIndex].inTangent;
            const currentFrame = keys[keyIndex].frame;
            const currentValue = keys[keyIndex].value;
            const prevFrame = keys[keyIndex - 1].frame;
            const prevValue = keys[keyIndex - 1].value;
            const frameDist = currentFrame - prevFrame;
            const prevInterpolation = keys[keyIndex - 1].interpolation;
            if (prevInterpolation === 1 /* AnimationKeyInterpolation.STEP */) {
                // Draw a stepped curve
                pathData += `L ${convertX(currentFrame)} ${convertY(prevValue)}`;
                pathData += `L ${convertX(currentFrame)} ${convertY(currentValue)}`;
                continue;
            }
            if (outTangent === undefined && inTangent === undefined && dataType !== core_Animations_animation__WEBPACK_IMPORTED_MODULE_0__.Animation.ANIMATIONTYPE_QUATERNION) {
                // Draw a straight line
                pathData += ` L${convertX(currentFrame)} ${convertY(currentValue)}`;
                continue;
            }
            // Let's sample the curve else
            for (let frame = prevFrame; frame < currentFrame; frame += frameDist / Curve.SampleRate) {
                const keyValue = this.animation.evaluate(frame);
                const value = this.property ? keyValue[this.property] : keyValue;
                pathData += ` L${convertX(frame)} ${convertY(value)}`;
            }
            pathData += ` L${convertX(currentFrame)} ${convertY(currentValue)}`;
        }
        return pathData;
    }
    updateLockedTangentMode(keyIndex, enabled) {
        const keys = this.keys;
        keys[keyIndex].lockedTangent = enabled;
        const animationKeys = this.animation.getKeys();
        animationKeys[keyIndex].lockedTangent = enabled;
    }
    updateInterpolationMode(keyIndex, interpolationMode) {
        const keys = this.keys;
        keys[keyIndex].interpolation = interpolationMode;
        const animationKeys = this.animation.getKeys();
        animationKeys[keyIndex].interpolation = interpolationMode;
        this.onDataUpdatedObservable.notifyObservers();
    }
    getInControlPoint(keyIndex) {
        if (keyIndex === 0) {
            return 0;
        }
        const keys = this.keys;
        let inTangent = keys[keyIndex].inTangent;
        if (inTangent === undefined && this.hasDefinedInTangent(keyIndex)) {
            inTangent = this.evaluateInTangent(keyIndex);
        }
        return inTangent;
    }
    getOutControlPoint(keyIndex) {
        const keys = this.keys;
        if (keyIndex === keys.length - 1) {
            return 0;
        }
        let outTangent = keys[keyIndex].outTangent;
        if (outTangent === undefined && this.hasDefinedOutTangent(keyIndex)) {
            outTangent = this.evaluateOutTangent(keyIndex);
        }
        return outTangent;
    }
    hasDefinedOutTangent(keyIndex) {
        const keys = this.keys;
        if (keyIndex === this.keys.length - 1)
            return false;
        const prevFrame = keys[keyIndex].frame;
        const currentFrame = keys[keyIndex + 1].frame;
        return prevFrame !== currentFrame;
    }
    evaluateOutTangent(keyIndex) {
        const keys = this.keys;
        const prevFrame = keys[keyIndex].frame;
        const currentFrame = keys[keyIndex + 1].frame;
        return (keys[keyIndex + 1].value - keys[keyIndex].value) / (currentFrame - prevFrame);
    }
    hasDefinedInTangent(keyIndex) {
        if (keyIndex === 0)
            return false;
        const keys = this.keys;
        const prevFrame = keys[keyIndex - 1].frame;
        const currentFrame = keys[keyIndex].frame;
        return prevFrame !== currentFrame;
    }
    evaluateInTangent(keyIndex) {
        const keys = this.keys;
        const prevFrame = keys[keyIndex - 1].frame;
        const currentFrame = keys[keyIndex].frame;
        return (keys[keyIndex].value - keys[keyIndex - 1].value) / (currentFrame - prevFrame);
    }
    storeDefaultInTangent(keyIndex) {
        const keys = this.keys;
        const animationKeys = this.animation.getKeys();
        if (this.hasDefinedInTangent(keyIndex)) {
            keys[keyIndex].inTangent = this.evaluateInTangent(keyIndex);
        }
        if (this.property) {
            if (!animationKeys[keyIndex].inTangent) {
                animationKeys[keyIndex].inTangent = this.tangentBuilder();
                this.setDefaultInTangent(keyIndex);
            }
            animationKeys[keyIndex].inTangent[this.property] = keys[keyIndex].inTangent;
        }
        else {
            animationKeys[keyIndex].inTangent = keys[keyIndex].inTangent;
        }
    }
    storeDefaultOutTangent(keyIndex) {
        const keys = this.keys;
        const animationKeys = this.animation.getKeys();
        if (this.hasDefinedOutTangent(keyIndex)) {
            keys[keyIndex].outTangent = this.evaluateOutTangent(keyIndex);
        }
        if (this.property) {
            if (!animationKeys[keyIndex].outTangent) {
                animationKeys[keyIndex].outTangent = this.tangentBuilder();
                this.setDefaultOutTangent(keyIndex);
            }
            animationKeys[keyIndex].outTangent[this.property] = keys[keyIndex].outTangent;
        }
        else {
            animationKeys[keyIndex].outTangent = keys[keyIndex].outTangent;
        }
    }
    updateInTangentFromControlPoint(keyId, slope) {
        const keys = this.keys;
        keys[keyId].inTangent = slope;
        const animationKeys = this.animation.getKeys();
        if (this.property) {
            if (!animationKeys[keyId].inTangent) {
                animationKeys[keyId].inTangent = this.tangentBuilder();
                this.setDefaultInTangent(keyId);
            }
            if (!animationKeys[keyId - 1].outTangent) {
                animationKeys[keyId - 1].outTangent = this.tangentBuilder();
                this.setDefaultOutTangent(keyId - 1);
            }
            animationKeys[keyId].inTangent[this.property] = keys[keyId].inTangent;
        }
        else {
            animationKeys[keyId].inTangent = keys[keyId].inTangent;
            if (animationKeys[keyId - 1].outTangent === undefined) {
                this.storeDefaultOutTangent(keyId - 1);
            }
        }
        this.onDataUpdatedObservable.notifyObservers();
    }
    updateOutTangentFromControlPoint(keyId, slope) {
        const keys = this.keys;
        keys[keyId].outTangent = slope;
        const animationKeys = this.animation.getKeys();
        if (this.property) {
            if (!animationKeys[keyId + 1].inTangent) {
                animationKeys[keyId + 1].inTangent = this.tangentBuilder();
                this.setDefaultInTangent(keyId + 1);
            }
            if (!animationKeys[keyId].outTangent) {
                animationKeys[keyId].outTangent = this.tangentBuilder();
                this.setDefaultOutTangent(keyId);
            }
            animationKeys[keyId].outTangent[this.property] = keys[keyId].outTangent;
        }
        else {
            animationKeys[keyId].outTangent = keys[keyId].outTangent;
            if (animationKeys[keyId + 1].inTangent === undefined) {
                this.storeDefaultInTangent(keyId + 1);
            }
        }
        this.onDataUpdatedObservable.notifyObservers();
    }
    updateKeyFrame(keyId, frame) {
        const originalKey = this.animation.getKeys()[keyId];
        originalKey.frame = frame;
        this.keys[keyId].frame = frame;
        this.onDataUpdatedObservable.notifyObservers();
    }
    updateKeyValue(keyId, value) {
        this.keys[keyId].value = value;
        const sourceKey = this.animation.getKeys()[keyId];
        if (this.property) {
            sourceKey.value[this.property] = value;
        }
        else {
            sourceKey.value = value;
        }
        this.onDataUpdatedObservable.notifyObservers();
    }
}
Curve.SampleRate = 50;
Curve.TangentLength = 50;


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/curveComponent.js":
/*!***************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/curveComponent.js ***!
  \***************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1649195__) => {

"use strict";
__nested_webpack_require_1649195__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1649195__.d(__nested_webpack_exports__, {
/* harmony export */   CurveComponent: () => (/* binding */ CurveComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1649195__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1649195__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1649195__(/*! core/Animations/animation */ "core/Misc/observable");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1649195__.n(core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__);



class CurveComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isSelected: false };
        this._onDataUpdatedObserver = this.props.curve.onDataUpdatedObservable.add(() => this.forceUpdate());
        this._onActiveAnimationChangedObserver = props.context.onActiveAnimationChanged.add(() => {
            if (this._onDataUpdatedObserver) {
                this.props.curve.onDataUpdatedObservable.remove(this._onDataUpdatedObserver);
            }
            this._onDataUpdatedObserver = null;
            this.forceUpdate();
        });
        this._onInterpolationModeSetObserver = props.context.onInterpolationModeSet.add(({ keyId, value }) => {
            this.props.curve.updateInterpolationMode(keyId, value);
        });
    }
    componentWillUnmount() {
        if (this._onDataUpdatedObserver) {
            this.props.curve.onDataUpdatedObservable.remove(this._onDataUpdatedObserver);
        }
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
        if (this._onInterpolationModeSetObserver) {
            this.props.context.onInterpolationModeSet.remove(this._onInterpolationModeSetObserver);
        }
    }
    componentDidUpdate() {
        if (!this._onDataUpdatedObserver) {
            this._onDataUpdatedObserver = this.props.curve.onDataUpdatedObservable.add(() => this.forceUpdate());
        }
        return true;
    }
    render() {
        if (!this.props.context.isChannelEnabled(this.props.curve.animation, this.props.curve.color)) {
            return null;
        }
        const pathStyle = {
            stroke: this.props.curve.color,
            fill: "none",
            strokeWidth: "1",
        };
        if (this.props.curve.animation.dataType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_QUATERNION) {
            pathStyle["stroke-dasharray"] = "5";
            pathStyle["stroke-opacity"] = "0.5";
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { style: { cursor: "pointer", overflow: "auto" }, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: this.props.curve.getPathData(this.props.convertX, this.props.convertY), style: pathStyle }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/frameBarComponent.js":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/frameBarComponent.js ***!
  \******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1653099__) => {

"use strict";
__nested_webpack_require_1653099__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1653099__.d(__nested_webpack_exports__, {
/* harmony export */   FrameBarComponent: () => (/* binding */ FrameBarComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1653099__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1653099__(/*! react */ "../../../../node_modules/react/index.js");


// x distance between consecutive ticks on the frame
const baseTickDistance = 25;
const minTickDistance = 35;
class FrameBarComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._graphAbsoluteWidth = 788;
        this._viewWidth = 748;
        this._viewScale = 1;
        this._offsetX = 0;
        this.state = {};
        this._svgHost = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this.props.context.onHostWindowResized.add(() => {
            this._computeSizes();
        });
        this._onActiveAnimationChangedObserver = this.props.context.onActiveAnimationChanged.add(() => {
            this._computeSizes();
            this.forceUpdate();
        });
        this.props.context.onGraphMoved.add((x) => {
            this._offsetX = x;
            this.forceUpdate();
        });
        this.props.context.onGraphScaled.add((scale) => {
            this._viewScale = scale;
            this.forceUpdate();
        });
    }
    componentWillUnmount() {
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
    }
    _computeSizes() {
        if (!this._svgHost.current) {
            return;
        }
        this._viewWidth = this._svgHost.current.clientWidth;
        this.forceUpdate();
    }
    _buildFrames() {
        if (this.props.context.activeAnimations.length === 0) {
            return null;
        }
        const minFrame = this.props.context.referenceMinFrame;
        const maxFrame = this.props.context.referenceMaxFrame;
        const range = maxFrame - minFrame;
        const convertRatio = range / this._graphAbsoluteWidth;
        const dist = Math.max(baseTickDistance * this._viewScale, minTickDistance); // x distance between consecutive ticks
        let offset = Math.floor(dist * convertRatio);
        const steps = [];
        if (offset === 0) {
            offset = 1;
        }
        const startPosition = this._offsetX * convertRatio;
        const start = minFrame - ((startPosition / offset) | 0) * offset;
        const end = start + this._viewWidth * this._viewScale * convertRatio;
        for (let step = start - offset; step <= end + offset; step += offset) {
            steps.push(step);
        }
        return steps.map((s) => {
            const x = (s - minFrame) / convertRatio;
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: `${5 * this._viewScale}px`, x2: x, y2: `${30 * this._viewScale}px`, style: {
                            stroke: "#333333",
                            strokeWidth: 0.5,
                        } }, "line" + s), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: x, y: 0, dx: `${7 * this._viewScale}px`, textAnchor: "middle", dy: `${15 * this._viewScale}px`, style: {
                            fontFamily: "acumin-pro-condensed",
                            fontSize: `${10 * this._viewScale}px`,
                            fill: "#555555",
                            textAlign: "center",
                        }, children: s.toFixed(0) }, "label" + s)] }, "axis" + s));
        });
    }
    render() {
        const viewBox = `${-this._offsetX} 0 ${Math.round(this._viewWidth * this._viewScale)} ${Math.round(30 * this._viewScale)}`;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "frame-bar", children: [this.props.context.activeAnimations.length > 0 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "angle-unit" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "frames", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { id: "svg-frames", viewBox: viewBox, ref: this._svgHost, children: this._buildFrames() }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/graphComponent.js":
/*!***************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/graphComponent.js ***!
  \***************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1658222__) => {

"use strict";
__nested_webpack_require_1658222__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1658222__.d(__nested_webpack_exports__, {
/* harmony export */   GraphComponent: () => (/* binding */ GraphComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1658222__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1658222__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1658222__(/*! core/Maths/math.scalar */ "core/Misc/observable");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1658222__.n(core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _curve__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1658222__(/*! ./curve */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/curve.js");
/* harmony import */ var _keyPoint__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1658222__(/*! ./keyPoint */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/keyPoint.js");
/* harmony import */ var _curveComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1658222__(/*! ./curveComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/curveComponent.js");









class GraphComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._minScale = 0.5;
        this._maxScale = 5;
        this._graphAbsoluteWidth = 788;
        this._graphAbsoluteHeight = 357;
        this._viewWidth = 788;
        this._viewCurveWidth = 788;
        this._viewHeight = 357;
        this._viewScale = 1;
        this._offsetX = 0;
        this._offsetY = 0;
        this._graphOffsetX = 30;
        this.state = {};
        this._svgHost = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._svgHost2 = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._selectionRectangle = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._evaluateKeys();
        this.props.context.onHostWindowResized.add(() => {
            this._computeSizes();
        });
        this._onActiveAnimationChangedObserver = this.props.context.onActiveAnimationChanged.add(({ evaluateKeys = true, frame = true, range = true }) => {
            if (evaluateKeys) {
                this._evaluateKeys(frame, range);
            }
            this._computeSizes();
            this.forceUpdate();
        });
        this.props.context.onFrameRequired.add(() => {
            this._frameFromActiveKeys();
            this.forceUpdate();
        });
        this.props.context.onRangeUpdated.add(() => {
            this.forceUpdate();
        });
        // Delete keypoint
        this.props.context.onDeleteKeyActiveKeyPoints.add(() => {
            if (this.props.context.activeAnimations.length === 0 || !this.props.context.activeKeyPoints) {
                return;
            }
            for (const currentAnimation of this.props.context.activeAnimations) {
                const keys = currentAnimation.getKeys();
                const newKeys = keys.slice(0);
                let deletedFrame = null;
                for (const keyPoint of this.props.context.activeKeyPoints) {
                    // Cannot delete 0 and last
                    if (keyPoint.props.keyId === 0 || keyPoint.props.keyId === keys.length - 1) {
                        continue;
                    }
                    const key = keys[keyPoint.props.keyId];
                    const keyIndex = newKeys.indexOf(key);
                    if (keyIndex > -1) {
                        newKeys.splice(keyIndex, 1);
                        if (deletedFrame === null) {
                            deletedFrame = key.frame;
                        }
                    }
                }
                this.props.context.stop();
                currentAnimation.setKeys(newKeys);
                if (deletedFrame !== null) {
                    this.props.context.moveToFrame(deletedFrame);
                }
            }
            this._evaluateKeys(false, false);
            this.props.context.activeKeyPoints = [];
            this.props.context.onActiveKeyPointChanged.notifyObservers();
            this.props.context.onActiveAnimationChanged.notifyObservers({ evaluateKeys: false });
            this.forceUpdate();
        });
        // Create or Update keypoint
        this.props.context.onCreateOrUpdateKeyPointRequired.add(() => {
            if (this.props.context.activeAnimations.length === 0) {
                return;
            }
            for (const currentAnimation of this.props.context.activeAnimations) {
                if (currentAnimation.dataType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_QUATERNION) {
                    continue;
                }
                const keys = currentAnimation.getKeys();
                const currentFrame = this.props.context.activeFrame;
                let indexToAdd = -1;
                for (const key of keys) {
                    if (key.frame < currentFrame) {
                        indexToAdd++;
                    }
                    else {
                        break;
                    }
                }
                let value;
                if (this.props.context.target) {
                    value = this.props.context.target;
                    for (const path of currentAnimation.targetPropertyPath) {
                        value = value[path];
                    }
                    if (value.clone) {
                        value = value.clone();
                    }
                }
                else {
                    value = currentAnimation.evaluate(currentFrame);
                }
                const leftKey = keys[indexToAdd];
                const rightKey = keys[indexToAdd + 1];
                if (Math.floor(currentFrame - leftKey?.frame) === 0) {
                    // Key already exists, update it
                    leftKey.value = value;
                }
                else if (Math.floor(rightKey?.frame - currentFrame) === 0) {
                    // Key already exists, update it
                    rightKey.value = value;
                }
                else {
                    // Key doesn't exist, create it (same operations) as
                    // the new key listener
                    const newKey = {
                        frame: currentFrame,
                        value: value,
                        lockedTangent: true,
                    };
                    if (leftKey?.outTangent !== undefined && rightKey?.inTangent !== undefined) {
                        let derivative = null;
                        const invFrameDelta = 1.0 / (rightKey.frame - leftKey.frame);
                        const cutTime = (currentFrame - leftKey.frame) * invFrameDelta;
                        switch (currentAnimation.dataType) {
                            case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_FLOAT: {
                                derivative = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Scalar.Hermite1stDerivative(leftKey.value * invFrameDelta, leftKey.outTangent, rightKey.value * invFrameDelta, rightKey.inTangent, cutTime);
                                break;
                            }
                            case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR2: {
                                derivative = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector2.Hermite1stDerivative(leftKey.value.scale(invFrameDelta), leftKey.outTangent, rightKey.value.scale(invFrameDelta), rightKey.inTangent, cutTime);
                                break;
                            }
                            case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR3: {
                                derivative = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3.Hermite1stDerivative(leftKey.value.scale(invFrameDelta), leftKey.outTangent, rightKey.value.scale(invFrameDelta), rightKey.inTangent, cutTime);
                                break;
                            }
                            case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_COLOR3:
                                derivative = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3.Hermite1stDerivative(leftKey.value.scale(invFrameDelta), leftKey.outTangent, rightKey.value.scale(invFrameDelta), rightKey.inTangent, cutTime);
                                break;
                            case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_COLOR4:
                                derivative = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4.Hermite1stDerivative(leftKey.value.scale(invFrameDelta), leftKey.outTangent, rightKey.value.scale(invFrameDelta), rightKey.inTangent, cutTime);
                                break;
                        }
                        if (derivative !== null) {
                            newKey.inTangent = derivative;
                            newKey.outTangent = derivative.clone ? derivative.clone() : derivative;
                        }
                    }
                    keys.splice(indexToAdd + 1, 0, newKey);
                }
                currentAnimation.setKeys(keys);
            }
            this._evaluateKeys(false, false);
            this.props.context.activeKeyPoints = [];
            this.props.context.onActiveKeyPointChanged.notifyObservers();
            this.props.context.onActiveAnimationChanged.notifyObservers({ evaluateKeys: false });
            this.forceUpdate();
        });
    }
    componentWillUnmount() {
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
    }
    _computeSizes() {
        if (!this._svgHost.current || !this._svgHost2.current) {
            return;
        }
        this._viewWidth = this._svgHost.current.clientWidth;
        this._viewCurveWidth = this._svgHost2.current.clientWidth;
        this._viewHeight = this._svgHost.current.clientHeight;
        this.forceUpdate();
    }
    _setDefaultInTangent(keyId) {
        for (const curve of this._curves) {
            curve.storeDefaultInTangent(keyId);
        }
    }
    _setDefaultOutTangent(keyId) {
        for (const curve of this._curves) {
            curve.storeDefaultOutTangent(keyId);
        }
    }
    _evaluateKeys(frame = true, range = true) {
        if (this.props.context.activeAnimations.length === 0) {
            this._curves = [];
            return;
        }
        this._curves = [];
        for (const animation of this.props.context.activeAnimations) {
            const keys = animation.getKeys();
            const curves = [];
            switch (animation.dataType) {
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_FLOAT:
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#DB3E3E", animation));
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR2:
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#DB3E3E", animation, "x", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector2.Zero(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#51E22D", animation, "y", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector2.Zero(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR3:
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#DB3E3E", animation, "x", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#51E22D", animation, "y", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#00A3FF", animation, "z", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_COLOR3:
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#DB3E3E", animation, "r", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3.Black(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#51E22D", animation, "g", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3.Black(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#00A3FF", animation, "b", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3.Black(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_QUATERNION:
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#DB3E3E", animation, "x", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion.Zero(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#51E22D", animation, "y", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion.Zero(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#00A3FF", animation, "z", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion.Zero(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#8700FF", animation, "w", () => core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion.Zero(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_COLOR4:
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#DB3E3E", animation, "r", () => new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#51E22D", animation, "g", () => new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#00A3FF", animation, "b", () => new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    curves.push(new _curve__WEBPACK_IMPORTED_MODULE_3__.Curve("#8700FF", animation, "a", () => new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(), (keyId) => this._setDefaultInTangent(keyId), (keyId) => this._setDefaultOutTangent(keyId)));
                    break;
            }
            const values = this._extractValuesFromKeys(keys, animation.dataType, curves);
            this._curves.push(...curves);
            if (range) {
                this._minValue = Math.min(this._minValue, values.min);
                this._maxValue = Math.max(this._maxValue, values.max);
                this._minFrame = Math.min(this._minFrame, keys[0].frame);
                this._maxFrame = Math.max(this._maxFrame, keys[keys.length - 1].frame);
            }
        }
        if (frame) {
            this._frameFromActiveKeys();
        }
    }
    _extractValuesFromKeys(keys, dataType, curvesToPushTo, propertyFilter) {
        let minValue = Number.MAX_VALUE;
        let maxValue = -Number.MAX_VALUE;
        for (const key of keys) {
            let lockedTangent = true;
            if (key.lockedTangent !== undefined) {
                lockedTangent = key.lockedTangent;
            }
            switch (dataType) {
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_FLOAT:
                    minValue = Math.min(minValue, key.value);
                    maxValue = Math.max(maxValue, key.value);
                    if (curvesToPushTo) {
                        curvesToPushTo[0].keys.push({
                            frame: key.frame,
                            value: key.value,
                            inTangent: key.inTangent,
                            outTangent: key.outTangent,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                    }
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR2:
                    if (!propertyFilter || propertyFilter === "x") {
                        minValue = Math.min(minValue, key.value.x);
                        maxValue = Math.max(maxValue, key.value.x);
                    }
                    if (!propertyFilter || propertyFilter === "y") {
                        minValue = Math.min(minValue, key.value.y);
                        maxValue = Math.max(maxValue, key.value.y);
                    }
                    if (curvesToPushTo) {
                        curvesToPushTo[0].keys.push({
                            frame: key.frame,
                            value: key.value.x,
                            inTangent: key.inTangent?.x,
                            outTangent: key.outTangent?.x,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[1].keys.push({
                            frame: key.frame,
                            value: key.value.y,
                            inTangent: key.inTangent?.y,
                            outTangent: key.outTangent?.y,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                    }
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR3:
                    if (!propertyFilter || propertyFilter === "x") {
                        minValue = Math.min(minValue, key.value.x);
                        maxValue = Math.max(maxValue, key.value.x);
                    }
                    if (!propertyFilter || propertyFilter === "y") {
                        minValue = Math.min(minValue, key.value.y);
                        maxValue = Math.max(maxValue, key.value.y);
                    }
                    if (!propertyFilter || propertyFilter === "z") {
                        minValue = Math.min(minValue, key.value.z);
                        maxValue = Math.max(maxValue, key.value.z);
                    }
                    if (curvesToPushTo) {
                        curvesToPushTo[0].keys.push({
                            frame: key.frame,
                            value: key.value.x,
                            inTangent: key.inTangent?.x,
                            outTangent: key.outTangent?.x,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[1].keys.push({
                            frame: key.frame,
                            value: key.value.y,
                            inTangent: key.inTangent?.y,
                            outTangent: key.outTangent?.y,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[2].keys.push({
                            frame: key.frame,
                            value: key.value.z,
                            inTangent: key.inTangent?.z,
                            outTangent: key.outTangent?.z,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                    }
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_COLOR3:
                    if (!propertyFilter || propertyFilter === "r") {
                        minValue = Math.min(minValue, key.value.r);
                        maxValue = Math.max(maxValue, key.value.r);
                    }
                    if (!propertyFilter || propertyFilter === "g") {
                        minValue = Math.min(minValue, key.value.g);
                        maxValue = Math.max(maxValue, key.value.g);
                    }
                    if (!propertyFilter || propertyFilter === "b") {
                        minValue = Math.min(minValue, key.value.b);
                        maxValue = Math.max(maxValue, key.value.b);
                    }
                    if (curvesToPushTo) {
                        curvesToPushTo[0].keys.push({
                            frame: key.frame,
                            value: key.value.r,
                            inTangent: key.inTangent?.r,
                            outTangent: key.outTangent?.r,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[1].keys.push({
                            frame: key.frame,
                            value: key.value.g,
                            inTangent: key.inTangent?.g,
                            outTangent: key.outTangent?.g,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[2].keys.push({
                            frame: key.frame,
                            value: key.value.b,
                            inTangent: key.inTangent?.b,
                            outTangent: key.outTangent?.b,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                    }
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_QUATERNION:
                    if (!propertyFilter || propertyFilter === "x") {
                        minValue = Math.min(minValue, key.value.x);
                        maxValue = Math.max(maxValue, key.value.x);
                    }
                    if (!propertyFilter || propertyFilter === "y") {
                        minValue = Math.min(minValue, key.value.y);
                        maxValue = Math.max(maxValue, key.value.y);
                    }
                    if (!propertyFilter || propertyFilter === "z") {
                        minValue = Math.min(minValue, key.value.z);
                        maxValue = Math.max(maxValue, key.value.z);
                    }
                    if (!propertyFilter || propertyFilter === "w") {
                        minValue = Math.min(minValue, key.value.w);
                        maxValue = Math.max(maxValue, key.value.w);
                    }
                    if (curvesToPushTo) {
                        curvesToPushTo[0].keys.push({
                            frame: key.frame,
                            value: key.value.x,
                            inTangent: key.inTangent?.x,
                            outTangent: key.outTangent?.x,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[1].keys.push({
                            frame: key.frame,
                            value: key.value.y,
                            inTangent: key.inTangent?.y,
                            outTangent: key.outTangent?.y,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[2].keys.push({
                            frame: key.frame,
                            value: key.value.z,
                            inTangent: key.inTangent?.z,
                            outTangent: key.outTangent?.z,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[3].keys.push({
                            frame: key.frame,
                            value: key.value.w,
                            inTangent: key.inTangent?.w,
                            outTangent: key.outTangent?.w,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                    }
                    break;
                case core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_COLOR4:
                    if (!propertyFilter || propertyFilter === "r") {
                        minValue = Math.min(minValue, key.value.r);
                        maxValue = Math.max(maxValue, key.value.r);
                    }
                    if (!propertyFilter || propertyFilter === "g") {
                        minValue = Math.min(minValue, key.value.g);
                        maxValue = Math.max(maxValue, key.value.g);
                    }
                    if (!propertyFilter || propertyFilter === "b") {
                        minValue = Math.min(minValue, key.value.b);
                        maxValue = Math.max(maxValue, key.value.b);
                    }
                    if (!propertyFilter || propertyFilter === "a") {
                        minValue = Math.min(minValue, key.value.a);
                        maxValue = Math.max(maxValue, key.value.a);
                    }
                    if (curvesToPushTo) {
                        curvesToPushTo[0].keys.push({
                            frame: key.frame,
                            value: key.value.r,
                            inTangent: key.inTangent?.r,
                            outTangent: key.outTangent?.r,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[1].keys.push({
                            frame: key.frame,
                            value: key.value.g,
                            inTangent: key.inTangent?.g,
                            outTangent: key.outTangent?.g,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[2].keys.push({
                            frame: key.frame,
                            value: key.value.b,
                            inTangent: key.inTangent?.b,
                            outTangent: key.outTangent?.b,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                        curvesToPushTo[3].keys.push({
                            frame: key.frame,
                            value: key.value.a,
                            inTangent: key.inTangent?.a,
                            outTangent: key.outTangent?.a,
                            lockedTangent: lockedTangent,
                            interpolation: key.interpolation,
                        });
                    }
                    break;
            }
        }
        return {
            min: minValue,
            max: maxValue,
        };
    }
    _convertX(x) {
        let diff = this._maxFrame - this._minFrame;
        if (diff === 0) {
            diff = 1;
        }
        return ((x - this._minFrame) / diff) * this._graphAbsoluteWidth;
    }
    _invertX(x) {
        return (x / this._graphAbsoluteWidth) * (this._maxFrame - this._minFrame) + this._minFrame;
    }
    _convertY(y) {
        let diff = this._maxValue - this._minValue;
        if (diff === 0) {
            diff = 1;
        }
        return this._graphAbsoluteHeight - ((y - this._minValue) / diff) * this._graphAbsoluteHeight;
    }
    _invertY(y) {
        let diff = this._maxValue - this._minValue;
        if (diff === 0) {
            diff = 1;
        }
        return ((this._graphAbsoluteHeight - y) / this._graphAbsoluteHeight) * diff + this._minValue;
    }
    _buildFrameIntervalAxis() {
        if (this.props.context.activeAnimations.length === 0) {
            return null;
        }
        const maxFrame = this.props.context.referenceMaxFrame;
        const range = maxFrame;
        let offset = this.props.context.activeAnimations[0].framePerSecond;
        const convertRatio = range / this._graphAbsoluteWidth;
        const steps = [];
        if (offset === 0) {
            offset = 1;
        }
        const startPosition = this._offsetX * convertRatio;
        const start = -((startPosition / offset) | 0) * offset;
        const end = start + (this._viewWidth - 40) * this._viewScale * convertRatio;
        for (let step = start - offset; step <= end + offset; step += offset) {
            steps.push(step);
        }
        return steps.map((s) => {
            const x = s / convertRatio;
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: 0, x2: x, y2: this._viewHeight * this._viewScale, style: {
                        stroke: "#666666",
                        strokeWidth: 1,
                    } }, "line" + s) }, "axis" + s));
        });
    }
    _buildYAxis() {
        if (this.props.context.activeAnimations.length === 0) {
            return null;
        }
        const stepCounts = 10;
        const range = this._maxValue !== this._minValue ? this._maxValue - this._minValue : 1;
        let offset = (range / stepCounts) * this._viewScale;
        const convertRatio = range / this._graphAbsoluteHeight;
        const steps = [];
        // Get precision
        const a = 0;
        const b = offset;
        let precision = 2;
        while (a.toFixed(precision) === b.toFixed(precision)) {
            precision++;
        }
        // Make sure we have an even number with the correct number of decimals
        const pow = Math.pow(10, precision);
        offset = Math.round(offset * pow);
        if (offset % 2 !== 0) {
            offset -= 1;
        }
        offset /= pow;
        // Evaluate limits
        const startPosition = (this._viewHeight * this._viewScale - this._graphAbsoluteHeight - this._offsetY) * convertRatio;
        const start = Math.ceil((this._minValue - ((startPosition / offset) | 0) * offset) / offset) * offset;
        const end = Math.round((start + this._viewHeight * this._viewScale * convertRatio) / offset) * offset;
        for (let step = start - offset; step <= end + offset; step += offset) {
            steps.push(step);
        }
        return steps.map((s) => {
            const y = this._graphAbsoluteHeight - (s - this._minValue) / convertRatio;
            let text = s.toFixed(precision);
            text = parseFloat(text).toFixed(precision); // Avoid -0.00 (negative zero)
            const zero = 0.0;
            const isZero = text === zero.toFixed(precision);
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: this._graphOffsetX * this._viewScale, y1: y, x2: this._viewWidth * this._viewScale, y2: y, style: {
                            stroke: isZero ? "#666666" : "#333333",
                            strokeWidth: isZero ? 1.0 : 0.5,
                        } }, "line" + s), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: 0, y: y, dx: `${15 * this._viewScale}px`, textAnchor: "middle", dy: `${3 * this._viewScale}px`, style: {
                            fontFamily: "acumin-pro-condensed",
                            fontSize: `${10 * this._viewScale}px`,
                            fill: "#888888",
                            textAlign: "center",
                        }, children: text }, "label" + s)] }, "axis" + s));
        });
    }
    _frameFromActiveKeys() {
        if (this.props.context.activeAnimations.length === 0) {
            return;
        }
        this._offsetX = 20;
        this._offsetY = 20;
        let minValue = Number.MAX_VALUE;
        let maxValue = -Number.MAX_VALUE;
        let minFrame = Number.MAX_VALUE;
        let maxFrame = -Number.MAX_VALUE;
        let hasRange = false;
        for (const animation of this.props.context.activeAnimations) {
            let propertyFilter = undefined;
            const activeChannel = this.props.context.getActiveChannel(animation);
            if (activeChannel) {
                const activeCurve = this._curves.filter((c) => c.color === activeChannel)[0];
                if (activeCurve) {
                    propertyFilter = activeCurve.property;
                }
            }
            let keys = animation.getKeys();
            // Only keep selected keys, the previous sibling to the first key, and the next sibling of the last key
            if (this.props.context.activeKeyPoints && this.props.context.activeKeyPoints.length > 0) {
                const newKeys = [];
                for (let i = 0; i < this.props.context.activeKeyPoints.length; i++) {
                    const keyPoint = this.props.context.activeKeyPoints[i];
                    if (keyPoint.props.curve.animation === animation) {
                        newKeys.push(keys[keyPoint.props.keyId]);
                        if (i === 0 && keyPoint.props.keyId >= 1) {
                            newKeys.unshift(keys[keyPoint.props.keyId - 1]);
                        }
                        if (i === this.props.context.activeKeyPoints.length - 1 && keyPoint.props.keyId < keys.length - 1) {
                            newKeys.push(keys[keyPoint.props.keyId + 1]);
                        }
                    }
                }
                keys = newKeys;
            }
            if (keys.length === 0) {
                continue;
            }
            const values = this._extractValuesFromKeys(keys, animation.dataType, undefined, propertyFilter);
            minValue = Math.min(minValue, values.min);
            maxValue = Math.max(maxValue, values.max);
            minFrame = Math.min(minFrame, keys[0].frame);
            maxFrame = Math.max(maxFrame, keys[keys.length - 1].frame);
            hasRange = true;
        }
        if (!hasRange) {
            return;
        }
        this._minFrame = minFrame;
        this._maxFrame = maxFrame;
        this._minValue = minValue;
        this._maxValue = maxValue;
        this.props.context.referenceMinFrame = this._minFrame;
        this.props.context.referenceMaxFrame = this._maxFrame;
        const frameConvert = Math.abs(this._convertX(this._maxFrame) - this._convertX(this._minFrame)) + this._offsetX * 2;
        const valueConvert = this._minValue !== this._maxValue ? Math.abs(this._convertY(this._minValue) - this._convertY(this._maxValue)) + this._offsetY * 2 : 1;
        const scaleWidth = frameConvert / this._viewCurveWidth;
        const scaleHeight = valueConvert / this._viewHeight;
        this._viewScale = scaleWidth * this._viewHeight < valueConvert ? scaleHeight : scaleWidth;
        this.props.context.onGraphMoved.notifyObservers(this._offsetX);
        this.props.context.onGraphScaled.notifyObservers(this._viewScale);
    }
    _dropKeyFrames(curve) {
        return curve.keys.map((key, i) => {
            const x = this._convertX(key.frame);
            const y = this._convertY(key.value);
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_keyPoint__WEBPACK_IMPORTED_MODULE_4__.KeyPointComponent, { x: x, y: y, context: this.props.context, scale: this._viewScale, getPreviousX: () => (i > 0 ? this._convertX(curve.keys[i - 1].frame) : null), getNextX: () => (i < curve.keys.length - 1 ? this._convertX(curve.keys[i + 1].frame) : null), channel: curve.color, keyId: i, curve: curve, invertX: (x) => this._invertX(x), invertY: (y) => this._invertY(y), convertX: (x) => this._convertX(x), convertY: (y) => this._convertY(y), onFrameValueChanged: (value) => {
                    curve.updateKeyFrame(i, value);
                    this.props.context.refreshTarget();
                }, onKeyValueChanged: (value) => {
                    curve.updateKeyValue(i, value);
                    this.props.context.refreshTarget();
                } }, "curve-" + i));
        });
    }
    _onPointerDown(evt) {
        if (evt.nativeEvent.target.id !== "svg-graph-curves") {
            return;
        }
        evt.preventDefault();
        this._pointerIsDown = true;
        evt.currentTarget.setPointerCapture(evt.pointerId);
        this._sourcePointerX = evt.nativeEvent.offsetX;
        this._sourcePointerY = evt.nativeEvent.offsetY;
        const isMiddleButton = evt.nativeEvent.which == 2 || evt.button == 4;
        this._inSelectionMode = !isMiddleButton && !evt.altKey;
        if (this._inSelectionMode) {
            this._selectionStartX = this._sourcePointerX + 40;
            this._selectionStartY = this._sourcePointerY;
        }
    }
    _onPointerMove(evt) {
        if (!this._pointerIsDown) {
            return;
        }
        if (this._inSelectionMode) {
            const style = this._selectionRectangle.current.style;
            style.visibility = "visible";
            const localX = evt.nativeEvent.offsetX;
            const localY = evt.nativeEvent.offsetY;
            if (localX > this._selectionStartX) {
                style.left = `${this._selectionStartX}px`;
                style.width = `${localX - this._selectionStartX}px`;
            }
            else {
                style.left = `${localX}px`;
                style.width = `${this._selectionStartX - localX}px`;
            }
            if (localY > this._selectionStartY) {
                style.top = `${this._selectionStartY}px`;
                style.height = `${localY - this._selectionStartY}px`;
            }
            else {
                style.top = `${localY}px`;
                style.height = `${this._selectionStartY - localY}px`;
            }
            if (localX !== this._selectionStartX || localY !== this._selectionStartY) {
                this._selectionMade = true;
            }
            this.props.context.onSelectionRectangleMoved.notifyObservers(this._selectionRectangle.current.getBoundingClientRect());
            return;
        }
        this._offsetX += (evt.nativeEvent.offsetX - this._sourcePointerX) * this._viewScale;
        this._offsetY += (evt.nativeEvent.offsetY - this._sourcePointerY) * this._viewScale;
        this._sourcePointerX = evt.nativeEvent.offsetX;
        this._sourcePointerY = evt.nativeEvent.offsetY;
        this.props.context.onGraphMoved.notifyObservers(this._offsetX);
        this.forceUpdate();
    }
    _onPointerUp(evt) {
        this._pointerIsDown = false;
        evt.currentTarget.releasePointerCapture(evt.pointerId);
        this._selectionRectangle.current.style.visibility = "hidden";
        if (!this._inSelectionMode || !this._selectionMade) {
            this.props.context.clearSelection();
        }
        this._selectionMade = false;
    }
    _onWheel(evt) {
        const delta = evt.deltaY < 0 ? -0.05 : 0.05;
        const oldScale = this._viewScale;
        this._viewScale = Math.min(Math.max(this._minScale, this._viewScale + delta * this._viewScale), this._maxScale);
        const clientX = evt.nativeEvent.offsetX;
        const clientY = evt.nativeEvent.offsetY;
        const xDiff = clientX * oldScale - clientX * this._viewScale;
        const yDiff = clientY * oldScale - clientY * this._viewScale;
        this._offsetX -= xDiff;
        this._offsetY -= yDiff;
        this.forceUpdate();
        evt.stopPropagation();
        this.props.context.onGraphMoved.notifyObservers(this._offsetX);
        this.props.context.onGraphScaled.notifyObservers(this._viewScale);
    }
    render() {
        const scale = this._viewScale;
        const viewBoxScalingCurves = `${-this._offsetX} ${-this._offsetY} ${Math.round(scale * this._viewCurveWidth)} ${Math.round(scale * this._viewHeight)}`;
        const viewBoxScalingGrid = `0 ${-this._offsetY} ${Math.round(scale * this._viewWidth)} ${Math.round(scale * this._viewHeight)}`;
        const viewBoxHorizontal = `${-this._offsetX} 0 ${Math.round((this._viewWidth - 40) * this._viewScale)}  ${Math.round(scale * this._viewHeight)}`;
        let activeBoxLeft = 0;
        let activeBoxRight = 0;
        if (this.props.context.activeAnimations.length !== 0) {
            const minFrame = this.props.context.referenceMinFrame;
            const maxFrame = this.props.context.referenceMaxFrame;
            activeBoxLeft = (((this.props.context.fromKey - minFrame) / (maxFrame - minFrame)) * this._graphAbsoluteWidth + this._offsetX) / this._viewScale;
            activeBoxRight = (((this.props.context.toKey - minFrame) / (maxFrame - minFrame)) * this._graphAbsoluteWidth + this._offsetX) / this._viewScale;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "graph", onWheel: (evt) => this._onWheel(evt), onPointerDown: (evt) => this._onPointerDown(evt), onPointerMove: (evt) => this._onPointerMove(evt), onPointerUp: (evt) => this._onPointerUp(evt), children: [this.props.context.activeAnimations.length !== 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "dark-rectangle", style: {
                        left: activeBoxLeft + "px",
                        width: activeBoxRight - activeBoxLeft + "px",
                    } })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "block-rectangle" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { id: "svg-graph-grid", viewBox: viewBoxScalingGrid, ref: this._svgHost, children: this._buildYAxis() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { id: "svg-graph-horizontal", viewBox: viewBoxHorizontal, children: this._buildFrameIntervalAxis() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { ref: this._svgHost2, id: "svg-graph-curves", tabIndex: 0, viewBox: viewBoxScalingCurves, children: [this._curves.map((c, i) => {
                            return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_curveComponent__WEBPACK_IMPORTED_MODULE_5__.CurveComponent, { context: this.props.context, curve: c, convertX: (x) => this._convertX(x), convertY: (y) => this._convertY(y) }, i);
                        }), this._curves.map((c) => {
                            return this._dropKeyFrames(c);
                        })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: this._selectionRectangle, id: "selection-rectangle" })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/keyPoint.js":
/*!*********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/keyPoint.js ***!
  \*********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1703974__) => {

"use strict";
__nested_webpack_require_1703974__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1703974__.d(__nested_webpack_exports__, {
/* harmony export */   KeyPointComponent: () => (/* binding */ KeyPointComponent),
/* harmony export */   SelectionState: () => (/* binding */ SelectionState)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1703974__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1703974__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1703974__.n(core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1703974__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _assets_keyInactiveIcon_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1703974__(/*! ../assets/keyInactiveIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keyInactiveIcon.svg");
/* harmony import */ var _assets_keySelectedIcon_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1703974__(/*! ../assets/keySelectedIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keySelectedIcon.svg");
/* harmony import */ var _assets_keyActiveIcon_svg__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1703974__(/*! ../assets/keyActiveIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keyActiveIcon.svg");







var SelectionState;
(function (SelectionState) {
    SelectionState[SelectionState["None"] = 0] = "None";
    SelectionState[SelectionState["Selected"] = 1] = "Selected";
    SelectionState[SelectionState["Siblings"] = 2] = "Siblings";
})(SelectionState || (SelectionState = {}));
var ControlMode;
(function (ControlMode) {
    ControlMode[ControlMode["None"] = 0] = "None";
    ControlMode[ControlMode["Key"] = 1] = "Key";
    ControlMode[ControlMode["TangentLeft"] = 2] = "TangentLeft";
    ControlMode[ControlMode["TangentRight"] = 3] = "TangentRight";
})(ControlMode || (ControlMode = {}));
class KeyPointComponent extends react__WEBPACK_IMPORTED_MODULE_2__.Component {
    constructor(props) {
        super(props);
        this._controlMode = ControlMode.None;
        this._lockX = false;
        this._lockY = false;
        this._accumulatedX = 0;
        this._accumulatedY = 0;
        this.state = { selectedState: SelectionState.None, x: this.props.x, y: this.props.y, tangentSelectedIndex: -1 };
        this._svgHost = react__WEBPACK_IMPORTED_MODULE_2__.createRef();
        this._keyPointSVG = react__WEBPACK_IMPORTED_MODULE_2__.createRef();
        this._onSelectAllKeysObserver = this.props.context.onSelectAllKeys.add(() => {
            const isSelected = this.props.context.activeKeyPoints?.indexOf(this) !== -1;
            if (isSelected) {
                return;
            }
            this.props.context.activeKeyPoints?.push(this);
        });
        this._onUnifyTangentRequiredObserver = this.props.context.onUnifyTangentRequired.add(() => {
            const isSelected = this.props.context.activeKeyPoints?.indexOf(this) !== -1;
            if (!isSelected) {
                return;
            }
            this._unifyTangent();
        });
        this._onBreakTangentRequiredObserver = this.props.context.onBreakTangentRequired.add(() => {
            const isSelected = this.props.context.activeKeyPoints?.indexOf(this) !== -1;
            if (!isSelected) {
                return;
            }
            this._breakTangent();
        });
        this._onFlattenTangentRequiredObserver = this.props.context.onFlattenTangentRequired.add(() => {
            const isSelected = this.props.context.activeKeyPoints?.indexOf(this) !== -1;
            if (!isSelected) {
                return;
            }
            this._flattenTangent();
        });
        this._onLinearTangentRequiredObserver = this.props.context.onLinearTangentRequired.add(() => {
            const isSelected = this.props.context.activeKeyPoints?.indexOf(this) !== -1;
            if (!isSelected) {
                return;
            }
            this._linearTangent();
        });
        this._onStepTangentRequiredObserver = this.props.context.onStepTangentRequired.add(() => {
            const isSelected = this.props.context.activeKeyPoints?.indexOf(this) !== -1;
            if (!isSelected) {
                return;
            }
            this._stepTangent();
        });
        this._onSelectionRectangleMovedObserver = this.props.context.onSelectionRectangleMoved.add((rect1) => {
            if (!this._keyPointSVG.current) {
                return;
            }
            const animationType = this.props.curve.animation.dataType;
            const isQuaternionAnimation = animationType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Animation.ANIMATIONTYPE_QUATERNION;
            if (isQuaternionAnimation) {
                return;
            }
            const rect2 = this._keyPointSVG.current.getBoundingClientRect();
            const overlap = !(rect1.right < rect2.left || rect1.left > rect2.right || rect1.bottom < rect2.top || rect1.top > rect2.bottom);
            if (!this.props.context.activeKeyPoints) {
                this.props.context.activeKeyPoints = [];
            }
            const index = this.props.context.activeKeyPoints.indexOf(this);
            if (overlap) {
                if (index === -1) {
                    this.props.context.activeKeyPoints.push(this);
                    this.props.context.onActiveKeyPointChanged.notifyObservers();
                }
            }
            else {
                if (index > -1) {
                    this.props.context.activeKeyPoints.splice(index, 1);
                    this.props.context.onActiveKeyPointChanged.notifyObservers();
                }
            }
        });
        this._onMainKeyPointSetObserver = this.props.context.onMainKeyPointSet.add(() => {
            if (!this.props.context.mainKeyPoint || this.props.context.mainKeyPoint === this) {
                return;
            }
            this._offsetXToMain = this.state.x - this.props.context.mainKeyPoint?.state.x;
            this._offsetYToMain = this.state.y - this.props.context.mainKeyPoint?.state.y;
        });
        this._onMainKeyPointMovedObserver = this.props.context.onMainKeyPointMoved.add(() => {
            const mainKeyPoint = this.props.context.mainKeyPoint;
            if (mainKeyPoint === this || !mainKeyPoint) {
                return;
            }
            if (this.state.selectedState !== SelectionState.None && this.props.keyId !== 0) {
                // Move frame for every selected or siblins
                const newFrameValue = mainKeyPoint.state.x + this._offsetXToMain;
                this.setState({ x: newFrameValue });
                this.props.onFrameValueChanged(this.props.invertX(newFrameValue));
            }
            if (this.state.selectedState === SelectionState.Selected) {
                // Move value only for selected
                const newY = mainKeyPoint.state.y + this._offsetYToMain;
                this.setState({ y: newY });
                this.props.onKeyValueChanged(this.props.invertY(newY));
            }
        });
        this._onActiveKeyPointChangedObserver = this.props.context.onActiveKeyPointChanged.add(() => {
            const isSelected = this.props.context.activeKeyPoints?.indexOf(this) !== -1;
            if (!isSelected && this.props.context.activeKeyPoints) {
                const curve = this.props.curve;
                let state = SelectionState.None;
                for (const activeKeyPoint of this.props.context.activeKeyPoints) {
                    if (activeKeyPoint.props.keyId === this.props.keyId && curve !== activeKeyPoint.props.curve && curve.animation === activeKeyPoint.props.curve.animation) {
                        state = SelectionState.Siblings;
                        break;
                    }
                }
                this.setState({ selectedState: state, tangentSelectedIndex: -1 });
            }
            else {
                this.setState({ selectedState: SelectionState.Selected, tangentSelectedIndex: -1 });
            }
            if (isSelected) {
                this.props.context.onFrameSet.notifyObservers(this.props.invertX(this.state.x));
                this.props.context.onValueSet.notifyObservers(this.props.invertY(this.state.y));
            }
        });
        this._onActiveKeyFrameChangedObserver = this.props.context.onActiveKeyFrameChanged.add((newFrameValue) => {
            if (this.state.selectedState !== SelectionState.Siblings || this.props.context.mainKeyPoint) {
                return;
            }
            this.setState({ x: newFrameValue });
            this.props.onFrameValueChanged(this.props.invertX(newFrameValue));
        });
        // Values set via the UI
        this._onFrameManuallyEnteredObserver = this.props.context.onFrameManuallyEntered.add((newValue) => {
            if (this.state.selectedState === SelectionState.None) {
                return;
            }
            let newX = this.props.convertX(newValue);
            // Checks
            const previousX = this.props.getPreviousX();
            const nextX = this.props.getNextX();
            if (previousX !== null) {
                newX = Math.max(previousX, newX);
            }
            if (nextX !== null) {
                newX = Math.min(nextX, newX);
            }
            const frame = this.props.invertX(newX);
            this.setState({ x: newX });
            this.props.onFrameValueChanged(frame);
        });
        this._onValueManuallyEnteredObserver = this.props.context.onValueManuallyEntered.add((newValue) => {
            if (this.state.selectedState !== SelectionState.Selected) {
                return;
            }
            const newY = this.props.convertY(newValue);
            this.setState({ y: newY });
            this.props.onKeyValueChanged(newValue);
        });
    }
    componentWillUnmount() {
        if (this._onSelectAllKeysObserver) {
            this.props.context.onSelectAllKeys.remove(this._onSelectAllKeysObserver);
        }
        if (this._onUnifyTangentRequiredObserver) {
            this.props.context.onUnifyTangentRequired.remove(this._onUnifyTangentRequiredObserver);
        }
        if (this._onBreakTangentRequiredObserver) {
            this.props.context.onBreakTangentRequired.remove(this._onBreakTangentRequiredObserver);
        }
        if (this._onFlattenTangentRequiredObserver) {
            this.props.context.onFlattenTangentRequired.remove(this._onFlattenTangentRequiredObserver);
        }
        if (this._onLinearTangentRequiredObserver) {
            this.props.context.onLinearTangentRequired.remove(this._onLinearTangentRequiredObserver);
        }
        if (this._onStepTangentRequiredObserver) {
            this.props.context.onStepTangentRequired.remove(this._onStepTangentRequiredObserver);
        }
        if (this._onSelectionRectangleMovedObserver) {
            this.props.context.onSelectionRectangleMoved.remove(this._onSelectionRectangleMovedObserver);
        }
        if (this._onMainKeyPointSetObserver) {
            this.props.context.onMainKeyPointSet.remove(this._onMainKeyPointSetObserver);
        }
        if (this._onMainKeyPointMovedObserver) {
            this.props.context.onMainKeyPointMoved.remove(this._onMainKeyPointMovedObserver);
        }
        if (this._onActiveKeyPointChangedObserver) {
            this.props.context.onActiveKeyPointChanged.remove(this._onActiveKeyPointChangedObserver);
        }
        if (this._onActiveKeyFrameChangedObserver) {
            this.props.context.onActiveKeyFrameChanged.remove(this._onActiveKeyFrameChangedObserver);
        }
        if (this._onFrameManuallyEnteredObserver) {
            this.props.context.onFrameManuallyEntered.remove(this._onFrameManuallyEnteredObserver);
        }
        if (this._onValueManuallyEnteredObserver) {
            this.props.context.onValueManuallyEntered.remove(this._onValueManuallyEnteredObserver);
        }
    }
    shouldComponentUpdate(newProps, newState) {
        if (newProps !== this.props) {
            newState.x = newProps.x;
            newState.y = newProps.y;
        }
        return true;
    }
    _breakTangent() {
        this.props.context.onInterpolationModeSet.notifyObservers({ keyId: this.props.keyId, value: 0 /* AnimationKeyInterpolation.NONE */ });
        this.props.curve.updateLockedTangentMode(this.props.keyId, false);
        this.forceUpdate();
    }
    _unifyTangent() {
        this.props.context.onInterpolationModeSet.notifyObservers({ keyId: this.props.keyId, value: 0 /* AnimationKeyInterpolation.NONE */ });
        this.props.curve.updateLockedTangentMode(this.props.keyId, true);
        this.forceUpdate();
    }
    _flattenTangent() {
        this.props.context.onInterpolationModeSet.notifyObservers({ keyId: this.props.keyId, value: 0 /* AnimationKeyInterpolation.NONE */ });
        if (this.state.tangentSelectedIndex === -1 || this.state.tangentSelectedIndex === 0) {
            if (this.props.keyId !== 0) {
                this.props.curve.updateInTangentFromControlPoint(this.props.keyId, 0);
            }
        }
        if (this.state.tangentSelectedIndex === -1 || this.state.tangentSelectedIndex === 1) {
            if (this.props.keyId !== this.props.curve.keys.length - 1) {
                this.props.curve.updateOutTangentFromControlPoint(this.props.keyId, 0);
            }
        }
        this.forceUpdate();
    }
    _linearTangent() {
        this.props.context.onInterpolationModeSet.notifyObservers({ keyId: this.props.keyId, value: 0 /* AnimationKeyInterpolation.NONE */ });
        if (this.state.tangentSelectedIndex === -1 || this.state.tangentSelectedIndex === 0) {
            if (this.props.keyId !== 0) {
                this.props.curve.storeDefaultInTangent(this.props.keyId);
            }
        }
        if (this.state.tangentSelectedIndex === -1 || this.state.tangentSelectedIndex === 1) {
            if (this.props.keyId !== this.props.curve.keys.length - 1) {
                this.props.curve.storeDefaultOutTangent(this.props.keyId);
            }
        }
        this.props.curve.onDataUpdatedObservable.notifyObservers();
        this.forceUpdate();
    }
    _stepTangent() {
        this.props.context.onInterpolationModeSet.notifyObservers({ keyId: this.props.keyId, value: 1 /* AnimationKeyInterpolation.STEP */ });
        this.forceUpdate();
    }
    _select(allowMultipleSelection) {
        if (!this.props.context.activeKeyPoints) {
            return;
        }
        const index = this.props.context.activeKeyPoints.indexOf(this);
        if (index === -1) {
            if (!allowMultipleSelection) {
                this.props.context.activeKeyPoints = [];
            }
            this.props.context.activeKeyPoints.push(this);
            if (this.props.context.activeKeyPoints.length > 1) {
                // multi selection is engaged
                this.props.context.mainKeyPoint = this;
                this.props.context.onMainKeyPointSet.notifyObservers();
            }
            else {
                this.props.context.mainKeyPoint = null;
            }
        }
        else {
            if (allowMultipleSelection) {
                this.props.context.activeKeyPoints.splice(index, 1);
                this.props.context.mainKeyPoint = null;
            }
            else {
                if (this.props.context.activeKeyPoints.length > 1) {
                    this.props.context.mainKeyPoint = this;
                    this.props.context.onMainKeyPointSet.notifyObservers();
                }
                else {
                    this.props.context.mainKeyPoint = null;
                }
            }
        }
    }
    _onPointerDown(evt) {
        if (!this.props.context.activeKeyPoints) {
            this.props.context.activeKeyPoints = [];
        }
        evt.preventDefault();
        const isQuaternionAnimation = this.props.curve.animation.dataType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Animation.ANIMATIONTYPE_QUATERNION;
        if (isQuaternionAnimation) {
            return;
        }
        this._select(evt.nativeEvent.ctrlKey);
        this.props.context.onActiveKeyPointChanged.notifyObservers();
        this._pointerIsDown = true;
        evt.currentTarget.setPointerCapture(evt.pointerId);
        this._sourcePointerX = evt.nativeEvent.offsetX;
        this._sourcePointerY = evt.nativeEvent.offsetY;
        const target = evt.nativeEvent.target;
        if (target.tagName === "image" && !isQuaternionAnimation) {
            this._controlMode = ControlMode.Key;
            this.setState({ tangentSelectedIndex: -1 });
        }
        else if (target.classList.contains("left-tangent") && !isQuaternionAnimation) {
            this._controlMode = ControlMode.TangentLeft;
            this.setState({ tangentSelectedIndex: 0 });
        }
        else if (target.classList.contains("right-tangent") && !isQuaternionAnimation) {
            this._controlMode = ControlMode.TangentRight;
            this.setState({ tangentSelectedIndex: 1 });
        }
        this._lockX = false;
        this._lockY = false;
        this._accumulatedX = 0;
        this._accumulatedY = 0;
        evt.stopPropagation();
    }
    _extractSlope(vec, storedLength, isIn) {
        if (isIn && vec.x >= 0) {
            vec.x = -0.01;
        }
        else if (!isIn && vec.x <= 0) {
            vec.x = 0.01;
        }
        const currentPosition = vec.clone();
        currentPosition.normalize();
        currentPosition.scaleInPlace(storedLength);
        const keys = this.props.curve.keys;
        const value = isIn
            ? keys[this.props.keyId].value - this.props.invertY(currentPosition.y + this.state.y)
            : this.props.invertY(currentPosition.y + this.state.y) - keys[this.props.keyId].value;
        const frame = isIn
            ? keys[this.props.keyId].frame - this.props.invertX(currentPosition.x + this.state.x)
            : this.props.invertX(currentPosition.x + this.state.x) - keys[this.props.keyId].frame;
        return value / frame;
    }
    _processTangentMove(evt, vec, storedLength, isIn) {
        vec.x += (evt.nativeEvent.offsetX - this._sourcePointerX) * this.props.scale;
        vec.y += (evt.nativeEvent.offsetY - this._sourcePointerY) * this.props.scale;
        return this._extractSlope(vec, storedLength, isIn);
    }
    _onPointerMove(evt) {
        if (!this._pointerIsDown || this.state.selectedState !== SelectionState.Selected || this.props.context.hasActiveQuaternionAnimationKeyPoints()) {
            return;
        }
        if (this._controlMode === ControlMode.Key) {
            const diffX = evt.nativeEvent.offsetX - this._sourcePointerX;
            const diffY = evt.nativeEvent.offsetY - this._sourcePointerY;
            if (evt.shiftKey) {
                if (!this._lockX && !this._lockY) {
                    this._accumulatedX += Math.abs(diffX);
                    this._accumulatedY += Math.abs(diffY);
                    if (this._accumulatedX > 5 || this._accumulatedY > 5) {
                        if (this._accumulatedX > this._accumulatedY) {
                            this._lockY = true;
                        }
                        else {
                            this._lockX = true;
                        }
                    }
                }
            }
            else {
                this._lockX = false;
                this._lockY = false;
            }
            let newX = this.state.x + (this._lockX ? 0 : diffX * this.props.scale);
            let newY = this.state.y + (this._lockY ? 0 : diffY * this.props.scale);
            const previousX = this.props.getPreviousX();
            const nextX = this.props.getNextX();
            const epsilon = 0.01;
            if (previousX !== null) {
                newX = Math.max(previousX + epsilon, newX);
            }
            if (nextX !== null) {
                newX = Math.min(nextX - epsilon, newX);
            }
            if (this.props.keyId !== 0 && !(this.props.context.lockLastFrameFrame && this.props.keyId === this.props.curve.keys.length - 1)) {
                const frame = this.props.invertX(newX);
                this.props.onFrameValueChanged(frame);
                this.props.context.onFrameSet.notifyObservers(frame);
                if (newX !== this.state.x) {
                    this.props.context.onActiveKeyFrameChanged.notifyObservers(newX);
                }
            }
            else {
                newX = this.state.x;
            }
            if (this.props.context.lockLastFrameValue && this.props.keyId === this.props.curve.keys.length - 1) {
                newY = this.state.y;
            }
            const value = this.props.invertY(newY);
            this.props.onKeyValueChanged(value);
            this.props.context.onValueSet.notifyObservers(value);
            this.setState({ x: newX, y: newY });
            if (this.props.context.activeKeyPoints.length > 1) {
                setTimeout(() => {
                    if (this.props.context.mainKeyPoint) {
                        this.props.context.onMainKeyPointMoved.notifyObservers();
                    }
                });
            }
        }
        else {
            const keys = this.props.curve.keys;
            const isLockedTangent = keys[this.props.keyId].lockedTangent && this.props.keyId !== 0 && this.props.keyId !== keys.length - 1;
            let angleDiff = 0;
            const tmpVector = core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector2[0];
            if (isLockedTangent) {
                const va = core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector2[1];
                const vb = core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector2[2];
                core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Vector2.NormalizeToRef(this._inVec, va);
                core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Vector2.NormalizeToRef(this._outVec, vb);
                angleDiff = Math.acos(Math.min(1.0, Math.max(-1, core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Vector2.Dot(va, vb))));
                this._inVec.rotateToRef(-angleDiff, tmpVector);
                if (core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Vector2.Distance(tmpVector, this._outVec) > 0.01) {
                    angleDiff = -angleDiff;
                }
            }
            if (this._controlMode === ControlMode.TangentLeft) {
                this.props.curve.updateInTangentFromControlPoint(this.props.keyId, this._processTangentMove(evt, this._inVec, this._storedLengthIn, true));
                if (isLockedTangent) {
                    this._inVec.rotateToRef(-angleDiff, tmpVector);
                    tmpVector.x = Math.abs(tmpVector.x);
                    this.props.curve.updateOutTangentFromControlPoint(this.props.keyId, this._extractSlope(tmpVector, this._storedLengthOut, false));
                }
            }
            else if (this._controlMode === ControlMode.TangentRight) {
                this.props.curve.updateOutTangentFromControlPoint(this.props.keyId, this._processTangentMove(evt, this._outVec, this._storedLengthOut, false));
                if (isLockedTangent) {
                    this._outVec.rotateToRef(angleDiff, tmpVector);
                    tmpVector.x = -Math.abs(tmpVector.x);
                    this.props.curve.updateInTangentFromControlPoint(this.props.keyId, this._extractSlope(tmpVector, this._storedLengthIn, true));
                }
            }
            this.props.context.refreshTarget();
            this.forceUpdate();
        }
        this.props.context.onActiveKeyDataChanged.notifyObservers(this.props.keyId);
        this._sourcePointerX = evt.nativeEvent.offsetX;
        this._sourcePointerY = evt.nativeEvent.offsetY;
        evt.stopPropagation();
    }
    _onPointerUp(evt) {
        this._pointerIsDown = false;
        evt.currentTarget.releasePointerCapture(evt.pointerId);
        evt.stopPropagation();
        this._controlMode = ControlMode.None;
    }
    render() {
        if (!this.props.context.isChannelEnabled(this.props.curve.animation, this.props.curve.color)) {
            return null;
        }
        const animationType = this.props.curve.animation.dataType;
        const isColorAnimation = animationType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Animation.ANIMATIONTYPE_COLOR3 || animationType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Animation.ANIMATIONTYPE_COLOR4;
        const isQuaternionAnimation = animationType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Animation.ANIMATIONTYPE_QUATERNION;
        const svgImageIcon = this.state.selectedState === SelectionState.Selected ? _assets_keySelectedIcon_svg__WEBPACK_IMPORTED_MODULE_3__ : this.state.selectedState === SelectionState.Siblings ? _assets_keyActiveIcon_svg__WEBPACK_IMPORTED_MODULE_4__ : _assets_keyInactiveIcon_svg__WEBPACK_IMPORTED_MODULE_5__;
        const keys = this.props.curve.keys;
        const isLockedTangent = keys[this.props.keyId].lockedTangent ?? true;
        const hasStepTangentIn = keys[this.props.keyId - 1]?.interpolation ?? false;
        const hasStepTangentOut = keys[this.props.keyId]?.interpolation ?? false;
        const hasDefinedInTangent = this.props.curve.hasDefinedInTangent(this.props.keyId);
        const hasDefinedOutTangent = this.props.curve.hasDefinedOutTangent(this.props.keyId);
        const convertedX = this.props.invertX(this.state.x);
        const convertedY = this.props.invertY(this.state.y);
        if (hasDefinedInTangent) {
            const inControlPointValue = convertedY - this.props.curve.getInControlPoint(this.props.keyId);
            this._inVec = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Vector2(this.props.convertX(convertedX - 1) - this.state.x, this.props.convertY(inControlPointValue) - this.state.y);
        }
        else {
            this._inVec = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Vector2();
        }
        if (hasDefinedOutTangent) {
            const outControlPointValue = convertedY + this.props.curve.getOutControlPoint(this.props.keyId);
            this._outVec = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Vector2(this.props.convertX(convertedX + 1) - this.state.x, this.props.convertY(outControlPointValue) - this.state.y);
        }
        else {
            this._outVec = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_1__.Vector2();
        }
        this._storedLengthIn = this._inVec.length();
        this._storedLengthOut = this._outVec.length();
        this._inVec.normalize();
        this._inVec.scaleInPlace(100 * this.props.scale);
        this._outVec.normalize();
        this._outVec.scaleInPlace(100 * this.props.scale);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { ref: this._svgHost, onPointerDown: (evt) => this._onPointerDown(evt), onPointerMove: (evt) => this._onPointerMove(evt), onPointerUp: (evt) => this._onPointerUp(evt), x: this.state.x, y: this.state.y, style: { cursor: isQuaternionAnimation ? "auto" : "pointer", overflow: "auto", opacity: isQuaternionAnimation ? "25%" : "100%" }, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("image", { x: `-${8 * this.props.scale}`, y: `-${8 * this.props.scale}`, width: `${16 * this.props.scale}`, height: `${16 * this.props.scale}`, ref: this._keyPointSVG, href: svgImageIcon }), this.state.selectedState === SelectionState.Selected && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [this.props.keyId !== 0 && !hasStepTangentIn && !isColorAnimation && !isQuaternionAnimation && hasDefinedInTangent && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: 0, y1: 0, x2: `${this._inVec.x}px`, y2: `${this._inVec.y}px`, style: {
                                        stroke: this.state.tangentSelectedIndex === 0 || this.state.tangentSelectedIndex === -1 ? "#F9BF00" : "#AAAAAA",
                                        strokeWidth: `${1 * this.props.scale}`,
                                        strokeDasharray: isLockedTangent ? "" : "2, 2",
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "left-tangent", cx: `${this._inVec.x}px`, cy: `${this._inVec.y}px`, r: `${4 * this.props.scale}`, style: {
                                        fill: this.state.tangentSelectedIndex === 0 || this.state.tangentSelectedIndex === -1 ? "#F9BF00" : "#AAAAAA",
                                    } })] })), this.props.keyId !== keys.length - 1 && !hasStepTangentOut && !isColorAnimation && !isQuaternionAnimation && hasDefinedOutTangent && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: 0, y1: 0, x2: `${this._outVec.x}px`, y2: `${this._outVec.y}px`, style: {
                                        stroke: this.state.tangentSelectedIndex === 1 || this.state.tangentSelectedIndex === -1 ? "#F9BF00" : "#AAAAAA",
                                        strokeWidth: `${1 * this.props.scale}`,
                                        strokeDasharray: isLockedTangent ? "" : "2, 2",
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "right-tangent", cx: `${this._outVec.x}px`, cy: `${this._outVec.y}px`, r: `${4 * this.props.scale}`, style: {
                                        fill: this.state.tangentSelectedIndex === 1 || this.state.tangentSelectedIndex === -1 ? "#F9BF00" : "#AAAAAA",
                                    } })] }))] }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/playHeadComponent.js":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/playHeadComponent.js ***!
  \******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1735148__) => {

"use strict";
__nested_webpack_require_1735148__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1735148__.d(__nested_webpack_exports__, {
/* harmony export */   PlayHeadComponent: () => (/* binding */ PlayHeadComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1735148__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1735148__(/*! react */ "../../../../node_modules/react/index.js");


class PlayHeadComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._graphAbsoluteWidth = 788;
        this._viewScale = 1;
        this._offsetX = 0;
        this._offsetRange = 10;
        this._viewWidth = 748;
        this._rangeWidthToPlayheadWidth = 40;
        this.state = {};
        this._playHead = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._playHeadCircle = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._onActiveAnimationChangedObserver = this.props.context.onActiveAnimationChanged.add(() => {
            this.forceUpdate();
        });
        this._onRangeFrameBarResizedObserver = this.props.context.onRangeFrameBarResized.add((width) => {
            this._viewWidth = width - this._rangeWidthToPlayheadWidth;
        });
        this._onBeforeRenderObserver = this.props.context.scene.onBeforeRenderObservable.add(() => {
            if (this.props.context.activeAnimations.length === 0) {
                return;
            }
            const animation = this.props.context.activeAnimations[0];
            if (!animation) {
                return;
            }
            const runtimeAnimation = animation.runtimeAnimations[0];
            if (runtimeAnimation) {
                this._moveHead(runtimeAnimation.currentFrame);
            }
            else if (!this._playHeadCircle.current?.innerHTML) {
                this._moveHead(0);
            }
        });
        this._onMoveToFrameRequiredObserver = this.props.context.onMoveToFrameRequired.add((frame) => {
            this.props.context.moveToFrame(frame);
            this._moveHead(frame);
        });
        this._onGraphMovedObserver = this.props.context.onGraphMoved.add((x) => {
            this._offsetX = x;
            this.forceUpdate();
            this._moveHead(this.props.context.activeFrame);
        });
        this._onGraphScaledObserver = this.props.context.onGraphScaled.add((scale) => {
            this._viewScale = 1 / scale;
            this.forceUpdate();
            this._moveHead(this.props.context.activeFrame);
        });
    }
    _moveHead(frame) {
        if (!this._playHead.current || !this._playHeadCircle.current || frame === undefined) {
            return;
        }
        this._playHead.current.style.left = this._frameToPixel(frame) + "px";
        this._playHeadCircle.current.innerHTML = frame.toFixed(0);
        this.props.context.activeFrame = frame;
        this.props.context.onPlayheadMoved.notifyObservers(frame);
    }
    _frameToPixel(frame) {
        const minFrame = this.props.context.referenceMinFrame;
        const maxFrame = this.props.context.referenceMaxFrame;
        return (((frame - minFrame) / (maxFrame - minFrame)) * this._graphAbsoluteWidth + this._offsetX) * this._viewScale;
    }
    _pixelToFrame(pixel, locator) {
        const { minFrame, maxFrame, width, offset, scale } = locator;
        const animation = this.props.context.activeAnimations[0];
        const keys = animation.getKeys();
        return Math.max(((pixel / scale - offset) / width) * (maxFrame - minFrame) + minFrame, keys[0].frame);
    }
    componentWillUnmount() {
        if (this._onBeforeRenderObserver) {
            this.props.context.scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
            this._onBeforeRenderObserver = null;
        }
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
        if (this._onRangeFrameBarResizedObserver) {
            this.props.context.onRangeFrameBarResized.remove(this._onRangeFrameBarResizedObserver);
        }
        if (this._onMoveToFrameRequiredObserver) {
            this.props.context.onMoveToFrameRequired.remove(this._onMoveToFrameRequiredObserver);
        }
        if (this._onGraphMovedObserver) {
            this.props.context.onGraphMoved.remove(this._onGraphMovedObserver);
        }
        if (this._onGraphScaledObserver) {
            this.props.context.onGraphScaled.remove(this._onGraphScaledObserver);
        }
    }
    _getPixelValues(isRange) {
        let minFrame, maxFrame, width, offset, scale;
        if (isRange) {
            minFrame = this.props.context.fromKey;
            maxFrame = this.props.context.toKey;
            width = this._viewWidth;
            offset = this._offsetRange;
            scale = 1;
        }
        else {
            minFrame = this.props.context.referenceMinFrame;
            maxFrame = this.props.context.referenceMaxFrame;
            width = this._graphAbsoluteWidth;
            offset = this._offsetX;
            scale = this._viewScale;
        }
        return { minFrame, maxFrame, width, offset, scale };
    }
    _onPointerDown(evt, isRange) {
        evt.preventDefault();
        this._pointerIsDown = true;
        evt.currentTarget.setPointerCapture(evt.pointerId);
        const locator = this._getPixelValues(isRange);
        const frame = this._pixelToFrame(evt.nativeEvent.offsetX, locator);
        this.props.context.moveToFrame(frame);
        this._moveHead(frame);
    }
    _onPointerMove(evt, isRange) {
        if (!this._pointerIsDown) {
            return;
        }
        const locator = this._getPixelValues(isRange);
        const frame = this._pixelToFrame(evt.nativeEvent.offsetX, locator);
        this.props.context.moveToFrame(frame);
        this._moveHead(frame);
    }
    _onPointerUp(evt) {
        this._pointerIsDown = false;
        evt.currentTarget.releasePointerCapture(evt.pointerId);
    }
    render() {
        if (this.props.context.activeAnimations.length === 0) {
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "play-head", ref: this._playHead, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "play-head-bar" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "play-head-circle", ref: this._playHeadCircle })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "play-head-control", onPointerDown: (evt) => this._onPointerDown(evt, false), onPointerMove: (evt) => this._onPointerMove(evt, false), onPointerUp: (evt) => this._onPointerUp(evt) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "play-head-control-2", onPointerDown: (evt) => this._onPointerDown(evt, true), onPointerMove: (evt) => this._onPointerMove(evt, true), onPointerUp: (evt) => this._onPointerUp(evt) })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/rangeFrameBarComponent.js":
/*!***********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/rangeFrameBarComponent.js ***!
  \***********************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1743076__) => {

"use strict";
__nested_webpack_require_1743076__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1743076__.d(__nested_webpack_exports__, {
/* harmony export */   RangeFrameBarComponent: () => (/* binding */ RangeFrameBarComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1743076__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1743076__(/*! react */ "../../../../node_modules/react/index.js");


const tickDistance = 25; // x distance between consecutive ticks
class RangeFrameBarComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._viewWidth = 748;
        this._offsetX = 10;
        this._isMounted = false;
        this.state = {};
        this._svgHost = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this.props.context.onHostWindowResized.add(() => {
            this._computeSizes();
        });
        this._onActiveAnimationChangedObserver = this.props.context.onActiveAnimationChanged.add(() => {
            if (!this._isMounted) {
                return;
            }
            this._computeSizes();
            this.forceUpdate();
        });
        this._onPlayheadMovedObserver = this.props.context.onPlayheadMoved.add(() => {
            this.forceUpdate();
        });
        this.props.context.onFrameSet.add(() => {
            if (!this._isMounted) {
                return;
            }
            this.forceUpdate();
        });
        this._onFrameManuallyEnteredObserver = this.props.context.onFrameManuallyEntered.add(() => {
            if (!this._isMounted) {
                return;
            }
            this.forceUpdate();
        });
        this.props.context.onRangeUpdated.add(() => {
            if (!this._isMounted) {
                return;
            }
            this.forceUpdate();
        });
    }
    componentDidMount() {
        this._isMounted = true;
    }
    componentWillUnmount() {
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
        if (this._onPlayheadMovedObserver) {
            this.props.context.onPlayheadMoved.remove(this._onPlayheadMovedObserver);
        }
        if (this._onFrameManuallyEnteredObserver) {
            this.props.context.onFrameManuallyEntered.remove(this._onFrameManuallyEnteredObserver);
        }
        this._isMounted = false;
    }
    _computeSizes() {
        if (!this._svgHost.current) {
            return;
        }
        this._viewWidth = this._svgHost.current.clientWidth;
        this.props.context.onRangeFrameBarResized.notifyObservers(this._viewWidth);
        this.forceUpdate();
    }
    _dropKeyFrames(animation) {
        const from = this.props.context.fromKey;
        const to = this.props.context.toKey;
        const range = to - from;
        const convertRatio = range / this._viewWidth;
        const keys = animation.getKeys();
        return keys.map((k, i) => {
            const x = (k.frame - from) / convertRatio;
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: "0px", x2: x, y2: "40px", style: {
                    stroke: "#ffc017",
                    strokeWidth: 0.5,
                } }, "frame-line" + k.frame + i));
        });
    }
    _buildActiveFrame() {
        if (this.props.context.activeFrame === null || this.props.context.activeFrame === undefined) {
            return null;
        }
        const from = this.props.context.fromKey;
        const to = this.props.context.toKey;
        const range = to - from;
        const convertRatio = range / this._viewWidth;
        const x = (this.props.context.activeFrame - from) / convertRatio;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: "0px", x2: x, y2: "40px", style: {
                stroke: "#ffffff",
                strokeWidth: 0.5,
            } }, "line-activeFrame"));
    }
    _buildFrames() {
        if (this.props.context.activeAnimations.length === 0) {
            return null;
        }
        const from = this.props.context.fromKey;
        const to = this.props.context.toKey;
        const range = to - from;
        const convertRatio = range / this._viewWidth;
        const dist = tickDistance;
        const offset = Math.max(Math.floor(dist * convertRatio), 1);
        const steps = [];
        const start = from;
        const end = start + range;
        for (let step = start; step <= end; step += offset) {
            steps.push(step);
        }
        if (steps[steps.length - 1] < end - offset / 2) {
            steps.push(end);
        }
        return steps.map((s, i) => {
            const x = (s - from) / convertRatio;
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: "22px", x2: x, y2: "40px", style: {
                            stroke: "#333333",
                            strokeWidth: 0.5,
                        } }, "line" + s + i), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: x, y: 0, dx: "6px", textAnchor: "middle", dy: "14px", style: {
                            fontFamily: "acumin-pro-condensed",
                            fontSize: `12px`,
                            fill: "#555555",
                            textAlign: "center",
                        }, children: s.toFixed(0) }, "label" + s + i)] }, "axis" + s + i));
        });
    }
    render() {
        const viewBox = `${-this._offsetX} 0 ${this._viewWidth + this._offsetX * 4} 40`;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "range-frame-bar", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { id: "svg-range-frames", viewBox: viewBox, ref: this._svgHost, children: [this._buildFrames(), this.props.context.activeAnimations.map((a) => {
                        return this._dropKeyFrames(a);
                    }), this._buildActiveFrame()] }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/addAnimationComponent.js":
/*!************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/addAnimationComponent.js ***!
  \************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1749981__) => {

"use strict";
__nested_webpack_require_1749981__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1749981__.d(__nested_webpack_exports__, {
/* harmony export */   AddAnimationComponent: () => (/* binding */ AddAnimationComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1749981__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1749981__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1749981__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1749981__.n(core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__);





class AddAnimationComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { customPropertyMode: false };
        this._root = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._displayName = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._property = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._typeElement = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._loopModeElement = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._propertylement = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    createNew() {
        const context = this.props.context;
        const document = this._displayName.current.ownerDocument;
        const displayName = this._displayName.current.value;
        const property = this._property.current ? this._property.current.value : this._propertylement.current.value;
        const type = this._typeElement.current ? this._typeElement.current.value : this.getInferredType();
        const loopModeValue = this._loopModeElement.current.value;
        if (!displayName) {
            document.defaultView.alert("Please define a display name");
            return;
        }
        if (!property) {
            document.defaultView.alert("Please define a property");
            return;
        }
        const fps = this.props.context.animations && this.props.context.animations.length
            ? this.props.context.useTargetAnimations
                ? this.props.context.animations[0].animation.framePerSecond
                : this.props.context.animations[0].framePerSecond
            : 60;
        let minFrame = this.props.context.referenceMinFrame;
        let maxFrame = this.props.context.referenceMaxFrame;
        if (this.props.context.animations) {
            for (const anim of this.props.context.animations) {
                const innerAnim = this.props.context.useTargetAnimations ? anim.animation : anim;
                minFrame = Math.min(minFrame, innerAnim.getKeys()[0].frame);
                maxFrame = Math.max(maxFrame, innerAnim.getKeys()[innerAnim.getKeys().length - 1].frame);
            }
        }
        let dataType = 0;
        let loopMode = 0;
        let defaultValue0;
        let defaultValue1;
        let defaultInTangent0;
        let defaultOutTangent0;
        let defaultInTangent1;
        let defaultOutTangent1;
        switch (type) {
            case "Float": {
                dataType = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_FLOAT;
                defaultValue0 = 0;
                defaultValue1 = 1;
                defaultInTangent0 = 0;
                defaultOutTangent0 = 0;
                defaultInTangent1 = 0;
                defaultOutTangent1 = 0;
                break;
            }
            case "Vector2": {
                dataType = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR2;
                defaultValue0 = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector2.Zero();
                defaultValue1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector2(1, 1);
                defaultInTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector2(0, 0);
                defaultOutTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector2(0, 0);
                defaultInTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector2(0, 0);
                defaultOutTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector2(0, 0);
                break;
            }
            case "Vector3": {
                dataType = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR3;
                defaultValue0 = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero();
                defaultValue1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3(1, 1, 1);
                defaultInTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0);
                defaultOutTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0);
                defaultInTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0);
                defaultOutTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0);
                break;
            }
            case "Quaternion": {
                dataType = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_QUATERNION;
                defaultValue0 = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion.Zero();
                defaultValue1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion(1, 1, 1, 0);
                defaultInTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion(0, 0, 0, 0);
                defaultOutTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion(0, 0, 0, 0);
                defaultInTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion(0, 0, 0, 0);
                defaultOutTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Quaternion(0, 0, 0, 0);
                break;
            }
            case "Color3": {
                dataType = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_COLOR3;
                defaultValue0 = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3.Black();
                defaultValue1 = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3.White();
                defaultInTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3(0, 0, 0);
                defaultOutTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3(0, 0, 0);
                defaultInTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3(0, 0, 0);
                defaultOutTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color3(0, 0, 0);
                break;
            }
            case "Color4": {
                dataType = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_COLOR4;
                defaultValue0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(0, 0, 0, 0);
                defaultValue1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(1, 1, 1, 1);
                defaultInTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(0, 0, 0, 0);
                defaultOutTangent0 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(0, 0, 0, 0);
                defaultInTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(0, 0, 0, 0);
                defaultOutTangent1 = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Color4(0, 0, 0, 0);
                break;
            }
        }
        switch (loopModeValue) {
            case "Cycle": {
                loopMode = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONLOOPMODE_CYCLE;
                break;
            }
            case "Relative": {
                loopMode = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONLOOPMODE_RELATIVE;
                break;
            }
            case "Relative from current": {
                loopMode = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT;
                break;
            }
            case "Constant": {
                loopMode = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONLOOPMODE_CONSTANT;
                break;
            }
        }
        const animation = new core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation(displayName, property, fps, dataType, loopMode);
        const keys = [];
        keys.push({
            frame: minFrame,
            value: defaultValue0,
            inTangent: defaultInTangent0,
            outTangent: defaultOutTangent0,
        });
        keys.push({
            frame: maxFrame,
            value: defaultValue1,
            inTangent: defaultInTangent1,
            outTangent: defaultOutTangent1,
        });
        animation.setKeys(keys);
        context.stop();
        if (!context.animations || context.animations.length === 0) {
            context.animations = [];
            if (context.target) {
                context.target.animations = context.animations;
            }
        }
        if (!context.useTargetAnimations) {
            context.animations.push(animation);
        }
        context.activeAnimations.push(animation);
        context.prepare();
        context.onActiveAnimationChanged.notifyObservers({});
        context.onAnimationsLoaded.notifyObservers();
    }
    getInferredType(activeProperty = "") {
        const source = this.props.context.target;
        if (this._propertylement.current) {
            activeProperty = this._propertylement.current.value;
        }
        const value = source[activeProperty];
        if (!isNaN(parseFloat(value))) {
            return "Float";
        }
        return value.getClassName();
    }
    render() {
        const types = ["Float", "Vector2", "Vector3", "Quaternion", "Color3", "Color4"];
        const loopModes = ["Cycle", "Relative", "Relative from current", "Constant"];
        const modes = ["Custom", "List"];
        const properties = [];
        let inferredType = "";
        if (this.props.context.target) {
            let target = this.props.context.target;
            const source = target;
            while (target !== null) {
                const descriptors = Object.getOwnPropertyDescriptors(target);
                for (const property in descriptors) {
                    const descriptor = descriptors[property];
                    if (property[0] === "_" || source[property] === null || source[property] === undefined) {
                        continue;
                    }
                    if (source[property].r === undefined && source[property].x === undefined && isNaN(parseFloat(source[property]))) {
                        continue;
                    }
                    if (properties.indexOf(property) !== -1) {
                        continue;
                    }
                    if (!descriptor.writable && !descriptor.set) {
                        continue;
                    }
                    properties.push(property);
                }
                target = Object.getPrototypeOf(target);
            }
            properties.sort();
            // Extract position, rotation, scaling
            const main = ["scaling", "rotation", "position"];
            for (const mainProperty of main) {
                const index = properties.indexOf(mainProperty);
                if (index === -1) {
                    continue;
                }
                properties.splice(index, 1);
                properties.splice(0, 0, mainProperty);
            }
            if (this._propertylement.current) {
                inferredType = this.getInferredType();
            }
            else {
                inferredType = this.getInferredType(properties[0]);
            }
        }
        const customPropertyMode = this.state.customPropertyMode || properties.length === 0;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "add-animation-pane", ref: this._root, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "add-animation-display-name-label", children: "Display Name" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "add-animation-mode-label", children: "Mode" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "add-animation-property-label", children: "Property" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "add-animation-type-label", children: "Type" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "add-animation-loop-mode-label", children: "Loop Mode" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", id: "add-animation-name", ref: this._displayName, className: "input-text", defaultValue: "" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { id: "add-animation-mode", className: "option", value: this.state.customPropertyMode ? "Custom" : "List", onChange: (evt) => {
                        this.setState({ customPropertyMode: evt.currentTarget.value === "Custom" });
                    }, children: modes.map((mode, i) => {
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: mode, title: mode, children: mode }, mode + i));
                    }) }), customPropertyMode && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", id: "add-animation-property", ref: this._property, className: "input-text", defaultValue: "" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { id: "add-animation-type", className: "option", ref: this._typeElement, children: types.map((type, i) => {
                                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: type, title: type, children: type }, type + i));
                            }) })] })), !customPropertyMode && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { id: "add-animation-property", className: "option", ref: this._propertylement, onClick: () => {
                                this.forceUpdate();
                            }, children: properties.map((property, i) => {
                                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: property, title: property, children: property }, property + i));
                            }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "add-animation-type", children: inferredType })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { id: "add-animation-loop-mode", className: "option", ref: this._loopModeElement, children: loopModes.map((loopMode, i) => {
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: loopMode, title: loopMode, children: loopMode }, loopMode + i));
                    }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "simple-button", id: "add-animation", type: "button", onClick: () => this.createNew(), children: "Create" })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/animationEntryComponent.js":
/*!**************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/animationEntryComponent.js ***!
  \**************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1766678__) => {

"use strict";
__nested_webpack_require_1766678__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1766678__.d(__nested_webpack_exports__, {
/* harmony export */   AnimationEntryComponent: () => (/* binding */ AnimationEntryComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1766678__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1766678__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1766678__(/*! core/Animations/animation */ "core/Misc/observable");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1766678__.n(core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1766678__(/*! ../controls/actionButtonComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/actionButtonComponent.js");
/* harmony import */ var _animationSubEntryComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1766678__(/*! ./animationSubEntryComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/animationSubEntryComponent.js");
/* harmony import */ var _assets_animationOptionsIcon_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1766678__(/*! ../assets/animationOptionsIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationOptionsIcon.svg");
/* harmony import */ var _assets_closeWindowIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1766678__(/*! ../assets/closeWindowIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/closeWindowIcon.svg");
/* harmony import */ var _assets_animationBulletIcon_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1766678__(/*! ../assets/animationBulletIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationBulletIcon.svg");
/* harmony import */ var _assets_keySelectedIcon_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1766678__(/*! ../assets/keySelectedIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keySelectedIcon.svg");
/* harmony import */ var _assets_animationTriangleIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1766678__(/*! ../assets/animationTriangleIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationTriangleIcon.svg");










class AnimationEntryComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._unmount = false;
        this.state = { isExpanded: false, isSelected: false };
        this._onActiveAnimationChangedObserver = props.context.onActiveAnimationChanged.add(() => {
            if (this._unmount) {
                return;
            }
            if (this.props.context.activeAnimations.indexOf(this.props.animation) === -1) {
                this.setState({ isSelected: false });
            }
            this.forceUpdate();
        });
        this._onActiveKeyPointChangedObserver = this.props.context.onActiveKeyPointChanged.add(() => {
            this.setState({
                isSelected: this.props.animation.dataType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_FLOAT &&
                    this.props.context.activeAnimations.indexOf(this.props.animation) !== -1 &&
                    this.props.context.activeKeyPoints !== null &&
                    this.props.context.activeKeyPoints.length > 0 &&
                    this.props.context.activeKeyPoints.some((kp) => kp.props.curve.animation === this.props.animation),
            });
        });
        this._onSelectToActivatedObserver = this.props.context.onSelectToActivated.add((info) => {
            const currentIndex = this.props.context.getAnimationSortIndex(this.props.animation);
            const activeIndex = this.props.context.activeAnimations.indexOf(this.props.animation);
            if ((currentIndex > info.from && currentIndex <= info.to) || (currentIndex >= info.to && currentIndex < info.from)) {
                if (activeIndex === -1) {
                    this.props.context.activeAnimations.push(this.props.animation);
                }
            }
            else if (currentIndex !== info.from && activeIndex !== -1) {
                this.props.context.activeAnimations.splice(activeIndex, 1);
            }
        });
    }
    _onGear() {
        this.props.context.onEditAnimationUIClosed.addOnce(() => {
            if (!this._unmount) {
                this.forceUpdate();
            }
        });
        this.props.context.onEditAnimationRequired.notifyObservers(this.props.animation);
    }
    _onDelete() {
        this.props.context.onDeleteAnimation.notifyObservers(this.props.animation);
    }
    componentWillUnmount() {
        this._unmount = true;
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
        if (this._onActiveKeyPointChangedObserver) {
            this.props.context.onActiveKeyPointChanged.remove(this._onActiveKeyPointChangedObserver);
        }
        if (this._onSelectToActivatedObserver) {
            this.props.context.onSelectToActivated.remove(this._onSelectToActivatedObserver);
        }
    }
    _activate(evt) {
        if (evt.shiftKey) {
            if (this.props.context.activeAnimations.length > 0) {
                const firstOne = this.props.context.activeAnimations[0];
                const payload = {
                    from: this.props.context.getAnimationSortIndex(firstOne),
                    to: this.props.context.getAnimationSortIndex(this.props.animation),
                };
                this.props.context.onSelectToActivated.notifyObservers(payload);
                this.props.context.onActiveAnimationChanged.notifyObservers({});
            }
            return;
        }
        if (!evt.ctrlKey) {
            this.props.context.activeAnimations = [this.props.animation];
            this.props.context.resetAllActiveChannels();
        }
        else {
            const index = this.props.context.activeAnimations.indexOf(this.props.animation);
            if (index !== -1) {
                this.props.context.activeAnimations.splice(index, 1);
            }
            else {
                this.props.context.activeAnimations.push(this.props.animation);
            }
        }
        this.props.context.disableChannel(this.props.animation);
        this.props.context.onActiveAnimationChanged.notifyObservers({});
    }
    _expandOrCollapse() {
        this.setState({ isExpanded: !this.state.isExpanded });
    }
    render() {
        const isActive = this.props.context.activeAnimations.indexOf(this.props.animation) !== -1;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "animation-entry" + (isActive ? " isActive" : ""), children: [this.state.isSelected && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "animation-active-indicator", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _assets_keySelectedIcon_svg__WEBPACK_IMPORTED_MODULE_5__ }) })), this.props.animation.dataType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_FLOAT && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "animation-chevron", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _assets_animationBulletIcon_svg__WEBPACK_IMPORTED_MODULE_6__ }) })), this.props.animation.dataType !== core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_FLOAT && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "animation-chevron", onClick: () => this._expandOrCollapse(), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "animation-chevron-image" + (this.state.isExpanded ? "" : " collapsed"), src: _assets_animationTriangleIcon_svg__WEBPACK_IMPORTED_MODULE_7__ }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "animation-name", onClick: (evt) => this._activate(evt), children: this.props.animation.name }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_3__.ActionButtonComponent, { className: "animation-options", context: this.props.context, globalState: this.props.globalState, icon: _assets_animationOptionsIcon_svg__WEBPACK_IMPORTED_MODULE_8__, onClick: () => this._onGear() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_3__.ActionButtonComponent, { className: "animation-delete", context: this.props.context, globalState: this.props.globalState, icon: _assets_closeWindowIcon_svg__WEBPACK_IMPORTED_MODULE_9__, onClick: () => this._onDelete() })] }), this.state.isExpanded && this.props.animation.dataType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_COLOR3 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationSubEntryComponent__WEBPACK_IMPORTED_MODULE_4__.AnimationSubEntryComponent, { globalState: this.props.globalState, context: this.props.context, animation: this.props.animation, color: "#DB3E3E", subName: "Red" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationSubEntryComponent__WEBPACK_IMPORTED_MODULE_4__.AnimationSubEntryComponent, { globalState: this.props.globalState, context: this.props.context, animation: this.props.animation, color: "#51E22D", subName: "Green" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationSubEntryComponent__WEBPACK_IMPORTED_MODULE_4__.AnimationSubEntryComponent, { globalState: this.props.globalState, context: this.props.context, animation: this.props.animation, color: "#00A3FF", subName: "Blue" })] })), this.state.isExpanded && this.props.animation.dataType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR3 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationSubEntryComponent__WEBPACK_IMPORTED_MODULE_4__.AnimationSubEntryComponent, { globalState: this.props.globalState, context: this.props.context, animation: this.props.animation, color: "#DB3E3E", subName: "X" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationSubEntryComponent__WEBPACK_IMPORTED_MODULE_4__.AnimationSubEntryComponent, { globalState: this.props.globalState, context: this.props.context, animation: this.props.animation, color: "#51E22D", subName: "Y" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationSubEntryComponent__WEBPACK_IMPORTED_MODULE_4__.AnimationSubEntryComponent, { globalState: this.props.globalState, context: this.props.context, animation: this.props.animation, color: "#00A3FF", subName: "Z" })] })), this.state.isExpanded && this.props.animation.dataType === core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONTYPE_VECTOR2 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationSubEntryComponent__WEBPACK_IMPORTED_MODULE_4__.AnimationSubEntryComponent, { globalState: this.props.globalState, context: this.props.context, animation: this.props.animation, color: "#DB3E3E", subName: "X" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationSubEntryComponent__WEBPACK_IMPORTED_MODULE_4__.AnimationSubEntryComponent, { globalState: this.props.globalState, context: this.props.context, animation: this.props.animation, color: "#51E22D", subName: "Y" })] }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/animationListComponent.js":
/*!*************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/animationListComponent.js ***!
  \*************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1779930__) => {

"use strict";
__nested_webpack_require_1779930__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1779930__.d(__nested_webpack_exports__, {
/* harmony export */   AnimationListComponent: () => (/* binding */ AnimationListComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1779930__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1779930__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _animationEntryComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1779930__(/*! ./animationEntryComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/animationEntryComponent.js");



class AnimationListComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isVisible: true };
        this._onEditAnimationRequiredObserver = this.props.context.onEditAnimationRequired.add(() => {
            this.setState({
                isVisible: false,
            });
        });
        this._onEditAnimationUIClosedObserver = this.props.context.onEditAnimationUIClosed.add(() => {
            this.setState({
                isVisible: true,
            });
        });
        this._onDeleteAnimationObserver = this.props.context.onDeleteAnimation.add(() => {
            this.forceUpdate();
        });
    }
    componentWillUnmount() {
        if (this._onEditAnimationRequiredObserver) {
            this.props.context.onEditAnimationRequired.remove(this._onEditAnimationRequiredObserver);
        }
        if (this._onEditAnimationUIClosedObserver) {
            this.props.context.onEditAnimationUIClosed.remove(this._onEditAnimationUIClosedObserver);
        }
        if (this._onDeleteAnimationObserver) {
            this.props.context.onDeleteAnimation.remove(this._onDeleteAnimationObserver);
        }
    }
    render() {
        if (!this.state.isVisible) {
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "animation-list", children: this.props.context.animations?.map((a, i) => {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationEntryComponent__WEBPACK_IMPORTED_MODULE_2__.AnimationEntryComponent, { globalState: this.props.globalState, context: this.props.context, animation: this.props.context.useTargetAnimations ? a.animation : a }, i));
            }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/animationSubEntryComponent.js":
/*!*****************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/animationSubEntryComponent.js ***!
  \*****************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1783195__) => {

"use strict";
__nested_webpack_require_1783195__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1783195__.d(__nested_webpack_exports__, {
/* harmony export */   AnimationSubEntryComponent: () => (/* binding */ AnimationSubEntryComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1783195__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1783195__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _graph_keyPoint__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1783195__(/*! ../graph/keyPoint */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/graph/keyPoint.js");
/* harmony import */ var _assets_keySelectedIcon_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1783195__(/*! ../assets/keySelectedIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keySelectedIcon.svg");




class AnimationSubEntryComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        let isSelected = false;
        if (this.props.context.activeAnimations.indexOf(this.props.animation) !== -1 && this.props.context.activeKeyPoints) {
            for (const keyPoint of this.props.context.activeKeyPoints) {
                if (keyPoint.state.selectedState === _graph_keyPoint__WEBPACK_IMPORTED_MODULE_2__.SelectionState.Selected && keyPoint.props.channel === this.props.color) {
                    isSelected = true;
                }
            }
        }
        this.state = { isSelected: isSelected };
        this._onActiveAnimationChangedObserver = props.context.onActiveAnimationChanged.add(() => {
            this.forceUpdate();
        });
        this._onActiveKeyPointChangedObserver = this.props.context.onActiveKeyPointChanged.add(() => {
            let isSelected = false;
            if (this.props.context.activeKeyPoints) {
                for (const activeKeyPoint of this.props.context.activeKeyPoints) {
                    if (activeKeyPoint.props.curve.animation === this.props.animation &&
                        activeKeyPoint.props.channel === this.props.color &&
                        this.props.context.activeAnimations.indexOf(this.props.animation) !== -1) {
                        isSelected = true;
                        break;
                    }
                }
            }
            this.setState({ isSelected: isSelected });
        });
    }
    componentWillUnmount() {
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
        if (this._onActiveKeyPointChangedObserver) {
            this.props.context.onActiveKeyPointChanged.remove(this._onActiveKeyPointChangedObserver);
        }
    }
    _activate(evt) {
        const index = this.props.context.activeAnimations.indexOf(this.props.animation);
        if (index !== -1 && this.props.context.getActiveChannel(this.props.animation) === this.props.color) {
            return;
        }
        if (!evt.ctrlKey) {
            this.props.context.activeAnimations = [this.props.animation];
            this.props.context.resetAllActiveChannels();
        }
        else {
            if (index === -1) {
                this.props.context.activeAnimations.push(this.props.animation);
            }
        }
        this.props.context.enableChannel(this.props.animation, this.props.color);
        this.props.context.onActiveAnimationChanged.notifyObservers({});
    }
    render() {
        const isActive = this.props.context.activeAnimations.indexOf(this.props.animation) !== -1 && this.props.context.isChannelEnabled(this.props.animation, this.props.color);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "animation-entry" + (isActive ? " isActive" : ""), children: [this.state.isSelected && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "animation-active-indicator", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _assets_keySelectedIcon_svg__WEBPACK_IMPORTED_MODULE_3__ }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "animation-name", style: {
                            color: this.props.color,
                        }, onClick: (evt) => this._activate(evt), children: this.props.subName })] }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/editAnimationComponent.js":
/*!*************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/editAnimationComponent.js ***!
  \*************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1788566__) => {

"use strict";
__nested_webpack_require_1788566__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1788566__.d(__nested_webpack_exports__, {
/* harmony export */   EditAnimationComponent: () => (/* binding */ EditAnimationComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1788566__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1788566__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1788566__(/*! core/Animations/animation */ "core/Misc/observable");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1788566__.n(core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__);



class EditAnimationComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isVisible: false, animation: null };
        this._root = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._displayName = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._property = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._loopModeElement = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._onEditAnimationRequiredObserver = this.props.context.onEditAnimationRequired.add((animation) => {
            this.setState({
                isVisible: true,
                animation: animation,
            });
        });
    }
    componentWillUnmount() {
        if (this._onEditAnimationRequiredObserver) {
            this.props.context.onEditAnimationRequired.remove(this._onEditAnimationRequiredObserver);
        }
    }
    close() {
        this.setState({ isVisible: false });
        this.props.context.onEditAnimationUIClosed.notifyObservers();
    }
    validate() {
        const context = this.props.context;
        const document = this._displayName.current.ownerDocument;
        const displayName = this._displayName.current.value;
        const property = this._property.current.value;
        const loopModeValue = this._loopModeElement.current.value;
        if (!displayName) {
            document.defaultView.alert("Please define a display name");
            return;
        }
        if (!property) {
            document.defaultView.alert("Please define a property");
            return;
        }
        const animation = this.state.animation;
        animation.name = displayName;
        if (animation.targetProperty !== property) {
            animation.targetProperty = property;
            animation.targetPropertyPath = property.split(".");
            context.stop();
        }
        switch (loopModeValue) {
            case "Cycle": {
                animation.loopMode = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONLOOPMODE_CYCLE;
                break;
            }
            case "Relative": {
                animation.loopMode = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONLOOPMODE_RELATIVE;
                break;
            }
            case "Relative from current": {
                animation.loopMode = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT;
                break;
            }
            case "Constant": {
                animation.loopMode = core_Animations_animation__WEBPACK_IMPORTED_MODULE_2__.Animation.ANIMATIONLOOPMODE_CONSTANT;
                break;
            }
        }
        this.close();
    }
    render() {
        if (!this.state.isVisible) {
            return null;
        }
        const loopModes = ["Relative", "Cycle", "Constant", "", "Yoyo", "Relative from current"];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "edit-animation-pane", ref: this._root, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "edit-animation-display-name-label", children: "Display Name" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "edit-animation-property-label", children: "Property" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "edit-animation-loop-mode-label", children: "Loop Mode" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", id: "edit-animation-name", ref: this._displayName, className: "input-text", defaultValue: this.state.animation.name || "" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", id: "edit-animation-property", ref: this._property, className: "input-text", defaultValue: this.state.animation.targetProperty }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { id: "edit-animation-loop-mode", className: "option", ref: this._loopModeElement, defaultValue: loopModes[this.state.animation.loopMode ?? 1], children: loopModes
                        .filter((value) => value !== "")
                        .map((loopMode, i) => {
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: loopMode, title: loopMode, children: loopMode }, loopMode + i));
                    }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "edit-animation", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "simple-button", id: "edit-animation-ok", type: "button", onClick: () => this.validate(), children: "OK" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "simple-button", id: "edit-animation-cancel", type: "button", onClick: () => this.close(), children: "Cancel" })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/loadAnimationComponent.js":
/*!*************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/loadAnimationComponent.js ***!
  \*************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1795062__) => {

"use strict";
__nested_webpack_require_1795062__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1795062__.d(__nested_webpack_exports__, {
/* harmony export */   LoadAnimationComponent: () => (/* binding */ LoadAnimationComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1795062__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1795062__(/*! core/Animations/animation */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1795062__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1795062__(/*! react */ "../../../../node_modules/react/index.js");




class LoadAnimationComponent extends react__WEBPACK_IMPORTED_MODULE_2__.Component {
    constructor(props) {
        super(props);
        this.state = {};
        this._root = react__WEBPACK_IMPORTED_MODULE_2__.createRef();
        this._textInput = react__WEBPACK_IMPORTED_MODULE_2__.createRef();
    }
    loadFromFile(evt) {
        const files = evt.target.files;
        if (!files || !files.length) {
            return;
        }
        const file = files[0];
        core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.ReadFile(file, (data) => {
            const context = this.props.context;
            const decoder = new TextDecoder("utf-8");
            const parsedAnimations = JSON.parse(decoder.decode(data)).animations;
            context.animations = [];
            const animations = context.animations;
            for (const parsedAnimation of parsedAnimations) {
                animations.push(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Animation.Parse(parsedAnimation));
            }
            context.stop();
            context.target.animations = animations;
            context.activeAnimations = animations.length ? animations : [];
            context.prepare();
            context.onAnimationsLoaded.notifyObservers();
            context.onActiveAnimationChanged.notifyObservers({});
        }, undefined, true);
        evt.target.value = "";
    }
    loadFromSnippetServer() {
        const context = this.props.context;
        const snippetId = this._textInput.current.value;
        core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Animation.ParseFromSnippetAsync(snippetId)
            .then((animations) => {
            context.snippetId = snippetId;
            if (animations.length !== undefined) {
                context.animations = animations;
            }
            else {
                context.animations = [animations];
            }
            context.stop();
            context.target.animations = context.animations;
            context.activeAnimations = context.animations.length ? context.animations : [];
            context.prepare();
            context.onAnimationsLoaded.notifyObservers();
            context.onActiveAnimationChanged.notifyObservers({});
        })
            .catch((err) => {
            this._root.current?.ownerDocument.defaultView.alert("Unable to load your animations: " + err);
        });
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "load-animation-pane", ref: this._root, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "load-animation-snippet-id-label", children: "Snippet Id" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "load-animation-local-file-label", children: "Local File" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", id: "load-snippet-id", ref: this._textInput }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "simple-button", id: "load-snippet", type: "button", onClick: () => this.loadFromSnippetServer(), children: "Load" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: "upload-snippet", id: "file-snippet-label", className: "simple-button", children: "Browse" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { id: "upload-snippet", type: "file", accept: ".json", onChange: (evt) => this.loadFromFile(evt) }), this.props.context.snippetId && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "load-animation-snippet", children: ["Snippet ID: ", this.props.context.snippetId] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/saveAnimationComponent.js":
/*!*************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/saveAnimationComponent.js ***!
  \*************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1800241__) => {

"use strict";
__nested_webpack_require_1800241__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1800241__.d(__nested_webpack_exports__, {
/* harmony export */   SaveAnimationComponent: () => (/* binding */ SaveAnimationComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1800241__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1800241__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_stringTools__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1800241__(/*! shared-ui-components/stringTools */ "../../../dev/sharedUiComponents/dist/stringTools.js");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1800241__(/*! core/Animations/animation */ "core/Misc/observable");
/* harmony import */ var core_Animations_animation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1800241__.n(core_Animations_animation__WEBPACK_IMPORTED_MODULE_3__);




class SaveAnimationComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._selectedAnimations = [];
        this.state = {};
        this._root = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        if (this.props.context.animations) {
            if (this.props.context.useTargetAnimations) {
                for (const targetedAnimation of this.props.context.animations) {
                    this._selectedAnimations.push(targetedAnimation.animation);
                }
            }
            else {
                this._selectedAnimations = this.props.context.animations.slice(0);
            }
        }
    }
    _getJson() {
        const json = {
            animations: [],
        };
        for (const animation of this._selectedAnimations) {
            json.animations.push(animation.serialize());
        }
        return JSON.stringify(json);
    }
    saveToSnippetServer() {
        const xmlHttp = new XMLHttpRequest();
        const hostDocument = this._root.current.ownerDocument;
        const json = this._getJson();
        xmlHttp.onreadystatechange = () => {
            if (xmlHttp.readyState == 4) {
                if (xmlHttp.status == 200) {
                    const snippet = JSON.parse(xmlHttp.responseText);
                    const oldId = this.props.context.snippetId;
                    this.props.context.snippetId = snippet.id;
                    if (snippet.version && snippet.version != "0") {
                        this.props.context.snippetId += "#" + snippet.version;
                    }
                    this.forceUpdate();
                    const windowAsAny = window;
                    if (windowAsAny.Playground && oldId) {
                        windowAsAny.Playground.onRequestCodeChangeObservable.notifyObservers({
                            regex: new RegExp(oldId, "g"),
                            replace: this.props.context.snippetId,
                        });
                    }
                    hostDocument.defaultView.alert("Animations saved with ID: " + this.props.context.snippetId);
                }
                else {
                    hostDocument.defaultView.alert(`Unable to save your animations. It may be too large (${(dataToSend.payload.length / 1024).toFixed(2)} KB). Please try reducing the number of animations or the number of keys per animation and try again.`);
                }
            }
        };
        xmlHttp.open("POST", core_Animations_animation__WEBPACK_IMPORTED_MODULE_3__.Animation.SnippetUrl + (this.props.context.snippetId ? "/" + this.props.context.snippetId : ""), true);
        xmlHttp.setRequestHeader("Content-Type", "application/json");
        const dataToSend = {
            payload: JSON.stringify({
                animations: json,
            }),
            name: "",
            description: "",
            tags: "",
        };
        xmlHttp.send(JSON.stringify(dataToSend));
    }
    saveToFile() {
        shared_ui_components_stringTools__WEBPACK_IMPORTED_MODULE_2__.StringTools.DownloadAsFile(this._root.current.ownerDocument, this._getJson(), "animations.json");
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "save-animation-pane", ref: this._root, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "save-animation-list", children: this.props.context.animations?.map((a, i) => {
                        const animation = this.props.context.useTargetAnimations ? a.animation : a;
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "save-animation-list-entry", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", value: animation.name, defaultChecked: true, onClick: (evt) => {
                                        if (evt.currentTarget.checked) {
                                            this._selectedAnimations.push(animation);
                                        }
                                        else {
                                            const index = this._selectedAnimations.indexOf(animation);
                                            if (index > -1) {
                                                this._selectedAnimations.splice(index, 1);
                                            }
                                        }
                                    } }), animation.name] }, i));
                    }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "save-animation-buttons", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "simple-button", id: "save-snippet", type: "button", onClick: () => {
                                this.saveToSnippetServer();
                            }, children: "Save Snippet" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "simple-button", id: "save-file", type: "button", onClick: () => {
                                this.saveToFile();
                            }, children: "Save File" })] }), this.props.context.snippetId && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "save-animation-snippet", children: ["Snippet ID: ", this.props.context.snippetId] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/sideBarComponent.js":
/*!*******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/sideBarComponent.js ***!
  \*******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1807372__) => {

"use strict";
__nested_webpack_require_1807372__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1807372__.d(__nested_webpack_exports__, {
/* harmony export */   SideBarComponent: () => (/* binding */ SideBarComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1807372__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1807372__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1807372__(/*! ../controls/actionButtonComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/actionButtonComponent.js");
/* harmony import */ var _animationListComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1807372__(/*! ./animationListComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/animationListComponent.js");
/* harmony import */ var _controls_textInputComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1807372__(/*! ../controls/textInputComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/textInputComponent.js");
/* harmony import */ var _saveAnimationComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1807372__(/*! ./saveAnimationComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/saveAnimationComponent.js");
/* harmony import */ var _loadAnimationComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1807372__(/*! ./loadAnimationComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/loadAnimationComponent.js");
/* harmony import */ var _addAnimationComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1807372__(/*! ./addAnimationComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/addAnimationComponent.js");
/* harmony import */ var _editAnimationComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1807372__(/*! ./editAnimationComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/sideBar/editAnimationComponent.js");
/* harmony import */ var _scss_sideBar_scss__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1807372__(/*! ../scss/sideBar.scss */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/sideBar.scss");
/* harmony import */ var _assets_addAnimationIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1807372__(/*! ../assets/addAnimationIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/addAnimationIcon.svg");
/* harmony import */ var _assets_loadIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1807372__(/*! ../assets/loadIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/loadIcon.svg");
/* harmony import */ var _assets_saveIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1807372__(/*! ../assets/saveIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/saveIcon.svg");
/* harmony import */ var _assets_editIcon_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1807372__(/*! ../assets/editIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/editIcon.svg");














var Mode;
(function (Mode) {
    Mode[Mode["Edit"] = 0] = "Edit";
    Mode[Mode["Add"] = 1] = "Add";
    Mode[Mode["Load"] = 2] = "Load";
    Mode[Mode["Save"] = 3] = "Save";
})(Mode || (Mode = {}));
class SideBarComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { mode: Mode.Edit };
        this.props.context.onDeleteAnimation.add((animationToDelete) => {
            const indexInActiveList = this.props.context.activeAnimations.indexOf(animationToDelete);
            if (indexInActiveList !== -1) {
                this.props.context.activeAnimations.splice(indexInActiveList, 1);
                this.props.context.onActiveAnimationChanged.notifyObservers({});
            }
            let index = -1;
            if (this.props.context.useTargetAnimations) {
                const targetedAnimations = this.props.context.animations;
                for (let i = 0; i < targetedAnimations.length; i++) {
                    if (targetedAnimations[i].animation === animationToDelete) {
                        index = i;
                        break;
                    }
                }
            }
            else {
                index = this.props.context.animations.indexOf(animationToDelete);
            }
            if (index > -1) {
                this.props.context.animations.splice(index, 1);
                this.forceUpdate();
            }
        });
        this.props.context.onAnimationsLoaded.add(() => this.setState({ mode: Mode.Edit }));
    }
    _onAddAnimation() {
        if (this.state.mode === Mode.Add) {
            return;
        }
        this.setState({ mode: Mode.Add });
    }
    _onLoadAnimation() {
        if (this.state.mode === Mode.Load) {
            return;
        }
        this.setState({ mode: Mode.Load });
    }
    _onSaveAnimation() {
        if (this.state.mode === Mode.Save) {
            return;
        }
        this.setState({ mode: Mode.Save });
    }
    _onEditAnimation() {
        if (this.state.mode === Mode.Edit) {
            return;
        }
        this.setState({ mode: Mode.Edit });
    }
    render() {
        let fps = "60";
        if (this.props.context.animations && this.props.context.animations.length) {
            if (this.props.context.useTargetAnimations) {
                fps = this.props.context.animations[0].animation.framePerSecond.toString();
            }
            else {
                fps = this.props.context.animations[0].framePerSecond.toString();
            }
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "sideBar", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "menu-bar", className: this.props.context.useTargetAnimations ? "small" : "", children: [!this.props.context.useTargetAnimations && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { tooltip: "Add new animation", isActive: this.state.mode === Mode.Add, id: "add-animation", globalState: this.props.globalState, context: this.props.context, icon: _assets_addAnimationIcon_svg__WEBPACK_IMPORTED_MODULE_10__, onClick: () => this._onAddAnimation() })), !this.props.context.useTargetAnimations && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { tooltip: "Load animations", isActive: this.state.mode === Mode.Load, id: "load-animation", globalState: this.props.globalState, context: this.props.context, icon: _assets_loadIcon_svg__WEBPACK_IMPORTED_MODULE_11__, onClick: () => this._onLoadAnimation() })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { tooltip: "save current animations", isActive: this.state.mode === Mode.Save, id: "save-animation", globalState: this.props.globalState, context: this.props.context, icon: _assets_saveIcon_svg__WEBPACK_IMPORTED_MODULE_12__, onClick: () => this._onSaveAnimation() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { tooltip: "Edit animations", isActive: this.state.mode === Mode.Edit, id: "edit-animation", globalState: this.props.globalState, context: this.props.context, icon: _assets_editIcon_svg__WEBPACK_IMPORTED_MODULE_13__, onClick: () => this._onEditAnimation() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_textInputComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputComponent, { value: fps, complement: " fps", isNumber: true, onValueAsNumberChanged: (value) => {
                                this.props.context.animations?.forEach((anim) => {
                                    if (this.props.context.useTargetAnimations) {
                                        anim.animation.framePerSecond = value;
                                    }
                                    else {
                                        anim.framePerSecond = value;
                                    }
                                });
                            }, tooltip: "Framerate", id: "framerate-animation", globalState: this.props.globalState, context: this.props.context })] }), this.state.mode === Mode.Edit && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animationListComponent__WEBPACK_IMPORTED_MODULE_3__.AnimationListComponent, { globalState: this.props.globalState, context: this.props.context }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_editAnimationComponent__WEBPACK_IMPORTED_MODULE_8__.EditAnimationComponent, { globalState: this.props.globalState, context: this.props.context })] })), this.state.mode === Mode.Save && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_saveAnimationComponent__WEBPACK_IMPORTED_MODULE_5__.SaveAnimationComponent, { globalState: this.props.globalState, context: this.props.context }), this.state.mode === Mode.Load && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_loadAnimationComponent__WEBPACK_IMPORTED_MODULE_6__.LoadAnimationComponent, { globalState: this.props.globalState, context: this.props.context }), this.state.mode === Mode.Add && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_addAnimationComponent__WEBPACK_IMPORTED_MODULE_7__.AddAnimationComponent, { globalState: this.props.globalState, context: this.props.context })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/topBarComponent.js":
/*!**********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/topBarComponent.js ***!
  \**********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1818272__) => {

"use strict";
__nested_webpack_require_1818272__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1818272__.d(__nested_webpack_exports__, {
/* harmony export */   TopBarComponent: () => (/* binding */ TopBarComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1818272__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1818272__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1818272__(/*! ./controls/actionButtonComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/actionButtonComponent.js");
/* harmony import */ var _controls_textInputComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1818272__(/*! ./controls/textInputComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/controls/textInputComponent.js");
/* harmony import */ var _scss_topBar_scss__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1818272__(/*! ./scss/topBar.scss */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/topBar.scss");
/* harmony import */ var _assets_babylonLogo_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1818272__(/*! ./assets/babylonLogo.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/babylonLogo.svg");
/* harmony import */ var _assets_frameIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1818272__(/*! ./assets/frameIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/frameIcon.svg");
/* harmony import */ var _assets_newKeyIcon_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1818272__(/*! ./assets/newKeyIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/newKeyIcon.svg");
/* harmony import */ var _assets_flatTangentIcon_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1818272__(/*! ./assets/flatTangentIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/flatTangentIcon.svg");
/* harmony import */ var _assets_linearTangentIcon_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1818272__(/*! ./assets/linearTangentIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/linearTangentIcon.svg");
/* harmony import */ var _assets_breakTangentIcon_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1818272__(/*! ./assets/breakTangentIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/breakTangentIcon.svg");
/* harmony import */ var _assets_unifyTangentIcon_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1818272__(/*! ./assets/unifyTangentIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/unifyTangentIcon.svg");
/* harmony import */ var _assets_stepTangentIcon_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1818272__(/*! ./assets/stepTangentIcon.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/stepTangentIcon.svg");













class TopBarComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { keyFrameValue: "", keyValue: "", frameControlEnabled: false, valueControlEnabled: false };
        this._onFrameSetObserver = this.props.context.onFrameSet.add((newFrameValue) => {
            this.setState({ keyFrameValue: newFrameValue.toFixed(0) });
        });
        this._onValueSetObserver = this.props.context.onValueSet.add((newValue) => {
            this.setState({ keyValue: newValue.toFixed(2) });
        });
        this._onActiveAnimationChangedObserver = this.props.context.onActiveAnimationChanged.add(() => {
            this.setState({ keyFrameValue: "", keyValue: "" });
        });
        this._onActiveKeyPointChanged = this.props.context.onActiveKeyPointChanged.add(() => {
            const numKeys = this.props.context.activeKeyPoints?.length || 0;
            const numAnims = new Set(this.props.context.activeKeyPoints?.map((keyPointComponent) => keyPointComponent.props.curve.animation.uniqueId)).size;
            const frameControlEnabled = (numKeys === 1 && numAnims === 1) || (numKeys > 1 && numAnims > 1);
            const valueControlEnabled = numKeys > 0;
            const hasActiveQuaternionAnimation = this.props.context.hasActiveQuaternionAnimationKeyPoints();
            this.setState({
                keyFrameValue: "",
                keyValue: "",
                frameControlEnabled: frameControlEnabled && !hasActiveQuaternionAnimation,
                valueControlEnabled: valueControlEnabled && !hasActiveQuaternionAnimation,
            });
        });
    }
    componentWillUnmount() {
        if (this._onFrameSetObserver) {
            this.props.context.onFrameSet.remove(this._onFrameSetObserver);
        }
        if (this._onValueSetObserver) {
            this.props.context.onValueSet.remove(this._onValueSetObserver);
        }
        if (this._onActiveAnimationChangedObserver) {
            this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver);
        }
        if (this._onActiveKeyPointChanged) {
            this.props.context.onActiveKeyPointChanged.remove(this._onActiveKeyPointChanged);
        }
    }
    render() {
        const hasActiveAnimations = this.props.context.activeAnimations.length > 0;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "top-bar", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { id: "top-bar-logo", src: _assets_babylonLogo_svg__WEBPACK_IMPORTED_MODULE_5__ }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "top-bar-parent-name", children: this.props.context.title }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_textInputComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputComponent, { className: hasActiveAnimations && this.state.frameControlEnabled ? "" : "disabled", isNumber: true, value: this.state.keyFrameValue, tooltip: "Frame", id: "key-frame", onValueAsNumberChanged: (newValue) => {
                        if (newValue !== 0) {
                            this.props.context.onFrameManuallyEntered.notifyObservers(newValue);
                        }
                    }, globalState: this.props.globalState, context: this.props.context, disabled: parseFloat(this.state.keyFrameValue) === 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_textInputComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputComponent, { className: hasActiveAnimations && this.state.valueControlEnabled ? "" : "disabled", isNumber: true, value: this.state.keyValue, tooltip: "Value", id: "key-value", onValueAsNumberChanged: (newValue) => this.props.context.onValueManuallyEntered.notifyObservers(newValue), globalState: this.props.globalState, context: this.props.context }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { className: hasActiveAnimations ? "" : "disabled", tooltip: "New key", id: "new-key", globalState: this.props.globalState, context: this.props.context, icon: _assets_newKeyIcon_svg__WEBPACK_IMPORTED_MODULE_6__, onClick: () => this.props.context.onCreateOrUpdateKeyPointRequired.notifyObservers() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { tooltip: "Frame canvas", id: "frame-canvas", globalState: this.props.globalState, context: this.props.context, icon: _assets_frameIcon_svg__WEBPACK_IMPORTED_MODULE_7__, onClick: () => this.props.context.onFrameRequired.notifyObservers() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { className: this.props.context.activeKeyPoints && this.props.context.activeKeyPoints.length > 0 ? "" : "disabled", tooltip: "Flatten tangent", id: "flatten-tangent", globalState: this.props.globalState, context: this.props.context, icon: _assets_flatTangentIcon_svg__WEBPACK_IMPORTED_MODULE_8__, onClick: () => this.props.context.onFlattenTangentRequired.notifyObservers() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { className: this.props.context.activeKeyPoints && this.props.context.activeKeyPoints.length > 0 ? "" : "disabled", tooltip: "Linear tangent", id: "linear-tangent", globalState: this.props.globalState, context: this.props.context, icon: _assets_linearTangentIcon_svg__WEBPACK_IMPORTED_MODULE_9__, onClick: () => this.props.context.onLinearTangentRequired.notifyObservers() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { className: this.props.context.activeKeyPoints && this.props.context.activeKeyPoints.length > 0 ? "" : "disabled", tooltip: "Break tangent", id: "break-tangent", globalState: this.props.globalState, context: this.props.context, icon: _assets_breakTangentIcon_svg__WEBPACK_IMPORTED_MODULE_10__, onClick: () => this.props.context.onBreakTangentRequired.notifyObservers() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { className: this.props.context.activeKeyPoints && this.props.context.activeKeyPoints.length > 0 ? "" : "disabled", tooltip: "Unify tangent", id: "unify-tangent", globalState: this.props.globalState, context: this.props.context, icon: _assets_unifyTangentIcon_svg__WEBPACK_IMPORTED_MODULE_11__, onClick: () => this.props.context.onUnifyTangentRequired.notifyObservers() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_controls_actionButtonComponent__WEBPACK_IMPORTED_MODULE_2__.ActionButtonComponent, { className: this.props.context.activeKeyPoints && this.props.context.activeKeyPoints.length > 0 ? "" : "disabled", tooltip: "Step tangent", id: "step-tangent", globalState: this.props.globalState, context: this.props.context, icon: _assets_stepTangentIcon_svg__WEBPACK_IMPORTED_MODULE_12__, onClick: () => this.props.context.onStepTangentRequired.notifyObservers() })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/targetedAnimationPropertyGridComponent.js":
/*!*********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/targetedAnimationPropertyGridComponent.js ***!
  \*********************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1829584__) => {

"use strict";
__nested_webpack_require_1829584__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1829584__.d(__nested_webpack_exports__, {
/* harmony export */   TargetedAnimationGridComponent: () => (/* binding */ TargetedAnimationGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1829584__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1829584__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1829584__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1829584__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1829584__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1829584__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _curveEditor_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1829584__(/*! ./curveEditor/animationCurveEditorComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/animationCurveEditorComponent.js");
/* harmony import */ var _curveEditor_context__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1829584__(/*! ./curveEditor/context */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.js");








class TargetedAnimationGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.findAnimationGroup = () => {
            this._animationGroup = this.props.scene.animationGroups.find((ag) => {
                const ta = ag.targetedAnimations.find((ta) => ta === this.props.targetedAnimation);
                return ta !== undefined;
            });
        };
        this.playOrPause = () => {
            if (this._animationGroup) {
                if (this._animationGroup.isPlaying) {
                    this._animationGroup.stop();
                }
                else {
                    this._animationGroup.start();
                }
                this.forceUpdate();
            }
        };
        this.deleteAnimation = () => {
            if (this._animationGroup) {
                const index = this._animationGroup.targetedAnimations.indexOf(this.props.targetedAnimation);
                if (index > -1) {
                    this._animationGroup.targetedAnimations.splice(index, 1);
                    this.props.onSelectionChangedObservable?.notifyObservers(null);
                    if (this._animationGroup.isPlaying) {
                        this._animationGroup.stop();
                        this._animationGroup.start();
                    }
                }
            }
        };
        this.updateContextFromProps = () => {
            if (!this._animationCurveEditorContext) {
                this._animationCurveEditorContext = new _curveEditor_context__WEBPACK_IMPORTED_MODULE_7__.Context();
            }
            this._animationCurveEditorContext.title = this.props.targetedAnimation.target.name || "";
            this._animationCurveEditorContext.animations = [this.props.targetedAnimation.animation];
            this._animationCurveEditorContext.target = this.props.targetedAnimation.target;
            this._animationCurveEditorContext.scene = this.props.scene;
            if (this._animationGroup) {
                this._animationCurveEditorContext.rootAnimationGroup = this._animationGroup;
            }
        };
    }
    componentDidMount() {
        this.findAnimationGroup();
        this.updateContextFromProps();
    }
    componentDidUpdate(prevProps, prevState, snapshot) {
        if (prevProps.targetedAnimation !== this.props.targetedAnimation) {
            this.findAnimationGroup();
            this.updateContextFromProps();
        }
    }
    render() {
        const targetedAnimation = this.props.targetedAnimation;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Class", value: targetedAnimation.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: targetedAnimation.animation, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), targetedAnimation.target.name && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Target", value: targetedAnimation.target.name, onLink: () => this.props.globalState.onSelectionChangedObservable.notifyObservers(targetedAnimation) })), this._animationCurveEditorContext && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_curveEditor_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_6__.AnimationCurveEditorComponent, { globalState: this.props.globalState, context: this._animationCurveEditorContext }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__.ButtonLineComponent, { label: "Dispose", onClick: this.deleteAnimation })] }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/arcRotateCameraPropertyGridComponent.js":
/*!****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/arcRotateCameraPropertyGridComponent.js ***!
  \****************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1836634__) => {

"use strict";
__nested_webpack_require_1836634__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1836634__.d(__nested_webpack_exports__, {
/* harmony export */   ArcRotateCameraPropertyGridComponent: () => (/* binding */ ArcRotateCameraPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1836634__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1836634__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1836634__(/*! ./commonCameraPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/commonCameraPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1836634__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1836634__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1836634__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1836634__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1836634__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");








class ArcRotateCameraPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const camera = this.props.camera;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonCameraPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, camera: camera, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TRANSFORMS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_7__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Target", target: camera, propertyName: "target", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Alpha", useEuler: this.props.globalState.onlyUseEulers, target: camera, propertyName: "alpha", minimum: camera.lowerAlphaLimit || 0, maximum: camera.upperAlphaLimit || 2 * Math.PI, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Beta", useEuler: this.props.globalState.onlyUseEulers, target: camera, propertyName: "beta", minimum: camera.lowerAlphaLimit || 0, maximum: camera.upperBetaLimit || 2 * Math.PI, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Radius", target: camera, propertyName: "radius", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "CONTROLS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Angular sensitivity X", target: camera, propertyName: "angularSensibilityX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Angular sensitivity Y", target: camera, propertyName: "angularSensibilityY", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Panning sensitivity", target: camera, propertyName: "panningSensibility", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Pinch delta percentage", target: camera, propertyName: "pinchDeltaPercentage", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Wheel delta percentage", target: camera, propertyName: "wheelDeltaPercentage", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Speed", target: camera, propertyName: "speed", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "COLLISIONS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { label: "Check collisions", target: camera, propertyName: "checkCollisions", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_7__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Collision radius", target: camera, propertyName: "collisionRadius", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LIMITS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Lower alpha limit", target: camera, propertyName: "lowerAlphaLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Upper alpha limit", target: camera, propertyName: "upperAlphaLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Lower beta limit", target: camera, propertyName: "lowerBetaLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Upper beta limit", target: camera, propertyName: "upperBetaLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Lower radius limit", target: camera, propertyName: "lowerRadiusLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Upper radius limit", target: camera, propertyName: "upperRadiusLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "BEHAVIORS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { label: "Auto rotation", target: camera, propertyName: "useAutoRotationBehavior", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { label: "Bouncing", target: camera, propertyName: "useBouncingBehavior", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { label: "Framing", target: camera, propertyName: "useFramingBehavior", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/commonCameraPropertyGridComponent.js":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/commonCameraPropertyGridComponent.js ***!
  \*************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1848392__) => {

"use strict";
__nested_webpack_require_1848392__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1848392__.d(__nested_webpack_exports__, {
/* harmony export */   CommonCameraPropertyGridComponent: () => (/* binding */ CommonCameraPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1848392__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1848392__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1848392__(/*! core/Cameras/camera */ "core/Misc/observable");
/* harmony import */ var core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1848392__.n(core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1848392__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1848392__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1848392__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1848392__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1848392__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1848392__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1848392__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1848392__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1848392__(/*! ../animations/animationPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_hexLineComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1848392__(/*! shared-ui-components/lines/hexLineComponent */ "../../../dev/sharedUiComponents/dist/lines/hexLineComponent.js");
/* harmony import */ var _parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1848392__(/*! ../parentPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/parentPropertyGridComponent.js");














class CommonCameraPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { mode: this.props.camera.mode };
    }
    render() {
        const camera = this.props.camera;
        const modeOptions = [
            { label: "Perspective", value: core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2__.Camera.PERSPECTIVE_CAMERA },
            { label: "Orthographic", value: core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2__.Camera.ORTHOGRAPHIC_CAMERA },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: camera, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "ID", value: camera.id }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_10__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: camera, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "Unique ID", value: camera.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "Class", value: camera.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Near plane", target: camera, propertyName: "minZ", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__.ParentPropertyGridComponent, { globalState: this.props.globalState, node: camera, lockObject: this.props.lockObject }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Far plane", target: camera, propertyName: "maxZ", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Inertia", target: camera, propertyName: "inertia", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_hexLineComponent__WEBPACK_IMPORTED_MODULE_12__.HexLineComponent, { isInteger: true, lockObject: this.props.lockObject, label: "Layer mask", target: camera, propertyName: "layerMask", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Mode", options: modeOptions, target: camera, propertyName: "mode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ mode: value }) }), camera.mode === core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2__.Camera.PERSPECTIVE_CAMERA && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Field of view", target: camera, useEuler: this.props.globalState.onlyUseEulers, propertyName: "fov", minimum: 0.1, maximum: Math.PI, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), camera.mode === core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2__.Camera.ORTHOGRAPHIC_CAMERA && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Left", target: camera, propertyName: "orthoLeft", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), camera.mode === core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2__.Camera.ORTHOGRAPHIC_CAMERA && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Top", target: camera, propertyName: "orthoTop", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), camera.mode === core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2__.Camera.ORTHOGRAPHIC_CAMERA && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Right", target: camera, propertyName: "orthoRight", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), camera.mode === core_Cameras_camera__WEBPACK_IMPORTED_MODULE_2__.Camera.ORTHOGRAPHIC_CAMERA && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Bottom", target: camera, propertyName: "orthoBottom", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__.ButtonLineComponent, { label: "Dispose", onClick: () => {
                                camera.dispose();
                                this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__.AnimationGridComponent, { globalState: this.props.globalState, animatable: camera, scene: camera.getScene(), lockObject: this.props.lockObject })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/followCameraPropertyGridComponent.js":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/followCameraPropertyGridComponent.js ***!
  \*************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1859486__) => {

"use strict";
__nested_webpack_require_1859486__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1859486__.d(__nested_webpack_exports__, {
/* harmony export */   FollowCameraPropertyGridComponent: () => (/* binding */ FollowCameraPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1859486__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1859486__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1859486__(/*! ./commonCameraPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/commonCameraPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1859486__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1859486__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");





class FollowCameraPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const camera = this.props.camera;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonCameraPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, camera: camera, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TRANSFORMS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Radius", target: camera, propertyName: "radius", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Rotation offset", target: camera, propertyName: "rotationOffset", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Height offset", target: camera, propertyName: "heightOffset", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Camera acceleration", target: camera, propertyName: "cameraAcceleration", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LIMITS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Lower radius limit", target: camera, propertyName: "lowerRadiusLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Upper radius limit", target: camera, propertyName: "upperRadiusLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Lower rotation offset limit", target: camera, propertyName: "lowerRotationOffsetLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Upper rotation offset limit", target: camera, propertyName: "upperRotationOffsetLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Lower height offset limit", target: camera, propertyName: "lowerHeightOffsetLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Upper height offset limit", target: camera, propertyName: "upperHeightOffsetLimit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Max camera speed", target: camera, propertyName: "maxCameraSpeed", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/freeCameraPropertyGridComponent.js":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/freeCameraPropertyGridComponent.js ***!
  \***********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1866314__) => {

"use strict";
__nested_webpack_require_1866314__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1866314__.d(__nested_webpack_exports__, {
/* harmony export */   FreeCameraPropertyGridComponent: () => (/* binding */ FreeCameraPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1866314__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1866314__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1866314__(/*! ./commonCameraPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/cameras/commonCameraPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1866314__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1866314__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1866314__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1866314__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");







class FreeCameraPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const camera = this.props.camera;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonCameraPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonCameraPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, camera: camera, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TRANSFORMS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Target", target: camera, propertyName: "target", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Position", target: camera, propertyName: "position", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Rotation", noSlider: true, useEuler: this.props.globalState.onlyUseEulers, target: camera, propertyName: "rotation", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "CONTROLS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Angular sensitivity", target: camera, propertyName: "angularSensibility", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Speed", target: camera, propertyName: "speed", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "COLLISIONS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Check collisions", target: camera, propertyName: "checkCollisions", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Apply gravity", target: camera, propertyName: "applyGravity", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Ellipsoid", target: camera, propertyName: "ellipsoid", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Ellipsoid offset", target: camera, propertyName: "ellipsoidOffset", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/commonPropertyGridComponent.js":
/*!***********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/commonPropertyGridComponent.js ***!
  \***********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1873058__) => {

"use strict";
__nested_webpack_require_1873058__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1873058__.d(__nested_webpack_exports__, {
/* harmony export */   CommonPropertyGridComponent: () => (/* binding */ CommonPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1873058__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1873058__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1873058__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1873058__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_indentedTextLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1873058__(/*! shared-ui-components/lines/indentedTextLineComponent */ "../../../dev/sharedUiComponents/dist/lines/indentedTextLineComponent.js");





class CommonPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    renderLevel(jsonObject) {
        const components = [];
        for (const data in jsonObject) {
            const value = jsonObject[data];
            const type = Object.prototype.toString.call(value);
            switch (type) {
                case "[object String]":
                    components.push((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: data, ignoreValue: true }, data));
                    components.push((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_indentedTextLineComponent__WEBPACK_IMPORTED_MODULE_4__.IndentedTextLineComponent, { value: value }, data + value));
                    break;
                case "[object Array]":
                    components.push((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: data, ignoreValue: true }, data));
                    for (const entry of value) {
                        components.push((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_indentedTextLineComponent__WEBPACK_IMPORTED_MODULE_4__.IndentedTextLineComponent, { value: entry }, data + entry));
                    }
                    break;
                case "[object Object]":
                    components.push((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: data, ignoreValue: true }, data));
                    for (const entryKey in value) {
                        components.push((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: entryKey, value: value[entryKey], additionalClass: "reduced-opacity" }, data + entryKey));
                    }
                    break;
            }
        }
        return components;
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: this.props.host.metadata && this.props.host.metadata.xmp && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "XMP METADATA", selection: this.props.globalState, children: this.renderLevel(this.props.host.metadata.xmp) })) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js":
/*!***********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js ***!
  \***********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1877609__) => {

"use strict";
__nested_webpack_require_1877609__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1877609__.d(__nested_webpack_exports__, {
/* harmony export */   CustomPropertyGridComponent: () => (/* binding */ CustomPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1877609__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1877609__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector2LineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/vector2LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var _lines_quaternionLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1877609__(/*! ../../lines/quaternionLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/quaternionLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1877609__(/*! shared-ui-components/lines/fileButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1877609__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__nested_webpack_require_1877609__.n(core_Misc_logger__WEBPACK_IMPORTED_MODULE_14__);















class CustomPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { mode: 0 };
    }
    renderInspectable(inspectable) {
        switch (inspectable.type) {
            case 0 /* InspectableType.Checkbox */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: inspectable.label, target: this.props.target, propertyName: inspectable.propertyName, onPropertyChangedObservable: this.props.onPropertyChangedObservable }, inspectable.label));
            case 1 /* InspectableType.Slider */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: inspectable.label, target: this.props.target, propertyName: inspectable.propertyName, step: inspectable.step !== undefined ? inspectable.step : 0.1, minimum: inspectable.min !== undefined ? inspectable.min : 0, maximum: inspectable.max !== undefined ? inspectable.max : 1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }, inspectable.label));
            case 10 /* InspectableType.Vector2 */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector2LineComponent__WEBPACK_IMPORTED_MODULE_5__.Vector2LineComponent, { lockObject: this.props.lockObject, label: inspectable.label, target: this.props.target, propertyName: inspectable.propertyName, onPropertyChangedObservable: this.props.onPropertyChangedObservable }, inspectable.label));
            case 2 /* InspectableType.Vector3 */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__.Vector3LineComponent, { lockObject: this.props.lockObject, label: inspectable.label, target: this.props.target, propertyName: inspectable.propertyName, onPropertyChangedObservable: this.props.onPropertyChangedObservable }, inspectable.label));
            case 3 /* InspectableType.Quaternion */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_quaternionLineComponent__WEBPACK_IMPORTED_MODULE_7__.QuaternionLineComponent, { lockObject: this.props.lockObject, useEuler: this.props.globalState.onlyUseEulers, label: inspectable.label, target: this.props.target, propertyName: inspectable.propertyName, onPropertyChangedObservable: this.props.onPropertyChangedObservable }, inspectable.label));
            case 4 /* InspectableType.Color3 */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_2__.Color3LineComponent, { lockObject: this.props.lockObject, label: inspectable.label, target: this.props.target, propertyName: inspectable.propertyName, onPropertyChangedObservable: this.props.onPropertyChangedObservable }, inspectable.label));
            case 5 /* InspectableType.String */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextInputLineComponent, { label: inspectable.label, lockObject: this.props.lockObject, target: this.props.target, propertyName: inspectable.propertyName, onPropertyChangedObservable: this.props.onPropertyChangedObservable }, inspectable.label));
            case 6 /* InspectableType.Button */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__.ButtonLineComponent, { label: inspectable.label, onClick: inspectable.callback ||
                        function () {
                            core_Misc_logger__WEBPACK_IMPORTED_MODULE_14__.Logger.Warn("no call back function added");
                        } }, inspectable.label));
            case 7 /* InspectableType.Options */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_11__.OptionsLine, { label: inspectable.label, target: this.props.target, propertyName: inspectable.propertyName, options: inspectable.options || [], onSelect: inspectable.callback ||
                        function (value) {
                            core_Misc_logger__WEBPACK_IMPORTED_MODULE_14__.Logger.Warn(`Option ${value} is selected`);
                        } }, inspectable.label));
            case 8 /* InspectableType.Tab */:
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_12__.TextLineComponent, { label: inspectable.label, value: " " }, inspectable.label);
            case 9 /* InspectableType.FileButton */:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_13__.FileButtonLine, { label: inspectable.label, onClick: inspectable.fileCallback ||
                        function () {
                            core_Misc_logger__WEBPACK_IMPORTED_MODULE_14__.Logger.Warn("no file call back function added");
                        }, accept: inspectable.accept || "*" }, inspectable.label));
        }
        return null;
    }
    render() {
        const inspectables = this.props.target.inspectableCustomProperties;
        if (!inspectables || inspectables.length === 0) {
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_8__.LineContainerComponent, { title: "CUSTOM", selection: this.props.globalState, children: inspectables.map((inspectable) => {
                return this.renderInspectable(inspectable);
            }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/emptyPropertyGridComponent.js":
/*!**********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/emptyPropertyGridComponent.js ***!
  \**********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1888110__) => {

"use strict";
__nested_webpack_require_1888110__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1888110__.d(__nested_webpack_exports__, {
/* harmony export */   EmptyPropertyGridComponent: () => (/* binding */ EmptyPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1888110__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1888110__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1888110__(/*! ./customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");



class EmptyPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CustomPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, target: this.props.item, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/fogPropertyGridComponent.js":
/*!********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/fogPropertyGridComponent.js ***!
  \********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1889939__) => {

"use strict";
__nested_webpack_require_1889939__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1889939__.d(__nested_webpack_exports__, {
/* harmony export */   FogPropertyGridComponent: () => (/* binding */ FogPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1889939__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1889939__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_scene__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1889939__(/*! core/scene */ "core/Misc/observable");
/* harmony import */ var core_scene__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1889939__.n(core_scene__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1889939__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1889939__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1889939__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");






class FogPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { mode: this.props.scene.fogMode };
    }
    render() {
        const scene = this.props.scene;
        const fogModeOptions = [
            { label: "None", value: core_scene__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_NONE },
            { label: "Linear", value: core_scene__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_LINEAR },
            { label: "Exp", value: core_scene__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_EXP },
            { label: "Exp2", value: core_scene__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_EXP2 },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__.OptionsLine, { label: "Fog mode", options: fogModeOptions, target: scene, propertyName: "fogMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ mode: value }) }), this.state.mode !== core_scene__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_NONE && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_3__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Fog color", target: scene, propertyName: "fogColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (this.state.mode === core_scene__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_EXP || this.state.mode === core_scene__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_EXP2) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Fog density", target: scene, propertyName: "fogDensity", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), this.state.mode === core_scene__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_LINEAR && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Fog start", target: scene, propertyName: "fogStart", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), this.state.mode === core_scene__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_LINEAR && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Fog end", target: scene, propertyName: "fogEnd", onPropertyChangedObservable: this.props.onPropertyChangedObservable }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/layers/layerPropertyGridComponent.js":
/*!*****************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/layers/layerPropertyGridComponent.js ***!
  \*****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1894941__) => {

"use strict";
__nested_webpack_require_1894941__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1894941__.d(__nested_webpack_exports__, {
/* harmony export */   LayerPropertyGridComponent: () => (/* binding */ LayerPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1894941__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1894941__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1894941__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1894941__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1894941__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1894941__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var core_Layers_glowLayer__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1894941__(/*! core/Layers/highlightLayer */ "core/Misc/observable");
/* harmony import */ var core_Layers_glowLayer__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_1894941__.n(core_Layers_glowLayer__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1894941__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");









class LayerPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const layer = this.props.layer;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Class", value: layer.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: layer, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), layer.getClassName() === core_Layers_glowLayer__WEBPACK_IMPORTED_MODULE_6__.GlowLayer.EffectName && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fragment", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", target: layer, propertyName: "intensity", minimum: 0, maximum: 2, step: 0.01, decimalCount: 2, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Blur Kernel Size", target: layer, propertyName: "blurKernelSize", minimum: 0, maximum: 64, step: 1, decimalCount: 0, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })), layer.getClassName() === core_Layers_glowLayer__WEBPACK_IMPORTED_MODULE_6__.HighlightLayer.EffectName && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fragment", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__.CheckBoxLineComponent, { label: "Inner Glow", target: layer, propertyName: "innerGlow", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__.CheckBoxLineComponent, { label: "Outer Glow", target: layer, propertyName: "outerGlow", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonLightPropertyGridComponent.js":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonLightPropertyGridComponent.js ***!
  \***********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1900537__) => {

"use strict";
__nested_webpack_require_1900537__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1900537__.d(__nested_webpack_exports__, {
/* harmony export */   CommonLightPropertyGridComponent: () => (/* binding */ CommonLightPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1900537__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1900537__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1900537__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1900537__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1900537__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1900537__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1900537__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1900537__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1900537__(/*! ../animations/animationPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js");
/* harmony import */ var _parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1900537__(/*! ../parentPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/parentPropertyGridComponent.js");










class CommonLightPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const light = this.props.light;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: light, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "ID", value: light.id }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: light, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Unique ID", value: light.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Class", value: light.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_9__.ParentPropertyGridComponent, { globalState: this.props.globalState, node: light, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Intensity", target: light, propertyName: "intensity", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: "Dispose", onClick: () => {
                                light.dispose();
                                this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__.AnimationGridComponent, { globalState: this.props.globalState, animatable: light, scene: light.getScene(), lockObject: this.props.lockObject })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonShadowLightPropertyGridComponent.js":
/*!*****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonShadowLightPropertyGridComponent.js ***!
  \*****************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1906775__) => {

"use strict";
__nested_webpack_require_1906775__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1906775__.d(__nested_webpack_exports__, {
/* harmony export */   CommonShadowLightPropertyGridComponent: () => (/* binding */ CommonShadowLightPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1906775__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1906775__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1906775__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1906775__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1906775__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1906775__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1906775__(/*! core/Lights/directionalLight */ "core/Misc/observable");
/* harmony import */ var core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_1906775__.n(core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1906775__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1906775__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");











class CommonShadowLightPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._internals = {
            generatorType: 0,
            mapSize: 1024,
        };
    }
    createShadowGenerator() {
        const light = this.props.light;
        const scene = light.getScene();
        const internals = this._internals;
        const generator = internals.generatorType === 0 ? new core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator(internals.mapSize, light) : new core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.CascadedShadowGenerator(internals.mapSize, light);
        scene.meshes.forEach((m) => {
            if (m.infiniteDistance) {
                return;
            }
            generator.addShadowCaster(m);
            if (!m.isAnInstance) {
                m.receiveShadows = true;
            }
        });
        this.forceUpdate();
    }
    disposeShadowGenerator() {
        const light = this.props.light;
        light.getShadowGenerator()?.dispose();
        this.forceUpdate();
    }
    render() {
        const light = this.props.light;
        const internals = this._internals;
        const generator = light.getShadowGenerator() || null;
        const csmGenerator = generator instanceof core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.CascadedShadowGenerator;
        const camera = light.getScene().activeCamera;
        const typeGeneratorOptions = [{ label: "Shadow Generator", value: 0 }];
        if (light instanceof core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.DirectionalLight) {
            typeGeneratorOptions.push({ label: "Cascaded Shadow Generator", value: 1 });
        }
        const mapSizeOptions = [
            { label: "4096x4096", value: 4096 },
            { label: "2048x2048", value: 2048 },
            { label: "1024x1024", value: 1024 },
            { label: "512x512", value: 512 },
            { label: "256x256", value: 256 },
        ];
        let blurModeOptions;
        if (generator instanceof core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.CascadedShadowGenerator) {
            blurModeOptions = [
                { label: "None", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_NONE },
                { label: "PCF", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_PCF },
                { label: "PCSS", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_PCSS },
            ];
        }
        else {
            blurModeOptions = [
                { label: "None", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_NONE },
                { label: "PCF", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_PCF },
                { label: "PCSS", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_PCSS },
                { label: "Poisson", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_POISSONSAMPLING },
                { label: "Exponential", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP },
                { label: "Blurred exponential", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP },
                { label: "Close exponential", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP },
                { label: "Blurred close exponential", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP },
            ];
        }
        const filteringQualityOptions = [
            { label: "Low", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.QUALITY_LOW },
            { label: "Medium", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.QUALITY_MEDIUM },
            { label: "High", value: core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.QUALITY_HIGH },
        ];
        const numCascadesOptions = [
            { label: "2", value: 2 },
            { label: "3", value: 3 },
            { label: "4", value: 4 },
        ];
        const near = camera ? camera.minZ : 0, far = camera ? (camera.maxZ ? camera.maxZ : 500000) : 0;
        const filter = generator ? generator.filter : 0;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SHADOWS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Shadows enabled", target: light, propertyName: "shadowEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), !csmGenerator && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Shadows near plane", target: light, propertyName: "shadowMinZ", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Shadows far plane", target: light, propertyName: "shadowMaxZ", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }), generator == null && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SHADOW GENERATOR", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__.OptionsLine, { label: "Type", options: typeGeneratorOptions, target: internals, propertyName: "generatorType" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__.OptionsLine, { label: "Map size", options: mapSizeOptions, target: internals, propertyName: "mapSize" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_8__.ButtonLineComponent, { label: "Create generator", onClick: () => this.createShadowGenerator() })] })), generator !== null && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SHADOW GENERATOR", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_8__.ButtonLineComponent, { label: "Dispose generator", onClick: () => this.disposeShadowGenerator() }), csmGenerator && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__.OptionsLine, { label: "Num cascades", options: numCascadesOptions, target: generator, propertyName: "numCascades", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Debug mode", target: generator, propertyName: "debug", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Stabilize cascades", target: generator, propertyName: "stabilizeCascades", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Lambda", minimum: 0, maximum: 1.0, step: 0.01, target: generator, propertyName: "lambda", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Cascade blend", minimum: 0, maximum: 1.0, step: 0.01, target: generator, propertyName: "cascadeBlendPercentage", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Depth clamp", target: generator, propertyName: "depthClamp", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Auto-Calc depth bounds", target: generator, propertyName: "autoCalcDepthBounds", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Shadow MaxZ", minimum: near, maximum: far, step: 0.5, target: generator, propertyName: "shadowMaxZ", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, digits: 4, step: "0.0001", label: "Bias", target: generator, propertyName: "bias", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Normal bias", target: generator, propertyName: "normalBias", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Darkness", target: generator, minimum: 0, maximum: 1, step: 0.01, propertyName: "darkness", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Allow transparent shadows", target: generator, propertyName: "transparencyShadow", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__.OptionsLine, { label: "Filter", options: blurModeOptions, onSelect: () => {
                                this.forceUpdate();
                            }, target: generator, propertyName: "filter", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_PCF || filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_PCSS) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__.OptionsLine, { label: "Filtering quality", options: filteringQualityOptions, onSelect: () => {
                                this.forceUpdate();
                            }, target: generator, propertyName: "filteringQuality", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_PCSS && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Penumbra ratio", minimum: 0, maximum: 0.5, step: 0.001, target: generator, propertyName: "contactHardeningLightSizeUVRatio", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), !csmGenerator && (filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP || filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Use kernel blur", target: generator, propertyName: "useKernelBlur", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable })), generator instanceof core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator &&
                            (filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP || filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) &&
                            !generator.useKernelBlur && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Blur box offset", target: generator, propertyName: "blurBoxOffset", minimum: 1, maximum: 64, step: 1, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), generator instanceof core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator &&
                            (filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP || filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) &&
                            generator.useKernelBlur && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Blur kernel", target: generator, propertyName: "blurKernel", minimum: 1, maximum: 64, step: 1, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), generator instanceof core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator &&
                            (filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP || filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Depth scale", target: generator, propertyName: "depthScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), generator instanceof core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator &&
                            (filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP || filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Blur scale", target: generator, propertyName: "blurScale", minimum: 1, maximum: 4, step: 1, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), csmGenerator && filter === core_Lights_Shadows_shadowGenerator__WEBPACK_IMPORTED_MODULE_6__.ShadowGenerator.FILTER_PCSS && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Penumbra darkness", minimum: 0, maximum: 1.0, step: 0.01, target: generator, propertyName: "penumbraDarkness", onPropertyChangedObservable: this.props.onPropertyChangedObservable }))] }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/directionalLightPropertyGridComponent.js":
/*!****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/directionalLightPropertyGridComponent.js ***!
  \****************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1927481__) => {

"use strict";
__nested_webpack_require_1927481__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1927481__.d(__nested_webpack_exports__, {
/* harmony export */   DirectionalLightPropertyGridComponent: () => (/* binding */ DirectionalLightPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1927481__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1927481__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1927481__(/*! ./commonLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonLightPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1927481__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1927481__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1927481__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var _commonShadowLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1927481__(/*! ./commonShadowLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonShadowLightPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1927481__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var core_Lights_Shadows_cascadedShadowGenerator__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1927481__(/*! core/Debug/directionalLightFrustumViewer */ "core/Misc/observable");
/* harmony import */ var core_Lights_Shadows_cascadedShadowGenerator__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__nested_webpack_require_1927481__.n(core_Lights_Shadows_cascadedShadowGenerator__WEBPACK_IMPORTED_MODULE_8__);










class DirectionalLightPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    displayFrustum() {
        const light = this.props.light;
        const camera = light.getScene().activeCamera;
        const displayFrustum = (light._displayFrustum = !light._displayFrustum);
        if (light._displayFrustumObservable) {
            light.getScene().onAfterRenderObservable.remove(light._displayFrustumObservable);
            light._displayFrustumDLH.dispose();
        }
        if (displayFrustum && camera) {
            const dlh = (light._displayFrustumDLH = new core_Lights_Shadows_cascadedShadowGenerator__WEBPACK_IMPORTED_MODULE_8__.DirectionalLightFrustumViewer(light, camera));
            light._displayFrustumObservable = light.getScene().onAfterRenderObservable.add(() => {
                dlh.update();
            });
        }
    }
    render() {
        const light = this.props.light;
        const generator = light.getShadowGenerator() || null;
        const hideAutoCalcShadowZBounds = generator instanceof core_Lights_Shadows_cascadedShadowGenerator__WEBPACK_IMPORTED_MODULE_8__.CascadedShadowGenerator;
        const displayFrustum = light._displayFrustum ?? false;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonLightPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, light: light, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SETUP", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Diffuse", target: light, propertyName: "diffuse", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Specular", target: light, propertyName: "specular", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Position", target: light, propertyName: "position", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Direction", target: light, propertyName: "direction", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), !hideAutoCalcShadowZBounds && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__.CheckBoxLineComponent, { label: "Auto Calc Shadow ZBounds", target: light, propertyName: "autoCalcShadowZBounds", onPropertyChangedObservable: this.props.onPropertyChangedObservable }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonShadowLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__.CommonShadowLightPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, light: light, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "DEBUG", closed: true, selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__.CheckBoxLineComponent, { label: "Display frustum", isSelected: () => displayFrustum, onSelect: () => this.displayFrustum() }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/hemisphericLightPropertyGridComponent.js":
/*!****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/hemisphericLightPropertyGridComponent.js ***!
  \****************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1935072__) => {

"use strict";
__nested_webpack_require_1935072__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1935072__.d(__nested_webpack_exports__, {
/* harmony export */   HemisphericLightPropertyGridComponent: () => (/* binding */ HemisphericLightPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1935072__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1935072__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1935072__(/*! ./commonLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonLightPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1935072__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1935072__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1935072__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");






class HemisphericLightPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const light = this.props.light;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonLightPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, light: light, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SETUP", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Diffuse", target: light, propertyName: "diffuse", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Ground", target: light, propertyName: "groundColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Direction", target: light, propertyName: "direction", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/pointLightPropertyGridComponent.js":
/*!**********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/pointLightPropertyGridComponent.js ***!
  \**********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1939130__) => {

"use strict";
__nested_webpack_require_1939130__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1939130__.d(__nested_webpack_exports__, {
/* harmony export */   PointLightPropertyGridComponent: () => (/* binding */ PointLightPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1939130__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1939130__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1939130__(/*! ./commonLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonLightPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1939130__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1939130__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1939130__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var _commonShadowLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1939130__(/*! ./commonShadowLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonShadowLightPropertyGridComponent.js");







class PointLightPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const light = this.props.light;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonLightPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, light: light, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SETUP", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Diffuse", target: light, propertyName: "diffuse", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Specular", target: light, propertyName: "specular", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Position", target: light, propertyName: "position", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonShadowLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__.CommonShadowLightPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, light: light, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/spotLightPropertyGridComponent.js":
/*!*********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/spotLightPropertyGridComponent.js ***!
  \*********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1943774__) => {

"use strict";
__nested_webpack_require_1943774__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1943774__.d(__nested_webpack_exports__, {
/* harmony export */   SpotLightPropertyGridComponent: () => (/* binding */ SpotLightPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1943774__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1943774__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1943774__(/*! ./commonLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonLightPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1943774__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1943774__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1943774__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1943774__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _commonShadowLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1943774__(/*! ./commonShadowLightPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/lights/commonShadowLightPropertyGridComponent.js");








class SpotLightPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const light = this.props.light;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonLightPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, light: light, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SETUP", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Diffuse", target: light, propertyName: "diffuse", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Specular", target: light, propertyName: "specular", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Position", target: light, propertyName: "position", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Direction", target: light, propertyName: "direction", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, useEuler: this.props.globalState.onlyUseEulers, label: "Angle", target: light, propertyName: "angle", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, useEuler: this.props.globalState.onlyUseEulers, label: "Inner angle", target: light, propertyName: "innerAngle", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Exponent", target: light, propertyName: "exponent", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonShadowLightPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__.CommonShadowLightPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, light: light, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/backgroundMaterialPropertyGridComponent.js":
/*!*********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/backgroundMaterialPropertyGridComponent.js ***!
  \*********************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1950085__) => {

"use strict";
__nested_webpack_require_1950085__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1950085__.d(__nested_webpack_exports__, {
/* harmony export */   BackgroundMaterialPropertyGridComponent: () => (/* binding */ BackgroundMaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1950085__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1950085__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1950085__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1950085__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1950085__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1950085__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1950085__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1950085__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1950085__(/*! ./commonMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1950085__(/*! ../../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");









class BackgroundMaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._onDebugSelectionChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable();
    }
    renderTextures() {
        const material = this.props.material;
        const onDebugSelectionChangeObservable = this._onDebugSelectionChangeObservable;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TEXTURES", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_8__.TextureLinkLineComponent, { label: "Diffuse", texture: material.diffuseTexture, material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_8__.TextureLinkLineComponent, { label: "Reflection", texture: material.reflectionTexture, material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), material.reflectionTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Reflection blur", target: material, propertyName: "reflectionBlur", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }))] }));
    }
    render() {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__.CommonMaterialPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, material: material, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LIGHTING & COLORS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Primary", target: material, propertyName: "primaryColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Shadow level", target: material, propertyName: "primaryColorShadowLevel", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Highlight level", target: material, propertyName: "primaryColorHighlightLevel", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), this.renderTextures(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "RENDERING", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Ground Projection", target: material, propertyName: "enableGroundProjection", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.enableGroundProjection && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fragment", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Ground radius", target: material, propertyName: "projectedGroundRadius", minimum: 0, maximum: 10000, step: 10, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Ground height", target: material, propertyName: "projectedGroundHeight", minimum: 1, maximum: 1000, step: 10, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enable noise", target: material, propertyName: "enableNoise", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Opacity fresnel", target: material, propertyName: "opacityFresnel", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Reflection fresnel", target: material, propertyName: "reflectionFresnel", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Reflection amount", target: material, propertyName: "reflectionAmount", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js":
/*!*****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js ***!
  \*****************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1959595__) => {

"use strict";
__nested_webpack_require_1959595__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1959595__.d(__nested_webpack_exports__, {
/* harmony export */   CommonMaterialPropertyGridComponent: () => (/* binding */ CommonMaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1959595__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1959595__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Materials_material__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1959595__(/*! core/Engines/engine */ "core/Misc/observable");
/* harmony import */ var core_Materials_material__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1959595__.n(core_Materials_material__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1959595__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1959595__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1959595__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1959595__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1959595__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1959595__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1959595__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1959595__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1959595__(/*! ../animations/animationPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_hexLineComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1959595__(/*! shared-ui-components/lines/hexLineComponent */ "../../../dev/sharedUiComponents/dist/lines/hexLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1959595__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");

















class CommonMaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const material = this.props.material;
        material.depthFunction = material.depthFunction ?? 0;
        const orientationOptions = [
            { label: "<None>", value: Number.MAX_SAFE_INTEGER },
            { label: "Clockwise", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Material.ClockWiseSideOrientation },
            { label: "Counterclockwise", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Material.CounterClockWiseSideOrientation },
        ];
        const transparencyModeOptions = [
            { label: "<Not Defined>", value: shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.Null_Value },
            { label: "Opaque", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.PBRMaterial.PBRMATERIAL_OPAQUE },
            { label: "Alpha test", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.PBRMaterial.PBRMATERIAL_ALPHATEST },
            { label: "Alpha blend", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.PBRMaterial.PBRMATERIAL_ALPHABLEND },
            { label: "Alpha blend and test", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND },
        ];
        const alphaModeOptions = [
            { label: "Combine", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.ALPHA_COMBINE },
            { label: "One one", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.ALPHA_ONEONE },
            { label: "Add", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.ALPHA_ADD },
            { label: "Subtract", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.ALPHA_SUBTRACT },
            { label: "Multiply", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.ALPHA_MULTIPLY },
            { label: "Maximized", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.ALPHA_MAXIMIZED },
            { label: "Pre-multiplied", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.ALPHA_PREMULTIPLIED },
        ];
        const depthfunctionOptions = [
            { label: "<Engine Default>", value: 0 },
            { label: "Never", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Engine.NEVER },
            { label: "Always", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Engine.ALWAYS },
            { label: "Equal", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Engine.EQUAL },
            { label: "Less", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Engine.LESS },
            { label: "Less or equal", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Engine.LEQUAL },
            { label: "Greater", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Engine.GREATER },
            { label: "Greater or equal", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Engine.GEQUAL },
            { label: "Not equal", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Engine.NOTEQUAL },
        ];
        const stencilFunctionOptions = [
            { label: "Never", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.NEVER },
            { label: "Always", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.ALWAYS },
            { label: "Equal", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.EQUAL },
            { label: "Less", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.LESS },
            { label: "Less or equal", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.LEQUAL },
            { label: "Greater", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.GREATER },
            { label: "Greater or equal", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.GEQUAL },
            { label: "Not equal", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.NOTEQUAL },
        ];
        const stencilOperationOptions = [
            { label: "Keep", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.KEEP },
            { label: "Zero", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.ZERO },
            { label: "Replace", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.REPLACE },
            { label: "Incr", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.INCR },
            { label: "Decr", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.DECR },
            { label: "Invert", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.INVERT },
            { label: "Incr wrap", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.INCR_WRAP },
            { label: "Decr wrap", value: core_Materials_material__WEBPACK_IMPORTED_MODULE_2__.Constants.DECR_WRAP },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: material, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_5__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "ID", value: material.id }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_10__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: material, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "Unique ID", value: material.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "Class", value: material.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Backface culling", target: material, propertyName: "backFaceCulling", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Orientation", options: orientationOptions, target: material, propertyName: "sideOrientation", onPropertyChangedObservable: this.props.onPropertyChangedObservable, allowNullValue: true, onSelect: (value) => this.setState({ mode: value }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Disable lighting", target: material, propertyName: "disableLighting", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Disable color write", target: material, propertyName: "disableColorWrite", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Disable depth write", target: material, propertyName: "disableDepthWrite", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Depth function", options: depthfunctionOptions, target: material, propertyName: "depthFunction", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ depthFunction: value }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Need depth pre-pass", target: material, propertyName: "needDepthPrePass", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Wireframe", target: material, propertyName: "wireframe", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Point cloud", target: material, propertyName: "pointsCloud", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Point size", target: material, propertyName: "pointSize", minimum: 0, maximum: 100, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Z-offset Factor", target: material, propertyName: "zOffset", minimum: -10, maximum: 10, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Z-offset Units", target: material, propertyName: "zOffsetUnits", minimum: -10, maximum: 10, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__.ButtonLineComponent, { label: "Dispose", onClick: () => {
                                material.dispose();
                                this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_5__.LineContainerComponent, { title: "TRANSPARENCY", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Alpha", target: material, propertyName: "alpha", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.transparencyMode !== undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { allowNullValue: true, label: "Transparency mode", options: transparencyModeOptions, target: material, propertyName: "transparencyMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ transparencyMode: value }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Alpha mode", options: alphaModeOptions, target: material, propertyName: "alphaMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ alphaMode: value }) }), material.diffuseTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Diffuse texture has alpha", target: material.diffuseTexture, propertyName: "hasAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.useAlphaFromDiffuseTexture !== undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Use alpha from diffuse texture", target: material, propertyName: "useAlphaFromDiffuseTexture", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.albedoTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Albedo texture has alpha", target: material.albedoTexture, propertyName: "hasAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.useAlphaFromAlbedoTexture !== undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Use alpha from albedo texture", target: material, propertyName: "useAlphaFromAlbedoTexture", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Separate culling pass", target: material, propertyName: "separateCullingPass", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), material.stencil && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_5__.LineContainerComponent, { title: "STENCIL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Enabled", target: material.stencil, propertyName: "enabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_hexLineComponent__WEBPACK_IMPORTED_MODULE_12__.HexLineComponent, { isInteger: true, lockObject: this.props.lockObject, label: "Mask", target: material.stencil, propertyName: "mask", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Function", options: stencilFunctionOptions, target: material.stencil, propertyName: "func", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ stencilFunction: value }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_13__.FloatLineComponent, { isInteger: true, lockObject: this.props.lockObject, label: "Function reference", target: material.stencil, propertyName: "funcRef", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_hexLineComponent__WEBPACK_IMPORTED_MODULE_12__.HexLineComponent, { isInteger: true, lockObject: this.props.lockObject, label: "Function mask", target: material.stencil, propertyName: "funcMask", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Op stencil fail", options: stencilOperationOptions, target: material.stencil, propertyName: "opStencilFail", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ opStencilFail: value }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Op depth fail", options: stencilOperationOptions, target: material.stencil, propertyName: "opDepthFail", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ opDepthFail: value }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Op stencil+depth pass", options: stencilOperationOptions, target: material.stencil, propertyName: "opStencilDepthPass", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ opStencilDepthPass: value }) })] }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__.AnimationGridComponent, { globalState: this.props.globalState, animatable: material, scene: material.getScene(), lockObject: this.props.lockObject })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/materialPropertyGridComponent.js":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/materialPropertyGridComponent.js ***!
  \***********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1981818__) => {

"use strict";
__nested_webpack_require_1981818__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1981818__.d(__nested_webpack_exports__, {
/* harmony export */   MaterialPropertyGridComponent: () => (/* binding */ MaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1981818__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1981818__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1981818__(/*! ./commonMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js");



class MaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonMaterialPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, material: material, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/multiMaterialPropertyGridComponent.js":
/*!****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/multiMaterialPropertyGridComponent.js ***!
  \****************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1983827__) => {

"use strict";
__nested_webpack_require_1983827__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1983827__.d(__nested_webpack_exports__, {
/* harmony export */   MultiMaterialPropertyGridComponent: () => (/* binding */ MultiMaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1983827__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1983827__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1983827__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1983827__(/*! ./commonMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1983827__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");





class MultiMaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onMaterialLink(mat) {
        if (!this.props.onSelectionChangedObservable) {
            return;
        }
        this.props.onSelectionChangedObservable.notifyObservers(mat);
    }
    renderChildMaterial() {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "CHILDREN", selection: this.props.globalState, children: material.subMaterials.map((mat, i) => {
                if (mat) {
                    return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Material #" + i, value: mat.name, onLink: () => this.onMaterialLink(mat) }, "Material #" + i);
                }
                return null;
            }) }));
    }
    render() {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_3__.CommonMaterialPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, material: material, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), this.renderChildMaterial()] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/nodeMaterialPropertyGridComponent.js":
/*!***************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/nodeMaterialPropertyGridComponent.js ***!
  \***************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1987426__) => {

"use strict";
__nested_webpack_require_1987426__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_1987426__.d(__nested_webpack_exports__, {
/* harmony export */   NodeMaterialPropertyGridComponent: () => (/* binding */ NodeMaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1987426__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1987426__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1987426__(/*! core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1987426__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_1987426__(/*! ./commonMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector4LineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/vector4LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector4LineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector2LineComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/vector2LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_1987426__(/*! ../../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _gradientNodePropertyComponent__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_1987426__(/*! ../../gradientNodePropertyComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/gradientNodePropertyComponent.js");
/* harmony import */ var shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_1987426__(/*! shared-ui-components/lines/color4LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js");

















class NodeMaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._onDebugSelectionChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable();
    }
    edit() {
        this.props.material.edit({ nodeEditorConfig: { backgroundColor: this.props.material.getScene().clearColor } });
    }
    renderTextures() {
        const material = this.props.material;
        const onDebugSelectionChangeObservable = this._onDebugSelectionChangeObservable;
        const textureBlocks = material.getTextureBlocks();
        if (!textureBlocks || textureBlocks.length === 0) {
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TEXTURES", selection: this.props.globalState, children: textureBlocks.map((textureBlock, i) => {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_12__.TextureLinkLineComponent, { label: textureBlock.name, texture: textureBlock.texture, material: material, onTextureCreated: (texture) => (textureBlock.texture = texture), onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }, "nodematText" + i));
            }) }));
    }
    renderInputBlock(block) {
        switch (block.type) {
            case core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.NodeMaterialBlockConnectionPointTypes.Float: {
                const cantDisplaySlider = isNaN(block.min) || isNaN(block.max) || block.min === block.max;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [block.isBoolean && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: block.name, target: block, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable }, block.name)), !block.isBoolean && cantDisplaySlider && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this.props.lockObject, label: block.name, target: block, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable }, block.name)), !block.isBoolean && !cantDisplaySlider && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_13__.SliderLineComponent, { lockObject: this.props.lockObject, label: block.name, target: block, propertyName: "value", step: (block.max - block.min) / 100.0, minimum: block.min, maximum: block.max, onPropertyChangedObservable: this.props.onPropertyChangedObservable }, block.name))] }, block.name));
            }
            case core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.NodeMaterialBlockConnectionPointTypes.Color3:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_8__.Color3LineComponent, { lockObject: this.props.lockObject, label: block.name, target: block, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable }, block.name));
            case core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.NodeMaterialBlockConnectionPointTypes.Color4:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_15__.Color4LineComponent, { lockObject: this.props.lockObject, label: block.name, target: block, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable }, block.name));
            case core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.NodeMaterialBlockConnectionPointTypes.Vector2:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector2LineComponent__WEBPACK_IMPORTED_MODULE_11__.Vector2LineComponent, { lockObject: this.props.lockObject, label: block.name, target: block, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable }, block.name));
            case core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.NodeMaterialBlockConnectionPointTypes.Vector3:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_9__.Vector3LineComponent, { lockObject: this.props.lockObject, label: block.name, target: block, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable }, block.name));
            case core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.NodeMaterialBlockConnectionPointTypes.Vector4:
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector4LineComponent__WEBPACK_IMPORTED_MODULE_10__.Vector4LineComponent, { lockObject: this.props.lockObject, label: block.name, target: block, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable }, block.name));
        }
        return null;
    }
    renderInputValues() {
        const configurableInputBlocks = this.props.material
            .getInputBlocks()
            .filter((block) => {
            return block.visibleInInspector && block.isUniform && !block.isSystemValue;
        })
            .sort((a, b) => {
            return a.name.localeCompare(b.name);
        });
        const namedGroups = [];
        configurableInputBlocks.forEach((block) => {
            if (!block.groupInInspector) {
                return;
            }
            if (namedGroups.indexOf(block.groupInInspector) === -1) {
                namedGroups.push(block.groupInInspector);
            }
        });
        namedGroups.sort();
        const gradiantNodeMaterialBlocks = this.props.material.attachedBlocks
            .filter((block) => {
            return block.visibleInInspector && block.getClassName() === "GradientBlock";
        })
            .sort((a, b) => {
            return a.name.localeCompare(b.name);
        });
        const inputBlockContainer = configurableInputBlocks.length > 0 ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "INPUTS", selection: this.props.globalState, children: [" ", configurableInputBlocks
                    .filter((block) => !block.groupInInspector)
                    .map((block) => {
                    return this.renderInputBlock(block);
                })] })) : null;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [inputBlockContainer, namedGroups.map((name, i) => {
                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: name.toUpperCase(), selection: this.props.globalState, children: configurableInputBlocks
                            .filter((block) => block.groupInInspector === name)
                            .map((block) => {
                            return this.renderInputBlock(block);
                        }) }, "inputValue" + i));
                }), gradiantNodeMaterialBlocks.map((block, i) => {
                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: block.name.toUpperCase(), selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_gradientNodePropertyComponent__WEBPACK_IMPORTED_MODULE_14__.GradientPropertyTabComponent, { globalState: this.props.globalState, block: block }) }, block.name + i));
                })] }));
    }
    render() {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_4__.CommonMaterialPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, material: material, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "CONFIGURATION", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Ignore alpha", target: material, propertyName: "ignoreAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_5__.ButtonLineComponent, { label: "Node Material Editor", onClick: () => this.edit() })] }), this.renderInputValues(), this.renderTextures()] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/pbrMaterialPropertyGridComponent.js":
/*!**************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/pbrMaterialPropertyGridComponent.js ***!
  \**************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2001836__) => {

"use strict";
__nested_webpack_require_2001836__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2001836__.d(__nested_webpack_exports__, {
/* harmony export */   PBRMaterialPropertyGridComponent: () => (/* binding */ PBRMaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2001836__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2001836__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2001836__(/*! core/Rendering/subSurfaceSceneComponent */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2001836__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2001836__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2001836__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2001836__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2001836__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2001836__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var _commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2001836__(/*! ./commonMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2001836__(/*! ../../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector2LineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2001836__(/*! shared-ui-components/lines/vector2LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js");















/**
 * @internal
 */
class PBRMaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._onDebugSelectionChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable();
    }
    switchAmbientMode(state) {
        this.props.material.debugMode = state ? 21 : 0;
    }
    renderTextures(onDebugSelectionChangeObservable) {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "CHANNELS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Albedo", texture: material.albedoTexture, propertyName: "albedoTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Metallic Roughness", texture: material.metallicTexture, propertyName: "metallicTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Reflection", texture: material.reflectionTexture, propertyName: "reflectionTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Refraction", texture: material.refractionTexture, propertyName: "refractionTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Reflectivity", texture: material.reflectivityTexture, propertyName: "reflectivityTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Micro-surface", texture: material.microSurfaceTexture, propertyName: "microSurfaceTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Bump", texture: material.bumpTexture, propertyName: "bumpTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Emissive", texture: material.emissiveTexture, propertyName: "emissiveTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Opacity", texture: material.opacityTexture, propertyName: "opacityTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { customDebugAction: (state) => this.switchAmbientMode(state), label: "Ambient", texture: material.ambientTexture, propertyName: "ambientTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Lightmap", texture: material.lightmapTexture, propertyName: "lightmapTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Detailmap", texture: material.detailMap.texture, material: material, onTextureCreated: (texture) => (material.detailMap.texture = texture), onTextureRemoved: () => (material.detailMap.texture = null), onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use lightmap as shadowmap", target: material, propertyName: "useLightmapAsShadowmap", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use detailmap", target: material.detailMap, propertyName: "isEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.decalMap && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use decalmap", target: material.decalMap, propertyName: "isEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }))] }));
    }
    render() {
        const material = this.props.material;
        const debugMode = [
            { label: "None", value: 0 },
            // Geometry
            { label: "Normalized position", value: 1 },
            { label: "Normals", value: 2 },
            { label: "Tangents", value: 3 },
            { label: "Bitangents", value: 4 },
            { label: "Bump Normals", value: 5 },
            { label: "UV1", value: 6 },
            { label: "UV2", value: 7 },
            { label: "ClearCoat Normals", value: 8 },
            { label: "ClearCoat Tangents", value: 9 },
            { label: "ClearCoat Bitangents", value: 10 },
            { label: "Anisotropic Normals", value: 11 },
            { label: "Anisotropic Tangents", value: 12 },
            { label: "Anisotropic Bitangents", value: 13 },
            // Maps
            { label: "Albedo Map", value: 20 },
            { label: "Ambient Map", value: 21 },
            { label: "Opacity Map", value: 22 },
            { label: "Emissive Map", value: 23 },
            { label: "Light Map", value: 24 },
            { label: "Metallic Map", value: 25 },
            { label: "Reflectivity Map", value: 26 },
            { label: "ClearCoat Map", value: 27 },
            { label: "ClearCoat Tint Map", value: 28 },
            { label: "Sheen Map", value: 29 },
            { label: "Anisotropic Map", value: 30 },
            { label: "Thickness Map", value: 31 },
            { label: "Bump Map", value: 32 },
            // Env
            { label: "Env Refraction", value: 40 },
            { label: "Env Reflection", value: 41 },
            { label: "Env Clear Coat", value: 42 },
            // Lighting
            { label: "Direct Diffuse", value: 50 },
            { label: "Direct Specular", value: 51 },
            { label: "Direct Clear Coat", value: 52 },
            { label: "Direct Sheen", value: 53 },
            { label: "Env Irradiance", value: 54 },
            // Lighting Params
            { label: "Surface Albedo", value: 60 },
            { label: "Reflectance 0", value: 61 },
            { label: "Metallic", value: 62 },
            { label: "Metallic F0", value: 71 },
            { label: "Roughness", value: 63 },
            { label: "AlphaG", value: 64 },
            { label: "NdotV", value: 65 },
            { label: "ClearCoat Color", value: 66 },
            { label: "ClearCoat Roughness", value: 67 },
            { label: "ClearCoat NdotV", value: 68 },
            { label: "Transmittance", value: 69 },
            { label: "Refraction Transmittance", value: 70 },
            { label: "Glossiness", value: 72 },
            { label: "Base Color", value: 73 },
            { label: "Specular Color", value: 74 },
            { label: "Emissive Color", value: 75 },
            // Misc
            { label: "SEO", value: 80 },
            { label: "EHO", value: 81 },
            { label: "Energy Factor", value: 82 },
            { label: "Specular Reflectance", value: 83 },
            { label: "Clear Coat Reflectance", value: 84 },
            { label: "Sheen Reflectance", value: 85 },
            { label: "Luminance Over Alpha", value: 86 },
            { label: "Alpha", value: 87 },
            { label: "Albedo Alpha", value: 88 },
            { label: "Ambient occlusion color", value: 89 },
        ];
        const realTimeFilteringQualityOptions = [
            { label: "Low", value: core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURE_FILTERING_QUALITY_LOW },
            { label: "Medium", value: core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURE_FILTERING_QUALITY_MEDIUM },
            { label: "High", value: core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURE_FILTERING_QUALITY_HIGH },
        ];
        material.sheen._useRoughness = material.sheen._useRoughness ?? material.sheen.roughness !== null;
        material.sheen.roughness = material.sheen.roughness ?? material.sheen._saveRoughness ?? 0;
        if (!material.sheen._useRoughness) {
            material.sheen._saveRoughness = material.sheen.roughness;
            material.sheen.roughness = null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_8__.CommonMaterialPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, material: material, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), this.renderTextures(this._onDebugSelectionChangeObservable), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LIGHTING & COLORS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Albedo", target: material, propertyName: "albedoColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Reflectivity", target: material, propertyName: "reflectivityColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Micro-surface", target: material, propertyName: "microSurface", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Emissive", target: material, propertyName: "emissiveColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Ambient", target: material, propertyName: "ambientColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use physical light falloff", target: material, propertyName: "usePhysicalLightFalloff", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "METALLIC WORKFLOW", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Metallic", target: material, propertyName: "metallic", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Roughness", target: material, propertyName: "roughness", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Index of Refraction", target: material, propertyName: "indexOfRefraction", minimum: 1, maximum: 3, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "F0 Factor", target: material, propertyName: "metallicF0Factor", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Reflectance Color", target: material, propertyName: "metallicReflectanceColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use only metallic from MetallicReflectance texture", target: material, propertyName: "useOnlyMetallicFromMetallicReflectanceTexture", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "MetallicReflectance Texture", texture: material.metallicReflectanceTexture, onTextureCreated: (texture) => (material.metallicReflectanceTexture = texture), onTextureRemoved: () => (material.metallicReflectanceTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Reflectance Texture", texture: material.reflectanceTexture, onTextureCreated: (texture) => (material.reflectanceTexture = texture), onTextureRemoved: () => (material.reflectanceTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "CLEAR COAT", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: material.clearCoat, propertyName: "isEnabled", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.clearCoat.isEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fragment", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", target: material.clearCoat, propertyName: "intensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Roughness", target: material.clearCoat, propertyName: "roughness", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "IOR", target: material.clearCoat, propertyName: "indexOfRefraction", minimum: 1.0, maximum: 3, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Remap F0", target: material.clearCoat, propertyName: "remapF0OnInterfaceChange", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Clear coat", texture: material.clearCoat.texture, onTextureCreated: (texture) => (material.clearCoat.texture = texture), onTextureRemoved: () => (material.clearCoat.texture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Roughness", texture: material.clearCoat.textureRoughness, onTextureCreated: (texture) => (material.clearCoat.textureRoughness = texture), onTextureRemoved: () => (material.clearCoat.textureRoughness = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Bump", texture: material.clearCoat.bumpTexture, onTextureCreated: (texture) => (material.clearCoat.bumpTexture = texture), onTextureRemoved: () => (material.clearCoat.bumpTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), material.clearCoat.bumpTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Bump strength", target: material.clearCoat.bumpTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use roughness from main texture", target: material.clearCoat, propertyName: "useRoughnessFromMainTexture", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Tint", target: material.clearCoat, propertyName: "isTintEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.clearCoat.isEnabled && material.clearCoat.isTintEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Tint Color", target: material.clearCoat, propertyName: "tintColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true })), material.clearCoat.isEnabled && material.clearCoat.isTintEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "At Distance", target: material.clearCoat, propertyName: "tintColorAtDistance", minimum: 0, maximum: 20, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.clearCoat.isEnabled && material.clearCoat.isTintEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Tint Thickness", target: material.clearCoat, propertyName: "tintThickness", minimum: 0, maximum: 20, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.clearCoat.isEnabled && material.clearCoat.isTintEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Tint", texture: material.clearCoat.tintTexture, onTextureCreated: (texture) => (material.clearCoat.tintTexture = texture), onTextureRemoved: () => (material.clearCoat.tintTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }))] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "IRIDESCENCE", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: material.iridescence, propertyName: "isEnabled", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.iridescence.isEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fragment", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", target: material.iridescence, propertyName: "intensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "IOR", target: material.iridescence, propertyName: "indexOfRefraction", minimum: 1.0, maximum: 3, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Min Thickness", target: material.iridescence, propertyName: "minimumThickness", minimum: 0, maximum: 1000, step: 10, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Max Thickness", target: material.iridescence, propertyName: "maximumThickness", minimum: 0, maximum: 1000, step: 10, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Iridescence", texture: material.iridescence.texture, onTextureCreated: (texture) => (material.iridescence.texture = texture), onTextureRemoved: () => (material.iridescence.texture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Thickness", texture: material.iridescence.thicknessTexture, onTextureCreated: (texture) => (material.iridescence.thicknessTexture = texture), onTextureRemoved: () => (material.iridescence.thicknessTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ANISOTROPIC", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: material.anisotropy, propertyName: "isEnabled", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.anisotropy.isEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fragment", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Legacy Mode", target: material.anisotropy, propertyName: "legacy", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", target: material.anisotropy, propertyName: "intensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector2LineComponent__WEBPACK_IMPORTED_MODULE_10__.Vector2LineComponent, { lockObject: this.props.lockObject, label: "Direction", target: material.anisotropy, propertyName: "direction", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Anisotropic", texture: material.anisotropy.texture, onTextureCreated: (texture) => (material.anisotropy.texture = texture), onTextureRemoved: () => (material.anisotropy.texture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SHEEN", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: material.sheen, propertyName: "isEnabled", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.sheen.isEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fragment", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Link to Albedo", target: material.sheen, propertyName: "linkSheenWithAlbedo", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", target: material.sheen, propertyName: "intensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Color", target: material.sheen, propertyName: "color", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Sheen", texture: material.sheen.texture, onTextureCreated: (texture) => (material.sheen.texture = texture), onTextureRemoved: () => (material.sheen.texture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Roughness", texture: material.sheen.textureRoughness, onTextureCreated: (texture) => (material.sheen.textureRoughness = texture), onTextureRemoved: () => (material.sheen.textureRoughness = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use roughness", target: material.sheen, propertyName: "_useRoughness" }), material.sheen._useRoughness && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Roughness", target: material.sheen, propertyName: "roughness", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use roughness from main texture", target: material.sheen, propertyName: "useRoughnessFromMainTexture", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Albedo scaling", target: material.sheen, propertyName: "albedoScaling", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SUBSURFACE", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Thickness", texture: material.subSurface.thicknessTexture, onTextureCreated: (texture) => (material.subSurface.thicknessTexture = texture), onTextureRemoved: () => (material.subSurface.thicknessTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Min Thickness", target: material.subSurface, propertyName: "minimumThickness", minimum: 0, maximum: 10, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Max Thickness", target: material.subSurface, propertyName: "maximumThickness", minimum: 0, maximum: 10, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Mask From Thickness", target: material.subSurface, propertyName: "useMaskFromThicknessTexture", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "glTF-Style Textures", target: material.subSurface, propertyName: "useGltfStyleTextures", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use Thickness as Depth", target: material.subSurface, propertyName: "useThicknessAsDepth", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Tint Color", target: material.subSurface, propertyName: "tintColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Scattering Enabled", target: material.subSurface, propertyName: "isScatteringEnabled", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.subSurface.isScatteringEnabled && material.getScene().prePassRenderer && material.getScene().subSurfaceConfiguration && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fragment", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Meters per unit", target: material.getScene().subSurfaceConfiguration, propertyName: "metersPerUnit", minimum: 0.01, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Refraction Enabled", target: material.subSurface, propertyName: "isRefractionEnabled", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.subSurface.isRefractionEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fragment", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", target: material.subSurface, propertyName: "refractionIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Refraction Intensity", texture: material.subSurface.refractionIntensityTexture, onTextureCreated: (texture) => (material.subSurface.refractionIntensityTexture = texture), onTextureRemoved: () => (material.subSurface.refractionIntensityTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Refraction", texture: material.subSurface.refractionTexture, onTextureCreated: (texture) => (material.subSurface.refractionTexture = texture), onTextureRemoved: () => (material.subSurface.refractionTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Volume Index of Refraction", target: material.subSurface, propertyName: "volumeIndexOfRefraction", minimum: 1, maximum: 3, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Tint at Distance", target: material.subSurface, propertyName: "tintColorAtDistance", minimum: 0, maximum: 10, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Link refraction with transparency", target: material.subSurface, propertyName: "linkRefractionWithTransparency", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use albedo to tint surface transparency", target: material.subSurface, propertyName: "useAlbedoToTintRefraction", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Dispersion Enabled", target: material.subSurface, propertyName: "isDispersionEnabled", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.subSurface.isDispersionEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fragment", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", target: material.subSurface, propertyName: "dispersion", minimum: 0, maximum: 5, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Translucency Enabled", target: material.subSurface, propertyName: "isTranslucencyEnabled", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.subSurface.isTranslucencyEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fragment", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", target: material.subSurface, propertyName: "translucencyIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Intensity", texture: material.subSurface.translucencyIntensityTexture, onTextureCreated: (texture) => (material.subSurface.translucencyIntensityTexture = texture), onTextureRemoved: () => (material.subSurface.translucencyIntensityTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Diffusion Distance", target: material.subSurface, propertyName: "diffusionDistance", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use albedo to tint surface translucency", target: material.subSurface, propertyName: "useAlbedoToTintTranslucency", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Translucency Tint", target: material.subSurface, propertyName: "translucencyColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Translucency Tint", texture: material.subSurface.translucencyColorTexture, onTextureCreated: (texture) => (material.subSurface.translucencyColorTexture = texture), onTextureRemoved: () => (material.subSurface.translucencyColorTexture = null), material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LEVELS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Environment", target: material, propertyName: "environmentIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Specular", target: material, propertyName: "specularIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Emissive", target: material, propertyName: "emissiveIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Direct", target: material, propertyName: "directIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.bumpTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Bump strength", target: material.bumpTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.ambientTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Ambient strength", target: material, propertyName: "ambientTextureStrength", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.reflectionTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Reflection strength", target: material.reflectionTexture, propertyName: "level", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.clearCoat.texture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Clear coat", target: material.clearCoat.texture, propertyName: "level", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.clearCoat.bumpTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Clear coat bump", target: material.clearCoat.bumpTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.clearCoat.tintTexture && false /* level is not used for the clear coat tint texture */ && (0), material.anisotropy.texture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Anisotropic", target: material.anisotropy.texture, propertyName: "level", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.sheen.texture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Sheen", target: material.sheen.texture, propertyName: "level", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.subSurface.thicknessTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Thickness", target: material.subSurface.thicknessTexture, propertyName: "level", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.subSurface.refractionTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Refraction", target: material.subSurface.refractionTexture, propertyName: "level", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.detailMap.isEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Detailmap diffuse", target: material.detailMap, propertyName: "diffuseBlendLevel", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Detailmap bump", target: material.detailMap, propertyName: "bumpLevel", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Detailmap roughness", target: material.detailMap, propertyName: "roughnessBlendLevel", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "RENDERING", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Alpha from albedo", target: material, propertyName: "useAlphaFromAlbedoTexture", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Ambient in grayscale", target: material, propertyName: "useAmbientInGrayScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Radiance over alpha", target: material, propertyName: "useRadianceOverAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Micro-surface from ref. map alpha", target: material, propertyName: "useMicroSurfaceFromReflectivityMapAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Specular over alpha", target: material, propertyName: "useSpecularOverAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Specular anti-aliasing", target: material, propertyName: "enableSpecularAntiAliasing", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Realtime Filtering", target: material, propertyName: "realTimeFiltering", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { allowNullValue: true, label: "Realtime Filtering quality", options: realTimeFilteringQualityOptions, target: material, propertyName: "realTimeFilteringQuality", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "NORMAL MAP", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Invert X axis", target: material, propertyName: "invertNormalMapX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Invert Y axis", target: material, propertyName: "invertNormalMapY", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ADVANCED", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Energy Conservation", target: material.brdf, propertyName: "useEnergyConservation", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Spherical Harmonics", target: material.brdf, propertyName: "useSphericalHarmonics", onValueChanged: () => this.forceUpdate(), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Radiance occlusion", target: material, propertyName: "useRadianceOcclusion", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Horizon occlusion ", target: material, propertyName: "useHorizonOcclusion", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Unlit", target: material, propertyName: "unlit", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "DEBUG", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Debug mode", options: debugMode, target: material, propertyName: "debugMode" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Split position", target: material, propertyName: "debugLimit", minimum: -1, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Output factor", target: material, propertyName: "debugFactor", minimum: 0, maximum: 5, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/pbrMetallicRoughnessMaterialPropertyGridComponent.js":
/*!*******************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/pbrMetallicRoughnessMaterialPropertyGridComponent.js ***!
  \*******************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2064074__) => {

"use strict";
__nested_webpack_require_2064074__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2064074__.d(__nested_webpack_exports__, {
/* harmony export */   PBRMetallicRoughnessMaterialPropertyGridComponent: () => (/* binding */ PBRMetallicRoughnessMaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2064074__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2064074__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2064074__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2064074__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2064074__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2064074__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2064074__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2064074__(/*! ./commonMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2064074__(/*! ../../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2064074__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");









class PBRMetallicRoughnessMaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._onDebugSelectionChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable();
    }
    renderTextures() {
        const material = this.props.material;
        const onDebugSelectionChangeObservable = this._onDebugSelectionChangeObservable;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TEXTURES", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Base", texture: material.baseTexture, propertyName: "baseTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Metallic roughness", texture: material.metallicRoughnessTexture, propertyName: "metallicRoughnessTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Normal", texture: material.normalTexture, propertyName: "normalTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Environment", texture: material.environmentTexture, propertyName: "environmentTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Emissive", texture: material.emissiveTexture, propertyName: "emissiveTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Lightmap", texture: material.lightmapTexture, propertyName: "lightmapTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable })] }));
    }
    render() {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__.CommonMaterialPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, material: material, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), this.renderTextures(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LIGHTING & COLORS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Base", target: material, propertyName: "baseColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Emissive", target: material, propertyName: "emissiveColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LEVELS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Metallic", target: material, propertyName: "metallic", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Roughness", target: material, propertyName: "roughness", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "NORMAL MAP", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Invert X axis", target: material, propertyName: "invertNormalMapX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Invert Y axis", target: material, propertyName: "invertNormalMapY", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/pbrSpecularGlossinessMaterialPropertyGridComponent.js":
/*!********************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/pbrSpecularGlossinessMaterialPropertyGridComponent.js ***!
  \********************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2073582__) => {

"use strict";
__nested_webpack_require_2073582__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2073582__.d(__nested_webpack_exports__, {
/* harmony export */   PBRSpecularGlossinessMaterialPropertyGridComponent: () => (/* binding */ PBRSpecularGlossinessMaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2073582__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2073582__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2073582__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2073582__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2073582__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2073582__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2073582__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2073582__(/*! ./commonMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2073582__(/*! ../../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2073582__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");









class PBRSpecularGlossinessMaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._onDebugSelectionChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable();
    }
    renderTextures() {
        const material = this.props.material;
        const onDebugSelectionChangeObservable = this._onDebugSelectionChangeObservable;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TEXTURES", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Diffuse", texture: material.diffuseTexture, propertyName: "diffuseTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Specular glossiness", texture: material.specularGlossinessTexture, propertyName: "specularGlossinessTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Normal", texture: material.normalTexture, propertyName: "normalTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Environment", texture: material.environmentTexture, propertyName: "environmentTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Emissive", texture: material.emissiveTexture, propertyName: "emissiveTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Lightmap", texture: material.lightmapTexture, propertyName: "lightmapTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable })] }));
    }
    render() {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__.CommonMaterialPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, material: material, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), this.renderTextures(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LIGHTING & COLORS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Diffuse", target: material, propertyName: "diffuseColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Specular", target: material, propertyName: "specularColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, isLinear: true })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LEVELS", closed: true, selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Glossiness", target: material, propertyName: "glossiness", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "NORMAL MAP", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Invert X axis", target: material, propertyName: "invertNormalMapX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Invert Y axis", target: material, propertyName: "invertNormalMapY", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/skyMaterialPropertyGridComponent.js":
/*!**************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/skyMaterialPropertyGridComponent.js ***!
  \**************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2082678__) => {

"use strict";
__nested_webpack_require_2082678__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2082678__.d(__nested_webpack_exports__, {
/* harmony export */   SkyMaterialPropertyGridComponent: () => (/* binding */ SkyMaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2082678__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2082678__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2082678__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2082678__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2082678__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2082678__(/*! ./commonMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2082678__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");







/**
 * Property grid component for the SkyMaterial
 */
class SkyMaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    renderSky() {
        const material = this.props.material;
        const sliderProps = [
            {
                label: "Azimuth",
                property: "azimuth",
                minimum: 0,
                maximum: Math.PI * 2,
                step: 0.001,
            },
            {
                label: "Inclination",
                property: "inclination",
                minimum: 0,
                maximum: Math.PI / 2,
                step: 0.001,
            },
            {
                label: "Turbidity",
                property: "turbidity",
                minimum: 0,
                maximum: 100,
                step: 0.1,
            },
            {
                label: "Luminance",
                property: "luminance",
                minimum: 0,
                maximum: 1,
                step: 0.001,
            },
            {
                label: "Rayleigh",
                property: "rayleigh",
                minimum: 0,
                maximum: 4,
                step: 0.001,
            },
            {
                label: "mieDirectionalG",
                property: "mieDirectionalG",
                minimum: 0,
                maximum: 1,
                step: 0.001,
            },
            {
                label: "mieCoefficient",
                property: "mieCoefficient",
                minimum: 0,
                maximum: 1,
                step: 0.001,
            },
            {
                label: "Distance",
                property: "distance",
                minimum: 0,
                maximum: 1000,
                step: 0.1,
            },
        ];
        const vector3Props = [
            {
                label: "Sun pos",
                property: "sunPosition",
            },
            {
                label: "Camera offset",
                property: "cameraOffset",
            },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SKY", selection: this.props.globalState, children: [sliderProps.map((prop) => ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: prop.label, target: material, propertyName: prop.property, minimum: prop.minimum, maximum: prop.maximum, step: prop.step, onPropertyChangedObservable: this.props.onPropertyChangedObservable }))), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Use sun pos", target: material, propertyName: "useSunPosition", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), vector3Props.map((prop) => ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__.Vector3LineComponent, { lockObject: this.props.lockObject, label: prop.label, target: material, propertyName: prop.property, onPropertyChangedObservable: this.props.onPropertyChangedObservable })))] }));
    }
    render() {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__.CommonMaterialPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, material: material, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), this.renderSky()] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/standardMaterialPropertyGridComponent.js":
/*!*******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/standardMaterialPropertyGridComponent.js ***!
  \*******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2089162__) => {

"use strict";
__nested_webpack_require_2089162__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2089162__.d(__nested_webpack_exports__, {
/* harmony export */   StandardMaterialPropertyGridComponent: () => (/* binding */ StandardMaterialPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2089162__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2089162__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2089162__(/*! core/Materials/material.decalMap */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2089162__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2089162__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2089162__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2089162__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2089162__(/*! ./commonMaterialPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/commonMaterialPropertyGridComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2089162__(/*! ../../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2089162__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");










class StandardMaterialPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._onDebugSelectionChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable();
    }
    renderTextures() {
        const material = this.props.material;
        const onDebugSelectionChangeObservable = this._onDebugSelectionChangeObservable;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TEXTURES", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Diffuse", texture: material.diffuseTexture, propertyName: "diffuseTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Specular", texture: material.specularTexture, propertyName: "specularTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Reflection", texture: material.reflectionTexture, propertyName: "reflectionTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Refraction", texture: material.refractionTexture, propertyName: "refractionTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Emissive", texture: material.emissiveTexture, propertyName: "emissiveTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Bump", texture: material.bumpTexture, propertyName: "bumpTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Opacity", texture: material.opacityTexture, propertyName: "opacityTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Ambient", texture: material.ambientTexture, propertyName: "ambientTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Lightmap", texture: material.lightmapTexture, propertyName: "lightmapTexture", material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Detailmap", texture: material.detailMap.texture, material: material, onTextureCreated: (texture) => (material.detailMap.texture = texture), onTextureRemoved: () => (material.detailMap.texture = null), onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: onDebugSelectionChangeObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Use lightmap as shadowmap", target: material, propertyName: "useLightmapAsShadowmap", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Use detailmap", target: material.detailMap, propertyName: "isEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), material.decalMap && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Use decalmap", target: material.decalMap, propertyName: "isEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }))] }));
    }
    render() {
        const material = this.props.material;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonMaterialPropertyGridComponent__WEBPACK_IMPORTED_MODULE_6__.CommonMaterialPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, material: material, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), this.renderTextures(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LIGHTING & COLORS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Diffuse", target: material, propertyName: "diffuseColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Specular", target: material, propertyName: "specularColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Specular power", target: material, propertyName: "specularPower", minimum: 0, maximum: 128, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Emissive", target: material, propertyName: "emissiveColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Ambient", target: material, propertyName: "ambientColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Use specular over alpha", target: material, propertyName: "useSpecularOverAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LEVELS", closed: true, selection: this.props.globalState, children: [material.diffuseTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Diffuse level", target: material.diffuseTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.specularTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Specular level", target: material.specularTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.reflectionTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Reflection level", target: material.reflectionTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.refractionTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Refraction level", target: material.refractionTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.emissiveTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Emissive level", target: material.emissiveTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.bumpTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Bump level", target: material.bumpTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.opacityTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Opacity level", target: material.opacityTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.ambientTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Ambient level", target: material.ambientTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.lightmapTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Lightmap level", target: material.lightmapTexture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), material.detailMap.isEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Detailmap diffuse", target: material.detailMap, propertyName: "diffuseBlendLevel", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Detailmap bump", target: material.detailMap, propertyName: "bumpLevel", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "NORMAL MAP", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Invert X axis", target: material, propertyName: "invertNormalMapX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_8__.CheckBoxLineComponent, { label: "Invert Y axis", target: material, propertyName: "invertNormalMapY", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/texturePropertyGridComponent.js":
/*!**********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/texturePropertyGridComponent.js ***!
  \**********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2106369__) => {

"use strict";
__nested_webpack_require_2106369__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2106369__.d(__nested_webpack_exports__, {
/* harmony export */   TexturePropertyGridComponent: () => (/* binding */ TexturePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2106369__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2106369__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2106369__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2106369__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _lines_textureLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2106369__(/*! ../../../lines/textureLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/fileButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/valueLineComponent */ "../../../dev/sharedUiComponents/dist/lines/valueLineComponent.js");
/* harmony import */ var gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_2106369__(/*! gui/2D/advancedDynamicTexture */ "gui/2D/adtInstrumentation");
/* harmony import */ var gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__nested_webpack_require_2106369__.n(gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_2106369__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_2106369__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_2106369__(/*! ../animations/animationPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js");
/* harmony import */ var _popupComponent__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_2106369__(/*! ../../../../popupComponent */ "../../../dev/inspector/dist/components/popupComponent.js");
/* harmony import */ var _textures_textureEditorComponent__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_2106369__(/*! ./textures/textureEditorComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.js");
/* harmony import */ var _sceneExplorer_entities_gui_guiTools__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_2106369__(/*! ../../../../sceneExplorer/entities/gui/guiTools */ "../../../dev/inspector/dist/components/sceneExplorer/entities/gui/guiTools.js");

























const textureFormat = [
    { label: "Alpha", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_ALPHA },
    { label: "Luminance", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_LUMINANCE },
    { label: "Luminance/Alpha", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA },
    { label: "RGB", normalizable: 1, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_RGB },
    { label: "RGBA", normalizable: 1, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_RGBA },
    { label: "R (red)", normalizable: 1, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_RED },
    { label: "RG (red/green)", normalizable: 1, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_RG },
    { label: "R (red) integer", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_RED_INTEGER },
    { label: "RG (red/green) integer", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_RG_INTEGER },
    { label: "RGB integer", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_RGB_INTEGER },
    { label: "RGBA integer", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_RGBA_INTEGER },
    { label: "BGRA", normalizable: 1, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_BGRA },
    { label: "Depth24/Stencil8", normalizable: 0, hideType: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 },
    { label: "Depth32 float", normalizable: 0, hideType: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_DEPTH32_FLOAT },
    { label: "Depth16", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_DEPTH16 },
    { label: "Depth24", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_DEPTH24 },
    { label: "Depth24Unorm/Stencil8", normalizable: 0, hideType: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8 },
    { label: "Depth32Float/Stencil8", normalizable: 0, hideType: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8 },
    { label: "RGBA BPTC UNorm", normalizable: 0, compressed: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM },
    { label: "RGB BPTC UFloat", normalizable: 0, compressed: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT },
    { label: "RGB BPTC SFloat", normalizable: 0, compressed: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT },
    { label: "RGBA S3TC DXT5", normalizable: 0, compressed: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5 },
    { label: "RGBA S3TC DXT3", normalizable: 0, compressed: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3 },
    { label: "RGBA S3TC DXT1", normalizable: 0, compressed: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1 },
    { label: "RGB S3TC DXT1", normalizable: 0, compressed: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1 },
    { label: "RGBA ASTC 4x4", normalizable: 0, compressed: true, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4 },
];
const textureType = [
    { label: "unsigned byte", normalizable: 1, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_BYTE },
    { label: "32-bit float", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_FLOAT },
    { label: "16-bit float", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_HALF_FLOAT },
    { label: "signed byte", normalizable: 1, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_BYTE },
    { label: "signed short", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_SHORT },
    { label: "unsigned short", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_SHORT },
    { label: "signed int", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_INT },
    { label: "unsigned int", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_INTEGER },
    { label: "unsigned 4/4/4/4 short", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 },
    { label: "unsigned 5/5/5/1 short", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 },
    { label: "unsigned 5/6/5 short", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 },
    { label: "unsigned 2/10/10/10 int", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV },
    { label: "unsigned 24/8 int", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_INT_24_8 },
    { label: "unsigned 10f/11f/11f int", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV },
    { label: "unsigned 5/9/9/9 int", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV },
    { label: "32-bits with only 8-bit used (stencil)", normalizable: 0, value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV },
];
class TexturePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._textureInspectorSize = { width: 1024, height: 490 };
        this.state = {
            isTextureEditorOpen: false,
            textureEditing: null,
        };
        const texture = this.props.texture;
        this._textureLineRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._popoutWindowRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        if (!texture || !texture.rootContainer) {
            return;
        }
        const adt = texture;
        this._adtInstrumentation = new gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12__.AdvancedDynamicTextureInstrumentation(adt);
        this._adtInstrumentation.captureRenderTime = true;
        this._adtInstrumentation.captureLayoutTime = true;
        this.onOpenTextureEditor.bind(this);
        this.onCloseTextureEditor.bind(this);
        this.openTextureEditor.bind(this);
    }
    componentWillUnmount() {
        if (this._adtInstrumentation) {
            this._adtInstrumentation.dispose();
            this._adtInstrumentation = null;
        }
    }
    updateTexture(file) {
        const texture = this.props.texture;
        core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Tools.ReadFile(file, (data) => {
            const blob = new Blob([data], { type: "octet/stream" });
            const reader = new FileReader();
            reader.readAsDataURL(blob);
            reader.onloadend = () => {
                const base64data = reader.result;
                if (texture.isCube) {
                    let extension = undefined;
                    if (file.name.toLowerCase().indexOf(".dds") > 0) {
                        extension = ".dds";
                    }
                    else if (file.name.toLowerCase().indexOf(".env") > 0) {
                        extension = ".env";
                    }
                    texture.updateURL(base64data, extension, () => this.forceRefresh());
                }
                else {
                    texture.updateURL(base64data, null, () => this.forceRefresh());
                }
            };
        }, undefined, true);
    }
    openTextureEditor() {
        if (this.state.isTextureEditorOpen) {
            this.onCloseTextureEditor(() => this.openTextureEditor());
            return;
        }
        this.setState({
            isTextureEditorOpen: true,
            textureEditing: this.props.texture,
        });
    }
    onOpenTextureEditor() { }
    onCloseTextureEditor(callback) {
        this.setState({
            isTextureEditorOpen: false,
            textureEditing: null,
        }, callback);
    }
    forceRefresh() {
        this.forceUpdate();
        this._textureLineRef.current.updatePreview();
    }
    findTextureFormat(format) {
        for (let i = 0; i < textureFormat.length; ++i) {
            if (textureFormat[i].value === format) {
                return textureFormat[i];
            }
        }
        return null;
    }
    findTextureType(type) {
        for (let i = 0; i < textureType.length; ++i) {
            if (textureType[i].value === type) {
                return textureType[i];
            }
        }
        return null;
    }
    render() {
        const texture = this.props.texture;
        const textureAsRTT = texture;
        const samplingMode = [
            { label: "Nearest", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.NEAREST_NEAREST }, // 1
            { label: "Linear", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.LINEAR_LINEAR }, // 2
            { label: "Linear & linear mip", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.LINEAR_LINEAR_MIPLINEAR }, // 3
            { label: "Linear & nearest mip", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.LINEAR_LINEAR_MIPNEAREST }, // 11
            { label: "Nearest & linear mip", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.NEAREST_NEAREST_MIPLINEAR }, // 8
            { label: "Nearest & nearest mip", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.NEAREST_NEAREST_MIPNEAREST }, // 4
            { label: "Nearest/Linear", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.NEAREST_LINEAR }, // 7
            { label: "Nearest/Linear & linear mip", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.NEAREST_LINEAR_MIPLINEAR }, // 6
            { label: "Nearest/Linear & nearest mip", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.NEAREST_LINEAR_MIPNEAREST }, // 5
            { label: "Linear/Nearest", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.LINEAR_NEAREST }, // 12
            { label: "Linear/Nearest & linear mip", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.LINEAR_NEAREST_MIPLINEAR }, // 10
            { label: "Linear/Nearest & nearest mip", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.LINEAR_NEAREST_MIPNEAREST }, // 9
        ];
        const coordinatesMode = [
            { label: "Explicit", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.EXPLICIT_MODE },
            { label: "Cubic", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.CUBIC_MODE },
            { label: "Inverse cubic", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.INVCUBIC_MODE },
            { label: "Equirectangular", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.EQUIRECTANGULAR_MODE },
            { label: "Fixed equirectangular", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.FIXED_EQUIRECTANGULAR_MODE },
            { label: "Fixed equirectangular mirrored", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE },
            { label: "Planar", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.PLANAR_MODE },
            { label: "Projection", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.PROJECTION_MODE },
            { label: "Skybox", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.SKYBOX_MODE },
            { label: "Spherical", value: core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.SPHERICAL_MODE },
        ];
        const format = texture._texture?.format ?? -2; // -2 is an invalid value so that findTextureFormat will return null when texture is null/undefined. It can't be -1 because -1 means RGBA, so it is -2 :)
        const type = texture._texture?.type ?? -2; // same than above, -1 means ubyte
        const oformat = this.findTextureFormat(format === -1 ? core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTUREFORMAT_RGBA : format);
        const otype = this.findTextureType(type === -1 ? core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Constants.TEXTURETYPE_UNSIGNED_BYTE : type);
        const textureClass = texture instanceof core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.MultiRenderTarget ? "MultiRenderTarget" : texture instanceof core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.RenderTargetTexture ? "RenderTargetTexture" : texture.getClassName();
        const count = texture instanceof core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.MultiRenderTarget ? texture.count : -1;
        const oformatDepthStencil = texture.isRenderTarget && textureAsRTT.renderTarget?._depthStencilTexture ? this.findTextureFormat(textureAsRTT.renderTarget._depthStencilTexture.format) : null;
        let extension = "";
        const url = texture.url;
        const textureUrl = !url || url.substring(0, 4) === "data" || url.substring(0, 4) === "blob" ? "" : url;
        if (textureUrl) {
            for (let index = textureUrl.length - 1; index >= 0; index--) {
                if (textureUrl[index] === ".") {
                    break;
                }
                extension = textureUrl[index] + extension;
            }
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "PREVIEW", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLineComponent, { ref: this._textureLineRef, texture: texture, width: 256, height: 256, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_10__.FileButtonLine, { label: "Load texture from file", onClick: (file) => this.updateTexture(file), accept: ".jpg, .png, .tga, .dds, .env, .exr" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__.ButtonLineComponent, { label: "Edit", onClick: () => {
                                if (this.props.texture instanceof gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12__.AdvancedDynamicTexture) {
                                    (0,_sceneExplorer_entities_gui_guiTools__WEBPACK_IMPORTED_MODULE_19__.EditAdvancedDynamicTexture)(this.props.texture);
                                }
                                else {
                                    this.openTextureEditor();
                                }
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_15__.TextInputLineComponent, { label: "URL", value: textureUrl, lockObject: this.props.lockObject, onChange: (url) => {
                                texture.updateURL(url);
                                this.forceRefresh();
                            } })] }), this.state.isTextureEditorOpen && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_popupComponent__WEBPACK_IMPORTED_MODULE_17__.PopupComponent, { id: "texture-editor", title: "Texture Inspector", size: this._textureInspectorSize, onOpen: this.onOpenTextureEditor, onClose: () => this.onCloseTextureEditor, ref: this._popoutWindowRef, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_textures_textureEditorComponent__WEBPACK_IMPORTED_MODULE_18__.TextureEditorComponent, { texture: this.props.texture, url: textureUrl, window: this._popoutWindowRef, onUpdate: () => this.forceRefresh() }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: texture, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_15__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Display name", target: texture, propertyName: "displayName", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Width", value: texture.getSize().width.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Height", value: texture.getSize().height.toString() }), texture.is2DArray && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Layers", value: texture._texture?.depth.toString() ?? "?" }), texture.is3D && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Depth", value: texture._texture?.depth.toString() ?? "?" }), texture.isRenderTarget && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__.ButtonLineComponent, { label: "Scale up", onClick: () => {
                                const scene = texture.getScene();
                                texture.scale(2);
                                setTimeout(() => {
                                    this.props.globalState.onSelectionChangedObservable.notifyObservers(scene.getTextureByUniqueId(texture.uniqueId));
                                });
                            } })), texture.isRenderTarget && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__.ButtonLineComponent, { label: "Scale down", onClick: () => {
                                const scene = texture.getScene();
                                texture.scale(0.5);
                                setTimeout(() => {
                                    this.props.globalState.onSelectionChangedObservable.notifyObservers(scene.getTextureByUniqueId(texture.uniqueId));
                                });
                            } })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Format", value: oformat?.label ?? "unknown" }), !oformat?.hideType && !oformat?.compressed && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Type", value: otype?.label ?? "unknown" }), !!oformat?.normalizable && !oformat?.compressed && !!otype?.normalizable && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Normalized", value: otype.normalizable ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Is compressed", value: oformat?.compressed ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Use sRGB buffers", value: texture._texture?._useSRGBBuffer ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Is Gamma space", value: texture.gammaSpace ? "Yes" : "No" }), extension && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "File format", value: extension }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Unique ID", value: texture.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Internal Unique ID", value: (texture._texture?.uniqueId ?? "N/A").toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Class", value: textureClass }), count >= 0 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Number of textures", value: count.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Has alpha", value: texture.hasAlpha ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Get alpha from RGB", target: texture, propertyName: "getAlphaFromRGB", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Is 3D", value: texture.is3D ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Is 2D array", value: texture.is2DArray ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Is cube", value: texture.isCube ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Is render target", value: texture.isRenderTarget ? "Yes" : "No" }), texture.isRenderTarget && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Depth/stencil texture format", value: oformatDepthStencil?.label ?? "no" }), texture instanceof core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Stored as inverted on Y", value: texture.invertY ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Has mipmaps", value: !texture.noMipmap ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "UV set", target: texture, propertyName: "coordinatesIndex", minimum: 0, maximum: 3, step: 1, onPropertyChangedObservable: this.props.onPropertyChangedObservable, decimalCount: 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_9__.OptionsLine, { label: "Mode", options: coordinatesMode, target: texture, propertyName: "coordinatesMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => (texture.coordinatesMode = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Level", target: texture, propertyName: "level", minimum: 0, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), texture.updateSamplingMode && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_9__.OptionsLine, { label: "Sampling", options: samplingMode, target: texture, noDirectUpdate: true, propertyName: "samplingMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => texture.updateSamplingMode(value) }))] }), texture.getScene() && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_16__.AnimationGridComponent, { globalState: this.props.globalState, animatable: texture, scene: texture.getScene(), lockObject: this.props.lockObject })), texture.rootContainer && this._adtInstrumentation && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ADVANCED TEXTURE PROPERTIES", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_11__.ValueLineComponent, { label: "Last layout time", value: this._adtInstrumentation.renderTimeCounter.current, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_11__.ValueLineComponent, { label: "Last render time", value: this._adtInstrumentation.layoutTimeCounter.current, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Render scale", minimum: 0.1, maximum: 5, step: 0.1, target: texture, propertyName: "renderScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Premultiply alpha", target: texture, propertyName: "premulAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Ideal width", target: texture, propertyName: "idealWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Ideal height", target: texture, propertyName: "idealHeight", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Use smallest ideal", target: texture, propertyName: "useSmallestIdeal", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Render at ideal size", target: texture, propertyName: "renderAtIdealSize", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Invalidate Rect optimization", target: texture, propertyName: "useInvalidateRectOptimization", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TRANSFORM", selection: this.props.globalState, children: [!texture.isCube && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "U offset", target: texture, propertyName: "uOffset", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "V offset", target: texture, propertyName: "vOffset", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "U scale", target: texture, propertyName: "uScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "V scale", target: texture, propertyName: "vScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "U angle", useEuler: this.props.globalState.onlyUseEulers, target: texture, propertyName: "uAng", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "V angle", useEuler: this.props.globalState.onlyUseEulers, target: texture, propertyName: "vAng", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "W angle", useEuler: this.props.globalState.onlyUseEulers, target: texture, propertyName: "wAng", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Clamp U", isSelected: () => texture.wrapU === core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.CLAMP_ADDRESSMODE, onSelect: (value) => (texture.wrapU = value ? core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.CLAMP_ADDRESSMODE : core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.WRAP_ADDRESSMODE) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Clamp V", isSelected: () => texture.wrapV === core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.CLAMP_ADDRESSMODE, onSelect: (value) => (texture.wrapV = value ? core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.CLAMP_ADDRESSMODE : core_Misc_tools__WEBPACK_IMPORTED_MODULE_2__.Texture.WRAP_ADDRESSMODE) })] })), texture.isCube && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Rotation Y", useEuler: this.props.globalState.onlyUseEulers, minimum: 0, maximum: 2 * Math.PI, step: 0.1, target: texture, propertyName: "rotationY" }) }))] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/bottomBar.js":
/*!************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/bottomBar.js ***!
  \************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2145588__) => {

"use strict";
__nested_webpack_require_2145588__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2145588__.d(__nested_webpack_exports__, {
/* harmony export */   BottomBar: () => (/* binding */ BottomBar)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2145588__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2145588__(/*! react */ "../../../../node_modules/react/index.js");


class BottomBar extends react__WEBPACK_IMPORTED_MODULE_1__.PureComponent {
    render() {
        const factor = Math.pow(2, this.props.mipLevel);
        const width = Math.ceil(this.props.texture.getSize().width / factor);
        const height = Math.ceil(this.props.texture.getSize().height / factor);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "bottom-bar", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { id: "file-url", children: this.props.texture.name }), !this.props.texture.noMipmap && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { id: "mip-level", children: ["MIP Preview: ", this.props.mipLevel, " ", width, "x", height] }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/canvasShader.js":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/canvasShader.js ***!
  \***************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2147412__) => {

"use strict";
__nested_webpack_require_2147412__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2147412__.d(__nested_webpack_exports__, {
/* harmony export */   canvasShader: () => (/* binding */ canvasShader)
/* harmony export */ });
const canvasShader = {
    path: {
        vertexSource: `
            precision highp float;

            attribute vec3 position;
            attribute vec2 uv;

            uniform mat4 worldViewProjection;

            varying vec2 vUV;

            void main(void) {
                gl_Position = worldViewProjection * vec4(position, 1.0);
                vUV = uv;
            }
        `,
        fragmentSource: `
            precision highp float;
    
            uniform sampler2D textureSampler;
    
            uniform bool r;
            uniform bool g;
            uniform bool b;
            uniform bool a;

            uniform int x1;
            uniform int y1;
            uniform int x2;
            uniform int y2;
            uniform int w;
            uniform int h;

            uniform int time;
            uniform bool showGrid;
    
            varying vec2 vUV;

            float scl = 200.0;
            float speed = 10.0 / 1000.0;
            float smoothing = 0.2;
    
            void main(void) {
                vec2 pos2 = vec2(gl_FragCoord.x, gl_FragCoord.y);
                vec2 pos = floor(pos2 * 0.05);
                float pattern = mod(pos.x + pos.y, 2.0); 
                if (pattern == 0.0) {
                    pattern = 0.7;
                }
                vec4 bg = vec4(pattern, pattern, pattern, 1.0);
                vec4 col = texture(textureSampler, vUV);
                if (!r && !g && !b) {
                    if (a) {
                        col = vec4(col.a, col.a, col.a, 1.0);
                    } else {
                        col = vec4(0.0,0.0,0.0,0.0);
                    }
                } else {
                    if (!r) {
                        col.r = 0.0;
                        if (!b) {
                            col.r = col.g;
                        }
                        else if (!g) {
                            col.r = col.b;
                        }
                    }
                    if (!g) {
                        col.g = 0.0;
                        if (!b) {
                            col.g = col.r;
                        }
                        else if (!r) {
                            col.g = col.b;
                        }
                    }
                    if (!b) {
                        col.b = 0.0;
                        if (!r) {
                            col.b = col.g;
                        } else if (!g) {
                            col.b = col.r;
                        }
                    }
                    if (!a) {
                        col.a = 1.0;
                    }
                }
                gl_FragColor = col * (col.a) + bg * (1.0 - col.a);
                float wF = float(w);
                float hF = float(h);
                int xPixel = int(floor(vUV.x * wF));
                int yPixel = int(floor((1.0 - vUV.y) * hF));
                int xDis = min(abs(xPixel - x1), abs(xPixel - x2));
                int yDis = min(abs(yPixel - y1), abs(yPixel - y2));
                if (showGrid) {
                    vec2 frac = fract(vUV * vec2(wF,hF));
                    float thickness = 0.1;
                    if (abs(frac.x) < thickness || abs (frac.y) < thickness) {
                        gl_FragColor = vec4(0.75,0.75,0.75,1.0);
                    }
                }
                if (xPixel >= x1 && yPixel >= y1 && xPixel <= x2 && yPixel <= y2) {
                    if (xDis <= 4 || yDis <= 4) {
                        float c = sin(vUV.x * scl + vUV.y * scl + float(time) * speed);
                        c = smoothstep(-smoothing,smoothing,c);
                        float val = 1.0 - c;
                        gl_FragColor = vec4(val, val, val, 1.0) * 0.7 + gl_FragColor * 0.3;
                    }
                }
            }`,
    },
    options: {
        attributes: ["position", "uv"],
        uniforms: ["worldViewProjection", "textureSampler", "r", "g", "b", "a", "x1", "y1", "x2", "y2", "w", "h", "time", "showGrid"],
    },
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/channelsBar.js":
/*!**************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/channelsBar.js ***!
  \**************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2152348__) => {

"use strict";
__nested_webpack_require_2152348__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2152348__.d(__nested_webpack_exports__, {
/* harmony export */   ChannelsBar: () => (/* binding */ ChannelsBar)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2152348__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2152348__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _assets_eyeOpen_svg__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2152348__(/*! ./assets/eyeOpen.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/eyeOpen.svg");
/* harmony import */ var _assets_eyeClosed_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2152348__(/*! ./assets/eyeClosed.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/eyeClosed.svg");




class ChannelsBar extends react__WEBPACK_IMPORTED_MODULE_1__.PureComponent {
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "channels-bar", children: this.props.channels.map((channel, index) => {
                const visTip = channel.visible ? "Hide" : "Show";
                const editTip = channel.editable ? "Lock" : "Unlock";
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: channel.editable ? "channel" : "channel uneditable", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: channel.visible ? "icon channel-visibility visible" : "icon channel-visibility", onClick: () => {
                                const newChannels = this.props.channels;
                                newChannels[index].visible = !newChannels[index].visible;
                                this.props.setChannels(newChannels);
                            }, src: channel.visible ? _assets_eyeOpen_svg__WEBPACK_IMPORTED_MODULE_2__ : _assets_eyeClosed_svg__WEBPACK_IMPORTED_MODULE_3__, title: `${visTip} ${channel.name}` }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "icon channel-name", onClick: () => {
                                const newChannels = this.props.channels;
                                newChannels[index].editable = !newChannels[index].editable;
                                this.props.setChannels(newChannels);
                            }, src: channel.icon, title: `${editTip} ${channel.name}` })] }, channel.name));
            }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/defaultTools.js":
/*!****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/defaultTools.js ***!
  \****************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2155597__) => {

"use strict";
__nested_webpack_require_2155597__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2155597__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _paintbrush__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2155597__(/*! ./paintbrush */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/paintbrush.js");
/* harmony import */ var _eyedropper__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2155597__(/*! ./eyedropper */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/eyedropper.js");
/* harmony import */ var _floodfill__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2155597__(/*! ./floodfill */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/floodfill.js");
/* harmony import */ var _rectangleSelect__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2155597__(/*! ./rectangleSelect */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/rectangleSelect.js");




/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([_rectangleSelect__WEBPACK_IMPORTED_MODULE_3__.RectangleSelect, _paintbrush__WEBPACK_IMPORTED_MODULE_0__.Paintbrush, _eyedropper__WEBPACK_IMPORTED_MODULE_1__.Eyedropper, _floodfill__WEBPACK_IMPORTED_MODULE_2__.Floodfill]);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/eyedropper.js":
/*!**************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/eyedropper.js ***!
  \**************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2157628__) => {

"use strict";
__nested_webpack_require_2157628__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2157628__.d(__nested_webpack_exports__, {
/* harmony export */   Eyedropper: () => (/* binding */ Eyedropper)
/* harmony export */ });
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2157628__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2157628__.n(core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__);


const Eyedropper = {
    name: "Eyedropper",
    type: class {
        constructor(getParameters) {
            this.getParameters = getParameters;
        }
        pick(pointerInfo) {
            const { canvas2D, setMetadata, getMouseCoordinates } = this.getParameters();
            const ctx = canvas2D.getContext("2d");
            const { x, y } = getMouseCoordinates(pointerInfo);
            const pixel = ctx.getImageData(x, y, 1, 1).data;
            setMetadata({
                color: core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__.Color3.FromInts(pixel[0], pixel[1], pixel[2]).toHexString(),
                alpha: pixel[3] / 255,
            });
        }
        setup() {
            this.pointerObserver = this.getParameters().scene.onPointerObservable.add((pointerInfo) => {
                if (pointerInfo.pickInfo?.hit) {
                    if (pointerInfo.type === core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERDOWN && pointerInfo.event.buttons === 1 && this.getParameters().interactionEnabled()) {
                        this.isPicking = true;
                        this.pick(pointerInfo);
                    }
                    if (this.isPicking) {
                        if (pointerInfo.event.buttons !== 1 || !this.getParameters().interactionEnabled()) {
                            this.isPicking = false;
                        }
                        else {
                            this.pick(pointerInfo);
                        }
                    }
                }
            });
            this.isPicking = false;
        }
        cleanup() {
            if (this.pointerObserver) {
                this.getParameters().scene.onPointerObservable.remove(this.pointerObserver);
            }
        }
    },
    icon: `PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjkuMzIsMTAu
    NjhjLTEuNjYtMS42Ni00LjA2LTEtNS41Ni41YTExLjg5LDExLjg5LDAsMCwwLTEuNjYsMi4zMUwyMiwxMy40MWExLjg5LDEuODksMCwwLDAtMi42NiwwbC0uOS45YTEuODksMS44OSwwLDAsMC0uMjIsMi4zOWwtNi4wOSw2LjA5YTIuNzUsMi43NSwwLDAsMC0uNzMs
    MS4yOGwtLjgxLDMuMjYtLjU2LjU2YTEuMTYsMS4xNiwwLDAsMCwwLDEuNjVsLjQxLjQxYTEuMTcsMS4xNywwLDAsMCwxLjY1LDBsLjU2LS41NiwzLjI2LS44MWEyLjc1LDIuNzUsMCwwLDAsMS4yOC0uNzNsNi4xNC02LjE0YTEuODcsMS44NywwLDAsMCwuODQuMjEs
    MS44MywxLjgzLDAsMCwwLDEuMzMtLjU1bC45LS45YTEuODcsMS44NywwLDAsMCwuMDgtMi41NywxMS41NCwxMS41NCwwLDAsMCwyLjMyLTEuNjZDMzAuMzIsMTQuNzQsMzEsMTIuMzUsMjkuMzIsMTAuNjhaTTE2LjE1LDI2Ljc5YTEuMjEsMS4yMSwwLDAsMS0uNTgu
    MzNMMTIsMjhsLjktMy41OWExLjIxLDEuMjEsMCwwLDEsLjMzLS41OGw2LjA3LTYuMDcsMi45NCwyLjk0Wm05LjIxLTcuMzgtLjkuOWMtLjE5LjItLjM0LjItLjU0LDBsLTQuNC00LjRhLjQuNCwwLDAsMSwwLS41NGwuOS0uOWEuNDMuNDMsMCwwLDEsLjI3LS4xMS4z
    OS4zOSwwLDAsMSwuMjcuMTFsNC40LDQuNEEuMzguMzgsMCwwLDEsMjUuMzYsMTkuNDFabTMuMzgtNS45M2EzLjcsMy43LDAsMCwxLTEsMS43LDExLjY3LDExLjY3LDAsMCwxLTIuMzUsMS42MkwyMy4yLDE0LjU5YTExLjY3LDExLjY3LDAsMCwxLDEuNjItMi4zNSwz
    LjcsMy43LDAsMCwxLDEuNy0xLDEuODMsMS44MywwLDAsMSwyLjIyLDIuMjJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+`,
    cursor: `iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAABmJLR0QA/wD/AP+gvaeTAAAByklEQVQ4jbWUv4saQRTHd+4s/BuCYRH1n7BQEhCRuyJ3RQgpRVt/tFvYSAjLxMPiWIJ1OA6OKwKBdCGBkIS4pFs76xgXhOlyyconzSrrojub4l618+a9z/u+mTdrGPdgIk0QwDZBCG3OUerqepYeCgigAbyJ+a+AEyB9lTDxAfBhPp9jWRZh+wB0u11msxnAJyCXSmkI/DIejx9Vq1Ujm83u7OdyOaPRaBi2bVeAr8BDnUIBfJRSUi6XWSwWa+B1VClw6ft+UKlUsG0b4DNw+G6AU8/zME2T5XIZAE9C/xYark983/9rmubmKM6SoNedTofRaARwqenqQkpJr9cDuI3uiYiSvbaZS4Dod1J8JrJIUoUQYgs+FLuplYk79lQ2hBAipvSggH2Vbvr9PlJKgFea2JeO49BqtQDeJgWee55HPp9ntVr9AR6H/vjtV5VSd8Vikel0CvA0CXoEfBsOh9RqNZRSd8CL2JwOlVK/6/X65rVNgWPdEeTX6/XPwWBAqVRiMpnsPFPHcSgUCliWRRAEv4BCIjAKBr67rkuz2dyBttttXNcF+AEUUwEj4GPgGfAu1v574DmQ0UI0BXYuSmepf9L/NZv3Yf8AKtG4imEra4UAAAAASUVORK5CYII=`,
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/floodfill.js":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/floodfill.js ***!
  \*************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2162665__) => {

"use strict";
__nested_webpack_require_2162665__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2162665__.d(__nested_webpack_exports__, {
/* harmony export */   Floodfill: () => (/* binding */ Floodfill)
/* harmony export */ });
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2162665__(/*! core/Events/pointerEvents */ "core/Misc/observable");
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2162665__.n(core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__);

const Floodfill = {
    name: "Floodfill",
    type: class {
        constructor(getParameters) {
            this.getParameters = getParameters;
        }
        async fill() {
            const { metadata, startPainting, updatePainting, stopPainting } = this.getParameters();
            const ctx = await startPainting();
            ctx.fillStyle = metadata.color;
            ctx.globalAlpha = metadata.alpha;
            ctx.globalCompositeOperation = "copy";
            ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
            updatePainting();
            stopPainting();
        }
        setup() {
            this.pointerObserver = this.getParameters().scene.onPointerObservable.add((pointerInfo) => {
                if (pointerInfo.type === core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERDOWN &&
                    pointerInfo.event.buttons === 1 &&
                    this.getParameters().interactionEnabled() &&
                    pointerInfo.pickInfo?.hit) {
                    this.fill();
                }
            });
        }
        cleanup() {
            if (this.pointerObserver) {
                this.getParameters().scene.onPointerObservable.remove(this.pointerObserver);
            }
        }
    },
    icon: `PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAsMTAuNWEu
    NzUuNzUsMCwwLDAtMS41LDB2MS4yNWEyLjE0LDIuMTQsMCwwLDAtLjg0LjUzbC02Ljg4LDYuODhhMi4yNSwyLjI1LDAsMCwwLDAsMy4xOGw0Ljg4LDQuODhhMi4yNSwyLjI1LDAsMCwwLDMuMTgsMGw2Ljg4LTYuODhhMi4yNSwyLjI1LDAsMCwwLDAtMy4xOGwtNC44
    OC00Ljg4YTIuMjksMi4yOSwwLDAsMC0uODQtLjUzWm0tOC4xNiw5LjcyLDYuNjYtNi42NlYxNUEuNzUuNzUsMCwwLDAsMjAsMTVWMTMuNTZsNC42Niw0LjY2YS43NS43NSwwLDAsMSwwLDEuMDZsLTEsMUgxMS44Wm0uNDcsMS41M2g5Ljg4bC00LjQxLDQuNDFhLjc1
    Ljc1LDAsMCwxLTEuMDYsMFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjcuNTEsMjEuODVhLjg4Ljg4LDAsMCwwLTEuNTQsMGwtMiwzLjc3YTMuMTUsMy4xNSwwLDEsMCw1LjU2LDBabS0yLjIzLDQuNDcsMS40Ni0yLjczLDEuNDUsMi43M2ExLjY1LDEu
    NjUsMCwxLDEtMi45MSwwWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==`,
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/paintbrush.js":
/*!**************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/paintbrush.js ***!
  \**************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2166011__) => {

"use strict";
__nested_webpack_require_2166011__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2166011__.d(__nested_webpack_exports__, {
/* harmony export */   Paintbrush: () => (/* binding */ Paintbrush)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2166011__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2166011__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2166011__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2166011__.n(core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2__);





class PaintbrushTool {
    constructor(getParameters) {
        this.width = 15;
        this.mousePos = null;
        this.getParameters = getParameters;
    }
    paint(pointerInfo) {
        const { getMouseCoordinates, metadata, updatePainting } = this.getParameters();
        let { x, y } = getMouseCoordinates(pointerInfo);
        if (metadata.select.x1 != -1) {
            x -= metadata.select.x1;
            y -= metadata.select.y1;
        }
        const { ctx } = this;
        let numSteps, stepVector;
        stepVector = new core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2__.Vector2();
        if (this.mousePos == null) {
            this.mousePos = new core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2__.Vector2(x, y);
            numSteps = 1;
        }
        else {
            const maxDistance = this.width / 4;
            const diffVector = new core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2__.Vector2(x - this.mousePos.x, y - this.mousePos.y);
            numSteps = Math.ceil(diffVector.length() / maxDistance);
            const trueDistance = diffVector.length() / numSteps;
            stepVector = diffVector.normalize().multiplyByFloats(trueDistance, trueDistance);
        }
        const paintVector = this.mousePos.clone();
        for (let stepCount = 0; stepCount < numSteps; stepCount++) {
            ctx.globalAlpha = 1.0;
            ctx.globalCompositeOperation = "destination-out";
            ctx.drawImage(this.circleCanvas, Math.ceil(paintVector.x - this.width / 2), Math.ceil(paintVector.y - this.width / 2));
            ctx.globalAlpha = metadata.alpha;
            ctx.globalCompositeOperation = "source-over";
            ctx.drawImage(this.circleCanvas, Math.ceil(paintVector.x - this.width / 2), Math.ceil(paintVector.y - this.width / 2));
            paintVector.addInPlace(stepVector);
        }
        updatePainting();
        this.mousePos = new core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2__.Vector2(x, y);
    }
    setBrushWidth(width) {
        this.width = width;
    }
    setup() {
        const { scene } = this.getParameters();
        this.pointerObserver = scene.onPointerObservable.add(async (pointerInfo) => {
            const { startPainting, stopPainting, metadata } = this.getParameters();
            if (!this.isPainting) {
                if (pointerInfo.type === core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2__.PointerEventTypes.POINTERDOWN &&
                    pointerInfo.event.buttons === 1 &&
                    this.getParameters().interactionEnabled() &&
                    pointerInfo.pickInfo?.hit) {
                    this.isPainting = true;
                    const circleCanvas = document.createElement("canvas");
                    circleCanvas.width = this.width;
                    circleCanvas.height = this.width;
                    const circleCtx = circleCanvas.getContext("2d");
                    circleCtx.imageSmoothingEnabled = false;
                    const pixels = new Array(4 * this.width * this.width);
                    const dis = (this.width * this.width) / 4;
                    const rgb = core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2__.Color3.FromHexString(metadata.color);
                    const r = Math.floor(rgb.r * 255);
                    const g = Math.floor(rgb.g * 255);
                    const b = Math.floor(rgb.b * 255);
                    let idx = 0;
                    const x1 = -Math.floor(this.width / 2), x2 = Math.ceil(this.width / 2);
                    const y1 = -Math.floor(this.width / 2), y2 = Math.ceil(this.width / 2);
                    for (let y = y1; y < y2; y++) {
                        for (let x = x1; x < x2; x++) {
                            pixels[idx++] = r;
                            pixels[idx++] = g;
                            pixels[idx++] = b;
                            pixels[idx++] = x * x + y * y <= dis ? 255 : 0;
                        }
                    }
                    circleCtx.putImageData(new ImageData(Uint8ClampedArray.from(pixels), this.width, this.width), 0, 0);
                    this.circleCanvas = circleCanvas;
                    this.ctx = await startPainting();
                    this.paint(pointerInfo);
                }
            }
            else {
                if (pointerInfo.event.buttons !== 1 || !this.getParameters().interactionEnabled()) {
                    this.isPainting = false;
                    this.circleCanvas.parentNode?.removeChild(this.circleCanvas);
                    stopPainting();
                    this.mousePos = null;
                }
                else {
                    if (pointerInfo.pickInfo?.hit && pointerInfo.type === core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_2__.PointerEventTypes.POINTERMOVE) {
                        this.paint(pointerInfo);
                    }
                }
            }
        });
        this.isPainting = false;
    }
    cleanup() {
        this.isPainting = false;
        if (this.pointerObserver) {
            this.getParameters().scene.onPointerObservable.remove(this.pointerObserver);
        }
    }
}
class Settings extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    render() {
        const instance = this.props.instance;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "tool-slider-input", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: ["Size: ", instance.width] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { id: "contrast-slider", type: "range", min: 1, max: 100, value: instance.width, onChange: (evt) => {
                            instance.setBrushWidth(evt.target.valueAsNumber);
                            this.forceUpdate();
                        } })] }) }));
    }
}
const Paintbrush = {
    name: "Paintbrush",
    type: PaintbrushTool,
    settingsComponent: Settings,
    icon: `PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjksMTFhMy41NywzLjU3LDAsMCwxLDAsNS4wNkwxNywyOGEyLjM0LDIuMzQsMCwwLDEtMSwuNThMMTAuOTEsMzBhLjc1Ljc1LDAsMCwxLS45Mi0uOTJMMTEuMzgsMjRBMi4zNCwyLjM0LDAsMCwxLDEyLDIzbDEyLTEyQTMuNTcsMy41NywwLDAsMSwyOSwxMVpNMjMsMTQuMSwxMywyNGEuNjkuNjksMCwwLDAtLjE5LjMzbC0xLjA1LDMuODUsMy44NS0xQS42OS42OSwwLDAsMCwxNiwyN0wyNS45LDE3Wm0yLTItMSwxTDI3LDE2bDEtMUEyLjA4LDIuMDgsMCwxLDAsMjUsMTIuMDdaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+`,
    cursor: `iVBORw0KGgoAAAANSUhEUgAAABUAAAAVAgMAAADUeU0FAAAACVBMVEUAAAAAAAD///+D3c/SAAAAAXRSTlMAQObYZgAAAAFiS0dEAmYLfGQAAAA3SURBVAjXY2CAgVUNYGoqhFJjwE2BgQYDBwMXUGiFGtcyBgbVkKmtYXAeVA4O8BkGtQ9qOwgAAEPfC1QJPmWqAAAAAElFTkSuQmCC`,
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/rectangleSelect.js":
/*!*******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/rectangleSelect.js ***!
  \*******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2174390__) => {

"use strict";
__nested_webpack_require_2174390__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2174390__.d(__nested_webpack_exports__, {
/* harmony export */   RectangleSelect: () => (/* binding */ RectangleSelect)
/* harmony export */ });
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2174390__(/*! core/Events/pointerEvents */ "core/Misc/observable");
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2174390__.n(core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__);

const RectangleSelect = {
    name: "Rectangle Select",
    type: class {
        constructor(getParameters) {
            this.isSelecting = false;
            this.xStart = -1;
            this.yStart = -1;
            this.getParameters = getParameters;
        }
        setup() {
            const { scene } = this.getParameters();
            this.pointerObserver = scene.onPointerObservable.add((pointerInfo) => {
                const { getMouseCoordinates, setMetadata, metadata } = this.getParameters();
                if (!this.isSelecting) {
                    if (pointerInfo.type == core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERDOWN &&
                        pointerInfo &&
                        pointerInfo.event.buttons === 1 &&
                        this.getParameters().interactionEnabled() &&
                        pointerInfo.pickInfo?.hit) {
                        this.isSelecting = true;
                        const { x, y } = ({ x: this.xStart, y: this.yStart } = getMouseCoordinates(pointerInfo));
                        setMetadata({
                            select: {
                                x1: x,
                                y1: y,
                                x2: x,
                                y2: y,
                            },
                        });
                    }
                }
                else {
                    if (pointerInfo.event.buttons !== 1 || !this.getParameters().interactionEnabled()) {
                        this.isSelecting = false;
                        if (metadata.select.x1 === metadata.select.x2 || metadata.select.y1 === metadata.select.y2) {
                            setMetadata({
                                select: {
                                    x1: -1,
                                    y1: -1,
                                    x2: -1,
                                    y2: -1,
                                },
                            });
                        }
                    }
                    else {
                        if (pointerInfo.pickInfo?.hit && pointerInfo.type === core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERMOVE) {
                            if (pointerInfo.type === core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERMOVE && this.isSelecting) {
                                const { x, y } = getMouseCoordinates(pointerInfo);
                                setMetadata({
                                    select: {
                                        x1: Math.min(x, this.xStart),
                                        y1: Math.min(y, this.yStart),
                                        x2: Math.max(x, this.xStart),
                                        y2: Math.max(y, this.yStart),
                                    },
                                });
                            }
                        }
                    }
                }
            });
        }
        cleanup() {
            this.isSelecting = false;
            if (this.pointerObserver) {
                this.getParameters().scene.onPointerObservable.remove(this.pointerObserver);
            }
        }
    },
    icon: `PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTEuNjMsMTUuNjNIMTAuMzh2LTMuN2ExLjU0LDEuNTQsMCwwLDEsMS41NS0xLjU1aDMuN3YxLjI1SDEyLjI1YS42Mi42MiwwLDAsMC0uNjIuNjJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTExLjYzLDIyLjYzSDEwLjM4VjE3LjM4aDEuMjVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI5LjYzLDIyLjYzSDI4LjM4VjE3LjM4aDEuMjVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTE1LjYzLDI5LjYzaC0zLjdhMS41NSwxLjU1LDAsMCwxLTEuNTUtMS41NlYyNC4zOGgxLjI1djMuMzdhLjYzLjYzLDAsMCwwLC42Mi42M2gzLjM4WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0yOC4wNywyOS42M0gyNC4zOFYyOC4zOGgzLjM3YS42NC42NCwwLDAsMCwuNjMtLjYzVjI0LjM4aDEuMjV2My42OUExLjU2LDEuNTYsMCwwLDEsMjguMDcsMjkuNjNaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTIyLjYzLDExLjYzSDE3LjM4VjEwLjM4aDUuMjVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI5LjYzLDE1LjYzSDI4LjM4VjEyLjI1YS42My42MywwLDAsMC0uNjMtLjYySDI0LjM4VjEwLjM4aDMuNjlhMS41NSwxLjU1LDAsMCwxLDEuNTYsMS41NVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjIuNjMsMjkuNjNIMTcuMzhWMjguMzhoNS4yNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=`,
    cursor: `iVBORw0KGgoAAAANSUhEUgAAABUAAAAVAgMAAADUeU0FAAAACVBMVEUAAAAAAAD///+D3c/SAAAAAXRSTlMAQObYZgAAAAFiS0dEAmYLfGQAAAAnSURBVAjXY2CAAS0IpUY0BdG1ikNrFQODaqiaaBicBwfEG6aF0AQA4oYGiJg4woEAAAAASUVORK5CYII=`,
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/propertiesBar.js":
/*!****************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/propertiesBar.js ***!
  \****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2180182__) => {

"use strict";
__nested_webpack_require_2180182__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2180182__.d(__nested_webpack_exports__, {
/* harmony export */   PropertiesBar: () => (/* binding */ PropertiesBar)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2180182__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2180182__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _assets_reset_svg__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_2180182__(/*! ./assets/reset.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/reset.svg");
/* harmony import */ var _assets_upload_svg__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_2180182__(/*! ./assets/upload.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/upload.svg");
/* harmony import */ var _assets_save_svg__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_2180182__(/*! ./assets/save.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/save.svg");
/* harmony import */ var _assets_babylonLogo_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2180182__(/*! ./assets/babylonLogo.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/babylonLogo.svg");
/* harmony import */ var _assets_resizeTool_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2180182__(/*! ./assets/resizeTool.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/resizeTool.svg");
/* harmony import */ var _assets_mipUp_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2180182__(/*! ./assets/mipUp.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/mipUp.svg");
/* harmony import */ var _assets_mipDown_svg__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2180182__(/*! ./assets/mipDown.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/mipDown.svg");
/* harmony import */ var _assets_posX_svg__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2180182__(/*! ./assets/posX.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/posX.svg");
/* harmony import */ var _assets_negX_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2180182__(/*! ./assets/negX.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/negX.svg");
/* harmony import */ var _assets_posY_svg__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2180182__(/*! ./assets/posY.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/posY.svg");
/* harmony import */ var _assets_negY_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2180182__(/*! ./assets/negY.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/negY.svg");
/* harmony import */ var _assets_posZ_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2180182__(/*! ./assets/posZ.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/posZ.svg");
/* harmony import */ var _assets_negZ_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2180182__(/*! ./assets/negZ.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/negZ.svg");















class PropertiesBar extends react__WEBPACK_IMPORTED_MODULE_1__.PureComponent {
    constructor(props) {
        super(props);
        this._faces = [_assets_posX_svg__WEBPACK_IMPORTED_MODULE_2__, _assets_negX_svg__WEBPACK_IMPORTED_MODULE_3__, _assets_posY_svg__WEBPACK_IMPORTED_MODULE_4__, _assets_negY_svg__WEBPACK_IMPORTED_MODULE_5__, _assets_posZ_svg__WEBPACK_IMPORTED_MODULE_6__, _assets_negZ_svg__WEBPACK_IMPORTED_MODULE_7__];
        this.state = {
            width: props.size.width,
            height: props.size.height,
        };
    }
    _pixelData(props) {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "pixel-data", children: [props.name, ": ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "value", children: props.data !== undefined ? props.data : "-" })] }));
    }
    _getNewDimension(oldDim, newDim) {
        if (!isNaN(newDim)) {
            if (parseInt(newDim) > 0) {
                if (Number.isInteger(parseInt(newDim)))
                    return parseInt(newDim);
            }
        }
        return oldDim;
    }
    componentWillUpdate(nextProps) {
        if (nextProps.size.width != this.props.size.width || nextProps.size.height != this.props.size.height) {
            this.setState({
                width: nextProps.size.width,
                height: nextProps.size.height,
            });
        }
    }
    render() {
        const { mipLevel, setMipLevel, pixelData, resizeTexture, texture, face, setFace, saveTexture, resetTexture, uploadTexture } = this.props;
        const maxLevels = Math.floor(Math.log2(Math.max(texture.getSize().width, texture.getSize().height)));
        const engine = texture.getScene().getEngine();
        const mipsEnabled = !texture.noMipmap && engine.getCaps().textureLOD;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "properties", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "tab", id: "logo-tab", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "icon", src: _assets_babylonLogo_svg__WEBPACK_IMPORTED_MODULE_8__ }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "left", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "tab", id: "dimensions-tab", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: (evt) => {
                                    this.props.resizeTexture(this.state.width, this.state.height);
                                    evt.preventDefault();
                                }, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "dimensions", children: ["W:", " ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: this.state.width, readOnly: texture.isCube, onChange: (evt) => this.setState({ width: this._getNewDimension(this.state.width, evt.target.value) }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "dimensions", children: ["H:", " ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: this.state.height, readOnly: texture.isCube, onChange: (evt) => this.setState({ height: this._getNewDimension(this.state.height, evt.target.value) }) })] }), !texture.isCube && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { id: "resize", className: "icon button", title: "Resize", alt: "Resize", src: _assets_resizeTool_svg__WEBPACK_IMPORTED_MODULE_9__, onClick: () => resizeTexture(this.state.width, this.state.height) }))] }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "tab", id: "pixel-coords-tab", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(this._pixelData, { name: "X", data: pixelData.x }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(this._pixelData, { name: "Y", data: pixelData.y })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "tab", id: "pixel-color-tab", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(this._pixelData, { name: "R", data: pixelData.r }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(this._pixelData, { name: "G", data: pixelData.g }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(this._pixelData, { name: "B", data: pixelData.b }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(this._pixelData, { name: "A", data: pixelData.a })] }), texture.isCube && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "tab", id: "face-tab", children: this._faces.map((value, index) => ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: face == index ? "icon face button active" : "icon face button", src: value, onClick: () => setFace(index) }, index))) })), mipsEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "tab", id: "mip-tab", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { title: "Mip Preview Up", className: "icon button", src: _assets_mipUp_svg__WEBPACK_IMPORTED_MODULE_10__, onClick: () => mipLevel > 0 && setMipLevel(mipLevel - 1) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { title: "Mip Preview Down", className: "icon button", src: _assets_mipDown_svg__WEBPACK_IMPORTED_MODULE_11__, onClick: () => mipLevel < maxLevels && setMipLevel(mipLevel + 1) })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "tab", id: "right-tab", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { title: "Reset", className: "icon button", src: _assets_reset_svg__WEBPACK_IMPORTED_MODULE_12__, onClick: () => resetTexture() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { accept: ".jpg, .png, .tga, .dds, .env, .exr", type: "file", onChange: (evt) => {
                                        const files = evt.target.files;
                                        if (files && files.length) {
                                            uploadTexture(files[0]);
                                        }
                                        evt.target.value = "";
                                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { title: "Upload", className: "icon button", src: _assets_upload_svg__WEBPACK_IMPORTED_MODULE_13__ })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { title: "Save", className: "icon button", src: _assets_save_svg__WEBPACK_IMPORTED_MODULE_14__, onClick: () => saveTexture() })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasComponent.js":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasComponent.js ***!
  \*************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2191138__) => {

"use strict";
__nested_webpack_require_2191138__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2191138__.d(__nested_webpack_exports__, {
/* harmony export */   TextureCanvasComponent: () => (/* binding */ TextureCanvasComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2191138__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2191138__(/*! react */ "../../../../node_modules/react/index.js");


class TextureCanvasComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("canvas", { id: "canvas-ui", ref: this.props.canvasUI, tabIndex: 1 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("canvas", { id: "canvas-2D", ref: this.props.canvas2D, hidden: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("canvas", { id: "canvas-3D", ref: this.props.canvas3D, hidden: true })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager.js":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager.js ***!
  \***********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2192862__) => {

"use strict";
__nested_webpack_require_2192862__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2192862__.d(__nested_webpack_exports__, {
/* harmony export */   TextureCanvasManager: () => (/* binding */ TextureCanvasManager)
/* harmony export */ });
/* harmony import */ var core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2192862__(/*! core/Events/keyboardEvents */ "core/Misc/observable");
/* harmony import */ var core_Engines_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2192862__.n(core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _textureHelper__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2192862__(/*! ../../../../../../textureHelper */ "../../../dev/inspector/dist/textureHelper.js");
/* harmony import */ var _canvasShader__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2192862__(/*! ./canvasShader */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/canvasShader.js");
/* eslint-disable @typescript-eslint/naming-convention */
















class TextureCanvasManager {
    constructor(texture, window, canvasUI, canvas2D, canvas3D, setPixelData, metadata, onUpdate, setMetadata, setMipLevel) {
        this._isPanning = false;
        this._channels = [];
        this._face = 0;
        this._mipLevel = 0;
        /** Keeps track of whether we have modified the texture */
        this._didEdit = false;
        /** Tracks which keys are currently pressed */
        this._keyMap = {};
        /** Tracks which mouse buttons are currently pressed */
        this._buttonsPressed = 0;
        this.ZOOM_MOUSE_SPEED = 0.001;
        this.ZOOM_KEYBOARD_SPEED = 0.4;
        this.ZOOM_IN_KEY = "+";
        this.ZOOM_OUT_KEY = "-";
        this.PAN_SPEED = 0.003;
        this.PAN_KEY = "Space";
        this.MIN_SCALE = 0.01;
        this.GRID_SCALE = 0.047;
        this.MAX_SCALE = 10;
        this.SELECT_ALL_KEY = "KeyA";
        this.SAVE_KEY = "KeyS";
        this.RESET_KEY = "KeyR";
        this.DESELECT_KEY = "Escape";
        /** The number of milliseconds between texture updates */
        this.PUSH_FREQUENCY = 32;
        this._editing3D = false;
        this._canPush = true;
        this._shouldPush = false;
        this._window = window;
        this._uiCanvas = canvasUI;
        this._2DCanvas = canvas2D;
        this._3DCanvas = canvas3D;
        this._paintCanvas = document.createElement("canvas");
        this._setPixelData = setPixelData;
        this._metadata = metadata;
        this._onUpdate = onUpdate;
        this._setMetadata = setMetadata;
        this._setMipLevel = setMipLevel;
        this._originalTexture = texture;
        this._originalTextureProperties = {
            _texture: this._originalTexture._texture,
            url: this._originalTexture.url,
            _forceSerialize: this._originalTexture._forceSerialize,
        };
        this._engine = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Engine(this._uiCanvas, true);
        this._scene = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Scene(this._engine, { virtual: true });
        this._scene.clearColor = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Color4(0.11, 0.11, 0.11, 1.0);
        this._camera = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.FreeCamera("camera", new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Vector3(0, 0, -1), this._scene);
        this._camera.mode = core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Camera.ORTHOGRAPHIC_CAMERA;
        this._camera.minZ = 0.5;
        this._camera.maxZ = 1.5;
        this._cameraPos = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Vector2();
        this.setSize(texture.getSize());
        this._channelsTexture = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.HtmlElementTexture("ct", this._2DCanvas, {
            engine: this._engine,
            scene: null,
            samplingMode: core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_SAMPLINGMODE,
            generateMipMaps: true,
        });
        this._3DEngine = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Engine(this._3DCanvas);
        this._3DScene = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Scene(this._3DEngine, { virtual: true });
        this._3DScene.clearColor = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Color4(0, 0, 0, 0);
        this._3DCanvasTexture = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.HtmlElementTexture("canvas", this._2DCanvas, { engine: this._3DEngine, scene: this._3DScene });
        this._3DCanvasTexture.hasAlpha = true;
        const cam = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.FreeCamera("camera", new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Vector3(0, 0, -1), this._3DScene);
        cam.mode = core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Camera.ORTHOGRAPHIC_CAMERA;
        [cam.orthoBottom, cam.orthoLeft, cam.orthoTop, cam.orthoRight] = [-0.5, -0.5, 0.5, 0.5];
        this._3DPlane = (0,core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.CreatePlane)("texture", { width: 1, height: 1 }, this._3DScene);
        this._3DPlane.hasVertexAlpha = true;
        const mat = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.StandardMaterial("material", this._3DScene);
        mat.diffuseTexture = this._3DCanvasTexture;
        mat.useAlphaFromDiffuseTexture = true;
        mat.disableLighting = true;
        mat.emissiveColor = core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Color3.White();
        this._3DPlane.material = mat;
        this._planeMaterial = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial("canvasShader", this._scene, _canvasShader__WEBPACK_IMPORTED_MODULE_2__.canvasShader.path, _canvasShader__WEBPACK_IMPORTED_MODULE_2__.canvasShader.options);
        this.grabOriginalTexture();
        this._planeMaterial.setTexture("textureSampler", this._channelsTexture);
        this._planeMaterial.setFloat("r", 1.0);
        this._planeMaterial.setFloat("g", 1.0);
        this._planeMaterial.setFloat("b", 1.0);
        this._planeMaterial.setFloat("a", 1.0);
        this._planeMaterial.setInt("x1", -1);
        this._planeMaterial.setInt("y1", -1);
        this._planeMaterial.setInt("x2", -1);
        this._planeMaterial.setInt("y2", -1);
        this._planeMaterial.setInt("w", this._size.width);
        this._planeMaterial.setInt("h", this._size.height);
        this._planeMaterial.setInt("time", 0);
        this._planeMaterial.setFloat("showGrid", 0.0);
        this._plane.material = this._planeMaterial;
        this._window.addEventListener("keydown", (evt) => {
            this._keyMap[evt.code] = true;
            if (evt.code === this.SELECT_ALL_KEY && evt.ctrlKey) {
                this._setMetadata({
                    select: {
                        x1: 0,
                        y1: 0,
                        x2: this._size.width,
                        y2: this._size.height,
                    },
                });
                evt.preventDefault();
            }
            if (evt.code === this.SAVE_KEY && evt.ctrlKey) {
                this.saveTexture();
                evt.preventDefault();
            }
            if (evt.code === this.RESET_KEY && evt.ctrlKey) {
                this.reset();
                evt.preventDefault();
            }
            if (evt.code === this.DESELECT_KEY) {
                this._setMetadata({
                    select: {
                        x1: -1,
                        y1: -1,
                        x2: -1,
                        y2: -1,
                    },
                });
            }
        });
        this._window.addEventListener("keyup", (evt) => {
            this._keyMap[evt.code] = false;
        });
        this._engine.runRenderLoop(() => {
            this._engine.resize();
            this._scene.render();
            this._planeMaterial.setInt("time", new Date().getTime());
        });
        this._scale = 1.5 / Math.max(this._size.width, this._size.height);
        this._isPanning = false;
        this._scene.onBeforeRenderObservable.add(() => {
            this._scale = Math.min(Math.max(this._scale, this.MIN_SCALE / Math.log2(Math.min(this._size.width, this._size.height))), this.MAX_SCALE);
            if (this._scale > this.GRID_SCALE) {
                this._planeMaterial.setFloat("showGrid", 1.0);
            }
            else {
                this._planeMaterial.setFloat("showGrid", 0.0);
            }
            const ratio = this._uiCanvas?.width / this._uiCanvas?.height;
            const { x, y } = this._cameraPos;
            this._camera.orthoBottom = y - 1 / this._scale;
            this._camera.orthoTop = y + 1 / this._scale;
            this._camera.orthoLeft = x - ratio / this._scale;
            this._camera.orthoRight = x + ratio / this._scale;
        });
        this._scene.onPointerObservable.add((pointerInfo) => {
            const leftButtonPressed = pointerInfo.event.buttons & 1;
            const middleButtonPressed = pointerInfo.event.buttons & 4;
            if (!this._isPanning) {
                if ((leftButtonPressed && !(this._buttonsPressed & 1) && this._keyMap[this.PAN_KEY]) || middleButtonPressed) {
                    this._isPanning = true;
                    this._mouseX = pointerInfo.event.x;
                    this._mouseY = pointerInfo.event.y;
                }
                if (middleButtonPressed) {
                    this._isPanning = true;
                }
            }
            else if ((!leftButtonPressed || !this._keyMap[this.PAN_KEY]) && !middleButtonPressed) {
                this._isPanning = false;
            }
            switch (pointerInfo.type) {
                case core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERWHEEL: {
                    const event = pointerInfo.event;
                    this._scale -= event.deltaY * this.ZOOM_MOUSE_SPEED * this._scale;
                    break;
                }
                case core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERMOVE:
                    if (this._isPanning) {
                        this._cameraPos.x -= ((pointerInfo.event.x - this._mouseX) * this.PAN_SPEED) / this._scale;
                        this._cameraPos.y += ((pointerInfo.event.y - this._mouseY) * this.PAN_SPEED) / this._scale;
                        this._mouseX = pointerInfo.event.x;
                        this._mouseY = pointerInfo.event.y;
                    }
                    if (pointerInfo.pickInfo?.hit) {
                        const pos = this.getMouseCoordinates(pointerInfo);
                        const idx = (pos.x + pos.y * this._size.width) * 4;
                        this._setPixelData({ x: pos.x, y: pos.y, r: this._imageData[idx], g: this._imageData[idx + 1], b: this._imageData[idx + 2], a: this._imageData[idx + 3] });
                    }
                    else {
                        this._setPixelData({});
                    }
                    break;
            }
            this._buttonsPressed = pointerInfo.event.buttons;
        });
        this._scene.onKeyboardObservable.add((kbInfo) => {
            switch (kbInfo.type) {
                case core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.KeyboardEventTypes.KEYDOWN:
                    this._keyMap[kbInfo.event.key] = true;
                    switch (kbInfo.event.key) {
                        case this.ZOOM_IN_KEY:
                            this._scale += this.ZOOM_KEYBOARD_SPEED * this._scale;
                            break;
                        case this.ZOOM_OUT_KEY:
                            this._scale -= this.ZOOM_KEYBOARD_SPEED * this._scale;
                            break;
                    }
                    break;
                case core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.KeyboardEventTypes.KEYUP:
                    this._keyMap[kbInfo.event.key] = false;
                    break;
            }
        });
    }
    async updateTexture() {
        if (this._mipLevel !== 0) {
            await this._setMipLevel(0);
        }
        this._didEdit = true;
        const element = this._editing3D ? this._3DCanvas : this._2DCanvas;
        if (this._editing3D) {
            this._3DCanvasTexture.update();
            this._3DScene.render();
        }
        if (this._originalTexture.isCube) {
            // TODO: fix cube map editing
        }
        else {
            if (!this._target) {
                this._target = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.HtmlElementTexture("editor", element, {
                    engine: this._originalTexture.getScene()?.getEngine(),
                    scene: null,
                    samplingMode: this._originalTexture.samplingMode,
                    generateMipMaps: this._originalTextureProperties._texture?.generateMipMaps,
                });
            }
            else {
                this._target.element = element;
            }
            this.pushTexture();
        }
        this._originalTexture._texture = this._target._texture;
        this._originalTexture.url = null;
        this._originalTexture._forceSerialize = true;
        this._channelsTexture.element = element;
        this.updateDisplay();
        this._onUpdate();
    }
    async pushTexture() {
        if (this._canPush) {
            const invertY = this._target.constructor.name === core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.HtmlElementTexture.name ? false : this._originalTexture.invertY;
            this._target.update(invertY);
            this._target._texture?.updateSize(this._size.width, this._size.height);
            if (this._editing3D) {
                const bufferView = await this._3DEngine.readPixels(0, 0, this._size.width, this._size.height);
                this._imageData = new Uint8Array(bufferView.buffer, 0, bufferView.byteLength);
            }
            else {
                this._imageData = this._2DCanvas.getContext("2d").getImageData(0, 0, this._size.width, this._size.height).data;
            }
            this._canPush = false;
            this._shouldPush = false;
            setTimeout(() => {
                this._canPush = true;
                if (this._shouldPush) {
                    this.pushTexture();
                }
            }, this.PUSH_FREQUENCY);
        }
        else {
            this._shouldPush = true;
        }
    }
    async startPainting() {
        if (this._mipLevel != 0) {
            await this._setMipLevel(0);
        }
        let x = 0, y = 0, w = this._size.width, h = this._size.height;
        if (this._metadata.select.x1 != -1) {
            x = this._metadata.select.x1;
            y = this._metadata.select.y1;
            w = this._metadata.select.x2 - this._metadata.select.x1;
            h = this._metadata.select.y2 - this._metadata.select.y1;
        }
        this._paintCanvas.width = w;
        this._paintCanvas.height = h;
        const ctx = this._paintCanvas.getContext("2d");
        ctx.imageSmoothingEnabled = false;
        ctx.drawImage(this._2DCanvas, x, y, w, h, 0, 0, w, h);
        return ctx;
    }
    updatePainting() {
        let x = 0, y = 0, w = this._size.width, h = this._size.height;
        if (this._metadata.select.x1 != -1) {
            x = this._metadata.select.x1;
            y = this._metadata.select.y1;
            w = this._metadata.select.x2 - this._metadata.select.x1;
            h = this._metadata.select.y2 - this._metadata.select.y1;
        }
        let editingAllChannels = true;
        this._channels.forEach((channel) => {
            if (!channel.editable) {
                editingAllChannels = false;
            }
        });
        let oldData;
        if (!editingAllChannels) {
            oldData = this._2DCanvas.getContext("2d").getImageData(x, y, w, h).data;
        }
        const ctx = this._paintCanvas.getContext("2d");
        const ctx2D = this.canvas2D.getContext("2d");
        ctx2D.globalAlpha = 1.0;
        ctx2D.globalCompositeOperation = "destination-out";
        ctx2D.fillStyle = "white";
        ctx2D.fillRect(x, y, w, h);
        ctx2D.imageSmoothingEnabled = false;
        // If we're not editing all channels, we must process the pixel data
        if (!editingAllChannels) {
            const newData = ctx.getImageData(0, 0, w, h);
            const nd = newData.data;
            this._channels.forEach((channel, index) => {
                if (!channel.editable) {
                    for (let i = index; i < w * h * 4; i += 4) {
                        nd[i] = oldData[i];
                    }
                }
            });
            ctx2D.globalCompositeOperation = "source-over";
            ctx2D.globalAlpha = 1.0;
            ctx2D.putImageData(newData, x, y);
        }
        else {
            ctx2D.globalCompositeOperation = "source-over";
            ctx2D.globalAlpha = 1.0;
            // We want to use drawImage wherever possible since it is much faster than putImageData
            ctx2D.drawImage(ctx.canvas, x, y);
        }
        this.updateTexture();
    }
    stopPainting() {
        this._paintCanvas.getContext("2d").clearRect(0, 0, this._paintCanvas.width, this._paintCanvas.height);
    }
    updateDisplay() {
        this._3DScene.render();
        this._channelsTexture.update(true);
    }
    set channels(channels) {
        // Determine if we need to re-render the texture. This is an expensive operation, so we should only do it if channel visibility has changed.
        let needsRender = false;
        if (channels.length !== this._channels.length) {
            needsRender = true;
        }
        else {
            channels.forEach((channel, index) => {
                if (channel.visible !== this._channels[index].visible) {
                    needsRender = true;
                    this._planeMaterial.setFloat(channel.id.toLowerCase(), channel.visible ? 1.0 : 0.0);
                }
            });
        }
        this._channels = channels;
        if (needsRender) {
            this.updateDisplay();
        }
    }
    paintPixelsOnCanvas(pixelData, canvas) {
        const ctx = canvas.getContext("2d");
        const imgData = ctx.createImageData(canvas.width, canvas.height);
        imgData.data.set(pixelData);
        ctx.putImageData(imgData, 0, 0);
    }
    async grabOriginalTexture() {
        // Grab image data from original texture and paint it onto the context of a DynamicTexture
        this.setSize(this._originalTexture.getSize());
        const data = await _textureHelper__WEBPACK_IMPORTED_MODULE_1__.TextureHelper.GetTextureDataAsync(this._originalTexture, this._size.width, this._size.height, this._face, { R: true, G: true, B: true, A: true }, undefined, this._mipLevel);
        this._imageData = data;
        this.paintPixelsOnCanvas(data, this._2DCanvas);
        this._3DCanvasTexture.update();
        this.updateDisplay();
        return data;
    }
    getMouseCoordinates(pointerInfo) {
        if (pointerInfo.pickInfo?.hit) {
            const x = Math.floor(pointerInfo.pickInfo.getTextureCoordinates().x * this._size.width);
            const y = Math.floor((1 - pointerInfo.pickInfo.getTextureCoordinates().y) * this._size.height);
            return new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Vector2(x, y);
        }
        else {
            return new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Vector2();
        }
    }
    get scene() {
        return this._scene;
    }
    get canvas2D() {
        return this._2DCanvas;
    }
    get size() {
        return this._size;
    }
    set tool(tool) {
        if (this._tool) {
            this._tool.instance.cleanup();
        }
        this._tool = tool;
        if (this._tool) {
            this._tool.instance.setup();
            if (this._editing3D && !this._tool.is3D) {
                this._editing3D = false;
                this._2DCanvas.getContext("2d")?.drawImage(this._3DCanvas, 0, 0);
            }
            else if (!this._editing3D && this._tool.is3D) {
                this._editing3D = true;
                this.updateTexture();
            }
        }
    }
    get tool() {
        return this._tool;
    }
    set face(face) {
        if (this._face !== face) {
            this._face = face;
            this.grabOriginalTexture();
            this.updateDisplay();
        }
    }
    set mipLevel(mipLevel) {
        if (this._mipLevel === mipLevel) {
            return;
        }
        this._mipLevel = mipLevel;
        this.grabOriginalTexture();
    }
    /** Returns the 3D scene used for postprocesses */
    get scene3D() {
        return this._3DScene;
    }
    set metadata(metadata) {
        this._metadata = metadata;
        const { x1, y1, x2, y2 } = metadata.select;
        this._planeMaterial.setInt("x1", x1);
        this._planeMaterial.setInt("y1", y1);
        this._planeMaterial.setInt("x2", x2);
        this._planeMaterial.setInt("y2", y2);
    }
    makePlane() {
        if (this._plane) {
            this._plane.dispose();
        }
        this._plane = (0,core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.CreatePlane)("plane", { width: this._size.width, height: this._size.height }, this._scene);
        this._plane.enableEdgesRendering();
        this._plane.edgesWidth = 4.0;
        this._plane.edgesColor = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Color4(1, 1, 1, 1);
        this._plane.enablePointerMoveEvents = true;
        this._plane.material = this._planeMaterial;
    }
    reset() {
        if (this._tool && this._tool.instance.onReset) {
            this._tool.instance.onReset();
        }
        this._originalTexture._texture = this._originalTextureProperties._texture;
        this._originalTexture.url = this._originalTextureProperties.url;
        this._originalTexture._forceSerialize = this._originalTextureProperties._forceSerialize;
        this.grabOriginalTexture();
        this.makePlane();
        this._didEdit = false;
        this._onUpdate();
    }
    async resize(newSize) {
        const data = await _textureHelper__WEBPACK_IMPORTED_MODULE_1__.TextureHelper.GetTextureDataAsync(this._originalTexture, newSize.width, newSize.height, this._face, { R: true, G: true, B: true, A: true });
        this.setSize(newSize);
        this.paintPixelsOnCanvas(data, this._2DCanvas);
        this.updateTexture();
        this._didEdit = true;
    }
    setSize(size) {
        const oldSize = this._size;
        this._size = size;
        this._2DCanvas.width = this._size.width;
        this._2DCanvas.height = this._size.height;
        this._3DCanvas.width = this._size.width;
        this._3DCanvas.height = this._size.height;
        if (this._planeMaterial) {
            this._planeMaterial.setInt("w", this._size.width);
            this._planeMaterial.setInt("h", this._size.height);
        }
        if (!oldSize || oldSize.width != size.width || oldSize.height != size.height) {
            this._cameraPos.x = 0;
            this._cameraPos.y = 0;
            this._scale = 1.5 / Math.max(this._size.width, this._size.height);
        }
        this.makePlane();
    }
    upload(file) {
        core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Tools.ReadFile(file, (data) => {
            const blob = new Blob([data], { type: "octet/stream" });
            let extension = undefined;
            if (file.name.toLowerCase().indexOf(".dds") > 0) {
                extension = ".dds";
            }
            else if (file.name.toLowerCase().indexOf(".env") > 0) {
                extension = ".env";
            }
            const reader = new FileReader();
            reader.readAsDataURL(blob);
            reader.onloadend = () => {
                const base64data = reader.result;
                if (extension === ".dds" || extension === ".env") {
                    this._originalTexture.updateURL(base64data, extension, () => this.grabOriginalTexture());
                }
                else {
                    const texture = new core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Texture(base64data, this._scene, this._originalTexture.noMipmap, false, core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_SAMPLINGMODE, () => {
                        _textureHelper__WEBPACK_IMPORTED_MODULE_1__.TextureHelper.GetTextureDataAsync(texture, texture.getSize().width, texture.getSize().height, 0, { R: true, G: true, B: true, A: true }).then(async (pixels) => {
                            if (this._tool && this._tool.instance.onReset) {
                                this._tool.instance.onReset();
                            }
                            texture.dispose();
                            this.setSize(texture.getSize());
                            this.paintPixelsOnCanvas(pixels, this._2DCanvas);
                            await this.updateTexture();
                            this._setMipLevel(0);
                        });
                    });
                }
            };
        }, undefined, true);
    }
    saveTexture() {
        const canvas = this._editing3D ? this._3DCanvas : this._2DCanvas;
        core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Tools.ToBlob(canvas, (blob) => {
            core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Tools.Download(blob, this._originalTexture.name);
        });
    }
    toolInteractionEnabled() {
        return !(this._keyMap[this.PAN_KEY] || this._isPanning);
    }
    dispose() {
        if (this._didEdit) {
            this._originalTextureProperties._texture?.dispose();
        }
        if (this._tool) {
            this._tool.instance.cleanup();
        }
        this._paintCanvas.parentNode?.removeChild(this._paintCanvas);
        this._3DPlane.dispose();
        this._3DCanvasTexture.dispose();
        this._3DScene.dispose();
        this._3DEngine.dispose();
        this._plane.dispose();
        this._channelsTexture.dispose();
        this._planeMaterial.dispose();
        this._camera.dispose();
        this._scene.dispose();
        this._engine.dispose();
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.js":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.js ***!
  \*************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2219647__) => {

"use strict";
__nested_webpack_require_2219647__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2219647__.d(__nested_webpack_exports__, {
/* harmony export */   TextureEditorComponent: () => (/* binding */ TextureEditorComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2219647__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2219647__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _textureCanvasManager__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2219647__(/*! ./textureCanvasManager */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager.js");
/* harmony import */ var _toolBar__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2219647__(/*! ./toolBar */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/toolBar.js");
/* harmony import */ var _propertiesBar__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2219647__(/*! ./propertiesBar */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/propertiesBar.js");
/* harmony import */ var _channelsBar__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2219647__(/*! ./channelsBar */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/channelsBar.js");
/* harmony import */ var _bottomBar__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2219647__(/*! ./bottomBar */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/bottomBar.js");
/* harmony import */ var _textureCanvasComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2219647__(/*! ./textureCanvasComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasComponent.js");
/* harmony import */ var _defaultTools_defaultTools__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2219647__(/*! ./defaultTools/defaultTools */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/defaultTools.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2219647__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__nested_webpack_require_2219647__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _toolSettings__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2219647__(/*! ./toolSettings */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/toolSettings.js");
/* harmony import */ var _textureEditor_scss__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2219647__(/*! ./textureEditor.scss */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss");













class TextureEditorComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._uiCanvas = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._2DCanvas = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._3DCanvas = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._pickerRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        const channels = [
            { name: "Red", visible: true, editable: true, id: "R", icon: __nested_webpack_require_2219647__(/*! ./assets/channelR.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelR.svg") },
            { name: "Green", visible: true, editable: true, id: "G", icon: __nested_webpack_require_2219647__(/*! ./assets/channelG.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelG.svg") },
            { name: "Blue", visible: true, editable: true, id: "B", icon: __nested_webpack_require_2219647__(/*! ./assets/channelB.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelB.svg") },
        ];
        if (this.props.texture.isCube) {
            channels.push({ name: "Display", visible: true, editable: true, id: "A", icon: __nested_webpack_require_2219647__(/*! ./assets/channelD.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelD.svg") });
        }
        else {
            channels.push({ name: "Alpha", visible: true, editable: true, id: "A", icon: __nested_webpack_require_2219647__(/*! ./assets/channelA.svg */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelA.svg") });
        }
        this.state = {
            tools: [],
            activeToolIndex: -1,
            metadata: {
                color: "#ffffff",
                alpha: 1,
                select: {
                    x1: -1,
                    y1: -1,
                    x2: -1,
                    y2: -1,
                },
            },
            channels,
            pixelData: {},
            face: 0,
            mipLevel: 0,
            pickerOpen: false,
        };
        this.loadToolFromURL = this.loadToolFromURL.bind(this);
        this.changeTool = this.changeTool.bind(this);
        this.setMetadata = this.setMetadata.bind(this);
        this.saveTexture = this.saveTexture.bind(this);
        this.resetTexture = this.resetTexture.bind(this);
        this.resizeTexture = this.resizeTexture.bind(this);
        this.uploadTexture = this.uploadTexture.bind(this);
        this.setPickerOpen = this.setPickerOpen.bind(this);
        this.onPointerDown = this.onPointerDown.bind(this);
    }
    componentDidMount() {
        this._textureCanvasManager = new _textureCanvasManager__WEBPACK_IMPORTED_MODULE_2__.TextureCanvasManager(this.props.texture, this.props.window.current.getWindow(), this._uiCanvas.current, this._2DCanvas.current, this._3DCanvas.current, (data) => {
            this.setState({ pixelData: data });
        }, this.state.metadata, () => this.textureDidUpdate(), (data) => this.setMetadata(data), (mipLevel) => this.setState({ mipLevel }));
        this.addTools(_defaultTools_defaultTools__WEBPACK_IMPORTED_MODULE_8__["default"]);
    }
    componentDidUpdate() {
        const channelsClone = [];
        this.state.channels.forEach((channel) => channelsClone.push({ ...channel }));
        this._textureCanvasManager.channels = channelsClone;
        this._textureCanvasManager.face = this.state.face;
        this._textureCanvasManager.mipLevel = this.state.mipLevel;
    }
    componentWillUnmount() {
        this._textureCanvasManager.dispose();
    }
    textureDidUpdate() {
        if (this._timer != null) {
            window.clearTimeout(this._timer);
        }
        this._timer = window.setTimeout(() => {
            this.props.onUpdate();
            this._timer = null;
        }, TextureEditorComponent._PREVIEW_UPDATE_DELAY_MS);
    }
    loadToolFromURL(url) {
        core_Misc_tools__WEBPACK_IMPORTED_MODULE_9__.Tools.LoadScript(url, () => {
            this.addTools([_TOOL_DATA_]);
        });
    }
    addTools(tools) {
        let newTools = [];
        tools.forEach((toolData) => {
            const tool = {
                ...toolData,
                instance: new toolData.type(() => this.getToolParameters()),
            };
            newTools = newTools.concat(tool);
        });
        newTools = this.state.tools.concat(newTools);
        this.setState({ tools: newTools });
    }
    getToolParameters() {
        return {
            scene: this._textureCanvasManager.scene,
            canvas2D: this._textureCanvasManager.canvas2D,
            scene3D: this._textureCanvasManager.scene3D,
            size: this._textureCanvasManager.size,
            updateTexture: () => this._textureCanvasManager.updateTexture(),
            startPainting: () => this._textureCanvasManager.startPainting(),
            stopPainting: () => this._textureCanvasManager.stopPainting(),
            updatePainting: () => this._textureCanvasManager.updatePainting(),
            metadata: this.state.metadata,
            setMetadata: (data) => this.setMetadata(data),
            getMouseCoordinates: (pointerInfo) => this._textureCanvasManager.getMouseCoordinates(pointerInfo),
            interactionEnabled: () => this._textureCanvasManager.toolInteractionEnabled(),
        };
    }
    changeTool(index) {
        if (index != -1) {
            this._textureCanvasManager.tool = this.state.tools[index];
        }
        else {
            this._textureCanvasManager.tool = null;
        }
        this.setState({ activeToolIndex: index });
    }
    setMetadata(newMetadata) {
        const data = {
            ...this.state.metadata,
            ...newMetadata,
        };
        this.setState({ metadata: data });
        this._textureCanvasManager.metadata = data;
    }
    setPickerOpen(open) {
        this.setState({ pickerOpen: open });
    }
    onPointerDown(evt) {
        if (!this._pickerRef.current?.contains(evt.target)) {
            this.setPickerOpen(false);
        }
    }
    saveTexture() {
        this._textureCanvasManager.saveTexture();
    }
    resetTexture() {
        this._textureCanvasManager.reset();
    }
    resizeTexture(width, height) {
        this._textureCanvasManager.resize({ width, height });
    }
    uploadTexture(file) {
        this._textureCanvasManager.upload(file);
    }
    render() {
        const currentTool = this.state.tools[this.state.activeToolIndex];
        let cursor = `initial`;
        if (!this._textureCanvasManager?.toolInteractionEnabled()) {
            cursor = `pointer`;
        }
        else if (currentTool && currentTool.cursor) {
            cursor = `url(data:image/png;base64,${currentTool.cursor}) 10 10, auto`;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "texture-editor", onPointerDown: this.onPointerDown, style: { cursor }, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_propertiesBar__WEBPACK_IMPORTED_MODULE_4__.PropertiesBar, { texture: this.props.texture, saveTexture: this.saveTexture, pixelData: this.state.pixelData, face: this.state.face, setFace: (face) => this.setState({ face }), resetTexture: this.resetTexture, resizeTexture: this.resizeTexture, uploadTexture: this.uploadTexture, mipLevel: this.state.mipLevel, setMipLevel: (mipLevel) => this.setState({ mipLevel }), size: this._textureCanvasManager?.size || this.props.texture.getSize() }), !this.props.texture.isCube && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_toolBar__WEBPACK_IMPORTED_MODULE_3__.ToolBar, { tools: this.state.tools, activeToolIndex: this.state.activeToolIndex, addTool: this.loadToolFromURL, changeTool: this.changeTool, metadata: this.state.metadata, setMetadata: this.setMetadata, pickerOpen: this.state.pickerOpen, setPickerOpen: this.setPickerOpen, pickerRef: this._pickerRef, hasAlpha: this.props.texture.textureFormat === -1 || this.props.texture.textureFormat === core_Misc_tools__WEBPACK_IMPORTED_MODULE_9__.Constants.TEXTUREFORMAT_RGBA })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_channelsBar__WEBPACK_IMPORTED_MODULE_5__.ChannelsBar, { channels: this.state.channels, setChannels: (channels) => {
                        this.setState({ channels });
                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_textureCanvasComponent__WEBPACK_IMPORTED_MODULE_7__.TextureCanvasComponent, { canvas2D: this._2DCanvas, canvas3D: this._3DCanvas, canvasUI: this._uiCanvas, texture: this.props.texture }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_toolSettings__WEBPACK_IMPORTED_MODULE_10__.ToolSettings, { tool: currentTool }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_bottomBar__WEBPACK_IMPORTED_MODULE_6__.BottomBar, { texture: this.props.texture, mipLevel: this.state.mipLevel })] }));
    }
}
TextureEditorComponent._PREVIEW_UPDATE_DELAY_MS = 160;


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/toolBar.js":
/*!**********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/toolBar.js ***!
  \**********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2232231__) => {

"use strict";
__nested_webpack_require_2232231__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2232231__.d(__nested_webpack_exports__, {
/* harmony export */   ToolBar: () => (/* binding */ ToolBar)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2232231__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2232231__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2232231__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2232231__.n(core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_colorPicker_colorPicker__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2232231__(/*! shared-ui-components/colorPicker/colorPicker */ "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2232231__(/*! shared-ui-components/tabs/propertyGrids/lockObject */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js");





class ToolBar extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._lockObject = new shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_4__.LockObject();
        this.state = {
            toolURL: "",
            addOpen: false,
        };
    }
    computeRGBAColor() {
        const opacityInt = Math.floor(this.props.metadata.alpha * 255);
        const opacityHex = opacityInt.toString(16).padStart(2, "0");
        return core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4.FromHexString(`${this.props.metadata.color}${opacityHex}`);
    }
    shouldComponentUpdate(nextProps) {
        return (nextProps.tools != this.props.tools ||
            nextProps.activeToolIndex !== this.props.activeToolIndex ||
            nextProps.metadata != this.props.metadata ||
            nextProps.pickerOpen != this.props.pickerOpen);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "toolbar", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "tools", children: this.props.tools.map((item, index) => {
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: `data:image/svg+xml;base64,${item.icon}`, className: index === this.props.activeToolIndex ? "icon button active" : "icon button", alt: item.name, title: item.name, onClick: (evt) => {
                                if (evt.button === 0) {
                                    this.props.changeTool(index);
                                }
                            } }, index));
                    }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "color", onClick: () => {
                        if (!this.props.pickerOpen)
                            this.props.setPickerOpen(true);
                    }, title: "Color", className: `icon button${this.props.pickerOpen ? ` active` : ``}`, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "active-color-bg", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "active-color", style: { backgroundColor: this.props.metadata.color, opacity: this.props.metadata.alpha } }) }) }), this.props.pickerOpen && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "color-picker", ref: this.props.pickerRef, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_colorPicker_colorPicker__WEBPACK_IMPORTED_MODULE_3__.ColorPicker, { lockObject: this._lockObject, color: this.computeRGBAColor(), onColorChanged: (color) => {
                            const metadata = { color: color.toHexString(true), alpha: color.a };
                            if (metadata.color !== this.props.metadata.color || metadata.alpha !== this.props.metadata.alpha) {
                                this.props.setMetadata(metadata);
                            }
                        } }) }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/toolSettings.js":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/toolSettings.js ***!
  \***************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2237178__) => {

"use strict";
__nested_webpack_require_2237178__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2237178__.d(__nested_webpack_exports__, {
/* harmony export */   ToolSettings: () => (/* binding */ ToolSettings)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2237178__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2237178__(/*! react */ "../../../../node_modules/react/index.js");


class ToolSettings extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    render() {
        if (!this.props.tool || !this.props.tool.settingsComponent)
            return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {});
        return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "tool-ui", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(this.props.tool.settingsComponent, { instance: this.props.tool.instance }) });
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/bonePropertyGridComponent.js":
/*!****************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/bonePropertyGridComponent.js ***!
  \****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2238809__) => {

"use strict";
__nested_webpack_require_2238809__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2238809__.d(__nested_webpack_exports__, {
/* harmony export */   BonePropertyGridComponent: () => (/* binding */ BonePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2238809__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2238809__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2238809__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2238809__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2238809__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var _lines_quaternionLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2238809__(/*! ../../../lines/quaternionLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/quaternionLineComponent.js");






class BonePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onTransformNodeLink() {
        if (!this.props.globalState.onSelectionChangedObservable) {
            return;
        }
        const node = this.props.bone.getTransformNode();
        this.props.globalState.onSelectionChangedObservable.notifyObservers(node);
    }
    render() {
        const bone = this.props.bone;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Name", value: bone.name }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Index", value: bone.getIndex().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Unique ID", value: bone.uniqueId.toString() }), bone.getParent() && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Parent", value: bone.getParent().name, onLink: () => this.props.globalState.onSelectionChangedObservable.notifyObservers(bone.getParent()) })), bone.getTransformNode() && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Linked node", value: bone.getTransformNode().name, onLink: () => this.onTransformNodeLink() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "TRANSFORMATIONS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Position", target: bone, propertyName: "position", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), !bone.rotationQuaternion && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Rotation", useEuler: this.props.globalState.onlyUseEulers, target: bone, propertyName: "rotation", step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), bone.rotationQuaternion && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_quaternionLineComponent__WEBPACK_IMPORTED_MODULE_5__.QuaternionLineComponent, { lockObject: this.props.lockObject, label: "Rotation", useEuler: this.props.globalState.onlyUseEulers, target: bone, propertyName: "rotationQuaternion", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Scaling", target: bone, propertyName: "scaling", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.js":
/*!****************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.js ***!
  \****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2244653__) => {

"use strict";
__nested_webpack_require_2244653__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2244653__.d(__nested_webpack_exports__, {
/* harmony export */   MeshPropertyGridComponent: () => (/* binding */ MeshPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2244653__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2244653__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2244653__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2244653__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _lines_quaternionLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2244653__(/*! ../../../lines/quaternionLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/quaternionLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2244653__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/color4LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_2244653__(/*! ../animations/animationPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js");
/* harmony import */ var _commonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_2244653__(/*! ../commonPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/commonPropertyGridComponent.js");
/* harmony import */ var _variantsPropertyGridComponent__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_2244653__(/*! ../variantsPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/variantsPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_hexLineComponent__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_2244653__(/*! shared-ui-components/lines/hexLineComponent */ "../../../dev/sharedUiComponents/dist/lines/hexLineComponent.js");
/* harmony import */ var core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_2244653__(/*! core/Debug/skeletonViewer */ "core/Debug/physicsViewer");
/* harmony import */ var core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__nested_webpack_require_2244653__.n(core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_20__);
/* harmony import */ var materials_normal_normalMaterial__WEBPACK_IMPORTED_MODULE_21__ = __nested_webpack_require_2244653__(/*! materials/normal/normalMaterial */ "materials/grid/gridMaterial");
/* harmony import */ var materials_normal_normalMaterial__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__nested_webpack_require_2244653__.n(materials_normal_normalMaterial__WEBPACK_IMPORTED_MODULE_21__);
/* harmony import */ var _parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_22__ = __nested_webpack_require_2244653__(/*! ../parentPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/parentPropertyGridComponent.js");
/* harmony import */ var _physics_physicsBodyGridComponent__WEBPACK_IMPORTED_MODULE_23__ = __nested_webpack_require_2244653__(/*! ./physics/physicsBodyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/physics/physicsBodyGridComponent.js");




































class MeshPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        const mesh = this.props.mesh;
        this.state = {
            displayNormals: false,
            displayVertexColors: false,
            displayBoneWeights: !!(mesh.material && mesh.material.getClassName() === "BoneWeightShader"),
            displayBoneIndex: 0,
            displaySkeletonMap: false,
        };
    }
    renderWireframeOver() {
        const mesh = this.props.mesh;
        const scene = mesh.getScene();
        if (mesh.reservedDataStore && mesh.reservedDataStore.wireframeOver) {
            mesh.reservedDataStore.wireframeOver.dispose(false, true);
            mesh.reservedDataStore.wireframeOver = null;
            this.forceUpdate();
            return;
        }
        const wireframeOver = mesh.clone(mesh.name + "_wireframeover", null, true, false);
        wireframeOver.reservedDataStore = { hidden: true };
        // Sets up the mesh to be attached to the parent.
        // So all neutral in local space.
        wireframeOver.parent = mesh;
        wireframeOver.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero();
        wireframeOver.scaling = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3(1, 1, 1);
        wireframeOver.rotation = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero();
        wireframeOver.rotationQuaternion = null;
        const material = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.StandardMaterial("wireframeOver", scene);
        material.reservedDataStore = { hidden: true };
        wireframeOver.material = material;
        material.disableLighting = true;
        material.backFaceCulling = false;
        material.emissiveColor = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Color3.White();
        material.wireframe = true;
        if (!mesh.reservedDataStore) {
            mesh.reservedDataStore = {};
        }
        mesh.reservedDataStore.wireframeOver = wireframeOver;
        this.forceUpdate();
    }
    renderNormalVectors() {
        const mesh = this.props.mesh;
        const scene = mesh.getScene();
        if (mesh.reservedDataStore && mesh.reservedDataStore.normalLines) {
            mesh.reservedDataStore.normalLines.dispose();
            mesh.reservedDataStore.normalLines = null;
            this.forceUpdate();
            return;
        }
        const normals = mesh.getVerticesData(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.NormalKind);
        const positions = mesh.getVerticesData(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.PositionKind);
        const color = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Color3.White();
        const bbox = mesh.getBoundingInfo();
        const diag = bbox.maximum.subtractToRef(bbox.minimum, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.TmpVectors.Vector3[0]);
        const size = diag.length() * 0.05;
        const lines = [];
        for (let i = 0; i < normals.length; i += 3) {
            const v1 = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.FromArray(positions, i);
            const v2 = v1.add(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.FromArray(normals, i).scaleInPlace(size));
            lines.push([v1, v2]);
        }
        const normalLines = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.CreateLineSystem)("normalLines", { lines: lines }, scene);
        normalLines.color = color;
        normalLines.parent = mesh;
        normalLines.reservedDataStore = { hidden: true };
        if (!mesh.reservedDataStore) {
            mesh.reservedDataStore = {};
        }
        mesh.reservedDataStore.normalLines = normalLines;
        this.forceUpdate();
    }
    displayNormals() {
        const mesh = this.props.mesh;
        const scene = mesh.getScene();
        if (mesh.material && mesh.material.getClassName() === "NormalMaterial") {
            mesh.material.dispose();
            mesh.material = mesh.reservedDataStore.originalMaterial;
            mesh.reservedDataStore.originalMaterial = null;
            this.setState({ displayNormals: false });
        }
        else {
            if (typeof materials_normal_normalMaterial__WEBPACK_IMPORTED_MODULE_21__.NormalMaterial === "undefined") {
                core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.Warn("NormalMaterial not found. Make sure to load the materials library.");
                return;
            }
            if (!mesh.reservedDataStore) {
                mesh.reservedDataStore = {};
            }
            if (!mesh.reservedDataStore.originalMaterial) {
                mesh.reservedDataStore.originalMaterial = mesh.material;
            }
            const normalMaterial = new materials_normal_normalMaterial__WEBPACK_IMPORTED_MODULE_21__.NormalMaterial("normalMaterial", scene);
            normalMaterial.disableLighting = true;
            if (mesh.material) {
                normalMaterial.sideOrientation = mesh.material.sideOrientation;
            }
            normalMaterial.reservedDataStore = { hidden: true };
            mesh.material = normalMaterial;
            this.setState({ displayNormals: true });
        }
    }
    displayVertexColors() {
        const mesh = this.props.mesh;
        const scene = mesh.getScene();
        if (mesh.material && mesh.material.reservedDataStore && mesh.material.reservedDataStore.isVertexColorMaterial) {
            mesh.material.dispose();
            mesh.material = mesh.reservedDataStore.originalMaterial;
            mesh.reservedDataStore.originalMaterial = null;
            this.setState({ displayVertexColors: false });
        }
        else {
            if (!mesh.reservedDataStore) {
                mesh.reservedDataStore = {};
            }
            if (!mesh.reservedDataStore.originalMaterial) {
                mesh.reservedDataStore.originalMaterial = mesh.material;
            }
            const vertexColorMaterial = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.StandardMaterial("vertex colors", scene);
            vertexColorMaterial.disableLighting = true;
            vertexColorMaterial.emissiveColor = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Color3.White();
            if (mesh.material) {
                vertexColorMaterial.sideOrientation = mesh.material.sideOrientation;
            }
            vertexColorMaterial.reservedDataStore = { hidden: true, isVertexColorMaterial: true };
            mesh.useVertexColors = true;
            mesh.material = vertexColorMaterial;
            this.setState({ displayVertexColors: true });
        }
    }
    displayBoneWeights() {
        const mesh = this.props.mesh;
        const scene = mesh.getScene();
        if (mesh.material && mesh.material.getClassName() === "BoneWeightShader") {
            mesh.material.dispose();
            mesh.material = mesh.reservedDataStore.originalMaterial;
            mesh.reservedDataStore.originalMaterial = null;
            this.setState({ displayBoneWeights: false });
        }
        else {
            if (!mesh.reservedDataStore) {
                mesh.reservedDataStore = {};
            }
            if (!mesh.reservedDataStore.originalMaterial) {
                mesh.reservedDataStore.originalMaterial = mesh.material;
            }
            if (!mesh.reservedDataStore.displayBoneIndex) {
                mesh.reservedDataStore.displayBoneIndex = this.state.displayBoneIndex;
            }
            if (mesh.skeleton) {
                const boneWeightsShader = core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_20__.SkeletonViewer.CreateBoneWeightShader({ skeleton: mesh.skeleton }, scene);
                boneWeightsShader.reservedDataStore = { hidden: true };
                mesh.material = boneWeightsShader;
                this.setState({ displayBoneWeights: true });
            }
        }
    }
    displaySkeletonMap() {
        const mesh = this.props.mesh;
        const scene = mesh.getScene();
        if (mesh.material && mesh.material.getClassName() === "SkeletonMapShader") {
            mesh.material.dispose();
            mesh.material = mesh.reservedDataStore.originalMaterial;
            mesh.reservedDataStore.originalMaterial = null;
            this.setState({ displaySkeletonMap: false });
        }
        else {
            if (!mesh.reservedDataStore) {
                mesh.reservedDataStore = {};
            }
            if (!mesh.reservedDataStore.originalMaterial) {
                mesh.reservedDataStore.originalMaterial = mesh.material;
            }
            if (mesh.skeleton) {
                const skeletonMapShader = core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_20__.SkeletonViewer.CreateSkeletonMapShader({ skeleton: mesh.skeleton }, scene);
                skeletonMapShader.reservedDataStore = { hidden: true };
                mesh.material = skeletonMapShader;
                this.setState({ displaySkeletonMap: true });
            }
        }
    }
    onBoneDisplayIndexChange(value) {
        const mesh = this.props.mesh;
        mesh.reservedDataStore.displayBoneIndex = value;
        this.setState({ displayBoneIndex: value });
        if (mesh.material && mesh.material.getClassName() === "BoneWeightShader") {
            mesh.material.setFloat("targetBoneIndex", value);
        }
    }
    onMaterialLink() {
        if (!this.props.onSelectionChangedObservable) {
            return;
        }
        const mesh = this.props.mesh;
        this.props.onSelectionChangedObservable.notifyObservers(mesh.material);
    }
    onSourceMeshLink() {
        if (!this.props.onSelectionChangedObservable) {
            return;
        }
        const instanceMesh = this.props.mesh;
        this.props.onSelectionChangedObservable.notifyObservers(instanceMesh.sourceMesh);
    }
    onSkeletonLink() {
        if (!this.props.onSelectionChangedObservable) {
            return;
        }
        const mesh = this.props.mesh;
        this.props.onSelectionChangedObservable.notifyObservers(mesh.skeleton);
    }
    convertPhysicsTypeToString() {
        const mesh = this.props.mesh;
        switch (mesh.physicsImpostor.type) {
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.NoImpostor:
                return "No impostor";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.SphereImpostor:
                return "Sphere";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.BoxImpostor:
                return "Box";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.PlaneImpostor:
                return "Plane";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.MeshImpostor:
                return "Mesh";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.CylinderImpostor:
                return "Cylinder";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.ParticleImpostor:
                return "Particle";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.HeightmapImpostor:
                return "Heightmap";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.ConvexHullImpostor:
                return "Convex hull";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.RopeImpostor:
                return "Rope";
            case core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.PhysicsImpostor.SoftbodyImpostor:
                return "Soft body";
        }
        return "Unknown";
    }
    _getIdForDisplay(id) {
        if (typeof id === "string") {
            return id;
        }
        return "[INVALID ID]";
    }
    render() {
        const mesh = this.props.mesh;
        const scene = mesh.getScene();
        const displayNormals = mesh.material != null && mesh.material.getClassName() === "NormalMaterial";
        const displayVertexColors = !!(mesh.material != null && mesh.material.reservedDataStore && mesh.material.reservedDataStore.isVertexColorMaterial);
        const renderNormalVectors = mesh.reservedDataStore && mesh.reservedDataStore.normalLines ? true : false;
        const renderWireframeOver = mesh.reservedDataStore && mesh.reservedDataStore.wireframeOver ? true : false;
        const displayBoneWeights = mesh.material != null && mesh.material.getClassName() === "BoneWeightShader";
        const displaySkeletonMap = mesh.material != null && mesh.material.getClassName() === "SkeletonMapShader";
        const morphTargets = [];
        if (mesh.morphTargetManager) {
            for (let index = 0; index < mesh.morphTargetManager.numTargets; index++) {
                morphTargets.push(mesh.morphTargetManager.getTarget(index));
            }
        }
        const algorithmOptions = [
            { label: "Accurate", value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE },
            { label: "Conservative", value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE },
        ];
        const occlusionTypeOptions = [
            { label: "None", value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.AbstractMesh.OCCLUSION_TYPE_NONE },
            { label: "Optimistic", value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC },
            { label: "Strict", value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.AbstractMesh.OCCLUSION_TYPE_STRICT },
        ];
        const orientationOptions = [
            { label: "Clockwise", value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Constants.MATERIAL_ClockWiseSideOrientation },
            { label: "Counterclockwise", value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Constants.MATERIAL_CounterClockWiseSideOrientation },
        ];
        const sortedMaterials = scene.materials.slice(0).sort((a, b) => (a.name || "no name").localeCompare(b.name || "no name"));
        const materialOptions = sortedMaterials.map((m, i) => {
            return {
                label: m.name || "no name",
                value: i,
            };
        });
        materialOptions.splice(0, 0, {
            label: "None (Default Fallback)",
            value: -1,
        });
        const targetBoneOptions = mesh.skeleton
            ? mesh.skeleton.bones
                .filter((bone) => bone.getIndex() >= 0)
                .sort((bone1, bone2) => bone1.getIndex() - bone2.getIndex())
                .map((bone) => {
                return {
                    label: bone.name,
                    value: bone.getIndex(),
                };
            })
            : [];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: mesh, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "ID", value: this._getIdForDisplay(mesh.id) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_15__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: mesh, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Unique ID", value: mesh.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Class", value: mesh.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Vertices", value: mesh.getTotalVertices().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Faces", value: (mesh.getTotalIndices() / 3).toFixed(0) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Sub-meshes", value: mesh.subMeshes ? mesh.subMeshes.length.toString() : "0" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_22__.ParentPropertyGridComponent, { globalState: this.props.globalState, node: mesh, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), mesh.skeleton && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Skeleton", value: mesh.skeleton.name, onLink: () => this.onSkeletonLink() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Is enabled", isSelected: () => mesh.isEnabled(), onSelect: (value) => {
                                const prevValue = mesh.isEnabled();
                                mesh.setEnabled(value);
                                this.props.onPropertyChangedObservable?.notifyObservers({
                                    object: mesh,
                                    property: "isEnabled",
                                    value,
                                    initialValue: prevValue,
                                });
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Is pickable", target: mesh, propertyName: "isPickable", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), mesh.material && (!mesh.material.reservedDataStore || !mesh.material.reservedDataStore.hidden) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Link to material", value: mesh.material.name, onLink: () => this.onMaterialLink() })), !mesh.isAnInstance && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_13__.OptionsLine, { label: "Active material", options: materialOptions, target: mesh, propertyName: "material", noDirectUpdate: true, onSelect: (value) => {
                                if (value < 0) {
                                    mesh.material = null;
                                }
                                else {
                                    mesh.material = sortedMaterials[value];
                                }
                                this.forceUpdate();
                            }, extractValue: () => (mesh.material ? sortedMaterials.indexOf(mesh.material) : -1), onPropertyChangedObservable: this.props.onPropertyChangedObservable })), mesh.isAnInstance && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Source", value: mesh.sourceMesh.name, onLink: () => this.onSourceMeshLink() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__.ButtonLineComponent, { label: "Dispose", onClick: () => {
                                mesh.dispose();
                                this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_17__.CommonPropertyGridComponent, { host: mesh, lockObject: this.props.lockObject, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_variantsPropertyGridComponent__WEBPACK_IMPORTED_MODULE_18__.VariantsPropertyGridComponent, { host: mesh, lockObject: this.props.lockObject, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "TRANSFORMS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Position", target: mesh, propertyName: "position", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), !mesh.rotationQuaternion && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Rotation", useEuler: this.props.globalState.onlyUseEulers, target: mesh, propertyName: "rotation", step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), mesh.rotationQuaternion && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_quaternionLineComponent__WEBPACK_IMPORTED_MODULE_8__.QuaternionLineComponent, { lockObject: this.props.lockObject, label: "Rotation", useEuler: this.props.globalState.onlyUseEulers, target: mesh, propertyName: "rotationQuaternion", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Scaling", target: mesh, propertyName: "scaling", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), mesh._internalMetadata && mesh._internalMetadata.nodeGeometry && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "NODE GEOMETRY", selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__.ButtonLineComponent, { label: "Edit", onClick: () => {
                            mesh._internalMetadata.nodeGeometry.edit({
                                nodeGeometryEditorConfig: {
                                    backgroundColor: mesh.getScene().clearColor,
                                    hostMesh: mesh,
                                    hostScene: mesh.getScene(),
                                },
                            });
                        } }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "DISPLAY", closed: true, selection: this.props.globalState, children: [!mesh.isAnInstance && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Visibility", target: mesh, propertyName: "visibility", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_13__.OptionsLine, { label: "Orientation", options: orientationOptions, target: mesh, propertyName: "sideOrientation", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Alpha index", target: mesh, propertyName: "alphaIndex", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Receive shadows", target: mesh, propertyName: "receiveShadows", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.ColorKind) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use vertex colors", target: mesh, propertyName: "useVertexColors", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.ColorKind) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Has vertex alpha", target: mesh, propertyName: "hasVertexAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), scene.fogMode !== core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Scene.FOGMODE_NONE && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Apply fog", target: mesh, propertyName: "applyFog", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), !mesh.parent && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Infinite distance", target: mesh, propertyName: "infiniteDistance", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Rendering group ID", decimalCount: 0, target: mesh, propertyName: "renderingGroupId", minimum: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.RenderingManager.MIN_RENDERINGGROUPS, maximum: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.RenderingManager.MAX_RENDERINGGROUPS - 1, step: 1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_hexLineComponent__WEBPACK_IMPORTED_MODULE_19__.HexLineComponent, { isInteger: true, lockObject: this.props.lockObject, label: "Layer mask", target: mesh, propertyName: "layerMask", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), mesh.morphTargetManager != null && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "MORPH TARGETS", closed: true, selection: this.props.globalState, children: morphTargets.map((mt, i) => {
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: mt.name, target: mt, propertyName: "influence", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }, i));
                    }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_16__.AnimationGridComponent, { globalState: this.props.globalState, animatable: mesh, scene: mesh.getScene(), lockObject: this.props.lockObject }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ADVANCED", closed: true, selection: this.props.globalState, children: [mesh.useBones && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Compute bones using shaders", target: mesh, propertyName: "computeBonesUsingShaders", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Collisions", target: mesh, propertyName: "checkCollisions", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Geometry ID", value: mesh.geometry?.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Has normals", value: mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.NormalKind) ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Has vertex colors", value: mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.ColorKind) ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Has UV set 0", value: mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.UVKind) ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Has UV set 1", value: mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.UV2Kind) ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Has UV set 2", value: mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.UV3Kind) ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Has UV set 3", value: mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.UV4Kind) ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Has tangents", value: mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.TangentKind) ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Has matrix weights", value: mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.MatricesWeightsKind) ? "Yes" : "No" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Has matrix indices", value: mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.MatricesIndicesKind) ? "Yes" : "No" })] }), mesh.physicsImpostor != null && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "PHYSICS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Mass", target: mesh.physicsImpostor, propertyName: "mass", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Friction", target: mesh.physicsImpostor, propertyName: "friction", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Restitution", target: mesh.physicsImpostor, propertyName: "restitution", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Type", value: this.convertPhysicsTypeToString() })] })), mesh.physicsBody && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_physics_physicsBodyGridComponent__WEBPACK_IMPORTED_MODULE_23__.PhysicsBodyGridComponent, { lockObject: this.props.lockObject, globalState: this.props.globalState, body: mesh.physicsBody, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "OCCLUSIONS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_13__.OptionsLine, { label: "Type", options: occlusionTypeOptions, target: mesh, propertyName: "occlusionType", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Retry count", minimum: -1, maximum: 10, decimalCount: 0, step: 1, target: mesh, propertyName: "occlusionRetryCount", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_13__.OptionsLine, { label: "Algorithm", options: algorithmOptions, target: mesh, propertyName: "occlusionQueryAlgorithmType", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "EDGE RENDERING", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enable", target: mesh, isSelected: () => mesh.edgesRenderer != null, onSelect: (value) => {
                                if (value) {
                                    mesh.enableEdgesRendering();
                                }
                                else {
                                    mesh.disableEdgesRendering();
                                }
                            }, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Edge width", minimum: 0, maximum: 10, step: 0.1, target: mesh, propertyName: "edgesWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_12__.Color4LineComponent, { lockObject: this.props.lockObject, label: "Edge color", target: mesh, propertyName: "edgesColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), !mesh.isAnInstance && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "OUTLINE & OVERLAY", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Render overlay", target: mesh, propertyName: "renderOverlay", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_11__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Overlay color", target: mesh, propertyName: "overlayColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Render outline", target: mesh, propertyName: "renderOutline", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_11__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Outline color", target: mesh, propertyName: "outlineColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Outline width", target: mesh, propertyName: "outlineWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "DEBUG", closed: true, selection: this.props.globalState, children: [!mesh.isAnInstance && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Display normals", isSelected: () => displayNormals, onSelect: () => this.displayNormals() }), !mesh.isAnInstance && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Display vertex colors", isSelected: () => displayVertexColors, onSelect: () => this.displayVertexColors() })), mesh.isVerticesDataPresent(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.VertexBuffer.NormalKind) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Render vertex normals", isSelected: () => renderNormalVectors, onSelect: () => this.renderNormalVectors() })), !mesh.isAnInstance && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Render wireframe over mesh", isSelected: () => renderWireframeOver, onSelect: () => this.renderWireframeOver() })), !mesh.isAnInstance && mesh.skeleton && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Display BoneWeights", isSelected: () => displayBoneWeights, onSelect: () => this.displayBoneWeights() })), !mesh.isAnInstance && this.state.displayBoneWeights && mesh.skeleton && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_13__.OptionsLine, { label: "Target Bone Name", options: targetBoneOptions, target: mesh.reservedDataStore, propertyName: "displayBoneIndex", noDirectUpdate: true, onSelect: (value) => {
                                this.onBoneDisplayIndexChange(value);
                                this.forceUpdate();
                            } })), !mesh.isAnInstance && this.state.displayBoneWeights && mesh.skeleton && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Target Bone", decimalCount: 0, target: mesh.reservedDataStore, propertyName: "displayBoneIndex", minimum: 0, maximum: targetBoneOptions.length - 1 || 0, step: 1, onChange: (value) => {
                                this.onBoneDisplayIndexChange(value);
                                this.forceUpdate();
                            } })), !mesh.isAnInstance && mesh.skeleton && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Display SkeletonMap", isSelected: () => displaySkeletonMap, onSelect: () => this.displaySkeletonMap() }))] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/physics/physicsBodyGridComponent.js":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/physics/physicsBodyGridComponent.js ***!
  \***********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2294103__) => {

"use strict";
__nested_webpack_require_2294103__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2294103__.d(__nested_webpack_exports__, {
/* harmony export */   PhysicsBodyGridComponent: () => (/* binding */ PhysicsBodyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2294103__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2294103__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2294103__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var _physicsMassPropertiesGridComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2294103__(/*! ./physicsMassPropertiesGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/physics/physicsMassPropertiesGridComponent.js");
/* harmony import */ var _physicsMaterialGridComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2294103__(/*! ./physicsMaterialGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/physics/physicsMaterialGridComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2294103__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2294103__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");







/**
 * Component that allows displaying and tweaking a physics body's properties.
 * @param props the component props
 * @returns the component
 */
function PhysicsBodyGridComponent(props) {
    const numInstances = props.body._pluginDataInstances?.length ?? 0;
    const [selectedInstance, setSelectedInstance] = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)({ selected: 0 });
    const onChangeSelectedInstance = (value) => {
        setSelectedInstance({ selected: value });
    };
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_1__.LineContainerComponent, { title: "PHYSICS", closed: true, selection: props.globalState, children: [numInstances > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { label: "Selected instance", lockObject: props.lockObject, target: selectedInstance, propertyName: "selected", onChange: onChangeSelectedInstance, min: 0, max: numInstances - 1, isInteger: true })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_physicsMassPropertiesGridComponent__WEBPACK_IMPORTED_MODULE_3__.PhysicsMassPropertiesGridComponent, { lockObject: props.lockObject, onPropertyChangedObservable: props.onPropertyChangedObservable, body: props.body, globalState: props.globalState, instanceIndex: selectedInstance.selected }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_physicsMaterialGridComponent__WEBPACK_IMPORTED_MODULE_4__.PhysicsMaterialGridComponent, { lockObject: props.lockObject, onPropertyChangedObservable: props.onPropertyChangedObservable, body: props.body, globalState: props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Motion Type", value: _convertPhysicsMotionTypeToString(props.body.motionType) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Shape Type", value: _convertPhysicsShapeTypeToString(props.body.shape?.type) })] }));
}
function _convertPhysicsMotionTypeToString(type) {
    switch (type) {
        case 2 /* PhysicsMotionType.DYNAMIC */:
            return "Dynamic";
        case 0 /* PhysicsMotionType.STATIC */:
            return "Static";
        case 1 /* PhysicsMotionType.ANIMATED */:
            return "Animated";
        default:
            return "Unknown";
    }
}
function _convertPhysicsShapeTypeToString(type) {
    switch (type) {
        case 3 /* PhysicsShapeType.BOX */:
            return "Box";
        case 0 /* PhysicsShapeType.SPHERE */:
            return "Sphere";
        case 2 /* PhysicsShapeType.CYLINDER */:
            return "Cylinder";
        case 1 /* PhysicsShapeType.CAPSULE */:
            return "Capsule";
        case 5 /* PhysicsShapeType.CONTAINER */:
            return "Container";
        case 4 /* PhysicsShapeType.CONVEX_HULL */:
            return "Convex Hull";
        case 6 /* PhysicsShapeType.MESH */:
            return "Mesh";
        case 7 /* PhysicsShapeType.HEIGHTFIELD */:
            return "Heightfield";
        default:
            return "Unknown";
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/physics/physicsMassPropertiesGridComponent.js":
/*!*********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/physics/physicsMassPropertiesGridComponent.js ***!
  \*********************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2299916__) => {

"use strict";
__nested_webpack_require_2299916__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2299916__.d(__nested_webpack_exports__, {
/* harmony export */   PhysicsMassPropertiesGridComponent: () => (/* binding */ PhysicsMassPropertiesGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2299916__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2299916__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");


/**
 * Component that displays the mass properties of a physics body.
 * @param props the component props
 * @returns the component
 */
function PhysicsMassPropertiesGridComponent(props) {
    const massProperties = props.body.getMassProperties(props.instanceIndex);
    const changeMass = (value) => {
        massProperties.mass = value;
        props.body.setMassProperties(massProperties, props.instanceIndex);
    };
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_1__.FloatLineComponent, { lockObject: props.lockObject, label: "Mass", target: massProperties, propertyName: "mass", onPropertyChangedObservable: props.onPropertyChangedObservable, onChange: changeMass }) }));
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/physics/physicsMaterialGridComponent.js":
/*!***************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/physics/physicsMaterialGridComponent.js ***!
  \***************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2302097__) => {

"use strict";
__nested_webpack_require_2302097__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2302097__.d(__nested_webpack_exports__, {
/* harmony export */   PhysicsMaterialGridComponent: () => (/* binding */ PhysicsMaterialGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2302097__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2302097__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");


/**
 * Component that displays the physic material properties of a physics body.
 * @param props the component props
 * @returns the component
 */
function PhysicsMaterialGridComponent(props) {
    const material = props.body.shape?.material;
    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_1__.FloatLineComponent, { lockObject: props.lockObject, label: "Dynamic Friction", target: material, propertyName: "friction", onPropertyChangedObservable: props.onPropertyChangedObservable, disabled: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_1__.FloatLineComponent, { lockObject: props.lockObject, label: "Restitution", target: material, propertyName: "restitution", onPropertyChangedObservable: props.onPropertyChangedObservable, disabled: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_1__.FloatLineComponent, { lockObject: props.lockObject, label: "Static Friction", target: material, propertyName: "staticFriction", onPropertyChangedObservable: props.onPropertyChangedObservable, disabled: true })] }));
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/skeletonPropertyGridComponent.js":
/*!********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/skeletonPropertyGridComponent.js ***!
  \********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2304741__) => {

"use strict";
__nested_webpack_require_2304741__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2304741__.d(__nested_webpack_exports__, {
/* harmony export */   SkeletonPropertyGridComponent: () => (/* binding */ SkeletonPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2304741__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2304741__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2304741__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2304741__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2304741__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var _animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2304741__(/*! ../animations/animationPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js");
/* harmony import */ var core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2304741__(/*! core/Debug/skeletonViewer */ "core/Debug/physicsViewer");
/* harmony import */ var core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_2304741__.n(core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2304741__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2304741__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2304741__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2304741__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");











class SkeletonPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._skeletonViewersEnabled = false;
        this._skeletonViewerDisplayOptions = {
            displayMode: core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_6__.SkeletonViewer.DISPLAY_LINES,
            sphereBaseSize: 0.15,
            sphereScaleUnit: 2,
            sphereFactor: 0.865,
            midStep: 0.235,
            midStepFactor: 0.155,
        };
        this._skeletonViewers = new Array();
        this.checkSkeletonViewerState(this.props);
    }
    switchSkeletonViewers() {
        this._skeletonViewersEnabled = !this._skeletonViewersEnabled;
        const scene = this.props.skeleton.getScene();
        if (this._skeletonViewersEnabled) {
            for (const mesh of scene.meshes) {
                if (mesh.skeleton === this.props.skeleton) {
                    let found = false;
                    for (let sIndex = 0; sIndex < this._skeletonViewers.length; sIndex++) {
                        if (this._skeletonViewers[sIndex].skeleton === mesh.skeleton) {
                            found = true;
                            break;
                        }
                    }
                    if (found) {
                        continue;
                    }
                    const viewer = new core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_6__.SkeletonViewer(mesh.skeleton, mesh, scene, true, 3, {
                        displayMode: this._skeletonViewerDisplayOptions.displayMode,
                        displayOptions: {
                            sphereBaseSize: this._skeletonViewerDisplayOptions.sphereBaseSize,
                            sphereScaleUnit: this._skeletonViewerDisplayOptions.sphereScaleUnit,
                            sphereFactor: this._skeletonViewerDisplayOptions.sphereFactor,
                            midStep: this._skeletonViewerDisplayOptions.midStep,
                            midStepFactor: this._skeletonViewerDisplayOptions.midStepFactor,
                        },
                    });
                    viewer.isEnabled = true;
                    this._skeletonViewers.push(viewer);
                    if (!mesh.reservedDataStore) {
                        mesh.reservedDataStore = {};
                    }
                    mesh.reservedDataStore.skeletonViewer = viewer;
                }
            }
        }
        else {
            for (let index = 0; index < this._skeletonViewers.length; index++) {
                const skeletonViewer = this._skeletonViewers[index];
                if (skeletonViewer.mesh) {
                    skeletonViewer.mesh.reservedDataStore.skeletonViewer = null;
                }
                skeletonViewer.dispose();
            }
            this._skeletonViewers = [];
        }
    }
    checkSkeletonViewerState(props) {
        const scene = props.skeleton.getScene();
        this._skeletonViewers = [];
        if (!scene) {
            return;
        }
        let needInit = true;
        for (const mesh of scene.meshes) {
            if (mesh.skeleton === props.skeleton && mesh.reservedDataStore && mesh.reservedDataStore.skeletonViewer) {
                this._skeletonViewers.push(mesh.reservedDataStore.skeletonViewer);
                if (needInit) {
                    needInit = false;
                    this._skeletonViewerDisplayOptions.displayMode = this._skeletonViewers[0].displayMode;
                    for (const key in this._skeletonViewers[0].options.displayOptions) {
                        if (!key) {
                            continue;
                        }
                        this._skeletonViewerDisplayOptions[key] = this._skeletonViewers[0].options.displayOptions[key];
                    }
                }
            }
        }
        this._skeletonViewersEnabled = this._skeletonViewers.length > 0;
    }
    changeDisplayMode() {
        if (this._skeletonViewersEnabled) {
            for (let index = 0; index < this._skeletonViewers.length; index++) {
                this._skeletonViewers[index].changeDisplayMode(this._skeletonViewerDisplayOptions.displayMode || 0);
            }
        }
    }
    changeDisplayOptions(option, value) {
        if (this._skeletonViewersEnabled) {
            for (let index = 0; index < this._skeletonViewers.length; index++) {
                this._skeletonViewers[index].changeDisplayOptions(option, value);
            }
            if (this._skeletonViewerDisplayOptions[option] !== undefined) {
                this._skeletonViewerDisplayOptions[option] = value;
            }
        }
    }
    shouldComponentUpdate(nextProps) {
        if (nextProps.skeleton !== this.props.skeleton) {
            this.checkSkeletonViewerState(nextProps);
        }
        return true;
    }
    render() {
        const skeleton = this.props.skeleton;
        const debugModeOptions = [
            { label: "Lines", value: core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_6__.SkeletonViewer.DISPLAY_LINES },
            { label: "Spheres", value: core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_6__.SkeletonViewer.DISPLAY_SPHERES },
            { label: "Sphere and Spurs", value: core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_6__.SkeletonViewer.DISPLAY_SPHERE_AND_SPURS },
        ];
        let displayOptions;
        if (this._skeletonViewerDisplayOptions.displayMode > core_Debug_skeletonViewer__WEBPACK_IMPORTED_MODULE_6__.SkeletonViewer.DISPLAY_LINES) {
            displayOptions = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "DISPLAY OPTIONS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "sphereBaseSize", target: this._skeletonViewerDisplayOptions, propertyName: "sphereBaseSize", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onChange: (value) => {
                            this.changeDisplayOptions("sphereBaseSize", value);
                        } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "sphereScaleUnit", target: this._skeletonViewerDisplayOptions, propertyName: "sphereScaleUnit", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onChange: (value) => {
                            this.changeDisplayOptions("sphereScaleUnit", value);
                        } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "sphereFactor", target: this._skeletonViewerDisplayOptions, propertyName: "sphereFactor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onChange: (value) => {
                            this.changeDisplayOptions("sphereFactor", value);
                        } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "midStep", target: this._skeletonViewerDisplayOptions, propertyName: "midStep", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onChange: (value) => {
                            this.changeDisplayOptions("midStep", value);
                        } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__.FloatLineComponent, { lockObject: this.props.lockObject, label: "midStepFactor", target: this._skeletonViewerDisplayOptions, propertyName: "midStepFactor", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onChange: (value) => {
                            this.changeDisplayOptions("midStepFactor", value);
                        } })] }));
        }
        else {
            displayOptions = null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: skeleton, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "ID", value: skeleton.id }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Bone count", value: skeleton.bones.length.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Use texture to store matrices", target: skeleton, propertyName: "useTextureToStoreBoneMatrices", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__.ButtonLineComponent, { label: "Return to rest", onClick: () => skeleton.returnToRest() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "DEBUG", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Enabled", isSelected: () => this._skeletonViewersEnabled, onSelect: () => this.switchSkeletonViewers() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_8__.OptionsLine, { label: "displayMode", options: debugModeOptions, target: this._skeletonViewerDisplayOptions, propertyName: "displayMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: () => this.changeDisplayMode() }), displayOptions] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__.AnimationGridComponent, { globalState: this.props.globalState, animatable: skeleton, scene: skeleton.getScene(), lockObject: this.props.lockObject })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/transformNodePropertyGridComponent.js":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/meshes/transformNodePropertyGridComponent.js ***!
  \*************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2319448__) => {

"use strict";
__nested_webpack_require_2319448__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2319448__.d(__nested_webpack_exports__, {
/* harmony export */   TransformNodePropertyGridComponent: () => (/* binding */ TransformNodePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2319448__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2319448__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2319448__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2319448__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2319448__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2319448__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var _lines_quaternionLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2319448__(/*! ../../../lines/quaternionLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/quaternionLineComponent.js");
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2319448__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2319448__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2319448__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2319448__(/*! ../animations/animationPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js");
/* harmony import */ var _commonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2319448__(/*! ../commonPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/commonPropertyGridComponent.js");
/* harmony import */ var _variantsPropertyGridComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_2319448__(/*! ../variantsPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/variantsPropertyGridComponent.js");
/* harmony import */ var _parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_2319448__(/*! ../parentPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/parentPropertyGridComponent.js");














class TransformNodePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const transformNode = this.props.transformNode;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: transformNode, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "ID", value: transformNode.id }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: transformNode, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Unique ID", value: transformNode.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Class", value: transformNode.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "IsEnabled", isSelected: () => transformNode.isEnabled(), onSelect: (value) => transformNode.setEnabled(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_parentPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__.ParentPropertyGridComponent, { globalState: this.props.globalState, node: transformNode, lockObject: this.props.lockObject }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_8__.ButtonLineComponent, { label: "Dispose", onClick: () => {
                                transformNode.dispose();
                                this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonPropertyGridComponent__WEBPACK_IMPORTED_MODULE_11__.CommonPropertyGridComponent, { host: transformNode, lockObject: this.props.lockObject, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_variantsPropertyGridComponent__WEBPACK_IMPORTED_MODULE_12__.VariantsPropertyGridComponent, { host: transformNode, lockObject: this.props.lockObject, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "TRANSFORMATIONS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Position", target: transformNode, propertyName: "position", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), !transformNode.rotationQuaternion && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Rotation", useEuler: this.props.globalState.onlyUseEulers, target: transformNode, propertyName: "rotation", step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })), transformNode.rotationQuaternion && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_quaternionLineComponent__WEBPACK_IMPORTED_MODULE_6__.QuaternionLineComponent, { lockObject: this.props.lockObject, label: "Rotation", useEuler: this.props.globalState.onlyUseEulers, target: transformNode, propertyName: "rotationQuaternion", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Scaling", target: transformNode, propertyName: "scaling", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_10__.AnimationGridComponent, { globalState: this.props.globalState, animatable: transformNode, scene: transformNode.getScene(), lockObject: this.props.lockObject })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGridComponent.js":
/*!**********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGridComponent.js ***!
  \**********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2328927__) => {

"use strict";
__nested_webpack_require_2328927__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2328927__.d(__nested_webpack_exports__, {
/* harmony export */   MetadataGridComponent: () => (/* binding */ MetadataGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2328927__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2328927__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2328927__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2328927__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2328927__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2328927__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2328927__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_imgs_copy_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2328927__(/*! shared-ui-components/imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");
/* harmony import */ var _metadataPropertyGrid_scss__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2328927__(/*! ./metadataPropertyGrid.scss */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGrid.scss");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2328927__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__nested_webpack_require_2328927__.n(core_Misc_logger__WEBPACK_IMPORTED_MODULE_8__);










var MetadataTypes;
(function (MetadataTypes) {
    MetadataTypes["UNDEFINED"] = "undefined";
    MetadataTypes["NULL"] = "null";
    MetadataTypes["STRING"] = "string";
    MetadataTypes["OBJECT"] = "Object";
    MetadataTypes["JSON"] = "JSON";
})(MetadataTypes || (MetadataTypes = {}));
/** Metadata Grid Component */
class MetadataGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    /**
     * @param props - component props
     */
    constructor(props) {
        super(props);
        this.state = {
            selectedEntityMetadata: "",
            dirty: false,
            prettyJson: false,
            preventObjCorruption: true,
            metadataPropType: MetadataTypes.UNDEFINED,
            statusMessage: "ready to pick",
            isValidJson: false,
        };
        this._textAreaHost = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this.refreshSelected = this.refreshSelected.bind(this);
        this.populateGltfExtras = this.populateGltfExtras.bind(this);
    }
    /** @ignorenaming */
    componentDidMount() {
        if (this.props.globalState) {
            this.refreshSelected();
        }
    }
    /**
     * @param prevProps - previous component props
     */
    componentDidUpdate(prevProps) {
        if (this.props.entity) {
            if (!prevProps.entity || prevProps.entity.id !== this.props.entity.id) {
                this.refreshSelected();
            }
        }
    }
    /** on entity refresh */
    refreshSelected() {
        if (this.props.entity) {
            const validJson = this.parsableJson(this.props.entity.metadata);
            const metadataPropType = this.getEntityType(this.props.entity);
            this.setState({
                statusMessage: "", // loaded entity
                selectedEntityMetadata: this.parseMetaObject(validJson, this.props.entity.metadata),
                metadataPropType: metadataPropType,
                isValidJson: validJson,
            });
            this.setTextAreaDisabled(this.state.preventObjCorruption && metadataPropType === MetadataTypes.OBJECT);
        }
        else {
            this.setState({
                statusMessage: "could not find entity, please pick again",
                selectedEntityMetadata: "",
                metadataPropType: MetadataTypes.UNDEFINED,
                isValidJson: false,
            });
            this.setTextAreaDisabled(true);
        }
    }
    /**
     * @param disabled - is disabled
     */
    setTextAreaDisabled(disabled) {
        try {
            if (this._textAreaHost.current) {
                const textAreaElement = this._textAreaHost.current?.firstChild?.firstChild;
                textAreaElement.disabled = disabled;
            }
        }
        catch (error) {
            core_Misc_logger__WEBPACK_IMPORTED_MODULE_8__.Logger.Error(error);
        }
    }
    /**
     * @returns class name
     */
    getClassName() {
        switch (this.state.metadataPropType) {
            case MetadataTypes.STRING:
                return "meta-string";
            case MetadataTypes.JSON:
                return "meta-json";
            case MetadataTypes.OBJECT:
                return this.state.preventObjCorruption ? "meta-object-protect" : "meta-object";
            default:
                return "";
        }
    }
    /**
     * Determines the Metadata type
     * @param entity Picked entity
     * @returns MetadataTypes
     */
    getEntityType(entity) {
        if (Object.prototype.hasOwnProperty.call(entity, "metadata")) {
            const meta = entity.metadata;
            if (this.isString(meta))
                return MetadataTypes.STRING;
            if (meta === null)
                return MetadataTypes.NULL;
            if (!this.objectCanSafelyStringify(meta))
                return MetadataTypes.OBJECT;
            return MetadataTypes.JSON;
        }
        return MetadataTypes.UNDEFINED;
    }
    /**
     * @param input - any input
     * @returns is string
     */
    isString(input) {
        return typeof input === "string" || input instanceof String;
    }
    /**
     * @param object - any object
     * @returns is parsable
     */
    parsableJson(object) {
        if (!object)
            return false;
        try {
            return !!JSON.parse(JSON.stringify(object));
        }
        catch (error) {
            return false;
        }
    }
    /**
     * @param string - any string
     * @returns parsable string
     */
    parsableString(string) {
        try {
            this.setState({ statusMessage: null });
            return JSON.parse(string);
        }
        catch (error) {
            this.setState({ statusMessage: "invalid JSON: " + error.message });
            return null;
        }
    }
    /**
     * @param validJson - a valid json
     * @param metadata - any metadata
     * @returns parsed metadata
     */
    parseMetaObject(validJson, metadata) {
        if (validJson)
            return JSON.stringify(metadata, undefined, this.state.prettyJson ? 2 : undefined);
        if (this.isString(metadata))
            return metadata;
        return String(metadata);
    }
    /**
     * Recurse through an object to check for any Functions, returns False if found at least one
     * @param o Any Object, String or number
     * @returns Boolean
     */
    objectCanSafelyStringify(o) {
        if (typeof o === "function")
            return false;
        if (o === null || o === true || o === false || typeof o === "number" || this.isString(o))
            return true;
        if (typeof o === "object") {
            if (Object.values(o).length === 0)
                return true;
            return Object.values(o).every((value) => this.objectCanSafelyStringify(value));
        }
        if (Array.isArray(o)) {
            return o.every((value) => this.objectCanSafelyStringify(value));
        }
        return false;
    }
    /* TODO: Convert testObjectCanSafelyStringify() to Jest unit tests
    testObjectCanSafelyStringify() {
        const scene = this.props.entity._scene;
        console.log("/// test Truthy and Falsey ///");
        console.log("expect true", this.objectCanSafelyStringify(true));
        console.log("expect true", this.objectCanSafelyStringify(false));
        console.log("expect true", this.objectCanSafelyStringify(null as any));
        console.log("expect false", this.objectCanSafelyStringify(undefined as any));

        console.log("/// test Strings");
        console.log("expect true", this.objectCanSafelyStringify(""));
        console.log("expect true", this.objectCanSafelyStringify("hi"));
        console.log("expect true", this.objectCanSafelyStringify(String("hello")));

        console.log("/// test Number");
        console.log("expect true", this.objectCanSafelyStringify(2));
        console.log("expect true", this.objectCanSafelyStringify(2.456));
        console.log("expect true", this.objectCanSafelyStringify(Number(9)));

        console.log("/// test Array");
        console.log("expect true", this.objectCanSafelyStringify(String([])));
        console.log("expect true", this.objectCanSafelyStringify(String(["aaa"])));

        console.log("/// test Objects");
        console.log("expect true", this.objectCanSafelyStringify({}));
        console.log("expect true", this.objectCanSafelyStringify({ foo: "bar" }));
        console.log("expect false", this.objectCanSafelyStringify({ foo: "bar", funky: () => "this is funky!" }));
        console.log("expect true", this.objectCanSafelyStringify({ a: "babylon", b: [{ c: ["js", { d: "rules", e: 7 }] }] }));

        console.log("/// test Function");
        console.log(
            "expect false",
            this.objectCanSafelyStringify(() => {})
        );

        console.log("/// test Mesh");
        const mesh = new Mesh("a test mesh", scene);
        console.log("expect false", this.objectCanSafelyStringify(mesh));
        mesh.dispose();
        console.log("/// end tests ///");
    }
    */
    copyToClipboard() {
        try {
            const textAreaElement = this._textAreaHost.current?.firstChild?.firstChild;
            textAreaElement.select();
            textAreaElement.setSelectionRange(0, 99999); // For mobile devices
            navigator.clipboard.writeText(textAreaElement.value);
        }
        catch (error) {
            window.alert("Could not copy to clipboard, see log.");
            core_Misc_logger__WEBPACK_IMPORTED_MODULE_8__.Logger.Error(error);
        }
    }
    /** Safely checks if valid JSON then appends necessary props without overwriting existing */
    populateGltfExtras() {
        if (this.state.isValidJson) {
            try {
                const parsedJson = this.parsableString(this.state.selectedEntityMetadata);
                if (parsedJson) {
                    if (Object.prototype.hasOwnProperty.call(parsedJson, "gltf")) {
                        if (Object.prototype.hasOwnProperty.call(parsedJson.gltf, "extras")) {
                            this.setState({
                                statusMessage: "metadata.gltf.extras property already exists",
                            });
                        }
                        else {
                            parsedJson.gltf.extras = {};
                            this.setState({
                                dirty: true,
                                prettyJson: false,
                                selectedEntityMetadata: this.parseMetaObject(this.state.isValidJson, parsedJson),
                                statusMessage: "metadata.gltf.extras property inserted, don't forget to Update!",
                            });
                        }
                    }
                    else {
                        parsedJson.gltf = {
                            extras: {},
                        };
                        this.setState({
                            dirty: true,
                            prettyJson: false,
                            selectedEntityMetadata: this.parseMetaObject(this.state.isValidJson, parsedJson),
                            statusMessage: "metadata.gltf property inserted, don't forget to Update!",
                        });
                    }
                }
            }
            catch (error) {
                this.setState({
                    statusMessage: error.message,
                });
            }
        }
    }
    /** render
     * @returns the component
     */
    render() {
        const protectObj = this.state.preventObjCorruption && this.state.metadataPropType === MetadataTypes.OBJECT;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "METADATA", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextLineComponent, { label: "Property type", value: this.state.metadataPropType }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Prevent Object corruption", disabled: false, isSelected: () => this.state.preventObjCorruption, onSelect: (value) => {
                        this.setState({ preventObjCorruption: value });
                        this.setTextAreaDisabled(value && this.state.metadataPropType === MetadataTypes.OBJECT);
                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Pretty JSON", disabled: false, isSelected: () => this.state.prettyJson, onSelect: (value) => {
                        this.setState({ prettyJson: value });
                        // Update textArea
                        if (this.props.entity && this.state.metadataPropType !== MetadataTypes.NULL && this.state.metadataPropType !== MetadataTypes.UNDEFINED) {
                            const parsable = this.parsableString(this.state.selectedEntityMetadata);
                            if (parsable && !this.isString(parsable)) {
                                this.setState({
                                    dirty: true,
                                    selectedEntityMetadata: JSON.stringify(parsable, undefined, value ? 2 : undefined),
                                });
                            }
                        }
                    } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: this._textAreaHost, id: "metadata-container", className: this.getClassName(), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { multilines: true, value: this.state.selectedEntityMetadata, onChange: (value) => {
                            if (value === this.state.selectedEntityMetadata)
                                return;
                            this.setState({
                                dirty: true,
                                prettyJson: false,
                                selectedEntityMetadata: value,
                            });
                            if (value === "" || value === "undefined") {
                                this.setState({
                                    isValidJson: false,
                                    metadataPropType: MetadataTypes.UNDEFINED,
                                });
                                return;
                            }
                            if (value === "null") {
                                this.setState({
                                    isValidJson: false,
                                    metadataPropType: MetadataTypes.NULL,
                                });
                                return;
                            }
                            const parsedJson = !!this.parsableString(value);
                            this.setState({
                                isValidJson: parsedJson,
                                metadataPropType: parsedJson ? MetadataTypes.JSON : MetadataTypes.STRING,
                            });
                        } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy-root", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy-container", onClick: () => this.copyToClipboard(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: shared_ui_components_imgs_copy_svg__WEBPACK_IMPORTED_MODULE_9__, alt: "Copy" }) }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__.ButtonLineComponent, { label: "Populate glTF extras", onClick: this.populateGltfExtras, isDisabled: !this.state.isValidJson || protectObj }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__.ButtonLineComponent, { label: `Update metadata${this.props.entity ? " as " + this.state.metadataPropType : ""}`, onClick: () => {
                        if (this.props.entity) {
                            if (this.state.metadataPropType === MetadataTypes.NULL) {
                                this.props.entity.metadata = null;
                                this.setState({ statusMessage: "metadata set to null", dirty: false });
                                return;
                            }
                            if (this.state.metadataPropType === MetadataTypes.UNDEFINED) {
                                delete this.props.entity.metadata;
                                this.setState({ statusMessage: "metadata set to undefined", dirty: false });
                                return;
                            }
                            const parsedJson = this.parsableString(this.state.selectedEntityMetadata);
                            this.props.entity.metadata = parsedJson || this.state.selectedEntityMetadata;
                            this.setState({ statusMessage: "metadata updated", dirty: false });
                        }
                    }, isDisabled: !this.state.dirty || protectObj }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "type-status", children: this.state.statusMessage })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/parentPropertyGridComponent.js":
/*!***********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/parentPropertyGridComponent.js ***!
  \***********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2348721__) => {

"use strict";
__nested_webpack_require_2348721__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2348721__.d(__nested_webpack_exports__, {
/* harmony export */   ParentPropertyGridComponent: () => (/* binding */ ParentPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2348721__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2348721__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2348721__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2348721__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");




class ParentPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    _getNameForSortingAndDisplay(node) {
        return typeof node.name === "string" ? node.name : "no name";
    }
    render() {
        const node = this.props.node;
        const scene = node.getScene();
        const sortedNodes = scene
            .getNodes()
            .filter((n) => n !== node)
            .sort((a, b) => {
            return this._getNameForSortingAndDisplay(a).localeCompare(this._getNameForSortingAndDisplay(b));
        });
        const nodeOptions = sortedNodes.map((m, i) => {
            return {
                label: this._getNameForSortingAndDisplay(m),
                value: i,
            };
        });
        nodeOptions.splice(0, 0, { label: "None", value: -1 });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [node.parent && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Link to parent", value: node.parent.name, onLink: () => this.props.globalState.onSelectionChangedObservable.notifyObservers(node.parent) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_3__.OptionsLine, { label: "Parent", options: nodeOptions, target: node, propertyName: "parent", noDirectUpdate: true, onSelect: (value) => {
                        const nodeAsTransform = node;
                        if (typeof value !== "number" || value < 0) {
                            if (nodeAsTransform.setParent) {
                                nodeAsTransform.setParent(null);
                            }
                            else {
                                node.parent = null;
                            }
                        }
                        else {
                            const newParent = sortedNodes[value];
                            if (nodeAsTransform.setParent) {
                                nodeAsTransform.setParent(newParent);
                            }
                            else {
                                node.parent = newParent;
                            }
                        }
                        this.props.globalState.onSelectionRenamedObservable.notifyObservers();
                    }, extractValue: () => (node.parent ? sortedNodes.indexOf(node.parent) : -1), onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/boxEmitterGridComponent.js":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/boxEmitterGridComponent.js ***!
  \***********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2353052__) => {

"use strict";
__nested_webpack_require_2353052__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2353052__.d(__nested_webpack_exports__, {
/* harmony export */   BoxEmitterGridComponent: () => (/* binding */ BoxEmitterGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2353052__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2353052__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2353052__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");



class BoxEmitterGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const emitter = this.props.emitter;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Direction 1", target: emitter, propertyName: "direction1", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Direction 2", target: emitter, propertyName: "direction2", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Min emit box", target: emitter, propertyName: "minEmitBox", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Max emit box", target: emitter, propertyName: "maxEmitBox", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/colorGradientStepGridComponent.js":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/colorGradientStepGridComponent.js ***!
  \******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2356147__) => {

"use strict";
__nested_webpack_require_2356147__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2356147__.d(__nested_webpack_exports__, {
/* harmony export */   ColorGradientStepGridComponent: () => (/* binding */ ColorGradientStepGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2356147__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2356147__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2356147__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2356147__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2356147__(/*! core/Particles/particleSystem */ "core/Misc/observable");
/* harmony import */ var core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2356147__.n(core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var shared_ui_components_lines_colorPickerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2356147__(/*! shared-ui-components/lines/colorPickerComponent */ "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js");








class ColorGradientStepGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { gradient: props.gradient.gradient };
    }
    updateColor1(color) {
        if (this.props.gradient instanceof core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__.ColorGradient) {
            this.props.gradient.color1 = core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__.Color4.FromHexString(color);
        }
        else {
            this.props.gradient.color = core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__.Color3.FromHexString(color);
        }
        this.props.onUpdateGradient();
        this.forceUpdate();
    }
    updateColor2(color) {
        if (this.props.gradient instanceof core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__.ColorGradient) {
            this.props.gradient.color2 = core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__.Color4.FromHexString(color);
        }
        this.props.onUpdateGradient();
        this.forceUpdate();
    }
    updateGradient(gradient) {
        this.props.gradient.gradient = gradient;
        this.setState({ gradient: gradient });
        this.props.onUpdateGradient();
    }
    onPointerUp() {
        this.props.onCheckForReOrder();
    }
    lock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = true;
        }
    }
    unlock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    render() {
        const gradient = this.props.gradient;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "gradient-step", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "step", children: `#${this.props.lineIndex}` }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color1", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorPickerComponent__WEBPACK_IMPORTED_MODULE_4__.ColorPickerLine, { lockObject: this.props.lockObject, value: gradient instanceof core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__.Color3Gradient ? gradient.color : gradient.color1, onColorChanged: (color) => {
                            this.updateColor1(color);
                        } }) }), this.props.host instanceof core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__.ParticleSystem && gradient instanceof core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__.ColorGradient && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color2", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_colorPickerComponent__WEBPACK_IMPORTED_MODULE_4__.ColorPickerLine, { lockObject: this.props.lockObject, value: gradient.color2 ? gradient.color2 : new core_Misc_gradients__WEBPACK_IMPORTED_MODULE_3__.Color4(), onColorChanged: (color) => {
                            this.updateColor2(color);
                        } }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "step-value", children: gradient.gradient.toFixed(2) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "step-slider", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { className: "range", type: "range", step: 0.01, min: 0, max: 1.0, value: gradient.gradient, onPointerUp: () => this.onPointerUp(), onChange: (evt) => this.updateGradient(parseFloat(evt.target.value)) }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "gradient-delete hoverIcon", onClick: () => this.props.onDelete(), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faTrash }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/coneEmitterGridComponent.js":
/*!************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/coneEmitterGridComponent.js ***!
  \************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2362222__) => {

"use strict";
__nested_webpack_require_2362222__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2362222__.d(__nested_webpack_exports__, {
/* harmony export */   ConeEmitterGridComponent: () => (/* binding */ ConeEmitterGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2362222__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2362222__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2362222__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2362222__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");




class ConeEmitterGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const emitter = this.props.emitter;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Radius range", target: emitter, propertyName: "radiusRange", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Height range", target: emitter, propertyName: "heightRange", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Emit from spawn point only", target: emitter, propertyName: "emitFromSpawnPointOnly", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Direction randomizer", target: emitter, propertyName: "directionRandomizer", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/cylinderEmitterGridComponent.js":
/*!****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/cylinderEmitterGridComponent.js ***!
  \****************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2365679__) => {

"use strict";
__nested_webpack_require_2365679__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2365679__.d(__nested_webpack_exports__, {
/* harmony export */   CylinderEmitterGridComponent: () => (/* binding */ CylinderEmitterGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2365679__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2365679__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2365679__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2365679__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");




class CylinderEmitterGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const emitter = this.props.emitter;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Radius", target: emitter, propertyName: "radius", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Height", target: emitter, propertyName: "height", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Radius range", target: emitter, propertyName: "radiusRange", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Direction randomizer", target: emitter, propertyName: "directionRandomizer", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/factorGradientStepGridComponent.js":
/*!*******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/factorGradientStepGridComponent.js ***!
  \*******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2369095__) => {

"use strict";
__nested_webpack_require_2369095__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2369095__.d(__nested_webpack_exports__, {
/* harmony export */   FactorGradientStepGridComponent: () => (/* binding */ FactorGradientStepGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2369095__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2369095__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2369095__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2369095__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2369095__(/*! core/Particles/particleSystem */ "core/Misc/observable");
/* harmony import */ var core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2369095__.n(core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_3__);





class FactorGradientStepGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { gradient: props.gradient.gradient, factor1: this.props.gradient.factor1.toString(), factor2: this.props.gradient.factor2?.toString() };
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (nextProps.gradient !== this.props.gradient) {
            nextState.gradient = nextProps.gradient.gradient;
            nextState.factor1 = nextProps.gradient.factor1.toString();
            nextState.factor2 = nextProps.gradient.factor2?.toString();
        }
        return true;
    }
    updateFactor1(valueString) {
        if (/[^0-9.-]/g.test(valueString)) {
            return;
        }
        const valueAsNumber = parseFloat(valueString);
        this.setState({ factor1: valueString });
        if (isNaN(valueAsNumber)) {
            return;
        }
        this.props.gradient.factor1 = valueAsNumber;
        this.props.onUpdateGradient();
        this.forceUpdate();
    }
    updateFactor2(valueString) {
        if (/[^0-9.-]/g.test(valueString)) {
            return;
        }
        const valueAsNumber = parseFloat(valueString);
        this.setState({ factor2: valueString });
        if (isNaN(valueAsNumber)) {
            return;
        }
        this.props.gradient.factor2 = valueAsNumber;
        this.props.onUpdateGradient();
        this.forceUpdate();
    }
    updateGradient(gradient) {
        this.props.gradient.gradient = gradient;
        this.setState({ gradient: gradient });
        this.props.onUpdateGradient();
    }
    onPointerUp() {
        this.props.onCheckForReOrder();
    }
    lock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = true;
        }
    }
    unlock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    render() {
        const gradient = this.props.gradient;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "gradient-step", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "step", children: `#${this.props.lineIndex}` }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "factor1", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", step: "0.01", className: "numeric-input", value: this.state.factor1, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (evt) => this.updateFactor1(evt.target.value) }) }), this.props.host instanceof core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_3__.ParticleSystem && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "factor2", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", step: "0.01", className: "numeric-input" + (this.state.factor1 === this.state.factor2 || gradient.factor2 === undefined ? " grayed" : ""), value: this.state.factor2, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (evt) => this.updateFactor2(evt.target.value) }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "step-value", children: gradient.gradient.toFixed(2) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "step-slider", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { className: "range", type: "range", step: 0.01, min: 0, max: 1.0, value: gradient.gradient, onPointerUp: () => this.onPointerUp(), onChange: (evt) => this.updateGradient(parseFloat(evt.target.value)) }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "gradient-delete hoverIcon", onClick: () => this.props.onDelete(), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faTrash }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/hemisphericEmitterGridComponent.js":
/*!*******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/hemisphericEmitterGridComponent.js ***!
  \*******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2375146__) => {

"use strict";
__nested_webpack_require_2375146__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2375146__.d(__nested_webpack_exports__, {
/* harmony export */   HemisphericEmitterGridComponent: () => (/* binding */ HemisphericEmitterGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2375146__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2375146__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2375146__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2375146__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");




class HemisphericEmitterGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const emitter = this.props.emitter;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_3__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Radius", target: emitter, propertyName: "radius", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Radius range", target: emitter, propertyName: "radiusRange", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Direction randomizer", target: emitter, propertyName: "directionRandomizer", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/meshEmitterGridComponent.js":
/*!************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/meshEmitterGridComponent.js ***!
  \************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2378226__) => {

"use strict";
__nested_webpack_require_2378226__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2378226__.d(__nested_webpack_exports__, {
/* harmony export */   MeshEmitterGridComponent: () => (/* binding */ MeshEmitterGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2378226__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2378226__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2378226__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2378226__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _lines_meshPickerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2378226__(/*! ../../../lines/meshPickerComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/meshPickerComponent.js");





class MeshEmitterGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const emitter = this.props.emitter;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_meshPickerComponent__WEBPACK_IMPORTED_MODULE_4__.MeshPickerComponent, { globalState: this.props.globalState, label: "Source", scene: this.props.scene, onPropertyChangedObservable: this.props.onPropertyChangedObservable, target: this.props.emitter, property: "mesh" }), !emitter.useMeshNormalsForDirection && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Direction 1", target: emitter, propertyName: "direction1", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), !emitter.useMeshNormalsForDirection && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Direction 2", target: emitter, propertyName: "direction2", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Use normals for direction", target: emitter, propertyName: "useMeshNormalsForDirection", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/particleSystemPropertyGridComponent.js":
/*!***********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/particleSystemPropertyGridComponent.js ***!
  \***********************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2381905__) => {

"use strict";
__nested_webpack_require_2381905__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2381905__.d(__nested_webpack_exports__, {
/* harmony export */   ParticleSystemPropertyGridComponent: () => (/* binding */ ParticleSystemPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2381905__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2381905__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2381905__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2381905__(/*! ../../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2381905__(/*! core/Materials/Textures/texture */ "core/Misc/observable");
/* harmony import */ var core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__nested_webpack_require_2381905__.n(core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _boxEmitterGridComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_2381905__(/*! ./boxEmitterGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/boxEmitterGridComponent.js");
/* harmony import */ var _coneEmitterGridComponent__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_2381905__(/*! ./coneEmitterGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/coneEmitterGridComponent.js");
/* harmony import */ var _cylinderEmitterGridComponent__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_2381905__(/*! ./cylinderEmitterGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/cylinderEmitterGridComponent.js");
/* harmony import */ var _hemisphericEmitterGridComponent__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_2381905__(/*! ./hemisphericEmitterGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/hemisphericEmitterGridComponent.js");
/* harmony import */ var _pointEmitterGridComponent__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_2381905__(/*! ./pointEmitterGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/pointEmitterGridComponent.js");
/* harmony import */ var _sphereEmitterGridComponent__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_2381905__(/*! ./sphereEmitterGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/sphereEmitterGridComponent.js");
/* harmony import */ var _meshEmitterGridComponent__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_2381905__(/*! ./meshEmitterGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/meshEmitterGridComponent.js");
/* harmony import */ var _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_2381905__(/*! ./valueGradientGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/valueGradientGridComponent.js");
/* harmony import */ var shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_21__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/fileButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_22__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_23__ = __nested_webpack_require_2381905__(/*! shared-ui-components/lines/color4LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js");






































class ParticleSystemPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._snippetUrl = core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Constants.SnippetUrl;
    }
    renderEmitter() {
        const system = this.props.system;
        switch (system.particleEmitterType?.getClassName()) {
            case "BoxParticleEmitter":
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_boxEmitterGridComponent__WEBPACK_IMPORTED_MODULE_13__.BoxEmitterGridComponent, { lockObject: this.props.lockObject, globalState: this.props.globalState, emitter: system.particleEmitterType, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            case "ConeParticleEmitter":
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_coneEmitterGridComponent__WEBPACK_IMPORTED_MODULE_14__.ConeEmitterGridComponent, { lockObject: this.props.lockObject, globalState: this.props.globalState, emitter: system.particleEmitterType, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            case "CylinderParticleEmitter":
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_cylinderEmitterGridComponent__WEBPACK_IMPORTED_MODULE_15__.CylinderEmitterGridComponent, { lockObject: this.props.lockObject, globalState: this.props.globalState, emitter: system.particleEmitterType, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            case "HemisphericParticleEmitter":
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_hemisphericEmitterGridComponent__WEBPACK_IMPORTED_MODULE_16__.HemisphericEmitterGridComponent, { lockObject: this.props.lockObject, globalState: this.props.globalState, emitter: system.particleEmitterType, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            case "MeshParticleEmitter":
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_meshEmitterGridComponent__WEBPACK_IMPORTED_MODULE_19__.MeshEmitterGridComponent, { lockObject: this.props.lockObject, scene: system.getScene(), globalState: this.props.globalState, emitter: system.particleEmitterType, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            case "PointParticleEmitter":
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_pointEmitterGridComponent__WEBPACK_IMPORTED_MODULE_17__.PointEmitterGridComponent, { lockObject: this.props.lockObject, globalState: this.props.globalState, emitter: system.particleEmitterType, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
            case "SphereParticleEmitter":
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_sphereEmitterGridComponent__WEBPACK_IMPORTED_MODULE_18__.SphereEmitterGridComponent, { lockObject: this.props.lockObject, globalState: this.props.globalState, emitter: system.particleEmitterType, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
        }
        return null;
    }
    raiseOnPropertyChanged(property, newValue, previousValue) {
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        const system = this.props.system;
        this.props.onPropertyChangedObservable.notifyObservers({
            object: system,
            property: property,
            value: newValue,
            initialValue: previousValue,
        });
    }
    renderControls() {
        const system = this.props.system;
        if (system instanceof core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.GPUParticleSystem) {
            const isStarted = system.isStarted() && !system.isStopped();
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: isStarted ? "Stop" : "Start", onClick: () => {
                    if (isStarted) {
                        system.stop();
                        system.reset();
                    }
                    else {
                        system.start();
                    }
                    this.forceUpdate();
                } }));
        }
        const isStarted = system.isStarted();
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [!system.isStopping() && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: isStarted ? "Stop" : "Start", onClick: () => {
                        if (isStarted) {
                            system.stop();
                        }
                        else {
                            system.start();
                        }
                        this.forceUpdate();
                    } })), system.isStopping() && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "System is stopping...", ignoreValue: true })] }));
    }
    saveToFile() {
        const system = this.props.system;
        const content = JSON.stringify(system.serialize(true));
        core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Tools.Download(new Blob([content]), "particleSystem.json");
    }
    loadFromFile(file) {
        const system = this.props.system;
        const scene = system.getScene();
        if (!scene) {
            return;
        }
        core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Tools.ReadFile(file, (data) => {
            const decoder = new TextDecoder("utf-8");
            const jsonObject = JSON.parse(decoder.decode(data));
            const isGpu = system instanceof core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.GPUParticleSystem;
            system.dispose();
            this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
            const newSystem = isGpu ? core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.GPUParticleSystem.Parse(jsonObject, scene, "") : core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem.Parse(jsonObject, scene, "");
            this.props.globalState.onSelectionChangedObservable.notifyObservers(newSystem);
        }, undefined, true);
    }
    loadFromSnippet() {
        const system = this.props.system;
        const scene = system.getScene();
        const isGpu = system instanceof core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.GPUParticleSystem;
        const snippedId = window.prompt("Please enter the snippet ID to use");
        if (!snippedId || !scene) {
            return;
        }
        system.dispose();
        this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
        core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleHelper.ParseFromSnippetAsync(snippedId, scene, isGpu)
            .then((newSystem) => {
            this.props.globalState.onSelectionChangedObservable.notifyObservers(newSystem);
        })
            .catch((err) => {
            alert("Unable to load your particle system: " + err);
        });
    }
    saveToSnippet() {
        const system = this.props.system;
        const content = JSON.stringify(system.serialize(true));
        const xmlHttp = new XMLHttpRequest();
        xmlHttp.onreadystatechange = () => {
            if (xmlHttp.readyState == 4) {
                if (xmlHttp.status == 200) {
                    const snippet = JSON.parse(xmlHttp.responseText);
                    const oldId = system.snippetId || "_BLANK";
                    system.snippetId = snippet.id;
                    if (snippet.version && snippet.version != "0") {
                        system.snippetId += "#" + snippet.version;
                    }
                    this.forceUpdate();
                    if (navigator.clipboard) {
                        navigator.clipboard.writeText(system.snippetId);
                    }
                    const windowAsAny = window;
                    if (windowAsAny.Playground && oldId) {
                        windowAsAny.Playground.onRequestCodeChangeObservable.notifyObservers({
                            regex: new RegExp(`ParticleHelper.ParseFromSnippetAsync\\("${oldId}`, "g"),
                            replace: `ParticleHelper.ParseFromSnippetAsync("${system.snippetId}`,
                        });
                    }
                    alert("Particle system saved with ID: " + system.snippetId + " (please note that the id was also saved to your clipboard)");
                }
                else {
                    alert("Unable to save your particle system");
                }
            }
        };
        xmlHttp.open("POST", this._snippetUrl + (system.snippetId ? "/" + system.snippetId : ""), true);
        xmlHttp.setRequestHeader("Content-Type", "application/json");
        const dataToSend = {
            payload: JSON.stringify({
                particleSystem: content,
            }),
            name: "",
            description: "",
            tags: "",
        };
        xmlHttp.send(JSON.stringify(dataToSend));
    }
    updateTexture(file) {
        const system = this.props.system;
        core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Tools.ReadFile(file, (data) => {
            const blob = new Blob([data], { type: "octet/stream" });
            const url = URL.createObjectURL(blob);
            system.particleTexture = new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Texture(url, system.getScene(), false, false);
            this.forceUpdate();
        }, undefined, true);
    }
    render() {
        const system = this.props.system;
        const blendModeOptions = [
            { label: "Add", value: core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem.BLENDMODE_ADD },
            { label: "Multiply", value: core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem.BLENDMODE_MULTIPLY },
            { label: "Multiply Add", value: core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem.BLENDMODE_MULTIPLYADD },
            { label: "OneOne", value: core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem.BLENDMODE_ONEONE },
            { label: "Standard", value: core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem.BLENDMODE_STANDARD },
        ];
        const particleEmitterTypeOptions = [
            { label: "Box", value: 0 },
            { label: "Cone", value: 1 },
            { label: "Cylinder", value: 2 },
            { label: "Hemispheric", value: 3 },
            { label: "Mesh", value: 4 },
            { label: "Point", value: 5 },
            { label: "Sphere", value: 6 },
        ];
        const meshEmitters = this.props.system.getScene().meshes.filter((m) => !!m.name);
        const emitterOptions = [
            { label: "None", value: -1 },
            { label: "Vector3", value: 0 },
        ];
        meshEmitters.sort((a, b) => a.name.localeCompare(b.name));
        emitterOptions.push(...meshEmitters.map((v, i) => {
            return { label: v.name, value: i + 1 };
        }));
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_4__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: system, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "ID", value: system.id }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_22__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: system, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Class", value: system.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Capacity", value: system.getCapacity().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Active count", value: system.getActiveCount().toString() }), system.particleTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextureLinkLineComponent, { label: "Texture", texture: system.particleTexture, onSelectionChangedObservable: this.props.onSelectionChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_21__.FileButtonLine, { label: "Load texture from file", onClick: (file) => this.updateTexture(file), accept: ".jpg, .png, .tga, .dds, .env, .exr" })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_8__.OptionsLine, { label: "Blend mode", options: blendModeOptions, target: system, propertyName: "blendMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_10__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "World offset", target: system, propertyName: "worldOffset", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_10__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Gravity", target: system, propertyName: "gravity", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_11__.CheckBoxLineComponent, { label: "Is billboard", target: system, propertyName: "isBillboardBased", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_11__.CheckBoxLineComponent, { label: "Is local", target: system, propertyName: "isLocal", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_11__.CheckBoxLineComponent, { label: "Force depth write", target: system, propertyName: "forceDepthWrite", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Update speed", target: system, propertyName: "updateSpeed", minimum: 0, maximum: 0.1, decimalCount: 3, step: 0.001, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "COMMANDS", selection: this.props.globalState, children: [this.renderControls(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: "Dispose", onClick: () => {
                                this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
                                system.dispose();
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "FILE", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_21__.FileButtonLine, { label: "Load", onClick: (file) => this.loadFromFile(file), accept: ".json" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: "Save", onClick: () => this.saveToFile() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SNIPPET", selection: this.props.globalState, children: [system.snippetId && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Snippet ID", value: system.snippetId }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: "Load from snippet server", onClick: () => this.loadFromSnippet() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: "Save to snippet server", onClick: () => this.saveToSnippet() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "EMITTER", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_8__.OptionsLine, { label: "Emitter", options: emitterOptions, target: system, propertyName: "emitter", noDirectUpdate: true, onSelect: (value) => {
                                const valueAsNumber = value;
                                switch (valueAsNumber) {
                                    case -1:
                                        this.raiseOnPropertyChanged("emitter", null, system.emitter);
                                        system.emitter = null;
                                        break;
                                    case 0:
                                        this.raiseOnPropertyChanged("emitter", core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Vector3.Zero(), system.emitter);
                                        system.emitter = core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Vector3.Zero();
                                        break;
                                    default:
                                        this.raiseOnPropertyChanged("emitter", meshEmitters[valueAsNumber - 1], system.emitter);
                                        system.emitter = meshEmitters[valueAsNumber - 1];
                                }
                                this.forceUpdate();
                            }, extractValue: () => {
                                if (!system.emitter) {
                                    return -1;
                                }
                                if (system.emitter.x !== undefined) {
                                    return 0;
                                }
                                const meshIndex = meshEmitters.indexOf(system.emitter);
                                if (meshIndex > -1) {
                                    return meshIndex + 1;
                                }
                                return -1;
                            } }), system.emitter && system.emitter.x === undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Link to emitter", value: system.emitter.name, onLink: () => this.props.globalState.onSelectionChangedObservable.notifyObservers(system.emitter) })), system.emitter && system.emitter.x !== undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_10__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Position", target: system, propertyName: "emitter", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_8__.OptionsLine, { label: "Type", options: particleEmitterTypeOptions, target: system, propertyName: "particleEmitterType", noDirectUpdate: true, onSelect: (value) => {
                                const valueAsNumber = value;
                                const currentType = system.particleEmitterType;
                                switch (valueAsNumber) {
                                    case 0:
                                        system.particleEmitterType = new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.BoxParticleEmitter();
                                        break;
                                    case 1:
                                        system.particleEmitterType = new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ConeParticleEmitter();
                                        break;
                                    case 2:
                                        system.particleEmitterType = new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.CylinderParticleEmitter();
                                        break;
                                    case 3:
                                        system.particleEmitterType = new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.HemisphericParticleEmitter();
                                        break;
                                    case 4:
                                        system.particleEmitterType = new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.MeshParticleEmitter();
                                        break;
                                    case 5:
                                        system.particleEmitterType = new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.PointParticleEmitter();
                                        break;
                                    case 6:
                                        system.particleEmitterType = new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.SphereParticleEmitter();
                                        break;
                                }
                                this.raiseOnPropertyChanged("particleEmitterType", system.particleEmitterType, currentType);
                                this.forceUpdate();
                            }, extractValue: () => {
                                switch (system.particleEmitterType?.getClassName()) {
                                    case "BoxParticleEmitter":
                                        return 0;
                                    case "ConeParticleEmitter":
                                        return 1;
                                    case "CylinderParticleEmitter":
                                        return 2;
                                    case "HemisphericParticleEmitter":
                                        return 3;
                                    case "MeshParticleEmitter":
                                        return 4;
                                    case "PointParticleEmitter":
                                        return 5;
                                    case "SphereParticleEmitter":
                                        return 6;
                                }
                                return 0;
                            } }), this.renderEmitter()] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "EMISSION", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Rate", target: system, propertyName: "emitRate", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), system instanceof core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getEmitRateGradients(), label: "Velocity gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-speed-over-lifetime", onCreateRequired: () => {
                                system.addEmitRateGradient(0, 50, 50);
                            }, mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, host: system, codeRecorderPropertyName: "getEmitRateGradients()", lockObject: this.props.lockObject })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Min emit power", target: system, propertyName: "minEmitPower", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Max emit power", target: system, propertyName: "maxEmitPower", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getVelocityGradients(), label: "Velocity gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-speed-over-lifetime", onCreateRequired: () => {
                                system.addVelocityGradient(0, 0.1, 0.1);
                            }, mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, host: system, codeRecorderPropertyName: "getVelocityGradients()", lockObject: this.props.lockObject }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getLimitVelocityGradients(), label: "Limit velocity gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#limit-speed-over-lifetime", onCreateRequired: () => {
                                system.addLimitVelocityGradient(0, 0.1, 0.1);
                            }, mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, host: system, codeRecorderPropertyName: "getLimitVelocityGradients()", lockObject: this.props.lockObject }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getDragGradients(), label: "Drag gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-drag-over-lifetime", onCreateRequired: () => {
                                system.addDragGradient(0, 0.1, 0.1);
                            }, host: system, codeRecorderPropertyName: "getDragGradients()", mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, lockObject: this.props.lockObject })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SIZE", closed: true, selection: this.props.globalState, children: [(!system.getSizeGradients() || system.getSizeGradients()?.length === 0) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Min size", target: system, propertyName: "minSize", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Max size", target: system, propertyName: "maxSize", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Min scale X", target: system, propertyName: "minScaleX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Max scale X", target: system, propertyName: "maxScaleX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Min scale Y", target: system, propertyName: "minScaleY", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Max scale Y", target: system, propertyName: "maxScaleY", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), system instanceof core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getStartSizeGradients(), label: "Start size gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-size-over-lifetime", onCreateRequired: () => {
                                system.addStartSizeGradient(0, 1, 1);
                            }, host: system, codeRecorderPropertyName: "getStartSizeGradients()", mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, lockObject: this.props.lockObject })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getSizeGradients(), label: "Size gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-size-over-lifetime", onCreateRequired: () => {
                                system.addSizeGradient(0, 1, 1);
                            }, host: system, codeRecorderPropertyName: "getSizeGradients()", mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, lockObject: this.props.lockObject })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "LIFETIME", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Min lifetime", target: system, propertyName: "minLifeTime", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Max lifetime", target: system, propertyName: "maxLifeTime", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Target stop duration", target: system, propertyName: "targetStopDuration", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), system instanceof core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getLifeTimeGradients(), label: "Lifetime gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-lifetime-over-duration", onCreateRequired: () => {
                                system.addLifeTimeGradient(0, 1, 1);
                            }, host: system, codeRecorderPropertyName: "getLifeTimeGradients()", mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, lockObject: this.props.lockObject }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "COLORS", closed: true, selection: this.props.globalState, children: [(!system.getColorGradients() || system.getColorGradients()?.length === 0) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_23__.Color4LineComponent, { lockObject: this.props.lockObject, label: "Color 1", target: system, propertyName: "color1", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_23__.Color4LineComponent, { lockObject: this.props.lockObject, label: "Color 2", target: system, propertyName: "color2", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_23__.Color4LineComponent, { lockObject: this.props.lockObject, label: "Color dead", target: system, propertyName: "colorDead", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getColorGradients(), label: "Color gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-color-over-lifetime", onCreateRequired: () => {
                                system.addColorGradient(0, new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Color4(0, 0, 0, 1), new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Color4(0, 0, 0, 1));
                                system.addColorGradient(1, new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Color4(1, 1, 1, 1), new core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Color4(1, 1, 1, 1));
                            }, host: system, codeRecorderPropertyName: "getColorGradients()", mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Color4, lockObject: this.props.lockObject }), system instanceof core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.ParticleSystem && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_11__.CheckBoxLineComponent, { label: "Enable ramp gradients", target: system, propertyName: "useRampGradients" }), system.useRampGradients && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getRampGradients(), label: "Ramp gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends#ramp-gradients", onCreateRequired: () => {
                                                system.addRampGradient(0, core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Color3.White());
                                                system.addRampGradient(1, core_Particles_particleSystem__WEBPACK_IMPORTED_MODULE_9__.Color3.Black());
                                            }, mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Color3, host: system, codeRecorderPropertyName: "getRampGradients()", lockObject: this.props.lockObject }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getColorRemapGradients(), label: "Color remap gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends#ramp-gradients", onCreateRequired: () => {
                                                system.addColorRemapGradient(0, 1, 1);
                                            }, host: system, codeRecorderPropertyName: "getColorRemapGradients()", mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, lockObject: this.props.lockObject }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getAlphaRemapGradients(), label: "Alpha remap gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends#ramp-gradients", onCreateRequired: () => {
                                                system.addAlphaRemapGradient(0, 1, 1);
                                            }, host: system, codeRecorderPropertyName: "getAlphaRemapGradients()", mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, lockObject: this.props.lockObject })] }))] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "ROTATION", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Min angular speed", target: system, propertyName: "minAngularSpeed", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Max angular speed", target: system, propertyName: "maxAngularSpeed", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Min initial rotation", target: system, propertyName: "minInitialRotation", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Max initial rotation", target: system, propertyName: "maxInitialRotation", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.ValueGradientGridComponent, { globalState: this.props.globalState, gradients: system.getAngularSpeedGradients(), label: "Angular speed gradients", docLink: "https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-rotation-speed-over-lifetime", onCreateRequired: () => {
                                system.addAngularSpeedGradient(0, 0.1, 0.1);
                            }, host: system, codeRecorderPropertyName: "getAngularSpeedGradients()", mode: _valueGradientGridComponent__WEBPACK_IMPORTED_MODULE_20__.GradientGridMode.Factor, lockObject: this.props.lockObject })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SPRITESHEET", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_11__.CheckBoxLineComponent, { label: "Animation sheet enabled", target: system, propertyName: "isAnimationSheetEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "First sprite index", isInteger: true, target: system, propertyName: "startSpriteCellID", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Last sprite index", isInteger: true, target: system, propertyName: "endSpriteCellID", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_11__.CheckBoxLineComponent, { label: "Animation Loop", target: system, propertyName: "spriteCellLoop", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_11__.CheckBoxLineComponent, { label: "Random start cell index", target: system, propertyName: "spriteRandomStartCell", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Cell width", isInteger: true, target: system, propertyName: "spriteCellWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Cell height", isInteger: true, target: system, propertyName: "spriteCellHeight", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Cell change speed", target: system, propertyName: "spriteCellChangeSpeed", minimum: 0, maximum: 10, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/pointEmitterGridComponent.js":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/pointEmitterGridComponent.js ***!
  \*************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2434713__) => {

"use strict";
__nested_webpack_require_2434713__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2434713__.d(__nested_webpack_exports__, {
/* harmony export */   PointEmitterGridComponent: () => (/* binding */ PointEmitterGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2434713__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2434713__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2434713__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");



class PointEmitterGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const emitter = this.props.emitter;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Direction 1", target: emitter, propertyName: "direction1", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_2__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Direction 2", target: emitter, propertyName: "direction2", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/sphereEmitterGridComponent.js":
/*!**************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/sphereEmitterGridComponent.js ***!
  \**************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2437136__) => {

"use strict";
__nested_webpack_require_2437136__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2437136__.d(__nested_webpack_exports__, {
/* harmony export */   SphereEmitterGridComponent: () => (/* binding */ SphereEmitterGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2437136__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2437136__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2437136__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2437136__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");




class SphereEmitterGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const emitter = this.props.emitter;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_2__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Radius", target: emitter, propertyName: "radius", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Radius range", target: emitter, propertyName: "radiusRange", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Direction randomizer", target: emitter, propertyName: "directionRandomizer", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/valueGradientGridComponent.js":
/*!**************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/valueGradientGridComponent.js ***!
  \**************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2440209__) => {

"use strict";
__nested_webpack_require_2440209__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2440209__.d(__nested_webpack_exports__, {
/* harmony export */   GradientGridMode: () => (/* binding */ GradientGridMode),
/* harmony export */   ValueGradientGridComponent: () => (/* binding */ ValueGradientGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2440209__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2440209__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_gradients__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2440209__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Misc_gradients__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2440209__.n(core_Misc_gradients__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2440209__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var _factorGradientStepGridComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2440209__(/*! ./factorGradientStepGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/factorGradientStepGridComponent.js");
/* harmony import */ var _colorGradientStepGridComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2440209__(/*! ./colorGradientStepGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/particleSystems/colorGradientStepGridComponent.js");
/* harmony import */ var shared_ui_components_lines_linkButtonComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2440209__(/*! shared-ui-components/lines/linkButtonComponent */ "../../../dev/sharedUiComponents/dist/lines/linkButtonComponent.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2440209__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");









var GradientGridMode;
(function (GradientGridMode) {
    GradientGridMode[GradientGridMode["Factor"] = 0] = "Factor";
    GradientGridMode[GradientGridMode["Color3"] = 1] = "Color3";
    GradientGridMode[GradientGridMode["Color4"] = 2] = "Color4";
})(GradientGridMode || (GradientGridMode = {}));
class ValueGradientGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    deleteStep(step) {
        const gradients = this.props.gradients;
        const index = gradients.indexOf(step);
        if (index > -1) {
            gradients.splice(index, 1);
            this.updateAndSync();
        }
    }
    addNewStep() {
        const gradients = this.props.gradients;
        switch (this.props.mode) {
            case GradientGridMode.Factor: {
                const newStep = new core_Misc_gradients__WEBPACK_IMPORTED_MODULE_2__.FactorGradient(1, 1, 1);
                gradients.push(newStep);
                break;
            }
            case GradientGridMode.Color4: {
                const newStepColor = new core_Misc_gradients__WEBPACK_IMPORTED_MODULE_2__.ColorGradient(1, new core_Misc_gradients__WEBPACK_IMPORTED_MODULE_2__.Color4(1, 1, 1, 1), new core_Misc_gradients__WEBPACK_IMPORTED_MODULE_2__.Color4(1, 1, 1, 1));
                gradients.push(newStepColor);
                break;
            }
            case GradientGridMode.Color3: {
                const newStepColor3 = new core_Misc_gradients__WEBPACK_IMPORTED_MODULE_2__.Color3Gradient(1, core_Misc_gradients__WEBPACK_IMPORTED_MODULE_2__.Color3.White());
                gradients.push(newStepColor3);
                break;
            }
        }
        this.props.host.forceRefreshGradients();
        this.forceUpdate();
    }
    checkForReOrder() {
        const gradients = this.props.gradients;
        gradients.sort((a, b) => {
            if (a.gradient === b.gradient) {
                return 0;
            }
            if (a.gradient > b.gradient) {
                return 1;
            }
            return -1;
        });
        this.forceUpdate();
    }
    updateAndSync() {
        this.props.host.forceRefreshGradients();
        this.forceUpdate();
    }
    render() {
        const gradients = this.props.gradients;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [gradients && gradients.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "gradient-container", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_linkButtonComponent__WEBPACK_IMPORTED_MODULE_6__.LinkButtonComponent, { label: this.props.label, url: this.props.docLink, icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faTrash, onIconClick: () => {
                                gradients.length = 0;
                                this.updateAndSync();
                            }, buttonLabel: "Add new step", onClick: () => this.addNewStep() }), gradients.map((g, i) => {
                            const codeRecorderPropertyName = this.props.codeRecorderPropertyName + `[${i}]`;
                            switch (this.props.mode) {
                                case GradientGridMode.Factor:
                                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_factorGradientStepGridComponent__WEBPACK_IMPORTED_MODULE_4__.FactorGradientStepGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, onCheckForReOrder: () => this.checkForReOrder(), onUpdateGradient: () => this.updateAndSync(), host: this.props.host, codeRecorderPropertyName: codeRecorderPropertyName, lineIndex: i, gradient: g, onDelete: () => this.deleteStep(g) }, "step-" + i));
                                case GradientGridMode.Color4:
                                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorGradientStepGridComponent__WEBPACK_IMPORTED_MODULE_5__.ColorGradientStepGridComponent, { globalState: this.props.globalState, host: this.props.host, codeRecorderPropertyName: codeRecorderPropertyName, lockObject: this.props.lockObject, isColor3: false, onCheckForReOrder: () => this.checkForReOrder(), onUpdateGradient: () => this.updateAndSync(), lineIndex: i, gradient: g, onDelete: () => this.deleteStep(g) }, "step-" + i));
                                case GradientGridMode.Color3:
                                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorGradientStepGridComponent__WEBPACK_IMPORTED_MODULE_5__.ColorGradientStepGridComponent, { globalState: this.props.globalState, host: this.props.host, codeRecorderPropertyName: codeRecorderPropertyName, lockObject: this.props.lockObject, isColor3: true, onCheckForReOrder: () => this.checkForReOrder(), onUpdateGradient: () => this.updateAndSync(), lineIndex: i, gradient: g, onDelete: () => this.deleteStep(g) }, "step-" + i));
                            }
                        })] })), (!gradients || gradients.length === 0) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Use " + this.props.label, onClick: () => {
                        this.props.onCreateRequired();
                        this.forceUpdate();
                    } }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonPostProcessPropertyGridComponent.js":
/*!************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonPostProcessPropertyGridComponent.js ***!
  \************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2448531__) => {

"use strict";
__nested_webpack_require_2448531__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2448531__.d(__nested_webpack_exports__, {
/* harmony export */   CommonPostProcessPropertyGridComponent: () => (/* binding */ CommonPostProcessPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2448531__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2448531__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2448531__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2448531__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2448531__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2448531__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2448531__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2448531__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2448531__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2448531__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");










class CommonPostProcessPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const postProcess = this.props.postProcess;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_9__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: postProcess, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Class", value: postProcess.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_8__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: postProcess, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), postProcess.width && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Width", value: postProcess.width.toString() }), postProcess.height && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Height", value: postProcess.height.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "Auto clear", target: postProcess, propertyName: "autoClear", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), postProcess.clearColor && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Clear color", target: postProcess, propertyName: "clearColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "Pixel perfect", target: postProcess, propertyName: "enablePixelPerfectMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "Fullscreen viewport", target: postProcess, propertyName: "forceFullscreenViewport", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Samples", target: postProcess, propertyName: "samples", minimum: 1, maximum: 8, step: 1, decimalCount: 0, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_7__.ButtonLineComponent, { label: "Dispose", onClick: () => {
                                postProcess.dispose();
                                this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
                            } })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonRenderingPipelinePropertyGridComponent.js":
/*!******************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonRenderingPipelinePropertyGridComponent.js ***!
  \******************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2455686__) => {

"use strict";
__nested_webpack_require_2455686__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2455686__.d(__nested_webpack_exports__, {
/* harmony export */   CommonRenderingPipelinePropertyGridComponent: () => (/* binding */ CommonRenderingPipelinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2455686__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2455686__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2455686__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2455686__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2455686__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2455686__(/*! ../customPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.js");






class CommonRenderingPipelinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const renderPipeline = this.props.renderPipeline;
        const renderPipelineAsAny = renderPipeline;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_5__.CustomPropertyGridComponent, { globalState: this.props.globalState, target: renderPipeline, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Name", value: renderPipeline.name }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Class", value: renderPipeline.getClassName() }), renderPipelineAsAny.samples !== undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_4__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Samples", minimum: 1, maximum: 64, step: 1, decimalCount: 0, target: renderPipeline, propertyName: "samples", onPropertyChangedObservable: this.props.onPropertyChangedObservable }))] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/defaultRenderingPipelinePropertyGridComponent.js":
/*!*******************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/defaultRenderingPipelinePropertyGridComponent.js ***!
  \*******************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2459704__) => {

"use strict";
__nested_webpack_require_2459704__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2459704__.d(__nested_webpack_exports__, {
/* harmony export */   DefaultRenderingPipelinePropertyGridComponent: () => (/* binding */ DefaultRenderingPipelinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2459704__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2459704__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2459704__(/*! ./commonRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonRenderingPipelinePropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2459704__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2459704__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2459704__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2459704__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var core_Materials_imageProcessingConfiguration__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2459704__(/*! core/Materials/imageProcessingConfiguration */ "core/Misc/observable");
/* harmony import */ var core_Materials_imageProcessingConfiguration__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__nested_webpack_require_2459704__.n(core_Materials_imageProcessingConfiguration__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2459704__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2459704__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector2LineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2459704__(/*! shared-ui-components/lines/vector2LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js");











class DefaultRenderingPipelinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const renderPipeline = this.props.renderPipeline;
        const camera = renderPipeline.scene.activeCamera;
        const toneMappingOptions = [
            { label: "Standard", value: core_Materials_imageProcessingConfiguration__WEBPACK_IMPORTED_MODULE_7__.ImageProcessingConfiguration.TONEMAPPING_STANDARD },
            { label: "ACES", value: core_Materials_imageProcessingConfiguration__WEBPACK_IMPORTED_MODULE_7__.ImageProcessingConfiguration.TONEMAPPING_ACES },
            { label: "Khronos PBR Neutral", value: core_Materials_imageProcessingConfiguration__WEBPACK_IMPORTED_MODULE_7__.ImageProcessingConfiguration.TONEMAPPING_KHR_PBR_NEUTRAL },
        ];
        const vignetteModeOptions = [
            { label: "Multiply", value: core_Materials_imageProcessingConfiguration__WEBPACK_IMPORTED_MODULE_7__.ImageProcessingConfiguration.VIGNETTEMODE_MULTIPLY },
            { label: "Opaque", value: core_Materials_imageProcessingConfiguration__WEBPACK_IMPORTED_MODULE_7__.ImageProcessingConfiguration.VIGNETTEMODE_OPAQUE },
        ];
        const depthOfFieldBlurOptions = [
            { label: "Low", value: 0 /* DepthOfFieldEffectBlurLevel.Low */ },
            { label: "Medium", value: 1 /* DepthOfFieldEffectBlurLevel.Medium */ },
            { label: "High", value: 2 /* DepthOfFieldEffectBlurLevel.High */ },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonRenderingPipelinePropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, renderPipeline: renderPipeline, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "BLOOM", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, onValueChanged: () => this.forceUpdate(), propertyName: "bloomEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), renderPipeline.bloomEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Threshold", minimum: 0, maximum: 2.0, step: 0.01, target: renderPipeline, propertyName: "bloomThreshold", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Weight", minimum: 0, maximum: 1, step: 0.05, target: renderPipeline, propertyName: "bloomWeight", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Kernel", minimum: 0, maximum: 128, step: 1, target: renderPipeline, propertyName: "bloomKernel", onPropertyChangedObservable: this.props.onPropertyChangedObservable, decimalCount: 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Scale", minimum: 0, maximum: 1, step: 0.25, target: renderPipeline, propertyName: "bloomScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "CHROMATIC ABERRATION", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, onValueChanged: () => this.forceUpdate(), propertyName: "chromaticAberrationEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), renderPipeline.chromaticAberrationEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "aberrationAmount", minimum: 0, maximum: 128, step: 0.1, target: renderPipeline.chromaticAberration, propertyName: "aberrationAmount", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Radial intensity", minimum: 0, maximum: 1, step: 0.01, target: renderPipeline.chromaticAberration, propertyName: "radialIntensity", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector2LineComponent__WEBPACK_IMPORTED_MODULE_10__.Vector2LineComponent, { lockObject: this.props.lockObject, label: "Center", target: renderPipeline.chromaticAberration, propertyName: "centerPosition", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector2LineComponent__WEBPACK_IMPORTED_MODULE_10__.Vector2LineComponent, { lockObject: this.props.lockObject, label: "Direction", target: renderPipeline.chromaticAberration, propertyName: "direction", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "DEPTH OF FIELD", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, onValueChanged: () => this.forceUpdate(), propertyName: "depthOfFieldEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), renderPipeline.depthOfFieldEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Focal length", minimum: 0, maximum: camera.maxZ, step: 0.1, target: renderPipeline.depthOfField, propertyName: "focalLength", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "fStop", minimum: 0, maximum: 32, step: 0.1, target: renderPipeline.depthOfField, propertyName: "fStop", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Distance", minimum: 0, maximum: camera.maxZ, step: 0.1, target: renderPipeline.depthOfField, propertyName: "focusDistance", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Lens size", minimum: 0, maximum: 1000, step: 1, target: renderPipeline.depthOfField, propertyName: "lensSize", onPropertyChangedObservable: this.props.onPropertyChangedObservable, decimalCount: 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__.OptionsLine, { label: "Blur level", options: depthOfFieldBlurOptions, target: renderPipeline, propertyName: "depthOfFieldBlurLevel", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ mode: value }) })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "FXAA", selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, propertyName: "fxaaEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "GLOW LAYER", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, propertyName: "glowLayerEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), renderPipeline.glowLayerEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Blur kernel size", minimum: 1, maximum: 128, step: 1, decimalCount: 0, target: renderPipeline.glowLayer, propertyName: "blurKernelSize", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", minimum: 0, maximum: 10, step: 0.1, target: renderPipeline.glowLayer, propertyName: "intensity", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "GRAIN", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, onValueChanged: () => this.forceUpdate(), propertyName: "grainEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), renderPipeline.grainEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Animated", target: renderPipeline.grain, propertyName: "animated", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Intensity", minimum: 0, maximum: 50, step: 0.1, target: renderPipeline.grain, propertyName: "intensity", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "IMAGE PROCESSING", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, onValueChanged: () => this.forceUpdate(), propertyName: "imageProcessingEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), renderPipeline.imageProcessing && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__.ButtonLineComponent, { label: "Convert clear color to linear", onClick: () => (renderPipeline.scene.clearColor = renderPipeline.scene.clearColor.toLinearSpace(renderPipeline.scene.getEngine().useExactSrgbConversions)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__.ButtonLineComponent, { label: "Convert clear color to gamma", onClick: () => (renderPipeline.scene.clearColor = renderPipeline.scene.clearColor.toGammaSpace(renderPipeline.scene.getEngine().useExactSrgbConversions)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 4, step: 0.1, label: "Contrast", target: renderPipeline.imageProcessing, propertyName: "contrast", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 4, step: 0.1, label: "Exposure", target: renderPipeline.imageProcessing, propertyName: "exposure", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Tone mapping", target: renderPipeline.imageProcessing, propertyName: "toneMappingEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__.OptionsLine, { label: "Tone mapping type", options: toneMappingOptions, target: renderPipeline.imageProcessing, propertyName: "toneMappingType", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ mode: value }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Vignette", target: renderPipeline.imageProcessing, propertyName: "vignetteEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 4, step: 0.1, label: "Vignette weight", target: renderPipeline.imageProcessing, propertyName: "vignetteWeight", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 1, step: 0.1, label: "Vignette stretch", target: renderPipeline.imageProcessing, propertyName: "vignetteStretch", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: Math.PI, step: 0.1, label: "Vignette FOV", target: renderPipeline.imageProcessing, propertyName: "vignetteCameraFov", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 1, step: 0.1, label: "Vignette center X", target: renderPipeline.imageProcessing, propertyName: "vignetteCenterX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 1, step: 0.1, label: "Vignette center Y", target: renderPipeline.imageProcessing, propertyName: "vignetteCenterY", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_8__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Vignette color", target: renderPipeline.imageProcessing, propertyName: "vignetteColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__.OptionsLine, { label: "Vignette blend mode", options: vignetteModeOptions, target: renderPipeline.imageProcessing, propertyName: "vignetteBlendMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ mode: value }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Dithering", target: renderPipeline.imageProcessing, propertyName: "ditheringEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 1, step: 0.5 / 255.0, label: "Dithering intensity", target: renderPipeline.imageProcessing, propertyName: "ditheringIntensity", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "SHARPEN", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, onValueChanged: () => this.forceUpdate(), propertyName: "sharpenEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), renderPipeline.sharpenEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Color amount", minimum: 0, maximum: 1, step: 0.05, target: renderPipeline.sharpen, propertyName: "colorAmount", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Edge amount", minimum: 0, maximum: 5, step: 0.05, target: renderPipeline.sharpen, propertyName: "edgeAmount", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }))] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/iblShadowsRenderPipelinePropertyGridComponent.js":
/*!*******************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/iblShadowsRenderPipelinePropertyGridComponent.js ***!
  \*******************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2484042__) => {

"use strict";
__nested_webpack_require_2484042__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2484042__.d(__nested_webpack_exports__, {
/* harmony export */   IblShadowsRenderPipelinePropertyGridComponent: () => (/* binding */ IblShadowsRenderPipelinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2484042__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2484042__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2484042__(/*! ./commonRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonRenderingPipelinePropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2484042__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2484042__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2484042__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2484042__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");







class IblShadowsRenderPipelinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const renderPipeline = this.props.renderPipeline;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonRenderingPipelinePropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, renderPipeline: renderPipeline, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "Voxel Shadows", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: "Update Scene Bounds", onClick: () => {
                                this.props.renderPipeline.updateSceneBounds();
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: "Revoxelize", onClick: () => {
                                this.props.renderPipeline.updateVoxelization();
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_6__.ButtonLineComponent, { label: "Link IBL", onClick: () => {
                                if (this.props.renderPipeline.scene.environmentTexture) {
                                    this.props.renderPipeline.setIblTexture(this.props.renderPipeline.scene.environmentTexture);
                                }
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Opacity", minimum: 0, maximum: 1, step: 0.05, target: renderPipeline, propertyName: "shadowOpacity", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Samples", minimum: 0, maximum: 8, step: 1, target: renderPipeline, propertyName: "sampleDirections", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Resolution", minimum: 4, maximum: 8, step: 1, target: renderPipeline, propertyName: "resolutionExp", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Remenance", minimum: 0, maximum: 1, step: 0.01, target: renderPipeline, propertyName: "shadowRemenance", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "Screenspace Shadows", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Opacity", minimum: 0, maximum: 1, step: 0.01, target: renderPipeline, propertyName: "ssShadowOpacity", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Samples", minimum: 0, maximum: 16, step: 1, target: renderPipeline, propertyName: "ssShadowSamples", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Stride", minimum: 0, maximum: 16, step: 0.01, target: renderPipeline, propertyName: "ssShadowStride", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Max Distance", minimum: 0.01, maximum: 0.2, step: 0.01, target: renderPipeline, propertyName: "ssShadowMaxDist", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Thickness", minimum: 0.005, maximum: 0.02, step: 0.001, target: renderPipeline, propertyName: "ssShadowThickness", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "Debug", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Allow Debug", propertyName: "allowDebugPasses", onPropertyChangedObservable: this.props.onPropertyChangedObservable, target: renderPipeline }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Voxel Grid", propertyName: "voxelDebugEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable, target: renderPipeline }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Importance Sample", propertyName: "importanceSamplingDebugEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable, target: renderPipeline }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Voxel Tracing", propertyName: "voxelTracingDebugEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable, target: renderPipeline }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Accumulation", propertyName: "accumulationPassDebugEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable, target: renderPipeline })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/lensRenderingPipelinePropertyGridComponent.js":
/*!****************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/lensRenderingPipelinePropertyGridComponent.js ***!
  \****************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2494113__) => {

"use strict";
__nested_webpack_require_2494113__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2494113__.d(__nested_webpack_exports__, {
/* harmony export */   LensRenderingPipelinePropertyGridComponent: () => (/* binding */ LensRenderingPipelinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2494113__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2494113__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2494113__(/*! ./commonRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonRenderingPipelinePropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2494113__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2494113__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2494113__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");






class LensRenderingPipelinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const renderPipeline = this.props.renderPipeline;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonRenderingPipelinePropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, renderPipeline: renderPipeline, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "OPTIONS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Edge blur", minimum: 0, maximum: 5, step: 0.1, target: renderPipeline, propertyName: "edgeBlur", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Edge distortion", minimum: 0, maximum: 5, step: 0.1, target: renderPipeline, propertyName: "edgeDistortion", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Grain amount", minimum: 0, maximum: 1, step: 0.1, target: renderPipeline, propertyName: "grainAmount", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Chromatic aberration", minimum: 0, maximum: 5, step: 0.1, target: renderPipeline, propertyName: "chromaticAberration", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Darken out of focus", minimum: 0, maximum: 5, step: 0.1, target: renderPipeline, propertyName: "darkenOutOfFocus", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Blur noise", target: renderPipeline, propertyName: "blurNoise", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "DEPTH OF FIELD", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Aperture", minimum: 0, maximum: 10, step: 0.1, target: renderPipeline, propertyName: "dofAperture", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Distortion", minimum: 0, maximum: 1000, step: 0.1, target: renderPipeline, propertyName: "dofDistortion", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Pentagon bokeh", target: renderPipeline, propertyName: "pentagonBokeh", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Highlight gain", minimum: 0, maximum: 5, step: 0.1, target: renderPipeline, propertyName: "highlightsGain", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Highlight threshold", minimum: 0, maximum: 5, step: 0.1, target: renderPipeline, propertyName: "highlightsThreshold", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/postProcessPropertyGridComponent.js":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/postProcessPropertyGridComponent.js ***!
  \******************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2501604__) => {

"use strict";
__nested_webpack_require_2501604__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2501604__.d(__nested_webpack_exports__, {
/* harmony export */   PostProcessPropertyGridComponent: () => (/* binding */ PostProcessPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2501604__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2501604__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonPostProcessPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2501604__(/*! ./commonPostProcessPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonPostProcessPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2501604__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2501604__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");





class PostProcessPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    edit() {
        const postProcess = this.props.postProcess;
        postProcess.nodeMaterialSource.edit();
    }
    render() {
        const postProcess = this.props.postProcess;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonPostProcessPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonPostProcessPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, postProcess: postProcess, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), postProcess.nodeMaterialSource && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "CONFIGURATION", selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_4__.ButtonLineComponent, { label: "Node Material Editor", onClick: () => this.edit() }) }))] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/renderingPipelinePropertyGridComponent.js":
/*!************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/renderingPipelinePropertyGridComponent.js ***!
  \************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2504922__) => {

"use strict";
__nested_webpack_require_2504922__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2504922__.d(__nested_webpack_exports__, {
/* harmony export */   RenderingPipelinePropertyGridComponent: () => (/* binding */ RenderingPipelinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2504922__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2504922__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2504922__(/*! ./commonRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonRenderingPipelinePropertyGridComponent.js");



class RenderingPipelinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const renderPipeline = this.props.renderPipeline;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonRenderingPipelinePropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, renderPipeline: renderPipeline, onPropertyChangedObservable: this.props.onPropertyChangedObservable }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/ssao2RenderingPipelinePropertyGridComponent.js":
/*!*****************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/ssao2RenderingPipelinePropertyGridComponent.js ***!
  \*****************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2507083__) => {

"use strict";
__nested_webpack_require_2507083__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2507083__.d(__nested_webpack_exports__, {
/* harmony export */   SSAO2RenderingPipelinePropertyGridComponent: () => (/* binding */ SSAO2RenderingPipelinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2507083__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2507083__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2507083__(/*! ./commonRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonRenderingPipelinePropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2507083__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2507083__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2507083__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");






class SSAO2RenderingPipelinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const renderPipeline = this.props.renderPipeline;
        const camera = renderPipeline.scene.activeCamera;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonRenderingPipelinePropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, renderPipeline: renderPipeline, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "SSAO", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Strength", minimum: 0, maximum: 2, step: 0.05, target: renderPipeline, propertyName: "totalStrength", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Base", minimum: 0, maximum: 1, step: 0.05, target: renderPipeline, propertyName: "base", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Max Z", minimum: 0, maximum: camera.maxZ, step: 1, target: renderPipeline, propertyName: "maxZ", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Min Z aspect", minimum: 0, maximum: 0.5, step: 0.01, target: renderPipeline, propertyName: "minZAspect", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Radius", minimum: 0, maximum: 10, step: 0.05, target: renderPipeline, propertyName: "radius", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Epsilon", minimum: 0, maximum: 1, step: 0.001, target: renderPipeline, propertyName: "epsilon", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "Denoiser", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Bypass Blur", propertyName: "bypassBlur", onPropertyChangedObservable: this.props.onPropertyChangedObservable, target: renderPipeline }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Expensive Blur", propertyName: "expensiveBlur", onPropertyChangedObservable: this.props.onPropertyChangedObservable, target: renderPipeline }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Samples", minimum: 2, maximum: 32, step: 1, target: renderPipeline, propertyName: "bilateralSamples", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Soften", minimum: 0, maximum: 1, step: 0.01, target: renderPipeline, propertyName: "bilateralSoften", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Tolerance", minimum: 0, maximum: 1, step: 0.01, target: renderPipeline, propertyName: "bilateralTolerance", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/ssaoRenderingPipelinePropertyGridComponent.js":
/*!****************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/ssaoRenderingPipelinePropertyGridComponent.js ***!
  \****************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2514553__) => {

"use strict";
__nested_webpack_require_2514553__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2514553__.d(__nested_webpack_exports__, {
/* harmony export */   SSAORenderingPipelinePropertyGridComponent: () => (/* binding */ SSAORenderingPipelinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2514553__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2514553__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2514553__(/*! ./commonRenderingPipelinePropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/commonRenderingPipelinePropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2514553__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2514553__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");





class SSAORenderingPipelinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const renderPipeline = this.props.renderPipeline;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonRenderingPipelinePropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonRenderingPipelinePropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, renderPipeline: renderPipeline, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "SSAO", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Strength", minimum: 0, maximum: 2, step: 0.05, target: renderPipeline, propertyName: "totalStrength", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Base", minimum: 0, maximum: 1, step: 0.05, target: renderPipeline, propertyName: "base", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Radius", minimum: 0.0001, maximum: 0.001, step: 0.0001, target: renderPipeline, propertyName: "radius", onPropertyChangedObservable: this.props.onPropertyChangedObservable, decimalCount: 4 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Area", minimum: 0.0001, maximum: 0.01, step: 0.0001, target: renderPipeline, propertyName: "area", onPropertyChangedObservable: this.props.onPropertyChangedObservable, decimalCount: 4 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_3__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Falloff", minimum: 0, maximum: 0.00001, step: 0.000001, target: renderPipeline, propertyName: "fallOff", onPropertyChangedObservable: this.props.onPropertyChangedObservable, decimalCount: 6 })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/ssrRenderingPipelinePropertyGridComponent.js":
/*!***************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/postProcesses/ssrRenderingPipelinePropertyGridComponent.js ***!
  \***************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2519474__) => {

"use strict";
__nested_webpack_require_2519474__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2519474__.d(__nested_webpack_exports__, {
/* harmony export */   SSRRenderingPipelinePropertyGridComponent: () => (/* binding */ SSRRenderingPipelinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2519474__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2519474__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2519474__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2519474__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2519474__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2519474__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2519474__(/*! ../../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");







class SSRRenderingPipelinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const renderPipeline = this.props.renderPipeline;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Name", value: renderPipeline.name }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Class", value: renderPipeline.getClassName() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SSR", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, propertyName: "isEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Debug", target: renderPipeline, propertyName: "debug", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Strength", minimum: 0, maximum: 5, step: 0.05, target: renderPipeline, propertyName: "strength", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Reflection exponent", minimum: 0, maximum: 5, step: 0.05, target: renderPipeline, propertyName: "reflectionSpecularFalloffExponent", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Reflectivity threshold", minimum: 0, maximum: 1, step: 0.01, target: renderPipeline, propertyName: "reflectivityThreshold", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Thickness", minimum: 0, maximum: 10, step: 0.01, target: renderPipeline, propertyName: "thickness", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Step", minimum: 1, maximum: 50, step: 1, target: renderPipeline, propertyName: "step", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Smooth reflections", target: renderPipeline, propertyName: "enableSmoothReflections", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Max steps", minimum: 1, maximum: 3000, step: 10, target: renderPipeline, propertyName: "maxSteps", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Max distance", minimum: 1, maximum: 3000, step: 10, target: renderPipeline, propertyName: "maxDistance", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Roughness factor", minimum: 0, maximum: 1, step: 0.01, target: renderPipeline, propertyName: "roughnessFactor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Self collision skips", minimum: 1, maximum: 10, step: 1, target: renderPipeline, propertyName: "selfCollisionNumSkip", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "SSR downsample", minimum: 0, maximum: 5, step: 1, target: renderPipeline, propertyName: "ssrDownsample", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Clip to frustum", target: renderPipeline, propertyName: "clipToFrustum", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "Automatic thickness computation", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Enabled", target: renderPipeline, propertyName: "enableAutomaticThicknessComputation", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Force write transparent", target: renderPipeline, propertyName: "backfaceForceDepthWriteTransparentMeshes", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Downsample", minimum: 0, maximum: 5, step: 1, target: renderPipeline, propertyName: "backfaceDepthTextureDownsample", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "Blur", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Strength", minimum: 0, maximum: 0.15, step: 0.001, target: renderPipeline, propertyName: "blurDispersionStrength", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Downsample", minimum: 0, maximum: 5, step: 1, target: renderPipeline, propertyName: "blurDownsample", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "Attenuations", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Screen borders", target: renderPipeline, propertyName: "attenuateScreenBorders", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Distance", target: renderPipeline, propertyName: "attenuateIntersectionDistance", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Step iterations", target: renderPipeline, propertyName: "attenuateIntersectionIterations", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Facing camera", target: renderPipeline, propertyName: "attenuateFacingCamera", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Backface reflections", target: renderPipeline, propertyName: "attenuateBackfaceReflection", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "Environment", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextureLinkLineComponent, { label: "Cube", texture: renderPipeline.environmentTexture, propertyName: "environmentTexture", texturedObject: renderPipeline, fileFormats: ".dds", cubeOnly: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Is probe", target: renderPipeline, propertyName: "environmentTextureIsProbe", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "Color space", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Input is in gamma space", target: renderPipeline, propertyName: "inputTextureColorIsInGammaSpace", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Output to gamma space", target: renderPipeline, propertyName: "generateOutputInGammaSpace", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/renderGridPropertyGridComponent.js":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/renderGridPropertyGridComponent.js ***!
  \***************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2534005__) => {

"use strict";
__nested_webpack_require_2534005__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2534005__.d(__nested_webpack_exports__, {
/* harmony export */   RenderGridPropertyGridComponent: () => (/* binding */ RenderGridPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2534005__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2534005__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2534005__(/*! core/Meshes/Builders/groundBuilder */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2534005__.n(core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var materials_grid_gridMaterial__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2534005__(/*! materials/grid/gridMaterial */ "materials/grid/gridMaterial");
/* harmony import */ var materials_grid_gridMaterial__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2534005__.n(materials_grid_gridMaterial__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2534005__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");








class RenderGridPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isEnabled: false };
    }
    componentDidMount() {
        const scene = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.UtilityLayerRenderer.DefaultKeepDepthUtilityLayer.utilityLayerScene;
        for (const mesh of scene.meshes) {
            if (mesh.reservedDataStore && mesh.reservedDataStore.isInspectorGrid) {
                this._gridMesh = mesh;
                this.setState({ isEnabled: true });
                return;
            }
        }
    }
    addOrRemoveGrid() {
        const scene = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.UtilityLayerRenderer.DefaultKeepDepthUtilityLayer.utilityLayerScene;
        if (!this._gridMesh) {
            const extend = this.props.scene.getWorldExtends();
            const width = (extend.max.x - extend.min.x) * 5.0;
            const depth = (extend.max.z - extend.min.z) * 5.0;
            this._gridMesh = (0,core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.CreateGround)("grid", { width: 1.0, height: 1.0, subdivisions: 1 }, scene);
            if (!this._gridMesh.reservedDataStore) {
                this._gridMesh.reservedDataStore = {};
            }
            this._gridMesh.scaling.x = Math.max(width, depth);
            this._gridMesh.scaling.z = this._gridMesh.scaling.x;
            this._gridMesh.reservedDataStore.isInspectorGrid = true;
            this._gridMesh.isPickable = false;
            const groundMaterial = new materials_grid_gridMaterial__WEBPACK_IMPORTED_MODULE_3__.GridMaterial("GridMaterial", scene);
            groundMaterial.majorUnitFrequency = 10;
            groundMaterial.minorUnitVisibility = 0.3;
            groundMaterial.gridRatio = 0.01;
            groundMaterial.backFaceCulling = false;
            groundMaterial.mainColor = new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3(1, 1, 1);
            groundMaterial.lineColor = new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3(1.0, 1.0, 1.0);
            groundMaterial.opacity = 0.8;
            groundMaterial.zOffset = 1.0;
            groundMaterial.opacityTexture = new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Texture("https://assets.babylonjs.com/environments/backgroundGround.png", scene);
            this._gridMesh.material = groundMaterial;
            this.setState({ isEnabled: true });
            return;
        }
        this.setState({ isEnabled: !this.state.isEnabled });
        this._gridMesh.dispose(true, true);
        this._gridMesh = null;
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { label: "Render grid", isSelected: () => this.state.isEnabled, onSelect: () => this.addOrRemoveGrid() }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/scenePropertyGridComponent.js":
/*!**********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/scenePropertyGridComponent.js ***!
  \**********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2539089__) => {

"use strict";
__nested_webpack_require_2539089__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2539089__.d(__nested_webpack_exports__, {
/* harmony export */   ScenePropertyGridComponent: () => (/* binding */ ScenePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2539089__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2539089__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2539089__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2539089__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_radioLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/radioLineComponent */ "../../../dev/sharedUiComponents/dist/lines/radioLineComponent.js");
/* harmony import */ var shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _fogPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2539089__(/*! ./fogPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/fogPropertyGridComponent.js");
/* harmony import */ var shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/fileButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2539089__(/*! ../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_2539089__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var _animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_2539089__(/*! ./animations/animationPropertyGridComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.js");























class ScenePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._renderingModeGroupObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable();
    }
    setRenderingModes(point, wireframe) {
        const scene = this.props.scene;
        scene.forcePointsCloud = point;
        scene.forceWireframe = wireframe;
    }
    switchIBL() {
        const scene = this.props.scene;
        if (scene.environmentTexture) {
            this._storedEnvironmentTexture = scene.environmentTexture;
            scene.environmentTexture = null;
        }
        else {
            scene.environmentTexture = this._storedEnvironmentTexture;
            this._storedEnvironmentTexture = null;
        }
    }
    updateEnvironmentTexture(file) {
        const isFileDDS = file.name.toLowerCase().indexOf(".dds") > 0;
        const isFileEnv = file.name.toLowerCase().indexOf(".env") > 0;
        if (!isFileDDS && !isFileEnv) {
            core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Logger.Error("Unable to update environment texture. Please select a dds or env file.");
            return;
        }
        const scene = this.props.scene;
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Tools.ReadFile(file, (data) => {
            const blob = new Blob([data], { type: "octet/stream" });
            const url = URL.createObjectURL(blob);
            if (isFileDDS) {
                scene.environmentTexture = core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.CubeTexture.CreateFromPrefilteredData(url, scene, ".dds");
            }
            else {
                scene.environmentTexture = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.CubeTexture(url, scene, undefined, undefined, undefined, () => { }, (message) => {
                    if (message) {
                        core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Logger.Error(message);
                    }
                }, undefined, undefined, ".env");
            }
        }, undefined, true);
    }
    updateGravity(newValue) {
        const scene = this.props.scene;
        const physicsEngine = scene.getPhysicsEngine();
        physicsEngine.setGravity(newValue);
    }
    updateTimeStep(newValue) {
        const scene = this.props.scene;
        const physicsEngine = scene.getPhysicsEngine();
        physicsEngine.setTimeStep(newValue);
    }
    normalizeScene() {
        const scene = this.props.scene;
        scene.meshes.forEach((mesh) => {
            mesh.normalizeToUnitCube(true);
            mesh.computeWorldMatrix(true);
        });
    }
    render() {
        const scene = this.props.scene;
        const physicsEngine = scene.getPhysicsEngine();
        let dummy = null;
        if (physicsEngine) {
            dummy = {
                gravity: physicsEngine.gravity,
                timeStep: physicsEngine.getTimeStep(),
            };
        }
        const imageProcessing = scene.imageProcessingConfiguration;
        const toneMappingOptions = [
            { label: "Standard", value: core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.ImageProcessingConfiguration.TONEMAPPING_STANDARD },
            { label: "ACES", value: core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.ImageProcessingConfiguration.TONEMAPPING_ACES },
            { label: "Khronos PBR Neutral", value: core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.ImageProcessingConfiguration.TONEMAPPING_KHR_PBR_NEUTRAL },
        ];
        const vignetteModeOptions = [
            { label: "Multiply", value: core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.ImageProcessingConfiguration.VIGNETTEMODE_MULTIPLY },
            { label: "Opaque", value: core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.ImageProcessingConfiguration.VIGNETTEMODE_OPAQUE },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "RENDERING MODE", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_radioLineComponent__WEBPACK_IMPORTED_MODULE_4__.RadioButtonLineComponent, { onSelectionChangedObservable: this._renderingModeGroupObservable, label: "Point", isSelected: () => scene.forcePointsCloud, onSelect: () => this.setRenderingModes(true, false) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_radioLineComponent__WEBPACK_IMPORTED_MODULE_4__.RadioButtonLineComponent, { onSelectionChangedObservable: this._renderingModeGroupObservable, label: "Wireframe", isSelected: () => scene.forceWireframe, onSelect: () => this.setRenderingModes(false, true) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_radioLineComponent__WEBPACK_IMPORTED_MODULE_4__.RadioButtonLineComponent, { onSelectionChangedObservable: this._renderingModeGroupObservable, label: "Solid", isSelected: () => !scene.forcePointsCloud && !scene.forceWireframe, onSelect: () => this.setRenderingModes(false, false) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ENVIRONMENT", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Clear color", target: scene, propertyName: "clearColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Clear color enabled", target: scene, propertyName: "autoClear", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Ambient color", target: scene, propertyName: "ambientColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Environment texture (IBL)", isSelected: () => scene.environmentTexture != null, onSelect: () => this.switchIBL() }), scene.environmentTexture && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Env. texture", texture: scene.environmentTexture, onSelectionChangedObservable: this.props.onSelectionChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_8__.FileButtonLine, { label: "Update environment texture", onClick: (file) => this.updateEnvironmentTexture(file), accept: ".dds, .env" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 2, step: 0.01, label: "IBL Intensity", target: scene, propertyName: "environmentIntensity", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fogPropertyGridComponent__WEBPACK_IMPORTED_MODULE_7__.FogPropertyGridComponent, { globalState: this.props.globalState, lockObject: this.props.lockObject, scene: scene, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_15__.AnimationGridComponent, { globalState: this.props.globalState, animatable: scene, scene: scene, lockObject: this.props.lockObject }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "MATERIAL IMAGE PROCESSING", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 4, step: 0.1, label: "Contrast", target: imageProcessing, propertyName: "contrast", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 4, step: 0.1, label: "Exposure", target: imageProcessing, propertyName: "exposure", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Tone mapping", target: imageProcessing, propertyName: "toneMappingEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_13__.OptionsLine, { label: "Tone mapping type", options: toneMappingOptions, target: imageProcessing, propertyName: "toneMappingType", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ mode: value }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Vignette", target: imageProcessing, propertyName: "vignetteEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 4, step: 0.1, label: "Vignette weight", target: imageProcessing, propertyName: "vignetteWeight", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 1, step: 0.1, label: "Vignette stretch", target: imageProcessing, propertyName: "vignetteStretch", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: Math.PI, step: 0.1, label: "Vignette FOV", target: imageProcessing, propertyName: "vignetteCameraFov", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 1, step: 0.1, label: "Vignette center X", target: imageProcessing, propertyName: "vignetteCenterX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 1, step: 0.1, label: "Vignette center Y", target: imageProcessing, propertyName: "vignetteCenterY", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_5__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Vignette color", target: imageProcessing, propertyName: "vignetteColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_13__.OptionsLine, { label: "Vignette blend mode", options: vignetteModeOptions, target: imageProcessing, propertyName: "vignetteBlendMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ mode: value }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Dithering", target: imageProcessing, propertyName: "ditheringEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_12__.SliderLineComponent, { lockObject: this.props.lockObject, minimum: 0, maximum: 1, step: 0.5 / 255.0, label: "Dithering intensity", target: imageProcessing, propertyName: "ditheringIntensity", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), dummy !== null && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "PHYSICS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_11__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Time step", target: dummy, propertyName: "timeStep", onChange: (newValue) => this.updateTimeStep(newValue), onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_10__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Gravity", target: dummy, propertyName: "gravity", onChange: (newValue) => this.updateGravity(newValue), onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "COLLISIONS", closed: true, selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_10__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Gravity", target: scene, propertyName: "gravity", onPropertyChangedObservable: this.props.onPropertyChangedObservable }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SHADOWS", closed: true, selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__.ButtonLineComponent, { label: "Normalize scene", onClick: () => this.normalizeScene() }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/sounds/soundPropertyGridComponent.js":
/*!*****************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/sounds/soundPropertyGridComponent.js ***!
  \*****************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2559489__) => {

"use strict";
__nested_webpack_require_2559489__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2559489__.d(__nested_webpack_exports__, {
/* harmony export */   SoundPropertyGridComponent: () => (/* binding */ SoundPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2559489__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2559489__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2559489__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2559489__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2559489__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2559489__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2559489__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2559489__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");








class SoundPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const sound = this.props.sound;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Class", value: sound.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: sound, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Status", value: sound.isPaused ? "Paused" : sound.isPlaying ? "Playing" : "Stopped" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "COMMANDS", selection: this.props.globalState, children: [sound.isPlaying && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_5__.ButtonLineComponent, { label: "Pause", onClick: () => {
                                sound.pause();
                                this.forceUpdate();
                            } })), !sound.isPlaying && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_5__.ButtonLineComponent, { label: "Play", onClick: () => {
                                sound.play();
                                this.forceUpdate();
                            } })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Volume", target: sound, directValue: sound.getVolume(), onChange: (value) => {
                                sound.setVolume(value);
                                this.forceUpdate();
                            }, minimum: 0, maximum: 5, step: 0.1, decimalCount: 1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__.CheckBoxLineComponent, { label: "Loop", target: sound, propertyName: "loop", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/sprites/spriteManagerPropertyGridComponent.js":
/*!**************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/sprites/spriteManagerPropertyGridComponent.js ***!
  \**************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2565230__) => {

"use strict";
__nested_webpack_require_2565230__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2565230__.d(__nested_webpack_exports__, {
/* harmony export */   SpriteManagerPropertyGridComponent: () => (/* binding */ SpriteManagerPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2565230__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2565230__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2565230__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2565230__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2565230__.n(core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2565230__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2565230__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2565230__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2565230__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2565230__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2565230__(/*! ../../../lines/textureLinkLineComponent */ "../../../dev/inspector/dist/components/actionTabs/lines/textureLinkLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2565230__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2565230__(/*! shared-ui-components/lines/fileButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_2565230__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");

















class SpriteManagerPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._snippetUrl = core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Constants.SnippetUrl;
    }
    addNewSprite() {
        const spriteManager = this.props.spriteManager;
        const newSprite = new core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Sprite("new sprite", spriteManager);
        this.props.onSelectionChangedObservable?.notifyObservers(newSprite);
    }
    disposeManager() {
        const spriteManager = this.props.spriteManager;
        spriteManager.dispose();
        this.props.onSelectionChangedObservable?.notifyObservers(null);
    }
    saveToFile() {
        const spriteManager = this.props.spriteManager;
        const content = JSON.stringify(spriteManager.serialize(true));
        core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Tools.Download(new Blob([content]), "spriteManager.json");
    }
    loadFromFile(file) {
        const spriteManager = this.props.spriteManager;
        const scene = spriteManager.scene;
        core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Tools.ReadFile(file, (data) => {
            const decoder = new TextDecoder("utf-8");
            const jsonObject = JSON.parse(decoder.decode(data));
            spriteManager.dispose();
            this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
            const newManager = core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.SpriteManager.Parse(jsonObject, scene, "");
            this.props.globalState.onSelectionChangedObservable.notifyObservers(newManager);
        }, undefined, true);
    }
    loadFromSnippet() {
        const spriteManager = this.props.spriteManager;
        const scene = spriteManager.scene;
        const snippedId = window.prompt("Please enter the snippet ID to use");
        if (!snippedId) {
            return;
        }
        spriteManager.dispose();
        this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
        core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.SpriteManager.ParseFromSnippetAsync(snippedId, scene)
            .then((newManager) => {
            this.props.globalState.onSelectionChangedObservable.notifyObservers(newManager);
        })
            .catch((err) => {
            alert("Unable to load your sprite manager: " + err);
        });
    }
    saveToSnippet() {
        const spriteManager = this.props.spriteManager;
        const content = JSON.stringify(spriteManager.serialize(true));
        const xmlHttp = new XMLHttpRequest();
        xmlHttp.onreadystatechange = () => {
            if (xmlHttp.readyState == 4) {
                if (xmlHttp.status == 200) {
                    const snippet = JSON.parse(xmlHttp.responseText);
                    const oldId = spriteManager.snippetId || "_BLANK";
                    spriteManager.snippetId = snippet.id;
                    if (snippet.version && snippet.version != "0") {
                        spriteManager.snippetId += "#" + snippet.version;
                    }
                    this.forceUpdate();
                    if (navigator.clipboard) {
                        navigator.clipboard.writeText(spriteManager.snippetId);
                    }
                    const windowAsAny = window;
                    if (windowAsAny.Playground && oldId) {
                        windowAsAny.Playground.onRequestCodeChangeObservable.notifyObservers({
                            regex: new RegExp(`SpriteManager.ParseFromSnippetAsync\\("${oldId}`, "g"),
                            replace: `SpriteManager.ParseFromSnippetAsync("${spriteManager.snippetId}`,
                        });
                    }
                    alert("Sprite manager saved with ID: " + spriteManager.snippetId + " (please note that the id was also saved to your clipboard)");
                }
                else {
                    alert("Unable to save your sprite manager");
                }
            }
        };
        xmlHttp.open("POST", this._snippetUrl + (spriteManager.snippetId ? "/" + spriteManager.snippetId : ""), true);
        xmlHttp.setRequestHeader("Content-Type", "application/json");
        const dataToSend = {
            payload: JSON.stringify({
                spriteManager: content,
            }),
            name: "",
            description: "",
            tags: "",
        };
        xmlHttp.send(JSON.stringify(dataToSend));
    }
    render() {
        const spriteManager = this.props.spriteManager;
        const alphaModeOptions = [
            { label: "Combine", value: core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Constants.ALPHA_COMBINE },
            { label: "One one", value: core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Constants.ALPHA_ONEONE },
            { label: "Add", value: core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Constants.ALPHA_ADD },
            { label: "Subtract", value: core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Constants.ALPHA_SUBTRACT },
            { label: "Multiply", value: core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Constants.ALPHA_MULTIPLY },
            { label: "Maximized", value: core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Constants.ALPHA_MAXIMIZED },
            { label: "Pre-multiplied", value: core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.Constants.ALPHA_PREMULTIPLIED },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: spriteManager, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Unique ID", value: spriteManager.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Capacity", value: spriteManager.capacity.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_9__.TextureLinkLineComponent, { label: "Texture", texture: spriteManager.texture, onSelectionChangedObservable: this.props.onSelectionChangedObservable }), spriteManager.sprites.length < spriteManager.capacity && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__.ButtonLineComponent, { label: "Add new sprite", onClick: () => this.addNewSprite() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__.ButtonLineComponent, { label: "Dispose", onClick: () => this.disposeManager() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "FILE", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_11__.FileButtonLine, { label: "Load", onClick: (file) => this.loadFromFile(file), accept: ".json" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__.ButtonLineComponent, { label: "Save", onClick: () => this.saveToFile() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SNIPPET", selection: this.props.globalState, children: [spriteManager.snippetId && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextLineComponent, { label: "Snippet ID", value: spriteManager.snippetId }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__.ButtonLineComponent, { label: "Load from snippet server", onClick: () => this.loadFromSnippet() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_10__.ButtonLineComponent, { label: "Save to snippet server", onClick: () => this.saveToSnippet() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "PROPERTIES", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Pickable", target: spriteManager, propertyName: "isPickable", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Fog enabled", target: spriteManager, propertyName: "fogEnabled", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "No depth write", target: spriteManager, propertyName: "disableDepthWrite", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_8__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Rendering group ID", decimalCount: 0, target: spriteManager, propertyName: "renderingGroupId", minimum: core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.RenderingManager.MIN_RENDERINGGROUPS, maximum: core_Sprites_spriteManager__WEBPACK_IMPORTED_MODULE_3__.RenderingManager.MAX_RENDERINGGROUPS - 1, step: 1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_12__.OptionsLine, { label: "Alpha mode", options: alphaModeOptions, target: spriteManager, propertyName: "blendMode", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ blendMode: value }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "CELLS", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Cell width", isInteger: true, target: spriteManager, propertyName: "cellWidth", min: 0, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Cell height", isInteger: true, target: spriteManager, propertyName: "cellHeight", min: 0, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/sprites/spritePropertyGridComponent.js":
/*!*******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/sprites/spritePropertyGridComponent.js ***!
  \*******************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2581311__) => {

"use strict";
__nested_webpack_require_2581311__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2581311__.d(__nested_webpack_exports__, {
/* harmony export */   SpritePropertyGridComponent: () => (/* binding */ SpritePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2581311__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2581311__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2581311__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2581311__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2581311__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2581311__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2581311__(/*! shared-ui-components/lines/vector3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2581311__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2581311__(/*! shared-ui-components/lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2581311__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var _textureHelper__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2581311__(/*! ../../../../../textureHelper */ "../../../dev/inspector/dist/textureHelper.js");
/* harmony import */ var shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2581311__(/*! shared-ui-components/lines/color4LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js");

/* eslint-disable @typescript-eslint/naming-convention */











class SpritePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._imageData = null;
        this._cachedCellIndex = -1;
        this._canvasRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    onManagerLink() {
        if (!this.props.onSelectionChangedObservable) {
            return;
        }
        const sprite = this.props.sprite;
        this.props.onSelectionChangedObservable.notifyObservers(sprite.manager);
    }
    switchPlayStopState() {
        const sprite = this.props.sprite;
        if (sprite.animationStarted) {
            sprite.stopAnimation();
        }
        else {
            sprite.playAnimation(sprite.fromIndex, sprite.toIndex, sprite.loopAnimation, sprite.delay, () => { });
        }
        this.forceUpdate();
    }
    disposeSprite() {
        const sprite = this.props.sprite;
        sprite.dispose();
        this.props.onSelectionChangedObservable?.notifyObservers(null);
    }
    componentDidMount() {
        this.updatePreview();
    }
    componentDidUpdate() {
        this.updatePreview();
    }
    shouldComponentUpdate(nextProps) {
        if (nextProps.sprite !== this.props.sprite) {
            this._imageData = null;
        }
        return true;
    }
    updatePreview() {
        const sprite = this.props.sprite;
        const manager = sprite.manager;
        const texture = manager.texture;
        const size = texture.getSize();
        if (!this._imageData) {
            _textureHelper__WEBPACK_IMPORTED_MODULE_10__.TextureHelper.GetTextureDataAsync(texture, size.width, size.height, 0, { R: true, G: true, B: true, A: true }, this.props.globalState).then((data) => {
                this._imageData = data;
                this.forceUpdate();
            });
            return;
        }
        if (this._cachedCellIndex === sprite.cellIndex) {
            return;
        }
        this._cachedCellIndex = sprite.cellIndex;
        const previewCanvas = this._canvasRef.current;
        previewCanvas.width = manager.cellWidth;
        previewCanvas.height = manager.cellHeight;
        const context = previewCanvas.getContext("2d");
        if (context) {
            // Copy the pixels to the preview canvas
            const imageData = context.createImageData(manager.cellWidth, manager.cellHeight);
            const castData = imageData.data;
            const rowLength = (size.width / manager.cellWidth) | 0;
            const offsetY = (sprite.cellIndex / rowLength) | 0;
            const offsetX = sprite.cellIndex - offsetY * rowLength;
            const offset = (offsetX + offsetY * size.width) * 4 * manager.cellWidth;
            for (let x = 0; x < manager.cellWidth; x++) {
                for (let y = 0; y < manager.cellHeight; y++) {
                    const targetCoord = (x + y * manager.cellWidth) * 4;
                    const sourceCoord = (x + y * size.width) * 4;
                    castData[targetCoord] = this._imageData[offset + sourceCoord];
                    castData[targetCoord + 1] = this._imageData[offset + sourceCoord + 1];
                    castData[targetCoord + 2] = this._imageData[offset + sourceCoord + 2];
                    castData[targetCoord + 3] = this._imageData[offset + sourceCoord + 3];
                }
            }
            context.putImageData(imageData, 0, 0);
        }
    }
    render() {
        const sprite = this.props.sprite;
        const manager = sprite.manager;
        const textureSize = manager.texture.getSize();
        let maxCellCount = 0;
        if (!textureSize.width || !textureSize.height) {
            maxCellCount = Math.max(sprite.fromIndex, sprite.toIndex);
        }
        else {
            maxCellCount = (textureSize.width / manager.cellWidth) * (textureSize.height / manager.cellHeight);
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: sprite, propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Unique ID", value: sprite.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: "Link to manager", value: manager.name, onLink: () => this.onManagerLink() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Visible", target: sprite, propertyName: "isVisible", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__.ButtonLineComponent, { label: "Dispose", onClick: () => this.disposeSprite() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "PROPERTIES", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__.Vector3LineComponent, { lockObject: this.props.lockObject, label: "Position", target: sprite, propertyName: "position", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Pickable", target: sprite, propertyName: "isPickable", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Use alpha for picking", target: sprite, propertyName: "useAlphaForPicking", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_color4LineComponent__WEBPACK_IMPORTED_MODULE_11__.Color4LineComponent, { lockObject: this.props.lockObject, label: "Color", target: sprite, propertyName: "color", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_8__.SliderLineComponent, { lockObject: this.props.lockObject, useEuler: this.props.globalState.onlyUseEulers, label: "Angle", target: sprite, propertyName: "angle", minimum: 0, maximum: 2 * Math.PI, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "CELL", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("canvas", { ref: this._canvasRef, className: "preview", style: {
                                margin: "auto",
                                marginTop: "4px",
                                marginBottom: "4px",
                                display: "grid",
                                height: "108px",
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_8__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Cell index", decimalCount: 0, target: sprite, propertyName: "cellIndex", minimum: 0, maximum: maxCellCount, step: 1, onPropertyChangedObservable: this.props.onPropertyChangedObservable, onChange: () => this.forceUpdate() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Invert U axis", target: sprite, propertyName: "invertU", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Invert V axis", target: sprite, propertyName: "invertV", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SCALE", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { label: "Width", lockObject: this.props.lockObject, target: sprite, propertyName: "width", min: 0, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { label: "Height", lockObject: this.props.lockObject, target: sprite, propertyName: "height", min: 0, onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "ANIMATION", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { label: "Start cell", isInteger: true, lockObject: this.props.lockObject, target: sprite, propertyName: "fromIndex", min: 0, max: maxCellCount, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { label: "End cell", isInteger: true, lockObject: this.props.lockObject, target: sprite, propertyName: "toIndex", min: 0, max: maxCellCount, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Loop", target: sprite, propertyName: "loopAnimation", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { label: "Delay", lockObject: this.props.lockObject, target: sprite, propertyName: "delay", digits: 0, min: 0, isInteger: true, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_9__.ButtonLineComponent, { label: sprite.animationStarted ? "Stop" : "Start", onClick: () => this.switchPlayStopState() })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/variantsPropertyGridComponent.js":
/*!*************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/variantsPropertyGridComponent.js ***!
  \*************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2596695__) => {

"use strict";
__nested_webpack_require_2596695__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2596695__.d(__nested_webpack_exports__, {
/* harmony export */   VariantsPropertyGridComponent: () => (/* binding */ VariantsPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2596695__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2596695__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2596695__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2596695__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");




class VariantsPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    _getVariantsExtension() {
        return this.props.globalState?.glTFLoaderExtensions["KHR_materials_variants"];
    }
    render() {
        const extension = this._getVariantsExtension();
        if (!extension) {
            return null;
        }
        const variants = extension.getAvailableVariants(this.props.host);
        if (!variants || variants.length === 0) {
            return null;
        }
        const options = variants.sort().map((v, i) => {
            return { label: v, value: i + 1 };
        });
        options.splice(0, 0, { label: "Original", value: 0 });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "VARIANTS", selection: this.props.globalState, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_3__.OptionsLine, { label: "Active variant", options: options, noDirectUpdate: true, target: this.props.host, propertyName: "", onSelect: (value) => {
                        const valueAsNumber = value;
                        if (valueAsNumber === 0) {
                            extension.reset(this.props.host);
                        }
                        else {
                            extension.selectVariant(this.props.host, variants[valueAsNumber - 1]);
                        }
                        this.forceUpdate();
                    }, extractValue: () => {
                        const lastPickedVariant = extension.getLastSelectedVariant(this.props.host) || 0;
                        let index = 0;
                        if (lastPickedVariant && Object.prototype.toString.call(lastPickedVariant) === "[object String]") {
                            index = variants.indexOf(lastPickedVariant);
                            if (index > -1) {
                                index = index + 1;
                            }
                        }
                        return index;
                    } }) }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/settingsTabComponent.js":
/*!**************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/settingsTabComponent.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2600564__) => {

"use strict";
__nested_webpack_require_2600564__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2600564__.d(__nested_webpack_exports__, {
/* harmony export */   SettingsTabComponent: () => (/* binding */ SettingsTabComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2600564__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _paneComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2600564__(/*! ../paneComponent */ "../../../dev/inspector/dist/components/actionTabs/paneComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2600564__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2600564__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");




class SettingsTabComponent extends _paneComponent__WEBPACK_IMPORTED_MODULE_1__.PaneComponent {
    constructor(props) {
        super(props);
    }
    render() {
        const state = this.props.globalState;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "pane", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "UI", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "Only display Euler values", target: state, propertyName: "onlyUseEulers" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_2__.CheckBoxLineComponent, { label: "Ignore backfaces when picking", target: state, propertyName: "ignoreBackfacesForPicking" })] }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/statisticsTabComponent.js":
/*!****************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/statisticsTabComponent.js ***!
  \****************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2603190__) => {

"use strict";
__nested_webpack_require_2603190__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2603190__.d(__nested_webpack_exports__, {
/* harmony export */   StatisticsTabComponent: () => (/* binding */ StatisticsTabComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2603190__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _paneComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2603190__(/*! ../paneComponent */ "../../../dev/inspector/dist/components/actionTabs/paneComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2603190__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2603190__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var core_Instrumentation_engineInstrumentation__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2603190__(/*! core/Engines/engine */ "core/Misc/observable");
/* harmony import */ var core_Instrumentation_engineInstrumentation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2603190__.n(core_Instrumentation_engineInstrumentation__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2603190__(/*! shared-ui-components/lines/valueLineComponent */ "../../../dev/sharedUiComponents/dist/lines/valueLineComponent.js");
/* harmony import */ var shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2603190__(/*! shared-ui-components/lines/booleanLineComponent */ "../../../dev/sharedUiComponents/dist/lines/booleanLineComponent.js");
/* harmony import */ var _performanceViewer_performanceViewerComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2603190__(/*! ./performanceViewer/performanceViewerComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/performanceViewerComponent.js");










class StatisticsTabComponent extends _paneComponent__WEBPACK_IMPORTED_MODULE_1__.PaneComponent {
    constructor(props) {
        super(props);
        const scene = this.props.scene;
        if (!scene) {
            return;
        }
        this._sceneInstrumentation = new core_Instrumentation_engineInstrumentation__WEBPACK_IMPORTED_MODULE_4__.SceneInstrumentation(scene);
        this._sceneInstrumentation.captureActiveMeshesEvaluationTime = true;
        this._sceneInstrumentation.captureRenderTargetsRenderTime = true;
        this._sceneInstrumentation.captureFrameTime = true;
        this._sceneInstrumentation.captureRenderTime = true;
        this._sceneInstrumentation.captureInterFrameTime = true;
        this._sceneInstrumentation.captureParticlesRenderTime = true;
        this._sceneInstrumentation.captureSpritesRenderTime = true;
        this._sceneInstrumentation.capturePhysicsTime = true;
        this._sceneInstrumentation.captureAnimationsTime = true;
        this._engineInstrumentation = new core_Instrumentation_engineInstrumentation__WEBPACK_IMPORTED_MODULE_4__.EngineInstrumentation(scene.getEngine());
        this._engineInstrumentation.captureGPUFrameTime = true;
        this._timerIntervalId = window.setInterval(() => this.forceUpdate(), 500);
    }
    componentWillUnmount() {
        if (this._sceneInstrumentation) {
            this._sceneInstrumentation.dispose();
            this._sceneInstrumentation = null;
        }
        if (this._engineInstrumentation) {
            this._engineInstrumentation.dispose();
            this._engineInstrumentation = null;
        }
        window.clearInterval(this._timerIntervalId);
    }
    render() {
        const scene = this.props.scene;
        if (!scene || !this._sceneInstrumentation || !this._engineInstrumentation) {
            return null;
        }
        const engine = scene.getEngine();
        const sceneInstrumentation = this._sceneInstrumentation;
        const engineInstrumentation = this._engineInstrumentation;
        const caps = engine.getCaps();
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Version", value: core_Instrumentation_engineInstrumentation__WEBPACK_IMPORTED_MODULE_4__.Engine.Version, color: "rgb(113, 159, 255)" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "FPS", value: engine.getFps(), fractionDigits: 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_performanceViewer_performanceViewerComponent__WEBPACK_IMPORTED_MODULE_7__.PerformanceViewerComponent, { scene: scene }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "COUNT", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Total meshes", value: scene.meshes.length.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Active meshes", value: scene.getActiveMeshes().length.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Active indices", value: scene.getActiveIndices().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Active faces", value: (scene.getActiveIndices() / 3).toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Active bones", value: scene.getActiveBones().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Active particles", value: scene.getActiveParticles().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Draw calls", value: sceneInstrumentation.drawCallsCounter.current.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Total lights", value: scene.lights.length.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Total vertices", value: scene.getTotalVertices().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Total materials", value: scene.materials.length.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Total textures", value: scene.textures.length.toString() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "FRAME STEPS DURATION", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Absolute FPS", value: 1000.0 / this._sceneInstrumentation.frameTimeCounter.lastSecAverage, fractionDigits: 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Meshes selection", value: sceneInstrumentation.activeMeshesEvaluationTimeCounter.lastSecAverage, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Render targets", value: sceneInstrumentation.renderTargetsRenderTimeCounter.lastSecAverage, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Particles", value: sceneInstrumentation.particlesRenderTimeCounter.lastSecAverage, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Sprites", value: sceneInstrumentation.spritesRenderTimeCounter.lastSecAverage, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Animations", value: sceneInstrumentation.animationsTimeCounter.lastSecAverage, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Physics", value: sceneInstrumentation.physicsTimeCounter.lastSecAverage, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Render", value: sceneInstrumentation.renderTimeCounter.lastSecAverage, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Frame total", value: sceneInstrumentation.frameTimeCounter.lastSecAverage, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Inter-frame", value: sceneInstrumentation.interFrameTimeCounter.lastSecAverage, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "GPU Frame time", value: engineInstrumentation.gpuFrameTimeCounter.lastSecAverage * 0.000001, units: "ms" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "GPU Frame time (average)", value: engineInstrumentation.gpuFrameTimeCounter.average * 0.000001, units: "ms" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SYSTEM INFO", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Resolution", value: engine.getRenderWidth() + "x" + engine.getRenderHeight() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Hardware scaling level", value: engine.getHardwareScalingLevel().toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Engine", value: engine.description }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Std derivatives", value: caps.standardDerivatives }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Compressed textures", value: caps.s3tc !== undefined }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Hardware instances", value: caps.instancedArrays }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Texture float", value: caps.textureFloat }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Texture half-float", value: caps.textureHalfFloat }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Render to texture float", value: caps.textureFloatRender }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Render to texture half-float", value: caps.textureHalfFloatRender }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "32bits indices", value: caps.uintIndices }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Fragment depth", value: caps.fragmentDepthSupported }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "High precision shaders", value: caps.highPrecisionShaderSupported }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Draw buffers", value: caps.drawBuffersExtension }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Vertex array object", value: caps.vertexArrayObject }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Timer query", value: caps.timerQuery !== undefined }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Stencil", value: engine.isStencilEnable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_booleanLineComponent__WEBPACK_IMPORTED_MODULE_6__.BooleanLineComponent, { label: "Parallel shader compilation", value: caps.parallelShaderCompile != null }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Max textures units", value: caps.maxTexturesImageUnits, fractionDigits: 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Max textures size", value: caps.maxTextureSize, fractionDigits: 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_5__.ValueLineComponent, { label: "Max anisotropy", value: caps.maxAnisotropy, fractionDigits: 0 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_2__.TextLineComponent, { label: "Driver", value: engine.extractDriverInfo() })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/tools/gltfComponent.js":
/*!*************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/tools/gltfComponent.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2619839__) => {

"use strict";
__nested_webpack_require_2619839__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2619839__.d(__nested_webpack_exports__, {
/* harmony export */   GLTFComponent: () => (/* binding */ GLTFComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2619839__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2619839__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2619839__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2619839__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2619839__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2619839__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var shared_ui_components_lines_messageLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2619839__(/*! shared-ui-components/lines/messageLineComponent */ "../../../dev/sharedUiComponents/dist/lines/messageLineComponent.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2619839__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2619839__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2619839__(/*! loaders/glTF/index */ "loaders/glTF/index");
/* harmony import */ var loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__nested_webpack_require_2619839__.n(loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8__);









// TODO - does it still work if loading the modules from the correct files?
// eslint-disable-next-line import/no-internal-modules

class GLTFComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._onValidationResultsUpdatedObserver = null;
        this.state = {
            showGLTFLoaderOptions: this.props.globalState.glTFLoaderOverrideConfig,
            showGLTFExtensionOptions: this.props.globalState.glTFLoaderOverrideExtensionsConfig,
        };
    }
    openValidationDetails() {
        const validationResults = this.props.globalState.validationResults;
        const win = window.open("", "_blank");
        if (win) {
            // TODO: format this better and use generator registry (https://github.com/KhronosGroup/glTF-Generator-Registry)
            win.document.title = "glTF Validation Results";
            win.document.body.innerText = JSON.stringify(validationResults, null, 2);
            win.document.body.style.whiteSpace = "pre";
            win.document.body.style.fontFamily = `monospace`;
            win.document.body.style.fontSize = `14px`;
            win.focus();
        }
    }
    prepareText(singularForm, count) {
        if (count) {
            return `${count} ${singularForm}s`;
        }
        return `${singularForm}`;
    }
    componentDidMount() {
        if (this.props.globalState) {
            this._onValidationResultsUpdatedObserver = this.props.globalState.onValidationResultsUpdatedObservable.add(() => {
                this.forceUpdate();
            });
        }
    }
    componentWillUnmount() {
        if (this.props.globalState) {
            if (this._onValidationResultsUpdatedObserver) {
                this.props.globalState.onValidationResultsUpdatedObservable.remove(this._onValidationResultsUpdatedObserver);
            }
        }
    }
    renderValidation() {
        const validationResults = this.props.globalState.validationResults;
        if (!validationResults) {
            return null;
        }
        const issues = validationResults.issues;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GLTF VALIDATION", closed: !issues.numErrors && !issues.numWarnings, selection: this.props.globalState, children: [issues.numErrors !== 0 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_messageLineComponent__WEBPACK_IMPORTED_MODULE_6__.MessageLineComponent, { text: "Your file has some validation issues", icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faTimesCircle, color: "Red" }), issues.numErrors === 0 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_messageLineComponent__WEBPACK_IMPORTED_MODULE_6__.MessageLineComponent, { text: "Your file is a valid glTF file", icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faCheck, color: "Green" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextLineComponent, { label: "Errors", value: issues.numErrors.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextLineComponent, { label: "Warnings", value: issues.numWarnings.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextLineComponent, { label: "Infos", value: issues.numInfos.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextLineComponent, { label: "Hints", value: issues.numHints.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextLineComponent, { label: "More details", value: "Click here", onLink: () => this.openValidationDetails() })] }));
    }
    render() {
        const extensionStates = this.props.globalState.glTFLoaderExtensionDefaults;
        const loaderState = this.props.globalState.glTFLoaderDefaults;
        const animationStartMode = typeof loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8__.GLTFLoaderAnimationStartMode !== "undefined"
            ? [
                { label: "None", value: loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8__.GLTFLoaderAnimationStartMode.NONE },
                { label: "First", value: loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8__.GLTFLoaderAnimationStartMode.FIRST },
                { label: "ALL", value: loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8__.GLTFLoaderAnimationStartMode.ALL },
            ]
            : [
                { label: "None", value: 0 },
                { label: "First", value: 1 },
                { label: "ALL", value: 2 },
            ];
        const coordinateSystemMode = typeof loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8__.GLTFLoaderCoordinateSystemMode !== "undefined"
            ? [
                { label: "Auto", value: loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8__.GLTFLoaderCoordinateSystemMode.AUTO },
                { label: "Right handed", value: loaders_glTF_index__WEBPACK_IMPORTED_MODULE_8__.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED },
            ]
            : [
                { label: "Auto", value: 0 },
                { label: "Right handed", value: 1 },
            ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GLTF LOADER", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Override glTF loader options", target: this.props.globalState, propertyName: "glTFLoaderOverrideConfig", onValueChanged: () => this.setState({ showGLTFLoaderOptions: this.props.globalState.glTFLoaderOverrideConfig }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_messageLineComponent__WEBPACK_IMPORTED_MODULE_6__.MessageLineComponent, { text: this.props.globalState.glTFLoaderOverrideConfig ? "Modify glTF loader overrides below" : "Toggle on glTF loader overrides to see and change options" }), this.state.showGLTFLoaderOptions && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Always compute bounding box", target: loaderState, propertyName: "alwaysComputeBoundingBox" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Always compute skeleton root node", target: loaderState, propertyName: "alwaysComputeSkeletonRootNode" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__.OptionsLine, { label: "Animation start mode", options: animationStartMode, target: loaderState, propertyName: "animationStartMode" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Capture performance counters", target: loaderState, propertyName: "capturePerformanceCounters" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Compile materials", target: loaderState, propertyName: "compileMaterials" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Compile shadow generators", target: loaderState, propertyName: "compileShadowGenerators" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_5__.OptionsLine, { label: "Coordinate system", options: coordinateSystemMode, target: loaderState, propertyName: "coordinateSystemMode" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Create instances", target: loaderState, propertyName: "createInstances" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Enable logging", target: loaderState, propertyName: "loggingEnabled" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Load all materials", target: loaderState, propertyName: "loadAllMaterials" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Target FPS", target: loaderState, propertyName: "targetFps", isInteger: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Transparency as coverage", target: loaderState, propertyName: "transparencyAsCoverage" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Use clip plane", target: loaderState, propertyName: "useClipPlane" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Use sRGB buffers", target: loaderState, propertyName: "useSRGBBuffers" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Validate", target: loaderState, propertyName: "validate" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_messageLineComponent__WEBPACK_IMPORTED_MODULE_6__.MessageLineComponent, { text: "You need to reload your file to see these changes" })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GLTF EXTENSIONS", closed: true, selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "Override glTF extension options", target: this.props.globalState, propertyName: "glTFLoaderOverrideExtensionsConfig", onValueChanged: () => this.setState({ showGLTFExtensionOptions: this.props.globalState.glTFLoaderOverrideExtensionsConfig }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_messageLineComponent__WEBPACK_IMPORTED_MODULE_6__.MessageLineComponent, { text: this.props.globalState.glTFLoaderOverrideExtensionsConfig
                                ? "Modify glTF extension overrides below"
                                : "Toggle on glTF extension overrides to see and change options" }), this.state.showGLTFExtensionOptions && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "EXT_lights_image_based", isSelected: () => extensionStates["EXT_lights_image_based"].enabled, onSelect: (value) => (extensionStates["EXT_lights_image_based"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "EXT_mesh_gpu_instancing", isSelected: () => extensionStates["EXT_mesh_gpu_instancing"].enabled, onSelect: (value) => (extensionStates["EXT_mesh_gpu_instancing"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "EXT_texture_webp", isSelected: () => extensionStates["EXT_texture_webp"].enabled, onSelect: (value) => (extensionStates["EXT_texture_webp"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "EXT_texture_avif", isSelected: () => extensionStates["EXT_texture_avif"].enabled, onSelect: (value) => (extensionStates["EXT_texture_avif"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_draco_mesh_compression", isSelected: () => extensionStates["KHR_draco_mesh_compression"].enabled, onSelect: (value) => (extensionStates["KHR_draco_mesh_compression"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_pbrSpecularGloss...", isSelected: () => extensionStates["KHR_materials_pbrSpecularGlossiness"].enabled, onSelect: (value) => (extensionStates["KHR_materials_pbrSpecularGlossiness"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_clearcoat", isSelected: () => extensionStates["KHR_materials_clearcoat"].enabled, onSelect: (value) => (extensionStates["KHR_materials_clearcoat"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_iridescence", isSelected: () => extensionStates["KHR_materials_iridescence"].enabled, onSelect: (value) => (extensionStates["KHR_materials_iridescence"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_anisotropy", isSelected: () => extensionStates["KHR_materials_anisotropy"].enabled, onSelect: (value) => (extensionStates["KHR_materials_anisotropy"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_emissive_strength", isSelected: () => extensionStates["KHR_materials_emissive_strength"].enabled, onSelect: (value) => (extensionStates["KHR_materials_emissive_strength"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_ior", isSelected: () => extensionStates["KHR_materials_ior"].enabled, onSelect: (value) => (extensionStates["KHR_materials_ior"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_sheen", isSelected: () => extensionStates["KHR_materials_sheen"].enabled, onSelect: (value) => (extensionStates["KHR_materials_sheen"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_specular", isSelected: () => extensionStates["KHR_materials_specular"].enabled, onSelect: (value) => (extensionStates["KHR_materials_specular"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_unlit", isSelected: () => extensionStates["KHR_materials_unlit"].enabled, onSelect: (value) => (extensionStates["KHR_materials_unlit"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_variants", isSelected: () => extensionStates["KHR_materials_variants"].enabled, onSelect: (value) => (extensionStates["KHR_materials_variants"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_transmission", isSelected: () => extensionStates["KHR_materials_transmission"].enabled, onSelect: (value) => (extensionStates["KHR_materials_transmission"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_diffuse_transmission", isSelected: () => extensionStates["KHR_materials_diffuse_transmission"].enabled, onSelect: (value) => (extensionStates["KHR_materials_diffuse_transmission"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_volume", isSelected: () => extensionStates["KHR_materials_volume"].enabled, onSelect: (value) => (extensionStates["KHR_materials_volume"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_materials_dispersion", isSelected: () => extensionStates["KHR_materials_dispersion"].enabled, onSelect: (value) => (extensionStates["KHR_materials_dispersion"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_mesh_quantization", isSelected: () => extensionStates["KHR_mesh_quantization"].enabled, onSelect: (value) => (extensionStates["KHR_mesh_quantization"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_lights_punctual", isSelected: () => extensionStates["KHR_lights_punctual"].enabled, onSelect: (value) => (extensionStates["KHR_lights_punctual"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_texture_basisu", isSelected: () => extensionStates["KHR_texture_basisu"].enabled, onSelect: (value) => (extensionStates["KHR_texture_basisu"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_texture_transform", isSelected: () => extensionStates["KHR_texture_transform"].enabled, onSelect: (value) => (extensionStates["KHR_texture_transform"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "KHR_xmp_json_ld", isSelected: () => extensionStates["KHR_xmp_json_ld"].enabled, onSelect: (value) => (extensionStates["KHR_xmp_json_ld"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "MSFT_lod", isSelected: () => extensionStates["MSFT_lod"].enabled, onSelect: (value) => (extensionStates["MSFT_lod"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Maximum LODs", target: extensionStates["MSFT_lod"], propertyName: "maxLODsToLoad", additionalClass: "gltf-extension-property", isInteger: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "MSFT_minecraftMesh", isSelected: () => extensionStates["MSFT_minecraftMesh"].enabled, onSelect: (value) => (extensionStates["MSFT_minecraftMesh"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "MSFT_sRGBFactors", isSelected: () => extensionStates["MSFT_sRGBFactors"].enabled, onSelect: (value) => (extensionStates["MSFT_sRGBFactors"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_3__.CheckBoxLineComponent, { label: "MSFT_audio_emitter", isSelected: () => extensionStates["MSFT_audio_emitter"].enabled, onSelect: (value) => (extensionStates["MSFT_audio_emitter"].enabled = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_messageLineComponent__WEBPACK_IMPORTED_MODULE_6__.MessageLineComponent, { text: "You need to reload your file to see these changes" })] }))] }), this.props.globalState.validationResults && this.renderValidation()] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/toolsTabComponent.js":
/*!***********************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/toolsTabComponent.js ***!
  \***********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2645140__) => {

"use strict";
__nested_webpack_require_2645140__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2645140__.d(__nested_webpack_exports__, {
/* harmony export */   ToolsTabComponent: () => (/* binding */ ToolsTabComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2645140__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _paneComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2645140__(/*! ../paneComponent */ "../../../dev/inspector/dist/components/actionTabs/paneComponent.js");
/* harmony import */ var shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/buttonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js");
/* harmony import */ var core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2645140__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_2645140__.n(core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _tools_gltfComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2645140__(/*! ./tools/gltfComponent */ "../../../dev/inspector/dist/components/actionTabs/tabs/tools/gltfComponent.js");
/* harmony import */ var serializers_glTF_2_0_index__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2645140__(/*! serializers/glTF/2.0/index */ "serializers/glTF/2.0/index");
/* harmony import */ var serializers_glTF_2_0_index__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_2645140__.n(serializers_glTF_2_0_index__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var shared_ui_components_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/numericInputComponent */ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js");
/* harmony import */ var shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var shared_ui_components_lines_fileMultipleButtonLineComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/fileMultipleButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileMultipleButtonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var shared_ui_components_lines_messageLineComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/messageLineComponent */ "../../../dev/sharedUiComponents/dist/lines/messageLineComponent.js");
/* harmony import */ var shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/fileButtonLineComponent */ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js");
/* harmony import */ var shared_ui_components_lines_indentedTextLineComponent__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/indentedTextLineComponent */ "../../../dev/sharedUiComponents/dist/lines/indentedTextLineComponent.js");
/* harmony import */ var shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_2645140__(/*! shared-ui-components/lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_2645140__(/*! shared-ui-components/tabs/propertyGrids/lockObject */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js");
/* harmony import */ var gif_js_optimized__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_2645140__(/*! gif.js.optimized */ "../../../../node_modules/gif.js.optimized/dist/gif.js");
/* harmony import */ var gif_js_optimized__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__nested_webpack_require_2645140__.n(gif_js_optimized__WEBPACK_IMPORTED_MODULE_18__);
/* harmony import */ var loaders_glTF_glTFFileLoader__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_2645140__(/*! loaders/glTF/glTFFileLoader */ "loaders/glTF/index");
/* harmony import */ var loaders_glTF_glTFFileLoader__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__nested_webpack_require_2645140__.n(loaders_glTF_glTFFileLoader__WEBPACK_IMPORTED_MODULE_19__);
































const envExportImageTypes = [
    { label: "PNG", value: 0, imageType: "image/png" },
    { label: "WebP", value: 1, imageType: "image/webp" },
];
class ToolsTabComponent extends _paneComponent__WEBPACK_IMPORTED_MODULE_1__.PaneComponent {
    constructor(props) {
        super(props);
        this._lockObject = new shared_ui_components_tabs_propertyGrids_lockObject__WEBPACK_IMPORTED_MODULE_17__.LockObject();
        this._screenShotSize = { precision: 1 };
        this._gifOptions = { width: 512, frequency: 200 };
        this._useWidthHeight = false;
        this._isExportingGltf = false;
        this._gltfExportOptions = { exportDisabledNodes: false, exportSkyboxes: false, exportCameras: false, exportLights: false };
        this._crunchingGIF = false;
        this._reflectorHostname = "localhost";
        this._reflectorPort = 1234;
        this._envOptions = { imageTypeIndex: 0, imageQuality: 0.8 };
        this.state = { tag: "Record video" };
        const sceneImportDefaults = this.props.globalState.sceneImportDefaults;
        if (sceneImportDefaults["overwriteAnimations"] === undefined) {
            sceneImportDefaults["overwriteAnimations"] = true;
        }
        if (sceneImportDefaults["animationGroupLoadingMode"] === undefined) {
            sceneImportDefaults["animationGroupLoadingMode"] = 0 /* SceneLoaderAnimationGroupLoadingMode.Clean */;
        }
    }
    componentDidMount() {
        if (!serializers_glTF_2_0_index__WEBPACK_IMPORTED_MODULE_6__.GLTF2Export) {
            core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Tools.Warn("GLTF2Export is not available. Make sure to load the serializers library");
            return;
        }
    }
    componentWillUnmount() {
        if (this._videoRecorder) {
            this._videoRecorder.stopRecording();
            this._videoRecorder.dispose();
            this._videoRecorder = null;
        }
        if (this._gifRecorder) {
            this._gifRecorder.render();
            this._gifRecorder = null;
            return;
        }
    }
    captureScreenshot() {
        const scene = this.props.scene;
        if (scene.activeCamera) {
            core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Tools.CreateScreenshot(scene.getEngine(), scene.activeCamera, this._screenShotSize);
        }
    }
    captureEquirectangular() {
        const scene = this.props.scene;
        if (scene.activeCamera) {
            (0,core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.captureEquirectangularFromScene)(scene, { size: 1024, filename: "equirectangular_capture.png" });
        }
    }
    captureRender() {
        const scene = this.props.scene;
        const oldScreenshotSize = {
            height: this._screenShotSize.height,
            width: this._screenShotSize.width,
            precision: this._screenShotSize.precision,
        };
        if (!this._useWidthHeight) {
            this._screenShotSize.width = undefined;
            this._screenShotSize.height = undefined;
        }
        if (scene.activeCamera) {
            core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Tools.CreateScreenshotUsingRenderTarget(scene.getEngine(), scene.activeCamera, this._screenShotSize, undefined, undefined, 4);
        }
        this._screenShotSize = oldScreenshotSize;
    }
    recordVideo() {
        if (this._videoRecorder && this._videoRecorder.isRecording) {
            this._videoRecorder.stopRecording();
            return;
        }
        const scene = this.props.scene;
        if (!this._videoRecorder) {
            this._videoRecorder = new core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.VideoRecorder(scene.getEngine());
        }
        this._videoRecorder.startRecording().then(() => {
            this.setState({ tag: "Record video" });
        });
        this.setState({ tag: "Stop recording" });
    }
    recordGIFInternal() {
        const workerUrl = URL.createObjectURL(this._gifWorkerBlob);
        this._gifRecorder = new (gif_js_optimized__WEBPACK_IMPORTED_MODULE_18___default())({
            workers: 2,
            quality: 10,
            workerScript: workerUrl,
        });
        const scene = this.props.scene;
        const engine = scene.getEngine();
        this._previousRenderingScale = engine.getHardwareScalingLevel();
        engine.setHardwareScalingLevel(engine.getRenderWidth() / this._gifOptions.width ?? 1);
        const intervalId = setInterval(() => {
            if (!this._gifRecorder) {
                clearInterval(intervalId);
                return;
            }
            this._gifRecorder.addFrame(engine.getRenderingCanvas(), { delay: 0, copy: true });
        }, this._gifOptions.frequency);
        this._gifRecorder.on("finished", (blob) => {
            this._crunchingGIF = false;
            core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Tools.Download(blob, "record.gif");
            this.forceUpdate();
            URL.revokeObjectURL(workerUrl);
            engine.setHardwareScalingLevel(this._previousRenderingScale);
        });
        this.forceUpdate();
    }
    recordGIF() {
        if (this._gifRecorder) {
            this._crunchingGIF = true;
            this.forceUpdate();
            this._gifRecorder.render();
            this._gifRecorder = null;
            return;
        }
        if (this._gifWorkerBlob) {
            this.recordGIFInternal();
            return;
        }
        core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Tools.LoadFileAsync("https://cdn.jsdelivr.net/gh//terikon/gif.js.optimized@0.1.6/dist/gif.worker.js").then((value) => {
            this._gifWorkerBlob = new Blob([value], {
                type: "application/javascript",
            });
            this.recordGIFInternal();
        });
    }
    importAnimations(event) {
        const scene = this.props.scene;
        const overwriteAnimations = this.props.globalState.sceneImportDefaults["overwriteAnimations"];
        const animationGroupLoadingMode = this.props.globalState.sceneImportDefaults["animationGroupLoadingMode"];
        const reload = function (sceneFile) {
            // If a scene file has been provided
            if (sceneFile) {
                const onSuccess = function (scene) {
                    if (scene.animationGroups.length > 0) {
                        const currentGroup = scene.animationGroups[0];
                        currentGroup.play(true);
                    }
                };
                core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.SceneLoader.ImportAnimationsAsync("file:", sceneFile, scene, overwriteAnimations, animationGroupLoadingMode, null, onSuccess);
            }
        };
        const filesInputAnimation = new core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.FilesInput(scene.getEngine(), scene, () => { }, () => { }, () => { }, () => { }, () => { }, reload, () => { });
        filesInputAnimation.loadFiles(event);
    }
    exportGLTF() {
        const scene = this.props.scene;
        this._isExportingGltf = true;
        this.forceUpdate();
        const shouldExport = (node) => {
            if (!this._gltfExportOptions.exportDisabledNodes) {
                if (!node.isEnabled()) {
                    return false;
                }
            }
            if (!this._gltfExportOptions.exportSkyboxes) {
                if (node instanceof core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Mesh) {
                    if (node.material) {
                        const material = node.material;
                        const reflectionTexture = material.reflectionTexture;
                        if (reflectionTexture && reflectionTexture.coordinatesMode === core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Texture.SKYBOX_MODE) {
                            return false;
                        }
                    }
                }
            }
            if (!this._gltfExportOptions.exportCameras) {
                if (node instanceof core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Camera) {
                    return false;
                }
            }
            if (!this._gltfExportOptions.exportLights) {
                if (node instanceof core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Light) {
                    return false;
                }
            }
            return true;
        };
        serializers_glTF_2_0_index__WEBPACK_IMPORTED_MODULE_6__.GLTF2Export.GLBAsync(scene, "scene", { shouldExportNode: (node) => shouldExport(node) }).then((glb) => {
            this._isExportingGltf = false;
            this.forceUpdate();
            glb.downloadFiles();
        }, () => {
            this._isExportingGltf = false;
            this.forceUpdate();
        });
    }
    exportBabylon() {
        const scene = this.props.scene;
        const strScene = JSON.stringify(core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.SceneSerializer.Serialize(scene));
        const blob = new Blob([strScene], { type: "octet/stream" });
        core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Tools.Download(blob, "scene.babylon");
    }
    createEnvTexture() {
        const scene = this.props.scene;
        core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.EnvironmentTextureTools.CreateEnvTextureAsync(scene.environmentTexture, {
            imageType: envExportImageTypes[this._envOptions.imageTypeIndex].imageType,
            imageQuality: this._envOptions.imageQuality,
        })
            .then((buffer) => {
            const blob = new Blob([buffer], { type: "octet/stream" });
            core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Tools.Download(blob, "environment.env");
        })
            .catch((error) => {
            core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Logger.Error(error);
            alert(error);
        });
    }
    exportReplay() {
        this.props.globalState.recorder.export();
        this.forceUpdate();
    }
    startRecording() {
        this.props.globalState.recorder.trackScene(this.props.scene);
        this.forceUpdate();
    }
    applyDelta(file) {
        core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Tools.ReadFile(file, (data) => {
            this.props.globalState.recorder.applyDelta(data, this.props.scene);
            this.forceUpdate();
        });
    }
    connectReflector() {
        if (this._reflector) {
            this._reflector.close();
        }
        this._reflector = new core_Misc_videoRecorder__WEBPACK_IMPORTED_MODULE_4__.Reflector(this.props.scene, this._reflectorHostname, this._reflectorPort);
    }
    render() {
        const scene = this.props.scene;
        if (!scene) {
            return null;
        }
        const sceneImportDefaults = this.props.globalState.sceneImportDefaults;
        const animationGroupLoadingModes = [
            { label: "Clean", value: 0 /* SceneLoaderAnimationGroupLoadingMode.Clean */ },
            { label: "Stop", value: 1 /* SceneLoaderAnimationGroupLoadingMode.Stop */ },
            { label: "Sync", value: 2 /* SceneLoaderAnimationGroupLoadingMode.Sync */ },
            { label: "NoSync", value: 3 /* SceneLoaderAnimationGroupLoadingMode.NoSync */ },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pane", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "CAPTURE", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Screenshot", onClick: () => this.captureScreenshot() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Generate equirectangular capture", onClick: () => this.captureEquirectangular() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: this.state.tag, onClick: () => this.recordVideo() })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "CAPTURE WITH RTT", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Capture", onClick: () => this.captureRender() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "vector3Line", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this._lockObject, label: "Precision", target: this._screenShotSize, propertyName: "precision", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__.CheckBoxLineComponent, { label: "Use Width/Height", onSelect: (value) => {
                                        this._useWidthHeight = value;
                                        this.forceUpdate();
                                    }, isSelected: () => this._useWidthHeight }), this._useWidthHeight && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_8__.NumericInput, { lockObject: this._lockObject, label: "Width", precision: 0, step: 1, value: this._screenShotSize.width ? this._screenShotSize.width : 512, onChange: (value) => (this._screenShotSize.width = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_8__.NumericInput, { lockObject: this._lockObject, label: "Height", precision: 0, step: 1, value: this._screenShotSize.height ? this._screenShotSize.height : 512, onChange: (value) => (this._screenShotSize.height = value) })] }))] })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GIF", selection: this.props.globalState, children: [this._crunchingGIF && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_messageLineComponent__WEBPACK_IMPORTED_MODULE_13__.MessageLineComponent, { text: "Creating the GIF file..." }), !this._crunchingGIF && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: this._gifRecorder ? "Stop" : "Record", onClick: () => this.recordGIF() }), !this._crunchingGIF && !this._gifRecorder && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this._lockObject, label: "Resolution", isInteger: true, target: this._gifOptions, propertyName: "width" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this._lockObject, label: "Frequency (ms)", isInteger: true, target: this._gifOptions, propertyName: "frequency" })] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "REPLAY", selection: this.props.globalState, children: [!this.props.globalState.recorder.isRecording && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Start recording", onClick: () => this.startRecording() }), this.props.globalState.recorder.isRecording && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_indentedTextLineComponent__WEBPACK_IMPORTED_MODULE_15__.IndentedTextLineComponent, { value: "Record in progress" }), this.props.globalState.recorder.isRecording && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Generate delta file", onClick: () => this.exportReplay() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_14__.FileButtonLine, { label: `Apply delta file`, onClick: (file) => this.applyDelta(file), accept: ".json" })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SCENE IMPORT", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_fileMultipleButtonLineComponent__WEBPACK_IMPORTED_MODULE_11__.FileMultipleButtonLineComponent, { label: "Import animations", accept: "gltf", onClick: (evt) => this.importAnimations(evt) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__.CheckBoxLineComponent, { label: "Overwrite animations", target: sceneImportDefaults, propertyName: "overwriteAnimations", onSelect: (value) => {
                                sceneImportDefaults["overwriteAnimations"] = value;
                                this.forceUpdate();
                            } }), sceneImportDefaults["overwriteAnimations"] === false && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_12__.OptionsLine, { label: "Animation merge mode", options: animationGroupLoadingModes, target: sceneImportDefaults, propertyName: "animationGroupLoadingMode" }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SCENE EXPORT", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Export to Babylon", onClick: () => this.exportBabylon() }), !scene.getEngine().premultipliedAlpha && scene.environmentTexture && scene.environmentTexture._prefiltered && scene.activeCamera && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Generate .env texture", onClick: () => this.createEnvTexture() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_12__.OptionsLine, { label: "Image type", options: envExportImageTypes, target: this._envOptions, propertyName: "imageTypeIndex", onSelect: () => {
                                        this.forceUpdate();
                                    } }), this._envOptions.imageTypeIndex > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this._lockObject, label: "Quality", isInteger: false, min: 0, max: 1, target: this._envOptions, propertyName: "imageQuality" }))] }))] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GLTF EXPORT", selection: this.props.globalState, children: [this._isExportingGltf && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_10__.TextLineComponent, { label: "Please wait..exporting", ignoreValue: true }), !this._isExportingGltf && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__.CheckBoxLineComponent, { label: "Export Disabled Nodes", isSelected: () => this._gltfExportOptions.exportDisabledNodes, onSelect: (value) => (this._gltfExportOptions.exportDisabledNodes = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__.CheckBoxLineComponent, { label: "Export Skybox", isSelected: () => this._gltfExportOptions.exportSkyboxes, onSelect: (value) => (this._gltfExportOptions.exportSkyboxes = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__.CheckBoxLineComponent, { label: "Export Cameras", isSelected: () => this._gltfExportOptions.exportCameras, onSelect: (value) => (this._gltfExportOptions.exportCameras = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_9__.CheckBoxLineComponent, { label: "Export Lights", isSelected: () => this._gltfExportOptions.exportLights, onSelect: (value) => (this._gltfExportOptions.exportLights = value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Export to GLB", onClick: () => this.exportGLTF() })] }))] }), loaders_glTF_glTFFileLoader__WEBPACK_IMPORTED_MODULE_19__.GLTFFileLoader && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tools_gltfComponent__WEBPACK_IMPORTED_MODULE_5__.GLTFComponent, { lockObject: this._lockObject, scene: scene, globalState: this.props.globalState }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(shared_ui_components_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "REFLECTOR", selection: this.props.globalState, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_16__.TextInputLineComponent, { lockObject: this._lockObject, label: "Hostname", target: this, propertyName: "_reflectorHostname" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this._lockObject, label: "Port", target: this, propertyName: "_reflectorPort", isInteger: true }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(shared_ui_components_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__.ButtonLineComponent, { label: "Connect", onClick: () => this.connectReflector() })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabsComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabsComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2674475__) => {

"use strict";
__nested_webpack_require_2674475__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2674475__.d(__nested_webpack_exports__, {
/* harmony export */   TabsComponent: () => (/* binding */ TabsComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2674475__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2674475__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2674475__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");



class TabsComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onSelect(index) {
        this.props.onSelectedIndexChange(index);
    }
    renderLabel(child, index) {
        const activeClass = this.props.selectedIndex === index ? "label active" : "label";
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: activeClass, onClick: () => this.onSelect(index), title: child.props.title, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: child.props.icon }) }) }, index));
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "tabsMenu", onContextMenu: (e) => e.preventDefault(), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "labels", children: this.props.children.map((child, index) => {
                        return this.renderLabel(child, index);
                    }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "panes", children: this.props.children[this.props.selectedIndex] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/embedHost/embedHostComponent.js":
/*!******************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/embedHost/embedHostComponent.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2676969__) => {

"use strict";
__nested_webpack_require_2676969__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2676969__.d(__nested_webpack_exports__, {
/* harmony export */   EmbedHostComponent: () => (/* binding */ EmbedHostComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2676969__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2676969__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _headerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2676969__(/*! ../headerComponent */ "../../../dev/inspector/dist/components/headerComponent.js");
/* harmony import */ var re_resizable__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2676969__(/*! re-resizable */ "../../../../node_modules/re-resizable/lib/index.js");
/* harmony import */ var _sceneExplorer_sceneExplorerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2676969__(/*! ../sceneExplorer/sceneExplorerComponent */ "../../../dev/inspector/dist/components/sceneExplorer/sceneExplorerComponent.js");
/* harmony import */ var _actionTabs_actionTabsComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2676969__(/*! ../actionTabs/actionTabsComponent */ "../../../dev/inspector/dist/components/actionTabs/actionTabsComponent.js");
/* harmony import */ var split_js__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2676969__(/*! split.js */ "../../../../node_modules/split.js/dist/split.es.js");
/* harmony import */ var _embedHost_scss__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2676969__(/*! ./embedHost.scss */ "../../../dev/inspector/dist/components/embedHost/embedHost.scss");







const ResizableCasted = re_resizable__WEBPACK_IMPORTED_MODULE_3__.Resizable;

class EmbedHostComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._once = true;
        this._splitRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._topPartRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._bottomPartRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    componentDidMount() {
        const container = this._splitRef.current;
        if (!container) {
            return;
        }
        (0,split_js__WEBPACK_IMPORTED_MODULE_6__["default"])([this._topPartRef.current, this._bottomPartRef.current], {
            direction: "vertical",
            minSize: [200, 200],
            gutterSize: 4,
        });
    }
    renderContent() {
        if (this.props.popupMode) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "split", className: "splitPopup", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "topPart", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_sceneExplorer_sceneExplorerComponent__WEBPACK_IMPORTED_MODULE_4__.SceneExplorerComponent, { scene: this.props.scene, extensibilityGroups: this.props.extensibilityGroups, additionalNodes: this.props.additionalNodes, popupMode: true, globalState: this.props.globalState, noHeader: true }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "separator" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "bottomPart", style: { marginTop: "4px", overflow: "hidden" }, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_actionTabs_actionTabsComponent__WEBPACK_IMPORTED_MODULE_5__.ActionTabsComponent, { scene: this.props.scene, popupMode: true, globalState: this.props.globalState, noHeader: true, initialTab: this.props.initialTab }) })] }));
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { ref: this._splitRef, id: "split", className: "noPopup", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "topPart", ref: this._topPartRef, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_sceneExplorer_sceneExplorerComponent__WEBPACK_IMPORTED_MODULE_4__.SceneExplorerComponent, { scene: this.props.scene, extensibilityGroups: this.props.extensibilityGroups, additionalNodes: this.props.additionalNodes, globalState: this.props.globalState, popupMode: true, noHeader: true }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "bottomPart", ref: this._bottomPartRef, style: { marginTop: "4px", overflow: "hidden" }, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_actionTabs_actionTabsComponent__WEBPACK_IMPORTED_MODULE_5__.ActionTabsComponent, { scene: this.props.scene, globalState: this.props.globalState, popupMode: true, noHeader: true, initialTab: this.props.initialTab }) })] }));
    }
    render() {
        if (this.props.popupMode) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "embed", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_headerComponent__WEBPACK_IMPORTED_MODULE_2__.HeaderComponent, { title: "INSPECTOR", noClose: this.props.noClose, noExpand: this.props.noExpand, handleBack: true, onClose: () => this.props.onClose(), onPopup: () => this.props.onPopup(), onSelectionChangedObservable: this.props.globalState.onSelectionChangedObservable }), this.renderContent()] }));
        }
        if (this._once) {
            this._once = false;
            // A bit hacky but no other way to force the initial width to 300px and not auto
            setTimeout(() => {
                const element = document.getElementById("embed");
                if (!element) {
                    return;
                }
                element.style.width = "300px";
            }, 150);
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ResizableCasted, { id: "embed", minWidth: 300, maxWidth: 600, defaultSize: { height: "100%" }, minHeight: "100%", enable: { top: false, right: false, bottom: false, left: true, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_headerComponent__WEBPACK_IMPORTED_MODULE_2__.HeaderComponent, { title: "INSPECTOR", noClose: this.props.noClose, noExpand: this.props.noExpand, handleBack: true, onClose: () => this.props.onClose(), onPopup: () => this.props.onPopup(), onSelectionChangedObservable: this.props.globalState.onSelectionChangedObservable }), this.renderContent()] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/globalState.js":
/*!*************************************************************!*\
  !*** ../../../dev/inspector/dist/components/globalState.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2683787__) => {

"use strict";
__nested_webpack_require_2683787__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2683787__.d(__nested_webpack_exports__, {
/* harmony export */   GlobalState: () => (/* binding */ GlobalState)
/* harmony export */ });
/* harmony import */ var loaders_glTF_index__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2683787__(/*! loaders/glTF/index */ "loaders/glTF/index");
/* harmony import */ var loaders_glTF_index__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2683787__.n(loaders_glTF_index__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2683787__(/*! core/Misc/dataStorage */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2683787__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _replayRecorder__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2683787__(/*! ./replayRecorder */ "../../../dev/inspector/dist/components/replayRecorder.js");
/* eslint-disable @typescript-eslint/naming-convention */
// eslint-disable-next-line import/no-internal-modules






class GlobalState {
    constructor() {
        this.onInspectorClosedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        this.onTabChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        this.onSelectionRenamedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        this.onNewSceneObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        this.sceneImportDefaults = {};
        this.validationResults = null;
        this.onValidationResultsUpdatedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        this.glTFLoaderOverrideExtensionsConfig = false;
        this.glTFLoaderExtensionDefaults = {
            MSFT_lod: { enabled: true, maxLODsToLoad: 10 },
            MSFT_minecraftMesh: { enabled: true },
            MSFT_sRGBFactors: { enabled: true },
            MSFT_audio_emitter: { enabled: true },
            KHR_xmp_json_ld: { enabled: true },
            KHR_draco_mesh_compression: { enabled: true },
            KHR_mesh_quantization: { enabled: true },
            KHR_materials_pbrSpecularGlossiness: { enabled: true },
            KHR_materials_clearcoat: { enabled: true },
            KHR_materials_iridescence: { enabled: true },
            KHR_materials_anisotropy: { enabled: true },
            KHR_materials_emissive_strength: { enabled: true },
            KHR_materials_ior: { enabled: true },
            KHR_materials_sheen: { enabled: true },
            KHR_materials_specular: { enabled: true },
            KHR_materials_unlit: { enabled: true },
            KHR_materials_variants: { enabled: true },
            KHR_materials_transmission: { enabled: true },
            KHR_materials_diffuse_transmission: { enabled: true },
            KHR_materials_volume: { enabled: true },
            KHR_materials_dispersion: { enabled: true },
            KHR_lights_punctual: { enabled: true },
            KHR_texture_basisu: { enabled: true },
            KHR_texture_transform: { enabled: true },
            EXT_lights_image_based: { enabled: true },
            EXT_mesh_gpu_instancing: { enabled: true },
            EXT_texture_webp: { enabled: true },
            EXT_texture_avif: { enabled: true },
        };
        this.glTFLoaderOverrideConfig = false;
        this.glTFLoaderDefaults = {
            alwaysComputeBoundingBox: false,
            alwaysComputeSkeletonRootNode: false,
            animationStartMode: typeof loaders_glTF_index__WEBPACK_IMPORTED_MODULE_0__.GLTFLoaderAnimationStartMode !== "undefined" ? loaders_glTF_index__WEBPACK_IMPORTED_MODULE_0__.GLTFLoaderAnimationStartMode.FIRST : 1,
            capturePerformanceCounters: false,
            compileMaterials: false,
            compileShadowGenerators: false,
            coordinateSystemMode: typeof loaders_glTF_index__WEBPACK_IMPORTED_MODULE_0__.GLTFLoaderCoordinateSystemMode !== "undefined" ? loaders_glTF_index__WEBPACK_IMPORTED_MODULE_0__.GLTFLoaderCoordinateSystemMode.AUTO : 0,
            createInstances: true,
            loadAllMaterials: false,
            loggingEnabled: false,
            targetFps: 60,
            transparencyAsCoverage: false,
            useClipPlane: false,
            useSRGBBuffers: true,
        };
        this.glTFLoaderExtensions = {};
        this.blockMutationUpdates = false;
        this.selectedLineContainerTitles = [];
        this.selectedLineContainerTitlesNoFocus = [];
        this.recorder = new _replayRecorder__WEBPACK_IMPORTED_MODULE_2__.ReplayRecorder();
        this._onlyUseEulers = null;
        this._ignoreBackfacesForPicking = null;
        // Light gizmos
        this.lightGizmos = [];
        // Camera gizmos
        this.cameraGizmos = [];
        this.onSceneExplorerClosedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        this.onActionTabsClosedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
    }
    get onlyUseEulers() {
        if (this._onlyUseEulers === null) {
            this._onlyUseEulers = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.DataStorage.ReadBoolean("settings_onlyUseEulers", true);
        }
        return this._onlyUseEulers;
    }
    set onlyUseEulers(value) {
        this._onlyUseEulers = value;
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteBoolean("settings_onlyUseEulers", value);
    }
    get ignoreBackfacesForPicking() {
        if (this._ignoreBackfacesForPicking === null) {
            this._ignoreBackfacesForPicking = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.DataStorage.ReadBoolean("settings_ignoreBackfacesForPicking", false);
        }
        return this._ignoreBackfacesForPicking;
    }
    set ignoreBackfacesForPicking(value) {
        this._ignoreBackfacesForPicking = value;
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.DataStorage.WriteBoolean("settings_ignoreBackfacesForPicking", value);
    }
    init(propertyChangedObservable) {
        this.onPropertyChangedObservable = propertyChangedObservable;
        this.onNewSceneObservable.add(() => {
            this.recorder.cancel();
        });
    }
    prepareGLTFPlugin(loader) {
        this.glTFLoaderExtensions = {};
        if (this.glTFLoaderOverrideConfig) {
            const loaderState = this.glTFLoaderDefaults;
            if (loaderState !== undefined) {
                for (const key in loaderState) {
                    loader[key] = loaderState[key];
                }
            }
        }
        loader.onExtensionLoadedObservable.add((extension) => {
            if (this.glTFLoaderOverrideExtensionsConfig) {
                const extensionState = this.glTFLoaderExtensionDefaults[extension.name];
                if (extensionState !== undefined) {
                    for (const key in extensionState) {
                        extension[key] = extensionState[key];
                    }
                }
            }
            this.glTFLoaderExtensions[extension.name] = extension;
        });
        loader.onValidatedObservable.add((results) => {
            this.validationResults = results;
            this.onValidationResultsUpdatedObservable.notifyObservers(results);
            if (results.issues.numErrors || results.issues.numWarnings) {
                this.selectedLineContainerTitlesNoFocus.push("GLTF VALIDATION");
                this.onTabChangedObservable.notifyObservers(3);
            }
        });
    }
    resetGLTFValidationResults() {
        if (this.validationResults) {
            this.validationResults = null;
            this.onValidationResultsUpdatedObservable.notifyObservers(null);
        }
    }
    enableLightGizmo(light, enable = true, gizmoCamera = null) {
        if (enable) {
            if (!light.reservedDataStore) {
                light.reservedDataStore = {};
            }
            if (!light.reservedDataStore.lightGizmo) {
                light.reservedDataStore.lightGizmo = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.LightGizmo();
                this.lightGizmos.push(light.reservedDataStore.lightGizmo);
                light.reservedDataStore.lightGizmo.light = light;
                light.reservedDataStore.lightGizmo.material.reservedDataStore = { hidden: true };
                if (gizmoCamera) {
                    light.reservedDataStore.lightGizmo.gizmoLayer.setRenderCamera(gizmoCamera);
                }
            }
        }
        else if (light.reservedDataStore && light.reservedDataStore.lightGizmo) {
            this.lightGizmos.splice(this.lightGizmos.indexOf(light.reservedDataStore.lightGizmo), 1);
            light.reservedDataStore.lightGizmo.dispose();
            light.reservedDataStore.lightGizmo = null;
        }
    }
    enableCameraGizmo(camera, enable = true, gizmoCamera = null) {
        if (enable) {
            if (!camera.reservedDataStore) {
                camera.reservedDataStore = {};
            }
            if (!camera.reservedDataStore.cameraGizmo) {
                camera.reservedDataStore.cameraGizmo = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.CameraGizmo();
                this.cameraGizmos.push(camera.reservedDataStore.cameraGizmo);
                camera.reservedDataStore.cameraGizmo.camera = camera;
                camera.reservedDataStore.cameraGizmo.material.reservedDataStore = { hidden: true };
                if (gizmoCamera) {
                    camera.reservedDataStore.cameraGizmo.gizmoLayer.setRenderCamera(gizmoCamera);
                }
            }
        }
        else if (camera.reservedDataStore && camera.reservedDataStore.cameraGizmo) {
            this.cameraGizmos.splice(this.cameraGizmos.indexOf(camera.reservedDataStore.cameraGizmo), 1);
            camera.reservedDataStore.cameraGizmo.dispose();
            camera.reservedDataStore.cameraGizmo = null;
        }
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/graph/canvasGraphComponent.js":
/*!****************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/graph/canvasGraphComponent.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2694342__) => {

"use strict";
__nested_webpack_require_2694342__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2694342__.d(__nested_webpack_exports__, {
/* harmony export */   CanvasGraphComponent: () => (/* binding */ CanvasGraphComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2694342__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2694342__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _canvasGraphService__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2694342__(/*! ./canvasGraphService */ "../../../dev/inspector/dist/components/graph/canvasGraphService.js");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2694342__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_2694342__.n(core_Misc_logger__WEBPACK_IMPORTED_MODULE_3__);




const CanvasGraphComponent = (props) => {
    const { id, collector, scene, layoutObservable, returnToPlayheadObservable, onVisibleRangeChangedObservable, initialGraphSize } = props;
    const canvasRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
        if (!canvasRef.current) {
            return;
        }
        if (initialGraphSize) {
            canvasRef.current.width = initialGraphSize.width;
            canvasRef.current.height = initialGraphSize.height;
        }
        let cs;
        try {
            cs = new _canvasGraphService__WEBPACK_IMPORTED_MODULE_2__.CanvasGraphService(canvasRef.current, { datasets: collector.datasets, onVisibleRangeChangedObservable });
        }
        catch (error) {
            core_Misc_logger__WEBPACK_IMPORTED_MODULE_3__.Logger.Error(error);
            return;
        }
        const layoutUpdated = (newSize) => {
            if (!canvasRef.current) {
                return;
            }
            const { left, top } = canvasRef.current.getBoundingClientRect();
            newSize.width = newSize.width - left;
            newSize.height = newSize.height - top;
            cs?.resize(newSize);
        };
        const dataUpdated = () => {
            cs?.update();
        };
        const metaUpdated = (meta) => {
            if (!cs) {
                return;
            }
            cs.metadata = meta;
            cs.update();
        };
        const resetDataPosition = () => {
            cs?.resetDataPosition();
        };
        scene.onAfterRenderObservable.add(dataUpdated);
        collector.metadataObservable.add(metaUpdated);
        layoutObservable?.add(layoutUpdated);
        returnToPlayheadObservable?.add(resetDataPosition);
        return () => {
            cs?.destroy();
            layoutObservable?.removeCallback(layoutUpdated);
            scene.onAfterRenderObservable.removeCallback(dataUpdated);
            collector.metadataObservable.removeCallback(metaUpdated);
        };
    }, [canvasRef]);
    return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("canvas", { id: id, ref: canvasRef });
};


/***/ }),

/***/ "../../../dev/inspector/dist/components/graph/canvasGraphService.js":
/*!**************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/graph/canvasGraphService.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2697985__) => {

"use strict";
__nested_webpack_require_2697985__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2697985__.d(__nested_webpack_exports__, {
/* harmony export */   CanvasGraphService: () => (/* binding */ CanvasGraphService)
/* harmony export */ });
/* harmony import */ var _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2697985__(/*! ./graphSupportingTypes */ "../../../dev/inspector/dist/components/graph/graphSupportingTypes.js");
/* harmony import */ var core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2697985__(/*! core/Misc/PerformanceViewer/performanceViewerCollector */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2697985__.n(core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__);



const defaultColor = "#000";
const axisColor = "#c0c4c8";
const futureBoxColor = "#dfe9ed";
const dividerColor = "#0a3066";
const playheadColor = "#b9dbef";
const positionIndicatorColor = "#4d5960";
const tooltipBackgroundColor = "#566268";
const tooltipForegroundColor = "#fbfbfb";
const topOfGraphY = 0;
const defaultAlpha = 1;
const tooltipBackgroundAlpha = 0.8;
const backgroundLineAlpha = 0.2;
const maxDistanceForHover = 10;
const tooltipHorizontalPadding = 10;
const spaceBetweenTextAndBox = 5;
const tooltipPaddingFromBottom = 20;
// height of indicator triangle
const triangleHeight = 10;
// width of indicator triangle
const triangleWidth = 20;
// padding to indicate how far below the axis line the triangle should be.
const trianglePaddingFromAxisLine = 3;
const tickerHorizontalPadding = 10;
// pixels to pad the top and bottom of data so that it doesn't get cut off by the margins.
const dataPadding = 2;
const playheadSize = 8;
const dividerSize = 2;
const axisLineLength = 10;
const axisPadding = 10;
// Currently the scale factor is a constant but when we add panning this may become formula based.
const scaleFactor = 0.8;
// This controls the scale factor at which we stop drawing the playhead. Below this value there tends to be flickering of the playhead as data comes in.
const stopDrawingPlayheadThreshold = 0.95;
// Threshold for the ratio at which we go from panning mode to live mode.
const returnToLiveThreshold = 0.998;
// Font to use on the addons such as tooltips and tickers!
const graphAddonFont = "12px Arial";
// A string containing the alphabet, used in line height calculation for the font.
const alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
// Arbitrary maximum used to make some GC optimizations.
const maximumDatasetsAllowed = 64;
const msInSecond = 1000;
const msInMinute = msInSecond * 60;
const msInHour = msInMinute * 60;
// time in ms to wait between tooltip draws inside the mouse move.
const tooltipDebounceTime = 32;
// time in ms to wait between draws
const drawThrottleTime = 15;
// What distance percentage in the x axis between two points makes us break the line and draw a "no data" box instead
const maxXDistancePercBetweenLinePoints = 0.1;
// Color used to draw the rectangle that indicates no collection of data
const noDataRectangleColor = "#aaaaaa";
const smoothingFactor = 0.2; // factor to smooth the graph with
const rangeMargin = 0.1; // extra margin to expand the min/max range on the graph
/**
 * This function will debounce calls to functions.
 *
 * @param callback callback to call.
 * @param time time to wait between calls in ms.
 * @returns a function that will call the callback after the time has passed.
 */
function debounce(callback, time) {
    let timerId;
    return function (...args) {
        clearTimeout(timerId);
        timerId = setTimeout(() => callback(...args), time);
    };
}
/**
 * This function will throttle calls to functions.
 *
 * @param callback callback to call.
 * @param time time to wait between calls in ms.
 * @returns a function that will call the callback after the time has passed.
 */
function throttle(callback, time) {
    let lastCalledTime = 0;
    return function (...args) {
        const now = Date.now();
        if (now - lastCalledTime < time) {
            return;
        }
        lastCalledTime = now;
        callback(...args);
    };
}
/*
 * This class acts as the main API for graphing given a Here is where you will find methods to let the service know new data needs to be drawn,
 * let it know something has been resized, etc!
 */
class CanvasGraphService {
    /**
     * Creates an instance of CanvasGraphService.
     *
     * @param canvas a pointer to the canvas dom element we would like to write to.
     * @param settings settings for our service.
     */
    constructor(canvas, settings) {
        this._sizeOfWindow = 300;
        /**
         * This method lets the service know it should get ready to update what it is displaying.
         */
        this.update = throttle(() => this._draw(), drawThrottleTime);
        this._prevPointById = new Map();
        this._prevValueById = new Map();
        /**
         * Handles what to do when we are hovering over the canvas and not panning.
         *
         * @param event A reference to the event to be handled.
         */
        this._handleDataHover = (event) => {
            if (this._panPosition) {
                // we don't want to do anything if we are in the middle of panning
                return;
            }
            this._hoverPosition = { xPos: event.clientX, yPos: event.clientY };
            // process and draw the tooltip.
            this._debouncedTooltip(this._hoverPosition, this._drawableArea);
        };
        /**
         * Debounced processing and drawing of tooltip.
         */
        this._debouncedTooltip = debounce((pos, drawableArea) => {
            this._preprocessTooltip(pos, drawableArea);
            this._drawTooltip(pos, drawableArea);
        }, tooltipDebounceTime);
        /**
         * Handles what to do when we stop hovering over the canvas.
         */
        this._handleStopHover = () => {
            this._hoverPosition = null;
        };
        /**
         * The handler for when we want to zoom in and out of the graph.
         *
         * @param event a mouse wheel event.
         */
        this._handleZoom = (event) => {
            event.preventDefault();
            if (!event.deltaY) {
                return;
            }
            const amount = ((event.deltaY * -0.01) | 0) * 100;
            const minZoom = 60;
            // The max zoom is the number of slices.
            const maxZoom = this._getNumberOfSlices();
            if (this._shouldBecomeRealtime()) {
                this._position = null;
            }
            // Bind the zoom between [minZoom, maxZoom]
            this._sizeOfWindow = core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.Scalar.Clamp(this._sizeOfWindow - amount, minZoom, maxZoom);
        };
        /**
         * Initializes the panning object and attaches appropriate listener.
         *
         * @param event the mouse event containing positional information.
         */
        this._handlePanStart = (event) => {
            const { _ctx: ctx } = this;
            if (!ctx || !ctx.canvas) {
                return;
            }
            const canvas = ctx.canvas;
            this._panPosition = {
                xPos: event.clientX,
                delta: 0,
            };
            this._hoverPosition = null;
            canvas.addEventListener("mousemove", this._handlePan);
        };
        /**
         * While panning this event will keep track of the delta and update the "positions".
         *
         * @param event The mouse event that contains positional information.
         */
        this._handlePan = (event) => {
            if (!this._panPosition || this._getNumberOfSlices() === 0) {
                return;
            }
            const pixelDelta = this._panPosition.delta + event.clientX - this._panPosition.xPos;
            const pixelsPerItem = (this._drawableArea.right - this._drawableArea.left) / this._sizeOfWindow;
            const itemsDelta = (pixelDelta / pixelsPerItem) | 0;
            const pos = this._position ?? this._getNumberOfSlices() - 1;
            // update our position without allowing the user to pan more than they need to (approximation)
            this._position = core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.Scalar.Clamp(pos - itemsDelta, Math.floor(this._sizeOfWindow * scaleFactor), this._getNumberOfSlices() - Math.floor(this._sizeOfWindow * (1 - scaleFactor)));
            if (itemsDelta === 0) {
                this._panPosition.delta += pixelDelta;
            }
            else {
                this._panPosition.delta = 0;
            }
            this._panPosition.xPos = event.clientX;
            this._prevPointById.clear();
            this._prevValueById.clear();
        };
        /**
         * Clears the panning object and removes the appropriate listener.
         */
        this._handlePanStop = () => {
            const { _ctx: ctx } = this;
            if (!ctx || !ctx.canvas) {
                return;
            }
            // check if we should return to realtime.
            if (this._shouldBecomeRealtime()) {
                this._position = null;
            }
            const canvas = ctx.canvas;
            canvas.removeEventListener("mousemove", this._handlePan);
            this._panPosition = null;
        };
        this._ctx = canvas.getContext && canvas.getContext("2d");
        this._width = canvas.width;
        this._height = canvas.height;
        this._ticks = [];
        this._panPosition = null;
        this._hoverPosition = null;
        this._position = null;
        this._datasetBounds = { start: 0, end: 0 };
        this._globalTimeMinMax = { min: Infinity, max: 0 };
        this._drawableArea = { top: 0, left: 0, right: 0, bottom: 0 };
        this._tooltipTextCache = { text: "", width: 0 };
        this._tickerTextCache = { text: "", width: 0 };
        this._tooltipItems = [];
        this._tickerItems = [];
        this._preprocessedTooltipInfo = { focusedId: "", longestText: "", numberOfTooltipItems: 0, xForActualTimestamp: 0 };
        this._numberOfTickers = 0;
        this._onVisibleRangeChangedObservable = settings.onVisibleRangeChangedObservable;
        for (let i = 0; i < maximumDatasetsAllowed; i++) {
            this._tooltipItems.push({ text: "", color: "" });
            this._tickerItems.push({ text: "", id: "", max: 0, min: 0 });
        }
        if (!this._ctx) {
            throw Error("No canvas context accessible");
        }
        const defaultMetrics = this._ctx.measureText(alphabet);
        this._defaultLineHeight = defaultMetrics.actualBoundingBoxAscent + defaultMetrics.actualBoundingBoxDescent;
        this._axisHeight = axisLineLength + axisPadding + this._defaultLineHeight + axisPadding;
        this._ctx.save();
        this._ctx.font = graphAddonFont;
        const fontMetrics = this._ctx.measureText(alphabet);
        this._addonFontLineHeight = fontMetrics.actualBoundingBoxAscent + fontMetrics.actualBoundingBoxDescent;
        this._ctx.restore();
        this.datasets = settings.datasets;
        this.metadata = new Map();
        this._attachEventListeners(canvas);
    }
    /**
     * Update the canvas graph service with the new height and width of the canvas.
     * @param size The new size of the canvas.
     */
    resize(size) {
        const { _ctx: ctx } = this;
        const { width, height } = size;
        if (!ctx || !ctx.canvas) {
            return;
        }
        this._width = width;
        this._height = height;
        ctx.canvas.width = width;
        ctx.canvas.height = height;
        this.update();
    }
    /**
     * Force resets the position in the data, effectively returning to the most current data.
     */
    resetDataPosition() {
        this._position = null;
    }
    /**
     * This method draws the data and sets up the appropriate scales.
     */
    _draw() {
        const { _ctx: ctx } = this;
        if (!ctx) {
            return;
        }
        const numSlices = this._getNumberOfSlices();
        if (numSlices === 0) {
            return;
        }
        // First we clear the canvas so we can draw our data!
        this.clear();
        // Get global min max of time axis (across all datasets).
        this._globalTimeMinMax.min = Infinity;
        this._globalTimeMinMax.max = 0;
        // First we must get the end positions of our view port.
        const pos = this._position ?? numSlices - 1;
        let start = pos - Math.ceil(this._sizeOfWindow * scaleFactor);
        let startOverflow = 0;
        // account for overflow from start.
        if (start < 0) {
            startOverflow = 0 - start;
            start = 0;
        }
        let end = Math.ceil(pos + this._sizeOfWindow * (1 - scaleFactor) + startOverflow);
        // account for overflow from end.
        if (end > numSlices) {
            const endOverflow = end - numSlices;
            end = numSlices;
            start = Math.max(start - endOverflow, 0);
        }
        // update the bounds
        this._datasetBounds.start = start;
        this._datasetBounds.end = end;
        // next we must find the min and max timestamp in bounds. (Timestamps are sorted)
        this._globalTimeMinMax.min = this.datasets.data.at(this.datasets.startingIndices.at(this._datasetBounds.start));
        this._globalTimeMinMax.max = this.datasets.data.at(this.datasets.startingIndices.at(this._datasetBounds.end - 1));
        // set the buffer region maximum by rescaling the max timestamp in bounds.
        const bufferMaximum = Math.ceil((this._globalTimeMinMax.max - this._globalTimeMinMax.min) / scaleFactor + this._globalTimeMinMax.min);
        // we then need to update the end position based on the maximum for the buffer region
        // binary search to get closest point to the buffer maximum.
        this._datasetBounds.end = this._getClosestPointToTimestamp(bufferMaximum) + 1;
        // keep track of largest timestamp value in view!
        this._globalTimeMinMax.max = Math.max(this.datasets.data.at(this.datasets.startingIndices.at(this._datasetBounds.end - 1)), this._globalTimeMinMax.max);
        const updatedScaleFactor = core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.Scalar.Clamp((this._globalTimeMinMax.max - this._globalTimeMinMax.min) / (bufferMaximum - this._globalTimeMinMax.min), scaleFactor, 1);
        // we will now set the global maximum to the maximum of the buffer.
        this._globalTimeMinMax.max = bufferMaximum;
        this._drawableArea.top = 0;
        this._drawableArea.left = 0;
        this._drawableArea.bottom = this._height;
        this._drawableArea.right = this._width;
        this._drawTickers(this._drawableArea, this._datasetBounds);
        this._drawTimeAxis(this._globalTimeMinMax, this._drawableArea);
        this._drawPlayheadRegion(this._drawableArea, updatedScaleFactor);
        this._drawableArea.top += dataPadding;
        this._drawableArea.bottom -= dataPadding;
        // pre-process tooltip info so we can use it in determining opacity of lines.
        this._preprocessTooltip(this._hoverPosition, this._drawableArea);
        const { left, right, bottom, top } = this._drawableArea;
        // process, and then draw our points
        this.datasets.ids.forEach((id, idOffset) => {
            let valueMinMax;
            let prevPoint = this._prevPointById.get(id);
            let prevValue = this._prevValueById.get(id);
            let ticker = false;
            for (let i = 0; i < this._numberOfTickers; i++) {
                if (this._tickerItems[i].id === id) {
                    ticker = true;
                }
            }
            if (!ticker) {
                return;
            }
            ctx.beginPath();
            ctx.strokeStyle = this.metadata.get(id)?.color ?? defaultColor;
            // if we are focused on a line and not in live mode handle the opacities appropriately.
            if (this._preprocessedTooltipInfo.focusedId === id) {
                ctx.globalAlpha = defaultAlpha;
            }
            else if (this._preprocessedTooltipInfo.focusedId !== "") {
                ctx.globalAlpha = backgroundLineAlpha;
            }
            const values = new Array(this._datasetBounds.end - this._datasetBounds.start);
            for (let pointIndex = this._datasetBounds.start; pointIndex < this._datasetBounds.end; pointIndex++) {
                const numPoints = this.datasets.data.at(this.datasets.startingIndices.at(pointIndex) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.NumberOfPointsOffset);
                if (idOffset >= numPoints) {
                    continue;
                }
                const valueIndex = this.datasets.startingIndices.at(pointIndex) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.SliceDataOffset + idOffset;
                const value = this.datasets.data.at(valueIndex);
                if (prevValue === undefined) {
                    prevValue = value;
                    this._prevValueById.set(id, prevValue);
                }
                // perform smoothing
                const smoothedValue = smoothingFactor * value + (1 - smoothingFactor) * prevValue;
                values[pointIndex - this._datasetBounds.start] = smoothedValue;
                if (!valueMinMax) {
                    valueMinMax = {
                        min: smoothedValue,
                        max: smoothedValue,
                    };
                }
                this._prevValueById.set(id, smoothedValue);
                valueMinMax.min = Math.min(valueMinMax.min, smoothedValue);
                valueMinMax.max = Math.max(valueMinMax.max, smoothedValue);
            }
            const delta = valueMinMax.max - valueMinMax.min;
            valueMinMax.min -= rangeMargin * delta;
            valueMinMax.max += rangeMargin * delta;
            for (let pointIndex = this._datasetBounds.start; pointIndex < this._datasetBounds.end; pointIndex++) {
                const timestamp = this.datasets.data.at(this.datasets.startingIndices.at(pointIndex));
                const smoothedValue = values[pointIndex - this._datasetBounds.start];
                const drawableTime = this._getPixelForNumber(timestamp, this._globalTimeMinMax, left, right - left, false);
                const drawableValue = this._getPixelForNumber(smoothedValue, valueMinMax, top, bottom - top, true);
                if (prevPoint === undefined) {
                    prevPoint = [drawableTime, drawableValue];
                    this._prevPointById.set(id, prevPoint);
                }
                const xDifference = drawableTime - prevPoint[0];
                const skipLine = xDifference > maxXDistancePercBetweenLinePoints * (right - left);
                if (skipLine) {
                    ctx.fillStyle = noDataRectangleColor;
                    ctx.fillRect(prevPoint[0], top, xDifference, bottom - top);
                }
                else {
                    if (prevPoint[0] < drawableTime) {
                        ctx.moveTo(prevPoint[0], prevPoint[1]);
                        ctx.lineTo(drawableTime, drawableValue);
                    }
                }
                prevPoint[0] = drawableTime;
                prevPoint[1] = drawableValue;
            }
            ctx.stroke();
        });
        ctx.globalAlpha = defaultAlpha;
        // then draw the tooltip.
        this._drawTooltip(this._hoverPosition, this._drawableArea);
    }
    _drawTickers(drawableArea, bounds) {
        const { _ctx: ctx } = this;
        if (!ctx) {
            return;
        }
        // create the ticker objects for each of the non hidden items.
        let longestText = "";
        this._numberOfTickers = 0;
        const valueMap = new Map();
        this.datasets.ids.forEach((id, idOffset) => {
            if (this.metadata.get(id)?.hidden) {
                return;
            }
            const valueMinMax = this._getMinMax(bounds, idOffset);
            const latestValue = this.datasets.data.at(this.datasets.startingIndices.at(bounds.end - 1) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.SliceDataOffset + idOffset);
            const text = `${id}: ${latestValue.toFixed(2)} (max: ${valueMinMax.max.toFixed(2)}, min: ${valueMinMax.min.toFixed(2)})`;
            valueMap.set(id, {
                min: valueMinMax.min,
                max: valueMinMax.max,
                current: latestValue,
            });
            if (text.length > longestText.length) {
                longestText = text;
            }
            this._tickerItems[this._numberOfTickers].id = id;
            this._tickerItems[this._numberOfTickers].max = valueMinMax.max;
            this._tickerItems[this._numberOfTickers].min = valueMinMax.min;
            this._tickerItems[this._numberOfTickers].text = text;
            this._numberOfTickers++;
        });
        this._onVisibleRangeChangedObservable?.notifyObservers({ valueMap });
        ctx.save();
        ctx.font = graphAddonFont;
        ctx.textBaseline = "middle";
        ctx.textAlign = "left";
        let width;
        // if the lengths are the same the estimate should be good enough given the padding.
        if (this._tickerTextCache.text.length === longestText.length) {
            width = this._tickerTextCache.width;
        }
        else {
            width = ctx.measureText(longestText).width + 2 * tickerHorizontalPadding;
            this._tickerTextCache.text = longestText;
            this._tickerTextCache.width = width;
        }
        ctx.restore();
    }
    /**
     * Returns the index of the closest time for the datasets.
     * Uses a modified binary search to get value.
     *
     * @param targetTime the time we want to get close to.
     * @returns index of the item with the closest time to the targetTime
     */
    _getClosestPointToTimestamp(targetTime) {
        let low = 0;
        let high = this._getNumberOfSlices() - 1;
        let closestIndex = 0;
        while (low <= high) {
            const middle = Math.trunc((low + high) / 2);
            const middleTimestamp = this.datasets.data.at(this.datasets.startingIndices.at(middle));
            if (Math.abs(middleTimestamp - targetTime) < Math.abs(this.datasets.data.at(this.datasets.startingIndices.at(closestIndex)) - targetTime)) {
                closestIndex = middle;
            }
            if (middleTimestamp < targetTime) {
                low = middle + 1;
            }
            else if (middleTimestamp > targetTime) {
                high = middle - 1;
            }
            else {
                break;
            }
        }
        return closestIndex;
    }
    /**
     * This is a convenience method to get the number of collected slices.
     * @returns the total number of collected slices.
     */
    _getNumberOfSlices() {
        return this.datasets.startingIndices.itemLength;
    }
    /**
     * Draws the time axis, adjusts the drawable area for the graph.
     *
     * @param timeMinMax the minimum and maximum for the time axis.
     * @param drawableArea the current allocated drawable area.
     */
    _drawTimeAxis(timeMinMax, drawableArea) {
        const { _ctx: ctx } = this;
        if (!ctx) {
            return;
        }
        const spaceAvailable = drawableArea.right - drawableArea.left;
        this._generateTicks(timeMinMax, spaceAvailable);
        // remove the height of the axis from the available drawable area.
        drawableArea.bottom -= this._axisHeight;
        // draw axis box.
        ctx.save();
        ctx.fillStyle = axisColor;
        ctx.fillRect(drawableArea.left, drawableArea.bottom, spaceAvailable, this._axisHeight);
        // draw time axis line
        ctx.beginPath();
        ctx.strokeStyle = defaultColor;
        ctx.moveTo(drawableArea.left, drawableArea.bottom);
        ctx.lineTo(drawableArea.right, drawableArea.bottom);
        // draw ticks and text.
        ctx.fillStyle = defaultColor;
        ctx.textAlign = "center";
        ctx.textBaseline = "middle";
        const timestampUnit = this._getTimestampUnit(this._ticks[this._ticks.length - 1]);
        this._ticks.forEach((tick) => {
            let position = this._getPixelForNumber(tick, timeMinMax, drawableArea.left, spaceAvailable, false);
            if (position > spaceAvailable) {
                position = spaceAvailable;
            }
            ctx.moveTo(position, drawableArea.bottom);
            ctx.lineTo(position, drawableArea.bottom + 10);
            ctx.fillText(this._parseTimestamp(tick, timestampUnit), position, drawableArea.bottom + 20);
        });
        ctx.stroke();
        ctx.restore();
    }
    /**
     * Given a timestamp (should be the maximum timestamp in view), this function returns the maximum unit the timestamp contains.
     * This information can be used for formatting purposes.
     * @param timestamp the maximum timestamp to find the maximum timestamp unit for.
     * @returns The maximum unit the timestamp has.
     */
    _getTimestampUnit(timestamp) {
        if (timestamp / msInHour > 1) {
            return _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__.TimestampUnit.Hours;
        }
        else if (timestamp / msInMinute > 1) {
            return _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__.TimestampUnit.Minutes;
        }
        else if (timestamp / msInSecond > 1) {
            return _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__.TimestampUnit.Seconds;
        }
        else {
            return _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__.TimestampUnit.Milliseconds;
        }
    }
    /**
     * Given a timestamp and the interval unit, this function will parse the timestamp to the appropriate format.
     * @param timestamp The timestamp to parse
     * @param intervalUnit The maximum unit of the maximum timestamp in an interval.
     * @returns a string representing the parsed timestamp.
     */
    _parseTimestamp(timestamp, intervalUnit) {
        let parsedTimestamp = "";
        if (intervalUnit >= _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__.TimestampUnit.Hours) {
            const numHours = Math.floor(timestamp / msInHour);
            timestamp -= numHours * msInHour;
            parsedTimestamp += `${numHours.toString().padStart(intervalUnit > _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__.TimestampUnit.Hours ? 2 : 1, "0")}:`;
        }
        if (intervalUnit >= _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__.TimestampUnit.Minutes) {
            const numMinutes = Math.floor(timestamp / msInMinute);
            timestamp -= numMinutes * msInMinute;
            parsedTimestamp += `${numMinutes.toString().padStart(intervalUnit > _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__.TimestampUnit.Minutes ? 2 : 1, "0")}:`;
        }
        const numSeconds = Math.floor(timestamp / msInSecond);
        timestamp -= numSeconds * msInSecond;
        parsedTimestamp += numSeconds.toString().padStart(intervalUnit > _graphSupportingTypes__WEBPACK_IMPORTED_MODULE_0__.TimestampUnit.Seconds ? 2 : 1, "0");
        if (timestamp > 0) {
            if (parsedTimestamp.length > 0) {
                parsedTimestamp += ".";
            }
            parsedTimestamp += Math.round(timestamp).toString().padStart(3, "0");
        }
        return parsedTimestamp;
    }
    /**
     * Generates a list of ticks given the min and max of the axis, and the space available in the axis.
     *
     * @param minMax the minimum and maximum values of the axis
     * @param spaceAvailable the total amount of space we have allocated to our axis
     */
    _generateTicks(minMax, spaceAvailable) {
        const { min, max } = minMax;
        const minTickSpacing = 40;
        this._ticks.length = 0;
        const maxTickCount = Math.ceil(spaceAvailable / minTickSpacing);
        const range = this._niceNumber(max - min, false);
        const spacing = this._niceNumber(range / (maxTickCount - 1), true);
        const niceMin = Math.floor(min / spacing) * spacing;
        const niceMax = Math.floor(max / spacing) * spacing;
        for (let i = niceMin; i <= niceMax + 0.5 * spacing; i += spacing) {
            this._ticks.push(i);
        }
    }
    /**
     * Nice number algorithm based on psueudo code defined in "Graphics Gems" by Andrew S. Glassner.
     * This will find a "nice" number approximately equal to num.
     *
     * @param num The number we want to get close to.
     * @param shouldRound if true we will round the number, otherwise we will get the ceiling.
     * @returns a "nice" number approximately equal to num.
     */
    _niceNumber(num, shouldRound) {
        const exp = Math.floor(Math.log10(num));
        const fraction = num / Math.pow(10, exp);
        let niceFraction;
        if (shouldRound) {
            if (fraction < 1.5) {
                niceFraction = 1;
            }
            else if (fraction < 3) {
                niceFraction = 2;
            }
            else if (fraction < 7) {
                niceFraction = 5;
            }
            else {
                niceFraction = 10;
            }
        }
        else {
            if (fraction <= 1) {
                niceFraction = 1;
            }
            else if (fraction <= 2) {
                niceFraction = 2;
            }
            else if (fraction <= 5) {
                niceFraction = 5;
            }
            else {
                niceFraction = 10;
            }
        }
        return niceFraction * Math.pow(10, exp);
    }
    /**
     * Gets the min and max as a single object from an array of numbers.
     * @param bounds
     * @param offset
     * @returns the min and max of the array.
     */
    _getMinMax(bounds, offset) {
        let min = Infinity, max = 0;
        for (let i = bounds.start; i < bounds.end; i++) {
            const numPoints = this.datasets.data.at(this.datasets.startingIndices.at(i) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.NumberOfPointsOffset);
            if (offset >= numPoints) {
                continue;
            }
            const itemIndex = this.datasets.startingIndices.at(i) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.SliceDataOffset + offset;
            const item = this.datasets.data.at(itemIndex);
            if (item < min) {
                min = item;
            }
            if (item > max) {
                max = item;
            }
        }
        return {
            min,
            max,
        };
    }
    /**
     * Converts a single number to a pixel coordinate in a single axis by normalizing the data to a [0, 1] scale using the minimum and maximum values.
     *
     * @param num the number we want to get the pixel coordinate for
     * @param minMax the min and max of the dataset in the axis we want the pixel coordinate for.
     * @param startingPixel the starting pixel coordinate (this means it takes account for any offset).
     * @param spaceAvailable the total space available in this axis.
     * @param shouldFlipValue if we should use a [1, 0] scale instead of a [0, 1] scale.
     * @returns the pixel coordinate of the value in a single axis.
     */
    _getPixelForNumber(num, minMax, startingPixel, spaceAvailable, shouldFlipValue) {
        const { min, max } = minMax;
        // Perform a min-max normalization to rescale the value onto a [0, 1] scale given the min and max of the dataset.
        let normalizedValue = Math.abs(max - min) > 0.001 ? (num - min) / (max - min) : 0.5;
        // if we should make this a [1, 0] range instead (higher numbers = smaller pixel value)
        if (shouldFlipValue) {
            normalizedValue = 1 - normalizedValue;
        }
        return startingPixel + normalizedValue * spaceAvailable;
    }
    /**
     * Add in any necessary event listeners.
     *
     * @param canvas The canvas we want to attach listeners to.
     */
    _attachEventListeners(canvas) {
        canvas.addEventListener("wheel", this._handleZoom);
        canvas.addEventListener("mousemove", this._handleDataHover);
        canvas.addEventListener("mousedown", this._handlePanStart);
        canvas.addEventListener("mouseleave", this._handleStopHover);
        // The user may stop panning outside of the canvas size so we should add the event listener to the document.
        canvas.ownerDocument.addEventListener("mouseup", this._handlePanStop);
    }
    /**
     * We remove all event listeners we added.
     *
     * @param canvas The canvas we want to remove listeners from.
     */
    _removeEventListeners(canvas) {
        canvas.removeEventListener("wheel", this._handleZoom);
        canvas.removeEventListener("mousemove", this._handleDataHover);
        canvas.removeEventListener("mousedown", this._handlePanStart);
        canvas.removeEventListener("mouseleave", this._handleStopHover);
        canvas.ownerDocument.removeEventListener("mouseup", this._handlePanStop);
    }
    /**
     * Given a line defined by P1: (x1, y1) and P2: (x2, y2) get the distance of P0 (x0, y0) from the line.
     * https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line#Line_defined_by_two_points
     * @param x1 x position of point P1
     * @param y1 y position of point P1
     * @param x2 x position of point P2
     * @param y2 y position of point P2
     * @param x0 x position of point P0
     * @param y0 y position of point P0
     * @returns distance of P0 from the line defined by P1 and P2
     */
    _getDistanceFromLine(x1, y1, x2, y2, x0, y0) {
        // if P1 and P2 are the same we just get the distance between P1 and P0
        if (x1 === x2 && y1 === y2) {
            return Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));
        }
        // next we want to handle the case where our point is beyond the y position of our line
        let topX = 0;
        let topY = 0;
        let bottomX = 0;
        let bottomY = 0;
        if (y1 >= y2) {
            topX = x1;
            topY = y1;
            bottomX = x2;
            bottomY = y2;
        }
        else {
            topX = x2;
            topY = y2;
            bottomX = x1;
            bottomY = y1;
        }
        if (y0 < bottomY) {
            return Math.sqrt(Math.pow(bottomX - x0, 2) + Math.pow(bottomY - y0, 2));
        }
        if (y0 > topY) {
            return Math.sqrt(Math.pow(topX - x0, 2) + Math.pow(topY - y0, 2));
        }
        // the general case!
        const numerator = Math.abs((x2 - x1) * (y1 - y0) - (x1 - x0) * (y2 - y1));
        const denominator = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
        return numerator / denominator;
    }
    /**
     * This method does preprocessing calculations for the tooltip.
     * @param pos the position of our mouse.
     * @param drawableArea the remaining drawable area.
     */
    _preprocessTooltip(pos, drawableArea) {
        const { _ctx: ctx } = this;
        if (pos === null || !ctx || !ctx.canvas || this._getNumberOfSlices() === 0) {
            return;
        }
        const { left, top } = ctx.canvas.getBoundingClientRect();
        const adjustedYPos = pos.yPos - top;
        let adjustedXPos = pos.xPos - left;
        if (adjustedXPos > drawableArea.right) {
            adjustedXPos = drawableArea.right;
        }
        // convert the mouse x position in pixels to a timestamp.
        const inferredTimestamp = this._getNumberFromPixel(adjustedXPos, this._globalTimeMinMax, drawableArea.left, drawableArea.right, false);
        let longestText = "";
        let numberOfTooltipItems = 0;
        // get the closest timestamps to the target timestamp, and store the appropriate meta object.
        const closestIndex = this._getClosestPointToTimestamp(inferredTimestamp);
        let actualTimestamp = 0;
        let closestLineId = "";
        let closestLineValueMinMax = { min: 0, max: 0 };
        let closestLineDistance = Number.POSITIVE_INFINITY;
        this.datasets.ids.forEach((id, idOffset) => {
            if (this.metadata.get(id)?.hidden) {
                return;
            }
            const numPoints = this.datasets.data.at(this.datasets.startingIndices.at(closestIndex) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.NumberOfPointsOffset);
            if (idOffset >= numPoints) {
                return;
            }
            const valueAtClosestPointIndex = this.datasets.startingIndices.at(closestIndex) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.SliceDataOffset + idOffset;
            const valueAtClosestPoint = this.datasets.data.at(valueAtClosestPointIndex);
            let valueMinMax;
            // we would have already calculated  the min and max while getting the tickers, so use those, and get first one.
            for (let i = 0; i < this._numberOfTickers; i++) {
                if (this._tickerItems[i].id === id) {
                    valueMinMax = this._tickerItems[i];
                }
            }
            if (!valueMinMax) {
                return;
            }
            actualTimestamp = this.datasets.data.at(this.datasets.startingIndices.at(closestIndex));
            const valueAtClosestPointYPos = this._getPixelForNumber(valueAtClosestPoint, valueMinMax, drawableArea.top, drawableArea.bottom - drawableArea.top, true);
            const xForActualTimestamp = this._getPixelForNumber(actualTimestamp, this._globalTimeMinMax, drawableArea.left, drawableArea.right - drawableArea.left, false);
            const text = `${id}: ${valueAtClosestPoint.toFixed(2)}`;
            if (text.length > longestText.length) {
                longestText = text;
            }
            this._tooltipItems[numberOfTooltipItems].text = text;
            this._tooltipItems[numberOfTooltipItems].color = this.metadata.get(id)?.color ?? defaultColor;
            numberOfTooltipItems++;
            // don't process rest if we aren't panned.
            if (!this._position) {
                return;
            }
            // initially distance between closest data point and mouse point.
            let distance = this._getDistanceFromLine(xForActualTimestamp, valueAtClosestPointYPos, xForActualTimestamp, valueAtClosestPointYPos, pos.xPos - left, adjustedYPos);
            // get the shortest distance between the point and the line segment infront, and line segment behind, store the shorter distance (if shorter than distance between closest data point and mouse).
            if (closestIndex + 1 < this.datasets.data.itemLength &&
                this.datasets.data.at(this.datasets.startingIndices.at(closestIndex + 1) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.NumberOfPointsOffset) > idOffset) {
                const secondPointTimestamp = this.datasets.data.at(this.datasets.startingIndices.at(closestIndex + 1));
                const secondPointX = this._getPixelForNumber(secondPointTimestamp, this._globalTimeMinMax, drawableArea.left, drawableArea.right - drawableArea.left, false);
                const secondPointValue = this.datasets.data.at(this.datasets.startingIndices.at(closestIndex + 1) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.SliceDataOffset + idOffset);
                const secondPointY = this._getPixelForNumber(secondPointValue, valueMinMax, drawableArea.top, drawableArea.bottom - drawableArea.top, true);
                distance = Math.min(this._getDistanceFromLine(xForActualTimestamp, valueAtClosestPointYPos, secondPointX, secondPointY, pos.xPos - left, adjustedYPos), distance);
            }
            if (closestIndex - 1 >= 0 && this.datasets.data.at(this.datasets.startingIndices.at(closestIndex + 1) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.NumberOfPointsOffset) > idOffset) {
                const secondPointTimestamp = this.datasets.data.at(this.datasets.startingIndices.at(closestIndex - 1));
                const secondPointX = this._getPixelForNumber(secondPointTimestamp, this._globalTimeMinMax, drawableArea.left, drawableArea.right - drawableArea.left, false);
                const secondPointValue = this.datasets.data.at(this.datasets.startingIndices.at(closestIndex - 1) + core_Maths_math_scalar__WEBPACK_IMPORTED_MODULE_1__.PerformanceViewerCollector.SliceDataOffset + idOffset);
                const secondPointY = this._getPixelForNumber(secondPointValue, valueMinMax, drawableArea.top, drawableArea.bottom - drawableArea.top, true);
                distance = Math.min(this._getDistanceFromLine(xForActualTimestamp, valueAtClosestPointYPos, secondPointX, secondPointY, pos.xPos - left, adjustedYPos), distance);
            }
            if (distance < closestLineDistance) {
                closestLineId = id;
                closestLineDistance = distance;
                closestLineValueMinMax = valueMinMax;
            }
        });
        const xForActualTimestamp = this._getPixelForNumber(actualTimestamp, this._globalTimeMinMax, drawableArea.left, drawableArea.right - drawableArea.left, false);
        this._preprocessedTooltipInfo.xForActualTimestamp = xForActualTimestamp;
        // check if hover is within a certain distance, if so it is our only item in our tooltip.
        if (closestLineDistance <= maxDistanceForHover && this._position) {
            this._preprocessedTooltipInfo.focusedId = closestLineId;
            const inferredValue = this._getNumberFromPixel(adjustedYPos, closestLineValueMinMax, drawableArea.top, drawableArea.bottom, true);
            const closestLineText = `${closestLineId}: ${inferredValue.toFixed(2)}`;
            this._preprocessedTooltipInfo.longestText = closestLineText;
            this._preprocessedTooltipInfo.numberOfTooltipItems = 1;
            this._tooltipItems[0].text = closestLineText;
            this._tooltipItems[0].color = this.metadata.get(closestLineId)?.color ?? defaultColor;
        }
        else {
            this._preprocessedTooltipInfo.focusedId = "";
            this._preprocessedTooltipInfo.longestText = longestText;
            this._preprocessedTooltipInfo.numberOfTooltipItems = numberOfTooltipItems;
        }
    }
    /**
     * Draws the tooltip given the area it is allowed to draw in and the current pixel position.
     *
     * @param pos the position of the mouse cursor in pixels (x, y).
     * @param drawableArea  the available area we can draw in.
     */
    _drawTooltip(pos, drawableArea) {
        const { _ctx: ctx } = this;
        if (pos === null || !ctx || !ctx.canvas || this._getNumberOfSlices() === 0) {
            return;
        }
        const { left, top } = ctx.canvas.getBoundingClientRect();
        const { numberOfTooltipItems, xForActualTimestamp, longestText } = this._preprocessedTooltipInfo;
        ctx.save();
        // draw pointer triangle
        ctx.fillStyle = positionIndicatorColor;
        const yTriangle = drawableArea.bottom + trianglePaddingFromAxisLine;
        ctx.beginPath();
        ctx.moveTo(xForActualTimestamp, yTriangle);
        ctx.lineTo(xForActualTimestamp + triangleWidth / 2, yTriangle + triangleHeight);
        ctx.lineTo(xForActualTimestamp - triangleWidth / 2, yTriangle + triangleHeight);
        ctx.closePath();
        ctx.fill();
        ctx.strokeStyle = positionIndicatorColor;
        ctx.beginPath();
        // draw vertical or horizontal line depending on if focused on a point on the line.
        if (this._preprocessedTooltipInfo.focusedId === "") {
            ctx.moveTo(xForActualTimestamp, drawableArea.bottom);
            ctx.lineTo(xForActualTimestamp, topOfGraphY);
        }
        else {
            const lineY = pos.yPos - top;
            ctx.moveTo(drawableArea.left, lineY);
            ctx.lineTo(drawableArea.right, lineY);
        }
        ctx.stroke();
        // draw the actual tooltip
        ctx.font = graphAddonFont;
        ctx.textBaseline = "middle";
        ctx.textAlign = "left";
        const boxLength = this._addonFontLineHeight;
        const textHeight = this._addonFontLineHeight + Math.floor(tooltipHorizontalPadding / 2);
        // initialize width with cached value or measure width of longest text and update cache.
        let width;
        if (longestText === this._tooltipTextCache.text) {
            width = this._tooltipTextCache.width;
        }
        else {
            width = ctx.measureText(longestText).width + boxLength + 2 * tooltipHorizontalPadding + spaceBetweenTextAndBox;
            this._tooltipTextCache.text = longestText;
            this._tooltipTextCache.width = width;
        }
        const tooltipHeight = textHeight * (numberOfTooltipItems + 1);
        let x = pos.xPos - left;
        let y = drawableArea.bottom - tooltipPaddingFromBottom - tooltipHeight;
        // We want the tool tip to always be inside the canvas so we adjust which way it is drawn.
        if (x + width > this._width) {
            x -= width;
        }
        ctx.globalAlpha = tooltipBackgroundAlpha;
        ctx.fillStyle = tooltipBackgroundColor;
        ctx.fillRect(x, y, width, tooltipHeight);
        ctx.globalAlpha = defaultAlpha;
        x += tooltipHorizontalPadding;
        y += textHeight;
        for (let i = 0; i < numberOfTooltipItems; i++) {
            const tooltipItem = this._tooltipItems[i];
            ctx.fillStyle = tooltipItem.color;
            ctx.fillRect(x, y - Math.floor(boxLength / 2), boxLength, boxLength);
            ctx.fillStyle = tooltipForegroundColor;
            ctx.fillText(tooltipItem.text, x + boxLength + spaceBetweenTextAndBox, y);
            y += textHeight;
        }
        ctx.restore();
    }
    /**
     * Gets the number from a pixel position given the minimum and maximum value in range, and the starting pixel and the ending pixel.
     *
     * @param pixel current pixel position we want to get the number for.
     * @param minMax the minimum and maximum number in the range.
     * @param startingPixel position of the starting pixel in range.
     * @param endingPixel position of ending pixel in range.
     * @param shouldFlip if we should use a [1, 0] scale instead of a [0, 1] scale.
     * @returns number corresponding to pixel position
     */
    _getNumberFromPixel(pixel, minMax, startingPixel, endingPixel, shouldFlip) {
        // normalize pixel to range [0, 1].
        let normalizedPixelPosition = (pixel - startingPixel) / (endingPixel - startingPixel);
        // we should use a [1, 0] scale instead.
        if (shouldFlip) {
            normalizedPixelPosition = 1 - normalizedPixelPosition;
        }
        return minMax.min + normalizedPixelPosition * (minMax.max - minMax.min);
    }
    /**
     * Method which returns true if the data should become realtime, false otherwise.
     *
     * @returns if the data should become realtime or not.
     */
    _shouldBecomeRealtime() {
        if (this._getNumberOfSlices() === 0) {
            return false;
        }
        // we need to compare our current slice to the latest slice to see if we should return to realtime mode.
        const pos = this._position;
        const latestSlicePos = this._getNumberOfSlices() - 1;
        if (pos === null) {
            return false;
        }
        // account for overflow on the left side only as it will be the one determining if we have sufficiently caught up to the realtime data.
        const overflow = Math.max(0 - (pos - Math.ceil(this._sizeOfWindow * scaleFactor)), 0);
        const rightmostPos = Math.min(overflow + pos + Math.ceil(this._sizeOfWindow * (1 - scaleFactor)), latestSlicePos);
        return (this.datasets.data.at(this.datasets.startingIndices.at(rightmostPos)) / this.datasets.data.at(this.datasets.startingIndices.at(latestSlicePos)) > returnToLiveThreshold);
    }
    /**
     * Will generate a playhead with a futurebox that takes up (1-scalefactor)*100% of the canvas.
     *
     * @param drawableArea The remaining drawable area.
     * @param scaleFactor The Percentage between 0.0 and 1.0 of the canvas the data gets drawn on.
     */
    _drawPlayheadRegion(drawableArea, scaleFactor) {
        const { _ctx: ctx } = this;
        if (!ctx || scaleFactor >= stopDrawingPlayheadThreshold) {
            return;
        }
        const dividerXPos = Math.ceil(drawableArea.right * scaleFactor);
        const playheadPos = dividerXPos - playheadSize;
        const futureBoxPos = dividerXPos + dividerSize;
        const rectangleHeight = drawableArea.bottom - drawableArea.top - 1;
        ctx.save();
        ctx.fillStyle = futureBoxColor;
        ctx.fillRect(futureBoxPos, drawableArea.top, drawableArea.right - futureBoxPos, rectangleHeight);
        ctx.fillStyle = dividerColor;
        ctx.fillRect(dividerXPos, drawableArea.top, dividerSize, rectangleHeight);
        ctx.fillStyle = playheadColor;
        ctx.fillRect(playheadPos, drawableArea.top, playheadSize, rectangleHeight);
        ctx.restore();
    }
    /**
     *  Method to do cleanup when the object is done being used.
     *
     */
    destroy() {
        if (!this._ctx || !this._ctx.canvas) {
            return;
        }
        this._removeEventListeners(this._ctx.canvas);
        this._ctx = null;
    }
    /**
     * This method clears the canvas
     */
    clear() {
        const { _ctx: ctx, _width, _height } = this;
        // If we do not have a context we can't really do much here!
        if (!ctx) {
            return;
        }
        // save the transformation matrix, clear the canvas then restore.
        ctx.save();
        ctx.resetTransform();
        ctx.clearRect(0, 0, _width, _height);
        ctx.restore();
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/graph/graphSupportingTypes.js":
/*!****************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/graph/graphSupportingTypes.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2748388__) => {

"use strict";
__nested_webpack_require_2748388__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2748388__.d(__nested_webpack_exports__, {
/* harmony export */   TimestampUnit: () => (/* binding */ TimestampUnit)
/* harmony export */ });
/**
 * Defines the supported timestamp units.
 */
var TimestampUnit;
(function (TimestampUnit) {
    TimestampUnit[TimestampUnit["Milliseconds"] = 0] = "Milliseconds";
    TimestampUnit[TimestampUnit["Seconds"] = 1] = "Seconds";
    TimestampUnit[TimestampUnit["Minutes"] = 2] = "Minutes";
    TimestampUnit[TimestampUnit["Hours"] = 3] = "Hours";
})(TimestampUnit || (TimestampUnit = {}));


/***/ }),

/***/ "../../../dev/inspector/dist/components/headerComponent.js":
/*!*****************************************************************!*\
  !*** ../../../dev/inspector/dist/components/headerComponent.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2749374__) => {

"use strict";
__nested_webpack_require_2749374__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2749374__.d(__nested_webpack_exports__, {
/* harmony export */   HeaderComponent: () => (/* binding */ HeaderComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2749374__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2749374__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2749374__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2749374__(/*! react */ "../../../../node_modules/react/index.js");




class HeaderComponent extends react__WEBPACK_IMPORTED_MODULE_2__.Component {
    constructor(props) {
        super(props);
        this._backStack = new Array();
        this.state = { isBackVisible: false };
    }
    componentDidMount() {
        if (!this.props.onSelectionChangedObservable) {
            return;
        }
        this._onSelectionChangeObserver = this.props.onSelectionChangedObservable.add((entity) => {
            if (this._backStack.length === 0 || entity !== this._backStack[this._backStack.length - 1]) {
                this._backStack.push(entity);
                this.setState({ isBackVisible: this._backStack.length > 1 });
            }
        });
    }
    componentWillUnmount() {
        if (this._onSelectionChangeObserver) {
            this.props.onSelectionChangedObservable.remove(this._onSelectionChangeObserver);
        }
    }
    goBack() {
        this._backStack.pop(); // remove current
        const entity = this._backStack[this._backStack.length - 1];
        if (this.props.onSelectionChangedObservable) {
            this.props.onSelectionChangedObservable.notifyObservers(entity);
        }
        this.setState({ isBackVisible: this._backStack.length > 1 });
    }
    renderLogo() {
        if (this.props.noCommands) {
            return null;
        }
        if (this.props.handleBack) {
            if (!this.state.isBackVisible) {
                return null;
            }
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "back", onClick: () => this.goBack(), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faArrowLeft }) }));
        }
        return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { id: "logo", style: { top: "0%" }, src: "https://www.babylonjs.com/Assets/logo-babylonjs-social-twitter.png" });
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "header", children: [this.renderLogo(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { id: "title", children: this.props.title }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "commands", children: [!this.props.noCommands && !this.props.noExpand && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expand", onClick: () => this.props.onPopup(), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faWindowRestore }) })), !this.props.noCommands && !this.props.noClose && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "close", onClick: () => this.props.onClose(), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faTimes }) }))] })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/popupComponent.js":
/*!****************************************************************!*\
  !*** ../../../dev/inspector/dist/components/popupComponent.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2753897__) => {

"use strict";
__nested_webpack_require_2753897__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2753897__.d(__nested_webpack_exports__, {
/* harmony export */   PopupComponent: () => (/* binding */ PopupComponent)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2753897__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2753897__(/*! react-dom */ "../../../../node_modules/react-dom/index.js");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2753897__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2753897__.n(core_Misc_logger__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var shared_ui_components_popupHelper__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2753897__(/*! shared-ui-components/popupHelper */ "../../../dev/sharedUiComponents/dist/popupHelper.js");




class PopupComponent extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
    constructor(props) {
        super(props);
        this.onBeforeUnloadListener = () => {
            if (this._window) {
                this._window.close();
            }
        };
        this._container = document.createElement("div");
        this._container.id = this.props.id;
        this._window;
        this.state = {
            isComponentMounted: false,
            blockedByBrowser: false,
        };
    }
    componentDidMount() {
        this.openPopup();
        this.setState({ isComponentMounted: true });
    }
    openPopup() {
        const { title, size, onClose, onOpen } = this.props;
        this._container = (0,shared_ui_components_popupHelper__WEBPACK_IMPORTED_MODULE_3__.CreatePopup)(title, { onWindowCreateCallback: (w) => (this._window = w), width: size.width, height: size.height });
        if (this._container) {
            this._host = this._container.ownerDocument.createElement("div");
            this._host.id = "host";
            this._host.style.width = "auto";
            this._container.appendChild(this._host);
        }
        window.addEventListener("beforeunload", this.onBeforeUnloadListener);
        if (this._window) {
            if (onOpen) {
                onOpen(this._window);
            }
            this._window.addEventListener("keyup", (evt) => {
                if (this.props.onKeyUp) {
                    this.props.onKeyUp(evt);
                }
            });
            this._window.addEventListener("keydown", (evt) => {
                if (this.props.onKeyDown) {
                    this.props.onKeyDown(evt);
                }
            });
            this._window.addEventListener("beforeunload", () => this._window && onClose(this._window));
            this._window.addEventListener("resize", () => {
                if (this.props.onResize) {
                    this._window && this.props.onResize(this._window);
                }
            });
        }
        else {
            if (!this._window) {
                this.setState({ blockedByBrowser: true }, () => {
                    if (this.state.blockedByBrowser) {
                        core_Misc_logger__WEBPACK_IMPORTED_MODULE_2__.Logger.Warn("Popup window couldn't be created");
                    }
                });
            }
        }
    }
    componentWillUnmount() {
        window.removeEventListener("beforeunload", this.onBeforeUnloadListener);
        if (this._window) {
            this._window.close();
        }
    }
    getWindow() {
        return this._window;
    }
    render() {
        if (!this.state.isComponentMounted || this._container === null) {
            return null;
        }
        return react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal(this.props.children, this._host);
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/propertyChangedEvent.js":
/*!**********************************************************************!*\
  !*** ../../../dev/inspector/dist/components/propertyChangedEvent.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2758184__) => {

"use strict";
__nested_webpack_require_2758184__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2758184__.d(__nested_webpack_exports__, {
/* harmony export */   PropertyChangedEvent: () => (/* binding */ PropertyChangedEvent)
/* harmony export */ });
class PropertyChangedEvent {
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/replayRecorder.js":
/*!****************************************************************!*\
  !*** ../../../dev/inspector/dist/components/replayRecorder.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2758821__) => {

"use strict";
__nested_webpack_require_2758821__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2758821__.d(__nested_webpack_exports__, {
/* harmony export */   ReplayRecorder: () => (/* binding */ ReplayRecorder)
/* harmony export */ });
/* harmony import */ var core_Misc_sceneRecorder__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2758821__(/*! core/Misc/tools */ "core/Misc/observable");
/* harmony import */ var core_Misc_sceneRecorder__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2758821__.n(core_Misc_sceneRecorder__WEBPACK_IMPORTED_MODULE_0__);


class ReplayRecorder {
    constructor() {
        this._sceneRecorder = new core_Misc_sceneRecorder__WEBPACK_IMPORTED_MODULE_0__.SceneRecorder();
        this._isRecording = false;
    }
    get isRecording() {
        return this._isRecording;
    }
    cancel() {
        this._isRecording = false;
    }
    trackScene(scene) {
        this._sceneRecorder.track(scene);
        this._isRecording = true;
    }
    applyDelta(json, scene) {
        core_Misc_sceneRecorder__WEBPACK_IMPORTED_MODULE_0__.SceneRecorder.ApplyDelta(json, scene);
        this._isRecording = false;
    }
    export() {
        const content = JSON.stringify(this._sceneRecorder.getDelta());
        core_Misc_sceneRecorder__WEBPACK_IMPORTED_MODULE_0__.Tools.Download(new Blob([content]), "diff.json");
        this._isRecording = false;
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/animationGroupTreeItemComponent.js":
/*!********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/animationGroupTreeItemComponent.js ***!
  \********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2760729__) => {

"use strict";
__nested_webpack_require_2760729__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2760729__.d(__nested_webpack_exports__, {
/* harmony export */   AnimationGroupItemComponent: () => (/* binding */ AnimationGroupItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2760729__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2760729__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2760729__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2760729__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2760729__(/*! react */ "../../../../node_modules/react/index.js");





class AnimationGroupItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const animationGroup = this.props.animationGroup;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "animationGroupTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: animationGroup.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faLayerGroup, color: "cornflowerblue" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: animationGroup, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/boneTreeItemComponent.js":
/*!**********************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/boneTreeItemComponent.js ***!
  \**********************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2763301__) => {

"use strict";
__nested_webpack_require_2763301__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2763301__.d(__nested_webpack_exports__, {
/* harmony export */   BoneTreeItemComponent: () => (/* binding */ BoneTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2763301__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2763301__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2763301__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2763301__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2763301__(/*! react */ "../../../../node_modules/react/index.js");





class BoneTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const bone = this.props.bone;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "skeletonTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: bone.name || "no name", onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faBone, color: "lightgray" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: bone, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/cameraTreeItemComponent.js":
/*!************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/cameraTreeItemComponent.js ***!
  \************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2765819__) => {

"use strict";
__nested_webpack_require_2765819__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2765819__.d(__nested_webpack_exports__, {
/* harmony export */   CameraTreeItemComponent: () => (/* binding */ CameraTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2765819__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2765819__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2765819__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2765819__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2765819__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2765819__(/*! react */ "../../../../node_modules/react/index.js");






class CameraTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_4__.Component {
    constructor(props) {
        super(props);
        const camera = this.props.camera;
        const scene = camera.getScene();
        this.state = { isActive: scene.activeCamera === camera, isGizmoEnabled: camera.reservedDataStore && camera.reservedDataStore.cameraGizmo };
    }
    setActive() {
        const camera = this.props.camera;
        const scene = camera.getScene();
        const previousActiveCamera = scene.activeCamera;
        scene.activeCamera = camera;
        camera.attachControl(true);
        this.props.globalState.onPropertyChangedObservable.notifyObservers({ object: scene, property: "activeCamera", value: camera, initialValue: previousActiveCamera });
        this.setState({ isActive: true });
    }
    componentDidMount() {
        const scene = this.props.camera.getScene();
        this._onBeforeRenderObserver = scene.onBeforeRenderObservable.add(() => {
            const camera = this.props.camera;
            // This will deactivate the previous camera when the camera is changed. Multiple camera's cycle frequently so only do this for single cameras
            if (this.state.isActive && scene.activeCameras && scene.activeCameras.length <= 1 && scene.activeCamera !== camera) {
                camera.detachControl();
            }
            const newState = scene.activeCamera === camera;
            if (newState !== this.state.isActive) {
                this.setState({ isActive: newState });
            }
        });
    }
    componentWillUnmount() {
        if (this._onBeforeRenderObserver) {
            const camera = this.props.camera;
            const scene = camera.getScene();
            scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
        }
    }
    toggleGizmo() {
        const camera = this.props.camera;
        if (camera.reservedDataStore && camera.reservedDataStore.cameraGizmo) {
            if (camera.getScene().reservedDataStore && camera.getScene().reservedDataStore.gizmoManager) {
                camera.getScene().reservedDataStore.gizmoManager.attachToMesh(null);
            }
            this.props.globalState.enableCameraGizmo(camera, false);
            this.setState({ isGizmoEnabled: false });
        }
        else {
            this.props.globalState.enableCameraGizmo(camera, true, this.props.gizmoCamera);
            this.setState({ isGizmoEnabled: true });
        }
    }
    render() {
        const isActiveElement = this.state.isActive ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faVideo }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faVideo, className: "isNotActive" });
        const scene = this.props.camera.getScene();
        const isGizmoEnabled = this.state.isGizmoEnabled || (this.props.camera && this.props.camera.reservedDataStore && this.props.camera.reservedDataStore.cameraGizmo) ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faEye })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faEye, className: "isNotActive" }));
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "cameraTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_2__.TreeItemLabelComponent, { label: this.props.camera.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faCamera, color: "green" }), (!scene.activeCameras || scene.activeCameras.length === 0) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "activeCamera icon", onClick: () => this.setActive(), title: "Set as main camera and attach to controls", children: isActiveElement })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "enableGizmo icon", onClick: () => this.toggleGizmo(), title: "Turn on/off the camera's gizmo", children: isGizmoEnabled }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_3__.ExtensionsComponent, { target: this.props.camera, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/effectLayerPipelineTreeItemComponent.js":
/*!*************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/effectLayerPipelineTreeItemComponent.js ***!
  \*************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2772595__) => {

"use strict";
__nested_webpack_require_2772595__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2772595__.d(__nested_webpack_exports__, {
/* harmony export */   EffectLayerItemComponent: () => (/* binding */ EffectLayerItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2772595__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2772595__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2772595__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2772595__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2772595__(/*! react */ "../../../../node_modules/react/index.js");





class EffectLayerItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "effectLayerTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: this.props.layer.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faSun, color: "Plum" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: this.props.layer, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/gui/advancedDynamicTextureTreeItemComponent.js":
/*!********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/gui/advancedDynamicTextureTreeItemComponent.js ***!
  \********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2775172__) => {

"use strict";
__nested_webpack_require_2775172__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2775172__.d(__nested_webpack_exports__, {
/* harmony export */   AdvancedDynamicTextureTreeItemComponent: () => (/* binding */ AdvancedDynamicTextureTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2775172__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2775172__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2775172__(/*! ../../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2775172__(/*! ../../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2775172__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2775172__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _guiTools__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2775172__(/*! ./guiTools */ "../../../dev/inspector/dist/components/sceneExplorer/entities/gui/guiTools.js");







class AdvancedDynamicTextureTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
        this.state = { isInPickingMode: false };
    }
    componentWillUnmount() {
        const adt = this.props.texture;
        if (this._onControlPickedObserver) {
            adt.onControlPickedObservable.remove(this._onControlPickedObserver);
            this._onControlPickedObserver = null;
        }
    }
    onPickingMode() {
        const adt = this.props.texture;
        if (this._onControlPickedObserver) {
            adt.onControlPickedObservable.remove(this._onControlPickedObserver);
            this._onControlPickedObserver = null;
        }
        if (!this.state.isInPickingMode) {
            this._onControlPickedObserver = adt.onControlPickedObservable.add((control) => {
                if (!this.props.onSelectionChangedObservable) {
                    return;
                }
                if (control.getClassName() === "ScrollViewerWindow") {
                    control = control.getAscendantOfClass("ScrollViewer");
                }
                this.props.onSelectionChangedObservable.notifyObservers(control);
            });
        }
        this.setState({ isInPickingMode: !this.state.isInPickingMode });
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "adtextureTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: this.props.texture.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faImage, color: "mediumpurple" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "icon edit", onClick: () => (0,_guiTools__WEBPACK_IMPORTED_MODULE_5__.EditAdvancedDynamicTexture)(this.props.texture, true), title: "Edit", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faPen }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.isInPickingMode ? "pickingMode selected icon" : "pickingMode icon", onClick: () => this.onPickingMode(), title: "Turn picking mode on/off", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faCrosshairs }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: this.props.texture, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/gui/controlTreeItemComponent.js":
/*!*****************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/gui/controlTreeItemComponent.js ***!
  \*****************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2780212__) => {

"use strict";
__nested_webpack_require_2780212__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2780212__.d(__nested_webpack_exports__, {
/* harmony export */   ControlTreeItemComponent: () => (/* binding */ ControlTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2780212__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2780212__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2780212__(/*! ../../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2780212__(/*! ../../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2780212__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2780212__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");






class ControlTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
        const control = this.props.control;
        this.state = { isActive: control.isHighlighted, isVisible: control.isVisible };
    }
    highlight() {
        const control = this.props.control;
        control.isHighlighted = !control.isHighlighted;
        this.setState({ isActive: control.isHighlighted });
    }
    switchVisibility() {
        const newState = !this.state.isVisible;
        this.setState({ isVisible: newState });
        this.props.control.isVisible = newState;
    }
    render() {
        const control = this.props.control;
        const name = (control.name || "No name") + ` [${control.getClassName()}]`;
        const isActiveElement = this.state.isActive ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faHighlighter }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faHighlighter, className: "isNotActive" });
        const visibilityElement = this.state.isVisible ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faEye }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faEyeSlash, className: "isNotActive" });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "controlTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faObjectGroup, color: "greenyellow" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "highlight icon", onClick: () => this.highlight(), title: "Highlight this control", children: isActiveElement }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "visibility icon", onClick: () => this.switchVisibility(), title: "Show/Hide control", children: visibilityElement }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: control, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/gui/guiTools.js":
/*!*************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/gui/guiTools.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2784914__) => {

"use strict";
__nested_webpack_require_2784914__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2784914__.d(__nested_webpack_exports__, {
/* harmony export */   EditAdvancedDynamicTexture: () => (/* binding */ EditAdvancedDynamicTexture),
/* harmony export */   InjectGUIEditor: () => (/* binding */ InjectGUIEditor),
/* harmony export */   SetGUIEditorURL: () => (/* binding */ SetGUIEditorURL)
/* harmony export */ });
/* harmony import */ var core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2784914__(/*! core/Misc/tools */ "core/Misc/observable");
/* harmony import */ var core_Engines_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2784914__.n(core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var gui_editor_guiEditor__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2784914__(/*! gui-editor/guiEditor */ "gui-editor/guiEditor");
/* harmony import */ var gui_editor_guiEditor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2784914__.n(gui_editor_guiEditor__WEBPACK_IMPORTED_MODULE_1__);



let editorUrl = `${core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Tools._DefaultCdnUrl}/v${core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Engine.Version}/guiEditor/babylon.guiEditor.js`;
// eslint-disable-next-line @typescript-eslint/naming-convention
let guiEditorContainer;
/** Get the inspector from bundle or global
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function _getGlobalGUIEditor() {
    // UMD Global name detection from Webpack Bundle UMD Name.
    if (typeof gui_editor_guiEditor__WEBPACK_IMPORTED_MODULE_1__.GUIEditor !== "undefined") {
        // eslint-disable-next-line @typescript-eslint/naming-convention
        return { GUIEditor: gui_editor_guiEditor__WEBPACK_IMPORTED_MODULE_1__.GUIEditor };
    }
    // In case of module let's check the global emitted from the editor entry point.
    if (typeof BABYLON !== "undefined" && typeof BABYLON.GUIEditor !== "undefined") {
        return BABYLON;
    }
    return undefined;
}
/**
 * Used to pass in the gui-editor package.
 * @param guiEditorPackage
 */
function InjectGUIEditor(guiEditorPackage) {
    guiEditorContainer = guiEditorPackage;
}
/**
 * Change the URL that the GUI editor loads from
 * @param guiEditorURL
 */
function SetGUIEditorURL(guiEditorURL) {
    editorUrl = guiEditorURL;
}
/**
 * Opens an ADT in the GUI editor
 * if you are in an ES6 environment, you must first call InjectGUIEditor to provide the gui-editor package
 * If you are in a UMD environment, it will load the package from a URL
 * @param adt
 * @param embed defines whether editor is being opened from the Playground
 * @returns a promise that resolves when the editor is opened
 */
async function EditAdvancedDynamicTexture(adt, embed) {
    guiEditorContainer = guiEditorContainer || _getGlobalGUIEditor();
    if (!guiEditorContainer) {
        if (typeof BABYLON !== "undefined") {
            // we are in UMD environment
            if (typeof guiEditorContainer === "undefined") {
                // Load editor and add it to the DOM
                try {
                    await core_Engines_engine__WEBPACK_IMPORTED_MODULE_0__.Tools.LoadScriptAsync(editorUrl);
                    guiEditorContainer = guiEditorContainer || _getGlobalGUIEditor();
                }
                catch {
                    // eslint-disable-next-line no-throw-literal
                    throw `Failed to load GUI editor from ${editorUrl}`;
                }
            }
        }
        else {
            // we are in ES6 environment
            // eslint-disable-next-line no-throw-literal
            throw `Tried to call EditAdvancedDynamicTexture without first injecting the GUI editor. You need to call InjectGUIEditor() with a reference to @babylonjs/gui-editor. It can be imported at runtime using await import("@babylonjs/gui-editor").`;
        }
    }
    guiEditorContainer.GUIEditor.Show({ liveGuiTexture: adt }, embed);
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/lightTreeItemComponent.js":
/*!***********************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/lightTreeItemComponent.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2789391__) => {

"use strict";
__nested_webpack_require_2789391__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2789391__.d(__nested_webpack_exports__, {
/* harmony export */   LightTreeItemComponent: () => (/* binding */ LightTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2789391__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2789391__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2789391__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2789391__(/*! @fortawesome/free-regular-svg-icons */ "../../../../node_modules/@fortawesome/free-regular-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2789391__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2789391__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2789391__(/*! react */ "../../../../node_modules/react/index.js");







class LightTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_4__.Component {
    constructor(props) {
        super(props);
        const light = this.props.light;
        this.state = { isEnabled: light.isEnabled(), isGizmoEnabled: light.reservedDataStore && light.reservedDataStore.lightGizmo };
    }
    switchIsEnabled() {
        const light = this.props.light;
        light.setEnabled(!light.isEnabled());
        this.props.globalState.onPropertyChangedObservable.notifyObservers({ object: light, property: "isEnabled", value: light.isEnabled(), initialValue: !light.isEnabled() });
        this.setState({ isEnabled: light.isEnabled() });
    }
    toggleGizmo() {
        const light = this.props.light;
        if (light.reservedDataStore && light.reservedDataStore.lightGizmo) {
            if (light.getScene().reservedDataStore && light.getScene().reservedDataStore.gizmoManager) {
                light.getScene().reservedDataStore.gizmoManager.attachToMesh(null);
            }
            this.props.globalState.enableLightGizmo(light, false);
            this.setState({ isGizmoEnabled: false });
        }
        else {
            this.props.globalState.enableLightGizmo(light, true, this.props.gizmoCamera);
            this.setState({ isGizmoEnabled: true });
        }
    }
    render() {
        const isEnabledElement = this.state.isEnabled ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faLightbulb }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faLightbulb, className: "isNotActive" });
        const isGizmoEnabled = this.state.isGizmoEnabled || (this.props.light && this.props.light.reservedDataStore && this.props.light.reservedDataStore.lightGizmo) ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faEye })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faEye, className: "isNotActive" }));
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "lightTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_2__.TreeItemLabelComponent, { label: this.props.light.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faLightbulb, color: "yellow" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "visibility icon", onClick: () => this.switchIsEnabled(), title: "Turn on/off the light", children: isEnabledElement }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "enableGizmo icon", onClick: () => this.toggleGizmo(), title: "Turn on/off the light's gizmo", children: isGizmoEnabled }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_3__.ExtensionsComponent, { target: this.props.light, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/materialTreeItemComponent.js":
/*!**************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/materialTreeItemComponent.js ***!
  \**************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2795056__) => {

"use strict";
__nested_webpack_require_2795056__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2795056__.d(__nested_webpack_exports__, {
/* harmony export */   MaterialTreeItemComponent: () => (/* binding */ MaterialTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2795056__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2795056__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2795056__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2795056__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2795056__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2795056__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");






class MaterialTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const nmeIcon = this.props.material.getClassName() === "NodeMaterial" ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "icon", onClick: () => {
                this.props.material.edit({ nodeEditorConfig: { backgroundColor: this.props.material.getScene().clearColor } });
            }, title: "Node Material Editor", color: "white", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faPen }) })) : null;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "materialTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: this.props.material.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faBrush, color: "orange" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: this.props.material, extensibilityGroups: this.props.extensibilityGroups }), nmeIcon] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/meshTreeItemComponent.js":
/*!**********************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/meshTreeItemComponent.js ***!
  \**********************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2798387__) => {

"use strict";
__nested_webpack_require_2798387__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2798387__.d(__nested_webpack_exports__, {
/* harmony export */   MeshTreeItemComponent: () => (/* binding */ MeshTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2798387__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2798387__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2798387__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2798387__(/*! @fortawesome/free-regular-svg-icons */ "../../../../node_modules/@fortawesome/free-regular-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2798387__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2798387__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2798387__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Rendering_boundingBoxRenderer__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2798387__(/*! core/Rendering/boundingBoxRenderer */ "core/Misc/observable");
/* harmony import */ var core_Rendering_boundingBoxRenderer__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_2798387__.n(core_Rendering_boundingBoxRenderer__WEBPACK_IMPORTED_MODULE_5__);








class MeshTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_4__.Component {
    constructor(props) {
        super(props);
        const mesh = this.props.mesh;
        this.state = { isBoundingBoxEnabled: mesh.showBoundingBox, isVisible: this.props.mesh.isVisible };
    }
    showBoundingBox() {
        const mesh = this.props.mesh;
        mesh.showBoundingBox = !this.state.isBoundingBoxEnabled;
        this.props.globalState.onPropertyChangedObservable.notifyObservers({
            object: mesh,
            property: "showBoundingBox",
            value: mesh.showBoundingBox,
            initialValue: !mesh.showBoundingBox,
        });
        this.setState({ isBoundingBoxEnabled: !this.state.isBoundingBoxEnabled });
    }
    switchVisibility() {
        const newState = !this.state.isVisible;
        this.setState({ isVisible: newState });
        this.props.mesh.isVisible = newState;
        this.props.globalState.onPropertyChangedObservable.notifyObservers({ object: this.props.mesh, property: "isVisible", value: newState, initialValue: !newState });
    }
    // mesh.name can fail the type check when we're in javascript, so
    // we can check to avoid crashing
    _getNameForLabel() {
        return typeof this.props.mesh.name === "string" ? this.props.mesh.name : "no name";
    }
    _editGeometry() {
        const mesh = this.props.mesh;
        mesh._internalMetadata.nodeGeometry.edit({
            nodeGeometryEditorConfig: {
                backgroundColor: mesh.getScene().clearColor,
                hostMesh: mesh,
                hostScene: mesh.getScene(),
            },
        });
    }
    render() {
        const mesh = this.props.mesh;
        const visibilityElement = this.state.isVisible ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faEye }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faEyeSlash, className: "isNotActive" });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "meshTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_2__.TreeItemLabelComponent, { label: this._getNameForLabel(), onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faCube, color: "dodgerblue" }), mesh._internalMetadata && mesh._internalMetadata.nodeGeometry && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "edit icon", onClick: () => this._editGeometry(), title: "Edit Node Geometry", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faPen }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.isBoundingBoxEnabled ? "bounding-box selected icon" : "bounding-box icon", onClick: () => this.showBoundingBox(), title: "Show/Hide bounding box", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_regular_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faSquare }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "visibility icon", onClick: () => this.switchVisibility(), title: "Show/Hide mesh", children: visibilityElement }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_3__.ExtensionsComponent, { target: mesh, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/particleSystemTreeItemComponent.js":
/*!********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/particleSystemTreeItemComponent.js ***!
  \********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2804886__) => {

"use strict";
__nested_webpack_require_2804886__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2804886__.d(__nested_webpack_exports__, {
/* harmony export */   ParticleSystemTreeItemComponent: () => (/* binding */ ParticleSystemTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2804886__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2804886__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2804886__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2804886__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2804886__(/*! react */ "../../../../node_modules/react/index.js");





class ParticleSystemTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "particleSystemTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: this.props.system.name || "Particle system", onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faBraille, color: "crimson" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: this.props.system, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/postProcessTreeItemComponent.js":
/*!*****************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/postProcessTreeItemComponent.js ***!
  \*****************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2807457__) => {

"use strict";
__nested_webpack_require_2807457__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2807457__.d(__nested_webpack_exports__, {
/* harmony export */   PostProcessItemComponent: () => (/* binding */ PostProcessItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2807457__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2807457__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2807457__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2807457__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2807457__(/*! react */ "../../../../node_modules/react/index.js");





class PostProcessItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "postProcessTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: this.props.postProcess.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faMagic, color: "red" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: this.props.postProcess, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/renderingPipelineTreeItemComponent.js":
/*!***********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/renderingPipelineTreeItemComponent.js ***!
  \***********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2810011__) => {

"use strict";
__nested_webpack_require_2810011__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2810011__.d(__nested_webpack_exports__, {
/* harmony export */   RenderingPipelineItemComponent: () => (/* binding */ RenderingPipelineItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2810011__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2810011__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2810011__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2810011__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2810011__(/*! react */ "../../../../node_modules/react/index.js");





class RenderingPipelineItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "postProcessTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: this.props.renderPipeline.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faMagic, color: "orangered" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: this.props.renderPipeline, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/sceneTreeItemComponent.js":
/*!***********************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/sceneTreeItemComponent.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2812547__) => {

"use strict";
__nested_webpack_require_2812547__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2812547__.d(__nested_webpack_exports__, {
/* harmony export */   SceneTreeItemComponent: () => (/* binding */ SceneTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2812547__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2812547__(/*! core/Maths/math */ "core/Misc/observable");
/* harmony import */ var core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_2812547__.n(core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2812547__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2812547__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2812547__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2812547__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _components_propertyChangedEvent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2812547__(/*! ../../../components/propertyChangedEvent */ "../../../dev/inspector/dist/components/propertyChangedEvent.js");
/* harmony import */ var _treeNodeDebugger__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2812547__(/*! ../treeNodeDebugger */ "../../../dev/inspector/dist/components/sceneExplorer/treeNodeDebugger.js");











class SceneTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_4__.Component {
    constructor(props) {
        super(props);
        this._posDragEnd = null;
        this._scaleDragEnd = null;
        this._rotateDragEnd = null;
        const scene = this.props.scene;
        let gizmoMode = 0;
        if (scene.reservedDataStore && scene.reservedDataStore.gizmoManager) {
            const manager = scene.reservedDataStore.gizmoManager;
            if (manager.positionGizmoEnabled) {
                gizmoMode = 1;
            }
            else if (manager.rotationGizmoEnabled) {
                gizmoMode = 2;
            }
            else if (manager.scaleGizmoEnabled) {
                gizmoMode = 3;
            }
            else if (manager.boundingBoxGizmoEnabled) {
                gizmoMode = 4;
            }
            // autopicking is disable by default
            manager.enableAutoPicking = false;
        }
        this.state = { isSelected: false, isInPickingMode: false, gizmoMode: gizmoMode, isInWorldCoodinatesMode: false };
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (nextProps.selectedEntity) {
            if (nextProps.scene === nextProps.selectedEntity) {
                nextState.isSelected = true;
                return true;
            }
            else {
                nextState.isSelected = false;
            }
        }
        this.updateGizmoAutoPicking(nextState.isInPickingMode);
        return true;
    }
    updateGizmoAutoPicking(isInPickingMode) {
        const scene = this.props.scene;
        if (scene.reservedDataStore && scene.reservedDataStore.gizmoManager) {
            const manager = scene.reservedDataStore.gizmoManager;
            manager.enableAutoPicking = isInPickingMode;
        }
    }
    componentDidMount() {
        if (!this.props.onSelectionChangedObservable) {
            return;
        }
        const scene = this.props.scene;
        this._onSelectionChangeObserver = this.props.onSelectionChangedObservable.add((entity) => {
            this._selectedEntity = entity;
            if (entity && scene.reservedDataStore && scene.reservedDataStore.gizmoManager) {
                const manager = scene.reservedDataStore.gizmoManager;
                const className = entity.getClassName();
                if (className === "TransformNode" || className.indexOf("Mesh") !== -1) {
                    manager.attachToMesh(entity);
                }
                else if (className.indexOf("Light") !== -1) {
                    if (!this._selectedEntity.reservedDataStore || !this._selectedEntity.reservedDataStore.lightGizmo) {
                        this.props.globalState.enableLightGizmo(this._selectedEntity, true, this.props.gizmoCamera);
                        this.forceUpdate();
                    }
                    manager.attachToNode(this._selectedEntity.reservedDataStore.lightGizmo.attachedNode);
                }
                else if (className.indexOf("Camera") !== -1) {
                    if (!this._selectedEntity.reservedDataStore || !this._selectedEntity.reservedDataStore.cameraGizmo) {
                        this.props.globalState.enableCameraGizmo(this._selectedEntity, true, this.props.gizmoCamera);
                        this.forceUpdate();
                    }
                    manager.attachToNode(this._selectedEntity.reservedDataStore.cameraGizmo.attachedNode);
                }
                else if (className.indexOf("Bone") !== -1) {
                    manager.attachToMesh(this._selectedEntity._linkedTransformNode ? this._selectedEntity._linkedTransformNode : this._selectedEntity);
                    if (!this._selectedEntity._linkedTransformNode) {
                        manager.additionalTransformNode = this._getMeshFromBone(this._selectedEntity, scene);
                    }
                }
                else {
                    manager.attachToNode(null);
                }
            }
        });
    }
    _getMeshFromBone(bone, scene) {
        const skeleton = bone.getSkeleton();
        // First try to find a mesh for which we've enabled the skeleton viewer
        for (const mesh of scene.meshes) {
            const skeletonViewer = mesh.reservedDataStore?.skeletonViewer;
            if (skeletonViewer && skeletonViewer.skeleton === skeleton) {
                return mesh;
            }
        }
        // Not found, return the first mesh that uses the skeleton
        for (const mesh of scene.meshes) {
            if (mesh.skeleton === skeleton) {
                return mesh;
            }
        }
        return undefined;
    }
    componentWillUnmount() {
        const scene = this.props.scene;
        if (this._onPointerObserver) {
            scene.onPointerObservable.remove(this._onPointerObserver);
            this._onPointerObserver = null;
        }
        if (this._gizmoLayerOnPointerObserver) {
            scene.onPointerObservable.remove(this._gizmoLayerOnPointerObserver);
            this._gizmoLayerOnPointerObserver = null;
        }
        if (this._onSelectionChangeObserver && this.props.onSelectionChangedObservable) {
            this.props.onSelectionChangedObservable.remove(this._onSelectionChangeObserver);
        }
    }
    onSelect() {
        if (!this.props.onSelectionChangedObservable) {
            return;
        }
        const scene = this.props.scene;
        // Put scene object into window.debugNode
        (0,_treeNodeDebugger__WEBPACK_IMPORTED_MODULE_6__.setDebugNode)(scene);
        this.props.onSelectionChangedObservable.notifyObservers(scene);
    }
    onCoordinatesMode() {
        const scene = this.props.scene;
        const manager = scene.reservedDataStore.gizmoManager;
        // flip coordinate system
        manager.coordinatesMode = this.state.isInWorldCoodinatesMode ? 1 /* GizmoCoordinatesMode.Local */ : 0 /* GizmoCoordinatesMode.World */;
        this.setState({ isInWorldCoodinatesMode: !this.state.isInWorldCoodinatesMode });
    }
    onPickingMode() {
        const scene = this.props.scene;
        if (this._onPointerObserver) {
            scene.onPointerObservable.remove(this._onPointerObserver);
            this._onPointerObserver = null;
        }
        if (!this.state.isInPickingMode) {
            this._onPointerObserver = scene.onPointerObservable.add(() => {
                const pickPosition = scene.unTranslatedPointer;
                const pickInfo = scene.pick(pickPosition.x, pickPosition.y, (mesh) => mesh.isEnabled() && mesh.isVisible && mesh.getTotalVertices() > 0, false, undefined, (p0, p1, p2, ray) => {
                    if (!this.props.globalState.ignoreBackfacesForPicking) {
                        return true;
                    }
                    const p0p1 = core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0];
                    const p1p2 = core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[1];
                    let normal = core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[2];
                    p1.subtractToRef(p0, p0p1);
                    p2.subtractToRef(p1, p1p2);
                    normal = core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.Vector3.Cross(p0p1, p1p2);
                    return core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.Vector3.Dot(normal, ray.direction) < 0;
                });
                // Pick light gizmos first
                if (this.props.globalState.lightGizmos.length > 0) {
                    const gizmoScene = this.props.globalState.lightGizmos[0].gizmoLayer.utilityLayerScene;
                    const pickInfo = gizmoScene.pick(pickPosition.x, pickPosition.y, (m) => {
                        for (const g of this.props.globalState.lightGizmos) {
                            if (g.attachedNode == m) {
                                return true;
                            }
                        }
                        return false;
                    });
                    if (pickInfo && pickInfo.hit && this.props.onSelectionChangedObservable) {
                        this.props.onSelectionChangedObservable.notifyObservers(pickInfo.pickedMesh);
                        return;
                    }
                }
                // Pick camera gizmos
                if (this.props.globalState.cameraGizmos.length > 0) {
                    const gizmoScene = this.props.globalState.cameraGizmos[0].gizmoLayer.utilityLayerScene;
                    const pickInfo = gizmoScene.pick(pickPosition.x, pickPosition.y, (m) => {
                        for (const g of this.props.globalState.cameraGizmos) {
                            if (g.attachedNode == m) {
                                return true;
                            }
                        }
                        return false;
                    });
                    if (pickInfo && pickInfo.hit && this.props.onSelectionChangedObservable) {
                        this.props.onSelectionChangedObservable.notifyObservers(pickInfo.pickedMesh);
                        return;
                    }
                }
                if (pickInfo && pickInfo.hit && this.props.onSelectionChangedObservable) {
                    this.props.onSelectionChangedObservable.notifyObservers(pickInfo.pickedMesh);
                }
            }, core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERTAP);
        }
        this.setState({ isInPickingMode: !this.state.isInPickingMode });
    }
    setGizmoMode(mode) {
        const scene = this.props.scene;
        if (!scene.reservedDataStore) {
            scene.reservedDataStore = {};
        }
        if (this._gizmoLayerOnPointerObserver) {
            scene.onPointerObservable.remove(this._gizmoLayerOnPointerObserver);
            this._gizmoLayerOnPointerObserver = null;
        }
        if (!scene.reservedDataStore.gizmoManager) {
            scene.reservedDataStore.gizmoManager = new core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.GizmoManager(scene, undefined, new core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.UtilityLayerRenderer(scene), new core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.UtilityLayerRenderer(scene));
        }
        if (this.props.gizmoCamera) {
            scene.reservedDataStore.gizmoManager.utilityLayer.setRenderCamera(this.props.gizmoCamera);
        }
        const manager = scene.reservedDataStore.gizmoManager;
        // Allow picking of light gizmo when a gizmo mode is selected
        this._gizmoLayerOnPointerObserver = core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
            if (pointerInfo.type == core_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERDOWN) {
                if (pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh) {
                    let node = pointerInfo.pickInfo.pickedMesh;
                    // Attach to the most parent node
                    while (node && node.parent != null) {
                        node = node.parent;
                    }
                    for (const gizmo of this.props.globalState.lightGizmos) {
                        if (gizmo._rootMesh == node) {
                            manager.attachToNode(gizmo.attachedNode);
                        }
                    }
                }
            }
        });
        manager.boundingBoxGizmoEnabled = false;
        manager.positionGizmoEnabled = false;
        manager.rotationGizmoEnabled = false;
        manager.scaleGizmoEnabled = false;
        if (this.state.gizmoMode === mode) {
            mode = 0;
            manager.dispose();
            scene.reservedDataStore.gizmoManager = null;
        }
        else {
            switch (mode) {
                case 1:
                    manager.positionGizmoEnabled = true;
                    if (!this._posDragEnd) {
                        // Record movement for generating replay code
                        this._posDragEnd = manager.gizmos.positionGizmo.onDragEndObservable.add(() => {
                            if (manager.gizmos.positionGizmo && manager.gizmos.positionGizmo.attachedNode) {
                                const lightGizmo = manager.gizmos.positionGizmo.attachedNode.reservedDataStore
                                    ? manager.gizmos.positionGizmo.attachedNode.reservedDataStore.lightGizmo
                                    : null;
                                const objLight = lightGizmo && lightGizmo.light ? lightGizmo.light : manager.gizmos.positionGizmo.attachedNode;
                                if (objLight.position) {
                                    const e = new _components_propertyChangedEvent__WEBPACK_IMPORTED_MODULE_5__.PropertyChangedEvent();
                                    e.object = objLight;
                                    e.property = "position";
                                    e.value = objLight.position;
                                    this.props.globalState.onPropertyChangedObservable.notifyObservers(e);
                                }
                                else {
                                    const cameraGizmo = manager.gizmos.positionGizmo.attachedNode.reservedDataStore
                                        ? manager.gizmos.positionGizmo.attachedNode.reservedDataStore.cameraGizmo
                                        : null;
                                    const objCamera = cameraGizmo && cameraGizmo.camera ? cameraGizmo.camera : manager.gizmos.positionGizmo.attachedNode;
                                    if (objCamera.position) {
                                        const e = new _components_propertyChangedEvent__WEBPACK_IMPORTED_MODULE_5__.PropertyChangedEvent();
                                        e.object = objCamera;
                                        e.property = "position";
                                        e.value = objCamera.position;
                                        this.props.globalState.onPropertyChangedObservable.notifyObservers(e);
                                    }
                                }
                            }
                        });
                    }
                    break;
                case 2:
                    manager.rotationGizmoEnabled = true;
                    if (!this._rotateDragEnd) {
                        // Record movement for generating replay code
                        this._rotateDragEnd = manager.gizmos.rotationGizmo.onDragEndObservable.add(() => {
                            if (manager.gizmos.rotationGizmo && manager.gizmos.rotationGizmo.attachedNode) {
                                const lightGizmo = manager.gizmos.rotationGizmo.attachedNode.reservedDataStore
                                    ? manager.gizmos.rotationGizmo.attachedNode.reservedDataStore.lightGizmo
                                    : null;
                                const objLight = lightGizmo && lightGizmo.light ? lightGizmo.light : manager.gizmos.rotationGizmo.attachedNode;
                                const cameraGizmo = manager.gizmos.rotationGizmo.attachedNode.reservedDataStore
                                    ? manager.gizmos.rotationGizmo.attachedNode.reservedDataStore.cameraGizmo
                                    : null;
                                const objCamera = cameraGizmo && cameraGizmo.camera ? cameraGizmo.camera : manager.gizmos.rotationGizmo.attachedNode;
                                if (objLight.rotationQuaternion) {
                                    const e = new _components_propertyChangedEvent__WEBPACK_IMPORTED_MODULE_5__.PropertyChangedEvent();
                                    e.object = objLight;
                                    e.property = "rotationQuaternion";
                                    e.value = objLight.rotationQuaternion;
                                    this.props.globalState.onPropertyChangedObservable.notifyObservers(e);
                                }
                                else if (objLight.rotation) {
                                    const e = new _components_propertyChangedEvent__WEBPACK_IMPORTED_MODULE_5__.PropertyChangedEvent();
                                    e.object = objLight;
                                    e.property = "rotation";
                                    e.value = objLight.rotation;
                                    this.props.globalState.onPropertyChangedObservable.notifyObservers(e);
                                }
                                else if (objLight.direction) {
                                    const e = new _components_propertyChangedEvent__WEBPACK_IMPORTED_MODULE_5__.PropertyChangedEvent();
                                    e.object = objLight;
                                    e.property = "direction";
                                    e.value = objLight.direction;
                                    this.props.globalState.onPropertyChangedObservable.notifyObservers(e);
                                }
                                else if (objCamera.rotationQuaternion) {
                                    const e = new _components_propertyChangedEvent__WEBPACK_IMPORTED_MODULE_5__.PropertyChangedEvent();
                                    e.object = objCamera;
                                    e.property = "rotationQuaternion";
                                    e.value = objCamera.rotationQuaternion;
                                    this.props.globalState.onPropertyChangedObservable.notifyObservers(e);
                                }
                                else if (objCamera.rotation) {
                                    const e = new _components_propertyChangedEvent__WEBPACK_IMPORTED_MODULE_5__.PropertyChangedEvent();
                                    e.object = objCamera;
                                    e.property = "rotation";
                                    e.value = objCamera.rotation;
                                    this.props.globalState.onPropertyChangedObservable.notifyObservers(e);
                                }
                            }
                        });
                    }
                    break;
                case 3:
                    manager.scaleGizmoEnabled = true;
                    if (!this._scaleDragEnd) {
                        // Record movement for generating replay code
                        this._scaleDragEnd = manager.gizmos.scaleGizmo.onDragEndObservable.add(() => {
                            if (manager.gizmos.scaleGizmo && manager.gizmos.scaleGizmo.attachedMesh) {
                                const lightGizmo = manager.gizmos.scaleGizmo.attachedMesh.reservedDataStore
                                    ? manager.gizmos.scaleGizmo.attachedMesh.reservedDataStore.lightGizmo
                                    : null;
                                const obj = lightGizmo && lightGizmo.light ? lightGizmo.light : manager.gizmos.scaleGizmo.attachedMesh;
                                if (obj.scaling) {
                                    const e = new _components_propertyChangedEvent__WEBPACK_IMPORTED_MODULE_5__.PropertyChangedEvent();
                                    e.object = obj;
                                    e.property = "scaling";
                                    e.value = obj.scaling;
                                    this.props.globalState.onPropertyChangedObservable.notifyObservers(e);
                                }
                            }
                        });
                    }
                    break;
                case 4:
                    manager.boundingBoxGizmoEnabled = true;
                    if (manager.gizmos.boundingBoxGizmo) {
                        manager.gizmos.boundingBoxGizmo.fixedDragMeshScreenSize = true;
                    }
                    break;
            }
            if (this._selectedEntity && this._selectedEntity.getClassName) {
                const className = this._selectedEntity.getClassName();
                if (className === "TransformNode" || className.indexOf("Mesh") !== -1) {
                    manager.attachToMesh(this._selectedEntity);
                }
                else if (className.indexOf("Light") !== -1) {
                    if (!this._selectedEntity.reservedDataStore || !this._selectedEntity.reservedDataStore.lightGizmo) {
                        this.props.globalState.enableLightGizmo(this._selectedEntity, true, this.props.gizmoCamera);
                        this.forceUpdate();
                    }
                    manager.attachToNode(this._selectedEntity.reservedDataStore.lightGizmo.attachedNode);
                }
                else if (className.indexOf("Camera") !== -1) {
                    if (!this._selectedEntity.reservedDataStore || !this._selectedEntity.reservedDataStore.cameraGizmo) {
                        this.props.globalState.enableCameraGizmo(this._selectedEntity, true, this.props.gizmoCamera);
                        this.forceUpdate();
                    }
                    manager.attachToNode(this._selectedEntity.reservedDataStore.cameraGizmo.attachedNode);
                }
                else if (className.indexOf("Bone") !== -1) {
                    manager.attachToMesh(this._selectedEntity._linkedTransformNode ? this._selectedEntity._linkedTransformNode : this._selectedEntity);
                    if (!this._selectedEntity._linkedTransformNode) {
                        manager.additionalTransformNode = this._getMeshFromBone(this._selectedEntity, scene);
                    }
                }
            }
        }
        this.setState({ gizmoMode: mode });
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.isSelected ? "itemContainer selected" : "itemContainer", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "sceneNode", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "sceneTitle", onClick: () => this.onSelect(), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faImage }), "\u00A0Scene"] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.gizmoMode === 1 ? "translation selected icon" : "translation icon", onClick: () => this.setGizmoMode(1), title: "Enable/Disable position mode", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faArrowsAlt }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.gizmoMode === 2 ? "rotation selected icon" : "rotation icon", onClick: () => this.setGizmoMode(2), title: "Enable/Disable rotation mode", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faRedoAlt }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.gizmoMode === 3 ? "scaling selected icon" : "scaling icon", onClick: () => this.setGizmoMode(3), title: "Enable/Disable scaling mode", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faCompress }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.gizmoMode === 4 ? "bounding selected icon" : "bounding icon", onClick: () => this.setGizmoMode(4), title: "Enable/Disable bounding box mode", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faVectorSquare }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "separator" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.isInPickingMode ? "pickingMode selected icon" : "pickingMode icon", onClick: () => this.onPickingMode(), title: "Turn picking mode on/off", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faCrosshairs }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.state.isInWorldCoodinatesMode ? "coordinates selected icon" : "coordinates icon", onClick: () => this.onCoordinatesMode(), title: "Switch between world and local coordinates", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faLocationDot }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "refresh icon", onClick: () => this.props.onRefresh(), title: "Refresh the explorer", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faSyncAlt }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_3__.ExtensionsComponent, { target: this.props.scene, extensibilityGroups: this.props.extensibilityGroups })] }) }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/skeletonTreeItemComponent.js":
/*!**************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/skeletonTreeItemComponent.js ***!
  \**************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2841121__) => {

"use strict";
__nested_webpack_require_2841121__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2841121__.d(__nested_webpack_exports__, {
/* harmony export */   SkeletonTreeItemComponent: () => (/* binding */ SkeletonTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2841121__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2841121__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2841121__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2841121__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2841121__(/*! react */ "../../../../node_modules/react/index.js");





class SkeletonTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const skeleton = this.props.skeleton;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "skeletonTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: skeleton.name || "no name", onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faSkull, color: "gray" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: skeleton, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/soundTreeItemComponent.js":
/*!***********************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/soundTreeItemComponent.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2843659__) => {

"use strict";
__nested_webpack_require_2843659__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2843659__.d(__nested_webpack_exports__, {
/* harmony export */   SoundTreeItemComponent: () => (/* binding */ SoundTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2843659__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2843659__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2843659__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2843659__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2843659__(/*! react */ "../../../../node_modules/react/index.js");





class SoundTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const sound = this.props.sound;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "soundTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: sound.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faMusic, color: "teal" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: sound, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/spriteManagerTreeItemComponent.js":
/*!*******************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/spriteManagerTreeItemComponent.js ***!
  \*******************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2846192__) => {

"use strict";
__nested_webpack_require_2846192__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2846192__.d(__nested_webpack_exports__, {
/* harmony export */   SpriteManagerTreeItemComponent: () => (/* binding */ SpriteManagerTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2846192__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2846192__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2846192__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2846192__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2846192__(/*! react */ "../../../../node_modules/react/index.js");





class SpriteManagerTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "spriteManagerTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: this.props.spriteManager.name || "No name", onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faAddressBook, color: "blanchedalmond" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: this.props.spriteManager, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/spriteTreeItemComponent.js":
/*!************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/spriteTreeItemComponent.js ***!
  \************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2848756__) => {

"use strict";
__nested_webpack_require_2848756__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2848756__.d(__nested_webpack_exports__, {
/* harmony export */   SpriteTreeItemComponent: () => (/* binding */ SpriteTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2848756__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2848756__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2848756__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2848756__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2848756__(/*! react */ "../../../../node_modules/react/index.js");





class SpriteTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "spriteTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: this.props.sprite.name || "No name", onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faGhost, color: "blanchedalmond" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: this.props.sprite, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/targetedAnimationTreeItemComponent.js":
/*!***********************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/targetedAnimationTreeItemComponent.js ***!
  \***********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2851316__) => {

"use strict";
__nested_webpack_require_2851316__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2851316__.d(__nested_webpack_exports__, {
/* harmony export */   TargetedAnimationItemComponent: () => (/* binding */ TargetedAnimationItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2851316__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2851316__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2851316__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2851316__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2851316__(/*! react */ "../../../../node_modules/react/index.js");





class TargetedAnimationItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const targetedAnimation = this.props.targetedAnimation;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "targetedAnimationTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: targetedAnimation.animation.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faFilm, color: "cornflowerblue" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: targetedAnimation, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/textureTreeItemComponent.js":
/*!*************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/textureTreeItemComponent.js ***!
  \*************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2853928__) => {

"use strict";
__nested_webpack_require_2853928__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2853928__.d(__nested_webpack_exports__, {
/* harmony export */   TextureTreeItemComponent: () => (/* binding */ TextureTreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2853928__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2853928__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2853928__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2853928__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2853928__(/*! react */ "../../../../node_modules/react/index.js");





class TextureTreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "textureTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: this.props.texture.displayName || this.props.texture.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faImage, color: "mediumpurple" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: this.props.texture, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/entities/transformNodeTreeItemComponent.js":
/*!*******************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/entities/transformNodeTreeItemComponent.js ***!
  \*******************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2856497__) => {

"use strict";
__nested_webpack_require_2856497__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2856497__.d(__nested_webpack_exports__, {
/* harmony export */   TransformNodeItemComponent: () => (/* binding */ TransformNodeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2856497__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2856497__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2856497__(/*! ../treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2856497__(/*! ../extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2856497__(/*! react */ "../../../../node_modules/react/index.js");





class TransformNodeItemComponent extends react__WEBPACK_IMPORTED_MODULE_3__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const transformNode = this.props.transformNode;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "transformNodeTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemLabelComponent, { label: transformNode.name, onClick: () => this.props.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.faCodeBranch, color: "cornflowerblue" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_2__.ExtensionsComponent, { target: transformNode, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js":
/*!***********************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js ***!
  \***********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2859017__) => {

"use strict";
__nested_webpack_require_2859017__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2859017__.d(__nested_webpack_exports__, {
/* harmony export */   ExtensionsComponent: () => (/* binding */ ExtensionsComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2859017__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2859017__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2859017__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2859017__(/*! react */ "../../../../node_modules/react/index.js");




class ExtensionsComponent extends react__WEBPACK_IMPORTED_MODULE_2__.Component {
    constructor(props) {
        super(props);
        this.state = { popupVisible: false };
        this._extensionRef = react__WEBPACK_IMPORTED_MODULE_2__.createRef();
    }
    showPopup() {
        this.setState({ popupVisible: true });
    }
    componentDidMount() {
        if (!this._popup) {
            return;
        }
        this._popup.focus();
    }
    componentDidUpdate() {
        if (!this._popup) {
            return;
        }
        this._popup.focus();
    }
    render() {
        if (!this.props.extensibilityGroups) {
            return null;
        }
        const options = [];
        for (const group of this.props.extensibilityGroups) {
            if (group.predicate(this.props.target)) {
                options.push(...group.entries);
            }
        }
        if (options.length === 0) {
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { ref: this._extensionRef, className: "extensions", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { title: "Additional options", className: "icon", onClick: () => this.showPopup(), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_1__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faEllipsisH }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: (input) => {
                        this._popup = input;
                    }, tabIndex: -1, className: this.state.popupVisible ? "popup show" : "popup", onBlur: () => this.setState({ popupVisible: false }), children: options.map((extensibility) => {
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "popupMenu", onClick: () => {
                                extensibility.action(this.props.target);
                                if (!extensibility.keepOpenAfterClick) {
                                    this.setState({ popupVisible: false });
                                }
                            }, children: extensibility.label }, extensibility.label));
                    }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/sceneExplorerComponent.js":
/*!**************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/sceneExplorerComponent.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2862774__) => {

"use strict";
__nested_webpack_require_2862774__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2862774__.d(__nested_webpack_exports__, {
/* harmony export */   SceneExplorerComponent: () => (/* binding */ SceneExplorerComponent),
/* harmony export */   SceneExplorerFilterComponent: () => (/* binding */ SceneExplorerFilterComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2862774__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2862774__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2862774__(/*! core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent */ "core/Misc/observable");
/* harmony import */ var core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2862774__.n(core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _treeItemComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2862774__(/*! ./treeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemComponent.js");
/* harmony import */ var re_resizable__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2862774__(/*! re-resizable */ "../../../../node_modules/re-resizable/lib/index.js");
/* harmony import */ var _headerComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2862774__(/*! ../headerComponent */ "../../../dev/inspector/dist/components/headerComponent.js");
/* harmony import */ var _entities_sceneTreeItemComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2862774__(/*! ./entities/sceneTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/sceneTreeItemComponent.js");
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2862774__(/*! ../../tools */ "../../../dev/inspector/dist/tools.js");
/* harmony import */ var _sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2862774__(/*! ./sceneExplorer.scss */ "../../../dev/inspector/dist/components/sceneExplorer/sceneExplorer.scss");
























// side effects




const ResizableCasted = re_resizable__WEBPACK_IMPORTED_MODULE_4__.Resizable;
class SceneExplorerFilterComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "filter", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", placeholder: "Filter", onChange: (evt) => this.props.onFilter(evt.target.value) }) }));
    }
}
class SceneExplorerComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._mutationTimeout = null;
        this._once = true;
        this._hooked = false;
        this.state = { filter: null, selectedEntity: null, scene: this.props.scene };
        this._sceneMutationFunc = this.processMutation.bind(this);
        this._sceneExplorerRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._onNewSceneObserver = this.props.globalState.onNewSceneObservable.add((scene) => {
            this.setState({
                scene,
            });
        });
    }
    processMutation() {
        if (this.props.globalState.blockMutationUpdates) {
            return;
        }
        // To avoid perf hits we want to make sure that we are not rebuilding the entire tree on each call
        if (this._mutationTimeout !== null) {
            window.clearTimeout(this._mutationTimeout);
        }
        this._mutationTimeout = window.setTimeout(() => {
            this._mutationTimeout = null;
            this.forceUpdate();
        }, 32);
    }
    componentDidMount() {
        this._onSelectionChangeObserver = this.props.globalState.onSelectionChangedObservable.add((entity) => {
            if (this.state.selectedEntity !== entity) {
                this.setState({ selectedEntity: entity });
            }
        });
        this._onSelectionRenamedObserver = this.props.globalState.onSelectionRenamedObservable.add(() => {
            this.forceUpdate();
        });
    }
    componentWillUnmount() {
        if (this._onSelectionChangeObserver) {
            this.props.globalState.onSelectionChangedObservable.remove(this._onSelectionChangeObserver);
        }
        if (this._onSelectionRenamedObserver) {
            this.props.globalState.onSelectionRenamedObservable.remove(this._onSelectionRenamedObserver);
        }
        if (this._onNewSceneAddedObserver) {
            core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.EngineStore.LastCreatedEngine.onNewSceneAddedObservable.remove(this._onNewSceneAddedObserver);
        }
        if (this._onNewSceneObserver) {
            this.props.globalState.onNewSceneObservable.remove(this._onNewSceneObserver);
        }
        const scene = this.state.scene;
        scene.onNewSkeletonAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewCameraAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewLightAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewMaterialAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewMeshAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewTextureAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewTransformNodeAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onSkeletonRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onMeshRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onCameraRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onLightRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onMaterialRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onTransformNodeRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onTextureRemovedObservable.removeCallback(this._sceneMutationFunc);
    }
    filterContent(filter) {
        this.setState({ filter: filter });
    }
    findSiblings(parent, items, target, goNext, data) {
        if (!items) {
            return false;
        }
        const sortedItems = _tools__WEBPACK_IMPORTED_MODULE_7__.Tools.SortAndFilter(parent, items);
        if (!items || sortedItems.length === 0) {
            return false;
        }
        for (const item of sortedItems) {
            if (item === target) {
                // found the current selection!
                data.found = true;
                if (!goNext) {
                    if (data.previousOne) {
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(data.previousOne);
                    }
                    return true;
                }
            }
            else {
                if (data.found) {
                    this.props.globalState.onSelectionChangedObservable.notifyObservers(item);
                    return true;
                }
                data.previousOne = item;
            }
            if (item.getChildren && item.reservedDataStore && item.reservedDataStore.isExpanded) {
                if (this.findSiblings(item, item.getChildren(), target, goNext, data)) {
                    return true;
                }
            }
        }
        return false;
    }
    processKeys(keyEvent, allNodes) {
        if (!this.state.selectedEntity) {
            return;
        }
        const scene = this.state.scene;
        let search = false;
        let goNext = false;
        if (keyEvent.keyCode === 38) {
            // up
            search = true;
        }
        else if (keyEvent.keyCode === 40) {
            // down
            goNext = true;
            search = true;
        }
        else if (keyEvent.keyCode === 13 || keyEvent.keyCode === 39) {
            // enter or right
            const reservedDataStore = this.state.selectedEntity.reservedDataStore;
            if (reservedDataStore && reservedDataStore.setExpandedState) {
                reservedDataStore.setExpandedState(true);
            }
            keyEvent.preventDefault();
            return;
        }
        else if (keyEvent.keyCode === 37) {
            // left
            const reservedDataStore = this.state.selectedEntity.reservedDataStore;
            if (reservedDataStore && reservedDataStore.setExpandedState) {
                reservedDataStore.setExpandedState(false);
            }
            keyEvent.preventDefault();
            return;
        }
        else if (keyEvent.keyCode === 46) {
            // delete
            this.state.selectedEntity.dispose();
            this.props.globalState.onSelectionChangedObservable.notifyObservers(scene);
        }
        if (!search) {
            return;
        }
        keyEvent.preventDefault();
        const data = {};
        for (const nodeGroup of allNodes) {
            if (this.findSiblings(null, nodeGroup, this.state.selectedEntity, goNext, data)) {
                break;
            }
        }
    }
    _getPipelineContextMenus(scene, pipelines) {
        const defaultMenuItems = [];
        if (scene.activeCamera) {
            if (!pipelines.some((p) => p.getClassName() === "DefaultRenderingPipeline")) {
                defaultMenuItems.push({
                    label: "Add new Default Rendering Pipeline",
                    action: () => {
                        const newPipeline = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.DefaultRenderingPipeline("Default rendering pipeline", true, scene, scene.cameras);
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(newPipeline);
                    },
                });
            }
            if (!pipelines.some((p) => p.getClassName() === "SSAORenderingPipeline")) {
                defaultMenuItems.push({
                    label: "Add new SSAO Rendering Pipeline",
                    action: () => {
                        const newPipeline = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.SSAORenderingPipeline("SSAO rendering pipeline", scene, 1, scene.cameras);
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(newPipeline);
                    },
                });
            }
            if (scene.getEngine().getCaps().drawBuffersExtension && !pipelines.some((p) => p.getClassName() === "SSAORenderingPipeline")) {
                defaultMenuItems.push({
                    label: "Add new SSAO2 Rendering Pipeline",
                    action: () => {
                        const newPipeline = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.SSAO2RenderingPipeline("SSAO2 rendering pipeline", scene, 1, scene.cameras);
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(newPipeline);
                    },
                });
            }
            if (scene.getEngine().getCaps().drawBuffersExtension && scene.getEngine().getCaps().texelFetch && !pipelines.some((p) => p.getClassName() === "SSRRenderingPipeline")) {
                defaultMenuItems.push({
                    label: "Add new SSR Rendering Pipeline",
                    action: () => {
                        const newPipeline = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.SSRRenderingPipeline("SSR rendering pipeline", scene, scene.cameras);
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(newPipeline);
                    },
                });
            }
            if (scene.getEngine().getCaps().drawBuffersExtension &&
                scene.getEngine().getCaps().texelFetch &&
                !pipelines.some((p) => p.getClassName() === "IBLShadowsRenderingPipeline")) {
                defaultMenuItems.push({
                    label: "Add new IBL Shadows Rendering Pipeline",
                    action: () => {
                        const newPipeline = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.IblShadowsRenderPipeline("IBL Shadows rendering pipeline", scene, {}, scene.cameras);
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(newPipeline);
                    },
                });
            }
        }
        const customMenuItems = this.props.contextMenu?.pipeline || [];
        const useDefaults = !this.props.contextMenuOverride?.includes("pipeline");
        return useDefaults ? [...defaultMenuItems, ...customMenuItems] : customMenuItems;
    }
    _getNodeContextMenus(scene) {
        const defaultMenuItems = [];
        defaultMenuItems.push({
            label: "Add new point light",
            action: () => {
                const newPointLight = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.PointLight("point light", core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero(), scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newPointLight);
            },
        });
        defaultMenuItems.push({
            label: "Add new directional light",
            action: () => {
                const newDirectionalLight = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.DirectionalLight("directional light", new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.Vector3(-1, -1, -0.5), scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newDirectionalLight);
            },
        });
        defaultMenuItems.push({
            label: "Add new free camera",
            action: () => {
                const newFreeCamera = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.FreeCamera("free camera", scene.activeCamera ? scene.activeCamera.globalPosition : new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, -5), scene);
                if (scene.activeCamera) {
                    newFreeCamera.minZ = scene.activeCamera.minZ;
                    newFreeCamera.maxZ = scene.activeCamera.maxZ;
                    if (scene.activeCamera.getTarget) {
                        newFreeCamera.setTarget(scene.activeCamera.getTarget());
                    }
                }
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newFreeCamera);
            },
        });
        defaultMenuItems.push({
            label: "Add new mesh from Node Geometry",
            action: () => {
                const ng = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.NodeGeometry("Node Geometry");
                ng.setToDefault();
                ng.build();
                const newMesh = ng.createMesh("Node geometry mesh", scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newMesh);
            },
        });
        const customMenuItems = this.props.contextMenu?.node || [];
        const useDefaults = !this.props.contextMenuOverride?.includes("node");
        return useDefaults ? [...defaultMenuItems, ...customMenuItems] : customMenuItems;
    }
    _getMaterialsContextMenus(scene) {
        const getUniqueName = (name) => {
            let idSubscript = 1;
            while (scene.getMaterialById(name)) {
                name = name + " " + idSubscript++;
            }
            return name;
        };
        const defaultMenuItems = [];
        defaultMenuItems.push({
            label: "Add new standard material",
            action: () => {
                const newStdMaterial = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.StandardMaterial(getUniqueName("Standard material"), scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newStdMaterial);
            },
        });
        defaultMenuItems.push({
            label: "Add new PBR material",
            action: () => {
                const newPBRMaterial = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.PBRMaterial(getUniqueName("PBR material"), scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newPBRMaterial);
            },
        });
        defaultMenuItems.push({
            label: "Add new node material",
            action: () => {
                const newNodeMaterial = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.NodeMaterial(getUniqueName("node material"), scene);
                newNodeMaterial.setToDefault();
                newNodeMaterial.build(false, false, true);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newNodeMaterial);
            },
        });
        const customMenuItems = this.props.contextMenu?.materials || [];
        const useDefaults = !this.props.contextMenuOverride?.includes("materials");
        return useDefaults ? [...defaultMenuItems, ...customMenuItems] : customMenuItems;
    }
    _getSpriteManagersContextMenus(scene) {
        const defaultMenuItems = [];
        defaultMenuItems.push({
            label: "Add new sprite manager",
            action: () => {
                const newSpriteManager = new core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.SpriteManager("Default sprite manager", "//playground.babylonjs.com/textures/player.png", 500, 64, scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newSpriteManager);
            },
        });
        const customMenuItems = this.props.contextMenu?.spriteManagers || [];
        const useDefaults = !this.props.contextMenuOverride?.includes("spriteManagers");
        return useDefaults ? [...defaultMenuItems, ...customMenuItems] : customMenuItems;
    }
    _getParticleSystemsContextMenus(scene) {
        const defaultMenuItems = [];
        defaultMenuItems.push({
            label: "Add new CPU particle system",
            action: () => {
                const newSystem = core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.ParticleHelper.CreateDefault(core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero(), 10000, scene);
                newSystem.name = "CPU particle system";
                newSystem.start();
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newSystem);
            },
        });
        if (core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.GPUParticleSystem.IsSupported) {
            defaultMenuItems.push({
                label: "Add new GPU particle system",
                action: () => {
                    const newSystem = core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.ParticleHelper.CreateDefault(core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero(), 10000, scene, true);
                    newSystem.name = "GPU particle system";
                    newSystem.start();
                    this.props.globalState.onSelectionChangedObservable.notifyObservers(newSystem);
                },
            });
        }
        const customMenuItems = this.props.contextMenu?.particleSystems || [];
        const useDefaults = !this.props.contextMenuOverride?.includes("particleSystems");
        return useDefaults ? [...defaultMenuItems, ...customMenuItems] : customMenuItems;
    }
    renderContent(allNodes) {
        const scene = this.state.scene;
        if (!scene) {
            this._onNewSceneAddedObserver = core_Engines_engineStore__WEBPACK_IMPORTED_MODULE_2__.EngineStore.LastCreatedEngine.onNewSceneAddedObservable.addOnce((scene) => this.setState({ scene: scene }));
            return null;
        }
        if (!this._hooked) {
            this._hooked = true;
            scene.onNewSkeletonAddedObservable.add(this._sceneMutationFunc);
            scene.onNewCameraAddedObservable.add(this._sceneMutationFunc);
            scene.onNewLightAddedObservable.add(this._sceneMutationFunc);
            scene.onNewMaterialAddedObservable.add(this._sceneMutationFunc);
            scene.onNewMeshAddedObservable.add(this._sceneMutationFunc);
            scene.onNewTextureAddedObservable.add(this._sceneMutationFunc);
            scene.onNewTransformNodeAddedObservable.add(this._sceneMutationFunc);
            scene.onSkeletonRemovedObservable.add(this._sceneMutationFunc);
            scene.onMeshRemovedObservable.add(this._sceneMutationFunc);
            scene.onCameraRemovedObservable.add(this._sceneMutationFunc);
            scene.onLightRemovedObservable.add(this._sceneMutationFunc);
            scene.onMaterialRemovedObservable.add(this._sceneMutationFunc);
            scene.onTransformNodeRemovedObservable.add(this._sceneMutationFunc);
            scene.onTextureRemovedObservable.add(this._sceneMutationFunc);
        }
        const guiElements = scene.textures.filter((t) => t.getClassName() === "AdvancedDynamicTexture");
        const textures = scene.textures.filter((t) => t.getClassName() !== "AdvancedDynamicTexture");
        const postProcesses = scene.postProcesses;
        const pipelines = scene.postProcessRenderPipelineManager.supportedPipelines;
        // Context menus
        const pipelineContextMenus = this._getPipelineContextMenus(scene, pipelines);
        const nodeContextMenus = this._getNodeContextMenus(scene);
        const materialsContextMenus = this._getMaterialsContextMenus(scene);
        const spriteManagersContextMenus = this._getSpriteManagersContextMenus(scene);
        const particleSystemsContextMenus = this._getParticleSystemsContextMenus(scene);
        const materials = [];
        materials.push(...scene.materials);
        if (scene.multiMaterials && scene.multiMaterials.length) {
            materials.push(...scene.multiMaterials);
        }
        const rootNodes = scene.rootNodes.slice(0);
        // Adding nodes parented to a bone
        for (const mesh of scene.meshes) {
            if (mesh.parent && mesh.parent.getClassName() === "Bone") {
                rootNodes.push(mesh);
            }
        }
        allNodes.push(rootNodes, scene.skeletons, materials, textures, postProcesses, pipelines, scene.effectLayers, scene.particleSystems, scene.spriteManagers, guiElements, scene.animationGroups);
        if (scene.mainSoundTrack) {
            allNodes.push(scene.mainSoundTrack.soundCollection);
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "tree", onContextMenu: (e) => e.preventDefault(), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SceneExplorerFilterComponent, { onFilter: (filter) => this.filterContent(filter) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_sceneTreeItemComponent__WEBPACK_IMPORTED_MODULE_6__.SceneTreeItemComponent, { globalState: this.props.globalState, gizmoCamera: this.props.gizmoCamera, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, scene: scene, onRefresh: () => this.forceUpdate(), onSelectionChangedObservable: this.props.globalState.onSelectionChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, gizmoCamera: this.props.gizmoCamera, contextMenuItems: nodeContextMenus, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: rootNodes, label: "Nodes", offset: 1, filter: this.state.filter }), scene.skeletons.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: scene.skeletons, label: "Skeletons", offset: 1, filter: this.state.filter })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: materials, contextMenuItems: materialsContextMenus, label: "Materials", offset: 1, filter: this.state.filter }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: textures, label: "Textures", offset: 1, filter: this.state.filter }), postProcesses.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: postProcesses, label: "Post-processes", offset: 1, filter: this.state.filter })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, contextMenuItems: pipelineContextMenus, selectedEntity: this.state.selectedEntity, items: pipelines, label: "Rendering pipelines", offset: 1, filter: this.state.filter }), scene.effectLayers && scene.effectLayers.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: scene.effectLayers, label: "Effect layers", offset: 1, filter: this.state.filter })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, contextMenuItems: particleSystemsContextMenus, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: scene.particleSystems, label: "Particle systems", offset: 1, filter: this.state.filter }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, contextMenuItems: spriteManagersContextMenus, forceSubitems: true, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: scene.spriteManagers, label: "Sprite managers", offset: 1, filter: this.state.filter }), guiElements && guiElements.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: guiElements, label: "GUI", offset: 1, filter: this.state.filter })), scene.animationGroups.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: scene.animationGroups, label: "Animation groups", offset: 1, filter: this.state.filter })), scene.mainSoundTrack && scene.mainSoundTrack.soundCollection.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: scene.mainSoundTrack.soundCollection, label: "Sounds", offset: 1, filter: this.state.filter })), this.props.additionalNodes &&
                    this.props.additionalNodes.map((additionalNode) => {
                        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.state.selectedEntity, items: additionalNode.getContent(), label: additionalNode.name, offset: 1, filter: this.state.filter }, additionalNode.name));
                    })] }));
    }
    onClose() {
        if (!this.props.onClose) {
            return;
        }
        this.props.onClose();
    }
    onPopup() {
        if (!this.props.onPopup) {
            return;
        }
        this.props.onPopup();
    }
    render() {
        const allNodes = [];
        if (this.props.popupMode) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { id: "sceneExplorer", tabIndex: 0, onKeyDown: (keyEvent) => this.processKeys(keyEvent, allNodes), children: [!this.props.noHeader && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_headerComponent__WEBPACK_IMPORTED_MODULE_5__.HeaderComponent, { title: "SCENE EXPLORER", noClose: this.props.noClose, noExpand: this.props.noExpand, noCommands: this.props.noCommands, onClose: () => this.onClose(), onPopup: () => this.onPopup() })), this.renderContent(allNodes)] }));
        }
        if (this._once) {
            this._once = false;
            // A bit hacky but no other way to force the initial width to 300px and not auto
            setTimeout(() => {
                const element = document.getElementById("sceneExplorer");
                if (!element) {
                    return;
                }
                element.style.width = "300px";
            }, 150);
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ResizableCasted, { tabIndex: -1, id: "sceneExplorer", defaultSize: { height: "100%" }, ref: this._sceneExplorerRef, minWidth: 300, maxWidth: 600, minHeight: "100%", enable: { top: false, right: true, bottom: false, left: false, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }, onKeyDown: (keyEvent) => this.processKeys(keyEvent, allNodes), children: [!this.props.noHeader && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_headerComponent__WEBPACK_IMPORTED_MODULE_5__.HeaderComponent, { title: "SCENE EXPLORER", noClose: this.props.noClose, noExpand: this.props.noExpand, noCommands: this.props.noCommands, onClose: () => this.onClose(), onPopup: () => this.onPopup() })), this.renderContent(allNodes)] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/treeItemComponent.js":
/*!*********************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/treeItemComponent.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2893836__) => {

"use strict";
__nested_webpack_require_2893836__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2893836__.d(__nested_webpack_exports__, {
/* harmony export */   TreeItemComponent: () => (/* binding */ TreeItemComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2893836__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2893836__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2893836__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2893836__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _treeItemSelectableComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2893836__(/*! ./treeItemSelectableComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemSelectableComponent.js");
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2893836__(/*! ../../tools */ "../../../dev/inspector/dist/tools.js");
/* harmony import */ var react_contextmenu__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2893836__(/*! react-contextmenu */ "../../../../node_modules/react-contextmenu/es6/index.js");







class TreeItemExpandableHeaderComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    expandAll() {
        this.props.onExpandAll(!this.props.isExpanded);
    }
    render() {
        const chevron = this.props.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faMinus }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faPlus });
        const expandAll = this.props.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faCompress }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faExpandArrowsAlt });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "expandableHeader", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "arrow icon", onClick: () => this.props.onClick(), children: chevron }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-value", children: this.props.label })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expandAll icon", onClick: () => this.expandAll(), title: this.props.isExpanded ? "Collapse all" : "Expand all", children: expandAll })] }));
    }
}
class TreeItemRootHeaderComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expandableHeader", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "arrow icon", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faBan }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-value", children: this.props.label })] }) }));
    }
}
class TreeItemComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isExpanded: false, mustExpand: false };
    }
    switchExpandedState() {
        this.setState({ isExpanded: !this.state.isExpanded, mustExpand: false });
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (!nextState.isExpanded && this.state.isExpanded) {
            return true;
        }
        const items = nextProps.items;
        if (items && items.length) {
            if (nextProps.selectedEntity) {
                for (const item of items) {
                    if (_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.LookForItem(item, nextProps.selectedEntity)) {
                        nextState.isExpanded = true;
                        return true;
                    }
                }
            }
        }
        return true;
    }
    expandAll(expand) {
        this.setState({ isExpanded: expand, mustExpand: expand });
    }
    renderContextMenu() {
        if (!this.props.contextMenuItems) {
            TreeItemComponent._ContextMenuUniqueIdGenerator++;
            return null;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__.ContextMenu, { id: "contextmenu#" + TreeItemComponent._ContextMenuUniqueIdGenerator++, className: "context-menu", children: this.props.contextMenuItems.map((c) => {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__.MenuItem, { onClick: () => c.action(), children: c.label }, c.label));
            }) }));
    }
    render() {
        let items = this.props.items;
        const marginStyle = {
            paddingLeft: 10 * (this.props.offset + 0.5) + "px",
        };
        if (!items) {
            if (this.props.forceSubitems) {
                items = [];
            }
            else {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "groupContainer", style: marginStyle, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: this.props.label }) }));
            }
        }
        if (!items.length) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "groupContainer", style: marginStyle, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__.ContextMenuTrigger, { id: "contextmenu#" + TreeItemComponent._ContextMenuUniqueIdGenerator, children: [this.renderContextMenu(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TreeItemRootHeaderComponent, { label: this.props.label })] }) }));
        }
        if (!this.state.isExpanded) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "groupContainer", style: marginStyle, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__.ContextMenuTrigger, { id: "contextmenu#" + TreeItemComponent._ContextMenuUniqueIdGenerator, children: [this.renderContextMenu(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TreeItemExpandableHeaderComponent, { isExpanded: false, label: this.props.label, onClick: () => this.switchExpandedState(), onExpandAll: (expand) => this.expandAll(expand) })] }) }));
        }
        const sortedItems = _tools__WEBPACK_IMPORTED_MODULE_4__.Tools.SortAndFilter(null, items);
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "groupContainer", style: marginStyle, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_contextmenu__WEBPACK_IMPORTED_MODULE_5__.ContextMenuTrigger, { id: "contextmenu#" + TreeItemComponent._ContextMenuUniqueIdGenerator, children: [this.renderContextMenu(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TreeItemExpandableHeaderComponent, { isExpanded: this.state.isExpanded, label: this.props.label, onClick: () => this.switchExpandedState(), onExpandAll: (expand) => this.expandAll(expand) })] }) }), sortedItems.map((item) => {
                    return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemSelectableComponent__WEBPACK_IMPORTED_MODULE_3__.TreeItemSelectableComponent, { mustExpand: this.state.mustExpand, extensibilityGroups: this.props.extensibilityGroups, offset: this.props.offset + 1, selectedEntity: this.props.selectedEntity, entity: item, globalState: this.props.globalState, gizmoCamera: this.props.gizmoCamera, filter: this.props.filter }, item.uniqueId !== undefined && item.uniqueId !== null ? item.uniqueId : item.name));
                })] }));
    }
}
TreeItemComponent._ContextMenuUniqueIdGenerator = 0;


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js":
/*!**************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2903475__) => {

"use strict";
__nested_webpack_require_2903475__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2903475__.d(__nested_webpack_exports__, {
/* harmony export */   TreeItemLabelComponent: () => (/* binding */ TreeItemLabelComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2903475__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2903475__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2903475__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");



class TreeItemLabelComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onClick() {
        if (!this.props.onClick) {
            return;
        }
        this.props.onClick();
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "title", title: this.props.label, onClick: () => this.onClick(), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "titleIcon", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: this.props.icon, color: this.props.color }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "titleText", children: this.props.label || "no name" })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/treeItemSelectableComponent.js":
/*!*******************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/treeItemSelectableComponent.js ***!
  \*******************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2905589__) => {

"use strict";
__nested_webpack_require_2905589__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2905589__.d(__nested_webpack_exports__, {
/* harmony export */   TreeItemSelectableComponent: () => (/* binding */ TreeItemSelectableComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2905589__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _treeItemSpecializedComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2905589__(/*! ./treeItemSpecializedComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemSpecializedComponent.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2905589__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2905589__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2905589__(/*! ../../tools */ "../../../dev/inspector/dist/tools.js");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2905589__(/*! react-dom */ "../../../../node_modules/react-dom/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2905589__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _treeNodeDebugger__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2905589__(/*! ./treeNodeDebugger */ "../../../dev/inspector/dist/components/sceneExplorer/treeNodeDebugger.js");








class TreeItemSelectableComponent extends react__WEBPACK_IMPORTED_MODULE_5__.Component {
    constructor(props) {
        super(props);
        this._wasSelected = false;
        this.state = {
            isSelected: this.props.entity === this.props.selectedEntity,
            isExpanded: this.props.mustExpand || _tools__WEBPACK_IMPORTED_MODULE_3__.Tools.LookForItem(this.props.entity, this.props.selectedEntity),
        };
    }
    switchExpandedState() {
        this.setState({ isExpanded: !this.state.isExpanded });
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (!nextState.isExpanded && this.state.isExpanded) {
            return true;
        }
        if (nextProps.selectedEntity) {
            if (nextProps.entity === nextProps.selectedEntity) {
                nextState.isSelected = true;
                return true;
            }
            else {
                nextState.isSelected = false;
            }
            if (_tools__WEBPACK_IMPORTED_MODULE_3__.Tools.LookForItem(nextProps.entity, nextProps.selectedEntity)) {
                nextState.isExpanded = true;
                return true;
            }
        }
        return true;
    }
    scrollIntoView() {
        const element = react_dom__WEBPACK_IMPORTED_MODULE_4__.findDOMNode(this);
        if (element) {
            element.scrollIntoView(false);
        }
    }
    componentDidMount() {
        if (this.state.isSelected) {
            this.scrollIntoView();
        }
    }
    componentDidUpdate() {
        if (this.state.isSelected && !this._wasSelected) {
            this.scrollIntoView();
        }
        this._wasSelected = false;
    }
    onSelect() {
        if (!this.props.globalState.onSelectionChangedObservable) {
            return;
        }
        this._wasSelected = true;
        const entity = this.props.entity;
        // Put selected node into window.debugNode
        (0,_treeNodeDebugger__WEBPACK_IMPORTED_MODULE_6__.setDebugNode)(entity);
        this.props.globalState.onSelectionChangedObservable.notifyObservers(entity);
    }
    renderChildren() {
        const entity = this.props.entity;
        if ((!entity.getChildren && !entity.children) || !this.state.isExpanded) {
            return null;
        }
        const children = _tools__WEBPACK_IMPORTED_MODULE_3__.Tools.SortAndFilter(entity, entity.getChildren ? entity.getChildren() : entity.children);
        return children.map((item, i) => {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TreeItemSelectableComponent, { globalState: this.props.globalState, gizmoCamera: this.props.gizmoCamera, mustExpand: this.props.mustExpand, extensibilityGroups: this.props.extensibilityGroups, selectedEntity: this.props.selectedEntity, offset: this.props.offset + 2, entity: item, filter: this.props.filter }, i));
        });
    }
    render() {
        const marginStyle = {
            paddingLeft: 10 * (this.props.offset + 0.5) + "px",
        };
        const entity = this.props.entity;
        const chevron = this.state.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faMinus }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faPlus });
        const children = entity.getClassName() === "MultiMaterial" ? [] : _tools__WEBPACK_IMPORTED_MODULE_3__.Tools.SortAndFilter(entity, entity.getChildren ? entity.getChildren() : entity.children);
        const hasChildren = children.length > 0;
        if (!entity.reservedDataStore) {
            entity.reservedDataStore = {};
        }
        entity.reservedDataStore.setExpandedState = (value) => {
            this.setState({ isExpanded: value });
        };
        entity.reservedDataStore.isExpanded = this.state.isExpanded;
        if (this.props.filter) {
            const lowerCaseFilter = this.props.filter.toLowerCase();
            if (!entity.name || entity.name.toLowerCase().indexOf(lowerCaseFilter) === -1) {
                if (!hasChildren) {
                    return null;
                }
                if (entity.getDescendants) {
                    if (entity.getDescendants(false, (n) => {
                        return n.name && n.name.toLowerCase().indexOf(lowerCaseFilter) !== -1;
                    }).length === 0) {
                        return null;
                    }
                }
            }
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: this.state.isSelected ? "itemContainer selected" : "itemContainer", style: marginStyle, children: [hasChildren && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "arrow icon", onClick: () => this.switchExpandedState(), children: chevron })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemSpecializedComponent__WEBPACK_IMPORTED_MODULE_1__.TreeItemSpecializedComponent, { globalState: this.props.globalState, gizmoCamera: this.props.gizmoCamera, extensibilityGroups: this.props.extensibilityGroups, label: entity.name, entity: entity, onClick: () => this.onSelect() })] }), this.renderChildren()] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/treeItemSpecializedComponent.js":
/*!********************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/treeItemSpecializedComponent.js ***!
  \********************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2913290__) => {

"use strict";
__nested_webpack_require_2913290__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2913290__.d(__nested_webpack_exports__, {
/* harmony export */   TreeItemSpecializedComponent: () => (/* binding */ TreeItemSpecializedComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2913290__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var _entities_meshTreeItemComponent__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2913290__(/*! ./entities/meshTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/meshTreeItemComponent.js");
/* harmony import */ var _entities_cameraTreeItemComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2913290__(/*! ./entities/cameraTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/cameraTreeItemComponent.js");
/* harmony import */ var _entities_lightTreeItemComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2913290__(/*! ./entities/lightTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/lightTreeItemComponent.js");
/* harmony import */ var _extensionsComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2913290__(/*! ./extensionsComponent */ "../../../dev/inspector/dist/components/sceneExplorer/extensionsComponent.js");
/* harmony import */ var _treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2913290__(/*! ./treeItemLabelComponent */ "../../../dev/inspector/dist/components/sceneExplorer/treeItemLabelComponent.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_23__ = __nested_webpack_require_2913290__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _entities_materialTreeItemComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2913290__(/*! ./entities/materialTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/materialTreeItemComponent.js");
/* harmony import */ var _entities_textureTreeItemComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2913290__(/*! ./entities/textureTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/textureTreeItemComponent.js");
/* harmony import */ var _entities_transformNodeTreeItemComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2913290__(/*! ./entities/transformNodeTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/transformNodeTreeItemComponent.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2913290__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _entities_gui_controlTreeItemComponent__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2913290__(/*! ./entities/gui/controlTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/gui/controlTreeItemComponent.js");
/* harmony import */ var _entities_gui_advancedDynamicTextureTreeItemComponent__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_2913290__(/*! ./entities/gui/advancedDynamicTextureTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/gui/advancedDynamicTextureTreeItemComponent.js");
/* harmony import */ var _entities_animationGroupTreeItemComponent__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_2913290__(/*! ./entities/animationGroupTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/animationGroupTreeItemComponent.js");
/* harmony import */ var _entities_postProcessTreeItemComponent__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_2913290__(/*! ./entities/postProcessTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/postProcessTreeItemComponent.js");
/* harmony import */ var _entities_renderingPipelineTreeItemComponent__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_2913290__(/*! ./entities/renderingPipelineTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/renderingPipelineTreeItemComponent.js");
/* harmony import */ var _entities_skeletonTreeItemComponent__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_2913290__(/*! ./entities/skeletonTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/skeletonTreeItemComponent.js");
/* harmony import */ var _entities_boneTreeItemComponent__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_2913290__(/*! ./entities/boneTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/boneTreeItemComponent.js");
/* harmony import */ var _entities_particleSystemTreeItemComponent__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_2913290__(/*! ./entities/particleSystemTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/particleSystemTreeItemComponent.js");
/* harmony import */ var _entities_spriteManagerTreeItemComponent__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_2913290__(/*! ./entities/spriteManagerTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/spriteManagerTreeItemComponent.js");
/* harmony import */ var _entities_spriteTreeItemComponent__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_2913290__(/*! ./entities/spriteTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/spriteTreeItemComponent.js");
/* harmony import */ var _entities_targetedAnimationTreeItemComponent__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_2913290__(/*! ./entities/targetedAnimationTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/targetedAnimationTreeItemComponent.js");
/* harmony import */ var _entities_soundTreeItemComponent__WEBPACK_IMPORTED_MODULE_21__ = __nested_webpack_require_2913290__(/*! ./entities/soundTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/soundTreeItemComponent.js");
/* harmony import */ var _entities_effectLayerPipelineTreeItemComponent__WEBPACK_IMPORTED_MODULE_22__ = __nested_webpack_require_2913290__(/*! ./entities/effectLayerPipelineTreeItemComponent */ "../../../dev/inspector/dist/components/sceneExplorer/entities/effectLayerPipelineTreeItemComponent.js");
























class TreeItemSpecializedComponent extends react__WEBPACK_IMPORTED_MODULE_9__.Component {
    constructor(props) {
        super(props);
    }
    onClick() {
        if (!this.props.onClick) {
            return;
        }
        this.props.onClick();
    }
    render() {
        const entity = this.props.entity;
        if (entity && entity.getClassName) {
            const className = entity.getClassName();
            if (className.indexOf("Mesh") !== -1) {
                const mesh = entity;
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_meshTreeItemComponent__WEBPACK_IMPORTED_MODULE_1__.MeshTreeItemComponent, { globalState: this.props.globalState, extensibilityGroups: this.props.extensibilityGroups, mesh: mesh, onClick: () => this.onClick() }));
            }
            if (className.indexOf("SpriteManager") !== -1) {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_spriteManagerTreeItemComponent__WEBPACK_IMPORTED_MODULE_18__.SpriteManagerTreeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, spriteManager: entity, onClick: () => this.onClick() }));
            }
            if (className.indexOf("Sprite") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_spriteTreeItemComponent__WEBPACK_IMPORTED_MODULE_19__.SpriteTreeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, sprite: entity, onClick: () => this.onClick() });
            }
            if (className.indexOf("Skeleton") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_skeletonTreeItemComponent__WEBPACK_IMPORTED_MODULE_15__.SkeletonTreeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, skeleton: entity, onClick: () => this.onClick() });
            }
            if (className.indexOf("Bone") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_boneTreeItemComponent__WEBPACK_IMPORTED_MODULE_16__.BoneTreeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, bone: entity, onClick: () => this.onClick() });
            }
            if (className.indexOf("TransformNode") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_transformNodeTreeItemComponent__WEBPACK_IMPORTED_MODULE_8__.TransformNodeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, transformNode: entity, onClick: () => this.onClick() });
            }
            if (className.indexOf("Camera") !== -1) {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_cameraTreeItemComponent__WEBPACK_IMPORTED_MODULE_2__.CameraTreeItemComponent, { globalState: this.props.globalState, gizmoCamera: this.props.gizmoCamera, extensibilityGroups: this.props.extensibilityGroups, camera: entity, onClick: () => this.onClick() }));
            }
            if (className.indexOf("Light", className.length - 5) !== -1) {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_lightTreeItemComponent__WEBPACK_IMPORTED_MODULE_3__.LightTreeItemComponent, { globalState: this.props.globalState, gizmoCamera: this.props.gizmoCamera, extensibilityGroups: this.props.extensibilityGroups, light: entity, onClick: () => this.onClick() }));
            }
            if (className.indexOf("Material") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_materialTreeItemComponent__WEBPACK_IMPORTED_MODULE_6__.MaterialTreeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, material: entity, onClick: () => this.onClick() });
            }
            if (className.indexOf("ParticleSystem") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_particleSystemTreeItemComponent__WEBPACK_IMPORTED_MODULE_17__.ParticleSystemTreeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, system: entity, onClick: () => this.onClick() });
            }
            if (className === "AdvancedDynamicTexture") {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_gui_advancedDynamicTextureTreeItemComponent__WEBPACK_IMPORTED_MODULE_11__.AdvancedDynamicTextureTreeItemComponent, { onSelectionChangedObservable: this.props.globalState.onSelectionChangedObservable, extensibilityGroups: this.props.extensibilityGroups, texture: entity, onClick: () => this.onClick() }));
            }
            if (className === "AnimationGroup") {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_animationGroupTreeItemComponent__WEBPACK_IMPORTED_MODULE_12__.AnimationGroupItemComponent, { extensibilityGroups: this.props.extensibilityGroups, animationGroup: entity, onClick: () => this.onClick() }));
            }
            if (className === "TargetedAnimation") {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_targetedAnimationTreeItemComponent__WEBPACK_IMPORTED_MODULE_20__.TargetedAnimationItemComponent, { extensibilityGroups: this.props.extensibilityGroups, targetedAnimation: entity, onClick: () => this.onClick() }));
            }
            if (className.indexOf("Texture") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_textureTreeItemComponent__WEBPACK_IMPORTED_MODULE_7__.TextureTreeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, texture: entity, onClick: () => this.onClick() });
            }
            if (className.indexOf("RenderingPipeline") !== -1) {
                return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_renderingPipelineTreeItemComponent__WEBPACK_IMPORTED_MODULE_14__.RenderingPipelineItemComponent, { extensibilityGroups: this.props.extensibilityGroups, renderPipeline: entity, onClick: () => this.onClick() }));
            }
            if (className.indexOf("PostProcess") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_postProcessTreeItemComponent__WEBPACK_IMPORTED_MODULE_13__.PostProcessItemComponent, { extensibilityGroups: this.props.extensibilityGroups, postProcess: entity, onClick: () => this.onClick() });
            }
            if (className.indexOf("Layer") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_effectLayerPipelineTreeItemComponent__WEBPACK_IMPORTED_MODULE_22__.EffectLayerItemComponent, { extensibilityGroups: this.props.extensibilityGroups, layer: entity, onClick: () => this.onClick() });
            }
            if (className.indexOf("Sound") !== -1) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_soundTreeItemComponent__WEBPACK_IMPORTED_MODULE_21__.SoundTreeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, sound: entity, onClick: () => this.onClick() });
            }
            if (entity._host) {
                return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_entities_gui_controlTreeItemComponent__WEBPACK_IMPORTED_MODULE_10__.ControlTreeItemComponent, { extensibilityGroups: this.props.extensibilityGroups, control: entity, onClick: () => this.onClick() });
            }
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "meshTools", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_treeItemLabelComponent__WEBPACK_IMPORTED_MODULE_5__.TreeItemLabelComponent, { label: entity.name, onClick: () => this.onClick(), icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_23__.faProjectDiagram, color: "cornflowerblue" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_extensionsComponent__WEBPACK_IMPORTED_MODULE_4__.ExtensionsComponent, { target: entity, extensibilityGroups: this.props.extensibilityGroups })] }));
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/treeNodeDebugger.js":
/*!********************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/treeNodeDebugger.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2927961__) => {

"use strict";
__nested_webpack_require_2927961__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2927961__.d(__nested_webpack_exports__, {
/* harmony export */   setDebugNode: () => (/* binding */ setDebugNode)
/* harmony export */ });
// globalThis.debugNode receives the selected node in the inspector
function setDebugNode(node) {
    if (typeof globalThis !== "undefined") {
        globalThis.debugNode = node;
        // GC to avoid memory leak on global reference
        if (typeof node._scene !== "undefined" && node._scene.onDisposeObservable) {
            node._scene.onDisposeObservable.add(() => {
                globalThis.debugNode = null;
            });
        }
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/index.js":
/*!********************************************!*\
  !*** ../../../dev/inspector/dist/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2928926__) => {

"use strict";
__nested_webpack_require_2928926__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2928926__.d(__nested_webpack_exports__, {
/* harmony export */   EditAdvancedDynamicTexture: () => (/* reexport safe */ _components_sceneExplorer_entities_gui_guiTools__WEBPACK_IMPORTED_MODULE_1__.EditAdvancedDynamicTexture),
/* harmony export */   InjectGUIEditor: () => (/* reexport safe */ _components_sceneExplorer_entities_gui_guiTools__WEBPACK_IMPORTED_MODULE_1__.InjectGUIEditor),
/* harmony export */   Inspector: () => (/* reexport safe */ _inspector__WEBPACK_IMPORTED_MODULE_0__.Inspector),
/* harmony export */   SetGUIEditorURL: () => (/* reexport safe */ _components_sceneExplorer_entities_gui_guiTools__WEBPACK_IMPORTED_MODULE_1__.SetGUIEditorURL)
/* harmony export */ });
/* harmony import */ var _inspector__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2928926__(/*! ./inspector */ "../../../dev/inspector/dist/inspector.js");
/* harmony import */ var _components_sceneExplorer_entities_gui_guiTools__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2928926__(/*! ./components/sceneExplorer/entities/gui/guiTools */ "../../../dev/inspector/dist/components/sceneExplorer/entities/gui/guiTools.js");




/***/ }),

/***/ "../../../dev/inspector/dist/inspector.js":
/*!************************************************!*\
  !*** ../../../dev/inspector/dist/inspector.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2930415__) => {

"use strict";
__nested_webpack_require_2930415__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2930415__.d(__nested_webpack_exports__, {
/* harmony export */   Inspector: () => (/* binding */ Inspector)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2930415__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2930415__(/*! react-dom */ "../../../../node_modules/react-dom/index.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2930415__(/*! core/Loading/sceneLoader */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2930415__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_actionTabs_actionTabsComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2930415__(/*! ./components/actionTabs/actionTabsComponent */ "../../../dev/inspector/dist/components/actionTabs/actionTabsComponent.js");
/* harmony import */ var _components_sceneExplorer_sceneExplorerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2930415__(/*! ./components/sceneExplorer/sceneExplorerComponent */ "../../../dev/inspector/dist/components/sceneExplorer/sceneExplorerComponent.js");
/* harmony import */ var _components_embedHost_embedHostComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2930415__(/*! ./components/embedHost/embedHostComponent */ "../../../dev/inspector/dist/components/embedHost/embedHostComponent.js");
/* harmony import */ var _components_globalState__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2930415__(/*! ./components/globalState */ "../../../dev/inspector/dist/components/globalState.js");
/* harmony import */ var _components_popupComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2930415__(/*! ./components/popupComponent */ "../../../dev/inspector/dist/components/popupComponent.js");
/* harmony import */ var shared_ui_components_styleHelper__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2930415__(/*! shared-ui-components/styleHelper */ "../../../dev/sharedUiComponents/dist/styleHelper.js");
/* harmony import */ var shared_ui_components_popupHelper__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2930415__(/*! shared-ui-components/popupHelper */ "../../../dev/sharedUiComponents/dist/popupHelper.js");












class Inspector {
    static MarkLineContainerTitleForHighlighting(title) {
        this._GlobalState.selectedLineContainerTitles = [];
        this._GlobalState.selectedLineContainerTitles.push(title);
    }
    static MarkMultipleLineContainerTitlesForHighlighting(titles) {
        this._GlobalState.selectedLineContainerTitles = [];
        this._GlobalState.selectedLineContainerTitles.push(...titles);
    }
    static PopupEmbed() {
        const scene = this._Scene;
        const options = this._EmbedOptions;
        if (!options) {
            return;
        }
        react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._EmbedHost);
        if (options.popup) {
            this._EmbedHostWindow.close();
        }
        this._RemoveElementFromDOM(this._EmbedHost);
        options.popup = !options.popup;
        options.embedMode = true;
        options.showExplorer = true;
        options.showInspector = true;
        options.embedHostWidth = options.popup ? "100%" : "auto";
        Inspector.Show(scene, options);
    }
    static PopupSceneExplorer() {
        const scene = this._Scene;
        const options = this._SceneExplorerOptions;
        if (!options) {
            return;
        }
        react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._SceneExplorerHost);
        this._RemoveElementFromDOM(this._SceneExplorerHost);
        if (options.popup) {
            this._SceneExplorerWindow.close();
        }
        options.popup = !options.popup;
        options.showExplorer = true;
        options.showInspector = false;
        options.explorerWidth = options.popup ? "100%" : "300px";
        Inspector.Show(scene, options);
    }
    static PopupInspector() {
        const scene = this._Scene;
        const options = this._InspectorOptions;
        if (!options) {
            return;
        }
        react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._ActionTabsHost);
        this._RemoveElementFromDOM(this._ActionTabsHost);
        if (options.popup) {
            this._ActionTabsWindow.close();
        }
        options.popup = !options.popup;
        options.showExplorer = false;
        options.showInspector = true;
        options.inspectorWidth = options.popup ? "100%" : "300px";
        Inspector.Show(scene, options);
    }
    static _CreateSceneExplorer(scene, options, parentControlExplorer) {
        // Duplicating the options as they can be different for each pane
        if (options.original) {
            options = {
                original: false,
                popup: options.popup,
                overlay: options.overlay,
                showExplorer: options.showExplorer,
                showInspector: options.showInspector,
                additionalNodes: options.additionalNodes,
                embedMode: options.embedMode,
                handleResize: options.handleResize,
                enablePopup: options.enablePopup,
                enableClose: options.enableClose,
                explorerExtensibility: options.explorerExtensibility,
                gizmoCamera: options.gizmoCamera,
                contextMenu: options.contextMenu,
                contextMenuOverride: options.contextMenuOverride,
            };
        }
        this._EmbedOptions = null;
        this._SceneExplorerOptions = options;
        // Prepare the scene explorer host
        if (parentControlExplorer) {
            this._SceneExplorerHost = parentControlExplorer.ownerDocument.createElement("div");
            this._SceneExplorerHost.id = "scene-explorer-host";
            this._SceneExplorerHost.style.width = options.explorerWidth || "auto";
            if (!options.popup) {
                parentControlExplorer.insertBefore(this._SceneExplorerHost, this._NewCanvasContainer);
            }
            else {
                parentControlExplorer.appendChild(this._SceneExplorerHost);
            }
            if (!options.overlay) {
                this._SceneExplorerHost.style.position = "relative";
            }
        }
        // Scene
        if (this._SceneExplorerHost) {
            this._OpenedPane++;
            const sceneExplorerElement = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_sceneExplorer_sceneExplorerComponent__WEBPACK_IMPORTED_MODULE_4__.SceneExplorerComponent, {
                scene,
                contextMenu: options.contextMenu,
                contextMenuOverride: options.contextMenuOverride,
                gizmoCamera: options.gizmoCamera,
                globalState: this._GlobalState,
                extensibilityGroups: options.explorerExtensibility,
                additionalNodes: options.additionalNodes,
                noClose: !options.enableClose,
                noExpand: !options.enablePopup,
                popupMode: options.popup,
                onPopup: () => {
                    this.PopupSceneExplorer();
                },
                onClose: () => {
                    react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._SceneExplorerHost);
                    Inspector._OpenedPane--;
                    this._RemoveElementFromDOM(this._SceneExplorerHost);
                    this._Cleanup();
                    if (options.popup) {
                        this._SceneExplorerWindow.close();
                    }
                    this._GlobalState.onSceneExplorerClosedObservable.notifyObservers();
                },
            });
            react_dom__WEBPACK_IMPORTED_MODULE_1__.render(sceneExplorerElement, this._SceneExplorerHost);
        }
    }
    static _CreateActionTabs(scene, options, parentControlActions) {
        options.original = false;
        this._EmbedOptions = null;
        this._InspectorOptions = options;
        // Prepare the inspector host
        if (parentControlActions) {
            const host = parentControlActions.ownerDocument.createElement("div");
            host.id = "inspector-host";
            host.style.width = options.inspectorWidth || "auto";
            parentControlActions.appendChild(host);
            this._ActionTabsHost = host;
            if (!options.overlay) {
                this._ActionTabsHost.style.position = "relative";
            }
        }
        if (this._ActionTabsHost) {
            this._OpenedPane++;
            const actionTabsElement = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_actionTabs_actionTabsComponent__WEBPACK_IMPORTED_MODULE_3__.ActionTabsComponent, {
                globalState: this._GlobalState,
                scene: scene,
                noClose: !options.enableClose,
                noExpand: !options.enablePopup,
                popupMode: options.popup,
                onPopup: () => {
                    this.PopupInspector();
                },
                onClose: () => {
                    react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._ActionTabsHost);
                    Inspector._OpenedPane--;
                    this._Cleanup();
                    this._RemoveElementFromDOM(this._ActionTabsHost);
                    if (options.popup) {
                        this._ActionTabsWindow.close();
                    }
                    this._GlobalState.onActionTabsClosedObservable.notifyObservers();
                },
                initialTab: options.initialTab,
            });
            react_dom__WEBPACK_IMPORTED_MODULE_1__.render(actionTabsElement, this._ActionTabsHost);
        }
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static _CreateEmbedHost(scene, options, parentControl, onSelectionChangedObservable) {
        this._EmbedOptions = options;
        this._SceneExplorerOptions = null;
        this._InspectorOptions = null;
        // Prepare the inspector host
        if (parentControl) {
            const host = parentControl.ownerDocument.createElement("div");
            host.id = "embed-host";
            host.style.width = options.embedHostWidth || "auto";
            parentControl.appendChild(host);
            this._EmbedHost = host;
            if (!options.overlay) {
                this._EmbedHost.style.position = "relative";
            }
        }
        if (this._EmbedHost) {
            this._OpenedPane++;
            const embedHostElement = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_embedHost_embedHostComponent__WEBPACK_IMPORTED_MODULE_5__.EmbedHostComponent, {
                globalState: this._GlobalState,
                scene: scene,
                extensibilityGroups: options.explorerExtensibility,
                additionalNodes: options.additionalNodes,
                noExpand: !options.enablePopup,
                noClose: !options.enableClose,
                popupMode: options.popup,
                onPopup: () => {
                    this.PopupEmbed();
                },
                onClose: () => {
                    react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._EmbedHost);
                    this._OpenedPane = 0;
                    this._Cleanup();
                    this._RemoveElementFromDOM(this._EmbedHost);
                    if (options.popup) {
                        this._EmbedHostWindow.close();
                    }
                    this._GlobalState.onSceneExplorerClosedObservable.notifyObservers();
                    this._GlobalState.onActionTabsClosedObservable.notifyObservers();
                },
                initialTab: options.initialTab,
            });
            react_dom__WEBPACK_IMPORTED_MODULE_1__.render(embedHostElement, this._EmbedHost);
        }
    }
    static get IsVisible() {
        return this._OpenedPane > 0;
    }
    static EarlyAttachToLoader() {
        if (!this._GlobalState.onPluginActivatedObserver) {
            this._GlobalState.onPluginActivatedObserver = core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.SceneLoader.OnPluginActivatedObservable.add((rawLoader) => {
                this._GlobalState.resetGLTFValidationResults();
                const loader = rawLoader;
                if (loader.name === "gltf") {
                    this._GlobalState.prepareGLTFPlugin(loader);
                }
            });
        }
    }
    static Show(scene, userOptions) {
        const options = {
            original: true,
            popup: false,
            overlay: false,
            showExplorer: true,
            showInspector: true,
            embedMode: false,
            enableClose: true,
            handleResize: true,
            enablePopup: true,
            ...userOptions,
        };
        // load the font, unless asked to skip it
        if (!options.skipDefaultFontLoading && !globalThis?.BABYLON_SKIP_FONT_LOADING) {
            const font = document.createElement("link");
            font.rel = "stylesheet";
            font.href = "https://use.typekit.net/cta4xsb.css";
            document.head.appendChild(font);
        }
        // Prepare state
        if (!this._GlobalState.onPropertyChangedObservable) {
            this._GlobalState.init(this.OnPropertyChangedObservable);
        }
        if (!this._GlobalState.onSelectionChangedObservable) {
            this._GlobalState.onSelectionChangedObservable = this.OnSelectionChangeObservable;
        }
        // Make sure it is not already opened
        if (this.IsVisible && options.original) {
            this.Hide();
        }
        if (!scene) {
            scene = core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.EngineStore.LastCreatedScene;
        }
        this._Scene = scene;
        const rootElement = scene ? scene.getEngine().getInputElement() : core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.EngineStore.LastCreatedEngine.getInputElement();
        if (options.embedMode && options.showExplorer && options.showInspector) {
            if (options.popup) {
                this._CreateEmbedHost(scene, options, (0,shared_ui_components_popupHelper__WEBPACK_IMPORTED_MODULE_9__.CreatePopup)("INSPECTOR", { onWindowCreateCallback: (w) => (this._EmbedHostWindow = w) }), Inspector.OnSelectionChangeObservable);
                this._EmbedHostWindow.addEventListener("beforeunload", () => this._GlobalState.onSceneExplorerClosedObservable.notifyObservers());
                this._EmbedHostWindow.addEventListener("beforeunload", () => this._GlobalState.onActionTabsClosedObservable.notifyObservers());
            }
            else {
                if (!rootElement) {
                    return;
                }
                let parentControl = (options.globalRoot ? options.globalRoot : rootElement.parentElement);
                if (!options.overlay && !this._NewCanvasContainer) {
                    this._CreateCanvasContainer(parentControl);
                }
                else if (!options.overlay && this._NewCanvasContainer && this._NewCanvasContainer.parentElement) {
                    // the root is now the parent of the canvas container
                    parentControl = this._NewCanvasContainer.parentElement;
                }
                if (this._NewCanvasContainer) {
                    // If we move things around, let's control the resize
                    if (options.handleResize && scene) {
                        this._OnBeforeRenderObserver = scene.onBeforeRenderObservable.add(() => {
                            scene.getEngine().resize();
                        });
                    }
                }
                this._CreateEmbedHost(scene, options, parentControl, Inspector.OnSelectionChangeObservable);
            }
        }
        else if (options.popup) {
            if (options.showExplorer) {
                if (this._SceneExplorerHost) {
                    this._SceneExplorerHost.style.width = "0";
                }
                this._CreateSceneExplorer(scene, options, (0,shared_ui_components_popupHelper__WEBPACK_IMPORTED_MODULE_9__.CreatePopup)("SCENE EXPLORER", { onWindowCreateCallback: (w) => (this._SceneExplorerWindow = w) }));
                this._SceneExplorerWindow.addEventListener("beforeunload", () => this._GlobalState.onSceneExplorerClosedObservable.notifyObservers());
            }
            if (options.showInspector) {
                if (this._ActionTabsHost) {
                    this._ActionTabsHost.style.width = "0";
                }
                this._CreateActionTabs(scene, options, (0,shared_ui_components_popupHelper__WEBPACK_IMPORTED_MODULE_9__.CreatePopup)("INSPECTOR", { onWindowCreateCallback: (w) => (this._ActionTabsWindow = w) }));
                this._ActionTabsWindow.addEventListener("beforeunload", () => this._GlobalState.onActionTabsClosedObservable.notifyObservers());
            }
        }
        else {
            let parentControl = (options.globalRoot ? options.globalRoot : rootElement.parentElement);
            if (!options.overlay && !this._NewCanvasContainer) {
                this._CreateCanvasContainer(parentControl);
            }
            else if (!options.overlay && this._NewCanvasContainer && this._NewCanvasContainer.parentElement) {
                // the root is now the parent of the canvas container
                parentControl = this._NewCanvasContainer.parentElement;
            }
            if (this._NewCanvasContainer) {
                // If we move things around, let's control the resize
                if (options.handleResize && scene) {
                    this._OnBeforeRenderObserver = scene.onBeforeRenderObservable.add(() => {
                        scene.getEngine().resize();
                    });
                }
            }
            if (options.showExplorer) {
                this._CreateSceneExplorer(scene, options, parentControl);
            }
            if (options.showInspector) {
                this._CreateActionTabs(scene, options, parentControl);
            }
        }
    }
    static _SetNewScene(scene) {
        this._Scene = scene;
        this._GlobalState.onNewSceneObservable.notifyObservers(scene);
    }
    static _CreateCanvasContainer(parentControl) {
        // If the parent control element's root is not the document (such as the ShadowRoot of the Babylon Viewer),
        // we need to copy the styles from the document to the parent control's root.
        if (parentControl.getRootNode() !== window.document) {
            setTimeout(() => {
                (0,shared_ui_components_styleHelper__WEBPACK_IMPORTED_MODULE_8__.CopyStyles)(window.document, parentControl.getRootNode());
            }, 0);
        }
        // Create a container for previous elements
        this._NewCanvasContainer = parentControl.ownerDocument.createElement("div");
        this._NewCanvasContainer.style.display = parentControl.style.display;
        parentControl.style.display = "flex";
        while (parentControl.childElementCount > 0) {
            const child = parentControl.childNodes[0];
            parentControl.removeChild(child);
            this._NewCanvasContainer.appendChild(child);
        }
        parentControl.appendChild(this._NewCanvasContainer);
        this._NewCanvasContainer.style.width = "100%";
        this._NewCanvasContainer.style.height = "100%";
    }
    static _DestroyCanvasContainer() {
        if (!this._NewCanvasContainer) {
            return;
        }
        const parentControl = this._NewCanvasContainer.parentElement;
        while (this._NewCanvasContainer.childElementCount > 0) {
            const child = this._NewCanvasContainer.childNodes[0];
            this._NewCanvasContainer.removeChild(child);
            parentControl.appendChild(child);
        }
        parentControl.removeChild(this._NewCanvasContainer);
        parentControl.style.display = this._NewCanvasContainer.style.display;
        this._NewCanvasContainer = null;
    }
    static _Cleanup() {
        if (Inspector._OpenedPane !== 0) {
            return;
        }
        // Gizmo disposal
        this._GlobalState.lightGizmos.forEach((g) => {
            if (g.light) {
                this._GlobalState.enableLightGizmo(g.light, false);
            }
        });
        this._GlobalState.cameraGizmos.forEach((g) => {
            if (g.camera) {
                this._GlobalState.enableCameraGizmo(g.camera, false);
            }
        });
        if (this._Scene && this._Scene.reservedDataStore && this._Scene.reservedDataStore.gizmoManager) {
            this._Scene.reservedDataStore.gizmoManager.dispose();
            this._Scene.reservedDataStore.gizmoManager = null;
        }
        if (this._NewCanvasContainer) {
            this._DestroyCanvasContainer();
        }
        if (this._OnBeforeRenderObserver && this._Scene) {
            this._Scene.onBeforeRenderObservable.remove(this._OnBeforeRenderObserver);
            this._OnBeforeRenderObserver = null;
            this._Scene.getEngine().resize();
        }
        this._GlobalState.onInspectorClosedObservable.notifyObservers(this._Scene);
    }
    static _RemoveElementFromDOM(element) {
        if (element && element.parentElement) {
            element.parentElement.removeChild(element);
        }
    }
    static Hide() {
        if (this._ActionTabsHost) {
            react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._ActionTabsHost);
            this._RemoveElementFromDOM(this._ActionTabsHost);
            this._ActionTabsHost = null;
            this._GlobalState.onActionTabsClosedObservable.notifyObservers();
        }
        if (this._SceneExplorerHost) {
            react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._SceneExplorerHost);
            if (this._SceneExplorerHost.parentElement) {
                this._SceneExplorerHost.parentElement.removeChild(this._SceneExplorerHost);
            }
            this._SceneExplorerHost = null;
            this._GlobalState.onSceneExplorerClosedObservable.notifyObservers();
        }
        if (this._EmbedHost) {
            react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._EmbedHost);
            if (this._EmbedHost.parentElement) {
                this._EmbedHost.parentElement.removeChild(this._EmbedHost);
            }
            this._EmbedHost = null;
            this._GlobalState.onActionTabsClosedObservable.notifyObservers();
            this._GlobalState.onSceneExplorerClosedObservable.notifyObservers();
        }
        Inspector._OpenedPane = 0;
        this._Cleanup();
        if (!this._GlobalState.onPluginActivatedObserver) {
            core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.SceneLoader.OnPluginActivatedObservable.remove(this._GlobalState.onPluginActivatedObserver);
            this._GlobalState.onPluginActivatedObserver = null;
        }
    }
    static _CreatePersistentPopup(config, hostElement) {
        if (this._PersistentPopupHost) {
            this._ClosePersistentPopup();
        }
        this._PersistentPopupHost = hostElement.ownerDocument.createElement("div");
        const popupElement = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_popupComponent__WEBPACK_IMPORTED_MODULE_7__.PopupComponent, config.props, config.children);
        react_dom__WEBPACK_IMPORTED_MODULE_1__.render(popupElement, this._PersistentPopupHost);
        if (config.closeWhenSceneExplorerCloses) {
            this._OnSceneExplorerClosedObserver = this._GlobalState.onSceneExplorerClosedObservable.add(() => this._ClosePersistentPopup());
        }
        if (config.closeWhenActionTabsCloses) {
            this._OnActionTabsClosedObserver = this._GlobalState.onActionTabsClosedObservable.add(() => this._ClosePersistentPopup());
        }
    }
    static _ClosePersistentPopup() {
        if (this._PersistentPopupHost) {
            react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this._PersistentPopupHost);
            this._PersistentPopupHost.remove();
            this._PersistentPopupHost = null;
        }
        if (this._OnSceneExplorerClosedObserver) {
            this._GlobalState.onSceneExplorerClosedObservable.remove(this._OnSceneExplorerClosedObserver);
            this._OnSceneExplorerClosedObserver = null;
        }
        if (this._OnActionTabsClosedObserver) {
            this._GlobalState.onActionTabsClosedObservable.remove(this._OnActionTabsClosedObserver);
            this._OnActionTabsClosedObserver = null;
        }
    }
}
Inspector._OpenedPane = 0;
Inspector.OnSelectionChangeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable();
Inspector.OnPropertyChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_2__.Observable();
Inspector._GlobalState = new _components_globalState__WEBPACK_IMPORTED_MODULE_6__.GlobalState();
Inspector._SceneExplorerOptions = null;
Inspector._InspectorOptions = null;
Inspector._EmbedOptions = null;
Inspector.EarlyAttachToLoader();


/***/ }),

/***/ "../../../dev/inspector/dist/legacy/legacy.js":
/*!****************************************************!*\
  !*** ../../../dev/inspector/dist/legacy/legacy.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2956060__) => {

"use strict";
__nested_webpack_require_2956060__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2956060__.d(__nested_webpack_exports__, {
/* harmony export */   EditAdvancedDynamicTexture: () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.EditAdvancedDynamicTexture),
/* harmony export */   InjectGUIEditor: () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.InjectGUIEditor),
/* harmony export */   Inspector: () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Inspector),
/* harmony export */   SetGUIEditorURL: () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.SetGUIEditorURL)
/* harmony export */ });
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2956060__(/*! ../index */ "../../../dev/inspector/dist/index.js");
/* eslint-disable import/no-internal-modules */

const globalObject = typeof __nested_webpack_require_2956060__.g !== "undefined" ? __nested_webpack_require_2956060__.g : typeof window !== "undefined" ? window : undefined;
if (typeof globalObject !== "undefined") {
    globalObject.BABYLON = globalObject.BABYLON || {};
    globalObject.BABYLON.Inspector = _index__WEBPACK_IMPORTED_MODULE_0__.Inspector;
    globalObject.INSPECTOR = _index__WEBPACK_IMPORTED_MODULE_0__;
}



/***/ }),

/***/ "../../../dev/inspector/dist/textureHelper.js":
/*!****************************************************!*\
  !*** ../../../dev/inspector/dist/textureHelper.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2957607__) => {

"use strict";
__nested_webpack_require_2957607__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2957607__.d(__nested_webpack_exports__, {
/* harmony export */   TextureHelper: () => (/* binding */ TextureHelper)
/* harmony export */ });
/* harmony import */ var core_Misc_textureTools__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2957607__(/*! core/Misc/textureTools */ "core/Misc/observable");
/* harmony import */ var core_Misc_textureTools__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2957607__.n(core_Misc_textureTools__WEBPACK_IMPORTED_MODULE_0__);

/**
 * Helper class for retrieving texture data.
 */
class TextureHelper {
    /**
     * Gets the data of the specified texture by rendering it to an intermediate RGBA texture and retrieving the bytes from it.
     * This is convienent to get 8-bit RGBA values for a texture in a GPU compressed format.
     * @param texture the source texture
     * @param width the width of the result, which does not have to match the source texture width
     * @param height the height of the result, which does not have to match the source texture height
     * @param face if the texture has multiple faces, the face index to use for the source
     * @param channels a filter for which of the RGBA channels to return in the result
     * @param globalState the global state to use for rendering the texture
     * @param lod if the texture has multiple LODs, the lod index to use for the source
     * @returns the 8-bit texture data
     */
    static async GetTextureDataAsync(texture, width, height, face, channels, globalState, lod = 0) {
        if (globalState) {
            globalState.blockMutationUpdates = true;
        }
        try {
            const data = await core_Misc_textureTools__WEBPACK_IMPORTED_MODULE_0__.TextureTools.GetTextureDataAsync(texture, width, height, face, lod);
            if (!channels.R || !channels.G || !channels.B || !channels.A) {
                for (let i = 0; i < width * height * 4; i += 4) {
                    // If alpha is the only channel, just display alpha across all channels
                    if (channels.A && !channels.R && !channels.G && !channels.B) {
                        data[i] = data[i + 3];
                        data[i + 1] = data[i + 3];
                        data[i + 2] = data[i + 3];
                        data[i + 3] = 255;
                        continue;
                    }
                    let r = data[i], g = data[i + 1], b = data[i + 2], a = data[i + 3];
                    // If alpha is not visible, make everything 100% alpha
                    if (!channels.A) {
                        a = 255;
                    }
                    // If only one color channel is selected, map both colors to it. If two are selected, the unused one gets set to 0
                    if (!channels.R) {
                        if (channels.G && !channels.B) {
                            r = g;
                        }
                        else if (channels.B && !channels.G) {
                            r = b;
                        }
                        else {
                            r = 0;
                        }
                    }
                    if (!channels.G) {
                        if (channels.R && !channels.B) {
                            g = r;
                        }
                        else if (channels.B && !channels.R) {
                            g = b;
                        }
                        else {
                            g = 0;
                        }
                    }
                    if (!channels.B) {
                        if (channels.R && !channels.G) {
                            b = r;
                        }
                        else if (channels.G && !channels.R) {
                            b = g;
                        }
                        else {
                            b = 0;
                        }
                    }
                    data[i] = r;
                    data[i + 1] = g;
                    data[i + 2] = b;
                    data[i + 3] = a;
                }
            }
            //To flip image on Y axis.
            if (texture.invertY || texture.isCube) {
                const numberOfChannelsByLine = width * 4;
                const halfHeight = height / 2;
                for (let i = 0; i < halfHeight; i++) {
                    for (let j = 0; j < numberOfChannelsByLine; j++) {
                        const currentCell = j + i * numberOfChannelsByLine;
                        const targetLine = height - i - 1;
                        const targetCell = j + targetLine * numberOfChannelsByLine;
                        const temp = data[currentCell];
                        data[currentCell] = data[targetCell];
                        data[targetCell] = temp;
                    }
                }
            }
            return data;
        }
        finally {
            if (globalState) {
                globalState.blockMutationUpdates = false;
            }
        }
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/tools.js":
/*!********************************************!*\
  !*** ../../../dev/inspector/dist/tools.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2962994__) => {

"use strict";
__nested_webpack_require_2962994__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2962994__.d(__nested_webpack_exports__, {
/* harmony export */   Tools: () => (/* binding */ Tools)
/* harmony export */ });
class Tools {
    static LookForItem(item, selectedEntity) {
        if (item === selectedEntity) {
            return true;
        }
        const children = item.getChildren ? item.getChildren() : item.children;
        if (children && item.getClassName() !== "MultiMaterial") {
            for (const child of children) {
                if (Tools.LookForItem(child, selectedEntity)) {
                    return true;
                }
            }
        }
        return false;
    }
    static _RecursiveRemoveHiddenMeshesAndHoistChildren(items) {
        const result = [];
        for (const i of items) {
            // If the mesh is hidden, add it's children that are not hidden, this will handle the case of bounding box parenting for bounding box gizmo
            if (i.reservedDataStore && i.reservedDataStore.hidden && i.getChildMeshes) {
                Tools._RecursiveRemoveHiddenMeshesAndHoistChildren(i.getChildMeshes()).forEach((m) => {
                    result.push(m);
                });
            }
            else if (!i.reservedDataStore || !i.reservedDataStore.hidden) {
                result.push(i);
            }
        }
        return result;
    }
    static GetNameString(obj) {
        if (obj?.name?.toString) {
            return obj.name.toString();
        }
        return "";
    }
    static SortAndFilter(parent, items) {
        if (!items) {
            return [];
        }
        const finalArray = Tools._RecursiveRemoveHiddenMeshesAndHoistChildren(items);
        if (parent && parent.reservedDataStore && parent.reservedDataStore.detachedChildren) {
            finalArray.push(...parent.reservedDataStore.detachedChildren);
        }
        return finalArray.sort((a, b) => {
            const lowerCaseA = Tools.GetNameString(a).toLowerCase();
            const lowerCaseB = Tools.GetNameString(b).toLowerCase();
            if (lowerCaseA === lowerCaseB) {
                return 0;
            }
            if (lowerCaseA > lowerCaseB) {
                return 1;
            }
            return -1;
        });
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/colorPicker/colorComponentEntry.js":
/*!*******************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/colorPicker/colorComponentEntry.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2965721__) => {

"use strict";
__nested_webpack_require_2965721__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2965721__.d(__nested_webpack_exports__, {
/* harmony export */   ColorComponentEntry: () => (/* binding */ ColorComponentEntry)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2965721__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2965721__(/*! react */ "../../../../node_modules/react/index.js");


class ColorComponentEntry extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    updateValue(valueString) {
        if (/[^0-9.-]/g.test(valueString)) {
            return;
        }
        let valueAsNumber = parseInt(valueString);
        if (isNaN(valueAsNumber)) {
            return;
        }
        if (this.props.max != undefined && valueAsNumber > this.props.max) {
            valueAsNumber = this.props.max;
        }
        if (this.props.min != undefined && valueAsNumber < this.props.min) {
            valueAsNumber = this.props.min;
        }
        this.props.onChange(valueAsNumber);
    }
    lock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = true;
        }
    }
    unlock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-component", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-component-value", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", step: 1, className: "numeric-input", value: this.props.value, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (evt) => this.updateValue(evt.target.value), disabled: this.props.disabled }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-component-label", children: this.props.label })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2968266__) => {

"use strict";
__nested_webpack_require_2968266__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2968266__.d(__nested_webpack_exports__, {
/* harmony export */   ColorPicker: () => (/* binding */ ColorPicker)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2968266__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2968266__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2968266__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_2968266__.n(core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2968266__(/*! ./colorComponentEntry */ "../../../dev/sharedUiComponents/dist/colorPicker/colorComponentEntry.js");
/* harmony import */ var _hexColor__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2968266__(/*! ./hexColor */ "../../../dev/sharedUiComponents/dist/colorPicker/hexColor.js");
/* harmony import */ var _colorPicker_scss__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2968266__(/*! ./colorPicker.scss */ "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss");







/**
 * Class used to create a color picker
 */
class ColorPicker extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        if (this.props.color instanceof core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4) {
            this.state = { color: new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3(this.props.color.r, this.props.color.g, this.props.color.b), alpha: this.props.color.a };
        }
        else {
            this.state = { color: this.props.color.clone(), alpha: 1 };
        }
        this._saturationRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._hueRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    shouldComponentUpdate(nextProps, nextState) {
        return nextProps.color.toHexString() !== this.props.color.toHexString() || nextState.color.toHexString() !== this.props.color.toHexString();
    }
    onSaturationPointerDown(evt) {
        this._evaluateSaturation(evt);
        this._isSaturationPointerDown = true;
        evt.currentTarget.setPointerCapture(evt.pointerId);
    }
    onSaturationPointerUp(evt) {
        this._isSaturationPointerDown = false;
        evt.currentTarget.releasePointerCapture(evt.pointerId);
    }
    onSaturationPointerMove(evt) {
        if (!this._isSaturationPointerDown) {
            return;
        }
        this._evaluateSaturation(evt);
    }
    onHuePointerDown(evt) {
        this._evaluateHue(evt);
        this._isHuePointerDown = true;
        evt.currentTarget.setPointerCapture(evt.pointerId);
    }
    onHuePointerUp(evt) {
        this._isHuePointerDown = false;
        evt.currentTarget.releasePointerCapture(evt.pointerId);
    }
    onHuePointerMove(evt) {
        if (!this._isHuePointerDown) {
            return;
        }
        this._evaluateHue(evt);
    }
    _evaluateSaturation(evt) {
        const left = evt.nativeEvent.offsetX;
        const top = evt.nativeEvent.offsetY;
        const saturation = Math.min(1, Math.max(0.0001, left / this._saturationRef.current.clientWidth));
        const value = Math.min(1, Math.max(0.0001, 1 - top / this._saturationRef.current.clientHeight));
        if (this.props.debugMode) {
            core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Logger.Log("Saturation: " + saturation);
            core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Logger.Log("Value: " + value);
        }
        const hsv = this.state.color.toHSV();
        core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.HSVtoRGBToRef(hsv.r, saturation, value, this.state.color);
        if (this.state.alpha === 0) {
            this.setState({ alpha: 1 });
        }
        this.setState({ color: this.state.color });
    }
    _evaluateHue(evt) {
        const left = evt.nativeEvent.offsetX;
        const hue = 360 * Math.min(0.9999, Math.max(0.0001, left / this._hueRef.current.clientWidth));
        if (this.props.debugMode) {
            core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Logger.Log("Hue: " + hue);
        }
        const hsv = this.state.color.toHSV();
        core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.HSVtoRGBToRef(hue, Math.max(hsv.g, 0.01), Math.max(hsv.b, 0.01), this.state.color);
        this.setState({ color: this.state.color });
    }
    componentDidUpdate() {
        this.raiseOnColorChanged();
    }
    raiseOnColorChanged() {
        if (!this.props.onColorChanged) {
            return;
        }
        if (this.props.color instanceof core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4) {
            const newColor4 = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4.FromColor3(this.state.color, this.state.alpha);
            this.props.onColorChanged(newColor4);
            return;
        }
        this.props.onColorChanged(this.state.color.clone());
    }
    render() {
        const color4 = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4.FromColor3(this.state.color);
        color4.a = this.state.alpha;
        const colorHex = color4.toHexString();
        const hsv = this.state.color.toHSV();
        const colorRef = new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3();
        core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.HSVtoRGBToRef(hsv.r, 1, 1, colorRef);
        const colorHexRef = colorRef.toHexString();
        const hasAlpha = this.props.color instanceof core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-container" + (this.props.linearhint ? " with-hints" : ""), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-saturation", onPointerMove: (e) => this.onSaturationPointerMove(e), onPointerDown: (e) => this.onSaturationPointerDown(e), onPointerUp: (e) => this.onSaturationPointerUp(e), ref: this._saturationRef, style: {
                        background: colorHexRef,
                    }, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-saturation-white" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-saturation-black" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-saturation-cursor", style: {
                                top: `${-(hsv.b * 100) + 100}%`,
                                left: `${hsv.g * 100}%`,
                            } })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-hue", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hue-color", style: {
                                background: colorHex,
                            } }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hue-slider", ref: this._hueRef, onPointerMove: (e) => this.onHuePointerMove(e), onPointerDown: (e) => this.onHuePointerDown(e), onPointerUp: (e) => this.onHuePointerUp(e), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hue-cursor", style: {
                                    left: `${(hsv.r / 360.0) * 100}%`,
                                    border: `1px solid ` + colorHexRef,
                                } }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-alpha" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-rgb", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "red", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__.ColorComponentEntry, { lockObject: this.props.lockObject, label: "R", min: 0, max: 255, value: Math.round(this.state.color.r * 255), onChange: (value) => {
                                    this.state.color.r = value / 255.0;
                                    this.forceUpdate();
                                } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "green", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__.ColorComponentEntry, { lockObject: this.props.lockObject, label: "G", min: 0, max: 255, value: Math.round(this.state.color.g * 255), onChange: (value) => {
                                    this.state.color.g = value / 255.0;
                                    this.forceUpdate();
                                } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "blue", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__.ColorComponentEntry, { lockObject: this.props.lockObject, label: "B", min: 0, max: 255, value: Math.round(this.state.color.b * 255), onChange: (value) => {
                                    this.state.color.b = value / 255.0;
                                    this.forceUpdate();
                                } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "alpha" + (hasAlpha ? "" : " grayed"), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorComponentEntry__WEBPACK_IMPORTED_MODULE_3__.ColorComponentEntry, { lockObject: this.props.lockObject, label: "A", min: 0, max: 255, value: Math.round(this.state.alpha * 255), onChange: (value) => {
                                    this.setState({ alpha: value / 255.0 });
                                    this.forceUpdate();
                                } }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker-hex", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hex-label", children: "Hex" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-hex-value", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_hexColor__WEBPACK_IMPORTED_MODULE_4__.HexColor, { lockObject: this.props.lockObject, expectedLength: hasAlpha ? 8 : 6, value: colorHex, onChange: (value) => {
                                    if (hasAlpha) {
                                        const color4 = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4.FromHexString(value);
                                        this.setState({ color: new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3(color4.r, color4.g, color4.b), alpha: color4.a });
                                    }
                                    else {
                                        this.setState({ color: core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.FromHexString(value) });
                                    }
                                } }) })] }), this.props.linearhint && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-warning", children: "(Note: color is stored in linear mode and was converted to gamma to be displayed here (toGammaSpace() / toLinearSpace()))" }))] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/colorPicker/hexColor.js":
/*!********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/colorPicker/hexColor.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2980315__) => {

"use strict";
__nested_webpack_require_2980315__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2980315__.d(__nested_webpack_exports__, {
/* harmony export */   HexColor: () => (/* binding */ HexColor)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2980315__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2980315__(/*! react */ "../../../../node_modules/react/index.js");


class HexColor extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { hex: this.props.value.replace("#", "") };
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (nextProps.value !== this.props.value) {
            nextState.hex = nextProps.value.replace("#", "");
        }
        return true;
    }
    lock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = true;
        }
    }
    unlock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    updateHexValue(valueString) {
        if (valueString != "" && /^[0-9A-Fa-f]+$/g.test(valueString) == false) {
            return;
        }
        this.setState({ hex: valueString });
        if (valueString.length !== this.props.expectedLength) {
            if (this.props.expectedLength === 8 && valueString.length === 6) {
                valueString = valueString + "FF";
            }
            else if (this.props.expectedLength === 6 && valueString.length === 8) {
                valueString = valueString.substring(0, 6);
            }
            else {
                return;
            }
        }
        this.props.onChange("#" + valueString);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "string", className: "hex-input", value: this.state.hex, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (evt) => this.updateHexValue(evt.target.value) }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2982811__) => {

"use strict";
__nested_webpack_require_2982811__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2982811__.d(__nested_webpack_exports__, {
/* harmony export */   copyCommandToClipboard: () => (/* binding */ copyCommandToClipboard),
/* harmony export */   getClassNameWithNamespace: () => (/* binding */ getClassNameWithNamespace)
/* harmony export */ });
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2982811__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_2982811__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_0__);

// Check if BABYLON namespace exists
let babylonNamespace = "";
const globalObject = typeof __nested_webpack_require_2982811__.g !== "undefined" ? __nested_webpack_require_2982811__.g : typeof window !== "undefined" ? window : undefined;
if (typeof globalObject !== "undefined") {
    if (typeof globalObject.BABYLON !== "undefined") {
        babylonNamespace = "BABYLON.";
    }
}
// Inspired by previous copyToClipboard() function which was copying Color3
// Copies strCommand to clipboard
function copyCommandToClipboard(strCommand) {
    const element = document.createElement("div");
    element.textContent = strCommand;
    document.body.appendChild(element);
    if (window.getSelection) {
        const range = document.createRange();
        range.selectNode(element);
        window.getSelection().removeAllRanges();
        window.getSelection().addRange(range);
    }
    document.execCommand("copy");
    element.remove();
}
// Return the class name of the considered target
// babylonNamespace is either "" (ES6) or "BABYLON."
function getClassNameWithNamespace(obj) {
    let className = (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_0__.GetClassName)(obj);
    if (className.includes("BABYLON.")) {
        className = className.split("BABYLON.")[1];
    }
    return { className, babylonNamespace };
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/booleanLineComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/booleanLineComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2985172__) => {

"use strict";
__nested_webpack_require_2985172__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2985172__.d(__nested_webpack_exports__, {
/* harmony export */   BooleanLineComponent: () => (/* binding */ BooleanLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2985172__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2985172__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2985172__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2985172__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");




class BooleanLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const check = this.props.value ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faCheck }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faTimesCircle });
        const className = this.props.value ? "value check" : "value uncheck";
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "textLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: className, children: check })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/buttonLineComponent.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2987830__) => {

"use strict";
__nested_webpack_require_2987830__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2987830__.d(__nested_webpack_exports__, {
/* harmony export */   ButtonLineComponent: () => (/* binding */ ButtonLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2987830__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2987830__(/*! react */ "../../../../node_modules/react/index.js");


class ButtonLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "buttonLine" + (this.props.isDisabled ? " disabled" : ""), children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: () => this.props.onClick(), children: this.props.label })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js":
/*!***************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2989430__) => {

"use strict";
__nested_webpack_require_2989430__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2989430__.d(__nested_webpack_exports__, {
/* harmony export */   CheckBoxLineComponent: () => (/* binding */ CheckBoxLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2989430__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2989430__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2989430__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_2989430__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _targetsProxy__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_2989430__(/*! ./targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_2989430__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");
/* harmony import */ var _imgs_toggleOnIcon_40px_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_2989430__(/*! ../imgs/toggleOnIcon_40px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_40px.svg");
/* harmony import */ var _imgs_toggleOffIcon_40px_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_2989430__(/*! ../imgs/toggleOffIcon_40px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_40px.svg");
/* harmony import */ var _imgs_toggleOnIcon_30px_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_2989430__(/*! ../imgs/toggleOnIcon_30px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_30px.svg");
/* harmony import */ var _imgs_toggleMixedIcon_30px_svg__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_2989430__(/*! ../imgs/toggleMixedIcon_30px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleMixedIcon_30px.svg");
/* harmony import */ var _imgs_toggleOffIcon_30px_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_2989430__(/*! ../imgs/toggleOffIcon_30px.svg */ "../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_30px.svg");











const Icons = {
    size30: {
        on: _imgs_toggleOnIcon_30px_svg__WEBPACK_IMPORTED_MODULE_5__,
        mixed: _imgs_toggleMixedIcon_30px_svg__WEBPACK_IMPORTED_MODULE_6__,
        off: _imgs_toggleOffIcon_30px_svg__WEBPACK_IMPORTED_MODULE_7__,
    },
    size40: {
        on: _imgs_toggleOnIcon_40px_svg__WEBPACK_IMPORTED_MODULE_8__,
        mixed: "", // unneeded
        off: _imgs_toggleOffIcon_40px_svg__WEBPACK_IMPORTED_MODULE_9__,
    },
};
class CheckBoxLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        if (this.props.isSelected) {
            this.state = { isSelected: this.props.isSelected(), isConflict: false };
        }
        else {
            this.state = {
                isSelected: this.props.target[this.props.propertyName] === true,
                isConflict: this.props.target[this.props.propertyName] === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder,
            };
        }
        if (this.props.disabled) {
            this.state = { ...this.state, isDisabled: this.props.disabled };
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        let selected;
        if (nextProps.isSelected) {
            selected = nextProps.isSelected();
        }
        else {
            selected = nextProps.target[nextProps.propertyName] === true;
            if (nextProps.target[nextProps.propertyName] === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder) {
                nextState.isConflict = true;
            }
        }
        if (selected !== nextState.isSelected || this._localChange) {
            nextState.isSelected = selected;
            this._localChange = false;
            return true;
        }
        if (nextProps.disabled !== nextState.isDisabled) {
            return true;
        }
        return nextProps.label !== this.props.label || nextProps.target !== this.props.target || nextState.isConflict !== this.state.isConflict;
    }
    onChange() {
        this._localChange = true;
        if (this.props.onSelect) {
            this.props.onSelect(!this.state.isSelected);
        }
        else {
            if (this.props.onPropertyChangedObservable) {
                this.props.onPropertyChangedObservable.notifyObservers({
                    object: this.props.target,
                    property: this.props.propertyName,
                    value: !this.state.isSelected,
                    initialValue: this.state.isSelected,
                });
            }
            if (this.props.target && this.props.propertyName) {
                this.props.target[this.props.propertyName] = !this.state.isSelected;
            }
        }
        if (this.props.onValueChanged) {
            this.props.onValueChanged();
        }
        this.setState({ isSelected: !this.state.isSelected, isConflict: false });
    }
    // Copy to clipboard the code this checkbox actually does
    // Example : mesh.checkCollisions = true;
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const strCommand = targetName + "." + targetProperty + " = " + value + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        const icons = this.props.large ? Icons.size40 : Icons.size30;
        const icon = this.state.isConflict ? icons.mixed : this.state.isSelected ? icons.on : icons.off;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "checkBoxLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), this.props.label && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.iconLabel, children: this.props.label })), this.props.faIcons && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_3__.FontAwesomeIcon, { className: `cbx ${this.props.disabled ? "disabled" : ""}`, icon: this.state.isSelected ? this.props.faIcons.enabled : this.props.faIcons.disabled, onClick: () => !this.props.disabled && this.onChange() })), !this.props.faIcons && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "checkBox", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: `container lbl${this.props.disabled ? " disabled" : ""} ${this.state.isSelected ? "checked" : ""}`, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", className: `cbx hidden ${this.state.isConflict ? "conflict" : ""}`, checked: this.state.isSelected, onChange: () => this.onChange(), disabled: !!this.props.disabled }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "icon", src: icon, alt: this.props.label })] }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_10__, alt: "Copy" }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2998113__) => {

"use strict";
__nested_webpack_require_2998113__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2998113__.d(__nested_webpack_exports__, {
/* harmony export */   Color3LineComponent: () => (/* binding */ Color3LineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2998113__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2998113__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _colorLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2998113__(/*! ./colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");



class Color3LineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    render() {
        const props = this.props;
        return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorLineComponent__WEBPACK_IMPORTED_MODULE_2__.ColorLine, { disableAlpha: true, ...props });
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/color4LineComponent.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_2999560__) => {

"use strict";
__nested_webpack_require_2999560__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_2999560__.d(__nested_webpack_exports__, {
/* harmony export */   Color4LineComponent: () => (/* binding */ Color4LineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_2999560__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_2999560__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _colorLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_2999560__(/*! ./colorLineComponent */ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js");



class Color4LineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    render() {
        const props = this.props;
        return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorLineComponent__WEBPACK_IMPORTED_MODULE_2__.ColorLine, { ...props });
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/colorLineComponent.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3000983__) => {

"use strict";
__nested_webpack_require_3000983__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3000983__.d(__nested_webpack_exports__, {
/* harmony export */   ColorLine: () => (/* binding */ ColorLine)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3000983__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3000983__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3000983__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3000983__.n(core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _numericInputComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3000983__(/*! ./numericInputComponent */ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3000983__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_3000983__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3000983__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var _colorPickerComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3000983__(/*! ./colorPickerComponent */ "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js");
/* harmony import */ var _targetsProxy__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_3000983__(/*! ./targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_3000983__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");










const emptyColor = new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(0, 0, 0, 0);
class ColorLine extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isExpanded: false, color: this.getValue() };
        const target = this.props.target;
        target._isLinearColor = props.isLinear; // so that replayRecorder can append toLinearSpace() as appropriate
    }
    shouldComponentUpdate(nextProps, nextState) {
        const stateColor = nextState.color;
        const propsColor = this.getValue(nextProps);
        if (stateColor !== this.state.color) {
            nextState.color = stateColor;
            return true;
        }
        if (propsColor !== this.state.color) {
            nextState.color = propsColor;
            return true;
        }
        if (nextState.isExpanded !== this.state.isExpanded) {
            return true;
        }
        return false;
    }
    getValue(props = this.props) {
        const target = props.target;
        const property = target[props.propertyName];
        if (!property)
            return emptyColor;
        if (typeof property === "string") {
            if (property === _targetsProxy__WEBPACK_IMPORTED_MODULE_7__.conflictingValuesPlaceholder) {
                return emptyColor;
            }
            return this._convertToColor(property);
        }
        else {
            if (props.isLinear) {
                return property.toGammaSpace();
            }
            return property.clone();
        }
    }
    setColorFromString(colorString) {
        const color = this._convertToColor(colorString);
        this.setColor(color);
    }
    setColor(newColor) {
        this.setState({ color: newColor.clone() });
        if (this.props.isLinear) {
            newColor.toLinearSpaceToRef(newColor);
        }
        // whether to set properties to color3 or color4
        const setColor = this.props.disableAlpha ? this._toColor3(newColor) : newColor;
        const target = this.props.target;
        const initialValue = target[this.props.propertyName];
        const value = typeof target[this.props.propertyName] === "string" ? setColor.toHexString() : setColor;
        // make the change
        target[this.props.propertyName] = value;
        // notify observers
        if (this.props.onPropertyChangedObservable) {
            this.props.onPropertyChangedObservable.notifyObservers({
                object: target,
                property: this.props.propertyName,
                value,
                initialValue,
            });
        }
        if (this.props.onChange) {
            this.props.onChange();
        }
    }
    switchExpandState() {
        this.setState({ isExpanded: !this.state.isExpanded });
    }
    updateStateR(value) {
        this.setColor(new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(value, this.state.color.g, this.state.color.b, this.state.color.a));
    }
    updateStateG(value) {
        this.setColor(new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(this.state.color.r, value, this.state.color.b, this.state.color.a));
    }
    updateStateB(value) {
        this.setColor(new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(this.state.color.r, this.state.color.g, value, this.state.color.a));
    }
    updateStateA(value) {
        if (this.props.disableAlpha) {
            return;
        }
        this.setColor(new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(this.state.color.r, this.state.color.g, this.state.color.b, value));
    }
    _convertToColor(color) {
        if (color === "" || color === "transparent") {
            return emptyColor;
        }
        if (color.substring(0, 1) !== "#" || (color.length !== 7 && color.length !== 9)) {
            const d = document.createElement("div");
            d.style.color = color;
            document.body.append(d);
            const rgb = window.getComputedStyle(d).color;
            document.body.removeChild(d);
            const rgbArray = rgb
                .substring(4, rgb.length - 1)
                .replace(/ /g, "")
                .split(",");
            const alpha = rgbArray.length > 3 ? parseInt(rgbArray[3]) / 255 : 1.0;
            return new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(parseInt(rgbArray[0]) / 255, parseInt(rgbArray[1]) / 255, parseInt(rgbArray[2]) / 255, alpha);
        }
        if (this.props.disableAlpha) {
            const color3 = core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3.FromHexString(color);
            return new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4(color3.r, color3.g, color3.b, 1.0);
        }
        return core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color4.FromHexString(color);
    }
    _toColor3(color) {
        return new core_Maths_math_color__WEBPACK_IMPORTED_MODULE_2__.Color3(color.r, color.g, color.b);
    }
    // Copy to clipboard the code this Color3 actually does
    // Example : material.diffuseColor = new BABYLON.Vector3(0,1,0);
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const hex = this.state.color.toHexString();
            let strColor;
            if (value.a) {
                strColor = "new " + babylonNamespace + "Color4(" + value.r + ", " + value.g + ", " + value.b + ", " + value.a + ")";
            }
            else {
                strColor = "new " + babylonNamespace + "Color3(" + value.r + ", " + value.g + ", " + value.b + ")";
            }
            strColor += ";// (HEX : " + hex;
            const strCommand = targetName + "." + targetProperty + " = " + strColor + " , debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        const chevron = this.state.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faMinus }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faPlus });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color3Line", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "firstLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color3", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorPickerComponent__WEBPACK_IMPORTED_MODULE_6__.ColorPickerLine, { lockObject: this.props.lockObject, linearHint: this.props.isLinear, value: this.props.disableAlpha ? this._toColor3(this.state.color) : this.state.color, onColorChanged: (colorString) => {
                                    this.setColorFromString(colorString);
                                } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: chevron }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_9__, alt: "Copy" }) })] }), this.state.isExpanded && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "r", labelTooltip: "Red", value: this.state.color.r, onChange: (value) => this.updateStateR(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "g", labelTooltip: "Green", value: this.state.color.g, onChange: (value) => this.updateStateG(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "b", labelTooltip: "Blue", value: this.state.color.b, onChange: (value) => this.updateStateB(value) }), this.props.disableAlpha || ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "a", labelTooltip: "Alpha", value: this.state.color.a, onChange: (value) => this.updateStateA(value) }))] }))] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/colorPickerComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3013274__) => {

"use strict";
__nested_webpack_require_3013274__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3013274__.d(__nested_webpack_exports__, {
/* harmony export */   ColorPickerLine: () => (/* binding */ ColorPickerLine)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3013274__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3013274__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _colorPicker_colorPicker__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3013274__(/*! ../colorPicker/colorPicker */ "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.js");



class ColorPickerLine extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { pickerEnabled: false, color: this.props.value, hex: this.getHexString(props) };
        this._floatRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._floatHostRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    syncPositions() {
        const div = this._floatRef.current;
        const host = this._floatHostRef.current;
        if (!div || !host) {
            return;
        }
        let top = host.getBoundingClientRect().top;
        const height = div.getBoundingClientRect().height;
        if (top + height + 10 > window.innerHeight) {
            top = window.innerHeight - height - 10;
        }
        div.style.top = top + "px";
        if (!this.props.shouldPopRight) {
            div.style.left = host.getBoundingClientRect().left - div.getBoundingClientRect().width + "px";
        }
        else {
            div.style.left = host.getBoundingClientRect().left + "px";
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        const diffProps = this.getHexString(nextProps) !== this.getHexString();
        if (diffProps) {
            nextState.color = nextProps.value;
            nextState.hex = this.getHexString(nextProps);
        }
        return diffProps || nextState.hex !== this.state.hex || nextState.pickerEnabled !== this.state.pickerEnabled;
    }
    getHexString(props = this.props) {
        return props.value.toHexString();
    }
    componentDidUpdate() {
        this.syncPositions();
    }
    componentDidMount() {
        this.syncPositions();
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "color-picker", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-rect-background", ref: this._floatHostRef, onClick: () => this.setState({ pickerEnabled: true }), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-rect", style: { background: this.state.hex } }) }), this.state.pickerEnabled && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-cover", onClick: (evt) => {
                            if (evt.target !== this._floatRef.current?.ownerDocument?.querySelector(".color-picker-cover")) {
                                return;
                            }
                            this.setState({ pickerEnabled: false });
                        }, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "color-picker-float", ref: this._floatRef, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_colorPicker_colorPicker__WEBPACK_IMPORTED_MODULE_2__.ColorPicker, { lockObject: this.props.lockObject || {}, color: this.state.color, linearhint: this.props.linearHint, onColorChanged: (color) => {
                                    const hex = color.toHexString();
                                    this.setState({ hex, color });
                                    this.props.onColorChanged(hex);
                                } }) }) }) }))] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js":
/*!*****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/fileButtonLineComponent.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3017983__) => {

"use strict";
__nested_webpack_require_3017983__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3017983__.d(__nested_webpack_exports__, {
/* harmony export */   FileButtonLine: () => (/* binding */ FileButtonLine)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3017983__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3017983__(/*! react */ "../../../../node_modules/react/index.js");


class FileButtonLine extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._id = FileButtonLine._IDGenerator++;
        this._uploadInputRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    onChange(evt) {
        const files = evt.target.files;
        if (files && files.length) {
            this.props.onClick(files[0]);
        }
        evt.target.value = "";
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "buttonLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: "file-upload" + this._id, className: "file-upload", children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: this._uploadInputRef, id: "file-upload" + this._id, type: "file", accept: this.props.accept, onChange: (evt) => this.onChange(evt) })] }));
    }
}
FileButtonLine._IDGenerator = 0;


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/fileMultipleButtonLineComponent.js":
/*!*************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/fileMultipleButtonLineComponent.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3020140__) => {

"use strict";
__nested_webpack_require_3020140__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3020140__.d(__nested_webpack_exports__, {
/* harmony export */   FileMultipleButtonLineComponent: () => (/* binding */ FileMultipleButtonLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3020140__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3020140__(/*! react */ "../../../../node_modules/react/index.js");


class FileMultipleButtonLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._id = FileMultipleButtonLineComponent._IDGenerator++;
        this._uploadInputRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
    }
    onChange(evt) {
        const files = evt.target.files;
        if (files && files.length) {
            this.props.onClick(evt);
        }
        evt.target.value = "";
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "buttonLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: "file-upload" + this._id, className: "file-upload", children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: this._uploadInputRef, id: "file-upload" + this._id, type: "file", accept: this.props.accept, onChange: (evt) => this.onChange(evt), multiple: true })] }));
    }
}
FileMultipleButtonLineComponent._IDGenerator = 0;


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3022341__) => {

"use strict";
__nested_webpack_require_3022341__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3022341__.d(__nested_webpack_exports__, {
/* harmony export */   FloatLineComponent: () => (/* binding */ FloatLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3022341__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3022341__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3022341__(/*! ./sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3022341__(/*! core/Misc/tools */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3022341__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _targetsProxy__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3022341__(/*! ./targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _inputArrowsComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3022341__(/*! ./inputArrowsComponent */ "../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3022341__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_3022341__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");








class FloatLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        const currentValue = this.props.target[this.props.propertyName];
        this.state = { value: this.getValueString(currentValue, this.props), dragging: false };
        this._store = currentValue;
    }
    componentWillUnmount() {
        this.unlock();
    }
    getValueString(value, props) {
        if (value) {
            if (value === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder) {
                return _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder;
            }
            else if (props.isInteger) {
                return value.toFixed(0);
            }
            else {
                return value.toFixed(props.digits || 4);
            }
        }
        return "0";
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (this._localChange) {
            this._localChange = false;
            return true;
        }
        const newValue = nextProps.target[nextProps.propertyName];
        const newValueString = this.getValueString(newValue, nextProps);
        if (newValueString !== nextState.value) {
            nextState.value = newValueString;
            return true;
        }
        if (nextState.dragging != this.state.dragging || nextProps.unit !== this.props.unit || nextProps.isInteger !== this.props.isInteger) {
            return true;
        }
        return false;
    }
    raiseOnPropertyChanged(newValue, previousValue) {
        if (this.props.onChange) {
            this.props.onChange(newValue);
        }
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName,
            value: newValue,
            initialValue: previousValue,
        });
    }
    updateValue(valueString) {
        if (/[^0-9.-]/g.test(valueString)) {
            return;
        }
        let valueAsNumber;
        if (this.props.isInteger) {
            valueAsNumber = parseInt(valueString);
        }
        else {
            valueAsNumber = parseFloat(valueString);
        }
        if (!isNaN(valueAsNumber)) {
            if (this.props.min !== undefined) {
                if (valueAsNumber < this.props.min) {
                    valueAsNumber = this.props.min;
                    valueString = valueAsNumber.toString();
                }
            }
            if (this.props.max !== undefined) {
                if (valueAsNumber > this.props.max) {
                    valueAsNumber = this.props.max;
                    valueString = valueAsNumber.toString();
                }
            }
        }
        else if (this.props.defaultValue != null) {
            valueAsNumber = this.props.defaultValue;
        }
        this._localChange = true;
        this.setState({ value: valueString });
        if (isNaN(valueAsNumber)) {
            return;
        }
        this.props.target[this.props.propertyName] = valueAsNumber;
        this.raiseOnPropertyChanged(valueAsNumber, this._store);
        this._store = valueAsNumber;
    }
    lock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = true;
        }
    }
    unlock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    incrementValue(amount, processStep = true) {
        if (processStep && this.props.step) {
            amount *= parseFloat(this.props.step);
        }
        let currentValue = parseFloat(this.state.value);
        if (isNaN(currentValue)) {
            currentValue = 0;
        }
        this.updateValue((currentValue + amount).toFixed(2));
    }
    onKeyDown(event) {
        const step = parseFloat(this.props.step || this.props.isInteger ? "1" : "0.01");
        const handleArrowKey = (sign) => {
            if (event.shiftKey) {
                sign *= 10;
                if (event.ctrlKey || event.metaKey) {
                    sign *= 10;
                }
            }
            this.incrementValue(sign * step, false);
            event.preventDefault();
        };
        if (event.key === "ArrowUp") {
            handleArrowKey(1);
        }
        else if (event.key === "ArrowDown") {
            handleArrowKey(-1);
        }
        if (event.key === "Enter" && this.props.onEnter) {
            this.props.onEnter(this._store);
        }
    }
    // Copy to clipboard the code this slider actually does
    // Example : BaseParticleSystem.minScaleX = 1.0;
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const strCommand = targetName + "." + targetProperty + " = " + value + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_6__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        let valueAsNumber;
        if (this.props.isInteger) {
            valueAsNumber = parseInt(this.state.value);
        }
        else {
            valueAsNumber = parseFloat(this.state.value);
        }
        let className = this.props.smallUI ? "short" : "value";
        if (this.state.dragging) {
            className += " dragging";
        }
        if (this.props.arrows) {
            className += " hasArrows";
        }
        const value = this.state.value === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder ? "" : this.state.value;
        const placeholder = this.state.value === _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder ? _targetsProxy__WEBPACK_IMPORTED_MODULE_4__.conflictingValuesPlaceholder : "";
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [!this.props.useEuler && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: this.props.additionalClass ? this.props.additionalClass + " floatLine" : "floatLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (!this.props.icon || this.props.label != "") && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: className, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", step: this.props.step || this.props.isInteger ? "1" : "0.01", className: "numeric-input", onKeyDown: (evt) => this.onKeyDown(evt), value: value, onBlur: () => {
                                        this.unlock();
                                        if (this.props.onEnter) {
                                            this.props.onEnter(this._store);
                                        }
                                    }, placeholder: placeholder, onFocus: () => this.lock(), onChange: (evt) => this.updateValue(evt.target.value), disabled: this.props.disabled }), this.props.arrows && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_inputArrowsComponent__WEBPACK_IMPORTED_MODULE_5__.InputArrowsComponent, { incrementValue: (amount) => this.incrementValue(amount), setDragging: (newDragging) => {
                                        const currentDragging = this.state.dragging;
                                        // drag stopped
                                        if (!currentDragging && newDragging && this.props.onDragStart) {
                                            this.props.onDragStart(valueAsNumber);
                                        }
                                        else if (currentDragging && !newDragging && this.props.onDragStop) {
                                            this.props.onDragStop(valueAsNumber);
                                        }
                                        this.setState({ dragging: newDragging });
                                    } }))] }), this.props.unit, (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_7__, alt: "Copy" }) })] })), this.props.useEuler && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_sliderLineComponent__WEBPACK_IMPORTED_MODULE_2__.SliderLineComponent, { lockObject: this.props.lockObject, label: this.props.label, minimum: 0, maximum: 360, step: 0.1, directValue: core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__.Tools.ToDegrees(valueAsNumber), onChange: (value) => this.updateValue(core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__.Tools.ToRadians(value).toString()) }))] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/hexLineComponent.js":
/*!**********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/hexLineComponent.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3034094__) => {

"use strict";
__nested_webpack_require_3034094__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3034094__.d(__nested_webpack_exports__, {
/* harmony export */   HexLineComponent: () => (/* binding */ HexLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3034094__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3034094__(/*! react */ "../../../../node_modules/react/index.js");


class HexLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        this._propertyChange = true;
        const currentValue = this.props.target[this.props.propertyName];
        this.state = { value: currentValue ? (this.props.isInteger ? currentValue.toFixed(0) : currentValue.toFixed(this.props.digits || 3)) : "0" };
        this._store = currentValue;
    }
    componentWillUnmount() {
        this.unlock();
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (this._localChange) {
            this._localChange = false;
            return true;
        }
        const newValue = nextProps.target[nextProps.propertyName];
        const newValueString = newValue ? (this.props.isInteger ? newValue.toFixed(0) : newValue.toFixed(this.props.digits || 3)) : "0";
        if (newValueString !== nextState.value) {
            nextState.value = newValueString;
            return true;
        }
        return false;
    }
    raiseOnPropertyChanged(newValue, previousValue) {
        if (this.props.onChange) {
            this.props.onChange(newValue);
        }
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.replaySourceReplacement ?? this.props.target,
            property: this.props.propertyName,
            value: newValue,
            initialValue: previousValue,
        });
    }
    convertToHexString(valueString) {
        while (valueString.length < 10) {
            valueString += "0";
        }
        return valueString;
    }
    updateValue(valueString, raisePropertyChanged) {
        if (valueString.substring(0, 2) != "0x") {
            if (valueString.substring(0, 1) != "0") {
                valueString = "0x" + valueString;
            }
            else {
                valueString = "0x" + valueString.substr(1);
            }
        }
        const valueSubstr = valueString.substr(2);
        if (valueSubstr != "" && /^[0-9A-Fa-f]+$/g.test(valueSubstr) == false) {
            return;
        }
        if (valueString.length > 10) {
            return;
        }
        const valueStringAsHex = this.convertToHexString(valueString);
        let valueAsNumber;
        valueAsNumber = parseInt(valueStringAsHex);
        if (!isNaN(valueAsNumber) && this.props.min !== undefined) {
            if (valueAsNumber < this.props.min) {
                valueAsNumber = this.props.min;
                valueString = valueAsNumber.toString();
            }
        }
        this._localChange = true;
        if (isNaN(valueAsNumber)) {
            return;
        }
        this.setState({ value: valueString });
        if (raisePropertyChanged) {
            this._propertyChange = true;
            this.props.target[this.props.propertyName] = valueAsNumber;
            this.raiseOnPropertyChanged(valueAsNumber, this._store);
        }
        else {
            this._propertyChange = false;
        }
        this._store = valueAsNumber;
    }
    lock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = true;
        }
    }
    unlock() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    render() {
        let valueAsHex;
        if (this._propertyChange) {
            const valueAsNumber = parseInt(this.state.value);
            valueAsHex = valueAsNumber.toString(16);
            let hex0String = "";
            for (let i = 0; i < 8 - valueAsHex.length; i++) {
                //padding the '0's
                hex0String += "0";
            }
            valueAsHex = "0x" + hex0String + valueAsHex.toUpperCase();
        }
        else {
            valueAsHex = this.state.value;
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: !this.props.useEuler && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: this.props.additionalClass ? this.props.additionalClass + " floatLine" : "floatLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "value", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "string", className: "hex-input", value: valueAsHex, onBlur: () => this.unlock(), onFocus: () => this.lock(), onChange: (evt) => this.updateValue(evt.target.value, false), onKeyDown: (evt) => {
                                if (evt.keyCode !== 13) {
                                    return;
                                }
                                this.updateValue(this.state.value, true);
                            } }) })] })) }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/indentedTextLineComponent.js":
/*!*******************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/indentedTextLineComponent.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3040182__) => {

"use strict";
__nested_webpack_require_3040182__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3040182__.d(__nested_webpack_exports__, {
/* harmony export */   IndentedTextLineComponent: () => (/* binding */ IndentedTextLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3040182__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3040182__(/*! react */ "../../../../node_modules/react/index.js");


class IndentedTextLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onLink() {
        if (this.props.url) {
            window.open(this.props.url, "_blank");
            return;
        }
        if (!this.props.onLink) {
            return;
        }
        this.props.onLink();
    }
    renderContent() {
        if (this.props.onLink || this.props.url) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "link-value", title: this.props.value, onClick: () => this.onLink(), children: this.props.url ? "doc" : this.props.value || "no name" }));
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "value", title: this.props.value, style: { color: this.props.color ? this.props.color : "" }, children: this.props.value || "no name" }));
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "indented " + (this.props.underline ? "textLine underline" : "textLine" + (this.props.additionalClass ? " " + this.props.additionalClass : "")), children: this.renderContent() }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3042361__) => {

"use strict";
__nested_webpack_require_3042361__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3042361__.d(__nested_webpack_exports__, {
/* harmony export */   InputArrowsComponent: () => (/* binding */ InputArrowsComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3042361__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3042361__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _valueUpArrowIcon_svg__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3042361__(/*! ./valueUpArrowIcon.svg */ "../../../dev/sharedUiComponents/dist/lines/valueUpArrowIcon.svg");
/* harmony import */ var _valueDownArrowIcon_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3042361__(/*! ./valueDownArrowIcon.svg */ "../../../dev/sharedUiComponents/dist/lines/valueDownArrowIcon.svg");




class InputArrowsComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor() {
        super(...arguments);
        this._arrowsRef = react__WEBPACK_IMPORTED_MODULE_1__.createRef();
        this._drag = (event) => {
            this.props.incrementValue(-event.movementY);
        };
        this._releaseListener = () => {
            this.props.setDragging(false);
            this._arrowsRef.current?.ownerDocument.exitPointerLock();
            this._arrowsRef.current?.ownerDocument.defaultView.removeEventListener("pointerup", this._releaseListener);
            this._arrowsRef.current?.ownerDocument.removeEventListener("pointerlockchange", this._lockChangeListener);
            this._arrowsRef.current?.ownerDocument.defaultView.removeEventListener("mousemove", this._drag);
        };
        this._lockChangeListener = () => {
            if (this._arrowsRef.current?.ownerDocument.pointerLockElement !== this._arrowsRef.current) {
                this._releaseListener();
            }
        };
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "arrows", ref: this._arrowsRef, onPointerDown: () => {
                this._arrowsRef.current?.ownerDocument.addEventListener("pointerlockchange", this._lockChangeListener);
                this._arrowsRef.current?.ownerDocument.defaultView.addEventListener("pointerup", this._releaseListener);
                this._arrowsRef.current?.ownerDocument.defaultView.addEventListener("mousemove", this._drag);
                this.props.setDragging(true);
                this._arrowsRef.current?.requestPointerLock();
            }, onDragStart: (evt) => evt.preventDefault(), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "upArrowIcon", src: _valueUpArrowIcon_svg__WEBPACK_IMPORTED_MODULE_2__, alt: "Increase Value" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "downArrowIcon", src: _valueDownArrowIcon_svg__WEBPACK_IMPORTED_MODULE_3__, alt: "Increase Value" })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js":
/*!****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3045819__) => {

"use strict";
__nested_webpack_require_3045819__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3045819__.d(__nested_webpack_exports__, {
/* harmony export */   LineContainerComponent: () => (/* binding */ LineContainerComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3045819__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3045819__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3045819__(/*! core/Misc/dataStorage */ "core/Misc/observable");
/* harmony import */ var core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3045819__.n(core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _downArrow_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3045819__(/*! ./downArrow.svg */ "../../../dev/sharedUiComponents/dist/lines/downArrow.svg");




class LineContainerComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        const initialState = core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2__.DataStorage.ReadBoolean(this.props.title, !this.props.closed);
        this.state = { isExpanded: initialState, isHighlighted: false };
    }
    switchExpandedState() {
        const newState = !this.state.isExpanded;
        core_Misc_dataStorage__WEBPACK_IMPORTED_MODULE_2__.DataStorage.WriteBoolean(this.props.title, newState);
        this.setState({ isExpanded: newState });
    }
    renderHeader() {
        const className = this.state.isExpanded ? "collapse" : "collapse closed";
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "header", onClick: () => this.switchExpandedState(), children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "title", children: this.props.title }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: className, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { className: "img", title: this.props.title, src: _downArrow_svg__WEBPACK_IMPORTED_MODULE_3__ }) })] }));
    }
    componentDidMount() {
        if (!this.props.selection) {
            return;
        }
        if (this.props.selection.selectedLineContainerTitles.length === 0 && this.props.selection.selectedLineContainerTitlesNoFocus.length === 0) {
            return;
        }
        if (this.props.selection.selectedLineContainerTitles.indexOf(this.props.title) > -1) {
            setTimeout(() => {
                this.props.selection.selectedLineContainerTitles = [];
            });
            this.setState({ isExpanded: true, isHighlighted: true });
            window.setTimeout(() => {
                this.setState({ isHighlighted: false });
            }, 5000);
        }
        else if (this.props.selection.selectedLineContainerTitlesNoFocus.indexOf(this.props.title) > -1) {
            setTimeout(() => {
                this.props.selection.selectedLineContainerTitlesNoFocus = [];
            });
            this.setState({ isExpanded: true, isHighlighted: false });
        }
        else {
            this.setState({ isExpanded: false });
        }
    }
    render() {
        if (!this.state.isExpanded) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "paneContainer", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "paneContainer-content", children: this.renderHeader() }) }));
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "paneContainer", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "paneContainer-content", children: [this.renderHeader(), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "paneList", children: this.props.children })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "paneContainer-highlight-border" + (!this.state.isHighlighted ? " transparent" : "") })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/linkButtonComponent.js":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/linkButtonComponent.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3050474__) => {

"use strict";
__nested_webpack_require_3050474__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3050474__.d(__nested_webpack_exports__, {
/* harmony export */   LinkButtonComponent: () => (/* binding */ LinkButtonComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3050474__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3050474__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3050474__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");



class LinkButtonComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onLink() {
        if (this.props.url) {
            window.open(this.props.url, "_blank");
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "linkButtonLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "link", title: this.props.label, onClick: () => this.onLink(), children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "link-button", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: () => this.props.onClick(), children: this.props.buttonLabel }) }), this.props.icon && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "link-icon hoverIcon", onClick: () => {
                        if (this.props.onIconClick) {
                            this.props.onIconClick();
                        }
                    }, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: this.props.icon }) }))] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/messageLineComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/messageLineComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3052920__) => {

"use strict";
__nested_webpack_require_3052920__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3052920__.d(__nested_webpack_exports__, {
/* harmony export */   MessageLineComponent: () => (/* binding */ MessageLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3052920__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3052920__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3052920__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");



class MessageLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        if (this.props.icon) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "iconMessageLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "icon", style: { color: this.props.color ? this.props.color : "" }, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_2__.FontAwesomeIcon, { icon: this.props.icon }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "value", title: this.props.text, children: this.props.text })] }));
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "messageLine", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "value", title: this.props.text, style: { color: this.props.color ? this.props.color : "" }, children: this.props.text }) }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js":
/*!***************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3055200__) => {

"use strict";
__nested_webpack_require_3055200__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3055200__.d(__nested_webpack_exports__, {
/* harmony export */   NumericInput: () => (/* binding */ NumericInput)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3055200__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3055200__(/*! react */ "../../../../node_modules/react/index.js");


class NumericInput extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        this.state = { value: this.props.value.toFixed(this.props.precision !== undefined ? this.props.precision : 3) };
    }
    componentWillUnmount() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (this._localChange) {
            this._localChange = false;
            return true;
        }
        if (nextProps.value.toString() !== nextState.value) {
            nextState.value = nextProps.value.toFixed(this.props.precision !== undefined ? this.props.precision : 3);
            return true;
        }
        return false;
    }
    updateValue(valueString) {
        if (/[^0-9.-]/g.test(valueString)) {
            return;
        }
        const valueAsNumber = parseFloat(valueString);
        this._localChange = true;
        this.setState({ value: valueString });
        if (isNaN(valueAsNumber)) {
            return;
        }
        this.props.onChange(valueAsNumber);
    }
    onBlur() {
        this._localChange = false;
        const valueAsNumber = parseFloat(this.state.value);
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
        if (isNaN(valueAsNumber)) {
            this.props.onChange(this.props.value);
            return;
        }
        this.props.onChange(valueAsNumber);
    }
    incrementValue(amount) {
        let currentValue = parseFloat(this.state.value);
        if (isNaN(currentValue)) {
            currentValue = 0;
        }
        this.updateValue((currentValue + amount).toFixed(this.props.precision !== undefined ? this.props.precision : 3));
    }
    onKeyDown(evt) {
        const step = this.props.step || 1;
        const handleArrowKey = (sign) => {
            if (evt.shiftKey) {
                sign *= 10;
                if (evt.ctrlKey || evt.metaKey) {
                    sign *= 10;
                }
            }
            this.incrementValue(sign * step);
            evt.preventDefault();
        };
        if (evt.key === "ArrowUp") {
            handleArrowKey(1);
        }
        else if (evt.key === "ArrowDown") {
            handleArrowKey(-1);
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "numeric", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), this.props.label && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "numeric-label", title: this.props.labelTooltip ?? this.props.label, children: `${this.props.label}: ` })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", step: this.props.step, className: "numeric-input", value: this.state.value, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => this.onKeyDown(evt), onFocus: () => {
                        if (this.props.lockObject) {
                            this.props.lockObject.lock = true;
                        }
                    }, onBlur: () => this.onBlur() })] }));
    }
}
// eslint-disable-next-line @typescript-eslint/naming-convention
NumericInput.defaultProps = {
    step: 1,
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3059622__) => {

"use strict";
__nested_webpack_require_3059622__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3059622__.d(__nested_webpack_exports__, {
/* harmony export */   Null_Value: () => (/* binding */ Null_Value),
/* harmony export */   OptionsLine: () => (/* binding */ OptionsLine)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3059622__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3059622__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3059622__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3059622__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");




// eslint-disable-next-line @typescript-eslint/naming-convention
const Null_Value = Number.MAX_SAFE_INTEGER;
class OptionsLine extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    _remapValueIn(value) {
        return this.props.allowNullValue && value === null ? Null_Value : value;
    }
    _remapValueOut(value) {
        return this.props.allowNullValue && value === Null_Value ? null : value;
    }
    _getValue(props) {
        if (props.extractValue) {
            return props.extractValue(props.target);
        }
        return props.target && props.propertyName ? props.target[props.propertyName] : props.options[props.defaultIfNull || 0];
    }
    constructor(props) {
        super(props);
        this._localChange = false;
        this.state = { value: this._remapValueIn(this._getValue(props)) };
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (this._localChange) {
            this._localChange = false;
            return true;
        }
        const newValue = this._remapValueIn(nextProps.extractValue ? nextProps.extractValue(this.props.target) : nextProps.target[nextProps.propertyName]);
        if (newValue != null && newValue !== nextState.value) {
            nextState.value = newValue;
            return true;
        }
        return false;
    }
    raiseOnPropertyChanged(newValue, previousValue) {
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName,
            value: newValue,
            initialValue: previousValue,
            allowNullValue: this.props.allowNullValue,
        });
    }
    setValue(value) {
        this.setState({ value: value });
    }
    updateValue(valueString) {
        const value = this.props.valuesAreStrings ? valueString : parseInt(valueString);
        this._localChange = true;
        const store = this.props.extractValue ? this.props.extractValue(this.props.target) : this.props.target[this.props.propertyName];
        if (!this.props.noDirectUpdate) {
            this.props.target[this.props.propertyName] = this._remapValueOut(value);
        }
        this.setState({ value: value });
        if (this.props.onSelect) {
            this.props.onSelect(value);
        }
        const newValue = this.props.extractValue ? this.props.extractValue(this.props.target) : this.props.target[this.props.propertyName];
        this.raiseOnPropertyChanged(newValue, store);
    }
    // Copy to clipboard the code this option actually does
    // Example : material.sideOrientation = 1;
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.extractValue ? this.props.extractValue(this.props.target) : this.props.target[this.props.propertyName];
            const strCommand = targetName + "." + targetProperty + " = " + value + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "listLine" + (this.props.className ? " " + this.props.className : ""), children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, color: "black", className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "options", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { onChange: (evt) => this.updateValue(evt.target.value), value: this.state.value ?? "", children: this.props.options.map((option, i) => {
                            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { selected: option.selected, value: option.value, title: option.label, children: option.label }, option.label + i));
                        }) }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_3__, alt: "Copy" }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/radioLineComponent.js":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/radioLineComponent.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3065927__) => {

"use strict";
__nested_webpack_require_3065927__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3065927__.d(__nested_webpack_exports__, {
/* harmony export */   RadioButtonLineComponent: () => (/* binding */ RadioButtonLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3065927__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3065927__(/*! react */ "../../../../node_modules/react/index.js");


class RadioButtonLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this.state = { isSelected: this.props.isSelected() };
    }
    componentDidMount() {
        this._onSelectionChangedObserver = this.props.onSelectionChangedObservable.add((value) => {
            this.setState({ isSelected: value === this });
        });
    }
    componentWillUnmount() {
        if (this._onSelectionChangedObserver) {
            this.props.onSelectionChangedObservable.remove(this._onSelectionChangedObserver);
            this._onSelectionChangedObserver = null;
        }
    }
    onChange() {
        this.props.onSelect();
        this.props.onSelectionChangedObservable.notifyObservers(this);
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "radioLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "radioContainer", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { id: this.props.label, className: "radio", type: "radio", checked: this.state.isSelected, onChange: () => this.onChange() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: this.props.label, className: "labelForRadio" })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3068547__) => {

"use strict";
__nested_webpack_require_3068547__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3068547__.d(__nested_webpack_exports__, {
/* harmony export */   SliderLineComponent: () => (/* binding */ SliderLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3068547__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3068547__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3068547__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3068547__(/*! core/Misc/tools */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3068547__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3068547__(/*! ./floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3068547__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");






class SliderLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        if (this.props.directValue !== undefined) {
            this.state = {
                value: this.props.directValue,
            };
        }
        else {
            let value = this.props.target[this.props.propertyName];
            if (value === undefined) {
                value = this.props.maximum;
            }
            this.state = { value: value };
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (nextProps.directValue !== undefined) {
            nextState.value = nextProps.directValue;
            return true;
        }
        if (nextProps.label !== this.props.label) {
            return true;
        }
        let currentState = nextProps.target[nextProps.propertyName];
        if (currentState === undefined) {
            currentState = nextProps.maximum;
        }
        if (currentState !== nextState.value || this._localChange || nextProps.maximum !== this.props.maximum || nextProps.minimum !== this.props.minimum) {
            nextState.value = currentState;
            this._localChange = false;
            return true;
        }
        if (nextProps.unit !== this.props.unit) {
            return true;
        }
        return false;
    }
    onChange(newValueString) {
        if (newValueString === "—")
            return;
        this._localChange = true;
        let newValue = parseFloat(newValueString);
        if (this.props.useEuler) {
            newValue = core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__.Tools.ToRadians(newValue);
        }
        if (this.props.target) {
            if (this.props.onPropertyChangedObservable) {
                this.props.onPropertyChangedObservable.notifyObservers({
                    object: this.props.target,
                    property: this.props.propertyName,
                    value: newValue,
                    initialValue: this.state.value,
                });
            }
            this.props.target[this.props.propertyName] = newValue;
        }
        if (this.props.onChange) {
            this.props.onChange(newValue);
        }
        this.setState({ value: newValue });
    }
    onInput(newValueString) {
        const newValue = parseFloat(newValueString);
        if (this.props.onInput) {
            this.props.onInput(newValue);
        }
    }
    prepareDataToRead(value) {
        if (value === null) {
            value = 0;
        }
        if (this.props.useEuler) {
            return core_Misc_tools__WEBPACK_IMPORTED_MODULE_3__.Tools.ToDegrees(value);
        }
        return value;
    }
    // Copy to clipboard the code this slider actually does
    // Example : ImageProcessingConfiguration.contrast = 1;
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const strCommand = targetName + "." + targetProperty + " = " + value + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_2__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "sliderLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (!this.props.icon || this.props.label != "") && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: this.props.margin ? "label withMargins" : "label", title: this.props.label, children: this.props.label })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, isInteger: this.props.decimalCount === 0, smallUI: true, label: "", target: this.state, digits: this.props.decimalCount === undefined ? 4 : this.props.decimalCount, propertyName: "value", min: this.props.allowOverflow ? undefined : this.props.minimum, max: this.props.allowOverflow ? undefined : this.props.maximum, onEnter: () => {
                        const changed = this.prepareDataToRead(this.state.value);
                        this.onChange(changed);
                    }, onChange: () => {
                        const changed = this.prepareDataToRead(this.state.value);
                        this.onChange(changed);
                    }, onPropertyChangedObservable: this.props.onPropertyChangedObservable, unit: this.props.unit }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "slider", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { className: "range" + (this.props.allowOverflow && (this.state.value > this.props.maximum || this.state.value < this.props.minimum) ? " overflow" : ""), type: "range", step: this.props.step, min: this.prepareDataToRead(this.props.minimum), max: this.prepareDataToRead(this.props.maximum), value: this.prepareDataToRead(this.state.value), onInput: (evt) => this.onInput(evt.target.value), onChange: (evt) => this.onChange(evt.target.value) }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_5__, alt: "Copy" }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js":
/*!******************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/targetsProxy.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3076367__) => {

"use strict";
__nested_webpack_require_3076367__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3076367__.d(__nested_webpack_exports__, {
/* harmony export */   conflictingValuesPlaceholder: () => (/* binding */ conflictingValuesPlaceholder),
/* harmony export */   makeTargetsProxy: () => (/* binding */ makeTargetsProxy)
/* harmony export */ });
const conflictingValuesPlaceholder = "—";
/**
 *
 * @param targets a list of selected targets
 * @param onPropertyChangedObservable
 * @param getProperty
 * @returns a proxy object that can be passed as a target into the input
 */
function makeTargetsProxy(targets, onPropertyChangedObservable, getProperty = (target, property) => target[property]) {
    return new Proxy({}, {
        get(_, name) {
            const property = name;
            if (targets.length === 0)
                return conflictingValuesPlaceholder;
            const firstValue = getProperty(targets[0], property);
            for (const target of targets) {
                if (getProperty(target, property) !== firstValue) {
                    return conflictingValuesPlaceholder;
                }
            }
            return firstValue;
        },
        set(_, name, value) {
            if (value === "—")
                return true;
            const property = name;
            for (const target of targets) {
                const initialValue = target[property];
                target[property] = value;
                if (onPropertyChangedObservable) {
                    onPropertyChangedObservable.notifyObservers({
                        object: target,
                        property: name,
                        value: target[property],
                        initialValue,
                    });
                }
            }
            return true;
        },
    });
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js":
/*!****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3078606__) => {

"use strict";
__nested_webpack_require_3078606__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3078606__.d(__nested_webpack_exports__, {
/* harmony export */   TextInputLineComponent: () => (/* binding */ TextInputLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3078606__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3078606__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _targetsProxy__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3078606__(/*! ./targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");
/* harmony import */ var _inputArrowsComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3078606__(/*! ./inputArrowsComponent */ "../../../dev/sharedUiComponents/dist/lines/inputArrowsComponent.js");




let throttleTimerId = -1;
class TextInputLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        const emptyValue = this.props.numeric ? "0" : "";
        this.state = {
            value: (this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName]) || emptyValue,
            dragging: false,
        };
    }
    componentWillUnmount() {
        if (this.props.lockObject) {
            this.props.lockObject.lock = false;
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        if (this._localChange) {
            this._localChange = false;
            return true;
        }
        const newValue = nextProps.value !== undefined ? nextProps.value : nextProps.target[nextProps.propertyName];
        if (newValue !== nextState.value) {
            nextState.value = newValue || "";
            return true;
        }
        if (nextState.dragging != this.state.dragging || nextProps.unit !== this.props.unit) {
            return true;
        }
        return false;
    }
    raiseOnPropertyChanged(newValue, previousValue) {
        if (this.props.onChange) {
            this.props.onChange(newValue);
            return;
        }
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName,
            value: newValue,
            initialValue: previousValue,
        });
    }
    getCurrentNumericValue(value) {
        const numeric = parseFloat(value);
        if (!isNaN(numeric)) {
            return numeric;
        }
        if (this.props.placeholder !== undefined) {
            const placeholderNumeric = parseFloat(this.props.placeholder);
            if (!isNaN(placeholderNumeric)) {
                return placeholderNumeric;
            }
        }
        return 0;
    }
    updateValue(value, valueToValidate) {
        if (this.props.disabled) {
            return;
        }
        if (this.props.numbersOnly) {
            if (/[^0-9.px%-]/g.test(value)) {
                return;
            }
            if (!value) {
                value = "0";
            }
            //Removing starting zero if there is a number of a minus after it.
            if (value.search(/0+[0-9-]/g) === 0) {
                value = value.substring(1);
            }
        }
        if (this.props.numeric) {
            let numericValue = this.getCurrentNumericValue(value);
            if (this.props.roundValues) {
                numericValue = Math.round(numericValue);
            }
            if (this.props.min !== undefined) {
                numericValue = Math.max(this.props.min, numericValue);
            }
            if (this.props.max !== undefined) {
                numericValue = Math.min(this.props.max, numericValue);
            }
            value = numericValue.toString();
        }
        this._localChange = true;
        const store = this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName];
        if (this.props.validator && valueToValidate) {
            if (this.props.validator(valueToValidate) == false) {
                value = store;
            }
        }
        this.setState({ value: value });
        if (this.props.propertyName && !this.props.delayInput) {
            this.props.target[this.props.propertyName] = value;
        }
        if (this.props.throttlePropertyChangedNotification) {
            if (throttleTimerId >= 0) {
                window.clearTimeout(throttleTimerId);
            }
            throttleTimerId = window.setTimeout(() => {
                this.raiseOnPropertyChanged(value, store);
            }, this.props.throttlePropertyChangedNotificationDelay ?? 200);
        }
        else {
            this.raiseOnPropertyChanged(value, store);
        }
    }
    incrementValue(amount) {
        if (this.props.step) {
            amount *= this.props.step;
        }
        if (this.props.arrowsIncrement) {
            this.props.arrowsIncrement(amount);
            return;
        }
        const currentValue = this.getCurrentNumericValue(this.state.value);
        this.updateValue((currentValue + amount).toFixed(2));
    }
    onKeyDown(event) {
        if (!this.props.disabled && this.props.arrows) {
            if (event.key === "ArrowUp") {
                this.incrementValue(1);
                event.preventDefault();
            }
            if (event.key === "ArrowDown") {
                this.incrementValue(-1);
                event.preventDefault();
            }
        }
    }
    render() {
        const value = this.state.value === _targetsProxy__WEBPACK_IMPORTED_MODULE_2__.conflictingValuesPlaceholder ? "" : this.state.value;
        const placeholder = this.state.value === _targetsProxy__WEBPACK_IMPORTED_MODULE_2__.conflictingValuesPlaceholder ? _targetsProxy__WEBPACK_IMPORTED_MODULE_2__.conflictingValuesPlaceholder : this.props.placeholder || "";
        const step = this.props.step || (this.props.roundValues ? 1 : 0.01);
        const className = this.props.multilines ? "textInputArea" : this.props.unit !== undefined ? "textInputLine withUnits" : "textInputLine";
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: className, children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, color: "black", className: "icon" }), this.props.label !== undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label })), this.props.multilines && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { className: this.props.disabled ? "disabled" : "", value: this.state.value, onFocus: () => {
                            if (this.props.lockObject) {
                                this.props.lockObject.lock = true;
                            }
                        }, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => {
                            if (evt.keyCode !== 13) {
                                return;
                            }
                            this.updateValue(this.state.value);
                        }, onBlur: (evt) => {
                            this.updateValue(evt.target.value, evt.target.value);
                            if (this.props.lockObject) {
                                this.props.lockObject.lock = false;
                            }
                        }, disabled: this.props.disabled }) })), !this.props.multilines && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: `value${this.props.noUnderline === true ? " noUnderline" : ""}${this.props.arrows ? " hasArrows" : ""}${this.state.dragging ? " dragging" : ""}`, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { className: this.props.disabled ? "disabled" : "", value: value, onBlur: (evt) => {
                                if (this.props.lockObject) {
                                    this.props.lockObject.lock = false;
                                }
                                this.updateValue((this.props.value !== undefined ? this.props.value : this.props.target[this.props.propertyName]) || "", evt.target.value);
                            }, onFocus: () => {
                                if (this.props.lockObject) {
                                    this.props.lockObject.lock = true;
                                }
                            }, onChange: (evt) => this.updateValue(evt.target.value), onKeyDown: (evt) => this.onKeyDown(evt), placeholder: placeholder, type: this.props.numeric ? "number" : "text", step: step, disabled: this.props.disabled }), this.props.arrows && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_inputArrowsComponent__WEBPACK_IMPORTED_MODULE_3__.InputArrowsComponent, { incrementValue: (amount) => this.incrementValue(amount), setDragging: (dragging) => this.setState({ dragging }) }))] })), this.props.unit] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/textLineComponent.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3088416__) => {

"use strict";
__nested_webpack_require_3088416__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3088416__.d(__nested_webpack_exports__, {
/* harmony export */   TextLineComponent: () => (/* binding */ TextLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3088416__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3088416__(/*! react */ "../../../../node_modules/react/index.js");


class TextLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onLink() {
        if (this.props.url) {
            window.open(this.props.url, "_blank");
            return;
        }
        if (!this.props.onLink) {
            return;
        }
        this.props.onLink();
    }
    renderContent() {
        if (this.props.ignoreValue) {
            return null;
        }
        if (this.props.onLink || this.props.url) {
            return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "link-value", title: this.props.tooltip ?? this.props.label ?? "", onClick: () => this.onLink(), children: this.props.url ? "doc" : this.props.value || "no name" }));
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "value", title: this.props.tooltip ?? this.props.label ?? "", style: { color: this.props.color ? this.props.color : "" }, children: this.props.value || "no name" }));
    }
    render() {
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: this.props.underline ? "textLine underline" : "textLine" + (this.props.additionalClass ? " " + this.props.additionalClass : ""), children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.tooltip ?? this.props.label ?? "", children: this.props.label ?? "" }), this.renderContent()] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/valueLineComponent.js":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/valueLineComponent.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3091036__) => {

"use strict";
__nested_webpack_require_3091036__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3091036__.d(__nested_webpack_exports__, {
/* harmony export */   ValueLineComponent: () => (/* binding */ ValueLineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3091036__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3091036__(/*! react */ "../../../../node_modules/react/index.js");


class ValueLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const digits = this.props.fractionDigits !== undefined ? this.props.fractionDigits : 2;
        const value = this.props.value.toFixed(digits) + (this.props.units ? " " + this.props.units : "");
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "textLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "value", style: { color: this.props.color ? this.props.color : "" }, children: value })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/vector2LineComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3092954__) => {

"use strict";
__nested_webpack_require_3092954__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3092954__.d(__nested_webpack_exports__, {
/* harmony export */   Vector2LineComponent: () => (/* binding */ Vector2LineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3092954__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3092954__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3092954__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3092954__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _numericInputComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3092954__(/*! ./numericInputComponent */ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3092954__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3092954__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");






class Vector2LineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        const value = this.props.target[this.props.propertyName];
        this.state = { isExpanded: false, value: value && value.clone ? value.clone() : core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector2.Zero() };
    }
    shouldComponentUpdate(nextProps, nextState) {
        const nextPropsValue = nextProps.target[nextProps.propertyName];
        if (!nextPropsValue.equals(nextState.value) || this._localChange) {
            nextState.value = nextPropsValue.clone();
            this._localChange = false;
            return true;
        }
        return false;
    }
    switchExpandState() {
        this._localChange = true;
        this.setState({ isExpanded: !this.state.isExpanded });
    }
    raiseOnPropertyChanged(previousValue) {
        if (this.props.onChange) {
            this.props.onChange(this.state.value);
        }
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName,
            value: this.state.value,
            initialValue: previousValue,
        });
    }
    updateStateX(value) {
        this._localChange = true;
        const store = this.state.value.clone();
        this.props.target[this.props.propertyName].x = value;
        this.state.value.x = value;
        this.setState({ value: this.state.value });
        this.raiseOnPropertyChanged(store);
    }
    updateStateY(value) {
        this._localChange = true;
        const store = this.state.value.clone();
        this.props.target[this.props.propertyName].y = value;
        this.state.value.y = value;
        this.setState({ value: this.state.value });
        this.raiseOnPropertyChanged(store);
    }
    render() {
        const chevron = this.state.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faMinus }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faPlus });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "vector3Line", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "firstLine", title: this.props.label, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "vector", children: `X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}` }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: chevron })] }), this.state.isExpanded && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "x", step: this.props.step, value: this.state.value.x, onChange: (value) => this.updateStateX(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "y", step: this.props.step, value: this.state.value.y, onChange: (value) => this.updateStateY(value) })] }))] }));
    }
}
// eslint-disable-next-line @typescript-eslint/naming-convention
Vector2LineComponent.defaultProps = {
    step: 0.001, // cm
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/vector3LineComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3099054__) => {

"use strict";
__nested_webpack_require_3099054__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3099054__.d(__nested_webpack_exports__, {
/* harmony export */   Vector3LineComponent: () => (/* binding */ Vector3LineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3099054__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3099054__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3099054__(/*! core/Misc/tools */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3099054__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3099054__(/*! ../lines/numericInputComponent */ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3099054__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_3099054__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
/* harmony import */ var _copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3099054__(/*! ../copyCommandToClipboard */ "../../../dev/sharedUiComponents/dist/copyCommandToClipboard.js");
/* harmony import */ var _lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3099054__(/*! ../lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_3099054__(/*! ../imgs/copy.svg */ "../../../dev/sharedUiComponents/dist/imgs/copy.svg");










class Vector3LineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        const value = this.getCurrentValue();
        this.state = { isExpanded: false, value: value && value.clone ? value.clone() : core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero() };
    }
    getCurrentValue() {
        return this.props.target[this.props.propertyName];
    }
    shouldComponentUpdate(nextProps, nextState) {
        const nextPropsValue = nextProps.target[nextProps.propertyName];
        if (!nextPropsValue.equals(nextState.value) || this._localChange) {
            nextState.value = nextPropsValue.clone();
            this._localChange = false;
            return true;
        }
        return false;
    }
    switchExpandState() {
        this._localChange = true;
        this.setState({ isExpanded: !this.state.isExpanded });
    }
    raiseOnPropertyChanged(previousValue) {
        if (this.props.onChange) {
            this.props.onChange(this.state.value);
        }
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName,
            value: this.state.value,
            initialValue: previousValue,
        });
    }
    updateVector3() {
        const store = this.props.target[this.props.propertyName].clone();
        this.props.target[this.props.propertyName] = this.state.value;
        this.setState({ value: store });
        this.raiseOnPropertyChanged(store);
    }
    updateStateX(value) {
        this._localChange = true;
        this.state.value.x = value;
        this.updateVector3();
    }
    updateStateY(value) {
        this._localChange = true;
        this.state.value.y = value;
        this.updateVector3();
    }
    updateStateZ(value) {
        this._localChange = true;
        this.state.value.z = value;
        this.updateVector3();
    }
    // Copy to clipboard the code this Vector3 actually does
    // Example : Mesh.position = new BABYLON.Vector3(0, 1, 0);
    onCopyClick() {
        if (this.props && this.props.target) {
            const { className, babylonNamespace } = (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__.getClassNameWithNamespace)(this.props.target);
            const targetName = "globalThis.debugNode";
            const targetProperty = this.props.propertyName;
            const value = this.props.target[this.props.propertyName];
            const strVector = "new " + babylonNamespace + "Vector3(" + value.x + ", " + value.y + ", " + value.z + ")";
            const strCommand = targetName + "." + targetProperty + " = " + strVector + ";// (debugNode as " + babylonNamespace + className + ")";
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__.copyCommandToClipboard)(strCommand);
        }
        else {
            (0,_copyCommandToClipboard__WEBPACK_IMPORTED_MODULE_5__.copyCommandToClipboard)("undefined");
        }
    }
    render() {
        const chevron = this.state.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faMinus }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faPlus });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "vector3Line", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "firstLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "vector", children: [!this.props.useEuler && `X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}`, this.props.useEuler &&
                                    `X: ${core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.x).toFixed(2)}, Y: ${core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.y).toFixed(2)}, Z: ${core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.z).toFixed(2)}`] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: chevron }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "copy hoverIcon", onClick: () => this.onCopyClick(), title: "Copy to clipboard", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: _imgs_copy_svg__WEBPACK_IMPORTED_MODULE_8__, alt: "Copy" }) })] }), this.state.isExpanded && !this.props.useEuler && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { label: "x", lockObject: this.props.lockObject, step: this.props.step, value: this.state.value.x, onChange: (value) => this.updateStateX(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { label: "y", lockObject: this.props.lockObject, step: this.props.step, value: this.state.value.y, onChange: (value) => this.updateStateY(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { label: "z", lockObject: this.props.lockObject, step: this.props.step, value: this.state.value.z, onChange: (value) => this.updateStateZ(value) })] })), this.state.isExpanded && this.props.useEuler && !this.props.noSlider && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, margin: true, label: "x", minimum: 0, maximum: 360, step: 0.1, directValue: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.x), onChange: (value) => this.updateStateX(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, margin: true, label: "y", minimum: 0, maximum: 360, step: 0.1, directValue: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.y), onChange: (value) => this.updateStateY(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_6__.SliderLineComponent, { lockObject: this.props.lockObject, margin: true, label: "z", minimum: 0, maximum: 360, step: 0.1, directValue: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.z), onChange: (value) => this.updateStateZ(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) })] })), this.state.isExpanded && this.props.useEuler && this.props.noSlider && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "x", step: this.props.step, value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.x), onChange: (value) => this.updateStateX(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "y", step: this.props.step, value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.y), onChange: (value) => this.updateStateY(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "z", step: this.props.step, value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.z), onChange: (value) => this.updateStateZ(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) })] }))] }));
    }
}
// eslint-disable-next-line @typescript-eslint/naming-convention
Vector3LineComponent.defaultProps = {
    step: 0.001, // cm
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/vector4LineComponent.js":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/vector4LineComponent.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3110911__) => {

"use strict";
__nested_webpack_require_3110911__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3110911__.d(__nested_webpack_exports__, {
/* harmony export */   Vector4LineComponent: () => (/* binding */ Vector4LineComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3110911__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3110911__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3110911__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3110911__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _numericInputComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3110911__(/*! ./numericInputComponent */ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js");
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3110911__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3110911__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");






class Vector4LineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
        this._localChange = false;
        const value = this.getCurrentValue();
        this.state = { isExpanded: false, value: value && value.clone ? value.clone() : core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector4.Zero() };
    }
    getCurrentValue() {
        return this.props.value || this.props.target[this.props.propertyName];
    }
    shouldComponentUpdate(nextProps, nextState) {
        const nextPropsValue = nextProps.value || nextProps.target[nextProps.propertyName];
        if (!nextPropsValue.equals(nextState.value) || this._localChange) {
            nextState.value = nextPropsValue.clone();
            this._localChange = false;
            return true;
        }
        return false;
    }
    switchExpandState() {
        this._localChange = true;
        this.setState({ isExpanded: !this.state.isExpanded });
    }
    raiseOnPropertyChanged(previousValue) {
        if (this.props.onChange) {
            this.props.onChange(this.state.value);
        }
        if (!this.props.onPropertyChangedObservable) {
            return;
        }
        this.props.onPropertyChangedObservable.notifyObservers({
            object: this.props.target,
            property: this.props.propertyName || "",
            value: this.state.value,
            initialValue: previousValue,
        });
    }
    updateVector4() {
        const store = this.getCurrentValue().clone();
        if (this.props.value) {
            this.props.value.copyFrom(this.state.value);
        }
        else {
            this.props.target[this.props.propertyName] = this.state.value;
        }
        this.setState({ value: store });
        this.raiseOnPropertyChanged(store);
    }
    updateStateX(value) {
        this._localChange = true;
        this.state.value.x = value;
        this.updateVector4();
    }
    updateStateY(value) {
        this._localChange = true;
        this.state.value.y = value;
        this.updateVector4();
    }
    updateStateZ(value) {
        this._localChange = true;
        this.state.value.z = value;
        this.updateVector4();
    }
    updateStateW(value) {
        this._localChange = true;
        this.state.value.w = value;
        this.updateVector4();
    }
    render() {
        const chevron = this.state.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faMinus }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faPlus });
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "vector3Line", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "firstLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "vector", children: `X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}, W: ${this.state.value.w.toFixed(2)}` }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: chevron })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "x", step: this.props.step, value: this.state.value.x, onChange: (value) => this.updateStateX(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "y", step: this.props.step, value: this.state.value.y, onChange: (value) => this.updateStateY(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "z", step: this.props.step, value: this.state.value.z, onChange: (value) => this.updateStateZ(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInput, { lockObject: this.props.lockObject, label: "w", step: this.props.step, value: this.state.value.w, onChange: (value) => this.updateStateW(value) })] })] }));
    }
}
// eslint-disable-next-line @typescript-eslint/naming-convention
Vector4LineComponent.defaultProps = {
    step: 0.001, // cm
};


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/popupHelper.js":
/*!***********************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/popupHelper.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3117930__) => {

"use strict";
__nested_webpack_require_3117930__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3117930__.d(__nested_webpack_exports__, {
/* harmony export */   CreatePopup: () => (/* binding */ CreatePopup)
/* harmony export */ });
/* harmony import */ var _styleHelper__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3117930__(/*! ./styleHelper */ "../../../dev/sharedUiComponents/dist/styleHelper.js");

/**
 * Create a popup window
 * @param title default title for the popup
 * @param options options for the popup
 * @returns the parent control of the popup
 */
function CreatePopup(title, options) {
    const localOptions = {
        width: 300,
        height: 800,
        ...options,
    };
    const windowCreationOptionsList = {
        width: localOptions.width,
        height: localOptions.height,
        top: (window.innerHeight - localOptions.width) / 2 + window.screenY,
        left: (window.innerWidth - localOptions.height) / 2 + window.screenX,
    };
    const windowCreationOptions = Object.keys(windowCreationOptionsList)
        .map((key) => key + "=" + windowCreationOptionsList[key])
        .join(",");
    const popupWindow = window.open("", title, windowCreationOptions);
    if (!popupWindow) {
        return null;
    }
    const parentDocument = popupWindow.document;
    // Font
    const newLinkEl = parentDocument.createElement("link");
    newLinkEl.rel = "stylesheet";
    newLinkEl.href = "https://use.typekit.net/cta4xsb.css";
    parentDocument.head.appendChild(newLinkEl);
    parentDocument.title = title;
    parentDocument.body.style.width = "100%";
    parentDocument.body.style.height = "100%";
    parentDocument.body.style.margin = "0";
    parentDocument.body.style.padding = "0";
    const parentControl = parentDocument.createElement("div");
    parentControl.style.width = "100%";
    parentControl.style.height = "100%";
    parentControl.style.margin = "0";
    parentControl.style.padding = "0";
    if (localOptions.onParentControlCreateCallback) {
        localOptions.onParentControlCreateCallback(parentControl);
    }
    popupWindow.document.body.appendChild(parentControl);
    (0,_styleHelper__WEBPACK_IMPORTED_MODULE_0__.CopyStyles)(window.document, parentDocument);
    setTimeout(() => {
        // need this for late bindings
        (0,_styleHelper__WEBPACK_IMPORTED_MODULE_0__.CopyStyles)(window.document, parentDocument);
    }, 0);
    if (localOptions.onWindowCreateCallback) {
        localOptions.onWindowCreateCallback(popupWindow);
    }
    return parentControl;
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/stringTools.js":
/*!***********************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/stringTools.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3120806__) => {

"use strict";
__nested_webpack_require_3120806__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3120806__.d(__nested_webpack_exports__, {
/* harmony export */   StringTools: () => (/* binding */ StringTools)
/* harmony export */ });
class StringTools {
    /*
     * Based on FileSaver.js
     * A saveAs() FileSaver implementation.
     *
     * By Eli Grey, http://eligrey.com
     *
     * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)
     * source  : http://purl.eligrey.com/github/FileSaver.js
     */
    static _SaveAs(blob, name, document) {
        if ("download" in HTMLAnchorElement.prototype) {
            const URL = window.URL || window.webkitURL;
            const a = document.createElement("a");
            a.download = name;
            a.rel = "noopener"; // tabnabbing
            a.href = URL.createObjectURL(blob);
            setTimeout(() => {
                URL.revokeObjectURL(a.href);
            }, 4e4); // 40s
            setTimeout(() => {
                this._Click(a, document);
            }, 0);
            return;
        }
        // Open a popup immediately do go around popup blocker
        // Mostly only available on user interaction and the fileReader is async so...
        let popup = open("", "_blank");
        if (popup) {
            popup.document.title = popup.document.body.innerText = "downloading...";
        }
        const force = blob.type === "application/octet-stream";
        const isSafari = /constructor/i.test(window.HTMLElement) || window.safari;
        const isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent);
        if ((isChromeIOS || (force && isSafari)) && typeof FileReader !== "undefined") {
            // Safari doesn't allow downloading of blob URLs
            const reader = new FileReader();
            reader.onloadend = () => {
                let url = reader.result;
                url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, "data:attachment/file;");
                if (popup) {
                    popup.location.href = url;
                }
                else {
                    location.href = url;
                }
                popup = null;
            };
            reader.readAsDataURL(blob);
        }
        else {
            const URL = window.URL || window.webkitURL;
            const url = URL.createObjectURL(blob);
            if (popup) {
                popup.location.href = url;
            }
            else {
                location.href = url;
            }
            popup = null;
            setTimeout(function () {
                URL.revokeObjectURL(url);
            }, 4e4);
        }
    }
    static _Click(node, document) {
        try {
            node.dispatchEvent(new MouseEvent("click"));
        }
        catch (e) {
            const evt = document.createEvent("MouseEvents");
            evt.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
            node.dispatchEvent(evt);
        }
    }
    /**
     * Download a string into a file that will be saved locally by the browser
     * @param document
     * @param content defines the string to download locally as a file
     * @param filename
     */
    static DownloadAsFile(document, content, filename) {
        const blob = new Blob([content], {
            type: "application/octet-stream",
        });
        this._SaveAs(blob, filename, document);
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/styleHelper.js":
/*!***********************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/styleHelper.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3124613__) => {

"use strict";
__nested_webpack_require_3124613__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3124613__.d(__nested_webpack_exports__, {
/* harmony export */   CopyStyles: () => (/* binding */ CopyStyles)
/* harmony export */ });
/**
 * Copy all styles from a document to another document or shadow root
 * @param source document to copy styles from
 * @param target document or shadow root to copy styles to
 */
function CopyStyles(source, target) {
    // Copy all <style> elements
    Array.from(source.querySelectorAll("style")).forEach((style) => {
        const newStyle = target.createElement("style");
        newStyle.textContent = style.textContent;
        target.head.appendChild(newStyle);
    });
    // Copy all <link> elements for stylesheets
    Array.from(source.querySelectorAll('link[rel="stylesheet"]')).forEach((link) => {
        const newLink = target.createElement("link");
        newLink.rel = "stylesheet";
        newLink.href = link.href;
        target.head.appendChild(newLink);
    });
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js":
/*!****************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js ***!
  \****************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3126134__) => {

"use strict";
__nested_webpack_require_3126134__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3126134__.d(__nested_webpack_exports__, {
/* harmony export */   CheckboxPropertyGridComponent: () => (/* binding */ CheckboxPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3126134__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3126134__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3126134__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3126134__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3126134__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3126134__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");






class CheckboxPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const checkbox = this.props.checkbox;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: checkbox, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "CHECKBOX", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Check size ratio", target: checkbox, propertyName: "checkSizeRatio", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Checked", target: checkbox, propertyName: "isChecked", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js":
/*!*******************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js ***!
  \*******************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3129627__) => {

"use strict";
__nested_webpack_require_3129627__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3129627__.d(__nested_webpack_exports__, {
/* harmony export */   ColorPickerPropertyGridComponent: () => (/* binding */ ColorPickerPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3129627__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3129627__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3129627__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3129627__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3129627__(/*! ../../../lines/color3LineComponent */ "../../../dev/sharedUiComponents/dist/lines/color3LineComponent.js");





class ColorPickerPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const colorPicker = this.props.colorPicker;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: colorPicker, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "COLORPICKER", children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__.Color3LineComponent, { lockObject: this.props.lockObject, label: "Color", target: colorPicker, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable }) })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js":
/*!*********************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js ***!
  \*********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3132639__) => {

"use strict";
__nested_webpack_require_3132639__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3132639__.d(__nested_webpack_exports__, {
/* harmony export */   CommonControlPropertyGridComponent: () => (/* binding */ CommonControlPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3132639__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3132639__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3132639__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3132639__(/*! ../../../lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3132639__(/*! gui/2D/controls/control */ "gui/2D/adtInstrumentation");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3132639__.n(gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3132639__(/*! ../../../lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3132639__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_3132639__(/*! ../../../lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_3132639__(/*! ../../../lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var _lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_3132639__(/*! ../../../lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");










class CommonControlPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    renderGridInformation(control) {
        if (!control.parent) {
            return null;
        }
        const gridParent = control.parent;
        if (gridParent.rowCount === undefined) {
            return null;
        }
        const grid = gridParent;
        const childCellInfo = grid.getChildCellInfo(control);
        if (childCellInfo === undefined) {
            return null;
        }
        const cellInfos = childCellInfo.split(":");
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GRID", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Row", value: cellInfos[0] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Column", value: cellInfos[1] })] }));
    }
    render() {
        let controls;
        if (this.props.controls) {
            controls = this.props.controls;
        }
        else if (this.props.control) {
            controls = [this.props.control];
        }
        else {
            return;
        }
        const control = controls[0];
        const horizontalOptions = [
            { label: "Left", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__.Control.HORIZONTAL_ALIGNMENT_LEFT },
            { label: "Right", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__.Control.HORIZONTAL_ALIGNMENT_RIGHT },
            { label: "Center", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__.Control.HORIZONTAL_ALIGNMENT_CENTER },
        ];
        const verticalOptions = [
            { label: "Top", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__.Control.VERTICAL_ALIGNMENT_TOP },
            { label: "Bottom", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__.Control.VERTICAL_ALIGNMENT_BOTTOM },
            { label: "Center", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__.Control.VERTICAL_ALIGNMENT_CENTER },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "GENERAL", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Class", value: control.getClassName() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Name", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "name", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__.TextLineComponent, { label: "Unique ID", value: control.uniqueId.toString() }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Alpha", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "alpha", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), control.color !== undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Color", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "color", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), control.background !== undefined && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Background", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "background", onPropertyChangedObservable: this.props.onPropertyChangedObservable })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, label: "ZIndex", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "zIndex", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), this.renderGridInformation(control), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "ALIGNMENT", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_8__.OptionsLine, { label: "Horizontal", options: horizontalOptions, target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "horizontalAlignment", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_8__.OptionsLine, { label: "Vertical", options: verticalOptions, target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "verticalAlignment", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "POSITION", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Left", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "left", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Top", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "top", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Width", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "width", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Height", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "height", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Padding left", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "paddingLeft", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Padding top", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "paddingTop", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Padding right", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "paddingRight", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Padding bottom", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "paddingBottom", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "TRANSFORMATION", closed: true, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, label: "ScaleX", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "scaleX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, label: "ScaleY", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "scaleY", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Rotation", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "rotation", minimum: 0, maximum: 2 * Math.PI, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Transform center X", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "transformCenterX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Transform center Y", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "transformCenterY", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "FONT", closed: true, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Family", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "fontFamily", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Size", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "fontSize", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Weight", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "fontWeight", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Style", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "fontStyle", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__.LineContainerComponent, { title: "SHADOWS", closed: true, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Color", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "shadowColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Offset X", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "shadowOffsetX", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Offset Y", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "shadowOffsetY", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Blur", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_9__.makeTargetsProxy)(controls, this.props.onPropertyChangedObservable), propertyName: "shadowBlur", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/controlPropertyGridComponent.js":
/*!***************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/controlPropertyGridComponent.js ***!
  \***************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3151372__) => {

"use strict";
__nested_webpack_require_3151372__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3151372__.d(__nested_webpack_exports__, {
/* harmony export */   ControlPropertyGridComponent: () => (/* binding */ ControlPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3151372__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3151372__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3151372__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");



class ControlPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const control = this.props.control;
        return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: control, onPropertyChangedObservable: this.props.onPropertyChangedObservable });
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js":
/*!***************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js ***!
  \***************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3153287__) => {

"use strict";
__nested_webpack_require_3153287__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3153287__.d(__nested_webpack_exports__, {
/* harmony export */   EllipsePropertyGridComponent: () => (/* binding */ EllipsePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3153287__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3153287__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3153287__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3153287__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3153287__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3153287__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");






class EllipsePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const ellipse = this.props.ellipse;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: ellipse, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ELLIPSE", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Clip children", target: ellipse, propertyName: "clipChildren", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Thickness", target: ellipse, propertyName: "thickness", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/gridPropertyGridComponent.js":
/*!************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/gridPropertyGridComponent.js ***!
  \************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3156740__) => {

"use strict";
__nested_webpack_require_3156740__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3156740__.d(__nested_webpack_exports__, {
/* harmony export */   GridPropertyGridComponent: () => (/* binding */ GridPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3156740__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3156740__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3156740__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3156740__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3156740__(/*! ../../../lines/textLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textLineComponent.js");





class GridPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    renderRows() {
        const grid = this.props.grid;
        const rows = [];
        for (let index = 0; index < grid.rowCount; index++) {
            rows.push(grid.getRowDefinition(index));
        }
        return rows.map((rd, i) => {
            return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: `Row ${i}`, value: rd.toString(grid.host, 2), underline: i === grid.rowCount - 1 }, `r${i}`);
        });
    }
    renderColumns() {
        const grid = this.props.grid;
        const cols = [];
        for (let index = 0; index < grid.columnCount; index++) {
            cols.push(grid.getColumnDefinition(index));
        }
        return cols.map((cd, i) => {
            return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextLineComponent, { label: `Column ${i}`, value: cd.toString(grid.host, 2) }, `c${i}`);
        });
    }
    render() {
        const grid = this.props.grid;
        const cols = [];
        for (let index = 0; index < grid.rowCount; index++) {
            cols.push(grid.getColumnDefinition(index));
        }
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: grid, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "GRID", children: [this.renderRows(), this.renderColumns()] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js":
/*!************************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js ***!
  \************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3160605__) => {

"use strict";
__nested_webpack_require_3160605__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3160605__.d(__nested_webpack_exports__, {
/* harmony export */   ImageBasedSliderPropertyGridComponent: () => (/* binding */ ImageBasedSliderPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3160605__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3160605__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3160605__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3160605__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3160605__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3160605__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3160605__(/*! ../../../lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");







class ImageBasedSliderPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const imageBasedSlider = this.props.imageBasedSlider;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: imageBasedSlider, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "IMAGE BASED SLIDER", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Display thumb", target: imageBasedSlider, propertyName: "displayThumb", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Vertical", target: imageBasedSlider, propertyName: "isVertical", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Thumb clamped", target: imageBasedSlider, propertyName: "isThumbClamped", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Bar offset", target: imageBasedSlider, propertyName: "barOffset", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Thumb width", target: imageBasedSlider, propertyName: "thumbWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Minimum", target: imageBasedSlider, propertyName: "minimum", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Maximum", target: imageBasedSlider, propertyName: "maximum", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Value", target: imageBasedSlider, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/imagePropertyGridComponent.js":
/*!*************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/imagePropertyGridComponent.js ***!
  \*************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3166197__) => {

"use strict";
__nested_webpack_require_3166197__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3166197__.d(__nested_webpack_exports__, {
/* harmony export */   ImagePropertyGridComponent: () => (/* binding */ ImagePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3166197__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3166197__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3166197__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3166197__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3166197__(/*! gui/2D/controls/image */ "gui/2D/adtInstrumentation");
/* harmony import */ var gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3166197__.n(gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3166197__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3166197__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_3166197__(/*! ../../../lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_3166197__(/*! ../../../lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");









class ImagePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const image = this.props.image;
        const stretchOptions = [
            { label: "None", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__.Image.STRETCH_NONE },
            { label: "Fill", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__.Image.STRETCH_FILL },
            { label: "Uniform", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__.Image.STRETCH_UNIFORM },
            { label: "Extend", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__.Image.STRETCH_EXTEND },
            { label: "NinePatch", value: gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__.Image.STRETCH_NINE_PATCH },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: image, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "IMAGE", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_8__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Source", target: image, propertyName: "source", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Source left", target: image, propertyName: "sourceLeft", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Source top", target: image, propertyName: "sourceTop", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Source width", target: image, propertyName: "sourceWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Source height", target: image, propertyName: "sourceHeight", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Autoscale", target: image, propertyName: "autoScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_7__.OptionsLine, { label: "Stretch", options: stretchOptions, target: image, propertyName: "stretch", onPropertyChangedObservable: this.props.onPropertyChangedObservable, onSelect: (value) => this.setState({ mode: value }) })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "ANIMATION SHEET", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Cell Id", isInteger: true, target: image, propertyName: "cellId", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Cell width", target: image, propertyName: "cellWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Cell height", target: image, propertyName: "cellHeight", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js":
/*!*****************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js ***!
  \*****************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3173689__) => {

"use strict";
__nested_webpack_require_3173689__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3173689__.d(__nested_webpack_exports__, {
/* harmony export */   InputTextPropertyGridComponent: () => (/* binding */ InputTextPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3173689__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3173689__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3173689__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3173689__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3173689__(/*! ../../../lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3173689__(/*! ../../../lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3173689__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_3173689__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");








class InputTextPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const inputText = this.props.inputText;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: inputText, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "INPUTTEXT", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Text", target: inputText, propertyName: "text", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Prompt", target: inputText, propertyName: "promptMessage", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Max width", target: inputText, propertyName: "maxWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Highlight color", target: inputText, propertyName: "textHighlightColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, label: "Highligher opacity", minimum: 0, maximum: 1, step: 0.01, target: inputText, propertyName: "highligherOpacity", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "On focus select all", target: inputText, propertyName: "onFocusSelectAll", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Focused background", target: inputText, propertyName: "focusedBackground", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Max width", target: inputText, propertyName: "maxWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Margin", target: inputText, propertyName: "margin", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Auto stretch width", target: inputText, propertyName: "autoStretchWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Thickness", target: inputText, propertyName: "thickness", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Placeholder text", target: inputText, propertyName: "placeholderText", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_4__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Placeholder color", target: inputText, propertyName: "placeholderColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/linePropertyGridComponent.js":
/*!************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/linePropertyGridComponent.js ***!
  \************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3181123__) => {

"use strict";
__nested_webpack_require_3181123__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3181123__.d(__nested_webpack_exports__, {
/* harmony export */   LinePropertyGridComponent: () => (/* binding */ LinePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3181123__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3181123__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3181123__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3181123__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3181123__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3181123__(/*! ../../../lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");






class LinePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    onDashChange(value) {
        const line = this.props.line;
        const split = value.split(",");
        line.dash = [];
        split.forEach((v) => {
            const int = parseInt(v);
            if (isNaN(int)) {
                return;
            }
            line.dash.push(int);
        });
    }
    render() {
        const line = this.props.line;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: line, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "LINE", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Line width", target: line, propertyName: "lineWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "X1", target: line, propertyName: "x1", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Y1", target: line, propertyName: "y1", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "X2", target: line, propertyName: "x2", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Y2", target: line, propertyName: "y2", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Dash pattern", target: line, value: line.dash.join(","), onChange: (newValue) => this.onDashChange(newValue) })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js":
/*!*******************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js ***!
  \*******************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3186090__) => {

"use strict";
__nested_webpack_require_3186090__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3186090__.d(__nested_webpack_exports__, {
/* harmony export */   RadioButtonPropertyGridComponent: () => (/* binding */ RadioButtonPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3186090__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3186090__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3186090__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3186090__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3186090__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3186090__(/*! ../../../lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3186090__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_3186090__(/*! ../../../lines/targetsProxy */ "../../../dev/sharedUiComponents/dist/lines/targetsProxy.js");








class RadioButtonPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const radioButtons = this.props.radioButtons;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, controls: radioButtons, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "RADIO BUTTON", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Thickness", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(radioButtons, this.props.onPropertyChangedObservable), propertyName: "thickness", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Check size ratio", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(radioButtons, this.props.onPropertyChangedObservable), propertyName: "checkSizeRatio", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Group", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(radioButtons, this.props.onPropertyChangedObservable), propertyName: "group", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__.CheckBoxLineComponent, { label: "Checked", target: (0,_lines_targetsProxy__WEBPACK_IMPORTED_MODULE_7__.makeTargetsProxy)(radioButtons, this.props.onPropertyChangedObservable), propertyName: "isChecked", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js":
/*!*****************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js ***!
  \*****************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3191089__) => {

"use strict";
__nested_webpack_require_3191089__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3191089__.d(__nested_webpack_exports__, {
/* harmony export */   RectanglePropertyGridComponent: () => (/* binding */ RectanglePropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3191089__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3191089__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3191089__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3191089__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3191089__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3191089__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");






class RectanglePropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const rectangle = this.props.rectangle;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: rectangle, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "RECTANGLE", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Clip children", target: rectangle, propertyName: "clipChildren", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Thickness", target: rectangle, propertyName: "thickness", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Corner radius", target: rectangle, propertyName: "cornerRadius", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js":
/*!********************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js ***!
  \********************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3194904__) => {

"use strict";
__nested_webpack_require_3194904__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3194904__.d(__nested_webpack_exports__, {
/* harmony export */   ScrollViewerPropertyGridComponent: () => (/* binding */ ScrollViewerPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3194904__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3194904__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3194904__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3194904__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3194904__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3194904__(/*! ../../../lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");






class ScrollViewerPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const scrollViewer = this.props.scrollViewer;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: scrollViewer, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "RECTANGLE", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Thickness", target: scrollViewer, propertyName: "thickness", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Corner radius", target: scrollViewer, propertyName: "cornerRadius", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SCROLLVIEWER", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Bar size", target: scrollViewer, propertyName: "barSize", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Bar color", target: scrollViewer, propertyName: "barColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Bar background", target: scrollViewer, propertyName: "barBackground", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Wheel precision", target: scrollViewer, propertyName: "wheelPrecision", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/sliderPropertyGridComponent.js":
/*!**************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/sliderPropertyGridComponent.js ***!
  \**************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3199882__) => {

"use strict";
__nested_webpack_require_3199882__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3199882__.d(__nested_webpack_exports__, {
/* harmony export */   SliderPropertyGridComponent: () => (/* binding */ SliderPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3199882__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3199882__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3199882__(/*! ./commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3199882__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3199882__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3199882__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3199882__(/*! ../../../lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");







class SliderPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const slider = this.props.slider;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: slider, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "SLIDER", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Border color", target: slider, propertyName: "borderColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Display thumb", target: slider, propertyName: "displayThumb", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Thumb circle", target: slider, propertyName: "isThumbCircle", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Vertical", target: slider, propertyName: "isVertical", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__.CheckBoxLineComponent, { label: "Thumb clamped", target: slider, propertyName: "isThumbClamped", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Bar offset", target: slider, propertyName: "barOffset", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_6__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Thumb width", target: slider, propertyName: "thumbWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Minimum", target: slider, propertyName: "minimum", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Maximum", target: slider, propertyName: "maximum", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_4__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Value", target: slider, propertyName: "value", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js":
/*!******************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js ***!
  \******************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3205861__) => {

"use strict";
__nested_webpack_require_3205861__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3205861__.d(__nested_webpack_exports__, {
/* harmony export */   StackPanelPropertyGridComponent: () => (/* binding */ StackPanelPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3205861__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3205861__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3205861__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3205861__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3205861__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");





class StackPanelPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const stackPanel = this.props.stackPanel;
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: stackPanel, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__.LineContainerComponent, { title: "STACKPANEL", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { label: "Clip children", target: stackPanel, propertyName: "clipChildren", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__.CheckBoxLineComponent, { label: "Vertical", target: stackPanel, propertyName: "isVertical", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js":
/*!*****************************************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js ***!
  \*****************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3209119__) => {

"use strict";
__nested_webpack_require_3209119__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3209119__.d(__nested_webpack_exports__, {
/* harmony export */   TextBlockPropertyGridComponent: () => (/* binding */ TextBlockPropertyGridComponent)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3209119__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3209119__(/*! react */ "../../../../node_modules/react/index.js");
/* harmony import */ var _tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3209119__(/*! ../../../tabs/propertyGrids/gui/commonControlPropertyGridComponent */ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3209119__(/*! gui/2D/controls/control */ "gui/2D/adtInstrumentation");
/* harmony import */ var gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3209119__.n(gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3209119__(/*! ../../../lines/lineContainerComponent */ "../../../dev/sharedUiComponents/dist/lines/lineContainerComponent.js");
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3209119__(/*! ../../../lines/textInputLineComponent */ "../../../dev/sharedUiComponents/dist/lines/textInputLineComponent.js");
/* harmony import */ var _lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3209119__(/*! ../../../lines/optionsLineComponent */ "../../../dev/sharedUiComponents/dist/lines/optionsLineComponent.js");
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_3209119__(/*! ../../../lines/checkBoxLineComponent */ "../../../dev/sharedUiComponents/dist/lines/checkBoxLineComponent.js");
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_3209119__(/*! ../../../lines/floatLineComponent */ "../../../dev/sharedUiComponents/dist/lines/floatLineComponent.js");









class TextBlockPropertyGridComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
    constructor(props) {
        super(props);
    }
    render() {
        const textBlock = this.props.textBlock;
        const horizontalOptions = [
            { label: "Left", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT },
            { label: "Right", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_RIGHT },
            { label: "Center", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_CENTER },
        ];
        const verticalOptions = [
            { label: "Top", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP },
            { label: "Bottom", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_BOTTOM },
            { label: "Center", value: gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_CENTER },
        ];
        const wrappingOptions = [
            { label: "Clip", value: 0 /* TextWrapping.Clip */ },
            { label: "Ellipsis", value: 2 /* TextWrapping.Ellipsis */ },
            { label: "Word wrap", value: 1 /* TextWrapping.WordWrap */ },
            { label: "Word wrap ellipsis", value: 3 /* TextWrapping.WordWrapEllipsis */ },
        ];
        return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabs_propertyGrids_gui_commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__.CommonControlPropertyGridComponent, { lockObject: this.props.lockObject, control: textBlock, onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "TEXTBLOCK", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Text", target: textBlock, propertyName: "text", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__.OptionsLine, { label: "Horizontal text alignment", options: horizontalOptions, target: textBlock, propertyName: "textHorizontalAlignment", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__.OptionsLine, { label: "Vertical text alignment", options: verticalOptions, target: textBlock, propertyName: "textVerticalAlignment", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_7__.CheckBoxLineComponent, { label: "Resize to fit", target: textBlock, propertyName: "resizeToFit", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_6__.OptionsLine, { label: "Wrapping", options: wrappingOptions, target: textBlock, propertyName: "textWrapping", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Line spacing", target: textBlock, propertyName: "lineSpacing", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_lines_lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__.LineContainerComponent, { title: "OUTLINE", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_8__.FloatLineComponent, { lockObject: this.props.lockObject, label: "Outline width", target: textBlock, propertyName: "outlineWidth", onPropertyChangedObservable: this.props.onPropertyChangedObservable }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__.TextInputLineComponent, { lockObject: this.props.lockObject, label: "Outline color", target: textBlock, propertyName: "outlineColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable })] })] }));
    }
}


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js":
/*!*****************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/tabs/propertyGrids/lockObject.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3216554__) => {

"use strict";
__nested_webpack_require_3216554__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3216554__.d(__nested_webpack_exports__, {
/* harmony export */   LockObject: () => (/* binding */ LockObject)
/* harmony export */ });
/**
 * Class used to provide lock mechanism
 */
class LockObject {
    constructor() {
        /**
         * Gets or set if the lock is engaged
         */
        this.lock = false;
    }
}


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/actionTabs.scss":
/*!*************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/actionTabs.scss ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3217368__) => {

"use strict";
__nested_webpack_require_3217368__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3217368__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3217368__(/*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3217368__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3217368__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3217368__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3217368__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3217368__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3217368__(/*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3217368__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3217368__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3217368__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3217368__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3217368__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_actionTabs_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3217368__(/*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./actionTabs.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/actionTabs.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_actionTabs_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_actionTabs_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_actionTabs_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_actionTabs_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/scss/performanceViewer.scss":
/*!************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/scss/performanceViewer.scss ***!
  \************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3223839__) => {

"use strict";
__nested_webpack_require_3223839__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3223839__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3223839__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3223839__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3223839__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3223839__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3223839__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3223839__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3223839__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3223839__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3223839__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3223839__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3223839__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3223839__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_performanceViewer_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3223839__(/*! !!../../../../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./performanceViewer.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/performanceViewer/scss/performanceViewer.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_performanceViewer_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_performanceViewer_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_performanceViewer_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_performanceViewer_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/bottomBar.scss":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/bottomBar.scss ***!
  \***********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3230503__) => {

"use strict";
__nested_webpack_require_3230503__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3230503__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3230503__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3230503__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3230503__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3230503__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3230503__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3230503__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3230503__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3230503__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3230503__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3230503__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3230503__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3230503__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_bottomBar_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3230503__(/*! !!../../../../../../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./bottomBar.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/bottomBar.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_bottomBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_bottomBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_bottomBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_bottomBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/canvas.scss":
/*!********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/canvas.scss ***!
  \********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3237166__) => {

"use strict";
__nested_webpack_require_3237166__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3237166__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3237166__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3237166__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3237166__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3237166__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3237166__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3237166__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3237166__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3237166__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3237166__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3237166__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3237166__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3237166__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_canvas_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3237166__(/*! !!../../../../../../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./canvas.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/canvas.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_canvas_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_canvas_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_canvas_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_canvas_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/curveEditor.scss":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/curveEditor.scss ***!
  \*************************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3243828__) => {

"use strict";
__nested_webpack_require_3243828__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3243828__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3243828__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3243828__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3243828__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3243828__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3243828__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3243828__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3243828__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3243828__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3243828__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3243828__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3243828__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3243828__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_curveEditor_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3243828__(/*! !!../../../../../../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./curveEditor.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/curveEditor.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_curveEditor_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_curveEditor_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_curveEditor_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_curveEditor_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/sideBar.scss":
/*!*********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/sideBar.scss ***!
  \*********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3250509__) => {

"use strict";
__nested_webpack_require_3250509__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3250509__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3250509__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3250509__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3250509__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3250509__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3250509__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3250509__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3250509__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3250509__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3250509__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3250509__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3250509__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3250509__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sideBar_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3250509__(/*! !!../../../../../../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./sideBar.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/sideBar.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sideBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sideBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sideBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sideBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/topBar.scss":
/*!********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/topBar.scss ***!
  \********************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3257158__) => {

"use strict";
__nested_webpack_require_3257158__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3257158__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3257158__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3257158__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3257158__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3257158__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3257158__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3257158__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3257158__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3257158__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3257158__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3257158__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3257158__(/*! !../../../../../../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3257158__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_topBar_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3257158__(/*! !!../../../../../../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./topBar.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/scss/topBar.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_topBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_topBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_topBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_topBar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss":
/*!******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss ***!
  \******************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3263792__) => {

"use strict";
__nested_webpack_require_3263792__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3263792__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3263792__(/*! !../../../../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3263792__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3263792__(/*! !../../../../../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3263792__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3263792__(/*! !../../../../../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3263792__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3263792__(/*! !../../../../../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3263792__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3263792__(/*! !../../../../../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3263792__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3263792__(/*! !../../../../../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3263792__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_textureEditor_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3263792__(/*! !!../../../../../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./textureEditor.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_textureEditor_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_textureEditor_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_textureEditor_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_textureEditor_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGrid.scss":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGrid.scss ***!
  \***************************************************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3270430__) => {

"use strict";
__nested_webpack_require_3270430__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3270430__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3270430__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3270430__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3270430__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3270430__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3270430__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3270430__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3270430__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3270430__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3270430__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3270430__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3270430__(/*! !../../../../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3270430__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_metadataPropertyGrid_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3270430__(/*! !!../../../../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./metadataPropertyGrid.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/metadata/metadataPropertyGrid.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_metadataPropertyGrid_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_metadataPropertyGrid_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_metadataPropertyGrid_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_metadataPropertyGrid_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/embedHost/embedHost.scss":
/*!***********************************************************************!*\
  !*** ../../../dev/inspector/dist/components/embedHost/embedHost.scss ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3276923__) => {

"use strict";
__nested_webpack_require_3276923__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3276923__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3276923__(/*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3276923__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3276923__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3276923__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3276923__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3276923__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3276923__(/*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3276923__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3276923__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3276923__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3276923__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3276923__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_embedHost_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3276923__(/*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./embedHost.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/embedHost/embedHost.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_embedHost_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_embedHost_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_embedHost_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_embedHost_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/sceneExplorer/sceneExplorer.scss":
/*!*******************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/sceneExplorer/sceneExplorer.scss ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3283270__) => {

"use strict";
__nested_webpack_require_3283270__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3283270__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3283270__(/*! !../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3283270__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3283270__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3283270__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3283270__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3283270__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3283270__(/*! !../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3283270__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3283270__(/*! !../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3283270__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3283270__(/*! !../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3283270__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3283270__(/*! !!../../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./sceneExplorer.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/inspector/dist/components/sceneExplorer/sceneExplorer.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_sceneExplorer_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_3289625__) => {

"use strict";
__nested_webpack_require_3289625__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3289625__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3289625__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3289625__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3289625__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3289625__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3289625__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "../../../../node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3289625__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3289625__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3289625__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_3289625__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_3289625__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_3289625__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_3289625__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_3289625__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./colorPicker.scss */ "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_3_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_3_use_2_colorPicker_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/lines/delete.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/lines/delete.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1OS4xICg4NjE0NCkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfZGVsZXRlXzI0X3JlZ3VsYXI8L3RpdGxlPg0KICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4NCiAgPGcgaWQ9IvCflI0tUHJvZHVjdC1JY29ucyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgPGcgaWQ9ImljX2ZsdWVudF9kZWxldGVfMjRfcmVndWxhciIgZmlsbD0id2hpdGUiIGZpbGwtcnVsZT0ibm9uemVybyI+DQogICAgICA8cGF0aCBkPSJNMTIsMS43NSBDMTMuNzMzMDMxNSwxLjc1IDE1LjE0OTI0NTksMy4xMDY0NTQ3NyAxNS4yNDQ4NTUyLDQuODE1NTc2MDkgTDE1LjI1LDUgTDIwLjUsNSBDMjAuOTE0MjEzNiw1IDIxLjI1LDUuMzM1Nzg2NDQgMjEuMjUsNS43NSBDMjEuMjUsNi4xMjk2OTU3NyAyMC45Njc4NDYxLDYuNDQzNDkwOTYgMjAuNjAxNzcwNiw2LjQ5MzE1MzM4IEwyMC41LDYuNSBMMTkuNzA0LDYuNSBMMTguNDIzODYyNywxOS41MTkxOTI3IEMxOC4yOTExNjY2LDIwLjg2ODI2OTYgMTcuMTk4NDMwOSwyMS45MDk5OTYxIDE1Ljg2MjYyNDksMjEuOTk0NDY0NSBMMTUuNjg3MDY5OCwyMiBMOC4zMTI5MzAyMiwyMiBDNi45NTczNDMwMiwyMiA1LjgxMzY1MzUyLDIxLjAxNDQ4NTEgNS41OTg4MzEwNiwxOS42OTMzNjI5IEw1LjU3NjEzNzM0LDE5LjUxOTE5MjcgTDQuMjk1LDYuNSBMMy41LDYuNSBDMy4xMjAzMDQyMyw2LjUgMi44MDY1MDkwNCw2LjIxNzg0NjEyIDIuNzU2ODQ2NjIsNS44NTE3NzA1NiBMMi43NSw1Ljc1IEMyLjc1LDUuMzcwMzA0MjMgMy4wMzIxNTM4OCw1LjA1NjUwOTA0IDMuMzk4MjI5NDQsNS4wMDY4NDY2MiBMMy41LDUgTDguNzUsNSBDOC43NSwzLjIwNTA3NDU2IDEwLjIwNTA3NDYsMS43NSAxMiwxLjc1IFogTTE4LjE5Nyw2LjUgTDUuODAyLDYuNSBMNy4wNjg5MzM0NiwxOS4zNzIzNjAzIEM3LjEyNzY3NjM5LDE5Ljk2OTU4MDEgNy42MDAzMzAxOSwyMC40MzQyODkxIDguMTg1ODQ1MDEsMjAuNDkzNTk2IEw4LjMxMjkzMDIyLDIwLjUgTDE1LjY4NzA2OTgsMjAuNSBDMTYuMjg3MTcxNiwyMC41IDE2Ljc5NTkxNiwyMC4wNzUxMDU3IDE2LjkxMjI1MzEsMTkuNDk4MjA4MyBMMTYuOTMxMDY2NSwxOS4zNzIzNjAzIEwxOC4xOTcsNi41IFogTTEzLjc1LDkuMjUgQzE0LjEyOTY5NTgsOS4yNSAxNC40NDM0OTEsOS41MzIxNTM4OCAxNC40OTMxNTM0LDkuODk4MjI5NDQgTDE0LjUsMTAgTDE0LjUsMTcgQzE0LjUsMTcuNDE0MjEzNiAxNC4xNjQyMTM2LDE3Ljc1IDEzLjc1LDE3Ljc1IEMxMy4zNzAzMDQyLDE3Ljc1IDEzLjA1NjUwOSwxNy40Njc4NDYxIDEzLjAwNjg0NjYsMTcuMTAxNzcwNiBMMTMsMTcgTDEzLDEwIEMxMyw5LjU4NTc4NjQ0IDEzLjMzNTc4NjQsOS4yNSAxMy43NSw5LjI1IFogTTEwLjI1LDkuMjUgQzEwLjYyOTY5NTgsOS4yNSAxMC45NDM0OTEsOS41MzIxNTM4OCAxMC45OTMxNTM0LDkuODk4MjI5NDQgTDExLDEwIEwxMSwxNyBDMTEsMTcuNDE0MjEzNiAxMC42NjQyMTM2LDE3Ljc1IDEwLjI1LDE3Ljc1IEM5Ljg3MDMwNDIzLDE3Ljc1IDkuNTU2NTA5MDQsMTcuNDY3ODQ2MSA5LjUwNjg0NjYyLDE3LjEwMTc3MDYgTDkuNSwxNyBMOS41LDEwIEM5LjUsOS41ODU3ODY0NCA5LjgzNTc4NjQ0LDkuMjUgMTAuMjUsOS4yNSBaIE0xMiwzLjI1IEMxMS4wODE4MjY2LDMuMjUgMTAuMzI4ODA3NywzLjk1NzExMDI3IDEwLjI1NTgwMTIsNC44NTY0NzI3OSBMMTAuMjUsNSBMMTMuNzUsNSBDMTMuNzUsNC4wMzM1MDE2OSAxMi45NjY0OTgzLDMuMjUgMTIsMy4yNSBaIiBpZD0i8J+OqC1Db2xvciI+PC9wYXRoPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/addAnimationIcon.svg":
/*!*******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/addAnimationIcon.svg ***!
  \*******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cmVjdCB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTUsOC4yN2EuNTguNTgsMCwwLDEsLjU3LjV2NS42NWg1LjU3YS41OC41OCwwLDAsMSwuMDgsMS4xNUgxNS41OHY1LjU3YS41OC41OCwwLDAsMS0xLjE1LjA4VjE1LjU4SDguODVhLjU4LjU4LDAsMCwxLS4wOC0xLjE1aDUuNjVWOC44NUEuNTguNTgsMCwwLDEsMTUsOC4yN1oiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationBulletIcon.svg":
/*!**********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationBulletIcon.svg ***!
  \**********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIj48Y2lyY2xlIGN4PSI1IiBjeT0iNSIgcj0iMi44OSIgc3R5bGU9ImZpbGw6Izg4OCIvPjxyZWN0IHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgc3R5bGU9ImZpbGw6bm9uZSIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationEndHoverIcon.svg":
/*!************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationEndHoverIcon.svg ***!
  \************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTEuNjcsMTYuMzEsMTksMjJhLjYxLjYxLDAsMCwxLC4xNS44NUEuNTQuNTQsMCwwLDEsMTksMjNsLTcuMzUsNS43MWEuNjEuNjEsMCwwLDEtLjg2LS4wOC42My42MywwLDAsMS0uMTQtLjRWMjQuMDdMNC43NCwyOC42OWEuNjEuNjEsMCwwLDEtLjg2LS4wOC42My42MywwLDAsMS0uMTQtLjRWMTYuNzlhLjYxLjYxLDAsMCwxLC42LS42Mi42My42MywwLDAsMSwuNC4xNGw1Ljk0LDQuNjJWMTYuNzlhLjYxLjYxLDAsMCwxLC42MS0uNjFBLjU4LjU4LDAsMCwxLDExLjY3LDE2LjMxWiIgc3R5bGU9ImZpbGw6I2NjYyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationEndIcon.svg":
/*!*******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationEndIcon.svg ***!
  \*******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTEuNjcsMTYuMzEsMTksMjJhLjYxLjYxLDAsMCwxLC4xNS44NUEuNTQuNTQsMCwwLDEsMTksMjNsLTcuMzUsNS43MWEuNjEuNjEsMCwwLDEtLjg2LS4wOC42My42MywwLDAsMS0uMTQtLjRWMjQuMDdMNC43NCwyOC42OWEuNjEuNjEsMCwwLDEtLjg2LS4wOC42My42MywwLDAsMS0uMTQtLjRWMTYuNzlhLjYxLjYxLDAsMCwxLC42LS42Mi42My42MywwLDAsMSwuNC4xNGw1Ljk0LDQuNjJWMTYuNzlhLjYxLjYxLDAsMCwxLC42MS0uNjFBLjU4LjU4LDAsMCwxLDExLjY3LDE2LjMxWk0xMS45MSwxOHY5bDUuNzMtNC40NlpNNSwxOHY5bDUuNzEtNC40NGgwWiIgc3R5bGU9ImZpbGw6Izg4OCIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastFrameHoverIcon.svg":
/*!******************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastFrameHoverIcon.svg ***!
  \******************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTguNzgsMjguM2ExLjQzLDEuNDMsMCwwLDEtMS40MywxLjQxLDEuNCwxLjQsMCwwLDEtLjc1LS4yMkw4LjEzLDI0LjA2YTEuNDIsMS40MiwwLDAsMS0uNDItMiwxLjQ1LDEuNDUsMCwwLDEsLjM2LS4zOGw4LjQ3LTYuMDdhMS40MiwxLjQyLDAsMCwxLDIsLjM0LDEuMzksMS4zOSwwLDAsMSwuMjYuODFaIiBzdHlsZT0iZmlsbDojY2NjIi8+PHBhdGggZD0iTTQuMjIsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojY2NjIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastFrameIcon.svg":
/*!*************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastFrameIcon.svg ***!
  \*************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cGF0aCBkPSJNOC4wNywyMS43MmExLjQyLDEuNDIsMCwwLDAtLjMyLDIsMS40NCwxLjQ0LDAsMCwwLC4zOC4zNmw4LjQ3LDUuNDNhMS40MiwxLjQyLDAsMCwwLDItLjQ0LDEuNCwxLjQsMCwwLDAsLjIyLS43NVYxNi44YTEuNDMsMS40MywwLDAsMC0xLjQzLTEuNDEsMS4zOSwxLjM5LDAsMCwwLS44MS4yNlptOS40OSw2LjU4YS4yLjIsMCwwLDEtLjMxLjE3TDguNzksMjNhLjIyLjIyLDAsMCwxLDAtLjI5bDAtLjA1LDguNDYtNi4wN2EuMi4yLDAsMCwxLC4yOCwwLC4yLjIsMCwwLDEsMCwuMTNabS0xMy4zNC44N2EuNjEuNjEsMCwwLDAsMS4yMiwwVjE1LjgzYS42MS42MSwwLDAsMC0xLjIyLDBoMFoiIHN0eWxlPSJmaWxsOiM4ODgiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastKeyHoverIcon.svg":
/*!****************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastKeyHoverIcon.svg ***!
  \****************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTguNzgsMjguM2ExLjQzLDEuNDMsMCwwLDEtMS40MywxLjQxLDEuNCwxLjQsMCwwLDEtLjc1LS4yMkw4LjEzLDI0LjA2YTEuNDIsMS40MiwwLDAsMS0uNDItMiwxLjQ1LDEuNDUsMCwwLDEsLjM2LS4zOGw4LjQ3LTYuMDdhMS40MiwxLjQyLDAsMCwxLDIsLjM0LDEuMzksMS4zOSwwLDAsMSwuMjYuODFaIiBzdHlsZT0iZmlsbDojY2NjIi8+PHBhdGggZD0iTTQuMjIsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojZmZjMDE3Ii8+PHBhdGggZD0iTTMuNDgsMjUuOTFhMS4zNSwxLjM1LDAsMSwwLDIuNywwVjE5LjA5YTEuMzUsMS4zNSwwLDEsMC0yLjcsMGgwWiIgc3R5bGU9ImZpbGw6I2ZmYzAxNyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastKeyIcon.svg":
/*!***********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationLastKeyIcon.svg ***!
  \***********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNOC4wNywyMS43MmExLjQyLDEuNDIsMCwwLDAtLjMyLDIsMS40NCwxLjQ0LDAsMCwwLC4zOC4zNmw4LjQ3LDUuNDNhMS40MiwxLjQyLDAsMCwwLDItLjQ0LDEuNCwxLjQsMCwwLDAsLjIyLS43NVYxNi44YTEuNDMsMS40MywwLDAsMC0xLjQzLTEuNDEsMS4zOSwxLjM5LDAsMCwwLS44MS4yNlptOS40OSw2LjU4YS4yLjIsMCwwLDEtLjMxLjE3TDguNzksMjNhLjIyLjIyLDAsMCwxLDAtLjI5bDAtLjA1LDguNDYtNi4wN2EuMi4yLDAsMCwxLC4yOCwwLC4yLjIsMCwwLDEsMCwuMTNaIiBzdHlsZT0iZmlsbDojODg4Ii8+PHBhdGggZD0iTTQuMjIsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojZmZjMDE3Ii8+PHBhdGggZD0iTTMuNDgsMjUuOTFhMS4zNSwxLjM1LDAsMSwwLDIuNywwVjE5LjA5YTEuMzUsMS4zNSwwLDEsMC0yLjcsMGgwWiIgc3R5bGU9ImZpbGw6I2ZmYzAxNyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextFrameHoverIcon.svg":
/*!******************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextFrameHoverIcon.svg ***!
  \******************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNC4yMiwxNi44YTEuNDMsMS40MywwLDAsMSwxLjQzLTEuNDEsMS4zOSwxLjM5LDAsMCwxLC44MS4yNmw4LjQ3LDYuMDdhMS40MiwxLjQyLDAsMCwxLC4zMiwyLDEuNDQsMS40NCwwLDAsMS0uMzguMzZMNi40LDI5LjQ5YTEuNDIsMS40MiwwLDAsMS0yLS40NCwxLjQsMS40LDAsMCwxLS4yMi0uNzVaIiBzdHlsZT0iZmlsbDojY2NjIi8+PHBhdGggZD0iTTE4Ljc4LDE1LjgzYS42MS42MSwwLDAsMC0xLjIyLDBWMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFoiIHN0eWxlPSJmaWxsOiNjY2MiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextFrameIcon.svg":
/*!*************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextFrameIcon.svg ***!
  \*************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNi40NiwxNS42NWExLjQyLDEuNDIsMCwwLDAtMiwuMzQsMS4zOSwxLjM5LDAsMCwwLS4yNi44MVYyOC4zYTEuNDMsMS40MywwLDAsMCwxLjQzLDEuNDEsMS40LDEuNCwwLDAsMCwuNzUtLjIybDguNDctNS40M2ExLjQyLDEuNDIsMCwwLDAsLjQyLTIsMS40NSwxLjQ1LDAsMCwwLS4zNi0uMzhabS0xLDEuMTVhLjIuMiwwLDAsMSwuMzItLjE3bDguNDYsNi4wN2EuMjIuMjIsMCwwLDEsMCwuMjlzMCwwLDAsLjA1TDUuNzUsMjguNDdhLjIuMiwwLDAsMS0uMjgtLjA2LjIuMiwwLDAsMSwwLS4xMVoiIHN0eWxlPSJmaWxsOiM4ODgiLz48cGF0aCBkPSJNMTcuNTYsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojODg4Ii8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextKeyHoverIcon.svg":
/*!****************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextKeyHoverIcon.svg ***!
  \****************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNC4yMiwxNi44YTEuNDMsMS40MywwLDAsMSwxLjQzLTEuNDEsMS4zOSwxLjM5LDAsMCwxLC44MS4yNmw4LjQ3LDYuMDdhMS40MiwxLjQyLDAsMCwxLC4zMiwyLDEuNDQsMS40NCwwLDAsMS0uMzguMzZMNi40LDI5LjQ5YTEuNDIsMS40MiwwLDAsMS0yLS40NCwxLjQsMS40LDAsMCwxLS4yMi0uNzVaIiBzdHlsZT0iZmlsbDojY2NjIi8+PHBhdGggZD0iTTE3LjU2LDI5LjE3YS42MS42MSwwLDAsMCwxLjIyLDBWMTUuODNhLjYxLjYxLDAsMCwwLTEuMjIsMGgwWiIgc3R5bGU9ImZpbGw6I2ZmYzAxNyIvPjxwYXRoIGQ9Ik0xNi44MiwyNS45MWExLjM1LDEuMzUsMCwwLDAsMi43LDBWMTkuMDlhMS4zNSwxLjM1LDAsMSwwLTIuNywwaDBaIiBzdHlsZT0iZmlsbDojZmZjMDE3Ii8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextKeyIcon.svg":
/*!***********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationNextKeyIcon.svg ***!
  \***********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNi40NiwxNS42NWExLjQyLDEuNDIsMCwwLDAtMiwuMzQsMS4zOSwxLjM5LDAsMCwwLS4yNi44MVYyOC4zYTEuNDMsMS40MywwLDAsMCwxLjQzLDEuNDEsMS40LDEuNCwwLDAsMCwuNzUtLjIybDguNDctNS40M2ExLjQyLDEuNDIsMCwwLDAsLjQyLTIsMS40NSwxLjQ1LDAsMCwwLS4zNi0uMzhabS0xLDEuMTVhLjIuMiwwLDAsMSwuMzItLjE3bDguNDYsNi4wN2EuMjIuMjIsMCwwLDEsMCwuMjlzMCwwLDAsLjA1TDUuNzUsMjguNDdhLjIuMiwwLDAsMS0uMjgtLjA2LjIuMiwwLDAsMSwwLS4xMVoiIHN0eWxlPSJmaWxsOiM4ODgiLz48cGF0aCBkPSJNMTcuNTYsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojZmZjMDE3Ii8+PHBhdGggZD0iTTE2LjgyLDI1LjkxYTEuMzUsMS4zNSwwLDAsMCwyLjcsMFYxOS4wOWExLjM1LDEuMzUsMCwxLDAtMi43LDBoMFoiIHN0eWxlPSJmaWxsOiNmZmMwMTciLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationOptionsIcon.svg":
/*!***********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationOptionsIcon.svg ***!
  \***********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj48cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTAsNC4xYTYuNjIsNi42MiwwLDAsMSwxLjMzLjE2bC4zNC4zOS4xLjkyYS44NS44NSwwLDAsMCwuODMuNzUsMS4wOSwxLjA5LDAsMCwwLC40LS4wN2wuODUtLjM4LjUuMUE2LDYsMCwwLDEsMTUuNyw4LjI4bC0uMTcuNDktLjc1LjU2YS44My44MywwLDAsMC0uMTgsMS4xNi43Ny43NywwLDAsMCwuMTguMThsLjc1LjU2LjE3LjQ5QTYsNiwwLDAsMSwxNC4zLDE0bC0uNS4xLS44LS4zNWEuODUuODUsMCwwLDAtLjc2LjA1LjgzLjgzLDAsMCwwLS40MS42M2wtLjEuOTItLjM0LjM5YTUuODIsNS44MiwwLDAsMS0yLjY5LDBsLS4zMy0uMzktLjEtLjkyYS44My44MywwLDAsMC0uNDEtLjYzLjg1Ljg1LDAsMCwwLS43NiwwbC0uODUuMzdMNS43LDE0YTYsNiwwLDAsMS0xLjM1LTIuMzFsLjE3LS40OS43NS0uNTZhLjgzLjgzLDAsMCwwLC4xOC0xLjE2Ljc3Ljc3LDAsMCwwLS4xOC0uMThsLS43NS0uNTYtLjE3LS40OEE2LjA2LDYuMDYsMCwwLDEsNS43LDZsLjUtLjEuODUuMzhhLjg1Ljg1LDAsMCwwLC43NiwwLC44My44MywwLDAsMCwuNDEtLjYzbC4xLS45Mi4zNC0uMzlBNi4xOCw2LjE4LDAsMCwxLDEwLDQuMVpNMTAsNWE1LjY3LDUuNjcsMCwwLDAtLjgyLjA3bC0uMDcuNTlBMS43MywxLjczLDAsMCwxLDcuMiw3LjIxYTEuNTMsMS41MywwLDAsMS0uNTEtLjEzbC0uNTUtLjI0YTUsNSwwLDAsMC0uODEsMS40bC40OC4zNkExLjc0LDEuNzQsMCwwLDEsNi4xOCwxMWExLjg1LDEuODUsMCwwLDEtLjM3LjM3bC0uNDguMzZhNS4wNyw1LjA3LDAsMCwwLC44MSwxLjQxbC41NS0uMjRBMS43NCwxLjc0LDAsMCwxLDksMTMuOGEyLDIsMCwwLDEsLjE0LjUzbC4wNy41OWE0Ljg5LDQuODksMCwwLDAsMS42MiwwbC4wNy0uNTlhMS43NCwxLjc0LDAsMCwxLDEuOTEtMS41NSwxLjgyLDEuODIsMCwwLDEsLjUyLjE0bC41NS4yNGE1LDUsMCwwLDAsLjgxLTEuNGwtLjQ4LS4zNkExLjc0LDEuNzQsMCwwLDEsMTMuODIsOWExLjg1LDEuODUsMCwwLDEsLjM3LS4zN2wuNDgtLjM2YTUsNSwwLDAsMC0uODEtMS40bC0uNTUuMjRhMS44NiwxLjg2LDAsMCwxLS43LjE0LDEuNzQsMS43NCwwLDAsMS0xLjczLTEuNTVsLS4wNy0uNTlBNC40NSw0LjQ1LDAsMCwwLDEwLDVabTAsMi43MkEyLjI3LDIuMjcsMCwxLDEsNy43MywxMCwyLjI3LDIuMjcsMCwwLDEsMTAsNy43MmgwWm0wLC45MUExLjM2LDEuMzYsMCwxLDAsMTEuMzYsMTAsMS4zNiwxLjM2LDAsMCwwLDEwLDguNjNaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayFwdHoverIcon.svg":
/*!****************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayFwdHoverIcon.svg ***!
  \****************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNC43NywxNy4xM2ExLjc5LDEuNzksMCwwLDEsMS44MS0xLjc5LDEuNzcsMS43NywwLDAsMSwuODQuMjFsOS44Nyw1LjM3QTEuODEsMS44MSwwLDAsMSwxOCwyMy4zNmExLjg1LDEuODUsMCwwLDEtLjcyLjcyTDcuNDIsMjkuNDVBMS44LDEuOCwwLDAsMSw1LDI4LjcxYTEuNzcsMS43NywwLDAsMS0uMjEtLjg0WiIgc3R5bGU9ImZpbGw6I2NjYyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayFwdIcon.svg":
/*!***********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayFwdIcon.svg ***!
  \***********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNi44NSwxNi42MWEuNTkuNTksMCwwLDAtLjguMjIuNjQuNjQsMCwwLDAtLjA4LjNWMjcuODdhLjYuNiwwLDAsMCwuNTguNi42MS42MSwwLDAsMCwuMy0uMDhMMTYuNzIsMjNhLjYuNiwwLDAsMCwwLTEuMDZabS0yLjA4LjUyYTEuNzksMS43OSwwLDAsMSwxLjgxLTEuNzksMS43NywxLjc3LDAsMCwxLC44NC4yMWw5Ljg3LDUuMzdBMS44MSwxLjgxLDAsMCwxLDE4LDIzLjM2YTEuODUsMS44NSwwLDAsMS0uNzIuNzJMNy40MiwyOS40NUExLjgsMS44LDAsMCwxLDUsMjguNzFhMS43NywxLjc3LDAsMCwxLS4yMS0uODRaIiBzdHlsZT0iZmlsbDojODg4Ii8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayRevHoverIcon.svg":
/*!****************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayRevHoverIcon.svg ***!
  \****************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTguMjMsMjcuODdhMS43OSwxLjc5LDAsMCwxLTEuODEsMS43OSwxLjc3LDEuNzcsMCwwLDEtLjg0LS4yMUw1LjcxLDI0LjA4QTEuODEsMS44MSwwLDAsMSw1LDIxLjY0YTEuODUsMS44NSwwLDAsMSwuNzItLjcybDkuODctNS4zN2ExLjgsMS44LDAsMCwxLDIuNDQuNzQsMS43NywxLjc3LDAsMCwxLC4yMS44NFoiIHN0eWxlPSJmaWxsOiNjY2MiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayRevIcon.svg":
/*!***********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationPlayRevIcon.svg ***!
  \***********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNi4yOCwyMmEuNi42LDAsMCwwLDAsMS4wNmw5Ljg3LDUuMzZhLjU5LjU5LDAsMCwwLC44LS4yMi42NC42NCwwLDAsMCwuMDgtLjNWMTcuMTNhLjYuNiwwLDAsMC0uNTgtLjYuNjEuNjEsMCwwLDAtLjMuMDhabTEyLDUuOWExLjc5LDEuNzksMCwwLDEtMS44MSwxLjc5LDEuNzcsMS43NywwLDAsMS0uODQtLjIxbC05LjkyLTUuNEExLjgxLDEuODEsMCwwLDEsNSwyMS42NGExLjg1LDEuODUsMCwwLDEsLjcyLS43Mmw5Ljg3LTUuMzdhMS44LDEuOCwwLDAsMSwyLjQ0Ljc0LDEuNzcsMS43NywwLDAsMSwuMjEuODRaIiBzdHlsZT0iZmlsbDojODg4Ii8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStartHoverIcon.svg":
/*!**************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStartHoverIcon.svg ***!
  \**************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTEuMzMsMTYuMzEsNCwyMmEuNjEuNjEsMCwwLDAtLjE1Ljg1QS41NC41NCwwLDAsMCw0LDIzbDcuMzUsNS43MWEuNjEuNjEsMCwwLDAsLjg2LS4wOC42My42MywwLDAsMCwuMTQtLjRWMjQuMDdsNS45NCw0LjYyYS42MS42MSwwLDAsMCwuODYtLjA4LjYzLjYzLDAsMCwwLC4xNC0uNFYxNi43OWEuNjEuNjEsMCwwLDAtLjYtLjYyLjYzLjYzLDAsMCwwLS40LjE0bC01Ljk0LDQuNjJWMTYuNzlhLjYxLjYxLDAsMCwwLTEtLjQ4WiIgc3R5bGU9ImZpbGw6I2NjYyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStartIcon.svg":
/*!*********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStartIcon.svg ***!
  \*********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTIuMzIsMTYuNzl2NC4xNGw1Ljk0LTQuNjJhLjYxLjYxLDAsMCwxLC44Ni4wOC42My42MywwLDAsMSwuMTQuNFYyOC4yMWEuNjEuNjEsMCwwLDEtLjYuNjIuNjMuNjMsMCwwLDEtLjQtLjE0bC01Ljk0LTQuNjJ2NC4xNGEuNjEuNjEsMCwwLDEtLjYuNjIuNjMuNjMsMCwwLDEtLjQtLjE0TDQsMjNhLjYxLjYxLDAsMCwxLS4xNS0uODVBLjU0LjU0LDAsMCwxLDQsMjJsNy4zNS01LjcxYS42MS42MSwwLDAsMSwuODUuMTNBLjYzLjYzLDAsMCwxLDEyLjMyLDE2Ljc5Wm0tNyw1LjcxTDExLjA5LDI3VjE4Wm03LDBoMEwxOCwyN1YxOFoiIHN0eWxlPSJmaWxsOiM4ODgiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStopHoverIcon.svg":
/*!*************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStopHoverIcon.svg ***!
  \*************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNS42MywxNS4yMWExLjQ0LDEuNDQsMCwwLDAtMS40MiwxLjQyVjI4LjM3YTEuNDQsMS40NCwwLDAsMCwxLjQyLDEuNDJIMTcuMzdhMS40NCwxLjQ0LDAsMCwwLDEuNDItMS40MlYxNi42M2ExLjQ0LDEuNDQsMCwwLDAtMS40Mi0xLjQyWiIgc3R5bGU9ImZpbGw6I2MxMmQyZCIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStopIcon.svg":
/*!********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationStopIcon.svg ***!
  \********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuMzcsMTYuNDNhLjIuMiwwLDAsMSwuMi4yaDBWMjguMzdhLjIuMiwwLDAsMS0uMi4ySDUuNjNhLjIuMiwwLDAsMS0uMi0uMmgwVjE2LjYzYS4yLjIsMCwwLDEsLjItLjJIMTcuMzdaTTUuNjMsMTUuMjFhMS40NCwxLjQ0LDAsMCwwLTEuNDIsMS40MlYyOC4zN2ExLjQ0LDEuNDQsMCwwLDAsMS40MiwxLjQySDE3LjM3YTEuNDQsMS40NCwwLDAsMCwxLjQyLTEuNDJWMTYuNjNhMS40NCwxLjQ0LDAsMCwwLTEuNDItMS40MloiIHN0eWxlPSJmaWxsOiM4YzJmMmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationTriangleIcon.svg":
/*!************************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/animationTriangleIcon.svg ***!
  \************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIj48cGF0aCBkPSJNNS40Myw3LjMxLDcuODEsMy4xOWEuNTEuNTEsMCwwLDAtLjE1LS42OC41NS41NSwwLDAsMC0uMjgtLjA3SDIuNjJhLjQ4LjQ4LDAsMCwwLS41LjQ3LjQ1LjQ1LDAsMCwwLC4wNy4yOEw0LjU3LDcuMzFhLjQ5LjQ5LDAsMCwwLC42Ni4yQS40OC40OCwwLDAsMCw1LjQzLDcuMzFaIiBzdHlsZT0iZmlsbDojODg4Ii8+PHJlY3Qgd2lkdGg9IjEwIiBoZWlnaHQ9IjEwIiBzdHlsZT0iZmlsbDpub25lIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/babylonLogo.svg":
/*!**************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/babylonLogo.svg ***!
  \**************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cG9seWdvbiBwb2ludHM9IjIyLjE0IDcuNTcgMTEuMzcgMTMuNzggMTEuMzcgMjYuMjIgMjIuMTQgMzIuNDQgMzIuOTEgMjYuMjIgMzIuOTEgMTMuNzggMjIuMTQgNy41NyIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxyZWN0IHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgc3R5bGU9ImZpbGw6bm9uZSIvPjxwb2x5Z29uIHBvaW50cz0iMzIuOTEgMTMuNzggMjkuNTQgMTEuODQgMjYuMjkgMTMuNzEgMjkuNjYgMTUuNjUgMzIuOTEgMTMuNzgiIHN0eWxlPSJmaWxsOiNlMDY4NGIiLz48cG9seWdvbiBwb2ludHM9IjE0LjYxIDE1LjY1IDI1LjM4IDkuNDQgMjIuMTQgNy41NyAxMS4zNyAxMy43OCAxNC42MSAxNS42NSIgc3R5bGU9ImZpbGw6I2UwNjg0YiIvPjxwb2x5Z29uIHBvaW50cz0iMTguNzcgMjEuOTUgMjIuMTQgMjMuODkgMjUuNTEgMjEuOTUgMjIuMTQgMjAgMTguNzcgMjEuOTUiIHN0eWxlPSJmaWxsOiNlMDY4NGIiLz48cG9seWdvbiBwb2ludHM9IjI5LjY2IDE1LjY1IDI5LjY2IDI0LjM0IDIyLjE0IDI4LjY5IDE0LjYxIDI0LjM0IDE0LjYxIDE1LjY1IDExLjM3IDEzLjc4IDExLjM3IDI2LjIyIDIyLjE0IDMyLjQ0IDMyLjkxIDI2LjIyIDMyLjkxIDEzLjc4IDI5LjY2IDE1LjY1IiBzdHlsZT0iZmlsbDojYmI0NjRiIi8+PHBvbHlnb24gcG9pbnRzPSIyMi4xNCAxNi4xMSAxOC43NyAxOC4wNSAxOC43NyAyMS45NSAyMi4xNCAyMCAyNS41MSAyMS45NSAyNS41MSAxOC4wNSAyMi4xNCAxNi4xMSIgc3R5bGU9ImZpbGw6I2JiNDY0YiIvPjxwb2x5Z29uIHBvaW50cz0iMjkuNjYgMTUuNjUgMjUuNTEgMTguMDUgMjUuNTEgMjEuOTUgMjIuMTQgMjMuODkgMjIuMTQgMjguNjkgMjkuNjYgMjQuMzQgMjkuNjYgMTUuNjUiIHN0eWxlPSJmaWxsOiNlMGRlZDgiLz48cG9seWdvbiBwb2ludHM9IjE0LjYxIDE1LjY1IDE4Ljc3IDE4LjA1IDE4Ljc3IDIxLjk1IDIyLjE0IDIzLjg5IDIyLjE0IDI4LjY5IDE0LjYxIDI0LjM0IDE0LjYxIDE1LjY1IiBzdHlsZT0iZmlsbDojZDVkMmNhIi8+PHBvbHlnb24gcG9pbnRzPSIyNS4zOCA5LjQ0IDI5LjU0IDExLjg0IDI2LjI5IDEzLjcxIDI5LjY2IDE1LjY1IDI1LjUxIDE4LjA1IDIyLjE0IDE2LjExIDE4Ljc3IDE4LjA1IDE0LjYxIDE1LjY1IDI1LjM4IDkuNDQiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/breakTangentIcon.svg":
/*!*******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/breakTangentIcon.svg ***!
  \*******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjcuMTEsMTMuMDVhMS40OSwxLjQ5LDAsMCwwLTIuMDUuNTMsMS40NywxLjQ3LDAsMCwwLC4xNCwxLjcybC00Ljc4LDhMMjAsMjIuOTJsLS40Mi40Mi00Ljc4LThhMS40NywxLjQ3LDAsMCwwLC4xNC0xLjcyLDEuNDksMS40OSwwLDAsMC0yLS41MywxLjUsMS41LDAsMCwwLDEsMi43Nmw0LjkxLDguMjYtMSwxTDIwLDI3LjE2LDIyLjEyLDI1bC0xLTEsNC45MS04LjI2YTEuNSwxLjUsMCwwLDAsMS4wNS0yLjc2WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/closeWindowIcon.svg":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/closeWindowIcon.svg ***!
  \******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxnIGlkPSJVSSI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuMTMsMjAsMjgsMjYuODcsMjYuODcsMjgsMjAsMjEuMTMsMTMuMTMsMjgsMTIsMjYuODcsMTguODcsMjAsMTIsMTMuMTMsMTMuMTMsMTIsMjAsMTguODcsMjYuODcsMTIsMjgsMTMuMTNaIi8+PC9nPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/editIcon.svg":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/editIcon.svg ***!
  \***********************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cmVjdCB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjIsOEEyLjc5LDIuNzksMCwwLDEsMjIsMTJoMGwtOS4zMyw5LjMzYTEuNzYsMS43NiwwLDAsMS0uNzguNDVsLTQsMS4wOWEuNTguNTgsMCwwLDEtLjcyLS4zOS42Mi42MiwwLDAsMSwwLS4zM2wxLjA5LTRhMS43NiwxLjc2LDAsMCwxLC40NS0uNzhMMTguMDYsOEEyLjgsMi44LDAsMCwxLDIyLDhabS00LjcsMi40MUw5LjU2LDE4LjE1YS40Ni40NiwwLDAsMC0uMTUuMjZsLS44MiwzLDMtLjgyYS40Ni40NiwwLDAsMCwuMjYtLjE1bDcuNzUtNy43NVptMS41OC0xLjU4LS43NS43NSwyLjI5LDIuMjkuNzUtLjc1YTEuNjIsMS42MiwwLDAsMC0yLjI5LTIuMjlaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/flatTangentIcon.svg":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/flatTangentIcon.svg ***!
  \******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjgsMTguNWExLjUxLDEuNTEsMCwwLDAtMS40MSwxSDExLjV2MUgyNi41OWExLjUsMS41LDAsMSwwLDEuNDEtMloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/frameIcon.svg":
/*!************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/frameIcon.svg ***!
  \************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTQuMDUsMTVhMSwxLDAsMCwxLDEtMWgxLjU5YS42LjYsMCwwLDAsLjU5LS42LjU4LjU4LDAsMCwwLS41OS0uNTlIMTVBMi4xOCwyLjE4LDAsMCwwLDEyLjg2LDE1djEuNTlhLjU4LjU4LDAsMCwwLC41OS41OWgwYS42LjYsMCwwLDAsLjYtLjU5Wm0wLDEwYTEsMSwwLDAsMCwxLDFoMS41OWEuNi42LDAsMCwxLC41OS42LjU4LjU4LDAsMCwxLS41OS41OUgxNUEyLjE4LDIuMTgsMCwwLDEsMTIuODYsMjVWMjMuMzdhLjU4LjU4LDAsMCwxLC41OS0uNTloMGEuNi42LDAsMCwxLC42LjU5Wk0yNSwxNC4wNWExLDEsMCwwLDEsMSwxdjEuNTlhLjYuNiwwLDAsMCwuNi41OS41OC41OCwwLDAsMCwuNTktLjU5aDBWMTVBMi4xOCwyLjE4LDAsMCwwLDI1LDEyLjg2SDIzLjM3YS41OC41OCwwLDAsMC0uNTkuNTloMGEuNi42LDAsMCwwLC41OS42Wm0xLDExYTEsMSwwLDAsMS0xLDFIMjMuMzdhLjYuNiwwLDAsMC0uNTkuNi41OC41OCwwLDAsMCwuNTkuNTlIMjVBMi4xOCwyLjE4LDAsMCwwLDI3LjE0LDI1VjIzLjM3YS41OC41OCwwLDAsMC0uNTktLjU5aDBhLjYuNiwwLDAsMC0uNi41OVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keyActiveIcon.svg":
/*!****************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keyActiveIcon.svg ***!
  \****************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIj48cGF0aCBkPSJNNSwxLjQxYTEsMSwwLDAsMC0uNzEuM0wxLjcxLDQuMjlhMSwxLDAsMCwwLDAsMS40MWgwTDQuMjksOC4yOWExLDEsMCwwLDAsMS40MSwwaDBMOC4yOSw1LjcxYTEsMSwwLDAsMCwwLTEuNDFoMEw1LjcxLDEuNzFBMSwxLDAsMCwwLDUsMS40MVoiIHN0eWxlPSJmaWxsOiNmZmMwMTciLz48cmVjdCB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cG9seWxpbmUgcG9pbnRzPSI1IDIuNDEgNSAyLjQxIDcuNTkgNSA1IDcuNTkgMi40MSA1IDUgMi40MSA1IDIuNDEiIHN0eWxlPSJmaWxsOiMxMTEiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keyInactiveIcon.svg":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keyInactiveIcon.svg ***!
  \******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIj48cmVjdCB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNSwxLjQxYTEsMSwwLDAsMC0uNzEuM0wxLjcxLDQuMjlhMSwxLDAsMCwwLDAsMS40MWgwTDQuMjksOC4yOWExLDEsMCwwLDAsMS40MSwwaDBMOC4yOSw1LjcxYTEsMSwwLDAsMCwwLTEuNDFoMEw1LjcxLDEuNzFBMSwxLDAsMCwwLDUsMS40MVoiIHN0eWxlPSJmaWxsOiNhYWEiLz48cG9seWxpbmUgcG9pbnRzPSI1IDIuNDEgNSAyLjQxIDcuNTkgNSA1IDcuNTkgMi40MSA1IDUgMi40MSA1IDIuNDEiIHN0eWxlPSJmaWxsOiMxMTEiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keySelectedIcon.svg":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/keySelectedIcon.svg ***!
  \******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIj48cmVjdCB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cmVjdCB4PSIyLjE3IiB5PSIyLjE3IiB3aWR0aD0iNS42NiIgaGVpZ2h0PSI1LjY2IiByeD0iMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTIuMDcgNSkgcm90YXRlKC00NSkiIHN0eWxlPSJmaWxsOiNmZmMwMTciLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/linearTangentIcon.svg":
/*!********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/linearTangentIcon.svg ***!
  \********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjYsMTRhMS40OSwxLjQ5LDAsMCwwLTIuNCwxLjY5bC0xMCwxMCwuNzEuNzEsMTAtMTBBMS40OSwxLjQ5LDAsMCwwLDI2LDE0WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/loadIcon.svg":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/loadIcon.svg ***!
  \***********************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cmVjdCB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAuMDYsOC4zOGEuNTkuNTksMCwwLDAsLjY2LS41MS41OS41OSwwLDAsMC0uNTEtLjY2SDkuOTNhLjU5LjU5LDAsMCwwLS41MS42Ni41Ny41NywwLDAsMCwuNTEuNTFaTTE0LjkyLDIyLjc5SDE1YS41OS41OSwwLDAsMCwuNTgtLjVWMTEuNTVsMi45LDIuODlhLjU4LjU4LDAsMCwwLC43Ni4wNmwuMDctLjA2YS41OS41OSwwLDAsMCwuMDUtLjc2bC0uMDUtLjA2LTMuOS0zLjg5YS41OC41OCwwLDAsMC0uNzYtLjA2bC0uMDYuMDUtMy45LDMuOWEuNTguNTgsMCwwLDAsMCwuODFoMGEuNTguNTgsMCwwLDAsLjc2LjA2bC4wNy0uMDYsMi44OS0yLjg5VjIyLjIxQS41OS41OSwwLDAsMCwxNC45MiwyMi43OVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/newKeyIcon.svg":
/*!*************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/newKeyIcon.svg ***!
  \*************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjEuODMsMTQuODNsMy4zNCwzLjM0YTIuNTksMi41OSwwLDAsMSwwLDMuNjZsLTMuMzQsMy4zNGEyLjU5LDIuNTksMCwwLDEtMy42NiwwbC0zLjM0LTMuMzRhMi41OSwyLjU5LDAsMCwxLDAtMy42NmwzLjM0LTMuMzRBMi41OSwyLjU5LDAsMCwxLDIxLjgzLDE0LjgzWk0xOSwxNS42OCwxNS42OCwxOWExLjM3LDEuMzcsMCwwLDAtLjA2LDEuOTRsLjA2LjA2TDE5LDI0LjMyYTEuMzcsMS4zNywwLDAsMCwxLjk0LjA2bC4wNi0uMDZMMjQuMzIsMjFhMS4zNywxLjM3LDAsMCwwLC4wNi0xLjk0TDI0LjMyLDE5LDIxLDE1LjY4YTEuMzcsMS4zNywwLDAsMC0xLjk0LS4wNloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/saveIcon.svg":
/*!***********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/saveIcon.svg ***!
  \***********************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cmVjdCB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNOCwxMC4xNkEyLjEzLDIuMTMsMCwwLDEsMTAuMSw4aDcuNzhhMi41MSwyLjUxLDAsMCwxLDEuNzguNzNsMS41OCwxLjU4QTIuNTMsMi41MywwLDAsMSwyMiwxMi4xMnY3LjczQTIuMTMsMi4xMywwLDAsMSwxOS44OSwyMkgxMC4xNUEyLjE0LDIuMTQsMCwwLDEsOCwxOS44N1YxMC4xNlptMi4xMy0xYTEsMSwwLDAsMC0xLDF2OS42OWExLDEsMCwwLDAsMSwxaC4ydi00LjFBMS43NCwxLjc0LDAsMCwxLDEyLjA2LDE1aDUuODVhMS43NCwxLjc0LDAsMCwxLDEuNzQsMS43NGgwdjQuMDdoLjE5YTEsMSwwLDAsMCwxLTF2LTcuN2ExLjM4LDEuMzgsMCwwLDAtLjQtMWwtMS42LTEuNTNhMS4yNiwxLjI2LDAsMCwwLS43NC0uMzh2Mi4xMWExLjc0LDEuNzQsMCwwLDEtMS43NCwxLjc0SDEyLjg3YTEuNzMsMS43MywwLDAsMS0xLjc1LTEuNzNoMFY5LjE5Wm04LjM0LDExLjYzdi00YS41OS41OSwwLDAsMC0uNTctLjU5SDEyLjA5YS41OC41OCwwLDAsMC0uNTguNThoMHY0LjA3Wk0xMi4yOSw5LjE5djIuMTNhLjU4LjU4LDAsMCwwLC41OC41OGgzLjQ4YS41OC41OCwwLDAsMCwuNTktLjU3aDBWOS4xOVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/scrollbarHandleIcon.svg":
/*!**********************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/scrollbarHandleIcon.svg ***!
  \**********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMSIgdmlld0JveD0iMCAwIDIwIDIxIj48cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iMjEiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTMuNjgsMTcuMzlWMy42MUEuNi42LDAsMCwxLDE0LjMyLDNhLjYxLjYxLDAsMCwxLC41Ny41VjE3LjM5YS42MS42MSwwLDEsMS0xLjIyLjA4Wm0tNC4yOSwwVjMuNjFBLjYxLjYxLDAsMCwxLDEwLDNhLjYyLjYyLDAsMCwxLC42MS41M1YxNy4zOUEuNi42LDAsMCwxLDEwLDE4YS42MS42MSwwLDAsMS0uNTctLjVabS00LjI5LDBWMy42MWEuNjEuNjEsMCwwLDEsMS4yMi0uMDhWMTcuMzlhLjYuNiwwLDAsMS0uNjQuNTguNjEuNjEsMCwwLDEtLjU3LS41WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/stepTangentIcon.svg":
/*!******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/stepTangentIcon.svg ***!
  \******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjksMTYuNzFhMS41LDEuNSwwLDEsMC0yLDEuNDF2NS42N0gxMXYxSDI4VjE4LjEyQTEuNTEsMS41MSwwLDAsMCwyOSwxNi43MVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/unifyTangentIcon.svg":
/*!*******************************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/animations/curveEditor/assets/unifyTangentIcon.svg ***!
  \*******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjcuOTQsMTguMjhhMS40OSwxLjQ5LDAsMCwwLTEuNDEsMWgtNWwtMS42Mi0xLjYzLTEuNjIsMS42M2gtNWExLjUsMS41LDAsMSwwLDAsMWg1bDEuNjIsMS42MiwxLjYyLTEuNjJoNWExLjUsMS41LDAsMSwwLDEuNDEtMloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/babylonLogo.svg":
/*!**********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/babylonLogo.svg ***!
  \**********************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNlMDY4NGI7fS5jbHMtM3tmaWxsOiNiYjQ2NGI7fS5jbHMtNHtmaWxsOiNlMGRlZDg7fS5jbHMtNXtmaWxsOiNkNWQyY2E7fS5jbHMtNntmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxnIGlkPSJVSSI+PHJlY3QgY2xhc3M9ImNscy0xIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iMzIuOTEgMTMuNzggMjkuNTQgMTEuODQgMjYuMjkgMTMuNzEgMjkuNjYgMTUuNjUgMzIuOTEgMTMuNzgiLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iMTQuNjEgMTUuNjUgMjUuMzggOS40NCAyMi4xNCA3LjU3IDExLjM3IDEzLjc4IDE0LjYxIDE1LjY1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjE4Ljc3IDIxLjk1IDIyLjE0IDIzLjg5IDI1LjUxIDIxLjk1IDIyLjE0IDIwIDE4Ljc3IDIxLjk1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjI5LjY2IDE1LjY1IDI5LjY2IDI0LjM0IDIyLjE0IDI4LjY5IDE0LjYxIDI0LjM0IDE0LjYxIDE1LjY1IDExLjM3IDEzLjc4IDExLjM3IDI2LjIyIDIyLjE0IDMyLjQ0IDMyLjkxIDI2LjIyIDMyLjkxIDEzLjc4IDI5LjY2IDE1LjY1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjIyLjE0IDE2LjExIDE4Ljc3IDE4LjA1IDE4Ljc3IDIxLjk1IDIyLjE0IDIwIDI1LjUxIDIxLjk1IDI1LjUxIDE4LjA1IDIyLjE0IDE2LjExIi8+PHBvbHlnb24gY2xhc3M9ImNscy00IiBwb2ludHM9IjI5LjY2IDE1LjY1IDI1LjUxIDE4LjA1IDI1LjUxIDIxLjk1IDIyLjE0IDIzLjg5IDIyLjE0IDI4LjY5IDI5LjY2IDI0LjM0IDI5LjY2IDE1LjY1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy01IiBwb2ludHM9IjE0LjYxIDE1LjY1IDE4Ljc3IDE4LjA1IDE4Ljc3IDIxLjk1IDIyLjE0IDIzLjg5IDIyLjE0IDI4LjY5IDE0LjYxIDI0LjM0IDE0LjYxIDE1LjY1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy02IiBwb2ludHM9IjI1LjM4IDkuNDQgMjkuNTQgMTEuODQgMjYuMjkgMTMuNzEgMjkuNjYgMTUuNjUgMjUuNTEgMTguMDUgMjIuMTQgMTYuMTEgMTguNzcgMTguMDUgMTQuNjEgMTUuNjUgMjUuMzggOS40NCIvPjwvZz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelA.svg":
/*!*******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelA.svg ***!
  \*******************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAsMzAuNUExMC41LDEwLjUsMCwxLDEsMzAuNSwyMCwxMC41MSwxMC41MSwwLDAsMSwyMCwzMC41Wm0wLTIwQTkuNSw5LjUsMCwxLDAsMjkuNSwyMCw5LjUxLDkuNTEsMCwwLDAsMjAsMTAuNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMTgsMjIuNTNsLS43OSwyLjM4SDE1bDMuNTEtMTAuMzNoMi44MUwyNSwyNC45MUgyMi42NGwtLjg2LTIuMzhabTMuMy0xLjgzYy0uNzMtMi4xOS0xLjItMy41OS0xLjQ1LTQuNTJoMGMtLjI1LDEtLjc2LDIuNjQtMS4zNSw0LjUyWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelB.svg":
/*!*******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelB.svg ***!
  \*******************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAsMzAuNUExMC41LDEwLjUsMCwxLDEsMzAuNSwyMCwxMC41MSwxMC41MSwwLDAsMSwyMCwzMC41Wm0wLTIwQTkuNSw5LjUsMCwxLDAsMjkuNSwyMCw5LjUxLDkuNTEsMCwwLDAsMjAsMTAuNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMTYuMTcsMTQuNThoNC41MWMyLjUxLDAsMy40NSwxLjI5LDMuNDUsMi42NGEyLjMxLDIuMzEsMCwwLDEtMS4zMiwyLjIzLDIuNDgsMi40OCwwLDAsMSwxLjYyLDIuMzdjMCwxLjc3LTEuMzksMy4wOS0zLjU4LDMuMDlIMTYuMTdabTQuMjYsNC4wOGMxLjA2LDAsMS41LS40OCwxLjUtMS4yMnMtLjU3LTEuMTQtMS40My0xLjE0SDE4LjM2djIuMzZabS0yLjA3LDQuNTNoMmMxLjIyLDAsMS43Ni0uNTEsMS43Ni0xLjQ0cy0uNTQtMS4zNy0xLjc3LTEuMzdoLTJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelD.svg":
/*!*******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelD.svg ***!
  \*******************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAsMzAuNUExMC41OCwxMC41OCwwLDEsMSwzMC41NywxOS45MywxMC41OCwxMC41OCwwLDAsMSwyMCwzMC41Wm0wLTE5LjlhOS4zMyw5LjMzLDAsMSwwLDkuMzMsOS4zM0E5LjM0LDkuMzQsMCwwLDAsMjAsMTAuNloiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMTYuMzIsMTQuNTRoNC4wOWE0LjY4LDQuNjgsMCwwLDEsNC45NSw1YzAsMy0xLjkxLDUuMjctNS4wNiw1LjI3aC00Wk0xOC41NCwyM2gxLjY3YzIsMCwyLjg1LTEuNDgsMi44NS0zLjQ4LDAtMS42OS0uODItMy4yMi0yLjgzLTMuMjJIMTguNTRaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelG.svg":
/*!*******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelG.svg ***!
  \*******************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAsMzAuNUExMC41LDEwLjUsMCwxLDEsMzAuNSwyMCwxMC41MSwxMC41MSwwLDAsMSwyMCwzMC41Wm0wLTIwQTkuNSw5LjUsMCwxLDAsMjkuNSwyMCw5LjUxLDkuNTEsMCwwLDAsMjAsMTAuNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjQuNiwyNC45MUgyM2E1LjQzLDUuNDMsMCwwLDEtLjE4LTEsMy41LDMuNSwwLDAsMS0zLDEuMmMtMywwLTQuNjgtMi4yOC00LjY4LTUuMjIsMC0zLjEsMS44MS01LjQ0LDUuMDctNS40NCwyLjY1LDAsNC4yMywxLjUsNC40NywzLjI1SDIyLjM5YTIuMDksMi4wOSwwLDAsMC0yLjI2LTEuNTFjLTIuMTMsMC0yLjczLDEuNzgtMi43MywzLjZzLjY5LDMuNTQsMi43NCwzLjU0YTIuMDUsMi4wNSwwLDAsMCwyLjI3LTIuMjVWMjFIMjAuMTRWMTkuMTJIMjQuNloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelR.svg":
/*!*******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/channelR.svg ***!
  \*******************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAsMzAuNUExMC41LDEwLjUsMCwxLDEsMzAuNSwyMCwxMC41MSwxMC41MSwwLDAsMSwyMCwzMC41Wm0wLTIwQTkuNSw5LjUsMCwxLDAsMjkuNSwyMCw5LjUxLDkuNTEsMCwwLDAsMjAsMTAuNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMTguNDUsMjAuNzd2NC4xNEgxNi4yNlYxNC41OGg0LjU1YzIuMjUsMCwzLjQ2LDEuMjMsMy40NiwyLjgzYTIuNSwyLjUsMCwwLDEtMS41LDIuNDVjLjUxLjE5LDEuMjkuNzIsMS4yOSwyLjU4VjIzYTcuNzcsNy43NywwLDAsMCwuMTUsMkgyMi4wOGE3LjM4LDcuMzgsMCwwLDEtLjIxLTIuMzJ2LS4xNWMwLTEuMTMtLjI4LTEuNjctMS45NS0xLjY3Wm0wLTEuNzhoMS44OGMxLjIxLDAsMS42OS0uNDcsMS42OS0xLjMycy0uNTUtMS4zMi0xLjY1LTEuMzJIMTguNDVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/eyeClosed.svg":
/*!********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/eyeClosed.svg ***!
  \********************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTIuNDIsMTNhLjU3LjU3LDAsMCwwLS4wNi43NWwuMDYuMDcsMy4xMywzLjEzYTcuNjksNy42OSwwLDAsMC0zLjA3LDQuNDUuNTguNTgsMCwwLDAsMS4xMy4yOSw2LjYsNi42LDAsMCwxLDIuNzctMy45MWwxLjQxLDEuNDFhMy4xLDMuMSwwLDAsMCw0LjM4LDQuMzhsNC41OSw0LjU5YS41Ny41NywwLDAsMCwuODIsMCwuNTguNTgsMCwwLDAsLjA2LS43NmwtLjA2LS4wNi00Ljc0LTQuNzRoMGwtLjkzLS45My0yLjIyLTIuMjNoMEwxNy40NiwxNy4yaDBsLS44OC0uODhMMTMuMjQsMTNBLjU3LjU3LDAsMCwwLDEyLjQyLDEzWm02LjE5LDcsMi43NCwyLjc0QTEuOTQsMS45NCwwLDAsMSwxOC42MSwyMFpNMjAsMTUuNTNhNy41NCw3LjU0LDAsMCwwLTIuMjQuMzNsMSwxQTYuNjksNi42OSwwLDAsMSwyMCwxNi42OWE2LjU5LDYuNTksMCwwLDEsNi4zOSw1LC41OS41OSwwLDAsMCwuNzEuNDIuNTguNTgsMCwwLDAsLjQyLS43QTcuNzQsNy43NCwwLDAsMCwyMCwxNS41M1ptLjE1LDIuNzIsMywyLjk1QTMuMTEsMy4xMSwwLDAsMCwyMC4xNSwxOC4yNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/eyeOpen.svg":
/*!******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/eyeOpen.svg ***!
  \******************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAsMTguMjdhMy4wOSwzLjA5LDAsMSwxLTMuMDgsMy4wOEEzLjA5LDMuMDksMCwwLDEsMjAsMTguMjdabTAsMS4xNWExLjkzLDEuOTMsMCwxLDAsMS45MywxLjkzQTEuOTQsMS45NCwwLDAsMCwyMCwxOS40MlptMC0zLjg2YTcuNzEsNy43MSwwLDAsMSw3LjQ4LDUuODQuNTguNTgsMCwxLDEtMS4xMi4yOCw2LjU2LDYuNTYsMCwwLDAtMTIuNzIsMCwuNTguNTgsMCwwLDEtMS4xMi0uMjhBNy43Miw3LjcyLDAsMCwxLDIwLDE1LjU2WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/mipDown.svg":
/*!******************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/mipDown.svg ***!
  \******************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjQuNTMsMTkuNzJsLS4wOC0uMDdhLjc1Ljc1LDAsMCwwLTEsLjA3bC0yLjcyLDIuNzJWMTUuNjVBLjc1Ljc1LDAsMCwwLDIwLDE1aC0uMWEuNzUuNzUsMCwwLDAtLjY1Ljc0djYuNjlsLTIuNzItMi43Mi0uMDgtLjA3YS43NS43NSwwLDAsMC0xLDEuMTNsNCw0LC4wOC4wN2EuNzUuNzUsMCwwLDAsMS0uMDdsNC00LC4wNy0uMDhBLjc1Ljc1LDAsMCwwLDI0LjUzLDE5LjcyWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0xMCwyMEExMCwxMCwwLDEsMCwyMCwxMCwxMCwxMCwwLDAsMCwxMCwyMFptMTguNSwwQTguNSw4LjUsMCwxLDEsMjAsMTEuNSw4LjUxLDguNTEsMCwwLDEsMjguNSwyMFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/mipUp.svg":
/*!****************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/mipUp.svg ***!
  \****************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTUuNDcsMjAuMjhsLjA4LjA3YS43NS43NSwwLDAsMCwxLS4wN2wyLjcyLTIuNzJ2Ni43OUEuNzUuNzUsMCwwLDAsMjAsMjVoLjFhLjc1Ljc1LDAsMCwwLC42NS0uNzRWMTcuNTZsMi43MiwyLjcyLjA4LjA3YS43NS43NSwwLDAsMCwxLTEuMTNsLTQtNC0uMDgtLjA3YS43NS43NSwwLDAsMC0xLC4wN2wtNCw0LS4wNy4wOEEuNzUuNzUsMCwwLDAsMTUuNDcsMjAuMjhaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTMwLDIwQTEwLDEwLDAsMSwwLDIwLDMwLDEwLDEwLDAsMCwwLDMwLDIwWk0xMS41LDIwQTguNSw4LjUsMCwxLDEsMjAsMjguNSw4LjUxLDguNTEsMCwwLDEsMTEuNSwyMFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/negX.svg":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/negX.svg ***!
  \***************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuNzUsMTguNzJ2MS40NUgxNC4zM1YxOC43MloiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjMuNzUsMjQuNjIsMjIsMjAuNDFoMGwtMS43Nyw0LjIxSDE4LjQ0bDIuNjEtNS41Ny0yLjUyLTUuMjloMS45M2wxLjYzLDMuOGgwbDEuNjUtMy44aDEuNzhMMjMsMTguODdsMi42NCw1Ljc1WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/negY.svg":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/negY.svg ***!
  \***************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuNywxOC43MnYxLjQ1SDE0LjI4VjE4LjcyWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0yMS4yMSwyNC42MlYyMC42OGEuNjMuNjMsMCwwLDAtLjA3LS4zMmwtMi43My02LjZoMS44N2MuNjYsMS43NiwxLjUsNCwxLjgyLDUuMTMuNC0xLjI0LDEuMjUtMy40NiwxLjg0LTUuMTNoMS43OEwyMywyMC4zN2EuOS45LDAsMCwwLS4wNS4zNHYzLjkxWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/negZ.svg":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/negZ.svg ***!
  \***************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTgsMTguNzJ2MS40NUgxNC41NFYxOC43MloiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMTkuMDksMjMuNDNsNC4zNS04LjE4aC00VjEzLjc2aDUuODZ2MS4zNmwtNC4yMiw4aDQuNGwtLjIzLDEuNDhIMTkuMDlaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/posX.svg":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/posX.svg ***!
  \***************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTYuODksMTZ2M2gyLjgydjEuMjdIMTYuODl2M2gtMS4zdi0zSDEyLjc0VjE5aDIuODVWMTZaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI1LjM0LDI0LjYybC0xLjc1LTQuMjFoMEwyMS44LDI0LjYySDIwbDIuNjEtNS41Ny0yLjUxLTUuMjlIMjJsMS42MywzLjhoMGwxLjY1LTMuOGgxLjc3bC0yLjQ5LDUuMTEsMi42NCw1Ljc1WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/posY.svg":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/posY.svg ***!
  \***************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTYuODQsMTZ2M2gyLjgydjEuMjdIMTYuODR2M2gtMS4zdi0zSDEyLjY5VjE5aDIuODVWMTZaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTIyLjc5LDI0LjYyVjIwLjY4YS42My42MywwLDAsMC0uMDYtLjMyTDIwLDEzLjc2aDEuODdjLjY2LDEuNzYsMS41MSw0LDEuODMsNS4xMy40LTEuMjQsMS4yNS0zLjQ2LDEuODQtNS4xM2gxLjc4bC0yLjc3LDYuNjFhLjczLjczLDAsMCwwLS4wNS4zNHYzLjkxWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/posZ.svg":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/posZ.svg ***!
  \***************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuMSwxNnYzaDIuODJ2MS4yN0gxNy4xdjNIMTUuODF2LTNIMTNWMTloMi44NVYxNloiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjAuNjcsMjMuNDMsMjUsMTUuMjVIMjFWMTMuNzZoNS44NnYxLjM2bC00LjIzLDhIMjdsLS4yMiwxLjQ4SDIwLjY3WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/reset.svg":
/*!****************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/reset.svg ***!
  \****************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTMuNDUsMTEuMzJhLjc4Ljc4LDAsMCwwLS43Ny42NnYzYS43Ny43NywwLDAsMCwuNjYuNzZoM2EuNzguNzgsMCwwLDAsLjc3LS43Ny43Ny43NywwLDAsMC0uNjctLjc2SDE1LjM2YTcuNDMsNy40MywwLDEsMS0yLjY0LDQuMzguNzcuNzcsMCwxLDAtMS41MS0uMjksOSw5LDAsMSwwLDMtNS4xM1YxMi4wOUEuNzYuNzYsMCwwLDAsMTMuNDUsMTEuMzJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/resizeTool.svg":
/*!*********************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/resizeTool.svg ***!
  \*********************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTIuNSwyMWEuNS41LDAsMCwxLC41LjVWMjVhMiwyLDAsMCwwLDIsMmgzLjVhLjUuNSwwLDAsMSwwLDFIMTVhMywzLDAsMCwxLTMtM1YyMS41QS41LjUsMCwwLDEsMTIuNSwyMVptMTUsMGEuNS41LDAsMCwxLC40OS40MVYyNWEzLDMsMCwwLDEtMi44MiwzSDIxLjVhLjUuNSwwLDAsMS0uMDktMUgyNWEyLDIsMCwwLDAsMi0xLjg1VjIxLjVBLjUuNSwwLDAsMSwyNy41LDIxWm0tOS05YS41LjUsMCwwLDEsLjA5LDFIMTVhMiwyLDAsMCwwLTIsMS44NVYxOC41YS41LjUsMCwwLDEtMSwuMDlWMTVhMywzLDAsMCwxLDIuODItM0gxOC41Wk0yNSwxMmEzLDMsMCwwLDEsMywyLjgyVjE4LjVhLjUuNSwwLDAsMS0xLC4wOVYxNWEyLDIsMCwwLDAtMS44NS0ySDIxLjVhLjUuNSwwLDAsMS0uMDktMUgyNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/save.svg":
/*!***************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/save.svg ***!
  \***************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjkuMzYsMTguMzlhMi4xOCwyLjE4LDAsMCwxLDAsMy4wOGwtNy45MSw3LjkxYTEuMjIsMS4yMiwwLDAsMS0uODkuMzdoLTEuN2EuODUuODUsMCwwLDEtLjg2LS44NnYtMS43YTEuMjIsMS4yMiwwLDAsMSwuMzctLjg5bDcuOTEtNy45MUEyLjE4LDIuMTgsMCwwLDEsMjkuMzYsMTguMzlaTTMwLDIzLjExVjI3LjVhMi4yNSwyLjI1LDAsMCwxLTIuMjUsMi4yNUgyM2wxLjUtMS41aDMuMjVhLjc2Ljc2LDAsMCwwLC43NS0uNzV2LTNaTTIzLjYzLDEwLjI1YTEuMjMsMS4yMywwLDAsMSwuNzYuMjZMMjkuNjQsMTVhMS4yMSwxLjIxLDAsMCwxLC4zNi45djEuMjNhMi40MywyLjQzLDAsMCwwLS43NS0uNDMsMiwyLDAsMCwwLS43NC0uMVYxNkwyNCwxMi4xNFYxNWExLjc1LDEuNzUsMCwwLDEtMS43NSwxLjc1aC02QTEuNzUsMS43NSwwLDAsMSwxNC41LDE1VjExLjc1SDEyLjI1YS43NS43NSwwLDAsMC0uNzUuNzV2MTVhLjc1Ljc1LDAsMCwwLC43NS43NUgxM1YyMi41MWExLjc1LDEuNzUsMCwwLDEsMS42MS0xLjc0SDIybC0xLjU1LDEuNUgxNC43NWEuMjUuMjUsMCwwLDAtLjI0LjJ2NS43OWgydjEuNUgxMi4yNUEyLjI1LDIuMjUsMCwwLDEsMTAsMjcuNXYtMTVhMi4yNSwyLjI1LDAsMCwxLDIuMjUtMi4yNVptMy43Miw5LjIxLTcuODQsNy44M3YuOTVoLjk1bDcuODMtNy44NGEuNjYuNjYsMCwwLDAtLjk0LS45NFpNMjIuNSwxMS43NUgxNlYxNWEuMjUuMjUsMCwwLDAsLjI1LjI1aDZBLjI1LjI1LDAsMCwwLDIyLjUsMTVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/upload.svg":
/*!*****************************************************************************************************************!*\
  !*** ../../../dev/inspector/dist/components/actionTabs/tabs/propertyGrids/materials/textures/assets/upload.svg ***!
  \*****************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTMuNSwyOC41aDEzYS43Ni43NiwwLDAsMSwuNzUuNzUuNzUuNzUsMCwwLDEtLjY1Ljc0SDEzLjVhLjc1Ljc1LDAsMCwxLS4xLTEuNVptMS0xMy4yOCw1LTVhLjczLjczLDAsMCwxLDEtLjA3bC4wOS4wNyw1LDVhLjc1Ljc1LDAsMCwxLDAsMS4wNi43NS43NSwwLDAsMS0xLC4wN2wtLjA5LS4wNy0zLjcyLTMuNzJWMjYuMjVhLjc1Ljc1LDAsMCwxLS42NS43NEgyMGEuNzUuNzUsMCwwLDEtLjc0LS42NVYxMi41NmwtMy43MiwzLjcyYS43Ni43NiwwLDAsMS0xLC4wN2wtLjA4LS4wN2EuNzUuNzUsMCwwLDEtLjA3LTFsLjA3LS4wOCw1LTVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/copy.svg":
/*!**********************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/copy.svg ***!
  \**********************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5jb3B5PC90aXRsZT48ZyBpZD0iVUlfRWxlbWVudHMiIGRhdGEtbmFtZT0iVUkgRWxlbWVudHMiPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTI0LDE0Ljg5SDIyLjc2bC0zLTNIMTIuNDNWMjYuNTloNC4yNnYzaDExLjVWMTlabS4zLDEuNzEsMi4xNCwyLjEzSDI0LjM0Wm0tMTAuOTEsOVYxMi45M2g1LjkzbDIsMkgxNi42OXYxMC43Wm00LjI2LDNWMTUuODloNS42NXYzLjg0aDMuODV2OC44M1oiLz48L2c+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/copyStep.svg":
/*!**************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/copyStep.svg ***!
  \**************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1OS4xICg4NjE0NCkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfY29weV8yNF9yZWd1bGFyPC90aXRsZT4NCiAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogIDxnIGlkPSLwn5SNLVByb2R1Y3QtSWNvbnMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPg0KICAgIDxnIGlkPSJpY19mbHVlbnRfY29weV8yNF9yZWd1bGFyIiBmaWxsPSJ3aGl0ZSIgZmlsbC1ydWxlPSJub256ZXJvIj4NCiAgICAgIDxwYXRoIGQ9Ik01LjUwMjgwMzgxLDQuNjI3MDQwMzggTDUuNSw2Ljc1IEw1LjUsMTcuMjU0MjA4NyBDNS41LDE5LjA0OTEzNDIgNi45NTUwNzQ1NiwyMC41MDQyMDg3IDguNzUsMjAuNTA0MjA4NyBMMTcuMzY2Mjg2OCwyMC41MDQ0NjIyIEMxNy4wNTczMzgsMjEuMzc4MjI0MSAxNi4yMjM5NzUxLDIyLjAwNDIwODcgMTUuMjQ0NDA1NywyMi4wMDQyMDg3IEw4Ljc1LDIyLjAwNDIwODcgQzYuMTI2NjQ3NDQsMjIuMDA0MjA4NyA0LDE5Ljg3NzU2MTMgNCwxNy4yNTQyMDg3IEw0LDYuNzUgQzQsNS43NjkyODg0OCA0LjYyNzQ0NTIzLDQuOTM1MTI0NjQgNS41MDI4MDM4MSw0LjYyNzA0MDM4IFogTTE3Ljc1LDIgQzE4Ljk5MjY0MDcsMiAyMCwzLjAwNzM1OTMxIDIwLDQuMjUgTDIwLDE3LjI1IEMyMCwxOC40OTI2NDA3IDE4Ljk5MjY0MDcsMTkuNSAxNy43NSwxOS41IEw4Ljc1LDE5LjUgQzcuNTA3MzU5MzEsMTkuNSA2LjUsMTguNDkyNjQwNyA2LjUsMTcuMjUgTDYuNSw0LjI1IEM2LjUsMy4wMDczNTkzMSA3LjUwNzM1OTMxLDIgOC43NSwyIEwxNy43NSwyIFogTTE3Ljc1LDMuNSBMOC43NSwzLjUgQzguMzM1Nzg2NDQsMy41IDgsMy44MzU3ODY0NCA4LDQuMjUgTDgsMTcuMjUgQzgsMTcuNjY0MjEzNiA4LjMzNTc4NjQ0LDE4IDguNzUsMTggTDE3Ljc1LDE4IEMxOC4xNjQyMTM2LDE4IDE4LjUsMTcuNjY0MjEzNiAxOC41LDE3LjI1IEwxOC41LDQuMjUgQzE4LjUsMy44MzU3ODY0NCAxOC4xNjQyMTM2LDMuNSAxNy43NSwzLjUgWiIgaWQ9IvCfjqgtQ29sb3IiPjwvcGF0aD4NCiAgICA8L2c+DQogIDwvZz4NCjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleMixedIcon_30px.svg":
/*!**************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleMixedIcon_30px.svg ***!
  \**************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTIwLDIwSDEwYy0yLjc2LDAtNS0yLjI0LTUtNSwwLTIuNzYsMi4yNC01LDUtNWgxMGMyLjc2LDAsNSwyLjI0LDUsNSwwLDIuNzYtMi4yNCw1LTUsNVpNMTAsMTEuNWMtMS45MywwLTMuNSwxLjU3LTMuNSwzLjVzMS41NywzLjUsMy41LDMuNWgxMGMxLjkzLDAsMy41LTEuNTcsMy41LTMuNXMtMS41Ny0zLjUtMy41LTMuNUgxMFoiLz48cmVjdCBjbGFzcz0iYiIgeD0iMTEuMDMiIHk9IjE0LjI1IiB3aWR0aD0iNy45NCIgaGVpZ2h0PSIxLjUiIHJ4PSIuNzUiIHJ5PSIuNzUiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_30px.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_30px.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTAuMjUsMTcuNWEyLjUsMi41LDAsMSwxLDIuNS0yLjVBMi41LDIuNSwwLDAsMSwxMC4yNSwxNy41WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik0yMCwyMEgxMGE1LDUsMCwwLDEsMC0xMEgyMGE1LDUsMCwwLDEsMCwxMFpNMTAsMTEuNWEzLjUsMy41LDAsMCwwLDAsN0gyMGEzLjUsMy41LDAsMCwwLDAtN1oiIHN0eWxlPSJmaWxsOiMzMzMiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_40px.svg":
/*!************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleOffIcon_40px.svg ***!
  \************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE1LjI1LDIyLjVjLTEuMzgsMC0yLjUtMS4xMi0yLjUtMi41LDAtMS4zOCwxLjEyLTIuNSwyLjUtMi41czIuNSwxLjEyLDIuNSwyLjVjMCwxLjM4LTEuMTIsMi41LTIuNSwyLjVaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0yNSwyNUgxNWMtMi43NiwwLTUtMi4yNC01LTUsMC0yLjc2LDIuMjQtNSw1LTVoMTBjMi43NiwwLDUsMi4yNCw1LDUsMCwyLjc2LTIuMjQsNS01LDVabS0xMC04LjVjLTEuOTMsMC0zLjUsMS41Ny0zLjUsMy41czEuNTcsMy41LDMuNSwzLjVoMTBjMS45MywwLDMuNS0xLjU3LDMuNS0zLjVzLTEuNTctMy41LTMuNS0zLjVIMTVaIi8+PC9zdmc+";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_30px.svg":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_30px.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cGF0aCBkPSJNMTkuNzUsMTcuNWEyLjUsMi41LDAsMSwwLTIuNS0yLjVBMi41LDIuNSwwLDAsMCwxOS43NSwxNy41WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjxwYXRoIGQ9Ik01LDE1YTUsNSwwLDAsMSw1LTVIMjBhNSw1LDAsMCwxLDAsMTBIMTBBNSw1LDAsMCwxLDUsMTVabTUtMy41YTMuNSwzLjUsMCwwLDAsMCw3SDIwYTMuNSwzLjUsMCwwLDAsMC03WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_40px.svg":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/imgs/toggleOnIcon_40px.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojMzMzO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTI0Ljc1LDIyLjVjMS4zOCwwLDIuNS0xLjEyLDIuNS0yLjVzLTEuMTItMi41LTIuNS0yLjUtMi41LDEuMTItMi41LDIuNSwxLjEyLDIuNSwyLjUsMi41WiIvPjxwYXRoIGNsYXNzPSJiIiBkPSJNMTAsMjBjMC0yLjc2LDIuMjQtNSw1LTVoMTBjMi43NiwwLDUsMi4yNCw1LDVzLTIuMjQsNS01LDVIMTVjLTIuNzYsMC01LTIuMjQtNS01Wm01LTMuNWMtMS45MywwLTMuNSwxLjU3LTMuNSwzLjVzMS41NywzLjUsMy41LDMuNWgxMGMxLjkzLDAsMy41LTEuNTcsMy41LTMuNXMtMS41Ny0zLjUtMy41LTMuNUgxNVoiLz48L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/downArrow.svg":
/*!****************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/downArrow.svg ***!
  \****************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjE3IiBoZWlnaHQ9IjE3Ij4NCiAgPHBhdGggZD0iTTQuMjE5NjcgOC40Njk2N0M0LjUxMjU2IDguMTc2NzggNC45ODc0NCA4LjE3Njc4IDUuMjgwMzMgOC40Njk2N0wxMiAxNS4xODkzTDE4LjcxOTcgOC40Njk2N0MxOS4wMTI2IDguMTc2NzggMTkuNDg3NCA4LjE3Njc4IDE5Ljc4MDMgOC40Njk2N0MyMC4wNzMyIDguNzYyNTYgMjAuMDczMiA5LjIzNzQ0IDE5Ljc4MDMgOS41MzAzM0wxMi41MzAzIDE2Ljc4MDNDMTIuMjM3NCAxNy4wNzMyIDExLjc2MjYgMTcuMDczMiAxMS40Njk3IDE2Ljc4MDNMNC4yMTk2NyA5LjUzMDMzQzMuOTI2NzggOS4yMzc0NCAzLjkyNjc4IDguNzYyNTYgNC4yMTk2NyA4LjQ2OTY3WiIgZmlsbD0id2hpdGUiIC8+DQo8L3N2Zz4=";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/valueDownArrowIcon.svg":
/*!*************************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/valueDownArrowIcon.svg ***!
  \*************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDE1IDE1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNC4wOSw1LjU1YS42MS42MSwwLDAsMSwuODUsMGwyLDJWMS43OWEuNi42LDAsMSwxLDEuMiwwVjcuNTJsMi0yYS42MS42MSwwLDAsMSwuODUsMCwuNi42LDAsMCwxLDAsLjg0bC0zLDNhLjYuNiwwLDAsMS0uODQsMGwtMy0zQS42LjYsMCwwLDEsNC4wOSw1LjU1WiIvPjwvc3ZnPg==";

/***/ }),

/***/ "../../../dev/sharedUiComponents/dist/lines/valueUpArrowIcon.svg":
/*!***********************************************************************!*\
  !*** ../../../dev/sharedUiComponents/dist/lines/valueUpArrowIcon.svg ***!
  \***********************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDE1IDE1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNC4wOSw5LjQ1YS42LjYsMCwwLDEsMC0uODRsMy0zYS42LjYsMCwwLDEsLjg0LDBsMywzYS42LjYsMCwwLDEsMCwuODQuNjEuNjEsMCwwLDEtLjg1LDBsLTItMnY1LjczYS42LjYsMCwwLDEtMS4yLDBWNy40OGwtMiwyQS42MS42MSwwLDAsMSw0LjA5LDkuNDVaIi8+PC9zdmc+";

/***/ }),

/***/ "data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 2 2%27%3E%3Cpath fill=%27rgba%281.0,1.0,1.0,0.3%29%27 fill-rule=%27evenodd%27 d=%27M0 0h1v1H0V0zm1 1h1v1H1V1z%27/%3E%3C/svg%3E":
/*!**********************************************************************************************************************************************************************************************************************!*\
  !*** data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 2 2%27%3E%3Cpath fill=%27rgba%281.0,1.0,1.0,0.3%29%27 fill-rule=%27evenodd%27 d=%27M0 0h1v1H0V0zm1 1h1v1H1V1z%27/%3E%3C/svg%3E ***!
  \**********************************************************************************************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = "data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 2 2%27%3E%3Cpath fill=%27rgba%281.0,1.0,1.0,0.3%29%27 fill-rule=%27evenodd%27 d=%27M0 0h1v1H0V0zm1 1h1v1H1V1z%27/%3E%3C/svg%3E";

/***/ }),

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

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_core_Misc_observable__;

/***/ }),

/***/ "gui-editor/guiEditor":
/*!****************************************************************************************************************************************!*\
  !*** external {"root":"BABYLON","commonjs":"@babylonjs/gui-editor","commonjs2":"@babylonjs/gui-editor","amd":"@babylonjs/gui-editor"} ***!
  \****************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_gui_editor_guiEditor__;

/***/ }),

/***/ "loaders/glTF/index":
/*!*******************************************************************************************************************************!*\
  !*** external {"root":"BABYLON","commonjs":"@babylonjs/loaders","commonjs2":"@babylonjs/loaders","amd":"@babylonjs/loaders"} ***!
  \*******************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_loaders_glTF_index__;

/***/ }),

/***/ "materials/grid/gridMaterial":
/*!*************************************************************************************************************************************!*\
  !*** external {"root":"BABYLON","commonjs":"@babylonjs/materials","commonjs2":"@babylonjs/materials","amd":"@babylonjs/materials"} ***!
  \*************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_materials_grid_gridMaterial__;

/***/ }),

/***/ "serializers/glTF/2.0/index":
/*!*******************************************************************************************************************************************!*\
  !*** external {"root":"BABYLON","commonjs":"@babylonjs/serializers","commonjs2":"@babylonjs/serializers","amd":"@babylonjs/serializers"} ***!
  \*******************************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_serializers_glTF_2_0_index__;

/***/ }),

/***/ "core/Debug/physicsViewer":
/*!********************************************************************************************************************************!*\
  !*** external {"root":["BABYLON","Debug"],"commonjs":"@babylonjs/core","commonjs2":"@babylonjs/core","amd":"@babylonjs/core"} ***!
  \********************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_core_Debug_physicsViewer__;

/***/ }),

/***/ "gui/2D/adtInstrumentation":
/*!***************************************************************************************************************************!*\
  !*** external {"root":["BABYLON","GUI"],"commonjs":"@babylonjs/gui","commonjs2":"@babylonjs/gui","amd":"@babylonjs/gui"} ***!
  \***************************************************************************************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_gui_2D_adtInstrumentation__;

/***/ }),

/***/ "../../../../node_modules/classnames/index.js":
/*!****************************************************!*\
  !*** ../../../../node_modules/classnames/index.js ***!
  \****************************************************/
/***/ ((module, exports) => {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
/* global define */

(function () {
	'use strict';

	var hasOwn = {}.hasOwnProperty;

	function classNames () {
		var classes = '';

		for (var i = 0; i < arguments.length; i++) {
			var arg = arguments[i];
			if (arg) {
				classes = appendClass(classes, parseValue(arg));
			}
		}

		return classes;
	}

	function parseValue (arg) {
		if (typeof arg === 'string' || typeof arg === 'number') {
			return arg;
		}

		if (typeof arg !== 'object') {
			return '';
		}

		if (Array.isArray(arg)) {
			return classNames.apply(null, arg);
		}

		if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
			return arg.toString();
		}

		var classes = '';

		for (var key in arg) {
			if (hasOwn.call(arg, key) && arg[key]) {
				classes = appendClass(classes, key);
			}
		}

		return classes;
	}

	function appendClass (value, newClass) {
		if (!newClass) {
			return value;
		}
	
		if (value) {
			return value + ' ' + newClass;
		}
	
		return value + newClass;
	}

	if (  true && module.exports) {
		classNames.default = classNames;
		module.exports = classNames;
	} else if (true) {
		// register as 'classnames', consistent with npm package name
		!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
			return classNames;
		}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	} else {}
}());


/***/ }),

/***/ "../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs":
/*!****************************************************************************!*\
  !*** ../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs ***!
  \****************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_3388683__) => {

"use strict";
__nested_webpack_require_3388683__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3388683__.d(__nested_webpack_exports__, {
/* harmony export */   api: () => (/* binding */ api),
/* harmony export */   config: () => (/* binding */ config$1),
/* harmony export */   counter: () => (/* binding */ counter),
/* harmony export */   dom: () => (/* binding */ dom$1),
/* harmony export */   findIconDefinition: () => (/* binding */ findIconDefinition$1),
/* harmony export */   icon: () => (/* binding */ icon),
/* harmony export */   layer: () => (/* binding */ layer),
/* harmony export */   library: () => (/* binding */ library$1),
/* harmony export */   noAuto: () => (/* binding */ noAuto$1),
/* harmony export */   parse: () => (/* binding */ parse$1),
/* harmony export */   text: () => (/* binding */ text),
/* harmony export */   toHtml: () => (/* binding */ toHtml$1)
/* harmony export */ });
/*!
 * Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com
 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
 * Copyright 2024 Fonticons, Inc.
 */
function _defineProperty(e, r, t) {
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}
function _inherits(t, e) {
  if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
  t.prototype = Object.create(e && e.prototype, {
    constructor: {
      value: t,
      writable: !0,
      configurable: !0
    }
  }), Object.defineProperty(t, "prototype", {
    writable: !1
  }), e && _setPrototypeOf(t, e);
}
function ownKeys(e, r) {
  var t = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    r && (o = o.filter(function (r) {
      return Object.getOwnPropertyDescriptor(e, r).enumerable;
    })), t.push.apply(t, o);
  }
  return t;
}
function _objectSpread2(e) {
  for (var r = 1; r < arguments.length; r++) {
    var t = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
      _defineProperty(e, r, t[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
    });
  }
  return e;
}
function _setPrototypeOf(t, e) {
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
    return t.__proto__ = e, t;
  }, _setPrototypeOf(t, e);
}
function _toPrimitive(t, r) {
  if ("object" != typeof t || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != typeof i) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
  var i = _toPrimitive(t, "string");
  return "symbol" == typeof i ? i : i + "";
}
function _wrapRegExp() {
  _wrapRegExp = function (e, r) {
    return new BabelRegExp(e, void 0, r);
  };
  var e = RegExp.prototype,
    r = new WeakMap();
  function BabelRegExp(e, t, p) {
    var o = RegExp(e, t);
    return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype);
  }
  function buildGroups(e, t) {
    var p = r.get(t);
    return Object.keys(p).reduce(function (r, t) {
      var o = p[t];
      if ("number" == typeof o) r[t] = e[o];else {
        for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++;
        r[t] = e[o[i]];
      }
      return r;
    }, Object.create(null));
  }
  return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {
    var t = e.exec.call(this, r);
    if (t) {
      t.groups = buildGroups(t, this);
      var p = t.indices;
      p && (p.groups = buildGroups(p, this));
    }
    return t;
  }, BabelRegExp.prototype[Symbol.replace] = function (t, p) {
    if ("string" == typeof p) {
      var o = r.get(this);
      return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) {
        var t = o[r];
        return "$" + (Array.isArray(t) ? t.join("$") : t);
      }));
    }
    if ("function" == typeof p) {
      var i = this;
      return e[Symbol.replace].call(this, t, function () {
        var e = arguments;
        return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e);
      });
    }
    return e[Symbol.replace].call(this, t, p);
  }, _wrapRegExp.apply(this, arguments);
}

const noop = () => {};
let _WINDOW = {};
let _DOCUMENT = {};
let _MUTATION_OBSERVER = null;
let _PERFORMANCE = {
  mark: noop,
  measure: noop
};
try {
  if (typeof window !== 'undefined') _WINDOW = window;
  if (typeof document !== 'undefined') _DOCUMENT = document;
  if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
  if (typeof performance !== 'undefined') _PERFORMANCE = performance;
} catch (e) {}
const {
  userAgent = ''
} = _WINDOW.navigator || {};
const WINDOW = _WINDOW;
const DOCUMENT = _DOCUMENT;
const MUTATION_OBSERVER = _MUTATION_OBSERVER;
const PERFORMANCE = _PERFORMANCE;
const IS_BROWSER = !!WINDOW.document;
const IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
const IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');

var p = /fa(s|r|l|t|d|dr|dl|dt|b|k|kd|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,
  g = /Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;
var S = {
    classic: {
      fa: "solid",
      fas: "solid",
      "fa-solid": "solid",
      far: "regular",
      "fa-regular": "regular",
      fal: "light",
      "fa-light": "light",
      fat: "thin",
      "fa-thin": "thin",
      fab: "brands",
      "fa-brands": "brands"
    },
    duotone: {
      fa: "solid",
      fad: "solid",
      "fa-solid": "solid",
      "fa-duotone": "solid",
      fadr: "regular",
      "fa-regular": "regular",
      fadl: "light",
      "fa-light": "light",
      fadt: "thin",
      "fa-thin": "thin"
    },
    sharp: {
      fa: "solid",
      fass: "solid",
      "fa-solid": "solid",
      fasr: "regular",
      "fa-regular": "regular",
      fasl: "light",
      "fa-light": "light",
      fast: "thin",
      "fa-thin": "thin"
    },
    "sharp-duotone": {
      fa: "solid",
      fasds: "solid",
      "fa-solid": "solid",
      fasdr: "regular",
      "fa-regular": "regular",
      fasdl: "light",
      "fa-light": "light",
      fasdt: "thin",
      "fa-thin": "thin"
    }
  },
  A = {
    GROUP: "duotone-group",
    SWAP_OPACITY: "swap-opacity",
    PRIMARY: "primary",
    SECONDARY: "secondary"
  },
  P = ["fa-classic", "fa-duotone", "fa-sharp", "fa-sharp-duotone"];
var s = "classic",
  t = "duotone",
  r = "sharp",
  o = "sharp-duotone",
  L = [s, t, r, o];
var G = {
    classic: {
      900: "fas",
      400: "far",
      normal: "far",
      300: "fal",
      100: "fat"
    },
    duotone: {
      900: "fad",
      400: "fadr",
      300: "fadl",
      100: "fadt"
    },
    sharp: {
      900: "fass",
      400: "fasr",
      300: "fasl",
      100: "fast"
    },
    "sharp-duotone": {
      900: "fasds",
      400: "fasdr",
      300: "fasdl",
      100: "fasdt"
    }
  };
var lt = {
    "Font Awesome 6 Free": {
      900: "fas",
      400: "far"
    },
    "Font Awesome 6 Pro": {
      900: "fas",
      400: "far",
      normal: "far",
      300: "fal",
      100: "fat"
    },
    "Font Awesome 6 Brands": {
      400: "fab",
      normal: "fab"
    },
    "Font Awesome 6 Duotone": {
      900: "fad",
      400: "fadr",
      normal: "fadr",
      300: "fadl",
      100: "fadt"
    },
    "Font Awesome 6 Sharp": {
      900: "fass",
      400: "fasr",
      normal: "fasr",
      300: "fasl",
      100: "fast"
    },
    "Font Awesome 6 Sharp Duotone": {
      900: "fasds",
      400: "fasdr",
      normal: "fasdr",
      300: "fasdl",
      100: "fasdt"
    }
  };
var pt = new Map([["classic", {
    defaultShortPrefixId: "fas",
    defaultStyleId: "solid",
    styleIds: ["solid", "regular", "light", "thin", "brands"],
    futureStyleIds: [],
    defaultFontWeight: 900
  }], ["sharp", {
    defaultShortPrefixId: "fass",
    defaultStyleId: "solid",
    styleIds: ["solid", "regular", "light", "thin"],
    futureStyleIds: [],
    defaultFontWeight: 900
  }], ["duotone", {
    defaultShortPrefixId: "fad",
    defaultStyleId: "solid",
    styleIds: ["solid", "regular", "light", "thin"],
    futureStyleIds: [],
    defaultFontWeight: 900
  }], ["sharp-duotone", {
    defaultShortPrefixId: "fasds",
    defaultStyleId: "solid",
    styleIds: ["solid", "regular", "light", "thin"],
    futureStyleIds: [],
    defaultFontWeight: 900
  }]]),
  xt = {
    classic: {
      solid: "fas",
      regular: "far",
      light: "fal",
      thin: "fat",
      brands: "fab"
    },
    duotone: {
      solid: "fad",
      regular: "fadr",
      light: "fadl",
      thin: "fadt"
    },
    sharp: {
      solid: "fass",
      regular: "fasr",
      light: "fasl",
      thin: "fast"
    },
    "sharp-duotone": {
      solid: "fasds",
      regular: "fasdr",
      light: "fasdl",
      thin: "fasdt"
    }
  };
var Ft = ["fak", "fa-kit", "fakd", "fa-kit-duotone"],
  St = {
    kit: {
      fak: "kit",
      "fa-kit": "kit"
    },
    "kit-duotone": {
      fakd: "kit-duotone",
      "fa-kit-duotone": "kit-duotone"
    }
  },
  At = ["kit"];
var Ct = {
  kit: {
    "fa-kit": "fak"
  },
  "kit-duotone": {
    "fa-kit-duotone": "fakd"
  }
};
var Lt = ["fak", "fakd"],
  Wt = {
    kit: {
      fak: "fa-kit"
    },
    "kit-duotone": {
      fakd: "fa-kit-duotone"
    }
  };
var Et = {
    kit: {
      kit: "fak"
    },
    "kit-duotone": {
      "kit-duotone": "fakd"
    }
  };

var t$1 = {
    GROUP: "duotone-group",
    SWAP_OPACITY: "swap-opacity",
    PRIMARY: "primary",
    SECONDARY: "secondary"
  },
  r$1 = ["fa-classic", "fa-duotone", "fa-sharp", "fa-sharp-duotone"];
var bt$1 = ["fak", "fa-kit", "fakd", "fa-kit-duotone"];
var Yt = {
    "Font Awesome Kit": {
      400: "fak",
      normal: "fak"
    },
    "Font Awesome Kit Duotone": {
      400: "fakd",
      normal: "fakd"
    }
  };
var po = {
    classic: {
      "fa-brands": "fab",
      "fa-duotone": "fad",
      "fa-light": "fal",
      "fa-regular": "far",
      "fa-solid": "fas",
      "fa-thin": "fat"
    },
    duotone: {
      "fa-regular": "fadr",
      "fa-light": "fadl",
      "fa-thin": "fadt"
    },
    sharp: {
      "fa-solid": "fass",
      "fa-regular": "fasr",
      "fa-light": "fasl",
      "fa-thin": "fast"
    },
    "sharp-duotone": {
      "fa-solid": "fasds",
      "fa-regular": "fasdr",
      "fa-light": "fasdl",
      "fa-thin": "fasdt"
    }
  },
  I$1 = {
    classic: ["fas", "far", "fal", "fat", "fad"],
    duotone: ["fadr", "fadl", "fadt"],
    sharp: ["fass", "fasr", "fasl", "fast"],
    "sharp-duotone": ["fasds", "fasdr", "fasdl", "fasdt"]
  },
  co = {
    classic: {
      fab: "fa-brands",
      fad: "fa-duotone",
      fal: "fa-light",
      far: "fa-regular",
      fas: "fa-solid",
      fat: "fa-thin"
    },
    duotone: {
      fadr: "fa-regular",
      fadl: "fa-light",
      fadt: "fa-thin"
    },
    sharp: {
      fass: "fa-solid",
      fasr: "fa-regular",
      fasl: "fa-light",
      fast: "fa-thin"
    },
    "sharp-duotone": {
      fasds: "fa-solid",
      fasdr: "fa-regular",
      fasdl: "fa-light",
      fasdt: "fa-thin"
    }
  },
  x = ["fa-solid", "fa-regular", "fa-light", "fa-thin", "fa-duotone", "fa-brands"],
  xo = ["fa", "fas", "far", "fal", "fat", "fad", "fadr", "fadl", "fadt", "fab", "fass", "fasr", "fasl", "fast", "fasds", "fasdr", "fasdl", "fasdt", ...r$1, ...x],
  m$1 = ["solid", "regular", "light", "thin", "duotone", "brands"],
  c$1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
  F$1 = c$1.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]),
  Fo = [...Object.keys(I$1), ...m$1, "2xs", "xs", "sm", "lg", "xl", "2xl", "beat", "border", "fade", "beat-fade", "bounce", "flip-both", "flip-horizontal", "flip-vertical", "flip", "fw", "inverse", "layers-counter", "layers-text", "layers", "li", "pull-left", "pull-right", "pulse", "rotate-180", "rotate-270", "rotate-90", "rotate-by", "shake", "spin-pulse", "spin-reverse", "spin", "stack-1x", "stack-2x", "stack", "ul", t$1.GROUP, t$1.SWAP_OPACITY, t$1.PRIMARY, t$1.SECONDARY].concat(c$1.map(o => "".concat(o, "x"))).concat(F$1.map(o => "w-".concat(o)));
var ko = {
    "Font Awesome 5 Free": {
      900: "fas",
      400: "far"
    },
    "Font Awesome 5 Pro": {
      900: "fas",
      400: "far",
      normal: "far",
      300: "fal"
    },
    "Font Awesome 5 Brands": {
      400: "fab",
      normal: "fab"
    },
    "Font Awesome 5 Duotone": {
      900: "fad"
    }
  };

const NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
const UNITS_IN_GRID = 16;
const DEFAULT_CSS_PREFIX = 'fa';
const DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
const DATA_FA_I2SVG = 'data-fa-i2svg';
const DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
const DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
const DATA_PREFIX = 'data-prefix';
const DATA_ICON = 'data-icon';
const HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
const MUTATION_APPROACH_ASYNC = 'async';
const TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
const PRODUCTION = (() => {
  try {
    return "development" === 'production';
  } catch (e$$1) {
    return false;
  }
})();
function familyProxy(obj) {
  // Defaults to the classic family if family is not available
  return new Proxy(obj, {
    get(target, prop) {
      return prop in target ? target[prop] : target[s];
    }
  });
}
const _PREFIX_TO_STYLE = _objectSpread2({}, S);

// We changed FACSSClassesToStyleId in the icons repo to be canonical and as such, "classic" family does not have any
// duotone styles.  But we do still need duotone in _PREFIX_TO_STYLE below, so we are manually adding
// {'fa-duotone': 'duotone'}
_PREFIX_TO_STYLE[s] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
  'fa-duotone': 'duotone'
}), S[s]), St['kit']), St['kit-duotone']);
const PREFIX_TO_STYLE = familyProxy(_PREFIX_TO_STYLE);
const _STYLE_TO_PREFIX = _objectSpread2({}, xt);

// We changed FAStyleIdToShortPrefixId in the icons repo to be canonical and as such, "classic" family does not have any
// duotone styles.  But we do still need duotone in _STYLE_TO_PREFIX below, so we are manually adding {duotone: 'fad'}
_STYLE_TO_PREFIX[s] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
  duotone: 'fad'
}), _STYLE_TO_PREFIX[s]), Et['kit']), Et['kit-duotone']);
const STYLE_TO_PREFIX = familyProxy(_STYLE_TO_PREFIX);
const _PREFIX_TO_LONG_STYLE = _objectSpread2({}, co);
_PREFIX_TO_LONG_STYLE[s] = _objectSpread2(_objectSpread2({}, _PREFIX_TO_LONG_STYLE[s]), Wt['kit']);
const PREFIX_TO_LONG_STYLE = familyProxy(_PREFIX_TO_LONG_STYLE);
const _LONG_STYLE_TO_PREFIX = _objectSpread2({}, po);
_LONG_STYLE_TO_PREFIX[s] = _objectSpread2(_objectSpread2({}, _LONG_STYLE_TO_PREFIX[s]), Ct['kit']);
const LONG_STYLE_TO_PREFIX = familyProxy(_LONG_STYLE_TO_PREFIX);
const ICON_SELECTION_SYNTAX_PATTERN = p; // eslint-disable-line no-useless-escape

const LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
const FONT_FAMILY_PATTERN = g;
const _FONT_WEIGHT_TO_PREFIX = _objectSpread2({}, G);
const FONT_WEIGHT_TO_PREFIX = familyProxy(_FONT_WEIGHT_TO_PREFIX);
const ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
const DUOTONE_CLASSES = A;
const RESERVED_CLASSES = [...At, ...Fo];

const initial = WINDOW.FontAwesomeConfig || {};
function getAttrConfig(attr) {
  var element = DOCUMENT.querySelector('script[' + attr + ']');
  if (element) {
    return element.getAttribute(attr);
  }
}
function coerce(val) {
  // Getting an empty string will occur if the attribute is set on the HTML tag but without a value
  // We'll assume that this is an indication that it should be toggled to true
  if (val === '') return true;
  if (val === 'false') return false;
  if (val === 'true') return true;
  return val;
}
if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
  const attrs = [['data-family-prefix', 'familyPrefix'], ['data-css-prefix', 'cssPrefix'], ['data-family-default', 'familyDefault'], ['data-style-default', 'styleDefault'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];
  attrs.forEach(_ref => {
    let [attr, key] = _ref;
    const val = coerce(getAttrConfig(attr));
    if (val !== undefined && val !== null) {
      initial[key] = val;
    }
  });
}
const _default = {
  styleDefault: 'solid',
  familyDefault: s,
  cssPrefix: DEFAULT_CSS_PREFIX,
  replacementClass: DEFAULT_REPLACEMENT_CLASS,
  autoReplaceSvg: true,
  autoAddCss: true,
  autoA11y: true,
  searchPseudoElements: false,
  observeMutations: true,
  mutateApproach: 'async',
  keepOriginalSource: true,
  measurePerformance: false,
  showMissingIcons: true
};

// familyPrefix is deprecated but we must still support it if present
if (initial.familyPrefix) {
  initial.cssPrefix = initial.familyPrefix;
}
const _config = _objectSpread2(_objectSpread2({}, _default), initial);
if (!_config.autoReplaceSvg) _config.observeMutations = false;
const config = {};
Object.keys(_default).forEach(key => {
  Object.defineProperty(config, key, {
    enumerable: true,
    set: function (val) {
      _config[key] = val;
      _onChangeCb.forEach(cb => cb(config));
    },
    get: function () {
      return _config[key];
    }
  });
});

// familyPrefix is deprecated as of 6.2.0 and should be removed in 7.0.0
Object.defineProperty(config, 'familyPrefix', {
  enumerable: true,
  set: function (val) {
    _config.cssPrefix = val;
    _onChangeCb.forEach(cb => cb(config));
  },
  get: function () {
    return _config.cssPrefix;
  }
});
WINDOW.FontAwesomeConfig = config;
const _onChangeCb = [];
function onChange(cb) {
  _onChangeCb.push(cb);
  return () => {
    _onChangeCb.splice(_onChangeCb.indexOf(cb), 1);
  };
}

const d$2 = UNITS_IN_GRID;
const meaninglessTransform = {
  size: 16,
  x: 0,
  y: 0,
  rotate: 0,
  flipX: false,
  flipY: false
};
function insertCss(css) {
  if (!css || !IS_DOM) {
    return;
  }
  const style = DOCUMENT.createElement('style');
  style.setAttribute('type', 'text/css');
  style.innerHTML = css;
  const headChildren = DOCUMENT.head.childNodes;
  let beforeChild = null;
  for (let i = headChildren.length - 1; i > -1; i--) {
    const child = headChildren[i];
    const tagName = (child.tagName || '').toUpperCase();
    if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
      beforeChild = child;
    }
  }
  DOCUMENT.head.insertBefore(style, beforeChild);
  return css;
}
const idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
function nextUniqueId() {
  let size = 12;
  let id = '';
  while (size-- > 0) {
    id += idPool[Math.random() * 62 | 0];
  }
  return id;
}
function toArray(obj) {
  const array = [];
  for (let i = (obj || []).length >>> 0; i--;) {
    array[i] = obj[i];
  }
  return array;
}
function classArray(node) {
  if (node.classList) {
    return toArray(node.classList);
  } else {
    return (node.getAttribute('class') || '').split(' ').filter(i => i);
  }
}
function htmlEscape(str) {
  return "".concat(str).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
function joinAttributes(attributes) {
  return Object.keys(attributes || {}).reduce((acc, attributeName) => {
    return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
  }, '').trim();
}
function joinStyles(styles) {
  return Object.keys(styles || {}).reduce((acc, styleName) => {
    return acc + "".concat(styleName, ": ").concat(styles[styleName].trim(), ";");
  }, '');
}
function transformIsMeaningful(transform) {
  return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
}
function transformForSvg(_ref) {
  let {
    transform,
    containerWidth,
    iconWidth
  } = _ref;
  const outer = {
    transform: "translate(".concat(containerWidth / 2, " 256)")
  };
  const innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
  const innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
  const innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
  const inner = {
    transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
  };
  const path = {
    transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
  };
  return {
    outer,
    inner,
    path
  };
}
function transformForCss(_ref2) {
  let {
    transform,
    width = UNITS_IN_GRID,
    height = UNITS_IN_GRID,
    startCentered = false
  } = _ref2;
  let val = '';
  if (startCentered && IS_IE) {
    val += "translate(".concat(transform.x / d$2 - width / 2, "em, ").concat(transform.y / d$2 - height / 2, "em) ");
  } else if (startCentered) {
    val += "translate(calc(-50% + ".concat(transform.x / d$2, "em), calc(-50% + ").concat(transform.y / d$2, "em)) ");
  } else {
    val += "translate(".concat(transform.x / d$2, "em, ").concat(transform.y / d$2, "em) ");
  }
  val += "scale(".concat(transform.size / d$2 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d$2 * (transform.flipY ? -1 : 1), ") ");
  val += "rotate(".concat(transform.rotate, "deg) ");
  return val;
}

var baseStyles = ":root, :host {\n  --fa-font-solid: normal 900 1em/1 \"Font Awesome 6 Free\";\n  --fa-font-regular: normal 400 1em/1 \"Font Awesome 6 Free\";\n  --fa-font-light: normal 300 1em/1 \"Font Awesome 6 Pro\";\n  --fa-font-thin: normal 100 1em/1 \"Font Awesome 6 Pro\";\n  --fa-font-duotone: normal 900 1em/1 \"Font Awesome 6 Duotone\";\n  --fa-font-duotone-regular: normal 400 1em/1 \"Font Awesome 6 Duotone\";\n  --fa-font-duotone-light: normal 300 1em/1 \"Font Awesome 6 Duotone\";\n  --fa-font-duotone-thin: normal 100 1em/1 \"Font Awesome 6 Duotone\";\n  --fa-font-brands: normal 400 1em/1 \"Font Awesome 6 Brands\";\n  --fa-font-sharp-solid: normal 900 1em/1 \"Font Awesome 6 Sharp\";\n  --fa-font-sharp-regular: normal 400 1em/1 \"Font Awesome 6 Sharp\";\n  --fa-font-sharp-light: normal 300 1em/1 \"Font Awesome 6 Sharp\";\n  --fa-font-sharp-thin: normal 100 1em/1 \"Font Awesome 6 Sharp\";\n  --fa-font-sharp-duotone-solid: normal 900 1em/1 \"Font Awesome 6 Sharp Duotone\";\n  --fa-font-sharp-duotone-regular: normal 400 1em/1 \"Font Awesome 6 Sharp Duotone\";\n  --fa-font-sharp-duotone-light: normal 300 1em/1 \"Font Awesome 6 Sharp Duotone\";\n  --fa-font-sharp-duotone-thin: normal 100 1em/1 \"Font Awesome 6 Sharp Duotone\";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n  overflow: visible;\n  box-sizing: content-box;\n}\n\n.svg-inline--fa {\n  display: var(--fa-display, inline-block);\n  height: 1em;\n  overflow: visible;\n  vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n  vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n  vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n  vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n  vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n  vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n  vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n  margin-right: var(--fa-pull-margin, 0.3em);\n  width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n  margin-left: var(--fa-pull-margin, 0.3em);\n  width: auto;\n}\n.svg-inline--fa.fa-li {\n  width: var(--fa-li-width, 2em);\n  top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n  width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n  display: inline-block;\n  position: absolute;\n  text-align: center;\n}\n\n.fa-layers {\n  display: inline-block;\n  height: 1em;\n  position: relative;\n  text-align: center;\n  vertical-align: -0.125em;\n  width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n  transform-origin: center center;\n}\n\n.fa-layers-text {\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  transform-origin: center center;\n}\n\n.fa-layers-counter {\n  background-color: var(--fa-counter-background-color, #ff253a);\n  border-radius: var(--fa-counter-border-radius, 1em);\n  box-sizing: border-box;\n  color: var(--fa-inverse, #fff);\n  line-height: var(--fa-counter-line-height, 1);\n  max-width: var(--fa-counter-max-width, 5em);\n  min-width: var(--fa-counter-min-width, 1.5em);\n  overflow: hidden;\n  padding: var(--fa-counter-padding, 0.25em 0.5em);\n  right: var(--fa-right, 0);\n  text-overflow: ellipsis;\n  top: var(--fa-top, 0);\n  transform: scale(var(--fa-counter-scale, 0.25));\n  transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n  bottom: var(--fa-bottom, 0);\n  right: var(--fa-right, 0);\n  top: auto;\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n  bottom: var(--fa-bottom, 0);\n  left: var(--fa-left, 0);\n  right: auto;\n  top: auto;\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n  top: var(--fa-top, 0);\n  right: var(--fa-right, 0);\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: top right;\n}\n\n.fa-layers-top-left {\n  left: var(--fa-left, 0);\n  right: auto;\n  top: var(--fa-top, 0);\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: top left;\n}\n\n.fa-1x {\n  font-size: 1em;\n}\n\n.fa-2x {\n  font-size: 2em;\n}\n\n.fa-3x {\n  font-size: 3em;\n}\n\n.fa-4x {\n  font-size: 4em;\n}\n\n.fa-5x {\n  font-size: 5em;\n}\n\n.fa-6x {\n  font-size: 6em;\n}\n\n.fa-7x {\n  font-size: 7em;\n}\n\n.fa-8x {\n  font-size: 8em;\n}\n\n.fa-9x {\n  font-size: 9em;\n}\n\n.fa-10x {\n  font-size: 10em;\n}\n\n.fa-2xs {\n  font-size: 0.625em;\n  line-height: 0.1em;\n  vertical-align: 0.225em;\n}\n\n.fa-xs {\n  font-size: 0.75em;\n  line-height: 0.0833333337em;\n  vertical-align: 0.125em;\n}\n\n.fa-sm {\n  font-size: 0.875em;\n  line-height: 0.0714285718em;\n  vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n  font-size: 1.25em;\n  line-height: 0.05em;\n  vertical-align: -0.075em;\n}\n\n.fa-xl {\n  font-size: 1.5em;\n  line-height: 0.0416666682em;\n  vertical-align: -0.125em;\n}\n\n.fa-2xl {\n  font-size: 2em;\n  line-height: 0.03125em;\n  vertical-align: -0.1875em;\n}\n\n.fa-fw {\n  text-align: center;\n  width: 1.25em;\n}\n\n.fa-ul {\n  list-style-type: none;\n  margin-left: var(--fa-li-margin, 2.5em);\n  padding-left: 0;\n}\n.fa-ul > li {\n  position: relative;\n}\n\n.fa-li {\n  left: calc(-1 * var(--fa-li-width, 2em));\n  position: absolute;\n  text-align: center;\n  width: var(--fa-li-width, 2em);\n  line-height: inherit;\n}\n\n.fa-border {\n  border-color: var(--fa-border-color, #eee);\n  border-radius: var(--fa-border-radius, 0.1em);\n  border-style: var(--fa-border-style, solid);\n  border-width: var(--fa-border-width, 0.08em);\n  padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n  float: left;\n  margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n  float: right;\n  margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n  animation-name: fa-beat;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n  animation-name: fa-bounce;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n  animation-name: fa-fade;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n  animation-name: fa-beat-fade;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n  animation-name: fa-flip;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n  animation-name: fa-shake;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n  animation-name: fa-spin;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 2s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n  --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n  animation-name: fa-spin;\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n    animation-delay: -1ms;\n    animation-duration: 1ms;\n    animation-iteration-count: 1;\n    transition-delay: 0s;\n    transition-duration: 0s;\n  }\n}\n@keyframes fa-beat {\n  0%, 90% {\n    transform: scale(1);\n  }\n  45% {\n    transform: scale(var(--fa-beat-scale, 1.25));\n  }\n}\n@keyframes fa-bounce {\n  0% {\n    transform: scale(1, 1) translateY(0);\n  }\n  10% {\n    transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n  }\n  30% {\n    transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n  }\n  50% {\n    transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n  }\n  57% {\n    transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n  }\n  64% {\n    transform: scale(1, 1) translateY(0);\n  }\n  100% {\n    transform: scale(1, 1) translateY(0);\n  }\n}\n@keyframes fa-fade {\n  50% {\n    opacity: var(--fa-fade-opacity, 0.4);\n  }\n}\n@keyframes fa-beat-fade {\n  0%, 100% {\n    opacity: var(--fa-beat-fade-opacity, 0.4);\n    transform: scale(1);\n  }\n  50% {\n    opacity: 1;\n    transform: scale(var(--fa-beat-fade-scale, 1.125));\n  }\n}\n@keyframes fa-flip {\n  50% {\n    transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n  }\n}\n@keyframes fa-shake {\n  0% {\n    transform: rotate(-15deg);\n  }\n  4% {\n    transform: rotate(15deg);\n  }\n  8%, 24% {\n    transform: rotate(-18deg);\n  }\n  12%, 28% {\n    transform: rotate(18deg);\n  }\n  16% {\n    transform: rotate(-22deg);\n  }\n  20% {\n    transform: rotate(22deg);\n  }\n  32% {\n    transform: rotate(-12deg);\n  }\n  36% {\n    transform: rotate(12deg);\n  }\n  40%, 100% {\n    transform: rotate(0deg);\n  }\n}\n@keyframes fa-spin {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n.fa-rotate-90 {\n  transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n  transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n  transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n  transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n  transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n  transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n  transform: rotate(var(--fa-rotate-angle, 0));\n}\n\n.fa-stack {\n  display: inline-block;\n  vertical-align: middle;\n  height: 2em;\n  position: relative;\n  width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n  z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n  height: 1em;\n  width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n  height: 2em;\n  width: 2.5em;\n}\n\n.fa-inverse {\n  color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n  fill: var(--fa-primary-color, currentColor);\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n  fill: var(--fa-secondary-color, currentColor);\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n  fill: black;\n}";

function css() {
  const dcp = DEFAULT_CSS_PREFIX;
  const drc = DEFAULT_REPLACEMENT_CLASS;
  const fp = config.cssPrefix;
  const rc = config.replacementClass;
  let s = baseStyles;
  if (fp !== dcp || rc !== drc) {
    const dPatt = new RegExp("\\.".concat(dcp, "\\-"), 'g');
    const customPropPatt = new RegExp("\\--".concat(dcp, "\\-"), 'g');
    const rPatt = new RegExp("\\.".concat(drc), 'g');
    s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
  }
  return s;
}
let _cssInserted = false;
function ensureCss() {
  if (config.autoAddCss && !_cssInserted) {
    insertCss(css());
    _cssInserted = true;
  }
}
var InjectCSS = {
  mixout() {
    return {
      dom: {
        css,
        insertCss: ensureCss
      }
    };
  },
  hooks() {
    return {
      beforeDOMElementCreation() {
        ensureCss();
      },
      beforeI2svg() {
        ensureCss();
      }
    };
  }
};

const w = WINDOW || {};
if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
var namespace = w[NAMESPACE_IDENTIFIER];

const functions = [];
const listener = function () {
  DOCUMENT.removeEventListener('DOMContentLoaded', listener);
  loaded = 1;
  functions.map(fn => fn());
};
let loaded = false;
if (IS_DOM) {
  loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
  if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
}
function domready (fn) {
  if (!IS_DOM) return;
  loaded ? setTimeout(fn, 0) : functions.push(fn);
}

function toHtml(abstractNodes) {
  const {
    tag,
    attributes = {},
    children = []
  } = abstractNodes;
  if (typeof abstractNodes === 'string') {
    return htmlEscape(abstractNodes);
  } else {
    return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
  }
}

function iconFromMapping(mapping, prefix, iconName) {
  if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
    return {
      prefix,
      iconName,
      icon: mapping[prefix][iconName]
    };
  }
}

/**
 * Internal helper to bind a function known to have 4 arguments
 * to a given context.
 */
var bindInternal4 = function bindInternal4(func, thisContext) {
  return function (a, b, c, d) {
    return func.call(thisContext, a, b, c, d);
  };
};

/**
 * # Reduce
 *
 * A fast object `.reduce()` implementation.
 *
 * @param  {Object}   subject      The object to reduce over.
 * @param  {Function} fn           The reducer function.
 * @param  {mixed}    initialValue The initial value for the reducer, defaults to subject[0].
 * @param  {Object}   thisContext  The context for the reducer.
 * @return {mixed}                 The final result.
 */
var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
  var keys = Object.keys(subject),
    length = keys.length,
    iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
    i,
    key,
    result;
  if (initialValue === undefined) {
    i = 1;
    result = subject[keys[0]];
  } else {
    i = 0;
    result = initialValue;
  }
  for (; i < length; i++) {
    key = keys[i];
    result = iterator(result, subject[key], key, subject);
  }
  return result;
};

/**
 * ucs2decode() and codePointAt() are both works of Mathias Bynens and licensed under MIT
 *
 * Copyright Mathias Bynens <https://mathiasbynens.be/>

 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:

 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

function ucs2decode(string) {
  const output = [];
  let counter = 0;
  const length = string.length;
  while (counter < length) {
    const value = string.charCodeAt(counter++);
    if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
      const extra = string.charCodeAt(counter++);
      if ((extra & 0xFC00) == 0xDC00) {
        // eslint-disable-line eqeqeq
        output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
      } else {
        output.push(value);
        counter--;
      }
    } else {
      output.push(value);
    }
  }
  return output;
}
function toHex(unicode) {
  const decoded = ucs2decode(unicode);
  return decoded.length === 1 ? decoded[0].toString(16) : null;
}
function codePointAt(string, index) {
  const size = string.length;
  let first = string.charCodeAt(index);
  let second;
  if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
    second = string.charCodeAt(index + 1);
    if (second >= 0xDC00 && second <= 0xDFFF) {
      return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
    }
  }
  return first;
}

function normalizeIcons(icons) {
  return Object.keys(icons).reduce((acc, iconName) => {
    const icon = icons[iconName];
    const expanded = !!icon.icon;
    if (expanded) {
      acc[icon.iconName] = icon.icon;
    } else {
      acc[iconName] = icon;
    }
    return acc;
  }, {});
}
function defineIcons(prefix, icons) {
  let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  const {
    skipHooks = false
  } = params;
  const normalized = normalizeIcons(icons);
  if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
    namespace.hooks.addPack(prefix, normalizeIcons(icons));
  } else {
    namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), normalized);
  }

  /**
   * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
   * of new styles we needed to differentiate between them. Prefix `fa` is now an alias
   * for `fas` so we'll ease the upgrade process for our users by automatically defining
   * this as well.
   */
  if (prefix === 'fas') {
    defineIcons('fa', icons);
  }
}

const duotonePathRe = [/*#__PURE__*/_wrapRegExp(/path d="([^"]+)".*path d="([^"]+)"/, {
  d1: 1,
  d2: 2
}), /*#__PURE__*/_wrapRegExp(/path class="([^"]+)".*d="([^"]+)".*path class="([^"]+)".*d="([^"]+)"/, {
  cls1: 1,
  d1: 2,
  cls2: 3,
  d2: 4
}), /*#__PURE__*/_wrapRegExp(/path class="([^"]+)".*d="([^"]+)"/, {
  cls1: 1,
  d1: 2
})];

const {
  styles,
  shims
} = namespace;
const FAMILY_NAMES = Object.keys(PREFIX_TO_LONG_STYLE);
const PREFIXES_FOR_FAMILY = FAMILY_NAMES.reduce((acc, familyId) => {
  acc[familyId] = Object.keys(PREFIX_TO_LONG_STYLE[familyId]);
  return acc;
}, {});
let _defaultUsablePrefix = null;
let _byUnicode = {};
let _byLigature = {};
let _byOldName = {};
let _byOldUnicode = {};
let _byAlias = {};
function isReserved(name) {
  return ~RESERVED_CLASSES.indexOf(name);
}
function getIconName(cssPrefix, cls) {
  const parts = cls.split('-');
  const prefix = parts[0];
  const iconName = parts.slice(1).join('-');
  if (prefix === cssPrefix && iconName !== '' && !isReserved(iconName)) {
    return iconName;
  } else {
    return null;
  }
}
const build = () => {
  const lookup = reducer => {
    return reduce(styles, (o$$1, style, prefix) => {
      o$$1[prefix] = reduce(style, reducer, {});
      return o$$1;
    }, {});
  };
  _byUnicode = lookup((acc, icon, iconName) => {
    if (icon[3]) {
      acc[icon[3]] = iconName;
    }
    if (icon[2]) {
      const aliases = icon[2].filter(a$$1 => {
        return typeof a$$1 === 'number';
      });
      aliases.forEach(alias => {
        acc[alias.toString(16)] = iconName;
      });
    }
    return acc;
  });
  _byLigature = lookup((acc, icon, iconName) => {
    acc[iconName] = iconName;
    if (icon[2]) {
      const aliases = icon[2].filter(a$$1 => {
        return typeof a$$1 === 'string';
      });
      aliases.forEach(alias => {
        acc[alias] = iconName;
      });
    }
    return acc;
  });
  _byAlias = lookup((acc, icon, iconName) => {
    const aliases = icon[2];
    acc[iconName] = iconName;
    aliases.forEach(alias => {
      acc[alias] = iconName;
    });
    return acc;
  });

  // If we have a Kit, we can't determine if regular is available since we
  // could be auto-fetching it. We'll have to assume that it is available.
  const hasRegular = 'far' in styles || config.autoFetchSvg;
  const shimLookups = reduce(shims, (acc, shim) => {
    const maybeNameMaybeUnicode = shim[0];
    let prefix = shim[1];
    const iconName = shim[2];
    if (prefix === 'far' && !hasRegular) {
      prefix = 'fas';
    }
    if (typeof maybeNameMaybeUnicode === 'string') {
      acc.names[maybeNameMaybeUnicode] = {
        prefix,
        iconName
      };
    }
    if (typeof maybeNameMaybeUnicode === 'number') {
      acc.unicodes[maybeNameMaybeUnicode.toString(16)] = {
        prefix,
        iconName
      };
    }
    return acc;
  }, {
    names: {},
    unicodes: {}
  });
  _byOldName = shimLookups.names;
  _byOldUnicode = shimLookups.unicodes;
  _defaultUsablePrefix = getCanonicalPrefix(config.styleDefault, {
    family: config.familyDefault
  });
};
onChange(c$$1 => {
  _defaultUsablePrefix = getCanonicalPrefix(c$$1.styleDefault, {
    family: config.familyDefault
  });
});
build();
function byUnicode(prefix, unicode) {
  return (_byUnicode[prefix] || {})[unicode];
}
function byLigature(prefix, ligature) {
  return (_byLigature[prefix] || {})[ligature];
}
function byAlias(prefix, alias) {
  return (_byAlias[prefix] || {})[alias];
}
function byOldName(name) {
  return _byOldName[name] || {
    prefix: null,
    iconName: null
  };
}
function byOldUnicode(unicode) {
  const oldUnicode = _byOldUnicode[unicode];
  const newUnicode = byUnicode('fas', unicode);
  return oldUnicode || (newUnicode ? {
    prefix: 'fas',
    iconName: newUnicode
  } : null) || {
    prefix: null,
    iconName: null
  };
}
function getDefaultUsablePrefix() {
  return _defaultUsablePrefix;
}
const emptyCanonicalIcon = () => {
  return {
    prefix: null,
    iconName: null,
    rest: []
  };
};
function getFamilyId(values) {
  let family = s;
  const famProps = FAMILY_NAMES.reduce((acc, familyId) => {
    acc[familyId] = "".concat(config.cssPrefix, "-").concat(familyId);
    return acc;
  }, {});
  L.forEach(familyId => {
    if (values.includes(famProps[familyId]) || values.some(v$$1 => PREFIXES_FOR_FAMILY[familyId].includes(v$$1))) {
      family = familyId;
    }
  });
  return family;
}
function getCanonicalPrefix(styleOrPrefix) {
  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  const {
    family = s
  } = params;
  const style = PREFIX_TO_STYLE[family][styleOrPrefix];

  // handles the exception of passing in only a family of 'duotone' with no style
  if (family === t && !styleOrPrefix) {
    return 'fad';
  }
  const prefix = STYLE_TO_PREFIX[family][styleOrPrefix] || STYLE_TO_PREFIX[family][style];
  const defined = styleOrPrefix in namespace.styles ? styleOrPrefix : null;
  const result = prefix || defined || null;
  return result;
}
function moveNonFaClassesToRest(classNames) {
  let rest = [];
  let iconName = null;
  classNames.forEach(cls => {
    const result = getIconName(config.cssPrefix, cls);
    if (result) {
      iconName = result;
    } else if (cls) {
      rest.push(cls);
    }
  });
  return {
    iconName,
    rest
  };
}
function sortedUniqueValues(arr) {
  return arr.sort().filter((value, index, arr) => {
    return arr.indexOf(value) === index;
  });
}
function getCanonicalIcon(values) {
  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  const {
    skipLookups = false
  } = params;
  let givenPrefix = null;
  const faCombinedClasses = xo.concat(bt$1);
  const faStyleOrFamilyClasses = sortedUniqueValues(values.filter(cls => faCombinedClasses.includes(cls)));
  const nonStyleOrFamilyClasses = sortedUniqueValues(values.filter(cls => !xo.includes(cls)));
  const faStyles = faStyleOrFamilyClasses.filter(cls => {
    givenPrefix = cls;
    return !P.includes(cls);
  });
  const [styleFromValues = null] = faStyles;
  const family = getFamilyId(faStyleOrFamilyClasses);
  const canonical = _objectSpread2(_objectSpread2({}, moveNonFaClassesToRest(nonStyleOrFamilyClasses)), {}, {
    prefix: getCanonicalPrefix(styleFromValues, {
      family
    })
  });
  return _objectSpread2(_objectSpread2(_objectSpread2({}, canonical), getDefaultCanonicalPrefix({
    values,
    family,
    styles,
    config,
    canonical,
    givenPrefix
  })), applyShimAndAlias(skipLookups, givenPrefix, canonical));
}
function applyShimAndAlias(skipLookups, givenPrefix, canonical) {
  let {
    prefix,
    iconName
  } = canonical;
  if (skipLookups || !prefix || !iconName) {
    return {
      prefix,
      iconName
    };
  }
  const shim = givenPrefix === 'fa' ? byOldName(iconName) : {};
  const aliasIconName = byAlias(prefix, iconName);
  iconName = shim.iconName || aliasIconName || iconName;
  prefix = shim.prefix || prefix;
  if (prefix === 'far' && !styles['far'] && styles['fas'] && !config.autoFetchSvg) {
    // Allow a fallback from the regular style to solid if regular is not available
    // but only if we aren't auto-fetching SVGs
    prefix = 'fas';
  }
  return {
    prefix,
    iconName
  };
}
const newCanonicalFamilies = L.filter(familyId => {
  return familyId !== s || familyId !== t;
});
const newCanonicalStyles = Object.keys(co).filter(key => key !== s).map(key => Object.keys(co[key])).flat();
function getDefaultCanonicalPrefix(prefixOptions) {
  const {
    values,
    family,
    canonical,
    givenPrefix = '',
    styles = {},
    config: config$$1 = {}
  } = prefixOptions;
  const isDuotoneFamily = family === t;
  const valuesHasDuotone = values.includes('fa-duotone') || values.includes('fad');
  const defaultFamilyIsDuotone = config$$1.familyDefault === 'duotone';
  const canonicalPrefixIsDuotone = canonical.prefix === 'fad' || canonical.prefix === 'fa-duotone';
  if (!isDuotoneFamily && (valuesHasDuotone || defaultFamilyIsDuotone || canonicalPrefixIsDuotone)) {
    canonical.prefix = 'fad';
  }
  if (values.includes('fa-brands') || values.includes('fab')) {
    canonical.prefix = 'fab';
  }
  if (!canonical.prefix && newCanonicalFamilies.includes(family)) {
    const validPrefix = Object.keys(styles).find(key => newCanonicalStyles.includes(key));
    if (validPrefix || config$$1.autoFetchSvg) {
      const defaultPrefix = pt.get(family).defaultShortPrefixId;
      canonical.prefix = defaultPrefix;
      canonical.iconName = byAlias(canonical.prefix, canonical.iconName) || canonical.iconName;
    }
  }
  if (canonical.prefix === 'fa' || givenPrefix === 'fa') {
    // The fa prefix is not canonical. So if it has made it through until this point
    // we will shift it to the correct prefix.
    canonical.prefix = getDefaultUsablePrefix() || 'fas';
  }
  return canonical;
}

class Library {
  constructor() {
    this.definitions = {};
  }
  add() {
    for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
      definitions[_key] = arguments[_key];
    }
    const additions = definitions.reduce(this._pullDefinitions, {});
    Object.keys(additions).forEach(key => {
      this.definitions[key] = _objectSpread2(_objectSpread2({}, this.definitions[key] || {}), additions[key]);
      defineIcons(key, additions[key]);

      // TODO can we stop doing this? We can't get the icons by 'fa-solid' any longer so this probably needs to change
      const longPrefix = PREFIX_TO_LONG_STYLE[s][key];
      if (longPrefix) defineIcons(longPrefix, additions[key]);
      build();
    });
  }
  reset() {
    this.definitions = {};
  }
  _pullDefinitions(additions, definition) {
    const normalized = definition.prefix && definition.iconName && definition.icon ? {
      0: definition
    } : definition;
    Object.keys(normalized).map(key => {
      const {
        prefix,
        iconName,
        icon
      } = normalized[key];
      const aliases = icon[2];
      if (!additions[prefix]) additions[prefix] = {};
      if (aliases.length > 0) {
        aliases.forEach(alias => {
          if (typeof alias === 'string') {
            additions[prefix][alias] = icon;
          }
        });
      }
      additions[prefix][iconName] = icon;
    });
    return additions;
  }
}

let _plugins = [];
let _hooks = {};
const providers = {};
const defaultProviderKeys = Object.keys(providers);
function registerPlugins(nextPlugins, _ref) {
  let {
    mixoutsTo: obj
  } = _ref;
  _plugins = nextPlugins;
  _hooks = {};
  Object.keys(providers).forEach(k => {
    if (defaultProviderKeys.indexOf(k) === -1) {
      delete providers[k];
    }
  });
  _plugins.forEach(plugin => {
    const mixout = plugin.mixout ? plugin.mixout() : {};
    Object.keys(mixout).forEach(tk => {
      if (typeof mixout[tk] === 'function') {
        obj[tk] = mixout[tk];
      }
      if (typeof mixout[tk] === 'object') {
        Object.keys(mixout[tk]).forEach(sk => {
          if (!obj[tk]) {
            obj[tk] = {};
          }
          obj[tk][sk] = mixout[tk][sk];
        });
      }
    });
    if (plugin.hooks) {
      const hooks = plugin.hooks();
      Object.keys(hooks).forEach(hook => {
        if (!_hooks[hook]) {
          _hooks[hook] = [];
        }
        _hooks[hook].push(hooks[hook]);
      });
    }
    if (plugin.provides) {
      plugin.provides(providers);
    }
  });
  return obj;
}
function chainHooks(hook, accumulator) {
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    args[_key - 2] = arguments[_key];
  }
  const hookFns = _hooks[hook] || [];
  hookFns.forEach(hookFn => {
    accumulator = hookFn.apply(null, [accumulator, ...args]); // eslint-disable-line no-useless-call
  });
  return accumulator;
}
function callHooks(hook) {
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
    args[_key2 - 1] = arguments[_key2];
  }
  const hookFns = _hooks[hook] || [];
  hookFns.forEach(hookFn => {
    hookFn.apply(null, args);
  });
  return undefined;
}
function callProvided() {
  const hook = arguments[0];
  const args = Array.prototype.slice.call(arguments, 1);
  return providers[hook] ? providers[hook].apply(null, args) : undefined;
}

function findIconDefinition(iconLookup) {
  if (iconLookup.prefix === 'fa') {
    iconLookup.prefix = 'fas';
  }
  let {
    iconName
  } = iconLookup;
  const prefix = iconLookup.prefix || getDefaultUsablePrefix();
  if (!iconName) return;
  iconName = byAlias(prefix, iconName) || iconName;
  return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
}
const library = new Library();
const noAuto = () => {
  config.autoReplaceSvg = false;
  config.observeMutations = false;
  callHooks('noAuto');
};
const dom = {
  i2svg: function () {
    let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    if (IS_DOM) {
      callHooks('beforeI2svg', params);
      callProvided('pseudoElements2svg', params);
      return callProvided('i2svg', params);
    } else {
      return Promise.reject(new Error('Operation requires a DOM of some kind.'));
    }
  },
  watch: function () {
    let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    const {
      autoReplaceSvgRoot
    } = params;
    if (config.autoReplaceSvg === false) {
      config.autoReplaceSvg = true;
    }
    config.observeMutations = true;
    domready(() => {
      autoReplace({
        autoReplaceSvgRoot
      });
      callHooks('watch', params);
    });
  }
};
const parse = {
  icon: icon => {
    if (icon === null) {
      return null;
    }
    if (typeof icon === 'object' && icon.prefix && icon.iconName) {
      return {
        prefix: icon.prefix,
        iconName: byAlias(icon.prefix, icon.iconName) || icon.iconName
      };
    }
    if (Array.isArray(icon) && icon.length === 2) {
      const iconName = icon[1].indexOf('fa-') === 0 ? icon[1].slice(3) : icon[1];
      const prefix = getCanonicalPrefix(icon[0]);
      return {
        prefix,
        iconName: byAlias(prefix, iconName) || iconName
      };
    }
    if (typeof icon === 'string' && (icon.indexOf("".concat(config.cssPrefix, "-")) > -1 || icon.match(ICON_SELECTION_SYNTAX_PATTERN))) {
      const canonicalIcon = getCanonicalIcon(icon.split(' '), {
        skipLookups: true
      });
      return {
        prefix: canonicalIcon.prefix || getDefaultUsablePrefix(),
        iconName: byAlias(canonicalIcon.prefix, canonicalIcon.iconName) || canonicalIcon.iconName
      };
    }
    if (typeof icon === 'string') {
      const prefix = getDefaultUsablePrefix();
      return {
        prefix,
        iconName: byAlias(prefix, icon) || icon
      };
    }
  }
};
const api = {
  noAuto,
  config,
  dom,
  parse,
  library,
  findIconDefinition,
  toHtml
};
const autoReplace = function () {
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const {
    autoReplaceSvgRoot = DOCUMENT
  } = params;
  if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({
    node: autoReplaceSvgRoot
  });
};

function domVariants(val, abstractCreator) {
  Object.defineProperty(val, 'abstract', {
    get: abstractCreator
  });
  Object.defineProperty(val, 'html', {
    get: function () {
      return val.abstract.map(a => toHtml(a));
    }
  });
  Object.defineProperty(val, 'node', {
    get: function () {
      if (!IS_DOM) return;
      const container = DOCUMENT.createElement('div');
      container.innerHTML = val.html;
      return container.children;
    }
  });
  return val;
}

function asIcon (_ref) {
  let {
    children,
    main,
    mask,
    attributes,
    styles,
    transform
  } = _ref;
  if (transformIsMeaningful(transform) && main.found && !mask.found) {
    const {
      width,
      height
    } = main;
    const offset = {
      x: width / height / 2,
      y: 0.5
    };
    attributes['style'] = joinStyles(_objectSpread2(_objectSpread2({}, styles), {}, {
      'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
    }));
  }
  return [{
    tag: 'svg',
    attributes,
    children
  }];
}

function asSymbol (_ref) {
  let {
    prefix,
    iconName,
    children,
    attributes,
    symbol
  } = _ref;
  const id = symbol === true ? "".concat(prefix, "-").concat(config.cssPrefix, "-").concat(iconName) : symbol;
  return [{
    tag: 'svg',
    attributes: {
      style: 'display: none;'
    },
    children: [{
      tag: 'symbol',
      attributes: _objectSpread2(_objectSpread2({}, attributes), {}, {
        id
      }),
      children
    }]
  }];
}

function makeInlineSvgAbstract(params) {
  const {
    icons: {
      main,
      mask
    },
    prefix,
    iconName,
    transform,
    symbol,
    title,
    maskId,
    titleId,
    extra,
    watchable = false
  } = params;
  const {
    width,
    height
  } = mask.found ? mask : main;
  const isUploadedIcon = Lt.includes(prefix);
  const attrClass = [config.replacementClass, iconName ? "".concat(config.cssPrefix, "-").concat(iconName) : ''].filter(c$$1 => extra.classes.indexOf(c$$1) === -1).filter(c$$1 => c$$1 !== '' || !!c$$1).concat(extra.classes).join(' ');
  let content = {
    children: [],
    attributes: _objectSpread2(_objectSpread2({}, extra.attributes), {}, {
      'data-prefix': prefix,
      'data-icon': iconName,
      'class': attrClass,
      'role': extra.attributes.role || 'img',
      'xmlns': 'http://www.w3.org/2000/svg',
      'viewBox': "0 0 ".concat(width, " ").concat(height)
    })
  };
  const uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
    width: "".concat(width / height * 16 * 0.0625, "em")
  } : {};
  if (watchable) {
    content.attributes[DATA_FA_I2SVG] = '';
  }
  if (title) {
    content.children.push({
      tag: 'title',
      attributes: {
        id: content.attributes['aria-labelledby'] || "title-".concat(titleId || nextUniqueId())
      },
      children: [title]
    });
    delete content.attributes.title;
  }
  const args = _objectSpread2(_objectSpread2({}, content), {}, {
    prefix,
    iconName,
    main,
    mask,
    maskId,
    transform,
    symbol,
    styles: _objectSpread2(_objectSpread2({}, uploadedIconWidthStyle), extra.styles)
  });
  const {
    children,
    attributes
  } = mask.found && main.found ? callProvided('generateAbstractMask', args) || {
    children: [],
    attributes: {}
  } : callProvided('generateAbstractIcon', args) || {
    children: [],
    attributes: {}
  };
  args.children = children;
  args.attributes = attributes;
  if (symbol) {
    return asSymbol(args);
  } else {
    return asIcon(args);
  }
}
function makeLayersTextAbstract(params) {
  const {
    content,
    width,
    height,
    transform,
    title,
    extra,
    watchable = false
  } = params;
  const attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
    'title': title
  } : {}), {}, {
    'class': extra.classes.join(' ')
  });
  if (watchable) {
    attributes[DATA_FA_I2SVG] = '';
  }
  const styles = _objectSpread2({}, extra.styles);
  if (transformIsMeaningful(transform)) {
    styles['transform'] = transformForCss({
      transform,
      startCentered: true,
      width,
      height
    });
    styles['-webkit-transform'] = styles['transform'];
  }
  const styleString = joinStyles(styles);
  if (styleString.length > 0) {
    attributes['style'] = styleString;
  }
  const val = [];
  val.push({
    tag: 'span',
    attributes,
    children: [content]
  });
  if (title) {
    val.push({
      tag: 'span',
      attributes: {
        class: 'sr-only'
      },
      children: [title]
    });
  }
  return val;
}
function makeLayersCounterAbstract(params) {
  const {
    content,
    title,
    extra
  } = params;
  const attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
    'title': title
  } : {}), {}, {
    'class': extra.classes.join(' ')
  });
  const styleString = joinStyles(extra.styles);
  if (styleString.length > 0) {
    attributes['style'] = styleString;
  }
  const val = [];
  val.push({
    tag: 'span',
    attributes,
    children: [content]
  });
  if (title) {
    val.push({
      tag: 'span',
      attributes: {
        class: 'sr-only'
      },
      children: [title]
    });
  }
  return val;
}

const {
  styles: styles$1
} = namespace;
function asFoundIcon(icon) {
  const width = icon[0];
  const height = icon[1];
  const [vectorData] = icon.slice(4);
  let element = null;
  if (Array.isArray(vectorData)) {
    element = {
      tag: 'g',
      attributes: {
        class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
      },
      children: [{
        tag: 'path',
        attributes: {
          class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
          fill: 'currentColor',
          d: vectorData[0]
        }
      }, {
        tag: 'path',
        attributes: {
          class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
          fill: 'currentColor',
          d: vectorData[1]
        }
      }]
    };
  } else {
    element = {
      tag: 'path',
      attributes: {
        fill: 'currentColor',
        d: vectorData
      }
    };
  }
  return {
    found: true,
    width,
    height,
    icon: element
  };
}
const missingIconResolutionMixin = {
  found: false,
  width: 512,
  height: 512
};
function maybeNotifyMissing(iconName, prefix) {
  if (!PRODUCTION && !config.showMissingIcons && iconName) {
    console.error("Icon with name \"".concat(iconName, "\" and prefix \"").concat(prefix, "\" is missing."));
  }
}
function findIcon(iconName, prefix) {
  let givenPrefix = prefix;
  if (prefix === 'fa' && config.styleDefault !== null) {
    prefix = getDefaultUsablePrefix();
  }
  return new Promise((resolve, reject) => {
    if (givenPrefix === 'fa') {
      const shim = byOldName(iconName) || {};
      iconName = shim.iconName || iconName;
      prefix = shim.prefix || prefix;
    }
    if (iconName && prefix && styles$1[prefix] && styles$1[prefix][iconName]) {
      const icon = styles$1[prefix][iconName];
      return resolve(asFoundIcon(icon));
    }
    maybeNotifyMissing(iconName, prefix);
    resolve(_objectSpread2(_objectSpread2({}, missingIconResolutionMixin), {}, {
      icon: config.showMissingIcons && iconName ? callProvided('missingIconAbstract') || {} : {}
    }));
  });
}

const noop$1 = () => {};
const p$2 = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
  mark: noop$1,
  measure: noop$1
};
const preamble = "FA \"6.7.1\"";
const begin = name => {
  p$2.mark("".concat(preamble, " ").concat(name, " begins"));
  return () => end(name);
};
const end = name => {
  p$2.mark("".concat(preamble, " ").concat(name, " ends"));
  p$2.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));
};
var perf = {
  begin,
  end
};

const noop$2 = () => {};
function isWatched(node) {
  const i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
  return typeof i2svg === 'string';
}
function hasPrefixAndIcon(node) {
  const prefix = node.getAttribute ? node.getAttribute(DATA_PREFIX) : null;
  const icon = node.getAttribute ? node.getAttribute(DATA_ICON) : null;
  return prefix && icon;
}
function hasBeenReplaced(node) {
  return node && node.classList && node.classList.contains && node.classList.contains(config.replacementClass);
}
function getMutator() {
  if (config.autoReplaceSvg === true) {
    return mutators.replace;
  }
  const mutator = mutators[config.autoReplaceSvg];
  return mutator || mutators.replace;
}
function createElementNS(tag) {
  return DOCUMENT.createElementNS('http://www.w3.org/2000/svg', tag);
}
function createElement(tag) {
  return DOCUMENT.createElement(tag);
}
function convertSVG(abstractObj) {
  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  const {
    ceFn = abstractObj.tag === 'svg' ? createElementNS : createElement
  } = params;
  if (typeof abstractObj === 'string') {
    return DOCUMENT.createTextNode(abstractObj);
  }
  const tag = ceFn(abstractObj.tag);
  Object.keys(abstractObj.attributes || []).forEach(function (key) {
    tag.setAttribute(key, abstractObj.attributes[key]);
  });
  const children = abstractObj.children || [];
  children.forEach(function (child) {
    tag.appendChild(convertSVG(child, {
      ceFn
    }));
  });
  return tag;
}
function nodeAsComment(node) {
  let comment = " ".concat(node.outerHTML, " ");
  /* BEGIN.ATTRIBUTION */
  comment = "".concat(comment, "Font Awesome fontawesome.com ");
  /* END.ATTRIBUTION */
  return comment;
}
const mutators = {
  replace: function (mutation) {
    const node = mutation[0];
    if (node.parentNode) {
      mutation[1].forEach(abstract => {
        node.parentNode.insertBefore(convertSVG(abstract), node);
      });
      if (node.getAttribute(DATA_FA_I2SVG) === null && config.keepOriginalSource) {
        let comment = DOCUMENT.createComment(nodeAsComment(node));
        node.parentNode.replaceChild(comment, node);
      } else {
        node.remove();
      }
    }
  },
  nest: function (mutation) {
    const node = mutation[0];
    const abstract = mutation[1];

    // If we already have a replaced node we do not want to continue nesting within it.
    // Short-circuit to the standard replacement
    if (~classArray(node).indexOf(config.replacementClass)) {
      return mutators.replace(mutation);
    }
    const forSvg = new RegExp("".concat(config.cssPrefix, "-.*"));
    delete abstract[0].attributes.id;
    if (abstract[0].attributes.class) {
      const splitClasses = abstract[0].attributes.class.split(' ').reduce((acc, cls) => {
        if (cls === config.replacementClass || cls.match(forSvg)) {
          acc.toSvg.push(cls);
        } else {
          acc.toNode.push(cls);
        }
        return acc;
      }, {
        toNode: [],
        toSvg: []
      });
      abstract[0].attributes.class = splitClasses.toSvg.join(' ');
      if (splitClasses.toNode.length === 0) {
        node.removeAttribute('class');
      } else {
        node.setAttribute('class', splitClasses.toNode.join(' '));
      }
    }
    const newInnerHTML = abstract.map(a => toHtml(a)).join('\n');
    node.setAttribute(DATA_FA_I2SVG, '');
    node.innerHTML = newInnerHTML;
  }
};
function performOperationSync(op) {
  op();
}
function perform(mutations, callback) {
  const callbackFunction = typeof callback === 'function' ? callback : noop$2;
  if (mutations.length === 0) {
    callbackFunction();
  } else {
    let frame = performOperationSync;
    if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {
      frame = WINDOW.requestAnimationFrame || performOperationSync;
    }
    frame(() => {
      const mutator = getMutator();
      const mark = perf.begin('mutate');
      mutations.map(mutator);
      mark();
      callbackFunction();
    });
  }
}
let disabled = false;
function disableObservation() {
  disabled = true;
}
function enableObservation() {
  disabled = false;
}
let mo$1 = null;
function observe(options) {
  if (!MUTATION_OBSERVER) {
    return;
  }
  if (!config.observeMutations) {
    return;
  }
  const {
    treeCallback = noop$2,
    nodeCallback = noop$2,
    pseudoElementsCallback = noop$2,
    observeMutationsRoot = DOCUMENT
  } = options;
  mo$1 = new MUTATION_OBSERVER(objects => {
    if (disabled) return;
    const defaultPrefix = getDefaultUsablePrefix();
    toArray(objects).forEach(mutationRecord => {
      if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {
        if (config.searchPseudoElements) {
          pseudoElementsCallback(mutationRecord.target);
        }
        treeCallback(mutationRecord.target);
      }
      if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
        pseudoElementsCallback(mutationRecord.target.parentNode);
      }
      if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {
        if (mutationRecord.attributeName === 'class' && hasPrefixAndIcon(mutationRecord.target)) {
          const {
            prefix,
            iconName
          } = getCanonicalIcon(classArray(mutationRecord.target));
          mutationRecord.target.setAttribute(DATA_PREFIX, prefix || defaultPrefix);
          if (iconName) mutationRecord.target.setAttribute(DATA_ICON, iconName);
        } else if (hasBeenReplaced(mutationRecord.target)) {
          nodeCallback(mutationRecord.target);
        }
      }
    });
  });
  if (!IS_DOM) return;
  mo$1.observe(observeMutationsRoot, {
    childList: true,
    attributes: true,
    characterData: true,
    subtree: true
  });
}
function disconnect() {
  if (!mo$1) return;
  mo$1.disconnect();
}

function styleParser (node) {
  const style = node.getAttribute('style');
  let val = [];
  if (style) {
    val = style.split(';').reduce((acc, style) => {
      const styles = style.split(':');
      const prop = styles[0];
      const value = styles.slice(1);
      if (prop && value.length > 0) {
        acc[prop] = value.join(':').trim();
      }
      return acc;
    }, {});
  }
  return val;
}

function classParser (node) {
  const existingPrefix = node.getAttribute('data-prefix');
  const existingIconName = node.getAttribute('data-icon');
  const innerText = node.innerText !== undefined ? node.innerText.trim() : '';
  let val = getCanonicalIcon(classArray(node));
  if (!val.prefix) {
    val.prefix = getDefaultUsablePrefix();
  }
  if (existingPrefix && existingIconName) {
    val.prefix = existingPrefix;
    val.iconName = existingIconName;
  }
  if (val.iconName && val.prefix) {
    return val;
  }
  if (val.prefix && innerText.length > 0) {
    val.iconName = byLigature(val.prefix, node.innerText) || byUnicode(val.prefix, toHex(node.innerText));
  }
  if (!val.iconName && config.autoFetchSvg && node.firstChild && node.firstChild.nodeType === Node.TEXT_NODE) {
    val.iconName = node.firstChild.data;
  }
  return val;
}

function attributesParser (node) {
  const extraAttributes = toArray(node.attributes).reduce((acc, attr) => {
    if (acc.name !== 'class' && acc.name !== 'style') {
      acc[attr.name] = attr.value;
    }
    return acc;
  }, {});
  const title = node.getAttribute('title');
  const titleId = node.getAttribute('data-fa-title-id');
  if (config.autoA11y) {
    if (title) {
      extraAttributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
    } else {
      extraAttributes['aria-hidden'] = 'true';
      extraAttributes['focusable'] = 'false';
    }
  }
  return extraAttributes;
}

function blankMeta() {
  return {
    iconName: null,
    title: null,
    titleId: null,
    prefix: null,
    transform: meaninglessTransform,
    symbol: false,
    mask: {
      iconName: null,
      prefix: null,
      rest: []
    },
    maskId: null,
    extra: {
      classes: [],
      styles: {},
      attributes: {}
    }
  };
}
function parseMeta(node) {
  let parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
    styleParser: true
  };
  const {
    iconName,
    prefix,
    rest: extraClasses
  } = classParser(node);
  const extraAttributes = attributesParser(node);
  const pluginMeta = chainHooks('parseNodeAttributes', {}, node);
  let extraStyles = parser.styleParser ? styleParser(node) : [];
  return _objectSpread2({
    iconName,
    title: node.getAttribute('title'),
    titleId: node.getAttribute('data-fa-title-id'),
    prefix,
    transform: meaninglessTransform,
    mask: {
      iconName: null,
      prefix: null,
      rest: []
    },
    maskId: null,
    symbol: false,
    extra: {
      classes: extraClasses,
      styles: extraStyles,
      attributes: extraAttributes
    }
  }, pluginMeta);
}

const {
  styles: styles$2
} = namespace;
function generateMutation(node) {
  const nodeMeta = config.autoReplaceSvg === 'nest' ? parseMeta(node, {
    styleParser: false
  }) : parseMeta(node);
  if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
    return callProvided('generateLayersText', node, nodeMeta);
  } else {
    return callProvided('generateSvgReplacementMutation', node, nodeMeta);
  }
}
function getKnownPrefixes() {
  return [...Ft, ...xo];
}
function onTree(root) {
  let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  if (!IS_DOM) return Promise.resolve();
  const htmlClassList = DOCUMENT.documentElement.classList;
  const hclAdd = suffix => htmlClassList.add("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
  const hclRemove = suffix => htmlClassList.remove("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
  const prefixes = config.autoFetchSvg ? getKnownPrefixes() : P.concat(Object.keys(styles$2));
  if (!prefixes.includes('fa')) {
    prefixes.push('fa');
  }
  const prefixesDomQuery = [".".concat(LAYERS_TEXT_CLASSNAME, ":not([").concat(DATA_FA_I2SVG, "])")].concat(prefixes.map(p$$1 => ".".concat(p$$1, ":not([").concat(DATA_FA_I2SVG, "])"))).join(', ');
  if (prefixesDomQuery.length === 0) {
    return Promise.resolve();
  }
  let candidates = [];
  try {
    candidates = toArray(root.querySelectorAll(prefixesDomQuery));
  } catch (e$$1) {
    // noop
  }
  if (candidates.length > 0) {
    hclAdd('pending');
    hclRemove('complete');
  } else {
    return Promise.resolve();
  }
  const mark = perf.begin('onTree');
  const mutations = candidates.reduce((acc, node) => {
    try {
      const mutation = generateMutation(node);
      if (mutation) {
        acc.push(mutation);
      }
    } catch (e$$1) {
      if (!PRODUCTION) {
        if (e$$1.name === 'MissingIcon') {
          console.error(e$$1);
        }
      }
    }
    return acc;
  }, []);
  return new Promise((resolve, reject) => {
    Promise.all(mutations).then(resolvedMutations => {
      perform(resolvedMutations, () => {
        hclAdd('active');
        hclAdd('complete');
        hclRemove('pending');
        if (typeof callback === 'function') callback();
        mark();
        resolve();
      });
    }).catch(e$$1 => {
      mark();
      reject(e$$1);
    });
  });
}
function onNode(node) {
  let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  generateMutation(node).then(mutation => {
    if (mutation) {
      perform([mutation], callback);
    }
  });
}
function resolveIcons(next) {
  return function (maybeIconDefinition) {
    let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    const iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
    let {
      mask
    } = params;
    if (mask) {
      mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
    }
    return next(iconDefinition, _objectSpread2(_objectSpread2({}, params), {}, {
      mask
    }));
  };
}
const render = function (iconDefinition) {
  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  const {
    transform = meaninglessTransform,
    symbol = false,
    mask = null,
    maskId = null,
    title = null,
    titleId = null,
    classes = [],
    attributes = {},
    styles = {}
  } = params;
  if (!iconDefinition) return;
  const {
    prefix,
    iconName,
    icon
  } = iconDefinition;
  return domVariants(_objectSpread2({
    type: 'icon'
  }, iconDefinition), () => {
    callHooks('beforeDOMElementCreation', {
      iconDefinition,
      params
    });
    if (config.autoA11y) {
      if (title) {
        attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
      } else {
        attributes['aria-hidden'] = 'true';
        attributes['focusable'] = 'false';
      }
    }
    return makeInlineSvgAbstract({
      icons: {
        main: asFoundIcon(icon),
        mask: mask ? asFoundIcon(mask.icon) : {
          found: false,
          width: null,
          height: null,
          icon: {}
        }
      },
      prefix,
      iconName,
      transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
      symbol,
      title,
      maskId,
      titleId,
      extra: {
        attributes,
        styles,
        classes
      }
    });
  });
};
var ReplaceElements = {
  mixout() {
    return {
      icon: resolveIcons(render)
    };
  },
  hooks() {
    return {
      mutationObserverCallbacks(accumulator) {
        accumulator.treeCallback = onTree;
        accumulator.nodeCallback = onNode;
        return accumulator;
      }
    };
  },
  provides(providers$$1) {
    providers$$1.i2svg = function (params) {
      const {
        node = DOCUMENT,
        callback = () => {}
      } = params;
      return onTree(node, callback);
    };
    providers$$1.generateSvgReplacementMutation = function (node, nodeMeta) {
      const {
        iconName,
        title,
        titleId,
        prefix,
        transform,
        symbol,
        mask,
        maskId,
        extra
      } = nodeMeta;
      return new Promise((resolve, reject) => {
        Promise.all([findIcon(iconName, prefix), mask.iconName ? findIcon(mask.iconName, mask.prefix) : Promise.resolve({
          found: false,
          width: 512,
          height: 512,
          icon: {}
        })]).then(_ref => {
          let [main, mask] = _ref;
          resolve([node, makeInlineSvgAbstract({
            icons: {
              main,
              mask
            },
            prefix,
            iconName,
            transform,
            symbol,
            maskId,
            title,
            titleId,
            extra,
            watchable: true
          })]);
        }).catch(reject);
      });
    };
    providers$$1.generateAbstractIcon = function (_ref2) {
      let {
        children,
        attributes,
        main,
        transform,
        styles
      } = _ref2;
      const styleString = joinStyles(styles);
      if (styleString.length > 0) {
        attributes['style'] = styleString;
      }
      let nextChild;
      if (transformIsMeaningful(transform)) {
        nextChild = callProvided('generateAbstractTransformGrouping', {
          main,
          transform,
          containerWidth: main.width,
          iconWidth: main.width
        });
      }
      children.push(nextChild || main.icon);
      return {
        children,
        attributes
      };
    };
  }
};

var Layers = {
  mixout() {
    return {
      layer(assembler) {
        let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
        const {
          classes = []
        } = params;
        return domVariants({
          type: 'layer'
        }, () => {
          callHooks('beforeDOMElementCreation', {
            assembler,
            params
          });
          let children = [];
          assembler(args => {
            Array.isArray(args) ? args.map(a => {
              children = children.concat(a.abstract);
            }) : children = children.concat(args.abstract);
          });
          return [{
            tag: 'span',
            attributes: {
              class: ["".concat(config.cssPrefix, "-layers"), ...classes].join(' ')
            },
            children
          }];
        });
      }
    };
  }
};

var LayersCounter = {
  mixout() {
    return {
      counter(content) {
        let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
        const {
          title = null,
          classes = [],
          attributes = {},
          styles = {}
        } = params;
        return domVariants({
          type: 'counter',
          content
        }, () => {
          callHooks('beforeDOMElementCreation', {
            content,
            params
          });
          return makeLayersCounterAbstract({
            content: content.toString(),
            title,
            extra: {
              attributes,
              styles,
              classes: ["".concat(config.cssPrefix, "-layers-counter"), ...classes]
            }
          });
        });
      }
    };
  }
};

var LayersText = {
  mixout() {
    return {
      text(content) {
        let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
        const {
          transform = meaninglessTransform,
          title = null,
          classes = [],
          attributes = {},
          styles = {}
        } = params;
        return domVariants({
          type: 'text',
          content
        }, () => {
          callHooks('beforeDOMElementCreation', {
            content,
            params
          });
          return makeLayersTextAbstract({
            content,
            transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
            title,
            extra: {
              attributes,
              styles,
              classes: ["".concat(config.cssPrefix, "-layers-text"), ...classes]
            }
          });
        });
      }
    };
  },
  provides(providers$$1) {
    providers$$1.generateLayersText = function (node, nodeMeta) {
      const {
        title,
        transform,
        extra
      } = nodeMeta;
      let width = null;
      let height = null;
      if (IS_IE) {
        const computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
        const boundingClientRect = node.getBoundingClientRect();
        width = boundingClientRect.width / computedFontSize;
        height = boundingClientRect.height / computedFontSize;
      }
      if (config.autoA11y && !title) {
        extra.attributes['aria-hidden'] = 'true';
      }
      return Promise.resolve([node, makeLayersTextAbstract({
        content: node.innerHTML,
        width,
        height,
        transform,
        title,
        extra,
        watchable: true
      })]);
    };
  }
};

const CLEAN_CONTENT_PATTERN = new RegExp('\u{22}', 'ug');
const SECONDARY_UNICODE_RANGE = [1105920, 1112319];
const _FONT_FAMILY_WEIGHT_TO_PREFIX = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
  FontAwesome: {
    normal: 'fas',
    400: 'fas'
  }
}), lt), ko), Yt);
const FONT_FAMILY_WEIGHT_TO_PREFIX = Object.keys(_FONT_FAMILY_WEIGHT_TO_PREFIX).reduce((acc, key) => {
  acc[key.toLowerCase()] = _FONT_FAMILY_WEIGHT_TO_PREFIX[key];
  return acc;
}, {});
const FONT_FAMILY_WEIGHT_FALLBACK = Object.keys(FONT_FAMILY_WEIGHT_TO_PREFIX).reduce((acc, fontFamily) => {
  const weights = FONT_FAMILY_WEIGHT_TO_PREFIX[fontFamily];
  acc[fontFamily] = weights[900] || [...Object.entries(weights)][0][1];
  return acc;
}, {});
function hexValueFromContent(content) {
  const cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
  const codePoint = codePointAt(cleaned, 0);
  const isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
  const isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
  return {
    value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
    isSecondary: isPrependTen || isDoubled
  };
}
function getPrefix(fontFamily, fontWeight) {
  const fontFamilySanitized = fontFamily.replace(/^['"]|['"]$/g, '').toLowerCase();
  const fontWeightInteger = parseInt(fontWeight);
  const fontWeightSanitized = isNaN(fontWeightInteger) ? 'normal' : fontWeightInteger;
  return (FONT_FAMILY_WEIGHT_TO_PREFIX[fontFamilySanitized] || {})[fontWeightSanitized] || FONT_FAMILY_WEIGHT_FALLBACK[fontFamilySanitized];
}
function replaceForPosition(node, position) {
  const pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
  return new Promise((resolve, reject) => {
    if (node.getAttribute(pendingAttribute) !== null) {
      // This node is already being processed
      return resolve();
    }
    const children = toArray(node.children);
    const alreadyProcessedPseudoElement = children.filter(c$$1 => c$$1.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position)[0];
    const styles = WINDOW.getComputedStyle(node, position);
    const fontFamily = styles.getPropertyValue('font-family');
    const fontFamilyMatch = fontFamily.match(FONT_FAMILY_PATTERN);
    const fontWeight = styles.getPropertyValue('font-weight');
    const content = styles.getPropertyValue('content');
    if (alreadyProcessedPseudoElement && !fontFamilyMatch) {
      // If we've already processed it but the current computed style does not result in a font-family,
      // that probably means that a class name that was previously present to make the icon has been
      // removed. So we now should delete the icon.
      node.removeChild(alreadyProcessedPseudoElement);
      return resolve();
    } else if (fontFamilyMatch && content !== 'none' && content !== '') {
      const content = styles.getPropertyValue('content');
      let prefix = getPrefix(fontFamily, fontWeight);
      const {
        value: hexValue,
        isSecondary
      } = hexValueFromContent(content);
      const isV4 = fontFamilyMatch[0].startsWith('FontAwesome');
      let iconName = byUnicode(prefix, hexValue);
      let iconIdentifier = iconName;
      if (isV4) {
        const iconName4 = byOldUnicode(hexValue);
        if (iconName4.iconName && iconName4.prefix) {
          iconName = iconName4.iconName;
          prefix = iconName4.prefix;
        }
      }

      // Only convert the pseudo element in this ::before/::after position into an icon if we haven't
      // already done so with the same prefix and iconName
      if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
        node.setAttribute(pendingAttribute, iconIdentifier);
        if (alreadyProcessedPseudoElement) {
          // Delete the old one, since we're replacing it with a new one
          node.removeChild(alreadyProcessedPseudoElement);
        }
        const meta = blankMeta();
        const {
          extra
        } = meta;
        extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
        findIcon(iconName, prefix).then(main => {
          const abstract = makeInlineSvgAbstract(_objectSpread2(_objectSpread2({}, meta), {}, {
            icons: {
              main,
              mask: emptyCanonicalIcon()
            },
            prefix,
            iconName: iconIdentifier,
            extra,
            watchable: true
          }));
          const element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');
          if (position === '::before') {
            node.insertBefore(element, node.firstChild);
          } else {
            node.appendChild(element);
          }
          element.outerHTML = abstract.map(a$$1 => toHtml(a$$1)).join('\n');
          node.removeAttribute(pendingAttribute);
          resolve();
        }).catch(reject);
      } else {
        resolve();
      }
    } else {
      resolve();
    }
  });
}
function replace(node) {
  return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
}
function processable(node) {
  return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');
}
function searchPseudoElements(root) {
  if (!IS_DOM) return;
  return new Promise((resolve, reject) => {
    const operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
    const end = perf.begin('searchPseudoElements');
    disableObservation();
    Promise.all(operations).then(() => {
      end();
      enableObservation();
      resolve();
    }).catch(() => {
      end();
      enableObservation();
      reject();
    });
  });
}
var PseudoElements = {
  hooks() {
    return {
      mutationObserverCallbacks(accumulator) {
        accumulator.pseudoElementsCallback = searchPseudoElements;
        return accumulator;
      }
    };
  },
  provides(providers) {
    providers.pseudoElements2svg = function (params) {
      const {
        node = DOCUMENT
      } = params;
      if (config.searchPseudoElements) {
        searchPseudoElements(node);
      }
    };
  }
};

let _unwatched = false;
var MutationObserver$1 = {
  mixout() {
    return {
      dom: {
        unwatch() {
          disableObservation();
          _unwatched = true;
        }
      }
    };
  },
  hooks() {
    return {
      bootstrap() {
        observe(chainHooks('mutationObserverCallbacks', {}));
      },
      noAuto() {
        disconnect();
      },
      watch(params) {
        const {
          observeMutationsRoot
        } = params;
        if (_unwatched) {
          enableObservation();
        } else {
          observe(chainHooks('mutationObserverCallbacks', {
            observeMutationsRoot
          }));
        }
      }
    };
  }
};

const parseTransformString = transformString => {
  let transform = {
    size: 16,
    x: 0,
    y: 0,
    flipX: false,
    flipY: false,
    rotate: 0
  };
  return transformString.toLowerCase().split(' ').reduce((acc, n) => {
    const parts = n.toLowerCase().split('-');
    const first = parts[0];
    let rest = parts.slice(1).join('-');
    if (first && rest === 'h') {
      acc.flipX = true;
      return acc;
    }
    if (first && rest === 'v') {
      acc.flipY = true;
      return acc;
    }
    rest = parseFloat(rest);
    if (isNaN(rest)) {
      return acc;
    }
    switch (first) {
      case 'grow':
        acc.size = acc.size + rest;
        break;
      case 'shrink':
        acc.size = acc.size - rest;
        break;
      case 'left':
        acc.x = acc.x - rest;
        break;
      case 'right':
        acc.x = acc.x + rest;
        break;
      case 'up':
        acc.y = acc.y - rest;
        break;
      case 'down':
        acc.y = acc.y + rest;
        break;
      case 'rotate':
        acc.rotate = acc.rotate + rest;
        break;
    }
    return acc;
  }, transform);
};
var PowerTransforms = {
  mixout() {
    return {
      parse: {
        transform: transformString => {
          return parseTransformString(transformString);
        }
      }
    };
  },
  hooks() {
    return {
      parseNodeAttributes(accumulator, node) {
        const transformString = node.getAttribute('data-fa-transform');
        if (transformString) {
          accumulator.transform = parseTransformString(transformString);
        }
        return accumulator;
      }
    };
  },
  provides(providers) {
    providers.generateAbstractTransformGrouping = function (_ref) {
      let {
        main,
        transform,
        containerWidth,
        iconWidth
      } = _ref;
      const outer = {
        transform: "translate(".concat(containerWidth / 2, " 256)")
      };
      const innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
      const innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
      const innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
      const inner = {
        transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
      };
      const path = {
        transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
      };
      const operations = {
        outer,
        inner,
        path
      };
      return {
        tag: 'g',
        attributes: _objectSpread2({}, operations.outer),
        children: [{
          tag: 'g',
          attributes: _objectSpread2({}, operations.inner),
          children: [{
            tag: main.icon.tag,
            children: main.icon.children,
            attributes: _objectSpread2(_objectSpread2({}, main.icon.attributes), operations.path)
          }]
        }]
      };
    };
  }
};

const ALL_SPACE = {
  x: 0,
  y: 0,
  width: '100%',
  height: '100%'
};
function fillBlack(abstract) {
  let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  if (abstract.attributes && (abstract.attributes.fill || force)) {
    abstract.attributes.fill = 'black';
  }
  return abstract;
}
function deGroup(abstract) {
  if (abstract.tag === 'g') {
    return abstract.children;
  } else {
    return [abstract];
  }
}
var Masks = {
  hooks() {
    return {
      parseNodeAttributes(accumulator, node) {
        const maskData = node.getAttribute('data-fa-mask');
        const mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(i => i.trim()));
        if (!mask.prefix) {
          mask.prefix = getDefaultUsablePrefix();
        }
        accumulator.mask = mask;
        accumulator.maskId = node.getAttribute('data-fa-mask-id');
        return accumulator;
      }
    };
  },
  provides(providers) {
    providers.generateAbstractMask = function (_ref) {
      let {
        children,
        attributes,
        main,
        mask,
        maskId: explicitMaskId,
        transform
      } = _ref;
      const {
        width: mainWidth,
        icon: mainPath
      } = main;
      const {
        width: maskWidth,
        icon: maskPath
      } = mask;
      const trans = transformForSvg({
        transform,
        containerWidth: maskWidth,
        iconWidth: mainWidth
      });
      const maskRect = {
        tag: 'rect',
        attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
          fill: 'white'
        })
      };
      const maskInnerGroupChildrenMixin = mainPath.children ? {
        children: mainPath.children.map(fillBlack)
      } : {};
      const maskInnerGroup = {
        tag: 'g',
        attributes: _objectSpread2({}, trans.inner),
        children: [fillBlack(_objectSpread2({
          tag: mainPath.tag,
          attributes: _objectSpread2(_objectSpread2({}, mainPath.attributes), trans.path)
        }, maskInnerGroupChildrenMixin))]
      };
      const maskOuterGroup = {
        tag: 'g',
        attributes: _objectSpread2({}, trans.outer),
        children: [maskInnerGroup]
      };
      const maskId = "mask-".concat(explicitMaskId || nextUniqueId());
      const clipId = "clip-".concat(explicitMaskId || nextUniqueId());
      const maskTag = {
        tag: 'mask',
        attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
          id: maskId,
          maskUnits: 'userSpaceOnUse',
          maskContentUnits: 'userSpaceOnUse'
        }),
        children: [maskRect, maskOuterGroup]
      };
      const defs = {
        tag: 'defs',
        children: [{
          tag: 'clipPath',
          attributes: {
            id: clipId
          },
          children: deGroup(maskPath)
        }, maskTag]
      };
      children.push(defs, {
        tag: 'rect',
        attributes: _objectSpread2({
          fill: 'currentColor',
          'clip-path': "url(#".concat(clipId, ")"),
          mask: "url(#".concat(maskId, ")")
        }, ALL_SPACE)
      });
      return {
        children,
        attributes
      };
    };
  }
};

var MissingIconIndicator = {
  provides(providers) {
    let reduceMotion = false;
    if (WINDOW.matchMedia) {
      reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
    }
    providers.missingIconAbstract = function () {
      const gChildren = [];
      const FILL = {
        fill: 'currentColor'
      };
      const ANIMATION_BASE = {
        attributeType: 'XML',
        repeatCount: 'indefinite',
        dur: '2s'
      };

      // Ring
      gChildren.push({
        tag: 'path',
        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
          d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'
        })
      });
      const OPACITY_ANIMATE = _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
        attributeName: 'opacity'
      });
      const dot = {
        tag: 'circle',
        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
          cx: '256',
          cy: '364',
          r: '28'
        }),
        children: []
      };
      if (!reduceMotion) {
        dot.children.push({
          tag: 'animate',
          attributes: _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
            attributeName: 'r',
            values: '28;14;28;28;14;28;'
          })
        }, {
          tag: 'animate',
          attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
            values: '1;0;1;1;0;1;'
          })
        });
      }
      gChildren.push(dot);
      gChildren.push({
        tag: 'path',
        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
          opacity: '1',
          d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'
        }),
        children: reduceMotion ? [] : [{
          tag: 'animate',
          attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
            values: '1;0;0;0;0;1;'
          })
        }]
      });
      if (!reduceMotion) {
        // Exclamation
        gChildren.push({
          tag: 'path',
          attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
            opacity: '0',
            d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'
          }),
          children: [{
            tag: 'animate',
            attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
              values: '0;0;1;1;0;0;'
            })
          }]
        });
      }
      return {
        tag: 'g',
        attributes: {
          'class': 'missing'
        },
        children: gChildren
      };
    };
  }
};

var SvgSymbols = {
  hooks() {
    return {
      parseNodeAttributes(accumulator, node) {
        const symbolData = node.getAttribute('data-fa-symbol');
        const symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
        accumulator['symbol'] = symbol;
        return accumulator;
      }
    };
  }
};

var plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];

registerPlugins(plugins, {
  mixoutsTo: api
});
const noAuto$1 = api.noAuto;
const config$1 = api.config;
const library$1 = api.library;
const dom$1 = api.dom;
const parse$1 = api.parse;
const findIconDefinition$1 = api.findIconDefinition;
const toHtml$1 = api.toHtml;
const icon = api.icon;
const layer = api.layer;
const text = api.text;
const counter = api.counter;




/***/ }),

/***/ "../../../../node_modules/@fortawesome/free-regular-svg-icons/index.mjs":
/*!******************************************************************************!*\
  !*** ../../../../node_modules/@fortawesome/free-regular-svg-icons/index.mjs ***!
  \******************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_3492245__) => {

"use strict";
__nested_webpack_require_3492245__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3492245__.d(__nested_webpack_exports__, {
/* harmony export */   faAddressBook: () => (/* binding */ faAddressBook),
/* harmony export */   faAddressCard: () => (/* binding */ faAddressCard),
/* harmony export */   faAngry: () => (/* binding */ faAngry),
/* harmony export */   faArrowAltCircleDown: () => (/* binding */ faArrowAltCircleDown),
/* harmony export */   faArrowAltCircleLeft: () => (/* binding */ faArrowAltCircleLeft),
/* harmony export */   faArrowAltCircleRight: () => (/* binding */ faArrowAltCircleRight),
/* harmony export */   faArrowAltCircleUp: () => (/* binding */ faArrowAltCircleUp),
/* harmony export */   faBarChart: () => (/* binding */ faBarChart),
/* harmony export */   faBell: () => (/* binding */ faBell),
/* harmony export */   faBellSlash: () => (/* binding */ faBellSlash),
/* harmony export */   faBookmark: () => (/* binding */ faBookmark),
/* harmony export */   faBuilding: () => (/* binding */ faBuilding),
/* harmony export */   faCalendar: () => (/* binding */ faCalendar),
/* harmony export */   faCalendarAlt: () => (/* binding */ faCalendarAlt),
/* harmony export */   faCalendarCheck: () => (/* binding */ faCalendarCheck),
/* harmony export */   faCalendarDays: () => (/* binding */ faCalendarDays),
/* harmony export */   faCalendarMinus: () => (/* binding */ faCalendarMinus),
/* harmony export */   faCalendarPlus: () => (/* binding */ faCalendarPlus),
/* harmony export */   faCalendarTimes: () => (/* binding */ faCalendarTimes),
/* harmony export */   faCalendarXmark: () => (/* binding */ faCalendarXmark),
/* harmony export */   faCaretSquareDown: () => (/* binding */ faCaretSquareDown),
/* harmony export */   faCaretSquareLeft: () => (/* binding */ faCaretSquareLeft),
/* harmony export */   faCaretSquareRight: () => (/* binding */ faCaretSquareRight),
/* harmony export */   faCaretSquareUp: () => (/* binding */ faCaretSquareUp),
/* harmony export */   faChartBar: () => (/* binding */ faChartBar),
/* harmony export */   faCheckCircle: () => (/* binding */ faCheckCircle),
/* harmony export */   faCheckSquare: () => (/* binding */ faCheckSquare),
/* harmony export */   faChessBishop: () => (/* binding */ faChessBishop),
/* harmony export */   faChessKing: () => (/* binding */ faChessKing),
/* harmony export */   faChessKnight: () => (/* binding */ faChessKnight),
/* harmony export */   faChessPawn: () => (/* binding */ faChessPawn),
/* harmony export */   faChessQueen: () => (/* binding */ faChessQueen),
/* harmony export */   faChessRook: () => (/* binding */ faChessRook),
/* harmony export */   faCircle: () => (/* binding */ faCircle),
/* harmony export */   faCircleCheck: () => (/* binding */ faCircleCheck),
/* harmony export */   faCircleDot: () => (/* binding */ faCircleDot),
/* harmony export */   faCircleDown: () => (/* binding */ faCircleDown),
/* harmony export */   faCircleLeft: () => (/* binding */ faCircleLeft),
/* harmony export */   faCirclePause: () => (/* binding */ faCirclePause),
/* harmony export */   faCirclePlay: () => (/* binding */ faCirclePlay),
/* harmony export */   faCircleQuestion: () => (/* binding */ faCircleQuestion),
/* harmony export */   faCircleRight: () => (/* binding */ faCircleRight),
/* harmony export */   faCircleStop: () => (/* binding */ faCircleStop),
/* harmony export */   faCircleUp: () => (/* binding */ faCircleUp),
/* harmony export */   faCircleUser: () => (/* binding */ faCircleUser),
/* harmony export */   faCircleXmark: () => (/* binding */ faCircleXmark),
/* harmony export */   faClipboard: () => (/* binding */ faClipboard),
/* harmony export */   faClock: () => (/* binding */ faClock),
/* harmony export */   faClockFour: () => (/* binding */ faClockFour),
/* harmony export */   faClone: () => (/* binding */ faClone),
/* harmony export */   faClosedCaptioning: () => (/* binding */ faClosedCaptioning),
/* harmony export */   faComment: () => (/* binding */ faComment),
/* harmony export */   faCommentAlt: () => (/* binding */ faCommentAlt),
/* harmony export */   faCommentDots: () => (/* binding */ faCommentDots),
/* harmony export */   faCommenting: () => (/* binding */ faCommenting),
/* harmony export */   faComments: () => (/* binding */ faComments),
/* harmony export */   faCompass: () => (/* binding */ faCompass),
/* harmony export */   faContactBook: () => (/* binding */ faContactBook),
/* harmony export */   faContactCard: () => (/* binding */ faContactCard),
/* harmony export */   faCopy: () => (/* binding */ faCopy),
/* harmony export */   faCopyright: () => (/* binding */ faCopyright),
/* harmony export */   faCreditCard: () => (/* binding */ faCreditCard),
/* harmony export */   faCreditCardAlt: () => (/* binding */ faCreditCardAlt),
/* harmony export */   faDizzy: () => (/* binding */ faDizzy),
/* harmony export */   faDotCircle: () => (/* binding */ faDotCircle),
/* harmony export */   faDriversLicense: () => (/* binding */ faDriversLicense),
/* harmony export */   faEdit: () => (/* binding */ faEdit),
/* harmony export */   faEnvelope: () => (/* binding */ faEnvelope),
/* harmony export */   faEnvelopeOpen: () => (/* binding */ faEnvelopeOpen),
/* harmony export */   faEye: () => (/* binding */ faEye),
/* harmony export */   faEyeSlash: () => (/* binding */ faEyeSlash),
/* harmony export */   faFaceAngry: () => (/* binding */ faFaceAngry),
/* harmony export */   faFaceDizzy: () => (/* binding */ faFaceDizzy),
/* harmony export */   faFaceFlushed: () => (/* binding */ faFaceFlushed),
/* harmony export */   faFaceFrown: () => (/* binding */ faFaceFrown),
/* harmony export */   faFaceFrownOpen: () => (/* binding */ faFaceFrownOpen),
/* harmony export */   faFaceGrimace: () => (/* binding */ faFaceGrimace),
/* harmony export */   faFaceGrin: () => (/* binding */ faFaceGrin),
/* harmony export */   faFaceGrinBeam: () => (/* binding */ faFaceGrinBeam),
/* harmony export */   faFaceGrinBeamSweat: () => (/* binding */ faFaceGrinBeamSweat),
/* harmony export */   faFaceGrinHearts: () => (/* binding */ faFaceGrinHearts),
/* harmony export */   faFaceGrinSquint: () => (/* binding */ faFaceGrinSquint),
/* harmony export */   faFaceGrinSquintTears: () => (/* binding */ faFaceGrinSquintTears),
/* harmony export */   faFaceGrinStars: () => (/* binding */ faFaceGrinStars),
/* harmony export */   faFaceGrinTears: () => (/* binding */ faFaceGrinTears),
/* harmony export */   faFaceGrinTongue: () => (/* binding */ faFaceGrinTongue),
/* harmony export */   faFaceGrinTongueSquint: () => (/* binding */ faFaceGrinTongueSquint),
/* harmony export */   faFaceGrinTongueWink: () => (/* binding */ faFaceGrinTongueWink),
/* harmony export */   faFaceGrinWide: () => (/* binding */ faFaceGrinWide),
/* harmony export */   faFaceGrinWink: () => (/* binding */ faFaceGrinWink),
/* harmony export */   faFaceKiss: () => (/* binding */ faFaceKiss),
/* harmony export */   faFaceKissBeam: () => (/* binding */ faFaceKissBeam),
/* harmony export */   faFaceKissWinkHeart: () => (/* binding */ faFaceKissWinkHeart),
/* harmony export */   faFaceLaugh: () => (/* binding */ faFaceLaugh),
/* harmony export */   faFaceLaughBeam: () => (/* binding */ faFaceLaughBeam),
/* harmony export */   faFaceLaughSquint: () => (/* binding */ faFaceLaughSquint),
/* harmony export */   faFaceLaughWink: () => (/* binding */ faFaceLaughWink),
/* harmony export */   faFaceMeh: () => (/* binding */ faFaceMeh),
/* harmony export */   faFaceMehBlank: () => (/* binding */ faFaceMehBlank),
/* harmony export */   faFaceRollingEyes: () => (/* binding */ faFaceRollingEyes),
/* harmony export */   faFaceSadCry: () => (/* binding */ faFaceSadCry),
/* harmony export */   faFaceSadTear: () => (/* binding */ faFaceSadTear),
/* harmony export */   faFaceSmile: () => (/* binding */ faFaceSmile),
/* harmony export */   faFaceSmileBeam: () => (/* binding */ faFaceSmileBeam),
/* harmony export */   faFaceSmileWink: () => (/* binding */ faFaceSmileWink),
/* harmony export */   faFaceSurprise: () => (/* binding */ faFaceSurprise),
/* harmony export */   faFaceTired: () => (/* binding */ faFaceTired),
/* harmony export */   faFile: () => (/* binding */ faFile),
/* harmony export */   faFileAlt: () => (/* binding */ faFileAlt),
/* harmony export */   faFileArchive: () => (/* binding */ faFileArchive),
/* harmony export */   faFileAudio: () => (/* binding */ faFileAudio),
/* harmony export */   faFileClipboard: () => (/* binding */ faFileClipboard),
/* harmony export */   faFileCode: () => (/* binding */ faFileCode),
/* harmony export */   faFileExcel: () => (/* binding */ faFileExcel),
/* harmony export */   faFileImage: () => (/* binding */ faFileImage),
/* harmony export */   faFileLines: () => (/* binding */ faFileLines),
/* harmony export */   faFilePdf: () => (/* binding */ faFilePdf),
/* harmony export */   faFilePowerpoint: () => (/* binding */ faFilePowerpoint),
/* harmony export */   faFileText: () => (/* binding */ faFileText),
/* harmony export */   faFileVideo: () => (/* binding */ faFileVideo),
/* harmony export */   faFileWord: () => (/* binding */ faFileWord),
/* harmony export */   faFileZipper: () => (/* binding */ faFileZipper),
/* harmony export */   faFlag: () => (/* binding */ faFlag),
/* harmony export */   faFloppyDisk: () => (/* binding */ faFloppyDisk),
/* harmony export */   faFlushed: () => (/* binding */ faFlushed),
/* harmony export */   faFolder: () => (/* binding */ faFolder),
/* harmony export */   faFolderBlank: () => (/* binding */ faFolderBlank),
/* harmony export */   faFolderClosed: () => (/* binding */ faFolderClosed),
/* harmony export */   faFolderOpen: () => (/* binding */ faFolderOpen),
/* harmony export */   faFontAwesome: () => (/* binding */ faFontAwesome),
/* harmony export */   faFontAwesomeFlag: () => (/* binding */ faFontAwesomeFlag),
/* harmony export */   faFontAwesomeLogoFull: () => (/* binding */ faFontAwesomeLogoFull),
/* harmony export */   faFrown: () => (/* binding */ faFrown),
/* harmony export */   faFrownOpen: () => (/* binding */ faFrownOpen),
/* harmony export */   faFutbol: () => (/* binding */ faFutbol),
/* harmony export */   faFutbolBall: () => (/* binding */ faFutbolBall),
/* harmony export */   faGem: () => (/* binding */ faGem),
/* harmony export */   faGrimace: () => (/* binding */ faGrimace),
/* harmony export */   faGrin: () => (/* binding */ faGrin),
/* harmony export */   faGrinAlt: () => (/* binding */ faGrinAlt),
/* harmony export */   faGrinBeam: () => (/* binding */ faGrinBeam),
/* harmony export */   faGrinBeamSweat: () => (/* binding */ faGrinBeamSweat),
/* harmony export */   faGrinHearts: () => (/* binding */ faGrinHearts),
/* harmony export */   faGrinSquint: () => (/* binding */ faGrinSquint),
/* harmony export */   faGrinSquintTears: () => (/* binding */ faGrinSquintTears),
/* harmony export */   faGrinStars: () => (/* binding */ faGrinStars),
/* harmony export */   faGrinTears: () => (/* binding */ faGrinTears),
/* harmony export */   faGrinTongue: () => (/* binding */ faGrinTongue),
/* harmony export */   faGrinTongueSquint: () => (/* binding */ faGrinTongueSquint),
/* harmony export */   faGrinTongueWink: () => (/* binding */ faGrinTongueWink),
/* harmony export */   faGrinWink: () => (/* binding */ faGrinWink),
/* harmony export */   faHand: () => (/* binding */ faHand),
/* harmony export */   faHandBackFist: () => (/* binding */ faHandBackFist),
/* harmony export */   faHandLizard: () => (/* binding */ faHandLizard),
/* harmony export */   faHandPaper: () => (/* binding */ faHandPaper),
/* harmony export */   faHandPeace: () => (/* binding */ faHandPeace),
/* harmony export */   faHandPointDown: () => (/* binding */ faHandPointDown),
/* harmony export */   faHandPointLeft: () => (/* binding */ faHandPointLeft),
/* harmony export */   faHandPointRight: () => (/* binding */ faHandPointRight),
/* harmony export */   faHandPointUp: () => (/* binding */ faHandPointUp),
/* harmony export */   faHandPointer: () => (/* binding */ faHandPointer),
/* harmony export */   faHandRock: () => (/* binding */ faHandRock),
/* harmony export */   faHandScissors: () => (/* binding */ faHandScissors),
/* harmony export */   faHandSpock: () => (/* binding */ faHandSpock),
/* harmony export */   faHandshake: () => (/* binding */ faHandshake),
/* harmony export */   faHardDrive: () => (/* binding */ faHardDrive),
/* harmony export */   faHdd: () => (/* binding */ faHdd),
/* harmony export */   faHeart: () => (/* binding */ faHeart),
/* harmony export */   faHospital: () => (/* binding */ faHospital),
/* harmony export */   faHospitalAlt: () => (/* binding */ faHospitalAlt),
/* harmony export */   faHospitalWide: () => (/* binding */ faHospitalWide),
/* harmony export */   faHourglass: () => (/* binding */ faHourglass),
/* harmony export */   faHourglass2: () => (/* binding */ faHourglass2),
/* harmony export */   faHourglassEmpty: () => (/* binding */ faHourglassEmpty),
/* harmony export */   faHourglassHalf: () => (/* binding */ faHourglassHalf),
/* harmony export */   faIdBadge: () => (/* binding */ faIdBadge),
/* harmony export */   faIdCard: () => (/* binding */ faIdCard),
/* harmony export */   faImage: () => (/* binding */ faImage),
/* harmony export */   faImages: () => (/* binding */ faImages),
/* harmony export */   faKeyboard: () => (/* binding */ faKeyboard),
/* harmony export */   faKiss: () => (/* binding */ faKiss),
/* harmony export */   faKissBeam: () => (/* binding */ faKissBeam),
/* harmony export */   faKissWinkHeart: () => (/* binding */ faKissWinkHeart),
/* harmony export */   faLaugh: () => (/* binding */ faLaugh),
/* harmony export */   faLaughBeam: () => (/* binding */ faLaughBeam),
/* harmony export */   faLaughSquint: () => (/* binding */ faLaughSquint),
/* harmony export */   faLaughWink: () => (/* binding */ faLaughWink),
/* harmony export */   faLemon: () => (/* binding */ faLemon),
/* harmony export */   faLifeRing: () => (/* binding */ faLifeRing),
/* harmony export */   faLightbulb: () => (/* binding */ faLightbulb),
/* harmony export */   faListAlt: () => (/* binding */ faListAlt),
/* harmony export */   faMap: () => (/* binding */ faMap),
/* harmony export */   faMeh: () => (/* binding */ faMeh),
/* harmony export */   faMehBlank: () => (/* binding */ faMehBlank),
/* harmony export */   faMehRollingEyes: () => (/* binding */ faMehRollingEyes),
/* harmony export */   faMessage: () => (/* binding */ faMessage),
/* harmony export */   faMinusSquare: () => (/* binding */ faMinusSquare),
/* harmony export */   faMoneyBill1: () => (/* binding */ faMoneyBill1),
/* harmony export */   faMoneyBillAlt: () => (/* binding */ faMoneyBillAlt),
/* harmony export */   faMoon: () => (/* binding */ faMoon),
/* harmony export */   faNewspaper: () => (/* binding */ faNewspaper),
/* harmony export */   faNoteSticky: () => (/* binding */ faNoteSticky),
/* harmony export */   faObjectGroup: () => (/* binding */ faObjectGroup),
/* harmony export */   faObjectUngroup: () => (/* binding */ faObjectUngroup),
/* harmony export */   faPaperPlane: () => (/* binding */ faPaperPlane),
/* harmony export */   faPaste: () => (/* binding */ faPaste),
/* harmony export */   faPauseCircle: () => (/* binding */ faPauseCircle),
/* harmony export */   faPenToSquare: () => (/* binding */ faPenToSquare),
/* harmony export */   faPlayCircle: () => (/* binding */ faPlayCircle),
/* harmony export */   faPlusSquare: () => (/* binding */ faPlusSquare),
/* harmony export */   faQuestionCircle: () => (/* binding */ faQuestionCircle),
/* harmony export */   faRectangleList: () => (/* binding */ faRectangleList),
/* harmony export */   faRectangleTimes: () => (/* binding */ faRectangleTimes),
/* harmony export */   faRectangleXmark: () => (/* binding */ faRectangleXmark),
/* harmony export */   faRegistered: () => (/* binding */ faRegistered),
/* harmony export */   faSadCry: () => (/* binding */ faSadCry),
/* harmony export */   faSadTear: () => (/* binding */ faSadTear),
/* harmony export */   faSave: () => (/* binding */ faSave),
/* harmony export */   faShareFromSquare: () => (/* binding */ faShareFromSquare),
/* harmony export */   faShareSquare: () => (/* binding */ faShareSquare),
/* harmony export */   faSmile: () => (/* binding */ faSmile),
/* harmony export */   faSmileBeam: () => (/* binding */ faSmileBeam),
/* harmony export */   faSmileWink: () => (/* binding */ faSmileWink),
/* harmony export */   faSnowflake: () => (/* binding */ faSnowflake),
/* harmony export */   faSoccerBall: () => (/* binding */ faSoccerBall),
/* harmony export */   faSquare: () => (/* binding */ faSquare),
/* harmony export */   faSquareCaretDown: () => (/* binding */ faSquareCaretDown),
/* harmony export */   faSquareCaretLeft: () => (/* binding */ faSquareCaretLeft),
/* harmony export */   faSquareCaretRight: () => (/* binding */ faSquareCaretRight),
/* harmony export */   faSquareCaretUp: () => (/* binding */ faSquareCaretUp),
/* harmony export */   faSquareCheck: () => (/* binding */ faSquareCheck),
/* harmony export */   faSquareFull: () => (/* binding */ faSquareFull),
/* harmony export */   faSquareMinus: () => (/* binding */ faSquareMinus),
/* harmony export */   faSquarePlus: () => (/* binding */ faSquarePlus),
/* harmony export */   faStar: () => (/* binding */ faStar),
/* harmony export */   faStarHalf: () => (/* binding */ faStarHalf),
/* harmony export */   faStarHalfAlt: () => (/* binding */ faStarHalfAlt),
/* harmony export */   faStarHalfStroke: () => (/* binding */ faStarHalfStroke),
/* harmony export */   faStickyNote: () => (/* binding */ faStickyNote),
/* harmony export */   faStopCircle: () => (/* binding */ faStopCircle),
/* harmony export */   faSun: () => (/* binding */ faSun),
/* harmony export */   faSurprise: () => (/* binding */ faSurprise),
/* harmony export */   faThumbsDown: () => (/* binding */ faThumbsDown),
/* harmony export */   faThumbsUp: () => (/* binding */ faThumbsUp),
/* harmony export */   faTimesCircle: () => (/* binding */ faTimesCircle),
/* harmony export */   faTimesRectangle: () => (/* binding */ faTimesRectangle),
/* harmony export */   faTired: () => (/* binding */ faTired),
/* harmony export */   faTrashAlt: () => (/* binding */ faTrashAlt),
/* harmony export */   faTrashCan: () => (/* binding */ faTrashCan),
/* harmony export */   faUser: () => (/* binding */ faUser),
/* harmony export */   faUserCircle: () => (/* binding */ faUserCircle),
/* harmony export */   faVcard: () => (/* binding */ faVcard),
/* harmony export */   faWindowClose: () => (/* binding */ faWindowClose),
/* harmony export */   faWindowMaximize: () => (/* binding */ faWindowMaximize),
/* harmony export */   faWindowMinimize: () => (/* binding */ faWindowMinimize),
/* harmony export */   faWindowRestore: () => (/* binding */ faWindowRestore),
/* harmony export */   faXmarkCircle: () => (/* binding */ faXmarkCircle),
/* harmony export */   far: () => (/* binding */ icons),
/* harmony export */   prefix: () => (/* binding */ prefix)
/* harmony export */ });
/*!
 * Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com
 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
 * Copyright 2024 Fonticons, Inc.
 */
const prefix = "far";
const faTrashCan = {
  prefix: 'far',
  iconName: 'trash-can',
  icon: [448, 512, [61460, "trash-alt"], "f2ed", "M170.5 51.6L151.5 80l145 0-19-28.4c-1.5-2.2-4-3.6-6.7-3.6l-93.7 0c-2.7 0-5.2 1.3-6.7 3.6zm147-26.6L354.2 80 368 80l48 0 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 304c0 44.2-35.8 80-80 80l-224 0c-44.2 0-80-35.8-80-80l0-304-8 0c-13.3 0-24-10.7-24-24S10.7 80 24 80l8 0 48 0 13.8 0 36.7-55.1C140.9 9.4 158.4 0 177.1 0l93.7 0c18.7 0 36.2 9.4 46.6 24.9zM80 128l0 304c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-304L80 128zm80 64l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faTrashAlt = faTrashCan;
const faMessage = {
  prefix: 'far',
  iconName: 'message',
  icon: [512, 512, ["comment-alt"], "f27a", "M160 368c26.5 0 48 21.5 48 48l0 16 72.5-54.4c8.3-6.2 18.4-9.6 28.8-9.6L448 368c8.8 0 16-7.2 16-16l0-288c0-8.8-7.2-16-16-16L64 48c-8.8 0-16 7.2-16 16l0 288c0 8.8 7.2 16 16 16l96 0zm48 124l-.2 .2-5.1 3.8-17.1 12.8c-4.8 3.6-11.3 4.2-16.8 1.5s-8.8-8.2-8.8-14.3l0-21.3 0-6.4 0-.3 0-4 0-48-48 0-48 0c-35.3 0-64-28.7-64-64L0 64C0 28.7 28.7 0 64 0L448 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64l-138.7 0L208 492z"]
};
const faCommentAlt = faMessage;
const faFileLines = {
  prefix: 'far',
  iconName: 'file-lines',
  icon: [384, 512, [128441, 128462, 61686, "file-alt", "file-text"], "f15c", "M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm56 256c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]
};
const faFileAlt = faFileLines;
const faFileText = faFileLines;
const faCalendarDays = {
  prefix: 'far',
  iconName: 'calendar-days',
  icon: [448, 512, ["calendar-alt"], "f073", "M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L64 64C28.7 64 0 92.7 0 128l0 16 0 48L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-256 0-48 0-16c0-35.3-28.7-64-64-64l-40 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L152 64l0-40zM48 192l80 0 0 56-80 0 0-56zm0 104l80 0 0 64-80 0 0-64zm128 0l96 0 0 64-96 0 0-64zm144 0l80 0 0 64-80 0 0-64zm80-48l-80 0 0-56 80 0 0 56zm0 160l0 40c0 8.8-7.2 16-16 16l-64 0 0-56 80 0zm-128 0l0 56-96 0 0-56 96 0zm-144 0l0 56-64 0c-8.8 0-16-7.2-16-16l0-40 80 0zM272 248l-96 0 0-56 96 0 0 56z"]
};
const faCalendarAlt = faCalendarDays;
const faHandPointRight = {
  prefix: 'far',
  iconName: 'hand-point-right',
  icon: [512, 512, [], "f0a4", "M448 128l-177.6 0c1 5.2 1.6 10.5 1.6 16l0 16 32 0 144 0c8.8 0 16-7.2 16-16s-7.2-16-16-16zM224 144c0-17.7-14.3-32-32-32c0 0 0 0 0 0l-24 0c-66.3 0-120 53.7-120 120l0 48c0 52.5 33.7 97.1 80.7 113.4c-.5-3.1-.7-6.2-.7-9.4c0-20 9.2-37.9 23.6-49.7c-4.9-9-7.6-19.4-7.6-30.3c0-15.1 5.3-29 14-40c-8.8-11-14-24.9-14-40l0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40c0 8.8 7.2 16 16 16s16-7.2 16-16l0-40 0-40zM192 64s0 0 0 0c18 0 34.6 6 48 16l208 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-82 0c1.3 5.1 2 10.5 2 16c0 25.3-14.7 47.2-36 57.6c2.6 7 4 14.5 4 22.4c0 20-9.2 37.9-23.6 49.7c4.9 9 7.6 19.4 7.6 30.3c0 35.3-28.7 64-64 64l-64 0-24 0C75.2 448 0 372.8 0 280l0-48C0 139.2 75.2 64 168 64l24 0zm64 336c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l64 0zm16-176c0 5.5-.7 10.9-2 16l2 0 32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0 16zm-24 64l-40 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-24 0z"]
};
const faFaceSmileBeam = {
  prefix: 'far',
  iconName: 'face-smile-beam',
  icon: [512, 512, [128522, "smile-beam"], "f5b8", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm177.6 62.1C192.8 334.5 218.8 352 256 352s63.2-17.5 78.4-33.9c9-9.7 24.2-10.4 33.9-1.4s10.4 24.2 1.4 33.9c-22 23.8-60 49.4-113.6 49.4s-91.7-25.5-113.6-49.4c-9-9.7-8.4-24.9 1.4-33.9s24.9-8.4 33.9 1.4zm40-89.3s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faSmileBeam = faFaceSmileBeam;
const faFaceGrinStars = {
  prefix: 'far',
  iconName: 'face-grin-stars',
  icon: [512, 512, [129321, "grin-stars"], "f587", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM183.2 132.6c-1.3-2.8-4.1-4.6-7.2-4.6s-5.9 1.8-7.2 4.6l-16.6 34.7-38.1 5c-3.1 .4-5.6 2.5-6.6 5.5s-.1 6.2 2.1 8.3l27.9 26.5-7 37.8c-.6 3 .7 6.1 3.2 7.9s5.8 2 8.5 .6L176 240.5l33.8 18.3c2.7 1.5 6 1.3 8.5-.6s3.7-4.9 3.2-7.9l-7-37.8L242.4 186c2.2-2.1 3.1-5.3 2.1-8.3s-3.5-5.1-6.6-5.5l-38.1-5-16.6-34.7zm160 0c-1.3-2.8-4.1-4.6-7.2-4.6s-5.9 1.8-7.2 4.6l-16.6 34.7-38.1 5c-3.1 .4-5.6 2.5-6.6 5.5s-.1 6.2 2.1 8.3l27.9 26.5-7 37.8c-.6 3 .7 6.1 3.2 7.9s5.8 2 8.5 .6L336 240.5l33.8 18.3c2.7 1.5 6 1.3 8.5-.6s3.7-4.9 3.2-7.9l-7-37.8L402.4 186c2.2-2.1 3.1-5.3 2.1-8.3s-3.5-5.1-6.6-5.5l-38.1-5-16.6-34.7zm6.3 175.8c-28.9 6.8-60.5 10.5-93.6 10.5s-64.7-3.7-93.6-10.5c-18.7-4.4-35.9 12-25.5 28.1c24.6 38.1 68.7 63.5 119.1 63.5s94.5-25.4 119.1-63.5c10.4-16.1-6.8-32.5-25.5-28.1z"]
};
const faGrinStars = faFaceGrinStars;
const faAddressBook = {
  prefix: 'far',
  iconName: 'address-book',
  icon: [512, 512, [62138, "contact-book"], "f2b9", "M384 48c8.8 0 16 7.2 16 16l0 384c0 8.8-7.2 16-16 16L96 464c-8.8 0-16-7.2-16-16L80 64c0-8.8 7.2-16 16-16l288 0zM96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L96 0zM240 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80l-64 0zM512 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64zM496 192c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8-7.2-16-16-16zm16 144c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64z"]
};
const faContactBook = faAddressBook;
const faComments = {
  prefix: 'far',
  iconName: 'comments',
  icon: [640, 512, [128490, 61670], "f086", "M88.2 309.1c9.8-18.3 6.8-40.8-7.5-55.8C59.4 230.9 48 204 48 176c0-63.5 63.8-128 160-128s160 64.5 160 128s-63.8 128-160 128c-13.1 0-25.8-1.3-37.8-3.6c-10.4-2-21.2-.6-30.7 4.2c-4.1 2.1-8.3 4.1-12.6 6c-16 7.2-32.9 13.5-49.9 18c2.8-4.6 5.4-9.1 7.9-13.6c1.1-1.9 2.2-3.9 3.2-5.9zM208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 41.8 17.2 80.1 45.9 110.3c-.9 1.7-1.9 3.5-2.8 5.1c-10.3 18.4-22.3 36.5-36.6 52.1c-6.6 7-8.3 17.2-4.6 25.9C5.8 378.3 14.4 384 24 384c43 0 86.5-13.3 122.7-29.7c4.8-2.2 9.6-4.5 14.2-6.8c15.1 3 30.9 4.5 47.1 4.5zM432 480c16.2 0 31.9-1.6 47.1-4.5c4.6 2.3 9.4 4.6 14.2 6.8C529.5 498.7 573 512 616 512c9.6 0 18.2-5.7 22-14.5c3.8-8.8 2-19-4.6-25.9c-14.2-15.6-26.2-33.7-36.6-52.1c-.9-1.7-1.9-3.4-2.8-5.1C622.8 384.1 640 345.8 640 304c0-94.4-87.9-171.5-198.2-175.8c4.1 15.2 6.2 31.2 6.2 47.8l0 .6c87.2 6.7 144 67.5 144 127.4c0 28-11.4 54.9-32.7 77.2c-14.3 15-17.3 37.6-7.5 55.8c1.1 2 2.2 4 3.2 5.9c2.5 4.5 5.2 9 7.9 13.6c-17-4.5-33.9-10.7-49.9-18c-4.3-1.9-8.5-3.9-12.6-6c-9.5-4.8-20.3-6.2-30.7-4.2c-12.1 2.4-24.8 3.6-37.8 3.6c-61.7 0-110-26.5-136.8-62.3c-16 5.4-32.8 9.4-50 11.8C279 439.8 350 480 432 480z"]
};
const faPaste = {
  prefix: 'far',
  iconName: 'paste',
  icon: [512, 512, ["file-clipboard"], "f0ea", "M104.6 48L64 48C28.7 48 0 76.7 0 112L0 384c0 35.3 28.7 64 64 64l96 0 0-48-96 0c-8.8 0-16-7.2-16-16l0-272c0-8.8 7.2-16 16-16l16 0c0 17.7 14.3 32 32 32l72.4 0C202 108.4 227.6 96 256 96l62 0c-7.1-27.6-32.2-48-62-48l-40.6 0C211.6 20.9 188.2 0 160 0s-51.6 20.9-55.4 48zM144 56a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM448 464l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L464 243.9 464 448c0 8.8-7.2 16-16 16zM256 512l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9l-67.9-67.9c-9-9-21.2-14.1-33.9-14.1L256 128c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64z"]
};
const faFileClipboard = faPaste;
const faFaceGrinTongueSquint = {
  prefix: 'far',
  iconName: 'face-grin-tongue-squint',
  icon: [512, 512, [128541, "grin-tongue-squint"], "f58a", "M464 256c0-114.9-93.1-208-208-208S48 141.1 48 256c0 81.7 47.1 152.4 115.7 186.4c-2.4-8.4-3.7-17.3-3.7-26.4l0-23.3c-24-17.5-43.1-41.4-54.8-69.2c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19c12.3-3.8 24.3 6.9 19.3 18.7c-11.8 28-31.1 52-55.4 69.6l0 22.9c0 9.2-1.3 18-3.7 26.4C416.9 408.4 464 337.7 464 256zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm116-98.9c0-9 9.6-14.7 17.5-10.5l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6zm262.5-10.5c7.9-4.2 17.5 1.5 17.5 10.5c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9zM320 416l0-37.4c0-14.7-11.9-26.6-26.6-26.6l-2 0c-11.3 0-21.1 7.9-23.6 18.9c-2.8 12.6-20.8 12.6-23.6 0c-2.5-11.1-12.3-18.9-23.6-18.9l-2 0c-14.7 0-26.6 11.9-26.6 26.6l0 37.4c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faGrinTongueSquint = faFaceGrinTongueSquint;
const faFaceFlushed = {
  prefix: 'far',
  iconName: 'face-flushed',
  icon: [512, 512, [128563, "flushed"], "f579", "M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM160.4 248a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm216-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM192 336c-13.3 0-24 10.7-24 24s10.7 24 24 24l128 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-128 0zM160 176a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm0 128a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm144-80a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm128 0a80 80 0 1 0 -160 0 80 80 0 1 0 160 0z"]
};
const faFlushed = faFaceFlushed;
const faSquareCaretRight = {
  prefix: 'far',
  iconName: 'square-caret-right',
  icon: [448, 512, ["caret-square-right"], "f152", "M400 96c0-8.8-7.2-16-16-16L64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-320zM384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM320 256c0 6.7-2.8 13-7.7 17.6l-112 104c-7 6.5-17.2 8.2-25.9 4.4s-14.4-12.5-14.4-22l0-208c0-9.5 5.7-18.2 14.4-22s18.9-2.1 25.9 4.4l112 104c4.9 4.5 7.7 10.9 7.7 17.6z"]
};
const faCaretSquareRight = faSquareCaretRight;
const faSquareMinus = {
  prefix: 'far',
  iconName: 'square-minus',
  icon: [448, 512, [61767, "minus-square"], "f146", "M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80zM0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM152 232l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faMinusSquare = faSquareMinus;
const faCompass = {
  prefix: 'far',
  iconName: 'compass',
  icon: [512, 512, [129517], "f14e", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm306.7 69.1L162.4 380.6c-19.4 7.5-38.5-11.6-31-31l55.5-144.3c3.3-8.5 9.9-15.1 18.4-18.4l144.3-55.5c19.4-7.5 38.5 11.6 31 31L325.1 306.7c-3.2 8.5-9.9 15.1-18.4 18.4zM288 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faSquareCaretDown = {
  prefix: 'far',
  iconName: 'square-caret-down',
  icon: [448, 512, ["caret-square-down"], "f150", "M384 432c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0zm64-16c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320zM224 352c-6.7 0-13-2.8-17.6-7.7l-104-112c-6.5-7-8.2-17.2-4.4-25.9s12.5-14.4 22-14.4l208 0c9.5 0 18.2 5.7 22 14.4s2.1 18.9-4.4 25.9l-104 112c-4.5 4.9-10.9 7.7-17.6 7.7z"]
};
const faCaretSquareDown = faSquareCaretDown;
const faFaceKissBeam = {
  prefix: 'far',
  iconName: 'face-kiss-beam',
  icon: [512, 512, [128537, "kiss-beam"], "f597", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm304.7 41.7c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C274.7 427.1 257.4 432 240 432c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4zm-87.1-68.9s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faKissBeam = faFaceKissBeam;
const faLightbulb = {
  prefix: 'far',
  iconName: 'lightbulb',
  icon: [384, 512, [128161], "f0eb", "M297.2 248.9C311.6 228.3 320 203.2 320 176c0-70.7-57.3-128-128-128S64 105.3 64 176c0 27.2 8.4 52.3 22.8 72.9c3.7 5.3 8.1 11.3 12.8 17.7c0 0 0 0 0 0c12.9 17.7 28.3 38.9 39.8 59.8c10.4 19 15.7 38.8 18.3 57.5L109 384c-2.2-12-5.9-23.7-11.8-34.5c-9.9-18-22.2-34.9-34.5-51.8c0 0 0 0 0 0s0 0 0 0c-5.2-7.1-10.4-14.2-15.4-21.4C27.6 247.9 16 213.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176c0 37.3-11.6 71.9-31.4 100.3c-5 7.2-10.2 14.3-15.4 21.4c0 0 0 0 0 0s0 0 0 0c-12.3 16.8-24.6 33.7-34.5 51.8c-5.9 10.8-9.6 22.5-11.8 34.5l-48.6 0c2.6-18.7 7.9-38.6 18.3-57.5c11.5-20.9 26.9-42.1 39.8-59.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0c4.7-6.4 9-12.4 12.7-17.7zM192 128c-26.5 0-48 21.5-48 48c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16s-7.2 16-16 16zm0 384c-44.2 0-80-35.8-80-80l0-16 160 0 0 16c0 44.2-35.8 80-80 80z"]
};
const faFlag = {
  prefix: 'far',
  iconName: 'flag',
  icon: [448, 512, [127988, 61725], "f024", "M48 24C48 10.7 37.3 0 24 0S0 10.7 0 24L0 64 0 350.5 0 400l0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-100 80.3-20.1c41.1-10.3 84.6-5.5 122.5 13.4c44.2 22.1 95.5 24.8 141.7 7.4l34.7-13c12.5-4.7 20.8-16.6 20.8-30l0-279.7c0-23-24.2-38-44.8-27.7l-9.6 4.8c-46.3 23.2-100.8 23.2-147.1 0c-35.1-17.6-75.4-22-113.5-12.5L48 52l0-28zm0 77.5l96.6-24.2c27-6.7 55.5-3.6 80.4 8.8c54.9 27.4 118.7 29.7 175 6.8l0 241.8-24.4 9.1c-33.7 12.6-71.2 10.7-103.4-5.4c-48.2-24.1-103.3-30.1-155.6-17.1L48 338.5l0-237z"]
};
const faSquareCheck = {
  prefix: 'far',
  iconName: 'square-check',
  icon: [448, 512, [9745, 9989, 61510, "check-square"], "f14a", "M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80zM0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faCheckSquare = faSquareCheck;
const faCircleDot = {
  prefix: 'far',
  iconName: 'circle-dot',
  icon: [512, 512, [128280, "dot-circle"], "f192", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faDotCircle = faCircleDot;
const faFaceDizzy = {
  prefix: 'far',
  iconName: 'face-dizzy',
  icon: [512, 512, ["dizzy"], "f567", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 32a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM103 135c9.4-9.4 24.6-9.4 33.9 0l23 23 23-23c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-23 23 23 23c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-23-23-23 23c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l23-23-23-23c-9.4-9.4-9.4-24.6 0-33.9zm192 0c9.4-9.4 24.6-9.4 33.9 0l23 23 23-23c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-23 23 23 23c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-23-23-23 23c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l23-23-23-23c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faDizzy = faFaceDizzy;
const faFutbol = {
  prefix: 'far',
  iconName: 'futbol',
  icon: [512, 512, [9917, "futbol-ball", "soccer-ball"], "f1e3", "M435.4 361.4l-89.7-6c-5.2-.3-10.3 1.1-14.5 4.2s-7.2 7.4-8.4 12.5l-22 87.2c-14.4 3.2-29.4 4.8-44.8 4.8s-30.3-1.7-44.8-4.8l-22-87.2c-1.3-5-4.3-9.4-8.4-12.5s-9.3-4.5-14.5-4.2l-89.7 6C61.7 335.9 51.9 307 49 276.2L125 228.3c4.4-2.8 7.6-7 9.2-11.9s1.4-10.2-.5-15L100.4 118c19.9-22.4 44.6-40.5 72.4-52.7l69.1 57.6c4 3.3 9 5.1 14.1 5.1s10.2-1.8 14.1-5.1l69.1-57.6c27.8 12.2 52.5 30.3 72.4 52.7l-33.4 83.4c-1.9 4.8-2.1 10.1-.5 15s4.9 9.1 9.2 11.9L463 276.2c-3 30.8-12.7 59.7-27.6 85.2zM256 48l.9 0-1.8 0 .9 0zM56.7 196.2c.9-3 1.9-6.1 2.9-9.1l-2.9 9.1zM132 423l3.8 2.7c-1.3-.9-2.5-1.8-3.8-2.7zm248.1-.1c-1.3 1-2.6 2-4 2.9l4-2.9zm75.2-226.7l-3-9.2c1.1 3 2.1 6.1 3 9.2zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm14.1-325.7c-8.4-6.1-19.8-6.1-28.2 0L194 221c-8.4 6.1-11.9 16.9-8.7 26.8l18.3 56.3c3.2 9.9 12.4 16.6 22.8 16.6l59.2 0c10.4 0 19.6-6.7 22.8-16.6l18.3-56.3c3.2-9.9-.3-20.7-8.7-26.8l-47.9-34.8z"]
};
const faFutbolBall = faFutbol;
const faSoccerBall = faFutbol;
const faPenToSquare = {
  prefix: 'far',
  iconName: 'pen-to-square',
  icon: [512, 512, ["edit"], "f044", "M441 58.9L453.1 71c9.4 9.4 9.4 24.6 0 33.9L424 134.1 377.9 88 407 58.9c9.4-9.4 24.6-9.4 33.9 0zM209.8 256.2L344 121.9 390.1 168 255.8 302.2c-2.9 2.9-6.5 5-10.4 6.1l-58.5 16.7 16.7-58.5c1.1-3.9 3.2-7.5 6.1-10.4zM373.1 25L175.8 222.2c-8.7 8.7-15 19.4-18.3 31.1l-28.6 100c-2.4 8.4-.1 17.4 6.1 23.6s15.2 8.5 23.6 6.1l100-28.6c11.8-3.4 22.5-9.7 31.1-18.3L487 138.9c28.1-28.1 28.1-73.7 0-101.8L474.9 25C446.8-3.1 401.2-3.1 373.1 25zM88 64C39.4 64 0 103.4 0 152L0 424c0 48.6 39.4 88 88 88l272 0c48.6 0 88-39.4 88-88l0-112c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 112c0 22.1-17.9 40-40 40L88 464c-22.1 0-40-17.9-40-40l0-272c0-22.1 17.9-40 40-40l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L88 64z"]
};
const faEdit = faPenToSquare;
const faHourglassHalf = {
  prefix: 'far',
  iconName: 'hourglass-half',
  icon: [384, 512, ["hourglass-2"], "f252", "M0 24C0 10.7 10.7 0 24 0L360 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 19c0 40.3-16 79-44.5 107.5L225.9 256l81.5 81.5C336 366 352 404.7 352 445l0 19 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-19c0-40.3 16-79 44.5-107.5L158.1 256 76.5 174.5C48 146 32 107.3 32 67l0-19-8 0C10.7 48 0 37.3 0 24zM110.5 371.5c-3.9 3.9-7.5 8.1-10.7 12.5l184.4 0c-3.2-4.4-6.8-8.6-10.7-12.5L192 289.9l-81.5 81.5zM284.2 128C297 110.4 304 89 304 67l0-19L80 48l0 19c0 22.1 7 43.4 19.8 61l184.4 0z"]
};
const faHourglass2 = faHourglassHalf;
const faEyeSlash = {
  prefix: 'far',
  iconName: 'eye-slash',
  icon: [640, 512, [], "f070", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"]
};
const faHand = {
  prefix: 'far',
  iconName: 'hand',
  icon: [512, 512, [129306, 9995, "hand-paper"], "f256", "M256 0c-25.3 0-47.2 14.7-57.6 36c-7-2.6-14.5-4-22.4-4c-35.3 0-64 28.7-64 64l0 165.5-2.7-2.7c-25-25-65.5-25-90.5 0s-25 65.5 0 90.5L106.5 437c48 48 113.1 75 181 75l8.5 0 8 0c1.5 0 3-.1 4.5-.4c91.7-6.2 165-79.4 171.1-171.1c.3-1.5 .4-3 .4-4.5l0-176c0-35.3-28.7-64-64-64c-5.5 0-10.9 .7-16 2l0-2c0-35.3-28.7-64-64-64c-7.9 0-15.4 1.4-22.4 4C303.2 14.7 281.3 0 256 0zM240 96.1l0-.1 0-32c0-8.8 7.2-16 16-16s16 7.2 16 16l0 31.9 0 .1 0 136c0 13.3 10.7 24 24 24s24-10.7 24-24l0-136c0 0 0 0 0-.1c0-8.8 7.2-16 16-16s16 7.2 16 16l0 55.9c0 0 0 .1 0 .1l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-71.9c0 0 0-.1 0-.1c0-8.8 7.2-16 16-16s16 7.2 16 16l0 172.9c-.1 .6-.1 1.3-.2 1.9c-3.4 69.7-59.3 125.6-129 129c-.6 0-1.3 .1-1.9 .2l-4.9 0-8.5 0c-55.2 0-108.1-21.9-147.1-60.9L52.7 315.3c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L119 336.4c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2L160 96c0-8.8 7.2-16 16-16c8.8 0 16 7.1 16 15.9L192 232c0 13.3 10.7 24 24 24s24-10.7 24-24l0-135.9z"]
};
const faHandPaper = faHand;
const faHandSpock = {
  prefix: 'far',
  iconName: 'hand-spock',
  icon: [576, 512, [128406], "f259", "M170.2 80.8C161 47 180.8 12 214.6 2.4c34-9.6 69.4 10.2 79 44.2l30.3 107.1L337.1 84c6.6-34.7 40.1-57.5 74.8-50.9c31.4 6 53 33.9 52 64.9c10-2.6 20.8-2.8 31.5-.1c34.3 8.6 55.1 43.3 46.6 77.6L486.7 397.2C469.8 464.7 409.2 512 339.6 512l-33.7 0c-56.9 0-112.2-19-157.2-53.9l-92-71.6c-27.9-21.7-32.9-61.9-11.2-89.8s61.9-32.9 89.8-11.2l17 13.2L100.5 167.5c-13-32.9 3.2-70.1 36-83c11.1-4.4 22.7-5.4 33.7-3.7zm77.1-21.2c-2.4-8.5-11.2-13.4-19.7-11s-13.4 11.2-11 19.7l54.8 182.4c3.5 12.3-3.3 25.2-15.4 29.3s-25.3-2-30-13.9L174.9 138.1c-3.2-8.2-12.5-12.3-20.8-9s-12.3 12.5-9 20.8l73.3 185.6c12 30.3-23.7 57-49.4 37l-63.1-49.1c-7-5.4-17-4.2-22.5 2.8s-4.2 17 2.8 22.5l92 71.6c36.5 28.4 81.4 43.8 127.7 43.8l33.7 0c47.5 0 89-32.4 100.5-78.5l55.4-221.6c2.1-8.6-3.1-17.3-11.6-19.4s-17.3 3.1-19.4 11.6l-26 104C435.6 271.8 425 280 413 280c-16.5 0-28.9-15-25.8-31.2L415.7 99c1.7-8.7-4-17.1-12.7-18.7s-17.1 4-18.7 12.7L352.5 260c-2.2 11.6-12.4 20-24.2 20c-11 0-20.7-7.3-23.7-17.9L247.4 59.6z"]
};
const faFaceKiss = {
  prefix: 'far',
  iconName: 'face-kiss',
  icon: [512, 512, [128535, "kiss"], "f596", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm304.7 25.7c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C274.7 411.1 257.4 416 240 416c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.8-.5-.1-.1-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faKiss = faFaceKiss;
const faFaceGrinTongue = {
  prefix: 'far',
  iconName: 'face-grin-tongue',
  icon: [512, 512, [128539, "grin-tongue"], "f589", "M464 256c0-114.9-93.1-208-208-208S48 141.1 48 256c0 81.7 47.1 152.4 115.7 186.4c-2.4-8.4-3.7-17.3-3.7-26.4l0-52.4c-8.9-8-16.7-17.1-23.1-27.1c-10.4-16.1 6.8-32.5 25.5-28.1c28.9 6.8 60.5 10.5 93.6 10.5s64.7-3.7 93.6-10.5c18.7-4.4 35.9 12 25.5 28.1c-6.4 9.9-14.2 19-23 27l0 52.5c0 9.2-1.3 18-3.7 26.4C416.9 408.4 464 337.7 464 256zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm176.4-80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 416l0-37.4c0-14.7-11.9-26.6-26.6-26.6l-2 0c-11.3 0-21.1 7.9-23.6 18.9c-2.8 12.6-20.8 12.6-23.6 0c-2.5-11.1-12.3-18.9-23.6-18.9l-2 0c-14.7 0-26.6 11.9-26.6 26.6l0 37.4c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faGrinTongue = faFaceGrinTongue;
const faChessBishop = {
  prefix: 'far',
  iconName: 'chess-bishop',
  icon: [320, 512, [9821], "f43a", "M104 0C90.7 0 80 10.7 80 24c0 11.2 7.6 20.6 18 23.2c-7.8 8-16.1 17-24.4 27C38.2 116.7 0 178.8 0 250.9c0 44.8 24.6 72.2 48 87.8L48 352l48 0 0-27c0-9-5-17.2-13-21.3c-18-9.3-35-24.7-35-52.7c0-55.5 29.8-106.8 62.4-145.9c16-19.2 32.1-34.8 44.2-45.5c1.9-1.7 3.7-3.2 5.3-4.6c1.7 1.4 3.4 3 5.3 4.6c12.1 10.7 28.2 26.3 44.2 45.5c5.3 6.3 10.5 13 15.5 20L159 191c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l57.8-57.8c12.8 25.9 21.2 54.3 21.2 83.8c0 28-17 43.4-35 52.7c-8 4.1-13 12.3-13 21.3l0 27 48 0 0-13.3c23.4-15.6 48-42.9 48-87.8c0-72.1-38.2-134.2-73.6-176.7c-8.3-9.9-16.6-19-24.4-27c10.3-2.7 18-12.1 18-23.2c0-13.3-10.7-24-24-24L160 0 104 0zM52.7 464l16.6-32 181.6 0 16.6 32L52.7 464zm207.9-80l-201 0c-12 0-22.9 6.7-28.4 17.3L4.6 452.5c-3 5.8-4.6 12.2-4.6 18.7C0 493.8 18.2 512 40.8 512l238.5 0c22.5 0 40.8-18.2 40.8-40.8c0-6.5-1.6-12.9-4.6-18.7l-26.5-51.2c-5.5-10.6-16.5-17.3-28.4-17.3z"]
};
const faFaceGrinWink = {
  prefix: 'far',
  iconName: 'face-grin-wink',
  icon: [512, 512, ["grin-wink"], "f58c", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm349.5 52.4c18.7-4.4 35.9 12 25.5 28.1C350.4 374.6 306.3 400 255.9 400s-94.5-25.4-119.1-63.5c-10.4-16.1 6.8-32.5 25.5-28.1c28.9 6.8 60.5 10.5 93.6 10.5s64.7-3.7 93.6-10.5zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm165.8 21.7c-7.6 8.1-20.2 8.5-28.3 .9s-8.5-20.2-.9-28.3c14.5-15.5 35.2-22.3 54.6-22.3s40.1 6.8 54.6 22.3c7.6 8.1 7.1 20.7-.9 28.3s-20.7 7.1-28.3-.9c-5.5-5.8-14.8-9.7-25.4-9.7s-19.9 3.8-25.4 9.7z"]
};
const faGrinWink = faFaceGrinWink;
const faFaceGrinWide = {
  prefix: 'far',
  iconName: 'face-grin-wide',
  icon: [512, 512, [128515, "grin-alt"], "f581", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm349.5 52.4c18.7-4.4 35.9 12 25.5 28.1C350.4 374.6 306.3 400 255.9 400s-94.5-25.4-119.1-63.5c-10.4-16.1 6.8-32.5 25.5-28.1c28.9 6.8 60.5 10.5 93.6 10.5s64.7-3.7 93.6-10.5zM224 192c0 35.3-14.3 64-32 64s-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64zm96 64c-17.7 0-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64s-14.3 64-32 64z"]
};
const faGrinAlt = faFaceGrinWide;
const faFaceFrownOpen = {
  prefix: 'far',
  iconName: 'face-frown-open',
  icon: [512, 512, [128550, "frown-open"], "f57a", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM182.4 382.5c-12.4 5.2-26.5-4.1-21.1-16.4c16-36.6 52.4-62.1 94.8-62.1s78.8 25.6 94.8 62.1c5.4 12.3-8.7 21.6-21.1 16.4c-22.4-9.5-47.4-14.8-73.7-14.8s-51.3 5.3-73.7 14.8zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faFrownOpen = faFaceFrownOpen;
const faHandPointUp = {
  prefix: 'far',
  iconName: 'hand-point-up',
  icon: [384, 512, [9757], "f0a6", "M64 64l0 177.6c5.2-1 10.5-1.6 16-1.6l16 0 0-32L96 64c0-8.8-7.2-16-16-16s-16 7.2-16 16zM80 288c-17.7 0-32 14.3-32 32c0 0 0 0 0 0l0 24c0 66.3 53.7 120 120 120l48 0c52.5 0 97.1-33.7 113.4-80.7c-3.1 .5-6.2 .7-9.4 .7c-20 0-37.9-9.2-49.7-23.6c-9 4.9-19.4 7.6-30.3 7.6c-15.1 0-29-5.3-40-14c-11 8.8-24.9 14-40 14l-40 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l40 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-40 0-40 0zM0 320s0 0 0 0c0-18 6-34.6 16-48L16 64C16 28.7 44.7 0 80 0s64 28.7 64 64l0 82c5.1-1.3 10.5-2 16-2c25.3 0 47.2 14.7 57.6 36c7-2.6 14.5-4 22.4-4c20 0 37.9 9.2 49.7 23.6c9-4.9 19.4-7.6 30.3-7.6c35.3 0 64 28.7 64 64l0 64 0 24c0 92.8-75.2 168-168 168l-48 0C75.2 512 0 436.8 0 344l0-24zm336-64c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48 0 16c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64zM160 240c5.5 0 10.9 .7 16 2l0-2 0-32c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 32 16 0zm64 24l0 40c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48 0-16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 24z"]
};
const faBookmark = {
  prefix: 'far',
  iconName: 'bookmark',
  icon: [384, 512, [128278, 61591], "f02e", "M0 48C0 21.5 21.5 0 48 0l0 48 0 393.4 130.1-92.9c8.3-6 19.6-6 27.9 0L336 441.4 336 48 48 48 48 0 336 0c26.5 0 48 21.5 48 48l0 440c0 9-5 17.2-13 21.3s-17.6 3.4-24.9-1.8L192 397.5 37.9 507.5c-7.3 5.2-16.9 5.9-24.9 1.8S0 497 0 488L0 48z"]
};
const faHandPointDown = {
  prefix: 'far',
  iconName: 'hand-point-down',
  icon: [384, 512, [], "f0a7", "M64 448l0-177.6c5.2 1 10.5 1.6 16 1.6l16 0 0 32 0 144c0 8.8-7.2 16-16 16s-16-7.2-16-16zM80 224c-17.7 0-32-14.3-32-32c0 0 0 0 0 0l0-24c0-66.3 53.7-120 120-120l48 0c52.5 0 97.1 33.7 113.4 80.7c-3.1-.5-6.2-.7-9.4-.7c-20 0-37.9 9.2-49.7 23.6c-9-4.9-19.4-7.6-30.3-7.6c-15.1 0-29 5.3-40 14c-11-8.8-24.9-14-40-14l-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-40 0-40 0zM0 192s0 0 0 0c0 18 6 34.6 16 48l0 208c0 35.3 28.7 64 64 64s64-28.7 64-64l0-82c5.1 1.3 10.5 2 16 2c25.3 0 47.2-14.7 57.6-36c7 2.6 14.5 4 22.4 4c20 0 37.9-9.2 49.7-23.6c9 4.9 19.4 7.6 30.3 7.6c35.3 0 64-28.7 64-64l0-64 0-24C384 75.2 308.8 0 216 0L168 0C75.2 0 0 75.2 0 168l0 24zm336 64c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64zM160 272c5.5 0 10.9-.7 16-2l0 2 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-32 16 0zm64-24l0-40c0-8.8 7.2-16 16-16s16 7.2 16 16l0 48 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-24z"]
};
const faFolder = {
  prefix: 'far',
  iconName: 'folder',
  icon: [512, 512, [128193, 128447, 61716, "folder-blank"], "f07b", "M0 96C0 60.7 28.7 32 64 32l132.1 0c19.1 0 37.4 7.6 50.9 21.1L289.9 96 448 96c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-256c0-8.8-7.2-16-16-16l-161.4 0c-10.6 0-20.8-4.2-28.3-11.7L213.1 87c-4.5-4.5-10.6-7-17-7L64 80z"]
};
const faFolderBlank = faFolder;
const faUser = {
  prefix: 'far',
  iconName: 'user',
  icon: [448, 512, [128100, 62144], "f007", "M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464l349.5 0c-8.9-63.3-63.3-112-129-112l-91.4 0c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3z"]
};
const faSquareCaretLeft = {
  prefix: 'far',
  iconName: 'square-caret-left',
  icon: [448, 512, ["caret-square-left"], "f191", "M48 416c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80c-8.8 0-16 7.2-16 16l0 320zm16 64c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480zm64-224c0-6.7 2.8-13 7.7-17.6l112-104c7-6.5 17.2-8.2 25.9-4.4s14.4 12.5 14.4 22l0 208c0 9.5-5.7 18.2-14.4 22s-18.9 2.1-25.9-4.4l-112-104c-4.9-4.5-7.7-10.9-7.7-17.6z"]
};
const faCaretSquareLeft = faSquareCaretLeft;
const faStar = {
  prefix: 'far',
  iconName: 'star',
  icon: [576, 512, [11088, 61446], "f005", "M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.7 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z"]
};
const faChessKnight = {
  prefix: 'far',
  iconName: 'chess-knight',
  icon: [448, 512, [9822], "f441", "M226.6 48L117.3 48l17.1 12.8c6 4.5 9.6 11.6 9.6 19.2s-3.6 14.7-9.6 19.2l-6.5 4.9c-10 7.5-16 19.3-16 31.9l-.3 91c0 10.2 4.9 19.9 13.2 25.8l1.9 1.3c9.9 7.1 23.3 7 33.2-.1l49.9-36.3c10.7-7.8 25.7-5.4 33.5 5.3s5.4 25.7-5.3 33.5l-49.9 36.3-53.8 39.1c-7.3 5.3-13 12.2-16.9 20.1l-50.7 0c5.3-22.1 17.8-41.9 35.9-56.3c-1.3-.8-2.6-1.7-3.8-2.6L97 291.8c-21-15-33.4-39.2-33.3-65l.3-91c.1-19.8 6.7-38.7 18.6-53.9l-.4-.3C70.7 73 64 59.6 64 45.3C64 20.3 84.3 0 109.3 0L226.6 0C331.2 0 416 84.8 416 189.4c0 11.1-1 22.2-2.9 33.2L390.1 352l-48.8 0 24.5-137.8c1.5-8.2 2.2-16.5 2.2-24.8C368 111.3 304.7 48 226.6 48zM85.2 432L68.7 464l310.7 0-16.6-32L85.2 432zm315.7-30.7l26.5 51.2c3 5.8 4.6 12.2 4.6 18.7c0 22.5-18.2 40.8-40.8 40.8L56.8 512C34.2 512 16 493.8 16 471.2c0-6.5 1.6-12.9 4.6-18.7l26.5-51.2C52.5 390.7 63.5 384 75.5 384l297 0c12 0 22.9 6.7 28.4 17.3zM172 128a20 20 0 1 1 0 40 20 20 0 1 1 0-40z"]
};
const faFaceLaughSquint = {
  prefix: 'far',
  iconName: 'face-laugh-squint',
  icon: [512, 512, ["laugh-squint"], "f59b", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm130.7 57.9c-4.2-13.6 7.1-25.9 21.3-25.9l212.5 0c14.2 0 25.5 12.4 21.3 25.9C369 368.4 318.2 408 258.2 408s-110.8-39.6-127.5-94.1zm2.8-183.3l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 141.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
};
const faLaughSquint = faFaceLaughSquint;
const faFaceLaugh = {
  prefix: 'far',
  iconName: 'face-laugh',
  icon: [512, 512, ["laugh"], "f599", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm130.7 57.9c-4.2-13.6 7.1-25.9 21.3-25.9l212.5 0c14.2 0 25.5 12.4 21.3 25.9C369 368.4 318.2 408 258.2 408s-110.8-39.6-127.5-94.1zM144.4 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faLaugh = faFaceLaugh;
const faFolderOpen = {
  prefix: 'far',
  iconName: 'folder-open',
  icon: [576, 512, [128194, 128449, 61717], "f07c", "M384 480l48 0c11.4 0 21.9-6 27.6-15.9l112-192c5.8-9.9 5.8-22.1 .1-32.1S555.5 224 544 224l-400 0c-11.4 0-21.9 6-27.6 15.9L48 357.1 48 96c0-8.8 7.2-16 16-16l117.5 0c4.2 0 8.3 1.7 11.3 4.7l26.5 26.5c21 21 49.5 32.8 79.2 32.8L416 144c8.8 0 16 7.2 16 16l0 32 48 0 0-32c0-35.3-28.7-64-64-64L298.5 96c-17 0-33.3-6.7-45.3-18.7L226.7 50.7c-12-12-28.3-18.7-45.3-18.7L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l23.7 0L384 480z"]
};
const faClipboard = {
  prefix: 'far',
  iconName: 'clipboard',
  icon: [384, 512, [128203], "f328", "M280 64l40 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l40 0 9.6 0C121 27.5 153.3 0 192 0s71 27.5 78.4 64l9.6 0zM64 112c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16l-16 0 0 24c0 13.3-10.7 24-24 24l-88 0-88 0c-13.3 0-24-10.7-24-24l0-24-16 0zm128-8a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faChessQueen = {
  prefix: 'far',
  iconName: 'chess-queen',
  icon: [512, 512, [9819], "f445", "M256 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-95.2-8c-18.1 0-31.3 12.8-35.6 26.9c-8 26.2-32.4 45.2-61.2 45.2c-10 0-19.4-2.3-27.7-6.3c-7.6-3.7-16.7-3.3-24 1.2C.7 162.1-3.1 177.1 3.7 188.9L97.6 352l55.4 0-83-144.1c40.5-2.2 75.3-25.9 93.1-59.8c22 26.8 55.4 43.9 92.8 43.9s70.8-17.1 92.8-43.9c17.8 34 52.6 57.7 93.1 59.8L359 352l55.4 0 93.9-163.1c6.8-11.7 3-26.7-8.6-33.8c-7.3-4.5-16.4-4.9-24-1.2c-8.4 4-17.7 6.3-27.7 6.3c-28.8 0-53.2-19-61.2-45.2C382.5 100.8 369.3 88 351.2 88c-14.5 0-26.3 8.5-32.4 19.3c-12.4 22-35.9 36.7-62.8 36.7s-50.4-14.8-62.8-36.7C187.1 96.5 175.4 88 160.8 88zM133.2 432l245.6 0 16.6 32-278.7 0 16.6-32zm283.7-30.7c-5.5-10.6-16.5-17.3-28.4-17.3l-265 0c-12 0-22.9 6.7-28.4 17.3L68.6 452.5c-3 5.8-4.6 12.2-4.6 18.7c0 22.5 18.2 40.8 40.8 40.8l302.5 0c22.5 0 40.8-18.2 40.8-40.8c0-6.5-1.6-12.9-4.6-18.7l-26.5-51.2z"]
};
const faHandBackFist = {
  prefix: 'far',
  iconName: 'hand-back-fist',
  icon: [448, 512, ["hand-rock"], "f255", "M144 64c0-8.8 7.2-16 16-16s16 7.2 16 16c0 9.1 5.1 17.4 13.3 21.5s17.9 3.2 25.1-2.3c2.7-2 6-3.2 9.6-3.2c8.8 0 16 7.2 16 16c0 9.1 5.1 17.4 13.3 21.5s17.9 3.2 25.1-2.3c2.7-2 6-3.2 9.6-3.2c8.8 0 16 7.2 16 16c0 9.1 5.1 17.4 13.3 21.5s17.9 3.2 25.1-2.3c2.7-2 6-3.2 9.6-3.2c8.8 0 16 7.2 16 16l0 104c0 31.3-20 58-48 67.9c-9.6 3.4-16 12.5-16 22.6L304 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-117.8c38-20.1 64-60.1 64-106.2l0-104c0-35.3-28.7-64-64-64c-2.8 0-5.6 .2-8.3 .5C332.8 77.1 311.9 64 288 64c-2.8 0-5.6 .2-8.3 .5C268.8 45.1 247.9 32 224 32c-2.8 0-5.6 .2-8.3 .5C204.8 13.1 183.9 0 160 0C124.7 0 96 28.7 96 64l0 64.3c-11.7 7.4-22.5 16.4-32 26.9l17.8 16.1L64 155.2l-9.4 10.5C40 181.8 32 202.8 32 224.6l0 12.8c0 49.6 24.2 96.1 64.8 124.5l13.8-19.7L96.8 361.9l8.9 6.2c6.9 4.8 14.4 8.6 22.3 11.3L128 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-128.1c0-12.6-9.8-23.1-22.4-23.9c-7.3-.5-14.3-2.9-20.3-7.1l-13.1 18.7 13.1-18.7-8.9-6.2C96.6 303.1 80 271.3 80 237.4l0-12.8c0-9.9 3.7-19.4 10.3-26.8l9.4-10.5c3.8-4.2 7.9-8.1 12.3-11.6l0 32.3c0 8.8 7.2 16 16 16s16-7.2 16-16l0-65.7 0-14.3 0-64z"]
};
const faHandRock = faHandBackFist;
const faSquareCaretUp = {
  prefix: 'far',
  iconName: 'square-caret-up',
  icon: [448, 512, ["caret-square-up"], "f151", "M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80zM0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm224 64c6.7 0 13 2.8 17.6 7.7l104 112c6.5 7 8.2 17.2 4.4 25.9s-12.5 14.4-22 14.4l-208 0c-9.5 0-18.2-5.7-22-14.4s-2.1-18.9 4.4-25.9l104-112c4.5-4.9 10.9-7.7 17.6-7.7z"]
};
const faCaretSquareUp = faSquareCaretUp;
const faChartBar = {
  prefix: 'far',
  iconName: 'chart-bar',
  icon: [512, 512, ["bar-chart"], "f080", "M24 32c13.3 0 24 10.7 24 24l0 352c0 13.3 10.7 24 24 24l416 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L72 480c-39.8 0-72-32.2-72-72L0 56C0 42.7 10.7 32 24 32zM128 136c0-13.3 10.7-24 24-24l208 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-208 0c-13.3 0-24-10.7-24-24zm24 72l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm0 96l272 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-272 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faBarChart = faChartBar;
const faWindowRestore = {
  prefix: 'far',
  iconName: 'window-restore',
  icon: [512, 512, [], "f2d2", "M432 48L208 48c-17.7 0-32 14.3-32 32l0 16-48 0 0-16c0-44.2 35.8-80 80-80L432 0c44.2 0 80 35.8 80 80l0 224c0 44.2-35.8 80-80 80l-16 0 0-48 16 0c17.7 0 32-14.3 32-32l0-224c0-17.7-14.3-32-32-32zM48 448c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-192L48 256l0 192zM64 128l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64z"]
};
const faSquarePlus = {
  prefix: 'far',
  iconName: 'square-plus',
  icon: [448, 512, [61846, "plus-square"], "f0fe", "M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80zM0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM200 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
};
const faPlusSquare = faSquarePlus;
const faImage = {
  prefix: 'far',
  iconName: 'image',
  icon: [512, 512, [], "f03e", "M448 80c8.8 0 16 7.2 16 16l0 319.8-5-6.5-136-176c-4.5-5.9-11.6-9.3-19-9.3s-14.4 3.4-19 9.3L202 340.7l-30.5-42.7C167 291.7 159.8 288 152 288s-15 3.7-19.5 10.1l-80 112L48 416.3l0-.3L48 96c0-8.8 7.2-16 16-16l384 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm80 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faFolderClosed = {
  prefix: 'far',
  iconName: 'folder-closed',
  icon: [512, 512, [], "e185", "M251.7 127.6s0 0 0 0c10.5 10.5 24.7 16.4 39.6 16.4L448 144c8.8 0 16 7.2 16 16l0 32L48 192l0-96c0-8.8 7.2-16 16-16l133.5 0c4.2 0 8.3 1.7 11.3 4.7l33.9-33.9L208.8 84.7l42.9 42.9zM48 240l416 0 0 176c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16l0-176zM285.7 93.7L242.7 50.7c-12-12-28.3-18.7-45.3-18.7L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L291.3 96c-2.1 0-4.2-.8-5.7-2.3z"]
};
const faLemon = {
  prefix: 'far',
  iconName: 'lemon',
  icon: [448, 512, [127819], "f094", "M368 80c-3.2 0-6.2 .4-8.9 1.3C340 86.8 313 91.9 284.8 84.6C227.4 69.7 160.2 92 110.1 142.1S37.7 259.4 52.6 316.8c7.3 28.2 2.2 55.2-3.3 74.3c-.8 2.8-1.3 5.8-1.3 8.9c0 17.7 14.3 32 32 32c3.2 0 6.2-.4 8.9-1.3c19.1-5.5 46.1-10.7 74.3-3.3c57.4 14.9 124.6-7.4 174.7-57.5s72.4-117.3 57.5-174.7c-7.3-28.2-2.2-55.2 3.3-74.3c.8-2.8 1.3-5.8 1.3-8.9c0-17.7-14.3-32-32-32zm0-48c44.2 0 80 35.8 80 80c0 7.7-1.1 15.2-3.1 22.3c-4.6 15.8-7.1 32.9-3 48.9c20.1 77.6-10.9 161.5-70 220.7s-143.1 90.2-220.7 70c-16-4.1-33-1.6-48.9 3c-7.1 2-14.6 3.1-22.3 3.1c-44.2 0-80-35.8-80-80c0-7.7 1.1-15.2 3.1-22.3c4.6-15.8 7.1-32.9 3-48.9C-14 251.3 17 167.3 76.2 108.2S219.3 18 296.8 38.1c16 4.1 33 1.6 48.9-3c7.1-2 14.6-3.1 22.3-3.1zM246.7 167c-52 15.2-96.5 59.7-111.7 111.7c-3.7 12.7-17.1 20-29.8 16.3s-20-17.1-16.3-29.8c19.8-67.7 76.6-124.5 144.3-144.3c12.7-3.7 26.1 3.6 29.8 16.3s-3.6 26.1-16.3 29.8z"]
};
const faHandshake = {
  prefix: 'far',
  iconName: 'handshake',
  icon: [640, 512, [], "f2b5", "M272.2 64.6l-51.1 51.1c-15.3 4.2-29.5 11.9-41.5 22.5L153 161.9C142.8 171 129.5 176 115.8 176L96 176l0 128c20.4 .6 39.8 8.9 54.3 23.4l35.6 35.6 7 7c0 0 0 0 0 0L219.9 397c6.2 6.2 16.4 6.2 22.6 0c1.7-1.7 3-3.7 3.7-5.8c2.8-7.7 9.3-13.5 17.3-15.3s16.4 .6 22.2 6.5L296.5 393c11.6 11.6 30.4 11.6 41.9 0c5.4-5.4 8.3-12.3 8.6-19.4c.4-8.8 5.6-16.6 13.6-20.4s17.3-3 24.4 2.1c9.4 6.7 22.5 5.8 30.9-2.6c9.4-9.4 9.4-24.6 0-33.9L340.1 243l-35.8 33c-27.3 25.2-69.2 25.6-97 .9c-31.7-28.2-32.4-77.4-1.6-106.5l70.1-66.2C303.2 78.4 339.4 64 377.1 64c36.1 0 71 13.3 97.9 37.2L505.1 128l38.9 0 40 0 40 0c8.8 0 16 7.2 16 16l0 208c0 17.7-14.3 32-32 32l-32 0c-11.8 0-22.2-6.4-27.7-16l-84.9 0c-3.4 6.7-7.9 13.1-13.5 18.7c-17.1 17.1-40.8 23.8-63 20.1c-3.6 7.3-8.5 14.1-14.6 20.2c-27.3 27.3-70 30-100.4 8.1c-25.1 20.8-62.5 19.5-86-4.1L159 404l-7-7-35.6-35.6c-5.5-5.5-12.7-8.7-20.4-9.3C96 369.7 81.6 384 64 384l-32 0c-17.7 0-32-14.3-32-32L0 144c0-8.8 7.2-16 16-16l40 0 40 0 19.8 0c2 0 3.9-.7 5.3-2l26.5-23.6C175.5 77.7 211.4 64 248.7 64L259 64c4.4 0 8.9 .2 13.2 .6zM544 320l0-144-48 0c-5.9 0-11.6-2.2-15.9-6.1l-36.9-32.8c-18.2-16.2-41.7-25.1-66.1-25.1c-25.4 0-49.8 9.7-68.3 27.1l-70.1 66.2c-10.3 9.8-10.1 26.3 .5 35.7c9.3 8.3 23.4 8.1 32.5-.3l71.9-66.4c9.7-9 24.9-8.4 33.9 1.4s8.4 24.9-1.4 33.9l-.8 .8 74.4 74.4c10 10 16.5 22.3 19.4 35.1l74.8 0zM64 336a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm528 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faGem = {
  prefix: 'far',
  iconName: 'gem',
  icon: [512, 512, [128142], "f3a5", "M168.5 72L256 165l87.5-93-175 0zM383.9 99.1L311.5 176l129 0L383.9 99.1zm50 124.9L256 224 78.1 224 256 420.3 433.9 224zM71.5 176l129 0L128.1 99.1 71.5 176zm434.3 40.1l-232 256c-4.5 5-11 7.9-17.8 7.9s-13.2-2.9-17.8-7.9l-232-256c-7.7-8.5-8.3-21.2-1.5-30.4l112-152c4.5-6.1 11.7-9.8 19.3-9.8l240 0c7.6 0 14.8 3.6 19.3 9.8l112 152c6.8 9.2 6.1 21.9-1.5 30.4z"]
};
const faCirclePlay = {
  prefix: 'far',
  iconName: 'circle-play',
  icon: [512, 512, [61469, "play-circle"], "f144", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c7.6-4.2 16.8-4.1 24.3 .5l144 88c7.1 4.4 11.5 12.1 11.5 20.5s-4.4 16.1-11.5 20.5l-144 88c-7.4 4.5-16.7 4.7-24.3 .5s-12.3-12.2-12.3-20.9l0-176c0-8.7 4.7-16.7 12.3-20.9z"]
};
const faPlayCircle = faCirclePlay;
const faCircleCheck = {
  prefix: 'far',
  iconName: 'circle-check',
  icon: [512, 512, [61533, "check-circle"], "f058", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L369 209z"]
};
const faCheckCircle = faCircleCheck;
const faCircleStop = {
  prefix: 'far',
  iconName: 'circle-stop',
  icon: [512, 512, [62094, "stop-circle"], "f28d", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm192-96l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z"]
};
const faStopCircle = faCircleStop;
const faIdBadge = {
  prefix: 'far',
  iconName: 'id-badge',
  icon: [384, 512, [], "f2c1", "M256 48l0 16c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-16L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-384c0-8.8-7.2-16-16-16l-64 0zM0 64C0 28.7 28.7 0 64 0L320 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM160 320l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L96 416c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"]
};
const faFaceLaughBeam = {
  prefix: 'far',
  iconName: 'face-laugh-beam',
  icon: [512, 512, [128513, "laugh-beam"], "f59a", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm130.7 57.9c-4.2-13.6 7.1-25.9 21.3-25.9l212.5 0c14.2 0 25.5 12.4 21.3 25.9C369 368.4 318.2 408 258.2 408s-110.8-39.6-127.5-94.1zm86.9-85.1s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faLaughBeam = faFaceLaughBeam;
const faRegistered = {
  prefix: 'far',
  iconName: 'registered',
  icon: [512, 512, [174], "f25d", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM160 152l0 112 0 96c0 13.3 10.7 24 24 24s24-10.7 24-24l0-72 60.9 0 37.2 81.9c5.5 12.1 19.7 17.4 31.8 11.9s17.4-19.7 11.9-31.8L315.7 275c21.8-14.3 36.3-39 36.3-67c0-44.2-35.8-80-80-80l-88 0c-13.3 0-24 10.7-24 24zm48 88l0-64 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0z"]
};
const faAddressCard = {
  prefix: 'far',
  iconName: 'address-card',
  icon: [576, 512, [62140, "contact-card", "vcard"], "f2bb", "M512 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l448 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM208 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80l-64 0zM376 144c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0z"]
};
const faContactCard = faAddressCard;
const faVcard = faAddressCard;
const faFaceTired = {
  prefix: 'far',
  iconName: 'face-tired',
  icon: [512, 512, [128555, "tired"], "f5c8", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm176.5 64.3C196.1 302.1 223.8 288 256 288s59.9 14.1 79.5 32.3C354.5 338.1 368 362 368 384c0 5.4-2.7 10.4-7.2 13.4s-10.2 3.4-15.2 1.3l-17.2-7.5c-22.8-10-47.5-15.1-72.4-15.1s-49.6 5.2-72.4 15.1l-17.2 7.5c-4.9 2.2-10.7 1.7-15.2-1.3s-7.2-8-7.2-13.4c0-22 13.5-45.9 32.5-63.7zm-43-173.6l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 157.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
};
const faTired = faFaceTired;
const faFontAwesome = {
  prefix: 'far',
  iconName: 'font-awesome',
  icon: [512, 512, [62501, 62694, "font-awesome-flag", "font-awesome-logo-full"], "f2b4", "M91.7 96C106.3 86.8 116 70.5 116 52C116 23.3 92.7 0 64 0S12 23.3 12 52c0 16.7 7.8 31.5 20 41l0 3 0 48 0 256 0 48 0 64 48 0 0-64 389.6 0c14.6 0 26.4-11.8 26.4-26.4c0-3.7-.8-7.3-2.3-10.7L432 272l61.7-138.9c1.5-3.4 2.3-7 2.3-10.7c0-14.6-11.8-26.4-26.4-26.4L91.7 96zM80 400l0-256 356.4 0L388.1 252.5c-5.5 12.4-5.5 26.6 0 39L436.4 400 80 400z"]
};
const faFontAwesomeFlag = faFontAwesome;
const faFontAwesomeLogoFull = faFontAwesome;
const faFaceSmileWink = {
  prefix: 'far',
  iconName: 'face-smile-wink',
  icon: [512, 512, [128521, "smile-wink"], "f4da", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm177.6 62.1C192.8 334.5 218.8 352 256 352s63.2-17.5 78.4-33.9c9-9.7 24.2-10.4 33.9-1.4s10.4 24.2 1.4 33.9c-22 23.8-60 49.4-113.6 49.4s-91.7-25.5-113.6-49.4c-9-9.7-8.4-24.9 1.4-33.9s24.9-8.4 33.9 1.4zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm165.8 21.7c-7.6 8.1-20.2 8.5-28.3 .9s-8.5-20.2-.9-28.3c14.5-15.5 35.2-22.3 54.6-22.3s40.1 6.8 54.6 22.3c7.6 8.1 7.1 20.7-.9 28.3s-20.7 7.1-28.3-.9c-5.5-5.8-14.8-9.7-25.4-9.7s-19.9 3.8-25.4 9.7z"]
};
const faSmileWink = faFaceSmileWink;
const faFileWord = {
  prefix: 'far',
  iconName: 'file-word',
  icon: [384, 512, [], "f1c2", "M48 448L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm55 241.1c-3.8-12.7-17.2-19.9-29.9-16.1s-19.9 17.2-16.1 29.9l48 160c3 10.2 12.4 17.1 23 17.1s19.9-7 23-17.1l25-83.4 25 83.4c3 10.2 12.4 17.1 23 17.1s19.9-7 23-17.1l48-160c3.8-12.7-3.4-26.1-16.1-29.9s-26.1 3.4-29.9 16.1l-25 83.4-25-83.4c-3-10.2-12.4-17.1-23-17.1s-19.9 7-23 17.1l-25 83.4-25-83.4z"]
};
const faFilePowerpoint = {
  prefix: 'far',
  iconName: 'file-powerpoint',
  icon: [384, 512, [], "f1c4", "M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm72 208c-13.3 0-24 10.7-24 24l0 104 0 56c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32 44 0c42 0 76-34 76-76s-34-76-76-76l-68 0zm68 104l-44 0 0-56 44 0c15.5 0 28 12.5 28 28s-12.5 28-28 28z"]
};
const faEnvelopeOpen = {
  prefix: 'far',
  iconName: 'envelope-open',
  icon: [512, 512, [62135], "f2b6", "M255.4 48.2c.2-.1 .4-.2 .6-.2s.4 .1 .6 .2L460.6 194c2.1 1.5 3.4 3.9 3.4 6.5l0 13.6L291.5 355.7c-20.7 17-50.4 17-71.1 0L48 214.1l0-13.6c0-2.6 1.2-5 3.4-6.5L255.4 48.2zM48 276.2L190 392.8c38.4 31.5 93.7 31.5 132 0L464 276.2 464 456c0 4.4-3.6 8-8 8L56 464c-4.4 0-8-3.6-8-8l0-179.8zM256 0c-10.2 0-20.2 3.2-28.5 9.1L23.5 154.9C8.7 165.4 0 182.4 0 200.5L0 456c0 30.9 25.1 56 56 56l400 0c30.9 0 56-25.1 56-56l0-255.5c0-18.1-8.7-35.1-23.4-45.6L284.5 9.1C276.2 3.2 266.2 0 256 0z"]
};
const faFileZipper = {
  prefix: 'far',
  iconName: 'file-zipper',
  icon: [384, 512, ["file-archive"], "f1c6", "M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l48 0c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l48 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm48 112c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm-6.3 71.8L82.1 335.9c-1.4 5.4-2.1 10.9-2.1 16.4c0 35.2 28.8 63.7 64 63.7s64-28.5 64-63.7c0-5.5-.7-11.1-2.1-16.4l-23.5-88.2c-3.7-14-16.4-23.8-30.9-23.8l-14.8 0c-14.5 0-27.2 9.7-30.9 23.8zM128 336l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faFileArchive = faFileZipper;
const faSquare = {
  prefix: 'far',
  iconName: 'square',
  icon: [448, 512, [9632, 9723, 9724, 61590], "f0c8", "M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"]
};
const faSnowflake = {
  prefix: 'far',
  iconName: 'snowflake',
  icon: [448, 512, [10052, 10054], "f2dc", "M224 0c13.3 0 24 10.7 24 24l0 46.1 23-23c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-57 57 0 76.5 66.2-38.2 20.9-77.8c3.4-12.8 16.6-20.4 29.4-17s20.4 16.6 17 29.4L373 142.2l37.1-21.4c11.5-6.6 26.2-2.7 32.8 8.8s2.7 26.2-8.8 32.8L397 183.8l31.5 8.4c12.8 3.4 20.4 16.6 17 29.4s-16.6 20.4-29.4 17l-77.8-20.9L272 256l66.2 38.2 77.8-20.9c12.8-3.4 26 4.2 29.4 17s-4.2 26-17 29.4L397 328.2l37.1 21.4c11.5 6.6 15.4 21.3 8.8 32.8s-21.3 15.4-32.8 8.8L373 369.8l8.4 31.5c3.4 12.8-4.2 26-17 29.4s-26-4.2-29.4-17l-20.9-77.8L248 297.6l0 76.5 57 57c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-23-23 0 46.1c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-46.1-23 23c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l57-57 0-76.5-66.2 38.2-20.9 77.8c-3.4 12.8-16.6 20.4-29.4 17s-20.4-16.6-17-29.4L75 369.8 37.9 391.2c-11.5 6.6-26.2 2.7-32.8-8.8s-2.7-26.2 8.8-32.8L51 328.2l-31.5-8.4c-12.8-3.4-20.4-16.6-17-29.4s16.6-20.4 29.4-17l77.8 20.9L176 256l-66.2-38.2L31.9 238.6c-12.8 3.4-26-4.2-29.4-17s4.2-26 17-29.4L51 183.8 13.9 162.4c-11.5-6.6-15.4-21.3-8.8-32.8s21.3-15.4 32.8-8.8L75 142.2l-8.4-31.5c-3.4-12.8 4.2-26 17-29.4s26 4.2 29.4 17l20.9 77.8L200 214.4l0-76.5L143 81c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l23 23L200 24c0-13.3 10.7-24 24-24z"]
};
const faNewspaper = {
  prefix: 'far',
  iconName: 'newspaper',
  icon: [512, 512, [128240], "f1ea", "M168 80c-13.3 0-24 10.7-24 24l0 304c0 8.4-1.4 16.5-4.1 24L440 432c13.3 0 24-10.7 24-24l0-304c0-13.3-10.7-24-24-24L168 80zM72 480c-39.8 0-72-32.2-72-72L0 112C0 98.7 10.7 88 24 88s24 10.7 24 24l0 296c0 13.3 10.7 24 24 24s24-10.7 24-24l0-304c0-39.8 32.2-72 72-72l272 0c39.8 0 72 32.2 72 72l0 304c0 39.8-32.2 72-72 72L72 480zM176 136c0-13.3 10.7-24 24-24l96 0c13.3 0 24 10.7 24 24l0 80c0 13.3-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24l0-80zm200-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm0 80l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM200 272l208 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-208 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm0 80l208 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-208 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faFaceKissWinkHeart = {
  prefix: 'far',
  iconName: 'face-kiss-wink-heart',
  icon: [512, 512, [128536, "kiss-wink-heart"], "f598", "M338.9 446.8c-25.4 11-53.4 17.2-82.9 17.2C141.1 464 48 370.9 48 256S141.1 48 256 48s208 93.1 208 208c0 22.4-3.5 43.9-10.1 64.1c3.1 4.5 5.7 9.4 7.8 14.6c12.7-1.6 25.1 .4 36.2 5c9.1-26.2 14-54.4 14-83.7C512 114.6 397.4 0 256 0S0 114.6 0 256S114.6 512 256 512c35.4 0 69.1-7.2 99.7-20.2c-4.8-5.5-8.5-12.2-10.4-19.7l-6.5-25.3zM296 316c0-6.9-3.1-13.2-7.3-18.3c-4.3-5.2-10.1-9.7-16.7-13.4C258.7 276.9 241.4 272 224 272c-3.6 0-6.8 2.5-7.7 6s.6 7.2 3.8 9c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2 .1c.2 .1 .5 .3 .9 .5c.8 .5 2 1.2 3.4 2.1c2.8 1.9 6.5 4.5 10.2 7.6c3.7 3.1 7.2 6.6 9.6 10.1c2.5 3.5 3.5 6.4 3.5 8.6s-1 5-3.5 8.6c-2.5 3.5-5.9 6.9-9.6 10.1c-3.7 3.1-7.4 5.7-10.2 7.6c-1.4 .9-2.6 1.6-3.4 2.1c-.4 .2-.7 .4-.9 .5l-.2 .1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c-2.5 1.4-4.1 4.1-4.1 7s1.6 5.6 4.1 7c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2 .1c.2 .1 .5 .3 .9 .5c.8 .5 2 1.2 3.4 2.1c2.8 1.9 6.5 4.5 10.2 7.6c3.7 3.1 7.2 6.6 9.6 10.1c2.5 3.5 3.5 6.4 3.5 8.6s-1 5-3.5 8.6c-2.5 3.5-5.9 6.9-9.6 10.1c-3.7 3.1-7.4 5.7-10.2 7.6c-1.4 .9-2.6 1.6-3.4 2.1c-.4 .2-.7 .4-.9 .5l-.2 .1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-3.2 1.8-4.7 5.5-3.8 9s4.1 6 7.7 6c17.4 0 34.7-4.9 47.9-12.3c6.6-3.7 12.5-8.2 16.7-13.4c4.3-5.1 7.3-11.4 7.3-18.3s-3.1-13.2-7.3-18.3c-4.3-5.2-10.1-9.7-16.7-13.4c-2.7-1.5-5.7-3-8.7-4.3c3.1-1.3 6-2.7 8.7-4.3c6.6-3.7 12.5-8.2 16.7-13.4c4.3-5.1 7.3-11.4 7.3-18.3zM176.4 240a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm159.3-20c10.6 0 19.9 3.8 25.4 9.7c7.6 8.1 20.2 8.5 28.3 .9s8.5-20.2 .9-28.3C375.7 186.8 355 180 335.6 180s-40.1 6.8-54.6 22.3c-7.6 8.1-7.1 20.7 .9 28.3s20.7 7.1 28.3-.9c5.5-5.8 14.8-9.7 25.4-9.7zM434 352.3c-6-23.2-28.8-37-51.1-30.8s-35.4 30.1-29.5 53.4l22.9 89.3c2.2 8.7 11.2 13.9 19.8 11.4l84.9-23.8c22.2-6.2 35.4-30.1 29.5-53.4s-28.8-37-51.1-30.8l-20.2 5.6-5.4-21z"]
};
const faKissWinkHeart = faFaceKissWinkHeart;
const faStarHalfStroke = {
  prefix: 'far',
  iconName: 'star-half-stroke',
  icon: [576, 512, ["star-half-alt"], "f5c0", "M309.5 13.5C305.5 5.2 297.1 0 287.9 0s-17.6 5.2-21.6 13.5L197.7 154.8 44.5 177.5c-9 1.3-16.5 7.6-19.3 16.3s-.5 18.1 5.9 24.5L142.2 328.4 116 483.9c-1.5 9 2.2 18.1 9.7 23.5s17.3 6 25.3 1.7l137-73.2 137 73.2c8.1 4.3 17.9 3.7 25.3-1.7s11.2-14.5 9.7-23.5L433.6 328.4 544.8 218.2c6.5-6.4 8.7-15.9 5.9-24.5s-10.3-14.9-19.3-16.3L378.1 154.8 309.5 13.5zM288 384.7l0-305.6 52.5 108.1c3.5 7.1 10.2 12.1 18.1 13.3l118.3 17.5L391 303c-5.5 5.5-8.1 13.3-6.8 21l20.2 119.6L299.2 387.5c-3.5-1.9-7.4-2.8-11.2-2.8z"]
};
const faStarHalfAlt = faStarHalfStroke;
const faFileExcel = {
  prefix: 'far',
  iconName: 'file-excel',
  icon: [384, 512, [], "f1c3", "M48 448L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm90.9 233.3c-8.1-10.5-23.2-12.3-33.7-4.2s-12.3 23.2-4.2 33.7L161.6 320l-44.5 57.3c-8.1 10.5-6.3 25.5 4.2 33.7s25.5 6.3 33.7-4.2L192 359.1l37.1 47.6c8.1 10.5 23.2 12.3 33.7 4.2s12.3-23.2 4.2-33.7L222.4 320l44.5-57.3c8.1-10.5 6.3-25.5-4.2-33.7s-25.5-6.3-33.7 4.2L192 280.9l-37.1-47.6z"]
};
const faFaceGrinBeam = {
  prefix: 'far',
  iconName: 'face-grin-beam',
  icon: [512, 512, [128516, "grin-beam"], "f582", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm349.5 52.4c18.7-4.4 35.9 12 25.5 28.1C350.4 374.6 306.3 400 255.9 400s-94.5-25.4-119.1-63.5c-10.4-16.1 6.8-32.5 25.5-28.1c28.9 6.8 60.5 10.5 93.6 10.5s64.7-3.7 93.6-10.5zM217.6 228.8s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faGrinBeam = faFaceGrinBeam;
const faObjectUngroup = {
  prefix: 'far',
  iconName: 'object-ungroup',
  icon: [640, 512, [], "f248", "M48.2 66.8c-.1-.8-.2-1.7-.2-2.5l0-.2c0-8.8 7.2-16 16-16c.9 0 1.9 .1 2.8 .2C74.3 49.5 80 56.1 80 64c0 8.8-7.2 16-16 16c-7.9 0-14.5-5.7-15.8-13.2zM0 64c0 26.9 16.5 49.9 40 59.3l0 105.3C16.5 238.1 0 261.1 0 288c0 35.3 28.7 64 64 64c26.9 0 49.9-16.5 59.3-40l201.3 0c9.5 23.5 32.5 40 59.3 40c35.3 0 64-28.7 64-64c0-26.9-16.5-49.9-40-59.3l0-105.3c23.5-9.5 40-32.5 40-59.3c0-35.3-28.7-64-64-64c-26.9 0-49.9 16.5-59.3 40L123.3 40C113.9 16.5 90.9 0 64 0C28.7 0 0 28.7 0 64zm368 0a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM324.7 88c6.5 16 19.3 28.9 35.3 35.3l0 105.3c-16 6.5-28.9 19.3-35.3 35.3l-201.3 0c-6.5-16-19.3-28.9-35.3-35.3l0-105.3c16-6.5 28.9-19.3 35.3-35.3l201.3 0zM384 272a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM80 288c0 7.9-5.7 14.5-13.2 15.8c-.8 .1-1.7 .2-2.5 .2l-.2 0c-8.8 0-16-7.2-16-16c0-.9 .1-1.9 .2-2.8C49.5 277.7 56.1 272 64 272c8.8 0 16 7.2 16 16zm391.3-40l45.4 0c6.5 16 19.3 28.9 35.3 35.3l0 105.3c-16 6.5-28.9 19.3-35.3 35.3l-201.3 0c-6.5-16-19.3-28.9-35.3-35.3l0-36.7-48 0 0 36.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64c26.9 0 49.9-16.5 59.3-40l201.3 0c9.5 23.5 32.5 40 59.3 40c35.3 0 64-28.7 64-64c0-26.9-16.5-49.9-40-59.3l0-105.3c23.5-9.5 40-32.5 40-59.3c0-35.3-28.7-64-64-64c-26.9 0-49.9 16.5-59.3 40L448 200l0 16.4c9.8 8.8 17.8 19.5 23.3 31.6zm88.9-26.7a16 16 0 1 1 31.5 5.5 16 16 0 1 1 -31.5-5.5zM271.8 450.7a16 16 0 1 1 -31.5-5.5 16 16 0 1 1 31.5 5.5zm307-18.5a16 16 0 1 1 -5.5 31.5 16 16 0 1 1 5.5-31.5z"]
};
const faCircleRight = {
  prefix: 'far',
  iconName: 'circle-right',
  icon: [512, 512, [61838, "arrow-alt-circle-right"], "f35a", "M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM294.6 151.2c-4.2-4.6-10.1-7.2-16.4-7.2C266 144 256 154 256 166.3l0 41.7-96 0c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l96 0 0 41.7c0 12.3 10 22.3 22.3 22.3c6.2 0 12.1-2.6 16.4-7.2l84-91c3.5-3.8 5.4-8.7 5.4-13.9s-1.9-10.1-5.4-13.9l-84-91z"]
};
const faArrowAltCircleRight = faCircleRight;
const faFaceRollingEyes = {
  prefix: 'far',
  iconName: 'face-rolling-eyes',
  icon: [512, 512, [128580, "meh-rolling-eyes"], "f5a5", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM168 376c0 13.3 10.7 24 24 24l128 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-128 0c-13.3 0-24 10.7-24 24zm-8-104c-26.5 0-48-21.5-48-48c0-14.3 6.3-27.2 16.2-36c-.2 1.3-.2 2.6-.2 4c0 17.7 14.3 32 32 32s32-14.3 32-32c0-1.4-.1-2.7-.2-4c10 8.8 16.2 21.7 16.2 36c0 26.5-21.5 48-48 48zm0 32a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm192-32c-26.5 0-48-21.5-48-48c0-14.3 6.3-27.2 16.2-36c-.2 1.3-.2 2.6-.2 4c0 17.7 14.3 32 32 32s32-14.3 32-32c0-1.4-.1-2.7-.2-4c10 8.8 16.2 21.7 16.2 36c0 26.5-21.5 48-48 48zm0 32a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]
};
const faMehRollingEyes = faFaceRollingEyes;
const faObjectGroup = {
  prefix: 'far',
  iconName: 'object-group',
  icon: [576, 512, [], "f247", "M48 115.8C38.2 107 32 94.2 32 80c0-26.5 21.5-48 48-48c14.2 0 27 6.2 35.8 16l344.4 0c8.8-9.8 21.6-16 35.8-16c26.5 0 48 21.5 48 48c0 14.2-6.2 27-16 35.8l0 280.4c9.8 8.8 16 21.6 16 35.8c0 26.5-21.5 48-48 48c-14.2 0-27-6.2-35.8-16l-344.4 0c-8.8 9.8-21.6 16-35.8 16c-26.5 0-48-21.5-48-48c0-14.2 6.2-27 16-35.8l0-280.4zM125.3 96c-4.8 13.6-15.6 24.4-29.3 29.3l0 261.5c13.6 4.8 24.4 15.6 29.3 29.3l325.5 0c4.8-13.6 15.6-24.4 29.3-29.3l0-261.5c-13.6-4.8-24.4-15.6-29.3-29.3L125.3 96zm2.7 64c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-96zM256 320l32 0c35.3 0 64-28.7 64-64l0-32 64 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-32z"]
};
const faHeart = {
  prefix: 'far',
  iconName: 'heart',
  icon: [512, 512, [128153, 128154, 128155, 128156, 128420, 129293, 129294, 129505, 9829, 10084, 61578], "f004", "M225.8 468.2l-2.5-2.3L48.1 303.2C17.4 274.7 0 234.7 0 192.8l0-3.3c0-70.4 50-130.8 119.2-144C158.6 37.9 198.9 47 231 69.6c9 6.4 17.4 13.8 25 22.3c4.2-4.8 8.7-9.2 13.5-13.3c3.7-3.2 7.5-6.2 11.5-9c0 0 0 0 0 0C313.1 47 353.4 37.9 392.8 45.4C462 58.6 512 119.1 512 189.5l0 3.3c0 41.9-17.4 81.9-48.1 110.4L288.7 465.9l-2.5 2.3c-8.2 7.6-19 11.9-30.2 11.9s-22-4.2-30.2-11.9zM239.1 145c-.4-.3-.7-.7-1-1.1l-17.8-20-.1-.1s0 0 0 0c-23.1-25.9-58-37.7-92-31.2C81.6 101.5 48 142.1 48 189.5l0 3.3c0 28.5 11.9 55.8 32.8 75.2L256 430.7 431.2 268c20.9-19.4 32.8-46.7 32.8-75.2l0-3.3c0-47.3-33.6-88-80.1-96.9c-34-6.5-69 5.4-92 31.2c0 0 0 0-.1 .1s0 0-.1 .1l-17.8 20c-.3 .4-.7 .7-1 1.1c-4.5 4.5-10.6 7-16.9 7s-12.4-2.5-16.9-7z"]
};
const faFaceSurprise = {
  prefix: 'far',
  iconName: 'face-surprise',
  icon: [512, 512, [128558, "surprise"], "f5c2", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm176.4-80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM256 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faSurprise = faFaceSurprise;
const faCirclePause = {
  prefix: 'far',
  iconName: 'circle-pause',
  icon: [512, 512, [62092, "pause-circle"], "f28b", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm224-72l0 144c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-144c0-13.3 10.7-24 24-24s24 10.7 24 24zm112 0l0 144c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-144c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faPauseCircle = faCirclePause;
const faCircle = {
  prefix: 'far',
  iconName: 'circle',
  icon: [512, 512, [128308, 128309, 128992, 128993, 128994, 128995, 128996, 9679, 9898, 9899, 11044, 61708, 61915], "f111", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faCircleUp = {
  prefix: 'far',
  iconName: 'circle-up',
  icon: [512, 512, [61467, "arrow-alt-circle-up"], "f35b", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM151.2 217.4c-4.6 4.2-7.2 10.1-7.2 16.4c0 12.3 10 22.3 22.3 22.3l41.7 0 0 96c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-96 41.7 0c12.3 0 22.3-10 22.3-22.3c0-6.2-2.6-12.1-7.2-16.4l-91-84c-3.8-3.5-8.7-5.4-13.9-5.4s-10.1 1.9-13.9 5.4l-91 84z"]
};
const faArrowAltCircleUp = faCircleUp;
const faFileAudio = {
  prefix: 'far',
  iconName: 'file-audio',
  icon: [384, 512, [], "f1c7", "M64 464l256 0c8.8 0 16-7.2 16-16l0-288-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16zM0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM192 272l0 128c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5L129.4 376 112 376c-8.8 0-16-7.2-16-16l0-48c0-8.8 7.2-16 16-16l17.4 0 35.3-35.3c4.6-4.6 11.5-5.9 17.4-3.5s9.9 8.3 9.9 14.8zm85.8-4c11.6 20 18.2 43.3 18.2 68s-6.6 48-18.2 68c-6.6 11.5-21.3 15.4-32.8 8.8s-15.4-21.3-8.8-32.8c7.5-12.9 11.8-27.9 11.8-44s-4.3-31.1-11.8-44c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8z"]
};
const faFileImage = {
  prefix: 'far',
  iconName: 'file-image',
  icon: [384, 512, [128443], "f1c5", "M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm96 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm69.2 46.9c-3-4.3-7.9-6.9-13.2-6.9s-10.2 2.6-13.2 6.9l-41.3 59.7-11.9-19.1c-2.9-4.7-8.1-7.5-13.6-7.5s-10.6 2.8-13.6 7.5l-40 64c-3.1 4.9-3.2 11.1-.4 16.2s8.2 8.2 14 8.2l48 0 32 0 40 0 72 0c6 0 11.4-3.3 14.2-8.6s2.4-11.6-1-16.5l-72-104z"]
};
const faCircleQuestion = {
  prefix: 'far',
  iconName: 'circle-question',
  icon: [512, 512, [62108, "question-circle"], "f059", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm169.8-90.7c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faQuestionCircle = faCircleQuestion;
const faFaceMehBlank = {
  prefix: 'far',
  iconName: 'face-meh-blank',
  icon: [512, 512, [128566, "meh-blank"], "f5a4", "M256 48a208 208 0 1 0 0 416 208 208 0 1 0 0-416zM512 256A256 256 0 1 1 0 256a256 256 0 1 1 512 0zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faMehBlank = faFaceMehBlank;
const faEye = {
  prefix: 'far',
  iconName: 'eye',
  icon: [576, 512, [128065], "f06e", "M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z"]
};
const faFaceSadCry = {
  prefix: 'far',
  iconName: 'face-sad-cry',
  icon: [512, 512, [128557, "sad-cry"], "f5b3", "M400 406.1L400 288c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 152.6c-28.7 15-61.4 23.4-96 23.4s-67.3-8.5-96-23.4L160 288c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 118.1C72.6 368.2 48 315 48 256C48 141.1 141.1 48 256 48s208 93.1 208 208c0 59-24.6 112.2-64 150.1zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM159.6 220c10.6 0 19.9 3.8 25.4 9.7c7.6 8.1 20.2 8.5 28.3 .9s8.5-20.2 .9-28.3C199.7 186.8 179 180 159.6 180s-40.1 6.8-54.6 22.3c-7.6 8.1-7.1 20.7 .9 28.3s20.7 7.1 28.3-.9c5.5-5.8 14.8-9.7 25.4-9.7zm166.6 9.7c5.5-5.8 14.8-9.7 25.4-9.7s19.9 3.8 25.4 9.7c7.6 8.1 20.2 8.5 28.3 .9s8.5-20.2 .9-28.3C391.7 186.8 371 180 351.6 180s-40.1 6.8-54.6 22.3c-7.6 8.1-7.1 20.7 .9 28.3s20.7 7.1 28.3-.9zM208 320l0 32c0 26.5 21.5 48 48 48s48-21.5 48-48l0-32c0-26.5-21.5-48-48-48s-48 21.5-48 48z"]
};
const faSadCry = faFaceSadCry;
const faFileCode = {
  prefix: 'far',
  iconName: 'file-code',
  icon: [384, 512, [], "f1c9", "M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm97 289c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L79 303c-9.4 9.4-9.4 24.6 0 33.9l48 48c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-31-31 31-31zM257 255c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9l-48-48z"]
};
const faWindowMaximize = {
  prefix: 'far',
  iconName: 'window-maximize',
  icon: [512, 512, [128470], "f2d0", "M.3 89.5C.1 91.6 0 93.8 0 96L0 224 0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-192 0-128c0-35.3-28.7-64-64-64L64 32c-2.2 0-4.4 .1-6.5 .3c-9.2 .9-17.8 3.8-25.5 8.2C21.8 46.5 13.4 55.1 7.7 65.5c-3.9 7.3-6.5 15.4-7.4 24zM48 224l416 0 0 192c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16l0-192z"]
};
const faFaceFrown = {
  prefix: 'far',
  iconName: 'face-frown',
  icon: [512, 512, [9785, "frown"], "f119", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM174.6 384.1c-4.5 12.5-18.2 18.9-30.7 14.4s-18.9-18.2-14.4-30.7C146.9 319.4 198.9 288 256 288s109.1 31.4 126.6 79.9c4.5 12.5-2 26.2-14.4 30.7s-26.2-2-30.7-14.4C328.2 358.5 297.2 336 256 336s-72.2 22.5-81.4 48.1zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faFrown = faFaceFrown;
const faFloppyDisk = {
  prefix: 'far',
  iconName: 'floppy-disk',
  icon: [448, 512, [128190, 128426, "save"], "f0c7", "M48 96l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-245.5c0-4.2-1.7-8.3-4.7-11.3l33.9-33.9c12 12 18.7 28.3 18.7 45.3L448 416c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l245.5 0c17 0 33.3 6.7 45.3 18.7l74.5 74.5-33.9 33.9L320.8 84.7c-.3-.3-.5-.5-.8-.8L320 184c0 13.3-10.7 24-24 24l-192 0c-13.3 0-24-10.7-24-24L80 80 64 80c-8.8 0-16 7.2-16 16zm80-16l0 80 144 0 0-80L128 80zm32 240a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"]
};
const faSave = faFloppyDisk;
const faCommentDots = {
  prefix: 'far',
  iconName: 'comment-dots',
  icon: [512, 512, [128172, 62075, "commenting"], "f4ad", "M168.2 384.9c-15-5.4-31.7-3.1-44.6 6.4c-8.2 6-22.3 14.8-39.4 22.7c5.6-14.7 9.9-31.3 11.3-49.4c1-12.9-3.3-25.7-11.8-35.5C60.4 302.8 48 272 48 240c0-79.5 83.3-160 208-160s208 80.5 208 160s-83.3 160-208 160c-31.6 0-61.3-5.5-87.8-15.1zM26.3 423.8c-1.6 2.7-3.3 5.4-5.1 8.1l-.3 .5c-1.6 2.3-3.2 4.6-4.8 6.9c-3.5 4.7-7.3 9.3-11.3 13.5c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c5.1 0 10.2-.3 15.3-.8l.7-.1c4.4-.5 8.8-1.1 13.2-1.9c.8-.1 1.6-.3 2.4-.5c17.8-3.5 34.9-9.5 50.1-16.1c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9zM144 272a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm80 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faCommenting = faCommentDots;
const faFaceGrinSquint = {
  prefix: 'far',
  iconName: 'face-grin-squint',
  icon: [512, 512, [128518, "grin-squint"], "f585", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm349.5 52.4c18.7-4.4 35.9 12 25.5 28.1C350.4 374.6 306.3 400 255.9 400s-94.5-25.4-119.1-63.5c-10.4-16.1 6.8-32.5 25.5-28.1c28.9 6.8 60.5 10.5 93.6 10.5s64.7-3.7 93.6-10.5zm-216-161.7l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 157.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
};
const faGrinSquint = faFaceGrinSquint;
const faHandPointer = {
  prefix: 'far',
  iconName: 'hand-pointer',
  icon: [448, 512, [], "f25a", "M160 64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 136c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c8.8 0 16 7.2 16 16c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c7.8 0 14.3 5.6 15.7 13c1.6 8.2 7.3 15.1 15.1 18s16.7 1.6 23.3-3.6c2.7-2.1 6.1-3.4 9.9-3.4c8.8 0 16 7.2 16 16l0 16 0 104c0 39.8-32.2 72-72 72l-56 0-59.8 0-.9 0c-37.4 0-72.4-18.7-93.2-49.9L50.7 312.9c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4L116 353.2c5.9 8.8 16.8 12.7 26.9 9.7s17-12.4 17-23l0-19.9 0-256zM176 0c-35.3 0-64 28.7-64 64l0 197.7C91.2 238 55.5 232.8 28.5 250.7C-.9 270.4-8.9 310.1 10.8 339.5L78.3 440.8c29.7 44.5 79.6 71.2 133.1 71.2l.9 0 59.8 0 56 0c66.3 0 120-53.7 120-120l0-104 0-16c0-35.3-28.7-64-64-64c-4.5 0-8.8 .5-13 1.3c-11.7-15.4-30.2-25.3-51-25.3c-6.9 0-13.5 1.1-19.7 3.1C288.7 170.7 269.6 160 248 160c-2.7 0-5.4 .2-8 .5L240 64c0-35.3-28.7-64-64-64zm48 304c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96zm48-16c-8.8 0-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96z"]
};
const faHandScissors = {
  prefix: 'far',
  iconName: 'hand-scissors',
  icon: [512, 512, [], "f257", "M.2 276.3c-1.2-35.3 26.4-65 61.7-66.2l3.3-.1L57 208.1C22.5 200.5 .7 166.3 8.3 131.8S50.2 75.5 84.7 83.2l173 38.3c2.3-2.9 4.7-5.7 7.1-8.5l18.4-20.3C299.9 74.5 323.5 64 348.3 64l10.2 0c54.1 0 104.1 28.7 131.3 75.4l1.5 2.6c13.6 23.2 20.7 49.7 20.7 76.6L512 344c0 66.3-53.7 120-120 120l-8 0-96 0c-35.3 0-64-28.7-64-64c0-2.8 .2-5.6 .5-8.3c-19.4-11-32.5-31.8-32.5-55.7c0-.8 0-1.6 0-2.4L66.4 338c-35.3 1.2-65-26.4-66.2-61.7zm63.4-18.2c-8.8 .3-15.7 7.7-15.4 16.5s7.7 15.7 16.5 15.4l161.5-5.6c9.8-.3 18.7 5.3 22.7 14.2s2.2 19.3-4.5 26.4c-2.8 2.9-4.4 6.7-4.4 11c0 8.8 7.2 16 16 16c9.1 0 17.4 5.1 21.5 13.3s3.2 17.9-2.3 25.1c-2 2.7-3.2 6-3.2 9.6c0 8.8 7.2 16 16 16l96 0 8 0c39.8 0 72-32.2 72-72l0-125.4c0-18.4-4.9-36.5-14.2-52.4l-1.5-2.6c-18.6-32-52.8-51.6-89.8-51.6l-10.2 0c-11.3 0-22 4.8-29.6 13.1l-17.5-15.9 17.5 15.9-18.4 20.3c-.6 .6-1.1 1.3-1.7 1.9l57 13.2c8.6 2 14 10.6 12 19.2s-10.6 14-19.2 12l-85.6-19.7L74.3 130c-8.6-1.9-17.2 3.5-19.1 12.2s3.5 17.2 12.2 19.1l187.5 41.6c10.2 2.3 17.8 10.9 18.7 21.4l.1 1c.6 6.6-1.5 13.1-5.8 18.1s-10.6 7.9-17.2 8.2L63.6 258.1z"]
};
const faFaceGrinTears = {
  prefix: 'far',
  iconName: 'face-grin-tears',
  icon: [640, 512, [128514, "grin-tears"], "f588", "M516.1 325.5c1 3 2.1 6 3.3 8.9c3.3 8.1 8.4 18.5 16.5 26.6c3.9 3.9 8.2 7.4 12.7 10.3C506.4 454.8 419.9 512 320 512s-186.4-57.2-228.6-140.6c4.5-2.9 8.7-6.3 12.7-10.3c8.1-8.1 13.2-18.6 16.5-26.6c1.2-2.9 2.3-5.9 3.3-8.9C152.5 406.2 229.5 464 320 464s167.5-57.8 196.1-138.5zM320 48c-101.4 0-185.8 72.5-204.3 168.5c-6.7-3.1-14.3-4.3-22.3-3.1c-6.8 .9-16.2 2.4-26.6 4.4C85.3 94.5 191.6 0 320 0S554.7 94.5 573.2 217.7c-10.3-2-19.8-3.5-26.6-4.4c-8-1.2-15.7 .1-22.3 3.1C505.8 120.5 421.4 48 320 48zM78.5 341.1C60 356.7 32 355.5 14.3 337.7c-18.7-18.7-19.1-48.8-.7-67.2c8.6-8.6 30.1-15.1 50.5-19.6c13-2.8 25.5-4.8 33.9-6c5.4-.8 9.9 3.7 9 9c-3.1 21.5-11.4 70.2-25.5 84.4c-.9 1-1.9 1.8-2.9 2.7zm483 0c-.8-.6-1.5-1.3-2.3-2c-.2-.2-.5-.4-.7-.7c-14.1-14.1-22.5-62.9-25.5-84.4c-.8-5.4 3.7-9.9 9-9c1 .1 2.2 .3 3.3 .5c8.2 1.2 19.2 3 30.6 5.5c20.4 4.4 41.9 10.9 50.5 19.6c18.4 18.4 18 48.5-.7 67.2c-17.7 17.7-45.7 19-64.2 3.4zM439 336.5C414.4 374.6 370.3 400 319.9 400s-94.5-25.4-119.1-63.5c-10.4-16.1 6.8-32.5 25.5-28.1c28.9 6.8 60.5 10.5 93.6 10.5s64.7-3.7 93.6-10.5c18.7-4.4 35.9 12 25.5 28.1zM281.6 228.8c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0zm160 0s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0z"]
};
const faGrinTears = faFaceGrinTears;
const faCalendarXmark = {
  prefix: 'far',
  iconName: 'calendar-xmark',
  icon: [448, 512, ["calendar-times"], "f273", "M128 0c13.3 0 24 10.7 24 24l0 40 144 0 0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40 40 0c35.3 0 64 28.7 64 64l0 16 0 48 0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192l0-48 0-16C0 92.7 28.7 64 64 64l40 0 0-40c0-13.3 10.7-24 24-24zM400 192L48 192l0 256c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-256zm-95 89l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faCalendarTimes = faCalendarXmark;
const faFileVideo = {
  prefix: 'far',
  iconName: 'file-video',
  icon: [384, 512, [], "f1c8", "M320 464c8.8 0 16-7.2 16-16l0-288-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0zM0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM80 288c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32l0 16 44.9-29.9c2-1.3 4.4-2.1 6.8-2.1c6.8 0 12.3 5.5 12.3 12.3l0 103.4c0 6.8-5.5 12.3-12.3 12.3c-2.4 0-4.8-.7-6.8-2.1L240 368l0 16c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-96z"]
};
const faFilePdf = {
  prefix: 'far',
  iconName: 'file-pdf',
  icon: [512, 512, [], "f1c1", "M64 464l48 0 0 48-48 0c-35.3 0-64-28.7-64-64L0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 304l-48 0 0-144-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16zM176 352l32 0c30.9 0 56 25.1 56 56s-25.1 56-56 56l-16 0 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-80c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0 48 16 0zm96-80l32 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16l0-128c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-16 0 0 96 16 0zm80-112c0-8.8 7.2-16 16-16l48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64 0-64z"]
};
const faComment = {
  prefix: 'far',
  iconName: 'comment',
  icon: [512, 512, [128489, 61669], "f075", "M123.6 391.3c12.9-9.4 29.6-11.8 44.6-6.4c26.5 9.6 56.2 15.1 87.8 15.1c124.7 0 208-80.5 208-160s-83.3-160-208-160S48 160.5 48 240c0 32 12.4 62.8 35.7 89.2c8.6 9.7 12.8 22.5 11.8 35.5c-1.4 18.1-5.7 34.7-11.3 49.4c17-7.9 31.1-16.7 39.4-22.7zM21.2 431.9c1.8-2.7 3.5-5.4 5.1-8.1c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208s-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6c-15.1 6.6-32.3 12.6-50.1 16.1c-.8 .2-1.6 .3-2.4 .5c-4.4 .8-8.7 1.5-13.2 1.9c-.2 0-.5 .1-.7 .1c-5.1 .5-10.2 .8-15.3 .8c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c4.1-4.2 7.8-8.7 11.3-13.5c1.7-2.3 3.3-4.6 4.8-6.9l.3-.5z"]
};
const faEnvelope = {
  prefix: 'far',
  iconName: 'envelope',
  icon: [512, 512, [128386, 9993, 61443], "f0e0", "M64 112c-8.8 0-16 7.2-16 16l0 22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1l0-22.1c0-8.8-7.2-16-16-16L64 112zM48 212.2L48 384c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-171.8L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128z"]
};
const faHourglass = {
  prefix: 'far',
  iconName: 'hourglass',
  icon: [384, 512, [9203, 62032, "hourglass-empty"], "f254", "M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48l8 0 0 19c0 40.3 16 79 44.5 107.5L158.1 256 76.5 337.5C48 366 32 404.7 32 445l0 19-8 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-19c0-40.3-16-79-44.5-107.5L225.9 256l81.5-81.5C336 146 352 107.3 352 67l0-19 8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 0zM192 289.9l81.5 81.5C293 391 304 417.4 304 445l0 19L80 464l0-19c0-27.6 11-54 30.5-73.5L192 289.9zm0-67.9l-81.5-81.5C91 121 80 94.6 80 67l0-19 224 0 0 19c0 27.6-11 54-30.5 73.5L192 222.1z"]
};
const faHourglassEmpty = faHourglass;
const faCalendarCheck = {
  prefix: 'far',
  iconName: 'calendar-check',
  icon: [448, 512, [], "f274", "M128 0c13.3 0 24 10.7 24 24l0 40 144 0 0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40 40 0c35.3 0 64 28.7 64 64l0 16 0 48 0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192l0-48 0-16C0 92.7 28.7 64 64 64l40 0 0-40c0-13.3 10.7-24 24-24zM400 192L48 192l0 256c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-256zM329 297L217 409c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faHardDrive = {
  prefix: 'far',
  iconName: 'hard-drive',
  icon: [512, 512, [128436, "hdd"], "f0a0", "M64 80c-8.8 0-16 7.2-16 16l0 162c5.1-1.3 10.5-2 16-2l384 0c5.5 0 10.9 .7 16 2l0-162c0-8.8-7.2-16-16-16L64 80zM48 320l0 96c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-96c0-8.8-7.2-16-16-16L64 304c-8.8 0-16 7.2-16 16zM0 320L0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 224 0 96c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64l0-96zm280 48a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faHdd = faHardDrive;
const faFaceGrinSquintTears = {
  prefix: 'far',
  iconName: 'face-grin-squint-tears',
  icon: [512, 512, [129315, "grin-squint-tears"], "f586", "M426.8 14.2C446-5 477.5-4.6 497.1 14.9s20 51 .7 70.3c-14.8 14.8-65.7 23.6-88.3 26.7c-5.6 .9-10.3-3.9-9.5-9.5C403.3 79.9 412 29 426.8 14.2zM75 75C158.2-8.3 284.5-22.2 382.2 33.2c-1.5 4.8-2.9 9.6-4.1 14.3c-3.1 12.2-5.5 24.6-7.3 35c-80.8-53.6-190.7-44.8-261.9 26.4C37.7 180.1 28.9 290 82.5 370.8c-10.5 1.8-22.9 4.2-35 7.3c-4.7 1.2-9.5 2.5-14.3 4.1C-22.2 284.5-8.2 158.2 75 75zm389.6 58.9c4.7-1.2 9.5-2.5 14.3-4.1C534.2 227.5 520.2 353.8 437 437c-83.2 83.2-209.5 97.2-307.2 41.8c1.5-4.8 2.8-9.6 4-14.3c3.1-12.2 5.5-24.6 7.3-35c80.8 53.6 190.7 44.8 261.9-26.4c71.2-71.2 80-181.1 26.4-261.9c10.5-1.8 22.9-4.2 35-7.3zm-105.4 93c10.1-16.3 33.9-16.9 37.9 1.9c9.5 44.4-3.7 93.5-39.3 129.1s-84.8 48.8-129.1 39.3c-18.7-4-18.2-27.8-1.9-37.9c25.2-15.7 50.2-35.4 73.6-58.8s43.1-48.4 58.8-73.6zM92 265.3l97.4-29.7c11.6-3.5 22.5 7.3 19 19l-29.7 97.4c-2.6 8.6-13.4 11.3-19.8 4.9c-2-2-3.2-4.6-3.4-7.3l-5.1-56.1-56.1-5.1c-2.8-.3-5.4-1.5-7.3-3.4c-6.3-6.3-3.6-17.2 4.9-19.8zm193-178.2c2 2 3.2 4.6 3.4 7.3l5.1 56.1 56.1 5.1c2.8 .3 5.4 1.5 7.3 3.4c6.3 6.3 3.6 17.2-4.9 19.8l-97.4 29.7c-11.6 3.5-22.5-7.3-19-19L265.3 92c2.6-8.6 13.4-11.3 19.8-4.9zM14.9 497.1c-19.6-19.6-20-51-.7-70.3C29 412 79.8 403.2 102.4 400.1c5.6-.9 10.3 3.9 9.5 9.5c-3.2 22.5-11.9 73.5-26.7 88.3C66 517 34.5 516.6 14.9 497.1z"]
};
const faGrinSquintTears = faFaceGrinSquintTears;
const faRectangleList = {
  prefix: 'far',
  iconName: 'rectangle-list',
  icon: [576, 512, ["list-alt"], "f022", "M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l448 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80zM0 96C0 60.7 28.7 32 64 32l448 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm96 64a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm104 0c0-13.3 10.7-24 24-24l224 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-224 0c-13.3 0-24-10.7-24-24zm0 96c0-13.3 10.7-24 24-24l224 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-224 0c-13.3 0-24-10.7-24-24zm0 96c0-13.3 10.7-24 24-24l224 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-224 0c-13.3 0-24-10.7-24-24zm-72-64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM96 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faListAlt = faRectangleList;
const faCalendarPlus = {
  prefix: 'far',
  iconName: 'calendar-plus',
  icon: [448, 512, [], "f271", "M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L64 64C28.7 64 0 92.7 0 128l0 16 0 48L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-256 0-48 0-16c0-35.3-28.7-64-64-64l-40 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L152 64l0-40zM48 192l352 0 0 256c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256zm176 40c-13.3 0-24 10.7-24 24l0 48-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0 0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48 48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-48c0-13.3-10.7-24-24-24z"]
};
const faCircleLeft = {
  prefix: 'far',
  iconName: 'circle-left',
  icon: [512, 512, [61840, "arrow-alt-circle-left"], "f359", "M48 256a208 208 0 1 1 416 0A208 208 0 1 1 48 256zm464 0A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM217.4 376.9c4.2 4.5 10.1 7.1 16.3 7.1c12.3 0 22.3-10 22.3-22.3l0-57.7 96 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-96 0 0-57.7c0-12.3-10-22.3-22.3-22.3c-6.2 0-12.1 2.6-16.3 7.1L117.5 242.2c-3.5 3.8-5.5 8.7-5.5 13.8s2 10.1 5.5 13.8l99.9 107.1z"]
};
const faArrowAltCircleLeft = faCircleLeft;
const faMoneyBill1 = {
  prefix: 'far',
  iconName: 'money-bill-1',
  icon: [576, 512, ["money-bill-alt"], "f3d1", "M112 112c0 35.3-28.7 64-64 64l0 160c35.3 0 64 28.7 64 64l352 0c0-35.3 28.7-64 64-64l0-160c-35.3 0-64-28.7-64-64l-352 0zM0 128C0 92.7 28.7 64 64 64l448 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM176 256a112 112 0 1 1 224 0 112 112 0 1 1 -224 0zm80-48c0 8.8 7.2 16 16 16l0 64-8 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l24 0 24 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-8 0 0-80c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z"]
};
const faMoneyBillAlt = faMoneyBill1;
const faClock = {
  prefix: 'far',
  iconName: 'clock',
  icon: [512, 512, [128339, "clock-four"], "f017", "M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
};
const faClockFour = faClock;
const faKeyboard = {
  prefix: 'far',
  iconName: 'keyboard',
  icon: [576, 512, [9000], "f11c", "M64 112c-8.8 0-16 7.2-16 16l0 256c0 8.8 7.2 16 16 16l448 0c8.8 0 16-7.2 16-16l0-256c0-8.8-7.2-16-16-16L64 112zM0 128C0 92.7 28.7 64 64 64l448 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM176 320l224 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm-72-72c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16z"]
};
const faClosedCaptioning = {
  prefix: 'far',
  iconName: 'closed-captioning',
  icon: [576, 512, [], "f20a", "M512 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l448 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM200 208c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48s21.5-48 48-48zm144 48c0-26.5 21.5-48 48-48c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48z"]
};
const faImages = {
  prefix: 'far',
  iconName: 'images',
  icon: [576, 512, [], "f302", "M160 80l352 0c8.8 0 16 7.2 16 16l0 224c0 8.8-7.2 16-16 16l-21.2 0L388.1 178.9c-4.4-6.8-12-10.9-20.1-10.9s-15.7 4.1-20.1 10.9l-52.2 79.8-12.4-16.9c-4.5-6.2-11.7-9.8-19.4-9.8s-14.8 3.6-19.4 9.8L175.6 336 160 336c-8.8 0-16-7.2-16-16l0-224c0-8.8 7.2-16 16-16zM96 96l0 224c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32c-35.3 0-64 28.7-64 64zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 344c0 75.1 60.9 136 136 136l320 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-320 0c-48.6 0-88-39.4-88-88l0-224zm208 24a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faFaceGrin = {
  prefix: 'far',
  iconName: 'face-grin',
  icon: [512, 512, [128512, "grin"], "f580", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm349.5 52.4c18.7-4.4 35.9 12 25.5 28.1C350.4 374.6 306.3 400 255.9 400s-94.5-25.4-119.1-63.5c-10.4-16.1 6.8-32.5 25.5-28.1c28.9 6.8 60.5 10.5 93.6 10.5s64.7-3.7 93.6-10.5zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGrin = faFaceGrin;
const faFaceMeh = {
  prefix: 'far',
  iconName: 'face-meh',
  icon: [512, 512, [128528, "meh"], "f11a", "M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM176.4 240a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm192-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM184 328c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]
};
const faMeh = faFaceMeh;
const faIdCard = {
  prefix: 'far',
  iconName: 'id-card',
  icon: [576, 512, [62147, "drivers-license"], "f2c2", "M528 160l0 256c0 8.8-7.2 16-16 16l-192 0c0-44.2-35.8-80-80-80l-64 0c-44.2 0-80 35.8-80 80l-32 0c-8.8 0-16-7.2-16-16l0-256 480 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM272 256a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zm104-48c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0z"]
};
const faDriversLicense = faIdCard;
const faSun = {
  prefix: 'far',
  iconName: 'sun',
  icon: [512, 512, [9728], "f185", "M375.7 19.7c-1.5-8-6.9-14.7-14.4-17.8s-16.1-2.2-22.8 2.4L256 61.1 173.5 4.2c-6.7-4.6-15.3-5.5-22.8-2.4s-12.9 9.8-14.4 17.8l-18.1 98.5L19.7 136.3c-8 1.5-14.7 6.9-17.8 14.4s-2.2 16.1 2.4 22.8L61.1 256 4.2 338.5c-4.6 6.7-5.5 15.3-2.4 22.8s9.8 13 17.8 14.4l98.5 18.1 18.1 98.5c1.5 8 6.9 14.7 14.4 17.8s16.1 2.2 22.8-2.4L256 450.9l82.5 56.9c6.7 4.6 15.3 5.5 22.8 2.4s12.9-9.8 14.4-17.8l18.1-98.5 98.5-18.1c8-1.5 14.7-6.9 17.8-14.4s2.2-16.1-2.4-22.8L450.9 256l56.9-82.5c4.6-6.7 5.5-15.3 2.4-22.8s-9.8-12.9-17.8-14.4l-98.5-18.1L375.7 19.7zM269.6 110l65.6-45.2 14.4 78.3c1.8 9.8 9.5 17.5 19.3 19.3l78.3 14.4L402 242.4c-5.7 8.2-5.7 19 0 27.2l45.2 65.6-78.3 14.4c-9.8 1.8-17.5 9.5-19.3 19.3l-14.4 78.3L269.6 402c-8.2-5.7-19-5.7-27.2 0l-65.6 45.2-14.4-78.3c-1.8-9.8-9.5-17.5-19.3-19.3L64.8 335.2 110 269.6c5.7-8.2 5.7-19 0-27.2L64.8 176.8l78.3-14.4c9.8-1.8 17.5-9.5 19.3-19.3l14.4-78.3L242.4 110c8.2 5.7 19 5.7 27.2 0zM256 368a112 112 0 1 0 0-224 112 112 0 1 0 0 224zM192 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"]
};
const faFaceLaughWink = {
  prefix: 'far',
  iconName: 'face-laugh-wink',
  icon: [512, 512, ["laugh-wink"], "f59c", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm130.7 57.9c-4.2-13.6 7.1-25.9 21.3-25.9l212.5 0c14.2 0 25.5 12.4 21.3 25.9C369 368.4 318.2 408 258.2 408s-110.8-39.6-127.5-94.1zM144.4 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm165.8 21.7c-7.6 8.1-20.2 8.5-28.3 .9s-8.5-20.2-.9-28.3c14.5-15.5 35.2-22.3 54.6-22.3s40.1 6.8 54.6 22.3c7.6 8.1 7.1 20.7-.9 28.3s-20.7 7.1-28.3-.9c-5.5-5.8-14.8-9.7-25.4-9.7s-19.9 3.8-25.4 9.7z"]
};
const faLaughWink = faFaceLaughWink;
const faCircleDown = {
  prefix: 'far',
  iconName: 'circle-down',
  icon: [512, 512, [61466, "arrow-alt-circle-down"], "f358", "M256 464a208 208 0 1 1 0-416 208 208 0 1 1 0 416zM256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM376.9 294.6c4.5-4.2 7.1-10.1 7.1-16.3c0-12.3-10-22.3-22.3-22.3L304 256l0-96c0-17.7-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32l0 96-57.7 0C138 256 128 266 128 278.3c0 6.2 2.6 12.1 7.1 16.3l107.1 99.9c3.8 3.5 8.7 5.5 13.8 5.5s10.1-2 13.8-5.5l107.1-99.9z"]
};
const faArrowAltCircleDown = faCircleDown;
const faThumbsDown = {
  prefix: 'far',
  iconName: 'thumbs-down',
  icon: [512, 512, [128078, 61576], "f165", "M323.8 477.2c-38.2 10.9-78.1-11.2-89-49.4l-5.7-20c-3.7-13-10.4-25-19.5-35l-51.3-56.4c-8.9-9.8-8.2-25 1.6-33.9s25-8.2 33.9 1.6l51.3 56.4c14.1 15.5 24.4 34 30.1 54.1l5.7 20c3.6 12.7 16.9 20.1 29.7 16.5s20.1-16.9 16.5-29.7l-5.7-20c-5.7-19.9-14.7-38.7-26.6-55.5c-5.2-7.3-5.8-16.9-1.7-24.9s12.3-13 21.3-13L448 288c8.8 0 16-7.2 16-16c0-6.8-4.3-12.7-10.4-15c-7.4-2.8-13-9-14.9-16.7s.1-15.8 5.3-21.7c2.5-2.8 4-6.5 4-10.6c0-7.8-5.6-14.3-13-15.7c-8.2-1.6-15.1-7.3-18-15.2s-1.6-16.7 3.6-23.3c2.1-2.7 3.4-6.1 3.4-9.9c0-6.7-4.2-12.6-10.2-14.9c-11.5-4.5-17.7-16.9-14.4-28.8c.4-1.3 .6-2.8 .6-4.3c0-8.8-7.2-16-16-16l-97.5 0c-12.6 0-25 3.7-35.5 10.7l-61.7 41.1c-11 7.4-25.9 4.4-33.3-6.7s-4.4-25.9 6.7-33.3l61.7-41.1c18.4-12.3 40-18.8 62.1-18.8L384 32c34.7 0 62.9 27.6 64 62c14.6 11.7 24 29.7 24 50c0 4.5-.5 8.8-1.3 13c15.4 11.7 25.3 30.2 25.3 51c0 6.5-1 12.8-2.8 18.7C504.8 238.3 512 254.3 512 272c0 35.3-28.6 64-64 64l-92.3 0c4.7 10.4 8.7 21.2 11.8 32.2l5.7 20c10.9 38.2-11.2 78.1-49.4 89zM32 384c-17.7 0-32-14.3-32-32L0 128c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 224c0 17.7-14.3 32-32 32l-64 0z"]
};
const faChessPawn = {
  prefix: 'far',
  iconName: 'chess-pawn',
  icon: [320, 512, [9823], "f443", "M232 152A72 72 0 1 0 88 152a72 72 0 1 0 144 0zm24 120l-12.6 0 10.7 80-48.4 0L195 272l-35 0-35 0-10.7 80-48.4 0 10.7-80L64 272c-13.3 0-24-10.7-24-24s10.7-24 24-24c-15.1-20.1-24-45-24-72C40 85.7 93.7 32 160 32s120 53.7 120 120c0 27-8.9 51.9-24 72c13.3 0 24 10.7 24 24s-10.7 24-24 24zM52.7 464l214.7 0-16.6-32L69.2 432 52.7 464zm207.9-80c12 0 22.9 6.7 28.4 17.3l26.5 51.2c3 5.8 4.6 12.2 4.6 18.7c0 22.5-18.2 40.8-40.8 40.8L40.8 512C18.2 512 0 493.8 0 471.2c0-6.5 1.6-12.9 4.6-18.7l26.5-51.2C36.5 390.7 47.5 384 59.5 384l201 0z"]
};
const faCreditCard = {
  prefix: 'far',
  iconName: 'credit-card',
  icon: [576, 512, [128179, 62083, "credit-card-alt"], "f09d", "M512 80c8.8 0 16 7.2 16 16l0 32L48 128l0-32c0-8.8 7.2-16 16-16l448 0zm16 144l0 192c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16l0-192 480 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm56 304c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0zm128 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0z"]
};
const faCreditCardAlt = faCreditCard;
const faBell = {
  prefix: 'far',
  iconName: 'bell',
  icon: [448, 512, [128276, 61602], "f0f3", "M224 0c-17.7 0-32 14.3-32 32l0 19.2C119 66 64 130.6 64 208l0 25.4c0 45.4-15.5 89.5-43.8 124.9L5.3 377c-5.8 7.2-6.9 17.1-2.9 25.4S14.8 416 24 416l400 0c9.2 0 17.6-5.3 21.6-13.6s2.9-18.2-2.9-25.4l-14.9-18.6C399.5 322.9 384 278.8 384 233.4l0-25.4c0-77.4-55-142-128-156.8L256 32c0-17.7-14.3-32-32-32zm0 96c61.9 0 112 50.1 112 112l0 25.4c0 47.9 13.9 94.6 39.7 134.6L72.3 368C98.1 328 112 281.3 112 233.4l0-25.4c0-61.9 50.1-112 112-112zm64 352l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"]
};
const faFile = {
  prefix: 'far',
  iconName: 'file',
  icon: [384, 512, [128196, 128459, 61462], "f15b", "M320 464c8.8 0 16-7.2 16-16l0-288-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0zM0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64z"]
};
const faHospital = {
  prefix: 'far',
  iconName: 'hospital',
  icon: [640, 512, [127973, 62589, "hospital-alt", "hospital-wide"], "f0f8", "M232 0c-39.8 0-72 32.2-72 72l0 8L72 80C32.2 80 0 112.2 0 152L0 440c0 39.8 32.2 72 72 72l.2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0s0 0 0 0l272 0 8 0s0 0 0 0l104 0c39.8 0 72-32.2 72-72l0-288c0-39.8-32.2-72-72-72l-88 0 0-8c0-39.8-32.2-72-72-72L232 0zM480 128l88 0c13.3 0 24 10.7 24 24l0 40-56 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l56 0 0 48-56 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l56 0 0 104c0 13.3-10.7 24-24 24l-88 0 0-128 0-208zM72 128l88 0 0 336c0 0 0 0-.1 0l-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0c-13.2 0-24-10.7-24-24l0-104 56 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-56 0 0-48 56 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-56 0 0-40c0-13.3 10.7-24 24-24zM208 72c0-13.3 10.7-24 24-24l176 0c13.3 0 24 10.7 24 24l0 264 0 128-64 0 0-64c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 64-64 0 0-392zm88 24l0 24-24 0c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l24 0 0 24c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-24 24 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-24 0 0-24c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z"]
};
const faHospitalAlt = faHospital;
const faHospitalWide = faHospital;
const faChessRook = {
  prefix: 'far',
  iconName: 'chess-rook',
  icon: [448, 512, [9820], "f447", "M80 80l0 112c0 2.5 1.2 4.9 3.2 6.4l51.2 38.4c6.8 5.1 10.4 13.4 9.5 21.9L133.5 352l-48.3 0 9.4-85L54.4 236.8C40.3 226.2 32 209.6 32 192L32 72c0-22.1 17.9-40 40-40l304 0c22.1 0 40 17.9 40 40l0 120c0 17.6-8.3 34.2-22.4 44.8L353.4 267l9.4 85-48.3 0-10.4-93.3c-.9-8.4 2.7-16.8 9.5-21.9l51.2-38.4c2-1.5 3.2-3.9 3.2-6.4l0-112-64 0 0 24c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-24-64 0 0 24c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-24L80 80zm4.7 384l278.7 0-16.6-32-245.6 0L84.7 464zm271.9-80c12 0 22.9 6.7 28.4 17.3l26.5 51.2c3 5.8 4.6 12.2 4.6 18.7c0 22.5-18.2 40.8-40.8 40.8L72.8 512C50.2 512 32 493.8 32 471.2c0-6.5 1.6-12.9 4.6-18.7l26.5-51.2C68.5 390.7 79.5 384 91.5 384l265 0zM208 288c-8.8 0-16-7.2-16-16l0-48c0-17.7 14.3-32 32-32s32 14.3 32 32l0 48c0 8.8-7.2 16-16 16l-32 0z"]
};
const faStarHalf = {
  prefix: 'far',
  iconName: 'star-half',
  icon: [576, 512, [61731], "f089", "M293.3 .6c10.9 2.5 18.6 12.2 18.6 23.4l0 384.7c0 8.9-4.9 17-12.7 21.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.3c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5c4.9-10.1 16.1-15.4 27-12.9zM263.9 128.4l-28.6 58.8c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l92.5-49.4 0-265.9z"]
};
const faChessKing = {
  prefix: 'far',
  iconName: 'chess-king',
  icon: [448, 512, [9818], "f43f", "M248 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 32-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 40L59.6 144C26.7 144 0 170.7 0 203.6c0 8.2 1.7 16.3 4.9 23.8L59.1 352l52.3 0L49 208.2c-.6-1.5-1-3-1-4.6c0-6.4 5.2-11.6 11.6-11.6L224 192l164.4 0c6.4 0 11.6 5.2 11.6 11.6c0 1.6-.3 3.2-1 4.6L336.5 352l52.3 0 54.2-124.6c3.3-7.5 4.9-15.6 4.9-23.8c0-32.9-26.7-59.6-59.6-59.6L248 144l0-40 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0 0-32zM101.2 432l245.6 0 16.6 32L84.7 464l16.6-32zm283.7-30.7c-5.5-10.6-16.5-17.3-28.4-17.3l-265 0c-12 0-22.9 6.7-28.4 17.3L36.6 452.5c-3 5.8-4.6 12.2-4.6 18.7C32 493.8 50.2 512 72.8 512l302.5 0c22.5 0 40.8-18.2 40.8-40.8c0-6.5-1.6-12.9-4.6-18.7l-26.5-51.2z"]
};
const faCircleUser = {
  prefix: 'far',
  iconName: 'circle-user',
  icon: [512, 512, [62142, "user-circle"], "f2bd", "M406.5 399.6C387.4 352.9 341.5 320 288 320l-64 0c-53.5 0-99.4 32.9-118.5 79.6C69.9 362.2 48 311.7 48 256C48 141.1 141.1 48 256 48s208 93.1 208 208c0 55.7-21.9 106.2-57.5 143.6zm-40.1 32.7C334.4 452.4 296.6 464 256 464s-78.4-11.6-110.5-31.7c7.3-36.7 39.7-64.3 78.5-64.3l64 0c38.8 0 71.2 27.6 78.5 64.3zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-272a40 40 0 1 1 0-80 40 40 0 1 1 0 80zm-88-40a88 88 0 1 0 176 0 88 88 0 1 0 -176 0z"]
};
const faUserCircle = faCircleUser;
const faCopy = {
  prefix: 'far',
  iconName: 'copy',
  icon: [448, 512, [], "f0c5", "M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L400 115.9 400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-32-48 0 0 32c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l32 0 0-48-32 0z"]
};
const faShareFromSquare = {
  prefix: 'far',
  iconName: 'share-from-square',
  icon: [576, 512, [61509, "share-square"], "f14d", "M400 255.4l0-15.4 0-32c0-8.8-7.2-16-16-16l-32 0-16 0-46.5 0c-50.9 0-93.9 33.5-108.3 79.6c-3.3-9.4-5.2-19.8-5.2-31.6c0-61.9 50.1-112 112-112l48 0 16 0 32 0c8.8 0 16-7.2 16-16l0-32 0-15.4L506 160 400 255.4zM336 240l16 0 0 48c0 17.7 14.3 32 32 32l3.7 0c7.9 0 15.5-2.9 21.4-8.2l139-125.1c7.6-6.8 11.9-16.5 11.9-26.7s-4.3-19.9-11.9-26.7L409.9 8.9C403.5 3.2 395.3 0 386.7 0C367.5 0 352 15.5 352 34.7L352 80l-16 0-32 0-16 0c-88.4 0-160 71.6-160 160c0 60.4 34.6 99.1 63.9 120.9c5.9 4.4 11.5 8.1 16.7 11.2c4.4 2.7 8.5 4.9 11.9 6.6c3.4 1.7 6.2 3 8.2 3.9c2.2 1 4.6 1.4 7.1 1.4l2.5 0c9.8 0 17.8-8 17.8-17.8c0-7.8-5.3-14.7-11.6-19.5c0 0 0 0 0 0c-.4-.3-.7-.5-1.1-.8c-1.7-1.1-3.4-2.5-5-4.1c-.8-.8-1.7-1.6-2.5-2.6s-1.6-1.9-2.4-2.9c-1.8-2.5-3.5-5.3-5-8.5c-2.6-6-4.3-13.3-4.3-22.4c0-36.1 29.3-65.5 65.5-65.5l14.5 0 32 0zM72 32C32.2 32 0 64.2 0 104L0 440c0 39.8 32.2 72 72 72l336 0c39.8 0 72-32.2 72-72l0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 64c0 13.3-10.7 24-24 24L72 464c-13.3 0-24-10.7-24-24l0-336c0-13.3 10.7-24 24-24l64 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L72 32z"]
};
const faShareSquare = faShareFromSquare;
const faCopyright = {
  prefix: 'far',
  iconName: 'copyright',
  icon: [512, 512, [169], "f1f9", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM199.4 312.6c-31.2-31.2-31.2-81.9 0-113.1s81.9-31.2 113.1 0c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9c-50-50-131-50-181 0s-50 131 0 181s131 50 181 0c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0c-31.2 31.2-81.9 31.2-113.1 0z"]
};
const faMap = {
  prefix: 'far',
  iconName: 'map',
  icon: [576, 512, [128506, 62072], "f279", "M565.6 36.2C572.1 40.7 576 48.1 576 56l0 336c0 10-6.2 18.9-15.5 22.4l-168 64c-5.2 2-10.9 2.1-16.1 .3L192.5 417.5l-160 61c-7.4 2.8-15.7 1.8-22.2-2.7S0 463.9 0 456L0 120c0-10 6.1-18.9 15.5-22.4l168-64c5.2-2 10.9-2.1 16.1-.3L383.5 94.5l160-61c7.4-2.8 15.7-1.8 22.2 2.7zM48 136.5l0 284.6 120-45.7 0-284.6L48 136.5zM360 422.7l0-285.4-144-48 0 285.4 144 48zm48-1.5l120-45.7 0-284.6L408 136.5l0 284.6z"]
};
const faBellSlash = {
  prefix: 'far',
  iconName: 'bell-slash',
  icon: [640, 512, [128277, 61943], "f1f6", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L542.6 400c2.7-7.8 1.3-16.5-3.9-23l-14.9-18.6C495.5 322.9 480 278.8 480 233.4l0-33.4c0-75.8-55.5-138.6-128-150.1L352 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 17.9c-43.9 7-81.5 32.7-104.4 68.7L38.8 5.1zM221.7 148.4C239.6 117.1 273.3 96 312 96l8 0 8 0c57.4 0 104 46.6 104 104l0 33.4c0 32.7 6.4 64.8 18.7 94.5L221.7 148.4zM406.2 416l-60.9-48-176.9 0c21.2-32.8 34.4-70.3 38.4-109.1L160 222.1l0 11.4c0 45.4-15.5 89.5-43.8 124.9L101.3 377c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l286.2 0zM384 448l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"]
};
const faHandLizard = {
  prefix: 'far',
  iconName: 'hand-lizard',
  icon: [512, 512, [], "f258", "M72 112c-13.3 0-24 10.7-24 24s10.7 24 24 24l168 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-104 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l152 0c4.5 0 8.9 1.3 12.7 3.6l64 40c7 4.4 11.3 12.1 11.3 20.4l0 24c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-10.7L281.1 384 136 384c-39.8 0-72-32.2-72-72s32.2-72 72-72l104 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L72 208c-39.8 0-72-32.2-72-72S32.2 64 72 64l209.6 0c46.7 0 90.9 21.5 119.7 58.3l78.4 100.1c20.9 26.7 32.3 59.7 32.3 93.7L512 424c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-107.9c0-23.2-7.8-45.8-22.1-64.1L363.5 151.9c-19.7-25.2-49.9-39.9-81.9-39.9L72 112z"]
};
const faFaceSmile = {
  prefix: 'far',
  iconName: 'face-smile',
  icon: [512, 512, [128578, "smile"], "f118", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm177.6 62.1C192.8 334.5 218.8 352 256 352s63.2-17.5 78.4-33.9c9-9.7 24.2-10.4 33.9-1.4s10.4 24.2 1.4 33.9c-22 23.8-60 49.4-113.6 49.4s-91.7-25.5-113.6-49.4c-9-9.7-8.4-24.9 1.4-33.9s24.9-8.4 33.9 1.4zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSmile = faFaceSmile;
const faHandPeace = {
  prefix: 'far',
  iconName: 'hand-peace',
  icon: [512, 512, [9996], "f25b", "M250.8 1.4c-35.2-3.7-66.6 21.8-70.3 57L174 119 156.7 69.6C145 36.3 108.4 18.8 75.1 30.5S24.2 78.8 35.9 112.1L88.7 262.2C73.5 276.7 64 297.3 64 320c0 0 0 0 0 0l0 24c0 92.8 75.2 168 168 168l48 0c92.8 0 168-75.2 168-168l0-72 0-16 0-32c0-35.3-28.7-64-64-64c-7.9 0-15.4 1.4-22.4 4c-10.4-21.3-32.3-36-57.6-36c-.7 0-1.5 0-2.2 0l5.9-56.3c3.7-35.2-21.8-66.6-57-70.3zm-.2 155.4C243.9 166.9 240 179 240 192l0 48c0 .7 0 1.4 0 2c-5.1-1.3-10.5-2-16-2l-7.4 0-5.4-15.3 17-161.3c.9-8.8 8.8-15.2 17.6-14.2s15.2 8.8 14.2 17.6l-9.5 90.1zM111.4 85.6L165.7 240 144 240c-4 0-8 .3-11.9 .9L81.2 96.2c-2.9-8.3 1.5-17.5 9.8-20.4s17.5 1.5 20.4 9.8zM288 192c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48zm38.4 108c10.4 21.3 32.3 36 57.6 36c5.5 0 10.9-.7 16-2l0 10c0 66.3-53.7 120-120 120l-48 0c-66.3 0-120-53.7-120-120l0-24s0 0 0 0c0-17.7 14.3-32 32-32l80 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0c35.3 0 64-28.7 64-64c0-.7 0-1.4 0-2c5.1 1.3 10.5 2 16 2c7.9 0 15.4-1.4 22.4-4zM400 272c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-32 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 0 16z"]
};
const faFaceGrinHearts = {
  prefix: 'far',
  iconName: 'face-grin-hearts',
  icon: [512, 512, [128525, "grin-hearts"], "f584", "M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm349.5 52.4c18.7-4.4 35.9 12 25.5 28.1C350.4 374.6 306.3 400 255.9 400s-94.5-25.4-119.1-63.5c-10.4-16.1 6.8-32.5 25.5-28.1c28.9 6.8 60.5 10.5 93.6 10.5s64.7-3.7 93.6-10.5zM215.3 137.1c17.8 4.8 28.4 23.1 23.6 40.8l-17.4 65c-2.3 8.5-11.1 13.6-19.6 11.3l-65.1-17.4c-17.8-4.8-28.4-23.1-23.6-40.8s23.1-28.4 40.8-23.6l16.1 4.3 4.3-16.1c4.8-17.8 23.1-28.4 40.8-23.6zm122.3 23.6l4.3 16.1 16.1-4.3c17.8-4.8 36.1 5.8 40.8 23.6s-5.8 36.1-23.6 40.8l-65.1 17.4c-8.5 2.3-17.3-2.8-19.6-11.3l-17.4-65c-4.8-17.8 5.8-36.1 23.6-40.8s36.1 5.8 40.9 23.6z"]
};
const faGrinHearts = faFaceGrinHearts;
const faBuilding = {
  prefix: 'far',
  iconName: 'building',
  icon: [384, 512, [127970, 61687], "f1ad", "M64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l80 0 0-64c0-26.5 21.5-48 48-48s48 21.5 48 48l0 64 80 0c8.8 0 16-7.2 16-16l0-384c0-8.8-7.2-16-16-16L64 48zM0 64C0 28.7 28.7 0 64 0L320 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm88 40c0-8.8 7.2-16 16-16l48 0c8.8 0 16 7.2 16 16l0 48c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-48zM232 88l48 0c8.8 0 16 7.2 16 16l0 48c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-48c0-8.8 7.2-16 16-16zM88 232c0-8.8 7.2-16 16-16l48 0c8.8 0 16 7.2 16 16l0 48c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-48zm144-16l48 0c8.8 0 16 7.2 16 16l0 48c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-48c0-8.8 7.2-16 16-16z"]
};
const faFaceGrinBeamSweat = {
  prefix: 'far',
  iconName: 'face-grin-beam-sweat',
  icon: [512, 512, [128517, "grin-beam-sweat"], "f583", "M476.8 126.3C497.1 120.8 512 102.7 512 81c0-20-28.6-60.4-41.6-77.7c-3.2-4.4-9.6-4.4-12.8 0c-9.5 12.6-27.1 37.2-36 57.5c-.3 .7-.6 1.4-.9 2.1C417.8 69.7 416 76 416 81c0 26 21.5 47 48 47c4.4 0 8.7-.6 12.8-1.7zM395.4 41.2C355.3 15.2 307.4 0 256 0C114.6 0 0 114.6 0 256S114.6 512 256 512s256-114.6 256-256c0-35.8-7.3-69.9-20.6-100.8c-8.6 3.1-17.8 4.8-27.4 4.8c-8.9 0-17.6-1.5-25.7-4.2C454.7 185.5 464 219.7 464 256c0 114.9-93.1 208-208 208S48 370.9 48 256S141.1 48 256 48c48.7 0 93.4 16.7 128.9 44.7c-.6-3.8-.9-7.7-.9-11.7c0-11.4 3.8-22.4 7.1-30.5c1.3-3.1 2.7-6.2 4.3-9.3zM375 336.5c10.4-16.1-6.8-32.5-25.5-28.1c-28.9 6.8-60.5 10.5-93.6 10.5s-64.7-3.7-93.6-10.5c-18.7-4.4-35.9 12-25.5 28.1c24.6 38.1 68.7 63.5 119.1 63.5s94.5-25.4 119.1-63.5zM217.6 228.8s0 0 0 0s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C126.7 188.4 120 206.1 120 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0zm160 0s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C286.7 188.4 280 206.1 280 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0c0 0 0 0 0 0z"]
};
const faGrinBeamSweat = faFaceGrinBeamSweat;
const faMoon = {
  prefix: 'far',
  iconName: 'moon',
  icon: [384, 512, [127769, 9214], "f186", "M144.7 98.7c-21 34.1-33.1 74.3-33.1 117.3c0 98 62.8 181.4 150.4 211.7c-12.4 2.8-25.3 4.3-38.6 4.3C126.6 432 48 353.3 48 256c0-68.9 39.4-128.4 96.8-157.3zm62.1-66C91.1 41.2 0 137.9 0 256C0 379.7 100 480 223.5 480c47.8 0 92-15 128.4-40.6c1.9-1.3 3.7-2.7 5.5-4c4.8-3.6 9.4-7.4 13.9-11.4c2.7-2.4 5.3-4.8 7.9-7.3c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-3.7 .6-7.4 1.2-11.1 1.6c-5 .5-10.1 .9-15.3 1c-1.2 0-2.5 0-3.7 0l-.3 0c-96.8-.2-175.2-78.9-175.2-176c0-54.8 24.9-103.7 64.1-136c1-.9 2.1-1.7 3.2-2.6c4-3.2 8.2-6.2 12.5-9c3.1-2 6.3-4 9.6-5.8c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-3.6-.3-7.1-.5-10.7-.6c-2.7-.1-5.5-.1-8.2-.1c-3.3 0-6.5 .1-9.8 .2c-2.3 .1-4.6 .2-6.9 .4z"]
};
const faCalendar = {
  prefix: 'far',
  iconName: 'calendar',
  icon: [448, 512, [128197, 128198], "f133", "M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L64 64C28.7 64 0 92.7 0 128l0 16 0 48L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-256 0-48 0-16c0-35.3-28.7-64-64-64l-40 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L152 64l0-40zM48 192l352 0 0 256c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256z"]
};
const faFaceGrinTongueWink = {
  prefix: 'far',
  iconName: 'face-grin-tongue-wink',
  icon: [512, 512, [128540, "grin-tongue-wink"], "f58b", "M348.3 442.4c2.4-8.4 3.7-17.3 3.7-26.4l0-52.5c8.8-8 16.6-17.1 23-27c10.4-16.1-6.8-32.5-25.5-28.1c-28.9 6.8-60.5 10.5-93.6 10.5s-64.7-3.7-93.6-10.5c-18.7-4.4-35.9 12-25.5 28.1c6.5 10 14.3 19.1 23.1 27.1l0 52.4c0 9.2 1.3 18 3.7 26.4C95.1 408.4 48 337.7 48 256C48 141.1 141.1 48 256 48s208 93.1 208 208c0 81.7-47.1 152.4-115.7 186.4zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM159.6 220c10.6 0 19.9 3.8 25.4 9.7c7.6 8.1 20.2 8.5 28.3 .9s8.5-20.2 .9-28.3C199.7 186.8 179 180 159.6 180s-40.1 6.8-54.6 22.3c-7.6 8.1-7.1 20.7 .9 28.3s20.7 7.1 28.3-.9c5.5-5.8 14.8-9.7 25.4-9.7zm176.7 12a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm-.4-72a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm0 128a80 80 0 1 0 0-160 80 80 0 1 0 0 160zM320 416c0 35.3-28.7 64-64 64s-64-28.7-64-64l0-37.4c0-14.7 11.9-26.6 26.6-26.6l2 0c11.3 0 21.1 7.9 23.6 18.9c2.8 12.6 20.8 12.6 23.6 0c2.5-11.1 12.3-18.9 23.6-18.9l2 0c14.7 0 26.6 11.9 26.6 26.6l0 37.4z"]
};
const faGrinTongueWink = faFaceGrinTongueWink;
const faClone = {
  prefix: 'far',
  iconName: 'clone',
  icon: [512, 512, [], "f24d", "M64 464l224 0c8.8 0 16-7.2 16-16l0-64 48 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l64 0 0 48-64 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zM224 304l224 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16L224 48c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zm-64-16l0-224c0-35.3 28.7-64 64-64L448 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-224 0c-35.3 0-64-28.7-64-64z"]
};
const faFaceAngry = {
  prefix: 'far',
  iconName: 'face-angry',
  icon: [512, 512, [128544, "angry"], "f556", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm72.4-118.5c9.7-9 10.2-24.2 1.2-33.9C315.3 344.3 290.6 328 256 328s-59.3 16.3-73.5 31.6c-9 9.7-8.5 24.9 1.2 33.9s24.9 8.5 33.9-1.2c7.4-7.9 20-16.4 38.5-16.4s31.1 8.5 38.5 16.4c9 9.7 24.2 10.2 33.9 1.2zM176.4 272c17.7 0 32-14.3 32-32c0-1.5-.1-3-.3-4.4l10.9 3.6c8.4 2.8 17.4-1.7 20.2-10.1s-1.7-17.4-10.1-20.2l-96-32c-8.4-2.8-17.4 1.7-20.2 10.1s1.7 17.4 10.1 20.2l30.7 10.2c-5.8 5.8-9.3 13.8-9.3 22.6c0 17.7 14.3 32 32 32zm192-32c0-8.9-3.6-17-9.5-22.8l30.2-10.1c8.4-2.8 12.9-11.9 10.1-20.2s-11.9-12.9-20.2-10.1l-96 32c-8.4 2.8-12.9 11.9-10.1 20.2s11.9 12.9 20.2 10.1l11.7-3.9c-.2 1.5-.3 3.1-.3 4.7c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
};
const faAngry = faFaceAngry;
const faRectangleXmark = {
  prefix: 'far',
  iconName: 'rectangle-xmark',
  icon: [512, 512, [62164, "rectangle-times", "times-rectangle", "window-close"], "f410", "M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80zM0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm175 79c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faRectangleTimes = faRectangleXmark;
const faTimesRectangle = faRectangleXmark;
const faWindowClose = faRectangleXmark;
const faPaperPlane = {
  prefix: 'far',
  iconName: 'paper-plane',
  icon: [512, 512, [61913], "f1d8", "M16.1 260.2c-22.6 12.9-20.5 47.3 3.6 57.3L160 376l0 103.3c0 18.1 14.6 32.7 32.7 32.7c9.7 0 18.9-4.3 25.1-11.8l62-74.3 123.9 51.6c18.9 7.9 40.8-4.5 43.9-24.7l64-416c1.9-12.1-3.4-24.3-13.5-31.2s-23.3-7.5-34-1.4l-448 256zm52.1 25.5L409.7 90.6 190.1 336l1.2 1L68.2 285.7zM403.3 425.4L236.7 355.9 450.8 116.6 403.3 425.4z"]
};
const faLifeRing = {
  prefix: 'far',
  iconName: 'life-ring',
  icon: [512, 512, [], "f1cd", "M385.1 419.1C349.7 447.2 304.8 464 256 464s-93.7-16.8-129.1-44.9l80.4-80.4c14.3 8.4 31 13.3 48.8 13.3s34.5-4.8 48.8-13.3l80.4 80.4zm68.1 .2C489.9 374.9 512 318.1 512 256s-22.1-118.9-58.8-163.3L465 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L419.3 58.8C374.9 22.1 318.1 0 256 0S137.1 22.1 92.7 58.8L81 47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9L58.8 92.7C22.1 137.1 0 193.9 0 256s22.1 118.9 58.8 163.3L47 431c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l11.8-11.8C137.1 489.9 193.9 512 256 512s118.9-22.1 163.3-58.8L431 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-11.8-11.8zm-34.1-34.1l-80.4-80.4c8.4-14.3 13.3-31 13.3-48.8s-4.8-34.5-13.3-48.8l80.4-80.4C447.2 162.3 464 207.2 464 256s-16.8 93.7-44.9 129.1zM385.1 92.9l-80.4 80.4c-14.3-8.4-31-13.3-48.8-13.3s-34.5 4.8-48.8 13.3L126.9 92.9C162.3 64.8 207.2 48 256 48s93.7 16.8 129.1 44.9zM173.3 304.8L92.9 385.1C64.8 349.7 48 304.8 48 256s16.8-93.7 44.9-129.1l80.4 80.4c-8.4 14.3-13.3 31-13.3 48.8s4.8 34.5 13.3 48.8zM208 256a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
};
const faFaceGrimace = {
  prefix: 'far',
  iconName: 'face-grimace',
  icon: [512, 512, [128556, "grimace"], "f57f", "M256 48a208 208 0 1 0 0 416 208 208 0 1 0 0-416zM512 256A256 256 0 1 1 0 256a256 256 0 1 1 512 0zM168 320c-13.3 0-24 10.7-24 24s10.7 24 24 24l8 0 0-48-8 0zm40 48l32 0 0-48-32 0 0 48zm96 0l0-48-32 0 0 48 32 0zm32 0l8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0 48zM168 288l176 0c30.9 0 56 25.1 56 56s-25.1 56-56 56l-176 0c-30.9 0-56-25.1-56-56s25.1-56 56-56zm-23.6-80a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGrimace = faFaceGrimace;
const faCalendarMinus = {
  prefix: 'far',
  iconName: 'calendar-minus',
  icon: [448, 512, [], "f272", "M128 0c13.3 0 24 10.7 24 24l0 40 144 0 0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40 40 0c35.3 0 64 28.7 64 64l0 16 0 48 0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192l0-48 0-16C0 92.7 28.7 64 64 64l40 0 0-40c0-13.3 10.7-24 24-24zM400 192L48 192l0 256c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-256zM296 352l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24z"]
};
const faCircleXmark = {
  prefix: 'far',
  iconName: 'circle-xmark',
  icon: [512, 512, [61532, "times-circle", "xmark-circle"], "f057", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z"]
};
const faTimesCircle = faCircleXmark;
const faXmarkCircle = faCircleXmark;
const faThumbsUp = {
  prefix: 'far',
  iconName: 'thumbs-up',
  icon: [512, 512, [128077, 61575], "f164", "M323.8 34.8c-38.2-10.9-78.1 11.2-89 49.4l-5.7 20c-3.7 13-10.4 25-19.5 35l-51.3 56.4c-8.9 9.8-8.2 25 1.6 33.9s25 8.2 33.9-1.6l51.3-56.4c14.1-15.5 24.4-34 30.1-54.1l5.7-20c3.6-12.7 16.9-20.1 29.7-16.5s20.1 16.9 16.5 29.7l-5.7 20c-5.7 19.9-14.7 38.7-26.6 55.5c-5.2 7.3-5.8 16.9-1.7 24.9s12.3 13 21.3 13L448 224c8.8 0 16 7.2 16 16c0 6.8-4.3 12.7-10.4 15c-7.4 2.8-13 9-14.9 16.7s.1 15.8 5.3 21.7c2.5 2.8 4 6.5 4 10.6c0 7.8-5.6 14.3-13 15.7c-8.2 1.6-15.1 7.3-18 15.2s-1.6 16.7 3.6 23.3c2.1 2.7 3.4 6.1 3.4 9.9c0 6.7-4.2 12.6-10.2 14.9c-11.5 4.5-17.7 16.9-14.4 28.8c.4 1.3 .6 2.8 .6 4.3c0 8.8-7.2 16-16 16l-97.5 0c-12.6 0-25-3.7-35.5-10.7l-61.7-41.1c-11-7.4-25.9-4.4-33.3 6.7s-4.4 25.9 6.7 33.3l61.7 41.1c18.4 12.3 40 18.8 62.1 18.8l97.5 0c34.7 0 62.9-27.6 64-62c14.6-11.7 24-29.7 24-50c0-4.5-.5-8.8-1.3-13c15.4-11.7 25.3-30.2 25.3-51c0-6.5-1-12.8-2.8-18.7C504.8 273.7 512 257.7 512 240c0-35.3-28.6-64-64-64l-92.3 0c4.7-10.4 8.7-21.2 11.8-32.2l5.7-20c10.9-38.2-11.2-78.1-49.4-89zM32 192c-17.7 0-32 14.3-32 32L0 448c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-224c0-17.7-14.3-32-32-32l-64 0z"]
};
const faWindowMinimize = {
  prefix: 'far',
  iconName: 'window-minimize',
  icon: [512, 512, [128469], "f2d1", "M24 432c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 432z"]
};
const faSquareFull = {
  prefix: 'far',
  iconName: 'square-full',
  icon: [512, 512, [128997, 128998, 128999, 129000, 129001, 129002, 129003, 11035, 11036], "f45c", "M464 48l0 416L48 464 48 48l416 0zM48 0L0 0 0 48 0 464l0 48 48 0 416 0 48 0 0-48 0-416 0-48L464 0 48 0z"]
};
const faNoteSticky = {
  prefix: 'far',
  iconName: 'note-sticky',
  icon: [448, 512, [62026, "sticky-note"], "f249", "M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l224 0 0-80c0-17.7 14.3-32 32-32l80 0 0-224c0-8.8-7.2-16-16-16L64 80zM288 480L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 224 0 5.5c0 17-6.7 33.3-18.7 45.3l-90.5 90.5c-12 12-28.3 18.7-45.3 18.7l-5.5 0z"]
};
const faStickyNote = faNoteSticky;
const faFaceSadTear = {
  prefix: 'far',
  iconName: 'face-sad-tear',
  icon: [512, 512, [128546, "sad-tear"], "f5b4", "M175.9 448c-35-.1-65.5-22.6-76-54.6C67.6 356.8 48 308.7 48 256C48 141.1 141.1 48 256 48s208 93.1 208 208s-93.1 208-208 208c-28.4 0-55.5-5.7-80.1-16zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM128 369c0 26 21.5 47 48 47s48-21 48-47c0-20-28.4-60.4-41.6-77.7c-3.2-4.4-9.6-4.4-12.8 0C156.6 308.6 128 349 128 369zm128-65c-13.3 0-24 10.7-24 24s10.7 24 24 24c30.7 0 58.7 11.5 80 30.6c9.9 8.8 25 8 33.9-1.9s8-25-1.9-33.9C338.3 320.2 299 304 256 304zm47.6-96a32 32 0 1 0 64 0 32 32 0 1 0 -64 0zm-128 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faSadTear = faFaceSadTear;
const faHandPointLeft = {
  prefix: 'far',
  iconName: 'hand-point-left',
  icon: [512, 512, [], "f0a5", "M64 128l177.6 0c-1 5.2-1.6 10.5-1.6 16l0 16-32 0L64 160c-8.8 0-16-7.2-16-16s7.2-16 16-16zm224 16c0-17.7 14.3-32 32-32c0 0 0 0 0 0l24 0c66.3 0 120 53.7 120 120l0 48c0 52.5-33.7 97.1-80.7 113.4c.5-3.1 .7-6.2 .7-9.4c0-20-9.2-37.9-23.6-49.7c4.9-9 7.6-19.4 7.6-30.3c0-15.1-5.3-29-14-40c8.8-11 14-24.9 14-40l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-40 0-40zm32-80s0 0 0 0c-18 0-34.6 6-48 16L64 80C28.7 80 0 108.7 0 144s28.7 64 64 64l82 0c-1.3 5.1-2 10.5-2 16c0 25.3 14.7 47.2 36 57.6c-2.6 7-4 14.5-4 22.4c0 20 9.2 37.9 23.6 49.7c-4.9 9-7.6 19.4-7.6 30.3c0 35.3 28.7 64 64 64l64 0 24 0c92.8 0 168-75.2 168-168l0-48c0-92.8-75.2-168-168-168l-24 0zM256 400c-8.8 0-16-7.2-16-16s7.2-16 16-16l48 0 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0zM240 224c0 5.5 .7 10.9 2 16l-2 0-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l32 0 0 16zm24 64l40 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l24 0z"]
};
var icons = {
  faTrashCan,
  faTrashAlt,
  faMessage,
  faCommentAlt,
  faFileLines,
  faFileAlt,
  faFileText,
  faCalendarDays,
  faCalendarAlt,
  faHandPointRight,
  faFaceSmileBeam,
  faSmileBeam,
  faFaceGrinStars,
  faGrinStars,
  faAddressBook,
  faContactBook,
  faComments,
  faPaste,
  faFileClipboard,
  faFaceGrinTongueSquint,
  faGrinTongueSquint,
  faFaceFlushed,
  faFlushed,
  faSquareCaretRight,
  faCaretSquareRight,
  faSquareMinus,
  faMinusSquare,
  faCompass,
  faSquareCaretDown,
  faCaretSquareDown,
  faFaceKissBeam,
  faKissBeam,
  faLightbulb,
  faFlag,
  faSquareCheck,
  faCheckSquare,
  faCircleDot,
  faDotCircle,
  faFaceDizzy,
  faDizzy,
  faFutbol,
  faFutbolBall,
  faSoccerBall,
  faPenToSquare,
  faEdit,
  faHourglassHalf,
  faHourglass2,
  faEyeSlash,
  faHand,
  faHandPaper,
  faHandSpock,
  faFaceKiss,
  faKiss,
  faFaceGrinTongue,
  faGrinTongue,
  faChessBishop,
  faFaceGrinWink,
  faGrinWink,
  faFaceGrinWide,
  faGrinAlt,
  faFaceFrownOpen,
  faFrownOpen,
  faHandPointUp,
  faBookmark,
  faHandPointDown,
  faFolder,
  faFolderBlank,
  faUser,
  faSquareCaretLeft,
  faCaretSquareLeft,
  faStar,
  faChessKnight,
  faFaceLaughSquint,
  faLaughSquint,
  faFaceLaugh,
  faLaugh,
  faFolderOpen,
  faClipboard,
  faChessQueen,
  faHandBackFist,
  faHandRock,
  faSquareCaretUp,
  faCaretSquareUp,
  faChartBar,
  faBarChart,
  faWindowRestore,
  faSquarePlus,
  faPlusSquare,
  faImage,
  faFolderClosed,
  faLemon,
  faHandshake,
  faGem,
  faCirclePlay,
  faPlayCircle,
  faCircleCheck,
  faCheckCircle,
  faCircleStop,
  faStopCircle,
  faIdBadge,
  faFaceLaughBeam,
  faLaughBeam,
  faRegistered,
  faAddressCard,
  faContactCard,
  faVcard,
  faFaceTired,
  faTired,
  faFontAwesome,
  faFontAwesomeFlag,
  faFontAwesomeLogoFull,
  faFaceSmileWink,
  faSmileWink,
  faFileWord,
  faFilePowerpoint,
  faEnvelopeOpen,
  faFileZipper,
  faFileArchive,
  faSquare,
  faSnowflake,
  faNewspaper,
  faFaceKissWinkHeart,
  faKissWinkHeart,
  faStarHalfStroke,
  faStarHalfAlt,
  faFileExcel,
  faFaceGrinBeam,
  faGrinBeam,
  faObjectUngroup,
  faCircleRight,
  faArrowAltCircleRight,
  faFaceRollingEyes,
  faMehRollingEyes,
  faObjectGroup,
  faHeart,
  faFaceSurprise,
  faSurprise,
  faCirclePause,
  faPauseCircle,
  faCircle,
  faCircleUp,
  faArrowAltCircleUp,
  faFileAudio,
  faFileImage,
  faCircleQuestion,
  faQuestionCircle,
  faFaceMehBlank,
  faMehBlank,
  faEye,
  faFaceSadCry,
  faSadCry,
  faFileCode,
  faWindowMaximize,
  faFaceFrown,
  faFrown,
  faFloppyDisk,
  faSave,
  faCommentDots,
  faCommenting,
  faFaceGrinSquint,
  faGrinSquint,
  faHandPointer,
  faHandScissors,
  faFaceGrinTears,
  faGrinTears,
  faCalendarXmark,
  faCalendarTimes,
  faFileVideo,
  faFilePdf,
  faComment,
  faEnvelope,
  faHourglass,
  faHourglassEmpty,
  faCalendarCheck,
  faHardDrive,
  faHdd,
  faFaceGrinSquintTears,
  faGrinSquintTears,
  faRectangleList,
  faListAlt,
  faCalendarPlus,
  faCircleLeft,
  faArrowAltCircleLeft,
  faMoneyBill1,
  faMoneyBillAlt,
  faClock,
  faClockFour,
  faKeyboard,
  faClosedCaptioning,
  faImages,
  faFaceGrin,
  faGrin,
  faFaceMeh,
  faMeh,
  faIdCard,
  faDriversLicense,
  faSun,
  faFaceLaughWink,
  faLaughWink,
  faCircleDown,
  faArrowAltCircleDown,
  faThumbsDown,
  faChessPawn,
  faCreditCard,
  faCreditCardAlt,
  faBell,
  faFile,
  faHospital,
  faHospitalAlt,
  faHospitalWide,
  faChessRook,
  faStarHalf,
  faChessKing,
  faCircleUser,
  faUserCircle,
  faCopy,
  faShareFromSquare,
  faShareSquare,
  faCopyright,
  faMap,
  faBellSlash,
  faHandLizard,
  faFaceSmile,
  faSmile,
  faHandPeace,
  faFaceGrinHearts,
  faGrinHearts,
  faBuilding,
  faFaceGrinBeamSweat,
  faGrinBeamSweat,
  faMoon,
  faCalendar,
  faFaceGrinTongueWink,
  faGrinTongueWink,
  faClone,
  faFaceAngry,
  faAngry,
  faRectangleXmark,
  faRectangleTimes,
  faTimesRectangle,
  faWindowClose,
  faPaperPlane,
  faLifeRing,
  faFaceGrimace,
  faGrimace,
  faCalendarMinus,
  faCircleXmark,
  faTimesCircle,
  faXmarkCircle,
  faThumbsUp,
  faWindowMinimize,
  faSquareFull,
  faNoteSticky,
  faStickyNote,
  faFaceSadTear,
  faSadTear,
  faHandPointLeft
};




/***/ }),

/***/ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs":
/*!****************************************************************************!*\
  !*** ../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs ***!
  \****************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_3645772__) => {

"use strict";
__nested_webpack_require_3645772__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_3645772__.d(__nested_webpack_exports__, {
/* harmony export */   fa0: () => (/* binding */ fa0),
/* harmony export */   fa1: () => (/* binding */ fa1),
/* harmony export */   fa2: () => (/* binding */ fa2),
/* harmony export */   fa3: () => (/* binding */ fa3),
/* harmony export */   fa4: () => (/* binding */ fa4),
/* harmony export */   fa5: () => (/* binding */ fa5),
/* harmony export */   fa6: () => (/* binding */ fa6),
/* harmony export */   fa7: () => (/* binding */ fa7),
/* harmony export */   fa8: () => (/* binding */ fa8),
/* harmony export */   fa9: () => (/* binding */ fa9),
/* harmony export */   faA: () => (/* binding */ faA),
/* harmony export */   faAd: () => (/* binding */ faAd),
/* harmony export */   faAdd: () => (/* binding */ faAdd),
/* harmony export */   faAddressBook: () => (/* binding */ faAddressBook),
/* harmony export */   faAddressCard: () => (/* binding */ faAddressCard),
/* harmony export */   faAdjust: () => (/* binding */ faAdjust),
/* harmony export */   faAirFreshener: () => (/* binding */ faAirFreshener),
/* harmony export */   faAlignCenter: () => (/* binding */ faAlignCenter),
/* harmony export */   faAlignJustify: () => (/* binding */ faAlignJustify),
/* harmony export */   faAlignLeft: () => (/* binding */ faAlignLeft),
/* harmony export */   faAlignRight: () => (/* binding */ faAlignRight),
/* harmony export */   faAllergies: () => (/* binding */ faAllergies),
/* harmony export */   faAmbulance: () => (/* binding */ faAmbulance),
/* harmony export */   faAmericanSignLanguageInterpreting: () => (/* binding */ faAmericanSignLanguageInterpreting),
/* harmony export */   faAnchor: () => (/* binding */ faAnchor),
/* harmony export */   faAnchorCircleCheck: () => (/* binding */ faAnchorCircleCheck),
/* harmony export */   faAnchorCircleExclamation: () => (/* binding */ faAnchorCircleExclamation),
/* harmony export */   faAnchorCircleXmark: () => (/* binding */ faAnchorCircleXmark),
/* harmony export */   faAnchorLock: () => (/* binding */ faAnchorLock),
/* harmony export */   faAngleDoubleDown: () => (/* binding */ faAngleDoubleDown),
/* harmony export */   faAngleDoubleLeft: () => (/* binding */ faAngleDoubleLeft),
/* harmony export */   faAngleDoubleRight: () => (/* binding */ faAngleDoubleRight),
/* harmony export */   faAngleDoubleUp: () => (/* binding */ faAngleDoubleUp),
/* harmony export */   faAngleDown: () => (/* binding */ faAngleDown),
/* harmony export */   faAngleLeft: () => (/* binding */ faAngleLeft),
/* harmony export */   faAngleRight: () => (/* binding */ faAngleRight),
/* harmony export */   faAngleUp: () => (/* binding */ faAngleUp),
/* harmony export */   faAnglesDown: () => (/* binding */ faAnglesDown),
/* harmony export */   faAnglesLeft: () => (/* binding */ faAnglesLeft),
/* harmony export */   faAnglesRight: () => (/* binding */ faAnglesRight),
/* harmony export */   faAnglesUp: () => (/* binding */ faAnglesUp),
/* harmony export */   faAngry: () => (/* binding */ faAngry),
/* harmony export */   faAnkh: () => (/* binding */ faAnkh),
/* harmony export */   faAppleAlt: () => (/* binding */ faAppleAlt),
/* harmony export */   faAppleWhole: () => (/* binding */ faAppleWhole),
/* harmony export */   faArchive: () => (/* binding */ faArchive),
/* harmony export */   faArchway: () => (/* binding */ faArchway),
/* harmony export */   faAreaChart: () => (/* binding */ faAreaChart),
/* harmony export */   faArrowAltCircleDown: () => (/* binding */ faArrowAltCircleDown),
/* harmony export */   faArrowAltCircleLeft: () => (/* binding */ faArrowAltCircleLeft),
/* harmony export */   faArrowAltCircleRight: () => (/* binding */ faArrowAltCircleRight),
/* harmony export */   faArrowAltCircleUp: () => (/* binding */ faArrowAltCircleUp),
/* harmony export */   faArrowCircleDown: () => (/* binding */ faArrowCircleDown),
/* harmony export */   faArrowCircleLeft: () => (/* binding */ faArrowCircleLeft),
/* harmony export */   faArrowCircleRight: () => (/* binding */ faArrowCircleRight),
/* harmony export */   faArrowCircleUp: () => (/* binding */ faArrowCircleUp),
/* harmony export */   faArrowDown: () => (/* binding */ faArrowDown),
/* harmony export */   faArrowDown19: () => (/* binding */ faArrowDown19),
/* harmony export */   faArrowDown91: () => (/* binding */ faArrowDown91),
/* harmony export */   faArrowDownAZ: () => (/* binding */ faArrowDownAZ),
/* harmony export */   faArrowDownLong: () => (/* binding */ faArrowDownLong),
/* harmony export */   faArrowDownShortWide: () => (/* binding */ faArrowDownShortWide),
/* harmony export */   faArrowDownUpAcrossLine: () => (/* binding */ faArrowDownUpAcrossLine),
/* harmony export */   faArrowDownUpLock: () => (/* binding */ faArrowDownUpLock),
/* harmony export */   faArrowDownWideShort: () => (/* binding */ faArrowDownWideShort),
/* harmony export */   faArrowDownZA: () => (/* binding */ faArrowDownZA),
/* harmony export */   faArrowLeft: () => (/* binding */ faArrowLeft),
/* harmony export */   faArrowLeftLong: () => (/* binding */ faArrowLeftLong),
/* harmony export */   faArrowLeftRotate: () => (/* binding */ faArrowLeftRotate),
/* harmony export */   faArrowPointer: () => (/* binding */ faArrowPointer),
/* harmony export */   faArrowRight: () => (/* binding */ faArrowRight),
/* harmony export */   faArrowRightArrowLeft: () => (/* binding */ faArrowRightArrowLeft),
/* harmony export */   faArrowRightFromBracket: () => (/* binding */ faArrowRightFromBracket),
/* harmony export */   faArrowRightFromFile: () => (/* binding */ faArrowRightFromFile),
/* harmony export */   faArrowRightLong: () => (/* binding */ faArrowRightLong),
/* harmony export */   faArrowRightRotate: () => (/* binding */ faArrowRightRotate),
/* harmony export */   faArrowRightToBracket: () => (/* binding */ faArrowRightToBracket),
/* harmony export */   faArrowRightToCity: () => (/* binding */ faArrowRightToCity),
/* harmony export */   faArrowRightToFile: () => (/* binding */ faArrowRightToFile),
/* harmony export */   faArrowRotateBack: () => (/* binding */ faArrowRotateBack),
/* harmony export */   faArrowRotateBackward: () => (/* binding */ faArrowRotateBackward),
/* harmony export */   faArrowRotateForward: () => (/* binding */ faArrowRotateForward),
/* harmony export */   faArrowRotateLeft: () => (/* binding */ faArrowRotateLeft),
/* harmony export */   faArrowRotateRight: () => (/* binding */ faArrowRotateRight),
/* harmony export */   faArrowTrendDown: () => (/* binding */ faArrowTrendDown),
/* harmony export */   faArrowTrendUp: () => (/* binding */ faArrowTrendUp),
/* harmony export */   faArrowTurnDown: () => (/* binding */ faArrowTurnDown),
/* harmony export */   faArrowTurnUp: () => (/* binding */ faArrowTurnUp),
/* harmony export */   faArrowUp: () => (/* binding */ faArrowUp),
/* harmony export */   faArrowUp19: () => (/* binding */ faArrowUp19),
/* harmony export */   faArrowUp91: () => (/* binding */ faArrowUp91),
/* harmony export */   faArrowUpAZ: () => (/* binding */ faArrowUpAZ),
/* harmony export */   faArrowUpFromBracket: () => (/* binding */ faArrowUpFromBracket),
/* harmony export */   faArrowUpFromGroundWater: () => (/* binding */ faArrowUpFromGroundWater),
/* harmony export */   faArrowUpFromWaterPump: () => (/* binding */ faArrowUpFromWaterPump),
/* harmony export */   faArrowUpLong: () => (/* binding */ faArrowUpLong),
/* harmony export */   faArrowUpRightDots: () => (/* binding */ faArrowUpRightDots),
/* harmony export */   faArrowUpRightFromSquare: () => (/* binding */ faArrowUpRightFromSquare),
/* harmony export */   faArrowUpShortWide: () => (/* binding */ faArrowUpShortWide),
/* harmony export */   faArrowUpWideShort: () => (/* binding */ faArrowUpWideShort),
/* harmony export */   faArrowUpZA: () => (/* binding */ faArrowUpZA),
/* harmony export */   faArrows: () => (/* binding */ faArrows),
/* harmony export */   faArrowsAlt: () => (/* binding */ faArrowsAlt),
/* harmony export */   faArrowsAltH: () => (/* binding */ faArrowsAltH),
/* harmony export */   faArrowsAltV: () => (/* binding */ faArrowsAltV),
/* harmony export */   faArrowsDownToLine: () => (/* binding */ faArrowsDownToLine),
/* harmony export */   faArrowsDownToPeople: () => (/* binding */ faArrowsDownToPeople),
/* harmony export */   faArrowsH: () => (/* binding */ faArrowsH),
/* harmony export */   faArrowsLeftRight: () => (/* binding */ faArrowsLeftRight),
/* harmony export */   faArrowsLeftRightToLine: () => (/* binding */ faArrowsLeftRightToLine),
/* harmony export */   faArrowsRotate: () => (/* binding */ faArrowsRotate),
/* harmony export */   faArrowsSpin: () => (/* binding */ faArrowsSpin),
/* harmony export */   faArrowsSplitUpAndLeft: () => (/* binding */ faArrowsSplitUpAndLeft),
/* harmony export */   faArrowsToCircle: () => (/* binding */ faArrowsToCircle),
/* harmony export */   faArrowsToDot: () => (/* binding */ faArrowsToDot),
/* harmony export */   faArrowsToEye: () => (/* binding */ faArrowsToEye),
/* harmony export */   faArrowsTurnRight: () => (/* binding */ faArrowsTurnRight),
/* harmony export */   faArrowsTurnToDots: () => (/* binding */ faArrowsTurnToDots),
/* harmony export */   faArrowsUpDown: () => (/* binding */ faArrowsUpDown),
/* harmony export */   faArrowsUpDownLeftRight: () => (/* binding */ faArrowsUpDownLeftRight),
/* harmony export */   faArrowsUpToLine: () => (/* binding */ faArrowsUpToLine),
/* harmony export */   faArrowsV: () => (/* binding */ faArrowsV),
/* harmony export */   faAslInterpreting: () => (/* binding */ faAslInterpreting),
/* harmony export */   faAssistiveListeningSystems: () => (/* binding */ faAssistiveListeningSystems),
/* harmony export */   faAsterisk: () => (/* binding */ faAsterisk),
/* harmony export */   faAt: () => (/* binding */ faAt),
/* harmony export */   faAtlas: () => (/* binding */ faAtlas),
/* harmony export */   faAtom: () => (/* binding */ faAtom),
/* harmony export */   faAudioDescription: () => (/* binding */ faAudioDescription),
/* harmony export */   faAustralSign: () => (/* binding */ faAustralSign),
/* harmony export */   faAutomobile: () => (/* binding */ faAutomobile),
/* harmony export */   faAward: () => (/* binding */ faAward),
/* harmony export */   faB: () => (/* binding */ faB),
/* harmony export */   faBaby: () => (/* binding */ faBaby),
/* harmony export */   faBabyCarriage: () => (/* binding */ faBabyCarriage),
/* harmony export */   faBackspace: () => (/* binding */ faBackspace),
/* harmony export */   faBackward: () => (/* binding */ faBackward),
/* harmony export */   faBackwardFast: () => (/* binding */ faBackwardFast),
/* harmony export */   faBackwardStep: () => (/* binding */ faBackwardStep),
/* harmony export */   faBacon: () => (/* binding */ faBacon),
/* harmony export */   faBacteria: () => (/* binding */ faBacteria),
/* harmony export */   faBacterium: () => (/* binding */ faBacterium),
/* harmony export */   faBagShopping: () => (/* binding */ faBagShopping),
/* harmony export */   faBahai: () => (/* binding */ faBahai),
/* harmony export */   faBahtSign: () => (/* binding */ faBahtSign),
/* harmony export */   faBalanceScale: () => (/* binding */ faBalanceScale),
/* harmony export */   faBalanceScaleLeft: () => (/* binding */ faBalanceScaleLeft),
/* harmony export */   faBalanceScaleRight: () => (/* binding */ faBalanceScaleRight),
/* harmony export */   faBan: () => (/* binding */ faBan),
/* harmony export */   faBanSmoking: () => (/* binding */ faBanSmoking),
/* harmony export */   faBandAid: () => (/* binding */ faBandAid),
/* harmony export */   faBandage: () => (/* binding */ faBandage),
/* harmony export */   faBangladeshiTakaSign: () => (/* binding */ faBangladeshiTakaSign),
/* harmony export */   faBank: () => (/* binding */ faBank),
/* harmony export */   faBarChart: () => (/* binding */ faBarChart),
/* harmony export */   faBarcode: () => (/* binding */ faBarcode),
/* harmony export */   faBars: () => (/* binding */ faBars),
/* harmony export */   faBarsProgress: () => (/* binding */ faBarsProgress),
/* harmony export */   faBarsStaggered: () => (/* binding */ faBarsStaggered),
/* harmony export */   faBaseball: () => (/* binding */ faBaseball),
/* harmony export */   faBaseballBall: () => (/* binding */ faBaseballBall),
/* harmony export */   faBaseballBatBall: () => (/* binding */ faBaseballBatBall),
/* harmony export */   faBasketShopping: () => (/* binding */ faBasketShopping),
/* harmony export */   faBasketball: () => (/* binding */ faBasketball),
/* harmony export */   faBasketballBall: () => (/* binding */ faBasketballBall),
/* harmony export */   faBath: () => (/* binding */ faBath),
/* harmony export */   faBathtub: () => (/* binding */ faBathtub),
/* harmony export */   faBattery: () => (/* binding */ faBattery),
/* harmony export */   faBattery0: () => (/* binding */ faBattery0),
/* harmony export */   faBattery2: () => (/* binding */ faBattery2),
/* harmony export */   faBattery3: () => (/* binding */ faBattery3),
/* harmony export */   faBattery4: () => (/* binding */ faBattery4),
/* harmony export */   faBattery5: () => (/* binding */ faBattery5),
/* harmony export */   faBatteryCar: () => (/* binding */ faBatteryCar),
/* harmony export */   faBatteryEmpty: () => (/* binding */ faBatteryEmpty),
/* harmony export */   faBatteryFull: () => (/* binding */ faBatteryFull),
/* harmony export */   faBatteryHalf: () => (/* binding */ faBatteryHalf),
/* harmony export */   faBatteryQuarter: () => (/* binding */ faBatteryQuarter),
/* harmony export */   faBatteryThreeQuarters: () => (/* binding */ faBatteryThreeQuarters),
/* harmony export */   faBed: () => (/* binding */ faBed),
/* harmony export */   faBedPulse: () => (/* binding */ faBedPulse),
/* harmony export */   faBeer: () => (/* binding */ faBeer),
/* harmony export */   faBeerMugEmpty: () => (/* binding */ faBeerMugEmpty),
/* harmony export */   faBell: () => (/* binding */ faBell),
/* harmony export */   faBellConcierge: () => (/* binding */ faBellConcierge),
/* harmony export */   faBellSlash: () => (/* binding */ faBellSlash),
/* harmony export */   faBezierCurve: () => (/* binding */ faBezierCurve),
/* harmony export */   faBible: () => (/* binding */ faBible),
/* harmony export */   faBicycle: () => (/* binding */ faBicycle),
/* harmony export */   faBiking: () => (/* binding */ faBiking),
/* harmony export */   faBinoculars: () => (/* binding */ faBinoculars),
/* harmony export */   faBiohazard: () => (/* binding */ faBiohazard),
/* harmony export */   faBirthdayCake: () => (/* binding */ faBirthdayCake),
/* harmony export */   faBitcoinSign: () => (/* binding */ faBitcoinSign),
/* harmony export */   faBlackboard: () => (/* binding */ faBlackboard),
/* harmony export */   faBlender: () => (/* binding */ faBlender),
/* harmony export */   faBlenderPhone: () => (/* binding */ faBlenderPhone),
/* harmony export */   faBlind: () => (/* binding */ faBlind),
/* harmony export */   faBlog: () => (/* binding */ faBlog),
/* harmony export */   faBold: () => (/* binding */ faBold),
/* harmony export */   faBolt: () => (/* binding */ faBolt),
/* harmony export */   faBoltLightning: () => (/* binding */ faBoltLightning),
/* harmony export */   faBomb: () => (/* binding */ faBomb),
/* harmony export */   faBone: () => (/* binding */ faBone),
/* harmony export */   faBong: () => (/* binding */ faBong),
/* harmony export */   faBook: () => (/* binding */ faBook),
/* harmony export */   faBookAtlas: () => (/* binding */ faBookAtlas),
/* harmony export */   faBookBible: () => (/* binding */ faBookBible),
/* harmony export */   faBookBookmark: () => (/* binding */ faBookBookmark),
/* harmony export */   faBookDead: () => (/* binding */ faBookDead),
/* harmony export */   faBookJournalWhills: () => (/* binding */ faBookJournalWhills),
/* harmony export */   faBookMedical: () => (/* binding */ faBookMedical),
/* harmony export */   faBookOpen: () => (/* binding */ faBookOpen),
/* harmony export */   faBookOpenReader: () => (/* binding */ faBookOpenReader),
/* harmony export */   faBookQuran: () => (/* binding */ faBookQuran),
/* harmony export */   faBookReader: () => (/* binding */ faBookReader),
/* harmony export */   faBookSkull: () => (/* binding */ faBookSkull),
/* harmony export */   faBookTanakh: () => (/* binding */ faBookTanakh),
/* harmony export */   faBookmark: () => (/* binding */ faBookmark),
/* harmony export */   faBorderAll: () => (/* binding */ faBorderAll),
/* harmony export */   faBorderNone: () => (/* binding */ faBorderNone),
/* harmony export */   faBorderStyle: () => (/* binding */ faBorderStyle),
/* harmony export */   faBorderTopLeft: () => (/* binding */ faBorderTopLeft),
/* harmony export */   faBoreHole: () => (/* binding */ faBoreHole),
/* harmony export */   faBottleDroplet: () => (/* binding */ faBottleDroplet),
/* harmony export */   faBottleWater: () => (/* binding */ faBottleWater),
/* harmony export */   faBowlFood: () => (/* binding */ faBowlFood),
/* harmony export */   faBowlRice: () => (/* binding */ faBowlRice),
/* harmony export */   faBowlingBall: () => (/* binding */ faBowlingBall),
/* harmony export */   faBox: () => (/* binding */ faBox),
/* harmony export */   faBoxArchive: () => (/* binding */ faBoxArchive),
/* harmony export */   faBoxOpen: () => (/* binding */ faBoxOpen),
/* harmony export */   faBoxTissue: () => (/* binding */ faBoxTissue),
/* harmony export */   faBoxes: () => (/* binding */ faBoxes),
/* harmony export */   faBoxesAlt: () => (/* binding */ faBoxesAlt),
/* harmony export */   faBoxesPacking: () => (/* binding */ faBoxesPacking),
/* harmony export */   faBoxesStacked: () => (/* binding */ faBoxesStacked),
/* harmony export */   faBraille: () => (/* binding */ faBraille),
/* harmony export */   faBrain: () => (/* binding */ faBrain),
/* harmony export */   faBrazilianRealSign: () => (/* binding */ faBrazilianRealSign),
/* harmony export */   faBreadSlice: () => (/* binding */ faBreadSlice),
/* harmony export */   faBridge: () => (/* binding */ faBridge),
/* harmony export */   faBridgeCircleCheck: () => (/* binding */ faBridgeCircleCheck),
/* harmony export */   faBridgeCircleExclamation: () => (/* binding */ faBridgeCircleExclamation),
/* harmony export */   faBridgeCircleXmark: () => (/* binding */ faBridgeCircleXmark),
/* harmony export */   faBridgeLock: () => (/* binding */ faBridgeLock),
/* harmony export */   faBridgeWater: () => (/* binding */ faBridgeWater),
/* harmony export */   faBriefcase: () => (/* binding */ faBriefcase),
/* harmony export */   faBriefcaseClock: () => (/* binding */ faBriefcaseClock),
/* harmony export */   faBriefcaseMedical: () => (/* binding */ faBriefcaseMedical),
/* harmony export */   faBroadcastTower: () => (/* binding */ faBroadcastTower),
/* harmony export */   faBroom: () => (/* binding */ faBroom),
/* harmony export */   faBroomBall: () => (/* binding */ faBroomBall),
/* harmony export */   faBrush: () => (/* binding */ faBrush),
/* harmony export */   faBucket: () => (/* binding */ faBucket),
/* harmony export */   faBug: () => (/* binding */ faBug),
/* harmony export */   faBugSlash: () => (/* binding */ faBugSlash),
/* harmony export */   faBugs: () => (/* binding */ faBugs),
/* harmony export */   faBuilding: () => (/* binding */ faBuilding),
/* harmony export */   faBuildingCircleArrowRight: () => (/* binding */ faBuildingCircleArrowRight),
/* harmony export */   faBuildingCircleCheck: () => (/* binding */ faBuildingCircleCheck),
/* harmony export */   faBuildingCircleExclamation: () => (/* binding */ faBuildingCircleExclamation),
/* harmony export */   faBuildingCircleXmark: () => (/* binding */ faBuildingCircleXmark),
/* harmony export */   faBuildingColumns: () => (/* binding */ faBuildingColumns),
/* harmony export */   faBuildingFlag: () => (/* binding */ faBuildingFlag),
/* harmony export */   faBuildingLock: () => (/* binding */ faBuildingLock),
/* harmony export */   faBuildingNgo: () => (/* binding */ faBuildingNgo),
/* harmony export */   faBuildingShield: () => (/* binding */ faBuildingShield),
/* harmony export */   faBuildingUn: () => (/* binding */ faBuildingUn),
/* harmony export */   faBuildingUser: () => (/* binding */ faBuildingUser),
/* harmony export */   faBuildingWheat: () => (/* binding */ faBuildingWheat),
/* harmony export */   faBullhorn: () => (/* binding */ faBullhorn),
/* harmony export */   faBullseye: () => (/* binding */ faBullseye),
/* harmony export */   faBurger: () => (/* binding */ faBurger),
/* harmony export */   faBurn: () => (/* binding */ faBurn),
/* harmony export */   faBurst: () => (/* binding */ faBurst),
/* harmony export */   faBus: () => (/* binding */ faBus),
/* harmony export */   faBusAlt: () => (/* binding */ faBusAlt),
/* harmony export */   faBusSimple: () => (/* binding */ faBusSimple),
/* harmony export */   faBusinessTime: () => (/* binding */ faBusinessTime),
/* harmony export */   faC: () => (/* binding */ faC),
/* harmony export */   faCab: () => (/* binding */ faCab),
/* harmony export */   faCableCar: () => (/* binding */ faCableCar),
/* harmony export */   faCake: () => (/* binding */ faCake),
/* harmony export */   faCakeCandles: () => (/* binding */ faCakeCandles),
/* harmony export */   faCalculator: () => (/* binding */ faCalculator),
/* harmony export */   faCalendar: () => (/* binding */ faCalendar),
/* harmony export */   faCalendarAlt: () => (/* binding */ faCalendarAlt),
/* harmony export */   faCalendarCheck: () => (/* binding */ faCalendarCheck),
/* harmony export */   faCalendarDay: () => (/* binding */ faCalendarDay),
/* harmony export */   faCalendarDays: () => (/* binding */ faCalendarDays),
/* harmony export */   faCalendarMinus: () => (/* binding */ faCalendarMinus),
/* harmony export */   faCalendarPlus: () => (/* binding */ faCalendarPlus),
/* harmony export */   faCalendarTimes: () => (/* binding */ faCalendarTimes),
/* harmony export */   faCalendarWeek: () => (/* binding */ faCalendarWeek),
/* harmony export */   faCalendarXmark: () => (/* binding */ faCalendarXmark),
/* harmony export */   faCamera: () => (/* binding */ faCamera),
/* harmony export */   faCameraAlt: () => (/* binding */ faCameraAlt),
/* harmony export */   faCameraRetro: () => (/* binding */ faCameraRetro),
/* harmony export */   faCameraRotate: () => (/* binding */ faCameraRotate),
/* harmony export */   faCampground: () => (/* binding */ faCampground),
/* harmony export */   faCancel: () => (/* binding */ faCancel),
/* harmony export */   faCandyCane: () => (/* binding */ faCandyCane),
/* harmony export */   faCannabis: () => (/* binding */ faCannabis),
/* harmony export */   faCapsules: () => (/* binding */ faCapsules),
/* harmony export */   faCar: () => (/* binding */ faCar),
/* harmony export */   faCarAlt: () => (/* binding */ faCarAlt),
/* harmony export */   faCarBattery: () => (/* binding */ faCarBattery),
/* harmony export */   faCarBurst: () => (/* binding */ faCarBurst),
/* harmony export */   faCarCrash: () => (/* binding */ faCarCrash),
/* harmony export */   faCarOn: () => (/* binding */ faCarOn),
/* harmony export */   faCarRear: () => (/* binding */ faCarRear),
/* harmony export */   faCarSide: () => (/* binding */ faCarSide),
/* harmony export */   faCarTunnel: () => (/* binding */ faCarTunnel),
/* harmony export */   faCaravan: () => (/* binding */ faCaravan),
/* harmony export */   faCaretDown: () => (/* binding */ faCaretDown),
/* harmony export */   faCaretLeft: () => (/* binding */ faCaretLeft),
/* harmony export */   faCaretRight: () => (/* binding */ faCaretRight),
/* harmony export */   faCaretSquareDown: () => (/* binding */ faCaretSquareDown),
/* harmony export */   faCaretSquareLeft: () => (/* binding */ faCaretSquareLeft),
/* harmony export */   faCaretSquareRight: () => (/* binding */ faCaretSquareRight),
/* harmony export */   faCaretSquareUp: () => (/* binding */ faCaretSquareUp),
/* harmony export */   faCaretUp: () => (/* binding */ faCaretUp),
/* harmony export */   faCarriageBaby: () => (/* binding */ faCarriageBaby),
/* harmony export */   faCarrot: () => (/* binding */ faCarrot),
/* harmony export */   faCartArrowDown: () => (/* binding */ faCartArrowDown),
/* harmony export */   faCartFlatbed: () => (/* binding */ faCartFlatbed),
/* harmony export */   faCartFlatbedSuitcase: () => (/* binding */ faCartFlatbedSuitcase),
/* harmony export */   faCartPlus: () => (/* binding */ faCartPlus),
/* harmony export */   faCartShopping: () => (/* binding */ faCartShopping),
/* harmony export */   faCashRegister: () => (/* binding */ faCashRegister),
/* harmony export */   faCat: () => (/* binding */ faCat),
/* harmony export */   faCediSign: () => (/* binding */ faCediSign),
/* harmony export */   faCentSign: () => (/* binding */ faCentSign),
/* harmony export */   faCertificate: () => (/* binding */ faCertificate),
/* harmony export */   faChain: () => (/* binding */ faChain),
/* harmony export */   faChainBroken: () => (/* binding */ faChainBroken),
/* harmony export */   faChainSlash: () => (/* binding */ faChainSlash),
/* harmony export */   faChair: () => (/* binding */ faChair),
/* harmony export */   faChalkboard: () => (/* binding */ faChalkboard),
/* harmony export */   faChalkboardTeacher: () => (/* binding */ faChalkboardTeacher),
/* harmony export */   faChalkboardUser: () => (/* binding */ faChalkboardUser),
/* harmony export */   faChampagneGlasses: () => (/* binding */ faChampagneGlasses),
/* harmony export */   faChargingStation: () => (/* binding */ faChargingStation),
/* harmony export */   faChartArea: () => (/* binding */ faChartArea),
/* harmony export */   faChartBar: () => (/* binding */ faChartBar),
/* harmony export */   faChartColumn: () => (/* binding */ faChartColumn),
/* harmony export */   faChartDiagram: () => (/* binding */ faChartDiagram),
/* harmony export */   faChartGantt: () => (/* binding */ faChartGantt),
/* harmony export */   faChartLine: () => (/* binding */ faChartLine),
/* harmony export */   faChartPie: () => (/* binding */ faChartPie),
/* harmony export */   faChartSimple: () => (/* binding */ faChartSimple),
/* harmony export */   faCheck: () => (/* binding */ faCheck),
/* harmony export */   faCheckCircle: () => (/* binding */ faCheckCircle),
/* harmony export */   faCheckDouble: () => (/* binding */ faCheckDouble),
/* harmony export */   faCheckSquare: () => (/* binding */ faCheckSquare),
/* harmony export */   faCheckToSlot: () => (/* binding */ faCheckToSlot),
/* harmony export */   faCheese: () => (/* binding */ faCheese),
/* harmony export */   faChess: () => (/* binding */ faChess),
/* harmony export */   faChessBishop: () => (/* binding */ faChessBishop),
/* harmony export */   faChessBoard: () => (/* binding */ faChessBoard),
/* harmony export */   faChessKing: () => (/* binding */ faChessKing),
/* harmony export */   faChessKnight: () => (/* binding */ faChessKnight),
/* harmony export */   faChessPawn: () => (/* binding */ faChessPawn),
/* harmony export */   faChessQueen: () => (/* binding */ faChessQueen),
/* harmony export */   faChessRook: () => (/* binding */ faChessRook),
/* harmony export */   faChevronCircleDown: () => (/* binding */ faChevronCircleDown),
/* harmony export */   faChevronCircleLeft: () => (/* binding */ faChevronCircleLeft),
/* harmony export */   faChevronCircleRight: () => (/* binding */ faChevronCircleRight),
/* harmony export */   faChevronCircleUp: () => (/* binding */ faChevronCircleUp),
/* harmony export */   faChevronDown: () => (/* binding */ faChevronDown),
/* harmony export */   faChevronLeft: () => (/* binding */ faChevronLeft),
/* harmony export */   faChevronRight: () => (/* binding */ faChevronRight),
/* harmony export */   faChevronUp: () => (/* binding */ faChevronUp),
/* harmony export */   faChild: () => (/* binding */ faChild),
/* harmony export */   faChildCombatant: () => (/* binding */ faChildCombatant),
/* harmony export */   faChildDress: () => (/* binding */ faChildDress),
/* harmony export */   faChildReaching: () => (/* binding */ faChildReaching),
/* harmony export */   faChildRifle: () => (/* binding */ faChildRifle),
/* harmony export */   faChildren: () => (/* binding */ faChildren),
/* harmony export */   faChurch: () => (/* binding */ faChurch),
/* harmony export */   faCircle: () => (/* binding */ faCircle),
/* harmony export */   faCircleArrowDown: () => (/* binding */ faCircleArrowDown),
/* harmony export */   faCircleArrowLeft: () => (/* binding */ faCircleArrowLeft),
/* harmony export */   faCircleArrowRight: () => (/* binding */ faCircleArrowRight),
/* harmony export */   faCircleArrowUp: () => (/* binding */ faCircleArrowUp),
/* harmony export */   faCircleCheck: () => (/* binding */ faCircleCheck),
/* harmony export */   faCircleChevronDown: () => (/* binding */ faCircleChevronDown),
/* harmony export */   faCircleChevronLeft: () => (/* binding */ faCircleChevronLeft),
/* harmony export */   faCircleChevronRight: () => (/* binding */ faCircleChevronRight),
/* harmony export */   faCircleChevronUp: () => (/* binding */ faCircleChevronUp),
/* harmony export */   faCircleDollarToSlot: () => (/* binding */ faCircleDollarToSlot),
/* harmony export */   faCircleDot: () => (/* binding */ faCircleDot),
/* harmony export */   faCircleDown: () => (/* binding */ faCircleDown),
/* harmony export */   faCircleExclamation: () => (/* binding */ faCircleExclamation),
/* harmony export */   faCircleH: () => (/* binding */ faCircleH),
/* harmony export */   faCircleHalfStroke: () => (/* binding */ faCircleHalfStroke),
/* harmony export */   faCircleInfo: () => (/* binding */ faCircleInfo),
/* harmony export */   faCircleLeft: () => (/* binding */ faCircleLeft),
/* harmony export */   faCircleMinus: () => (/* binding */ faCircleMinus),
/* harmony export */   faCircleNodes: () => (/* binding */ faCircleNodes),
/* harmony export */   faCircleNotch: () => (/* binding */ faCircleNotch),
/* harmony export */   faCirclePause: () => (/* binding */ faCirclePause),
/* harmony export */   faCirclePlay: () => (/* binding */ faCirclePlay),
/* harmony export */   faCirclePlus: () => (/* binding */ faCirclePlus),
/* harmony export */   faCircleQuestion: () => (/* binding */ faCircleQuestion),
/* harmony export */   faCircleRadiation: () => (/* binding */ faCircleRadiation),
/* harmony export */   faCircleRight: () => (/* binding */ faCircleRight),
/* harmony export */   faCircleStop: () => (/* binding */ faCircleStop),
/* harmony export */   faCircleUp: () => (/* binding */ faCircleUp),
/* harmony export */   faCircleUser: () => (/* binding */ faCircleUser),
/* harmony export */   faCircleXmark: () => (/* binding */ faCircleXmark),
/* harmony export */   faCity: () => (/* binding */ faCity),
/* harmony export */   faClapperboard: () => (/* binding */ faClapperboard),
/* harmony export */   faClinicMedical: () => (/* binding */ faClinicMedical),
/* harmony export */   faClipboard: () => (/* binding */ faClipboard),
/* harmony export */   faClipboardCheck: () => (/* binding */ faClipboardCheck),
/* harmony export */   faClipboardList: () => (/* binding */ faClipboardList),
/* harmony export */   faClipboardQuestion: () => (/* binding */ faClipboardQuestion),
/* harmony export */   faClipboardUser: () => (/* binding */ faClipboardUser),
/* harmony export */   faClock: () => (/* binding */ faClock),
/* harmony export */   faClockFour: () => (/* binding */ faClockFour),
/* harmony export */   faClockRotateLeft: () => (/* binding */ faClockRotateLeft),
/* harmony export */   faClone: () => (/* binding */ faClone),
/* harmony export */   faClose: () => (/* binding */ faClose),
/* harmony export */   faClosedCaptioning: () => (/* binding */ faClosedCaptioning),
/* harmony export */   faCloud: () => (/* binding */ faCloud),
/* harmony export */   faCloudArrowDown: () => (/* binding */ faCloudArrowDown),
/* harmony export */   faCloudArrowUp: () => (/* binding */ faCloudArrowUp),
/* harmony export */   faCloudBolt: () => (/* binding */ faCloudBolt),
/* harmony export */   faCloudDownload: () => (/* binding */ faCloudDownload),
/* harmony export */   faCloudDownloadAlt: () => (/* binding */ faCloudDownloadAlt),
/* harmony export */   faCloudMeatball: () => (/* binding */ faCloudMeatball),
/* harmony export */   faCloudMoon: () => (/* binding */ faCloudMoon),
/* harmony export */   faCloudMoonRain: () => (/* binding */ faCloudMoonRain),
/* harmony export */   faCloudRain: () => (/* binding */ faCloudRain),
/* harmony export */   faCloudShowersHeavy: () => (/* binding */ faCloudShowersHeavy),
/* harmony export */   faCloudShowersWater: () => (/* binding */ faCloudShowersWater),
/* harmony export */   faCloudSun: () => (/* binding */ faCloudSun),
/* harmony export */   faCloudSunRain: () => (/* binding */ faCloudSunRain),
/* harmony export */   faCloudUpload: () => (/* binding */ faCloudUpload),
/* harmony export */   faCloudUploadAlt: () => (/* binding */ faCloudUploadAlt),
/* harmony export */   faClover: () => (/* binding */ faClover),
/* harmony export */   faCny: () => (/* binding */ faCny),
/* harmony export */   faCocktail: () => (/* binding */ faCocktail),
/* harmony export */   faCode: () => (/* binding */ faCode),
/* harmony export */   faCodeBranch: () => (/* binding */ faCodeBranch),
/* harmony export */   faCodeCommit: () => (/* binding */ faCodeCommit),
/* harmony export */   faCodeCompare: () => (/* binding */ faCodeCompare),
/* harmony export */   faCodeFork: () => (/* binding */ faCodeFork),
/* harmony export */   faCodeMerge: () => (/* binding */ faCodeMerge),
/* harmony export */   faCodePullRequest: () => (/* binding */ faCodePullRequest),
/* harmony export */   faCoffee: () => (/* binding */ faCoffee),
/* harmony export */   faCog: () => (/* binding */ faCog),
/* harmony export */   faCogs: () => (/* binding */ faCogs),
/* harmony export */   faCoins: () => (/* binding */ faCoins),
/* harmony export */   faColonSign: () => (/* binding */ faColonSign),
/* harmony export */   faColumns: () => (/* binding */ faColumns),
/* harmony export */   faComment: () => (/* binding */ faComment),
/* harmony export */   faCommentAlt: () => (/* binding */ faCommentAlt),
/* harmony export */   faCommentDollar: () => (/* binding */ faCommentDollar),
/* harmony export */   faCommentDots: () => (/* binding */ faCommentDots),
/* harmony export */   faCommentMedical: () => (/* binding */ faCommentMedical),
/* harmony export */   faCommentNodes: () => (/* binding */ faCommentNodes),
/* harmony export */   faCommentSlash: () => (/* binding */ faCommentSlash),
/* harmony export */   faCommentSms: () => (/* binding */ faCommentSms),
/* harmony export */   faCommenting: () => (/* binding */ faCommenting),
/* harmony export */   faComments: () => (/* binding */ faComments),
/* harmony export */   faCommentsDollar: () => (/* binding */ faCommentsDollar),
/* harmony export */   faCompactDisc: () => (/* binding */ faCompactDisc),
/* harmony export */   faCompass: () => (/* binding */ faCompass),
/* harmony export */   faCompassDrafting: () => (/* binding */ faCompassDrafting),
/* harmony export */   faCompress: () => (/* binding */ faCompress),
/* harmony export */   faCompressAlt: () => (/* binding */ faCompressAlt),
/* harmony export */   faCompressArrowsAlt: () => (/* binding */ faCompressArrowsAlt),
/* harmony export */   faComputer: () => (/* binding */ faComputer),
/* harmony export */   faComputerMouse: () => (/* binding */ faComputerMouse),
/* harmony export */   faConciergeBell: () => (/* binding */ faConciergeBell),
/* harmony export */   faContactBook: () => (/* binding */ faContactBook),
/* harmony export */   faContactCard: () => (/* binding */ faContactCard),
/* harmony export */   faCookie: () => (/* binding */ faCookie),
/* harmony export */   faCookieBite: () => (/* binding */ faCookieBite),
/* harmony export */   faCopy: () => (/* binding */ faCopy),
/* harmony export */   faCopyright: () => (/* binding */ faCopyright),
/* harmony export */   faCouch: () => (/* binding */ faCouch),
/* harmony export */   faCow: () => (/* binding */ faCow),
/* harmony export */   faCreditCard: () => (/* binding */ faCreditCard),
/* harmony export */   faCreditCardAlt: () => (/* binding */ faCreditCardAlt),
/* harmony export */   faCrop: () => (/* binding */ faCrop),
/* harmony export */   faCropAlt: () => (/* binding */ faCropAlt),
/* harmony export */   faCropSimple: () => (/* binding */ faCropSimple),
/* harmony export */   faCross: () => (/* binding */ faCross),
/* harmony export */   faCrosshairs: () => (/* binding */ faCrosshairs),
/* harmony export */   faCrow: () => (/* binding */ faCrow),
/* harmony export */   faCrown: () => (/* binding */ faCrown),
/* harmony export */   faCrutch: () => (/* binding */ faCrutch),
/* harmony export */   faCruzeiroSign: () => (/* binding */ faCruzeiroSign),
/* harmony export */   faCube: () => (/* binding */ faCube),
/* harmony export */   faCubes: () => (/* binding */ faCubes),
/* harmony export */   faCubesStacked: () => (/* binding */ faCubesStacked),
/* harmony export */   faCut: () => (/* binding */ faCut),
/* harmony export */   faCutlery: () => (/* binding */ faCutlery),
/* harmony export */   faD: () => (/* binding */ faD),
/* harmony export */   faDashboard: () => (/* binding */ faDashboard),
/* harmony export */   faDatabase: () => (/* binding */ faDatabase),
/* harmony export */   faDeaf: () => (/* binding */ faDeaf),
/* harmony export */   faDeafness: () => (/* binding */ faDeafness),
/* harmony export */   faDedent: () => (/* binding */ faDedent),
/* harmony export */   faDeleteLeft: () => (/* binding */ faDeleteLeft),
/* harmony export */   faDemocrat: () => (/* binding */ faDemocrat),
/* harmony export */   faDesktop: () => (/* binding */ faDesktop),
/* harmony export */   faDesktopAlt: () => (/* binding */ faDesktopAlt),
/* harmony export */   faDharmachakra: () => (/* binding */ faDharmachakra),
/* harmony export */   faDiagnoses: () => (/* binding */ faDiagnoses),
/* harmony export */   faDiagramNext: () => (/* binding */ faDiagramNext),
/* harmony export */   faDiagramPredecessor: () => (/* binding */ faDiagramPredecessor),
/* harmony export */   faDiagramProject: () => (/* binding */ faDiagramProject),
/* harmony export */   faDiagramSuccessor: () => (/* binding */ faDiagramSuccessor),
/* harmony export */   faDiamond: () => (/* binding */ faDiamond),
/* harmony export */   faDiamondTurnRight: () => (/* binding */ faDiamondTurnRight),
/* harmony export */   faDice: () => (/* binding */ faDice),
/* harmony export */   faDiceD20: () => (/* binding */ faDiceD20),
/* harmony export */   faDiceD6: () => (/* binding */ faDiceD6),
/* harmony export */   faDiceFive: () => (/* binding */ faDiceFive),
/* harmony export */   faDiceFour: () => (/* binding */ faDiceFour),
/* harmony export */   faDiceOne: () => (/* binding */ faDiceOne),
/* harmony export */   faDiceSix: () => (/* binding */ faDiceSix),
/* harmony export */   faDiceThree: () => (/* binding */ faDiceThree),
/* harmony export */   faDiceTwo: () => (/* binding */ faDiceTwo),
/* harmony export */   faDigging: () => (/* binding */ faDigging),
/* harmony export */   faDigitalTachograph: () => (/* binding */ faDigitalTachograph),
/* harmony export */   faDirections: () => (/* binding */ faDirections),
/* harmony export */   faDisease: () => (/* binding */ faDisease),
/* harmony export */   faDisplay: () => (/* binding */ faDisplay),
/* harmony export */   faDivide: () => (/* binding */ faDivide),
/* harmony export */   faDizzy: () => (/* binding */ faDizzy),
/* harmony export */   faDna: () => (/* binding */ faDna),
/* harmony export */   faDog: () => (/* binding */ faDog),
/* harmony export */   faDollar: () => (/* binding */ faDollar),
/* harmony export */   faDollarSign: () => (/* binding */ faDollarSign),
/* harmony export */   faDolly: () => (/* binding */ faDolly),
/* harmony export */   faDollyBox: () => (/* binding */ faDollyBox),
/* harmony export */   faDollyFlatbed: () => (/* binding */ faDollyFlatbed),
/* harmony export */   faDonate: () => (/* binding */ faDonate),
/* harmony export */   faDongSign: () => (/* binding */ faDongSign),
/* harmony export */   faDoorClosed: () => (/* binding */ faDoorClosed),
/* harmony export */   faDoorOpen: () => (/* binding */ faDoorOpen),
/* harmony export */   faDotCircle: () => (/* binding */ faDotCircle),
/* harmony export */   faDove: () => (/* binding */ faDove),
/* harmony export */   faDownLeftAndUpRightToCenter: () => (/* binding */ faDownLeftAndUpRightToCenter),
/* harmony export */   faDownLong: () => (/* binding */ faDownLong),
/* harmony export */   faDownload: () => (/* binding */ faDownload),
/* harmony export */   faDraftingCompass: () => (/* binding */ faDraftingCompass),
/* harmony export */   faDragon: () => (/* binding */ faDragon),
/* harmony export */   faDrawPolygon: () => (/* binding */ faDrawPolygon),
/* harmony export */   faDriversLicense: () => (/* binding */ faDriversLicense),
/* harmony export */   faDroplet: () => (/* binding */ faDroplet),
/* harmony export */   faDropletSlash: () => (/* binding */ faDropletSlash),
/* harmony export */   faDrum: () => (/* binding */ faDrum),
/* harmony export */   faDrumSteelpan: () => (/* binding */ faDrumSteelpan),
/* harmony export */   faDrumstickBite: () => (/* binding */ faDrumstickBite),
/* harmony export */   faDumbbell: () => (/* binding */ faDumbbell),
/* harmony export */   faDumpster: () => (/* binding */ faDumpster),
/* harmony export */   faDumpsterFire: () => (/* binding */ faDumpsterFire),
/* harmony export */   faDungeon: () => (/* binding */ faDungeon),
/* harmony export */   faE: () => (/* binding */ faE),
/* harmony export */   faEarDeaf: () => (/* binding */ faEarDeaf),
/* harmony export */   faEarListen: () => (/* binding */ faEarListen),
/* harmony export */   faEarth: () => (/* binding */ faEarth),
/* harmony export */   faEarthAfrica: () => (/* binding */ faEarthAfrica),
/* harmony export */   faEarthAmerica: () => (/* binding */ faEarthAmerica),
/* harmony export */   faEarthAmericas: () => (/* binding */ faEarthAmericas),
/* harmony export */   faEarthAsia: () => (/* binding */ faEarthAsia),
/* harmony export */   faEarthEurope: () => (/* binding */ faEarthEurope),
/* harmony export */   faEarthOceania: () => (/* binding */ faEarthOceania),
/* harmony export */   faEdit: () => (/* binding */ faEdit),
/* harmony export */   faEgg: () => (/* binding */ faEgg),
/* harmony export */   faEject: () => (/* binding */ faEject),
/* harmony export */   faElevator: () => (/* binding */ faElevator),
/* harmony export */   faEllipsis: () => (/* binding */ faEllipsis),
/* harmony export */   faEllipsisH: () => (/* binding */ faEllipsisH),
/* harmony export */   faEllipsisV: () => (/* binding */ faEllipsisV),
/* harmony export */   faEllipsisVertical: () => (/* binding */ faEllipsisVertical),
/* harmony export */   faEnvelope: () => (/* binding */ faEnvelope),
/* harmony export */   faEnvelopeCircleCheck: () => (/* binding */ faEnvelopeCircleCheck),
/* harmony export */   faEnvelopeOpen: () => (/* binding */ faEnvelopeOpen),
/* harmony export */   faEnvelopeOpenText: () => (/* binding */ faEnvelopeOpenText),
/* harmony export */   faEnvelopeSquare: () => (/* binding */ faEnvelopeSquare),
/* harmony export */   faEnvelopesBulk: () => (/* binding */ faEnvelopesBulk),
/* harmony export */   faEquals: () => (/* binding */ faEquals),
/* harmony export */   faEraser: () => (/* binding */ faEraser),
/* harmony export */   faEthernet: () => (/* binding */ faEthernet),
/* harmony export */   faEur: () => (/* binding */ faEur),
/* harmony export */   faEuro: () => (/* binding */ faEuro),
/* harmony export */   faEuroSign: () => (/* binding */ faEuroSign),
/* harmony export */   faExchange: () => (/* binding */ faExchange),
/* harmony export */   faExchangeAlt: () => (/* binding */ faExchangeAlt),
/* harmony export */   faExclamation: () => (/* binding */ faExclamation),
/* harmony export */   faExclamationCircle: () => (/* binding */ faExclamationCircle),
/* harmony export */   faExclamationTriangle: () => (/* binding */ faExclamationTriangle),
/* harmony export */   faExpand: () => (/* binding */ faExpand),
/* harmony export */   faExpandAlt: () => (/* binding */ faExpandAlt),
/* harmony export */   faExpandArrowsAlt: () => (/* binding */ faExpandArrowsAlt),
/* harmony export */   faExplosion: () => (/* binding */ faExplosion),
/* harmony export */   faExternalLink: () => (/* binding */ faExternalLink),
/* harmony export */   faExternalLinkAlt: () => (/* binding */ faExternalLinkAlt),
/* harmony export */   faExternalLinkSquare: () => (/* binding */ faExternalLinkSquare),
/* harmony export */   faExternalLinkSquareAlt: () => (/* binding */ faExternalLinkSquareAlt),
/* harmony export */   faEye: () => (/* binding */ faEye),
/* harmony export */   faEyeDropper: () => (/* binding */ faEyeDropper),
/* harmony export */   faEyeDropperEmpty: () => (/* binding */ faEyeDropperEmpty),
/* harmony export */   faEyeLowVision: () => (/* binding */ faEyeLowVision),
/* harmony export */   faEyeSlash: () => (/* binding */ faEyeSlash),
/* harmony export */   faEyedropper: () => (/* binding */ faEyedropper),
/* harmony export */   faF: () => (/* binding */ faF),
/* harmony export */   faFaceAngry: () => (/* binding */ faFaceAngry),
/* harmony export */   faFaceDizzy: () => (/* binding */ faFaceDizzy),
/* harmony export */   faFaceFlushed: () => (/* binding */ faFaceFlushed),
/* harmony export */   faFaceFrown: () => (/* binding */ faFaceFrown),
/* harmony export */   faFaceFrownOpen: () => (/* binding */ faFaceFrownOpen),
/* harmony export */   faFaceGrimace: () => (/* binding */ faFaceGrimace),
/* harmony export */   faFaceGrin: () => (/* binding */ faFaceGrin),
/* harmony export */   faFaceGrinBeam: () => (/* binding */ faFaceGrinBeam),
/* harmony export */   faFaceGrinBeamSweat: () => (/* binding */ faFaceGrinBeamSweat),
/* harmony export */   faFaceGrinHearts: () => (/* binding */ faFaceGrinHearts),
/* harmony export */   faFaceGrinSquint: () => (/* binding */ faFaceGrinSquint),
/* harmony export */   faFaceGrinSquintTears: () => (/* binding */ faFaceGrinSquintTears),
/* harmony export */   faFaceGrinStars: () => (/* binding */ faFaceGrinStars),
/* harmony export */   faFaceGrinTears: () => (/* binding */ faFaceGrinTears),
/* harmony export */   faFaceGrinTongue: () => (/* binding */ faFaceGrinTongue),
/* harmony export */   faFaceGrinTongueSquint: () => (/* binding */ faFaceGrinTongueSquint),
/* harmony export */   faFaceGrinTongueWink: () => (/* binding */ faFaceGrinTongueWink),
/* harmony export */   faFaceGrinWide: () => (/* binding */ faFaceGrinWide),
/* harmony export */   faFaceGrinWink: () => (/* binding */ faFaceGrinWink),
/* harmony export */   faFaceKiss: () => (/* binding */ faFaceKiss),
/* harmony export */   faFaceKissBeam: () => (/* binding */ faFaceKissBeam),
/* harmony export */   faFaceKissWinkHeart: () => (/* binding */ faFaceKissWinkHeart),
/* harmony export */   faFaceLaugh: () => (/* binding */ faFaceLaugh),
/* harmony export */   faFaceLaughBeam: () => (/* binding */ faFaceLaughBeam),
/* harmony export */   faFaceLaughSquint: () => (/* binding */ faFaceLaughSquint),
/* harmony export */   faFaceLaughWink: () => (/* binding */ faFaceLaughWink),
/* harmony export */   faFaceMeh: () => (/* binding */ faFaceMeh),
/* harmony export */   faFaceMehBlank: () => (/* binding */ faFaceMehBlank),
/* harmony export */   faFaceRollingEyes: () => (/* binding */ faFaceRollingEyes),
/* harmony export */   faFaceSadCry: () => (/* binding */ faFaceSadCry),
/* harmony export */   faFaceSadTear: () => (/* binding */ faFaceSadTear),
/* harmony export */   faFaceSmile: () => (/* binding */ faFaceSmile),
/* harmony export */   faFaceSmileBeam: () => (/* binding */ faFaceSmileBeam),
/* harmony export */   faFaceSmileWink: () => (/* binding */ faFaceSmileWink),
/* harmony export */   faFaceSurprise: () => (/* binding */ faFaceSurprise),
/* harmony export */   faFaceTired: () => (/* binding */ faFaceTired),
/* harmony export */   faFan: () => (/* binding */ faFan),
/* harmony export */   faFastBackward: () => (/* binding */ faFastBackward),
/* harmony export */   faFastForward: () => (/* binding */ faFastForward),
/* harmony export */   faFaucet: () => (/* binding */ faFaucet),
/* harmony export */   faFaucetDrip: () => (/* binding */ faFaucetDrip),
/* harmony export */   faFax: () => (/* binding */ faFax),
/* harmony export */   faFeather: () => (/* binding */ faFeather),
/* harmony export */   faFeatherAlt: () => (/* binding */ faFeatherAlt),
/* harmony export */   faFeatherPointed: () => (/* binding */ faFeatherPointed),
/* harmony export */   faFeed: () => (/* binding */ faFeed),
/* harmony export */   faFemale: () => (/* binding */ faFemale),
/* harmony export */   faFerry: () => (/* binding */ faFerry),
/* harmony export */   faFighterJet: () => (/* binding */ faFighterJet),
/* harmony export */   faFile: () => (/* binding */ faFile),
/* harmony export */   faFileAlt: () => (/* binding */ faFileAlt),
/* harmony export */   faFileArchive: () => (/* binding */ faFileArchive),
/* harmony export */   faFileArrowDown: () => (/* binding */ faFileArrowDown),
/* harmony export */   faFileArrowUp: () => (/* binding */ faFileArrowUp),
/* harmony export */   faFileAudio: () => (/* binding */ faFileAudio),
/* harmony export */   faFileCircleCheck: () => (/* binding */ faFileCircleCheck),
/* harmony export */   faFileCircleExclamation: () => (/* binding */ faFileCircleExclamation),
/* harmony export */   faFileCircleMinus: () => (/* binding */ faFileCircleMinus),
/* harmony export */   faFileCirclePlus: () => (/* binding */ faFileCirclePlus),
/* harmony export */   faFileCircleQuestion: () => (/* binding */ faFileCircleQuestion),
/* harmony export */   faFileCircleXmark: () => (/* binding */ faFileCircleXmark),
/* harmony export */   faFileClipboard: () => (/* binding */ faFileClipboard),
/* harmony export */   faFileCode: () => (/* binding */ faFileCode),
/* harmony export */   faFileContract: () => (/* binding */ faFileContract),
/* harmony export */   faFileCsv: () => (/* binding */ faFileCsv),
/* harmony export */   faFileDownload: () => (/* binding */ faFileDownload),
/* harmony export */   faFileEdit: () => (/* binding */ faFileEdit),
/* harmony export */   faFileExcel: () => (/* binding */ faFileExcel),
/* harmony export */   faFileExport: () => (/* binding */ faFileExport),
/* harmony export */   faFileFragment: () => (/* binding */ faFileFragment),
/* harmony export */   faFileHalfDashed: () => (/* binding */ faFileHalfDashed),
/* harmony export */   faFileImage: () => (/* binding */ faFileImage),
/* harmony export */   faFileImport: () => (/* binding */ faFileImport),
/* harmony export */   faFileInvoice: () => (/* binding */ faFileInvoice),
/* harmony export */   faFileInvoiceDollar: () => (/* binding */ faFileInvoiceDollar),
/* harmony export */   faFileLines: () => (/* binding */ faFileLines),
/* harmony export */   faFileMedical: () => (/* binding */ faFileMedical),
/* harmony export */   faFileMedicalAlt: () => (/* binding */ faFileMedicalAlt),
/* harmony export */   faFilePdf: () => (/* binding */ faFilePdf),
/* harmony export */   faFilePen: () => (/* binding */ faFilePen),
/* harmony export */   faFilePowerpoint: () => (/* binding */ faFilePowerpoint),
/* harmony export */   faFilePrescription: () => (/* binding */ faFilePrescription),
/* harmony export */   faFileShield: () => (/* binding */ faFileShield),
/* harmony export */   faFileSignature: () => (/* binding */ faFileSignature),
/* harmony export */   faFileText: () => (/* binding */ faFileText),
/* harmony export */   faFileUpload: () => (/* binding */ faFileUpload),
/* harmony export */   faFileVideo: () => (/* binding */ faFileVideo),
/* harmony export */   faFileWaveform: () => (/* binding */ faFileWaveform),
/* harmony export */   faFileWord: () => (/* binding */ faFileWord),
/* harmony export */   faFileZipper: () => (/* binding */ faFileZipper),
/* harmony export */   faFill: () => (/* binding */ faFill),
/* harmony export */   faFillDrip: () => (/* binding */ faFillDrip),
/* harmony export */   faFilm: () => (/* binding */ faFilm),
/* harmony export */   faFilter: () => (/* binding */ faFilter),
/* harmony export */   faFilterCircleDollar: () => (/* binding */ faFilterCircleDollar),
/* harmony export */   faFilterCircleXmark: () => (/* binding */ faFilterCircleXmark),
/* harmony export */   faFingerprint: () => (/* binding */ faFingerprint),
/* harmony export */   faFire: () => (/* binding */ faFire),
/* harmony export */   faFireAlt: () => (/* binding */ faFireAlt),
/* harmony export */   faFireBurner: () => (/* binding */ faFireBurner),
/* harmony export */   faFireExtinguisher: () => (/* binding */ faFireExtinguisher),
/* harmony export */   faFireFlameCurved: () => (/* binding */ faFireFlameCurved),
/* harmony export */   faFireFlameSimple: () => (/* binding */ faFireFlameSimple),
/* harmony export */   faFirstAid: () => (/* binding */ faFirstAid),
/* harmony export */   faFish: () => (/* binding */ faFish),
/* harmony export */   faFishFins: () => (/* binding */ faFishFins),
/* harmony export */   faFistRaised: () => (/* binding */ faFistRaised),
/* harmony export */   faFlag: () => (/* binding */ faFlag),
/* harmony export */   faFlagCheckered: () => (/* binding */ faFlagCheckered),
/* harmony export */   faFlagUsa: () => (/* binding */ faFlagUsa),
/* harmony export */   faFlask: () => (/* binding */ faFlask),
/* harmony export */   faFlaskVial: () => (/* binding */ faFlaskVial),
/* harmony export */   faFloppyDisk: () => (/* binding */ faFloppyDisk),
/* harmony export */   faFlorinSign: () => (/* binding */ faFlorinSign),
/* harmony export */   faFlushed: () => (/* binding */ faFlushed),
/* harmony export */   faFolder: () => (/* binding */ faFolder),
/* harmony export */   faFolderBlank: () => (/* binding */ faFolderBlank),
/* harmony export */   faFolderClosed: () => (/* binding */ faFolderClosed),
/* harmony export */   faFolderMinus: () => (/* binding */ faFolderMinus),
/* harmony export */   faFolderOpen: () => (/* binding */ faFolderOpen),
/* harmony export */   faFolderPlus: () => (/* binding */ faFolderPlus),
/* harmony export */   faFolderTree: () => (/* binding */ faFolderTree),
/* harmony export */   faFont: () => (/* binding */ faFont),
/* harmony export */   faFontAwesome: () => (/* binding */ faFontAwesome),
/* harmony export */   faFontAwesomeFlag: () => (/* binding */ faFontAwesomeFlag),
/* harmony export */   faFontAwesomeLogoFull: () => (/* binding */ faFontAwesomeLogoFull),
/* harmony export */   faFootball: () => (/* binding */ faFootball),
/* harmony export */   faFootballBall: () => (/* binding */ faFootballBall),
/* harmony export */   faForward: () => (/* binding */ faForward),
/* harmony export */   faForwardFast: () => (/* binding */ faForwardFast),
/* harmony export */   faForwardStep: () => (/* binding */ faForwardStep),
/* harmony export */   faFrancSign: () => (/* binding */ faFrancSign),
/* harmony export */   faFrog: () => (/* binding */ faFrog),
/* harmony export */   faFrown: () => (/* binding */ faFrown),
/* harmony export */   faFrownOpen: () => (/* binding */ faFrownOpen),
/* harmony export */   faFunnelDollar: () => (/* binding */ faFunnelDollar),
/* harmony export */   faFutbol: () => (/* binding */ faFutbol),
/* harmony export */   faFutbolBall: () => (/* binding */ faFutbolBall),
/* harmony export */   faG: () => (/* binding */ faG),
/* harmony export */   faGamepad: () => (/* binding */ faGamepad),
/* harmony export */   faGasPump: () => (/* binding */ faGasPump),
/* harmony export */   faGauge: () => (/* binding */ faGauge),
/* harmony export */   faGaugeHigh: () => (/* binding */ faGaugeHigh),
/* harmony export */   faGaugeMed: () => (/* binding */ faGaugeMed),
/* harmony export */   faGaugeSimple: () => (/* binding */ faGaugeSimple),
/* harmony export */   faGaugeSimpleHigh: () => (/* binding */ faGaugeSimpleHigh),
/* harmony export */   faGaugeSimpleMed: () => (/* binding */ faGaugeSimpleMed),
/* harmony export */   faGavel: () => (/* binding */ faGavel),
/* harmony export */   faGbp: () => (/* binding */ faGbp),
/* harmony export */   faGear: () => (/* binding */ faGear),
/* harmony export */   faGears: () => (/* binding */ faGears),
/* harmony export */   faGem: () => (/* binding */ faGem),
/* harmony export */   faGenderless: () => (/* binding */ faGenderless),
/* harmony export */   faGhost: () => (/* binding */ faGhost),
/* harmony export */   faGift: () => (/* binding */ faGift),
/* harmony export */   faGifts: () => (/* binding */ faGifts),
/* harmony export */   faGlassCheers: () => (/* binding */ faGlassCheers),
/* harmony export */   faGlassMartini: () => (/* binding */ faGlassMartini),
/* harmony export */   faGlassMartiniAlt: () => (/* binding */ faGlassMartiniAlt),
/* harmony export */   faGlassWater: () => (/* binding */ faGlassWater),
/* harmony export */   faGlassWaterDroplet: () => (/* binding */ faGlassWaterDroplet),
/* harmony export */   faGlassWhiskey: () => (/* binding */ faGlassWhiskey),
/* harmony export */   faGlasses: () => (/* binding */ faGlasses),
/* harmony export */   faGlobe: () => (/* binding */ faGlobe),
/* harmony export */   faGlobeAfrica: () => (/* binding */ faGlobeAfrica),
/* harmony export */   faGlobeAmericas: () => (/* binding */ faGlobeAmericas),
/* harmony export */   faGlobeAsia: () => (/* binding */ faGlobeAsia),
/* harmony export */   faGlobeEurope: () => (/* binding */ faGlobeEurope),
/* harmony export */   faGlobeOceania: () => (/* binding */ faGlobeOceania),
/* harmony export */   faGolfBall: () => (/* binding */ faGolfBall),
/* harmony export */   faGolfBallTee: () => (/* binding */ faGolfBallTee),
/* harmony export */   faGopuram: () => (/* binding */ faGopuram),
/* harmony export */   faGraduationCap: () => (/* binding */ faGraduationCap),
/* harmony export */   faGreaterThan: () => (/* binding */ faGreaterThan),
/* harmony export */   faGreaterThanEqual: () => (/* binding */ faGreaterThanEqual),
/* harmony export */   faGrimace: () => (/* binding */ faGrimace),
/* harmony export */   faGrin: () => (/* binding */ faGrin),
/* harmony export */   faGrinAlt: () => (/* binding */ faGrinAlt),
/* harmony export */   faGrinBeam: () => (/* binding */ faGrinBeam),
/* harmony export */   faGrinBeamSweat: () => (/* binding */ faGrinBeamSweat),
/* harmony export */   faGrinHearts: () => (/* binding */ faGrinHearts),
/* harmony export */   faGrinSquint: () => (/* binding */ faGrinSquint),
/* harmony export */   faGrinSquintTears: () => (/* binding */ faGrinSquintTears),
/* harmony export */   faGrinStars: () => (/* binding */ faGrinStars),
/* harmony export */   faGrinTears: () => (/* binding */ faGrinTears),
/* harmony export */   faGrinTongue: () => (/* binding */ faGrinTongue),
/* harmony export */   faGrinTongueSquint: () => (/* binding */ faGrinTongueSquint),
/* harmony export */   faGrinTongueWink: () => (/* binding */ faGrinTongueWink),
/* harmony export */   faGrinWink: () => (/* binding */ faGrinWink),
/* harmony export */   faGrip: () => (/* binding */ faGrip),
/* harmony export */   faGripHorizontal: () => (/* binding */ faGripHorizontal),
/* harmony export */   faGripLines: () => (/* binding */ faGripLines),
/* harmony export */   faGripLinesVertical: () => (/* binding */ faGripLinesVertical),
/* harmony export */   faGripVertical: () => (/* binding */ faGripVertical),
/* harmony export */   faGroupArrowsRotate: () => (/* binding */ faGroupArrowsRotate),
/* harmony export */   faGuaraniSign: () => (/* binding */ faGuaraniSign),
/* harmony export */   faGuitar: () => (/* binding */ faGuitar),
/* harmony export */   faGun: () => (/* binding */ faGun),
/* harmony export */   faH: () => (/* binding */ faH),
/* harmony export */   faHSquare: () => (/* binding */ faHSquare),
/* harmony export */   faHamburger: () => (/* binding */ faHamburger),
/* harmony export */   faHammer: () => (/* binding */ faHammer),
/* harmony export */   faHamsa: () => (/* binding */ faHamsa),
/* harmony export */   faHand: () => (/* binding */ faHand),
/* harmony export */   faHandBackFist: () => (/* binding */ faHandBackFist),
/* harmony export */   faHandDots: () => (/* binding */ faHandDots),
/* harmony export */   faHandFist: () => (/* binding */ faHandFist),
/* harmony export */   faHandHolding: () => (/* binding */ faHandHolding),
/* harmony export */   faHandHoldingDollar: () => (/* binding */ faHandHoldingDollar),
/* harmony export */   faHandHoldingDroplet: () => (/* binding */ faHandHoldingDroplet),
/* harmony export */   faHandHoldingHand: () => (/* binding */ faHandHoldingHand),
/* harmony export */   faHandHoldingHeart: () => (/* binding */ faHandHoldingHeart),
/* harmony export */   faHandHoldingMedical: () => (/* binding */ faHandHoldingMedical),
/* harmony export */   faHandHoldingUsd: () => (/* binding */ faHandHoldingUsd),
/* harmony export */   faHandHoldingWater: () => (/* binding */ faHandHoldingWater),
/* harmony export */   faHandLizard: () => (/* binding */ faHandLizard),
/* harmony export */   faHandMiddleFinger: () => (/* binding */ faHandMiddleFinger),
/* harmony export */   faHandPaper: () => (/* binding */ faHandPaper),
/* harmony export */   faHandPeace: () => (/* binding */ faHandPeace),
/* harmony export */   faHandPointDown: () => (/* binding */ faHandPointDown),
/* harmony export */   faHandPointLeft: () => (/* binding */ faHandPointLeft),
/* harmony export */   faHandPointRight: () => (/* binding */ faHandPointRight),
/* harmony export */   faHandPointUp: () => (/* binding */ faHandPointUp),
/* harmony export */   faHandPointer: () => (/* binding */ faHandPointer),
/* harmony export */   faHandRock: () => (/* binding */ faHandRock),
/* harmony export */   faHandScissors: () => (/* binding */ faHandScissors),
/* harmony export */   faHandSparkles: () => (/* binding */ faHandSparkles),
/* harmony export */   faHandSpock: () => (/* binding */ faHandSpock),
/* harmony export */   faHandcuffs: () => (/* binding */ faHandcuffs),
/* harmony export */   faHands: () => (/* binding */ faHands),
/* harmony export */   faHandsAmericanSignLanguageInterpreting: () => (/* binding */ faHandsAmericanSignLanguageInterpreting),
/* harmony export */   faHandsAslInterpreting: () => (/* binding */ faHandsAslInterpreting),
/* harmony export */   faHandsBound: () => (/* binding */ faHandsBound),
/* harmony export */   faHandsBubbles: () => (/* binding */ faHandsBubbles),
/* harmony export */   faHandsClapping: () => (/* binding */ faHandsClapping),
/* harmony export */   faHandsHelping: () => (/* binding */ faHandsHelping),
/* harmony export */   faHandsHolding: () => (/* binding */ faHandsHolding),
/* harmony export */   faHandsHoldingChild: () => (/* binding */ faHandsHoldingChild),
/* harmony export */   faHandsHoldingCircle: () => (/* binding */ faHandsHoldingCircle),
/* harmony export */   faHandsPraying: () => (/* binding */ faHandsPraying),
/* harmony export */   faHandsWash: () => (/* binding */ faHandsWash),
/* harmony export */   faHandshake: () => (/* binding */ faHandshake),
/* harmony export */   faHandshakeAlt: () => (/* binding */ faHandshakeAlt),
/* harmony export */   faHandshakeAltSlash: () => (/* binding */ faHandshakeAltSlash),
/* harmony export */   faHandshakeAngle: () => (/* binding */ faHandshakeAngle),
/* harmony export */   faHandshakeSimple: () => (/* binding */ faHandshakeSimple),
/* harmony export */   faHandshakeSimpleSlash: () => (/* binding */ faHandshakeSimpleSlash),
/* harmony export */   faHandshakeSlash: () => (/* binding */ faHandshakeSlash),
/* harmony export */   faHanukiah: () => (/* binding */ faHanukiah),
/* harmony export */   faHardDrive: () => (/* binding */ faHardDrive),
/* harmony export */   faHardHat: () => (/* binding */ faHardHat),
/* harmony export */   faHardOfHearing: () => (/* binding */ faHardOfHearing),
/* harmony export */   faHashtag: () => (/* binding */ faHashtag),
/* harmony export */   faHatCowboy: () => (/* binding */ faHatCowboy),
/* harmony export */   faHatCowboySide: () => (/* binding */ faHatCowboySide),
/* harmony export */   faHatHard: () => (/* binding */ faHatHard),
/* harmony export */   faHatWizard: () => (/* binding */ faHatWizard),
/* harmony export */   faHaykal: () => (/* binding */ faHaykal),
/* harmony export */   faHdd: () => (/* binding */ faHdd),
/* harmony export */   faHeadSideCough: () => (/* binding */ faHeadSideCough),
/* harmony export */   faHeadSideCoughSlash: () => (/* binding */ faHeadSideCoughSlash),
/* harmony export */   faHeadSideMask: () => (/* binding */ faHeadSideMask),
/* harmony export */   faHeadSideVirus: () => (/* binding */ faHeadSideVirus),
/* harmony export */   faHeader: () => (/* binding */ faHeader),
/* harmony export */   faHeading: () => (/* binding */ faHeading),
/* harmony export */   faHeadphones: () => (/* binding */ faHeadphones),
/* harmony export */   faHeadphonesAlt: () => (/* binding */ faHeadphonesAlt),
/* harmony export */   faHeadphonesSimple: () => (/* binding */ faHeadphonesSimple),
/* harmony export */   faHeadset: () => (/* binding */ faHeadset),
/* harmony export */   faHeart: () => (/* binding */ faHeart),
/* harmony export */   faHeartBroken: () => (/* binding */ faHeartBroken),
/* harmony export */   faHeartCircleBolt: () => (/* binding */ faHeartCircleBolt),
/* harmony export */   faHeartCircleCheck: () => (/* binding */ faHeartCircleCheck),
/* harmony export */   faHeartCircleExclamation: () => (/* binding */ faHeartCircleExclamation),
/* harmony export */   faHeartCircleMinus: () => (/* binding */ faHeartCircleMinus),
/* harmony export */   faHeartCirclePlus: () => (/* binding */ faHeartCirclePlus),
/* harmony export */   faHeartCircleXmark: () => (/* binding */ faHeartCircleXmark),
/* harmony export */   faHeartCrack: () => (/* binding */ faHeartCrack),
/* harmony export */   faHeartMusicCameraBolt: () => (/* binding */ faHeartMusicCameraBolt),
/* harmony export */   faHeartPulse: () => (/* binding */ faHeartPulse),
/* harmony export */   faHeartbeat: () => (/* binding */ faHeartbeat),
/* harmony export */   faHelicopter: () => (/* binding */ faHelicopter),
/* harmony export */   faHelicopterSymbol: () => (/* binding */ faHelicopterSymbol),
/* harmony export */   faHelmetSafety: () => (/* binding */ faHelmetSafety),
/* harmony export */   faHelmetUn: () => (/* binding */ faHelmetUn),
/* harmony export */   faHexagonNodes: () => (/* binding */ faHexagonNodes),
/* harmony export */   faHexagonNodesBolt: () => (/* binding */ faHexagonNodesBolt),
/* harmony export */   faHighlighter: () => (/* binding */ faHighlighter),
/* harmony export */   faHiking: () => (/* binding */ faHiking),
/* harmony export */   faHillAvalanche: () => (/* binding */ faHillAvalanche),
/* harmony export */   faHillRockslide: () => (/* binding */ faHillRockslide),
/* harmony export */   faHippo: () => (/* binding */ faHippo),
/* harmony export */   faHistory: () => (/* binding */ faHistory),
/* harmony export */   faHockeyPuck: () => (/* binding */ faHockeyPuck),
/* harmony export */   faHollyBerry: () => (/* binding */ faHollyBerry),
/* harmony export */   faHome: () => (/* binding */ faHome),
/* harmony export */   faHomeAlt: () => (/* binding */ faHomeAlt),
/* harmony export */   faHomeLg: () => (/* binding */ faHomeLg),
/* harmony export */   faHomeLgAlt: () => (/* binding */ faHomeLgAlt),
/* harmony export */   faHomeUser: () => (/* binding */ faHomeUser),
/* harmony export */   faHorse: () => (/* binding */ faHorse),
/* harmony export */   faHorseHead: () => (/* binding */ faHorseHead),
/* harmony export */   faHospital: () => (/* binding */ faHospital),
/* harmony export */   faHospitalAlt: () => (/* binding */ faHospitalAlt),
/* harmony export */   faHospitalSymbol: () => (/* binding */ faHospitalSymbol),
/* harmony export */   faHospitalUser: () => (/* binding */ faHospitalUser),
/* harmony export */   faHospitalWide: () => (/* binding */ faHospitalWide),
/* harmony export */   faHotTub: () => (/* binding */ faHotTub),
/* harmony export */   faHotTubPerson: () => (/* binding */ faHotTubPerson),
/* harmony export */   faHotdog: () => (/* binding */ faHotdog),
/* harmony export */   faHotel: () => (/* binding */ faHotel),
/* harmony export */   faHourglass: () => (/* binding */ faHourglass),
/* harmony export */   faHourglass1: () => (/* binding */ faHourglass1),
/* harmony export */   faHourglass2: () => (/* binding */ faHourglass2),
/* harmony export */   faHourglass3: () => (/* binding */ faHourglass3),
/* harmony export */   faHourglassEmpty: () => (/* binding */ faHourglassEmpty),
/* harmony export */   faHourglassEnd: () => (/* binding */ faHourglassEnd),
/* harmony export */   faHourglassHalf: () => (/* binding */ faHourglassHalf),
/* harmony export */   faHourglassStart: () => (/* binding */ faHourglassStart),
/* harmony export */   faHouse: () => (/* binding */ faHouse),
/* harmony export */   faHouseChimney: () => (/* binding */ faHouseChimney),
/* harmony export */   faHouseChimneyCrack: () => (/* binding */ faHouseChimneyCrack),
/* harmony export */   faHouseChimneyMedical: () => (/* binding */ faHouseChimneyMedical),
/* harmony export */   faHouseChimneyUser: () => (/* binding */ faHouseChimneyUser),
/* harmony export */   faHouseChimneyWindow: () => (/* binding */ faHouseChimneyWindow),
/* harmony export */   faHouseCircleCheck: () => (/* binding */ faHouseCircleCheck),
/* harmony export */   faHouseCircleExclamation: () => (/* binding */ faHouseCircleExclamation),
/* harmony export */   faHouseCircleXmark: () => (/* binding */ faHouseCircleXmark),
/* harmony export */   faHouseCrack: () => (/* binding */ faHouseCrack),
/* harmony export */   faHouseDamage: () => (/* binding */ faHouseDamage),
/* harmony export */   faHouseFire: () => (/* binding */ faHouseFire),
/* harmony export */   faHouseFlag: () => (/* binding */ faHouseFlag),
/* harmony export */   faHouseFloodWater: () => (/* binding */ faHouseFloodWater),
/* harmony export */   faHouseFloodWaterCircleArrowRight: () => (/* binding */ faHouseFloodWaterCircleArrowRight),
/* harmony export */   faHouseLaptop: () => (/* binding */ faHouseLaptop),
/* harmony export */   faHouseLock: () => (/* binding */ faHouseLock),
/* harmony export */   faHouseMedical: () => (/* binding */ faHouseMedical),
/* harmony export */   faHouseMedicalCircleCheck: () => (/* binding */ faHouseMedicalCircleCheck),
/* harmony export */   faHouseMedicalCircleExclamation: () => (/* binding */ faHouseMedicalCircleExclamation),
/* harmony export */   faHouseMedicalCircleXmark: () => (/* binding */ faHouseMedicalCircleXmark),
/* harmony export */   faHouseMedicalFlag: () => (/* binding */ faHouseMedicalFlag),
/* harmony export */   faHouseSignal: () => (/* binding */ faHouseSignal),
/* harmony export */   faHouseTsunami: () => (/* binding */ faHouseTsunami),
/* harmony export */   faHouseUser: () => (/* binding */ faHouseUser),
/* harmony export */   faHryvnia: () => (/* binding */ faHryvnia),
/* harmony export */   faHryvniaSign: () => (/* binding */ faHryvniaSign),
/* harmony export */   faHurricane: () => (/* binding */ faHurricane),
/* harmony export */   faI: () => (/* binding */ faI),
/* harmony export */   faICursor: () => (/* binding */ faICursor),
/* harmony export */   faIceCream: () => (/* binding */ faIceCream),
/* harmony export */   faIcicles: () => (/* binding */ faIcicles),
/* harmony export */   faIcons: () => (/* binding */ faIcons),
/* harmony export */   faIdBadge: () => (/* binding */ faIdBadge),
/* harmony export */   faIdCard: () => (/* binding */ faIdCard),
/* harmony export */   faIdCardAlt: () => (/* binding */ faIdCardAlt),
/* harmony export */   faIdCardClip: () => (/* binding */ faIdCardClip),
/* harmony export */   faIgloo: () => (/* binding */ faIgloo),
/* harmony export */   faIls: () => (/* binding */ faIls),
/* harmony export */   faImage: () => (/* binding */ faImage),
/* harmony export */   faImagePortrait: () => (/* binding */ faImagePortrait),
/* harmony export */   faImages: () => (/* binding */ faImages),
/* harmony export */   faInbox: () => (/* binding */ faInbox),
/* harmony export */   faIndent: () => (/* binding */ faIndent),
/* harmony export */   faIndianRupee: () => (/* binding */ faIndianRupee),
/* harmony export */   faIndianRupeeSign: () => (/* binding */ faIndianRupeeSign),
/* harmony export */   faIndustry: () => (/* binding */ faIndustry),
/* harmony export */   faInfinity: () => (/* binding */ faInfinity),
/* harmony export */   faInfo: () => (/* binding */ faInfo),
/* harmony export */   faInfoCircle: () => (/* binding */ faInfoCircle),
/* harmony export */   faInr: () => (/* binding */ faInr),
/* harmony export */   faInstitution: () => (/* binding */ faInstitution),
/* harmony export */   faItalic: () => (/* binding */ faItalic),
/* harmony export */   faJ: () => (/* binding */ faJ),
/* harmony export */   faJar: () => (/* binding */ faJar),
/* harmony export */   faJarWheat: () => (/* binding */ faJarWheat),
/* harmony export */   faJedi: () => (/* binding */ faJedi),
/* harmony export */   faJetFighter: () => (/* binding */ faJetFighter),
/* harmony export */   faJetFighterUp: () => (/* binding */ faJetFighterUp),
/* harmony export */   faJoint: () => (/* binding */ faJoint),
/* harmony export */   faJournalWhills: () => (/* binding */ faJournalWhills),
/* harmony export */   faJpy: () => (/* binding */ faJpy),
/* harmony export */   faJugDetergent: () => (/* binding */ faJugDetergent),
/* harmony export */   faK: () => (/* binding */ faK),
/* harmony export */   faKaaba: () => (/* binding */ faKaaba),
/* harmony export */   faKey: () => (/* binding */ faKey),
/* harmony export */   faKeyboard: () => (/* binding */ faKeyboard),
/* harmony export */   faKhanda: () => (/* binding */ faKhanda),
/* harmony export */   faKipSign: () => (/* binding */ faKipSign),
/* harmony export */   faKiss: () => (/* binding */ faKiss),
/* harmony export */   faKissBeam: () => (/* binding */ faKissBeam),
/* harmony export */   faKissWinkHeart: () => (/* binding */ faKissWinkHeart),
/* harmony export */   faKitMedical: () => (/* binding */ faKitMedical),
/* harmony export */   faKitchenSet: () => (/* binding */ faKitchenSet),
/* harmony export */   faKiwiBird: () => (/* binding */ faKiwiBird),
/* harmony export */   faKrw: () => (/* binding */ faKrw),
/* harmony export */   faL: () => (/* binding */ faL),
/* harmony export */   faLadderWater: () => (/* binding */ faLadderWater),
/* harmony export */   faLandMineOn: () => (/* binding */ faLandMineOn),
/* harmony export */   faLandmark: () => (/* binding */ faLandmark),
/* harmony export */   faLandmarkAlt: () => (/* binding */ faLandmarkAlt),
/* harmony export */   faLandmarkDome: () => (/* binding */ faLandmarkDome),
/* harmony export */   faLandmarkFlag: () => (/* binding */ faLandmarkFlag),
/* harmony export */   faLanguage: () => (/* binding */ faLanguage),
/* harmony export */   faLaptop: () => (/* binding */ faLaptop),
/* harmony export */   faLaptopCode: () => (/* binding */ faLaptopCode),
/* harmony export */   faLaptopFile: () => (/* binding */ faLaptopFile),
/* harmony export */   faLaptopHouse: () => (/* binding */ faLaptopHouse),
/* harmony export */   faLaptopMedical: () => (/* binding */ faLaptopMedical),
/* harmony export */   faLariSign: () => (/* binding */ faLariSign),
/* harmony export */   faLaugh: () => (/* binding */ faLaugh),
/* harmony export */   faLaughBeam: () => (/* binding */ faLaughBeam),
/* harmony export */   faLaughSquint: () => (/* binding */ faLaughSquint),
/* harmony export */   faLaughWink: () => (/* binding */ faLaughWink),
/* harmony export */   faLayerGroup: () => (/* binding */ faLayerGroup),
/* harmony export */   faLeaf: () => (/* binding */ faLeaf),
/* harmony export */   faLeftLong: () => (/* binding */ faLeftLong),
/* harmony export */   faLeftRight: () => (/* binding */ faLeftRight),
/* harmony export */   faLegal: () => (/* binding */ faLegal),
/* harmony export */   faLemon: () => (/* binding */ faLemon),
/* harmony export */   faLessThan: () => (/* binding */ faLessThan),
/* harmony export */   faLessThanEqual: () => (/* binding */ faLessThanEqual),
/* harmony export */   faLevelDown: () => (/* binding */ faLevelDown),
/* harmony export */   faLevelDownAlt: () => (/* binding */ faLevelDownAlt),
/* harmony export */   faLevelUp: () => (/* binding */ faLevelUp),
/* harmony export */   faLevelUpAlt: () => (/* binding */ faLevelUpAlt),
/* harmony export */   faLifeRing: () => (/* binding */ faLifeRing),
/* harmony export */   faLightbulb: () => (/* binding */ faLightbulb),
/* harmony export */   faLineChart: () => (/* binding */ faLineChart),
/* harmony export */   faLinesLeaning: () => (/* binding */ faLinesLeaning),
/* harmony export */   faLink: () => (/* binding */ faLink),
/* harmony export */   faLinkSlash: () => (/* binding */ faLinkSlash),
/* harmony export */   faLiraSign: () => (/* binding */ faLiraSign),
/* harmony export */   faList: () => (/* binding */ faList),
/* harmony export */   faList12: () => (/* binding */ faList12),
/* harmony export */   faListAlt: () => (/* binding */ faListAlt),
/* harmony export */   faListCheck: () => (/* binding */ faListCheck),
/* harmony export */   faListDots: () => (/* binding */ faListDots),
/* harmony export */   faListNumeric: () => (/* binding */ faListNumeric),
/* harmony export */   faListOl: () => (/* binding */ faListOl),
/* harmony export */   faListSquares: () => (/* binding */ faListSquares),
/* harmony export */   faListUl: () => (/* binding */ faListUl),
/* harmony export */   faLitecoinSign: () => (/* binding */ faLitecoinSign),
/* harmony export */   faLocation: () => (/* binding */ faLocation),
/* harmony export */   faLocationArrow: () => (/* binding */ faLocationArrow),
/* harmony export */   faLocationCrosshairs: () => (/* binding */ faLocationCrosshairs),
/* harmony export */   faLocationDot: () => (/* binding */ faLocationDot),
/* harmony export */   faLocationPin: () => (/* binding */ faLocationPin),
/* harmony export */   faLocationPinLock: () => (/* binding */ faLocationPinLock),
/* harmony export */   faLock: () => (/* binding */ faLock),
/* harmony export */   faLockOpen: () => (/* binding */ faLockOpen),
/* harmony export */   faLocust: () => (/* binding */ faLocust),
/* harmony export */   faLongArrowAltDown: () => (/* binding */ faLongArrowAltDown),
/* harmony export */   faLongArrowAltLeft: () => (/* binding */ faLongArrowAltLeft),
/* harmony export */   faLongArrowAltRight: () => (/* binding */ faLongArrowAltRight),
/* harmony export */   faLongArrowAltUp: () => (/* binding */ faLongArrowAltUp),
/* harmony export */   faLongArrowDown: () => (/* binding */ faLongArrowDown),
/* harmony export */   faLongArrowLeft: () => (/* binding */ faLongArrowLeft),
/* harmony export */   faLongArrowRight: () => (/* binding */ faLongArrowRight),
/* harmony export */   faLongArrowUp: () => (/* binding */ faLongArrowUp),
/* harmony export */   faLowVision: () => (/* binding */ faLowVision),
/* harmony export */   faLuggageCart: () => (/* binding */ faLuggageCart),
/* harmony export */   faLungs: () => (/* binding */ faLungs),
/* harmony export */   faLungsVirus: () => (/* binding */ faLungsVirus),
/* harmony export */   faM: () => (/* binding */ faM),
/* harmony export */   faMagic: () => (/* binding */ faMagic),
/* harmony export */   faMagicWandSparkles: () => (/* binding */ faMagicWandSparkles),
/* harmony export */   faMagnet: () => (/* binding */ faMagnet),
/* harmony export */   faMagnifyingGlass: () => (/* binding */ faMagnifyingGlass),
/* harmony export */   faMagnifyingGlassArrowRight: () => (/* binding */ faMagnifyingGlassArrowRight),
/* harmony export */   faMagnifyingGlassChart: () => (/* binding */ faMagnifyingGlassChart),
/* harmony export */   faMagnifyingGlassDollar: () => (/* binding */ faMagnifyingGlassDollar),
/* harmony export */   faMagnifyingGlassLocation: () => (/* binding */ faMagnifyingGlassLocation),
/* harmony export */   faMagnifyingGlassMinus: () => (/* binding */ faMagnifyingGlassMinus),
/* harmony export */   faMagnifyingGlassPlus: () => (/* binding */ faMagnifyingGlassPlus),
/* harmony export */   faMailBulk: () => (/* binding */ faMailBulk),
/* harmony export */   faMailForward: () => (/* binding */ faMailForward),
/* harmony export */   faMailReply: () => (/* binding */ faMailReply),
/* harmony export */   faMailReplyAll: () => (/* binding */ faMailReplyAll),
/* harmony export */   faMale: () => (/* binding */ faMale),
/* harmony export */   faManatSign: () => (/* binding */ faManatSign),
/* harmony export */   faMap: () => (/* binding */ faMap),
/* harmony export */   faMapLocation: () => (/* binding */ faMapLocation),
/* harmony export */   faMapLocationDot: () => (/* binding */ faMapLocationDot),
/* harmony export */   faMapMarked: () => (/* binding */ faMapMarked),
/* harmony export */   faMapMarkedAlt: () => (/* binding */ faMapMarkedAlt),
/* harmony export */   faMapMarker: () => (/* binding */ faMapMarker),
/* harmony export */   faMapMarkerAlt: () => (/* binding */ faMapMarkerAlt),
/* harmony export */   faMapPin: () => (/* binding */ faMapPin),
/* harmony export */   faMapSigns: () => (/* binding */ faMapSigns),
/* harmony export */   faMarker: () => (/* binding */ faMarker),
/* harmony export */   faMars: () => (/* binding */ faMars),
/* harmony export */   faMarsAndVenus: () => (/* binding */ faMarsAndVenus),
/* harmony export */   faMarsAndVenusBurst: () => (/* binding */ faMarsAndVenusBurst),
/* harmony export */   faMarsDouble: () => (/* binding */ faMarsDouble),
/* harmony export */   faMarsStroke: () => (/* binding */ faMarsStroke),
/* harmony export */   faMarsStrokeH: () => (/* binding */ faMarsStrokeH),
/* harmony export */   faMarsStrokeRight: () => (/* binding */ faMarsStrokeRight),
/* harmony export */   faMarsStrokeUp: () => (/* binding */ faMarsStrokeUp),
/* harmony export */   faMarsStrokeV: () => (/* binding */ faMarsStrokeV),
/* harmony export */   faMartiniGlass: () => (/* binding */ faMartiniGlass),
/* harmony export */   faMartiniGlassCitrus: () => (/* binding */ faMartiniGlassCitrus),
/* harmony export */   faMartiniGlassEmpty: () => (/* binding */ faMartiniGlassEmpty),
/* harmony export */   faMask: () => (/* binding */ faMask),
/* harmony export */   faMaskFace: () => (/* binding */ faMaskFace),
/* harmony export */   faMaskVentilator: () => (/* binding */ faMaskVentilator),
/* harmony export */   faMasksTheater: () => (/* binding */ faMasksTheater),
/* harmony export */   faMattressPillow: () => (/* binding */ faMattressPillow),
/* harmony export */   faMaximize: () => (/* binding */ faMaximize),
/* harmony export */   faMedal: () => (/* binding */ faMedal),
/* harmony export */   faMedkit: () => (/* binding */ faMedkit),
/* harmony export */   faMeh: () => (/* binding */ faMeh),
/* harmony export */   faMehBlank: () => (/* binding */ faMehBlank),
/* harmony export */   faMehRollingEyes: () => (/* binding */ faMehRollingEyes),
/* harmony export */   faMemory: () => (/* binding */ faMemory),
/* harmony export */   faMenorah: () => (/* binding */ faMenorah),
/* harmony export */   faMercury: () => (/* binding */ faMercury),
/* harmony export */   faMessage: () => (/* binding */ faMessage),
/* harmony export */   faMeteor: () => (/* binding */ faMeteor),
/* harmony export */   faMicrochip: () => (/* binding */ faMicrochip),
/* harmony export */   faMicrophone: () => (/* binding */ faMicrophone),
/* harmony export */   faMicrophoneAlt: () => (/* binding */ faMicrophoneAlt),
/* harmony export */   faMicrophoneAltSlash: () => (/* binding */ faMicrophoneAltSlash),
/* harmony export */   faMicrophoneLines: () => (/* binding */ faMicrophoneLines),
/* harmony export */   faMicrophoneLinesSlash: () => (/* binding */ faMicrophoneLinesSlash),
/* harmony export */   faMicrophoneSlash: () => (/* binding */ faMicrophoneSlash),
/* harmony export */   faMicroscope: () => (/* binding */ faMicroscope),
/* harmony export */   faMillSign: () => (/* binding */ faMillSign),
/* harmony export */   faMinimize: () => (/* binding */ faMinimize),
/* harmony export */   faMinus: () => (/* binding */ faMinus),
/* harmony export */   faMinusCircle: () => (/* binding */ faMinusCircle),
/* harmony export */   faMinusSquare: () => (/* binding */ faMinusSquare),
/* harmony export */   faMitten: () => (/* binding */ faMitten),
/* harmony export */   faMobile: () => (/* binding */ faMobile),
/* harmony export */   faMobileAlt: () => (/* binding */ faMobileAlt),
/* harmony export */   faMobileAndroid: () => (/* binding */ faMobileAndroid),
/* harmony export */   faMobileAndroidAlt: () => (/* binding */ faMobileAndroidAlt),
/* harmony export */   faMobileButton: () => (/* binding */ faMobileButton),
/* harmony export */   faMobilePhone: () => (/* binding */ faMobilePhone),
/* harmony export */   faMobileRetro: () => (/* binding */ faMobileRetro),
/* harmony export */   faMobileScreen: () => (/* binding */ faMobileScreen),
/* harmony export */   faMobileScreenButton: () => (/* binding */ faMobileScreenButton),
/* harmony export */   faMoneyBill: () => (/* binding */ faMoneyBill),
/* harmony export */   faMoneyBill1: () => (/* binding */ faMoneyBill1),
/* harmony export */   faMoneyBill1Wave: () => (/* binding */ faMoneyBill1Wave),
/* harmony export */   faMoneyBillAlt: () => (/* binding */ faMoneyBillAlt),
/* harmony export */   faMoneyBillTransfer: () => (/* binding */ faMoneyBillTransfer),
/* harmony export */   faMoneyBillTrendUp: () => (/* binding */ faMoneyBillTrendUp),
/* harmony export */   faMoneyBillWave: () => (/* binding */ faMoneyBillWave),
/* harmony export */   faMoneyBillWaveAlt: () => (/* binding */ faMoneyBillWaveAlt),
/* harmony export */   faMoneyBillWheat: () => (/* binding */ faMoneyBillWheat),
/* harmony export */   faMoneyBills: () => (/* binding */ faMoneyBills),
/* harmony export */   faMoneyCheck: () => (/* binding */ faMoneyCheck),
/* harmony export */   faMoneyCheckAlt: () => (/* binding */ faMoneyCheckAlt),
/* harmony export */   faMoneyCheckDollar: () => (/* binding */ faMoneyCheckDollar),
/* harmony export */   faMonument: () => (/* binding */ faMonument),
/* harmony export */   faMoon: () => (/* binding */ faMoon),
/* harmony export */   faMortarBoard: () => (/* binding */ faMortarBoard),
/* harmony export */   faMortarPestle: () => (/* binding */ faMortarPestle),
/* harmony export */   faMosque: () => (/* binding */ faMosque),
/* harmony export */   faMosquito: () => (/* binding */ faMosquito),
/* harmony export */   faMosquitoNet: () => (/* binding */ faMosquitoNet),
/* harmony export */   faMotorcycle: () => (/* binding */ faMotorcycle),
/* harmony export */   faMound: () => (/* binding */ faMound),
/* harmony export */   faMountain: () => (/* binding */ faMountain),
/* harmony export */   faMountainCity: () => (/* binding */ faMountainCity),
/* harmony export */   faMountainSun: () => (/* binding */ faMountainSun),
/* harmony export */   faMouse: () => (/* binding */ faMouse),
/* harmony export */   faMousePointer: () => (/* binding */ faMousePointer),
/* harmony export */   faMugHot: () => (/* binding */ faMugHot),
/* harmony export */   faMugSaucer: () => (/* binding */ faMugSaucer),
/* harmony export */   faMultiply: () => (/* binding */ faMultiply),
/* harmony export */   faMuseum: () => (/* binding */ faMuseum),
/* harmony export */   faMusic: () => (/* binding */ faMusic),
/* harmony export */   faN: () => (/* binding */ faN),
/* harmony export */   faNairaSign: () => (/* binding */ faNairaSign),
/* harmony export */   faNavicon: () => (/* binding */ faNavicon),
/* harmony export */   faNetworkWired: () => (/* binding */ faNetworkWired),
/* harmony export */   faNeuter: () => (/* binding */ faNeuter),
/* harmony export */   faNewspaper: () => (/* binding */ faNewspaper),
/* harmony export */   faNotEqual: () => (/* binding */ faNotEqual),
/* harmony export */   faNotdef: () => (/* binding */ faNotdef),
/* harmony export */   faNoteSticky: () => (/* binding */ faNoteSticky),
/* harmony export */   faNotesMedical: () => (/* binding */ faNotesMedical),
/* harmony export */   faO: () => (/* binding */ faO),
/* harmony export */   faObjectGroup: () => (/* binding */ faObjectGroup),
/* harmony export */   faObjectUngroup: () => (/* binding */ faObjectUngroup),
/* harmony export */   faOilCan: () => (/* binding */ faOilCan),
/* harmony export */   faOilWell: () => (/* binding */ faOilWell),
/* harmony export */   faOm: () => (/* binding */ faOm),
/* harmony export */   faOtter: () => (/* binding */ faOtter),
/* harmony export */   faOutdent: () => (/* binding */ faOutdent),
/* harmony export */   faP: () => (/* binding */ faP),
/* harmony export */   faPager: () => (/* binding */ faPager),
/* harmony export */   faPaintBrush: () => (/* binding */ faPaintBrush),
/* harmony export */   faPaintRoller: () => (/* binding */ faPaintRoller),
/* harmony export */   faPaintbrush: () => (/* binding */ faPaintbrush),
/* harmony export */   faPalette: () => (/* binding */ faPalette),
/* harmony export */   faPallet: () => (/* binding */ faPallet),
/* harmony export */   faPanorama: () => (/* binding */ faPanorama),
/* harmony export */   faPaperPlane: () => (/* binding */ faPaperPlane),
/* harmony export */   faPaperclip: () => (/* binding */ faPaperclip),
/* harmony export */   faParachuteBox: () => (/* binding */ faParachuteBox),
/* harmony export */   faParagraph: () => (/* binding */ faParagraph),
/* harmony export */   faParking: () => (/* binding */ faParking),
/* harmony export */   faPassport: () => (/* binding */ faPassport),
/* harmony export */   faPastafarianism: () => (/* binding */ faPastafarianism),
/* harmony export */   faPaste: () => (/* binding */ faPaste),
/* harmony export */   faPause: () => (/* binding */ faPause),
/* harmony export */   faPauseCircle: () => (/* binding */ faPauseCircle),
/* harmony export */   faPaw: () => (/* binding */ faPaw),
/* harmony export */   faPeace: () => (/* binding */ faPeace),
/* harmony export */   faPen: () => (/* binding */ faPen),
/* harmony export */   faPenAlt: () => (/* binding */ faPenAlt),
/* harmony export */   faPenClip: () => (/* binding */ faPenClip),
/* harmony export */   faPenFancy: () => (/* binding */ faPenFancy),
/* harmony export */   faPenNib: () => (/* binding */ faPenNib),
/* harmony export */   faPenRuler: () => (/* binding */ faPenRuler),
/* harmony export */   faPenSquare: () => (/* binding */ faPenSquare),
/* harmony export */   faPenToSquare: () => (/* binding */ faPenToSquare),
/* harmony export */   faPencil: () => (/* binding */ faPencil),
/* harmony export */   faPencilAlt: () => (/* binding */ faPencilAlt),
/* harmony export */   faPencilRuler: () => (/* binding */ faPencilRuler),
/* harmony export */   faPencilSquare: () => (/* binding */ faPencilSquare),
/* harmony export */   faPeopleArrows: () => (/* binding */ faPeopleArrows),
/* harmony export */   faPeopleArrowsLeftRight: () => (/* binding */ faPeopleArrowsLeftRight),
/* harmony export */   faPeopleCarry: () => (/* binding */ faPeopleCarry),
/* harmony export */   faPeopleCarryBox: () => (/* binding */ faPeopleCarryBox),
/* harmony export */   faPeopleGroup: () => (/* binding */ faPeopleGroup),
/* harmony export */   faPeopleLine: () => (/* binding */ faPeopleLine),
/* harmony export */   faPeoplePulling: () => (/* binding */ faPeoplePulling),
/* harmony export */   faPeopleRobbery: () => (/* binding */ faPeopleRobbery),
/* harmony export */   faPeopleRoof: () => (/* binding */ faPeopleRoof),
/* harmony export */   faPepperHot: () => (/* binding */ faPepperHot),
/* harmony export */   faPercent: () => (/* binding */ faPercent),
/* harmony export */   faPercentage: () => (/* binding */ faPercentage),
/* harmony export */   faPerson: () => (/* binding */ faPerson),
/* harmony export */   faPersonArrowDownToLine: () => (/* binding */ faPersonArrowDownToLine),
/* harmony export */   faPersonArrowUpFromLine: () => (/* binding */ faPersonArrowUpFromLine),
/* harmony export */   faPersonBiking: () => (/* binding */ faPersonBiking),
/* harmony export */   faPersonBooth: () => (/* binding */ faPersonBooth),
/* harmony export */   faPersonBreastfeeding: () => (/* binding */ faPersonBreastfeeding),
/* harmony export */   faPersonBurst: () => (/* binding */ faPersonBurst),
/* harmony export */   faPersonCane: () => (/* binding */ faPersonCane),
/* harmony export */   faPersonChalkboard: () => (/* binding */ faPersonChalkboard),
/* harmony export */   faPersonCircleCheck: () => (/* binding */ faPersonCircleCheck),
/* harmony export */   faPersonCircleExclamation: () => (/* binding */ faPersonCircleExclamation),
/* harmony export */   faPersonCircleMinus: () => (/* binding */ faPersonCircleMinus),
/* harmony export */   faPersonCirclePlus: () => (/* binding */ faPersonCirclePlus),
/* harmony export */   faPersonCircleQuestion: () => (/* binding */ faPersonCircleQuestion),
/* harmony export */   faPersonCircleXmark: () => (/* binding */ faPersonCircleXmark),
/* harmony export */   faPersonDigging: () => (/* binding */ faPersonDigging),
/* harmony export */   faPersonDotsFromLine: () => (/* binding */ faPersonDotsFromLine),
/* harmony export */   faPersonDress: () => (/* binding */ faPersonDress),
/* harmony export */   faPersonDressBurst: () => (/* binding */ faPersonDressBurst),
/* harmony export */   faPersonDrowning: () => (/* binding */ faPersonDrowning),
/* harmony export */   faPersonFalling: () => (/* binding */ faPersonFalling),
/* harmony export */   faPersonFallingBurst: () => (/* binding */ faPersonFallingBurst),
/* harmony export */   faPersonHalfDress: () => (/* binding */ faPersonHalfDress),
/* harmony export */   faPersonHarassing: () => (/* binding */ faPersonHarassing),
/* harmony export */   faPersonHiking: () => (/* binding */ faPersonHiking),
/* harmony export */   faPersonMilitaryPointing: () => (/* binding */ faPersonMilitaryPointing),
/* harmony export */   faPersonMilitaryRifle: () => (/* binding */ faPersonMilitaryRifle),
/* harmony export */   faPersonMilitaryToPerson: () => (/* binding */ faPersonMilitaryToPerson),
/* harmony export */   faPersonPraying: () => (/* binding */ faPersonPraying),
/* harmony export */   faPersonPregnant: () => (/* binding */ faPersonPregnant),
/* harmony export */   faPersonRays: () => (/* binding */ faPersonRays),
/* harmony export */   faPersonRifle: () => (/* binding */ faPersonRifle),
/* harmony export */   faPersonRunning: () => (/* binding */ faPersonRunning),
/* harmony export */   faPersonShelter: () => (/* binding */ faPersonShelter),
/* harmony export */   faPersonSkating: () => (/* binding */ faPersonSkating),
/* harmony export */   faPersonSkiing: () => (/* binding */ faPersonSkiing),
/* harmony export */   faPersonSkiingNordic: () => (/* binding */ faPersonSkiingNordic),
/* harmony export */   faPersonSnowboarding: () => (/* binding */ faPersonSnowboarding),
/* harmony export */   faPersonSwimming: () => (/* binding */ faPersonSwimming),
/* harmony export */   faPersonThroughWindow: () => (/* binding */ faPersonThroughWindow),
/* harmony export */   faPersonWalking: () => (/* binding */ faPersonWalking),
/* harmony export */   faPersonWalkingArrowLoopLeft: () => (/* binding */ faPersonWalkingArrowLoopLeft),
/* harmony export */   faPersonWalkingArrowRight: () => (/* binding */ faPersonWalkingArrowRight),
/* harmony export */   faPersonWalkingDashedLineArrowRight: () => (/* binding */ faPersonWalkingDashedLineArrowRight),
/* harmony export */   faPersonWalkingLuggage: () => (/* binding */ faPersonWalkingLuggage),
/* harmony export */   faPersonWalkingWithCane: () => (/* binding */ faPersonWalkingWithCane),
/* harmony export */   faPesetaSign: () => (/* binding */ faPesetaSign),
/* harmony export */   faPesoSign: () => (/* binding */ faPesoSign),
/* harmony export */   faPhone: () => (/* binding */ faPhone),
/* harmony export */   faPhoneAlt: () => (/* binding */ faPhoneAlt),
/* harmony export */   faPhoneFlip: () => (/* binding */ faPhoneFlip),
/* harmony export */   faPhoneSlash: () => (/* binding */ faPhoneSlash),
/* harmony export */   faPhoneSquare: () => (/* binding */ faPhoneSquare),
/* harmony export */   faPhoneSquareAlt: () => (/* binding */ faPhoneSquareAlt),
/* harmony export */   faPhoneVolume: () => (/* binding */ faPhoneVolume),
/* harmony export */   faPhotoFilm: () => (/* binding */ faPhotoFilm),
/* harmony export */   faPhotoVideo: () => (/* binding */ faPhotoVideo),
/* harmony export */   faPieChart: () => (/* binding */ faPieChart),
/* harmony export */   faPiggyBank: () => (/* binding */ faPiggyBank),
/* harmony export */   faPills: () => (/* binding */ faPills),
/* harmony export */   faPingPongPaddleBall: () => (/* binding */ faPingPongPaddleBall),
/* harmony export */   faPizzaSlice: () => (/* binding */ faPizzaSlice),
/* harmony export */   faPlaceOfWorship: () => (/* binding */ faPlaceOfWorship),
/* harmony export */   faPlane: () => (/* binding */ faPlane),
/* harmony export */   faPlaneArrival: () => (/* binding */ faPlaneArrival),
/* harmony export */   faPlaneCircleCheck: () => (/* binding */ faPlaneCircleCheck),
/* harmony export */   faPlaneCircleExclamation: () => (/* binding */ faPlaneCircleExclamation),
/* harmony export */   faPlaneCircleXmark: () => (/* binding */ faPlaneCircleXmark),
/* harmony export */   faPlaneDeparture: () => (/* binding */ faPlaneDeparture),
/* harmony export */   faPlaneLock: () => (/* binding */ faPlaneLock),
/* harmony export */   faPlaneSlash: () => (/* binding */ faPlaneSlash),
/* harmony export */   faPlaneUp: () => (/* binding */ faPlaneUp),
/* harmony export */   faPlantWilt: () => (/* binding */ faPlantWilt),
/* harmony export */   faPlateWheat: () => (/* binding */ faPlateWheat),
/* harmony export */   faPlay: () => (/* binding */ faPlay),
/* harmony export */   faPlayCircle: () => (/* binding */ faPlayCircle),
/* harmony export */   faPlug: () => (/* binding */ faPlug),
/* harmony export */   faPlugCircleBolt: () => (/* binding */ faPlugCircleBolt),
/* harmony export */   faPlugCircleCheck: () => (/* binding */ faPlugCircleCheck),
/* harmony export */   faPlugCircleExclamation: () => (/* binding */ faPlugCircleExclamation),
/* harmony export */   faPlugCircleMinus: () => (/* binding */ faPlugCircleMinus),
/* harmony export */   faPlugCirclePlus: () => (/* binding */ faPlugCirclePlus),
/* harmony export */   faPlugCircleXmark: () => (/* binding */ faPlugCircleXmark),
/* harmony export */   faPlus: () => (/* binding */ faPlus),
/* harmony export */   faPlusCircle: () => (/* binding */ faPlusCircle),
/* harmony export */   faPlusMinus: () => (/* binding */ faPlusMinus),
/* harmony export */   faPlusSquare: () => (/* binding */ faPlusSquare),
/* harmony export */   faPodcast: () => (/* binding */ faPodcast),
/* harmony export */   faPoll: () => (/* binding */ faPoll),
/* harmony export */   faPollH: () => (/* binding */ faPollH),
/* harmony export */   faPoo: () => (/* binding */ faPoo),
/* harmony export */   faPooBolt: () => (/* binding */ faPooBolt),
/* harmony export */   faPooStorm: () => (/* binding */ faPooStorm),
/* harmony export */   faPoop: () => (/* binding */ faPoop),
/* harmony export */   faPortrait: () => (/* binding */ faPortrait),
/* harmony export */   faPoundSign: () => (/* binding */ faPoundSign),
/* harmony export */   faPowerOff: () => (/* binding */ faPowerOff),
/* harmony export */   faPray: () => (/* binding */ faPray),
/* harmony export */   faPrayingHands: () => (/* binding */ faPrayingHands),
/* harmony export */   faPrescription: () => (/* binding */ faPrescription),
/* harmony export */   faPrescriptionBottle: () => (/* binding */ faPrescriptionBottle),
/* harmony export */   faPrescriptionBottleAlt: () => (/* binding */ faPrescriptionBottleAlt),
/* harmony export */   faPrescriptionBottleMedical: () => (/* binding */ faPrescriptionBottleMedical),
/* harmony export */   faPrint: () => (/* binding */ faPrint),
/* harmony export */   faProcedures: () => (/* binding */ faProcedures),
/* harmony export */   faProjectDiagram: () => (/* binding */ faProjectDiagram),
/* harmony export */   faPumpMedical: () => (/* binding */ faPumpMedical),
/* harmony export */   faPumpSoap: () => (/* binding */ faPumpSoap),
/* harmony export */   faPuzzlePiece: () => (/* binding */ faPuzzlePiece),
/* harmony export */   faQ: () => (/* binding */ faQ),
/* harmony export */   faQrcode: () => (/* binding */ faQrcode),
/* harmony export */   faQuestion: () => (/* binding */ faQuestion),
/* harmony export */   faQuestionCircle: () => (/* binding */ faQuestionCircle),
/* harmony export */   faQuidditch: () => (/* binding */ faQuidditch),
/* harmony export */   faQuidditchBroomBall: () => (/* binding */ faQuidditchBroomBall),
/* harmony export */   faQuoteLeft: () => (/* binding */ faQuoteLeft),
/* harmony export */   faQuoteLeftAlt: () => (/* binding */ faQuoteLeftAlt),
/* harmony export */   faQuoteRight: () => (/* binding */ faQuoteRight),
/* harmony export */   faQuoteRightAlt: () => (/* binding */ faQuoteRightAlt),
/* harmony export */   faQuran: () => (/* binding */ faQuran),
/* harmony export */   faR: () => (/* binding */ faR),
/* harmony export */   faRadiation: () => (/* binding */ faRadiation),
/* harmony export */   faRadiationAlt: () => (/* binding */ faRadiationAlt),
/* harmony export */   faRadio: () => (/* binding */ faRadio),
/* harmony export */   faRainbow: () => (/* binding */ faRainbow),
/* harmony export */   faRandom: () => (/* binding */ faRandom),
/* harmony export */   faRankingStar: () => (/* binding */ faRankingStar),
/* harmony export */   faReceipt: () => (/* binding */ faReceipt),
/* harmony export */   faRecordVinyl: () => (/* binding */ faRecordVinyl),
/* harmony export */   faRectangleAd: () => (/* binding */ faRectangleAd),
/* harmony export */   faRectangleList: () => (/* binding */ faRectangleList),
/* harmony export */   faRectangleTimes: () => (/* binding */ faRectangleTimes),
/* harmony export */   faRectangleXmark: () => (/* binding */ faRectangleXmark),
/* harmony export */   faRecycle: () => (/* binding */ faRecycle),
/* harmony export */   faRedo: () => (/* binding */ faRedo),
/* harmony export */   faRedoAlt: () => (/* binding */ faRedoAlt),
/* harmony export */   faRefresh: () => (/* binding */ faRefresh),
/* harmony export */   faRegistered: () => (/* binding */ faRegistered),
/* harmony export */   faRemove: () => (/* binding */ faRemove),
/* harmony export */   faRemoveFormat: () => (/* binding */ faRemoveFormat),
/* harmony export */   faReorder: () => (/* binding */ faReorder),
/* harmony export */   faRepeat: () => (/* binding */ faRepeat),
/* harmony export */   faReply: () => (/* binding */ faReply),
/* harmony export */   faReplyAll: () => (/* binding */ faReplyAll),
/* harmony export */   faRepublican: () => (/* binding */ faRepublican),
/* harmony export */   faRestroom: () => (/* binding */ faRestroom),
/* harmony export */   faRetweet: () => (/* binding */ faRetweet),
/* harmony export */   faRibbon: () => (/* binding */ faRibbon),
/* harmony export */   faRightFromBracket: () => (/* binding */ faRightFromBracket),
/* harmony export */   faRightLeft: () => (/* binding */ faRightLeft),
/* harmony export */   faRightLong: () => (/* binding */ faRightLong),
/* harmony export */   faRightToBracket: () => (/* binding */ faRightToBracket),
/* harmony export */   faRing: () => (/* binding */ faRing),
/* harmony export */   faRmb: () => (/* binding */ faRmb),
/* harmony export */   faRoad: () => (/* binding */ faRoad),
/* harmony export */   faRoadBarrier: () => (/* binding */ faRoadBarrier),
/* harmony export */   faRoadBridge: () => (/* binding */ faRoadBridge),
/* harmony export */   faRoadCircleCheck: () => (/* binding */ faRoadCircleCheck),
/* harmony export */   faRoadCircleExclamation: () => (/* binding */ faRoadCircleExclamation),
/* harmony export */   faRoadCircleXmark: () => (/* binding */ faRoadCircleXmark),
/* harmony export */   faRoadLock: () => (/* binding */ faRoadLock),
/* harmony export */   faRoadSpikes: () => (/* binding */ faRoadSpikes),
/* harmony export */   faRobot: () => (/* binding */ faRobot),
/* harmony export */   faRocket: () => (/* binding */ faRocket),
/* harmony export */   faRodAsclepius: () => (/* binding */ faRodAsclepius),
/* harmony export */   faRodSnake: () => (/* binding */ faRodSnake),
/* harmony export */   faRotate: () => (/* binding */ faRotate),
/* harmony export */   faRotateBack: () => (/* binding */ faRotateBack),
/* harmony export */   faRotateBackward: () => (/* binding */ faRotateBackward),
/* harmony export */   faRotateForward: () => (/* binding */ faRotateForward),
/* harmony export */   faRotateLeft: () => (/* binding */ faRotateLeft),
/* harmony export */   faRotateRight: () => (/* binding */ faRotateRight),
/* harmony export */   faRouble: () => (/* binding */ faRouble),
/* harmony export */   faRoute: () => (/* binding */ faRoute),
/* harmony export */   faRss: () => (/* binding */ faRss),
/* harmony export */   faRssSquare: () => (/* binding */ faRssSquare),
/* harmony export */   faRub: () => (/* binding */ faRub),
/* harmony export */   faRuble: () => (/* binding */ faRuble),
/* harmony export */   faRubleSign: () => (/* binding */ faRubleSign),
/* harmony export */   faRug: () => (/* binding */ faRug),
/* harmony export */   faRuler: () => (/* binding */ faRuler),
/* harmony export */   faRulerCombined: () => (/* binding */ faRulerCombined),
/* harmony export */   faRulerHorizontal: () => (/* binding */ faRulerHorizontal),
/* harmony export */   faRulerVertical: () => (/* binding */ faRulerVertical),
/* harmony export */   faRunning: () => (/* binding */ faRunning),
/* harmony export */   faRupee: () => (/* binding */ faRupee),
/* harmony export */   faRupeeSign: () => (/* binding */ faRupeeSign),
/* harmony export */   faRupiahSign: () => (/* binding */ faRupiahSign),
/* harmony export */   faS: () => (/* binding */ faS),
/* harmony export */   faSackDollar: () => (/* binding */ faSackDollar),
/* harmony export */   faSackXmark: () => (/* binding */ faSackXmark),
/* harmony export */   faSadCry: () => (/* binding */ faSadCry),
/* harmony export */   faSadTear: () => (/* binding */ faSadTear),
/* harmony export */   faSailboat: () => (/* binding */ faSailboat),
/* harmony export */   faSatellite: () => (/* binding */ faSatellite),
/* harmony export */   faSatelliteDish: () => (/* binding */ faSatelliteDish),
/* harmony export */   faSave: () => (/* binding */ faSave),
/* harmony export */   faScaleBalanced: () => (/* binding */ faScaleBalanced),
/* harmony export */   faScaleUnbalanced: () => (/* binding */ faScaleUnbalanced),
/* harmony export */   faScaleUnbalancedFlip: () => (/* binding */ faScaleUnbalancedFlip),
/* harmony export */   faSchool: () => (/* binding */ faSchool),
/* harmony export */   faSchoolCircleCheck: () => (/* binding */ faSchoolCircleCheck),
/* harmony export */   faSchoolCircleExclamation: () => (/* binding */ faSchoolCircleExclamation),
/* harmony export */   faSchoolCircleXmark: () => (/* binding */ faSchoolCircleXmark),
/* harmony export */   faSchoolFlag: () => (/* binding */ faSchoolFlag),
/* harmony export */   faSchoolLock: () => (/* binding */ faSchoolLock),
/* harmony export */   faScissors: () => (/* binding */ faScissors),
/* harmony export */   faScrewdriver: () => (/* binding */ faScrewdriver),
/* harmony export */   faScrewdriverWrench: () => (/* binding */ faScrewdriverWrench),
/* harmony export */   faScroll: () => (/* binding */ faScroll),
/* harmony export */   faScrollTorah: () => (/* binding */ faScrollTorah),
/* harmony export */   faSdCard: () => (/* binding */ faSdCard),
/* harmony export */   faSearch: () => (/* binding */ faSearch),
/* harmony export */   faSearchDollar: () => (/* binding */ faSearchDollar),
/* harmony export */   faSearchLocation: () => (/* binding */ faSearchLocation),
/* harmony export */   faSearchMinus: () => (/* binding */ faSearchMinus),
/* harmony export */   faSearchPlus: () => (/* binding */ faSearchPlus),
/* harmony export */   faSection: () => (/* binding */ faSection),
/* harmony export */   faSeedling: () => (/* binding */ faSeedling),
/* harmony export */   faServer: () => (/* binding */ faServer),
/* harmony export */   faShapes: () => (/* binding */ faShapes),
/* harmony export */   faShare: () => (/* binding */ faShare),
/* harmony export */   faShareAlt: () => (/* binding */ faShareAlt),
/* harmony export */   faShareAltSquare: () => (/* binding */ faShareAltSquare),
/* harmony export */   faShareFromSquare: () => (/* binding */ faShareFromSquare),
/* harmony export */   faShareNodes: () => (/* binding */ faShareNodes),
/* harmony export */   faShareSquare: () => (/* binding */ faShareSquare),
/* harmony export */   faSheetPlastic: () => (/* binding */ faSheetPlastic),
/* harmony export */   faShekel: () => (/* binding */ faShekel),
/* harmony export */   faShekelSign: () => (/* binding */ faShekelSign),
/* harmony export */   faSheqel: () => (/* binding */ faSheqel),
/* harmony export */   faSheqelSign: () => (/* binding */ faSheqelSign),
/* harmony export */   faShield: () => (/* binding */ faShield),
/* harmony export */   faShieldAlt: () => (/* binding */ faShieldAlt),
/* harmony export */   faShieldBlank: () => (/* binding */ faShieldBlank),
/* harmony export */   faShieldCat: () => (/* binding */ faShieldCat),
/* harmony export */   faShieldDog: () => (/* binding */ faShieldDog),
/* harmony export */   faShieldHalved: () => (/* binding */ faShieldHalved),
/* harmony export */   faShieldHeart: () => (/* binding */ faShieldHeart),
/* harmony export */   faShieldVirus: () => (/* binding */ faShieldVirus),
/* harmony export */   faShip: () => (/* binding */ faShip),
/* harmony export */   faShippingFast: () => (/* binding */ faShippingFast),
/* harmony export */   faShirt: () => (/* binding */ faShirt),
/* harmony export */   faShoePrints: () => (/* binding */ faShoePrints),
/* harmony export */   faShop: () => (/* binding */ faShop),
/* harmony export */   faShopLock: () => (/* binding */ faShopLock),
/* harmony export */   faShopSlash: () => (/* binding */ faShopSlash),
/* harmony export */   faShoppingBag: () => (/* binding */ faShoppingBag),
/* harmony export */   faShoppingBasket: () => (/* binding */ faShoppingBasket),
/* harmony export */   faShoppingCart: () => (/* binding */ faShoppingCart),
/* harmony export */   faShower: () => (/* binding */ faShower),
/* harmony export */   faShrimp: () => (/* binding */ faShrimp),
/* harmony export */   faShuffle: () => (/* binding */ faShuffle),
/* harmony export */   faShuttleSpace: () => (/* binding */ faShuttleSpace),
/* harmony export */   faShuttleVan: () => (/* binding */ faShuttleVan),
/* harmony export */   faSign: () => (/* binding */ faSign),
/* harmony export */   faSignHanging: () => (/* binding */ faSignHanging),
/* harmony export */   faSignIn: () => (/* binding */ faSignIn),
/* harmony export */   faSignInAlt: () => (/* binding */ faSignInAlt),
/* harmony export */   faSignLanguage: () => (/* binding */ faSignLanguage),
/* harmony export */   faSignOut: () => (/* binding */ faSignOut),
/* harmony export */   faSignOutAlt: () => (/* binding */ faSignOutAlt),
/* harmony export */   faSignal: () => (/* binding */ faSignal),
/* harmony export */   faSignal5: () => (/* binding */ faSignal5),
/* harmony export */   faSignalPerfect: () => (/* binding */ faSignalPerfect),
/* harmony export */   faSignature: () => (/* binding */ faSignature),
/* harmony export */   faSigning: () => (/* binding */ faSigning),
/* harmony export */   faSignsPost: () => (/* binding */ faSignsPost),
/* harmony export */   faSimCard: () => (/* binding */ faSimCard),
/* harmony export */   faSink: () => (/* binding */ faSink),
/* harmony export */   faSitemap: () => (/* binding */ faSitemap),
/* harmony export */   faSkating: () => (/* binding */ faSkating),
/* harmony export */   faSkiing: () => (/* binding */ faSkiing),
/* harmony export */   faSkiingNordic: () => (/* binding */ faSkiingNordic),
/* harmony export */   faSkull: () => (/* binding */ faSkull),
/* harmony export */   faSkullCrossbones: () => (/* binding */ faSkullCrossbones),
/* harmony export */   faSlash: () => (/* binding */ faSlash),
/* harmony export */   faSleigh: () => (/* binding */ faSleigh),
/* harmony export */   faSliders: () => (/* binding */ faSliders),
/* harmony export */   faSlidersH: () => (/* binding */ faSlidersH),
/* harmony export */   faSmile: () => (/* binding */ faSmile),
/* harmony export */   faSmileBeam: () => (/* binding */ faSmileBeam),
/* harmony export */   faSmileWink: () => (/* binding */ faSmileWink),
/* harmony export */   faSmog: () => (/* binding */ faSmog),
/* harmony export */   faSmoking: () => (/* binding */ faSmoking),
/* harmony export */   faSmokingBan: () => (/* binding */ faSmokingBan),
/* harmony export */   faSms: () => (/* binding */ faSms),
/* harmony export */   faSnowboarding: () => (/* binding */ faSnowboarding),
/* harmony export */   faSnowflake: () => (/* binding */ faSnowflake),
/* harmony export */   faSnowman: () => (/* binding */ faSnowman),
/* harmony export */   faSnowplow: () => (/* binding */ faSnowplow),
/* harmony export */   faSoap: () => (/* binding */ faSoap),
/* harmony export */   faSoccerBall: () => (/* binding */ faSoccerBall),
/* harmony export */   faSocks: () => (/* binding */ faSocks),
/* harmony export */   faSolarPanel: () => (/* binding */ faSolarPanel),
/* harmony export */   faSort: () => (/* binding */ faSort),
/* harmony export */   faSortAlphaAsc: () => (/* binding */ faSortAlphaAsc),
/* harmony export */   faSortAlphaDesc: () => (/* binding */ faSortAlphaDesc),
/* harmony export */   faSortAlphaDown: () => (/* binding */ faSortAlphaDown),
/* harmony export */   faSortAlphaDownAlt: () => (/* binding */ faSortAlphaDownAlt),
/* harmony export */   faSortAlphaUp: () => (/* binding */ faSortAlphaUp),
/* harmony export */   faSortAlphaUpAlt: () => (/* binding */ faSortAlphaUpAlt),
/* harmony export */   faSortAmountAsc: () => (/* binding */ faSortAmountAsc),
/* harmony export */   faSortAmountDesc: () => (/* binding */ faSortAmountDesc),
/* harmony export */   faSortAmountDown: () => (/* binding */ faSortAmountDown),
/* harmony export */   faSortAmountDownAlt: () => (/* binding */ faSortAmountDownAlt),
/* harmony export */   faSortAmountUp: () => (/* binding */ faSortAmountUp),
/* harmony export */   faSortAmountUpAlt: () => (/* binding */ faSortAmountUpAlt),
/* harmony export */   faSortAsc: () => (/* binding */ faSortAsc),
/* harmony export */   faSortDesc: () => (/* binding */ faSortDesc),
/* harmony export */   faSortDown: () => (/* binding */ faSortDown),
/* harmony export */   faSortNumericAsc: () => (/* binding */ faSortNumericAsc),
/* harmony export */   faSortNumericDesc: () => (/* binding */ faSortNumericDesc),
/* harmony export */   faSortNumericDown: () => (/* binding */ faSortNumericDown),
/* harmony export */   faSortNumericDownAlt: () => (/* binding */ faSortNumericDownAlt),
/* harmony export */   faSortNumericUp: () => (/* binding */ faSortNumericUp),
/* harmony export */   faSortNumericUpAlt: () => (/* binding */ faSortNumericUpAlt),
/* harmony export */   faSortUp: () => (/* binding */ faSortUp),
/* harmony export */   faSpa: () => (/* binding */ faSpa),
/* harmony export */   faSpaceShuttle: () => (/* binding */ faSpaceShuttle),
/* harmony export */   faSpaghettiMonsterFlying: () => (/* binding */ faSpaghettiMonsterFlying),
/* harmony export */   faSpellCheck: () => (/* binding */ faSpellCheck),
/* harmony export */   faSpider: () => (/* binding */ faSpider),
/* harmony export */   faSpinner: () => (/* binding */ faSpinner),
/* harmony export */   faSplotch: () => (/* binding */ faSplotch),
/* harmony export */   faSpoon: () => (/* binding */ faSpoon),
/* harmony export */   faSprayCan: () => (/* binding */ faSprayCan),
/* harmony export */   faSprayCanSparkles: () => (/* binding */ faSprayCanSparkles),
/* harmony export */   faSprout: () => (/* binding */ faSprout),
/* harmony export */   faSquare: () => (/* binding */ faSquare),
/* harmony export */   faSquareArrowUpRight: () => (/* binding */ faSquareArrowUpRight),
/* harmony export */   faSquareBinary: () => (/* binding */ faSquareBinary),
/* harmony export */   faSquareCaretDown: () => (/* binding */ faSquareCaretDown),
/* harmony export */   faSquareCaretLeft: () => (/* binding */ faSquareCaretLeft),
/* harmony export */   faSquareCaretRight: () => (/* binding */ faSquareCaretRight),
/* harmony export */   faSquareCaretUp: () => (/* binding */ faSquareCaretUp),
/* harmony export */   faSquareCheck: () => (/* binding */ faSquareCheck),
/* harmony export */   faSquareEnvelope: () => (/* binding */ faSquareEnvelope),
/* harmony export */   faSquareFull: () => (/* binding */ faSquareFull),
/* harmony export */   faSquareH: () => (/* binding */ faSquareH),
/* harmony export */   faSquareMinus: () => (/* binding */ faSquareMinus),
/* harmony export */   faSquareNfi: () => (/* binding */ faSquareNfi),
/* harmony export */   faSquareParking: () => (/* binding */ faSquareParking),
/* harmony export */   faSquarePen: () => (/* binding */ faSquarePen),
/* harmony export */   faSquarePersonConfined: () => (/* binding */ faSquarePersonConfined),
/* harmony export */   faSquarePhone: () => (/* binding */ faSquarePhone),
/* harmony export */   faSquarePhoneFlip: () => (/* binding */ faSquarePhoneFlip),
/* harmony export */   faSquarePlus: () => (/* binding */ faSquarePlus),
/* harmony export */   faSquarePollHorizontal: () => (/* binding */ faSquarePollHorizontal),
/* harmony export */   faSquarePollVertical: () => (/* binding */ faSquarePollVertical),
/* harmony export */   faSquareRootAlt: () => (/* binding */ faSquareRootAlt),
/* harmony export */   faSquareRootVariable: () => (/* binding */ faSquareRootVariable),
/* harmony export */   faSquareRss: () => (/* binding */ faSquareRss),
/* harmony export */   faSquareShareNodes: () => (/* binding */ faSquareShareNodes),
/* harmony export */   faSquareUpRight: () => (/* binding */ faSquareUpRight),
/* harmony export */   faSquareVirus: () => (/* binding */ faSquareVirus),
/* harmony export */   faSquareXmark: () => (/* binding */ faSquareXmark),
/* harmony export */   faStaffAesculapius: () => (/* binding */ faStaffAesculapius),
/* harmony export */   faStaffSnake: () => (/* binding */ faStaffSnake),
/* harmony export */   faStairs: () => (/* binding */ faStairs),
/* harmony export */   faStamp: () => (/* binding */ faStamp),
/* harmony export */   faStapler: () => (/* binding */ faStapler),
/* harmony export */   faStar: () => (/* binding */ faStar),
/* harmony export */   faStarAndCrescent: () => (/* binding */ faStarAndCrescent),
/* harmony export */   faStarHalf: () => (/* binding */ faStarHalf),
/* harmony export */   faStarHalfAlt: () => (/* binding */ faStarHalfAlt),
/* harmony export */   faStarHalfStroke: () => (/* binding */ faStarHalfStroke),
/* harmony export */   faStarOfDavid: () => (/* binding */ faStarOfDavid),
/* harmony export */   faStarOfLife: () => (/* binding */ faStarOfLife),
/* harmony export */   faStepBackward: () => (/* binding */ faStepBackward),
/* harmony export */   faStepForward: () => (/* binding */ faStepForward),
/* harmony export */   faSterlingSign: () => (/* binding */ faSterlingSign),
/* harmony export */   faStethoscope: () => (/* binding */ faStethoscope),
/* harmony export */   faStickyNote: () => (/* binding */ faStickyNote),
/* harmony export */   faStop: () => (/* binding */ faStop),
/* harmony export */   faStopCircle: () => (/* binding */ faStopCircle),
/* harmony export */   faStopwatch: () => (/* binding */ faStopwatch),
/* harmony export */   faStopwatch20: () => (/* binding */ faStopwatch20),
/* harmony export */   faStore: () => (/* binding */ faStore),
/* harmony export */   faStoreAlt: () => (/* binding */ faStoreAlt),
/* harmony export */   faStoreAltSlash: () => (/* binding */ faStoreAltSlash),
/* harmony export */   faStoreSlash: () => (/* binding */ faStoreSlash),
/* harmony export */   faStream: () => (/* binding */ faStream),
/* harmony export */   faStreetView: () => (/* binding */ faStreetView),
/* harmony export */   faStrikethrough: () => (/* binding */ faStrikethrough),
/* harmony export */   faStroopwafel: () => (/* binding */ faStroopwafel),
/* harmony export */   faSubscript: () => (/* binding */ faSubscript),
/* harmony export */   faSubtract: () => (/* binding */ faSubtract),
/* harmony export */   faSubway: () => (/* binding */ faSubway),
/* harmony export */   faSuitcase: () => (/* binding */ faSuitcase),
/* harmony export */   faSuitcaseMedical: () => (/* binding */ faSuitcaseMedical),
/* harmony export */   faSuitcaseRolling: () => (/* binding */ faSuitcaseRolling),
/* harmony export */   faSun: () => (/* binding */ faSun),
/* harmony export */   faSunPlantWilt: () => (/* binding */ faSunPlantWilt),
/* harmony export */   faSuperscript: () => (/* binding */ faSuperscript),
/* harmony export */   faSurprise: () => (/* binding */ faSurprise),
/* harmony export */   faSwatchbook: () => (/* binding */ faSwatchbook),
/* harmony export */   faSwimmer: () => (/* binding */ faSwimmer),
/* harmony export */   faSwimmingPool: () => (/* binding */ faSwimmingPool),
/* harmony export */   faSynagogue: () => (/* binding */ faSynagogue),
/* harmony export */   faSync: () => (/* binding */ faSync),
/* harmony export */   faSyncAlt: () => (/* binding */ faSyncAlt),
/* harmony export */   faSyringe: () => (/* binding */ faSyringe),
/* harmony export */   faT: () => (/* binding */ faT),
/* harmony export */   faTShirt: () => (/* binding */ faTShirt),
/* harmony export */   faTable: () => (/* binding */ faTable),
/* harmony export */   faTableCells: () => (/* binding */ faTableCells),
/* harmony export */   faTableCellsColumnLock: () => (/* binding */ faTableCellsColumnLock),
/* harmony export */   faTableCellsLarge: () => (/* binding */ faTableCellsLarge),
/* harmony export */   faTableCellsRowLock: () => (/* binding */ faTableCellsRowLock),
/* harmony export */   faTableCellsRowUnlock: () => (/* binding */ faTableCellsRowUnlock),
/* harmony export */   faTableColumns: () => (/* binding */ faTableColumns),
/* harmony export */   faTableList: () => (/* binding */ faTableList),
/* harmony export */   faTableTennis: () => (/* binding */ faTableTennis),
/* harmony export */   faTableTennisPaddleBall: () => (/* binding */ faTableTennisPaddleBall),
/* harmony export */   faTablet: () => (/* binding */ faTablet),
/* harmony export */   faTabletAlt: () => (/* binding */ faTabletAlt),
/* harmony export */   faTabletAndroid: () => (/* binding */ faTabletAndroid),
/* harmony export */   faTabletButton: () => (/* binding */ faTabletButton),
/* harmony export */   faTabletScreenButton: () => (/* binding */ faTabletScreenButton),
/* harmony export */   faTablets: () => (/* binding */ faTablets),
/* harmony export */   faTachographDigital: () => (/* binding */ faTachographDigital),
/* harmony export */   faTachometer: () => (/* binding */ faTachometer),
/* harmony export */   faTachometerAlt: () => (/* binding */ faTachometerAlt),
/* harmony export */   faTachometerAltAverage: () => (/* binding */ faTachometerAltAverage),
/* harmony export */   faTachometerAltFast: () => (/* binding */ faTachometerAltFast),
/* harmony export */   faTachometerAverage: () => (/* binding */ faTachometerAverage),
/* harmony export */   faTachometerFast: () => (/* binding */ faTachometerFast),
/* harmony export */   faTag: () => (/* binding */ faTag),
/* harmony export */   faTags: () => (/* binding */ faTags),
/* harmony export */   faTanakh: () => (/* binding */ faTanakh),
/* harmony export */   faTape: () => (/* binding */ faTape),
/* harmony export */   faTarp: () => (/* binding */ faTarp),
/* harmony export */   faTarpDroplet: () => (/* binding */ faTarpDroplet),
/* harmony export */   faTasks: () => (/* binding */ faTasks),
/* harmony export */   faTasksAlt: () => (/* binding */ faTasksAlt),
/* harmony export */   faTaxi: () => (/* binding */ faTaxi),
/* harmony export */   faTeeth: () => (/* binding */ faTeeth),
/* harmony export */   faTeethOpen: () => (/* binding */ faTeethOpen),
/* harmony export */   faTeletype: () => (/* binding */ faTeletype),
/* harmony export */   faTelevision: () => (/* binding */ faTelevision),
/* harmony export */   faTemperature0: () => (/* binding */ faTemperature0),
/* harmony export */   faTemperature1: () => (/* binding */ faTemperature1),
/* harmony export */   faTemperature2: () => (/* binding */ faTemperature2),
/* harmony export */   faTemperature3: () => (/* binding */ faTemperature3),
/* harmony export */   faTemperature4: () => (/* binding */ faTemperature4),
/* harmony export */   faTemperatureArrowDown: () => (/* binding */ faTemperatureArrowDown),
/* harmony export */   faTemperatureArrowUp: () => (/* binding */ faTemperatureArrowUp),
/* harmony export */   faTemperatureDown: () => (/* binding */ faTemperatureDown),
/* harmony export */   faTemperatureEmpty: () => (/* binding */ faTemperatureEmpty),
/* harmony export */   faTemperatureFull: () => (/* binding */ faTemperatureFull),
/* harmony export */   faTemperatureHalf: () => (/* binding */ faTemperatureHalf),
/* harmony export */   faTemperatureHigh: () => (/* binding */ faTemperatureHigh),
/* harmony export */   faTemperatureLow: () => (/* binding */ faTemperatureLow),
/* harmony export */   faTemperatureQuarter: () => (/* binding */ faTemperatureQuarter),
/* harmony export */   faTemperatureThreeQuarters: () => (/* binding */ faTemperatureThreeQuarters),
/* harmony export */   faTemperatureUp: () => (/* binding */ faTemperatureUp),
/* harmony export */   faTenge: () => (/* binding */ faTenge),
/* harmony export */   faTengeSign: () => (/* binding */ faTengeSign),
/* harmony export */   faTent: () => (/* binding */ faTent),
/* harmony export */   faTentArrowDownToLine: () => (/* binding */ faTentArrowDownToLine),
/* harmony export */   faTentArrowLeftRight: () => (/* binding */ faTentArrowLeftRight),
/* harmony export */   faTentArrowTurnLeft: () => (/* binding */ faTentArrowTurnLeft),
/* harmony export */   faTentArrowsDown: () => (/* binding */ faTentArrowsDown),
/* harmony export */   faTents: () => (/* binding */ faTents),
/* harmony export */   faTerminal: () => (/* binding */ faTerminal),
/* harmony export */   faTextHeight: () => (/* binding */ faTextHeight),
/* harmony export */   faTextSlash: () => (/* binding */ faTextSlash),
/* harmony export */   faTextWidth: () => (/* binding */ faTextWidth),
/* harmony export */   faTh: () => (/* binding */ faTh),
/* harmony export */   faThLarge: () => (/* binding */ faThLarge),
/* harmony export */   faThList: () => (/* binding */ faThList),
/* harmony export */   faTheaterMasks: () => (/* binding */ faTheaterMasks),
/* harmony export */   faThermometer: () => (/* binding */ faThermometer),
/* harmony export */   faThermometer0: () => (/* binding */ faThermometer0),
/* harmony export */   faThermometer1: () => (/* binding */ faThermometer1),
/* harmony export */   faThermometer2: () => (/* binding */ faThermometer2),
/* harmony export */   faThermometer3: () => (/* binding */ faThermometer3),
/* harmony export */   faThermometer4: () => (/* binding */ faThermometer4),
/* harmony export */   faThermometerEmpty: () => (/* binding */ faThermometerEmpty),
/* harmony export */   faThermometerFull: () => (/* binding */ faThermometerFull),
/* harmony export */   faThermometerHalf: () => (/* binding */ faThermometerHalf),
/* harmony export */   faThermometerQuarter: () => (/* binding */ faThermometerQuarter),
/* harmony export */   faThermometerThreeQuarters: () => (/* binding */ faThermometerThreeQuarters),
/* harmony export */   faThumbTack: () => (/* binding */ faThumbTack),
/* harmony export */   faThumbTackSlash: () => (/* binding */ faThumbTackSlash),
/* harmony export */   faThumbsDown: () => (/* binding */ faThumbsDown),
/* harmony export */   faThumbsUp: () => (/* binding */ faThumbsUp),
/* harmony export */   faThumbtack: () => (/* binding */ faThumbtack),
/* harmony export */   faThumbtackSlash: () => (/* binding */ faThumbtackSlash),
/* harmony export */   faThunderstorm: () => (/* binding */ faThunderstorm),
/* harmony export */   faTicket: () => (/* binding */ faTicket),
/* harmony export */   faTicketAlt: () => (/* binding */ faTicketAlt),
/* harmony export */   faTicketSimple: () => (/* binding */ faTicketSimple),
/* harmony export */   faTimeline: () => (/* binding */ faTimeline),
/* harmony export */   faTimes: () => (/* binding */ faTimes),
/* harmony export */   faTimesCircle: () => (/* binding */ faTimesCircle),
/* harmony export */   faTimesRectangle: () => (/* binding */ faTimesRectangle),
/* harmony export */   faTimesSquare: () => (/* binding */ faTimesSquare),
/* harmony export */   faTint: () => (/* binding */ faTint),
/* harmony export */   faTintSlash: () => (/* binding */ faTintSlash),
/* harmony export */   faTired: () => (/* binding */ faTired),
/* harmony export */   faToggleOff: () => (/* binding */ faToggleOff),
/* harmony export */   faToggleOn: () => (/* binding */ faToggleOn),
/* harmony export */   faToilet: () => (/* binding */ faToilet),
/* harmony export */   faToiletPaper: () => (/* binding */ faToiletPaper),
/* harmony export */   faToiletPaperSlash: () => (/* binding */ faToiletPaperSlash),
/* harmony export */   faToiletPortable: () => (/* binding */ faToiletPortable),
/* harmony export */   faToiletsPortable: () => (/* binding */ faToiletsPortable),
/* harmony export */   faToolbox: () => (/* binding */ faToolbox),
/* harmony export */   faTools: () => (/* binding */ faTools),
/* harmony export */   faTooth: () => (/* binding */ faTooth),
/* harmony export */   faTorah: () => (/* binding */ faTorah),
/* harmony export */   faToriiGate: () => (/* binding */ faToriiGate),
/* harmony export */   faTornado: () => (/* binding */ faTornado),
/* harmony export */   faTowerBroadcast: () => (/* binding */ faTowerBroadcast),
/* harmony export */   faTowerCell: () => (/* binding */ faTowerCell),
/* harmony export */   faTowerObservation: () => (/* binding */ faTowerObservation),
/* harmony export */   faTractor: () => (/* binding */ faTractor),
/* harmony export */   faTrademark: () => (/* binding */ faTrademark),
/* harmony export */   faTrafficLight: () => (/* binding */ faTrafficLight),
/* harmony export */   faTrailer: () => (/* binding */ faTrailer),
/* harmony export */   faTrain: () => (/* binding */ faTrain),
/* harmony export */   faTrainSubway: () => (/* binding */ faTrainSubway),
/* harmony export */   faTrainTram: () => (/* binding */ faTrainTram),
/* harmony export */   faTram: () => (/* binding */ faTram),
/* harmony export */   faTransgender: () => (/* binding */ faTransgender),
/* harmony export */   faTransgenderAlt: () => (/* binding */ faTransgenderAlt),
/* harmony export */   faTrash: () => (/* binding */ faTrash),
/* harmony export */   faTrashAlt: () => (/* binding */ faTrashAlt),
/* harmony export */   faTrashArrowUp: () => (/* binding */ faTrashArrowUp),
/* harmony export */   faTrashCan: () => (/* binding */ faTrashCan),
/* harmony export */   faTrashCanArrowUp: () => (/* binding */ faTrashCanArrowUp),
/* harmony export */   faTrashRestore: () => (/* binding */ faTrashRestore),
/* harmony export */   faTrashRestoreAlt: () => (/* binding */ faTrashRestoreAlt),
/* harmony export */   faTree: () => (/* binding */ faTree),
/* harmony export */   faTreeCity: () => (/* binding */ faTreeCity),
/* harmony export */   faTriangleCircleSquare: () => (/* binding */ faTriangleCircleSquare),
/* harmony export */   faTriangleExclamation: () => (/* binding */ faTriangleExclamation),
/* harmony export */   faTrophy: () => (/* binding */ faTrophy),
/* harmony export */   faTrowel: () => (/* binding */ faTrowel),
/* harmony export */   faTrowelBricks: () => (/* binding */ faTrowelBricks),
/* harmony export */   faTruck: () => (/* binding */ faTruck),
/* harmony export */   faTruckArrowRight: () => (/* binding */ faTruckArrowRight),
/* harmony export */   faTruckDroplet: () => (/* binding */ faTruckDroplet),
/* harmony export */   faTruckFast: () => (/* binding */ faTruckFast),
/* harmony export */   faTruckField: () => (/* binding */ faTruckField),
/* harmony export */   faTruckFieldUn: () => (/* binding */ faTruckFieldUn),
/* harmony export */   faTruckFront: () => (/* binding */ faTruckFront),
/* harmony export */   faTruckLoading: () => (/* binding */ faTruckLoading),
/* harmony export */   faTruckMedical: () => (/* binding */ faTruckMedical),
/* harmony export */   faTruckMonster: () => (/* binding */ faTruckMonster),
/* harmony export */   faTruckMoving: () => (/* binding */ faTruckMoving),
/* harmony export */   faTruckPickup: () => (/* binding */ faTruckPickup),
/* harmony export */   faTruckPlane: () => (/* binding */ faTruckPlane),
/* harmony export */   faTruckRampBox: () => (/* binding */ faTruckRampBox),
/* harmony export */   faTry: () => (/* binding */ faTry),
/* harmony export */   faTshirt: () => (/* binding */ faTshirt),
/* harmony export */   faTty: () => (/* binding */ faTty),
/* harmony export */   faTurkishLira: () => (/* binding */ faTurkishLira),
/* harmony export */   faTurkishLiraSign: () => (/* binding */ faTurkishLiraSign),
/* harmony export */   faTurnDown: () => (/* binding */ faTurnDown),
/* harmony export */   faTurnUp: () => (/* binding */ faTurnUp),
/* harmony export */   faTv: () => (/* binding */ faTv),
/* harmony export */   faTvAlt: () => (/* binding */ faTvAlt),
/* harmony export */   faU: () => (/* binding */ faU),
/* harmony export */   faUmbrella: () => (/* binding */ faUmbrella),
/* harmony export */   faUmbrellaBeach: () => (/* binding */ faUmbrellaBeach),
/* harmony export */   faUnderline: () => (/* binding */ faUnderline),
/* harmony export */   faUndo: () => (/* binding */ faUndo),
/* harmony export */   faUndoAlt: () => (/* binding */ faUndoAlt),
/* harmony export */   faUniversalAccess: () => (/* binding */ faUniversalAccess),
/* harmony export */   faUniversity: () => (/* binding */ faUniversity),
/* harmony export */   faUnlink: () => (/* binding */ faUnlink),
/* harmony export */   faUnlock: () => (/* binding */ faUnlock),
/* harmony export */   faUnlockAlt: () => (/* binding */ faUnlockAlt),
/* harmony export */   faUnlockKeyhole: () => (/* binding */ faUnlockKeyhole),
/* harmony export */   faUnsorted: () => (/* binding */ faUnsorted),
/* harmony export */   faUpDown: () => (/* binding */ faUpDown),
/* harmony export */   faUpDownLeftRight: () => (/* binding */ faUpDownLeftRight),
/* harmony export */   faUpLong: () => (/* binding */ faUpLong),
/* harmony export */   faUpRightAndDownLeftFromCenter: () => (/* binding */ faUpRightAndDownLeftFromCenter),
/* harmony export */   faUpRightFromSquare: () => (/* binding */ faUpRightFromSquare),
/* harmony export */   faUpload: () => (/* binding */ faUpload),
/* harmony export */   faUsd: () => (/* binding */ faUsd),
/* harmony export */   faUser: () => (/* binding */ faUser),
/* harmony export */   faUserAlt: () => (/* binding */ faUserAlt),
/* harmony export */   faUserAltSlash: () => (/* binding */ faUserAltSlash),
/* harmony export */   faUserAstronaut: () => (/* binding */ faUserAstronaut),
/* harmony export */   faUserCheck: () => (/* binding */ faUserCheck),
/* harmony export */   faUserCircle: () => (/* binding */ faUserCircle),
/* harmony export */   faUserClock: () => (/* binding */ faUserClock),
/* harmony export */   faUserCog: () => (/* binding */ faUserCog),
/* harmony export */   faUserDoctor: () => (/* binding */ faUserDoctor),
/* harmony export */   faUserEdit: () => (/* binding */ faUserEdit),
/* harmony export */   faUserFriends: () => (/* binding */ faUserFriends),
/* harmony export */   faUserGear: () => (/* binding */ faUserGear),
/* harmony export */   faUserGraduate: () => (/* binding */ faUserGraduate),
/* harmony export */   faUserGroup: () => (/* binding */ faUserGroup),
/* harmony export */   faUserInjured: () => (/* binding */ faUserInjured),
/* harmony export */   faUserLarge: () => (/* binding */ faUserLarge),
/* harmony export */   faUserLargeSlash: () => (/* binding */ faUserLargeSlash),
/* harmony export */   faUserLock: () => (/* binding */ faUserLock),
/* harmony export */   faUserMd: () => (/* binding */ faUserMd),
/* harmony export */   faUserMinus: () => (/* binding */ faUserMinus),
/* harmony export */   faUserNinja: () => (/* binding */ faUserNinja),
/* harmony export */   faUserNurse: () => (/* binding */ faUserNurse),
/* harmony export */   faUserPen: () => (/* binding */ faUserPen),
/* harmony export */   faUserPlus: () => (/* binding */ faUserPlus),
/* harmony export */   faUserSecret: () => (/* binding */ faUserSecret),
/* harmony export */   faUserShield: () => (/* binding */ faUserShield),
/* harmony export */   faUserSlash: () => (/* binding */ faUserSlash),
/* harmony export */   faUserTag: () => (/* binding */ faUserTag),
/* harmony export */   faUserTie: () => (/* binding */ faUserTie),
/* harmony export */   faUserTimes: () => (/* binding */ faUserTimes),
/* harmony export */   faUserXmark: () => (/* binding */ faUserXmark),
/* harmony export */   faUsers: () => (/* binding */ faUsers),
/* harmony export */   faUsersBetweenLines: () => (/* binding */ faUsersBetweenLines),
/* harmony export */   faUsersCog: () => (/* binding */ faUsersCog),
/* harmony export */   faUsersGear: () => (/* binding */ faUsersGear),
/* harmony export */   faUsersLine: () => (/* binding */ faUsersLine),
/* harmony export */   faUsersRays: () => (/* binding */ faUsersRays),
/* harmony export */   faUsersRectangle: () => (/* binding */ faUsersRectangle),
/* harmony export */   faUsersSlash: () => (/* binding */ faUsersSlash),
/* harmony export */   faUsersViewfinder: () => (/* binding */ faUsersViewfinder),
/* harmony export */   faUtensilSpoon: () => (/* binding */ faUtensilSpoon),
/* harmony export */   faUtensils: () => (/* binding */ faUtensils),
/* harmony export */   faV: () => (/* binding */ faV),
/* harmony export */   faVanShuttle: () => (/* binding */ faVanShuttle),
/* harmony export */   faVault: () => (/* binding */ faVault),
/* harmony export */   faVcard: () => (/* binding */ faVcard),
/* harmony export */   faVectorSquare: () => (/* binding */ faVectorSquare),
/* harmony export */   faVenus: () => (/* binding */ faVenus),
/* harmony export */   faVenusDouble: () => (/* binding */ faVenusDouble),
/* harmony export */   faVenusMars: () => (/* binding */ faVenusMars),
/* harmony export */   faVest: () => (/* binding */ faVest),
/* harmony export */   faVestPatches: () => (/* binding */ faVestPatches),
/* harmony export */   faVial: () => (/* binding */ faVial),
/* harmony export */   faVialCircleCheck: () => (/* binding */ faVialCircleCheck),
/* harmony export */   faVialVirus: () => (/* binding */ faVialVirus),
/* harmony export */   faVials: () => (/* binding */ faVials),
/* harmony export */   faVideo: () => (/* binding */ faVideo),
/* harmony export */   faVideoCamera: () => (/* binding */ faVideoCamera),
/* harmony export */   faVideoSlash: () => (/* binding */ faVideoSlash),
/* harmony export */   faVihara: () => (/* binding */ faVihara),
/* harmony export */   faVirus: () => (/* binding */ faVirus),
/* harmony export */   faVirusCovid: () => (/* binding */ faVirusCovid),
/* harmony export */   faVirusCovidSlash: () => (/* binding */ faVirusCovidSlash),
/* harmony export */   faVirusSlash: () => (/* binding */ faVirusSlash),
/* harmony export */   faViruses: () => (/* binding */ faViruses),
/* harmony export */   faVoicemail: () => (/* binding */ faVoicemail),
/* harmony export */   faVolcano: () => (/* binding */ faVolcano),
/* harmony export */   faVolleyball: () => (/* binding */ faVolleyball),
/* harmony export */   faVolleyballBall: () => (/* binding */ faVolleyballBall),
/* harmony export */   faVolumeControlPhone: () => (/* binding */ faVolumeControlPhone),
/* harmony export */   faVolumeDown: () => (/* binding */ faVolumeDown),
/* harmony export */   faVolumeHigh: () => (/* binding */ faVolumeHigh),
/* harmony export */   faVolumeLow: () => (/* binding */ faVolumeLow),
/* harmony export */   faVolumeMute: () => (/* binding */ faVolumeMute),
/* harmony export */   faVolumeOff: () => (/* binding */ faVolumeOff),
/* harmony export */   faVolumeTimes: () => (/* binding */ faVolumeTimes),
/* harmony export */   faVolumeUp: () => (/* binding */ faVolumeUp),
/* harmony export */   faVolumeXmark: () => (/* binding */ faVolumeXmark),
/* harmony export */   faVoteYea: () => (/* binding */ faVoteYea),
/* harmony export */   faVrCardboard: () => (/* binding */ faVrCardboard),
/* harmony export */   faW: () => (/* binding */ faW),
/* harmony export */   faWalkieTalkie: () => (/* binding */ faWalkieTalkie),
/* harmony export */   faWalking: () => (/* binding */ faWalking),
/* harmony export */   faWallet: () => (/* binding */ faWallet),
/* harmony export */   faWandMagic: () => (/* binding */ faWandMagic),
/* harmony export */   faWandMagicSparkles: () => (/* binding */ faWandMagicSparkles),
/* harmony export */   faWandSparkles: () => (/* binding */ faWandSparkles),
/* harmony export */   faWarehouse: () => (/* binding */ faWarehouse),
/* harmony export */   faWarning: () => (/* binding */ faWarning),
/* harmony export */   faWater: () => (/* binding */ faWater),
/* harmony export */   faWaterLadder: () => (/* binding */ faWaterLadder),
/* harmony export */   faWaveSquare: () => (/* binding */ faWaveSquare),
/* harmony export */   faWebAwesome: () => (/* binding */ faWebAwesome),
/* harmony export */   faWeight: () => (/* binding */ faWeight),
/* harmony export */   faWeightHanging: () => (/* binding */ faWeightHanging),
/* harmony export */   faWeightScale: () => (/* binding */ faWeightScale),
/* harmony export */   faWheatAlt: () => (/* binding */ faWheatAlt),
/* harmony export */   faWheatAwn: () => (/* binding */ faWheatAwn),
/* harmony export */   faWheatAwnCircleExclamation: () => (/* binding */ faWheatAwnCircleExclamation),
/* harmony export */   faWheelchair: () => (/* binding */ faWheelchair),
/* harmony export */   faWheelchairAlt: () => (/* binding */ faWheelchairAlt),
/* harmony export */   faWheelchairMove: () => (/* binding */ faWheelchairMove),
/* harmony export */   faWhiskeyGlass: () => (/* binding */ faWhiskeyGlass),
/* harmony export */   faWifi: () => (/* binding */ faWifi),
/* harmony export */   faWifi3: () => (/* binding */ faWifi3),
/* harmony export */   faWifiStrong: () => (/* binding */ faWifiStrong),
/* harmony export */   faWind: () => (/* binding */ faWind),
/* harmony export */   faWindowClose: () => (/* binding */ faWindowClose),
/* harmony export */   faWindowMaximize: () => (/* binding */ faWindowMaximize),
/* harmony export */   faWindowMinimize: () => (/* binding */ faWindowMinimize),
/* harmony export */   faWindowRestore: () => (/* binding */ faWindowRestore),
/* harmony export */   faWineBottle: () => (/* binding */ faWineBottle),
/* harmony export */   faWineGlass: () => (/* binding */ faWineGlass),
/* harmony export */   faWineGlassAlt: () => (/* binding */ faWineGlassAlt),
/* harmony export */   faWineGlassEmpty: () => (/* binding */ faWineGlassEmpty),
/* harmony export */   faWon: () => (/* binding */ faWon),
/* harmony export */   faWonSign: () => (/* binding */ faWonSign),
/* harmony export */   faWorm: () => (/* binding */ faWorm),
/* harmony export */   faWrench: () => (/* binding */ faWrench),
/* harmony export */   faX: () => (/* binding */ faX),
/* harmony export */   faXRay: () => (/* binding */ faXRay),
/* harmony export */   faXmark: () => (/* binding */ faXmark),
/* harmony export */   faXmarkCircle: () => (/* binding */ faXmarkCircle),
/* harmony export */   faXmarkSquare: () => (/* binding */ faXmarkSquare),
/* harmony export */   faXmarksLines: () => (/* binding */ faXmarksLines),
/* harmony export */   faY: () => (/* binding */ faY),
/* harmony export */   faYen: () => (/* binding */ faYen),
/* harmony export */   faYenSign: () => (/* binding */ faYenSign),
/* harmony export */   faYinYang: () => (/* binding */ faYinYang),
/* harmony export */   faZ: () => (/* binding */ faZ),
/* harmony export */   faZap: () => (/* binding */ faZap),
/* harmony export */   fas: () => (/* binding */ icons),
/* harmony export */   prefix: () => (/* binding */ prefix)
/* harmony export */ });
/*!
 * Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com
 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
 * Copyright 2024 Fonticons, Inc.
 */
const prefix = "fas";
const fa0 = {
  prefix: 'fas',
  iconName: '0',
  icon: [320, 512, [], "30", "M0 192C0 103.6 71.6 32 160 32s160 71.6 160 160l0 128c0 88.4-71.6 160-160 160S0 408.4 0 320L0 192zM160 96c-53 0-96 43-96 96l0 128c0 53 43 96 96 96s96-43 96-96l0-128c0-53-43-96-96-96z"]
};
const fa1 = {
  prefix: 'fas',
  iconName: '1',
  icon: [256, 512, [], "31", "M160 64c0-11.8-6.5-22.6-16.9-28.2s-23-5-32.8 1.6l-96 64C-.5 111.2-4.4 131 5.4 145.8s29.7 18.7 44.4 8.9L96 123.8 96 416l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-352z"]
};
const fa2 = {
  prefix: 'fas',
  iconName: '2',
  icon: [320, 512, [], "32", "M142.9 96c-21.5 0-42.2 8.5-57.4 23.8L54.6 150.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L40.2 74.5C67.5 47.3 104.4 32 142.9 32C223 32 288 97 288 177.1c0 38.5-15.3 75.4-42.5 102.6L109.3 416 288 416c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L200.2 234.5c15.2-15.2 23.8-35.9 23.8-57.4c0-44.8-36.3-81.1-81.1-81.1z"]
};
const fa3 = {
  prefix: 'fas',
  iconName: '3',
  icon: [320, 512, [], "33", "M0 64C0 46.3 14.3 32 32 32l240 0c13.2 0 25 8.1 29.8 20.4s1.5 26.3-8.2 35.2L162.3 208l21.7 0c75.1 0 136 60.9 136 136s-60.9 136-136 136l-78.6 0C63 480 24.2 456 5.3 418.1l-1.9-3.8c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l1.9 3.8c8.1 16.3 24.8 26.5 42.9 26.5l78.6 0c39.8 0 72-32.2 72-72s-32.2-72-72-72L80 272c-13.2 0-25-8.1-29.8-20.4s-1.5-26.3 8.2-35.2L189.7 96 32 96C14.3 96 0 81.7 0 64z"]
};
const fa4 = {
  prefix: 'fas',
  iconName: '4',
  icon: [384, 512, [], "34", "M189 77.6c7.5-16 .7-35.1-15.3-42.6s-35.1-.7-42.6 15.3L3 322.4c-4.7 9.9-3.9 21.5 1.9 30.8S21 368 32 368l224 0 0 80c0 17.7 14.3 32 32 32s32-14.3 32-32l0-80 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-144c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L82.4 304 189 77.6z"]
};
const fa5 = {
  prefix: 'fas',
  iconName: '5',
  icon: [320, 512, [], "35", "M32.5 58.3C35.3 43.1 48.5 32 64 32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L90.7 96 70.3 208 184 208c75.1 0 136 60.9 136 136s-60.9 136-136 136l-83.5 0c-39.4 0-75.4-22.3-93-57.5l-4.1-8.2c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l4.1 8.2c6.8 13.6 20.6 22.1 35.8 22.1l83.5 0c39.8 0 72-32.2 72-72s-32.2-72-72-72L32 272c-9.5 0-18.5-4.2-24.6-11.5s-8.6-16.9-6.9-26.2l32-176z"]
};
const fa6 = {
  prefix: 'fas',
  iconName: '6',
  icon: [320, 512, [], "36", "M232.4 84.7c11.4-13.5 9.7-33.7-3.8-45.1s-33.7-9.7-45.1 3.8L38.6 214.7C14.7 242.9 1.1 278.4 .1 315.2c0 1.4-.1 2.9-.1 4.3l0 .5c0 88.4 71.6 160 160 160s160-71.6 160-160c0-85.5-67.1-155.4-151.5-159.8l63.9-75.6zM256 320A96 96 0 1 1 64 320a96 96 0 1 1 192 0z"]
};
const fa7 = {
  prefix: 'fas',
  iconName: '7',
  icon: [320, 512, [], "37", "M0 64C0 46.3 14.3 32 32 32l256 0c11.5 0 22 6.1 27.7 16.1s5.7 22.2-.1 32.1l-224 384c-8.9 15.3-28.5 20.4-43.8 11.5s-20.4-28.5-11.5-43.8L232.3 96 32 96C14.3 96 0 81.7 0 64z"]
};
const fa8 = {
  prefix: 'fas',
  iconName: '8',
  icon: [320, 512, [], "38", "M304 160c0-70.7-57.3-128-128-128l-32 0C73.3 32 16 89.3 16 160c0 34.6 13.7 66 36 89C20.5 272.3 0 309.8 0 352c0 70.7 57.3 128 128 128l64 0c70.7 0 128-57.3 128-128c0-42.2-20.5-79.7-52-103c22.3-23 36-54.4 36-89zM176.1 288l15.9 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64s28.7-64 64-64l15.9 0c0 0 .1 0 .1 0l32 0c0 0 .1 0 .1 0zm0-64c0 0 0 0 0 0l-32 0c0 0 0 0 0 0c-35.3 0-64-28.7-64-64c0-35.3 28.7-64 64-64l32 0c35.3 0 64 28.7 64 64c0 35.3-28.6 64-64 64z"]
};
const fa9 = {
  prefix: 'fas',
  iconName: '9',
  icon: [320, 512, [], "39", "M64 192a96 96 0 1 0 192 0A96 96 0 1 0 64 192zm87.5 159.8C67.1 347.4 0 277.5 0 192C0 103.6 71.6 32 160 32s160 71.6 160 160c0 2.6-.1 5.3-.2 7.9c-1.7 35.7-15.2 70-38.4 97.4l-145 171.4c-11.4 13.5-31.6 15.2-45.1 3.8s-15.2-31.6-3.8-45.1l63.9-75.6z"]
};
const faFillDrip = {
  prefix: 'fas',
  iconName: 'fill-drip',
  icon: [576, 512, [], "f576", "M41.4 9.4C53.9-3.1 74.1-3.1 86.6 9.4L168 90.7l53.1-53.1c28.1-28.1 73.7-28.1 101.8 0L474.3 189.1c28.1 28.1 28.1 73.7 0 101.8L283.9 481.4c-37.5 37.5-98.3 37.5-135.8 0L30.6 363.9c-37.5-37.5-37.5-98.3 0-135.8L122.7 136 41.4 54.6c-12.5-12.5-12.5-32.8 0-45.3zm176 221.3L168 181.3 75.9 273.4c-4.2 4.2-7 9.3-8.4 14.6l319.2 0 42.3-42.3c3.1-3.1 3.1-8.2 0-11.3L277.7 82.9c-3.1-3.1-8.2-3.1-11.3 0L213.3 136l49.4 49.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0zM512 512c-35.3 0-64-28.7-64-64c0-25.2 32.6-79.6 51.2-108.7c6-9.4 19.5-9.4 25.5 0C543.4 368.4 576 422.8 576 448c0 35.3-28.7 64-64 64z"]
};
const faArrowsToCircle = {
  prefix: 'fas',
  iconName: 'arrows-to-circle',
  icon: [640, 512, [], "e4bd", "M9.4 9.4C21.9-3.1 42.1-3.1 54.6 9.4L160 114.7 160 96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96c0 4.3-.9 8.5-2.4 12.2c-1.6 3.7-3.8 7.3-6.9 10.3l-.1 .1c-3.1 3-6.6 5.3-10.3 6.9c-3.8 1.6-7.9 2.4-12.2 2.4l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.7 0L9.4 54.6C-3.1 42.1-3.1 21.9 9.4 9.4zM256 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM114.7 352L96 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0s0 0 0 0l.1 0c8.8 0 16.7 3.6 22.5 9.3l.1 .1c3 3.1 5.3 6.6 6.9 10.3c1.6 3.8 2.4 7.9 2.4 12.2l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.7L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L114.7 352zM416 96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 18.7L585.4 9.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L525.3 160l18.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-8.8 0-16.8-3.6-22.6-9.3l-.1-.1c-3-3.1-5.3-6.6-6.9-10.3s-2.4-7.8-2.4-12.2l0-.1s0 0 0 0l0-96zM525.3 352L630.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L480 397.3l0 18.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96s0 0 0 0l0-.1c0-4.3 .9-8.4 2.4-12.2c1.6-3.8 3.9-7.3 6.9-10.4c5.8-5.8 13.7-9.3 22.5-9.4l.1 0s0 0 0 0l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.7 0z"]
};
const faCircleChevronRight = {
  prefix: 'fas',
  iconName: 'circle-chevron-right',
  icon: [512, 512, ["chevron-circle-right"], "f138", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM241 377c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l87-87-87-87c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L345 239c9.4 9.4 9.4 24.6 0 33.9L241 377z"]
};
const faChevronCircleRight = faCircleChevronRight;
const faAt = {
  prefix: 'fas',
  iconName: 'at',
  icon: [512, 512, [61946], "40", "M256 64C150 64 64 150 64 256s86 192 192 192c17.7 0 32 14.3 32 32s-14.3 32-32 32C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256l0 32c0 53-43 96-96 96c-29.3 0-55.6-13.2-73.2-33.9C320 371.1 289.5 384 256 384c-70.7 0-128-57.3-128-128s57.3-128 128-128c27.9 0 53.7 8.9 74.7 24.1c5.7-5 13.1-8.1 21.3-8.1c17.7 0 32 14.3 32 32l0 80 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32c0-106-86-192-192-192zm64 192a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faTrashCan = {
  prefix: 'fas',
  iconName: 'trash-can',
  icon: [448, 512, [61460, "trash-alt"], "f2ed", "M135.2 17.7C140.6 6.8 151.7 0 163.8 0L284.2 0c12.1 0 23.2 6.8 28.6 17.7L320 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 7.2-14.3zM32 128l384 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-320zm96 64c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16z"]
};
const faTrashAlt = faTrashCan;
const faTextHeight = {
  prefix: 'fas',
  iconName: 'text-height',
  icon: [576, 512, [], "f034", "M64 128l0-32 64 0 0 320-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-320 64 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48c0-26.5-21.5-48-48-48L160 32 48 32C21.5 32 0 53.5 0 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32zM502.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 192-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0 0-192 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z"]
};
const faUserXmark = {
  prefix: 'fas',
  iconName: 'user-xmark',
  icon: [640, 512, ["user-times"], "f235", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM471 143c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faUserTimes = faUserXmark;
const faStethoscope = {
  prefix: 'fas',
  iconName: 'stethoscope',
  icon: [576, 512, [129658], "f0f1", "M142.4 21.9c5.6 16.8-3.5 34.9-20.2 40.5L96 71.1 96 192c0 53 43 96 96 96s96-43 96-96l0-120.9-26.1-8.7c-16.8-5.6-25.8-23.7-20.2-40.5s23.7-25.8 40.5-20.2l26.1 8.7C334.4 19.1 352 43.5 352 71.1L352 192c0 77.2-54.6 141.6-127.3 156.7C231 404.6 278.4 448 336 448c61.9 0 112-50.1 112-112l0-70.7c-28.3-12.3-48-40.5-48-73.3c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3l0 70.7c0 97.2-78.8 176-176 176c-92.9 0-168.9-71.9-175.5-163.1C87.2 334.2 32 269.6 32 192L32 71.1c0-27.5 17.6-52 43.8-60.7l26.1-8.7c16.8-5.6 34.9 3.5 40.5 20.2zM480 224a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faMessage = {
  prefix: 'fas',
  iconName: 'message',
  icon: [512, 512, ["comment-alt"], "f27a", "M64 0C28.7 0 0 28.7 0 64L0 352c0 35.3 28.7 64 64 64l96 0 0 80c0 6.1 3.4 11.6 8.8 14.3s11.9 2.1 16.8-1.5L309.3 416 448 416c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64L64 0z"]
};
const faCommentAlt = faMessage;
const faInfo = {
  prefix: 'fas',
  iconName: 'info',
  icon: [192, 512, [], "f129", "M48 80a48 48 0 1 1 96 0A48 48 0 1 1 48 80zM0 224c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 224 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-192-32 0c-17.7 0-32-14.3-32-32z"]
};
const faDownLeftAndUpRightToCenter = {
  prefix: 'fas',
  iconName: 'down-left-and-up-right-to-center',
  icon: [512, 512, ["compress-alt"], "f422", "M439 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39L439 7zM72 272l144 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39L73 505c-9.4 9.4-24.6 9.4-33.9 0L7 473c-9.4-9.4-9.4-24.6 0-33.9l87-87L55 313c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8z"]
};
const faCompressAlt = faDownLeftAndUpRightToCenter;
const faExplosion = {
  prefix: 'fas',
  iconName: 'explosion',
  icon: [576, 512, [], "e4e9", "M499.6 11.3c6.7-10.7 20.5-14.5 31.7-8.5s15.8 19.5 10.6 31L404.8 338.6c2.2 2.3 4.3 4.7 6.3 7.1l97.2-54.7c10.5-5.9 23.6-3.1 30.9 6.4s6.3 23-2.2 31.5l-87 87-71.4 0c-13.2-37.3-48.7-64-90.5-64s-77.4 26.7-90.5 64l-79.6 0L42.3 363.7c-9.7-6.7-13.1-19.6-7.9-30.3s17.4-15.9 28.7-12.4l97.2 30.4c3-3.9 6.1-7.7 9.4-11.3L107.4 236.3c-6.1-10.1-3.9-23.1 5.1-30.7s22.2-7.5 31.1 .1L246 293.6c1.5-.4 3-.8 4.5-1.1l13.6-142.7c1.2-12.3 11.5-21.7 23.9-21.7s22.7 9.4 23.9 21.7l13.5 141.9L499.6 11.3zM64 448s0 0 0 0l448 0s0 0 0 0l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0zM288 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24z"]
};
const faFileLines = {
  prefix: 'fas',
  iconName: 'file-lines',
  icon: [384, 512, [128441, 128462, 61686, "file-alt", "file-text"], "f15c", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM112 256l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faFileAlt = faFileLines;
const faFileText = faFileLines;
const faWaveSquare = {
  prefix: 'fas',
  iconName: 'wave-square',
  icon: [640, 512, [], "f83e", "M128 64c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 352 96 0 0-160c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0 0 160c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-352-96 0 0 160c0 17.7-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0 0-160z"]
};
const faRing = {
  prefix: 'fas',
  iconName: 'ring',
  icon: [512, 512, [], "f70b", "M64 208c0 7.8 4.4 18.7 17.1 30.3C126.5 214.1 188.9 200 256 200s129.5 14.1 174.9 38.3C443.6 226.7 448 215.8 448 208c0-12.3-10.8-32-47.9-50.6C364.9 139.8 314 128 256 128s-108.9 11.8-144.1 29.4C74.8 176 64 195.7 64 208zm192 40c-47 0-89.3 7.6-122.9 19.7C166.3 280.2 208.8 288 256 288s89.7-7.8 122.9-20.3C345.3 255.6 303 248 256 248zM0 208c0-49.6 39.4-85.8 83.3-107.8C129.1 77.3 190.3 64 256 64s126.9 13.3 172.7 36.2c43.9 22 83.3 58.2 83.3 107.8l0 96c0 49.6-39.4 85.8-83.3 107.8C382.9 434.7 321.7 448 256 448s-126.9-13.3-172.7-36.2C39.4 389.8 0 353.6 0 304l0-96z"]
};
const faBuildingUn = {
  prefix: 'fas',
  iconName: 'building-un',
  icon: [384, 512, [], "e4d9", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c26.5 0 48-21.5 48-48l0-416c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM237.3 71.1l34.7 52L272 80c0-8.8 7.2-16 16-16s16 7.2 16 16l0 96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52 0 43.2c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM112 80l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faDiceThree = {
  prefix: 'fas',
  iconName: 'dice-three',
  icon: [448, 512, [9858], "f527", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm128 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faCalendarDays = {
  prefix: 'fas',
  iconName: 'calendar-days',
  icon: [448, 512, ["calendar-alt"], "f073", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm64 80l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 400l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faCalendarAlt = faCalendarDays;
const faAnchorCircleCheck = {
  prefix: 'fas',
  iconName: 'anchor-circle-check',
  icon: [640, 512, [], "e4aa", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c8.2 0 16.3-.6 24.2-1.8c-22.2-16.2-40.4-37.5-53-62.2L320 448l0-80 0-128 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faBuildingCircleArrowRight = {
  prefix: 'fas',
  iconName: 'building-circle-arrow-right',
  icon: [640, 512, [], "e4d1", "M0 48C0 21.5 21.5 0 48 0L336 0c26.5 0 48 21.5 48 48l0 184.2c-39.1 32.3-64 81.1-64 135.8c0 49.5 20.4 94.2 53.3 126.2C364.5 505.1 351.1 512 336 512l-96 0 0-80c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 80-96 0c-26.5 0-48-21.5-48-48L0 48zM80 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm112-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L80 96c-8.8 0-16 7.2-16 16zM176 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm96 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm140.7-67.3c-6.2 6.2-6.2 16.4 0 22.6L521.4 352 432 352c-8.8 0-16 7.2-16 16s7.2 16 16 16l89.4 0-28.7 28.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l56-56c6.2-6.2 6.2-16.4 0-22.6l-56-56c-6.2-6.2-16.4-6.2-22.6 0z"]
};
const faVolleyball = {
  prefix: 'fas',
  iconName: 'volleyball',
  icon: [512, 512, [127952, "volleyball-ball"], "f45f", "M511.8 267.4c-26.1 8.7-53.4 13.8-81 15.1c9.2-105.3-31.5-204.2-103.2-272.4C434.1 41.1 512 139.5 512 256c0 3.8-.1 7.6-.2 11.4zm-3.9 34.7c-5.8 32-17.6 62-34.2 88.7c-97.5 48.5-217.7 42.6-311.9-24.5c23.7-36.2 55.4-67.7 94.5-91.8c79.9 43.2 170.1 50.8 251.6 27.6zm-236-55.5c-2.5-90.9-41.1-172.7-101.9-231.7C196.8 5.2 225.8 0 256 0c2.7 0 5.3 0 7.9 .1c90.8 60.2 145.7 167.2 134.7 282.3c-43.1-2.4-86.4-14.1-126.8-35.9zM138 28.8c20.6 18.3 38.7 39.4 53.7 62.6C95.9 136.1 30.6 220.8 7.3 316.9C2.5 297.4 0 277 0 256C0 157.2 56 71.5 138 28.8zm69.6 90.5c19.5 38.6 31 81.9 32.3 127.7C162.5 294.6 110.9 368.9 90.2 451C66 430.4 45.6 405.4 30.4 377.2c6.7-108.7 71.9-209.9 177.1-257.9zM256 512c-50.7 0-98-14.7-137.8-40.2c5.6-27 14.8-53.1 27.4-77.7C232.2 454.6 338.1 468.8 433 441c-46 44-108.3 71-177 71z"]
};
const faVolleyballBall = faVolleyball;
const faArrowsUpToLine = {
  prefix: 'fas',
  iconName: 'arrows-up-to-line',
  icon: [576, 512, [], "e4c2", "M32 96l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96zM9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 237.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0l-96 96zm320 45.3c12.5 12.5 32.8 12.5 45.3 0L416 237.3 416 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3z"]
};
const faSortDown = {
  prefix: 'fas',
  iconName: 'sort-down',
  icon: [320, 512, ["sort-desc"], "f0dd", "M182.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l256 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128z"]
};
const faSortDesc = faSortDown;
const faCircleMinus = {
  prefix: 'fas',
  iconName: 'circle-minus',
  icon: [512, 512, ["minus-circle"], "f056", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faMinusCircle = faCircleMinus;
const faDoorOpen = {
  prefix: 'fas',
  iconName: 'door-open',
  icon: [576, 512, [], "f52b", "M320 32c0-9.9-4.5-19.2-12.3-25.2S289.8-1.4 280.2 1l-179.9 45C79 51.3 64 70.5 64 92.5L64 448l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 192 0 32 0 0-32 0-448zM256 256c0 17.7-10.7 32-24 32s-24-14.3-24-32s10.7-32 24-32s24 14.3 24 32zm96-128l96 0 0 352c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-320c0-35.3-28.7-64-64-64l-96 0 0 64z"]
};
const faRightFromBracket = {
  prefix: 'fas',
  iconName: 'right-from-bracket',
  icon: [512, 512, ["sign-out-alt"], "f2f5", "M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]
};
const faSignOutAlt = faRightFromBracket;
const faAtom = {
  prefix: 'fas',
  iconName: 'atom',
  icon: [512, 512, [9883], "f5d2", "M256 398.8c-11.8 5.1-23.4 9.7-34.9 13.5c16.7 33.8 31 35.7 34.9 35.7s18.1-1.9 34.9-35.7c-11.4-3.9-23.1-8.4-34.9-13.5zM446 256c33 45.2 44.3 90.9 23.6 128c-20.2 36.3-62.5 49.3-115.2 43.2c-22 52.1-55.6 84.8-98.4 84.8s-76.4-32.7-98.4-84.8c-52.7 6.1-95-6.8-115.2-43.2C21.7 346.9 33 301.2 66 256c-33-45.2-44.3-90.9-23.6-128c20.2-36.3 62.5-49.3 115.2-43.2C179.6 32.7 213.2 0 256 0s76.4 32.7 98.4 84.8c52.7-6.1 95 6.8 115.2 43.2c20.7 37.1 9.4 82.8-23.6 128zm-65.8 67.4c-1.7 14.2-3.9 28-6.7 41.2c31.8 1.4 38.6-8.7 40.2-11.7c2.3-4.2 7-17.9-11.9-48.1c-6.8 6.3-14 12.5-21.6 18.6zm-6.7-175.9c2.8 13.1 5 26.9 6.7 41.2c7.6 6.1 14.8 12.3 21.6 18.6c18.9-30.2 14.2-44 11.9-48.1c-1.6-2.9-8.4-13-40.2-11.7zM290.9 99.7C274.1 65.9 259.9 64 256 64s-18.1 1.9-34.9 35.7c11.4 3.9 23.1 8.4 34.9 13.5c11.8-5.1 23.4-9.7 34.9-13.5zm-159 88.9c1.7-14.3 3.9-28 6.7-41.2c-31.8-1.4-38.6 8.7-40.2 11.7c-2.3 4.2-7 17.9 11.9 48.1c6.8-6.3 14-12.5 21.6-18.6zM110.2 304.8C91.4 335 96 348.7 98.3 352.9c1.6 2.9 8.4 13 40.2 11.7c-2.8-13.1-5-26.9-6.7-41.2c-7.6-6.1-14.8-12.3-21.6-18.6zM336 256a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zm-80-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSoap = {
  prefix: 'fas',
  iconName: 'soap',
  icon: [512, 512, [129532], "e06e", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM320 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM416 32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0 160c0 27.6-11.7 52.5-30.4 70.1C422.1 275.7 448 310.8 448 352c0 53-43 96-96 96l-192 0c-53 0-96-43-96-96s43-96 96-96l88.4 0c-15.2-17-24.4-39.4-24.4-64L96 192c-53 0-96 43-96 96L0 416c0 53 43 96 96 96l320 0c53 0 96-43 96-96l0-128c0-53-43-96-96-96zM160 288c-35.3 0-64 28.7-64 64s28.7 64 64 64l192 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-160 0z"]
};
const faIcons = {
  prefix: 'fas',
  iconName: 'icons',
  icon: [512, 512, ["heart-music-camera-bolt"], "f86d", "M500.3 7.3C507.7 13.3 512 22.4 512 32l0 144c0 26.5-28.7 48-64 48s-64-21.5-64-48s28.7-48 64-48l0-57L352 90.2 352 208c0 26.5-28.7 48-64 48s-64-21.5-64-48s28.7-48 64-48l0-96c0-15.3 10.8-28.4 25.7-31.4l160-32c9.4-1.9 19.1 .6 26.6 6.6zM74.7 304l11.8-17.8c5.9-8.9 15.9-14.2 26.6-14.2l61.7 0c10.7 0 20.7 5.3 26.6 14.2L213.3 304l26.7 0c26.5 0 48 21.5 48 48l0 112c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 352c0-26.5 21.5-48 48-48l26.7 0zM192 408a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM478.7 278.3L440.3 368l55.7 0c6.7 0 12.6 4.1 15 10.4s.6 13.3-4.4 17.7l-128 112c-5.6 4.9-13.9 5.3-19.9 .9s-8.2-12.4-5.3-19.2L391.7 400 336 400c-6.7 0-12.6-4.1-15-10.4s-.6-13.3 4.4-17.7l128-112c5.6-4.9 13.9-5.3 19.9-.9s8.2 12.4 5.3 19.2zm-339-59.2c-6.5 6.5-17 6.5-23 0L19.9 119.2c-28-29-26.5-76.9 5-103.9c27-23.5 68.4-19 93.4 6.5l10 10.5 9.5-10.5c25-25.5 65.9-30 93.9-6.5c31 27 32.5 74.9 4.5 103.9l-96.4 99.9z"]
};
const faHeartMusicCameraBolt = faIcons;
const faMicrophoneLinesSlash = {
  prefix: 'fas',
  iconName: 'microphone-lines-slash',
  icon: [640, 512, ["microphone-alt-slash"], "f539", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c15.2-26 23.9-56.3 23.9-88.7l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24 0 16c0 21.2-5.1 41.1-14.2 58.7L416 300.8l0-44.8-57.1 0-34.5-27c2.9-3.1 7-5 11.6-5l80 0 0-32-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-32-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0c0-53-43-96-96-96s-96 43-96 96l0 54.3L38.8 5.1zm362.5 407l-43.1-33.9C346.1 382 333.3 384 320 384c-70.7 0-128-57.3-128-128l0-8.7L144.7 210c-.5 1.9-.7 3.9-.7 6l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c20.4-2.8 39.7-9.1 57.3-18.2z"]
};
const faMicrophoneAltSlash = faMicrophoneLinesSlash;
const faBridgeCircleCheck = {
  prefix: 'fas',
  iconName: 'bridge-circle-check',
  icon: [640, 512, [], "e4c9", "M64 32C46.3 32 32 46.3 32 64s14.3 32 32 32l40 0 0 64-72 0 0 128c53 0 96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96c6.3 0 12.4 .6 18.3 1.7C367.1 231.8 426.9 192 496 192c42.5 0 81.6 15.1 112 40.2l0-72.2-72 0 0-64 40 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32zM488 96l0 64-80 0 0-64 80 0zM360 96l0 64-80 0 0-64 80 0zM232 96l0 64-80 0 0-64 80 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faPumpMedical = {
  prefix: 'fas',
  iconName: 'pump-medical',
  icon: [448, 512, [], "e06a", "M128 32l0 96 128 0 0-32 60.1 0c4.2 0 8.3 1.7 11.3 4.7l33.9 33.9c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L372.7 55.4c-15-15-35.4-23.4-56.6-23.4L256 32c0-17.7-14.3-32-32-32L160 0c-17.7 0-32 14.3-32 32zM117.4 160c-33.3 0-61 25.5-63.8 58.7L35 442.7C31.9 480 61.3 512 98.8 512l186.4 0c37.4 0 66.9-32 63.8-69.3l-18.7-224c-2.8-33.2-30.5-58.7-63.8-58.7l-149.1 0zM216 280l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faFingerprint = {
  prefix: 'fas',
  iconName: 'fingerprint',
  icon: [512, 512, [], "f577", "M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256l0 24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"]
};
const faHandPointRight = {
  prefix: 'fas',
  iconName: 'hand-point-right',
  icon: [512, 512, [], "f0a4", "M480 96c17.7 0 32 14.3 32 32s-14.3 32-32 32l-208 0 0-64 208 0zM320 288c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0zm64-64c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l48 0c17.7 0 32 14.3 32 32zM288 384c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0zm-88-96l.6 0c-5.4 9.4-8.6 20.3-8.6 32c0 13.2 4 25.4 10.8 35.6C177.9 364.3 160 388.1 160 416c0 11.7 3.1 22.6 8.6 32l-8.6 0C71.6 448 0 376.4 0 288l0-61.7c0-42.4 16.9-83.1 46.9-113.1l11.6-11.6C82.5 77.5 115.1 64 149 64l27 0c35.3 0 64 28.7 64 64l0 88c0 22.1-17.9 40-40 40s-40-17.9-40-40l0-56c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 56c0 39.8 32.2 72 72 72z"]
};
const faMagnifyingGlassLocation = {
  prefix: 'fas',
  iconName: 'magnifying-glass-location',
  icon: [512, 512, ["search-location"], "f689", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM288 176c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 48.8 46.5 111.6 68.6 138.6c6 7.3 16.8 7.3 22.7 0c22.1-27 68.6-89.8 68.6-138.6zm-112 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faSearchLocation = faMagnifyingGlassLocation;
const faForwardStep = {
  prefix: 'fas',
  iconName: 'forward-step',
  icon: [320, 512, ["step-forward"], "f051", "M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416L0 96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4l192 160L256 241l0-145c0-17.7 14.3-32 32-32s32 14.3 32 32l0 320c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-145-11.5 9.6-192 160z"]
};
const faStepForward = faForwardStep;
const faFaceSmileBeam = {
  prefix: 'fas',
  iconName: 'face-smile-beam',
  icon: [512, 512, [128522, "smile-beam"], "f5b8", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zm53.5-96.7s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faSmileBeam = faFaceSmileBeam;
const faFlagCheckered = {
  prefix: 'fas',
  iconName: 'flag-checkered',
  icon: [448, 512, [127937], "f11e", "M32 0C49.7 0 64 14.3 64 32l0 16 69-17.2c38.1-9.5 78.3-5.1 113.5 12.5c46.3 23.2 100.8 23.2 147.1 0l9.6-4.8C423.8 28.1 448 43.1 448 66.1l0 279.7c0 13.3-8.3 25.3-20.8 30l-34.7 13c-46.2 17.3-97.6 14.6-141.7-7.4c-37.9-19-81.3-23.7-122.5-13.4L64 384l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-80 0-66L0 64 0 32C0 14.3 14.3 0 32 0zM64 187.1l64-13.9 0 65.5L64 252.6 64 318l48.8-12.2c5.1-1.3 10.1-2.4 15.2-3.3l0-63.9 38.9-8.4c8.3-1.8 16.7-2.5 25.1-2.1l0-64c13.6 .4 27.2 2.6 40.4 6.4l23.6 6.9 0 66.7-41.7-12.3c-7.3-2.1-14.8-3.4-22.3-3.8l0 71.4c21.8 1.9 43.3 6.7 64 14.4l0-69.8 22.7 6.7c13.5 4 27.3 6.4 41.3 7.4l0-64.2c-7.8-.8-15.6-2.3-23.2-4.5l-40.8-12 0-62c-13-3.8-25.8-8.8-38.2-15c-8.2-4.1-16.9-7-25.8-8.8l0 72.4c-13-.4-26 .8-38.7 3.6L128 173.2 128 98 64 114l0 73.1zM320 335.7c16.8 1.5 33.9-.7 50-6.8l14-5.2 0-71.7-7.9 1.8c-18.4 4.3-37.3 5.7-56.1 4.5l0 77.4zm64-149.4l0-70.8c-20.9 6.1-42.4 9.1-64 9.1l0 69.4c13.9 1.4 28 .5 41.7-2.6l22.3-5.2z"]
};
const faFootball = {
  prefix: 'fas',
  iconName: 'football',
  icon: [512, 512, [127944, "football-ball"], "f44e", "M247.5 25.4c-13.5 3.3-26.4 7.2-38.6 11.7C142.9 61.6 96.7 103.6 66 153.6C47.8 183.4 35.1 215.9 26.9 249L264.5 486.6c13.5-3.3 26.4-7.2 38.6-11.7c66-24.5 112.2-66.5 142.9-116.5c18.3-29.8 30.9-62.3 39.1-95.3L247.5 25.4zM495.2 205.3c6.1-56.8 1.4-112.2-7.7-156.4c-2.7-12.9-13-22.9-26.1-25.1c-58.2-9.7-109.9-12-155.6-7.9L495.2 205.3zM206.1 496L16.8 306.7c-6.1 56.8-1.4 112.2 7.7 156.4c2.7 12.9 13 22.9 26.1 25.1c58.2 9.7 109.9 12 155.6 7.9zm54.6-331.3c6.2-6.2 16.4-6.2 22.6 0l64 64c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-64-64c-6.2-6.2-6.2-16.4 0-22.6zm-48 48c6.2-6.2 16.4-6.2 22.6 0l64 64c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-64-64c-6.2-6.2-6.2-16.4 0-22.6zm-48 48c6.2-6.2 16.4-6.2 22.6 0l64 64c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-64-64c-6.2-6.2-6.2-16.4 0-22.6z"]
};
const faFootballBall = faFootball;
const faSchoolCircleExclamation = {
  prefix: 'fas',
  iconName: 'school-circle-exclamation',
  icon: [640, 512, [], "e56c", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l272 0s0 0 0 0l-64 0 0-96c0-35.3 28.7-64 64-64l.3 0 .5 0c3.4-37.7 18.7-72.1 42.2-99.1C350.2 260 335.6 264 320 264c-48.6 0-88-39.4-88-88s39.4-88 88-88s88 39.4 88 88c0 18.3-5.6 35.3-15.1 49.4c29-21 64.6-33.4 103.1-33.4c59.5 0 112.1 29.6 144 74.8L640 144c0-26.5-21.5-48-48-48L473.7 96 337.8 5.4zM96 192l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm0 128l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zM320 128c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16c0-8.8-7.2-16-16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faCrop = {
  prefix: 'fas',
  iconName: 'crop',
  icon: [512, 512, [], "f125", "M448 109.3l54.6-54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L402.7 64 160 64l0 64 178.7 0L128 338.7 128 32c0-17.7-14.3-32-32-32S64 14.3 64 32l0 32L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l32 0 0 256c0 35.3 28.7 64 64 64l224 0 0-64-178.7 0L384 173.3 384 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-274.7z"]
};
const faAnglesDown = {
  prefix: 'fas',
  iconName: 'angles-down',
  icon: [448, 512, ["angle-double-down"], "f103", "M246.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L224 402.7 361.4 265.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-160 160zm160-352l-160 160c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L224 210.7 361.4 73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3z"]
};
const faAngleDoubleDown = faAnglesDown;
const faUsersRectangle = {
  prefix: 'fas',
  iconName: 'users-rectangle',
  icon: [640, 512, [], "e594", "M96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96l448 0c53 0 96-43 96-96l0-320c0-53-43-96-96-96L96 0zM64 96c0-17.7 14.3-32 32-32l448 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32L64 96zm159.8 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM96 309.3c0 14.7 11.9 26.7 26.7 26.7l56.1 0c8-34.1 32.8-61.7 65.2-73.6c-7.5-4.1-16.2-6.4-25.3-6.4l-69.3 0C119.9 256 96 279.9 96 309.3zM461.2 336l56.1 0c14.7 0 26.7-11.9 26.7-26.7c0-29.5-23.9-53.3-53.3-53.3l-69.3 0c-9.2 0-17.8 2.3-25.3 6.4c32.4 11.9 57.2 39.5 65.2 73.6zM372 289c-3.9-.7-7.9-1-12-1l-80 0c-4.1 0-8.1 .3-12 1c-26 4.4-47.3 22.7-55.9 47c-2.7 7.5-4.1 15.6-4.1 24c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24c0-8.4-1.4-16.5-4.1-24c-8.6-24.3-29.9-42.6-55.9-47zM512 176a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM320 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128z"]
};
const faPeopleRoof = {
  prefix: 'fas',
  iconName: 'people-roof',
  icon: [640, 512, [], "e537", "M335.5 4l288 160c15.4 8.6 21 28.1 12.4 43.5s-28.1 21-43.5 12.4L320 68.6 47.5 220c-15.4 8.6-34.9 3-43.5-12.4s-3-34.9 12.4-43.5L304.5 4c9.7-5.4 21.4-5.4 31.1 0zM320 160a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM144 256a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm312 40a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM226.9 491.4L200 441.5l0 38.5c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32l0-38.5L61.1 491.4c-6.3 11.7-20.8 16-32.5 9.8s-16-20.8-9.8-32.5l37.9-70.3c15.3-28.5 45.1-46.3 77.5-46.3l19.5 0c16.3 0 31.9 4.5 45.4 12.6l33.6-62.3c15.3-28.5 45.1-46.3 77.5-46.3l19.5 0c32.4 0 62.1 17.8 77.5 46.3l33.6 62.3c13.5-8.1 29.1-12.6 45.4-12.6l19.5 0c32.4 0 62.1 17.8 77.5 46.3l37.9 70.3c6.3 11.7 1.9 26.2-9.8 32.5s-26.2 1.9-32.5-9.8L552 441.5l0 38.5c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32l0-38.5-26.9 49.9c-6.3 11.7-20.8 16-32.5 9.8s-16-20.8-9.8-32.5l36.3-67.5c-1.7-1.7-3.2-3.6-4.3-5.8L376 345.5l0 54.5c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32l0-54.5-26.9 49.9c-1.2 2.2-2.6 4.1-4.3 5.8l36.3 67.5c6.3 11.7 1.9 26.2-9.8 32.5s-26.2 1.9-32.5-9.8z"]
};
const faPeopleLine = {
  prefix: 'fas',
  iconName: 'people-line',
  icon: [640, 512, [], "e534", "M360 72a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zM144 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416zM496 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM200 313.5l26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-36.3-67.5c1.7-1.7 3.2-3.6 4.3-5.8L264 217.5l0 54.5c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-54.5 26.9 49.9c1.2 2.2 2.6 4.1 4.3 5.8l-36.3 67.5c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L440 313.5l0 38.5c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-38.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-16.3 0-31.9 4.5-45.4 12.6l-33.6-62.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3l-33.6 62.3c-13.5-8.1-29.1-12.6-45.4-12.6l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3L18.9 340.6c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L88 313.5 88 352c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-38.5z"]
};
const faBeerMugEmpty = {
  prefix: 'fas',
  iconName: 'beer-mug-empty',
  icon: [512, 512, ["beer"], "f0fc", "M32 64c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32l0 32 51.2 0c42.4 0 76.8 34.4 76.8 76.8l0 102.1c0 30.4-17.9 57.9-45.6 70.2L384 381.7l0 34.3c0 35.3-28.7 64-64 64L96 480c-35.3 0-64-28.7-64-64L32 64zM384 311.6l56.4-25.1c4.6-2.1 7.6-6.6 7.6-11.7l0-102.1c0-7.1-5.7-12.8-12.8-12.8L384 160l0 151.6zM160 144c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224zm64 0c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224zm64 0c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224z"]
};
const faBeer = faBeerMugEmpty;
const faDiagramPredecessor = {
  prefix: 'fas',
  iconName: 'diagram-predecessor',
  icon: [512, 512, [], "e477", "M448 416l0-64L64 352l0 64 384 0zm0 64L64 480c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64zM288 160c0 35.3-28.7 64-64 64L64 224c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l144 0 16 0 144 0c44.2 0 80 35.8 80 80l0 16 38.1 0c21.4 0 32.1 25.9 17 41L433 239c-9.4 9.4-24.6 9.4-33.9 0L329 169c-15.1-15.1-4.4-41 17-41l38.1 0 0-16c0-8.8-7.2-16-16-16l-80 0 0 64z"]
};
const faArrowUpLong = {
  prefix: 'fas',
  iconName: 'arrow-up-long',
  icon: [384, 512, ["long-arrow-up"], "f176", "M214.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-370.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128z"]
};
const faLongArrowUp = faArrowUpLong;
const faFireFlameSimple = {
  prefix: 'fas',
  iconName: 'fire-flame-simple',
  icon: [384, 512, ["burn"], "f46a", "M372.5 256.5l-.7-1.9C337.8 160.8 282 76.5 209.1 8.5l-3.3-3C202.1 2 197.1 0 192 0s-10.1 2-13.8 5.5l-3.3 3C102 76.5 46.2 160.8 12.2 254.6l-.7 1.9C3.9 277.3 0 299.4 0 321.6C0 426.7 86.8 512 192 512s192-85.3 192-190.4c0-22.2-3.9-44.2-11.5-65.1zm-90.8 49.5c4.1 9.3 6.2 19.4 6.2 29.5c0 53-43 96.5-96 96.5s-96-43.5-96-96.5c0-10.1 2.1-20.3 6.2-29.5l1.9-4.3c15.8-35.4 37.9-67.7 65.3-95.1l8.9-8.9c3.6-3.6 8.5-5.6 13.6-5.6s10 2 13.6 5.6l8.9 8.9c27.4 27.4 49.6 59.7 65.3 95.1l1.9 4.3z"]
};
const faBurn = faFireFlameSimple;
const faPerson = {
  prefix: 'fas',
  iconName: 'person',
  icon: [320, 512, [129485, "male"], "f183", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l58.3 97c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0z"]
};
const faMale = faPerson;
const faLaptop = {
  prefix: 'fas',
  iconName: 'laptop',
  icon: [640, 512, [128187], "f109", "M128 32C92.7 32 64 60.7 64 96l0 256 64 0 0-256 384 0 0 256 64 0 0-256c0-35.3-28.7-64-64-64L128 32zM19.2 384C8.6 384 0 392.6 0 403.2C0 445.6 34.4 480 76.8 480l486.4 0c42.4 0 76.8-34.4 76.8-76.8c0-10.6-8.6-19.2-19.2-19.2L19.2 384z"]
};
const faFileCsv = {
  prefix: 'fas',
  iconName: 'file-csv',
  icon: [512, 512, [], "f6dd", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 144-208 0c-35.3 0-64 28.7-64 64l0 144-48 0c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM200 352l16 0c22.1 0 40 17.9 40 40l0 8c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-8c0-4.4-3.6-8-8-8l-16 0c-4.4 0-8 3.6-8 8l0 80c0 4.4 3.6 8 8 8l16 0c4.4 0 8-3.6 8-8l0-8c0-8.8 7.2-16 16-16s16 7.2 16 16l0 8c0 22.1-17.9 40-40 40l-16 0c-22.1 0-40-17.9-40-40l0-80c0-22.1 17.9-40 40-40zm133.1 0l34.9 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-34.9 0c-7.2 0-13.1 5.9-13.1 13.1c0 5.2 3 9.9 7.8 12l37.4 16.6c16.3 7.2 26.8 23.4 26.8 41.2c0 24.9-20.2 45.1-45.1 45.1L304 512c-8.8 0-16-7.2-16-16s7.2-16 16-16l42.9 0c7.2 0 13.1-5.9 13.1-13.1c0-5.2-3-9.9-7.8-12l-37.4-16.6c-16.3-7.2-26.8-23.4-26.8-41.2c0-24.9 20.2-45.1 45.1-45.1zm98.9 0c8.8 0 16 7.2 16 16l0 31.6c0 23 5.5 45.6 16 66c10.5-20.3 16-42.9 16-66l0-31.6c0-8.8 7.2-16 16-16s16 7.2 16 16l0 31.6c0 34.7-10.3 68.7-29.6 97.6l-5.1 7.7c-3 4.5-8 7.1-13.3 7.1s-10.3-2.7-13.3-7.1l-5.1-7.7c-19.3-28.9-29.6-62.9-29.6-97.6l0-31.6c0-8.8 7.2-16 16-16z"]
};
const faMenorah = {
  prefix: 'fas',
  iconName: 'menorah',
  icon: [640, 512, [], "f676", "M20.8 7.4C22.8 2.9 27.1 0 32 0s9.2 2.9 11.2 7.4L61.3 49.7c1.8 4.1 2.7 8.6 2.7 13.1L64 64c0 17.7-14.3 32-32 32S0 81.7 0 64l0-1.2c0-4.5 .9-8.9 2.7-13.1L20.8 7.4zm96 0C118.8 2.9 123.1 0 128 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1L116.8 7.4zm77.8 42.4L212.8 7.4C214.8 2.9 219.1 0 224 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1zM308.8 7.4C310.8 2.9 315.1 0 320 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1L308.8 7.4zm77.8 42.4L404.8 7.4C406.8 2.9 411.1 0 416 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1zM500.8 7.4C502.8 2.9 507.1 0 512 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1L500.8 7.4zm77.8 42.4L596.8 7.4C598.8 2.9 603.1 0 608 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1zM32 128c17.7 0 32 14.3 32 32l0 128c0 17.7 14.3 32 32 32l192 0 0-160c0-17.7 14.3-32 32-32s32 14.3 32 32l0 160 192 0c17.7 0 32-14.3 32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 53-43 96-96 96l-192 0 0 64 128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0-160 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l128 0 0-64L96 384c-53 0-96-43-96-96L0 160c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 96 0 32-64 0 0-32 0-96c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 96 0 32-64 0 0-32 0-96c0-17.7 14.3-32 32-32zm192 0c17.7 0 32 14.3 32 32l0 96 0 32-64 0 0-32 0-96c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 96 0 32-64 0 0-32 0-96c0-17.7 14.3-32 32-32z"]
};
const faTruckPlane = {
  prefix: 'fas',
  iconName: 'truck-plane',
  icon: [640, 512, [], "e58f", "M200 0c-30.6 0-56 54.7-56 86.1l0 106.5L7.8 274.3C2.9 277.2 0 282.4 0 288l0 64c0 5.1 2.4 9.8 6.4 12.8s9.3 3.9 14.1 2.5l123.4-37 0 81.2-50 40c-3.8 3-6 7.6-6 12.5l0 32c0 5.1 2.5 10 6.6 13s9.5 3.8 14.4 2.2L200 480.9 290.4 511c-1.6-4.7-2.4-9.8-2.4-15l0-32.6c-18.2-10.5-30.7-29.7-31.9-51.8l-.1-.1 0-3.5 0-82.5L256 184l0-1.1s0 0 0 0l0-96.9C256 54.7 231.5 0 200 0zm88 176l0 224c0 20.9 13.4 38.7 32 45.3l0 42.7c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-40 160 0 0 40c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-42.7c18.6-6.6 32-24.4 32-45.3l0-224c0-26.5-21.5-48-48-48l-256 0c-26.5 0-48 21.5-48 48zm79.8 78.7c3.3-8.7 11.2-14.7 20.5-14.7l151.4 0c9.2 0 17.2 6 20.5 14.7L576 304l-224 0 15.8-49.3zM568 352a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM336 376a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faRecordVinyl = {
  prefix: 'fas',
  iconName: 'record-vinyl',
  icon: [512, 512, [], "f8d9", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm0 224a128 128 0 1 0 0-256 128 128 0 1 0 0 256zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faFaceGrinStars = {
  prefix: 'fas',
  iconName: 'face-grin-stars',
  icon: [512, 512, [129321, "grin-stars"], "f587", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm407.4 75.5c5-11.8-7-22.5-19.3-18.7c-39.7 12.2-84.5 19-131.8 19s-92.1-6.8-131.8-19c-12.3-3.8-24.3 6.9-19.3 18.7c25 59.1 83.2 100.5 151.1 100.5s126.2-41.4 151.1-100.5zM160 120c-3.1 0-5.9 1.8-7.2 4.6l-16.6 34.7-38.1 5c-3.1 .4-5.6 2.5-6.6 5.5s-.1 6.2 2.1 8.3l27.9 26.5-7 37.8c-.6 3 .7 6.1 3.2 7.9s5.8 2 8.5 .6L160 232.5l33.8 18.3c2.7 1.5 6 1.3 8.5-.6s3.7-4.9 3.2-7.9l-7-37.8L226.4 178c2.2-2.1 3.1-5.3 2.1-8.3s-3.5-5.1-6.6-5.5l-38.1-5-16.6-34.7c-1.3-2.8-4.1-4.6-7.2-4.6zm192 0c-3.1 0-5.9 1.8-7.2 4.6l-16.6 34.7-38.1 5c-3.1 .4-5.6 2.5-6.6 5.5s-.1 6.2 2.1 8.3l27.9 26.5-7 37.8c-.6 3 .7 6.1 3.2 7.9s5.8 2 8.5 .6L352 232.5l33.8 18.3c2.7 1.5 6 1.3 8.5-.6s3.7-4.9 3.2-7.9l-7-37.8L418.4 178c2.2-2.1 3.1-5.3 2.1-8.3s-3.5-5.1-6.6-5.5l-38.1-5-16.6-34.7c-1.3-2.8-4.1-4.6-7.2-4.6z"]
};
const faGrinStars = faFaceGrinStars;
const faBong = {
  prefix: 'fas',
  iconName: 'bong',
  icon: [448, 512, [], "f55c", "M160 208.5c0 29.1-15.6 53.9-37.2 67.8c-17.2 11.1-31.5 26.1-41.7 43.7l221.8 0c-10.2-17.6-24.5-32.6-41.7-43.7c-21.6-13.9-37.2-38.7-37.2-67.8L224 64l-64 0 0 144.5zM288 64l0 144.5c0 5.7 3.1 10.9 7.9 14c11.2 7.2 21.5 15.5 30.9 24.8L366.1 208l-7-7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l24 24 24 24c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-7-7-43.3 43.3C374 314.1 384 347.9 384 384c0 39.4-11.9 76.1-32.2 106.5c-9.6 14.4-26.5 21.5-43.8 21.5L76.1 512c-17.3 0-34.2-7.1-43.8-21.5C11.9 460.1 0 423.4 0 384c0-67.8 35.1-127.3 88.1-161.5c4.8-3.1 7.9-8.3 7.9-14L96 64C78.3 64 64 49.7 64 32S78.3 0 96 0l16 0L272 0l16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]
};
const faSpaghettiMonsterFlying = {
  prefix: 'fas',
  iconName: 'spaghetti-monster-flying',
  icon: [640, 512, ["pastafarianism"], "f67b", "M208 64a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 0c0 16.2-6 31.1-16 42.3l15.6 31.2c18.7-6 39.9-9.5 64.4-9.5s45.8 3.5 64.4 9.5L400 106.3C390 95.1 384 80.2 384 64c0-35.3 28.7-64 64-64s64 28.7 64 64s-28.7 64-64 64c-1.7 0-3.4-.1-5.1-.2L427.8 158c21.1 13.6 37.7 30.2 51.4 46.4c7.1 8.3 13.5 16.6 19.3 24l1.4 1.8c6.3 8.1 11.6 14.8 16.7 20.4C527.3 262.3 532.7 264 536 264c2.5 0 4.3-.6 7.1-3.3c3.7-3.5 7.1-8.8 12.5-17.4l.6-.9c4.6-7.4 11-17.6 19.4-25.7c9.7-9.3 22.9-16.7 40.4-16.7c13.3 0 24 10.7 24 24s-10.7 24-24 24c-2.5 0-4.3 .6-7.1 3.3c-3.7 3.5-7.1 8.8-12.5 17.4l-.6 .9c-4.6 7.4-11 17.6-19.4 25.7c-9.7 9.3-22.9 16.7-40.4 16.7c-18.5 0-32.9-8.5-44.3-18.6c-3.1 4-6.6 8.3-10.5 12.7c1.4 4.3 2.8 8.5 4 12.5c.9 3 1.8 5.8 2.6 8.6c3 9.8 5.5 18.2 8.6 25.9c3.9 9.8 7.4 15.4 10.8 18.5c2.6 2.4 5.9 4.3 12.8 4.3c8.7 0 16.9-4.2 33.7-13.2c15-8 35.7-18.8 62.3-18.8c13.3 0 24 10.7 24 24s-10.7 24-24 24c-13.4 0-24.7 5.2-39.7 13.2c-1 .6-2.1 1.1-3.2 1.7C559.9 414 541.4 424 520 424c-18.4 0-33.6-6.1-45.5-17.2c-11.1-10.3-17.9-23.7-22.7-36c-3.6-9-6.7-19.1-9.5-28.5c-16.4 12.3-36.1 23.6-58.9 31.3c3.6 10.8 8.4 23.5 14.4 36.2c7.5 15.9 16.2 30.4 25.8 40.5C433 460.5 441.2 464 448 464c13.3 0 24 10.7 24 24s-10.7 24-24 24c-25.2 0-45-13.5-59.5-28.8c-14.5-15.4-25.7-34.9-34.2-53c-8-17-14.1-33.8-18.3-46.9c-5.2 .4-10.6 .6-16 .6s-10.8-.2-16-.6c-4.2 13-10.3 29.9-18.3 46.9c-8.5 18.1-19.8 37.6-34.2 53C237 498.5 217.2 512 192 512c-13.3 0-24-10.7-24-24s10.7-24 24-24c6.8 0 15-3.5 24.5-13.7c9.5-10.1 18.3-24.6 25.8-40.5c5.9-12.6 10.7-25.4 14.4-36.2c-22.8-7.7-42.5-19-58.9-31.3c-2.9 9.4-6 19.5-9.5 28.5c-4.8 12.2-11.6 25.6-22.7 36C153.6 417.9 138.4 424 120 424c-21.4 0-39.9-10-53.1-17.1c0 0 0 0 0 0c-1.1-.6-2.2-1.2-3.2-1.7c-15-8-26.3-13.2-39.7-13.2c-13.3 0-24-10.7-24-24s10.7-24 24-24c26.6 0 47.3 10.8 62.3 18.8c16.8 9 25 13.2 33.7 13.2c6.8 0 10.2-1.9 12.8-4.3c3.4-3.2 7-8.8 10.8-18.5c3-7.7 5.6-16.1 8.6-25.9c.8-2.7 1.7-5.6 2.6-8.6c1.2-4 2.6-8.2 4-12.5c-3.9-4.5-7.4-8.8-10.5-12.7C136.9 303.5 122.5 312 104 312c-17.5 0-30.7-7.4-40.4-16.7c-8.4-8.1-14.8-18.3-19.4-25.7l-.6-.9c-5.4-8.6-8.8-13.9-12.5-17.4c-2.8-2.7-4.6-3.3-7.1-3.3c-13.3 0-24-10.7-24-24s10.7-24 24-24c17.5 0 30.7 7.4 40.4 16.7c8.4 8.1 14.8 18.3 19.4 25.7l.6 .9c5.4 8.6 8.8 13.9 12.5 17.4c2.8 2.7 4.6 3.3 7.1 3.3c3.3 0 8.7-1.7 19.4-13.4c5.1-5.6 10.4-12.3 16.7-20.4l1.4-1.8c5.8-7.4 12.2-15.7 19.3-24c13.8-16.2 30.3-32.8 51.4-46.4l-15.1-30.2c-1.7 .1-3.4 .2-5.1 .2c-35.3 0-64-28.7-64-64s28.7-64 64-64s64 28.7 64 64zm208 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faPastafarianism = faSpaghettiMonsterFlying;
const faArrowDownUpAcrossLine = {
  prefix: 'fas',
  iconName: 'arrow-down-up-across-line',
  icon: [576, 512, [], "e4af", "M137.4 502.6c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7 192 288l352 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0 0-114.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L384 109.3 384 224l-192 0-64 0-96 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 0 114.7L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96zM128 192l64 0 0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 128zM448 320l-64 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128z"]
};
const faSpoon = {
  prefix: 'fas',
  iconName: 'spoon',
  icon: [512, 512, [129348, 61873, "utensil-spoon"], "f2e5", "M245.8 220.9c-14.5-17.6-21.8-39.2-21.8-60.8C224 80 320 0 416 0c53 0 96 43 96 96c0 96-80 192-160.2 192c-21.6 0-43.2-7.3-60.8-21.8L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L245.8 220.9z"]
};
const faUtensilSpoon = faSpoon;
const faJarWheat = {
  prefix: 'fas',
  iconName: 'jar-wheat',
  icon: [320, 512, [], "e517", "M32 32C32 14.3 46.3 0 64 0L256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 64C46.3 64 32 49.7 32 32zM0 160c0-35.3 28.7-64 64-64l192 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 160zm112 0l-42.2 0c-3.2 0-5.8 2.6-5.8 5.8C64 198 90 224 122.2 224l21.8 0 32 0 21.8 0c32.1 0 58.2-26 58.2-58.2c0-3.2-2.6-5.8-5.8-5.8L208 160c-19.1 0-36.3 8.4-48 21.7c-11.7-13.3-28.9-21.7-48-21.7zm48 117.7c-11.7-13.3-28.9-21.7-48-21.7l-42.2 0c-3.2 0-5.8 2.6-5.8 5.8C64 294 90 320 122.2 320l21.8 0 32 0 21.8 0c32.1 0 58.2-26 58.2-58.2c0-3.2-2.6-5.8-5.8-5.8L208 256c-19.1 0-36.3 8.4-48 21.7zM112 352l-42.2 0c-3.2 0-5.8 2.6-5.8 5.8C64 390 90 416 122.2 416l21.8 0 0 32c0 8.8 7.2 16 16 16s16-7.2 16-16l0-32 21.8 0c32.1 0 58.2-26 58.2-58.2c0-3.2-2.6-5.8-5.8-5.8L208 352c-19.1 0-36.3 8.4-48 21.7c-11.7-13.3-28.9-21.7-48-21.7z"]
};
const faEnvelopesBulk = {
  prefix: 'fas',
  iconName: 'envelopes-bulk',
  icon: [640, 512, ["mail-bulk"], "f674", "M128 0C110.3 0 96 14.3 96 32l0 192 96 0 0-32c0-35.3 28.7-64 64-64l224 0 0-96c0-17.7-14.3-32-32-32L128 0zM256 160c-17.7 0-32 14.3-32 32l0 32 96 0c35.3 0 64 28.7 64 64l0 128 192 0c17.7 0 32-14.3 32-32l0-192c0-17.7-14.3-32-32-32l-320 0zm240 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM64 256c-17.7 0-32 14.3-32 32l0 13L187.1 415.9c1.4 1 3.1 1.6 4.9 1.6s3.5-.6 4.9-1.6L352 301l0-13c0-17.7-14.3-32-32-32L64 256zm288 84.8L216 441.6c-6.9 5.1-15.3 7.9-24 7.9s-17-2.8-24-7.9L32 340.8 32 480c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32l0-139.2z"]
};
const faMailBulk = faEnvelopesBulk;
const faFileCircleExclamation = {
  prefix: 'fas',
  iconName: 'file-circle-exclamation',
  icon: [576, 512, [], "e4eb", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z"]
};
const faCircleH = {
  prefix: 'fas',
  iconName: 'circle-h',
  icon: [512, 512, [9405, "hospital-symbol"], "f47e", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM368 152l0 104 0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-80-128 0 0 80c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-208c0-13.3 10.7-24 24-24s24 10.7 24 24l0 80 128 0 0-80c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faHospitalSymbol = faCircleH;
const faPager = {
  prefix: 'fas',
  iconName: 'pager',
  icon: [512, 512, [128223], "f815", "M0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zm64 32l0 64c0 17.7 14.3 32 32 32l320 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L96 128c-17.7 0-32 14.3-32 32zM80 320c-13.3 0-24 10.7-24 24s10.7 24 24 24l56 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-56 0zm136 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0z"]
};
const faAddressBook = {
  prefix: 'fas',
  iconName: 'address-book',
  icon: [512, 512, [62138, "contact-book"], "f2b9", "M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L96 0zM208 288l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM512 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64zM496 192c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8-7.2-16-16-16zm16 144c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64z"]
};
const faContactBook = faAddressBook;
const faStrikethrough = {
  prefix: 'fas',
  iconName: 'strikethrough',
  icon: [512, 512, [], "f0cc", "M161.3 144c3.2-17.2 14-30.1 33.7-38.6c21.1-9 51.8-12.3 88.6-6.5c11.9 1.9 48.8 9.1 60.1 12c17.1 4.5 34.6-5.6 39.2-22.7s-5.6-34.6-22.7-39.2c-14.3-3.8-53.6-11.4-66.6-13.4c-44.7-7-88.3-4.2-123.7 10.9c-36.5 15.6-64.4 44.8-71.8 87.3c-.1 .6-.2 1.1-.2 1.7c-2.8 23.9 .5 45.6 10.1 64.6c4.5 9 10.2 16.9 16.7 23.9L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-209.9 0-.4-.1-1.1-.3c-36-10.8-65.2-19.6-85.2-33.1c-9.3-6.3-15-12.6-18.2-19.1c-3.1-6.1-5.2-14.6-3.8-27.4zM348.9 337.2c2.7 6.5 4.4 15.8 1.9 30.1c-3 17.6-13.8 30.8-33.9 39.4c-21.1 9-51.7 12.3-88.5 6.5c-18-2.9-49.1-13.5-74.4-22.1c-5.6-1.9-11-3.7-15.9-5.4c-16.8-5.6-34.9 3.5-40.5 20.3s3.5 34.9 20.3 40.5c3.6 1.2 7.9 2.7 12.7 4.3c0 0 0 0 0 0s0 0 0 0c24.9 8.5 63.6 21.7 87.6 25.6c0 0 0 0 0 0l.2 0c44.7 7 88.3 4.2 123.7-10.9c36.5-15.6 64.4-44.8 71.8-87.3c3.6-21 2.7-40.4-3.1-58.1l-75.7 0c7 5.6 11.4 11.2 13.9 17.2z"]
};
const faK = {
  prefix: 'fas',
  iconName: 'k',
  icon: [320, 512, [107], "4b", "M311 86.3c12.3-12.7 12-32.9-.7-45.2s-32.9-12-45.2 .7l-155.2 160L64 249 64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 328 0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-107 64.7-66.7 133 192c10.1 14.5 30 18.1 44.5 8.1s18.1-30 8.1-44.5L174.1 227.4 311 86.3z"]
};
const faLandmarkFlag = {
  prefix: 'fas',
  iconName: 'landmark-flag',
  icon: [512, 512, [], "e51c", "M272 0l80 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-80 0 0 32 192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L48 192c-17.7 0-32-14.3-32-32s14.3-32 32-32l192 0 0-112c0-8.8 7.2-16 16-16l16 0zM64 224l64 0 0 192 40 0 0-192 64 0 0 192 48 0 0-192 64 0 0 192 40 0 0-192 64 0 0 196.3c.6 .3 1.2 .7 1.8 1.1l48 32c11.7 7.8 17 22.4 12.9 35.9S494.1 512 480 512L32 512c-14.1 0-26.5-9.2-30.6-22.7s1.1-28.1 12.9-35.9l48-32c.6-.4 1.2-.7 1.8-1.1L64 224z"]
};
const faPencil = {
  prefix: 'fas',
  iconName: 'pencil',
  icon: [512, 512, [9999, 61504, "pencil-alt"], "f303", "M410.3 231l11.3-11.3-33.9-33.9-62.1-62.1L291.7 89.8l-11.3 11.3-22.6 22.6L58.6 322.9c-10.4 10.4-18 23.3-22.2 37.4L1 480.7c-2.5 8.4-.2 17.5 6.1 23.7s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L387.7 253.7 410.3 231zM160 399.4l-9.1 22.7c-4 3.1-8.5 5.4-13.3 6.9L59.4 452l23-78.1c1.4-4.9 3.8-9.4 6.9-13.3l22.7-9.1 0 32c0 8.8 7.2 16 16 16l32 0zM362.7 18.7L348.3 33.2 325.7 55.8 314.3 67.1l33.9 33.9 62.1 62.1 33.9 33.9 11.3-11.3 22.6-22.6 14.5-14.5c25-25 25-65.5 0-90.5L453.3 18.7c-25-25-65.5-25-90.5 0zm-47.4 168l-144 144c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l144-144c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faPencilAlt = faPencil;
const faBackward = {
  prefix: 'fas',
  iconName: 'backward',
  icon: [512, 512, [9194], "f04a", "M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-320c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3l0 41.7 0 41.7L459.5 440.6zM256 352l0-96 0-128 0-32c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-64z"]
};
const faCaretRight = {
  prefix: 'fas',
  iconName: 'caret-right',
  icon: [256, 512, [], "f0da", "M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"]
};
const faComments = {
  prefix: 'fas',
  iconName: 'comments',
  icon: [640, 512, [128490, 61670], "f086", "M208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 38.6 14.7 74.3 39.6 103.4c-3.5 9.4-8.7 17.7-14.2 24.7c-4.8 6.2-9.7 11-13.3 14.3c-1.8 1.6-3.3 2.9-4.3 3.7c-.5 .4-.9 .7-1.1 .8l-.2 .2s0 0 0 0s0 0 0 0C1 327.2-1.4 334.4 .8 340.9S9.1 352 16 352c21.8 0 43.8-5.6 62.1-12.5c9.2-3.5 17.8-7.4 25.2-11.4C134.1 343.3 169.8 352 208 352zM448 176c0 112.3-99.1 196.9-216.5 207C255.8 457.4 336.4 512 432 512c38.2 0 73.9-8.7 104.7-23.9c7.5 4 16 7.9 25.2 11.4c18.3 6.9 40.3 12.5 62.1 12.5c6.9 0 13.1-4.5 15.2-11.1c2.1-6.6-.2-13.8-5.8-17.9c0 0 0 0 0 0s0 0 0 0l-.2-.2c-.2-.2-.6-.4-1.1-.8c-1-.8-2.5-2-4.3-3.7c-3.6-3.3-8.5-8.1-13.3-14.3c-5.5-7-10.7-15.4-14.2-24.7c24.9-29 39.6-64.7 39.6-103.4c0-92.8-84.9-168.9-192.6-175.5c.4 5.1 .6 10.3 .6 15.5z"]
};
const faPaste = {
  prefix: 'fas',
  iconName: 'paste',
  icon: [512, 512, ["file-clipboard"], "f0ea", "M160 0c-23.7 0-44.4 12.9-55.4 32L48 32C21.5 32 0 53.5 0 80L0 400c0 26.5 21.5 48 48 48l144 0 0-272c0-44.2 35.8-80 80-80l48 0 0-16c0-26.5-21.5-48-48-48l-56.6 0C204.4 12.9 183.7 0 160 0zM272 128c-26.5 0-48 21.5-48 48l0 272 0 16c0 26.5 21.5 48 48 48l192 0c26.5 0 48-21.5 48-48l0-220.1c0-12.7-5.1-24.9-14.1-33.9l-67.9-67.9c-9-9-21.2-14.1-33.9-14.1L320 128l-48 0zM160 40a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faFileClipboard = faPaste;
const faCodePullRequest = {
  prefix: 'fas',
  iconName: 'code-pull-request',
  icon: [512, 512, [], "e13c", "M305.8 2.1C314.4 5.9 320 14.5 320 24l0 40 16 0c70.7 0 128 57.3 128 128l0 166.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3L400 192c0-35.3-28.7-64-64-64l-16 0 0 40c0 9.5-5.6 18.1-14.2 21.9s-18.8 2.3-25.8-4.1l-80-72c-5.1-4.6-7.9-11-7.9-17.8s2.9-13.3 7.9-17.8l80-72c7-6.3 17.2-7.9 25.8-4.1zM104 80A24 24 0 1 0 56 80a24 24 0 1 0 48 0zm8 73.3l0 205.3c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3l0-205.3C19.7 141 0 112.8 0 80C0 35.8 35.8 0 80 0s80 35.8 80 80c0 32.8-19.7 61-48 73.3zM104 432a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm328 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faClipboardList = {
  prefix: 'fas',
  iconName: 'clipboard-list',
  icon: [384, 512, [], "f46d", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM72 272a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm104-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zM72 368a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm88 0c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16z"]
};
const faTruckRampBox = {
  prefix: 'fas',
  iconName: 'truck-ramp-box',
  icon: [640, 512, ["truck-loading"], "f4de", "M640 0l0 400c0 61.9-50.1 112-112 112c-61 0-110.5-48.7-112-109.3L48.4 502.9c-17.1 4.6-34.6-5.4-39.3-22.5s5.4-34.6 22.5-39.3L352 353.8 352 64c0-35.3 28.7-64 64-64L640 0zM576 400a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM23.1 207.7c-4.6-17.1 5.6-34.6 22.6-39.2l46.4-12.4 20.7 77.3c2.3 8.5 11.1 13.6 19.6 11.3l30.9-8.3c8.5-2.3 13.6-11.1 11.3-19.6l-20.7-77.3 46.4-12.4c17.1-4.6 34.6 5.6 39.2 22.6l41.4 154.5c4.6 17.1-5.6 34.6-22.6 39.2L103.7 384.9c-17.1 4.6-34.6-5.6-39.2-22.6L23.1 207.7z"]
};
const faTruckLoading = faTruckRampBox;
const faUserCheck = {
  prefix: 'fas',
  iconName: 'user-check',
  icon: [640, 512, [], "f4fc", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM625 177L497 305c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L591 143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faVialVirus = {
  prefix: 'fas',
  iconName: 'vial-virus',
  icon: [512, 512, [], "e597", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l0 288c0 53 43 96 96 96c28.6 0 54.2-12.5 71.8-32.3c.1-14.2 5.6-28.3 16.4-39.1c.2-.2 .1-.6-.2-.6c-30.9 0-56-25.1-56-56s25.1-56 56-56c.3 0 .4-.4 .2-.6c-21.9-21.9-21.9-57.3 0-79.2c2.4-2.4 5-4.6 7.8-6.5L224 96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0L96 32 32 32zM96 192l0-96 64 0 0 96-64 0zM216 376c28.8 0 43.2 34.8 22.9 55.2c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0c20.4-20.4 55.2-5.9 55.2 22.9c0 13.3 10.7 24 24 24s24-10.7 24-24c0-28.8 34.8-43.2 55.2-22.9c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9C444.8 410.8 459.2 376 488 376c13.3 0 24-10.7 24-24s-10.7-24-24-24c-28.8 0-43.2-34.8-22.9-55.2c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0C410.8 259.2 376 244.8 376 216c0-13.3-10.7-24-24-24s-24 10.7-24 24c0 28.8-34.8 43.2-55.2 22.9c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9c20.4 20.4 5.9 55.2-22.9 55.2c-13.3 0-24 10.7-24 24s10.7 24 24 24zm104-88a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm40 96a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faSheetPlastic = {
  prefix: 'fas',
  iconName: 'sheet-plastic',
  icon: [384, 512, [], "e571", "M0 448c0 35.3 28.7 64 64 64l160 0 0-128c0-17.7 14.3-32 32-32l128 0 0-288c0-35.3-28.7-64-64-64L64 0C28.7 0 0 28.7 0 64L0 448zM171.3 75.3l-96 96c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l96-96c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6zm96 32l-160 160c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l160-160c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6zM384 384l-128 0 0 128L384 384z"]
};
const faBlog = {
  prefix: 'fas',
  iconName: 'blog',
  icon: [512, 512, [], "f781", "M192 32c0 17.7 14.3 32 32 32c123.7 0 224 100.3 224 224c0 17.7 14.3 32 32 32s32-14.3 32-32C512 128.9 383.1 0 224 0c-17.7 0-32 14.3-32 32zm0 96c0 17.7 14.3 32 32 32c70.7 0 128 57.3 128 128c0 17.7 14.3 32 32 32s32-14.3 32-32c0-106-86-192-192-192c-17.7 0-32 14.3-32 32zM96 144c0-26.5-21.5-48-48-48S0 117.5 0 144L0 368c0 79.5 64.5 144 144 144s144-64.5 144-144s-64.5-144-144-144l-16 0 0 96 16 0c26.5 0 48 21.5 48 48s-21.5 48-48 48s-48-21.5-48-48l0-224z"]
};
const faUserNinja = {
  prefix: 'fas',
  iconName: 'user-ninja',
  icon: [448, 512, [129399], "f504", "M224 256c-57.2 0-105.6-37.5-122-89.3c-1.1 1.3-2.2 2.6-3.5 3.8c-15.8 15.8-38.8 20.7-53.6 22.1c-8.1 .8-14.6-5.7-13.8-13.8c1.4-14.7 6.3-37.8 22.1-53.6c5.8-5.8 12.6-10.1 19.6-13.4c-7-3.2-13.8-7.6-19.6-13.4C37.4 82.7 32.6 59.7 31.1 44.9c-.8-8.1 5.7-14.6 13.8-13.8c14.7 1.4 37.8 6.3 53.6 22.1c4.8 4.8 8.7 10.4 11.7 16.1C131.4 28.2 174.4 0 224 0c70.7 0 128 57.3 128 128s-57.3 128-128 128zM0 482.3C0 399.5 56.4 330 132.8 309.9c6-1.6 12.2 .9 15.9 5.8l62.5 83.3c6.4 8.5 19.2 8.5 25.6 0l62.5-83.3c3.7-4.9 9.9-7.4 15.9-5.8C391.6 330 448 399.5 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM160 96c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L160 96z"]
};
const faPersonArrowUpFromLine = {
  prefix: 'fas',
  iconName: 'person-arrow-up-from-line',
  icon: [640, 512, [], "e539", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 352l0-96 16 0 0 96-16 0zm-64 0l-88 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l120 0 80 0 376 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-344 0 0-191.1 28.6 47.5c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-58.3-97c-17.4-28.9-48.6-46.6-82.3-46.6l-29.7 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9 120 448zM598.6 121.4l-80-80c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L464 141.3 464 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-242.7 25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z"]
};
const faScrollTorah = {
  prefix: 'fas',
  iconName: 'scroll-torah',
  icon: [640, 512, ["torah"], "f6a0", "M96 480L96 32C96 14.3 74.5 0 48 0S0 14.3 0 32L0 480c0 17.7 21.5 32 48 32s48-14.3 48-32zM512 32L128 32l0 448 384 0 0-448zM592 0c-26.5 0-48 14.3-48 32l0 448c0 17.7 21.5 32 48 32s48-14.3 48-32l0-448c0-17.7-21.5-32-48-32zM196 313.7c0-3.2 .9-6.4 2.5-9.2L226.7 256l-28.3-48.5c-1.6-2.8-2.5-6-2.5-9.2c0-10.1 8.2-18.3 18.3-18.3l56.7 0 31.4-53.9c3.6-6.3 10.3-10.1 17.6-10.1s13.9 3.8 17.6 10.1L369 180l56.7 0c10.1 0 18.3 8.2 18.3 18.3c0 3.2-.9 6.4-2.5 9.2L413.3 256l28.3 48.5c1.6 2.8 2.5 6 2.5 9.2c0 10.1-8.2 18.3-18.3 18.3L369 332l-31.4 53.9c-3.6 6.3-10.3 10.1-17.6 10.1s-13.9-3.8-17.6-10.1L271 332l-56.7 0c-10.1 0-18.3-8.2-18.3-18.3zm124 54.7L341.2 332l-42.4 0L320 368.4zM254.5 256l30.3 52 70.4 0 30.3-52-30.3-52-70.4 0-30.3 52zm144.9 23.8L383 308l32.8 0-16.4-28.2zM415.8 204L383 204l16.4 28.2L415.8 204zM320 143.6L298.8 180l42.4 0L320 143.6zM224.2 204l16.4 28.2L257 204l-32.8 0zM257 308l-16.4-28.2L224.2 308l32.8 0z"]
};
const faTorah = faScrollTorah;
const faBroomBall = {
  prefix: 'fas',
  iconName: 'broom-ball',
  icon: [576, 512, ["quidditch", "quidditch-broom-ball"], "f458", "M566.6 9.4c12.5 12.5 12.5 32.8 0 45.3l-192 192 34.7 34.7c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6l-29.1 0L256 211.7l0-29.1c0-12.5 10.1-22.6 22.6-22.6c6 0 11.8 2.4 16 6.6l34.7 34.7 192-192c12.5-12.5 32.8-12.5 45.3 0zm-344 225.5L341.1 353.4c3.7 42.7-11.7 85.2-42.3 115.8C271.4 496.6 234.2 512 195.5 512L22.1 512C9.9 512 0 502.1 0 489.9c0-6.3 2.7-12.3 7.3-16.5L133.7 359.7c4.2-3.7-.4-10.4-5.4-7.9L77.2 377.4c-6.1 3-13.2-1.4-13.2-8.2c0-31.5 12.5-61.7 34.8-84l8-8c30.6-30.6 73.1-45.9 115.8-42.3zM464 352a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faQuidditch = faBroomBall;
const faQuidditchBroomBall = faBroomBall;
const faToggleOff = {
  prefix: 'fas',
  iconName: 'toggle-off',
  icon: [576, 512, [], "f204", "M384 128c70.7 0 128 57.3 128 128s-57.3 128-128 128l-192 0c-70.7 0-128-57.3-128-128s57.3-128 128-128l192 0zM576 256c0-106-86-192-192-192L192 64C86 64 0 150 0 256S86 448 192 448l192 0c106 0 192-86 192-192zM192 352a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"]
};
const faBoxArchive = {
  prefix: 'fas',
  iconName: 'box-archive',
  icon: [512, 512, ["archive"], "f187", "M32 32l448 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96L0 64C0 46.3 14.3 32 32 32zm0 128l448 0 0 256c0 35.3-28.7 64-64 64L96 480c-35.3 0-64-28.7-64-64l0-256zm128 80c0 8.8 7.2 16 16 16l160 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-160 0c-8.8 0-16 7.2-16 16z"]
};
const faArchive = faBoxArchive;
const faPersonDrowning = {
  prefix: 'fas',
  iconName: 'person-drowning',
  icon: [576, 512, [], "e545", "M192 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32.2c0 54.1 23.5 104 62.2 138.3l-21 146.7c7.8 2.1 15.5 3.3 22.8 3.3c21.1 0 42-8.5 59.2-20.3c22.1-15.5 51.6-15.5 73.7 0c12.4 8.5 26.1 14.8 39.7 18l17.7-97.6c10.7-1.2 21.3-3.1 31.9-5.5l105-23.9c17.2-3.9 28-21.1 24.1-38.3s-21.1-28-38.3-24.1L400 216.6c-41 9.3-83.7 7.5-123.7-5.2c-50.2-16-84.3-62.6-84.3-115.3L192 64zM320 192a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM306.5 389.9c-11.1-7.9-25.9-7.9-37 0C247 405.4 219.5 416 192 416c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 469.7 159 480 192 480c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 405.2 410.9 416 384 416c-27.5 0-55-10.6-77.5-26.1z"]
};
const faArrowDown91 = {
  prefix: 'fas',
  iconName: 'arrow-down-9-1',
  icon: [576, 512, ["sort-numeric-desc", "sort-numeric-down-alt"], "f886", "M160 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L192 365.7 192 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 301.7L95.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C142.5 476.2 151 480 160 480zM450.7 294c-8.3-6-19.1-7.7-28.8-4.4l-48 16c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l5.9-2 0 51.6-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l48 0 48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-96c0-10.3-4.9-19.9-13.3-26zM418.3 91a32 32 0 1 1 27.4 57.9A32 32 0 1 1 418.3 91zM405.1 203.8l-6.8 9.2c-10.5 14.2-7.5 34.2 6.7 44.8s34.2 7.5 44.8-6.7l48.8-65.8c14-18.9 21.5-41.7 21.5-65.2c0-48.6-39.4-88-88-88s-88 39.4-88 88c0 39.2 25.6 72.4 61.1 83.8z"]
};
const faSortNumericDesc = faArrowDown91;
const faSortNumericDownAlt = faArrowDown91;
const faFaceGrinTongueSquint = {
  prefix: 'fas',
  iconName: 'face-grin-tongue-squint',
  icon: [512, 512, [128541, "grin-tongue-squint"], "f58a", "M0 256C0 368.9 73.1 464.7 174.5 498.8C165.3 484 160 466.6 160 448l0-47.3c-24-17.5-43.1-41.4-54.8-69.2c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19c12.3-3.8 24.3 6.9 19.3 18.7c-11.8 28-31.1 52-55.4 69.6l0 46.9c0 18.6-5.3 36-14.5 50.8C438.9 464.7 512 368.9 512 256C512 114.6 397.4 0 256 0S0 114.6 0 256zM116 141.1c0-9 9.6-14.7 17.5-10.5l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6zm262.5-10.5c7.9-4.2 17.5 1.5 17.5 10.5c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9zM320 448l0-45.4c0-14.7-11.9-26.6-26.6-26.6l-2 0c-11.3 0-21.1 7.9-23.6 18.9c-2.8 12.6-20.8 12.6-23.6 0c-2.5-11.1-12.3-18.9-23.6-18.9l-2 0c-14.7 0-26.6 11.9-26.6 26.6l0 45.4c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faGrinTongueSquint = faFaceGrinTongueSquint;
const faSprayCan = {
  prefix: 'fas',
  iconName: 'spray-can',
  icon: [512, 512, [], "f5bd", "M128 0l64 0c17.7 0 32 14.3 32 32l0 96L96 128l0-96c0-17.7 14.3-32 32-32zM0 256c0-53 43-96 96-96l128 0c53 0 96 43 96 96l0 208c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 256zm240 80A80 80 0 1 0 80 336a80 80 0 1 0 160 0zM256 64a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM384 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM448 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM384 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faTruckMonster = {
  prefix: 'fas',
  iconName: 'truck-monster',
  icon: [640, 512, [], "f63b", "M288 64l0 64 128 0L368 64l-80 0zM419.2 25.6L496 128l80 0c17.7 0 32 14.3 32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32c-29.2-38.9-75.7-64-128-64s-98.8 25.1-128 64l-64 0c-29.2-38.9-75.7-64-128-64s-98.8 25.1-128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c0-17.7 14.3-32 32-32l160 0 0-80c0-26.5 21.5-48 48-48l96 0c20.1 0 39.1 9.5 51.2 25.6zM152 256l16 0c12.1 0 22.1 8.9 23.8 20.6c7.6 2.2 14.9 5.3 21.7 9c9.4-7 22.8-6.3 31.3 2.3l11.3 11.3c8.6 8.6 9.3 21.9 2.3 31.3c3.7 6.8 6.8 14.1 9 21.7c11.6 1.7 20.6 11.7 20.6 23.8l0 16c0 12.1-8.9 22.1-20.6 23.8c-2.2 7.6-5.3 14.9-9 21.7c7 9.4 6.3 22.8-2.3 31.3l-11.3 11.3c-8.6 8.6-21.9 9.3-31.3 2.2c-6.8 3.7-14.1 6.8-21.7 9C190.1 503.1 180.1 512 168 512l-16 0c-12.1 0-22.1-8.9-23.8-20.6c-7.6-2.2-14.9-5.3-21.7-9c-9.4 7.1-22.8 6.3-31.3-2.2L63.8 468.9c-8.6-8.6-9.3-21.9-2.3-31.3c-3.7-6.9-6.8-14.1-9-21.8C40.9 414.1 32 404.1 32 392l0-16c0-12.1 8.9-22.1 20.6-23.8c2.2-7.6 5.3-14.9 9-21.8c-7-9.4-6.3-22.8 2.3-31.3l11.3-11.3c8.6-8.6 21.9-9.3 31.3-2.3c6.8-3.7 14.1-6.8 21.7-9c1.7-11.6 11.7-20.6 23.8-20.6zm8 176a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM448.2 276.6c1.7-11.6 11.7-20.6 23.8-20.6l16 0c12.1 0 22.1 8.9 23.8 20.6c7.6 2.2 14.9 5.3 21.8 9c9.4-7 22.8-6.3 31.3 2.3l11.3 11.3c8.6 8.6 9.3 21.9 2.2 31.3c3.7 6.8 6.8 14.1 9 21.7c11.6 1.7 20.6 11.7 20.6 23.8l0 16c0 12.1-8.9 22.1-20.6 23.8c-2.2 7.6-5.3 14.9-9 21.7c7 9.4 6.3 22.8-2.2 31.3l-11.3 11.3c-8.6 8.6-21.9 9.3-31.3 2.2c-6.9 3.7-14.1 6.8-21.8 9C510.1 503.1 500.1 512 488 512l-16 0c-12.1 0-22.1-8.9-23.8-20.6c-7.6-2.2-14.9-5.3-21.7-9c-9.4 7.1-22.8 6.3-31.3-2.2l-11.3-11.3c-8.6-8.6-9.3-21.9-2.2-31.3c-3.7-6.9-6.8-14.1-9-21.8C360.9 414.1 352 404.1 352 392l0-16c0-12.1 8.9-22.1 20.6-23.8c2.2-7.6 5.3-14.9 9-21.8c-7-9.4-6.3-22.8 2.2-31.3l11.3-11.3c8.6-8.6 21.9-9.3 31.3-2.3c6.8-3.7 14.1-6.8 21.7-9zM528 384a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faW = {
  prefix: 'fas',
  iconName: 'w',
  icon: [576, 512, [119], "57", "M20.8 34c16.5-6.2 35 2.2 41.2 18.7l110.2 294L257.3 55c4-13.7 16.5-23 30.7-23s26.7 9.4 30.7 23l85.1 291.7L514 52.8c6.2-16.5 24.6-24.9 41.2-18.7s24.9 24.7 18.7 41.2l-144 384c-4.8 12.9-17.4 21.3-31.2 20.7s-25.7-9.8-29.5-23L288 178.3 206.7 457c-3.9 13.2-15.8 22.5-29.5 23s-26.3-7.8-31.2-20.7L2 75.2C-4.2 58.7 4.2 40.2 20.8 34z"]
};
const faEarthAfrica = {
  prefix: 'fas',
  iconName: 'earth-africa',
  icon: [512, 512, [127757, "globe-africa"], "f57c", "M177.8 63.2l10 17.4c2.8 4.8 4.2 10.3 4.2 15.9l0 41.4c0 3.9 1.6 7.7 4.3 10.4c6.2 6.2 16.5 5.7 22-1.2l13.6-17c4.7-5.9 12.9-7.7 19.6-4.3l15.2 7.6c3.4 1.7 7.2 2.6 11 2.6c6.5 0 12.8-2.6 17.4-7.2l3.9-3.9c2.9-2.9 7.3-3.6 11-1.8l29.2 14.6c7.8 3.9 12.6 11.8 12.6 20.5c0 10.5-7.1 19.6-17.3 22.2l-35.4 8.8c-7.4 1.8-15.1 1.5-22.4-.9l-32-10.7c-3.3-1.1-6.7-1.7-10.2-1.7c-7 0-13.8 2.3-19.4 6.5L176 212c-10.1 7.6-16 19.4-16 32l0 28c0 26.5 21.5 48 48 48l32 0c8.8 0 16 7.2 16 16l0 48c0 17.7 14.3 32 32 32c10.1 0 19.6-4.7 25.6-12.8l25.6-34.1c8.3-11.1 12.8-24.6 12.8-38.4l0-12.1c0-3.9 2.6-7.3 6.4-8.2l5.3-1.3c11.9-3 20.3-13.7 20.3-26c0-7.1-2.8-13.9-7.8-18.9l-33.5-33.5c-3.7-3.7-3.7-9.7 0-13.4c5.7-5.7 14.1-7.7 21.8-5.1l14.1 4.7c12.3 4.1 25.7-1.5 31.5-13c3.5-7 11.2-10.8 18.9-9.2l27.4 5.5C432 112.4 351.5 48 256 48c-27.7 0-54 5.4-78.2 15.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faGlobeAfrica = faEarthAfrica;
const faRainbow = {
  prefix: 'fas',
  iconName: 'rainbow',
  icon: [640, 512, [127752], "f75b", "M320 96C178.6 96 64 210.6 64 352l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96C0 175.3 143.3 32 320 32s320 143.3 320 320l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96C576 210.6 461.4 96 320 96zm0 192c-35.3 0-64 28.7-64 64l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-70.7 57.3-128 128-128s128 57.3 128 128l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-35.3-28.7-64-64-64zM160 352l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-123.7 100.3-224 224-224s224 100.3 224 224l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-88.4-71.6-160-160-160s-160 71.6-160 160z"]
};
const faCircleNotch = {
  prefix: 'fas',
  iconName: 'circle-notch',
  icon: [512, 512, [], "f1ce", "M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z"]
};
const faTabletScreenButton = {
  prefix: 'fas',
  iconName: 'tablet-screen-button',
  icon: [448, 512, ["tablet-alt"], "f3fa", "M0 64C0 28.7 28.7 0 64 0L384 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM256 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM384 64L64 64l0 320 320 0 0-320z"]
};
const faTabletAlt = faTabletScreenButton;
const faPaw = {
  prefix: 'fas',
  iconName: 'paw',
  icon: [512, 512, [], "f1b0", "M226.5 92.9c14.3 42.9-.3 86.2-32.6 96.8s-70.1-15.6-84.4-58.5s.3-86.2 32.6-96.8s70.1 15.6 84.4 58.5zM100.4 198.6c18.9 32.4 14.3 70.1-10.2 84.1s-59.7-.9-78.5-33.3S-2.7 179.3 21.8 165.3s59.7 .9 78.5 33.3zM69.2 401.2C121.6 259.9 214.7 224 256 224s134.4 35.9 186.8 177.2c3.6 9.7 5.2 20.1 5.2 30.5l0 1.6c0 25.8-20.9 46.7-46.7 46.7c-11.5 0-22.9-1.4-34-4.2l-88-22c-15.3-3.8-31.3-3.8-46.6 0l-88 22c-11.1 2.8-22.5 4.2-34 4.2C84.9 480 64 459.1 64 433.3l0-1.6c0-10.4 1.6-20.8 5.2-30.5zM421.8 282.7c-24.5-14-29.1-51.7-10.2-84.1s54-47.3 78.5-33.3s29.1 51.7 10.2 84.1s-54 47.3-78.5 33.3zM310.1 189.7c-32.3-10.6-46.9-53.9-32.6-96.8s52.1-69.1 84.4-58.5s46.9 53.9 32.6 96.8s-52.1 69.1-84.4 58.5z"]
};
const faCloud = {
  prefix: 'fas',
  iconName: 'cloud',
  icon: [640, 512, [9729], "f0c2", "M0 336c0 79.5 64.5 144 144 144l368 0c70.7 0 128-57.3 128-128c0-61.9-44-113.6-102.4-125.4c4.1-10.7 6.4-22.4 6.4-34.6c0-53-43-96-96-96c-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32C167.6 32 96 103.6 96 192c0 2.7 .1 5.4 .2 8.1C40.2 219.8 0 273.2 0 336z"]
};
const faTrowelBricks = {
  prefix: 'fas',
  iconName: 'trowel-bricks',
  icon: [512, 512, [], "e58a", "M240.8 4.8C250.3 10.6 256 20.9 256 32l0 72 89 0c3.6-13.8 16.1-24 31-24l88 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-88 0c-14.9 0-27.4-10.2-31-24l-89 0 0 72c0 11.1-5.7 21.4-15.2 27.2s-21.2 6.4-31.1 1.4l-192-96C6.8 151.2 0 140.1 0 128s6.8-23.2 17.7-28.6l192-96c9.9-5 21.7-4.4 31.1 1.4zM288 256c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-64zM32 384l96 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm192 0l256 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32z"]
};
const faFaceFlushed = {
  prefix: 'fas',
  iconName: 'face-flushed',
  icon: [512, 512, [128563, "flushed"], "f579", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM176 384c0 8.8 7.2 16 16 16l128 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-128 0c-8.8 0-16 7.2-16 16zm-16-88a72 72 0 1 0 0-144 72 72 0 1 0 0 144zm264-72a72 72 0 1 0 -144 0 72 72 0 1 0 144 0zm-288 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm192 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faFlushed = faFaceFlushed;
const faHospitalUser = {
  prefix: 'fas',
  iconName: 'hospital-user',
  icon: [576, 512, [], "f80d", "M48 0C21.5 0 0 21.5 0 48L0 256l144 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L0 288l0 64 144 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L0 384l0 80c0 26.5 21.5 48 48 48l217.9 0c-6.3-10.2-9.9-22.2-9.9-35.1c0-46.9 25.8-87.8 64-109.2l0-95.9L320 48c0-26.5-21.5-48-48-48L48 0zM152 64l16 0c8.8 0 16 7.2 16 16l0 24 24 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-24 0 0 24c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-24-24 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16l24 0 0-24c0-8.8 7.2-16 16-16zM512 272a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM288 477.1c0 19.3 15.6 34.9 34.9 34.9l218.2 0c19.3 0 34.9-15.6 34.9-34.9c0-51.4-41.7-93.1-93.1-93.1l-101.8 0c-51.4 0-93.1 41.7-93.1 93.1z"]
};
const faTentArrowLeftRight = {
  prefix: 'fas',
  iconName: 'tent-arrow-left-right',
  icon: [576, 512, [], "e57f", "M488.1 6.2c-9.9-8.9-25-8.1-33.9 1.8s-8.1 25 1.8 33.9L489.5 72 86.5 72l33.5-30.2c9.9-8.9 10.7-24 1.8-33.9S97.8-2.7 87.9 6.2l-80 72C2.9 82.7 0 89.2 0 96s2.9 13.3 7.9 17.8l80 72c9.9 8.9 25 8.1 33.9-1.8s8.1-25-1.8-33.9L86.5 120l402.9 0-33.5 30.2c-9.9 8.9-10.7 24-1.8 33.9s24 10.7 33.9 1.8l80-72c5.1-4.6 7.9-11 7.9-17.8s-2.9-13.3-7.9-17.8l-80-72zM307.4 166.5c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S86.7 512 96 512l144 0 16 0c17.7 0 32-14.3 32-32l0-118.1c0-5.5 4.4-9.9 9.9-9.9c3.7 0 7.2 2.1 8.8 5.5l68.4 136.8c5.4 10.8 16.5 17.7 28.6 17.7l60.2 0 16 0c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
};
const faGavel = {
  prefix: 'fas',
  iconName: 'gavel',
  icon: [512, 512, ["legal"], "f0e3", "M318.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-120 120c-12.5 12.5-12.5 32.8 0 45.3l16 16c12.5 12.5 32.8 12.5 45.3 0l4-4L325.4 293.4l-4 4c-12.5 12.5-12.5 32.8 0 45.3l16 16c12.5 12.5 32.8 12.5 45.3 0l120-120c12.5-12.5 12.5-32.8 0-45.3l-16-16c-12.5-12.5-32.8-12.5-45.3 0l-4 4L330.6 74.6l4-4c12.5-12.5 12.5-32.8 0-45.3l-16-16zm-152 288c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l48 48c12.5 12.5 32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-1.4-1.4L272 285.3 226.7 240 168 298.7l-1.4-1.4z"]
};
const faLegal = faGavel;
const faBinoculars = {
  prefix: 'fas',
  iconName: 'binoculars',
  icon: [512, 512, [], "f1e5", "M128 32l32 0c17.7 0 32 14.3 32 32l0 32L96 96l0-32c0-17.7 14.3-32 32-32zm64 96l0 320c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32l0-59.1c0-34.6 9.4-68.6 27.2-98.3C40.9 267.8 49.7 242.4 53 216L60.5 156c2-16 15.6-28 31.8-28l99.8 0zm227.8 0c16.1 0 29.8 12 31.8 28L459 216c3.3 26.4 12.1 51.8 25.8 74.6c17.8 29.7 27.2 63.7 27.2 98.3l0 59.1c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-320 99.8 0zM320 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 32-96 0 0-32zm-32 64l0 160-64 0 0-160 64 0z"]
};
const faMicrophoneSlash = {
  prefix: 'fas',
  iconName: 'microphone-slash',
  icon: [640, 512, [], "f131", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c15.2-26 23.9-56.3 23.9-88.7l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 21.2-5.1 41.1-14.2 58.7L416 300.8 416 96c0-53-43-96-96-96s-96 43-96 96l0 54.3L38.8 5.1zM344 430.4c20.4-2.8 39.7-9.1 57.3-18.2l-43.1-33.9C346.1 382 333.3 384 320 384c-70.7 0-128-57.3-128-128l0-8.7L144.7 210c-.5 1.9-.7 3.9-.7 6l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6z"]
};
const faBoxTissue = {
  prefix: 'fas',
  iconName: 'box-tissue',
  icon: [512, 512, [], "e05b", "M92.5 0L208 0c40 0 52 24 64 48s24 48 64 48l85.2 0C436 96 448 108 448 122.8c0 3.4-.7 6.8-1.9 10L409.6 224 384 288l-256 0-16-64L64.9 35.4c-.6-2.3-.9-4.6-.9-6.9C64 12.8 76.8 0 92.5 0zM79 224l16 64-15 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 256 0 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-13.5 0 25.6-64 19.9 0c26.5 0 48 21.5 48 48l0 112L0 384 0 272c0-26.5 21.5-48 48-48l31 0zM0 416l512 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48l0-48z"]
};
const faMotorcycle = {
  prefix: 'fas',
  iconName: 'motorcycle',
  icon: [640, 512, [127949], "f21c", "M280 32c-13.3 0-24 10.7-24 24s10.7 24 24 24l57.7 0 16.4 30.3L256 192l-45.3-45.3c-12-12-28.3-18.7-45.3-18.7L64 128c-17.7 0-32 14.3-32 32l0 32 96 0c88.4 0 160 71.6 160 160c0 11-1.1 21.7-3.2 32l70.4 0c-2.1-10.3-3.2-21-3.2-32c0-52.2 25-98.6 63.7-127.8l15.4 28.6C402.4 276.3 384 312 384 352c0 70.7 57.3 128 128 128s128-57.3 128-128s-57.3-128-128-128c-13.5 0-26.5 2.1-38.7 6L418.2 128l61.8 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-20.4 0c-7.5 0-14.7 2.6-20.5 7.4L391.7 78.9l-14-26c-7-12.9-20.5-21-35.2-21L280 32zM462.7 311.2l28.2 52.2c6.3 11.7 20.9 16 32.5 9.7s16-20.9 9.7-32.5l-28.2-52.2c2.3-.3 4.7-.4 7.1-.4c35.3 0 64 28.7 64 64s-28.7 64-64 64s-64-28.7-64-64c0-15.5 5.5-29.7 14.7-40.8zM187.3 376c-9.5 23.5-32.5 40-59.3 40c-35.3 0-64-28.7-64-64s28.7-64 64-64c26.9 0 49.9 16.5 59.3 40l66.4 0C242.5 268.8 190.5 224 128 224C57.3 224 0 281.3 0 352s57.3 128 128 128c62.5 0 114.5-44.8 125.8-104l-66.4 0zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faBellConcierge = {
  prefix: 'fas',
  iconName: 'bell-concierge',
  icon: [512, 512, [128718, "concierge-bell"], "f562", "M216 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0 0 33.3C119.6 157.2 32 252.4 32 368l448 0c0-115.6-87.6-210.8-200-222.7l0-33.3 16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0-40 0zM24 400c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 400z"]
};
const faConciergeBell = faBellConcierge;
const faPenRuler = {
  prefix: 'fas',
  iconName: 'pen-ruler',
  icon: [512, 512, ["pencil-ruler"], "f5ae", "M469.3 19.3l23.4 23.4c25 25 25 65.5 0 90.5l-56.4 56.4L322.3 75.7l56.4-56.4c25-25 65.5-25 90.5 0zM44.9 353.2L299.7 98.3 413.7 212.3 158.8 467.1c-6.7 6.7-15.1 11.6-24.2 14.2l-104 29.7c-8.4 2.4-17.4 .1-23.6-6.1s-8.5-15.2-6.1-23.6l29.7-104c2.6-9.2 7.5-17.5 14.2-24.2zM249.4 103.4L103.4 249.4 16 161.9c-18.7-18.7-18.7-49.1 0-67.9L94.1 16c18.7-18.7 49.1-18.7 67.9 0l19.8 19.8c-.3 .3-.7 .6-1 .9l-64 64c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l64-64c.3-.3 .6-.7 .9-1l45.1 45.1zM408.6 262.6l45.1 45.1c-.3 .3-.7 .6-1 .9l-64 64c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l64-64c.3-.3 .6-.7 .9-1L496 350.1c18.7 18.7 18.7 49.1 0 67.9L417.9 496c-18.7 18.7-49.1 18.7-67.9 0l-87.4-87.4L408.6 262.6z"]
};
const faPencilRuler = faPenRuler;
const faPeopleArrows = {
  prefix: 'fas',
  iconName: 'people-arrows',
  icon: [640, 512, ["people-arrows-left-right"], "e068", "M64 64a64 64 0 1 1 128 0A64 64 0 1 1 64 64zM25.9 233.4C29.3 191.9 64 160 105.6 160l44.8 0c27 0 51 13.4 65.5 34.1c-2.7 1.9-5.2 4-7.5 6.3l-64 64c-21.9 21.9-21.9 57.3 0 79.2L192 391.2l0 72.8c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-115.7c-26.5-9.5-44.7-35.8-42.2-65.6l4.1-49.3zM448 64a64 64 0 1 1 128 0A64 64 0 1 1 448 64zM431.6 200.4c-2.3-2.3-4.9-4.4-7.5-6.3c14.5-20.7 38.6-34.1 65.5-34.1l44.8 0c41.6 0 76.3 31.9 79.7 73.4l4.1 49.3c2.5 29.8-15.7 56.1-42.2 65.6L576 464c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-72.8 47.6-47.6c21.9-21.9 21.9-57.3 0-79.2l-64-64zM272 240l0 32 96 0 0-32c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l64 64c9.4 9.4 9.4 24.6 0 33.9l-64 64c-6.9 6.9-17.2 8.9-26.2 5.2s-14.8-12.5-14.8-22.2l0-32-96 0 0 32c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-64-64c-9.4-9.4-9.4-24.6 0-33.9l64-64c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2z"]
};
const faPeopleArrowsLeftRight = faPeopleArrows;
const faMarsAndVenusBurst = {
  prefix: 'fas',
  iconName: 'mars-and-venus-burst',
  icon: [640, 512, [], "e523", "M504 0c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l39 39-22.2 22.2C475.9 78.4 439.6 64 400 64c-88.4 0-160 71.6-160 160c0 80.2 59.1 146.7 136.1 158.2c0 .6-.1 1.2-.1 1.8l0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .4 0 .3 0 .4 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3 0 .3-24 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .2 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1 0 .1c0 0 0 .1 0 .1s0 .1 0 .1l0 .1c0 0 0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 .1 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 .1s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0l24 0-24 0c0 13.3 10.7 24 24 24s24-10.7 24-24l-24 0 24 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0 0 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1s0-.1 0-.1l0-.1c0 0 0-.1 0-.1s0-.1 0-.1l0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.1 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 0-.2 24 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-24 0 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.3 0-.4 0-.3 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4 0-.4c0-.6 0-1.2-.1-1.8c77-11.6 136.1-78 136.1-158.2c0-31.4-9-60.7-24.7-85.4L560 113.9l39 39c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-112c0-13.3-10.7-24-24-24L504 0zM400 128a96 96 0 1 1 0 192 96 96 0 1 1 0-192zM190.9 18.1C188.4 12 182.6 8 176 8s-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L176 286.1l58.6 53.9c4.1 3.8 9.9 5.1 15.2 3.6C223.6 310.8 208 269.2 208 224c0-60.8 28.3-115 72.4-150.2L220.3 92.1l-29.4-74z"]
};
const faSquareCaretRight = {
  prefix: 'fas',
  iconName: 'square-caret-right',
  icon: [448, 512, ["caret-square-right"], "f152", "M448 96c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320zM320 256c0 6.7-2.8 13-7.7 17.6l-112 104c-7 6.5-17.2 8.2-25.9 4.4s-14.4-12.5-14.4-22l0-208c0-9.5 5.7-18.2 14.4-22s18.9-2.1 25.9 4.4l112 104c4.9 4.5 7.7 10.9 7.7 17.6z"]
};
const faCaretSquareRight = faSquareCaretRight;
const faScissors = {
  prefix: 'fas',
  iconName: 'scissors',
  icon: [512, 512, [9984, 9986, 9988, "cut"], "f0c4", "M256 192l-39.5-39.5c4.9-12.6 7.5-26.2 7.5-40.5C224 50.1 173.9 0 112 0S0 50.1 0 112s50.1 112 112 112c14.3 0 27.9-2.7 40.5-7.5L192 256l-39.5 39.5c-12.6-4.9-26.2-7.5-40.5-7.5C50.1 288 0 338.1 0 400s50.1 112 112 112s112-50.1 112-112c0-14.3-2.7-27.9-7.5-40.5L499.2 76.8c7.1-7.1 7.1-18.5 0-25.6c-28.3-28.3-74.1-28.3-102.4 0L256 192zm22.6 150.6L396.8 460.8c28.3 28.3 74.1 28.3 102.4 0c7.1-7.1 7.1-18.5 0-25.6L342.6 278.6l-64 64zM64 112a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm48 240a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faCut = faScissors;
const faSunPlantWilt = {
  prefix: 'fas',
  iconName: 'sun-plant-wilt',
  icon: [640, 512, [], "e57a", "M160 0c-6.3 0-12 3.7-14.6 9.5L120.6 64.9 63.9 43.2c-5.9-2.3-12.6-.8-17 3.6s-5.9 11.1-3.6 17l21.7 56.7L9.5 145.4C3.7 148 0 153.7 0 160s3.7 12 9.5 14.6l55.4 24.8L43.2 256.1c-2.3 5.9-.8 12.6 3.6 17s11.1 5.9 17 3.6l56.7-21.7 24.8 55.4c2.6 5.8 8.3 9.5 14.6 9.5s12-3.7 14.6-9.5l24.8-55.4 56.7 21.7c5.9 2.3 12.6 .8 17-3.6s5.9-11.1 3.6-17l-21.7-56.7 55.4-24.8c5.8-2.6 9.5-8.3 9.5-14.6s-3.7-12-9.5-14.6l-55.4-24.8 21.7-56.7c2.3-5.9 .8-12.6-3.6-17s-11.1-5.9-17-3.6L199.4 64.9 174.6 9.5C172 3.7 166.3 0 160 0zm0 96a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm312 16c0-17.7 14.3-32 32-32s32 14.3 32 32l0 53.4c-14.8 7.7-24 23.1-24 44.6c0 16.8 16 44 37.4 67.2c5.8 6.2 15.5 6.2 21.2 0C624 318 640 290.7 640 274c0-21.5-9.2-37-24-44.6l0-53.4c0-44.2-35.8-80-80-80s-80 35.8-80 80l0 22.7c-9.8-4.3-20.6-6.7-32-6.7c-44.2 0-80 35.8-80 80l0 21.4c-14.8 7.7-24 23.1-24 44.6c0 16.8 16 44 37.4 67.2c5.8 6.2 15.5 6.2 21.2 0C400 382 416 354.7 416 338c0-21.5-9.2-37-24-44.6l0-21.4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 8 0 168L32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-104 0 0-168 0-8 0-96z"]
};
const faToiletsPortable = {
  prefix: 'fas',
  iconName: 'toilets-portable',
  icon: [576, 512, [], "e584", "M32 0L224 0c17.7 0 32 14.3 32 32l0 32L0 64 0 32C0 14.3 14.3 0 32 0zM0 96l24 0 208 0 24 0 0 24 0 368c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8L48 480l0 8c0 13.3-10.7 24-24 24s-24-10.7-24-24L0 120 0 96zM192 224c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8-7.2-16-16-16zM352 0L544 0c17.7 0 32 14.3 32 32l0 32L320 64l0-32c0-17.7 14.3-32 32-32zM320 96l24 0 208 0 24 0 0 24 0 368c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8-160 0 0 8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-368 0-24zM512 224c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8-7.2-16-16-16z"]
};
const faHockeyPuck = {
  prefix: 'fas',
  iconName: 'hockey-puck',
  icon: [512, 512, [], "f453", "M256 256C114.6 256 0 213 0 160s114.6-96 256-96s256 43 256 96s-114.6 96-256 96zm192.3 1.8c24.7-9.3 46.9-21 63.7-35.6L512 352c0 53-114.6 96-256 96S0 405 0 352L0 222.3c16.8 14.6 39 26.3 63.7 35.6C114.5 276.9 182.5 288 256 288s141.5-11.1 192.3-30.2z"]
};
const faTable = {
  prefix: 'fas',
  iconName: 'table',
  icon: [512, 512, [], "f0ce", "M64 256l0-96 160 0 0 96L64 256zm0 64l160 0 0 96L64 416l0-96zm224 96l0-96 160 0 0 96-160 0zM448 256l-160 0 0-96 160 0 0 96zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"]
};
const faMagnifyingGlassArrowRight = {
  prefix: 'fas',
  iconName: 'magnifying-glass-arrow-right',
  icon: [512, 512, [], "e521", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM241 119c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31L120 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l118.1 0-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9l-72-72z"]
};
const faTachographDigital = {
  prefix: 'fas',
  iconName: 'tachograph-digital',
  icon: [640, 512, ["digital-tachograph"], "f566", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l512 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm32 64l224 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L96 256c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zM64 368c0-8.8 7.2-16 16-16l256 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 384c-8.8 0-16-7.2-16-16zm320 0c0-8.8 7.2-16 16-16l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16zM80 288a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm80-16a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm80-16a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faDigitalTachograph = faTachographDigital;
const faUsersSlash = {
  prefix: 'fas',
  iconName: 'users-slash',
  icon: [640, 512, [], "e073", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L440.6 320l178.1 0c11.8 0 21.3-9.6 21.3-21.3C640 239.8 592.2 192 533.3 192l-42.7 0c-15.9 0-31 3.5-44.6 9.7c1.3 7.2 1.9 14.7 1.9 22.3c0 30.2-10.5 58-28 79.9l-25.2-19.7C408.1 267.7 416 246.8 416 224c0-53-43-96-96-96c-31.1 0-58.7 14.8-76.3 37.7l-40.6-31.8c13-14.2 20.9-33.1 20.9-53.9c0-44.2-35.8-80-80-80C116.3 0 91.9 14.1 77.5 35.5L38.8 5.1zM106.7 192C47.8 192 0 239.8 0 298.7C0 310.4 9.6 320 21.3 320l213.3 0c.2 0 .4 0 .7 0c-20.6-18.2-35.2-42.8-40.8-70.8L121.8 192l-15.2 0zM261.3 352C187.7 352 128 411.7 128 485.3c0 14.7 11.9 26.7 26.7 26.7l330.7 0c10.5 0 19.5-6 23.9-14.8L324.9 352l-63.6 0zM512 160A80 80 0 1 0 512 0a80 80 0 1 0 0 160z"]
};
const faClover = {
  prefix: 'fas',
  iconName: 'clover',
  icon: [448, 512, [], "e139", "M216.6 49.9C205.1 38.5 189.5 32 173.3 32C139.4 32 112 59.4 112 93.3l0 4.9c0 12 3.3 23.7 9.4 34l18.8 31.3c1.1 1.8 1.2 3.1 1 4.2c-.2 1.2-.8 2.5-2 3.6s-2.4 1.8-3.6 2c-1 .2-2.4 .1-4.2-1l-31.3-18.8c-10.3-6.2-22-9.4-34-9.4l-4.9 0C27.4 144 0 171.4 0 205.3c0 16.2 6.5 31.8 17.9 43.3l1.2 1.2c3.4 3.4 3.4 9 0 12.4l-1.2 1.2C6.5 274.9 0 290.5 0 306.7C0 340.6 27.4 368 61.3 368l4.9 0c12 0 23.7-3.3 34-9.4l31.3-18.8c1.8-1.1 3.1-1.2 4.2-1c1.2 .2 2.5 .8 3.6 2s1.8 2.4 2 3.6c.2 1 .1 2.4-1 4.2l-18.8 31.3c-6.2 10.3-9.4 22-9.4 34l0 4.9c0 33.8 27.4 61.3 61.3 61.3c16.2 0 31.8-6.5 43.3-17.9l1.2-1.2c3.4-3.4 9-3.4 12.4 0l1.2 1.2c11.5 11.5 27.1 17.9 43.3 17.9c33.8 0 61.3-27.4 61.3-61.3l0-4.9c0-12-3.3-23.7-9.4-34l-18.8-31.3c-1.1-1.8-1.2-3.1-1-4.2c.2-1.2 .8-2.5 2-3.6s2.4-1.8 3.6-2c1-.2 2.4-.1 4.2 1l31.3 18.8c10.3 6.2 22 9.4 34 9.4l4.9 0c33.8 0 61.3-27.4 61.3-61.3c0-16.2-6.5-31.8-17.9-43.3l-1.2-1.2c-3.4-3.4-3.4-9 0-12.4l1.2-1.2c11.5-11.5 17.9-27.1 17.9-43.3c0-33.8-27.4-61.3-61.3-61.3l-4.9 0c-12 0-23.7 3.3-34 9.4l-31.3 18.8c-1.8 1.1-3.1 1.2-4.2 1c-1.2-.2-2.5-.8-3.6-2s-1.8-2.4-2-3.6c-.2-1-.1-2.4 1-4.2l18.8-31.3c6.2-10.3 9.4-22 9.4-34l0-4.9C336 59.4 308.6 32 274.7 32c-16.2 0-31.8 6.5-43.3 17.9l-1.2 1.2c-3.4 3.4-9 3.4-12.4 0l-1.2-1.2z"]
};
const faReply = {
  prefix: 'fas',
  iconName: 'reply',
  icon: [512, 512, [61714, "mail-reply"], "f3e5", "M205 34.8c11.5 5.1 19 16.6 19 29.2l0 64 112 0c97.2 0 176 78.8 176 176c0 113.3-81.5 163.9-100.2 174.1c-2.5 1.4-5.3 1.9-8.1 1.9c-10.9 0-19.7-8.9-19.7-19.7c0-7.5 4.3-14.4 9.8-19.5c9.4-8.8 22.2-26.4 22.2-56.7c0-53-43-96-96-96l-96 0 0 64c0 12.6-7.4 24.1-19 29.2s-25 3-34.4-5.4l-160-144C3.9 225.7 0 217.1 0 208s3.9-17.7 10.6-23.8l160-144c9.4-8.5 22.9-10.6 34.4-5.4z"]
};
const faMailReply = faReply;
const faStarAndCrescent = {
  prefix: 'fas',
  iconName: 'star-and-crescent',
  icon: [512, 512, [9770], "f699", "M0 256C0 114.6 114.6 0 256 0c33 0 64.6 6.3 93.6 17.7c7.4 2.9 11.5 10.7 9.8 18.4s-8.8 13-16.7 12.4c-4.8-.3-9.7-.5-14.6-.5c-114.9 0-208 93.1-208 208s93.1 208 208 208c4.9 0 9.8-.2 14.6-.5c7.9-.5 15 4.7 16.7 12.4s-2.4 15.5-9.8 18.4C320.6 505.7 289 512 256 512C114.6 512 0 397.4 0 256zM375.4 137.4c3.5-7.1 13.7-7.1 17.2 0l31.5 63.8c1.4 2.8 4.1 4.8 7.2 5.3l70.4 10.2c7.9 1.1 11 10.8 5.3 16.4l-50.9 49.6c-2.3 2.2-3.3 5.4-2.8 8.5l12 70.1c1.3 7.8-6.9 13.8-13.9 10.1l-63-33.1c-2.8-1.5-6.1-1.5-8.9 0l-63 33.1c-7 3.7-15.3-2.3-13.9-10.1l12-70.1c.5-3.1-.5-6.3-2.8-8.5L261 233.1c-5.7-5.6-2.6-15.2 5.3-16.4l70.4-10.2c3.1-.5 5.8-2.4 7.2-5.3l31.5-63.8z"]
};
const faHouseFire = {
  prefix: 'fas',
  iconName: 'house-fire',
  icon: [640, 512, [], "e50c", "M288 350.1l0 1.9-32 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L447.3 128.1c-12.3-1-25 3-34.8 11.7c-35.4 31.6-65.6 67.7-87.3 102.8C304.3 276.5 288 314.9 288 350.1zM480 512c-88.4 0-160-71.6-160-160c0-76.7 62.5-144.7 107.2-179.4c5-3.9 10.9-5.8 16.8-5.8c7.9-.1 16 3.1 22 9.2l46 46 11.3-11.3c11.7-11.7 30.6-12.7 42.3-1C624.5 268 640 320.2 640 352c0 88.4-71.6 160-160 160zm64-111.8c0-36.5-37-73-54.8-88.4c-5.4-4.7-13.1-4.7-18.5 0C453 327.1 416 363.6 416 400.2c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faSquareMinus = {
  prefix: 'fas',
  iconName: 'square-minus',
  icon: [448, 512, [61767, "minus-square"], "f146", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm88 200l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faMinusSquare = faSquareMinus;
const faHelicopter = {
  prefix: 'fas',
  iconName: 'helicopter',
  icon: [640, 512, [128641], "f533", "M128 32c0-17.7 14.3-32 32-32L544 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L384 64l0 64 32 0c88.4 0 160 71.6 160 160l0 64c0 17.7-14.3 32-32 32l-160 0-64 0c-20.1 0-39.1-9.5-51.2-25.6l-71.4-95.2c-3.5-4.7-8.3-8.3-13.7-10.5L47.2 198.1c-9.5-3.8-16.7-12-19.2-22L5 83.9C2.4 73.8 10.1 64 20.5 64L48 64c10.1 0 19.6 4.7 25.6 12.8L112 128l208 0 0-64L160 64c-17.7 0-32-14.3-32-32zM384 320l128 0 0-32c0-53-43-96-96-96l-32 0 0 128zM630.6 425.4c12.5 12.5 12.5 32.8 0 45.3l-3.9 3.9c-24 24-56.6 37.5-90.5 37.5L256 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l280.2 0c17 0 33.3-6.7 45.3-18.7l3.9-3.9c12.5-12.5 32.8-12.5 45.3 0z"]
};
const faCompass = {
  prefix: 'fas',
  iconName: 'compass',
  icon: [512, 512, [129517], "f14e", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm50.7-186.9L162.4 380.6c-19.4 7.5-38.5-11.6-31-31l55.5-144.3c3.3-8.5 9.9-15.1 18.4-18.4l144.3-55.5c19.4-7.5 38.5 11.6 31 31L325.1 306.7c-3.2 8.5-9.9 15.1-18.4 18.4zM288 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faSquareCaretDown = {
  prefix: 'fas',
  iconName: 'square-caret-down',
  icon: [448, 512, ["caret-square-down"], "f150", "M384 480c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0zM224 352c-6.7 0-13-2.8-17.6-7.7l-104-112c-6.5-7-8.2-17.2-4.4-25.9s12.5-14.4 22-14.4l208 0c9.5 0 18.2 5.7 22 14.4s2.1 18.9-4.4 25.9l-104 112c-4.5 4.9-10.9 7.7-17.6 7.7z"]
};
const faCaretSquareDown = faSquareCaretDown;
const faFileCircleQuestion = {
  prefix: 'fas',
  iconName: 'file-circle-question',
  icon: [576, 512, [], "e4ef", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM368 321.6l0 6.4c0 8.8 7.2 16 16 16s16-7.2 16-16l0-6.4c0-5.3 4.3-9.6 9.6-9.6l40.5 0c7.7 0 13.9 6.2 13.9 13.9c0 5.2-2.9 9.9-7.4 12.3l-32 16.8c-5.3 2.8-8.6 8.2-8.6 14.2l0 14.8c0 8.8 7.2 16 16 16s16-7.2 16-16l0-5.1 23.5-12.3c15.1-7.9 24.5-23.6 24.5-40.6c0-25.4-20.6-45.9-45.9-45.9l-40.5 0c-23 0-41.6 18.6-41.6 41.6z"]
};
const faLaptopCode = {
  prefix: 'fas',
  iconName: 'laptop-code',
  icon: [640, 512, [], "f5fc", "M64 96c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 256-64 0 0-256L128 96l0 256-64 0L64 96zM0 403.2C0 392.6 8.6 384 19.2 384l601.6 0c10.6 0 19.2 8.6 19.2 19.2c0 42.4-34.4 76.8-76.8 76.8L76.8 480C34.4 480 0 445.6 0 403.2zM281 209l-31 31 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-48-48c-9.4-9.4-9.4-24.6 0-33.9l48-48c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM393 175l48 48c9.4 9.4 9.4 24.6 0 33.9l-48 48c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"]
};
const faSwatchbook = {
  prefix: 'fas',
  iconName: 'swatchbook',
  icon: [512, 512, [], "f5c3", "M0 32C0 14.3 14.3 0 32 0L160 0c17.7 0 32 14.3 32 32l0 384c0 53-43 96-96 96s-96-43-96-96L0 32zM223.6 425.9c.3-3.3 .4-6.6 .4-9.9l0-262 75.4-75.4c12.5-12.5 32.8-12.5 45.3 0l90.5 90.5c12.5 12.5 12.5 32.8 0 45.3L223.6 425.9zM182.8 512l192-192L480 320c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-297.2 0zM128 64L64 64l0 64 64 0 0-64zM64 192l0 64 64 0 0-64-64 0zM96 440a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faPrescriptionBottle = {
  prefix: 'fas',
  iconName: 'prescription-bottle',
  icon: [384, 512, [], "f485", "M0 32C0 14.3 14.3 0 32 0L352 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64L0 32zm32 96l320 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-32 112 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L32 384l0-64 112 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L32 288l0-64 112 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L32 192l0-64z"]
};
const faBars = {
  prefix: 'fas',
  iconName: 'bars',
  icon: [448, 512, ["navicon"], "f0c9", "M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
};
const faNavicon = faBars;
const faPeopleGroup = {
  prefix: 'fas',
  iconName: 'people-group',
  icon: [640, 512, [], "e533", "M72 88a56 56 0 1 1 112 0A56 56 0 1 1 72 88zM64 245.7C54 256.9 48 271.8 48 288s6 31.1 16 42.3l0-84.7zm144.4-49.3C178.7 222.7 160 261.2 160 304c0 34.3 12 65.8 32 90.5l0 21.5c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-26.8C26.2 371.2 0 332.7 0 288c0-61.9 50.1-112 112-112l32 0c24 0 46.2 7.5 64.4 20.3zM448 416l0-21.5c20-24.7 32-56.2 32-90.5c0-42.8-18.7-81.3-48.4-107.7C449.8 183.5 472 176 496 176l32 0c61.9 0 112 50.1 112 112c0 44.7-26.2 83.2-64 101.2l0 26.8c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32zm8-328a56 56 0 1 1 112 0A56 56 0 1 1 456 88zM576 245.7l0 84.7c10-11.3 16-26.1 16-42.3s-6-31.1-16-42.3zM320 32a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM240 304c0 16.2 6 31 16 42.3l0-84.7c-10 11.3-16 26.1-16 42.3zm144-42.3l0 84.7c10-11.3 16-26.1 16-42.3s-6-31.1-16-42.3zM448 304c0 44.7-26.2 83.2-64 101.2l0 42.8c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-42.8c-37.8-18-64-56.5-64-101.2c0-61.9 50.1-112 112-112l32 0c61.9 0 112 50.1 112 112z"]
};
const faHourglassEnd = {
  prefix: 'fas',
  iconName: 'hourglass-end',
  icon: [384, 512, [8987, "hourglass-3"], "f253", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1L146.7 256 78.9 323.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 256 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1L237.3 256l67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32s-14.3-32-32-32L320 0 64 0 32 0zM96 75l0-11 192 0 0 11c0 25.5-10.1 49.9-28.1 67.9L192 210.7l-67.9-67.9C106.1 124.9 96 100.4 96 75z"]
};
const faHourglass3 = faHourglassEnd;
const faHeartCrack = {
  prefix: 'fas',
  iconName: 'heart-crack',
  icon: [512, 512, [128148, "heart-broken"], "f7a9", "M119.4 44.1c23.3-3.9 46.8-1.9 68.6 5.3l49.8 77.5-75.4 75.4c-1.5 1.5-2.4 3.6-2.3 5.8s1 4.2 2.6 5.7l112 104c2.9 2.7 7.4 2.9 10.5 .3s3.8-7 1.7-10.4l-60.4-98.1 90.7-75.6c2.6-2.1 3.5-5.7 2.4-8.8L296.8 61.8c28.5-16.7 62.4-23.2 95.7-17.6C461.5 55.6 512 115.2 512 185.1l0 5.8c0 41.5-17.2 81.2-47.6 109.5L283.7 469.1c-7.5 7-17.4 10.9-27.7 10.9s-20.2-3.9-27.7-10.9L47.6 300.4C17.2 272.1 0 232.4 0 190.9l0-5.8c0-69.9 50.5-129.5 119.4-141z"]
};
const faHeartBroken = faHeartCrack;
const faSquareUpRight = {
  prefix: 'fas',
  iconName: 'square-up-right',
  icon: [448, 512, [8599, "external-link-square-alt"], "f360", "M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM160 160c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l40 40-71 71C114 302 112 306.9 112 312s2 10 5.7 13.7l36.7 36.7c3.6 3.6 8.5 5.7 13.7 5.7s10-2 13.7-5.7l71-71 40 40c4.6 4.6 11.5 5.9 17.4 3.5s9.9-8.3 9.9-14.8l0-144c0-8.8-7.2-16-16-16l-144 0z"]
};
const faExternalLinkSquareAlt = faSquareUpRight;
const faFaceKissBeam = {
  prefix: 'fas',
  iconName: 'face-kiss-beam',
  icon: [512, 512, [128537, "kiss-beam"], "f597", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm48.7-198.3c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C274.7 443.1 257.4 448 240 448c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1 .3-.2 .6-.4c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.4-.3-.5-.3-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4zm-87.1-84.9s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faKissBeam = faFaceKissBeam;
const faFilm = {
  prefix: 'fas',
  iconName: 'film',
  icon: [512, 512, [127902], "f008", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM48 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm368-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM48 240l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm368-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM48 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L64 96c-8.8 0-16 7.2-16 16zM416 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM160 128l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L192 96c-17.7 0-32 14.3-32 32zm32 160c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-128 0z"]
};
const faRulerHorizontal = {
  prefix: 'fas',
  iconName: 'ruler-horizontal',
  icon: [640, 512, [], "f547", "M0 336c0 26.5 21.5 48 48 48l544 0c26.5 0 48-21.5 48-48l0-160c0-26.5-21.5-48-48-48l-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0c-26.5 0-48 21.5-48 48L0 336z"]
};
const faPeopleRobbery = {
  prefix: 'fas',
  iconName: 'people-robbery',
  icon: [576, 512, [], "e536", "M488.2 59.1C478.1 99.6 441.7 128 400 128s-78.1-28.4-88.2-68.9L303 24.2C298.8 7.1 281.4-3.3 264.2 1S236.7 22.6 241 39.8l8.7 34.9c11 44 40.2 79.6 78.3 99.6L328 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-305.7c38.1-20 67.3-55.6 78.3-99.6L559 39.8c4.3-17.1-6.1-34.5-23.3-38.8S501.2 7.1 497 24.2l-8.7 34.9zM400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM80 96A48 48 0 1 0 80 0a48 48 0 1 0 0 96zm-8 32c-35.3 0-64 28.7-64 64l0 96 0 .6L8 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-227.3 13 20.5c5.9 9.2 16.1 14.9 27 14.9l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-30.4 0-37.4-58.9C157.6 142 132.1 128 104.7 128L72 128z"]
};
const faLightbulb = {
  prefix: 'fas',
  iconName: 'lightbulb',
  icon: [384, 512, [128161], "f0eb", "M272 384c9.6-31.9 29.5-59.1 49.2-86.2c0 0 0 0 0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C368 78.8 289.2 0 192 0S16 78.8 16 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4c0 0 0 0 0 0c19.8 27.1 39.7 54.4 49.2 86.2l160 0zM192 512c44.2 0 80-35.8 80-80l0-16-160 0 0 16c0 44.2 35.8 80 80 80zM112 176c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80z"]
};
const faCaretLeft = {
  prefix: 'fas',
  iconName: 'caret-left',
  icon: [256, 512, [], "f0d9", "M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"]
};
const faCircleExclamation = {
  prefix: 'fas',
  iconName: 'circle-exclamation',
  icon: [512, 512, ["exclamation-circle"], "f06a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faExclamationCircle = faCircleExclamation;
const faSchoolCircleXmark = {
  prefix: 'fas',
  iconName: 'school-circle-xmark',
  icon: [640, 512, [], "e56d", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l272 0s0 0 0 0l-64 0 0-96c0-35.3 28.7-64 64-64l.3 0 .5 0c3.4-37.7 18.7-72.1 42.2-99.1C350.2 260 335.6 264 320 264c-48.6 0-88-39.4-88-88s39.4-88 88-88s88 39.4 88 88c0 18.3-5.6 35.3-15.1 49.4c29-21 64.6-33.4 103.1-33.4c59.5 0 112.1 29.6 144 74.8L640 144c0-26.5-21.5-48-48-48L473.7 96 337.8 5.4zM96 192l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm0 128l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zM320 128c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16c0-8.8-7.2-16-16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm22.6-144l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L518.6 368z"]
};
const faArrowRightFromBracket = {
  prefix: 'fas',
  iconName: 'arrow-right-from-bracket',
  icon: [512, 512, ["sign-out"], "f08b", "M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 192 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128zM160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0z"]
};
const faSignOut = faArrowRightFromBracket;
const faCircleChevronDown = {
  prefix: 'fas',
  iconName: 'circle-chevron-down',
  icon: [512, 512, ["chevron-circle-down"], "f13a", "M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM135 241c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l87 87 87-87c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 345c-9.4 9.4-24.6 9.4-33.9 0L135 241z"]
};
const faChevronCircleDown = faCircleChevronDown;
const faUnlockKeyhole = {
  prefix: 'fas',
  iconName: 'unlock-keyhole',
  icon: [448, 512, ["unlock-alt"], "f13e", "M224 64c-44.2 0-80 35.8-80 80l0 48 240 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0 0-48C80 64.5 144.5 0 224 0c57.5 0 107 33.7 130.1 82.3c7.6 16 .8 35.1-15.2 42.6s-35.1 .8-42.6-15.2C283.4 82.6 255.9 64 224 64zm32 320c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0z"]
};
const faUnlockAlt = faUnlockKeyhole;
const faCloudShowersHeavy = {
  prefix: 'fas',
  iconName: 'cloud-showers-heavy',
  icon: [512, 512, [], "f740", "M96 320c-53 0-96-43-96-96c0-42.5 27.6-78.6 65.9-91.2C64.7 126.1 64 119.1 64 112C64 50.1 114.1 0 176 0c43.1 0 80.5 24.3 99.2 60c14.7-17.1 36.5-28 60.8-28c44.2 0 80 35.8 80 80c0 5.5-.6 10.8-1.6 16c.5 0 1.1 0 1.6 0c53 0 96 43 96 96s-43 96-96 96L96 320zM81.5 353.9c12.2 5.2 17.8 19.3 12.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6S-3.3 490.7 1.9 478.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6zm120 0c12.2 5.2 17.8 19.3 12.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6s-17.8-19.3-12.6-31.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6zm244.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6s-17.8-19.3-12.6-31.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6s17.8 19.3 12.6 31.5zM313.5 353.9c12.2 5.2 17.8 19.3 12.6 31.5l-48 112c-5.2 12.2-19.3 17.8-31.5 12.6s-17.8-19.3-12.6-31.5l48-112c5.2-12.2 19.3-17.8 31.5-12.6z"]
};
const faHeadphonesSimple = {
  prefix: 'fas',
  iconName: 'headphones-simple',
  icon: [512, 512, ["headphones-alt"], "f58f", "M256 80C141.1 80 48 173.1 48 288l0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24L0 288C0 146.6 114.6 32 256 32s256 114.6 256 256l0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-104c0-114.9-93.1-208-208-208zM80 352c0-35.3 28.7-64 64-64l16 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-16 0c-35.3 0-64-28.7-64-64l0-64zm288-64c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-16 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l16 0z"]
};
const faHeadphonesAlt = faHeadphonesSimple;
const faSitemap = {
  prefix: 'fas',
  iconName: 'sitemap',
  icon: [576, 512, [], "f0e8", "M208 80c0-26.5 21.5-48 48-48l64 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-8 0 0 40 152 0c30.9 0 56 25.1 56 56l0 32 8 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-64 0c-26.5 0-48-21.5-48-48l0-64c0-26.5 21.5-48 48-48l8 0 0-32c0-4.4-3.6-8-8-8l-152 0 0 40 8 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-64 0c-26.5 0-48-21.5-48-48l0-64c0-26.5 21.5-48 48-48l8 0 0-40-152 0c-4.4 0-8 3.6-8 8l0 32 8 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-64 0c-26.5 0-48-21.5-48-48l0-64c0-26.5 21.5-48 48-48l8 0 0-32c0-30.9 25.1-56 56-56l152 0 0-40-8 0c-26.5 0-48-21.5-48-48l0-64z"]
};
const faCircleDollarToSlot = {
  prefix: 'fas',
  iconName: 'circle-dollar-to-slot',
  icon: [512, 512, ["donate"], "f4b9", "M326.7 403.7c-22.1 8-45.9 12.3-70.7 12.3s-48.7-4.4-70.7-12.3l-.8-.3c-30-11-56.8-28.7-78.6-51.4C70 314.6 48 263.9 48 208C48 93.1 141.1 0 256 0S464 93.1 464 208c0 55.9-22 106.6-57.9 144c-1 1-2 2.1-3 3.1c-21.4 21.4-47.4 38.1-76.3 48.6zM256 91.9c-11.1 0-20.1 9-20.1 20.1l0 6c-5.6 1.2-10.9 2.9-15.9 5.1c-15 6.8-27.9 19.4-31.1 37.7c-1.8 10.2-.8 20 3.4 29c4.2 8.8 10.7 15 17.3 19.5c11.6 7.9 26.9 12.5 38.6 16l2.2 .7c13.9 4.2 23.4 7.4 29.3 11.7c2.5 1.8 3.4 3.2 3.7 4c.3 .8 .9 2.6 .2 6.7c-.6 3.5-2.5 6.4-8 8.8c-6.1 2.6-16 3.9-28.8 1.9c-6-1-16.7-4.6-26.2-7.9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-2.2-.7-4.3-1.5-6.4-2.1c-10.5-3.5-21.8 2.2-25.3 12.7s2.2 21.8 12.7 25.3c1.2 .4 2.7 .9 4.4 1.5c7.9 2.7 20.3 6.9 29.8 9.1l0 6.4c0 11.1 9 20.1 20.1 20.1s20.1-9 20.1-20.1l0-5.5c5.3-1 10.5-2.5 15.4-4.6c15.7-6.7 28.4-19.7 31.6-38.7c1.8-10.4 1-20.3-3-29.4c-3.9-9-10.2-15.6-16.9-20.5c-12.2-8.8-28.3-13.7-40.4-17.4l-.8-.2c-14.2-4.3-23.8-7.3-29.9-11.4c-2.6-1.8-3.4-3-3.6-3.5c-.2-.3-.7-1.6-.1-5c.3-1.9 1.9-5.2 8.2-8.1c6.4-2.9 16.4-4.5 28.6-2.6c4.3 .7 17.9 3.3 21.7 4.3c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-4.4-1.2-14.4-3.2-21-4.4l0-6.3c0-11.1-9-20.1-20.1-20.1zM48 352l16 0c19.5 25.9 44 47.7 72.2 64L64 416l0 32 192 0 192 0 0-32-72.2 0c28.2-16.3 52.8-38.1 72.2-64l16 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48l0-64c0-26.5 21.5-48 48-48z"]
};
const faDonate = faCircleDollarToSlot;
const faMemory = {
  prefix: 'fas',
  iconName: 'memory',
  icon: [576, 512, [], "f538", "M64 64C28.7 64 0 92.7 0 128l0 7.4c0 6.8 4.4 12.6 10.1 16.3C23.3 160.3 32 175.1 32 192s-8.7 31.7-21.9 40.3C4.4 236 0 241.8 0 248.6L0 320l576 0 0-71.4c0-6.8-4.4-12.6-10.1-16.3C552.7 223.7 544 208.9 544 192s8.7-31.7 21.9-40.3c5.7-3.7 10.1-9.5 10.1-16.3l0-7.4c0-35.3-28.7-64-64-64L64 64zM576 352L0 352l0 64c0 17.7 14.3 32 32 32l48 0 0-32c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 96 0 0-32c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 96 0 0-32c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 96 0 0-32c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 48 0c17.7 0 32-14.3 32-32l0-64zM192 160l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faRoadSpikes = {
  prefix: 'fas',
  iconName: 'road-spikes',
  icon: [640, 512, [], "e568", "M64 116.8c0-15.8 20.5-22 29.3-8.9L192 256l0-139.2c0-15.8 20.5-22 29.3-8.9L320 256l0-139.2c0-15.8 20.5-22 29.3-8.9L448 256l0-139.2c0-15.8 20.5-22 29.3-8.9L606.8 302.2c14.2 21.3-1.1 49.7-26.6 49.7L512 352l-64 0-64 0-64 0-64 0-64 0L64 352l0-235.2zM32 384l576 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faFireBurner = {
  prefix: 'fas',
  iconName: 'fire-burner',
  icon: [640, 512, [], "e4f1", "M345.7 48.3L358 34.5c5.4-6.1 13.3-8.8 20.9-8.9c7.2 0 14.3 2.6 19.9 7.8c19.7 18.3 39.8 43.2 55 70.6C469 131.2 480 162.2 480 192.2C480 280.8 408.7 352 320 352c-89.6 0-160-71.3-160-159.8c0-37.3 16-73.4 36.8-104.5c20.9-31.3 47.5-59 70.9-80.2C273.4 2.3 280.7-.2 288 0c14.1 .3 23.8 11.4 32.7 21.6c0 0 0 0 0 0c2 2.3 4 4.6 6 6.7l19 19.9zM384 240.2c0-36.5-37-73-54.8-88.4c-5.4-4.7-13.1-4.7-18.5 0C293 167.1 256 203.6 256 240.2c0 35.3 28.7 64 64 64s64-28.7 64-64zM32 288c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 64 448 0 0-64c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 96c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l0-96zM320 480a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm160-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM192 480a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faFlag = {
  prefix: 'fas',
  iconName: 'flag',
  icon: [448, 512, [127988, 61725], "f024", "M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32L0 64 0 368 0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 64.3-16.1c41.1-10.3 84.6-5.5 122.5 13.4c44.2 22.1 95.5 24.8 141.7 7.4l34.7-13c12.5-4.7 20.8-16.6 20.8-30l0-247.7c0-23-24.2-38-44.8-27.7l-9.6 4.8c-46.3 23.2-100.8 23.2-147.1 0c-35.1-17.6-75.4-22-113.5-12.5L64 48l0-16z"]
};
const faHanukiah = {
  prefix: 'fas',
  iconName: 'hanukiah',
  icon: [640, 512, [128334], "f6e6", "M314.2 3.3C309.1 12.1 296 36.6 296 56c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7C324.6 1.2 322.4 0 320 0s-4.6 1.2-5.8 3.3zm-288 48C21.1 60.1 8 84.6 8 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7C36.6 49.2 34.4 48 32 48s-4.6 1.2-5.8 3.3zM88 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C101.1 60.1 88 84.6 88 104zm82.2-52.7C165.1 60.1 152 84.6 152 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM216 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C229.1 60.1 216 84.6 216 104zM394.2 51.3C389.1 60.1 376 84.6 376 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM440 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C453.1 60.1 440 84.6 440 104zm82.2-52.7C517.1 60.1 504 84.6 504 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM584 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7c-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C597.1 60.1 584 84.6 584 104zM112 160c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm160 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 96 0 16 32 0 0-16 0-96c0-8.8-7.2-16-16-16zM352 144c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176L96 320c-17.7 0-32-14.3-32-32l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 53 43 96 96 96l192 0 0 64-128 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-128 0 0-64 192 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32l-192 0 0-176z"]
};
const faFeather = {
  prefix: 'fas',
  iconName: 'feather',
  icon: [512, 512, [129718], "f52d", "M278.5 215.6L23 471c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l57-57 68 0c49.7 0 97.9-14.4 139-41c11.1-7.2 5.5-23-7.8-23c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l81-24.3c2.5-.8 4.8-2.1 6.7-4l22.4-22.4c10.1-10.1 2.9-27.3-11.3-27.3l-32.2 0c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l112-33.6c4-1.2 7.4-3.9 9.3-7.7C506.4 207.6 512 184.1 512 160c0-41-16.3-80.3-45.3-109.3l-5.5-5.5C432.3 16.3 393 0 352 0s-80.3 16.3-109.3 45.3L139 149C91 197 64 262.1 64 330l0 55.3L253.6 195.8c6.2-6.2 16.4-6.2 22.6 0c5.4 5.4 6.1 13.6 2.2 19.8z"]
};
const faVolumeLow = {
  prefix: 'fas',
  iconName: 'volume-low',
  icon: [448, 512, [128264, "volume-down"], "f027", "M301.1 34.8C312.6 40 320 51.4 320 64l0 384c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352 64 352c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l67.8 0L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM412.6 181.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5z"]
};
const faVolumeDown = faVolumeLow;
const faCommentSlash = {
  prefix: 'fas',
  iconName: 'comment-slash',
  icon: [640, 512, [], "f4b3", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L512.9 376.7C552.2 340.2 576 292.3 576 240C576 125.1 461.4 32 320 32c-67.7 0-129.3 21.4-175.1 56.3L38.8 5.1zm385.2 425L82.9 161.3C70.7 185.6 64 212.2 64 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9c37 0 72.3-6.4 104.1-17.9z"]
};
const faCloudSunRain = {
  prefix: 'fas',
  iconName: 'cloud-sun-rain',
  icon: [640, 512, [127782], "f743", "M294.2 1.2c5.1 2.1 8.7 6.7 9.6 12.1l10.4 62.4c-23.3 10.8-42.9 28.4-56 50.3c-14.6-9-31.8-14.1-50.2-14.1c-53 0-96 43-96 96c0 35.5 19.3 66.6 48 83.2c.8 31.8 13.2 60.7 33.1 82.7l-56 39.2c-4.5 3.2-10.3 3.8-15.4 1.6s-8.7-6.7-9.6-12.1L98.1 317.9 13.4 303.8c-5.4-.9-10-4.5-12.1-9.6s-1.5-10.9 1.6-15.4L52.5 208 2.9 137.2c-3.2-4.5-3.8-10.3-1.6-15.4s6.7-8.7 12.1-9.6L98.1 98.1l14.1-84.7c.9-5.4 4.5-10 9.6-12.1s10.9-1.5 15.4 1.6L208 52.5 278.8 2.9c4.5-3.2 10.3-3.8 15.4-1.6zM208 144c13.8 0 26.7 4.4 37.1 11.9c-1.2 4.1-2.2 8.3-3 12.6c-37.9 14.6-67.2 46.6-77.8 86.4C151.8 243.1 144 226.5 144 208c0-35.3 28.7-64 64-64zm69.4 276c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm96 0c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm96 0c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm96 0c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7zm74.5-116.1c0 44.2-35.8 80-80 80l-271.9 0c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]
};
const faCompress = {
  prefix: 'fas',
  iconName: 'compress',
  icon: [448, 512, [], "f066", "M160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 320c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0z"]
};
const faWheatAwn = {
  prefix: 'fas',
  iconName: 'wheat-awn',
  icon: [512, 512, ["wheat-alt"], "e2cd", "M505 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L383 95c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l88-88zM305.5 27.3c-6.2-6.2-16.4-6.2-22.6 0L271.5 38.6c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0l-11.3 11.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8L101.8 231c-6.2-6.2-16.4-6.2-22.6 0L67.9 242.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4L9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l68.9-68.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-21.8-21.8-49.6-34.1-78.1-36.9l31.9-31.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-21.8-21.8-49.6-34.1-78.1-36.9l31.9-31.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0L486.5 231c6.2-6.2 6.2-16.4 0-22.6L475.2 197c-5.2-5.2-10.6-9.8-16.4-13.9L505 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-59.4 59.4c-20.6-4.4-42-3.7-62.3 2.1c6.1-21.3 6.6-43.8 1.4-65.3L409 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L329.1 52.9c-3.7-5-7.8-9.8-12.4-14.3L305.5 27.3z"]
};
const faWheatAlt = faWheatAwn;
const faAnkh = {
  prefix: 'fas',
  iconName: 'ankh',
  icon: [320, 512, [9765], "f644", "M96 128c0-35.3 28.7-64 64-64s64 28.7 64 64c0 41.6-20.7 76.6-46.6 104.1c-5.9 6.2-11.8 11.8-17.4 16.7c-5.6-4.9-11.5-10.5-17.4-16.7C116.7 204.6 96 169.6 96 128zM160 0C89.3 0 32 57.3 32 128c0 52.4 21.5 95.5 46.8 128L32 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-46.8 0c25.4-32.5 46.8-75.6 46.8-128C288 57.3 230.7 0 160 0z"]
};
const faHandsHoldingChild = {
  prefix: 'fas',
  iconName: 'hands-holding-child',
  icon: [640, 512, [], "e4fa", "M320 0a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm44.7 164.3L375.8 253c1.6 13.2-7.7 25.1-20.8 26.8s-25.1-7.7-26.8-20.8l-4.4-35-7.6 0-4.4 35c-1.6 13.2-13.6 22.5-26.8 20.8s-22.5-13.6-20.8-26.8l11.1-88.8L255.5 181c-10.1 8.6-25.3 7.3-33.8-2.8s-7.3-25.3 2.8-33.8l27.9-23.6C271.3 104.8 295.3 96 320 96s48.7 8.8 67.6 24.7l27.9 23.6c10.1 8.6 11.4 23.7 2.8 33.8s-23.7 11.4-33.8 2.8l-19.8-16.7zM40 64c22.1 0 40 17.9 40 40l0 40 0 80 0 40.2c0 17 6.7 33.3 18.7 45.3l51.1 51.1c8.3 8.3 21.3 9.6 31 3.1c12.9-8.6 14.7-26.9 3.7-37.8l-15.2-15.2-32-32c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l32 32 15.2 15.2c0 0 0 0 0 0l25.3 25.3c21 21 32.8 49.5 32.8 79.2l0 78.9c0 26.5-21.5 48-48 48l-66.7 0c-17 0-33.3-6.7-45.3-18.7L28.1 393.4C10.1 375.4 0 351 0 325.5L0 224l0-64 0-56C0 81.9 17.9 64 40 64zm560 0c22.1 0 40 17.9 40 40l0 56 0 64 0 101.5c0 25.5-10.1 49.9-28.1 67.9L512 493.3c-12 12-28.3 18.7-45.3 18.7L400 512c-26.5 0-48-21.5-48-48l0-78.9c0-29.7 11.8-58.2 32.8-79.2l25.3-25.3c0 0 0 0 0 0l15.2-15.2 32-32c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-32 32-15.2 15.2c-11 11-9.2 29.2 3.7 37.8c9.7 6.5 22.7 5.2 31-3.1l51.1-51.1c12-12 18.7-28.3 18.7-45.3l0-40.2 0-80 0-40c0-22.1 17.9-40 40-40z"]
};
const faAsterisk = {
  prefix: 'fas',
  iconName: 'asterisk',
  icon: [384, 512, [10033, 61545], "2a", "M192 32c17.7 0 32 14.3 32 32l0 135.5 111.5-66.9c15.2-9.1 34.8-4.2 43.9 11s4.2 34.8-11 43.9L254.2 256l114.3 68.6c15.2 9.1 20.1 28.7 11 43.9s-28.7 20.1-43.9 11L224 312.5 224 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-135.5L48.5 379.4c-15.2 9.1-34.8 4.2-43.9-11s-4.2-34.8 11-43.9L129.8 256 15.5 187.4c-15.2-9.1-20.1-28.7-11-43.9s28.7-20.1 43.9-11L160 199.5 160 64c0-17.7 14.3-32 32-32z"]
};
const faSquareCheck = {
  prefix: 'fas',
  iconName: 'square-check',
  icon: [448, 512, [9745, 9989, 61510, "check-square"], "f14a", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faCheckSquare = faSquareCheck;
const faPesetaSign = {
  prefix: 'fas',
  iconName: 'peseta-sign',
  icon: [384, 512, [], "e221", "M64 32C46.3 32 32 46.3 32 64l0 96c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 96 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 96 0c77.4 0 142-55 156.8-128l3.2 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-3.2 0C334 87 269.4 32 192 32L64 32zM282.5 160L96 160l0-64 96 0c41.8 0 77.4 26.7 90.5 64zM96 224l186.5 0c-13.2 37.3-48.7 64-90.5 64l-96 0 0-64z"]
};
const faHeading = {
  prefix: 'fas',
  iconName: 'heading',
  icon: [448, 512, ["header"], "f1dc", "M0 64C0 46.3 14.3 32 32 32l48 0 48 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 112 224 0 0-112-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l48 0 48 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 144 0 176 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-144-224 0 0 144 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-176L48 96 32 96C14.3 96 0 81.7 0 64z"]
};
const faHeader = faHeading;
const faGhost = {
  prefix: 'fas',
  iconName: 'ghost',
  icon: [384, 512, [128123], "f6e2", "M40.1 467.1l-11.2 9c-3.2 2.5-7.1 3.9-11.1 3.9C8 480 0 472 0 462.2L0 192C0 86 86 0 192 0S384 86 384 192l0 270.2c0 9.8-8 17.8-17.8 17.8c-4 0-7.9-1.4-11.1-3.9l-11.2-9c-13.4-10.7-32.8-9-44.1 3.9L269.3 506c-3.3 3.8-8.2 6-13.3 6s-9.9-2.2-13.3-6l-26.6-30.5c-12.7-14.6-35.4-14.6-48.2 0L141.3 506c-3.3 3.8-8.2 6-13.3 6s-9.9-2.2-13.3-6L84.2 471c-11.3-12.9-30.7-14.6-44.1-3.9zM160 192a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faList = {
  prefix: 'fas',
  iconName: 'list',
  icon: [512, 512, ["list-squares"], "f03a", "M40 48C26.7 48 16 58.7 16 72l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24L40 48zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM16 232l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0z"]
};
const faListSquares = faList;
const faSquarePhoneFlip = {
  prefix: 'fas',
  iconName: 'square-phone-flip',
  icon: [448, 512, ["phone-square-alt"], "f87b", "M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zm-90.7 96.7c-9.7-2.6-19.9 2.3-23.7 11.6l-20 48c-3.4 8.2-1 17.6 5.8 23.2L280 231.7c-16.6 35.2-45.1 63.7-80.3 80.3l-20.2-24.7c-5.6-6.8-15-9.2-23.2-5.8l-48 20c-9.3 3.9-14.2 14-11.6 23.7l12 44C111.1 378 119 384 128 384c123.7 0 224-100.3 224-224c0-9-6-16.9-14.7-19.3l-44-12z"]
};
const faPhoneSquareAlt = faSquarePhoneFlip;
const faCartPlus = {
  prefix: 'fas',
  iconName: 'cart-plus',
  icon: [576, 512, [], "f217", "M0 24C0 10.7 10.7 0 24 0L69.5 0c22 0 41.5 12.8 50.6 32l411 0c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3l-288.5 0 5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5L488 336c13.3 0 24 10.7 24 24s-10.7 24-24 24l-288.3 0c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5L24 48C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM252 160c0 11 9 20 20 20l44 0 0 44c0 11 9 20 20 20s20-9 20-20l0-44 44 0c11 0 20-9 20-20s-9-20-20-20l-44 0 0-44c0-11-9-20-20-20s-20 9-20 20l0 44-44 0c-11 0-20 9-20 20z"]
};
const faGamepad = {
  prefix: 'fas',
  iconName: 'gamepad',
  icon: [640, 512, [], "f11b", "M192 64C86 64 0 150 0 256S86 448 192 448l256 0c106 0 192-86 192-192s-86-192-192-192L192 64zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32z"]
};
const faCircleDot = {
  prefix: 'fas',
  iconName: 'circle-dot',
  icon: [512, 512, [128280, "dot-circle"], "f192", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faDotCircle = faCircleDot;
const faFaceDizzy = {
  prefix: 'fas',
  iconName: 'face-dizzy',
  icon: [512, 512, ["dizzy"], "f567", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-224a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM100.7 132.7c6.2-6.2 16.4-6.2 22.6 0L160 169.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L182.6 192l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L160 214.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L137.4 192l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6zm192 0c6.2-6.2 16.4-6.2 22.6 0L352 169.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L374.6 192l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L352 214.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L329.4 192l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6z"]
};
const faDizzy = faFaceDizzy;
const faEgg = {
  prefix: 'fas',
  iconName: 'egg',
  icon: [384, 512, [129370], "f7fb", "M192 496C86 496 0 394 0 288C0 176 64 16 192 16s192 160 192 272c0 106-86 208-192 208zM154.8 134c6.5-6 7-16.1 1-22.6s-16.1-7-22.6-1c-23.9 21.8-41.1 52.7-52.3 84.2C69.7 226.1 64 259.7 64 288c0 8.8 7.2 16 16 16s16-7.2 16-16c0-24.5 5-54.4 15.1-82.8c10.1-28.5 25-54.1 43.7-71.2z"]
};
const faHouseMedicalCircleXmark = {
  prefix: 'fas',
  iconName: 'house-medical-circle-xmark',
  icon: [640, 512, [], "e513", "M320 368c0 59.5 29.5 112.1 74.8 144l-266.7 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L522.1 193.9c-8.5-1.3-17.3-1.9-26.1-1.9c-54.7 0-103.5 24.9-135.8 64L320 256l0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm22.6 144l36.7-36.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L496 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L473.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L496 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L518.6 368z"]
};
const faCampground = {
  prefix: 'fas',
  iconName: 'campground',
  icon: [576, 512, [9978], "f6bb", "M377 52c11-13.8 8.8-33.9-5-45s-33.9-8.8-45 5L288 60.8 249 12c-11-13.8-31.2-16-45-5s-16 31.2-5 45l48 60L12.3 405.4C4.3 415.4 0 427.7 0 440.4L0 464c0 26.5 21.5 48 48 48l240 0 240 0c26.5 0 48-21.5 48-48l0-23.6c0-12.7-4.3-25.1-12.3-35L329 112l48-60zM288 448l-119.5 0L288 291.7 407.5 448 288 448z"]
};
const faFolderPlus = {
  prefix: 'fas',
  iconName: 'folder-plus',
  icon: [512, 512, [], "f65e", "M512 416c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l128 0c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8l160 0c35.3 0 64 28.7 64 64l0 256zM232 376c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64 64 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-64 0 0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 64-64 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l64 0 0 64z"]
};
const faFutbol = {
  prefix: 'fas',
  iconName: 'futbol',
  icon: [512, 512, [9917, "futbol-ball", "soccer-ball"], "f1e3", "M417.3 360.1l-71.6-4.8c-5.2-.3-10.3 1.1-14.5 4.2s-7.2 7.4-8.4 12.5l-17.6 69.6C289.5 445.8 273 448 256 448s-33.5-2.2-49.2-6.4L189.2 372c-1.3-5-4.3-9.4-8.4-12.5s-9.3-4.5-14.5-4.2l-71.6 4.8c-17.6-27.2-28.5-59.2-30.4-93.6L125 228.3c4.4-2.8 7.6-7 9.2-11.9s1.4-10.2-.5-15l-26.7-66.6C128 109.2 155.3 89 186.7 76.9l55.2 46c4 3.3 9 5.1 14.1 5.1s10.2-1.8 14.1-5.1l55.2-46c31.3 12.1 58.7 32.3 79.6 57.9l-26.7 66.6c-1.9 4.8-2.1 10.1-.5 15s4.9 9.1 9.2 11.9l60.7 38.2c-1.9 34.4-12.8 66.4-30.4 93.6zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm14.1-325.7c-8.4-6.1-19.8-6.1-28.2 0L194 221c-8.4 6.1-11.9 16.9-8.7 26.8l18.3 56.3c3.2 9.9 12.4 16.6 22.8 16.6l59.2 0c10.4 0 19.6-6.7 22.8-16.6l18.3-56.3c3.2-9.9-.3-20.7-8.7-26.8l-47.9-34.8z"]
};
const faFutbolBall = faFutbol;
const faSoccerBall = faFutbol;
const faPaintbrush = {
  prefix: 'fas',
  iconName: 'paintbrush',
  icon: [576, 512, [128396, "paint-brush"], "f1fc", "M339.3 367.1c27.3-3.9 51.9-19.4 67.2-42.9L568.2 74.1c12.6-19.5 9.4-45.3-7.6-61.2S517.7-4.4 499.1 9.6L262.4 187.2c-24 18-38.2 46.1-38.4 76.1L339.3 367.1zm-19.6 25.4l-116-104.4C143.9 290.3 96 339.6 96 400c0 3.9 .2 7.8 .6 11.6C98.4 429.1 86.4 448 68.8 448L64 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0c61.9 0 112-50.1 112-112c0-2.5-.1-5-.2-7.5z"]
};
const faPaintBrush = faPaintbrush;
const faLock = {
  prefix: 'fas',
  iconName: 'lock',
  icon: [448, 512, [128274], "f023", "M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"]
};
const faGasPump = {
  prefix: 'fas',
  iconName: 'gas-pump',
  icon: [512, 512, [9981], "f52f", "M32 64C32 28.7 60.7 0 96 0L256 0c35.3 0 64 28.7 64 64l0 192 8 0c48.6 0 88 39.4 88 88l0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-154c-27.6-7.1-48-32.2-48-62l0-64L384 64c-8.8-8.8-8.8-23.2 0-32s23.2-8.8 32 0l77.3 77.3c12 12 18.7 28.3 18.7 45.3l0 13.5 0 24 0 32 0 152c0 39.8-32.2 72-72 72s-72-32.2-72-72l0-32c0-22.1-17.9-40-40-40l-8 0 0 144c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32L32 64zM96 80l0 96c0 8.8 7.2 16 16 16l128 0c8.8 0 16-7.2 16-16l0-96c0-8.8-7.2-16-16-16L112 64c-8.8 0-16 7.2-16 16z"]
};
const faHotTubPerson = {
  prefix: 'fas',
  iconName: 'hot-tub-person',
  icon: [512, 512, ["hot-tub"], "f593", "M272 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 5.2c0 34 14.4 66.4 39.7 89.2l16.4 14.8c15.2 13.7 23.8 33.1 23.8 53.5l0 13.2c0 13.3 10.7 24 24 24s24-10.7 24-24l0-13.2c0-34-14.4-66.4-39.7-89.2L295.8 82.8C280.7 69.1 272 49.7 272 29.2l0-5.2zM0 320l0 16L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-128c0-35.3-28.7-64-64-64l-170.7 0c-13.8 0-27.3-4.5-38.4-12.8l-85.3-64C137 166.7 116.8 160 96 160c-53 0-96 43-96 96l0 64zm128 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16s16 7.2 16 16zm80-16c8.8 0 16 7.2 16 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16zm112 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16s16 7.2 16 16zm80-16c8.8 0 16 7.2 16 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16zM360 0c-13.3 0-24 10.7-24 24l0 5.2c0 34 14.4 66.4 39.7 89.2l16.4 14.8c15.2 13.7 23.8 33.1 23.8 53.5l0 13.2c0 13.3 10.7 24 24 24s24-10.7 24-24l0-13.2c0-34-14.4-66.4-39.7-89.2L407.8 82.8C392.7 69.1 384 49.7 384 29.2l0-5.2c0-13.3-10.7-24-24-24zM64 128A64 64 0 1 0 64 0a64 64 0 1 0 0 128z"]
};
const faHotTub = faHotTubPerson;
const faMapLocation = {
  prefix: 'fas',
  iconName: 'map-location',
  icon: [576, 512, ["map-marked"], "f59f", "M302.8 312C334.9 271.9 408 174.6 408 120C408 53.7 354.3 0 288 0S168 53.7 168 120c0 54.6 73.1 151.9 105.2 192c7.7 9.6 22 9.6 29.6 0zM416 503l144.9-58c9.1-3.6 15.1-12.5 15.1-22.3L576 152c0-17-17.1-28.6-32.9-22.3l-116 46.4c-.5 1.2-1 2.5-1.5 3.7c-2.9 6.8-6.1 13.7-9.6 20.6L416 503zM15.1 187.3C6 191 0 199.8 0 209.6L0 480.4c0 17 17.1 28.6 32.9 22.3L160 451.8l0-251.4c-3.5-6.9-6.7-13.8-9.6-20.6c-5.6-13.2-10.4-27.4-12.8-41.5l-122.6 49zM384 255c-20.5 31.3-42.3 59.6-56.2 77c-20.5 25.6-59.1 25.6-79.6 0c-13.9-17.4-35.7-45.7-56.2-77l0 194.4 192 54.9L384 255z"]
};
const faMapMarked = faMapLocation;
const faHouseFloodWater = {
  prefix: 'fas',
  iconName: 'house-flood-water',
  icon: [576, 512, [], "e50e", "M306.8 6.1C295.6-2 280.4-2 269.2 6.1l-176 128c-11.2 8.2-15.9 22.6-11.6 35.8S98.1 192 112 192l16 0 0 73c1.7 1 3.3 2 4.9 3.1c18 12.4 40.1 20.3 59.2 20.3c21.1 0 42-8.5 59.2-20.3c22.1-15.5 51.6-15.5 73.7 0c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c1.5-1 3-2 4.5-2.9l-.3-73.2 16.6 0c13.9 0 26.1-8.9 30.4-22.1s-.4-27.6-11.6-35.8l-176-128zM269.5 309.9C247 325.4 219.5 336 192 336c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 389.7 159 400 192 400c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.5-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 325.2 410.9 336 384 336c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0zM384 448c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 437.2 410.9 448 384 448z"]
};
const faTree = {
  prefix: 'fas',
  iconName: 'tree',
  icon: [448, 512, [127794], "f1bb", "M210.6 5.9L62 169.4c-3.9 4.2-6 9.8-6 15.5C56 197.7 66.3 208 79.1 208l24.9 0L30.6 281.4c-4.2 4.2-6.6 10-6.6 16C24 309.9 34.1 320 46.6 320L80 320 5.4 409.5C1.9 413.7 0 419 0 424.5c0 13 10.5 23.5 23.5 23.5L192 448l0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 168.5 0c13 0 23.5-10.5 23.5-23.5c0-5.5-1.9-10.8-5.4-15L368 320l33.4 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L344 208l24.9 0c12.7 0 23.1-10.3 23.1-23.1c0-5.7-2.1-11.3-6-15.5L237.4 5.9C234 2.1 229.1 0 224 0s-10 2.1-13.4 5.9z"]
};
const faBridgeLock = {
  prefix: 'fas',
  iconName: 'bridge-lock',
  icon: [640, 512, [], "e4cc", "M32 64c0-17.7 14.3-32 32-32l512 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-40 0 0 64-8 0c-61.9 0-112 50.1-112 112l0 24.6c-9.9 5.8-18.2 14.1-23.8 24.1c-17.6-20-43.4-32.7-72.2-32.7c-53 0-96 43-96 96l0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64c0-53-43-96-96-96l0-128 72 0 0-64L64 96C46.3 96 32 81.7 32 64zM408 96l0 64 80 0 0-64-80 0zm-48 64l0-64-80 0 0 64 80 0zM152 96l0 64 80 0 0-64-80 0zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faSackDollar = {
  prefix: 'fas',
  iconName: 'sack-dollar',
  icon: [512, 512, [128176], "f81d", "M320 96L192 96 144.6 24.9C137.5 14.2 145.1 0 157.9 0L354.1 0c12.8 0 20.4 14.2 13.3 24.9L320 96zM192 128l128 0c3.8 2.5 8.1 5.3 13 8.4C389.7 172.7 512 250.9 512 416c0 53-43 96-96 96L96 512c-53 0-96-43-96-96C0 250.9 122.3 172.7 179 136.4c0 0 0 0 0 0s0 0 0 0c4.8-3.1 9.2-5.9 13-8.4zm84 88c0-11-9-20-20-20s-20 9-20 20l0 14c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1c0 0 0 0 0 0s0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4l0 14.6c0 11 9 20 20 20s20-9 20-20l0-13.8c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15c0 0 0 0 0 0l-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7l0-13.9z"]
};
const faPenToSquare = {
  prefix: 'fas',
  iconName: 'pen-to-square',
  icon: [512, 512, ["edit"], "f044", "M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 64z"]
};
const faEdit = faPenToSquare;
const faCarSide = {
  prefix: 'fas',
  iconName: 'car-side',
  icon: [640, 512, [128663], "f5e4", "M171.3 96L224 96l0 96-112.7 0 30.4-75.9C146.5 104 158.2 96 171.3 96zM272 192l0-96 81.2 0c9.7 0 18.9 4.4 25 12l67.2 84L272 192zm256.2 1L428.2 68c-18.2-22.8-45.8-36-75-36L171.3 32c-39.3 0-74.6 23.9-89.1 60.3L40.6 196.4C16.8 205.8 0 228.9 0 256L0 368c0 17.7 14.3 32 32 32l33.3 0c7.6 45.4 47.1 80 94.7 80s87.1-34.6 94.7-80l130.7 0c7.6 45.4 47.1 80 94.7 80s87.1-34.6 94.7-80l33.3 0c17.7 0 32-14.3 32-32l0-48c0-65.2-48.8-119-111.8-127zM434.7 368a48 48 0 1 1 90.5 32 48 48 0 1 1 -90.5-32zM160 336a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faShareNodes = {
  prefix: 'fas',
  iconName: 'share-nodes',
  icon: [448, 512, ["share-alt"], "f1e0", "M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z"]
};
const faShareAlt = faShareNodes;
const faHeartCircleMinus = {
  prefix: 'fas',
  iconName: 'heart-circle-minus',
  icon: [576, 512, [], "e4ff", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-64 0c0 8.8-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l128 0c8.8 0 16 7.2 16 16z"]
};
const faHourglassHalf = {
  prefix: 'fas',
  iconName: 'hourglass-half',
  icon: [384, 512, ["hourglass-2"], "f252", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1L146.7 256 78.9 323.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 256 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1L237.3 256l67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32s-14.3-32-32-32L320 0 64 0 32 0zM96 75l0-11 192 0 0 11c0 19-5.6 37.4-16 53L112 128c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9L192 301.3l67.9 67.9c4.6 4.6 8.6 9.6 12.1 14.9L112 384z"]
};
const faHourglass2 = faHourglassHalf;
const faMicroscope = {
  prefix: 'fas',
  iconName: 'microscope',
  icon: [512, 512, [128300], "f610", "M160 32c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32c17.7 0 32 14.3 32 32l0 224c0 17.7-14.3 32-32 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32c-17.7 0-32-14.3-32-32l0-224c0-17.7 14.3-32 32-32zM32 448l288 0c70.7 0 128-57.3 128-128s-57.3-128-128-128l0-64c106 0 192 86 192 192c0 49.2-18.5 94-48.9 128l16.9 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32zm80-64l192 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faSink = {
  prefix: 'fas',
  iconName: 'sink',
  icon: [512, 512, [], "e06d", "M288 96c0-17.7 14.3-32 32-32s32 14.3 32 32s14.3 32 32 32s32-14.3 32-32c0-53-43-96-96-96s-96 43-96 96l0 192-64 0 0-24c0-30.9-25.1-56-56-56l-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c4.4 0 8 3.6 8 8l0 24-80 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0 224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 0-24c0-4.4 3.6-8 8-8l56 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-56 0c-30.9 0-56 25.1-56 56l0 24-64 0 0-192zM480 416l0-32L32 384l0 32c0 53 43 96 96 96l256 0c53 0 96-43 96-96z"]
};
const faBagShopping = {
  prefix: 'fas',
  iconName: 'bag-shopping',
  icon: [448, 512, ["shopping-bag"], "f290", "M160 112c0-35.3 28.7-64 64-64s64 28.7 64 64l0 48-128 0 0-48zm-48 48l-64 0c-26.5 0-48 21.5-48 48L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-208c0-26.5-21.5-48-48-48l-64 0 0-48C336 50.1 285.9 0 224 0S112 50.1 112 112l0 48zm24 48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm152 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faShoppingBag = faBagShopping;
const faArrowDownZA = {
  prefix: 'fas',
  iconName: 'arrow-down-z-a',
  icon: [576, 512, ["sort-alpha-desc", "sort-alpha-down-alt"], "f881", "M183.6 469.6C177.5 476.2 169 480 160 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L128 365.7 128 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 64c0-17.7 14.3-32 32-32l128 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L429.3 160l50.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L402.7 96 352 96c-17.7 0-32-14.3-32-32zm96 192c12.1 0 23.2 6.8 28.6 17.7l64 128 16 32c7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3L460.2 448l-88.4 0-7.2 14.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l16-32 64-128c5.4-10.8 16.5-17.7 28.6-17.7zM395.8 400l40.4 0L416 359.6 395.8 400z"]
};
const faSortAlphaDesc = faArrowDownZA;
const faSortAlphaDownAlt = faArrowDownZA;
const faMitten = {
  prefix: 'fas',
  iconName: 'mitten',
  icon: [448, 512, [], "f7b5", "M352 384L64 384 5.4 178.9C1.8 166.4 0 153.4 0 140.3C0 62.8 62.8 0 140.3 0l3.4 0c66 0 123.5 44.9 139.5 108.9l31.4 125.8 17.6-20.1C344.8 200.2 362.9 192 382 192l2.8 0c34.9 0 63.3 28.3 63.3 63.3c0 15.9-6 31.2-16.8 42.9L352 384zM32 448c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L64 512c-17.7 0-32-14.3-32-32l0-32z"]
};
const faPersonRays = {
  prefix: 'fas',
  iconName: 'person-rays',
  icon: [512, 512, [], "e54d", "M208 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1-28.6 47.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l58.3 97c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9L328 256.9 328 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM7 7C16.4-2.3 31.6-2.3 41 7l80 80c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 41C-2.3 31.6-2.3 16.4 7 7zM471 7c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-80 80c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L471 7zM7 505c-9.4-9.4-9.4-24.6 0-33.9l80-80c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L41 505c-9.4 9.4-24.6 9.4-33.9 0zm464 0l-80-80c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l80 80c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0z"]
};
const faUsers = {
  prefix: 'fas',
  iconName: 'users',
  icon: [640, 512, [], "f0c0", "M144 0a80 80 0 1 1 0 160A80 80 0 1 1 144 0zM512 0a80 80 0 1 1 0 160A80 80 0 1 1 512 0zM0 298.7C0 239.8 47.8 192 106.7 192l42.7 0c15.9 0 31 3.5 44.6 9.7c-1.3 7.2-1.9 14.7-1.9 22.3c0 38.2 16.8 72.5 43.3 96c-.2 0-.4 0-.7 0L21.3 320C9.6 320 0 310.4 0 298.7zM405.3 320c-.2 0-.4 0-.7 0c26.6-23.5 43.3-57.8 43.3-96c0-7.6-.7-15-1.9-22.3c13.6-6.3 28.7-9.7 44.6-9.7l42.7 0C592.2 192 640 239.8 640 298.7c0 11.8-9.6 21.3-21.3 21.3l-213.3 0zM224 224a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zM128 485.3C128 411.7 187.7 352 261.3 352l117.3 0C452.3 352 512 411.7 512 485.3c0 14.7-11.9 26.7-26.7 26.7l-330.7 0c-14.7 0-26.7-11.9-26.7-26.7z"]
};
const faEyeSlash = {
  prefix: 'fas',
  iconName: 'eye-slash',
  icon: [640, 512, [], "f070", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"]
};
const faFlaskVial = {
  prefix: 'fas',
  iconName: 'flask-vial',
  icon: [640, 512, [], "e4f3", "M175 389.4c-9.8 16-15 34.3-15 53.1c-10 3.5-20.8 5.5-32 5.5c-53 0-96-43-96-96L32 64C14.3 64 0 49.7 0 32S14.3 0 32 0L96 0l64 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 245.9-49 79.6zM96 64l0 96 64 0 0-96L96 64zM352 0L480 0l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 150.9L629.7 406.2c6.7 10.9 10.3 23.5 10.3 36.4c0 38.3-31.1 69.4-69.4 69.4l-309.2 0c-38.3 0-69.4-31.1-69.4-69.4c0-12.8 3.6-25.4 10.3-36.4L320 214.9 320 64c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0zm32 64l0 160c0 5.9-1.6 11.7-4.7 16.8L330.5 320l171 0-48.8-79.2c-3.1-5-4.7-10.8-4.7-16.8l0-160-64 0z"]
};
const faHand = {
  prefix: 'fas',
  iconName: 'hand',
  icon: [512, 512, [129306, 9995, "hand-paper"], "f256", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 272c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L124.8 448c43.1 41.1 100.4 64 160 64l19.2 0c97.2 0 176-78.8 176-176l0-208c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208z"]
};
const faHandPaper = faHand;
const faOm = {
  prefix: 'fas',
  iconName: 'om',
  icon: [512, 512, [128329], "f679", "M379.3 4.7c-6.2-6.2-16.4-6.2-22.6 0l-16 16c-6.2 6.2-6.2 16.4 0 22.6l16 16c6.2 6.2 16.4 6.2 22.6 0l16-16c6.2-6.2 6.2-16.4 0-22.6l-16-16zM281 66.7c-2.2-1.5-4.9-2.5-7.7-2.7c-.6 0-1.3-.1-1.9 0c-3.9 .2-7.4 1.7-10.1 4.2c-.9 .8-1.6 1.7-2.3 2.6c-1.7 2.4-2.7 5.3-2.9 8.5c0 .7 0 1.4 0 2.1c.2 2.2 .9 4.3 1.9 6.2l.3 .6c.3 .6 .8 1.4 1.4 2.4c1.2 2 2.9 4.8 5.1 8.2c4.4 6.7 11.1 15.5 20 24.4C302.4 141.1 330.3 160 368 160c31.2 0 56.6-10.4 73.9-20.2c8.7-5 15.6-9.9 20.4-13.8c2.4-1.9 4.3-3.6 5.7-4.9c.7-.6 1.3-1.2 1.7-1.6l.6-.5 .1-.1 .1-.1s0 0 0 0s0 0 0 0c5.9-5.8 9.5-13.9 9.5-22.8c0-17.7-14.3-32-32-32c-8.7 0-16.7 3.5-22.4 9.2c-.1 .1-.2 .2-.5 .4c-.5 .5-1.5 1.3-2.8 2.4c-2.7 2.2-6.8 5.2-12.1 8.2C399.4 90.4 384.8 96 368 96c-20.8 0-42.4-7-59.5-14.6c-8.4-3.7-15.4-7.5-20.3-10.3c-2.4-1.4-4.3-2.5-5.6-3.3c-.6-.4-1.1-.7-1.4-.9l-.3-.2zM115.2 169.6c8-6 17.9-9.6 28.8-9.6c26.5 0 48 21.5 48 48s-21.5 48-48 48l-34.2 0c-7.6 0-13.8 6.2-13.8 13.8c0 1.5 .2 2.9 .7 4.4l8 24c4.4 13.1 16.6 21.9 30.4 21.9l8.9 0 16 0c35.3 0 64 28.7 64 64s-28.7 64-64 64c-50.8 0-82.7-21.5-102.2-42.8c-9.9-10.8-16.6-21.6-20.9-29.7c-2.1-4-3.6-7.3-4.5-9.6c-.5-1.1-.8-2-1-2.5l-.2-.5c-.3-.9-.7-1.8-1.1-2.6c-1.2-2.2-2.8-4-4.7-5.4c-1.9-1.4-4.1-2.3-6.5-2.8c-1.4-.3-2.9-.3-4.4-.2c-2.5 .2-4.8 1-6.8 2.3c-1.1 .7-2.2 1.5-3.1 2.5c-2.4 2.5-4.1 5.8-4.5 9.5c-.1 .6-.1 1.1-.1 1.7c0 0 0 0 0 0c0 .8 .1 1.7 .2 2.5l0 .1c0 .3 .1 .8 .2 1.3c.2 1.1 .4 2.7 .8 4.6c.8 3.9 2 9.4 3.9 15.9c3.8 13 10.3 30.4 21.3 48C48.7 476.2 89.4 512 160 512c70.7 0 128-57.3 128-128c0-23.3-6.2-45.2-17.1-64l22.6 0c25.5 0 49.9-10.1 67.9-28.1l26.5-26.5c6-6 14.1-9.4 22.6-9.4l5.5 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32c-25.7 0-41.4-12.5-51.2-25.6c-5-6.7-8.4-13.4-10.5-18.6c-1.1-2.5-1.8-4.6-2.2-6c-.2-.7-.4-1.2-.5-1.5l-.1-.2c-.3-1.3-.8-2.6-1.5-3.8c-1.1-2-2.6-3.8-4.4-5.1c-2.7-2-6-3.2-9.6-3.2l-.2 0c-8 .1-14.6 6.1-15.6 13.9c0 0 0 0 0 0c0 .3-.1 .6-.2 1.1c-.1 .9-.3 2.1-.4 3.6c-.3 3-.6 7.3-.6 12.4c0 10.1 1.1 23.9 5.8 38.1c4.8 14.3 13.4 29.3 28.6 40.7C368.7 473.3 389.3 480 416 480c53 0 96-43 96-96l0-96c0-53-43-96-96-96l-5.5 0c-25.5 0-49.9 10.1-67.9 28.1l-26.5 26.5c-6 6-14.1 9.4-22.6 9.4l-48.3 0c6.9-14.5 10.8-30.8 10.8-48c0-61.9-50.1-112-112-112c-25.2 0-48.5 8.3-67.2 22.4c-14.1 10.6-17 30.7-6.4 44.8s30.7 17 44.8 6.4z"]
};
const faWorm = {
  prefix: 'fas',
  iconName: 'worm',
  icon: [512, 512, [], "e599", "M256 96c0-53 43-96 96-96l38.4 0C439.9 0 480 40.1 480 89.6l0 86.4 0 16 0 184c0 75.1-60.9 136-136 136s-136-60.9-136-136l0-80c0-22.1-17.9-40-40-40s-40 17.9-40 40l0 168c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-168c0-75.1 60.9-136 136-136s136 60.9 136 136l0 80c0 22.1 17.9 40 40 40s40-17.9 40-40l0-184-32 0c-53 0-96-43-96-96zm144-8a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faHouseCircleXmark = {
  prefix: 'fas',
  iconName: 'house-circle-xmark',
  icon: [640, 512, [], "e50b", "M320.7 352c8.1-89.7 83.5-160 175.3-160c8.9 0 17.6 .7 26.1 1.9L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 69.7c-.1 .9-.1 1.8-.1 2.8l0 112c0 22.1 17.9 40 40 40l16 0c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2l31.9 0 24 0c22.1 0 40-17.9 40-40l0-24 0-64c0-17.7 14.3-32 32-32l64 0 .7 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faPlug = {
  prefix: 'fas',
  iconName: 'plug',
  icon: [384, 512, [128268], "f1e6", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2C297 398 352 333.4 352 256l0-32c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z"]
};
const faChevronUp = {
  prefix: 'fas',
  iconName: 'chevron-up',
  icon: [512, 512, [], "f077", "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]
};
const faHandSpock = {
  prefix: 'fas',
  iconName: 'hand-spock',
  icon: [576, 512, [128406], "f259", "M246.9 23.7C242.3 6.6 224.8-3.5 207.7 1.1s-27.2 22.1-22.6 39.2L238 237.8c2.5 9.2-4.5 18.2-14 18.2c-6.4 0-12-4.2-13.9-10.3L166.6 102.7c-5.1-16.9-23-26.4-39.9-21.3s-26.4 23-21.3 39.9l62.8 206.4c2.4 7.9-7.2 13.8-13.2 8.1L99.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L156.8 448c43.1 41.1 100.4 64 160 64l10.9 0 8.2 0c.1 0 .1-.1 .1-.1s.1-.1 .1-.1c58.3-3.5 108.6-43.2 125.3-99.7l81.2-275c5-16.9-4.7-34.7-21.6-39.8s-34.7 4.7-39.8 21.6L443.5 247.1c-1.6 5.3-6.4 8.9-12 8.9c-7.9 0-13.8-7.3-12.2-15.1l36-170.3c3.7-17.3-7.4-34.3-24.7-37.9s-34.3 7.4-37.9 24.7L355.1 235.1c-2.6 12.2-13.3 20.9-25.8 20.9c-11.9 0-22.4-8-25.4-19.5l-57-212.8z"]
};
const faStopwatch = {
  prefix: 'fas',
  iconName: 'stopwatch',
  icon: [448, 512, [9201], "f2f2", "M176 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 34.4C92.3 113.8 16 200 16 304c0 114.9 93.1 208 208 208s208-93.1 208-208c0-41.8-12.3-80.7-33.5-113.2l24.1-24.1c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L355.7 143c-28.1-23-62.2-38.8-99.7-44.6L256 64l16 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L224 0 176 0zm72 192l0 128c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-128c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faFaceKiss = {
  prefix: 'fas',
  iconName: 'face-kiss',
  icon: [512, 512, [128535, "kiss"], "f596", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm48.7-198.3c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C274.7 443.1 257.4 448 240 448c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1 .3-.2 .6-.4c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.4-.3-.5-.3-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faKiss = faFaceKiss;
const faBridgeCircleXmark = {
  prefix: 'fas',
  iconName: 'bridge-circle-xmark',
  icon: [640, 512, [], "e4cb", "M64 32C46.3 32 32 46.3 32 64s14.3 32 32 32l40 0 0 64-72 0 0 128c53 0 96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96c6.3 0 12.4 .6 18.3 1.7C367.1 231.8 426.9 192 496 192c42.5 0 81.6 15.1 112 40.2l0-72.2-72 0 0-64 40 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32zM488 96l0 64-80 0 0-64 80 0zM360 96l0 64-80 0 0-64 80 0zM232 96l0 64-80 0 0-64 80 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faFaceGrinTongue = {
  prefix: 'fas',
  iconName: 'face-grin-tongue',
  icon: [512, 512, [128539, "grin-tongue"], "f589", "M0 256C0 368.9 73.1 464.7 174.5 498.8C165.3 484 160 466.6 160 448l0-47.3c-24-17.5-43.1-41.4-54.8-69.2c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19c12.3-3.8 24.3 6.9 19.3 18.7c-11.8 28-31.1 52-55.4 69.6l0 46.9c0 18.6-5.3 36-14.5 50.8C438.9 464.7 512 368.9 512 256C512 114.6 397.4 0 256 0S0 114.6 0 256zm176.4-80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 448l0-45.4c0-14.7-11.9-26.6-26.6-26.6l-2 0c-11.3 0-21.1 7.9-23.6 18.9c-2.8 12.6-20.8 12.6-23.6 0c-2.5-11.1-12.3-18.9-23.6-18.9l-2 0c-14.7 0-26.6 11.9-26.6 26.6l0 45.4c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faGrinTongue = faFaceGrinTongue;
const faChessBishop = {
  prefix: 'fas',
  iconName: 'chess-bishop',
  icon: [320, 512, [9821], "f43a", "M128 0C110.3 0 96 14.3 96 32c0 16.1 11.9 29.4 27.4 31.7C78.4 106.8 8 190 8 288c0 47.4 30.8 72.3 56 84.7L64 400l192 0 0-27.3c25.2-12.5 56-37.4 56-84.7c0-37.3-10.2-72.4-25.3-104.1l-99.4 99.4c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L270.8 154.6c-23.2-38.1-51.8-69.5-74.2-90.9C212.1 61.4 224 48.1 224 32c0-17.7-14.3-32-32-32L128 0zM48 432L6.6 473.4c-4.2 4.2-6.6 10-6.6 16C0 501.9 10.1 512 22.6 512l274.7 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L272 432 48 432z"]
};
const faFaceGrinWink = {
  prefix: 'fas',
  iconName: 'face-grin-wink',
  icon: [512, 512, ["grin-wink"], "f58c", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zm-16.9-79.2c-17.6-23.5-52.8-23.5-70.4 0c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGrinWink = faFaceGrinWink;
const faEarDeaf = {
  prefix: 'fas',
  iconName: 'ear-deaf',
  icon: [512, 512, ["deaf", "deafness", "hard-of-hearing"], "f2a4", "M502.6 54.6l-40 40c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l40-40c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zm-320 320l-128 128c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM240 128c-57.6 0-105.1 43.6-111.3 99.5c-1.9 17.6-17.8 30.2-35.3 28.3s-30.2-17.8-28.3-35.3C74.8 132.5 149.4 64 240 64c97.2 0 176 78.8 176 176c0 46-17.7 87.9-46.6 119.3c-12 13-17.4 24.8-17.4 34.7l0 6.1c0 61.9-50.1 112-112 112c-17.7 0-32-14.3-32-32s14.3-32 32-32c26.5 0 48-21.5 48-48l0-6.1c0-32.9 17.4-59.6 34.4-78c18.4-20 29.6-46.6 29.6-75.9c0-61.9-50.1-112-112-112zm0 80c-17.7 0-32 14.3-32 32c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-44.2 35.8-80 80-80s80 35.8 80 80c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-17.7-14.3-32-32-32z"]
};
const faDeaf = faEarDeaf;
const faDeafness = faEarDeaf;
const faHardOfHearing = faEarDeaf;
const faRoadCircleCheck = {
  prefix: 'fas',
  iconName: 'road-circle-check',
  icon: [640, 512, [], "e564", "M213.2 32L288 32l0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 74.8 0c27.1 0 51.3 17.1 60.3 42.6l42.7 120.6c-10.9-2.1-22.2-3.2-33.8-3.2c-59.5 0-112.1 29.6-144 74.8l0-42.8c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32c2.3 0 4.6-.3 6.8-.7c-4.5 15.5-6.8 31.8-6.8 48.7c0 5.4 .2 10.7 .7 16l-.7 0c-17.7 0-32 14.3-32 32l0 64L86.6 480C56.5 480 32 455.5 32 425.4c0-6.2 1.1-12.4 3.1-18.2L152.9 74.6C162 49.1 186.1 32 213.2 32zM352 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L480 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faDiceFive = {
  prefix: 'fas',
  iconName: 'dice-five',
  icon: [448, 512, [9860], "f523", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM96 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM224 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64-64a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 160a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSquareRss = {
  prefix: 'fas',
  iconName: 'square-rss',
  icon: [448, 512, ["rss-square"], "f143", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM96 136c0-13.3 10.7-24 24-24c137 0 248 111 248 248c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-110.5-89.5-200-200-200c-13.3 0-24-10.7-24-24zm0 96c0-13.3 10.7-24 24-24c83.9 0 152 68.1 152 152c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-57.4-46.6-104-104-104c-13.3 0-24-10.7-24-24zm0 120a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faRssSquare = faSquareRss;
const faLandMineOn = {
  prefix: 'fas',
  iconName: 'land-mine-on',
  icon: [640, 512, [], "e51b", "M344 24l0 144c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-144c0-13.3 10.7-24 24-24s24 10.7 24 24zM192 320c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32l0 32-256 0 0-32zm-77.3 90.5c8.1-16.3 24.8-26.5 42.9-26.5l324.7 0c18.2 0 34.8 10.3 42.9 26.5l27.6 55.2C563.5 487 548 512 524.2 512l-408.4 0c-23.8 0-39.3-25-28.6-46.3l27.6-55.2zM36.3 138.3c7.5-10.9 22.5-13.6 33.4-6.1l104 72c10.9 7.5 13.6 22.5 6.1 33.4s-22.5 13.6-33.4 6.1l-104-72c-10.9-7.5-13.6-22.5-6.1-33.4zm534.1-6.1c10.9-7.5 25.8-4.8 33.4 6.1s4.8 25.8-6.1 33.4l-104 72c-10.9 7.5-25.8 4.8-33.4-6.1s-4.8-25.8 6.1-33.4l104-72z"]
};
const faICursor = {
  prefix: 'fas',
  iconName: 'i-cursor',
  icon: [256, 512, [], "f246", "M.1 29.3C-1.4 47 11.7 62.4 29.3 63.9l8 .7C70.5 67.3 96 95 96 128.3L96 224l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 95.7c0 33.3-25.5 61-58.7 63.8l-8 .7C11.7 449.6-1.4 465 .1 482.7s16.9 30.7 34.5 29.2l8-.7c34.1-2.8 64.2-18.9 85.4-42.9c21.2 24 51.2 40 85.4 42.9l8 .7c17.6 1.5 33.1-11.6 34.5-29.2s-11.6-33.1-29.2-34.5l-8-.7C185.5 444.7 160 417 160 383.7l0-95.7 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-95.7c0-33.3 25.5-61 58.7-63.8l8-.7c17.6-1.5 30.7-16.9 29.2-34.5S239-1.4 221.3 .1l-8 .7C179.2 3.6 149.2 19.7 128 43.7c-21.2-24-51.2-40-85.4-42.9l-8-.7C17-1.4 1.6 11.7 .1 29.3z"]
};
const faStamp = {
  prefix: 'fas',
  iconName: 'stamp',
  icon: [512, 512, [], "f5bf", "M312 201.8c0-17.4 9.2-33.2 19.9-47C344.5 138.5 352 118.1 352 96c0-53-43-96-96-96s-96 43-96 96c0 22.1 7.5 42.5 20.1 58.8c10.7 13.8 19.9 29.6 19.9 47c0 29.9-24.3 54.2-54.2 54.2L112 256C50.1 256 0 306.1 0 368c0 20.9 13.4 38.7 32 45.3L32 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-50.7c18.6-6.6 32-24.4 32-45.3c0-61.9-50.1-112-112-112l-33.8 0c-29.9 0-54.2-24.3-54.2-54.2zM416 416l0 32L96 448l0-32 320 0z"]
};
const faStairs = {
  prefix: 'fas',
  iconName: 'stairs',
  icon: [576, 512, [], "e289", "M384 64c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0 0 96c0 17.7-14.3 32-32 32l-96 0 0 96c0 17.7-14.3 32-32 32l-96 0 0 96c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0 0-96c0-17.7 14.3-32 32-32l96 0 0-96c0-17.7 14.3-32 32-32l96 0 0-96z"]
};
const faI = {
  prefix: 'fas',
  iconName: 'i',
  icon: [320, 512, [105], "49", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l96 0 0 320-96 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0 0-320 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L160 32 32 32z"]
};
const faHryvniaSign = {
  prefix: 'fas',
  iconName: 'hryvnia-sign',
  icon: [384, 512, [8372, "hryvnia"], "f6f2", "M121.9 116.2C138.3 103.1 158.7 96 179.6 96L223 96c27.1 0 49 21.9 49 49c0 11.5-4 22.4-11.1 31L32 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l123.5 0-50.6 28.9c-1.7 1-3.4 2-5.1 3.1L32 272c-17.7 0-32 14.3-32 32s14.3 32 32 32l20.3 0c-2.8 9.9-4.3 20.4-4.3 31c0 62.4 50.6 113 113 113l43.4 0c35.5 0 70-12.1 97.7-34.3L308 441c13.8-11 16-31.2 5-45s-31.2-16-45-5l-5.9 4.7c-16.4 13.1-36.7 20.2-57.7 20.2L161 416c-27.1 0-49-21.9-49-49c0-11.5 4-22.4 11.1-31L352 336c17.7 0 32-14.3 32-32s-14.3-32-32-32l-123.5 0 50.6-28.9c1.7-1 3.4-2 5.1-3.1l67.8 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-20.3 0c2.8-10 4.3-20.4 4.3-31c0-62.4-50.6-113-113-113l-43.4 0c-35.5 0-70 12.1-97.7 34.3L76 71c-13.8 11-16 31.2-5 45s31.2 16 45 5l5.9-4.7z"]
};
const faHryvnia = faHryvniaSign;
const faPills = {
  prefix: 'fas',
  iconName: 'pills',
  icon: [576, 512, [], "f484", "M112 96c-26.5 0-48 21.5-48 48l0 112 96 0 0-112c0-26.5-21.5-48-48-48zM0 144C0 82.1 50.1 32 112 32s112 50.1 112 112l0 224c0 61.9-50.1 112-112 112S0 429.9 0 368L0 144zM554.9 399.4c-7.1 12.3-23.7 13.1-33.8 3.1L333.5 214.9c-10-10-9.3-26.7 3.1-33.8C360 167.7 387.1 160 416 160c88.4 0 160 71.6 160 160c0 28.9-7.7 56-21.1 79.4zm-59.5 59.5C472 472.3 444.9 480 416 480c-88.4 0-160-71.6-160-160c0-28.9 7.7-56 21.1-79.4c7.1-12.3 23.7-13.1 33.8-3.1L498.5 425.1c10 10 9.3 26.7-3.1 33.8z"]
};
const faFaceGrinWide = {
  prefix: 'fas',
  iconName: 'face-grin-wide',
  icon: [512, 512, [128515, "grin-alt"], "f581", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM208 192c0 35.3-14.3 64-32 64s-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64zm128 64c-17.7 0-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64s-14.3 64-32 64z"]
};
const faGrinAlt = faFaceGrinWide;
const faTooth = {
  prefix: 'fas',
  iconName: 'tooth',
  icon: [448, 512, [129463], "f5c9", "M186.1 52.1C169.3 39.1 148.7 32 127.5 32C74.7 32 32 74.7 32 127.5l0 6.2c0 15.8 3.7 31.3 10.7 45.5l23.5 47.1c4.5 8.9 7.6 18.4 9.4 28.2l36.7 205.8c2 11.2 11.6 19.4 22.9 19.8s21.4-7.4 24-18.4l28.9-121.3C192.2 323.7 207 312 224 312s31.8 11.7 35.8 28.3l28.9 121.3c2.6 11.1 12.7 18.8 24 18.4s20.9-8.6 22.9-19.8l36.7-205.8c1.8-9.8 4.9-19.3 9.4-28.2l23.5-47.1c7.1-14.1 10.7-29.7 10.7-45.5l0-2.1c0-55-44.6-99.6-99.6-99.6c-24.1 0-47.4 8.8-65.6 24.6l-3.2 2.8 19.5 15.2c7 5.4 8.2 15.5 2.8 22.5s-15.5 8.2-22.5 2.8l-24.4-19-37-28.8z"]
};
const faV = {
  prefix: 'fas',
  iconName: 'v',
  icon: [384, 512, [118], "56", "M19.7 34.5c16.3-6.8 35 .9 41.8 17.2L192 364.8 322.5 51.7c6.8-16.3 25.5-24 41.8-17.2s24 25.5 17.2 41.8l-160 384c-5 11.9-16.6 19.7-29.5 19.7s-24.6-7.8-29.5-19.7L2.5 76.3c-6.8-16.3 .9-35 17.2-41.8z"]
};
const faBangladeshiTakaSign = {
  prefix: 'fas',
  iconName: 'bangladeshi-taka-sign',
  icon: [384, 512, [], "e2e6", "M36 32.3C18.4 30.1 2.4 42.5 .2 60S10.5 93.6 28 95.8l7.9 1c16 2 28 15.6 28 31.8L64 160l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 160c0 53 43 96 96 96l32 0c106 0 192-86 192-192l0-32c0-53-43-96-96-96l-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0c17.7 0 32 14.3 32 32l0 32c0 70.7-57.3 128-128 128l-32 0c-17.7 0-32-14.3-32-32l0-160 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-31.5c0-48.4-36.1-89.3-84.1-95.3l-7.9-1z"]
};
const faBicycle = {
  prefix: 'fas',
  iconName: 'bicycle',
  icon: [640, 512, [128690], "f206", "M312 32c-13.3 0-24 10.7-24 24s10.7 24 24 24l25.7 0 34.6 64-149.4 0-27.4-38C191 99.7 183.7 96 176 96l-56 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l43.7 0 22.1 30.7-26.6 53.1c-10-2.5-20.5-3.8-31.2-3.8C57.3 224 0 281.3 0 352s57.3 128 128 128c65.3 0 119.1-48.9 127-112l49 0c8.5 0 16.3-4.5 20.7-11.8l84.8-143.5 21.7 40.1C402.4 276.3 384 312 384 352c0 70.7 57.3 128 128 128s128-57.3 128-128s-57.3-128-128-128c-13.5 0-26.5 2.1-38.7 6L375.4 48.8C369.8 38.4 359 32 347.2 32L312 32zM458.6 303.7l32.3 59.7c6.3 11.7 20.9 16 32.5 9.7s16-20.9 9.7-32.5l-32.3-59.7c3.6-.6 7.4-.9 11.2-.9c39.8 0 72 32.2 72 72s-32.2 72-72 72s-72-32.2-72-72c0-18.6 7-35.5 18.6-48.3zM133.2 368l65 0c-7.3 32.1-36 56-70.2 56c-39.8 0-72-32.2-72-72s32.2-72 72-72c1.7 0 3.4 .1 5.1 .2l-24.2 48.5c-9 18.1 4.1 39.4 24.3 39.4zm33.7-48l50.7-101.3 72.9 101.2-.1 .1-123.5 0zm90.6-128l108.5 0L317 274.8 257.4 192z"]
};
const faStaffSnake = {
  prefix: 'fas',
  iconName: 'staff-snake',
  icon: [384, 512, ["rod-asclepius", "rod-snake", "staff-aesculapius"], "e579", "M222.6 43.2l-.1 4.8L288 48c53 0 96 43 96 96s-43 96-96 96l-40 0 0-80 40 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-40 0-28 0-4.5 144 40.5 0c53 0 96 43 96 96s-43 96-96 96l-16 0 0-80 16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-43 0-3.1 99.5L208.5 495l0 1c-.3 8.9-7.6 16-16.5 16s-16.2-7.1-16.5-16l0-1-1-31L136 464c-22.1 0-40-17.9-40-40s17.9-40 40-40l36 0-1-32-19 0c-53 0-96-43-96-96c0-47.6 34.6-87.1 80-94.7l0 94.7c0 8.8 7.2 16 16 16l16.5 0L164 128l-28 0-13.4 0c-9 18.9-28.3 32-50.6 32l-16 0c-30.9 0-56-25.1-56-56S25.1 48 56 48l8 0 8 0 89.5 0-.1-4.8L161 32c0-.7 0-1.3 0-1.9c.5-16.6 14.1-30 31-30s30.5 13.4 31 30c0 .6 0 1.3 0 1.9l-.4 11.2zM64 112a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faRodAsclepius = faStaffSnake;
const faRodSnake = faStaffSnake;
const faStaffAesculapius = faStaffSnake;
const faHeadSideCoughSlash = {
  prefix: 'fas',
  iconName: 'head-side-cough-slash',
  icon: [640, 512, [], "e062", "M448 325.8l44 34.5c8.1 1.4 14.8 6.8 18 14.1L552.9 408c10.6 .4 19.5 7.6 22.2 17.4l39.1 30.6c.6 0 1.2-.1 1.8-.1c11.1 0 20.4 7.5 23.2 17.8l-3.9 0c6.2 8.5 6.4 20.4-.4 29c-8.2 10.4-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2S28.4-3.1 38.8 5.1L89.6 44.9C127 16.7 173.5 0 224 0l24 0c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8L448 320s0 0 0 0l0 5.8zM0 224.2c0-38.7 9.8-75.1 27.1-106.9L341.8 365.3l-2.5 .3c-11 1.4-19.2 10.7-19.2 21.8c0 11.6 9 21.2 20.6 21.9l62 3.9 43 33.9C439.3 466.2 421.2 480 400 480l-80 0 0 8c0 13.3-10.7 24-24 24l-40 0s0 0 0 0L96 512c-17.7 0-32-14.3-32-32l0-72.7c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zM616 360a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm-64-48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40-24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faTruckMedical = {
  prefix: 'fas',
  iconName: 'truck-medical',
  icon: [640, 512, [128657, "ambulance"], "f0f9", "M0 48C0 21.5 21.5 0 48 0L368 0c26.5 0 48 21.5 48 48l0 48 50.7 0c17 0 33.3 6.7 45.3 18.7L589.3 192c12 12 18.7 28.3 18.7 45.3l0 18.7 0 32 0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-26.5 0-48-21.5-48-48L0 48zM416 256l128 0 0-18.7L466.7 160 416 160l0 96zM160 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM176 80l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faAmbulance = faTruckMedical;
const faWheatAwnCircleExclamation = {
  prefix: 'fas',
  iconName: 'wheat-awn-circle-exclamation',
  icon: [640, 512, [], "e598", "M505 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L383 95c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l88-88zM305.5 27.3c-6.2-6.2-16.4-6.2-22.6 0L271.5 38.6c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0l-11.3 11.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4-30.5 30.5c-3.4-27.3-15.5-53.8-36.5-74.8L101.8 231c-6.2-6.2-16.4-6.2-22.6 0L67.9 242.3c-37.5 37.5-37.5 98.3 0 135.8l10.4 10.4L9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l68.9-68.9 12.2 12.2c37.5 37.5 98.3 37.5 135.8 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-21.8-21.8-49.6-34.1-78.1-36.9l31.9-31.9 12.2 12.2c22.5 22.5 53.3 31.5 82.4 27c0-1 0-2.1 0-3.1c0-33.1 9.1-64.1 25-90.6c-15.5-8.7-32.5-13.8-49.8-15.5l31.9-31.9 12.2 12.2c6 6 12.6 11.1 19.7 15.2c27.5-34 67.3-57.5 112.6-63.8c-4.1-3.8-8.4-7.3-12.9-10.5L505 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-59.4 59.4c-20.6-4.4-42-3.7-62.3 2.1c6.1-21.3 6.6-43.8 1.4-65.3L409 41c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L329.1 52.9c-3.7-5-7.8-9.8-12.4-14.3L305.5 27.3zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faSnowman = {
  prefix: 'fas',
  iconName: 'snowman',
  icon: [512, 512, [9731, 9924], "f7d0", "M341.1 140.6c-2 3.9-1.6 8.6 1.2 12c7 8.5 12.9 18.1 17.2 28.4L408 160.2l0-40.2c0-13.3 10.7-24 24-24s24 10.7 24 24l0 19.6 22.5-9.7c12.2-5.2 26.3 .4 31.5 12.6s-.4 26.3-12.6 31.5l-56 24-73.6 31.5c-.5 9.5-2.1 18.6-4.8 27.3c-1.2 3.8-.1 8 2.8 10.8C396.7 296.9 416 338.2 416 384c0 44.7-18.3 85-47.8 114.1c-9.9 9.7-23.7 13.9-37.5 13.9l-149.3 0c-13.9 0-27.7-4.2-37.5-13.9C114.3 469 96 428.7 96 384c0-45.8 19.3-87.1 50.1-116.3c2.9-2.8 4-6.9 2.8-10.8c-2.7-8.7-4.3-17.9-4.8-27.3L70.5 198.1l-56-24C2.4 168.8-3.3 154.7 1.9 142.5s19.3-17.8 31.5-12.6L56 139.6 56 120c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40.2L152.6 181c4.3-10.3 10.1-19.9 17.2-28.4c2.8-3.4 3.3-8.1 1.2-12C164 127.2 160 112.1 160 96c0-53 43-96 96-96s96 43 96 96c0 16.1-4 31.2-10.9 44.6zM224 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm48 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-16 80a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm16 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zM288 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-48 24l0 3.2c0 3.2 .8 6.3 2.3 9l9 16.9c.9 1.7 2.7 2.8 4.7 2.8s3.8-1.1 4.7-2.8l9-16.9c1.5-2.8 2.3-5.9 2.3-9l0-3.2c0-8.8-7.2-16-16-16s-16 7.2-16 16z"]
};
const faMortarPestle = {
  prefix: 'fas',
  iconName: 'mortar-pestle',
  icon: [512, 512, [], "f5a7", "M504.3 11.1C493.3-1.6 474.5-3.7 461 6.2L252.3 160l144.9 0L502.6 54.6c11.8-11.8 12.6-30.8 1.6-43.5zM32 192c-17.7 0-32 14.3-32 32s14.3 32 32 32c0 82.5 43.4 147.7 123.9 176.2c-11.1 13.9-19.4 30.3-23.9 48.1C127.6 497.4 142.3 512 160 512l192 0c17.7 0 32.4-14.6 28.1-31.7c-4.5-17.8-12.8-34.1-23.9-48.1C436.6 403.7 480 338.5 480 256c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 192z"]
};
const faRoadBarrier = {
  prefix: 'fas',
  iconName: 'road-barrier',
  icon: [640, 512, [], "e562", "M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-181.7L149.2 96 64 96l0-32c0-17.7-14.3-32-32-32zM405.2 96l-74.3 0-5.4 10.7L234.8 288l74.3 0 5.4-10.7L405.2 96zM362.8 288l74.3 0 5.4-10.7L533.2 96l-74.3 0-5.4 10.7L362.8 288zM202.8 96l-5.4 10.7L106.8 288l74.3 0 5.4-10.7L277.2 96l-74.3 0zm288 192l85.2 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 53.7L490.8 288z"]
};
const faSchool = {
  prefix: 'fas',
  iconName: 'school',
  icon: [640, 512, [127979], "f549", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l208 0 0-96c0-35.3 28.7-64 64-64s64 28.7 64 64l0 96 208 0c26.5 0 48-21.5 48-48l0-320c0-26.5-21.5-48-48-48L473.7 96 337.8 5.4zM96 192l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm400 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64zM96 320l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm400 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64zM232 176a88 88 0 1 1 176 0 88 88 0 1 1 -176 0zm88-48c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16c0-8.8-7.2-16-16-16z"]
};
const faIgloo = {
  prefix: 'fas',
  iconName: 'igloo',
  icon: [576, 512, [], "f7ae", "M320 33.8L320 160 48.5 160C100.2 82.8 188.1 32 288 32c10.8 0 21.5 .6 32 1.8zM352 160l0-120.9C424.9 55.7 487.2 99.8 527.5 160L352 160zM29.9 192L96 192l0 128L0 320c0-46 10.8-89.4 29.9-128zM192 320l-64 0 0-128 320 0 0 128-64 0 0 32 192 0 0 80c0 26.5-21.5 48-48 48l-176 0 0-128c0-35.3-28.7-64-64-64s-64 28.7-64 64l0 128L48 480c-26.5 0-48-21.5-48-48l0-80 192 0 0-32zm288 0l0-128 66.1 0c19.2 38.6 29.9 82 29.9 128l-96 0z"]
};
const faJoint = {
  prefix: 'fas',
  iconName: 'joint',
  icon: [640, 512, [], "f595", "M448 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 11c0 55.2 21.9 108.1 60.9 147.1l21 21c9 9 14.1 21.2 14.1 33.9l0 11c0 17.7 14.3 32 32 32s32-14.3 32-32l0-11c0-29.7-11.8-58.2-32.8-79.2l-21-21C463.2 117.8 448 81.2 448 43l0-11zM576 256c0 17.7 14.3 32 32 32s32-14.3 32-32l0-11c0-55.2-21.9-108.1-60.9-147.1l-21-21c-9-9-14.1-21.2-14.1-33.9l0-11c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 11c0 29.7 11.8 58.2 32.8 79.2l21 21c27 27 42.2 63.6 42.2 101.8l0 11zM229.8 360c-4.7-2.3-10-2.7-15.2-2c-37.8 5.6-75.2 14.3-106.9 22.8C81.3 388 58.3 395.1 42 400.4c-8.2 2.7-14.7 4.9-19.2 6.5c-2.3 .8-4 1.4-5.2 1.8l-1.3 .5C6.8 412.5 0 421.4 0 432s6.8 19.5 16.3 22.7l1.3 .5c1.2 .4 3 1.1 5.2 1.8c4.5 1.6 11 3.8 19.2 6.5c16.3 5.4 39.2 12.5 65.7 19.6C160.3 497.3 228.8 512 288 512l67.3 0c4.1 0 6.3-5.1 3.6-8.3L256.5 380.8c-7.4-8.9-16.5-15.9-26.7-20.8zM445 512l19 0 51.3 0c4.1 0 6.3-5.1 3.6-8.3L416.5 380.8C401.3 362.5 378.8 352 355 352l-19 0-48 0c-1.1 0-2.3 0-3.4 0c-4.1 0-6.2 5.1-3.5 8.3L383.5 483.2C398.7 501.5 421.2 512 445 512zm-3.9-151.7L543.5 483.2c14.6 17.5 35.9 27.9 58.6 28.7c21.1-1.1 37.9-18.6 37.9-39.9l0-80c0-22.1-17.9-40-40-40l-155.3 0c-4.1 0-6.3 5.1-3.6 8.3z"]
};
const faAngleRight = {
  prefix: 'fas',
  iconName: 'angle-right',
  icon: [320, 512, [8250], "f105", "M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"]
};
const faHorse = {
  prefix: 'fas',
  iconName: 'horse',
  icon: [576, 512, [128014], "f6f0", "M448 238.1l0-78.1 16 0 9.8 19.6c12.5 25.1 42.2 36.4 68.3 26c20.5-8.2 33.9-28 33.9-50.1L576 80c0-19.1-8.4-36.3-21.7-48l5.7 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L480 0 448 0C377.3 0 320 57.3 320 128l-96 0-20.8 0-54.4 0c-30.7 0-57.6 16.3-72.5 40.8C33.2 174.5 0 211.4 0 256l0 56c0 13.3 10.7 24 24 24s24-10.7 24-24l0-56c0-13.4 6.6-25.2 16.7-32.5c1.6 13 6.3 25.4 13.6 36.4l28.2 42.4c8.3 12.4 6.4 28.7-1.2 41.6c-16.5 28-20.6 62.2-10 93.9l17.5 52.4c4.4 13.1 16.6 21.9 30.4 21.9l33.7 0c21.8 0 37.3-21.4 30.4-42.1l-20.8-62.5c-2.1-6.4-.5-13.4 4.3-18.2l12.7-12.7c13.2-13.2 20.6-31.1 20.6-49.7c0-2.3-.1-4.6-.3-6.9l84 24c4.1 1.2 8.2 2.1 12.3 2.8L320 480c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-164.3c19.2-19.2 31.5-45.7 32-75.7c0 0 0 0 0 0l0-1.9zM496 64a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faQ = {
  prefix: 'fas',
  iconName: 'q',
  icon: [448, 512, [113], "51", "M64 256c0 88.4 71.6 160 160 160c28.9 0 56-7.7 79.4-21.1l-72-86.4c-11.3-13.6-9.5-33.8 4.1-45.1s33.8-9.5 45.1 4.1l70.9 85.1C371.9 325.8 384 292.3 384 256c0-88.4-71.6-160-160-160S64 167.6 64 256zM344.9 444.6C310 467 268.5 480 224 480C100.3 480 0 379.7 0 256S100.3 32 224 32s224 100.3 224 224c0 56.1-20.6 107.4-54.7 146.7l47.3 56.8c11.3 13.6 9.5 33.8-4.1 45.1s-33.8 9.5-45.1-4.1l-46.6-55.9z"]
};
const faG = {
  prefix: 'fas',
  iconName: 'g',
  icon: [448, 512, [103], "47", "M224 96C135.6 96 64 167.6 64 256s71.6 160 160 160c77.4 0 142-55 156.8-128L256 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l144 0c25.8 0 49.6 21.4 47.2 50.6C437.8 389.6 341.4 480 224 480C100.3 480 0 379.7 0 256S100.3 32 224 32c57.4 0 109.7 21.6 149.3 57c13.2 11.8 14.3 32 2.5 45.2s-32 14.3-45.2 2.5C302.3 111.4 265 96 224 96z"]
};
const faNotesMedical = {
  prefix: 'fas',
  iconName: 'notes-medical',
  icon: [512, 512, [], "f481", "M96 352L96 96c0-35.3 28.7-64 64-64l256 0c35.3 0 64 28.7 64 64l0 197.5c0 17-6.7 33.3-18.7 45.3l-58.5 58.5c-12 12-28.3 18.7-45.3 18.7L160 416c-35.3 0-64-28.7-64-64zM272 128c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0zm24 336c13.3 0 24 10.7 24 24s-10.7 24-24 24l-160 0C60.9 512 0 451.1 0 376L0 152c0-13.3 10.7-24 24-24s24 10.7 24 24l0 224c0 48.6 39.4 88 88 88l160 0z"]
};
const faTemperatureHalf = {
  prefix: 'fas',
  iconName: 'temperature-half',
  icon: [320, 512, [127777, "temperature-2", "thermometer-2", "thermometer-half"], "f2c9", "M160 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L208 112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L48 112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3L144 208c0-8.8 7.2-16 16-16s16 7.2 16 16l0 114.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faTemperature2 = faTemperatureHalf;
const faThermometer2 = faTemperatureHalf;
const faThermometerHalf = faTemperatureHalf;
const faDongSign = {
  prefix: 'fas',
  iconName: 'dong-sign',
  icon: [384, 512, [], "e169", "M288 32c-17.7 0-32 14.3-32 32l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 49.1c-18.8-10.9-40.7-17.1-64-17.1c-70.7 0-128 57.3-128 128s57.3 128 128 128c24.5 0 47.4-6.9 66.8-18.8c5 11.1 16.2 18.8 29.2 18.8c17.7 0 32-14.3 32-32l0-96 0-160c17.7 0 32-14.3 32-32s-14.3-32-32-32c0-17.7-14.3-32-32-32zM128 288a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 448z"]
};
const faCapsules = {
  prefix: 'fas',
  iconName: 'capsules',
  icon: [576, 512, [], "f46b", "M64 144c0-26.5 21.5-48 48-48s48 21.5 48 48l0 112-96 0 0-112zM0 144L0 368c0 61.9 50.1 112 112 112s112-50.1 112-112l0-178.4c1.8 19.1 8.2 38 19.8 54.8L372.3 431.7c35.5 51.7 105.3 64.3 156 28.1s63-107.5 27.5-159.2L427.3 113.3C391.8 61.5 321.9 49 271.3 85.2c-28 20-44.3 50.8-47.3 83l0-24.2c0-61.9-50.1-112-112-112S0 82.1 0 144zm296.6 64.2c-16-23.3-10-55.3 11.9-71c21.2-15.1 50.5-10.3 66 12.2l67 97.6L361.6 303l-65-94.8zM491 407.7c-.8 .6-1.6 1.1-2.4 1.6l4-2.8c-.5 .4-1 .8-1.6 1.2z"]
};
const faPooStorm = {
  prefix: 'fas',
  iconName: 'poo-storm',
  icon: [448, 512, ["poo-bolt"], "f75a", "M236.9 .2c-5.5-.7-11 1.4-14.5 5.7s-4.6 10.1-2.8 15.3c2.8 8.2 4.3 16.9 4.3 26.1c0 21.7-8.5 37.2-21.9 47.6c-13.8 10.8-34 17-57.8 17L128 112c-35.3 0-64 28.7-64 64c0 12.2 3.4 23.5 9.3 33.2C31.7 216.2 0 252.4 0 296c0 40.9 28 75.4 65.8 85.2c-5.3-18.5 1-38.5 16.2-50.7l160-128c17.6-14.1 42.6-14 60.2 .2s22.8 38.6 12.8 58.8L285.7 320l18.3 0c20.4 0 38.5 12.9 45.3 32.1c3.7 10.6 3.5 21.8 0 31.9l10.7 0c48.6 0 88-39.4 88-88c0-43.6-31.7-79.8-73.3-86.8c5.9-9.7 9.3-21.1 9.3-33.2c0-35.3-28.7-64-64-64l-1.4 0c.9-5.4 1.4-10.9 1.4-16.6c0-48.7-36.1-88.9-83.1-95.2zm45.1 227.4c-5.8-4.7-14.2-4.7-20.1-.1l-160 128c-5.3 4.2-7.4 11.4-5.1 17.8s8.3 10.7 15.1 10.7l70.1 0L129.7 488.8c-3.4 6.7-1.6 14.9 4.3 19.6s14.2 4.7 20.1 .1l160-128c5.3-4.2 7.4-11.4 5.1-17.8s-8.3-10.7-15.1-10.7l-70.1 0 52.4-104.8c3.4-6.7 1.6-14.9-4.3-19.6z"]
};
const faPooBolt = faPooStorm;
const faFaceFrownOpen = {
  prefix: 'fas',
  iconName: 'face-frown-open',
  icon: [512, 512, [128550, "frown-open"], "f57a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-122 174.5c-12.4 5.2-26.5-4.1-21.1-16.4c16-36.6 52.4-62.1 94.8-62.1s78.8 25.6 94.8 62.1c5.4 12.3-8.7 21.6-21.1 16.4c-22.4-9.5-47.4-14.8-73.7-14.8s-51.3 5.3-73.7 14.8z"]
};
const faFrownOpen = faFaceFrownOpen;
const faHandPointUp = {
  prefix: 'fas',
  iconName: 'hand-point-up',
  icon: [384, 512, [9757], "f0a6", "M32 32C32 14.3 46.3 0 64 0S96 14.3 96 32l0 208-64 0L32 32zM224 192c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm-64-64c17.7 0 32 14.3 32 32l0 48c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-48c0-17.7 14.3-32 32-32zm160 96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm-96 88l0-.6c9.4 5.4 20.3 8.6 32 8.6c13.2 0 25.4-4 35.6-10.8c8.7 24.9 32.5 42.8 60.4 42.8c11.7 0 22.6-3.1 32-8.6l0 8.6c0 88.4-71.6 160-160 160l-61.7 0c-42.4 0-83.1-16.9-113.1-46.9L37.5 453.5C13.5 429.5 0 396.9 0 363l0-27c0-35.3 28.7-64 64-64l88 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-56 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l56 0c39.8 0 72-32.2 72-72z"]
};
const faMoneyBill = {
  prefix: 'fas',
  iconName: 'money-bill',
  icon: [576, 512, [], "f0d6", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm64 320l-64 0 0-64c35.3 0 64 28.7 64 64zM64 192l0-64 64 0c0 35.3-28.7 64-64 64zM448 384c0-35.3 28.7-64 64-64l0 64-64 0zm64-192c-35.3 0-64-28.7-64-64l64 0 0 64zM288 160a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faBookmark = {
  prefix: 'fas',
  iconName: 'bookmark',
  icon: [384, 512, [128278, 61591], "f02e", "M0 48V487.7C0 501.1 10.9 512 24.3 512c5 0 9.9-1.5 14-4.4L192 400 345.7 507.6c4.1 2.9 9 4.4 14 4.4c13.4 0 24.3-10.9 24.3-24.3V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48z"]
};
const faAlignJustify = {
  prefix: 'fas',
  iconName: 'align-justify',
  icon: [448, 512, [], "f039", "M448 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32L32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32z"]
};
const faUmbrellaBeach = {
  prefix: 'fas',
  iconName: 'umbrella-beach',
  icon: [576, 512, [127958], "f5ca", "M346.3 271.8l-60.1-21.9L214 448 32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-261.9 0 64.1-176.2zm121.1-.2l-3.3 9.1 67.7 24.6c18.1 6.6 38-4.2 39.6-23.4c6.5-78.5-23.9-155.5-80.8-208.5c2 8 3.2 16.3 3.4 24.8l.2 6c1.8 57-7.3 113.8-26.8 167.4zM462 99.1c-1.1-34.4-22.5-64.8-54.4-77.4c-.9-.4-1.9-.7-2.8-1.1c-33-11.7-69.8-2.4-93.1 23.8l-4 4.5C272.4 88.3 245 134.2 226.8 184l-3.3 9.1L434 269.7l3.3-9.1c18.1-49.8 26.6-102.5 24.9-155.5l-.2-6zM107.2 112.9c-11.1 15.7-2.8 36.8 15.3 43.4l71 25.8 3.3-9.1c19.5-53.6 49.1-103 87.1-145.5l4-4.5c6.2-6.9 13.1-13 20.5-18.2c-79.6 2.5-154.7 42.2-201.2 108z"]
};
const faHelmetUn = {
  prefix: 'fas',
  iconName: 'helmet-un',
  icon: [512, 512, [], "e503", "M479.5 224C471.2 98.9 367.2 0 240 0C107.5 0 0 107.5 0 240l0 56.3C0 344.8 39.2 384 87.7 384L200 384l14.9 0L343.5 505.4c4.5 4.2 10.4 6.6 16.5 6.6l96 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-86.5 0-1.5-1.5L368 288l80 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-.5 0zM320 417.2l-78-73.7L274.4 288l45.6 0 0 129.2zM285.3 103.1l34.7 52 0-43.2c0-8.8 7.2-16 16-16s16 7.2 16 16l0 96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52 0 43.2c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM160 112l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faBullseye = {
  prefix: 'fas',
  iconName: 'bullseye',
  icon: [512, 512, [], "f140", "M448 256A192 192 0 1 0 64 256a192 192 0 1 0 384 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 80a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zM224 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faBacon = {
  prefix: 'fas',
  iconName: 'bacon',
  icon: [576, 512, [129363], "f7e5", "M439.2 1.2c11.2-3.2 23.2-.1 31.4 8.1L518 56.7l-26.5 7.9c-58 16.6-98.1 39.6-129.6 67.4c-31.2 27.5-53.2 59.1-75.1 90.9l-2.3 3.3C241.6 288.7 195 356.6 72.8 417.7L37.9 435.2 9.4 406.6c-7.3-7.3-10.6-17.6-9-27.8s8.1-18.9 17.3-23.5C136.1 296.2 180.9 231 223.3 169.3l2.3-3.4c21.8-31.8 44.9-64.9 77.7-93.9c33.4-29.5 75.8-53.6 135.9-70.8zM61.8 459l25.4-12.7c129.5-64.7 179.9-138.1 223.8-202l2.2-3.3c22.1-32.1 42.1-60.5 69.9-85.1c27.5-24.3 63.4-45.2 117.3-60.6c0 0 0 0 0 0l.2-.1 43.1-12.9 23 23c8 8 11.2 19.7 8.3 30.7s-11.3 19.6-22.2 22.7c-51.9 14.8-85.6 34.7-111.1 57.2c-26.1 23-45.1 49.9-67.3 82.1l-2.2 3.2C327.8 365.9 275.5 442 142.3 508.6c-12.3 6.2-27.2 3.7-36.9-6L61.8 459z"]
};
const faHandPointDown = {
  prefix: 'fas',
  iconName: 'hand-point-down',
  icon: [384, 512, [], "f0a7", "M32 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-208-64 0 0 208zM224 320c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64zm-64 64c17.7 0 32-14.3 32-32l0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c0 17.7 14.3 32 32 32zm160-96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64zm-96-88l0 .6c9.4-5.4 20.3-8.6 32-8.6c13.2 0 25.4 4 35.6 10.8c8.7-24.9 32.5-42.8 60.4-42.8c11.7 0 22.6 3.1 32 8.6l0-8.6C384 71.6 312.4 0 224 0L162.3 0C119.8 0 79.1 16.9 49.1 46.9L37.5 58.5C13.5 82.5 0 115.1 0 149l0 27c0 35.3 28.7 64 64 64l88 0c22.1 0 40-17.9 40-40s-17.9-40-40-40l-56 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l56 0c39.8 0 72 32.2 72 72z"]
};
const faArrowUpFromBracket = {
  prefix: 'fas',
  iconName: 'arrow-up-from-bracket',
  icon: [448, 512, [], "e09a", "M246.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 109.3 192 320c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-64z"]
};
const faFolder = {
  prefix: 'fas',
  iconName: 'folder',
  icon: [512, 512, [128193, 128447, 61716, "folder-blank"], "f07b", "M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H288c-10.1 0-19.6-4.7-25.6-12.8L243.2 57.6C231.1 41.5 212.1 32 192 32H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64z"]
};
const faFolderBlank = faFolder;
const faFileWaveform = {
  prefix: 'fas',
  iconName: 'file-waveform',
  icon: [448, 512, ["file-medical-alt"], "f478", "M96 0C60.7 0 32 28.7 32 64l0 224 112 0c6.1 0 11.6 3.4 14.3 8.8L176 332.2l49.7-99.4c2.7-5.4 8.3-8.8 14.3-8.8s11.6 3.4 14.3 8.8L281.9 288l70.1 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-80 0c-6.1 0-11.6-3.4-14.3-8.8L240 275.8l-49.7 99.4c-2.7 5.4-8.3 8.8-14.3 8.8s-11.6-3.4-14.3-8.8L134.1 320 32 320l0 128c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L256 0 96 0zM288 0l0 128 128 0L288 0z"]
};
const faFileMedicalAlt = faFileWaveform;
const faRadiation = {
  prefix: 'fas',
  iconName: 'radiation',
  icon: [512, 512, [], "f7b9", "M216 186.7c-23.9 13.8-40 39.7-40 69.3L32 256C14.3 256-.2 241.6 2 224.1C10.7 154 47.8 92.7 101.3 52c14.1-10.7 33.8-5.3 42.7 10l72 124.7zM256 336c14.6 0 28.2-3.9 40-10.7l72 124.8c8.8 15.3 3.7 35.1-12.6 41.9c-30.6 12.9-64.2 20-99.4 20s-68.9-7.1-99.4-20c-16.3-6.9-21.4-26.6-12.6-41.9l72-124.8c11.8 6.8 25.4 10.7 40 10.7zm224-80l-144 0c0-29.6-16.1-55.5-40-69.3L368 62c8.8-15.3 28.6-20.7 42.7-10c53.6 40.7 90.6 102 99.4 172.1c2.2 17.5-12.4 31.9-30 31.9zM256 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faChartSimple = {
  prefix: 'fas',
  iconName: 'chart-simple',
  icon: [448, 512, [], "e473", "M160 80c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-352zM0 272c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48L0 272zM368 96l32 0c26.5 0 48 21.5 48 48l0 288c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48z"]
};
const faMarsStroke = {
  prefix: 'fas',
  iconName: 'mars-stroke',
  icon: [512, 512, [9894], "f229", "M376 0c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l33.4 33.4L370.3 96.4 345 71c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l25.4 25.4L307.8 159c-28.4-19.5-62.7-31-99.8-31c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176c0-37-11.4-71.4-31-99.8l28.6-28.6L407 201c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-25.4-25.4 22.1-22.1L471 153c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-112c0-13.3-10.7-24-24-24L376 0zm88 48s0 0 0 0s0 0 0 0s0 0 0 0zM96 304a112 112 0 1 1 224 0A112 112 0 1 1 96 304z"]
};
const faVial = {
  prefix: 'fas',
  iconName: 'vial',
  icon: [512, 512, [129514], "f492", "M342.6 9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4L28.1 342.6C10.1 360.6 0 385 0 410.5L0 416c0 53 43 96 96 96l5.5 0c25.5 0 49.9-10.1 67.9-28.1L448 205.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-32-32-96-96-32-32zM205.3 256L352 109.3 402.7 160l-96 96-101.5 0z"]
};
const faGauge = {
  prefix: 'fas',
  iconName: 'gauge',
  icon: [512, 512, ["dashboard", "gauge-med", "tachometer-alt-average"], "f624", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-26.9-16.5-49.9-40-59.3L280 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 204.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64s64-28.7 64-64zM144 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm-16 80a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM400 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faDashboard = faGauge;
const faGaugeMed = faGauge;
const faTachometerAltAverage = faGauge;
const faWandMagicSparkles = {
  prefix: 'fas',
  iconName: 'wand-magic-sparkles',
  icon: [576, 512, ["magic-wand-sparkles"], "e2ca", "M234.7 42.7L197 56.8c-3 1.1-5 4-5 7.2s2 6.1 5 7.2l37.7 14.1L248.8 123c1.1 3 4 5 7.2 5s6.1-2 7.2-5l14.1-37.7L315 71.2c3-1.1 5-4 5-7.2s-2-6.1-5-7.2L277.3 42.7 263.2 5c-1.1-3-4-5-7.2-5s-6.1 2-7.2 5L234.7 42.7zM46.1 395.4c-18.7 18.7-18.7 49.1 0 67.9l34.6 34.6c18.7 18.7 49.1 18.7 67.9 0L529.9 116.5c18.7-18.7 18.7-49.1 0-67.9L495.3 14.1c-18.7-18.7-49.1-18.7-67.9 0L46.1 395.4zM484.6 82.6l-105 105-23.3-23.3 105-105 23.3 23.3zM7.5 117.2C3 118.9 0 123.2 0 128s3 9.1 7.5 10.8L64 160l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L128 160l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L128 96 106.8 39.5C105.1 35 100.8 32 96 32s-9.1 3-10.8 7.5L64 96 7.5 117.2zm352 256c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L416 416l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L480 416l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L480 352l-21.2-56.5c-1.7-4.5-6-7.5-10.8-7.5s-9.1 3-10.8 7.5L416 352l-56.5 21.2z"]
};
const faMagicWandSparkles = faWandMagicSparkles;
const faE = {
  prefix: 'fas',
  iconName: 'e',
  icon: [320, 512, [101], "45", "M64 32C28.7 32 0 60.7 0 96L0 256 0 416c0 35.3 28.7 64 64 64l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 416l0-128 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 224 64 96l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32z"]
};
const faPenClip = {
  prefix: 'fas',
  iconName: 'pen-clip',
  icon: [512, 512, ["pen-alt"], "f305", "M453.3 19.3l39.4 39.4c25 25 25 65.5 0 90.5l-52.1 52.1s0 0 0 0l-1-1s0 0 0 0l-16-16-96-96-17-17 52.1-52.1c25-25 65.5-25 90.5 0zM241 114.9c-9.4-9.4-24.6-9.4-33.9 0L105 217c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L173.1 81c28.1-28.1 73.7-28.1 101.8 0L288 94.1l17 17 96 96 16 16 1 1-17 17L229.5 412.5c-48 48-109.2 80.8-175.8 94.1l-25 5c-7.9 1.6-16-.9-21.7-6.6s-8.1-13.8-6.6-21.7l5-25c13.3-66.6 46.1-127.8 94.1-175.8L254.1 128 241 114.9z"]
};
const faPenAlt = faPenClip;
const faBridgeCircleExclamation = {
  prefix: 'fas',
  iconName: 'bridge-circle-exclamation',
  icon: [640, 512, [], "e4ca", "M64 32C46.3 32 32 46.3 32 64s14.3 32 32 32l40 0 0 64-72 0 0 128c53 0 96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96c6.3 0 12.4 .6 18.3 1.7C367.1 231.8 426.9 192 496 192c42.5 0 81.6 15.1 112 40.2l0-72.2-72 0 0-64 40 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32zM488 96l0 64-80 0 0-64 80 0zM360 96l0 64-80 0 0-64 80 0zM232 96l0 64-80 0 0-64 80 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faUser = {
  prefix: 'fas',
  iconName: 'user',
  icon: [448, 512, [128100, 62144], "f007", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z"]
};
const faSchoolCircleCheck = {
  prefix: 'fas',
  iconName: 'school-circle-check',
  icon: [640, 512, [], "e56b", "M337.8 5.4C327-1.8 313-1.8 302.2 5.4L166.3 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l272 0s0 0 0 0l-64 0 0-96c0-35.3 28.7-64 64-64l.3 0 .5 0c3.4-37.7 18.7-72.1 42.2-99.1C350.2 260 335.6 264 320 264c-48.6 0-88-39.4-88-88s39.4-88 88-88s88 39.4 88 88c0 18.3-5.6 35.3-15.1 49.4c29-21 64.6-33.4 103.1-33.4c59.5 0 112.1 29.6 144 74.8L640 144c0-26.5-21.5-48-48-48L473.7 96 337.8 5.4zM96 192l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zm0 128l32 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16zM320 128c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16c0-8.8-7.2-16-16-16zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-99.3-43.3c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7z"]
};
const faDumpster = {
  prefix: 'fas',
  iconName: 'dumpster',
  icon: [576, 512, [], "f793", "M49.7 32c-10.5 0-19.8 6.9-22.9 16.9L.9 133c-.6 2-.9 4.1-.9 6.1C0 150.7 9.3 160 20.9 160l94 0L140.5 32 49.7 32zM272 160l0-128-98.9 0L147.5 160 272 160zm32 0l124.5 0L402.9 32 304 32l0 128zm157.1 0l94 0c11.5 0 20.9-9.3 20.9-20.9c0-2.1-.3-4.1-.9-6.1L549.2 48.9C546.1 38.9 536.8 32 526.3 32l-90.8 0 25.6 128zM32 192l4 32-4 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l12 0L64 448c0 17.7 14.3 32 32 32s32-14.3 32-32l320 0c0 17.7 14.3 32 32 32s32-14.3 32-32l20-160 12 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-4 0 4-32L32 192z"]
};
const faVanShuttle = {
  prefix: 'fas',
  iconName: 'van-shuttle',
  icon: [640, 512, [128656, "shuttle-van"], "f5b6", "M64 104l0 88 96 0 0-96L72 96c-4.4 0-8 3.6-8 8zm482 88L465.1 96 384 96l0 96 162 0zm-226 0l0-96-96 0 0 96 96 0zM592 384l-16 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-26.5 0-48-21.5-48-48L0 104C0 64.2 32.2 32 72 32l120 0 160 0 113.1 0c18.9 0 36.8 8.3 49 22.8L625 186.5c9.7 11.5 15 26.1 15 41.2L640 336c0 26.5-21.5 48-48 48zm-64 0a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM160 432a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faShuttleVan = faVanShuttle;
const faBuildingUser = {
  prefix: 'fas',
  iconName: 'building-user',
  icon: [640, 512, [], "e4da", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 89.9 0c-6.3-10.2-9.9-22.2-9.9-35.1c0-46.9 25.8-87.8 64-109.2l0-95.9L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM576 272a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM352 477.1c0 19.3 15.6 34.9 34.9 34.9l218.2 0c19.3 0 34.9-15.6 34.9-34.9c0-51.4-41.7-93.1-93.1-93.1l-101.8 0c-51.4 0-93.1 41.7-93.1 93.1z"]
};
const faSquareCaretLeft = {
  prefix: 'fas',
  iconName: 'square-caret-left',
  icon: [448, 512, ["caret-square-left"], "f191", "M0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416zM128 256c0-6.7 2.8-13 7.7-17.6l112-104c7-6.5 17.2-8.2 25.9-4.4s14.4 12.5 14.4 22l0 208c0 9.5-5.7 18.2-14.4 22s-18.9 2.1-25.9-4.4l-112-104c-4.9-4.5-7.7-10.9-7.7-17.6z"]
};
const faCaretSquareLeft = faSquareCaretLeft;
const faHighlighter = {
  prefix: 'fas',
  iconName: 'highlighter',
  icon: [576, 512, [], "f591", "M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5s0 0 0 0l0-71.7c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5L224 416l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7L24 512c-13.3 0-24-10.7-24-24l0-4.7c0-6.4 2.5-12.5 7-17z"]
};
const faKey = {
  prefix: 'fas',
  iconName: 'key',
  icon: [512, 512, [128273], "f084", "M336 352c97.2 0 176-78.8 176-176S433.2 0 336 0S160 78.8 160 176c0 18.7 2.9 36.8 8.3 53.7L7 391c-4.5 4.5-7 10.6-7 17l0 80c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-40 40 0c13.3 0 24-10.7 24-24l0-40 40 0c6.4 0 12.5-2.5 17-7l33.3-33.3c16.9 5.4 35 8.3 53.7 8.3zM376 96a40 40 0 1 1 0 80 40 40 0 1 1 0-80z"]
};
const faBullhorn = {
  prefix: 'fas',
  iconName: 'bullhorn',
  icon: [512, 512, [128226, 128363], "f0a1", "M480 32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9L381.7 53c-48 48-113.1 75-181 75l-8.7 0-32 0-96 0c-35.3 0-64 28.7-64 64l0 96c0 35.3 28.7 64 64 64l0 128c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-128 8.7 0c67.9 0 133 27 181 75l43.6 43.6c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-147.6c18.6-8.8 32-32.5 32-60.4s-13.4-51.6-32-60.4L480 32zm-64 76.7L416 240l0 131.3C357.2 317.8 280.5 288 200.7 288l-8.7 0 0-96 8.7 0c79.8 0 156.5-29.8 215.3-83.3z"]
};
const faGlobe = {
  prefix: 'fas',
  iconName: 'globe',
  icon: [512, 512, [127760], "f0ac", "M352 256c0 22.2-1.2 43.6-3.3 64l-185.3 0c-2.2-20.4-3.3-41.8-3.3-64s1.2-43.6 3.3-64l185.3 0c2.2 20.4 3.3 41.8 3.3 64zm28.8-64l123.1 0c5.3 20.5 8.1 41.9 8.1 64s-2.8 43.5-8.1 64l-123.1 0c2.1-20.6 3.2-42 3.2-64s-1.1-43.4-3.2-64zm112.6-32l-116.7 0c-10-63.9-29.8-117.4-55.3-151.6c78.3 20.7 142 77.5 171.9 151.6zm-149.1 0l-176.6 0c6.1-36.4 15.5-68.6 27-94.7c10.5-23.6 22.2-40.7 33.5-51.5C239.4 3.2 248.7 0 256 0s16.6 3.2 27.8 13.8c11.3 10.8 23 27.9 33.5 51.5c11.6 26 20.9 58.2 27 94.7zm-209 0L18.6 160C48.6 85.9 112.2 29.1 190.6 8.4C165.1 42.6 145.3 96.1 135.3 160zM8.1 192l123.1 0c-2.1 20.6-3.2 42-3.2 64s1.1 43.4 3.2 64L8.1 320C2.8 299.5 0 278.1 0 256s2.8-43.5 8.1-64zM194.7 446.6c-11.6-26-20.9-58.2-27-94.6l176.6 0c-6.1 36.4-15.5 68.6-27 94.6c-10.5 23.6-22.2 40.7-33.5 51.5C272.6 508.8 263.3 512 256 512s-16.6-3.2-27.8-13.8c-11.3-10.8-23-27.9-33.5-51.5zM135.3 352c10 63.9 29.8 117.4 55.3 151.6C112.2 482.9 48.6 426.1 18.6 352l116.7 0zm358.1 0c-30 74.1-93.6 130.9-171.9 151.6c25.5-34.2 45.2-87.7 55.3-151.6l116.7 0z"]
};
const faSynagogue = {
  prefix: 'fas',
  iconName: 'synagogue',
  icon: [640, 512, [128333], "f69b", "M309.8 3.7c5.9-4.9 14.6-4.9 20.5 0l121 100.8C469.5 119.7 480 142.2 480 166l0 114.1L480 512l-16 0-112 0 0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96-112 0-16 0 0-231.9L160 166c0-23.7 10.5-46.3 28.8-61.5L309.8 3.7zM512 512l0-267.5 28.1-31.2c3-3.4 7.4-5.3 11.9-5.3s8.9 1.9 11.9 5.3l63.8 70.9c7.9 8.8 12.3 20.3 12.3 32.1L640 448c0 35.3-28.7 64-64 64l-64 0zM128 244.5L128 512l-64 0c-35.3 0-64-28.7-64-64L0 316.3c0-11.9 4.4-23.3 12.3-32.1l63.8-70.9c3-3.4 7.4-5.3 11.9-5.3s8.9 1.9 11.9 5.3L128 244.5zM327 124.3c-3.1-5.4-10.9-5.4-13.9 0l-15.9 28.1-32.3-.3c-6.2-.1-10.1 6.7-7 12.1L274.3 192l-16.4 27.8c-3.2 5.4 .7 12.1 7 12.1l32.3-.3L313 259.7c3.1 5.4 10.9 5.4 13.9 0l15.9-28.1 32.3 .3c6.2 .1 10.1-6.7 7-12.1L365.7 192l16.4-27.8c3.2-5.4-.7-12.1-7-12.1l-32.3 .3L327 124.3z"]
};
const faPersonHalfDress = {
  prefix: 'fas',
  iconName: 'person-half-dress',
  icon: [320, 512, [], "e548", "M160 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm8 352l0-224 6.9 0c33.7 0 64.9 17.7 82.3 46.6l58.3 97c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128s0 0 0 0zM58.2 182.3c19.9-33.1 55.3-53.5 93.8-54.3l0 256s0 0 0 0l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-17.8 0c-10.9 0-18.6-10.7-15.2-21.1L93.3 248.1 59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l53.6-89.2z"]
};
const faRoadBridge = {
  prefix: 'fas',
  iconName: 'road-bridge',
  icon: [640, 512, [], "e563", "M352 0L608 0c17.7 0 32 14.3 32 32l0 448c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-448c0-17.7 14.3-32 32-32zM480 200c-13.3 0-24 10.7-24 24l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64c0-13.3-10.7-24-24-24zm24 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64zM480 40c-13.3 0-24 10.7-24 24l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64c0-13.3-10.7-24-24-24zM32 96l256 0 0 64-40 0 0 64 40 0 0 96c-53 0-96 43-96 96l0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64c0-53-43-96-96-96l0-96 72 0 0-64-40 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm168 64l-80 0 0 64 80 0 0-64z"]
};
const faLocationArrow = {
  prefix: 'fas',
  iconName: 'location-arrow',
  icon: [448, 512, [], "f124", "M429.6 92.1c4.9-11.9 2.1-25.6-7-34.7s-22.8-11.9-34.7-7l-352 144c-14.2 5.8-22.2 20.8-19.3 35.8s16.1 25.8 31.4 25.8l176 0 0 176c0 15.3 10.8 28.4 25.8 31.4s30-5.1 35.8-19.3l144-352z"]
};
const faC = {
  prefix: 'fas',
  iconName: 'c',
  icon: [384, 512, [99], "43", "M329.1 142.9c-62.5-62.5-155.8-62.5-218.3 0s-62.5 163.8 0 226.3s155.8 62.5 218.3 0c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3c-87.5 87.5-221.3 87.5-308.8 0s-87.5-229.3 0-316.8s221.3-87.5 308.8 0c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0z"]
};
const faTabletButton = {
  prefix: 'fas',
  iconName: 'tablet-button',
  icon: [448, 512, [], "f10a", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM224 400a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBuildingLock = {
  prefix: 'fas',
  iconName: 'building-lock',
  icon: [576, 512, [], "e4d6", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 88.6 0c-5.4-9.4-8.6-20.3-8.6-32l0-128c0-23.7 12.9-44.4 32-55.4l0-24.6c0-30.5 12.2-58.2 32-78.4L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM464 240c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faPizzaSlice = {
  prefix: 'fas',
  iconName: 'pizza-slice',
  icon: [512, 512, [], "f818", "M169.7 .9c-22.8-1.6-41.9 14-47.5 34.7L110.4 80c.5 0 1.1 0 1.6 0c176.7 0 320 143.3 320 320c0 .5 0 1.1 0 1.6l44.4-11.8c20.8-5.5 36.3-24.7 34.7-47.5C498.5 159.5 352.5 13.5 169.7 .9zM399.8 410.2c.1-3.4 .2-6.8 .2-10.2c0-159.1-128.9-288-288-288c-3.4 0-6.8 .1-10.2 .2L.5 491.9c-1.5 5.5 .1 11.4 4.1 15.4s9.9 5.6 15.4 4.1L399.8 410.2zM176 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM96 384a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faMoneyBillWave = {
  prefix: 'fas',
  iconName: 'money-bill-wave',
  icon: [576, 512, [], "f53a", "M0 112.5L0 422.3c0 18 10.1 35 27 41.3c87 32.5 174 10.3 261-11.9c79.8-20.3 159.6-40.7 239.3-18.9c23 6.3 48.7-9.5 48.7-33.4l0-309.9c0-18-10.1-35-27-41.3C462 15.9 375 38.1 288 60.3C208.2 80.6 128.4 100.9 48.7 79.1C25.6 72.8 0 88.6 0 112.5zM288 352c-44.2 0-80-43-80-96s35.8-96 80-96s80 43 80 96s-35.8 96-80 96zM64 352c35.3 0 64 28.7 64 64l-64 0 0-64zm64-208c0 35.3-28.7 64-64 64l0-64 64 0zM512 304l0 64-64 0c0-35.3 28.7-64 64-64zM448 96l64 0 0 64c-35.3 0-64-28.7-64-64z"]
};
const faChartArea = {
  prefix: 'fas',
  iconName: 'chart-area',
  icon: [512, 512, ["area-chart"], "f1fe", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm96 288l288 0c17.7 0 32-14.3 32-32l0-68.2c0-7.6-2.7-15-7.7-20.8l-65.8-76.8c-12.1-14.2-33.7-15-46.9-1.8l-21 21c-10 10-26.4 9.2-35.4-1.6l-39.2-47c-12.6-15.1-35.7-15.4-48.7-.6L135.9 215c-5.1 5.8-7.9 13.3-7.9 21.1l0 84c0 17.7 14.3 32 32 32z"]
};
const faAreaChart = faChartArea;
const faHouseFlag = {
  prefix: 'fas',
  iconName: 'house-flag',
  icon: [640, 512, [], "e50d", "M480 0c-17.7 0-32 14.3-32 32l0 160 0 320 64 0 0-320 112 0c8.8 0 16-7.2 16-16l0-128c0-8.8-7.2-16-16-16L512 32c0-17.7-14.3-32-32-32zM416 159L276.8 39.7c-12-10.3-29.7-10.3-41.7 0l-224 192C1 240.4-2.7 254.5 2 267.1S18.6 288 32 288l32 0 0 192c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-96c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 96c0 17.7 14.3 32 32 32l64.7 0 .2 0-1 0 0-353z"]
};
const faPersonCircleMinus = {
  prefix: 'fas',
  iconName: 'person-circle-minus',
  icon: [576, 512, [], "e540", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zm136 16a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm224 0c0-8.8-7.2-16-16-16l-128 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16z"]
};
const faBan = {
  prefix: 'fas',
  iconName: 'ban',
  icon: [512, 512, [128683, "cancel"], "f05e", "M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faCancel = faBan;
const faCameraRotate = {
  prefix: 'fas',
  iconName: 'camera-rotate',
  icon: [640, 512, [], "e0d8", "M213.1 64.8L202.7 96 128 96c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L426.9 64.8C420.4 45.2 402.1 32 381.4 32L258.6 32c-20.7 0-39 13.2-45.5 32.8zM448 256c0 8.8-7.2 16-16 16l-76.7 0c-6.2 0-11.3-5.1-11.3-11.3c0-3 1.2-5.9 3.3-8L371 229c-13.6-13.4-31.9-21-51-21c-19.2 0-37.7 7.6-51.3 21.3L249 249c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l19.7-19.7C257.4 172.7 288 160 320 160c31.8 0 62.4 12.6 85 35l23.7-23.7c2.1-2.1 5-3.3 8-3.3c6.2 0 11.3 5.1 11.3 11.3l0 76.7zM192 320c0-8.8 7.2-16 16-16l76.7 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8L269 347c13.6 13.4 31.9 21 51 21c19.2 0 37.7-7.6 51.3-21.3L391 327c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-19.7 19.7C382.6 403.3 352 416 320 416c-31.8 0-62.4-12.6-85-35l-23.7 23.7c-2.1 2.1-5 3.3-8 3.3c-6.2 0-11.3-5.1-11.3-11.3l0-76.7z"]
};
const faSprayCanSparkles = {
  prefix: 'fas',
  iconName: 'spray-can-sparkles',
  icon: [512, 512, ["air-freshener"], "f5d0", "M96 32l0 96 128 0 0-96c0-17.7-14.3-32-32-32L128 0C110.3 0 96 14.3 96 32zm0 128c-53 0-96 43-96 96L0 464c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-208c0-53-43-96-96-96L96 160zm64 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM384 48c0-1.4-1-3-2.2-3.6L352 32 339.6 2.2C339 1 337.4 0 336 0s-3 1-3.6 2.2L320 32 290.2 44.4C289 45 288 46.6 288 48c0 1.4 1 3 2.2 3.6L320 64l12.4 29.8C333 95 334.6 96 336 96s3-1 3.6-2.2L352 64l29.8-12.4C383 51 384 49.4 384 48zm76.4 45.8C461 95 462.6 96 464 96s3-1 3.6-2.2L480 64l29.8-12.4C511 51 512 49.4 512 48c0-1.4-1-3-2.2-3.6L480 32 467.6 2.2C467 1 465.4 0 464 0s-3 1-3.6 2.2L448 32 418.2 44.4C417 45 416 46.6 416 48c0 1.4 1 3 2.2 3.6L448 64l12.4 29.8zm7.2 100.4c-.6-1.2-2.2-2.2-3.6-2.2s-3 1-3.6 2.2L448 224l-29.8 12.4c-1.2 .6-2.2 2.2-2.2 3.6c0 1.4 1 3 2.2 3.6L448 256l12.4 29.8c.6 1.2 2.2 2.2 3.6 2.2s3-1 3.6-2.2L480 256l29.8-12.4c1.2-.6 2.2-2.2 2.2-3.6c0-1.4-1-3-2.2-3.6L480 224l-12.4-29.8zM448 144c0-1.4-1-3-2.2-3.6L416 128 403.6 98.2C403 97 401.4 96 400 96s-3 1-3.6 2.2L384 128l-29.8 12.4c-1.2 .6-2.2 2.2-2.2 3.6c0 1.4 1 3 2.2 3.6L384 160l12.4 29.8c.6 1.2 2.2 2.2 3.6 2.2s3-1 3.6-2.2L416 160l29.8-12.4c1.2-.6 2.2-2.2 2.2-3.6z"]
};
const faAirFreshener = faSprayCanSparkles;
const faStar = {
  prefix: 'fas',
  iconName: 'star',
  icon: [576, 512, [11088, 61446], "f005", "M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"]
};
const faRepeat = {
  prefix: 'fas',
  iconName: 'repeat',
  icon: [512, 512, [128257], "f363", "M0 224c0 17.7 14.3 32 32 32s32-14.3 32-32c0-53 43-96 96-96l160 0 0 32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9S320 19.1 320 32l0 32L160 64C71.6 64 0 135.6 0 224zm512 64c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 53-43 96-96 96l-160 0 0-32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-32 160 0c88.4 0 160-71.6 160-160z"]
};
const faCross = {
  prefix: 'fas',
  iconName: 'cross',
  icon: [384, 512, [128327, 10013], "f654", "M176 0c-26.5 0-48 21.5-48 48l0 80-80 0c-26.5 0-48 21.5-48 48l0 32c0 26.5 21.5 48 48 48l80 0 0 208c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-208 80 0c26.5 0 48-21.5 48-48l0-32c0-26.5-21.5-48-48-48l-80 0 0-80c0-26.5-21.5-48-48-48L176 0z"]
};
const faBox = {
  prefix: 'fas',
  iconName: 'box',
  icon: [448, 512, [128230], "f466", "M50.7 58.5L0 160l208 0 0-128L93.7 32C75.5 32 58.9 42.3 50.7 58.5zM240 160l208 0L397.3 58.5C389.1 42.3 372.5 32 354.3 32L240 32l0 128zm208 32L0 192 0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-224z"]
};
const faVenusMars = {
  prefix: 'fas',
  iconName: 'venus-mars',
  icon: [640, 512, [9892], "f228", "M176 288a112 112 0 1 0 0-224 112 112 0 1 0 0 224zM352 176c0 86.3-62.1 158.1-144 173.1l0 34.9 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-34.9C62.1 334.1 0 262.3 0 176C0 78.8 78.8 0 176 0s176 78.8 176 176zM271.9 360.6c19.3-10.1 36.9-23.1 52.1-38.4c20 18.5 46.7 29.8 76.1 29.8c61.9 0 112-50.1 112-112s-50.1-112-112-112c-7.2 0-14.3 .7-21.1 2c-4.9-21.5-13-41.7-24-60.2C369.3 66 384.4 64 400 64c37 0 71.4 11.4 99.8 31l20.6-20.6L487 41c-6.9-6.9-8.9-17.2-5.2-26.2S494.3 0 504 0L616 0c13.3 0 24 10.7 24 24l0 112c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-33.4-33.4L545 140.2c19.5 28.4 31 62.7 31 99.8c0 97.2-78.8 176-176 176c-50.5 0-96-21.3-128.1-55.4z"]
};
const faArrowPointer = {
  prefix: 'fas',
  iconName: 'arrow-pointer',
  icon: [320, 512, ["mouse-pointer"], "f245", "M0 55.2L0 426c0 12.2 9.9 22 22 22c6.3 0 12.4-2.7 16.6-7.5L121.2 346l58.1 116.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9L179.8 320l118.1 0c12.2 0 22.1-9.9 22.1-22.1c0-6.3-2.7-12.3-7.4-16.5L38.6 37.9C34.3 34.1 28.9 32 23.2 32C10.4 32 0 42.4 0 55.2z"]
};
const faMousePointer = faArrowPointer;
const faMaximize = {
  prefix: 'fas',
  iconName: 'maximize',
  icon: [512, 512, ["expand-arrows-alt"], "f31e", "M200 32L56 32C42.7 32 32 42.7 32 56l0 144c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l40-40 79 79-79 79L73 295c-6.9-6.9-17.2-8.9-26.2-5.2S32 302.3 32 312l0 144c0 13.3 10.7 24 24 24l144 0c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-40-40 79-79 79 79-40 40c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l144 0c13.3 0 24-10.7 24-24l0-144c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2l-40 40-79-79 79-79 40 40c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-144c0-13.3-10.7-24-24-24L312 32c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l40 40-79 79-79-79 40-40c6.9-6.9 8.9-17.2 5.2-26.2S209.7 32 200 32z"]
};
const faExpandArrowsAlt = faMaximize;
const faChargingStation = {
  prefix: 'fas',
  iconName: 'charging-station',
  icon: [576, 512, [], "f5e7", "M96 0C60.7 0 32 28.7 32 64l0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-144 16 0c22.1 0 40 17.9 40 40l0 32c0 39.8 32.2 72 72 72s72-32.2 72-72l0-123.7c32.5-10.2 56-40.5 56-76.3l0-32c0-8.8-7.2-16-16-16l-16 0 0-48c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-32 0 0-48c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-16 0c-8.8 0-16 7.2-16 16l0 32c0 35.8 23.5 66.1 56 76.3L472 376c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32c0-48.6-39.4-88-88-88l-16 0 0-192c0-35.3-28.7-64-64-64L96 0zM216.9 82.7c6 4 8.5 11.5 6.3 18.3l-25 74.9 57.8 0c6.7 0 12.7 4.2 15 10.4s.5 13.3-4.6 17.7l-112 96c-5.5 4.7-13.4 5.1-19.3 1.1s-8.5-11.5-6.3-18.3l25-74.9L96 208c-6.7 0-12.7-4.2-15-10.4s-.5-13.3 4.6-17.7l112-96c5.5-4.7 13.4-5.1 19.3-1.1z"]
};
const faShapes = {
  prefix: 'fas',
  iconName: 'shapes',
  icon: [512, 512, ["triangle-circle-square"], "f61f", "M315.4 15.5C309.7 5.9 299.2 0 288 0s-21.7 5.9-27.4 15.5l-96 160c-5.9 9.9-6.1 22.2-.4 32.2s16.3 16.2 27.8 16.2l192 0c11.5 0 22.2-6.2 27.8-16.2s5.5-22.3-.4-32.2l-96-160zM288 312l0 144c0 22.1 17.9 40 40 40l144 0c22.1 0 40-17.9 40-40l0-144c0-22.1-17.9-40-40-40l-144 0c-22.1 0-40 17.9-40 40zM128 512a128 128 0 1 0 0-256 128 128 0 1 0 0 256z"]
};
const faTriangleCircleSquare = faShapes;
const faShuffle = {
  prefix: 'fas',
  iconName: 'shuffle',
  icon: [512, 512, [128256, "random"], "f074", "M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"]
};
const faRandom = faShuffle;
const faPersonRunning = {
  prefix: 'fas',
  iconName: 'person-running',
  icon: [448, 512, [127939, "running"], "f70c", "M320 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM125.7 175.5c9.9-9.9 23.4-15.5 37.5-15.5c1.9 0 3.8 .1 5.6 .3L137.6 254c-9.3 28 1.7 58.8 26.8 74.5l86.2 53.9-25.4 88.8c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l28.7-100.4c5.9-20.6-2.6-42.6-20.7-53.9L238 299l30.9-82.4 5.1 12.3C289 264.7 323.9 288 362.7 288l21.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-21.3 0c-12.9 0-24.6-7.8-29.5-19.7l-6.3-15c-14.6-35.1-44.1-61.9-80.5-73.1l-48.7-15c-11.1-3.4-22.7-5.2-34.4-5.2c-31 0-60.8 12.3-82.7 34.3L57.4 153.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l23.1-23.1zM91.2 352L32 352c-17.7 0-32 14.3-32 32s14.3 32 32 32l69.6 0c19 0 36.2-11.2 43.9-28.5L157 361.6l-9.5-6c-17.5-10.9-30.5-26.8-37.9-44.9L91.2 352z"]
};
const faRunning = faPersonRunning;
const faMobileRetro = {
  prefix: 'fas',
  iconName: 'mobile-retro',
  icon: [320, 512, [], "e527", "M0 64C0 28.7 28.7 0 64 0L256 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm64 96l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L96 128c-17.7 0-32 14.3-32 32zM80 352a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm56-56a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm56-56a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM128 48c-8.8 0-16 7.2-16 16s7.2 16 16 16l64 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0z"]
};
const faGripLinesVertical = {
  prefix: 'fas',
  iconName: 'grip-lines-vertical',
  icon: [192, 512, [], "f7a5", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32L64 64zm128 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384z"]
};
const faSpider = {
  prefix: 'fas',
  iconName: 'spider',
  icon: [512, 512, [128375], "f717", "M158.4 32.6c4.8-12.4-1.4-26.3-13.8-31s-26.3 1.4-31 13.8L81.1 100c-7.9 20.7-3 44.1 12.7 59.7l57.4 57.4L70.8 190.3c-2.4-.8-4.3-2.7-5.1-5.1L46.8 128.4C42.6 115.8 29 109 16.4 113.2S-3 131 1.2 143.6l18.9 56.8c5.6 16.7 18.7 29.8 35.4 35.4L116.1 256 55.6 276.2c-16.7 5.6-29.8 18.7-35.4 35.4L1.2 368.4C-3 381 3.8 394.6 16.4 398.8s26.2-2.6 30.4-15.2l18.9-56.8c.8-2.4 2.7-4.3 5.1-5.1l80.4-26.8L93.7 352.3C78.1 368 73.1 391.4 81.1 412l32.5 84.6c4.8 12.4 18.6 18.5 31 13.8s18.5-18.6 13.8-31l-32.5-84.6c-1.1-3-.4-6.3 1.8-8.5L160 353.9c1 52.1 43.6 94.1 96 94.1s95-41.9 96-94.1l32.3 32.3c2.2 2.2 2.9 5.6 1.8 8.5l-32.5 84.6c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8L430.9 412c7.9-20.7 3-44.1-12.7-59.7l-57.4-57.4 80.4 26.8c2.4 .8 4.3 2.7 5.1 5.1l18.9 56.8c4.2 12.6 17.8 19.4 30.4 15.2s19.4-17.8 15.2-30.4l-18.9-56.8c-5.6-16.7-18.7-29.8-35.4-35.4L395.9 256l60.5-20.2c16.7-5.6 29.8-18.7 35.4-35.4l18.9-56.8c4.2-12.6-2.6-26.2-15.2-30.4s-26.2 2.6-30.4 15.2l-18.9 56.8c-.8 2.4-2.7 4.3-5.1 5.1l-80.4 26.8 57.4-57.4c15.6-15.6 20.6-39 12.7-59.7L398.4 15.4C393.6 3 379.8-3.2 367.4 1.6s-18.5 18.6-13.8 31l32.5 84.6c1.1 3 .4 6.3-1.8 8.5L336 174.1l0-14.1c0-31.8-18.6-59.3-45.5-72.2c-9.1-4.4-18.5 3.3-18.5 13.4l0 10.8c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-10.8c0-10.1-9.4-17.7-18.5-13.4C194.6 100.7 176 128.2 176 160l0 14.1-48.3-48.3c-2.2-2.2-2.9-5.6-1.8-8.5l32.5-84.6z"]
};
const faHandsBound = {
  prefix: 'fas',
  iconName: 'hands-bound',
  icon: [640, 512, [], "e4f9", "M96 32C96 14.3 81.7 0 64 0S32 14.3 32 32l0 64 0 59.1 0 .7L32 192l0 21.9c0 14.2 5.1 27.9 14.3 38.7L131.6 352l-3.6 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 128 0 64 0 128 0 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-3.6 0 85.3-99.5c9.2-10.8 14.3-24.5 14.3-38.7l0-21.9 0-36.2 0-.7L608 96l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64 0 48.8-69.3 92.4c-5.7 7.6-16.1 9.6-24.2 4.8c-9.7-5.7-12.1-18.7-5.1-27.5L473 180c10.8-13.5 8.9-33.3-4.4-44.5s-33-9.8-44.5 3.2l-46.7 52.5C361 209.7 352 233.4 352 258.1l0 61.9 0 32-64 0 0-32 0-61.9c0-24.6-9-48.4-25.4-66.8l-46.7-52.5c-11.5-13-31.3-14.4-44.5-3.2s-15.2 30.9-4.4 44.5l27.6 34.5c7 8.8 4.7 21.8-5.1 27.5c-8.1 4.8-18.6 2.7-24.2-4.8L96 144.8 96 96l0-64zm64 448l0 32 128 0 0-32 64 0 0 32 128 0 0-32 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0-128 0-64 0-128 0-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0z"]
};
const faFileInvoiceDollar = {
  prefix: 'fas',
  iconName: 'file-invoice-dollar',
  icon: [384, 512, [], "f571", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM64 80c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 96c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16zm128 72c8.8 0 16 7.2 16 16l0 17.3c8.5 1.2 16.7 3.1 24.1 5.1c8.5 2.3 13.6 11 11.3 19.6s-11 13.6-19.6 11.3c-11.1-3-22-5.2-32.1-5.3c-8.4-.1-17.4 1.8-23.6 5.5c-5.7 3.4-8.1 7.3-8.1 12.8c0 3.7 1.3 6.5 7.3 10.1c6.9 4.1 16.6 7.1 29.2 10.9l.5 .1s0 0 0 0s0 0 0 0c11.3 3.4 25.3 7.6 36.3 14.6c12.1 7.6 22.4 19.7 22.7 38.2c.3 19.3-9.6 33.3-22.9 41.6c-7.7 4.8-16.4 7.6-25.1 9.1l0 17.1c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-17.8c-11.2-2.1-21.7-5.7-30.9-8.9c0 0 0 0 0 0c-2.1-.7-4.2-1.4-6.2-2.1c-8.4-2.8-12.9-11.9-10.1-20.2s11.9-12.9 20.2-10.1c2.5 .8 4.8 1.6 7.1 2.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c13.6 4.6 24.6 8.4 36.3 8.7c9.1 .3 17.9-1.7 23.7-5.3c5.1-3.2 7.9-7.3 7.8-14c-.1-4.6-1.8-7.8-7.7-11.6c-6.8-4.3-16.5-7.4-29-11.2l-1.6-.5s0 0 0 0c-11-3.3-24.3-7.3-34.8-13.7c-12-7.2-22.6-18.9-22.7-37.3c-.1-19.4 10.8-32.8 23.8-40.5c7.5-4.4 15.8-7.2 24.1-8.7l0-17.3c0-8.8 7.2-16 16-16z"]
};
const faPlaneCircleExclamation = {
  prefix: 'fas',
  iconName: 'plane-circle-exclamation',
  icon: [640, 512, [], "e556", "M256 0c-35 0-64 59.5-64 93.7l0 84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9l0 65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8l0 42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3l0-84.6C320 59.5 292 0 256 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faXRay = {
  prefix: 'fas',
  iconName: 'x-ray',
  icon: [512, 512, [], "f497", "M0 64C0 46.3 14.3 32 32 32l448 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 320c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32L32 96C14.3 96 0 81.7 0 64zM256 96c-8.8 0-16 7.2-16 16l0 32-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 48-112 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l112 0 0 70.6L189.1 307c-5.2-2-10.6-3-16.2-3l-2.1 0c-23.6 0-42.8 19.2-42.8 42.8c0 9.6 3.2 18.9 9.1 26.4l18.2 23.2c9.7 12.4 24.6 19.6 40.3 19.6l120.8 0c15.7 0 30.6-7.2 40.3-19.6l18.2-23.2c5.9-7.5 9.1-16.8 9.1-26.4c0-23.6-19.2-42.8-42.8-42.8l-2.2 0c-5.5 0-11 1-16.2 3L272 326.6l0-70.6 112 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-112 0 0-48 80 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-80 0 0-32c0-8.8-7.2-16-16-16zM208 352a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm80 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faSpellCheck = {
  prefix: 'fas',
  iconName: 'spell-check',
  icon: [576, 512, [], "f891", "M112 0C99.1 0 87.4 7.8 82.5 19.7l-66.7 160-13.3 32c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L66.7 224l90.7 0 5.1 12.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8l-13.3-32-66.7-160C136.6 7.8 124.9 0 112 0zm18.7 160l-37.3 0L112 115.2 130.7 160zM256 32l0 96 0 96c0 17.7 14.3 32 32 32l80 0c44.2 0 80-35.8 80-80c0-23.1-9.8-43.8-25.4-58.4c6-11.2 9.4-24 9.4-37.6c0-44.2-35.8-80-80-80L288 0c-17.7 0-32 14.3-32 32zm96 64l-32 0 0-32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16zm-32 64l32 0 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0 0-32zM566.6 310.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L352 434.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l192-192z"]
};
const faSlash = {
  prefix: 'fas',
  iconName: 'slash',
  icon: [640, 512, [], "f715", "M5.1 9.2C13.3-1.2 28.4-3.1 38.8 5.1l592 464c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2z"]
};
const faComputerMouse = {
  prefix: 'fas',
  iconName: 'computer-mouse',
  icon: [384, 512, [128433, "mouse"], "f8cc", "M0 192l176 0L176 0 160 0C71.6 0 0 71.6 0 160l0 32zm0 32L0 352c0 88.4 71.6 160 160 160l64 0c88.4 0 160-71.6 160-160l0-128-192 0L0 224zm384-32l0-32C384 71.6 312.4 0 224 0L208 0l0 192 176 0z"]
};
const faMouse = faComputerMouse;
const faArrowRightToBracket = {
  prefix: 'fas',
  iconName: 'arrow-right-to-bracket',
  icon: [512, 512, ["sign-in"], "f090", "M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]
};
const faSignIn = faArrowRightToBracket;
const faShopSlash = {
  prefix: 'fas',
  iconName: 'shop-slash',
  icon: [640, 512, ["store-alt-slash"], "e070", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-54.8-43L576 224l-64 0 0 152L384 275.7l0-51.7-64 0 0 1.5L277.2 192l325.9 0c20.3 0 36.8-16.5 36.8-36.8c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0L121.7 0c-16 0-31 8-39.9 21.4L74.1 32.8 38.8 5.1zM36.8 192l85 0L21 112.5 6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM320 384l-192 0 0-160-64 0 0 160 0 80c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-65.5-64-50.4 0 35.9z"]
};
const faStoreAltSlash = faShopSlash;
const faServer = {
  prefix: 'fas',
  iconName: 'server',
  icon: [512, 512, [], "f233", "M64 32C28.7 32 0 60.7 0 96l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 32zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm48 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 288zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm56 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faVirusCovidSlash = {
  prefix: 'fas',
  iconName: 'virus-covid-slash',
  icon: [640, 512, [], "e4a9", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c11.4-19.5 19.1-41.4 22.3-64.7l33.6 0 0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-80c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16-33.6 0c-4.2-30.7-16.3-58.8-34.1-82.3L484 125.9l11.3 11.3c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L472.7 46.7c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9L450.1 92l-23.8 23.8C402.8 97.9 374.7 85.8 344 81.6L344 48l16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L280 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0 0 33.6c-30.7 4.2-58.8 16.3-82.3 34.1L189.9 92l11.3-11.3c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L134.1 79.8 38.8 5.1zM149.2 213.5c-1.5 6-2.7 12.2-3.5 18.5L112 232l0-16c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16 33.6 0c4.2 30.7 16.3 58.8 34.1 82.3L156 386.1l-11.3-11.3c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l56.6 56.6c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L189.9 420l23.8-23.8c23.5 17.9 51.7 29.9 82.3 34.1l0 33.6-16 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0-33.6c20.4-2.8 39.7-9.1 57.3-18.2L149.2 213.5z"]
};
const faShopLock = {
  prefix: 'fas',
  iconName: 'shop-lock',
  icon: [640, 512, [], "e4a5", "M36.8 192l412.8 0c20.2-19.8 47.9-32 78.4-32c30.5 0 58.1 12.2 78.3 31.9c18.9-1.6 33.7-17.4 33.7-36.7c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0L121.7 0c-16 0-31 8-39.9 21.4L6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM384 224l-64 0 0 160-192 0 0-160-64 0 0 160 0 80c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-80 0-32 0-128zm144 16c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faHourglassStart = {
  prefix: 'fas',
  iconName: 'hourglass-start',
  icon: [384, 512, ["hourglass-1"], "f251", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1L146.7 256 78.9 323.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 256 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1L237.3 256l67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32s-14.3-32-32-32L320 0 64 0 32 0zM288 437l0 11L96 448l0-11c0-25.5 10.1-49.9 28.1-67.9L192 301.3l67.9 67.9c18 18 28.1 42.4 28.1 67.9z"]
};
const faHourglass1 = faHourglassStart;
const faBlenderPhone = {
  prefix: 'fas',
  iconName: 'blender-phone',
  icon: [576, 512, [], "f6b6", "M224 352L196.8 52.3C194.2 24.2 216.3 0 244.6 0L534.1 0c21.1 0 36.4 20.1 30.9 40.4L558.5 64 400 64c-8.8 0-16 7.2-16 16s7.2 16 16 16l149.8 0-17.5 64L400 160c-8.8 0-16 7.2-16 16s7.2 16 16 16l123.6 0-17.5 64L400 256c-8.8 0-16 7.2-16 16s7.2 16 16 16l97.5 0L480 352l-256 0zm-16 32l288 0c26.5 0 48 21.5 48 48l0 32c0 26.5-21.5 48-48 48l-288 0c-26.5 0-48-21.5-48-48l0-32c0-26.5 21.5-48 48-48zm144 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM147.5 30.7c10.8 6.7 15.3 21 10.6 33.4l-22 57.8c-4.2 10.9-14.5 17.6-25.3 16.4l-33.3-3.6c-13.6 42.2-13.6 88.4 0 130.7l33.3-3.6c10.9-1.2 21.2 5.5 25.3 16.4l22 57.8c4.7 12.4 .2 26.7-10.6 33.4l-44 27.2c-9.7 6-21.9 4.2-29.8-4.3C-24.6 286-24.6 114 73.7 7.8C81.6-.7 93.8-2.5 103.5 3.5l44 27.2z"]
};
const faBuildingWheat = {
  prefix: 'fas',
  iconName: 'building-wheat',
  icon: [640, 512, [], "e4db", "M0 48C0 21.5 21.5 0 48 0L336 0c26.5 0 48 21.5 48 48l0 416c0 26.5-21.5 48-48 48l-96 0 0-80c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 80-96 0c-26.5 0-48-21.5-48-48L0 48zM80 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm112-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L80 96c-8.8 0-16 7.2-16 16zM176 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm384 80l0 16c0 44.2-35.8 80-80 80l-16 0 0-16c0-44.2 35.8-80 80-80l16 0zm0 128c0 44.2-35.8 80-80 80l-16 0 0-16c0-44.2 35.8-80 80-80l16 0 0 16zm0 112c0 44.2-35.8 80-80 80l-16 0 0-16c0-44.2 35.8-80 80-80l16 0 0 16zM512 496l0 16-16 0c-44.2 0-80-35.8-80-80l0-16 16 0c44.2 0 80 35.8 80 80zm0-96l-16 0c-44.2 0-80-35.8-80-80l0-16 16 0c44.2 0 80 35.8 80 80l0 16zm0-128l0 16-16 0c-44.2 0-80-35.8-80-80l0-16 16 0c44.2 0 80 35.8 80 80zM528 32c13.3 0 24 10.7 24 24l0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-104c0-13.3 10.7-24 24-24zm96 64l0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32c0-13.3 10.7-24 24-24s24 10.7 24 24zM456 72c13.3 0 24 10.7 24 24l0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32c0-13.3 10.7-24 24-24z"]
};
const faPersonBreastfeeding = {
  prefix: 'fas',
  iconName: 'person-breastfeeding',
  icon: [448, 512, [], "e53a", "M224 0a80 80 0 1 1 0 160A80 80 0 1 1 224 0zM436.8 382.8L373.5 462c-16.6 20.7-46.8 24.1-67.5 7.5c-17.6-14.1-22.7-38.1-13.5-57.7l-.8-.1c-38.9-5.6-74.3-25.1-99.7-54.8l0-36.8c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c0 .8 0 1.6 .1 2.4l101.4 50.7c23.7 11.9 33.3 40.7 21.5 64.4s-40.7 33.3-64.4 21.5L27.2 427.3c-1.1-.5-2.2-1.1-3.3-1.7c-4.9-2.8-9.2-6.4-12.6-10.6c-4.6-5.4-7.8-11.7-9.6-18.4c-3.3-12-1.9-25.2 4.8-36.6c.6-1.1 1.3-2.2 2-3.2L75.6 256.1c26.7-40.1 71.7-64.1 119.8-64.1l75.2 0c46.5 0 90.1 22.5 117.2 60.3l50.7 70.9c2.2 3 4 6.1 5.5 9.4c2.9 6.7 4.3 13.8 4 20.8c-.3 10.6-4.2 21-11.2 29.4zM320 332a44 44 0 1 0 -88 0 44 44 0 1 0 88 0z"]
};
const faRightToBracket = {
  prefix: 'fas',
  iconName: 'right-to-bracket',
  icon: [512, 512, ["sign-in-alt"], "f2f6", "M217.9 105.9L340.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L217.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1L32 320c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM352 416l64 0c17.7 0 32-14.3 32-32l0-256c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c53 0 96 43 96 96l0 256c0 53-43 96-96 96l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faSignInAlt = faRightToBracket;
const faVenus = {
  prefix: 'fas',
  iconName: 'venus',
  icon: [384, 512, [9792], "f221", "M80 176a112 112 0 1 1 224 0A112 112 0 1 1 80 176zM224 349.1c81.9-15 144-86.8 144-173.1C368 78.8 289.2 0 192 0S16 78.8 16 176c0 86.3 62.1 158.1 144 173.1l0 34.9-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-34.9z"]
};
const faPassport = {
  prefix: 'fas',
  iconName: 'passport',
  icon: [448, 512, [], "f5ab", "M0 64C0 28.7 28.7 0 64 0L384 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM183 278.8c-27.9-13.2-48.4-39.4-53.7-70.8l39.1 0c1.6 30.4 7.7 53.8 14.6 70.8zm41.3 9.2l-.3 0-.3 0c-2.4-3.5-5.7-8.9-9.1-16.5c-6-13.6-12.4-34.3-14.2-63.5l47.1 0c-1.8 29.2-8.1 49.9-14.2 63.5c-3.4 7.6-6.7 13-9.1 16.5zm40.7-9.2c6.8-17.1 12.9-40.4 14.6-70.8l39.1 0c-5.3 31.4-25.8 57.6-53.7 70.8zM279.6 176c-1.6-30.4-7.7-53.8-14.6-70.8c27.9 13.2 48.4 39.4 53.7 70.8l-39.1 0zM223.7 96l.3 0 .3 0c2.4 3.5 5.7 8.9 9.1 16.5c6 13.6 12.4 34.3 14.2 63.5l-47.1 0c1.8-29.2 8.1-49.9 14.2-63.5c3.4-7.6 6.7-13 9.1-16.5zM183 105.2c-6.8 17.1-12.9 40.4-14.6 70.8l-39.1 0c5.3-31.4 25.8-57.6 53.7-70.8zM352 192A128 128 0 1 0 96 192a128 128 0 1 0 256 0zM112 384c-8.8 0-16 7.2-16 16s7.2 16 16 16l224 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-224 0z"]
};
const faThumbtackSlash = {
  prefix: 'fas',
  iconName: 'thumbtack-slash',
  icon: [640, 512, ["thumb-tack-slash"], "e68f", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L481.4 352c9.8-.4 18.9-5.3 24.6-13.3c6-8.3 7.7-19.1 4.4-28.8l-1-3c-13.8-41.5-42.8-74.8-79.5-94.7L418.5 64 448 64c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l29.5 0-6.1 79.5L38.8 5.1zM324.9 352L177.1 235.6c-20.9 18.9-37.2 43.3-46.5 71.3l-1 3c-3.3 9.8-1.6 20.5 4.4 28.8s15.7 13.3 26 13.3l164.9 0zM288 384l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96-64 0z"]
};
const faThumbTackSlash = faThumbtackSlash;
const faHeartPulse = {
  prefix: 'fas',
  iconName: 'heart-pulse',
  icon: [512, 512, ["heartbeat"], "f21e", "M228.3 469.1L47.6 300.4c-4.2-3.9-8.2-8.1-11.9-12.4l87 0c22.6 0 43-13.6 51.7-34.5l10.5-25.2 49.3 109.5c3.8 8.5 12.1 14 21.4 14.1s17.8-5 22-13.3L320 253.7l1.7 3.4c9.5 19 28.9 31 50.1 31l104.5 0c-3.7 4.3-7.7 8.5-11.9 12.4L283.7 469.1c-7.5 7-17.4 10.9-27.7 10.9s-20.2-3.9-27.7-10.9zM503.7 240l-132 0c-3 0-5.8-1.7-7.2-4.4l-23.2-46.3c-4.1-8.1-12.4-13.3-21.5-13.3s-17.4 5.1-21.5 13.3l-41.4 82.8L205.9 158.2c-3.9-8.7-12.7-14.3-22.2-14.1s-18.1 5.9-21.8 14.8l-31.8 76.3c-1.2 3-4.2 4.9-7.4 4.9L16 240c-2.6 0-5 .4-7.3 1.1C3 225.2 0 208.2 0 190.9l0-5.8c0-69.9 50.5-129.5 119.4-141C165 36.5 211.4 51.4 244 84l12 12 12-12c32.6-32.6 79-47.5 124.6-39.9C461.5 55.6 512 115.2 512 185.1l0 5.8c0 16.9-2.8 33.5-8.3 49.1z"]
};
const faHeartbeat = faHeartPulse;
const faPeopleCarryBox = {
  prefix: 'fas',
  iconName: 'people-carry-box',
  icon: [640, 512, ["people-carry"], "f4ce", "M80 48a48 48 0 1 1 96 0A48 48 0 1 1 80 48zm64 193.7l0 65.1 51 51c7.1 7.1 11.8 16.2 13.4 26.1l15.2 90.9c2.9 17.4-8.9 33.9-26.3 36.8s-33.9-8.9-36.8-26.3l-14.3-85.9L66.8 320C54.8 308 48 291.7 48 274.7l0-88.1c0-32.4 26.2-58.6 58.6-58.6c24.1 0 46.5 12 59.9 32l47.4 71.1 10.1 5 0-76.2c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32l0 76.2 10.1-5L473.5 160c13.3-20 35.8-32 59.9-32c32.4 0 58.6 26.2 58.6 58.6l0 88.1c0 17-6.7 33.3-18.7 45.3l-79.4 79.4-14.3 85.9c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l15.2-90.9c1.6-9.9 6.3-19 13.4-26.1l51-51 0-65.1-19 28.5c-4.6 7-11 12.6-18.5 16.3l-59.6 29.8c-2.4 1.3-4.9 2.2-7.6 2.8c-2.6 .6-5.3 .9-7.9 .8l-126.7 0c-2.5 .1-5-.2-7.5-.7c-2.9-.6-5.6-1.6-8.1-3l-59.5-29.8c-7.5-3.7-13.8-9.4-18.5-16.3l-19-28.5zM2.3 468.1L50.1 348.6l49.2 49.2-37.6 94c-6.6 16.4-25.2 24.4-41.6 17.8S-4.3 484.5 2.3 468.1zM512 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm77.9 348.6l47.8 119.5c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8l-37.6-94 49.2-49.2z"]
};
const faPeopleCarry = faPeopleCarryBox;
const faTemperatureHigh = {
  prefix: 'fas',
  iconName: 'temperature-high',
  icon: [512, 512, [], "f769", "M416 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 128A96 96 0 1 0 416 0a96 96 0 1 0 0 192zM96 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 164.5c0 17.3 7.1 31.9 15.3 42.5C217.8 332.6 224 349.5 224 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9C88.9 308.4 96 293.8 96 276.5L96 112zM144 0C82.1 0 32 50.2 32 112l0 164.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C11.2 304.2 0 334.8 0 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6L256 112C256 50.2 205.9 0 144 0zm0 416c26.5 0 48-21.5 48-48c0-20.9-13.4-38.7-32-45.3L160 112c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 210.7c-18.6 6.6-32 24.4-32 45.3c0 26.5 21.5 48 48 48z"]
};
const faMicrochip = {
  prefix: 'fas',
  iconName: 'microchip',
  icon: [512, 512, [], "f2db", "M176 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c-35.3 0-64 28.7-64 64l-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0 0 56-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0 0 56-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0c0 35.3 28.7 64 64 64l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40 56 0 0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40 56 0 0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c35.3 0 64-28.7 64-64l40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0 0-56 40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0 0-56 40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0c0-35.3-28.7-64-64-64l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40-56 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40-56 0 0-40zM160 128l192 0c17.7 0 32 14.3 32 32l0 192c0 17.7-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32l0-192c0-17.7 14.3-32 32-32zm192 32l-192 0 0 192 192 0 0-192z"]
};
const faCrown = {
  prefix: 'fas',
  iconName: 'crown',
  icon: [576, 512, [128081], "f521", "M309 106c11.4-7 19-19.7 19-34c0-22.1-17.9-40-40-40s-40 17.9-40 40c0 14.4 7.6 27 19 34L209.7 220.6c-9.1 18.2-32.7 23.4-48.6 10.7L72 160c5-6.7 8-15 8-24c0-22.1-17.9-40-40-40S0 113.9 0 136s17.9 40 40 40c.2 0 .5 0 .7 0L86.4 427.4c5.5 30.4 32 52.6 63 52.6l277.2 0c30.9 0 57.4-22.1 63-52.6L535.3 176c.2 0 .5 0 .7 0c22.1 0 40-17.9 40-40s-17.9-40-40-40s-40 17.9-40 40c0 9 3 17.3 8 24l-89.1 71.3c-15.9 12.7-39.5 7.5-48.6-10.7L309 106z"]
};
const faWeightHanging = {
  prefix: 'fas',
  iconName: 'weight-hanging',
  icon: [512, 512, [], "f5cd", "M224 96a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm122.5 32c3.5-10 5.5-20.8 5.5-32c0-53-43-96-96-96s-96 43-96 96c0 11.2 1.9 22 5.5 32L120 128c-22 0-41.2 15-46.6 36.4l-72 288c-3.6 14.3-.4 29.5 8.7 41.2S33.2 512 48 512l416 0c14.8 0 28.7-6.8 37.8-18.5s12.3-26.8 8.7-41.2l-72-288C433.2 143 414 128 392 128l-45.5 0z"]
};
const faXmarksLines = {
  prefix: 'fas',
  iconName: 'xmarks-lines',
  icon: [640, 512, [], "e59a", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zm0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416zM7 167c-9.4 9.4-9.4 24.6 0 33.9l55 55L7 311c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55L41 167c-9.4-9.4-24.6-9.4-33.9 0zM265 167c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55zM455 167c-9.4 9.4-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55c-9.4-9.4-24.6-9.4-33.9 0z"]
};
const faFilePrescription = {
  prefix: 'fas',
  iconName: 'file-prescription',
  icon: [384, 512, [], "f572", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM104 196l72 0c33.1 0 60 26.9 60 60c0 25.5-15.9 47.2-38.3 55.9l43 40.3 33.8-31c8.1-7.5 20.8-6.9 28.3 1.2s6.9 20.8-1.2 28.3L270 379.7l31.7 29.7c8.1 7.6 8.5 20.2 .9 28.3s-20.2 8.5-28.3 .9l-33.9-31.8-34.9 32c-8.1 7.5-20.8 6.9-28.3-1.2s-6.9-20.8 1.2-28.3l32.6-29.9-64.8-60.8c-.9-.8-1.6-1.7-2.3-2.6l-20 0 0 44c0 11-9 20-20 20s-20-9-20-20l0-64 0-80c0-11 9-20 20-20zm72 80c11 0 20-9 20-20s-9-20-20-20l-52 0 0 40 52 0z"]
};
const faWeightScale = {
  prefix: 'fas',
  iconName: 'weight-scale',
  icon: [512, 512, ["weight"], "f496", "M128 176a128 128 0 1 1 256 0 128 128 0 1 1 -256 0zM391.8 64C359.5 24.9 310.7 0 256 0S152.5 24.9 120.2 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-56.2 0zM296 224c0-10.6-4.1-20.2-10.9-27.4l33.6-78.3c3.5-8.1-.3-17.5-8.4-21s-17.5 .3-21 8.4L255.7 184c-22 .1-39.7 18-39.7 40c0 22.1 17.9 40 40 40s40-17.9 40-40z"]
};
const faWeight = faWeightScale;
const faUserGroup = {
  prefix: 'fas',
  iconName: 'user-group',
  icon: [640, 512, [128101, "user-friends"], "f500", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM609.3 512l-137.8 0c5.4-9.4 8.6-20.3 8.6-32l0-8c0-60.7-27.1-115.2-69.8-151.8c2.4-.1 4.7-.2 7.1-.2l61.4 0C567.8 320 640 392.2 640 481.3c0 17-13.8 30.7-30.7 30.7zM432 256c-31 0-59-12.6-79.3-32.9C372.4 196.5 384 163.6 384 128c0-26.8-6.6-52.1-18.3-74.3C384.3 40.1 407.2 32 432 32c61.9 0 112 50.1 112 112s-50.1 112-112 112z"]
};
const faUserFriends = faUserGroup;
const faArrowUpAZ = {
  prefix: 'fas',
  iconName: 'arrow-up-a-z',
  icon: [576, 512, ["sort-alpha-up"], "f15e", "M183.6 42.4C177.5 35.8 169 32 160 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L128 146.3 128 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 320c0 17.7 14.3 32 32 32l50.7 0-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-50.7 0 73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-128 0c-17.7 0-32 14.3-32 32zM416 32c-12.1 0-23.2 6.8-28.6 17.7l-64 128-16 32c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3 88.4 0 7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9l-16-32-64-128C439.2 38.8 428.1 32 416 32zM395.8 176L416 135.6 436.2 176l-40.4 0z"]
};
const faSortAlphaUp = faArrowUpAZ;
const faChessKnight = {
  prefix: 'fas',
  iconName: 'chess-knight',
  icon: [448, 512, [9822], "f441", "M96 48L82.7 61.3C70.7 73.3 64 89.5 64 106.5l0 132.4c0 10.7 5.3 20.7 14.2 26.6l10.6 7c14.3 9.6 32.7 10.7 48.1 3l3.2-1.6c2.6-1.3 5-2.8 7.3-4.5l49.4-37c6.6-5 15.7-5 22.3 0c10.2 7.7 9.9 23.1-.7 30.3L90.4 350C73.9 361.3 64 380 64 400l320 0 28.9-159c2.1-11.3 3.1-22.8 3.1-34.3l0-14.7C416 86 330 0 224 0L83.8 0C72.9 0 64 8.9 64 19.8c0 7.5 4.2 14.3 10.9 17.7L96 48zm24 68a20 20 0 1 1 40 0 20 20 0 1 1 -40 0zM22.6 473.4c-4.2 4.2-6.6 10-6.6 16C16 501.9 26.1 512 38.6 512l370.7 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L384 432 64 432 22.6 473.4z"]
};
const faFaceLaughSquint = {
  prefix: 'fas',
  iconName: 'face-laugh-squint',
  icon: [512, 512, ["laugh-squint"], "f59b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1l275.2 0c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zm36.7-199.4l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 125.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
};
const faLaughSquint = faFaceLaughSquint;
const faWheelchair = {
  prefix: 'fas',
  iconName: 'wheelchair',
  icon: [512, 512, [], "f193", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM120.5 247.2c12.4-4.7 18.7-18.5 14-30.9s-18.5-18.7-30.9-14C43.1 225.1 0 283.5 0 352c0 88.4 71.6 160 160 160c61.2 0 114.3-34.3 141.2-84.7c6.2-11.7 1.8-26.2-9.9-32.5s-26.2-1.8-32.5 9.9C240 440 202.8 464 160 464C98.1 464 48 413.9 48 352c0-47.9 30.1-88.8 72.5-104.8zM259.8 176l-1.9-9.7c-4.5-22.3-24-38.3-46.8-38.3c-30.1 0-52.7 27.5-46.8 57l23.1 115.5c6 29.9 32.2 51.4 62.8 51.4l5.1 0c.4 0 .8 0 1.3 0l94.1 0c6.7 0 12.6 4.1 15 10.4L402 459.2c6 16.1 23.8 24.6 40.1 19.1l48-16c16.8-5.6 25.8-23.7 20.2-40.5s-23.7-25.8-40.5-20.2l-18.7 6.2-25.5-68c-11.7-31.2-41.6-51.9-74.9-51.9l-68.5 0-9.6-48 63.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-76.2 0z"]
};
const faCircleArrowUp = {
  prefix: 'fas',
  iconName: 'circle-arrow-up',
  icon: [512, 512, ["arrow-circle-up"], "f0aa", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM385 215c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-71-71L280 392c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-214.1-71 71c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 103c9.4-9.4 24.6-9.4 33.9 0L385 215z"]
};
const faArrowCircleUp = faCircleArrowUp;
const faToggleOn = {
  prefix: 'fas',
  iconName: 'toggle-on',
  icon: [576, 512, [], "f205", "M192 64C86 64 0 150 0 256S86 448 192 448l192 0c106 0 192-86 192-192s-86-192-192-192L192 64zm192 96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faPersonWalking = {
  prefix: 'fas',
  iconName: 'person-walking',
  icon: [320, 512, [128694, "walking"], "f554", "M160 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM126.5 199.3c-1 .4-1.9 .8-2.9 1.2l-8 3.5c-16.4 7.3-29 21.2-34.7 38.2l-2.6 7.8c-5.6 16.8-23.7 25.8-40.5 20.2s-25.8-23.7-20.2-40.5l2.6-7.8c11.4-34.1 36.6-61.9 69.4-76.5l8-3.5c20.8-9.2 43.3-14 66.1-14c44.6 0 84.8 26.8 101.9 67.9L281 232.7l21.4 10.7c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3L247 287.3c-10.3-5.2-18.4-13.8-22.8-24.5l-9.6-23-19.3 65.5 49.5 54c5.4 5.9 9.2 13 11.2 20.8l23 92.1c4.3 17.1-6.1 34.5-23.3 38.8s-34.5-6.1-38.8-23.3l-22-88.1-70.7-77.1c-14.8-16.1-20.3-38.6-14.7-59.7l16.9-63.5zM68.7 398l25-62.4c2.1 3 4.5 5.8 7 8.6l40.7 44.4-14.5 36.2c-2.4 6-6 11.5-10.6 16.1L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L68.7 398z"]
};
const faWalking = faPersonWalking;
const faL = {
  prefix: 'fas',
  iconName: 'l',
  icon: [320, 512, [108], "4c", "M64 32c17.7 0 32 14.3 32 32l0 352 192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 480c-17.7 0-32-14.3-32-32L32 64c0-17.7 14.3-32 32-32z"]
};
const faFire = {
  prefix: 'fas',
  iconName: 'fire',
  icon: [448, 512, [128293], "f06d", "M159.3 5.4c7.8-7.3 19.9-7.2 27.7 .1c27.6 25.9 53.5 53.8 77.7 84c11-14.4 23.5-30.1 37-42.9c7.9-7.4 20.1-7.4 28 .1c34.6 33 63.9 76.6 84.5 118c20.3 40.8 33.8 82.5 33.8 111.9C448 404.2 348.2 512 224 512C98.4 512 0 404.1 0 276.5c0-38.4 17.8-85.3 45.4-131.7C73.3 97.7 112.7 48.6 159.3 5.4zM225.7 416c25.3 0 47.7-7 68.8-21c42.1-29.4 53.4-88.2 28.1-134.4c-4.5-9-16-9.6-22.5-2l-25.2 29.3c-6.6 7.6-18.5 7.4-24.7-.5c-16.5-21-46-58.5-62.8-79.8c-6.3-8-18.3-8.1-24.7-.1c-33.8 42.5-50.8 69.3-50.8 99.4C112 375.4 162.6 416 225.7 416z"]
};
const faBedPulse = {
  prefix: 'fas',
  iconName: 'bed-pulse',
  icon: [640, 512, ["procedures"], "f487", "M483.2 9.6L524 64l92 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-104 0c-7.6 0-14.7-3.6-19.2-9.6L468.7 70.3l-47 99.9c-3.7 7.8-11.3 13.1-19.9 13.7s-16.9-3.4-21.7-10.6L339.2 112 216 112c-13.3 0-24-10.7-24-24s10.7-24 24-24l136 0c8 0 15.5 4 20 10.7l24.4 36.6 45.9-97.5C445.9 6.2 453.2 1 461.6 .1s16.6 2.7 21.6 9.5zM320 160l12.7 0 20.7 31.1c11.2 16.8 30.6 26.3 50.7 24.8s37.9-13.7 46.5-32L461.9 160l82.1 0c53 0 96 43 96 96l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-224 0-32 0L64 448l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 96C0 78.3 14.3 64 32 64s32 14.3 32 32l0 256 224 0 0-160c0-17.7 14.3-32 32-32zm-144 0a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faProcedures = faBedPulse;
const faShuttleSpace = {
  prefix: 'fas',
  iconName: 'shuttle-space',
  icon: [640, 512, ["space-shuttle"], "f197", "M130 480c40.6 0 80.4-11 115.2-31.9L352 384l-224 0 0 96 2 0zM352 128L245.2 63.9C210.4 43 170.6 32 130 32l-2 0 0 96 224 0zM96 128l0-96L80 32C53.5 32 32 53.5 32 80l0 48 8 0c-22.1 0-40 17.9-40 40l0 16L0 328l0 16c0 22.1 17.9 40 40 40l-8 0 0 48c0 26.5 21.5 48 48 48l16 0 0-96 8 0c26.2 0 49.4-12.6 64-32l288 0c69.3 0 135-22.7 179.2-81.6c6.4-8.5 6.4-20.3 0-28.8C591 182.7 525.3 160 456 160l-288 0c-14.6-19.4-37.8-32-64-32l-8 0zM512 243.6l0 24.9c0 19.6-15.9 35.6-35.6 35.6c-2.5 0-4.4-2-4.4-4.4l0-87.1c0-2.5 2-4.4 4.4-4.4c19.6 0 35.6 15.9 35.6 35.6z"]
};
const faSpaceShuttle = faShuttleSpace;
const faFaceLaugh = {
  prefix: 'fas',
  iconName: 'face-laugh',
  icon: [512, 512, ["laugh"], "f599", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1l275.2 0c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zM144.4 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faLaugh = faFaceLaugh;
const faFolderOpen = {
  prefix: 'fas',
  iconName: 'folder-open',
  icon: [576, 512, [128194, 128449, 61717], "f07c", "M88.7 223.8L0 375.8 0 96C0 60.7 28.7 32 64 32l117.5 0c17 0 33.3 6.7 45.3 18.7l26.5 26.5c12 12 28.3 18.7 45.3 18.7L416 96c35.3 0 64 28.7 64 64l0 32-336 0c-22.8 0-43.8 12.1-55.3 31.8zm27.6 16.1C122.1 230 132.6 224 144 224l400 0c11.5 0 22 6.1 27.7 16.1s5.7 22.2-.1 32.1l-112 192C453.9 474 443.4 480 432 480L32 480c-11.5 0-22-6.1-27.7-16.1s-5.7-22.2 .1-32.1l112-192z"]
};
const faHeartCirclePlus = {
  prefix: 'fas',
  iconName: 'heart-circle-plus',
  icon: [576, 512, [], "e500", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm16-208l0 48 48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l48 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faCodeFork = {
  prefix: 'fas',
  iconName: 'code-fork',
  icon: [448, 512, [], "e13b", "M80 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm80-24c0 32.8-19.7 61-48 73.3l0 38.7c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-38.7C307.7 141 288 112.8 288 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3l0 38.7c0 53-43 96-96 96l-48 0 0 70.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3l0-70.7-48 0c-53 0-96-43-96-96l0-38.7C19.7 141 0 112.8 0 80C0 35.8 35.8 0 80 0s80 35.8 80 80zm208 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM248 432a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faCity = {
  prefix: 'fas',
  iconName: 'city',
  icon: [640, 512, [127961], "f64f", "M480 48c0-26.5-21.5-48-48-48L336 0c-26.5 0-48 21.5-48 48l0 48-64 0 0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-64 0 0-72c0-13.3-10.7-24-24-24S64 10.7 64 24l0 72L48 96C21.5 96 0 117.5 0 144l0 96L0 464c0 26.5 21.5 48 48 48l256 0 32 0 96 0 160 0c26.5 0 48-21.5 48-48l0-224c0-26.5-21.5-48-48-48l-112 0 0-144zm96 320l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zM240 416l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16zM128 400c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32zM560 256c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0zM256 176l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zM112 160c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0zM256 304c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32zM112 320l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16zm304-48l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zM400 64c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0zm16 112l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16z"]
};
const faMicrophoneLines = {
  prefix: 'fas',
  iconName: 'microphone-lines',
  icon: [384, 512, [127897, "microphone-alt"], "f3c9", "M96 96l0 160c0 53 43 96 96 96s96-43 96-96l-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-32-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-32-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0c0-53-43-96-96-96S96 43 96 96zM320 240l0 16c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24z"]
};
const faMicrophoneAlt = faMicrophoneLines;
const faPepperHot = {
  prefix: 'fas',
  iconName: 'pepper-hot',
  icon: [512, 512, [127798], "f816", "M428.3 3c11.6-6.4 26.2-2.3 32.6 9.3l4.8 8.7c19.3 34.7 19.8 75.7 3.4 110C495.8 159.6 512 197.9 512 240c0 18.5-3.1 36.3-8.9 52.8c-6.1 17.3-28.5 16.3-36.8-.1l-11.7-23.4c-4.1-8.1-12.4-13.3-21.5-13.3L360 256c-13.3 0-24-10.7-24-24l0-80c0-13.3-10.7-24-24-24l-17.1 0c-21.3 0-30-23.9-10.8-32.9C304.7 85.4 327.7 80 352 80c28.3 0 54.8 7.3 77.8 20.2c5.5-18.2 3.7-38.4-6-55.8L419 35.7c-6.4-11.6-2.3-26.2 9.3-32.6zM171.2 345.5L264 160l40 0 0 80c0 26.5 21.5 48 48 48l76.2 0 23.9 47.8C372.3 443.9 244.3 512 103.2 512l-58.8 0C19.9 512 0 492.1 0 467.6c0-20.8 14.5-38.8 34.8-43.3l49.8-11.1c37.6-8.4 69.5-33.2 86.7-67.7z"]
};
const faUnlock = {
  prefix: 'fas',
  iconName: 'unlock',
  icon: [448, 512, [128275], "f09c", "M144 144c0-44.2 35.8-80 80-80c31.9 0 59.4 18.6 72.3 45.7c7.6 16 26.7 22.8 42.6 15.2s22.8-26.7 15.2-42.6C331 33.7 281.5 0 224 0C144.5 0 80 64.5 80 144l0 48-16 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-240 0 0-48z"]
};
const faColonSign = {
  prefix: 'fas',
  iconName: 'colon-sign',
  icon: [384, 512, [], "e140", "M255 39.8c4.3-17.1-6.1-34.5-23.3-38.8S197.2 7.1 193 24.2L181.9 68.6C96.1 87.8 32 164.4 32 256c0 58.1 25.8 110.2 66.7 145.4L81 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l13-52.1c9 3.4 18.4 6.2 28 8.2L177 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l10.4-41.4c33.4-4.4 64.1-17.4 89.8-36.7c14.1-10.6 17-30.7 6.4-44.8s-30.7-17-44.8-6.4c-10.2 7.7-21.7 13.9-34 18.3L321 160c9.4-.3 18.5-4.7 24.6-12.8c10.6-14.1 7.8-34.2-6.4-44.8c-1.1-.8-2.2-1.6-3.3-2.4L351 39.8c4.3-17.1-6.1-34.5-23.3-38.8S293.2 7.1 289 24.2L277.2 71.5c-9.3-2.7-18.8-4.6-28.6-5.9L255 39.8zM163.2 143.3L117.3 326.8C103.9 306.5 96 282.2 96 256c0-48.7 27.2-91 67.2-112.7zm8.6 229.5l61.1-244.6c9.9 .7 19.5 2.5 28.7 5.3l-62 248.1c-9.7-1.9-19-4.8-27.8-8.8z"]
};
const faHeadset = {
  prefix: 'fas',
  iconName: 'headset',
  icon: [512, 512, [], "f590", "M256 48C141.1 48 48 141.1 48 256l0 40c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-40C0 114.6 114.6 0 256 0S512 114.6 512 256l0 144.1c0 48.6-39.4 88-88.1 88L313.6 488c-8.3 14.3-23.8 24-41.6 24l-32 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l32 0c17.8 0 33.3 9.7 41.6 24l110.4 .1c22.1 0 40-17.9 40-40L464 256c0-114.9-93.1-208-208-208zM144 208l16 0c17.7 0 32 14.3 32 32l0 112c0 17.7-14.3 32-32 32l-16 0c-35.3 0-64-28.7-64-64l0-48c0-35.3 28.7-64 64-64zm224 0c35.3 0 64 28.7 64 64l0 48c0 35.3-28.7 64-64 64l-16 0c-17.7 0-32-14.3-32-32l0-112c0-17.7 14.3-32 32-32l16 0z"]
};
const faStoreSlash = {
  prefix: 'fas',
  iconName: 'store-slash',
  icon: [640, 512, [], "e071", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-86.8-68 0-17.1 0-131.4c-4 1-8 1.8-12.3 2.3c0 0 0 0-.1 0c-5.3 .7-10.7 1.1-16.2 1.1c-12.4 0-24.3-1.9-35.4-5.3l0 100.3L301.2 210.7c7-4.4 13.3-9.7 18.8-15.7c15.9 17.6 39.1 29 65.2 29c26.2 0 49.3-11.4 65.2-29c16 17.6 39.1 29 65.2 29c4.1 0 8.1-.3 12.1-.8c55.5-7.4 81.8-72.5 52.1-119.4L522.3 13.1C517.2 5 508.1 0 498.4 0L141.6 0c-9.7 0-18.8 5-23.9 13.1l-22.7 36L38.8 5.1zm73.4 218.1c4 .5 8.1 .8 12.1 .8c11 0 21.4-2 31-5.6L48.9 134.5c-6.1 40.6 19.5 82.8 63.3 88.7zM160 384l0-133.4c-11.2 3.5-23.2 5.4-35.6 5.4c-5.5 0-11-.4-16.3-1.1l-.1 0c-4.1-.6-8.1-1.3-12-2.3L96 384l0 64c0 35.3 28.7 64 64 64l320 0c12.9 0 24.8-3.8 34.9-10.3L365.5 384 160 384z"]
};
const faRoadCircleXmark = {
  prefix: 'fas',
  iconName: 'road-circle-xmark',
  icon: [640, 512, [], "e566", "M213.2 32L288 32l0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 74.8 0c27.1 0 51.3 17.1 60.3 42.6l42.7 120.6c-10.9-2.1-22.2-3.2-33.8-3.2c-59.5 0-112.1 29.6-144 74.8l0-42.8c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32c2.3 0 4.6-.3 6.8-.7c-4.5 15.5-6.8 31.8-6.8 48.7c0 5.4 .2 10.7 .7 16l-.7 0c-17.7 0-32 14.3-32 32l0 64L86.6 480C56.5 480 32 455.5 32 425.4c0-6.2 1.1-12.4 3.1-18.2L152.9 74.6C162 49.1 186.1 32 213.2 32zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm22.6 144l36.7-36.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L496 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L473.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L496 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L518.6 368z"]
};
const faUserMinus = {
  prefix: 'fas',
  iconName: 'user-minus',
  icon: [640, 512, [], "f503", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM472 200l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faMarsStrokeUp = {
  prefix: 'fas',
  iconName: 'mars-stroke-up',
  icon: [320, 512, [9896, "mars-stroke-v"], "f22a", "M148.7 4.7c6.2-6.2 16.4-6.2 22.6 0l64 64c4.6 4.6 5.9 11.5 3.5 17.4s-8.3 9.9-14.8 9.9l-40 0 0 24 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 24c0 .6 0 1.2-.1 1.8c77 11.6 136.1 78 136.1 158.2c0 88.4-71.6 160-160 160S0 440.4 0 352c0-80.2 59.1-146.7 136.1-158.2c0-.6-.1-1.2-.1-1.8l0-24-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-24L96 96c-6.5 0-12.3-3.9-14.8-9.9s-1.1-12.9 3.5-17.4l64-64zM256 352A96 96 0 1 0 64 352a96 96 0 1 0 192 0z"]
};
const faMarsStrokeV = faMarsStrokeUp;
const faChampagneGlasses = {
  prefix: 'fas',
  iconName: 'champagne-glasses',
  icon: [640, 512, [129346, "glass-cheers"], "f79f", "M155.6 17.3C163 3 179.9-3.6 195 1.9L320 47.5l125-45.6c15.1-5.5 32 1.1 39.4 15.4l78.8 152.9c28.8 55.8 10.3 122.3-38.5 156.6L556.1 413l41-15c16.6-6 35 2.5 41 19.1s-2.5 35-19.1 41l-71.1 25.9L476.8 510c-16.6 6.1-35-2.5-41-19.1s2.5-35 19.1-41l41-15-31.3-86.2c-59.4 5.2-116.2-34-130-95.2L320 188.8l-14.6 64.7c-13.8 61.3-70.6 100.4-130 95.2l-31.3 86.2 41 15c16.6 6 25.2 24.4 19.1 41s-24.4 25.2-41 19.1L92.2 484.1 21.1 458.2c-16.6-6.1-25.2-24.4-19.1-41s24.4-25.2 41-19.1l41 15 31.3-86.2C66.5 292.5 48.1 226 76.9 170.2L155.6 17.3zm44 54.4l-27.2 52.8L261.6 157l13.1-57.9L199.6 71.7zm240.9 0L365.4 99.1 378.5 157l89.2-32.5L440.5 71.7z"]
};
const faGlassCheers = faChampagneGlasses;
const faClipboard = {
  prefix: 'fas',
  iconName: 'clipboard',
  icon: [384, 512, [128203], "f328", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM112 192l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faHouseCircleExclamation = {
  prefix: 'fas',
  iconName: 'house-circle-exclamation',
  icon: [640, 512, [], "e50a", "M320.7 352c8.1-89.7 83.5-160 175.3-160c8.9 0 17.6 .7 26.1 1.9L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 69.7c-.1 .9-.1 1.8-.1 2.8l0 112c0 22.1 17.9 40 40 40l16 0c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2l31.9 0 24 0c22.1 0 40-17.9 40-40l0-24 0-64c0-17.7 14.3-32 32-32l64 0 .7 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faFileArrowUp = {
  prefix: 'fas',
  iconName: 'file-arrow-up',
  icon: [384, 512, ["file-upload"], "f574", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM216 408c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-102.1-31 31c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l72-72c9.4-9.4 24.6-9.4 33.9 0l72 72c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-31-31L216 408z"]
};
const faFileUpload = faFileArrowUp;
const faWifi = {
  prefix: 'fas',
  iconName: 'wifi',
  icon: [640, 512, ["wifi-3", "wifi-strong"], "f1eb", "M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faWifi3 = faWifi;
const faWifiStrong = faWifi;
const faBath = {
  prefix: 'fas',
  iconName: 'bath',
  icon: [512, 512, [128705, "bathtub"], "f2cd", "M96 77.3c0-7.3 5.9-13.3 13.3-13.3c3.5 0 6.9 1.4 9.4 3.9l14.9 14.9C130 91.8 128 101.7 128 112c0 19.9 7.2 38 19.2 52c-5.3 9.2-4 21.1 3.8 29c9.4 9.4 24.6 9.4 33.9 0L289 89c9.4-9.4 9.4-24.6 0-33.9c-7.9-7.9-19.8-9.1-29-3.8C246 39.2 227.9 32 208 32c-10.3 0-20.2 2-29.2 5.5L163.9 22.6C149.4 8.1 129.7 0 109.3 0C66.6 0 32 34.6 32 77.3L32 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 256 96 77.3zM32 352l0 16c0 28.4 12.4 54 32 71.6L64 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-16 256 0 0 16c0 17.7 14.3 32 32 32s32-14.3 32-32l0-40.4c19.6-17.6 32-43.1 32-71.6l0-16L32 352z"]
};
const faBathtub = faBath;
const faUnderline = {
  prefix: 'fas',
  iconName: 'underline',
  icon: [448, 512, [], "f0cd", "M16 64c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 53 43 96 96 96s96-43 96-96l0-128-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 88.4-71.6 160-160 160s-160-71.6-160-160L64 96 48 96C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32z"]
};
const faUserPen = {
  prefix: 'fas',
  iconName: 'user-pen',
  icon: [640, 512, ["user-edit"], "f4ff", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l293.1 0c-3.1-8.8-3.7-18.4-1.4-27.8l15-60.1c2.8-11.3 8.6-21.5 16.8-29.7l40.3-40.3c-32.1-31-75.7-50.1-123.9-50.1l-91.4 0zm435.5-68.3c-15.6-15.6-40.9-15.6-56.6 0l-29.4 29.4 71 71 29.4-29.4c15.6-15.6 15.6-40.9 0-56.6l-14.4-14.4zM375.9 417c-4.1 4.1-7 9.2-8.4 14.9l-15 60.1c-1.4 5.5 .2 11.2 4.2 15.2s9.7 5.6 15.2 4.2l60.1-15c5.6-1.4 10.8-4.3 14.9-8.4L576.1 358.7l-71-71L375.9 417z"]
};
const faUserEdit = faUserPen;
const faSignature = {
  prefix: 'fas',
  iconName: 'signature',
  icon: [640, 512, [], "f5b7", "M192 128c0-17.7 14.3-32 32-32s32 14.3 32 32l0 7.8c0 27.7-2.4 55.3-7.1 82.5l-84.4 25.3c-40.6 12.2-68.4 49.6-68.4 92l0 71.9c0 40 32.5 72.5 72.5 72.5c26 0 50-13.9 62.9-36.5l13.9-24.3c26.8-47 46.5-97.7 58.4-150.5l94.4-28.3-12.5 37.5c-3.3 9.8-1.6 20.5 4.4 28.8s15.7 13.3 26 13.3l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-83.6 0 18-53.9c3.8-11.3 .9-23.8-7.4-32.4s-20.7-11.8-32.2-8.4L316.4 198.1c2.4-20.7 3.6-41.4 3.6-62.3l0-7.8c0-53-43-96-96-96s-96 43-96 96l0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32zm-9.2 177l49-14.7c-10.4 33.8-24.5 66.4-42.1 97.2l-13.9 24.3c-1.5 2.6-4.3 4.3-7.4 4.3c-4.7 0-8.5-3.8-8.5-8.5l0-71.9c0-14.1 9.3-26.6 22.8-30.7zM24 368c-13.3 0-24 10.7-24 24s10.7 24 24 24l40.3 0c-.2-2.8-.3-5.6-.3-8.5L64 368l-40 0zm592 48c13.3 0 24-10.7 24-24s-10.7-24-24-24l-310.1 0c-6.7 16.3-14.2 32.3-22.3 48L616 416z"]
};
const faStroopwafel = {
  prefix: 'fas',
  iconName: 'stroopwafel',
  icon: [512, 512, [], "f551", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM312.6 63.7c-6.2-6.2-16.4-6.2-22.6 0L256 97.6 222.1 63.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l33.9 33.9-45.3 45.3-56.6-56.6c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l56.6 56.6-45.3 45.3L86.3 199.4c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L97.6 256 63.7 289.9c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l33.9-33.9 45.3 45.3-56.6 56.6c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l56.6-56.6 45.3 45.3-33.9 33.9c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L256 414.4l33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-33.9-33.9 45.3-45.3 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 45.3-45.3 33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L414.4 256l33.9-33.9c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-33.9 33.9-45.3-45.3 56.6-56.6c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-56.6 56.6-45.3-45.3 33.9-33.9c6.2-6.2 6.2-16.4 0-22.6zM142.9 256l45.3-45.3L233.4 256l-45.3 45.3L142.9 256zm67.9 67.9L256 278.6l45.3 45.3L256 369.1l-45.3-45.3zM278.6 256l45.3-45.3L369.1 256l-45.3 45.3L278.6 256zm22.6-67.9L256 233.4l-45.3-45.3L256 142.9l45.3 45.3z"]
};
const faBold = {
  prefix: 'fas',
  iconName: 'bold',
  icon: [384, 512, [], "f032", "M0 64C0 46.3 14.3 32 32 32l48 0 16 0 128 0c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128L96 480l-16 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-160L48 96 32 96C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64L112 96l0 128 112 0zM112 288l0 128 144 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-112 0z"]
};
const faAnchorLock = {
  prefix: 'fas',
  iconName: 'anchor-lock',
  icon: [640, 512, [], "e4ad", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c8 0 15.9-.6 23.6-1.7c-4.8-9-7.6-19.3-7.6-30.3l0-33.3c-5.2 .9-10.5 1.3-16 1.3l-48 0 0-208 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0zM528 240c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faBuildingNgo = {
  prefix: 'fas',
  iconName: 'building-ngo',
  icon: [384, 512, [], "e4d7", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c26.5 0 48-21.5 48-48l0-416c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM168 64l48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 64 16 0 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 24c0 13.3-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24l0-88c0-8.8 7.2-16 16-16zM304 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16s16-7.2 16-16l0-32c0-8.8-7.2-16-16-16zm-48 16c0-26.5 21.5-48 48-48s48 21.5 48 48l0 32c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-32zM61.3 71.1l34.7 52L96 80c0-8.8 7.2-16 16-16s16 7.2 16 16l0 96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4L64 132.8 64 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4z"]
};
const faManatSign = {
  prefix: 'fas',
  iconName: 'manat-sign',
  icon: [384, 512, [], "e1d5", "M192 32c-17.7 0-32 14.3-32 32l0 34.7C69.2 113.9 0 192.9 0 288L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-59.6 40.8-109.8 96-124l0 284c0 17.7 14.3 32 32 32s32-14.3 32-32l0-284c55.2 14.2 96 64.3 96 124l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-95.1-69.2-174.1-160-189.3L224 64c0-17.7-14.3-32-32-32z"]
};
const faNotEqual = {
  prefix: 'fas',
  iconName: 'not-equal',
  icon: [448, 512, [], "f53e", "M369.8 37.4c14.7 9.8 18.7 29.7 8.9 44.4L337.1 144l62.9 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-105.5 0-64 96L400 304c17.7 0 32 14.3 32 32s-14.3 32-32 32l-212.2 0-65.2 97.7c-9.8 14.7-29.7 18.7-44.4 8.9s-18.7-29.7-8.9-44.4L110.9 368 48 368c-17.7 0-32-14.3-32-32s14.3-32 32-32l105.5 0 64-96L48 208c-17.7 0-32-14.3-32-32s14.3-32 32-32l212.2 0 65.2-97.7c9.8-14.7 29.7-18.7 44.4-8.9z"]
};
const faBorderTopLeft = {
  prefix: 'fas',
  iconName: 'border-top-left',
  icon: [448, 512, ["border-style"], "f853", "M0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-336c0-8.8 7.2-16 16-16l336 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32C35.8 32 0 67.8 0 112L0 448zm160 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm192 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm-96 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm192 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm0 32a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faBorderStyle = faBorderTopLeft;
const faMapLocationDot = {
  prefix: 'fas',
  iconName: 'map-location-dot',
  icon: [576, 512, ["map-marked-alt"], "f5a0", "M408 120c0 54.6-73.1 151.9-105.2 192c-7.7 9.6-22 9.6-29.6 0C241.1 271.9 168 174.6 168 120C168 53.7 221.7 0 288 0s120 53.7 120 120zm8 80.4c3.5-6.9 6.7-13.8 9.6-20.6c.5-1.2 1-2.5 1.5-3.7l116-46.4C558.9 123.4 576 135 576 152l0 270.8c0 9.8-6 18.6-15.1 22.3L416 503l0-302.6zM137.6 138.3c2.4 14.1 7.2 28.3 12.8 41.5c2.9 6.8 6.1 13.7 9.6 20.6l0 251.4L32.9 502.7C17.1 509 0 497.4 0 480.4L0 209.6c0-9.8 6-18.6 15.1-22.3l122.6-49zM327.8 332c13.9-17.4 35.7-45.7 56.2-77l0 249.3L192 449.4 192 255c20.5 31.3 42.3 59.6 56.2 77c20.5 25.6 59.1 25.6 79.6 0zM288 152a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faMapMarkedAlt = faMapLocationDot;
const faJedi = {
  prefix: 'fas',
  iconName: 'jedi',
  icon: [576, 512, [], "f669", "M246 315.7l-21.2-31.9c-2.1-3.2-1.7-7.4 1-10.1s6.9-3.1 10.1-1l29.5 19.7c2.1 1.4 4.9 0 5-2.6L279.7 8c.1-4.5 3.8-8 8.3-8s8.1 3.5 8.3 8l9.4 281.9c.1 2.5 2.9 3.9 5 2.6l29.5-19.7c3.2-2.1 7.4-1.7 10.1 1s3.1 6.9 1 10.1L330 315.7c-1.3 1.9-.2 4.5 2 4.9l37.6 7.5c3.7 .7 6.4 4 6.4 7.8s-2.7 7.1-6.4 7.8L332 351.4c-2.2 .4-3.3 3-2 4.9l21.2 31.9c2.1 3.2 1.7 7.4-1 10.1s-6.9 3.1-10.1 1l-26.3-17.6c-2.2-1.4-5.1 .2-5 2.8l2.1 61.5C370.6 435.2 416 382.9 416 320c0-37-15.7-70.4-40.8-93.7c-7-6.5-6.5-18.6 1-24.4C410.1 175.5 432 134.3 432 88c0-16.8-2.9-33-8.2-48c-4.6-13 10.2-30 21.4-22c53.5 38 92.7 94.8 107.8 160.7c.5 2.1-.2 4.3-1.7 5.9l-28.4 28.4c-4 4-1.2 10.9 4.5 10.9l26 0c3.4 0 6.2 2.6 6.3 6c.1 3.3 .2 6.6 .2 10c0 17.5-1.7 34.7-4.8 51.3c-.2 1.2-.9 2.4-1.7 3.3l-46.5 46.5c-4 4-1.2 10.9 4.5 10.9l14.6 0c4.6 0 7.7 4.8 5.7 9C487.2 450.5 394.8 512 288 512S88.8 450.5 44.3 361c-2.1-4.2 1-9 5.7-9l14.6 0c5.7 0 8.6-6.9 4.5-10.9L22.6 294.6c-.9-.9-1.5-2-1.7-3.3C17.7 274.7 16 257.5 16 240c0-3.3 .1-6.7 .2-10c.1-3.4 2.9-6 6.3-6l26 0c5.7 0 8.6-6.9 4.5-10.9L24.6 184.6c-1.5-1.5-2.2-3.8-1.7-5.9C38.1 112.8 77.3 56 130.8 18c11.3-8 26 8.9 21.4 22c-5.3 15-8.2 31.2-8.2 48c0 46.3 21.9 87.5 55.8 113.9c7.5 5.8 8 17.9 1 24.4C175.7 249.6 160 283 160 320c0 62.9 45.4 115.2 105.1 126l2.1-61.5c.1-2.6-2.8-4.2-5-2.8l-26.3 17.6c-3.2 2.1-7.4 1.7-10.1-1s-3.1-6.9-1-10.1L246 356.3c1.3-1.9 .2-4.5-2-4.9l-37.6-7.5c-3.7-.7-6.4-4-6.4-7.8s2.7-7.1 6.4-7.8l37.6-7.5c2.2-.4 3.3-3 2-4.9z"]
};
const faSquarePollVertical = {
  prefix: 'fas',
  iconName: 'square-poll-vertical',
  icon: [448, 512, ["poll"], "f681", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 192c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32zm64-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 192c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-192zM320 288c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32z"]
};
const faPoll = faSquarePollVertical;
const faMugHot = {
  prefix: 'fas',
  iconName: 'mug-hot',
  icon: [512, 512, [9749], "f7b6", "M88 0C74.7 0 64 10.7 64 24c0 38.9 23.4 59.4 39.1 73.1l1.1 1C120.5 112.3 128 119.9 128 136c0 13.3 10.7 24 24 24s24-10.7 24-24c0-38.9-23.4-59.4-39.1-73.1l-1.1-1C119.5 47.7 112 40.1 112 24c0-13.3-10.7-24-24-24zM32 192c-17.7 0-32 14.3-32 32L0 416c0 53 43 96 96 96l192 0c53 0 96-43 96-96l16 0c61.9 0 112-50.1 112-112s-50.1-112-112-112l-48 0L32 192zm352 64l16 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-16 0 0-96zM224 24c0-13.3-10.7-24-24-24s-24 10.7-24 24c0 38.9 23.4 59.4 39.1 73.1l1.1 1C232.5 112.3 240 119.9 240 136c0 13.3 10.7 24 24 24s24-10.7 24-24c0-38.9-23.4-59.4-39.1-73.1l-1.1-1C231.5 47.7 224 40.1 224 24z"]
};
const faCarBattery = {
  prefix: 'fas',
  iconName: 'car-battery',
  icon: [512, 512, ["battery-car"], "f5df", "M80 96c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l96 0c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l16 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 160c0-35.3 28.7-64 64-64l16 0zm304 96c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 32-32 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0 0 32c0 8.8 7.2 16 16 16s16-7.2 16-16l0-32 32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0-32zM80 240c0 8.8 7.2 16 16 16l96 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-96 0c-8.8 0-16 7.2-16 16z"]
};
const faBatteryCar = faCarBattery;
const faGift = {
  prefix: 'fas',
  iconName: 'gift',
  icon: [512, 512, [127873], "f06b", "M190.5 68.8L225.3 128l-1.3 0-72 0c-22.1 0-40-17.9-40-40s17.9-40 40-40l2.2 0c14.9 0 28.8 7.9 36.3 20.8zM64 88c0 14.4 3.5 28 9.6 40L32 128c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l448 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-41.6 0c6.1-12 9.6-25.6 9.6-40c0-48.6-39.4-88-88-88l-2.2 0c-31.9 0-61.5 16.9-77.7 44.4L256 85.5l-24.1-41C215.7 16.9 186.1 0 154.2 0L152 0C103.4 0 64 39.4 64 88zm336 0c0 22.1-17.9 40-40 40l-72 0-1.3 0 34.8-59.2C329.1 55.9 342.9 48 357.8 48l2.2 0c22.1 0 40 17.9 40 40zM32 288l0 176c0 26.5 21.5 48 48 48l144 0 0-224L32 288zM288 512l144 0c26.5 0 48-21.5 48-48l0-176-192 0 0 224z"]
};
const faDiceTwo = {
  prefix: 'fas',
  iconName: 'dice-two',
  icon: [448, 512, [9857], "f528", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM352 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faChessQueen = {
  prefix: 'fas',
  iconName: 'chess-queen',
  icon: [512, 512, [9819], "f445", "M256 0a56 56 0 1 1 0 112A56 56 0 1 1 256 0zM134.1 143.8c3.3-13 15-23.8 30.2-23.8c12.3 0 22.6 7.2 27.7 17c12 23.2 36.2 39 64 39s52-15.8 64-39c5.1-9.8 15.4-17 27.7-17c15.3 0 27 10.8 30.2 23.8c7 27.8 32.2 48.3 62.1 48.3c10.8 0 21-2.7 29.8-7.4c8.4-4.4 18.9-4.5 27.6 .9c13 8 17.1 25 9.2 38L399.7 400 384 400l-40.4 0-175.1 0L128 400l-15.7 0L5.4 223.6c-7.9-13-3.8-30 9.2-38c8.7-5.3 19.2-5.3 27.6-.9c8.9 4.7 19 7.4 29.8 7.4c29.9 0 55.1-20.5 62.1-48.3zM256 224s0 0 0 0s0 0 0 0s0 0 0 0zM112 432l288 0 41.4 41.4c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6L86.6 512C74.1 512 64 501.9 64 489.4c0-6 2.4-11.8 6.6-16L112 432z"]
};
const faGlasses = {
  prefix: 'fas',
  iconName: 'glasses',
  icon: [576, 512, [], "f530", "M118.6 80c-11.5 0-21.4 7.9-24 19.1L57 260.3c20.5-6.2 48.3-12.3 78.7-12.3c32.3 0 61.8 6.9 82.8 13.5c10.6 3.3 19.3 6.7 25.4 9.2c3.1 1.3 5.5 2.4 7.3 3.2c.9 .4 1.6 .7 2.1 1l.6 .3 .2 .1c0 0 .1 0 .1 0c0 0 0 0 0 0s0 0 0 0L247.9 288s0 0 0 0l6.3-12.7c5.8 2.9 10.4 7.3 13.5 12.7l40.6 0c3.1-5.3 7.7-9.8 13.5-12.7l6.3 12.7s0 0 0 0c-6.3-12.7-6.3-12.7-6.3-12.7s0 0 0 0s0 0 0 0c0 0 .1 0 .1 0l.2-.1 .6-.3c.5-.2 1.2-.6 2.1-1c1.8-.8 4.2-1.9 7.3-3.2c6.1-2.6 14.8-5.9 25.4-9.2c21-6.6 50.4-13.5 82.8-13.5c30.4 0 58.2 6.1 78.7 12.3L481.4 99.1c-2.6-11.2-12.6-19.1-24-19.1c-3.1 0-6.2 .6-9.2 1.8L416.9 94.3c-12.3 4.9-26.3-1.1-31.2-13.4s1.1-26.3 13.4-31.2l31.3-12.5c8.6-3.4 17.7-5.2 27-5.2c33.8 0 63.1 23.3 70.8 56.2l43.9 188c1.7 7.3 2.9 14.7 3.5 22.1c.3 1.9 .5 3.8 .5 5.7l0 6.7 0 41.3 0 16c0 61.9-50.1 112-112 112l-44.3 0c-59.4 0-108.5-46.4-111.8-105.8L306.6 352l-37.2 0-1.2 22.2C264.9 433.6 215.8 480 156.3 480L112 480C50.1 480 0 429.9 0 368l0-16 0-41.3L0 304c0-1.9 .2-3.8 .5-5.7c.6-7.4 1.8-14.8 3.5-22.1l43.9-188C55.5 55.3 84.8 32 118.6 32c9.2 0 18.4 1.8 27 5.2l31.3 12.5c12.3 4.9 18.3 18.9 13.4 31.2s-18.9 18.3-31.2 13.4L127.8 81.8c-2.9-1.2-6-1.8-9.2-1.8zM64 325.4L64 368c0 26.5 21.5 48 48 48l44.3 0c25.5 0 46.5-19.9 47.9-45.3l2.5-45.6c-2.3-.8-4.9-1.7-7.5-2.5c-17.2-5.4-39.9-10.5-63.6-10.5c-23.7 0-46.2 5.1-63.2 10.5c-3.1 1-5.9 1.9-8.5 2.9zM512 368l0-42.6c-2.6-.9-5.5-1.9-8.5-2.9c-17-5.4-39.5-10.5-63.2-10.5c-23.7 0-46.4 5.1-63.6 10.5c-2.7 .8-5.2 1.7-7.5 2.5l2.5 45.6c1.4 25.4 22.5 45.3 47.9 45.3l44.3 0c26.5 0 48-21.5 48-48z"]
};
const faChessBoard = {
  prefix: 'fas',
  iconName: 'chess-board',
  icon: [448, 512, [], "f43c", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 64l0 64 64 0 0-64 64 0 0 64 64 0 0-64 64 0 0 64-64 0 0 64 64 0 0 64-64 0 0 64 64 0 0 64-64 0 0-64-64 0 0 64-64 0 0-64-64 0 0 64-64 0 0-64 64 0 0-64-64 0 0-64 64 0 0-64-64 0 0-64 64 0zm64 128l64 0 0-64-64 0 0 64zm0 64l0-64-64 0 0 64 64 0zm64 0l-64 0 0 64 64 0 0-64zm0 0l64 0 0-64-64 0 0 64z"]
};
const faBuildingCircleCheck = {
  prefix: 'fas',
  iconName: 'building-circle-check',
  icon: [640, 512, [], "e4d2", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c15.1 0 28.5-6.9 37.3-17.8C340.4 462.2 320 417.5 320 368c0-54.7 24.9-103.5 64-135.8L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faPersonChalkboard = {
  prefix: 'fas',
  iconName: 'person-chalkboard',
  icon: [640, 512, [], "e53d", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 384l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-288 56 0 64 0 16 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-64 192 0 0 192-192 0 0-32-64 0 0 48c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-224c0-26.5-21.5-48-48-48L368 0c-26.5 0-48 21.5-48 48l0 80-76.9 0-65.9 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9 120 480c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
};
const faMarsStrokeRight = {
  prefix: 'fas',
  iconName: 'mars-stroke-right',
  icon: [640, 512, [9897, "mars-stroke-h"], "f22b", "M208 368a112 112 0 1 0 0-224 112 112 0 1 0 0 224zm174.4-88C370.7 365.8 297.1 432 208 432c-97.2 0-176-78.8-176-176s78.8-176 176-176c89.1 0 162.7 66.2 174.4 152l33.6 0 0-56c0-13.3 10.7-24 24-24s24 10.7 24 24l0 56 32 0 0-56c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l80 80c9.4 9.4 9.4 24.6 0 33.9l-80 80c-6.9 6.9-17.2 8.9-26.2 5.2s-14.8-12.5-14.8-22.2l0-56-32 0 0 56c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-56-33.6 0z"]
};
const faMarsStrokeH = faMarsStrokeRight;
const faHandBackFist = {
  prefix: 'fas',
  iconName: 'hand-back-fist',
  icon: [448, 512, ["hand-rock"], "f255", "M144 0C117.5 0 96 21.5 96 48l0 48 0 28.5L96 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-26.7-9 7.5C40.4 169 32 187 32 206L32 244c0 38 16.9 74 46.1 98.3L128 384l0 96c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-105.3c46.9-19 80-65 80-118.7l0-80 0-16 0-16c0-26.5-21.5-48-48-48c-12.4 0-23.6 4.7-32.1 12.3C350 83.5 329.3 64 304 64c-12.4 0-23.6 4.7-32.1 12.3C270 51.5 249.3 32 224 32c-12.4 0-23.6 4.7-32.1 12.3C190 19.5 169.3 0 144 0z"]
};
const faHandRock = faHandBackFist;
const faSquareCaretUp = {
  prefix: 'fas',
  iconName: 'square-caret-up',
  icon: [448, 512, ["caret-square-up"], "f151", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM224 160c6.7 0 13 2.8 17.6 7.7l104 112c6.5 7 8.2 17.2 4.4 25.9s-12.5 14.4-22 14.4l-208 0c-9.5 0-18.2-5.7-22-14.4s-2.1-18.9 4.4-25.9l104-112c4.5-4.9 10.9-7.7 17.6-7.7z"]
};
const faCaretSquareUp = faSquareCaretUp;
const faCloudShowersWater = {
  prefix: 'fas',
  iconName: 'cloud-showers-water',
  icon: [576, 512, [], "e4e4", "M224 0c38.6 0 71.9 22.8 87.2 55.7C325.7 41.1 345.8 32 368 32c38.7 0 71 27.5 78.4 64l1.6 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64s28.7-64 64-64c0-53 43-96 96-96zM140.6 292.3l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15.1-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2s15.1 21.6 8.2 32.9zm327.8-32.9c11.4 6.8 15 21.6 8.2 32.9l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2zM252.6 292.3l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15.1-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2s15.1 21.6 8.2 32.9zm103.8-32.9c11.4 6.8 15 21.6 8.2 32.9l-48 80c-6.8 11.4-21.6 15-32.9 8.2s-15.1-21.6-8.2-32.9l48-80c6.8-11.4 21.6-15.1 32.9-8.2zM306.5 421.9C329 437.4 356.5 448 384 448c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 501.7 417 512 384 512c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 437.2 165.1 448 192 448c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faChartBar = {
  prefix: 'fas',
  iconName: 'chart-bar',
  icon: [512, 512, ["bar-chart"], "f080", "M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zm96 96c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 64l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 96l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faBarChart = faChartBar;
const faHandsBubbles = {
  prefix: 'fas',
  iconName: 'hands-bubbles',
  icon: [576, 512, ["hands-wash"], "e05e", "M416 64a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm96 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM160 464a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM32 160l.1 72.6c.1 52.2 24 101 64 133.1c-.1-1.9-.1-3.8-.1-5.7l0-8c0-71.8 37-138.6 97.9-176.7l60.2-37.6c8.6-5.4 17.9-8.4 27.3-9.4l45.9-79.5c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8l-78 135.1c-3.3 5.7-10.7 7.7-16.4 4.4s-7.7-10.7-4.4-16.4l62-107.4c6.6-11.5 2.7-26.2-8.8-32.8S214 5 207.4 16.5l-68 117.8s0 0 0 0s0 0 0 0l-43.3 75L96 160c0-17.7-14.4-32-32-32s-32 14.4-32 32zM332.1 88.5L307.5 131c13.9 4.5 26.4 13.7 34.7 27c.9 1.5 1.8 2.9 2.5 4.4l28.9-50c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8zm46.4 63.7l-26.8 46.4c-.6 6-2.1 11.8-4.3 17.4l4.7 0 13.3 0s0 0 0 0l31.8 0 23-39.8c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8zM315.1 175c-9.4-15-29.1-19.5-44.1-10.2l-60.2 37.6C159.3 234.7 128 291.2 128 352l0 8c0 8.9 .8 17.6 2.2 26.1c35.4 8.2 61.8 40 61.8 77.9c0 6.3-.7 12.5-2.1 18.4C215.1 501 246.3 512 280 512l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-92 0c-6.6 0-12-5.4-12-12s5.4-12 12-12l124 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-124 0c-6.6 0-12-5.4-12-12s5.4-12 12-12l156 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-156 0c-6.6 0-12-5.4-12-12s5.4-12 12-12l124 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-136 0s0 0 0 0s0 0 0 0l-93.2 0L305 219.1c15-9.4 19.5-29.1 10.2-44.1z"]
};
const faHandsWash = faHandsBubbles;
const faLessThanEqual = {
  prefix: 'fas',
  iconName: 'less-than-equal',
  icon: [448, 512, [], "f537", "M395.9 93.7c16.4-6.6 24.4-25.2 17.8-41.6s-25.2-24.4-41.6-17.8l-320 128C40 167.1 32 178.9 32 192s8 24.9 20.1 29.7l320 128c16.4 6.6 35-1.4 41.6-17.8s-1.4-35-17.8-41.6L150.2 192 395.9 93.7zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416z"]
};
const faTrain = {
  prefix: 'fas',
  iconName: 'train',
  icon: [448, 512, [128646], "f238", "M96 0C43 0 0 43 0 96L0 352c0 48 35.2 87.7 81.1 94.9l-46 46C28.1 499.9 33.1 512 43 512l39.7 0c8.5 0 16.6-3.4 22.6-9.4L160 448l128 0 54.6 54.6c6 6 14.1 9.4 22.6 9.4l39.7 0c10 0 15-12.1 7.9-19.1l-46-46c46-7.1 81.1-46.9 81.1-94.9l0-256c0-53-43-96-96-96L96 0zM64 96c0-17.7 14.3-32 32-32l256 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32L96 224c-17.7 0-32-14.3-32-32l0-96zM224 288a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faEyeLowVision = {
  prefix: 'fas',
  iconName: 'eye-low-vision',
  icon: [640, 512, ["low-vision"], "f2a8", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223 149.5c48.6-44.3 123-50.8 179.3-11.7c60.8 42.4 78.9 123.2 44.2 186.9L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3L223 149.5zm223.1 298L83.1 161.5c-11 14.4-20.5 28.7-28.4 42.2l339 265.7c18.7-5.5 36.2-13 52.6-21.8zM34.5 268.3c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c3.1 0 6.1-.1 9.2-.2L33.1 247.8c-1.8 6.8-1.3 14 1.4 20.5z"]
};
const faLowVision = faEyeLowVision;
const faCrow = {
  prefix: 'fas',
  iconName: 'crow',
  icon: [640, 512, [], "f520", "M456 0c-48.6 0-88 39.4-88 88l0 29.2L12.5 390.6c-14 10.8-16.6 30.9-5.9 44.9s30.9 16.6 44.9 5.9L126.1 384l133.1 0 46.6 113.1c5 12.3 19.1 18.1 31.3 13.1s18.1-19.1 13.1-31.3L311.1 384l40.9 0c1.1 0 2.1 0 3.2 0l46.6 113.2c5 12.3 19.1 18.1 31.3 13.1s18.1-19.1 13.1-31.3l-42-102C484.9 354.1 544 280 544 192l0-64 0-8 80.5-20.1c8.6-2.1 13.8-10.8 11.6-19.4C629 52 603.4 32 574 32l-50.1 0C507.7 12.5 483.3 0 456 0zm0 64a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faSailboat = {
  prefix: 'fas',
  iconName: 'sailboat',
  icon: [576, 512, [], "e445", "M256 16c0-7 4.5-13.2 11.2-15.3s13.9 .4 17.9 6.1l224 320c3.4 4.9 3.8 11.3 1.1 16.6s-8.2 8.6-14.2 8.6l-224 0c-8.8 0-16-7.2-16-16l0-320zM212.1 96.5c7 1.9 11.9 8.2 11.9 15.5l0 224c0 8.8-7.2 16-16 16L80 352c-5.7 0-11-3-13.8-8s-2.9-11-.1-16l128-224c3.6-6.3 11-9.4 18-7.5zM5.7 404.3C2.8 394.1 10.5 384 21.1 384l533.8 0c10.6 0 18.3 10.1 15.4 20.3l-4 14.3C550.7 473.9 500.4 512 443 512L133 512C75.6 512 25.3 473.9 9.7 418.7l-4-14.3z"]
};
const faWindowRestore = {
  prefix: 'fas',
  iconName: 'window-restore',
  icon: [512, 512, [], "f2d2", "M432 64L208 64c-8.8 0-16 7.2-16 16l0 16-64 0 0-16c0-44.2 35.8-80 80-80L432 0c44.2 0 80 35.8 80 80l0 224c0 44.2-35.8 80-80 80l-16 0 0-64 16 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zM0 192c0-35.3 28.7-64 64-64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192zm64 32c0 17.7 14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 192c-17.7 0-32 14.3-32 32z"]
};
const faSquarePlus = {
  prefix: 'fas',
  iconName: 'square-plus',
  icon: [448, 512, [61846, "plus-square"], "f0fe", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM200 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
};
const faPlusSquare = faSquarePlus;
const faToriiGate = {
  prefix: 'fas',
  iconName: 'torii-gate',
  icon: [512, 512, [9961], "f6a1", "M0 80c0 26.5 21.5 48 48 48l16 0 0 64 64 0 0-64 96 0 0 64 64 0 0-64 96 0 0 64 64 0 0-64 16 0c26.5 0 48-21.5 48-48l0-66.6C512 6 506 0 498.6 0c-1.7 0-3.4 .3-5 1l-49 19.6C425.7 28.1 405.5 32 385.2 32L126.8 32c-20.4 0-40.5-3.9-59.4-11.4L18.4 1c-1.6-.6-3.3-1-5-1C6 0 0 6 0 13.4L0 80zM64 288l0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192 256 0 0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0z"]
};
const faFrog = {
  prefix: 'fas',
  iconName: 'frog',
  icon: [576, 512, [], "f52e", "M368 32c41.7 0 75.9 31.8 79.7 72.5l85.6 26.3c25.4 7.8 42.8 31.3 42.8 57.9c0 21.8-11.7 41.9-30.7 52.7L400.8 323.5 493.3 416l50.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-8.5 0-16.6-3.4-22.6-9.4L346.9 360.2c11.7-36 3.2-77.1-25.4-105.7c-40.6-40.6-106.3-40.6-146.9-.1L101 324.4c-6.4 6.1-6.7 16.2-.6 22.6s16.2 6.6 22.6 .6l73.8-70.2 .1-.1 .1-.1c3.5-3.5 7.3-6.6 11.3-9.2c27.9-18.5 65.9-15.4 90.5 9.2c24.7 24.7 27.7 62.9 9 90.9c-2.6 3.8-5.6 7.5-9 10.9L261.8 416l90.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 480c-35.3 0-64-28.7-64-64C0 249.6 127 112.9 289.3 97.5C296.2 60.2 328.8 32 368 32zm0 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faBucket = {
  prefix: 'fas',
  iconName: 'bucket',
  icon: [448, 512, [], "e4cf", "M96 152l0 8-48 0 0-8C48 68.1 116.1 0 200 0l48 0c83.9 0 152 68.1 152 152l0 8-48 0 0-8c0-57.4-46.6-104-104-104l-48 0C142.6 48 96 94.6 96 152zM0 224c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-5.1 0L388.5 469c-2.6 24.4-23.2 43-47.7 43l-233.6 0c-24.6 0-45.2-18.5-47.7-43L37.1 256 32 256c-17.7 0-32-14.3-32-32z"]
};
const faImage = {
  prefix: 'fas',
  iconName: 'image',
  icon: [512, 512, [], "f03e", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faMicrophone = {
  prefix: 'fas',
  iconName: 'microphone',
  icon: [384, 512, [], "f130", "M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z"]
};
const faCow = {
  prefix: 'fas',
  iconName: 'cow',
  icon: [640, 512, [128004], "f6c8", "M96 224l0 32 0 160c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-88.2c9.9 6.6 20.6 12 32 16.1l0 24.2c0 8.8 7.2 16 16 16s16-7.2 16-16l0-16.9c5.3 .6 10.6 .9 16 .9s10.7-.3 16-.9l0 16.9c0 8.8 7.2 16 16 16s16-7.2 16-16l0-24.2c11.4-4 22.1-9.4 32-16.1l0 88.2c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-160 32 32 0 49.5c0 9.5 2.8 18.7 8.1 26.6L530 427c8.8 13.1 23.5 21 39.3 21c22.5 0 41.9-15.9 46.3-38l20.3-101.6c2.6-13-.3-26.5-8-37.3l-3.9-5.5 0-81.6c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 14.4-52.9-74.1C496 86.5 452.4 64 405.9 64L272 64l-16 0-64 0-48 0C77.7 64 24 117.7 24 184l0 54C9.4 249.8 0 267.8 0 288l0 17.6c0 8 6.4 14.4 14.4 14.4C46.2 320 72 294.2 72 262.4l0-6.4 0-32 0-40c0-24.3 12.1-45.8 30.5-58.9C98.3 135.9 96 147.7 96 160l0 64zM560 336a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM166.6 166.6c-4.2-4.2-6.6-10-6.6-16c0-12.5 10.1-22.6 22.6-22.6l178.7 0c12.5 0 22.6 10.1 22.6 22.6c0 6-2.4 11.8-6.6 16l-23.4 23.4C332.2 211.8 302.7 224 272 224s-60.2-12.2-81.9-33.9l-23.4-23.4z"]
};
const faCaretUp = {
  prefix: 'fas',
  iconName: 'caret-up',
  icon: [320, 512, [], "f0d8", "M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]
};
const faScrewdriver = {
  prefix: 'fas',
  iconName: 'screwdriver',
  icon: [512, 512, [129691], "f54a", "M465 7c-8.5-8.5-22-9.4-31.6-2.1l-104 80c-5.9 4.5-9.4 11.6-9.4 19l0 54.1-85.6 85.6c6.7 4.2 13 9.3 18.8 15.1s10.9 12.2 15.1 18.8L353.9 192l54.1 0c7.5 0 14.5-3.5 19-9.4l80-104c7.4-9.6 6.5-23.1-2.1-31.6L465 7zM121.4 281.4l-112 112c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l112-112c30.2-30.2 30.2-79.1 0-109.3s-79.1-30.2-109.3 0z"]
};
const faFolderClosed = {
  prefix: 'fas',
  iconName: 'folder-closed',
  icon: [512, 512, [], "e185", "M448 480L64 480c-35.3 0-64-28.7-64-64L0 192l512 0 0 224c0 35.3-28.7 64-64 64zm64-320L0 160 0 96C0 60.7 28.7 32 64 32l128 0c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8l160 0c35.3 0 64 28.7 64 64z"]
};
const faHouseTsunami = {
  prefix: 'fas',
  iconName: 'house-tsunami',
  icon: [576, 512, [], "e515", "M80.8 136.5C104.9 93.8 152.6 64 209 64c16.9 0 33.1 2.7 48.2 7.7c16.8 5.5 34.9-3.6 40.4-20.4s-3.6-34.9-20.4-40.4C255.8 3.8 232.8 0 209 0C95.2 0 0 88 0 200c0 91.6 53.5 172.1 142.2 194.1c13.4 3.8 27.5 5.9 42.2 5.9c.7 0 1.4 0 2.1-.1c1.8 0 3.7 .1 5.5 .1c0 0 0 0 0 0c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.5-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 325.2 410.9 336 384 336c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0c-22.4 15.5-49.9 26.1-77.4 26.1c0 0-.1 0-.1 0c-12.4 0-24-1.5-34.9-4.3C121.6 320.2 96 287 96 248c0-48.5 39.5-88 88.4-88c13.5 0 26.1 3 37.5 8.3c16 7.5 35.1 .6 42.5-15.5s.6-35.1-15.5-42.5C229.3 101.1 207.4 96 184.4 96c-40 0-76.4 15.4-103.6 40.5zm252-18.1c-8.1 6-12.8 15.5-12.8 25.6l0 121c1.6 1 3.3 2 4.8 3.1c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.3 78.1 3.4c10.6 8.8 24.2 15.6 37.3 18.6c5.8 1.4 11.2 3.4 16.2 6.2c.7-2.7 1.1-5.5 1.1-8.4l-.4-144c0-10-4.7-19.4-12.7-25.5l-95.5-72c-11.4-8.6-27.1-8.6-38.5 0l-96 72zM384 448c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 437.2 410.9 448 384 448z"]
};
const faSquareNfi = {
  prefix: 'fas',
  iconName: 'square-nfi',
  icon: [448, 512, [], "e576", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm75.7 64.6C68.8 162.5 64 168.8 64 176l0 160c0 8.8 7.2 16 16 16s16-7.2 16-16l0-102.2 66.3 110.5c3.7 6.2 11.1 9.1 18 7.2s11.7-8.2 11.7-15.4l0-160c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 102.2L93.7 167.8c-3.7-6.2-11.1-9.1-18-7.2zM224 176l0 64 0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0 0-32 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zm160 0c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 160c0 8.8 7.2 16 16 16s16-7.2 16-16l0-160z"]
};
const faArrowUpFromGroundWater = {
  prefix: 'fas',
  iconName: 'arrow-up-from-ground-water',
  icon: [576, 512, [], "e4b5", "M288 352c17.7 0 32-14.3 32-32l0-210.7 25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-80-80c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L256 109.3 256 320c0 17.7 14.3 32 32 32zm-18.5 69.9C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 437.2 410.9 448 384 448c-27.5 0-55-10.6-77.5-26.1c-11.1-7.9-25.9-7.9-37 0zM192 192L48 192c-26.5 0-48 21.5-48 48L0 425c5.3-3.1 11.2-5.4 17.5-6.9c13.1-3.1 26.7-9.8 37.3-18.6c22.2-18.7 54.3-20.1 78.1-3.4c18 12.4 40.1 20.3 59.1 20.3L192 192zm384 48c0-26.5-21.5-48-48-48l-144 0 0 224.5s0 0 0 0c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.4 78.1 3.4c10.6 8.8 24.2 15.6 37.3 18.6c6.3 1.5 12.1 3.8 17.5 6.9l0-185z"]
};
const faMartiniGlass = {
  prefix: 'fas',
  iconName: 'martini-glass',
  icon: [512, 512, [127864, "glass-martini-alt"], "f57b", "M32 0C19.1 0 7.4 7.8 2.4 19.8s-2.2 25.7 6.9 34.9L224 269.3 224 448l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-178.7L502.6 54.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 0 480 0L32 0zM173.3 128l-64-64 293.5 0-64 64-165.5 0z"]
};
const faGlassMartiniAlt = faMartiniGlass;
const faSquareBinary = {
  prefix: 'fas',
  iconName: 'square-binary',
  icon: [448, 512, [], "e69b", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm144 4c-24.3 0-44 19.7-44 44l0 48c0 24.3 19.7 44 44 44l32 0c24.3 0 44-19.7 44-44l0-48c0-24.3-19.7-44-44-44l-32 0zm-4 44c0-2.2 1.8-4 4-4l32 0c2.2 0 4 1.8 4 4l0 48c0 2.2-1.8 4-4 4l-32 0c-2.2 0-4-1.8-4-4l0-48zm140-44c-11 0-20 9-20 20c0 9.7 6.9 17.7 16 19.6l0 76.4c0 11 9 20 20 20s20-9 20-20l0-96c0-11-9-20-20-20l-16 0zM132 296c0 9.7 6.9 17.7 16 19.6l0 76.4c0 11 9 20 20 20s20-9 20-20l0-96c0-11-9-20-20-20l-16 0c-11 0-20 9-20 20zm96 24l0 48c0 24.3 19.7 44 44 44l32 0c24.3 0 44-19.7 44-44l0-48c0-24.3-19.7-44-44-44l-32 0c-24.3 0-44 19.7-44 44zm44-4l32 0c2.2 0 4 1.8 4 4l0 48c0 2.2-1.8 4-4 4l-32 0c-2.2 0-4-1.8-4-4l0-48c0-2.2 1.8-4 4-4z"]
};
const faRotateLeft = {
  prefix: 'fas',
  iconName: 'rotate-left',
  icon: [512, 512, ["rotate-back", "rotate-backward", "undo-alt"], "f2ea", "M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"]
};
const faRotateBack = faRotateLeft;
const faRotateBackward = faRotateLeft;
const faUndoAlt = faRotateLeft;
const faTableColumns = {
  prefix: 'fas',
  iconName: 'table-columns',
  icon: [512, 512, ["columns"], "f0db", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 160 0 0-256L64 160zm384 0l-160 0 0 256 160 0 0-256z"]
};
const faColumns = faTableColumns;
const faLemon = {
  prefix: 'fas',
  iconName: 'lemon',
  icon: [448, 512, [127819], "f094", "M448 96c0-35.3-28.7-64-64-64c-6.6 0-13 1-19 2.9c-22.5 7-48.1 14.9-71 9c-75.2-19.1-156.4 11-213.7 68.3S-7.2 250.8 11.9 326c5.8 22.9-2 48.4-9 71C1 403 0 409.4 0 416c0 35.3 28.7 64 64 64c6.6 0 13-1 19.1-2.9c22.5-7 48.1-14.9 71-9c75.2 19.1 156.4-11 213.7-68.3s87.5-138.5 68.3-213.7c-5.8-22.9 2-48.4 9-71c1.9-6 2.9-12.4 2.9-19.1zM212.5 127.4c-54.6 16-101.1 62.5-117.1 117.1C92.9 253 84 257.8 75.5 255.4S62.2 244 64.6 235.5c19.1-65.1 73.7-119.8 138.9-138.9c8.5-2.5 17.4 2.4 19.9 10.9s-2.4 17.4-10.9 19.9z"]
};
const faHeadSideMask = {
  prefix: 'fas',
  iconName: 'head-side-mask',
  icon: [576, 512, [], "e063", "M32 224.2c0-22.2 3.2-43.6 9.2-63.9L262.2 321c-4 9.5-6.2 20-6.2 31l0 160-128 0c-17.7 0-32-14.3-32-32l0-72.7c0-16.7-6.9-32.5-17.1-45.8C48.6 322.4 32 274.1 32 224.2zm248.3 70.4L53 129.3C88.7 53 166.2 0 256 0l24 0c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c5.4 6.7 8.6 14.8 9.4 23.2L336 272c-21.7 0-41.3 8.6-55.7 22.6zM336 304l198 0s0 0 0 0l10 0-19.7 64L368 368c-8.8 0-16 7.2-16 16s7.2 16 16 16l146.5 0-9.8 32L368 432c-8.8 0-16 7.2-16 16s7.2 16 16 16l126.8 0-.9 2.8c-8.3 26.9-33.1 45.2-61.2 45.2L288 512l0-160c0-14 6-26.7 15.6-35.4c0 0 0 0 0 0c8.5-7.8 19.9-12.6 32.4-12.6zm48-80a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faHandshake = {
  prefix: 'fas',
  iconName: 'handshake',
  icon: [640, 512, [], "f2b5", "M323.4 85.2l-96.8 78.4c-16.1 13-19.2 36.4-7 53.1c12.9 17.8 38 21.3 55.3 7.8l99.3-77.2c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L512 316.8 512 128l-.7 0-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2zm22.8 124.4l-51.7 40.2C263 274.4 217.3 268 193.7 235.6c-22.2-30.5-16.6-73.1 12.7-96.8l83.2-67.3c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-72 48 0 224 28.2 0 91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c4.5-4.9 7.8-10.6 9.9-16.5c19.4 13 45.8 10.3 62.1-7.5c17.9-19.5 16.6-49.9-2.9-67.8l-134.2-123zM16 128c-8.8 0-16 7.2-16 16L0 352c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-224-80 0zM48 320a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM544 128l0 224c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-208c0-8.8-7.2-16-16-16l-80 0zm32 208a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faGem = {
  prefix: 'fas',
  iconName: 'gem',
  icon: [512, 512, [128142], "f3a5", "M116.7 33.8c4.5-6.1 11.7-9.8 19.3-9.8l240 0c7.6 0 14.8 3.6 19.3 9.8l112 152c6.8 9.2 6.1 21.9-1.5 30.4l-232 256c-4.5 5-11 7.9-17.8 7.9s-13.2-2.9-17.8-7.9l-232-256c-7.7-8.5-8.3-21.2-1.5-30.4l112-152zm38.5 39.8c-3.3 2.5-4.2 7-2.1 10.5l57.4 95.6L63.3 192c-4.1 .3-7.3 3.8-7.3 8s3.2 7.6 7.3 8l192 16c.4 0 .9 0 1.3 0l192-16c4.1-.3 7.3-3.8 7.3-8s-3.2-7.6-7.3-8L301.5 179.8l57.4-95.6c2.1-3.5 1.2-8.1-2.1-10.5s-7.9-2-10.7 1L256 172.2 165.9 74.6c-2.8-3-7.4-3.4-10.7-1z"]
};
const faDolly = {
  prefix: 'fas',
  iconName: 'dolly',
  icon: [576, 512, ["dolly-box"], "f472", "M0 32C0 14.3 14.3 0 32 0l72.9 0c27.5 0 52 17.6 60.7 43.8L257.7 320c30.1 .5 56.8 14.9 74 37l202.1-67.4c16.8-5.6 34.9 3.5 40.5 20.2s-3.5 34.9-20.2 40.5L352 417.7c-.9 52.2-43.5 94.3-96 94.3c-53 0-96-43-96-96c0-30.8 14.5-58.2 37-75.8L104.9 64 32 64C14.3 64 0 49.7 0 32zM244.8 134.5c-5.5-16.8 3.7-34.9 20.5-40.3L311 79.4l19.8 60.9 60.9-19.8L371.8 59.6l45.7-14.8c16.8-5.5 34.9 3.7 40.3 20.5l49.4 152.2c5.5 16.8-3.7 34.9-20.5 40.3L334.5 307.2c-16.8 5.5-34.9-3.7-40.3-20.5L244.8 134.5z"]
};
const faDollyBox = faDolly;
const faSmoking = {
  prefix: 'fas',
  iconName: 'smoking',
  icon: [640, 512, [128684], "f48d", "M448 32l0 11c0 38.2 15.2 74.8 42.2 101.8l21 21c21 21 32.8 49.5 32.8 79.2l0 11c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-11c0-12.7-5.1-24.9-14.1-33.9l-21-21C405.9 151.1 384 98.1 384 43l0-11c0-17.7 14.3-32 32-32s32 14.3 32 32zM576 256l0-11c0-38.2-15.2-74.8-42.2-101.8l-21-21c-21-21-32.8-49.5-32.8-79.2l0-11c0-17.7 14.3-32 32-32s32 14.3 32 32l0 11c0 12.7 5.1 24.9 14.1 33.9l21 21c39 39 60.9 91.9 60.9 147.1l0 11c0 17.7-14.3 32-32 32s-32-14.3-32-32zM0 416c0-35.3 28.7-64 64-64l352 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32L64 512c-35.3 0-64-28.7-64-64l0-32zm224 0l0 32 160 0 0-32-160 0zm288-64c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32z"]
};
const faMinimize = {
  prefix: 'fas',
  iconName: 'minimize',
  icon: [512, 512, ["compress-arrows-alt"], "f78c", "M456 224l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l40 40L442.3 5.7C446 2 450.9 0 456 0s10 2 13.7 5.7l36.7 36.7C510 46 512 50.9 512 56s-2 10-5.7 13.7L433 143l40 40c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8zm0 64c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-40 40 73.4 73.4c3.6 3.6 5.7 8.5 5.7 13.7s-2 10-5.7 13.7l-36.7 36.7C466 510 461.1 512 456 512s-10-2-13.7-5.7L369 433l-40 40c-6.9 6.9-17.2 8.9-26.2 5.2s-14.8-12.5-14.8-22.2l0-144c0-13.3 10.7-24 24-24l144 0zm-256 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-40-40L69.7 506.3C66 510 61.1 512 56 512s-10-2-13.7-5.7L5.7 469.7C2 466 0 461.1 0 456s2-10 5.7-13.7L79 369 39 329c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8l144 0zM56 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l40-40L5.7 69.7C2 66 0 61.1 0 56s2-10 5.7-13.7L42.3 5.7C46 2 50.9 0 56 0s10 2 13.7 5.7L143 79l40-40c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 144c0 13.3-10.7 24-24 24L56 224z"]
};
const faCompressArrowsAlt = faMinimize;
const faMonument = {
  prefix: 'fas',
  iconName: 'monument',
  icon: [384, 512, [], "f5a6", "M180.7 4.7c6.2-6.2 16.4-6.2 22.6 0l80 80c2.5 2.5 4.1 5.8 4.6 9.3l40.2 322L55.9 416 96.1 94c.4-3.5 2-6.8 4.6-9.3l80-80zM152 272c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zM32 448l320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faSnowplow = {
  prefix: 'fas',
  iconName: 'snowplow',
  icon: [640, 512, [], "f7d2", "M298.9 64l68.6 160L256 224l-64-64 0-96 106.9 0zM445.1 242.7l-87.4-204C347.6 15.3 324.5 0 298.9 0L176 0c-26.5 0-48 21.5-48 48l0 112-32 0c-17.7 0-32 14.3-32 32l0 106.8C26.2 316.8 0 355.3 0 400c0 61.9 50.1 112 112 112l256 0c61.9 0 112-50.1 112-112c0-17.2-3.9-33.5-10.8-48l42.8 0 0 50.7c0 17 6.7 33.3 18.7 45.3l54.6 54.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L576 402.7l0-82.7 0-84.8L633 164c11-13.8 8.8-33.9-5-45s-33.9-8.8-45 5l-57 71.2c-9.1 11.3-14 25.4-14 40l0 52.8-64 0 0-31.3c.1-2.4-.2-4.8-.6-7.1s-1.2-4.7-2.2-6.8zM368 352c26.5 0 48 21.5 48 48s-21.5 48-48 48l-256 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l256 0zM144 400a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm216 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm-56-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM200 424a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faAnglesRight = {
  prefix: 'fas',
  iconName: 'angles-right',
  icon: [512, 512, [187, "angle-double-right"], "f101", "M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"]
};
const faAngleDoubleRight = faAnglesRight;
const faCannabis = {
  prefix: 'fas',
  iconName: 'cannabis',
  icon: [512, 512, [], "f55f", "M256 0c5.3 0 10.3 2.7 13.3 7.1c15.8 23.5 36.7 63.7 49.2 109c7.2 26.4 11.8 55.2 10.4 84c11.5-8.8 23.7-16.7 35.8-23.6c41-23.3 84.4-36.9 112.2-42.5c5.2-1 10.7 .6 14.4 4.4s5.4 9.2 4.4 14.5c-5.6 27.7-19.3 70.9-42.7 111.7c-9.1 15.9-19.9 31.7-32.4 46.3c27.8 6.6 52.4 17.3 67.2 25.5c5.1 2.8 8.2 8.2 8.2 14s-3.2 11.2-8.2 14c-15.2 8.4-40.9 19.5-69.8 26.1c-20.2 4.6-42.9 7.2-65.2 4.6l8.3 33.1c1.5 6.1-.6 12.4-5.5 16.4s-11.6 4.6-17.2 1.9L280 417.2l0 70.8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-70.8-58.5 29.1c-5.6 2.8-12.3 2.1-17.2-1.9s-7-10.3-5.5-16.4l8.3-33.1c-22.2 2.6-45 0-65.2-4.6c-28.9-6.6-54.6-17.6-69.8-26.1c-5.1-2.8-8.2-8.2-8.2-14s3.2-11.2 8.2-14c14.8-8.2 39.4-18.8 67.2-25.5C78.9 296.3 68.1 280.5 59 264.6c-23.4-40.8-37.1-84-42.7-111.7c-1.1-5.2 .6-10.7 4.4-14.5s9.2-5.4 14.4-4.4c27.9 5.5 71.2 19.2 112.2 42.5c12.1 6.9 24.3 14.7 35.8 23.6c-1.4-28.7 3.1-57.6 10.4-84c12.5-45.3 33.4-85.5 49.2-109c3-4.4 8-7.1 13.3-7.1z"]
};
const faCirclePlay = {
  prefix: 'fas',
  iconName: 'circle-play',
  icon: [512, 512, [61469, "play-circle"], "f144", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"]
};
const faPlayCircle = faCirclePlay;
const faTablets = {
  prefix: 'fas',
  iconName: 'tablets',
  icon: [640, 512, [], "f490", "M614.3 247c-5.2 7.9-16.2 8.5-22.9 1.8L391.2 48.6c-6.7-6.7-6.2-17.8 1.8-22.9C418.1 9.4 447.9 0 480 0c88.4 0 160 71.6 160 160c0 32.1-9.4 61.9-25.7 87zM567 294.3c-25 16.3-54.9 25.7-87 25.7c-88.4 0-160-71.6-160-160c0-32.1 9.4-61.9 25.7-87c5.2-7.9 16.2-8.5 22.9-1.8L568.8 271.4c6.7 6.7 6.2 17.8-1.8 22.9zM301.5 368c9.5 0 16.9 8.2 15 17.5C301.1 457.8 236.9 512 160 512S18.9 457.8 3.5 385.5c-2-9.3 5.5-17.5 15-17.5l283.1 0zm0-32L18.5 336c-9.5 0-16.9-8.2-15-17.5C18.9 246.2 83.1 192 160 192s141.1 54.2 156.5 126.5c2 9.3-5.5 17.5-15 17.5z"]
};
const faEthernet = {
  prefix: 'fas',
  iconName: 'ethernet',
  icon: [512, 512, [], "f796", "M0 224L0 416c0 17.7 14.3 32 32 32l64 0 0-112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112 64 0 0-112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112 64 0 0-112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112 64 0 0-112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112 64 0c17.7 0 32-14.3 32-32l0-192c0-17.7-14.3-32-32-32l-32 0 0-32c0-17.7-14.3-32-32-32l-32 0 0-32c0-17.7-14.3-32-32-32L160 64c-17.7 0-32 14.3-32 32l0 32-32 0c-17.7 0-32 14.3-32 32l0 32-32 0c-17.7 0-32 14.3-32 32z"]
};
const faEuroSign = {
  prefix: 'fas',
  iconName: 'euro-sign',
  icon: [320, 512, [8364, "eur", "euro"], "f153", "M48.1 240c-.1 2.7-.1 5.3-.1 8l0 16c0 2.7 0 5.3 .1 8L32 272c-17.7 0-32 14.3-32 32s14.3 32 32 32l28.3 0C89.9 419.9 170 480 264 480l24 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-24 0c-57.9 0-108.2-32.4-133.9-80L256 336c17.7 0 32-14.3 32-32s-14.3-32-32-32l-143.8 0c-.1-2.6-.2-5.3-.2-8l0-16c0-2.7 .1-5.4 .2-8L256 240c17.7 0 32-14.3 32-32s-14.3-32-32-32l-125.9 0c25.7-47.6 76-80 133.9-80l24 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-24 0C170 32 89.9 92.1 60.3 176L32 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l16.1 0z"]
};
const faEur = faEuroSign;
const faEuro = faEuroSign;
const faChair = {
  prefix: 'fas',
  iconName: 'chair',
  icon: [448, 512, [129681], "f6c0", "M248 48l0 208 48 0 0-197.3c23.9 13.8 40 39.7 40 69.3l0 128 48 0 0-128C384 57.3 326.7 0 256 0L192 0C121.3 0 64 57.3 64 128l0 128 48 0 0-128c0-29.6 16.1-55.5 40-69.3L152 256l48 0 0-208 48 0zM48 288c-12.1 0-23.2 6.8-28.6 17.7l-16 32c-5 9.9-4.4 21.7 1.4 31.1S20.9 384 32 384l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 256 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c11.1 0 21.4-5.7 27.2-15.2s6.4-21.2 1.4-31.1l-16-32C423.2 294.8 412.1 288 400 288L48 288z"]
};
const faCircleCheck = {
  prefix: 'fas',
  iconName: 'circle-check',
  icon: [512, 512, [61533, "check-circle"], "f058", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faCheckCircle = faCircleCheck;
const faCircleStop = {
  prefix: 'fas',
  iconName: 'circle-stop',
  icon: [512, 512, [62094, "stop-circle"], "f28d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 160l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z"]
};
const faStopCircle = faCircleStop;
const faCompassDrafting = {
  prefix: 'fas',
  iconName: 'compass-drafting',
  icon: [512, 512, ["drafting-compass"], "f568", "M352 96c0 14.3-3.1 27.9-8.8 40.2L396 227.4c-23.7 25.3-54.2 44.1-88.5 53.6L256 192c0 0 0 0 0 0s0 0 0 0l-68 117.5c21.5 6.8 44.3 10.5 68.1 10.5c70.7 0 133.8-32.7 174.9-84c11.1-13.8 31.2-16 45-5s16 31.2 5 45C428.1 341.8 347 384 256 384c-35.4 0-69.4-6.4-100.7-18.1L98.7 463.7C94 471.8 87 478.4 78.6 482.6L23.2 510.3c-5 2.5-10.9 2.2-15.6-.7S0 501.5 0 496l0-55.4c0-8.4 2.2-16.7 6.5-24.1l60-103.7C53.7 301.6 41.8 289.3 31.2 276c-11.1-13.8-8.8-33.9 5-45s33.9-8.8 45 5c5.7 7.1 11.8 13.8 18.2 20.1l69.4-119.9c-5.6-12.2-8.8-25.8-8.8-40.2c0-53 43-96 96-96s96 43 96 96zm21 297.9c32.6-12.8 62.5-30.8 88.9-52.9l43.7 75.5c4.2 7.3 6.5 15.6 6.5 24.1l0 55.4c0 5.5-2.9 10.7-7.6 13.6s-10.6 3.2-15.6 .7l-55.4-27.7c-8.4-4.2-15.4-10.8-20.1-18.9L373 393.9zM256 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faDraftingCompass = faCompassDrafting;
const faPlateWheat = {
  prefix: 'fas',
  iconName: 'plate-wheat',
  icon: [512, 512, [], "e55a", "M176 32c44.2 0 80 35.8 80 80l0 16c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80l0-16c0-8.8 7.2-16 16-16zM56 64l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM24 136l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 96c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zM272 48c0-8.8 7.2-16 16-16c44.2 0 80 35.8 80 80l0 16c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80l0-16zM400 32c44.2 0 80 35.8 80 80l0 16c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80l0-16c0-8.8 7.2-16 16-16zm80 160l0 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM352 176c8.8 0 16 7.2 16 16l0 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80zm-96 16l0 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM3.5 347.6C1.6 332.9 13 320 27.8 320l456.4 0c14.8 0 26.2 12.9 24.4 27.6C502.3 397.8 464.2 437 416 446l0 2c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-2c-48.2-9-86.3-48.2-92.5-98.4z"]
};
const faIcicles = {
  prefix: 'fas',
  iconName: 'icicles',
  icon: [512, 512, [], "f7ad", "M75.8 304.8L1 35.7c-.7-2.5-1-5-1-7.5C0 12.6 12.6 0 28.2 0H482.4C498.8 0 512 13.2 512 29.6c0 1.6-.1 3.3-.4 4.9L434.6 496.1c-1.5 9.2-9.5 15.9-18.8 15.9c-9.2 0-17.1-6.6-18.7-15.6L336 160 307.2 303.9c-1.9 9.3-10.1 16.1-19.6 16.1c-9.2 0-17.2-6.2-19.4-15.1L240 192 210.6 368.2c-1.5 9.1-9.4 15.8-18.6 15.8s-17.1-6.7-18.6-15.8L144 192 115.9 304.3c-2.3 9.2-10.6 15.7-20.1 15.7c-9.3 0-17.5-6.2-20-15.2z"]
};
const faPersonShelter = {
  prefix: 'fas',
  iconName: 'person-shelter',
  icon: [512, 512, [], "e54f", "M271.9 4.2c-9.8-5.6-21.9-5.6-31.8 0l-224 128C6.2 137.9 0 148.5 0 160L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.4L256 68.9 448 178.6 448 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-11.5-6.2-22.1-16.1-27.8l-224-128zM256 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zm-8 280l0-88 16 0 0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-174.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3l-37.9 70.3c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L200 313.5 200 488c0 13.3 10.7 24 24 24s24-10.7 24-24z"]
};
const faNeuter = {
  prefix: 'fas',
  iconName: 'neuter',
  icon: [384, 512, [9906], "f22c", "M80 176a112 112 0 1 1 224 0A112 112 0 1 1 80 176zM224 349.1c81.9-15 144-86.8 144-173.1C368 78.8 289.2 0 192 0S16 78.8 16 176c0 86.3 62.1 158.1 144 173.1L160 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-130.9z"]
};
const faIdBadge = {
  prefix: 'fas',
  iconName: 'id-badge',
  icon: [384, 512, [], "f2c1", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zm96 320l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L96 416c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM144 64l96 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faMarker = {
  prefix: 'fas',
  iconName: 'marker',
  icon: [512, 512, [], "f5a1", "M481 31C445.1-4.8 386.9-4.8 351 31l-15 15L322.9 33C294.8 4.9 249.2 4.9 221.1 33L135 119c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L255 66.9c9.4-9.4 24.6-9.4 33.9 0L302.1 80 186.3 195.7 316.3 325.7 481 161c35.9-35.9 35.9-94.1 0-129.9zM293.7 348.3L163.7 218.3 99.5 282.5c-48 48-80.8 109.2-94.1 175.8l-5 25c-1.6 7.9 .9 16 6.6 21.7s13.8 8.1 21.7 6.6l25-5c66.6-13.3 127.8-46.1 175.8-94.1l64.2-64.2z"]
};
const faFaceLaughBeam = {
  prefix: 'fas',
  iconName: 'face-laugh-beam',
  icon: [512, 512, [128513, "laugh-beam"], "f59a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1l275.2 0c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zM217.6 212.8s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faLaughBeam = faFaceLaughBeam;
const faHelicopterSymbol = {
  prefix: 'fas',
  iconName: 'helicopter-symbol',
  icon: [512, 512, [], "e502", "M445.3 224l64.7 0C495.6 108.2 403.8 16.4 288 2l0 64.7C368.4 80.1 431.9 143.6 445.3 224zM510 288l-64.7 0C431.9 368.4 368.4 431.9 288 445.3l0 64.7c115.8-14.4 207.6-106.2 222-222zM2 288C16.4 403.8 108.2 495.6 224 510l0-64.7C143.6 431.9 80.1 368.4 66.7 288L2 288zm0-64l64.7 0C80.1 143.6 143.6 80.1 224 66.7L224 2C108.2 16.4 16.4 108.2 2 224zm206-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 96 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-96 0 0-64z"]
};
const faUniversalAccess = {
  prefix: 'fas',
  iconName: 'universal-access',
  icon: [512, 512, [], "f29a", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm161.5-86.1c-12.2-5.2-26.3 .4-31.5 12.6s.4 26.3 12.6 31.5l11.9 5.1c17.3 7.4 35.2 12.9 53.6 16.3l0 50.1c0 4.3-.7 8.6-2.1 12.6l-28.7 86.1c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l24.4-73.2c1.3-3.8 4.8-6.4 8.8-6.4s7.6 2.6 8.8 6.4l24.4 73.2c4.2 12.6 17.8 19.4 30.4 15.2s19.4-17.8 15.2-30.4l-28.7-86.1c-1.4-4.1-2.1-8.3-2.1-12.6l0-50.1c18.4-3.5 36.3-8.9 53.6-16.3l11.9-5.1c12.2-5.2 17.8-19.3 12.6-31.5s-19.3-17.8-31.5-12.6L338.7 175c-26.1 11.2-54.2 17-82.7 17s-56.5-5.8-82.7-17l-11.9-5.1zM256 160a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faCircleChevronUp = {
  prefix: 'fas',
  iconName: 'circle-chevron-up',
  icon: [512, 512, ["chevron-circle-up"], "f139", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM377 271c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-87-87-87 87c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 167c9.4-9.4 24.6-9.4 33.9 0L377 271z"]
};
const faChevronCircleUp = faCircleChevronUp;
const faLariSign = {
  prefix: 'fas',
  iconName: 'lari-sign',
  icon: [384, 512, [], "e1c8", "M144 32c17.7 0 32 14.3 32 32l0 32.7c5.3-.4 10.6-.7 16-.7s10.7 .2 16 .7L208 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 49.4c54.9 25.2 95.8 75.5 108.2 136.2c3.5 17.3-7.7 34.2-25 37.7s-34.2-7.7-37.7-25c-6.1-29.9-22.5-55.9-45.4-74.3l0 67.9c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-95c-5.2-.7-10.6-1-16-1s-10.8 .3-16 1l0 95c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-67.9C82.7 211.5 64 247.6 64 288c0 70.7 57.3 128 128 128l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l16.9 0C18.5 382 0 337.2 0 288c0-77.5 45.9-144.3 112-174.6L112 64c0-17.7 14.3-32 32-32z"]
};
const faVolcano = {
  prefix: 'fas',
  iconName: 'volcano',
  icon: [512, 512, [127755], "f770", "M160 144c-35.3 0-64-28.7-64-64s28.7-64 64-64c15.7 0 30 5.6 41.2 15C212.4 12.4 232.7 0 256 0s43.6 12.4 54.8 31C322 21.6 336.3 16 352 16c35.3 0 64 28.7 64 64s-28.7 64-64 64c-14.7 0-28.3-5-39.1-13.3l-32 48C275.3 187 266 192 256 192s-19.3-5-24.9-13.3l-32-48C188.3 139 174.7 144 160 144zM144 352l48.4-24.2c10.2-5.1 21.6-7.8 33-7.8c19.6 0 38.4 7.8 52.2 21.6l32.5 32.5c6.3 6.3 14.9 9.9 23.8 9.9c11.3 0 21.8-5.6 28-15l9.7-14.6-58.9-66.3c-9.1-10.2-22.2-16.1-35.9-16.1l-41.8 0c-13.7 0-26.8 5.9-35.9 16.1l-59.9 67.4L144 352zm19.4-95.8c18.2-20.5 44.3-32.2 71.8-32.2l41.8 0c27.4 0 53.5 11.7 71.8 32.2l150.2 169c8.5 9.5 13.2 21.9 13.2 34.7c0 28.8-23.4 52.2-52.2 52.2L52.2 512C23.4 512 0 488.6 0 459.8c0-12.8 4.7-25.1 13.2-34.7l150.2-169z"]
};
const faPersonWalkingDashedLineArrowRight = {
  prefix: 'fas',
  iconName: 'person-walking-dashed-line-arrow-right',
  icon: [640, 512, [], "e553", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224 384 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l146.7 0-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80zM392 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48c0-13.3-10.7-24-24-24zm24 152c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16zM392 320c-13.3 0-24 10.7-24 24l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16c0-13.3-10.7-24-24-24zm24 120c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48z"]
};
const faSterlingSign = {
  prefix: 'fas',
  iconName: 'sterling-sign',
  icon: [320, 512, [163, "gbp", "pound-sign"], "f154", "M112 160.4c0-35.5 28.8-64.4 64.4-64.4c6.9 0 13.8 1.1 20.4 3.3l81.2 27.1c16.8 5.6 34.9-3.5 40.5-20.2s-3.5-34.9-20.2-40.5L217 38.6c-13.1-4.4-26.8-6.6-40.6-6.6C105.5 32 48 89.5 48 160.4L48 224l-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 44.5c0 17.4-4.7 34.5-13.7 49.4L4.6 431.5c-5.9 9.9-6.1 22.2-.4 32.2S20.5 480 32 480l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L88.5 416l.7-1.1C104.1 390 112 361.5 112 332.5l0-44.5 112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0 0-63.6z"]
};
const faGbp = faSterlingSign;
const faPoundSign = faSterlingSign;
const faViruses = {
  prefix: 'fas',
  iconName: 'viruses',
  icon: [640, 512, [], "e076", "M192 0c13.3 0 24 10.7 24 24l0 13.5c0 35.6 43.1 53.5 68.3 28.3l9.5-9.5c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-9.5 9.5C293 124.9 310.9 168 346.5 168l13.5 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-13.5 0c-35.6 0-53.5 43.1-28.3 68.3l9.5 9.5c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-9.5-9.5C259.1 293 216 310.9 216 346.5l0 13.5c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-13.5c0-35.6-43.1-53.5-68.3-28.3l-9.5 9.5c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l9.5-9.5C91 259.1 73.1 216 37.5 216L24 216c-13.3 0-24-10.7-24-24s10.7-24 24-24l13.5 0c35.6 0 53.5-43.1 28.3-68.3l-9.5-9.5c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l9.5 9.5C124.9 91 168 73.1 168 37.5L168 24c0-13.3 10.7-24 24-24zm48 224a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-48-64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm320 80c0 33 39.9 49.5 63.2 26.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6C574.5 312.1 591 352 624 352c8.8 0 16 7.2 16 16s-7.2 16-16 16c-33 0-49.5 39.9-26.2 63.2c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0C551.9 446.5 512 463 512 496c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-33-39.9-49.5-63.2-26.2c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6C417.5 423.9 401 384 368 384c-8.8 0-16-7.2-16-16s7.2-16 16-16c33 0 49.5-39.9 26.2-63.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0C440.1 289.5 480 273 480 240c0-8.8 7.2-16 16-16s16 7.2 16 16zm0 112a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faSquarePersonConfined = {
  prefix: 'fas',
  iconName: 'square-person-confined',
  icon: [448, 512, [], "e577", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm96 112a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm80 104c0-30.9 25.1-56 56-56s56 25.1 56 56l0 102.1c0 36.4-29.5 65.9-65.9 65.9c-17.5 0-34.3-6.9-46.6-19.3L184.8 342l-28.1 56.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l48-96c4.6-9.2 13.3-15.6 23.5-17.3s20.5 1.7 27.8 9L240 306.7l0-58.7z"]
};
const faUserTie = {
  prefix: 'fas',
  iconName: 'user-tie',
  icon: [448, 512, [], "f508", "M96 128a128 128 0 1 0 256 0A128 128 0 1 0 96 128zm94.5 200.2l18.6 31L175.8 483.1l-36-146.9c-2-8.1-9.8-13.4-17.9-11.3C51.9 342.4 0 405.8 0 481.3c0 17 13.8 30.7 30.7 30.7l131.7 0c0 0 0 0 .1 0l5.5 0 112 0 5.5 0c0 0 0 0 .1 0l131.7 0c17 0 30.7-13.8 30.7-30.7c0-75.5-51.9-138.9-121.9-156.4c-8.1-2-15.9 3.3-17.9 11.3l-36 146.9L238.9 359.2l18.6-31c6.4-10.7-1.3-24.2-13.7-24.2L224 304l-19.7 0c-12.4 0-20.1 13.6-13.7 24.2z"]
};
const faArrowDownLong = {
  prefix: 'fas',
  iconName: 'arrow-down-long',
  icon: [384, 512, ["long-arrow-down"], "f175", "M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 402.7 224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 370.7L86.6 329.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128z"]
};
const faLongArrowDown = faArrowDownLong;
const faTentArrowDownToLine = {
  prefix: 'fas',
  iconName: 'tent-arrow-down-to-line',
  icon: [640, 512, [], "e57e", "M241.8 111.9c8.9 9.9 8.1 25-1.8 33.9l-80 72c-9.1 8.2-23 8.2-32.1 0l-80-72c-9.9-8.9-10.7-24-1.8-33.9s24-10.7 33.9-1.8l39.9 36L120 24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 122.1 39.9-36c9.9-8.9 25-8.1 33.9 1.8zm122.8 22.6c11.5-8.7 27.3-8.7 38.8 0l168 128c6.6 5 11 12.5 12.3 20.7l24 160 .7 4.7c17.5 .2 31.6 14.4 31.6 32c0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l127.6 0 .7-4.7 24-160c1.2-8.2 5.6-15.7 12.3-20.7l168-128zM384 448l80 0L402.7 325.5c-1.7-3.4-5.1-5.5-8.8-5.5c-5.5 0-9.9 4.4-9.9 9.9L384 448z"]
};
const faCertificate = {
  prefix: 'fas',
  iconName: 'certificate',
  icon: [512, 512, [], "f0a3", "M211 7.3C205 1 196-1.4 187.6 .8s-14.9 8.9-17.1 17.3L154.7 80.6l-62-17.5c-8.4-2.4-17.4 0-23.5 6.1s-8.5 15.1-6.1 23.5l17.5 62L18.1 170.6c-8.4 2.1-15 8.7-17.3 17.1S1 205 7.3 211l46.2 45L7.3 301C1 307-1.4 316 .8 324.4s8.9 14.9 17.3 17.1l62.5 15.8-17.5 62c-2.4 8.4 0 17.4 6.1 23.5s15.1 8.5 23.5 6.1l62-17.5 15.8 62.5c2.1 8.4 8.7 15 17.1 17.3s17.3-.2 23.4-6.4l45-46.2 45 46.2c6.1 6.2 15 8.7 23.4 6.4s14.9-8.9 17.1-17.3l15.8-62.5 62 17.5c8.4 2.4 17.4 0 23.5-6.1s8.5-15.1 6.1-23.5l-17.5-62 62.5-15.8c8.4-2.1 15-8.7 17.3-17.1s-.2-17.4-6.4-23.4l-46.2-45 46.2-45c6.2-6.1 8.7-15 6.4-23.4s-8.9-14.9-17.3-17.1l-62.5-15.8 17.5-62c2.4-8.4 0-17.4-6.1-23.5s-15.1-8.5-23.5-6.1l-62 17.5L341.4 18.1c-2.1-8.4-8.7-15-17.1-17.3S307 1 301 7.3L256 53.5 211 7.3z"]
};
const faReplyAll = {
  prefix: 'fas',
  iconName: 'reply-all',
  icon: [576, 512, ["mail-reply-all"], "f122", "M209.4 39.5c-9.1-9.6-24.3-10-33.9-.9L33.8 173.2c-19.9 18.9-19.9 50.7 0 69.6L175.5 377.4c9.6 9.1 24.8 8.7 33.9-.9s8.7-24.8-.9-33.9L66.8 208 208.5 73.4c9.6-9.1 10-24.3 .9-33.9zM352 64c0-12.6-7.4-24.1-19-29.2s-25-3-34.4 5.4l-160 144c-6.7 6.1-10.6 14.7-10.6 23.8s3.9 17.7 10.6 23.8l160 144c9.4 8.5 22.9 10.6 34.4 5.4s19-16.6 19-29.2l0-64 32 0c53 0 96 43 96 96c0 30.4-12.8 47.9-22.2 56.7c-5.5 5.1-9.8 12-9.8 19.5c0 10.9 8.8 19.7 19.7 19.7c2.8 0 5.6-.6 8.1-1.9C494.5 467.9 576 417.3 576 304c0-97.2-78.8-176-176-176l-48 0 0-64z"]
};
const faMailReplyAll = faReplyAll;
const faSuitcase = {
  prefix: 'fas',
  iconName: 'suitcase',
  icon: [512, 512, [129523], "f0f2", "M176 56l0 40 160 0 0-40c0-4.4-3.6-8-8-8L184 48c-4.4 0-8 3.6-8 8zM128 96l0-40c0-30.9 25.1-56 56-56L328 0c30.9 0 56 25.1 56 56l0 40 0 32 0 352-256 0 0-352 0-32zM64 96l32 0 0 384-32 0c-35.3 0-64-28.7-64-64L0 160c0-35.3 28.7-64 64-64zM448 480l-32 0 0-384 32 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64z"]
};
const faPersonSkating = {
  prefix: 'fas',
  iconName: 'person-skating',
  icon: [448, 512, ["skating"], "f7c5", "M352 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM128 128c0-17.7 14.3-32 32-32l159.4 0c43.6 0 64.6 53.4 32.8 83.1l-74.4 69.4 60.2 60.2c9 9 14.1 21.2 14.1 33.9l0 73.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-66.7-77.9-77.8c-26.6-26.6-24.6-70.3 4.3-94.4l20.4-17L160 160c-17.7 0-32-14.3-32-32zM81.4 353.4l86.9-86.9c4.6 10 11 19.3 19.3 27.5l21.8 21.8-82.7 82.7c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3zm322.5 95.1c8.6 2.1 13.8 10.8 11.6 19.4l-.4 1.7c-6.2 24.9-28.6 42.4-54.3 42.4L272 512c-8.8 0-16-7.2-16-16s7.2-16 16-16l88.8 0c11 0 20.6-7.5 23.3-18.2l.4-1.7c2.1-8.6 10.8-13.8 19.4-11.6zM135.2 478.3l-6.2 3.1c-21.6 10.8-47.6 6.6-64.6-10.5L4.7 411.3c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l59.6 59.6c7.3 7.3 18.5 9.1 27.7 4.5l6.2-3.1c7.9-4 17.5-.7 21.5 7.2s.7 17.5-7.2 21.5z"]
};
const faSkating = faPersonSkating;
const faFilterCircleDollar = {
  prefix: 'fas',
  iconName: 'filter-circle-dollar',
  icon: [576, 512, ["funnel-dollar"], "f662", "M3.9 22.9C10.5 8.9 24.5 0 40 0L472 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L396.4 195.6C316.2 212.1 256 283 256 368c0 27.4 6.3 53.4 17.5 76.5c-1.6-.8-3.2-1.8-4.7-2.9l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 65.3C-.7 53.4-2.8 36.8 3.9 22.9zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm120.8-32.6c.6-.9 1.8-2.1 4.2-3.4c5.1-2.7 12.5-4.1 18.7-4c8.2 .1 17.1 1.8 26.4 4.1c8.6 2.1 17.3-3.1 19.4-11.7s-3.1-17.3-11.7-19.4c-5.6-1.4-11.6-2.7-17.9-3.7l0-9.4c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 9.5c-6.1 1.2-12.3 3.2-18 6.3c-11.8 6.3-23 18.4-21.8 37.2c1 16 11.7 25.3 21.6 30.7c8.8 4.7 19.7 7.8 28.6 10.3l1.8 .5c10.3 2.9 17.9 5.2 23.2 8.3c4.5 2.7 4.7 4.2 4.7 5.6c.1 2.4-.5 3.7-1 4.5c-.6 1-1.8 2.2-4 3.3c-4.7 2.5-11.8 3.8-18.5 3.6c-9.5-.3-18.5-3.1-29.9-6.8c-1.9-.6-3.8-1.2-5.8-1.8c-8.4-2.6-17.4 2.1-20 10.5s2.1 17.4 10.5 20c1.6 .5 3.3 1 5 1.6c0 0 0 0 0 0s0 0 0 0c7 2.3 15.1 4.8 23.7 6.6l0 11.4c0 8.8 7.2 16 16 16s16-7.2 16-16l0-10.8c6.2-1.1 12.5-3.1 18.3-6.2c12.1-6.5 22.3-18.7 21.7-36.9c-.5-16.2-10.3-26.3-20.5-32.3c-9.4-5.6-21.2-8.9-30.5-11.5l-.2 0c-10.4-2.9-18.3-5.2-23.9-8.2c-4.8-2.6-4.8-4-4.8-4.5c0 0 0 0 0-.1c-.1-1.9 .3-2.9 .8-3.6z"]
};
const faFunnelDollar = faFilterCircleDollar;
const faCameraRetro = {
  prefix: 'fas',
  iconName: 'camera-retro',
  icon: [512, 512, [128247], "f083", "M220.6 121.2L271.1 96 448 96l0 96-114.8 0c-21.9-15.1-48.5-24-77.2-24s-55.2 8.9-77.2 24L64 192l0-64 128 0c9.9 0 19.7-2.3 28.6-6.8zM0 128L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L271.1 32c-9.9 0-19.7 2.3-28.6 6.8L192 64l-32 0 0-16c0-8.8-7.2-16-16-16L80 32c-8.8 0-16 7.2-16 16l0 16C28.7 64 0 92.7 0 128zM168 304a88 88 0 1 1 176 0 88 88 0 1 1 -176 0z"]
};
const faCircleArrowDown = {
  prefix: 'fas',
  iconName: 'circle-arrow-down',
  icon: [512, 512, ["arrow-circle-down"], "f0ab", "M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM127 297c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l71 71L232 120c0-13.3 10.7-24 24-24s24 10.7 24 24l0 214.1 71-71c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 409c-9.4 9.4-24.6 9.4-33.9 0L127 297z"]
};
const faArrowCircleDown = faCircleArrowDown;
const faFileImport = {
  prefix: 'fas',
  iconName: 'file-import',
  icon: [512, 512, ["arrow-right-to-file"], "f56f", "M128 64c0-35.3 28.7-64 64-64L352 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64l-256 0c-35.3 0-64-28.7-64-64l0-112 174.1 0-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39L128 288l0-224zm0 224l0 48L24 336c-13.3 0-24-10.7-24-24s10.7-24 24-24l104 0zM512 128l-128 0L384 0 512 128z"]
};
const faArrowRightToFile = faFileImport;
const faSquareArrowUpRight = {
  prefix: 'fas',
  iconName: 'square-arrow-up-right',
  icon: [448, 512, ["external-link-square"], "f14c", "M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM160 144c-13.3 0-24 10.7-24 24s10.7 24 24 24l94.1 0L119 327c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135L288 328c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24l-152 0z"]
};
const faExternalLinkSquare = faSquareArrowUpRight;
const faBoxOpen = {
  prefix: 'fas',
  iconName: 'box-open',
  icon: [640, 512, [], "f49e", "M58.9 42.1c3-6.1 9.6-9.6 16.3-8.7L320 64 564.8 33.4c6.7-.8 13.3 2.7 16.3 8.7l41.7 83.4c9 17.9-.6 39.6-19.8 45.1L439.6 217.3c-13.9 4-28.8-1.9-36.2-14.3L320 64 236.6 203c-7.4 12.4-22.3 18.3-36.2 14.3L37.1 170.6c-19.3-5.5-28.8-27.2-19.8-45.1L58.9 42.1zM321.1 128l54.9 91.4c14.9 24.8 44.6 36.6 72.5 28.6L576 211.6l0 167c0 22-15 41.2-36.4 46.6l-204.1 51c-10.2 2.6-20.9 2.6-31 0l-204.1-51C79 419.7 64 400.5 64 378.5l0-167L191.6 248c27.8 8 57.6-3.8 72.5-28.6L318.9 128l2.2 0z"]
};
const faScroll = {
  prefix: 'fas',
  iconName: 'scroll',
  icon: [576, 512, [128220], "f70e", "M0 80l0 48c0 17.7 14.3 32 32 32l16 0 48 0 0-80c0-26.5-21.5-48-48-48S0 53.5 0 80zM112 32c10 13.4 16 30 16 48l0 304c0 35.3 28.7 64 64 64s64-28.7 64-64l0-5.3c0-32.4 26.3-58.7 58.7-58.7L480 320l0-192c0-53-43-96-96-96L112 32zM464 480c61.9 0 112-50.1 112-112c0-8.8-7.2-16-16-16l-245.3 0c-14.7 0-26.7 11.9-26.7 26.7l0 5.3c0 53-43 96-96 96l176 0 96 0z"]
};
const faSpa = {
  prefix: 'fas',
  iconName: 'spa',
  icon: [576, 512, [], "f5bb", "M183.1 235.3c33.7 20.7 62.9 48.1 85.8 80.5c7 9.9 13.4 20.3 19.1 31c5.7-10.8 12.1-21.1 19.1-31c22.9-32.4 52.1-59.8 85.8-80.5C437.6 207.8 490.1 192 546 192l9.9 0c11.1 0 20.1 9 20.1 20.1C576 360.1 456.1 480 308.1 480L288 480l-20.1 0C119.9 480 0 360.1 0 212.1C0 201 9 192 20.1 192l9.9 0c55.9 0 108.4 15.8 153.1 43.3zM301.5 37.6c15.7 16.9 61.1 71.8 84.4 164.6c-38 21.6-71.4 50.8-97.9 85.6c-26.5-34.8-59.9-63.9-97.9-85.6c23.2-92.8 68.6-147.7 84.4-164.6C278 33.9 282.9 32 288 32s10 1.9 13.5 5.6z"]
};
const faLocationPinLock = {
  prefix: 'fas',
  iconName: 'location-pin-lock',
  icon: [512, 512, [], "e51f", "M215.7 499.2c11-13.8 25.1-31.7 40.3-52.3l0-94.8c0-23.7 12.9-44.4 32-55.4l0-24.6c0-55.6 40.5-101.7 93.6-110.5C367 70 287.7 0 192 0C86 0 0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM400 240c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faPause = {
  prefix: 'fas',
  iconName: 'pause',
  icon: [320, 512, [9208], "f04c", "M48 64C21.5 64 0 85.5 0 112L0 400c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48L48 64zm192 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-32 0z"]
};
const faHillAvalanche = {
  prefix: 'fas',
  iconName: 'hill-avalanche',
  icon: [576, 512, [], "e507", "M439.7 401.9c34.2 23.1 81.1 19.5 111.4-10.8c34.4-34.4 34.4-90.1 0-124.4c-27.8-27.8-69.5-33.1-102.6-16c-11.8 6.1-16.4 20.6-10.3 32.3s20.6 16.4 32.3 10.3c15.1-7.8 34-5.3 46.6 7.3c15.6 15.6 15.6 40.9 0 56.6s-40.9 15.6-56.6 0l-81.7-81.7C401.2 261.3 416 236.4 416 208c0-33.9-21.1-62.9-50.9-74.5c1.9-6.8 2.9-14 2.9-21.5c0-44.2-35.8-80-80-80c-27.3 0-51.5 13.7-65.9 34.6C216.3 46.6 197.9 32 176 32c-26.5 0-48 21.5-48 48c0 4 .5 7.9 1.4 11.6L439.7 401.9zM480 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM68.3 87C43.1 61.8 0 79.7 0 115.3L0 432c0 44.2 35.8 80 80 80l316.7 0c35.6 0 53.5-43.1 28.3-68.3L68.3 87z"]
};
const faTemperatureEmpty = {
  prefix: 'fas',
  iconName: 'temperature-empty',
  icon: [320, 512, ["temperature-0", "thermometer-0", "thermometer-empty"], "f2cb", "M112 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 164.5c0 17.3 7.1 31.9 15.3 42.5C233.8 332.6 240 349.5 240 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9c8.2-10.6 15.3-25.2 15.3-42.5L112 112zM160 0C98.1 0 48 50.2 48 112l0 164.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C27.2 304.2 16 334.8 16 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6L272 112C272 50.2 221.9 0 160 0zm0 416a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faTemperature0 = faTemperatureEmpty;
const faThermometer0 = faTemperatureEmpty;
const faThermometerEmpty = faTemperatureEmpty;
const faBomb = {
  prefix: 'fas',
  iconName: 'bomb',
  icon: [512, 512, [128163], "f1e2", "M459.1 52.4L442.6 6.5C440.7 2.6 436.5 0 432.1 0s-8.5 2.6-10.4 6.5L405.2 52.4l-46 16.8c-4.3 1.6-7.3 5.9-7.2 10.4c0 4.5 3 8.7 7.2 10.2l45.7 16.8 16.8 45.8c1.5 4.4 5.8 7.5 10.4 7.5s8.9-3.1 10.4-7.5l16.5-45.8 45.7-16.8c4.2-1.5 7.2-5.7 7.2-10.2c0-4.6-3-8.9-7.2-10.4L459.1 52.4zm-132.4 53c-12.5-12.5-32.8-12.5-45.3 0l-2.9 2.9C256.5 100.3 232.7 96 208 96C93.1 96 0 189.1 0 304S93.1 512 208 512s208-93.1 208-208c0-24.7-4.3-48.5-12.2-70.5l2.9-2.9c12.5-12.5 12.5-32.8 0-45.3l-80-80zM200 192c-57.4 0-104 46.6-104 104l0 8c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-8c0-75.1 60.9-136 136-136l8 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-8 0z"]
};
const faRegistered = {
  prefix: 'fas',
  iconName: 'registered',
  icon: [512, 512, [174], "f25d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM160 152c0-13.3 10.7-24 24-24l88 0c44.2 0 80 35.8 80 80c0 28-14.4 52.7-36.3 67l34.1 75.1c5.5 12.1 .1 26.3-11.9 31.8s-26.3 .1-31.8-11.9L268.9 288 208 288l0 72c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-96 0-112zm48 88l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0 64z"]
};
const faAddressCard = {
  prefix: 'fas',
  iconName: 'address-card',
  icon: [576, 512, [62140, "contact-card", "vcard"], "f2bb", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm80 256l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L80 384c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm256-32l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faContactCard = faAddressCard;
const faVcard = faAddressCard;
const faScaleUnbalancedFlip = {
  prefix: 'fas',
  iconName: 'scale-unbalanced-flip',
  icon: [640, 512, ["balance-scale-right"], "f516", "M117.9 62.4c-16.8-5.6-25.8-23.7-20.2-40.5s23.7-25.8 40.5-20.2l113 37.7C265 15.8 290.7 0 320 0c44.2 0 80 35.8 80 80c0 3-.2 5.9-.5 8.8l122.6 40.9c16.8 5.6 25.8 23.7 20.2 40.5s-23.7 25.8-40.5 20.2L366.4 145.2c-4.5 3.2-9.3 5.9-14.4 8.2L352 480c0 17.7-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0 0-294.7c-21-9.2-37.2-27-44.2-49l-125.9-42zM200.4 288L128 163.8 55.6 288l144.9 0zM128 384C65.1 384 12.8 350 2 305.1c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1C243.2 350 190.9 384 128 384zm382.8-92.2L438.4 416l144.9 0L510.8 291.8zm126 141.3C626 478 573.7 512 510.8 512s-115.2-34-126-78.9c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1z"]
};
const faBalanceScaleRight = faScaleUnbalancedFlip;
const faSubscript = {
  prefix: 'fas',
  iconName: 'subscript',
  icon: [512, 512, [], "f12c", "M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64zM480 320c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 361.5 404.3 368 416 368l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128z"]
};
const faDiamondTurnRight = {
  prefix: 'fas',
  iconName: 'diamond-turn-right',
  icon: [512, 512, ["directions"], "f5eb", "M227.7 11.7c15.6-15.6 40.9-15.6 56.6 0l216 216c15.6 15.6 15.6 40.9 0 56.6l-216 216c-15.6 15.6-40.9 15.6-56.6 0l-216-216c-15.6-15.6-15.6-40.9 0-56.6l216-216zm87.6 137c-4.6-4.6-11.5-5.9-17.4-3.5s-9.9 8.3-9.9 14.8l0 56-64 0c-35.3 0-64 28.7-64 64l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48c0-8.8 7.2-16 16-16l64 0 0 56c0 6.5 3.9 12.3 9.9 14.8s12.9 1.1 17.4-3.5l80-80c6.2-6.2 6.2-16.4 0-22.6l-80-80z"]
};
const faDirections = faDiamondTurnRight;
const faBurst = {
  prefix: 'fas',
  iconName: 'burst',
  icon: [512, 512, [], "e4dc", "M37.6 4.2C28-2.3 15.2-1.1 7 7s-9.4 21-2.8 30.5l112 163.3L16.6 233.2C6.7 236.4 0 245.6 0 256s6.7 19.6 16.6 22.8l103.1 33.4L66.8 412.8c-4.9 9.3-3.2 20.7 4.3 28.1s18.8 9.2 28.1 4.3l100.6-52.9 33.4 103.1c3.2 9.9 12.4 16.6 22.8 16.6s19.6-6.7 22.8-16.6l33.4-103.1 100.6 52.9c9.3 4.9 20.7 3.2 28.1-4.3s9.2-18.8 4.3-28.1L392.3 312.2l103.1-33.4c9.9-3.2 16.6-12.4 16.6-22.8s-6.7-19.6-16.6-22.8L388.9 198.7l25.7-70.4c3.2-8.8 1-18.6-5.6-25.2s-16.4-8.8-25.2-5.6l-70.4 25.7L278.8 16.6C275.6 6.7 266.4 0 256 0s-19.6 6.7-22.8 16.6l-32.3 99.6L37.6 4.2z"]
};
const faHouseLaptop = {
  prefix: 'fas',
  iconName: 'house-laptop',
  icon: [640, 512, ["laptop-house"], "e066", "M218.3 8.5c12.3-11.3 31.2-11.3 43.4 0l208 192c6.7 6.2 10.3 14.8 10.3 23.5l-144 0c-19.1 0-36.3 8.4-48 21.7l0-37.7c0-8.8-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l64 0 0 128-160 0c-26.5 0-48-21.5-48-48l0-112-32 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8.1-35.2l208-192zM352 304l0 144 192 0 0-144-192 0zm-48-16c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32l0 160 32 0c8.8 0 16 7.2 16 16c0 26.5-21.5 48-48 48l-48 0-192 0-48 0c-26.5 0-48-21.5-48-48c0-8.8 7.2-16 16-16l32 0 0-160z"]
};
const faLaptopHouse = faHouseLaptop;
const faFaceTired = {
  prefix: 'fas',
  iconName: 'face-tired',
  icon: [512, 512, [128555, "tired"], "f5c8", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.7 328.7c22-22 53.9-40.7 91.3-40.7s69.3 18.7 91.3 40.7c11.1 11.1 20.1 23.4 26.4 35.4c6.2 11.7 10.3 24.4 10.3 35.9c0 5.2-2.6 10.2-6.9 13.2s-9.8 3.7-14.7 1.8l-20.5-7.7c-26.9-10.1-55.5-15.3-84.3-15.3l-3.2 0c-28.8 0-57.3 5.2-84.3 15.3L149.6 415c-4.9 1.8-10.4 1.2-14.7-1.8s-6.9-7.9-6.9-13.2c0-11.6 4.2-24.2 10.3-35.9c6.3-12 15.3-24.3 26.4-35.4zm-31.2-182l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 157.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
};
const faTired = faFaceTired;
const faMoneyBills = {
  prefix: 'fas',
  iconName: 'money-bills',
  icon: [640, 512, [], "e1f3", "M96 96l0 224c0 35.3 28.7 64 64 64l416 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32c-35.3 0-64 28.7-64 64zm64 160c35.3 0 64 28.7 64 64l-64 0 0-64zM224 96c0 35.3-28.7 64-64 64l0-64 64 0zM576 256l0 64-64 0c0-35.3 28.7-64 64-64zM512 96l64 0 0 64c-35.3 0-64-28.7-64-64zM288 208a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 360c0 66.3 53.7 120 120 120l400 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-400 0c-39.8 0-72-32.2-72-72l0-240z"]
};
const faSmog = {
  prefix: 'fas',
  iconName: 'smog',
  icon: [640, 512, [], "f75f", "M32 144c0 79.5 64.5 144 144 144l123.3 0c22.6 19.9 52.2 32 84.7 32s62.1-12.1 84.7-32l27.3 0c61.9 0 112-50.1 112-112s-50.1-112-112-112c-10.7 0-21 1.5-30.8 4.3C443.8 27.7 401.1 0 352 0c-32.6 0-62.4 12.2-85.1 32.3C242.1 12.1 210.5 0 176 0C96.5 0 32 64.5 32 144zM616 368l-336 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24zm-64 96l-112 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24zm-192 0L24 464c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24zM224 392c0-13.3-10.7-24-24-24L96 368c-13.3 0-24 10.7-24 24s10.7 24 24 24l104 0c13.3 0 24-10.7 24-24z"]
};
const faCrutch = {
  prefix: 'fas',
  iconName: 'crutch',
  icon: [512, 512, [], "f7f7", "M297.4 9.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0zm-96 144l-34.8 34.8c-12.9 12.9-21.9 29.2-25.8 47.1L116.8 342.9c-1.3 5.9-4.3 11.4-8.6 15.7L9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l98.8-98.8c4.3-4.3 9.7-7.3 15.7-8.6l107.6-23.9c17.8-4 34.1-12.9 47.1-25.8l34.7-34.7c0 0 .1-.1 .1-.1s.1-.1 .1-.1l74.6-74.6-45.3-45.3L336 242.7 269.3 176l52.1-52.1L276.1 78.6l-74.7 74.7zM224 221.3L290.7 288l-12.2 12.2c-4.3 4.3-9.7 7.3-15.7 8.6l-76.7 17 17-76.7c1.3-5.9 4.3-11.4 8.6-15.7L224 221.3z"]
};
const faFontAwesome = {
  prefix: 'fas',
  iconName: 'font-awesome',
  icon: [512, 512, [62501, 62694, "font-awesome-flag", "font-awesome-logo-full"], "f2b4", "M91.7 96C106.3 86.8 116 70.5 116 52C116 23.3 92.7 0 64 0S12 23.3 12 52c0 16.7 7.8 31.5 20 41l0 3 0 352 0 64 64 0 0-64 373.6 0c14.6 0 26.4-11.8 26.4-26.4c0-3.7-.8-7.3-2.3-10.7L432 272l61.7-138.9c1.5-3.4 2.3-7 2.3-10.7c0-14.6-11.8-26.4-26.4-26.4L91.7 96z"]
};
const faFontAwesomeFlag = faFontAwesome;
const faFontAwesomeLogoFull = faFontAwesome;
const faCloudArrowUp = {
  prefix: 'fas',
  iconName: 'cloud-arrow-up',
  icon: [640, 512, [62338, "cloud-upload", "cloud-upload-alt"], "f0ee", "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-217c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39L296 392c0 13.3 10.7 24 24 24s24-10.7 24-24l0-134.1 39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0l-80 80z"]
};
const faCloudUpload = faCloudArrowUp;
const faCloudUploadAlt = faCloudArrowUp;
const faPalette = {
  prefix: 'fas',
  iconName: 'palette',
  icon: [512, 512, [127912], "f53f", "M512 256c0 .9 0 1.8 0 2.7c-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48c0 3.4 .4 6.7 1 9.9c2.1 10.2 6.5 20 10.8 29.9c6.1 13.8 12.1 27.5 12.1 42c0 31.8-21.6 60.7-53.4 62c-3.5 .1-7 .2-10.6 .2C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faArrowsTurnRight = {
  prefix: 'fas',
  iconName: 'arrows-turn-right',
  icon: [448, 512, [], "e4c0", "M297.4 9.4c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L338.7 160 128 160c-35.3 0-64 28.7-64 64l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32C0 153.3 57.3 96 128 96l210.7 0L297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3zm-96 256c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 416 96 416c-17.7 0-32 14.3-32 32l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-53 43-96 96-96l146.7 0-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3z"]
};
const faVest = {
  prefix: 'fas',
  iconName: 'vest',
  icon: [448, 512, [], "e085", "M207.1 237.4L151.2 69.7C168.6 79.7 192.6 88 224 88s55.4-8.3 72.8-18.3L226.5 280.6c-1.6 4.9-2.5 10-2.5 15.2L224 464c0 26.5 21.5 48 48 48l128 0c26.5 0 48-21.5 48-48l0-193.5c0-9.5-2.8-18.7-8.1-26.6l-47.9-71.8c-5.3-7.9-8.1-17.1-8.1-26.6l0-17.5 0-73.7 0-6.3c0-26.5-21.5-48-48-48l-4.5 0c-.2 0-.4 0-.6 0c-.4 0-.8 0-1.2 0C311 0 295.7 9.7 285.7 18.8C276.4 27.2 257.2 40 224 40s-52.4-12.8-61.7-21.2C152.3 9.7 137 0 118.3 0c-.4 0-.8 0-1.2 0c-.2 0-.4 0-.6 0L112 0C85.5 0 64 21.5 64 48l0 6.3L64 128l0 17.5c0 9.5-2.8 18.7-8.1 26.6L8.1 243.9C2.8 251.8 0 261.1 0 270.5L0 464c0 26.5 21.5 48 48 48l128 0c9.9 0 19-3 26.7-8.1C195.9 492.2 192 478.5 192 464l0-168.2c0-8.6 1.4-17.1 4.1-25.3l11-33.1zM347.3 356.7l48 48c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-48-48c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0zm-294.6 48l48-48c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-48 48c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6z"]
};
const faFerry = {
  prefix: 'fas',
  iconName: 'ferry',
  icon: [576, 512, [], "e4ea", "M224 0L352 0c17.7 0 32 14.3 32 32l75.1 0c20.6 0 31.6 24.3 18.1 39.8L456 96 120 96 98.8 71.8C85.3 56.3 96.3 32 116.9 32L192 32c0-17.7 14.3-32 32-32zM96 128l384 0c17.7 0 32 14.3 32 32l0 123.5c0 13.3-4.2 26.3-11.9 37.2l-51.4 71.9c-1.9 1.1-3.7 2.2-5.5 3.5c-15.5 10.7-34 18-51 19.9l-16.5 0c-17.1-1.8-35-9-50.8-19.9c-22.1-15.5-51.6-15.5-73.7 0c-14.8 10.2-32.5 18-50.6 19.9l-16.6 0c-17-1.8-35.6-9.2-51-19.9c-1.8-1.3-3.7-2.4-5.6-3.5L75.9 320.7C68.2 309.8 64 296.8 64 283.5L64 160c0-17.7 14.3-32 32-32zm32 64l0 96 320 0 0-96-320 0zM306.5 421.9C329 437.4 356.5 448 384 448c26.9 0 55.3-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 501.7 417 512 384 512c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 437.2 165.1 448 192 448c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faArrowsDownToPeople = {
  prefix: 'fas',
  iconName: 'arrows-down-to-people',
  icon: [640, 512, [], "e4b9", "M144 0c-13.3 0-24 10.7-24 24l0 118.1L97 119c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0l64-64c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-23 23L168 24c0-13.3-10.7-24-24-24zM360 200a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zM184 296a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm312 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM200 441.5l26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-36.3-67.5c1.7-1.7 3.2-3.6 4.3-5.8L264 345.5l0 54.5c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-54.5 26.9 49.9c1.2 2.2 2.6 4.1 4.3 5.8l-36.3 67.5c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L440 441.5l0 38.5c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-38.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-16.3 0-31.9 4.5-45.4 12.6l-33.6-62.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3l-33.6 62.3c-13.5-8.1-29.1-12.6-45.4-12.6l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3L18.9 468.6c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L88 441.5 88 480c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-38.5zM415 153l64 64c9.4 9.4 24.6 9.4 33.9 0l64-64c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-23 23L520 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 118.1-23-23c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z"]
};
const faSeedling = {
  prefix: 'fas',
  iconName: 'seedling',
  icon: [512, 512, [127793, "sprout"], "f4d8", "M512 32c0 113.6-84.6 207.5-194.2 222c-7.1-53.4-30.6-101.6-65.3-139.3C290.8 46.3 364 0 448 0l32 0c17.7 0 32 14.3 32 32zM0 96C0 78.3 14.3 64 32 64l32 0c123.7 0 224 100.3 224 224l0 32 0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160C100.3 320 0 219.7 0 96z"]
};
const faSprout = faSeedling;
const faLeftRight = {
  prefix: 'fas',
  iconName: 'left-right',
  icon: [512, 512, [8596, "arrows-alt-h"], "f337", "M504.3 273.6c4.9-4.5 7.7-10.9 7.7-17.6s-2.8-13-7.7-17.6l-112-104c-7-6.5-17.2-8.2-25.9-4.4s-14.4 12.5-14.4 22l0 56-192 0 0-56c0-9.5-5.7-18.2-14.4-22s-18.9-2.1-25.9 4.4l-112 104C2.8 243 0 249.3 0 256s2.8 13 7.7 17.6l112 104c7 6.5 17.2 8.2 25.9 4.4s14.4-12.5 14.4-22l0-56 192 0 0 56c0 9.5 5.7 18.2 14.4 22s18.9 2.1 25.9-4.4l112-104z"]
};
const faArrowsAltH = faLeftRight;
const faBoxesPacking = {
  prefix: 'fas',
  iconName: 'boxes-packing',
  icon: [640, 512, [], "e4c7", "M256 48c0-26.5 21.5-48 48-48L592 0c26.5 0 48 21.5 48 48l0 416c0 26.5-21.5 48-48 48l-210.7 0c1.8-5 2.7-10.4 2.7-16l0-242.7c18.6-6.6 32-24.4 32-45.3l0-32c0-26.5-21.5-48-48-48l-112 0 0-80zM571.3 347.3c6.2-6.2 6.2-16.4 0-22.6l-64-64c-6.2-6.2-16.4-6.2-22.6 0l-64 64c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L480 310.6 480 432c0 8.8 7.2 16 16 16s16-7.2 16-16l0-121.4 36.7 36.7c6.2 6.2 16.4 6.2 22.6 0zM0 176c0-8.8 7.2-16 16-16l352 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16L16 224c-8.8 0-16-7.2-16-16l0-32zm352 80l0 224c0 17.7-14.3 32-32 32L64 512c-17.7 0-32-14.3-32-32l0-224 320 0zM144 320c-8.8 0-16 7.2-16 16s7.2 16 16 16l96 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-96 0z"]
};
const faCircleArrowLeft = {
  prefix: 'fas',
  iconName: 'circle-arrow-left',
  icon: [512, 512, ["arrow-circle-left"], "f0a8", "M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM215 127c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-71 71L392 232c13.3 0 24 10.7 24 24s-10.7 24-24 24l-214.1 0 71 71c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L103 273c-9.4-9.4-9.4-24.6 0-33.9L215 127z"]
};
const faArrowCircleLeft = faCircleArrowLeft;
const faGroupArrowsRotate = {
  prefix: 'fas',
  iconName: 'group-arrows-rotate',
  icon: [512, 512, [], "e4f6", "M201.1 71.9c16.9-5 26.6-22.9 21.5-39.8s-22.9-26.6-39.8-21.5c-21.5 6.4-41.8 15.5-60.6 27C114.3 34 105.4 32 96 32C60.7 32 32 60.7 32 96c0 9.4 2 18.3 5.6 26.3c-11.5 18.7-20.6 39-27 60.6c-5 16.9 4.6 34.8 21.5 39.8s34.8-4.6 39.8-21.5c4.3-14.6 10.4-28.5 17.9-41.4c2 .2 4.1 .3 6.1 .3c35.3 0 64-28.7 64-64c0-2.1-.1-4.1-.3-6.1c12.9-7.5 26.8-13.6 41.4-17.9zm128-61.3c-16.9-5-34.8 4.6-39.8 21.5s4.6 34.8 21.5 39.8c14.6 4.3 28.5 10.4 41.4 17.9c-.2 2-.3 4.1-.3 6.1c0 35.3 28.7 64 64 64c2.1 0 4.1-.1 6.2-.3c7.5 12.9 13.6 26.8 17.9 41.4c5 16.9 22.9 26.6 39.8 21.5s26.6-22.9 21.5-39.8c-6.4-21.5-15.5-41.8-27-60.6c3.6-8 5.6-16.9 5.6-26.3c0-35.3-28.7-64-64-64c-9.4 0-18.3 2-26.3 5.6c-18.7-11.5-39-20.6-60.6-27zM71.9 310.9c-5-16.9-22.9-26.6-39.8-21.5s-26.6 22.9-21.5 39.8c6.4 21.5 15.5 41.8 27 60.6C34 397.7 32 406.6 32 416c0 35.3 28.7 64 64 64c9.4 0 18.3-2 26.3-5.6c18.7 11.5 39 20.6 60.6 27c16.9 5 34.8-4.6 39.8-21.5s-4.6-34.8-21.5-39.8c-14.6-4.3-28.5-10.4-41.4-17.9c.2-2 .3-4.1 .3-6.2c0-35.3-28.7-64-64-64c-2.1 0-4.1 .1-6.2 .3c-7.5-12.9-13.6-26.8-17.9-41.4zm429.4 18.3c5-16.9-4.6-34.8-21.5-39.8s-34.8 4.6-39.8 21.5c-4.3 14.6-10.4 28.5-17.9 41.4c-2-.2-4.1-.3-6.2-.3c-35.3 0-64 28.7-64 64c0 2.1 .1 4.1 .3 6.2c-12.9 7.5-26.8 13.6-41.4 17.9c-16.9 5-26.6 22.9-21.5 39.8s22.9 26.6 39.8 21.5c21.5-6.4 41.8-15.5 60.6-27c8 3.6 16.9 5.6 26.3 5.6c35.3 0 64-28.7 64-64c0-9.4-2-18.3-5.6-26.3c11.5-18.7 20.6-39 27-60.6zM192.8 256.8c0-15.6 5.6-29.9 14.9-41.1L223 231c6.6 6.6 17.8 1.9 17.8-7.4l0-60.5c0-5.7-4.7-10.4-10.4-10.4l-60.5 0c-9.3 0-13.9 11.2-7.4 17.8l11.2 11.2c-17.9 19.8-28.9 46.2-28.9 75.1c0 43.6 24.9 81.3 61.1 99.8c11.8 6 26.3 1.4 32.3-10.4s1.4-26.3-10.4-32.3c-20.8-10.6-34.9-32.2-34.9-57zm93.1-58.6c20.8 10.6 34.9 32.2 34.9 57c0 15.6-5.6 29.9-14.9 41.1L290.6 281c-6.6-6.6-17.8-1.9-17.8 7.4l0 60.5c0 5.7 4.7 10.4 10.4 10.4l60.5 0c9.3 0 13.9-11.2 7.4-17.8l-11.2-11.2c17.9-19.8 28.9-46.2 28.9-75.1c0-43.6-24.9-81.3-61.1-99.8c-11.8-6-26.3-1.4-32.3 10.4s-1.4 26.3 10.4 32.3z"]
};
const faBowlFood = {
  prefix: 'fas',
  iconName: 'bowl-food',
  icon: [512, 512, [], "e4c6", "M0 192c0-35.3 28.7-64 64-64c.5 0 1.1 0 1.6 0C73 91.5 105.3 64 144 64c15 0 29 4.1 40.9 11.2C198.2 49.6 225.1 32 256 32s57.8 17.6 71.1 43.2C339 68.1 353 64 368 64c38.7 0 71 27.5 78.4 64c.5 0 1.1 0 1.6 0c35.3 0 64 28.7 64 64c0 11.7-3.1 22.6-8.6 32L8.6 224C3.1 214.6 0 203.7 0 192zm0 91.4C0 268.3 12.3 256 27.4 256l457.1 0c15.1 0 27.4 12.3 27.4 27.4c0 70.5-44.4 130.7-106.7 154.1L403.5 452c-2 16-15.6 28-31.8 28l-231.5 0c-16.1 0-29.8-12-31.8-28l-1.8-14.4C44.4 414.1 0 353.9 0 283.4z"]
};
const faCandyCane = {
  prefix: 'fas',
  iconName: 'candy-cane',
  icon: [512, 512, [], "f786", "M348.8 131.5c3.7-2.3 7.9-3.5 12.2-3.5c12.7 0 23 10.3 23 23l0 5.6c0 9.9-5.1 19.1-13.5 24.3L30.1 393.7C.1 412.5-9 451.9 9.7 481.9s58.2 39.1 88.2 20.4L438.4 289.5c45.8-28.6 73.6-78.8 73.6-132.8l0-5.6C512 67.6 444.4 0 361 0c-28.3 0-56 8-80.1 23L254.1 39.7c-30 18.7-39.1 58.2-20.4 88.2s58.2 39.1 88.2 20.4l26.8-16.8zM298.4 49.8c9.2-5.7 19.1-10.1 29.4-13.1L348 97.5c-5.7 1.4-11.2 3.7-16.3 6.8l-12.6 7.9L298.4 49.8zm88.5 52.7l46.2-46.2c8.5 6.5 16.1 14.1 22.6 22.6l-46.2 46.2c-5.1-9.6-13-17.5-22.6-22.6zm28.9 59.3l61.6 20.5c-2.2 10.5-5.8 20.7-10.5 30.2l-62-20.7c6.2-8.8 10.1-19.1 11-30.1zm-86.1 82.5l60.4 37.7-30.2 18.9-60.4-37.7 30.2-18.9zm-107.2 67l60.4 37.7-30.2 18.9-60.4-37.7 30.2-18.9zM119.3 375.7l60.4 37.7-30.2 18.9L89.1 394.6l30.2-18.9z"]
};
const faArrowDownWideShort = {
  prefix: 'fas',
  iconName: 'arrow-down-wide-short',
  icon: [576, 512, ["sort-amount-asc", "sort-amount-down"], "f160", "M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L320 96z"]
};
const faSortAmountAsc = faArrowDownWideShort;
const faSortAmountDown = faArrowDownWideShort;
const faCloudBolt = {
  prefix: 'fas',
  iconName: 'cloud-bolt',
  icon: [512, 512, [127785, "thunderstorm"], "f76c", "M0 224c0 53 43 96 96 96l47.2 0L290 202.5c17.6-14.1 42.6-14 60.2 .2s22.8 38.6 12.8 58.8L333.7 320l18.3 0 64 0c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0c1.1-5.2 1.6-10.5 1.6-16c0-44.2-35.8-80-80-80c-24.3 0-46.1 10.9-60.8 28C256.5 24.3 219.1 0 176 0C114.1 0 64 50.1 64 112c0 7.1 .7 14.1 1.9 20.8C27.6 145.4 0 181.5 0 224zm330.1 3.6c-5.8-4.7-14.2-4.7-20.1-.1l-160 128c-5.3 4.2-7.4 11.4-5.1 17.8s8.3 10.7 15.1 10.7l70.1 0L177.7 488.8c-3.4 6.7-1.6 14.9 4.3 19.6s14.2 4.7 20.1 .1l160-128c5.3-4.2 7.4-11.4 5.1-17.8s-8.3-10.7-15.1-10.7l-70.1 0 52.4-104.8c3.4-6.7 1.6-14.9-4.2-19.6z"]
};
const faThunderstorm = faCloudBolt;
const faTextSlash = {
  prefix: 'fas',
  iconName: 'text-slash',
  icon: [640, 512, ["remove-format"], "f87d", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L355.7 253.5 400.2 96 503 96 497 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C577.6 61.3 554.7 32 523.5 32L376.1 32l-.3 0L204.5 32c-22 0-41.2 15-46.6 36.4l-6.3 25.2L38.8 5.1zm168 131.7c.1-.3 .2-.7 .3-1L217 96l116.7 0L301.3 210.8l-94.5-74.1zM243.3 416L192 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-42.2 0 17.6-62.1L272.9 311 243.3 416z"]
};
const faRemoveFormat = faTextSlash;
const faFaceSmileWink = {
  prefix: 'fas',
  iconName: 'face-smile-wink',
  icon: [512, 512, [128521, "smile-wink"], "f4da", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm156.4 25.6c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2c-17.6-23.5-52.8-23.5-70.4 0z"]
};
const faSmileWink = faFaceSmileWink;
const faFileWord = {
  prefix: 'fas',
  iconName: 'file-word',
  icon: [384, 512, [], "f1c2", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM111 257.1l26.8 89.2 31.6-90.3c3.4-9.6 12.5-16.1 22.7-16.1s19.3 6.4 22.7 16.1l31.6 90.3L273 257.1c3.8-12.7 17.2-19.9 29.9-16.1s19.9 17.2 16.1 29.9l-48 160c-3 10-12 16.9-22.4 17.1s-19.8-6.2-23.2-16.1L192 336.6l-33.3 95.3c-3.4 9.8-12.8 16.3-23.2 16.1s-19.5-7.1-22.4-17.1l-48-160c-3.8-12.7 3.4-26.1 16.1-29.9s26.1 3.4 29.9 16.1z"]
};
const faFilePowerpoint = {
  prefix: 'fas',
  iconName: 'file-powerpoint',
  icon: [384, 512, [], "f1c4", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM136 240l68 0c42 0 76 34 76 76s-34 76-76 76l-44 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-56 0-104c0-13.3 10.7-24 24-24zm68 104c15.5 0 28-12.5 28-28s-12.5-28-28-28l-44 0 0 56 44 0z"]
};
const faArrowsLeftRight = {
  prefix: 'fas',
  iconName: 'arrows-left-right',
  icon: [512, 512, ["arrows-h"], "f07e", "M406.6 374.6l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224l-293.5 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288l293.5 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"]
};
const faArrowsH = faArrowsLeftRight;
const faHouseLock = {
  prefix: 'fas',
  iconName: 'house-lock',
  icon: [640, 512, [], "e510", "M384 480c0 11.7 3.1 22.6 8.6 32l-.6 0c-22.1 0-40-17.9-40-40l0-24 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L490.7 166.3C447.2 181.7 416 223.2 416 272l0 24.6c-19.1 11.1-32 31.7-32 55.4l0 128zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faCloudArrowDown = {
  prefix: 'fas',
  iconName: 'cloud-arrow-down',
  icon: [640, 512, [62337, "cloud-download", "cloud-download-alt"], "f0ed", "M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z"]
};
const faCloudDownload = faCloudArrowDown;
const faCloudDownloadAlt = faCloudArrowDown;
const faChildren = {
  prefix: 'fas',
  iconName: 'children',
  icon: [640, 512, [], "e4e1", "M160 0a64 64 0 1 1 0 128A64 64 0 1 1 160 0zM88 480l0-80-17.8 0c-10.9 0-18.6-10.7-15.2-21.1l31.1-93.4L57.5 323.3c-10.7 14.1-30.8 16.8-44.8 6.2s-16.8-30.7-6.2-44.8L65.4 207c22.4-29.6 57.5-47 94.6-47s72.2 17.4 94.6 47l58.9 77.7c10.7 14.1 7.9 34.2-6.2 44.8s-34.2 7.9-44.8-6.2l-28.6-37.8L265 378.9c3.5 10.4-4.3 21.1-15.2 21.1L232 400l0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-80-16 0 0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32zM480 0a64 64 0 1 1 0 128A64 64 0 1 1 480 0zm-8 384l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-179.5L395.1 321c-9.4 15-29.2 19.4-44.1 10s-19.4-29.2-10-44.1l51.7-82.1c17.6-27.9 48.3-44.9 81.2-44.9l12.3 0c33 0 63.7 16.9 81.2 44.9L619.1 287c9.4 15 4.9 34.7-10 44.1s-34.7 4.9-44.1-10L552 300.5 552 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-16 0z"]
};
const faChalkboard = {
  prefix: 'fas',
  iconName: 'chalkboard',
  icon: [576, 512, ["blackboard"], "f51b", "M96 32C60.7 32 32 60.7 32 96l0 288 64 0L96 96l384 0 0 288 64 0 0-288c0-35.3-28.7-64-64-64L96 32zM224 384l0 32L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-128 0 0-32c0-17.7-14.3-32-32-32l-128 0c-17.7 0-32 14.3-32 32z"]
};
const faBlackboard = faChalkboard;
const faUserLargeSlash = {
  prefix: 'fas',
  iconName: 'user-large-slash',
  icon: [640, 512, ["user-alt-slash"], "f4fa", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L381.9 274c48.5-23.2 82.1-72.7 82.1-130C464 64.5 399.5 0 320 0C250.4 0 192.4 49.3 178.9 114.9L38.8 5.1zM545.5 512L528 512 284.3 320l-59 0C136.2 320 64 392.2 64 481.3c0 17 13.8 30.7 30.7 30.7l450.6 0 .3 0z"]
};
const faUserAltSlash = faUserLargeSlash;
const faEnvelopeOpen = {
  prefix: 'fas',
  iconName: 'envelope-open',
  icon: [512, 512, [62135], "f2b6", "M64 208.1L256 65.9 448 208.1l0 47.4L289.5 373c-9.7 7.2-21.4 11-33.5 11s-23.8-3.9-33.5-11L64 255.5l0-47.4zM256 0c-12.1 0-23.8 3.9-33.5 11L25.9 156.7C9.6 168.8 0 187.8 0 208.1L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-239.9c0-20.3-9.6-39.4-25.9-51.4L289.5 11C279.8 3.9 268.1 0 256 0z"]
};
const faHandshakeSimpleSlash = {
  prefix: 'fas',
  iconName: 'handshake-simple-slash',
  icon: [640, 512, ["handshake-alt-slash"], "e05f", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-135-105.8c-1.1-11.4-6.3-22.3-15.3-30.7l-134.2-123-23.4 18.2-26-20.3 77.2-60.1c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L550.2 352l41.8 0c26.5 0 48-21.5 48-48l0-128c0-26.5-21.5-48-48-48l-76 0-4 0-.7 0-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2l-89.7 72.6-25.8-20.3 81.8-66.2c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-35.5 23.7L38.8 5.1zM0 176L0 304c0 26.5 21.5 48 48 48l108.2 0 91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c.8-.8 1.5-1.7 2.2-2.6L41.2 128.5C17.9 131.8 0 151.8 0 176z"]
};
const faHandshakeAltSlash = faHandshakeSimpleSlash;
const faMattressPillow = {
  prefix: 'fas',
  iconName: 'mattress-pillow',
  icon: [640, 512, [], "e525", "M256 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l192 0 0-384zm32 384l288 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L288 64l0 384zM64 160c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 192c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-192z"]
};
const faGuaraniSign = {
  prefix: 'fas',
  iconName: 'guarani-sign',
  icon: [384, 512, [], "e19a", "M192 0c-17.7 0-32 14.3-32 32l0 34.7C69.2 81.9 0 160.9 0 256s69.2 174.1 160 189.3l0 34.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-34.7c90.8-15.2 160-94.2 160-189.3c0-17.7-14.3-32-32-32l-128 0 0-92c22.1 5.7 41.8 17.1 57.6 32.6c12.6 12.4 32.9 12.2 45.3-.4s12.2-32.9-.5-45.3C299 92 263.5 73.3 224 66.7L224 32c0-17.7-14.3-32-32-32zM160 132L160 380c-55.2-14.2-96-64.3-96-124s40.8-109.8 96-124zM224 380l0-92 92 0c-11.6 45-47 80.4-92 92z"]
};
const faArrowsRotate = {
  prefix: 'fas',
  iconName: 'arrows-rotate',
  icon: [512, 512, [128472, "refresh", "sync"], "f021", "M105.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L386.3 160 352 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l111.5 0c0 0 0 0 0 0l.4 0c17.7 0 32-14.3 32-32l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 35.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM39 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1L16 432c0 17.7 14.3 32 32 32s32-14.3 32-32l0-35.1 17.6 17.5c0 0 0 0 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.8c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L125.6 352l34.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48.4 288c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"]
};
const faRefresh = faArrowsRotate;
const faSync = faArrowsRotate;
const faFireExtinguisher = {
  prefix: 'fas',
  iconName: 'fire-extinguisher',
  icon: [512, 512, [129519], "f134", "M500.3 7.3C507.7 13.3 512 22.4 512 32l0 96c0 9.6-4.3 18.7-11.7 24.7s-17.2 8.5-26.6 6.6l-160-32C301.5 124.9 292 115.7 289 104l-65 0 0 34.8c37.8 18 64 56.5 64 101.2l0 144L64 384l0-144c0-44.7 26.2-83.2 64-101.2l0-28.8c-36.2 11.1-66 36.9-82.3 70.5c-5.8 11.9-20.2 16.9-32.1 11.1S-3.3 171.4 2.5 159.5C26.7 109.8 72.7 72.6 128 60.4L128 32c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 24 65 0c3-11.7 12.5-20.9 24.7-23.4l160-32c9.4-1.9 19.1 .6 26.6 6.6zM288 416l0 32c0 35.3-28.7 64-64 64l-96 0c-35.3 0-64-28.7-64-64l0-32 224 0zM176 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faCruzeiroSign = {
  prefix: 'fas',
  iconName: 'cruzeiro-sign',
  icon: [448, 512, [], "e152", "M96 256c0-88.4 71.6-160 160-160c41 0 78.3 15.4 106.7 40.7c13.2 11.8 33.4 10.7 45.2-2.5s10.7-33.4-2.5-45.2c-39.6-35.5-92-57-149.3-57C132.3 32 32 132.3 32 256s100.3 224 224 224c57.4 0 109.7-21.6 149.3-57c13.2-11.8 14.3-32 2.5-45.2s-32-14.3-45.2-2.5C334.3 400.6 297 416 256 416l0-96 0-8.7c0-12.8 10.4-23.3 23.3-23.3c4.6 0 9.1 1.4 12.9 3.9l10.1 6.7c14.7 9.8 34.6 5.8 44.4-8.9s5.8-34.6-8.9-44.4l-10.1-6.7c-14.3-9.6-31.2-14.7-48.4-14.7c-12.4 0-24.2 2.6-34.9 7.3c-5.5-4.5-12.6-7.3-20.3-7.3c-17.7 0-32 14.3-32 32l0 55.3 0 8.7 0 82.7C135.5 378 96 321.6 96 256z"]
};
const faGreaterThanEqual = {
  prefix: 'fas',
  iconName: 'greater-than-equal',
  icon: [448, 512, [], "f532", "M52.1 93.7C35.7 87.1 27.7 68.5 34.3 52.1s25.2-24.4 41.6-17.8l320 128C408 167.1 416 178.9 416 192s-8 24.9-20.1 29.7l-320 128c-16.4 6.6-35-1.4-41.6-17.8s1.4-35 17.8-41.6L297.8 192 52.1 93.7zM416 416c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0z"]
};
const faShieldHalved = {
  prefix: 'fas',
  iconName: 'shield-halved',
  icon: [512, 512, ["shield-alt"], "f3ed", "M256 0c4.6 0 9.2 1 13.4 2.9L457.7 82.8c22 9.3 38.4 31 38.3 57.2c-.5 99.2-41.3 280.7-213.6 363.2c-16.7 8-36.1 8-52.8 0C57.3 420.7 16.5 239.2 16 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.8 1 251.4 0 256 0zm0 66.8l0 378.1C394 378 431.1 230.1 432 141.4L256 66.8s0 0 0 0z"]
};
const faShieldAlt = faShieldHalved;
const faBookAtlas = {
  prefix: 'fas',
  iconName: 'book-atlas',
  icon: [448, 512, ["atlas"], "f558", "M0 96C0 43 43 0 96 0L384 0l32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32zM247.4 283.8c-3.7 3.7-6.2 4.2-7.4 4.2s-3.7-.5-7.4-4.2c-3.8-3.7-8-10-11.8-18.9c-6.2-14.5-10.8-34.3-12.2-56.9l63 0c-1.5 22.6-6 42.4-12.2 56.9c-3.8 8.9-8 15.2-11.8 18.9zm42.7-9.9c7.3-18.3 12-41.1 13.4-65.9l31.1 0c-4.7 27.9-21.4 51.7-44.5 65.9zm0-163.8c23.2 14.2 39.9 38 44.5 65.9l-31.1 0c-1.4-24.7-6.1-47.5-13.4-65.9zM368 192a128 128 0 1 0 -256 0 128 128 0 1 0 256 0zM145.3 208l31.1 0c1.4 24.7 6.1 47.5 13.4 65.9c-23.2-14.2-39.9-38-44.5-65.9zm31.1-32l-31.1 0c4.7-27.9 21.4-51.7 44.5-65.9c-7.3 18.3-12 41.1-13.4 65.9zm56.1-75.8c3.7-3.7 6.2-4.2 7.4-4.2s3.7 .5 7.4 4.2c3.8 3.7 8 10 11.8 18.9c6.2 14.5 10.8 34.3 12.2 56.9l-63 0c1.5-22.6 6-42.4 12.2-56.9c3.8-8.9 8-15.2 11.8-18.9z"]
};
const faAtlas = faBookAtlas;
const faVirus = {
  prefix: 'fas',
  iconName: 'virus',
  icon: [512, 512, [], "e074", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 11.5c0 49.9-60.3 74.9-95.6 39.6L120.2 75C107.7 62.5 87.5 62.5 75 75s-12.5 32.8 0 45.3l8.2 8.2C118.4 163.7 93.4 224 43.5 224L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l11.5 0c49.9 0 74.9 60.3 39.6 95.6L75 391.8c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l8.2-8.2c35.3-35.3 95.6-10.3 95.6 39.6l0 11.5c0 17.7 14.3 32 32 32s32-14.3 32-32l0-11.5c0-49.9 60.3-74.9 95.6-39.6l8.2 8.2c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-8.2-8.2c-35.3-35.3-10.3-95.6 39.6-95.6l11.5 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-11.5 0c-49.9 0-74.9-60.3-39.6-95.6l8.2-8.2c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-8.2 8.2C348.3 118.4 288 93.4 288 43.5L288 32zM176 224a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm128 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faEnvelopeCircleCheck = {
  prefix: 'fas',
  iconName: 'envelope-circle-check',
  icon: [640, 512, [], "e4e8", "M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0l57.4-43c23.9-59.8 79.7-103.3 146.3-109.8l13.9-10.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176 0 384c0 35.3 28.7 64 64 64l296.2 0C335.1 417.6 320 378.5 320 336c0-5.6 .3-11.1 .8-16.6l-26.4 19.8zM640 336a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 353.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faLayerGroup = {
  prefix: 'fas',
  iconName: 'layer-group',
  icon: [576, 512, [], "f5fd", "M264.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 149.8C37.4 145.8 32 137.3 32 128s5.4-17.9 13.9-21.8L264.5 5.2zM476.9 209.6l53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 277.8C37.4 273.8 32 265.3 32 256s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0l152-70.2zm-152 198.2l152-70.2 53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 405.8C37.4 401.8 32 393.3 32 384s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0z"]
};
const faArrowsToDot = {
  prefix: 'fas',
  iconName: 'arrows-to-dot',
  icon: [512, 512, [], "e4be", "M256 0c17.7 0 32 14.3 32 32l0 32 32 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-64-64c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l32 0 0-32c0-17.7 14.3-32 32-32zM169.4 393.4l64-64c12.5-12.5 32.8-12.5 45.3 0l64 64c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9zM32 224l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c12.5 12.5 12.5 32.8 0 45.3l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3l64-64c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 32 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-64-64zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faArchway = {
  prefix: 'fas',
  iconName: 'archway',
  icon: [512, 512, [], "f557", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zm0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 64 0 0-128c0-53 43-96 96-96s96 43 96 96l0 128 64 0 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-288L32 128l0 288z"]
};
const faHeartCircleCheck = {
  prefix: 'fas',
  iconName: 'heart-circle-check',
  icon: [576, 512, [], "e4fd", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L416 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faHouseChimneyCrack = {
  prefix: 'fas',
  iconName: 'house-chimney-crack',
  icon: [576, 512, ["house-damage"], "f6f1", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c.2 35.5-28.5 64.3-64 64.3l-122.1 0L288 448l80.8-67.3c7.8-6.5 7.6-18.6-.4-24.9L250.6 263.2c-14.6-11.5-33.8 7-22.8 22L288 368l-85.5 71.2c-6.1 5-7.5 13.8-3.5 20.5L230.4 512l-102.3 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7 416 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 121 52.8 46.4c8 7 12 15 11 24z"]
};
const faHouseDamage = faHouseChimneyCrack;
const faFileZipper = {
  prefix: 'fas',
  iconName: 'file-zipper',
  icon: [384, 512, ["file-archive"], "f1c6", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM96 48c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zm-6.3 71.8c3.7-14 16.4-23.8 30.9-23.8l14.8 0c14.5 0 27.2 9.7 30.9 23.8l23.5 88.2c1.4 5.4 2.1 10.9 2.1 16.4c0 35.2-28.8 63.7-64 63.7s-64-28.5-64-63.7c0-5.5 .7-11.1 2.1-16.4l23.5-88.2zM112 336c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0z"]
};
const faFileArchive = faFileZipper;
const faSquare = {
  prefix: 'fas',
  iconName: 'square',
  icon: [448, 512, [9632, 9723, 9724, 61590], "f0c8", "M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96z"]
};
const faMartiniGlassEmpty = {
  prefix: 'fas',
  iconName: 'martini-glass-empty',
  icon: [512, 512, ["glass-martini"], "f000", "M32 0C19.1 0 7.4 7.8 2.4 19.8s-2.2 25.7 6.9 34.9L224 269.3 224 448l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-178.7L502.6 54.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 0 480 0L32 0zM256 210.7L109.3 64l293.5 0L256 210.7z"]
};
const faGlassMartini = faMartiniGlassEmpty;
const faCouch = {
  prefix: 'fas',
  iconName: 'couch',
  icon: [640, 512, [], "f4b8", "M64 160C64 89.3 121.3 32 192 32l256 0c70.7 0 128 57.3 128 128l0 33.6c-36.5 7.4-64 39.7-64 78.4l0 48-384 0 0-48c0-38.7-27.5-71-64-78.4L64 160zM544 272c0-20.9 13.4-38.7 32-45.3c5-1.8 10.4-2.7 16-2.7c26.5 0 48 21.5 48 48l0 176c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32L96 448c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32L0 272c0-26.5 21.5-48 48-48c5.6 0 11 1 16 2.7c18.6 6.6 32 24.4 32 45.3l0 48 0 32 32 0 384 0 32 0 0-32 0-48z"]
};
const faCediSign = {
  prefix: 'fas',
  iconName: 'cedi-sign',
  icon: [384, 512, [], "e0df", "M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 34.7C101.2 81.9 32 160.9 32 256s69.2 174.1 160 189.3l0 34.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-34.7c30.9-5.2 59.2-17.7 83.2-35.8c14.1-10.6 17-30.7 6.4-44.8s-30.7-17-44.8-6.4c-13.2 9.9-28.3 17.3-44.8 21.6L256 132c16.4 4.2 31.6 11.6 44.8 21.6c14.1 10.6 34.2 7.8 44.8-6.4s7.8-34.2-6.4-44.8c-24-18-52.4-30.6-83.2-35.8L256 32zM192 132L192 380c-55.2-14.2-96-64.3-96-124s40.8-109.8 96-124z"]
};
const faItalic = {
  prefix: 'fas',
  iconName: 'italic',
  icon: [384, 512, [], "f033", "M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0L160 416l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0L224 96l-64 0c-17.7 0-32-14.3-32-32z"]
};
const faTableCellsColumnLock = {
  prefix: 'fas',
  iconName: 'table-cells-column-lock',
  icon: [640, 512, [], "e678", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 65.1c-37.8 5.4-69.4 29.6-85.2 62.9L360 224l0 64 56 0 0 8.6c-19.1 11.1-32 31.7-32 55.4l-24 0 0 64 24 0 0 64L64 480c-35.3 0-64-28.7-64-64L0 96zm208 0l0 64 88 0 0-64-88 0zm240 0l-88 0 0 64 88 0 0-64zM208 224l0 64 88 0 0-64-88 0zm0 128l0 64 88 0 0-64-88 0zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faChurch = {
  prefix: 'fas',
  iconName: 'church',
  icon: [640, 512, [9962], "f51d", "M344 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 46.4L183.3 210c-14.5 8.7-23.3 24.3-23.3 41.2L160 512l96 0 0-96c0-35.3 28.7-64 64-64s64 28.7 64 64l0 96 96 0 0-260.8c0-16.9-8.8-32.5-23.3-41.2L344 142.4 344 96l32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0 0-24zM24.9 330.3C9.5 338.8 0 354.9 0 372.4L0 464c0 26.5 21.5 48 48 48l80 0 0-238.4L24.9 330.3zM592 512c26.5 0 48-21.5 48-48l0-91.6c0-17.5-9.5-33.6-24.9-42.1L512 273.6 512 512l80 0z"]
};
const faCommentsDollar = {
  prefix: 'fas',
  iconName: 'comments-dollar',
  icon: [640, 512, [], "f653", "M416 176c0 97.2-93.1 176-208 176c-38.2 0-73.9-8.7-104.7-23.9c-7.5 4-16 7.9-25.2 11.4C59.8 346.4 37.8 352 16 352c-6.9 0-13.1-4.5-15.2-11.1s.2-13.8 5.8-17.9c0 0 0 0 0 0s0 0 0 0l.2-.2c.2-.2 .6-.4 1.1-.8c1-.8 2.5-2 4.3-3.7c3.6-3.3 8.5-8.1 13.3-14.3c5.5-7 10.7-15.4 14.2-24.7C14.7 250.3 0 214.6 0 176C0 78.8 93.1 0 208 0S416 78.8 416 176zM231.5 383C348.9 372.9 448 288.3 448 176c0-5.2-.2-10.4-.6-15.5C555.1 167.1 640 243.2 640 336c0 38.6-14.7 74.3-39.6 103.4c3.5 9.4 8.7 17.7 14.2 24.7c4.8 6.2 9.7 11 13.3 14.3c1.8 1.6 3.3 2.9 4.3 3.7c.5 .4 .9 .7 1.1 .8l.2 .2s0 0 0 0s0 0 0 0c5.6 4.1 7.9 11.3 5.8 17.9c-2.1 6.6-8.3 11.1-15.2 11.1c-21.8 0-43.8-5.6-62.1-12.5c-9.2-3.5-17.8-7.4-25.2-11.4C505.9 503.3 470.2 512 432 512c-95.6 0-176.2-54.6-200.5-129zM228 72c0-11-9-20-20-20s-20 9-20 20l0 14c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1c0 0 0 0 0 0s0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4l0 14.6c0 11 9 20 20 20s20-9 20-20l0-13.8c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15l-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7L228 72z"]
};
const faDemocrat = {
  prefix: 'fas',
  iconName: 'democrat',
  icon: [640, 512, [], "f747", "M64 32c0-8.9 3.8-20.9 6.2-27.3C71.2 1.8 74 0 77 0c1.9 0 3.8 .7 5.2 2.1L128 45.7 173.8 2.1C175.2 .7 177.1 0 179 0c3 0 5.8 1.8 6.8 4.7c2.4 6.5 6.2 18.4 6.2 27.3c0 26.5-21.9 42-29.5 46.6l76.2 72.6c6 5.7 13.9 8.8 22.1 8.8L480 160l32 0c40.3 0 78.2 19 102.4 51.2l19.2 25.6c10.6 14.1 7.7 34.2-6.4 44.8s-34.2 7.7-44.8-6.4l-19.2-25.6c-5.3-7-11.8-12.8-19.2-17l0 87.4-352 0-40.4-94.3c-3.9-9.2-15.3-12.6-23.6-7l-42.1 28c-9.1 6.1-19.7 9.3-30.7 9.3l-2 0C23.9 256 0 232.1 0 202.7c0-12.1 4.1-23.8 11.7-33.3L87.6 74.6C78.1 67.4 64 53.2 64 32zM448 352l96 0 0 64 0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64-160 0 0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64 0-64 96 0 160 0zM260.9 210.9c-.9-1.8-2.8-2.9-4.8-2.9s-3.9 1.1-4.8 2.9l-10.5 20.5-23.5 3.3c-2 .3-3.7 1.6-4.3 3.5s-.1 3.9 1.3 5.3l17 16-4 22.6c-.3 1.9 .5 3.9 2.1 5s3.8 1.3 5.6 .4l21-10.7 21 10.7c1.8 .9 4 .8 5.6-.4s2.5-3.1 2.1-5l-4-22.6 17-16c1.5-1.4 2-3.4 1.3-5.3s-2.3-3.2-4.3-3.5l-23.5-3.3-10.5-20.5zM368.1 208c-2 0-3.9 1.1-4.8 2.9l-10.5 20.5-23.5 3.3c-2 .3-3.7 1.6-4.3 3.5s-.1 3.9 1.3 5.3l17 16-4 22.6c-.3 1.9 .5 3.9 2.1 5s3.8 1.3 5.6 .4l21-10.7 21 10.7c1.8 .9 4 .8 5.6-.4s2.5-3.1 2.1-5l-4-22.6 17-16c1.5-1.4 2-3.4 1.4-5.3s-2.3-3.2-4.3-3.5l-23.5-3.3-10.5-20.5c-.9-1.8-2.8-2.9-4.8-2.9zm116.8 2.9c-.9-1.8-2.8-2.9-4.8-2.9s-3.9 1.1-4.8 2.9l-10.5 20.5-23.5 3.3c-2 .3-3.7 1.6-4.3 3.5s-.1 3.9 1.3 5.3l17 16-4 22.6c-.3 1.9 .5 3.9 2.1 5s3.8 1.3 5.6 .4l21-10.7 21 10.7c1.8 .9 4 .8 5.6-.4s2.5-3.1 2.1-5l-4-22.6 17-16c1.5-1.4 2-3.4 1.4-5.3s-2.3-3.2-4.3-3.5l-23.5-3.3-10.5-20.5z"]
};
const faZ = {
  prefix: 'fas',
  iconName: 'z',
  icon: [384, 512, [122], "5a", "M0 64C0 46.3 14.3 32 32 32l320 0c12.4 0 23.7 7.2 29 18.4s3.6 24.5-4.4 34.1L100.3 416 352 416c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-12.4 0-23.7-7.2-29-18.4s-3.6-24.5 4.4-34.1L283.7 96 32 96C14.3 96 0 81.7 0 64z"]
};
const faPersonSkiing = {
  prefix: 'fas',
  iconName: 'person-skiing',
  icon: [512, 512, [9975, "skiing"], "f7c9", "M380.7 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM2.7 268.9c6.1-11.8 20.6-16.3 32.4-10.2L232.7 361.3l46.2-69.2-75.1-75.1c-14.6-14.6-20.4-33.9-18.4-52.1l108.8 52 39.3 39.3c16.2 16.2 18.7 41.5 6 60.6L289.8 391l128.7 66.8c13.6 7.1 29.8 7.2 43.6 .3l15.2-7.6c11.9-5.9 26.3-1.1 32.2 10.7s1.1 26.3-10.7 32.2l-15.2 7.6c-27.5 13.7-59.9 13.5-87.2-.7L12.9 301.3C1.2 295.2-3.4 280.7 2.7 268.9zM118.9 65.6L137 74.2l8.7-17.4c4-7.9 13.6-11.1 21.5-7.2s11.1 13.6 7.2 21.5l-8.5 16.9 54.7 26.2c1.5-.7 3.1-1.4 4.7-2.1l83.4-33.4c34.2-13.7 72.8 4.2 84.5 39.2l17.1 51.2 52.1 26.1c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3l-58.1-29c-11.4-5.7-20-15.7-24.1-27.8l-5.8-17.3-27.3 12.1-6.8 3-6.7-3.2L151.5 116.7l-9.2 18.4c-4 7.9-13.6 11.1-21.5 7.2s-11.1-13.6-7.2-21.5l9-18-17.6-8.4c-8-3.8-11.3-13.4-7.5-21.3s13.4-11.3 21.3-7.5z"]
};
const faSkiing = faPersonSkiing;
const faRoadLock = {
  prefix: 'fas',
  iconName: 'road-lock',
  icon: [640, 512, [], "e567", "M288 32l-74.8 0c-27.1 0-51.3 17.1-60.3 42.6L35.1 407.2c-2.1 5.9-3.1 12-3.1 18.2C32 455.5 56.5 480 86.6 480L288 480l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64 32 0 0-128c0-23.7 12.9-44.4 32-55.4l0-24.6c0-58.3 44.6-106.2 101.5-111.5L487.1 74.6C478 49.1 453.9 32 426.8 32L352 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm64 192l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32zm176 16c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faA = {
  prefix: 'fas',
  iconName: 'a',
  icon: [384, 512, [97], "41", "M221.5 51.7C216.6 39.8 204.9 32 192 32s-24.6 7.8-29.5 19.7l-120 288-40 96c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L93.3 384l197.3 0 31.8 76.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8l-40-96-120-288zM264 320l-144 0 72-172.8L264 320z"]
};
const faTemperatureArrowDown = {
  prefix: 'fas',
  iconName: 'temperature-arrow-down',
  icon: [576, 512, ["temperature-down"], "e03f", "M128 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 164.5c0 17.3 7.1 31.9 15.3 42.5C249.8 332.6 256 349.5 256 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9c8.2-10.6 15.3-25.2 15.3-42.5L128 112zM176 0C114.1 0 64 50.1 64 112l0 164.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C43.2 304.2 32 334.8 32 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6L288 112C288 50.1 237.9 0 176 0zm0 416c26.5 0 48-21.5 48-48c0-20.9-13.4-38.7-32-45.3l0-50.7c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 50.7c-18.6 6.6-32 24.4-32 45.3c0 26.5 21.5 48 48 48zm336-64l-32 0 0-288c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 288-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c6 6 14.1 9.4 22.6 9.4s16.6-3.4 22.6-9.4l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8z"]
};
const faTemperatureDown = faTemperatureArrowDown;
const faFeatherPointed = {
  prefix: 'fas',
  iconName: 'feather-pointed',
  icon: [512, 512, ["feather-alt"], "f56b", "M278.5 215.6L23 471c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l74.8-74.8c7.4 4.6 15.3 8.2 23.8 10.5C200.3 452.8 270 454.5 338 409.4c12.2-8.1 5.8-25.4-8.8-25.4l-16.1 0c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l97.7-29.3c3.4-1 6.4-3.1 8.4-6.1c4.4-6.4 8.6-12.9 12.6-19.6c6.2-10.3-1.5-23-13.5-23l-38.6 0c-5.1 0-9.2-4.1-9.2-9.2c0-4.1 2.7-7.6 6.5-8.8l80.9-24.3c4.6-1.4 8.4-4.8 10.2-9.3C494.5 163 507.8 86.1 511.9 36.8c.8-9.9-3-19.6-10-26.6s-16.7-10.8-26.6-10C391.5 7 228.5 40.5 137.4 131.6C57.3 211.7 56.7 302.3 71.3 356.4c2.1 7.9 12 9.6 17.8 3.8L253.6 195.8c6.2-6.2 16.4-6.2 22.6 0c5.4 5.4 6.1 13.6 2.2 19.8z"]
};
const faFeatherAlt = faFeatherPointed;
const faP = {
  prefix: 'fas',
  iconName: 'p',
  icon: [320, 512, [112], "50", "M0 96C0 60.7 28.7 32 64 32l96 0c88.4 0 160 71.6 160 160s-71.6 160-160 160l-96 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 320 0 96zM64 288l96 0c53 0 96-43 96-96s-43-96-96-96L64 96l0 192z"]
};
const faSnowflake = {
  prefix: 'fas',
  iconName: 'snowflake',
  icon: [448, 512, [10052, 10054], "f2dc", "M224 0c17.7 0 32 14.3 32 32l0 30.1 15-15c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-49 49 0 70.3 61.4-35.8 17.7-66.1c3.4-12.8 16.6-20.4 29.4-17s20.4 16.6 17 29.4l-5.2 19.3 23.6-13.8c15.3-8.9 34.9-3.7 43.8 11.5s3.8 34.9-11.5 43.8l-25.3 14.8 21.7 5.8c12.8 3.4 20.4 16.6 17 29.4s-16.6 20.4-29.4 17l-67.7-18.1L287.5 256l60.9 35.5 67.7-18.1c12.8-3.4 26 4.2 29.4 17s-4.2 26-17 29.4l-21.7 5.8 25.3 14.8c15.3 8.9 20.4 28.5 11.5 43.8s-28.5 20.4-43.8 11.5l-23.6-13.8 5.2 19.3c3.4 12.8-4.2 26-17 29.4s-26-4.2-29.4-17l-17.7-66.1L256 311.7l0 70.3 49 49c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-15-15 0 30.1c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-30.1-15 15c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l49-49 0-70.3-61.4 35.8-17.7 66.1c-3.4 12.8-16.6 20.4-29.4 17s-20.4-16.6-17-29.4l5.2-19.3L48.1 395.6c-15.3 8.9-34.9 3.7-43.8-11.5s-3.7-34.9 11.5-43.8l25.3-14.8-21.7-5.8c-12.8-3.4-20.4-16.6-17-29.4s16.6-20.4 29.4-17l67.7 18.1L160.5 256 99.6 220.5 31.9 238.6c-12.8 3.4-26-4.2-29.4-17s4.2-26 17-29.4l21.7-5.8L15.9 171.6C.6 162.7-4.5 143.1 4.4 127.9s28.5-20.4 43.8-11.5l23.6 13.8-5.2-19.3c-3.4-12.8 4.2-26 17-29.4s26 4.2 29.4 17l17.7 66.1L192 200.3l0-70.3L143 81c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l15 15L192 32c0-17.7 14.3-32 32-32z"]
};
const faNewspaper = {
  prefix: 'fas',
  iconName: 'newspaper',
  icon: [512, 512, [128240], "f1ea", "M96 96c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L80 480c-44.2 0-80-35.8-80-80L0 128c0-17.7 14.3-32 32-32s32 14.3 32 32l0 272c0 8.8 7.2 16 16 16s16-7.2 16-16L96 96zm64 24l0 80c0 13.3 10.7 24 24 24l112 0c13.3 0 24-10.7 24-24l0-80c0-13.3-10.7-24-24-24L184 96c-13.3 0-24 10.7-24 24zm208-8c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0c-8.8 0-16 7.2-16 16zM160 304c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-256 0c-8.8 0-16 7.2-16 16zm0 96c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-256 0c-8.8 0-16 7.2-16 16z"]
};
const faRectangleAd = {
  prefix: 'fas',
  iconName: 'rectangle-ad',
  icon: [576, 512, ["ad"], "f641", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM229.5 173.3l72 144c5.9 11.9 1.1 26.3-10.7 32.2s-26.3 1.1-32.2-10.7L253.2 328l-90.3 0-5.4 10.7c-5.9 11.9-20.3 16.7-32.2 10.7s-16.7-20.3-10.7-32.2l72-144c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3zM208 237.7L186.8 280l42.3 0L208 237.7zM392 256a24 24 0 1 0 0 48 24 24 0 1 0 0-48zm24-43.9l0-28.1c0-13.3 10.7-24 24-24s24 10.7 24 24l0 96 0 48c0 13.3-10.7 24-24 24c-6.6 0-12.6-2.7-17-7c-9.4 4.5-19.9 7-31 7c-39.8 0-72-32.2-72-72s32.2-72 72-72c8.4 0 16.5 1.4 24 4.1z"]
};
const faAd = faRectangleAd;
const faCircleArrowRight = {
  prefix: 'fas',
  iconName: 'circle-arrow-right',
  icon: [512, 512, ["arrow-circle-right"], "f0a9", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM297 385c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l71-71L120 280c-13.3 0-24-10.7-24-24s10.7-24 24-24l214.1 0-71-71c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L409 239c9.4 9.4 9.4 24.6 0 33.9L297 385z"]
};
const faArrowCircleRight = faCircleArrowRight;
const faFilterCircleXmark = {
  prefix: 'fas',
  iconName: 'filter-circle-xmark',
  icon: [576, 512, [], "e17b", "M3.9 22.9C10.5 8.9 24.5 0 40 0L472 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L396.4 195.6C316.2 212.1 256 283 256 368c0 27.4 6.3 53.4 17.5 76.5c-1.6-.8-3.2-1.8-4.7-2.9l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 65.3C-.7 53.4-2.8 36.8 3.9 22.9zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L432 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L409.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L432 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L454.6 368l36.7-36.7z"]
};
const faLocust = {
  prefix: 'fas',
  iconName: 'locust',
  icon: [576, 512, [], "e520", "M312 32c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0c98.7 0 180.6 71.4 197 165.4c-9-3.5-18.8-5.4-29-5.4l-64.2 0-41.8-97.5c-3.4-7.9-10.8-13.4-19.3-14.4s-17 2.7-22.1 9.6l-40.9 55.5-21.7-50.7c-3.3-7.8-10.5-13.2-18.9-14.3s-16.7 2.3-22 8.9l-240 304c-8.2 10.4-6.4 25.5 4 33.7s25.5 6.4 33.7-4l79.4-100.5 43 16.4-40.5 55c-7.9 10.7-5.6 25.7 5.1 33.6s25.7 5.6 33.6-5.1L215.1 400l74.5 0-29.3 42.3c-7.5 10.9-4.8 25.8 6.1 33.4s25.8 4.8 33.4-6.1L348 400l80.4 0 38.8 67.9c6.6 11.5 21.2 15.5 32.7 8.9s15.5-21.2 8.9-32.7L483.6 400l12.4 0c44.1 0 79.8-35.7 80-79.7c0-.1 0-.2 0-.3l0-40C576 143 465 32 328 32l-16 0zm50.5 168l17.1 40L333 240l29.5-40zm-87.7 38.1l-1.4 1.9-48.2 0 32.7-41.5 16.9 39.5zM88.8 240C57.4 240 32 265.4 32 296.8c0 15.5 6.3 30 16.9 40.4L126.7 240l-37.9 0zM496 288a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faSort = {
  prefix: 'fas',
  iconName: 'sort',
  icon: [320, 512, ["unsorted"], "f0dc", "M137.4 41.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8L32 224c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128zm0 429.3l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l256 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128c-12.5 12.5-32.8 12.5-45.3 0z"]
};
const faUnsorted = faSort;
const faListOl = {
  prefix: 'fas',
  iconName: 'list-ol',
  icon: [512, 512, ["list-1-2", "list-numeric"], "f0cb", "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faList12 = faListOl;
const faListNumeric = faListOl;
const faPersonDressBurst = {
  prefix: 'fas',
  iconName: 'person-dress-burst',
  icon: [640, 512, [], "e544", "M528 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM390.2 384l17.8 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 16 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 17.8 0c10.9 0 18.6-10.7 15.2-21.1L546.7 248.1l33.9 56.3c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-53.6-89.2c-20.2-33.7-56.7-54.3-96-54.3l-11.6 0c-39.3 0-75.7 20.6-96 54.3l-53.6 89.2c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9l33.9-56.3L375 362.9c-3.5 10.4 4.3 21.1 15.2 21.1zM190.9 18.1C188.4 12 182.6 8 176 8s-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L176 286.1l58.6 53.9c4.8 4.4 11.9 5.5 17.8 2.6s9.5-9 9-15.5l-5.6-79.4 50.5-7.8 24.4-40.5-55.2-38L315 92.2c3.3-5.7 2.7-12.8-1.4-17.9s-10.9-7.2-17.2-5.3L220.3 92.1l-29.4-74z"]
};
const faMoneyCheckDollar = {
  prefix: 'fas',
  iconName: 'money-check-dollar',
  icon: [576, 512, ["money-check-alt"], "f53d", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zM272 192l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zM256 304c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16zM164 152l0 13.9c7.5 1.2 14.6 2.9 21.1 4.7c10.7 2.8 17 13.8 14.2 24.5s-13.8 17-24.5 14.2c-11-2.9-21.6-5-31.2-5.2c-7.9-.1-16 1.8-21.5 5c-4.8 2.8-6.2 5.6-6.2 9.3c0 1.8 .1 3.5 5.3 6.7c6.3 3.8 15.5 6.7 28.3 10.5l.7 .2c11.2 3.4 25.6 7.7 37.1 15c12.9 8.1 24.3 21.3 24.6 41.6c.3 20.9-10.5 36.1-24.8 45c-7.2 4.5-15.2 7.3-23.2 9l0 13.8c0 11-9 20-20 20s-20-9-20-20l0-14.6c-10.3-2.2-20-5.5-28.2-8.4c0 0 0 0 0 0s0 0 0 0c-2.1-.7-4.1-1.4-6.1-2.1c-10.5-3.5-16.1-14.8-12.6-25.3s14.8-16.1 25.3-12.6c2.5 .8 4.9 1.7 7.2 2.4c13.6 4.6 24 8.1 35.1 8.5c8.6 .3 16.5-1.6 21.4-4.7c4.1-2.5 6-5.5 5.9-10.5c0-2.9-.8-5-5.9-8.2c-6.3-4-15.4-6.9-28-10.7l-1.7-.5c-10.9-3.3-24.6-7.4-35.6-14c-12.7-7.7-24.6-20.5-24.7-40.7c-.1-21.1 11.8-35.7 25.8-43.9c6.9-4.1 14.5-6.8 22.2-8.5l0-14c0-11 9-20 20-20s20 9 20 20z"]
};
const faMoneyCheckAlt = faMoneyCheckDollar;
const faVectorSquare = {
  prefix: 'fas',
  iconName: 'vector-square',
  icon: [448, 512, [], "f5cb", "M368 80l32 0 0 32-32 0 0-32zM352 32c-17.7 0-32 14.3-32 32L128 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64l0 64c0 17.7 14.3 32 32 32l0 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l192 0c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-192c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0zM96 160c17.7 0 32-14.3 32-32l192 0c0 17.7 14.3 32 32 32l0 192c-17.7 0-32 14.3-32 32l-192 0c0-17.7-14.3-32-32-32l0-192zM48 400l32 0 0 32-32 0 0-32zm320 32l0-32 32 0 0 32-32 0zM48 112l0-32 32 0 0 32-32 0z"]
};
const faBreadSlice = {
  prefix: 'fas',
  iconName: 'bread-slice',
  icon: [512, 512, [], "f7ec", "M256 32C192 32 0 64 0 192c0 35.3 28.7 64 64 64V432c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V256c35.3 0 64-28.7 64-64C512 64 320 32 256 32z"]
};
const faLanguage = {
  prefix: 'fas',
  iconName: 'language',
  icon: [640, 512, [], "f1ab", "M0 128C0 92.7 28.7 64 64 64l192 0 48 0 16 0 256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64l-256 0-16 0-48 0L64 448c-35.3 0-64-28.7-64-64L0 128zm320 0l0 256 256 0 0-256-256 0zM178.3 175.9c-3.2-7.2-10.4-11.9-18.3-11.9s-15.1 4.7-18.3 11.9l-64 144c-4.5 10.1 .1 21.9 10.2 26.4s21.9-.1 26.4-10.2l8.9-20.1 73.6 0 8.9 20.1c4.5 10.1 16.3 14.6 26.4 10.2s14.6-16.3 10.2-26.4l-64-144zM160 233.2L179 276l-38 0 19-42.8zM448 164c11 0 20 9 20 20l0 4 44 0 16 0c11 0 20 9 20 20s-9 20-20 20l-2 0-1.6 4.5c-8.9 24.4-22.4 46.6-39.6 65.4c.9 .6 1.8 1.1 2.7 1.6l18.9 11.3c9.5 5.7 12.5 18 6.9 27.4s-18 12.5-27.4 6.9l-18.9-11.3c-4.5-2.7-8.8-5.5-13.1-8.5c-10.6 7.5-21.9 14-34 19.4l-3.6 1.6c-10.1 4.5-21.9-.1-26.4-10.2s.1-21.9 10.2-26.4l3.6-1.6c6.4-2.9 12.6-6.1 18.5-9.8l-12.2-12.2c-7.8-7.8-7.8-20.5 0-28.3s20.5-7.8 28.3 0l14.6 14.6 .5 .5c12.4-13.1 22.5-28.3 29.8-45L448 228l-72 0c-11 0-20-9-20-20s9-20 20-20l52 0 0-4c0-11 9-20 20-20z"]
};
const faFaceKissWinkHeart = {
  prefix: 'fas',
  iconName: 'face-kiss-wink-heart',
  icon: [512, 512, [128536, "kiss-wink-heart"], "f598", "M498 339.7c9.1-26.2 14-54.4 14-83.7C512 114.6 397.4 0 256 0S0 114.6 0 256S114.6 512 256 512c35.4 0 69.1-7.2 99.7-20.2c-4.8-5.5-8.5-12.2-10.4-19.7l-22.9-89.3c-10-39 11.8-80.9 51.8-92.1c37.2-10.4 73.8 10.1 87.5 44c12.7-1.6 25.1 .4 36.2 5zM296 332c0 6.9-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4c-2.7 1.5-5.7 3-8.7 4.3c3.1 1.3 6 2.7 8.7 4.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3s-3.1 13.2-7.3 18.3c-4.3 5.2-10.1 9.7-16.7 13.4C258.7 443.1 241.4 448 224 448c-3.6 0-6.8-2.5-7.7-6s.6-7.2 3.8-9c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1l-.6-.4-.3-.2-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.5-1.4-4.1-4.1-4.1-7s1.6-5.6 4.1-7c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.1c.2-.1 .5-.3 .9-.5c.8-.5 2-1.2 3.4-2.1c2.8-1.9 6.5-4.5 10.2-7.6c3.7-3.1 7.2-6.6 9.6-10.1c2.5-3.5 3.5-6.4 3.5-8.6s-1-5-3.5-8.6c-2.5-3.5-5.9-6.9-9.6-10.1c-3.7-3.1-7.4-5.7-10.2-7.6c-1.4-.9-2.6-1.6-3.4-2.1c-.4-.2-.7-.4-.9-.5l-.2-.1c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-3.2-1.8-4.7-5.5-3.8-9s4.1-6 7.7-6c17.4 0 34.7 4.9 47.9 12.3c6.6 3.7 12.5 8.2 16.7 13.4c4.3 5.1 7.3 11.4 7.3 18.3zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm194.8 57.6c-17.6-23.5-52.8-23.5-70.4 0c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2zM434 352.3c-6-23.2-28.8-37-51.1-30.8s-35.4 30.1-29.5 53.4l22.9 89.3c2.2 8.7 11.2 13.9 19.8 11.4l84.9-23.8c22.2-6.2 35.4-30.1 29.5-53.4s-28.8-37-51.1-30.8l-20.2 5.6-5.4-21z"]
};
const faKissWinkHeart = faFaceKissWinkHeart;
const faFilter = {
  prefix: 'fas',
  iconName: 'filter',
  icon: [512, 512, [], "f0b0", "M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"]
};
const faQuestion = {
  prefix: 'fas',
  iconName: 'question',
  icon: [320, 512, [10067, 10068, 61736], "3f", "M80 160c0-35.3 28.7-64 64-64l32 0c35.3 0 64 28.7 64 64l0 3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74l0 1.4c0 17.7 14.3 32 32 32s32-14.3 32-32l0-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7l0-3.6c0-70.7-57.3-128-128-128l-32 0C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faFileSignature = {
  prefix: 'fas',
  iconName: 'file-signature',
  icon: [576, 512, [], "f573", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-19.3c-2.7 1.1-5.4 2-8.2 2.7l-60.1 15c-3 .7-6 1.2-9 1.4c-.9 .1-1.8 .2-2.7 .2l-64 0c-6.1 0-11.6-3.4-14.3-8.8l-8.8-17.7c-1.7-3.4-5.1-5.5-8.8-5.5s-7.2 2.1-8.8 5.5l-8.8 17.7c-2.9 5.9-9.2 9.4-15.7 8.8s-12.1-5.1-13.9-11.3L144 381l-9.8 32.8c-6.1 20.3-24.8 34.2-46 34.2L80 448c-8.8 0-16-7.2-16-16s7.2-16 16-16l8.2 0c7.1 0 13.3-4.6 15.3-11.4l14.9-49.5c3.4-11.3 13.8-19.1 25.6-19.1s22.2 7.8 25.6 19.1l11.6 38.6c7.4-6.2 16.8-9.7 26.8-9.7c15.9 0 30.4 9 37.5 23.2l4.4 8.8 8.9 0c-3.1-8.8-3.7-18.4-1.4-27.8l15-60.1c2.8-11.3 8.6-21.5 16.8-29.7L384 203.6l0-43.6-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM549.8 139.7c-15.6-15.6-40.9-15.6-56.6 0l-29.4 29.4 71 71 29.4-29.4c15.6-15.6 15.6-40.9 0-56.6l-14.4-14.4zM311.9 321c-4.1 4.1-7 9.2-8.4 14.9l-15 60.1c-1.4 5.5 .2 11.2 4.2 15.2s9.7 5.6 15.2 4.2l60.1-15c5.6-1.4 10.8-4.3 14.9-8.4L512.1 262.7l-71-71L311.9 321z"]
};
const faUpDownLeftRight = {
  prefix: 'fas',
  iconName: 'up-down-left-right',
  icon: [512, 512, ["arrows-alt"], "f0b2", "M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 96-96 0 0-32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-32 96 0 0 96-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0 0-96 96 0 0 32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 32-96 0 0-96 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z"]
};
const faArrowsAlt = faUpDownLeftRight;
const faHouseChimneyUser = {
  prefix: 'fas',
  iconName: 'house-chimney-user',
  icon: [576, 512, [], "e065", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L512 185l0-121c0-17.7-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32l0 36.7L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 160.4c0 35.3 28.7 64 64 64l320.4 0c35.5 0 64.2-28.8 64-64.3l-.7-160.2 32 0zM288 160a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM176 400c0-44.2 35.8-80 80-80l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16z"]
};
const faHandHoldingHeart = {
  prefix: 'fas',
  iconName: 'hand-holding-heart',
  icon: [576, 512, [], "f4be", "M163.9 136.9c-29.4-29.8-29.4-78.2 0-108s77-29.8 106.4 0l17.7 18 17.7-18c29.4-29.8 77-29.8 106.4 0s29.4 78.2 0 108L310.5 240.1c-6.2 6.3-14.3 9.4-22.5 9.4s-16.3-3.1-22.5-9.4L163.9 136.9zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5L192 512 32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l36.8 0 44.9-36c22.7-18.2 50.9-28 80-28l78.3 0 16 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l120.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384c0 0 0 0 0 0l-.9 0c.3 0 .6 0 .9 0z"]
};
const faPuzzlePiece = {
  prefix: 'fas',
  iconName: 'puzzle-piece',
  icon: [512, 512, [129513], "f12e", "M192 104.8c0-9.2-5.8-17.3-13.2-22.8C167.2 73.3 160 61.3 160 48c0-26.5 28.7-48 64-48s64 21.5 64 48c0 13.3-7.2 25.3-18.8 34c-7.4 5.5-13.2 13.6-13.2 22.8c0 12.8 10.4 23.2 23.2 23.2l56.8 0c26.5 0 48 21.5 48 48l0 56.8c0 12.8 10.4 23.2 23.2 23.2c9.2 0 17.3-5.8 22.8-13.2c8.7-11.6 20.7-18.8 34-18.8c26.5 0 48 28.7 48 64s-21.5 64-48 64c-13.3 0-25.3-7.2-34-18.8c-5.5-7.4-13.6-13.2-22.8-13.2c-12.8 0-23.2 10.4-23.2 23.2L384 464c0 26.5-21.5 48-48 48l-56.8 0c-12.8 0-23.2-10.4-23.2-23.2c0-9.2 5.8-17.3 13.2-22.8c11.6-8.7 18.8-20.7 18.8-34c0-26.5-28.7-48-64-48s-64 21.5-64 48c0 13.3 7.2 25.3 18.8 34c7.4 5.5 13.2 13.6 13.2 22.8c0 12.8-10.4 23.2-23.2 23.2L48 512c-26.5 0-48-21.5-48-48L0 343.2C0 330.4 10.4 320 23.2 320c9.2 0 17.3 5.8 22.8 13.2C54.7 344.8 66.7 352 80 352c26.5 0 48-28.7 48-64s-21.5-64-48-64c-13.3 0-25.3 7.2-34 18.8C40.5 250.2 32.4 256 23.2 256C10.4 256 0 245.6 0 232.8L0 176c0-26.5 21.5-48 48-48l120.8 0c12.8 0 23.2-10.4 23.2-23.2z"]
};
const faMoneyCheck = {
  prefix: 'fas',
  iconName: 'money-check',
  icon: [576, 512, [], "f53c", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm48 160l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zM96 336c0-8.8 7.2-16 16-16l352 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-352 0c-8.8 0-16-7.2-16-16zM376 160l80 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24z"]
};
const faStarHalfStroke = {
  prefix: 'fas',
  iconName: 'star-half-stroke',
  icon: [576, 512, ["star-half-alt"], "f5c0", "M288 376.4l.1-.1 26.4 14.1 85.2 45.5-16.5-97.6-4.8-28.7 20.7-20.5 70.1-69.3-96.1-14.2-29.3-4.3-12.9-26.6L288.1 86.9l-.1 .3 0 289.2zm175.1 98.3c2 12-3 24.2-12.9 31.3s-23 8-33.8 2.3L288.1 439.8 159.8 508.3C149 514 135.9 513.1 126 506s-14.9-19.3-12.9-31.3L137.8 329 33.6 225.9c-8.6-8.5-11.7-21.2-7.9-32.7s13.7-19.9 25.7-21.7L195 150.3 259.4 18c5.4-11 16.5-18 28.8-18s23.4 7 28.8 18l64.3 132.3 143.6 21.2c12 1.8 22 10.2 25.7 21.7s.7 24.2-7.9 32.7L438.5 329l24.6 145.7z"]
};
const faStarHalfAlt = faStarHalfStroke;
const faCode = {
  prefix: 'fas',
  iconName: 'code',
  icon: [640, 512, [], "f121", "M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"]
};
const faWhiskeyGlass = {
  prefix: 'fas',
  iconName: 'whiskey-glass',
  icon: [512, 512, [129347, "glass-whiskey"], "f7a0", "M32 32c-9.3 0-18.1 4-24.2 11.1S-1 59.4 .3 68.6l50 342.9c5.7 39.3 39.4 68.5 79.2 68.5l253 0c39.7 0 73.4-29.1 79.2-68.5l50-342.9c1.3-9.2-1.4-18.5-7.5-25.5S489.3 32 480 32L32 32zM87.7 224L69 96l374 0L424.3 224 87.7 224z"]
};
const faGlassWhiskey = faWhiskeyGlass;
const faBuildingCircleExclamation = {
  prefix: 'fas',
  iconName: 'building-circle-exclamation',
  icon: [640, 512, [], "e4d3", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c15.1 0 28.5-6.9 37.3-17.8C340.4 462.2 320 417.5 320 368c0-54.7 24.9-103.5 64-135.8L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faMagnifyingGlassChart = {
  prefix: 'fas',
  iconName: 'magnifying-glass-chart',
  icon: [512, 512, [], "e522", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zm-312 8l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80-96l0 160c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80 64l0 96c0 13.3 10.7 24 24 24s24-10.7 24-24l0-96c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
};
const faArrowUpRightFromSquare = {
  prefix: 'fas',
  iconName: 'arrow-up-right-from-square',
  icon: [512, 512, ["external-link"], "f08e", "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]
};
const faExternalLink = faArrowUpRightFromSquare;
const faCubesStacked = {
  prefix: 'fas',
  iconName: 'cubes-stacked',
  icon: [448, 512, [], "e4e6", "M192 64l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32zM82.7 207c-15.3 8.8-20.5 28.4-11.7 43.7l32 55.4c8.8 15.3 28.4 20.5 43.7 11.7l55.4-32c15.3-8.8 20.5-28.4 11.7-43.7l-32-55.4c-8.8-15.3-28.4-20.5-43.7-11.7L82.7 207zM288 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0zm64 160c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0zM160 384l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32zM32 352c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0z"]
};
const faWonSign = {
  prefix: 'fas',
  iconName: 'won-sign',
  icon: [512, 512, [8361, "krw", "won"], "f159", "M62.4 53.9C56.8 37.1 38.6 28.1 21.9 33.6S-3.9 57.4 1.6 74.1L51.6 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l40.9 0 56.7 170.1c4.5 13.5 17.4 22.4 31.6 21.9s26.4-10.4 29.8-24.2L233 288l46 0L321 455.8c3.4 13.8 15.6 23.7 29.8 24.2s27.1-8.4 31.6-21.9L439.1 288l40.9 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-19.6 0 50-149.9c5.6-16.8-3.5-34.9-20.2-40.5s-34.9 3.5-40.5 20.2L392.9 224l-64 0L287 56.2C283.5 42 270.7 32 256 32s-27.5 10-31 24.2L183 224l-64 0L62.4 53.9zm78 234.1l26.6 0-11.4 45.6L140.4 288zM249 224l7-28.1 7 28.1-14 0zm96 64l26.6 0-15.2 45.6L345 288z"]
};
const faKrw = faWonSign;
const faWon = faWonSign;
const faVirusCovid = {
  prefix: 'fas',
  iconName: 'virus-covid',
  icon: [512, 512, [], "e4a8", "M192 24c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 33.6c30.7 4.2 58.8 16.3 82.3 34.1L386.1 92 374.8 80.6c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l56.6 56.6c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L420 125.9l-23.8 23.8c17.9 23.5 29.9 51.7 34.1 82.3l33.6 0 0-16c0-13.3 10.7-24 24-24s24 10.7 24 24l0 80c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-33.6 0c-4.2 30.7-16.3 58.8-34.1 82.3L420 386.1l11.3-11.3c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-56.6 56.6c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L386.1 420l-23.8-23.8c-23.5 17.9-51.7 29.9-82.3 34.1l0 33.6 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-33.6c-30.7-4.2-58.8-16.3-82.3-34.1L125.9 420l11.3 11.3c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L46.7 408.7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L92 386.1l23.8-23.8C97.9 338.8 85.8 310.7 81.6 280L48 280l0 16c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-80c0-13.3 10.7-24 24-24s24 10.7 24 24l0 16 33.6 0c4.2-30.7 16.3-58.8 34.1-82.3L92 125.9 80.6 137.2c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l56.6-56.6c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L125.9 92l23.8 23.8c23.5-17.9 51.7-29.9 82.3-34.1L232 48l-16 0c-13.3 0-24-10.7-24-24zm48 200a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm64 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faAustralSign = {
  prefix: 'fas',
  iconName: 'austral-sign',
  icon: [448, 512, [], "e0a9", "M253.5 51.7C248.6 39.8 236.9 32 224 32s-24.6 7.8-29.5 19.7L122.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0L82.7 320 32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l24 0L34.5 435.7c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L125.3 384l197.3 0 31.8 76.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8L392 384l24 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-50.7 0L352 288l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-90.7 0L253.5 51.7zM256 224l-64 0 32-76.8L256 224zm-90.7 64l117.3 0L296 320l-144 0 13.3-32z"]
};
const faF = {
  prefix: 'fas',
  iconName: 'f',
  icon: [320, 512, [102], "46", "M64 32C28.7 32 0 60.7 0 96L0 256 0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 224 64 96l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32z"]
};
const faLeaf = {
  prefix: 'fas',
  iconName: 'leaf',
  icon: [512, 512, [], "f06c", "M272 96c-78.6 0-145.1 51.5-167.7 122.5c33.6-17 71.5-26.5 111.7-26.5l88 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0-72 0s0 0 0 0c-16.6 0-32.7 1.9-48.3 5.4c-25.9 5.9-49.9 16.4-71.4 30.7c0 0 0 0 0 0C38.3 298.8 0 364.9 0 440l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16c0-48.7 20.7-92.5 53.8-123.2C121.6 392.3 190.3 448 272 448l1 0c132.1-.7 239-130.9 239-291.4c0-42.6-7.5-83.1-21.1-119.6c-2.6-6.9-12.7-6.6-16.2-.1C455.9 72.1 418.7 96 376 96L272 96z"]
};
const faRoad = {
  prefix: 'fas',
  iconName: 'road',
  icon: [576, 512, [128739], "f018", "M256 32l-74.8 0c-27.1 0-51.3 17.1-60.3 42.6L3.1 407.2C1.1 413 0 419.2 0 425.4C0 455.5 24.5 480 54.6 480L256 480l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64 201.4 0c30.2 0 54.6-24.5 54.6-54.6c0-6.2-1.1-12.4-3.1-18.2L455.1 74.6C446 49.1 421.9 32 394.8 32L320 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm64 192l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faTaxi = {
  prefix: 'fas',
  iconName: 'taxi',
  icon: [512, 512, [128662, "cab"], "f1ba", "M192 0c-17.7 0-32 14.3-32 32l0 32 0 .2c-38.6 2.2-72.3 27.3-85.2 64.1L39.6 228.8C16.4 238.4 0 261.3 0 288L0 432l0 48c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-48 320 0 0 48c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-48 0-144c0-26.7-16.4-49.6-39.6-59.2L437.2 128.3c-12.9-36.8-46.6-62-85.2-64.1l0-.2 0-32c0-17.7-14.3-32-32-32L192 0zM165.4 128l181.2 0c13.6 0 25.7 8.6 30.2 21.4L402.9 224l-293.8 0 26.1-74.6c4.5-12.8 16.6-21.4 30.2-21.4zM96 288a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm288 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faCab = faTaxi;
const faPersonCirclePlus = {
  prefix: 'fas',
  iconName: 'person-circle-plus',
  icon: [576, 512, [], "e541", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm16 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0 0-48z"]
};
const faChartPie = {
  prefix: 'fas',
  iconName: 'chart-pie',
  icon: [576, 512, ["pie-chart"], "f200", "M304 240l0-223.4c0-9 7-16.6 16-16.6C443.7 0 544 100.3 544 224c0 9-7.6 16-16.6 16L304 240zM32 272C32 150.7 122.1 50.3 239 34.3c9.2-1.3 17 6.1 17 15.4L256 288 412.5 444.5c6.7 6.7 6.2 17.7-1.5 23.1C371.8 495.6 323.8 512 272 512C139.5 512 32 404.6 32 272zm526.4 16c9.3 0 16.6 7.8 15.4 17c-7.7 55.9-34.6 105.6-73.9 142.3c-6 5.6-15.4 5.2-21.2-.7L320 288l238.4 0z"]
};
const faPieChart = faChartPie;
const faBoltLightning = {
  prefix: 'fas',
  iconName: 'bolt-lightning',
  icon: [384, 512, [], "e0b7", "M0 256L28.5 28c2-16 15.6-28 31.8-28H228.9c15 0 27.1 12.1 27.1 27.1c0 3.2-.6 6.5-1.7 9.5L208 160H347.3c20.2 0 36.7 16.4 36.7 36.7c0 7.4-2.2 14.6-6.4 20.7l-192.2 281c-5.9 8.6-15.6 13.7-25.9 13.7h-2.9c-15.7 0-28.5-12.8-28.5-28.5c0-2.3 .3-4.6 .9-6.9L176 288H32c-17.7 0-32-14.3-32-32z"]
};
const faSackXmark = {
  prefix: 'fas',
  iconName: 'sack-xmark',
  icon: [512, 512, [], "e56a", "M192 96l128 0 47.4-71.1C374.5 14.2 366.9 0 354.1 0L157.9 0c-12.8 0-20.4 14.2-13.3 24.9L192 96zm128 32l-128 0c-3.8 2.5-8.1 5.3-13 8.4c0 0 0 0 0 0s0 0 0 0C122.3 172.7 0 250.9 0 416c0 53 43 96 96 96l320 0c53 0 96-43 96-96c0-165.1-122.3-243.3-179-279.6c-4.8-3.1-9.2-5.9-13-8.4zM289.9 336l47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47z"]
};
const faFileExcel = {
  prefix: 'fas',
  iconName: 'file-excel',
  icon: [384, 512, [], "f1c3", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM155.7 250.2L192 302.1l36.3-51.9c7.6-10.9 22.6-13.5 33.4-5.9s13.5 22.6 5.9 33.4L221.3 344l46.4 66.2c7.6 10.9 5 25.8-5.9 33.4s-25.8 5-33.4-5.9L192 385.8l-36.3 51.9c-7.6 10.9-22.6 13.5-33.4 5.9s-13.5-22.6-5.9-33.4L162.7 344l-46.4-66.2c-7.6-10.9-5-25.8 5.9-33.4s25.8-5 33.4 5.9z"]
};
const faFileContract = {
  prefix: 'fas',
  iconName: 'file-contract',
  icon: [384, 512, [], "f56c", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM80 64l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 96c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm54.2 253.8c-6.1 20.3-24.8 34.2-46 34.2L80 416c-8.8 0-16-7.2-16-16s7.2-16 16-16l8.2 0c7.1 0 13.3-4.6 15.3-11.4l14.9-49.5c3.4-11.3 13.8-19.1 25.6-19.1s22.2 7.7 25.6 19.1l11.6 38.6c7.4-6.2 16.8-9.7 26.8-9.7c15.9 0 30.4 9 37.5 23.2l4.4 8.8 54.1 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-6.1 0-11.6-3.4-14.3-8.8l-8.8-17.7c-1.7-3.4-5.1-5.5-8.8-5.5s-7.2 2.1-8.8 5.5l-8.8 17.7c-2.9 5.9-9.2 9.4-15.7 8.8s-12.1-5.1-13.9-11.3L144 349l-9.8 32.8z"]
};
const faFishFins = {
  prefix: 'fas',
  iconName: 'fish-fins',
  icon: [576, 512, [], "e4f2", "M275.2 38.4c-10.6-8-25-8.5-36.3-1.5S222 57.3 224.6 70.3l9.7 48.6c-19.4 9-36.9 19.9-52.4 31.5c-15.3 11.5-29 23.9-40.7 36.3L48.1 132.4c-12.5-7.3-28.4-5.3-38.6 4.9S-3 163.3 4.2 175.9L50 256 4.2 336.1c-7.2 12.6-5 28.4 5.3 38.6s26.1 12.2 38.6 4.9l93.1-54.3c11.8 12.3 25.4 24.8 40.7 36.3c15.5 11.6 33 22.5 52.4 31.5l-9.7 48.6c-2.6 13 3.1 26.3 14.3 33.3s25.6 6.5 36.3-1.5l77.6-58.2c54.9-4 101.5-27 137.2-53.8c39.2-29.4 67.2-64.7 81.6-89.5c5.8-9.9 5.8-22.2 0-32.1c-14.4-24.8-42.5-60.1-81.6-89.5c-35.8-26.8-82.3-49.8-137.2-53.8L275.2 38.4zM384 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faBuildingFlag = {
  prefix: 'fas',
  iconName: 'building-flag',
  icon: [640, 512, [], "e4d5", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c26.5 0 48-21.5 48-48l0-416c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM448 0c-17.7 0-32 14.3-32 32l0 480 64 0 0-320 144 0c8.8 0 16-7.2 16-16l0-128c0-8.8-7.2-16-16-16L480 32c0-17.7-14.3-32-32-32z"]
};
const faFaceGrinBeam = {
  prefix: 'fas',
  iconName: 'face-grin-beam',
  icon: [512, 512, [128516, "grin-beam"], "f582", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zm-170.5-84s0 0 0 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0zm160 0c0 0 0 0 0 0l-.2-.2c-.2-.2-.4-.5-.7-.9c-.6-.8-1.6-2-2.8-3.4c-2.5-2.8-6-6.6-10.2-10.3c-8.8-7.8-18.8-14-27.7-14s-18.9 6.2-27.7 14c-4.2 3.7-7.7 7.5-10.2 10.3c-1.2 1.4-2.2 2.6-2.8 3.4c-.3 .4-.6 .7-.7 .9l-.2 .2c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0c-2.1 2.8-5.7 3.9-8.9 2.8s-5.5-4.1-5.5-7.6c0-17.9 6.7-35.6 16.6-48.8c9.8-13 23.9-23.2 39.4-23.2s29.6 10.2 39.4 23.2c9.9 13.2 16.6 30.9 16.6 48.8c0 3.4-2.2 6.5-5.5 7.6s-6.9 0-8.9-2.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0z"]
};
const faGrinBeam = faFaceGrinBeam;
const faObjectUngroup = {
  prefix: 'fas',
  iconName: 'object-ungroup',
  icon: [640, 512, [], "f248", "M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32l209.1 0C339.6 12.9 360.3 0 384 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4l0 113.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32l-209.1 0c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4l0-113.1zM119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4l0 113.1c9.7 5.6 17.8 13.7 23.4 23.4l209.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-113.1c-9.7-5.6-17.8-13.7-23.4-23.4L119.4 96zm192 384c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4l0-40.6 64 0 0 40.6c9.7 5.6 17.8 13.7 23.4 23.4l209.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-113.1c-9.7-5.6-17.8-13.7-23.4-23.4l-46 0c-5.4-15.4-14.6-28.9-26.5-39.6l0-24.4 72.6 0c11.1-19.1 31.7-32 55.4-32c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4l0 113.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32l-209.1 0z"]
};
const faPoop = {
  prefix: 'fas',
  iconName: 'poop',
  icon: [512, 512, [], "f619", "M254.4 6.6c3.5-4.3 9-6.5 14.5-5.7C315.8 7.2 352 47.4 352 96c0 11.2-1.9 22-5.5 32l5.5 0c35.3 0 64 28.7 64 64c0 19.1-8.4 36.3-21.7 48l13.7 0c39.8 0 72 32.2 72 72c0 23.2-11 43.8-28 57c34.1 5.7 60 35.3 60 71c0 39.8-32.2 72-72 72L72 512c-39.8 0-72-32.2-72-72c0-35.7 25.9-65.3 60-71c-17-13.2-28-33.8-28-57c0-39.8 32.2-72 72-72l13.7 0C104.4 228.3 96 211.1 96 192c0-35.3 28.7-64 64-64l16.2 0c44.1-.1 79.8-35.9 79.8-80c0-9.2-1.5-17.9-4.3-26.1c-1.8-5.2-.8-11.1 2.8-15.4z"]
};
const faLocationPin = {
  prefix: 'fas',
  iconName: 'location-pin',
  icon: [384, 512, ["map-marker"], "f041", "M384 192c0 87.4-117 243-168.3 307.2c-12.3 15.3-35.1 15.3-47.4 0C117 435 0 279.4 0 192C0 86 86 0 192 0S384 86 384 192z"]
};
const faMapMarker = faLocationPin;
const faKaaba = {
  prefix: 'fas',
  iconName: 'kaaba',
  icon: [576, 512, [128331], "f66b", "M60 120l228 71.2L516 120 288 48.8 60 120zM278.5 1.5c6.2-1.9 12.9-1.9 19.1 0l256 80C566.9 85.6 576 98 576 112l0 16s0 0 0 0l0 21.2L292.8 237.7c-3.1 1-6.4 1-9.5 0L0 149.2 0 128l0-16C0 98 9.1 85.6 22.5 81.5l256-80zm23.9 266.8L576 182.8l0 46.5-52.8 16.5c-8.4 2.6-13.1 11.6-10.5 20s11.6 13.1 20 10.5L576 262.8 576 400c0 14-9.1 26.4-22.5 30.5l-256 80c-6.2 1.9-12.9 1.9-19.1 0l-256-80C9.1 426.4 0 414 0 400L0 262.8l43.2 13.5c8.4 2.6 17.4-2.1 20-10.5s-2.1-17.4-10.5-20L0 229.2l0-46.5 273.7 85.5c9.3 2.9 19.3 2.9 28.6 0zm-185.5-2.6c-8.4-2.6-17.4 2.1-20 10.5s2.1 17.4 10.5 20l64 20c8.4 2.6 17.4-2.1 20-10.5s-2.1-17.4-10.5-20l-64-20zm352 30.5c8.4-2.6 13.1-11.6 10.5-20s-11.6-13.1-20-10.5l-64 20c-8.4 2.6-13.1 11.6-10.5 20s11.6 13.1 20 10.5l64-20zm-224 9.5c-8.4-2.6-17.4 2.1-20 10.5s2.1 17.4 10.5 20l38.5 12c9.3 2.9 19.3 2.9 28.6 0l38.5-12c8.4-2.6 13.1-11.6 10.5-20s-11.6-13.1-20-10.5l-38.5 12c-3.1 1-6.4 1-9.5 0l-38.5-12z"]
};
const faToiletPaper = {
  prefix: 'fas',
  iconName: 'toilet-paper',
  icon: [640, 512, [129531], "f71e", "M444.2 0C397.2 49.6 384 126.5 384 192c0 158.8-27.3 247-42.7 283.9c-10 24-33.2 36.1-55.4 36.1L48 512c-11.5 0-22.2-6.2-27.8-16.2s-5.6-22.3 .4-32.2c9.8-17.7 15.4-38.2 20.5-57.7C52.3 362.8 64 293.5 64 192C64 86 107 0 160 0L444.2 0zM512 384c-53 0-96-86-96-192S459 0 512 0s96 86 96 192s-43 192-96 192zm0-128c17.7 0 32-28.7 32-64s-14.3-64-32-64s-32 28.7-32 64s14.3 64 32 64zM144 208a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm64 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm80-16a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faHelmetSafety = {
  prefix: 'fas',
  iconName: 'helmet-safety',
  icon: [576, 512, ["hard-hat", "hat-hard"], "f807", "M256 32c-17.7 0-32 14.3-32 32l0 2.3 0 99.6c0 5.6-4.5 10.1-10.1 10.1c-3.6 0-7-1.9-8.8-5.1L157.1 87C83 123.5 32 199.8 32 288l0 64 512 0 0-66.4c-.9-87.2-51.7-162.4-125.1-198.6l-48 83.9c-1.8 3.2-5.2 5.1-8.8 5.1c-5.6 0-10.1-4.5-10.1-10.1l0-99.6 0-2.3c0-17.7-14.3-32-32-32l-64 0zM16.6 384C7.4 384 0 391.4 0 400.6c0 4.7 2 9.2 5.8 11.9C27.5 428.4 111.8 480 288 480s260.5-51.6 282.2-67.5c3.8-2.8 5.8-7.2 5.8-11.9c0-9.2-7.4-16.6-16.6-16.6L16.6 384z"]
};
const faHardHat = faHelmetSafety;
const faHatHard = faHelmetSafety;
const faEject = {
  prefix: 'fas',
  iconName: 'eject',
  icon: [448, 512, [9167], "f052", "M224 32c13.5 0 26.3 5.6 35.4 15.6l176 192c12.9 14 16.2 34.3 8.6 51.8S419 320 400 320L48 320c-19 0-36.3-11.2-43.9-28.7s-4.3-37.7 8.6-51.8l176-192C197.7 37.6 210.5 32 224 32zM0 432c0-26.5 21.5-48 48-48l352 0c26.5 0 48 21.5 48 48s-21.5 48-48 48L48 480c-26.5 0-48-21.5-48-48z"]
};
const faCircleRight = {
  prefix: 'fas',
  iconName: 'circle-right',
  icon: [512, 512, [61838, "arrow-alt-circle-right"], "f35a", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm395.3 11.3l-112 112c-4.6 4.6-11.5 5.9-17.4 3.5s-9.9-8.3-9.9-14.8l0-64-96 0c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32l96 0 0-64c0-6.5 3.9-12.3 9.9-14.8s12.9-1.1 17.4 3.5l112 112c6.2 6.2 6.2 16.4 0 22.6z"]
};
const faArrowAltCircleRight = faCircleRight;
const faPlaneCircleCheck = {
  prefix: 'fas',
  iconName: 'plane-circle-check',
  icon: [640, 512, [], "e555", "M256 0c-35 0-64 59.5-64 93.7l0 84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9l0 65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8l0 42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3l0-84.6C320 59.5 292 0 256 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faFaceRollingEyes = {
  prefix: 'fas',
  iconName: 'face-rolling-eyes',
  icon: [512, 512, [128580, "meh-rolling-eyes"], "f5a5", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 368l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm32-144c0 35.3-28.7 64-64 64s-64-28.7-64-64c0-26 15.5-48.4 37.8-58.4c-3.7 5.2-5.8 11.6-5.8 18.4c0 17.7 14.3 32 32 32s32-14.3 32-32c0-6.9-2.2-13.2-5.8-18.4C208.5 175.6 224 198 224 224zm128 64c-35.3 0-64-28.7-64-64c0-26 15.5-48.4 37.8-58.4c-3.7 5.2-5.8 11.6-5.8 18.4c0 17.7 14.3 32 32 32s32-14.3 32-32c0-6.9-2.2-13.2-5.8-18.4C400.5 175.6 416 198 416 224c0 35.3-28.7 64-64 64z"]
};
const faMehRollingEyes = faFaceRollingEyes;
const faObjectGroup = {
  prefix: 'fas',
  iconName: 'object-group',
  icon: [576, 512, [], "f247", "M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32l337.1 0C467.6 12.9 488.3 0 512 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4l0 273.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32l-337.1 0c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4l0-273.1zM456.6 96L119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4l0 273.1c9.7 5.6 17.8 13.7 23.4 23.4l337.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-273.1c-9.7-5.6-17.8-13.7-23.4-23.4zM128 160c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-96zM256 320l32 0c35.3 0 64-28.7 64-64l0-32 64 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-32z"]
};
const faChartLine = {
  prefix: 'fas',
  iconName: 'chart-line',
  icon: [512, 512, ["line-chart"], "f201", "M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L240 221.3l57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z"]
};
const faLineChart = faChartLine;
const faMaskVentilator = {
  prefix: 'fas',
  iconName: 'mask-ventilator',
  icon: [640, 512, [], "e524", "M159.1 176C139.4 219.2 128 264.7 128 300.8c0 15.9 2.2 31.4 6.3 46l-31.8-7.9C70.5 330.9 48 302.1 48 269l0-85c0-4.4 3.6-8 8-8l103.1 0zm26-48L56 128c-30.9 0-56 25.1-56 56l0 85c0 55.1 37.5 103.1 90.9 116.4l71.3 17.8c22.7 30.5 55.4 54.1 93.8 66.6l0-76.6c-19.7-16.4-32-40.3-32-66.9c0-49.5 43-134.4 96-134.4c52.5 0 96 84.9 96 134.4c0 26.7-12.4 50.4-32 66.8l0 76.6c38-12.6 70.6-36 93.5-66.4l71.6-17.9C602.5 372.1 640 324.1 640 269l0-85c0-30.9-25.1-56-56-56l-129.5 0C419.7 73.8 372.1 32 320 32c-52.6 0-100.2 41.8-134.9 96zm295.6 48L584 176c4.4 0 8 3.6 8 8l0 85c0 33-22.5 61.8-54.5 69.9l-31.8 8c4.2-14.7 6.4-30.1 6.4-46.1c0-36.1-11.6-81.6-31.3-124.8zM288 320l0 192 64 0 0-192c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faArrowRight = {
  prefix: 'fas',
  iconName: 'arrow-right',
  icon: [448, 512, [8594], "f061", "M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]
};
const faSignsPost = {
  prefix: 'fas',
  iconName: 'signs-post',
  icon: [512, 512, ["map-signs"], "f277", "M224 32L64 32C46.3 32 32 46.3 32 64l0 64c0 17.7 14.3 32 32 32l377.4 0c4.2 0 8.3-1.7 11.3-4.7l48-48c6.2-6.2 6.2-16.4 0-22.6l-48-48c-3-3-7.1-4.7-11.3-4.7L288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32zM480 256c0-17.7-14.3-32-32-32l-160 0 0-32-64 0 0 32L70.6 224c-4.2 0-8.3 1.7-11.3 4.7l-48 48c-6.2 6.2-6.2 16.4 0 22.6l48 48c3 3 7.1 4.7 11.3 4.7L448 352c17.7 0 32-14.3 32-32l0-64zM288 480l0-96-64 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
};
const faMapSigns = faSignsPost;
const faCashRegister = {
  prefix: 'fas',
  iconName: 'cash-register',
  icon: [512, 512, [], "f788", "M64 0C46.3 0 32 14.3 32 32l0 64c0 17.7 14.3 32 32 32l80 0 0 32-57 0c-31.6 0-58.5 23.1-63.3 54.4L1.1 364.1C.4 368.8 0 373.6 0 378.4L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-69.6c0-4.8-.4-9.6-1.1-14.4L488.2 214.4C483.5 183.1 456.6 160 425 160l-217 0 0-32 80 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L64 0zM96 48l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L96 80c-8.8 0-16-7.2-16-16s7.2-16 16-16zM64 432c0-8.8 7.2-16 16-16l352 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16zm48-168a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm120-24a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM160 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM328 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM256 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM424 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM352 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48z"]
};
const faPersonCircleQuestion = {
  prefix: 'fas',
  iconName: 'person-circle-question',
  icon: [576, 512, [], "e542", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM368 321.6l0 6.4c0 8.8 7.2 16 16 16s16-7.2 16-16l0-6.4c0-5.3 4.3-9.6 9.6-9.6l40.5 0c7.7 0 13.9 6.2 13.9 13.9c0 5.2-2.9 9.9-7.4 12.3l-32 16.8c-5.3 2.8-8.6 8.2-8.6 14.2l0 14.8c0 8.8 7.2 16 16 16s16-7.2 16-16l0-5.1 23.5-12.3c15.1-7.9 24.5-23.6 24.5-40.6c0-25.4-20.6-45.9-45.9-45.9l-40.5 0c-23 0-41.6 18.6-41.6 41.6z"]
};
const faH = {
  prefix: 'fas',
  iconName: 'h',
  icon: [384, 512, [104], "48", "M320 256l0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224 0-160c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 128L64 192 64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192 256 0z"]
};
const faTarp = {
  prefix: 'fas',
  iconName: 'tarp',
  icon: [576, 512, [], "e57b", "M576 128c0-35.3-28.7-64-64-64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l352 0 0-128c0-17.7 14.3-32 32-32l128 0 0-160zM448 448L576 320l-128 0 0 128zM96 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faScrewdriverWrench = {
  prefix: 'fas',
  iconName: 'screwdriver-wrench',
  icon: [512, 512, ["tools"], "f7d9", "M78.6 5C69.1-2.4 55.6-1.5 47 7L7 47c-8.5 8.5-9.4 22-2.1 31.6l80 104c4.5 5.9 11.6 9.4 19 9.4l54.1 0 109 109c-14.7 29-10 65.4 14.3 89.6l112 112c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-112-112c-24.2-24.2-60.6-29-89.6-14.3l-109-109 0-54.1c0-7.5-3.5-14.5-9.4-19L78.6 5zM19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L233.7 374.3c-7.8-20.9-9-43.6-3.6-65.1l-61.7-61.7L19.9 396.1zM512 144c0-10.5-1.1-20.7-3.2-30.5c-2.4-11.2-16.1-14.1-24.2-6l-63.9 63.9c-3 3-7.1 4.7-11.3 4.7L352 176c-8.8 0-16-7.2-16-16l0-57.4c0-4.2 1.7-8.3 4.7-11.3l63.9-63.9c8.1-8.1 5.2-21.8-6-24.2C388.7 1.1 378.5 0 368 0C288.5 0 224 64.5 224 144l0 .8 85.3 85.3c36-9.1 75.8 .5 104 28.7L429 274.5c49-23 83-72.8 83-130.5zM56 432a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faTools = faScrewdriverWrench;
const faArrowsToEye = {
  prefix: 'fas',
  iconName: 'arrows-to-eye',
  icon: [640, 512, [], "e4bf", "M15 15C24.4 5.7 39.6 5.7 49 15l63 63L112 40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 96c0 13.3-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l38.1 0L15 49C5.7 39.6 5.7 24.4 15 15zM133.5 243.9C158.6 193.6 222.7 112 320 112s161.4 81.6 186.5 131.9c3.8 7.6 3.8 16.5 0 24.2C481.4 318.4 417.3 400 320 400s-161.4-81.6-186.5-131.9c-3.8-7.6-3.8-16.5 0-24.2zM320 320a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM591 15c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-63 63 38.1 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24s24 10.7 24 24l0 38.1 63-63zM15 497c-9.4-9.4-9.4-24.6 0-33.9l63-63L40 400c-13.3 0-24-10.7-24-24s10.7-24 24-24l96 0c13.3 0 24 10.7 24 24l0 96c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-38.1L49 497c-9.4 9.4-24.6 9.4-33.9 0zm576 0l-63-63 0 38.1c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-96c0-13.3 10.7-24 24-24l96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-38.1 0 63 63c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0z"]
};
const faPlugCircleBolt = {
  prefix: 'fas',
  iconName: 'plug-circle-bolt',
  icon: [576, 512, [], "e55b", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm47.9-225c4.3 3.7 5.4 9.9 2.6 14.9L452.4 356l35.6 0c5.2 0 9.8 3.3 11.4 8.2s-.1 10.3-4.2 13.4l-96 72c-4.5 3.4-10.8 3.2-15.1-.6s-5.4-9.9-2.6-14.9L411.6 380 376 380c-5.2 0-9.8-3.3-11.4-8.2s.1-10.3 4.2-13.4l96-72c4.5-3.4 10.8-3.2 15.1 .6z"]
};
const faHeart = {
  prefix: 'fas',
  iconName: 'heart',
  icon: [512, 512, [128153, 128154, 128155, 128156, 128420, 129293, 129294, 129505, 9829, 10084, 61578], "f004", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"]
};
const faMarsAndVenus = {
  prefix: 'fas',
  iconName: 'mars-and-venus',
  icon: [512, 512, [9893], "f224", "M337.8 14.8C341.5 5.8 350.3 0 360 0L472 0c13.3 0 24 10.7 24 24l0 112c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-24.7 24.7C407 163.3 416 192.6 416 224c0 80.2-59 146.6-136 158.2l0 25.8 24 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-24 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-25.8C155 370.6 96 304.2 96 224c0-88.4 71.6-160 160-160c39.6 0 75.9 14.4 103.8 38.2L382.1 80 343 41c-6.9-6.9-8.9-17.2-5.2-26.2zM448 48s0 0 0 0s0 0 0 0s0 0 0 0zM352 224a96 96 0 1 0 -192 0 96 96 0 1 0 192 0z"]
};
const faHouseUser = {
  prefix: 'fas',
  iconName: 'house-user',
  icon: [576, 512, ["home-user"], "e1b0", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c.2 35.5-28.5 64.3-64 64.3l-320.4 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24zM352 224a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zm-96 96c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80l-64 0z"]
};
const faHomeUser = faHouseUser;
const faDumpsterFire = {
  prefix: 'fas',
  iconName: 'dumpster-fire',
  icon: [640, 512, [], "f794", "M49.7 32l90.8 0L114.9 160l-94 0C9.3 160 0 150.7 0 139.1c0-2.1 .3-4.1 .9-6.1L26.8 48.9C29.9 38.9 39.2 32 49.7 32zM272 160l-124.5 0L173.1 32 272 32l0 128zm32 0l0-128 98.9 0 14.4 72.1c-1.7 1.1-3.3 2.4-4.8 3.8c-18.4 16.4-35.4 34-50.5 52.1l-58 0zm209.9-23.7c-1.7 1.6-3.4 3.2-5 4.8C498 129.6 486.7 118.6 475 108c-7.6-6.9-17-10.8-26.6-11.8L435.5 32l90.8 0c10.5 0 19.8 6.9 22.9 16.9L575.1 133c.2 .7 .4 1.4 .5 2.1c-17.8-15-44.3-14.6-61.7 1.2zM325.2 210.7C304.3 244.5 288 282.9 288 318.1c0 49.3 18.6 95.2 49.6 129.9L128 448c0 17.7-14.3 32-32 32s-32-14.3-32-32L44 288l-12 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l4 0-4-32 305.5 0c-4.4 6.2-8.5 12.5-12.3 18.7zm180.6-34.5L518 162.5c5.4-6.1 13.3-8.8 20.9-8.9c7.2 0 14.3 2.6 19.9 7.8c19.7 18.3 39.8 43.2 55 70.6C629 259.2 640 290.2 640 320.2C640 408.8 568.7 480 480 480c-89.6 0-160-71.3-160-159.8c0-37.3 16-73.4 36.8-104.5c20.9-31.3 47.5-59 70.9-80.2c5.7-5.2 13.1-7.7 20.3-7.5c14.1 .3 23.8 11.4 32.7 21.6c0 0 0 0 0 0c2 2.3 4 4.6 6 6.7l19 19.9zM544 368.2c0-36.5-37-73-54.8-88.4c-5.4-4.7-13.1-4.7-18.5 0C453 295.1 416 331.6 416 368.2c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faHouseCrack = {
  prefix: 'fas',
  iconName: 'house-crack',
  icon: [576, 512, [], "e3b1", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 160.4c0 35.3 28.7 64 64 64l102.3 0-31.3-52.2c-4.1-6.8-2.6-15.5 3.5-20.5L288 368l-60.2-82.8c-10.9-15 8.2-33.5 22.8-22l117.9 92.6c8 6.3 8.2 18.4 .4 24.9L288 448l38.4 64 122.1 0c35.5 0 64.2-28.8 64-64.3l-.7-160.2 32 0z"]
};
const faMartiniGlassCitrus = {
  prefix: 'fas',
  iconName: 'martini-glass-citrus',
  icon: [576, 512, ["cocktail"], "f561", "M432 240c53 0 96-43 96-96s-43-96-96-96c-35.5 0-66.6 19.3-83.2 48l-52.6 0C316 40.1 369.3 0 432 0c79.5 0 144 64.5 144 144s-64.5 144-144 144c-27.7 0-53.5-7.8-75.5-21.3l35.4-35.4c12.2 5.6 25.8 8.7 40.1 8.7zM1.8 142.8C5.5 133.8 14.3 128 24 128l368 0c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-177 177L232 464l64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0-88 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-118.1L7 169c-6.9-6.9-8.9-17.2-5.2-26.2z"]
};
const faCocktail = faMartiniGlassCitrus;
const faFaceSurprise = {
  prefix: 'fas',
  iconName: 'face-surprise',
  icon: [512, 512, [128558, "surprise"], "f5c2", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM256 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faSurprise = faFaceSurprise;
const faBottleWater = {
  prefix: 'fas',
  iconName: 'bottle-water',
  icon: [320, 512, [], "e4c5", "M120 0l80 0c13.3 0 24 10.7 24 24l0 40L96 64l0-40c0-13.3 10.7-24 24-24zM32 167.5c0-19.5 10-37.6 26.6-47.9l15.8-9.9C88.7 100.7 105.2 96 122.1 96l75.8 0c16.9 0 33.4 4.7 47.7 13.7l15.8 9.9C278 129.9 288 148 288 167.5c0 17-7.5 32.3-19.4 42.6C280.6 221.7 288 238 288 256c0 19.1-8.4 36.3-21.7 48c13.3 11.7 21.7 28.9 21.7 48s-8.4 36.3-21.7 48c13.3 11.7 21.7 28.9 21.7 48c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64c0-19.1 8.4-36.3 21.7-48C40.4 388.3 32 371.1 32 352s8.4-36.3 21.7-48C40.4 292.3 32 275.1 32 256c0-18 7.4-34.3 19.4-45.9C39.5 199.7 32 184.5 32 167.5zM96 240c0 8.8 7.2 16 16 16l96 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-96 0c-8.8 0-16 7.2-16 16zm16 112c-8.8 0-16 7.2-16 16s7.2 16 16 16l96 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-96 0z"]
};
const faCirclePause = {
  prefix: 'fas',
  iconName: 'circle-pause',
  icon: [512, 512, [62092, "pause-circle"], "f28b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM224 192l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faPauseCircle = faCirclePause;
const faToiletPaperSlash = {
  prefix: 'fas',
  iconName: 'toilet-paper-slash',
  icon: [640, 512, [], "e072", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-109.7-86C569.9 374 608 291.9 608 192C608 86 565 0 512 0s-96 86-96 192c0 49.1 9.2 93.9 24.4 127.9l-59-46.2c1.6-24.8 2.6-52 2.6-81.6c0-65.5 13.2-142.4 60.2-192L160 0c-24.8 0-47.4 18.8-64.4 49.6L38.8 5.1zM367.3 385.4L66.5 148.4C64.9 162.4 64 177 64 192c0 101.5-11.7 170.8-23 213.9c-5.1 19.4-10.7 39.9-20.5 57.7c-5.9 9.9-6.1 22.1-.4 32.2S36.5 512 48 512l237.9 0c22.3 0 45.4-12.1 55.4-36.1c7.4-17.7 17.5-47.2 26-90.6zM544 192c0 35.3-14.3 64-32 64s-32-28.7-32-64s14.3-64 32-64s32 28.7 32 64z"]
};
const faAppleWhole = {
  prefix: 'fas',
  iconName: 'apple-whole',
  icon: [448, 512, [127822, 127823, "apple-alt"], "f5d1", "M224 112c-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80l16 0c8.8 0 16 7.2 16 16l0 16c0 44.2-35.8 80-80 80l-16 0zM0 288c0-76.3 35.7-160 112-160c27.3 0 59.7 10.3 82.7 19.3c18.8 7.3 39.9 7.3 58.7 0c22.9-8.9 55.4-19.3 82.7-19.3c76.3 0 112 83.7 112 160c0 128-80 224-160 224c-16.5 0-38.1-6.6-51.5-11.3c-8.1-2.8-16.9-2.8-25 0c-13.4 4.7-35 11.3-51.5 11.3C80 512 0 416 0 288z"]
};
const faAppleAlt = faAppleWhole;
const faKitchenSet = {
  prefix: 'fas',
  iconName: 'kitchen-set',
  icon: [576, 512, [], "e51a", "M240 144A96 96 0 1 0 48 144a96 96 0 1 0 192 0zm44.4 32C269.9 240.1 212.5 288 144 288C64.5 288 0 223.5 0 144S64.5 0 144 0c68.5 0 125.9 47.9 140.4 112l71.8 0c8.8-9.8 21.6-16 35.8-16l104 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-104 0c-14.2 0-27-6.2-35.8-16l-71.8 0zM144 80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM400 240c13.3 0 24 10.7 24 24l0 8 96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-240 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l96 0 0-8c0-13.3 10.7-24 24-24zM288 464l0-112 224 0 0 112c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48zM48 320l80 0 16 0 32 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-16 0c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-80c0-8.8 7.2-16 16-16zm128 64c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0 32 16 0zM24 464l176 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faR = {
  prefix: 'fas',
  iconName: 'r',
  icon: [320, 512, [114], "52", "M64 32C28.7 32 0 60.7 0 96L0 288 0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 95.3 0L261.8 466.4c10.1 14.5 30.1 18 44.6 7.9s18-30.1 7.9-44.6L230.1 309.5C282.8 288.1 320 236.4 320 176c0-79.5-64.5-144-144-144L64 32zM176 256L64 256 64 96l112 0c44.2 0 80 35.8 80 80s-35.8 80-80 80z"]
};
const faTemperatureQuarter = {
  prefix: 'fas',
  iconName: 'temperature-quarter',
  icon: [320, 512, ["temperature-1", "thermometer-1", "thermometer-quarter"], "f2ca", "M160 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L208 112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L48 112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3l0-50.7c0-8.8 7.2-16 16-16s16 7.2 16 16l0 50.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faTemperature1 = faTemperatureQuarter;
const faThermometer1 = faTemperatureQuarter;
const faThermometerQuarter = faTemperatureQuarter;
const faCube = {
  prefix: 'fas',
  iconName: 'cube',
  icon: [512, 512, [], "f1b2", "M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6l0 242.9c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4L0 134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1 0-188L288 246.6l0 188z"]
};
const faBitcoinSign = {
  prefix: 'fas',
  iconName: 'bitcoin-sign',
  icon: [320, 512, [], "e0b4", "M48 32C48 14.3 62.3 0 80 0s32 14.3 32 32l0 32 32 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32c0 1.5-.1 3.1-.3 4.5C254.1 82.2 288 125.1 288 176c0 24.2-7.7 46.6-20.7 64.9c31.7 19.8 52.7 55 52.7 95.1c0 61.9-50.1 112-112 112l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-6.3 0C18.7 448 0 429.3 0 406.3L0 288l0-22.3L0 224 0 101.6C0 80.8 16.8 64 37.6 64L48 64l0-32zM64 224l112 0c26.5 0 48-21.5 48-48s-21.5-48-48-48L64 128l0 96zm112 64L64 288l0 96 144 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-32 0z"]
};
const faShieldDog = {
  prefix: 'fas',
  iconName: 'shield-dog',
  icon: [512, 512, [], "e573", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM160.9 286.2c4.8 1.2 9.9 1.8 15.1 1.8c35.3 0 64-28.7 64-64l0-64 44.2 0c12.1 0 23.2 6.8 28.6 17.7L320 192l64 0c8.8 0 16 7.2 16 16l0 32c0 44.2-35.8 80-80 80l-48 0 0 50.7c0 7.3-5.9 13.3-13.3 13.3c-1.8 0-3.6-.4-5.2-1.1l-98.7-42.3c-6.6-2.8-10.8-9.3-10.8-16.4c0-2.8 .6-5.5 1.9-8l15-30zM160 160l40 0 8 0 0 32 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-48c0-8.8 7.2-16 16-16zm128 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faSolarPanel = {
  prefix: 'fas',
  iconName: 'solar-panel',
  icon: [640, 512, [], "f5ba", "M122.2 0C91.7 0 65.5 21.5 59.5 51.4L8.3 307.4C.4 347 30.6 384 71 384l217 0 0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64 217 0c40.4 0 70.7-36.9 62.8-76.6l-51.2-256C574.5 21.5 548.3 0 517.8 0L122.2 0zM260.9 64l118.2 0 10.4 104-139 0L260.9 64zM202.3 168l-100.8 0L122.2 64l90.4 0L202.3 168zM91.8 216l105.6 0L187.1 320 71 320 91.8 216zm153.9 0l148.6 0 10.4 104-169.4 0 10.4-104zm196.8 0l105.6 0L569 320l-116 0L442.5 216zm96-48l-100.8 0L427.3 64l90.4 0 31.4-6.3L517.8 64l20.8 104z"]
};
const faLockOpen = {
  prefix: 'fas',
  iconName: 'lock-open',
  icon: [576, 512, [], "f3c1", "M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z"]
};
const faElevator = {
  prefix: 'fas',
  iconName: 'elevator',
  icon: [512, 512, [], "e16d", "M132.7 4.7l-64 64c-4.6 4.6-5.9 11.5-3.5 17.4s8.3 9.9 14.8 9.9l128 0c6.5 0 12.3-3.9 14.8-9.9s1.1-12.9-3.5-17.4l-64-64c-6.2-6.2-16.4-6.2-22.6 0zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 128zm96 96a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM80 400c0-26.5 21.5-48 48-48l64 0c26.5 0 48 21.5 48 48l0 16c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-16zm192 0c0-26.5 21.5-48 48-48l64 0c26.5 0 48 21.5 48 48l0 16c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-16zm32-128a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM356.7 91.3c6.2 6.2 16.4 6.2 22.6 0l64-64c4.6-4.6 5.9-11.5 3.5-17.4S438.5 0 432 0L304 0c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l64 64z"]
};
const faMoneyBillTransfer = {
  prefix: 'fas',
  iconName: 'money-bill-transfer',
  icon: [640, 512, [], "e528", "M535 41c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l64 64c4.5 4.5 7 10.6 7 17s-2.5 12.5-7 17l-64 64c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l23-23L384 112c-13.3 0-24-10.7-24-24s10.7-24 24-24l174.1 0L535 41zM105 377l-23 23L256 400c13.3 0 24 10.7 24 24s-10.7 24-24 24L81.9 448l23 23c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 441c-4.5-4.5-7-10.6-7-17s2.5-12.5 7-17l64-64c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM96 64l241.9 0c-3.7 7.2-5.9 15.3-5.9 24c0 28.7 23.3 52 52 52l117.4 0c-4 17 .6 35.5 13.8 48.8c20.3 20.3 53.2 20.3 73.5 0L608 169.5 608 384c0 35.3-28.7 64-64 64l-241.9 0c3.7-7.2 5.9-15.3 5.9-24c0-28.7-23.3-52-52-52l-117.4 0c4-17-.6-35.5-13.8-48.8c-20.3-20.3-53.2-20.3-73.5 0L32 342.5 32 128c0-35.3 28.7-64 64-64zm64 64l-64 0 0 64c35.3 0 64-28.7 64-64zM544 320c-35.3 0-64 28.7-64 64l64 0 0-64zM320 352a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"]
};
const faMoneyBillTrendUp = {
  prefix: 'fas',
  iconName: 'money-bill-trend-up',
  icon: [512, 512, [], "e529", "M470.7 9.4c3 3.1 5.3 6.6 6.9 10.3s2.4 7.8 2.4 12.2c0 0 0 .1 0 .1c0 0 0 0 0 0l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.7L310.6 214.6c-11.8 11.8-30.8 12.6-43.5 1.7L176 138.1 84.8 216.3c-13.4 11.5-33.6 9.9-45.1-3.5s-9.9-33.6 3.5-45.1l112-96c12-10.3 29.7-10.3 41.7 0l89.5 76.7L370.7 64 352 64c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0s0 0 0 0c8.8 0 16.8 3.6 22.6 9.3l.1 .1zM0 304c0-26.5 21.5-48 48-48l416 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 304zM48 416l0 48 48 0c0-26.5-21.5-48-48-48zM96 304l-48 0 0 48c26.5 0 48-21.5 48-48zM464 416c-26.5 0-48 21.5-48 48l48 0 0-48zM416 304c0 26.5 21.5 48 48 48l0-48-48 0zm-96 80a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faHouseFloodWaterCircleArrowRight = {
  prefix: 'fas',
  iconName: 'house-flood-water-circle-arrow-right',
  icon: [640, 512, [], "e50f", "M288 144A144 144 0 1 0 0 144a144 144 0 1 0 288 0zM140.7 76.7c6.2-6.2 16.4-6.2 22.6 0l56 56c6.2 6.2 6.2 16.4 0 22.6l-56 56c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L169.4 160 80 160c-8.8 0-16-7.2-16-16s7.2-16 16-16l89.4 0L140.7 99.3c-6.2-6.2-6.2-16.4 0-22.6zM320 144c0 57.3-27.4 108.2-69.8 140.3c11.8-3.6 23-9.4 33-16.2c22.1-15.5 51.6-15.5 73.7 0c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.4 78.1 3.4c2.1 1.7 4.2 3.3 6.5 4.9l-.3-84.4 16.6 0c13.9 0 26.1-8.9 30.4-22.1s-.4-27.6-11.6-35.8l-176-128C407.6-2 392.4-2 381.2 6.1L301 64.4c12.1 23.9 19 50.9 19 79.6zm18.5 165.9c-11.1-7.9-25.9-7.9-37 0C279 325.4 251.5 336 224 336c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C158.5 389.7 191 400 224 400c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.6 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.5-27.3-10.1-39.2-1.7c0 0 0 0 0 0C471.4 325.2 442.9 336 416 336c-27.5 0-55-10.6-77.5-26.1zm0 112c-11.1-7.9-25.9-7.9-37 0C279 437.4 251.5 448 224 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C158.5 501.7 191 512 224 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.6 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C471.4 437.2 442.9 448 416 448c-27.5 0-55-10.6-77.5-26.1z"]
};
const faSquarePollHorizontal = {
  prefix: 'fas',
  iconName: 'square-poll-horizontal',
  icon: [448, 512, ["poll-h"], "f682", "M448 96c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320zM256 160c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32zm64 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l192 0zM192 352c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32z"]
};
const faPollH = faSquarePollHorizontal;
const faCircle = {
  prefix: 'fas',
  iconName: 'circle',
  icon: [512, 512, [128308, 128309, 128992, 128993, 128994, 128995, 128996, 9679, 9898, 9899, 11044, 61708, 61915], "f111", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"]
};
const faBackwardFast = {
  prefix: 'fas',
  iconName: 'backward-fast',
  icon: [512, 512, [9198, "fast-backward"], "f049", "M493.6 445c-11.2 5.3-24.5 3.6-34.1-4.4L288 297.7 288 416c0 12.4-7.2 23.7-18.4 29s-24.5 3.6-34.1-4.4L64 297.7 64 416c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 96C0 78.3 14.3 64 32 64s32 14.3 32 32l0 118.3L235.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S288 83.6 288 96l0 118.3L459.5 71.4c9.5-7.9 22.8-9.7 34.1-4.4S512 83.6 512 96l0 320c0 12.4-7.2 23.7-18.4 29z"]
};
const faFastBackward = faBackwardFast;
const faRecycle = {
  prefix: 'fas',
  iconName: 'recycle',
  icon: [512, 512, [9842, 9850, 9851], "f1b8", "M174.7 45.1C192.2 17 223 0 256 0s63.8 17 81.3 45.1l38.6 61.7 27-15.6c8.4-4.9 18.9-4.2 26.6 1.7s11.1 15.9 8.6 25.3l-23.4 87.4c-3.4 12.8-16.6 20.4-29.4 17l-87.4-23.4c-9.4-2.5-16.3-10.4-17.6-20s3.4-19.1 11.8-23.9l28.4-16.4L283 79c-5.8-9.3-16-15-27-15s-21.2 5.7-27 15l-17.5 28c-9.2 14.8-28.6 19.5-43.6 10.5c-15.3-9.2-20.2-29.2-10.7-44.4l17.5-28zM429.5 251.9c15-9 34.4-4.3 43.6 10.5l24.4 39.1c9.4 15.1 14.4 32.4 14.6 50.2c.3 53.1-42.7 96.4-95.8 96.4L320 448l0 32c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-64-64c-9.4-9.4-9.4-24.6 0-33.9l64-64c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 32 96.2 0c17.6 0 31.9-14.4 31.8-32c0-5.9-1.7-11.7-4.8-16.7l-24.4-39.1c-9.5-15.2-4.7-35.2 10.7-44.4zm-364.6-31L36 204.2c-8.4-4.9-13.1-14.3-11.8-23.9s8.2-17.5 17.6-20l87.4-23.4c12.8-3.4 26 4.2 29.4 17L182 241.2c2.5 9.4-.9 19.3-8.6 25.3s-18.2 6.6-26.6 1.7l-26.5-15.3L68.8 335.3c-3.1 5-4.8 10.8-4.8 16.7c-.1 17.6 14.2 32 31.8 32l32.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32.2 0C42.7 448-.3 404.8 0 351.6c.1-17.8 5.1-35.1 14.6-50.2l50.3-80.5z"]
};
const faUserAstronaut = {
  prefix: 'fas',
  iconName: 'user-astronaut',
  icon: [448, 512, [], "f4fb", "M370.7 96.1C346.1 39.5 289.7 0 224 0S101.9 39.5 77.3 96.1C60.9 97.5 48 111.2 48 128l0 64c0 16.8 12.9 30.5 29.3 31.9C101.9 280.5 158.3 320 224 320s122.1-39.5 146.7-96.1c16.4-1.4 29.3-15.1 29.3-31.9l0-64c0-16.8-12.9-30.5-29.3-31.9zM336 144l0 16c0 53-43 96-96 96l-32 0c-53 0-96-43-96-96l0-16c0-26.5 21.5-48 48-48l128 0c26.5 0 48 21.5 48 48zM189.3 162.7l-6-21.2c-.9-3.3-3.9-5.5-7.3-5.5s-6.4 2.2-7.3 5.5l-6 21.2-21.2 6c-3.3 .9-5.5 3.9-5.5 7.3s2.2 6.4 5.5 7.3l21.2 6 6 21.2c.9 3.3 3.9 5.5 7.3 5.5s6.4-2.2 7.3-5.5l6-21.2 21.2-6c3.3-.9 5.5-3.9 5.5-7.3s-2.2-6.4-5.5-7.3l-21.2-6zM112.7 316.5C46.7 342.6 0 407 0 482.3C0 498.7 13.3 512 29.7 512l98.3 0 0-64c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32l0 64 98.3 0c16.4 0 29.7-13.3 29.7-29.7c0-75.3-46.7-139.7-112.7-165.8C303.9 338.8 265.5 352 224 352s-79.9-13.2-111.3-35.5zM176 448c-8.8 0-16 7.2-16 16l0 48 32 0 0-48c0-8.8-7.2-16-16-16zm96 32a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faPlaneSlash = {
  prefix: 'fas',
  iconName: 'plane-slash',
  icon: [640, 512, [], "e069", "M514.3 192c34.2 0 93.7 29 93.7 64c0 36-59.5 64-93.7 64l-73.8 0L630.8 469.1c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2S28.4-3.1 38.8 5.1L238.1 161.3 197.8 20.4C194.9 10.2 202.6 0 213.2 0l56.2 0c11.5 0 22.1 6.2 27.8 16.1L397.7 192l116.6 0zM41.5 128.7l321 252.9L297.2 495.9c-5.7 10-16.3 16.1-27.8 16.1l-56.2 0c-10.6 0-18.3-10.2-15.4-20.4l49-171.6L144 320l-43.2 57.6c-3 4-7.8 6.4-12.8 6.4l-42 0c-7.8 0-14-6.3-14-14c0-1.3 .2-2.6 .5-3.9L64 256 32.5 145.9c-.4-1.3-.5-2.6-.5-3.9c0-6.2 4-11.4 9.5-13.3z"]
};
const faTrademark = {
  prefix: 'fas',
  iconName: 'trademark',
  icon: [640, 512, [8482], "f25c", "M345.6 108.8c-8.3-11-22.7-15.5-35.7-11.2S288 114.2 288 128l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 86.4 115.2c6 8.1 15.5 12.8 25.6 12.8s19.6-4.7 25.6-12.8L576 224l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-256c0-13.8-8.8-26-21.9-30.4s-27.5 .1-35.7 11.2L464 266.7 345.6 108.8zM0 128c0 17.7 14.3 32 32 32l64 0 0 224c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 96C14.3 96 0 110.3 0 128z"]
};
const faBasketball = {
  prefix: 'fas',
  iconName: 'basketball',
  icon: [512, 512, [127936, "basketball-ball"], "f434", "M86.6 64l85.2 85.2C194.5 121.7 208 86.4 208 48c0-14.7-2-28.9-5.7-42.4C158.6 15 119 35.5 86.6 64zM64 86.6C35.5 119 15 158.6 5.6 202.3C19.1 206 33.3 208 48 208c38.4 0 73.7-13.5 101.3-36.1L64 86.6zM256 0c-7.3 0-14.6 .3-21.8 .9C238 16 240 31.8 240 48c0 47.3-17.1 90.5-45.4 124L256 233.4 425.4 64C380.2 24.2 320.9 0 256 0zM48 240c-16.2 0-32-2-47.1-5.8C.3 241.4 0 248.7 0 256c0 64.9 24.2 124.2 64 169.4L233.4 256 172 194.6C138.5 222.9 95.3 240 48 240zm463.1 37.8c.6-7.2 .9-14.5 .9-21.8c0-64.9-24.2-124.2-64-169.4L278.6 256 340 317.4c33.4-28.3 76.7-45.4 124-45.4c16.2 0 32 2 47.1 5.8zm-4.7 31.9C492.9 306 478.7 304 464 304c-38.4 0-73.7 13.5-101.3 36.1L448 425.4c28.5-32.3 49.1-71.9 58.4-115.7zM340.1 362.7C317.5 390.3 304 425.6 304 464c0 14.7 2 28.9 5.7 42.4C353.4 497 393 476.5 425.4 448l-85.2-85.2zM317.4 340L256 278.6 86.6 448c45.1 39.8 104.4 64 169.4 64c7.3 0 14.6-.3 21.8-.9C274 496 272 480.2 272 464c0-47.3 17.1-90.5 45.4-124z"]
};
const faBasketballBall = faBasketball;
const faSatelliteDish = {
  prefix: 'fas',
  iconName: 'satellite-dish',
  icon: [512, 512, [128225], "f7c0", "M192 32c0-17.7 14.3-32 32-32C383.1 0 512 128.9 512 288c0 17.7-14.3 32-32 32s-32-14.3-32-32C448 164.3 347.7 64 224 64c-17.7 0-32-14.3-32-32zM60.6 220.6L164.7 324.7l28.4-28.4c-.7-2.6-1.1-5.4-1.1-8.3c0-17.7 14.3-32 32-32s32 14.3 32 32s-14.3 32-32 32c-2.9 0-5.6-.4-8.3-1.1l-28.4 28.4L291.4 451.4c14.5 14.5 11.8 38.8-7.3 46.3C260.5 506.9 234.9 512 208 512C93.1 512 0 418.9 0 304c0-26.9 5.1-52.5 14.4-76.1c7.5-19 31.8-21.8 46.3-7.3zM224 96c106 0 192 86 192 192c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-70.7-57.3-128-128-128c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faCircleUp = {
  prefix: 'fas',
  iconName: 'circle-up',
  icon: [512, 512, [61467, "arrow-alt-circle-up"], "f35b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm11.3-395.3l112 112c4.6 4.6 5.9 11.5 3.5 17.4s-8.3 9.9-14.8 9.9l-64 0 0 96c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-96-64 0c-6.5 0-12.3-3.9-14.8-9.9s-1.1-12.9 3.5-17.4l112-112c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faArrowAltCircleUp = faCircleUp;
const faMobileScreenButton = {
  prefix: 'fas',
  iconName: 'mobile-screen-button',
  icon: [384, 512, ["mobile-alt"], "f3cd", "M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM224 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM304 64L80 64l0 320 224 0 0-320z"]
};
const faMobileAlt = faMobileScreenButton;
const faVolumeHigh = {
  prefix: 'fas',
  iconName: 'volume-high',
  icon: [640, 512, [128266, "volume-up"], "f028", "M533.6 32.5C598.5 85.2 640 165.8 640 256s-41.5 170.7-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64l0 384c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352 64 352c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l67.8 0L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z"]
};
const faVolumeUp = faVolumeHigh;
const faUsersRays = {
  prefix: 'fas',
  iconName: 'users-rays',
  icon: [640, 512, [], "e593", "M41 7C31.6-2.3 16.4-2.3 7 7S-2.3 31.6 7 41l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L41 7zM599 7L527 79c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0zM7 505c9.4 9.4 24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L7 471c-9.4 9.4-9.4 24.6 0 33.9zm592 0c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-72-72c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72zM320 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM212.1 336c-2.7 7.5-4.1 15.6-4.1 24c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24c0-8.4-1.4-16.5-4.1-24c-.5-1.4-1-2.7-1.6-4c-9.4-22.3-29.8-38.9-54.3-43c-3.9-.7-7.9-1-12-1l-80 0c-4.1 0-8.1 .3-12 1c-.8 .1-1.7 .3-2.5 .5c-24.9 5.1-45.1 23-53.4 46.5zM175.8 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-26.5 32C119.9 256 96 279.9 96 309.3c0 14.7 11.9 26.7 26.7 26.7l56.1 0c8-34.1 32.8-61.7 65.2-73.6c-7.5-4.1-16.2-6.4-25.3-6.4l-69.3 0zm368 80c14.7 0 26.7-11.9 26.7-26.7c0-29.5-23.9-53.3-53.3-53.3l-69.3 0c-9.2 0-17.8 2.3-25.3 6.4c32.4 11.9 57.2 39.5 65.2 73.6l56.1 0zM464 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faWallet = {
  prefix: 'fas',
  iconName: 'wallet',
  icon: [512, 512, [], "f555", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L80 128c-8.8 0-16-7.2-16-16s7.2-16 16-16l368 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32zM416 272a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faClipboardCheck = {
  prefix: 'fas',
  iconName: 'clipboard-check',
  icon: [384, 512, [], "f46c", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]
};
const faFileAudio = {
  prefix: 'fas',
  iconName: 'file-audio',
  icon: [384, 512, [], "f1c7", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zm2 226.3c37.1 22.4 62 63.1 62 109.7s-24.9 87.3-62 109.7c-7.6 4.6-17.4 2.1-22-5.4s-2.1-17.4 5.4-22C269.4 401.5 288 370.9 288 336s-18.6-65.5-46.5-82.3c-7.6-4.6-10-14.4-5.4-22s14.4-10 22-5.4zm-91.9 30.9c6 2.5 9.9 8.3 9.9 14.8l0 128c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5L113.4 376 80 376c-8.8 0-16-7.2-16-16l0-48c0-8.8 7.2-16 16-16l33.4 0 35.3-35.3c4.6-4.6 11.5-5.9 17.4-3.5zm51 34.9c6.6-5.9 16.7-5.3 22.6 1.3C249.8 304.6 256 319.6 256 336s-6.2 31.4-16.3 42.7c-5.9 6.6-16 7.1-22.6 1.3s-7.1-16-1.3-22.6c5.1-5.7 8.1-13.1 8.1-21.3s-3.1-15.7-8.1-21.3c-5.9-6.6-5.3-16.7 1.3-22.6z"]
};
const faBurger = {
  prefix: 'fas',
  iconName: 'burger',
  icon: [512, 512, ["hamburger"], "f805", "M61.1 224C45 224 32 211 32 194.9c0-1.9 .2-3.7 .6-5.6C37.9 168.3 78.8 32 256 32s218.1 136.3 223.4 157.3c.5 1.9 .6 3.7 .6 5.6c0 16.1-13 29.1-29.1 29.1L61.1 224zM144 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm240 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32zM272 96a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zM16 304c0-26.5 21.5-48 48-48l384 0c26.5 0 48 21.5 48 48s-21.5 48-48 48L64 352c-26.5 0-48-21.5-48-48zm16 96c0-8.8 7.2-16 16-16l416 0c8.8 0 16 7.2 16 16l0 16c0 35.3-28.7 64-64 64L96 480c-35.3 0-64-28.7-64-64l0-16z"]
};
const faHamburger = faBurger;
const faWrench = {
  prefix: 'fas',
  iconName: 'wrench',
  icon: [512, 512, [128295], "f0ad", "M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7L336 192c-8.8 0-16-7.2-16-16l0-57.4c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-21.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faBugs = {
  prefix: 'fas',
  iconName: 'bugs',
  icon: [576, 512, [], "e4d0", "M164.5 107.4l33.4-73.5c5.5-12.1 .1-26.3-11.9-31.8s-26.3-.1-31.8 11.9L128 71.7 101.9 14.1C96.4 2 82.1-3.3 70.1 2.1S52.7 21.9 58.1 33.9l33.4 73.5c-10.2 7.1-18.2 17-22.9 28.6l-17 0-4.1-20.7c-2.6-13-15.2-21.4-28.2-18.8S-2.1 111.7 .5 124.7l8 40C10.7 175.9 20.6 184 32 184l32 0 0 23.3-37.8 9.5c-9.5 2.4-16.6 10.2-17.9 19.9l-8 56c-1.9 13.1 7.2 25.3 20.4 27.2s25.3-7.2 27.2-20.4l5.7-40 18.4-4.6C82.7 274.6 103.8 288 128 288s45.3-13.4 56.1-33.2l18.4 4.6 5.7 40c1.9 13.1 14 22.2 27.2 20.4s22.2-14 20.4-27.2l-8-56c-1.4-9.7-8.5-17.5-17.9-19.9L192 207.3l0-23.3 32 0c11.4 0 21.3-8.1 23.5-19.3l8-40c2.6-13-5.8-25.6-18.8-28.2s-25.6 5.8-28.2 18.8L204.3 136l-17 0c-4.7-11.6-12.7-21.5-22.9-28.6zM496 286.5l65.6-47c10.8-7.7 13.3-22.7 5.6-33.5s-22.7-13.3-33.5-5.6l-51.4 36.8 6.1-62.9c1.3-13.2-8.4-24.9-21.6-26.2s-24.9 8.4-26.2 21.6L432.8 250c-12.3 1-24.2 5.6-34.1 13.3L384 254.8l6.8-20c4.2-12.6-2.5-26.2-15-30.4s-26.2 2.5-30.4 15l-13.1 38.6c-3.7 10.8 .8 22.8 10.7 28.5l27.7 16L359 322.7 321.5 312c-9.4-2.7-19.5 .6-25.5 8.3l-34.9 44.5c-8.2 10.4-6.4 25.5 4.1 33.7s25.5 6.4 33.7-4.1l25-31.8 18.2 5.2c-.5 22.6 11 44.7 32 56.8s45.9 11 65.2-.7l13.6 13.2-15.1 37.5c-4.9 12.3 1 26.3 13.3 31.2s26.3-1 31.2-13.3L503.5 440c3.6-9.1 1.4-19.4-5.6-26.2l-28-27.1 11.6-20.1 27.7 16c9.9 5.7 22.5 3.7 30-4.9L566.2 347c8.7-10 7.8-25.1-2.2-33.9s-25.1-7.8-33.9 2.2l-13.9 15.9-14.7-8.5c1.7-12.4-.2-25-5.5-36.2z"]
};
const faRupeeSign = {
  prefix: 'fas',
  iconName: 'rupee-sign',
  icon: [448, 512, [8360, "rupee"], "f156", "M0 64C0 46.3 14.3 32 32 32l80 0c79.5 0 144 64.5 144 144c0 58.8-35.2 109.3-85.7 131.7l51.4 128.4c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8L106.3 320 64 320l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 288 0 64zM64 256l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80L64 96l0 160zm256.5 16.4c-.9 6 0 8.7 .4 9.8c.4 1.1 1.4 2.6 4.2 4.9c7.2 5.7 18.7 10 37.9 16.8l1.3 .5c16 5.6 38.7 13.6 55.7 28.1c9.5 8.1 17.9 18.6 23.1 32.3c5.1 13.7 6.1 28.5 3.8 44c-4.2 28.1-20.5 49.3-43.8 60.9c-22.1 11-48.1 12.5-73.2 8l-.2 0s0 0 0 0c-9.3-1.8-20.5-5.7-29.3-9c-6-2.3-12.6-4.9-17.7-6.9c0 0 0 0 0 0c-2.5-1-4.6-1.8-6.3-2.5c-16.5-6.4-24.6-25-18.2-41.4s24.9-24.6 41.4-18.2c2.6 1 5.2 2 7.9 3.1c0 0 0 0 0 0c4.8 1.9 9.8 3.9 15.4 6c8.8 3.3 15.3 5.4 18.7 6c15.7 2.8 26.7 .8 32.9-2.3c5-2.5 8-6 9.1-13c1-6.9 .2-10.5-.5-12.3c-.6-1.7-1.8-3.6-4.5-5.9c-6.9-5.8-18.2-10.4-36.9-17l-3-1.1c-15.5-5.4-37-13-53.3-25.9c-9.5-7.5-18.3-17.6-23.7-31c-5.5-13.4-6.6-28-4.4-43.2c8.4-57.1 67-78 116.9-68.9c6.9 1.3 27.3 5.8 35.4 8.4c16.9 5.2 26.3 23.2 21.1 40.1s-23.2 26.3-40.1 21.1c-4.7-1.4-22.3-5.5-27.9-6.5c-14.6-2.7-25.8-.4-32.6 3.2c-6.3 3.3-8.9 7.6-9.5 12z"]
};
const faRupee = faRupeeSign;
const faFileImage = {
  prefix: 'fas',
  iconName: 'file-image',
  icon: [384, 512, [128443], "f1c5", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM64 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm152 32c5.3 0 10.2 2.6 13.2 6.9l88 128c3.4 4.9 3.7 11.3 1 16.5s-8.2 8.6-14.2 8.6l-88 0-40 0-48 0-48 0c-5.8 0-11.1-3.1-13.9-8.1s-2.8-11.2 .2-16.1l48-80c2.9-4.8 8.1-7.8 13.7-7.8s10.8 2.9 13.7 7.8l12.8 21.4 48.3-70.2c3-4.3 7.9-6.9 13.2-6.9z"]
};
const faCircleQuestion = {
  prefix: 'fas',
  iconName: 'circle-question',
  icon: [512, 512, [62108, "question-circle"], "f059", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faQuestionCircle = faCircleQuestion;
const faPlaneDeparture = {
  prefix: 'fas',
  iconName: 'plane-departure',
  icon: [640, 512, [128747], "f5b0", "M381 114.9L186.1 41.8c-16.7-6.2-35.2-5.3-51.1 2.7L89.1 67.4C78 73 77.2 88.5 87.6 95.2l146.9 94.5L136 240 77.8 214.1c-8.7-3.9-18.8-3.7-27.3 .6L18.3 230.8c-9.3 4.7-11.8 16.8-5 24.7l73.1 85.3c6.1 7.1 15 11.2 24.3 11.2l137.7 0c5 0 9.9-1.2 14.3-3.4L535.6 212.2c46.5-23.3 82.5-63.3 100.8-112C645.9 75 627.2 48 600.2 48l-57.4 0c-20.2 0-40.2 4.8-58.2 14L381 114.9zM0 480c0 17.7 14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 448c-17.7 0-32 14.3-32 32z"]
};
const faHandshakeSlash = {
  prefix: 'fas',
  iconName: 'handshake-slash',
  icon: [640, 512, [], "e060", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-135-105.8c-1.1-11.4-6.3-22.3-15.3-30.7l-134.2-123-23.4 18.2-26-20.3 77.2-60.1c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L512 316.8 512 128l-.7 0-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2l-89.7 72.6-25.8-20.3 81.8-66.2c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-35.5 23.7L38.8 5.1zM96 171.6L40.6 128 0 128 0 352c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-180.4zM413.6 421.9L128 196.9 128 352l28.2 0 91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c.8-.8 1.5-1.7 2.2-2.6zM48 320a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM544 128l0 224c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-224-96 0zm32 208a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faBookBookmark = {
  prefix: 'fas',
  iconName: 'book-bookmark',
  icon: [448, 512, [], "e0bb", "M0 96C0 43 43 0 96 0l96 0 0 190.7c0 13.4 15.5 20.9 26 12.5L272 160l54 43.2c10.5 8.4 26 .9 26-12.5L352 0l32 0 32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32z"]
};
const faCodeBranch = {
  prefix: 'fas',
  iconName: 'code-branch',
  icon: [448, 512, [], "f126", "M80 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm80-24c0 32.8-19.7 61-48 73.3l0 87.8c18.8-10.9 40.7-17.1 64-17.1l96 0c35.3 0 64-28.7 64-64l0-6.7C307.7 141 288 112.8 288 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3l0 6.7c0 70.7-57.3 128-128 128l-96 0c-35.3 0-64 28.7-64 64l0 6.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3l0-6.7 0-198.7C19.7 141 0 112.8 0 80C0 35.8 35.8 0 80 0s80 35.8 80 80zm232 0a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM80 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faHatCowboy = {
  prefix: 'fas',
  iconName: 'hat-cowboy',
  icon: [640, 512, [], "f8c0", "M320 64c14.4 0 22.3-7 30.8-14.4C360.4 41.1 370.7 32 392 32c49.3 0 84.4 152.2 97.9 221.9C447.8 272.1 390.9 288 320 288s-127.8-15.9-169.9-34.1C163.6 184.2 198.7 32 248 32c21.3 0 31.6 9.1 41.2 17.6C297.7 57 305.6 64 320 64zM111.1 270.7c47.2 24.5 117.5 49.3 209 49.3s161.8-24.8 208.9-49.3c24.8-12.9 49.8-28.3 70.1-47.7c7.9-7.9 20.2-9.2 29.6-3.3c9.5 5.9 13.5 17.9 9.9 28.5c-13.5 37.7-38.4 72.3-66.1 100.6C523.7 398.9 443.6 448 320 448s-203.6-49.1-252.5-99.2C39.8 320.4 14.9 285.8 1.4 248.1c-3.6-10.6 .4-22.6 9.9-28.5c9.5-5.9 21.7-4.5 29.6 3.3c20.4 19.4 45.3 34.8 70.1 47.7z"]
};
const faBridge = {
  prefix: 'fas',
  iconName: 'bridge',
  icon: [576, 512, [], "e4c8", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l40 0 0 64L0 160 0 288c53 0 96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96s96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96l0-128-72 0 0-64 40 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM456 96l0 64-80 0 0-64 80 0zM328 96l0 64-80 0 0-64 80 0zM200 96l0 64-80 0 0-64 80 0z"]
};
const faPhoneFlip = {
  prefix: 'fas',
  iconName: 'phone-flip',
  icon: [512, 512, [128381, "phone-alt"], "f879", "M347.1 24.6c7.7-18.6 28-28.5 47.4-23.2l88 24C499.9 30.2 512 46 512 64c0 247.4-200.6 448-448 448c-18 0-33.8-12.1-38.6-29.5l-24-88c-5.3-19.4 4.6-39.7 23.2-47.4l96-40c16.3-6.8 35.2-2.1 46.3 11.6L207.3 368c70.4-33.3 127.4-90.3 160.7-160.7L318.7 167c-13.7-11.2-18.4-30-11.6-46.3l40-96z"]
};
const faPhoneAlt = faPhoneFlip;
const faTruckFront = {
  prefix: 'fas',
  iconName: 'truck-front',
  icon: [512, 512, [], "e2b7", "M0 80C0 35.8 35.8 0 80 0L432 0c44.2 0 80 35.8 80 80l0 288c0 26.2-12.6 49.4-32 64l0 48c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-256 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-48C12.6 417.4 0 394.2 0 368L0 80zm129.9 72.2L112 224l288 0-17.9-71.8C378.5 138 365.7 128 351 128l-190 0c-14.7 0-27.5 10-31 24.2zM128 320a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faCat = {
  prefix: 'fas',
  iconName: 'cat',
  icon: [576, 512, [128008], "f6be", "M320 192l17.1 0c22.1 38.3 63.5 64 110.9 64c11 0 21.8-1.4 32-4l0 4 0 32 0 192c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-140.8L280 448l56 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-144 0c-53 0-96-43-96-96l0-223.5c0-16.1-12-29.8-28-31.8l-7.9-1c-17.5-2.2-30-18.2-27.8-35.7s18.2-30 35.7-27.8l7.9 1c48 6 84.1 46.8 84.1 95.3l0 85.3c34.4-51.7 93.2-85.8 160-85.8zm160 26.5s0 0 0 0c-10 3.5-20.8 5.5-32 5.5c-28.4 0-54-12.4-71.6-32c0 0 0 0 0 0c-3.7-4.1-7-8.5-9.9-13.2C357.3 164 352 146.6 352 128c0 0 0 0 0 0l0-96 0-20 0-1.3C352 4.8 356.7 .1 362.6 0l.2 0c3.3 0 6.4 1.6 8.4 4.2c0 0 0 0 0 .1L384 21.3l27.2 36.3L416 64l64 0 4.8-6.4L512 21.3 524.8 4.3c0 0 0 0 0-.1c2-2.6 5.1-4.2 8.4-4.2l.2 0C539.3 .1 544 4.8 544 10.7l0 1.3 0 20 0 96c0 17.3-4.6 33.6-12.6 47.6c-11.3 19.8-29.6 35.2-51.4 42.9zM432 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faAnchorCircleExclamation = {
  prefix: 'fas',
  iconName: 'anchor-circle-exclamation',
  icon: [640, 512, [], "e4ab", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c8.2 0 16.3-.6 24.2-1.8c-22.2-16.2-40.4-37.5-53-62.2L320 448l0-80 0-128 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faTruckField = {
  prefix: 'fas',
  iconName: 'truck-field',
  icon: [640, 512, [], "e58d", "M32 96c0-35.3 28.7-64 64-64l224 0c23.7 0 44.4 12.9 55.4 32l51.8 0c25.3 0 48.2 14.9 58.5 38l52.8 118.8c.5 1.1 .9 2.1 1.3 3.2l4.2 0c35.3 0 64 28.7 64 64l0 32c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-32c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32l0-32zM384 224l85.9 0-42.7-96L384 128l0 96zM160 432a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faRoute = {
  prefix: 'fas',
  iconName: 'route',
  icon: [512, 512, [], "f4d7", "M512 96c0 50.2-59.1 125.1-84.6 155c-3.8 4.4-9.4 6.1-14.5 5L320 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96 43 96 96s-43 96-96 96l-276.4 0c8.7-9.9 19.3-22.6 30-36.8c6.3-8.4 12.8-17.6 19-27.2L416 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c-53 0-96-43-96-96s43-96 96-96l39.8 0c-21-31.5-39.8-67.7-39.8-96c0-53 43-96 96-96s96 43 96 96zM117.1 489.1c-3.8 4.3-7.2 8.1-10.1 11.3l-1.8 2-.2-.2c-6 4.6-14.6 4-20-1.8C59.8 473 0 402.5 0 352c0-53 43-96 96-96s96 43 96 96c0 30-21.1 67-43.5 97.9c-10.7 14.7-21.7 28-30.8 38.5l-.6 .7zM128 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faClipboardQuestion = {
  prefix: 'fas',
  iconName: 'clipboard-question',
  icon: [384, 512, [], "e4e3", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM105.8 229.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L216 328.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM160 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faPanorama = {
  prefix: 'fas',
  iconName: 'panorama',
  icon: [640, 512, [], "e209", "M45.6 32C20.4 32 0 52.4 0 77.6L0 434.4C0 459.6 20.4 480 45.6 480c5.1 0 10-.8 14.7-2.4C74.6 472.8 177.6 440 320 440s245.4 32.8 259.6 37.6c4.7 1.6 9.7 2.4 14.7 2.4c25.2 0 45.6-20.4 45.6-45.6l0-356.7C640 52.4 619.6 32 594.4 32c-5 0-10 .8-14.7 2.4C565.4 39.2 462.4 72 320 72S74.6 39.2 60.4 34.4C55.6 32.8 50.7 32 45.6 32zM96 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm272 0c7.9 0 15.4 3.9 19.8 10.5L512.3 353c5.4 8 5.6 18.4 .4 26.5s-14.7 12.3-24.2 10.7C442.7 382.4 385.2 376 320 376c-65.6 0-123.4 6.5-169.3 14.4c-9.8 1.7-19.7-2.9-24.7-11.5s-4.3-19.4 1.9-27.2L197.3 265c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l26.4 33.1 87-127.6c4.5-6.6 11.9-10.5 19.8-10.5z"]
};
const faCommentMedical = {
  prefix: 'fas',
  iconName: 'comment-medical',
  icon: [512, 512, [], "f7f5", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM224 160c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faTeethOpen = {
  prefix: 'fas',
  iconName: 'teeth-open',
  icon: [576, 512, [], "f62f", "M96 32C43 32 0 75 0 128l0 64c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-64c0-53-43-96-96-96L96 32zM224 96c26.5 0 48 21.5 48 48l0 56c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-56c0-26.5 21.5-48 48-48zm80 48c0-26.5 21.5-48 48-48s48 21.5 48 48l0 56c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-56zM96 128c26.5 0 48 21.5 48 48l0 24c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-24c0-26.5 21.5-48 48-48zm336 48c0-26.5 21.5-48 48-48s48 21.5 48 48l0 24c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-24zM96 480l384 0c53 0 96-43 96-96l0-32c0-35.3-28.7-64-64-64L64 288c-35.3 0-64 28.7-64 64l0 32c0 53 43 96 96 96zm0-64c-26.5 0-48-21.5-48-48l0-24c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 24c0 26.5-21.5 48-48 48zm80-48l0-24c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 24c0 26.5-21.5 48-48 48s-48-21.5-48-48zm176 48c-26.5 0-48-21.5-48-48l0-24c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 24c0 26.5-21.5 48-48 48zm80-48l0-24c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 24c0 26.5-21.5 48-48 48s-48-21.5-48-48z"]
};
const faFileCircleMinus = {
  prefix: 'fas',
  iconName: 'file-circle-minus',
  icon: [576, 512, [], "e4ed", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm224 0c0-8.8-7.2-16-16-16l-128 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16z"]
};
const faTags = {
  prefix: 'fas',
  iconName: 'tags',
  icon: [512, 512, [], "f02c", "M345 39.1L472.8 168.4c52.4 53 52.4 138.2 0 191.2L360.8 472.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L438.6 325.9c33.9-34.3 33.9-89.4 0-123.7L310.9 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM0 229.5L0 80C0 53.5 21.5 32 48 32l149.5 0c17 0 33.3 6.7 45.3 18.7l168 168c25 25 25 65.5 0 90.5L277.3 442.7c-25 25-65.5 25-90.5 0l-168-168C6.7 262.7 0 246.5 0 229.5zM144 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faWineGlass = {
  prefix: 'fas',
  iconName: 'wine-glass',
  icon: [320, 512, [127863], "f4e3", "M32.1 29.3C33.5 12.8 47.4 0 64 0L256 0c16.6 0 30.5 12.8 31.9 29.3l14 168.4c6 72-42.5 135.2-109.9 150.6l0 99.6 48 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-80 0-80 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l48 0 0-99.6C60.6 333 12.1 269.8 18.1 197.8l14-168.4zm56 98.7l143.8 0-5.3-64L93.4 64l-5.3 64z"]
};
const faForwardFast = {
  prefix: 'fas',
  iconName: 'forward-fast',
  icon: [512, 512, [9197, "fast-forward"], "f050", "M18.4 445c11.2 5.3 24.5 3.6 34.1-4.4L224 297.7 224 416c0 12.4 7.2 23.7 18.4 29s24.5 3.6 34.1-4.4L448 297.7 448 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 118.3L276.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S224 83.6 224 96l0 118.3L52.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S0 83.6 0 96L0 416c0 12.4 7.2 23.7 18.4 29z"]
};
const faFastForward = faForwardFast;
const faFaceMehBlank = {
  prefix: 'fas',
  iconName: 'face-meh-blank',
  icon: [512, 512, [128566, "meh-blank"], "f5a4", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm208.4-48a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm128 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faMehBlank = faFaceMehBlank;
const faSquareParking = {
  prefix: 'fas',
  iconName: 'square-parking',
  icon: [448, 512, [127359, "parking"], "f540", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM192 256l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-48 0 0 64zm48 64l-48 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64 0-120c0-22.1 17.9-40 40-40l72 0c53 0 96 43 96 96s-43 96-96 96z"]
};
const faParking = faSquareParking;
const faHouseSignal = {
  prefix: 'fas',
  iconName: 'house-signal',
  icon: [576, 512, [], "e012", "M357.7 8.5c-12.3-11.3-31.2-11.3-43.4 0l-208 192c-9.4 8.6-12.7 22-8.5 34c87.1 25.3 155.6 94.2 180.3 181.6L464 416c26.5 0 48-21.5 48-48l0-112 32 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8.1-35.2l-208-192zM288 208c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16l0-64zM24 256c-13.3 0-24 10.7-24 24s10.7 24 24 24c101.6 0 184 82.4 184 184c0 13.3 10.7 24 24 24s24-10.7 24-24c0-128.1-103.9-232-232-232zm8 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM0 376c0 13.3 10.7 24 24 24c48.6 0 88 39.4 88 88c0 13.3 10.7 24 24 24s24-10.7 24-24c0-75.1-60.9-136-136-136c-13.3 0-24 10.7-24 24z"]
};
const faBarsProgress = {
  prefix: 'fas',
  iconName: 'bars-progress',
  icon: [512, 512, ["tasks-alt"], "f828", "M448 160l-128 0 0-32 128 0 0 32zM48 64C21.5 64 0 85.5 0 112l0 64c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48L48 64zM448 352l0 32-256 0 0-32 256 0zM48 288c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48L48 288z"]
};
const faTasksAlt = faBarsProgress;
const faFaucetDrip = {
  prefix: 'fas',
  iconName: 'faucet-drip',
  icon: [512, 512, [128688], "e006", "M224 0c17.7 0 32 14.3 32 32l0 12 96-12c17.7 0 32 14.3 32 32s-14.3 32-32 32L256 84l-31-3.9-1-.1-1 .1L192 84 96 96C78.3 96 64 81.7 64 64s14.3-32 32-32l96 12 0-12c0-17.7 14.3-32 32-32zM0 224c0-17.7 14.3-32 32-32l96 0 22.6-22.6c6-6 14.1-9.4 22.6-9.4l18.7 0 0-43.8 32-4 32 4 0 43.8 18.7 0c8.5 0 16.6 3.4 22.6 9.4L320 192l32 0c88.4 0 160 71.6 160 160c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s-14.3-32-32-32l-36.1 0c-20.2 29-53.9 48-91.9 48s-71.7-19-91.9-48L32 320c-17.7 0-32-14.3-32-32l0-64zM436.8 423.4c1.9-4.5 6.3-7.4 11.2-7.4s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1l18.2-42.4z"]
};
const faCartFlatbed = {
  prefix: 'fas',
  iconName: 'cart-flatbed',
  icon: [640, 512, ["dolly-flatbed"], "f474", "M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l16 0c8.8 0 16 7.2 16 16l0 288c0 44.2 35.8 80 80 80l18.7 0c-1.8 5-2.7 10.4-2.7 16c0 26.5 21.5 48 48 48s48-21.5 48-48c0-5.6-1-11-2.7-16l197.5 0c-1.8 5-2.7 10.4-2.7 16c0 26.5 21.5 48 48 48s48-21.5 48-48c0-5.6-1-11-2.7-16l66.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-464 0c-8.8 0-16-7.2-16-16l0-288C128 35.8 92.2 0 48 0L32 0zM192 80l0 192c0 26.5 21.5 48 48 48l320 0c26.5 0 48-21.5 48-48l0-192c0-26.5-21.5-48-48-48l-96 0 0 144c0 5.9-3.2 11.3-8.5 14.1s-11.5 2.5-16.4-.8L400 163.2l-39.1 26.1c-4.9 3.3-11.2 3.6-16.4 .8s-8.5-8.2-8.5-14.1l0-144-96 0c-26.5 0-48 21.5-48 48z"]
};
const faDollyFlatbed = faCartFlatbed;
const faBanSmoking = {
  prefix: 'fas',
  iconName: 'ban-smoking',
  icon: [512, 512, [128685, "smoking-ban"], "f54d", "M99.5 144.8L178.7 224l96 96 92.5 92.5C335.9 434.9 297.5 448 256 448C150 448 64 362 64 256c0-41.5 13.1-79.9 35.5-111.2zM333.3 288l-32-32 82.7 0 0 32-50.7 0zm32 32l34.7 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-130.7 0L144.8 99.5C176.1 77.1 214.5 64 256 64c106 0 192 86 192 192c0 41.5-13.1 79.9-35.5 111.2L365.3 320zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM272 96c-8.8 0-16 7.2-16 16c0 26.5 21.5 48 48 48l32 0c8.8 0 16 7.2 16 16s7.2 16 16 16s16-7.2 16-16c0-26.5-21.5-48-48-48l-32 0c-8.8 0-16-7.2-16-16s-7.2-16-16-16zM229.5 320l-96-96L112 224c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l117.5 0z"]
};
const faSmokingBan = faBanSmoking;
const faTerminal = {
  prefix: 'fas',
  iconName: 'terminal',
  icon: [576, 512, [], "f120", "M9.4 86.6C-3.1 74.1-3.1 53.9 9.4 41.4s32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L178.7 256 9.4 86.6zM256 416l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faMobileButton = {
  prefix: 'fas',
  iconName: 'mobile-button',
  icon: [384, 512, [], "f10b", "M80 0C44.7 0 16 28.7 16 64l0 384c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L80 0zM192 400a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faHouseMedicalFlag = {
  prefix: 'fas',
  iconName: 'house-medical-flag',
  icon: [640, 512, [], "e514", "M480 0c17.7 0 32 14.3 32 32l112 0c8.8 0 16 7.2 16 16l0 128c0 8.8-7.2 16-16 16l-112 0 0 320-64 0 0-320 0-160c0-17.7 14.3-32 32-32zM276.8 39.7L416 159l0 353 1 0-.2 0L96 512c-17.7 0-32-14.3-32-32l0-192-32 0c-13.4 0-25.4-8.3-30-20.9s-1-26.7 9.2-35.4l224-192c12-10.3 29.7-10.3 41.7 0zM224 208l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faBasketShopping = {
  prefix: 'fas',
  iconName: 'basket-shopping',
  icon: [576, 512, ["shopping-basket"], "f291", "M253.3 35.1c6.1-11.8 1.5-26.3-10.2-32.4s-26.3-1.5-32.4 10.2L117.6 192 32 192c-17.7 0-32 14.3-32 32s14.3 32 32 32L83.9 463.5C91 492 116.6 512 146 512L430 512c29.4 0 55-20 62.1-48.5L544 256c17.7 0 32-14.3 32-32s-14.3-32-32-32l-85.6 0L365.3 12.9C359.2 1.2 344.7-3.4 332.9 2.7s-16.3 20.6-10.2 32.4L404.3 192l-232.6 0L253.3 35.1zM192 304l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16s16 7.2 16 16zm96-16c8.8 0 16 7.2 16 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16zm128 16l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faShoppingBasket = faBasketShopping;
const faTape = {
  prefix: 'fas',
  iconName: 'tape',
  icon: [576, 512, [], "f4db", "M380.8 416c41.5-40.7 67.2-97.3 67.2-160C448 132.3 347.7 32 224 32S0 132.3 0 256S100.3 480 224 480l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-163.2 0zM224 160a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm64 96a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faBusSimple = {
  prefix: 'fas',
  iconName: 'bus-simple',
  icon: [448, 512, ["bus-alt"], "f55e", "M224 0C348.8 0 448 35.2 448 80l0 16 0 320c0 17.7-14.3 32-32 32l0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-192 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32c-17.7 0-32-14.3-32-32L0 96 0 80C0 35.2 99.2 0 224 0zM64 128l0 128c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32L96 96c-17.7 0-32 14.3-32 32zM80 400a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm288 0a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faBusAlt = faBusSimple;
const faEye = {
  prefix: 'fas',
  iconName: 'eye',
  icon: [576, 512, [128065], "f06e", "M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"]
};
const faFaceSadCry = {
  prefix: 'fas',
  iconName: 'face-sad-cry',
  icon: [512, 512, [128557, "sad-cry"], "f5b3", "M352 493.4c-29.6 12-62.1 18.6-96 18.6s-66.4-6.6-96-18.6L160 288c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 189.8C51.5 433.5 0 350.8 0 256C0 114.6 114.6 0 256 0S512 114.6 512 256c0 94.8-51.5 177.5-128 221.8L384 288c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 205.4zM195.2 233.6c5.3 7.1 15.3 8.5 22.4 3.2s8.5-15.3 3.2-22.4c-30.4-40.5-91.2-40.5-121.6 0c-5.3 7.1-3.9 17.1 3.2 22.4s17.1 3.9 22.4-3.2c17.6-23.5 52.8-23.5 70.4 0zm121.6 0c17.6-23.5 52.8-23.5 70.4 0c5.3 7.1 15.3 8.5 22.4 3.2s8.5-15.3 3.2-22.4c-30.4-40.5-91.2-40.5-121.6 0c-5.3 7.1-3.9 17.1 3.2 22.4s17.1 3.9 22.4-3.2zM208 336l0 32c0 26.5 21.5 48 48 48s48-21.5 48-48l0-32c0-26.5-21.5-48-48-48s-48 21.5-48 48z"]
};
const faSadCry = faFaceSadCry;
const faAudioDescription = {
  prefix: 'fas',
  iconName: 'audio-description',
  icon: [576, 512, [], "f29e", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM213.5 173.3l72 144c5.9 11.9 1.1 26.3-10.7 32.2s-26.3 1.1-32.2-10.7l-9.4-18.9-82.2 0-9.4 18.9c-5.9 11.9-20.3 16.7-32.2 10.7s-16.7-20.3-10.7-32.2l72-144c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3zm-.4 106.6L192 237.7l-21.1 42.2 42.2 0zM304 184c0-13.3 10.7-24 24-24l56 0c53 0 96 43 96 96s-43 96-96 96l-56 0c-13.3 0-24-10.7-24-24l0-144zm48 24l0 96 32 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-32 0z"]
};
const faPersonMilitaryToPerson = {
  prefix: 'fas',
  iconName: 'person-military-to-person',
  icon: [512, 512, [], "e54c", "M71 12.5c-8.6 1-15 8.2-15 16.8c0 9.3 7.5 16.8 16.7 16.9l111.4 0c8.8-.1 15.9-7.2 15.9-16L200 16c0-9.5-8.3-17-17.8-15.9L71 12.5zM189.5 78.1l-122.9 0C64.9 83.8 64 89.8 64 96c0 35.3 28.7 64 64 64s64-28.7 64-64c0-6.2-.9-12.2-2.5-17.9zM32 256l0 32c0 17.7 14.3 32 32 32l128 0c1.8 0 3.5-.1 5.2-.4L53 208.6C40.1 220.3 32 237.2 32 256zm190.2 42.5c1.1-3.3 1.8-6.8 1.8-10.5l0-32c0-35.3-28.7-64-64-64l-64 0c-3.7 0-7.4 .3-10.9 .9L222.2 298.5zM384 160a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-35.3 0-64 28.7-64 64l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32c0-35.3-28.7-64-64-64l-64 0zM215.8 450.1c5.2-4.6 8.2-11.1 8.2-18.1s-3-13.5-8.2-18.1l-64-56c-7.1-6.2-17.1-7.7-25.7-3.8S112 366.6 112 376l0 32-88 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l88 0 0 32c0 9.4 5.5 18 14.1 21.9s18.6 2.4 25.7-3.8l64-56zM288 431.9c0 6.9 2.9 13.5 8.1 18.1l64 56.4c7.1 6.2 17.1 7.8 25.7 3.9s14.1-12.4 14.1-21.9l0-32.4 88 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-88 0 0-32c0-9.4-5.5-18-14.1-21.9s-18.6-2.4-25.7 3.8l-64 56c-5.2 4.5-8.2 11.1-8.2 18z"]
};
const faFileShield = {
  prefix: 'fas',
  iconName: 'file-shield',
  icon: [576, 512, [], "e4f0", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 47-92.8 37.1c-21.3 8.5-35.2 29.1-35.2 52c0 56.6 18.9 148 94.2 208.3c-9 4.8-19.3 7.6-30.2 7.6L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm39.1 97.7c5.7-2.3 12.1-2.3 17.8 0l120 48C570 277.4 576 286.2 576 296c0 63.3-25.9 168.8-134.8 214.2c-5.9 2.5-12.6 2.5-18.5 0C313.9 464.8 288 359.3 288 296c0-9.8 6-18.6 15.1-22.3l120-48zM527.4 312L432 273.8l0 187.8c68.2-33 91.5-99 95.4-149.7z"]
};
const faUserSlash = {
  prefix: 'fas',
  iconName: 'user-slash',
  icon: [640, 512, [], "f506", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L353.3 251.6C407.9 237 448 187.2 448 128C448 57.3 390.7 0 320 0C250.2 0 193.5 55.8 192 125.2L38.8 5.1zM264.3 304.3C170.5 309.4 96 387.2 96 482.3c0 16.4 13.3 29.7 29.7 29.7l388.6 0c3.9 0 7.6-.7 11-2.1l-261-205.6z"]
};
const faPen = {
  prefix: 'fas',
  iconName: 'pen',
  icon: [512, 512, [128394], "f304", "M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"]
};
const faTowerObservation = {
  prefix: 'fas',
  iconName: 'tower-observation',
  icon: [512, 512, [], "e586", "M241.7 3.4c9-4.5 19.6-4.5 28.6 0l160 80c15.8 7.9 22.2 27.1 14.3 42.9C439 137.5 427.7 144 416 144l0 80c0 17.7-14.3 32-32 32l-4.9 0 32 192 68.9 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-95.5 0c-.4 0-.8 0-1.1 0l-254.8 0c-.4 0-.8 0-1.1 0L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l68.9 0 32-192-4.9 0c-17.7 0-32-14.3-32-32l0-80c-11.7 0-23-6.5-28.6-17.7c-7.9-15.8-1.5-35 14.3-42.9l160-80zM314.5 448L256 399.2 197.5 448l117 0zM197.8 256l-4.7 28.3L256 336.8l62.9-52.5L314.2 256l-116.5 0zm-13.9 83.2l-11.2 67L218.5 368l-34.6-28.8zM293.5 368l45.8 38.1-11.2-67L293.5 368zM176 128c-8.8 0-16 7.2-16 16s7.2 16 16 16l160 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-160 0z"]
};
const faFileCode = {
  prefix: 'fas',
  iconName: 'file-code',
  icon: [384, 512, [], "f1c9", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM153 289l-31 31 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L71 337c-9.4-9.4-9.4-24.6 0-33.9l48-48c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM265 255l48 48c9.4 9.4 9.4 24.6 0 33.9l-48 48c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"]
};
const faSignal = {
  prefix: 'fas',
  iconName: 'signal',
  icon: [640, 512, [128246, "signal-5", "signal-perfect"], "f012", "M576 0c17.7 0 32 14.3 32 32l0 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-448c0-17.7 14.3-32 32-32zM448 96c17.7 0 32 14.3 32 32l0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352c0-17.7 14.3-32 32-32zM352 224l0 256c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32s32 14.3 32 32zM192 288c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32zM96 416l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faSignal5 = faSignal;
const faSignalPerfect = faSignal;
const faBus = {
  prefix: 'fas',
  iconName: 'bus',
  icon: [576, 512, [128653], "f207", "M288 0C422.4 0 512 35.2 512 80l0 16 0 32c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l0 160c0 17.7-14.3 32-32 32l0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-192 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32c-17.7 0-32-14.3-32-32l0-160c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32c0 0 0 0 0 0l0-32s0 0 0 0l0-16C64 35.2 153.6 0 288 0zM128 160l0 96c0 17.7 14.3 32 32 32l112 0 0-160-112 0c-17.7 0-32 14.3-32 32zM304 288l112 0c17.7 0 32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-112 0 0 160zM144 400a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm288 0a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM384 80c0-8.8-7.2-16-16-16L208 64c-8.8 0-16 7.2-16 16s7.2 16 16 16l160 0c8.8 0 16-7.2 16-16z"]
};
const faHeartCircleXmark = {
  prefix: 'fas',
  iconName: 'heart-circle-xmark',
  icon: [576, 512, [], "e501", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L454.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L432 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L409.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L432 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faHouseChimney = {
  prefix: 'fas',
  iconName: 'house-chimney',
  icon: [576, 512, [63499, "home-lg"], "e3af", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L512 185l0-121c0-17.7-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32l0 36.7L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 69.7c-.1 .9-.1 1.8-.1 2.8l0 112c0 22.1 17.9 40 40 40l16 0c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2l31.9 0 24 0c22.1 0 40-17.9 40-40l0-24 0-64c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 64 0 24c0 22.1 17.9 40 40 40l24 0 32.5 0c1.4 0 2.8 0 4.2-.1c1.1 .1 2.2 .1 3.3 .1l16 0c22.1 0 40-17.9 40-40l0-16.2c.3-2.6 .5-5.3 .5-8.1l-.7-160.2 32 0z"]
};
const faHomeLg = faHouseChimney;
const faWindowMaximize = {
  prefix: 'fas',
  iconName: 'window-maximize',
  icon: [512, 512, [128470], "f2d0", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM96 96l320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L96 160c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faFaceFrown = {
  prefix: 'fas',
  iconName: 'face-frown',
  icon: [512, 512, [9785, "frown"], "f119", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM159.3 388.7c-2.6 8.4-11.6 13.2-20 10.5s-13.2-11.6-10.5-20C145.2 326.1 196.3 288 256 288s110.8 38.1 127.3 91.3c2.6 8.4-2.1 17.4-10.5 20s-17.4-2.1-20-10.5C340.5 349.4 302.1 320 256 320s-84.5 29.4-96.7 68.7zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faFrown = faFaceFrown;
const faPrescription = {
  prefix: 'fas',
  iconName: 'prescription',
  icon: [448, 512, [], "f5b1", "M32 0C14.3 0 0 14.3 0 32L0 192l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 50.7 0 128 128L137.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L288 397.3 393.4 502.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L333.3 352 438.6 246.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 306.7l-85.8-85.8C251.4 209.1 288 164.8 288 112C288 50.1 237.9 0 176 0L32 0zM176 160L64 160l0-96 112 0c26.5 0 48 21.5 48 48s-21.5 48-48 48z"]
};
const faShop = {
  prefix: 'fas',
  iconName: 'shop',
  icon: [640, 512, ["store-alt"], "f54f", "M36.8 192l566.3 0c20.3 0 36.8-16.5 36.8-36.8c0-7.3-2.2-14.4-6.2-20.4L558.2 21.4C549.3 8 534.4 0 518.3 0L121.7 0c-16 0-31 8-39.9 21.4L6.2 134.7c-4 6.1-6.2 13.2-6.2 20.4C0 175.5 16.5 192 36.8 192zM64 224l0 160 0 80c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-80 0-160-64 0 0 160-192 0 0-160-64 0zm448 0l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32l0-256-64 0z"]
};
const faStoreAlt = faShop;
const faFloppyDisk = {
  prefix: 'fas',
  iconName: 'floppy-disk',
  icon: [448, 512, [128190, 128426, "save"], "f0c7", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-242.7c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32L64 32zm0 96c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L96 224c-17.7 0-32-14.3-32-32l0-64zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faSave = faFloppyDisk;
const faVihara = {
  prefix: 'fas',
  iconName: 'vihara',
  icon: [640, 512, [], "f6a7", "M281 22L305.8 4.7c1.3-.9 2.7-1.8 4.1-2.4C313.1 .7 316.6 0 320 0s6.9 .7 10.1 2.2c1.4 .7 2.8 1.5 4.1 2.4L359 22C393 45.8 430.8 63.5 470.8 74.4l23 6.3c1.8 .5 3.6 1.1 5.2 2c3.2 1.7 5.9 4 8.1 6.8c3.8 4.9 5.6 11.3 4.7 17.8c-.4 2.8-1.2 5.4-2.5 7.8c-1.7 3.2-4 5.9-6.8 8.1c-4.3 3.2-9.6 5.1-15.1 4.9l-7.5 0 0 56.1 6.4 5.1 5.2 4.1c21.1 16.7 45 29.6 70.5 38.1l28.9 9.6c1.6 .5 3.2 1.2 4.6 2c3.1 1.7 5.8 4.1 7.8 6.9s3.5 6.1 4.1 9.6c.5 2.7 .6 5.5 .1 8.3s-1.4 5.4-2.7 7.8c-1.7 3.1-4.1 5.8-6.9 7.8s-6.1 3.5-9.6 4.1c-1.6 .3-3.3 .4-5 .4L544 288l0 65.9c20.5 22.8 47.4 39.2 77.4 46.7C632 403 640 412.6 640 424c0 13.3-10.7 24-24 24l-40 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-160 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-160 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-40 0c-13.3 0-24-10.7-24-24c0-11.4 8-21 18.6-23.4c30-7.6 56.9-23.9 77.4-46.7L96 288l-39.4 0c-1.7 0-3.4-.1-5-.4c-3.5-.7-6.8-2.1-9.6-4.1s-5.2-4.7-7-7.8c-1.3-2.4-2.3-5-2.7-7.8s-.4-5.6 .1-8.3c.7-3.5 2.1-6.8 4.1-9.6s4.7-5.2 7.8-6.9c1.4-.8 3-1.5 4.6-2l28.9-9.6c25.5-8.5 49.4-21.4 70.5-38.1l5.2-4.1 6.4-5.1 0-8.1 0-48-7.5 0c-5.5 .1-10.8-1.7-15.1-4.9c-2.8-2.1-5.1-4.8-6.8-8.1c-1.2-2.4-2.1-5-2.5-7.8c-.9-6.5 .9-12.8 4.7-17.8c2.1-2.8 4.8-5.1 8.1-6.8c1.6-.8 3.4-1.5 5.2-2l23-6.3C209.2 63.5 247 45.8 281 22zM416 128l-96 0-96 0 0 64 72 0 48 0 72 0 0-64zM160 288l0 64 136 0 24 0 24 0 136 0 0-64-136 0-24 0s0 0 0 0l-24 0-136 0z"]
};
const faScaleUnbalanced = {
  prefix: 'fas',
  iconName: 'scale-unbalanced',
  icon: [640, 512, ["balance-scale-left"], "f515", "M522.1 62.4c16.8-5.6 25.8-23.7 20.2-40.5S518.6-3.9 501.9 1.6l-113 37.7C375 15.8 349.3 0 320 0c-44.2 0-80 35.8-80 80c0 3 .2 5.9 .5 8.8L117.9 129.6c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l135.5-45.2c4.5 3.2 9.3 5.9 14.4 8.2L288 480c0 17.7 14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-294.7c21-9.2 37.2-27 44.2-49l125.9-42zM439.6 288L512 163.8 584.4 288l-144.9 0zM512 384c62.9 0 115.2-34 126-78.9c2.6-11-1-22.3-6.7-32.1L536.1 109.8c-5-8.6-14.2-13.8-24.1-13.8s-19.1 5.3-24.1 13.8L392.7 273.1c-5.7 9.8-9.3 21.1-6.7 32.1C396.8 350 449.1 384 512 384zM129.2 291.8L201.6 416 56.7 416l72.4-124.2zM3.2 433.1C14 478 66.3 512 129.2 512s115.2-34 126-78.9c2.6-11-1-22.3-6.7-32.1L153.2 237.8c-5-8.6-14.2-13.8-24.1-13.8s-19.1 5.3-24.1 13.8L9.9 401.1c-5.7 9.8-9.3 21.1-6.7 32.1z"]
};
const faBalanceScaleLeft = faScaleUnbalanced;
const faSortUp = {
  prefix: 'fas',
  iconName: 'sort-up',
  icon: [320, 512, ["sort-asc"], "f0de", "M182.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]
};
const faSortAsc = faSortUp;
const faCommentDots = {
  prefix: 'fas',
  iconName: 'comment-dots',
  icon: [512, 512, [128172, 62075, "commenting"], "f4ad", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM128 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faCommenting = faCommentDots;
const faPlantWilt = {
  prefix: 'fas',
  iconName: 'plant-wilt',
  icon: [512, 512, [], "e5aa", "M288 120c0-30.9 25.1-56 56-56s56 25.1 56 56l0 13c-29.3 10-48 34.5-48 70.1c0 27.9 25.3 74.8 66 111.6c3.8 3.5 8.9 5.3 14 5.3s10.2-1.8 14-5.3c40.7-36.8 66-83.7 66-111.6c0-35.6-18.7-60.2-48-70.1l0-13C464 53.7 410.3 0 344 0S224 53.7 224 120l0 21.8C207.3 133 188.2 128 168 128c-66.3 0-120 53.7-120 120l0 13c-29.3 10-48 34.5-48 70.1C0 359 25.3 405.9 66 442.7c3.8 3.5 8.9 5.3 14 5.3s10.2-1.8 14-5.3c40.7-36.8 66-83.7 66-111.6c0-35.6-18.7-60.2-48-70.1l0-13c0-30.9 25.1-56 56-56s56 25.1 56 56l0 32 0 200c0 17.7 14.3 32 32 32s32-14.3 32-32l0-200 0-32 0-128z"]
};
const faDiamond = {
  prefix: 'fas',
  iconName: 'diamond',
  icon: [512, 512, [9830], "f219", "M284.3 11.7c-15.6-15.6-40.9-15.6-56.6 0l-216 216c-15.6 15.6-15.6 40.9 0 56.6l216 216c15.6 15.6 40.9 15.6 56.6 0l216-216c15.6-15.6 15.6-40.9 0-56.6l-216-216z"]
};
const faFaceGrinSquint = {
  prefix: 'fas',
  iconName: 'face-grin-squint',
  icon: [512, 512, [128518, "grin-squint"], "f585", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM133.5 146.7l89.9 47.9c10.7 5.7 10.7 21.1 0 26.8l-89.9 47.9c-7.9 4.2-17.5-1.5-17.5-10.5c0-2.8 1-5.5 2.8-7.6l36-43.2-36-43.2c-1.8-2.1-2.8-4.8-2.8-7.6c0-9 9.6-14.7 17.5-10.5zM396 157.1c0 2.8-1 5.5-2.8 7.6l-36 43.2 36 43.2c1.8 2.1 2.8 4.8 2.8 7.6c0 9-9.6 14.7-17.5 10.5l-89.9-47.9c-10.7-5.7-10.7-21.1 0-26.8l89.9-47.9c7.9-4.2 17.5 1.5 17.5 10.5z"]
};
const faGrinSquint = faFaceGrinSquint;
const faHandHoldingDollar = {
  prefix: 'fas',
  iconName: 'hand-holding-dollar',
  icon: [576, 512, ["hand-holding-usd"], "f4c0", "M312 24l0 10.5c6.4 1.2 12.6 2.7 18.2 4.2c12.8 3.4 20.4 16.6 17 29.4s-16.6 20.4-29.4 17c-10.9-2.9-21.1-4.9-30.2-5c-7.3-.1-14.7 1.7-19.4 4.4c-2.1 1.3-3.1 2.4-3.5 3c-.3 .5-.7 1.2-.7 2.8c0 .3 0 .5 0 .6c.2 .2 .9 1.2 3.3 2.6c5.8 3.5 14.4 6.2 27.4 10.1l.9 .3s0 0 0 0c11.1 3.3 25.9 7.8 37.9 15.3c13.7 8.6 26.1 22.9 26.4 44.9c.3 22.5-11.4 38.9-26.7 48.5c-6.7 4.1-13.9 7-21.3 8.8l0 10.6c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-11.4c-9.5-2.3-18.2-5.3-25.6-7.8c-2.1-.7-4.1-1.4-6-2c-12.6-4.2-19.4-17.8-15.2-30.4s17.8-19.4 30.4-15.2c2.6 .9 5 1.7 7.3 2.5c13.6 4.6 23.4 7.9 33.9 8.3c8 .3 15.1-1.6 19.2-4.1c1.9-1.2 2.8-2.2 3.2-2.9c.4-.6 .9-1.8 .8-4.1l0-.2c0-1 0-2.1-4-4.6c-5.7-3.6-14.3-6.4-27.1-10.3l-1.9-.6c-10.8-3.2-25-7.5-36.4-14.4c-13.5-8.1-26.5-22-26.6-44.1c-.1-22.9 12.9-38.6 27.7-47.4c6.4-3.8 13.3-6.4 20.2-8.2L264 24c0-13.3 10.7-24 24-24s24 10.7 24 24zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5L192 512 32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l36.8 0 44.9-36c22.7-18.2 50.9-28 80-28l78.3 0 16 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l120.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384c0 0 0 0 0 0l-.9 0c.3 0 .6 0 .9 0z"]
};
const faHandHoldingUsd = faHandHoldingDollar;
const faChartDiagram = {
  prefix: 'fas',
  iconName: 'chart-diagram',
  icon: [512, 512, [], "e695", "M80 32C53.5 32 32 53.5 32 80s21.5 48 48 48l152 0 0 40-48 48-56 0c-48.6 0-88 39.4-88 88l0 48-8 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-8 0 0-48c0-22.1 17.9-40 40-40l56 0 48 48 0 40-8 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-8 0 0-40 48-48 56 0c22.1 0 40 17.9 40 40l0 48-8 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-8 0 0-48c0-48.6-39.4-88-88-88l-56 0-48-48 0-40 152 0c26.5 0 48-21.5 48-48s-21.5-48-48-48L80 32z"]
};
const faBacterium = {
  prefix: 'fas',
  iconName: 'bacterium',
  icon: [512, 512, [], "e05a", "M423.1 30.6c3.6-12.7-3.7-26-16.5-29.7s-26 3.7-29.7 16.5l-4.2 14.7c-9.8-.4-19.9 .5-29.9 2.8c-12.1 2.8-23.7 5.9-34.9 9.4l-5.9-13.7c-5.2-12.2-19.3-17.8-31.5-12.6s-17.8 19.3-12.6 31.5l4.9 11.3c-22 9.4-42 20.1-60.2 31.8L196 82.7c-7.4-11-22.3-14-33.3-6.7s-14 22.3-6.7 33.3l7.8 11.6c-18 15-33.7 30.8-47.3 47.1L103 157.3c-10.4-8.3-25.5-6.6-33.7 3.7s-6.6 25.5 3.7 33.7l15 12c-2.1 3.2-4.1 6.5-6 9.7c-9.4 15.7-17 31-23.2 45.3l-9.9-3.9c-12.3-4.9-26.3 1.1-31.2 13.4s1.1 26.3 13.4 31.2l11.6 4.6c-.3 1.1-.6 2.1-.9 3.1c-3.5 12.5-5.7 23.2-7.1 31.3c-.7 4.1-1.2 7.5-1.6 10.3c-.2 1.4-.3 2.6-.4 3.6l-.1 1.4-.1 .6 0 .3 0 .1c0 0 0 .1 39.2 3.7c0 0 0 0 0 0l-39.2-3.6c-.5 5-.6 10-.4 14.9l-14.7 4.2C4.7 380.6-2.7 393.8 .9 406.6s16.9 20.1 29.7 16.5l13.8-3.9c10.6 20.7 27.6 37.8 48.5 48.5l-3.9 13.7c-3.6 12.7 3.7 26 16.5 29.7s26-3.7 29.7-16.5l4.2-14.7c23.8 1 46.3-5.5 65.1-17.6L215 473c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-10.6-10.6c9.1-14.1 15.1-30.5 17-48.3l.1-.8c.3-1.7 1-5.1 2.3-9.8l.2-.8 12.6 5.4c12.2 5.2 26.3-.4 31.5-12.6s-.4-26.3-12.6-31.5l-11.3-4.8c9.9-14.9 24.9-31.6 48.6-46l2.1 7.5c3.6 12.7 16.9 20.1 29.7 16.5s20.1-16.9 16.5-29.7L371 259.2c6.9-2.2 14.3-4.3 22.2-6.1c12.9-3 24.7-8 35.2-14.8L439 249c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-10.6-10.6c12.2-19 18.6-41.6 17.6-65.1l14.7-4.2c12.7-3.6 20.1-16.9 16.5-29.7s-16.9-20.1-29.7-16.5l-13.7 3.9c-10.8-21.2-28-38-48.5-48.5l3.9-13.8zM92.1 363.3s0 0 0 0L144 368l-51.9-4.7zM112 320a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM240 184a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faHandPointer = {
  prefix: 'fas',
  iconName: 'hand-pointer',
  icon: [448, 512, [], "f25a", "M128 40c0-22.1 17.9-40 40-40s40 17.9 40 40l0 148.2c8.5-7.6 19.7-12.2 32-12.2c20.6 0 38.2 13 45 31.2c8.8-9.3 21.2-15.2 35-15.2c25.3 0 46 19.5 47.9 44.3c8.5-7.7 19.8-12.3 32.1-12.3c26.5 0 48 21.5 48 48l0 48 0 16 0 48c0 70.7-57.3 128-128 128l-16 0-64 0-.1 0-5.2 0c-5 0-9.9-.3-14.7-1c-55.3-5.6-106.2-34-140-79L8 336c-13.3-17.7-9.7-42.7 8-56s42.7-9.7 56 8l56 74.7L128 40zM240 304c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96zm48-16c-8.8 0-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96z"]
};
const faDrumSteelpan = {
  prefix: 'fas',
  iconName: 'drum-steelpan',
  icon: [576, 512, [], "f56a", "M288 32c159.1 0 288 48 288 128l0 192c0 80-128.9 128-288 128S0 432 0 352L0 160C0 80 128.9 32 288 32zM528 160c0-9.9-8-29.9-55-49.8c-18.6-7.9-40.9-14.4-66-19.4l-27.8 43.6c-7.3 11.5-11.2 24.8-11.2 38.4c0 17.5 6.4 34.4 18.1 47.5l9.8 11c29.8-5.2 55.9-12.5 77.2-21.5c47.1-19.9 55-39.9 55-49.8zM349.2 237.3c-8-26.2-32.4-45.3-61.2-45.3s-53.3 19.1-61.2 45.3c19.4 1.7 39.9 2.7 61.2 2.7s41.8-.9 61.2-2.7zM169 90.8c-25.2 5-47.4 11.6-66 19.4C56 130.1 48 150.1 48 160s8 29.9 55 49.8c21.3 9 47.4 16.3 77.2 21.5l9.8-11c11.6-13.1 18.1-30 18.1-47.5c0-13.6-3.9-26.9-11.2-38.4L169 90.8zm56.3-8C224.5 87 224 91.5 224 96c0 35.3 28.7 64 64 64s64-28.7 64-64c0-4.5-.5-9-1.4-13.2C330.8 81 309.8 80 288 80s-42.8 1-62.6 2.8z"]
};
const faHandScissors = {
  prefix: 'fas',
  iconName: 'hand-scissors',
  icon: [512, 512, [], "f257", "M40 208c-22.1 0-40 17.9-40 40s17.9 40 40 40l180.2 0c-7.6 8.5-12.2 19.7-12.2 32c0 25.3 19.5 46 44.3 47.9c-7.7 8.5-12.3 19.8-12.3 32.1c0 26.5 21.5 48 48 48l32 0 64 0c70.7 0 128-57.3 128-128l0-113.1c0-40.2-16-78.8-44.4-107.3C444.8 76.8 413.9 64 381.7 64L336 64c-21.3 0-39.3 13.9-45.6 33.1l74.5 23.7c8.4 2.7 13.1 11.7 10.4 20.1s-11.7 13.1-20.1 10.4L288 129.9c0 0 0 .1 0 .1L84 65.8C62.9 59.2 40.5 70.9 33.8 92s5.1 43.5 26.2 50.2L269.5 208 40 208z"]
};
const faHandsPraying = {
  prefix: 'fas',
  iconName: 'hands-praying',
  icon: [640, 512, ["praying-hands"], "f684", "M351.2 4.8c3.2-2 6.6-3.3 10-4.1c4.7-1 9.6-.9 14.1 .1c7.7 1.8 14.8 6.5 19.4 13.6L514.6 194.2c8.8 13.1 13.4 28.6 13.4 44.4l0 73.5c0 6.9 4.4 13 10.9 15.2l79.2 26.4C631.2 358 640 370.2 640 384l0 96c0 9.9-4.6 19.3-12.5 25.4s-18.1 8.1-27.7 5.5L431 465.9c-56-14.9-95-65.7-95-123.7L336 224c0-17.7 14.3-32 32-32s32 14.3 32 32l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-84.9c0-7-1.8-13.8-5.3-19.8L340.3 48.1c-1.7-3-2.9-6.1-3.6-9.3c-1-4.7-1-9.6 .1-14.1c1.9-8 6.8-15.2 14.3-19.9zm-62.4 0c7.5 4.6 12.4 11.9 14.3 19.9c1.1 4.6 1.2 9.4 .1 14.1c-.7 3.2-1.9 6.3-3.6 9.3L213.3 199.3c-3.5 6-5.3 12.9-5.3 19.8l0 84.9c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-17.7 14.3-32 32-32s32 14.3 32 32l0 118.2c0 58-39 108.7-95 123.7l-168.7 45c-9.6 2.6-19.9 .5-27.7-5.5S0 490 0 480l0-96c0-13.8 8.8-26 21.9-30.4l79.2-26.4c6.5-2.2 10.9-8.3 10.9-15.2l0-73.5c0-15.8 4.7-31.2 13.4-44.4L245.2 14.5c4.6-7.1 11.7-11.8 19.4-13.6c4.6-1.1 9.4-1.2 14.1-.1c3.5 .8 6.9 2.1 10 4.1z"]
};
const faPrayingHands = faHandsPraying;
const faArrowRotateRight = {
  prefix: 'fas',
  iconName: 'arrow-rotate-right',
  icon: [512, 512, [8635, "arrow-right-rotate", "arrow-rotate-forward", "redo"], "f01e", "M386.3 160L336 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0s-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3s163.8-62.5 226.3 0L386.3 160z"]
};
const faArrowRightRotate = faArrowRotateRight;
const faArrowRotateForward = faArrowRotateRight;
const faRedo = faArrowRotateRight;
const faWebAwesome = {
  prefix: 'fas',
  iconName: 'web-awesome',
  icon: [640, 512, [], "e682", "M372.2 52c0 20.9-12.4 39-30.2 47.2L448 192l104.4-20.9c-5.3-7.7-8.4-17.1-8.4-27.1c0-26.5 21.5-48 48-48s48 21.5 48 48c0 26-20.6 47.1-46.4 48L481 442.3c-10.3 23-33.2 37.7-58.4 37.7l-205.2 0c-25.2 0-48-14.8-58.4-37.7L46.4 192C20.6 191.1 0 170 0 144c0-26.5 21.5-48 48-48s48 21.5 48 48c0 10.1-3.1 19.4-8.4 27.1L192 192 298.1 99.1c-17.7-8.3-30-26.3-30-47.1c0-28.7 23.3-52 52-52s52 23.3 52 52z"]
};
const faBiohazard = {
  prefix: 'fas',
  iconName: 'biohazard',
  icon: [576, 512, [9763], "f780", "M173.2 0c-1.8 0-3.5 .7-4.8 2C138.5 32.3 120 74 120 120c0 26.2 6 50.9 16.6 73c-22 2.4-43.8 9.1-64.2 20.5C37.9 232.8 13.3 262.4 .4 296c-.7 1.7-.5 3.7 .5 5.2c2.2 3.7 7.4 4.3 10.6 1.3C64.2 254.3 158 245.1 205 324s-8.1 153.1-77.6 173.2c-4.2 1.2-6.3 5.9-4.1 9.6c1 1.6 2.6 2.7 4.5 3c36.5 5.9 75.2 .1 109.7-19.2c20.4-11.4 37.4-26.5 50.5-43.8c13.1 17.3 30.1 32.4 50.5 43.8c34.5 19.3 73.3 25.2 109.7 19.2c1.9-.3 3.5-1.4 4.5-3c2.2-3.7 .1-8.4-4.1-9.6C379.1 477.1 324 403 371 324s140.7-69.8 193.5-21.4c3.2 2.9 8.4 2.3 10.6-1.3c1-1.6 1.1-3.5 .5-5.2c-12.9-33.6-37.5-63.2-72.1-82.5c-20.4-11.4-42.2-18.1-64.2-20.5C450 170.9 456 146.2 456 120c0-46-18.5-87.7-48.4-118c-1.3-1.3-3-2-4.8-2c-5 0-8.4 5.2-6.7 9.9C421.7 80.5 385.6 176 288 176S154.3 80.5 179.9 9.9c1.7-4.7-1.6-9.9-6.7-9.9zM240 272a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM181.7 417.6c6.3-11.8 9.8-25.1 8.6-39.8c-19.5-18-34-41.4-41.2-67.8c-12.5-8.1-26.2-11.8-40-12.4c-9-.4-18.1 .6-27.1 2.7c7.8 57.1 38.7 106.8 82.9 139.4c6.8-6.7 12.6-14.1 16.8-22.1zM288 64c-28.8 0-56.3 5.9-81.2 16.5c2 8.3 5 16.2 9 23.5c6.8 12.4 16.7 23.1 30.1 30.3c13.3-4.1 27.5-6.3 42.2-6.3s28.8 2.2 42.2 6.3c13.4-7.2 23.3-17.9 30.1-30.3c4-7.3 7-15.2 9-23.5C344.3 69.9 316.8 64 288 64zM426.9 310c-7.2 26.4-21.7 49.7-41.2 67.8c-1.2 14.7 2.2 28.1 8.6 39.8c4.3 8 10 15.4 16.8 22.1c44.3-32.6 75.2-82.3 82.9-139.4c-9-2.2-18.1-3.1-27.1-2.7c-13.8 .6-27.5 4.4-40 12.4z"]
};
const faLocationCrosshairs = {
  prefix: 'fas',
  iconName: 'location-crosshairs',
  icon: [512, 512, ["location"], "f601", "M256 0c17.7 0 32 14.3 32 32l0 34.7C368.4 80.1 431.9 143.6 445.3 224l34.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-34.7 0C431.9 368.4 368.4 431.9 288 445.3l0 34.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-34.7C143.6 431.9 80.1 368.4 66.7 288L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l34.7 0C80.1 143.6 143.6 80.1 224 66.7L224 32c0-17.7 14.3-32 32-32zM128 256a128 128 0 1 0 256 0 128 128 0 1 0 -256 0zm128-80a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faLocation = faLocationCrosshairs;
const faMarsDouble = {
  prefix: 'fas',
  iconName: 'mars-double',
  icon: [640, 512, [9891], "f227", "M312 32c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l33.4 33.4L275.8 159c-28.4-19.5-62.7-31-99.8-31C78.8 128 0 206.8 0 304s78.8 176 176 176s176-78.8 176-176c0-37-11.4-71.4-31-99.8l52.6-52.6L407 185c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-112c0-13.3-10.7-24-24-24L312 32zm88 48s0 0 0 0s0 0 0 0s0 0 0 0zM64 304a112 112 0 1 1 224 0A112 112 0 1 1 64 304zM368 480c97.2 0 176-78.8 176-176c0-37-11.4-71.4-31-99.8l52.6-52.6L599 185c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2l0-112c0-13.3-10.7-24-24-24L504 32c-9.7 0-18.5 5.8-22.2 14.8c-1.2 2.9-1.8 6-1.8 9l0 .2 0 .2c0 6.2 2.5 12.2 7 16.8l33.4 33.4L480 146.7l0 21.3c0 22.6-13.6 43.1-34.6 51.7c-.8 .3-1.7 .7-2.5 1C465.7 241.2 480 270.9 480 304c0 61.9-50.1 112-112 112c-5.4 0-10.8-.4-16-1.1c-12.9 20.4-29.1 38.3-48.1 53.1c19.8 7.8 41.4 12 64 12z"]
};
const faChildDress = {
  prefix: 'fas',
  iconName: 'child-dress',
  icon: [320, 512, [], "e59c", "M224 64A64 64 0 1 0 96 64a64 64 0 1 0 128 0zM88 400l0 80c0 17.7 14.3 32 32 32s32-14.3 32-32l0-80 16 0 0 80c0 17.7 14.3 32 32 32s32-14.3 32-32l0-80 17.8 0c10.9 0 18.6-10.7 15.2-21.1l-31.1-93.4 28.6 37.8c10.7 14.1 30.8 16.8 44.8 6.2s16.8-30.7 6.2-44.8L254.6 207c-22.4-29.6-57.5-47-94.6-47s-72.2 17.4-94.6 47L6.5 284.7c-10.7 14.1-7.9 34.2 6.2 44.8s34.2 7.9 44.8-6.2l28.7-37.8L55 378.9C51.6 389.3 59.3 400 70.2 400L88 400z"]
};
const faUsersBetweenLines = {
  prefix: 'fas',
  iconName: 'users-between-lines',
  icon: [640, 512, [], "e591", "M0 24C0 10.7 10.7 0 24 0L616 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 48C10.7 48 0 37.3 0 24zM0 488c0-13.3 10.7-24 24-24l592 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24zM83.2 160a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM32 320c0-35.3 28.7-64 64-64l96 0c12.2 0 23.7 3.4 33.4 9.4c-37.2 15.1-65.6 47.2-75.8 86.6L64 352c-17.7 0-32-14.3-32-32zm461.6 32c-10.3-40.1-39.6-72.6-77.7-87.4c9.4-5.5 20.4-8.6 32.1-8.6l96 0c35.3 0 64 28.7 64 64c0 17.7-14.3 32-32 32l-82.4 0zM391.2 290.4c32.1 7.4 58.1 30.9 68.9 61.6c3.5 10 5.5 20.8 5.5 32c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32c0-11.2 1.9-22 5.5-32c10.5-29.7 35.3-52.8 66.1-60.9c7.8-2.1 16-3.1 24.5-3.1l96 0c7.4 0 14.7 .8 21.6 2.4zm44-130.4a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM321.6 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faLungsVirus = {
  prefix: 'fas',
  iconName: 'lungs-virus',
  icon: [640, 512, [], "e067", "M320 0c17.7 0 32 14.3 32 32l0 124.2c-8.5-7.6-19.7-12.2-32-12.2s-23.5 4.6-32 12.2L288 32c0-17.7 14.3-32 32-32zM444.5 195.5c-16.4-16.4-41.8-18.5-60.5-6.1l0-24.1C384 127 415 96 453.3 96c21.7 0 42.8 10.2 55.8 28.8c15.4 22.1 44.3 65.4 71 116.9c26.5 50.9 52.4 112.5 59.6 170.3c.2 1.3 .2 2.6 .2 4l0 7c0 49.1-39.8 89-89 89c-7.3 0-14.5-.9-21.6-2.7l-72.7-18.2c-20.9-5.2-38.7-17.1-51.5-32.9c14 1.5 28.5-3 39.2-13.8l-22.6-22.6 22.6 22.6c18.7-18.7 18.7-49.1 0-67.9c-1.1-1.1-1.4-2-1.5-2.5c-.1-.8-.1-1.8 .4-2.9s1.2-1.9 1.8-2.3c.5-.3 1.3-.8 2.9-.8c26.5 0 48-21.5 48-48s-21.5-48-48-48c-1.6 0-2.4-.4-2.9-.8c-.6-.4-1.3-1.2-1.8-2.3s-.5-2.2-.4-2.9c.1-.6 .4-1.4 1.5-2.5c18.7-18.7 18.7-49.1 0-67.9zM421.8 421.8c-6.2 6.2-16.4 6.2-22.6 0C375.9 398.5 336 415 336 448c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-33-39.9-49.5-63.2-26.2c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6C241.5 375.9 225 336 192 336c-8.8 0-16-7.2-16-16s7.2-16 16-16c33 0 49.5-39.9 26.2-63.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0C264.1 241.5 304 225 304 192c0-8.8 7.2-16 16-16s16 7.2 16 16c0 33 39.9 49.5 63.2 26.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6C398.5 264.1 415 304 448 304c8.8 0 16 7.2 16 16s-7.2 16-16 16c-33 0-49.5 39.9-26.2 63.2c6.2 6.2 6.2 16.4 0 22.6zM183.3 491.2l-72.7 18.2c-7.1 1.8-14.3 2.7-21.6 2.7c-49.1 0-89-39.8-89-89l0-7c0-1.3 .1-2.7 .2-4c7.2-57.9 33.1-119.4 59.6-170.3c26.8-51.5 55.6-94.8 71-116.9c13-18.6 34-28.8 55.8-28.8C225 96 256 127 256 165.3l0 24.1c-18.6-12.4-44-10.3-60.5 6.1c-18.7 18.7-18.7 49.1 0 67.9c1.1 1.1 1.4 2 1.5 2.5c.1 .8 .1 1.8-.4 2.9s-1.2 1.9-1.8 2.3c-.5 .3-1.3 .8-2.9 .8c-26.5 0-48 21.5-48 48s21.5 48 48 48c1.6 0 2.4 .4 2.9 .8c.6 .4 1.3 1.2 1.8 2.3s.5 2.2 .4 2.9c-.1 .6-.4 1.4-1.5 2.5c-18.7 18.7-18.7 49.1 0 67.9c10.7 10.7 25.3 15.3 39.2 13.8c-12.8 15.9-30.6 27.7-51.5 32.9zM296 320a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm72 32a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faFaceGrinTears = {
  prefix: 'fas',
  iconName: 'face-grin-tears',
  icon: [640, 512, [128514, "grin-tears"], "f588", "M548.6 371.4C506.4 454.8 419.9 512 320 512s-186.4-57.2-228.6-140.6c4.5-2.9 8.7-6.3 12.7-10.3c8.1-8.1 13.2-18.6 16.5-26.6c3.6-8.8 6.5-18.4 8.8-27.5c4.6-18.2 7.7-37 9.3-48.2c3.9-26.5-18.8-49.2-45.2-45.4c-6.8 .9-16.2 2.4-26.6 4.4C85.3 94.5 191.6 0 320 0S554.7 94.5 573.2 217.7c-10.3-2-19.8-3.5-26.6-4.4c-26.5-3.9-49.2 18.8-45.2 45.4c1.6 11.3 4.6 30 9.3 48.2c2.3 9.1 5.2 18.8 8.8 27.5c3.3 8.1 8.4 18.5 16.5 26.6c3.9 3.9 8.2 7.4 12.7 10.3zM107 254.1c-3.1 21.5-11.4 70.2-25.5 84.4c-.9 1-1.9 1.8-2.9 2.7C60 356.7 32 355.5 14.3 337.7c-18.7-18.7-19.1-48.8-.7-67.2c8.6-8.6 30.1-15.1 50.5-19.6c13-2.8 25.5-4.8 33.9-6c5.4-.8 9.9 3.7 9 9zm454.5 87.1c-.8-.6-1.5-1.3-2.3-2c-.2-.2-.5-.4-.7-.7c-14.1-14.1-22.5-62.9-25.5-84.4c-.8-5.4 3.7-9.9 9-9c1 .1 2.2 .3 3.3 .5c8.2 1.2 19.2 3 30.6 5.5c20.4 4.4 41.9 10.9 50.5 19.6c18.4 18.4 18 48.5-.7 67.2c-17.7 17.7-45.7 19-64.2 3.4zm-90.1-9.7c5-11.8-7-22.5-19.3-18.7c-39.7 12.2-84.5 19-131.8 19s-92.1-6.8-131.8-19c-12.3-3.8-24.3 6.9-19.3 18.7c25 59.1 83.2 100.5 151.1 100.5s126.2-41.4 151.1-100.5zM281.6 228.8s0 0 0 0s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C190.7 188.4 184 206.1 184 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0zm160 0s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C350.7 188.4 344 206.1 344 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0c0 0 0 0 0 0z"]
};
const faGrinTears = faFaceGrinTears;
const faPhone = {
  prefix: 'fas',
  iconName: 'phone',
  icon: [512, 512, [128222, 128379], "f095", "M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"]
};
const faCalendarXmark = {
  prefix: 'fas',
  iconName: 'calendar-xmark',
  icon: [448, 512, ["calendar-times"], "f273", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM305 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47z"]
};
const faCalendarTimes = faCalendarXmark;
const faChildReaching = {
  prefix: 'fas',
  iconName: 'child-reaching',
  icon: [384, 512, [], "e59d", "M256 64A64 64 0 1 0 128 64a64 64 0 1 0 128 0zM152.9 169.3c-23.7-8.4-44.5-24.3-58.8-45.8L74.6 94.2C64.8 79.5 45 75.6 30.2 85.4s-18.7 29.7-8.9 44.4L40.9 159c18.1 27.1 42.8 48.4 71.1 62.4L112 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 32 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-258.4c29.1-14.2 54.4-36.2 72.7-64.2l18.2-27.9c9.6-14.8 5.4-34.6-9.4-44.3s-34.6-5.5-44.3 9.4L291 122.4c-21.8 33.4-58.9 53.6-98.8 53.6c-12.6 0-24.9-2-36.6-5.8c-.9-.3-1.8-.7-2.7-.9z"]
};
const faHeadSideVirus = {
  prefix: 'fas',
  iconName: 'head-side-virus',
  icon: [512, 512, [], "e064", "M0 224.2C0 100.6 100.2 0 224 0l24 0c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8L448 320l0 64c0 35.3-28.7 64-64 64l-64 0 0 32c0 17.7-14.3 32-32 32L96 512c-17.7 0-32-14.3-32-32l0-72.7c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zM224 64c-8.8 0-16 7.2-16 16c0 33-39.9 49.5-63.2 26.2c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6C145.5 152.1 129 192 96 192c-8.8 0-16 7.2-16 16s7.2 16 16 16c33 0 49.5 39.9 26.2 63.2c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0C168.1 286.5 208 303 208 336c0 8.8 7.2 16 16 16s16-7.2 16-16c0-33 39.9-49.5 63.2-26.2c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6C302.5 263.9 319 224 352 224c8.8 0 16-7.2 16-16s-7.2-16-16-16c-33 0-49.5-39.9-26.2-63.2c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0C279.9 129.5 240 113 240 80c0-8.8-7.2-16-16-16zm-24 96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40 80a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faUserGear = {
  prefix: 'fas',
  iconName: 'user-gear',
  icon: [640, 512, ["user-cog"], "f4fe", "M224 0a128 128 0 1 1 0 256A128 128 0 1 1 224 0zM178.3 304l91.4 0c11.8 0 23.4 1.2 34.5 3.3c-2.1 18.5 7.4 35.6 21.8 44.8c-16.6 10.6-26.7 31.6-20 53.3c4 12.9 9.4 25.5 16.4 37.6s15.2 23.1 24.4 33c15.7 16.9 39.6 18.4 57.2 8.7l0 .9c0 9.2 2.7 18.5 7.9 26.3L29.7 512C13.3 512 0 498.7 0 482.3C0 383.8 79.8 304 178.3 304zM436 218.2c0-7 4.5-13.3 11.3-14.8c10.5-2.4 21.5-3.7 32.7-3.7s22.2 1.3 32.7 3.7c6.8 1.5 11.3 7.8 11.3 14.8l0 30.6c7.9 3.4 15.4 7.7 22.3 12.8l24.9-14.3c6.1-3.5 13.7-2.7 18.5 2.4c7.6 8.1 14.3 17.2 20.1 27.2s10.3 20.4 13.5 31c2.1 6.7-1.1 13.7-7.2 17.2l-25 14.4c.4 4 .7 8.1 .7 12.3s-.2 8.2-.7 12.3l25 14.4c6.1 3.5 9.2 10.5 7.2 17.2c-3.3 10.6-7.8 21-13.5 31s-12.5 19.1-20.1 27.2c-4.8 5.1-12.5 5.9-18.5 2.4l-24.9-14.3c-6.9 5.1-14.3 9.4-22.3 12.8l0 30.6c0 7-4.5 13.3-11.3 14.8c-10.5 2.4-21.5 3.7-32.7 3.7s-22.2-1.3-32.7-3.7c-6.8-1.5-11.3-7.8-11.3-14.8l0-30.5c-8-3.4-15.6-7.7-22.5-12.9l-24.7 14.3c-6.1 3.5-13.7 2.7-18.5-2.4c-7.6-8.1-14.3-17.2-20.1-27.2s-10.3-20.4-13.5-31c-2.1-6.7 1.1-13.7 7.2-17.2l24.8-14.3c-.4-4.1-.7-8.2-.7-12.4s.2-8.3 .7-12.4L343.8 325c-6.1-3.5-9.2-10.5-7.2-17.2c3.3-10.6 7.7-21 13.5-31s12.5-19.1 20.1-27.2c4.8-5.1 12.4-5.9 18.5-2.4l24.8 14.3c6.9-5.1 14.5-9.4 22.5-12.9l0-30.5zm92.1 133.5a48.1 48.1 0 1 0 -96.1 0 48.1 48.1 0 1 0 96.1 0z"]
};
const faUserCog = faUserGear;
const faArrowUp19 = {
  prefix: 'fas',
  iconName: 'arrow-up-1-9',
  icon: [576, 512, ["sort-numeric-up"], "f163", "M450.7 38c8.3 6 13.3 15.7 13.3 26l0 96 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-51.6-5.9 2c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5l48-16c9.8-3.3 20.5-1.6 28.8 4.4zM160 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L192 146.3 192 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-301.7L95.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C142.5 35.8 151 32 160 32zM445.7 364.9A32 32 0 1 0 418.3 307a32 32 0 1 0 27.4 57.9zm-40.7 54.9C369.6 408.4 344 375.2 344 336c0-48.6 39.4-88 88-88s88 39.4 88 88c0 23.5-7.5 46.3-21.5 65.2L449.7 467c-10.5 14.2-30.6 17.2-44.8 6.7s-17.2-30.6-6.7-44.8l6.8-9.2z"]
};
const faSortNumericUp = faArrowUp19;
const faDoorClosed = {
  prefix: 'fas',
  iconName: 'door-closed',
  icon: [576, 512, [128682], "f52a", "M96 64c0-35.3 28.7-64 64-64L416 0c35.3 0 64 28.7 64 64l0 384 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-112 0-288 0L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0L96 64zM384 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faShieldVirus = {
  prefix: 'fas',
  iconName: 'shield-virus',
  icon: [512, 512, [], "e06c", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM256 112c8.8 0 16 7.2 16 16c0 33 39.9 49.5 63.2 26.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6C334.5 200.1 351 240 384 240c8.8 0 16 7.2 16 16s-7.2 16-16 16c-33 0-49.5 39.9-26.2 63.2c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0C311.9 334.5 272 351 272 384c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-33-39.9-49.5-63.2-26.2c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6C177.5 311.9 161 272 128 272c-8.8 0-16-7.2-16-16s7.2-16 16-16c33 0 49.5-39.9 26.2-63.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0C200.1 177.5 240 161 240 128c0-8.8 7.2-16 16-16zM232 256a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm72 32a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faDiceSix = {
  prefix: 'fas',
  iconName: 'dice-six',
  icon: [448, 512, [9861], "f526", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm160 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faMosquitoNet = {
  prefix: 'fas',
  iconName: 'mosquito-net',
  icon: [640, 512, [], "e52c", "M168.8 462.3c-7.9-4-11.1-13.6-7.2-21.5L192 380.2l0-44.2c0-4.2 1.7-8.3 4.7-11.3L256 265.4l0-23.1L139.2 344C87.8 395.3 0 358.9 0 286.3c0-41.1 30.6-75.8 71.4-80.9l159.9-23.9-49.6-41.3c-5.1-4.2-7-11.1-4.9-17.4l13.9-41.7-29-58.1c-4-7.9-.7-17.5 7.2-21.5s17.5-.7 21.5 7.2l32 64c1.9 3.8 2.2 8.2 .9 12.2l-12.5 37.6L256 160.5l0-22.6c0-14.9 10.1-27.3 23.8-31l0-43.3c0-4.5 3.7-8.2 8.2-8.2s8.2 3.7 8.2 8.2l0 43.3c13.7 3.6 23.8 16.1 23.8 31l0 22.6 45.4-37.8L352.8 85.1c-1.3-4-1-8.4 .9-12.2l32-64c4-7.9 13.6-11.1 21.5-7.2s11.1 13.6 7.2 21.5l-29 58.1 13.9 41.7c2.1 6.2 .1 13.1-4.9 17.4l-49.6 41.3 159.9 23.9c22.5 2.8 41.8 14.6 54.7 31.4c-2.7 2.6-5.2 5.4-7.3 8.6c-8.6-12.9-23.3-21.5-40-21.5s-31.4 8.5-40 21.5c-8.6-12.9-23.3-21.5-40-21.5c-21.7 0-40 14.3-45.9 34.1c-10.7 3.2-19.8 10.1-25.9 19.2l-40.2-35 0 23.1 32.4 32.4c-.3 2-.4 4.1-.4 6.2c0 16.7 8.5 31.4 21.5 40c-4 2.6-7.5 5.9-10.6 9.5L320 310.6l0 50c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-50-32 32 0 41.4c0 2.5-.6 4.9-1.7 7.2l-32 64c-4 7.9-13.6 11.1-21.5 7.2zM512 256c8.8 0 16 7.2 16 16l0 16 48 0 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 16 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0 0 48 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0 0 48 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-16-48 0 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-16-48 0 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-16-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 0-48-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 0-48-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 16 48 0 0-16c0-8.8 7.2-16 16-16zm16 112l48 0 0-48-48 0 0 48zm0 80l48 0 0-48-48 0 0 48zM448 320l0 48 48 0 0-48-48 0zm0 80l0 48 48 0 0-48-48 0z"]
};
const faFileFragment = {
  prefix: 'fas',
  iconName: 'file-fragment',
  icon: [384, 512, [], "e697", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64l-128 0 0-128c0-35.3-28.7-64-64-64L0 320 0 64zm384 64l-128 0L256 0 384 128zM32 352l96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32z"]
};
const faBridgeWater = {
  prefix: 'fas',
  iconName: 'bridge-water',
  icon: [576, 512, [], "e4ce", "M0 96C0 78.3 14.3 64 32 64l512 0c17.7 0 32 14.3 32 32l0 35.6c0 15.7-12.7 28.4-28.4 28.4c-37.3 0-67.6 30.2-67.6 67.6l0 124.9c-12.9 0-25.8 3.9-36.8 11.7c-18 12.4-40.1 20.3-59.2 20.3c0 0 0 0 0 0l0-.5 0-128c0-53-43-96-96-96s-96 43-96 96l0 128 0 .5c-19 0-41.2-7.9-59.1-20.3c-11.1-7.8-24-11.7-36.9-11.7l0-124.9C96 190.2 65.8 160 28.4 160C12.7 160 0 147.3 0 131.6L0 96zM306.5 389.9C329 405.4 356.5 416 384 416c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 469.7 417 480 384 480c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 405.2 165.1 416 192 416c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faPersonBooth = {
  prefix: 'fas',
  iconName: 'person-booth',
  icon: [576, 512, [], "f756", "M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160 64 0 0-160zm320 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-448zM224 512c17.7 0 32-14.3 32-32l0-160-64 0 0 160c0 17.7 14.3 32 32 32zM320 0c-9.3 0-18.1 4-24.2 11s-8.8 16.3-7.5 25.5l31.2 218.6L288.6 409.7c-3.5 17.3 7.8 34.2 25.1 37.7s34.2-7.8 37.7-25.1l.7-3.6c1.3 16.4 15.1 29.4 31.9 29.4c17.7 0 32-14.3 32-32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32L320 0zM112 80A48 48 0 1 0 16 80a48 48 0 1 0 96 0zm0 261.3l0-72.1 4.7 4.7c9 9 21.2 14.1 33.9 14.1l73.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-66.7 0-41.6-41.6c-14.3-14.3-33.8-22.4-54-22.4C27.6 160 0 187.6 0 221.6l0 55.7 0 .9L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 32 42.7L96 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-58.7c0-10.4-3.4-20.5-9.6-28.8L112 341.3z"]
};
const faTextWidth = {
  prefix: 'fas',
  iconName: 'text-width',
  icon: [448, 512, [], "f035", "M64 128l0-32 128 0 0 128-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-128 128 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48c0-26.5-21.5-48-48-48L224 32 48 32C21.5 32 0 53.5 0 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32zM9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-32 192 0 0 32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 32-192 0 0-32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64z"]
};
const faHatWizard = {
  prefix: 'fas',
  iconName: 'hat-wizard',
  icon: [512, 512, [], "f6e8", "M64 416L168.6 180.7c15.3-34.4 40.3-63.5 72-83.7l146.9-94c3-1.9 6.5-2.9 10-2.9C407.7 0 416 8.3 416 18.6l0 1.6c0 2.6-.5 5.1-1.4 7.5L354.8 176.9c-1.9 4.7-2.8 9.7-2.8 14.7c0 5.5 1.2 11 3.4 16.1L448 416l-207.1 0 11.8-35.4 40.4-13.5c6.5-2.2 10.9-8.3 10.9-15.2s-4.4-13-10.9-15.2l-40.4-13.5-13.5-40.4C237 276.4 230.9 272 224 272s-13 4.4-15.2 10.9l-13.5 40.4-40.4 13.5C148.4 339 144 345.1 144 352s4.4 13 10.9 15.2l40.4 13.5L207.1 416 64 416zM279.6 141.5c-1.1-3.3-4.1-5.5-7.6-5.5s-6.5 2.2-7.6 5.5l-6.7 20.2-20.2 6.7c-3.3 1.1-5.5 4.1-5.5 7.6s2.2 6.5 5.5 7.6l20.2 6.7 6.7 20.2c1.1 3.3 4.1 5.5 7.6 5.5s6.5-2.2 7.6-5.5l6.7-20.2 20.2-6.7c3.3-1.1 5.5-4.1 5.5-7.6s-2.2-6.5-5.5-7.6l-20.2-6.7-6.7-20.2zM32 448l448 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faPenFancy = {
  prefix: 'fas',
  iconName: 'pen-fancy',
  icon: [512, 512, [128395, 10002], "f5ac", "M373.5 27.1C388.5 9.9 410.2 0 433 0c43.6 0 79 35.4 79 79c0 22.8-9.9 44.6-27.1 59.6L277.7 319l-10.3-10.3-64-64L193 234.3 373.5 27.1zM170.3 256.9l10.4 10.4 64 64 10.4 10.4-19.2 83.4c-3.9 17.1-16.9 30.7-33.8 35.4L24.3 510.3l95.4-95.4c2.6 .7 5.4 1.1 8.3 1.1c17.7 0 32-14.3 32-32s-14.3-32-32-32s-32 14.3-32 32c0 2.9 .4 5.6 1.1 8.3L1.7 487.6 51.5 310c4.7-16.9 18.3-29.9 35.4-33.8l83.4-19.2z"]
};
const faPersonDigging = {
  prefix: 'fas',
  iconName: 'person-digging',
  icon: [576, 512, ["digging"], "f85e", "M208 64a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM9.8 214.8c5.1-12.2 19.1-18 31.4-12.9L60.7 210l22.9-38.1C99.9 144.6 129.3 128 161 128c51.4 0 97 32.9 113.3 81.7l34.6 103.7 79.3 33.1 34.2-45.6c6.4-8.5 16.6-13.3 27.2-12.8s20.3 6.4 25.8 15.5l96 160c5.9 9.9 6.1 22.2 .4 32.2s-16.3 16.2-27.8 16.2l-256 0c-11.1 0-21.4-5.7-27.2-15.2s-6.4-21.2-1.4-31.1l16-32c5.4-10.8 16.5-17.7 28.6-17.7l32 0 22.5-30L22.8 246.2c-12.2-5.1-18-19.1-12.9-31.4zm82.8 91.8l112 48c11.8 5 19.4 16.6 19.4 29.4l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-74.9-60.6-26-37 111c-5.6 16.8-23.7 25.8-40.5 20.2S-3.9 486.6 1.6 469.9l48-144 11-33 32 13.7z"]
};
const faDigging = faPersonDigging;
const faTrash = {
  prefix: 'fas',
  iconName: 'trash',
  icon: [448, 512, [], "f1f8", "M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"]
};
const faGaugeSimple = {
  prefix: 'fas',
  iconName: 'gauge-simple',
  icon: [512, 512, ["gauge-simple-med", "tachometer-average"], "f629", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-26.9-16.5-49.9-40-59.3L280 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 204.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64s64-28.7 64-64z"]
};
const faGaugeSimpleMed = faGaugeSimple;
const faTachometerAverage = faGaugeSimple;
const faBookMedical = {
  prefix: 'fas',
  iconName: 'book-medical',
  icon: [448, 512, [], "f7e6", "M0 96C0 43 43 0 96 0L384 0l32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32zM208 112l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faPoo = {
  prefix: 'fas',
  iconName: 'poo',
  icon: [512, 512, [128169], "f2fe", "M268.9 .9c-5.5-.7-11 1.4-14.5 5.7s-4.6 10.1-2.8 15.4c2.8 8.2 4.3 16.9 4.3 26.1c0 44.1-35.7 79.9-79.8 80L160 128c-35.3 0-64 28.7-64 64c0 19.1 8.4 36.3 21.7 48L104 240c-39.8 0-72 32.2-72 72c0 23.2 11 43.8 28 57c-34.1 5.7-60 35.3-60 71c0 39.8 32.2 72 72 72l368 0c39.8 0 72-32.2 72-72c0-35.7-25.9-65.3-60-71c17-13.2 28-33.8 28-57c0-39.8-32.2-72-72-72l-13.7 0c13.3-11.7 21.7-28.9 21.7-48c0-35.3-28.7-64-64-64l-5.5 0c3.5-10 5.5-20.8 5.5-32c0-48.6-36.2-88.8-83.1-95.1zM192 256a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm64 108.3c0 2.4-.7 4.8-2.2 6.7c-8.2 10.5-39.5 45-93.8 45s-85.6-34.6-93.8-45c-1.5-1.9-2.2-4.3-2.2-6.7c0-6.8 5.5-12.3 12.3-12.3l167.4 0c6.8 0 12.3 5.5 12.3 12.3z"]
};
const faQuoteRight = {
  prefix: 'fas',
  iconName: 'quote-right',
  icon: [448, 512, [8221, "quote-right-alt"], "f10e", "M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"]
};
const faQuoteRightAlt = faQuoteRight;
const faShirt = {
  prefix: 'fas',
  iconName: 'shirt',
  icon: [640, 512, [128085, "t-shirt", "tshirt"], "f553", "M211.8 0c7.8 0 14.3 5.7 16.7 13.2C240.8 51.9 277.1 80 320 80s79.2-28.1 91.5-66.8C413.9 5.7 420.4 0 428.2 0l12.6 0c22.5 0 44.2 7.9 61.5 22.3L628.5 127.4c6.6 5.5 10.7 13.5 11.4 22.1s-2.1 17.1-7.8 23.6l-56 64c-11.4 13.1-31.2 14.6-44.6 3.5L480 197.7 480 448c0 35.3-28.7 64-64 64l-192 0c-35.3 0-64-28.7-64-64l0-250.3-51.5 42.9c-13.3 11.1-33.1 9.6-44.6-3.5l-56-64c-5.7-6.5-8.5-15-7.8-23.6s4.8-16.6 11.4-22.1L137.7 22.3C155 7.9 176.7 0 199.2 0l12.6 0z"]
};
const faTShirt = faShirt;
const faTshirt = faShirt;
const faCubes = {
  prefix: 'fas',
  iconName: 'cubes',
  icon: [576, 512, [], "f1b3", "M290.8 48.6l78.4 29.7L288 109.5 206.8 78.3l78.4-29.7c1.8-.7 3.8-.7 5.7 0zM136 92.5l0 112.2c-1.3 .4-2.6 .8-3.9 1.3l-96 36.4C14.4 250.6 0 271.5 0 294.7L0 413.9c0 22.2 13.1 42.3 33.5 51.3l96 42.2c14.4 6.3 30.7 6.3 45.1 0L288 457.5l113.5 49.9c14.4 6.3 30.7 6.3 45.1 0l96-42.2c20.3-8.9 33.5-29.1 33.5-51.3l0-119.1c0-23.3-14.4-44.1-36.1-52.4l-96-36.4c-1.3-.5-2.6-.9-3.9-1.3l0-112.2c0-23.3-14.4-44.1-36.1-52.4l-96-36.4c-12.8-4.8-26.9-4.8-39.7 0l-96 36.4C150.4 48.4 136 69.3 136 92.5zM392 210.6l-82.4 31.2 0-89.2L392 121l0 89.6zM154.8 250.9l78.4 29.7L152 311.7 70.8 280.6l78.4-29.7c1.8-.7 3.8-.7 5.7 0zm18.8 204.4l0-100.5L256 323.2l0 95.9-82.4 36.2zM421.2 250.9c1.8-.7 3.8-.7 5.7 0l78.4 29.7L424 311.7l-81.2-31.1 78.4-29.7zM523.2 421.2l-77.6 34.1 0-100.5L528 323.2l0 90.7c0 3.2-1.9 6-4.8 7.3z"]
};
const faDivide = {
  prefix: 'fas',
  iconName: 'divide',
  icon: [448, 512, [10135, 247], "f529", "M272 96a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 320a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM400 288c17.7 0 32-14.3 32-32s-14.3-32-32-32L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l352 0z"]
};
const faTengeSign = {
  prefix: 'fas',
  iconName: 'tenge-sign',
  icon: [384, 512, [8376, "tenge"], "f7d7", "M0 64C0 46.3 14.3 32 32 32l320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM0 192c0-17.7 14.3-32 32-32l160 0 160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0 0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-224L32 224c-17.7 0-32-14.3-32-32z"]
};
const faTenge = faTengeSign;
const faHeadphones = {
  prefix: 'fas',
  iconName: 'headphones',
  icon: [512, 512, [127911], "f025", "M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48c-44.2 0-80-35.8-80-80l0-16 0-48 0-48C0 146.6 114.6 32 256 32s256 114.6 256 256l0 48 0 48 0 16c0 44.2-35.8 80-80 80c-26.5 0-48-21.5-48-48l0-128c0-26.5 21.5-48 48-48c10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80z"]
};
const faHandsHolding = {
  prefix: 'fas',
  iconName: 'hands-holding',
  icon: [640, 512, [], "f4c2", "M80 104c0-22.1-17.9-40-40-40S0 81.9 0 104l0 56 0 64L0 325.5c0 25.5 10.1 49.9 28.1 67.9L128 493.3c12 12 28.3 18.7 45.3 18.7l66.7 0c26.5 0 48-21.5 48-48l0-78.9c0-29.7-11.8-58.2-32.8-79.2l-25.3-25.3c0 0 0 0 0 0l-15.2-15.2-32-32c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l32 32 15.2 15.2c11 11 9.2 29.2-3.7 37.8c-9.7 6.5-22.7 5.2-31-3.1L98.7 309.5c-12-12-18.7-28.3-18.7-45.3L80 224l0-80 0-40zm480 0l0 40 0 80 0 40.2c0 17-6.7 33.3-18.7 45.3l-51.1 51.1c-8.3 8.3-21.3 9.6-31 3.1c-12.9-8.6-14.7-26.9-3.7-37.8l15.2-15.2 32-32c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-32 32-15.2 15.2c0 0 0 0 0 0l-25.3 25.3c-21 21-32.8 49.5-32.8 79.2l0 78.9c0 26.5 21.5 48 48 48l66.7 0c17 0 33.3-6.7 45.3-18.7l99.9-99.9c18-18 28.1-42.4 28.1-67.9L640 224l0-64 0-56c0-22.1-17.9-40-40-40s-40 17.9-40 40z"]
};
const faHandsClapping = {
  prefix: 'fas',
  iconName: 'hands-clapping',
  icon: [512, 512, [], "e1a8", "M336 16l0 64c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16zm-98.7 7.1l32 48c4.9 7.4 2.9 17.3-4.4 22.2s-17.3 2.9-22.2-4.4l-32-48c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4zM135 119c9.4-9.4 24.6-9.4 33.9 0L292.7 242.7c10.1 10.1 27.3 2.9 27.3-11.3l0-39.4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 153.6c0 57.1-30 110-78.9 139.4c-64 38.4-145.8 28.3-198.5-24.4L7 361c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l53 53c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1L23 265c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l93 93c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1L55 185c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l117 117c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1l-93-93c-9.4-9.4-9.4-24.6 0-33.9zM433.1 484.9c-24.2 14.5-50.9 22.1-77.7 23.1c48.1-39.6 76.6-99 76.6-162.4l0-98.1c8.2-.1 16-6.4 16-16l0-39.4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 153.6c0 57.1-30 110-78.9 139.4zM424.9 18.7c7.4 4.9 9.3 14.8 4.4 22.2l-32 48c-4.9 7.4-14.8 9.3-22.2 4.4s-9.3-14.8-4.4-22.2l32-48c4.9-7.4 14.8-9.3 22.2-4.4z"]
};
const faRepublican = {
  prefix: 'fas',
  iconName: 'republican',
  icon: [640, 512, [], "f75e", "M0 192C0 103.6 71.6 32 160 32l224 0c88.4 0 160 71.6 160 160l0 64L0 256l0-64zm415.9-64c-2.4 0-4.7 1.3-5.7 3.4l-12.6 24.6-28.2 4c-2.4 .3-4.4 2-5.2 4.2s-.1 4.7 1.6 6.3l20.4 19.2-4.8 27.1c-.4 2.3 .6 4.7 2.5 6s4.6 1.6 6.7 .5l25.2-12.8 25.2 12.8c2.2 1.1 4.8 .9 6.7-.5s3-3.7 2.5-6l-4.8-27.1L466 170.5c1.7-1.6 2.4-4.1 1.6-6.3s-2.8-3.9-5.2-4.2l-28.2-4-12.6-24.6c-1.1-2.1-3.3-3.4-5.7-3.4zm-138.3 3.4c-1.1-2.1-3.3-3.4-5.7-3.4s-4.7 1.3-5.7 3.4l-12.6 24.6-28.2 4c-2.4 .3-4.4 2-5.2 4.2s-.1 4.7 1.6 6.3l20.4 19.2-4.8 27.1c-.4 2.3 .6 4.7 2.5 6s4.6 1.6 6.7 .5l25.2-12.8 25.2 12.8c2.2 1.1 4.8 .9 6.7-.5s3-3.7 2.5-6l-4.8-27.1L322 170.5c1.7-1.6 2.4-4.1 1.6-6.3s-2.8-3.9-5.2-4.2l-28.2-4-12.6-24.6zM127.9 128c-2.4 0-4.7 1.3-5.7 3.4l-12.6 24.6-28.2 4c-2.4 .3-4.4 2-5.2 4.2s-.1 4.7 1.6 6.3l20.4 19.2-4.8 27.1c-.4 2.3 .6 4.7 2.5 6s4.6 1.6 6.7 .5l25.2-12.8 25.2 12.8c2.2 1.1 4.8 .9 6.7-.5s3-3.7 2.5-6l-4.8-27.1L178 170.5c1.7-1.6 2.4-4.1 1.6-6.3s-2.8-3.9-5.2-4.2l-28.2-4-12.6-24.6c-1.1-2.1-3.3-3.4-5.7-3.4zm.1 160l192 0 96 0 32 0 64 0 32 0 0 32 0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48c0-17.7 14.3-32 32-32s32 14.3 32 32l0 48c0 44.2-35.8 80-80 80s-80-35.8-80-80l0-48-32 0 0 32 0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64-192 0 0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64 0-96 128 0z"]
};
const faArrowLeft = {
  prefix: 'fas',
  iconName: 'arrow-left',
  icon: [448, 512, [8592], "f060", "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]
};
const faPersonCircleXmark = {
  prefix: 'fas',
  iconName: 'person-circle-xmark',
  icon: [576, 512, [], "e543", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L432 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L409.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L432 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L454.6 368l36.7-36.7z"]
};
const faRuler = {
  prefix: 'fas',
  iconName: 'ruler',
  icon: [512, 512, [128207], "f545", "M177.9 494.1c-18.7 18.7-49.1 18.7-67.9 0L17.9 401.9c-18.7-18.7-18.7-49.1 0-67.9l50.7-50.7 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 50.7-50.7c18.7-18.7 49.1-18.7 67.9 0l92.1 92.1c18.7 18.7 18.7 49.1 0 67.9L177.9 494.1z"]
};
const faAlignLeft = {
  prefix: 'fas',
  iconName: 'align-left',
  icon: [448, 512, [], "f036", "M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
};
const faDiceD6 = {
  prefix: 'fas',
  iconName: 'dice-d6',
  icon: [448, 512, [], "f6d1", "M201 10.3c14.3-7.8 31.6-7.8 46 0L422.3 106c5.1 2.8 8.3 8.2 8.3 14s-3.2 11.2-8.3 14L231.7 238c-4.8 2.6-10.5 2.6-15.3 0L25.7 134c-5.1-2.8-8.3-8.2-8.3-14s3.2-11.2 8.3-14L201 10.3zM23.7 170l176 96c5.1 2.8 8.3 8.2 8.3 14l0 216c0 5.6-3 10.9-7.8 13.8s-10.9 3-15.8 .3L25 423.1C9.6 414.7 0 398.6 0 381L0 184c0-5.6 3-10.9 7.8-13.8s10.9-3 15.8-.3zm400.7 0c5-2.7 11-2.6 15.8 .3s7.8 8.1 7.8 13.8l0 197c0 17.6-9.6 33.7-25 42.1L263.7 510c-5 2.7-11 2.6-15.8-.3s-7.8-8.1-7.8-13.8l0-216c0-5.9 3.2-11.2 8.3-14l176-96z"]
};
const faRestroom = {
  prefix: 'fas',
  iconName: 'restroom',
  icon: [640, 512, [], "f7bd", "M80 48a48 48 0 1 1 96 0A48 48 0 1 1 80 48zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-154.8c-8.1 9.2-21.1 13.2-33.5 9.4c-16.9-5.3-26.3-23.2-21-40.1l30.9-99.1C44.9 155.3 82 128 124 128l8 0c42 0 79.1 27.3 91.6 67.4l30.9 99.1c5.3 16.9-4.1 34.8-21 40.1c-12.4 3.9-25.4-.2-33.5-9.4L200 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM320 0c13.3 0 24 10.7 24 24l0 464c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-464c0-13.3 10.7-24 24-24zM464 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM440 480l0-96-17.8 0c-10.9 0-18.6-10.7-15.2-21.1l9-26.9c-3.2 0-6.4-.5-9.5-1.5c-16.9-5.3-26.3-23.2-21-40.1l29.7-95.2C428.4 156.9 467.6 128 512 128s83.6 28.9 96.8 71.2l29.7 95.2c5.3 16.9-4.1 34.8-21 40.1c-3.2 1-6.4 1.5-9.5 1.5l9 26.9c3.5 10.4-4.3 21.1-15.2 21.1L584 384l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-16 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32z"]
};
const faJ = {
  prefix: 'fas',
  iconName: 'j',
  icon: [320, 512, [106], "4a", "M288 32c17.7 0 32 14.3 32 32l0 256c0 88.4-71.6 160-160 160S0 408.4 0 320l0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32c0 53 43 96 96 96s96-43 96-96l0-256c0-17.7 14.3-32 32-32z"]
};
const faUsersViewfinder = {
  prefix: 'fas',
  iconName: 'users-viewfinder',
  icon: [640, 512, [], "e595", "M48 48l88 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L32 0C14.3 0 0 14.3 0 32L0 136c0 13.3 10.7 24 24 24s24-10.7 24-24l0-88zM175.8 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-26.5 32C119.9 256 96 279.9 96 309.3c0 14.7 11.9 26.7 26.7 26.7l56.1 0c8-34.1 32.8-61.7 65.2-73.6c-7.5-4.1-16.2-6.4-25.3-6.4l-69.3 0zm368 80c14.7 0 26.7-11.9 26.7-26.7c0-29.5-23.9-53.3-53.3-53.3l-69.3 0c-9.2 0-17.8 2.3-25.3 6.4c32.4 11.9 57.2 39.5 65.2 73.6l56.1 0zm-89.4 0c-8.6-24.3-29.9-42.6-55.9-47c-3.9-.7-7.9-1-12-1l-80 0c-4.1 0-8.1 .3-12 1c-26 4.4-47.3 22.7-55.9 47c-2.7 7.5-4.1 15.6-4.1 24c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24c0-8.4-1.4-16.5-4.1-24zM464 224a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-80-32a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM504 48l88 0 0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-104c0-17.7-14.3-32-32-32L504 0c-13.3 0-24 10.7-24 24s10.7 24 24 24zM48 464l0-88c0-13.3-10.7-24-24-24s-24 10.7-24 24L0 480c0 17.7 14.3 32 32 32l104 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-88 0zm456 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l104 0c17.7 0 32-14.3 32-32l0-104c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 88-88 0z"]
};
const faFileVideo = {
  prefix: 'fas',
  iconName: 'file-video',
  icon: [384, 512, [], "f1c8", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM64 288c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-96zM300.9 397.9L256 368l0-64 44.9-29.9c2-1.3 4.4-2.1 6.8-2.1c6.8 0 12.3 5.5 12.3 12.3l0 103.4c0 6.8-5.5 12.3-12.3 12.3c-2.4 0-4.8-.7-6.8-2.1z"]
};
const faUpRightFromSquare = {
  prefix: 'fas',
  iconName: 'up-right-from-square',
  icon: [512, 512, ["external-link-alt"], "f35d", "M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-128c0-17.7-14.3-32-32-32L352 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]
};
const faExternalLinkAlt = faUpRightFromSquare;
const faTableCells = {
  prefix: 'fas',
  iconName: 'table-cells',
  icon: [512, 512, ["th"], "f00a", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm88 64l0 64-88 0 0-64 88 0zm56 0l88 0 0 64-88 0 0-64zm240 0l0 64-88 0 0-64 88 0zM64 224l88 0 0 64-88 0 0-64zm232 0l0 64-88 0 0-64 88 0zm64 0l88 0 0 64-88 0 0-64zM152 352l0 64-88 0 0-64 88 0zm56 0l88 0 0 64-88 0 0-64zm240 0l0 64-88 0 0-64 88 0z"]
};
const faTh = faTableCells;
const faFilePdf = {
  prefix: 'fas',
  iconName: 'file-pdf',
  icon: [512, 512, [], "f1c1", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 144-208 0c-35.3 0-64 28.7-64 64l0 144-48 0c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM176 352l32 0c30.9 0 56 25.1 56 56s-25.1 56-56 56l-16 0 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-80c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0 48 16 0zm96-80l32 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16l0-128c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-16 0 0 96 16 0zm80-112c0-8.8 7.2-16 16-16l48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64 0-64z"]
};
const faBookBible = {
  prefix: 'fas',
  iconName: 'book-bible',
  icon: [448, 512, ["bible"], "f647", "M96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96l288 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64c17.7 0 32-14.3 32-32l0-320c0-17.7-14.3-32-32-32L384 0 96 0zm0 384l256 0 0 64L96 448c-17.7 0-32-14.3-32-32s14.3-32 32-32zM208 80c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 112c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-112-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faBible = faBookBible;
const faO = {
  prefix: 'fas',
  iconName: 'o',
  icon: [448, 512, [111], "4f", "M224 96a160 160 0 1 0 0 320 160 160 0 1 0 0-320zM448 256A224 224 0 1 1 0 256a224 224 0 1 1 448 0z"]
};
const faSuitcaseMedical = {
  prefix: 'fas',
  iconName: 'suitcase-medical',
  icon: [512, 512, ["medkit"], "f0fa", "M184 48l144 0c4.4 0 8 3.6 8 8l0 40L176 96l0-40c0-4.4 3.6-8 8-8zm-56 8l0 40 0 32 0 352 256 0 0-352 0-32 0-40c0-30.9-25.1-56-56-56L184 0c-30.9 0-56 25.1-56 56zM96 96L64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l32 0L96 96zM416 480l32 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-32 0 0 384zM224 208c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faMedkit = faSuitcaseMedical;
const faUserSecret = {
  prefix: 'fas',
  iconName: 'user-secret',
  icon: [448, 512, [128373], "f21b", "M224 16c-6.7 0-10.8-2.8-15.5-6.1C201.9 5.4 194 0 176 0c-30.5 0-52 43.7-66 89.4C62.7 98.1 32 112.2 32 128c0 14.3 25 27.1 64.6 35.9c-.4 4-.6 8-.6 12.1c0 17 3.3 33.2 9.3 48l-59.9 0C38 224 32 230 32 237.4c0 1.7 .3 3.4 1 5l38.8 96.9C28.2 371.8 0 423.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7c0-58.5-28.2-110.4-71.7-143L415 242.4c.6-1.6 1-3.3 1-5c0-7.4-6-13.4-13.4-13.4l-59.9 0c6-14.8 9.3-31 9.3-48c0-4.1-.2-8.1-.6-12.1C391 155.1 416 142.3 416 128c0-15.8-30.7-29.9-78-38.6C324 43.7 302.5 0 272 0c-18 0-25.9 5.4-32.5 9.9c-4.8 3.3-8.8 6.1-15.5 6.1zm56 208l-12.4 0c-16.5 0-31.1-10.6-36.3-26.2c-2.3-7-12.2-7-14.5 0c-5.2 15.6-19.9 26.2-36.3 26.2L168 224c-22.1 0-40-17.9-40-40l0-14.4c28.2 4.1 61 6.4 96 6.4s67.8-2.3 96-6.4l0 14.4c0 22.1-17.9 40-40 40zm-88 96l16 32L176 480 128 288l64 32zm128-32L272 480 240 352l16-32 64-32z"]
};
const faOtter = {
  prefix: 'fas',
  iconName: 'otter',
  icon: [640, 512, [129446], "f700", "M181.5 197.1l12.9 6.4c5.9 3 12.4 4.5 19.1 4.5c23.5 0 42.6-19.1 42.6-42.6l0-21.4c0-35.3-28.7-64-64-64l-64 0c-35.3 0-64 28.7-64 64l0 21.4c0 23.5 19.1 42.6 42.6 42.6c6.6 0 13.1-1.5 19.1-4.5l12.9-6.4 8.4-4.2L135.1 185c-4.5-3-7.1-8-7.1-13.3l0-3.7c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24l0 3.7c0 5.3-2.7 10.3-7.1 13.3l-11.8 7.9 8.4 4.2zm-8.6 49.4L160 240l-12.9 6.4c-12.6 6.3-26.5 9.6-40.5 9.6c-3.6 0-7.1-.2-10.6-.6l0 .6c0 35.3 28.7 64 64 64l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l160 0 0-48 0-16c0-23.7 12.9-44.4 32-55.4c9.4-5.4 20.3-8.6 32-8.6l0-16c0-26.5 21.5-48 48-48c8.8 0 16 7.2 16 16l0 32 0 16 0 48c0 8.8 7.2 16 16 16s16-7.2 16-16l0-99.7c0-48.2-30.8-91-76.6-106.3l-8.5-2.8c-8-2.7-12.6-11.1-10.4-19.3s10.3-13.2 18.6-11.6l19.9 4C576 86.1 640 164.2 640 254.9l0 1.1s0 0 0 0c0 123.7-100.3 224-224 224l-1.1 0L256 480l-.6 0C132 480 32 380 32 256.6l0-.6 0-39.2c-10.1-14.6-16-32.3-16-51.4L16 144l0-1.4C6.7 139.3 0 130.5 0 120c0-13.3 10.7-24 24-24l2.8 0C44.8 58.2 83.3 32 128 32l64 0c44.7 0 83.2 26.2 101.2 64l2.8 0c13.3 0 24 10.7 24 24c0 10.5-6.7 19.3-16 22.6l0 1.4 0 21.4c0 1.4 0 2.8-.1 4.3c12-6.2 25.7-9.6 40.1-9.6l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-13.3 0-24 10.7-24 24l0 8 56.4 0c-15.2 17-24.4 39.4-24.4 64l-32 0c-42.3 0-78.2-27.4-91-65.3c-5.1 .9-10.3 1.3-15.6 1.3c-14.1 0-27.9-3.3-40.5-9.6zM96 128a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm112 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"]
};
const faPersonDress = {
  prefix: 'fas',
  iconName: 'person-dress',
  icon: [320, 512, ["female"], "f182", "M160 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM88 384l-17.8 0c-10.9 0-18.6-10.7-15.2-21.1L93.3 248.1 59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l53.6-89.2c20.3-33.7 56.7-54.3 96-54.3l11.6 0c39.3 0 75.7 20.6 96 54.3l53.6 89.2c9.1 15.1 4.2 34.8-10.9 43.9s-34.8 4.2-43.9-10.9l-33.9-56.3L265 362.9c3.5 10.4-4.3 21.1-15.2 21.1L232 384l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-16 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96z"]
};
const faFemale = faPersonDress;
const faCommentDollar = {
  prefix: 'fas',
  iconName: 'comment-dollar',
  icon: [512, 512, [], "f651", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zm20-312l0 13.9c7.5 1.2 14.6 2.9 21.1 4.7c10.7 2.8 17 13.8 14.2 24.5s-13.8 17-24.5 14.2c-11-2.9-21.6-5-31.2-5.2c-7.9-.1-16 1.8-21.5 5c-4.8 2.8-6.2 5.6-6.2 9.3c0 1.8 .1 3.5 5.3 6.7c6.3 3.8 15.5 6.7 28.3 10.5l.7 .2c11.2 3.4 25.6 7.7 37.1 15c12.9 8.1 24.3 21.3 24.6 41.6c.3 20.9-10.5 36.1-24.8 45c-7.2 4.5-15.2 7.3-23.2 9l0 13.8c0 11-9 20-20 20s-20-9-20-20l0-14.6c-10.3-2.2-20-5.5-28.2-8.4c0 0 0 0 0 0s0 0 0 0c-2.1-.7-4.1-1.4-6.1-2.1c-10.5-3.5-16.1-14.8-12.6-25.3s14.8-16.1 25.3-12.6c2.5 .8 4.9 1.7 7.2 2.4c0 0 0 0 0 0c13.6 4.6 24 8.1 35.1 8.5c8.6 .3 16.5-1.6 21.4-4.7c4.1-2.5 6-5.5 5.9-10.5c0-2.9-.8-5-5.9-8.2c-6.3-4-15.4-6.9-28-10.7l-1.7-.5c-10.9-3.3-24.6-7.4-35.6-14c-12.7-7.7-24.6-20.5-24.7-40.7c-.1-21.1 11.8-35.7 25.8-43.9c6.9-4.1 14.5-6.8 22.2-8.5l0-14c0-11 9-20 20-20s20 9 20 20z"]
};
const faBusinessTime = {
  prefix: 'fas',
  iconName: 'business-time',
  icon: [640, 512, ["briefcase-clock"], "f64a", "M184 48l144 0c4.4 0 8 3.6 8 8l0 40L176 96l0-40c0-4.4 3.6-8 8-8zm-56 8l0 40L64 96C28.7 96 0 124.7 0 160l0 96 192 0 160 0 8.2 0c32.3-39.1 81.1-64 135.8-64c5.4 0 10.7 .2 16 .7l0-32.7c0-35.3-28.7-64-64-64l-64 0 0-40c0-30.9-25.1-56-56-56L184 0c-30.9 0-56 25.1-56 56zM320 352l-96 0c-17.7 0-32-14.3-32-32l0-32L0 288 0 416c0 35.3 28.7 64 64 64l296.2 0C335.1 449.6 320 410.5 320 368c0-5.4 .2-10.7 .7-16l-.7 0zm320 16a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 288c8.8 0 16 7.2 16 16l0 48 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16z"]
};
const faBriefcaseClock = faBusinessTime;
const faTableCellsLarge = {
  prefix: 'fas',
  iconName: 'table-cells-large',
  icon: [512, 512, ["th-large"], "f009", "M448 96l0 128-160 0 0-128 160 0zm0 192l0 128-160 0 0-128 160 0zM224 224L64 224 64 96l160 0 0 128zM64 288l160 0 0 128L64 416l0-128zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"]
};
const faThLarge = faTableCellsLarge;
const faBookTanakh = {
  prefix: 'fas',
  iconName: 'book-tanakh',
  icon: [448, 512, ["tanakh"], "f827", "M352 0c53 0 96 43 96 96l0 320c0 53-43 96-96 96L64 512l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0L64 0 352 0zm0 384L96 384l0 64 256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32zM138.7 208l13.9 24-27.7 0 13.9-24zm-13.9-24L97.1 232c-6.2 10.7 1.5 24 13.9 24l55.4 0 27.7 48c6.2 10.7 21.6 10.7 27.7 0l27.7-48 55.4 0c12.3 0 20-13.3 13.9-24l-27.7-48 27.7-48c6.2-10.7-1.5-24-13.9-24l-55.4 0L221.9 64c-6.2-10.7-21.6-10.7-27.7 0l-27.7 48L111 112c-12.3 0-20 13.3-13.9 24l27.7 48zm27.7 0l27.7-48 55.4 0 27.7 48-27.7 48-55.4 0-27.7-48zm0-48l-13.9 24-13.9-24 27.7 0zm41.6-24L208 88l13.9 24-27.7 0zm69.3 24l27.7 0-13.9 24-13.9-24zm13.9 72l13.9 24-27.7 0 13.9-24zm-55.4 48L208 280l-13.9-24 27.7 0z"]
};
const faTanakh = faBookTanakh;
const faPhoneVolume = {
  prefix: 'fas',
  iconName: 'phone-volume',
  icon: [512, 512, ["volume-control-phone"], "f2a0", "M280 0C408.1 0 512 103.9 512 232c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-101.6-82.4-184-184-184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm-32-72c0-13.3 10.7-24 24-24c75.1 0 136 60.9 136 136c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-48.6-39.4-88-88-88c-13.3 0-24-10.7-24-24zM117.5 1.4c19.4-5.3 39.7 4.6 47.4 23.2l40 96c6.8 16.3 2.1 35.2-11.6 46.3L144 207.3c33.3 70.4 90.3 127.4 160.7 160.7L345 318.7c11.2-13.7 30-18.4 46.3-11.6l96 40c18.6 7.7 28.5 28 23.2 47.4l-24 88C481.8 499.9 466 512 448 512C200.6 512 0 311.4 0 64C0 46 12.1 30.2 29.5 25.4l88-24z"]
};
const faVolumeControlPhone = faPhoneVolume;
const faHatCowboySide = {
  prefix: 'fas',
  iconName: 'hat-cowboy-side',
  icon: [640, 512, [], "f8c1", "M152.7 135.9l-10.4 57.2c6.8-.7 13.6-1.1 20.5-1.1l10.7 0c39.4 0 77.8 12.1 110.1 34.7L562.4 421.8l35.1 24.6c24.4-6 42.5-28.1 42.5-54.4c0-75.8-94.7-126.6-134.6-144.7L474 83.9C468.2 53.8 441.8 32 411.1 32l-2.7 0c-5.6 0-11.1 .7-16.5 2.2L199.2 85.5c-23.9 6.4-42 26-46.5 50.4zM0 384c0 35.3 28.7 64 64 64l480 0L265.3 252.9c-26.9-18.8-58.9-28.9-91.8-28.9l-10.7 0c-60.6 0-116 34.2-143.1 88.4L13.5 325C4.6 342.7 0 362.3 0 382.2L0 384z"]
};
const faClipboardUser = {
  prefix: 'fas',
  iconName: 'clipboard-user',
  icon: [384, 512, [], "f7f3", "M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM128 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM80 432c0-44.2 35.8-80 80-80l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L96 448c-8.8 0-16-7.2-16-16z"]
};
const faChild = {
  prefix: 'fas',
  iconName: 'child',
  icon: [320, 512, [], "f1ae", "M96 64a64 64 0 1 1 128 0A64 64 0 1 1 96 64zm48 320l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-192.2L59.1 321c-9.4 15-29.2 19.4-44.1 10S-4.5 301.9 4.9 287l39.9-63.3C69.7 184 113.2 160 160 160s90.3 24 115.2 63.6L315.1 287c9.4 15 4.9 34.7-10 44.1s-34.7 4.9-44.1-10L240 287.8 240 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-32 0z"]
};
const faLiraSign = {
  prefix: 'fas',
  iconName: 'lira-sign',
  icon: [320, 512, [8356], "f195", "M112 160.4c0-35.5 28.8-64.4 64.4-64.4c6.9 0 13.8 1.1 20.4 3.3l81.2 27.1c16.8 5.6 34.9-3.5 40.5-20.2s-3.5-34.9-20.2-40.5L217 38.6c-13.1-4.4-26.8-6.6-40.6-6.6C105.5 32 48 89.5 48 160.4L48 192l-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 32-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l14 0c-2.2 10.5-6.1 20.6-11.7 29.9L4.6 431.5c-5.9 9.9-6.1 22.2-.4 32.2S20.5 480 32 480l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L88.5 416l.7-1.1c11.6-19.3 18.9-40.7 21.6-62.9L224 352c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0 0-32 112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0 0-31.6z"]
};
const faSatellite = {
  prefix: 'fas',
  iconName: 'satellite',
  icon: [512, 512, [128752], "f7bf", "M233 7c-9.4-9.4-24.6-9.4-33.9 0l-96 96c-9.4 9.4-9.4 24.6 0 33.9l89.4 89.4-15.5 15.5C152.3 230.4 124.9 224 96 224c-31.7 0-61.5 7.7-87.8 21.2c-9 4.7-10.3 16.7-3.1 23.8L112.7 376.7 96.3 393.1c-2.6-.7-5.4-1.1-8.3-1.1c-17.7 0-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32c0-2.9-.4-5.6-1.1-8.3l16.4-16.4L242.9 506.9c7.2 7.2 19.2 5.9 23.8-3.1C280.3 477.5 288 447.7 288 416c0-28.9-6.4-56.3-17.8-80.9l15.5-15.5L375 409c9.4 9.4 24.6 9.4 33.9 0l96-96c9.4-9.4 9.4-24.6 0-33.9l-89.4-89.4 55-55c12.5-12.5 12.5-32.8 0-45.3l-48-48c-12.5-12.5-32.8-12.5-45.3 0l-55 55L233 7zm159 351l-72.4-72.4 62.1-62.1L454.1 296 392 358.1zM226.3 192.4L153.9 120 216 57.9l72.4 72.4-62.1 62.1z"]
};
const faPlaneLock = {
  prefix: 'fas',
  iconName: 'plane-lock',
  icon: [640, 512, [], "e558", "M192 93.7C192 59.5 221 0 256 0c36 0 64 59.5 64 93.7l0 84.6 101.8 58.2C418 247.6 416 259.6 416 272l0 24.6c-17.9 10.4-30.3 29.1-31.8 50.9L320 329.1l0 70.9 57.6 43.2c4 3 6.4 7.8 6.4 12.8l0 24 0 18c0 7.8-6.3 14-14 14c-1.3 0-2.6-.2-3.9-.5L256 480 145.9 511.5c-1.3 .4-2.6 .5-3.9 .5c-7.8 0-14-6.3-14-14l0-42c0-5 2.4-9.8 6.4-12.8L192 400l0-70.9-171.6 49C10.2 381.1 0 373.4 0 362.8l0-65.5c0-5.7 3.1-11 8.1-13.9L192 178.3l0-84.6zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faTag = {
  prefix: 'fas',
  iconName: 'tag',
  icon: [448, 512, [127991], "f02b", "M0 80L0 229.5c0 17 6.7 33.3 18.7 45.3l176 176c25 25 65.5 25 90.5 0L418.7 317.3c25-25 25-65.5 0-90.5l-176-176c-12-12-28.3-18.7-45.3-18.7L48 32C21.5 32 0 53.5 0 80zm112 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faComment = {
  prefix: 'fas',
  iconName: 'comment',
  icon: [512, 512, [128489, 61669], "f075", "M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"]
};
const faCakeCandles = {
  prefix: 'fas',
  iconName: 'cake-candles',
  icon: [448, 512, [127874, "birthday-cake", "cake"], "f1fd", "M86.4 5.5L61.8 47.6C58 54.1 56 61.6 56 69.2L56 72c0 22.1 17.9 40 40 40s40-17.9 40-40l0-2.8c0-7.6-2-15-5.8-21.6L105.6 5.5C103.6 2.1 100 0 96 0s-7.6 2.1-9.6 5.5zm128 0L189.8 47.6c-3.8 6.5-5.8 14-5.8 21.6l0 2.8c0 22.1 17.9 40 40 40s40-17.9 40-40l0-2.8c0-7.6-2-15-5.8-21.6L233.6 5.5C231.6 2.1 228 0 224 0s-7.6 2.1-9.6 5.5zM317.8 47.6c-3.8 6.5-5.8 14-5.8 21.6l0 2.8c0 22.1 17.9 40 40 40s40-17.9 40-40l0-2.8c0-7.6-2-15-5.8-21.6L361.6 5.5C359.6 2.1 356 0 352 0s-7.6 2.1-9.6 5.5L317.8 47.6zM128 176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c-35.3 0-64 28.7-64 64l0 71c8.3 5.2 18.1 9 28.8 9c13.5 0 27.2-6.1 38.4-13.4c5.4-3.5 9.9-7.1 13-9.7c1.5-1.3 2.7-2.4 3.5-3.1c.4-.4 .7-.6 .8-.8l.1-.1s0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0c3.1-3.2 7.4-4.9 11.9-4.8s8.6 2.1 11.6 5.4c0 0 0 0 0 0s0 0 0 0l.1 .1c.1 .1 .4 .4 .7 .7c.7 .7 1.7 1.7 3.1 3c2.8 2.6 6.8 6.1 11.8 9.5c10.2 7.1 23 13.1 36.3 13.1s26.1-6 36.3-13.1c5-3.5 9-6.9 11.8-9.5c1.4-1.3 2.4-2.3 3.1-3c.3-.3 .6-.6 .7-.7l.1-.1c3-3.5 7.4-5.4 12-5.4s9 2 12 5.4l.1 .1c.1 .1 .4 .4 .7 .7c.7 .7 1.7 1.7 3.1 3c2.8 2.6 6.8 6.1 11.8 9.5c10.2 7.1 23 13.1 36.3 13.1s26.1-6 36.3-13.1c5-3.5 9-6.9 11.8-9.5c1.4-1.3 2.4-2.3 3.1-3c.3-.3 .6-.6 .7-.7l.1-.1c2.9-3.4 7.1-5.3 11.6-5.4s8.7 1.6 11.9 4.8c0 0 0 0 0 0s0 0 0 0s0 0 0 0l.1 .1c.2 .2 .4 .4 .8 .8c.8 .7 1.9 1.8 3.5 3.1c3.1 2.6 7.5 6.2 13 9.7c11.2 7.3 24.9 13.4 38.4 13.4c10.7 0 20.5-3.9 28.8-9l0-71c0-35.3-28.7-64-64-64l0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48-64 0 0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48-64 0 0-48zM448 394.6c-8.5 3.3-18.2 5.4-28.8 5.4c-22.5 0-42.4-9.9-55.8-18.6c-4.1-2.7-7.8-5.4-10.9-7.8c-2.8 2.4-6.1 5-9.8 7.5C329.8 390 310.6 400 288 400s-41.8-10-54.6-18.9c-3.5-2.4-6.7-4.9-9.4-7.2c-2.7 2.3-5.9 4.7-9.4 7.2C201.8 390 182.6 400 160 400s-41.8-10-54.6-18.9c-3.7-2.6-7-5.2-9.8-7.5c-3.1 2.4-6.8 5.1-10.9 7.8C71.2 390.1 51.3 400 28.8 400c-10.6 0-20.3-2.2-28.8-5.4L0 480c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32l0-85.4z"]
};
const faBirthdayCake = faCakeCandles;
const faCake = faCakeCandles;
const faEnvelope = {
  prefix: 'fas',
  iconName: 'envelope',
  icon: [512, 512, [128386, 9993, 61443], "f0e0", "M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"]
};
const faAnglesUp = {
  prefix: 'fas',
  iconName: 'angles-up',
  icon: [448, 512, ["angle-double-up"], "f102", "M246.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 109.3 361.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160zm160 352l-160-160c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L224 301.3 361.4 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z"]
};
const faAngleDoubleUp = faAnglesUp;
const faPaperclip = {
  prefix: 'fas',
  iconName: 'paperclip',
  icon: [448, 512, [128206], "f0c6", "M364.2 83.8c-24.4-24.4-64-24.4-88.4 0l-184 184c-42.1 42.1-42.1 110.3 0 152.4s110.3 42.1 152.4 0l152-152c10.9-10.9 28.7-10.9 39.6 0s10.9 28.7 0 39.6l-152 152c-64 64-167.6 64-231.6 0s-64-167.6 0-231.6l184-184c46.3-46.3 121.3-46.3 167.6 0s46.3 121.3 0 167.6l-176 176c-28.6 28.6-75 28.6-103.6 0s-28.6-75 0-103.6l144-144c10.9-10.9 28.7-10.9 39.6 0s10.9 28.7 0 39.6l-144 144c-6.7 6.7-6.7 17.7 0 24.4s17.7 6.7 24.4 0l176-176c24.4-24.4 24.4-64 0-88.4z"]
};
const faArrowRightToCity = {
  prefix: 'fas',
  iconName: 'arrow-right-to-city',
  icon: [640, 512, [], "e4b3", "M288 48c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 144 40 0 0-72c0-13.3 10.7-24 24-24s24 10.7 24 24l0 72 24 0c26.5 0 48 21.5 48 48l0 224c0 26.5-21.5 48-48 48l-160 0-96 0c-26.5 0-48-21.5-48-48l0-416zm64 32l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM352 272l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm176-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM512 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM166.6 153.4l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L146.7 288 32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l114.7 0-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0z"]
};
const faRibbon = {
  prefix: 'fas',
  iconName: 'ribbon',
  icon: [448, 512, [127895], "f4d6", "M333.2 322.8s0 0 0 0l-133.9-146s0 0 0 0L146 118.6c7.8-5.1 37-22.6 78-22.6s70.2 17.4 78 22.6L245.7 180l85.6 93.4 27.4-29.8c16.3-17.7 25.3-40.9 25.3-65l0-29.5c0-19-5.6-37.5-16.1-53.3L327.8 35.6C312.9 13.4 287.9 0 261.2 0l-76 0c-25.8 0-50.1 12.5-65.1 33.5L81.9 87C70.3 103.2 64 122.8 64 142.8L64 164c0 23.2 8.4 45.6 23.6 63.1l56 64.2s0 0 0 0l83.3 95.6s0 0 0 0l91.8 105.3c10 11.5 26.8 14.3 40 6.8l54.5-31.1c17.8-10.2 21.6-34.3 7.7-49.4l-87.7-95.7zM205.2 410.6l-83.3-95.6L27.1 418.5c-13.9 15.1-10.1 39.2 7.7 49.4l55.1 31.5c13 7.4 29.3 4.9 39.4-6.1l75.9-82.6z"]
};
const faLungs = {
  prefix: 'fas',
  iconName: 'lungs',
  icon: [640, 512, [129729], "f604", "M320 0c17.7 0 32 14.3 32 32l0 132.1c0 16.4 8.4 31.7 22.2 40.5l9.8 6.2 0-45.5C384 127 415 96 453.3 96c21.7 0 42.8 10.2 55.8 28.8c15.4 22.1 44.3 65.4 71 116.9c26.5 50.9 52.4 112.5 59.6 170.3c.2 1.3 .2 2.6 .2 4l0 7c0 49.1-39.8 89-89 89c-7.3 0-14.5-.9-21.6-2.7l-72.7-18.2C414 480.5 384 442.1 384 398l0-73 90.5 57.6c7.5 4.7 17.3 2.5 22.1-4.9s2.5-17.3-4.9-22.1L384 287.1l0-.4-44.1-28.1c-7.3-4.6-13.9-10.1-19.9-16.1c-5.9 6-12.6 11.5-19.9 16.1L256 286.7 161.2 347l-13.5 8.6c0 0 0 0-.1 0c-7.4 4.8-9.6 14.6-4.8 22.1c4.7 7.5 14.6 9.7 22.1 4.9l91.1-58 0 73.4c0 44.1-30 82.5-72.7 93.1l-72.7 18.2c-7.1 1.8-14.3 2.7-21.6 2.7c-49.1 0-89-39.8-89-89l0-7c0-1.3 .1-2.7 .2-4c7.2-57.9 33.1-119.4 59.6-170.3c26.8-51.5 55.6-94.8 71-116.9c13-18.6 34-28.8 55.8-28.8C225 96 256 127 256 165.3l0 45.5 9.8-6.2c13.8-8.8 22.2-24.1 22.2-40.5L288 32c0-17.7 14.3-32 32-32z"]
};
const faArrowUp91 = {
  prefix: 'fas',
  iconName: 'arrow-up-9-1',
  icon: [576, 512, ["sort-numeric-up-alt"], "f887", "M160 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L192 146.3 192 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-301.7L95.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C142.5 35.8 151 32 160 32zM450.7 294c8.3 6 13.3 15.7 13.3 26l0 96 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-51.6-5.9 2c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5l48-16c9.8-3.3 20.5-1.6 28.8 4.4zm-5-145.1A32 32 0 1 0 418.3 91a32 32 0 1 0 27.4 57.9zm-40.7 54.9C369.6 192.4 344 159.2 344 120c0-48.6 39.4-88 88-88s88 39.4 88 88c0 23.5-7.5 46.3-21.5 65.2L449.7 251c-10.5 14.2-30.6 17.2-44.8 6.7s-17.2-30.6-6.7-44.8l6.8-9.2z"]
};
const faSortNumericUpAlt = faArrowUp91;
const faLitecoinSign = {
  prefix: 'fas',
  iconName: 'litecoin-sign',
  icon: [384, 512, [], "e1d3", "M128 64c0-17.7-14.3-32-32-32S64 46.3 64 64l0 149.6L23.2 225.2c-17 4.9-26.8 22.6-22 39.6s22.6 26.8 39.6 22L64 280.1 64 448c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0 0-154.1 136.8-39.1c17-4.9 26.8-22.6 22-39.6s-22.6-26.8-39.6-22L128 195.3 128 64z"]
};
const faBorderNone = {
  prefix: 'fas',
  iconName: 'border-none',
  icon: [448, 512, [], "f850", "M32 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm96-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM320 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-320a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM224 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0-448a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 96a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 288a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm192 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 320a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM416 192a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"]
};
const faCircleNodes = {
  prefix: 'fas',
  iconName: 'circle-nodes',
  icon: [512, 512, [], "e4e2", "M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"]
};
const faParachuteBox = {
  prefix: 'fas',
  iconName: 'parachute-box',
  icon: [512, 512, [], "f4cd", "M383.5 192c.3-5.3 .5-10.6 .5-16c0-51-15.9-96-40.2-127.6C319.5 16.9 288.2 0 256 0s-63.5 16.9-87.8 48.4C143.9 80 128 125 128 176c0 5.4 .2 10.7 .5 16L240 192l0 128-32 0c-7 0-13.7 1.5-19.7 4.2L68.2 192l28.3 0c-.3-5.3-.5-10.6-.5-16c0-64 22.2-121.2 57.1-159.3C62 49.3 18.6 122.6 4.2 173.6C1.5 183.1 9 192 18.9 192l6 0L165.2 346.3c-3.3 6.5-5.2 13.9-5.2 21.7l0 96c0 26.5 21.5 48 48 48l96 0c26.5 0 48-21.5 48-48l0-96c0-7.8-1.9-15.2-5.2-21.7L487.1 192l6 0c9.9 0 17.4-8.9 14.7-18.4C493.4 122.6 450 49.3 358.9 16.7C393.8 54.8 416 112.1 416 176c0 5.4-.2 10.7-.5 16l28.3 0L323.7 324.2c-6-2.7-12.7-4.2-19.7-4.2l-32 0 0-128 111.5 0z"]
};
const faIndent = {
  prefix: 'fas',
  iconName: 'indent',
  icon: [448, 512, [], "f03c", "M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3L0 176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"]
};
const faTruckFieldUn = {
  prefix: 'fas',
  iconName: 'truck-field-un',
  icon: [640, 512, [], "e58e", "M96 32C60.7 32 32 60.7 32 96l0 32c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l0 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c0 53 43 96 96 96s96-43 96-96l128 0c0 53 43 96 96 96s96-43 96-96l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-32c0-35.3-28.7-64-64-64l-4.2 0c-.4-1.1-.9-2.1-1.3-3.2L485.7 102c-10.3-23.1-33.2-38-58.5-38l-51.8 0C364.4 44.9 343.7 32 320 32L96 32zm288 96l43.2 0 42.7 96L384 224l0-96zM112 384a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm368-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM253.3 135.1l34.7 52 0-43.2c0-8.8 7.2-16 16-16s16 7.2 16 16l0 96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52 0 43.2c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM128 144l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faHourglass = {
  prefix: 'fas',
  iconName: 'hourglass',
  icon: [384, 512, [9203, 62032, "hourglass-empty"], "f254", "M0 32C0 14.3 14.3 0 32 0L64 0 320 0l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 11c0 42.4-16.9 83.1-46.9 113.1L237.3 256l67.9 67.9c30 30 46.9 70.7 46.9 113.1l0 11c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L64 512l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-11c0-42.4 16.9-83.1 46.9-113.1L146.7 256 78.9 188.1C48.9 158.1 32 117.4 32 75l0-11C14.3 64 0 49.7 0 32zM96 64l0 11c0 25.5 10.1 49.9 28.1 67.9L192 210.7l67.9-67.9c18-18 28.1-42.4 28.1-67.9l0-11L96 64zm0 384l192 0 0-11c0-25.5-10.1-49.9-28.1-67.9L192 301.3l-67.9 67.9c-18 18-28.1 42.4-28.1 67.9l0 11z"]
};
const faHourglassEmpty = faHourglass;
const faMountain = {
  prefix: 'fas',
  iconName: 'mountain',
  icon: [512, 512, [127956], "f6fc", "M256 32c12.5 0 24.1 6.4 30.8 17L503.4 394.4c5.6 8.9 8.6 19.2 8.6 29.7c0 30.9-25 55.9-55.9 55.9L55.9 480C25 480 0 455 0 424.1c0-10.5 3-20.8 8.6-29.7L225.2 49c6.6-10.6 18.3-17 30.8-17zm65 192L256 120.4 176.9 246.5l18.3 24.4c6.4 8.5 19.2 8.5 25.6 0l25.6-34.1c6-8.1 15.5-12.8 25.6-12.8l49 0z"]
};
const faUserDoctor = {
  prefix: 'fas',
  iconName: 'user-doctor',
  icon: [448, 512, ["user-md"], "f0f0", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-96 55.2C54 332.9 0 401.3 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7c0-81-54-149.4-128-171.1l0 50.8c27.6 7.1 48 32.2 48 62l0 40c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l0-24c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 24c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-40c0-29.8 20.4-54.9 48-62l0-57.1c-6-.6-12.1-.9-18.3-.9l-91.4 0c-6.2 0-12.3 .3-18.3 .9l0 65.4c23.1 6.9 40 28.3 40 53.7c0 30.9-25.1 56-56 56s-56-25.1-56-56c0-25.4 16.9-46.8 40-53.7l0-59.1zM144 448a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faUserMd = faUserDoctor;
const faCircleInfo = {
  prefix: 'fas',
  iconName: 'circle-info',
  icon: [512, 512, ["info-circle"], "f05a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faInfoCircle = faCircleInfo;
const faCloudMeatball = {
  prefix: 'fas',
  iconName: 'cloud-meatball',
  icon: [512, 512, [], "f73b", "M0 224c0 53 43 96 96 96l44.7 0c9.5-23.5 32.5-40 59.3-40c2 0 3.9 .1 5.8 .3C217.6 265.5 235.7 256 256 256s38.4 9.5 50.2 24.3c1.9-.2 3.9-.3 5.8-.3c26.9 0 49.9 16.5 59.3 40l44.7 0c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0c1.1-5.2 1.6-10.5 1.6-16c0-44.2-35.8-80-80-80c-24.3 0-46.1 10.9-60.8 28C256.5 24.3 219.1 0 176 0C114.1 0 64 50.1 64 112c0 7.1 .7 14.1 1.9 20.8C27.6 145.4 0 181.5 0 224zm288 96c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 1 .1 2.1 .1 3.1c-.7-.8-1.4-1.6-2.1-2.3c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3c.7 .7 1.5 1.4 2.3 2.1c-1-.1-2.1-.1-3.1-.1c-17.7 0-32 14.3-32 32s14.3 32 32 32c1 0 2.1-.1 3.1-.1c-.8 .7-1.6 1.3-2.3 2.1c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0c.7-.7 1.4-1.5 2.1-2.3c-.1 1-.1 2.1-.1 3.1c0 17.7 14.3 32 32 32s32-14.3 32-32c0-1-.1-2.1-.1-3.1c.7 .8 1.3 1.6 2.1 2.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3c-.7-.7-1.5-1.4-2.3-2.1c1 .1 2.1 .1 3.1 .1c17.7 0 32-14.3 32-32s-14.3-32-32-32c-1 0-2.1 .1-3.1 .1c.8-.7 1.6-1.3 2.3-2.1c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-.7 .7-1.4 1.5-2.1 2.3c.1-1 .1-2.1 .1-3.1zM48 448a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm416 0a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faCamera = {
  prefix: 'fas',
  iconName: 'camera',
  icon: [512, 512, [62258, "camera-alt"], "f030", "M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L362.9 64.8C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faCameraAlt = faCamera;
const faSquareVirus = {
  prefix: 'fas',
  iconName: 'square-virus',
  icon: [448, 512, [], "e578", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM223.8 93.7c13.3 0 24 10.7 24 24c0 29.3 35.4 43.9 56.1 23.2c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-20.7 20.7-6 56.1 23.2 56.1c13.3 0 24 10.7 24 24s-10.7 24-24 24c-29.3 0-43.9 35.4-23.2 56.1c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-20.7-20.7-56.1-6-56.1 23.2c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-29.3-35.4-43.9-56.1-23.2c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9c20.7-20.7 6-56.1-23.2-56.1c-13.3 0-24-10.7-24-24s10.7-24 24-24c29.3 0 43.9-35.4 23.2-56.1c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0c20.7 20.7 56.1 6 56.1-23.2c0-13.3 10.7-24 24-24zM192 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm88 32a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faMeteor = {
  prefix: 'fas',
  iconName: 'meteor',
  icon: [512, 512, [9732], "f753", "M493.7 .9L299.4 75.6l2.3-29.3c1-12.8-12.8-21.5-24-15.1L101.3 133.4C38.6 169.7 0 236.6 0 309C0 421.1 90.9 512 203 512c72.4 0 139.4-38.6 175.7-101.3L480.8 234.3c6.5-11.1-2.2-25-15.1-24l-29.3 2.3L511.1 18.3c.6-1.5 .9-3.2 .9-4.8C512 6 506 0 498.5 0c-1.7 0-3.3 .3-4.8 .9zM192 192a128 128 0 1 1 0 256 128 128 0 1 1 0-256zm0 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm16 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faCarOn = {
  prefix: 'fas',
  iconName: 'car-on',
  icon: [512, 512, [], "e4dd", "M280 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-80zM185.8 224l140.3 0c6.8 0 12.8 4.3 15.1 10.6L360.3 288l-208.6 0 19.1-53.4c2.3-6.4 8.3-10.6 15.1-10.6zm-75.3-10.9L82.2 292.4C62.1 300.9 48 320.8 48 344l0 40 0 64 0 32c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-32 256 0 0 32c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-32 0-64 0-40c0-23.2-14.1-43.1-34.2-51.6l-28.3-79.3C390.1 181.3 360 160 326.2 160l-140.3 0c-33.8 0-64 21.3-75.3 53.1zM128 344a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm232 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM39 39c-9.4 9.4-9.4 24.6 0 33.9l48 48c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L73 39c-9.4-9.4-24.6-9.4-33.9 0zm400 0L391 87c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0z"]
};
const faSleigh = {
  prefix: 'fas',
  iconName: 'sleigh',
  icon: [640, 512, [], "f7cc", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l0 160c0 53 43 96 96 96l0 32 64 0 0-32 192 0 0 32 64 0 0-32c53 0 96-43 96-96l0-96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0-32 0c-17.7 0-32 14.3-32 32l0 41.3c0 30.2-24.5 54.7-54.7 54.7c-75.5 0-145.6-38.9-185.6-102.9l-4.3-6.9C174.2 67.6 125 37.6 70.7 32.7c-2.2-.5-4.4-.7-6.7-.7l-9 0L32 32zM640 384c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 8c0 13.3-10.7 24-24 24L64 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l488 0c48.6 0 88-39.4 88-88l0-8z"]
};
const faArrowDown19 = {
  prefix: 'fas',
  iconName: 'arrow-down-1-9',
  icon: [576, 512, ["sort-numeric-asc", "sort-numeric-down"], "f162", "M450.7 38c-8.3-6-19.1-7.7-28.8-4.4l-48 16c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l5.9-2 0 51.6-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l48 0 48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-96c0-10.3-4.9-19.9-13.3-26zM160 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L192 365.7 192 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 301.7L95.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C142.5 476.2 151 480 160 480zM418.3 307a32 32 0 1 1 27.4 57.9A32 32 0 1 1 418.3 307zM405.1 419.8l-6.8 9.2c-10.5 14.2-7.5 34.2 6.7 44.8s34.2 7.5 44.8-6.7l48.8-65.8c14-18.9 21.5-41.7 21.5-65.2c0-48.6-39.4-88-88-88s-88 39.4-88 88c0 39.2 25.6 72.4 61.1 83.8z"]
};
const faSortNumericAsc = faArrowDown19;
const faSortNumericDown = faArrowDown19;
const faHandHoldingDroplet = {
  prefix: 'fas',
  iconName: 'hand-holding-droplet',
  icon: [576, 512, ["hand-holding-water"], "f4c1", "M275.5 6.6C278.3 2.5 283 0 288 0s9.7 2.5 12.5 6.6L366.8 103C378 119.3 384 138.6 384 158.3l0 1.7c0 53-43 96-96 96s-96-43-96-96l0-1.7c0-19.8 6-39 17.2-55.3L275.5 6.6zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5L192 512 32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l36.8 0 44.9-36c22.7-18.2 50.9-28 80-28l78.3 0 16 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l120.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384c0 0 0 0 0 0l-.9 0c.3 0 .6 0 .9 0z"]
};
const faHandHoldingWater = faHandHoldingDroplet;
const faWater = {
  prefix: 'fas',
  iconName: 'water',
  icon: [576, 512, [], "f773", "M269.5 69.9c11.1-7.9 25.9-7.9 37 0C329 85.4 356.5 96 384 96c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 149.7 417 160 384 160c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4C42.8 92.6 61 83.5 75.3 71.6c11.1-9.5 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 85.2 165.1 96 192 96c27.5 0 55-10.6 77.5-26.1zm37 288C329 373.4 356.5 384 384 384c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 437.7 417 448 384 448c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 373.2 165.1 384 192 384c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0zm0-144C329 229.4 356.5 240 384 240c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 293.7 417 304 384 304c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.5 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 229.2 165.1 240 192 240c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faCalendarCheck = {
  prefix: 'fas',
  iconName: 'calendar-check',
  icon: [448, 512, [], "f274", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM329 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-95 95-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L329 305z"]
};
const faBraille = {
  prefix: 'fas',
  iconName: 'braille',
  icon: [640, 512, [], "f2a1", "M0 96a64 64 0 1 1 128 0A64 64 0 1 1 0 96zM224 272a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm0-80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM80 416a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zM0 416a64 64 0 1 1 128 0A64 64 0 1 1 0 416zm240 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM64 192a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM224 32a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM352 96a64 64 0 1 1 128 0A64 64 0 1 1 352 96zm240 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0A64 64 0 1 1 512 96zm64 176a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm0-80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm16 224a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM416 272a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm0-80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm16 224a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm-80 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"]
};
const faPrescriptionBottleMedical = {
  prefix: 'fas',
  iconName: 'prescription-bottle-medical',
  icon: [384, 512, ["prescription-bottle-alt"], "f486", "M0 32C0 14.3 14.3 0 32 0L352 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64L0 32zm32 96l320 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-320zM160 240l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]
};
const faPrescriptionBottleAlt = faPrescriptionBottleMedical;
const faLandmark = {
  prefix: 'fas',
  iconName: 'landmark',
  icon: [512, 512, [127963], "f66f", "M240.1 4.2c9.8-5.6 21.9-5.6 31.8 0l171.8 98.1L448 104l0 .9 47.9 27.4c12.6 7.2 18.8 22 15.1 36s-16.4 23.8-30.9 23.8L32 192c-14.5 0-27.2-9.8-30.9-23.8s2.5-28.8 15.1-36L64 104.9l0-.9 4.4-1.6L240.1 4.2zM64 224l64 0 0 192 40 0 0-192 64 0 0 192 48 0 0-192 64 0 0 192 40 0 0-192 64 0 0 196.3c.6 .3 1.2 .7 1.8 1.1l48 32c11.7 7.8 17 22.4 12.9 35.9S494.1 512 480 512L32 512c-14.1 0-26.5-9.2-30.6-22.7s1.1-28.1 12.9-35.9l48-32c.6-.4 1.2-.7 1.8-1.1L64 224z"]
};
const faTruck = {
  prefix: 'fas',
  iconName: 'truck',
  icon: [640, 512, [128666, 9951], "f0d1", "M48 0C21.5 0 0 21.5 0 48L0 368c0 26.5 21.5 48 48 48l16 0c0 53 43 96 96 96s96-43 96-96l128 0c0 53 43 96 96 96s96-43 96-96l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64 0-32 0-18.7c0-17-6.7-33.3-18.7-45.3L512 114.7c-12-12-28.3-18.7-45.3-18.7L416 96l0-48c0-26.5-21.5-48-48-48L48 0zM416 160l50.7 0L544 237.3l0 18.7-128 0 0-96zM112 416a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm368-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faCrosshairs = {
  prefix: 'fas',
  iconName: 'crosshairs',
  icon: [512, 512, [], "f05b", "M256 0c17.7 0 32 14.3 32 32l0 10.4c93.7 13.9 167.7 88 181.6 181.6l10.4 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-10.4 0c-13.9 93.7-88 167.7-181.6 181.6l0 10.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-10.4C130.3 455.7 56.3 381.7 42.4 288L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l10.4 0C56.3 130.3 130.3 56.3 224 42.4L224 32c0-17.7 14.3-32 32-32zM107.4 288c12.5 58.3 58.4 104.1 116.6 116.6l0-20.6c0-17.7 14.3-32 32-32s32 14.3 32 32l0 20.6c58.3-12.5 104.1-58.4 116.6-116.6L384 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l20.6 0C392.1 165.7 346.3 119.9 288 107.4l0 20.6c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-20.6C165.7 119.9 119.9 165.7 107.4 224l20.6 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-20.6 0zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faPersonCane = {
  prefix: 'fas',
  iconName: 'person-cane',
  icon: [448, 512, [], "e53c", "M272 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm-8 187.3l47.4 57.1c11.3 13.6 31.5 15.5 45.1 4.2s15.5-31.5 4.2-45.1l-73.7-88.9c-18.2-22-45.3-34.7-73.9-34.7l-35.9 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9 120 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-244.7zM352 376c0-4.4 3.6-8 8-8s8 3.6 8 8l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-30.9-25.1-56-56-56s-56 25.1-56 56l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8z"]
};
const faTent = {
  prefix: 'fas',
  iconName: 'tent',
  icon: [576, 512, [], "e57d", "M269.4 6C280.5-2 295.5-2 306.6 6l224 160c7.4 5.3 12.2 13.5 13.2 22.5l32 288c1 9-1.9 18.1-8 24.9s-14.7 10.7-23.8 10.7l-80 0-28.2 0c-12.1 0-23.2-6.8-28.6-17.7L306.7 293.5c-1.7-3.4-5.1-5.5-8.8-5.5c-5.5 0-9.9 4.4-9.9 9.9L288 480c0 17.7-14.3 32-32 32l-16 0L32 512c-9.1 0-17.8-3.9-23.8-10.7s-9-15.8-8-24.9l32-288c1-9 5.8-17.2 13.2-22.5L269.4 6z"]
};
const faVestPatches = {
  prefix: 'fas',
  iconName: 'vest-patches',
  icon: [448, 512, [], "e086", "M151.2 69.7l55.9 167.7-11 33.1c-2.7 8.2-4.1 16.7-4.1 25.3L192 464c0 14.5 3.9 28.2 10.7 39.9C195 509 185.9 512 176 512L48 512c-26.5 0-48-21.5-48-48L0 270.5c0-9.5 2.8-18.7 8.1-26.6l47.9-71.8c5.3-7.9 8.1-17.1 8.1-26.6L64 128l0-73.7L64 48C64 21.5 85.5 0 112 0l4.5 0c.2 0 .4 0 .6 0c.4 0 .8 0 1.2 0c18.8 0 34.1 9.7 44.1 18.8C171.6 27.2 190.8 40 224 40s52.4-12.8 61.7-21.2C295.7 9.7 311 0 329.7 0c.4 0 .8 0 1.2 0c.2 0 .4 0 .6 0L336 0c26.5 0 48 21.5 48 48l0 6.3 0 73.7 0 17.5c0 9.5 2.8 18.7 8.1 26.6l47.9 71.8c5.3 7.9 8.1 17.1 8.1 26.6L448 464c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-168.2c0-5.2 .8-10.3 2.5-15.2L296.8 69.7C279.4 79.7 255.4 88 224 88s-55.4-8.3-72.8-18.3zM96 456a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM63.5 255.5c-4.7 4.7-4.7 12.3 0 17L79 288 63.5 303.5c-4.7 4.7-4.7 12.3 0 17s12.3 4.7 17 0L96 305l15.5 15.5c4.7 4.7 12.3 4.7 17 0s4.7-12.3 0-17L113 288l15.5-15.5c4.7-4.7 4.7-12.3 0-17s-12.3-4.7-17 0L96 271 80.5 255.5c-4.7-4.7-12.3-4.7-17 0zM304 280l0 8 0 32c0 8.8 7.2 16 16 16l32 0 8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-8c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
};
const faCheckDouble = {
  prefix: 'fas',
  iconName: 'check-double',
  icon: [448, 512, [], "f560", "M342.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 178.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l80 80c12.5 12.5 32.8 12.5 45.3 0l160-160zm96 128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 402.7 54.6 297.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l256-256z"]
};
const faArrowDownAZ = {
  prefix: 'fas',
  iconName: 'arrow-down-a-z',
  icon: [576, 512, ["sort-alpha-asc", "sort-alpha-down"], "f15d", "M183.6 469.6C177.5 476.2 169 480 160 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L128 365.7 128 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 320c0-17.7 14.3-32 32-32l128 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L429.3 416l50.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L402.7 352 352 352c-17.7 0-32-14.3-32-32zM416 32c12.1 0 23.2 6.8 28.6 17.7l64 128 16 32c7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3L460.2 224l-88.4 0-7.2 14.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l16-32 64-128C392.8 38.8 403.9 32 416 32zM395.8 176l40.4 0L416 135.6 395.8 176z"]
};
const faSortAlphaAsc = faArrowDownAZ;
const faSortAlphaDown = faArrowDownAZ;
const faMoneyBillWheat = {
  prefix: 'fas',
  iconName: 'money-bill-wheat',
  icon: [512, 512, [], "e52a", "M176 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80c0-8.8 7.2-16 16-16zM56 16l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L56 64C42.7 64 32 53.3 32 40s10.7-24 24-24zM24 88l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 136c-13.3 0-24-10.7-24-24S10.7 88 24 88zm8 96c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zM272 16c0-8.8 7.2-16 16-16c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80zM400 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16c-44.2 0-80-35.8-80-80c0-8.8 7.2-16 16-16zm80 144c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM352 128c8.8 0 16 7.2 16 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-96 16c0 44.2-35.8 80-80 80c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16zM0 304c0-26.5 21.5-48 48-48l416 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 304zM48 416l0 48 48 0c0-26.5-21.5-48-48-48zM96 304l-48 0 0 48c26.5 0 48-21.5 48-48zM464 416c-26.5 0-48 21.5-48 48l48 0 0-48zM416 304c0 26.5 21.5 48 48 48l0-48-48 0zm-96 80a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faCookie = {
  prefix: 'fas',
  iconName: 'cookie',
  icon: [512, 512, [127850], "f563", "M247.2 17c-22.1-3.1-44.6 .9-64.4 11.4l-74 39.5C89.1 78.4 73.2 94.9 63.4 115L26.7 190.6c-9.8 20.1-13 42.9-9.1 64.9l14.5 82.8c3.9 22.1 14.6 42.3 30.7 57.9l60.3 58.4c16.1 15.6 36.6 25.6 58.7 28.7l83 11.7c22.1 3.1 44.6-.9 64.4-11.4l74-39.5c19.7-10.5 35.6-27 45.4-47.2l36.7-75.5c9.8-20.1 13-42.9 9.1-64.9l-14.6-82.8c-3.9-22.1-14.6-42.3-30.7-57.9L388.9 57.5c-16.1-15.6-36.6-25.6-58.7-28.7L247.2 17zM208 144a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM144 336a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm224-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faArrowRotateLeft = {
  prefix: 'fas',
  iconName: 'arrow-rotate-left',
  icon: [512, 512, [8634, "arrow-left-rotate", "arrow-rotate-back", "arrow-rotate-backward", "undo"], "f0e2", "M125.7 160l50.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L48 224c-17.7 0-32-14.3-32-32L16 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"]
};
const faArrowLeftRotate = faArrowRotateLeft;
const faArrowRotateBack = faArrowRotateLeft;
const faArrowRotateBackward = faArrowRotateLeft;
const faUndo = faArrowRotateLeft;
const faHardDrive = {
  prefix: 'fas',
  iconName: 'hard-drive',
  icon: [512, 512, [128436, "hdd"], "f0a0", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 184.4c-17-15.2-39.4-24.4-64-24.4L64 256c-24.6 0-47 9.2-64 24.4L0 96zM64 288l384 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64zM320 416a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm128-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faHdd = faHardDrive;
const faFaceGrinSquintTears = {
  prefix: 'fas',
  iconName: 'face-grin-squint-tears',
  icon: [512, 512, [129315, "grin-squint-tears"], "f586", "M426.8 14.2C446-5 477.5-4.6 497.1 14.9s20 51 .7 70.3c-6.8 6.8-21.4 12.4-37.4 16.7c-16.3 4.4-34.1 7.5-46.3 9.3c-1.6 .2-3.1 .5-4.6 .6c-4.9 .8-9.1-2.8-9.5-7.4c-.1-.7 0-1.4 .1-2.1c1.6-11.2 4.6-29.6 9-47c.3-1.3 .7-2.6 1-3.9c4.3-15.9 9.8-30.5 16.7-37.4zm-44.7 19c-1.5 4.8-2.9 9.6-4.1 14.3c-4.8 18.9-8 38.5-9.7 50.3c-4 26.8 18.9 49.7 45.7 45.8c11.9-1.6 31.5-4.8 50.4-9.7c4.7-1.2 9.5-2.5 14.3-4.1C534.2 227.5 520.2 353.8 437 437c-83.2 83.2-209.5 97.2-307.2 41.8c1.5-4.8 2.8-9.6 4-14.3c4.8-18.9 8-38.5 9.7-50.3c4-26.8-18.9-49.7-45.7-45.8c-11.9 1.6-31.5 4.8-50.4 9.7c-4.7 1.2-9.5 2.5-14.3 4.1C-22.2 284.5-8.2 158.2 75 75C158.2-8.3 284.5-22.2 382.2 33.2zM51.5 410.1c18.5-5 38.8-8.3 50.9-10c.4-.1 .7-.1 1-.1c5.1-.2 9.2 4.3 8.4 9.6c-1.7 12.1-5 32.4-10 50.9C97.6 476.4 92 491 85.2 497.8C66 517 34.5 516.6 14.9 497.1s-20-51-.7-70.3c6.8-6.8 21.4-12.4 37.4-16.7zM416.9 209c-4.7-11.9-20.8-11-26.8 .3c-19 35.5-45 70.8-77.5 103.3S244.8 371.1 209.3 390c-11.3 6-12.2 22.1-.3 26.8c57.6 22.9 125.8 11 172.3-35.5s58.4-114.8 35.5-172.3zM87.1 285.1c2 2 4.6 3.2 7.3 3.4l56.1 5.1 5.1 56.1c.3 2.8 1.5 5.4 3.4 7.3c6.3 6.3 17.2 3.6 19.8-4.9l29.7-97.4c3.5-11.6-7.3-22.5-19-19L92 265.3c-8.6 2.6-11.3 13.4-4.9 19.8zM265.3 92l-29.7 97.4c-3.5 11.6 7.3 22.5 19 19l97.4-29.7c8.6-2.6 11.3-13.4 4.9-19.8c-2-2-4.6-3.2-7.3-3.4l-56.1-5.1-5.1-56.1c-.3-2.8-1.5-5.4-3.4-7.3c-6.3-6.3-17.2-3.6-19.8 4.9z"]
};
const faGrinSquintTears = faFaceGrinSquintTears;
const faDumbbell = {
  prefix: 'fas',
  iconName: 'dumbbell',
  icon: [640, 512, [], "f44b", "M96 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 160 0 64 0 160c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64-32 0c-17.7 0-32-14.3-32-32l0-64c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c0-17.7 14.3-32 32-32l32 0 0-64zm448 0l0 64 32 0c17.7 0 32 14.3 32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 64c0 17.7-14.3 32-32 32l-32 0 0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-160 0-64 0-160c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32zM416 224l0 64-192 0 0-64 192 0z"]
};
const faRectangleList = {
  prefix: 'fas',
  iconName: 'rectangle-list',
  icon: [576, 512, ["list-alt"], "f022", "M0 96C0 60.7 28.7 32 64 32l448 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM128 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32-128a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm96-248c-13.3 0-24 10.7-24 24s10.7 24 24 24l224 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-224 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l224 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-224 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l224 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-224 0z"]
};
const faListAlt = faRectangleList;
const faTarpDroplet = {
  prefix: 'fas',
  iconName: 'tarp-droplet',
  icon: [576, 512, [], "e57c", "M288 160c-35.3 0-64-26.9-64-60c0-24 33.7-70.1 52.2-93.5c6.1-7.7 17.5-7.7 23.6 0C318.3 29.9 352 76 352 100c0 33.1-28.7 60-64 60zM64 128l133.5 0c13.2 37.3 48.7 64 90.5 64s77.4-26.7 90.5-64L512 128c35.3 0 64 28.7 64 64l0 160-128 0c-17.7 0-32 14.3-32 32l0 128L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zM448 512l0-128 128 0L448 512zM96 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faHouseMedicalCircleCheck = {
  prefix: 'fas',
  iconName: 'house-medical-circle-check',
  icon: [640, 512, [], "e511", "M320 368c0 59.5 29.5 112.1 74.8 144l-266.7 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L522.1 193.9c-8.5-1.3-17.3-1.9-26.1-1.9c-54.7 0-103.5 24.9-135.8 64L320 256l0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zm32 0a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L480 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faPersonSkiingNordic = {
  prefix: 'fas',
  iconName: 'person-skiing-nordic',
  icon: [576, 512, ["skiing-nordic"], "f7ca", "M336 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM227.2 160c1.9 0 3.8 .1 5.6 .3L201.6 254c-9.3 28 1.7 58.8 26.8 74.5l86.2 53.9L291.3 464l-88.5 0 41.1-88.1-32.4-20.3c-7.8-4.9-14.7-10.7-20.6-17.3L132.2 464l-32.4 0 54.2-257.6c4.6-1.5 9-4.1 12.7-7.8l23.1-23.1c9.9-9.9 23.4-15.5 37.5-15.5zM121.4 198.6c.4 .4 .8 .8 1.3 1.2L67 464l-43 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l135.3 0c.5 0 .9 0 1.4 0l158.6 0c.5 0 1 0 1.4 0L504 512c39.8 0 72-32.2 72-72l0-8c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 8c0 13.3-10.7 24-24 24l-69.4 0 27.6-179.3c10.5-5.2 17.8-16.1 17.8-28.7c0-17.7-14.3-32-32-32l-21.3 0c-12.9 0-24.6-7.8-29.5-19.7l-6.3-15c-14.6-35.1-44.1-61.9-80.5-73.1l-48.7-15c-11.1-3.4-22.7-5.2-34.4-5.2c-31 0-60.8 12.3-82.7 34.3l-23.1 23.1c-12.5 12.5-12.5 32.8 0 45.3zm308 89.4L402.3 464l-44.4 0 21.6-75.6c5.9-20.6-2.6-42.6-20.7-53.9L302 299l30.9-82.4 5.1 12.3C353 264.7 387.9 288 426.7 288l2.7 0z"]
};
const faSkiingNordic = faPersonSkiingNordic;
const faCalendarPlus = {
  prefix: 'fas',
  iconName: 'calendar-plus',
  icon: [448, 512, [], "f271", "M96 32l0 32L48 64C21.5 64 0 85.5 0 112l0 48 448 0 0-48c0-26.5-21.5-48-48-48l-48 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L160 64l0-32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192L0 192 0 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-272zM224 248c13.3 0 24 10.7 24 24l0 56 56 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-56 0 0 56c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-56-56 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l56 0 0-56c0-13.3 10.7-24 24-24z"]
};
const faPlaneArrival = {
  prefix: 'fas',
  iconName: 'plane-arrival',
  icon: [640, 512, [128748], "f5af", "M.3 166.9L0 68C0 57.7 9.5 50.1 19.5 52.3l35.6 7.9c10.6 2.3 19.2 9.9 23 20L96 128l127.3 37.6L181.8 20.4C178.9 10.2 186.6 0 197.2 0l40.1 0c11.6 0 22.2 6.2 27.9 16.3l109 193.8 107.2 31.7c15.9 4.7 30.8 12.5 43.7 22.8l34.4 27.6c24 19.2 18.1 57.3-10.7 68.2c-41.2 15.6-86.2 18.1-128.8 7L121.7 289.8c-11.1-2.9-21.2-8.7-29.3-16.9L9.5 189.4c-5.9-6-9.3-14.1-9.3-22.5zM32 448l576 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32zm96-80a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm128-16a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faCircleLeft = {
  prefix: 'fas',
  iconName: 'circle-left',
  icon: [512, 512, [61840, "arrow-alt-circle-left"], "f359", "M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM116.7 244.7l112-112c4.6-4.6 11.5-5.9 17.4-3.5s9.9 8.3 9.9 14.8l0 64 96 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32l-96 0 0 64c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5l-112-112c-6.2-6.2-6.2-16.4 0-22.6z"]
};
const faArrowAltCircleLeft = faCircleLeft;
const faTrainSubway = {
  prefix: 'fas',
  iconName: 'train-subway',
  icon: [448, 512, ["subway"], "f239", "M96 0C43 0 0 43 0 96L0 352c0 48 35.2 87.7 81.1 94.9l-46 46C28.1 499.9 33.1 512 43 512l39.7 0c8.5 0 16.6-3.4 22.6-9.4L160 448l128 0 54.6 54.6c6 6 14.1 9.4 22.6 9.4l39.7 0c10 0 15-12.1 7.9-19.1l-46-46c46-7.1 81.1-46.9 81.1-94.9l0-256c0-53-43-96-96-96L96 0zM64 128c0-17.7 14.3-32 32-32l80 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-80 0c-17.7 0-32-14.3-32-32l0-96zM272 96l80 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-80 0c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32zM64 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm288-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSubway = faTrainSubway;
const faChartGantt = {
  prefix: 'fas',
  iconName: 'chart-gantt',
  icon: [512, 512, [], "e0e4", "M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zm96 96c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32zm96 64l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm160 96l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faIndianRupeeSign = {
  prefix: 'fas',
  iconName: 'indian-rupee-sign',
  icon: [320, 512, ["indian-rupee", "inr"], "e1bc", "M0 64C0 46.3 14.3 32 32 32l64 0 16 0 176 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-56.2 0c9.6 14.4 16.7 30.6 20.7 48l35.6 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-35.6 0c-13.2 58.3-61.9 103.2-122.2 110.9L274.6 422c14.4 10.3 17.7 30.3 7.4 44.6s-30.3 17.7-44.6 7.4L13.4 314C2.1 306-2.7 291.5 1.5 278.2S18.1 256 32 256l80 0c32.8 0 61-19.7 73.3-48L32 208c-17.7 0-32-14.3-32-32s14.3-32 32-32l153.3 0C173 115.7 144.8 96 112 96L96 96 32 96C14.3 96 0 81.7 0 64z"]
};
const faIndianRupee = faIndianRupeeSign;
const faInr = faIndianRupeeSign;
const faCropSimple = {
  prefix: 'fas',
  iconName: 'crop-simple',
  icon: [512, 512, ["crop-alt"], "f565", "M128 32c0-17.7-14.3-32-32-32S64 14.3 64 32l0 32L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l32 0 0 256c0 35.3 28.7 64 64 64l224 0 0-64-224 0 0-352zM384 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-256c0-35.3-28.7-64-64-64L160 64l0 64 224 0 0 352z"]
};
const faCropAlt = faCropSimple;
const faMoneyBill1 = {
  prefix: 'fas',
  iconName: 'money-bill-1',
  icon: [576, 512, ["money-bill-alt"], "f3d1", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm64 320l-64 0 0-64c35.3 0 64 28.7 64 64zM64 192l0-64 64 0c0 35.3-28.7 64-64 64zM448 384c0-35.3 28.7-64 64-64l0 64-64 0zm64-192c-35.3 0-64-28.7-64-64l64 0 0 64zM176 256a112 112 0 1 1 224 0 112 112 0 1 1 -224 0zm76-48c0 9.7 6.9 17.7 16 19.6l0 48.4-4 0c-11 0-20 9-20 20s9 20 20 20l24 0 24 0c11 0 20-9 20-20s-9-20-20-20l-4 0 0-68c0-11-9-20-20-20l-16 0c-11 0-20 9-20 20z"]
};
const faMoneyBillAlt = faMoneyBill1;
const faLeftLong = {
  prefix: 'fas',
  iconName: 'left-long',
  icon: [512, 512, ["long-arrow-alt-left"], "f30a", "M177.5 414c-8.8 3.8-19 2-26-4.6l-144-136C2.7 268.9 0 262.6 0 256s2.7-12.9 7.5-17.4l144-136c7-6.6 17.2-8.4 26-4.6s14.5 12.5 14.5 22l0 72 288 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-288 0 0 72c0 9.6-5.7 18.2-14.5 22z"]
};
const faLongArrowAltLeft = faLeftLong;
const faDna = {
  prefix: 'fas',
  iconName: 'dna',
  icon: [448, 512, [129516], "f471", "M416 0c17.7 0 32 14.3 32 32c0 59.8-30.3 107.5-69.4 146.6c-28 28-62.5 53.5-97.3 77.4l-2.5 1.7c-11.9 8.1-23.8 16.1-35.5 23.9c0 0 0 0 0 0s0 0 0 0s0 0 0 0l-1.6 1c-6 4-11.9 7.9-17.8 11.9c-20.9 14-40.8 27.7-59.3 41.5l118.5 0c-9.8-7.4-20.1-14.7-30.7-22.1l7-4.7 3-2c15.1-10.1 30.9-20.6 46.7-31.6c25 18.1 48.9 37.3 69.4 57.7C417.7 372.5 448 420.2 448 480c0 17.7-14.3 32-32 32s-32-14.3-32-32L64 480c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-59.8 30.3-107.5 69.4-146.6c28-28 62.5-53.5 97.3-77.4c-34.8-23.9-69.3-49.3-97.3-77.4C30.3 139.5 0 91.8 0 32C0 14.3 14.3 0 32 0S64 14.3 64 32l320 0c0-17.7 14.3-32 32-32zM338.6 384l-229.2 0c-10.1 10.6-18.6 21.3-25.5 32l280.2 0c-6.8-10.7-15.3-21.4-25.5-32zM109.4 128l229.2 0c10.1-10.7 18.6-21.3 25.5-32L83.9 96c6.8 10.7 15.3 21.3 25.5 32zm55.4 48c18.4 13.8 38.4 27.5 59.3 41.5c20.9-14 40.8-27.7 59.3-41.5l-118.5 0z"]
};
const faVirusSlash = {
  prefix: 'fas',
  iconName: 'virus-slash',
  icon: [640, 512, [], "e075", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-154.3-121c-2-30.1 20.8-60.1 56-60.1l11.5 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-11.5 0c-49.9 0-74.9-60.3-39.6-95.6l8.2-8.2c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-8.2 8.2C412.3 118.4 352 93.4 352 43.5L352 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 11.5c0 49.9-60.3 74.9-95.6 39.6L184.2 75c-12.5-12.5-32.8-12.5-45.3 0c-1.6 1.6-3.1 3.4-4.3 5.3L38.8 5.1zm225.8 177c6.9-3.9 14.9-6.1 23.4-6.1c26.5 0 48 21.5 48 48c0 4.4-.6 8.7-1.7 12.7l-69.7-54.6zM402 412.7L144.7 210c-9.5 8.5-22.2 14-37.2 14L96 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l11.5 0c49.9 0 74.9 60.3 39.6 95.6l-8.2 8.2c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l8.2-8.2c35.3-35.3 95.6-10.3 95.6 39.6l0 11.5c0 17.7 14.3 32 32 32s32-14.3 32-32l0-11.5c0-31.2 23.6-52.7 50-55.7z"]
};
const faMinus = {
  prefix: 'fas',
  iconName: 'minus',
  icon: [448, 512, [8211, 8722, 10134, "subtract"], "f068", "M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"]
};
const faSubtract = faMinus;
const faChess = {
  prefix: 'fas',
  iconName: 'chess',
  icon: [512, 512, [], "f439", "M144 16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 16L96 32c-8.8 0-16 7.2-16 16s7.2 16 16 16l16 0 0 32L60.2 96C49.1 96 40 105.1 40 116.2c0 2.5 .5 4.9 1.3 7.3L73.8 208 72 208c-13.3 0-24 10.7-24 24s10.7 24 24 24l4 0L60 384l136 0L180 256l4 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-1.8 0 32.5-84.5c.9-2.3 1.3-4.8 1.3-7.3c0-11.2-9.1-20.2-20.2-20.2L144 96l0-32 16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0-16zM48 416L4.8 473.6C1.7 477.8 0 482.8 0 488c0 13.3 10.7 24 24 24l208 0c13.3 0 24-10.7 24-24c0-5.2-1.7-10.2-4.8-14.4L208 416 48 416zm288 0l-43.2 57.6c-3.1 4.2-4.8 9.2-4.8 14.4c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24c0-5.2-1.7-10.2-4.8-14.4L464 416l-128 0zM304 208l0 51.9c0 7.8 2.8 15.3 8 21.1L339.2 312 337 384l125.5 0-3.3-72 28.3-30.8c5.4-5.9 8.5-13.6 8.5-21.7l0-51.5c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16l0 16-24 0 0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16l0 16-24 0 0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16zm80 96c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32-32 0 0-32z"]
};
const faArrowLeftLong = {
  prefix: 'fas',
  iconName: 'arrow-left-long',
  icon: [512, 512, ["long-arrow-left"], "f177", "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 73.4-73.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-128 128z"]
};
const faLongArrowLeft = faArrowLeftLong;
const faPlugCircleCheck = {
  prefix: 'fas',
  iconName: 'plug-circle-check',
  icon: [576, 512, [], "e55c", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L416 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faStreetView = {
  prefix: 'fas',
  iconName: 'street-view',
  icon: [512, 512, [], "f21d", "M320 64A64 64 0 1 0 192 64a64 64 0 1 0 128 0zm-96 96c-35.3 0-64 28.7-64 64l0 48c0 17.7 14.3 32 32 32l1.8 0 11.1 99.5c1.8 16.2 15.5 28.5 31.8 28.5l38.7 0c16.3 0 30-12.3 31.8-28.5L318.2 304l1.8 0c17.7 0 32-14.3 32-32l0-48c0-35.3-28.7-64-64-64l-64 0zM132.3 394.2c13-2.4 21.7-14.9 19.3-27.9s-14.9-21.7-27.9-19.3c-32.4 5.9-60.9 14.2-82 24.8c-10.5 5.3-20.3 11.7-27.8 19.6C6.4 399.5 0 410.5 0 424c0 21.4 15.5 36.1 29.1 45c14.7 9.6 34.3 17.3 56.4 23.4C130.2 504.7 190.4 512 256 512s125.8-7.3 170.4-19.6c22.1-6.1 41.8-13.8 56.4-23.4c13.7-8.9 29.1-23.6 29.1-45c0-13.5-6.4-24.5-14-32.6c-7.5-7.9-17.3-14.3-27.8-19.6c-21-10.6-49.5-18.9-82-24.8c-13-2.4-25.5 6.3-27.9 19.3s6.3 25.5 19.3 27.9c30.2 5.5 53.7 12.8 69 20.5c3.2 1.6 5.8 3.1 7.9 4.5c3.6 2.4 3.6 7.2 0 9.6c-8.8 5.7-23.1 11.8-43 17.3C374.3 457 318.5 464 256 464s-118.3-7-157.7-17.9c-19.9-5.5-34.2-11.6-43-17.3c-3.6-2.4-3.6-7.2 0-9.6c2.1-1.4 4.8-2.9 7.9-4.5c15.3-7.7 38.8-14.9 69-20.5z"]
};
const faFrancSign = {
  prefix: 'fas',
  iconName: 'franc-sign',
  icon: [320, 512, [], "e18f", "M80 32C62.3 32 48 46.3 48 64l0 160 0 96-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 0-64 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-96 176 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]
};
const faVolumeOff = {
  prefix: 'fas',
  iconName: 'volume-off',
  icon: [320, 512, [], "f026", "M320 64c0-12.6-7.4-24-18.9-29.2s-25-3.1-34.4 5.3L131.8 160 64 160c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l67.8 0L266.7 471.9c9.4 8.4 22.9 10.4 34.4 5.3S320 460.6 320 448l0-384z"]
};
const faHandsAslInterpreting = {
  prefix: 'fas',
  iconName: 'hands-asl-interpreting',
  icon: [640, 512, ["american-sign-language-interpreting", "asl-interpreting", "hands-american-sign-language-interpreting"], "f2a3", "M156.6 46.3c7.9-15.8 1.5-35-14.3-42.9s-35-1.5-42.9 14.3L13.5 189.4C4.6 207.2 0 226.8 0 246.7L0 256c0 70.7 57.3 128 128 128l72 0 8 0 0-.3c35.2-2.7 65.4-22.8 82.1-51.7c8.8-15.3 3.6-34.9-11.7-43.7s-34.9-3.6-43.7 11.7c-7 12-19.9 20-34.7 20c-22.1 0-40-17.9-40-40s17.9-40 40-40c14.8 0 27.7 8 34.7 20c8.8 15.3 28.4 20.5 43.7 11.7s20.5-28.4 11.7-43.7c-12.8-22.1-33.6-39.1-58.4-47.1l80.8-22c17-4.6 27.1-22.2 22.5-39.3s-22.2-27.1-39.3-22.5L194.9 124.6l81.6-68c13.6-11.3 15.4-31.5 4.1-45.1S249.1-3.9 235.5 7.4L133.6 92.3l23-46zM483.4 465.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l85.9-171.7c8.9-17.8 13.5-37.4 13.5-57.2l0-9.3c0-70.7-57.3-128-128-128l-72 0-8 0 0 .3c-35.2 2.7-65.4 22.8-82.1 51.7c-8.9 15.3-3.6 34.9 11.7 43.7s34.9 3.6 43.7-11.7c7-12 19.9-20 34.7-20c22.1 0 40 17.9 40 40s-17.9 40-40 40c-14.8 0-27.7-8-34.7-20c-8.9-15.3-28.4-20.5-43.7-11.7s-20.5 28.4-11.7 43.7c12.8 22.1 33.6 39.1 58.4 47.1l-80.8 22c-17.1 4.7-27.1 22.2-22.5 39.3s22.2 27.1 39.3 22.5l100.7-27.5-81.6 68c-13.6 11.3-15.4 31.5-4.1 45.1s31.5 15.4 45.1 4.1l101.9-84.9-23 46z"]
};
const faAmericanSignLanguageInterpreting = faHandsAslInterpreting;
const faAslInterpreting = faHandsAslInterpreting;
const faHandsAmericanSignLanguageInterpreting = faHandsAslInterpreting;
const faGear = {
  prefix: 'fas',
  iconName: 'gear',
  icon: [512, 512, [9881, "cog"], "f013", "M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]
};
const faCog = faGear;
const faDropletSlash = {
  prefix: 'fas',
  iconName: 'droplet-slash',
  icon: [640, 512, ["tint-slash"], "f5c7", "M320 512c53.2 0 101.4-21.6 136.1-56.6l-298.3-235C140 257.1 128 292.3 128 320c0 106 86 192 192 192zM505.2 370.7c4.4-16.2 6.8-33.1 6.8-50.7c0-91.2-130.2-262.3-166.6-308.3C339.4 4.2 330.5 0 320.9 0l-1.8 0c-9.6 0-18.5 4.2-24.5 11.7C277.8 33 240.7 81.3 205.8 136L38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L505.2 370.7zM224 336c0 44.2 35.8 80 80 80c8.8 0 16 7.2 16 16s-7.2 16-16 16c-61.9 0-112-50.1-112-112c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faTintSlash = faDropletSlash;
const faMosque = {
  prefix: 'fas',
  iconName: 'mosque',
  icon: [640, 512, [128332], "f678", "M400 0c5 0 9.8 2.4 12.8 6.4c34.7 46.3 78.1 74.9 133.5 111.5c0 0 0 0 0 0s0 0 0 0c5.2 3.4 10.5 7 16 10.6c28.9 19.2 45.7 51.7 45.7 86.1c0 28.6-11.3 54.5-29.8 73.4l-356.4 0c-18.4-19-29.8-44.9-29.8-73.4c0-34.4 16.7-66.9 45.7-86.1c5.4-3.6 10.8-7.1 16-10.6c0 0 0 0 0 0s0 0 0 0C309.1 81.3 352.5 52.7 387.2 6.4c3-4 7.8-6.4 12.8-6.4zM288 512l0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-48 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l416 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-48 0 0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-64 0 0-58c0-19-8.4-37-23-49.2L400 384l-25 20.8C360.4 417 352 435 352 454l0 58-64 0zM70.4 5.2c5.7-4.3 13.5-4.3 19.2 0l16 12C139.8 42.9 160 83.2 160 126l0 2L0 128l0-2C0 83.2 20.2 42.9 54.4 17.2l16-12zM0 160l160 0 0 136.6c-19.1 11.1-32 31.7-32 55.4l0 128c0 9.6 2.1 18.6 5.8 26.8c-6.6 3.4-14 5.2-21.8 5.2l-64 0c-26.5 0-48-21.5-48-48L0 176l0-16z"]
};
const faMosquito = {
  prefix: 'fas',
  iconName: 'mosquito',
  icon: [640, 512, [], "e52b", "M463.7 505.9c9.8-8.9 10.7-24.3 2.1-34.3l-42.1-49 0-54.7c0-5.5-1.8-10.8-5.1-15.1L352 266.3l0-.3L485.4 387.8C542.4 447.6 640 405.2 640 320.6c0-47.9-34-88.3-79.4-94.2l-153-23.9 40.8-40.9c7.8-7.8 9.4-20.1 3.9-29.8L428.5 90.1l38.2-50.9c8-10.6 6.1-25.9-4.3-34.1s-25.2-6.3-33.2 4.4l-48 63.9c-5.9 7.9-6.6 18.6-1.7 27.2L402.2 140 352 190.3l0-38.2c0-14.9-10.2-27.4-24-31l0-57.2c0-4.4-3.6-8-8-8s-8 3.6-8 8l0 57.2c-13.8 3.6-24 16.1-24 31l0 38.1L237.8 140l22.6-39.5c4.9-8.6 4.2-19.3-1.7-27.2l-48-63.9c-8-10.6-22.8-12.6-33.2-4.4s-12.2 23.5-4.3 34.1l38.2 50.9-23.9 41.7c-5.5 9.7-3.9 22 3.9 29.8l40.8 40.9-153 23.9C34 232.3 0 272.7 0 320.6c0 84.6 97.6 127 154.6 67.1L288 266l0 .3-66.5 86.4c-3.3 4.3-5.1 9.6-5.1 15.1l0 54.7-42.1 49c-8.6 10.1-7.7 25.5 2.1 34.3s24.7 7.9 33.4-2.1l48-55.9c3.8-4.4 5.9-10.2 5.9-16.1l0-55.4L288 344.7l0 63.1c0 17.7 14.3 32 32 32s32-14.3 32-32l0-63.1 24.3 31.6 0 55.4c0 5.9 2.1 11.7 5.9 16.1l48 55.9c8.6 10.1 23.6 11 33.4 2.1z"]
};
const faStarOfDavid = {
  prefix: 'fas',
  iconName: 'star-of-david',
  icon: [512, 512, [10017], "f69a", "M404.2 309.5L383.1 344l42.3 0-21.1-34.5zM371.4 256l-54-88-122.8 0-54 88 54 88 122.8 0 54-88zm65.7 0l53.4 87c3.6 5.9 5.5 12.7 5.5 19.6c0 20.7-16.8 37.4-37.4 37.4l-109.8 0-56.2 91.5C284.8 504.3 270.9 512 256 512s-28.8-7.7-36.6-20.5L163.3 400 53.4 400C32.8 400 16 383.2 16 362.6c0-6.9 1.9-13.7 5.5-19.6l53.4-87L21.5 169c-3.6-5.9-5.5-12.7-5.5-19.6C16 128.8 32.8 112 53.4 112l109.8 0 56.2-91.5C227.2 7.7 241.1 0 256 0s28.8 7.7 36.6 20.5L348.7 112l109.8 0c20.7 0 37.4 16.8 37.4 37.4c0 6.9-1.9 13.7-5.5 19.6l-53.4 87zm-54-88l21.1 34.5L425.4 168l-42.3 0zM283 112L256 68l-27 44 54 0zM128.9 168l-42.3 0 21.1 34.5L128.9 168zM107.8 309.5L86.6 344l42.3 0-21.1-34.5zM229 400l27 44 27-44-54 0z"]
};
const faPersonMilitaryRifle = {
  prefix: 'fas',
  iconName: 'person-military-rifle',
  icon: [512, 512, [], "e54b", "M160 39c0-13 10-23.8 22.9-24.9L334.7 1.4C344 .7 352 8 352 17.4L352 48c0 8.8-7.2 16-16 16L185 64c-13.8 0-25-11.2-25-25zm17.6 57l156.8 0c1 5.2 1.6 10.5 1.6 16c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-5.5 .6-10.8 1.6-16zm228 364.3L352 369.7 352 480c0 1.3-.1 2.5-.2 3.8L177.5 234.9c16.6-7.1 34.6-10.9 53.3-10.9l50.4 0c15.9 0 31.3 2.8 45.8 7.9L421.9 67.7c-7.7-4.4-10.3-14.2-5.9-21.9s14.2-10.3 21.9-5.9l13.9 8 13.9 8c7.7 4.4 10.3 14.2 5.9 21.9L416 173.9l1.6 .9c15.3 8.8 20.6 28.4 11.7 43.7L392.6 282c2 2.8 3.9 5.8 5.7 8.8l76.1 128.8c11.2 19 4.9 43.5-14.1 54.8s-43.5 4.9-54.8-14.1zM320 512l-128 0c-17.7 0-32-14.3-32-32l0-110.3-53.6 90.6c-11.2 19-35.8 25.3-54.8 14.1s-25.3-35.8-14.1-54.8l76.1-128.8c9.4-15.8 21.7-29.3 36-40L331.1 510c-3.5 1.3-7.2 2-11.1 2zM296 320a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faCartShopping = {
  prefix: 'fas',
  iconName: 'cart-shopping',
  icon: [576, 512, [128722, "shopping-cart"], "f07a", "M0 24C0 10.7 10.7 0 24 0L69.5 0c22 0 41.5 12.8 50.6 32l411 0c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3l-288.5 0 5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5L488 336c13.3 0 24 10.7 24 24s-10.7 24-24 24l-288.3 0c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5L24 48C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faShoppingCart = faCartShopping;
const faVials = {
  prefix: 'fas',
  iconName: 'vials',
  icon: [512, 512, [], "f493", "M0 64C0 46.3 14.3 32 32 32l56 0 48 0 56 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 304c0 44.2-35.8 80-80 80s-80-35.8-80-80L32 96C14.3 96 0 81.7 0 64zM136 96L88 96l0 160 48 0 0-160zM288 64c0-17.7 14.3-32 32-32l56 0 48 0 56 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 304c0 44.2-35.8 80-80 80s-80-35.8-80-80l0-304c-17.7 0-32-14.3-32-32zM424 96l-48 0 0 160 48 0 0-160z"]
};
const faPlugCirclePlus = {
  prefix: 'fas',
  iconName: 'plug-circle-plus',
  icon: [576, 512, [], "e55f", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm16-208l0 48 48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l48 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faPlaceOfWorship = {
  prefix: 'fas',
  iconName: 'place-of-worship',
  icon: [640, 512, [], "f67f", "M224 109.3l0 108.3L183.3 242c-14.5 8.7-23.3 24.3-23.3 41.2L160 512l96 0 0-96c0-35.3 28.7-64 64-64s64 28.7 64 64l0 96 96 0 0-228.8c0-16.9-8.8-32.5-23.3-41.2L416 217.6l0-108.3c0-8.5-3.4-16.6-9.4-22.6L331.3 11.3c-6.2-6.2-16.4-6.2-22.6 0L233.4 86.6c-6 6-9.4 14.1-9.4 22.6zM24.9 330.3C9.5 338.8 0 354.9 0 372.4L0 464c0 26.5 21.5 48 48 48l80 0 0-238.4L24.9 330.3zM592 512c26.5 0 48-21.5 48-48l0-91.6c0-17.5-9.5-33.6-24.9-42.1L512 273.6 512 512l80 0z"]
};
const faGripVertical = {
  prefix: 'fas',
  iconName: 'grip-vertical',
  icon: [320, 512, [], "f58e", "M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z"]
};
const faHexagonNodes = {
  prefix: 'fas',
  iconName: 'hexagon-nodes',
  icon: [448, 512, [], "e699", "M248 106.6c18.9-9 32-28.3 32-50.6c0-30.9-25.1-56-56-56s-56 25.1-56 56c0 22.3 13.1 41.6 32 50.6l0 98.8c-2.8 1.3-5.5 2.9-8 4.7l-80.1-45.8c1.6-20.8-8.6-41.6-27.9-52.8C57.2 96 23 105.2 7.5 132S1.2 193 28 208.5c1.3 .8 2.6 1.5 4 2.1l0 90.8c-1.3 .6-2.7 1.3-4 2.1C1.2 319-8 353.2 7.5 380S57.2 416 84 400.5c19.3-11.1 29.4-32 27.8-52.8l50.5-28.9c-11.5-11.2-19.9-25.6-23.8-41.7L88 306.1c-2.6-1.8-5.2-3.3-8-4.7l0-90.8c2.8-1.3 5.5-2.9 8-4.7l80.1 45.8c-.1 1.4-.2 2.8-.2 4.3c0 22.3 13.1 41.6 32 50.6l0 98.8c-18.9 9-32 28.3-32 50.6c0 30.9 25.1 56 56 56s56-25.1 56-56c0-22.3-13.1-41.6-32-50.6l0-98.8c2.8-1.3 5.5-2.9 8-4.7l80.1 45.8c-1.6 20.8 8.6 41.6 27.8 52.8c26.8 15.5 61 6.3 76.5-20.5s6.3-61-20.5-76.5c-1.3-.8-2.7-1.5-4-2.1l0-90.8c1.4-.6 2.7-1.3 4-2.1c26.8-15.5 36-49.7 20.5-76.5S390.8 96 364 111.5c-19.3 11.1-29.4 32-27.8 52.8l-50.6 28.9c11.5 11.2 19.9 25.6 23.8 41.7L360 205.9c2.6 1.8 5.2 3.3 8 4.7l0 90.8c-2.8 1.3-5.5 2.9-8 4.6l-80.1-45.8c.1-1.4 .2-2.8 .2-4.3c0-22.3-13.1-41.6-32-50.6l0-98.8z"]
};
const faArrowTurnUp = {
  prefix: 'fas',
  iconName: 'arrow-turn-up',
  icon: [384, 512, ["level-up"], "f148", "M32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96-43 96-96l0-306.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 416c0 17.7-14.3 32-32 32l-96 0z"]
};
const faLevelUp = faArrowTurnUp;
const faU = {
  prefix: 'fas',
  iconName: 'u',
  icon: [384, 512, [117], "55", "M32 32c17.7 0 32 14.3 32 32l0 224c0 70.7 57.3 128 128 128s128-57.3 128-128l0-224c0-17.7 14.3-32 32-32s32 14.3 32 32l0 224c0 106-86 192-192 192S0 394 0 288L0 64C0 46.3 14.3 32 32 32z"]
};
const faSquareRootVariable = {
  prefix: 'fas',
  iconName: 'square-root-variable',
  icon: [576, 512, ["square-root-alt"], "f698", "M282.6 78.1c8-27.3 33-46.1 61.4-46.1l200 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L344 96 238.7 457c-3.6 12.3-14.1 21.2-26.8 22.8s-25.1-4.6-31.5-15.6L77.6 288 32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l45.6 0c22.8 0 43.8 12.1 55.3 31.8l65.2 111.8L282.6 78.1zM393.4 233.4c12.5-12.5 32.8-12.5 45.3 0L480 274.7l41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L525.3 320l41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L480 365.3l-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L434.7 320l-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3z"]
};
const faSquareRootAlt = faSquareRootVariable;
const faClock = {
  prefix: 'fas',
  iconName: 'clock',
  icon: [512, 512, [128339, "clock-four"], "f017", "M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]
};
const faClockFour = faClock;
const faBackwardStep = {
  prefix: 'fas',
  iconName: 'backward-step',
  icon: [320, 512, ["step-backward"], "f048", "M267.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-320c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160L64 241 64 96c0-17.7-14.3-32-32-32S0 78.3 0 96L0 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-145 11.5 9.6 192 160z"]
};
const faStepBackward = faBackwardStep;
const faPallet = {
  prefix: 'fas',
  iconName: 'pallet',
  icon: [640, 512, [], "f482", "M32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 64-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 224 0 224 0 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-64 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0-224 0L96 320l-64 0zm96 64l160 0 0 64-160 0 0-64zm224 0l160 0 0 64-160 0 0-64z"]
};
const faFaucet = {
  prefix: 'fas',
  iconName: 'faucet',
  icon: [512, 512, [], "e005", "M192 96l0 12L96 96c-17.7 0-32 14.3-32 32s14.3 32 32 32l96-12 31-3.9 1-.1 1 .1 31 3.9 96 12c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 12 0-12c0-17.7-14.3-32-32-32s-32 14.3-32 32zM32 256c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l100.1 0c20.2 29 53.9 48 91.9 48s71.7-19 91.9-48l36.1 0c17.7 0 32 14.3 32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32c0-88.4-71.6-160-160-160l-32 0-22.6-22.6c-6-6-14.1-9.4-22.6-9.4L256 224l0-43.8-32-4-32 4 0 43.8-18.7 0c-8.5 0-16.6 3.4-22.6 9.4L128 256l-96 0z"]
};
const faBaseballBatBall = {
  prefix: 'fas',
  iconName: 'baseball-bat-ball',
  icon: [512, 512, [], "f432", "M424 0c-12.4 0-24.2 4.9-33 13.7L233.5 171.2c-10.5 10.5-19.8 22.1-27.7 34.6L132.7 321.6c-7.3 11.5-15.8 22.2-25.5 31.9L69.9 390.7l51.3 51.3 37.3-37.3c9.6-9.6 20.3-18.2 31.9-25.5l115.8-73.1c12.5-7.9 24.1-17.2 34.6-27.7L498.3 121c8.7-8.7 13.7-20.6 13.7-33s-4.9-24.2-13.7-33L457 13.7C448.2 4.9 436.4 0 424 0zm88 432a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM15 399c-9.4 9.4-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L49 399c-9.4-9.4-24.6-9.4-33.9 0z"]
};
const faS = {
  prefix: 'fas',
  iconName: 's',
  icon: [320, 512, [115], "53", "M99.1 105.4C79 114 68.2 127.2 65.2 144.8c-2.4 14.1-.7 23.2 2 29.4c2.8 6.3 7.9 12.4 16.7 18.6c19.2 13.4 48.3 22.1 84.9 32.5c1 .3 1.9 .6 2.9 .8c32.7 9.3 72 20.6 100.9 40.7c15.7 10.9 29.9 25.5 38.6 45.1c8.8 19.8 10.8 42 6.6 66.3c-7.3 42.5-35.3 71.7-71.8 87.3c-35.4 15.2-79.1 17.9-123.7 10.9l-.2 0s0 0 0 0c-24-3.9-62.7-17.1-87.6-25.6c-4.8-1.7-9.2-3.1-12.8-4.3C5.1 440.8-3.9 422.7 1.6 405.9s23.7-25.8 40.5-20.3c4.9 1.6 10.2 3.4 15.9 5.4c25.4 8.6 56.4 19.2 74.4 22.1c36.8 5.7 67.5 2.5 88.5-6.5c20.1-8.6 30.8-21.8 33.9-39.4c2.4-14.1 .7-23.2-2-29.4c-2.8-6.3-7.9-12.4-16.7-18.6c-19.2-13.4-48.3-22.1-84.9-32.5c-1-.3-1.9-.6-2.9-.8c-32.7-9.3-72-20.6-100.9-40.7c-15.7-10.9-29.9-25.5-38.6-45.1c-8.8-19.8-10.8-42-6.6-66.3l31.5 5.5L2.1 133.9C9.4 91.4 37.4 62.2 73.9 46.6c35.4-15.2 79.1-17.9 123.7-10.9c13 2 52.4 9.6 66.6 13.4c17.1 4.5 27.2 22.1 22.7 39.2s-22.1 27.2-39.2 22.7c-11.2-3-48.1-10.2-60.1-12l4.9-31.5-4.9 31.5c-36.9-5.8-67.5-2.5-88.6 6.5z"]
};
const faTimeline = {
  prefix: 'fas',
  iconName: 'timeline',
  icon: [640, 512, [], "e29c", "M128 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm32 97.3c28.3-12.3 48-40.5 48-73.3c0-44.2-35.8-80-80-80S48 51.8 48 96c0 32.8 19.7 61 48 73.3L96 224l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0 0 54.7c-28.3 12.3-48 40.5-48 73.3c0 44.2 35.8 80 80 80s80-35.8 80-80c0-32.8-19.7-61-48-73.3l0-54.7 256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-54.7c28.3-12.3 48-40.5 48-73.3c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 32.8 19.7 61 48 73.3l0 54.7-320 0 0-54.7zM488 96a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM320 392a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faKeyboard = {
  prefix: 'fas',
  iconName: 'keyboard',
  icon: [576, 512, [9000], "f11c", "M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm16 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80-176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM160 336c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-32zM272 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM256 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM368 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM352 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM464 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM448 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]
};
const faCaretDown = {
  prefix: 'fas',
  iconName: 'caret-down',
  icon: [320, 512, [], "f0d7", "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"]
};
const faHouseChimneyMedical = {
  prefix: 'fas',
  iconName: 'house-chimney-medical',
  icon: [576, 512, ["clinic-medical"], "f7f2", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c.2 35.5-28.5 64.3-64 64.3l-320.4 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7 416 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 121 52.8 46.4c8 7 12 15 11 24zM272 192c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0z"]
};
const faClinicMedical = faHouseChimneyMedical;
const faTemperatureThreeQuarters = {
  prefix: 'fas',
  iconName: 'temperature-three-quarters',
  icon: [320, 512, ["temperature-3", "thermometer-3", "thermometer-three-quarters"], "f2c8", "M160 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L208 112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L48 112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3L144 144c0-8.8 7.2-16 16-16s16 7.2 16 16l0 178.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faTemperature3 = faTemperatureThreeQuarters;
const faThermometer3 = faTemperatureThreeQuarters;
const faThermometerThreeQuarters = faTemperatureThreeQuarters;
const faMobileScreen = {
  prefix: 'fas',
  iconName: 'mobile-screen',
  icon: [384, 512, ["mobile-android-alt"], "f3cf", "M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM144 448c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zM304 64L80 64l0 320 224 0 0-320z"]
};
const faMobileAndroidAlt = faMobileScreen;
const faPlaneUp = {
  prefix: 'fas',
  iconName: 'plane-up',
  icon: [512, 512, [], "e22d", "M192 93.7C192 59.5 221 0 256 0c36 0 64 59.5 64 93.7l0 66.3L497.8 278.5c8.9 5.9 14.2 15.9 14.2 26.6l0 56.7c0 10.9-10.7 18.6-21.1 15.2L320 320l0 80 57.6 43.2c4 3 6.4 7.8 6.4 12.8l0 42c0 7.8-6.3 14-14 14c-1.3 0-2.6-.2-3.9-.5L256 480 145.9 511.5c-1.3 .4-2.6 .5-3.9 .5c-7.8 0-14-6.3-14-14l0-42c0-5 2.4-9.8 6.4-12.8L192 400l0-80L21.1 377C10.7 380.4 0 372.7 0 361.8l0-56.7c0-10.7 5.3-20.7 14.2-26.6L192 160l0-66.3z"]
};
const faPiggyBank = {
  prefix: 'fas',
  iconName: 'piggy-bank',
  icon: [576, 512, [], "f4d3", "M400 96l0 .7c-5.3-.4-10.6-.7-16-.7L256 96c-16.5 0-32.5 2.1-47.8 6c-.1-2-.2-4-.2-6c0-53 43-96 96-96s96 43 96 96zm-16 32c3.5 0 7 .1 10.4 .3c4.2 .3 8.4 .7 12.6 1.3C424.6 109.1 450.8 96 480 96l11.5 0c10.4 0 18 9.8 15.5 19.9l-13.8 55.2c15.8 14.8 28.7 32.8 37.5 52.9l13.3 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-32 0c-9.1 12.1-19.9 22.9-32 32l0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-128 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64c-34.9-26.2-58.7-66.3-63.2-112L68 304c-37.6 0-68-30.4-68-68s30.4-68 68-68l4 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-4 0c-11 0-20 9-20 20s9 20 20 20l31.2 0c12.1-59.8 57.7-107.5 116.3-122.8c12.9-3.4 26.5-5.2 40.5-5.2l128 0zm64 136a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faBatteryHalf = {
  prefix: 'fas',
  iconName: 'battery-half',
  icon: [576, 512, ["battery-3"], "f242", "M464 160c8.8 0 16 7.2 16 16l0 160c0 8.8-7.2 16-16 16L80 352c-8.8 0-16-7.2-16-16l0-160c0-8.8 7.2-16 16-16l384 0zM80 96C35.8 96 0 131.8 0 176L0 336c0 44.2 35.8 80 80 80l384 0c44.2 0 80-35.8 80-80l0-16c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-16c0-44.2-35.8-80-80-80L80 96zm208 96L96 192l0 128 192 0 0-128z"]
};
const faBattery3 = faBatteryHalf;
const faMountainCity = {
  prefix: 'fas',
  iconName: 'mountain-city',
  icon: [640, 512, [], "e52e", "M336 0c-26.5 0-48 21.5-48 48l0 92.1 71.4 118.4c2.5-1.6 5.4-2.5 8.6-2.5l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-3.5 0 73.8 122.4c12.4 20.6 12.9 46.3 1.2 67.3c-.4 .8-.9 1.6-1.4 2.3L592 512c26.5 0 48-21.5 48-48l0-224c0-26.5-21.5-48-48-48l-24 0 0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-40 0 0-144c0-26.5-21.5-48-48-48L336 0zm32 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM352 176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm160 96c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM224 188.9L283.8 288 223 288l-48 64-24.6-41.2L224 188.9zm29.4-44.2C247.1 134.3 236 128 224 128s-23.1 6.3-29.4 16.7L5.1 458.9c-6.5 10.8-6.7 24.3-.7 35.3S22 512 34.5 512l379.1 0c12.5 0 24-6.8 30.1-17.8s5.8-24.5-.7-35.3L253.4 144.7z"]
};
const faCoins = {
  prefix: 'fas',
  iconName: 'coins',
  icon: [512, 512, [], "f51e", "M512 80c0 18-14.3 34.6-38.4 48c-29.1 16.1-72.5 27.5-122.3 30.9c-3.7-1.8-7.4-3.5-11.3-5C300.6 137.4 248.2 128 192 128c-8.3 0-16.4 .2-24.5 .6l-1.1-.6C142.3 114.6 128 98 128 80c0-44.2 86-80 192-80S512 35.8 512 80zM160.7 161.1c10.2-.7 20.7-1.1 31.3-1.1c62.2 0 117.4 12.3 152.5 31.4C369.3 204.9 384 221.7 384 240c0 4-.7 7.9-2.1 11.7c-4.6 13.2-17 25.3-35 35.5c0 0 0 0 0 0c-.1 .1-.3 .1-.4 .2c0 0 0 0 0 0s0 0 0 0c-.3 .2-.6 .3-.9 .5c-35 19.4-90.8 32-153.6 32c-59.6 0-112.9-11.3-148.2-29.1c-1.9-.9-3.7-1.9-5.5-2.9C14.3 274.6 0 258 0 240c0-34.8 53.4-64.5 128-75.4c10.5-1.5 21.4-2.7 32.7-3.5zM416 240c0-21.9-10.6-39.9-24.1-53.4c28.3-4.4 54.2-11.4 76.2-20.5c16.3-6.8 31.5-15.2 43.9-25.5l0 35.4c0 19.3-16.5 37.1-43.8 50.9c-14.6 7.4-32.4 13.7-52.4 18.5c.1-1.8 .2-3.5 .2-5.3zm-32 96c0 18-14.3 34.6-38.4 48c-1.8 1-3.6 1.9-5.5 2.9C304.9 404.7 251.6 416 192 416c-62.8 0-118.6-12.6-153.6-32C14.3 370.6 0 354 0 336l0-35.4c12.5 10.3 27.6 18.7 43.9 25.5C83.4 342.6 135.8 352 192 352s108.6-9.4 148.1-25.9c7.8-3.2 15.3-6.9 22.4-10.9c6.1-3.4 11.8-7.2 17.2-11.2c1.5-1.1 2.9-2.3 4.3-3.4l0 3.4 0 5.7 0 26.3zm32 0l0-32 0-25.9c19-4.2 36.5-9.5 52.1-16c16.3-6.8 31.5-15.2 43.9-25.5l0 35.4c0 10.5-5 21-14.9 30.9c-16.3 16.3-45 29.7-81.3 38.4c.1-1.7 .2-3.5 .2-5.3zM192 448c56.2 0 108.6-9.4 148.1-25.9c16.3-6.8 31.5-15.2 43.9-25.5l0 35.4c0 44.2-86 80-192 80S0 476.2 0 432l0-35.4c12.5 10.3 27.6 18.7 43.9 25.5C83.4 438.6 135.8 448 192 448z"]
};
const faKhanda = {
  prefix: 'fas',
  iconName: 'khanda',
  icon: [512, 512, [9772], "f66d", "M245.8 3.7c5.9-4.9 14.6-4.9 20.5 0l48 40c5.9 4.9 7.5 13.2 3.8 19.9c0 0 0 0 0 0s0 0 0 0s0 0 0 0s0 0 0 0l-.1 .1-.3 .6c-.3 .5-.7 1.3-1.2 2.3c-1 2-2.6 5-4.4 8.6c-.5 .9-.9 1.9-1.4 2.9C344.9 97.4 368 134 368 176s-23.1 78.6-57.3 97.8c.5 1 1 2 1.4 2.9c1.8 3.7 3.3 6.6 4.4 8.6c.5 1 .9 1.8 1.2 2.3l.3 .6 .1 .1s0 0 0 0s0 0 0 0c3.6 6.7 2 15-3.8 19.9L272 343.5l0 19.8 35.6-24.5 41.1-28.2c42.8-29.4 68.4-78 68.4-130c0-31.1-9.2-61.6-26.5-87.5l-2.8-4.2c-4-6-3.5-14 1.3-19.5s12.7-7 19.2-3.7L401.1 80c7.2-14.3 7.2-14.3 7.2-14.3s0 0 0 0s0 0 0 0l.1 0 .3 .2 1 .5c.8 .4 2 1.1 3.5 1.9c2.9 1.7 7 4.1 11.8 7.3c9.6 6.4 22.5 16.1 35.4 29c25.7 25.7 52.7 65.6 52.7 119.3c0 53.1-26.4 100.5-51.2 133.6c-12.6 16.7-25.1 30.3-34.5 39.7c-4.7 4.7-8.7 8.4-11.5 10.9c-1.4 1.3-2.5 2.2-3.3 2.9l-.9 .8-.3 .2-.1 .1c0 0 0 0 0 0s0 0 0 0L401.1 400l10.2 12.3c-5.1 4.3-12.4 4.9-18.2 1.6l-75.6-43-32.7 22.5 45.5 31.3c1.8-.4 3.7-.7 5.7-.7c13.3 0 24 10.7 24 24s-10.7 24-24 24c-12.2 0-22.3-9.1-23.8-21L272 423.4l0 28.9c9.6 5.5 16 15.9 16 27.7c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-11.8 6.4-22.2 16-27.7l0-28.1-40.3 27.7C197.8 463.3 187.9 472 176 472c-13.3 0-24-10.7-24-24s10.7-24 24-24c2.2 0 4.4 .3 6.5 .9l45.8-31.5-32.7-22.5-75.6 43c-5.8 3.3-13 2.7-18.2-1.6L112 400c-10.2 12.3-10.2 12.3-10.3 12.3s0 0 0 0s0 0 0 0l-.1-.1-.3-.2-.9-.8c-.8-.7-1.9-1.7-3.3-2.9c-2.8-2.5-6.7-6.2-11.5-10.9c-9.4-9.4-21.9-23-34.5-39.7C26.4 324.5 0 277.1 0 224c0-53.7 26.9-93.6 52.7-119.3c12.9-12.9 25.8-22.6 35.4-29C93 72.5 97 70 99.9 68.4c1.5-.8 2.6-1.5 3.5-1.9l1-.5 .3-.2 .1 0c0 0 0 0 0 0s0 0 0 0L112 80l-7.2-14.3c6.5-3.2 14.3-1.7 19.2 3.7s5.3 13.4 1.3 19.5l-2.8 4.2C105.2 119 96 149.5 96 180.6c0 51.9 25.6 100.6 68.4 130l41.1 28.2L240 362.6l0-19.1-42.2-35.2c-5.9-4.9-7.5-13.2-3.8-19.9c0 0 0 0 0 0s0 0 0 0s0 0 0 0l.1-.1 .3-.6c.3-.5 .7-1.3 1.2-2.3c1-2 2.6-5 4.4-8.6c.5-.9 .9-1.9 1.4-2.9C167.1 254.6 144 218 144 176s23.1-78.6 57.3-97.8c-.5-1-1-2-1.4-2.9c-1.8-3.7-3.3-6.6-4.4-8.6c-.5-1-.9-1.8-1.2-2.3l-.3-.6-.1-.1s0 0 0 0s0 0 0 0s0 0 0 0c-3.6-6.7-2-15 3.8-19.9l48-40zM220.2 122.9c-17 11.5-28.2 31-28.2 53.1s11.2 41.6 28.2 53.1C227 210.2 232 190.9 232 176s-5-34.2-11.8-53.1zm71.5 106.2c17-11.5 28.2-31 28.2-53.1s-11.2-41.6-28.2-53.1C285 141.8 280 161.1 280 176s5 34.2 11.8 53.1z"]
};
const faSliders = {
  prefix: 'fas',
  iconName: 'sliders',
  icon: [512, 512, ["sliders-h"], "f1de", "M0 416c0 17.7 14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384c-17.7 0-32 14.3-32 32zm128 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32-80c-32.8 0-61 19.7-73.3 48L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm73.3-64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64z"]
};
const faSlidersH = faSliders;
const faFolderTree = {
  prefix: 'fas',
  iconName: 'folder-tree',
  icon: [576, 512, [], "f802", "M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32l0 96L0 384c0 35.3 28.7 64 64 64l192 0 0-64L64 384l0-224 192 0 0-64L64 96l0-64zM288 192c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4L409.4 9.4c-6-6-14.1-9.4-22.6-9.4L320 0c-17.7 0-32 14.3-32 32l0 160zm0 288c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4l-13.3-13.3c-6-6-14.1-9.4-22.6-9.4L320 288c-17.7 0-32 14.3-32 32l0 160z"]
};
const faNetworkWired = {
  prefix: 'fas',
  iconName: 'network-wired',
  icon: [640, 512, [], "f6ff", "M256 64l128 0 0 64-128 0 0-64zM240 0c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48l48 0 0 32L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 0 32-48 0c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48l160 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-48 0 0-32 256 0 0 32-48 0c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48l160 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-48 0 0-32 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-256 0 0-32 48 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48L240 0zM96 448l0-64 128 0 0 64L96 448zm320-64l128 0 0 64-128 0 0-64z"]
};
const faMapPin = {
  prefix: 'fas',
  iconName: 'map-pin',
  icon: [320, 512, [128205], "f276", "M16 144a144 144 0 1 1 288 0A144 144 0 1 1 16 144zM160 80c8.8 0 16-7.2 16-16s-7.2-16-16-16c-53 0-96 43-96 96c0 8.8 7.2 16 16 16s16-7.2 16-16c0-35.3 28.7-64 64-64zM128 480l0-162.9c10.4 1.9 21.1 2.9 32 2.9s21.6-1 32-2.9L192 480c0 17.7-14.3 32-32 32s-32-14.3-32-32z"]
};
const faHamsa = {
  prefix: 'fas',
  iconName: 'hamsa',
  icon: [512, 512, [], "f665", "M34.6 288L80 288c8.8 0 16-7.2 16-16L96 72c0-22.1 17.9-40 40-40s40 17.9 40 40l0 132c0 11 9 20 20 20s20-9 20-20l0-164c0-22.1 17.9-40 40-40s40 17.9 40 40l0 164c0 11 9 20 20 20s20-9 20-20l0-132c0-22.1 17.9-40 40-40s40 17.9 40 40l0 200c0 8.8 7.2 16 16 16l45.4 0c19.1 0 34.6 15.5 34.6 34.6c0 8.6-3.2 16.9-9 23.3L416.6 441c-41.1 45.2-99.4 71-160.6 71s-119.4-25.8-160.6-71L9 345.9c-5.8-6.4-9-14.7-9-23.3C0 303.5 15.5 288 34.6 288zM256 288c-38.4 0-76.8 35.8-90.6 50.2c-3.6 3.7-5.4 8.7-5.4 13.8s1.8 10.1 5.4 13.8C179.2 380.2 217.6 416 256 416s76.8-35.8 90.6-50.2c3.6-3.7 5.4-8.7 5.4-13.8s-1.8-10.1-5.4-13.8C332.8 323.8 294.4 288 256 288zm0 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faCentSign = {
  prefix: 'fas',
  iconName: 'cent-sign',
  icon: [384, 512, [], "e3f5", "M224 0c17.7 0 32 14.3 32 32l0 34.7c30.9 5.2 59.2 17.7 83.2 35.8c14.1 10.6 17 30.7 6.4 44.8s-30.7 17-44.8 6.4C279.4 137.5 252.9 128 224 128c-70.7 0-128 57.3-128 128s57.3 128 128 128c28.9 0 55.4-9.5 76.8-25.6c14.1-10.6 34.2-7.8 44.8 6.4s7.8 34.2-6.4 44.8c-24 18-52.4 30.6-83.2 35.8l0 34.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-34.7C101.2 430.1 32 351.1 32 256s69.2-174.1 160-189.3L192 32c0-17.7 14.3-32 32-32z"]
};
const faFlask = {
  prefix: 'fas',
  iconName: 'flask',
  icon: [448, 512, [], "f0c3", "M288 0L160 0 128 0C110.3 0 96 14.3 96 32s14.3 32 32 32l0 132.8c0 11.8-3.3 23.5-9.5 33.5L10.3 406.2C3.6 417.2 0 429.7 0 442.6C0 480.9 31.1 512 69.4 512l309.2 0c38.3 0 69.4-31.1 69.4-69.4c0-12.8-3.6-25.4-10.3-36.4L329.5 230.4c-6.2-10.1-9.5-21.7-9.5-33.5L320 64c17.7 0 32-14.3 32-32s-14.3-32-32-32L288 0zM192 196.8L192 64l64 0 0 132.8c0 23.7 6.6 46.9 19 67.1L309.5 320l-171 0L173 263.9c12.4-20.2 19-43.4 19-67.1z"]
};
const faPersonPregnant = {
  prefix: 'fas',
  iconName: 'person-pregnant',
  icon: [384, 512, [], "e31e", "M192 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM120 383c-13.8-3.6-24-16.1-24-31l0-55.1-4.6 7.6c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c15-24.9 40.3-41.5 68.7-45.6c4.1-.6 8.2-1 12.5-1l1.1 0 12.5 0 2.4 0c1.4 0 2.8 .1 4.1 .3c35.7 2.9 65.4 29.3 72.1 65l6.1 32.5c44.3 8.6 77.7 47.5 77.7 94.3l0 32c0 17.7-14.3 32-32 32l-16 0-40 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-8 0-8 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-97z"]
};
const faWandSparkles = {
  prefix: 'fas',
  iconName: 'wand-sparkles',
  icon: [512, 512, [], "f72b", "M464 6.1c9.5-8.5 24-8.1 33 .9l8 8c9 9 9.4 23.5 .9 33l-85.8 95.9c-2.6 2.9-4.1 6.7-4.1 10.7l0 21.4c0 8.8-7.2 16-16 16l-15.8 0c-4.6 0-8.9 1.9-11.9 5.3L100.7 500.9C94.3 508 85.3 512 75.8 512c-8.8 0-17.3-3.5-23.5-9.8L9.7 459.7C3.5 453.4 0 445 0 436.2c0-9.5 4-18.5 11.1-24.8l111.6-99.8c3.4-3 5.3-7.4 5.3-11.9l0-27.6c0-8.8 7.2-16 16-16l34.6 0c3.9 0 7.7-1.5 10.7-4.1L464 6.1zM432 288c3.6 0 6.7 2.4 7.7 5.8l14.8 51.7 51.7 14.8c3.4 1 5.8 4.1 5.8 7.7s-2.4 6.7-5.8 7.7l-51.7 14.8-14.8 51.7c-1 3.4-4.1 5.8-7.7 5.8s-6.7-2.4-7.7-5.8l-14.8-51.7-51.7-14.8c-3.4-1-5.8-4.1-5.8-7.7s2.4-6.7 5.8-7.7l51.7-14.8 14.8-51.7c1-3.4 4.1-5.8 7.7-5.8zM87.7 69.8l14.8 51.7 51.7 14.8c3.4 1 5.8 4.1 5.8 7.7s-2.4 6.7-5.8 7.7l-51.7 14.8L87.7 218.2c-1 3.4-4.1 5.8-7.7 5.8s-6.7-2.4-7.7-5.8L57.5 166.5 5.8 151.7c-3.4-1-5.8-4.1-5.8-7.7s2.4-6.7 5.8-7.7l51.7-14.8L72.3 69.8c1-3.4 4.1-5.8 7.7-5.8s6.7 2.4 7.7 5.8zM208 0c3.7 0 6.9 2.5 7.8 6.1l6.8 27.3 27.3 6.8c3.6 .9 6.1 4.1 6.1 7.8s-2.5 6.9-6.1 7.8l-27.3 6.8-6.8 27.3c-.9 3.6-4.1 6.1-7.8 6.1s-6.9-2.5-7.8-6.1l-6.8-27.3-27.3-6.8c-3.6-.9-6.1-4.1-6.1-7.8s2.5-6.9 6.1-7.8l27.3-6.8 6.8-27.3c.9-3.6 4.1-6.1 7.8-6.1z"]
};
const faEllipsisVertical = {
  prefix: 'fas',
  iconName: 'ellipsis-vertical',
  icon: [128, 512, ["ellipsis-v"], "f142", "M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"]
};
const faEllipsisV = faEllipsisVertical;
const faTicket = {
  prefix: 'fas',
  iconName: 'ticket',
  icon: [576, 512, [127903], "f145", "M64 64C28.7 64 0 92.7 0 128l0 64c0 8.8 7.4 15.7 15.7 18.6C34.5 217.1 48 235 48 256s-13.5 38.9-32.3 45.4C7.4 304.3 0 311.2 0 320l0 64c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-64c0-8.8-7.4-15.7-15.7-18.6C541.5 294.9 528 277 528 256s13.5-38.9 32.3-45.4c8.3-2.9 15.7-9.8 15.7-18.6l0-64c0-35.3-28.7-64-64-64L64 64zm64 112l0 160c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16l0-160c0-8.8-7.2-16-16-16l-288 0c-8.8 0-16 7.2-16 16zM96 160c0-17.7 14.3-32 32-32l320 0c17.7 0 32 14.3 32 32l0 192c0 17.7-14.3 32-32 32l-320 0c-17.7 0-32-14.3-32-32l0-192z"]
};
const faPowerOff = {
  prefix: 'fas',
  iconName: 'power-off',
  icon: [512, 512, [9211], "f011", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 224c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224zM143.5 120.6c13.6-11.3 15.4-31.5 4.1-45.1s-31.5-15.4-45.1-4.1C49.7 115.4 16 181.8 16 256c0 132.5 107.5 240 240 240s240-107.5 240-240c0-74.2-33.8-140.6-86.6-184.6c-13.6-11.3-33.8-9.4-45.1 4.1s-9.4 33.8 4.1 45.1c38.9 32.3 63.5 81 63.5 135.4c0 97.2-78.8 176-176 176s-176-78.8-176-176c0-54.4 24.7-103.1 63.5-135.4z"]
};
const faRightLong = {
  prefix: 'fas',
  iconName: 'right-long',
  icon: [512, 512, ["long-arrow-alt-right"], "f30b", "M334.5 414c8.8 3.8 19 2 26-4.6l144-136c4.8-4.5 7.5-10.8 7.5-17.4s-2.7-12.9-7.5-17.4l-144-136c-7-6.6-17.2-8.4-26-4.6s-14.5 12.5-14.5 22l0 72L32 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l288 0 0 72c0 9.6 5.7 18.2 14.5 22z"]
};
const faLongArrowAltRight = faRightLong;
const faFlagUsa = {
  prefix: 'fas',
  iconName: 'flag-usa',
  icon: [448, 512, [], "f74d", "M32 0C49.7 0 64 14.3 64 32l0 16 69-17.2c38.1-9.5 78.3-5.1 113.5 12.5c46.3 23.2 100.8 23.2 147.1 0l9.6-4.8C423.8 28.1 448 43.1 448 66.1l0 36.1-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-20.3-9-41.8-14.7-63.6-16.9l0 32.2c17.4 2.1 34.4 6.7 50.6 13.9l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4L448 136.3l0 62-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-40.2-17.9-85-22.5-128.1-13.3L64 203.1l0 32.7 70.2-15.1c36.4-7.8 74.3-3.9 108.4 11.3l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4L448 232.3l0 62-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-40.2-17.9-85-22.5-128.1-13.3L64 299.1l0 32.7 70.2-15.1c36.4-7.8 74.3-3.9 108.4 11.3l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4L448 328.3l0 33.5c0 13.3-8.3 25.3-20.8 30l-34.7 13c-46.2 17.3-97.6 14.6-141.7-7.4c-37.9-19-81.3-23.7-122.5-13.4L64 400l0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64 0-70.5 0-32.7 0-63.3 0-32.7 0-63.3 0-32.7L0 64 0 32C0 14.3 14.3 0 32 0zm80 96A16 16 0 1 0 80 96a16 16 0 1 0 32 0zm32 0a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-32 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm32 0a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faLaptopFile = {
  prefix: 'fas',
  iconName: 'laptop-file',
  icon: [640, 512, [], "e51d", "M128 0C92.7 0 64 28.7 64 64l0 224-44.8 0C8.6 288 0 296.6 0 307.2C0 349.6 34.4 384 76.8 384L320 384l0-96-192 0 0-224 320 0 0 32 64 0 0-32c0-35.3-28.7-64-64-64L128 0zM512 128l-112 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l192 0c26.5 0 48-21.5 48-48l0-208-96 0c-17.7 0-32-14.3-32-32l0-96zm32 0l0 96 96 0-96-96z"]
};
const faTty = {
  prefix: 'fas',
  iconName: 'tty',
  icon: [512, 512, ["teletype"], "f1e4", "M38.3 241.3L15.1 200.6c-9.2-16.2-8.4-36.5 4.5-50C61.4 106.8 144.7 48 256 48s194.6 58.8 236.4 102.6c12.9 13.5 13.7 33.8 4.5 50l-23.1 40.7c-7.5 13.2-23.3 19.3-37.8 14.6l-81.1-26.6c-13.1-4.3-22-16.6-22-30.4l0-54.8c-49.6-18.1-104-18.1-153.6 0l0 54.8c0 13.8-8.9 26.1-22 30.4L76.1 255.8c-14.5 4.7-30.3-1.4-37.8-14.6zM32 336c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm0 96c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM144 320l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM128 432c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-32z"]
};
const faTeletype = faTty;
const faDiagramNext = {
  prefix: 'fas',
  iconName: 'diagram-next',
  icon: [512, 512, [], "e476", "M512 160c0 35.3-28.7 64-64 64l-168 0 0 64 46.1 0c21.4 0 32.1 25.9 17 41L273 399c-9.4 9.4-24.6 9.4-33.9 0L169 329c-15.1-15.1-4.4-41 17-41l46.1 0 0-64L64 224c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 64zM448 416l0-64-82.7 0 .4-.4c18.4-18.4 20.4-43.7 11-63.6l71.3 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l71.3 0c-9.4 19.9-7.4 45.2 11 63.6l.4 .4L64 352l0 64 146.7 0 5.7 5.7c21.9 21.9 57.3 21.9 79.2 0l5.7-5.7L448 416z"]
};
const faPersonRifle = {
  prefix: 'fas',
  iconName: 'person-rifle',
  icon: [576, 512, [], "e54e", "M265.2 192c25.4 0 49.8 7.1 70.8 19.9L336 512l-192 0 0-174.3L90.4 428.3c-11.2 19-35.8 25.3-54.8 14.1s-25.3-35.8-14.1-54.8L97.7 258.8c24.5-41.4 69-66.8 117.1-66.8l50.4 0zM160 80a80 80 0 1 1 160 0A80 80 0 1 1 160 80zM448 0c8.8 0 16 7.2 16 16l0 116.3c9.6 5.5 16 15.9 16 27.7l0 109.3 16-5.3 0-56c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 84.5c0 6.9-4.4 13-10.9 15.2L480 325.3l0 26.7 48 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-44 0 23 92.1c2.5 10.1-5.1 19.9-15.5 19.9L432 512c-8.8 0-16-7.2-16-16l0-96-16 0c-17.7 0-32-14.3-32-32l0-144c0-17.7 14.3-32 32-32l0-32c0-11.8 6.4-22.2 16-27.7L416 32c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 16 0z"]
};
const faHouseMedicalCircleExclamation = {
  prefix: 'fas',
  iconName: 'house-medical-circle-exclamation',
  icon: [640, 512, [], "e512", "M320 368c0 59.5 29.5 112.1 74.8 144l-266.7 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L522.1 193.9c-8.5-1.3-17.3-1.9-26.1-1.9c-54.7 0-103.5 24.9-135.8 64L320 256l0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z"]
};
const faClosedCaptioning = {
  prefix: 'fas',
  iconName: 'closed-captioning',
  icon: [576, 512, [], "f20a", "M0 96C0 60.7 28.7 32 64 32l448 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM200 208c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48s21.5-48 48-48zm144 48c0-26.5 21.5-48 48-48c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48z"]
};
const faPersonHiking = {
  prefix: 'fas',
  iconName: 'person-hiking',
  icon: [384, 512, ["hiking"], "f6ec", "M192 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm51.3 182.7L224.2 307l49.7 49.7c9 9 14.1 21.2 14.1 33.9l0 89.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-82.7-73.9-73.9c-15.8-15.8-22.2-38.6-16.9-60.3l20.4-84c8.3-34.1 42.7-54.9 76.7-46.4c19 4.8 35.6 16.4 46.4 32.7L305.1 208l30.9 0 0-24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 55.8c0 .1 0 .2 0 .2s0 .2 0 .2L384 488c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-216-39.4 0c-16 0-31-8-39.9-21.4l-13.3-20zM81.1 471.9L117.3 334c3 4.2 6.4 8.2 10.1 11.9l41.9 41.9L142.9 488.1c-4.5 17.1-22 27.3-39.1 22.8s-27.3-22-22.8-39.1zm55.5-346L101.4 266.5c-3 12.1-14.9 19.9-27.2 17.9l-47.9-8c-14-2.3-22.9-16.3-19.2-30L31.9 155c9.5-34.8 41.1-59 77.2-59l4.2 0c15.6 0 27.1 14.7 23.3 29.8z"]
};
const faHiking = faPersonHiking;
const faVenusDouble = {
  prefix: 'fas',
  iconName: 'venus-double',
  icon: [640, 512, [9890], "f226", "M192 288a112 112 0 1 0 0-224 112 112 0 1 0 0 224zM368 176c0 86.3-62.1 158.1-144 173.1l0 34.9 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-34.9C78.1 334.1 16 262.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176zM344 318c14.6-15.6 26.8-33.4 36-53c18.8 14.4 42.4 23 68 23c61.9 0 112-50.1 112-112s-50.1-112-112-112c-25.6 0-49.1 8.6-68 23c-9.3-19.5-21.5-37.4-36-53C373.1 12.6 409.1 0 448 0c97.2 0 176 78.8 176 176c0 86.3-62.1 158.1-144 173.1l0 34.9 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-34.9c-26.6-4.9-51.1-15.7-72-31.1z"]
};
const faImages = {
  prefix: 'fas',
  iconName: 'images',
  icon: [576, 512, [], "f302", "M160 32c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32zM396 138.7l96 144c4.9 7.4 5.4 16.8 1.2 24.6S480.9 320 472 320l-144 0-48 0-80 0c-9.2 0-17.6-5.3-21.6-13.6s-2.9-18.2 2.9-25.4l64-80c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l17.3 21.6 56-84C360.5 132 368 128 376 128s15.5 4 20 10.7zM192 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 344c0 75.1 60.9 136 136 136l320 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-320 0c-48.6 0-88-39.4-88-88l0-224z"]
};
const faCalculator = {
  prefix: 'fas',
  iconName: 'calculator',
  icon: [384, 512, [128425], "f1ec", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM96 64l192 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L96 160c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32zm32 160a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zM96 352a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM64 416c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32zM192 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm32 64a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm64-64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm32 64a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zM288 448a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"]
};
const faPeoplePulling = {
  prefix: 'fas',
  iconName: 'people-pulling',
  icon: [576, 512, [], "e535", "M80 96A48 48 0 1 0 80 0a48 48 0 1 0 0 96zM64 128c-35.3 0-64 28.7-64 64L0 320c0 17.7 14.3 32 32 32c9.8 0 18.5-4.4 24.4-11.2L80.4 485.3c2.9 17.4 19.4 29.2 36.8 26.3s29.2-19.4 26.3-36.8L123.1 352l15.7 0 30 134.9c3.8 17.3 20.9 28.1 38.2 24.3s28.1-20.9 24.3-38.2l-57.3-258 116.3 53.8c.5 .3 1.1 .5 1.6 .7c8.6 3.6 18 3.1 25.9-.7c3.4-1.6 6.6-3.9 9.3-6.7c3.1-3.2 5.5-7 7.1-11.4c.1-.3 .2-.7 .3-1l2.5-7.5c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L537 232.7l-15.3-36.8C504.5 154.8 464.3 128 419.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-24.4 10.9-44.6 29-58.1 51.6L157.3 136.9C144.7 131 130.9 128 117 128l-53 0zM464 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM349.7 335.6l-25 62.4-59.4 59.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L372.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6z"]
};
const faN = {
  prefix: 'fas',
  iconName: 'n',
  icon: [384, 512, [110], "4e", "M21.1 33.9c12.7-4.6 26.9-.7 35.5 9.6L320 359.6 320 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 384c0 13.5-8.4 25.5-21.1 30.1s-26.9 .7-35.5-9.6L64 152.4 64 448c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 64C0 50.5 8.4 38.5 21.1 33.9z"]
};
const faCableCar = {
  prefix: 'fas',
  iconName: 'cable-car',
  icon: [512, 512, [128673, 57551, "tram"], "f7da", "M288 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM160 56a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM32 288c0-35.3 28.7-64 64-64l136 0 0-66.5-203.1 42c-13 2.7-25.7-5.7-28.4-18.6s5.7-25.7 18.6-28.4l232-48 232-48c13-2.7 25.7 5.7 28.4 18.6s-5.7 25.7-18.6 28.4L280 147.5l0 76.5 136 0c35.3 0 64 28.7 64 64l0 160c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-160zm64 0c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-64 0zm112 16l0 64c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-64 0z"]
};
const faTram = faCableCar;
const faCloudRain = {
  prefix: 'fas',
  iconName: 'cloud-rain',
  icon: [512, 512, [127783, 9926], "f73d", "M96 320c-53 0-96-43-96-96c0-42.5 27.6-78.6 65.9-91.2C64.7 126.1 64 119.1 64 112C64 50.1 114.1 0 176 0c43.1 0 80.5 24.3 99.2 60c14.7-17.1 36.5-28 60.8-28c44.2 0 80 35.8 80 80c0 5.5-.6 10.8-1.6 16c.5 0 1.1 0 1.6 0c53 0 96 43 96 96s-43 96-96 96L96 320zm-6.8 52c1.3-2.5 3.9-4 6.8-4s5.4 1.5 6.8 4l35.1 64.6c4.1 7.5 6.2 15.8 6.2 24.3l0 3c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-3c0-8.5 2.1-16.9 6.2-24.3L89.2 372zm160 0c1.3-2.5 3.9-4 6.8-4s5.4 1.5 6.8 4l35.1 64.6c4.1 7.5 6.2 15.8 6.2 24.3l0 3c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-3c0-8.5 2.1-16.9 6.2-24.3L249.2 372zm124.9 64.6L409.2 372c1.3-2.5 3.9-4 6.8-4s5.4 1.5 6.8 4l35.1 64.6c4.1 7.5 6.2 15.8 6.2 24.3l0 3c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-3c0-8.5 2.1-16.9 6.2-24.3z"]
};
const faBuildingCircleXmark = {
  prefix: 'fas',
  iconName: 'building-circle-xmark',
  icon: [640, 512, [], "e4d4", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c15.1 0 28.5-6.9 37.3-17.8C340.4 462.2 320 417.5 320 368c0-54.7 24.9-103.5 64-135.8L384 48c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faShip = {
  prefix: 'fas',
  iconName: 'ship',
  icon: [576, 512, [128674], "f21a", "M192 32c0-17.7 14.3-32 32-32L352 0c17.7 0 32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 128 44.4 14.8c23.1 7.7 29.5 37.5 11.5 53.9l-101 92.6c-16.2 9.4-34.7 15.1-50.9 15.1c-19.6 0-40.8-7.7-59.2-20.3c-22.1-15.5-51.6-15.5-73.7 0c-17.1 11.8-38 20.3-59.2 20.3c-16.2 0-34.7-5.7-50.9-15.1l-101-92.6c-18-16.5-11.6-46.2 11.5-53.9L96 240l0-128c0-26.5 21.5-48 48-48l48 0 0-32zM160 218.7l107.8-35.9c13.1-4.4 27.3-4.4 40.5 0L416 218.7l0-90.7-256 0 0 90.7zM306.5 421.9C329 437.4 356.5 448 384 448c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 501.7 417 512 384 512c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 437.2 165.1 448 192 448c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faArrowsDownToLine = {
  prefix: 'fas',
  iconName: 'arrows-down-to-line',
  icon: [576, 512, [], "e4b8", "M544 416L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32zm22.6-137.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L480 274.7 480 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7-41.4-41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96zm-320-45.3c-12.5-12.5-32.8-12.5-45.3 0L160 274.7 160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7L54.6 233.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3z"]
};
const faDownload = {
  prefix: 'fas',
  iconName: 'download',
  icon: [512, 512, [], "f019", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faFaceGrin = {
  prefix: 'fas',
  iconName: 'face-grin',
  icon: [512, 512, [128512, "grin"], "f580", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGrin = faFaceGrin;
const faDeleteLeft = {
  prefix: 'fas',
  iconName: 'delete-left',
  icon: [576, 512, [9003, "backspace"], "f55a", "M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faBackspace = faDeleteLeft;
const faEyeDropper = {
  prefix: 'fas',
  iconName: 'eye-dropper',
  icon: [512, 512, ["eye-dropper-empty", "eyedropper"], "f1fb", "M341.6 29.2L240.1 130.8l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4L482.8 170.4c39-39 39-102.2 0-141.1s-102.2-39-141.1 0zM55.4 323.3c-15 15-23.4 35.4-23.4 56.6l0 42.4L5.4 462.2c-8.5 12.7-6.8 29.6 4 40.4s27.7 12.5 40.4 4L89.7 480l42.4 0c21.2 0 41.6-8.4 56.6-23.4L309.4 335.9l-45.3-45.3L143.4 411.3c-3 3-7.1 4.7-11.3 4.7L96 416l0-36.1c0-4.2 1.7-8.3 4.7-11.3L221.4 247.9l-45.3-45.3L55.4 323.3z"]
};
const faEyeDropperEmpty = faEyeDropper;
const faEyedropper = faEyeDropper;
const faFileCircleCheck = {
  prefix: 'fas',
  iconName: 'file-circle-check',
  icon: [576, 512, [], "e5a0", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L416 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faForward = {
  prefix: 'fas',
  iconName: 'forward',
  icon: [512, 512, [9193], "f04e", "M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416L0 96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3l0 41.7 0 41.7L52.5 440.6zM256 352l0-96 0-128 0-32c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29l0-64z"]
};
const faMobile = {
  prefix: 'fas',
  iconName: 'mobile',
  icon: [384, 512, [128241, "mobile-android", "mobile-phone"], "f3ce", "M80 0C44.7 0 16 28.7 16 64l0 384c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L80 0zm80 432l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faMobileAndroid = faMobile;
const faMobilePhone = faMobile;
const faFaceMeh = {
  prefix: 'fas',
  iconName: 'face-meh',
  icon: [512, 512, [128528, "meh"], "f11a", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM176.4 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM160 336l192 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faMeh = faFaceMeh;
const faAlignCenter = {
  prefix: 'fas',
  iconName: 'align-center',
  icon: [448, 512, [], "f037", "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"]
};
const faBookSkull = {
  prefix: 'fas',
  iconName: 'book-skull',
  icon: [448, 512, ["book-dead"], "f6b7", "M0 96C0 43 43 0 96 0L384 0l32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32zM320 112c0-35.3-35.8-64-80-64s-80 28.7-80 64c0 20.9 12.6 39.5 32 51.2l0 12.8c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16l0-12.8c19.4-11.7 32-30.3 32-51.2zM208 96a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM134.3 209.3c-8.1-3.5-17.5 .3-21 8.4s.3 17.5 8.4 21L199.4 272l-77.7 33.3c-8.1 3.5-11.9 12.9-8.4 21s12.9 11.9 21 8.4L240 289.4l105.7 45.3c8.1 3.5 17.5-.3 21-8.4s-.3-17.5-8.4-21L280.6 272l77.7-33.3c8.1-3.5 11.9-12.9 8.4-21s-12.9-11.9-21-8.4L240 254.6 134.3 209.3z"]
};
const faBookDead = faBookSkull;
const faIdCard = {
  prefix: 'fas',
  iconName: 'id-card',
  icon: [576, 512, [62147, "drivers-license"], "f2c2", "M0 96l576 0c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96zm0 32L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-288L0 128zM64 405.3c0-29.5 23.9-53.3 53.3-53.3l117.3 0c29.5 0 53.3 23.9 53.3 53.3c0 5.9-4.8 10.7-10.7 10.7L74.7 416c-5.9 0-10.7-4.8-10.7-10.7zM176 192a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm176 16c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16z"]
};
const faDriversLicense = faIdCard;
const faOutdent = {
  prefix: 'fas',
  iconName: 'outdent',
  icon: [448, 512, ["dedent"], "f03b", "M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM.2 268.6c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6l0 158.6c0 13.3-15.3 20.8-25.8 12.6L.2 268.6z"]
};
const faDedent = faOutdent;
const faHeartCircleExclamation = {
  prefix: 'fas',
  iconName: 'heart-circle-exclamation',
  icon: [576, 512, [], "e4fe", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faHouse = {
  prefix: 'fas',
  iconName: 'house',
  icon: [576, 512, [127968, 63498, 63500, "home", "home-alt", "home-lg-alt"], "f015", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c0 2.7-.2 5.4-.5 8.1l0 16.2c0 22.1-17.9 40-40 40l-16 0c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1L416 512l-24 0c-22.1 0-40-17.9-40-40l0-24 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"]
};
const faHome = faHouse;
const faHomeAlt = faHouse;
const faHomeLgAlt = faHouse;
const faCalendarWeek = {
  prefix: 'fas',
  iconName: 'calendar-week',
  icon: [448, 512, [], "f784", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm80 64c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16L80 256z"]
};
const faLaptopMedical = {
  prefix: 'fas',
  iconName: 'laptop-medical',
  icon: [640, 512, [], "f812", "M64 96c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 256-64 0 0-256L128 96l0 256-64 0L64 96zM0 403.2C0 392.6 8.6 384 19.2 384l601.6 0c10.6 0 19.2 8.6 19.2 19.2c0 42.4-34.4 76.8-76.8 76.8L76.8 480C34.4 480 0 445.6 0 403.2zM288 160c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faB = {
  prefix: 'fas',
  iconName: 'b',
  icon: [320, 512, [98], "42", "M64 32C28.7 32 0 60.7 0 96L0 256 0 416c0 35.3 28.7 64 64 64l128 0c70.7 0 128-57.3 128-128c0-46.5-24.8-87.3-62-109.7c18.7-22.3 30-51 30-82.3c0-70.7-57.3-128-128-128L64 32zm96 192l-96 0L64 96l96 0c35.3 0 64 28.7 64 64s-28.7 64-64 64zM64 288l96 0 32 0c35.3 0 64 28.7 64 64s-28.7 64-64 64L64 416l0-128z"]
};
const faFileMedical = {
  prefix: 'fas',
  iconName: 'file-medical',
  icon: [384, 512, [], "f477", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM160 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faDiceOne = {
  prefix: 'fas',
  iconName: 'dice-one',
  icon: [448, 512, [9856], "f525", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM224 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faKiwiBird = {
  prefix: 'fas',
  iconName: 'kiwi-bird',
  icon: [576, 512, [], "f535", "M291.2 388.4c31.2-18.8 64.7-36.4 101.1-36.4l55.7 0c4.6 0 9.1-.2 13.6-.7l85.3 121.9c4 5.7 11.3 8.2 17.9 6.1s11.2-8.3 11.2-15.3l0-240c0-70.7-57.3-128-128-128l-55.7 0c-36.4 0-69.9-17.6-101.1-36.4C262.3 42.1 228.3 32 192 32C86 32 0 118 0 224c0 71.1 38.6 133.1 96 166.3L96 456c0 13.3 10.7 24 24 24s24-10.7 24-24l0-46c15.3 3.9 31.4 6 48 6c5.4 0 10.7-.2 16-.7l0 40.7c0 13.3 10.7 24 24 24s24-10.7 24-24l0-50.9c12.4-4.4 24.2-10 35.2-16.7zM448 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faArrowRightArrowLeft = {
  prefix: 'fas',
  iconName: 'arrow-right-arrow-left',
  icon: [448, 512, [8644, "exchange"], "f0ec", "M438.6 150.6c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.7 96 32 96C14.3 96 0 110.3 0 128s14.3 32 32 32l306.7 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l96-96zm-333.3 352c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 416 416 416c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96z"]
};
const faExchange = faArrowRightArrowLeft;
const faRotateRight = {
  prefix: 'fas',
  iconName: 'rotate-right',
  icon: [512, 512, ["redo-alt", "rotate-forward"], "f2f9", "M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"]
};
const faRedoAlt = faRotateRight;
const faRotateForward = faRotateRight;
const faUtensils = {
  prefix: 'fas',
  iconName: 'utensils',
  icon: [448, 512, [127860, 61685, "cutlery"], "f2e7", "M416 0C400 0 288 32 288 176l0 112c0 35.3 28.7 64 64 64l32 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 0-112 0-208c0-17.7-14.3-32-32-32zM64 16C64 7.8 57.9 1 49.7 .1S34.2 4.6 32.4 12.5L2.1 148.8C.7 155.1 0 161.5 0 167.9c0 45.9 35.1 83.6 80 87.7L80 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224.4c44.9-4.1 80-41.8 80-87.7c0-6.4-.7-12.8-2.1-19.1L191.6 12.5c-1.8-8-9.3-13.3-17.4-12.4S160 7.8 160 16l0 134.2c0 5.4-4.4 9.8-9.8 9.8c-5.1 0-9.3-3.9-9.8-9L127.9 14.6C127.2 6.3 120.3 0 112 0s-15.2 6.3-15.9 14.6L83.7 151c-.5 5.1-4.7 9-9.8 9c-5.4 0-9.8-4.4-9.8-9.8L64 16zm48.3 152l-.3 0-.3 0 .3-.7 .3 .7z"]
};
const faCutlery = faUtensils;
const faArrowUpWideShort = {
  prefix: 'fas',
  iconName: 'arrow-up-wide-short',
  icon: [576, 512, ["sort-amount-up"], "f161", "M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 480l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32z"]
};
const faSortAmountUp = faArrowUpWideShort;
const faMillSign = {
  prefix: 'fas',
  iconName: 'mill-sign',
  icon: [384, 512, [], "e1ed", "M302.1 42.8c5.9-16.6-2.7-35-19.4-40.9s-35 2.7-40.9 19.4L208 116.1c-5.7 4-11.1 8.5-16 13.5C171.7 108.9 143.3 96 112 96c-19.5 0-37.8 5-53.7 13.7C52.5 101.4 42.9 96 32 96C14.3 96 0 110.3 0 128l0 80L0 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-208c0-26.5 21.5-48 48-48s48 21.5 48 48l0 42.5L81.9 469.2c-5.9 16.6 2.7 35 19.4 40.9s35-2.7 40.9-19.4l21.4-60C168.9 441 179.6 448 192 448c17.7 0 32-14.3 32-32l0-154.5 35.7-100c3.9-1 8.1-1.6 12.3-1.6c26.5 0 48 21.5 48 48l0 208c0 17.7 14.3 32 32 32s32-14.3 32-32l0-208c0-58.2-44.3-106-101.1-111.5l19.2-53.8z"]
};
const faBowlRice = {
  prefix: 'fas',
  iconName: 'bowl-rice',
  icon: [512, 512, [], "e2eb", "M176 56c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm24 48l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM56 176l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM0 283.4C0 268.3 12.3 256 27.4 256l457.1 0c15.1 0 27.4 12.3 27.4 27.4c0 70.5-44.4 130.7-106.7 154.1L403.5 452c-2 16-15.6 28-31.8 28l-231.5 0c-16.1 0-29.8-12-31.8-28l-1.8-14.4C44.4 414.1 0 353.9 0 283.4zM224 200c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm-96 0c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm-24-96l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm216 96c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm-24-96l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm120 96c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm-24-96l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM296 32l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faSkull = {
  prefix: 'fas',
  iconName: 'skull',
  icon: [512, 512, [128128], "f54c", "M416 398.9c58.5-41.1 96-104.1 96-174.9C512 100.3 397.4 0 256 0S0 100.3 0 224c0 70.7 37.5 133.8 96 174.9c0 .4 0 .7 0 1.1l0 64c0 26.5 21.5 48 48 48l48 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16l0 48 64 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16l0 48 48 0c26.5 0 48-21.5 48-48l0-64c0-.4 0-.7 0-1.1zM96 256a64 64 0 1 1 128 0A64 64 0 1 1 96 256zm256-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faTowerBroadcast = {
  prefix: 'fas',
  iconName: 'tower-broadcast',
  icon: [576, 512, ["broadcast-tower"], "f519", "M80.3 44C69.8 69.9 64 98.2 64 128s5.8 58.1 16.3 84c6.6 16.4-1.3 35-17.7 41.7s-35-1.3-41.7-17.7C7.4 202.6 0 166.1 0 128S7.4 53.4 20.9 20C27.6 3.6 46.2-4.3 62.6 2.3S86.9 27.6 80.3 44zM555.1 20C568.6 53.4 576 89.9 576 128s-7.4 74.6-20.9 108c-6.6 16.4-25.3 24.3-41.7 17.7S489.1 228.4 495.7 212c10.5-25.9 16.3-54.2 16.3-84s-5.8-58.1-16.3-84C489.1 27.6 497 9 513.4 2.3s35 1.3 41.7 17.7zM352 128c0 23.7-12.9 44.4-32 55.4L320 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-296.6c-19.1-11.1-32-31.7-32-55.4c0-35.3 28.7-64 64-64s64 28.7 64 64zM170.6 76.8C163.8 92.4 160 109.7 160 128s3.8 35.6 10.6 51.2c7.1 16.2-.3 35.1-16.5 42.1s-35.1-.3-42.1-16.5c-10.3-23.6-16-49.6-16-76.8s5.7-53.2 16-76.8c7.1-16.2 25.9-23.6 42.1-16.5s23.6 25.9 16.5 42.1zM464 51.2c10.3 23.6 16 49.6 16 76.8s-5.7 53.2-16 76.8c-7.1 16.2-25.9 23.6-42.1 16.5s-23.6-25.9-16.5-42.1c6.8-15.6 10.6-32.9 10.6-51.2s-3.8-35.6-10.6-51.2c-7.1-16.2 .3-35.1 16.5-42.1s35.1 .3 42.1 16.5z"]
};
const faBroadcastTower = faTowerBroadcast;
const faTruckPickup = {
  prefix: 'fas',
  iconName: 'truck-pickup',
  icon: [640, 512, [128763], "f63c", "M368.6 96l76.8 96L288 192l0-96 80.6 0zM224 80l0 112L64 192c-17.7 0-32 14.3-32 32l0 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l33.1 0c-.7 5.2-1.1 10.6-1.1 16c0 61.9 50.1 112 112 112s112-50.1 112-112c0-5.4-.4-10.8-1.1-16l66.3 0c-.7 5.2-1.1 10.6-1.1 16c0 61.9 50.1 112 112 112s112-50.1 112-112c0-5.4-.4-10.8-1.1-16l33.1 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64c0-17.7-14.3-32-32-32l-48.6 0L418.6 56c-12.1-15.2-30.5-24-50-24L272 32c-26.5 0-48 21.5-48 48zm0 288a48 48 0 1 1 -96 0 48 48 0 1 1 96 0zm288 0a48 48 0 1 1 -96 0 48 48 0 1 1 96 0z"]
};
const faUpLong = {
  prefix: 'fas',
  iconName: 'up-long',
  icon: [320, 512, ["long-arrow-alt-up"], "f30c", "M318 177.5c3.8-8.8 2-19-4.6-26l-136-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-136 144c-6.6 7-8.4 17.2-4.6 26S14.4 192 24 192l72 0 0 288c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"]
};
const faLongArrowAltUp = faUpLong;
const faStop = {
  prefix: 'fas',
  iconName: 'stop',
  icon: [384, 512, [9209], "f04d", "M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"]
};
const faCodeMerge = {
  prefix: 'fas',
  iconName: 'code-merge',
  icon: [448, 512, [], "f387", "M80 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm32.4 97.2c28-12.4 47.6-40.5 47.6-73.2c0-44.2-35.8-80-80-80S0 35.8 0 80c0 32.8 19.7 61 48 73.3l0 205.3C19.7 371 0 399.2 0 432c0 44.2 35.8 80 80 80s80-35.8 80-80c0-32.8-19.7-61-48-73.3l0-86.6c26.7 20.1 60 32 96 32l86.7 0c12.3 28.3 40.5 48 73.3 48c44.2 0 80-35.8 80-80s-35.8-80-80-80c-32.8 0-61 19.7-73.3 48L208 240c-49.9 0-91-38.1-95.6-86.8zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM344 272a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faUpload = {
  prefix: 'fas',
  iconName: 'upload',
  icon: [512, 512, [], "f093", "M288 109.3L288 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-242.7-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352l128 0c0 35.3 28.7 64 64 64s64-28.7 64-64l128 0c35.3 0 64 28.7 64 64l0 32c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64l0-32c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faHurricane = {
  prefix: 'fas',
  iconName: 'hurricane',
  icon: [384, 512, [], "f751", "M0 208C0 104.4 75.7 18.5 174.9 2.6C184 1.2 192 8.6 192 17.9l0 63.3c0 8.4 6.5 15.3 14.7 16.5C307 112.5 384 199 384 303.4c0 103.6-75.7 189.5-174.9 205.4c-9.2 1.5-17.1-5.9-17.1-15.2l0-63.3c0-8.4-6.5-15.3-14.7-16.5C77 398.9 0 312.4 0 208zm288 48A96 96 0 1 0 96 256a96 96 0 1 0 192 0zm-96-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faMound = {
  prefix: 'fas',
  iconName: 'mound',
  icon: [576, 512, [], "e52d", "M144.1 179.2C173.8 127.7 228.6 96 288 96s114.2 31.7 143.9 83.2L540.4 368c12.3 21.3-3.1 48-27.7 48H63.3c-24.6 0-40-26.6-27.7-48L144.1 179.2z"]
};
const faToiletPortable = {
  prefix: 'fas',
  iconName: 'toilet-portable',
  icon: [320, 512, [], "e583", "M0 32L0 64l320 0 0-32c0-17.7-14.3-32-32-32L32 0C14.3 0 0 14.3 0 32zM24 96L0 96l0 24L0 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8 224 0 0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-368 0-24-24 0L24 96zM256 240l0 64c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16z"]
};
const faCompactDisc = {
  prefix: 'fas',
  iconName: 'compact-disc',
  icon: [512, 512, [128191, 128192, 128440], "f51f", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 32a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm-96-32a96 96 0 1 0 192 0 96 96 0 1 0 -192 0zM96 240c0-35 17.5-71.1 45.2-98.8S205 96 240 96c8.8 0 16-7.2 16-16s-7.2-16-16-16c-45.4 0-89.2 22.3-121.5 54.5S64 194.6 64 240c0 8.8 7.2 16 16 16s16-7.2 16-16z"]
};
const faFileArrowDown = {
  prefix: 'fas',
  iconName: 'file-arrow-down',
  icon: [384, 512, ["file-download"], "f56d", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM216 232l0 102.1 31-31c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-72 72c-9.4 9.4-24.6 9.4-33.9 0l-72-72c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l31 31L168 232c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faFileDownload = faFileArrowDown;
const faCaravan = {
  prefix: 'fas',
  iconName: 'caravan',
  icon: [640, 512, [], "f8ff", "M0 112C0 67.8 35.8 32 80 32l336 0c88.4 0 160 71.6 160 160l0 160 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0-288 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-44.2 0-80-35.8-80-80L0 112zM320 352l128 0 0-96-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l32 0 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 192zM96 128c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L96 128zm96 336a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faShieldCat = {
  prefix: 'fas',
  iconName: 'shield-cat',
  icon: [512, 512, [], "e572", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM160 154.4c0-5.8 4.7-10.4 10.4-10.4l.2 0c3.4 0 6.5 1.6 8.5 4.3l40 53.3c3 4 7.8 6.4 12.8 6.4l48 0c5 0 9.8-2.4 12.8-6.4l40-53.3c2-2.7 5.2-4.3 8.5-4.3l.2 0c5.8 0 10.4 4.7 10.4 10.4L352 272c0 53-43 96-96 96s-96-43-96-96l0-117.6zM216 288a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm96-16a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faBolt = {
  prefix: 'fas',
  iconName: 'bolt',
  icon: [448, 512, [9889, "zap"], "f0e7", "M349.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.9 1.8l-256 224c-10 8.8-13.6 22.9-8.9 35.3S50.7 288 64 288l111.5 0L98.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.9-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7l-111.5 0L349.4 44.6z"]
};
const faZap = faBolt;
const faGlassWater = {
  prefix: 'fas',
  iconName: 'glass-water',
  icon: [384, 512, [], "e4f4", "M32 0C23.1 0 14.6 3.7 8.6 10.2S-.6 25.4 .1 34.3L28.9 437.7c3 41.9 37.8 74.3 79.8 74.3l166.6 0c42 0 76.8-32.4 79.8-74.3L383.9 34.3c.6-8.9-2.4-17.6-8.5-24.1S360.9 0 352 0L32 0zM73 156.5L66.4 64l251.3 0L311 156.5l-24.2 12.1c-19.4 9.7-42.2 9.7-61.6 0c-20.9-10.4-45.5-10.4-66.4 0c-19.4 9.7-42.2 9.7-61.6 0L73 156.5z"]
};
const faOilWell = {
  prefix: 'fas',
  iconName: 'oil-well',
  icon: [576, 512, [], "e532", "M528.3 61.3c-11.4-42.7-55.3-68-98-56.6L414.9 8.8C397.8 13.4 387.7 31 392.3 48l24.5 91.4L308.5 167.5l-6.3-18.1C297.7 136.6 285.6 128 272 128s-25.7 8.6-30.2 21.4l-13.6 39L96 222.6 96 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 264-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-137.3 0L340 257.5l-62.2 16.1L305.3 352l-66.6 0L265 277l-74.6 19.3L137.3 448 96 448l0-159.2 337.4-87.5 25.2 94c4.6 17.1 22.1 27.2 39.2 22.6l15.5-4.1c42.7-11.4 68-55.3 56.6-98L528.3 61.3zM205.1 448l11.2-32 111.4 0 11.2 32-133.8 0z"]
};
const faVault = {
  prefix: 'fas',
  iconName: 'vault',
  icon: [576, 512, [], "e2c5", "M64 0C28.7 0 0 28.7 0 64L0 416c0 35.3 28.7 64 64 64l16 0 16 32 64 0 16-32 224 0 16 32 64 0 16-32 16 0c35.3 0 64-28.7 64-64l0-352c0-35.3-28.7-64-64-64L64 0zM224 320a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-240a160 160 0 1 1 0 320 160 160 0 1 1 0-320zM480 221.3L480 336c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-114.7c-18.6-6.6-32-24.4-32-45.3c0-26.5 21.5-48 48-48s48 21.5 48 48c0 20.9-13.4 38.7-32 45.3z"]
};
const faMars = {
  prefix: 'fas',
  iconName: 'mars',
  icon: [448, 512, [9794], "f222", "M289.8 46.8c3.7-9 12.5-14.8 22.2-14.8l112 0c13.3 0 24 10.7 24 24l0 112c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-33.4-33.4L321 204.2c19.5 28.4 31 62.7 31 99.8c0 97.2-78.8 176-176 176S0 401.2 0 304s78.8-176 176-176c37 0 71.4 11.4 99.8 31l52.6-52.6L295 73c-6.9-6.9-8.9-17.2-5.2-26.2zM400 80s0 0 0 0s0 0 0 0s0 0 0 0zM176 416a112 112 0 1 0 0-224 112 112 0 1 0 0 224z"]
};
const faToilet = {
  prefix: 'fas',
  iconName: 'toilet',
  icon: [448, 512, [128701], "f7d8", "M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48l8 0 0 148.9c-1.9 1.4-3.8 2.9-5.6 4.4C10.9 214.5 0 232.9 0 256c0 46.9 14.3 84.1 37 112.5c14.2 17.7 31.1 31.3 48.5 41.8L65.6 469.9c-3.3 9.8-1.6 20.5 4.4 28.8s15.7 13.3 26 13.3l256 0c10.3 0 19.9-4.9 26-13.3s7.7-19.1 4.4-28.8l-19.8-59.5c17.4-10.5 34.3-24.1 48.5-41.8c22.7-28.4 37-65.5 37-112.5c0-23.1-10.9-41.5-26.4-54.6c-1.8-1.5-3.7-3-5.6-4.4L416 48l8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 0zM384 256.3c0 1-.3 2.6-3.8 5.6c-4.8 4.1-14 9-29.3 13.4C320.5 284 276.1 288 224 288s-96.5-4-126.9-12.8c-15.3-4.4-24.5-9.3-29.3-13.4c-3.5-3-3.8-4.6-3.8-5.6l0-.3c0 0 0-.1 0-.1c0-1 0-2.5 3.8-5.8c4.8-4.1 14-9 29.3-13.4C127.5 228 171.9 224 224 224s96.5 4 126.9 12.8c15.3 4.4 24.5 9.3 29.3 13.4c3.8 3.2 3.8 4.8 3.8 5.8c0 0 0 .1 0 .1l0 .3zM328.2 384l-.2 .5 0-.5 .2 0zM112 64l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faPlaneCircleXmark = {
  prefix: 'fas',
  iconName: 'plane-circle-xmark',
  icon: [640, 512, [], "e557", "M256 0c-35 0-64 59.5-64 93.7l0 84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9l0 65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8l0 42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3l0-84.6C320 59.5 292 0 256 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faYenSign = {
  prefix: 'fas',
  iconName: 'yen-sign',
  icon: [320, 512, [165, "cny", "jpy", "rmb", "yen"], "f157", "M58.6 46.3C48.8 31.5 29 27.6 14.2 37.4S-4.4 67 5.4 81.8L100.2 224 48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0 0 32-80 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 0-32 80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-52.2 0L314.6 81.8c9.8-14.7 5.8-34.6-8.9-44.4s-34.6-5.8-44.4 8.9L160 198.3 58.6 46.3z"]
};
const faCny = faYenSign;
const faJpy = faYenSign;
const faRmb = faYenSign;
const faYen = faYenSign;
const faRubleSign = {
  prefix: 'fas',
  iconName: 'ruble-sign',
  icon: [384, 512, [8381, "rouble", "rub", "ruble"], "f158", "M96 32C78.3 32 64 46.3 64 64l0 192-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-32 112 0c79.5 0 144-64.5 144-144s-64.5-144-144-144L96 32zM240 256l-112 0 0-160 112 0c44.2 0 80 35.8 80 80s-35.8 80-80 80z"]
};
const faRouble = faRubleSign;
const faRub = faRubleSign;
const faRuble = faRubleSign;
const faSun = {
  prefix: 'fas',
  iconName: 'sun',
  icon: [512, 512, [9728], "f185", "M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM160 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"]
};
const faGuitar = {
  prefix: 'fas',
  iconName: 'guitar',
  icon: [512, 512, [], "f7a6", "M465 7c-9.4-9.4-24.6-9.4-33.9 0L383 55c-2.4 2.4-4.3 5.3-5.5 8.5l-15.4 41-77.5 77.6c-45.1-29.4-99.3-30.2-131 1.6c-11 11-18 24.6-21.4 39.6c-3.7 16.6-19.1 30.7-36.1 31.6c-25.6 1.3-49.3 10.7-67.3 28.6C-16 328.4-7.6 409.4 47.5 464.5s136.1 63.5 180.9 18.7c17.9-17.9 27.4-41.7 28.6-67.3c.9-17 15-32.3 31.6-36.1c15-3.4 28.6-10.5 39.6-21.4c31.8-31.8 31-85.9 1.6-131l77.6-77.6 41-15.4c3.2-1.2 6.1-3.1 8.5-5.5l48-48c9.4-9.4 9.4-24.6 0-33.9L465 7zM208 256a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faFaceLaughWink = {
  prefix: 'fas',
  iconName: 'face-laugh-wink',
  icon: [512, 512, ["laugh-wink"], "f59c", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM96.8 314.1c-3.8-13.7 7.4-26.1 21.6-26.1l275.2 0c14.2 0 25.5 12.4 21.6 26.1C396.2 382 332.1 432 256 432s-140.2-50-159.2-117.9zM144.4 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm156.4 25.6c-5.3 7.1-15.3 8.5-22.4 3.2s-8.5-15.3-3.2-22.4c30.4-40.5 91.2-40.5 121.6 0c5.3 7.1 3.9 17.1-3.2 22.4s-17.1 3.9-22.4-3.2c-17.6-23.5-52.8-23.5-70.4 0z"]
};
const faLaughWink = faFaceLaughWink;
const faHorseHead = {
  prefix: 'fas',
  iconName: 'horse-head',
  icon: [640, 512, [], "f7ab", "M64 464l0-147.1c0-108.4 68.3-205.1 170.5-241.3L404.2 15.5C425.6 7.9 448 23.8 448 46.4c0 11-5.5 21.2-14.6 27.3L400 96c48.1 0 91.2 29.8 108.1 74.9l48.6 129.5c11.8 31.4 4.1 66.8-19.6 90.5c-16 16-37.8 25.1-60.5 25.1l-3.4 0c-26.1 0-50.9-11.6-67.6-31.7l-32.3-38.7c-11.7 4.1-24.2 6.4-37.3 6.4c0 0 0 0-.1 0c0 0 0 0 0 0c-6.3 0-12.5-.5-18.6-1.5c-3.6-.6-7.2-1.4-10.7-2.3c0 0 0 0 0 0c-28.9-7.8-53.1-26.8-67.8-52.2c-4.4-7.6-14.2-10.3-21.9-5.8s-10.3 14.2-5.8 21.9c24 41.5 68.3 70 119.3 71.9l47.2 70.8c4 6.1 6.2 13.2 6.2 20.4c0 20.3-16.5 36.8-36.8 36.8L112 512c-26.5 0-48-21.5-48-48zM392 224a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]
};
const faBoreHole = {
  prefix: 'fas',
  iconName: 'bore-hole',
  icon: [512, 512, [], "e4c3", "M256 0c-17.7 0-32 14.3-32 32l0 264.6c-19.1 11.1-32 31.7-32 55.4c0 35.3 28.7 64 64 64s64-28.7 64-64c0-23.7-12.9-44.4-32-55.4L288 32c0-17.7-14.3-32-32-32zM48 128c-26.5 0-48 21.5-48 48L0 464c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-80 0c-17.7 0-32 14.3-32 32l0 192c0 53-43 96-96 96s-96-43-96-96l0-192c0-17.7-14.3-32-32-32l-80 0z"]
};
const faIndustry = {
  prefix: 'fas',
  iconName: 'industry',
  icon: [576, 512, [], "f275", "M64 32C46.3 32 32 46.3 32 64l0 240 0 48 0 80c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-128 0-151.8c0-18.2-19.4-29.7-35.4-21.1L352 215.4l0-63.2c0-18.2-19.4-29.7-35.4-21.1L160 215.4 160 64c0-17.7-14.3-32-32-32L64 32z"]
};
const faCircleDown = {
  prefix: 'fas',
  iconName: 'circle-down',
  icon: [512, 512, [61466, "arrow-alt-circle-down"], "f358", "M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM244.7 395.3l-112-112c-4.6-4.6-5.9-11.5-3.5-17.4s8.3-9.9 14.8-9.9l64 0 0-96c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 96 64 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-112 112c-6.2 6.2-16.4 6.2-22.6 0z"]
};
const faArrowAltCircleDown = faCircleDown;
const faArrowsTurnToDots = {
  prefix: 'fas',
  iconName: 'arrows-turn-to-dots',
  icon: [512, 512, [], "e4c1", "M249.4 25.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L269.3 96 416 96c53 0 96 43 96 96l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-17.7-14.3-32-32-32l-146.7 0 25.4 25.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3l80-80zm13.3 256l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 416 96 416c-17.7 0-32 14.3-32 32l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-53 43-96 96-96l146.7 0-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0zM384 384a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM64 192A64 64 0 1 1 64 64a64 64 0 1 1 0 128z"]
};
const faFlorinSign = {
  prefix: 'fas',
  iconName: 'florin-sign',
  icon: [384, 512, [], "e184", "M314.7 32c-38.8 0-73.7 23.3-88.6 59.1L170.7 224 64 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0L98.9 396.3c-5 11.9-16.6 19.7-29.5 19.7L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l37.3 0c38.8 0 73.7-23.3 88.6-59.1L213.3 288 320 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 45.1-108.3c5-11.9 16.6-19.7 29.5-19.7L352 96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-37.3 0z"]
};
const faArrowDownShortWide = {
  prefix: 'fas',
  iconName: 'arrow-down-short-wide',
  icon: [576, 512, ["sort-amount-desc", "sort-amount-down-alt"], "f884", "M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 301.7 32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faSortAmountDesc = faArrowDownShortWide;
const faSortAmountDownAlt = faArrowDownShortWide;
const faLessThan = {
  prefix: 'fas',
  iconName: 'less-than',
  icon: [384, 512, [62774], "3c", "M380.6 81.7c7.9 15.8 1.5 35-14.3 42.9L103.6 256 366.3 387.4c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3l-320-160C6.8 279.2 0 268.1 0 256s6.8-23.2 17.7-28.6l320-160c15.8-7.9 35-1.5 42.9 14.3z"]
};
const faAngleDown = {
  prefix: 'fas',
  iconName: 'angle-down',
  icon: [448, 512, [8964], "f107", "M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]
};
const faCarTunnel = {
  prefix: 'fas',
  iconName: 'car-tunnel',
  icon: [512, 512, [], "e4de", "M256 0C114.6 0 0 114.6 0 256L0 448c0 35.3 28.7 64 64 64l42.8 0c-6.6-5.9-10.8-14.4-10.8-24l0-112c0-20.8 11.3-38.9 28.1-48.6l21-64.7c7.5-23.1 29-38.7 53.3-38.7l115.2 0c24.3 0 45.8 15.6 53.3 38.7l21 64.7c16.8 9.7 28.2 27.8 28.2 48.6l0 112c0 9.6-4.2 18.1-10.8 24l42.8 0c35.3 0 64-28.7 64-64l0-192C512 114.6 397.4 0 256 0zM362.8 512c-6.6-5.9-10.8-14.4-10.8-24l0-40-192 0 0 40c0 9.6-4.2 18.1-10.8 24l213.7 0zM190.8 277.5L177 320l158 0-13.8-42.5c-1.1-3.3-4.1-5.5-7.6-5.5l-115.2 0c-3.5 0-6.5 2.2-7.6 5.5zM168 408a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm200-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"]
};
const faHeadSideCough = {
  prefix: 'fas',
  iconName: 'head-side-cough',
  icon: [640, 512, [], "e061", "M0 224.2C0 100.6 100.2 0 224 0l24 0c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8L448 320s0 0 0 0l0 32L339.2 365.6c-11 1.4-19.2 10.7-19.2 21.8c0 11.6 9 21.2 20.6 21.9L448 416l0 16c0 26.5-21.5 48-48 48l-80 0 0 8c0 13.3-10.7 24-24 24l-40 0s0 0 0 0L96 512c-17.7 0-32-14.3-32-32l0-72.7c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zm352-.2a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM464 384a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm152-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM592 480a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM552 312a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40-24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM552 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faGripLines = {
  prefix: 'fas',
  iconName: 'grip-lines',
  icon: [448, 512, [], "f7a4", "M32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 288zm0-128c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z"]
};
const faThumbsDown = {
  prefix: 'fas',
  iconName: 'thumbs-down',
  icon: [512, 512, [128078, 61576], "f165", "M313.4 479.1c26-5.2 42.9-30.5 37.7-56.5l-2.3-11.4c-5.3-26.7-15.1-52.1-28.8-75.2l144 0c26.5 0 48-21.5 48-48c0-18.5-10.5-34.6-25.9-42.6C497 236.6 504 223.1 504 208c0-23.4-16.8-42.9-38.9-47.1c4.4-7.3 6.9-15.8 6.9-24.9c0-21.3-13.9-39.4-33.1-45.6c.7-3.3 1.1-6.8 1.1-10.4c0-26.5-21.5-48-48-48l-97.5 0c-19 0-37.5 5.6-53.3 16.1L202.7 73.8C176 91.6 160 121.6 160 153.7l0 38.3 0 48 0 24.9c0 29.2 13.3 56.7 36 75l7.4 5.9c26.5 21.2 44.6 51 51.2 84.2l2.3 11.4c5.2 26 30.5 42.9 56.5 37.7zM32 384l64 0c17.7 0 32-14.3 32-32l0-224c0-17.7-14.3-32-32-32L32 96C14.3 96 0 110.3 0 128L0 352c0 17.7 14.3 32 32 32z"]
};
const faUserLock = {
  prefix: 'fas',
  iconName: 'user-lock',
  icon: [640, 512, [], "f502", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l362.8 0c-5.4-9.4-8.6-20.3-8.6-32l0-128c0-2.1 .1-4.2 .3-6.3c-31-26-71-41.7-114.6-41.7l-91.4 0zM528 240c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faArrowRightLong = {
  prefix: 'fas',
  iconName: 'arrow-right-long',
  icon: [512, 512, ["long-arrow-right"], "f178", "M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]
};
const faLongArrowRight = faArrowRightLong;
const faAnchorCircleXmark = {
  prefix: 'fas',
  iconName: 'anchor-circle-xmark',
  icon: [640, 512, [], "e4ac", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c8.2 0 16.3-.6 24.2-1.8c-22.2-16.2-40.4-37.5-53-62.2L320 448l0-80 0-128 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0zM496 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L518.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L496 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L473.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faEllipsis = {
  prefix: 'fas',
  iconName: 'ellipsis',
  icon: [448, 512, ["ellipsis-h"], "f141", "M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"]
};
const faEllipsisH = faEllipsis;
const faChessPawn = {
  prefix: 'fas',
  iconName: 'chess-pawn',
  icon: [320, 512, [9823], "f443", "M215.5 224c29.2-18.4 48.5-50.9 48.5-88c0-57.4-46.6-104-104-104S56 78.6 56 136c0 37.1 19.4 69.6 48.5 88L96 224c-17.7 0-32 14.3-32 32c0 16.5 12.5 30 28.5 31.8L80 400l160 0L227.5 287.8c16-1.8 28.5-15.3 28.5-31.8c0-17.7-14.3-32-32-32l-8.5 0zM22.6 473.4c-4.2 4.2-6.6 10-6.6 16C16 501.9 26.1 512 38.6 512l242.7 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16L256 432 64 432 22.6 473.4z"]
};
const faKitMedical = {
  prefix: 'fas',
  iconName: 'kit-medical',
  icon: [576, 512, ["first-aid"], "f479", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l32 0L96 32 64 32zm64 0l0 448 320 0 0-448L128 32zM512 480c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-32 0 0 448 32 0zM256 176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faFirstAid = faKitMedical;
const faPersonThroughWindow = {
  prefix: 'fas',
  iconName: 'person-through-window',
  icon: [640, 512, [], "e5a9", "M64 64l224 0 0 9.8c0 39-23.7 74-59.9 88.4C167.6 186.5 128 245 128 310.2l0 73.8s0 0 0 0l-64 0L64 64zm288 0l224 0 0 320-67.7 0-3.7-4.5-75.2-90.2c-9.1-10.9-22.6-17.3-36.9-17.3l-71.1 0-41-63.1c-.3-.5-.6-1-1-1.4c44.7-29 72.5-79 72.5-133.6l0-9.8zm73 320l-45.8 0 42.7 64L592 448c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48L48 0C21.5 0 0 21.5 0 48L0 400c0 26.5 21.5 48 48 48l260.2 0 33.2 49.8c9.8 14.7 29.7 18.7 44.4 8.9s18.7-29.7 8.9-44.4L310.5 336l74.6 0 40 48zm-159.5 0L192 384s0 0 0 0l0-73.8c0-10.2 1.6-20.1 4.7-29.5L265.5 384zM192 128a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faToolbox = {
  prefix: 'fas',
  iconName: 'toolbox',
  icon: [512, 512, [129520], "f552", "M176 88l0 40 160 0 0-40c0-4.4-3.6-8-8-8L184 80c-4.4 0-8 3.6-8 8zm-48 40l0-40c0-30.9 25.1-56 56-56l144 0c30.9 0 56 25.1 56 56l0 40 28.1 0c12.7 0 24.9 5.1 33.9 14.1l51.9 51.9c9 9 14.1 21.2 14.1 33.9l0 92.1-128 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32-128 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L0 320l0-92.1c0-12.7 5.1-24.9 14.1-33.9l51.9-51.9c9-9 21.2-14.1 33.9-14.1l28.1 0zM0 416l0-64 128 0c0 17.7 14.3 32 32 32s32-14.3 32-32l128 0c0 17.7 14.3 32 32 32s32-14.3 32-32l128 0 0 64c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64z"]
};
const faHandsHoldingCircle = {
  prefix: 'fas',
  iconName: 'hands-holding-circle',
  icon: [640, 512, [], "e4fb", "M320 0a128 128 0 1 1 0 256A128 128 0 1 1 320 0zM40 64c22.1 0 40 17.9 40 40l0 40 0 80 0 40.2c0 17 6.7 33.3 18.7 45.3l51.1 51.1c8.3 8.3 21.3 9.6 31 3.1c12.9-8.6 14.7-26.9 3.7-37.8l-15.2-15.2-32-32c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l32 32 15.2 15.2c0 0 0 0 0 0l25.3 25.3c21 21 32.8 49.5 32.8 79.2l0 78.9c0 26.5-21.5 48-48 48l-66.7 0c-17 0-33.3-6.7-45.3-18.7L28.1 393.4C10.1 375.4 0 351 0 325.5L0 224l0-64 0-56C0 81.9 17.9 64 40 64zm560 0c22.1 0 40 17.9 40 40l0 56 0 64 0 101.5c0 25.5-10.1 49.9-28.1 67.9L512 493.3c-12 12-28.3 18.7-45.3 18.7L400 512c-26.5 0-48-21.5-48-48l0-78.9c0-29.7 11.8-58.2 32.8-79.2l25.3-25.3c0 0 0 0 0 0l15.2-15.2 32-32c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-32 32-15.2 15.2c-11 11-9.2 29.2 3.7 37.8c9.7 6.5 22.7 5.2 31-3.1l51.1-51.1c12-12 18.7-28.3 18.7-45.3l0-40.2 0-80 0-40c0-22.1 17.9-40 40-40z"]
};
const faBug = {
  prefix: 'fas',
  iconName: 'bug',
  icon: [512, 512, [], "f188", "M256 0c53 0 96 43 96 96l0 3.6c0 15.7-12.7 28.4-28.4 28.4l-135.1 0c-15.7 0-28.4-12.7-28.4-28.4l0-3.6c0-53 43-96 96-96zM41.4 105.4c12.5-12.5 32.8-12.5 45.3 0l64 64c.7 .7 1.3 1.4 1.9 2.1c14.2-7.3 30.4-11.4 47.5-11.4l112 0c17.1 0 33.2 4.1 47.5 11.4c.6-.7 1.2-1.4 1.9-2.1l64-64c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-64 64c-.7 .7-1.4 1.3-2.1 1.9c6.2 12 10.1 25.3 11.1 39.5l64.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c0 24.6-5.5 47.8-15.4 68.6c2.2 1.3 4.2 2.9 6 4.8l64 64c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-63.1-63.1c-24.5 21.8-55.8 36.2-90.3 39.6L272 240c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 239.2c-34.5-3.4-65.8-17.8-90.3-39.6L86.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l64-64c1.9-1.9 3.9-3.4 6-4.8C101.5 367.8 96 344.6 96 320l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64.3 0c1.1-14.1 5-27.5 11.1-39.5c-.7-.6-1.4-1.2-2.1-1.9l-64-64c-12.5-12.5-12.5-32.8 0-45.3z"]
};
const faCreditCard = {
  prefix: 'fas',
  iconName: 'credit-card',
  icon: [576, 512, [128179, 62083, "credit-card-alt"], "f09d", "M64 32C28.7 32 0 60.7 0 96l0 32 576 0 0-32c0-35.3-28.7-64-64-64L64 32zM576 224L0 224 0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-192zM112 352l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm112 16c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16z"]
};
const faCreditCardAlt = faCreditCard;
const faCar = {
  prefix: 'fas',
  iconName: 'car',
  icon: [512, 512, [128664, "automobile"], "f1b9", "M135.2 117.4L109.1 192l293.8 0-26.1-74.6C372.3 104.6 360.2 96 346.6 96L165.4 96c-13.6 0-25.7 8.6-30.2 21.4zM39.6 196.8L74.8 96.3C88.3 57.8 124.6 32 165.4 32l181.2 0c40.8 0 77.1 25.8 90.6 64.3l35.2 100.5c23.2 9.6 39.6 32.5 39.6 59.2l0 144 0 48c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-48L96 400l0 48c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-48L0 256c0-26.7 16.4-49.6 39.6-59.2zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faAutomobile = faCar;
const faHandHoldingHand = {
  prefix: 'fas',
  iconName: 'hand-holding-hand',
  icon: [576, 512, [], "e4f7", "M7.8 207.7c-13.1-17.8-9.3-42.8 8.5-55.9L142.9 58.5C166.2 41.3 194.5 32 223.5 32L384 32l160 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-36.8 0-44.9 36c-22.7 18.2-50.9 28-80 28L304 224l-16 0-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0 16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-120.6 0L63.7 216.2c-17.8 13.1-42.8 9.3-55.9-8.5zM382.4 160c0 0 0 0 0 0l.9 0c-.3 0-.6 0-.9 0zM568.2 304.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 453.5c-23.4 17.2-51.6 26.5-80.7 26.5L192 480 32 480c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l36.8 0 44.9-36c22.7-18.2 50.9-28 80-28l78.3 0 16 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l120.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 352c0 0 0 0 0 0l-.9 0c.3 0 .6 0 .9 0z"]
};
const faBookOpenReader = {
  prefix: 'fas',
  iconName: 'book-open-reader',
  icon: [512, 512, ["book-reader"], "f5da", "M160 96a96 96 0 1 1 192 0A96 96 0 1 1 160 96zm80 152l0 264-48.4-24.2c-20.9-10.4-43.5-17-66.8-19.3l-96-9.6C12.5 457.2 0 443.5 0 427L0 224c0-17.7 14.3-32 32-32l30.3 0c63.6 0 125.6 19.6 177.7 56zm32 264l0-264c52.1-36.4 114.1-56 177.7-56l30.3 0c17.7 0 32 14.3 32 32l0 203c0 16.4-12.5 30.2-28.8 31.8l-96 9.6c-23.2 2.3-45.9 8.9-66.8 19.3L272 512z"]
};
const faBookReader = faBookOpenReader;
const faMountainSun = {
  prefix: 'fas',
  iconName: 'mountain-sun',
  icon: [640, 512, [], "e52f", "M560 160A80 80 0 1 0 560 0a80 80 0 1 0 0 160zM55.9 512l325.2 0 75 0 122.8 0c33.8 0 61.1-27.4 61.1-61.1c0-11.2-3.1-22.2-8.9-31.8l-132-216.3C495 196.1 487.8 192 480 192s-15 4.1-19.1 10.7l-48.2 79L286.8 81c-6.6-10.6-18.3-17-30.8-17s-24.1 6.4-30.8 17L8.6 426.4C3 435.3 0 445.6 0 456.1C0 487 25 512 55.9 512z"]
};
const faArrowsLeftRightToLine = {
  prefix: 'fas',
  iconName: 'arrows-left-right-to-line',
  icon: [640, 512, [], "e4ba", "M32 64c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 96C0 78.3 14.3 64 32 64zm214.6 73.4c12.5 12.5 12.5 32.8 0 45.3L205.3 224l229.5 0-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L434.7 288l-229.5 0 41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0zM640 96l0 320c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-320c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faDiceD20 = {
  prefix: 'fas',
  iconName: 'dice-d20',
  icon: [512, 512, [], "f6cf", "M48.7 125.8l53.2 31.9c7.8 4.7 17.8 2 22.2-5.9L201.6 12.1c3-5.4-.9-12.1-7.1-12.1c-1.6 0-3.2 .5-4.6 1.4L47.9 98.8c-9.6 6.6-9.2 20.9 .8 26.9zM16 171.7l0 123.5c0 8 10.4 11 14.7 4.4l60-92c5-7.6 2.6-17.8-5.2-22.5L40.2 158C29.6 151.6 16 159.3 16 171.7zM310.4 12.1l77.6 139.6c4.4 7.9 14.5 10.6 22.2 5.9l53.2-31.9c10-6 10.4-20.3 .8-26.9L322.1 1.4c-1.4-.9-3-1.4-4.6-1.4c-6.2 0-10.1 6.7-7.1 12.1zM496 171.7c0-12.4-13.6-20.1-24.2-13.7l-45.3 27.2c-7.8 4.7-10.1 14.9-5.2 22.5l60 92c4.3 6.7 14.7 3.6 14.7-4.4l0-123.5zm-49.3 246L286.1 436.6c-8.1 .9-14.1 7.8-14.1 15.9l0 52.8c0 3.7 3 6.8 6.8 6.8c.8 0 1.6-.1 2.4-.4l172.7-64c6.1-2.2 10.1-8 10.1-14.5c0-9.3-8.1-16.5-17.3-15.4zM233.2 512c3.7 0 6.8-3 6.8-6.8l0-52.6c0-8.1-6.1-14.9-14.1-15.9l-160.6-19c-9.2-1.1-17.3 6.1-17.3 15.4c0 6.5 4 12.3 10.1 14.5l172.7 64c.8 .3 1.6 .4 2.4 .4zM41.7 382.9l170.9 20.2c7.8 .9 13.4-7.5 9.5-14.3l-85.7-150c-5.9-10.4-20.7-10.8-27.3-.8L30.2 358.2c-6.5 9.9-.3 23.3 11.5 24.7zm439.6-24.8L402.9 238.1c-6.5-10-21.4-9.6-27.3 .8L290.2 388.5c-3.9 6.8 1.6 15.2 9.5 14.3l170.1-20c11.8-1.4 18-14.7 11.5-24.6zm-216.9 11l78.4-137.2c6.1-10.7-1.6-23.9-13.9-23.9l-145.7 0c-12.3 0-20 13.3-13.9 23.9l78.4 137.2c3.7 6.4 13 6.4 16.7 0zM174.4 176l163.2 0c12.2 0 19.9-13.1 14-23.8l-80-144c-2.8-5.1-8.2-8.2-14-8.2l-3.2 0c-5.8 0-11.2 3.2-14 8.2l-80 144c-5.9 10.7 1.8 23.8 14 23.8z"]
};
const faTruckDroplet = {
  prefix: 'fas',
  iconName: 'truck-droplet',
  icon: [640, 512, [], "e58c", "M0 48C0 21.5 21.5 0 48 0L368 0c26.5 0 48 21.5 48 48l0 48 50.7 0c17 0 33.3 6.7 45.3 18.7L589.3 192c12 12 18.7 28.3 18.7 45.3l0 18.7 0 32 0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-26.5 0-48-21.5-48-48L0 48zM416 256l128 0 0-18.7L466.7 160 416 160l0 96zM160 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM208 272c39.8 0 72-29.6 72-66c0-27-39.4-82.9-59.9-110.3c-6.1-8.2-18.1-8.2-24.2 0C175.4 123 136 179 136 206c0 36.5 32.2 66 72 66z"]
};
const faFileCircleXmark = {
  prefix: 'fas',
  iconName: 'file-circle-xmark',
  icon: [576, 512, [], "e5a1", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L432 345.4l-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L409.4 368l-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L432 390.6l36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L454.6 368l36.7-36.7z"]
};
const faTemperatureArrowUp = {
  prefix: 'fas',
  iconName: 'temperature-arrow-up',
  icon: [576, 512, ["temperature-up"], "e040", "M128 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 164.5c0 17.3 7.1 31.9 15.3 42.5C249.8 332.6 256 349.5 256 368c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-18.5 6.2-35.4 16.7-48.9c8.2-10.6 15.3-25.2 15.3-42.5L128 112zM176 0C114.1 0 64 50.1 64 112l0 164.4c0 .1-.1 .3-.2 .6c-.2 .6-.8 1.6-1.7 2.8C43.2 304.2 32 334.8 32 368c0 79.5 64.5 144 144 144s144-64.5 144-144c0-33.2-11.2-63.8-30.1-88.1c-.9-1.2-1.5-2.2-1.7-2.8c-.1-.3-.2-.5-.2-.6L288 112C288 50.1 237.9 0 176 0zm0 416c26.5 0 48-21.5 48-48c0-20.9-13.4-38.7-32-45.3L192 112c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 210.7c-18.6 6.6-32 24.4-32 45.3c0 26.5 21.5 48 48 48zM480 160l32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 288c0 17.7 14.3 32 32 32s32-14.3 32-32l0-288z"]
};
const faTemperatureUp = faTemperatureArrowUp;
const faMedal = {
  prefix: 'fas',
  iconName: 'medal',
  icon: [512, 512, [127941], "f5a2", "M4.1 38.2C1.4 34.2 0 29.4 0 24.6C0 11 11 0 24.6 0L133.9 0c11.2 0 21.7 5.9 27.4 15.5l68.5 114.1c-48.2 6.1-91.3 28.6-123.4 61.9L4.1 38.2zm503.7 0L405.6 191.5c-32.1-33.3-75.2-55.8-123.4-61.9L350.7 15.5C356.5 5.9 366.9 0 378.1 0L487.4 0C501 0 512 11 512 24.6c0 4.8-1.4 9.6-4.1 13.6zM80 336a176 176 0 1 1 352 0A176 176 0 1 1 80 336zm184.4-94.9c-3.4-7-13.3-7-16.8 0l-22.4 45.4c-1.4 2.8-4 4.7-7 5.1L168 298.9c-7.7 1.1-10.7 10.5-5.2 16l36.3 35.4c2.2 2.2 3.2 5.2 2.7 8.3l-8.6 49.9c-1.3 7.6 6.7 13.5 13.6 9.9l44.8-23.6c2.7-1.4 6-1.4 8.7 0l44.8 23.6c6.9 3.6 14.9-2.2 13.6-9.9l-8.6-49.9c-.5-3 .5-6.1 2.7-8.3l36.3-35.4c5.6-5.4 2.5-14.8-5.2-16l-50.1-7.3c-3-.4-5.7-2.4-7-5.1l-22.4-45.4z"]
};
const faBed = {
  prefix: 'fas',
  iconName: 'bed',
  icon: [640, 512, [128716], "f236", "M32 32c17.7 0 32 14.3 32 32l0 256 224 0 0-160c0-17.7 14.3-32 32-32l224 0c53 0 96 43 96 96l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-224 0-32 0L64 416l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 64C0 46.3 14.3 32 32 32zm144 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faSquareH = {
  prefix: 'fas',
  iconName: 'square-h',
  icon: [448, 512, ["h-square"], "f0fd", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM336 152l0 104 0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-80-128 0 0 80c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-208c0-13.3 10.7-24 24-24s24 10.7 24 24l0 80 128 0 0-80c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faHSquare = faSquareH;
const faPodcast = {
  prefix: 'fas',
  iconName: 'podcast',
  icon: [448, 512, [], "f2ce", "M319.4 372c48.5-31.3 80.6-85.9 80.6-148c0-97.2-78.8-176-176-176S48 126.8 48 224c0 62.1 32.1 116.6 80.6 148c1.2 17.3 4 38 7.2 57.1l.2 1C56 395.8 0 316.5 0 224C0 100.3 100.3 0 224 0S448 100.3 448 224c0 92.5-56 171.9-136 206.1l.2-1.1c3.1-19.2 6-39.8 7.2-57zm-2.3-38.1c-1.6-5.7-3.9-11.1-7-16.2c-5.8-9.7-13.5-17-21.9-22.4c19.5-17.6 31.8-43 31.8-71.3c0-53-43-96-96-96s-96 43-96 96c0 28.3 12.3 53.8 31.8 71.3c-8.4 5.4-16.1 12.7-21.9 22.4c-3.1 5.1-5.4 10.5-7 16.2C99.8 307.5 80 268 80 224c0-79.5 64.5-144 144-144s144 64.5 144 144c0 44-19.8 83.5-50.9 109.9zM224 312c32.9 0 64 8.6 64 43.8c0 33-12.9 104.1-20.6 132.9c-5.1 19-24.5 23.4-43.4 23.4s-38.2-4.4-43.4-23.4c-7.8-28.5-20.6-99.7-20.6-132.8c0-35.1 31.1-43.8 64-43.8zm0-144a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"]
};
const faTemperatureFull = {
  prefix: 'fas',
  iconName: 'temperature-full',
  icon: [320, 512, ["temperature-4", "thermometer-4", "thermometer-full"], "f2c7", "M160 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C86.2 332.6 80 349.5 80 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L208 112c0-26.5-21.5-48-48-48zM48 112C48 50.2 98.1 0 160 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S16 447.5 16 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L48 112zM208 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3L144 112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 210.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faTemperature4 = faTemperatureFull;
const faThermometer4 = faTemperatureFull;
const faThermometerFull = faTemperatureFull;
const faBell = {
  prefix: 'fas',
  iconName: 'bell',
  icon: [448, 512, [128276, 61602], "f0f3", "M224 0c-17.7 0-32 14.3-32 32l0 19.2C119 66 64 130.6 64 208l0 18.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S19.4 416 32 416l384 0c12.6 0 24-7.4 29.2-18.9s3.1-25-5.3-34.4l-7.4-8.3C401.3 319.2 384 273.9 384 226.8l0-18.8c0-77.4-55-142-128-156.8L256 32c0-17.7-14.3-32-32-32zm45.3 493.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"]
};
const faSuperscript = {
  prefix: 'fas',
  iconName: 'superscript',
  icon: [512, 512, [], "f12b", "M480 32c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9C393 73.5 404.3 80 416 80l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128zM32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l15.3 0 89.6 128L47.3 384 32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L176 311.8l85.8 122.6c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0L215.1 256l89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L176 200.2 90.2 77.6C84.2 69.1 74.4 64 64 64L32 64z"]
};
const faPlugCircleXmark = {
  prefix: 'fas',
  iconName: 'plug-circle-xmark',
  icon: [576, 512, [], "e560", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7L454.6 368l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L432 390.6l-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L409.4 368l-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L432 345.4l36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faStarOfLife = {
  prefix: 'fas',
  iconName: 'star-of-life',
  icon: [512, 512, [], "f621", "M208 32c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 140.9 122-70.4c15.3-8.8 34.9-3.6 43.7 11.7l16 27.7c8.8 15.3 3.6 34.9-11.7 43.7L352 256l122 70.4c15.3 8.8 20.6 28.4 11.7 43.7l-16 27.7c-8.8 15.3-28.4 20.6-43.7 11.7L304 339.1 304 480c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-140.9L86 409.6c-15.3 8.8-34.9 3.6-43.7-11.7l-16-27.7c-8.8-15.3-3.6-34.9 11.7-43.7L160 256 38 185.6c-15.3-8.8-20.5-28.4-11.7-43.7l16-27.7C51.1 98.8 70.7 93.6 86 102.4l122 70.4L208 32z"]
};
const faPhoneSlash = {
  prefix: 'fas',
  iconName: 'phone-slash',
  icon: [640, 512, [], "f3dd", "M228.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C76.1 30.2 64 46 64 64c0 107.4 37.8 206 100.8 283.1L9.2 469.1c-10.4 8.2-12.3 23.3-4.1 33.7s23.3 12.3 33.7 4.1l592-464c10.4-8.2 12.3-23.3 4.1-33.7s-23.3-12.3-33.7-4.1L253 278c-17.8-21.5-32.9-45.2-45-70.7L257.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96zm96.8 319l-91.3 72C310.7 476 407.1 512 512 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L368.7 368c-15-7.1-29.3-15.2-43-24.3z"]
};
const faPaintRoller = {
  prefix: 'fas',
  iconName: 'paint-roller',
  icon: [512, 512, [], "f5aa", "M0 64C0 28.7 28.7 0 64 0L352 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 192c-35.3 0-64-28.7-64-64L0 64zM160 352c0-17.7 14.3-32 32-32l0-16c0-44.2 35.8-80 80-80l144 0c17.7 0 32-14.3 32-32l0-32 0-90.5c37.3 13.2 64 48.7 64 90.5l0 32c0 53-43 96-96 96l-144 0c-8.8 0-16 7.2-16 16l0 16c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-128z"]
};
const faHandshakeAngle = {
  prefix: 'fas',
  iconName: 'handshake-angle',
  icon: [640, 512, ["hands-helping"], "f4c4", "M544 248l0 3.3 69.7-69.7c21.9-21.9 21.9-57.3 0-79.2L535.6 24.4c-21.9-21.9-57.3-21.9-79.2 0L416.3 64.5c-2.7-.3-5.5-.5-8.3-.5L296 64c-37.1 0-67.6 28-71.6 64l-.4 0 0 120c0 22.1 17.9 40 40 40s40-17.9 40-40l0-72c0 0 0-.1 0-.1l0-15.9 16 0 136 0c0 0 0 0 .1 0l7.9 0c44.2 0 80 35.8 80 80l0 8zM336 192l0 56c0 39.8-32.2 72-72 72s-72-32.2-72-72l0-118.6c-35.9 6.2-65.8 32.3-76 68.2L99.5 255.2 26.3 328.4c-21.9 21.9-21.9 57.3 0 79.2l78.1 78.1c21.9 21.9 57.3 21.9 79.2 0l37.7-37.7c.9 0 1.8 .1 2.7 .1l160 0c26.5 0 48-21.5 48-48c0-5.6-1-11-2.7-16l2.7 0c26.5 0 48-21.5 48-48c0-12.8-5-24.4-13.2-33c25.7-5 45.1-27.6 45.2-54.8l0-.4c-.1-30.8-25.1-55.8-56-55.8c0 0 0 0 0 0l-120 0z"]
};
const faHandsHelping = faHandshakeAngle;
const faLocationDot = {
  prefix: 'fas',
  iconName: 'location-dot',
  icon: [384, 512, ["map-marker-alt"], "f3c5", "M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faMapMarkerAlt = faLocationDot;
const faFile = {
  prefix: 'fas',
  iconName: 'file',
  icon: [384, 512, [128196, 128459, 61462], "f15b", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128z"]
};
const faGreaterThan = {
  prefix: 'fas',
  iconName: 'greater-than',
  icon: [384, 512, [62769], "3e", "M3.4 81.7c-7.9 15.8-1.5 35 14.3 42.9L280.5 256 17.7 387.4C1.9 395.3-4.5 414.5 3.4 430.3s27.1 22.2 42.9 14.3l320-160c10.8-5.4 17.7-16.5 17.7-28.6s-6.8-23.2-17.7-28.6l-320-160c-15.8-7.9-35-1.5-42.9 14.3z"]
};
const faPersonSwimming = {
  prefix: 'fas',
  iconName: 'person-swimming',
  icon: [576, 512, [127946, "swimmer"], "f5c4", "M309.5 178.4L447.9 297.1c-1.6 .9-3.2 2-4.8 3c-18 12.4-40.1 20.3-59.2 20.3c-19.6 0-40.8-7.7-59.2-20.3c-22.1-15.5-51.6-15.5-73.7 0c-17.1 11.8-38 20.3-59.2 20.3c-10.1 0-21.1-2.2-31.9-6.2C163.1 193.2 262.2 96 384 96l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-26.9 0-52.3 6.6-74.5 18.4zM160 160A64 64 0 1 1 32 160a64 64 0 1 1 128 0zM306.5 325.9C329 341.4 356.5 352 384 352c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 405.7 417 416 384 416c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 341.2 165.1 352 192 352c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faSwimmer = faPersonSwimming;
const faArrowDown = {
  prefix: 'fas',
  iconName: 'arrow-down',
  icon: [384, 512, [8595], "f063", "M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 370.8 224 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]
};
const faDroplet = {
  prefix: 'fas',
  iconName: 'droplet',
  icon: [384, 512, [128167, "tint"], "f043", "M192 512C86 512 0 426 0 320C0 228.8 130.2 57.7 166.6 11.7C172.6 4.2 181.5 0 191.1 0l1.8 0c9.6 0 18.5 4.2 24.5 11.7C253.8 57.7 384 228.8 384 320c0 106-86 192-192 192zM96 336c0-8.8-7.2-16-16-16s-16 7.2-16 16c0 61.9 50.1 112 112 112c8.8 0 16-7.2 16-16s-7.2-16-16-16c-44.2 0-80-35.8-80-80z"]
};
const faTint = faDroplet;
const faEraser = {
  prefix: 'fas',
  iconName: 'eraser',
  icon: [576, 512, [], "f12d", "M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7L288 480l9.4 0L512 480c17.7 0 32-14.3 32-32s-14.3-32-32-32l-124.1 0L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416l-9.4 0-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"]
};
const faEarthAmericas = {
  prefix: 'fas',
  iconName: 'earth-americas',
  icon: [512, 512, [127758, "earth", "earth-america", "globe-americas"], "f57d", "M57.7 193l9.4 16.4c8.3 14.5 21.9 25.2 38 29.8L163 255.7c17.2 4.9 29 20.6 29 38.5l0 39.9c0 11 6.2 21 16 25.9s16 14.9 16 25.9l0 39c0 15.6 14.9 26.9 29.9 22.6c16.1-4.6 28.6-17.5 32.7-33.8l2.8-11.2c4.2-16.9 15.2-31.4 30.3-40l8.1-4.6c15-8.5 24.2-24.5 24.2-41.7l0-8.3c0-12.7-5.1-24.9-14.1-33.9l-3.9-3.9c-9-9-21.2-14.1-33.9-14.1L257 256c-11.1 0-22.1-2.9-31.8-8.4l-34.5-19.7c-4.3-2.5-7.6-6.5-9.2-11.2c-3.2-9.6 1.1-20 10.2-24.5l5.9-3c6.6-3.3 14.3-3.9 21.3-1.5l23.2 7.7c8.2 2.7 17.2-.4 21.9-7.5c4.7-7 4.2-16.3-1.2-22.8l-13.6-16.3c-10-12-9.9-29.5 .3-41.3l15.7-18.3c8.8-10.3 10.2-25 3.5-36.7l-2.4-4.2c-3.5-.2-6.9-.3-10.4-.3C163.1 48 84.4 108.9 57.7 193zM464 256c0-36.8-9.6-71.4-26.4-101.5L412 164.8c-15.7 6.3-23.8 23.8-18.5 39.8l16.9 50.7c3.5 10.4 12 18.3 22.6 20.9l29.1 7.3c1.2-9 1.8-18.2 1.8-27.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faEarth = faEarthAmericas;
const faEarthAmerica = faEarthAmericas;
const faGlobeAmericas = faEarthAmericas;
const faPersonBurst = {
  prefix: 'fas',
  iconName: 'person-burst',
  icon: [640, 512, [], "e53b", "M480 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 384l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-223.1 28.6 47.5c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-58.3-97c-17.4-28.9-48.6-46.6-82.3-46.6l-29.7 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L408 256.9 408 480c0 17.7 14.3 32 32 32s32-14.3 32-32zM190.9 18.1C188.4 12 182.6 8 176 8s-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L176 286.1l58.6 53.9c4.8 4.4 11.9 5.5 17.8 2.6s9.5-9 9-15.5l-5.6-79.4 50.5-7.8 24.3-40.5-55.2-38L315 92.2c3.3-5.7 2.7-12.8-1.4-17.9s-10.9-7.2-17.2-5.3L220.3 92.1l-29.4-74z"]
};
const faDove = {
  prefix: 'fas',
  iconName: 'dove',
  icon: [512, 512, [128330], "f4ba", "M160.8 96.5c14 17 31 30.9 49.5 42.2c25.9 15.8 53.7 25.9 77.7 31.6l0-31.5C265.8 108.5 250 71.5 248.6 28c-.4-11.3-7.5-21.5-18.4-24.4c-7.6-2-15.8-.2-21 5.8c-13.3 15.4-32.7 44.6-48.4 87.2zM320 144l0 30.6s0 0 0 0l0 1.3s0 0 0 0l0 32.1c-60.8-5.1-185-43.8-219.3-157.2C97.4 40 87.9 32 76.6 32c-7.9 0-15.3 3.9-18.8 11C46.8 65.9 32 112.1 32 176c0 116.9 80.1 180.5 118.4 202.8L11.8 416.6C6.7 418 2.6 421.8 .9 426.8s-.8 10.6 2.3 14.8C21.7 466.2 77.3 512 160 512c3.6 0 7.2-1.2 10-3.5L245.6 448l74.4 0c88.4 0 160-71.6 160-160l0-160 29.9-44.9c1.3-2 2.1-4.4 2.1-6.8c0-6.8-5.5-12.3-12.3-12.3L400 64c-44.2 0-80 35.8-80 80zm80-16a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faBatteryEmpty = {
  prefix: 'fas',
  iconName: 'battery-empty',
  icon: [576, 512, ["battery-0"], "f244", "M80 160c-8.8 0-16 7.2-16 16l0 160c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-160c0-8.8-7.2-16-16-16L80 160zM0 176c0-44.2 35.8-80 80-80l384 0c44.2 0 80 35.8 80 80l0 16c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l0 16c0 44.2-35.8 80-80 80L80 416c-44.2 0-80-35.8-80-80L0 176z"]
};
const faBattery0 = faBatteryEmpty;
const faSocks = {
  prefix: 'fas',
  iconName: 'socks',
  icon: [512, 512, [129510], "f696", "M175.2 476.6c-9.7-18-15.2-38.7-15.2-60.6c0-40.3 19-78.2 51.2-102.4l64-48c8.1-6 12.8-15.5 12.8-25.6l0-144L128 96l0 144c0 20.1-9.5 39.1-25.6 51.2l-64 48C14.2 357.3 0 385.8 0 416c0 53 43 96 96 96c20.8 0 41-6.7 57.6-19.2l21.6-16.2zM128 64l160 0 0-16c0-14.5 3.9-28.2 10.7-39.9C291 3 281.9 0 272 0L176 0c-26.5 0-48 21.5-48 48l0 16zM320 96l0 144c0 20.1-9.5 39.1-25.6 51.2l-64 48C206.2 357.3 192 385.8 192 416c0 53 43 96 96 96c20.8 0 41-6.7 57.6-19.2l115.2-86.4C493 382.2 512 344.3 512 304l0-208L320 96zM512 64l0-16c0-26.5-21.5-48-48-48L368 0c-26.5 0-48 21.5-48 48l0 16 192 0z"]
};
const faInbox = {
  prefix: 'fas',
  iconName: 'inbox',
  icon: [512, 512, [], "f01c", "M121 32C91.6 32 66 52 58.9 80.5L1.9 308.4C.6 313.5 0 318.7 0 323.9L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-92.1c0-5.2-.6-10.4-1.9-15.5l-57-227.9C446 52 420.4 32 391 32L121 32zm0 64l270 0 48 192-51.2 0c-12.1 0-23.2 6.8-28.6 17.7l-14.3 28.6c-5.4 10.8-16.5 17.7-28.6 17.7l-120.4 0c-12.1 0-23.2-6.8-28.6-17.7l-14.3-28.6c-5.4-10.8-16.5-17.7-28.6-17.7L73 288 121 96z"]
};
const faSection = {
  prefix: 'fas',
  iconName: 'section',
  icon: [256, 512, [], "e447", "M64.9 96C67.1 84.4 73.7 76.2 86 70.6c13.8-6.2 34.8-8.9 61.2-4.5c8.8 1.4 36.1 7.1 44.1 9.3c17 4.8 34.7-5.1 39.5-22.2s-5.1-34.7-22.2-39.5c-11.1-3.1-41-9.2-50.9-10.8C123-2.7 88.3-.6 59.7 12.3C29.9 25.8 7.5 50.9 1.6 86.5c-.1 .5-.2 1.1-.2 1.6c-2.2 19.7 .3 37.9 8.1 54.1c7.7 16.1 19.4 28 32 36.9c.6 .5 1.3 .9 2 1.4C22.3 194.2 6.5 215.1 1.7 243c-.1 .6-.2 1.1-.2 1.7c-2.3 19.3 .4 37.1 8.4 53c7.9 15.6 19.8 27 32.3 35.5c22.4 15.2 51.9 24 75.4 31c0 0 0 0 0 0l3.7 1.1c27.2 8.2 46.9 14.6 59.4 23.8c5.5 4 8.2 7.6 9.5 10.9c1.3 3.2 2.6 8.6 .9 18.1c-1.7 10.1-7.7 18-20.7 23.5c-14 6-35.4 8.5-62 4.4c-12.8-2.1-35.1-9.7-54.1-16.2c0 0 0 0 0 0c-4.3-1.5-8.5-2.9-12.3-4.2C25.3 420 7.2 429.1 1.6 445.8s3.5 34.9 20.3 40.5c2.6 .8 5.7 1.9 9.2 3.1c18.6 6.3 48.5 16.6 67.3 19.6c0 0 0 0 0 0l.2 0c34.5 5.4 68.8 3.4 97.2-8.7c29.4-12.6 52.5-36.5 58.5-71.5c3.3-19.3 1.9-37.4-5-53.9c-6.3-15-16.4-26.4-27.6-35.2c16.5-13.9 28.5-33.2 32.6-58.2c3.2-19.8 1.9-38.3-4.8-55.1c-6.7-16.8-17.8-29.4-30.2-39c-22.8-17.6-53.6-27.4-77.7-35l-1.4-.5c-27.4-8.7-47.8-15.3-61.5-25c-6.1-4.4-9.5-8.5-11.4-12.4c-1.8-3.7-3.2-9.3-2.3-18.5zm76.7 208.5l-.6-.2-1.4-.4c-27.4-8.2-47.9-14.5-61.7-23.8c-6.2-4.2-9.3-7.9-11-11.3c-1.5-3-2.9-7.7-2.1-15.7c1.9-9.7 7.9-17.3 20.5-22.7c14-6 35.4-8.5 62.1-4.3l16.4 2.6c6.3 2.9 11.7 6 16.2 9.5c5.5 4.2 8.4 8.2 10 12.2c1.6 4 2.8 10.4 1.1 20.9c-2.4 14.7-12.8 26.4-37.1 31l-12.4 2.3z"]
};
const faGaugeHigh = {
  prefix: 'fas',
  iconName: 'gauge-high',
  icon: [512, 512, [62461, "tachometer-alt", "tachometer-alt-fast"], "f625", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM256 416c35.3 0 64-28.7 64-64c0-17.4-6.9-33.1-18.1-44.6L366 161.7c5.3-12.1-.2-26.3-12.3-31.6s-26.3 .2-31.6 12.3L257.9 288c-.6 0-1.3 0-1.9 0c-35.3 0-64 28.7-64 64s28.7 64 64 64zM176 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM96 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm352-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faTachometerAlt = faGaugeHigh;
const faTachometerAltFast = faGaugeHigh;
const faEnvelopeOpenText = {
  prefix: 'fas',
  iconName: 'envelope-open-text',
  icon: [512, 512, [], "f658", "M215.4 96L144 96l-36.2 0L96 96l0 8.8L96 144l0 40.4 0 89L.2 202.5c1.6-18.1 10.9-34.9 25.7-45.8L48 140.3 48 96c0-26.5 21.5-48 48-48l76.6 0 49.9-36.9C232.2 3.9 243.9 0 256 0s23.8 3.9 33.5 11L339.4 48 416 48c26.5 0 48 21.5 48 48l0 44.3 22.1 16.4c14.8 10.9 24.1 27.7 25.7 45.8L416 273.4l0-89 0-40.4 0-39.2 0-8.8-11.8 0L368 96l-71.4 0-81.3 0zM0 448L0 242.1 217.6 403.3c11.1 8.2 24.6 12.7 38.4 12.7s27.3-4.4 38.4-12.7L512 242.1 512 448s0 0 0 0c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64c0 0 0 0 0 0zM176 160l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faHospital = {
  prefix: 'fas',
  iconName: 'hospital',
  icon: [640, 512, [127973, 62589, "hospital-alt", "hospital-wide"], "f0f8", "M192 48c0-26.5 21.5-48 48-48L400 0c26.5 0 48 21.5 48 48l0 464-80 0 0-80c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 80-80 0 0-464zM48 96l112 0 0 416L48 512c-26.5 0-48-21.5-48-48L0 320l80 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L0 288l0-64 80 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L0 192l0-48c0-26.5 21.5-48 48-48zm544 0c26.5 0 48 21.5 48 48l0 48-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 64-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 144c0 26.5-21.5 48-48 48l-112 0 0-416 112 0zM312 64c-8.8 0-16 7.2-16 16l0 24-24 0c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l24 0 0 24c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-24 24 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-24 0 0-24c0-8.8-7.2-16-16-16l-16 0z"]
};
const faHospitalAlt = faHospital;
const faHospitalWide = faHospital;
const faWineBottle = {
  prefix: 'fas',
  iconName: 'wine-bottle',
  icon: [512, 512, [], "f72f", "M393.4 9.4c12.5-12.5 32.8-12.5 45.3 0l64 64c12.5 12.5 12.5 32.8 0 45.3c-11.8 11.8-30.7 12.5-43.2 1.9l-9.5 9.5-48.8 48.8c-9.2 9.2-11.5 22.9-8.6 35.6c9.4 40.9-1.9 85.6-33.8 117.5L197.3 493.3c-25 25-65.5 25-90.5 0l-88-88c-25-25-25-65.5 0-90.5L180.2 153.3c31.9-31.9 76.6-43.1 117.5-33.8c12.6 2.9 26.4 .5 35.5-8.6l48.8-48.8 9.5-9.5c-10.6-12.6-10-31.4 1.9-43.2zM99.3 347.3l65.4 65.4c6.2 6.2 16.4 6.2 22.6 0l97.4-97.4c6.2-6.2 6.2-16.4 0-22.6l-65.4-65.4c-6.2-6.2-16.4-6.2-22.6 0L99.3 324.7c-6.2 6.2-6.2 16.4 0 22.6z"]
};
const faChessRook = {
  prefix: 'fas',
  iconName: 'chess-rook',
  icon: [448, 512, [9820], "f447", "M32 192L32 48c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 40c0 4.4 3.6 8 8 8l32 0c4.4 0 8-3.6 8-8l0-40c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 40c0 4.4 3.6 8 8 8l32 0c4.4 0 8-3.6 8-8l0-40c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 144c0 10.1-4.7 19.6-12.8 25.6L352 256l16 144L80 400 96 256 44.8 217.6C36.7 211.6 32 202.1 32 192zm176 96l32 0c8.8 0 16-7.2 16-16l0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c0 8.8 7.2 16 16 16zM22.6 473.4L64 432l320 0 41.4 41.4c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6L38.6 512C26.1 512 16 501.9 16 489.4c0-6 2.4-11.8 6.6-16z"]
};
const faBarsStaggered = {
  prefix: 'fas',
  iconName: 'bars-staggered',
  icon: [512, 512, ["reorder", "stream"], "f550", "M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM64 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L96 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
};
const faReorder = faBarsStaggered;
const faStream = faBarsStaggered;
const faDharmachakra = {
  prefix: 'fas',
  iconName: 'dharmachakra',
  icon: [512, 512, [9784], "f655", "M337.8 205.7l48.6-42.5c13.8 19.3 23.4 41.9 27.4 66.2l-64.4 4.3c-2.4-10.1-6.4-19.5-11.6-28zm140.1 19.5c-5.3-38.8-20.6-74.5-43.2-104.3l.8-.7C449 108.4 449.7 87.6 437 75s-33.4-12-45.2 1.5l-.7 .8c-29.8-22.6-65.5-37.9-104.3-43.2l.1-1.1c1.2-17.9-13-33-30.9-33s-32.1 15.2-30.9 33l.1 1.1c-38.8 5.3-74.5 20.6-104.3 43.2l-.7-.8C108.4 63 87.6 62.3 75 75s-12 33.4 1.5 45.2l.8 .7c-22.6 29.8-37.9 65.5-43.2 104.3l-1.1-.1c-17.9-1.2-33 13-33 30.9s15.2 32.1 33 30.9l1.1-.1c5.3 38.8 20.6 74.5 43.2 104.3l-.8 .7C63 403.6 62.3 424.4 75 437s33.4 12 45.2-1.5l.7-.8c29.8 22.6 65.5 37.9 104.3 43.2l-.1 1.1c-1.2 17.9 13 33 30.9 33s32.1-15.2 30.9-33l-.1-1.1c38.8-5.3 74.5-20.6 104.3-43.2l.7 .8c11.8 13.5 32.5 14.2 45.2 1.5s12-33.4-1.5-45.2l-.8-.7c22.6-29.8 37.9-65.5 43.2-104.3l1.1 .1c17.9 1.2 33-13 33-30.9s-15.2-32.1-33-30.9l-1.1 .1zM163.2 125.6c19.3-13.8 41.9-23.4 66.2-27.5l4.3 64.4c-10 2.4-19.5 6.4-28 11.6l-42.5-48.6zm-65 103.8c4.1-24.4 13.7-46.9 27.5-66.2l48.6 42.5c-5.3 8.5-9.2 18-11.6 28l-64.4-4.3zm27.5 119.4c-13.8-19.3-23.4-41.9-27.5-66.2l64.4-4.3c2.4 10 6.4 19.5 11.6 28l-48.6 42.5zm103.8 65c-24.4-4.1-46.9-13.7-66.2-27.4l42.5-48.6c8.5 5.3 18 9.2 28 11.6l-4.3 64.4zm119.4-27.4c-19.3 13.8-41.9 23.4-66.2 27.4l-4.3-64.4c10-2.4 19.5-6.4 28-11.6l42.5 48.6zm65-103.8c-4.1 24.4-13.7 46.9-27.4 66.2l-48.6-42.5c5.3-8.5 9.2-18 11.6-28l64.4 4.3zm-65-156.9l-42.5 48.6c-8.5-5.3-18-9.2-28-11.6l4.3-64.4c24.4 4.1 46.9 13.7 66.2 27.5zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faHotdog = {
  prefix: 'fas',
  iconName: 'hotdog',
  icon: [512, 512, [127789], "f80f", "M488.6 23.4c31.2 31.2 31.2 81.9 0 113.1l-352 352c-31.2 31.2-81.9 31.2-113.1 0s-31.2-81.9 0-113.1l352-352c31.2-31.2 81.9-31.2 113.1 0zM443.3 92.7c-6.2-6.2-16.4-6.2-22.6 0c-12.5 12.5-23.8 15.1-37.5 17.6l-2.5 .4c-13.8 2.5-31.6 5.6-48 22c-16.7 16.7-20.9 36-24.1 50.9c0 0 0 0 0 0s0 0 0 0l-.2 1c-3.4 15.6-6 26.4-15.7 36.1s-20.5 12.3-36.1 15.7l-1 .2c-14.9 3.2-34.2 7.4-50.9 24.1s-20.9 36-24.1 50.9l-.2 1c-3.4 15.6-6 26.4-15.7 36.1c-9.2 9.2-18 10.8-32.7 13.4c0 0 0 0 0 0l-.9 .2c-15.6 2.8-34.9 6.9-54.4 26.4c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0c12.5-12.5 23.8-15.1 37.5-17.6l2.5-.4c13.8-2.5 31.6-5.6 48-22c16.7-16.7 20.9-36 24.1-50.9l.2-1c3.4-15.6 6-26.4 15.7-36.1s20.5-12.3 36.1-15.7l1-.2c14.9-3.2 34.2-7.4 50.9-24.1s20.9-36 24.1-50.9l.2-1c3.4-15.6 6-26.4 15.7-36.1c9.2-9.2 18-10.8 32.7-13.4l.9-.2c15.6-2.8 34.9-6.9 54.4-26.4c6.2-6.2 6.2-16.4 0-22.6zM191.2 479.2l288-288L495 207c10.9 10.9 17 25.6 17 41s-6.1 30.1-17 41L289 495c-10.9 10.9-25.6 17-41 17s-30.1-6.1-41-17l-15.8-15.8zM17 305C6.1 294.1 0 279.4 0 264s6.1-30.1 17-41L223 17C233.9 6.1 248.6 0 264 0s30.1 6.1 41 17l15.8 15.8-288 288L17 305z"]
};
const faPersonWalkingWithCane = {
  prefix: 'fas',
  iconName: 'person-walking-with-cane',
  icon: [512, 512, ["blind"], "f29d", "M176 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8.4 32c-36.4 0-69.6 20.5-85.9 53.1L35.4 273.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3L128 231.6l0 43.2c0 17 6.7 33.3 18.7 45.3L224 397.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-89.4c0-12.7-5.1-24.9-14.1-33.9L224 306.7l0-93.4 70.4 93.9c10.6 14.1 30.7 17 44.8 6.4s17-30.7 6.4-44.8L268.8 166.4C250.7 142.2 222.2 128 192 128l-24.4 0zM128.3 346.8L97 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l22-88.2-52.8-52.8zM450.8 505.1c5 7.3 15 9.1 22.3 4s9.1-15 4-22.3L358.9 316.1c-2.8 3.8-6.1 7.3-10.1 10.3c-5 3.8-10.5 6.4-16.2 7.9L450.8 505.1z"]
};
const faBlind = faPersonWalkingWithCane;
const faDrum = {
  prefix: 'fas',
  iconName: 'drum',
  icon: [512, 512, [129345], "f569", "M501.2 76.1c11.1-7.3 14.2-22.1 6.9-33.2s-22.1-14.2-33.2-6.9L370.2 104.5C335.8 98.7 297 96 256 96C114.6 96 0 128 0 208L0 368c0 31.3 27.4 58.8 72 78.7L72 344c0-13.3 10.7-24 24-24s24 10.7 24 24l0 119.4c33 8.9 71.1 14.5 112 16.1L232 376c0-13.3 10.7-24 24-24s24 10.7 24 24l0 103.5c40.9-1.6 79-7.2 112-16.1L392 344c0-13.3 10.7-24 24-24s24 10.7 24 24l0 102.7c44.6-19.9 72-47.4 72-78.7l0-160c0-41.1-30.2-69.5-78.8-87.4l67.9-44.5zM307.4 145.6l-64.6 42.3c-11.1 7.3-14.2 22.1-6.9 33.2s22.1 14.2 33.2 6.9l111.1-72.8c14.7 3.2 27.9 7 39.4 11.5C458.4 181.8 464 197.4 464 208c0 .8-2.7 17.2-46 35.9C379.1 260.7 322 272 256 272s-123.1-11.3-162-28.1C50.7 225.2 48 208.8 48 208c0-10.6 5.6-26.2 44.4-41.3C130.6 151.9 187.8 144 256 144c18 0 35.1 .5 51.4 1.6z"]
};
const faIceCream = {
  prefix: 'fas',
  iconName: 'ice-cream',
  icon: [448, 512, [127848], "f810", "M367.1 160c.6-5.3 .9-10.6 .9-16C368 64.5 303.5 0 224 0S80 64.5 80 144c0 5.4 .3 10.7 .9 16l-.9 0c-26.5 0-48 21.5-48 48s21.5 48 48 48l53.5 0 181 0 53.5 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-.9 0zM96 288L200.8 497.7c4.4 8.8 13.3 14.3 23.2 14.3s18.8-5.5 23.2-14.3L352 288 96 288z"]
};
const faHeartCircleBolt = {
  prefix: 'fas',
  iconName: 'heart-circle-bolt',
  icon: [576, 512, [], "e4fc", "M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9l2.6-2.4C267.2 438.6 256 404.6 256 368c0-97.2 78.8-176 176-176c28.3 0 55 6.7 78.7 18.5c.9-6.5 1.3-13 1.3-19.6l0-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1l0 5.8c0 41.5 17.2 81.2 47.6 109.5zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm47.9-225c4.3 3.7 5.4 9.9 2.6 14.9L452.4 356l35.6 0c5.2 0 9.8 3.3 11.4 8.2s-.1 10.3-4.2 13.4l-96 72c-4.5 3.4-10.8 3.2-15.1-.6s-5.4-9.9-2.6-14.9L411.6 380 376 380c-5.2 0-9.8-3.3-11.4-8.2s.1-10.3 4.2-13.4l96-72c4.5-3.4 10.8-3.2 15.1 .6z"]
};
const faFax = {
  prefix: 'fas',
  iconName: 'fax',
  icon: [512, 512, [128224, 128439], "f1ac", "M128 64l0 96 64 0 0-96 194.7 0L416 93.3l0 66.7 64 0 0-66.7c0-17-6.7-33.3-18.7-45.3L432 18.7C420 6.7 403.7 0 386.7 0L192 0c-35.3 0-64 28.7-64 64zM0 160L0 480c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-320c0-17.7-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32zm480 32l-352 0 0 288c0 17.7 14.3 32 32 32l320 0c17.7 0 32-14.3 32-32l0-256c0-17.7-14.3-32-32-32zM256 256a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM224 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faParagraph = {
  prefix: 'fas',
  iconName: 'paragraph',
  icon: [448, 512, [182], "f1dd", "M192 32l64 0 160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352-32 0 0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-32 0c-88.4 0-160-71.6-160-160s71.6-160 160-160z"]
};
const faCheckToSlot = {
  prefix: 'fas',
  iconName: 'check-to-slot',
  icon: [576, 512, ["vote-yea"], "f772", "M96 80c0-26.5 21.5-48 48-48l288 0c26.5 0 48 21.5 48 48l0 304L96 384 96 80zm313 47c-9.4-9.4-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L409 161c9.4-9.4 9.4-24.6 0-33.9zM0 336c0-26.5 21.5-48 48-48l16 0 0 128 448 0 0-128 16 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48L48 480c-26.5 0-48-21.5-48-48l0-96z"]
};
const faVoteYea = faCheckToSlot;
const faStarHalf = {
  prefix: 'fas',
  iconName: 'star-half',
  icon: [576, 512, [61731], "f089", "M288 0c-12.2 .1-23.3 7-28.6 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3L288 439.8 288 0zM429.9 512c1.1 .1 2.1 .1 3.2 0l-3.2 0z"]
};
const faBoxesStacked = {
  prefix: 'fas',
  iconName: 'boxes-stacked',
  icon: [576, 512, [62625, "boxes", "boxes-alt"], "f468", "M248 0L208 0c-26.5 0-48 21.5-48 48l0 112c0 35.3 28.7 64 64 64l128 0c35.3 0 64-28.7 64-64l0-112c0-26.5-21.5-48-48-48L328 0l0 80c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-80zM64 256c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l160 0c35.3 0 64-28.7 64-64l0-128c0-35.3-28.7-64-64-64l-40 0 0 80c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-80-40 0zM352 512l160 0c35.3 0 64-28.7 64-64l0-128c0-35.3-28.7-64-64-64l-40 0 0 80c0 8.8-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-80-40 0c-15 0-28.8 5.1-39.7 13.8c4.9 10.4 7.7 22 7.7 34.2l0 160c0 12.2-2.8 23.8-7.7 34.2C323.2 506.9 337 512 352 512z"]
};
const faBoxes = faBoxesStacked;
const faBoxesAlt = faBoxesStacked;
const faLink = {
  prefix: 'fas',
  iconName: 'link',
  icon: [640, 512, [128279, "chain"], "f0c1", "M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"]
};
const faChain = faLink;
const faEarListen = {
  prefix: 'fas',
  iconName: 'ear-listen',
  icon: [512, 512, ["assistive-listening-systems"], "f2a2", "M398.3 3.4c-15.8-7.9-35-1.5-42.9 14.3c-7.9 15.8-1.5 34.9 14.2 42.9l.4 .2c.4 .2 1.1 .6 2.1 1.2c2 1.2 5 3 8.7 5.6c7.5 5.2 17.6 13.2 27.7 24.2C428.5 113.4 448 146 448 192c0 17.7 14.3 32 32 32s32-14.3 32-32c0-66-28.5-113.4-56.5-143.7C441.6 33.2 427.7 22.2 417.3 15c-5.3-3.7-9.7-6.4-13-8.3c-1.6-1-3-1.7-4-2.2c-.5-.3-.9-.5-1.2-.7l-.4-.2-.2-.1c0 0 0 0-.1 0c0 0 0 0 0 0L384 32 398.3 3.4zM128.7 227.5c6.2-56 53.7-99.5 111.3-99.5c61.9 0 112 50.1 112 112c0 29.3-11.2 55.9-29.6 75.9c-17 18.4-34.4 45.1-34.4 78l0 6.1c0 26.5-21.5 48-48 48c-17.7 0-32 14.3-32 32s14.3 32 32 32c61.9 0 112-50.1 112-112l0-6.1c0-9.8 5.4-21.7 17.4-34.7C398.3 327.9 416 286 416 240c0-97.2-78.8-176-176-176C149.4 64 74.8 132.5 65.1 220.5c-1.9 17.6 10.7 33.4 28.3 35.3s33.4-10.7 35.3-28.3zM32 512a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM192 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0zM208 240c0-17.7 14.3-32 32-32s32 14.3 32 32c0 13.3 10.7 24 24 24s24-10.7 24-24c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 13.3 10.7 24 24 24s24-10.7 24-24z"]
};
const faAssistiveListeningSystems = faEarListen;
const faTreeCity = {
  prefix: 'fas',
  iconName: 'tree-city',
  icon: [640, 512, [], "e587", "M288 48c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 144 40 0 0-72c0-13.3 10.7-24 24-24s24 10.7 24 24l0 72 24 0c26.5 0 48 21.5 48 48l0 224c0 26.5-21.5 48-48 48l-160 0-96 0c-26.5 0-48-21.5-48-48l0-416zm64 32l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM352 272l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm176-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM512 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM224 160c0 6-1 11-2 16c20 14 34 38 34 64c0 45-36 80-80 80l-16 0 0 160c0 18-15 32-32 32c-18 0-32-14-32-32l0-160-16 0c-45 0-80-35-80-80c0-26 13-50 33-64c-1-5-1-10-1-16c0-53 42-96 96-96c53 0 96 43 96 96z"]
};
const faPlay = {
  prefix: 'fas',
  iconName: 'play',
  icon: [384, 512, [9654], "f04b", "M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"]
};
const faFont = {
  prefix: 'fas',
  iconName: 'font',
  icon: [448, 512, [], "f031", "M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z"]
};
const faTableCellsRowLock = {
  prefix: 'fas',
  iconName: 'table-cells-row-lock',
  icon: [640, 512, [], "e67a", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 65.1c-37.8 5.4-69.4 29.6-85.2 62.9L360 224l0 64 56 0 0 8.6c-19.1 11.1-32 31.7-32 55.4l-24 0 0 64 24 0 0 64L64 480c-35.3 0-64-28.7-64-64L0 96zM64 224l0 64 88 0 0-64-88 0zm232 0l-88 0 0 64 88 0 0-64zM152 352l-88 0 0 64 88 0 0-64zm56 0l0 64 88 0 0-64-88 0zM528 240c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faRupiahSign = {
  prefix: 'fas',
  iconName: 'rupiah-sign',
  icon: [512, 512, [], "e23d", "M0 64C0 46.3 14.3 32 32 32l80 0c79.5 0 144 64.5 144 144c0 58.8-35.2 109.3-85.7 131.7l51.4 128.4c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8L106.3 320 64 320l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 288 0 64zM64 256l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80L64 96l0 160zm256-96l80 0c61.9 0 112 50.1 112 112s-50.1 112-112 112l-48 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128 0-160c0-17.7 14.3-32 32-32zm80 160c26.5 0 48-21.5 48-48s-21.5-48-48-48l-48 0 0 96 48 0z"]
};
const faMagnifyingGlass = {
  prefix: 'fas',
  iconName: 'magnifying-glass',
  icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
};
const faSearch = faMagnifyingGlass;
const faTableTennisPaddleBall = {
  prefix: 'fas',
  iconName: 'table-tennis-paddle-ball',
  icon: [512, 512, [127955, "ping-pong-paddle-ball", "table-tennis"], "f45d", "M416 288c-50.1 0-93.6 28.8-114.6 70.8L68.9 126.3l.6-.6 60.1-60.1c87.5-87.5 229.3-87.5 316.8 0c67.1 67.1 82.7 166.3 46.8 248.3C471.8 297.6 445 288 416 288zM49.3 151.9L290.1 392.7c-1.4 7.5-2.1 15.3-2.1 23.3c0 23.2 6.2 44.9 16.9 63.7c-3 .2-6.1 .3-9.2 .3l-2.7 0c-33.9 0-66.5-13.5-90.5-37.5l-9.8-9.8c-13.1-13.1-34.6-12.4-46.8 1.7L88.2 501c-5.8 6.7-14.2 10.7-23 11s-17.5-3.1-23.8-9.4l-32-32C3.1 464.3-.3 455.7 0 446.9s4.3-17.2 11-23l66.6-57.7c14-12.2 14.8-33.7 1.7-46.8l-9.8-9.8C45.5 285.5 32 252.9 32 219l0-2.7c0-22.8 6.1-44.9 17.3-64.3zM416 320a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]
};
const faPingPongPaddleBall = faTableTennisPaddleBall;
const faTableTennis = faTableTennisPaddleBall;
const faPersonDotsFromLine = {
  prefix: 'fas',
  iconName: 'person-dots-from-line',
  icon: [576, 512, ["diagnoses"], "f470", "M288 176A88 88 0 1 0 288 0a88 88 0 1 0 0 176zM78.7 372.9c15-12.5 50-34.4 97.3-50.1L176 432l224 0 0-109.3c47.3 15.8 82.3 37.7 97.3 50.1c20.4 17 50.6 14.2 67.6-6.1s14.2-50.6-6.1-67.6c-12-10-30.1-22.5-53.2-35C497.2 278.4 481.7 288 464 288c-26.5 0-48-21.5-48-48c0-4.3 .6-8.4 1.6-12.4C379.1 215.9 335.3 208 288 208c-60.2 0-114.9 12.9-160 29.9c0 .7 0 1.4 0 2.1c0 26.5-21.5 48-48 48c-11.8 0-22.7-4.3-31-11.4c-13.1 8.1-23.7 15.9-31.7 22.5c-20.4 17-23.1 47.2-6.1 67.6s47.2 23.1 67.6 6.1zM24 464c-13.3 0-24 10.7-24 24s10.7 24 24 24l528 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 464zM224 280a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm104 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM96 240a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm368 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faDiagnoses = faPersonDotsFromLine;
const faTrashCanArrowUp = {
  prefix: 'fas',
  iconName: 'trash-can-arrow-up',
  icon: [448, 512, ["trash-restore-alt"], "f82a", "M163.8 0L284.2 0c12.1 0 23.2 6.8 28.6 17.7L320 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 7.2-14.3C140.6 6.8 151.7 0 163.8 0zM32 128l384 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-320zm192 64c-6.4 0-12.5 2.5-17 7l-80 80c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39L200 408c0 13.3 10.7 24 24 24s24-10.7 24-24l0-134.1 39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-4.5-4.5-10.6-7-17-7z"]
};
const faTrashRestoreAlt = faTrashCanArrowUp;
const faNairaSign = {
  prefix: 'fas',
  iconName: 'naira-sign',
  icon: [448, 512, [], "e1f6", "M122.6 46.3c-7.8-11.7-22.4-17-35.9-12.9S64 49.9 64 64l0 192-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 100.2 0 97.2 145.8c7.8 11.7 22.4 17 35.9 12.9s22.7-16.5 22.7-30.6l0-128 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-192c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 192-57.5 0L122.6 46.3zM305.1 320l14.9 0 0 22.3L305.1 320zM185.5 256L128 256l0-86.3L185.5 256z"]
};
const faCartArrowDown = {
  prefix: 'fas',
  iconName: 'cart-arrow-down',
  icon: [576, 512, [], "f218", "M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48l45.5 0c3.8 0 7.1 2.7 7.9 6.5l51.6 271c6.5 34 36.2 58.5 70.7 58.5L488 384c13.3 0 24-10.7 24-24s-10.7-24-24-24l-288.3 0c-11.5 0-21.4-8.2-23.6-19.5L170.7 288l288.5 0c32.6 0 61.1-21.8 69.5-53.3l41-152.3C576.6 57 557.4 32 531.1 32L360 32l0 102.1 23-23c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-64 64c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l23 23L312 32 120.1 32C111 12.8 91.6 0 69.5 0L24 0zM176 512a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm336-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faWalkieTalkie = {
  prefix: 'fas',
  iconName: 'walkie-talkie',
  icon: [384, 512, [], "f8ef", "M112 24c0-13.3-10.7-24-24-24S64 10.7 64 24l0 72L48 96C21.5 96 0 117.5 0 144L0 300.1c0 12.7 5.1 24.9 14.1 33.9l3.9 3.9c9 9 14.1 21.2 14.1 33.9L32 464c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-92.1c0-12.7 5.1-24.9 14.1-33.9l3.9-3.9c9-9 14.1-21.2 14.1-33.9L384 144c0-26.5-21.5-48-48-48l-16 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l-32 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l-48 0 0-72zm0 136l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faFilePen = {
  prefix: 'fas',
  iconName: 'file-pen',
  icon: [576, 512, [128221, "file-edit"], "f31c", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 125.7-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"]
};
const faFileEdit = faFilePen;
const faReceipt = {
  prefix: 'fas',
  iconName: 'receipt',
  icon: [384, 512, [129534], "f543", "M14 2.2C22.5-1.7 32.5-.3 39.6 5.8L80 40.4 120.4 5.8c9-7.7 22.3-7.7 31.2 0L192 40.4 232.4 5.8c9-7.7 22.3-7.7 31.2 0L304 40.4 344.4 5.8c7.1-6.1 17.1-7.5 25.6-3.6s14 12.4 14 21.8l0 464c0 9.4-5.5 17.9-14 21.8s-18.5 2.5-25.6-3.6L304 471.6l-40.4 34.6c-9 7.7-22.3 7.7-31.2 0L192 471.6l-40.4 34.6c-9 7.7-22.3 7.7-31.2 0L80 471.6 39.6 506.2c-7.1 6.1-17.1 7.5-25.6 3.6S0 497.4 0 488L0 24C0 14.6 5.5 6.1 14 2.2zM96 144c-8.8 0-16 7.2-16 16s7.2 16 16 16l192 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L96 144zM80 352c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L96 336c-8.8 0-16 7.2-16 16zM96 240c-8.8 0-16 7.2-16 16s7.2 16 16 16l192 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L96 240z"]
};
const faSquarePen = {
  prefix: 'fas',
  iconName: 'square-pen',
  icon: [448, 512, ["pen-square", "pencil-square"], "f14b", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM325.8 139.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-21.4 21.4-71-71 21.4-21.4c15.6-15.6 40.9-15.6 56.6 0zM119.9 289L225.1 183.8l71 71L190.9 359.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"]
};
const faPenSquare = faSquarePen;
const faPencilSquare = faSquarePen;
const faSuitcaseRolling = {
  prefix: 'fas',
  iconName: 'suitcase-rolling',
  icon: [384, 512, [], "f5c1", "M144 56c0-4.4 3.6-8 8-8l80 0c4.4 0 8 3.6 8 8l0 72-96 0 0-72zm176 72l-32 0 0-72c0-30.9-25.1-56-56-56L152 0C121.1 0 96 25.1 96 56l0 72-32 0c-35.3 0-64 28.7-64 64L0 416c0 35.3 28.7 64 64 64c0 17.7 14.3 32 32 32s32-14.3 32-32l128 0c0 17.7 14.3 32 32 32s32-14.3 32-32c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64zM112 224l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 128l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faPersonCircleExclamation = {
  prefix: 'fas',
  iconName: 'person-circle-exclamation',
  icon: [576, 512, [], "e53f", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM432 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z"]
};
const faChevronDown = {
  prefix: 'fas',
  iconName: 'chevron-down',
  icon: [512, 512, [], "f078", "M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]
};
const faBatteryFull = {
  prefix: 'fas',
  iconName: 'battery-full',
  icon: [576, 512, [128267, "battery", "battery-5"], "f240", "M464 160c8.8 0 16 7.2 16 16l0 160c0 8.8-7.2 16-16 16L80 352c-8.8 0-16-7.2-16-16l0-160c0-8.8 7.2-16 16-16l384 0zM80 96C35.8 96 0 131.8 0 176L0 336c0 44.2 35.8 80 80 80l384 0c44.2 0 80-35.8 80-80l0-16c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-16c0-44.2-35.8-80-80-80L80 96zm368 96L96 192l0 128 352 0 0-128z"]
};
const faBattery = faBatteryFull;
const faBattery5 = faBatteryFull;
const faSkullCrossbones = {
  prefix: 'fas',
  iconName: 'skull-crossbones',
  icon: [448, 512, [128369, 9760], "f714", "M368 128c0 44.4-25.4 83.5-64 106.4l0 21.6c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-21.6c-38.6-23-64-62.1-64-106.4C80 57.3 144.5 0 224 0s144 57.3 144 128zM168 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM3.4 273.7c7.9-15.8 27.1-22.2 42.9-14.3L224 348.2l177.7-88.8c15.8-7.9 35-1.5 42.9 14.3s1.5 35-14.3 42.9L295.6 384l134.8 67.4c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3L224 419.8 46.3 508.6c-15.8 7.9-35 1.5-42.9-14.3s-1.5-35 14.3-42.9L152.4 384 17.7 316.6C1.9 308.7-4.5 289.5 3.4 273.7z"]
};
const faCodeCompare = {
  prefix: 'fas',
  iconName: 'code-compare',
  icon: [512, 512, [], "e13a", "M320 488c0 9.5-5.6 18.1-14.2 21.9s-18.8 2.3-25.8-4.1l-80-72c-5.1-4.6-7.9-11-7.9-17.8s2.9-13.3 7.9-17.8l80-72c7-6.3 17.2-7.9 25.8-4.1s14.2 12.4 14.2 21.9l0 40 16 0c35.3 0 64-28.7 64-64l0-166.7C371.7 141 352 112.8 352 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3L464 320c0 70.7-57.3 128-128 128l-16 0 0 40zM456 80a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM192 24c0-9.5 5.6-18.1 14.2-21.9s18.8-2.3 25.8 4.1l80 72c5.1 4.6 7.9 11 7.9 17.8s-2.9 13.3-7.9 17.8l-80 72c-7 6.3-17.2 7.9-25.8 4.1s-14.2-12.4-14.2-21.9l0-40-16 0c-35.3 0-64 28.7-64 64l0 166.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3L48 192c0-70.7 57.3-128 128-128l16 0 0-40zM56 432a24 24 0 1 0 48 0 24 24 0 1 0 -48 0z"]
};
const faListUl = {
  prefix: 'fas',
  iconName: 'list-ul',
  icon: [512, 512, ["list-dots"], "f0ca", "M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faListDots = faListUl;
const faSchoolLock = {
  prefix: 'fas',
  iconName: 'school-lock',
  icon: [640, 512, [], "e56f", "M302.2 5.4c10.7-7.2 24.8-7.2 35.5 0L473.7 96 592 96c26.5 0 48 21.5 48 48l0 128c0-61.9-50.1-112-112-112s-112 50.1-112 112l0 24.6c-19.1 11.1-32 31.7-32 55.4l-63.7 0-.3 0c-35.3 0-64 28.7-64 64l0 96 64 0s0 0 0 0L48 512c-26.5 0-48-21.5-48-48L0 144c0-26.5 21.5-48 48-48l118.3 0L302.2 5.4zM80 208l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm0 128l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm240-72a88 88 0 1 0 0-176 88 88 0 1 0 0 176zm16-120l0 16 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16s16 7.2 16 16zm192 96c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-80 32c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48z"]
};
const faTowerCell = {
  prefix: 'fas',
  iconName: 'tower-cell',
  icon: [576, 512, [], "e585", "M62.6 2.3C46.2-4.3 27.6 3.6 20.9 20C7.4 53.4 0 89.9 0 128s7.4 74.6 20.9 108c6.6 16.4 25.3 24.3 41.7 17.7S86.9 228.4 80.3 212C69.8 186.1 64 157.8 64 128s5.8-58.1 16.3-84C86.9 27.6 79 9 62.6 2.3zm450.8 0C497 9 489.1 27.6 495.7 44C506.2 69.9 512 98.2 512 128s-5.8 58.1-16.3 84c-6.6 16.4 1.3 35 17.7 41.7s35-1.3 41.7-17.7c13.5-33.4 20.9-69.9 20.9-108s-7.4-74.6-20.9-108C548.4 3.6 529.8-4.3 513.4 2.3zM340.1 165.2c7.5-10.5 11.9-23.3 11.9-37.2c0-35.3-28.7-64-64-64s-64 28.7-64 64c0 13.9 4.4 26.7 11.9 37.2L98.9 466.8c-7.3 16.1-.2 35.1 15.9 42.4s35.1 .2 42.4-15.9L177.7 448l220.6 0 20.6 45.2c7.3 16.1 26.3 23.2 42.4 15.9s23.2-26.3 15.9-42.4L340.1 165.2zM369.2 384l-162.4 0 14.5-32 133.3 0 14.5 32zM288 205.3L325.6 288l-75.2 0L288 205.3zM163.3 73.6c5.3-12.1-.2-26.3-12.4-31.6s-26.3 .2-31.6 12.4C109.5 77 104 101.9 104 128s5.5 51 15.3 73.6c5.3 12.1 19.5 17.7 31.6 12.4s17.7-19.5 12.4-31.6C156 165.8 152 147.4 152 128s4-37.8 11.3-54.4zM456.7 54.4c-5.3-12.1-19.5-17.7-31.6-12.4s-17.7 19.5-12.4 31.6C420 90.2 424 108.6 424 128s-4 37.8-11.3 54.4c-5.3 12.1 .2 26.3 12.4 31.6s26.3-.2 31.6-12.4C466.5 179 472 154.1 472 128s-5.5-51-15.3-73.6z"]
};
const faDownLong = {
  prefix: 'fas',
  iconName: 'down-long',
  icon: [320, 512, ["long-arrow-alt-down"], "f309", "M2 334.5c-3.8 8.8-2 19 4.6 26l136 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l136-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L128 0C110.3 0 96 14.3 96 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"]
};
const faLongArrowAltDown = faDownLong;
const faRankingStar = {
  prefix: 'fas',
  iconName: 'ranking-star',
  icon: [640, 512, [], "e561", "M353.8 54.1L330.2 6.3c-3.9-8.3-16.1-8.6-20.4 0L286.2 54.1l-52.3 7.5c-9.3 1.4-13.3 12.9-6.4 19.8l38 37-9 52.1c-1.4 9.3 8.2 16.5 16.8 12.2l46.9-24.8 46.6 24.4c8.6 4.3 18.3-2.9 16.8-12.2l-9-52.1 38-36.6c6.8-6.8 2.9-18.3-6.4-19.8l-52.3-7.5zM256 256c-17.7 0-32 14.3-32 32l0 192c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-192c0-17.7-14.3-32-32-32l-128 0zM32 320c-17.7 0-32 14.3-32 32L0 480c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32L32 320zm416 96l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-128 0c-17.7 0-32 14.3-32 32z"]
};
const faChessKing = {
  prefix: 'fas',
  iconName: 'chess-king',
  icon: [448, 512, [9818], "f43f", "M224 0c17.7 0 32 14.3 32 32l0 16 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 48 152 0c22.1 0 40 17.9 40 40c0 5.3-1 10.5-3.1 15.4L368 400 80 400 3.1 215.4C1 210.5 0 205.3 0 200c0-22.1 17.9-40 40-40l152 0 0-48-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-16c0-17.7 14.3-32 32-32zM38.6 473.4L80 432l288 0 41.4 41.4c4.2 4.2 6.6 10 6.6 16c0 12.5-10.1 22.6-22.6 22.6L54.6 512C42.1 512 32 501.9 32 489.4c0-6 2.4-11.8 6.6-16z"]
};
const faPersonHarassing = {
  prefix: 'fas',
  iconName: 'person-harassing',
  icon: [576, 512, [], "e549", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM59.4 304.5L88 256.9 88 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-244.7 47.4 57.1c11.3 13.6 31.5 15.5 45.1 4.2s15.5-31.5 4.2-45.1l-73.7-88.9c-18.2-22-45.3-34.7-73.9-34.7l-35.9 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9zM480 240a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM464 344l0 58.7-41.4-41.4c-7.3-7.3-17.6-10.6-27.8-9s-18.9 8.1-23.5 17.3l-48 96c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3L408.8 438l54.7 54.7c12.4 12.4 29.1 19.3 46.6 19.3c36.4 0 65.9-29.5 65.9-65.9L576 344c0-30.9-25.1-56-56-56s-56 25.1-56 56zM288 48c0 8.8 7.2 16 16 16l56 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-56 0c-8.8 0-16 7.2-16 16zm-.8 49.7c-7.9-4-17.5-.7-21.5 7.2s-.7 17.5 7.2 21.5l48 24c7.9 4 17.5 .7 21.5-7.2s.7-17.5-7.2-21.5l-48-24z"]
};
const faBrazilianRealSign = {
  prefix: 'fas',
  iconName: 'brazilian-real-sign',
  icon: [512, 512, [], "e46c", "M400 0c17.7 0 32 14.3 32 32l0 18.2c12.5 2.3 24.7 6.4 36.2 12.1l10.1 5.1c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3l-10.2-5.1c-9.9-5-20.9-7.5-32-7.5l-1.7 0c-29.8 0-53.9 24.1-53.9 53.9c0 22 13.4 41.8 33.9 50l52 20.8c44.7 17.9 74.1 61.2 74.1 109.4l0 3.4c0 51.2-33.6 94.6-80 109.2l0 21.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-19.4c-15-3.5-29.4-9.7-42.3-18.3l-23.4-15.6c-14.7-9.8-18.7-29.7-8.9-44.4s29.7-18.7 44.4-8.9L361.2 389c10.8 7.2 23.4 11 36.3 11c27.9 0 50.5-22.6 50.5-50.5l0-3.4c0-22-13.4-41.8-33.9-50l-52-20.8C317.3 257.4 288 214.1 288 165.9C288 114 321.5 70 368 54.2L368 32c0-17.7 14.3-32 32-32zM0 64C0 46.3 14.3 32 32 32l80 0c79.5 0 144 64.5 144 144c0 58.8-35.2 109.3-85.7 131.7l51.4 128.4c6.6 16.4-1.4 35-17.8 41.6s-35-1.4-41.6-17.8L106.3 320 64 320l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 288 0 64zM64 256l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80L64 96l0 160z"]
};
const faLandmarkDome = {
  prefix: 'fas',
  iconName: 'landmark-dome',
  icon: [512, 512, ["landmark-alt"], "f752", "M248 0l16 0c13.3 0 24 10.7 24 24l0 10.7C368.4 48.1 431.9 111.6 445.3 192l2.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 256c-17.7 0-32-14.3-32-32s14.3-32 32-32l2.7 0C80.1 111.6 143.6 48.1 224 34.7L224 24c0-13.3 10.7-24 24-24zM64 288l64 0 0 128 40 0 0-128 64 0 0 128 48 0 0-128 64 0 0 128 40 0 0-128 64 0 0 132.3c.6 .3 1.2 .7 1.8 1.1l48 32c11.7 7.8 17 22.4 12.9 35.9S494.1 512 480 512L32 512c-14.1 0-26.5-9.2-30.6-22.7s1.1-28.1 12.9-35.9l48-32c.6-.4 1.2-.7 1.8-1.1L64 288z"]
};
const faLandmarkAlt = faLandmarkDome;
const faArrowUp = {
  prefix: 'fas',
  iconName: 'arrow-up',
  icon: [384, 512, [8593], "f062", "M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"]
};
const faTv = {
  prefix: 'fas',
  iconName: 'tv',
  icon: [640, 512, [63717, "television", "tv-alt"], "f26c", "M64 64l0 288 512 0 0-288L64 64zM0 64C0 28.7 28.7 0 64 0L576 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 416c-35.3 0-64-28.7-64-64L0 64zM128 448l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-384 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faTelevision = faTv;
const faTvAlt = faTv;
const faShrimp = {
  prefix: 'fas',
  iconName: 'shrimp',
  icon: [512, 512, [129424], "e448", "M64 32C28.7 32 0 60.7 0 96s28.7 64 64 64l1 0c3.7 88.9 77 160 167 160l56 0 0-192-24 0L88.8 128 64 128c-17.7 0-32-14.3-32-32s14.3-32 32-32l400 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L64 32zM224 456c0 13.3 10.7 24 24 24l72 0 0-72.2-64.1-22.4c-12.5-4.4-26.2 2.2-30.6 14.7s2.2 26.2 14.7 30.6l4.5 1.6C233 433.9 224 443.9 224 456zm128 23.3c36.4-3.3 69.5-17.6 96.1-39.6l-86.5-34.6c-3 1.8-6.2 3.2-9.6 4.3l0 69.9zM472.6 415c24.6-30.3 39.4-68.9 39.4-111c0-12.3-1.3-24.3-3.7-35.9L382.8 355.1c.8 3.4 1.2 7 1.2 10.6c0 4.6-.7 9-1.9 13.1L472.6 415zM336 128l-16 0 0 192 18.3 0c9.9 0 19.1 3.2 26.6 8.5l133.5-92.4C471.8 172.6 409.1 128 336 128zM168 192a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faListCheck = {
  prefix: 'fas',
  iconName: 'list-check',
  icon: [512, 512, ["tasks"], "f0ae", "M152.1 38.2c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 113C-2.3 103.6-2.3 88.4 7 79s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zm0 160c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM48 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faTasks = faListCheck;
const faJugDetergent = {
  prefix: 'fas',
  iconName: 'jug-detergent',
  icon: [384, 512, [], "e519", "M96 24c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24l0 24 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 96C74.7 96 64 85.3 64 72s10.7-24 24-24l8 0 0-24zM0 256c0-70.7 57.3-128 128-128l128 0c70.7 0 128 57.3 128 128l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256zm256 0l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faCircleUser = {
  prefix: 'fas',
  iconName: 'circle-user',
  icon: [512, 512, [62142, "user-circle"], "f2bd", "M399 384.2C376.9 345.8 335.4 320 288 320l-64 0c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z"]
};
const faUserCircle = faCircleUser;
const faUserShield = {
  prefix: 'fas',
  iconName: 'user-shield',
  icon: [640, 512, [], "f505", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c1.8 0 3.5-.2 5.3-.5c-76.3-55.1-99.8-141-103.1-200.2c-16.1-4.8-33.1-7.3-50.7-7.3l-91.4 0zm308.8-78.3l-120 48C358 277.4 352 286.2 352 296c0 63.3 25.9 168.8 134.8 214.2c5.9 2.5 12.6 2.5 18.5 0C614.1 464.8 640 359.3 640 296c0-9.8-6-18.6-15.1-22.3l-120-48c-5.7-2.3-12.1-2.3-17.8 0zM591.4 312c-3.9 50.7-27.2 116.7-95.4 149.7l0-187.8L591.4 312z"]
};
const faWind = {
  prefix: 'fas',
  iconName: 'wind',
  icon: [512, 512, [], "f72e", "M288 32c0 17.7 14.3 32 32 32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c53 0 96-43 96-96s-43-96-96-96L320 0c-17.7 0-32 14.3-32 32zm64 352c0 17.7 14.3 32 32 32l32 0c53 0 96-43 96-96s-43-96-96-96L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32 14.3-32 32zM128 512l32 0c53 0 96-43 96-96s-43-96-96-96L32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32z"]
};
const faCarBurst = {
  prefix: 'fas',
  iconName: 'car-burst',
  icon: [640, 512, ["car-crash"], "f5e1", "M176 8c-6.6 0-12.4 4-14.9 10.1l-29.4 74L55.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1L10.9 206.4c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2L90.6 327c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6l35.3-32.5 9.5-35.4 10.4-38.6c8-29.9 30.5-52.1 57.9-60.9l41-59.2c11.3-16.3 26.4-28.9 43.5-37.2c-.4-.6-.8-1.2-1.3-1.8c-4.1-5.1-10.9-7.2-17.2-5.3L220.3 92.1l-29.4-74C188.4 12 182.6 8 176 8zM367.7 161.5l135.6 36.3c6.5 1.8 11.3 7.4 11.8 14.2l4.6 56.5-201.5-54 32.2-46.6c3.8-5.6 10.8-8.1 17.3-6.4zm-69.9-30l-47.9 69.3c-21.6 3-40.3 18.6-46.3 41l-10.4 38.6-16.6 61.8-8.3 30.9c-4.6 17.1 5.6 34.6 22.6 39.2l15.5 4.1c17.1 4.6 34.6-5.6 39.2-22.6l8.3-30.9 247.3 66.3-8.3 30.9c-4.6 17.1 5.6 34.6 22.6 39.2l15.5 4.1c17.1 4.6 34.6-5.6 39.2-22.6l8.3-30.9L595 388l10.4-38.6c6-22.4-2.5-45.2-19.6-58.7l-6.8-84c-2.7-33.7-26.4-62-59-70.8L384.2 99.7c-32.7-8.8-67.3 4-86.5 31.8zm-17 131a24 24 0 1 1 -12.4 46.4 24 24 0 1 1 12.4-46.4zm217.9 83.2A24 24 0 1 1 545 358.1a24 24 0 1 1 -46.4-12.4z"]
};
const faCarCrash = faCarBurst;
const faY = {
  prefix: 'fas',
  iconName: 'y',
  icon: [384, 512, [121], "59", "M58 45.4C47.8 31 27.8 27.7 13.4 38S-4.3 68.2 6 82.6L160 298.3 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-149.7L378 82.6c10.3-14.4 6.9-34.4-7.4-44.6S336.2 31 326 45.4L192 232.9 58 45.4z"]
};
const faPersonSnowboarding = {
  prefix: 'fas',
  iconName: 'person-snowboarding',
  icon: [512, 512, [127938, "snowboarding"], "f7ce", "M209.7 3.4c15.8-7.9 35-1.5 42.9 14.3l25 50 42.4 8.5c19.5 3.9 37.8 12.3 53.5 24.5l126.1 98.1c14 10.9 16.5 31 5.6 44.9s-31 16.5-44.9 5.6l-72.1-56.1-71.5 31.8 33.1 27.6c23.2 19.3 33.5 50 26.7 79.4l-17.4 75.2c-2.2 9.4-8.2 16.8-16.1 21l86.5 33.1c4.6 1.8 9.4 2.6 14.3 2.6l28.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-28.2 0c-10.8 0-21.4-2-31.5-5.8L60.1 371.3c-11.5-4.4-22-11.2-30.8-20L7 329c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.4 22.4c4 4 8.7 7.1 14 9.1l22.4 8.6c-.8-1.6-1.5-3.2-2.1-4.9c-5.6-16.8 3.5-34.9 20.2-40.5L192 264.9l0-53.2c0-24.2 13.7-46.4 35.4-57.2l45.2-22.6-7.5-1.5c-19.4-3.9-35.9-16.5-44.7-34.1l-25-50c-7.9-15.8-1.5-35 14.3-42.9zM139 350.1l159 60.9c-2.1-5.6-2.6-11.9-1.1-18.2l17.4-75.2c1.4-5.9-.7-12-5.3-15.9l-52.8-44 0 18.8c0 20.7-13.2 39-32.8 45.5L139 350.1zM432 0a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faSnowboarding = faPersonSnowboarding;
const faTruckFast = {
  prefix: 'fas',
  iconName: 'truck-fast',
  icon: [640, 512, ["shipping-fast"], "f48b", "M112 0C85.5 0 64 21.5 64 48l0 48L16 96c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 208 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L64 160l-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l16 0 176 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L64 224l-48 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 144 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L64 288l0 128c0 53 43 96 96 96s96-43 96-96l128 0c0 53 43 96 96 96s96-43 96-96l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64 0-32 0-18.7c0-17-6.7-33.3-18.7-45.3L512 114.7c-12-12-28.3-18.7-45.3-18.7L416 96l0-48c0-26.5-21.5-48-48-48L112 0zM544 237.3l0 18.7-128 0 0-96 50.7 0L544 237.3zM160 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm272 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
};
const faShippingFast = faTruckFast;
const faFish = {
  prefix: 'fas',
  iconName: 'fish',
  icon: [576, 512, [128031], "f578", "M180.5 141.5C219.7 108.5 272.6 80 336 80s116.3 28.5 155.5 61.5c39.1 33 66.9 72.4 81 99.8c4.7 9.2 4.7 20.1 0 29.3c-14.1 27.4-41.9 66.8-81 99.8C452.3 403.5 399.4 432 336 432s-116.3-28.5-155.5-61.5c-16.2-13.7-30.5-28.5-42.7-43.1L48.1 379.6c-12.5 7.3-28.4 5.3-38.7-4.9S-3 348.7 4.2 336.1L50 256 4.2 175.9c-7.2-12.6-5-28.4 5.3-38.6s26.1-12.2 38.7-4.9l89.7 52.3c12.2-14.6 26.5-29.4 42.7-43.1zM448 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faUserGraduate = {
  prefix: 'fas',
  iconName: 'user-graduate',
  icon: [448, 512, [], "f501", "M219.3 .5c3.1-.6 6.3-.6 9.4 0l200 40C439.9 42.7 448 52.6 448 64s-8.1 21.3-19.3 23.5L352 102.9l0 57.1c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-57.1L48 93.3l0 65.1 15.7 78.4c.9 4.7-.3 9.6-3.3 13.3s-7.6 5.9-12.4 5.9l-32 0c-4.8 0-9.3-2.1-12.4-5.9s-4.3-8.6-3.3-13.3L16 158.4l0-71.8C6.5 83.3 0 74.3 0 64C0 52.6 8.1 42.7 19.3 40.5l200-40zM111.9 327.7c10.5-3.4 21.8 .4 29.4 8.5l71 75.5c6.3 6.7 17 6.7 23.3 0l71-75.5c7.6-8.1 18.9-11.9 29.4-8.5C401 348.6 448 409.4 448 481.3c0 17-13.8 30.7-30.7 30.7L30.7 512C13.8 512 0 498.2 0 481.3c0-71.9 47-132.7 111.9-153.6z"]
};
const faCircleHalfStroke = {
  prefix: 'fas',
  iconName: 'circle-half-stroke',
  icon: [512, 512, [9680, "adjust"], "f042", "M448 256c0-106-86-192-192-192l0 384c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faAdjust = faCircleHalfStroke;
const faClapperboard = {
  prefix: 'fas',
  iconName: 'clapperboard',
  icon: [512, 512, [], "e131", "M448 32l-86.1 0-1 1-127 127 92.1 0 1-1L453.8 32.3c-1.9-.2-3.8-.3-5.8-.3zm64 128l0-64c0-15.1-5.3-29.1-14-40l-104 104L512 160zM294.1 32l-92.1 0-1 1L73.9 160l92.1 0 1-1 127-127zM64 32C28.7 32 0 60.7 0 96l0 64 6.1 0 1-1 127-127L64 32zM512 192L0 192 0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224z"]
};
const faCircleRadiation = {
  prefix: 'fas',
  iconName: 'circle-radiation',
  icon: [512, 512, [9762, "radiation-alt"], "f7ba", "M256 64a192 192 0 1 1 0 384 192 192 0 1 1 0-384zm0 448A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM200 256c0-20.7 11.3-38.8 28-48.5l-36-62.3c-8.8-15.3-28.7-20.8-42-9c-25.6 22.6-43.9 53.3-50.9 88.1C95.7 241.5 110.3 256 128 256l72 0zm28 48.5l-36 62.4c-8.8 15.3-3.6 35.2 13.1 40.8c16 5.4 33.1 8.3 50.9 8.3s34.9-2.9 50.9-8.3c16.7-5.6 21.9-25.5 13.1-40.8l-36-62.4c-8.2 4.8-17.8 7.5-28 7.5s-19.8-2.7-28-7.5zM312 256l72 0c17.7 0 32.3-14.5 28.8-31.8c-7-34.8-25.3-65.5-50.9-88.1c-13.2-11.7-33.1-6.3-42 9l-36 62.3c16.7 9.7 28 27.8 28 48.5zm-56 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faRadiationAlt = faCircleRadiation;
const faBaseball = {
  prefix: 'fas',
  iconName: 'baseball',
  icon: [512, 512, [129358, 9918, "baseball-ball"], "f433", "M62.7 223.4c-4.8 .4-9.7 .6-14.7 .6c-15.6 0-30.8-2-45.2-5.9C19.2 107.1 107.1 19.2 218.1 2.8C222 17.2 224 32.4 224 48c0 4.9-.2 9.8-.6 14.7c-.7 8.8 5.8 16.5 14.6 17.3s16.5-5.8 17.3-14.6c.5-5.7 .7-11.5 .7-17.3c0-16.5-1.9-32.6-5.6-47.9c1.8 0 3.7-.1 5.6-.1C397.4 0 512 114.6 512 256c0 1.9 0 3.7-.1 5.6c-15.4-3.6-31.4-5.6-47.9-5.6c-5.8 0-11.6 .2-17.3 .7c-8.8 .7-15.4 8.5-14.6 17.3s8.5 15.4 17.3 14.6c4.8-.4 9.7-.6 14.7-.6c15.6 0 30.8 2 45.2 5.9C492.8 404.9 404.9 492.8 293.9 509.2C290 494.8 288 479.6 288 464c0-4.9 .2-9.8 .6-14.7c.7-8.8-5.8-16.5-14.6-17.3s-16.5 5.8-17.3 14.6c-.5 5.7-.7 11.5-.7 17.3c0 16.5 1.9 32.6 5.6 47.9c-1.8 0-3.7 .1-5.6 .1C114.6 512 0 397.4 0 256c0-1.9 0-3.7 .1-5.6C15.4 254.1 31.5 256 48 256c5.8 0 11.6-.2 17.3-.7c8.8-.7 15.4-8.5 14.6-17.3s-8.5-15.4-17.3-14.6zM121.3 208c-8 3.7-11.6 13.2-7.9 21.2s13.2 11.6 21.2 7.9c45.2-20.8 81.7-57.2 102.5-102.5c3.7-8 .2-17.5-7.9-21.2s-17.5-.2-21.2 7.9c-17.6 38.3-48.5 69.2-86.7 86.7zm277.2 74.7c-3.7-8-13.2-11.6-21.2-7.9c-45.2 20.8-81.7 57.2-102.5 102.5c-3.7 8-.2 17.5 7.9 21.2s17.5 .2 21.2-7.9c17.6-38.3 48.5-69.2 86.7-86.7c8-3.7 11.6-13.2 7.9-21.2z"]
};
const faBaseballBall = faBaseball;
const faJetFighterUp = {
  prefix: 'fas',
  iconName: 'jet-fighter-up',
  icon: [512, 512, [], "e518", "M270.7 9.7C268.2 3.8 262.4 0 256 0s-12.2 3.8-14.7 9.7L197.2 112.6c-3.4 8-5.2 16.5-5.2 25.2l0 77-144 84L48 280c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 56 0 32 0 24c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8 144 0 0 32.7L133.5 468c-3.5 3-5.5 7.4-5.5 12l0 16c0 8.8 7.2 16 16 16l96 0 0-64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64 96 0c8.8 0 16-7.2 16-16l0-16c0-4.6-2-9-5.5-12L320 416.7l0-32.7 144 0 0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-24 0-32 0-56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 18.8-144-84 0-77c0-8.7-1.8-17.2-5.2-25.2L270.7 9.7z"]
};
const faDiagramProject = {
  prefix: 'fas',
  iconName: 'diagram-project',
  icon: [576, 512, ["project-diagram"], "f542", "M0 80C0 53.5 21.5 32 48 32l96 0c26.5 0 48 21.5 48 48l0 16 192 0 0-16c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-16-192 0 0 16c0 1.7-.1 3.4-.3 5L272 288l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96c0-1.7 .1-3.4 .3-5L144 224l-96 0c-26.5 0-48-21.5-48-48L0 80z"]
};
const faProjectDiagram = faDiagramProject;
const faCopy = {
  prefix: 'fas',
  iconName: 'copy',
  icon: [448, 512, [], "f0c5", "M208 0L332.1 0c12.7 0 24.9 5.1 33.9 14.1l67.9 67.9c9 9 14.1 21.2 14.1 33.9L448 336c0 26.5-21.5 48-48 48l-192 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48zM48 128l80 0 0 64-64 0 0 256 192 0 0-32 64 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 176c0-26.5 21.5-48 48-48z"]
};
const faVolumeXmark = {
  prefix: 'fas',
  iconName: 'volume-xmark',
  icon: [576, 512, ["volume-mute", "volume-times"], "f6a9", "M301.1 34.8C312.6 40 320 51.4 320 64l0 384c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352 64 352c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l67.8 0L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM425 167l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"]
};
const faVolumeMute = faVolumeXmark;
const faVolumeTimes = faVolumeXmark;
const faHandSparkles = {
  prefix: 'fas',
  iconName: 'hand-sparkles',
  icon: [640, 512, [], "e05d", "M320 0c17.7 0 32 14.3 32 32l0 208c0 8.8 7.2 16 16 16s16-7.2 16-16l0-176c0-17.7 14.3-32 32-32s32 14.3 32 32l0 176c0 8.8 7.2 16 16 16s16-7.2 16-16l0-112c0-17.7 14.3-32 32-32s32 14.3 32 32l0 195.1c-11.9 4.8-21.3 14.9-25 27.8l-8.9 31.2L478.9 391C460.6 396.3 448 413 448 432c0 18.9 12.5 35.6 30.6 40.9C448.4 497.4 409.9 512 368 512l-19.2 0c-59.6 0-116.9-22.9-160-64L76.4 341c-16-15.2-16.6-40.6-1.4-56.6s40.6-16.6 56.6-1.4l60.5 57.6c0-1.5-.1-3.1-.1-4.6l0-272c0-17.7 14.3-32 32-32s32 14.3 32 32l0 176c0 8.8 7.2 16 16 16s16-7.2 16-16l0-208c0-17.7 14.3-32 32-32zm-7.3 326.6c-1.1-3.9-4.7-6.6-8.7-6.6s-7.6 2.7-8.7 6.6L288 352l-25.4 7.3c-3.9 1.1-6.6 4.7-6.6 8.7s2.7 7.6 6.6 8.7L288 384l7.3 25.4c1.1 3.9 4.7 6.6 8.7 6.6s7.6-2.7 8.7-6.6L320 384l25.4-7.3c3.9-1.1 6.6-4.7 6.6-8.7s-2.7-7.6-6.6-8.7L320 352l-7.3-25.4zM104 120l48.3 13.8c4.6 1.3 7.7 5.5 7.7 10.2s-3.1 8.9-7.7 10.2L104 168 90.2 216.3c-1.3 4.6-5.5 7.7-10.2 7.7s-8.9-3.1-10.2-7.7L56 168 7.7 154.2C3.1 152.9 0 148.7 0 144s3.1-8.9 7.7-10.2L56 120 69.8 71.7C71.1 67.1 75.3 64 80 64s8.9 3.1 10.2 7.7L104 120zM584 408l48.3 13.8c4.6 1.3 7.7 5.5 7.7 10.2s-3.1 8.9-7.7 10.2L584 456l-13.8 48.3c-1.3 4.6-5.5 7.7-10.2 7.7s-8.9-3.1-10.2-7.7L536 456l-48.3-13.8c-4.6-1.3-7.7-5.5-7.7-10.2s3.1-8.9 7.7-10.2L536 408l13.8-48.3c1.3-4.6 5.5-7.7 10.2-7.7s8.9 3.1 10.2 7.7L584 408z"]
};
const faGrip = {
  prefix: 'fas',
  iconName: 'grip',
  icon: [448, 512, ["grip-horizontal"], "f58d", "M128 136c0-22.1-17.9-40-40-40L40 96C17.9 96 0 113.9 0 136l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zm0 192c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zm32-192l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM288 328c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zm32-192l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM448 328c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48z"]
};
const faGripHorizontal = faGrip;
const faShareFromSquare = {
  prefix: 'fas',
  iconName: 'share-from-square',
  icon: [576, 512, [61509, "share-square"], "f14d", "M352 224l-46.5 0c-45 0-81.5 36.5-81.5 81.5c0 22.3 10.3 34.3 19.2 40.5c6.8 4.7 12.8 12 12.8 20.3c0 9.8-8 17.8-17.8 17.8l-2.5 0c-2.4 0-4.8-.4-7.1-1.4C210.8 374.8 128 333.4 128 240c0-79.5 64.5-144 144-144l80 0 0-61.3C352 15.5 367.5 0 386.7 0c8.6 0 16.8 3.2 23.2 8.9L548.1 133.3c7.6 6.8 11.9 16.5 11.9 26.7s-4.3 19.9-11.9 26.7l-139 125.1c-5.9 5.3-13.5 8.2-21.4 8.2l-3.7 0c-17.7 0-32-14.3-32-32l0-64zM80 96c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-48c0-17.7 14.3-32 32-32s32 14.3 32 32l0 48c0 44.2-35.8 80-80 80L80 512c-44.2 0-80-35.8-80-80L0 112C0 67.8 35.8 32 80 32l48 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 96z"]
};
const faShareSquare = faShareFromSquare;
const faChildCombatant = {
  prefix: 'fas',
  iconName: 'child-combatant',
  icon: [576, 512, ["child-rifle"], "e4e0", "M176 128A64 64 0 1 0 176 0a64 64 0 1 0 0 128zm-8 352l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-179.5L260.9 321c9.4 15 29.2 19.4 44.1 10s19.4-29.2 10-44.1l-51.7-82.1c-17.6-27.9-48.3-44.9-81.2-44.9l-12.3 0c-33 0-63.7 16.9-81.2 44.9L36.9 287c-9.4 15-4.9 34.7 10 44.1s34.7 4.9 44.1-10L104 300.5 104 480c0 17.7 14.3 32 32 32s32-14.3 32-32zM448 0L432 0 416 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l0 100.3c-9.6 5.5-16 15.9-16 27.7l0 32c-17.7 0-32 14.3-32 32l0 144c0 17.7 14.3 32 32 32l16 0 0 96c0 8.8 7.2 16 16 16l59.5 0c10.4 0 18-9.8 15.5-19.9L484 400l44 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-48 0 0-26.7 53.1-17.7c6.5-2.2 10.9-8.3 10.9-15.2l0-84.5c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16l0 56-16 5.3L480 160c0-11.8-6.4-22.2-16-27.7L464 16c0-8.8-7.2-16-16-16z"]
};
const faChildRifle = faChildCombatant;
const faGun = {
  prefix: 'fas',
  iconName: 'gun',
  icon: [576, 512, [], "e19b", "M528 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 8L32 64C14.3 64 0 78.3 0 96L0 208c0 17.7 14.3 32 32 32l10 0c20.8 0 36.1 19.6 31 39.8L33 440.2c-2.4 9.6-.2 19.7 5.8 27.5S54.1 480 64 480l96 0c14.7 0 27.5-10 31-24.2L217 352l104.5 0c23.7 0 44.8-14.9 52.7-37.2L400.9 240l31.1 0c8.5 0 16.6-3.4 22.6-9.4L477.3 208l66.7 0c17.7 0 32-14.3 32-32l0-80c0-17.7-14.3-32-32-32l-16 0 0-8zM321.4 304L229 304l16-64 105 0-21 58.7c-1.1 3.2-4.2 5.3-7.5 5.3zM80 128l384 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 160c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faSquarePhone = {
  prefix: 'fas',
  iconName: 'square-phone',
  icon: [448, 512, ["phone-square"], "f098", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm90.7 96.7c9.7-2.6 19.9 2.3 23.7 11.6l20 48c3.4 8.2 1 17.6-5.8 23.2L168 231.7c16.6 35.2 45.1 63.7 80.3 80.3l20.2-24.7c5.6-6.8 15-9.2 23.2-5.8l48 20c9.3 3.9 14.2 14 11.6 23.7l-12 44C336.9 378 329 384 320 384C196.3 384 96 283.7 96 160c0-9 6-16.9 14.7-19.3l44-12z"]
};
const faPhoneSquare = faSquarePhone;
const faPlus = {
  prefix: 'fas',
  iconName: 'plus',
  icon: [448, 512, [10133, 61543, "add"], "2b", "M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]
};
const faAdd = faPlus;
const faExpand = {
  prefix: 'fas',
  iconName: 'expand',
  icon: [448, 512, [], "f065", "M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"]
};
const faComputer = {
  prefix: 'fas',
  iconName: 'computer',
  icon: [640, 512, [], "e4e5", "M384 96l0 224L64 320 64 96l320 0zM64 32C28.7 32 0 60.7 0 96L0 320c0 35.3 28.7 64 64 64l117.3 0-10.7 32L96 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-74.7 0-10.7-32L384 384c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L64 32zm464 0c-26.5 0-48 21.5-48 48l0 352c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48l-64 0zm16 64l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm-16 80c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zm32 160a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faXmark = {
  prefix: 'fas',
  iconName: 'xmark',
  icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]
};
const faClose = faXmark;
const faMultiply = faXmark;
const faRemove = faXmark;
const faTimes = faXmark;
const faArrowsUpDownLeftRight = {
  prefix: 'fas',
  iconName: 'arrows-up-down-left-right',
  icon: [512, 512, ["arrows"], "f047", "M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4L224 224l-114.7 0 9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4L224 288l0 114.7-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4L288 288l114.7 0-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4L288 224l0-114.7 9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z"]
};
const faArrows = faArrowsUpDownLeftRight;
const faChalkboardUser = {
  prefix: 'fas',
  iconName: 'chalkboard-user',
  icon: [640, 512, ["chalkboard-teacher"], "f51c", "M160 64c0-35.3 28.7-64 64-64L576 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64l-239.2 0c-11.8-25.5-29.9-47.5-52.4-64l99.6 0 0-32c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 32 64 0 0-288L224 64l0 49.1C205.2 102.2 183.3 96 160 96l0-32zm0 64a96 96 0 1 1 0 192 96 96 0 1 1 0-192zM133.3 352l53.3 0C260.3 352 320 411.7 320 485.3c0 14.7-11.9 26.7-26.7 26.7L26.7 512C11.9 512 0 500.1 0 485.3C0 411.7 59.7 352 133.3 352z"]
};
const faChalkboardTeacher = faChalkboardUser;
const faPesoSign = {
  prefix: 'fas',
  iconName: 'peso-sign',
  icon: [384, 512, [], "e222", "M64 32C46.3 32 32 46.3 32 64l0 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 64 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 80 0c68.4 0 127.7-39 156.8-96l19.2 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-.7 0c.5-5.3 .7-10.6 .7-16s-.2-10.7-.7-16l.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-19.2 0C303.7 71 244.4 32 176 32L64 32zm190.4 96L96 128l0-32 80 0c30.5 0 58.2 12.2 78.4 32zM96 192l190.9 0c.7 5.2 1.1 10.6 1.1 16s-.4 10.8-1.1 16L96 224l0-32zm158.4 96c-20.2 19.8-47.9 32-78.4 32l-80 0 0-32 158.4 0z"]
};
const faBuildingShield = {
  prefix: 'fas',
  iconName: 'building-shield',
  icon: [576, 512, [], "e4d8", "M0 48C0 21.5 21.5 0 48 0L336 0c26.5 0 48 21.5 48 48l0 159-42.4 17L304 224l-32 0c-8.8 0-16 7.2-16 16l0 32 0 24.2 0 7.8c0 .9 .1 1.7 .2 2.6c2.3 58.1 24.1 144.8 98.7 201.5c-5.8 2.5-12.2 3.9-18.9 3.9l-96 0 0-80c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 80-96 0c-26.5 0-48-21.5-48-48L0 48zM80 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM64 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L80 96c-8.8 0-16 7.2-16 16zM176 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm80 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM423.1 225.7c5.7-2.3 12.1-2.3 17.8 0l120 48C570 277.4 576 286.2 576 296c0 63.3-25.9 168.8-134.8 214.2c-5.9 2.5-12.6 2.5-18.5 0C313.9 464.8 288 359.3 288 296c0-9.8 6-18.6 15.1-22.3l120-48zM527.4 312L432 273.8l0 187.8c68.2-33 91.5-99 95.4-149.7z"]
};
const faBaby = {
  prefix: 'fas',
  iconName: 'baby',
  icon: [448, 512, [], "f77c", "M152 88a72 72 0 1 1 144 0A72 72 0 1 1 152 88zM39.7 144.5c13-17.9 38-21.8 55.9-8.8L131.8 162c26.8 19.5 59.1 30 92.2 30s65.4-10.5 92.2-30l36.2-26.4c17.9-13 42.9-9 55.9 8.8s9 42.9-8.8 55.9l-36.2 26.4c-13.6 9.9-28.1 18.2-43.3 25l0 36.3-192 0 0-36.3c-15.2-6.7-29.7-15.1-43.3-25L48.5 200.3c-17.9-13-21.8-38-8.8-55.9zm89.8 184.8l60.6 53-26 37.2 24.3 24.3c15.6 15.6 15.6 40.9 0 56.6s-40.9 15.6-56.6 0l-48-48C70 438.6 68.1 417 79.2 401.1l50.2-71.8zm128.5 53l60.6-53 50.2 71.8c11.1 15.9 9.2 37.5-4.5 51.2l-48 48c-15.6 15.6-40.9 15.6-56.6 0s-15.6-40.9 0-56.6L284 419.4l-26-37.2z"]
};
const faUsersLine = {
  prefix: 'fas',
  iconName: 'users-line',
  icon: [640, 512, [], "e592", "M211.2 96a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM32 256c0 17.7 14.3 32 32 32l85.6 0c10.1-39.4 38.6-71.5 75.8-86.6c-9.7-6-21.2-9.4-33.4-9.4l-96 0c-35.3 0-64 28.7-64 64zm461.6 32l82.4 0c17.7 0 32-14.3 32-32c0-35.3-28.7-64-64-64l-96 0c-11.7 0-22.7 3.1-32.1 8.6c38.1 14.8 67.4 47.3 77.7 87.4zM391.2 226.4c-6.9-1.6-14.2-2.4-21.6-2.4l-96 0c-8.5 0-16.7 1.1-24.5 3.1c-30.8 8.1-55.6 31.1-66.1 60.9c-3.5 10-5.5 20.8-5.5 32c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32c0-11.2-1.9-22-5.5-32c-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM321.6 192a80 80 0 1 0 0-160 80 80 0 1 0 0 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416z"]
};
const faQuoteLeft = {
  prefix: 'fas',
  iconName: 'quote-left',
  icon: [448, 512, [8220, "quote-left-alt"], "f10d", "M0 216C0 149.7 53.7 96 120 96l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-32 0-32 0-72zm256 0c0-66.3 53.7-120 120-120l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-32 0-32 0-72z"]
};
const faQuoteLeftAlt = faQuoteLeft;
const faTractor = {
  prefix: 'fas',
  iconName: 'tractor',
  icon: [640, 512, [128668], "f722", "M96 64c0-35.3 28.7-64 64-64L266.3 0c26.2 0 49.7 15.9 59.4 40.2L373.7 160 480 160l0-33.8c0-24.8 5.8-49.3 16.9-71.6l2.5-5c7.9-15.8 27.1-22.2 42.9-14.3s22.2 27.1 14.3 42.9l-2.5 5c-6.7 13.3-10.1 28-10.1 42.9l0 33.8 56 0c22.1 0 40 17.9 40 40l0 45.4c0 16.5-8.5 31.9-22.6 40.7l-43.3 27.1c-14.2-5.9-29.8-9.2-46.1-9.2c-39.3 0-74.1 18.9-96 48l-80 0c0 17.7-14.3 32-32 32l-8.2 0c-1.7 4.8-3.7 9.5-5.8 14.1l5.8 5.8c12.5 12.5 12.5 32.8 0 45.3l-22.6 22.6c-12.5 12.5-32.8 12.5-45.3 0l-5.8-5.8c-4.6 2.2-9.3 4.1-14.1 5.8l0 8.2c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-8.2c-4.8-1.7-9.5-3.7-14.1-5.8l-5.8 5.8c-12.5 12.5-32.8 12.5-45.3 0L40.2 449.1c-12.5-12.5-12.5-32.8 0-45.3l5.8-5.8c-2.2-4.6-4.1-9.3-5.8-14.1L32 384c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32l8.2 0c1.7-4.8 3.7-9.5 5.8-14.1l-5.8-5.8c-12.5-12.5-12.5-32.8 0-45.3l22.6-22.6c9-9 21.9-11.5 33.1-7.6l0-.6 0-32 0-96zm170.3 0L160 64l0 96 32 0 112.7 0L266.3 64zM176 256a80 80 0 1 0 0 160 80 80 0 1 0 0-160zM528 448a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0 64c-48.6 0-88-39.4-88-88c0-29.8 14.8-56.1 37.4-72c14.3-10.1 31.8-16 50.6-16c2.7 0 5.3 .1 7.9 .3c44.9 4 80.1 41.7 80.1 87.7c0 48.6-39.4 88-88 88z"]
};
const faTrashArrowUp = {
  prefix: 'fas',
  iconName: 'trash-arrow-up',
  icon: [448, 512, ["trash-restore"], "f829", "M163.8 0L284.2 0c12.1 0 23.2 6.8 28.6 17.7L320 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 7.2-14.3C140.6 6.8 151.7 0 163.8 0zM32 128l384 0L394.8 467c-1.6 25.3-22.6 45-47.9 45l-245.8 0c-25.3 0-46.3-19.7-47.9-45L32 128zm192 64c-6.4 0-12.5 2.5-17 7l-80 80c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39L200 408c0 13.3 10.7 24 24 24s24-10.7 24-24l0-134.1 39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-4.5-4.5-10.6-7-17-7z"]
};
const faTrashRestore = faTrashArrowUp;
const faArrowDownUpLock = {
  prefix: 'fas',
  iconName: 'arrow-down-up-lock',
  icon: [640, 512, [], "e4b0", "M150.6 502.6l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 402.7 160 288l256 0 0-16c0-17.2 3.9-33.5 10.8-48L352 224l0-114.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96c-6-6-14.1-9.4-22.6-9.4s-16.6 3.4-22.6 9.4l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L288 109.3 288 224l-128 0-64 0-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 114.7L54.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0zM160 192l0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 128 64 0zM288 320l0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128-64 0zm240-80c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z"]
};
const faLinesLeaning = {
  prefix: 'fas',
  iconName: 'lines-leaning',
  icon: [384, 512, [], "e51e", "M190.4 74.1c5.6-16.8-3.5-34.9-20.2-40.5s-34.9 3.5-40.5 20.2l-128 384c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l128-384zm70.9-41.7c-17.4-2.9-33.9 8.9-36.8 26.3l-64 384c-2.9 17.4 8.9 33.9 26.3 36.8s33.9-8.9 36.8-26.3l64-384c2.9-17.4-8.9-33.9-26.3-36.8zM352 32c-17.7 0-32 14.3-32 32l0 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32z"]
};
const faRulerCombined = {
  prefix: 'fas',
  iconName: 'ruler-combined',
  icon: [512, 512, [], "f546", "M.2 468.9C2.7 493.1 23.1 512 48 512l96 0 320 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-48 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-64 0 0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-64-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-64-80 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l80 0 0-48c0-26.5-21.5-48-48-48L48 0C21.5 0 0 21.5 0 48L0 368l0 96c0 1.7 .1 3.3 .2 4.9z"]
};
const faCopyright = {
  prefix: 'fas',
  iconName: 'copyright',
  icon: [512, 512, [169], "f1f9", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM199.4 312.6c31.2 31.2 81.9 31.2 113.1 0c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-50 50-131 50-181 0s-50-131 0-181s131-50 181 0c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-31.2-31.2-81.9-31.2-113.1 0s-31.2 81.9 0 113.1z"]
};
const faEquals = {
  prefix: 'fas',
  iconName: 'equals',
  icon: [448, 512, [62764], "3d", "M48 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l352 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48 128zm0 192c-17.7 0-32 14.3-32 32s14.3 32 32 32l352 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48 320z"]
};
const faBlender = {
  prefix: 'fas',
  iconName: 'blender',
  icon: [512, 512, [], "f517", "M0 64C0 28.7 28.7 0 64 0l64 0 32 0L470.1 0c21.1 0 36.4 20.1 30.9 40.4L494.5 64 336 64c-8.8 0-16 7.2-16 16s7.2 16 16 16l149.8 0-17.5 64L336 160c-8.8 0-16 7.2-16 16s7.2 16 16 16l123.6 0-17.5 64L336 256c-8.8 0-16 7.2-16 16s7.2 16 16 16l97.5 0L416 352l-256 0-8.7-96L64 256c-35.3 0-64-28.7-64-64L0 64zM145.5 192L133.8 64 64 64l0 128 81.5 0zM144 384l288 0c26.5 0 48 21.5 48 48l0 32c0 26.5-21.5 48-48 48l-288 0c-26.5 0-48-21.5-48-48l0-32c0-26.5 21.5-48 48-48zm144 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faTeeth = {
  prefix: 'fas',
  iconName: 'teeth',
  icon: [576, 512, [], "f62e", "M0 128C0 75 43 32 96 32l384 0c53 0 96 43 96 96l0 256c0 53-43 96-96 96L96 480c-53 0-96-43-96-96L0 128zm176 48l0 56c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-56c0-26.5-21.5-48-48-48s-48 21.5-48 48zm176-48c-26.5 0-48 21.5-48 48l0 56c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-56c0-26.5-21.5-48-48-48zM48 208l0 24c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-24c0-26.5-21.5-48-48-48s-48 21.5-48 48zM96 384c26.5 0 48-21.5 48-48l0-24c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24l0 24c0 26.5 21.5 48 48 48zm80-48c0 26.5 21.5 48 48 48s48-21.5 48-48l0-24c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24l0 24zm176 48c26.5 0 48-21.5 48-48l0-24c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24l0 24c0 26.5 21.5 48 48 48zm80-176l0 24c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-24c0-26.5-21.5-48-48-48s-48 21.5-48 48zm48 176c26.5 0 48-21.5 48-48l0-24c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24l0 24c0 26.5 21.5 48 48 48z"]
};
const faShekelSign = {
  prefix: 'fas',
  iconName: 'shekel-sign',
  icon: [448, 512, [8362, "ils", "shekel", "sheqel", "sheqel-sign"], "f20b", "M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32L64 96l128 0c35.3 0 64 28.7 64 64l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-70.7-57.3-128-128-128L32 32zM320 480c70.7 0 128-57.3 128-128l0-288c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 288c0 35.3-28.7 64-64 64l-128 0 0-224c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l160 0z"]
};
const faIls = faShekelSign;
const faShekel = faShekelSign;
const faSheqel = faShekelSign;
const faSheqelSign = faShekelSign;
const faMap = {
  prefix: 'fas',
  iconName: 'map',
  icon: [576, 512, [128506, 62072], "f279", "M384 476.1L192 421.2l0-385.3L384 90.8l0 385.3zm32-1.2l0-386.5L543.1 37.5c15.8-6.3 32.9 5.3 32.9 22.3l0 334.8c0 9.8-6 18.6-15.1 22.3L416 474.8zM15.1 95.1L160 37.2l0 386.5L32.9 474.5C17.1 480.8 0 469.2 0 452.2L0 117.4c0-9.8 6-18.6 15.1-22.3z"]
};
const faRocket = {
  prefix: 'fas',
  iconName: 'rocket',
  icon: [512, 512, [], "f135", "M156.6 384.9L125.7 354c-8.5-8.5-11.5-20.8-7.7-32.2c3-8.9 7-20.5 11.8-33.8L24 288c-8.6 0-16.6-4.6-20.9-12.1s-4.2-16.7 .2-24.1l52.5-88.5c13-21.9 36.5-35.3 61.9-35.3l82.3 0c2.4-4 4.8-7.7 7.2-11.3C289.1-4.1 411.1-8.1 483.9 5.3c11.6 2.1 20.6 11.2 22.8 22.8c13.4 72.9 9.3 194.8-111.4 276.7c-3.5 2.4-7.3 4.8-11.3 7.2l0 82.3c0 25.4-13.4 49-35.3 61.9l-88.5 52.5c-7.4 4.4-16.6 4.5-24.1 .2s-12.1-12.2-12.1-20.9l0-107.2c-14.1 4.9-26.4 8.9-35.7 11.9c-11.2 3.6-23.4 .5-31.8-7.8zM384 168a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faPhotoFilm = {
  prefix: 'fas',
  iconName: 'photo-film',
  icon: [640, 512, ["photo-video"], "f87c", "M256 0L576 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64l0-224c0-35.3 28.7-64 64-64zM476 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84L362.7 169c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l80 0 48 0 144 0c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6l-96-144zM336 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM64 128l96 0 0 256 0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32 160 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zm8 64c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm336 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z"]
};
const faPhotoVideo = faPhotoFilm;
const faFolderMinus = {
  prefix: 'fas',
  iconName: 'folder-minus',
  icon: [512, 512, [], "f65d", "M448 480L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l128 0c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8l160 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64zM184 272c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]
};
const faHexagonNodesBolt = {
  prefix: 'fas',
  iconName: 'hexagon-nodes-bolt',
  icon: [576, 512, [], "e69a", "M248 106.6c18.9-9 32-28.3 32-50.6c0-30.9-25.1-56-56-56s-56 25.1-56 56c0 22.3 13.1 41.6 32 50.6l0 98.8c-2.8 1.3-5.5 2.9-8 4.7l-80.1-45.8c1.6-20.8-8.6-41.6-27.9-52.8C57.2 96 23 105.2 7.5 132S1.2 193 28 208.5c1.3 .8 2.6 1.5 4 2.1l0 90.8c-1.3 .6-2.7 1.3-4 2.1C1.2 319-8 353.2 7.5 380S57.2 416 84 400.5c19.3-11.1 29.4-32 27.8-52.8l50.5-28.9c-11.5-11.2-19.9-25.6-23.8-41.7L88 306.1c-2.6-1.8-5.2-3.3-8-4.7l0-90.8c2.8-1.3 5.5-2.9 8-4.7l80.1 45.8c-.1 1.4-.2 2.8-.2 4.3c0 22.3 13.1 41.6 32 50.6l0 98.8c-18.9 9-32 28.3-32 50.6c0 30.9 25.1 56 56 56c30.7 0 55.6-24.7 56-55.2c-7.5-12.9-13.5-26.8-17.6-41.5c-4.2-4-9.1-7.3-14.4-9.9l0-98.8c2.8-1.3 5.5-2.9 8-4.7l10.5 6c5.5-15.3 13.1-29.5 22.4-42.5l-9.1-5.2c.1-1.4 .2-2.8 .2-4.3c0-22.3-13.1-41.6-32-50.6l0-98.8zM440.5 132C425 105.2 390.8 96 364 111.5c-19.3 11.1-29.4 32-27.8 52.8l-50.6 28.9c11.5 11.2 19.9 25.6 23.8 41.7L360 205.9c.4 .3 .8 .6 1.3 .9c21.7-9.5 45.6-14.8 70.8-14.8c2 0 4 0 5.9 .1c12.1-17.3 13.8-40.6 2.6-60.1zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm47.9-225c4.3 3.7 5.4 9.9 2.6 14.9L452.4 356l35.6 0c5.2 0 9.8 3.3 11.4 8.2s-.1 10.3-4.2 13.4l-96 72c-4.5 3.4-10.8 3.2-15.1-.6s-5.4-9.9-2.6-14.9L411.6 380 376 380c-5.2 0-9.8-3.3-11.4-8.2s.1-10.3 4.2-13.4l96-72c4.5-3.4 10.8-3.2 15.1 .6z"]
};
const faStore = {
  prefix: 'fas',
  iconName: 'store',
  icon: [576, 512, [], "f54e", "M547.6 103.8L490.3 13.1C485.2 5 476.1 0 466.4 0L109.6 0C99.9 0 90.8 5 85.7 13.1L28.3 103.8c-29.6 46.8-3.4 111.9 51.9 119.4c4 .5 8.1 .8 12.1 .8c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.1 0 49.3-11.4 65.2-29c15.9 17.6 39.1 29 65.2 29c26.2 0 49.3-11.4 65.2-29c16 17.6 39.1 29 65.2 29c4.1 0 8.1-.3 12.1-.8c55.5-7.4 81.8-72.5 52.1-119.4zM499.7 254.9c0 0 0 0-.1 0c-5.3 .7-10.7 1.1-16.2 1.1c-12.4 0-24.3-1.9-35.4-5.3L448 384l-320 0 0-133.4c-11.2 3.5-23.2 5.4-35.6 5.4c-5.5 0-11-.4-16.3-1.1l-.1 0c-4.1-.6-8.1-1.3-12-2.3L64 384l0 64c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-64 0-131.4c-4 1-8 1.8-12.3 2.3z"]
};
const faArrowTrendUp = {
  prefix: 'fas',
  iconName: 'arrow-trend-up',
  icon: [576, 512, [], "e098", "M384 160c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-82.7L342.6 374.6c-12.5 12.5-32.8 12.5-45.3 0L192 269.3 54.6 406.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160c12.5-12.5 32.8-12.5 45.3 0L320 306.7 466.7 160 384 160z"]
};
const faPlugCircleMinus = {
  prefix: 'fas',
  iconName: 'plug-circle-minus',
  icon: [576, 512, [], "e55e", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM576 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-64 0c0 8.8-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l128 0c8.8 0 16 7.2 16 16z"]
};
const faSignHanging = {
  prefix: 'fas',
  iconName: 'sign-hanging',
  icon: [512, 512, ["sign"], "f4d9", "M96 0c17.7 0 32 14.3 32 32l0 32 352 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-352 0 0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352-32 0C14.3 128 0 113.7 0 96S14.3 64 32 64l32 0 0-32C64 14.3 78.3 0 96 0zm96 160l256 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32z"]
};
const faSign = faSignHanging;
const faBezierCurve = {
  prefix: 'fas',
  iconName: 'bezier-curve',
  icon: [640, 512, [], "f55b", "M296 136l0-48 48 0 0 48-48 0zM288 32c-26.5 0-48 21.5-48 48l0 4L121.6 84C111.2 62.7 89.3 48 64 48C28.7 48 0 76.7 0 112s28.7 64 64 64c25.3 0 47.2-14.7 57.6-36l66.9 0c-58.9 39.6-98.9 105-104 180L80 320c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-3.3 0c5.9-67 48.5-123.4 107.5-149.1c8.6 12.7 23.2 21.1 39.8 21.1l64 0c16.6 0 31.1-8.4 39.8-21.1c59 25.7 101.6 82.1 107.5 149.1l-3.3 0c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-4.5 0c-5-75-45.1-140.4-104-180l66.9 0c10.4 21.3 32.3 36 57.6 36c35.3 0 64-28.7 64-64s-28.7-64-64-64c-25.3 0-47.2 14.7-57.6 36L400 84l0-4c0-26.5-21.5-48-48-48l-64 0zM88 376l48 0 0 48-48 0 0-48zm416 48l0-48 48 0 0 48-48 0z"]
};
const faBellSlash = {
  prefix: 'fas',
  iconName: 'bell-slash',
  icon: [640, 512, [128277, 61943], "f1f6", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-90.2-70.7c.2-.4 .4-.9 .6-1.3c5.2-11.5 3.1-25-5.3-34.4l-7.4-8.3C497.3 319.2 480 273.9 480 226.8l0-18.8c0-77.4-55-142-128-156.8L352 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 19.2c-42.6 8.6-79 34.2-102 69.3L38.8 5.1zM406.2 416L160 222.1l0 4.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S115.4 416 128 416l278.2 0zm-40.9 77.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"]
};
const faTablet = {
  prefix: 'fas',
  iconName: 'tablet',
  icon: [448, 512, ["tablet-android"], "f3fb", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM176 432l96 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faTabletAndroid = faTablet;
const faSchoolFlag = {
  prefix: 'fas',
  iconName: 'school-flag',
  icon: [576, 512, [], "e56e", "M288 0L400 0c8.8 0 16 7.2 16 16l0 64c0 8.8-7.2 16-16 16l-79.3 0 89.6 64L512 160c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-176 0 0-112c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 112L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l101.7 0L256 95.5 256 32c0-17.7 14.3-32 32-32zm48 240a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM80 224c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0zm368 16l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM80 352c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0zm384 0c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-32 0z"]
};
const faFill = {
  prefix: 'fas',
  iconName: 'fill',
  icon: [512, 512, [], "f575", "M86.6 9.4C74.1-3.1 53.9-3.1 41.4 9.4s-12.5 32.8 0 45.3L122.7 136 30.6 228.1c-37.5 37.5-37.5 98.3 0 135.8L148.1 481.4c37.5 37.5 98.3 37.5 135.8 0L474.3 290.9c28.1-28.1 28.1-73.7 0-101.8L322.9 37.7c-28.1-28.1-73.7-28.1-101.8 0L168 90.7 86.6 9.4zM168 181.3l49.4 49.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L213.3 136l53.1-53.1c3.1-3.1 8.2-3.1 11.3 0L429.1 234.3c3.1 3.1 3.1 8.2 0 11.3L386.7 288 67.5 288c1.4-5.4 4.2-10.4 8.4-14.6L168 181.3z"]
};
const faAngleUp = {
  prefix: 'fas',
  iconName: 'angle-up',
  icon: [448, 512, [8963], "f106", "M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"]
};
const faDrumstickBite = {
  prefix: 'fas',
  iconName: 'drumstick-bite',
  icon: [512, 512, [], "f6d7", "M160 265.2c0 8.5-3.4 16.6-9.4 22.6l-26.8 26.8c-12.3 12.3-32.5 11.4-49.4 7.2C69.8 320.6 65 320 60 320c-33.1 0-60 26.9-60 60s26.9 60 60 60c6.3 0 12 5.7 12 12c0 33.1 26.9 60 60 60s60-26.9 60-60c0-5-.6-9.8-1.8-14.5c-4.2-16.9-5.2-37.1 7.2-49.4l26.8-26.8c6-6 14.1-9.4 22.6-9.4l89.2 0c6.3 0 12.4-.3 18.5-1c11.9-1.2 16.4-15.5 10.8-26c-8.5-15.8-13.3-33.8-13.3-53c0-61.9 50.1-112 112-112c8 0 15.7 .8 23.2 2.4c11.7 2.5 24.1-5.9 22-17.6C494.5 62.5 422.5 0 336 0C238.8 0 160 78.8 160 176l0 89.2z"]
};
const faHollyBerry = {
  prefix: 'fas',
  iconName: 'holly-berry',
  icon: [512, 512, [], "f7aa", "M256 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-80 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM276.8 383.8c1 .1 2.1 .2 3.2 .2c39.8 0 72 32.2 72 72l0 22.7c0 16.4 16 27.9 31.6 22.8l12.8-4.3c18-6 37.3-6.5 55.6-1.5l19.4 5.3c17.9 4.9 34.4-11.6 29.5-29.5L495.6 452c-5-18.3-4.4-37.6 1.5-55.6l4.3-12.8c5.2-15.5-6.4-31.6-22.8-31.6c-34.6 0-62.7-28.1-62.7-62.7l0-32c0-16.4-16-27.9-31.6-22.8l-12.8 4.3c-18 6-37.3 6.5-55.6 1.5l-29.6-8.1c-2.9-.8-5.9-1-8.7-.7c4.2 9.7 5.8 20.8 3.7 32.3L275 298.7c-1.5 8.4-1.4 17 .5 25.3l5.3 23.9c2.8 12.7 1.1 25.2-4 35.9zM127.6 234.5c-15.5-5.2-31.6 6.4-31.6 22.8l0 32C96 323.9 67.9 352 33.3 352c-16.4 0-27.9 16-22.8 31.6l4.3 12.8c6 18 6.5 37.3 1.5 55.6l-5.3 19.4C6.2 489.4 22.6 505.8 40.5 501L60 495.6c18.3-5 37.6-4.5 55.6 1.5l12.8 4.3c15.5 5.2 31.6-6.4 31.6-22.8l0-32c0-34.6 28.1-62.7 62.7-62.7c16.4 0 27.9-16 22.8-31.6l-4.3-12.8c-6-18-6.5-37.3-1.5-55.6l5.3-19.4c4.9-17.9-11.6-34.4-29.5-29.5L196 240.4c-18.3 5-37.6 4.4-55.6-1.5l-12.8-4.3zM384 144a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"]
};
const faChevronLeft = {
  prefix: 'fas',
  iconName: 'chevron-left',
  icon: [320, 512, [9001], "f053", "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]
};
const faBacteria = {
  prefix: 'fas',
  iconName: 'bacteria',
  icon: [640, 512, [], "e059", "M304.9 .7c-9.6-2.7-19.5 2.8-22.3 12.4l-4.3 15.2c-8.3-.6-16.8 0-25.2 1.9c-7.3 1.7-14.3 3.5-21.1 5.5l-5.5-12.7c-3.9-9.1-14.5-13.4-23.6-9.5s-13.4 14.5-9.5 23.6l4.4 10.4c-16.6 6.7-31.7 14.4-45.4 22.8L147 62c-5.5-8.3-16.7-10.5-25-5s-10.5 16.7-5 25l6 9c-13.7 11-25.5 22.8-35.8 34.9l-10-8c-7.8-6.2-19.1-5-25.3 2.8s-5 19.1 2.8 25.3L65.9 155c-1.8 2.8-3.5 5.7-5.1 8.5c-6.6 11.4-11.8 22.6-16 33l-8-3.2c-9.2-3.7-19.7 .8-23.4 10s.8 19.7 10 23.4l10.4 4.2c-.2 .8-.4 1.5-.5 2.3c-2.2 9.3-3.4 17.3-4.1 23.4c-.4 3.1-.6 5.7-.8 7.8c-.1 1.1-.1 2-.2 2.8l-.1 1.1 0 .5 0 .2 0 .1c0 0 0 .1 29.1 1c0 0 0 0-.1 0L28 269.3c-.1 3.1 0 6.1 .2 9.1l-15.2 4.3C3.5 285.4-2 295.4 .7 304.9s12.7 15.1 22.3 12.4l15.6-4.5c7.6 13.6 18.9 25 32.6 32.6L66.7 361c-2.7 9.6 2.8 19.5 12.4 22.3s19.5-2.8 22.3-12.4l4.3-15.2c1.2 .1 2.4 .2 3.6 .2c15.6 .5 30.3-3.3 43-10.2l9 9c7 7 18.4 7 25.5 0s7-18.4 0-25.5l-7.2-7.2c9.3-12.6 15.2-27.8 16.3-44.5l7.1 3c9.1 3.9 19.7-.3 23.6-9.5s-.3-19.7-9.5-23.6l-8.6-3.7c6.4-9.9 17.3-22.4 36.9-33.3l1.3 4.4c2.7 9.6 12.7 15.1 22.3 12.4s15.1-12.7 12.4-22.3l-2.3-8.1c3.8-1.1 7.7-2.1 11.9-3.1c11.6-2.7 22.1-7.7 31.1-14.4l7.2 7.2c7 7 18.4 7 25.5 0s7-18.4 0-25.5l-9-9c7.6-13.9 11.3-30.1 10.1-46.6l15.2-4.3c9.6-2.7 15.1-12.7 12.4-22.3S370.6 64 361 66.7l-15.6 4.5c-7.7-13.9-19.1-25.1-32.6-32.6l4.5-15.6c2.7-9.6-2.8-19.5-12.4-22.3zM112 272l-48-1.5c0 0 0 0 0 0c11.7 .4 27.3 .9 48 1.6zm16-80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64-48a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM322.7 489c-2.7 9.6 2.8 19.5 12.4 22.3s19.5-2.8 22.2-12.4l4.3-15.2c8.3 .6 16.8 0 25.2-1.9c7.3-1.7 14.3-3.5 21.1-5.5l5.5 12.7c3.9 9.1 14.5 13.4 23.6 9.5s13.4-14.5 9.5-23.6l-4.4-10.4c16.6-6.7 31.7-14.4 45.4-22.8L493 450c5.5 8.3 16.7 10.5 25 5s10.5-16.7 5-25l-6-9c13.7-11 25.5-22.8 35.8-34.9l10 8c7.8 6.2 19.1 5 25.3-2.8s5-19.1-2.8-25.3L574.1 357c1.8-2.8 3.5-5.7 5.1-8.5c6.6-11.4 11.8-22.6 16-33l8 3.2c9.2 3.7 19.7-.8 23.4-10s-.8-19.7-10-23.4l-10.4-4.2c.2-.8 .4-1.5 .5-2.3c2.2-9.3 3.4-17.3 4.1-23.4c.4-3.1 .6-5.7 .8-7.8c.1-1.1 .1-2 .2-2.8l.1-1.1 0-.5 0-.2 0-.1c0 0 0-.1-29.1-1c0 0 0 0 .1 0l29.1 .9c.1-3.1 0-6.1-.2-9.1l15.2-4.3c9.6-2.7 15.1-12.7 12.4-22.3s-12.7-15.1-22.3-12.4l-15.6 4.5c-7.6-13.6-18.9-25-32.6-32.6l4.5-15.6c2.7-9.6-2.8-19.5-12.4-22.3s-19.5 2.8-22.3 12.4l-4.3 15.2c-1.2-.1-2.4-.2-3.6-.2c-15.6-.5-30.3 3.3-43 10.2l-9-9c-7-7-18.4-7-25.5 0s-7 18.4 0 25.5l7.2 7.2c-9.3 12.6-15.2 27.8-16.3 44.5l-7.1-3c-9.1-3.9-19.7 .3-23.6 9.5s.3 19.7 9.5 23.6l8.6 3.7c-6.4 9.9-17.3 22.4-36.9 33.3l-1.3-4.4c-2.7-9.6-12.7-15.1-22.3-12.4s-15.1 12.7-12.4 22.3l2.3 8.1c-3.8 1.1-7.7 2.1-11.9 3.1c-11.6 2.7-22.1 7.7-31.1 14.4l-7.2-7.2c-7-7-18.4-7-25.5 0s-7 18.4 0 25.5l9 9c-7.6 13.9-11.3 30.1-10.1 46.6l-15.2 4.3c-9.6 2.7-15.1 12.7-12.4 22.2s12.7 15.1 22.3 12.4l15.6-4.5c7.7 13.9 19.1 25.1 32.6 32.6L322.7 489zM576 241.5c0 0 0 0 0 0c-11.7-.4-27.3-.9-48-1.6l48 1.5zM448 384a32 32 0 1 1 -64 0 32 32 0 1 1 64 0z"]
};
const faHandLizard = {
  prefix: 'fas',
  iconName: 'hand-lizard',
  icon: [512, 512, [], "f258", "M0 112C0 85.5 21.5 64 48 64l112 0 80 0 46.5 0c36.8 0 71.2 18 92.1 48.2l113.5 164c13 18.7 19.9 41 19.9 63.8l0 12 0 16 0 48c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-13.8L273.9 352 240 352l-80 0-48 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l48 0 80 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-80 0L48 160c-26.5 0-48-21.5-48-48z"]
};
const faNotdef = {
  prefix: 'fas',
  iconName: 'notdef',
  icon: [384, 512, [], "e1fe", "M64 390.3L153.5 256 64 121.7l0 268.6zM102.5 448l179.1 0L192 313.7 102.5 448zm128-192L320 390.3l0-268.6L230.5 256zM281.5 64L102.5 64 192 198.3 281.5 64zM0 48C0 21.5 21.5 0 48 0L336 0c26.5 0 48 21.5 48 48l0 416c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 48z"]
};
const faDisease = {
  prefix: 'fas',
  iconName: 'disease',
  icon: [512, 512, [], "f7fa", "M236.4 61.4L227 75.5c-21.3 32-59.4 48.5-97.3 42.1l-59.6-9.9C33.4 101.6 0 129.9 .1 167.1c0 15.9 6.4 31.2 17.6 42.5l29.2 29.2c11 11 17.2 25.9 17.2 41.5c0 15.8-6.4 30.9-17.7 42L33.3 335.1C22.2 345.9 16 360.7 16 376.2c0 36.8 34.1 64.2 70.1 56.2l62.3-13.8c7.7-1.7 15.7-2.6 23.6-2.6l10 0c27.2 0 53.7 9.3 75 26.3L287.8 467c10.5 8.4 23.6 13 37 13c32.7 0 59.3-26.5 59.3-59.3l0-25.2c0-34.9 21.4-66.2 53.9-78.8l36.9-14.3c22.4-8.7 37.2-30.3 37.2-54.3c0-28.1-20.1-52.3-47.8-57.3l-28-5.1c-36.5-6.7-65.4-34.5-73.6-70.7l-7.1-31.5C348.9 53.4 322.1 32 291.3 32c-22 0-42.6 11-54.9 29.4zM160 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm0 80a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBriefcaseMedical = {
  prefix: 'fas',
  iconName: 'briefcase-medical',
  icon: [512, 512, [], "f469", "M184 48l144 0c4.4 0 8 3.6 8 8l0 40L176 96l0-40c0-4.4 3.6-8 8-8zm-56 8l0 40L64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-64 0 0-40c0-30.9-25.1-56-56-56L184 0c-30.9 0-56 25.1-56 56zm96 152c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faGenderless = {
  prefix: 'fas',
  iconName: 'genderless',
  icon: [384, 512, [], "f22d", "M192 144a112 112 0 1 1 0 224 112 112 0 1 1 0-224zm0 288a176 176 0 1 0 0-352 176 176 0 1 0 0 352z"]
};
const faChevronRight = {
  prefix: 'fas',
  iconName: 'chevron-right',
  icon: [320, 512, [9002], "f054", "M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]
};
const faRetweet = {
  prefix: 'fas',
  iconName: 'retweet',
  icon: [576, 512, [], "f079", "M272 416c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0c-17.7 0-32-14.3-32-32l0-128 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 128c0 53 43 96 96 96l112 0zM304 96c-17.7 0-32 14.3-32 32s14.3 32 32 32l112 0c17.7 0 32 14.3 32 32l0 128-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0 0-128c0-53-43-96-96-96L304 96z"]
};
const faCarRear = {
  prefix: 'fas',
  iconName: 'car-rear',
  icon: [512, 512, ["car-alt"], "f5de", "M165.4 96l181.2 0c13.6 0 25.7 8.6 30.2 21.4L402.9 192l-293.8 0 26.1-74.6c4.5-12.8 16.6-21.4 30.2-21.4zm-90.6 .3L39.6 196.8C16.4 206.4 0 229.3 0 256l0 80c0 23.7 12.9 44.4 32 55.4L32 448c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-48 256 0 0 48c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-56.6c19.1-11.1 32-31.7 32-55.4l0-80c0-26.7-16.4-49.6-39.6-59.2L437.2 96.3C423.7 57.8 387.4 32 346.6 32L165.4 32c-40.8 0-77.1 25.8-90.6 64.3zM208 272l96 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM48 280c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24zm360-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
};
const faCarAlt = faCarRear;
const faPumpSoap = {
  prefix: 'fas',
  iconName: 'pump-soap',
  icon: [448, 512, [], "e06b", "M128 32l0 96 128 0 0-32 60.1 0c4.2 0 8.3 1.7 11.3 4.7l33.9 33.9c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L372.7 55.4c-15-15-35.4-23.4-56.6-23.4L256 32c0-17.7-14.3-32-32-32L160 0c-17.7 0-32 14.3-32 32zM117.4 160c-33.3 0-61 25.5-63.8 58.7L35 442.7C31.9 480 61.3 512 98.8 512l186.4 0c37.4 0 66.9-32 63.8-69.3l-18.7-224c-2.8-33.2-30.5-58.7-63.8-58.7l-149.1 0zM256 360c0 35.3-28.7 56-64 56s-64-20.7-64-56c0-32.5 37-80.9 50.9-97.9c3.2-3.9 8.1-6.1 13.1-6.1s9.9 2.2 13.1 6.1C219 279.1 256 327.5 256 360z"]
};
const faVideoSlash = {
  prefix: 'fas',
  iconName: 'video-slash',
  icon: [640, 512, [], "f4e2", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-86.4-67.7 13.8 9.2c9.8 6.5 22.4 7.2 32.9 1.6s16.9-16.4 16.9-28.2l0-256c0-11.8-6.5-22.6-16.9-28.2s-23-5-32.9 1.6l-96 64L448 174.9l0 17.1 0 128 0 5.8-32-25.1L416 128c0-35.3-28.7-64-64-64L113.9 64 38.8 5.1zM407 416.7L32.3 121.5c-.2 2.1-.3 4.3-.3 6.5l0 256c0 35.3 28.7 64 64 64l256 0c23.4 0 43.9-12.6 55-31.3z"]
};
const faBatteryQuarter = {
  prefix: 'fas',
  iconName: 'battery-quarter',
  icon: [576, 512, ["battery-2"], "f243", "M464 160c8.8 0 16 7.2 16 16l0 160c0 8.8-7.2 16-16 16L80 352c-8.8 0-16-7.2-16-16l0-160c0-8.8 7.2-16 16-16l384 0zM80 96C35.8 96 0 131.8 0 176L0 336c0 44.2 35.8 80 80 80l384 0c44.2 0 80-35.8 80-80l0-16c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-16c0-44.2-35.8-80-80-80L80 96zm112 96l-96 0 0 128 96 0 0-128z"]
};
const faBattery2 = faBatteryQuarter;
const faRadio = {
  prefix: 'fas',
  iconName: 'radio',
  icon: [512, 512, [128251], "f8d7", "M494.8 47c12.7-3.7 20-17.1 16.3-29.8S494-2.8 481.2 1L51.7 126.9c-9.4 2.7-17.9 7.3-25.1 13.2C10.5 151.7 0 170.6 0 192l0 4L0 304 0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-229.5 0L494.8 47zM368 240a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM80 256c0-8.8 7.2-16 16-16l96 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16zM64 320c0-8.8 7.2-16 16-16l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 336c-8.8 0-16-7.2-16-16zm16 64c0-8.8 7.2-16 16-16l96 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16z"]
};
const faBabyCarriage = {
  prefix: 'fas',
  iconName: 'baby-carriage',
  icon: [512, 512, ["carriage-baby"], "f77d", "M256 192L.1 192C2.7 117.9 41.3 52.9 99 14.1c13.3-8.9 30.8-4.3 39.9 8.8L256 192zm128-32c0-35.3 28.7-64 64-64l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 64c0 25.2-5.8 50.2-17 73.5s-27.8 44.5-48.6 62.3s-45.5 32-72.7 41.6S253.4 416 224 416s-58.5-5-85.7-14.6s-51.9-23.8-72.7-41.6s-37.3-39-48.6-62.3S0 249.2 0 224l224 0 160 0 0-64zM80 416a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm240 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
};
const faCarriageBaby = faBabyCarriage;
const faTrafficLight = {
  prefix: 'fas',
  iconName: 'traffic-light',
  icon: [320, 512, [128678], "f637", "M64 0C28.7 0 0 28.7 0 64L0 352c0 88.4 71.6 160 160 160s160-71.6 160-160l0-288c0-35.3-28.7-64-64-64L64 0zm96 416a48 48 0 1 1 0-96 48 48 0 1 1 0 96zm48-176a48 48 0 1 1 -96 0 48 48 0 1 1 96 0zm-48-80a48 48 0 1 1 0-96 48 48 0 1 1 0 96z"]
};
const faThermometer = {
  prefix: 'fas',
  iconName: 'thermometer',
  icon: [512, 512, [], "f491", "M96 382.1l0-88.8c0-14.9 5.9-29.1 16.4-39.6l27.3-27.3 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 41.4-41.4 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 41.4-41.4 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 45.5-45.5C355.2 10.9 381.4 0 408.8 0C465.8 0 512 46.2 512 103.2c0 27.4-10.9 53.6-30.2 73L258.3 399.6c-10.5 10.5-24.7 16.4-39.6 16.4l-88.8 0L41 505c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l89-89z"]
};
const faVrCardboard = {
  prefix: 'fas',
  iconName: 'vr-cardboard',
  icon: [640, 512, [], "f729", "M576 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l120.4 0c24.2 0 46.4-13.7 57.2-35.4l32-64c8.8-17.5 26.7-28.6 46.3-28.6s37.5 11.1 46.3 28.6l32 64c10.8 21.7 33 35.4 57.2 35.4L576 448c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64zM96 240a64 64 0 1 1 128 0A64 64 0 1 1 96 240zm384-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faHandMiddleFinger = {
  prefix: 'fas',
  iconName: 'hand-middle-finger',
  icon: [448, 512, [128405], "f806", "M232 0c-22.1 0-40 17.9-40 40l0 164.2c-8.5-7.6-19.7-12.2-32-12.2c-26.5 0-48 21.5-48 48l0 7 0 73c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-55.7c-2 1.4-3.9 3-5.8 4.5L55 284.8C40.4 297 32 315 32 334L32 372c0 38 16.9 74 46.1 98.3l5.4 4.5c28.8 24 65 37.1 102.4 37.1L304 512c70.7 0 128-57.3 128-128l0-64 0-32c0-26.5-21.5-48-48-48c-12.4 0-23.6 4.7-32.1 12.3C350 227.5 329.3 208 304 208c-12.3 0-23.5 4.6-32 12.2L272 40c0-22.1-17.9-40-40-40z"]
};
const faPercent = {
  prefix: 'fas',
  iconName: 'percent',
  icon: [384, 512, [62101, 62785, "percentage"], "25", "M374.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-320 320c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l320-320zM128 128A64 64 0 1 0 0 128a64 64 0 1 0 128 0zM384 384a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"]
};
const faPercentage = faPercent;
const faTruckMoving = {
  prefix: 'fas',
  iconName: 'truck-moving',
  icon: [640, 512, [], "f4df", "M64 32C28.7 32 0 60.7 0 96L0 304l0 80 0 16c0 44.2 35.8 80 80 80c26.2 0 49.4-12.6 64-32c14.6 19.4 37.8 32 64 32c44.2 0 80-35.8 80-80c0-5.5-.6-10.8-1.6-16L416 384l33.6 0c-1 5.2-1.6 10.5-1.6 16c0 44.2 35.8 80 80 80s80-35.8 80-80c0-5.5-.6-10.8-1.6-16l1.6 0c17.7 0 32-14.3 32-32l0-64 0-16 0-10.3c0-9.2-3.2-18.2-9-25.3l-58.8-71.8c-10.6-13-26.5-20.5-43.3-20.5L480 144l0-48c0-35.3-28.7-64-64-64L64 32zM585 256l-105 0 0-64 48.8 0c2.4 0 4.7 1.1 6.2 2.9L585 256zM528 368a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM176 400a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM80 368a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGlassWaterDroplet = {
  prefix: 'fas',
  iconName: 'glass-water-droplet',
  icon: [384, 512, [], "e4f5", "M32 0C23.1 0 14.6 3.7 8.6 10.2S-.6 25.4 .1 34.3L28.9 437.7c3 41.9 37.8 74.3 79.8 74.3l166.6 0c42 0 76.8-32.4 79.8-74.3L383.9 34.3c.6-8.9-2.4-17.6-8.5-24.1S360.9 0 352 0L32 0zM83 297.5L66.4 64l251.3 0L301 297.5 288 304c-20.1 10.1-43.9 10.1-64 0s-43.9-10.1-64 0s-43.9 10.1-64 0l-13-6.5zM256 196c0-24-33.7-70.1-52.2-93.5c-6.1-7.7-17.5-7.7-23.6 0C161.7 125.9 128 172 128 196c0 33.1 28.7 60 64 60s64-26.9 64-60z"]
};
const faDisplay = {
  prefix: 'fas',
  iconName: 'display',
  icon: [576, 512, [], "e163", "M64 0C28.7 0 0 28.7 0 64L0 352c0 35.3 28.7 64 64 64l176 0-10.7 32L160 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-69.3 0L336 416l176 0c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64L64 0zM512 64l0 288L64 352 64 64l448 0z"]
};
const faFaceSmile = {
  prefix: 'fas',
  iconName: 'face-smile',
  icon: [512, 512, [128578, "smile"], "f118", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSmile = faFaceSmile;
const faThumbtack = {
  prefix: 'fas',
  iconName: 'thumbtack',
  icon: [384, 512, [128204, 128392, "thumb-tack"], "f08d", "M32 32C32 14.3 46.3 0 64 0L320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-29.5 0 11.4 148.2c36.7 19.9 65.7 53.2 79.5 94.7l1 3c3.3 9.8 1.6 20.5-4.4 28.8s-15.7 13.3-26 13.3L32 352c-10.3 0-19.9-4.9-26-13.3s-7.7-19.1-4.4-28.8l1-3c13.8-41.5 42.8-74.8 79.5-94.7L93.5 64 64 64C46.3 64 32 49.7 32 32zM160 384l64 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96z"]
};
const faThumbTack = faThumbtack;
const faTrophy = {
  prefix: 'fas',
  iconName: 'trophy',
  icon: [576, 512, [127942], "f091", "M400 0L176 0c-26.5 0-48.1 21.8-47.1 48.2c.2 5.3 .4 10.6 .7 15.8L24 64C10.7 64 0 74.7 0 88c0 92.6 33.5 157 78.5 200.7c44.3 43.1 98.3 64.8 138.1 75.8c23.4 6.5 39.4 26 39.4 45.6c0 20.9-17 37.9-37.9 37.9L192 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-26.1 0C337 448 320 431 320 410.1c0-19.6 15.9-39.2 39.4-45.6c39.9-11 93.9-32.7 138.2-75.8C542.5 245 576 180.6 576 88c0-13.3-10.7-24-24-24L446.4 64c.3-5.2 .5-10.4 .7-15.8C448.1 21.8 426.5 0 400 0zM48.9 112l84.4 0c9.1 90.1 29.2 150.3 51.9 190.6c-24.9-11-50.8-26.5-73.2-48.3c-32-31.1-58-76-63-142.3zM464.1 254.3c-22.4 21.8-48.3 37.3-73.2 48.3c22.7-40.3 42.8-100.5 51.9-190.6l84.4 0c-5.1 66.3-31.1 111.2-63 142.3z"]
};
const faPersonPraying = {
  prefix: 'fas',
  iconName: 'person-praying',
  icon: [448, 512, [128720, "pray"], "f683", "M352 64A64 64 0 1 0 224 64a64 64 0 1 0 128 0zM232.7 264l22.9 31.5c6.5 8.9 16.3 14.7 27.2 16.1s21.9-1.7 30.4-8.7l88-72c17.1-14 19.6-39.2 5.6-56.3s-39.2-19.6-56.3-5.6l-55.2 45.2-26.2-36C253.6 156.7 228.6 144 202 144c-30.9 0-59.2 17.1-73.6 44.4L79.8 280.9c-20.2 38.5-9.4 85.9 25.6 111.8L158.6 432 72 432c-22.1 0-40 17.9-40 40s17.9 40 40 40l208 0c17.3 0 32.6-11.1 38-27.5s-.3-34.4-14.2-44.7L187.7 354l45-90z"]
};
const faPray = faPersonPraying;
const faHammer = {
  prefix: 'fas',
  iconName: 'hammer',
  icon: [576, 512, [128296], "f6e3", "M413.5 237.5c-28.2 4.8-58.2-3.6-80-25.4l-38.1-38.1C280.4 159 272 138.8 272 117.6l0-12.1L192.3 62c-5.3-2.9-8.6-8.6-8.3-14.7s3.9-11.5 9.5-14l47.2-21C259.1 4.2 279 0 299.2 0l18.1 0c36.7 0 72 14 98.7 39.1l44.6 42c24.2 22.8 33.2 55.7 26.6 86L503 183l8-8c9.4-9.4 24.6-9.4 33.9 0l24 24c9.4 9.4 9.4 24.6 0 33.9l-88 88c-9.4 9.4-24.6 9.4-33.9 0l-24-24c-9.4-9.4-9.4-24.6 0-33.9l8-8-17.5-17.5zM27.4 377.1L260.9 182.6c3.5 4.9 7.5 9.6 11.8 14l38.1 38.1c6 6 12.4 11.2 19.2 15.7L134.9 484.6c-14.5 17.4-36 27.4-58.6 27.4C34.1 512 0 477.8 0 435.7c0-22.6 10.1-44.1 27.4-58.6z"]
};
const faHandPeace = {
  prefix: 'fas',
  iconName: 'hand-peace',
  icon: [512, 512, [9996], "f25b", "M224 0c17.7 0 32 14.3 32 32l0 208-64 0 0-208c0-17.7 14.3-32 32-32zm96 160c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm64 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zM93.3 51.2L175.9 240l-69.9 0L34.7 76.8C27.6 60.6 35 41.8 51.2 34.7s35.1 .3 42.1 16.5zm27 221.3l-.2-.5 69.9 0 26.1 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-56 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l56 0c39.8 0 72-32.2 72-72l0-.6c9.4 5.4 20.3 8.6 32 8.6c13.2 0 25.4-4 35.6-10.8c8.7 24.9 32.5 42.8 60.4 42.8c11.7 0 22.6-3.1 32-8.6l0 8.6c0 88.4-71.6 160-160 160l-61.7 0c-42.4 0-83.1-16.9-113.1-46.9l-11.6-11.6C77.5 429.5 64 396.9 64 363l0-27c0-32.7 24.6-59.7 56.3-63.5z"]
};
const faRotate = {
  prefix: 'fas',
  iconName: 'rotate',
  icon: [512, 512, [128260, "sync-alt"], "f2f1", "M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z"]
};
const faSyncAlt = faRotate;
const faSpinner = {
  prefix: 'fas',
  iconName: 'spinner',
  icon: [512, 512, [], "f110", "M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"]
};
const faRobot = {
  prefix: 'fas',
  iconName: 'robot',
  icon: [640, 512, [129302], "f544", "M320 0c17.7 0 32 14.3 32 32l0 64 120 0c39.8 0 72 32.2 72 72l0 272c0 39.8-32.2 72-72 72l-304 0c-39.8 0-72-32.2-72-72l0-272c0-39.8 32.2-72 72-72l120 0 0-64c0-17.7 14.3-32 32-32zM208 384c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0zM264 256a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm152 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM48 224l16 0 0 192-16 0c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48zm544 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-16 0 0-192 16 0z"]
};
const faPeace = {
  prefix: 'fas',
  iconName: 'peace',
  icon: [512, 512, [9774], "f67c", "M224 445.3l0-121.8-94.3 77.1c26.1 22.8 58.5 38.7 94.3 44.7zM89.2 351.1L224 240.8l0-174.2C133.2 81.9 64 160.9 64 256c0 34.6 9.2 67.1 25.2 95.1zm293.1 49.5L288 323.5l0 121.8c35.7-6 68.1-21.9 94.3-44.7zm40.6-49.5c16-28 25.2-60.5 25.2-95.1c0-95.1-69.2-174.1-160-189.3l0 174.2L422.8 351.1zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]
};
const faGears = {
  prefix: 'fas',
  iconName: 'gears',
  icon: [640, 512, ["cogs"], "f085", "M308.5 135.3c7.1-6.3 9.9-16.2 6.2-25c-2.3-5.3-4.8-10.5-7.6-15.5L304 89.4c-3-5-6.3-9.9-9.8-14.6c-5.7-7.6-15.7-10.1-24.7-7.1l-28.2 9.3c-10.7-8.8-23-16-36.2-20.9L199 27.1c-1.9-9.3-9.1-16.7-18.5-17.8C173.9 8.4 167.2 8 160.4 8l-.7 0c-6.8 0-13.5 .4-20.1 1.2c-9.4 1.1-16.6 8.6-18.5 17.8L115 56.1c-13.3 5-25.5 12.1-36.2 20.9L50.5 67.8c-9-3-19-.5-24.7 7.1c-3.5 4.7-6.8 9.6-9.9 14.6l-3 5.3c-2.8 5-5.3 10.2-7.6 15.6c-3.7 8.7-.9 18.6 6.2 25l22.2 19.8C32.6 161.9 32 168.9 32 176s.6 14.1 1.7 20.9L11.5 216.7c-7.1 6.3-9.9 16.2-6.2 25c2.3 5.3 4.8 10.5 7.6 15.6l3 5.2c3 5.1 6.3 9.9 9.9 14.6c5.7 7.6 15.7 10.1 24.7 7.1l28.2-9.3c10.7 8.8 23 16 36.2 20.9l6.1 29.1c1.9 9.3 9.1 16.7 18.5 17.8c6.7 .8 13.5 1.2 20.4 1.2s13.7-.4 20.4-1.2c9.4-1.1 16.6-8.6 18.5-17.8l6.1-29.1c13.3-5 25.5-12.1 36.2-20.9l28.2 9.3c9 3 19 .5 24.7-7.1c3.5-4.7 6.8-9.5 9.8-14.6l3.1-5.4c2.8-5 5.3-10.2 7.6-15.5c3.7-8.7 .9-18.6-6.2-25l-22.2-19.8c1.1-6.8 1.7-13.8 1.7-20.9s-.6-14.1-1.7-20.9l22.2-19.8zM112 176a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM504.7 500.5c6.3 7.1 16.2 9.9 25 6.2c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-8.7-3.7-18.6-.9-25 6.2l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-6.3-7.1-16.2-9.9-25-6.2c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4s.4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c8.7 3.7 18.6 .9 25-6.2l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2zM464 304a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faCogs = faGears;
const faWarehouse = {
  prefix: 'fas',
  iconName: 'warehouse',
  icon: [640, 512, [], "f494", "M0 488L0 171.3c0-26.2 15.9-49.7 40.2-59.4L308.1 4.8c7.6-3.1 16.1-3.1 23.8 0L599.8 111.9c24.3 9.7 40.2 33.3 40.2 59.4L640 488c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-264c0-17.7-14.3-32-32-32l-384 0c-17.7 0-32 14.3-32 32l0 264c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zm488 24l-336 0c-13.3 0-24-10.7-24-24l0-56 384 0 0 56c0 13.3-10.7 24-24 24zM128 400l0-64 384 0 0 64-384 0zm0-96l0-80 384 0 0 80-384 0z"]
};
const faArrowUpRightDots = {
  prefix: 'fas',
  iconName: 'arrow-up-right-dots',
  icon: [576, 512, [], "e4b7", "M160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l50.7 0L9.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L256 109.3l0 50.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128c0-17.7-14.3-32-32-32L160 0zM576 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM448 208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM400 384a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm128 0a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM272 384a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48 80a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM144 512a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM576 336a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm-48-80a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]
};
const faSplotch = {
  prefix: 'fas',
  iconName: 'splotch',
  icon: [512, 512, [], "f5bc", "M208.5 62.3l28.1-36.9C248.8 9.4 267.8 0 288 0c28.5 0 53.6 18.7 61.8 46l17.8 59.4c10.3 34.4 36.1 62 69.8 74.6l39.8 14.9c20.9 7.9 34.8 27.9 34.8 50.2c0 16.9-7.9 32.8-21.5 42.9l-67.3 50.5c-24.3 18.2-37.2 47.9-33.8 78.1l2.5 22.7c4.3 38.7-26 72.6-65 72.6c-14.8 0-29.3-5.1-40.8-14.3l-55.4-44.3c-4.5-3.6-9.3-6.7-14.5-9.2c-15.8-7.9-33.7-10.4-51-7.3L82.4 451.9C47.8 458.2 16 431.6 16 396.5c0-13.2 4.7-26 13.1-36.2l11.2-13.4c14.6-17.4 22.6-39.4 22.6-62.1c0-18.8-5.5-37.2-15.8-53L8.8 173.5C3.1 164.7 0 154.4 0 143.9c0-33.4 30.1-58.8 63-53.2l51.3 8.7c35.9 6.1 72.2-8.2 94.2-37.1z"]
};
const faFaceGrinHearts = {
  prefix: 'fas',
  iconName: 'face-grin-hearts',
  icon: [512, 512, [128525, "grin-hearts"], "f584", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM388.1 312.8c12.3-3.8 24.3 6.9 19.3 18.7C382.4 390.6 324.2 432 256.3 432s-126.2-41.4-151.1-100.5c-5-11.8 7-22.5 19.3-18.7c39.7 12.2 84.5 19 131.8 19s92.1-6.8 131.8-19zM199.3 129.1c17.8 4.8 28.4 23.1 23.6 40.8l-17.4 65c-2.3 8.5-11.1 13.6-19.6 11.3l-65.1-17.4c-17.8-4.8-28.4-23.1-23.6-40.8s23.1-28.4 40.8-23.6l16.1 4.3 4.3-16.1c4.8-17.8 23.1-28.4 40.8-23.6zm154.3 23.6l4.3 16.1 16.1-4.3c17.8-4.8 36.1 5.8 40.8 23.6s-5.8 36.1-23.6 40.8l-65.1 17.4c-8.5 2.3-17.3-2.8-19.6-11.3l-17.4-65c-4.8-17.8 5.8-36.1 23.6-40.8s36.1 5.8 40.9 23.6z"]
};
const faGrinHearts = faFaceGrinHearts;
const faDiceFour = {
  prefix: 'fas',
  iconName: 'dice-four',
  icon: [448, 512, [9859], "f524", "M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm160 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM352 160a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faSimCard = {
  prefix: 'fas',
  iconName: 'sim-card',
  icon: [384, 512, [], "f7c4", "M64 0L242.7 0c17 0 33.3 6.7 45.3 18.7L365.3 96c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64C0 28.7 28.7 0 64 0zM96 192c-17.7 0-32 14.3-32 32l0 32 64 0 0-64-32 0zM64 352l80 0 96 0 80 0 0-64-80 0-96 0-80 0 0 64zM320 224c0-17.7-14.3-32-32-32l-32 0 0 64 64 0 0-32zM160 192l0 64 64 0 0-64-64 0zM288 448c17.7 0 32-14.3 32-32l0-32-64 0 0 64 32 0zM160 384l0 64 64 0 0-64-64 0zM64 416c0 17.7 14.3 32 32 32l32 0 0-64-64 0 0 32z"]
};
const faTransgender = {
  prefix: 'fas',
  iconName: 'transgender',
  icon: [512, 512, [9895, "transgender-alt"], "f225", "M112 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-31 31L112 78.1l7-7c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-7 7 15.2 15.2C187.7 107.6 220.5 96 256 96s68.3 11.6 94.9 31.2l68.8-68.8-31-31c-4.6-4.6-5.9-11.5-3.5-17.4s8.3-9.9 14.8-9.9l96 0c8.8 0 16 7.2 16 16l0 96c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5l-31-31-68.8 68.8C404.4 187.7 416 220.5 416 256c0 80.2-59 146.6-136 158.2l0 17.8 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-17.8C155 402.6 96 336.2 96 256c0-35.5 11.6-68.3 31.2-94.9L112 145.9l-7 7c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l7-7L58.3 92.3l-31 31c-4.6 4.6-11.5 5.9-17.4 3.5S0 118.5 0 112L0 16C0 7.2 7.2 0 16 0l96 0zM352 256a96 96 0 1 0 -192 0 96 96 0 1 0 192 0z"]
};
const faTransgenderAlt = faTransgender;
const faMercury = {
  prefix: 'fas',
  iconName: 'mercury',
  icon: [384, 512, [9791], "f223", "M72.1 7C85.8-4 106-1.8 117 12c17.6 22 44.7 36 75 36s57.3-14 75-36c11.1-13.8 31.2-16 45-5s16 31.2 5 45c-7.8 9.7-16.6 18.4-26.4 26.1C337.3 109.7 368 163.3 368 224c0 89.1-66.2 162.7-152 174.4l0 25.6 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 16c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-25.6C82.2 386.7 16 313.1 16 224c0-60.7 30.7-114.3 77.5-145.9C83.7 70.5 74.9 61.7 67.1 52c-11.1-13.8-8.8-33.9 5-45zM80 224a112 112 0 1 0 224 0A112 112 0 1 0 80 224z"]
};
const faArrowTurnDown = {
  prefix: 'fas',
  iconName: 'arrow-turn-down',
  icon: [384, 512, ["level-down"], "f149", "M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z"]
};
const faLevelDown = faArrowTurnDown;
const faPersonFallingBurst = {
  prefix: 'fas',
  iconName: 'person-falling-burst',
  icon: [640, 512, [], "e547", "M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 9.8c0 39-23.7 74-59.9 88.4C71.6 154.5 32 213 32 278.2L32 352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-73.8c0-10 1.6-19.8 4.5-29L261.1 497.4c9.6 14.8 29.4 19.1 44.3 9.5s19.1-29.4 9.5-44.3L222.6 320l1.4 0 80 0 38.4 51.2c10.6 14.1 30.7 17 44.8 6.4s17-30.7 6.4-44.8l-43.2-57.6C341.3 263.1 327.1 256 312 256l-71.5 0-56.8-80.2-.2-.3c44.7-29 72.5-79 72.5-133.6l0-9.8zM96 80A48 48 0 1 0 0 80a48 48 0 1 0 96 0zM464 286.1l58.6 53.9c4.8 4.4 11.9 5.5 17.8 2.6s9.5-9 9-15.5l-5.6-79.4 78.7-12.2c6.5-1 11.7-5.9 13.1-12.2s-1.1-13-6.5-16.7l-65.6-45.1L603 92.2c3.3-5.7 2.7-12.8-1.4-17.9s-10.9-7.2-17.2-5.3L508.3 92.1l-29.4-74C476.4 12 470.6 8 464 8s-12.4 4-14.9 10.1l-29.4 74L343.6 68.9c-6.3-1.9-13.1 .2-17.2 5.3s-4.6 12.2-1.4 17.9l39.5 69.1-65.6 45.1c-5.4 3.7-8 10.3-6.5 16.7c.1 .3 .1 .6 .2 .8l19.4 0c20.1 0 39.2 7.5 53.8 20.8l18.4 2.9L383 265.3l36.2 48.3c2.1 2.8 3.9 5.7 5.5 8.6L464 286.1z"]
};
const faAward = {
  prefix: 'fas',
  iconName: 'award',
  icon: [384, 512, [], "f559", "M173.8 5.5c11-7.3 25.4-7.3 36.4 0L228 17.2c6 3.9 13 5.8 20.1 5.4l21.3-1.3c13.2-.8 25.6 6.4 31.5 18.2l9.6 19.1c3.2 6.4 8.4 11.5 14.7 14.7L344.5 83c11.8 5.9 19 18.3 18.2 31.5l-1.3 21.3c-.4 7.1 1.5 14.2 5.4 20.1l11.8 17.8c7.3 11 7.3 25.4 0 36.4L366.8 228c-3.9 6-5.8 13-5.4 20.1l1.3 21.3c.8 13.2-6.4 25.6-18.2 31.5l-19.1 9.6c-6.4 3.2-11.5 8.4-14.7 14.7L301 344.5c-5.9 11.8-18.3 19-31.5 18.2l-21.3-1.3c-7.1-.4-14.2 1.5-20.1 5.4l-17.8 11.8c-11 7.3-25.4 7.3-36.4 0L156 366.8c-6-3.9-13-5.8-20.1-5.4l-21.3 1.3c-13.2 .8-25.6-6.4-31.5-18.2l-9.6-19.1c-3.2-6.4-8.4-11.5-14.7-14.7L39.5 301c-11.8-5.9-19-18.3-18.2-31.5l1.3-21.3c.4-7.1-1.5-14.2-5.4-20.1L5.5 210.2c-7.3-11-7.3-25.4 0-36.4L17.2 156c3.9-6 5.8-13 5.4-20.1l-1.3-21.3c-.8-13.2 6.4-25.6 18.2-31.5l19.1-9.6C65 70.2 70.2 65 73.4 58.6L83 39.5c5.9-11.8 18.3-19 31.5-18.2l21.3 1.3c7.1 .4 14.2-1.5 20.1-5.4L173.8 5.5zM272 192a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM1.3 441.8L44.4 339.3c.2 .1 .3 .2 .4 .4l9.6 19.1c11.7 23.2 36 37.3 62 35.8l21.3-1.3c.2 0 .5 0 .7 .2l17.8 11.8c5.1 3.3 10.5 5.9 16.1 7.7l-37.6 89.3c-2.3 5.5-7.4 9.2-13.3 9.7s-11.6-2.2-14.8-7.2L74.4 455.5l-56.1 8.3c-5.7 .8-11.4-1.5-15-6s-4.3-10.7-2.1-16zm248 60.4L211.7 413c5.6-1.8 11-4.3 16.1-7.7l17.8-11.8c.2-.1 .4-.2 .7-.2l21.3 1.3c26 1.5 50.3-12.6 62-35.8l9.6-19.1c.1-.2 .2-.3 .4-.4l43.2 102.5c2.2 5.3 1.4 11.4-2.1 16s-9.3 6.9-15 6l-56.1-8.3-32.2 49.2c-3.2 5-8.9 7.7-14.8 7.2s-11-4.3-13.3-9.7z"]
};
const faTicketSimple = {
  prefix: 'fas',
  iconName: 'ticket-simple',
  icon: [576, 512, ["ticket-alt"], "f3ff", "M0 128C0 92.7 28.7 64 64 64l448 0c35.3 0 64 28.7 64 64l0 64c0 8.8-7.4 15.7-15.7 18.6C541.5 217.1 528 235 528 256s13.5 38.9 32.3 45.4c8.3 2.9 15.7 9.8 15.7 18.6l0 64c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64l0-64c0-8.8 7.4-15.7 15.7-18.6C34.5 294.9 48 277 48 256s-13.5-38.9-32.3-45.4C7.4 207.7 0 200.8 0 192l0-64z"]
};
const faTicketAlt = faTicketSimple;
const faBuilding = {
  prefix: 'fas',
  iconName: 'building',
  icon: [384, 512, [127970, 61687], "f1ad", "M48 0C21.5 0 0 21.5 0 48L0 464c0 26.5 21.5 48 48 48l96 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 96 0c26.5 0 48-21.5 48-48l0-416c0-26.5-21.5-48-48-48L48 0zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm112-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM80 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80 16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]
};
const faAnglesLeft = {
  prefix: 'fas',
  iconName: 'angles-left',
  icon: [512, 512, [171, "angle-double-left"], "f100", "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"]
};
const faAngleDoubleLeft = faAnglesLeft;
const faQrcode = {
  prefix: 'fas',
  iconName: 'qrcode',
  icon: [448, 512, [], "f029", "M0 80C0 53.5 21.5 32 48 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48L0 80zM64 96l0 64 64 0 0-64L64 96zM0 336c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96zm64 16l0 64 64 0 0-64-64 0zM304 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48zm80 64l-64 0 0 64 64 0 0-64zM256 304c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16s7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s7.2-16 16-16s16 7.2 16 16l0 96c0 8.8-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-160zM368 480a16 16 0 1 1 0-32 16 16 0 1 1 0 32zm64 0a16 16 0 1 1 0-32 16 16 0 1 1 0 32z"]
};
const faClockRotateLeft = {
  prefix: 'fas',
  iconName: 'clock-rotate-left',
  icon: [512, 512, ["history"], "f1da", "M75 75L41 41C25.9 25.9 0 36.6 0 57.9L0 168c0 13.3 10.7 24 24 24l110.1 0c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1c0-13.3-10.7-24-24-24z"]
};
const faHistory = faClockRotateLeft;
const faFaceGrinBeamSweat = {
  prefix: 'fas',
  iconName: 'face-grin-beam-sweat',
  icon: [512, 512, [128517, "grin-beam-sweat"], "f583", "M476.8 126.3c-4.1 1.1-8.4 1.7-12.8 1.7c-26.5 0-48-21-48-47c0-5 1.8-11.3 4.6-18.1c.3-.7 .6-1.4 .9-2.1c9-20.2 26.5-44.9 36-57.5c3.2-4.4 9.6-4.4 12.8 0C483.4 20.6 512 61 512 81c0 21.7-14.9 39.8-35.2 45.3zM256 0c51.4 0 99.3 15.2 139.4 41.2c-1.5 3.1-3 6.2-4.3 9.3c-3.4 8-7.1 19-7.1 30.5c0 44.3 36.6 79 80 79c9.6 0 18.8-1.7 27.4-4.8c13.3 30.9 20.6 65 20.6 100.8c0 141.4-114.6 256-256 256S0 397.4 0 256S114.6 0 256 0zM383.8 317.8C345.3 329.4 301.9 336 256 336s-89.3-6.6-127.8-18.2c-12.3-3.7-24.3 7-19.2 18.7c24.5 56.9 81.1 96.7 147 96.7s122.5-39.8 147-96.7c5.1-11.8-6.9-22.4-19.2-18.7zm-166.2-89s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C126.7 188.4 120 206.1 120 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0c0 0 0 0 0 0zm160 0s0 0 0 0s0 0 0 0s0 0 0 0c2.1 2.8 5.7 3.9 8.9 2.8s5.5-4.1 5.5-7.6c0-17.9-6.7-35.6-16.6-48.8c-9.8-13-23.9-23.2-39.4-23.2s-29.6 10.2-39.4 23.2C286.7 188.4 280 206.1 280 224c0 3.4 2.2 6.5 5.5 7.6s6.9 0 8.9-2.8c0 0 0 0 0 0s0 0 0 0c0 0 0 0 0 0l.2-.2c.2-.2 .4-.5 .7-.9c.6-.8 1.6-2 2.8-3.4c2.5-2.8 6-6.6 10.2-10.3c8.8-7.8 18.8-14 27.7-14s18.9 6.2 27.7 14c4.2 3.7 7.7 7.5 10.2 10.3c1.2 1.4 2.2 2.6 2.8 3.4c.3 .4 .6 .7 .7 .9l.2 .2c0 0 0 0 0 0z"]
};
const faGrinBeamSweat = faFaceGrinBeamSweat;
const faFileExport = {
  prefix: 'fas',
  iconName: 'file-export',
  icon: [576, 512, ["arrow-right-from-file"], "f56e", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 128-168 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l168 0 0 112c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM384 336l0-48 110.1 0-39-39c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l80 80c9.4 9.4 9.4 24.6 0 33.9l-80 80c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l39-39L384 336zm0-208l-128 0L256 0 384 128z"]
};
const faArrowRightFromFile = faFileExport;
const faShield = {
  prefix: 'fas',
  iconName: 'shield',
  icon: [512, 512, [128737, "shield-blank"], "f132", "M256 0c4.6 0 9.2 1 13.4 2.9L457.7 82.8c22 9.3 38.4 31 38.3 57.2c-.5 99.2-41.3 280.7-213.6 363.2c-16.7 8-36.1 8-52.8 0C57.3 420.7 16.5 239.2 16 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.8 1 251.4 0 256 0z"]
};
const faShieldBlank = faShield;
const faArrowUpShortWide = {
  prefix: 'fas',
  iconName: 'arrow-up-short-wide',
  icon: [576, 512, ["sort-amount-up-alt"], "f885", "M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0z"]
};
const faSortAmountUpAlt = faArrowUpShortWide;
const faCommentNodes = {
  prefix: 'fas',
  iconName: 'comment-nodes',
  icon: [640, 512, [], "e696", "M256 448c10.8 0 21.5-.5 32-1.6c.3-15.8 4.4-31.7 12.9-46.4c16-27.7 43.7-44.4 73.2-47.5l16.7-29.2c-4.3-11-6.7-22.9-6.7-35.4c0-53 43-96 96-96c9.1 0 17.8 1.3 26.2 3.6C481.1 102.1 378.6 32 256 32C114.6 32 0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.2 .3-.4 .5-.6 .7c-.3 .3-.5 .5-.6 .7l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zm72.6-32c-17.7 30.6-7.2 69.7 23.4 87.4s69.7 7.2 87.4-23.4c1.5-2.6 2.8-5.3 3.9-8l73.3 0c1.1 2.7 2.4 5.4 3.9 8c17.7 30.6 56.8 41.1 87.4 23.4s41.1-56.8 23.4-87.4c-13.4-23.2-39.1-34.8-64-31.4l-17.6-30.7c-11 11.7-25 20.6-40.6 25.6l16.5 28.9c-3.8 4.8-6.8 10-9 15.6l-73.4 0c-2.2-5.6-5.3-10.8-9-15.6l33-57.7c4.1 .8 8.4 1.3 12.8 1.3c35.3 0 64-28.7 64-64s-28.7-64-64-64s-64 28.7-64 64c0 13.4 4.1 25.8 11.2 36.1l-34.6 60.5c-25-3.4-50.6 8.3-64 31.4z"]
};
const faHouseMedical = {
  prefix: 'fas',
  iconName: 'house-medical',
  icon: [576, 512, [], "e3b2", "M543.8 287.6c17 0 32-14 32-32.1c1-9-3-17-11-24L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 160.4c0 35.3 28.7 64 64 64l320.4 0c35.5 0 64.2-28.8 64-64.3l-.7-160.2 32 0zM256 208c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48z"]
};
const faGolfBallTee = {
  prefix: 'fas',
  iconName: 'golf-ball-tee',
  icon: [384, 512, ["golf-ball"], "f450", "M384 192c0 66.8-34.1 125.6-85.8 160L85.8 352C34.1 317.6 0 258.8 0 192C0 86 86 0 192 0S384 86 384 192zM242.1 256.6c0 18.5-15 33.5-33.5 33.5c-4.9 0-9.1 5.1-5.4 8.4c5.9 5.2 13.7 8.4 22.1 8.4c18.5 0 33.5-15 33.5-33.5c0-8.5-3.2-16.2-8.4-22.1c-3.3-3.7-8.4 .5-8.4 5.4zm-52.3-49.3c-4.9 0-9.1 5.1-5.4 8.4c5.9 5.2 13.7 8.4 22.1 8.4c18.5 0 33.5-15 33.5-33.5c0-8.5-3.2-16.2-8.4-22.1c-3.3-3.7-8.4 .5-8.4 5.4c0 18.5-15 33.5-33.5 33.5zm113.5-17.5c0 18.5-15 33.5-33.5 33.5c-4.9 0-9.1 5.1-5.4 8.4c5.9 5.2 13.7 8.4 22.1 8.4c18.5 0 33.5-15 33.5-33.5c0-8.5-3.2-16.2-8.4-22.1c-3.3-3.7-8.4 .5-8.4 5.4zM96 416c0-17.7 14.3-32 32-32l64 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0c-8.8 0-16 7.2-16 16l0 16c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-16c0-8.8-7.2-16-16-16l-16 0c-17.7 0-32-14.3-32-32z"]
};
const faGolfBall = faGolfBallTee;
const faCircleChevronLeft = {
  prefix: 'fas',
  iconName: 'circle-chevron-left',
  icon: [512, 512, ["chevron-circle-left"], "f137", "M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM271 135c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-87 87 87 87c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L167 273c-9.4-9.4-9.4-24.6 0-33.9L271 135z"]
};
const faChevronCircleLeft = faCircleChevronLeft;
const faHouseChimneyWindow = {
  prefix: 'fas',
  iconName: 'house-chimney-window',
  icon: [576, 512, [], "e00d", "M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c.2 35.5-28.5 64.3-64 64.3l-320.4 0c-35.3 0-64-28.7-64-64l0-160.4-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L416 100.7 416 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 121 52.8 46.4c8 7 12 15 11 24zM248 192c-13.3 0-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-80c0-13.3-10.7-24-24-24l-80 0z"]
};
const faPenNib = {
  prefix: 'fas',
  iconName: 'pen-nib',
  icon: [512, 512, [10001], "f5ad", "M368.4 18.3L312.7 74.1 437.9 199.3l55.7-55.7c21.9-21.9 21.9-57.3 0-79.2L447.6 18.3c-21.9-21.9-57.3-21.9-79.2 0zM288 94.6l-9.2 2.8L134.7 140.6c-19.9 6-35.7 21.2-42.3 41L3.8 445.8c-3.8 11.3-1 23.9 7.3 32.4L164.7 324.7c-3-6.3-4.7-13.3-4.7-20.7c0-26.5 21.5-48 48-48s48 21.5 48 48s-21.5 48-48 48c-7.4 0-14.4-1.7-20.7-4.7L33.7 500.9c8.6 8.3 21.1 11.2 32.4 7.3l264.3-88.6c19.7-6.6 35-22.4 41-42.3l43.2-144.1 2.7-9.2L288 94.6z"]
};
const faTentArrowTurnLeft = {
  prefix: 'fas',
  iconName: 'tent-arrow-turn-left',
  icon: [576, 512, [], "e580", "M120.1 41.8c9.9-8.9 10.7-24 1.8-33.9S97.8-2.7 87.9 6.2l-80 72C2.9 82.7 0 89.2 0 96s2.9 13.3 7.9 17.8l80 72c9.9 8.9 25 8.1 33.9-1.8s8.1-25-1.8-33.9L86.5 120 456 120c39.8 0 72 32.2 72 72l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-66.3-53.7-120-120-120L86.5 72l33.5-30.2zM307.4 166.5c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S86.7 512 96 512l144 0 16 0c17.7 0 32-14.3 32-32l0-118.1c0-5.5 4.4-9.9 9.9-9.9c3.7 0 7.2 2.1 8.8 5.5l68.4 136.8c5.4 10.8 16.5 17.7 28.6 17.7l60.2 0 16 0c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
};
const faTents = {
  prefix: 'fas',
  iconName: 'tents',
  icon: [640, 512, [], "e582", "M396.6 6.5L235.8 129.1c9.6 1.8 18.9 5.8 27 12l168 128c13.2 10.1 22 24.9 24.5 41.4l6.2 41.5L608 352c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128c-11.5-8.7-27.3-8.7-38.8 0zm-153.2 160c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S22.7 512 32 512l144 0 16 0c17.7 0 32-14.3 32-32l0-118.1c0-5.5 4.4-9.9 9.9-9.9c3.7 0 7.2 2.1 8.8 5.5l68.4 136.8c5.4 10.8 16.5 17.7 28.6 17.7l60.2 0 16 0c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
};
const faWandMagic = {
  prefix: 'fas',
  iconName: 'wand-magic',
  icon: [512, 512, ["magic"], "f0d0", "M14.1 463.3c-18.7-18.7-18.7-49.1 0-67.9L395.4 14.1c18.7-18.7 49.1-18.7 67.9 0l34.6 34.6c18.7 18.7 18.7 49.1 0 67.9L116.5 497.9c-18.7 18.7-49.1 18.7-67.9 0L14.1 463.3zM347.6 187.6l105-105L429.4 59.3l-105 105 23.3 23.3z"]
};
const faMagic = faWandMagic;
const faDog = {
  prefix: 'fas',
  iconName: 'dog',
  icon: [576, 512, [128021], "f6d3", "M309.6 158.5L332.7 19.8C334.6 8.4 344.5 0 356.1 0c7.5 0 14.5 3.5 19 9.5L392 32l52.1 0c12.7 0 24.9 5.1 33.9 14.1L496 64l56 0c13.3 0 24 10.7 24 24l0 24c0 44.2-35.8 80-80 80l-32 0-16 0-21.3 0-5.1 30.5-112-64zM416 256.1L416 480c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-115.2c-24 12.3-51.2 19.2-80 19.2s-56-6.9-80-19.2L160 480c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-230.2c-28.8-10.9-51.4-35.3-59.2-66.5L1 167.8c-4.3-17.1 6.1-34.5 23.3-38.8s34.5 6.1 38.8 23.3l3.9 15.5C70.5 182 83.3 192 98 192l30 0 16 0 159.8 0L416 256.1zM464 80a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z"]
};
const faCarrot = {
  prefix: 'fas',
  iconName: 'carrot',
  icon: [512, 512, [129365], "f787", "M346.7 6C337.6 17 320 42.3 320 72c0 40 15.3 55.3 40 80s40 40 80 40c29.7 0 55-17.6 66-26.7c4-3.3 6-8.2 6-13.3s-2-10-6-13.2c-11.4-9.1-38.3-26.8-74-26.8c-32 0-40 8-40 8s8-8 8-40c0-35.7-17.7-62.6-26.8-74C370 2 365.1 0 360 0s-10 2-13.3 6zM244.6 136c-40 0-77.1 18.1-101.7 48.2l60.5 60.5c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-55.3-55.3 0 .1L2.2 477.9C-2 487-.1 497.8 7 505s17.9 9 27.1 4.8l134.7-62.4-52.1-52.1c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L199.7 433l100.2-46.4c46.4-21.5 76.2-68 76.2-119.2C376 194.8 317.2 136 244.6 136z"]
};
const faMoon = {
  prefix: 'fas',
  iconName: 'moon',
  icon: [384, 512, [127769, 9214], "f186", "M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z"]
};
const faWineGlassEmpty = {
  prefix: 'fas',
  iconName: 'wine-glass-empty',
  icon: [320, 512, ["wine-glass-alt"], "f5ce", "M64 0C47.4 0 33.5 12.8 32.1 29.3l-14 168.4c-6 72 42.5 135.2 109.9 150.6l0 99.6-48 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0 80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-48 0 0-99.6c67.4-15.4 115.9-78.6 109.9-150.6l-14-168.4C286.5 12.8 272.6 0 256 0L64 0zM81.9 203.1L93.4 64l133.1 0 11.6 139.1C242 248.8 205.9 288 160 288s-82-39.2-78.1-84.9z"]
};
const faWineGlassAlt = faWineGlassEmpty;
const faCheese = {
  prefix: 'fas',
  iconName: 'cheese',
  icon: [512, 512, [], "f7ef", "M512 240.2l0 15.8L0 256c0-20 10-38.7 26.6-49.8L274.9 40.7c8.6-5.7 18.6-8.7 28.9-8.7C418.8 32 512 125.2 512 240.2zm0 47.8l0 128c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 288l512 0z"]
};
const faYinYang = {
  prefix: 'fas',
  iconName: 'yin-yang',
  icon: [512, 512, [9775], "f6ad", "M256 64c53 0 96 43 96 96s-43 96-96 96s-96 43-96 96s43 96 96 96C150 448 64 362 64 256S150 64 256 64zm0 448A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm32-352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]
};
const faMusic = {
  prefix: 'fas',
  iconName: 'music',
  icon: [512, 512, [127925], "f001", "M499.1 6.3c8.1 6 12.9 15.6 12.9 25.7l0 72 0 264c0 44.2-43 80-96 80s-96-35.8-96-80s43-80 96-80c11.2 0 22 1.6 32 4.6L448 147 192 223.8 192 432c0 44.2-43 80-96 80s-96-35.8-96-80s43-80 96-80c11.2 0 22 1.6 32 4.6L128 200l0-72c0-14.1 9.3-26.6 22.8-30.7l320-96c9.7-2.9 20.2-1.1 28.3 5z"]
};
const faCodeCommit = {
  prefix: 'fas',
  iconName: 'code-commit',
  icon: [640, 512, [], "f386", "M320 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm156.8-48C462 361 397.4 416 320 416s-142-55-156.8-128L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l131.2 0C178 151 242.6 96 320 96s142 55 156.8 128L608 224c17.7 0 32 14.3 32 32s-14.3 32-32 32l-131.2 0z"]
};
const faTemperatureLow = {
  prefix: 'fas',
  iconName: 'temperature-low',
  icon: [512, 512, [], "f76b", "M448 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 96a96 96 0 1 1 192 0A96 96 0 1 1 320 96zM144 64c-26.5 0-48 21.5-48 48l0 164.5c0 17.3-7.1 31.9-15.3 42.5C70.2 332.6 64 349.5 64 368c0 44.2 35.8 80 80 80s80-35.8 80-80c0-18.5-6.2-35.4-16.7-48.9c-8.2-10.6-15.3-25.2-15.3-42.5L192 112c0-26.5-21.5-48-48-48zM32 112C32 50.2 82.1 0 144 0s112 50.1 112 112l0 164.4c0 .1 .1 .3 .2 .6c.2 .6 .8 1.6 1.7 2.8c18.9 24.4 30.1 55 30.1 88.1c0 79.5-64.5 144-144 144S0 447.5 0 368c0-33.2 11.2-63.8 30.1-88.1c.9-1.2 1.5-2.2 1.7-2.8c.1-.3 .2-.5 .2-.6L32 112zM192 368c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-20.9 13.4-38.7 32-45.3l0-50.7c0-8.8 7.2-16 16-16s16 7.2 16 16l0 50.7c18.6 6.6 32 24.4 32 45.3z"]
};
const faPersonBiking = {
  prefix: 'fas',
  iconName: 'person-biking',
  icon: [640, 512, [128692, "biking"], "f84a", "M400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm27.2 64l-61.8-48.8c-17.3-13.6-41.7-13.8-59.1-.3l-83.1 64.2c-30.7 23.8-28.5 70.8 4.3 91.6L288 305.1 288 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128c0-10.7-5.3-20.7-14.2-26.6L295 232.9l60.3-48.5L396 217c5.7 4.5 12.7 7 20 7l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-52.8 0zM56 384a72 72 0 1 1 144 0A72 72 0 1 1 56 384zm200 0A128 128 0 1 0 0 384a128 128 0 1 0 256 0zm184 0a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zm200 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"]
};
const faBiking = faPersonBiking;
const faBroom = {
  prefix: 'fas',
  iconName: 'broom',
  icon: [576, 512, [129529], "f51a", "M566.6 54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192-34.7-34.7c-4.2-4.2-10-6.6-16-6.6c-12.5 0-22.6 10.1-22.6 22.6l0 29.1L364.3 320l29.1 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16l-34.7-34.7 192-192zM341.1 353.4L222.6 234.9c-42.7-3.7-85.2 11.7-115.8 42.3l-8 8C76.5 307.5 64 337.7 64 369.2c0 6.8 7.1 11.2 13.2 8.2l51.1-25.5c5-2.5 9.5 4.1 5.4 7.9L7.3 473.4C2.7 477.6 0 483.6 0 489.9C0 502.1 9.9 512 22.1 512l173.3 0c38.8 0 75.9-15.4 103.4-42.8c30.6-30.6 45.9-73.1 42.3-115.8z"]
};
const faShieldHeart = {
  prefix: 'fas',
  iconName: 'shield-heart',
  icon: [512, 512, [], "e574", "M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM144 221.3c0-33.8 27.4-61.3 61.3-61.3c16.2 0 31.8 6.5 43.3 17.9l7.4 7.4 7.4-7.4c11.5-11.5 27.1-17.9 43.3-17.9c33.8 0 61.3 27.4 61.3 61.3c0 16.2-6.5 31.8-17.9 43.3l-82.7 82.7c-6.2 6.2-16.4 6.2-22.6 0l-82.7-82.7c-11.5-11.5-17.9-27.1-17.9-43.3z"]
};
const faGopuram = {
  prefix: 'fas',
  iconName: 'gopuram',
  icon: [512, 512, [], "f664", "M120 0c13.3 0 24 10.7 24 24l0 8 40 0 0-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 8 48 0 0-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 8 40 0 0-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 8 0 32 0 64c17.7 0 32 14.3 32 32l0 64c17.7 0 32 14.3 32 32l0 96c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-64 0 0-160-32 0 0-128-32 0 0-96-32 0 0 96 32 0 0 128 32 0 0 160-80 0 0-48c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 48-80 0 0-160 32 0 0-128 32 0 0-96-32 0 0 96-32 0 0 128-32 0 0 160-64 0c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32l0-96c0-17.7 14.3-32 32-32l0-64c0-17.7 14.3-32 32-32l0-64 0-32 0-8c0-13.3 10.7-24 24-24zM256 272c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zm-32-80l0 32 64 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faEarthOceania = {
  prefix: 'fas',
  iconName: 'earth-oceania',
  icon: [512, 512, ["globe-oceania"], "e47b", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM208.6 357.3l-39-13.5c-6.5-2.2-13.6-2.3-20.1-.3l-15.3 4.9c-18.5 5.9-38.5-2.4-47.5-19.5l-3.3-6.2c-10.6-20.1-2.3-45 18.2-54.7l35.3-16.8c2.3-1.1 4.4-2.8 5.9-4.8l5.3-7c7.2-9.6 18.6-15.3 30.6-15.3s23.4 5.7 30.6 15.3l4.6 6.1c2 2.6 4.9 4.5 8.1 5.1c7.8 1.6 15.7-1.5 20.4-7.9l10.4-14.2c2-2.8 5.3-4.4 8.7-4.4c4.4 0 8.4 2.7 10 6.8l10.1 25.9c2.8 7.2 6.7 14 11.5 20.2L311 299.8c5.8 7.4 9 16.6 9 26s-3.2 18.6-9 26L299 367.2c-8.3 10.6-21 16.8-34.4 16.8c-8.4 0-16.6-2.4-23.7-7l-25.4-16.4c-2.2-1.4-4.5-2.5-6.9-3.4zm65.2-214.8L296 164.7c10.1 10.1 2.9 27.3-11.3 27.3l-29.9 0c-5.6 0-11.1-1.2-16.2-3.4l-42.8-19c-14.3-6.3-11.9-27.3 3.4-30.3l38.5-7.7c13.1-2.6 26.7 1.5 36.1 10.9zM248 432c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16zM431.2 298.9l8 24c2.8 8.4-1.7 17.4-10.1 20.2s-17.4-1.7-20.2-10.1l-8-24c-2.8-8.4 1.7-17.4 10.1-20.2s17.4 1.7 20.2 10.1zm-19.9 80.4l-32 32c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l32-32c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z"]
};
const faGlobeOceania = faEarthOceania;
const faSquareXmark = {
  prefix: 'fas',
  iconName: 'square-xmark',
  icon: [448, 512, [10062, "times-square", "xmark-square"], "f2d3", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm79 143c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faTimesSquare = faSquareXmark;
const faXmarkSquare = faSquareXmark;
const faHashtag = {
  prefix: 'fas',
  iconName: 'hashtag',
  icon: [448, 512, [62098], "23", "M181.3 32.4c17.4 2.9 29.2 19.4 26.3 36.8L197.8 128l95.1 0 11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3s29.2 19.4 26.3 36.8L357.8 128l58.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-68.9 0L325.8 320l58.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-68.9 0-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l9.8-58.7-95.1 0-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8L90.2 384 32 384c-17.7 0-32-14.3-32-32s14.3-32 32-32l68.9 0 21.3-128L64 192c-17.7 0-32-14.3-32-32s14.3-32 32-32l68.9 0 11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3zM187.1 192L165.8 320l95.1 0 21.3-128-95.1 0z"]
};
const faUpRightAndDownLeftFromCenter = {
  prefix: 'fas',
  iconName: 'up-right-and-down-left-from-center',
  icon: [512, 512, ["expand-alt"], "f424", "M344 0L488 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87L327 41c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512L24 512c-13.3 0-24-10.7-24-24L0 344c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8z"]
};
const faExpandAlt = faUpRightAndDownLeftFromCenter;
const faOilCan = {
  prefix: 'fas',
  iconName: 'oil-can',
  icon: [640, 512, [], "f613", "M320 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32-80 0-48 0-48 0c-26.5 0-48 21.5-48 48l0 64.8c0 19 11.2 36.2 28.5 43.9l67.5 30L96 368c0 26.5 21.5 48 48 48l259.1 0c18.4 0 35.8-7.9 48-21.7L633.5 187.7c12.3-13.9-.3-35.4-18.4-31.5L448 192l-50.5-25.2c-8.9-4.4-18.7-6.8-28.6-6.8L288 160l0-32 32 0zM96 208l0 86.1L48 272.8 48 208l48 0z"]
};
const faT = {
  prefix: 'fas',
  iconName: 't',
  icon: [384, 512, [116], "54", "M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l128 0 0 352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-352 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 32 32 32z"]
};
const faHippo = {
  prefix: 'fas',
  iconName: 'hippo',
  icon: [640, 512, [129435], "f6ed", "M407 47c9.4-9.4 24.6-9.4 33.9 0l17.2 17.2c1.9-.1 3.9-.2 5.8-.2l32 0c11.2 0 21.9 2.3 31.6 6.5L543 55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L564 101.9c7.6 12.2 12 26.7 12 42.1c0 10.2 7.4 18.8 16.7 23c27.9 12.5 47.3 40.5 47.3 73c0 26.2-12.6 49.4-32 64l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-16-64 0 0 16c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-17.6c-11.8-2.4-22.7-7.4-32-14.4c-1.5-1.1-2.9-2.3-4.3-3.5c-17-14.7-27.7-36.4-27.7-60.5c0-8.8-7.2-16-16-16s-16 7.2-16 16c0 44.7 26.2 83.2 64 101.2l0 10.8c0 17.7 14.3 32 32 32l32 0 0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-76c-19.8 7.7-41.4 12-64 12s-44.2-4.3-64-12l0 76c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-118.9L45.9 369.7c-5.4 12.1-19.6 17.6-31.7 12.2S-3.3 362.4 2.1 350.3L24 300.9c5.3-11.9 8-24.7 8-37.7C32 155.7 117.2 68 223.8 64.1l.2-.1 7.2 0L256 64l32 0c41.7 0 83.4 12.1 117.2 25.7c1.7-1.8 3.5-3.6 5.3-5.2L407 81c-9.4-9.4-9.4-24.6 0-33.9zm73 185a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm88 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM480 144a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"]
};
const faChartColumn = {
  prefix: 'fas',
  iconName: 'chart-column',
  icon: [512, 512, [], "e0e3", "M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zM160 224c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm128-64l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32s32 14.3 32 32zm64 32c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32zM480 96l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-224c0-17.7 14.3-32 32-32s32 14.3 32 32z"]
};
const faInfinity = {
  prefix: 'fas',
  iconName: 'infinity',
  icon: [640, 512, [8734, 9854], "f534", "M0 241.1C0 161 65 96 145.1 96c38.5 0 75.4 15.3 102.6 42.5L320 210.7l72.2-72.2C419.5 111.3 456.4 96 494.9 96C575 96 640 161 640 241.1l0 29.7C640 351 575 416 494.9 416c-38.5 0-75.4-15.3-102.6-42.5L320 301.3l-72.2 72.2C220.5 400.7 183.6 416 145.1 416C65 416 0 351 0 270.9l0-29.7zM274.7 256l-72.2-72.2c-15.2-15.2-35.9-23.8-57.4-23.8C100.3 160 64 196.3 64 241.1l0 29.7c0 44.8 36.3 81.1 81.1 81.1c21.5 0 42.2-8.5 57.4-23.8L274.7 256zm90.5 0l72.2 72.2c15.2 15.2 35.9 23.8 57.4 23.8c44.8 0 81.1-36.3 81.1-81.1l0-29.7c0-44.8-36.3-81.1-81.1-81.1c-21.5 0-42.2 8.5-57.4 23.8L365.3 256z"]
};
const faVialCircleCheck = {
  prefix: 'fas',
  iconName: 'vial-circle-check',
  icon: [512, 512, [], "e596", "M0 64C0 46.3 14.3 32 32 32l64 0 64 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 170.8c-20.2 28.6-32 63.5-32 101.2c0 25.2 5.3 49.1 14.8 70.8C189.5 463.7 160.6 480 128 480c-53 0-96-43-96-96L32 96C14.3 96 0 81.7 0 64zM96 96l0 96 64 0 0-96L96 96zM224 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L352 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faPersonArrowDownToLine = {
  prefix: 'fas',
  iconName: 'person-arrow-down-to-line',
  icon: [640, 512, [], "e538", "M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 352l0-96 16 0 0 96-16 0zm-64 0l-88 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l120 0 80 0 376 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-344 0 0-191.1 28.6 47.5c9.1 15.1 28.8 20 43.9 10.9s20-28.8 10.9-43.9l-58.3-97c-17.4-28.9-48.6-46.6-82.3-46.6l-29.7 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9L120 256.9 120 448zM464 64l0 242.7-25.4-25.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l80 80c12.5 12.5 32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L528 306.7 528 64c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faVoicemail = {
  prefix: 'fas',
  iconName: 'voicemail',
  icon: [640, 512, [], "f897", "M144 320a80 80 0 1 1 0-160 80 80 0 1 1 0 160zm119.8 0c15.3-22.9 24.2-50.4 24.2-80c0-79.5-64.5-144-144-144S0 160.5 0 240s64.5 144 144 144l352 0c79.5 0 144-64.5 144-144s-64.5-144-144-144s-144 64.5-144 144c0 29.6 8.9 57.1 24.2 80l-112.5 0zM496 160a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"]
};
const faFan = {
  prefix: 'fas',
  iconName: 'fan',
  icon: [512, 512, [], "f863", "M258.6 0c-1.7 0-3.4 .1-5.1 .5C168 17 115.6 102.3 130.5 189.3c2.9 17 8.4 32.9 15.9 47.4L32 224l-2.6 0C13.2 224 0 237.2 0 253.4c0 1.7 .1 3.4 .5 5.1C17 344 102.3 396.4 189.3 381.5c17-2.9 32.9-8.4 47.4-15.9L224 480l0 2.6c0 16.2 13.2 29.4 29.4 29.4c1.7 0 3.4-.1 5.1-.5C344 495 396.4 409.7 381.5 322.7c-2.9-17-8.4-32.9-15.9-47.4L480 288l2.6 0c16.2 0 29.4-13.2 29.4-29.4c0-1.7-.1-3.4-.5-5.1C495 168 409.7 115.6 322.7 130.5c-17 2.9-32.9 8.4-47.4 15.9L288 32l0-2.6C288 13.2 274.8 0 258.6 0zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faPersonWalkingLuggage = {
  prefix: 'fas',
  iconName: 'person-walking-luggage',
  icon: [576, 512, [], "e554", "M432 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM347.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L505 232.7l-15.3-36.8C472.5 154.8 432.3 128 387.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1l-25 62.4-59.4 59.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L340.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM256 274.1c-7.7-4.4-17.4-1.8-21.9 5.9l-32 55.4L147.7 304c-15.3-8.8-34.9-3.6-43.7 11.7L40 426.6c-8.8 15.3-3.6 34.9 11.7 43.7l55.4 32c15.3 8.8 34.9 3.6 43.7-11.7l64-110.9c1.5-2.6 2.6-5.2 3.3-8L261.9 296c4.4-7.7 1.8-17.4-5.9-21.9z"]
};
const faUpDown = {
  prefix: 'fas',
  iconName: 'up-down',
  icon: [256, 512, [8597, 11021, "arrows-alt-v"], "f338", "M145.6 7.7C141 2.8 134.7 0 128 0s-13 2.8-17.6 7.7l-104 112c-6.5 7-8.2 17.2-4.4 25.9S14.5 160 24 160l56 0 0 192-56 0c-9.5 0-18.2 5.7-22 14.4s-2.1 18.9 4.4 25.9l104 112c4.5 4.9 10.9 7.7 17.6 7.7s13-2.8 17.6-7.7l104-112c6.5-7 8.2-17.2 4.4-25.9s-12.5-14.4-22-14.4l-56 0 0-192 56 0c9.5 0 18.2-5.7 22-14.4s2.1-18.9-4.4-25.9l-104-112z"]
};
const faArrowsAltV = faUpDown;
const faCloudMoonRain = {
  prefix: 'fas',
  iconName: 'cloud-moon-rain',
  icon: [576, 512, [], "f73c", "M481.2 0C417 0 363.5 46.5 353.7 107.6c35.4 17.6 60.2 53.3 62.1 95.1c23.2 11 42 29.7 53.1 52.7c4 .4 8.1 .6 12.3 .6c34.9 0 66.7-13.8 89.9-36.1c5.1-4.9 6.4-12.5 3.2-18.7s-10.1-9.7-17-8.6c-4.9 .8-10 1.3-15.2 1.3c-49 0-88.4-39.3-88.4-87.4c0-32.6 18-61.1 44.9-76.1c6.1-3.4 9.3-10.5 7.8-17.4s-7.3-12-14.3-12.6c-3.6-.3-7.3-.5-10.9-.5zM367.9 383.9c44.2 0 80-35.8 80-80c0-39.3-28.4-72.1-65.8-78.7c1.2-5.6 1.9-11.3 1.9-17.2c0-44.2-35.8-80-80-80c-17 0-32.8 5.3-45.8 14.4C241.3 114.6 210.8 96 176 96c-53 0-96 43-96 96l0 1.3c-45.4 7.6-80 47.1-80 94.6c0 53 43 96 96 96l271.9 0zM85.4 420.1c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3zm96 0c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3zm96 0c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3zm96 0c-11-7.4-25.9-4.4-33.3 6.7l-32 48c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l32-48c7.4-11 4.4-25.9-6.7-33.3z"]
};
const faCalendar = {
  prefix: 'fas',
  iconName: 'calendar',
  icon: [448, 512, [128197, 128198], "f133", "M96 32l0 32L48 64C21.5 64 0 85.5 0 112l0 48 448 0 0-48c0-26.5-21.5-48-48-48l-48 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L160 64l0-32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192L0 192 0 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-272z"]
};
const faTrailer = {
  prefix: 'fas',
  iconName: 'trailer',
  icon: [640, 512, [], "e041", "M48 32C21.5 32 0 53.5 0 80L0 336c0 26.5 21.5 48 48 48l17.1 0c7.8-54.3 54.4-96 110.9-96s103.1 41.7 110.9 96L488 384l8 0 112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-240c0-26.5-21.5-48-48-48L48 32zM80 96c8.8 0 16 7.2 16 16l0 131.2c-11.4 5.9-22.2 12.9-32 21L64 112c0-8.8 7.2-16 16-16zm96 128c-5.4 0-10.7 .2-16 .7L160 112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 112.7c-5.3-.5-10.6-.7-16-.7zm80 19.2L256 112c0-8.8 7.2-16 16-16s16 7.2 16 16l0 152.2c-9.8-8.1-20.6-15.2-32-21zM368 96c8.8 0 16 7.2 16 16l0 192c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-192c0-8.8 7.2-16 16-16zm112 16l0 192c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-192c0-8.8 7.2-16 16-16s16 7.2 16 16zM176 480a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-112a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBahai = {
  prefix: 'fas',
  iconName: 'bahai',
  icon: [576, 512, ["haykal"], "f666", "M288 0c14.5 0 27.2 9.7 30.9 23.8l23.9 89.6 75.9-53.3c11.9-8.3 27.8-7.6 39 1.7s14.6 24.9 8.4 38.1l-39.3 84 92.4 8c14.4 1.2 26.2 12 28.8 26.3s-4.9 28.5-18 34.6l-84.1 39.1 65.7 65.5c10.3 10.2 12.4 26.1 5.1 38.7s-22 18.7-36 14.9L391 386.8l8.2 92.4c1.3 14.4-7.3 27.9-20.9 32.9s-28.9 .1-37.2-11.7l-53.1-76-53.1 76c-8.3 11.9-23.6 16.7-37.2 11.7s-22.2-18.5-20.9-32.9l8.2-92.4L95.4 410.9c-14 3.8-28.8-2.3-36-14.9s-5.2-28.4 5.1-38.7l65.7-65.5L46 252.7c-13.1-6.1-20.5-20.3-18-34.6s14.3-25.1 28.8-26.3l92.4-8-39.3-84c-6.1-13.1-2.7-28.8 8.4-38.1s27.1-10 39-1.7l75.9 53.3 23.9-89.6C260.8 9.7 273.5 0 288 0zm0 156.2l-4.8 18c-2.7 10.1-10.2 18.2-20 21.8s-20.8 2.1-29.3-3.9l-15.2-10.7 7.9 16.8c4.4 9.5 4 20.5-1.3 29.6s-14.5 15-25 15.9l-18.5 1.6 16.8 7.8c9.5 4.4 16.2 13.2 18 23.5s-1.5 20.8-8.9 28.2l-13.2 13.1 17.9-4.8c10.1-2.7 20.9-.3 28.9 6.4s12.2 16.9 11.3 27.3l-1.6 18.5 10.6-15.2c6-8.6 15.8-13.7 26.2-13.7s20.2 5.1 26.2 13.7l10.6 15.2-1.6-18.5c-.9-10.4 3.3-20.6 11.3-27.3s18.8-9.1 28.9-6.4l17.9 4.8-13.2-13.1c-7.4-7.4-10.7-17.9-8.9-28.2s8.5-19.1 18-23.5l16.8-7.8-18.5-1.6c-10.4-.9-19.7-6.8-25-15.9s-5.7-20.1-1.3-29.6l7.9-16.8-15.2 10.7c-8.6 6-19.5 7.5-29.3 3.9s-17.3-11.7-20-21.8l-4.8-18z"]
};
const faHaykal = faBahai;
const faSdCard = {
  prefix: 'fas',
  iconName: 'sd-card',
  icon: [384, 512, [], "f7c2", "M320 0L141.3 0C124.3 0 108 6.7 96 18.7L18.7 96C6.7 108 0 124.3 0 141.3L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64zM160 88l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24zm80 0l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24zm80 0l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24z"]
};
const faDragon = {
  prefix: 'fas',
  iconName: 'dragon',
  icon: [640, 512, [128009], "f6d5", "M352 124.5l-51.9-13c-6.5-1.6-11.3-7.1-12-13.8s2.8-13.1 8.7-16.1l40.8-20.4L294.4 28.8c-5.5-4.1-7.8-11.3-5.6-17.9S297.1 0 304 0L416 0l32 0 16 0c30.2 0 58.7 14.2 76.8 38.4l57.6 76.8c6.2 8.3 9.6 18.4 9.6 28.8c0 26.5-21.5 48-48 48l-21.5 0c-17 0-33.3-6.7-45.3-18.7L480 160l-32 0 0 21.5c0 24.8 12.8 47.9 33.8 61.1l106.6 66.6c32.1 20.1 51.6 55.2 51.6 93.1C640 462.9 590.9 512 530.2 512L496 512l-64 0L32.3 512c-3.3 0-6.6-.4-9.6-1.4C13.5 507.8 6 501 2.4 492.1C1 488.7 .2 485.2 0 481.4c-.2-3.7 .3-7.3 1.3-10.7c2.8-9.2 9.6-16.7 18.6-20.4c3-1.2 6.2-2 9.5-2.2L433.3 412c8.3-.7 14.7-7.7 14.7-16.1c0-4.3-1.7-8.4-4.7-11.4l-44.4-44.4c-30-30-46.9-70.7-46.9-113.1l0-45.5 0-57zM512 72.3c0-.1 0-.2 0-.3s0-.2 0-.3l0 .6zm-1.3 7.4L464.3 68.1c-.2 1.3-.3 2.6-.3 3.9c0 13.3 10.7 24 24 24c10.6 0 19.5-6.8 22.7-16.3zM130.9 116.5c16.3-14.5 40.4-16.2 58.5-4.1l130.6 87 0 27.5c0 32.8 8.4 64.8 24 93l-232 0c-6.7 0-12.7-4.2-15-10.4s-.5-13.3 4.6-17.7L171 232.3 18.4 255.8c-7 1.1-13.9-2.6-16.9-9s-1.5-14.1 3.8-18.8L130.9 116.5z"]
};
const faShoePrints = {
  prefix: 'fas',
  iconName: 'shoe-prints',
  icon: [640, 512, [], "f54b", "M416 0C352.3 0 256 32 256 32l0 128c48 0 76 16 104 32s56 32 104 32c56.4 0 176-16 176-96S512 0 416 0zM128 96c0 35.3 28.7 64 64 64l32 0 0-128-32 0c-35.3 0-64 28.7-64 64zM288 512c96 0 224-48 224-128s-119.6-96-176-96c-48 0-76 16-104 32s-56 32-104 32l0 128s96.3 32 160 32zM0 416c0 35.3 28.7 64 64 64l32 0 0-128-32 0c-35.3 0-64 28.7-64 64z"]
};
const faCirclePlus = {
  prefix: 'fas',
  iconName: 'circle-plus',
  icon: [512, 512, ["plus-circle"], "f055", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
};
const faPlusCircle = faCirclePlus;
const faFaceGrinTongueWink = {
  prefix: 'fas',
  iconName: 'face-grin-tongue-wink',
  icon: [512, 512, [128540, "grin-tongue-wink"], "f58b", "M174.5 498.8C73.1 464.7 0 368.9 0 256C0 114.6 114.6 0 256 0S512 114.6 512 256c0 112.9-73.1 208.7-174.5 242.8C346.7 484 352 466.6 352 448l0-46.9c24.3-17.5 43.6-41.6 55.4-69.6c5-11.8-7-22.5-19.3-18.7c-39.7 12.2-84.5 19-131.8 19s-92.1-6.8-131.8-19c-12.3-3.8-24.3 6.9-19.3 18.7c11.7 27.8 30.8 51.7 54.8 69.2l0 47.3c0 18.6 5.3 36 14.5 50.8zm20.7-265.2c5.3 7.1 15.3 8.5 22.4 3.2s8.5-15.3 3.2-22.4c-30.4-40.5-91.2-40.5-121.6 0c-5.3 7.1-3.9 17.1 3.2 22.4s17.1 3.9 22.4-3.2c17.6-23.5 52.8-23.5 70.4 0zM336 272a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM320 402.6l0 45.4c0 35.3-28.7 64-64 64s-64-28.7-64-64l0-45.4c0-14.7 11.9-26.6 26.6-26.6l2 0c11.3 0 21.1 7.9 23.6 18.9c2.8 12.6 20.8 12.6 23.6 0c2.5-11.1 12.3-18.9 23.6-18.9l2 0c14.7 0 26.6 11.9 26.6 26.6zM336 184a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faGrinTongueWink = faFaceGrinTongueWink;
const faHandHolding = {
  prefix: 'fas',
  iconName: 'hand-holding',
  icon: [576, 512, [], "f4bd", "M559.7 392.2c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416 272 416c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0-16 0-78.3 0c-29.1 0-57.3 9.9-80 28L68.8 384 32 384c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l160 0 160.5 0c29 0 57.3-9.3 80.7-26.5l126.6-93.3zm-367-8.2c.3 0 .6 0 .9 0c0 0 0 0 0 0c-.3 0-.6 0-.9 0z"]
};
const faPlugCircleExclamation = {
  prefix: 'fas',
  iconName: 'plug-circle-exclamation',
  icon: [576, 512, [], "e55d", "M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2c12.3-2.5 24.1-6.4 35.1-11.5c-2.1-10.8-3.1-21.9-3.1-33.3c0-80.3 53.8-148 127.3-169.2c.5-2.2 .7-4.5 .7-6.8c0-17.7-14.3-32-32-32L32 160zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0-144c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z"]
};
const faLinkSlash = {
  prefix: 'fas',
  iconName: 'link-slash',
  icon: [640, 512, ["chain-broken", "chain-slash", "unlink"], "f127", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L489.3 358.2l90.5-90.5c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114l-96 96-31.9-25C430.9 239.6 420.1 175.1 377 132c-52.2-52.3-134.5-56.2-191.3-11.7L38.8 5.1zM239 162c30.1-14.9 67.7-9.9 92.8 15.3c20 20 27.5 48.3 21.7 74.5L239 162zM406.6 416.4L220.9 270c-2.1 39.8 12.2 80.1 42.2 110c38.9 38.9 94.4 51 143.6 36.3zm-290-228.5L60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5l61.8-61.8-50.6-39.9z"]
};
const faChainBroken = faLinkSlash;
const faChainSlash = faLinkSlash;
const faUnlink = faLinkSlash;
const faClone = {
  prefix: 'fas',
  iconName: 'clone',
  icon: [512, 512, [], "f24d", "M288 448L64 448l0-224 64 0 0-64-64 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-64-64 0 0 64zm-64-96l224 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L224 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64z"]
};
const faPersonWalkingArrowLoopLeft = {
  prefix: 'fas',
  iconName: 'person-walking-arrow-loop-left',
  icon: [640, 512, [], "e551", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zm347.7 119c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L461.3 384l18.7 0c88.4 0 160-71.6 160-160s-71.6-160-160-160L352 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c53 0 96 43 96 96s-43 96-96 96l-18.7 0 25.4-25.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3l80 80z"]
};
const faArrowUpZA = {
  prefix: 'fas',
  iconName: 'arrow-up-z-a',
  icon: [576, 512, ["sort-alpha-up-alt"], "f882", "M183.6 42.4C177.5 35.8 169 32 160 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L128 146.3 128 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 64c0 17.7 14.3 32 32 32l50.7 0-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-50.7 0 73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L352 32c-17.7 0-32 14.3-32 32zm96 192c-12.1 0-23.2 6.8-28.6 17.7l-64 128-16 32c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3 88.4 0 7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9l-16-32-64-128C439.2 262.8 428.1 256 416 256zM395.8 400L416 359.6 436.2 400l-40.4 0z"]
};
const faSortAlphaUpAlt = faArrowUpZA;
const faFireFlameCurved = {
  prefix: 'fas',
  iconName: 'fire-flame-curved',
  icon: [384, 512, ["fire-alt"], "f7e4", "M153.6 29.9l16-21.3C173.6 3.2 180 0 186.7 0C198.4 0 208 9.6 208 21.3V43.5c0 13.1 5.4 25.7 14.9 34.7L307.6 159C356.4 205.6 384 270.2 384 337.7C384 434 306 512 209.7 512H192C86 512 0 426 0 320v-3.8c0-48.8 19.4-95.6 53.9-130.1l3.5-3.5c4.2-4.2 10-6.6 16-6.6C85.9 176 96 186.1 96 198.6V288c0 35.3 28.7 64 64 64s64-28.7 64-64v-3.9c0-18-7.2-35.3-19.9-48l-38.6-38.6c-24-24-37.5-56.7-37.5-90.7c0-27.7 9-54.8 25.6-76.9z"]
};
const faFireAlt = faFireFlameCurved;
const faTornado = {
  prefix: 'fas',
  iconName: 'tornado',
  icon: [448, 512, [127786], "f76f", "M0 32L0 45.6C0 62.7 1.7 79.6 5 96l352.8 0c3.2-6.9 7.5-13.3 13-18.8l38.6-38.6c4.2-4.2 6.6-10 6.6-16C416 10.1 405.9 0 393.4 0L32 0C14.3 0 0 14.3 0 32zm352.2 96L13.6 128c12.2 35.9 32.3 68.7 58.8 96L412 224l-47.2-62.9c-7.3-9.7-11.6-21.2-12.6-33.1zm-226 138.2l116.4 68.5c8.2 4.8 15.8 10.7 22.5 17.3L445 352c2-9.8 3-19.9 3-30.1c0-23-5.3-45.5-15.3-65.9l-322.5 0c5.2 3.6 10.5 7 16 10.2zM288 384c10.3 21.4 13.8 45.5 9.9 69l-5.9 35.7c-2 12.2 7.4 23.4 19.8 23.4c5.3 0 10.4-2.1 14.2-5.9l78.2-78.2c12.8-12.8 23.1-27.7 30.4-43.9L288 384z"]
};
const faFileCirclePlus = {
  prefix: 'fas',
  iconName: 'file-circle-plus',
  icon: [576, 512, [58606], "e494", "M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zm48 96a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm16 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0 0-48z"]
};
const faBookQuran = {
  prefix: 'fas',
  iconName: 'book-quran',
  icon: [448, 512, ["quran"], "f687", "M352 0c53 0 96 43 96 96l0 320c0 53-43 96-96 96L64 512l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0L64 0 352 0zm0 384L96 384l0 64 256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32zM274.1 150.2l-8.9 21.4-23.1 1.9c-5.7 .5-8 7.5-3.7 11.2L256 199.8l-5.4 22.6c-1.3 5.5 4.7 9.9 9.6 6.9L280 217.2l19.8 12.1c4.9 3 10.9-1.4 9.6-6.9L304 199.8l17.6-15.1c4.3-3.7 2-10.8-3.7-11.2l-23.1-1.9-8.9-21.4c-2.2-5.3-9.6-5.3-11.8 0zM96 192c0 70.7 57.3 128 128 128c25.6 0 49.5-7.5 69.5-20.5c3.2-2.1 4.5-6.2 3.1-9.7s-5.2-5.6-9-4.8c-6.1 1.2-12.5 1.9-19 1.9c-52.4 0-94.9-42.5-94.9-94.9s42.5-94.9 94.9-94.9c6.5 0 12.8 .7 19 1.9c3.8 .8 7.5-1.3 9-4.8s.2-7.6-3.1-9.7C273.5 71.5 249.6 64 224 64C153.3 64 96 121.3 96 192z"]
};
const faQuran = faBookQuran;
const faAnchor = {
  prefix: 'fas',
  iconName: 'anchor',
  icon: [576, 512, [9875], "f13d", "M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm21.1 80C367 158.8 384 129.4 384 96c0-53-43-96-96-96s-96 43-96 96c0 33.4 17 62.8 42.9 80L224 176c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 208-48 0c-53 0-96-43-96-96l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L97 263c-9.4-9.4-24.6-9.4-33.9 0L7 319c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 88.4 71.6 160 160 160l80 0 80 0c88.4 0 160-71.6 160-160l0-6.1 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-56-56c-9.4-9.4-24.6-9.4-33.9 0l-56 56c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l7-7 0 6.1c0 53-43 96-96 96l-48 0 0-208 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.9 0z"]
};
const faBorderAll = {
  prefix: 'fas',
  iconName: 'border-all',
  icon: [448, 512, [], "f84c", "M384 96l0 128-128 0 0-128 128 0zm0 192l0 128-128 0 0-128 128 0zM192 224L64 224 64 96l128 0 0 128zM64 288l128 0 0 128L64 416l0-128zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"]
};
const faFaceAngry = {
  prefix: 'fas',
  iconName: 'face-angry',
  icon: [512, 512, [128544, "angry"], "f556", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM338.7 395.9c6.6-5.9 7.1-16 1.2-22.6C323.8 355.4 295.7 336 256 336s-67.8 19.4-83.9 37.3c-5.9 6.6-5.4 16.7 1.2 22.6s16.7 5.4 22.6-1.2c11.7-13 31.6-26.7 60.1-26.7s48.4 13.7 60.1 26.7c5.9 6.6 16 7.1 22.6 1.2zM176.4 272c17.7 0 32-14.3 32-32c0-1.5-.1-3-.3-4.4l10.9 3.6c8.4 2.8 17.4-1.7 20.2-10.1s-1.7-17.4-10.1-20.2l-96-32c-8.4-2.8-17.4 1.7-20.2 10.1s1.7 17.4 10.1 20.2l30.7 10.2c-5.8 5.8-9.3 13.8-9.3 22.6c0 17.7 14.3 32 32 32zm192-32c0-8.9-3.6-17-9.5-22.8l30.2-10.1c8.4-2.8 12.9-11.9 10.1-20.2s-11.9-12.9-20.2-10.1l-96 32c-8.4 2.8-12.9 11.9-10.1 20.2s11.9 12.9 20.2 10.1l11.7-3.9c-.2 1.5-.3 3.1-.3 4.7c0 17.7 14.3 32 32 32s32-14.3 32-32z"]
};
const faAngry = faFaceAngry;
const faCookieBite = {
  prefix: 'fas',
  iconName: 'cookie-bite',
  icon: [512, 512, [], "f564", "M257.5 27.6c-.8-5.4-4.9-9.8-10.3-10.6c-22.1-3.1-44.6 .9-64.4 11.4l-74 39.5C89.1 78.4 73.2 94.9 63.4 115L26.7 190.6c-9.8 20.1-13 42.9-9.1 64.9l14.5 82.8c3.9 22.1 14.6 42.3 30.7 57.9l60.3 58.4c16.1 15.6 36.6 25.6 58.7 28.7l83 11.7c22.1 3.1 44.6-.9 64.4-11.4l74-39.5c19.7-10.5 35.6-27 45.4-47.2l36.7-75.5c9.8-20.1 13-42.9 9.1-64.9c-.9-5.3-5.3-9.3-10.6-10.1c-51.5-8.2-92.8-47.1-104.5-97.4c-1.8-7.6-8-13.4-15.7-14.6c-54.6-8.7-97.7-52-106.2-106.8zM208 144a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM144 336a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm224-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faArrowTrendDown = {
  prefix: 'fas',
  iconName: 'arrow-trend-down',
  icon: [576, 512, [], "e097", "M384 352c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-160c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 82.7L342.6 137.4c-12.5-12.5-32.8-12.5-45.3 0L192 242.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0L320 205.3 466.7 352 384 352z"]
};
const faRss = {
  prefix: 'fas',
  iconName: 'rss',
  icon: [448, 512, ["feed"], "f09e", "M0 64C0 46.3 14.3 32 32 32c229.8 0 416 186.2 416 416c0 17.7-14.3 32-32 32s-32-14.3-32-32C384 253.6 226.4 96 32 96C14.3 96 0 81.7 0 64zM0 416a64 64 0 1 1 128 0A64 64 0 1 1 0 416zM32 160c159.1 0 288 128.9 288 288c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-123.7-100.3-224-224-224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faFeed = faRss;
const faDrawPolygon = {
  prefix: 'fas',
  iconName: 'draw-polygon',
  icon: [448, 512, [], "f5ee", "M96 151.4l0 209.1c9.7 5.6 17.8 13.7 23.4 23.4l209.1 0c0-.1 .1-.2 .1-.3l-4.5-7.9-32-56s0 0 0 0c-1.4 .1-2.8 .1-4.2 .1c-35.3 0-64-28.7-64-64s28.7-64 64-64c1.4 0 2.8 0 4.2 .1c0 0 0 0 0 0l32-56 4.5-7.9-.1-.3-209.1 0c-5.6 9.7-13.7 17.8-23.4 23.4zM384.3 352c35.2 .2 63.7 28.7 63.7 64c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32l-209.1 0c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4l0-209.1C12.9 140.4 0 119.7 0 96C0 60.7 28.7 32 64 32c23.7 0 44.4 12.9 55.4 32l209.1 0c11.1-19.1 31.7-32 55.4-32c35.3 0 64 28.7 64 64c0 35.3-28.5 63.8-63.7 64l-4.5 7.9-32 56-2.3 4c4.2 8.5 6.5 18 6.5 28.1s-2.3 19.6-6.5 28.1l2.3 4 32 56 4.5 7.9z"]
};
const faScaleBalanced = {
  prefix: 'fas',
  iconName: 'scale-balanced',
  icon: [640, 512, [9878, "balance-scale"], "f24e", "M384 32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L398.4 96c-5.2 25.8-22.9 47.1-46.4 57.3L352 448l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0 0-294.7c-23.5-10.3-41.2-31.6-46.4-57.3L128 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l128 0c14.6-19.4 37.8-32 64-32s49.4 12.6 64 32zm55.6 288l144.9 0L512 195.8 439.6 320zM512 416c-62.9 0-115.2-34-126-78.9c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1C627.2 382 574.9 416 512 416zM126.8 195.8L54.4 320l144.9 0L126.8 195.8zM.9 337.1c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1C242 382 189.7 416 126.8 416S11.7 382 .9 337.1z"]
};
const faBalanceScale = faScaleBalanced;
const faGaugeSimpleHigh = {
  prefix: 'fas',
  iconName: 'gauge-simple-high',
  icon: [512, 512, [61668, "tachometer", "tachometer-fast"], "f62a", "M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm320 96c0-15.9-5.8-30.4-15.3-41.6l76.6-147.4c6.1-11.8 1.5-26.3-10.2-32.4s-26.2-1.5-32.4 10.2L262.1 288.3c-2-.2-4-.3-6.1-.3c-35.3 0-64 28.7-64 64s28.7 64 64 64s64-28.7 64-64z"]
};
const faTachometer = faGaugeSimpleHigh;
const faTachometerFast = faGaugeSimpleHigh;
const faShower = {
  prefix: 'fas',
  iconName: 'shower',
  icon: [512, 512, [128703], "f2cc", "M64 131.9C64 112.1 80.1 96 99.9 96c9.5 0 18.6 3.8 25.4 10.5l16.2 16.2c-21 38.9-17.4 87.5 10.9 123L151 247c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L345 121c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-1.3 1.3c-35.5-28.3-84.2-31.9-123-10.9L170.5 61.3C151.8 42.5 126.4 32 99.9 32C44.7 32 0 76.7 0 131.9L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-316.1zM256 352a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm32-32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faDesktop = {
  prefix: 'fas',
  iconName: 'desktop',
  icon: [576, 512, [128421, 61704, "desktop-alt"], "f390", "M64 0C28.7 0 0 28.7 0 64L0 352c0 35.3 28.7 64 64 64l176 0-10.7 32L160 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-69.3 0L336 416l176 0c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64L64 0zM512 64l0 224L64 288 64 64l448 0z"]
};
const faDesktopAlt = faDesktop;
const faM = {
  prefix: 'fas',
  iconName: 'm',
  icon: [448, 512, [109], "4d", "M22.7 33.4c13.5-4.1 28.1 1.1 35.9 12.9L224 294.3 389.4 46.3c7.8-11.7 22.4-17 35.9-12.9S448 49.9 448 64l0 384c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-278.3L250.6 369.8c-5.9 8.9-15.9 14.2-26.6 14.2s-20.7-5.3-26.6-14.2L64 169.7 64 448c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 64C0 49.9 9.2 37.5 22.7 33.4z"]
};
const faTableList = {
  prefix: 'fas',
  iconName: 'table-list',
  icon: [512, 512, ["th-list"], "f00b", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 0l0 64 64 0 0-64L64 96zm384 0L192 96l0 64 256 0 0-64zM64 224l0 64 64 0 0-64-64 0zm384 0l-256 0 0 64 256 0 0-64zM64 352l0 64 64 0 0-64-64 0zm384 0l-256 0 0 64 256 0 0-64z"]
};
const faThList = faTableList;
const faCommentSms = {
  prefix: 'fas',
  iconName: 'comment-sms',
  icon: [512, 512, ["sms"], "f7cd", "M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM96 212.8c0-20.3 16.5-36.8 36.8-36.8l19.2 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-19.2 0c-2.7 0-4.8 2.2-4.8 4.8c0 1.6 .8 3.1 2.2 4l29.4 19.6c10.3 6.8 16.4 18.3 16.4 30.7c0 20.3-16.5 36.8-36.8 36.8L112 304c-8.8 0-16-7.2-16-16s7.2-16 16-16l27.2 0c2.7 0 4.8-2.2 4.8-4.8c0-1.6-.8-3.1-2.2-4l-29.4-19.6C102.2 236.7 96 225.2 96 212.8zM372.8 176l19.2 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-19.2 0c-2.7 0-4.8 2.2-4.8 4.8c0 1.6 .8 3.1 2.2 4l29.4 19.6c10.2 6.8 16.4 18.3 16.4 30.7c0 20.3-16.5 36.8-36.8 36.8L352 304c-8.8 0-16-7.2-16-16s7.2-16 16-16l27.2 0c2.7 0 4.8-2.2 4.8-4.8c0-1.6-.8-3.1-2.2-4l-29.4-19.6c-10.2-6.8-16.4-18.3-16.4-30.7c0-20.3 16.5-36.8 36.8-36.8zm-152 6.4L256 229.3l35.2-46.9c4.1-5.5 11.3-7.8 17.9-5.6s10.9 8.3 10.9 15.2l0 96c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48-19.2 25.6c-3 4-7.8 6.4-12.8 6.4s-9.8-2.4-12.8-6.4L224 240l0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-6.9 4.4-13 10.9-15.2s13.7 .1 17.9 5.6z"]
};
const faSms = faCommentSms;
const faBook = {
  prefix: 'fas',
  iconName: 'book',
  icon: [448, 512, [128212], "f02d", "M96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96l288 0 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-64c17.7 0 32-14.3 32-32l0-320c0-17.7-14.3-32-32-32L384 0 96 0zm0 384l256 0 0 64L96 448c-17.7 0-32-14.3-32-32s14.3-32 32-32zm32-240c0-8.8 7.2-16 16-16l192 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16zm16 48l192 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faUserPlus = {
  prefix: 'fas',
  iconName: 'user-plus',
  icon: [640, 512, [], "f234", "M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM504 312l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"]
};
const faCheck = {
  prefix: 'fas',
  iconName: 'check',
  icon: [448, 512, [10003, 10004], "f00c", "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"]
};
const faBatteryThreeQuarters = {
  prefix: 'fas',
  iconName: 'battery-three-quarters',
  icon: [576, 512, ["battery-4"], "f241", "M464 160c8.8 0 16 7.2 16 16l0 160c0 8.8-7.2 16-16 16L80 352c-8.8 0-16-7.2-16-16l0-160c0-8.8 7.2-16 16-16l384 0zM80 96C35.8 96 0 131.8 0 176L0 336c0 44.2 35.8 80 80 80l384 0c44.2 0 80-35.8 80-80l0-16c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-16c0-44.2-35.8-80-80-80L80 96zm272 96L96 192l0 128 256 0 0-128z"]
};
const faBattery4 = faBatteryThreeQuarters;
const faHouseCircleCheck = {
  prefix: 'fas',
  iconName: 'house-circle-check',
  icon: [640, 512, [], "e509", "M320.7 352c8.1-89.7 83.5-160 175.3-160c8.9 0 17.6 .7 26.1 1.9L309.5 7c-6-5-14-7-21-7s-15 1-22 8L10 231.5c-7 7-10 15-10 24c0 18 14 32.1 32 32.1l32 0 0 69.7c-.1 .9-.1 1.8-.1 2.8l0 112c0 22.1 17.9 40 40 40l16 0c1.2 0 2.4-.1 3.6-.2c1.5 .1 3 .2 4.5 .2l31.9 0 24 0c22.1 0 40-17.9 40-40l0-24 0-64c0-17.7 14.3-32 32-32l64 0 .7 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z"]
};
const faAngleLeft = {
  prefix: 'fas',
  iconName: 'angle-left',
  icon: [320, 512, [8249], "f104", "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]
};
const faDiagramSuccessor = {
  prefix: 'fas',
  iconName: 'diagram-successor',
  icon: [512, 512, [], "e47a", "M512 416l0-64c0-35.3-28.7-64-64-64L64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64zM64 160l0-64 144 0 16 0 0 64L64 160zm224 0l0-64 80 0c8.8 0 16 7.2 16 16l0 16-38.1 0c-21.4 0-32.1 25.9-17 41L399 239c9.4 9.4 24.6 9.4 33.9 0L503 169c15.1-15.1 4.4-41-17-41L448 128l0-16c0-44.2-35.8-80-80-80L224 32l-16 0L64 32C28.7 32 0 60.7 0 96l0 64c0 35.3 28.7 64 64 64l160 0c35.3 0 64-28.7 64-64z"]
};
const faTruckArrowRight = {
  prefix: 'fas',
  iconName: 'truck-arrow-right',
  icon: [640, 512, [], "e58b", "M0 48C0 21.5 21.5 0 48 0L368 0c26.5 0 48 21.5 48 48l0 48 50.7 0c17 0 33.3 6.7 45.3 18.7L589.3 192c12 12 18.7 28.3 18.7 45.3l0 18.7 0 32 0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c0 53-43 96-96 96s-96-43-96-96l-128 0c0 53-43 96-96 96s-96-43-96-96l-16 0c-26.5 0-48-21.5-48-48L0 48zM416 256l128 0 0-18.7L466.7 160 416 160l0 96zM160 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm368-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM257 95c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39L96 168c-13.3 0-24 10.7-24 24s10.7 24 24 24l166.1 0-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9L257 95z"]
};
const faArrowsSplitUpAndLeft = {
  prefix: 'fas',
  iconName: 'arrows-split-up-and-left',
  icon: [512, 512, [], "e4bc", "M246.6 150.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L352 109.3 352 384c0 35.3 28.7 64 64 64l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-70.7 0-128-57.3-128-128c0-35.3-28.7-64-64-64l-114.7 0 41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L109.3 256 224 256c23.3 0 45.2 6.2 64 17.1l0-163.9-41.4 41.4z"]
};
const faHandFist = {
  prefix: 'fas',
  iconName: 'hand-fist',
  icon: [448, 512, [9994, "fist-raised"], "f6de", "M192 0c17.7 0 32 14.3 32 32l0 112-64 0 0-112c0-17.7 14.3-32 32-32zM64 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 80-64 0 0-80zm192 0c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96zm96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm-96 88l0-.6c9.4 5.4 20.3 8.6 32 8.6c13.2 0 25.4-4 35.6-10.8c8.7 24.9 32.5 42.8 60.4 42.8c11.7 0 22.6-3.1 32-8.6l0 8.6c0 52.3-25.1 98.8-64 128l0 96c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-78.4c-17.3-7.9-33.2-18.8-46.9-32.5L69.5 357.5C45.5 333.5 32 300.9 32 267l0-27c0-35.3 28.7-64 64-64l88 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-56 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l56 0c39.8 0 72-32.2 72-72z"]
};
const faFistRaised = faHandFist;
const faCloudMoon = {
  prefix: 'fas',
  iconName: 'cloud-moon',
  icon: [640, 512, [], "f6c3", "M495.8 0c5.5 0 10.9 .2 16.3 .7c7 .6 12.8 5.7 14.3 12.5s-1.6 13.9-7.7 17.3c-44.4 25.2-74.4 73-74.4 127.8c0 81 65.5 146.6 146.2 146.6c8.6 0 17-.7 25.1-2.1c6.9-1.2 13.8 2.2 17 8.5s1.9 13.8-3.1 18.7c-34.5 33.6-81.7 54.4-133.6 54.4c-9.3 0-18.4-.7-27.4-1.9c-11.2-22.6-29.8-40.9-52.6-51.7c-2.7-58.5-50.3-105.3-109.2-106.7c-1.7-10.4-2.6-21-2.6-31.8C304 86.1 389.8 0 495.8 0zM447.9 431.9c0 44.2-35.8 80-80 80L96 511.9c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]
};
const faBriefcase = {
  prefix: 'fas',
  iconName: 'briefcase',
  icon: [512, 512, [128188], "f0b1", "M184 48l144 0c4.4 0 8 3.6 8 8l0 40L176 96l0-40c0-4.4 3.6-8 8-8zm-56 8l0 40L64 96C28.7 96 0 124.7 0 160l0 96 192 0 128 0 192 0 0-96c0-35.3-28.7-64-64-64l-64 0 0-40c0-30.9-25.1-56-56-56L184 0c-30.9 0-56 25.1-56 56zM512 288l-192 0 0 32c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-32L0 288 0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-128z"]
};
const faPersonFalling = {
  prefix: 'fas',
  iconName: 'person-falling',
  icon: [512, 512, [], "e546", "M288 0c17.7 0 32 14.3 32 32l0 9.8c0 54.6-27.9 104.6-72.5 133.6l.2 .3L304.5 256l87.5 0c15.1 0 29.3 7.1 38.4 19.2l43.2 57.6c10.6 14.1 7.7 34.2-6.4 44.8s-34.2 7.7-44.8-6.4L384 320l-96 0-1.4 0 92.3 142.6c9.6 14.8 5.4 34.6-9.5 44.3s-34.6 5.4-44.3-9.5L164.5 249.2c-2.9 9.2-4.5 19-4.5 29l0 73.8c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-73.8c0-65.1 39.6-123.7 100.1-147.9C232.3 115.8 256 80.8 256 41.8l0-9.8c0-17.7 14.3-32 32-32zM112 32a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"]
};
const faImagePortrait = {
  prefix: 'fas',
  iconName: 'image-portrait',
  icon: [384, 512, ["portrait"], "f3e0", "M384 64c0-35.3-28.7-64-64-64L64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384zM128 192a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM80 356.6c0-37.9 30.7-68.6 68.6-68.6l86.9 0c37.9 0 68.6 30.7 68.6 68.6c0 15.1-12.3 27.4-27.4 27.4l-169.1 0C92.3 384 80 371.7 80 356.6z"]
};
const faPortrait = faImagePortrait;
const faUserTag = {
  prefix: 'fas',
  iconName: 'user-tag',
  icon: [640, 512, [], "f507", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c10 0 18.8-4.9 24.2-12.5l-99.2-99.2c-14.9-14.9-23.3-35.1-23.3-56.1l0-33c-15.9-4.7-32.8-7.2-50.3-7.2l-91.4 0zM384 224c-17.7 0-32 14.3-32 32l0 82.7c0 17 6.7 33.3 18.7 45.3L478.1 491.3c18.7 18.7 49.1 18.7 67.9 0l73.4-73.4c18.7-18.7 18.7-49.1 0-67.9L512 242.7c-12-12-28.3-18.7-45.3-18.7L384 224zm24 80a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"]
};
const faRug = {
  prefix: 'fas',
  iconName: 'rug',
  icon: [640, 512, [], "e569", "M24 64l32 0 24 0 0 24 0 88 0 80 0 80 0 88 0 24-24 0-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-40-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-32-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-32-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-40-8 0C10.7 112 0 101.3 0 88S10.7 64 24 64zm88 0l416 0 0 384-416 0 0-384zM640 88c0 13.3-10.7 24-24 24l-8 0 0 40 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 32 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 32 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 40 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0-24 0 0-24 0-88 0-80 0-80 0-88 0-24 24 0 32 0c13.3 0 24 10.7 24 24z"]
};
const faEarthEurope = {
  prefix: 'fas',
  iconName: 'earth-europe',
  icon: [512, 512, ["globe-europe"], "f7a2", "M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1l0 9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1l1 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24l0 4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6l29.4 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-20.7 0c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3l11.3 0c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16l7.3 0c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4l-20.9 0c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3l0 3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3l21.3 0c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faGlobeEurope = faEarthEurope;
const faCartFlatbedSuitcase = {
  prefix: 'fas',
  iconName: 'cart-flatbed-suitcase',
  icon: [640, 512, ["luggage-cart"], "f59d", "M0 32C0 14.3 14.3 0 32 0L48 0c44.2 0 80 35.8 80 80l0 288c0 8.8 7.2 16 16 16l464 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-66.7 0c1.8 5 2.7 10.4 2.7 16c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-5.6 1-11 2.7-16l-197.5 0c1.8 5 2.7 10.4 2.7 16c0 26.5-21.5 48-48 48s-48-21.5-48-48c0-5.6 1-11 2.7-16L144 448c-44.2 0-80-35.8-80-80L64 80c0-8.8-7.2-16-16-16L32 64C14.3 64 0 49.7 0 32zM432 96l0-40c0-4.4-3.6-8-8-8l-80 0c-4.4 0-8 3.6-8 8l0 40 96 0zM288 96l0-40c0-30.9 25.1-56 56-56l80 0c30.9 0 56 25.1 56 56l0 40 0 224-192 0 0-224zM512 320l0-224 16 0c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48l-16 0zM240 96l16 0 0 224-16 0c-26.5 0-48-21.5-48-48l0-128c0-26.5 21.5-48 48-48z"]
};
const faLuggageCart = faCartFlatbedSuitcase;
const faRectangleXmark = {
  prefix: 'fas',
  iconName: 'rectangle-xmark',
  icon: [512, 512, [62164, "rectangle-times", "times-rectangle", "window-close"], "f410", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faRectangleTimes = faRectangleXmark;
const faTimesRectangle = faRectangleXmark;
const faWindowClose = faRectangleXmark;
const faBahtSign = {
  prefix: 'fas',
  iconName: 'baht-sign',
  icon: [320, 512, [], "e0ac", "M144 0c-17.7 0-32 14.3-32 32l0 32L37.6 64C16.8 64 0 80.8 0 101.6L0 224l0 41.7L0 288 0 406.3c0 23 18.7 41.7 41.7 41.7l70.3 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c61.9 0 112-50.1 112-112c0-40.1-21.1-75.3-52.7-95.1C280.3 222.6 288 200.2 288 176c0-61.9-50.1-112-112-112l0-32c0-17.7-14.3-32-32-32zM112 128l0 96-48 0 0-96 48 0zm64 96l0-96c26.5 0 48 21.5 48 48s-21.5 48-48 48zm-64 64l0 96-48 0 0-96 48 0zm64 96l0-96 32 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-32 0z"]
};
const faBookOpen = {
  prefix: 'fas',
  iconName: 'book-open',
  icon: [576, 512, [128214, 128366], "f518", "M249.6 471.5c10.8 3.8 22.4-4.1 22.4-15.5l0-377.4c0-4.2-1.6-8.4-5-11C247.4 52 202.4 32 144 32C93.5 32 46.3 45.3 18.1 56.1C6.8 60.5 0 71.7 0 83.8L0 454.1c0 11.9 12.8 20.2 24.1 16.5C55.6 460.1 105.5 448 144 448c33.9 0 79 14 105.6 23.5zm76.8 0C353 462 398.1 448 432 448c38.5 0 88.4 12.1 119.9 22.6c11.3 3.8 24.1-4.6 24.1-16.5l0-370.3c0-12.1-6.8-23.3-18.1-27.6C529.7 45.3 482.5 32 432 32c-58.4 0-103.4 20-123 35.6c-3.3 2.6-5 6.8-5 11L304 456c0 11.4 11.7 19.3 22.4 15.5z"]
};
const faBookJournalWhills = {
  prefix: 'fas',
  iconName: 'book-journal-whills',
  icon: [448, 512, ["journal-whills"], "f66a", "M0 96C0 43 43 0 96 0L384 0l32 0c17.7 0 32 14.3 32 32l0 320c0 17.7-14.3 32-32 32l0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0L96 512c-53 0-96-43-96-96L0 96zM64 416c0 17.7 14.3 32 32 32l256 0 0-64L96 384c-17.7 0-32 14.3-32 32zm90.4-234.4l-21.2-21.2c-3 10.1-5.1 20.6-5.1 31.6c0 .2 0 .5 .1 .8s.1 .5 .1 .8L165.2 226c2.5 2.1 3.4 5.8 2.3 8.9c-1.3 3-4.1 5.1-7.5 5.1c-1.9-.1-3.8-.8-5.2-2l-23.6-20.6C142.8 267 186.9 304 240 304s97.3-37 108.9-86.6L325.3 238c-1.4 1.2-3.3 2-5.3 2c-2.2-.1-4.4-1.1-6-2.8c-1.2-1.5-1.9-3.4-2-5.2c.1-2.2 1.1-4.4 2.8-6l37.1-32.5c0-.3 0-.5 .1-.8s.1-.5 .1-.8c0-11-2.1-21.5-5.1-31.6l-21.2 21.2c-3.1 3.1-8.1 3.1-11.3 0s-3.1-8.1 0-11.2l26.4-26.5c-8.2-17-20.5-31.7-35.9-42.6c-2.7-1.9-6.2 1.4-5 4.5c8.5 22.4 3.6 48-13 65.6c-3.2 3.4-3.6 8.9-.9 12.7c9.8 14 12.7 31.9 7.5 48.5c-5.9 19.4-22 34.1-41.9 38.3l-1.4-34.3 12.6 8.6c.6 .4 1.5 .6 2.3 .6c1.5 0 2.7-.8 3.5-2s.6-2.8-.1-4L260 225.4l18-3.6c1.8-.4 3.1-2.1 3.1-4s-1.4-3.5-3.1-3.9l-18-3.7 8.5-14.3c.8-1.2 .9-2.9 .1-4.1s-2-2-3.5-2l-.1 0c-.7 .1-1.5 .3-2.1 .7l-14.1 9.6L244 87.9c-.1-2.2-1.9-3.9-4-3.9s-3.9 1.6-4 3.9l-4.6 110.8-12-8.1c-1.5-1.1-3.6-.9-5 .4s-1.6 3.4-.8 5l8.6 14.3-18 3.7c-1.8 .4-3.1 2-3.1 3.9s1.4 3.6 3.1 4l18 3.8-8.6 14.2c-.2 .6-.5 1.4-.5 2c0 1.1 .5 2.1 1.2 3c.8 .6 1.8 1 2.8 1c.7 0 1.6-.2 2.2-.6l10.4-7.1-1.4 32.8c-19.9-4.1-36-18.9-41.9-38.3c-5.1-16.6-2.2-34.4 7.6-48.5c2.7-3.9 2.3-9.3-.9-12.7c-16.6-17.5-21.6-43.1-13.1-65.5c1.2-3.1-2.3-6.4-5-4.5c-15.3 10.9-27.6 25.6-35.8 42.6l26.4 26.5c3.1 3.1 3.1 8.1 0 11.2s-8.1 3.1-11.2 0z"]
};
const faJournalWhills = faBookJournalWhills;
const faHandcuffs = {
  prefix: 'fas',
  iconName: 'handcuffs',
  icon: [640, 512, [], "e4f8", "M240 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM192 48a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm-32 80c17.7 0 32 14.3 32 32l8 0c13.3 0 24 10.7 24 24l0 16c0 1.7-.2 3.4-.5 5.1C280.3 229.6 320 286.2 320 352c0 88.4-71.6 160-160 160S0 440.4 0 352c0-65.8 39.7-122.4 96.5-146.9c-.4-1.6-.5-3.3-.5-5.1l0-16c0-13.3 10.7-24 24-24l8 0c0-17.7 14.3-32 32-32zm0 320a96 96 0 1 0 0-192 96 96 0 1 0 0 192zm192-96c0-25.9-5.1-50.5-14.4-73.1c16.9-32.9 44.8-59.1 78.9-73.9c-.4-1.6-.5-3.3-.5-5.1l0-16c0-13.3 10.7-24 24-24l8 0c0-17.7 14.3-32 32-32s32 14.3 32 32l8 0c13.3 0 24 10.7 24 24l0 16c0 1.7-.2 3.4-.5 5.1C600.3 229.6 640 286.2 640 352c0 88.4-71.6 160-160 160c-62 0-115.8-35.3-142.4-86.9c9.3-22.5 14.4-47.2 14.4-73.1zm224 0a96 96 0 1 0 -192 0 96 96 0 1 0 192 0zM368 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm80 48a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faTriangleExclamation = {
  prefix: 'fas',
  iconName: 'triangle-exclamation',
  icon: [512, 512, [9888, "exclamation-triangle", "warning"], "f071", "M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
};
const faExclamationTriangle = faTriangleExclamation;
const faWarning = faTriangleExclamation;
const faDatabase = {
  prefix: 'fas',
  iconName: 'database',
  icon: [448, 512, [], "f1c0", "M448 80l0 48c0 44.2-100.3 80-224 80S0 172.2 0 128L0 80C0 35.8 100.3 0 224 0S448 35.8 448 80zM393.2 214.7c20.8-7.4 39.9-16.9 54.8-28.6L448 288c0 44.2-100.3 80-224 80S0 332.2 0 288L0 186.1c14.9 11.8 34 21.2 54.8 28.6C99.7 230.7 159.5 240 224 240s124.3-9.3 169.2-25.3zM0 346.1c14.9 11.8 34 21.2 54.8 28.6C99.7 390.7 159.5 400 224 400s124.3-9.3 169.2-25.3c20.8-7.4 39.9-16.9 54.8-28.6l0 85.9c0 44.2-100.3 80-224 80S0 476.2 0 432l0-85.9z"]
};
const faShare = {
  prefix: 'fas',
  iconName: 'share',
  icon: [512, 512, ["mail-forward"], "f064", "M307 34.8c-11.5 5.1-19 16.6-19 29.2l0 64-112 0C78.8 128 0 206.8 0 304C0 417.3 81.5 467.9 100.2 478.1c2.5 1.4 5.3 1.9 8.1 1.9c10.9 0 19.7-8.9 19.7-19.7c0-7.5-4.3-14.4-9.8-19.5C108.8 431.9 96 414.4 96 384c0-53 43-96 96-96l96 0 0 64c0 12.6 7.4 24.1 19 29.2s25 3 34.4-5.4l160-144c6.7-6.1 10.6-14.7 10.6-23.8s-3.8-17.7-10.6-23.8l-160-144c-9.4-8.5-22.9-10.6-34.4-5.4z"]
};
const faMailForward = faShare;
const faBottleDroplet = {
  prefix: 'fas',
  iconName: 'bottle-droplet',
  icon: [320, 512, [], "e4c4", "M96 0C82.7 0 72 10.7 72 24s10.7 24 24 24c4.4 0 8 3.6 8 8l0 64.9c0 12.2-7.2 23.1-17.2 30.1C53.7 174.1 32 212.5 32 256l0 192c0 35.3 28.7 64 64 64l128 0c35.3 0 64-28.7 64-64l0-192c0-43.5-21.7-81.9-54.8-105c-10-7-17.2-17.9-17.2-30.1L216 56c0-4.4 3.6-8 8-8c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0s0 0 0 0s0 0 0 0L104 0s0 0 0 0s0 0 0 0L96 0zm64 382c-26.5 0-48-20.1-48-45c0-16.8 22.1-48.1 36.3-66.4c6-7.8 17.5-7.8 23.5 0C185.9 288.9 208 320.2 208 337c0 24.9-21.5 45-48 45z"]
};
const faMaskFace = {
  prefix: 'fas',
  iconName: 'mask-face',
  icon: [640, 512, [], "e1d7", "M320 64c-27.2 0-53.8 8-76.4 23.1l-37.1 24.8c-15.8 10.5-34.3 16.1-53.3 16.1l-9.2 0-16 0-72 0c-30.9 0-56 25.1-56 56l0 85c0 55.1 37.5 103.1 90.9 116.4l108 27C233.8 435 275.4 448 320 448s86.2-13 121.1-35.5l108-27C602.5 372.1 640 324.1 640 269l0-85c0-30.9-25.1-56-56-56l-72 0-16 0-9.2 0c-19 0-37.5-5.6-53.3-16.1L396.4 87.1C373.8 72 347.2 64 320 64zM132.3 346.3l-29.8-7.4C70.5 330.9 48 302.1 48 269l0-85c0-4.4 3.6-8 8-8l40 0 0 48c0 45.1 13.4 87.2 36.3 122.3zm405.1-7.4l-29.8 7.4c23-35.2 36.3-77.2 36.3-122.3l0-48 40 0c4.4 0 8 3.6 8 8l0 85c0 33-22.5 61.8-54.5 69.9zM192 208c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16zm16 48l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm16 80c0-8.8 7.2-16 16-16l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16z"]
};
const faHillRockslide = {
  prefix: 'fas',
  iconName: 'hill-rockslide',
  icon: [576, 512, [], "e508", "M252.4 103.8l27 48c2.8 5 8.2 8.2 13.9 8.2l53.3 0c5.8 0 11.1-3.1 13.9-8.2l27-48c2.7-4.9 2.7-10.8 0-15.7l-27-48c-2.8-5-8.2-8.2-13.9-8.2l-53.3 0c-5.8 0-11.1 3.1-13.9 8.2l-27 48c-2.7 4.9-2.7 10.8 0 15.7zM68.3 87C43.1 61.8 0 79.7 0 115.3L0 432c0 44.2 35.8 80 80 80l316.7 0c35.6 0 53.5-43.1 28.3-68.3L68.3 87zM504.2 403.6c4.9 2.7 10.8 2.7 15.7 0l48-27c5-2.8 8.2-8.2 8.2-13.9l0-53.3c0-5.8-3.1-11.1-8.2-13.9l-48-27c-4.9-2.7-10.8-2.7-15.7 0l-48 27c-5 2.8-8.2 8.2-8.2 13.9l0 53.3c0 5.8 3.1 11.1 8.2 13.9l48 27zM192 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM384 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faRightLeft = {
  prefix: 'fas',
  iconName: 'right-left',
  icon: [512, 512, ["exchange-alt"], "f362", "M32 96l320 0 0-64c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l96 96c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-96 96c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-64L32 160c-17.7 0-32-14.3-32-32s14.3-32 32-32zM480 352c17.7 0 32 14.3 32 32s-14.3 32-32 32l-320 0 0 64c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-96-96c-6-6-9.4-14.1-9.4-22.6s3.4-16.6 9.4-22.6l96-96c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 64 320 0z"]
};
const faExchangeAlt = faRightLeft;
const faPaperPlane = {
  prefix: 'fas',
  iconName: 'paper-plane',
  icon: [512, 512, [61913], "f1d8", "M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480l0-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"]
};
const faRoadCircleExclamation = {
  prefix: 'fas',
  iconName: 'road-circle-exclamation',
  icon: [640, 512, [], "e565", "M213.2 32L288 32l0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 74.8 0c27.1 0 51.3 17.1 60.3 42.6l42.7 120.6c-10.9-2.1-22.2-3.2-33.8-3.2c-59.5 0-112.1 29.6-144 74.8l0-42.8c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32c2.3 0 4.6-.3 6.8-.7c-4.5 15.5-6.8 31.8-6.8 48.7c0 5.4 .2 10.7 .7 16l-.7 0c-17.7 0-32 14.3-32 32l0 64L86.6 480C56.5 480 32 455.5 32 425.4c0-6.2 1.1-12.4 3.1-18.2L152.9 74.6C162 49.1 186.1 32 213.2 32zM496 224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 240a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm0-192c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z"]
};
const faDungeon = {
  prefix: 'fas',
  iconName: 'dungeon',
  icon: [512, 512, [], "f6d9", "M336.6 156.5c1.3 1.1 2.7 2.2 3.9 3.3c9.3 8.2 23 10.5 33.4 3.6l67.6-45.1c11.4-7.6 14.2-23.2 5.1-33.4C430 66.6 410.9 50.6 389.7 37.6c-11.9-7.3-26.9-1.4-32.1 11.6l-30.5 76.2c-4.5 11.1 .2 23.6 9.5 31.2zM328 36.8c5.1-12.8-1.6-27.4-15-30.5C294.7 2.2 275.6 0 256 0s-38.7 2.2-57 6.4C185.5 9.4 178.8 24 184 36.8l30.3 75.8c4.5 11.3 16.8 17.2 29 16c4.2-.4 8.4-.6 12.7-.6s8.6 .2 12.7 .6c12.1 1.2 24.4-4.7 29-16L328 36.8zM65.5 85c-9.1 10.2-6.3 25.8 5.1 33.4l67.6 45.1c10.3 6.9 24.1 4.6 33.4-3.6c1.3-1.1 2.6-2.3 4-3.3c9.3-7.5 13.9-20.1 9.5-31.2L154.4 49.2c-5.2-12.9-20.3-18.8-32.1-11.6C101.1 50.6 82 66.6 65.5 85zm314 137.1c.9 3.3 1.7 6.6 2.3 10c2.5 13 13 23.9 26.2 23.9l80 0c13.3 0 24.1-10.8 22.9-24c-2.5-27.2-9.3-53.2-19.7-77.3c-5.5-12.9-21.4-16.6-33.1-8.9l-68.6 45.7c-9.8 6.5-13.2 19.2-10 30.5zM53.9 145.8c-11.6-7.8-27.6-4-33.1 8.9C10.4 178.8 3.6 204.8 1.1 232c-1.2 13.2 9.6 24 22.9 24l80 0c13.3 0 23.8-10.8 26.2-23.9c.6-3.4 1.4-6.7 2.3-10c3.1-11.4-.2-24-10-30.5L53.9 145.8zM104 288l-80 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24zm304 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-80 0zM24 416c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-80 0zm384 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-80 0zM272 192c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 272c0 8.8 7.2 16 16 16s16-7.2 16-16l0-272zm-64 32c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 240c0 8.8 7.2 16 16 16s16-7.2 16-16l0-240zm128 0c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 240c0 8.8 7.2 16 16 16s16-7.2 16-16l0-240z"]
};
const faAlignRight = {
  prefix: 'fas',
  iconName: 'align-right',
  icon: [448, 512, [], "f038", "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
};
const faMoneyBill1Wave = {
  prefix: 'fas',
  iconName: 'money-bill-1-wave',
  icon: [576, 512, ["money-bill-wave-alt"], "f53b", "M0 112.5L0 422.3c0 18 10.1 35 27 41.3c87 32.5 174 10.3 261-11.9c79.8-20.3 159.6-40.7 239.3-18.9c23 6.3 48.7-9.5 48.7-33.4l0-309.9c0-18-10.1-35-27-41.3C462 15.9 375 38.1 288 60.3C208.2 80.6 128.4 100.9 48.7 79.1C25.6 72.8 0 88.6 0 112.5zM128 416l-64 0 0-64c35.3 0 64 28.7 64 64zM64 224l0-64 64 0c0 35.3-28.7 64-64 64zM448 352c0-35.3 28.7-64 64-64l0 64-64 0zm64-192c-35.3 0-64-28.7-64-64l64 0 0 64zM384 256c0 61.9-43 112-96 112s-96-50.1-96-112s43-112 96-112s96 50.1 96 112zM252 208c0 9.7 6.9 17.7 16 19.6l0 48.4-4 0c-11 0-20 9-20 20s9 20 20 20l24 0 24 0c11 0 20-9 20-20s-9-20-20-20l-4 0 0-68c0-11-9-20-20-20l-16 0c-11 0-20 9-20 20z"]
};
const faMoneyBillWaveAlt = faMoneyBill1Wave;
const faLifeRing = {
  prefix: 'fas',
  iconName: 'life-ring',
  icon: [512, 512, [], "f1cd", "M367.2 412.5C335.9 434.9 297.5 448 256 448s-79.9-13.1-111.2-35.5l58-58c15.8 8.6 34 13.5 53.3 13.5s37.4-4.9 53.3-13.5l58 58zm90.7 .8c33.8-43.4 54-98 54-157.3s-20.2-113.9-54-157.3c9-12.5 7.9-30.1-3.4-41.3S425.8 45 413.3 54C369.9 20.2 315.3 0 256 0S142.1 20.2 98.7 54c-12.5-9-30.1-7.9-41.3 3.4S45 86.2 54 98.7C20.2 142.1 0 196.7 0 256s20.2 113.9 54 157.3c-9 12.5-7.9 30.1 3.4 41.3S86.2 467 98.7 458c43.4 33.8 98 54 157.3 54s113.9-20.2 157.3-54c12.5 9 30.1 7.9 41.3-3.4s12.4-28.8 3.4-41.3zm-45.5-46.1l-58-58c8.6-15.8 13.5-34 13.5-53.3s-4.9-37.4-13.5-53.3l58-58C434.9 176.1 448 214.5 448 256s-13.1 79.9-35.5 111.2zM367.2 99.5l-58 58c-15.8-8.6-34-13.5-53.3-13.5s-37.4 4.9-53.3 13.5l-58-58C176.1 77.1 214.5 64 256 64s79.9 13.1 111.2 35.5zM157.5 309.3l-58 58C77.1 335.9 64 297.5 64 256s13.1-79.9 35.5-111.2l58 58c-8.6 15.8-13.5 34-13.5 53.3s4.9 37.4 13.5 53.3zM208 256a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z"]
};
const faHands = {
  prefix: 'fas',
  iconName: 'hands',
  icon: [576, 512, ["sign-language", "signing"], "f2a7", "M544 160l-.1 72.6c-.1 52.2-24 101-64 133.1c.1-1.9 .1-3.8 .1-5.7l0-8c0-71.8-37-138.6-97.9-176.7l-60.2-37.6c-8.6-5.4-17.9-8.4-27.3-9.4L248.7 48.8c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8l78 135.1c3.3 5.7 10.7 7.7 16.4 4.4s7.7-10.7 4.4-16.4l-62-107.4c-6.6-11.5-2.7-26.2 8.8-32.8S362 5 368.6 16.5l68 117.8s0 0 0 0s0 0 0 0l43.3 75L480 160c0-17.7 14.4-32 32-32s32 14.4 32 32zM243.9 88.5L268.5 131c-13.9 4.5-26.4 13.7-34.7 27c-.9 1.4-1.7 2.9-2.5 4.4l-28.9-50c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8zm-46.4 63.7l26.8 46.4c.6 6 2.1 11.8 4.3 17.4l-4.7 0-13.3 0s0 0 0 0L179 216l-23-39.8c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8zM260.9 175c9.4-15 29.1-19.5 44.1-10.2l60.2 37.6C416.7 234.7 448 291.2 448 352l0 8c0 83.9-68.1 152-152 152l-176 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l92 0c6.6 0 12-5.4 12-12s-5.4-12-12-12L88 440c-13.3 0-24-10.7-24-24s10.7-24 24-24l124 0c6.6 0 12-5.4 12-12s-5.4-12-12-12L56 368c-13.3 0-24-10.7-24-24s10.7-24 24-24l156 0c6.6 0 12-5.4 12-12s-5.4-12-12-12L88 296c-13.3 0-24-10.7-24-24s10.7-24 24-24l136 0s0 0 0 0s0 0 0 0l93.2 0L271 219.1c-15-9.4-19.5-29.1-10.2-44.1z"]
};
const faSignLanguage = faHands;
const faSigning = faHands;
const faCalendarDay = {
  prefix: 'fas',
  iconName: 'calendar-day',
  icon: [448, 512, [], "f783", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm80 64c-8.8 0-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16l96 0c8.8 0 16-7.2 16-16l0-96c0-8.8-7.2-16-16-16l-96 0z"]
};
const faWaterLadder = {
  prefix: 'fas',
  iconName: 'water-ladder',
  icon: [576, 512, ["ladder-water", "swimming-pool"], "f5c5", "M128 127.7C128 74.9 170.9 32 223.7 32c48.3 0 89 36 95 83.9l1 8.2c2.2 17.5-10.2 33.5-27.8 35.7s-33.5-10.2-35.7-27.8l-1-8.2c-2-15.9-15.5-27.8-31.5-27.8c-17.5 0-31.7 14.2-31.7 31.7l0 96.3 192 0 0-96.3C384 74.9 426.9 32 479.7 32c48.3 0 89 36 95 83.9l1 8.2c2.2 17.5-10.2 33.5-27.8 35.7s-33.5-10.2-35.7-27.8l-1-8.2c-2-15.9-15.5-27.8-31.5-27.8c-17.5 0-31.7 14.2-31.7 31.7L448 361c-1.6 1-3.3 2-4.8 3.1c-18 12.4-40.1 20.3-59.2 20.3c0 0 0 0 0 0l0-96.5-192 0 0 96.5c-19 0-41.2-7.9-59.1-20.3c-1.6-1.1-3.2-2.2-4.9-3.1l0-233.3zM306.5 389.9C329 405.4 356.5 416 384 416c26.9 0 55.4-10.8 77.4-26.1c0 0 0 0 0 0c11.9-8.5 28.1-7.8 39.2 1.7c14.4 11.9 32.5 21 50.6 25.2c17.2 4 27.9 21.2 23.9 38.4s-21.2 27.9-38.4 23.9c-24.5-5.7-44.9-16.5-58.2-25C449.5 469.7 417 480 384 480c-31.9 0-60.6-9.9-80.4-18.9c-5.8-2.7-11.1-5.3-15.6-7.7c-4.5 2.4-9.7 5.1-15.6 7.7c-19.8 9-48.5 18.9-80.4 18.9c-33 0-65.5-10.3-94.5-25.8c-13.4 8.4-33.7 19.3-58.2 25c-17.2 4-34.4-6.7-38.4-23.9s6.7-34.4 23.9-38.4c18.1-4.2 36.2-13.3 50.6-25.2c11.1-9.4 27.3-10.1 39.2-1.7c0 0 0 0 0 0C136.7 405.2 165.1 416 192 416c27.5 0 55-10.6 77.5-26.1c11.1-7.9 25.9-7.9 37 0z"]
};
const faLadderWater = faWaterLadder;
const faSwimmingPool = faWaterLadder;
const faArrowsUpDown = {
  prefix: 'fas',
  iconName: 'arrows-up-down',
  icon: [320, 512, ["arrows-v"], "f07d", "M182.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L128 109.3l0 293.5L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7l0-293.5 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z"]
};
const faArrowsV = faArrowsUpDown;
const faFaceGrimace = {
  prefix: 'fas',
  iconName: 'face-grimace',
  icon: [512, 512, [128556, "grimace"], "f57f", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm96-112l-8 0 0-40 55.3 0c-3.8 22.7-23.6 40-47.3 40zm47.3-56L344 344l0-40 8 0c23.8 0 43.5 17.3 47.3 40zM328 344l-64 0 0-40 64 0 0 40zm0 56l-64 0 0-40 64 0 0 40zm-80-96l0 40-64 0 0-40 64 0zm0 56l0 40-64 0 0-40 64 0zm-80-16l-55.3 0c3.8-22.7 23.6-40 47.3-40l8 0 0 40zm0 56l-8 0c-23.8 0-43.5-17.3-47.3-40l55.3 0 0 40zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faGrimace = faFaceGrimace;
const faWheelchairMove = {
  prefix: 'fas',
  iconName: 'wheelchair-move',
  icon: [448, 512, ["wheelchair-alt"], "e2ce", "M320 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM204.5 121.3c-5.4-2.5-11.7-1.9-16.4 1.7l-40.9 30.7c-14.1 10.6-34.2 7.7-44.8-6.4s-7.7-34.2 6.4-44.8l40.9-30.7c23.7-17.8 55.3-21 82.1-8.4l90.4 42.5c29.1 13.7 36.8 51.6 15.2 75.5L299.1 224l97.4 0c30.3 0 53 27.7 47.1 57.4L415.4 422.3c-3.5 17.3-20.3 28.6-37.7 25.1s-28.6-20.3-25.1-37.7L377 288l-70.3 0c8.6 19.6 13.3 41.2 13.3 64c0 88.4-71.6 160-160 160S0 440.4 0 352s71.6-160 160-160c11.1 0 22 1.1 32.4 3.3l54.2-54.2-42.1-19.8zM160 448a96 96 0 1 0 0-192 96 96 0 1 0 0 192z"]
};
const faWheelchairAlt = faWheelchairMove;
const faTurnDown = {
  prefix: 'fas',
  iconName: 'turn-down',
  icon: [384, 512, [10549, "level-down-alt"], "f3be", "M350 334.5c3.8 8.8 2 19-4.6 26l-136 144c-4.5 4.8-10.8 7.5-17.4 7.5s-12.9-2.7-17.4-7.5l-136-144c-6.6-7-8.4-17.2-4.6-26s12.5-14.5 22-14.5l88 0 0-192c0-17.7-14.3-32-32-32L32 96C14.3 96 0 81.7 0 64L0 32C0 14.3 14.3 0 32 0l80 0c70.7 0 128 57.3 128 128l0 192 88 0c9.6 0 18.2 5.7 22 14.5z"]
};
const faLevelDownAlt = faTurnDown;
const faPersonWalkingArrowRight = {
  prefix: 'fas',
  iconName: 'person-walking-arrow-right',
  icon: [640, 512, [], "e552", "M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224 384 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l146.7 0-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80z"]
};
const faSquareEnvelope = {
  prefix: 'fas',
  iconName: 'square-envelope',
  icon: [448, 512, ["envelope-square"], "f199", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM218 271.7L64.2 172.4C66 156.4 79.5 144 96 144l256 0c16.5 0 30 12.4 31.8 28.4L230 271.7c-1.8 1.2-3.9 1.8-6 1.8s-4.2-.6-6-1.8zm29.4 26.9L384 210.4 384 336c0 17.7-14.3 32-32 32L96 368c-17.7 0-32-14.3-32-32l0-125.6 136.6 88.2c7 4.5 15.1 6.9 23.4 6.9s16.4-2.4 23.4-6.9z"]
};
const faEnvelopeSquare = faSquareEnvelope;
const faDice = {
  prefix: 'fas',
  iconName: 'dice',
  icon: [640, 512, [127922], "f522", "M274.9 34.3c-28.1-28.1-73.7-28.1-101.8 0L34.3 173.1c-28.1 28.1-28.1 73.7 0 101.8L173.1 413.7c28.1 28.1 73.7 28.1 101.8 0L413.7 274.9c28.1-28.1 28.1-73.7 0-101.8L274.9 34.3zM200 224a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM96 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM224 376a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM352 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM224 120a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm96 328c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-114.3 0c11.6 36 3.1 77-25.4 105.5L320 413.8l0 34.2zM480 328a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faBowlingBall = {
  prefix: 'fas',
  iconName: 'bowling-ball',
  icon: [512, 512, [], "f436", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM240 80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM208 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-64-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBrain = {
  prefix: 'fas',
  iconName: 'brain',
  icon: [512, 512, [129504], "f5dc", "M184 0c30.9 0 56 25.1 56 56l0 400c0 30.9-25.1 56-56 56c-28.9 0-52.7-21.9-55.7-50.1c-5.2 1.4-10.7 2.1-16.3 2.1c-35.3 0-64-28.7-64-64c0-7.4 1.3-14.6 3.6-21.2C21.4 367.4 0 338.2 0 304c0-31.9 18.7-59.5 45.8-72.3C37.1 220.8 32 207 32 192c0-30.7 21.6-56.3 50.4-62.6C80.8 123.9 80 118 80 112c0-29.9 20.6-55.1 48.3-62.1C131.3 21.9 155.1 0 184 0zM328 0c28.9 0 52.6 21.9 55.7 49.9c27.8 7 48.3 32.1 48.3 62.1c0 6-.8 11.9-2.4 17.4c28.8 6.2 50.4 31.9 50.4 62.6c0 15-5.1 28.8-13.8 39.7C493.3 244.5 512 272.1 512 304c0 34.2-21.4 63.4-51.6 74.8c2.3 6.6 3.6 13.8 3.6 21.2c0 35.3-28.7 64-64 64c-5.6 0-11.1-.7-16.3-2.1c-3 28.2-26.8 50.1-55.7 50.1c-30.9 0-56-25.1-56-56l0-400c0-30.9 25.1-56 56-56z"]
};
const faBandage = {
  prefix: 'fas',
  iconName: 'bandage',
  icon: [640, 512, [129657, "band-aid"], "f462", "M480 416l96 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-96 0 0 320zM448 96L192 96l0 320 256 0 0-320zM64 96C28.7 96 0 124.7 0 160L0 352c0 35.3 28.7 64 64 64l96 0 0-320L64 96zM248 208a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM248 304a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faBandAid = faBandage;
const faCalendarMinus = {
  prefix: 'fas',
  iconName: 'calendar-minus',
  icon: [448, 512, [], "f272", "M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM312 376c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0z"]
};
const faCircleXmark = {
  prefix: 'fas',
  iconName: 'circle-xmark',
  icon: [512, 512, [61532, "times-circle", "xmark-circle"], "f057", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]
};
const faTimesCircle = faCircleXmark;
const faXmarkCircle = faCircleXmark;
const faGifts = {
  prefix: 'fas',
  iconName: 'gifts',
  icon: [640, 512, [], "f79c", "M200.6 32C205 19.5 198.5 5.8 186 1.4S159.8 3.5 155.4 16L144.7 46.2l-9.9-29.8C130.6 3.8 117-3 104.4 1.2S85 19 89.2 31.6l8.3 25-27.4-20c-10.7-7.8-25.7-5.4-33.5 5.3s-5.4 25.7 5.3 33.5L70.2 96 48 96C21.5 96 0 117.5 0 144L0 464c0 26.5 21.5 48 48 48l152.6 0c-5.4-9.4-8.6-20.3-8.6-32l0-224c0-29.9 20.5-55 48.2-62c1.8-31 17.1-58.2 40.1-76.1C271.7 104.7 256.9 96 240 96l-22.2 0 28.3-20.6c10.7-7.8 13.1-22.8 5.3-33.5s-22.8-13.1-33.5-5.3L192.5 55.1 200.6 32zM363.5 185.5L393.1 224 344 224c-13.3 0-24-10.7-24-24c0-13.1 10.8-24 24.2-24c7.6 0 14.7 3.5 19.3 9.5zM272 200c0 8.4 1.4 16.5 4.1 24l-4.1 0c-26.5 0-48 21.5-48 48l0 80 192 0 0-96 32 0 0 96 192 0 0-80c0-26.5-21.5-48-48-48l-4.1 0c2.7-7.5 4.1-15.6 4.1-24c0-39.9-32.5-72-72.2-72c-22.4 0-43.6 10.4-57.3 28.2L432 195.8l-30.5-39.6c-13.7-17.8-35-28.2-57.3-28.2c-39.7 0-72.2 32.1-72.2 72zM224 464c0 26.5 21.5 48 48 48l144 0 0-128-192 0 0 80zm224 48l144 0c26.5 0 48-21.5 48-48l0-80-192 0 0 128zm96-312c0 13.3-10.7 24-24 24l-49.1 0 29.6-38.5c4.6-5.9 11.7-9.5 19.3-9.5c13.4 0 24.2 10.9 24.2 24z"]
};
const faHotel = {
  prefix: 'fas',
  iconName: 'hotel',
  icon: [512, 512, [127976], "f594", "M0 32C0 14.3 14.3 0 32 0L480 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 384c17.7 0 32 14.3 32 32s-14.3 32-32 32l-176 0 0-48c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 48L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32L32 64C14.3 64 0 49.7 0 32zm96 80l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM240 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM112 192c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM328 384c13.3 0 24.3-10.9 21-23.8c-10.6-41.5-48.2-72.2-93-72.2s-82.5 30.7-93 72.2c-3.3 12.8 7.8 23.8 21 23.8l144 0z"]
};
const faEarthAsia = {
  prefix: 'fas',
  iconName: 'earth-asia',
  icon: [512, 512, [127759, "globe-asia"], "f57e", "M51.7 295.1l31.7 6.3c7.9 1.6 16-.9 21.7-6.6l15.4-15.4c11.6-11.6 31.1-8.4 38.4 6.2l9.3 18.5c4.8 9.6 14.6 15.7 25.4 15.7c15.2 0 26.1-14.6 21.7-29.2l-6-19.9c-4.6-15.4 6.9-30.9 23-30.9l2.3 0c13.4 0 25.9-6.7 33.3-17.8l10.7-16.1c5.6-8.5 5.3-19.6-.8-27.7l-16.1-21.5c-10.3-13.7-3.3-33.5 13.4-37.7l17-4.3c7.5-1.9 13.6-7.2 16.5-14.4l16.4-40.9C303.4 52.1 280.2 48 256 48C141.1 48 48 141.1 48 256c0 13.4 1.3 26.5 3.7 39.1zm407.7 4.6c-3-.3-6-.1-9 .8l-15.8 4.4c-6.7 1.9-13.8-.9-17.5-6.7l-2-3.1c-6-9.4-16.4-15.1-27.6-15.1s-21.6 5.7-27.6 15.1l-6.1 9.5c-1.4 2.2-3.4 4.1-5.7 5.3L312 330.1c-18.1 10.1-25.5 32.4-17 51.3l5.5 12.4c8.6 19.2 30.7 28.5 50.5 21.1l2.6-1c10-3.7 21.3-2.2 29.9 4.1l1.5 1.1c37.2-29.5 64.1-71.4 74.4-119.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm144.5 92.1c-2.1 8.6 3.1 17.3 11.6 19.4l32 8c8.6 2.1 17.3-3.1 19.4-11.6s-3.1-17.3-11.6-19.4l-32-8c-8.6-2.1-17.3 3.1-19.4 11.6zm92-20c-2.1 8.6 3.1 17.3 11.6 19.4s17.3-3.1 19.4-11.6l8-32c2.1-8.6-3.1-17.3-11.6-19.4s-17.3 3.1-19.4 11.6l-8 32zM343.2 113.7c-7.9-4-17.5-.7-21.5 7.2l-16 32c-4 7.9-.7 17.5 7.2 21.5s17.5 .7 21.5-7.2l16-32c4-7.9 .7-17.5-7.2-21.5z"]
};
const faGlobeAsia = faEarthAsia;
const faIdCardClip = {
  prefix: 'fas',
  iconName: 'id-card-clip',
  icon: [576, 512, ["id-card-alt"], "f47f", "M256 0l64 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zM64 64l128 0 0 48c0 26.5 21.5 48 48 48l96 0c26.5 0 48-21.5 48-48l0-48 128 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64zM176 437.3c0 5.9 4.8 10.7 10.7 10.7l202.7 0c5.9 0 10.7-4.8 10.7-10.7c0-29.5-23.9-53.3-53.3-53.3l-117.3 0c-29.5 0-53.3 23.9-53.3 53.3zM288 352a64 64 0 1 0 0-128 64 64 0 1 0 0 128z"]
};
const faIdCardAlt = faIdCardClip;
const faMagnifyingGlassPlus = {
  prefix: 'fas',
  iconName: 'magnifying-glass-plus',
  icon: [512, 512, ["search-plus"], "f00e", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM184 296c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64 64 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-64 0 0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 64-64 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l64 0 0 64z"]
};
const faSearchPlus = faMagnifyingGlassPlus;
const faThumbsUp = {
  prefix: 'fas',
  iconName: 'thumbs-up',
  icon: [512, 512, [128077, 61575], "f164", "M313.4 32.9c26 5.2 42.9 30.5 37.7 56.5l-2.3 11.4c-5.3 26.7-15.1 52.1-28.8 75.2l144 0c26.5 0 48 21.5 48 48c0 18.5-10.5 34.6-25.9 42.6C497 275.4 504 288.9 504 304c0 23.4-16.8 42.9-38.9 47.1c4.4 7.3 6.9 15.8 6.9 24.9c0 21.3-13.9 39.4-33.1 45.6c.7 3.3 1.1 6.8 1.1 10.4c0 26.5-21.5 48-48 48l-97.5 0c-19 0-37.5-5.6-53.3-16.1l-38.5-25.7C176 420.4 160 390.4 160 358.3l0-38.3 0-48 0-24.9c0-29.2 13.3-56.7 36-75l7.4-5.9c26.5-21.2 44.6-51 51.2-84.2l2.3-11.4c5.2-26 30.5-42.9 56.5-37.7zM32 192l64 0c17.7 0 32 14.3 32 32l0 224c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32L0 224c0-17.7 14.3-32 32-32z"]
};
const faUserClock = {
  prefix: 'fas',
  iconName: 'user-clock',
  icon: [640, 512, [], "f4fd", "M224 0a128 128 0 1 1 0 256A128 128 0 1 1 224 0zM178.3 304l91.4 0c20.6 0 40.4 3.5 58.8 9.9C323 331 320 349.1 320 368c0 59.5 29.5 112.1 74.8 144L29.7 512C13.3 512 0 498.7 0 482.3C0 383.8 79.8 304 178.3 304zM352 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-80c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0-48c0-8.8-7.2-16-16-16z"]
};
const faHandDots = {
  prefix: 'fas',
  iconName: 'hand-dots',
  icon: [512, 512, ["allergies"], "f461", "M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 272c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L124.8 448c43.1 41.1 100.4 64 160 64l19.2 0c97.2 0 176-78.8 176-176l0-208c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208zM240 336a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm80 16a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm48-16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm-16 80a16 16 0 1 1 0 32 16 16 0 1 1 0-32zM240 432a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zm-48-48a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faAllergies = faHandDots;
const faFileInvoice = {
  prefix: 'fas',
  iconName: 'file-invoice',
  icon: [384, 512, [], "f570", "M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-288-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM80 64l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 96c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm16 96l192 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L96 352c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm0 32l0 64 192 0 0-64L96 256zM240 416l64 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]
};
const faWindowMinimize = {
  prefix: 'fas',
  iconName: 'window-minimize',
  icon: [512, 512, [128469], "f2d1", "M32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416z"]
};
const faMugSaucer = {
  prefix: 'fas',
  iconName: 'mug-saucer',
  icon: [640, 512, ["coffee"], "f0f4", "M96 64c0-17.7 14.3-32 32-32l320 0 64 0c70.7 0 128 57.3 128 128s-57.3 128-128 128l-32 0c0 53-43 96-96 96l-192 0c-53 0-96-43-96-96L96 64zM480 224l32 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0 0 128zM32 416l512 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]
};
const faCoffee = faMugSaucer;
const faBrush = {
  prefix: 'fas',
  iconName: 'brush',
  icon: [384, 512, [], "f55d", "M162.4 6c-1.5-3.6-5-6-8.9-6l-19 0c-3.9 0-7.5 2.4-8.9 6L104.9 57.7c-3.2 8-14.6 8-17.8 0L66.4 6c-1.5-3.6-5-6-8.9-6L48 0C21.5 0 0 21.5 0 48L0 224l0 22.4L0 256l9.6 0 364.8 0 9.6 0 0-9.6 0-22.4 0-176c0-26.5-21.5-48-48-48L230.5 0c-3.9 0-7.5 2.4-8.9 6L200.9 57.7c-3.2 8-14.6 8-17.8 0L162.4 6zM0 288l0 32c0 35.3 28.7 64 64 64l64 0 0 64c0 35.3 28.7 64 64 64s64-28.7 64-64l0-64 64 0c35.3 0 64-28.7 64-64l0-32L0 288zM192 432a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]
};
const faFileHalfDashed = {
  prefix: 'fas',
  iconName: 'file-half-dashed',
  icon: [384, 512, [], "e698", "M64 0C28.7 0 0 28.7 0 64L0 320l384 0 0-160-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM0 416l64 0 0-64L0 352l0 64zm288 32l-80 0 0 64 80 0 0-64zm-112 0l-80 0 0 64 80 0 0-64zM64 448L0 448c0 35.3 28.7 64 64 64l0-64zm256 0l0 64c35.3 0 64-28.7 64-64l-64 0zm64-32l0-64-64 0 0 64 64 0z"]
};
const faMask = {
  prefix: 'fas',
  iconName: 'mask',
  icon: [576, 512, [], "f6fa", "M288 64C64 64 0 160 0 272S80 448 176 448l8.4 0c24.2 0 46.4-13.7 57.2-35.4l23.2-46.3c4.4-8.8 13.3-14.3 23.2-14.3s18.8 5.5 23.2 14.3l23.2 46.3c10.8 21.7 33 35.4 57.2 35.4l8.4 0c96 0 176-64 176-176s-64-208-288-208zM96 256a64 64 0 1 1 128 0A64 64 0 1 1 96 256zm320-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]
};
const faMagnifyingGlassMinus = {
  prefix: 'fas',
  iconName: 'magnifying-glass-minus',
  icon: [512, 512, ["search-minus"], "f010", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]
};
const faSearchMinus = faMagnifyingGlassMinus;
const faRulerVertical = {
  prefix: 'fas',
  iconName: 'ruler-vertical',
  icon: [256, 512, [], "f548", "M0 48C0 21.5 21.5 0 48 0L208 0c26.5 0 48 21.5 48 48l0 48-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 64-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 64-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 64-80 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 48z"]
};
const faUserLarge = {
  prefix: 'fas',
  iconName: 'user-large',
  icon: [512, 512, ["user-alt"], "f406", "M256 288A144 144 0 1 0 256 0a144 144 0 1 0 0 288zm-94.7 32C72.2 320 0 392.2 0 481.3c0 17 13.8 30.7 30.7 30.7l450.6 0c17 0 30.7-13.8 30.7-30.7C512 392.2 439.8 320 350.7 320l-189.4 0z"]
};
const faUserAlt = faUserLarge;
const faTrainTram = {
  prefix: 'fas',
  iconName: 'train-tram',
  icon: [448, 512, [128650], "e5b4", "M86.8 48c-12.2 0-23.6 5.5-31.2 15L42.7 79C34.5 89.3 19.4 91 9 82.7S-3 59.4 5.3 49L18 33C34.7 12.2 60 0 86.8 0L361.2 0c26.7 0 52 12.2 68.7 33l12.8 16c8.3 10.4 6.6 25.5-3.8 33.7s-25.5 6.6-33.7-3.7L392.5 63c-7.6-9.5-19.1-15-31.2-15L248 48l0 48 40 0c53 0 96 43 96 96l0 160c0 30.6-14.3 57.8-36.6 75.4l65.5 65.5c7.1 7.1 2.1 19.1-7.9 19.1l-39.7 0c-8.5 0-16.6-3.4-22.6-9.4L288 448l-128 0-54.6 54.6c-6 6-14.1 9.4-22.6 9.4L43 512c-10 0-15-12.1-7.9-19.1l65.5-65.5C78.3 409.8 64 382.6 64 352l0-160c0-53 43-96 96-96l40 0 0-48L86.8 48zM160 160c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-128 0zm32 192a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]
};
const faUserNurse = {
  prefix: 'fas',
  iconName: 'user-nurse',
  icon: [448, 512, [], "f82f", "M96 128l0-57.8c0-13.3 8.3-25.3 20.8-30l96-36c7.2-2.7 15.2-2.7 22.5 0l96 36c12.5 4.7 20.8 16.6 20.8 30l0 57.8-.3 0c.2 2.6 .3 5.3 .3 8l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40c0-2.7 .1-5.4 .3-8l-.3 0zm48 48c0 44.2 35.8 80 80 80s80-35.8 80-80l0-16-160 0 0 16zM111.9 327.7c10.5-3.4 21.8 .4 29.4 8.5l71 75.5c6.3 6.7 17 6.7 23.3 0l71-75.5c7.6-8.1 18.9-11.9 29.4-8.5C401 348.6 448 409.4 448 481.3c0 17-13.8 30.7-30.7 30.7L30.7 512C13.8 512 0 498.2 0 481.3c0-71.9 47-132.7 111.9-153.6zM208 48l0 16-16 0c-4.4 0-8 3.6-8 8l0 16c0 4.4 3.6 8 8 8l16 0 0 16c0 4.4 3.6 8 8 8l16 0c4.4 0 8-3.6 8-8l0-16 16 0c4.4 0 8-3.6 8-8l0-16c0-4.4-3.6-8-8-8l-16 0 0-16c0-4.4-3.6-8-8-8l-16 0c-4.4 0-8 3.6-8 8z"]
};
const faSyringe = {
  prefix: 'fas',
  iconName: 'syringe',
  icon: [512, 512, [128137], "f48e", "M441 7l32 32 32 32c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-15-15L417.9 128l55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-72-72L295 73c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l55 55L422.1 56 407 41c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0zM210.3 155.7l61.1-61.1c.3 .3 .6 .7 1 1l16 16 56 56 56 56 16 16c.3 .3 .6 .6 1 1l-191 191c-10.5 10.5-24.7 16.4-39.6 16.4l-88.8 0L41 505c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l57-57 0-88.8c0-14.9 5.9-29.1 16.4-39.6l43.3-43.3 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57 41.4-41.4 57 57c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-57-57z"]
};
const faCloudSun = {
  prefix: 'fas',
  iconName: 'cloud-sun',
  icon: [640, 512, [9925], "f6c4", "M294.2 1.2c5.1 2.1 8.7 6.7 9.6 12.1l14.1 84.7 84.7 14.1c5.4 .9 10 4.5 12.1 9.6s1.5 10.9-1.6 15.4l-38.5 55c-2.2-.1-4.4-.2-6.7-.2c-23.3 0-45.1 6.2-64 17.1l0-1.1c0-53-43-96-96-96s-96 43-96 96s43 96 96 96c8.1 0 15.9-1 23.4-2.9c-36.6 18.1-63.3 53.1-69.8 94.9l-24.4 17c-4.5 3.2-10.3 3.8-15.4 1.6s-8.7-6.7-9.6-12.1L98.1 317.9 13.4 303.8c-5.4-.9-10-4.5-12.1-9.6s-1.5-10.9 1.6-15.4L52.5 208 2.9 137.2c-3.2-4.5-3.8-10.3-1.6-15.4s6.7-8.7 12.1-9.6L98.1 98.1l14.1-84.7c.9-5.4 4.5-10 9.6-12.1s10.9-1.5 15.4 1.6L208 52.5 278.8 2.9c4.5-3.2 10.3-3.8 15.4-1.6zM144 208a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM639.9 431.9c0 44.2-35.8 80-80 80l-271.9 0c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]
};
const faStopwatch20 = {
  prefix: 'fas',
  iconName: 'stopwatch-20',
  icon: [448, 512, [], "e06f", "M176 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 34.4C92.3 113.8 16 200 16 304c0 114.9 93.1 208 208 208s208-93.1 208-208c0-41.8-12.3-80.7-33.5-113.2l24.1-24.1c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L355.7 143c-28.1-23-62.2-38.8-99.7-44.6L256 64l16 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L176 0zM288 204c28.7 0 52 23.3 52 52l0 96c0 28.7-23.3 52-52 52s-52-23.3-52-52l0-96c0-28.7 23.3-52 52-52zm-12 52l0 96c0 6.6 5.4 12 12 12s12-5.4 12-12l0-96c0-6.6-5.4-12-12-12s-12 5.4-12 12zM159.5 244c-5.4 0-10.2 3.5-11.9 8.6l-.6 1.7c-3.5 10.5-14.8 16.1-25.3 12.6s-16.1-14.8-12.6-25.3l.6-1.7c7.2-21.5 27.2-35.9 49.8-35.9c29 0 52.5 23.5 52.5 52.5l0 2.2c0 13.4-4.9 26.4-13.8 36.4l-39 43.9c-6.2 7-10 15.7-10.9 24.9l43.8 0c11 0 20 9 20 20s-9 20-20 20l-64 0c-11 0-20-9-20-20l0-15.7c0-20.6 7.5-40.4 21.2-55.8l39-43.9c2.4-2.7 3.7-6.2 3.7-9.8l0-2.2c0-6.9-5.6-12.5-12.5-12.5z"]
};
const faSquareFull = {
  prefix: 'fas',
  iconName: 'square-full',
  icon: [512, 512, [128997, 128998, 128999, 129000, 129001, 129002, 129003, 11035, 11036], "f45c", "M0 0H512V512H0V0z"]
};
const faMagnet = {
  prefix: 'fas',
  iconName: 'magnet',
  icon: [448, 512, [129522], "f076", "M0 160l0 96C0 379.7 100.3 480 224 480s224-100.3 224-224l0-96-128 0 0 96c0 53-43 96-96 96s-96-43-96-96l0-96L0 160zm0-32l128 0 0-64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64l0 64zm320 0l128 0 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64z"]
};
const faJar = {
  prefix: 'fas',
  iconName: 'jar',
  icon: [320, 512, [], "e516", "M32 32C32 14.3 46.3 0 64 0L256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 64C46.3 64 32 49.7 32 32zM0 160c0-35.3 28.7-64 64-64l192 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 160zm96 64c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-96c0-17.7-14.3-32-32-32L96 224z"]
};
const faNoteSticky = {
  prefix: 'fas',
  iconName: 'note-sticky',
  icon: [448, 512, [62026, "sticky-note"], "f249", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l224 0 0-112c0-26.5 21.5-48 48-48l112 0 0-224c0-35.3-28.7-64-64-64L64 32zM448 352l-45.3 0L336 352c-8.8 0-16 7.2-16 16l0 66.7 0 45.3 32-32 64-64 32-32z"]
};
const faStickyNote = faNoteSticky;
const faBugSlash = {
  prefix: 'fas',
  iconName: 'bug-slash',
  icon: [640, 512, [], "e490", "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L477.4 348.9c1.7-9.4 2.6-19 2.6-28.9l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64.3 0c-1.1-14.1-5-27.5-11.1-39.5c.7-.6 1.4-1.2 2.1-1.9l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-.7 .7-1.3 1.4-1.9 2.1C409.2 164.1 393.1 160 376 160l-112 0c-8.3 0-16.3 1-24 2.8L38.8 5.1zM320 0c-53 0-96 43-96 96l0 3.6c0 15.7 12.7 28.4 28.4 28.4l135.1 0c15.7 0 28.4-12.7 28.4-28.4l0-3.6c0-53-43-96-96-96zM160.3 256L96 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c0 24.6 5.5 47.8 15.4 68.6c-2.2 1.3-4.2 2.9-6 4.8l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l63.1-63.1c24.5 21.8 55.8 36.2 90.3 39.6l0-143.7L166.7 227.3c-3.4 9-5.6 18.7-6.4 28.7zM336 479.2c36.6-3.6 69.7-19.6 94.8-43.8L336 360.7l0 118.5z"]
};
const faArrowUpFromWaterPump = {
  prefix: 'fas',
  iconName: 'arrow-up-from-water-pump',
  icon: [576, 512, [], "e4b6", "M112 0C85.5 0 64 21.5 64 48l0 208-16 0c-26.5 0-48 21.5-48 48l0 96c0 8 2 15.6 5.4 22.2c3.8-1.7 7.8-3.1 12-4.1c13.1-3.1 26.7-9.8 37.3-18.6c22.2-18.7 54.3-20.1 78.1-3.4c18 12.4 40.1 20.3 59.2 20.3c21.1 0 42-8.5 59.2-20.3c22.1-15.5 51.6-15.5 73.7 0c18.4 12.7 39.6 20.3 59.2 20.3c19 0 41.2-7.9 59.2-20.3c23.8-16.7 55.8-15.3 78.1 3.4c10.6 8.8 24.2 15.6 37.3 18.6c4.2 1 8.2 2.4 12 4.1C574 415.6 576 408 576 400l0-96c0-26.5-21.5-48-48-48l-48 0 0-146.7 25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-80-80c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 109.3 416 256l-128 0 0-208c0-26.5-21.5-48-48-48L112 0zM306.5 421.9c-11.1-7.9-25.9-7.9-37 0C247 437.4 219.5 448 192 448c-26.9 0-55.3-10.8-77.4-26.1c0 0 0 0 0 0c-11.9-8.5-28.1-7.8-39.2 1.7c-14.4 11.9-32.5 21-50.6 25.2c-17.2 4-27.9 21.2-23.9 38.4s21.2 27.9 38.4 23.9c24.5-5.7 44.9-16.5 58.2-25C126.5 501.7 159 512 192 512c31.9 0 60.6-9.9 80.4-18.9c5.8-2.7 11.1-5.3 15.6-7.7c4.5 2.4 9.7 5.1 15.6 7.7c19.8 9 48.5 18.9 80.4 18.9c33 0 65.5-10.3 94.5-25.8c13.4 8.4 33.7 19.3 58.2 25c17.2 4 34.4-6.7 38.4-23.9s-6.7-34.4-23.9-38.4c-18.1-4.2-36.2-13.3-50.6-25.2c-11.1-9.4-27.3-10.1-39.2-1.7c0 0 0 0 0 0C439.4 437.2 410.9 448 384 448c-27.5 0-55-10.6-77.5-26.1z"]
};
const faBone = {
  prefix: 'fas',
  iconName: 'bone',
  icon: [576, 512, [129460], "f5d7", "M153.7 144.8c6.9 16.3 20.6 31.2 38.3 31.2l192 0c17.7 0 31.4-14.9 38.3-31.2C434.4 116.1 462.9 96 496 96c44.2 0 80 35.8 80 80c0 30.4-17 56.9-42 70.4c-3.6 1.9-6 5.5-6 9.6s2.4 7.7 6 9.6c25 13.5 42 40 42 70.4c0 44.2-35.8 80-80 80c-33.1 0-61.6-20.1-73.7-48.8C415.4 350.9 401.7 336 384 336l-192 0c-17.7 0-31.4 14.9-38.3 31.2C141.6 395.9 113.1 416 80 416c-44.2 0-80-35.8-80-80c0-30.4 17-56.9 42-70.4c3.6-1.9 6-5.5 6-9.6s-2.4-7.7-6-9.6C17 232.9 0 206.4 0 176c0-44.2 35.8-80 80-80c33.1 0 61.6 20.1 73.7 48.8z"]
};
const faTableCellsRowUnlock = {
  prefix: 'fas',
  iconName: 'table-cells-row-unlock',
  icon: [640, 512, [], "e691", "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 65.1c-37.8 5.4-69.4 29.6-85.2 62.9L360 224l0 64 56 0 0 8.6c-19.1 11.1-32 31.7-32 55.4l-24 0 0 64 24 0 0 64L64 480c-35.3 0-64-28.7-64-64L0 96zM64 224l0 64 88 0 0-64-88 0zm232 0l-88 0 0 64 88 0 0-64zM152 352l-88 0 0 64 88 0 0-64zm56 0l0 64 88 0 0-64-88 0zm288-80l0 48 32 0 32 0 48 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32l0-48c0-44.2 35.8-80 80-80s80 35.8 80 80l-48 0c0-17.7-14.3-32-32-32s-32 14.3-32 32z"]
};
const faUserInjured = {
  prefix: 'fas',
  iconName: 'user-injured',
  icon: [448, 512, [], "f728", "M240 80l102.7 0c-7.9-19.5-20.4-36.5-36.2-49.9L240 80zm37.7-68.2C261.3 4.2 243.2 0 224 0c-53.7 0-99.7 33.1-118.7 80l81.4 0 91-68.2zM224 256c70.7 0 128-57.3 128-128c0-5.4-.3-10.8-1-16L97 112c-.7 5.2-1 10.6-1 16c0 70.7 57.3 128 128 128zM124 312.4c-9.7 3.1-19.1 7-28 11.7L96 512l147.7 0L181.5 408.2 124 312.4zm33-7.2L204.3 384l67.7 0c44.2 0 80 35.8 80 80c0 18-6 34.6-16 48l82.3 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0c-7.2 0-14.3 .4-21.3 1.3zM0 482.3C0 498.7 13.3 512 29.7 512L64 512l0-166.6C24.9 378.1 0 427.3 0 482.3zM320 464c0-26.5-21.5-48-48-48l-48.5 0 57.1 95.2C303 507.2 320 487.6 320 464z"]
};
const faFaceSadTear = {
  prefix: 'fas',
  iconName: 'face-sad-tear',
  icon: [512, 512, [128546, "sad-tear"], "f5b4", "M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm240 80c0-8.8 7.2-16 16-16c45 0 85.6 20.5 115.7 53.1c6 6.5 5.6 16.6-.9 22.6s-16.6 5.6-22.6-.9c-25-27.1-57.4-42.9-92.3-42.9c-8.8 0-16-7.2-16-16zm-80 80c-26.5 0-48-21-48-47c0-20 28.6-60.4 41.6-77.7c3.2-4.4 9.6-4.4 12.8 0C179.6 308.6 208 349 208 369c0 26-21.5 47-48 47zM367.6 208a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm-192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faSadTear = faFaceSadTear;
const faPlane = {
  prefix: 'fas',
  iconName: 'plane',
  icon: [576, 512, [], "f072", "M482.3 192c34.2 0 93.7 29 93.7 64c0 36-59.5 64-93.7 64l-116.6 0L265.2 495.9c-5.7 10-16.3 16.1-27.8 16.1l-56.2 0c-10.6 0-18.3-10.2-15.4-20.4l49-171.6L112 320 68.8 377.6c-3 4-7.8 6.4-12.8 6.4l-42 0c-7.8 0-14-6.3-14-14c0-1.3 .2-2.6 .5-3.9L32 256 .5 145.9c-.4-1.3-.5-2.6-.5-3.9c0-7.8 6.3-14 14-14l42 0c5 0 9.8 2.4 12.8 6.4L112 192l102.9 0-49-171.6C162.9 10.2 170.6 0 181.2 0l56.2 0c11.5 0 22.1 6.2 27.8 16.1L365.7 192l116.6 0z"]
};
const faTentArrowsDown = {
  prefix: 'fas',
  iconName: 'tent-arrows-down',
  icon: [576, 512, [], "e581", "M209.8 111.9c-8.9-9.9-24-10.7-33.9-1.8l-39.9 36L136 24c0-13.3-10.7-24-24-24S88 10.7 88 24l0 122.1-39.9-36c-9.9-8.9-25-8.1-33.9 1.8s-8.1 25 1.8 33.9l80 72c9.1 8.2 23 8.2 32.1 0l80-72c9.9-8.9 10.7-24 1.8-33.9zm352 0c-8.9-9.9-24-10.7-33.9-1.8l-39.9 36L488 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 122.1-39.9-36c-9.9-8.9-25-8.1-33.9 1.8s-8.1 25 1.8 33.9l80 72c9.1 8.2 23 8.2 32.1 0l80-72c9.9-8.9 10.7-24 1.8-33.9zM307.4 166.5c-11.5-8.7-27.3-8.7-38.8 0l-168 128c-6.6 5-11 12.5-12.3 20.7l-24 160c-1.4 9.2 1.3 18.6 7.4 25.6S86.7 512 96 512l144 0 16 0c17.7 0 32-14.3 32-32l0-118.1c0-5.5 4.4-9.9 9.9-9.9c3.7 0 7.2 2.1 8.8 5.5l68.4 136.8c5.4 10.8 16.5 17.7 28.6 17.7l60.2 0 16 0c9.3 0 18.2-4.1 24.2-11.1s8.8-16.4 7.4-25.6l-24-160c-1.2-8.2-5.6-15.7-12.3-20.7l-168-128z"]
};
const faExclamation = {
  prefix: 'fas',
  iconName: 'exclamation',
  icon: [128, 512, [10069, 10071, 61738], "21", "M96 64c0-17.7-14.3-32-32-32S32 46.3 32 64l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32L96 64zM64 480a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]
};
const faArrowsSpin = {
  prefix: 'fas',
  iconName: 'arrows-spin',
  icon: [512, 512, [], "e4bb", "M256 96c38.4 0 73.7 13.5 101.3 36.1l-32.6 32.6c-4.6 4.6-5.9 11.5-3.5 17.4s8.3 9.9 14.8 9.9l112 0c8.8 0 16-7.2 16-16l0-112c0-6.5-3.9-12.3-9.9-14.8s-12.9-1.1-17.4 3.5l-34 34C363.4 52.6 312.1 32 256 32c-10.9 0-21.5 .8-32 2.3l0 64.9c10.3-2.1 21-3.2 32-3.2zM132.1 154.7l32.6 32.6c4.6 4.6 11.5 5.9 17.4 3.5s9.9-8.3 9.9-14.8l0-112c0-8.8-7.2-16-16-16L64 48c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l34 34C52.6 148.6 32 199.9 32 256c0 10.9 .8 21.5 2.3 32l64.9 0c-2.1-10.3-3.2-21-3.2-32c0-38.4 13.5-73.7 36.1-101.3zM477.7 224l-64.9 0c2.1 10.3 3.2 21 3.2 32c0 38.4-13.5 73.7-36.1 101.3l-32.6-32.6c-4.6-4.6-11.5-5.9-17.4-3.5s-9.9 8.3-9.9 14.8l0 112c0 8.8 7.2 16 16 16l112 0c6.5 0 12.3-3.9 14.8-9.9s1.1-12.9-3.5-17.4l-34-34C459.4 363.4 480 312.1 480 256c0-10.9-.8-21.5-2.3-32zM256 416c-38.4 0-73.7-13.5-101.3-36.1l32.6-32.6c4.6-4.6 5.9-11.5 3.5-17.4s-8.3-9.9-14.8-9.9L64 320c-8.8 0-16 7.2-16 16l0 112c0 6.5 3.9 12.3 9.9 14.8s12.9 1.1 17.4-3.5l34-34C148.6 459.4 199.9 480 256 480c10.9 0 21.5-.8 32-2.3l0-64.9c-10.3 2.1-21 3.2-32 3.2z"]
};
const faPrint = {
  prefix: 'fas',
  iconName: 'print',
  icon: [512, 512, [128424, 128438, 9113], "f02f", "M128 0C92.7 0 64 28.7 64 64l0 96 64 0 0-96 226.7 0L384 93.3l0 66.7 64 0 0-66.7c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0L128 0zM384 352l0 32 0 64-256 0 0-64 0-16 0-16 256 0zm64 32l32 0c17.7 0 32-14.3 32-32l0-96c0-35.3-28.7-64-64-64L64 192c-35.3 0-64 28.7-64 64l0 96c0 17.7 14.3 32 32 32l32 0 0 64c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-64zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
};
const faTurkishLiraSign = {
  prefix: 'fas',
  iconName: 'turkish-lira-sign',
  icon: [384, 512, ["try", "turkish-lira"], "e2bb", "M96 32c17.7 0 32 14.3 32 32l0 35.3L247.2 65.2c17-4.9 34.7 5 39.6 22s-5 34.7-22 39.6L128 165.9l0 29.4 119.2-34.1c17-4.9 34.7 5 39.6 22s-5 34.7-22 39.6L128 261.9 128 416l63.8 0c68.2 0 124.4-53.5 127.8-121.6l.4-8c.9-17.7 15.9-31.2 33.6-30.4s31.2 15.9 30.4 33.6l-.4 8C378.5 399.8 294.1 480 191.8 480L96 480c-17.7 0-32-14.3-32-32l0-167.9-23.2 6.6c-17 4.9-34.7-5-39.6-22s5-34.7 22-39.6L64 213.6l0-29.4-23.2 6.6c-17 4.9-34.7-5-39.6-22s5-34.7 22-39.6L64 117.6 64 64c0-17.7 14.3-32 32-32z"]
};
const faTry = faTurkishLiraSign;
const faTurkishLira = faTurkishLiraSign;
const faDollarSign = {
  prefix: 'fas',
  iconName: 'dollar-sign',
  icon: [320, 512, [128178, 61781, "dollar", "usd"], "24", "M160 0c17.7 0 32 14.3 32 32l0 35.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11l0 33.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-34.9c-.4-.1-.9-.1-1.3-.2l-.2 0s0 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7s0 0 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11L128 32c0-17.7 14.3-32 32-32z"]
};
const faDollar = faDollarSign;
const faUsd = faDollarSign;
const faX = {
  prefix: 'fas',
  iconName: 'x',
  icon: [384, 512, [120], "58", "M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"]
};
const faMagnifyingGlassDollar = {
  prefix: 'fas',
  iconName: 'magnifying-glass-dollar',
  icon: [512, 512, ["search-dollar"], "f688", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM228 104c0-11-9-20-20-20s-20 9-20 20l0 14c-7.6 1.7-15.2 4.4-22.2 8.5c-13.9 8.3-25.9 22.8-25.8 43.9c.1 20.3 12 33.1 24.7 40.7c11 6.6 24.7 10.8 35.6 14l1.7 .5c12.6 3.8 21.8 6.8 28 10.7c5.1 3.2 5.8 5.4 5.9 8.2c.1 5-1.8 8-5.9 10.5c-5 3.1-12.9 5-21.4 4.7c-11.1-.4-21.5-3.9-35.1-8.5c-2.3-.8-4.7-1.6-7.2-2.4c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3c1.9 .6 4 1.3 6.1 2.1c0 0 0 0 0 0s0 0 0 0c8.3 2.9 17.9 6.2 28.2 8.4l0 14.6c0 11 9 20 20 20s20-9 20-20l0-13.8c8-1.7 16-4.5 23.2-9c14.3-8.9 25.1-24.1 24.8-45c-.3-20.3-11.7-33.4-24.6-41.6c-11.5-7.2-25.9-11.6-37.1-15l-.7-.2c-12.8-3.9-21.9-6.7-28.3-10.5c-5.2-3.1-5.3-4.9-5.3-6.7c0-3.7 1.4-6.5 6.2-9.3c5.4-3.2 13.6-5.1 21.5-5c9.6 .1 20.2 2.2 31.2 5.2c10.7 2.8 21.6-3.5 24.5-14.2s-3.5-21.6-14.2-24.5c-6.5-1.7-13.7-3.4-21.1-4.7l0-13.9z"]
};
const faSearchDollar = faMagnifyingGlassDollar;
const faUsersGear = {
  prefix: 'fas',
  iconName: 'users-gear',
  icon: [640, 512, ["users-cog"], "f509", "M144 160A80 80 0 1 0 144 0a80 80 0 1 0 0 160zm368 0A80 80 0 1 0 512 0a80 80 0 1 0 0 160zM0 298.7C0 310.4 9.6 320 21.3 320l213.3 0c.2 0 .4 0 .7 0c-26.6-23.5-43.3-57.8-43.3-96c0-7.6 .7-15 1.9-22.3c-13.6-6.3-28.7-9.7-44.6-9.7l-42.7 0C47.8 192 0 239.8 0 298.7zM320 320c24 0 45.9-8.8 62.7-23.3c2.5-3.7 5.2-7.3 8-10.7c2.7-3.3 5.7-6.1 9-8.3C410 262.3 416 243.9 416 224c0-53-43-96-96-96s-96 43-96 96s43 96 96 96zm65.4 60.2c-10.3-5.9-18.1-16.2-20.8-28.2l-103.2 0C187.7 352 128 411.7 128 485.3c0 14.7 11.9 26.7 26.7 26.7l300.6 0c-2.1-5.2-3.2-10.9-3.2-16.4l0-3c-1.3-.7-2.7-1.5-4-2.3l-2.6 1.5c-16.8 9.7-40.5 8-54.7-9.7c-4.5-5.6-8.6-11.5-12.4-17.6l-.1-.2-.1-.2-2.4-4.1-.1-.2-.1-.2c-3.4-6.2-6.4-12.6-9-19.3c-8.2-21.2 2.2-42.6 19-52.3l2.7-1.5c0-.8 0-1.5 0-2.3s0-1.5 0-2.3l-2.7-1.5zM533.3 192l-42.7 0c-15.9 0-31 3.5-44.6 9.7c1.3 7.2 1.9 14.7 1.9 22.3c0 17.4-3.5 33.9-9.7 49c2.5 .9 4.9 2 7.1 3.3l2.6 1.5c1.3-.8 2.6-1.6 4-2.3l0-3c0-19.4 13.3-39.1 35.8-42.6c7.9-1.2 16-1.9 24.2-1.9s16.3 .6 24.2 1.9c22.5 3.5 35.8 23.2 35.8 42.6l0 3c1.3 .7 2.7 1.5 4 2.3l2.6-1.5c16.8-9.7 40.5-8 54.7 9.7c2.3 2.8 4.5 5.8 6.6 8.7c-2.1-57.1-49-102.7-106.6-102.7zm91.3 163.9c6.3-3.6 9.5-11.1 6.8-18c-2.1-5.5-4.6-10.8-7.4-15.9l-2.3-4c-3.1-5.1-6.5-9.9-10.2-14.5c-4.6-5.7-12.7-6.7-19-3l-2.9 1.7c-9.2 5.3-20.4 4-29.6-1.3s-16.1-14.5-16.1-25.1l0-3.4c0-7.3-4.9-13.8-12.1-14.9c-6.5-1-13.1-1.5-19.9-1.5s-13.4 .5-19.9 1.5c-7.2 1.1-12.1 7.6-12.1 14.9l0 3.4c0 10.6-6.9 19.8-16.1 25.1s-20.4 6.6-29.6 1.3l-2.9-1.7c-6.3-3.6-14.4-2.6-19 3c-3.7 4.6-7.1 9.5-10.2 14.6l-2.3 3.9c-2.8 5.1-5.3 10.4-7.4 15.9c-2.6 6.8 .5 14.3 6.8 17.9l2.9 1.7c9.2 5.3 13.7 15.8 13.7 26.4s-4.5 21.1-13.7 26.4l-3 1.7c-6.3 3.6-9.5 11.1-6.8 17.9c2.1 5.5 4.6 10.7 7.4 15.8l2.4 4.1c3 5.1 6.4 9.9 10.1 14.5c4.6 5.7 12.7 6.7 19 3l2.9-1.7c9.2-5.3 20.4-4 29.6 1.3s16.1 14.5 16.1 25.1l0 3.4c0 7.3 4.9 13.8 12.1 14.9c6.5 1 13.1 1.5 19.9 1.5s13.4-.5 19.9-1.5c7.2-1.1 12.1-7.6 12.1-14.9l0-3.4c0-10.6 6.9-19.8 16.1-25.1s20.4-6.6 29.6-1.3l2.9 1.7c6.3 3.6 14.4 2.6 19-3c3.7-4.6 7.1-9.4 10.1-14.5l2.4-4.2c2.8-5.1 5.3-10.3 7.4-15.8c2.6-6.8-.5-14.3-6.8-17.9l-3-1.7c-9.2-5.3-13.7-15.8-13.7-26.4s4.5-21.1 13.7-26.4l3-1.7zM472 384a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z"]
};
const faUsersCog = faUsersGear;
const faPersonMilitaryPointing = {
  prefix: 'fas',
  iconName: 'person-military-pointing',
  icon: [576, 512, [], "e54a", "M246.9 14.1C234 15.2 224 26 224 39c0 13.8 11.2 25 25 25l151 0c8.8 0 16-7.2 16-16l0-30.6C416 8 408 .7 398.7 1.4L246.9 14.1zM240 112c0 44.2 35.8 80 80 80s80-35.8 80-80c0-5.5-.6-10.8-1.6-16L241.6 96c-1 5.2-1.6 10.5-1.6 16zM72 224c-22.1 0-40 17.9-40 40s17.9 40 40 40l152 0 0 89.4L386.8 230.5c-13.3-4.3-27.3-6.5-41.6-6.5L240 224 72 224zm345.7 20.9L246.6 416 416 416l0-46.3 53.6 90.6c11.2 19 35.8 25.3 54.8 14.1s25.3-35.8 14.1-54.8L462.3 290.8c-11.2-18.9-26.6-34.5-44.6-45.9zM224 448l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32-192 0z"]
};
const faBuildingColumns = {
  prefix: 'fas',
  iconName: 'building-columns',
  icon: [512, 512, ["bank", "institution", "museum", "university"], "f19c", "M243.4 2.6l-224 96c-14 6-21.8 21-18.7 35.8S16.8 160 32 160l0 8c0 13.3 10.7 24 24 24l400 0c13.3 0 24-10.7 24-24l0-8c15.2 0 28.3-10.7 31.3-25.6s-4.8-29.9-18.7-35.8l-224-96c-8-3.4-17.2-3.4-25.2 0zM128 224l-64 0 0 196.3c-.6 .3-1.2 .7-1.8 1.1l-48 32c-11.7 7.8-17 22.4-12.9 35.9S17.9 512 32 512l448 0c14.1 0 26.5-9.2 30.6-22.7s-1.1-28.1-12.9-35.9l-48-32c-.6-.4-1.2-.7-1.8-1.1L448 224l-64 0 0 192-40 0 0-192-64 0 0 192-48 0 0-192-64 0 0 192-40 0 0-192zM256 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]
};
const faBank = faBuildingColumns;
const faInstitution = faBuildingColumns;
const faMuseum = faBuildingColumns;
const faUniversity = faBuildingColumns;
const faUmbrella = {
  prefix: 'fas',
  iconName: 'umbrella',
  icon: [576, 512, [], "f0e9", "M288 0c17.7 0 32 14.3 32 32l0 17.7C451.8 63.4 557.7 161 573.9 285.9c2 15.6-17.3 24.4-27.8 12.7C532.1 283 504.8 272 480 272c-38.7 0-71 27.5-78.4 64.1c-1.7 8.7-8.7 15.9-17.6 15.9s-15.8-7.2-17.6-15.9C359 299.5 326.7 272 288 272s-71 27.5-78.4 64.1c-1.7 8.7-8.7 15.9-17.6 15.9s-15.8-7.2-17.6-15.9C167 299.5 134.7 272 96 272c-24.8 0-52.1 11-66.1 26.7C19.4 310.4 .1 301.5 2.1 285.9C18.3 161 124.2 63.4 256 49.7L256 32c0-17.7 14.3-32 32-32zm0 304c12.3 0 23.5 4.6 32 12.2l0 114.3c0 45-36.5 81.4-81.4 81.4c-30.8 0-59-17.4-72.8-45l-2.3-4.7c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l2.3 4.7c3 5.9 9 9.6 15.6 9.6c9.6 0 17.4-7.8 17.4-17.4l0-114.3c8.5-7.6 19.7-12.2 32-12.2z"]
};
const faTrowel = {
  prefix: 'fas',
  iconName: 'trowel',
  icon: [512, 512, [], "e589", "M343.9 213.4L245.3 312l65.4 65.4c7.9 7.9 11.1 19.4 8.4 30.3s-10.8 19.6-21.5 22.9l-256 80c-11.4 3.5-23.8 .5-32.2-7.9S-2.1 481.8 1.5 470.5l80-256c3.3-10.7 12-18.9 22.9-21.5s22.4 .5 30.3 8.4L200 266.7l98.6-98.6c-14.3-14.6-14.2-38 .3-52.5l95.4-95.4c26.9-26.9 70.5-26.9 97.5 0s26.9 70.5 0 97.5l-95.4 95.4c-14.5 14.5-37.9 14.6-52.5 .3z"]
};
const faD = {
  prefix: 'fas',
  iconName: 'd',
  icon: [384, 512, [100], "44", "M0 96C0 60.7 28.7 32 64 32l96 0c123.7 0 224 100.3 224 224s-100.3 224-224 224l-96 0c-35.3 0-64-28.7-64-64L0 96zm160 0L64 96l0 320 96 0c88.4 0 160-71.6 160-160s-71.6-160-160-160z"]
};
const faStapler = {
  prefix: 'fas',
  iconName: 'stapler',
  icon: [640, 512, [], "e5af", "M640 299.3l0 4.7 0 128c0 26.5-21.5 48-48 48l-80 0-64 0L64 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0 0-48L96 368c-17.7 0-32-14.3-32-32l0-116.6L33.8 214C14.2 210.5 0 193.5 0 173.7c0-8.9 2.9-17.5 8.2-24.6l35.6-47.5C76.7 57.8 128.2 32 182.9 32c27 0 53.6 6.3 77.8 18.4L586.9 213.5C619.5 229.7 640 263 640 299.3zM448 304l0-16L128 230.9l0 73.1 320 0z"]
};
const faMasksTheater = {
  prefix: 'fas',
  iconName: 'masks-theater',
  icon: [640, 512, [127917, "theater-masks"], "f630", "M74.6 373.2c41.7 36.1 108 82.5 166.1 73.7c6.1-.9 12.1-2.5 18-4.5c-9.2-12.3-17.3-24.4-24.2-35.4c-21.9-35-28.8-75.2-25.9-113.6c-20.6 4.1-39.2 13-54.7 25.4c-6.5 5.2-16.3 1.3-14.8-7c6.4-33.5 33-60.9 68.2-66.3c2.6-.4 5.3-.7 7.9-.8l19.4-131.3c2-13.8 8-32.7 25-45.9C278.2 53.2 310.5 37 363.2 32.2c-.8-.7-1.6-1.4-2.4-2.1C340.6 14.5 288.4-11.5 175.7 5.6S20.5 63 5.7 83.9C0 91.9-.8 102 .6 111.8L24.8 276.1c5.5 37.3 21.5 72.6 49.8 97.2zm87.7-219.6c4.4-3.1 10.8-2 11.8 3.3c.1 .5 .2 1.1 .3 1.6c3.2 21.8-11.6 42-33.1 45.3s-41.5-11.8-44.7-33.5c-.1-.5-.1-1.1-.2-1.6c-.6-5.4 5.2-8.4 10.3-6.7c9 3 18.8 3.9 28.7 2.4s19.1-5.3 26.8-10.8zM261.6 390c29.4 46.9 79.5 110.9 137.6 119.7s124.5-37.5 166.1-73.7c28.3-24.5 44.3-59.8 49.8-97.2l24.2-164.3c1.4-9.8 .6-19.9-5.1-27.9c-14.8-20.9-57.3-61.2-170-78.3S299.4 77.2 279.2 92.8c-7.8 6-11.5 15.4-12.9 25.2L242.1 282.3c-5.5 37.3-.4 75.8 19.6 107.7zM404.5 235.3c-7.7-5.5-16.8-9.3-26.8-10.8s-19.8-.6-28.7 2.4c-5.1 1.7-10.9-1.3-10.3-6.7c.1-.5 .1-1.1 .2-1.6c3.2-21.8 23.2-36.8 44.7-33.5s36.3 23.5 33.1 45.3c-.1 .5-.2 1.1-.3 1.6c-1 5.3-7.4 6.4-11.8 3.3zm136.2 15.5c-1 5.3-7.4 6.4-11.8 3.3c-7.7-5.5-16.8-9.3-26.8-10.8s-19.8-.6-28.7 2.4c-5.1 1.7-10.9-1.3-10.3-6.7c.1-.5 .1-1.1 .2-1.6c3.2-21.8 23.2-36.8 44.7-33.5s36.3 23.5 33.1 45.3c-.1 .5-.2 1.1-.3 1.6zM530 350.2c-19.6 44.7-66.8 72.5-116.8 64.9s-87.1-48.2-93-96.7c-1-8.3 8.9-12.1 15.2-6.7c23.9 20.8 53.6 35.3 87 40.3s66.1 .1 94.9-12.8c7.6-3.4 16 3.2 12.6 10.9z"]
};
const faTheaterMasks = faMasksTheater;
const faKipSign = {
  prefix: 'fas',
  iconName: 'kip-sign',
  icon: [384, 512, [], "e1c4", "M340.8 88.3c13.4-11.5 15-31.7 3.5-45.1s-31.7-15-45.1-3.5L128 186.4 128 64c0-17.7-14.3-32-32-32S64 46.3 64 64l0 160-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-122.4L299.2 472.3c13.4 11.5 33.6 9.9 45.1-3.5s9.9-33.6-3.5-45.1L182.5 288 352 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-169.5 0L340.8 88.3z"]
};
const faHandPointLeft = {
  prefix: 'fas',
  iconName: 'hand-point-left',
  icon: [512, 512, [], "f0a5", "M32 96C14.3 96 0 110.3 0 128s14.3 32 32 32l208 0 0-64L32 96zM192 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0zm-64-64c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-48 0c-17.7 0-32 14.3-32 32zm96 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0zm88-96l-.6 0c5.4 9.4 8.6 20.3 8.6 32c0 13.2-4 25.4-10.8 35.6c24.9 8.7 42.8 32.5 42.8 60.4c0 11.7-3.1 22.6-8.6 32l8.6 0c88.4 0 160-71.6 160-160l0-61.7c0-42.4-16.9-83.1-46.9-113.1l-11.6-11.6C429.5 77.5 396.9 64 363 64l-27 0c-35.3 0-64 28.7-64 64l0 88c0 22.1 17.9 40 40 40s40-17.9 40-40l0-56c0-8.8 7.2-16 16-16s16 7.2 16 16l0 56c0 39.8-32.2 72-72 72z"]
};
const faHandshakeSimple = {
  prefix: 'fas',
  iconName: 'handshake-simple',
  icon: [640, 512, [129309, "handshake-alt"], "f4c6", "M323.4 85.2l-96.8 78.4c-16.1 13-19.2 36.4-7 53.1c12.9 17.8 38 21.3 55.3 7.8l99.3-77.2c7-5.4 17-4.2 22.5 2.8s4.2 17-2.8 22.5l-20.9 16.2L550.2 352l41.8 0c26.5 0 48-21.5 48-48l0-128c0-26.5-21.5-48-48-48l-76 0-4 0-.7 0-3.9-2.5L434.8 79c-15.3-9.8-33.2-15-51.4-15c-21.8 0-43 7.5-60 21.2zm22.8 124.4l-51.7 40.2C263 274.4 217.3 268 193.7 235.6c-22.2-30.5-16.6-73.1 12.7-96.8l83.2-67.3c-11.6-4.9-24.1-7.4-36.8-7.4C234 64 215.7 69.6 200 80l-72 48-80 0c-26.5 0-48 21.5-48 48L0 304c0 26.5 21.5 48 48 48l108.2 0 91.4 83.4c19.6 17.9 49.9 16.5 67.8-3.1c5.5-6.1 9.2-13.2 11.1-20.6l17 15.6c19.5 17.9 49.9 16.6 67.8-2.9c4.5-4.9 7.8-10.6 9.9-16.5c19.4 13 45.8 10.3 62.1-7.5c17.9-19.5 16.6-49.9-2.9-67.8l-134.2-123z"]
};
const faHandshakeAlt = faHandshakeSimple;
const faJetFighter = {
  prefix: 'fas',
  iconName: 'jet-fighter',
  icon: [640, 512, ["fighter-jet"], "f0fb", "M160 24c0-13.3 10.7-24 24-24L296 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0L384 192l116.4 0c7.7 0 15.3 1.4 22.5 4.1L625 234.4c9 3.4 15 12 15 21.6s-6 18.2-15 21.6L522.9 315.9c-7.2 2.7-14.8 4.1-22.5 4.1L384 320 280 464l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-112 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-144-32 0-54.6 54.6c-6 6-14.1 9.4-22.6 9.4L64 384c-17.7 0-32-14.3-32-32l0-64c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-64c0-17.7 14.3-32 32-32l18.7 0c8.5 0 16.6 3.4 22.6 9.4L160 192l32 0 0-144-8 0c-13.3 0-24-10.7-24-24zM80 240c-8.8 0-16 7.2-16 16s7.2 16 16 16l64 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0z"]
};
const faFighterJet = faJetFighter;
const faSquareShareNodes = {
  prefix: 'fas',
  iconName: 'square-share-nodes',
  icon: [448, 512, ["share-alt-square"], "f1e1", "M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM384 160c0 35.3-28.7 64-64 64c-15.4 0-29.5-5.4-40.6-14.5L194.1 256l85.3 46.5c11-9.1 25.2-14.5 40.6-14.5c35.3 0 64 28.7 64 64s-28.7 64-64 64s-64-28.7-64-64c0-2.5 .1-4.9 .4-7.3L174.5 300c-11.7 12.3-28.2 20-46.5 20c-35.3 0-64-28.7-64-64s28.7-64 64-64c18.3 0 34.8 7.7 46.5 20l81.9-44.7c-.3-2.4-.4-4.9-.4-7.3c0-35.3 28.7-64 64-64s64 28.7 64 64z"]
};
const faShareAltSquare = faSquareShareNodes;
const faBarcode = {
  prefix: 'fas',
  iconName: 'barcode',
  icon: [512, 512, [], "f02a", "M24 32C10.7 32 0 42.7 0 56L0 456c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24L64 56c0-13.3-10.7-24-24-24L24 32zm88 0c-8.8 0-16 7.2-16 16l0 416c0 8.8 7.2 16 16 16s16-7.2 16-16l0-416c0-8.8-7.2-16-16-16zm72 0c-13.3 0-24 10.7-24 24l0 400c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-400c0-13.3-10.7-24-24-24l-16 0zm96 0c-13.3 0-24 10.7-24 24l0 400c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-400c0-13.3-10.7-24-24-24l-16 0zM448 56l0 400c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-400c0-13.3-10.7-24-24-24l-16 0c-13.3 0-24 10.7-24 24zm-64-8l0 416c0 8.8 7.2 16 16 16s16-7.2 16-16l0-416c0-8.8-7.2-16-16-16s-16 7.2-16 16z"]
};
const faPlusMinus = {
  prefix: 'fas',
  iconName: 'plus-minus',
  icon: [384, 512, [], "e43c", "M224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112L48 144c-17.7 0-32 14.3-32 32s14.3 32 32 32l112 0 0 112c0 17.7 14.3 32 32 32s32-14.3 32-32l0-112 112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-112 0 0-112zM0 480c0 17.7 14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 448c-17.7 0-32 14.3-32 32z"]
};
const faVideo = {
  prefix: 'fas',
  iconName: 'video',
  icon: [576, 512, ["video-camera"], "f03d", "M0 128C0 92.7 28.7 64 64 64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2l0 256c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1l0-17.1 0-128 0-17.1 14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]
};
const faVideoCamera = faVideo;
const faGraduationCap = {
  prefix: 'fas',
  iconName: 'graduation-cap',
  icon: [640, 512, [127891, "mortar-board"], "f19d", "M320 32c-8.1 0-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6l57.9 20.9C57.3 229.3 48 259.8 48 291.9l0 28.1c0 28.4-10.8 57.7-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7C90.3 344.3 86 329.8 80 316.5l0-24.6c0-30.2 10.2-58.7 27.9-81.5c12.9-15.5 29.6-28 49.2-35.7l157-61.7c8.2-3.2 17.5 .8 20.7 9s-.8 17.5-9 20.7l-157 61.7c-12.4 4.9-23.3 12.4-32.2 21.6l159.6 57.6c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1L624.2 182.6c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1C336.1 33.4 328.1 32 320 32zM128 408c0 35.3 86 72 192 72s192-36.7 192-72L496.7 262.6 354.5 314c-11.1 4-22.8 6-34.5 6s-23.5-2-34.5-6L143.3 262.6 128 408z"]
};
const faMortarBoard = faGraduationCap;
const faHandHoldingMedical = {
  prefix: 'fas',
  iconName: 'hand-holding-medical',
  icon: [576, 512, [], "e05c", "M224 24l0 56-56 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l56 0 0 56c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-56 56 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-56 0 0-56c0-13.3-10.7-24-24-24L248 0c-13.3 0-24 10.7-24 24zM559.7 392.2c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416 272 416c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0-16 0-78.3 0c-29.1 0-57.3 9.9-80 28L68.8 384 32 384c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l160 0 160.5 0c29 0 57.3-9.3 80.7-26.5l126.6-93.3zm-367-8.2l.9 0c0 0 0 0 0 0c-.3 0-.6 0-.9 0z"]
};
const faPersonCircleCheck = {
  prefix: 'fas',
  iconName: 'person-circle-check',
  icon: [576, 512, [], "e53e", "M112 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-223.1L59.4 304.5c-9.1 15.1-28.8 20-43.9 10.9s-20-28.8-10.9-43.9l58.3-97c17.4-28.9 48.6-46.6 82.3-46.6l29.7 0c33.7 0 64.9 17.7 82.3 46.6l44.9 74.7c-16.1 17.6-28.6 38.5-36.6 61.5c-1.9-1.8-3.5-3.9-4.9-6.3L232 256.9 232 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zm136 16a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L416 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"]
};
const faTurnUp = {
  prefix: 'fas',
  iconName: 'turn-up',
  icon: [384, 512, [10548, "level-up-alt"], "f3bf", "M350 177.5c3.8-8.8 2-19-4.6-26l-136-144C204.9 2.7 198.6 0 192 0s-12.9 2.7-17.4 7.5l-136 144c-6.6 7-8.4 17.2-4.6 26s12.5 14.5 22 14.5l88 0 0 192c0 17.7-14.3 32-32 32l-80 0c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l80 0c70.7 0 128-57.3 128-128l0-192 88 0c9.6 0 18.2-5.7 22-14.5z"]
};
const faLevelUpAlt = faTurnUp;
var icons = {
  fa0,
  fa1,
  fa2,
  fa3,
  fa4,
  fa5,
  fa6,
  fa7,
  fa8,
  fa9,
  faFillDrip,
  faArrowsToCircle,
  faCircleChevronRight,
  faChevronCircleRight,
  faAt,
  faTrashCan,
  faTrashAlt,
  faTextHeight,
  faUserXmark,
  faUserTimes,
  faStethoscope,
  faMessage,
  faCommentAlt,
  faInfo,
  faDownLeftAndUpRightToCenter,
  faCompressAlt,
  faExplosion,
  faFileLines,
  faFileAlt,
  faFileText,
  faWaveSquare,
  faRing,
  faBuildingUn,
  faDiceThree,
  faCalendarDays,
  faCalendarAlt,
  faAnchorCircleCheck,
  faBuildingCircleArrowRight,
  faVolleyball,
  faVolleyballBall,
  faArrowsUpToLine,
  faSortDown,
  faSortDesc,
  faCircleMinus,
  faMinusCircle,
  faDoorOpen,
  faRightFromBracket,
  faSignOutAlt,
  faAtom,
  faSoap,
  faIcons,
  faHeartMusicCameraBolt,
  faMicrophoneLinesSlash,
  faMicrophoneAltSlash,
  faBridgeCircleCheck,
  faPumpMedical,
  faFingerprint,
  faHandPointRight,
  faMagnifyingGlassLocation,
  faSearchLocation,
  faForwardStep,
  faStepForward,
  faFaceSmileBeam,
  faSmileBeam,
  faFlagCheckered,
  faFootball,
  faFootballBall,
  faSchoolCircleExclamation,
  faCrop,
  faAnglesDown,
  faAngleDoubleDown,
  faUsersRectangle,
  faPeopleRoof,
  faPeopleLine,
  faBeerMugEmpty,
  faBeer,
  faDiagramPredecessor,
  faArrowUpLong,
  faLongArrowUp,
  faFireFlameSimple,
  faBurn,
  faPerson,
  faMale,
  faLaptop,
  faFileCsv,
  faMenorah,
  faTruckPlane,
  faRecordVinyl,
  faFaceGrinStars,
  faGrinStars,
  faBong,
  faSpaghettiMonsterFlying,
  faPastafarianism,
  faArrowDownUpAcrossLine,
  faSpoon,
  faUtensilSpoon,
  faJarWheat,
  faEnvelopesBulk,
  faMailBulk,
  faFileCircleExclamation,
  faCircleH,
  faHospitalSymbol,
  faPager,
  faAddressBook,
  faContactBook,
  faStrikethrough,
  faK,
  faLandmarkFlag,
  faPencil,
  faPencilAlt,
  faBackward,
  faCaretRight,
  faComments,
  faPaste,
  faFileClipboard,
  faCodePullRequest,
  faClipboardList,
  faTruckRampBox,
  faTruckLoading,
  faUserCheck,
  faVialVirus,
  faSheetPlastic,
  faBlog,
  faUserNinja,
  faPersonArrowUpFromLine,
  faScrollTorah,
  faTorah,
  faBroomBall,
  faQuidditch,
  faQuidditchBroomBall,
  faToggleOff,
  faBoxArchive,
  faArchive,
  faPersonDrowning,
  faArrowDown91,
  faSortNumericDesc,
  faSortNumericDownAlt,
  faFaceGrinTongueSquint,
  faGrinTongueSquint,
  faSprayCan,
  faTruckMonster,
  faW,
  faEarthAfrica,
  faGlobeAfrica,
  faRainbow,
  faCircleNotch,
  faTabletScreenButton,
  faTabletAlt,
  faPaw,
  faCloud,
  faTrowelBricks,
  faFaceFlushed,
  faFlushed,
  faHospitalUser,
  faTentArrowLeftRight,
  faGavel,
  faLegal,
  faBinoculars,
  faMicrophoneSlash,
  faBoxTissue,
  faMotorcycle,
  faBellConcierge,
  faConciergeBell,
  faPenRuler,
  faPencilRuler,
  faPeopleArrows,
  faPeopleArrowsLeftRight,
  faMarsAndVenusBurst,
  faSquareCaretRight,
  faCaretSquareRight,
  faScissors,
  faCut,
  faSunPlantWilt,
  faToiletsPortable,
  faHockeyPuck,
  faTable,
  faMagnifyingGlassArrowRight,
  faTachographDigital,
  faDigitalTachograph,
  faUsersSlash,
  faClover,
  faReply,
  faMailReply,
  faStarAndCrescent,
  faHouseFire,
  faSquareMinus,
  faMinusSquare,
  faHelicopter,
  faCompass,
  faSquareCaretDown,
  faCaretSquareDown,
  faFileCircleQuestion,
  faLaptopCode,
  faSwatchbook,
  faPrescriptionBottle,
  faBars,
  faNavicon,
  faPeopleGroup,
  faHourglassEnd,
  faHourglass3,
  faHeartCrack,
  faHeartBroken,
  faSquareUpRight,
  faExternalLinkSquareAlt,
  faFaceKissBeam,
  faKissBeam,
  faFilm,
  faRulerHorizontal,
  faPeopleRobbery,
  faLightbulb,
  faCaretLeft,
  faCircleExclamation,
  faExclamationCircle,
  faSchoolCircleXmark,
  faArrowRightFromBracket,
  faSignOut,
  faCircleChevronDown,
  faChevronCircleDown,
  faUnlockKeyhole,
  faUnlockAlt,
  faCloudShowersHeavy,
  faHeadphonesSimple,
  faHeadphonesAlt,
  faSitemap,
  faCircleDollarToSlot,
  faDonate,
  faMemory,
  faRoadSpikes,
  faFireBurner,
  faFlag,
  faHanukiah,
  faFeather,
  faVolumeLow,
  faVolumeDown,
  faCommentSlash,
  faCloudSunRain,
  faCompress,
  faWheatAwn,
  faWheatAlt,
  faAnkh,
  faHandsHoldingChild,
  faAsterisk,
  faSquareCheck,
  faCheckSquare,
  faPesetaSign,
  faHeading,
  faHeader,
  faGhost,
  faList,
  faListSquares,
  faSquarePhoneFlip,
  faPhoneSquareAlt,
  faCartPlus,
  faGamepad,
  faCircleDot,
  faDotCircle,
  faFaceDizzy,
  faDizzy,
  faEgg,
  faHouseMedicalCircleXmark,
  faCampground,
  faFolderPlus,
  faFutbol,
  faFutbolBall,
  faSoccerBall,
  faPaintbrush,
  faPaintBrush,
  faLock,
  faGasPump,
  faHotTubPerson,
  faHotTub,
  faMapLocation,
  faMapMarked,
  faHouseFloodWater,
  faTree,
  faBridgeLock,
  faSackDollar,
  faPenToSquare,
  faEdit,
  faCarSide,
  faShareNodes,
  faShareAlt,
  faHeartCircleMinus,
  faHourglassHalf,
  faHourglass2,
  faMicroscope,
  faSink,
  faBagShopping,
  faShoppingBag,
  faArrowDownZA,
  faSortAlphaDesc,
  faSortAlphaDownAlt,
  faMitten,
  faPersonRays,
  faUsers,
  faEyeSlash,
  faFlaskVial,
  faHand,
  faHandPaper,
  faOm,
  faWorm,
  faHouseCircleXmark,
  faPlug,
  faChevronUp,
  faHandSpock,
  faStopwatch,
  faFaceKiss,
  faKiss,
  faBridgeCircleXmark,
  faFaceGrinTongue,
  faGrinTongue,
  faChessBishop,
  faFaceGrinWink,
  faGrinWink,
  faEarDeaf,
  faDeaf,
  faDeafness,
  faHardOfHearing,
  faRoadCircleCheck,
  faDiceFive,
  faSquareRss,
  faRssSquare,
  faLandMineOn,
  faICursor,
  faStamp,
  faStairs,
  faI,
  faHryvniaSign,
  faHryvnia,
  faPills,
  faFaceGrinWide,
  faGrinAlt,
  faTooth,
  faV,
  faBangladeshiTakaSign,
  faBicycle,
  faStaffSnake,
  faRodAsclepius,
  faRodSnake,
  faStaffAesculapius,
  faHeadSideCoughSlash,
  faTruckMedical,
  faAmbulance,
  faWheatAwnCircleExclamation,
  faSnowman,
  faMortarPestle,
  faRoadBarrier,
  faSchool,
  faIgloo,
  faJoint,
  faAngleRight,
  faHorse,
  faQ,
  faG,
  faNotesMedical,
  faTemperatureHalf,
  faTemperature2,
  faThermometer2,
  faThermometerHalf,
  faDongSign,
  faCapsules,
  faPooStorm,
  faPooBolt,
  faFaceFrownOpen,
  faFrownOpen,
  faHandPointUp,
  faMoneyBill,
  faBookmark,
  faAlignJustify,
  faUmbrellaBeach,
  faHelmetUn,
  faBullseye,
  faBacon,
  faHandPointDown,
  faArrowUpFromBracket,
  faFolder,
  faFolderBlank,
  faFileWaveform,
  faFileMedicalAlt,
  faRadiation,
  faChartSimple,
  faMarsStroke,
  faVial,
  faGauge,
  faDashboard,
  faGaugeMed,
  faTachometerAltAverage,
  faWandMagicSparkles,
  faMagicWandSparkles,
  faE,
  faPenClip,
  faPenAlt,
  faBridgeCircleExclamation,
  faUser,
  faSchoolCircleCheck,
  faDumpster,
  faVanShuttle,
  faShuttleVan,
  faBuildingUser,
  faSquareCaretLeft,
  faCaretSquareLeft,
  faHighlighter,
  faKey,
  faBullhorn,
  faGlobe,
  faSynagogue,
  faPersonHalfDress,
  faRoadBridge,
  faLocationArrow,
  faC,
  faTabletButton,
  faBuildingLock,
  faPizzaSlice,
  faMoneyBillWave,
  faChartArea,
  faAreaChart,
  faHouseFlag,
  faPersonCircleMinus,
  faBan,
  faCancel,
  faCameraRotate,
  faSprayCanSparkles,
  faAirFreshener,
  faStar,
  faRepeat,
  faCross,
  faBox,
  faVenusMars,
  faArrowPointer,
  faMousePointer,
  faMaximize,
  faExpandArrowsAlt,
  faChargingStation,
  faShapes,
  faTriangleCircleSquare,
  faShuffle,
  faRandom,
  faPersonRunning,
  faRunning,
  faMobileRetro,
  faGripLinesVertical,
  faSpider,
  faHandsBound,
  faFileInvoiceDollar,
  faPlaneCircleExclamation,
  faXRay,
  faSpellCheck,
  faSlash,
  faComputerMouse,
  faMouse,
  faArrowRightToBracket,
  faSignIn,
  faShopSlash,
  faStoreAltSlash,
  faServer,
  faVirusCovidSlash,
  faShopLock,
  faHourglassStart,
  faHourglass1,
  faBlenderPhone,
  faBuildingWheat,
  faPersonBreastfeeding,
  faRightToBracket,
  faSignInAlt,
  faVenus,
  faPassport,
  faThumbtackSlash,
  faThumbTackSlash,
  faHeartPulse,
  faHeartbeat,
  faPeopleCarryBox,
  faPeopleCarry,
  faTemperatureHigh,
  faMicrochip,
  faCrown,
  faWeightHanging,
  faXmarksLines,
  faFilePrescription,
  faWeightScale,
  faWeight,
  faUserGroup,
  faUserFriends,
  faArrowUpAZ,
  faSortAlphaUp,
  faChessKnight,
  faFaceLaughSquint,
  faLaughSquint,
  faWheelchair,
  faCircleArrowUp,
  faArrowCircleUp,
  faToggleOn,
  faPersonWalking,
  faWalking,
  faL,
  faFire,
  faBedPulse,
  faProcedures,
  faShuttleSpace,
  faSpaceShuttle,
  faFaceLaugh,
  faLaugh,
  faFolderOpen,
  faHeartCirclePlus,
  faCodeFork,
  faCity,
  faMicrophoneLines,
  faMicrophoneAlt,
  faPepperHot,
  faUnlock,
  faColonSign,
  faHeadset,
  faStoreSlash,
  faRoadCircleXmark,
  faUserMinus,
  faMarsStrokeUp,
  faMarsStrokeV,
  faChampagneGlasses,
  faGlassCheers,
  faClipboard,
  faHouseCircleExclamation,
  faFileArrowUp,
  faFileUpload,
  faWifi,
  faWifi3,
  faWifiStrong,
  faBath,
  faBathtub,
  faUnderline,
  faUserPen,
  faUserEdit,
  faSignature,
  faStroopwafel,
  faBold,
  faAnchorLock,
  faBuildingNgo,
  faManatSign,
  faNotEqual,
  faBorderTopLeft,
  faBorderStyle,
  faMapLocationDot,
  faMapMarkedAlt,
  faJedi,
  faSquarePollVertical,
  faPoll,
  faMugHot,
  faCarBattery,
  faBatteryCar,
  faGift,
  faDiceTwo,
  faChessQueen,
  faGlasses,
  faChessBoard,
  faBuildingCircleCheck,
  faPersonChalkboard,
  faMarsStrokeRight,
  faMarsStrokeH,
  faHandBackFist,
  faHandRock,
  faSquareCaretUp,
  faCaretSquareUp,
  faCloudShowersWater,
  faChartBar,
  faBarChart,
  faHandsBubbles,
  faHandsWash,
  faLessThanEqual,
  faTrain,
  faEyeLowVision,
  faLowVision,
  faCrow,
  faSailboat,
  faWindowRestore,
  faSquarePlus,
  faPlusSquare,
  faToriiGate,
  faFrog,
  faBucket,
  faImage,
  faMicrophone,
  faCow,
  faCaretUp,
  faScrewdriver,
  faFolderClosed,
  faHouseTsunami,
  faSquareNfi,
  faArrowUpFromGroundWater,
  faMartiniGlass,
  faGlassMartiniAlt,
  faSquareBinary,
  faRotateLeft,
  faRotateBack,
  faRotateBackward,
  faUndoAlt,
  faTableColumns,
  faColumns,
  faLemon,
  faHeadSideMask,
  faHandshake,
  faGem,
  faDolly,
  faDollyBox,
  faSmoking,
  faMinimize,
  faCompressArrowsAlt,
  faMonument,
  faSnowplow,
  faAnglesRight,
  faAngleDoubleRight,
  faCannabis,
  faCirclePlay,
  faPlayCircle,
  faTablets,
  faEthernet,
  faEuroSign,
  faEur,
  faEuro,
  faChair,
  faCircleCheck,
  faCheckCircle,
  faCircleStop,
  faStopCircle,
  faCompassDrafting,
  faDraftingCompass,
  faPlateWheat,
  faIcicles,
  faPersonShelter,
  faNeuter,
  faIdBadge,
  faMarker,
  faFaceLaughBeam,
  faLaughBeam,
  faHelicopterSymbol,
  faUniversalAccess,
  faCircleChevronUp,
  faChevronCircleUp,
  faLariSign,
  faVolcano,
  faPersonWalkingDashedLineArrowRight,
  faSterlingSign,
  faGbp,
  faPoundSign,
  faViruses,
  faSquarePersonConfined,
  faUserTie,
  faArrowDownLong,
  faLongArrowDown,
  faTentArrowDownToLine,
  faCertificate,
  faReplyAll,
  faMailReplyAll,
  faSuitcase,
  faPersonSkating,
  faSkating,
  faFilterCircleDollar,
  faFunnelDollar,
  faCameraRetro,
  faCircleArrowDown,
  faArrowCircleDown,
  faFileImport,
  faArrowRightToFile,
  faSquareArrowUpRight,
  faExternalLinkSquare,
  faBoxOpen,
  faScroll,
  faSpa,
  faLocationPinLock,
  faPause,
  faHillAvalanche,
  faTemperatureEmpty,
  faTemperature0,
  faThermometer0,
  faThermometerEmpty,
  faBomb,
  faRegistered,
  faAddressCard,
  faContactCard,
  faVcard,
  faScaleUnbalancedFlip,
  faBalanceScaleRight,
  faSubscript,
  faDiamondTurnRight,
  faDirections,
  faBurst,
  faHouseLaptop,
  faLaptopHouse,
  faFaceTired,
  faTired,
  faMoneyBills,
  faSmog,
  faCrutch,
  faFontAwesome,
  faFontAwesomeFlag,
  faFontAwesomeLogoFull,
  faCloudArrowUp,
  faCloudUpload,
  faCloudUploadAlt,
  faPalette,
  faArrowsTurnRight,
  faVest,
  faFerry,
  faArrowsDownToPeople,
  faSeedling,
  faSprout,
  faLeftRight,
  faArrowsAltH,
  faBoxesPacking,
  faCircleArrowLeft,
  faArrowCircleLeft,
  faGroupArrowsRotate,
  faBowlFood,
  faCandyCane,
  faArrowDownWideShort,
  faSortAmountAsc,
  faSortAmountDown,
  faCloudBolt,
  faThunderstorm,
  faTextSlash,
  faRemoveFormat,
  faFaceSmileWink,
  faSmileWink,
  faFileWord,
  faFilePowerpoint,
  faArrowsLeftRight,
  faArrowsH,
  faHouseLock,
  faCloudArrowDown,
  faCloudDownload,
  faCloudDownloadAlt,
  faChildren,
  faChalkboard,
  faBlackboard,
  faUserLargeSlash,
  faUserAltSlash,
  faEnvelopeOpen,
  faHandshakeSimpleSlash,
  faHandshakeAltSlash,
  faMattressPillow,
  faGuaraniSign,
  faArrowsRotate,
  faRefresh,
  faSync,
  faFireExtinguisher,
  faCruzeiroSign,
  faGreaterThanEqual,
  faShieldHalved,
  faShieldAlt,
  faBookAtlas,
  faAtlas,
  faVirus,
  faEnvelopeCircleCheck,
  faLayerGroup,
  faArrowsToDot,
  faArchway,
  faHeartCircleCheck,
  faHouseChimneyCrack,
  faHouseDamage,
  faFileZipper,
  faFileArchive,
  faSquare,
  faMartiniGlassEmpty,
  faGlassMartini,
  faCouch,
  faCediSign,
  faItalic,
  faTableCellsColumnLock,
  faChurch,
  faCommentsDollar,
  faDemocrat,
  faZ,
  faPersonSkiing,
  faSkiing,
  faRoadLock,
  faA,
  faTemperatureArrowDown,
  faTemperatureDown,
  faFeatherPointed,
  faFeatherAlt,
  faP,
  faSnowflake,
  faNewspaper,
  faRectangleAd,
  faAd,
  faCircleArrowRight,
  faArrowCircleRight,
  faFilterCircleXmark,
  faLocust,
  faSort,
  faUnsorted,
  faListOl,
  faList12,
  faListNumeric,
  faPersonDressBurst,
  faMoneyCheckDollar,
  faMoneyCheckAlt,
  faVectorSquare,
  faBreadSlice,
  faLanguage,
  faFaceKissWinkHeart,
  faKissWinkHeart,
  faFilter,
  faQuestion,
  faFileSignature,
  faUpDownLeftRight,
  faArrowsAlt,
  faHouseChimneyUser,
  faHandHoldingHeart,
  faPuzzlePiece,
  faMoneyCheck,
  faStarHalfStroke,
  faStarHalfAlt,
  faCode,
  faWhiskeyGlass,
  faGlassWhiskey,
  faBuildingCircleExclamation,
  faMagnifyingGlassChart,
  faArrowUpRightFromSquare,
  faExternalLink,
  faCubesStacked,
  faWonSign,
  faKrw,
  faWon,
  faVirusCovid,
  faAustralSign,
  faF,
  faLeaf,
  faRoad,
  faTaxi,
  faCab,
  faPersonCirclePlus,
  faChartPie,
  faPieChart,
  faBoltLightning,
  faSackXmark,
  faFileExcel,
  faFileContract,
  faFishFins,
  faBuildingFlag,
  faFaceGrinBeam,
  faGrinBeam,
  faObjectUngroup,
  faPoop,
  faLocationPin,
  faMapMarker,
  faKaaba,
  faToiletPaper,
  faHelmetSafety,
  faHardHat,
  faHatHard,
  faEject,
  faCircleRight,
  faArrowAltCircleRight,
  faPlaneCircleCheck,
  faFaceRollingEyes,
  faMehRollingEyes,
  faObjectGroup,
  faChartLine,
  faLineChart,
  faMaskVentilator,
  faArrowRight,
  faSignsPost,
  faMapSigns,
  faCashRegister,
  faPersonCircleQuestion,
  faH,
  faTarp,
  faScrewdriverWrench,
  faTools,
  faArrowsToEye,
  faPlugCircleBolt,
  faHeart,
  faMarsAndVenus,
  faHouseUser,
  faHomeUser,
  faDumpsterFire,
  faHouseCrack,
  faMartiniGlassCitrus,
  faCocktail,
  faFaceSurprise,
  faSurprise,
  faBottleWater,
  faCirclePause,
  faPauseCircle,
  faToiletPaperSlash,
  faAppleWhole,
  faAppleAlt,
  faKitchenSet,
  faR,
  faTemperatureQuarter,
  faTemperature1,
  faThermometer1,
  faThermometerQuarter,
  faCube,
  faBitcoinSign,
  faShieldDog,
  faSolarPanel,
  faLockOpen,
  faElevator,
  faMoneyBillTransfer,
  faMoneyBillTrendUp,
  faHouseFloodWaterCircleArrowRight,
  faSquarePollHorizontal,
  faPollH,
  faCircle,
  faBackwardFast,
  faFastBackward,
  faRecycle,
  faUserAstronaut,
  faPlaneSlash,
  faTrademark,
  faBasketball,
  faBasketballBall,
  faSatelliteDish,
  faCircleUp,
  faArrowAltCircleUp,
  faMobileScreenButton,
  faMobileAlt,
  faVolumeHigh,
  faVolumeUp,
  faUsersRays,
  faWallet,
  faClipboardCheck,
  faFileAudio,
  faBurger,
  faHamburger,
  faWrench,
  faBugs,
  faRupeeSign,
  faRupee,
  faFileImage,
  faCircleQuestion,
  faQuestionCircle,
  faPlaneDeparture,
  faHandshakeSlash,
  faBookBookmark,
  faCodeBranch,
  faHatCowboy,
  faBridge,
  faPhoneFlip,
  faPhoneAlt,
  faTruckFront,
  faCat,
  faAnchorCircleExclamation,
  faTruckField,
  faRoute,
  faClipboardQuestion,
  faPanorama,
  faCommentMedical,
  faTeethOpen,
  faFileCircleMinus,
  faTags,
  faWineGlass,
  faForwardFast,
  faFastForward,
  faFaceMehBlank,
  faMehBlank,
  faSquareParking,
  faParking,
  faHouseSignal,
  faBarsProgress,
  faTasksAlt,
  faFaucetDrip,
  faCartFlatbed,
  faDollyFlatbed,
  faBanSmoking,
  faSmokingBan,
  faTerminal,
  faMobileButton,
  faHouseMedicalFlag,
  faBasketShopping,
  faShoppingBasket,
  faTape,
  faBusSimple,
  faBusAlt,
  faEye,
  faFaceSadCry,
  faSadCry,
  faAudioDescription,
  faPersonMilitaryToPerson,
  faFileShield,
  faUserSlash,
  faPen,
  faTowerObservation,
  faFileCode,
  faSignal,
  faSignal5,
  faSignalPerfect,
  faBus,
  faHeartCircleXmark,
  faHouseChimney,
  faHomeLg,
  faWindowMaximize,
  faFaceFrown,
  faFrown,
  faPrescription,
  faShop,
  faStoreAlt,
  faFloppyDisk,
  faSave,
  faVihara,
  faScaleUnbalanced,
  faBalanceScaleLeft,
  faSortUp,
  faSortAsc,
  faCommentDots,
  faCommenting,
  faPlantWilt,
  faDiamond,
  faFaceGrinSquint,
  faGrinSquint,
  faHandHoldingDollar,
  faHandHoldingUsd,
  faChartDiagram,
  faBacterium,
  faHandPointer,
  faDrumSteelpan,
  faHandScissors,
  faHandsPraying,
  faPrayingHands,
  faArrowRotateRight,
  faArrowRightRotate,
  faArrowRotateForward,
  faRedo,
  faWebAwesome,
  faBiohazard,
  faLocationCrosshairs,
  faLocation,
  faMarsDouble,
  faChildDress,
  faUsersBetweenLines,
  faLungsVirus,
  faFaceGrinTears,
  faGrinTears,
  faPhone,
  faCalendarXmark,
  faCalendarTimes,
  faChildReaching,
  faHeadSideVirus,
  faUserGear,
  faUserCog,
  faArrowUp19,
  faSortNumericUp,
  faDoorClosed,
  faShieldVirus,
  faDiceSix,
  faMosquitoNet,
  faFileFragment,
  faBridgeWater,
  faPersonBooth,
  faTextWidth,
  faHatWizard,
  faPenFancy,
  faPersonDigging,
  faDigging,
  faTrash,
  faGaugeSimple,
  faGaugeSimpleMed,
  faTachometerAverage,
  faBookMedical,
  faPoo,
  faQuoteRight,
  faQuoteRightAlt,
  faShirt,
  faTShirt,
  faTshirt,
  faCubes,
  faDivide,
  faTengeSign,
  faTenge,
  faHeadphones,
  faHandsHolding,
  faHandsClapping,
  faRepublican,
  faArrowLeft,
  faPersonCircleXmark,
  faRuler,
  faAlignLeft,
  faDiceD6,
  faRestroom,
  faJ,
  faUsersViewfinder,
  faFileVideo,
  faUpRightFromSquare,
  faExternalLinkAlt,
  faTableCells,
  faTh,
  faFilePdf,
  faBookBible,
  faBible,
  faO,
  faSuitcaseMedical,
  faMedkit,
  faUserSecret,
  faOtter,
  faPersonDress,
  faFemale,
  faCommentDollar,
  faBusinessTime,
  faBriefcaseClock,
  faTableCellsLarge,
  faThLarge,
  faBookTanakh,
  faTanakh,
  faPhoneVolume,
  faVolumeControlPhone,
  faHatCowboySide,
  faClipboardUser,
  faChild,
  faLiraSign,
  faSatellite,
  faPlaneLock,
  faTag,
  faComment,
  faCakeCandles,
  faBirthdayCake,
  faCake,
  faEnvelope,
  faAnglesUp,
  faAngleDoubleUp,
  faPaperclip,
  faArrowRightToCity,
  faRibbon,
  faLungs,
  faArrowUp91,
  faSortNumericUpAlt,
  faLitecoinSign,
  faBorderNone,
  faCircleNodes,
  faParachuteBox,
  faIndent,
  faTruckFieldUn,
  faHourglass,
  faHourglassEmpty,
  faMountain,
  faUserDoctor,
  faUserMd,
  faCircleInfo,
  faInfoCircle,
  faCloudMeatball,
  faCamera,
  faCameraAlt,
  faSquareVirus,
  faMeteor,
  faCarOn,
  faSleigh,
  faArrowDown19,
  faSortNumericAsc,
  faSortNumericDown,
  faHandHoldingDroplet,
  faHandHoldingWater,
  faWater,
  faCalendarCheck,
  faBraille,
  faPrescriptionBottleMedical,
  faPrescriptionBottleAlt,
  faLandmark,
  faTruck,
  faCrosshairs,
  faPersonCane,
  faTent,
  faVestPatches,
  faCheckDouble,
  faArrowDownAZ,
  faSortAlphaAsc,
  faSortAlphaDown,
  faMoneyBillWheat,
  faCookie,
  faArrowRotateLeft,
  faArrowLeftRotate,
  faArrowRotateBack,
  faArrowRotateBackward,
  faUndo,
  faHardDrive,
  faHdd,
  faFaceGrinSquintTears,
  faGrinSquintTears,
  faDumbbell,
  faRectangleList,
  faListAlt,
  faTarpDroplet,
  faHouseMedicalCircleCheck,
  faPersonSkiingNordic,
  faSkiingNordic,
  faCalendarPlus,
  faPlaneArrival,
  faCircleLeft,
  faArrowAltCircleLeft,
  faTrainSubway,
  faSubway,
  faChartGantt,
  faIndianRupeeSign,
  faIndianRupee,
  faInr,
  faCropSimple,
  faCropAlt,
  faMoneyBill1,
  faMoneyBillAlt,
  faLeftLong,
  faLongArrowAltLeft,
  faDna,
  faVirusSlash,
  faMinus,
  faSubtract,
  faChess,
  faArrowLeftLong,
  faLongArrowLeft,
  faPlugCircleCheck,
  faStreetView,
  faFrancSign,
  faVolumeOff,
  faHandsAslInterpreting,
  faAmericanSignLanguageInterpreting,
  faAslInterpreting,
  faHandsAmericanSignLanguageInterpreting,
  faGear,
  faCog,
  faDropletSlash,
  faTintSlash,
  faMosque,
  faMosquito,
  faStarOfDavid,
  faPersonMilitaryRifle,
  faCartShopping,
  faShoppingCart,
  faVials,
  faPlugCirclePlus,
  faPlaceOfWorship,
  faGripVertical,
  faHexagonNodes,
  faArrowTurnUp,
  faLevelUp,
  faU,
  faSquareRootVariable,
  faSquareRootAlt,
  faClock,
  faClockFour,
  faBackwardStep,
  faStepBackward,
  faPallet,
  faFaucet,
  faBaseballBatBall,
  faS,
  faTimeline,
  faKeyboard,
  faCaretDown,
  faHouseChimneyMedical,
  faClinicMedical,
  faTemperatureThreeQuarters,
  faTemperature3,
  faThermometer3,
  faThermometerThreeQuarters,
  faMobileScreen,
  faMobileAndroidAlt,
  faPlaneUp,
  faPiggyBank,
  faBatteryHalf,
  faBattery3,
  faMountainCity,
  faCoins,
  faKhanda,
  faSliders,
  faSlidersH,
  faFolderTree,
  faNetworkWired,
  faMapPin,
  faHamsa,
  faCentSign,
  faFlask,
  faPersonPregnant,
  faWandSparkles,
  faEllipsisVertical,
  faEllipsisV,
  faTicket,
  faPowerOff,
  faRightLong,
  faLongArrowAltRight,
  faFlagUsa,
  faLaptopFile,
  faTty,
  faTeletype,
  faDiagramNext,
  faPersonRifle,
  faHouseMedicalCircleExclamation,
  faClosedCaptioning,
  faPersonHiking,
  faHiking,
  faVenusDouble,
  faImages,
  faCalculator,
  faPeoplePulling,
  faN,
  faCableCar,
  faTram,
  faCloudRain,
  faBuildingCircleXmark,
  faShip,
  faArrowsDownToLine,
  faDownload,
  faFaceGrin,
  faGrin,
  faDeleteLeft,
  faBackspace,
  faEyeDropper,
  faEyeDropperEmpty,
  faEyedropper,
  faFileCircleCheck,
  faForward,
  faMobile,
  faMobileAndroid,
  faMobilePhone,
  faFaceMeh,
  faMeh,
  faAlignCenter,
  faBookSkull,
  faBookDead,
  faIdCard,
  faDriversLicense,
  faOutdent,
  faDedent,
  faHeartCircleExclamation,
  faHouse,
  faHome,
  faHomeAlt,
  faHomeLgAlt,
  faCalendarWeek,
  faLaptopMedical,
  faB,
  faFileMedical,
  faDiceOne,
  faKiwiBird,
  faArrowRightArrowLeft,
  faExchange,
  faRotateRight,
  faRedoAlt,
  faRotateForward,
  faUtensils,
  faCutlery,
  faArrowUpWideShort,
  faSortAmountUp,
  faMillSign,
  faBowlRice,
  faSkull,
  faTowerBroadcast,
  faBroadcastTower,
  faTruckPickup,
  faUpLong,
  faLongArrowAltUp,
  faStop,
  faCodeMerge,
  faUpload,
  faHurricane,
  faMound,
  faToiletPortable,
  faCompactDisc,
  faFileArrowDown,
  faFileDownload,
  faCaravan,
  faShieldCat,
  faBolt,
  faZap,
  faGlassWater,
  faOilWell,
  faVault,
  faMars,
  faToilet,
  faPlaneCircleXmark,
  faYenSign,
  faCny,
  faJpy,
  faRmb,
  faYen,
  faRubleSign,
  faRouble,
  faRub,
  faRuble,
  faSun,
  faGuitar,
  faFaceLaughWink,
  faLaughWink,
  faHorseHead,
  faBoreHole,
  faIndustry,
  faCircleDown,
  faArrowAltCircleDown,
  faArrowsTurnToDots,
  faFlorinSign,
  faArrowDownShortWide,
  faSortAmountDesc,
  faSortAmountDownAlt,
  faLessThan,
  faAngleDown,
  faCarTunnel,
  faHeadSideCough,
  faGripLines,
  faThumbsDown,
  faUserLock,
  faArrowRightLong,
  faLongArrowRight,
  faAnchorCircleXmark,
  faEllipsis,
  faEllipsisH,
  faChessPawn,
  faKitMedical,
  faFirstAid,
  faPersonThroughWindow,
  faToolbox,
  faHandsHoldingCircle,
  faBug,
  faCreditCard,
  faCreditCardAlt,
  faCar,
  faAutomobile,
  faHandHoldingHand,
  faBookOpenReader,
  faBookReader,
  faMountainSun,
  faArrowsLeftRightToLine,
  faDiceD20,
  faTruckDroplet,
  faFileCircleXmark,
  faTemperatureArrowUp,
  faTemperatureUp,
  faMedal,
  faBed,
  faSquareH,
  faHSquare,
  faPodcast,
  faTemperatureFull,
  faTemperature4,
  faThermometer4,
  faThermometerFull,
  faBell,
  faSuperscript,
  faPlugCircleXmark,
  faStarOfLife,
  faPhoneSlash,
  faPaintRoller,
  faHandshakeAngle,
  faHandsHelping,
  faLocationDot,
  faMapMarkerAlt,
  faFile,
  faGreaterThan,
  faPersonSwimming,
  faSwimmer,
  faArrowDown,
  faDroplet,
  faTint,
  faEraser,
  faEarthAmericas,
  faEarth,
  faEarthAmerica,
  faGlobeAmericas,
  faPersonBurst,
  faDove,
  faBatteryEmpty,
  faBattery0,
  faSocks,
  faInbox,
  faSection,
  faGaugeHigh,
  faTachometerAlt,
  faTachometerAltFast,
  faEnvelopeOpenText,
  faHospital,
  faHospitalAlt,
  faHospitalWide,
  faWineBottle,
  faChessRook,
  faBarsStaggered,
  faReorder,
  faStream,
  faDharmachakra,
  faHotdog,
  faPersonWalkingWithCane,
  faBlind,
  faDrum,
  faIceCream,
  faHeartCircleBolt,
  faFax,
  faParagraph,
  faCheckToSlot,
  faVoteYea,
  faStarHalf,
  faBoxesStacked,
  faBoxes,
  faBoxesAlt,
  faLink,
  faChain,
  faEarListen,
  faAssistiveListeningSystems,
  faTreeCity,
  faPlay,
  faFont,
  faTableCellsRowLock,
  faRupiahSign,
  faMagnifyingGlass,
  faSearch,
  faTableTennisPaddleBall,
  faPingPongPaddleBall,
  faTableTennis,
  faPersonDotsFromLine,
  faDiagnoses,
  faTrashCanArrowUp,
  faTrashRestoreAlt,
  faNairaSign,
  faCartArrowDown,
  faWalkieTalkie,
  faFilePen,
  faFileEdit,
  faReceipt,
  faSquarePen,
  faPenSquare,
  faPencilSquare,
  faSuitcaseRolling,
  faPersonCircleExclamation,
  faChevronDown,
  faBatteryFull,
  faBattery,
  faBattery5,
  faSkullCrossbones,
  faCodeCompare,
  faListUl,
  faListDots,
  faSchoolLock,
  faTowerCell,
  faDownLong,
  faLongArrowAltDown,
  faRankingStar,
  faChessKing,
  faPersonHarassing,
  faBrazilianRealSign,
  faLandmarkDome,
  faLandmarkAlt,
  faArrowUp,
  faTv,
  faTelevision,
  faTvAlt,
  faShrimp,
  faListCheck,
  faTasks,
  faJugDetergent,
  faCircleUser,
  faUserCircle,
  faUserShield,
  faWind,
  faCarBurst,
  faCarCrash,
  faY,
  faPersonSnowboarding,
  faSnowboarding,
  faTruckFast,
  faShippingFast,
  faFish,
  faUserGraduate,
  faCircleHalfStroke,
  faAdjust,
  faClapperboard,
  faCircleRadiation,
  faRadiationAlt,
  faBaseball,
  faBaseballBall,
  faJetFighterUp,
  faDiagramProject,
  faProjectDiagram,
  faCopy,
  faVolumeXmark,
  faVolumeMute,
  faVolumeTimes,
  faHandSparkles,
  faGrip,
  faGripHorizontal,
  faShareFromSquare,
  faShareSquare,
  faChildCombatant,
  faChildRifle,
  faGun,
  faSquarePhone,
  faPhoneSquare,
  faPlus,
  faAdd,
  faExpand,
  faComputer,
  faXmark,
  faClose,
  faMultiply,
  faRemove,
  faTimes,
  faArrowsUpDownLeftRight,
  faArrows,
  faChalkboardUser,
  faChalkboardTeacher,
  faPesoSign,
  faBuildingShield,
  faBaby,
  faUsersLine,
  faQuoteLeft,
  faQuoteLeftAlt,
  faTractor,
  faTrashArrowUp,
  faTrashRestore,
  faArrowDownUpLock,
  faLinesLeaning,
  faRulerCombined,
  faCopyright,
  faEquals,
  faBlender,
  faTeeth,
  faShekelSign,
  faIls,
  faShekel,
  faSheqel,
  faSheqelSign,
  faMap,
  faRocket,
  faPhotoFilm,
  faPhotoVideo,
  faFolderMinus,
  faHexagonNodesBolt,
  faStore,
  faArrowTrendUp,
  faPlugCircleMinus,
  faSignHanging,
  faSign,
  faBezierCurve,
  faBellSlash,
  faTablet,
  faTabletAndroid,
  faSchoolFlag,
  faFill,
  faAngleUp,
  faDrumstickBite,
  faHollyBerry,
  faChevronLeft,
  faBacteria,
  faHandLizard,
  faNotdef,
  faDisease,
  faBriefcaseMedical,
  faGenderless,
  faChevronRight,
  faRetweet,
  faCarRear,
  faCarAlt,
  faPumpSoap,
  faVideoSlash,
  faBatteryQuarter,
  faBattery2,
  faRadio,
  faBabyCarriage,
  faCarriageBaby,
  faTrafficLight,
  faThermometer,
  faVrCardboard,
  faHandMiddleFinger,
  faPercent,
  faPercentage,
  faTruckMoving,
  faGlassWaterDroplet,
  faDisplay,
  faFaceSmile,
  faSmile,
  faThumbtack,
  faThumbTack,
  faTrophy,
  faPersonPraying,
  faPray,
  faHammer,
  faHandPeace,
  faRotate,
  faSyncAlt,
  faSpinner,
  faRobot,
  faPeace,
  faGears,
  faCogs,
  faWarehouse,
  faArrowUpRightDots,
  faSplotch,
  faFaceGrinHearts,
  faGrinHearts,
  faDiceFour,
  faSimCard,
  faTransgender,
  faTransgenderAlt,
  faMercury,
  faArrowTurnDown,
  faLevelDown,
  faPersonFallingBurst,
  faAward,
  faTicketSimple,
  faTicketAlt,
  faBuilding,
  faAnglesLeft,
  faAngleDoubleLeft,
  faQrcode,
  faClockRotateLeft,
  faHistory,
  faFaceGrinBeamSweat,
  faGrinBeamSweat,
  faFileExport,
  faArrowRightFromFile,
  faShield,
  faShieldBlank,
  faArrowUpShortWide,
  faSortAmountUpAlt,
  faCommentNodes,
  faHouseMedical,
  faGolfBallTee,
  faGolfBall,
  faCircleChevronLeft,
  faChevronCircleLeft,
  faHouseChimneyWindow,
  faPenNib,
  faTentArrowTurnLeft,
  faTents,
  faWandMagic,
  faMagic,
  faDog,
  faCarrot,
  faMoon,
  faWineGlassEmpty,
  faWineGlassAlt,
  faCheese,
  faYinYang,
  faMusic,
  faCodeCommit,
  faTemperatureLow,
  faPersonBiking,
  faBiking,
  faBroom,
  faShieldHeart,
  faGopuram,
  faEarthOceania,
  faGlobeOceania,
  faSquareXmark,
  faTimesSquare,
  faXmarkSquare,
  faHashtag,
  faUpRightAndDownLeftFromCenter,
  faExpandAlt,
  faOilCan,
  faT,
  faHippo,
  faChartColumn,
  faInfinity,
  faVialCircleCheck,
  faPersonArrowDownToLine,
  faVoicemail,
  faFan,
  faPersonWalkingLuggage,
  faUpDown,
  faArrowsAltV,
  faCloudMoonRain,
  faCalendar,
  faTrailer,
  faBahai,
  faHaykal,
  faSdCard,
  faDragon,
  faShoePrints,
  faCirclePlus,
  faPlusCircle,
  faFaceGrinTongueWink,
  faGrinTongueWink,
  faHandHolding,
  faPlugCircleExclamation,
  faLinkSlash,
  faChainBroken,
  faChainSlash,
  faUnlink,
  faClone,
  faPersonWalkingArrowLoopLeft,
  faArrowUpZA,
  faSortAlphaUpAlt,
  faFireFlameCurved,
  faFireAlt,
  faTornado,
  faFileCirclePlus,
  faBookQuran,
  faQuran,
  faAnchor,
  faBorderAll,
  faFaceAngry,
  faAngry,
  faCookieBite,
  faArrowTrendDown,
  faRss,
  faFeed,
  faDrawPolygon,
  faScaleBalanced,
  faBalanceScale,
  faGaugeSimpleHigh,
  faTachometer,
  faTachometerFast,
  faShower,
  faDesktop,
  faDesktopAlt,
  faM,
  faTableList,
  faThList,
  faCommentSms,
  faSms,
  faBook,
  faUserPlus,
  faCheck,
  faBatteryThreeQuarters,
  faBattery4,
  faHouseCircleCheck,
  faAngleLeft,
  faDiagramSuccessor,
  faTruckArrowRight,
  faArrowsSplitUpAndLeft,
  faHandFist,
  faFistRaised,
  faCloudMoon,
  faBriefcase,
  faPersonFalling,
  faImagePortrait,
  faPortrait,
  faUserTag,
  faRug,
  faEarthEurope,
  faGlobeEurope,
  faCartFlatbedSuitcase,
  faLuggageCart,
  faRectangleXmark,
  faRectangleTimes,
  faTimesRectangle,
  faWindowClose,
  faBahtSign,
  faBookOpen,
  faBookJournalWhills,
  faJournalWhills,
  faHandcuffs,
  faTriangleExclamation,
  faExclamationTriangle,
  faWarning,
  faDatabase,
  faShare,
  faMailForward,
  faBottleDroplet,
  faMaskFace,
  faHillRockslide,
  faRightLeft,
  faExchangeAlt,
  faPaperPlane,
  faRoadCircleExclamation,
  faDungeon,
  faAlignRight,
  faMoneyBill1Wave,
  faMoneyBillWaveAlt,
  faLifeRing,
  faHands,
  faSignLanguage,
  faSigning,
  faCalendarDay,
  faWaterLadder,
  faLadderWater,
  faSwimmingPool,
  faArrowsUpDown,
  faArrowsV,
  faFaceGrimace,
  faGrimace,
  faWheelchairMove,
  faWheelchairAlt,
  faTurnDown,
  faLevelDownAlt,
  faPersonWalkingArrowRight,
  faSquareEnvelope,
  faEnvelopeSquare,
  faDice,
  faBowlingBall,
  faBrain,
  faBandage,
  faBandAid,
  faCalendarMinus,
  faCircleXmark,
  faTimesCircle,
  faXmarkCircle,
  faGifts,
  faHotel,
  faEarthAsia,
  faGlobeAsia,
  faIdCardClip,
  faIdCardAlt,
  faMagnifyingGlassPlus,
  faSearchPlus,
  faThumbsUp,
  faUserClock,
  faHandDots,
  faAllergies,
  faFileInvoice,
  faWindowMinimize,
  faMugSaucer,
  faCoffee,
  faBrush,
  faFileHalfDashed,
  faMask,
  faMagnifyingGlassMinus,
  faSearchMinus,
  faRulerVertical,
  faUserLarge,
  faUserAlt,
  faTrainTram,
  faUserNurse,
  faSyringe,
  faCloudSun,
  faStopwatch20,
  faSquareFull,
  faMagnet,
  faJar,
  faNoteSticky,
  faStickyNote,
  faBugSlash,
  faArrowUpFromWaterPump,
  faBone,
  faTableCellsRowUnlock,
  faUserInjured,
  faFaceSadTear,
  faSadTear,
  faPlane,
  faTentArrowsDown,
  faExclamation,
  faArrowsSpin,
  faPrint,
  faTurkishLiraSign,
  faTry,
  faTurkishLira,
  faDollarSign,
  faDollar,
  faUsd,
  faX,
  faMagnifyingGlassDollar,
  faSearchDollar,
  faUsersGear,
  faUsersCog,
  faPersonMilitaryPointing,
  faBuildingColumns,
  faBank,
  faInstitution,
  faMuseum,
  faUniversity,
  faUmbrella,
  faTrowel,
  faD,
  faStapler,
  faMasksTheater,
  faTheaterMasks,
  faKipSign,
  faHandPointLeft,
  faHandshakeSimple,
  faHandshakeAlt,
  faJetFighter,
  faFighterJet,
  faSquareShareNodes,
  faShareAltSquare,
  faBarcode,
  faPlusMinus,
  faVideo,
  faVideoCamera,
  faGraduationCap,
  faMortarBoard,
  faHandHoldingMedical,
  faPersonCircleCheck,
  faTurnUp,
  faLevelUpAlt
};




/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __nested_webpack_require_4799229__(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] = {
/******/ 			id: moduleId,
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_4799229__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__nested_webpack_require_4799229__.m = __webpack_modules__;
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__nested_webpack_require_4799229__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__nested_webpack_require_4799229__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__nested_webpack_require_4799229__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__nested_webpack_require_4799229__.o(definition, key) && !__nested_webpack_require_4799229__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	(() => {
/******/ 		__nested_webpack_require_4799229__.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 */
/******/ 	(() => {
/******/ 		__nested_webpack_require_4799229__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__nested_webpack_require_4799229__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/jsonp chunk loading */
/******/ 	(() => {
/******/ 		__nested_webpack_require_4799229__.b = document.baseURI || self.location.href;
/******/ 		
/******/ 		// object to store loaded and loading chunks
/******/ 		// undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ 		// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ 		var installedChunks = {
/******/ 			"main": 0
/******/ 		};
/******/ 		
/******/ 		// no chunk on demand loading
/******/ 		
/******/ 		// no prefetching
/******/ 		
/******/ 		// no preloaded
/******/ 		
/******/ 		// no HMR
/******/ 		
/******/ 		// no HMR manifest
/******/ 		
/******/ 		// no on chunks loaded
/******/ 		
/******/ 		// no jsonp function
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/nonce */
/******/ 	(() => {
/******/ 		__nested_webpack_require_4799229__.nc = undefined;
/******/ 	})();
/******/ 	
/************************************************************************/
var __nested_webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
/*!**********************!*\
  !*** ./src/index.ts ***!
  \**********************/
__nested_webpack_require_4799229__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_4799229__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   inspector: () => (/* reexport module object */ inspector_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__)
/* harmony export */ });
/* harmony import */ var inspector_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_4799229__(/*! inspector/legacy/legacy */ "../../../dev/inspector/dist/legacy/legacy.js");


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

})();

__nested_webpack_exports__ = __nested_webpack_exports__["default"];
/******/ 	return __nested_webpack_exports__;
/******/ })()
;
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64, 

/***/ }),

/***/ 99451:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   G: () => (/* binding */ AbstractActionManager)
/* harmony export */ });

/**
 * Abstract class used to decouple action Manager from scene and meshes.
 * Do not instantiate.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class AbstractActionManager {
    constructor() {
        /** Gets the cursor to use when hovering items */
        this.hoverCursor = "";
        /** Gets the list of actions */
        this.actions = [];
        /**
         * Gets or sets a boolean indicating that the manager is recursive meaning that it can trigger action from children
         */
        this.isRecursive = false;
        /**
         * Gets or sets a boolean indicating if this ActionManager should be disposed once the last Mesh using it is disposed
         */
        this.disposeWhenUnowned = true;
    }
    /**
     * Does exist one action manager with at least one trigger
     **/
    static get HasTriggers() {
        for (const t in AbstractActionManager.Triggers) {
            if (Object.prototype.hasOwnProperty.call(AbstractActionManager.Triggers, t)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Does exist one action manager with at least one pick trigger
     **/
    static get HasPickTriggers() {
        for (const t in AbstractActionManager.Triggers) {
            if (Object.prototype.hasOwnProperty.call(AbstractActionManager.Triggers, t)) {
                const tAsInt = parseInt(t);
                if (tAsInt >= 1 && tAsInt <= 7) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Does exist one action manager that handles actions of a given trigger
     * @param trigger defines the trigger to be tested
     * @returns a boolean indicating whether the trigger is handled by at least one action manager
     **/
    static HasSpecificTrigger(trigger) {
        for (const t in AbstractActionManager.Triggers) {
            if (Object.prototype.hasOwnProperty.call(AbstractActionManager.Triggers, t)) {
                const tAsInt = parseInt(t);
                if (tAsInt === trigger) {
                    return true;
                }
            }
        }
        return false;
    }
}
/** Gets the list of active triggers */
AbstractActionManager.Triggers = {};
//# sourceMappingURL=abstractActionManager.js.map

/***/ }),

/***/ 61466:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   X: () => (/* binding */ ActionEvent)
/* harmony export */ });
/**
 * ActionEvent is the event being sent when an action is triggered.
 */
class ActionEvent {
    /**
     * Creates a new ActionEvent
     * @param source The mesh or sprite that triggered the action
     * @param pointerX The X mouse cursor position at the time of the event
     * @param pointerY The Y mouse cursor position at the time of the event
     * @param meshUnderPointer The mesh that is currently pointed at (can be null)
     * @param sourceEvent the original (browser) event that triggered the ActionEvent
     * @param additionalData additional data for the event
     */
    constructor(
    /** The mesh or sprite that triggered the action */
    source, 
    /** The X mouse cursor position at the time of the event */
    pointerX, 
    /** The Y mouse cursor position at the time of the event */
    pointerY, 
    /** The mesh that is currently pointed at (can be null) */
    meshUnderPointer, 
    /** the original (browser) event that triggered the ActionEvent */
    sourceEvent, 
    /** additional data for the event */
    additionalData) {
        this.source = source;
        this.pointerX = pointerX;
        this.pointerY = pointerY;
        this.meshUnderPointer = meshUnderPointer;
        this.sourceEvent = sourceEvent;
        this.additionalData = additionalData;
    }
    /**
     * Helper function to auto-create an ActionEvent from a source mesh.
     * @param source The source mesh that triggered the event
     * @param evt The original (browser) event
     * @param additionalData additional data for the event
     * @returns the new ActionEvent
     */
    static CreateNew(source, evt, additionalData) {
        const scene = source.getScene();
        return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer || source, evt, additionalData);
    }
    /**
     * Helper function to auto-create an ActionEvent from a source sprite
     * @param source The source sprite that triggered the event
     * @param scene Scene associated with the sprite
     * @param evt The original (browser) event
     * @param additionalData additional data for the event
     * @returns the new ActionEvent
     */
    static CreateNewFromSprite(source, scene, evt, additionalData) {
        return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt, additionalData);
    }
    /**
     * Helper function to auto-create an ActionEvent from a scene. If triggered by a mesh use ActionEvent.CreateNew
     * @param scene the scene where the event occurred
     * @param evt The original (browser) event
     * @returns the new ActionEvent
     */
    static CreateNewFromScene(scene, evt) {
        return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt);
    }
    /**
     * Helper function to auto-create an ActionEvent from a primitive
     * @param prim defines the target primitive
     * @param pointerPos defines the pointer position
     * @param evt The original (browser) event
     * @param additionalData additional data for the event
     * @returns the new ActionEvent
     */
    static CreateNewFromPrimitive(prim, pointerPos, evt, additionalData) {
        return new ActionEvent(prim, pointerPos.x, pointerPos.y, null, evt, additionalData);
    }
}
//# sourceMappingURL=actionEvent.js.map

/***/ }),

/***/ 6903:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  SM: () => (/* reexport */ AddAnimationExtensions),
  rT: () => (/* reexport */ Animatable),
  BT: () => (/* reexport */ RegisterTargetForLateAnimationBinding)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Bones/bone.js
var bone = __webpack_require__(36504);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__(99848);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/runtimeAnimation.js
var runtimeAnimation = __webpack_require__(27266);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animation.js
var animation = __webpack_require__(7540);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/precisionDate.js
var precisionDate = __webpack_require__(76237);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__(79923);
;// ./node_modules/@babylonjs/core/Animations/animatable.core.js





/**
 * Class used to store an actual running animation
 */
class Animatable {
    /**
     * Gets the root Animatable used to synchronize and normalize animations
     */
    get syncRoot() {
        return this._syncRoot;
    }
    /**
     * Gets the current frame of the first RuntimeAnimation
     * Used to synchronize Animatables
     */
    get masterFrame() {
        if (this._runtimeAnimations.length === 0) {
            return 0;
        }
        return this._runtimeAnimations[0].currentFrame;
    }
    /**
     * Gets or sets the animatable weight (-1.0 by default meaning not weighted)
     */
    get weight() {
        return this._weight;
    }
    set weight(value) {
        if (value === -1) {
            // -1 is ok and means no weight
            this._weight = -1;
            return;
        }
        // Else weight must be in [0, 1] range
        this._weight = Math.min(Math.max(value, 0), 1.0);
    }
    /**
     * Gets or sets the speed ratio to apply to the animatable (1.0 by default)
     */
    get speedRatio() {
        return this._speedRatio;
    }
    set speedRatio(value) {
        for (let index = 0; index < this._runtimeAnimations.length; index++) {
            const animation = this._runtimeAnimations[index];
            animation._prepareForSpeedRatioChange(value);
        }
        this._speedRatio = value;
        // Resync _manualJumpDelay in case goToFrame was called before speedRatio was set.
        if (this._goToFrame !== null) {
            this.goToFrame(this._goToFrame);
        }
    }
    /**
     * Gets the elapsed time since the animatable started in milliseconds
     */
    get elapsedTime() {
        return this._localDelayOffset === null ? 0 : this._scene._animationTime - this._localDelayOffset;
    }
    /**
     * Creates a new Animatable
     * @param scene defines the hosting scene
     * @param target defines the target object
     * @param fromFrame defines the starting frame number (default is 0)
     * @param toFrame defines the ending frame number (default is 100)
     * @param loopAnimation defines if the animation must loop (default is false)
     * @param speedRatio defines the factor to apply to animation speed (default is 1)
     * @param onAnimationEnd defines a callback to call when animation ends if it is not looping
     * @param animations defines a group of animation to add to the new Animatable
     * @param onAnimationLoop defines a callback to call when animation loops
     * @param isAdditive defines whether the animation should be evaluated additively
     * @param playOrder defines the order in which this animatable should be processed in the list of active animatables (default: 0)
     */
    constructor(scene, 
    /** defines the target object */
    target, 
    /** [0] defines the starting frame number (default is 0) */
    fromFrame = 0, 
    /** [100] defines the ending frame number (default is 100) */
    toFrame = 100, 
    /** [false] defines if the animation must loop (default is false)  */
    loopAnimation = false, speedRatio = 1.0, 
    /** defines a callback to call when animation ends if it is not looping */
    onAnimationEnd, animations, 
    /** defines a callback to call when animation loops */
    onAnimationLoop, 
    /** [false] defines whether the animation should be evaluated additively */
    isAdditive = false, 
    /** [0] defines the order in which this animatable should be processed in the list of active animatables (default: 0) */
    playOrder = 0) {
        this.target = target;
        this.fromFrame = fromFrame;
        this.toFrame = toFrame;
        this.loopAnimation = loopAnimation;
        this.onAnimationEnd = onAnimationEnd;
        this.onAnimationLoop = onAnimationLoop;
        this.isAdditive = isAdditive;
        this.playOrder = playOrder;
        this._localDelayOffset = null;
        this._pausedDelay = null;
        this._manualJumpDelay = null;
        /** @hidden */
        this._runtimeAnimations = new Array();
        this._paused = false;
        this._speedRatio = 1;
        this._weight = -1.0;
        this._syncRoot = null;
        this._frameToSyncFromJump = null;
        this._goToFrame = null;
        /**
         * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation.
         * This will only apply for non looping animation (default is true)
         */
        this.disposeOnEnd = true;
        /**
         * Gets a boolean indicating if the animation has started
         */
        this.animationStarted = false;
        /**
         * Observer raised when the animation ends
         */
        this.onAnimationEndObservable = new observable/* Observable */.cP();
        /**
         * Observer raised when the animation loops
         */
        this.onAnimationLoopObservable = new observable/* Observable */.cP();
        this._scene = scene;
        if (animations) {
            this.appendAnimations(target, animations);
        }
        this._speedRatio = speedRatio;
        scene._activeAnimatables.push(this);
    }
    // Methods
    /**
     * Synchronize and normalize current Animatable with a source Animatable
     * This is useful when using animation weights and when animations are not of the same length
     * @param root defines the root Animatable to synchronize with (null to stop synchronizing)
     * @returns the current Animatable
     */
    syncWith(root) {
        this._syncRoot = root;
        if (root) {
            // Make sure this animatable will animate after the root
            const index = this._scene._activeAnimatables.indexOf(this);
            if (index > -1) {
                this._scene._activeAnimatables.splice(index, 1);
                this._scene._activeAnimatables.push(this);
            }
        }
        return this;
    }
    /**
     * Gets the list of runtime animations
     * @returns an array of RuntimeAnimation
     */
    getAnimations() {
        return this._runtimeAnimations;
    }
    /**
     * Adds more animations to the current animatable
     * @param target defines the target of the animations
     * @param animations defines the new animations to add
     */
    appendAnimations(target, animations) {
        for (let index = 0; index < animations.length; index++) {
            const animation = animations[index];
            const newRuntimeAnimation = new runtimeAnimation/* RuntimeAnimation */.x(target, animation, this._scene, this);
            newRuntimeAnimation._onLoop = () => {
                this.onAnimationLoopObservable.notifyObservers(this);
                if (this.onAnimationLoop) {
                    this.onAnimationLoop();
                }
            };
            this._runtimeAnimations.push(newRuntimeAnimation);
        }
    }
    /**
     * Gets the source animation for a specific property
     * @param property defines the property to look for
     * @returns null or the source animation for the given property
     */
    getAnimationByTargetProperty(property) {
        const runtimeAnimations = this._runtimeAnimations;
        for (let index = 0; index < runtimeAnimations.length; index++) {
            if (runtimeAnimations[index].animation.targetProperty === property) {
                return runtimeAnimations[index].animation;
            }
        }
        return null;
    }
    /**
     * Gets the runtime animation for a specific property
     * @param property defines the property to look for
     * @returns null or the runtime animation for the given property
     */
    getRuntimeAnimationByTargetProperty(property) {
        const runtimeAnimations = this._runtimeAnimations;
        for (let index = 0; index < runtimeAnimations.length; index++) {
            if (runtimeAnimations[index].animation.targetProperty === property) {
                return runtimeAnimations[index];
            }
        }
        return null;
    }
    /**
     * Resets the animatable to its original state
     */
    reset() {
        const runtimeAnimations = this._runtimeAnimations;
        for (let index = 0; index < runtimeAnimations.length; index++) {
            runtimeAnimations[index].reset(true);
        }
        this._localDelayOffset = null;
        this._pausedDelay = null;
    }
    /**
     * Allows the animatable to blend with current running animations
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending
     * @param blendingSpeed defines the blending speed to use
     */
    enableBlending(blendingSpeed) {
        const runtimeAnimations = this._runtimeAnimations;
        for (let index = 0; index < runtimeAnimations.length; index++) {
            runtimeAnimations[index].animation.enableBlending = true;
            runtimeAnimations[index].animation.blendingSpeed = blendingSpeed;
        }
    }
    /**
     * Disable animation blending
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending
     */
    disableBlending() {
        const runtimeAnimations = this._runtimeAnimations;
        for (let index = 0; index < runtimeAnimations.length; index++) {
            runtimeAnimations[index].animation.enableBlending = false;
        }
    }
    /**
     * Jump directly to a given frame
     * @param frame defines the frame to jump to
     * @param useWeight defines whether the animation weight should be applied to the image to be jumped to (false by default)
     */
    goToFrame(frame, useWeight = false) {
        const runtimeAnimations = this._runtimeAnimations;
        if (runtimeAnimations[0]) {
            const fps = runtimeAnimations[0].animation.framePerSecond;
            this._frameToSyncFromJump = this._frameToSyncFromJump ?? runtimeAnimations[0].currentFrame;
            const delay = this.speedRatio === 0 ? 0 : (((frame - this._frameToSyncFromJump) / fps) * 1000) / this.speedRatio;
            this._manualJumpDelay = -delay;
        }
        for (let index = 0; index < runtimeAnimations.length; index++) {
            runtimeAnimations[index].goToFrame(frame, useWeight ? this._weight : -1);
        }
        this._goToFrame = frame;
    }
    /**
     * Returns true if the animations for this animatable are paused
     */
    get paused() {
        return this._paused;
    }
    /**
     * Pause the animation
     */
    pause() {
        if (this._paused) {
            return;
        }
        this._paused = true;
    }
    /**
     * Restart the animation
     */
    restart() {
        this._paused = false;
    }
    _raiseOnAnimationEnd() {
        if (this.onAnimationEnd) {
            this.onAnimationEnd();
        }
        this.onAnimationEndObservable.notifyObservers(this);
    }
    /**
     * Stop and delete the current animation
     * @param animationName defines a string used to only stop some of the runtime animations instead of all
     * @param targetMask a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)
     * @param useGlobalSplice if true, the animatables will be removed by the caller of this function (false by default)
     * @param skipOnAnimationEnd defines if the system should not raise onAnimationEnd. Default is false
     */
    stop(animationName, targetMask, useGlobalSplice = false, skipOnAnimationEnd = false) {
        if (animationName || targetMask) {
            const idx = this._scene._activeAnimatables.indexOf(this);
            if (idx > -1) {
                const runtimeAnimations = this._runtimeAnimations;
                for (let index = runtimeAnimations.length - 1; index >= 0; index--) {
                    const runtimeAnimation = runtimeAnimations[index];
                    if (animationName && runtimeAnimation.animation.name != animationName) {
                        continue;
                    }
                    if (targetMask && !targetMask(runtimeAnimation.target)) {
                        continue;
                    }
                    runtimeAnimation.dispose();
                    runtimeAnimations.splice(index, 1);
                }
                if (runtimeAnimations.length == 0) {
                    if (!useGlobalSplice) {
                        this._scene._activeAnimatables.splice(idx, 1);
                    }
                    if (!skipOnAnimationEnd) {
                        this._raiseOnAnimationEnd();
                    }
                }
            }
        }
        else {
            const index = this._scene._activeAnimatables.indexOf(this);
            if (index > -1) {
                if (!useGlobalSplice) {
                    this._scene._activeAnimatables.splice(index, 1);
                }
                const runtimeAnimations = this._runtimeAnimations;
                for (let index = 0; index < runtimeAnimations.length; index++) {
                    runtimeAnimations[index].dispose();
                }
                this._runtimeAnimations.length = 0;
                if (!skipOnAnimationEnd) {
                    this._raiseOnAnimationEnd();
                }
            }
        }
    }
    /**
     * Wait asynchronously for the animation to end
     * @returns a promise which will be fulfilled when the animation ends
     */
    waitAsync() {
        return new Promise((resolve) => {
            this.onAnimationEndObservable.add(() => {
                resolve(this);
            }, undefined, undefined, this, true);
        });
    }
    /**
     * @internal
     */
    _animate(delay) {
        if (this._paused) {
            this.animationStarted = false;
            if (this._pausedDelay === null) {
                this._pausedDelay = delay;
            }
            return true;
        }
        if (this._localDelayOffset === null) {
            this._localDelayOffset = delay;
            this._pausedDelay = null;
        }
        else if (this._pausedDelay !== null) {
            this._localDelayOffset += delay - this._pausedDelay;
            this._pausedDelay = null;
        }
        if (this._manualJumpDelay !== null) {
            this._localDelayOffset += this._manualJumpDelay;
            this._manualJumpDelay = null;
            this._frameToSyncFromJump = null;
        }
        this._goToFrame = null;
        if (this._weight === 0) {
            // We consider that an animatable with a weight === 0 is "actively" paused
            return true;
        }
        // Animating
        let running = false;
        const runtimeAnimations = this._runtimeAnimations;
        let index;
        for (index = 0; index < runtimeAnimations.length; index++) {
            const animation = runtimeAnimations[index];
            const isRunning = animation.animate(delay - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio, this._weight);
            running = running || isRunning;
        }
        this.animationStarted = running;
        if (!running) {
            if (this.disposeOnEnd) {
                // Remove from active animatables
                index = this._scene._activeAnimatables.indexOf(this);
                this._scene._activeAnimatables.splice(index, 1);
                // Dispose all runtime animations
                for (index = 0; index < runtimeAnimations.length; index++) {
                    runtimeAnimations[index].dispose();
                }
            }
            this._raiseOnAnimationEnd();
            if (this.disposeOnEnd) {
                this.onAnimationEnd = null;
                this.onAnimationLoop = null;
                this.onAnimationLoopObservable.clear();
                this.onAnimationEndObservable.clear();
            }
        }
        return running;
    }
}
/** @internal */
function ProcessLateAnimationBindingsForMatrices(holder) {
    if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) {
        return holder.originalValue;
    }
    let normalizer = 1.0;
    const finalPosition = math_vector/* TmpVectors */.AA.Vector3[0];
    const finalScaling = math_vector/* TmpVectors */.AA.Vector3[1];
    const finalQuaternion = math_vector/* TmpVectors */.AA.Quaternion[0];
    let startIndex = 0;
    const originalAnimation = holder.animations[0];
    const originalValue = holder.originalValue;
    let scale = 1;
    let skipOverride = false;
    if (holder.totalWeight < 1.0) {
        // We need to mix the original value in
        scale = 1.0 - holder.totalWeight;
        originalValue.decompose(finalScaling, finalQuaternion, finalPosition);
    }
    else {
        startIndex = 1;
        // We need to normalize the weights
        normalizer = holder.totalWeight;
        scale = originalAnimation.weight / normalizer;
        if (scale == 1) {
            if (holder.totalAdditiveWeight) {
                skipOverride = true;
            }
            else {
                return originalAnimation.currentValue;
            }
        }
        originalAnimation.currentValue.decompose(finalScaling, finalQuaternion, finalPosition);
    }
    // Add up the override animations
    if (!skipOverride) {
        finalScaling.scaleInPlace(scale);
        finalPosition.scaleInPlace(scale);
        finalQuaternion.scaleInPlace(scale);
        for (let animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {
            const runtimeAnimation = holder.animations[animIndex];
            if (runtimeAnimation.weight === 0) {
                continue;
            }
            scale = runtimeAnimation.weight / normalizer;
            const currentPosition = math_vector/* TmpVectors */.AA.Vector3[2];
            const currentScaling = math_vector/* TmpVectors */.AA.Vector3[3];
            const currentQuaternion = math_vector/* TmpVectors */.AA.Quaternion[1];
            runtimeAnimation.currentValue.decompose(currentScaling, currentQuaternion, currentPosition);
            currentScaling.scaleAndAddToRef(scale, finalScaling);
            currentQuaternion.scaleAndAddToRef(math_vector/* Quaternion */.PT.Dot(finalQuaternion, currentQuaternion) > 0 ? scale : -scale, finalQuaternion);
            currentPosition.scaleAndAddToRef(scale, finalPosition);
        }
        finalQuaternion.normalize();
    }
    // Add up the additive animations
    for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {
        const runtimeAnimation = holder.additiveAnimations[animIndex];
        if (runtimeAnimation.weight === 0) {
            continue;
        }
        const currentPosition = math_vector/* TmpVectors */.AA.Vector3[2];
        const currentScaling = math_vector/* TmpVectors */.AA.Vector3[3];
        const currentQuaternion = math_vector/* TmpVectors */.AA.Quaternion[1];
        runtimeAnimation.currentValue.decompose(currentScaling, currentQuaternion, currentPosition);
        currentScaling.multiplyToRef(finalScaling, currentScaling);
        math_vector/* Vector3 */.Pq.LerpToRef(finalScaling, currentScaling, runtimeAnimation.weight, finalScaling);
        finalQuaternion.multiplyToRef(currentQuaternion, currentQuaternion);
        math_vector/* Quaternion */.PT.SlerpToRef(finalQuaternion, currentQuaternion, runtimeAnimation.weight, finalQuaternion);
        currentPosition.scaleAndAddToRef(runtimeAnimation.weight, finalPosition);
    }
    const workValue = originalAnimation ? originalAnimation._animationState.workValue : math_vector/* TmpVectors */.AA.Matrix[0].clone();
    math_vector/* Matrix */.uq.ComposeToRef(finalScaling, finalQuaternion, finalPosition, workValue);
    return workValue;
}
/** @internal */
function ProcessLateAnimationBindingsForQuaternions(holder, refQuaternion) {
    if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) {
        return refQuaternion;
    }
    const originalAnimation = holder.animations[0];
    const originalValue = holder.originalValue;
    let cumulativeQuaternion = refQuaternion;
    if (holder.totalWeight === 0 && holder.totalAdditiveWeight > 0) {
        cumulativeQuaternion.copyFrom(originalValue);
    }
    else if (holder.animations.length === 1) {
        math_vector/* Quaternion */.PT.SlerpToRef(originalValue, originalAnimation.currentValue, Math.min(1.0, holder.totalWeight), cumulativeQuaternion);
        if (holder.totalAdditiveWeight === 0) {
            return cumulativeQuaternion;
        }
    }
    else if (holder.animations.length > 1) {
        // Add up the override animations
        let normalizer = 1.0;
        let quaternions;
        let weights;
        if (holder.totalWeight < 1.0) {
            const scale = 1.0 - holder.totalWeight;
            quaternions = [];
            weights = [];
            quaternions.push(originalValue);
            weights.push(scale);
        }
        else {
            if (holder.animations.length === 2) {
                // Slerp as soon as we can
                math_vector/* Quaternion */.PT.SlerpToRef(holder.animations[0].currentValue, holder.animations[1].currentValue, holder.animations[1].weight / holder.totalWeight, refQuaternion);
                if (holder.totalAdditiveWeight === 0) {
                    return refQuaternion;
                }
            }
            quaternions = [];
            weights = [];
            normalizer = holder.totalWeight;
        }
        for (let animIndex = 0; animIndex < holder.animations.length; animIndex++) {
            const runtimeAnimation = holder.animations[animIndex];
            quaternions.push(runtimeAnimation.currentValue);
            weights.push(runtimeAnimation.weight / normalizer);
        }
        // https://gamedev.stackexchange.com/questions/62354/method-for-interpolation-between-3-quaternions
        let cumulativeAmount = 0;
        for (let index = 0; index < quaternions.length;) {
            if (!index) {
                math_vector/* Quaternion */.PT.SlerpToRef(quaternions[index], quaternions[index + 1], weights[index + 1] / (weights[index] + weights[index + 1]), refQuaternion);
                cumulativeQuaternion = refQuaternion;
                cumulativeAmount = weights[index] + weights[index + 1];
                index += 2;
                continue;
            }
            cumulativeAmount += weights[index];
            math_vector/* Quaternion */.PT.SlerpToRef(cumulativeQuaternion, quaternions[index], weights[index] / cumulativeAmount, cumulativeQuaternion);
            index++;
        }
    }
    // Add up the additive animations
    for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {
        const runtimeAnimation = holder.additiveAnimations[animIndex];
        if (runtimeAnimation.weight === 0) {
            continue;
        }
        cumulativeQuaternion.multiplyToRef(runtimeAnimation.currentValue, math_vector/* TmpVectors */.AA.Quaternion[0]);
        math_vector/* Quaternion */.PT.SlerpToRef(cumulativeQuaternion, math_vector/* TmpVectors */.AA.Quaternion[0], runtimeAnimation.weight, cumulativeQuaternion);
    }
    return cumulativeQuaternion;
}
/** @internal */
function ProcessLateAnimationBindings(scene) {
    if (!scene._registeredForLateAnimationBindings.length) {
        return;
    }
    for (let index = 0; index < scene._registeredForLateAnimationBindings.length; index++) {
        const target = scene._registeredForLateAnimationBindings.data[index];
        for (const path in target._lateAnimationHolders) {
            const holder = target._lateAnimationHolders[path];
            const originalAnimation = holder.animations[0];
            const originalValue = holder.originalValue;
            if (originalValue === undefined || originalValue === null) {
                continue;
            }
            const matrixDecomposeMode = animation/* Animation */.X5.AllowMatrixDecomposeForInterpolation && originalValue.m; // ie. data is matrix
            let finalValue = target[path];
            if (matrixDecomposeMode) {
                finalValue = ProcessLateAnimationBindingsForMatrices(holder);
            }
            else {
                const quaternionMode = originalValue.w !== undefined;
                if (quaternionMode) {
                    finalValue = ProcessLateAnimationBindingsForQuaternions(holder, finalValue || math_vector/* Quaternion */.PT.Identity());
                }
                else {
                    let startIndex = 0;
                    let normalizer = 1.0;
                    const originalAnimationIsLoopRelativeFromCurrent = originalAnimation && originalAnimation._animationState.loopMode === animation/* Animation */.X5.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT;
                    if (holder.totalWeight < 1.0) {
                        // We need to mix the original value in
                        if (originalAnimationIsLoopRelativeFromCurrent) {
                            finalValue = originalValue.clone ? originalValue.clone() : originalValue;
                        }
                        else if (originalAnimation && originalValue.scale) {
                            finalValue = originalValue.scale(1.0 - holder.totalWeight);
                        }
                        else if (originalAnimation) {
                            finalValue = originalValue * (1.0 - holder.totalWeight);
                        }
                        else if (originalValue.clone) {
                            finalValue = originalValue.clone();
                        }
                        else {
                            finalValue = originalValue;
                        }
                    }
                    else if (originalAnimation) {
                        // We need to normalize the weights
                        normalizer = holder.totalWeight;
                        const scale = originalAnimation.weight / normalizer;
                        if (scale !== 1) {
                            if (originalAnimation.currentValue.scale) {
                                finalValue = originalAnimation.currentValue.scale(scale);
                            }
                            else {
                                finalValue = originalAnimation.currentValue * scale;
                            }
                        }
                        else {
                            finalValue = originalAnimation.currentValue;
                        }
                        if (originalAnimationIsLoopRelativeFromCurrent) {
                            if (finalValue.addToRef) {
                                finalValue.addToRef(originalValue, finalValue);
                            }
                            else {
                                finalValue += originalValue;
                            }
                        }
                        startIndex = 1;
                    }
                    // Add up the override animations
                    for (let animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {
                        const runtimeAnimation = holder.animations[animIndex];
                        const scale = runtimeAnimation.weight / normalizer;
                        if (!scale) {
                            continue;
                        }
                        else if (runtimeAnimation.currentValue.scaleAndAddToRef) {
                            runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue);
                        }
                        else {
                            finalValue += runtimeAnimation.currentValue * scale;
                        }
                    }
                    // Add up the additive animations
                    for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {
                        const runtimeAnimation = holder.additiveAnimations[animIndex];
                        const scale = runtimeAnimation.weight;
                        if (!scale) {
                            continue;
                        }
                        else if (runtimeAnimation.currentValue.scaleAndAddToRef) {
                            runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue);
                        }
                        else {
                            finalValue += runtimeAnimation.currentValue * scale;
                        }
                    }
                }
            }
            target[path] = finalValue;
        }
        target._lateAnimationHolders = {};
    }
    scene._registeredForLateAnimationBindings.reset();
}
/** @internal */
function RegisterTargetForLateAnimationBinding(scene, runtimeAnimation, originalValue) {
    const target = runtimeAnimation.target;
    scene._registeredForLateAnimationBindings.pushNoDuplicate(target);
    if (!target._lateAnimationHolders) {
        target._lateAnimationHolders = {};
    }
    if (!target._lateAnimationHolders[runtimeAnimation.targetPath]) {
        target._lateAnimationHolders[runtimeAnimation.targetPath] = {
            totalWeight: 0,
            totalAdditiveWeight: 0,
            animations: [],
            additiveAnimations: [],
            originalValue: originalValue,
        };
    }
    if (runtimeAnimation.isAdditive) {
        target._lateAnimationHolders[runtimeAnimation.targetPath].additiveAnimations.push(runtimeAnimation);
        target._lateAnimationHolders[runtimeAnimation.targetPath].totalAdditiveWeight += runtimeAnimation.weight;
    }
    else {
        target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation);
        target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight;
    }
}
/**
 * Initialize all the inter dependecies between the animations and Scene and Bone
 * @param sceneClass defines the scene prototype to use
 * @param boneClass defines the bone prototype to use
 */
function AddAnimationExtensions(sceneClass, boneClass) {
    if (boneClass) {
        boneClass.prototype.copyAnimationRange = function (source, rangeName, frameOffset, rescaleAsRequired = false, skelDimensionsRatio = null) {
            // all animation may be coming from a library skeleton, so may need to create animation
            if (this.animations.length === 0) {
                this.animations.push(new animation/* Animation */.X5(this.name, "_matrix", source.animations[0].framePerSecond, animation/* Animation */.X5.ANIMATIONTYPE_MATRIX, 0));
                this.animations[0].setKeys([]);
            }
            // get animation info / verify there is such a range from the source bone
            const sourceRange = source.animations[0].getRange(rangeName);
            if (!sourceRange) {
                return false;
            }
            const from = sourceRange.from;
            const to = sourceRange.to;
            const sourceKeys = source.animations[0].getKeys();
            // rescaling prep
            const sourceBoneLength = source.length;
            const sourceParent = source.getParent();
            const parent = this.getParent();
            const parentScalingReqd = rescaleAsRequired && sourceParent && sourceBoneLength && this.length && sourceBoneLength !== this.length;
            const parentRatio = parentScalingReqd && parent && sourceParent ? parent.length / sourceParent.length : 1;
            const dimensionsScalingReqd = rescaleAsRequired && !parent && skelDimensionsRatio && (skelDimensionsRatio.x !== 1 || skelDimensionsRatio.y !== 1 || skelDimensionsRatio.z !== 1);
            const destKeys = this.animations[0].getKeys();
            // loop vars declaration
            let orig;
            let origTranslation;
            let mat;
            for (let key = 0, nKeys = sourceKeys.length; key < nKeys; key++) {
                orig = sourceKeys[key];
                if (orig.frame >= from && orig.frame <= to) {
                    if (rescaleAsRequired) {
                        mat = orig.value.clone();
                        // scale based on parent ratio, when bone has parent
                        if (parentScalingReqd) {
                            origTranslation = mat.getTranslation();
                            mat.setTranslation(origTranslation.scaleInPlace(parentRatio));
                            // scale based on skeleton dimension ratio when root bone, and value is passed
                        }
                        else if (dimensionsScalingReqd && skelDimensionsRatio) {
                            origTranslation = mat.getTranslation();
                            mat.setTranslation(origTranslation.multiplyInPlace(skelDimensionsRatio));
                            // use original when root bone, and no data for skelDimensionsRatio
                        }
                        else {
                            mat = orig.value;
                        }
                    }
                    else {
                        mat = orig.value;
                    }
                    destKeys.push({ frame: orig.frame + frameOffset, value: mat });
                }
            }
            this.animations[0].createRange(rangeName, from + frameOffset, to + frameOffset);
            return true;
        };
    }
    if (!sceneClass) {
        return;
    }
    sceneClass.prototype._animate = function (customDeltaTime) {
        if (!this.animationsEnabled) {
            return;
        }
        // Getting time
        const now = precisionDate/* PrecisionDate */.j.Now;
        if (!this._animationTimeLast) {
            if (this._pendingData.length > 0) {
                return;
            }
            this._animationTimeLast = now;
        }
        this.deltaTime = customDeltaTime !== undefined ? customDeltaTime : this.useConstantAnimationDeltaTime ? 16.0 : (now - this._animationTimeLast) * this.animationTimeScale;
        this._animationTimeLast = now;
        const animatables = this._activeAnimatables;
        if (animatables.length === 0) {
            return;
        }
        this._animationTime += this.deltaTime;
        const animationTime = this._animationTime;
        for (let index = 0; index < animatables.length; index++) {
            const animatable = animatables[index];
            if (!animatable._animate(animationTime) && animatable.disposeOnEnd) {
                index--; // Array was updated
            }
        }
        // Late animation bindings
        ProcessLateAnimationBindings(this);
    };
    sceneClass.prototype.sortActiveAnimatables = function () {
        this._activeAnimatables.sort((a, b) => {
            return a.playOrder - b.playOrder;
        });
    };
    sceneClass.prototype.beginWeightedAnimation = function (target, from, to, weight = 1.0, loop, speedRatio = 1.0, onAnimationEnd, animatable, targetMask, onAnimationLoop, isAdditive = false) {
        const returnedAnimatable = this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, false, targetMask, onAnimationLoop, isAdditive);
        returnedAnimatable.weight = weight;
        return returnedAnimatable;
    };
    sceneClass.prototype.beginAnimation = function (target, from, to, loop, speedRatio = 1.0, onAnimationEnd, animatable, stopCurrent = true, targetMask, onAnimationLoop, isAdditive = false) {
        // get speed speedRatio, to and from, based on the sign and value(s)
        if (speedRatio < 0) {
            const tmp = from;
            from = to;
            to = tmp;
            speedRatio = -speedRatio;
        }
        // if from > to switch speed ratio
        if (from > to) {
            speedRatio = -speedRatio;
        }
        if (stopCurrent) {
            this.stopAnimation(target, undefined, targetMask);
        }
        if (!animatable) {
            animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, undefined, onAnimationLoop, isAdditive);
        }
        const shouldRunTargetAnimations = targetMask ? targetMask(target) : true;
        // Local animations
        if (target.animations && shouldRunTargetAnimations) {
            animatable.appendAnimations(target, target.animations);
        }
        // Children animations
        if (target.getAnimatables) {
            const animatables = target.getAnimatables();
            for (let index = 0; index < animatables.length; index++) {
                this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, onAnimationLoop);
            }
        }
        animatable.reset();
        return animatable;
    };
    sceneClass.prototype.beginHierarchyAnimation = function (target, directDescendantsOnly, from, to, loop, speedRatio = 1.0, onAnimationEnd, animatable, stopCurrent = true, targetMask, onAnimationLoop, isAdditive = false) {
        const children = target.getDescendants(directDescendantsOnly);
        const result = [];
        result.push(this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive));
        for (const child of children) {
            result.push(this.beginAnimation(child, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive));
        }
        return result;
    };
    sceneClass.prototype.beginDirectAnimation = function (target, animations, from, to, loop, speedRatio = 1.0, onAnimationEnd, onAnimationLoop, isAdditive = false) {
        // get speed speedRatio, to and from, based on the sign and value(s)
        if (speedRatio < 0) {
            const tmp = from;
            from = to;
            to = tmp;
            speedRatio = -speedRatio;
        }
        // if from > to switch speed ratio
        if (from > to) {
            speedRatio = -speedRatio;
        }
        const animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, animations, onAnimationLoop, isAdditive);
        return animatable;
    };
    sceneClass.prototype.beginDirectHierarchyAnimation = function (target, directDescendantsOnly, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive = false) {
        const children = target.getDescendants(directDescendantsOnly);
        const result = [];
        result.push(this.beginDirectAnimation(target, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive));
        for (const child of children) {
            result.push(this.beginDirectAnimation(child, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive));
        }
        return result;
    };
    sceneClass.prototype.getAnimatableByTarget = function (target) {
        for (let index = 0; index < this._activeAnimatables.length; index++) {
            if (this._activeAnimatables[index].target === target) {
                return this._activeAnimatables[index];
            }
        }
        return null;
    };
    sceneClass.prototype.getAllAnimatablesByTarget = function (target) {
        const result = [];
        for (let index = 0; index < this._activeAnimatables.length; index++) {
            if (this._activeAnimatables[index].target === target) {
                result.push(this._activeAnimatables[index]);
            }
        }
        return result;
    };
    sceneClass.prototype.stopAnimation = function (target, animationName, targetMask) {
        const animatables = this.getAllAnimatablesByTarget(target);
        for (const animatable of animatables) {
            animatable.stop(animationName, targetMask);
        }
    };
    sceneClass.prototype.stopAllAnimations = function () {
        if (this._activeAnimatables) {
            for (let i = 0; i < this._activeAnimatables.length; i++) {
                this._activeAnimatables[i].stop(undefined, undefined, true);
            }
            this._activeAnimatables.length = 0;
        }
        for (const group of this.animationGroups) {
            group.stop();
        }
    };
}
//# sourceMappingURL=animatable.core.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/scene.js + 2 modules
var scene = __webpack_require__(87491);
;// ./node_modules/@babylonjs/core/Animations/animatable.js




// Connect everything!
AddAnimationExtensions(scene/* Scene */.Z, bone/* Bone */.$);
//# sourceMappingURL=animatable.js.map

/***/ }),

/***/ 7540:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   X5: () => (/* binding */ Animation),
/* harmony export */   eA: () => (/* binding */ _staticOffsetValueColor3),
/* harmony export */   nl: () => (/* binding */ _staticOffsetValueColor4),
/* harmony export */   rq: () => (/* binding */ _staticOffsetValueVector2),
/* harmony export */   s$: () => (/* binding */ _staticOffsetValueQuaternion),
/* harmony export */   vF: () => (/* binding */ _staticOffsetValueSize),
/* harmony export */   y4: () => (/* binding */ _staticOffsetValueVector3)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26041);
/* harmony import */ var _Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84867);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56552);
/* harmony import */ var _animationRange_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56227);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4870);
/* harmony import */ var _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(70521);
/* harmony import */ var _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(62366);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(26877);










// Static values to help the garbage collector
// Quaternion
const _staticOffsetValueQuaternion = Object.freeze(new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT(0, 0, 0, 0));
// Vector3
const _staticOffsetValueVector3 = Object.freeze(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero());
// Vector2
const _staticOffsetValueVector2 = Object.freeze(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9.Zero());
// Size
const _staticOffsetValueSize = Object.freeze(_Maths_math_size_js__WEBPACK_IMPORTED_MODULE_6__/* .Size */ .o.Zero());
// Color3
const _staticOffsetValueColor3 = Object.freeze(_Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9.Black());
// Color4
const _staticOffsetValueColor4 = Object.freeze(new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov(0, 0, 0, 0));
const evaluateAnimationState = {
    key: 0,
    repeatCount: 0,
    loopMode: 2 /*Animation.ANIMATIONLOOPMODE_CONSTANT*/,
};
/**
 * Class used to store any kind of animation
 */
class Animation {
    /**
     * @internal Internal use
     */
    static _PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction) {
        let dataType = undefined;
        if (!isNaN(parseFloat(from)) && isFinite(from)) {
            dataType = Animation.ANIMATIONTYPE_FLOAT;
        }
        else if (from instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT) {
            dataType = Animation.ANIMATIONTYPE_QUATERNION;
        }
        else if (from instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq) {
            dataType = Animation.ANIMATIONTYPE_VECTOR3;
        }
        else if (from instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9) {
            dataType = Animation.ANIMATIONTYPE_VECTOR2;
        }
        else if (from instanceof _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9) {
            dataType = Animation.ANIMATIONTYPE_COLOR3;
        }
        else if (from instanceof _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov) {
            dataType = Animation.ANIMATIONTYPE_COLOR4;
        }
        else if (from instanceof _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_6__/* .Size */ .o) {
            dataType = Animation.ANIMATIONTYPE_SIZE;
        }
        if (dataType == undefined) {
            return null;
        }
        const animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);
        const keys = [
            { frame: 0, value: from },
            { frame: totalFrame, value: to },
        ];
        animation.setKeys(keys);
        if (easingFunction !== undefined) {
            animation.setEasingFunction(easingFunction);
        }
        return animation;
    }
    /**
     * Sets up an animation
     * @param property The property to animate
     * @param animationType The animation type to apply
     * @param framePerSecond The frames per second of the animation
     * @param easingFunction The easing function used in the animation
     * @returns The created animation
     */
    static CreateAnimation(property, animationType, framePerSecond, easingFunction) {
        const animation = new Animation(property + "Animation", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);
        animation.setEasingFunction(easingFunction);
        return animation;
    }
    /**
     * Create and start an animation on a node
     * @param name defines the name of the global animation that will be run on all nodes
     * @param target defines the target where the animation will take place
     * @param targetProperty defines property to animate
     * @param framePerSecond defines the number of frame per second yo use
     * @param totalFrame defines the number of frames in total
     * @param from defines the initial value
     * @param to defines the final value
     * @param loopMode defines which loop mode you want to use (off by default)
     * @param easingFunction defines the easing function to use (linear by default)
     * @param onAnimationEnd defines the callback to call when animation end
     * @param scene defines the hosting scene
     * @returns the animatable created for this animation
     */
    static CreateAndStartAnimation(name, target, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd, scene) {
        const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);
        if (!animation) {
            return null;
        }
        if (target.getScene) {
            scene = target.getScene();
        }
        if (!scene) {
            return null;
        }
        return scene.beginDirectAnimation(target, [animation], 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);
    }
    /**
     * Create and start an animation on a node and its descendants
     * @param name defines the name of the global animation that will be run on all nodes
     * @param node defines the root node where the animation will take place
     * @param directDescendantsOnly if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used
     * @param targetProperty defines property to animate
     * @param framePerSecond defines the number of frame per second to use
     * @param totalFrame defines the number of frames in total
     * @param from defines the initial value
     * @param to defines the final value
     * @param loopMode defines which loop mode you want to use (off by default)
     * @param easingFunction defines the easing function to use (linear by default)
     * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node)
     * @returns the list of animatables created for all nodes
     * @example https://www.babylonjs-playground.com/#MH0VLI
     */
    static CreateAndStartHierarchyAnimation(name, node, directDescendantsOnly, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {
        const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);
        if (!animation) {
            return null;
        }
        const scene = node.getScene();
        return scene.beginDirectHierarchyAnimation(node, directDescendantsOnly, [animation], 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);
    }
    /**
     * Creates a new animation, merges it with the existing animations and starts it
     * @param name Name of the animation
     * @param node Node which contains the scene that begins the animations
     * @param targetProperty Specifies which property to animate
     * @param framePerSecond The frames per second of the animation
     * @param totalFrame The total number of frames
     * @param from The frame at the beginning of the animation
     * @param to The frame at the end of the animation
     * @param loopMode Specifies the loop mode of the animation
     * @param easingFunction (Optional) The easing function of the animation, which allow custom mathematical formulas for animations
     * @param onAnimationEnd Callback to run once the animation is complete
     * @returns Nullable animation
     */
    static CreateMergeAndStartAnimation(name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {
        const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);
        if (!animation) {
            return null;
        }
        node.animations.push(animation);
        return node.getScene().beginAnimation(node, 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);
    }
    /** @internal */
    static MakeAnimationAdditive(sourceAnimation, referenceFrameOrOptions, range, cloneOriginal = false, clonedName) {
        let options;
        if (typeof referenceFrameOrOptions === "object") {
            options = referenceFrameOrOptions;
        }
        else {
            options = {
                referenceFrame: referenceFrameOrOptions ?? 0,
                range: range,
                cloneOriginalAnimation: cloneOriginal,
                clonedAnimationName: clonedName,
            };
        }
        let animation = sourceAnimation;
        if (options.cloneOriginalAnimation) {
            animation = sourceAnimation.clone();
            animation.name = options.clonedAnimationName || animation.name;
        }
        if (!animation._keys.length) {
            return animation;
        }
        const referenceFrame = options.referenceFrame && options.referenceFrame >= 0 ? options.referenceFrame : 0;
        let startIndex = 0;
        const firstKey = animation._keys[0];
        let endIndex = animation._keys.length - 1;
        const lastKey = animation._keys[endIndex];
        const valueStore = {
            referenceValue: firstKey.value,
            referencePosition: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0],
            referenceQuaternion: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0],
            referenceScaling: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[1],
            keyPosition: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[2],
            keyQuaternion: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[1],
            keyScaling: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[3],
        };
        let from = firstKey.frame;
        let to = lastKey.frame;
        if (options.range) {
            const rangeValue = animation.getRange(options.range);
            if (rangeValue) {
                from = rangeValue.from;
                to = rangeValue.to;
            }
        }
        else {
            from = options.fromFrame ?? from;
            to = options.toFrame ?? to;
        }
        if (from !== firstKey.frame) {
            startIndex = animation.createKeyForFrame(from);
        }
        if (to !== lastKey.frame) {
            endIndex = animation.createKeyForFrame(to);
        }
        // There's only one key, so use it
        if (animation._keys.length === 1) {
            const value = animation._getKeyValue(animation._keys[0]);
            valueStore.referenceValue = value.clone ? value.clone() : value;
        }
        // Reference frame is before the first frame, so just use the first frame
        else if (referenceFrame <= firstKey.frame) {
            const value = animation._getKeyValue(firstKey.value);
            valueStore.referenceValue = value.clone ? value.clone() : value;
        }
        // Reference frame is after the last frame, so just use the last frame
        else if (referenceFrame >= lastKey.frame) {
            const value = animation._getKeyValue(lastKey.value);
            valueStore.referenceValue = value.clone ? value.clone() : value;
        }
        // Interpolate the reference value from the animation
        else {
            evaluateAnimationState.key = 0;
            const value = animation._interpolate(referenceFrame, evaluateAnimationState);
            valueStore.referenceValue = value.clone ? value.clone() : value;
        }
        // Conjugate the quaternion
        if (animation.dataType === Animation.ANIMATIONTYPE_QUATERNION) {
            valueStore.referenceValue.normalize().conjugateInPlace();
        }
        // Decompose matrix and conjugate the quaternion
        else if (animation.dataType === Animation.ANIMATIONTYPE_MATRIX) {
            valueStore.referenceValue.decompose(valueStore.referenceScaling, valueStore.referenceQuaternion, valueStore.referencePosition);
            valueStore.referenceQuaternion.normalize().conjugateInPlace();
        }
        let startFrame = Number.MAX_VALUE;
        const clippedKeys = options.clipKeys ? [] : null;
        // Subtract the reference value from all of the key values
        for (let index = startIndex; index <= endIndex; index++) {
            let key = animation._keys[index];
            if (clippedKeys || options.cloneOriginalAnimation) {
                key = {
                    frame: key.frame,
                    value: key.value.clone ? key.value.clone() : key.value,
                    inTangent: key.inTangent,
                    outTangent: key.outTangent,
                    interpolation: key.interpolation,
                    lockedTangent: key.lockedTangent,
                };
                if (clippedKeys) {
                    if (startFrame === Number.MAX_VALUE) {
                        startFrame = key.frame;
                    }
                    key.frame -= startFrame;
                    clippedKeys.push(key);
                }
            }
            // If this key was duplicated to create a frame 0 key, skip it because its value has already been updated
            if (index && animation.dataType !== Animation.ANIMATIONTYPE_FLOAT && key.value === firstKey.value) {
                continue;
            }
            switch (animation.dataType) {
                case Animation.ANIMATIONTYPE_MATRIX:
                    key.value.decompose(valueStore.keyScaling, valueStore.keyQuaternion, valueStore.keyPosition);
                    valueStore.keyPosition.subtractInPlace(valueStore.referencePosition);
                    valueStore.keyScaling.divideInPlace(valueStore.referenceScaling);
                    valueStore.referenceQuaternion.multiplyToRef(valueStore.keyQuaternion, valueStore.keyQuaternion);
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.ComposeToRef(valueStore.keyScaling, valueStore.keyQuaternion, valueStore.keyPosition, key.value);
                    break;
                case Animation.ANIMATIONTYPE_QUATERNION:
                    valueStore.referenceValue.multiplyToRef(key.value, key.value);
                    break;
                case Animation.ANIMATIONTYPE_VECTOR2:
                case Animation.ANIMATIONTYPE_VECTOR3:
                case Animation.ANIMATIONTYPE_COLOR3:
                case Animation.ANIMATIONTYPE_COLOR4:
                    key.value.subtractToRef(valueStore.referenceValue, key.value);
                    break;
                case Animation.ANIMATIONTYPE_SIZE:
                    key.value.width -= valueStore.referenceValue.width;
                    key.value.height -= valueStore.referenceValue.height;
                    break;
                default:
                    key.value -= valueStore.referenceValue;
            }
        }
        if (clippedKeys) {
            animation.setKeys(clippedKeys, true);
        }
        return animation;
    }
    /**
     * Transition property of an host to the target Value
     * @param property The property to transition
     * @param targetValue The target Value of the property
     * @param host The object where the property to animate belongs
     * @param scene Scene used to run the animation
     * @param frameRate Framerate (in frame/s) to use
     * @param transition The transition type we want to use
     * @param duration The duration of the animation, in milliseconds
     * @param onAnimationEnd Callback trigger at the end of the animation
     * @returns Nullable animation
     */
    static TransitionTo(property, targetValue, host, scene, frameRate, transition, duration, onAnimationEnd = null) {
        if (duration <= 0) {
            host[property] = targetValue;
            if (onAnimationEnd) {
                onAnimationEnd();
            }
            return null;
        }
        const endFrame = frameRate * (duration / 1000);
        transition.setKeys([
            {
                frame: 0,
                value: host[property].clone ? host[property].clone() : host[property],
            },
            {
                frame: endFrame,
                value: targetValue,
            },
        ]);
        if (!host.animations) {
            host.animations = [];
        }
        host.animations.push(transition);
        const animation = scene.beginAnimation(host, 0, endFrame, false);
        animation.onAnimationEnd = onAnimationEnd;
        return animation;
    }
    /**
     * Return the array of runtime animations currently using this animation
     */
    get runtimeAnimations() {
        return this._runtimeAnimations;
    }
    /**
     * Specifies if any of the runtime animations are currently running
     */
    get hasRunningRuntimeAnimations() {
        for (const runtimeAnimation of this._runtimeAnimations) {
            if (!runtimeAnimation.isStopped()) {
                return true;
            }
        }
        return false;
    }
    /**
     * Initializes the animation
     * @param name Name of the animation
     * @param targetProperty Property to animate
     * @param framePerSecond The frames per second of the animation
     * @param dataType The data type of the animation
     * @param loopMode The loop mode of the animation
     * @param enableBlending Specifies if blending should be enabled
     */
    constructor(
    /**Name of the animation */
    name, 
    /**Property to animate */
    targetProperty, 
    /**The frames per second of the animation */
    framePerSecond, 
    /**The data type of the animation */
    dataType, 
    /**The loop mode of the animation */
    loopMode, 
    /**Specifies if blending should be enabled */
    enableBlending) {
        this.name = name;
        this.targetProperty = targetProperty;
        this.framePerSecond = framePerSecond;
        this.dataType = dataType;
        this.loopMode = loopMode;
        this.enableBlending = enableBlending;
        /**
         * Stores the easing function of the animation
         */
        this._easingFunction = null;
        /**
         * @internal Internal use only
         */
        this._runtimeAnimations = new Array();
        /**
         * The set of event that will be linked to this animation
         */
        this._events = new Array();
        /**
         * Stores the blending speed of the animation
         */
        this.blendingSpeed = 0.01;
        /**
         * Stores the animation ranges for the animation
         */
        this._ranges = {};
        this.targetPropertyPath = targetProperty.split(".");
        this.dataType = dataType;
        this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode;
        this.uniqueId = Animation._UniqueIdGenerator++;
    }
    // Methods
    /**
     * Converts the animation to a string
     * @param fullDetails support for multiple levels of logging within scene loading
     * @returns String form of the animation
     */
    toString(fullDetails) {
        let ret = "Name: " + this.name + ", property: " + this.targetProperty;
        ret += ", datatype: " + ["Float", "Vector3", "Quaternion", "Matrix", "Color3", "Vector2"][this.dataType];
        ret += ", nKeys: " + (this._keys ? this._keys.length : "none");
        ret += ", nRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none");
        if (fullDetails) {
            ret += ", Ranges: {";
            let first = true;
            for (const name in this._ranges) {
                if (first) {
                    ret += ", ";
                    first = false;
                }
                ret += name;
            }
            ret += "}";
        }
        return ret;
    }
    /**
     * Add an event to this animation
     * @param event Event to add
     */
    addEvent(event) {
        this._events.push(event);
        this._events.sort((a, b) => a.frame - b.frame);
    }
    /**
     * Remove all events found at the given frame
     * @param frame The frame to remove events from
     */
    removeEvents(frame) {
        for (let index = 0; index < this._events.length; index++) {
            if (this._events[index].frame === frame) {
                this._events.splice(index, 1);
                index--;
            }
        }
    }
    /**
     * Retrieves all the events from the animation
     * @returns Events from the animation
     */
    getEvents() {
        return this._events;
    }
    /**
     * Creates an animation range
     * @param name Name of the animation range
     * @param from Starting frame of the animation range
     * @param to Ending frame of the animation
     */
    createRange(name, from, to) {
        // check name not already in use; could happen for bones after serialized
        if (!this._ranges[name]) {
            this._ranges[name] = new _animationRange_js__WEBPACK_IMPORTED_MODULE_4__/* .AnimationRange */ .K(name, from, to);
        }
    }
    /**
     * Deletes an animation range by name
     * @param name Name of the animation range to delete
     * @param deleteFrames Specifies if the key frames for the range should also be deleted (true) or not (false)
     */
    deleteRange(name, deleteFrames = true) {
        const range = this._ranges[name];
        if (!range) {
            return;
        }
        if (deleteFrames) {
            const from = range.from;
            const to = range.to;
            // this loop MUST go high to low for multiple splices to work
            for (let key = this._keys.length - 1; key >= 0; key--) {
                if (this._keys[key].frame >= from && this._keys[key].frame <= to) {
                    this._keys.splice(key, 1);
                }
            }
        }
        this._ranges[name] = null; // said much faster than 'delete this._range[name]'
    }
    /**
     * Gets the animation range by name, or null if not defined
     * @param name Name of the animation range
     * @returns Nullable animation range
     */
    getRange(name) {
        return this._ranges[name];
    }
    /**
     * Gets the key frames from the animation
     * @returns The key frames of the animation
     */
    getKeys() {
        return this._keys;
    }
    /**
     * Gets the highest frame of the animation
     * @returns Highest frame of the animation
     */
    getHighestFrame() {
        let ret = 0;
        for (let key = 0, nKeys = this._keys.length; key < nKeys; key++) {
            if (ret < this._keys[key].frame) {
                ret = this._keys[key].frame;
            }
        }
        return ret;
    }
    /**
     * Gets the easing function of the animation
     * @returns Easing function of the animation
     */
    getEasingFunction() {
        return this._easingFunction;
    }
    /**
     * Sets the easing function of the animation
     * @param easingFunction A custom mathematical formula for animation
     */
    setEasingFunction(easingFunction) {
        this._easingFunction = easingFunction;
    }
    /**
     * Interpolates a scalar linearly
     * @param startValue Start value of the animation curve
     * @param endValue End value of the animation curve
     * @param gradient Scalar amount to interpolate
     * @returns Interpolated scalar value
     */
    floatInterpolateFunction(startValue, endValue, gradient) {
        return (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_2__.Lerp)(startValue, endValue, gradient);
    }
    /**
     * Interpolates a scalar cubically
     * @param startValue Start value of the animation curve
     * @param outTangent End tangent of the animation
     * @param endValue End value of the animation curve
     * @param inTangent Start tangent of the animation curve
     * @param gradient Scalar amount to interpolate
     * @returns Interpolated scalar value
     */
    floatInterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {
        return (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_2__.Hermite)(startValue, outTangent, endValue, inTangent, gradient);
    }
    /**
     * Interpolates a quaternion using a spherical linear interpolation
     * @param startValue Start value of the animation curve
     * @param endValue End value of the animation curve
     * @param gradient Scalar amount to interpolate
     * @returns Interpolated quaternion value
     */
    quaternionInterpolateFunction(startValue, endValue, gradient) {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Slerp(startValue, endValue, gradient);
    }
    /**
     * Interpolates a quaternion cubically
     * @param startValue Start value of the animation curve
     * @param outTangent End tangent of the animation curve
     * @param endValue End value of the animation curve
     * @param inTangent Start tangent of the animation curve
     * @param gradient Scalar amount to interpolate
     * @returns Interpolated quaternion value
     */
    quaternionInterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Hermite(startValue, outTangent, endValue, inTangent, gradient).normalize();
    }
    /**
     * Interpolates a Vector3 linearly
     * @param startValue Start value of the animation curve
     * @param endValue End value of the animation curve
     * @param gradient Scalar amount to interpolate (value between 0 and 1)
     * @returns Interpolated scalar value
     */
    vector3InterpolateFunction(startValue, endValue, gradient) {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Lerp(startValue, endValue, gradient);
    }
    /**
     * Interpolates a Vector3 cubically
     * @param startValue Start value of the animation curve
     * @param outTangent End tangent of the animation
     * @param endValue End value of the animation curve
     * @param inTangent Start tangent of the animation curve
     * @param gradient Scalar amount to interpolate (value between 0 and 1)
     * @returns InterpolatedVector3 value
     */
    vector3InterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Hermite(startValue, outTangent, endValue, inTangent, gradient);
    }
    /**
     * Interpolates a Vector2 linearly
     * @param startValue Start value of the animation curve
     * @param endValue End value of the animation curve
     * @param gradient Scalar amount to interpolate (value between 0 and 1)
     * @returns Interpolated Vector2 value
     */
    vector2InterpolateFunction(startValue, endValue, gradient) {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9.Lerp(startValue, endValue, gradient);
    }
    /**
     * Interpolates a Vector2 cubically
     * @param startValue Start value of the animation curve
     * @param outTangent End tangent of the animation
     * @param endValue End value of the animation curve
     * @param inTangent Start tangent of the animation curve
     * @param gradient Scalar amount to interpolate (value between 0 and 1)
     * @returns Interpolated Vector2 value
     */
    vector2InterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9.Hermite(startValue, outTangent, endValue, inTangent, gradient);
    }
    /**
     * Interpolates a size linearly
     * @param startValue Start value of the animation curve
     * @param endValue End value of the animation curve
     * @param gradient Scalar amount to interpolate
     * @returns Interpolated Size value
     */
    sizeInterpolateFunction(startValue, endValue, gradient) {
        return _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_6__/* .Size */ .o.Lerp(startValue, endValue, gradient);
    }
    /**
     * Interpolates a Color3 linearly
     * @param startValue Start value of the animation curve
     * @param endValue End value of the animation curve
     * @param gradient Scalar amount to interpolate
     * @returns Interpolated Color3 value
     */
    color3InterpolateFunction(startValue, endValue, gradient) {
        return _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9.Lerp(startValue, endValue, gradient);
    }
    /**
     * Interpolates a Color3 cubically
     * @param startValue Start value of the animation curve
     * @param outTangent End tangent of the animation
     * @param endValue End value of the animation curve
     * @param inTangent Start tangent of the animation curve
     * @param gradient Scalar amount to interpolate
     * @returns interpolated value
     */
    color3InterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {
        return _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9.Hermite(startValue, outTangent, endValue, inTangent, gradient);
    }
    /**
     * Interpolates a Color4 linearly
     * @param startValue Start value of the animation curve
     * @param endValue End value of the animation curve
     * @param gradient Scalar amount to interpolate
     * @returns Interpolated Color3 value
     */
    color4InterpolateFunction(startValue, endValue, gradient) {
        return _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov.Lerp(startValue, endValue, gradient);
    }
    /**
     * Interpolates a Color4 cubically
     * @param startValue Start value of the animation curve
     * @param outTangent End tangent of the animation
     * @param endValue End value of the animation curve
     * @param inTangent Start tangent of the animation curve
     * @param gradient Scalar amount to interpolate
     * @returns interpolated value
     */
    color4InterpolateFunctionWithTangents(startValue, outTangent, endValue, inTangent, gradient) {
        return _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov.Hermite(startValue, outTangent, endValue, inTangent, gradient);
    }
    /**
     * @internal Internal use only
     */
    _getKeyValue(value) {
        if (typeof value === "function") {
            return value();
        }
        return value;
    }
    /**
     * Evaluate the animation value at a given frame
     * @param currentFrame defines the frame where we want to evaluate the animation
     * @returns the animation value
     */
    evaluate(currentFrame) {
        evaluateAnimationState.key = 0;
        return this._interpolate(currentFrame, evaluateAnimationState);
    }
    /**
     * @internal Internal use only
     */
    _interpolate(currentFrame, state, searchClosestKeyOnly = false) {
        if (state.loopMode === Animation.ANIMATIONLOOPMODE_CONSTANT && state.repeatCount > 0) {
            return state.highLimitValue.clone ? state.highLimitValue.clone() : state.highLimitValue;
        }
        const keys = this._keys;
        const keysLength = keys.length;
        let key = state.key;
        while (key >= 0 && currentFrame < keys[key].frame) {
            --key;
        }
        while (key + 1 <= keysLength - 1 && currentFrame >= keys[key + 1].frame) {
            ++key;
        }
        state.key = key;
        if (key < 0) {
            return searchClosestKeyOnly ? undefined : this._getKeyValue(keys[0].value);
        }
        else if (key + 1 > keysLength - 1) {
            return searchClosestKeyOnly ? undefined : this._getKeyValue(keys[keysLength - 1].value);
        }
        const startKey = keys[key];
        const endKey = keys[key + 1];
        if (searchClosestKeyOnly && (currentFrame === startKey.frame || currentFrame === endKey.frame)) {
            return undefined;
        }
        const startValue = this._getKeyValue(startKey.value);
        const endValue = this._getKeyValue(endKey.value);
        if (startKey.interpolation === 1 /* AnimationKeyInterpolation.STEP */) {
            if (endKey.frame > currentFrame) {
                return startValue;
            }
            else {
                return endValue;
            }
        }
        const useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined;
        const frameDelta = endKey.frame - startKey.frame;
        // gradient : percent of currentFrame between the frame inf and the frame sup
        let gradient = (currentFrame - startKey.frame) / frameDelta;
        // check for easingFunction and correction of gradient
        const easingFunction = startKey.easingFunction || this.getEasingFunction();
        if (easingFunction !== null) {
            gradient = easingFunction.ease(gradient);
        }
        switch (this.dataType) {
            // Float
            case Animation.ANIMATIONTYPE_FLOAT: {
                const floatValue = useTangent
                    ? this.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient)
                    : this.floatInterpolateFunction(startValue, endValue, gradient);
                switch (state.loopMode) {
                    case Animation.ANIMATIONLOOPMODE_CYCLE:
                    case Animation.ANIMATIONLOOPMODE_CONSTANT:
                    case Animation.ANIMATIONLOOPMODE_YOYO:
                        return floatValue;
                    case Animation.ANIMATIONLOOPMODE_RELATIVE:
                    case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
                        return (state.offsetValue ?? 0) * state.repeatCount + floatValue;
                }
                break;
            }
            // Quaternion
            case Animation.ANIMATIONTYPE_QUATERNION: {
                const quatValue = useTangent
                    ? this.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)
                    : this.quaternionInterpolateFunction(startValue, endValue, gradient);
                switch (state.loopMode) {
                    case Animation.ANIMATIONLOOPMODE_CYCLE:
                    case Animation.ANIMATIONLOOPMODE_CONSTANT:
                    case Animation.ANIMATIONLOOPMODE_YOYO:
                        return quatValue;
                    case Animation.ANIMATIONLOOPMODE_RELATIVE:
                    case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
                        return quatValue.addInPlace((state.offsetValue || _staticOffsetValueQuaternion).scale(state.repeatCount));
                }
                return quatValue;
            }
            // Vector3
            case Animation.ANIMATIONTYPE_VECTOR3: {
                const vec3Value = useTangent
                    ? this.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)
                    : this.vector3InterpolateFunction(startValue, endValue, gradient);
                switch (state.loopMode) {
                    case Animation.ANIMATIONLOOPMODE_CYCLE:
                    case Animation.ANIMATIONLOOPMODE_CONSTANT:
                    case Animation.ANIMATIONLOOPMODE_YOYO:
                        return vec3Value;
                    case Animation.ANIMATIONLOOPMODE_RELATIVE:
                    case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
                        return vec3Value.add((state.offsetValue || _staticOffsetValueVector3).scale(state.repeatCount));
                }
                break;
            }
            // Vector2
            case Animation.ANIMATIONTYPE_VECTOR2: {
                const vec2Value = useTangent
                    ? this.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)
                    : this.vector2InterpolateFunction(startValue, endValue, gradient);
                switch (state.loopMode) {
                    case Animation.ANIMATIONLOOPMODE_CYCLE:
                    case Animation.ANIMATIONLOOPMODE_CONSTANT:
                    case Animation.ANIMATIONLOOPMODE_YOYO:
                        return vec2Value;
                    case Animation.ANIMATIONLOOPMODE_RELATIVE:
                    case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
                        return vec2Value.add((state.offsetValue || _staticOffsetValueVector2).scale(state.repeatCount));
                }
                break;
            }
            // Size
            case Animation.ANIMATIONTYPE_SIZE: {
                switch (state.loopMode) {
                    case Animation.ANIMATIONLOOPMODE_CYCLE:
                    case Animation.ANIMATIONLOOPMODE_CONSTANT:
                    case Animation.ANIMATIONLOOPMODE_YOYO:
                        return this.sizeInterpolateFunction(startValue, endValue, gradient);
                    case Animation.ANIMATIONLOOPMODE_RELATIVE:
                    case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
                        return this.sizeInterpolateFunction(startValue, endValue, gradient).add((state.offsetValue || _staticOffsetValueSize).scale(state.repeatCount));
                }
                break;
            }
            // Color3
            case Animation.ANIMATIONTYPE_COLOR3: {
                const color3Value = useTangent
                    ? this.color3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)
                    : this.color3InterpolateFunction(startValue, endValue, gradient);
                switch (state.loopMode) {
                    case Animation.ANIMATIONLOOPMODE_CYCLE:
                    case Animation.ANIMATIONLOOPMODE_CONSTANT:
                    case Animation.ANIMATIONLOOPMODE_YOYO:
                        return color3Value;
                    case Animation.ANIMATIONLOOPMODE_RELATIVE:
                    case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
                        return color3Value.add((state.offsetValue || _staticOffsetValueColor3).scale(state.repeatCount));
                }
                break;
            }
            // Color4
            case Animation.ANIMATIONTYPE_COLOR4: {
                const color4Value = useTangent
                    ? this.color4InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)
                    : this.color4InterpolateFunction(startValue, endValue, gradient);
                switch (state.loopMode) {
                    case Animation.ANIMATIONLOOPMODE_CYCLE:
                    case Animation.ANIMATIONLOOPMODE_CONSTANT:
                    case Animation.ANIMATIONLOOPMODE_YOYO:
                        return color4Value;
                    case Animation.ANIMATIONLOOPMODE_RELATIVE:
                    case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:
                        return color4Value.add((state.offsetValue || _staticOffsetValueColor4).scale(state.repeatCount));
                }
                break;
            }
            // Matrix
            case Animation.ANIMATIONTYPE_MATRIX: {
                switch (state.loopMode) {
                    case Animation.ANIMATIONLOOPMODE_CYCLE:
                    case Animation.ANIMATIONLOOPMODE_CONSTANT:
                    case Animation.ANIMATIONLOOPMODE_YOYO: {
                        if (Animation.AllowMatricesInterpolation) {
                            return this.matrixInterpolateFunction(startValue, endValue, gradient, state.workValue);
                        }
                        return startValue;
                    }
                    case Animation.ANIMATIONLOOPMODE_RELATIVE:
                    case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT: {
                        return startValue;
                    }
                }
                break;
            }
        }
        return 0;
    }
    /**
     * Defines the function to use to interpolate matrices
     * @param startValue defines the start matrix
     * @param endValue defines the end matrix
     * @param gradient defines the gradient between both matrices
     * @param result defines an optional target matrix where to store the interpolation
     * @returns the interpolated matrix
     */
    matrixInterpolateFunction(startValue, endValue, gradient, result) {
        if (Animation.AllowMatrixDecomposeForInterpolation) {
            if (result) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.DecomposeLerpToRef(startValue, endValue, gradient, result);
                return result;
            }
            return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.DecomposeLerp(startValue, endValue, gradient);
        }
        if (result) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.LerpToRef(startValue, endValue, gradient, result);
            return result;
        }
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Lerp(startValue, endValue, gradient);
    }
    /**
     * Makes a copy of the animation
     * @returns Cloned animation
     */
    clone() {
        const clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);
        clone.enableBlending = this.enableBlending;
        clone.blendingSpeed = this.blendingSpeed;
        if (this._keys) {
            clone.setKeys(this._keys);
        }
        if (this._ranges) {
            clone._ranges = {};
            for (const name in this._ranges) {
                const range = this._ranges[name];
                if (!range) {
                    continue;
                }
                clone._ranges[name] = range.clone();
            }
        }
        return clone;
    }
    /**
     * Sets the key frames of the animation
     * @param values The animation key frames to set
     * @param dontClone Whether to clone the keys or not (default is false, so the array of keys is cloned)
     */
    setKeys(values, dontClone = false) {
        this._keys = !dontClone ? values.slice(0) : values;
    }
    /**
     * Creates a key for the frame passed as a parameter and adds it to the animation IF a key doesn't already exist for that frame
     * @param frame Frame number
     * @returns The key index if the key was added or the index of the pre existing key if the frame passed as parameter already has a corresponding key
     */
    createKeyForFrame(frame) {
        // Find the key corresponding to frame
        evaluateAnimationState.key = 0;
        const value = this._interpolate(frame, evaluateAnimationState, true);
        if (!value) {
            // A key corresponding to this frame already exists
            return this._keys[evaluateAnimationState.key].frame === frame ? evaluateAnimationState.key : evaluateAnimationState.key + 1;
        }
        // The frame is between two keys, so create a new key
        const newKey = {
            frame,
            value: value.clone ? value.clone() : value,
        };
        this._keys.splice(evaluateAnimationState.key + 1, 0, newKey);
        return evaluateAnimationState.key + 1;
    }
    /**
     * Serializes the animation to an object
     * @returns Serialized object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.property = this.targetProperty;
        serializationObject.framePerSecond = this.framePerSecond;
        serializationObject.dataType = this.dataType;
        serializationObject.loopBehavior = this.loopMode;
        serializationObject.enableBlending = this.enableBlending;
        serializationObject.blendingSpeed = this.blendingSpeed;
        const dataType = this.dataType;
        serializationObject.keys = [];
        const keys = this.getKeys();
        for (let index = 0; index < keys.length; index++) {
            const animationKey = keys[index];
            const key = {};
            key.frame = animationKey.frame;
            switch (dataType) {
                case Animation.ANIMATIONTYPE_FLOAT:
                    key.values = [animationKey.value];
                    if (animationKey.inTangent !== undefined) {
                        key.values.push(animationKey.inTangent);
                    }
                    if (animationKey.outTangent !== undefined) {
                        if (animationKey.inTangent === undefined) {
                            key.values.push(undefined);
                        }
                        key.values.push(animationKey.outTangent);
                    }
                    if (animationKey.interpolation !== undefined) {
                        if (animationKey.inTangent === undefined) {
                            key.values.push(undefined);
                        }
                        if (animationKey.outTangent === undefined) {
                            key.values.push(undefined);
                        }
                        key.values.push(animationKey.interpolation);
                    }
                    break;
                case Animation.ANIMATIONTYPE_QUATERNION:
                case Animation.ANIMATIONTYPE_MATRIX:
                case Animation.ANIMATIONTYPE_VECTOR3:
                case Animation.ANIMATIONTYPE_COLOR3:
                case Animation.ANIMATIONTYPE_COLOR4:
                    key.values = animationKey.value.asArray();
                    if (animationKey.inTangent != undefined) {
                        key.values.push(animationKey.inTangent.asArray());
                    }
                    if (animationKey.outTangent != undefined) {
                        if (animationKey.inTangent === undefined) {
                            key.values.push(undefined);
                        }
                        key.values.push(animationKey.outTangent.asArray());
                    }
                    if (animationKey.interpolation !== undefined) {
                        if (animationKey.inTangent === undefined) {
                            key.values.push(undefined);
                        }
                        if (animationKey.outTangent === undefined) {
                            key.values.push(undefined);
                        }
                        key.values.push(animationKey.interpolation);
                    }
                    break;
            }
            serializationObject.keys.push(key);
        }
        serializationObject.ranges = [];
        for (const name in this._ranges) {
            const source = this._ranges[name];
            if (!source) {
                continue;
            }
            const range = {};
            range.name = name;
            range.from = source.from;
            range.to = source.to;
            serializationObject.ranges.push(range);
        }
        return serializationObject;
    }
    /**
     * @internal
     */
    static _UniversalLerp(left, right, amount) {
        const constructor = left.constructor;
        if (constructor.Lerp) {
            // Lerp supported
            return constructor.Lerp(left, right, amount);
        }
        else if (constructor.Slerp) {
            // Slerp supported
            return constructor.Slerp(left, right, amount);
        }
        else if (left.toFixed) {
            // Number
            return left * (1.0 - amount) + amount * right;
        }
        else {
            // Blending not supported
            return right;
        }
    }
    /**
     * Parses an animation object and creates an animation
     * @param parsedAnimation Parsed animation object
     * @returns Animation object
     */
    static Parse(parsedAnimation) {
        const animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior);
        const dataType = parsedAnimation.dataType;
        const keys = [];
        let data;
        let index;
        if (parsedAnimation.enableBlending) {
            animation.enableBlending = parsedAnimation.enableBlending;
        }
        if (parsedAnimation.blendingSpeed) {
            animation.blendingSpeed = parsedAnimation.blendingSpeed;
        }
        for (index = 0; index < parsedAnimation.keys.length; index++) {
            const key = parsedAnimation.keys[index];
            let inTangent = undefined;
            let outTangent = undefined;
            let interpolation = undefined;
            switch (dataType) {
                case Animation.ANIMATIONTYPE_FLOAT:
                    data = key.values[0];
                    if (key.values.length >= 2) {
                        inTangent = key.values[1];
                    }
                    if (key.values.length >= 3) {
                        outTangent = key.values[2];
                    }
                    if (key.values.length >= 4) {
                        interpolation = key.values[3];
                    }
                    break;
                case Animation.ANIMATIONTYPE_QUATERNION:
                    data = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.FromArray(key.values);
                    if (key.values.length >= 8) {
                        const _inTangent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.FromArray(key.values.slice(4, 8));
                        if (!_inTangent.equals(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Zero())) {
                            inTangent = _inTangent;
                        }
                    }
                    if (key.values.length >= 12) {
                        const _outTangent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.FromArray(key.values.slice(8, 12));
                        if (!_outTangent.equals(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Zero())) {
                            outTangent = _outTangent;
                        }
                    }
                    if (key.values.length >= 13) {
                        interpolation = key.values[12];
                    }
                    break;
                case Animation.ANIMATIONTYPE_MATRIX:
                    data = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.FromArray(key.values);
                    if (key.values.length >= 17) {
                        interpolation = key.values[16];
                    }
                    break;
                case Animation.ANIMATIONTYPE_COLOR3:
                    data = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9.FromArray(key.values);
                    if (key.values[3]) {
                        inTangent = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9.FromArray(key.values[3]);
                    }
                    if (key.values[4]) {
                        outTangent = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9.FromArray(key.values[4]);
                    }
                    if (key.values[5]) {
                        interpolation = key.values[5];
                    }
                    break;
                case Animation.ANIMATIONTYPE_COLOR4:
                    data = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov.FromArray(key.values);
                    if (key.values[4]) {
                        inTangent = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov.FromArray(key.values[4]);
                    }
                    if (key.values[5]) {
                        outTangent = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov.FromArray(key.values[5]);
                    }
                    if (key.values[6]) {
                        interpolation = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov.FromArray(key.values[6]);
                    }
                    break;
                case Animation.ANIMATIONTYPE_VECTOR3:
                default:
                    data = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArray(key.values);
                    if (key.values[3]) {
                        inTangent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArray(key.values[3]);
                    }
                    if (key.values[4]) {
                        outTangent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArray(key.values[4]);
                    }
                    if (key.values[5]) {
                        interpolation = key.values[5];
                    }
                    break;
            }
            const keyData = {};
            keyData.frame = key.frame;
            keyData.value = data;
            if (inTangent != undefined) {
                keyData.inTangent = inTangent;
            }
            if (outTangent != undefined) {
                keyData.outTangent = outTangent;
            }
            if (interpolation != undefined) {
                keyData.interpolation = interpolation;
            }
            keys.push(keyData);
        }
        animation.setKeys(keys);
        if (parsedAnimation.ranges) {
            for (index = 0; index < parsedAnimation.ranges.length; index++) {
                data = parsedAnimation.ranges[index];
                animation.createRange(data.name, data.from, data.to);
            }
        }
        return animation;
    }
    /**
     * Appends the serialized animations from the source animations
     * @param source Source containing the animations
     * @param destination Target to store the animations
     */
    static AppendSerializedAnimations(source, destination) {
        _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__/* .SerializationHelper */ .p.AppendSerializedAnimations(source, destination);
    }
    /**
     * Creates a new animation or an array of animations from a snippet saved in a remote file
     * @param name defines the name of the animation to create (can be null or empty to use the one from the json data)
     * @param url defines the url to load from
     * @returns a promise that will resolve to the new animation or an array of animations
     */
    static ParseFromFileAsync(name, url) {
        return new Promise((resolve, reject) => {
            const request = new _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_7__/* .WebRequest */ .u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        let serializationObject = JSON.parse(request.responseText);
                        if (serializationObject.animations) {
                            serializationObject = serializationObject.animations;
                        }
                        if (serializationObject.length) {
                            const output = [];
                            for (const serializedAnimation of serializationObject) {
                                output.push(this.Parse(serializedAnimation));
                            }
                            resolve(output);
                        }
                        else {
                            const output = this.Parse(serializationObject);
                            if (name) {
                                output.name = name;
                            }
                            resolve(output);
                        }
                    }
                    else {
                        reject("Unable to load the animation");
                    }
                }
            });
            request.open("GET", url);
            request.send();
        });
    }
    /**
     * Creates an animation or an array of animations from a snippet saved by the Inspector
     * @param snippetId defines the snippet to load
     * @returns a promise that will resolve to the new animation or a new array of animations
     */
    static ParseFromSnippetAsync(snippetId) {
        return new Promise((resolve, reject) => {
            const request = new _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_7__/* .WebRequest */ .u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);
                        if (snippet.animations) {
                            const serializationObject = JSON.parse(snippet.animations);
                            const outputs = [];
                            for (const serializedAnimation of serializationObject.animations) {
                                const output = this.Parse(serializedAnimation);
                                output.snippetId = snippetId;
                                outputs.push(output);
                            }
                            resolve(outputs);
                        }
                        else {
                            const serializationObject = JSON.parse(snippet.animation);
                            const output = this.Parse(serializationObject);
                            output.snippetId = snippetId;
                            resolve(output);
                        }
                    }
                    else {
                        reject("Unable to load the snippet " + snippetId);
                    }
                }
            });
            request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/"));
            request.send();
        });
    }
}
Animation._UniqueIdGenerator = 0;
/**
 * Use matrix interpolation instead of using direct key value when animating matrices
 */
Animation.AllowMatricesInterpolation = false;
/**
 * When matrix interpolation is enabled, this boolean forces the system to use Matrix.DecomposeLerp instead of Matrix.Lerp. Interpolation is more precise but slower
 */
Animation.AllowMatrixDecomposeForInterpolation = true;
/** Define the Url to load snippets */
Animation.SnippetUrl = `https://snippet.babylonjs.com`;
// Statics
/**
 * Float animation type
 */
Animation.ANIMATIONTYPE_FLOAT = 0;
/**
 * Vector3 animation type
 */
Animation.ANIMATIONTYPE_VECTOR3 = 1;
/**
 * Quaternion animation type
 */
Animation.ANIMATIONTYPE_QUATERNION = 2;
/**
 * Matrix animation type
 */
Animation.ANIMATIONTYPE_MATRIX = 3;
/**
 * Color3 animation type
 */
Animation.ANIMATIONTYPE_COLOR3 = 4;
/**
 * Color3 animation type
 */
Animation.ANIMATIONTYPE_COLOR4 = 7;
/**
 * Vector2 animation type
 */
Animation.ANIMATIONTYPE_VECTOR2 = 5;
/**
 * Size animation type
 */
Animation.ANIMATIONTYPE_SIZE = 6;
/**
 * Relative Loop Mode
 */
Animation.ANIMATIONLOOPMODE_RELATIVE = 0;
/**
 * Cycle Loop Mode
 */
Animation.ANIMATIONLOOPMODE_CYCLE = 1;
/**
 * Constant Loop Mode
 */
Animation.ANIMATIONLOOPMODE_CONSTANT = 2;
/**
 * Yoyo Loop Mode
 */
Animation.ANIMATIONLOOPMODE_YOYO = 4;
/**
 * Relative Loop Mode (add to current value of animated object, unlike ANIMATIONLOOPMODE_RELATIVE)
 */
Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT = 5;
/**
 * Creates an animation or an array of animations from a snippet saved by the Inspector
 * @deprecated Please use ParseFromSnippetAsync instead
 * @param snippetId defines the snippet to load
 * @returns a promise that will resolve to the new animation or a new array of animations
 */
Animation.CreateFromSnippetAsync = Animation.ParseFromSnippetAsync;
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .Y5)("BABYLON.Animation", Animation);
_node_js__WEBPACK_IMPORTED_MODULE_5__/* .Node */ .b._AnimationRangeFactory = (name, from, to) => new _animationRange_js__WEBPACK_IMPORTED_MODULE_4__/* .AnimationRange */ .K(name, from, to);
//# sourceMappingURL=animation.js.map

/***/ }),

/***/ 35238:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   p: () => (/* binding */ AnimationEvent)
/* harmony export */ });
/**
 * Composed of a frame, and an action function
 */
class AnimationEvent {
    /**
     * Initializes the animation event
     * @param frame The frame for which the event is triggered
     * @param action The event to perform when triggered
     * @param onlyOnce Specifies if the event should be triggered only once
     */
    constructor(
    /** The frame for which the event is triggered **/
    frame, 
    /** The event to perform when triggered **/
    action, 
    /** Specifies if the event should be triggered only once**/
    onlyOnce) {
        this.frame = frame;
        this.action = action;
        this.onlyOnce = onlyOnce;
        /**
         * Specifies if the animation event is done
         */
        this.isDone = false;
    }
    /** @internal */
    _clone() {
        return new AnimationEvent(this.frame, this.action, this.onlyOnce);
    }
}
//# sourceMappingURL=animationEvent.js.map

/***/ }),

/***/ 97689:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AnimationGroup: () => (/* binding */ AnimationGroup),
/* harmony export */   TargetedAnimation: () => (/* binding */ TargetedAnimation)
/* harmony export */ });
/* harmony import */ var _animation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7540);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6315);
/* harmony import */ var _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27152);
/* harmony import */ var _animatable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6903);





/**
 * This class defines the direct association between an animation and a target
 */
class TargetedAnimation {
    /**
     * Returns the string "TargetedAnimation"
     * @returns "TargetedAnimation"
     */
    getClassName() {
        return "TargetedAnimation";
    }
    /**
     * Serialize the object
     * @returns the JSON object representing the current entity
     */
    serialize() {
        const serializationObject = {};
        serializationObject.animation = this.animation.serialize();
        serializationObject.targetId = this.target.id;
        return serializationObject;
    }
}
/**
 * Use this class to create coordinated animations on multiple targets
 */
class AnimationGroup {
    /**
     * Gets or sets the mask associated with this animation group. This mask is used to filter which objects should be animated.
     */
    get mask() {
        return this._mask;
    }
    set mask(value) {
        if (this._mask === value) {
            return;
        }
        this._mask = value;
        this.syncWithMask(true);
    }
    /**
     * Makes sure that the animations are either played or stopped according to the animation group mask.
     * Note however that the call won't have any effect if the animation group has not been started yet.
     * @param forceUpdate If true, forces to loop over the animatables even if no mask is defined (used internally, you shouldn't need to use it). Default: false.
     */
    syncWithMask(forceUpdate = false) {
        if (!this.mask && !forceUpdate) {
            this._numActiveAnimatables = this._targetedAnimations.length;
            return;
        }
        this._numActiveAnimatables = 0;
        for (let i = 0; i < this._animatables.length; ++i) {
            const animatable = this._animatables[i];
            if (!this.mask || this.mask.disabled || this.mask.retainsTarget(animatable.target.name)) {
                this._numActiveAnimatables++;
                if (animatable.paused) {
                    animatable.restart();
                }
            }
            else {
                if (!animatable.paused) {
                    animatable.pause();
                }
            }
        }
    }
    /**
     * Removes all animations for the targets not retained by the animation group mask.
     * Use this function if you know you won't need those animations anymore and if you want to free memory.
     */
    removeUnmaskedAnimations() {
        if (!this.mask || this.mask.disabled) {
            return;
        }
        // Removes all animatables (in case the animation group has already been started)
        for (let i = 0; i < this._animatables.length; ++i) {
            const animatable = this._animatables[i];
            if (!this.mask.retainsTarget(animatable.target.name)) {
                animatable.stop();
                this._animatables.splice(i, 1);
                --i;
            }
        }
        // Removes the targeted animations
        for (let index = 0; index < this._targetedAnimations.length; index++) {
            const targetedAnimation = this._targetedAnimations[index];
            if (!this.mask.retainsTarget(targetedAnimation.target.name)) {
                this._targetedAnimations.splice(index, 1);
                --index;
            }
        }
    }
    /**
     * Gets or sets the first frame
     */
    get from() {
        return this._from;
    }
    set from(value) {
        if (this._from === value) {
            return;
        }
        this._from = value;
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.fromFrame = this._from;
        }
    }
    /**
     * Gets or sets the last frame
     */
    get to() {
        return this._to;
    }
    set to(value) {
        if (this._to === value) {
            return;
        }
        this._to = value;
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.toFrame = this._to;
        }
    }
    /**
     * Define if the animations are started
     */
    get isStarted() {
        return this._isStarted;
    }
    /**
     * Gets a value indicating that the current group is playing
     */
    get isPlaying() {
        return this._isStarted && !this._isPaused;
    }
    /**
     * Gets or sets the speed ratio to use for all animations
     */
    get speedRatio() {
        return this._speedRatio;
    }
    /**
     * Gets or sets the speed ratio to use for all animations
     */
    set speedRatio(value) {
        if (this._speedRatio === value) {
            return;
        }
        this._speedRatio = value;
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.speedRatio = this._speedRatio;
        }
    }
    /**
     * Gets or sets if all animations should loop or not
     */
    get loopAnimation() {
        return this._loopAnimation;
    }
    set loopAnimation(value) {
        if (this._loopAnimation === value) {
            return;
        }
        this._loopAnimation = value;
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.loopAnimation = this._loopAnimation;
        }
    }
    /**
     * Gets or sets if all animations should be evaluated additively
     */
    get isAdditive() {
        return this._isAdditive;
    }
    set isAdditive(value) {
        if (this._isAdditive === value) {
            return;
        }
        this._isAdditive = value;
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.isAdditive = this._isAdditive;
        }
    }
    /**
     * Gets or sets the weight to apply to all animations of the group
     */
    get weight() {
        return this._weight;
    }
    set weight(value) {
        if (this._weight === value) {
            return;
        }
        this._weight = value;
        this.setWeightForAllAnimatables(this._weight);
    }
    /**
     * Gets the targeted animations for this animation group
     */
    get targetedAnimations() {
        return this._targetedAnimations;
    }
    /**
     * returning the list of animatables controlled by this animation group.
     */
    get animatables() {
        return this._animatables;
    }
    /**
     * Gets the list of target animations
     */
    get children() {
        return this._targetedAnimations;
    }
    /**
     * Gets or sets the order of play of the animation group (default: 0)
     */
    get playOrder() {
        return this._playOrder;
    }
    set playOrder(value) {
        if (this._playOrder === value) {
            return;
        }
        this._playOrder = value;
        if (this._animatables.length > 0) {
            for (let i = 0; i < this._animatables.length; i++) {
                this._animatables[i].playOrder = this._playOrder;
            }
            this._scene.sortActiveAnimatables();
        }
    }
    /**
     * Allows the animations of the animation group to blend with current running animations
     * Note that a null value means that each animation will use their own existing blending configuration (Animation.enableBlending)
     */
    get enableBlending() {
        return this._enableBlending;
    }
    set enableBlending(value) {
        if (this._enableBlending === value) {
            return;
        }
        this._enableBlending = value;
        if (value !== null) {
            for (let i = 0; i < this._targetedAnimations.length; ++i) {
                this._targetedAnimations[i].animation.enableBlending = value;
            }
        }
    }
    /**
     * Gets or sets the animation blending speed
     * Note that a null value means that each animation will use their own existing blending configuration (Animation.blendingSpeed)
     */
    get blendingSpeed() {
        return this._blendingSpeed;
    }
    set blendingSpeed(value) {
        if (this._blendingSpeed === value) {
            return;
        }
        this._blendingSpeed = value;
        if (value !== null) {
            for (let i = 0; i < this._targetedAnimations.length; ++i) {
                this._targetedAnimations[i].animation.blendingSpeed = value;
            }
        }
    }
    /**
     * Gets the length (in seconds) of the animation group
     * This function assumes that all animations are played at the same framePerSecond speed!
     * Note: you can only call this method after you've added at least one targeted animation!
     * @param from Starting frame range (default is AnimationGroup.from)
     * @param to Ending frame range (default is AnimationGroup.to)
     * @returns The length in seconds
     */
    getLength(from, to) {
        from = from ?? this._from;
        to = to ?? this._to;
        const fps = this.targetedAnimations[0].animation.framePerSecond * this._speedRatio;
        return (to - from) / fps;
    }
    /**
     * Merge the array of animation groups into a new animation group
     * @param animationGroups List of animation groups to merge
     * @param disposeSource If true, animation groups will be disposed after being merged (default: true)
     * @param normalize If true, animation groups will be normalized before being merged, so that all animations have the same "from" and "to" frame (default: false)
     * @param weight Weight for the new animation group. If not provided, it will inherit the weight from the first animation group of the array
     * @returns The new animation group or null if no animation groups were passed
     */
    static MergeAnimationGroups(animationGroups, disposeSource = true, normalize = false, weight) {
        if (animationGroups.length === 0) {
            return null;
        }
        weight = weight ?? animationGroups[0].weight;
        let beginFrame = Number.MAX_VALUE;
        let endFrame = -Number.MAX_VALUE;
        if (normalize) {
            for (const animationGroup of animationGroups) {
                if (animationGroup.from < beginFrame) {
                    beginFrame = animationGroup.from;
                }
                if (animationGroup.to > endFrame) {
                    endFrame = animationGroup.to;
                }
            }
        }
        const mergedAnimationGroup = new AnimationGroup(animationGroups[0].name + "_merged", animationGroups[0]._scene, weight);
        for (const animationGroup of animationGroups) {
            if (normalize) {
                animationGroup.normalize(beginFrame, endFrame);
            }
            for (const targetedAnimation of animationGroup.targetedAnimations) {
                mergedAnimationGroup.addTargetedAnimation(targetedAnimation.animation, targetedAnimation.target);
            }
            if (disposeSource) {
                animationGroup.dispose();
            }
        }
        return mergedAnimationGroup;
    }
    /**
     * Instantiates a new Animation Group.
     * This helps managing several animations at once.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations
     * @param name Defines the name of the group
     * @param scene Defines the scene the group belongs to
     * @param weight Defines the weight to use for animations in the group (-1.0 by default, meaning "no weight")
     * @param playOrder Defines the order of play of the animation group (default is 0)
     */
    constructor(
    /** The name of the animation group */
    name, scene = null, weight = -1, playOrder = 0) {
        this.name = name;
        this._targetedAnimations = new Array();
        this._animatables = new Array();
        this._from = Number.MAX_VALUE;
        this._to = -Number.MAX_VALUE;
        this._speedRatio = 1;
        this._loopAnimation = false;
        this._isAdditive = false;
        this._weight = -1;
        this._playOrder = 0;
        this._enableBlending = null;
        this._blendingSpeed = null;
        this._numActiveAnimatables = 0;
        this._shouldStart = true;
        /** @internal */
        this._parentContainer = null;
        /**
         * This observable will notify when one animation have ended
         */
        this.onAnimationEndObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * Observer raised when one animation loops
         */
        this.onAnimationLoopObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * Observer raised when all animations have looped
         */
        this.onAnimationGroupLoopObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * This observable will notify when all animations have ended.
         */
        this.onAnimationGroupEndObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * This observable will notify when all animations have paused.
         */
        this.onAnimationGroupPauseObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * This observable will notify when all animations are playing.
         */
        this.onAnimationGroupPlayObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * Gets or sets an object used to store user defined information for the node
         */
        this.metadata = null;
        this._mask = null;
        this._animationLoopFlags = [];
        this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__/* .EngineStore */ .q.LastCreatedScene;
        this._weight = weight;
        this._playOrder = playOrder;
        this.uniqueId = this._scene.getUniqueId();
        this._scene.addAnimationGroup(this);
    }
    /**
     * Add an animation (with its target) in the group
     * @param animation defines the animation we want to add
     * @param target defines the target of the animation
     * @returns the TargetedAnimation object
     */
    addTargetedAnimation(animation, target) {
        const targetedAnimation = new TargetedAnimation();
        targetedAnimation.animation = animation;
        targetedAnimation.target = target;
        const keys = animation.getKeys();
        if (this._from > keys[0].frame) {
            this._from = keys[0].frame;
        }
        if (this._to < keys[keys.length - 1].frame) {
            this._to = keys[keys.length - 1].frame;
        }
        if (this._enableBlending !== null) {
            animation.enableBlending = this._enableBlending;
        }
        if (this._blendingSpeed !== null) {
            animation.blendingSpeed = this._blendingSpeed;
        }
        this._targetedAnimations.push(targetedAnimation);
        this._shouldStart = true;
        return targetedAnimation;
    }
    /**
     * Remove an animation from the group
     * @param animation defines the animation we want to remove
     */
    removeTargetedAnimation(animation) {
        for (let index = this._targetedAnimations.length - 1; index > -1; index--) {
            const targetedAnimation = this._targetedAnimations[index];
            if (targetedAnimation.animation === animation) {
                this._targetedAnimations.splice(index, 1);
            }
        }
    }
    /**
     * This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame
     * It can add constant keys at begin or end
     * @param beginFrame defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to null)
     * @param endFrame defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null)
     * @returns the animation group
     */
    normalize(beginFrame = null, endFrame = null) {
        if (beginFrame == null) {
            beginFrame = this._from;
        }
        if (endFrame == null) {
            endFrame = this._to;
        }
        for (let index = 0; index < this._targetedAnimations.length; index++) {
            const targetedAnimation = this._targetedAnimations[index];
            const keys = targetedAnimation.animation.getKeys();
            const startKey = keys[0];
            const endKey = keys[keys.length - 1];
            if (startKey.frame > beginFrame) {
                const newKey = {
                    frame: beginFrame,
                    value: startKey.value,
                    inTangent: startKey.inTangent,
                    outTangent: startKey.outTangent,
                    interpolation: startKey.interpolation,
                };
                keys.splice(0, 0, newKey);
            }
            if (endKey.frame < endFrame) {
                const newKey = {
                    frame: endFrame,
                    value: endKey.value,
                    inTangent: endKey.inTangent,
                    outTangent: endKey.outTangent,
                    interpolation: endKey.interpolation,
                };
                keys.push(newKey);
            }
        }
        this._from = beginFrame;
        this._to = endFrame;
        return this;
    }
    _processLoop(animatable, targetedAnimation, index) {
        animatable.onAnimationLoop = () => {
            this.onAnimationLoopObservable.notifyObservers(targetedAnimation);
            if (this._animationLoopFlags[index]) {
                return;
            }
            this._animationLoopFlags[index] = true;
            this._animationLoopCount++;
            if (this._animationLoopCount === this._numActiveAnimatables) {
                this.onAnimationGroupLoopObservable.notifyObservers(this);
                this._animationLoopCount = 0;
                this._animationLoopFlags.length = 0;
            }
        };
    }
    /**
     * Start all animations on given targets
     * @param loop defines if animations must loop
     * @param speedRatio defines the ratio to apply to animation speed (1 by default)
     * @param from defines the from key (optional)
     * @param to defines the to key (optional)
     * @param isAdditive defines the additive state for the resulting animatables (optional)
     * @returns the current animation group
     */
    start(loop = false, speedRatio = 1, from, to, isAdditive) {
        if (this._isStarted || this._targetedAnimations.length === 0) {
            return this;
        }
        this._loopAnimation = loop;
        this._shouldStart = false;
        this._animationLoopCount = 0;
        this._animationLoopFlags.length = 0;
        for (let index = 0; index < this._targetedAnimations.length; index++) {
            const targetedAnimation = this._targetedAnimations[index];
            const animatable = this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this._from, to !== undefined ? to : this._to, loop, speedRatio, undefined, undefined, isAdditive !== undefined ? isAdditive : this._isAdditive);
            animatable.weight = this._weight;
            animatable.playOrder = this._playOrder;
            animatable.onAnimationEnd = () => {
                this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                this._checkAnimationGroupEnded(animatable);
            };
            this._processLoop(animatable, targetedAnimation, index);
            this._animatables.push(animatable);
        }
        this.syncWithMask();
        this._scene.sortActiveAnimatables();
        this._speedRatio = speedRatio;
        this._isStarted = true;
        this._isPaused = false;
        this.onAnimationGroupPlayObservable.notifyObservers(this);
        return this;
    }
    /**
     * Pause all animations
     * @returns the animation group
     */
    pause() {
        if (!this._isStarted) {
            return this;
        }
        this._isPaused = true;
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.pause();
        }
        this.onAnimationGroupPauseObservable.notifyObservers(this);
        return this;
    }
    /**
     * Play all animations to initial state
     * This function will start() the animations if they were not started or will restart() them if they were paused
     * @param loop defines if animations must loop
     * @returns the animation group
     */
    play(loop) {
        // only if there are animatable available
        if (this.isStarted && this._animatables.length && !this._shouldStart) {
            if (loop !== undefined) {
                this.loopAnimation = loop;
            }
            this.restart();
        }
        else {
            this.stop();
            this.start(loop, this._speedRatio);
        }
        return this;
    }
    /**
     * Reset all animations to initial state
     * @returns the animation group
     */
    reset() {
        if (!this._isStarted) {
            this.play();
            this.goToFrame(0);
            this.stop(true);
            return this;
        }
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.reset();
        }
        return this;
    }
    /**
     * Restart animations from after pausing it
     * @returns the animation group
     */
    restart() {
        if (!this._isStarted) {
            return this;
        }
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.restart();
        }
        this.syncWithMask();
        this._isPaused = false;
        this.onAnimationGroupPlayObservable.notifyObservers(this);
        return this;
    }
    /**
     * Stop all animations
     * @param skipOnAnimationEnd defines if the system should not raise onAnimationEnd. Default is false
     * @returns the animation group
     */
    stop(skipOnAnimationEnd = false) {
        if (!this._isStarted) {
            return this;
        }
        const list = this._animatables.slice();
        for (let index = 0; index < list.length; index++) {
            list[index].stop(undefined, undefined, true, skipOnAnimationEnd);
        }
        // We will take care of removing all stopped animatables
        let curIndex = 0;
        for (let index = 0; index < this._scene._activeAnimatables.length; index++) {
            const animatable = this._scene._activeAnimatables[index];
            if (animatable._runtimeAnimations.length > 0) {
                this._scene._activeAnimatables[curIndex++] = animatable;
            }
            else if (skipOnAnimationEnd) {
                // We normally rely on the onAnimationEnd callback (assigned in the start function) to be notified when an animatable
                // ends and should be removed from the active animatables array. However, if the animatable is stopped with the skipOnAnimationEnd
                // flag set to true, then we need to explicitly remove it from the active animatables array.
                this._checkAnimationGroupEnded(animatable, skipOnAnimationEnd);
            }
        }
        this._scene._activeAnimatables.length = curIndex;
        this._isStarted = false;
        return this;
    }
    /**
     * Set animation weight for all animatables
     *
     * @since 6.12.4
     *  You can pass the weight to the AnimationGroup constructor, or use the weight property to set it after the group has been created,
     *  making it easier to define the overall animation weight than calling setWeightForAllAnimatables() after the animation group has been started
     * @param weight defines the weight to use
     * @returns the animationGroup
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-weights
     */
    setWeightForAllAnimatables(weight) {
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.weight = weight;
        }
        return this;
    }
    /**
     * Synchronize and normalize all animatables with a source animatable
     * @param root defines the root animatable to synchronize with (null to stop synchronizing)
     * @returns the animationGroup
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-weights
     */
    syncAllAnimationsWith(root) {
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.syncWith(root);
        }
        return this;
    }
    /**
     * Goes to a specific frame in this animation group. Note that the animation group must be in playing or paused status
     * @param frame the frame number to go to
     * @param useWeight defines whether the animation weight should be applied to the image to be jumped to (false by default)
     * @returns the animationGroup
     */
    goToFrame(frame, useWeight = false) {
        if (!this._isStarted) {
            return this;
        }
        for (let index = 0; index < this._animatables.length; index++) {
            const animatable = this._animatables[index];
            animatable.goToFrame(frame, useWeight);
        }
        return this;
    }
    /**
     * Helper to get the current frame. This will return 0 if the AnimationGroup is not running, and it might return wrong results if multiple animations are running in different frames.
     * @returns current animation frame.
     */
    getCurrentFrame() {
        return this.animatables[0]?.masterFrame || 0;
    }
    /**
     * Dispose all associated resources
     */
    dispose() {
        if (this.isStarted) {
            this.stop();
        }
        this._targetedAnimations.length = 0;
        this._animatables.length = 0;
        // Remove from scene
        const index = this._scene.animationGroups.indexOf(this);
        if (index > -1) {
            this._scene.animationGroups.splice(index, 1);
        }
        if (this._parentContainer) {
            const index = this._parentContainer.animationGroups.indexOf(this);
            if (index > -1) {
                this._parentContainer.animationGroups.splice(index, 1);
            }
            this._parentContainer = null;
        }
        this.onAnimationEndObservable.clear();
        this.onAnimationGroupEndObservable.clear();
        this.onAnimationGroupPauseObservable.clear();
        this.onAnimationGroupPlayObservable.clear();
        this.onAnimationLoopObservable.clear();
        this.onAnimationGroupLoopObservable.clear();
    }
    _checkAnimationGroupEnded(animatable, skipOnAnimationEnd = false) {
        // animatable should be taken out of the array
        const idx = this._animatables.indexOf(animatable);
        if (idx > -1) {
            this._animatables.splice(idx, 1);
        }
        // all animatables were removed? animation group ended!
        if (this._animatables.length === this._targetedAnimations.length - this._numActiveAnimatables) {
            this._isStarted = false;
            if (!skipOnAnimationEnd) {
                this.onAnimationGroupEndObservable.notifyObservers(this);
            }
            this._animatables.length = 0;
        }
    }
    /**
     * Clone the current animation group and returns a copy
     * @param newName defines the name of the new group
     * @param targetConverter defines an optional function used to convert current animation targets to new ones
     * @param cloneAnimations defines if the animations should be cloned or referenced
     * @returns the new animation group
     */
    clone(newName, targetConverter, cloneAnimations = false) {
        const newGroup = new AnimationGroup(newName || this.name, this._scene, this._weight, this._playOrder);
        newGroup._from = this.from;
        newGroup._to = this.to;
        newGroup._speedRatio = this.speedRatio;
        newGroup._loopAnimation = this.loopAnimation;
        newGroup._isAdditive = this.isAdditive;
        newGroup._enableBlending = this.enableBlending;
        newGroup._blendingSpeed = this.blendingSpeed;
        newGroup.metadata = this.metadata;
        newGroup.mask = this.mask;
        for (const targetAnimation of this._targetedAnimations) {
            newGroup.addTargetedAnimation(cloneAnimations ? targetAnimation.animation.clone() : targetAnimation.animation, targetConverter ? targetConverter(targetAnimation.target) : targetAnimation.target);
        }
        return newGroup;
    }
    /**
     * Serializes the animationGroup to an object
     * @returns Serialized object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.from = this.from;
        serializationObject.to = this.to;
        serializationObject.speedRatio = this.speedRatio;
        serializationObject.loopAnimation = this.loopAnimation;
        serializationObject.isAdditive = this.isAdditive;
        serializationObject.weight = this.weight;
        serializationObject.playOrder = this.playOrder;
        serializationObject.enableBlending = this.enableBlending;
        serializationObject.blendingSpeed = this.blendingSpeed;
        serializationObject.targetedAnimations = [];
        for (let targetedAnimationIndex = 0; targetedAnimationIndex < this.targetedAnimations.length; targetedAnimationIndex++) {
            const targetedAnimation = this.targetedAnimations[targetedAnimationIndex];
            serializationObject.targetedAnimations[targetedAnimationIndex] = targetedAnimation.serialize();
        }
        if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.HasTags(this)) {
            serializationObject.tags = _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.GetTags(this);
        }
        // Metadata
        if (this.metadata) {
            serializationObject.metadata = this.metadata;
        }
        return serializationObject;
    }
    // Statics
    /**
     * Returns a new AnimationGroup object parsed from the source provided.
     * @param parsedAnimationGroup defines the source
     * @param scene defines the scene that will receive the animationGroup
     * @returns a new AnimationGroup
     */
    static Parse(parsedAnimationGroup, scene) {
        const animationGroup = new AnimationGroup(parsedAnimationGroup.name, scene, parsedAnimationGroup.weight, parsedAnimationGroup.playOrder);
        for (let i = 0; i < parsedAnimationGroup.targetedAnimations.length; i++) {
            const targetedAnimation = parsedAnimationGroup.targetedAnimations[i];
            const animation = _animation_js__WEBPACK_IMPORTED_MODULE_0__/* .Animation */ .X5.Parse(targetedAnimation.animation);
            const id = targetedAnimation.targetId;
            if (targetedAnimation.animation.property === "influence") {
                // morph target animation
                const morphTarget = scene.getMorphTargetById(id);
                if (morphTarget) {
                    animationGroup.addTargetedAnimation(animation, morphTarget);
                }
            }
            else {
                const targetNode = scene.getNodeById(id);
                if (targetNode != null) {
                    animationGroup.addTargetedAnimation(animation, targetNode);
                }
            }
        }
        if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y) {
            _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.AddTagsTo(animationGroup, parsedAnimationGroup.tags);
        }
        if (parsedAnimationGroup.from !== null && parsedAnimationGroup.to !== null) {
            animationGroup.normalize(parsedAnimationGroup.from, parsedAnimationGroup.to);
        }
        if (parsedAnimationGroup.speedRatio !== undefined) {
            animationGroup._speedRatio = parsedAnimationGroup.speedRatio;
        }
        if (parsedAnimationGroup.loopAnimation !== undefined) {
            animationGroup._loopAnimation = parsedAnimationGroup.loopAnimation;
        }
        if (parsedAnimationGroup.isAdditive !== undefined) {
            animationGroup._isAdditive = parsedAnimationGroup.isAdditive;
        }
        if (parsedAnimationGroup.weight !== undefined) {
            animationGroup._weight = parsedAnimationGroup.weight;
        }
        if (parsedAnimationGroup.playOrder !== undefined) {
            animationGroup._playOrder = parsedAnimationGroup.playOrder;
        }
        if (parsedAnimationGroup.enableBlending !== undefined) {
            animationGroup._enableBlending = parsedAnimationGroup.enableBlending;
        }
        if (parsedAnimationGroup.blendingSpeed !== undefined) {
            animationGroup._blendingSpeed = parsedAnimationGroup.blendingSpeed;
        }
        if (parsedAnimationGroup.metadata !== undefined) {
            animationGroup.metadata = parsedAnimationGroup.metadata;
        }
        return animationGroup;
    }
    /** @internal */
    static MakeAnimationAdditive(sourceAnimationGroup, referenceFrameOrOptions, range, cloneOriginal = false, clonedName) {
        let options;
        if (typeof referenceFrameOrOptions === "object") {
            options = referenceFrameOrOptions;
        }
        else {
            options = {
                referenceFrame: referenceFrameOrOptions,
                range: range,
                cloneOriginalAnimationGroup: cloneOriginal,
                clonedAnimationName: clonedName,
            };
        }
        let animationGroup = sourceAnimationGroup;
        if (options.cloneOriginalAnimationGroup) {
            animationGroup = sourceAnimationGroup.clone(options.clonedAnimationGroupName || animationGroup.name);
        }
        const targetedAnimations = animationGroup.targetedAnimations;
        for (let index = 0; index < targetedAnimations.length; index++) {
            const targetedAnimation = targetedAnimations[index];
            targetedAnimation.animation = _animation_js__WEBPACK_IMPORTED_MODULE_0__/* .Animation */ .X5.MakeAnimationAdditive(targetedAnimation.animation, options);
        }
        animationGroup.isAdditive = true;
        if (options.clipKeys) {
            // We need to recalculate the from/to frames for the animation group because some keys may have been removed
            let from = Number.MAX_VALUE;
            let to = -Number.MAX_VALUE;
            const targetedAnimations = animationGroup.targetedAnimations;
            for (let index = 0; index < targetedAnimations.length; index++) {
                const targetedAnimation = targetedAnimations[index];
                const animation = targetedAnimation.animation;
                const keys = animation.getKeys();
                if (from > keys[0].frame) {
                    from = keys[0].frame;
                }
                if (to < keys[keys.length - 1].frame) {
                    to = keys[keys.length - 1].frame;
                }
            }
            animationGroup._from = from;
            animationGroup._to = to;
        }
        return animationGroup;
    }
    /**
     * Creates a new animation, keeping only the keys that are inside a given key range
     * @param sourceAnimationGroup defines the animation group on which to operate
     * @param fromKey defines the lower bound of the range
     * @param toKey defines the upper bound of the range
     * @param name defines the name of the new animation group. If not provided, use the same name as animationGroup
     * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned
     * @returns a new animation group stripped from all the keys outside the given range
     */
    static ClipKeys(sourceAnimationGroup, fromKey, toKey, name, dontCloneAnimations) {
        const animationGroup = sourceAnimationGroup.clone(name || sourceAnimationGroup.name);
        return AnimationGroup.ClipKeysInPlace(animationGroup, fromKey, toKey, dontCloneAnimations);
    }
    /**
     * Updates an existing animation, keeping only the keys that are inside a given key range
     * @param animationGroup defines the animation group on which to operate
     * @param fromKey defines the lower bound of the range
     * @param toKey defines the upper bound of the range
     * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned
     * @returns the animationGroup stripped from all the keys outside the given range
     */
    static ClipKeysInPlace(animationGroup, fromKey, toKey, dontCloneAnimations) {
        return AnimationGroup.ClipInPlace(animationGroup, fromKey, toKey, dontCloneAnimations, false);
    }
    /**
     * Creates a new animation, keeping only the frames that are inside a given frame range
     * @param sourceAnimationGroup defines the animation group on which to operate
     * @param fromFrame defines the lower bound of the range
     * @param toFrame defines the upper bound of the range
     * @param name defines the name of the new animation group. If not provided, use the same name as animationGroup
     * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned
     * @returns a new animation group stripped from all the frames outside the given range
     */
    static ClipFrames(sourceAnimationGroup, fromFrame, toFrame, name, dontCloneAnimations) {
        const animationGroup = sourceAnimationGroup.clone(name || sourceAnimationGroup.name);
        return AnimationGroup.ClipFramesInPlace(animationGroup, fromFrame, toFrame, dontCloneAnimations);
    }
    /**
     * Updates an existing animation, keeping only the frames that are inside a given frame range
     * @param animationGroup defines the animation group on which to operate
     * @param fromFrame defines the lower bound of the range
     * @param toFrame defines the upper bound of the range
     * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned
     * @returns the animationGroup stripped from all the frames outside the given range
     */
    static ClipFramesInPlace(animationGroup, fromFrame, toFrame, dontCloneAnimations) {
        return AnimationGroup.ClipInPlace(animationGroup, fromFrame, toFrame, dontCloneAnimations, true);
    }
    /**
     * Updates an existing animation, keeping only the keys that are inside a given key or frame range
     * @param animationGroup defines the animation group on which to operate
     * @param start defines the lower bound of the range
     * @param end defines the upper bound of the range
     * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned
     * @param useFrame defines if the range is defined by frame numbers or key indices (default is false which means use key indices)
     * @returns the animationGroup stripped from all the keys outside the given range
     */
    static ClipInPlace(animationGroup, start, end, dontCloneAnimations, useFrame = false) {
        let from = Number.MAX_VALUE;
        let to = -Number.MAX_VALUE;
        const targetedAnimations = animationGroup.targetedAnimations;
        for (let index = 0; index < targetedAnimations.length; index++) {
            const targetedAnimation = targetedAnimations[index];
            const animation = dontCloneAnimations ? targetedAnimation.animation : targetedAnimation.animation.clone();
            if (useFrame) {
                // Make sure we have keys corresponding to the bounds of the frame range
                animation.createKeyForFrame(start);
                animation.createKeyForFrame(end);
            }
            const keys = animation.getKeys();
            const newKeys = [];
            let startFrame = Number.MAX_VALUE;
            for (let k = 0; k < keys.length; k++) {
                const key = keys[k];
                if ((!useFrame && k >= start && k <= end) || (useFrame && key.frame >= start && key.frame <= end)) {
                    const newKey = {
                        frame: key.frame,
                        value: key.value.clone ? key.value.clone() : key.value,
                        inTangent: key.inTangent,
                        outTangent: key.outTangent,
                        interpolation: key.interpolation,
                        lockedTangent: key.lockedTangent,
                    };
                    if (startFrame === Number.MAX_VALUE) {
                        startFrame = newKey.frame;
                    }
                    newKey.frame -= startFrame;
                    newKeys.push(newKey);
                }
            }
            if (newKeys.length === 0) {
                targetedAnimations.splice(index, 1);
                index--;
                continue;
            }
            if (from > newKeys[0].frame) {
                from = newKeys[0].frame;
            }
            if (to < newKeys[newKeys.length - 1].frame) {
                to = newKeys[newKeys.length - 1].frame;
            }
            animation.setKeys(newKeys, true);
            targetedAnimation.animation = animation; // in case the animation has been cloned
        }
        animationGroup._from = from;
        animationGroup._to = to;
        return animationGroup;
    }
    /**
     * Returns the string "AnimationGroup"
     * @returns "AnimationGroup"
     */
    getClassName() {
        return "AnimationGroup";
    }
    /**
     * Creates a detailed string about the object
     * @param fullDetails defines if the output string will support multiple levels of logging within scene loading
     * @returns a string representing the object
     */
    toString(fullDetails) {
        let ret = "Name: " + this.name;
        ret += ", type: " + this.getClassName();
        if (fullDetails) {
            ret += ", from: " + this._from;
            ret += ", to: " + this._to;
            ret += ", isStarted: " + this._isStarted;
            ret += ", speedRatio: " + this._speedRatio;
            ret += ", targetedAnimations length: " + this._targetedAnimations.length;
            ret += ", animatables length: " + this._animatables;
        }
        return ret;
    }
}
//# sourceMappingURL=animationGroup.js.map

/***/ }),

/***/ 56227:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   K: () => (/* binding */ AnimationRange)
/* harmony export */ });
/**
 * Represents the range of an animation
 */
class AnimationRange {
    /**
     * Initializes the range of an animation
     * @param name The name of the animation range
     * @param from The starting frame of the animation
     * @param to The ending frame of the animation
     */
    constructor(
    /**The name of the animation range**/
    name, 
    /**The starting frame of the animation */
    from, 
    /**The ending frame of the animation*/
    to) {
        this.name = name;
        this.from = from;
        this.to = to;
    }
    /**
     * Makes a copy of the animation range
     * @returns A copy of the animation range
     */
    clone() {
        return new AnimationRange(this.name, this.from, this.to);
    }
}
//# sourceMappingURL=animationRange.js.map

/***/ }),

/***/ 27266:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   x: () => (/* binding */ RuntimeAnimation)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _animation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7540);


/**
 * Defines a runtime animation
 */
class RuntimeAnimation {
    /**
     * Gets the current frame of the runtime animation
     */
    get currentFrame() {
        return this._currentFrame;
    }
    /**
     * Gets the weight of the runtime animation
     */
    get weight() {
        return this._weight;
    }
    /**
     * Gets the current value of the runtime animation
     */
    get currentValue() {
        return this._currentValue;
    }
    /**
     * Gets or sets the target path of the runtime animation
     */
    get targetPath() {
        return this._targetPath;
    }
    /**
     * Gets the actual target of the runtime animation
     */
    get target() {
        return this._currentActiveTarget;
    }
    /**
     * Gets the additive state of the runtime animation
     */
    get isAdditive() {
        return this._host && this._host.isAdditive;
    }
    /**
     * Create a new RuntimeAnimation object
     * @param target defines the target of the animation
     * @param animation defines the source animation object
     * @param scene defines the hosting scene
     * @param host defines the initiating Animatable
     */
    constructor(target, animation, scene, host) {
        this._events = new Array();
        /**
         * The current frame of the runtime animation
         */
        this._currentFrame = 0;
        /**
         * The original value of the runtime animation
         */
        this._originalValue = new Array();
        /**
         * The original blend value of the runtime animation
         */
        this._originalBlendValue = null;
        /**
         * The offsets cache of the runtime animation
         */
        this._offsetsCache = {};
        /**
         * The high limits cache of the runtime animation
         */
        this._highLimitsCache = {};
        /**
         * Specifies if the runtime animation has been stopped
         */
        this._stopped = false;
        /**
         * The blending factor of the runtime animation
         */
        this._blendingFactor = 0;
        /**
         * The current value of the runtime animation
         */
        this._currentValue = null;
        this._currentActiveTarget = null;
        this._directTarget = null;
        /**
         * The target path of the runtime animation
         */
        this._targetPath = "";
        /**
         * The weight of the runtime animation
         */
        this._weight = 1.0;
        /**
         * The absolute frame offset of the runtime animation
         */
        this._absoluteFrameOffset = 0;
        /**
         * The previous elapsed time (since start of animation) of the runtime animation
         */
        this._previousElapsedTime = 0;
        this._yoyoDirection = 1;
        /**
         * The previous absolute frame of the runtime animation (meaning, without taking into account the from/to values, only the elapsed time and the fps)
         */
        this._previousAbsoluteFrame = 0;
        this._targetIsArray = false;
        this._animation = animation;
        this._target = target;
        this._scene = scene;
        this._host = host;
        this._activeTargets = [];
        animation._runtimeAnimations.push(this);
        // State
        this._animationState = {
            key: 0,
            repeatCount: 0,
            loopMode: this._getCorrectLoopMode(),
        };
        if (this._animation.dataType === _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_MATRIX) {
            this._animationState.workValue = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Zero();
        }
        // Limits
        this._keys = this._animation.getKeys();
        this._minFrame = this._keys[0].frame;
        this._maxFrame = this._keys[this._keys.length - 1].frame;
        this._minValue = this._keys[0].value;
        this._maxValue = this._keys[this._keys.length - 1].value;
        // Add a start key at frame 0 if missing
        if (this._minFrame !== 0) {
            const newKey = { frame: 0, value: this._minValue };
            this._keys.splice(0, 0, newKey);
        }
        // Check data
        if (this._target instanceof Array) {
            let index = 0;
            for (const target of this._target) {
                this._preparePath(target, index);
                this._getOriginalValues(index);
                index++;
            }
            this._targetIsArray = true;
        }
        else {
            this._preparePath(this._target);
            this._getOriginalValues();
            this._targetIsArray = false;
            this._directTarget = this._activeTargets[0];
        }
        // Cloning events locally
        const events = animation.getEvents();
        if (events && events.length > 0) {
            events.forEach((e) => {
                this._events.push(e._clone());
            });
        }
        this._enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
    }
    _preparePath(target, targetIndex = 0) {
        const targetPropertyPath = this._animation.targetPropertyPath;
        if (targetPropertyPath.length > 1) {
            let property = target;
            for (let index = 0; index < targetPropertyPath.length - 1; index++) {
                const name = targetPropertyPath[index];
                property = property[name];
                if (property === undefined) {
                    throw new Error(`Invalid property (${name}) in property path (${targetPropertyPath.join(".")})`);
                }
            }
            this._targetPath = targetPropertyPath[targetPropertyPath.length - 1];
            this._activeTargets[targetIndex] = property;
        }
        else {
            this._targetPath = targetPropertyPath[0];
            this._activeTargets[targetIndex] = target;
        }
        if (this._activeTargets[targetIndex][this._targetPath] === undefined) {
            throw new Error(`Invalid property (${this._targetPath}) in property path (${targetPropertyPath.join(".")})`);
        }
    }
    /**
     * Gets the animation from the runtime animation
     */
    get animation() {
        return this._animation;
    }
    /**
     * Resets the runtime animation to the beginning
     * @param restoreOriginal defines whether to restore the target property to the original value
     */
    reset(restoreOriginal = false) {
        if (restoreOriginal) {
            if (this._target instanceof Array) {
                let index = 0;
                for (const target of this._target) {
                    if (this._originalValue[index] !== undefined) {
                        this._setValue(target, this._activeTargets[index], this._originalValue[index], -1, index);
                    }
                    index++;
                }
            }
            else {
                if (this._originalValue[0] !== undefined) {
                    this._setValue(this._target, this._directTarget, this._originalValue[0], -1, 0);
                }
            }
        }
        this._offsetsCache = {};
        this._highLimitsCache = {};
        this._currentFrame = 0;
        this._blendingFactor = 0;
        // Events
        for (let index = 0; index < this._events.length; index++) {
            this._events[index].isDone = false;
        }
    }
    /**
     * Specifies if the runtime animation is stopped
     * @returns Boolean specifying if the runtime animation is stopped
     */
    isStopped() {
        return this._stopped;
    }
    /**
     * Disposes of the runtime animation
     */
    dispose() {
        const index = this._animation.runtimeAnimations.indexOf(this);
        if (index > -1) {
            this._animation.runtimeAnimations.splice(index, 1);
        }
    }
    /**
     * Apply the interpolated value to the target
     * @param currentValue defines the value computed by the animation
     * @param weight defines the weight to apply to this value (Defaults to 1.0)
     */
    setValue(currentValue, weight) {
        if (this._targetIsArray) {
            for (let index = 0; index < this._target.length; index++) {
                const target = this._target[index];
                this._setValue(target, this._activeTargets[index], currentValue, weight, index);
            }
            return;
        }
        this._setValue(this._target, this._directTarget, currentValue, weight, 0);
    }
    _getOriginalValues(targetIndex = 0) {
        let originalValue;
        const target = this._activeTargets[targetIndex];
        if (target.getLocalMatrix && this._targetPath === "_matrix") {
            // For bones
            originalValue = target.getLocalMatrix();
        }
        else {
            originalValue = target[this._targetPath];
        }
        if (originalValue && originalValue.clone) {
            this._originalValue[targetIndex] = originalValue.clone();
        }
        else {
            this._originalValue[targetIndex] = originalValue;
        }
    }
    _registerTargetForLateAnimationBinding(runtimeAnimation, originalValue) {
        const target = runtimeAnimation.target;
        this._scene._registeredForLateAnimationBindings.pushNoDuplicate(target);
        if (!target._lateAnimationHolders) {
            target._lateAnimationHolders = {};
        }
        if (!target._lateAnimationHolders[runtimeAnimation.targetPath]) {
            target._lateAnimationHolders[runtimeAnimation.targetPath] = {
                totalWeight: 0,
                totalAdditiveWeight: 0,
                animations: [],
                additiveAnimations: [],
                originalValue: originalValue,
            };
        }
        if (runtimeAnimation.isAdditive) {
            target._lateAnimationHolders[runtimeAnimation.targetPath].additiveAnimations.push(runtimeAnimation);
            target._lateAnimationHolders[runtimeAnimation.targetPath].totalAdditiveWeight += runtimeAnimation.weight;
        }
        else {
            target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation);
            target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight;
        }
    }
    _setValue(target, destination, currentValue, weight, targetIndex) {
        // Set value
        this._currentActiveTarget = destination;
        this._weight = weight;
        if (this._enableBlending && this._blendingFactor <= 1.0) {
            if (!this._originalBlendValue) {
                const originalValue = destination[this._targetPath];
                if (originalValue.clone) {
                    this._originalBlendValue = originalValue.clone();
                }
                else {
                    this._originalBlendValue = originalValue;
                }
            }
            if (this._originalBlendValue.m) {
                // Matrix
                if (_animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.AllowMatrixDecomposeForInterpolation) {
                    if (this._currentValue) {
                        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.DecomposeLerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);
                    }
                    else {
                        this._currentValue = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.DecomposeLerp(this._originalBlendValue, currentValue, this._blendingFactor);
                    }
                }
                else {
                    if (this._currentValue) {
                        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.LerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);
                    }
                    else {
                        this._currentValue = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Lerp(this._originalBlendValue, currentValue, this._blendingFactor);
                    }
                }
            }
            else {
                this._currentValue = _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5._UniversalLerp(this._originalBlendValue, currentValue, this._blendingFactor);
            }
            const blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
            this._blendingFactor += blendingSpeed;
        }
        else {
            if (!this._currentValue) {
                if (currentValue?.clone) {
                    this._currentValue = currentValue.clone();
                }
                else {
                    this._currentValue = currentValue;
                }
            }
            else if (this._currentValue.copyFrom) {
                this._currentValue.copyFrom(currentValue);
            }
            else {
                this._currentValue = currentValue;
            }
        }
        if (weight !== -1.0) {
            this._registerTargetForLateAnimationBinding(this, this._originalValue[targetIndex]);
        }
        else {
            if (this._animationState.loopMode === _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT) {
                if (this._currentValue.addToRef) {
                    this._currentValue.addToRef(this._originalValue[targetIndex], destination[this._targetPath]);
                }
                else {
                    destination[this._targetPath] = this._originalValue[targetIndex] + this._currentValue;
                }
            }
            else {
                destination[this._targetPath] = this._currentValue;
            }
        }
        if (target.markAsDirty) {
            target.markAsDirty(this._animation.targetProperty);
        }
    }
    /**
     * Gets the loop pmode of the runtime animation
     * @returns Loop Mode
     */
    _getCorrectLoopMode() {
        if (this._target && this._target.animationPropertiesOverride) {
            return this._target.animationPropertiesOverride.loopMode;
        }
        return this._animation.loopMode;
    }
    /**
     * Move the current animation to a given frame
     * @param frame defines the frame to move to
     * @param weight defines the weight to apply to the animation (-1.0 by default)
     */
    goToFrame(frame, weight = -1) {
        const keys = this._animation.getKeys();
        if (frame < keys[0].frame) {
            frame = keys[0].frame;
        }
        else if (frame > keys[keys.length - 1].frame) {
            frame = keys[keys.length - 1].frame;
        }
        // Need to reset animation events
        const events = this._events;
        if (events.length) {
            for (let index = 0; index < events.length; index++) {
                if (!events[index].onlyOnce) {
                    // reset events in the future
                    events[index].isDone = events[index].frame < frame;
                }
            }
        }
        this._currentFrame = frame;
        const currentValue = this._animation._interpolate(frame, this._animationState);
        this.setValue(currentValue, weight);
    }
    /**
     * @internal Internal use only
     */
    _prepareForSpeedRatioChange(newSpeedRatio) {
        const newAbsoluteFrame = (this._previousElapsedTime * (this._animation.framePerSecond * newSpeedRatio)) / 1000.0;
        this._absoluteFrameOffset = this._previousAbsoluteFrame - newAbsoluteFrame;
    }
    /**
     * Execute the current animation
     * @param elapsedTimeSinceAnimationStart defines the elapsed time (in milliseconds) since the animation was started
     * @param from defines the lower frame of the animation range
     * @param to defines the upper frame of the animation range
     * @param loop defines if the current animation must loop
     * @param speedRatio defines the current speed ratio
     * @param weight defines the weight of the animation (default is -1 so no weight)
     * @returns a boolean indicating if the animation is running
     */
    animate(elapsedTimeSinceAnimationStart, from, to, loop, speedRatio, weight = -1.0) {
        const animation = this._animation;
        const targetPropertyPath = animation.targetPropertyPath;
        if (!targetPropertyPath || targetPropertyPath.length < 1) {
            this._stopped = true;
            return false;
        }
        let returnValue = true;
        // Check limits
        if (from < this._minFrame || from > this._maxFrame) {
            from = this._minFrame;
        }
        if (to < this._minFrame || to > this._maxFrame) {
            to = this._maxFrame;
        }
        const frameRange = to - from;
        let offsetValue;
        // Compute the frame according to the elapsed time and the fps of the animation ("from" and "to" are not factored in!)
        let absoluteFrame = (elapsedTimeSinceAnimationStart * (animation.framePerSecond * speedRatio)) / 1000.0 + this._absoluteFrameOffset;
        let highLimitValue = 0;
        // Apply the yoyo function if required
        let yoyoLoop = false;
        const yoyoMode = loop && this._animationState.loopMode === _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONLOOPMODE_YOYO;
        if (yoyoMode) {
            const position = (absoluteFrame - from) / frameRange;
            // Apply the yoyo curve
            const sin = Math.sin(position * Math.PI);
            const yoyoPosition = Math.abs(sin);
            // Map the yoyo position back to the range
            absoluteFrame = yoyoPosition * frameRange + from;
            const direction = sin >= 0 ? 1 : -1;
            if (this._yoyoDirection !== direction) {
                yoyoLoop = true;
            }
            this._yoyoDirection = direction;
        }
        this._previousElapsedTime = elapsedTimeSinceAnimationStart;
        this._previousAbsoluteFrame = absoluteFrame;
        if (!loop && to >= from && ((absoluteFrame >= frameRange && speedRatio > 0) || (absoluteFrame <= 0 && speedRatio < 0))) {
            // If we are out of range and not looping get back to caller
            returnValue = false;
            highLimitValue = animation._getKeyValue(this._maxValue);
        }
        else if (!loop && from >= to && ((absoluteFrame <= frameRange && speedRatio < 0) || (absoluteFrame >= 0 && speedRatio > 0))) {
            returnValue = false;
            highLimitValue = animation._getKeyValue(this._minValue);
        }
        else if (this._animationState.loopMode !== _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONLOOPMODE_CYCLE) {
            const keyOffset = to.toString() + from.toString();
            if (!this._offsetsCache[keyOffset]) {
                this._animationState.repeatCount = 0;
                this._animationState.loopMode = _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONLOOPMODE_CYCLE; // force a specific codepath in animation._interpolate()!
                const fromValue = animation._interpolate(from, this._animationState);
                const toValue = animation._interpolate(to, this._animationState);
                this._animationState.loopMode = this._getCorrectLoopMode();
                switch (animation.dataType) {
                    // Float
                    case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_FLOAT:
                        this._offsetsCache[keyOffset] = toValue - fromValue;
                        break;
                    // Quaternion
                    case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_QUATERNION:
                        this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
                        break;
                    // Vector3
                    case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_VECTOR3:
                        this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
                        break;
                    // Vector2
                    case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_VECTOR2:
                        this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
                        break;
                    // Size
                    case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_SIZE:
                        this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
                        break;
                    // Color3
                    case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_COLOR3:
                        this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
                        break;
                    default:
                        break;
                }
                this._highLimitsCache[keyOffset] = toValue;
            }
            highLimitValue = this._highLimitsCache[keyOffset];
            offsetValue = this._offsetsCache[keyOffset];
        }
        if (offsetValue === undefined) {
            switch (animation.dataType) {
                // Float
                case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_FLOAT:
                    offsetValue = 0;
                    break;
                // Quaternion
                case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_QUATERNION:
                    offsetValue = _animation_js__WEBPACK_IMPORTED_MODULE_1__/* ._staticOffsetValueQuaternion */ .s$;
                    break;
                // Vector3
                case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_VECTOR3:
                    offsetValue = _animation_js__WEBPACK_IMPORTED_MODULE_1__/* ._staticOffsetValueVector3 */ .y4;
                    break;
                // Vector2
                case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_VECTOR2:
                    offsetValue = _animation_js__WEBPACK_IMPORTED_MODULE_1__/* ._staticOffsetValueVector2 */ .rq;
                    break;
                // Size
                case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_SIZE:
                    offsetValue = _animation_js__WEBPACK_IMPORTED_MODULE_1__/* ._staticOffsetValueSize */ .vF;
                    break;
                // Color3
                case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_COLOR3:
                    offsetValue = _animation_js__WEBPACK_IMPORTED_MODULE_1__/* ._staticOffsetValueColor3 */ .eA;
                    break;
                case _animation_js__WEBPACK_IMPORTED_MODULE_1__/* .Animation */ .X5.ANIMATIONTYPE_COLOR4:
                    offsetValue = _animation_js__WEBPACK_IMPORTED_MODULE_1__/* ._staticOffsetValueColor4 */ .nl;
                    break;
            }
        }
        // Compute value
        let currentFrame;
        if (this._host && this._host.syncRoot) {
            // If we must sync with an animatable, calculate the current frame based on the frame of the root animatable
            const syncRoot = this._host.syncRoot;
            const hostNormalizedFrame = (syncRoot.masterFrame - syncRoot.fromFrame) / (syncRoot.toFrame - syncRoot.fromFrame);
            currentFrame = from + frameRange * hostNormalizedFrame;
        }
        else {
            if ((absoluteFrame > 0 && from > to) || (absoluteFrame < 0 && from < to)) {
                currentFrame = returnValue && frameRange !== 0 ? to + (absoluteFrame % frameRange) : from;
            }
            else {
                currentFrame = returnValue && frameRange !== 0 ? from + (absoluteFrame % frameRange) : to;
            }
        }
        const events = this._events;
        // Reset event/state if looping
        if ((!yoyoMode && ((speedRatio > 0 && this.currentFrame > currentFrame) || (speedRatio < 0 && this.currentFrame < currentFrame))) || (yoyoMode && yoyoLoop)) {
            this._onLoop();
            // Need to reset animation events
            for (let index = 0; index < events.length; index++) {
                if (!events[index].onlyOnce) {
                    // reset event, the animation is looping
                    events[index].isDone = false;
                }
            }
            this._animationState.key = speedRatio > 0 ? 0 : animation.getKeys().length - 1;
        }
        this._currentFrame = currentFrame;
        this._animationState.repeatCount = frameRange === 0 ? 0 : (absoluteFrame / frameRange) >> 0;
        this._animationState.highLimitValue = highLimitValue;
        this._animationState.offsetValue = offsetValue;
        const currentValue = animation._interpolate(currentFrame, this._animationState);
        // Set value
        this.setValue(currentValue, weight);
        // Check events
        if (events.length) {
            for (let index = 0; index < events.length; index++) {
                // Make sure current frame has passed event frame and that event frame is within the current range
                // Also, handle both forward and reverse animations
                if ((frameRange >= 0 && currentFrame >= events[index].frame && events[index].frame >= from) ||
                    (frameRange < 0 && currentFrame <= events[index].frame && events[index].frame <= from)) {
                    const event = events[index];
                    if (!event.isDone) {
                        // If event should be done only once, remove it.
                        if (event.onlyOnce) {
                            events.splice(index, 1);
                            index--;
                        }
                        event.isDone = true;
                        event.action(currentFrame);
                    } // Don't do anything if the event has already been done.
                }
            }
        }
        if (!returnValue) {
            this._stopped = true;
        }
        return returnValue;
    }
}
//# sourceMappingURL=runtimeAnimation.js.map

/***/ }),

/***/ 47841:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   L: () => (/* binding */ AudioEngine)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32206);
/* harmony import */ var _Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18790);




// Sets the default audio engine to Babylon.js
_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_2__/* .AbstractEngine */ .$.AudioEngineFactory = (hostElement, audioContext, audioDestination) => {
    return new AudioEngine(hostElement, audioContext, audioDestination);
};
/**
 * This represents the default audio engine used in babylon.
 * It is responsible to play, synchronize and analyse sounds throughout the  application.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic
 */
class AudioEngine {
    /**
     * Gets the current AudioContext if available.
     */
    get audioContext() {
        if (!this._audioContextInitialized) {
            this._initializeAudioContext();
        }
        return this._audioContext;
    }
    /**
     * Instantiates a new audio engine.
     *
     * There should be only one per page as some browsers restrict the number
     * of audio contexts you can create.
     * @param hostElement defines the host element where to display the mute icon if necessary
     * @param audioContext defines the audio context to be used by the audio engine
     * @param audioDestination defines the audio destination node to be used by audio engine
     */
    constructor(hostElement = null, audioContext = null, audioDestination = null) {
        this._audioContext = null;
        this._audioContextInitialized = false;
        this._muteButton = null;
        this._audioDestination = null;
        /**
         * Gets whether the current host supports Web Audio and thus could create AudioContexts.
         */
        this.canUseWebAudio = false;
        /**
         * Defines if Babylon should emit a warning if WebAudio is not supported.
         * @ignoreNaming
         */
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.WarnedWebAudioUnsupported = false;
        /**
         * Gets whether or not mp3 are supported by your browser.
         */
        this.isMP3supported = false;
        /**
         * Gets whether or not ogg are supported by your browser.
         */
        this.isOGGsupported = false;
        /**
         * Gets whether audio has been unlocked on the device.
         * Some Browsers have strong restrictions about Audio and won't autoplay unless
         * a user interaction has happened.
         */
        this.unlocked = false;
        /**
         * Defines if the audio engine relies on a custom unlocked button.
         * In this case, the embedded button will not be displayed.
         */
        this.useCustomUnlockedButton = false;
        /**
         * Event raised when audio has been unlocked on the browser.
         */
        this.onAudioUnlockedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * Event raised when audio has been locked on the browser.
         */
        this.onAudioLockedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        this._tryToRun = false;
        this._onResize = () => {
            this._moveButtonToTopLeft();
        };
        if (!(0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_3__/* .IsWindowObjectExist */ .BA)()) {
            return;
        }
        if (typeof window.AudioContext !== "undefined") {
            this.canUseWebAudio = true;
        }
        const audioElem = document.createElement("audio");
        this._hostElement = hostElement;
        this._audioContext = audioContext;
        this._audioDestination = audioDestination;
        try {
            if (audioElem &&
                !!audioElem.canPlayType &&
                (audioElem.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/, "") || audioElem.canPlayType("audio/mp3").replace(/^no$/, ""))) {
                this.isMP3supported = true;
            }
        }
        catch (e) {
            // protect error during capability check.
        }
        try {
            if (audioElem && !!audioElem.canPlayType && audioElem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, "")) {
                this.isOGGsupported = true;
            }
        }
        catch (e) {
            // protect error during capability check.
        }
    }
    /**
     * Flags the audio engine in Locked state.
     * This happens due to new browser policies preventing audio to autoplay.
     */
    lock() {
        this._triggerSuspendedState();
    }
    /**
     * Unlocks the audio engine once a user action has been done on the dom.
     * This is helpful to resume play once browser policies have been satisfied.
     */
    unlock() {
        if (this._audioContext?.state === "running") {
            this._hideMuteButton();
            if (!this.unlocked) {
                // Notify users that the audio stack is unlocked/unmuted
                this.unlocked = true;
                this.onAudioUnlockedObservable.notifyObservers(this);
            }
            return;
        }
        // On iOS, if the audio context resume request was sent from an event other than a `click` event, then
        // the resume promise will never resolve and the only way to get the audio context unstuck is to
        // suspend it and make another resume request.
        if (this._tryToRun) {
            this._audioContext?.suspend().then(() => {
                this._tryToRun = false;
                this._triggerRunningState();
            });
        }
        else {
            this._triggerRunningState();
        }
    }
    /** @internal */
    _resumeAudioContextOnStateChange() {
        this._audioContext?.addEventListener("statechange", () => {
            if (this.unlocked && this._audioContext?.state !== "running") {
                this._resumeAudioContext();
            }
        }, {
            once: true,
            passive: true,
            signal: AbortSignal.timeout(3000),
        });
    }
    _resumeAudioContext() {
        if (this._audioContext?.resume) {
            return this._audioContext.resume();
        }
        return Promise.resolve();
    }
    _initializeAudioContext() {
        try {
            if (this.canUseWebAudio) {
                if (!this._audioContext) {
                    this._audioContext = new AudioContext();
                }
                // create a global volume gain node
                this.masterGain = this._audioContext.createGain();
                this.masterGain.gain.value = 1;
                if (!this._audioDestination) {
                    this._audioDestination = this._audioContext.destination;
                }
                this.masterGain.connect(this._audioDestination);
                this._audioContextInitialized = true;
                if (this._audioContext.state === "running") {
                    // Do not wait for the promise to unlock.
                    this._triggerRunningState();
                }
            }
        }
        catch (e) {
            this.canUseWebAudio = false;
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Web Audio: " + e.message);
        }
    }
    _triggerRunningState() {
        if (this._tryToRun) {
            return;
        }
        this._tryToRun = true;
        this._resumeAudioContext()
            .then(() => {
            this._tryToRun = false;
            if (this._muteButton) {
                this._hideMuteButton();
            }
            // Notify users that the audio stack is unlocked/unmuted
            this.unlocked = true;
            this.onAudioUnlockedObservable.notifyObservers(this);
        })
            .catch(() => {
            this._tryToRun = false;
            this.unlocked = false;
        });
    }
    _triggerSuspendedState() {
        this.unlocked = false;
        this.onAudioLockedObservable.notifyObservers(this);
        this._displayMuteButton();
    }
    _displayMuteButton() {
        if (this.useCustomUnlockedButton || this._muteButton) {
            return;
        }
        this._muteButton = document.createElement("BUTTON");
        this._muteButton.className = "babylonUnmuteIcon";
        this._muteButton.id = "babylonUnmuteIconBtn";
        this._muteButton.title = "Unmute";
        const imageUrl = !window.SVGSVGElement
            ? "https://cdn.babylonjs.com/Assets/audio.png"
            : "data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E";
        const css = ".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url(" +
            imageUrl +
            ");  background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }";
        const style = document.createElement("style");
        style.appendChild(document.createTextNode(css));
        document.getElementsByTagName("head")[0].appendChild(style);
        document.body.appendChild(this._muteButton);
        this._moveButtonToTopLeft();
        this._muteButton.addEventListener("touchend", () => {
            this._triggerRunningState();
        }, true);
        this._muteButton.addEventListener("click", () => {
            this.unlock();
        }, true);
        window.addEventListener("resize", this._onResize);
    }
    _moveButtonToTopLeft() {
        if (this._hostElement && this._muteButton) {
            this._muteButton.style.top = this._hostElement.offsetTop + 20 + "px";
            this._muteButton.style.left = this._hostElement.offsetLeft + 20 + "px";
        }
    }
    _hideMuteButton() {
        if (this._muteButton) {
            document.body.removeChild(this._muteButton);
            this._muteButton = null;
        }
    }
    /**
     * Destroy and release the resources associated with the audio context.
     */
    dispose() {
        if (this.canUseWebAudio && this._audioContextInitialized) {
            if (this._connectedAnalyser && this._audioContext) {
                this._connectedAnalyser.stopDebugCanvas();
                this._connectedAnalyser.dispose();
                this.masterGain.disconnect();
                this.masterGain.connect(this._audioContext.destination);
                this._connectedAnalyser = null;
            }
            this.masterGain.gain.value = 1;
        }
        this.WarnedWebAudioUnsupported = false;
        this._hideMuteButton();
        window.removeEventListener("resize", this._onResize);
        this.onAudioUnlockedObservable.clear();
        this.onAudioLockedObservable.clear();
    }
    /**
     * Gets the global volume sets on the master gain.
     * @returns the global volume if set or -1 otherwise
     */
    getGlobalVolume() {
        if (this.canUseWebAudio && this._audioContextInitialized) {
            return this.masterGain.gain.value;
        }
        else {
            return -1;
        }
    }
    /**
     * Sets the global volume of your experience (sets on the master gain).
     * @param newVolume Defines the new global volume of the application
     */
    setGlobalVolume(newVolume) {
        if (this.canUseWebAudio && this._audioContextInitialized) {
            this.masterGain.gain.value = newVolume;
        }
    }
    /**
     * Connect the audio engine to an audio analyser allowing some amazing
     * synchronization between the sounds/music and your visualization (VuMeter for instance).
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-the-analyser
     * @param analyser The analyser to connect to the engine
     */
    connectToAnalyser(analyser) {
        if (this._connectedAnalyser) {
            this._connectedAnalyser.stopDebugCanvas();
        }
        if (this.canUseWebAudio && this._audioContextInitialized && this._audioContext) {
            this._connectedAnalyser = analyser;
            this.masterGain.disconnect();
            this._connectedAnalyser.connectAudioNodes(this.masterGain, this._audioContext.destination);
        }
    }
}
//# sourceMappingURL=audioEngine.js.map

/***/ }),

/***/ 69440:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Y: () => (/* binding */ AudioSceneComponent)
/* harmony export */ });
/* harmony import */ var _sound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23938);
/* harmony import */ var _soundTrack_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68415);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16945);
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(87491);
/* harmony import */ var _audioEngine_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(47841);
/* harmony import */ var _Misc_precisionDate_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(76237);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6315);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(32206);
/* harmony import */ var _Loading_Plugins_babylonFileParser_function_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(93084);










// Adds the parser to the scene parsers.
(0,_Loading_Plugins_babylonFileParser_function_js__WEBPACK_IMPORTED_MODULE_9__/* .AddParser */ .ji)(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO, (parsedData, scene, container, rootUrl) => {
    // TODO: add sound
    let loadedSounds = [];
    let loadedSound;
    container.sounds = container.sounds || [];
    if (parsedData.sounds !== undefined && parsedData.sounds !== null) {
        for (let index = 0, cache = parsedData.sounds.length; index < cache; index++) {
            const parsedSound = parsedData.sounds[index];
            if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio) {
                if (!parsedSound.url) {
                    parsedSound.url = parsedSound.name;
                }
                if (!loadedSounds[parsedSound.url]) {
                    loadedSound = _sound_js__WEBPACK_IMPORTED_MODULE_0__/* .Sound */ .A.Parse(parsedSound, scene, rootUrl);
                    loadedSounds[parsedSound.url] = loadedSound;
                    container.sounds.push(loadedSound);
                }
                else {
                    container.sounds.push(_sound_js__WEBPACK_IMPORTED_MODULE_0__/* .Sound */ .A.Parse(parsedSound, scene, rootUrl, loadedSounds[parsedSound.url]));
                }
            }
            else {
                container.sounds.push(new _sound_js__WEBPACK_IMPORTED_MODULE_0__/* .Sound */ .A(parsedSound.name, null, scene));
            }
        }
    }
    loadedSounds = [];
});
Object.defineProperty(_scene_js__WEBPACK_IMPORTED_MODULE_4__/* .Scene */ .Z.prototype, "mainSoundTrack", {
    get: function () {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        if (!this._mainSoundTrack) {
            this._mainSoundTrack = new _soundTrack_js__WEBPACK_IMPORTED_MODULE_1__/* .SoundTrack */ .j(this, { mainTrack: true });
        }
        return this._mainSoundTrack;
    },
    enumerable: true,
    configurable: true,
});
_scene_js__WEBPACK_IMPORTED_MODULE_4__/* .Scene */ .Z.prototype.getSoundByName = function (name) {
    let index;
    for (index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
        if (this.mainSoundTrack.soundCollection[index].name === name) {
            return this.mainSoundTrack.soundCollection[index];
        }
    }
    if (this.soundTracks) {
        for (let sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
            for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
                if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
                    return this.soundTracks[sdIndex].soundCollection[index];
                }
            }
        }
    }
    return null;
};
Object.defineProperty(_scene_js__WEBPACK_IMPORTED_MODULE_4__/* .Scene */ .Z.prototype, "audioEnabled", {
    get: function () {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        return compo.audioEnabled;
    },
    set: function (value) {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        if (value) {
            compo.enableAudio();
        }
        else {
            compo.disableAudio();
        }
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(_scene_js__WEBPACK_IMPORTED_MODULE_4__/* .Scene */ .Z.prototype, "headphone", {
    get: function () {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        return compo.headphone;
    },
    set: function (value) {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        if (value) {
            compo.switchAudioModeForHeadphones();
        }
        else {
            compo.switchAudioModeForNormalSpeakers();
        }
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(_scene_js__WEBPACK_IMPORTED_MODULE_4__/* .Scene */ .Z.prototype, "audioListenerPositionProvider", {
    get: function () {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        return compo.audioListenerPositionProvider;
    },
    set: function (value) {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        if (value && typeof value !== "function") {
            throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3");
        }
        else {
            compo.audioListenerPositionProvider = value;
        }
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(_scene_js__WEBPACK_IMPORTED_MODULE_4__/* .Scene */ .Z.prototype, "audioListenerRotationProvider", {
    get: function () {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        return compo.audioListenerRotationProvider;
    },
    set: function (value) {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        if (value && typeof value !== "function") {
            throw new Error("The value passed to [Scene.audioListenerRotationProvider] must be a function that returns a Vector3");
        }
        else {
            compo.audioListenerRotationProvider = value;
        }
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(_scene_js__WEBPACK_IMPORTED_MODULE_4__/* .Scene */ .Z.prototype, "audioPositioningRefreshRate", {
    get: function () {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        return compo.audioPositioningRefreshRate;
    },
    set: function (value) {
        let compo = this._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
        if (!compo) {
            compo = new AudioSceneComponent(this);
            this._addComponent(compo);
        }
        compo.audioPositioningRefreshRate = value;
    },
    enumerable: true,
    configurable: true,
});
/**
 * Defines the sound scene component responsible to manage any sounds
 * in a given scene.
 */
class AudioSceneComponent {
    /**
     * Gets whether audio is enabled or not.
     * Please use related enable/disable method to switch state.
     */
    get audioEnabled() {
        return this._audioEnabled;
    }
    /**
     * Gets whether audio is outputting to headphone or not.
     * Please use the according Switch methods to change output.
     */
    get headphone() {
        return this._headphone;
    }
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = _sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO;
        this._audioEnabled = true;
        this._headphone = false;
        /**
         * Gets or sets a refresh rate when using 3D audio positioning
         */
        this.audioPositioningRefreshRate = 500;
        /**
         * Gets or Sets a custom listener position for all sounds in the scene
         * By default, this is the position of the first active camera
         */
        this.audioListenerPositionProvider = null;
        /**
         * Gets or Sets a custom listener rotation for all sounds in the scene
         * By default, this is the rotation of the first active camera
         */
        this.audioListenerRotationProvider = null;
        this._cachedCameraDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq();
        this._cachedCameraPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq();
        this._lastCheck = 0;
        this._invertMatrixTemp = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq();
        this._cameraDirectionTemp = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq();
        scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore */ .q.LastCreatedScene;
        if (!scene) {
            return;
        }
        this.scene = scene;
        scene.soundTracks = [];
        scene.sounds = [];
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._afterRenderStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.STEP_AFTERRENDER_AUDIO, this, this._afterRender);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do here. (Not rendering related)
    }
    /**
     * Serializes the component data to the specified json object
     * @param serializationObject The object to serialize to
     */
    serialize(serializationObject) {
        serializationObject.sounds = [];
        if (this.scene.soundTracks) {
            for (let index = 0; index < this.scene.soundTracks.length; index++) {
                const soundtrack = this.scene.soundTracks[index];
                for (let soundId = 0; soundId < soundtrack.soundCollection.length; soundId++) {
                    serializationObject.sounds.push(soundtrack.soundCollection[soundId].serialize());
                }
            }
        }
    }
    /**
     * Adds all the elements from the container to the scene
     * @param container the container holding the elements
     */
    addFromContainer(container) {
        if (!container.sounds) {
            return;
        }
        container.sounds.forEach((sound) => {
            sound.play();
            sound.autoplay = true;
            this.scene.mainSoundTrack.addSound(sound);
        });
    }
    /**
     * Removes all the elements in the container from the scene
     * @param container contains the elements to remove
     * @param dispose if the removed element should be disposed (default: false)
     */
    removeFromContainer(container, dispose = false) {
        if (!container.sounds) {
            return;
        }
        container.sounds.forEach((sound) => {
            sound.stop();
            sound.autoplay = false;
            this.scene.mainSoundTrack.removeSound(sound);
            if (dispose) {
                sound.dispose();
            }
        });
    }
    /**
     * Disposes the component and the associated resources.
     */
    dispose() {
        const scene = this.scene;
        if (scene._mainSoundTrack) {
            scene.mainSoundTrack.dispose();
        }
        if (scene.soundTracks) {
            for (let scIndex = 0; scIndex < scene.soundTracks.length; scIndex++) {
                scene.soundTracks[scIndex].dispose();
            }
        }
    }
    /**
     * Disables audio in the associated scene.
     */
    disableAudio() {
        const scene = this.scene;
        this._audioEnabled = false;
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.audioEngine && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.audioEngine.audioContext) {
            _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.audioEngine.audioContext.suspend();
        }
        let i;
        for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) {
            scene.mainSoundTrack.soundCollection[i].pause();
        }
        if (scene.soundTracks) {
            for (i = 0; i < scene.soundTracks.length; i++) {
                for (let j = 0; j < scene.soundTracks[i].soundCollection.length; j++) {
                    scene.soundTracks[i].soundCollection[j].pause();
                }
            }
        }
    }
    /**
     * Enables audio in the associated scene.
     */
    enableAudio() {
        const scene = this.scene;
        this._audioEnabled = true;
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.audioEngine && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.audioEngine.audioContext) {
            _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.audioEngine.audioContext.resume();
        }
        let i;
        for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) {
            if (scene.mainSoundTrack.soundCollection[i].isPaused) {
                scene.mainSoundTrack.soundCollection[i].play();
            }
        }
        if (scene.soundTracks) {
            for (i = 0; i < scene.soundTracks.length; i++) {
                for (let j = 0; j < scene.soundTracks[i].soundCollection.length; j++) {
                    if (scene.soundTracks[i].soundCollection[j].isPaused) {
                        scene.soundTracks[i].soundCollection[j].play();
                    }
                }
            }
        }
    }
    /**
     * Switch audio to headphone output.
     */
    switchAudioModeForHeadphones() {
        const scene = this.scene;
        this._headphone = true;
        scene.mainSoundTrack.switchPanningModelToHRTF();
        if (scene.soundTracks) {
            for (let i = 0; i < scene.soundTracks.length; i++) {
                scene.soundTracks[i].switchPanningModelToHRTF();
            }
        }
    }
    /**
     * Switch audio to normal speakers.
     */
    switchAudioModeForNormalSpeakers() {
        const scene = this.scene;
        this._headphone = false;
        scene.mainSoundTrack.switchPanningModelToEqualPower();
        if (scene.soundTracks) {
            for (let i = 0; i < scene.soundTracks.length; i++) {
                scene.soundTracks[i].switchPanningModelToEqualPower();
            }
        }
    }
    _afterRender() {
        const now = _Misc_precisionDate_js__WEBPACK_IMPORTED_MODULE_6__/* .PrecisionDate */ .j.Now;
        if (this._lastCheck && now - this._lastCheck < this.audioPositioningRefreshRate) {
            return;
        }
        this._lastCheck = now;
        const scene = this.scene;
        if (!this._audioEnabled || !scene._mainSoundTrack || !scene.soundTracks || (scene._mainSoundTrack.soundCollection.length === 0 && scene.soundTracks.length === 1)) {
            return;
        }
        const audioEngine = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.audioEngine;
        if (!audioEngine) {
            return;
        }
        if (audioEngine.audioContext) {
            let listeningCamera = scene.activeCamera;
            if (scene.activeCameras && scene.activeCameras.length > 0) {
                listeningCamera = scene.activeCameras[0];
            }
            // A custom listener position provider was set
            // Use the users provided position instead of camera's
            if (this.audioListenerPositionProvider) {
                const position = this.audioListenerPositionProvider();
                // Set the listener position
                audioEngine.audioContext.listener.setPosition(position.x || 0, position.y || 0, position.z || 0);
                // Check if there is a listening camera
            }
            else if (listeningCamera) {
                // Set the listener position to the listening camera global position
                if (!this._cachedCameraPosition.equals(listeningCamera.globalPosition)) {
                    this._cachedCameraPosition.copyFrom(listeningCamera.globalPosition);
                    audioEngine.audioContext.listener.setPosition(listeningCamera.globalPosition.x, listeningCamera.globalPosition.y, listeningCamera.globalPosition.z);
                }
            }
            // Otherwise set the listener position to 0, 0 ,0
            else {
                // Set the listener position
                audioEngine.audioContext.listener.setPosition(0, 0, 0);
            }
            // A custom listener rotation provider was set
            // Use the users provided rotation instead of camera's
            if (this.audioListenerRotationProvider) {
                const rotation = this.audioListenerRotationProvider();
                audioEngine.audioContext.listener.setOrientation(rotation.x || 0, rotation.y || 0, rotation.z || 0, 0, 1, 0);
                // Check if there is a listening camera
            }
            else if (listeningCamera) {
                // for VR cameras
                if (listeningCamera.rigCameras && listeningCamera.rigCameras.length > 0) {
                    listeningCamera = listeningCamera.rigCameras[0];
                }
                listeningCamera.getViewMatrix().invertToRef(this._invertMatrixTemp);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformNormalToRef(AudioSceneComponent._CameraDirection, this._invertMatrixTemp, this._cameraDirectionTemp);
                this._cameraDirectionTemp.normalize();
                // To avoid some errors on GearVR
                if (!isNaN(this._cameraDirectionTemp.x) && !isNaN(this._cameraDirectionTemp.y) && !isNaN(this._cameraDirectionTemp.z)) {
                    if (!this._cachedCameraDirection.equals(this._cameraDirectionTemp)) {
                        this._cachedCameraDirection.copyFrom(this._cameraDirectionTemp);
                        audioEngine.audioContext.listener.setOrientation(this._cameraDirectionTemp.x, this._cameraDirectionTemp.y, this._cameraDirectionTemp.z, 0, 1, 0);
                    }
                }
            }
            // Otherwise set the listener rotation to 0, 0 ,0
            else {
                // Set the listener position
                audioEngine.audioContext.listener.setOrientation(0, 0, 0, 0, 1, 0);
            }
            let i;
            for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) {
                const sound = scene.mainSoundTrack.soundCollection[i];
                if (sound.useCustomAttenuation) {
                    sound.updateDistanceFromListener();
                }
            }
            if (scene.soundTracks) {
                for (i = 0; i < scene.soundTracks.length; i++) {
                    for (let j = 0; j < scene.soundTracks[i].soundCollection.length; j++) {
                        const sound = scene.soundTracks[i].soundCollection[j];
                        if (sound.useCustomAttenuation) {
                            sound.updateDistanceFromListener();
                        }
                    }
                }
            }
        }
    }
}
AudioSceneComponent._CameraDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0, 0, -1);
_sound_js__WEBPACK_IMPORTED_MODULE_0__/* .Sound */ .A._SceneComponentInitialization = (scene) => {
    let compo = scene._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .SceneComponentConstants */ .v.NAME_AUDIO);
    if (!compo) {
        compo = new AudioSceneComponent(scene);
        scene._addComponent(compo);
    }
};
//# sourceMappingURL=audioSceneComponent.js.map

/***/ }),

/***/ 23938:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (/* binding */ Sound)
/* harmony export */ });
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(998);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51137);
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45503);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6315);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56552);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(32206);








/**
 * Defines a sound that can be played in the application.
 * The sound can either be an ambient track or a simple sound played in reaction to a user action.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic
 */
class Sound {
    /**
     * Does the sound loop after it finishes playing once.
     */
    get loop() {
        return this._loop;
    }
    set loop(value) {
        if (value === this._loop) {
            return;
        }
        this._loop = value;
        this.updateOptions({ loop: value });
    }
    /**
     * Gets the current time for the sound.
     */
    get currentTime() {
        if (this._htmlAudioElement) {
            return this._htmlAudioElement.currentTime;
        }
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext && (this.isPlaying || this.isPaused)) {
            // The `_currentTime` member is only updated when the sound is paused. Add the time since the last start
            // to get the actual current time.
            const timeSinceLastStart = this.isPaused ? 0 : _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.currentTime - this._startTime;
            return this._currentTime + timeSinceLastStart;
        }
        return 0;
    }
    /**
     * Does this sound enables spatial sound.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
     */
    get spatialSound() {
        return this._spatialSound;
    }
    /**
     * Does this sound enables spatial sound.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
     */
    set spatialSound(newValue) {
        if (newValue == this._spatialSound) {
            return;
        }
        const wasPlaying = this.isPlaying;
        this.pause();
        if (newValue) {
            this._spatialSound = newValue;
            this._updateSpatialParameters();
        }
        else {
            this._disableSpatialSound();
        }
        if (wasPlaying) {
            this.play();
        }
    }
    /**
     * Create a sound and attach it to a scene
     * @param name Name of your sound
     * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer, it also works with MediaStreams and AudioBuffers
     * @param scene defines the scene the sound belongs to
     * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played
     * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel, streaming
     */
    constructor(name, urlOrArrayBuffer, scene, readyToPlayCallback = null, options) {
        /**
         * Does the sound autoplay once loaded.
         */
        this.autoplay = false;
        this._loop = false;
        /**
         * Does the sound use a custom attenuation curve to simulate the falloff
         * happening when the source gets further away from the camera.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-your-own-custom-attenuation-function
         */
        this.useCustomAttenuation = false;
        /**
         * Is this sound currently played.
         */
        this.isPlaying = false;
        /**
         * Is this sound currently paused.
         */
        this.isPaused = false;
        /**
         * Define the reference distance the sound should be heard perfectly.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
         */
        this.refDistance = 1;
        /**
         * Define the roll off factor of spatial sounds.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
         */
        this.rolloffFactor = 1;
        /**
         * Define the max distance the sound should be heard (intensity just became 0 at this point).
         * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
         */
        this.maxDistance = 100;
        /**
         * Define the distance attenuation model the sound will follow.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
         */
        this.distanceModel = "linear";
        /**
         * Gets or sets an object used to store user defined information for the sound.
         */
        this.metadata = null;
        /**
         * Observable event when the current playing sound finishes.
         */
        this.onEndedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        this._spatialSound = false;
        this._panningModel = "equalpower";
        this._playbackRate = 1;
        this._streaming = false;
        this._startTime = 0;
        this._currentTime = 0;
        this._position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        this._localDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(1, 0, 0);
        this._volume = 1;
        this._isReadyToPlay = false;
        this._isDirectional = false;
        // Used if you'd like to create a directional sound.
        // If not set, the sound will be omnidirectional
        this._coneInnerAngle = 360;
        this._coneOuterAngle = 360;
        this._coneOuterGain = 0;
        this._isOutputConnected = false;
        this._urlType = "Unknown";
        this.name = name;
        scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_5__/* .EngineStore */ .q.LastCreatedScene;
        if (!scene) {
            return;
        }
        this._scene = scene;
        Sound._SceneComponentInitialization(scene);
        this._readyToPlayCallback = readyToPlayCallback;
        // Default custom attenuation function is a linear attenuation
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._customAttenuationFunction = (currentVolume, currentDistance, maxDistance, refDistance, rolloffFactor) => {
            if (currentDistance < maxDistance) {
                return currentVolume * (1 - currentDistance / maxDistance);
            }
            else {
                return 0;
            }
        };
        if (options) {
            this.autoplay = options.autoplay || false;
            this._loop = options.loop || false;
            // if volume === 0, we need another way to check this option
            if (options.volume !== undefined) {
                this._volume = options.volume;
            }
            this._spatialSound = options.spatialSound ?? false;
            this.maxDistance = options.maxDistance ?? 100;
            this.useCustomAttenuation = options.useCustomAttenuation ?? false;
            this.rolloffFactor = options.rolloffFactor || 1;
            this.refDistance = options.refDistance || 1;
            this.distanceModel = options.distanceModel || "linear";
            this._playbackRate = options.playbackRate || 1;
            this._streaming = options.streaming ?? false;
            this._length = options.length;
            this._offset = options.offset;
        }
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext) {
            this._soundGain = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.createGain();
            this._soundGain.gain.value = this._volume;
            this._inputAudioNode = this._soundGain;
            this._outputAudioNode = this._soundGain;
            if (this._spatialSound) {
                this._createSpatialParameters();
            }
            this._scene.mainSoundTrack.addSound(this);
            let validParameter = true;
            // if no parameter is passed, you need to call setAudioBuffer yourself to prepare the sound
            if (urlOrArrayBuffer) {
                try {
                    if (typeof urlOrArrayBuffer === "string") {
                        this._urlType = "String";
                        this._url = urlOrArrayBuffer;
                    }
                    else if (urlOrArrayBuffer instanceof ArrayBuffer) {
                        this._urlType = "ArrayBuffer";
                    }
                    else if (urlOrArrayBuffer instanceof HTMLMediaElement) {
                        this._urlType = "MediaElement";
                    }
                    else if (urlOrArrayBuffer instanceof MediaStream) {
                        this._urlType = "MediaStream";
                    }
                    else if (urlOrArrayBuffer instanceof AudioBuffer) {
                        this._urlType = "AudioBuffer";
                    }
                    else if (Array.isArray(urlOrArrayBuffer)) {
                        this._urlType = "Array";
                    }
                    let urls = [];
                    let codecSupportedFound = false;
                    switch (this._urlType) {
                        case "MediaElement":
                            this._streaming = true;
                            this._isReadyToPlay = true;
                            this._streamingSource = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.createMediaElementSource(urlOrArrayBuffer);
                            if (this.autoplay) {
                                this.play(0, this._offset, this._length);
                            }
                            if (this._readyToPlayCallback) {
                                this._readyToPlayCallback();
                            }
                            break;
                        case "MediaStream":
                            this._streaming = true;
                            this._isReadyToPlay = true;
                            this._streamingSource = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.createMediaStreamSource(urlOrArrayBuffer);
                            if (this.autoplay) {
                                this.play(0, this._offset, this._length);
                            }
                            if (this._readyToPlayCallback) {
                                this._readyToPlayCallback();
                            }
                            break;
                        case "ArrayBuffer":
                            if (urlOrArrayBuffer.byteLength > 0) {
                                codecSupportedFound = true;
                                this._soundLoaded(urlOrArrayBuffer);
                            }
                            break;
                        case "AudioBuffer":
                            this._audioBufferLoaded(urlOrArrayBuffer);
                            break;
                        case "String":
                            urls.push(urlOrArrayBuffer);
                        // eslint-disable-next-line no-fallthrough
                        case "Array":
                            if (urls.length === 0) {
                                urls = urlOrArrayBuffer;
                            }
                            // If we found a supported format, we load it immediately and stop the loop
                            for (let i = 0; i < urls.length; i++) {
                                const url = urls[i];
                                codecSupportedFound =
                                    (options && options.skipCodecCheck) ||
                                        (url.indexOf(".mp3", url.length - 4) !== -1 && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.isMP3supported) ||
                                        (url.indexOf(".ogg", url.length - 4) !== -1 && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.isOGGsupported) ||
                                        url.indexOf(".wav", url.length - 4) !== -1 ||
                                        url.indexOf(".m4a", url.length - 4) !== -1 ||
                                        url.indexOf(".mp4", url.length - 4) !== -1 ||
                                        url.indexOf("blob:") !== -1;
                                if (codecSupportedFound) {
                                    // Loading sound
                                    if (!this._streaming) {
                                        this._scene._loadFile(url, (data) => {
                                            this._soundLoaded(data);
                                        }, undefined, true, true, (exception) => {
                                            if (exception) {
                                                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("XHR " + exception.status + " error on: " + url + ".");
                                            }
                                            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("Sound creation aborted.");
                                            this._scene.mainSoundTrack.removeSound(this);
                                        });
                                    }
                                    // Streaming sound using HTML5 Audio tag
                                    else {
                                        this._htmlAudioElement = new Audio(url);
                                        this._htmlAudioElement.controls = false;
                                        this._htmlAudioElement.loop = this.loop;
                                        _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0.SetCorsBehavior(url, this._htmlAudioElement);
                                        this._htmlAudioElement.preload = "auto";
                                        this._htmlAudioElement.addEventListener("canplaythrough", () => {
                                            this._isReadyToPlay = true;
                                            if (this.autoplay) {
                                                this.play(0, this._offset, this._length);
                                            }
                                            if (this._readyToPlayCallback) {
                                                this._readyToPlayCallback();
                                            }
                                        }, { once: true });
                                        document.body.appendChild(this._htmlAudioElement);
                                        this._htmlAudioElement.load();
                                    }
                                    break;
                                }
                            }
                            break;
                        default:
                            validParameter = false;
                            break;
                    }
                    if (!validParameter) {
                        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.");
                    }
                    else {
                        if (!codecSupportedFound) {
                            this._isReadyToPlay = true;
                            // Simulating a ready to play event to avoid breaking code path
                            if (this._readyToPlayCallback) {
                                setTimeout(() => {
                                    if (this._readyToPlayCallback) {
                                        this._readyToPlayCallback();
                                    }
                                }, 1000);
                            }
                        }
                    }
                }
                catch (ex) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("Unexpected error. Sound creation aborted.");
                    this._scene.mainSoundTrack.removeSound(this);
                }
            }
        }
        else {
            // Adding an empty sound to avoid breaking audio calls for non Web Audio browsers
            this._scene.mainSoundTrack.addSound(this);
            if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine && !_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.WarnedWebAudioUnsupported) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("Web Audio is not supported by your browser.");
                _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.WarnedWebAudioUnsupported = true;
            }
            // Simulating a ready to play event to avoid breaking code for non web audio browsers
            if (this._readyToPlayCallback) {
                setTimeout(() => {
                    if (this._readyToPlayCallback) {
                        this._readyToPlayCallback();
                    }
                }, 1000);
            }
        }
    }
    /**
     * Release the sound and its associated resources
     */
    dispose() {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio) {
            if (this.isPlaying) {
                this.stop();
            }
            this._isReadyToPlay = false;
            if (this.soundTrackId === -1) {
                this._scene.mainSoundTrack.removeSound(this);
            }
            else if (this._scene.soundTracks) {
                this._scene.soundTracks[this.soundTrackId].removeSound(this);
            }
            if (this._soundGain) {
                this._soundGain.disconnect();
                this._soundGain = null;
            }
            if (this._soundPanner) {
                this._soundPanner.disconnect();
                this._soundPanner = null;
            }
            if (this._soundSource) {
                this._soundSource.disconnect();
                this._soundSource = null;
            }
            this._audioBuffer = null;
            if (this._htmlAudioElement) {
                this._htmlAudioElement.pause();
                this._htmlAudioElement.src = "";
                document.body.removeChild(this._htmlAudioElement);
                this._htmlAudioElement = null;
            }
            if (this._streamingSource) {
                this._streamingSource.disconnect();
                this._streamingSource = null;
            }
            if (this._connectedTransformNode && this._registerFunc) {
                this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc);
                this._connectedTransformNode = null;
            }
            this._clearTimeoutsAndObservers();
        }
    }
    /**
     * Gets if the sounds is ready to be played or not.
     * @returns true if ready, otherwise false
     */
    isReady() {
        return this._isReadyToPlay;
    }
    /**
     * Get the current class name.
     * @returns current class name
     */
    getClassName() {
        return "Sound";
    }
    _audioBufferLoaded(buffer) {
        if (!_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext) {
            return;
        }
        this._audioBuffer = buffer;
        this._isReadyToPlay = true;
        if (this.autoplay) {
            this.play(0, this._offset, this._length);
        }
        if (this._readyToPlayCallback) {
            this._readyToPlayCallback();
        }
    }
    _soundLoaded(audioData) {
        if (!_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext) {
            return;
        }
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.decodeAudioData(audioData, (buffer) => {
            this._audioBufferLoaded(buffer);
        }, (err) => {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("Error while decoding audio data for: " + this.name + " / Error: " + err);
        });
    }
    /**
     * Sets the data of the sound from an audiobuffer
     * @param audioBuffer The audioBuffer containing the data
     */
    setAudioBuffer(audioBuffer) {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio) {
            this._audioBuffer = audioBuffer;
            this._isReadyToPlay = true;
        }
    }
    /**
     * Updates the current sounds options such as maxdistance, loop...
     * @param options A JSON object containing values named as the object properties
     */
    updateOptions(options) {
        if (options) {
            this.loop = options.loop ?? this.loop;
            this.maxDistance = options.maxDistance ?? this.maxDistance;
            this.useCustomAttenuation = options.useCustomAttenuation ?? this.useCustomAttenuation;
            this.rolloffFactor = options.rolloffFactor ?? this.rolloffFactor;
            this.refDistance = options.refDistance ?? this.refDistance;
            this.distanceModel = options.distanceModel ?? this.distanceModel;
            this._playbackRate = options.playbackRate ?? this._playbackRate;
            this._length = options.length ?? undefined;
            this.spatialSound = options.spatialSound ?? this._spatialSound;
            this._setOffset(options.offset ?? undefined);
            this.setVolume(options.volume ?? this._volume);
            this._updateSpatialParameters();
            if (this.isPlaying) {
                if (this._streaming && this._htmlAudioElement) {
                    this._htmlAudioElement.playbackRate = this._playbackRate;
                    if (this._htmlAudioElement.loop !== this.loop) {
                        this._htmlAudioElement.loop = this.loop;
                    }
                }
                else {
                    if (this._soundSource) {
                        this._soundSource.playbackRate.value = this._playbackRate;
                        if (this._soundSource.loop !== this.loop) {
                            this._soundSource.loop = this.loop;
                        }
                        if (this._offset !== undefined && this._soundSource.loopStart !== this._offset) {
                            this._soundSource.loopStart = this._offset;
                        }
                        if (this._length !== undefined && this._length !== this._soundSource.loopEnd) {
                            this._soundSource.loopEnd = (this._offset | 0) + this._length;
                        }
                    }
                }
            }
        }
    }
    _createSpatialParameters() {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext) {
            if (this._scene.headphone) {
                this._panningModel = "HRTF";
            }
            this._soundPanner = this._soundPanner ?? _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.createPanner();
            if (this._soundPanner && this._outputAudioNode) {
                this._updateSpatialParameters();
                this._soundPanner.connect(this._outputAudioNode);
                this._inputAudioNode = this._soundPanner;
            }
        }
    }
    _disableSpatialSound() {
        if (!this._spatialSound) {
            return;
        }
        this._inputAudioNode = this._soundGain;
        this._soundPanner?.disconnect();
        this._soundPanner = null;
        this._spatialSound = false;
    }
    _updateSpatialParameters() {
        if (!this._spatialSound) {
            return;
        }
        if (this._soundPanner) {
            if (this.useCustomAttenuation) {
                // Tricks to disable in a way embedded Web Audio attenuation
                this._soundPanner.distanceModel = "linear";
                this._soundPanner.maxDistance = Number.MAX_VALUE;
                this._soundPanner.refDistance = 1;
                this._soundPanner.rolloffFactor = 1;
                this._soundPanner.panningModel = this._panningModel;
            }
            else {
                this._soundPanner.distanceModel = this.distanceModel;
                this._soundPanner.maxDistance = this.maxDistance;
                this._soundPanner.refDistance = this.refDistance;
                this._soundPanner.rolloffFactor = this.rolloffFactor;
                this._soundPanner.panningModel = this._panningModel;
            }
        }
        else {
            this._createSpatialParameters();
        }
    }
    /**
     * Switch the panning model to HRTF:
     * Renders a stereo output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
     */
    switchPanningModelToHRTF() {
        this._panningModel = "HRTF";
        this._switchPanningModel();
    }
    /**
     * Switch the panning model to Equal Power:
     * Represents the equal-power panning algorithm, generally regarded as simple and efficient. equalpower is the default value.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
     */
    switchPanningModelToEqualPower() {
        this._panningModel = "equalpower";
        this._switchPanningModel();
    }
    _switchPanningModel() {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner) {
            this._soundPanner.panningModel = this._panningModel;
        }
    }
    /**
     * Connect this sound to a sound track audio node like gain...
     * @param soundTrackAudioNode the sound track audio node to connect to
     */
    connectToSoundTrackAudioNode(soundTrackAudioNode) {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._outputAudioNode) {
            if (this._isOutputConnected) {
                this._outputAudioNode.disconnect();
            }
            this._outputAudioNode.connect(soundTrackAudioNode);
            this._isOutputConnected = true;
        }
    }
    /**
     * Transform this sound into a directional source
     * @param coneInnerAngle Size of the inner cone in degree
     * @param coneOuterAngle Size of the outer cone in degree
     * @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0)
     */
    setDirectionalCone(coneInnerAngle, coneOuterAngle, coneOuterGain) {
        if (coneOuterAngle < coneInnerAngle) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");
            return;
        }
        this._coneInnerAngle = coneInnerAngle;
        this._coneOuterAngle = coneOuterAngle;
        this._coneOuterGain = coneOuterGain;
        this._isDirectional = true;
        if (this.isPlaying && this.loop) {
            this.stop();
            this.play(0, this._offset, this._length);
        }
    }
    /**
     * Gets or sets the inner angle for the directional cone.
     */
    get directionalConeInnerAngle() {
        return this._coneInnerAngle;
    }
    /**
     * Gets or sets the inner angle for the directional cone.
     */
    set directionalConeInnerAngle(value) {
        if (value != this._coneInnerAngle) {
            if (this._coneOuterAngle < value) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");
                return;
            }
            this._coneInnerAngle = value;
            if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner) {
                this._soundPanner.coneInnerAngle = this._coneInnerAngle;
            }
        }
    }
    /**
     * Gets or sets the outer angle for the directional cone.
     */
    get directionalConeOuterAngle() {
        return this._coneOuterAngle;
    }
    /**
     * Gets or sets the outer angle for the directional cone.
     */
    set directionalConeOuterAngle(value) {
        if (value != this._coneOuterAngle) {
            if (value < this._coneInnerAngle) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");
                return;
            }
            this._coneOuterAngle = value;
            if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner) {
                this._soundPanner.coneOuterAngle = this._coneOuterAngle;
            }
        }
    }
    /**
     * Sets the position of the emitter if spatial sound is enabled
     * @param newPosition Defines the new position
     */
    setPosition(newPosition) {
        if (newPosition.equals(this._position)) {
            return;
        }
        this._position.copyFrom(newPosition);
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio &&
            this._spatialSound &&
            this._soundPanner &&
            !isNaN(this._position.x) &&
            !isNaN(this._position.y) &&
            !isNaN(this._position.z)) {
            this._soundPanner.positionX.value = this._position.x;
            this._soundPanner.positionY.value = this._position.y;
            this._soundPanner.positionZ.value = this._position.z;
        }
    }
    /**
     * Sets the local direction of the emitter if spatial sound is enabled
     * @param newLocalDirection Defines the new local direction
     */
    setLocalDirectionToMesh(newLocalDirection) {
        this._localDirection = newLocalDirection;
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._connectedTransformNode && this.isPlaying) {
            this._updateDirection();
        }
    }
    _updateDirection() {
        if (!this._connectedTransformNode || !this._soundPanner) {
            return;
        }
        const mat = this._connectedTransformNode.getWorldMatrix();
        const direction = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformNormal(this._localDirection, mat);
        direction.normalize();
        this._soundPanner.orientationX.value = direction.x;
        this._soundPanner.orientationY.value = direction.y;
        this._soundPanner.orientationZ.value = direction.z;
    }
    /** @internal */
    updateDistanceFromListener() {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._connectedTransformNode && this.useCustomAttenuation && this._soundGain && this._scene.activeCamera) {
            const distance = this._scene.audioListenerPositionProvider
                ? this._connectedTransformNode.position.subtract(this._scene.audioListenerPositionProvider()).length()
                : this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);
            this._soundGain.gain.value = this._customAttenuationFunction(this._volume, distance, this.maxDistance, this.refDistance, this.rolloffFactor);
        }
    }
    /**
     * Sets a new custom attenuation function for the sound.
     * @param callback Defines the function used for the attenuation
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-your-own-custom-attenuation-function
     */
    setAttenuationFunction(callback) {
        this._customAttenuationFunction = callback;
    }
    /**
     * Play the sound
     * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
     * @param offset (optional) Start the sound at a specific time in seconds
     * @param length (optional) Sound duration (in seconds)
     */
    play(time, offset, length) {
        if (this._isReadyToPlay && this._scene.audioEnabled && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext) {
            try {
                this._clearTimeoutsAndObservers();
                let startTime = time ? _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext.currentTime + time : _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext.currentTime;
                if (!this._soundSource || !this._streamingSource) {
                    if (this._spatialSound && this._soundPanner) {
                        if (!isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z)) {
                            this._soundPanner.positionX.value = this._position.x;
                            this._soundPanner.positionY.value = this._position.y;
                            this._soundPanner.positionZ.value = this._position.z;
                        }
                        if (this._isDirectional) {
                            this._soundPanner.coneInnerAngle = this._coneInnerAngle;
                            this._soundPanner.coneOuterAngle = this._coneOuterAngle;
                            this._soundPanner.coneOuterGain = this._coneOuterGain;
                            if (this._connectedTransformNode) {
                                this._updateDirection();
                            }
                            else {
                                this._soundPanner.setOrientation(this._localDirection.x, this._localDirection.y, this._localDirection.z);
                            }
                        }
                    }
                }
                if (this._streaming) {
                    if (!this._streamingSource && this._htmlAudioElement) {
                        this._streamingSource = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement);
                        this._htmlAudioElement.onended = () => {
                            this._onended();
                        };
                        this._htmlAudioElement.playbackRate = this._playbackRate;
                    }
                    if (this._streamingSource) {
                        this._streamingSource.disconnect();
                        if (this._inputAudioNode) {
                            this._streamingSource.connect(this._inputAudioNode);
                        }
                    }
                    if (this._htmlAudioElement) {
                        // required to manage properly the new suspended default state of Chrome
                        // When the option 'streaming: true' is used, we need first to wait for
                        // the audio engine to be unlocked by a user gesture before trying to play
                        // an HTML Audio element
                        const tryToPlay = () => {
                            if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.unlocked) {
                                if (!this._htmlAudioElement) {
                                    return;
                                }
                                this._htmlAudioElement.currentTime = offset ?? 0;
                                const playPromise = this._htmlAudioElement.play();
                                // In browsers that don’t yet support this functionality,
                                // playPromise won’t be defined.
                                if (playPromise !== undefined) {
                                    playPromise.catch(() => {
                                        // Automatic playback failed.
                                        // Waiting for the audio engine to be unlocked by user click on unmute
                                        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.lock();
                                        if (this.loop || this.autoplay) {
                                            this._audioUnlockedObserver = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.onAudioUnlockedObservable.addOnce(() => {
                                                tryToPlay();
                                            });
                                        }
                                    });
                                }
                            }
                            else {
                                if (this.loop || this.autoplay) {
                                    this._audioUnlockedObserver = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.onAudioUnlockedObservable.addOnce(() => {
                                        tryToPlay();
                                    });
                                }
                            }
                        };
                        tryToPlay();
                    }
                }
                else {
                    const tryToPlay = () => {
                        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext) {
                            length = length || this._length;
                            if (offset !== undefined) {
                                this._setOffset(offset);
                            }
                            if (this._soundSource) {
                                const oldSource = this._soundSource;
                                oldSource.onended = () => {
                                    oldSource.disconnect();
                                };
                            }
                            this._soundSource = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext.createBufferSource();
                            if (this._soundSource && this._inputAudioNode) {
                                this._soundSource.buffer = this._audioBuffer;
                                this._soundSource.connect(this._inputAudioNode);
                                this._soundSource.loop = this.loop;
                                if (offset !== undefined) {
                                    this._soundSource.loopStart = offset;
                                }
                                if (length !== undefined) {
                                    this._soundSource.loopEnd = (offset | 0) + length;
                                }
                                this._soundSource.playbackRate.value = this._playbackRate;
                                this._soundSource.onended = () => {
                                    this._onended();
                                };
                                startTime = time ? _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext.currentTime + time : _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.currentTime;
                                const actualOffset = ((this.isPaused ? this.currentTime : 0) + (this._offset ?? 0)) % this._soundSource.buffer.duration;
                                this._soundSource.start(startTime, actualOffset, this.loop ? undefined : length);
                            }
                        }
                    };
                    if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext.state === "suspended") {
                        // Wait a bit for FF as context seems late to be ready.
                        this._tryToPlayTimeout = setTimeout(() => {
                            if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext.state === "suspended") {
                                // Automatic playback failed.
                                // Waiting for the audio engine to be unlocked by user click on unmute
                                _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.lock();
                                if (this.loop || this.autoplay) {
                                    this._audioUnlockedObserver = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.onAudioUnlockedObservable.addOnce(() => {
                                        tryToPlay();
                                    });
                                }
                            }
                            else {
                                tryToPlay();
                            }
                        }, 500);
                    }
                    else {
                        tryToPlay();
                    }
                }
                this._startTime = startTime;
                this.isPlaying = true;
                this.isPaused = false;
            }
            catch (ex) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
            }
        }
    }
    _onended() {
        this.isPlaying = false;
        this._startTime = 0;
        this._currentTime = 0;
        if (this.onended) {
            this.onended();
        }
        this.onEndedObservable.notifyObservers(this);
    }
    /**
     * Stop the sound
     * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default.
     */
    stop(time) {
        if (this.isPlaying) {
            this._clearTimeoutsAndObservers();
            if (this._streaming) {
                if (this._htmlAudioElement) {
                    this._htmlAudioElement.pause();
                    // Test needed for Firefox or it will generate an Invalid State Error
                    if (this._htmlAudioElement.currentTime > 0) {
                        this._htmlAudioElement.currentTime = 0;
                    }
                }
                else {
                    this._streamingSource?.disconnect();
                }
                this.isPlaying = false;
            }
            else if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext && this._soundSource) {
                const stopTime = time ? _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.currentTime + time : undefined;
                this._soundSource.onended = () => {
                    this.isPlaying = false;
                    this.isPaused = false;
                    this._startTime = 0;
                    this._currentTime = 0;
                    if (this._soundSource) {
                        this._soundSource.onended = () => void 0;
                    }
                    this._onended();
                };
                this._soundSource.stop(stopTime);
            }
            else {
                this.isPlaying = false;
            }
        }
        else if (this.isPaused) {
            this.isPaused = false;
            this._startTime = 0;
            this._currentTime = 0;
        }
    }
    /**
     * Put the sound in pause
     */
    pause() {
        if (this.isPlaying) {
            this._clearTimeoutsAndObservers();
            if (this._streaming) {
                if (this._htmlAudioElement) {
                    this._htmlAudioElement.pause();
                }
                else {
                    this._streamingSource?.disconnect();
                }
                this.isPlaying = false;
                this.isPaused = true;
            }
            else if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.audioContext && this._soundSource) {
                this._soundSource.onended = () => void 0;
                this._soundSource.stop();
                this.isPlaying = false;
                this.isPaused = true;
                this._currentTime += _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.currentTime - this._startTime;
            }
        }
    }
    /**
     * Sets a dedicated volume for this sounds
     * @param newVolume Define the new volume of the sound
     * @param time Define time for gradual change to new volume
     */
    setVolume(newVolume, time) {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._soundGain) {
            if (time && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext) {
                this._soundGain.gain.cancelScheduledValues(_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.currentTime);
                this._soundGain.gain.setValueAtTime(this._soundGain.gain.value, _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.currentTime);
                this._soundGain.gain.linearRampToValueAtTime(newVolume, _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine.audioContext.currentTime + time);
            }
            else {
                this._soundGain.gain.value = newVolume;
            }
        }
        this._volume = newVolume;
    }
    /**
     * Set the sound play back rate
     * @param newPlaybackRate Define the playback rate the sound should be played at
     */
    setPlaybackRate(newPlaybackRate) {
        this._playbackRate = newPlaybackRate;
        if (this.isPlaying) {
            if (this._streaming && this._htmlAudioElement) {
                this._htmlAudioElement.playbackRate = this._playbackRate;
            }
            else if (this._soundSource) {
                this._soundSource.playbackRate.value = this._playbackRate;
            }
        }
    }
    /**
     * Gets the sound play back rate.
     * @returns the  play back rate of the sound
     */
    getPlaybackRate() {
        return this._playbackRate;
    }
    /**
     * Gets the volume of the sound.
     * @returns the volume of the sound
     */
    getVolume() {
        return this._volume;
    }
    /**
     * Attach the sound to a dedicated mesh
     * @param transformNode The transform node to connect the sound with
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#attaching-a-sound-to-a-mesh
     */
    attachToMesh(transformNode) {
        if (this._connectedTransformNode && this._registerFunc) {
            this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc);
            this._registerFunc = null;
        }
        this._connectedTransformNode = transformNode;
        if (!this._spatialSound) {
            this._spatialSound = true;
            this._createSpatialParameters();
            if (this.isPlaying && this.loop) {
                this.stop();
                this.play(0, this._offset, this._length);
            }
        }
        this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode);
        this._registerFunc = (transformNode) => this._onRegisterAfterWorldMatrixUpdate(transformNode);
        this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc);
    }
    /**
     * Detach the sound from the previously attached mesh
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#attaching-a-sound-to-a-mesh
     */
    detachFromMesh() {
        if (this._connectedTransformNode && this._registerFunc) {
            this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc);
            this._registerFunc = null;
            this._connectedTransformNode = null;
        }
    }
    _onRegisterAfterWorldMatrixUpdate(node) {
        if (!node.getBoundingInfo) {
            this.setPosition(node.absolutePosition);
        }
        else {
            const mesh = node;
            const boundingInfo = mesh.getBoundingInfo();
            this.setPosition(boundingInfo.boundingSphere.centerWorld);
        }
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._isDirectional && this.isPlaying) {
            this._updateDirection();
        }
    }
    /**
     * Clone the current sound in the scene.
     * @returns the new sound clone
     */
    clone() {
        if (!this._streaming) {
            const setBufferAndRun = () => {
                if (this._isReadyToPlay) {
                    clonedSound._audioBuffer = this.getAudioBuffer();
                    clonedSound._isReadyToPlay = true;
                    if (clonedSound.autoplay) {
                        clonedSound.play(0, this._offset, this._length);
                    }
                }
                else {
                    setTimeout(setBufferAndRun, 300);
                }
            };
            const currentOptions = {
                autoplay: this.autoplay,
                loop: this.loop,
                volume: this._volume,
                spatialSound: this._spatialSound,
                maxDistance: this.maxDistance,
                useCustomAttenuation: this.useCustomAttenuation,
                rolloffFactor: this.rolloffFactor,
                refDistance: this.refDistance,
                distanceModel: this.distanceModel,
            };
            const clonedSound = new Sound(this.name + "_cloned", new ArrayBuffer(0), this._scene, null, currentOptions);
            if (this.useCustomAttenuation) {
                clonedSound.setAttenuationFunction(this._customAttenuationFunction);
            }
            clonedSound.setPosition(this._position);
            clonedSound.setPlaybackRate(this._playbackRate);
            setBufferAndRun();
            return clonedSound;
        }
        // Can't clone a streaming sound
        else {
            return null;
        }
    }
    /**
     * Gets the current underlying audio buffer containing the data
     * @returns the audio buffer
     */
    getAudioBuffer() {
        return this._audioBuffer;
    }
    /**
     * Gets the WebAudio AudioBufferSourceNode, lets you keep track of and stop instances of this Sound.
     * @returns the source node
     */
    getSoundSource() {
        return this._soundSource;
    }
    /**
     * Gets the WebAudio GainNode, gives you precise control over the gain of instances of this Sound.
     * @returns the gain node
     */
    getSoundGain() {
        return this._soundGain;
    }
    /**
     * Serializes the Sound in a JSON representation
     * @returns the JSON representation of the sound
     */
    serialize() {
        const serializationObject = {
            name: this.name,
            url: this._url,
            autoplay: this.autoplay,
            loop: this.loop,
            volume: this._volume,
            spatialSound: this._spatialSound,
            maxDistance: this.maxDistance,
            rolloffFactor: this.rolloffFactor,
            refDistance: this.refDistance,
            distanceModel: this.distanceModel,
            playbackRate: this._playbackRate,
            panningModel: this._panningModel,
            soundTrackId: this.soundTrackId,
            metadata: this.metadata,
        };
        if (this._spatialSound) {
            if (this._connectedTransformNode) {
                serializationObject.connectedMeshId = this._connectedTransformNode.id;
            }
            serializationObject.position = this._position.asArray();
            serializationObject.refDistance = this.refDistance;
            serializationObject.distanceModel = this.distanceModel;
            serializationObject.isDirectional = this._isDirectional;
            serializationObject.localDirectionToMesh = this._localDirection.asArray();
            serializationObject.coneInnerAngle = this._coneInnerAngle;
            serializationObject.coneOuterAngle = this._coneOuterAngle;
            serializationObject.coneOuterGain = this._coneOuterGain;
        }
        return serializationObject;
    }
    /**
     * Parse a JSON representation of a sound to instantiate in a given scene
     * @param parsedSound Define the JSON representation of the sound (usually coming from the serialize method)
     * @param scene Define the scene the new parsed sound should be created in
     * @param rootUrl Define the rooturl of the load in case we need to fetch relative dependencies
     * @param sourceSound Define a sound place holder if do not need to instantiate a new one
     * @returns the newly parsed sound
     */
    static Parse(parsedSound, scene, rootUrl, sourceSound) {
        const soundName = parsedSound.name;
        let soundUrl;
        if (parsedSound.url) {
            soundUrl = rootUrl + parsedSound.url;
        }
        else {
            soundUrl = rootUrl + soundName;
        }
        const options = {
            autoplay: parsedSound.autoplay,
            loop: parsedSound.loop,
            volume: parsedSound.volume,
            spatialSound: parsedSound.spatialSound,
            maxDistance: parsedSound.maxDistance,
            rolloffFactor: parsedSound.rolloffFactor,
            refDistance: parsedSound.refDistance,
            distanceModel: parsedSound.distanceModel,
            playbackRate: parsedSound.playbackRate,
        };
        let newSound;
        if (!sourceSound) {
            newSound = new Sound(soundName, soundUrl, scene, () => {
                scene.removePendingData(newSound);
            }, options);
            scene.addPendingData(newSound);
        }
        else {
            const setBufferAndRun = () => {
                if (sourceSound._isReadyToPlay) {
                    newSound._audioBuffer = sourceSound.getAudioBuffer();
                    newSound._isReadyToPlay = true;
                    if (newSound.autoplay) {
                        newSound.play(0, newSound._offset, newSound._length);
                    }
                }
                else {
                    setTimeout(setBufferAndRun, 300);
                }
            };
            newSound = new Sound(soundName, new ArrayBuffer(0), scene, null, options);
            setBufferAndRun();
        }
        if (parsedSound.position) {
            const soundPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.FromArray(parsedSound.position);
            newSound.setPosition(soundPosition);
        }
        if (parsedSound.isDirectional) {
            newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
            if (parsedSound.localDirectionToMesh) {
                const localDirectionToMesh = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.FromArray(parsedSound.localDirectionToMesh);
                newSound.setLocalDirectionToMesh(localDirectionToMesh);
            }
        }
        if (parsedSound.connectedMeshId) {
            const connectedMesh = scene.getMeshById(parsedSound.connectedMeshId);
            if (connectedMesh) {
                newSound.attachToMesh(connectedMesh);
            }
        }
        if (parsedSound.metadata) {
            newSound.metadata = parsedSound.metadata;
        }
        return newSound;
    }
    _setOffset(value) {
        if (this._offset === value) {
            return;
        }
        if (this.isPaused) {
            this.stop();
            this.isPaused = false;
        }
        this._offset = value;
    }
    _clearTimeoutsAndObservers() {
        if (this._tryToPlayTimeout) {
            clearTimeout(this._tryToPlayTimeout);
            this._tryToPlayTimeout = null;
        }
        if (this._audioUnlockedObserver) {
            _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.audioEngine?.onAudioUnlockedObservable.remove(this._audioUnlockedObserver);
            this._audioUnlockedObserver = null;
        }
    }
}
/**
 * @internal
 */
Sound._SceneComponentInitialization = (_) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_4__/* ._WarnImport */ .n)("AudioSceneComponent");
};
// Register Class Name
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .RegisterClass */ .Y5)("BABYLON.Sound", Sound);
//# sourceMappingURL=sound.js.map

/***/ }),

/***/ 68415:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   j: () => (/* binding */ SoundTrack)
/* harmony export */ });
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6315);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32206);


/**
 * It could be useful to isolate your music & sounds on several tracks to better manage volume on a grouped instance of sounds.
 * It will be also used in a future release to apply effects on a specific track.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-sound-tracks
 */
class SoundTrack {
    /**
     * Creates a new sound track.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-sound-tracks
     * @param scene Define the scene the sound track belongs to
     * @param options
     */
    constructor(scene, options = {}) {
        /**
         * The unique identifier of the sound track in the scene.
         */
        this.id = -1;
        this._isInitialized = false;
        scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.LastCreatedScene;
        if (!scene) {
            return;
        }
        this._scene = scene;
        this.soundCollection = [];
        this._options = options;
        if (!this._options.mainTrack && this._scene.soundTracks) {
            this._scene.soundTracks.push(this);
            this.id = this._scene.soundTracks.length - 1;
        }
    }
    _initializeSoundTrackAudioGraph() {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine.audioContext) {
            this._outputAudioNode = _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine.audioContext.createGain();
            this._outputAudioNode.connect(_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine.masterGain);
            if (this._options) {
                if (this._options.volume) {
                    this._outputAudioNode.gain.value = this._options.volume;
                }
            }
            this._isInitialized = true;
        }
    }
    /**
     * Release the sound track and its associated resources
     */
    dispose() {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine && _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine.canUseWebAudio) {
            if (this._connectedAnalyser) {
                this._connectedAnalyser.stopDebugCanvas();
            }
            while (this.soundCollection.length) {
                this.soundCollection[0].dispose();
            }
            if (this._outputAudioNode) {
                this._outputAudioNode.disconnect();
            }
            this._outputAudioNode = null;
        }
    }
    /**
     * Adds a sound to this sound track
     * @param sound define the sound to add
     * @ignoreNaming
     */
    addSound(sound) {
        if (!this._isInitialized) {
            this._initializeSoundTrackAudioGraph();
        }
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._outputAudioNode) {
            sound.connectToSoundTrackAudioNode(this._outputAudioNode);
        }
        if (sound.soundTrackId !== undefined) {
            if (sound.soundTrackId === -1) {
                this._scene.mainSoundTrack.removeSound(sound);
            }
            else if (this._scene.soundTracks) {
                this._scene.soundTracks[sound.soundTrackId].removeSound(sound);
            }
        }
        this.soundCollection.push(sound);
        sound.soundTrackId = this.id;
    }
    /**
     * Removes a sound to this sound track
     * @param sound define the sound to remove
     * @ignoreNaming
     */
    removeSound(sound) {
        const index = this.soundCollection.indexOf(sound);
        if (index !== -1) {
            this.soundCollection.splice(index, 1);
        }
    }
    /**
     * Set a global volume for the full sound track.
     * @param newVolume Define the new volume of the sound track
     */
    setVolume(newVolume) {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._outputAudioNode) {
            this._outputAudioNode.gain.value = newVolume;
        }
    }
    /**
     * Switch the panning model to HRTF:
     * Renders a stereo output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
     */
    switchPanningModelToHRTF() {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio) {
            for (let i = 0; i < this.soundCollection.length; i++) {
                this.soundCollection[i].switchPanningModelToHRTF();
            }
        }
    }
    /**
     * Switch the panning model to Equal Power:
     * Represents the equal-power panning algorithm, generally regarded as simple and efficient. equalpower is the default value.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#creating-a-spatial-3d-sound
     */
    switchPanningModelToEqualPower() {
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio) {
            for (let i = 0; i < this.soundCollection.length; i++) {
                this.soundCollection[i].switchPanningModelToEqualPower();
            }
        }
    }
    /**
     * Connect the sound track to an audio analyser allowing some amazing
     * synchronization between the sounds/music and your visualization (VuMeter for instance).
     * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-the-analyser
     * @param analyser The analyser to connect to the engine
     */
    connectToAnalyser(analyser) {
        if (this._connectedAnalyser) {
            this._connectedAnalyser.stopDebugCanvas();
        }
        this._connectedAnalyser = analyser;
        if (_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine?.canUseWebAudio && this._outputAudioNode) {
            this._outputAudioNode.disconnect();
            this._connectedAnalyser.connectAudioNodes(this._outputAudioNode, _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine.masterGain);
        }
    }
}
//# sourceMappingURL=soundTrack.js.map

/***/ }),

/***/ 69645:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   r: () => (/* binding */ WeightedSound)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);

/**
 * Wraps one or more Sound objects and selects one with random weight for playback.
 */
class WeightedSound {
    /**
     * Creates a new WeightedSound from the list of sounds given.
     * @param loop When true a Sound will be selected and played when the current playing Sound completes.
     * @param sounds Array of Sounds that will be selected from.
     * @param weights Array of number values for selection weights; length must equal sounds, values will be normalized to 1
     */
    constructor(loop, sounds, weights) {
        /** When true a Sound will be selected and played when the current playing Sound completes. */
        this.loop = false;
        this._coneInnerAngle = 360;
        this._coneOuterAngle = 360;
        this._volume = 1;
        /** A Sound is currently playing. */
        this.isPlaying = false;
        /** A Sound is currently paused. */
        this.isPaused = false;
        this._sounds = [];
        this._weights = [];
        if (sounds.length !== weights.length) {
            throw new Error("Sounds length does not equal weights length");
        }
        this.loop = loop;
        this._weights = weights;
        // Normalize the weights
        let weightSum = 0;
        for (const weight of weights) {
            weightSum += weight;
        }
        const invWeightSum = weightSum > 0 ? 1 / weightSum : 0;
        for (let i = 0; i < this._weights.length; i++) {
            this._weights[i] *= invWeightSum;
        }
        this._sounds = sounds;
        for (const sound of this._sounds) {
            sound.onEndedObservable.add(() => {
                this._onended();
            });
        }
    }
    /**
     * The size of cone in degrees for a directional sound in which there will be no attenuation.
     */
    get directionalConeInnerAngle() {
        return this._coneInnerAngle;
    }
    /**
     * The size of cone in degrees for a directional sound in which there will be no attenuation.
     */
    set directionalConeInnerAngle(value) {
        if (value !== this._coneInnerAngle) {
            if (this._coneOuterAngle < value) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");
                return;
            }
            this._coneInnerAngle = value;
            for (const sound of this._sounds) {
                sound.directionalConeInnerAngle = value;
            }
        }
    }
    /**
     * Size of cone in degrees for a directional sound outside of which there will be no sound.
     * Listener angles between innerAngle and outerAngle will falloff linearly.
     */
    get directionalConeOuterAngle() {
        return this._coneOuterAngle;
    }
    /**
     * Size of cone in degrees for a directional sound outside of which there will be no sound.
     * Listener angles between innerAngle and outerAngle will falloff linearly.
     */
    set directionalConeOuterAngle(value) {
        if (value !== this._coneOuterAngle) {
            if (value < this._coneInnerAngle) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");
                return;
            }
            this._coneOuterAngle = value;
            for (const sound of this._sounds) {
                sound.directionalConeOuterAngle = value;
            }
        }
    }
    /**
     * Playback volume.
     */
    get volume() {
        return this._volume;
    }
    /**
     * Playback volume.
     */
    set volume(value) {
        if (value !== this._volume) {
            for (const sound of this._sounds) {
                sound.setVolume(value);
            }
        }
    }
    _onended() {
        if (this._currentIndex !== undefined) {
            this._sounds[this._currentIndex].autoplay = false;
        }
        if (this.loop && this.isPlaying) {
            this.play();
        }
        else {
            this.isPlaying = false;
        }
    }
    /**
     * Suspend playback
     */
    pause() {
        if (this.isPlaying) {
            this.isPaused = true;
            if (this._currentIndex !== undefined) {
                this._sounds[this._currentIndex].pause();
            }
        }
    }
    /**
     * Stop playback
     */
    stop() {
        this.isPlaying = false;
        if (this._currentIndex !== undefined) {
            this._sounds[this._currentIndex].stop();
        }
    }
    /**
     * Start playback.
     * @param startOffset Position the clip head at a specific time in seconds.
     */
    play(startOffset) {
        if (!this.isPaused) {
            this.stop();
            const randomValue = Math.random();
            let total = 0;
            for (let i = 0; i < this._weights.length; i++) {
                total += this._weights[i];
                if (randomValue <= total) {
                    this._currentIndex = i;
                    break;
                }
            }
        }
        const sound = this._sounds[this._currentIndex ?? 0];
        if (sound.isReady()) {
            sound.play(0, this.isPaused ? undefined : startOffset);
        }
        else {
            sound.autoplay = true;
        }
        this.isPlaying = true;
        this.isPaused = false;
    }
}
//# sourceMappingURL=weightedsound.js.map

/***/ }),

/***/ 55234:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   D: () => (/* binding */ BaseSixDofDragBehavior)
/* harmony export */ });
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87491);
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66240);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99848);
/* harmony import */ var _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97328);
/* harmony import */ var _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(30388);






/**
 * Base behavior for six degrees of freedom interactions in XR experiences.
 * Creates virtual meshes that are dragged around
 * And observables for position/rotation changes
 */
class BaseSixDofDragBehavior {
    constructor() {
        this._attachedToElement = false;
        this._virtualMeshesInfo = {};
        this._tmpVector = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq();
        this._tmpQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion */ .PT();
        this._dragType = {
            NONE: 0,
            DRAG: 1,
            DRAG_WITH_CONTROLLER: 2,
            NEAR_DRAG: 3,
        };
        this._moving = false;
        this._dragging = this._dragType.NONE;
        /**
         * The list of child meshes that can receive drag events
         * If `null`, all child meshes will receive drag event
         */
        this.draggableMeshes = null;
        /**
         * How much faster the object should move when the controller is moving towards it. This is useful to bring objects that are far away from the user to them faster. Set this to 0 to avoid any speed increase. (Default: 3)
         */
        this.zDragFactor = 3;
        /**
         * In case of multipointer interaction, all pointer ids currently active are stored here
         */
        this.currentDraggingPointerIds = [];
        /**
        /**
         * If camera controls should be detached during the drag
         */
        this.detachCameraControls = true;
        /**
         * Fires each time a drag starts
         */
        this.onDragStartObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .cP();
        /**
         * Fires each time a drag happens
         */
        this.onDragObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .cP();
        /**
         *  Fires each time a drag ends (eg. mouse release after drag)
         */
        this.onDragEndObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .cP();
        /**
         * Should the behavior allow simultaneous pointers to interact with the owner node.
         */
        this.allowMultiPointer = true;
    }
    /**
     * The id of the pointer that is currently interacting with the behavior (-1 when no pointer is active)
     */
    get currentDraggingPointerId() {
        if (this.currentDraggingPointerIds[0] !== undefined) {
            return this.currentDraggingPointerIds[0];
        }
        return -1;
    }
    set currentDraggingPointerId(value) {
        this.currentDraggingPointerIds[0] = value;
    }
    /**
     * Get or set the currentDraggingPointerId
     * @deprecated Please use currentDraggingPointerId instead
     */
    get currentDraggingPointerID() {
        return this.currentDraggingPointerId;
    }
    set currentDraggingPointerID(currentDraggingPointerID) {
        this.currentDraggingPointerId = currentDraggingPointerID;
    }
    /**
     *  The name of the behavior
     */
    get name() {
        return "BaseSixDofDrag";
    }
    /**
     *  Returns true if the attached mesh is currently moving with this behavior
     */
    get isMoving() {
        return this._moving;
    }
    /**
     *  Initializes the behavior
     */
    init() { }
    /**
     * In the case of multiple active cameras, the cameraToUseForPointers should be used if set instead of active camera
     */
    get _pointerCamera() {
        if (this._scene.cameraToUseForPointers) {
            return this._scene.cameraToUseForPointers;
        }
        else {
            return this._scene.activeCamera;
        }
    }
    _createVirtualMeshInfo() {
        // Setup virtual meshes to be used for dragging without dirtying the existing scene
        const dragMesh = new _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_4__/* .TransformNode */ .V("", BaseSixDofDragBehavior._virtualScene);
        dragMesh.rotationQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion */ .PT();
        const originMesh = new _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_4__/* .TransformNode */ .V("", BaseSixDofDragBehavior._virtualScene);
        originMesh.rotationQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion */ .PT();
        const pivotMesh = new _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_4__/* .TransformNode */ .V("", BaseSixDofDragBehavior._virtualScene);
        pivotMesh.rotationQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion */ .PT();
        return {
            dragging: false,
            moving: false,
            dragMesh,
            originMesh,
            pivotMesh,
            startingPivotPosition: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(),
            startingPivotOrientation: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion */ .PT(),
            startingPosition: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(),
            startingOrientation: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion */ .PT(),
            lastOriginPosition: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(),
            lastDragPosition: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(),
        };
    }
    _resetVirtualMeshesPosition() {
        for (let i = 0; i < this.currentDraggingPointerIds.length; i++) {
            this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].pivotMesh.position.copyFrom(this._ownerNode.getAbsolutePivotPoint());
            this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].pivotMesh.rotationQuaternion.copyFrom(this._ownerNode.rotationQuaternion);
            this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].startingPivotPosition.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].pivotMesh.position);
            this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].startingPivotOrientation.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].pivotMesh.rotationQuaternion);
            this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].startingPosition.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].dragMesh.position);
            this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].startingOrientation.copyFrom(this._virtualMeshesInfo[this.currentDraggingPointerIds[i]].dragMesh.rotationQuaternion);
        }
    }
    _pointerUpdate2D(ray, pointerId, zDragFactor) {
        if (this._pointerCamera && this._pointerCamera.cameraRigMode == _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_5__/* .Camera */ .i.RIG_MODE_NONE && !this._pointerCamera._isLeftCamera && !this._pointerCamera._isRightCamera) {
            ray.origin.copyFrom(this._pointerCamera.globalPosition);
            zDragFactor = 0;
        }
        const virtualMeshesInfo = this._virtualMeshesInfo[pointerId];
        // Calculate controller drag distance in controller space
        const originDragDifference = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0];
        ray.origin.subtractToRef(virtualMeshesInfo.lastOriginPosition, originDragDifference);
        virtualMeshesInfo.lastOriginPosition.copyFrom(ray.origin);
        const localOriginDragDifference = -_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Dot(originDragDifference, ray.direction);
        virtualMeshesInfo.originMesh.addChild(virtualMeshesInfo.dragMesh);
        virtualMeshesInfo.originMesh.addChild(virtualMeshesInfo.pivotMesh);
        this._applyZOffset(virtualMeshesInfo.dragMesh, localOriginDragDifference, zDragFactor);
        this._applyZOffset(virtualMeshesInfo.pivotMesh, localOriginDragDifference, zDragFactor);
        // Update the controller position
        virtualMeshesInfo.originMesh.position.copyFrom(ray.origin);
        const lookAt = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0];
        ray.origin.addToRef(ray.direction, lookAt);
        virtualMeshesInfo.originMesh.lookAt(lookAt);
        virtualMeshesInfo.originMesh.removeChild(virtualMeshesInfo.dragMesh);
        virtualMeshesInfo.originMesh.removeChild(virtualMeshesInfo.pivotMesh);
    }
    _pointerUpdateXR(controllerAimTransform, controllerGripTransform, pointerId, zDragFactor) {
        const virtualMeshesInfo = this._virtualMeshesInfo[pointerId];
        virtualMeshesInfo.originMesh.position.copyFrom(controllerAimTransform.position);
        if (this._dragging === this._dragType.NEAR_DRAG && controllerGripTransform) {
            virtualMeshesInfo.originMesh.rotationQuaternion.copyFrom(controllerGripTransform.rotationQuaternion);
        }
        else {
            virtualMeshesInfo.originMesh.rotationQuaternion.copyFrom(controllerAimTransform.rotationQuaternion);
        }
        virtualMeshesInfo.pivotMesh.computeWorldMatrix(true);
        virtualMeshesInfo.dragMesh.computeWorldMatrix(true);
        // Z scaling logic
        if (zDragFactor !== 0) {
            // Camera.getForwardRay modifies TmpVectors.Vector[0-3], so cache it in advance
            const cameraForwardVec = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0];
            const originDragDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[1];
            cameraForwardVec.copyFrom(this._pointerCamera.getForwardRay().direction);
            virtualMeshesInfo.originMesh.position.subtractToRef(virtualMeshesInfo.lastOriginPosition, originDragDirection);
            virtualMeshesInfo.lastOriginPosition.copyFrom(virtualMeshesInfo.originMesh.position);
            const controllerDragDistance = originDragDirection.length();
            originDragDirection.normalize();
            const cameraToDrag = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[2];
            const controllerToDrag = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[3];
            virtualMeshesInfo.dragMesh.absolutePosition.subtractToRef(this._pointerCamera.globalPosition, cameraToDrag);
            virtualMeshesInfo.dragMesh.absolutePosition.subtractToRef(virtualMeshesInfo.originMesh.position, controllerToDrag);
            const controllerToDragDistance = controllerToDrag.length();
            cameraToDrag.normalize();
            controllerToDrag.normalize();
            const controllerDragScaling = Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Dot(originDragDirection, controllerToDrag)) * _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Dot(originDragDirection, cameraForwardVec);
            let zOffsetScaling = controllerDragScaling * zDragFactor * controllerDragDistance * controllerToDragDistance;
            // Prevent pulling the mesh through the controller
            const minDistanceFromControllerToDragMesh = 0.01;
            if (zOffsetScaling < 0 && minDistanceFromControllerToDragMesh - controllerToDragDistance > zOffsetScaling) {
                zOffsetScaling = Math.min(minDistanceFromControllerToDragMesh - controllerToDragDistance, 0);
            }
            controllerToDrag.scaleInPlace(zOffsetScaling);
            controllerToDrag.addToRef(virtualMeshesInfo.pivotMesh.absolutePosition, this._tmpVector);
            virtualMeshesInfo.pivotMesh.setAbsolutePosition(this._tmpVector);
            controllerToDrag.addToRef(virtualMeshesInfo.dragMesh.absolutePosition, this._tmpVector);
            virtualMeshesInfo.dragMesh.setAbsolutePosition(this._tmpVector);
        }
    }
    /**
     * Attaches the scale behavior the passed in mesh
     * @param ownerNode The mesh that will be scaled around once attached
     */
    attach(ownerNode) {
        this._ownerNode = ownerNode;
        this._scene = this._ownerNode.getScene();
        if (!BaseSixDofDragBehavior._virtualScene) {
            BaseSixDofDragBehavior._virtualScene = new _scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z(this._scene.getEngine(), { virtual: true });
            BaseSixDofDragBehavior._virtualScene.detachControl();
        }
        const pickPredicate = (m) => {
            return this._ownerNode === m || (m.isDescendantOf(this._ownerNode) && (!this.draggableMeshes || this.draggableMeshes.indexOf(m) !== -1));
        };
        this._pointerObserver = this._scene.onPointerObservable.add((pointerInfo) => {
            const pointerId = pointerInfo.event.pointerId;
            if (!this._virtualMeshesInfo[pointerId]) {
                this._virtualMeshesInfo[pointerId] = this._createVirtualMeshInfo();
            }
            const virtualMeshesInfo = this._virtualMeshesInfo[pointerId];
            const isXRPointer = pointerInfo.event.pointerType === "xr-near" || pointerInfo.event.pointerType === "xr";
            if (pointerInfo.type == _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_1__/* .PointerEventTypes */ .Zp.POINTERDOWN) {
                if (!virtualMeshesInfo.dragging &&
                    pointerInfo.pickInfo &&
                    pointerInfo.pickInfo.hit &&
                    pointerInfo.pickInfo.pickedMesh &&
                    pointerInfo.pickInfo.pickedPoint &&
                    pointerInfo.pickInfo.ray &&
                    (!isXRPointer || pointerInfo.pickInfo.aimTransform) &&
                    pickPredicate(pointerInfo.pickInfo.pickedMesh)) {
                    if ((!this.allowMultiPointer || isXRPointer) && this.currentDraggingPointerIds.length > 0) {
                        return;
                    }
                    if (this._pointerCamera &&
                        this._pointerCamera.cameraRigMode === _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_5__/* .Camera */ .i.RIG_MODE_NONE &&
                        !this._pointerCamera._isLeftCamera &&
                        !this._pointerCamera._isRightCamera) {
                        pointerInfo.pickInfo.ray.origin.copyFrom(this._pointerCamera.globalPosition);
                    }
                    this._ownerNode.computeWorldMatrix(true);
                    const virtualMeshesInfo = this._virtualMeshesInfo[pointerId];
                    if (isXRPointer) {
                        this._dragging = pointerInfo.pickInfo.originMesh ? this._dragType.NEAR_DRAG : this._dragType.DRAG_WITH_CONTROLLER;
                        virtualMeshesInfo.originMesh.position.copyFrom(pointerInfo.pickInfo.aimTransform.position);
                        if (this._dragging === this._dragType.NEAR_DRAG && pointerInfo.pickInfo.gripTransform) {
                            virtualMeshesInfo.originMesh.rotationQuaternion.copyFrom(pointerInfo.pickInfo.gripTransform.rotationQuaternion);
                        }
                        else {
                            virtualMeshesInfo.originMesh.rotationQuaternion.copyFrom(pointerInfo.pickInfo.aimTransform.rotationQuaternion);
                        }
                    }
                    else {
                        this._dragging = this._dragType.DRAG;
                        virtualMeshesInfo.originMesh.position.copyFrom(pointerInfo.pickInfo.ray.origin);
                    }
                    virtualMeshesInfo.lastOriginPosition.copyFrom(virtualMeshesInfo.originMesh.position);
                    virtualMeshesInfo.dragMesh.position.copyFrom(pointerInfo.pickInfo.pickedPoint);
                    virtualMeshesInfo.lastDragPosition.copyFrom(pointerInfo.pickInfo.pickedPoint);
                    virtualMeshesInfo.pivotMesh.position.copyFrom(this._ownerNode.getAbsolutePivotPoint());
                    virtualMeshesInfo.pivotMesh.rotationQuaternion.copyFrom(this._ownerNode.absoluteRotationQuaternion);
                    virtualMeshesInfo.startingPosition.copyFrom(virtualMeshesInfo.dragMesh.position);
                    virtualMeshesInfo.startingPivotPosition.copyFrom(virtualMeshesInfo.pivotMesh.position);
                    virtualMeshesInfo.startingOrientation.copyFrom(virtualMeshesInfo.dragMesh.rotationQuaternion);
                    virtualMeshesInfo.startingPivotOrientation.copyFrom(virtualMeshesInfo.pivotMesh.rotationQuaternion);
                    if (isXRPointer) {
                        virtualMeshesInfo.originMesh.addChild(virtualMeshesInfo.dragMesh);
                        virtualMeshesInfo.originMesh.addChild(virtualMeshesInfo.pivotMesh);
                    }
                    else {
                        virtualMeshesInfo.originMesh.lookAt(virtualMeshesInfo.dragMesh.position);
                    }
                    // Update state
                    virtualMeshesInfo.dragging = true;
                    if (this.currentDraggingPointerIds.indexOf(pointerId) === -1) {
                        this.currentDraggingPointerIds.push(pointerId);
                    }
                    // Detach camera controls
                    if (this.detachCameraControls && this._pointerCamera && !this._pointerCamera.leftCamera) {
                        if (this._pointerCamera.inputs && this._pointerCamera.inputs.attachedToElement) {
                            this._pointerCamera.detachControl();
                            this._attachedToElement = true;
                        }
                        else if (!this.allowMultiPointer || this.currentDraggingPointerIds.length === 0) {
                            this._attachedToElement = false;
                        }
                    }
                    this._targetDragStart(virtualMeshesInfo.pivotMesh.position, virtualMeshesInfo.pivotMesh.rotationQuaternion, pointerId);
                    this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.pivotMesh.position });
                }
            }
            else if (pointerInfo.type == _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_1__/* .PointerEventTypes */ .Zp.POINTERUP || pointerInfo.type == _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_1__/* .PointerEventTypes */ .Zp.POINTERDOUBLETAP) {
                const registeredPointerIndex = this.currentDraggingPointerIds.indexOf(pointerId);
                // Update state
                virtualMeshesInfo.dragging = false;
                if (registeredPointerIndex !== -1) {
                    this.currentDraggingPointerIds.splice(registeredPointerIndex, 1);
                    if (this.currentDraggingPointerIds.length === 0) {
                        this._moving = false;
                        this._dragging = this._dragType.NONE;
                        // Reattach camera controls
                        if (this.detachCameraControls && this._attachedToElement && this._pointerCamera && !this._pointerCamera.leftCamera) {
                            this._reattachCameraControls();
                            this._attachedToElement = false;
                        }
                    }
                    virtualMeshesInfo.originMesh.removeChild(virtualMeshesInfo.dragMesh);
                    virtualMeshesInfo.originMesh.removeChild(virtualMeshesInfo.pivotMesh);
                    this._targetDragEnd(pointerId);
                    this.onDragEndObservable.notifyObservers({});
                }
            }
            else if (pointerInfo.type == _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_1__/* .PointerEventTypes */ .Zp.POINTERMOVE) {
                const registeredPointerIndex = this.currentDraggingPointerIds.indexOf(pointerId);
                if (registeredPointerIndex !== -1 && virtualMeshesInfo.dragging && pointerInfo.pickInfo && (pointerInfo.pickInfo.ray || pointerInfo.pickInfo.aimTransform)) {
                    let zDragFactor = this.zDragFactor;
                    // 2 pointer interaction should not have a z axis drag factor
                    // as well as near interaction
                    if (this.currentDraggingPointerIds.length > 1 || pointerInfo.pickInfo.originMesh) {
                        zDragFactor = 0;
                    }
                    this._ownerNode.computeWorldMatrix(true);
                    if (!isXRPointer) {
                        this._pointerUpdate2D(pointerInfo.pickInfo.ray, pointerId, zDragFactor);
                    }
                    else {
                        this._pointerUpdateXR(pointerInfo.pickInfo.aimTransform, pointerInfo.pickInfo.gripTransform, pointerId, zDragFactor);
                    }
                    // Get change in rotation
                    this._tmpQuaternion.copyFrom(virtualMeshesInfo.startingPivotOrientation);
                    this._tmpQuaternion.x = -this._tmpQuaternion.x;
                    this._tmpQuaternion.y = -this._tmpQuaternion.y;
                    this._tmpQuaternion.z = -this._tmpQuaternion.z;
                    virtualMeshesInfo.pivotMesh.absoluteRotationQuaternion.multiplyToRef(this._tmpQuaternion, this._tmpQuaternion);
                    virtualMeshesInfo.pivotMesh.absolutePosition.subtractToRef(virtualMeshesInfo.startingPivotPosition, this._tmpVector);
                    this.onDragObservable.notifyObservers({ delta: this._tmpVector, position: virtualMeshesInfo.pivotMesh.position, pickInfo: pointerInfo.pickInfo });
                    // Notify herited methods and observables
                    this._targetDrag(this._tmpVector, this._tmpQuaternion, pointerId);
                    virtualMeshesInfo.lastDragPosition.copyFrom(virtualMeshesInfo.dragMesh.absolutePosition);
                    this._moving = true;
                }
            }
        });
    }
    _applyZOffset(node, localOriginDragDifference, zDragFactor) {
        // Determine how much the controller moved to/away towards the dragged object and use this to move the object further when its further away
        node.position.z -= node.position.z < 1 ? localOriginDragDifference * zDragFactor : localOriginDragDifference * zDragFactor * node.position.z;
        if (node.position.z < 0) {
            node.position.z = 0;
        }
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _targetDragStart(worldPosition, worldRotation, pointerId) {
        // Herited classes can override that
    }
    _targetDrag(worldDeltaPosition, worldDeltaRotation, pointerId) {
        // Herited classes can override that
    }
    _targetDragEnd(pointerId) {
        // Herited classes can override that
    }
    _reattachCameraControls() {
        if (this._pointerCamera) {
            // If the camera is an ArcRotateCamera, preserve the settings from the camera
            // when reattaching control
            if (this._pointerCamera.getClassName() === "ArcRotateCamera") {
                const arcRotateCamera = this._pointerCamera;
                arcRotateCamera.attachControl(arcRotateCamera.inputs ? arcRotateCamera.inputs.noPreventDefault : true, arcRotateCamera._useCtrlForPanning, arcRotateCamera._panningMouseButton);
            }
            else {
                // preserve the settings from the camera when reattaching control
                this._pointerCamera.attachControl(this._pointerCamera.inputs ? this._pointerCamera.inputs.noPreventDefault : true);
            }
        }
    }
    /**
     * Detaches the behavior from the mesh
     */
    detach() {
        if (this._scene) {
            if (this.detachCameraControls && this._attachedToElement && this._pointerCamera && !this._pointerCamera.leftCamera) {
                this._reattachCameraControls();
                this._attachedToElement = false;
            }
            this._scene.onPointerObservable.remove(this._pointerObserver);
        }
        for (const pointerId in this._virtualMeshesInfo) {
            this._virtualMeshesInfo[pointerId].originMesh.dispose();
            this._virtualMeshesInfo[pointerId].dragMesh.dispose();
        }
        this.onDragEndObservable.clear();
        this.onDragObservable.clear();
        this.onDragStartObservable.clear();
    }
}
//# sourceMappingURL=baseSixDofDragBehavior.js.map

/***/ }),

/***/ 74741:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _: () => (/* binding */ FadeInOutBehavior)
/* harmony export */ });
/**
 * A behavior that when attached to a mesh will allow the mesh to fade in and out
 */
class FadeInOutBehavior {
    /**
     * Time in milliseconds to delay before fading in (Default: 0)
     * Will set both fade in and out delay to the same value
     */
    get delay() {
        return this.fadeInDelay;
    }
    set delay(value) {
        this.fadeInDelay = value;
        this.fadeOutDelay = value;
    }
    /**
     * Instantiates the FadeInOutBehavior
     */
    constructor() {
        /**
         * Time in milliseconds to delay before fading in (Default: 0)
         */
        this.fadeInDelay = 0;
        /**
         * Time in milliseconds to delay before fading out (Default: 0)
         */
        this.fadeOutDelay = 0;
        /**
         * Time in milliseconds for the mesh to fade in (Default: 300)
         */
        this.fadeInTime = 300;
        /**
         * Time in milliseconds for the mesh to fade out (Default: 300)
         */
        this.fadeOutTime = 300;
        this._millisecondsPerFrame = 1000 / 60;
        this._hovered = false;
        this._hoverValue = 0;
        this._ownerNode = null;
        this._delay = 0;
        this._time = 300;
        this._update = () => {
            if (this._ownerNode) {
                this._hoverValue += this._hovered ? this._millisecondsPerFrame : -this._millisecondsPerFrame;
                this._setAllVisibility(this._ownerNode, (this._hoverValue - this._delay) / this._time);
                if (this._ownerNode.visibility > 1) {
                    this._setAllVisibility(this._ownerNode, 1);
                    if (this._hoverValue > this._time) {
                        this._hoverValue = this._time;
                        this._detachObserver();
                        return;
                    }
                }
                else if (this._ownerNode.visibility < 0) {
                    this._setAllVisibility(this._ownerNode, 0);
                    if (this._hoverValue < 0) {
                        this._hoverValue = 0;
                        this._detachObserver();
                        return;
                    }
                }
                this._attachObserver();
            }
        };
    }
    /**
     *  The name of the behavior
     */
    get name() {
        return "FadeInOut";
    }
    /**
     *  Initializes the behavior
     */
    init() { }
    /**
     * Attaches the fade behavior on the passed in mesh
     * @param ownerNode The mesh that will be faded in/out once attached
     */
    attach(ownerNode) {
        this._ownerNode = ownerNode;
        this._setAllVisibility(this._ownerNode, 0);
    }
    /**
     *  Detaches the behavior from the mesh
     */
    detach() {
        this._ownerNode = null;
    }
    /**
     * Triggers the mesh to begin fading in (or out)
     * @param fadeIn if the object should fade in or out (true to fade in)
     */
    fadeIn(fadeIn = true) {
        this._delay = fadeIn ? this.fadeInDelay : this.fadeOutDelay;
        this._time = fadeIn ? this.fadeInTime : this.fadeOutTime;
        // Cancel any pending updates
        this._detachObserver();
        // If fading in and already visible or fading out and already not visible do nothing
        if (this._ownerNode && ((fadeIn && this._ownerNode.visibility >= 1) || (!fadeIn && this._ownerNode.visibility <= 0))) {
            return;
        }
        this._hovered = fadeIn;
        if (!this._hovered) {
            // Make the delay the negative of fadeout delay so the hoverValue is kept above 1 until
            // fadeOutDelay has elapsed
            this._delay *= -1;
        }
        // Reset the hoverValue.  This is necessary because we may have been fading out, e.g. but not yet reached
        // the delay, so the hover value is greater than 1
        if (this._ownerNode.visibility >= 1) {
            this._hoverValue = this._time;
        }
        else if (this._ownerNode.visibility <= 0) {
            this._hoverValue = 0;
        }
        this._update();
    }
    /**
     * Triggers the mesh to begin fading out
     */
    fadeOut() {
        this.fadeIn(false);
    }
    _setAllVisibility(mesh, value) {
        mesh.visibility = value;
        mesh.getChildMeshes().forEach((c) => {
            this._setAllVisibility(c, value);
        });
    }
    _attachObserver() {
        if (!this._onBeforeRenderObserver) {
            this._onBeforeRenderObserver = this._ownerNode?.getScene().onBeforeRenderObservable.add(this._update);
        }
    }
    _detachObserver() {
        if (this._onBeforeRenderObserver) {
            this._ownerNode?.getScene().onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
            this._onBeforeRenderObserver = null;
        }
    }
}
//# sourceMappingURL=fadeInOutBehavior.js.map

/***/ }),

/***/ 84289:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   S: () => (/* binding */ FollowBehavior)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84867);
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65559);



/**
 * A behavior that when attached to a mesh will follow a camera
 * @since 5.0.0
 */
class FollowBehavior {
    constructor() {
        // Memory cache to avoid GC usage
        this._tmpQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT();
        this._tmpVectors = [new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq()];
        this._tmpMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
        this._tmpInvertView = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
        this._tmpForward = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq();
        this._tmpNodeForward = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq();
        this._tmpPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq();
        this._workingPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq();
        this._workingQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT();
        this._lastTick = -1;
        this._recenterNextUpdate = true;
        /**
         * Set to false if the node should strictly follow the camera without any interpolation time
         */
        this.interpolatePose = true;
        /**
         * Rate of interpolation of position and rotation of the attached node.
         * Higher values will give a slower interpolation.
         */
        this.lerpTime = 500;
        /**
         * If the behavior should ignore the pitch and roll of the camera.
         */
        this.ignoreCameraPitchAndRoll = false;
        /**
         * Pitch offset from camera (relative to Max Distance)
         * Is only effective if `ignoreCameraPitchAndRoll` is set to `true`.
         */
        this.pitchOffset = 15;
        /**
         * The vertical angle from the camera forward axis to the owner will not exceed this value
         */
        this.maxViewVerticalDegrees = 30;
        /**
         * The horizontal angle from the camera forward axis to the owner will not exceed this value
         */
        this.maxViewHorizontalDegrees = 30;
        /**
         * The attached node will not reorient until the angle between its forward vector and the vector to the camera is greater than this value
         */
        this.orientToCameraDeadzoneDegrees = 60;
        /**
         * Option to ignore distance clamping
         */
        this.ignoreDistanceClamp = false;
        /**
         * Option to ignore angle clamping
         */
        this.ignoreAngleClamp = false;
        /**
         * Max vertical distance between the attachedNode and camera
         */
        this.verticalMaxDistance = 0;
        /**
         *  Default distance from eye to attached node, i.e. the sphere radius
         */
        this.defaultDistance = 0.8;
        /**
         *  Max distance from eye to attached node, i.e. the sphere radius
         */
        this.maximumDistance = 2;
        /**
         *  Min distance from eye to attached node, i.e. the sphere radius
         */
        this.minimumDistance = 0.3;
        /**
         * Ignore vertical movement and lock the Y position of the object.
         */
        this.useFixedVerticalOffset = false;
        /**
         * Fixed vertical position offset distance.
         */
        this.fixedVerticalOffset = 0;
        /**
         * Enables/disables the behavior
         * @internal
         */
        this._enabled = true;
    }
    /**
     * The camera that should be followed by this behavior
     */
    get followedCamera() {
        return this._followedCamera || this._scene.activeCamera;
    }
    set followedCamera(camera) {
        this._followedCamera = camera;
    }
    /**
     *  The name of the behavior
     */
    get name() {
        return "Follow";
    }
    /**
     *  Initializes the behavior
     */
    init() { }
    /**
     * Attaches the follow behavior
     * @param ownerNode The mesh that will be following once attached
     * @param followedCamera The camera that should be followed by the node
     */
    attach(ownerNode, followedCamera) {
        this._scene = ownerNode.getScene();
        this.attachedNode = ownerNode;
        if (followedCamera) {
            this.followedCamera = followedCamera;
        }
        this._addObservables();
    }
    /**
     *  Detaches the behavior from the mesh
     */
    detach() {
        this.attachedNode = null;
        this._removeObservables();
    }
    /**
     * Recenters the attached node in front of the camera on the next update
     */
    recenter() {
        this._recenterNextUpdate = true;
    }
    _angleBetweenVectorAndPlane(vector, normal) {
        // Work on copies
        this._tmpVectors[0].copyFrom(vector);
        vector = this._tmpVectors[0];
        this._tmpVectors[1].copyFrom(normal);
        normal = this._tmpVectors[1];
        vector.normalize();
        normal.normalize();
        return Math.PI / 2 - Math.acos(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Dot(vector, normal));
    }
    _length2D(vector) {
        return Math.sqrt(vector.x * vector.x + vector.z * vector.z);
    }
    _distanceClamp(currentToTarget, moveToDefault = false) {
        let minDistance = this.minimumDistance;
        let maxDistance = this.maximumDistance;
        const defaultDistance = this.defaultDistance;
        const direction = this._tmpVectors[0];
        direction.copyFrom(currentToTarget);
        let currentDistance = direction.length();
        direction.normalizeFromLength(currentDistance);
        if (this.ignoreCameraPitchAndRoll) {
            // If we don't account for pitch offset, the casted object will float up/down as the reference
            // gets closer to it because we will still be casting in the direction of the pitched offset.
            // To fix this, only modify the XZ position of the object.
            minDistance = this._length2D(direction) * minDistance;
            maxDistance = this._length2D(direction) * maxDistance;
            const currentDistance2D = this._length2D(currentToTarget);
            direction.scaleInPlace(currentDistance / currentDistance2D);
            currentDistance = currentDistance2D;
        }
        let clampedDistance = currentDistance;
        if (moveToDefault) {
            clampedDistance = defaultDistance;
        }
        else {
            clampedDistance = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__.Clamp)(currentDistance, minDistance, maxDistance);
        }
        currentToTarget.copyFrom(direction).scaleInPlace(clampedDistance);
        return currentDistance !== clampedDistance;
    }
    _applyVerticalClamp(currentToTarget) {
        if (this.verticalMaxDistance !== 0) {
            currentToTarget.y = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__.Clamp)(currentToTarget.y, -this.verticalMaxDistance, this.verticalMaxDistance);
        }
    }
    _toOrientationQuatToRef(vector, quaternion) {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationYawPitchRollToRef(Math.atan2(vector.x, vector.z), Math.atan2(vector.y, Math.sqrt(vector.z * vector.z + vector.x * vector.x)), 0, quaternion);
    }
    _applyPitchOffset(invertView) {
        const forward = this._tmpVectors[0];
        const right = this._tmpVectors[1];
        forward.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1);
        right.copyFromFloats(1, 0, 0);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalToRef(forward, invertView, forward);
        forward.y = 0;
        forward.normalize();
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalToRef(right, invertView, right);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationAxisToRef(right, (this.pitchOffset * Math.PI) / 180, this._tmpQuaternion);
        forward.rotateByQuaternionToRef(this._tmpQuaternion, forward);
        this._toOrientationQuatToRef(forward, this._tmpQuaternion);
        this._tmpQuaternion.toRotationMatrix(this._tmpMatrix);
        // Since we already extracted position from the invert view matrix, we can
        // disregard the position part of the matrix in the copy
        invertView.copyFrom(this._tmpMatrix);
    }
    _angularClamp(invertView, currentToTarget) {
        const forward = this._tmpVectors[5];
        forward.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1);
        const right = this._tmpVectors[6];
        right.copyFromFloats(1, 0, 0);
        // forward and right are related to camera frame of reference
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalToRef(forward, invertView, forward);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalToRef(right, invertView, right);
        // Up is global Z
        const up = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.UpReadOnly;
        const dist = currentToTarget.length();
        if (dist < _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .bH) {
            return false;
        }
        let angularClamped = false;
        const rotationQuat = this._tmpQuaternion;
        // X-axis leashing
        if (this.ignoreCameraPitchAndRoll) {
            const angle = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.GetAngleBetweenVectorsOnPlane(currentToTarget, forward, right);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationAxisToRef(right, angle, rotationQuat);
            currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget);
        }
        else {
            const angle = -_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.GetAngleBetweenVectorsOnPlane(currentToTarget, forward, right);
            const minMaxAngle = ((this.maxViewVerticalDegrees * Math.PI) / 180) * 0.5;
            if (angle < -minMaxAngle) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationAxisToRef(right, -angle - minMaxAngle, rotationQuat);
                currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget);
                angularClamped = true;
            }
            else if (angle > minMaxAngle) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationAxisToRef(right, -angle + minMaxAngle, rotationQuat);
                currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget);
                angularClamped = true;
            }
        }
        // Y-axis leashing
        const angle = this._angleBetweenVectorAndPlane(currentToTarget, right) * (this._scene.useRightHandedSystem ? -1 : 1);
        const minMaxAngle = ((this.maxViewHorizontalDegrees * Math.PI) / 180) * 0.5;
        if (angle < -minMaxAngle) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationAxisToRef(up, -angle - minMaxAngle, rotationQuat);
            currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget);
            angularClamped = true;
        }
        else if (angle > minMaxAngle) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationAxisToRef(up, -angle + minMaxAngle, rotationQuat);
            currentToTarget.rotateByQuaternionToRef(rotationQuat, currentToTarget);
            angularClamped = true;
        }
        return angularClamped;
    }
    _orientationClamp(currentToTarget, rotationQuaternion) {
        // Construct a rotation quat from up vector and target vector
        const toFollowed = this._tmpVectors[0];
        toFollowed.copyFrom(currentToTarget).scaleInPlace(-1).normalize();
        const up = this._tmpVectors[1];
        const right = this._tmpVectors[2];
        // We use global up vector to orient the following node (global +Y)
        up.copyFromFloats(0, 1, 0);
        // Gram-Schmidt to create an orthonormal frame
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.CrossToRef(toFollowed, up, right);
        const length = right.length();
        if (length < _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .bH) {
            return;
        }
        right.normalizeFromLength(length);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.CrossToRef(right, toFollowed, up);
        if (this.attachedNode?.getScene().useRightHandedSystem) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.FromLookDirectionRHToRef(toFollowed, up, rotationQuaternion);
        }
        else {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.FromLookDirectionLHToRef(toFollowed, up, rotationQuaternion);
        }
    }
    _passedOrientationDeadzone(currentToTarget, forward) {
        const leashToFollow = this._tmpVectors[5];
        leashToFollow.copyFrom(currentToTarget);
        leashToFollow.normalize();
        const angle = Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.GetAngleBetweenVectorsOnPlane(forward, leashToFollow, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.UpReadOnly));
        return (angle * 180) / Math.PI > this.orientToCameraDeadzoneDegrees;
    }
    _updateLeashing(camera) {
        if (this.attachedNode && this._enabled) {
            const oldParent = this.attachedNode.parent;
            this.attachedNode.setParent(null);
            const worldMatrix = this.attachedNode.getWorldMatrix();
            const currentToTarget = this._workingPosition;
            const rotationQuaternion = this._workingQuaternion;
            const pivot = this.attachedNode.getPivotPoint();
            const invertView = this._tmpInvertView;
            invertView.copyFrom(camera.getViewMatrix());
            invertView.invert();
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformCoordinatesToRef(pivot, worldMatrix, currentToTarget);
            const position = this._tmpPosition;
            position.copyFromFloats(0, 0, 0);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformCoordinatesToRef(position, worldMatrix, position);
            position.scaleInPlace(-1).subtractInPlace(pivot);
            currentToTarget.subtractInPlace(camera.globalPosition);
            if (this.ignoreCameraPitchAndRoll) {
                this._applyPitchOffset(invertView);
            }
            let angularClamped = false;
            const forward = this._tmpForward;
            forward.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalToRef(forward, invertView, forward);
            const nodeForward = this._tmpNodeForward;
            nodeForward.copyFromFloats(0, 0, this._scene.useRightHandedSystem ? -1 : 1);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalToRef(nodeForward, worldMatrix, nodeForward);
            if (this._recenterNextUpdate) {
                currentToTarget.copyFrom(forward).scaleInPlace(this.defaultDistance);
            }
            else {
                if (this.ignoreAngleClamp) {
                    const currentDistance = currentToTarget.length();
                    currentToTarget.copyFrom(forward).scaleInPlace(currentDistance);
                }
                else {
                    angularClamped = this._angularClamp(invertView, currentToTarget);
                }
            }
            let distanceClamped = false;
            if (!this.ignoreDistanceClamp) {
                distanceClamped = this._distanceClamp(currentToTarget, angularClamped);
                this._applyVerticalClamp(currentToTarget);
            }
            if (this.useFixedVerticalOffset) {
                currentToTarget.y = position.y - camera.globalPosition.y + this.fixedVerticalOffset;
            }
            if (angularClamped || distanceClamped || this._passedOrientationDeadzone(currentToTarget, nodeForward) || this._recenterNextUpdate) {
                this._orientationClamp(currentToTarget, rotationQuaternion);
            }
            this._workingPosition.subtractInPlace(pivot);
            this._recenterNextUpdate = false;
            this.attachedNode.setParent(oldParent);
        }
    }
    _updateTransformToGoal(elapsed) {
        if (!this.attachedNode || !this.followedCamera || !this._enabled) {
            return;
        }
        if (!this.attachedNode.rotationQuaternion) {
            this.attachedNode.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Identity();
        }
        const oldParent = this.attachedNode.parent;
        this.attachedNode.setParent(null);
        if (!this.interpolatePose) {
            this.attachedNode.position.copyFrom(this.followedCamera.globalPosition).addInPlace(this._workingPosition);
            this.attachedNode.rotationQuaternion.copyFrom(this._workingQuaternion);
            return;
        }
        // position
        const currentDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq();
        currentDirection.copyFrom(this.attachedNode.position).subtractInPlace(this.followedCamera.globalPosition);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.SmoothToRef(currentDirection, this._workingPosition, elapsed, this.lerpTime, currentDirection);
        currentDirection.addInPlace(this.followedCamera.globalPosition);
        this.attachedNode.position.copyFrom(currentDirection);
        // rotation
        const currentRotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT();
        currentRotation.copyFrom(this.attachedNode.rotationQuaternion);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.SmoothToRef(currentRotation, this._workingQuaternion, elapsed, this.lerpTime, this.attachedNode.rotationQuaternion);
        this.attachedNode.setParent(oldParent);
    }
    _addObservables() {
        this._lastTick = Date.now();
        this._onBeforeRender = this._scene.onBeforeRenderObservable.add(() => {
            if (!this.followedCamera) {
                return;
            }
            const tick = Date.now();
            this._updateLeashing(this.followedCamera);
            this._updateTransformToGoal(tick - this._lastTick);
            this._lastTick = tick;
        });
    }
    _removeObservables() {
        if (this._onBeforeRender) {
            this._scene.onBeforeRenderObservable.remove(this._onBeforeRender);
        }
    }
}
//# sourceMappingURL=followBehavior.js.map

/***/ }),

/***/ 85054:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Re: () => (/* binding */ HandConstraintBehavior),
/* harmony export */   VF: () => (/* binding */ HandConstraintVisibility),
/* harmony export */   d9: () => (/* binding */ HandConstraintOrientation),
/* harmony export */   rf: () => (/* binding */ HandConstraintZone)
/* harmony export */ });
/* harmony import */ var _XR_webXRFeaturesManager_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75441);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(998);



/**
 * Zones around the hand
 */
var HandConstraintZone;
(function (HandConstraintZone) {
    /**
     * Above finger tips
     */
    HandConstraintZone[HandConstraintZone["ABOVE_FINGER_TIPS"] = 0] = "ABOVE_FINGER_TIPS";
    /**
     * Next to the thumb
     */
    HandConstraintZone[HandConstraintZone["RADIAL_SIDE"] = 1] = "RADIAL_SIDE";
    /**
     * Next to the pinky finger
     */
    HandConstraintZone[HandConstraintZone["ULNAR_SIDE"] = 2] = "ULNAR_SIDE";
    /**
     * Below the wrist
     */
    HandConstraintZone[HandConstraintZone["BELOW_WRIST"] = 3] = "BELOW_WRIST";
})(HandConstraintZone || (HandConstraintZone = {}));
/**
 * Orientations for the hand zones and for the attached node
 */
var HandConstraintOrientation;
(function (HandConstraintOrientation) {
    /**
     * Orientation is towards the camera
     */
    HandConstraintOrientation[HandConstraintOrientation["LOOK_AT_CAMERA"] = 0] = "LOOK_AT_CAMERA";
    /**
     * Orientation is determined by the rotation of the palm
     */
    HandConstraintOrientation[HandConstraintOrientation["HAND_ROTATION"] = 1] = "HAND_ROTATION";
})(HandConstraintOrientation || (HandConstraintOrientation = {}));
/**
 * Orientations for the hand zones and for the attached node
 */
var HandConstraintVisibility;
(function (HandConstraintVisibility) {
    /**
     * Constraint is always visible
     */
    HandConstraintVisibility[HandConstraintVisibility["ALWAYS_VISIBLE"] = 0] = "ALWAYS_VISIBLE";
    /**
     * Constraint is only visible when the palm is up
     */
    HandConstraintVisibility[HandConstraintVisibility["PALM_UP"] = 1] = "PALM_UP";
    /**
     * Constraint is only visible when the user is looking at the constraint.
     * Uses XR Eye Tracking if enabled/available, otherwise uses camera direction
     */
    HandConstraintVisibility[HandConstraintVisibility["GAZE_FOCUS"] = 2] = "GAZE_FOCUS";
    /**
     * Constraint is only visible when the palm is up and the user is looking at it
     */
    HandConstraintVisibility[HandConstraintVisibility["PALM_AND_GAZE"] = 3] = "PALM_AND_GAZE";
})(HandConstraintVisibility || (HandConstraintVisibility = {}));
/**
 * Hand constraint behavior that makes the attached `TransformNode` follow hands in XR experiences.
 * @since 5.0.0
 */
class HandConstraintBehavior {
    /**
     * Builds a hand constraint behavior
     */
    constructor() {
        this._sceneRenderObserver = null;
        this._zoneAxis = {};
        /**
         * Sets the HandConstraintVisibility level for the hand constraint
         */
        this.handConstraintVisibility = 3 /* HandConstraintVisibility.PALM_AND_GAZE */;
        /**
         * A number from 0.0 to 1.0, marking how restricted the direction the palm faces is for the attached node to be enabled.
         * A 1 means the palm must be directly facing the user before the node is enabled, a 0 means it is always enabled.
         * Used with HandConstraintVisibility.PALM_UP
         */
        this.palmUpStrictness = 0.95;
        /**
         * The radius in meters around the center of the hand that the user must gaze inside for the attached node to be enabled and appear.
         * Used with HandConstraintVisibility.GAZE_FOCUS
         */
        this.gazeProximityRadius = 0.15;
        /**
         * Offset distance from the hand in meters
         */
        this.targetOffset = 0.1;
        /**
         * Where to place the node regarding the center of the hand.
         */
        this.targetZone = 2 /* HandConstraintZone.ULNAR_SIDE */;
        /**
         * Orientation mode of the 4 zones around the hand
         */
        this.zoneOrientationMode = 1 /* HandConstraintOrientation.HAND_ROTATION */;
        /**
         * Orientation mode of the node attached to this behavior
         */
        this.nodeOrientationMode = 1 /* HandConstraintOrientation.HAND_ROTATION */;
        /**
         * Set the hand this behavior should follow. If set to "none", it will follow any visible hand (prioritising the left one).
         */
        this.handedness = "none";
        /**
         * Rate of interpolation of position and rotation of the attached node.
         * Higher values will give a slower interpolation.
         */
        this.lerpTime = 100;
        // For a right hand
        this._zoneAxis[0 /* HandConstraintZone.ABOVE_FINGER_TIPS */] = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(0, 1, 0);
        this._zoneAxis[1 /* HandConstraintZone.RADIAL_SIDE */] = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(-1, 0, 0);
        this._zoneAxis[2 /* HandConstraintZone.ULNAR_SIDE */] = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(1, 0, 0);
        this._zoneAxis[3 /* HandConstraintZone.BELOW_WRIST */] = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(0, -1, 0);
    }
    /** gets or sets behavior's name */
    get name() {
        return "HandConstraint";
    }
    /** Enable the behavior */
    enable() {
        this._node.setEnabled(true);
    }
    /** Disable the behavior */
    disable() {
        this._node.setEnabled(false);
    }
    _getHandPose() {
        if (!this._handTracking) {
            return null;
        }
        // Retrieve any available hand, starting by the left
        let hand;
        if (this.handedness === "none") {
            hand = this._handTracking.getHandByHandedness("left") || this._handTracking.getHandByHandedness("right");
        }
        else {
            hand = this._handTracking.getHandByHandedness(this.handedness);
        }
        if (hand) {
            const pinkyMetacarpal = hand.getJointMesh("pinky-finger-metacarpal" /* WebXRHandJoint.PINKY_FINGER_METACARPAL */);
            const middleMetacarpal = hand.getJointMesh("middle-finger-metacarpal" /* WebXRHandJoint.MIDDLE_FINGER_METACARPAL */);
            const wrist = hand.getJointMesh("wrist" /* WebXRHandJoint.WRIST */);
            if (wrist && middleMetacarpal && pinkyMetacarpal) {
                const handPose = { position: middleMetacarpal.absolutePosition, quaternion: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT(), id: hand.xrController.uniqueId };
                // palm forward
                const up = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
                const forward = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1];
                const left = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2];
                up.copyFrom(middleMetacarpal.absolutePosition).subtractInPlace(wrist.absolutePosition).normalize();
                forward.copyFrom(pinkyMetacarpal.absolutePosition).subtractInPlace(middleMetacarpal.absolutePosition).normalize();
                // Create vectors for a rotation quaternion, where forward points out from the palm
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CrossToRef(up, forward, forward);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CrossToRef(forward, up, left);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.FromLookDirectionLHToRef(forward, up, handPose.quaternion);
                return handPose;
            }
        }
        return null;
    }
    /**
     * Initializes the hand constraint behavior
     */
    init() { }
    /**
     * Attaches the hand constraint to a `TransformNode`
     * @param node defines the node to attach the behavior to
     */
    attach(node) {
        this._node = node;
        this._scene = node.getScene();
        if (!this._node.rotationQuaternion) {
            this._node.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.RotationYawPitchRoll(this._node.rotation.y, this._node.rotation.x, this._node.rotation.z);
        }
        let lastTick = Date.now();
        this._sceneRenderObserver = this._scene.onBeforeRenderObservable.add(() => {
            const pose = this._getHandPose();
            this._node.reservedDataStore = this._node.reservedDataStore || {};
            this._node.reservedDataStore.nearInteraction = this._node.reservedDataStore.nearInteraction || {};
            this._node.reservedDataStore.nearInteraction.excludedControllerId = null;
            if (pose) {
                const zoneOffset = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
                const camera = this._scene.activeCamera;
                zoneOffset.copyFrom(this._zoneAxis[this.targetZone]);
                const cameraLookAtQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Quaternion[0];
                if (camera && (this.zoneOrientationMode === 0 /* HandConstraintOrientation.LOOK_AT_CAMERA */ || this.nodeOrientationMode === 0 /* HandConstraintOrientation.LOOK_AT_CAMERA */)) {
                    const toCamera = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1];
                    toCamera.copyFrom(camera.position).subtractInPlace(pose.position).normalize();
                    if (this._scene.useRightHandedSystem) {
                        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.FromLookDirectionRHToRef(toCamera, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.UpReadOnly, cameraLookAtQuaternion);
                    }
                    else {
                        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.FromLookDirectionLHToRef(toCamera, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.UpReadOnly, cameraLookAtQuaternion);
                    }
                }
                if (this.zoneOrientationMode === 1 /* HandConstraintOrientation.HAND_ROTATION */) {
                    pose.quaternion.toRotationMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0]);
                }
                else {
                    cameraLookAtQuaternion.toRotationMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0]);
                }
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformNormalToRef(zoneOffset, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0], zoneOffset);
                zoneOffset.scaleInPlace(this.targetOffset);
                const targetPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2];
                const targetRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Quaternion[1];
                targetPosition.copyFrom(pose.position).addInPlace(zoneOffset);
                if (this.nodeOrientationMode === 1 /* HandConstraintOrientation.HAND_ROTATION */) {
                    targetRotation.copyFrom(pose.quaternion);
                }
                else {
                    targetRotation.copyFrom(cameraLookAtQuaternion);
                }
                const elapsed = Date.now() - lastTick;
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.SmoothToRef(this._node.position, targetPosition, elapsed, this.lerpTime, this._node.position);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.SmoothToRef(this._node.rotationQuaternion, targetRotation, elapsed, this.lerpTime, this._node.rotationQuaternion);
                this._node.reservedDataStore.nearInteraction.excludedControllerId = pose.id;
            }
            this._setVisibility(pose);
            lastTick = Date.now();
        });
    }
    _setVisibility(pose) {
        let palmVisible = true;
        let gazeVisible = true;
        const camera = this._scene.activeCamera;
        if (camera) {
            const cameraForward = camera.getForwardRay();
            if (this.handConstraintVisibility === 2 /* HandConstraintVisibility.GAZE_FOCUS */ || this.handConstraintVisibility === 3 /* HandConstraintVisibility.PALM_AND_GAZE */) {
                gazeVisible = false;
                let gaze;
                if (this._eyeTracking) {
                    gaze = this._eyeTracking.getEyeGaze();
                }
                gaze = gaze || cameraForward;
                const gazeToBehavior = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
                if (pose) {
                    pose.position.subtractToRef(gaze.origin, gazeToBehavior);
                }
                else {
                    this._node.getAbsolutePosition().subtractToRef(gaze.origin, gazeToBehavior);
                }
                const projectedDistance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(gazeToBehavior, gaze.direction);
                const projectedSquared = projectedDistance * projectedDistance;
                if (projectedDistance > 0) {
                    const radiusSquared = gazeToBehavior.lengthSquared() - projectedSquared;
                    if (radiusSquared < this.gazeProximityRadius * this.gazeProximityRadius) {
                        gazeVisible = true;
                    }
                }
            }
            if (this.handConstraintVisibility === 1 /* HandConstraintVisibility.PALM_UP */ || this.handConstraintVisibility === 3 /* HandConstraintVisibility.PALM_AND_GAZE */) {
                palmVisible = false;
                if (pose) {
                    const palmDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.LeftHandedForwardReadOnly.rotateByQuaternionToRef(pose.quaternion, palmDirection);
                    if (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(palmDirection, cameraForward.direction) > this.palmUpStrictness * 2 - 1) {
                        palmVisible = true;
                    }
                }
            }
        }
        this._node.setEnabled(palmVisible && gazeVisible);
    }
    /**
     * Detaches the behavior from the `TransformNode`
     */
    detach() {
        this._scene.onBeforeRenderObservable.remove(this._sceneRenderObserver);
    }
    /**
     * Links the behavior to the XR experience in which to retrieve hand transform information.
     * @param xr xr experience
     */
    linkToXRExperience(xr) {
        const featuresManager = xr.featuresManager ? xr.featuresManager : xr;
        if (!featuresManager) {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools */ .S0.Error("XR features manager must be available or provided directly for the Hand Menu to work");
        }
        else {
            try {
                this._eyeTracking = featuresManager.getEnabledFeature(_XR_webXRFeaturesManager_js__WEBPACK_IMPORTED_MODULE_0__/* .WebXRFeatureName */ ._.EYE_TRACKING);
            }
            catch { }
            try {
                this._handTracking = featuresManager.getEnabledFeature(_XR_webXRFeaturesManager_js__WEBPACK_IMPORTED_MODULE_0__/* .WebXRFeatureName */ ._.HAND_TRACKING);
            }
            catch {
                _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools */ .S0.Error("Hand tracking must be enabled for the Hand Menu to work");
            }
        }
    }
}
//# sourceMappingURL=handConstraintBehavior.js.map

/***/ }),

/***/ 21877:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   C: () => (/* binding */ PointerDragBehavior)
/* harmony export */ });
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76595);
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87491);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66240);
/* harmony import */ var _Culling_ray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(86919);
/* harmony import */ var _Misc_pivotTools_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(23822);
/* harmony import */ var _Meshes_Builders_planeBuilder_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(58144);
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(65559);









/**
 * A behavior that when attached to a mesh will allow the mesh to be dragged around the screen based on pointer events
 */
class PointerDragBehavior {
    /**
     * Get or set the currentDraggingPointerId
     * @deprecated Please use currentDraggingPointerId instead
     */
    get currentDraggingPointerID() {
        return this.currentDraggingPointerId;
    }
    set currentDraggingPointerID(currentDraggingPointerID) {
        this.currentDraggingPointerId = currentDraggingPointerID;
    }
    /**
     *  If the drag behavior will react to drag events (Default: true)
     */
    set enabled(value) {
        if (value != this._enabled) {
            this.onEnabledObservable.notifyObservers(value);
        }
        this._enabled = value;
    }
    get enabled() {
        return this._enabled;
    }
    /**
     * Gets the options used by the behavior
     */
    get options() {
        return this._options;
    }
    /**
     * Sets the options used by the behavior
     */
    set options(options) {
        this._options = options;
    }
    /**
     * Creates a pointer drag behavior that can be attached to a mesh
     * @param options The drag axis or normal of the plane that will be dragged across. If no options are specified the drag plane will always face the ray's origin (eg. camera)
     * @param options.dragAxis
     * @param options.dragPlaneNormal
     */
    constructor(options) {
        this._useAlternatePickedPointAboveMaxDragAngleDragSpeed = -1.1;
        this._activeDragButton = -1;
        /**
         * The maximum tolerated angle between the drag plane and dragging pointer rays to trigger pointer events. Set to 0 to allow any angle (default: 0)
         */
        this.maxDragAngle = 0;
        /**
         * Butttons that can be used to initiate a drag
         */
        this.dragButtons = [0, 1, 2];
        /**
         * @internal
         */
        this._useAlternatePickedPointAboveMaxDragAngle = false;
        /**
         * The id of the pointer that is currently interacting with the behavior (-1 when no pointer is active)
         */
        this.currentDraggingPointerId = -1;
        /**
         * If the behavior is currently in a dragging state
         */
        this.dragging = false;
        /**
         * The distance towards the target drag position to move each frame. This can be useful to avoid jitter. Set this to 1 for no delay. (Default: 0.2)
         */
        this.dragDeltaRatio = 0.2;
        /**
         * If the drag plane orientation should be updated during the dragging (Default: true)
         */
        this.updateDragPlane = true;
        // Debug mode will display drag planes to help visualize behavior
        this._debugMode = false;
        this._moving = false;
        /**
         *  Fires each time the attached mesh is dragged with the pointer
         *  * delta between last drag position and current drag position in world space
         *  * dragDistance along the drag axis
         *  * dragPlaneNormal normal of the current drag plane used during the drag
         *  * dragPlanePoint in world space where the drag intersects the drag plane
         *
         *  (if validatedDrag is used, the position of the attached mesh might not equal dragPlanePoint)
         */
        this.onDragObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        /**
         *  Fires each time a drag begins (eg. mouse down on mesh)
         *  * dragPlanePoint in world space where the drag intersects the drag plane
         *
         *  (if validatedDrag is used, the position of the attached mesh might not equal dragPlanePoint)
         */
        this.onDragStartObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        /**
         *  Fires each time a drag ends (eg. mouse release after drag)
         *  * dragPlanePoint in world space where the drag intersects the drag plane
         *
         *  (if validatedDrag is used, the position of the attached mesh might not equal dragPlanePoint)
         */
        this.onDragEndObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        /**
         *  Fires each time behavior enabled state changes
         */
        this.onEnabledObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        /**
         *  If the attached mesh should be moved when dragged
         */
        this.moveAttached = true;
        this._enabled = true;
        /**
         * If pointer events should start and release the drag (Default: true)
         */
        this.startAndReleaseDragOnPointerEvents = true;
        /**
         * If camera controls should be detached during the drag
         */
        this.detachCameraControls = true;
        /**
         * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)
         */
        this.useObjectOrientationForDragging = true;
        /**
         * Predicate to determine if it is valid to move the object to a new position when it is moved.
         * In the case of rotation gizmo, target contains the angle.
         * @param target destination position or desired angle delta
         * @returns boolean for whether or not it is valid to move
         */
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this.validateDrag = (target) => {
            return true;
        };
        this._tmpVector = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        this._alternatePickedPoint = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        this._worldDragAxis = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        this._targetPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        this._attachedToElement = false;
        this._startDragRay = new _Culling_ray_js__WEBPACK_IMPORTED_MODULE_5__/* .Ray */ .Rl(new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq());
        this._lastPointerRay = {};
        this._dragDelta = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq();
        // Variables to avoid instantiation in the below method
        this._pointA = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        this._pointC = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        this._localAxis = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        this._lookAt = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        this._options = options ? options : {};
        let optionCount = 0;
        if (this._options.dragAxis) {
            optionCount++;
        }
        if (this._options.dragPlaneNormal) {
            optionCount++;
        }
        if (optionCount > 1) {
            // eslint-disable-next-line no-throw-literal
            throw "Multiple drag modes specified in dragBehavior options. Only one expected";
        }
    }
    /**
     *  The name of the behavior
     */
    get name() {
        return "PointerDrag";
    }
    /**
     *  Initializes the behavior
     */
    init() { }
    /**
     * Attaches the drag behavior the passed in mesh
     * @param ownerNode The mesh that will be dragged around once attached
     * @param predicate Predicate to use for pick filtering
     */
    attach(ownerNode, predicate) {
        this._scene = ownerNode.getScene();
        ownerNode.isNearGrabbable = true;
        this.attachedNode = ownerNode;
        // Initialize drag plane to not interfere with existing scene
        if (!PointerDragBehavior._PlaneScene) {
            if (this._debugMode) {
                PointerDragBehavior._PlaneScene = this._scene;
            }
            else {
                PointerDragBehavior._PlaneScene = new _scene_js__WEBPACK_IMPORTED_MODULE_1__/* .Scene */ .Z(this._scene.getEngine(), { virtual: true });
                PointerDragBehavior._PlaneScene.detachControl();
                this._scene.onDisposeObservable.addOnce(() => {
                    PointerDragBehavior._PlaneScene.dispose();
                    PointerDragBehavior._PlaneScene = null;
                });
            }
        }
        this._dragPlane = (0,_Meshes_Builders_planeBuilder_js__WEBPACK_IMPORTED_MODULE_7__/* .CreatePlane */ .x)("pointerDragPlane", { size: this._debugMode ? 1 : 10000, updatable: false, sideOrientation: _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.DOUBLESIDE }, PointerDragBehavior._PlaneScene);
        // State of the drag
        this.lastDragPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        const pickPredicate = predicate
            ? predicate
            : (m) => {
                return this.attachedNode == m || m.isDescendantOf(this.attachedNode);
            };
        this._pointerObserver = this._scene.onPointerObservable.add((pointerInfo) => {
            if (!this.enabled) {
                // If behavior is disabled before releaseDrag is ever called, call it now.
                if (this._attachedToElement) {
                    this.releaseDrag();
                }
                return;
            }
            if (pointerInfo.type == _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERDOWN) {
                if (this.startAndReleaseDragOnPointerEvents &&
                    !this.dragging &&
                    pointerInfo.pickInfo &&
                    pointerInfo.pickInfo.hit &&
                    pointerInfo.pickInfo.pickedMesh &&
                    pointerInfo.pickInfo.pickedPoint &&
                    pointerInfo.pickInfo.ray &&
                    pickPredicate(pointerInfo.pickInfo.pickedMesh)) {
                    if (this._activeDragButton === -1 && this.dragButtons.indexOf(pointerInfo.event.button) !== -1) {
                        this._activeDragButton = pointerInfo.event.button;
                        this._activePointerInfo = pointerInfo;
                        this._startDrag(pointerInfo.event.pointerId, pointerInfo.pickInfo.ray, pointerInfo.pickInfo.pickedPoint);
                    }
                }
            }
            else if (pointerInfo.type == _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERUP) {
                if (this.startAndReleaseDragOnPointerEvents &&
                    this.currentDraggingPointerId == pointerInfo.event.pointerId &&
                    (this._activeDragButton === pointerInfo.event.button || this._activeDragButton === -1)) {
                    this.releaseDrag();
                }
            }
            else if (pointerInfo.type == _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERMOVE) {
                const pointerId = pointerInfo.event.pointerId;
                // If drag was started with anyMouseID specified, set pointerID to the next mouse that moved
                if (this.currentDraggingPointerId === PointerDragBehavior._AnyMouseId && pointerId !== PointerDragBehavior._AnyMouseId) {
                    const evt = pointerInfo.event;
                    const isMouseEvent = evt.pointerType === "mouse" || (!this._scene.getEngine().hostInformation.isMobile && evt instanceof MouseEvent);
                    if (isMouseEvent) {
                        if (this._lastPointerRay[this.currentDraggingPointerId]) {
                            this._lastPointerRay[pointerId] = this._lastPointerRay[this.currentDraggingPointerId];
                            delete this._lastPointerRay[this.currentDraggingPointerId];
                        }
                        this.currentDraggingPointerId = pointerId;
                    }
                }
                // Keep track of last pointer ray, this is used simulating the start of a drag in startDrag()
                if (!this._lastPointerRay[pointerId]) {
                    this._lastPointerRay[pointerId] = new _Culling_ray_js__WEBPACK_IMPORTED_MODULE_5__/* .Ray */ .Rl(new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq());
                }
                if (pointerInfo.pickInfo && pointerInfo.pickInfo.ray) {
                    this._lastPointerRay[pointerId].origin.copyFrom(pointerInfo.pickInfo.ray.origin);
                    this._lastPointerRay[pointerId].direction.copyFrom(pointerInfo.pickInfo.ray.direction);
                    if (this.currentDraggingPointerId == pointerId && this.dragging) {
                        this._moveDrag(pointerInfo.pickInfo.ray);
                    }
                }
            }
        });
        this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(() => {
            if (this._moving && this.moveAttached) {
                let needMatrixUpdate = false;
                _Misc_pivotTools_js__WEBPACK_IMPORTED_MODULE_6__/* .PivotTools */ .G._RemoveAndStorePivotPoint(this.attachedNode);
                // Slowly move mesh to avoid jitter
                this._targetPosition.subtractToRef(this.attachedNode.absolutePosition, this._tmpVector);
                this._tmpVector.scaleInPlace(this.dragDeltaRatio);
                this.attachedNode.getAbsolutePosition().addToRef(this._tmpVector, this._tmpVector);
                if (this.validateDrag(this._tmpVector)) {
                    this.attachedNode.setAbsolutePosition(this._tmpVector);
                    needMatrixUpdate = true;
                }
                _Misc_pivotTools_js__WEBPACK_IMPORTED_MODULE_6__/* .PivotTools */ .G._RestorePivotPoint(this.attachedNode);
                if (needMatrixUpdate) {
                    this.attachedNode.computeWorldMatrix();
                }
            }
        });
    }
    /**
     * Force release the drag action by code.
     */
    releaseDrag() {
        if (this.dragging) {
            this.dragging = false;
            this.onDragEndObservable.notifyObservers({ dragPlanePoint: this.lastDragPosition, pointerId: this.currentDraggingPointerId, pointerInfo: this._activePointerInfo });
        }
        this.currentDraggingPointerId = -1;
        this._activeDragButton = -1;
        this._activePointerInfo = null;
        this._moving = false;
        // Reattach camera controls
        if (this.detachCameraControls && this._attachedToElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera) {
            if (this._scene.activeCamera.getClassName() === "ArcRotateCamera") {
                const arcRotateCamera = this._scene.activeCamera;
                arcRotateCamera.attachControl(arcRotateCamera.inputs ? arcRotateCamera.inputs.noPreventDefault : true, arcRotateCamera._useCtrlForPanning, arcRotateCamera._panningMouseButton);
            }
            else {
                this._scene.activeCamera.attachControl(this._scene.activeCamera.inputs ? this._scene.activeCamera.inputs.noPreventDefault : true);
            }
            this._attachedToElement = false;
        }
    }
    /**
     * Simulates the start of a pointer drag event on the behavior
     * @param pointerId pointerID of the pointer that should be simulated (Default: Any mouse pointer ID)
     * @param fromRay initial ray of the pointer to be simulated (Default: Ray from camera to attached mesh)
     * @param startPickedPoint picked point of the pointer to be simulated (Default: attached mesh position)
     */
    startDrag(pointerId = PointerDragBehavior._AnyMouseId, fromRay, startPickedPoint) {
        this._startDrag(pointerId, fromRay, startPickedPoint);
        let lastRay = this._lastPointerRay[pointerId];
        if (pointerId === PointerDragBehavior._AnyMouseId) {
            lastRay = this._lastPointerRay[Object.keys(this._lastPointerRay)[0]];
        }
        if (lastRay) {
            // if there was a last pointer ray drag the object there
            this._moveDrag(lastRay);
        }
    }
    _startDrag(pointerId, fromRay, startPickedPoint) {
        if (!this._scene.activeCamera || this.dragging || !this.attachedNode) {
            return;
        }
        _Misc_pivotTools_js__WEBPACK_IMPORTED_MODULE_6__/* .PivotTools */ .G._RemoveAndStorePivotPoint(this.attachedNode);
        // Create start ray from the camera to the object
        if (fromRay) {
            this._startDragRay.direction.copyFrom(fromRay.direction);
            this._startDragRay.origin.copyFrom(fromRay.origin);
        }
        else {
            this._startDragRay.origin.copyFrom(this._scene.activeCamera.position);
            this.attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector);
            this._tmpVector.subtractToRef(this._scene.activeCamera.position, this._startDragRay.direction);
        }
        this._updateDragPlanePosition(this._startDragRay, startPickedPoint ? startPickedPoint : this._tmpVector);
        const pickedPoint = this._pickWithRayOnDragPlane(this._startDragRay);
        if (pickedPoint) {
            this.dragging = true;
            this.currentDraggingPointerId = pointerId;
            this.lastDragPosition.copyFrom(pickedPoint);
            this.onDragStartObservable.notifyObservers({ dragPlanePoint: pickedPoint, pointerId: this.currentDraggingPointerId, pointerInfo: this._activePointerInfo });
            this._targetPosition.copyFrom(this.attachedNode.getAbsolutePosition());
            // Detatch camera controls
            if (this.detachCameraControls && this._scene.activeCamera && this._scene.activeCamera.inputs && !this._scene.activeCamera.leftCamera) {
                if (this._scene.activeCamera.inputs.attachedToElement) {
                    this._scene.activeCamera.detachControl();
                    this._attachedToElement = true;
                }
                else {
                    this._attachedToElement = false;
                }
            }
        }
        else {
            this.releaseDrag();
        }
        _Misc_pivotTools_js__WEBPACK_IMPORTED_MODULE_6__/* .PivotTools */ .G._RestorePivotPoint(this.attachedNode);
    }
    _moveDrag(ray) {
        this._moving = true;
        const pickedPoint = this._pickWithRayOnDragPlane(ray);
        if (pickedPoint) {
            _Misc_pivotTools_js__WEBPACK_IMPORTED_MODULE_6__/* .PivotTools */ .G._RemoveAndStorePivotPoint(this.attachedNode);
            if (this.updateDragPlane) {
                this._updateDragPlanePosition(ray, pickedPoint);
            }
            let dragLength = 0;
            // depending on the drag mode option drag accordingly
            if (this._options.dragAxis) {
                // Convert local drag axis to world if useObjectOrientationForDragging
                this.useObjectOrientationForDragging
                    ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._worldDragAxis)
                    : this._worldDragAxis.copyFrom(this._options.dragAxis);
                // Project delta drag from the drag plane onto the drag axis
                pickedPoint.subtractToRef(this.lastDragPosition, this._tmpVector);
                this._worldDragAxis.normalize();
                dragLength = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Dot(this._tmpVector, this._worldDragAxis);
                this._worldDragAxis.scaleToRef(dragLength, this._dragDelta);
            }
            else {
                dragLength = this._dragDelta.length();
                pickedPoint.subtractToRef(this.lastDragPosition, this._dragDelta);
            }
            this._targetPosition.addInPlace(this._dragDelta);
            this.onDragObservable.notifyObservers({
                dragDistance: dragLength,
                delta: this._dragDelta,
                dragPlanePoint: pickedPoint,
                dragPlaneNormal: this._dragPlane.forward,
                pointerId: this.currentDraggingPointerId,
                pointerInfo: this._activePointerInfo,
            });
            this.lastDragPosition.copyFrom(pickedPoint);
            _Misc_pivotTools_js__WEBPACK_IMPORTED_MODULE_6__/* .PivotTools */ .G._RestorePivotPoint(this.attachedNode);
        }
    }
    _pickWithRayOnDragPlane(ray) {
        if (!ray) {
            return null;
        }
        // Calculate angle between plane normal and ray
        let angle = Math.acos(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Dot(this._dragPlane.forward, ray.direction));
        // Correct if ray is casted from oposite side
        if (angle > Math.PI / 2) {
            angle = Math.PI - angle;
        }
        // If the angle is too perpendicular to the plane pick another point on the plane where it is looking
        if (this.maxDragAngle > 0 && angle > this.maxDragAngle) {
            if (this._useAlternatePickedPointAboveMaxDragAngle) {
                // Invert ray direction along the towards object axis
                this._tmpVector.copyFrom(ray.direction);
                this.attachedNode.absolutePosition.subtractToRef(ray.origin, this._alternatePickedPoint);
                this._alternatePickedPoint.normalize();
                this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed * _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Dot(this._alternatePickedPoint, this._tmpVector));
                this._tmpVector.addInPlace(this._alternatePickedPoint);
                // Project resulting vector onto the drag plane and add it to the attached nodes absolute position to get a picked point
                const dot = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Dot(this._dragPlane.forward, this._tmpVector);
                this._dragPlane.forward.scaleToRef(-dot, this._alternatePickedPoint);
                this._alternatePickedPoint.addInPlace(this._tmpVector);
                this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition);
                return this._alternatePickedPoint;
            }
            else {
                return null;
            }
        }
        // use an infinite plane instead of ray picking a mesh that must be updated every frame
        const planeNormal = this._dragPlane.forward;
        const planePosition = this._dragPlane.position;
        const dotProduct = ray.direction.dot(planeNormal);
        if (Math.abs(dotProduct) < _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_8__/* .Epsilon */ .bH) {
            // Ray and plane are parallel, no intersection
            return null;
        }
        planePosition.subtractToRef(ray.origin, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[0]);
        const t = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[0].dot(planeNormal) / dotProduct;
        // Ensure the intersection point is in front of the ray (t must be positive)
        if (t < 0) {
            // Intersection point is behind the ray
            return null;
        }
        // Calculate the intersection point using the parameter t
        ray.direction.scaleToRef(t, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[0]);
        const intersectionPoint = ray.origin.add(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[0]);
        return intersectionPoint;
    }
    // Position the drag plane based on the attached mesh position, for single axis rotate the plane along the axis to face the camera
    _updateDragPlanePosition(ray, dragPlanePosition) {
        this._pointA.copyFrom(dragPlanePosition);
        if (this._options.dragAxis) {
            this.useObjectOrientationForDragging
                ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis)
                : this._localAxis.copyFrom(this._options.dragAxis);
            // Calculate plane normal that is the cross product of local axis and (eye-dragPlanePosition)
            ray.origin.subtractToRef(this._pointA, this._pointC);
            this._pointC.normalize();
            if (Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Dot(this._localAxis, this._pointC)) > 0.999) {
                // the drag axis is colinear with the (eye to position) ray. The cross product will give jittered values.
                // A new axis vector need to be computed
                if (Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Dot(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.UpReadOnly, this._pointC)) > 0.999) {
                    this._lookAt.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Right());
                }
                else {
                    this._lookAt.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.UpReadOnly);
                }
            }
            else {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.CrossToRef(this._localAxis, this._pointC, this._lookAt);
                // Get perpendicular line from previous result and drag axis to adjust lineB to be perpendicular to camera
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.CrossToRef(this._localAxis, this._lookAt, this._lookAt);
                this._lookAt.normalize();
            }
            this._dragPlane.position.copyFrom(this._pointA);
            this._pointA.addToRef(this._lookAt, this._lookAt);
            this._dragPlane.lookAt(this._lookAt);
        }
        else if (this._options.dragPlaneNormal) {
            this.useObjectOrientationForDragging
                ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformCoordinatesToRef(this._options.dragPlaneNormal, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis)
                : this._localAxis.copyFrom(this._options.dragPlaneNormal);
            this._dragPlane.position.copyFrom(this._pointA);
            this._pointA.addToRef(this._localAxis, this._lookAt);
            this._dragPlane.lookAt(this._lookAt);
        }
        else {
            this._dragPlane.position.copyFrom(this._pointA);
            this._dragPlane.lookAt(ray.origin);
        }
        // Update the position of the drag plane so it doesn't get out of sync with the node (eg. when moving back and forth quickly)
        this._dragPlane.position.copyFrom(this.attachedNode.getAbsolutePosition());
        this._dragPlane.computeWorldMatrix(true);
    }
    /**
     *  Detaches the behavior from the mesh
     */
    detach() {
        this._lastPointerRay = {};
        if (this.attachedNode) {
            this.attachedNode.isNearGrabbable = false;
        }
        if (this._pointerObserver) {
            this._scene.onPointerObservable.remove(this._pointerObserver);
        }
        if (this._beforeRenderObserver) {
            this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver);
        }
        if (this._dragPlane) {
            this._dragPlane.dispose();
        }
        this.releaseDrag();
    }
}
PointerDragBehavior._AnyMouseId = -2;
//# sourceMappingURL=pointerDragBehavior.js.map

/***/ }),

/***/ 22575:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Y: () => (/* binding */ SixDofDragBehavior)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);
/* harmony import */ var _baseSixDofDragBehavior_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55234);
/* harmony import */ var _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97328);




/**
 * A behavior that when attached to a mesh will allow the mesh to be dragged around based on directions and origin of the pointer's ray
 */
class SixDofDragBehavior extends _baseSixDofDragBehavior_js__WEBPACK_IMPORTED_MODULE_2__/* .BaseSixDofDragBehavior */ .D {
    constructor() {
        super(...arguments);
        this._sceneRenderObserver = null;
        this._targetPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, 0);
        this._targetOrientation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT();
        this._targetScaling = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1, 1, 1);
        this._startingPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, 0);
        this._startingOrientation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT();
        this._startingScaling = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1, 1, 1);
        /**
         * Fires when position is updated
         */
        this.onPositionChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * The distance towards the target drag position to move each frame. This can be useful to avoid jitter. Set this to 1 for no delay. (Default: 0.2)
         */
        this.dragDeltaRatio = 0.2;
        /**
         * If the object should rotate to face the drag origin
         */
        this.rotateDraggedObject = true;
        /**
         * If `rotateDraggedObject` is set to `true`, this parameter determines if we are only rotating around the y axis (yaw)
         */
        this.rotateAroundYOnly = false;
        /**
         * Should the behavior rotate 1:1 with the motion controller, when one is used.
         */
        this.rotateWithMotionController = true;
        /**
         * Use this flag to update the target but not move the owner node towards the target
         */
        this.disableMovement = false;
        /**
         * Should the object rotate towards the camera when we start dragging it
         */
        this.faceCameraOnDragStart = false;
    }
    /**
     *  The name of the behavior
     */
    get name() {
        return "SixDofDrag";
    }
    /**
     * Attaches the six DoF drag behavior
     * In XR mode the mesh and its children will have their isNearGrabbable property set to true
     * @param ownerNode The mesh that will be dragged around once attached
     */
    attach(ownerNode) {
        super.attach(ownerNode);
        ownerNode.isNearGrabbable = true;
        // if it has children, make sure they are grabbable too
        ownerNode.getChildMeshes().forEach((m) => {
            m.isNearGrabbable = true;
        });
        // Node that will save the owner's transform
        this._virtualTransformNode = new _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_3__/* .TransformNode */ .V("virtual_sixDof", _baseSixDofDragBehavior_js__WEBPACK_IMPORTED_MODULE_2__/* .BaseSixDofDragBehavior */ .D._virtualScene);
        this._virtualTransformNode.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Identity();
        // On every frame move towards target scaling to avoid jitter caused by vr controllers
        this._sceneRenderObserver = ownerNode.getScene().onBeforeRenderObservable.add(() => {
            if (this.currentDraggingPointerIds.length === 1 && this._moving && !this.disableMovement) {
                // 1 pointer only drags mesh
                const deltaToAdd = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0];
                deltaToAdd.copyFrom(this._targetPosition).subtractInPlace(ownerNode.absolutePosition).scaleInPlace(this.dragDeltaRatio);
                const deltaToAddTransformed = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[1];
                deltaToAddTransformed.copyFrom(deltaToAdd);
                // If the node has a parent, transform the delta to local space, so it can be added to the
                // position in local space
                if (ownerNode.parent) {
                    const parentRotationMatrixInverse = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0];
                    ownerNode.parent.absoluteRotationQuaternion.toRotationMatrix(parentRotationMatrixInverse);
                    parentRotationMatrixInverse.invert();
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalToRef(deltaToAdd, parentRotationMatrixInverse, deltaToAddTransformed);
                }
                ownerNode.position.addInPlace(deltaToAddTransformed);
                this.onPositionChangedObservable.notifyObservers({ position: ownerNode.absolutePosition });
                // Only rotate the mesh if it's parent has uniform scaling
                if (!ownerNode.parent || (ownerNode.parent.scaling && !ownerNode.parent.scaling.isNonUniformWithinEpsilon(0.001))) {
                    const rotationToApply = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0];
                    rotationToApply.copyFrom(this._targetOrientation);
                    if (ownerNode.parent) {
                        const parentRotationInverse = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0];
                        parentRotationInverse.copyFrom(ownerNode.parent.absoluteRotationQuaternion);
                        parentRotationInverse.invertInPlace();
                        parentRotationInverse.multiplyToRef(this._targetOrientation, rotationToApply);
                    }
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.SlerpToRef(ownerNode.rotationQuaternion, rotationToApply, this.dragDeltaRatio, ownerNode.rotationQuaternion);
                }
            }
        });
    }
    _getPositionOffsetAround(transformationLocalOrigin, scaling, rotation) {
        const translationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0]; // T
        const translationMatrixInv = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[1]; // T'
        const rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[2]; // R
        const scaleMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[3]; // S
        const finalMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[4]; // T' x R x S x T
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.TranslationToRef(transformationLocalOrigin.x, transformationLocalOrigin.y, transformationLocalOrigin.z, translationMatrix); // T
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.TranslationToRef(-transformationLocalOrigin.x, -transformationLocalOrigin.y, -transformationLocalOrigin.z, translationMatrixInv); // T'
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.FromQuaternionToRef(rotation, rotationMatrix); // R
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.ScalingToRef(scaling, scaling, scaling, scaleMatrix);
        translationMatrixInv.multiplyToRef(rotationMatrix, finalMatrix); // T' x R
        finalMatrix.multiplyToRef(scaleMatrix, finalMatrix); // T' x R x S
        finalMatrix.multiplyToRef(translationMatrix, finalMatrix); // T' x R x S x T
        return finalMatrix.getTranslation();
    }
    _onePointerPositionUpdated(worldDeltaPosition, worldDeltaRotation) {
        const pointerDelta = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0];
        pointerDelta.setAll(0);
        if (this._dragging === this._dragType.DRAG) {
            if (this.rotateDraggedObject) {
                if (this.rotateAroundYOnly) {
                    // Convert change in rotation to only y axis rotation
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationYawPitchRollToRef(worldDeltaRotation.toEulerAngles().y, 0, 0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0]);
                }
                else {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0].copyFrom(worldDeltaRotation);
                }
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0].multiplyToRef(this._startingOrientation, this._targetOrientation);
            }
        }
        else if (this._dragging === this._dragType.NEAR_DRAG || (this._dragging === this._dragType.DRAG_WITH_CONTROLLER && this.rotateWithMotionController)) {
            worldDeltaRotation.multiplyToRef(this._startingOrientation, this._targetOrientation);
        }
        this._targetPosition.copyFrom(this._startingPosition).addInPlace(worldDeltaPosition);
    }
    _twoPointersPositionUpdated() {
        const startingPosition0 = this._virtualMeshesInfo[this.currentDraggingPointerIds[0]].startingPosition;
        const startingPosition1 = this._virtualMeshesInfo[this.currentDraggingPointerIds[1]].startingPosition;
        const startingCenter = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0];
        startingPosition0.addToRef(startingPosition1, startingCenter);
        startingCenter.scaleInPlace(0.5);
        const startingVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[1];
        startingPosition1.subtractToRef(startingPosition0, startingVector);
        const currentPosition0 = this._virtualMeshesInfo[this.currentDraggingPointerIds[0]].dragMesh.absolutePosition;
        const currentPosition1 = this._virtualMeshesInfo[this.currentDraggingPointerIds[1]].dragMesh.absolutePosition;
        const currentCenter = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[2];
        currentPosition0.addToRef(currentPosition1, currentCenter);
        currentCenter.scaleInPlace(0.5);
        const currentVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[3];
        currentPosition1.subtractToRef(currentPosition0, currentVector);
        const scaling = currentVector.length() / startingVector.length();
        const translation = currentCenter.subtract(startingCenter);
        const rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.FromEulerAngles(0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.GetAngleBetweenVectorsOnPlane(startingVector.normalize(), currentVector.normalize(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.UpReadOnly), 0);
        const oldParent = this._ownerNode.parent;
        this._ownerNode.setParent(null);
        const positionOffset = this._getPositionOffsetAround(startingCenter.subtract(this._virtualTransformNode.getAbsolutePivotPoint()), scaling, rotationQuaternion);
        this._virtualTransformNode.rotationQuaternion.multiplyToRef(rotationQuaternion, this._ownerNode.rotationQuaternion);
        this._virtualTransformNode.scaling.scaleToRef(scaling, this._ownerNode.scaling);
        this._virtualTransformNode.position.addToRef(translation.addInPlace(positionOffset), this._ownerNode.position);
        this.onPositionChangedObservable.notifyObservers({ position: this._ownerNode.position });
        this._ownerNode.setParent(oldParent);
    }
    _targetDragStart() {
        const pointerCount = this.currentDraggingPointerIds.length;
        if (!this._ownerNode.rotationQuaternion) {
            this._ownerNode.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationYawPitchRoll(this._ownerNode.rotation.y, this._ownerNode.rotation.x, this._ownerNode.rotation.z);
        }
        const worldPivot = this._ownerNode.getAbsolutePivotPoint();
        if (pointerCount === 1) {
            this._targetPosition.copyFrom(this._ownerNode.absolutePosition);
            this._targetOrientation.copyFrom(this._ownerNode.rotationQuaternion);
            this._targetScaling.copyFrom(this._ownerNode.absoluteScaling);
            if (this.faceCameraOnDragStart && this._scene.activeCamera) {
                const toCamera = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0];
                this._scene.activeCamera.position.subtractToRef(worldPivot, toCamera);
                toCamera.normalize();
                const quat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0];
                if (this._scene.useRightHandedSystem) {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.FromLookDirectionRHToRef(toCamera, new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 1, 0), quat);
                }
                else {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.FromLookDirectionLHToRef(toCamera, new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 1, 0), quat);
                }
                quat.normalize();
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationYawPitchRollToRef(quat.toEulerAngles().y, 0, 0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0]);
                this._targetOrientation.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0]);
            }
            this._startingPosition.copyFrom(this._targetPosition);
            this._startingOrientation.copyFrom(this._targetOrientation);
            this._startingScaling.copyFrom(this._targetScaling);
        }
        else if (pointerCount === 2) {
            this._virtualTransformNode.setPivotPoint(new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, 0), 0 /* Space.LOCAL */);
            this._virtualTransformNode.position.copyFrom(this._ownerNode.absolutePosition);
            this._virtualTransformNode.scaling.copyFrom(this._ownerNode.absoluteScaling);
            this._virtualTransformNode.rotationQuaternion.copyFrom(this._ownerNode.absoluteRotationQuaternion);
            this._virtualTransformNode.setPivotPoint(worldPivot, 1 /* Space.WORLD */);
            this._resetVirtualMeshesPosition();
        }
    }
    _targetDrag(worldDeltaPosition, worldDeltaRotation) {
        if (this.currentDraggingPointerIds.length === 1) {
            this._onePointerPositionUpdated(worldDeltaPosition, worldDeltaRotation);
        }
        else if (this.currentDraggingPointerIds.length === 2) {
            this._twoPointersPositionUpdated();
        }
    }
    _targetDragEnd() {
        if (this.currentDraggingPointerIds.length === 1) {
            // We still have 1 active pointer, we must simulate a dragstart with a reseted position/orientation
            this._resetVirtualMeshesPosition();
            const previousFaceCameraFlag = this.faceCameraOnDragStart;
            this.faceCameraOnDragStart = false;
            this._targetDragStart();
            this.faceCameraOnDragStart = previousFaceCameraFlag;
        }
    }
    /**
     *  Detaches the behavior from the mesh
     */
    detach() {
        super.detach();
        if (this._ownerNode) {
            this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver);
        }
        if (this._virtualTransformNode) {
            this._virtualTransformNode.dispose();
        }
    }
}
//# sourceMappingURL=sixDofDragBehavior.js.map

/***/ }),

/***/ 38968:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ SurfaceMagnetismBehavior)
/* harmony export */ });
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66240);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);


/**
 * A behavior that allows a transform node to stick to a surface position/orientation
 * @since 5.0.0
 */
class SurfaceMagnetismBehavior {
    constructor() {
        this._attachPointLocalOffset = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
        this._workingPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
        this._workingQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT();
        this._lastTick = -1;
        this._hit = false;
        /**
         * Distance offset from the hit point to place the target at, along the hit normal.
         */
        this.hitNormalOffset = 0.05;
        /**
         * Spatial mapping meshes to collide with
         */
        this.meshes = [];
        /**
         * Set to false if the node should strictly follow the camera without any interpolation time
         */
        this.interpolatePose = true;
        /**
         * Rate of interpolation of position and rotation of the attached node.
         * Higher values will give a slower interpolation.
         */
        this.lerpTime = 250;
        /**
         * If true, pitch and roll are omitted.
         */
        this.keepOrientationVertical = true;
        /**
         * Is this behavior reacting to pointer events
         */
        this.enabled = true;
        /**
         * Maximum distance for the node to stick to the surface
         */
        this.maxStickingDistance = 0.8;
    }
    /**
     * Name of the behavior
     */
    get name() {
        return "SurfaceMagnetism";
    }
    /**
     * Function called when the behavior needs to be initialized (after attaching it to a target)
     */
    init() { }
    /**
     * Attaches the behavior to a transform node
     * @param target defines the target where the behavior is attached to
     * @param scene the scene
     */
    attach(target, scene) {
        this._attachedMesh = target;
        this._scene = scene || target.getScene();
        if (!this._attachedMesh.rotationQuaternion) {
            this._attachedMesh.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.RotationYawPitchRoll(this._attachedMesh.rotation.y, this._attachedMesh.rotation.x, this._attachedMesh.rotation.z);
        }
        this.updateAttachPoint();
        this._workingPosition.copyFrom(this._attachedMesh.position);
        this._workingQuaternion.copyFrom(this._attachedMesh.rotationQuaternion);
        this._addObservables();
    }
    /**
     * Detaches the behavior
     */
    detach() {
        this._attachedMesh = null;
        this._removeObservables();
    }
    _getTargetPose(pickingInfo) {
        if (!this._attachedMesh) {
            return null;
        }
        if (pickingInfo && pickingInfo.hit) {
            const pickedNormal = pickingInfo.getNormal(true, true);
            const pickedPoint = pickingInfo.pickedPoint;
            if (!pickedNormal || !pickedPoint) {
                return null;
            }
            pickedNormal.normalize();
            const worldTarget = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
            worldTarget.copyFrom(pickedNormal);
            worldTarget.scaleInPlace(this.hitNormalOffset);
            worldTarget.addInPlace(pickedPoint);
            if (this._attachedMesh.parent) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0].copyFrom(this._attachedMesh.parent.getWorldMatrix()).invert();
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformNormalToRef(worldTarget, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0], worldTarget);
            }
            return {
                position: worldTarget,
                quaternion: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.RotationYawPitchRoll(-Math.atan2(pickedNormal.x, -pickedNormal.z), this.keepOrientationVertical ? 0 : Math.atan2(pickedNormal.y, Math.sqrt(pickedNormal.z * pickedNormal.z + pickedNormal.x * pickedNormal.x)), 0),
            };
        }
        return null;
    }
    /**
     * Updates the attach point with the current geometry extents of the attached mesh
     */
    updateAttachPoint() {
        this._getAttachPointOffsetToRef(this._attachPointLocalOffset);
    }
    /**
     * Finds the intersection point of the given ray onto the meshes and updates the target.
     * Transformation will be interpolated according to `interpolatePose` and `lerpTime` properties.
     * If no mesh of `meshes` are hit, this does nothing.
     * @param pickInfo The input pickingInfo that will be used to intersect the meshes
     * @returns a boolean indicating if we found a hit to stick to
     */
    findAndUpdateTarget(pickInfo) {
        this._hit = false;
        if (!pickInfo.ray) {
            return false;
        }
        const subPicking = pickInfo.ray.intersectsMeshes(this.meshes)[0];
        if (this._attachedMesh && subPicking && subPicking.hit && subPicking.pickedMesh) {
            const pose = this._getTargetPose(subPicking);
            if (pose && _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Distance(this._attachedMesh.position, pose.position) < this.maxStickingDistance) {
                this._workingPosition.copyFrom(pose.position);
                this._workingQuaternion.copyFrom(pose.quaternion);
                this._hit = true;
            }
        }
        return this._hit;
    }
    _getAttachPointOffsetToRef(ref) {
        if (!this._attachedMesh) {
            ref.setAll(0);
            return;
        }
        const storedQuat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Quaternion[0];
        storedQuat.copyFrom(this._attachedMesh.rotationQuaternion);
        this._attachedMesh.rotationQuaternion.copyFromFloats(0, 0, 0, 1);
        this._attachedMesh.computeWorldMatrix();
        const boundingMinMax = this._attachedMesh.getHierarchyBoundingVectors();
        const center = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
        boundingMinMax.max.addToRef(boundingMinMax.min, center);
        center.scaleInPlace(0.5);
        center.z = boundingMinMax.max.z;
        // We max the z coordinate because we want the attach point to be on the back of the mesh
        const invWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0];
        this._attachedMesh.getWorldMatrix().invertToRef(invWorld);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinatesToRef(center, invWorld, ref);
        this._attachedMesh.rotationQuaternion.copyFrom(storedQuat);
    }
    _updateTransformToGoal(elapsed) {
        if (!this._attachedMesh || !this._hit) {
            return;
        }
        const oldParent = this._attachedMesh.parent;
        this._attachedMesh.setParent(null);
        const worldOffset = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformNormalToRef(this._attachPointLocalOffset, this._attachedMesh.getWorldMatrix(), worldOffset);
        if (!this.interpolatePose) {
            this._attachedMesh.position.copyFrom(this._workingPosition).subtractInPlace(worldOffset);
            this._attachedMesh.rotationQuaternion.copyFrom(this._workingQuaternion);
            return;
        }
        // position
        const interpolatedPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.SmoothToRef(this._attachedMesh.position, this._workingPosition, elapsed, this.lerpTime, interpolatedPosition);
        this._attachedMesh.position.copyFrom(interpolatedPosition);
        // rotation
        const currentRotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT();
        currentRotation.copyFrom(this._attachedMesh.rotationQuaternion);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.SmoothToRef(currentRotation, this._workingQuaternion, elapsed, this.lerpTime, this._attachedMesh.rotationQuaternion);
        this._attachedMesh.setParent(oldParent);
    }
    _addObservables() {
        this._pointerObserver = this._scene.onPointerObservable.add((pointerInfo) => {
            if (this.enabled && pointerInfo.type == _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_0__/* .PointerEventTypes */ .Zp.POINTERMOVE && pointerInfo.pickInfo) {
                this.findAndUpdateTarget(pointerInfo.pickInfo);
            }
        });
        this._lastTick = Date.now();
        this._onBeforeRender = this._scene.onBeforeRenderObservable.add(() => {
            const tick = Date.now();
            this._updateTransformToGoal(tick - this._lastTick);
            this._lastTick = tick;
        });
    }
    _removeObservables() {
        this._scene.onPointerObservable.remove(this._pointerObserver);
        this._scene.onBeforeRenderObservable.remove(this._onBeforeRender);
        this._pointerObserver = null;
        this._onBeforeRender = null;
    }
}
//# sourceMappingURL=surfaceMagnetismBehavior.js.map

/***/ }),

/***/ 36504:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $: () => (/* binding */ Bone)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27309);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4870);



/**
 * Class used to store bone information
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
 */
class Bone extends _node_js__WEBPACK_IMPORTED_MODULE_2__/* .Node */ .b {
    /** @internal */
    get _matrix() {
        this._compose();
        return this._localMatrix;
    }
    /** @internal */
    set _matrix(value) {
        // skip if the matrices are the same
        if (value.updateFlag === this._localMatrix.updateFlag && !this._needToCompose) {
            return;
        }
        this._needToCompose = false; // in case there was a pending compose
        this._localMatrix.copyFrom(value);
        this._markAsDirtyAndDecompose();
    }
    /**
     * Create a new bone
     * @param name defines the bone name
     * @param skeleton defines the parent skeleton
     * @param parentBone defines the parent (can be null if the bone is the root)
     * @param localMatrix defines the local matrix (default: identity)
     * @param restMatrix defines the rest matrix (default: localMatrix)
     * @param bindMatrix defines the bind matrix (default: localMatrix)
     * @param index defines index of the bone in the hierarchy (default: null)
     */
    constructor(
    /**
     * defines the bone name
     */
    name, skeleton, parentBone = null, localMatrix = null, restMatrix = null, bindMatrix = null, index = null) {
        super(name, skeleton.getScene(), false);
        this.name = name;
        /**
         * Gets the list of child bones
         */
        this.children = [];
        /** Gets the animations associated with this bone */
        this.animations = [];
        /**
         * @internal Internal only
         * Set this value to map this bone to a different index in the transform matrices
         * Set this value to -1 to exclude the bone from the transform matrices
         */
        this._index = null;
        this._scalingDeterminant = 1;
        this._needToDecompose = true;
        this._needToCompose = false;
        /** @internal */
        this._linkedTransformNode = null;
        /** @internal */
        this._waitingTransformNodeId = null;
        this._skeleton = skeleton;
        this._localMatrix = localMatrix?.clone() ?? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Identity();
        this._restMatrix = restMatrix ?? this._localMatrix.clone();
        this._bindMatrix = bindMatrix ?? this._localMatrix.clone();
        this._index = index;
        this._absoluteMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
        this._absoluteBindMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
        this._absoluteInverseBindMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
        this._finalMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
        skeleton.bones.push(this);
        this.setParent(parentBone, false);
        this._updateAbsoluteBindMatrices();
    }
    /**
     * Gets the current object class name.
     * @returns the class name
     */
    getClassName() {
        return "Bone";
    }
    // Members
    /**
     * Gets the parent skeleton
     * @returns a skeleton
     */
    getSkeleton() {
        return this._skeleton;
    }
    get parent() {
        return this._parentNode;
    }
    /**
     * Gets parent bone
     * @returns a bone or null if the bone is the root of the bone hierarchy
     */
    getParent() {
        return this.parent;
    }
    /**
     * Returns an array containing the children of the bone
     * @returns an array containing the children of the bone (can be empty if the bone has no children)
     */
    getChildren() {
        return this.children;
    }
    /**
     * Gets the node index in matrix array generated for rendering
     * @returns the node index
     */
    getIndex() {
        return this._index === null ? this.getSkeleton().bones.indexOf(this) : this._index;
    }
    set parent(newParent) {
        this.setParent(newParent);
    }
    /**
     * Sets the parent bone
     * @param parent defines the parent (can be null if the bone is the root)
     * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be updated
     */
    setParent(parent, updateAbsoluteBindMatrices = true) {
        if (this.parent === parent) {
            return;
        }
        if (this.parent) {
            const index = this.parent.children.indexOf(this);
            if (index !== -1) {
                this.parent.children.splice(index, 1);
            }
        }
        this._parentNode = parent;
        if (this.parent) {
            this.parent.children.push(this);
        }
        if (updateAbsoluteBindMatrices) {
            this._updateAbsoluteBindMatrices();
        }
        this.markAsDirty();
    }
    /**
     * Gets the local matrix
     * @returns the local matrix
     */
    getLocalMatrix() {
        this._compose();
        return this._localMatrix;
    }
    /**
     * Gets the bind matrix
     * @returns the bind matrix
     */
    getBindMatrix() {
        return this._bindMatrix;
    }
    /**
     * Gets the bind matrix.
     * @returns the bind matrix
     * @deprecated Please use getBindMatrix instead
     */
    getBaseMatrix() {
        return this.getBindMatrix();
    }
    /**
     * Gets the rest matrix
     * @returns the rest matrix
     */
    getRestMatrix() {
        return this._restMatrix;
    }
    /**
     * Gets the rest matrix
     * @returns the rest matrix
     * @deprecated Please use getRestMatrix instead
     */
    getRestPose() {
        return this.getRestMatrix();
    }
    /**
     * Sets the rest matrix
     * @param matrix the local-space rest matrix to set for this bone
     */
    setRestMatrix(matrix) {
        this._restMatrix.copyFrom(matrix);
    }
    /**
     * Sets the rest matrix
     * @param matrix the local-space rest to set for this bone
     * @deprecated Please use setRestMatrix instead
     */
    setRestPose(matrix) {
        this.setRestMatrix(matrix);
    }
    /**
     * Gets the bind matrix
     * @returns the bind matrix
     * @deprecated Please use getBindMatrix instead
     */
    getBindPose() {
        return this.getBindMatrix();
    }
    /**
     * Sets the bind matrix
     * This will trigger a recomputation of the absolute bind and absolute inverse bind matrices for this bone and its children
     * Note that the local matrix will also be set with the matrix passed in parameter!
     * @param matrix the local-space bind matrix to set for this bone
     */
    setBindMatrix(matrix) {
        this.updateMatrix(matrix);
    }
    /**
     * Sets the bind matrix
     * @param matrix the local-space bind to set for this bone
     * @deprecated Please use setBindMatrix instead
     */
    setBindPose(matrix) {
        this.setBindMatrix(matrix);
    }
    /**
     * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)
     * @returns the final world matrix
     */
    getFinalMatrix() {
        return this._finalMatrix;
    }
    /**
     * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)
     * @deprecated Please use getFinalMatrix instead
     * @returns the final world matrix
     */
    getWorldMatrix() {
        return this.getFinalMatrix();
    }
    /**
     * Sets the local matrix to the rest matrix
     */
    returnToRest() {
        if (this._linkedTransformNode) {
            const localScaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0];
            const localRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0];
            const localPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[1];
            this.getRestMatrix().decompose(localScaling, localRotation, localPosition);
            this._linkedTransformNode.position.copyFrom(localPosition);
            this._linkedTransformNode.rotationQuaternion = this._linkedTransformNode.rotationQuaternion ?? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Identity();
            this._linkedTransformNode.rotationQuaternion.copyFrom(localRotation);
            this._linkedTransformNode.scaling.copyFrom(localScaling);
        }
        else {
            this._matrix = this._restMatrix;
        }
    }
    /**
     * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)
     * @returns the inverse bind matrix, in world space
     */
    getAbsoluteInverseBindMatrix() {
        return this._absoluteInverseBindMatrix;
    }
    /**
     * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)
     * @returns the inverse bind matrix, in world space
     * @deprecated Please use getAbsoluteInverseBindMatrix instead
     */
    getInvertedAbsoluteTransform() {
        return this.getAbsoluteInverseBindMatrix();
    }
    /**
     * Gets the bone matrix, in world space (relative to the skeleton root)
     * @returns the bone matrix, in world space
     */
    getAbsoluteMatrix() {
        return this._absoluteMatrix;
    }
    /**
     * Gets the bone matrix, in world space (relative to the skeleton root)
     * @returns the bone matrix, in world space
     * @deprecated Please use getAbsoluteMatrix instead
     */
    getAbsoluteTransform() {
        return this._absoluteMatrix;
    }
    /**
     * Links with the given transform node.
     * The local matrix of this bone is overwritten by the transform of the node every frame.
     * @param transformNode defines the transform node to link to
     */
    linkTransformNode(transformNode) {
        if (this._linkedTransformNode) {
            this._skeleton._numBonesWithLinkedTransformNode--;
        }
        this._linkedTransformNode = transformNode;
        if (this._linkedTransformNode) {
            this._skeleton._numBonesWithLinkedTransformNode++;
        }
    }
    // Properties (matches TransformNode properties)
    /**
     * Gets the node used to drive the bone's transformation
     * @returns a transform node or null
     */
    getTransformNode() {
        return this._linkedTransformNode;
    }
    /** Gets or sets current position (in local space) */
    get position() {
        this._decompose();
        return this._localPosition;
    }
    set position(newPosition) {
        this._decompose();
        this._localPosition.copyFrom(newPosition);
        this._markAsDirtyAndCompose();
    }
    /** Gets or sets current rotation (in local space) */
    get rotation() {
        return this.getRotation();
    }
    set rotation(newRotation) {
        this.setRotation(newRotation);
    }
    /** Gets or sets current rotation quaternion (in local space) */
    get rotationQuaternion() {
        this._decompose();
        return this._localRotation;
    }
    set rotationQuaternion(newRotation) {
        this.setRotationQuaternion(newRotation);
    }
    /** Gets or sets current scaling (in local space) */
    get scaling() {
        return this.getScale();
    }
    set scaling(newScaling) {
        this.setScale(newScaling);
    }
    /**
     * Gets the animation properties override
     */
    get animationPropertiesOverride() {
        return this._skeleton.animationPropertiesOverride;
    }
    // Methods
    _decompose() {
        if (!this._needToDecompose) {
            return;
        }
        this._needToDecompose = false;
        if (!this._localScaling) {
            this._localScaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
            this._localRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Zero();
            this._localPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        }
        this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition);
    }
    _compose() {
        if (!this._needToCompose) {
            return;
        }
        if (!this._localScaling) {
            this._needToCompose = false;
            return;
        }
        this._needToCompose = false;
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix);
    }
    /**
     * Update the bind (and optionally the local) matrix
     * @param bindMatrix defines the new matrix to set to the bind/local matrix, in local space
     * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be recomputed (default: true)
     * @param updateLocalMatrix defines if the local matrix should also be updated with the matrix passed in parameter (default: true)
     */
    updateMatrix(bindMatrix, updateAbsoluteBindMatrices = true, updateLocalMatrix = true) {
        this._bindMatrix.copyFrom(bindMatrix);
        if (updateAbsoluteBindMatrices) {
            this._updateAbsoluteBindMatrices();
        }
        if (updateLocalMatrix) {
            this._matrix = bindMatrix;
        }
        else {
            this.markAsDirty();
        }
    }
    /**
     * @internal
     */
    _updateAbsoluteBindMatrices(bindMatrix, updateChildren = true) {
        if (!bindMatrix) {
            bindMatrix = this._bindMatrix;
        }
        if (this.parent) {
            bindMatrix.multiplyToRef(this.parent._absoluteBindMatrix, this._absoluteBindMatrix);
        }
        else {
            this._absoluteBindMatrix.copyFrom(bindMatrix);
        }
        this._absoluteBindMatrix.invertToRef(this._absoluteInverseBindMatrix);
        if (updateChildren) {
            for (let index = 0; index < this.children.length; index++) {
                this.children[index]._updateAbsoluteBindMatrices();
            }
        }
        this._scalingDeterminant = this._absoluteBindMatrix.determinant() < 0 ? -1 : 1;
    }
    /**
     * Flag the bone as dirty (Forcing it to update everything)
     * @returns this bone
     */
    markAsDirty() {
        this._currentRenderId++;
        this._childUpdateId++;
        this._skeleton._markAsDirty();
        return this;
    }
    /** @internal */
    _markAsDirtyAndCompose() {
        this.markAsDirty();
        this._needToCompose = true;
    }
    _markAsDirtyAndDecompose() {
        this.markAsDirty();
        this._needToDecompose = true;
    }
    _updatePosition(vec, space = 0 /* Space.LOCAL */, tNode, translationMode = true) {
        const lm = this.getLocalMatrix();
        if (space == 0 /* Space.LOCAL */) {
            if (translationMode) {
                lm.addAtIndex(12, vec.x);
                lm.addAtIndex(13, vec.y);
                lm.addAtIndex(14, vec.z);
            }
            else {
                lm.setTranslationFromFloats(vec.x, vec.y, vec.z);
            }
        }
        else {
            let wm = null;
            //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()
            if (tNode) {
                wm = tNode.getWorldMatrix();
            }
            this._skeleton.computeAbsoluteMatrices();
            const tmat = Bone._TmpMats[0];
            const tvec = Bone._TmpVecs[0];
            if (this.parent) {
                if (tNode && wm) {
                    tmat.copyFrom(this.parent.getAbsoluteMatrix());
                    tmat.multiplyToRef(wm, tmat);
                }
                else {
                    tmat.copyFrom(this.parent.getAbsoluteMatrix());
                }
            }
            else {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.IdentityToRef(tmat);
            }
            if (translationMode) {
                tmat.setTranslationFromFloats(0, 0, 0);
            }
            tmat.invert();
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformCoordinatesToRef(vec, tmat, tvec);
            if (translationMode) {
                lm.addAtIndex(12, tvec.x);
                lm.addAtIndex(13, tvec.y);
                lm.addAtIndex(14, tvec.z);
            }
            else {
                lm.setTranslationFromFloats(tvec.x, tvec.y, tvec.z);
            }
        }
        this._markAsDirtyAndDecompose();
    }
    /**
     * Translate the bone in local or world space
     * @param vec The amount to translate the bone
     * @param space The space that the translation is in (default: Space.LOCAL)
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     */
    translate(vec, space = 0 /* Space.LOCAL */, tNode) {
        this._updatePosition(vec, space, tNode, true);
    }
    /**
     * Set the position of the bone in local or world space
     * @param position The position to set the bone
     * @param space The space that the position is in (default: Space.LOCAL)
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     */
    setPosition(position, space = 0 /* Space.LOCAL */, tNode) {
        this._updatePosition(position, space, tNode, false);
    }
    /**
     * Set the absolute position of the bone (world space)
     * @param position The position to set the bone
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     */
    setAbsolutePosition(position, tNode) {
        this.setPosition(position, 1 /* Space.WORLD */, tNode);
    }
    /**
     * Scale the bone on the x, y and z axes (in local space)
     * @param x The amount to scale the bone on the x axis
     * @param y The amount to scale the bone on the y axis
     * @param z The amount to scale the bone on the z axis
     * @param scaleChildren sets this to true if children of the bone should be scaled as well (false by default)
     */
    scale(x, y, z, scaleChildren = false) {
        const locMat = this.getLocalMatrix();
        // Apply new scaling on top of current local matrix
        const scaleMat = Bone._TmpMats[0];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.ScalingToRef(x, y, z, scaleMat);
        scaleMat.multiplyToRef(locMat, locMat);
        // Invert scaling matrix and apply the inverse to all children
        scaleMat.invert();
        for (const child of this.children) {
            const cm = child.getLocalMatrix();
            cm.multiplyToRef(scaleMat, cm);
            cm.multiplyAtIndex(12, x);
            cm.multiplyAtIndex(13, y);
            cm.multiplyAtIndex(14, z);
            child._markAsDirtyAndDecompose();
        }
        this._markAsDirtyAndDecompose();
        if (scaleChildren) {
            for (const child of this.children) {
                child.scale(x, y, z, scaleChildren);
            }
        }
    }
    /**
     * Set the bone scaling in local space
     * @param scale defines the scaling vector
     */
    setScale(scale) {
        this._decompose();
        this._localScaling.copyFrom(scale);
        this._markAsDirtyAndCompose();
    }
    /**
     * Gets the current scaling in local space
     * @returns the current scaling vector
     */
    getScale() {
        this._decompose();
        return this._localScaling;
    }
    /**
     * Gets the current scaling in local space and stores it in a target vector
     * @param result defines the target vector
     */
    getScaleToRef(result) {
        this._decompose();
        result.copyFrom(this._localScaling);
    }
    /**
     * Set the yaw, pitch, and roll of the bone in local or world space
     * @param yaw The rotation of the bone on the y axis
     * @param pitch The rotation of the bone on the x axis
     * @param roll The rotation of the bone on the z axis
     * @param space The space that the axes of rotation are in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     */
    setYawPitchRoll(yaw, pitch, roll, space = 0 /* Space.LOCAL */, tNode) {
        if (space === 0 /* Space.LOCAL */) {
            const quat = Bone._TmpQuat;
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationYawPitchRollToRef(yaw, pitch, roll, quat);
            this.setRotationQuaternion(quat, space, tNode);
            return;
        }
        const rotMatInv = Bone._TmpMats[0];
        if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {
            return;
        }
        const rotMat = Bone._TmpMats[1];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.RotationYawPitchRollToRef(yaw, pitch, roll, rotMat);
        rotMatInv.multiplyToRef(rotMat, rotMat);
        this._rotateWithMatrix(rotMat, space, tNode);
    }
    /**
     * Add a rotation to the bone on an axis in local or world space
     * @param axis The axis to rotate the bone on
     * @param amount The amount to rotate the bone
     * @param space The space that the axis is in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     */
    rotate(axis, amount, space = 0 /* Space.LOCAL */, tNode) {
        const rmat = Bone._TmpMats[0];
        rmat.setTranslationFromFloats(0, 0, 0);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.RotationAxisToRef(axis, amount, rmat);
        this._rotateWithMatrix(rmat, space, tNode);
    }
    /**
     * Set the rotation of the bone to a particular axis angle in local or world space
     * @param axis The axis to rotate the bone on
     * @param angle The angle that the bone should be rotated to
     * @param space The space that the axis is in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     */
    setAxisAngle(axis, angle, space = 0 /* Space.LOCAL */, tNode) {
        if (space === 0 /* Space.LOCAL */) {
            const quat = Bone._TmpQuat;
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationAxisToRef(axis, angle, quat);
            this.setRotationQuaternion(quat, space, tNode);
            return;
        }
        const rotMatInv = Bone._TmpMats[0];
        if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {
            return;
        }
        const rotMat = Bone._TmpMats[1];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.RotationAxisToRef(axis, angle, rotMat);
        rotMatInv.multiplyToRef(rotMat, rotMat);
        this._rotateWithMatrix(rotMat, space, tNode);
    }
    /**
     * Set the euler rotation of the bone in local or world space
     * @param rotation The euler rotation that the bone should be set to
     * @param space The space that the rotation is in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     */
    setRotation(rotation, space = 0 /* Space.LOCAL */, tNode) {
        this.setYawPitchRoll(rotation.y, rotation.x, rotation.z, space, tNode);
    }
    /**
     * Set the quaternion rotation of the bone in local or world space
     * @param quat The quaternion rotation that the bone should be set to
     * @param space The space that the rotation is in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     */
    setRotationQuaternion(quat, space = 0 /* Space.LOCAL */, tNode) {
        if (space === 0 /* Space.LOCAL */) {
            this._decompose();
            this._localRotation.copyFrom(quat);
            this._markAsDirtyAndCompose();
            return;
        }
        const rotMatInv = Bone._TmpMats[0];
        if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {
            return;
        }
        const rotMat = Bone._TmpMats[1];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.FromQuaternionToRef(quat, rotMat);
        rotMatInv.multiplyToRef(rotMat, rotMat);
        this._rotateWithMatrix(rotMat, space, tNode);
    }
    /**
     * Set the rotation matrix of the bone in local or world space
     * @param rotMat The rotation matrix that the bone should be set to
     * @param space The space that the rotation is in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     */
    setRotationMatrix(rotMat, space = 0 /* Space.LOCAL */, tNode) {
        if (space === 0 /* Space.LOCAL */) {
            const quat = Bone._TmpQuat;
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.FromRotationMatrixToRef(rotMat, quat);
            this.setRotationQuaternion(quat, space, tNode);
            return;
        }
        const rotMatInv = Bone._TmpMats[0];
        if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {
            return;
        }
        const rotMat2 = Bone._TmpMats[1];
        rotMat2.copyFrom(rotMat);
        rotMatInv.multiplyToRef(rotMat, rotMat2);
        this._rotateWithMatrix(rotMat2, space, tNode);
    }
    _rotateWithMatrix(rmat, space = 0 /* Space.LOCAL */, tNode) {
        const lmat = this.getLocalMatrix();
        const lx = lmat.m[12];
        const ly = lmat.m[13];
        const lz = lmat.m[14];
        const parent = this.getParent();
        const parentScale = Bone._TmpMats[3];
        const parentScaleInv = Bone._TmpMats[4];
        if (parent && space == 1 /* Space.WORLD */) {
            if (tNode) {
                parentScale.copyFrom(tNode.getWorldMatrix());
                parent.getAbsoluteMatrix().multiplyToRef(parentScale, parentScale);
            }
            else {
                parentScale.copyFrom(parent.getAbsoluteMatrix());
            }
            parentScaleInv.copyFrom(parentScale);
            parentScaleInv.invert();
            lmat.multiplyToRef(parentScale, lmat);
            lmat.multiplyToRef(rmat, lmat);
            lmat.multiplyToRef(parentScaleInv, lmat);
        }
        else {
            if (space == 1 /* Space.WORLD */ && tNode) {
                parentScale.copyFrom(tNode.getWorldMatrix());
                parentScaleInv.copyFrom(parentScale);
                parentScaleInv.invert();
                lmat.multiplyToRef(parentScale, lmat);
                lmat.multiplyToRef(rmat, lmat);
                lmat.multiplyToRef(parentScaleInv, lmat);
            }
            else {
                lmat.multiplyToRef(rmat, lmat);
            }
        }
        lmat.setTranslationFromFloats(lx, ly, lz);
        this.computeAbsoluteMatrices();
        this._markAsDirtyAndDecompose();
    }
    _getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode) {
        const scaleMatrix = Bone._TmpMats[2];
        rotMatInv.copyFrom(this.getAbsoluteMatrix());
        if (tNode) {
            rotMatInv.multiplyToRef(tNode.getWorldMatrix(), rotMatInv);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.ScalingToRef(tNode.scaling.x, tNode.scaling.y, tNode.scaling.z, scaleMatrix);
        }
        else {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.IdentityToRef(scaleMatrix);
        }
        rotMatInv.invert();
        if (isNaN(rotMatInv.m[0])) {
            // Matrix failed to invert.
            // This can happen if scale is zero for example.
            return false;
        }
        scaleMatrix.multiplyAtIndex(0, this._scalingDeterminant);
        rotMatInv.multiplyToRef(scaleMatrix, rotMatInv);
        return true;
    }
    /**
     * Get the position of the bone in local or world space
     * @param space The space that the returned position is in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @returns The position of the bone
     */
    getPosition(space = 0 /* Space.LOCAL */, tNode = null) {
        const pos = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        this.getPositionToRef(space, tNode, pos);
        return pos;
    }
    /**
     * Copy the position of the bone to a vector3 in local or world space
     * @param space The space that the returned position is in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @param result The vector3 to copy the position to
     */
    getPositionToRef(space = 0 /* Space.LOCAL */, tNode, result) {
        if (space == 0 /* Space.LOCAL */) {
            const lm = this.getLocalMatrix();
            result.x = lm.m[12];
            result.y = lm.m[13];
            result.z = lm.m[14];
        }
        else {
            let wm = null;
            //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()
            if (tNode) {
                wm = tNode.getWorldMatrix();
            }
            this._skeleton.computeAbsoluteMatrices();
            let tmat = Bone._TmpMats[0];
            if (tNode && wm) {
                tmat.copyFrom(this.getAbsoluteMatrix());
                tmat.multiplyToRef(wm, tmat);
            }
            else {
                tmat = this.getAbsoluteMatrix();
            }
            result.x = tmat.m[12];
            result.y = tmat.m[13];
            result.z = tmat.m[14];
        }
    }
    /**
     * Get the absolute position of the bone (world space)
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @returns The absolute position of the bone
     */
    getAbsolutePosition(tNode = null) {
        const pos = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        this.getPositionToRef(1 /* Space.WORLD */, tNode, pos);
        return pos;
    }
    /**
     * Copy the absolute position of the bone (world space) to the result param
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @param result The vector3 to copy the absolute position to
     */
    getAbsolutePositionToRef(tNode, result) {
        this.getPositionToRef(1 /* Space.WORLD */, tNode, result);
    }
    /**
     * Compute the absolute matrices of this bone and its children
     */
    computeAbsoluteMatrices() {
        this._compose();
        if (this.parent) {
            this._localMatrix.multiplyToRef(this.parent._absoluteMatrix, this._absoluteMatrix);
        }
        else {
            this._absoluteMatrix.copyFrom(this._localMatrix);
            const poseMatrix = this._skeleton.getPoseMatrix();
            if (poseMatrix) {
                this._absoluteMatrix.multiplyToRef(poseMatrix, this._absoluteMatrix);
            }
        }
        const children = this.children;
        const len = children.length;
        for (let i = 0; i < len; i++) {
            children[i].computeAbsoluteMatrices();
        }
    }
    /**
     * Compute the absolute matrices of this bone and its children
     * @deprecated Please use computeAbsoluteMatrices instead
     */
    computeAbsoluteTransforms() {
        this.computeAbsoluteMatrices();
    }
    /**
     * Get the world direction from an axis that is in the local space of the bone
     * @param localAxis The local direction that is used to compute the world direction
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @returns The world direction
     */
    getDirection(localAxis, tNode = null) {
        const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        this.getDirectionToRef(localAxis, tNode, result);
        return result;
    }
    /**
     * Copy the world direction to a vector3 from an axis that is in the local space of the bone
     * @param localAxis The local direction that is used to compute the world direction
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @param result The vector3 that the world direction will be copied to
     */
    getDirectionToRef(localAxis, tNode = null, result) {
        let wm = null;
        //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()
        if (tNode) {
            wm = tNode.getWorldMatrix();
        }
        this._skeleton.computeAbsoluteMatrices();
        const mat = Bone._TmpMats[0];
        mat.copyFrom(this.getAbsoluteMatrix());
        if (tNode && wm) {
            mat.multiplyToRef(wm, mat);
        }
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalToRef(localAxis, mat, result);
        result.normalize();
    }
    /**
     * Get the euler rotation of the bone in local or world space
     * @param space The space that the rotation should be in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @returns The euler rotation
     */
    getRotation(space = 0 /* Space.LOCAL */, tNode = null) {
        const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        this.getRotationToRef(space, tNode, result);
        return result;
    }
    /**
     * Copy the euler rotation of the bone to a vector3.  The rotation can be in either local or world space
     * @param space The space that the rotation should be in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @param result The vector3 that the rotation should be copied to
     */
    getRotationToRef(space = 0 /* Space.LOCAL */, tNode = null, result) {
        const quat = Bone._TmpQuat;
        this.getRotationQuaternionToRef(space, tNode, quat);
        quat.toEulerAnglesToRef(result);
    }
    /**
     * Get the quaternion rotation of the bone in either local or world space
     * @param space The space that the rotation should be in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @returns The quaternion rotation
     */
    getRotationQuaternion(space = 0 /* Space.LOCAL */, tNode = null) {
        const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Identity();
        this.getRotationQuaternionToRef(space, tNode, result);
        return result;
    }
    /**
     * Copy the quaternion rotation of the bone to a quaternion.  The rotation can be in either local or world space
     * @param space The space that the rotation should be in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @param result The quaternion that the rotation should be copied to
     */
    getRotationQuaternionToRef(space = 0 /* Space.LOCAL */, tNode = null, result) {
        if (space == 0 /* Space.LOCAL */) {
            this._decompose();
            result.copyFrom(this._localRotation);
        }
        else {
            const mat = Bone._TmpMats[0];
            const amat = this.getAbsoluteMatrix();
            if (tNode) {
                amat.multiplyToRef(tNode.getWorldMatrix(), mat);
            }
            else {
                mat.copyFrom(amat);
            }
            mat.multiplyAtIndex(0, this._scalingDeterminant);
            mat.multiplyAtIndex(1, this._scalingDeterminant);
            mat.multiplyAtIndex(2, this._scalingDeterminant);
            mat.decompose(undefined, result, undefined);
        }
    }
    /**
     * Get the rotation matrix of the bone in local or world space
     * @param space The space that the rotation should be in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @returns The rotation matrix
     */
    getRotationMatrix(space = 0 /* Space.LOCAL */, tNode) {
        const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Identity();
        this.getRotationMatrixToRef(space, tNode, result);
        return result;
    }
    /**
     * Copy the rotation matrix of the bone to a matrix.  The rotation can be in either local or world space
     * @param space The space that the rotation should be in
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @param result The quaternion that the rotation should be copied to
     */
    getRotationMatrixToRef(space = 0 /* Space.LOCAL */, tNode, result) {
        if (space == 0 /* Space.LOCAL */) {
            this.getLocalMatrix().getRotationMatrixToRef(result);
        }
        else {
            const mat = Bone._TmpMats[0];
            const amat = this.getAbsoluteMatrix();
            if (tNode) {
                amat.multiplyToRef(tNode.getWorldMatrix(), mat);
            }
            else {
                mat.copyFrom(amat);
            }
            mat.multiplyAtIndex(0, this._scalingDeterminant);
            mat.multiplyAtIndex(1, this._scalingDeterminant);
            mat.multiplyAtIndex(2, this._scalingDeterminant);
            mat.getRotationMatrixToRef(result);
        }
    }
    /**
     * Get the world position of a point that is in the local space of the bone
     * @param position The local position
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @returns The world position
     */
    getAbsolutePositionFromLocal(position, tNode = null) {
        const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        this.getAbsolutePositionFromLocalToRef(position, tNode, result);
        return result;
    }
    /**
     * Get the world position of a point that is in the local space of the bone and copy it to the result param
     * @param position The local position
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @param result The vector3 that the world position should be copied to
     */
    getAbsolutePositionFromLocalToRef(position, tNode = null, result) {
        let wm = null;
        //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()
        if (tNode) {
            wm = tNode.getWorldMatrix();
        }
        this._skeleton.computeAbsoluteMatrices();
        const tmat = Bone._TmpMats[0];
        tmat.copyFrom(this.getAbsoluteMatrix());
        if (tNode && wm) {
            tmat.multiplyToRef(wm, tmat);
        }
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformCoordinatesToRef(position, tmat, result);
    }
    /**
     * Get the local position of a point that is in world space
     * @param position The world position
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @returns The local position
     */
    getLocalPositionFromAbsolute(position, tNode = null) {
        const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        this.getLocalPositionFromAbsoluteToRef(position, tNode, result);
        return result;
    }
    /**
     * Get the local position of a point that is in world space and copy it to the result param
     * @param position The world position
     * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
     * @param result The vector3 that the local position should be copied to
     */
    getLocalPositionFromAbsoluteToRef(position, tNode = null, result) {
        let wm = null;
        //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()
        if (tNode) {
            wm = tNode.getWorldMatrix();
        }
        this._skeleton.computeAbsoluteMatrices();
        const tmat = Bone._TmpMats[0];
        tmat.copyFrom(this.getAbsoluteMatrix());
        if (tNode && wm) {
            tmat.multiplyToRef(wm, tmat);
        }
        tmat.invert();
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformCoordinatesToRef(position, tmat, result);
    }
    /**
     * Set the current local matrix as the restMatrix for this bone.
     */
    setCurrentPoseAsRest() {
        this.setRestMatrix(this.getLocalMatrix());
    }
    /**
     * Releases associated resources
     */
    dispose() {
        this._linkedTransformNode = null;
        const index = this._skeleton.bones.indexOf(this);
        if (index !== -1) {
            this._skeleton.bones.splice(index, 1);
        }
        if (this._parentNode && this._parentNode.children) {
            const children = this._parentNode.children;
            const index = children.indexOf(this);
            if (index !== -1) {
                children.splice(index, 1);
            }
        }
        super.dispose();
    }
}
Bone._TmpVecs = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildArray */ .mI)(2, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero);
Bone._TmpQuat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Identity();
Bone._TmpMats = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildArray */ .mI)(5, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Identity);
//# sourceMappingURL=bone.js.map

/***/ }),

/***/ 15397:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   E: () => (/* binding */ Skeleton)
/* harmony export */ });
/* harmony import */ var _bone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36504);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(96041);
/* harmony import */ var _Animations_animation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7540);
/* harmony import */ var _Animations_animationRange_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(56227);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6315);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(51137);
/* harmony import */ var _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(74609);










/**
 * Class used to handle skinning animations
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
 */
class Skeleton {
    /**
     * Gets or sets a boolean indicating that bone matrices should be stored as a texture instead of using shader uniforms (default is true).
     * Please note that this option is not available if the hardware does not support it
     */
    get useTextureToStoreBoneMatrices() {
        return this._useTextureToStoreBoneMatrices;
    }
    set useTextureToStoreBoneMatrices(value) {
        this._useTextureToStoreBoneMatrices = value;
        this._markAsDirty();
    }
    /**
     * Gets or sets the animation properties override
     */
    get animationPropertiesOverride() {
        if (!this._animationPropertiesOverride) {
            return this._scene.animationPropertiesOverride;
        }
        return this._animationPropertiesOverride;
    }
    set animationPropertiesOverride(value) {
        this._animationPropertiesOverride = value;
    }
    /**
     * Gets a boolean indicating that the skeleton effectively stores matrices into a texture
     */
    get isUsingTextureForMatrices() {
        return this.useTextureToStoreBoneMatrices && this._canUseTextureForBones;
    }
    /**
     * Gets the unique ID of this skeleton
     */
    get uniqueId() {
        return this._uniqueId;
    }
    /**
     * Creates a new skeleton
     * @param name defines the skeleton name
     * @param id defines the skeleton Id
     * @param scene defines the hosting scene
     */
    constructor(
    /** defines the skeleton name */
    name, 
    /** defines the skeleton Id */
    id, scene) {
        this.name = name;
        this.id = id;
        /**
         * Defines the list of child bones
         */
        this.bones = [];
        /**
         * Defines a boolean indicating if the root matrix is provided by meshes or by the current skeleton (this is the default value)
         */
        this.needInitialSkinMatrix = false;
        this._isDirty = true;
        this._meshesWithPoseMatrix = new Array();
        this._identity = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.Identity();
        this._currentRenderId = -1;
        this._ranges = {};
        this._absoluteTransformIsDirty = true;
        this._canUseTextureForBones = false;
        this._uniqueId = 0;
        /** @internal */
        this._numBonesWithLinkedTransformNode = 0;
        /** @internal */
        this._hasWaitingData = null;
        /** @internal */
        this._parentContainer = null;
        /**
         * Specifies if the skeleton should be serialized
         */
        this.doNotSerialize = false;
        this._useTextureToStoreBoneMatrices = true;
        this._animationPropertiesOverride = null;
        // Events
        /**
         * An observable triggered before computing the skeleton's matrices
         */
        this.onBeforeComputeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        this.bones = [];
        this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__/* .EngineStore */ .q.LastCreatedScene;
        this._uniqueId = this._scene.getUniqueId();
        this._scene.addSkeleton(this);
        //make sure it will recalculate the matrix next time prepare is called.
        this._isDirty = true;
        const engineCaps = this._scene.getEngine().getCaps();
        this._canUseTextureForBones = engineCaps.textureFloat && engineCaps.maxVertexTextureImageUnits > 0;
    }
    /**
     * Gets the current object class name.
     * @returns the class name
     */
    getClassName() {
        return "Skeleton";
    }
    /**
     * Returns an array containing the root bones
     * @returns an array containing the root bones
     */
    getChildren() {
        return this.bones.filter((b) => !b.getParent());
    }
    // Members
    /**
     * Gets the list of transform matrices to send to shaders (one matrix per bone)
     * @param mesh defines the mesh to use to get the root matrix (if needInitialSkinMatrix === true)
     * @returns a Float32Array containing matrices data
     */
    getTransformMatrices(mesh) {
        if (this.needInitialSkinMatrix) {
            if (!mesh) {
                throw new Error("getTransformMatrices: When using the needInitialSkinMatrix flag, a mesh must be provided");
            }
            if (!mesh._bonesTransformMatrices) {
                this.prepare(true);
            }
            return mesh._bonesTransformMatrices;
        }
        if (!this._transformMatrices || this._isDirty) {
            this.prepare(!this._transformMatrices);
        }
        return this._transformMatrices;
    }
    /**
     * Gets the list of transform matrices to send to shaders inside a texture (one matrix per bone)
     * @param mesh defines the mesh to use to get the root matrix (if needInitialSkinMatrix === true)
     * @returns a raw texture containing the data
     */
    getTransformMatrixTexture(mesh) {
        if (this.needInitialSkinMatrix && mesh._transformMatrixTexture) {
            return mesh._transformMatrixTexture;
        }
        return this._transformMatrixTexture;
    }
    /**
     * Gets the current hosting scene
     * @returns a scene object
     */
    getScene() {
        return this._scene;
    }
    // Methods
    /**
     * Gets a string representing the current skeleton data
     * @param fullDetails defines a boolean indicating if we want a verbose version
     * @returns a string representing the current skeleton data
     */
    toString(fullDetails) {
        let ret = `Name: ${this.name}, nBones: ${this.bones.length}`;
        ret += `, nAnimationRanges: ${this._ranges ? Object.keys(this._ranges).length : "none"}`;
        if (fullDetails) {
            ret += ", Ranges: {";
            let first = true;
            for (const name in this._ranges) {
                if (first) {
                    ret += ", ";
                    first = false;
                }
                ret += name;
            }
            ret += "}";
        }
        return ret;
    }
    /**
     * Get bone's index searching by name
     * @param name defines bone's name to search for
     * @returns the indice of the bone. Returns -1 if not found
     */
    getBoneIndexByName(name) {
        for (let boneIndex = 0, cache = this.bones.length; boneIndex < cache; boneIndex++) {
            if (this.bones[boneIndex].name === name) {
                return boneIndex;
            }
        }
        return -1;
    }
    /**
     * Create a new animation range
     * @param name defines the name of the range
     * @param from defines the start key
     * @param to defines the end key
     */
    createAnimationRange(name, from, to) {
        // check name not already in use
        if (!this._ranges[name]) {
            this._ranges[name] = new _Animations_animationRange_js__WEBPACK_IMPORTED_MODULE_5__/* .AnimationRange */ .K(name, from, to);
            for (let i = 0, nBones = this.bones.length; i < nBones; i++) {
                if (this.bones[i].animations[0]) {
                    this.bones[i].animations[0].createRange(name, from, to);
                }
            }
        }
    }
    /**
     * Delete a specific animation range
     * @param name defines the name of the range
     * @param deleteFrames defines if frames must be removed as well
     */
    deleteAnimationRange(name, deleteFrames = true) {
        for (let i = 0, nBones = this.bones.length; i < nBones; i++) {
            if (this.bones[i].animations[0]) {
                this.bones[i].animations[0].deleteRange(name, deleteFrames);
            }
        }
        this._ranges[name] = null; // said much faster than 'delete this._range[name]'
    }
    /**
     * Gets a specific animation range
     * @param name defines the name of the range to look for
     * @returns the requested animation range or null if not found
     */
    getAnimationRange(name) {
        return this._ranges[name] || null;
    }
    /**
     * Gets the list of all animation ranges defined on this skeleton
     * @returns an array
     */
    getAnimationRanges() {
        const animationRanges = [];
        let name;
        for (name in this._ranges) {
            animationRanges.push(this._ranges[name]);
        }
        return animationRanges;
    }
    /**
     * Copy animation range from a source skeleton.
     * This is not for a complete retargeting, only between very similar skeleton's with only possible bone length differences
     * @param source defines the source skeleton
     * @param name defines the name of the range to copy
     * @param rescaleAsRequired defines if rescaling must be applied if required
     * @returns true if operation was successful
     */
    copyAnimationRange(source, name, rescaleAsRequired = false) {
        if (this._ranges[name] || !source.getAnimationRange(name)) {
            return false;
        }
        let ret = true;
        const frameOffset = this._getHighestAnimationFrame() + 1;
        // make a dictionary of source skeleton's bones, so exact same order or doubly nested loop is not required
        const boneDict = {};
        const sourceBones = source.bones;
        let nBones;
        let i;
        for (i = 0, nBones = sourceBones.length; i < nBones; i++) {
            boneDict[sourceBones[i].name] = sourceBones[i];
        }
        if (this.bones.length !== sourceBones.length) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .Logger */ .V.Warn(`copyAnimationRange: this rig has ${this.bones.length} bones, while source as ${sourceBones.length}`);
            ret = false;
        }
        const skelDimensionsRatio = rescaleAsRequired && this.dimensionsAtRest && source.dimensionsAtRest ? this.dimensionsAtRest.divide(source.dimensionsAtRest) : null;
        for (i = 0, nBones = this.bones.length; i < nBones; i++) {
            const boneName = this.bones[i].name;
            const sourceBone = boneDict[boneName];
            if (sourceBone) {
                ret = ret && this.bones[i].copyAnimationRange(sourceBone, name, frameOffset, rescaleAsRequired, skelDimensionsRatio);
            }
            else {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .Logger */ .V.Warn("copyAnimationRange: not same rig, missing source bone " + boneName);
                ret = false;
            }
        }
        // do not call createAnimationRange(), since it also is done to bones, which was already done
        const range = source.getAnimationRange(name);
        if (range) {
            this._ranges[name] = new _Animations_animationRange_js__WEBPACK_IMPORTED_MODULE_5__/* .AnimationRange */ .K(name, range.from + frameOffset, range.to + frameOffset);
        }
        return ret;
    }
    /**
     * Forces the skeleton to go to rest pose
     */
    returnToRest() {
        for (const bone of this.bones) {
            if (bone._index !== -1) {
                bone.returnToRest();
            }
        }
    }
    _getHighestAnimationFrame() {
        let ret = 0;
        for (let i = 0, nBones = this.bones.length; i < nBones; i++) {
            if (this.bones[i].animations[0]) {
                const highest = this.bones[i].animations[0].getHighestFrame();
                if (ret < highest) {
                    ret = highest;
                }
            }
        }
        return ret;
    }
    /**
     * Begin a specific animation range
     * @param name defines the name of the range to start
     * @param loop defines if looping must be turned on (false by default)
     * @param speedRatio defines the speed ratio to apply (1 by default)
     * @param onAnimationEnd defines a callback which will be called when animation will end
     * @returns a new animatable
     */
    beginAnimation(name, loop, speedRatio, onAnimationEnd) {
        const range = this.getAnimationRange(name);
        if (!range) {
            return null;
        }
        return this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd);
    }
    /**
     * Convert the keyframes for a range of animation on a skeleton to be relative to a given reference frame.
     * @param skeleton defines the Skeleton containing the animation range to convert
     * @param referenceFrame defines the frame that keyframes in the range will be relative to
     * @param range defines the name of the AnimationRange belonging to the Skeleton to convert
     * @returns the original skeleton
     */
    static MakeAnimationAdditive(skeleton, referenceFrame = 0, range) {
        const rangeValue = skeleton.getAnimationRange(range);
        // We can't make a range additive if it doesn't exist
        if (!rangeValue) {
            return null;
        }
        // Find any current scene-level animatable belonging to the target that matches the range
        const sceneAnimatables = skeleton._scene.getAllAnimatablesByTarget(skeleton);
        let rangeAnimatable = null;
        for (let index = 0; index < sceneAnimatables.length; index++) {
            const sceneAnimatable = sceneAnimatables[index];
            if (sceneAnimatable.fromFrame === rangeValue?.from && sceneAnimatable.toFrame === rangeValue?.to) {
                rangeAnimatable = sceneAnimatable;
                break;
            }
        }
        // Convert the animations belonging to the skeleton to additive keyframes
        const animatables = skeleton.getAnimatables();
        for (let index = 0; index < animatables.length; index++) {
            const animatable = animatables[index];
            const animations = animatable.animations;
            if (!animations) {
                continue;
            }
            for (let animIndex = 0; animIndex < animations.length; animIndex++) {
                _Animations_animation_js__WEBPACK_IMPORTED_MODULE_4__/* .Animation */ .X5.MakeAnimationAdditive(animations[animIndex], referenceFrame, range);
            }
        }
        // Mark the scene-level animatable as additive
        if (rangeAnimatable) {
            rangeAnimatable.isAdditive = true;
        }
        return skeleton;
    }
    /** @internal */
    _markAsDirty() {
        this._isDirty = true;
        this._absoluteTransformIsDirty = true;
    }
    /**
     * @internal
     */
    _registerMeshWithPoseMatrix(mesh) {
        this._meshesWithPoseMatrix.push(mesh);
    }
    /**
     * @internal
     */
    _unregisterMeshWithPoseMatrix(mesh) {
        const index = this._meshesWithPoseMatrix.indexOf(mesh);
        if (index > -1) {
            this._meshesWithPoseMatrix.splice(index, 1);
        }
    }
    _computeTransformMatrices(targetMatrix, initialSkinMatrix) {
        this.onBeforeComputeObservable.notifyObservers(this);
        for (let index = 0; index < this.bones.length; index++) {
            const bone = this.bones[index];
            bone._childUpdateId++;
            const parentBone = bone.getParent();
            if (parentBone) {
                bone.getLocalMatrix().multiplyToRef(parentBone.getFinalMatrix(), bone.getFinalMatrix());
            }
            else {
                if (initialSkinMatrix) {
                    bone.getLocalMatrix().multiplyToRef(initialSkinMatrix, bone.getFinalMatrix());
                }
                else {
                    bone.getFinalMatrix().copyFrom(bone.getLocalMatrix());
                }
            }
            if (bone._index !== -1) {
                const mappedIndex = bone._index === null ? index : bone._index;
                bone.getAbsoluteInverseBindMatrix().multiplyToArray(bone.getFinalMatrix(), targetMatrix, mappedIndex * 16);
            }
        }
        this._identity.copyToArray(targetMatrix, this.bones.length * 16);
    }
    /**
     * Build all resources required to render a skeleton
     * @param dontCheckFrameId defines a boolean indicating if prepare should be run without checking first the current frame id (default: false)
     */
    prepare(dontCheckFrameId = false) {
        if (!dontCheckFrameId) {
            const currentRenderId = this.getScene().getRenderId();
            if (this._currentRenderId === currentRenderId) {
                return;
            }
            this._currentRenderId = currentRenderId;
        }
        // Update the local matrix of bones with linked transform nodes.
        if (this._numBonesWithLinkedTransformNode > 0) {
            for (const bone of this.bones) {
                if (bone._linkedTransformNode) {
                    const node = bone._linkedTransformNode;
                    bone.position = node.position;
                    if (node.rotationQuaternion) {
                        bone.rotationQuaternion = node.rotationQuaternion;
                    }
                    else {
                        bone.rotation = node.rotation;
                    }
                    bone.scaling = node.scaling;
                }
            }
        }
        if (this.needInitialSkinMatrix) {
            for (const mesh of this._meshesWithPoseMatrix) {
                const poseMatrix = mesh.getPoseMatrix();
                let needsUpdate = this._isDirty;
                if (!mesh._bonesTransformMatrices || mesh._bonesTransformMatrices.length !== 16 * (this.bones.length + 1)) {
                    mesh._bonesTransformMatrices = new Float32Array(16 * (this.bones.length + 1));
                    needsUpdate = true;
                }
                if (!needsUpdate) {
                    continue;
                }
                if (this._synchronizedWithMesh !== mesh) {
                    this._synchronizedWithMesh = mesh;
                    // Prepare bones
                    for (const bone of this.bones) {
                        if (!bone.getParent()) {
                            const matrix = bone.getBindMatrix();
                            matrix.multiplyToRef(poseMatrix, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Matrix[1]);
                            bone._updateAbsoluteBindMatrices(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Matrix[1]);
                        }
                    }
                    if (this.isUsingTextureForMatrices) {
                        const textureWidth = (this.bones.length + 1) * 4;
                        if (!mesh._transformMatrixTexture || mesh._transformMatrixTexture.getSize().width !== textureWidth) {
                            if (mesh._transformMatrixTexture) {
                                mesh._transformMatrixTexture.dispose();
                            }
                            mesh._transformMatrixTexture = _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_3__/* .RawTexture */ .I.CreateRGBATexture(mesh._bonesTransformMatrices, (this.bones.length + 1) * 4, 1, this._scene, false, false, 1, 1);
                        }
                    }
                }
                this._computeTransformMatrices(mesh._bonesTransformMatrices, poseMatrix);
                if (this.isUsingTextureForMatrices && mesh._transformMatrixTexture) {
                    mesh._transformMatrixTexture.update(mesh._bonesTransformMatrices);
                }
            }
        }
        else {
            if (!this._isDirty) {
                return;
            }
            if (!this._transformMatrices || this._transformMatrices.length !== 16 * (this.bones.length + 1)) {
                this._transformMatrices = new Float32Array(16 * (this.bones.length + 1));
                if (this.isUsingTextureForMatrices) {
                    if (this._transformMatrixTexture) {
                        this._transformMatrixTexture.dispose();
                    }
                    this._transformMatrixTexture = _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_3__/* .RawTexture */ .I.CreateRGBATexture(this._transformMatrices, (this.bones.length + 1) * 4, 1, this._scene, false, false, 1, 1);
                }
            }
            this._computeTransformMatrices(this._transformMatrices, null);
            if (this.isUsingTextureForMatrices && this._transformMatrixTexture) {
                this._transformMatrixTexture.update(this._transformMatrices);
            }
        }
        this._isDirty = false;
    }
    /**
     * Gets the list of animatables currently running for this skeleton
     * @returns an array of animatables
     */
    getAnimatables() {
        if (!this._animatables || this._animatables.length !== this.bones.length) {
            this._animatables = [];
            for (let index = 0; index < this.bones.length; index++) {
                this._animatables.push(this.bones[index]);
            }
        }
        return this._animatables;
    }
    /**
     * Clone the current skeleton
     * @param name defines the name of the new skeleton
     * @param id defines the id of the new skeleton
     * @returns the new skeleton
     */
    clone(name, id) {
        const result = new Skeleton(name, id || name, this._scene);
        result.needInitialSkinMatrix = this.needInitialSkinMatrix;
        for (let index = 0; index < this.bones.length; index++) {
            const source = this.bones[index];
            let parentBone = null;
            const parent = source.getParent();
            if (parent) {
                const parentIndex = this.bones.indexOf(parent);
                parentBone = result.bones[parentIndex];
            }
            const bone = new _bone_js__WEBPACK_IMPORTED_MODULE_0__/* .Bone */ .$(source.name, result, parentBone, source.getBindMatrix().clone(), source.getRestMatrix().clone());
            bone._index = source._index;
            if (source._linkedTransformNode) {
                bone.linkTransformNode(source._linkedTransformNode);
            }
            _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_8__/* .DeepCopier */ .r.DeepCopy(source.animations, bone.animations);
        }
        if (this._ranges) {
            result._ranges = {};
            for (const rangeName in this._ranges) {
                const range = this._ranges[rangeName];
                if (range) {
                    result._ranges[rangeName] = range.clone();
                }
            }
        }
        this._isDirty = true;
        result.prepare(true);
        return result;
    }
    /**
     * Enable animation blending for this skeleton
     * @param blendingSpeed defines the blending speed to apply
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending
     */
    enableBlending(blendingSpeed = 0.01) {
        this.bones.forEach((bone) => {
            bone.animations.forEach((animation) => {
                animation.enableBlending = true;
                animation.blendingSpeed = blendingSpeed;
            });
        });
    }
    /**
     * Releases all resources associated with the current skeleton
     */
    dispose() {
        this._meshesWithPoseMatrix.length = 0;
        // Animations
        this.getScene().stopAnimation(this);
        // Remove from scene
        this.getScene().removeSkeleton(this);
        if (this._parentContainer) {
            const index = this._parentContainer.skeletons.indexOf(this);
            if (index > -1) {
                this._parentContainer.skeletons.splice(index, 1);
            }
            this._parentContainer = null;
        }
        if (this._transformMatrixTexture) {
            this._transformMatrixTexture.dispose();
            this._transformMatrixTexture = null;
        }
    }
    /**
     * Serialize the skeleton in a JSON object
     * @returns a JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.id = this.id;
        if (this.dimensionsAtRest) {
            serializationObject.dimensionsAtRest = this.dimensionsAtRest.asArray();
        }
        serializationObject.bones = [];
        serializationObject.needInitialSkinMatrix = this.needInitialSkinMatrix;
        for (let index = 0; index < this.bones.length; index++) {
            const bone = this.bones[index];
            const parent = bone.getParent();
            const serializedBone = {
                parentBoneIndex: parent ? this.bones.indexOf(parent) : -1,
                index: bone.getIndex(),
                name: bone.name,
                id: bone.id,
                matrix: bone.getBindMatrix().asArray(),
                rest: bone.getRestMatrix().asArray(),
                linkedTransformNodeId: bone.getTransformNode()?.id,
            };
            serializationObject.bones.push(serializedBone);
            if (bone.length) {
                serializedBone.length = bone.length;
            }
            if (bone.metadata) {
                serializedBone.metadata = bone.metadata;
            }
            if (bone.animations && bone.animations.length > 0) {
                serializedBone.animation = bone.animations[0].serialize();
            }
            serializationObject.ranges = [];
            for (const name in this._ranges) {
                const source = this._ranges[name];
                if (!source) {
                    continue;
                }
                const range = {};
                range.name = name;
                range.from = source.from;
                range.to = source.to;
                serializationObject.ranges.push(range);
            }
        }
        return serializationObject;
    }
    /**
     * Creates a new skeleton from serialized data
     * @param parsedSkeleton defines the serialized data
     * @param scene defines the hosting scene
     * @returns a new skeleton
     */
    static Parse(parsedSkeleton, scene) {
        const skeleton = new Skeleton(parsedSkeleton.name, parsedSkeleton.id, scene);
        if (parsedSkeleton.dimensionsAtRest) {
            skeleton.dimensionsAtRest = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.FromArray(parsedSkeleton.dimensionsAtRest);
        }
        skeleton.needInitialSkinMatrix = parsedSkeleton.needInitialSkinMatrix;
        let index;
        for (index = 0; index < parsedSkeleton.bones.length; index++) {
            const parsedBone = parsedSkeleton.bones[index];
            const parsedBoneIndex = parsedSkeleton.bones[index].index;
            let parentBone = null;
            if (parsedBone.parentBoneIndex > -1) {
                parentBone = skeleton.bones[parsedBone.parentBoneIndex];
            }
            const rest = parsedBone.rest ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromArray(parsedBone.rest) : null;
            const bone = new _bone_js__WEBPACK_IMPORTED_MODULE_0__/* .Bone */ .$(parsedBone.name, skeleton, parentBone, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromArray(parsedBone.matrix), rest, null, parsedBoneIndex);
            if (parsedBone.id !== undefined && parsedBone.id !== null) {
                bone.id = parsedBone.id;
            }
            if (parsedBone.length) {
                bone.length = parsedBone.length;
            }
            if (parsedBone.metadata) {
                bone.metadata = parsedBone.metadata;
            }
            if (parsedBone.animation) {
                bone.animations.push(_Animations_animation_js__WEBPACK_IMPORTED_MODULE_4__/* .Animation */ .X5.Parse(parsedBone.animation));
            }
            if (parsedBone.linkedTransformNodeId !== undefined && parsedBone.linkedTransformNodeId !== null) {
                skeleton._hasWaitingData = true;
                bone._waitingTransformNodeId = parsedBone.linkedTransformNodeId;
            }
        }
        // placed after bones, so createAnimationRange can cascade down
        if (parsedSkeleton.ranges) {
            for (index = 0; index < parsedSkeleton.ranges.length; index++) {
                const data = parsedSkeleton.ranges[index];
                skeleton.createAnimationRange(data.name, data.from, data.to);
            }
        }
        return skeleton;
    }
    /**
     * Compute all node absolute matrices
     * @param forceUpdate defines if computation must be done even if cache is up to date
     */
    computeAbsoluteMatrices(forceUpdate = false) {
        if (this._absoluteTransformIsDirty || forceUpdate) {
            this.bones[0].computeAbsoluteMatrices();
            this._absoluteTransformIsDirty = false;
        }
    }
    /**
     * Compute all node absolute matrices
     * @param forceUpdate defines if computation must be done even if cache is up to date
     * @deprecated Please use computeAbsoluteMatrices instead
     */
    computeAbsoluteTransforms(forceUpdate = false) {
        this.computeAbsoluteMatrices(forceUpdate);
    }
    /**
     * Gets the root pose matrix
     * @returns a matrix
     */
    getPoseMatrix() {
        let poseMatrix = null;
        if (this._meshesWithPoseMatrix.length > 0) {
            poseMatrix = this._meshesWithPoseMatrix[0].getPoseMatrix();
        }
        return poseMatrix;
    }
    /**
     * Sorts bones per internal index
     */
    sortBones() {
        const bones = [];
        const visited = new Array(this.bones.length);
        for (let index = 0; index < this.bones.length; index++) {
            this._sortBones(index, bones, visited);
        }
        this.bones = bones;
    }
    _sortBones(index, bones, visited) {
        if (visited[index]) {
            return;
        }
        visited[index] = true;
        const bone = this.bones[index];
        if (!bone)
            return;
        if (bone._index === undefined) {
            bone._index = index;
        }
        const parentBone = bone.getParent();
        if (parentBone) {
            this._sortBones(this.bones.indexOf(parentBone), bones, visited);
        }
        bones.push(bone);
    }
    /**
     * Set the current local matrix as the restPose for all bones in the skeleton.
     */
    setCurrentPoseAsRest() {
        this.bones.forEach((b) => {
            b.setCurrentPoseAsRest();
        });
    }
}
//# sourceMappingURL=skeleton.js.map

/***/ }),

/***/ 95616:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   R: () => (/* binding */ VertexBuffer),
/* harmony export */   h: () => (/* binding */ Buffer)
/* harmony export */ });
/* harmony import */ var _dataBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71504);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);



/**
 * Class used to store data that will be store in GPU memory
 */
class Buffer {
    /**
     * Gets a boolean indicating if the Buffer is disposed
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Constructor
     * @param engine the engine
     * @param data the data to use for this buffer
     * @param updatable whether the data is updatable
     * @param stride the stride (optional)
     * @param postponeInternalCreation whether to postpone creating the internal WebGL buffer (optional)
     * @param instanced whether the buffer is instanced (optional)
     * @param useBytes set to true if the stride in in bytes (optional)
     * @param divisor sets an optional divisor for instances (1 by default)
     * @param label defines the label of the buffer (for debug purpose)
     */
    constructor(engine, data, updatable, stride = 0, postponeInternalCreation = false, instanced = false, useBytes = false, divisor, label) {
        this._isAlreadyOwned = false;
        this._isDisposed = false;
        if (engine && engine.getScene) {
            // old versions of VertexBuffer accepted 'mesh' instead of 'engine'
            this._engine = engine.getScene().getEngine();
        }
        else {
            this._engine = engine;
        }
        this._updatable = updatable;
        this._instanced = instanced;
        this._divisor = divisor || 1;
        this._label = label;
        if (data instanceof _dataBuffer_js__WEBPACK_IMPORTED_MODULE_0__/* .DataBuffer */ .n) {
            this._data = null;
            this._buffer = data;
        }
        else {
            this._data = data;
            this._buffer = null;
        }
        this.byteStride = useBytes ? stride : stride * Float32Array.BYTES_PER_ELEMENT;
        if (!postponeInternalCreation) {
            // by default
            this.create();
        }
    }
    /**
     * Create a new VertexBuffer based on the current buffer
     * @param kind defines the vertex buffer kind (position, normal, etc.)
     * @param offset defines offset in the buffer (0 by default)
     * @param size defines the size in floats of attributes (position is 3 for instance)
     * @param stride defines the stride size in floats in the buffer (the offset to apply to reach next value when data is interleaved)
     * @param instanced defines if the vertex buffer contains indexed data
     * @param useBytes defines if the offset and stride are in bytes     *
     * @param divisor sets an optional divisor for instances (1 by default)
     * @returns the new vertex buffer
     */
    createVertexBuffer(kind, offset, size, stride, instanced, useBytes = false, divisor) {
        const byteOffset = useBytes ? offset : offset * Float32Array.BYTES_PER_ELEMENT;
        const byteStride = stride ? (useBytes ? stride : stride * Float32Array.BYTES_PER_ELEMENT) : this.byteStride;
        // a lot of these parameters are ignored as they are overridden by the buffer
        return new VertexBuffer(this._engine, this, kind, this._updatable, true, byteStride, instanced === undefined ? this._instanced : instanced, byteOffset, size, undefined, undefined, true, this._divisor || divisor);
    }
    // Properties
    /**
     * Gets a boolean indicating if the Buffer is updatable?
     * @returns true if the buffer is updatable
     */
    isUpdatable() {
        return this._updatable;
    }
    /**
     * Gets current buffer's data
     * @returns a DataArray or null
     */
    getData() {
        return this._data;
    }
    /**
     * Gets underlying native buffer
     * @returns underlying native buffer
     */
    getBuffer() {
        return this._buffer;
    }
    /**
     * Gets the stride in float32 units (i.e. byte stride / 4).
     * May not be an integer if the byte stride is not divisible by 4.
     * @returns the stride in float32 units
     * @deprecated Please use byteStride instead.
     */
    getStrideSize() {
        return this.byteStride / Float32Array.BYTES_PER_ELEMENT;
    }
    // Methods
    /**
     * Store data into the buffer. Creates the buffer if not used already.
     * If the buffer was already used, it will be updated only if it is updatable, otherwise it will do nothing.
     * @param data defines the data to store
     */
    create(data = null) {
        if (!data && this._buffer) {
            return; // nothing to do
        }
        data = data || this._data;
        if (!data) {
            return;
        }
        if (!this._buffer) {
            // create buffer
            if (this._updatable) {
                this._buffer = this._engine.createDynamicVertexBuffer(data, this._label);
                this._data = data;
            }
            else {
                this._buffer = this._engine.createVertexBuffer(data, undefined, this._label);
            }
        }
        else if (this._updatable) {
            // update buffer
            this._engine.updateDynamicVertexBuffer(this._buffer, data);
            this._data = data;
        }
    }
    /** @internal */
    _rebuild() {
        if (!this._data) {
            if (!this._buffer) {
                // Buffer was not yet created, nothing to do
                return;
            }
            if (this._buffer.capacity > 0) {
                // We can at least recreate the buffer with the right size, even if we don't have the data
                if (this._updatable) {
                    this._buffer = this._engine.createDynamicVertexBuffer(this._buffer.capacity, this._label);
                }
                else {
                    this._buffer = this._engine.createVertexBuffer(this._buffer.capacity, undefined, this._label);
                }
                return;
            }
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn(`Missing data for buffer "${this._label}" ${this._buffer ? "(uniqueId: " + this._buffer.uniqueId + ")" : ""}. Buffer reconstruction failed.`);
            this._buffer = null;
        }
        else {
            this._buffer = null;
            this.create(this._data);
        }
    }
    /**
     * Update current buffer data
     * @param data defines the data to store
     */
    update(data) {
        this.create(data);
    }
    /**
     * Updates the data directly.
     * @param data the new data
     * @param offset the new offset
     * @param vertexCount the vertex count (optional)
     * @param useBytes set to true if the offset is in bytes
     */
    updateDirectly(data, offset, vertexCount, useBytes = false) {
        if (!this._buffer) {
            return;
        }
        if (this._updatable) {
            // update buffer
            this._engine.updateDynamicVertexBuffer(this._buffer, data, useBytes ? offset : offset * Float32Array.BYTES_PER_ELEMENT, vertexCount ? vertexCount * this.byteStride : undefined);
            if (offset === 0 && vertexCount === undefined) {
                // Keep the data if we easily can
                this._data = data;
            }
            else {
                this._data = null;
            }
        }
    }
    /** @internal */
    _increaseReferences() {
        if (!this._buffer) {
            return;
        }
        if (!this._isAlreadyOwned) {
            this._isAlreadyOwned = true;
            return;
        }
        this._buffer.references++;
    }
    /**
     * Release all resources
     */
    dispose() {
        if (!this._buffer) {
            return;
        }
        // The data buffer has an internal counter as this buffer can be used by several VertexBuffer objects
        // This means that we only flag it as disposed when all references are released (when _releaseBuffer will return true)
        if (this._engine._releaseBuffer(this._buffer)) {
            this._isDisposed = true;
            this._data = null;
            this._buffer = null;
        }
    }
}
/**
 * Specialized buffer used to store vertex data
 */
class VertexBuffer {
    /**
     * Gets a boolean indicating if the Buffer is disposed
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Gets or sets the instance divisor when in instanced mode
     */
    get instanceDivisor() {
        return this._instanceDivisor;
    }
    set instanceDivisor(value) {
        const isInstanced = value != 0;
        this._instanceDivisor = value;
        if (isInstanced !== this._instanced) {
            this._instanced = isInstanced;
            this._computeHashCode();
        }
    }
    /**
     * Gets the max possible amount of vertices stored within the current vertex buffer.
     * We do not have the end offset or count so this will be too big for concatenated vertex buffers.
     * @internal
     */
    get _maxVerticesCount() {
        const data = this.getData();
        if (!data) {
            return 0;
        }
        if (Array.isArray(data)) {
            // data is a regular number[] with float values
            return data.length / (this.byteStride / 4) - this.byteOffset / 4;
        }
        return (data.byteLength - this.byteOffset) / this.byteStride;
    }
    /** @internal */
    constructor(engine, data, kind, updatableOrOptions, postponeInternalCreation, stride, instanced, offset, size, type, normalized = false, useBytes = false, divisor = 1, takeBufferOwnership = false) {
        /** @internal */
        this._isDisposed = false;
        let updatable = false;
        this.engine = engine;
        if (typeof updatableOrOptions === "object" && updatableOrOptions !== null) {
            updatable = updatableOrOptions.updatable ?? false;
            postponeInternalCreation = updatableOrOptions.postponeInternalCreation;
            stride = updatableOrOptions.stride;
            instanced = updatableOrOptions.instanced;
            offset = updatableOrOptions.offset;
            size = updatableOrOptions.size;
            type = updatableOrOptions.type;
            normalized = updatableOrOptions.normalized ?? false;
            useBytes = updatableOrOptions.useBytes ?? false;
            divisor = updatableOrOptions.divisor ?? 1;
            takeBufferOwnership = updatableOrOptions.takeBufferOwnership ?? false;
            this._label = updatableOrOptions.label;
        }
        else {
            updatable = !!updatableOrOptions;
        }
        if (data instanceof Buffer) {
            this._buffer = data;
            this._ownsBuffer = takeBufferOwnership;
        }
        else {
            this._buffer = new Buffer(engine, data, updatable, stride, postponeInternalCreation, instanced, useBytes, divisor, this._label);
            this._ownsBuffer = true;
        }
        this.uniqueId = VertexBuffer._Counter++;
        this._kind = kind;
        if (type === undefined) {
            const vertexData = this.getData();
            this.type = vertexData ? VertexBuffer.GetDataType(vertexData) : VertexBuffer.FLOAT;
        }
        else {
            this.type = type;
        }
        const typeByteLength = VertexBuffer.GetTypeByteLength(this.type);
        if (useBytes) {
            this._size = size || (stride ? stride / typeByteLength : VertexBuffer.DeduceStride(kind));
            this.byteStride = stride || this._buffer.byteStride || this._size * typeByteLength;
            this.byteOffset = offset || 0;
        }
        else {
            this._size = size || stride || VertexBuffer.DeduceStride(kind);
            this.byteStride = stride ? stride * typeByteLength : this._buffer.byteStride || this._size * typeByteLength;
            this.byteOffset = (offset || 0) * typeByteLength;
        }
        this.normalized = normalized;
        this._instanced = instanced !== undefined ? instanced : false;
        this._instanceDivisor = instanced ? divisor : 0;
        this._alignBuffer();
        this._computeHashCode();
    }
    _computeHashCode() {
        // note: cast to any because the property is declared readonly
        this.hashCode =
            ((this.type - 5120) << 0) +
                ((this.normalized ? 1 : 0) << 3) +
                (this._size << 4) +
                ((this._instanced ? 1 : 0) << 6) +
                /* keep 5 bits free */
                (this.byteStride << 12);
    }
    /** @internal */
    _rebuild() {
        this._buffer?._rebuild();
    }
    /**
     * Returns the kind of the VertexBuffer (string)
     * @returns a string
     */
    getKind() {
        return this._kind;
    }
    // Properties
    /**
     * Gets a boolean indicating if the VertexBuffer is updatable?
     * @returns true if the buffer is updatable
     */
    isUpdatable() {
        return this._buffer.isUpdatable();
    }
    /**
     * Gets current buffer's data
     * @returns a DataArray or null
     */
    getData() {
        return this._buffer.getData();
    }
    /**
     * Gets current buffer's data as a float array. Float data is constructed if the vertex buffer data cannot be returned directly.
     * @param totalVertices number of vertices in the buffer to take into account
     * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
     * @returns a float array containing vertex data
     */
    getFloatData(totalVertices, forceCopy) {
        const data = this.getData();
        if (!data) {
            return null;
        }
        return VertexBuffer.GetFloatData(data, this._size, this.type, this.byteOffset, this.byteStride, this.normalized, totalVertices, forceCopy);
    }
    /**
     * Gets underlying native buffer
     * @returns underlying native buffer
     */
    getBuffer() {
        return this._buffer.getBuffer();
    }
    /**
     * Gets the Buffer instance that wraps the native GPU buffer
     * @returns the wrapper buffer
     */
    getWrapperBuffer() {
        return this._buffer;
    }
    /**
     * Gets the stride in float32 units (i.e. byte stride / 4).
     * May not be an integer if the byte stride is not divisible by 4.
     * @returns the stride in float32 units
     * @deprecated Please use byteStride instead.
     */
    getStrideSize() {
        return this.byteStride / VertexBuffer.GetTypeByteLength(this.type);
    }
    /**
     * Returns the offset as a multiple of the type byte length.
     * @returns the offset in bytes
     * @deprecated Please use byteOffset instead.
     */
    getOffset() {
        return this.byteOffset / VertexBuffer.GetTypeByteLength(this.type);
    }
    /**
     * Returns the number of components or the byte size per vertex attribute
     * @param sizeInBytes If true, returns the size in bytes or else the size in number of components of the vertex attribute (default: false)
     * @returns the number of components
     */
    getSize(sizeInBytes = false) {
        return sizeInBytes ? this._size * VertexBuffer.GetTypeByteLength(this.type) : this._size;
    }
    /**
     * Gets a boolean indicating is the internal buffer of the VertexBuffer is instanced
     * @returns true if this buffer is instanced
     */
    getIsInstanced() {
        return this._instanced;
    }
    /**
     * Returns the instancing divisor, zero for non-instanced (integer).
     * @returns a number
     */
    getInstanceDivisor() {
        return this._instanceDivisor;
    }
    // Methods
    /**
     * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
     * @param data defines the data to store
     */
    create(data) {
        this._buffer.create(data);
        this._alignBuffer();
    }
    /**
     * Updates the underlying buffer according to the passed numeric array or Float32Array.
     * This function will create a new buffer if the current one is not updatable
     * @param data defines the data to store
     */
    update(data) {
        this._buffer.update(data);
        this._alignBuffer();
    }
    /**
     * Updates directly the underlying WebGLBuffer according to the passed numeric array or Float32Array.
     * Returns the directly updated WebGLBuffer.
     * @param data the new data
     * @param offset the new offset
     * @param useBytes set to true if the offset is in bytes
     */
    updateDirectly(data, offset, useBytes = false) {
        this._buffer.updateDirectly(data, offset, undefined, useBytes);
        this._alignBuffer();
    }
    /**
     * Disposes the VertexBuffer and the underlying WebGLBuffer.
     */
    dispose() {
        if (this._ownsBuffer) {
            this._buffer.dispose();
        }
        this._isDisposed = true;
    }
    /**
     * Enumerates each value of this vertex buffer as numbers.
     * @param count the number of values to enumerate
     * @param callback the callback function called for each value
     */
    forEach(count, callback) {
        VertexBuffer.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, count, this.normalized, callback);
    }
    /** @internal */
    _alignBuffer() { }
    /**
     * Deduces the stride given a kind.
     * @param kind The kind string to deduce
     * @returns The deduced stride
     */
    static DeduceStride(kind) {
        switch (kind) {
            case VertexBuffer.UVKind:
            case VertexBuffer.UV2Kind:
            case VertexBuffer.UV3Kind:
            case VertexBuffer.UV4Kind:
            case VertexBuffer.UV5Kind:
            case VertexBuffer.UV6Kind:
                return 2;
            case VertexBuffer.NormalKind:
            case VertexBuffer.PositionKind:
                return 3;
            case VertexBuffer.ColorKind:
            case VertexBuffer.ColorInstanceKind:
            case VertexBuffer.MatricesIndicesKind:
            case VertexBuffer.MatricesIndicesExtraKind:
            case VertexBuffer.MatricesWeightsKind:
            case VertexBuffer.MatricesWeightsExtraKind:
            case VertexBuffer.TangentKind:
                return 4;
            default:
                throw new Error("Invalid kind '" + kind + "'");
        }
    }
    /**
     * Gets the vertex buffer type of the given data array.
     * @param data the data array
     * @returns the vertex buffer type
     */
    static GetDataType(data) {
        if (data instanceof Int8Array) {
            return VertexBuffer.BYTE;
        }
        else if (data instanceof Uint8Array) {
            return VertexBuffer.UNSIGNED_BYTE;
        }
        else if (data instanceof Int16Array) {
            return VertexBuffer.SHORT;
        }
        else if (data instanceof Uint16Array) {
            return VertexBuffer.UNSIGNED_SHORT;
        }
        else if (data instanceof Int32Array) {
            return VertexBuffer.INT;
        }
        else if (data instanceof Uint32Array) {
            return VertexBuffer.UNSIGNED_INT;
        }
        else {
            return VertexBuffer.FLOAT;
        }
    }
    /**
     * Gets the byte length of the given type.
     * @param type the type
     * @returns the number of bytes
     */
    static GetTypeByteLength(type) {
        switch (type) {
            case VertexBuffer.BYTE:
            case VertexBuffer.UNSIGNED_BYTE:
                return 1;
            case VertexBuffer.SHORT:
            case VertexBuffer.UNSIGNED_SHORT:
                return 2;
            case VertexBuffer.INT:
            case VertexBuffer.UNSIGNED_INT:
            case VertexBuffer.FLOAT:
                return 4;
            default:
                throw new Error(`Invalid type '${type}'`);
        }
    }
    /**
     * Enumerates each value of the given parameters as numbers.
     * @param data the data to enumerate
     * @param byteOffset the byte offset of the data
     * @param byteStride the byte stride of the data
     * @param componentCount the number of components per element
     * @param componentType the type of the component
     * @param count the number of values to enumerate
     * @param normalized whether the data is normalized
     * @param callback the callback function called for each value
     */
    static ForEach(data, byteOffset, byteStride, componentCount, componentType, count, normalized, callback) {
        if (data instanceof Array) {
            let offset = byteOffset / 4;
            const stride = byteStride / 4;
            for (let index = 0; index < count; index += componentCount) {
                for (let componentIndex = 0; componentIndex < componentCount; componentIndex++) {
                    callback(data[offset + componentIndex], index + componentIndex);
                }
                offset += stride;
            }
        }
        else {
            const dataView = data instanceof ArrayBuffer ? new DataView(data) : new DataView(data.buffer, data.byteOffset, data.byteLength);
            const componentByteLength = VertexBuffer.GetTypeByteLength(componentType);
            for (let index = 0; index < count; index += componentCount) {
                let componentByteOffset = byteOffset;
                for (let componentIndex = 0; componentIndex < componentCount; componentIndex++) {
                    const value = VertexBuffer._GetFloatValue(dataView, componentType, componentByteOffset, normalized);
                    callback(value, index + componentIndex);
                    componentByteOffset += componentByteLength;
                }
                byteOffset += byteStride;
            }
        }
    }
    static _GetFloatValue(dataView, type, byteOffset, normalized) {
        switch (type) {
            case VertexBuffer.BYTE: {
                let value = dataView.getInt8(byteOffset);
                if (normalized) {
                    value = Math.max(value / 127, -1);
                }
                return value;
            }
            case VertexBuffer.UNSIGNED_BYTE: {
                let value = dataView.getUint8(byteOffset);
                if (normalized) {
                    value = value / 255;
                }
                return value;
            }
            case VertexBuffer.SHORT: {
                let value = dataView.getInt16(byteOffset, true);
                if (normalized) {
                    value = Math.max(value / 32767, -1);
                }
                return value;
            }
            case VertexBuffer.UNSIGNED_SHORT: {
                let value = dataView.getUint16(byteOffset, true);
                if (normalized) {
                    value = value / 65535;
                }
                return value;
            }
            case VertexBuffer.INT: {
                return dataView.getInt32(byteOffset, true);
            }
            case VertexBuffer.UNSIGNED_INT: {
                return dataView.getUint32(byteOffset, true);
            }
            case VertexBuffer.FLOAT: {
                return dataView.getFloat32(byteOffset, true);
            }
            default: {
                throw new Error(`Invalid component type ${type}`);
            }
        }
    }
    /**
     * Gets the given data array as a float array. Float data is constructed if the data array cannot be returned directly.
     * @param data the input data array
     * @param size the number of components
     * @param type the component type
     * @param byteOffset the byte offset of the data
     * @param byteStride the byte stride of the data
     * @param normalized whether the data is normalized
     * @param totalVertices number of vertices in the buffer to take into account
     * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
     * @returns a float array containing vertex data
     */
    static GetFloatData(data, size, type, byteOffset, byteStride, normalized, totalVertices, forceCopy) {
        const tightlyPackedByteStride = size * VertexBuffer.GetTypeByteLength(type);
        const count = totalVertices * size;
        if (type !== VertexBuffer.FLOAT || byteStride !== tightlyPackedByteStride) {
            const copy = new Float32Array(count);
            VertexBuffer.ForEach(data, byteOffset, byteStride, size, type, count, normalized, (value, index) => (copy[index] = value));
            return copy;
        }
        if (!(data instanceof Array || data instanceof Float32Array) || byteOffset !== 0 || data.length !== count) {
            if (data instanceof Array) {
                const offset = byteOffset / 4;
                return data.slice(offset, offset + count);
            }
            else if (data instanceof ArrayBuffer) {
                return new Float32Array(data, byteOffset, count);
            }
            else {
                const offset = data.byteOffset + byteOffset;
                if ((offset & 3) !== 0) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("Float array must be aligned to 4-bytes border");
                    forceCopy = true;
                }
                if (forceCopy) {
                    const result = new Uint8Array(count * Float32Array.BYTES_PER_ELEMENT);
                    const source = new Uint8Array(data.buffer, offset, result.length);
                    result.set(source);
                    return new Float32Array(result.buffer);
                }
                else {
                    return new Float32Array(data.buffer, offset, count);
                }
            }
        }
        if (forceCopy) {
            return data.slice();
        }
        return data;
    }
}
VertexBuffer._Counter = 0;
/**
 * The byte type.
 */
VertexBuffer.BYTE = 5120;
/**
 * The unsigned byte type.
 */
VertexBuffer.UNSIGNED_BYTE = 5121;
/**
 * The short type.
 */
VertexBuffer.SHORT = 5122;
/**
 * The unsigned short type.
 */
VertexBuffer.UNSIGNED_SHORT = 5123;
/**
 * The integer type.
 */
VertexBuffer.INT = 5124;
/**
 * The unsigned integer type.
 */
VertexBuffer.UNSIGNED_INT = 5125;
/**
 * The float type.
 */
VertexBuffer.FLOAT = 5126;
// Enums
/**
 * Positions
 */
VertexBuffer.PositionKind = `position`;
/**
 * Normals
 */
VertexBuffer.NormalKind = `normal`;
/**
 * Tangents
 */
VertexBuffer.TangentKind = `tangent`;
/**
 * Texture coordinates
 */
VertexBuffer.UVKind = `uv`;
/**
 * Texture coordinates 2
 */
VertexBuffer.UV2Kind = `uv2`;
/**
 * Texture coordinates 3
 */
VertexBuffer.UV3Kind = `uv3`;
/**
 * Texture coordinates 4
 */
VertexBuffer.UV4Kind = `uv4`;
/**
 * Texture coordinates 5
 */
VertexBuffer.UV5Kind = `uv5`;
/**
 * Texture coordinates 6
 */
VertexBuffer.UV6Kind = `uv6`;
/**
 * Colors
 */
VertexBuffer.ColorKind = `color`;
/**
 * Instance Colors
 */
VertexBuffer.ColorInstanceKind = `instanceColor`;
/**
 * Matrix indices (for bones)
 */
VertexBuffer.MatricesIndicesKind = `matricesIndices`;
/**
 * Matrix weights (for bones)
 */
VertexBuffer.MatricesWeightsKind = `matricesWeights`;
/**
 * Additional matrix indices (for bones)
 */
VertexBuffer.MatricesIndicesExtraKind = `matricesIndicesExtra`;
/**
 * Additional matrix weights (for bones)
 */
VertexBuffer.MatricesWeightsExtraKind = `matricesWeightsExtra`;
//# sourceMappingURL=buffer.js.map

/***/ }),

/***/ 11675:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   g: () => (/* binding */ CopyFloatData)
/* harmony export */ });
/* harmony import */ var _buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95616);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);


/**
 * Copies the given data array to the given float array.
 * @param input the input data array
 * @param size the number of components
 * @param type the component type
 * @param byteOffset the byte offset of the data
 * @param byteStride the byte stride of the data
 * @param normalized whether the data is normalized
 * @param totalVertices number of vertices in the buffer to take into account
 * @param output the output float array
 */
function CopyFloatData(input, size, type, byteOffset, byteStride, normalized, totalVertices, output) {
    const tightlyPackedByteStride = size * _buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.GetTypeByteLength(type);
    const count = totalVertices * size;
    if (output.length !== count) {
        throw new Error("Output length is not valid");
    }
    if (type !== _buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.FLOAT || byteStride !== tightlyPackedByteStride) {
        _buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.ForEach(input, byteOffset, byteStride, size, type, count, normalized, (value, index) => (output[index] = value));
        return;
    }
    if (input instanceof Array) {
        const offset = byteOffset / 4;
        output.set(input, offset);
    }
    else if (input instanceof ArrayBuffer) {
        const floatData = new Float32Array(input, byteOffset, count);
        output.set(floatData);
    }
    else {
        const offset = input.byteOffset + byteOffset;
        // Protect against bad data
        const remainder = offset % 4;
        if (remainder) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("CopyFloatData: copied misaligned data.");
            // If not aligned, copy the data to aligned buffer
            output.set(new Float32Array(input.buffer.slice(offset, offset + count * 4)));
            return;
        }
        const floatData = new Float32Array(input.buffer, offset, count);
        output.set(floatData);
    }
}
//# sourceMappingURL=bufferUtils.js.map

/***/ }),

/***/ 71504:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   n: () => (/* binding */ DataBuffer)
/* harmony export */ });
/**
 * Class used to store gfx data (like WebGLBuffer)
 */
class DataBuffer {
    /**
     * Gets the underlying buffer
     */
    get underlyingResource() {
        return null;
    }
    /**
     * Constructs the buffer
     */
    constructor() {
        /**
         * Gets or sets the number of objects referencing this buffer
         */
        this.references = 0;
        /** Gets or sets the size of the underlying buffer */
        this.capacity = 0;
        /**
         * Gets or sets a boolean indicating if the buffer contains 32bits indices
         */
        this.is32Bits = false;
        this.uniqueId = DataBuffer._Counter++;
    }
}
DataBuffer._Counter = 0;
//# sourceMappingURL=dataBuffer.js.map

/***/ }),

/***/ 31367:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   K: () => (/* binding */ StorageBuffer)
/* harmony export */ });

/**
 * This class is a small wrapper around a native buffer that can be read and/or written
 */
class StorageBuffer {
    /**
     * Creates a new storage buffer instance
     * @param engine The engine the buffer will be created inside
     * @param size The size of the buffer in bytes
     * @param creationFlags flags to use when creating the buffer (see undefined). The BUFFER_CREATIONFLAG_STORAGE flag will be automatically added.
     * @param label defines the label of the buffer (for debug purpose)
     */
    constructor(engine, size, creationFlags = 3, label) {
        this._engine = engine;
        this._label = label;
        this._engine._storageBuffers.push(this);
        this._create(size, creationFlags);
    }
    _create(size, creationFlags) {
        this._bufferSize = size;
        this._creationFlags = creationFlags;
        this._buffer = this._engine.createStorageBuffer(size, creationFlags, this._label);
    }
    /** @internal */
    _rebuild() {
        this._create(this._bufferSize, this._creationFlags);
    }
    /**
     * Gets underlying native buffer
     * @returns underlying native buffer
     */
    getBuffer() {
        return this._buffer;
    }
    /**
     * Updates the storage buffer
     * @param data the data used to update the storage buffer
     * @param byteOffset the byte offset of the data (optional)
     * @param byteLength the byte length of the data (optional)
     */
    update(data, byteOffset, byteLength) {
        if (!this._buffer) {
            return;
        }
        this._engine.updateStorageBuffer(this._buffer, data, byteOffset, byteLength);
    }
    /**
     * Reads data from the storage buffer
     * @param offset The offset in the storage buffer to start reading from (default: 0)
     * @param size  The number of bytes to read from the storage buffer (default: capacity of the buffer)
     * @param buffer The buffer to write the data we have read from the storage buffer to (optional)
     * @param noDelay If true, a call to flushFramebuffer will be issued so that the data can be read back immediately. This can speed up data retrieval, at the cost of a small perf penalty (default: false).
     * @returns If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer
     */
    read(offset, size, buffer, noDelay) {
        return this._engine.readFromStorageBuffer(this._buffer, offset, size, buffer, noDelay);
    }
    /**
     * Disposes the storage buffer
     */
    dispose() {
        const storageBuffers = this._engine._storageBuffers;
        const index = storageBuffers.indexOf(this);
        if (index !== -1) {
            storageBuffers[index] = storageBuffers[storageBuffers.length - 1];
            storageBuffers.pop();
        }
        this._engine._releaseBuffer(this._buffer);
        this._buffer = null;
    }
}
//# sourceMappingURL=storageBuffer.js.map

/***/ }),

/***/ 54973:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   l: () => (/* binding */ BaseCameraMouseWheelInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99848);
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66240);
/* harmony import */ var _Events_deviceInputEvents_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38123);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(998);






/**
 * Base class for mouse wheel input..
 * See FollowCameraMouseWheelInput in src/Cameras/Inputs/freeCameraMouseWheelInput.ts
 * for example usage.
 */
class BaseCameraMouseWheelInput {
    constructor() {
        /**
         * How fast is the camera moves in relation to X axis mouseWheel events.
         * Use negative value to reverse direction.
         */
        this.wheelPrecisionX = 3.0;
        /**
         * How fast is the camera moves in relation to Y axis mouseWheel events.
         * Use negative value to reverse direction.
         */
        this.wheelPrecisionY = 3.0;
        /**
         * How fast is the camera moves in relation to Z axis mouseWheel events.
         * Use negative value to reverse direction.
         */
        this.wheelPrecisionZ = 3.0;
        /**
         * Observable for when a mouse wheel move event occurs.
         */
        this.onChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        /**
         * Incremental value of multiple mouse wheel movements of the X axis.
         * Should be zero-ed when read.
         */
        this._wheelDeltaX = 0;
        /**
         * Incremental value of multiple mouse wheel movements of the Y axis.
         * Should be zero-ed when read.
         */
        this._wheelDeltaY = 0;
        /**
         * Incremental value of multiple mouse wheel movements of the Z axis.
         * Should be zero-ed when read.
         */
        this._wheelDeltaZ = 0;
        /**
         * Firefox uses a different scheme to report scroll distances to other
         * browsers. Rather than use complicated methods to calculate the exact
         * multiple we need to apply, let's just cheat and use a constant.
         * https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaMode
         * https://stackoverflow.com/questions/20110224/what-is-the-height-of-a-line-in-a-wheel-event-deltamode-dom-delta-line
         */
        this._ffMultiplier = 12;
        /**
         * Different event attributes for wheel data fall into a few set ranges.
         * Some relevant but dated date here:
         * https://stackoverflow.com/questions/5527601/normalizing-mousewheel-speed-across-browsers
         */
        this._normalize = 120;
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls
     *   should call preventdefault().
     *   (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools */ .S0.BackCompatCameraNoPreventDefault(arguments);
        this._wheel = (pointer) => {
            // sanity check - this should be a PointerWheel event.
            if (pointer.type !== _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes */ .Zp.POINTERWHEEL) {
                return;
            }
            const event = pointer.event;
            const platformScale = event.deltaMode === _Events_deviceInputEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .EventConstants */ .s.DOM_DELTA_LINE ? this._ffMultiplier : 1; // If this happens to be set to DOM_DELTA_LINE, adjust accordingly
            this._wheelDeltaX += (this.wheelPrecisionX * platformScale * event.deltaX) / this._normalize;
            this._wheelDeltaY -= (this.wheelPrecisionY * platformScale * event.deltaY) / this._normalize;
            this._wheelDeltaZ += (this.wheelPrecisionZ * platformScale * event.deltaZ) / this._normalize;
            if (event.preventDefault) {
                if (!noPreventDefault) {
                    event.preventDefault();
                }
            }
        };
        this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel, _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes */ .Zp.POINTERWHEEL);
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._observer) {
            this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer);
            this._observer = null;
            this._wheel = null;
        }
        if (this.onChangedObservable) {
            this.onChangedObservable.clear();
        }
    }
    /**
     * Called for each rendered frame.
     */
    checkInputs() {
        this.onChangedObservable.notifyObservers({
            wheelDeltaX: this._wheelDeltaX,
            wheelDeltaY: this._wheelDeltaY,
            wheelDeltaZ: this._wheelDeltaZ,
        });
        // Clear deltas.
        this._wheelDeltaX = 0;
        this._wheelDeltaY = 0;
        this._wheelDeltaZ = 0;
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "BaseCameraMouseWheelInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "mousewheel";
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseCameraMouseWheelInput.prototype, "wheelPrecisionX", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseCameraMouseWheelInput.prototype, "wheelPrecisionY", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseCameraMouseWheelInput.prototype, "wheelPrecisionZ", void 0);
//# sourceMappingURL=BaseCameraMouseWheelInput.js.map

/***/ }),

/***/ 23102:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   i: () => (/* binding */ FreeCameraKeyboardMoveInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22002);
/* harmony import */ var _Events_keyboardEvents_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24146);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79923);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(998);






/**
 * Manage the keyboard inputs to control the movement of a free camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FreeCameraKeyboardMoveInput {
    constructor() {
        /**
         * Gets or Set the list of keyboard keys used to control the forward move of the camera.
         */
        this.keysUp = [38];
        /**
         * Gets or Set the list of keyboard keys used to control the upward move of the camera.
         */
        this.keysUpward = [33];
        /**
         * Gets or Set the list of keyboard keys used to control the backward move of the camera.
         */
        this.keysDown = [40];
        /**
         * Gets or Set the list of keyboard keys used to control the downward move of the camera.
         */
        this.keysDownward = [34];
        /**
         * Gets or Set the list of keyboard keys used to control the left strafe move of the camera.
         */
        this.keysLeft = [37];
        /**
         * Gets or Set the list of keyboard keys used to control the right strafe move of the camera.
         */
        this.keysRight = [39];
        /**
         * Defines the pointer angular sensibility  along the X and Y axis or how fast is the camera rotating.
         */
        this.rotationSpeed = 0.5;
        /**
         * Gets or Set the list of keyboard keys used to control the left rotation move of the camera.
         */
        this.keysRotateLeft = [];
        /**
         * Gets or Set the list of keyboard keys used to control the right rotation move of the camera.
         */
        this.keysRotateRight = [];
        /**
         * Gets or Set the list of keyboard keys used to control the up rotation move of the camera.
         */
        this.keysRotateUp = [];
        /**
         * Gets or Set the list of keyboard keys used to control the down rotation move of the camera.
         */
        this.keysRotateDown = [];
        this._keys = new Array();
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools */ .S0.BackCompatCameraNoPreventDefault(arguments);
        if (this._onCanvasBlurObserver) {
            return;
        }
        this._scene = this.camera.getScene();
        this._engine = this._scene.getEngine();
        this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {
            this._keys.length = 0;
        });
        this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {
            const evt = info.event;
            if (!evt.metaKey) {
                if (info.type === _Events_keyboardEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .KeyboardEventTypes */ .TB.KEYDOWN) {
                    if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
                        this.keysDown.indexOf(evt.keyCode) !== -1 ||
                        this.keysLeft.indexOf(evt.keyCode) !== -1 ||
                        this.keysRight.indexOf(evt.keyCode) !== -1 ||
                        this.keysUpward.indexOf(evt.keyCode) !== -1 ||
                        this.keysDownward.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotateLeft.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotateRight.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotateUp.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotateDown.indexOf(evt.keyCode) !== -1) {
                        const index = this._keys.indexOf(evt.keyCode);
                        if (index === -1) {
                            this._keys.push(evt.keyCode);
                        }
                        if (!noPreventDefault) {
                            evt.preventDefault();
                        }
                    }
                }
                else {
                    if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
                        this.keysDown.indexOf(evt.keyCode) !== -1 ||
                        this.keysLeft.indexOf(evt.keyCode) !== -1 ||
                        this.keysRight.indexOf(evt.keyCode) !== -1 ||
                        this.keysUpward.indexOf(evt.keyCode) !== -1 ||
                        this.keysDownward.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotateLeft.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotateRight.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotateUp.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotateDown.indexOf(evt.keyCode) !== -1) {
                        const index = this._keys.indexOf(evt.keyCode);
                        if (index >= 0) {
                            this._keys.splice(index, 1);
                        }
                        if (!noPreventDefault) {
                            evt.preventDefault();
                        }
                    }
                }
            }
        });
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._scene) {
            if (this._onKeyboardObserver) {
                this._scene.onKeyboardObservable.remove(this._onKeyboardObserver);
            }
            if (this._onCanvasBlurObserver) {
                this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver);
            }
            this._onKeyboardObserver = null;
            this._onCanvasBlurObserver = null;
        }
        this._keys.length = 0;
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (this._onKeyboardObserver) {
            const camera = this.camera;
            // Keyboard
            for (let index = 0; index < this._keys.length; index++) {
                const keyCode = this._keys[index];
                const speed = camera._computeLocalCameraSpeed();
                if (this.keysLeft.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(-speed, 0, 0);
                }
                else if (this.keysUp.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, 0, speed);
                }
                else if (this.keysRight.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(speed, 0, 0);
                }
                else if (this.keysDown.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, 0, -speed);
                }
                else if (this.keysUpward.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, speed, 0);
                }
                else if (this.keysDownward.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, -speed, 0);
                }
                else if (this.keysRotateLeft.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, 0, 0);
                    camera.cameraRotation.y -= this._getLocalRotation();
                }
                else if (this.keysRotateRight.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, 0, 0);
                    camera.cameraRotation.y += this._getLocalRotation();
                }
                else if (this.keysRotateUp.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, 0, 0);
                    camera.cameraRotation.x -= this._getLocalRotation();
                }
                else if (this.keysRotateDown.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, 0, 0);
                    camera.cameraRotation.x += this._getLocalRotation();
                }
                if (camera.getScene().useRightHandedSystem) {
                    camera._localDirection.z *= -1;
                }
                camera.getViewMatrix().invertToRef(camera._cameraTransformMatrix);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformNormalToRef(camera._localDirection, camera._cameraTransformMatrix, camera._transformedDirection);
                camera.cameraDirection.addInPlace(camera._transformedDirection);
            }
        }
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FreeCameraKeyboardMoveInput";
    }
    /** @internal */
    _onLostFocus() {
        this._keys.length = 0;
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "keyboard";
    }
    _getLocalRotation() {
        const handednessMultiplier = this.camera._calculateHandednessMultiplier();
        const rotation = ((this.rotationSpeed * this._engine.getDeltaTime()) / 1000) * handednessMultiplier;
        return rotation;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysUp", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysUpward", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysDown", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysDownward", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysLeft", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysRight", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "rotationSpeed", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysRotateLeft", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysRotateRight", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysRotateUp", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraKeyboardMoveInput.prototype, "keysRotateDown", void 0);
_Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__/* .CameraInputTypes */ .H["FreeCameraKeyboardMoveInput"] = FreeCameraKeyboardMoveInput;
//# sourceMappingURL=freeCameraKeyboardMoveInput.js.map

/***/ }),

/***/ 12901:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   h: () => (/* binding */ FreeCameraMouseInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79259);
/* harmony import */ var _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22002);
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66240);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(998);






/**
 * Manage the mouse inputs to control the movement of a free camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FreeCameraMouseInput {
    /**
     * Manage the mouse inputs to control the movement of a free camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
     * @param touchEnabled Defines if touch is enabled or not
     */
    constructor(
    /**
     * [true] Define if touch is enabled in the mouse input
     */
    touchEnabled = true) {
        this.touchEnabled = touchEnabled;
        /**
         * Defines the buttons associated with the input to handle camera move.
         */
        this.buttons = [0, 1, 2];
        /**
         * Defines the pointer angular sensibility  along the X and Y axis or how fast is the camera rotating.
         */
        this.angularSensibility = 2000.0;
        this._previousPosition = null;
        /**
         * Observable for when a pointer move event occurs containing the move offset
         */
        this.onPointerMovedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * @internal
         * If the camera should be rotated automatically based on pointer movement
         */
        this._allowCameraRotation = true;
        this._currentActiveButton = -1;
        this._activePointerId = -1;
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools */ .S0.BackCompatCameraNoPreventDefault(arguments);
        const engine = this.camera.getEngine();
        const element = engine.getInputElement();
        if (!this._pointerInput) {
            this._pointerInput = (p) => {
                const evt = p.event;
                const isTouch = evt.pointerType === "touch";
                if (!this.touchEnabled && isTouch) {
                    return;
                }
                if (p.type !== _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERMOVE && this.buttons.indexOf(evt.button) === -1) {
                    return;
                }
                const srcElement = evt.target;
                if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERDOWN) {
                    // If the input is touch with more than one touch OR if the input is mouse and there is already an active button, return
                    if ((isTouch && this._activePointerId !== -1) || (!isTouch && this._currentActiveButton !== -1)) {
                        return;
                    }
                    this._activePointerId = evt.pointerId;
                    try {
                        srcElement?.setPointerCapture(evt.pointerId);
                    }
                    catch (e) {
                        //Nothing to do with the error. Execution will continue.
                    }
                    if (this._currentActiveButton === -1) {
                        this._currentActiveButton = evt.button;
                    }
                    this._previousPosition = {
                        x: evt.clientX,
                        y: evt.clientY,
                    };
                    if (!noPreventDefault) {
                        evt.preventDefault();
                        element && element.focus();
                    }
                    // This is required to move while pointer button is down
                    if (engine.isPointerLock && this._onMouseMove) {
                        this._onMouseMove(p.event);
                    }
                }
                else if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERUP) {
                    // If input is touch with a different touch id OR if input is mouse with a different button, return
                    if ((isTouch && this._activePointerId !== evt.pointerId) || (!isTouch && this._currentActiveButton !== evt.button)) {
                        return;
                    }
                    try {
                        srcElement?.releasePointerCapture(evt.pointerId);
                    }
                    catch (e) {
                        //Nothing to do with the error.
                    }
                    this._currentActiveButton = -1;
                    this._previousPosition = null;
                    if (!noPreventDefault) {
                        evt.preventDefault();
                    }
                    this._activePointerId = -1;
                }
                else if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERMOVE && (this._activePointerId === evt.pointerId || !isTouch)) {
                    if (engine.isPointerLock && this._onMouseMove) {
                        this._onMouseMove(p.event);
                    }
                    else if (this._previousPosition) {
                        const handednessMultiplier = this.camera._calculateHandednessMultiplier();
                        const offsetX = (evt.clientX - this._previousPosition.x) * handednessMultiplier;
                        const offsetY = evt.clientY - this._previousPosition.y;
                        if (this._allowCameraRotation) {
                            this.camera.cameraRotation.y += offsetX / this.angularSensibility;
                            this.camera.cameraRotation.x += offsetY / this.angularSensibility;
                        }
                        this.onPointerMovedObservable.notifyObservers({ offsetX: offsetX, offsetY: offsetY });
                        this._previousPosition = {
                            x: evt.clientX,
                            y: evt.clientY,
                        };
                        if (!noPreventDefault) {
                            evt.preventDefault();
                        }
                    }
                }
            };
        }
        this._onMouseMove = (evt) => {
            if (!engine.isPointerLock) {
                return;
            }
            const handednessMultiplier = this.camera._calculateHandednessMultiplier();
            const offsetX = evt.movementX * handednessMultiplier;
            this.camera.cameraRotation.y += offsetX / this.angularSensibility;
            const offsetY = evt.movementY;
            this.camera.cameraRotation.x += offsetY / this.angularSensibility;
            this._previousPosition = null;
            if (!noPreventDefault) {
                evt.preventDefault();
            }
        };
        this._observer = this.camera
            .getScene()
            ._inputManager._addCameraPointerObserver(this._pointerInput, _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERDOWN | _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERUP | _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERMOVE);
        if (element) {
            this._contextMenuBind = (evt) => this.onContextMenu(evt);
            element.addEventListener("contextmenu", this._contextMenuBind, false); // TODO: We need to figure out how to handle this for Native
        }
    }
    /**
     * Called on JS contextmenu event.
     * Override this method to provide functionality.
     * @param evt the context menu event
     */
    onContextMenu(evt) {
        evt.preventDefault();
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._observer) {
            this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer);
            if (this._contextMenuBind) {
                const engine = this.camera.getEngine();
                const element = engine.getInputElement();
                element && element.removeEventListener("contextmenu", this._contextMenuBind);
            }
            if (this.onPointerMovedObservable) {
                this.onPointerMovedObservable.clear();
            }
            this._observer = null;
            this._onMouseMove = null;
            this._previousPosition = null;
        }
        this._activePointerId = -1;
        this._currentActiveButton = -1;
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FreeCameraMouseInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "mouse";
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], FreeCameraMouseInput.prototype, "buttons", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], FreeCameraMouseInput.prototype, "angularSensibility", void 0);
_Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_3__/* .CameraInputTypes */ .H["FreeCameraMouseInput"] = FreeCameraMouseInput;
//# sourceMappingURL=freeCameraMouseInput.js.map

/***/ }),

/***/ 11984:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   m: () => (/* binding */ FreeCameraMouseWheelInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22002);
/* harmony import */ var _Cameras_Inputs_BaseCameraMouseWheelInput_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(54973);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79923);





// eslint-disable-next-line @typescript-eslint/naming-convention
var _CameraProperty;
(function (_CameraProperty) {
    _CameraProperty[_CameraProperty["MoveRelative"] = 0] = "MoveRelative";
    _CameraProperty[_CameraProperty["RotateRelative"] = 1] = "RotateRelative";
    _CameraProperty[_CameraProperty["MoveScene"] = 2] = "MoveScene";
})(_CameraProperty || (_CameraProperty = {}));
/**
 * Manage the mouse wheel inputs to control a free camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FreeCameraMouseWheelInput extends _Cameras_Inputs_BaseCameraMouseWheelInput_js__WEBPACK_IMPORTED_MODULE_3__/* .BaseCameraMouseWheelInput */ .l {
    constructor() {
        super(...arguments);
        this._moveRelative = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        this._rotateRelative = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        this._moveScene = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        /**
         * These are set to the desired default behaviour.
         */
        this._wheelXAction = _CameraProperty.MoveRelative;
        this._wheelXActionCoordinate = 0 /* Coordinate.X */;
        this._wheelYAction = _CameraProperty.MoveRelative;
        this._wheelYActionCoordinate = 2 /* Coordinate.Z */;
        this._wheelZAction = null;
        this._wheelZActionCoordinate = null;
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FreeCameraMouseWheelInput";
    }
    /**
     * Set which movement axis (relative to camera's orientation) the mouse
     * wheel's X axis controls.
     * @param axis The axis to be moved. Set null to clear.
     */
    set wheelXMoveRelative(axis) {
        if (axis === null && this._wheelXAction !== _CameraProperty.MoveRelative) {
            // Attempting to clear different _wheelXAction.
            return;
        }
        this._wheelXAction = _CameraProperty.MoveRelative;
        this._wheelXActionCoordinate = axis;
    }
    /**
     * Get the configured movement axis (relative to camera's orientation) the
     * mouse wheel's X axis controls.
     * @returns The configured axis or null if none.
     */
    get wheelXMoveRelative() {
        if (this._wheelXAction !== _CameraProperty.MoveRelative) {
            return null;
        }
        return this._wheelXActionCoordinate;
    }
    /**
     * Set which movement axis (relative to camera's orientation) the mouse
     * wheel's Y axis controls.
     * @param axis The axis to be moved. Set null to clear.
     */
    set wheelYMoveRelative(axis) {
        if (axis === null && this._wheelYAction !== _CameraProperty.MoveRelative) {
            // Attempting to clear different _wheelYAction.
            return;
        }
        this._wheelYAction = _CameraProperty.MoveRelative;
        this._wheelYActionCoordinate = axis;
    }
    /**
     * Get the configured movement axis (relative to camera's orientation) the
     * mouse wheel's Y axis controls.
     * @returns The configured axis or null if none.
     */
    get wheelYMoveRelative() {
        if (this._wheelYAction !== _CameraProperty.MoveRelative) {
            return null;
        }
        return this._wheelYActionCoordinate;
    }
    /**
     * Set which movement axis (relative to camera's orientation) the mouse
     * wheel's Z axis controls.
     * @param axis The axis to be moved. Set null to clear.
     */
    set wheelZMoveRelative(axis) {
        if (axis === null && this._wheelZAction !== _CameraProperty.MoveRelative) {
            // Attempting to clear different _wheelZAction.
            return;
        }
        this._wheelZAction = _CameraProperty.MoveRelative;
        this._wheelZActionCoordinate = axis;
    }
    /**
     * Get the configured movement axis (relative to camera's orientation) the
     * mouse wheel's Z axis controls.
     * @returns The configured axis or null if none.
     */
    get wheelZMoveRelative() {
        if (this._wheelZAction !== _CameraProperty.MoveRelative) {
            return null;
        }
        return this._wheelZActionCoordinate;
    }
    /**
     * Set which rotation axis (relative to camera's orientation) the mouse
     * wheel's X axis controls.
     * @param axis The axis to be moved. Set null to clear.
     */
    set wheelXRotateRelative(axis) {
        if (axis === null && this._wheelXAction !== _CameraProperty.RotateRelative) {
            // Attempting to clear different _wheelXAction.
            return;
        }
        this._wheelXAction = _CameraProperty.RotateRelative;
        this._wheelXActionCoordinate = axis;
    }
    /**
     * Get the configured rotation axis (relative to camera's orientation) the
     * mouse wheel's X axis controls.
     * @returns The configured axis or null if none.
     */
    get wheelXRotateRelative() {
        if (this._wheelXAction !== _CameraProperty.RotateRelative) {
            return null;
        }
        return this._wheelXActionCoordinate;
    }
    /**
     * Set which rotation axis (relative to camera's orientation) the mouse
     * wheel's Y axis controls.
     * @param axis The axis to be moved. Set null to clear.
     */
    set wheelYRotateRelative(axis) {
        if (axis === null && this._wheelYAction !== _CameraProperty.RotateRelative) {
            // Attempting to clear different _wheelYAction.
            return;
        }
        this._wheelYAction = _CameraProperty.RotateRelative;
        this._wheelYActionCoordinate = axis;
    }
    /**
     * Get the configured rotation axis (relative to camera's orientation) the
     * mouse wheel's Y axis controls.
     * @returns The configured axis or null if none.
     */
    get wheelYRotateRelative() {
        if (this._wheelYAction !== _CameraProperty.RotateRelative) {
            return null;
        }
        return this._wheelYActionCoordinate;
    }
    /**
     * Set which rotation axis (relative to camera's orientation) the mouse
     * wheel's Z axis controls.
     * @param axis The axis to be moved. Set null to clear.
     */
    set wheelZRotateRelative(axis) {
        if (axis === null && this._wheelZAction !== _CameraProperty.RotateRelative) {
            // Attempting to clear different _wheelZAction.
            return;
        }
        this._wheelZAction = _CameraProperty.RotateRelative;
        this._wheelZActionCoordinate = axis;
    }
    /**
     * Get the configured rotation axis (relative to camera's orientation) the
     * mouse wheel's Z axis controls.
     * @returns The configured axis or null if none.
     */
    get wheelZRotateRelative() {
        if (this._wheelZAction !== _CameraProperty.RotateRelative) {
            return null;
        }
        return this._wheelZActionCoordinate;
    }
    /**
     * Set which movement axis (relative to the scene) the mouse wheel's X axis
     * controls.
     * @param axis The axis to be moved. Set null to clear.
     */
    set wheelXMoveScene(axis) {
        if (axis === null && this._wheelXAction !== _CameraProperty.MoveScene) {
            // Attempting to clear different _wheelXAction.
            return;
        }
        this._wheelXAction = _CameraProperty.MoveScene;
        this._wheelXActionCoordinate = axis;
    }
    /**
     * Get the configured movement axis (relative to the scene) the mouse wheel's
     * X axis controls.
     * @returns The configured axis or null if none.
     */
    get wheelXMoveScene() {
        if (this._wheelXAction !== _CameraProperty.MoveScene) {
            return null;
        }
        return this._wheelXActionCoordinate;
    }
    /**
     * Set which movement axis (relative to the scene) the mouse wheel's Y axis
     * controls.
     * @param axis The axis to be moved. Set null to clear.
     */
    set wheelYMoveScene(axis) {
        if (axis === null && this._wheelYAction !== _CameraProperty.MoveScene) {
            // Attempting to clear different _wheelYAction.
            return;
        }
        this._wheelYAction = _CameraProperty.MoveScene;
        this._wheelYActionCoordinate = axis;
    }
    /**
     * Get the configured movement axis (relative to the scene) the mouse wheel's
     * Y axis controls.
     * @returns The configured axis or null if none.
     */
    get wheelYMoveScene() {
        if (this._wheelYAction !== _CameraProperty.MoveScene) {
            return null;
        }
        return this._wheelYActionCoordinate;
    }
    /**
     * Set which movement axis (relative to the scene) the mouse wheel's Z axis
     * controls.
     * @param axis The axis to be moved. Set null to clear.
     */
    set wheelZMoveScene(axis) {
        if (axis === null && this._wheelZAction !== _CameraProperty.MoveScene) {
            // Attempting to clear different _wheelZAction.
            return;
        }
        this._wheelZAction = _CameraProperty.MoveScene;
        this._wheelZActionCoordinate = axis;
    }
    /**
     * Get the configured movement axis (relative to the scene) the mouse wheel's
     * Z axis controls.
     * @returns The configured axis or null if none.
     */
    get wheelZMoveScene() {
        if (this._wheelZAction !== _CameraProperty.MoveScene) {
            return null;
        }
        return this._wheelZActionCoordinate;
    }
    /**
     * Called for each rendered frame.
     */
    checkInputs() {
        if (this._wheelDeltaX === 0 && this._wheelDeltaY === 0 && this._wheelDeltaZ == 0) {
            return;
        }
        // Clear the camera properties that we might be updating.
        this._moveRelative.setAll(0);
        this._rotateRelative.setAll(0);
        this._moveScene.setAll(0);
        // Set the camera properties that are to be updated.
        this._updateCamera();
        if (this.camera.getScene().useRightHandedSystem) {
            // TODO: Does this need done for worldUpdate too?
            this._moveRelative.z *= -1;
        }
        // Convert updates relative to camera to world position update.
        const cameraTransformMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Zero();
        this.camera.getViewMatrix().invertToRef(cameraTransformMatrix);
        const transformedDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformNormalToRef(this._moveRelative, cameraTransformMatrix, transformedDirection);
        // Apply updates to camera position.
        this.camera.cameraRotation.x += this._rotateRelative.x / 200;
        this.camera.cameraRotation.y += this._rotateRelative.y / 200;
        this.camera.cameraDirection.addInPlace(transformedDirection);
        this.camera.cameraDirection.addInPlace(this._moveScene);
        // Call the base class implementation to handle observers and do cleanup.
        super.checkInputs();
    }
    /**
     * Update the camera according to any configured properties for the 3
     * mouse-wheel axis.
     */
    _updateCamera() {
        // Do the camera updates for each of the 3 touch-wheel axis.
        this._updateCameraProperty(this._wheelDeltaX, this._wheelXAction, this._wheelXActionCoordinate);
        this._updateCameraProperty(this._wheelDeltaY, this._wheelYAction, this._wheelYActionCoordinate);
        this._updateCameraProperty(this._wheelDeltaZ, this._wheelZAction, this._wheelZActionCoordinate);
    }
    /**
     * Update one property of the camera.
     * @param value
     * @param cameraProperty
     * @param coordinate
     */
    _updateCameraProperty(
    /* Mouse-wheel delta. */
    value, 
    /* Camera property to be changed. */
    cameraProperty, 
    /* Axis of Camera property to be changed. */
    coordinate) {
        if (value === 0) {
            // Mouse wheel has not moved.
            return;
        }
        if (cameraProperty === null || coordinate === null) {
            // Mouse wheel axis not configured.
            return;
        }
        let action = null;
        switch (cameraProperty) {
            case _CameraProperty.MoveRelative:
                action = this._moveRelative;
                break;
            case _CameraProperty.RotateRelative:
                action = this._rotateRelative;
                break;
            case _CameraProperty.MoveScene:
                action = this._moveScene;
                break;
        }
        switch (coordinate) {
            case 0 /* Coordinate.X */:
                action.set(value, 0, 0);
                break;
            case 1 /* Coordinate.Y */:
                action.set(0, value, 0);
                break;
            case 2 /* Coordinate.Z */:
                action.set(0, 0, value);
                break;
        }
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraMouseWheelInput.prototype, "wheelXMoveRelative", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraMouseWheelInput.prototype, "wheelYMoveRelative", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraMouseWheelInput.prototype, "wheelZMoveRelative", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraMouseWheelInput.prototype, "wheelXRotateRelative", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraMouseWheelInput.prototype, "wheelYRotateRelative", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraMouseWheelInput.prototype, "wheelZRotateRelative", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraMouseWheelInput.prototype, "wheelXMoveScene", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraMouseWheelInput.prototype, "wheelYMoveScene", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraMouseWheelInput.prototype, "wheelZMoveScene", null);
_Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__/* .CameraInputTypes */ .H["FreeCameraMouseWheelInput"] = FreeCameraMouseWheelInput;
//# sourceMappingURL=freeCameraMouseWheelInput.js.map

/***/ }),

/***/ 5305:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (/* binding */ FreeCameraTouchInput)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22002);
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66240);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79923);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(998);






/**
 * Manage the touch inputs to control the movement of a free camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FreeCameraTouchInput {
    /**
     * Manage the touch inputs to control the movement of a free camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
     * @param allowMouse Defines if mouse events can be treated as touch events
     */
    constructor(
    /**
     * [false] Define if mouse events can be treated as touch events
     */
    allowMouse = false) {
        this.allowMouse = allowMouse;
        /**
         * Defines the touch sensibility for rotation.
         * The lower the faster.
         */
        this.touchAngularSensibility = 200000.0;
        /**
         * Defines the touch sensibility for move.
         * The lower the faster.
         */
        this.touchMoveSensibility = 250.0;
        /**
         * Swap touch actions so that one touch is used for rotation and multiple for movement
         */
        this.singleFingerRotate = false;
        this._offsetX = null;
        this._offsetY = null;
        this._pointerPressed = new Array();
        this._isSafari = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools */ .S0.IsSafari();
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools */ .S0.BackCompatCameraNoPreventDefault(arguments);
        let previousPosition = null;
        if (this._pointerInput === undefined) {
            this._onLostFocus = () => {
                this._offsetX = null;
                this._offsetY = null;
            };
            this._pointerInput = (p) => {
                const evt = p.event;
                const isMouseEvent = evt.pointerType === "mouse" || (this._isSafari && typeof evt.pointerType === "undefined");
                if (!this.allowMouse && isMouseEvent) {
                    return;
                }
                if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes */ .Zp.POINTERDOWN) {
                    if (!noPreventDefault) {
                        evt.preventDefault();
                    }
                    this._pointerPressed.push(evt.pointerId);
                    if (this._pointerPressed.length !== 1) {
                        return;
                    }
                    previousPosition = {
                        x: evt.clientX,
                        y: evt.clientY,
                    };
                }
                else if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes */ .Zp.POINTERUP) {
                    if (!noPreventDefault) {
                        evt.preventDefault();
                    }
                    const index = this._pointerPressed.indexOf(evt.pointerId);
                    if (index === -1) {
                        return;
                    }
                    this._pointerPressed.splice(index, 1);
                    if (index != 0) {
                        return;
                    }
                    previousPosition = null;
                    this._offsetX = null;
                    this._offsetY = null;
                }
                else if (p.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes */ .Zp.POINTERMOVE) {
                    if (!noPreventDefault) {
                        evt.preventDefault();
                    }
                    if (!previousPosition) {
                        return;
                    }
                    const index = this._pointerPressed.indexOf(evt.pointerId);
                    if (index != 0) {
                        return;
                    }
                    this._offsetX = evt.clientX - previousPosition.x;
                    this._offsetY = -(evt.clientY - previousPosition.y);
                }
            };
        }
        this._observer = this.camera
            .getScene()
            ._inputManager._addCameraPointerObserver(this._pointerInput, _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes */ .Zp.POINTERDOWN | _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes */ .Zp.POINTERUP | _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_3__/* .PointerEventTypes */ .Zp.POINTERMOVE);
        if (this._onLostFocus) {
            const engine = this.camera.getEngine();
            const element = engine.getInputElement();
            element && element.addEventListener("blur", this._onLostFocus);
        }
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._pointerInput) {
            if (this._observer) {
                this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer);
                this._observer = null;
            }
            if (this._onLostFocus) {
                const engine = this.camera.getEngine();
                const element = engine.getInputElement();
                element && element.removeEventListener("blur", this._onLostFocus);
                this._onLostFocus = null;
            }
            this._pointerPressed.length = 0;
            this._offsetX = null;
            this._offsetY = null;
        }
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (this._offsetX === null || this._offsetY === null) {
            return;
        }
        if (this._offsetX === 0 && this._offsetY === 0) {
            return;
        }
        const camera = this.camera;
        const handednessMultiplier = camera._calculateHandednessMultiplier();
        camera.cameraRotation.y = (handednessMultiplier * this._offsetX) / this.touchAngularSensibility;
        const rotateCamera = (this.singleFingerRotate && this._pointerPressed.length === 1) || (!this.singleFingerRotate && this._pointerPressed.length > 1);
        if (rotateCamera) {
            camera.cameraRotation.x = -this._offsetY / this.touchAngularSensibility;
        }
        else {
            const speed = camera._computeLocalCameraSpeed();
            const direction = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq(0, 0, this.touchMoveSensibility !== 0 ? (speed * this._offsetY) / this.touchMoveSensibility : 0);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.RotationYawPitchRollToRef(camera.rotation.y, camera.rotation.x, 0, camera._cameraRotationMatrix);
            camera.cameraDirection.addInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformCoordinates(direction, camera._cameraRotationMatrix));
        }
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FreeCameraTouchInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "touch";
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraTouchInput.prototype, "touchAngularSensibility", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCameraTouchInput.prototype, "touchMoveSensibility", void 0);
_Cameras_cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_2__/* .CameraInputTypes */ .H["FreeCameraTouchInput"] = FreeCameraTouchInput;
//# sourceMappingURL=freeCameraTouchInput.js.map

/***/ }),

/***/ 30388:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   i: () => (/* binding */ Camera)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17931);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(998);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79923);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4870);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(51137);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56552);
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(45503);
/* harmony import */ var _Maths_math_viewport_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(54494);
/* harmony import */ var _Maths_math_frustum_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(22572);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(26877);














/**
 * This is the base class of all the camera used in the application.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
 */
class Camera extends _node_js__WEBPACK_IMPORTED_MODULE_6__/* .Node */ .b {
    /**
     * Define the current local position of the camera in the scene
     */
    get position() {
        return this._position;
    }
    set position(newPosition) {
        this._position = newPosition;
    }
    /**
     * The vector the camera should consider as up.
     * (default is Vector3(0, 1, 0) aka Vector3.Up())
     */
    set upVector(vec) {
        this._upVector = vec;
    }
    get upVector() {
        return this._upVector;
    }
    /**
     * The screen area in scene units squared
     */
    get screenArea() {
        let x = 0;
        let y = 0;
        if (this.mode === Camera.PERSPECTIVE_CAMERA) {
            if (this.fovMode === Camera.FOVMODE_VERTICAL_FIXED) {
                y = this.minZ * 2 * Math.tan(this.fov / 2);
                x = this.getEngine().getAspectRatio(this) * y;
            }
            else {
                x = this.minZ * 2 * Math.tan(this.fov / 2);
                y = x / this.getEngine().getAspectRatio(this);
            }
        }
        else {
            const halfWidth = this.getEngine().getRenderWidth() / 2.0;
            const halfHeight = this.getEngine().getRenderHeight() / 2.0;
            x = (this.orthoRight ?? halfWidth) - (this.orthoLeft ?? -halfWidth);
            y = (this.orthoTop ?? halfHeight) - (this.orthoBottom ?? -halfHeight);
        }
        return x * y;
    }
    /**
     * Define the current limit on the left side for an orthographic camera
     * In scene unit
     */
    set orthoLeft(value) {
        this._orthoLeft = value;
        for (const rigCamera of this._rigCameras) {
            rigCamera.orthoLeft = value;
        }
    }
    get orthoLeft() {
        return this._orthoLeft;
    }
    /**
     * Define the current limit on the right side for an orthographic camera
     * In scene unit
     */
    set orthoRight(value) {
        this._orthoRight = value;
        for (const rigCamera of this._rigCameras) {
            rigCamera.orthoRight = value;
        }
    }
    get orthoRight() {
        return this._orthoRight;
    }
    /**
     * Define the current limit on the bottom side for an orthographic camera
     * In scene unit
     */
    set orthoBottom(value) {
        this._orthoBottom = value;
        for (const rigCamera of this._rigCameras) {
            rigCamera.orthoBottom = value;
        }
    }
    get orthoBottom() {
        return this._orthoBottom;
    }
    /**
     * Define the current limit on the top side for an orthographic camera
     * In scene unit
     */
    set orthoTop(value) {
        this._orthoTop = value;
        for (const rigCamera of this._rigCameras) {
            rigCamera.orthoTop = value;
        }
    }
    get orthoTop() {
        return this._orthoTop;
    }
    /**
     * Define the mode of the camera (Camera.PERSPECTIVE_CAMERA or Camera.ORTHOGRAPHIC_CAMERA)
     */
    set mode(mode) {
        this._mode = mode;
        // Pass the mode down to the rig cameras
        for (const rigCamera of this._rigCameras) {
            rigCamera.mode = mode;
        }
    }
    get mode() {
        return this._mode;
    }
    /**
     * Gets a flag indicating that the camera has moved in some way since the last call to Camera.update()
     */
    get hasMoved() {
        return this._hasMoved;
    }
    /**
     * Instantiates a new camera object.
     * This should not be used directly but through the inherited cameras: ArcRotate, Free...
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
     * @param name Defines the name of the camera in the scene
     * @param position Defines the position of the camera
     * @param scene Defines the scene the camera belongs too
     * @param setActiveOnSceneIfNoneActive Defines if the camera should be set as active after creation if no other camera have been defined in the scene
     */
    constructor(name, position, scene, setActiveOnSceneIfNoneActive = true) {
        super(name, scene, false);
        /** @internal */
        this._position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq.Zero();
        this._upVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq.Up();
        /**
         * Object containing oblique projection values (only used with ORTHOGRAPHIC_CAMERA)
         */
        this.oblique = null;
        this._orthoLeft = null;
        this._orthoRight = null;
        this._orthoBottom = null;
        this._orthoTop = null;
        /**
         * Field Of View is set in Radians. (default is 0.8)
         */
        this.fov = 0.8;
        /**
         * Projection plane tilt around the X axis (horizontal), set in Radians. (default is 0)
         * Can be used to make vertical lines in world space actually vertical on the screen.
         * See https://forum.babylonjs.com/t/add-vertical-shift-to-3ds-max-exporter-babylon-cameras/17480
         */
        this.projectionPlaneTilt = 0;
        /**
         * Define the minimum distance the camera can see from.
         * This is important to note that the depth buffer are not infinite and the closer it starts
         * the more your scene might encounter depth fighting issue.
         */
        this.minZ = 1;
        /**
         * Define the maximum distance the camera can see to.
         * This is important to note that the depth buffer are not infinite and the further it end
         * the more your scene might encounter depth fighting issue.
         */
        this.maxZ = 10000.0;
        /**
         * Define the default inertia of the camera.
         * This helps giving a smooth feeling to the camera movement.
         */
        this.inertia = 0.9;
        this._mode = Camera.PERSPECTIVE_CAMERA;
        /**
         * Define whether the camera is intermediate.
         * This is useful to not present the output directly to the screen in case of rig without post process for instance
         */
        this.isIntermediate = false;
        /**
         * Define the viewport of the camera.
         * This correspond to the portion of the screen the camera will render to in normalized 0 to 1 unit.
         */
        this.viewport = new _Maths_math_viewport_js__WEBPACK_IMPORTED_MODULE_10__/* .Viewport */ .L(0, 0, 1.0, 1.0);
        /**
         * Restricts the camera to viewing objects with the same layerMask.
         * A camera with a layerMask of 1 will render mesh.layerMask & camera.layerMask!== 0
         */
        this.layerMask = 0x0fffffff;
        /**
         * fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED)
         */
        this.fovMode = Camera.FOVMODE_VERTICAL_FIXED;
        /**
         * Rig mode of the camera.
         * This is useful to create the camera with two "eyes" instead of one to create VR or stereoscopic scenes.
         * This is normally controlled byt the camera themselves as internal use.
         */
        this.cameraRigMode = Camera.RIG_MODE_NONE;
        /**
         * Defines the list of custom render target which are rendered to and then used as the input to this camera's render. Eg. display another camera view on a TV in the main scene
         * This is pretty helpful if you wish to make a camera render to a texture you could reuse somewhere
         * else in the scene. (Eg. security camera)
         *
         * To change the final output target of the camera, camera.outputRenderTarget should be used instead (eg. webXR renders to a render target corresponding to an HMD)
         */
        this.customRenderTargets = [];
        /**
         * When set, the camera will render to this render target instead of the default canvas
         *
         * If the desire is to use the output of a camera as a texture in the scene consider using camera.customRenderTargets instead
         */
        this.outputRenderTarget = null;
        /**
         * Observable triggered when the camera view matrix has changed.
         * Beware of reentrance! Some methods like Camera.getViewMatrix and Camera.getWorldMatrix can trigger the onViewMatrixChangedObservable
         * observable, so using them inside an observer will require additional logic to avoid a stack overflow error.
         */
        this.onViewMatrixChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__/* .Observable */ .cP();
        /**
         * Observable triggered when the camera Projection matrix has changed.
         */
        this.onProjectionMatrixChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__/* .Observable */ .cP();
        /**
         * Observable triggered when the inputs have been processed.
         */
        this.onAfterCheckInputsObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__/* .Observable */ .cP();
        /**
         * Observable triggered when reset has been called and applied to the camera.
         */
        this.onRestoreStateObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__/* .Observable */ .cP();
        /**
         * Is this camera a part of a rig system?
         */
        this.isRigCamera = false;
        this._hasMoved = false;
        /** @internal */
        this._rigCameras = new Array();
        /** @internal */
        this._skipRendering = false;
        /** @internal */
        this._projectionMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq();
        /** @internal */
        this._postProcesses = new Array();
        /** @internal */
        this._activeMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_2__/* .SmartArray */ .L(256);
        this._globalPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq.Zero();
        /** @internal */
        this._computedViewMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.Identity();
        this._doNotComputeProjectionMatrix = false;
        this._transformMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.Zero();
        this._refreshFrustumPlanes = true;
        this._absoluteRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Quaternion */ .PT.Identity();
        /** @internal */
        this._isCamera = true;
        /** @internal */
        this._isLeftCamera = false;
        /** @internal */
        this._isRightCamera = false;
        this.getScene().addCamera(this);
        if (setActiveOnSceneIfNoneActive && !this.getScene().activeCamera) {
            this.getScene().activeCamera = this;
        }
        this.position = position;
        this.renderPassId = this.getScene().getEngine().createRenderPassId(`Camera ${name}`);
    }
    /**
     * Store current camera state (fov, position, etc..)
     * @returns the camera
     */
    storeState() {
        this._stateStored = true;
        this._storedFov = this.fov;
        return this;
    }
    /**
     * Returns true if a state has been stored by calling storeState method.
     * @returns true if state has been stored.
     */
    hasStateStored() {
        return !!this._stateStored;
    }
    /**
     * Restores the camera state values if it has been stored. You must call storeState() first
     * @returns true if restored and false otherwise
     */
    _restoreStateValues() {
        if (!this._stateStored) {
            return false;
        }
        this.fov = this._storedFov;
        return true;
    }
    /**
     * Restored camera state. You must call storeState() first.
     * @returns true if restored and false otherwise
     */
    restoreState() {
        if (this._restoreStateValues()) {
            this.onRestoreStateObservable.notifyObservers(this);
            return true;
        }
        return false;
    }
    /**
     * Gets the class name of the camera.
     * @returns the class name
     */
    getClassName() {
        return "Camera";
    }
    /**
     * Gets a string representation of the camera useful for debug purpose.
     * @param fullDetails Defines that a more verbose level of logging is required
     * @returns the string representation
     */
    toString(fullDetails) {
        let ret = "Name: " + this.name;
        ret += ", type: " + this.getClassName();
        if (this.animations) {
            for (let i = 0; i < this.animations.length; i++) {
                ret += ", animation[0]: " + this.animations[i].toString(fullDetails);
            }
        }
        return ret;
    }
    /**
     * Automatically tilts the projection plane, using `projectionPlaneTilt`, to correct the perspective effect on vertical lines.
     */
    applyVerticalCorrection() {
        const rot = this.absoluteRotation.toEulerAngles();
        this.projectionPlaneTilt = this._scene.useRightHandedSystem ? -rot.x : rot.x;
    }
    /**
     * Gets the current world space position of the camera.
     */
    get globalPosition() {
        return this._globalPosition;
    }
    /**
     * Gets the list of active meshes this frame (meshes no culled or excluded by lod s in the frame)
     * @returns the active meshe list
     */
    getActiveMeshes() {
        return this._activeMeshes;
    }
    /**
     * Check whether a mesh is part of the current active mesh list of the camera
     * @param mesh Defines the mesh to check
     * @returns true if active, false otherwise
     */
    isActiveMesh(mesh) {
        return this._activeMeshes.indexOf(mesh) !== -1;
    }
    /**
     * Is this camera ready to be used/rendered
     * @param completeCheck defines if a complete check (including post processes) has to be done (false by default)
     * @returns true if the camera is ready
     */
    isReady(completeCheck = false) {
        if (completeCheck) {
            for (const pp of this._postProcesses) {
                if (pp && !pp.isReady()) {
                    return false;
                }
            }
        }
        return super.isReady(completeCheck);
    }
    /** @internal */
    _initCache() {
        super._initCache();
        this._cache.position = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        this._cache.upVector = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        this._cache.mode = undefined;
        this._cache.minZ = undefined;
        this._cache.maxZ = undefined;
        this._cache.fov = undefined;
        this._cache.fovMode = undefined;
        this._cache.aspectRatio = undefined;
        this._cache.orthoLeft = undefined;
        this._cache.orthoRight = undefined;
        this._cache.orthoBottom = undefined;
        this._cache.orthoTop = undefined;
        this._cache.obliqueAngle = undefined;
        this._cache.obliqueLength = undefined;
        this._cache.obliqueOffset = undefined;
        this._cache.renderWidth = undefined;
        this._cache.renderHeight = undefined;
    }
    /**
     * @internal
     */
    _updateCache(ignoreParentClass) {
        if (!ignoreParentClass) {
            super._updateCache();
        }
        this._cache.position.copyFrom(this.position);
        this._cache.upVector.copyFrom(this.upVector);
    }
    /** @internal */
    _isSynchronized() {
        return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();
    }
    /** @internal */
    _isSynchronizedViewMatrix() {
        if (!super._isSynchronized()) {
            return false;
        }
        return this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent();
    }
    /** @internal */
    _isSynchronizedProjectionMatrix() {
        let isSynchronized = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;
        if (!isSynchronized) {
            return false;
        }
        const engine = this.getEngine();
        if (this.mode === Camera.PERSPECTIVE_CAMERA) {
            isSynchronized =
                this._cache.fov === this.fov &&
                    this._cache.fovMode === this.fovMode &&
                    this._cache.aspectRatio === engine.getAspectRatio(this) &&
                    this._cache.projectionPlaneTilt === this.projectionPlaneTilt;
        }
        else {
            isSynchronized =
                this._cache.orthoLeft === this.orthoLeft &&
                    this._cache.orthoRight === this.orthoRight &&
                    this._cache.orthoBottom === this.orthoBottom &&
                    this._cache.orthoTop === this.orthoTop &&
                    this._cache.renderWidth === engine.getRenderWidth() &&
                    this._cache.renderHeight === engine.getRenderHeight();
            if (this.oblique) {
                isSynchronized =
                    isSynchronized &&
                        this._cache.obliqueAngle === this.oblique.angle &&
                        this._cache.obliqueLength === this.oblique.length &&
                        this._cache.obliqueOffset === this.oblique.offset;
            }
        }
        return isSynchronized;
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * This function is here because typescript removes the typing of the last function.
     * @param _ignored defines an ignored parameter kept for backward compatibility.
     * @param _noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(_ignored, _noPreventDefault) { }
    /**
     * Detach the current controls from the specified dom element.
     * This function is here because typescript removes the typing of the last function.
     * @param _ignored defines an ignored parameter kept for backward compatibility.
     */
    detachControl(_ignored) { }
    /**
     * Update the camera state according to the different inputs gathered during the frame.
     */
    update() {
        this._hasMoved = false;
        this._checkInputs();
        if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
            this._updateRigCameras();
        }
        // Attempt to update the camera's view and projection matrices.
        // This call is being made because these matrices are no longer being updated
        // as a part of the picking ray process (in addition to scene.render).
        this.getViewMatrix();
        this.getProjectionMatrix();
    }
    /** @internal */
    _checkInputs() {
        this.onAfterCheckInputsObservable.notifyObservers(this);
    }
    /** @internal */
    get rigCameras() {
        return this._rigCameras;
    }
    /**
     * Gets the post process used by the rig cameras
     */
    get rigPostProcess() {
        return this._rigPostProcess;
    }
    /**
     * Internal, gets the first post process.
     * @returns the first post process to be run on this camera.
     */
    _getFirstPostProcess() {
        for (let ppIndex = 0; ppIndex < this._postProcesses.length; ppIndex++) {
            if (this._postProcesses[ppIndex] !== null) {
                return this._postProcesses[ppIndex];
            }
        }
        return null;
    }
    _cascadePostProcessesToRigCams() {
        // invalidate framebuffer
        const firstPostProcess = this._getFirstPostProcess();
        if (firstPostProcess) {
            firstPostProcess.markTextureDirty();
        }
        // glue the rigPostProcess to the end of the user postprocesses & assign to each sub-camera
        for (let i = 0, len = this._rigCameras.length; i < len; i++) {
            const cam = this._rigCameras[i];
            const rigPostProcess = cam._rigPostProcess;
            // for VR rig, there does not have to be a post process
            if (rigPostProcess) {
                const isPass = rigPostProcess.getEffectName() === "pass";
                if (isPass) {
                    // any rig which has a PassPostProcess for rig[0], cannot be isIntermediate when there are also user postProcesses
                    cam.isIntermediate = this._postProcesses.length === 0;
                }
                cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess);
                rigPostProcess.markTextureDirty();
            }
            else {
                cam._postProcesses = this._postProcesses.slice(0);
            }
        }
    }
    /**
     * Attach a post process to the camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess
     * @param postProcess The post process to attach to the camera
     * @param insertAt The position of the post process in case several of them are in use in the scene
     * @returns the position the post process has been inserted at
     */
    attachPostProcess(postProcess, insertAt = null) {
        if (!postProcess.isReusable() && this._postProcesses.indexOf(postProcess) > -1) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .Logger */ .V.Error("You're trying to reuse a post process not defined as reusable.");
            return 0;
        }
        if (insertAt == null || insertAt < 0) {
            this._postProcesses.push(postProcess);
        }
        else if (this._postProcesses[insertAt] === null) {
            this._postProcesses[insertAt] = postProcess;
        }
        else {
            this._postProcesses.splice(insertAt, 0, postProcess);
        }
        this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated
        // Update prePass
        if (this._scene.prePassRenderer) {
            this._scene.prePassRenderer.markAsDirty();
        }
        return this._postProcesses.indexOf(postProcess);
    }
    /**
     * Detach a post process to the camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess
     * @param postProcess The post process to detach from the camera
     */
    detachPostProcess(postProcess) {
        const idx = this._postProcesses.indexOf(postProcess);
        if (idx !== -1) {
            this._postProcesses[idx] = null;
        }
        // Update prePass
        if (this._scene.prePassRenderer) {
            this._scene.prePassRenderer.markAsDirty();
        }
        this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated
    }
    /**
     * Gets the current world matrix of the camera
     * @returns the world matrix
     */
    getWorldMatrix() {
        if (this._isSynchronizedViewMatrix()) {
            return this._worldMatrix;
        }
        // Getting the view matrix will also compute the world matrix.
        this.getViewMatrix();
        return this._worldMatrix;
    }
    /** @internal */
    _getViewMatrix() {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.Identity();
    }
    /**
     * Gets the current view matrix of the camera.
     * @param force forces the camera to recompute the matrix without looking at the cached state
     * @returns the view matrix
     */
    getViewMatrix(force) {
        if (!force && this._isSynchronizedViewMatrix()) {
            return this._computedViewMatrix;
        }
        this._hasMoved = true;
        this.updateCache();
        this._computedViewMatrix = this._getViewMatrix();
        this._currentRenderId = this.getScene().getRenderId();
        this._childUpdateId++;
        this._refreshFrustumPlanes = true;
        if (this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix) {
            this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix);
        }
        // Notify parent camera if rig camera is changed
        if (this.parent && this.parent.onViewMatrixChangedObservable) {
            this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent);
        }
        this.onViewMatrixChangedObservable.notifyObservers(this);
        this._computedViewMatrix.invertToRef(this._worldMatrix);
        return this._computedViewMatrix;
    }
    /**
     * Freeze the projection matrix.
     * It will prevent the cache check of the camera projection compute and can speed up perf
     * if no parameter of the camera are meant to change
     * @param projection Defines manually a projection if necessary
     */
    freezeProjectionMatrix(projection) {
        this._doNotComputeProjectionMatrix = true;
        if (projection !== undefined) {
            this._projectionMatrix = projection;
        }
    }
    /**
     * Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.
     */
    unfreezeProjectionMatrix() {
        this._doNotComputeProjectionMatrix = false;
    }
    /**
     * Gets the current projection matrix of the camera.
     * @param force forces the camera to recompute the matrix without looking at the cached state
     * @returns the projection matrix
     */
    getProjectionMatrix(force) {
        if (this._doNotComputeProjectionMatrix || (!force && this._isSynchronizedProjectionMatrix())) {
            return this._projectionMatrix;
        }
        // Cache
        this._cache.mode = this.mode;
        this._cache.minZ = this.minZ;
        this._cache.maxZ = this.maxZ;
        // Matrix
        this._refreshFrustumPlanes = true;
        const engine = this.getEngine();
        const scene = this.getScene();
        const reverseDepth = engine.useReverseDepthBuffer;
        if (this.mode === Camera.PERSPECTIVE_CAMERA) {
            this._cache.fov = this.fov;
            this._cache.fovMode = this.fovMode;
            this._cache.aspectRatio = engine.getAspectRatio(this);
            this._cache.projectionPlaneTilt = this.projectionPlaneTilt;
            if (this.minZ <= 0) {
                this.minZ = 0.1;
            }
            let getProjectionMatrix;
            if (scene.useRightHandedSystem) {
                getProjectionMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.PerspectiveFovRHToRef;
            }
            else {
                getProjectionMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.PerspectiveFovLHToRef;
            }
            getProjectionMatrix(this.fov, engine.getAspectRatio(this), reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED, engine.isNDCHalfZRange, this.projectionPlaneTilt, reverseDepth);
        }
        else {
            const halfWidth = engine.getRenderWidth() / 2.0;
            const halfHeight = engine.getRenderHeight() / 2.0;
            if (scene.useRightHandedSystem) {
                if (this.oblique) {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.ObliqueOffCenterRHToRef(this.orthoLeft ?? -halfWidth, this.orthoRight ?? halfWidth, this.orthoBottom ?? -halfHeight, this.orthoTop ?? halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this.oblique.length, this.oblique.angle, this._computeObliqueDistance(this.oblique.offset), this._projectionMatrix, engine.isNDCHalfZRange);
                }
                else {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.OrthoOffCenterRHToRef(this.orthoLeft ?? -halfWidth, this.orthoRight ?? halfWidth, this.orthoBottom ?? -halfHeight, this.orthoTop ?? halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, engine.isNDCHalfZRange);
                }
            }
            else {
                if (this.oblique) {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.ObliqueOffCenterLHToRef(this.orthoLeft ?? -halfWidth, this.orthoRight ?? halfWidth, this.orthoBottom ?? -halfHeight, this.orthoTop ?? halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this.oblique.length, this.oblique.angle, this._computeObliqueDistance(this.oblique.offset), this._projectionMatrix, engine.isNDCHalfZRange);
                }
                else {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.OrthoOffCenterLHToRef(this.orthoLeft ?? -halfWidth, this.orthoRight ?? halfWidth, this.orthoBottom ?? -halfHeight, this.orthoTop ?? halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, engine.isNDCHalfZRange);
                }
            }
            this._cache.orthoLeft = this.orthoLeft;
            this._cache.orthoRight = this.orthoRight;
            this._cache.orthoBottom = this.orthoBottom;
            this._cache.orthoTop = this.orthoTop;
            this._cache.obliqueAngle = this.oblique?.angle;
            this._cache.obliqueLength = this.oblique?.length;
            this._cache.obliqueOffset = this.oblique?.offset;
            this._cache.renderWidth = engine.getRenderWidth();
            this._cache.renderHeight = engine.getRenderHeight();
        }
        this.onProjectionMatrixChangedObservable.notifyObservers(this);
        return this._projectionMatrix;
    }
    /**
     * Gets the transformation matrix (ie. the multiplication of view by projection matrices)
     * @returns a Matrix
     */
    getTransformationMatrix() {
        this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);
        return this._transformMatrix;
    }
    _computeObliqueDistance(offset) {
        const arcRotateCamera = this;
        const targetCamera = this;
        return (arcRotateCamera.radius || (targetCamera.target ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq.Distance(this.position, targetCamera.target) : this.position.length())) + offset;
    }
    /** @internal */
    _updateFrustumPlanes() {
        if (!this._refreshFrustumPlanes) {
            return;
        }
        this.getTransformationMatrix();
        if (!this._frustumPlanes) {
            this._frustumPlanes = _Maths_math_frustum_js__WEBPACK_IMPORTED_MODULE_11__/* .Frustum */ .P.GetPlanes(this._transformMatrix);
        }
        else {
            _Maths_math_frustum_js__WEBPACK_IMPORTED_MODULE_11__/* .Frustum */ .P.GetPlanesToRef(this._transformMatrix, this._frustumPlanes);
        }
        this._refreshFrustumPlanes = false;
    }
    /**
     * Checks if a cullable object (mesh...) is in the camera frustum
     * This checks the bounding box center. See isCompletelyInFrustum for a full bounding check
     * @param target The object to check
     * @param checkRigCameras If the rig cameras should be checked (eg. with VR camera both eyes should be checked) (Default: false)
     * @returns true if the object is in frustum otherwise false
     */
    isInFrustum(target, checkRigCameras = false) {
        this._updateFrustumPlanes();
        if (checkRigCameras && this.rigCameras.length > 0) {
            let result = false;
            this.rigCameras.forEach((cam) => {
                cam._updateFrustumPlanes();
                result = result || target.isInFrustum(cam._frustumPlanes);
            });
            return result;
        }
        else {
            return target.isInFrustum(this._frustumPlanes);
        }
    }
    /**
     * Checks if a cullable object (mesh...) is in the camera frustum
     * Unlike isInFrustum this checks the full bounding box
     * @param target The object to check
     * @returns true if the object is in frustum otherwise false
     */
    isCompletelyInFrustum(target) {
        this._updateFrustumPlanes();
        return target.isCompletelyInFrustum(this._frustumPlanes);
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Gets a ray in the forward direction from the camera.
     * @param length Defines the length of the ray to create
     * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray
     * @param origin Defines the start point of the ray which defaults to the camera position
     * @returns the forward ray
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    getForwardRay(length = 100, transform, origin) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("Ray");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Gets a ray in the forward direction from the camera.
     * @param refRay the ray to (re)use when setting the values
     * @param length Defines the length of the ray to create
     * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray
     * @param origin Defines the start point of the ray which defaults to the camera position
     * @returns the forward ray
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    getForwardRayToRef(refRay, length = 100, transform, origin) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("Ray");
    }
    /**
     * Releases resources associated with this node.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        // Observables
        this.onViewMatrixChangedObservable.clear();
        this.onProjectionMatrixChangedObservable.clear();
        this.onAfterCheckInputsObservable.clear();
        this.onRestoreStateObservable.clear();
        // Inputs
        if (this.inputs) {
            this.inputs.clear();
        }
        // Animations
        this.getScene().stopAnimation(this);
        // Remove from scene
        this.getScene().removeCamera(this);
        while (this._rigCameras.length > 0) {
            const camera = this._rigCameras.pop();
            if (camera) {
                camera.dispose();
            }
        }
        if (this._parentContainer) {
            const index = this._parentContainer.cameras.indexOf(this);
            if (index > -1) {
                this._parentContainer.cameras.splice(index, 1);
            }
            this._parentContainer = null;
        }
        // Postprocesses
        if (this._rigPostProcess) {
            this._rigPostProcess.dispose(this);
            this._rigPostProcess = null;
            this._postProcesses.length = 0;
        }
        else if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
            this._rigPostProcess = null;
            this._postProcesses.length = 0;
        }
        else {
            let i = this._postProcesses.length;
            while (--i >= 0) {
                const postProcess = this._postProcesses[i];
                if (postProcess) {
                    postProcess.dispose(this);
                }
            }
        }
        // Render targets
        let i = this.customRenderTargets.length;
        while (--i >= 0) {
            this.customRenderTargets[i].dispose();
        }
        this.customRenderTargets.length = 0;
        // Active Meshes
        this._activeMeshes.dispose();
        this.getScene().getEngine().releaseRenderPassId(this.renderPassId);
        super.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
    /**
     * Gets the left camera of a rig setup in case of Rigged Camera
     */
    get isLeftCamera() {
        return this._isLeftCamera;
    }
    /**
     * Gets the right camera of a rig setup in case of Rigged Camera
     */
    get isRightCamera() {
        return this._isRightCamera;
    }
    /**
     * Gets the left camera of a rig setup in case of Rigged Camera
     */
    get leftCamera() {
        if (this._rigCameras.length < 1) {
            return null;
        }
        return this._rigCameras[0];
    }
    /**
     * Gets the right camera of a rig setup in case of Rigged Camera
     */
    get rightCamera() {
        if (this._rigCameras.length < 2) {
            return null;
        }
        return this._rigCameras[1];
    }
    /**
     * Gets the left camera target of a rig setup in case of Rigged Camera
     * @returns the target position
     */
    getLeftTarget() {
        if (this._rigCameras.length < 1) {
            return null;
        }
        return this._rigCameras[0].getTarget();
    }
    /**
     * Gets the right camera target of a rig setup in case of Rigged Camera
     * @returns the target position
     */
    getRightTarget() {
        if (this._rigCameras.length < 2) {
            return null;
        }
        return this._rigCameras[1].getTarget();
    }
    /**
     * @internal
     */
    setCameraRigMode(mode, rigParams) {
        if (this.cameraRigMode === mode) {
            return;
        }
        while (this._rigCameras.length > 0) {
            const camera = this._rigCameras.pop();
            if (camera) {
                camera.dispose();
            }
        }
        this.cameraRigMode = mode;
        this._cameraRigParams = {};
        //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target,
        //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced
        this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;
        this._cameraRigParams.stereoHalfAngle = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools */ .S0.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);
        // create the rig cameras, unless none
        if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
            const leftCamera = this.createRigCamera(this.name + "_L", 0);
            if (leftCamera) {
                leftCamera._isLeftCamera = true;
            }
            const rightCamera = this.createRigCamera(this.name + "_R", 1);
            if (rightCamera) {
                rightCamera._isRightCamera = true;
            }
            if (leftCamera && rightCamera) {
                this._rigCameras.push(leftCamera);
                this._rigCameras.push(rightCamera);
            }
        }
        this._setRigMode(rigParams);
        this._cascadePostProcessesToRigCams();
        this.update();
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _setRigMode(rigParams) {
        // no-op
    }
    /** @internal */
    _getVRProjectionMatrix() {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Matrix */ .uq.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix, true, this.getEngine().isNDCHalfZRange);
        this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix);
        return this._projectionMatrix;
    }
    /**
     * @internal
     */
    setCameraRigParameter(name, value) {
        if (!this._cameraRigParams) {
            this._cameraRigParams = {};
        }
        this._cameraRigParams[name] = value;
        //provisionnally:
        if (name === "interaxialDistance") {
            this._cameraRigParams.stereoHalfAngle = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools */ .S0.ToRadians(value / 0.0637);
        }
    }
    /**
     * needs to be overridden by children so sub has required properties to be copied
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    createRigCamera(name, cameraIndex) {
        return null;
    }
    /**
     * May need to be overridden by children
     * @internal
     */
    _updateRigCameras() {
        for (let i = 0; i < this._rigCameras.length; i++) {
            this._rigCameras[i].minZ = this.minZ;
            this._rigCameras[i].maxZ = this.maxZ;
            this._rigCameras[i].fov = this.fov;
            this._rigCameras[i].upVector.copyFrom(this.upVector);
        }
        // only update viewport when ANAGLYPH
        if (this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH) {
            this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport;
        }
    }
    /** @internal */
    _setupInputs() { }
    /**
     * Serialiaze the camera setup to a json representation
     * @returns the JSON representation
     */
    serialize() {
        const serializationObject = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_12__/* .SerializationHelper */ .p.Serialize(this);
        serializationObject.uniqueId = this.uniqueId;
        // Type
        serializationObject.type = this.getClassName();
        // Parent
        if (this.parent) {
            this.parent._serializeAsParent(serializationObject);
        }
        if (this.inputs) {
            this.inputs.serialize(serializationObject);
        }
        // Animations
        _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_12__/* .SerializationHelper */ .p.AppendSerializedAnimations(this, serializationObject);
        serializationObject.ranges = this.serializeAnimationRanges();
        serializationObject.isEnabled = this.isEnabled();
        return serializationObject;
    }
    /**
     * Clones the current camera.
     * @param name The cloned camera name
     * @param newParent The cloned camera's new parent (none by default)
     * @returns the cloned camera
     */
    clone(name, newParent = null) {
        const camera = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_12__/* .SerializationHelper */ .p.Clone(Camera.GetConstructorFromName(this.getClassName(), name, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this);
        camera.name = name;
        camera.parent = newParent;
        this.onClonedObservable.notifyObservers(camera);
        return camera;
    }
    /**
     * Gets the direction of the camera relative to a given local axis.
     * @param localAxis Defines the reference axis to provide a relative direction.
     * @returns the direction
     */
    getDirection(localAxis) {
        const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq.Zero();
        this.getDirectionToRef(localAxis, result);
        return result;
    }
    /**
     * Returns the current camera absolute rotation
     */
    get absoluteRotation() {
        this.getWorldMatrix().decompose(undefined, this._absoluteRotation);
        return this._absoluteRotation;
    }
    /**
     * Gets the direction of the camera relative to a given local axis into a passed vector.
     * @param localAxis Defines the reference axis to provide a relative direction.
     * @param result Defines the vector to store the result in
     */
    getDirectionToRef(localAxis, result) {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq.TransformNormalToRef(localAxis, this.getWorldMatrix(), result);
    }
    /**
     * Gets a camera constructor for a given camera type
     * @param type The type of the camera to construct (should be equal to one of the camera class name)
     * @param name The name of the camera the result will be able to instantiate
     * @param scene The scene the result will construct the camera in
     * @param interaxial_distance In case of stereoscopic setup, the distance between both eyes
     * @param isStereoscopicSideBySide In case of stereoscopic setup, should the sereo be side b side
     * @returns a factory method to construct the camera
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static GetConstructorFromName(type, name, scene, interaxial_distance = 0, isStereoscopicSideBySide = true) {
        const constructorFunc = _node_js__WEBPACK_IMPORTED_MODULE_6__/* .Node */ .b.Construct(type, name, scene, {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            interaxial_distance: interaxial_distance,
            isStereoscopicSideBySide: isStereoscopicSideBySide,
        });
        if (constructorFunc) {
            return constructorFunc;
        }
        // Default to universal camera
        return () => Camera._CreateDefaultParsedCamera(name, scene);
    }
    /**
     * Compute the world  matrix of the camera.
     * @returns the camera world matrix
     */
    computeWorldMatrix() {
        return this.getWorldMatrix();
    }
    /**
     * Parse a JSON and creates the camera from the parsed information
     * @param parsedCamera The JSON to parse
     * @param scene The scene to instantiate the camera in
     * @returns the newly constructed camera
     */
    static Parse(parsedCamera, scene) {
        const type = parsedCamera.type;
        const construct = Camera.GetConstructorFromName(type, parsedCamera.name, scene, parsedCamera.interaxial_distance, parsedCamera.isStereoscopicSideBySide);
        const camera = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_12__/* .SerializationHelper */ .p.Parse(construct, parsedCamera, scene);
        // Parent
        if (parsedCamera.parentId !== undefined) {
            camera._waitingParentId = parsedCamera.parentId;
        }
        // Parent instance index
        if (parsedCamera.parentInstanceIndex !== undefined) {
            camera._waitingParentInstanceIndex = parsedCamera.parentInstanceIndex;
        }
        //If camera has an input manager, let it parse inputs settings
        if (camera.inputs) {
            camera.inputs.parse(parsedCamera);
            camera._setupInputs();
        }
        if (parsedCamera.upVector) {
            camera.upVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq.FromArray(parsedCamera.upVector); // need to force the upVector
        }
        if (camera.setPosition) {
            // need to force position
            camera.position.copyFromFloats(0, 0, 0);
            camera.setPosition(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq.FromArray(parsedCamera.position));
        }
        // Target
        if (parsedCamera.target) {
            if (camera.setTarget) {
                camera.setTarget(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_5__/* .Vector3 */ .Pq.FromArray(parsedCamera.target));
            }
        }
        // Apply 3d rig, when found
        if (parsedCamera.cameraRigMode) {
            const rigParams = parsedCamera.interaxial_distance ? { interaxialDistance: parsedCamera.interaxial_distance } : {};
            camera.setCameraRigMode(parsedCamera.cameraRigMode, rigParams);
        }
        // Animations
        if (parsedCamera.animations) {
            for (let animationIndex = 0; animationIndex < parsedCamera.animations.length; animationIndex++) {
                const parsedAnimation = parsedCamera.animations[animationIndex];
                const internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__/* .GetClass */ .n9)("BABYLON.Animation");
                if (internalClass) {
                    camera.animations.push(internalClass.Parse(parsedAnimation));
                }
            }
            _node_js__WEBPACK_IMPORTED_MODULE_6__/* .Node */ .b.ParseAnimationRanges(camera, parsedCamera, scene);
        }
        if (parsedCamera.autoAnimate) {
            scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1.0);
        }
        // Check if isEnabled is defined to be back compatible with prior serialized versions.
        if (parsedCamera.isEnabled !== undefined) {
            camera.setEnabled(parsedCamera.isEnabled);
        }
        return camera;
    }
    /** @internal */
    _calculateHandednessMultiplier() {
        let handednessMultiplier = this.getScene().useRightHandedSystem ? -1 : 1;
        if (this.parent && this.parent._getWorldMatrixDeterminant() < 0) {
            handednessMultiplier *= -1;
        }
        return handednessMultiplier;
    }
}
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Camera._CreateDefaultParsedCamera = (name, scene) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("UniversalCamera");
};
/**
 * This is the default projection mode used by the cameras.
 * It helps recreating a feeling of perspective and better appreciate depth.
 * This is the best way to simulate real life cameras.
 */
Camera.PERSPECTIVE_CAMERA = 0;
/**
 * This helps creating camera with an orthographic mode.
 * Orthographic is commonly used in engineering as a means to produce object specifications that communicate dimensions unambiguously, each line of 1 unit length (cm, meter..whatever) will appear to have the same length everywhere on the drawing. This allows the drafter to dimension only a subset of lines and let the reader know that other lines of that length on the drawing are also that length in reality. Every parallel line in the drawing is also parallel in the object.
 */
Camera.ORTHOGRAPHIC_CAMERA = 1;
/**
 * This is the default FOV mode for perspective cameras.
 * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.
 */
Camera.FOVMODE_VERTICAL_FIXED = 0;
/**
 * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.
 */
Camera.FOVMODE_HORIZONTAL_FIXED = 1;
/**
 * This specifies there is no need for a camera rig.
 * Basically only one eye is rendered corresponding to the camera.
 */
Camera.RIG_MODE_NONE = 0;
/**
 * Simulates a camera Rig with one blue eye and one red eye.
 * This can be use with 3d blue and red glasses.
 */
Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10;
/**
 * Defines that both eyes of the camera will be rendered side by side with a parallel target.
 */
Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11;
/**
 * Defines that both eyes of the camera will be rendered side by side with a none parallel target.
 */
Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12;
/**
 * Defines that both eyes of the camera will be rendered over under each other.
 */
Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13;
/**
 * Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.
 */
Camera.RIG_MODE_STEREOSCOPIC_INTERLACED = 14;
/**
 * Defines that both eyes of the camera should be renderered in a VR mode (carbox).
 */
Camera.RIG_MODE_VR = 20;
/**
 * Custom rig mode allowing rig cameras to be populated manually with any number of cameras
 */
Camera.RIG_MODE_CUSTOM = 22;
/**
 * Defines if by default attaching controls should prevent the default javascript event to continue.
 */
Camera.ForceAttachControlToAlwaysPreventDefault = false;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)("position")
], Camera.prototype, "_position", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)("upVector")
], Camera.prototype, "_upVector", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "orthoLeft", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "orthoRight", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "orthoBottom", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "orthoTop", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "fov", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "projectionPlaneTilt", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "minZ", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "maxZ", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "inertia", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "mode", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "layerMask", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "fovMode", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "cameraRigMode", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "interaxialDistance", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Camera.prototype, "isStereoscopicSideBySide", void 0);
//# sourceMappingURL=camera.js.map

/***/ }),

/***/ 22002:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   H: () => (/* binding */ CameraInputTypes),
/* harmony export */   _: () => (/* binding */ CameraInputsManager)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26877);
/* harmony import */ var _camera_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30388);



/**
 * @ignore
 * This is a list of all the different input types that are available in the application.
 * Fo instance: ArcRotateCameraGamepadInput...
 */
// eslint-disable-next-line no-var, @typescript-eslint/naming-convention
var CameraInputTypes = {};
/**
 * This represents the input manager used within a camera.
 * It helps dealing with all the different kind of input attached to a camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class CameraInputsManager {
    /**
     * Instantiate a new Camera Input Manager.
     * @param camera Defines the camera the input manager belongs to
     */
    constructor(camera) {
        /**
         * Defines the dom element the camera is collecting inputs from.
         * This is null if the controls have not been attached.
         */
        this.attachedToElement = false;
        this.attached = {};
        this.camera = camera;
        this.checkInputs = () => { };
    }
    /**
     * Add an input method to a camera
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
     * @param input Camera input method
     */
    add(input) {
        const type = input.getSimpleName();
        if (this.attached[type]) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn("camera input of type " + type + " already exists on camera");
            return;
        }
        this.attached[type] = input;
        input.camera = this.camera;
        // for checkInputs, we are dynamically creating a function
        // the goal is to avoid the performance penalty of looping for inputs in the render loop
        if (input.checkInputs) {
            this.checkInputs = this._addCheckInputs(input.checkInputs.bind(input));
        }
        if (this.attachedToElement) {
            input.attachControl(this.noPreventDefault);
        }
    }
    /**
     * Remove a specific input method from a camera
     * example: camera.inputs.remove(camera.inputs.attached.mouse);
     * @param inputToRemove camera input method
     */
    remove(inputToRemove) {
        for (const cam in this.attached) {
            const input = this.attached[cam];
            if (input === inputToRemove) {
                input.detachControl();
                input.camera = null;
                delete this.attached[cam];
                this.rebuildInputCheck();
                return;
            }
        }
    }
    /**
     * Remove a specific input type from a camera
     * example: camera.inputs.remove("ArcRotateCameraGamepadInput");
     * @param inputType the type of the input to remove
     */
    removeByType(inputType) {
        for (const cam in this.attached) {
            const input = this.attached[cam];
            if (input.getClassName() === inputType) {
                input.detachControl();
                input.camera = null;
                delete this.attached[cam];
                this.rebuildInputCheck();
            }
        }
    }
    _addCheckInputs(fn) {
        const current = this.checkInputs;
        return () => {
            current();
            fn();
        };
    }
    /**
     * Attach the input controls to the currently attached dom element to listen the events from.
     * @param input Defines the input to attach
     */
    attachInput(input) {
        if (this.attachedToElement) {
            input.attachControl(this.noPreventDefault);
        }
    }
    /**
     * Attach the current manager inputs controls to a specific dom element to listen the events from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachElement(noPreventDefault = false) {
        if (this.attachedToElement) {
            return;
        }
        noPreventDefault = _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.ForceAttachControlToAlwaysPreventDefault ? false : noPreventDefault;
        this.attachedToElement = true;
        this.noPreventDefault = noPreventDefault;
        for (const cam in this.attached) {
            this.attached[cam].attachControl(noPreventDefault);
        }
    }
    /**
     * Detach the current manager inputs controls from a specific dom element.
     * @param disconnect Defines whether the input should be removed from the current list of attached inputs
     */
    detachElement(disconnect = false) {
        for (const cam in this.attached) {
            this.attached[cam].detachControl();
            if (disconnect) {
                this.attached[cam].camera = null;
            }
        }
        this.attachedToElement = false;
    }
    /**
     * Rebuild the dynamic inputCheck function from the current list of
     * defined inputs in the manager.
     */
    rebuildInputCheck() {
        this.checkInputs = () => { };
        for (const cam in this.attached) {
            const input = this.attached[cam];
            if (input.checkInputs) {
                this.checkInputs = this._addCheckInputs(input.checkInputs.bind(input));
            }
        }
    }
    /**
     * Remove all attached input methods from a camera
     */
    clear() {
        if (this.attachedToElement) {
            this.detachElement(true);
        }
        this.attached = {};
        this.attachedToElement = false;
        this.checkInputs = () => { };
    }
    /**
     * Serialize the current input manager attached to a camera.
     * This ensures than once parsed,
     * the input associated to the camera will be identical to the current ones
     * @param serializedCamera Defines the camera serialization JSON the input serialization should write to
     */
    serialize(serializedCamera) {
        const inputs = {};
        for (const cam in this.attached) {
            const input = this.attached[cam];
            const res = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper */ .p.Serialize(input);
            inputs[input.getClassName()] = res;
        }
        serializedCamera.inputsmgr = inputs;
    }
    /**
     * Parses an input manager serialized JSON to restore the previous list of inputs
     * and states associated to a camera.
     * @param parsedCamera Defines the JSON to parse
     */
    parse(parsedCamera) {
        const parsedInputs = parsedCamera.inputsmgr;
        if (parsedInputs) {
            this.clear();
            for (const n in parsedInputs) {
                const construct = CameraInputTypes[n];
                if (construct) {
                    const parsedinput = parsedInputs[n];
                    const input = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper */ .p.Parse(() => {
                        return new construct();
                    }, parsedinput, null);
                    this.add(input);
                }
            }
        }
        else {
            //2016-03-08 this part is for managing backward compatibility
            for (const n in this.attached) {
                const construct = CameraInputTypes[this.attached[n].getClassName()];
                if (construct) {
                    const input = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_1__/* .SerializationHelper */ .p.Parse(() => {
                        return new construct();
                    }, parsedCamera, null);
                    this.remove(this.attached[n]);
                    this.add(input);
                }
            }
        }
    }
}
//# sourceMappingURL=cameraInputsManager.js.map

/***/ }),

/***/ 11710:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   S: () => (/* binding */ FreeCamera)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _targetCamera_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12333);
/* harmony import */ var _freeCameraInputsManager_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67100);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(998);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56552);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(32206);








/**
 * This represents a free type of camera. It can be useful in First Person Shooter game for instance.
 * Please consider using the new UniversalCamera instead as it adds more functionality like the gamepad.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
 */
class FreeCamera extends _targetCamera_js__WEBPACK_IMPORTED_MODULE_3__/* .TargetCamera */ .F {
    /**
     * Gets the input sensibility for a mouse input. (default is 2000.0)
     * Higher values reduce sensitivity.
     */
    get angularSensibility() {
        const mouse = this.inputs.attached["mouse"];
        if (mouse) {
            return mouse.angularSensibility;
        }
        return 0;
    }
    /**
     * Sets the input sensibility for a mouse input. (default is 2000.0)
     * Higher values reduce sensitivity.
     */
    set angularSensibility(value) {
        const mouse = this.inputs.attached["mouse"];
        if (mouse) {
            mouse.angularSensibility = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the forward move of the camera.
     */
    get keysUp() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysUp;
        }
        return [];
    }
    set keysUp(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysUp = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the upward move of the camera.
     */
    get keysUpward() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysUpward;
        }
        return [];
    }
    set keysUpward(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysUpward = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the backward move of the camera.
     */
    get keysDown() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysDown;
        }
        return [];
    }
    set keysDown(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysDown = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the downward move of the camera.
     */
    get keysDownward() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysDownward;
        }
        return [];
    }
    set keysDownward(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysDownward = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the left strafe move of the camera.
     */
    get keysLeft() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysLeft;
        }
        return [];
    }
    set keysLeft(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysLeft = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the right strafe move of the camera.
     */
    get keysRight() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysRight;
        }
        return [];
    }
    set keysRight(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysRight = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the left rotation move of the camera.
     */
    get keysRotateLeft() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysRotateLeft;
        }
        return [];
    }
    set keysRotateLeft(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysRotateLeft = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the right rotation move of the camera.
     */
    get keysRotateRight() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysRotateRight;
        }
        return [];
    }
    set keysRotateRight(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysRotateRight = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the up rotation move of the camera.
     */
    get keysRotateUp() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysRotateUp;
        }
        return [];
    }
    set keysRotateUp(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysRotateUp = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control the down rotation move of the camera.
     */
    get keysRotateDown() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysRotateDown;
        }
        return [];
    }
    set keysRotateDown(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysRotateDown = value;
        }
    }
    /**
     * Instantiates a Free Camera.
     * This represents a free type of camera. It can be useful in First Person Shooter game for instance.
     * Please consider using the new UniversalCamera instead as it adds more functionality like touch to this camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
     * @param name Define the name of the camera in the scene
     * @param position Define the start position of the camera in the scene
     * @param scene Define the scene the camera belongs to
     * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
     */
    constructor(name, position, scene, setActiveOnSceneIfNoneActive = true) {
        super(name, position, scene, setActiveOnSceneIfNoneActive);
        /**
         * Define the collision ellipsoid of the camera.
         * This is helpful to simulate a camera body like the player body around the camera
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#arcrotatecamera
         */
        this.ellipsoid = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0.5, 1, 0.5);
        /**
         * Define an offset for the position of the ellipsoid around the camera.
         * This can be helpful to determine the center of the body near the gravity center of the body
         * instead of its head.
         */
        this.ellipsoidOffset = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0, 0, 0);
        /**
         * Enable or disable collisions of the camera with the rest of the scene objects.
         */
        this.checkCollisions = false;
        /**
         * Enable or disable gravity on the camera.
         */
        this.applyGravity = false;
        this._needMoveForGravity = false;
        this._oldPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        this._diffPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        this._newPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        // Collisions
        this._collisionMask = -1;
        this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {
            this._newPosition.copyFrom(newPosition);
            this._newPosition.subtractToRef(this._oldPosition, this._diffPosition);
            if (this._diffPosition.length() > _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_7__/* .AbstractEngine */ .$.CollisionsEpsilon) {
                this.position.addToRef(this._diffPosition, this._deferredPositionUpdate);
                if (!this._deferOnly) {
                    this.position.copyFrom(this._deferredPositionUpdate);
                }
                else {
                    this._deferredUpdated = true;
                }
                // call onCollide, if defined. Note that in case of deferred update, the actual position change might happen in the next frame.
                if (this.onCollide && collidedMesh) {
                    this.onCollide(collidedMesh);
                }
            }
        };
        this.inputs = new _freeCameraInputsManager_js__WEBPACK_IMPORTED_MODULE_4__/* .FreeCameraInputsManager */ .s(this);
        this.inputs.addKeyboard().addMouse();
    }
    /**
     * Attached controls to the current camera.
     * @param ignored defines an ignored parameter kept for backward compatibility.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(ignored, noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools */ .S0.BackCompatCameraNoPreventDefault(arguments);
        this.inputs.attachElement(noPreventDefault);
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        this.inputs.detachElement();
        this.cameraDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0, 0, 0);
        this.cameraRotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector2 */ .I9(0, 0);
    }
    /**
     * Define a collision mask to limit the list of object the camera can collide with
     */
    get collisionMask() {
        return this._collisionMask;
    }
    set collisionMask(mask) {
        this._collisionMask = !isNaN(mask) ? mask : -1;
    }
    /**
     * @internal
     */
    _collideWithWorld(displacement) {
        let globalPosition;
        if (this.parent) {
            globalPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinates(this.position, this.parent.getWorldMatrix());
        }
        else {
            globalPosition = this.position;
        }
        globalPosition.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition);
        this._oldPosition.addInPlace(this.ellipsoidOffset);
        const coordinator = this.getScene().collisionCoordinator;
        if (!this._collider) {
            this._collider = coordinator.createCollider();
        }
        this._collider._radius = this.ellipsoid;
        this._collider.collisionMask = this._collisionMask;
        //no need for clone, as long as gravity is not on.
        let actualDisplacement = displacement;
        //add gravity to the direction to prevent the dual-collision checking
        if (this.applyGravity) {
            //this prevents mending with cameraDirection, a global variable of the free camera class.
            actualDisplacement = displacement.add(this.getScene().gravity);
        }
        coordinator.getNewPosition(this._oldPosition, actualDisplacement, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
    }
    /** @internal */
    _checkInputs() {
        if (!this._localDirection) {
            this._localDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
            this._transformedDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        }
        this.inputs.checkInputs();
        super._checkInputs();
    }
    /**
     * Enable movement without a user input. This allows gravity to always be applied.
     */
    set needMoveForGravity(value) {
        this._needMoveForGravity = value;
    }
    /**
     * When true, gravity is applied whether there is user input or not.
     */
    get needMoveForGravity() {
        return this._needMoveForGravity;
    }
    /** @internal */
    _decideIfNeedsToMove() {
        return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;
    }
    /** @internal */
    _updatePosition() {
        if (this.checkCollisions && this.getScene().collisionsEnabled) {
            this._collideWithWorld(this.cameraDirection);
        }
        else {
            super._updatePosition();
        }
    }
    /**
     * Destroy the camera and release the current resources hold by it.
     */
    dispose() {
        this.inputs.clear();
        super.dispose();
    }
    /**
     * Gets the current object class name.
     * @returns the class name
     */
    getClassName() {
        return "FreeCamera";
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)()
], FreeCamera.prototype, "ellipsoid", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)()
], FreeCamera.prototype, "ellipsoidOffset", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCamera.prototype, "checkCollisions", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FreeCamera.prototype, "applyGravity", void 0);
// Register Class Name
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .RegisterClass */ .Y5)("BABYLON.FreeCamera", FreeCamera);
//# sourceMappingURL=freeCamera.js.map

/***/ }),

/***/ 67100:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   s: () => (/* binding */ FreeCameraInputsManager)
/* harmony export */ });
/* harmony import */ var _cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22002);
/* harmony import */ var _Cameras_Inputs_freeCameraKeyboardMoveInput_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23102);
/* harmony import */ var _Cameras_Inputs_freeCameraMouseInput_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12901);
/* harmony import */ var _Cameras_Inputs_freeCameraMouseWheelInput_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11984);
/* harmony import */ var _Cameras_Inputs_freeCameraTouchInput_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5305);





/**
 * Default Inputs manager for the FreeCamera.
 * It groups all the default supported inputs for ease of use.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FreeCameraInputsManager extends _cameraInputsManager_js__WEBPACK_IMPORTED_MODULE_0__/* .CameraInputsManager */ ._ {
    /**
     * Instantiates a new FreeCameraInputsManager.
     * @param camera Defines the camera the inputs belong to
     */
    constructor(camera) {
        super(camera);
        /**
         * @internal
         */
        this._mouseInput = null;
        /**
         * @internal
         */
        this._mouseWheelInput = null;
    }
    /**
     * Add keyboard input support to the input manager.
     * @returns the current input manager
     */
    addKeyboard() {
        this.add(new _Cameras_Inputs_freeCameraKeyboardMoveInput_js__WEBPACK_IMPORTED_MODULE_1__/* .FreeCameraKeyboardMoveInput */ .i());
        return this;
    }
    /**
     * Add mouse input support to the input manager.
     * @param touchEnabled if the FreeCameraMouseInput should support touch (default: true)
     * @returns the current input manager
     */
    addMouse(touchEnabled = true) {
        if (!this._mouseInput) {
            this._mouseInput = new _Cameras_Inputs_freeCameraMouseInput_js__WEBPACK_IMPORTED_MODULE_2__/* .FreeCameraMouseInput */ .h(touchEnabled);
            this.add(this._mouseInput);
        }
        return this;
    }
    /**
     * Removes the mouse input support from the manager
     * @returns the current input manager
     */
    removeMouse() {
        if (this._mouseInput) {
            this.remove(this._mouseInput);
        }
        return this;
    }
    /**
     * Add mouse wheel input support to the input manager.
     * @returns the current input manager
     */
    addMouseWheel() {
        if (!this._mouseWheelInput) {
            this._mouseWheelInput = new _Cameras_Inputs_freeCameraMouseWheelInput_js__WEBPACK_IMPORTED_MODULE_3__/* .FreeCameraMouseWheelInput */ .m();
            this.add(this._mouseWheelInput);
        }
        return this;
    }
    /**
     * Removes the mouse wheel input support from the manager
     * @returns the current input manager
     */
    removeMouseWheel() {
        if (this._mouseWheelInput) {
            this.remove(this._mouseWheelInput);
        }
        return this;
    }
    /**
     * Add touch input support to the input manager.
     * @returns the current input manager
     */
    addTouch() {
        this.add(new _Cameras_Inputs_freeCameraTouchInput_js__WEBPACK_IMPORTED_MODULE_4__/* .FreeCameraTouchInput */ .Z());
        return this;
    }
    /**
     * Remove all attached input methods from a camera
     */
    clear() {
        super.clear();
        this._mouseInput = null;
    }
}
//# sourceMappingURL=freeCameraInputsManager.js.map

/***/ }),

/***/ 12333:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   F: () => (/* binding */ TargetCamera)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _camera_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30388);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65559);
/* harmony import */ var _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18733);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4870);







_node_js__WEBPACK_IMPORTED_MODULE_6__/* .Node */ .b.AddNodeConstructor("TargetCamera", (name, scene) => {
    return () => new TargetCamera(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Zero(), scene);
});
/**
 * A target camera takes a mesh or position as a target and continues to look at it while it moves.
 * This is the base of the follow, arc rotate cameras and Free camera
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
 */
class TargetCamera extends _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i {
    /**
     * Instantiates a target camera that takes a mesh or position as a target and continues to look at it while it moves.
     * This is the base of the follow, arc rotate cameras and Free camera
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
     * @param name Defines the name of the camera in the scene
     * @param position Defines the start position of the camera in the scene
     * @param scene Defines the scene the camera belongs to
     * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
     */
    constructor(name, position, scene, setActiveOnSceneIfNoneActive = true) {
        super(name, position, scene, setActiveOnSceneIfNoneActive);
        this._tmpUpVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Zero();
        this._tmpTargetVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Zero();
        /**
         * Define the current direction the camera is moving to
         */
        this.cameraDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        /**
         * Define the current rotation the camera is rotating to
         */
        this.cameraRotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2 */ .I9(0, 0);
        /** Gets or sets a boolean indicating that the scaling of the parent hierarchy will not be taken in account by the camera */
        this.ignoreParentScaling = false;
        /**
         * When set, the up vector of the camera will be updated by the rotation of the camera
         */
        this.updateUpVectorFromRotation = false;
        this._tmpQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ .PT();
        /**
         * Define the current rotation of the camera
         */
        this.rotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 0);
        /**
         * Define the current speed of the camera
         */
        this.speed = 2.0;
        /**
         * Add constraint to the camera to prevent it to move freely in all directions and
         * around all axis.
         */
        this.noRotationConstraint = false;
        /**
         * Reverses mouselook direction to 'natural' panning as opposed to traditional direct
         * panning
         */
        this.invertRotation = false;
        /**
         * Speed multiplier for inverse camera panning
         */
        this.inverseRotationSpeed = 0.2;
        /**
         * Define the current target of the camera as an object or a position.
         * Please note that locking a target will disable panning.
         */
        this.lockedTarget = null;
        /** @internal */
        this._currentTarget = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Zero();
        /** @internal */
        this._initialFocalDistance = 1;
        /** @internal */
        this._viewMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Zero();
        /** @internal */
        this._camMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Zero();
        /** @internal */
        this._cameraTransformMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Zero();
        /** @internal */
        this._cameraRotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Zero();
        /** @internal */
        this._referencePoint = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(0, 0, 1);
        /** @internal */
        this._transformedReferencePoint = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Zero();
        this._deferredPositionUpdate = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq();
        this._deferredRotationQuaternionUpdate = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ .PT();
        this._deferredRotationUpdate = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq();
        this._deferredUpdated = false;
        this._deferOnly = false;
        this._defaultUp = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Up();
        this._cachedRotationZ = 0;
        this._cachedQuaternionRotationZ = 0;
    }
    /**
     * Gets the position in front of the camera at a given distance.
     * @param distance The distance from the camera we want the position to be
     * @returns the position
     */
    getFrontPosition(distance) {
        this.getWorldMatrix();
        const direction = this.getTarget().subtract(this.position);
        direction.normalize();
        direction.scaleInPlace(distance);
        return this.globalPosition.add(direction);
    }
    /** @internal */
    _getLockedTargetPosition() {
        if (!this.lockedTarget) {
            return null;
        }
        if (this.lockedTarget.absolutePosition) {
            const lockedTarget = this.lockedTarget;
            const m = lockedTarget.computeWorldMatrix();
            // in some cases the absolute position resets externally, but doesn't update since the matrix is cached.
            m.getTranslationToRef(lockedTarget.absolutePosition);
        }
        return this.lockedTarget.absolutePosition || this.lockedTarget;
    }
    /**
     * Store current camera state of the camera (fov, position, rotation, etc..)
     * @returns the camera
     */
    storeState() {
        this._storedPosition = this.position.clone();
        this._storedRotation = this.rotation.clone();
        if (this.rotationQuaternion) {
            this._storedRotationQuaternion = this.rotationQuaternion.clone();
        }
        return super.storeState();
    }
    /**
     * Restored camera state. You must call storeState() first
     * @returns whether it was successful or not
     * @internal
     */
    _restoreStateValues() {
        if (!super._restoreStateValues()) {
            return false;
        }
        this.position = this._storedPosition.clone();
        this.rotation = this._storedRotation.clone();
        if (this.rotationQuaternion) {
            this.rotationQuaternion = this._storedRotationQuaternion.clone();
        }
        this.cameraDirection.copyFromFloats(0, 0, 0);
        this.cameraRotation.copyFromFloats(0, 0);
        return true;
    }
    /** @internal */
    _initCache() {
        super._initCache();
        this._cache.lockedTarget = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        this._cache.rotation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        this._cache.rotationQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ .PT(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
    }
    /**
     * @internal
     */
    _updateCache(ignoreParentClass) {
        if (!ignoreParentClass) {
            super._updateCache();
        }
        const lockedTargetPosition = this._getLockedTargetPosition();
        if (!lockedTargetPosition) {
            this._cache.lockedTarget = null;
        }
        else {
            if (!this._cache.lockedTarget) {
                this._cache.lockedTarget = lockedTargetPosition.clone();
            }
            else {
                this._cache.lockedTarget.copyFrom(lockedTargetPosition);
            }
        }
        this._cache.rotation.copyFrom(this.rotation);
        if (this.rotationQuaternion) {
            this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);
        }
    }
    // Synchronized
    /** @internal */
    _isSynchronizedViewMatrix() {
        if (!super._isSynchronizedViewMatrix()) {
            return false;
        }
        const lockedTargetPosition = this._getLockedTargetPosition();
        return ((this._cache.lockedTarget ? this._cache.lockedTarget.equals(lockedTargetPosition) : !lockedTargetPosition) &&
            (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation)));
    }
    // Methods
    /** @internal */
    _computeLocalCameraSpeed() {
        const engine = this.getEngine();
        return this.speed * Math.sqrt(engine.getDeltaTime() / (engine.getFps() * 100.0));
    }
    // Target
    /**
     * Defines the target the camera should look at.
     * @param target Defines the new target as a Vector
     */
    setTarget(target) {
        this.upVector.normalize();
        this._initialFocalDistance = target.subtract(this.position).length();
        if (this.position.z === target.z) {
            this.position.z += _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .bH;
        }
        this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.LookAtLHToRef(this.position, target, this._defaultUp, this._camMatrix);
        this._camMatrix.invert();
        this.rotation.x = Math.atan(this._camMatrix.m[6] / this._camMatrix.m[10]);
        const vDir = target.subtract(this.position);
        if (vDir.x >= 0.0) {
            this.rotation.y = -Math.atan(vDir.z / vDir.x) + Math.PI / 2.0;
        }
        else {
            this.rotation.y = -Math.atan(vDir.z / vDir.x) - Math.PI / 2.0;
        }
        this.rotation.z = 0;
        if (isNaN(this.rotation.x)) {
            this.rotation.x = 0;
        }
        if (isNaN(this.rotation.y)) {
            this.rotation.y = 0;
        }
        if (isNaN(this.rotation.z)) {
            this.rotation.z = 0;
        }
        if (this.rotationQuaternion) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ .PT.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion);
        }
    }
    /**
     * Defines the target point of the camera.
     * The camera looks towards it form the radius distance.
     */
    get target() {
        return this.getTarget();
    }
    set target(value) {
        this.setTarget(value);
    }
    /**
     * Return the current target position of the camera. This value is expressed in local space.
     * @returns the target position
     */
    getTarget() {
        return this._currentTarget;
    }
    /** @internal */
    _decideIfNeedsToMove() {
        return Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;
    }
    /** @internal */
    _updatePosition() {
        if (this.parent) {
            this.parent.getWorldMatrix().invertToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[0]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformNormalToRef(this.cameraDirection, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[0]);
            this._deferredPositionUpdate.addInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[0]);
            if (!this._deferOnly) {
                this.position.copyFrom(this._deferredPositionUpdate);
            }
            else {
                this._deferredUpdated = true;
            }
            return;
        }
        this._deferredPositionUpdate.addInPlace(this.cameraDirection);
        if (!this._deferOnly) {
            this.position.copyFrom(this._deferredPositionUpdate);
        }
        else {
            this._deferredUpdated = true;
        }
    }
    /** @internal */
    _checkInputs() {
        const directionMultiplier = this.invertRotation ? -this.inverseRotationSpeed : 1.0;
        const needToMove = this._decideIfNeedsToMove();
        const needToRotate = this.cameraRotation.x || this.cameraRotation.y;
        this._deferredUpdated = false;
        this._deferredRotationUpdate.copyFrom(this.rotation);
        this._deferredPositionUpdate.copyFrom(this.position);
        if (this.rotationQuaternion) {
            this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion);
        }
        // Move
        if (needToMove) {
            this._updatePosition();
        }
        // Rotate
        if (needToRotate) {
            //rotate, if quaternion is set and rotation was used
            if (this.rotationQuaternion) {
                this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate);
            }
            this._deferredRotationUpdate.x += this.cameraRotation.x * directionMultiplier;
            this._deferredRotationUpdate.y += this.cameraRotation.y * directionMultiplier;
            // Apply constraints
            if (!this.noRotationConstraint) {
                const limit = 1.570796;
                if (this._deferredRotationUpdate.x > limit) {
                    this._deferredRotationUpdate.x = limit;
                }
                if (this._deferredRotationUpdate.x < -limit) {
                    this._deferredRotationUpdate.x = -limit;
                }
            }
            if (!this._deferOnly) {
                this.rotation.copyFrom(this._deferredRotationUpdate);
            }
            else {
                this._deferredUpdated = true;
            }
            //rotate, if quaternion is set and rotation was used
            if (this.rotationQuaternion) {
                const len = this._deferredRotationUpdate.lengthSquared();
                if (len) {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ .PT.RotationYawPitchRollToRef(this._deferredRotationUpdate.y, this._deferredRotationUpdate.x, this._deferredRotationUpdate.z, this._deferredRotationQuaternionUpdate);
                    if (!this._deferOnly) {
                        this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate);
                    }
                    else {
                        this._deferredUpdated = true;
                    }
                }
            }
        }
        // Inertia
        if (needToMove) {
            if (Math.abs(this.cameraDirection.x) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .bH) {
                this.cameraDirection.x = 0;
            }
            if (Math.abs(this.cameraDirection.y) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .bH) {
                this.cameraDirection.y = 0;
            }
            if (Math.abs(this.cameraDirection.z) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .bH) {
                this.cameraDirection.z = 0;
            }
            this.cameraDirection.scaleInPlace(this.inertia);
        }
        if (needToRotate) {
            if (Math.abs(this.cameraRotation.x) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .bH) {
                this.cameraRotation.x = 0;
            }
            if (Math.abs(this.cameraRotation.y) < this.speed * _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_4__/* .Epsilon */ .bH) {
                this.cameraRotation.y = 0;
            }
            this.cameraRotation.scaleInPlace(this.inertia);
        }
        super._checkInputs();
    }
    _updateCameraRotationMatrix() {
        if (this.rotationQuaternion) {
            this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix);
        }
        else {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix);
        }
    }
    /**
     * Update the up vector to apply the rotation of the camera (So if you changed the camera rotation.z this will let you update the up vector as well)
     * @returns the current camera
     */
    _rotateUpVectorWithCameraRotationMatrix() {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformNormalToRef(this._defaultUp, this._cameraRotationMatrix, this.upVector);
        return this;
    }
    /** @internal */
    _getViewMatrix() {
        if (this.lockedTarget) {
            this.setTarget(this._getLockedTargetPosition());
        }
        // Compute
        this._updateCameraRotationMatrix();
        // Apply the changed rotation to the upVector
        if (this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z) {
            this._rotateUpVectorWithCameraRotationMatrix();
            this._cachedQuaternionRotationZ = this.rotationQuaternion.z;
        }
        else if (this._cachedRotationZ !== this.rotation.z) {
            this._rotateUpVectorWithCameraRotationMatrix();
            this._cachedRotationZ = this.rotation.z;
        }
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint);
        // Computing target and final matrix
        this.position.addToRef(this._transformedReferencePoint, this._currentTarget);
        if (this.updateUpVectorFromRotation) {
            if (this.rotationQuaternion) {
                _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Axis */ ._0.Y.rotateByQuaternionToRef(this.rotationQuaternion, this.upVector);
            }
            else {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ .PT.FromEulerVectorToRef(this.rotation, this._tmpQuaternion);
                _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_5__/* .Axis */ ._0.Y.rotateByQuaternionToRef(this._tmpQuaternion, this.upVector);
            }
        }
        this._computeViewMatrix(this.position, this._currentTarget, this.upVector);
        return this._viewMatrix;
    }
    _computeViewMatrix(position, target, up) {
        if (this.ignoreParentScaling) {
            if (this.parent) {
                const parentWorldMatrix = this.parent.getWorldMatrix();
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformCoordinatesToRef(position, parentWorldMatrix, this._globalPosition);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformCoordinatesToRef(target, parentWorldMatrix, this._tmpTargetVector);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformNormalToRef(up, parentWorldMatrix, this._tmpUpVector);
                this._markSyncedWithParent();
            }
            else {
                this._globalPosition.copyFrom(position);
                this._tmpTargetVector.copyFrom(target);
                this._tmpUpVector.copyFrom(up);
            }
            if (this.getScene().useRightHandedSystem) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.LookAtRHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix);
            }
            else {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.LookAtLHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix);
            }
            return;
        }
        if (this.getScene().useRightHandedSystem) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.LookAtRHToRef(position, target, up, this._viewMatrix);
        }
        else {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.LookAtLHToRef(position, target, up, this._viewMatrix);
        }
        if (this.parent) {
            const parentWorldMatrix = this.parent.getWorldMatrix();
            this._viewMatrix.invert();
            this._viewMatrix.multiplyToRef(parentWorldMatrix, this._viewMatrix);
            this._viewMatrix.getTranslationToRef(this._globalPosition);
            this._viewMatrix.invert();
            this._markSyncedWithParent();
        }
        else {
            this._globalPosition.copyFrom(position);
        }
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    createRigCamera(name, cameraIndex) {
        if (this.cameraRigMode !== _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_NONE) {
            const rigCamera = new TargetCamera(name, this.position.clone(), this.getScene());
            rigCamera.isRigCamera = true;
            rigCamera.rigParent = this;
            if (this.cameraRigMode === _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_VR) {
                if (!this.rotationQuaternion) {
                    this.rotationQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ .PT();
                }
                rigCamera._cameraRigParams = {};
                rigCamera.rotationQuaternion = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ .PT();
            }
            rigCamera.mode = this.mode;
            rigCamera.orthoLeft = this.orthoLeft;
            rigCamera.orthoRight = this.orthoRight;
            rigCamera.orthoTop = this.orthoTop;
            rigCamera.orthoBottom = this.orthoBottom;
            return rigCamera;
        }
        return null;
    }
    /**
     * @internal
     */
    _updateRigCameras() {
        const camLeft = this._rigCameras[0];
        const camRight = this._rigCameras[1];
        this.computeWorldMatrix();
        switch (this.cameraRigMode) {
            case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
            case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
            case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
            case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_STEREOSCOPIC_OVERUNDER:
            case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_STEREOSCOPIC_INTERLACED: {
                //provisionnaly using _cameraRigParams.stereoHalfAngle instead of calculations based on _cameraRigParams.interaxialDistance:
                const leftSign = this.cameraRigMode === _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? 1 : -1;
                const rightSign = this.cameraRigMode === _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? -1 : 1;
                this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * leftSign, camLeft);
                this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * rightSign, camRight);
                break;
            }
            case _camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.RIG_MODE_VR:
                if (camLeft.rotationQuaternion) {
                    camLeft.rotationQuaternion.copyFrom(this.rotationQuaternion);
                    camRight.rotationQuaternion.copyFrom(this.rotationQuaternion);
                }
                else {
                    camLeft.rotation.copyFrom(this.rotation);
                    camRight.rotation.copyFrom(this.rotation);
                }
                camLeft.position.copyFrom(this.position);
                camRight.position.copyFrom(this.position);
                break;
        }
        super._updateRigCameras();
    }
    _getRigCamPositionAndTarget(halfSpace, rigCamera) {
        const target = this.getTarget();
        target.subtractToRef(this.position, TargetCamera._TargetFocalPoint);
        TargetCamera._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);
        const newFocalTarget = TargetCamera._TargetFocalPoint.addInPlace(this.position);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.TranslationToRef(-newFocalTarget.x, -newFocalTarget.y, -newFocalTarget.z, TargetCamera._TargetTransformMatrix);
        TargetCamera._TargetTransformMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.RotationAxis(rigCamera.upVector, halfSpace), TargetCamera._RigCamTransformMatrix);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.TranslationToRef(newFocalTarget.x, newFocalTarget.y, newFocalTarget.z, TargetCamera._TargetTransformMatrix);
        TargetCamera._RigCamTransformMatrix.multiplyToRef(TargetCamera._TargetTransformMatrix, TargetCamera._RigCamTransformMatrix);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformCoordinatesToRef(this.position, TargetCamera._RigCamTransformMatrix, rigCamera.position);
        rigCamera.setTarget(newFocalTarget);
    }
    /**
     * Gets the current object class name.
     * @returns the class name
     */
    getClassName() {
        return "TargetCamera";
    }
}
TargetCamera._RigCamTransformMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq();
TargetCamera._TargetTransformMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq();
TargetCamera._TargetFocalPoint = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq();
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)()
], TargetCamera.prototype, "rotation", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], TargetCamera.prototype, "speed", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsMeshReference */ .xG)("lockedTargetId")
], TargetCamera.prototype, "lockedTarget", void 0);
//# sourceMappingURL=targetCamera.js.map

/***/ }),

/***/ 77103:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   w: () => (/* binding */ IntersectionInfo)
/* harmony export */ });
/**
 * @internal
 */
class IntersectionInfo {
    constructor(bu, bv, distance) {
        this.bu = bu;
        this.bv = bv;
        this.distance = distance;
        this.faceId = 0;
        this.subMeshId = 0;
    }
}
//# sourceMappingURL=intersectionInfo.js.map

/***/ }),

/***/ 76439:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   j: () => (/* binding */ _MeshCollisionData)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);

/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _MeshCollisionData {
    constructor() {
        this._checkCollisions = false;
        this._collisionMask = -1;
        this._collisionGroup = -1;
        this._surroundingMeshes = null;
        this._collider = null;
        this._oldPositionForCollisions = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, 0);
        this._diffPositionForCollisions = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, 0);
        this._collisionResponse = true;
    }
}
//# sourceMappingURL=meshCollisionData.js.map

/***/ }),

/***/ 30311:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   G: () => (/* binding */ PickingInfo)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95616);


/**
 * Information about the result of picking within a scene
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking_collisions
 */
class PickingInfo {
    constructor() {
        /**
         * If the pick collided with an object
         */
        this.hit = false;
        /**
         * Distance away where the pick collided
         */
        this.distance = 0;
        /**
         * The location of pick collision
         */
        this.pickedPoint = null;
        /**
         * The mesh corresponding the pick collision
         */
        this.pickedMesh = null;
        /** (See getTextureCoordinates) The barycentric U coordinate that is used when calculating the texture coordinates of the collision.*/
        this.bu = 0;
        /** (See getTextureCoordinates) The barycentric V coordinate that is used when calculating the texture coordinates of the collision.*/
        this.bv = 0;
        /** The index of the face on the mesh that was picked, or the index of the Line if the picked Mesh is a LinesMesh */
        this.faceId = -1;
        /** The index of the face on the subMesh that was picked, or the index of the Line if the picked Mesh is a LinesMesh */
        this.subMeshFaceId = -1;
        /** Id of the submesh that was picked */
        this.subMeshId = 0;
        /** If a sprite was picked, this will be the sprite the pick collided with */
        this.pickedSprite = null;
        /** If we are picking a mesh with thin instance, this will give you the picked thin instance */
        this.thinInstanceIndex = -1;
        /**
         * The ray that was used to perform the picking.
         */
        this.ray = null;
        /**
         * If a mesh was used to do the picking (eg. 6dof controller) as a "near interaction", this will be populated.
         */
        this.originMesh = null;
        /**
         * The aim-space transform of the input used for picking, if it is an XR input source.
         */
        this.aimTransform = null;
        /**
         * The grip-space transform of the input used for picking, if it is an XR input source.
         * Some XR sources, such as input coming from head mounted displays, do not have this.
         */
        this.gripTransform = null;
    }
    /**
     * Gets the normal corresponding to the face the pick collided with
     * @param useWorldCoordinates If the resulting normal should be relative to the world (default: false)
     * @param useVerticesNormals If the vertices normals should be used to calculate the normal instead of the normal map (default: true)
     * @returns The normal corresponding to the face the pick collided with
     * @remarks Note that the returned normal will always point towards the picking ray.
     */
    getNormal(useWorldCoordinates = false, useVerticesNormals = true) {
        if (!this.pickedMesh || (useVerticesNormals && !this.pickedMesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.NormalKind))) {
            return null;
        }
        let indices = this.pickedMesh.getIndices();
        if (indices?.length === 0) {
            indices = null;
        }
        let result;
        const tmp0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0];
        const tmp1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[1];
        const tmp2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[2];
        if (useVerticesNormals) {
            const normals = this.pickedMesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.NormalKind);
            let normal0 = indices
                ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(normals, indices[this.faceId * 3] * 3, tmp0)
                : tmp0.copyFromFloats(normals[this.faceId * 3 * 3], normals[this.faceId * 3 * 3 + 1], normals[this.faceId * 3 * 3 + 2]);
            let normal1 = indices
                ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(normals, indices[this.faceId * 3 + 1] * 3, tmp1)
                : tmp1.copyFromFloats(normals[(this.faceId * 3 + 1) * 3], normals[(this.faceId * 3 + 1) * 3 + 1], normals[(this.faceId * 3 + 1) * 3 + 2]);
            let normal2 = indices
                ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(normals, indices[this.faceId * 3 + 2] * 3, tmp2)
                : tmp2.copyFromFloats(normals[(this.faceId * 3 + 2) * 3], normals[(this.faceId * 3 + 2) * 3 + 1], normals[(this.faceId * 3 + 2) * 3 + 2]);
            normal0 = normal0.scale(this.bu);
            normal1 = normal1.scale(this.bv);
            normal2 = normal2.scale(1.0 - this.bu - this.bv);
            result = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(normal0.x + normal1.x + normal2.x, normal0.y + normal1.y + normal2.y, normal0.z + normal1.z + normal2.z);
        }
        else {
            const positions = this.pickedMesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind);
            const vertex1 = indices
                ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(positions, indices[this.faceId * 3] * 3, tmp0)
                : tmp0.copyFromFloats(positions[this.faceId * 3 * 3], positions[this.faceId * 3 * 3 + 1], positions[this.faceId * 3 * 3 + 2]);
            const vertex2 = indices
                ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(positions, indices[this.faceId * 3 + 1] * 3, tmp1)
                : tmp1.copyFromFloats(positions[(this.faceId * 3 + 1) * 3], positions[(this.faceId * 3 + 1) * 3 + 1], positions[(this.faceId * 3 + 1) * 3 + 2]);
            const vertex3 = indices
                ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(positions, indices[this.faceId * 3 + 2] * 3, tmp2)
                : tmp2.copyFromFloats(positions[(this.faceId * 3 + 2) * 3], positions[(this.faceId * 3 + 2) * 3 + 1], positions[(this.faceId * 3 + 2) * 3 + 2]);
            const p1p2 = vertex1.subtract(vertex2);
            const p3p2 = vertex3.subtract(vertex2);
            result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Cross(p1p2, p3p2);
        }
        const transformNormalToWorld = (pickedMesh, n) => {
            let wm = pickedMesh.getWorldMatrix();
            if (pickedMesh.nonUniformScaling) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0].copyFrom(wm);
                wm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0];
                wm.setTranslationFromFloats(0, 0, 0);
                wm.invert();
                wm.transposeToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[1]);
                wm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[1];
            }
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalToRef(n, wm, n);
        };
        if (useWorldCoordinates) {
            transformNormalToWorld(this.pickedMesh, result);
        }
        if (this.ray) {
            const normalForDirectionChecking = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0].copyFrom(result);
            if (!useWorldCoordinates) {
                // the normal has not been transformed to world space as part as the normal processing, so we must do it now
                transformNormalToWorld(this.pickedMesh, normalForDirectionChecking);
            }
            // Flip the normal if the picking ray is in the same direction.
            if (_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Dot(normalForDirectionChecking, this.ray.direction) > 0) {
                result.negateInPlace();
            }
        }
        result.normalize();
        return result;
    }
    /**
     * Gets the texture coordinates of where the pick occurred
     * @param uvSet The UV set to use to calculate the texture coordinates (default: VertexBuffer.UVKind)
     * @returns The vector containing the coordinates of the texture
     */
    getTextureCoordinates(uvSet = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.UVKind) {
        if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(uvSet)) {
            return null;
        }
        const indices = this.pickedMesh.getIndices();
        if (!indices) {
            return null;
        }
        const uvs = this.pickedMesh.getVerticesData(uvSet);
        if (!uvs) {
            return null;
        }
        let uv0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9.FromArray(uvs, indices[this.faceId * 3] * 2);
        let uv1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9.FromArray(uvs, indices[this.faceId * 3 + 1] * 2);
        let uv2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9.FromArray(uvs, indices[this.faceId * 3 + 2] * 2);
        uv0 = uv0.scale(this.bu);
        uv1 = uv1.scale(this.bv);
        uv2 = uv2.scale(1.0 - this.bu - this.bv);
        return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9(uv0.x + uv1.x + uv2.x, uv0.y + uv1.y + uv2.y);
    }
}
//# sourceMappingURL=pickingInfo.js.map

/***/ }),

/***/ 91313:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ge: () => (/* binding */ setOpenGLOrientationForUV),
/* harmony export */   p9: () => (/* binding */ CompatibilityOptions),
/* harmony export */   rX: () => (/* binding */ useOpenGLOrientationForUV)
/* harmony export */ });
/**
 * Defines if the system should use OpenGL convention for UVs when creating geometry or loading .babylon files (false by default)
 */
let useOpenGLOrientationForUV = false;
/**
 * Sets whether to use OpenGL convention for UVs
 * @param value the new value
 */
function setOpenGLOrientationForUV(value) {
    useOpenGLOrientationForUV = value;
}
/**
 * Options used to control default behaviors regarding compatibility support
 * @deprecated please use named exports
 */
const CompatibilityOptions = {
    /* eslint-disable @typescript-eslint/naming-convention */
    get UseOpenGLOrientationForUV() {
        return useOpenGLOrientationForUV;
    },
    set UseOpenGLOrientationForUV(value) {
        useOpenGLOrientationForUV = value;
    },
    /* eslint-enable @typescript-eslint/naming-convention */
};
//# sourceMappingURL=compatibilityOptions.js.map

/***/ }),

/***/ 72266:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   H: () => (/* binding */ ComputeShader)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26877);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56552);
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7481);
/* harmony import */ var _Misc_uniqueIdGenerator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82678);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51137);
/* harmony import */ var _Materials_Textures_textureSampler_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38573);
/* harmony import */ var _Engines_WebGPU_webgpuPerfCounter_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(39176);









/**
 * The ComputeShader object lets you execute a compute shader on your GPU (if supported by the engine)
 */
class ComputeShader {
    /**
     * The options used to create the shader
     */
    get options() {
        return this._options;
    }
    /**
     * The shaderPath used to create the shader
     */
    get shaderPath() {
        return this._shaderPath;
    }
    /**
     * Instantiates a new compute shader.
     * @param name Defines the name of the compute shader in the scene
     * @param engine Defines the engine the compute shader belongs to
     * @param shaderPath Defines the route to the shader code in one of three ways:
     *  * object: \{ compute: "custom" \}, used with ShaderStore.ShadersStoreWGSL["customComputeShader"]
     *  * object: \{ computeElement: "HTMLElementId" \}, used with shader code in script tags
     *  * object: \{ computeSource: "compute shader code string" \}, where the string contains the shader code
     *  * string: try first to find the code in ShaderStore.ShadersStoreWGSL[shaderPath + "ComputeShader"]. If not, assumes it is a file with name shaderPath.compute.fx in index.html folder.
     * @param options Define the options used to create the shader
     */
    constructor(name, engine, shaderPath, options = {}) {
        this._bindings = {};
        this._samplers = {};
        this._contextIsDirty = false;
        /**
         * When set to true, dispatch won't call isReady anymore and won't check if the underlying GPU resources should be (re)created because of a change in the inputs (texture, uniform buffer, etc.)
         * If you know that your inputs did not change since last time dispatch was called and that isReady() returns true, set this flag to true to improve performance
         */
        this.fastMode = false;
        /**
         * Callback triggered when the shader is compiled
         */
        this.onCompiled = null;
        /**
         * Callback triggered when an error occurs
         */
        this.onError = null;
        this.name = name;
        this._engine = engine;
        this.uniqueId = _Misc_uniqueIdGenerator_js__WEBPACK_IMPORTED_MODULE_5__/* .UniqueIdGenerator */ .K.UniqueId;
        if (engine.enableGPUTimingMeasurements) {
            this.gpuTimeInFrame = new _Engines_WebGPU_webgpuPerfCounter_js__WEBPACK_IMPORTED_MODULE_8__/* .WebGPUPerfCounter */ .e();
        }
        if (!this._engine.getCaps().supportComputeShaders) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_6__/* .Logger */ .V.Error("This engine does not support compute shaders!");
            return;
        }
        if (!options.bindingsMapping) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_6__/* .Logger */ .V.Error("You must provide the binding mappings as browsers don't support reflection for wgsl shaders yet!");
            return;
        }
        this._context = engine.createComputeContext();
        this._shaderPath = shaderPath;
        this._options = {
            bindingsMapping: {},
            defines: [],
            ...options,
        };
    }
    /**
     * Gets the current class name of the material e.g. "ComputeShader"
     * Mainly use in serialization.
     * @returns the class name
     */
    getClassName() {
        return "ComputeShader";
    }
    /**
     * Binds a texture to the shader
     * @param name Binding name of the texture
     * @param texture Texture to bind
     * @param bindSampler Bind the sampler corresponding to the texture (default: true). The sampler will be bound just before the binding index of the texture
     */
    setTexture(name, texture, bindSampler = true) {
        const current = this._bindings[name];
        this._bindings[name] = {
            type: bindSampler ? 0 /* ComputeBindingType.Texture */ : 4 /* ComputeBindingType.TextureWithoutSampler */,
            object: texture,
            indexInGroupEntries: current?.indexInGroupEntries,
        };
        this._contextIsDirty || (this._contextIsDirty = !current || current.object !== texture || current.type !== this._bindings[name].type);
    }
    /**
     * Binds a storage texture to the shader
     * @param name Binding name of the texture
     * @param texture Texture to bind
     */
    setStorageTexture(name, texture) {
        const current = this._bindings[name];
        this._contextIsDirty || (this._contextIsDirty = !current || current.object !== texture);
        this._bindings[name] = {
            type: 1 /* ComputeBindingType.StorageTexture */,
            object: texture,
            indexInGroupEntries: current?.indexInGroupEntries,
        };
    }
    /**
     * Binds an external texture to the shader
     * @param name Binding name of the texture
     * @param texture Texture to bind
     */
    setExternalTexture(name, texture) {
        const current = this._bindings[name];
        this._contextIsDirty || (this._contextIsDirty = !current || current.object !== texture);
        this._bindings[name] = {
            type: 6 /* ComputeBindingType.ExternalTexture */,
            object: texture,
            indexInGroupEntries: current?.indexInGroupEntries,
        };
    }
    /**
     * Binds a video texture to the shader (by binding the external texture attached to this video)
     * @param name Binding name of the texture
     * @param texture Texture to bind
     * @returns true if the video texture was successfully bound, else false. false will be returned if the current engine does not support external textures
     */
    setVideoTexture(name, texture) {
        if (texture.externalTexture) {
            this.setExternalTexture(name, texture.externalTexture);
            return true;
        }
        return false;
    }
    /**
     * Binds a uniform buffer to the shader
     * @param name Binding name of the buffer
     * @param buffer Buffer to bind
     */
    setUniformBuffer(name, buffer) {
        const current = this._bindings[name];
        this._contextIsDirty || (this._contextIsDirty = !current || current.object !== buffer);
        this._bindings[name] = {
            type: ComputeShader._BufferIsDataBuffer(buffer) ? 7 /* ComputeBindingType.DataBuffer */ : 2 /* ComputeBindingType.UniformBuffer */,
            object: buffer,
            indexInGroupEntries: current?.indexInGroupEntries,
        };
    }
    /**
     * Binds a storage buffer to the shader
     * @param name Binding name of the buffer
     * @param buffer Buffer to bind
     */
    setStorageBuffer(name, buffer) {
        const current = this._bindings[name];
        this._contextIsDirty || (this._contextIsDirty = !current || current.object !== buffer);
        this._bindings[name] = {
            type: ComputeShader._BufferIsDataBuffer(buffer) ? 7 /* ComputeBindingType.DataBuffer */ : 3 /* ComputeBindingType.StorageBuffer */,
            object: buffer,
            indexInGroupEntries: current?.indexInGroupEntries,
        };
    }
    /**
     * Binds a texture sampler to the shader
     * @param name Binding name of the sampler
     * @param sampler Sampler to bind
     */
    setTextureSampler(name, sampler) {
        const current = this._bindings[name];
        this._contextIsDirty || (this._contextIsDirty = !current || !sampler.compareSampler(current.object));
        this._bindings[name] = {
            type: 5 /* ComputeBindingType.Sampler */,
            object: sampler,
            indexInGroupEntries: current?.indexInGroupEntries,
        };
    }
    /**
     * Specifies that the compute shader is ready to be executed (the compute effect and all the resources are ready)
     * @returns true if the compute shader is ready to be executed
     */
    isReady() {
        let effect = this._effect;
        for (const key in this._bindings) {
            const binding = this._bindings[key], type = binding.type, object = binding.object;
            switch (type) {
                case 0 /* ComputeBindingType.Texture */:
                case 4 /* ComputeBindingType.TextureWithoutSampler */:
                case 1 /* ComputeBindingType.StorageTexture */: {
                    const texture = object;
                    if (!texture.isReady()) {
                        return false;
                    }
                    break;
                }
                case 6 /* ComputeBindingType.ExternalTexture */: {
                    const texture = object;
                    if (!texture.isReady()) {
                        return false;
                    }
                    break;
                }
            }
        }
        const defines = [];
        const shaderName = this._shaderPath;
        if (this._options.defines) {
            for (let index = 0; index < this._options.defines.length; index++) {
                defines.push(this._options.defines[index]);
            }
        }
        const join = defines.join("\n");
        if (this._cachedDefines !== join) {
            this._cachedDefines = join;
            effect = this._engine.createComputeEffect(shaderName, {
                defines: join,
                entryPoint: this._options.entryPoint,
                onCompiled: this.onCompiled,
                onError: this.onError,
            });
            this._effect = effect;
        }
        if (!effect.isReady()) {
            return false;
        }
        return true;
    }
    /**
     * Dispatches (executes) the compute shader
     * @param x Number of workgroups to execute on the X dimension
     * @param y Number of workgroups to execute on the Y dimension (default: 1)
     * @param z Number of workgroups to execute on the Z dimension (default: 1)
     * @returns True if the dispatch could be done, else false (meaning either the compute effect or at least one of the bound resources was not ready)
     */
    dispatch(x, y, z) {
        if (!this.fastMode && !this._checkContext()) {
            return false;
        }
        this._engine.computeDispatch(this._effect, this._context, this._bindings, x, y, z, this._options.bindingsMapping, this.gpuTimeInFrame);
        return true;
    }
    /**
     * Dispatches (executes) the compute shader.
     * @param buffer Buffer containing the number of workgroups to execute on the X, Y and Z dimensions
     * @param offset Offset in the buffer where the workgroup counts are stored (default: 0)
     * @returns True if the dispatch could be done, else false (meaning either the compute effect or at least one of the bound resources was not ready)
     */
    dispatchIndirect(buffer, offset = 0) {
        if (!this.fastMode && !this._checkContext()) {
            return false;
        }
        const dataBuffer = ComputeShader._BufferIsDataBuffer(buffer) ? buffer : buffer.getBuffer();
        this._engine.computeDispatchIndirect(this._effect, this._context, this._bindings, dataBuffer, offset, this._options.bindingsMapping, this.gpuTimeInFrame);
        return true;
    }
    _checkContext() {
        if (!this.isReady()) {
            return false;
        }
        // If the sampling parameters of a texture bound to the shader have changed, we must clear the compute context so that it is recreated with the updated values
        // Also, if the actual (gpu) buffer used by a uniform buffer has changed, we must clear the compute context so that it is recreated with the updated value
        for (const key in this._bindings) {
            const binding = this._bindings[key];
            if (!this._options.bindingsMapping[key]) {
                throw new Error("ComputeShader ('" + this.name + "'): No binding mapping has been provided for the property '" + key + "'");
            }
            switch (binding.type) {
                case 0 /* ComputeBindingType.Texture */: {
                    const sampler = this._samplers[key];
                    const texture = binding.object;
                    if (!sampler || !texture._texture || !sampler.compareSampler(texture._texture)) {
                        this._samplers[key] = new _Materials_Textures_textureSampler_js__WEBPACK_IMPORTED_MODULE_7__/* .TextureSampler */ .u().setParameters(texture.wrapU, texture.wrapV, texture.wrapR, texture.anisotropicFilteringLevel, texture._texture.samplingMode, texture._texture?._comparisonFunction);
                        this._contextIsDirty = true;
                    }
                    break;
                }
                case 6 /* ComputeBindingType.ExternalTexture */: {
                    // we must recreate the bind groups each time if there's an external texture, because device.importExternalTexture must be called each frame
                    this._contextIsDirty = true;
                    break;
                }
                case 2 /* ComputeBindingType.UniformBuffer */: {
                    const ubo = binding.object;
                    if (ubo.getBuffer() !== binding.buffer) {
                        binding.buffer = ubo.getBuffer();
                        this._contextIsDirty = true;
                    }
                    break;
                }
            }
        }
        if (this._contextIsDirty) {
            this._contextIsDirty = false;
            this._context.clear();
        }
        return true;
    }
    /**
     * Waits for the compute shader to be ready and executes it
     * @param x Number of workgroups to execute on the X dimension
     * @param y Number of workgroups to execute on the Y dimension (default: 1)
     * @param z Number of workgroups to execute on the Z dimension (default: 1)
     * @param delay Delay between the retries while the shader is not ready (in milliseconds - 10 by default)
     * @returns A promise that is resolved once the shader has been sent to the GPU. Note that it does not mean that the shader execution itself is finished!
     */
    dispatchWhenReady(x, y, z, delay = 10) {
        return new Promise((resolve) => {
            const check = () => {
                if (!this.dispatch(x, y, z)) {
                    setTimeout(check, delay);
                }
                else {
                    resolve();
                }
            };
            check();
        });
    }
    /**
     * Serializes this compute shader in a JSON representation
     * @returns the serialized compute shader object
     */
    serialize() {
        const serializationObject = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_2__/* .SerializationHelper */ .p.Serialize(this);
        serializationObject.options = this._options;
        serializationObject.shaderPath = this._shaderPath;
        serializationObject.bindings = {};
        serializationObject.textures = {};
        for (const key in this._bindings) {
            const binding = this._bindings[key];
            const object = binding.object;
            switch (binding.type) {
                case 0 /* ComputeBindingType.Texture */:
                case 4 /* ComputeBindingType.TextureWithoutSampler */:
                case 1 /* ComputeBindingType.StorageTexture */: {
                    const serializedData = object.serialize();
                    if (serializedData) {
                        serializationObject.textures[key] = serializedData;
                        serializationObject.bindings[key] = {
                            type: binding.type,
                        };
                    }
                    break;
                }
                case 2 /* ComputeBindingType.UniformBuffer */: {
                    break;
                }
            }
        }
        return serializationObject;
    }
    /**
     * Creates a compute shader from parsed compute shader data
     * @param source defines the JSON representation of the compute shader
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @returns a new compute shader
     */
    static Parse(source, scene, rootUrl) {
        const compute = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_2__/* .SerializationHelper */ .p.Parse(() => new ComputeShader(source.name, scene.getEngine(), source.shaderPath, source.options), source, scene, rootUrl);
        for (const key in source.textures) {
            const binding = source.bindings[key];
            const texture = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_4__/* .Texture */ .g.Parse(source.textures[key], scene, rootUrl);
            if (binding.type === 0 /* ComputeBindingType.Texture */) {
                compute.setTexture(key, texture);
            }
            else if (binding.type === 4 /* ComputeBindingType.TextureWithoutSampler */) {
                compute.setTexture(key, texture, false);
            }
            else {
                compute.setStorageTexture(key, texture);
            }
        }
        return compute;
    }
    static _BufferIsDataBuffer(buffer) {
        return buffer.underlyingResource !== undefined;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ComputeShader.prototype, "name", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ComputeShader.prototype, "fastMode", void 0);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .Y5)("BABYLON.ComputeShader", ComputeShader);
//# sourceMappingURL=computeShader.js.map

/***/ }),

/***/ 28011:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ComputeShaderBoundingHelper: () => (/* binding */ ComputeShaderBoundingHelper)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Compute/computeShader.js
var Compute_computeShader = __webpack_require__(72266);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/storageBuffer.js
var storageBuffer = __webpack_require__(31367);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/buffer.js
var buffer = __webpack_require__(95616);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__(79923);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/uniformBuffer.js
var uniformBuffer = __webpack_require__(80935);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
;// ./node_modules/@babylonjs/core/ShadersWGSL/boundingInfo.compute.js
// Do not edit.

const boundingInfo_compute_name = "boundingInfoComputeShader";
const shader = `struct Results {minX : atomic<i32>,
minY : atomic<i32>,
minZ : atomic<i32>,
maxX : atomic<i32>,
maxY : atomic<i32>,
maxZ : atomic<i32>,
dummy1 : i32,
dummy2 : i32,};fn floatToBits(value: f32)->i32 {return bitcast<i32>(value);}
fn bitsToFloat(value: i32)->f32 {return bitcast<f32>(value);}
fn atomicMinFloat(atomicVar: ptr<storage,atomic<i32>,read_write>,value: f32) {let intValue=floatToBits(value);loop {let oldIntValue=atomicLoad(atomicVar);let oldValue=bitsToFloat(oldIntValue);if (value>=oldValue) {break;}
if (atomicCompareExchangeWeak(atomicVar,oldIntValue,intValue).old_value==oldIntValue) {break;}}}
fn atomicMaxFloat(atomicVar: ptr<storage,atomic<i32>,read_write>,value: f32) {let intValue=floatToBits(value);loop {let oldIntValue=atomicLoad(atomicVar);let oldValue=bitsToFloat(oldIntValue);if (value<=oldValue) {break;}
if (atomicCompareExchangeWeak(atomicVar,oldIntValue,intValue).old_value==oldIntValue) {break;}}}
fn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4<f32>
{let offset=i32(index) *4; 
let m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);return mat4x4<f32>(m0,m1,m2,m3);}
const identity=mat4x4f(
vec4f(1.0,0.0,0.0,0.0),
vec4f(0.0,1.0,0.0,0.0),
vec4f(0.0,0.0,1.0,0.0),
vec4f(0.0,0.0,0.0,1.0)
);struct Settings {morphTargetTextureInfo: vec3f,
morphTargetCount: i32,
indexResult : u32,};@group(0) @binding(0) var<storage,read> positionBuffer : array<f32>;@group(0) @binding(1) var<storage,read_write> resultBuffer : array<Results>;@group(0) @binding(7) var<uniform> settings : Settings;
#if NUM_BONE_INFLUENCERS>0
@group(0) @binding(2) var boneSampler : texture_2d<f32>;@group(0) @binding(3) var<storage,read> indexBuffer : array<vec4f>;@group(0) @binding(4) var<storage,read> weightBuffer : array<vec4f>;
#if NUM_BONE_INFLUENCERS>4
@group(0) @binding(5) var<storage,read> indexExtraBuffer : array<vec4f>;@group(0) @binding(6) var<storage,read> weightExtraBuffer : array<vec4f>;
#endif
#endif
#ifdef MORPHTARGETS
@group(0) @binding(8) var morphTargets : texture_2d_array<f32>;@group(0) @binding(9) var<storage,read> morphTargetInfluences : array<f32>;@group(0) @binding(10) var<storage,read> morphTargetTextureIndices : array<f32>;
#endif
#ifdef MORPHTARGETS
fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : u32)->vec3f
{ 
let vertexID=f32(vertexIndex)*settings.morphTargetTextureInfo.x;let y=floor(vertexID/settings.morphTargetTextureInfo.y);let x=vertexID-y*settings.morphTargetTextureInfo.y;let textureUV=vec2<i32>(i32(x),i32(y));return textureLoad(morphTargets,textureUV,i32(morphTargetTextureIndices[targetIndex]),0).xyz;}
#endif
@compute @workgroup_size(256,1,1)
fn main(@builtin(global_invocation_id) global_id : vec3<u32>) {let index=global_id.x;if (index>=arrayLength(&positionBuffer)/3) {return;}
let position=vec3f(positionBuffer[index*3],positionBuffer[index*3+1],positionBuffer[index*3+2]);var finalWorld=identity;var positionUpdated=position;
#if NUM_BONE_INFLUENCERS>0
var influence : mat4x4<f32>;let matricesIndices=indexBuffer[index];let matricesWeights=weightBuffer[index];influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];
#endif 
#if NUM_BONE_INFLUENCERS>4
let matricesIndicesExtra=indexExtraBuffer[index];let matricesWeightsExtra=weightExtraBuffer[index];influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra.x)*matricesWeightsExtra.x;
#if NUM_BONE_INFLUENCERS>5
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra.y)*matricesWeightsExtra.y;
#endif 
#if NUM_BONE_INFLUENCERS>6
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra.z)*matricesWeightsExtra.z;
#endif 
#if NUM_BONE_INFLUENCERS>7
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra.w)*matricesWeightsExtra.w;
#endif 
#endif 
finalWorld=finalWorld*influence;
#endif
#ifdef MORPHTARGETS
for (var i=0; i<NUM_MORPH_INFLUENCERS; i=i+1) {if (i>=settings.morphTargetCount) {break;}
positionUpdated=positionUpdated+(readVector3FromRawSampler(i,index)-position)*morphTargetInfluences[i];}
#endif
var worldPos=finalWorld*vec4f(positionUpdated.x,positionUpdated.y,positionUpdated.z,1.0);atomicMinFloat(&resultBuffer[settings.indexResult].minX,worldPos.x);atomicMinFloat(&resultBuffer[settings.indexResult].minY,worldPos.y);atomicMinFloat(&resultBuffer[settings.indexResult].minZ,worldPos.z);atomicMaxFloat(&resultBuffer[settings.indexResult].maxX,worldPos.x);atomicMaxFloat(&resultBuffer[settings.indexResult].maxY,worldPos.y);atomicMaxFloat(&resultBuffer[settings.indexResult].maxZ,worldPos.z);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[boundingInfo_compute_name] = shader;
/** @internal */
const boundingInfoComputeShaderWGSL = { name: boundingInfo_compute_name, shader };
//# sourceMappingURL=boundingInfo.compute.js.map
;// ./node_modules/@babylonjs/core/Culling/Helper/computeShaderBoundingHelper.js






/** @internal */
class ComputeShaderBoundingHelper {
    /**
     * Creates a new ComputeShaderBoundingHelper
     * @param engine defines the engine to use
     */
    constructor(engine) {
        this._computeShadersCache = {};
        this._positionBuffers = {};
        this._indexBuffers = {};
        this._weightBuffers = {};
        this._indexExtraBuffers = {};
        this._weightExtraBuffers = {};
        this._morphTargetInfluenceBuffers = {};
        this._morphTargetTextureIndexBuffers = {};
        this._ubos = [];
        this._uboIndex = 0;
        this._processedMeshes = [];
        this._computeShaders = [];
        this._uniqueComputeShaders = new Set();
        this._resultBuffers = [];
        this._engine = engine;
    }
    _getComputeShader(defines, hasBones, hasMorphs) {
        let computeShader;
        const join = defines.join("\n");
        if (!this._computeShadersCache[join]) {
            const bindingsMapping = {
                positionBuffer: { group: 0, binding: 0 },
                resultBuffer: { group: 0, binding: 1 },
                settings: { group: 0, binding: 7 },
            };
            if (hasBones) {
                bindingsMapping.boneSampler = { group: 0, binding: 2 };
                bindingsMapping.indexBuffer = { group: 0, binding: 3 };
                bindingsMapping.weightBuffer = { group: 0, binding: 4 };
                bindingsMapping.indexExtraBuffer = { group: 0, binding: 5 };
                bindingsMapping.weightExtraBuffer = { group: 0, binding: 6 };
            }
            if (hasMorphs) {
                bindingsMapping.morphTargets = { group: 0, binding: 8 };
                bindingsMapping.morphTargetInfluences = { group: 0, binding: 9 };
                bindingsMapping.morphTargetTextureIndices = { group: 0, binding: 10 };
            }
            computeShader = new Compute_computeShader/* ComputeShader */.H(`boundingInfoCompute${hasBones ? "_bones" : ""}${hasMorphs ? "_morphs" : ""}`, this._engine, "boundingInfo", {
                bindingsMapping,
                defines: defines,
            });
            this._computeShadersCache[join] = computeShader;
        }
        else {
            computeShader = this._computeShadersCache[join];
        }
        return computeShader;
    }
    _getUBO() {
        if (this._uboIndex >= this._ubos.length) {
            const ubo = new uniformBuffer/* UniformBuffer */.D(this._engine);
            ubo.addFloat3("morphTargetTextureInfo", 0, 0, 0);
            ubo.addUniform("morphTargetCount", 1);
            ubo.addUniform("indexResult", 1);
            this._ubos.push(ubo);
        }
        return this._ubos[this._uboIndex++];
    }
    _extractDataAndLink(computeShader, mesh, kind, stride, name, storageUnit) {
        let buffer;
        const vertexCount = mesh.getTotalVertices();
        if (!storageUnit[mesh.uniqueId]) {
            const dataArray = mesh.getVertexBuffer(kind)?.getFloatData(vertexCount);
            buffer = new storageBuffer/* StorageBuffer */.K(this._engine, Float32Array.BYTES_PER_ELEMENT * vertexCount * stride);
            buffer.update(dataArray);
            storageUnit[mesh.uniqueId] = buffer;
        }
        else {
            buffer = storageUnit[mesh.uniqueId];
        }
        computeShader.setStorageBuffer(name, buffer);
    }
    _prepareStorage(computeShader, name, id, storageUnit, numInfluencers, data) {
        let buffer;
        if (!storageUnit[id]) {
            buffer = new storageBuffer/* StorageBuffer */.K(this._engine, Float32Array.BYTES_PER_ELEMENT * numInfluencers);
            storageUnit[id] = buffer;
        }
        else {
            buffer = storageUnit[id];
        }
        buffer.update(data);
        computeShader.setStorageBuffer(name, buffer);
    }
    /** @internal */
    async processAsync(meshes) {
        await this.registerMeshListAsync(meshes);
        this.processMeshList();
        await this.fetchResultsForMeshListAsync();
    }
    /** @internal */
    registerMeshListAsync(meshes) {
        this._disposeForMeshList();
        if (!Array.isArray(meshes)) {
            meshes = [meshes];
        }
        let maxNumInfluencers = 0;
        for (let i = 0; i < meshes.length; i++) {
            const mesh = meshes[i];
            const vertexCount = mesh.getTotalVertices();
            if (vertexCount === 0 || !mesh.getVertexBuffer || !mesh.getVertexBuffer(buffer/* VertexBuffer */.R.PositionKind)) {
                continue;
            }
            this._processedMeshes.push(mesh);
            const manager = mesh.morphTargetManager;
            if (manager) {
                maxNumInfluencers = Math.max(maxNumInfluencers, manager.numTargets);
            }
        }
        for (let i = 0; i < this._processedMeshes.length; i++) {
            const mesh = this._processedMeshes[i];
            let defines = [""];
            let hasBones = false;
            if (mesh && mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
                defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
                hasBones = true;
            }
            const computeShaderWithoutMorph = this._getComputeShader(defines, hasBones, false);
            this._uniqueComputeShaders.add(computeShaderWithoutMorph);
            const manager = mesh.morphTargetManager;
            if (manager) {
                defines = defines.slice();
                defines.push("#define MORPHTARGETS");
                defines.push("#define NUM_MORPH_INFLUENCERS " + maxNumInfluencers);
                const computeShaderWithMorph = this._getComputeShader(defines, hasBones, true);
                this._uniqueComputeShaders.add(computeShaderWithMorph);
                this._computeShaders.push([computeShaderWithoutMorph, computeShaderWithMorph]);
            }
            else {
                this._computeShaders.push([computeShaderWithoutMorph, computeShaderWithoutMorph]);
            }
            // Pre-build the ubos, as they won't change if there's no morph targets
            const ubo = this._getUBO();
            ubo.updateUInt("indexResult", i);
            ubo.update();
        }
        return new Promise((resolve) => {
            const check = () => {
                const iterator = this._uniqueComputeShaders.keys();
                for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
                    const computeShader = key.value;
                    if (!computeShader.isReady()) {
                        setTimeout(check, 10);
                        return;
                    }
                }
                resolve();
            };
            check();
        });
    }
    /** @internal */
    processMeshList() {
        if (this._processedMeshes.length === 0) {
            return;
        }
        this._uboIndex = 0;
        const resultDataSize = 8 * this._processedMeshes.length;
        const resultData = new Float32Array(resultDataSize);
        const resultBuffer = new storageBuffer/* StorageBuffer */.K(this._engine, Float32Array.BYTES_PER_ELEMENT * resultDataSize);
        this._resultBuffers.push(resultBuffer);
        for (let i = 0; i < this._processedMeshes.length; i++) {
            resultData[i * 8 + 0] = Number.POSITIVE_INFINITY;
            resultData[i * 8 + 1] = Number.POSITIVE_INFINITY;
            resultData[i * 8 + 2] = Number.POSITIVE_INFINITY;
            resultData[i * 8 + 3] = Number.NEGATIVE_INFINITY;
            resultData[i * 8 + 4] = Number.NEGATIVE_INFINITY;
            resultData[i * 8 + 5] = Number.NEGATIVE_INFINITY;
        }
        resultBuffer.update(resultData);
        for (let i = 0; i < this._processedMeshes.length; i++) {
            const mesh = this._processedMeshes[i];
            const vertexCount = mesh.getTotalVertices();
            const [computeShaderWithoutMorph, computeShaderWithMorph] = this._computeShaders[i];
            const manager = mesh.morphTargetManager;
            const hasMorphs = manager && manager.numInfluencers > 0;
            const computeShader = hasMorphs ? computeShaderWithMorph : computeShaderWithoutMorph;
            this._extractDataAndLink(computeShader, mesh, buffer/* VertexBuffer */.R.PositionKind, 3, "positionBuffer", this._positionBuffers);
            // Bones
            if (mesh && mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton && mesh.skeleton.useTextureToStoreBoneMatrices) {
                this._extractDataAndLink(computeShader, mesh, buffer/* VertexBuffer */.R.MatricesIndicesKind, 4, "indexBuffer", this._indexBuffers);
                this._extractDataAndLink(computeShader, mesh, buffer/* VertexBuffer */.R.MatricesWeightsKind, 4, "weightBuffer", this._weightBuffers);
                const boneSampler = mesh.skeleton.getTransformMatrixTexture(mesh);
                computeShader.setTexture("boneSampler", boneSampler, false);
                if (mesh.numBoneInfluencers > 4) {
                    this._extractDataAndLink(computeShader, mesh, buffer/* VertexBuffer */.R.MatricesIndicesExtraKind, 4, "indexExtraBuffer", this._indexExtraBuffers);
                    this._extractDataAndLink(computeShader, mesh, buffer/* VertexBuffer */.R.MatricesWeightsExtraKind, 4, "weightExtraBuffer", this._weightExtraBuffers);
                }
            }
            const ubo = this._getUBO();
            // Morphs
            if (hasMorphs) {
                const morphTargets = manager._targetStoreTexture;
                computeShader.setTexture("morphTargets", morphTargets, false);
                this._prepareStorage(computeShader, "morphTargetInfluences", mesh.uniqueId, this._morphTargetInfluenceBuffers, manager.numInfluencers, manager.influences);
                this._prepareStorage(computeShader, "morphTargetTextureIndices", mesh.uniqueId, this._morphTargetTextureIndexBuffers, manager.numInfluencers, manager._morphTargetTextureIndices);
                ubo.updateFloat3("morphTargetTextureInfo", manager._textureVertexStride, manager._textureWidth, manager._textureHeight);
                ubo.updateInt("morphTargetCount", manager.numInfluencers);
                ubo.update();
            }
            computeShader.setStorageBuffer("resultBuffer", resultBuffer);
            computeShader.setUniformBuffer("settings", ubo);
            // Dispatch
            computeShader.dispatch(Math.ceil(vertexCount / 256));
            this._engine.flushFramebuffer();
        }
    }
    /** @internal */
    fetchResultsForMeshListAsync() {
        return new Promise((resolve) => {
            const buffers = [];
            let size = 0;
            for (let i = 0; i < this._resultBuffers.length; i++) {
                const buffer = this._resultBuffers[i].getBuffer();
                buffers.push(buffer);
                size += buffer.capacity;
            }
            const resultData = new Float32Array(size / Float32Array.BYTES_PER_ELEMENT);
            const minimum = math_vector/* Vector3 */.Pq.Zero();
            const maximum = math_vector/* Vector3 */.Pq.Zero();
            const minmax = { minimum, maximum };
            this._engine.readFromMultipleStorageBuffers(buffers, 0, undefined, resultData, true).then(() => {
                let resultDataOffset = 0;
                for (let j = 0; j < this._resultBuffers.length; j++) {
                    for (let i = 0; i < this._processedMeshes.length; i++) {
                        const mesh = this._processedMeshes[i];
                        math_vector/* Vector3 */.Pq.FromArrayToRef(resultData, resultDataOffset + i * 8, minimum);
                        math_vector/* Vector3 */.Pq.FromArrayToRef(resultData, resultDataOffset + i * 8 + 3, maximum);
                        if (j > 0) {
                            minimum.minimizeInPlace(mesh.getBoundingInfo().minimum);
                            maximum.maximizeInPlace(mesh.getBoundingInfo().maximum);
                        }
                        mesh._refreshBoundingInfoDirect(minmax);
                    }
                    resultDataOffset += 8 * this._processedMeshes.length;
                }
                for (const resultBuffer of this._resultBuffers) {
                    resultBuffer.dispose();
                }
                this._resultBuffers = [];
                this._uboIndex = 0;
                resolve();
            });
        });
    }
    _disposeCache(storageUnit) {
        for (const key in storageUnit) {
            storageUnit[key].dispose();
        }
    }
    _disposeForMeshList() {
        for (const resultBuffer of this._resultBuffers) {
            resultBuffer.dispose();
        }
        this._resultBuffers = [];
        this._processedMeshes = [];
        this._computeShaders = [];
        this._uniqueComputeShaders = new Set();
    }
    /** @internal */
    dispose() {
        this._disposeCache(this._positionBuffers);
        this._positionBuffers = {};
        this._disposeCache(this._indexBuffers);
        this._indexBuffers = {};
        this._disposeCache(this._weightBuffers);
        this._weightBuffers = {};
        this._disposeCache(this._morphTargetInfluenceBuffers);
        this._morphTargetInfluenceBuffers = {};
        this._disposeCache(this._morphTargetTextureIndexBuffers);
        this._morphTargetTextureIndexBuffers = {};
        for (const ubo of this._ubos) {
            ubo.dispose();
        }
        this._ubos = [];
        this._computeShadersCache = {};
        this._engine = undefined;
        this._disposeForMeshList();
    }
}
//# sourceMappingURL=computeShaderBoundingHelper.js.map

/***/ }),

/***/ 17301:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  TransformFeedbackBoundingHelper: () => (/* binding */ TransformFeedbackBoundingHelper)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/buffer.js
var buffer = __webpack_require__(95616);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialHelper.functions.js
var materialHelper_functions = __webpack_require__(80467);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.functions.js
var math_functions = __webpack_require__(71139);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__(79923);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(69707);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(18959);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__(27999);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__(90738);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__(48451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__(15060);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(3361);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(65523);
;// ./node_modules/@babylonjs/core/Shaders/gpuTransform.vertex.js
// Do not edit.









const gpuTransform_vertex_name = "gpuTransformVertexShader";
const shader = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
out vec3 outPosition;const mat4 identity=mat4(
vec4(1.0,0.0,0.0,0.0),
vec4(0.0,1.0,0.0,0.0),
vec4(0.0,0.0,1.0,0.0),
vec4(0.0,0.0,0.0,1.0)
);void main(void) {vec3 positionUpdated=position;
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
mat4 finalWorld=identity;
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);outPosition=worldPos.xyz;}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[gpuTransform_vertex_name] = shader;
/** @internal */
const gpuTransformVertexShader = { name: gpuTransform_vertex_name, shader };
//# sourceMappingURL=gpuTransform.vertex.js.map
;// ./node_modules/@babylonjs/core/Shaders/gpuTransform.fragment.js
// Do not edit.

const gpuTransform_fragment_name = "gpuTransformPixelShader";
const gpuTransform_fragment_shader = `#version 300 es
void main() {discard;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[gpuTransform_fragment_name] = gpuTransform_fragment_shader;
/** @internal */
const gpuTransformPixelShader = { name: gpuTransform_fragment_name, shader: gpuTransform_fragment_shader };
//# sourceMappingURL=gpuTransform.fragment.js.map
;// ./node_modules/@babylonjs/core/Culling/Helper/transformFeedbackBoundingHelper.js







/** @internal */
class TransformFeedbackBoundingHelper {
    /**
     * Creates a new TransformFeedbackBoundingHelper
     * @param engine defines the engine to use
     */
    constructor(engine) {
        this._buffers = {};
        this._effects = {};
        this._meshListCounter = 0;
        this._engine = engine;
    }
    /** @internal */
    processAsync(meshes) {
        if (!Array.isArray(meshes)) {
            meshes = [meshes];
        }
        this._meshListCounter = 0;
        this._processMeshList(meshes);
        return Promise.resolve();
    }
    _processMeshList(meshes) {
        const parallelShaderCompile = this._engine.getCaps().parallelShaderCompile;
        this._engine.getCaps().parallelShaderCompile = undefined;
        for (let i = 0; i < meshes.length; ++i) {
            const mesh = meshes[i];
            const vertexCount = mesh.getTotalVertices();
            if (vertexCount === 0 || !mesh.getVertexBuffer || !mesh.getVertexBuffer(buffer/* VertexBuffer */.R.PositionKind)) {
                continue;
            }
            // Get correct effect
            let computeEffect;
            let numInfluencers = 0;
            const defines = [];
            let uniforms = [];
            const attribs = [buffer/* VertexBuffer */.R.PositionKind];
            const samplers = [];
            // Bones
            if (mesh && mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
                attribs.push(buffer/* VertexBuffer */.R.MatricesIndicesKind);
                attribs.push(buffer/* VertexBuffer */.R.MatricesWeightsKind);
                if (mesh.numBoneInfluencers > 4) {
                    attribs.push(buffer/* VertexBuffer */.R.MatricesIndicesExtraKind);
                    attribs.push(buffer/* VertexBuffer */.R.MatricesWeightsExtraKind);
                }
                const skeleton = mesh.skeleton;
                defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
                if (skeleton.isUsingTextureForMatrices) {
                    defines.push("#define BONETEXTURE");
                    if (uniforms.indexOf("boneTextureWidth") === -1) {
                        uniforms.push("boneTextureWidth");
                    }
                    if (samplers.indexOf("boneSampler") === -1) {
                        samplers.push("boneSampler");
                    }
                }
                else {
                    defines.push("#define BonesPerMesh " + (skeleton.bones.length + 1));
                    if (uniforms.indexOf("mBones") === -1) {
                        uniforms.push("mBones");
                    }
                }
            }
            else {
                defines.push("#define NUM_BONE_INFLUENCERS 0");
            }
            // Morph
            const manager = mesh ? mesh.morphTargetManager : null;
            if (manager) {
                numInfluencers = manager.numMaxInfluencers || manager.numInfluencers;
                if (numInfluencers > 0) {
                    defines.push("#define MORPHTARGETS");
                }
                if (manager.isUsingTextureForTargets) {
                    defines.push("#define MORPHTARGETS_TEXTURE");
                    if (uniforms.indexOf("morphTargetTextureIndices") === -1) {
                        uniforms.push("morphTargetTextureIndices");
                    }
                    if (samplers.indexOf("morphTargets") === -1) {
                        samplers.push("morphTargets");
                    }
                }
                defines.push("#define NUM_MORPH_INFLUENCERS " + numInfluencers);
                for (let index = 0; index < numInfluencers; index++) {
                    attribs.push(buffer/* VertexBuffer */.R.PositionKind + index);
                }
                if (numInfluencers > 0) {
                    uniforms = uniforms.slice();
                    uniforms.push("morphTargetInfluences");
                    uniforms.push("morphTargetCount");
                    uniforms.push("morphTargetTextureInfo");
                    uniforms.push("morphTargetTextureIndices");
                }
            }
            // Baked Vertex Animation
            const bvaManager = mesh.bakedVertexAnimationManager;
            if (bvaManager && bvaManager.isEnabled) {
                defines.push("#define BAKED_VERTEX_ANIMATION_TEXTURE");
                if (uniforms.indexOf("bakedVertexAnimationSettings") === -1) {
                    uniforms.push("bakedVertexAnimationSettings");
                }
                if (uniforms.indexOf("bakedVertexAnimationTextureSizeInverted") === -1) {
                    uniforms.push("bakedVertexAnimationTextureSizeInverted");
                }
                if (uniforms.indexOf("bakedVertexAnimationTime") === -1) {
                    uniforms.push("bakedVertexAnimationTime");
                }
                if (samplers.indexOf("bakedVertexAnimationTexture") === -1) {
                    samplers.push("bakedVertexAnimationTexture");
                }
                (0,materialHelper_functions/* PrepareAttributesForBakedVertexAnimation */.J2)(attribs, mesh, defines);
            }
            const join = defines.join("\n");
            if (!this._effects[join]) {
                const computeEffectOptions = {
                    attributes: attribs,
                    uniformsNames: uniforms,
                    uniformBuffersNames: [],
                    samplers: samplers,
                    defines: join,
                    fallbacks: null,
                    onCompiled: null,
                    onError: null,
                    indexParameters: { maxSimultaneousMorphTargets: numInfluencers },
                    maxSimultaneousLights: 0,
                    transformFeedbackVaryings: ["outPosition"],
                };
                computeEffect = this._engine.createEffect("gpuTransform", computeEffectOptions, this._engine);
                this._effects[join] = computeEffect;
            }
            else {
                computeEffect = this._effects[join];
            }
            this._compute(mesh, computeEffect);
        }
        this._engine.getCaps().parallelShaderCompile = parallelShaderCompile;
    }
    _compute(mesh, effect) {
        const engine = this._engine;
        // Buffer
        let targetBuffer;
        const vertexCount = mesh.getTotalVertices();
        if (!this._buffers[mesh.uniqueId]) {
            const targetData = new Float32Array(vertexCount * 3);
            targetBuffer = new buffer/* Buffer */.h(mesh.getEngine(), targetData, true, 3);
            this._buffers[mesh.uniqueId] = targetBuffer;
        }
        else {
            targetBuffer = this._buffers[mesh.uniqueId];
        }
        // Bind
        effect.getEngine().enableEffect(effect);
        mesh._bindDirect(effect, null, true);
        // Bones
        (0,materialHelper_functions/* BindBonesParameters */.f$)(mesh, effect);
        // Morph targets
        const manager = mesh.morphTargetManager;
        if (manager && manager.numInfluencers > 0) {
            (0,materialHelper_functions/* BindMorphTargetParameters */.nR)(mesh, effect);
        }
        // BVA
        const bvaManager = mesh.bakedVertexAnimationManager;
        if (bvaManager && bvaManager.isEnabled) {
            mesh.bakedVertexAnimationManager?.bind(effect, false);
        }
        // Update
        const arrayBuffer = targetBuffer.getData();
        engine.bindTransformFeedbackBuffer(targetBuffer.getBuffer());
        engine.setRasterizerState(false);
        engine.beginTransformFeedback(true);
        engine.drawArraysType(2, 0, vertexCount);
        engine.endTransformFeedback();
        engine.setRasterizerState(true);
        engine.readTransformFeedbackBuffer(arrayBuffer);
        engine.bindTransformFeedbackBuffer(null);
        // Update mesh
        if (this._meshListCounter === 0) {
            mesh._refreshBoundingInfo(arrayBuffer, null);
        }
        else {
            const bb = mesh.getBoundingInfo().boundingBox;
            const extend = (0,math_functions/* extractMinAndMax */.b8)(arrayBuffer, 0, vertexCount);
            TransformFeedbackBoundingHelper._Min.copyFrom(bb.minimum).minimizeInPlace(extend.minimum);
            TransformFeedbackBoundingHelper._Max.copyFrom(bb.maximum).maximizeInPlace(extend.maximum);
            mesh._refreshBoundingInfoDirect({ minimum: TransformFeedbackBoundingHelper._Min, maximum: TransformFeedbackBoundingHelper._Max });
        }
    }
    /** @internal */
    registerMeshListAsync(meshes) {
        if (!Array.isArray(meshes)) {
            meshes = [meshes];
        }
        this._meshList = meshes;
        this._meshListCounter = 0;
        return Promise.resolve();
    }
    /** @internal */
    processMeshList() {
        if (this._meshList.length === 0) {
            return;
        }
        this._processMeshList(this._meshList);
        this._meshListCounter++;
    }
    /** @internal */
    fetchResultsForMeshListAsync() {
        this._meshListCounter = 0;
        return Promise.resolve();
    }
    /** @internal */
    dispose() {
        for (const key in this._buffers) {
            this._buffers[key].dispose();
        }
        this._buffers = {};
        this._effects = {};
        this._engine = null;
    }
}
TransformFeedbackBoundingHelper._Min = new math_vector/* Vector3 */.Pq();
TransformFeedbackBoundingHelper._Max = new math_vector/* Vector3 */.Pq();
//# sourceMappingURL=transformFeedbackBoundingHelper.js.map

/***/ }),

/***/ 84766:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   I: () => (/* binding */ BoundingBox)
/* harmony export */ });
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27309);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65559);



/**
 * Class used to store bounding box information
 */
class BoundingBox {
    /**
     * Creates a new bounding box
     * @param min defines the minimum vector (in local space)
     * @param max defines the maximum vector (in local space)
     * @param worldMatrix defines the new world matrix
     */
    constructor(min, max, worldMatrix) {
        /**
         * Gets the 8 vectors representing the bounding box in local space
         */
        this.vectors = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .BuildArray */ .mI)(8, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero);
        /**
         * Gets the center of the bounding box in local space
         */
        this.center = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets the center of the bounding box in world space
         */
        this.centerWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets half the size of the extent in local space. Multiply by 2 to obtain the full size of the box!
         */
        this.extendSize = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets half the size of the extent in world space. Multiply by 2 to obtain the full size of the box!
         */
        this.extendSizeWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets the OBB (object bounding box) directions
         */
        this.directions = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .BuildArray */ .mI)(3, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero);
        /**
         * Gets the 8 vectors representing the bounding box in world space
         */
        this.vectorsWorld = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .BuildArray */ .mI)(8, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero);
        /**
         * Gets the minimum vector in world space
         */
        this.minimumWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets the maximum vector in world space
         */
        this.maximumWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets the minimum vector in local space
         */
        this.minimum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets the maximum vector in local space
         */
        this.maximum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /** @internal */
        this._drawWrapperFront = null;
        /** @internal */
        this._drawWrapperBack = null;
        this.reConstruct(min, max, worldMatrix);
    }
    // Methods
    /**
     * Recreates the entire bounding box from scratch as if we call the constructor in place
     * @param min defines the new minimum vector (in local space)
     * @param max defines the new maximum vector (in local space)
     * @param worldMatrix defines the new world matrix
     */
    reConstruct(min, max, worldMatrix) {
        const minX = min.x, minY = min.y, minZ = min.z, maxX = max.x, maxY = max.y, maxZ = max.z;
        const vectors = this.vectors;
        this.minimum.copyFromFloats(minX, minY, minZ);
        this.maximum.copyFromFloats(maxX, maxY, maxZ);
        vectors[0].copyFromFloats(minX, minY, minZ);
        vectors[1].copyFromFloats(maxX, maxY, maxZ);
        vectors[2].copyFromFloats(maxX, minY, minZ);
        vectors[3].copyFromFloats(minX, maxY, minZ);
        vectors[4].copyFromFloats(minX, minY, maxZ);
        vectors[5].copyFromFloats(maxX, maxY, minZ);
        vectors[6].copyFromFloats(minX, maxY, maxZ);
        vectors[7].copyFromFloats(maxX, minY, maxZ);
        // OBB
        max.addToRef(min, this.center).scaleInPlace(0.5);
        max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
        this._worldMatrix = worldMatrix || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.IdentityReadOnly;
        this._update(this._worldMatrix);
    }
    /**
     * Scale the current bounding box by applying a scale factor
     * @param factor defines the scale factor to apply
     * @returns the current bounding box
     */
    scale(factor) {
        const tmpVectors = BoundingBox._TmpVector3;
        const diff = this.maximum.subtractToRef(this.minimum, tmpVectors[0]);
        const len = diff.length();
        diff.normalizeFromLength(len);
        const distance = len * factor;
        const newRadius = diff.scaleInPlace(distance * 0.5);
        const min = this.center.subtractToRef(newRadius, tmpVectors[1]);
        const max = this.center.addToRef(newRadius, tmpVectors[2]);
        this.reConstruct(min, max, this._worldMatrix);
        return this;
    }
    /**
     * Gets the world matrix of the bounding box
     * @returns a matrix
     */
    getWorldMatrix() {
        return this._worldMatrix;
    }
    /**
     * @internal
     */
    _update(world) {
        const minWorld = this.minimumWorld;
        const maxWorld = this.maximumWorld;
        const directions = this.directions;
        const vectorsWorld = this.vectorsWorld;
        const vectors = this.vectors;
        if (!world.isIdentity()) {
            minWorld.setAll(Number.MAX_VALUE);
            maxWorld.setAll(-Number.MAX_VALUE);
            for (let index = 0; index < 8; ++index) {
                const v = vectorsWorld[index];
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinatesToRef(vectors[index], world, v);
                minWorld.minimizeInPlace(v);
                maxWorld.maximizeInPlace(v);
            }
            // Extend
            maxWorld.subtractToRef(minWorld, this.extendSizeWorld).scaleInPlace(0.5);
            maxWorld.addToRef(minWorld, this.centerWorld).scaleInPlace(0.5);
        }
        else {
            minWorld.copyFrom(this.minimum);
            maxWorld.copyFrom(this.maximum);
            for (let index = 0; index < 8; ++index) {
                vectorsWorld[index].copyFrom(vectors[index]);
            }
            // Extend
            this.extendSizeWorld.copyFrom(this.extendSize);
            this.centerWorld.copyFrom(this.center);
        }
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(world.m, 0, directions[0]);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(world.m, 4, directions[1]);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(world.m, 8, directions[2]);
        this._worldMatrix = world;
    }
    /**
     * Tests if the bounding box is intersecting the frustum planes
     * @param frustumPlanes defines the frustum planes to test
     * @returns true if there is an intersection
     */
    isInFrustum(frustumPlanes) {
        return BoundingBox.IsInFrustum(this.vectorsWorld, frustumPlanes);
    }
    /**
     * Tests if the bounding box is entirely inside the frustum planes
     * @param frustumPlanes defines the frustum planes to test
     * @returns true if there is an inclusion
     */
    isCompletelyInFrustum(frustumPlanes) {
        return BoundingBox.IsCompletelyInFrustum(this.vectorsWorld, frustumPlanes);
    }
    /**
     * Tests if a point is inside the bounding box
     * @param point defines the point to test
     * @returns true if the point is inside the bounding box
     */
    intersectsPoint(point) {
        const min = this.minimumWorld;
        const max = this.maximumWorld;
        const minX = min.x, minY = min.y, minZ = min.z, maxX = max.x, maxY = max.y, maxZ = max.z;
        const pointX = point.x, pointY = point.y, pointZ = point.z;
        const delta = -_Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .bH;
        if (maxX - pointX < delta || delta > pointX - minX) {
            return false;
        }
        if (maxY - pointY < delta || delta > pointY - minY) {
            return false;
        }
        if (maxZ - pointZ < delta || delta > pointZ - minZ) {
            return false;
        }
        return true;
    }
    /**
     * Tests if the bounding box intersects with a bounding sphere
     * @param sphere defines the sphere to test
     * @returns true if there is an intersection
     */
    intersectsSphere(sphere) {
        return BoundingBox.IntersectsSphere(this.minimumWorld, this.maximumWorld, sphere.centerWorld, sphere.radiusWorld);
    }
    /**
     * Tests if the bounding box intersects with a box defined by a min and max vectors
     * @param min defines the min vector to use
     * @param max defines the max vector to use
     * @returns true if there is an intersection
     */
    intersectsMinMax(min, max) {
        const myMin = this.minimumWorld;
        const myMax = this.maximumWorld;
        const myMinX = myMin.x, myMinY = myMin.y, myMinZ = myMin.z, myMaxX = myMax.x, myMaxY = myMax.y, myMaxZ = myMax.z;
        const minX = min.x, minY = min.y, minZ = min.z, maxX = max.x, maxY = max.y, maxZ = max.z;
        if (myMaxX < minX || myMinX > maxX) {
            return false;
        }
        if (myMaxY < minY || myMinY > maxY) {
            return false;
        }
        if (myMaxZ < minZ || myMinZ > maxZ) {
            return false;
        }
        return true;
    }
    /**
     * Disposes the resources of the class
     */
    dispose() {
        this._drawWrapperFront?.dispose();
        this._drawWrapperBack?.dispose();
    }
    // Statics
    /**
     * Tests if two bounding boxes are intersections
     * @param box0 defines the first box to test
     * @param box1 defines the second box to test
     * @returns true if there is an intersection
     */
    static Intersects(box0, box1) {
        return box0.intersectsMinMax(box1.minimumWorld, box1.maximumWorld);
    }
    /**
     * Tests if a bounding box defines by a min/max vectors intersects a sphere
     * @param minPoint defines the minimum vector of the bounding box
     * @param maxPoint defines the maximum vector of the bounding box
     * @param sphereCenter defines the sphere center
     * @param sphereRadius defines the sphere radius
     * @returns true if there is an intersection
     */
    static IntersectsSphere(minPoint, maxPoint, sphereCenter, sphereRadius) {
        const vector = BoundingBox._TmpVector3[0];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.ClampToRef(sphereCenter, minPoint, maxPoint, vector);
        const num = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.DistanceSquared(sphereCenter, vector);
        return num <= sphereRadius * sphereRadius;
    }
    /**
     * Tests if a bounding box defined with 8 vectors is entirely inside frustum planes
     * @param boundingVectors defines an array of 8 vectors representing a bounding box
     * @param frustumPlanes defines the frustum planes to test
     * @returns true if there is an inclusion
     */
    static IsCompletelyInFrustum(boundingVectors, frustumPlanes) {
        for (let p = 0; p < 6; ++p) {
            const frustumPlane = frustumPlanes[p];
            for (let i = 0; i < 8; ++i) {
                if (frustumPlane.dotCoordinate(boundingVectors[i]) < 0) {
                    return false;
                }
            }
        }
        return true;
    }
    /**
     * Tests if a bounding box defined with 8 vectors intersects frustum planes
     * @param boundingVectors defines an array of 8 vectors representing a bounding box
     * @param frustumPlanes defines the frustum planes to test
     * @returns true if there is an intersection
     */
    static IsInFrustum(boundingVectors, frustumPlanes) {
        for (let p = 0; p < 6; ++p) {
            let canReturnFalse = true;
            const frustumPlane = frustumPlanes[p];
            for (let i = 0; i < 8; ++i) {
                if (frustumPlane.dotCoordinate(boundingVectors[i]) >= 0) {
                    canReturnFalse = false;
                    break;
                }
            }
            if (canReturnFalse) {
                return false;
            }
        }
        return true;
    }
}
BoundingBox._TmpVector3 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .BuildArray */ .mI)(3, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero);
//# sourceMappingURL=boundingBox.js.map

/***/ }),

/***/ 20863:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   j: () => (/* binding */ BoundingInfo)
/* harmony export */ });
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27309);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _boundingBox_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84766);
/* harmony import */ var _boundingSphere_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27906);






const _result0 = { min: 0, max: 0 };
const _result1 = { min: 0, max: 0 };
const computeBoxExtents = (axis, box, result) => {
    const p = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(box.centerWorld, axis);
    const r0 = Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(box.directions[0], axis)) * box.extendSize.x;
    const r1 = Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(box.directions[1], axis)) * box.extendSize.y;
    const r2 = Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(box.directions[2], axis)) * box.extendSize.z;
    const r = r0 + r1 + r2;
    result.min = p - r;
    result.max = p + r;
};
const axisOverlap = (axis, box0, box1) => {
    computeBoxExtents(axis, box0, _result0);
    computeBoxExtents(axis, box1, _result1);
    return !(_result0.min > _result1.max || _result1.min > _result0.max);
};
/**
 * Info for a bounding data of a mesh
 */
class BoundingInfo {
    /**
     * Constructs bounding info
     * @param minimum min vector of the bounding box/sphere
     * @param maximum max vector of the bounding box/sphere
     * @param worldMatrix defines the new world matrix
     */
    constructor(minimum, maximum, worldMatrix) {
        this._isLocked = false;
        this.boundingBox = new _boundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* .BoundingBox */ .I(minimum, maximum, worldMatrix);
        this.boundingSphere = new _boundingSphere_js__WEBPACK_IMPORTED_MODULE_3__/* .BoundingSphere */ .i(minimum, maximum, worldMatrix);
    }
    /**
     * Recreates the entire bounding info from scratch as if we call the constructor in place
     * @param min defines the new minimum vector (in local space)
     * @param max defines the new maximum vector (in local space)
     * @param worldMatrix defines the new world matrix
     */
    reConstruct(min, max, worldMatrix) {
        this.boundingBox.reConstruct(min, max, worldMatrix);
        this.boundingSphere.reConstruct(min, max, worldMatrix);
    }
    /**
     * min vector of the bounding box/sphere
     */
    get minimum() {
        return this.boundingBox.minimum;
    }
    /**
     * max vector of the bounding box/sphere
     */
    get maximum() {
        return this.boundingBox.maximum;
    }
    /**
     * If the info is locked and won't be updated to avoid perf overhead
     */
    get isLocked() {
        return this._isLocked;
    }
    set isLocked(value) {
        this._isLocked = value;
    }
    // Methods
    /**
     * Updates the bounding sphere and box
     * @param world world matrix to be used to update
     */
    update(world) {
        if (this._isLocked) {
            return;
        }
        this.boundingBox._update(world);
        this.boundingSphere._update(world);
    }
    /**
     * Recreate the bounding info to be centered around a specific point given a specific extend.
     * @param center New center of the bounding info
     * @param extend New extend of the bounding info
     * @returns the current bounding info
     */
    centerOn(center, extend) {
        const minimum = BoundingInfo._TmpVector3[0].copyFrom(center).subtractInPlace(extend);
        const maximum = BoundingInfo._TmpVector3[1].copyFrom(center).addInPlace(extend);
        this.boundingBox.reConstruct(minimum, maximum, this.boundingBox.getWorldMatrix());
        this.boundingSphere.reConstruct(minimum, maximum, this.boundingBox.getWorldMatrix());
        return this;
    }
    /**
     * Grows the bounding info to include the given point.
     * @param point The point that will be included in the current bounding info (in local space)
     * @returns the current bounding info
     */
    encapsulate(point) {
        const minimum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Minimize(this.minimum, point);
        const maximum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Maximize(this.maximum, point);
        this.reConstruct(minimum, maximum, this.boundingBox.getWorldMatrix());
        return this;
    }
    /**
     * Grows the bounding info to encapsulate the given bounding info.
     * @param toEncapsulate The bounding info that will be encapsulated in the current bounding info
     * @returns the current bounding info
     */
    encapsulateBoundingInfo(toEncapsulate) {
        const invw = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0];
        this.boundingBox.getWorldMatrix().invertToRef(invw);
        const v = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinatesToRef(toEncapsulate.boundingBox.minimumWorld, invw, v);
        this.encapsulate(v);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinatesToRef(toEncapsulate.boundingBox.maximumWorld, invw, v);
        this.encapsulate(v);
        return this;
    }
    /**
     * Scale the current bounding info by applying a scale factor
     * @param factor defines the scale factor to apply
     * @returns the current bounding info
     */
    scale(factor) {
        this.boundingBox.scale(factor);
        this.boundingSphere.scale(factor);
        return this;
    }
    /**
     * Returns `true` if the bounding info is within the frustum defined by the passed array of planes.
     * @param frustumPlanes defines the frustum to test
     * @param strategy defines the strategy to use for the culling (default is BABYLON.AbstractMesh.CULLINGSTRATEGY_STANDARD)
     * The different strategies available are:
     * * BABYLON.AbstractMesh.CULLINGSTRATEGY_STANDARD most accurate but slower @see https://doc.babylonjs.com/typedoc/classes/BABYLON.AbstractMesh#CULLINGSTRATEGY_STANDARD
     * * BABYLON.AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY faster but less accurate @see https://doc.babylonjs.com/typedoc/classes/BABYLON.AbstractMesh#CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY
     * * BABYLON.AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION can be faster if always visible @see https://doc.babylonjs.com/typedoc/classes/BABYLON.AbstractMesh#CULLINGSTRATEGY_OPTIMISTIC_INCLUSION
     * * BABYLON.AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY can be faster if always visible @see https://doc.babylonjs.com/typedoc/classes/BABYLON.AbstractMesh#CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY
     * @returns true if the bounding info is in the frustum planes
     */
    isInFrustum(frustumPlanes, strategy = 0) {
        const inclusionTest = strategy === 2 || strategy === 3;
        if (inclusionTest) {
            if (this.boundingSphere.isCenterInFrustum(frustumPlanes)) {
                return true;
            }
        }
        if (!this.boundingSphere.isInFrustum(frustumPlanes)) {
            return false;
        }
        const bSphereOnlyTest = strategy === 1 || strategy === 3;
        if (bSphereOnlyTest) {
            return true;
        }
        return this.boundingBox.isInFrustum(frustumPlanes);
    }
    /**
     * Gets the world distance between the min and max points of the bounding box
     */
    get diagonalLength() {
        const boundingBox = this.boundingBox;
        const diag = boundingBox.maximumWorld.subtractToRef(boundingBox.minimumWorld, BoundingInfo._TmpVector3[0]);
        return diag.length();
    }
    /**
     * Checks if a cullable object (mesh...) is in the camera frustum
     * Unlike isInFrustum this checks the full bounding box
     * @param frustumPlanes Camera near/planes
     * @returns true if the object is in frustum otherwise false
     */
    isCompletelyInFrustum(frustumPlanes) {
        return this.boundingBox.isCompletelyInFrustum(frustumPlanes);
    }
    /**
     * @internal
     */
    _checkCollision(collider) {
        return collider._canDoCollision(this.boundingSphere.centerWorld, this.boundingSphere.radiusWorld, this.boundingBox.minimumWorld, this.boundingBox.maximumWorld);
    }
    /**
     * Checks if a point is inside the bounding box and bounding sphere or the mesh
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect
     * @param point the point to check intersection with
     * @returns if the point intersects
     */
    intersectsPoint(point) {
        if (!this.boundingSphere.centerWorld) {
            return false;
        }
        if (!this.boundingSphere.intersectsPoint(point)) {
            return false;
        }
        if (!this.boundingBox.intersectsPoint(point)) {
            return false;
        }
        return true;
    }
    /**
     * Checks if another bounding info intersects the bounding box and bounding sphere or the mesh
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect
     * @param boundingInfo the bounding info to check intersection with
     * @param precise if the intersection should be done using OBB
     * @returns if the bounding info intersects
     */
    intersects(boundingInfo, precise) {
        if (!_boundingSphere_js__WEBPACK_IMPORTED_MODULE_3__/* .BoundingSphere */ .i.Intersects(this.boundingSphere, boundingInfo.boundingSphere)) {
            return false;
        }
        if (!_boundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* .BoundingBox */ .I.Intersects(this.boundingBox, boundingInfo.boundingBox)) {
            return false;
        }
        if (!precise) {
            return true;
        }
        const box0 = this.boundingBox;
        const box1 = boundingInfo.boundingBox;
        if (!axisOverlap(box0.directions[0], box0, box1)) {
            return false;
        }
        if (!axisOverlap(box0.directions[1], box0, box1)) {
            return false;
        }
        if (!axisOverlap(box0.directions[2], box0, box1)) {
            return false;
        }
        if (!axisOverlap(box1.directions[0], box0, box1)) {
            return false;
        }
        if (!axisOverlap(box1.directions[1], box0, box1)) {
            return false;
        }
        if (!axisOverlap(box1.directions[2], box0, box1)) {
            return false;
        }
        if (!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(box0.directions[0], box1.directions[0]), box0, box1)) {
            return false;
        }
        if (!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(box0.directions[0], box1.directions[1]), box0, box1)) {
            return false;
        }
        if (!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(box0.directions[0], box1.directions[2]), box0, box1)) {
            return false;
        }
        if (!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(box0.directions[1], box1.directions[0]), box0, box1)) {
            return false;
        }
        if (!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(box0.directions[1], box1.directions[1]), box0, box1)) {
            return false;
        }
        if (!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(box0.directions[1], box1.directions[2]), box0, box1)) {
            return false;
        }
        if (!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(box0.directions[2], box1.directions[0]), box0, box1)) {
            return false;
        }
        if (!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(box0.directions[2], box1.directions[1]), box0, box1)) {
            return false;
        }
        if (!axisOverlap(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(box0.directions[2], box1.directions[2]), box0, box1)) {
            return false;
        }
        return true;
    }
}
BoundingInfo._TmpVector3 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .BuildArray */ .mI)(2, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero);
//# sourceMappingURL=boundingInfo.js.map

/***/ }),

/***/ 27906:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   i: () => (/* binding */ BoundingSphere)
/* harmony export */ });
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27309);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);


/**
 * Class used to store bounding sphere information
 */
class BoundingSphere {
    /**
     * Creates a new bounding sphere
     * @param min defines the minimum vector (in local space)
     * @param max defines the maximum vector (in local space)
     * @param worldMatrix defines the new world matrix
     */
    constructor(min, max, worldMatrix) {
        /**
         * Gets the center of the bounding sphere in local space
         */
        this.center = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets the center of the bounding sphere in world space
         */
        this.centerWorld = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets the minimum vector in local space
         */
        this.minimum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        /**
         * Gets the maximum vector in local space
         */
        this.maximum = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        this.reConstruct(min, max, worldMatrix);
    }
    /**
     * Recreates the entire bounding sphere from scratch as if we call the constructor in place
     * @param min defines the new minimum vector (in local space)
     * @param max defines the new maximum vector (in local space)
     * @param worldMatrix defines the new world matrix
     */
    reConstruct(min, max, worldMatrix) {
        this.minimum.copyFrom(min);
        this.maximum.copyFrom(max);
        const distance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Distance(min, max);
        max.addToRef(min, this.center).scaleInPlace(0.5);
        this.radius = distance * 0.5;
        this._update(worldMatrix || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.IdentityReadOnly);
    }
    /**
     * Scale the current bounding sphere by applying a scale factor
     * @param factor defines the scale factor to apply
     * @returns the current bounding box
     */
    scale(factor) {
        const newRadius = this.radius * factor;
        const tmpVectors = BoundingSphere._TmpVector3;
        const tempRadiusVector = tmpVectors[0].setAll(newRadius);
        const min = this.center.subtractToRef(tempRadiusVector, tmpVectors[1]);
        const max = this.center.addToRef(tempRadiusVector, tmpVectors[2]);
        this.reConstruct(min, max, this._worldMatrix);
        return this;
    }
    /**
     * Gets the world matrix of the bounding box
     * @returns a matrix
     */
    getWorldMatrix() {
        return this._worldMatrix;
    }
    // Methods
    /**
     * @internal
     */
    _update(worldMatrix) {
        if (!worldMatrix.isIdentity()) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinatesToRef(this.center, worldMatrix, this.centerWorld);
            const tempVector = BoundingSphere._TmpVector3[0];
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformNormalFromFloatsToRef(1.0, 1.0, 1.0, worldMatrix, tempVector);
            this.radiusWorld = Math.max(Math.abs(tempVector.x), Math.abs(tempVector.y), Math.abs(tempVector.z)) * this.radius;
        }
        else {
            this.centerWorld.copyFrom(this.center);
            this.radiusWorld = this.radius;
        }
    }
    /**
     * Tests if the bounding sphere is intersecting the frustum planes
     * @param frustumPlanes defines the frustum planes to test
     * @returns true if there is an intersection
     */
    isInFrustum(frustumPlanes) {
        const center = this.centerWorld;
        const radius = this.radiusWorld;
        for (let i = 0; i < 6; i++) {
            if (frustumPlanes[i].dotCoordinate(center) <= -radius) {
                return false;
            }
        }
        return true;
    }
    /**
     * Tests if the bounding sphere center is in between the frustum planes.
     * Used for optimistic fast inclusion.
     * @param frustumPlanes defines the frustum planes to test
     * @returns true if the sphere center is in between the frustum planes
     */
    isCenterInFrustum(frustumPlanes) {
        const center = this.centerWorld;
        for (let i = 0; i < 6; i++) {
            if (frustumPlanes[i].dotCoordinate(center) < 0) {
                return false;
            }
        }
        return true;
    }
    /**
     * Tests if a point is inside the bounding sphere
     * @param point defines the point to test
     * @returns true if the point is inside the bounding sphere
     */
    intersectsPoint(point) {
        const squareDistance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.DistanceSquared(this.centerWorld, point);
        if (this.radiusWorld * this.radiusWorld < squareDistance) {
            return false;
        }
        return true;
    }
    // Statics
    /**
     * Checks if two sphere intersect
     * @param sphere0 sphere 0
     * @param sphere1 sphere 1
     * @returns true if the spheres intersect
     */
    static Intersects(sphere0, sphere1) {
        const squareDistance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.DistanceSquared(sphere0.centerWorld, sphere1.centerWorld);
        const radiusSum = sphere0.radiusWorld + sphere1.radiusWorld;
        if (radiusSum * radiusSum < squareDistance) {
            return false;
        }
        return true;
    }
    /**
     * Creates a sphere from a center and a radius
     * @param center The center
     * @param radius radius
     * @param matrix Optional worldMatrix
     * @returns The sphere
     */
    static CreateFromCenterAndRadius(center, radius, matrix) {
        this._TmpVector3[0].copyFrom(center);
        this._TmpVector3[1].copyFromFloats(0, 0, radius);
        this._TmpVector3[2].copyFrom(center);
        this._TmpVector3[0].addInPlace(this._TmpVector3[1]);
        this._TmpVector3[2].subtractInPlace(this._TmpVector3[1]);
        const sphere = new BoundingSphere(this._TmpVector3[0], this._TmpVector3[2]);
        if (matrix) {
            sphere._worldMatrix = matrix;
        }
        else {
            sphere._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity();
        }
        return sphere;
    }
}
BoundingSphere._TmpVector3 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .BuildArray */ .mI)(3, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero);
//# sourceMappingURL=boundingSphere.js.map

/***/ }),

/***/ 48086:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AU: () => (/* binding */ CreatePickingRayInCameraSpace),
/* harmony export */   DY: () => (/* binding */ MultiPick),
/* harmony export */   Gz: () => (/* binding */ CreatePickingRayToRef),
/* harmony export */   KI: () => (/* binding */ GetForwardRay),
/* harmony export */   Oj: () => (/* binding */ AddRayExtensions),
/* harmony export */   R0: () => (/* binding */ PickingCustomization),
/* harmony export */   Rl: () => (/* binding */ Ray),
/* harmony export */   S: () => (/* binding */ PickWithRay),
/* harmony export */   TR: () => (/* binding */ MultiPickWithRay),
/* harmony export */   m9: () => (/* binding */ GetForwardRayToRef),
/* harmony export */   mc: () => (/* binding */ Pick),
/* harmony export */   oZ: () => (/* binding */ CreatePickingRayInCameraSpaceToRef),
/* harmony export */   uW: () => (/* binding */ PickWithBoundingInfo),
/* harmony export */   ui: () => (/* binding */ CreatePickingRay)
/* harmony export */ });
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65559);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27309);
/* harmony import */ var _Collisions_intersectionInfo_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77103);
/* harmony import */ var _Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30311);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6315);
/* harmony import */ var _import_helper_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65877);







/**
 * Use this object to customize mesh picking behavior
 */
const PickingCustomization = {
    internalPickerForMesh: undefined,
};
/**
 * Class representing a ray with position and direction
 */
class Ray {
    /**
     * Creates a new ray
     * @param origin origin point
     * @param direction direction
     * @param length length of the ray
     * @param epsilon The epsilon value to use when calculating the ray/triangle intersection (default: 0)
     */
    constructor(
    /** origin point */
    origin, 
    /** direction */
    direction, 
    /** [Number.MAX_VALUE] length of the ray */
    length = Number.MAX_VALUE, 
    /** [Epsilon] The epsilon value to use when calculating the ray/triangle intersection (default: Epsilon from math constants) */
    epsilon = _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
        this.origin = origin;
        this.direction = direction;
        this.length = length;
        this.epsilon = epsilon;
    }
    // Methods
    /**
     * Clone the current ray
     * @returns a new ray
     */
    clone() {
        return new Ray(this.origin.clone(), this.direction.clone(), this.length);
    }
    /**
     * Checks if the ray intersects a box
     * This does not account for the ray length by design to improve perfs.
     * @param minimum bound of the box
     * @param maximum bound of the box
     * @param intersectionTreshold extra extend to be added to the box in all direction
     * @returns if the box was hit
     */
    intersectsBoxMinMax(minimum, maximum, intersectionTreshold = 0) {
        const newMinimum = Ray._TmpVector3[0].copyFromFloats(minimum.x - intersectionTreshold, minimum.y - intersectionTreshold, minimum.z - intersectionTreshold);
        const newMaximum = Ray._TmpVector3[1].copyFromFloats(maximum.x + intersectionTreshold, maximum.y + intersectionTreshold, maximum.z + intersectionTreshold);
        let d = 0.0;
        let maxValue = Number.MAX_VALUE;
        let inv;
        let min;
        let max;
        let temp;
        if (Math.abs(this.direction.x) < 0.0000001) {
            if (this.origin.x < newMinimum.x || this.origin.x > newMaximum.x) {
                return false;
            }
        }
        else {
            inv = 1.0 / this.direction.x;
            min = (newMinimum.x - this.origin.x) * inv;
            max = (newMaximum.x - this.origin.x) * inv;
            if (max === -Infinity) {
                max = Infinity;
            }
            if (min > max) {
                temp = min;
                min = max;
                max = temp;
            }
            d = Math.max(min, d);
            maxValue = Math.min(max, maxValue);
            if (d > maxValue) {
                return false;
            }
        }
        if (Math.abs(this.direction.y) < 0.0000001) {
            if (this.origin.y < newMinimum.y || this.origin.y > newMaximum.y) {
                return false;
            }
        }
        else {
            inv = 1.0 / this.direction.y;
            min = (newMinimum.y - this.origin.y) * inv;
            max = (newMaximum.y - this.origin.y) * inv;
            if (max === -Infinity) {
                max = Infinity;
            }
            if (min > max) {
                temp = min;
                min = max;
                max = temp;
            }
            d = Math.max(min, d);
            maxValue = Math.min(max, maxValue);
            if (d > maxValue) {
                return false;
            }
        }
        if (Math.abs(this.direction.z) < 0.0000001) {
            if (this.origin.z < newMinimum.z || this.origin.z > newMaximum.z) {
                return false;
            }
        }
        else {
            inv = 1.0 / this.direction.z;
            min = (newMinimum.z - this.origin.z) * inv;
            max = (newMaximum.z - this.origin.z) * inv;
            if (max === -Infinity) {
                max = Infinity;
            }
            if (min > max) {
                temp = min;
                min = max;
                max = temp;
            }
            d = Math.max(min, d);
            maxValue = Math.min(max, maxValue);
            if (d > maxValue) {
                return false;
            }
        }
        return true;
    }
    /**
     * Checks if the ray intersects a box
     * This does not account for the ray lenght by design to improve perfs.
     * @param box the bounding box to check
     * @param intersectionTreshold extra extend to be added to the BoundingBox in all direction
     * @returns if the box was hit
     */
    intersectsBox(box, intersectionTreshold = 0) {
        return this.intersectsBoxMinMax(box.minimum, box.maximum, intersectionTreshold);
    }
    /**
     * If the ray hits a sphere
     * @param sphere the bounding sphere to check
     * @param intersectionTreshold extra extend to be added to the BoundingSphere in all direction
     * @returns true if it hits the sphere
     */
    intersectsSphere(sphere, intersectionTreshold = 0) {
        const x = sphere.center.x - this.origin.x;
        const y = sphere.center.y - this.origin.y;
        const z = sphere.center.z - this.origin.z;
        const pyth = x * x + y * y + z * z;
        const radius = sphere.radius + intersectionTreshold;
        const rr = radius * radius;
        if (pyth <= rr) {
            return true;
        }
        const dot = x * this.direction.x + y * this.direction.y + z * this.direction.z;
        if (dot < 0.0) {
            return false;
        }
        const temp = pyth - dot * dot;
        return temp <= rr;
    }
    /**
     * If the ray hits a triange
     * @param vertex0 triangle vertex
     * @param vertex1 triangle vertex
     * @param vertex2 triangle vertex
     * @returns intersection information if hit
     */
    intersectsTriangle(vertex0, vertex1, vertex2) {
        const edge1 = Ray._TmpVector3[0];
        const edge2 = Ray._TmpVector3[1];
        const pvec = Ray._TmpVector3[2];
        const tvec = Ray._TmpVector3[3];
        const qvec = Ray._TmpVector3[4];
        vertex1.subtractToRef(vertex0, edge1);
        vertex2.subtractToRef(vertex0, edge2);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CrossToRef(this.direction, edge2, pvec);
        const det = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(edge1, pvec);
        if (det === 0) {
            return null;
        }
        const invdet = 1 / det;
        this.origin.subtractToRef(vertex0, tvec);
        const bv = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(tvec, pvec) * invdet;
        if (bv < -this.epsilon || bv > 1.0 + this.epsilon) {
            return null;
        }
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CrossToRef(tvec, edge1, qvec);
        const bw = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(this.direction, qvec) * invdet;
        if (bw < -this.epsilon || bv + bw > 1.0 + this.epsilon) {
            return null;
        }
        //check if the distance is longer than the predefined length.
        const distance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(edge2, qvec) * invdet;
        if (distance > this.length) {
            return null;
        }
        return new _Collisions_intersectionInfo_js__WEBPACK_IMPORTED_MODULE_3__/* .IntersectionInfo */ .w(1 - bv - bw, bv, distance);
    }
    /**
     * Checks if ray intersects a plane
     * @param plane the plane to check
     * @returns the distance away it was hit
     */
    intersectsPlane(plane) {
        let distance;
        const result1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(plane.normal, this.direction);
        if (Math.abs(result1) < 9.99999997475243e-7) {
            return null;
        }
        else {
            const result2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(plane.normal, this.origin);
            distance = (-plane.d - result2) / result1;
            if (distance < 0.0) {
                if (distance < -9.99999997475243e-7) {
                    return null;
                }
                else {
                    return 0;
                }
            }
            return distance;
        }
    }
    /**
     * Calculate the intercept of a ray on a given axis
     * @param axis to check 'x' | 'y' | 'z'
     * @param offset from axis interception (i.e. an offset of 1y is intercepted above ground)
     * @returns a vector containing the coordinates where 'axis' is equal to zero (else offset), or null if there is no intercept.
     */
    intersectsAxis(axis, offset = 0) {
        switch (axis) {
            case "y": {
                const t = (this.origin.y - offset) / this.direction.y;
                if (t > 0) {
                    return null;
                }
                return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(this.origin.x + this.direction.x * -t, offset, this.origin.z + this.direction.z * -t);
            }
            case "x": {
                const t = (this.origin.x - offset) / this.direction.x;
                if (t > 0) {
                    return null;
                }
                return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(offset, this.origin.y + this.direction.y * -t, this.origin.z + this.direction.z * -t);
            }
            case "z": {
                const t = (this.origin.z - offset) / this.direction.z;
                if (t > 0) {
                    return null;
                }
                return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(this.origin.x + this.direction.x * -t, this.origin.y + this.direction.y * -t, offset);
            }
            default:
                return null;
        }
    }
    /**
     * Checks if ray intersects a mesh. The ray is defined in WORLD space. A mesh triangle can be picked both from its front and back sides,
     * irrespective of orientation.
     * @param mesh the mesh to check
     * @param fastCheck defines if the first intersection will be used (and not the closest)
     * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
     * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
     * @param worldToUse defines the world matrix to use to get the world coordinate of the intersection point
     * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
     * @returns picking info of the intersection
     */
    intersectsMesh(mesh, fastCheck, trianglePredicate, onlyBoundingInfo = false, worldToUse, skipBoundingInfo = false) {
        const tm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0];
        mesh.getWorldMatrix().invertToRef(tm);
        if (this._tmpRay) {
            Ray.TransformToRef(this, tm, this._tmpRay);
        }
        else {
            this._tmpRay = Ray.Transform(this, tm);
        }
        return mesh.intersects(this._tmpRay, fastCheck, trianglePredicate, onlyBoundingInfo, worldToUse, skipBoundingInfo);
    }
    /**
     * Checks if ray intersects a mesh
     * @param meshes the meshes to check
     * @param fastCheck defines if the first intersection will be used (and not the closest)
     * @param results array to store result in
     * @returns Array of picking infos
     */
    intersectsMeshes(meshes, fastCheck, results) {
        if (results) {
            results.length = 0;
        }
        else {
            results = [];
        }
        for (let i = 0; i < meshes.length; i++) {
            const pickInfo = this.intersectsMesh(meshes[i], fastCheck);
            if (pickInfo.hit) {
                results.push(pickInfo);
            }
        }
        results.sort(this._comparePickingInfo);
        return results;
    }
    _comparePickingInfo(pickingInfoA, pickingInfoB) {
        if (pickingInfoA.distance < pickingInfoB.distance) {
            return -1;
        }
        else if (pickingInfoA.distance > pickingInfoB.distance) {
            return 1;
        }
        else {
            return 0;
        }
    }
    /**
     * Intersection test between the ray and a given segment within a given tolerance (threshold)
     * @param sega the first point of the segment to test the intersection against
     * @param segb the second point of the segment to test the intersection against
     * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
     * @returns the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
     */
    intersectionSegment(sega, segb, threshold) {
        const o = this.origin;
        const u = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
        const rsegb = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1];
        const v = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2];
        const w = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[3];
        segb.subtractToRef(sega, u);
        this.direction.scaleToRef(Ray._Rayl, v);
        o.addToRef(v, rsegb);
        sega.subtractToRef(o, w);
        const a = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(u, u); // always >= 0
        const b = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(u, v);
        const c = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(v, v); // always >= 0
        const d = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(u, w);
        const e = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(v, w);
        const D = a * c - b * b; // always >= 0
        let sN, sD = D; // sc = sN / sD, default sD = D >= 0
        let tN, tD = D; // tc = tN / tD, default tD = D >= 0
        // compute the line parameters of the two closest points
        if (D < Ray._Smallnum) {
            // the lines are almost parallel
            sN = 0.0; // force using point P0 on segment S1
            sD = 1.0; // to prevent possible division by 0.0 later
            tN = e;
            tD = c;
        }
        else {
            // get the closest points on the infinite lines
            sN = b * e - c * d;
            tN = a * e - b * d;
            if (sN < 0.0) {
                // sc < 0 => the s=0 edge is visible
                sN = 0.0;
                tN = e;
                tD = c;
            }
            else if (sN > sD) {
                // sc > 1 => the s=1 edge is visible
                sN = sD;
                tN = e + b;
                tD = c;
            }
        }
        if (tN < 0.0) {
            // tc < 0 => the t=0 edge is visible
            tN = 0.0;
            // recompute sc for this edge
            if (-d < 0.0) {
                sN = 0.0;
            }
            else if (-d > a) {
                sN = sD;
            }
            else {
                sN = -d;
                sD = a;
            }
        }
        else if (tN > tD) {
            // tc > 1 => the t=1 edge is visible
            tN = tD;
            // recompute sc for this edge
            if (-d + b < 0.0) {
                sN = 0;
            }
            else if (-d + b > a) {
                sN = sD;
            }
            else {
                sN = -d + b;
                sD = a;
            }
        }
        // finally do the division to get sc and tc
        const sc = Math.abs(sN) < Ray._Smallnum ? 0.0 : sN / sD;
        const tc = Math.abs(tN) < Ray._Smallnum ? 0.0 : tN / tD;
        // get the difference of the two closest points
        const qtc = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[4];
        v.scaleToRef(tc, qtc);
        const qsc = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[5];
        u.scaleToRef(sc, qsc);
        qsc.addInPlace(w);
        const dP = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[6];
        qsc.subtractToRef(qtc, dP); // = S1(sc) - S2(tc)
        const isIntersected = tc > 0 && tc <= this.length && dP.lengthSquared() < threshold * threshold; // return intersection result
        if (isIntersected) {
            return qsc.length();
        }
        return -1;
    }
    /**
     * Update the ray from viewport position
     * @param x position
     * @param y y position
     * @param viewportWidth viewport width
     * @param viewportHeight viewport height
     * @param world world matrix
     * @param view view matrix
     * @param projection projection matrix
     * @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
     * @returns this ray updated
     */
    update(x, y, viewportWidth, viewportHeight, world, view, projection, enableDistantPicking = false) {
        if (enableDistantPicking) {
            // With world matrices having great values (like 8000000000 on 1 or more scaling or position axis),
            // multiplying view/projection/world and doing invert will result in loss of float precision in the matrix.
            // One way to fix it is to compute the ray with world at identity then transform the ray in object space.
            // This is slower (2 matrix inverts instead of 1) but precision is preserved.
            // This is hidden behind `EnableDistantPicking` flag (default is false)
            if (!Ray._RayDistant) {
                Ray._RayDistant = Ray.Zero();
            }
            Ray._RayDistant.unprojectRayToRef(x, y, viewportWidth, viewportHeight, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.IdentityReadOnly, view, projection);
            const tm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0];
            world.invertToRef(tm);
            Ray.TransformToRef(Ray._RayDistant, tm, this);
        }
        else {
            this.unprojectRayToRef(x, y, viewportWidth, viewportHeight, world, view, projection);
        }
        return this;
    }
    // Statics
    /**
     * Creates a ray with origin and direction of 0,0,0
     * @returns the new ray
     */
    static Zero() {
        return new Ray(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero());
    }
    /**
     * Creates a new ray from screen space and viewport
     * @param x position
     * @param y y position
     * @param viewportWidth viewport width
     * @param viewportHeight viewport height
     * @param world world matrix
     * @param view view matrix
     * @param projection projection matrix
     * @returns new ray
     */
    static CreateNew(x, y, viewportWidth, viewportHeight, world, view, projection) {
        const result = Ray.Zero();
        return result.update(x, y, viewportWidth, viewportHeight, world, view, projection);
    }
    /**
     * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
     * transformed to the given world matrix.
     * @param origin The origin point
     * @param end The end point
     * @param world a matrix to transform the ray to. Default is the identity matrix.
     * @returns the new ray
     */
    static CreateNewFromTo(origin, end, world = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.IdentityReadOnly) {
        const result = new Ray(new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(0, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(0, 0, 0));
        return Ray.CreateFromToToRef(origin, end, result, world);
    }
    /**
     * Function will update a transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
     * transformed to the given world matrix.
     * @param origin The origin point
     * @param end The end point
     * @param result the object to store the result
     * @param world a matrix to transform the ray to. Default is the identity matrix.
     * @returns the ref ray
     */
    static CreateFromToToRef(origin, end, result, world = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.IdentityReadOnly) {
        result.origin.copyFrom(origin);
        const direction = end.subtractToRef(origin, result.direction);
        const length = Math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z);
        result.length = length;
        result.direction.normalize();
        return Ray.TransformToRef(result, world, result);
    }
    /**
     * Transforms a ray by a matrix
     * @param ray ray to transform
     * @param matrix matrix to apply
     * @returns the resulting new ray
     */
    static Transform(ray, matrix) {
        const result = new Ray(new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(0, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(0, 0, 0));
        Ray.TransformToRef(ray, matrix, result);
        return result;
    }
    /**
     * Transforms a ray by a matrix
     * @param ray ray to transform
     * @param matrix matrix to apply
     * @param result ray to store result in
     * @returns the updated result ray
     */
    static TransformToRef(ray, matrix, result) {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinatesToRef(ray.origin, matrix, result.origin);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformNormalToRef(ray.direction, matrix, result.direction);
        result.length = ray.length;
        result.epsilon = ray.epsilon;
        const dir = result.direction;
        const len = dir.length();
        if (!(len === 0 || len === 1)) {
            const num = 1.0 / len;
            dir.x *= num;
            dir.y *= num;
            dir.z *= num;
            result.length *= len;
        }
        return result;
    }
    /**
     * Unproject a ray from screen space to object space
     * @param sourceX defines the screen space x coordinate to use
     * @param sourceY defines the screen space y coordinate to use
     * @param viewportWidth defines the current width of the viewport
     * @param viewportHeight defines the current height of the viewport
     * @param world defines the world matrix to use (can be set to Identity to go to world space)
     * @param view defines the view matrix to use
     * @param projection defines the projection matrix to use
     */
    unprojectRayToRef(sourceX, sourceY, viewportWidth, viewportHeight, world, view, projection) {
        const matrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0];
        world.multiplyToRef(view, matrix);
        matrix.multiplyToRef(projection, matrix);
        matrix.invert();
        const engine = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_5__/* .EngineStore */ .q.LastCreatedEngine;
        const nearScreenSource = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
        nearScreenSource.x = (sourceX / viewportWidth) * 2 - 1;
        nearScreenSource.y = -((sourceY / viewportHeight) * 2 - 1);
        nearScreenSource.z = engine?.useReverseDepthBuffer ? 1 : engine?.isNDCHalfZRange ? 0 : -1;
        // far Z need to be close but < to 1 or camera projection matrix with maxZ = 0 will NaN
        const farScreenSource = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1].copyFromFloats(nearScreenSource.x, nearScreenSource.y, 1.0 - 1e-8);
        const nearVec3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2];
        const farVec3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[3];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq._UnprojectFromInvertedMatrixToRef(nearScreenSource, matrix, nearVec3);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq._UnprojectFromInvertedMatrixToRef(farScreenSource, matrix, farVec3);
        this.origin.copyFrom(nearVec3);
        farVec3.subtractToRef(nearVec3, this.direction);
        this.direction.normalize();
    }
}
Ray._TmpVector3 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* .BuildArray */ .mI)(6, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero);
Ray._RayDistant = Ray.Zero();
Ray._Smallnum = 0.00000001;
Ray._Rayl = 10e8;
/**
 * Creates a ray that can be used to pick in the scene
 * @param scene defines the scene to use for the picking
 * @param x defines the x coordinate of the origin (on-screen)
 * @param y defines the y coordinate of the origin (on-screen)
 * @param world defines the world matrix to use if you want to pick in object space (instead of world space)
 * @param camera defines the camera to use for the picking
 * @param cameraViewSpace defines if picking will be done in view space (false by default)
 * @returns a Ray
 */
function CreatePickingRay(scene, x, y, world, camera, cameraViewSpace = false) {
    const result = Ray.Zero();
    CreatePickingRayToRef(scene, x, y, world, result, camera, cameraViewSpace);
    return result;
}
/**
 * Creates a ray that can be used to pick in the scene
 * @param scene defines the scene to use for the picking
 * @param x defines the x coordinate of the origin (on-screen)
 * @param y defines the y coordinate of the origin (on-screen)
 * @param world defines the world matrix to use if you want to pick in object space (instead of world space)
 * @param result defines the ray where to store the picking ray
 * @param camera defines the camera to use for the picking
 * @param cameraViewSpace defines if picking will be done in view space (false by default)
 * @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
 * @returns the current scene
 */
function CreatePickingRayToRef(scene, x, y, world, result, camera, cameraViewSpace = false, enableDistantPicking = false) {
    const engine = scene.getEngine();
    if (!camera && !(camera = scene.activeCamera)) {
        return scene;
    }
    const cameraViewport = camera.viewport;
    const renderHeight = engine.getRenderHeight();
    const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine.getRenderWidth(), renderHeight);
    // Moving coordinates to local viewport world
    const levelInv = 1 / engine.getHardwareScalingLevel();
    x = x * levelInv - vx;
    y = y * levelInv - (renderHeight - vy - height);
    result.update(x, y, width, height, world ? world : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.IdentityReadOnly, cameraViewSpace ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.IdentityReadOnly : camera.getViewMatrix(), camera.getProjectionMatrix(), enableDistantPicking);
    return scene;
}
/**
 * Creates a ray that can be used to pick in the scene
 * @param scene defines the scene to use for the picking
 * @param x defines the x coordinate of the origin (on-screen)
 * @param y defines the y coordinate of the origin (on-screen)
 * @param camera defines the camera to use for the picking
 * @returns a Ray
 */
function CreatePickingRayInCameraSpace(scene, x, y, camera) {
    const result = Ray.Zero();
    CreatePickingRayInCameraSpaceToRef(scene, x, y, result, camera);
    return result;
}
/**
 * Creates a ray that can be used to pick in the scene
 * @param scene defines the scene to use for the picking
 * @param x defines the x coordinate of the origin (on-screen)
 * @param y defines the y coordinate of the origin (on-screen)
 * @param result defines the ray where to store the picking ray
 * @param camera defines the camera to use for the picking
 * @returns the current scene
 */
function CreatePickingRayInCameraSpaceToRef(scene, x, y, result, camera) {
    if (!_Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_4__/* .PickingInfo */ .G) {
        return scene;
    }
    const engine = scene.getEngine();
    if (!camera && !(camera = scene.activeCamera)) {
        throw new Error("Active camera not set");
    }
    const cameraViewport = camera.viewport;
    const renderHeight = engine.getRenderHeight();
    const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine.getRenderWidth(), renderHeight);
    const identity = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity();
    // Moving coordinates to local viewport world
    const levelInv = 1 / engine.getHardwareScalingLevel();
    x = x * levelInv - vx;
    y = y * levelInv - (renderHeight - vy - height);
    result.update(x, y, width, height, identity, identity, camera.getProjectionMatrix());
    return scene;
}
function InternalPickForMesh(pickingInfo, rayFunction, mesh, world, fastCheck, onlyBoundingInfo, trianglePredicate, skipBoundingInfo) {
    const ray = rayFunction(world, mesh.enableDistantPicking);
    const result = mesh.intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo, world, skipBoundingInfo);
    if (!result || !result.hit) {
        return null;
    }
    if (!fastCheck && pickingInfo != null && result.distance >= pickingInfo.distance) {
        return null;
    }
    return result;
}
function InternalPick(scene, rayFunction, predicate, fastCheck, onlyBoundingInfo, trianglePredicate) {
    let pickingInfo = null;
    const computeWorldMatrixForCamera = !!(scene.activeCameras && scene.activeCameras.length > 1 && scene.cameraToUseForPointers !== scene.activeCamera);
    const currentCamera = scene.cameraToUseForPointers || scene.activeCamera;
    const picker = PickingCustomization.internalPickerForMesh || InternalPickForMesh;
    for (let meshIndex = 0; meshIndex < scene.meshes.length; meshIndex++) {
        const mesh = scene.meshes[meshIndex];
        if (predicate) {
            if (!predicate(mesh, -1)) {
                continue;
            }
        }
        else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) {
            continue;
        }
        const forceCompute = computeWorldMatrixForCamera && mesh.isWorldMatrixCameraDependent();
        const world = mesh.computeWorldMatrix(forceCompute, currentCamera);
        if (mesh.hasThinInstances && mesh.thinInstanceEnablePicking) {
            // first check if the ray intersects the whole bounding box/sphere of the mesh
            const result = picker(pickingInfo, rayFunction, mesh, world, true, true, trianglePredicate);
            if (result) {
                if (onlyBoundingInfo) {
                    // the user only asked for a bounding info check so we can return
                    return result;
                }
                const tmpMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[1];
                const thinMatrices = mesh.thinInstanceGetWorldMatrices();
                for (let index = 0; index < thinMatrices.length; index++) {
                    if (predicate && !predicate(mesh, index)) {
                        continue;
                    }
                    const thinMatrix = thinMatrices[index];
                    thinMatrix.multiplyToRef(world, tmpMatrix);
                    const result = picker(pickingInfo, rayFunction, mesh, tmpMatrix, fastCheck, onlyBoundingInfo, trianglePredicate, true);
                    if (result) {
                        pickingInfo = result;
                        pickingInfo.thinInstanceIndex = index;
                        if (fastCheck) {
                            return pickingInfo;
                        }
                    }
                }
            }
        }
        else {
            const result = picker(pickingInfo, rayFunction, mesh, world, fastCheck, onlyBoundingInfo, trianglePredicate);
            if (result) {
                pickingInfo = result;
                if (fastCheck) {
                    return pickingInfo;
                }
            }
        }
    }
    return pickingInfo || new _Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_4__/* .PickingInfo */ .G();
}
function InternalMultiPick(scene, rayFunction, predicate, trianglePredicate) {
    if (!_Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_4__/* .PickingInfo */ .G) {
        return null;
    }
    const pickingInfos = [];
    const computeWorldMatrixForCamera = !!(scene.activeCameras && scene.activeCameras.length > 1 && scene.cameraToUseForPointers !== scene.activeCamera);
    const currentCamera = scene.cameraToUseForPointers || scene.activeCamera;
    const picker = PickingCustomization.internalPickerForMesh || InternalPickForMesh;
    for (let meshIndex = 0; meshIndex < scene.meshes.length; meshIndex++) {
        const mesh = scene.meshes[meshIndex];
        if (predicate) {
            if (!predicate(mesh, -1)) {
                continue;
            }
        }
        else if (!mesh.isEnabled() || !mesh.isVisible || !mesh.isPickable) {
            continue;
        }
        const forceCompute = computeWorldMatrixForCamera && mesh.isWorldMatrixCameraDependent();
        const world = mesh.computeWorldMatrix(forceCompute, currentCamera);
        if (mesh.hasThinInstances && mesh.thinInstanceEnablePicking) {
            const result = picker(null, rayFunction, mesh, world, true, true, trianglePredicate);
            if (result) {
                const tmpMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[1];
                const thinMatrices = mesh.thinInstanceGetWorldMatrices();
                for (let index = 0; index < thinMatrices.length; index++) {
                    if (predicate && !predicate(mesh, index)) {
                        continue;
                    }
                    const thinMatrix = thinMatrices[index];
                    thinMatrix.multiplyToRef(world, tmpMatrix);
                    const result = picker(null, rayFunction, mesh, tmpMatrix, false, false, trianglePredicate, true);
                    if (result) {
                        result.thinInstanceIndex = index;
                        pickingInfos.push(result);
                    }
                }
            }
        }
        else {
            const result = picker(null, rayFunction, mesh, world, false, false, trianglePredicate);
            if (result) {
                pickingInfos.push(result);
            }
        }
    }
    return pickingInfos;
}
/** Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)
 * @param scene defines the scene to use for the picking
 * @param x position on screen
 * @param y position on screen
 * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
 * @param fastCheck defines if the first intersection will be used (and not the closest)
 * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
 * @returns a PickingInfo (Please note that some info will not be set like distance, bv, bu and everything that cannot be capture by only using bounding infos)
 */
function PickWithBoundingInfo(scene, x, y, predicate, fastCheck, camera) {
    if (!_Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_4__/* .PickingInfo */ .G) {
        return null;
    }
    const result = InternalPick(scene, (world) => {
        if (!scene._tempPickingRay) {
            scene._tempPickingRay = Ray.Zero();
        }
        CreatePickingRayToRef(scene, x, y, world, scene._tempPickingRay, camera || null);
        return scene._tempPickingRay;
    }, predicate, fastCheck, true);
    if (result) {
        result.ray = CreatePickingRay(scene, x, y, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity(), camera || null);
    }
    return result;
}
/** Launch a ray to try to pick a mesh in the scene
 * @param scene defines the scene to use for the picking
 * @param x position on screen
 * @param y position on screen
 * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
 * @param fastCheck defines if the first intersection will be used (and not the closest)
 * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
 * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
 * @param _enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
 * @returns a PickingInfo
 */
function Pick(scene, x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking = false) {
    const result = InternalPick(scene, (world, enableDistantPicking) => {
        if (!scene._tempPickingRay) {
            scene._tempPickingRay = Ray.Zero();
        }
        CreatePickingRayToRef(scene, x, y, world, scene._tempPickingRay, camera || null, false, enableDistantPicking);
        return scene._tempPickingRay;
    }, predicate, fastCheck, false, trianglePredicate);
    if (result) {
        result.ray = CreatePickingRay(scene, x, y, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity(), camera || null);
    }
    return result;
}
/**
 * Use the given ray to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
 * irrespective of orientation.
 * @param scene defines the scene to use for the picking
 * @param ray The ray to use to pick meshes
 * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must have isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
 * @param fastCheck defines if the first intersection will be used (and not the closest)
 * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
 * @returns a PickingInfo
 */
function PickWithRay(scene, ray, predicate, fastCheck, trianglePredicate) {
    const result = InternalPick(scene, (world) => {
        if (!scene._pickWithRayInverseMatrix) {
            scene._pickWithRayInverseMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity();
        }
        world.invertToRef(scene._pickWithRayInverseMatrix);
        if (!scene._cachedRayForTransform) {
            scene._cachedRayForTransform = Ray.Zero();
        }
        Ray.TransformToRef(ray, scene._pickWithRayInverseMatrix, scene._cachedRayForTransform);
        return scene._cachedRayForTransform;
    }, predicate, fastCheck, false, trianglePredicate);
    if (result) {
        result.ray = ray;
    }
    return result;
}
/**
 * Launch a ray to try to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
 * irrespective of orientation.
 * @param scene defines the scene to use for the picking
 * @param x X position on screen
 * @param y Y position on screen
 * @param predicate Predicate function used to determine eligible meshes and instances. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
 * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
 * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
 * @returns an array of PickingInfo
 */
function MultiPick(scene, x, y, predicate, camera, trianglePredicate) {
    return InternalMultiPick(scene, (world) => CreatePickingRay(scene, x, y, world, camera || null), predicate, trianglePredicate);
}
/**
 * Launch a ray to try to pick a mesh in the scene
 * @param scene defines the scene to use for the picking
 * @param ray Ray to use
 * @param predicate Predicate function used to determine eligible meshes and instances. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
 * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
 * @returns an array of PickingInfo
 */
function MultiPickWithRay(scene, ray, predicate, trianglePredicate) {
    return InternalMultiPick(scene, (world) => {
        if (!scene._pickWithRayInverseMatrix) {
            scene._pickWithRayInverseMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity();
        }
        world.invertToRef(scene._pickWithRayInverseMatrix);
        if (!scene._cachedRayForTransform) {
            scene._cachedRayForTransform = Ray.Zero();
        }
        Ray.TransformToRef(ray, scene._pickWithRayInverseMatrix, scene._cachedRayForTransform);
        return scene._cachedRayForTransform;
    }, predicate, trianglePredicate);
}
/**
 * Gets a ray in the forward direction from the camera.
 * @param camera Defines the camera to use to get the ray from
 * @param length Defines the length of the ray to create
 * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray
 * @param origin Defines the start point of the ray which defaults to the camera position
 * @returns the forward ray
 */
function GetForwardRay(camera, length = 100, transform, origin) {
    return GetForwardRayToRef(camera, new Ray(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero(), length), length, transform, origin);
}
/**
 * Gets a ray in the forward direction from the camera.
 * @param camera Defines the camera to use to get the ray from
 * @param refRay the ray to (re)use when setting the values
 * @param length Defines the length of the ray to create
 * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray
 * @param origin Defines the start point of the ray which defaults to the camera position
 * @returns the forward ray
 */
function GetForwardRayToRef(camera, refRay, length = 100, transform, origin) {
    if (!transform) {
        transform = camera.getWorldMatrix();
    }
    refRay.length = length;
    if (origin) {
        refRay.origin.copyFrom(origin);
    }
    else {
        refRay.origin.copyFrom(camera.position);
    }
    const forward = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2];
    forward.set(0, 0, camera._scene.useRightHandedSystem ? -1 : 1);
    const worldForward = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[3];
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformNormalToRef(forward, transform, worldForward);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.NormalizeToRef(worldForward, refRay.direction);
    return refRay;
}
/**
 * Initialize the minimal interdependecies between the Ray and Scene and Camera
 * @param sceneClass defines the scene prototype to use
 * @param cameraClass defines the camera prototype to use
 */
function AddRayExtensions(sceneClass, cameraClass) {
    if (cameraClass) {
        cameraClass.prototype.getForwardRay = function (length = 100, transform, origin) {
            return GetForwardRayToRef(this, new Ray(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero(), length), length, transform, origin);
        };
        cameraClass.prototype.getForwardRayToRef = function (refRay, length = 100, transform, origin) {
            return GetForwardRayToRef(this, refRay, length, transform, origin);
        };
    }
    if (!sceneClass) {
        return;
    }
    _import_helper_js__WEBPACK_IMPORTED_MODULE_6__/* ._ImportHelper */ .h._IsPickingAvailable = true;
    sceneClass.prototype.createPickingRay = function (x, y, world, camera, cameraViewSpace = false) {
        return CreatePickingRay(this, x, y, world, camera, cameraViewSpace);
    };
}
//# sourceMappingURL=ray.core.js.map

/***/ }),

/***/ 86919:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AU: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.AU),
/* harmony export */   DY: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.DY),
/* harmony export */   Gz: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.Gz),
/* harmony export */   KI: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.KI),
/* harmony export */   Oj: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.Oj),
/* harmony export */   R0: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.R0),
/* harmony export */   Rl: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.Rl),
/* harmony export */   S: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.S),
/* harmony export */   TR: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.TR),
/* harmony export */   m9: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.m9),
/* harmony export */   mc: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.mc),
/* harmony export */   oZ: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.oZ),
/* harmony export */   uW: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.uW),
/* harmony export */   ui: () => (/* reexport safe */ _ray_core_js__WEBPACK_IMPORTED_MODULE_2__.ui)
/* harmony export */ });
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87491);
/* harmony import */ var _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30388);
/* harmony import */ var _ray_core_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(48086);




// Picking
(0,_ray_core_js__WEBPACK_IMPORTED_MODULE_2__/* .AddRayExtensions */ .Oj)(_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z, _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_1__/* .Camera */ .i);
_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype.createPickingRayToRef = function (x, y, world, result, camera, cameraViewSpace = false, enableDistantPicking = false) {
    return (0,_ray_core_js__WEBPACK_IMPORTED_MODULE_2__/* .CreatePickingRayToRef */ .Gz)(this, x, y, world, result, camera, cameraViewSpace, enableDistantPicking);
};
_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype.createPickingRayInCameraSpace = function (x, y, camera) {
    return (0,_ray_core_js__WEBPACK_IMPORTED_MODULE_2__/* .CreatePickingRayInCameraSpace */ .AU)(this, x, y, camera);
};
_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype.createPickingRayInCameraSpaceToRef = function (x, y, result, camera) {
    return (0,_ray_core_js__WEBPACK_IMPORTED_MODULE_2__/* .CreatePickingRayInCameraSpaceToRef */ .oZ)(this, x, y, result, camera);
};
_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype.pickWithBoundingInfo = function (x, y, predicate, fastCheck, camera) {
    return (0,_ray_core_js__WEBPACK_IMPORTED_MODULE_2__/* .PickWithBoundingInfo */ .uW)(this, x, y, predicate, fastCheck, camera);
};
_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype.pick = function (x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking = false) {
    return (0,_ray_core_js__WEBPACK_IMPORTED_MODULE_2__/* .Pick */ .mc)(this, x, y, predicate, fastCheck, camera, trianglePredicate, _enableDistantPicking);
};
_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype.pickWithRay = function (ray, predicate, fastCheck, trianglePredicate) {
    return (0,_ray_core_js__WEBPACK_IMPORTED_MODULE_2__/* .PickWithRay */ .S)(this, ray, predicate, fastCheck, trianglePredicate);
};
_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype.multiPick = function (x, y, predicate, camera, trianglePredicate) {
    return (0,_ray_core_js__WEBPACK_IMPORTED_MODULE_2__/* .MultiPick */ .DY)(this, x, y, predicate, camera, trianglePredicate);
};
_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype.multiPickWithRay = function (ray, predicate, trianglePredicate) {
    return (0,_ray_core_js__WEBPACK_IMPORTED_MODULE_2__/* .MultiPickWithRay */ .TR)(this, ray, predicate, trianglePredicate);
};
//# sourceMappingURL=ray.js.map

/***/ }),

/***/ 15022:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   K: () => (/* binding */ DebugLayerTab),
/* harmony export */   d: () => (/* binding */ DebugLayer)
/* harmony export */ });
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(998);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(87491);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6315);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32206);





Object.defineProperty(_scene_js__WEBPACK_IMPORTED_MODULE_2__/* .Scene */ .Z.prototype, "debugLayer", {
    get: function () {
        if (!this._debugLayer) {
            this._debugLayer = new DebugLayer(this);
        }
        return this._debugLayer;
    },
    enumerable: true,
    configurable: true,
});
/**
 * Enum of inspector action tab
 */
var DebugLayerTab;
(function (DebugLayerTab) {
    /**
     * Properties tag (default)
     */
    DebugLayerTab[DebugLayerTab["Properties"] = 0] = "Properties";
    /**
     * Debug tab
     */
    DebugLayerTab[DebugLayerTab["Debug"] = 1] = "Debug";
    /**
     * Statistics tab
     */
    DebugLayerTab[DebugLayerTab["Statistics"] = 2] = "Statistics";
    /**
     * Tools tab
     */
    DebugLayerTab[DebugLayerTab["Tools"] = 3] = "Tools";
    /**
     * Settings tab
     */
    DebugLayerTab[DebugLayerTab["Settings"] = 4] = "Settings";
})(DebugLayerTab || (DebugLayerTab = {}));
/**
 * The debug layer (aka Inspector) is the go to tool in order to better understand
 * what is happening in your scene
 * @see https://doc.babylonjs.com/toolsAndResources/inspector
 */
class DebugLayer {
    /**
     * Observable triggered when a property is changed through the inspector.
     */
    get onPropertyChangedObservable() {
        if (this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector) {
            return this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable;
        }
        if (!this._onPropertyChangedObservable) {
            this._onPropertyChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        }
        return this._onPropertyChangedObservable;
    }
    /**
     * Observable triggered when the selection is changed through the inspector.
     */
    get onSelectionChangedObservable() {
        if (this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector) {
            return this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable;
        }
        if (!this._onSelectionChangedObservable) {
            this._onSelectionChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        }
        return this._onSelectionChangedObservable;
    }
    /**
     * Instantiates a new debug layer.
     * The debug layer (aka Inspector) is the go to tool in order to better understand
     * what is happening in your scene
     * @see https://doc.babylonjs.com/toolsAndResources/inspector
     * @param scene Defines the scene to inspect
     */
    constructor(scene) {
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.BJSINSPECTOR = this._getGlobalInspector();
        this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore */ .q.LastCreatedScene;
        if (!this._scene) {
            return;
        }
        this._scene.onDisposeObservable.add(() => {
            // Debug layer
            if (this._scene._debugLayer) {
                this._scene._debugLayer.hide();
            }
        });
    }
    /**
     * Creates the inspector window.
     * @param config
     */
    _createInspector(config) {
        if (this.isVisible()) {
            return;
        }
        if (this._onPropertyChangedObservable) {
            for (const observer of this._onPropertyChangedObservable.observers) {
                this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(observer);
            }
            this._onPropertyChangedObservable.clear();
            this._onPropertyChangedObservable = undefined;
        }
        if (this._onSelectionChangedObservable) {
            for (const observer of this._onSelectionChangedObservable.observers) {
                this.BJSINSPECTOR.Inspector.OnSelectionChangedObservable.add(observer);
            }
            this._onSelectionChangedObservable.clear();
            this._onSelectionChangedObservable = undefined;
        }
        const userOptions = {
            ...DebugLayer.Config,
            ...config,
        };
        this.BJSINSPECTOR = this.BJSINSPECTOR || this._getGlobalInspector();
        this.BJSINSPECTOR.Inspector.Show(this._scene, userOptions);
    }
    /**
     * Select a specific entity in the scene explorer and highlight a specific block in that entity property grid
     * @param entity defines the entity to select
     * @param lineContainerTitles defines the specific blocks to highlight (could be a string or an array of strings)
     */
    select(entity, lineContainerTitles) {
        if (this.BJSINSPECTOR) {
            if (lineContainerTitles) {
                if (Object.prototype.toString.call(lineContainerTitles) == "[object String]") {
                    this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(lineContainerTitles);
                }
                else {
                    this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(lineContainerTitles);
                }
            }
            this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(entity);
        }
    }
    /**
     * Get the inspector from bundle or global
     * @returns the inspector instance if found otherwise, null
     */
    _getGlobalInspector() {
        // UMD Global name detection from Webpack Bundle UMD Name.
        if (typeof INSPECTOR !== "undefined") {
            return INSPECTOR;
        }
        // In case of module let s check the global emitted from the Inspector entry point.
        if (typeof BABYLON !== "undefined" && typeof BABYLON.Inspector !== "undefined") {
            return BABYLON;
        }
        return undefined;
    }
    /**
     * Get if the inspector is visible or not.
     * @returns true if visible otherwise, false
     */
    isVisible() {
        return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;
    }
    /**
     * Hide the inspector and close its window.
     */
    hide() {
        if (this.BJSINSPECTOR) {
            this.BJSINSPECTOR.Inspector.Hide();
        }
    }
    /**
     * Update the scene in the inspector
     */
    setAsActiveScene() {
        if (this.BJSINSPECTOR) {
            this.BJSINSPECTOR.Inspector._SetNewScene(this._scene);
        }
    }
    popupSceneExplorer() {
        if (this.BJSINSPECTOR) {
            this.BJSINSPECTOR.Inspector.PopupSceneExplorer();
        }
    }
    popupInspector() {
        if (this.BJSINSPECTOR) {
            this.BJSINSPECTOR.Inspector.PopupInspector();
        }
    }
    popupEmbed() {
        if (this.BJSINSPECTOR) {
            this.BJSINSPECTOR.Inspector.PopupEmbed();
        }
    }
    /**
     * Launch the debugLayer.
     * @param config Define the configuration of the inspector
     * @returns a promise fulfilled when the debug layer is visible
     */
    show(config) {
        return new Promise((resolve) => {
            if (typeof this.BJSINSPECTOR == "undefined") {
                const inspectorUrl = config && config.inspectorURL ? config.inspectorURL : DebugLayer.InspectorURL;
                // Load inspector and add it to the DOM
                _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0.LoadBabylonScript(inspectorUrl, () => {
                    this._createInspector(config);
                    resolve(this);
                });
            }
            else {
                // Otherwise creates the inspector
                this._createInspector(config);
                resolve(this);
            }
        });
    }
}
/**
 * Define the url to get the inspector script from.
 * By default it uses the babylonjs CDN.
 * @ignoreNaming
 */
DebugLayer.InspectorURL = `${_Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0._DefaultCdnUrl}/v${_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_4__/* .AbstractEngine */ .$.Version}/inspector/babylon.inspector.bundle.js`;
/**
 * The default configuration of the inspector
 */
DebugLayer.Config = {
    overlay: false,
    showExplorer: true,
    showInspector: true,
    embedMode: false,
    handleResize: true,
    enablePopup: true,
};
//# sourceMappingURL=debugLayer.js.map

/***/ }),

/***/ 24153:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ST: () => (/* binding */ PointerInput),
/* harmony export */   Ze: () => (/* binding */ NativePointerInput),
/* harmony export */   bq: () => (/* binding */ DeviceType),
/* harmony export */   dR: () => (/* binding */ SwitchInput),
/* harmony export */   h8: () => (/* binding */ DualShockInput),
/* harmony export */   pI: () => (/* binding */ DualSenseInput),
/* harmony export */   sZ: () => (/* binding */ XboxInput)
/* harmony export */ });
/**
 * Enum for Device Types
 */
var DeviceType;
(function (DeviceType) {
    /** Generic */
    DeviceType[DeviceType["Generic"] = 0] = "Generic";
    /** Keyboard */
    DeviceType[DeviceType["Keyboard"] = 1] = "Keyboard";
    /** Mouse */
    DeviceType[DeviceType["Mouse"] = 2] = "Mouse";
    /** Touch Pointers */
    DeviceType[DeviceType["Touch"] = 3] = "Touch";
    /** PS4 Dual Shock */
    DeviceType[DeviceType["DualShock"] = 4] = "DualShock";
    /** Xbox */
    DeviceType[DeviceType["Xbox"] = 5] = "Xbox";
    /** Switch Controller */
    DeviceType[DeviceType["Switch"] = 6] = "Switch";
    /** PS5 DualSense */
    DeviceType[DeviceType["DualSense"] = 7] = "DualSense";
})(DeviceType || (DeviceType = {}));
// Device Enums
/**
 * Enum for All Pointers (Touch/Mouse)
 */
var PointerInput;
(function (PointerInput) {
    /** Horizontal Axis (Not used in events/observables; only in polling) */
    PointerInput[PointerInput["Horizontal"] = 0] = "Horizontal";
    /** Vertical Axis (Not used in events/observables; only in polling) */
    PointerInput[PointerInput["Vertical"] = 1] = "Vertical";
    /** Left Click or Touch */
    PointerInput[PointerInput["LeftClick"] = 2] = "LeftClick";
    /** Middle Click */
    PointerInput[PointerInput["MiddleClick"] = 3] = "MiddleClick";
    /** Right Click */
    PointerInput[PointerInput["RightClick"] = 4] = "RightClick";
    /** Browser Back */
    PointerInput[PointerInput["BrowserBack"] = 5] = "BrowserBack";
    /** Browser Forward */
    PointerInput[PointerInput["BrowserForward"] = 6] = "BrowserForward";
    /** Mouse Wheel X */
    PointerInput[PointerInput["MouseWheelX"] = 7] = "MouseWheelX";
    /** Mouse Wheel Y */
    PointerInput[PointerInput["MouseWheelY"] = 8] = "MouseWheelY";
    /** Mouse Wheel Z */
    PointerInput[PointerInput["MouseWheelZ"] = 9] = "MouseWheelZ";
    /** Used in events/observables to identify if x/y changes occurred */
    PointerInput[PointerInput["Move"] = 12] = "Move";
})(PointerInput || (PointerInput = {}));
/** @internal */
var NativePointerInput;
(function (NativePointerInput) {
    /** Horizontal Axis */
    NativePointerInput[NativePointerInput["Horizontal"] = 0] = "Horizontal";
    /** Vertical Axis */
    NativePointerInput[NativePointerInput["Vertical"] = 1] = "Vertical";
    /** Left Click or Touch */
    NativePointerInput[NativePointerInput["LeftClick"] = 2] = "LeftClick";
    /** Middle Click */
    NativePointerInput[NativePointerInput["MiddleClick"] = 3] = "MiddleClick";
    /** Right Click */
    NativePointerInput[NativePointerInput["RightClick"] = 4] = "RightClick";
    /** Browser Back */
    NativePointerInput[NativePointerInput["BrowserBack"] = 5] = "BrowserBack";
    /** Browser Forward */
    NativePointerInput[NativePointerInput["BrowserForward"] = 6] = "BrowserForward";
    /** Mouse Wheel X */
    NativePointerInput[NativePointerInput["MouseWheelX"] = 7] = "MouseWheelX";
    /** Mouse Wheel Y */
    NativePointerInput[NativePointerInput["MouseWheelY"] = 8] = "MouseWheelY";
    /** Mouse Wheel Z */
    NativePointerInput[NativePointerInput["MouseWheelZ"] = 9] = "MouseWheelZ";
    /** Delta X */
    NativePointerInput[NativePointerInput["DeltaHorizontal"] = 10] = "DeltaHorizontal";
    /** Delta Y */
    NativePointerInput[NativePointerInput["DeltaVertical"] = 11] = "DeltaVertical";
})(NativePointerInput || (NativePointerInput = {}));
/**
 * Enum for Dual Shock Gamepad
 */
var DualShockInput;
(function (DualShockInput) {
    /** Cross */
    DualShockInput[DualShockInput["Cross"] = 0] = "Cross";
    /** Circle */
    DualShockInput[DualShockInput["Circle"] = 1] = "Circle";
    /** Square */
    DualShockInput[DualShockInput["Square"] = 2] = "Square";
    /** Triangle */
    DualShockInput[DualShockInput["Triangle"] = 3] = "Triangle";
    /** L1 */
    DualShockInput[DualShockInput["L1"] = 4] = "L1";
    /** R1 */
    DualShockInput[DualShockInput["R1"] = 5] = "R1";
    /** L2 */
    DualShockInput[DualShockInput["L2"] = 6] = "L2";
    /** R2 */
    DualShockInput[DualShockInput["R2"] = 7] = "R2";
    /** Share */
    DualShockInput[DualShockInput["Share"] = 8] = "Share";
    /** Options */
    DualShockInput[DualShockInput["Options"] = 9] = "Options";
    /** L3 */
    DualShockInput[DualShockInput["L3"] = 10] = "L3";
    /** R3 */
    DualShockInput[DualShockInput["R3"] = 11] = "R3";
    /** DPadUp */
    DualShockInput[DualShockInput["DPadUp"] = 12] = "DPadUp";
    /** DPadDown */
    DualShockInput[DualShockInput["DPadDown"] = 13] = "DPadDown";
    /** DPadLeft */
    DualShockInput[DualShockInput["DPadLeft"] = 14] = "DPadLeft";
    /** DRight */
    DualShockInput[DualShockInput["DPadRight"] = 15] = "DPadRight";
    /** Home */
    DualShockInput[DualShockInput["Home"] = 16] = "Home";
    /** TouchPad */
    DualShockInput[DualShockInput["TouchPad"] = 17] = "TouchPad";
    /** LStickXAxis */
    DualShockInput[DualShockInput["LStickXAxis"] = 18] = "LStickXAxis";
    /** LStickYAxis */
    DualShockInput[DualShockInput["LStickYAxis"] = 19] = "LStickYAxis";
    /** RStickXAxis */
    DualShockInput[DualShockInput["RStickXAxis"] = 20] = "RStickXAxis";
    /** RStickYAxis */
    DualShockInput[DualShockInput["RStickYAxis"] = 21] = "RStickYAxis";
})(DualShockInput || (DualShockInput = {}));
/**
 * Enum for Dual Sense Gamepad
 */
var DualSenseInput;
(function (DualSenseInput) {
    /** Cross */
    DualSenseInput[DualSenseInput["Cross"] = 0] = "Cross";
    /** Circle */
    DualSenseInput[DualSenseInput["Circle"] = 1] = "Circle";
    /** Square */
    DualSenseInput[DualSenseInput["Square"] = 2] = "Square";
    /** Triangle */
    DualSenseInput[DualSenseInput["Triangle"] = 3] = "Triangle";
    /** L1 */
    DualSenseInput[DualSenseInput["L1"] = 4] = "L1";
    /** R1 */
    DualSenseInput[DualSenseInput["R1"] = 5] = "R1";
    /** L2 */
    DualSenseInput[DualSenseInput["L2"] = 6] = "L2";
    /** R2 */
    DualSenseInput[DualSenseInput["R2"] = 7] = "R2";
    /** Create */
    DualSenseInput[DualSenseInput["Create"] = 8] = "Create";
    /** Options */
    DualSenseInput[DualSenseInput["Options"] = 9] = "Options";
    /** L3 */
    DualSenseInput[DualSenseInput["L3"] = 10] = "L3";
    /** R3 */
    DualSenseInput[DualSenseInput["R3"] = 11] = "R3";
    /** DPadUp */
    DualSenseInput[DualSenseInput["DPadUp"] = 12] = "DPadUp";
    /** DPadDown */
    DualSenseInput[DualSenseInput["DPadDown"] = 13] = "DPadDown";
    /** DPadLeft */
    DualSenseInput[DualSenseInput["DPadLeft"] = 14] = "DPadLeft";
    /** DRight */
    DualSenseInput[DualSenseInput["DPadRight"] = 15] = "DPadRight";
    /** Home */
    DualSenseInput[DualSenseInput["Home"] = 16] = "Home";
    /** TouchPad */
    DualSenseInput[DualSenseInput["TouchPad"] = 17] = "TouchPad";
    /** LStickXAxis */
    DualSenseInput[DualSenseInput["LStickXAxis"] = 18] = "LStickXAxis";
    /** LStickYAxis */
    DualSenseInput[DualSenseInput["LStickYAxis"] = 19] = "LStickYAxis";
    /** RStickXAxis */
    DualSenseInput[DualSenseInput["RStickXAxis"] = 20] = "RStickXAxis";
    /** RStickYAxis */
    DualSenseInput[DualSenseInput["RStickYAxis"] = 21] = "RStickYAxis";
})(DualSenseInput || (DualSenseInput = {}));
/**
 * Enum for Xbox Gamepad
 */
var XboxInput;
(function (XboxInput) {
    /** A */
    XboxInput[XboxInput["A"] = 0] = "A";
    /** B */
    XboxInput[XboxInput["B"] = 1] = "B";
    /** X */
    XboxInput[XboxInput["X"] = 2] = "X";
    /** Y */
    XboxInput[XboxInput["Y"] = 3] = "Y";
    /** LB */
    XboxInput[XboxInput["LB"] = 4] = "LB";
    /** RB */
    XboxInput[XboxInput["RB"] = 5] = "RB";
    /** LT */
    XboxInput[XboxInput["LT"] = 6] = "LT";
    /** RT */
    XboxInput[XboxInput["RT"] = 7] = "RT";
    /** Back */
    XboxInput[XboxInput["Back"] = 8] = "Back";
    /** Start */
    XboxInput[XboxInput["Start"] = 9] = "Start";
    /** LS */
    XboxInput[XboxInput["LS"] = 10] = "LS";
    /** RS */
    XboxInput[XboxInput["RS"] = 11] = "RS";
    /** DPadUp */
    XboxInput[XboxInput["DPadUp"] = 12] = "DPadUp";
    /** DPadDown */
    XboxInput[XboxInput["DPadDown"] = 13] = "DPadDown";
    /** DPadLeft */
    XboxInput[XboxInput["DPadLeft"] = 14] = "DPadLeft";
    /** DRight */
    XboxInput[XboxInput["DPadRight"] = 15] = "DPadRight";
    /** Home */
    XboxInput[XboxInput["Home"] = 16] = "Home";
    /** LStickXAxis */
    XboxInput[XboxInput["LStickXAxis"] = 17] = "LStickXAxis";
    /** LStickYAxis */
    XboxInput[XboxInput["LStickYAxis"] = 18] = "LStickYAxis";
    /** RStickXAxis */
    XboxInput[XboxInput["RStickXAxis"] = 19] = "RStickXAxis";
    /** RStickYAxis */
    XboxInput[XboxInput["RStickYAxis"] = 20] = "RStickYAxis";
})(XboxInput || (XboxInput = {}));
/**
 * Enum for Switch (Pro/JoyCon L+R) Gamepad
 */
var SwitchInput;
(function (SwitchInput) {
    /** B */
    SwitchInput[SwitchInput["B"] = 0] = "B";
    /** A */
    SwitchInput[SwitchInput["A"] = 1] = "A";
    /** Y */
    SwitchInput[SwitchInput["Y"] = 2] = "Y";
    /** X */
    SwitchInput[SwitchInput["X"] = 3] = "X";
    /** L */
    SwitchInput[SwitchInput["L"] = 4] = "L";
    /** R */
    SwitchInput[SwitchInput["R"] = 5] = "R";
    /** ZL */
    SwitchInput[SwitchInput["ZL"] = 6] = "ZL";
    /** ZR */
    SwitchInput[SwitchInput["ZR"] = 7] = "ZR";
    /** Minus */
    SwitchInput[SwitchInput["Minus"] = 8] = "Minus";
    /** Plus */
    SwitchInput[SwitchInput["Plus"] = 9] = "Plus";
    /** LS */
    SwitchInput[SwitchInput["LS"] = 10] = "LS";
    /** RS */
    SwitchInput[SwitchInput["RS"] = 11] = "RS";
    /** DPadUp */
    SwitchInput[SwitchInput["DPadUp"] = 12] = "DPadUp";
    /** DPadDown */
    SwitchInput[SwitchInput["DPadDown"] = 13] = "DPadDown";
    /** DPadLeft */
    SwitchInput[SwitchInput["DPadLeft"] = 14] = "DPadLeft";
    /** DRight */
    SwitchInput[SwitchInput["DPadRight"] = 15] = "DPadRight";
    /** Home */
    SwitchInput[SwitchInput["Home"] = 16] = "Home";
    /** Capture */
    SwitchInput[SwitchInput["Capture"] = 17] = "Capture";
    /** LStickXAxis */
    SwitchInput[SwitchInput["LStickXAxis"] = 18] = "LStickXAxis";
    /** LStickYAxis */
    SwitchInput[SwitchInput["LStickYAxis"] = 19] = "LStickYAxis";
    /** RStickXAxis */
    SwitchInput[SwitchInput["RStickXAxis"] = 20] = "RStickXAxis";
    /** RStickYAxis */
    SwitchInput[SwitchInput["RStickYAxis"] = 21] = "RStickYAxis";
})(SwitchInput || (SwitchInput = {}));
//# sourceMappingURL=deviceEnums.js.map

/***/ }),

/***/ 51314:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   c: () => (/* binding */ DeviceSource)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);

/**
 * Class that handles all input for a specific device
 */
class DeviceSource {
    /**
     * Default Constructor
     * @param deviceInputSystem - Reference to DeviceInputSystem
     * @param deviceType - Type of device
     * @param deviceSlot - "Slot" or index that device is referenced in
     */
    constructor(deviceInputSystem, 
    /** Type of device */
    deviceType, 
    /** [0] "Slot" or index that device is referenced in */
    deviceSlot = 0) {
        this.deviceType = deviceType;
        this.deviceSlot = deviceSlot;
        // Public Members
        /**
         * Observable to handle device input changes per device
         */
        this.onInputChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        this._deviceInputSystem = deviceInputSystem;
    }
    /**
     * Get input for specific input
     * @param inputIndex - index of specific input on device
     * @returns Input value from DeviceInputSystem
     */
    getInput(inputIndex) {
        return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, inputIndex);
    }
}
//# sourceMappingURL=deviceSource.js.map

/***/ }),

/***/ 64100:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  Z: () => (/* binding */ DeviceSourceManager)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js
var deviceEnums = __webpack_require__(24153);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__(99848);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/deviceInputEvents.js
var deviceInputEvents = __webpack_require__(38123);
;// ./node_modules/@babylonjs/core/DeviceInput/eventFactory.js



/**
 * Class to wrap DeviceInputSystem data into an event object
 */
class DeviceEventFactory {
    /**
     * Create device input events based on provided type and slot
     *
     * @param deviceType Type of device
     * @param deviceSlot "Slot" or index that device is referenced in
     * @param inputIndex Id of input to be checked
     * @param currentState Current value for given input
     * @param deviceInputSystem Reference to DeviceInputSystem
     * @param elementToAttachTo HTMLElement to reference as target for inputs
     * @param pointerId PointerId to use for pointer events
     * @returns IUIEvent object
     */
    static CreateDeviceEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo, pointerId) {
        switch (deviceType) {
            case deviceEnums/* DeviceType */.bq.Keyboard:
                return this._CreateKeyboardEvent(inputIndex, currentState, deviceInputSystem, elementToAttachTo);
            case deviceEnums/* DeviceType */.bq.Mouse:
                if (inputIndex === deviceEnums/* PointerInput */.ST.MouseWheelX || inputIndex === deviceEnums/* PointerInput */.ST.MouseWheelY || inputIndex === deviceEnums/* PointerInput */.ST.MouseWheelZ) {
                    return this._CreateWheelEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);
                }
            // eslint-disable-next-line no-fallthrough
            case deviceEnums/* DeviceType */.bq.Touch:
                return this._CreatePointerEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo, pointerId);
            default:
                // eslint-disable-next-line no-throw-literal
                throw `Unable to generate event for device ${deviceEnums/* DeviceType */.bq[deviceType]}`;
        }
    }
    /**
     * Creates pointer event
     *
     * @param deviceType Type of device
     * @param deviceSlot "Slot" or index that device is referenced in
     * @param inputIndex Id of input to be checked
     * @param currentState Current value for given input
     * @param deviceInputSystem Reference to DeviceInputSystem
     * @param elementToAttachTo HTMLElement to reference as target for inputs
     * @param pointerId PointerId to use for pointer events
     * @returns IUIEvent object (Pointer)
     */
    static _CreatePointerEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo, pointerId) {
        const evt = this._CreateMouseEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);
        if (deviceType === deviceEnums/* DeviceType */.bq.Mouse) {
            evt.deviceType = deviceEnums/* DeviceType */.bq.Mouse;
            evt.pointerId = 1;
            evt.pointerType = "mouse";
        }
        else {
            evt.deviceType = deviceEnums/* DeviceType */.bq.Touch;
            evt.pointerId = pointerId ?? deviceSlot;
            evt.pointerType = "touch";
        }
        let buttons = 0;
        // Populate buttons property with current state of all mouse buttons
        // Uses values found on: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
        buttons += deviceInputSystem.pollInput(deviceType, deviceSlot, deviceEnums/* PointerInput */.ST.LeftClick);
        buttons += deviceInputSystem.pollInput(deviceType, deviceSlot, deviceEnums/* PointerInput */.ST.RightClick) * 2;
        buttons += deviceInputSystem.pollInput(deviceType, deviceSlot, deviceEnums/* PointerInput */.ST.MiddleClick) * 4;
        evt.buttons = buttons;
        if (inputIndex === deviceEnums/* PointerInput */.ST.Move) {
            evt.type = "pointermove";
        }
        else if (inputIndex >= deviceEnums/* PointerInput */.ST.LeftClick && inputIndex <= deviceEnums/* PointerInput */.ST.RightClick) {
            evt.type = currentState === 1 ? "pointerdown" : "pointerup";
            evt.button = inputIndex - 2;
        }
        return evt;
    }
    /**
     * Create Mouse Wheel Event
     * @param deviceType Type of device
     * @param deviceSlot "Slot" or index that device is referenced in
     * @param inputIndex Id of input to be checked
     * @param currentState Current value for given input
     * @param deviceInputSystem Reference to DeviceInputSystem
     * @param elementToAttachTo HTMLElement to reference as target for inputs
     * @returns IUIEvent object (Wheel)
     */
    static _CreateWheelEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo) {
        const evt = this._CreateMouseEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);
        // While WheelEvents don't generally have a pointerId, we used to add one in the InputManager
        // This line has been added to make the InputManager more platform-agnostic
        // Similar code exists in the WebDeviceInputSystem to handle browser created events
        evt.pointerId = 1;
        evt.type = "wheel";
        evt.deltaMode = deviceInputEvents/* EventConstants */.s.DOM_DELTA_PIXEL;
        evt.deltaX = 0;
        evt.deltaY = 0;
        evt.deltaZ = 0;
        switch (inputIndex) {
            case deviceEnums/* PointerInput */.ST.MouseWheelX:
                evt.deltaX = currentState;
                break;
            case deviceEnums/* PointerInput */.ST.MouseWheelY:
                evt.deltaY = currentState;
                break;
            case deviceEnums/* PointerInput */.ST.MouseWheelZ:
                evt.deltaZ = currentState;
                break;
        }
        return evt;
    }
    /**
     * Create Mouse Event
     * @param deviceType Type of device
     * @param deviceSlot "Slot" or index that device is referenced in
     * @param inputIndex Id of input to be checked
     * @param currentState Current value for given input
     * @param deviceInputSystem Reference to DeviceInputSystem
     * @param elementToAttachTo HTMLElement to reference as target for inputs
     * @returns IUIEvent object (Mouse)
     */
    static _CreateMouseEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo) {
        const evt = this._CreateEvent(elementToAttachTo);
        const pointerX = deviceInputSystem.pollInput(deviceType, deviceSlot, deviceEnums/* PointerInput */.ST.Horizontal);
        const pointerY = deviceInputSystem.pollInput(deviceType, deviceSlot, deviceEnums/* PointerInput */.ST.Vertical);
        // Handle offsets/deltas based on existence of HTMLElement
        if (elementToAttachTo) {
            evt.movementX = 0;
            evt.movementY = 0;
            evt.offsetX = evt.movementX - elementToAttachTo.getBoundingClientRect().x;
            evt.offsetY = evt.movementY - elementToAttachTo.getBoundingClientRect().y;
        }
        else {
            evt.movementX = deviceInputSystem.pollInput(deviceType, deviceSlot, 10 /* NativePointerInput.DeltaHorizontal */); // DeltaHorizontal
            evt.movementY = deviceInputSystem.pollInput(deviceType, deviceSlot, 11 /* NativePointerInput.DeltaVertical */); // DeltaVertical
            evt.offsetX = 0;
            evt.offsetY = 0;
        }
        this._CheckNonCharacterKeys(evt, deviceInputSystem);
        evt.clientX = pointerX;
        evt.clientY = pointerY;
        evt.x = pointerX;
        evt.y = pointerY;
        evt.deviceType = deviceType;
        evt.deviceSlot = deviceSlot;
        evt.inputIndex = inputIndex;
        return evt;
    }
    /**
     * Create Keyboard Event
     * @param inputIndex Id of input to be checked
     * @param currentState Current value for given input
     * @param deviceInputSystem Reference to DeviceInputSystem
     * @param elementToAttachTo HTMLElement to reference as target for inputs
     * @returns IEvent object (Keyboard)
     */
    static _CreateKeyboardEvent(inputIndex, currentState, deviceInputSystem, elementToAttachTo) {
        const evt = this._CreateEvent(elementToAttachTo);
        this._CheckNonCharacterKeys(evt, deviceInputSystem);
        evt.deviceType = deviceEnums/* DeviceType */.bq.Keyboard;
        evt.deviceSlot = 0;
        evt.inputIndex = inputIndex;
        evt.type = currentState === 1 ? "keydown" : "keyup";
        evt.key = String.fromCharCode(inputIndex);
        evt.keyCode = inputIndex;
        return evt;
    }
    /**
     * Add parameters for non-character keys (Ctrl, Alt, Meta, Shift)
     * @param evt Event object to add parameters to
     * @param deviceInputSystem DeviceInputSystem to pull values from
     */
    static _CheckNonCharacterKeys(evt, deviceInputSystem) {
        const isKeyboardActive = deviceInputSystem.isDeviceAvailable(deviceEnums/* DeviceType */.bq.Keyboard);
        const altKey = isKeyboardActive && deviceInputSystem.pollInput(deviceEnums/* DeviceType */.bq.Keyboard, 0, 18) === 1;
        const ctrlKey = isKeyboardActive && deviceInputSystem.pollInput(deviceEnums/* DeviceType */.bq.Keyboard, 0, 17) === 1;
        const metaKey = isKeyboardActive &&
            (deviceInputSystem.pollInput(deviceEnums/* DeviceType */.bq.Keyboard, 0, 91) === 1 ||
                deviceInputSystem.pollInput(deviceEnums/* DeviceType */.bq.Keyboard, 0, 92) === 1 ||
                deviceInputSystem.pollInput(deviceEnums/* DeviceType */.bq.Keyboard, 0, 93) === 1);
        const shiftKey = isKeyboardActive && deviceInputSystem.pollInput(deviceEnums/* DeviceType */.bq.Keyboard, 0, 16) === 1;
        evt.altKey = altKey;
        evt.ctrlKey = ctrlKey;
        evt.metaKey = metaKey;
        evt.shiftKey = shiftKey;
    }
    /**
     * Create base event object
     * @param elementToAttachTo Value to use as event target
     * @returns
     */
    static _CreateEvent(elementToAttachTo) {
        const evt = {};
        evt.preventDefault = () => { };
        evt.target = elementToAttachTo;
        return evt;
    }
}
//# sourceMappingURL=eventFactory.js.map
;// ./node_modules/@babylonjs/core/DeviceInput/nativeDeviceInputSystem.js


/** @internal */
class NativeDeviceInputSystem {
    constructor(onDeviceConnected, onDeviceDisconnected, onInputChanged) {
        this._nativeInput = _native.DeviceInputSystem
            ? new _native.DeviceInputSystem(onDeviceConnected, onDeviceDisconnected, (deviceType, deviceSlot, inputIndex, currentState) => {
                const evt = DeviceEventFactory.CreateDeviceEvent(deviceType, deviceSlot, inputIndex, currentState, this);
                onInputChanged(deviceType, deviceSlot, evt);
            })
            : this._createDummyNativeInput();
    }
    // Public functions
    /**
     * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
     * @param deviceType Enum specifying device type
     * @param deviceSlot "Slot" or index that device is referenced in
     * @param inputIndex Id of input to be checked
     * @returns Current value of input
     */
    pollInput(deviceType, deviceSlot, inputIndex) {
        return this._nativeInput.pollInput(deviceType, deviceSlot, inputIndex);
    }
    /**
     * Check for a specific device in the DeviceInputSystem
     * @param deviceType Type of device to check for
     * @returns bool with status of device's existence
     */
    isDeviceAvailable(deviceType) {
        //TODO: FIx native side first
        return deviceType === deviceEnums/* DeviceType */.bq.Mouse || deviceType === deviceEnums/* DeviceType */.bq.Touch;
    }
    /**
     * Dispose of all the observables
     */
    dispose() {
        this._nativeInput.dispose();
    }
    /**
     * For versions of BabylonNative that don't have the NativeInput plugin initialized, create a dummy version
     * @returns Object with dummy functions
     */
    _createDummyNativeInput() {
        const nativeInput = {
            pollInput: () => {
                return 0;
            },
            isDeviceAvailable: () => {
                return false;
            },
            dispose: () => { },
        };
        return nativeInput;
    }
}
//# sourceMappingURL=nativeDeviceInputSystem.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/domManagement.js
var domManagement = __webpack_require__(18790);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__(998);
;// ./node_modules/@babylonjs/core/DeviceInput/webDeviceInputSystem.js




// eslint-disable-next-line @typescript-eslint/naming-convention
const MAX_KEYCODES = 255;
// eslint-disable-next-line @typescript-eslint/naming-convention
const MAX_POINTER_INPUTS = Object.keys(deviceEnums/* PointerInput */.ST).length / 2;
/** @internal */
class WebDeviceInputSystem {
    /**
     * Constructor for the WebDeviceInputSystem
     * @param engine Engine to reference
     * @param onDeviceConnected Callback to execute when device is connected
     * @param onDeviceDisconnected Callback to execute when device is disconnected
     * @param onInputChanged Callback to execute when input changes on device
     */
    constructor(engine, onDeviceConnected, onDeviceDisconnected, onInputChanged) {
        // Private Members
        this._inputs = [];
        this._keyboardActive = false;
        this._pointerActive = false;
        this._usingSafari = tools/* Tools */.S0.IsSafari();
        // Found solution for determining if MacOS is being used here:
        // https://stackoverflow.com/questions/10527983/best-way-to-detect-mac-os-x-or-windows-computers-with-javascript-or-jquery
        this._usingMacOS = (0,domManagement/* IsNavigatorAvailable */.XD)() && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._keyboardDownEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._keyboardUpEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._keyboardBlurEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._pointerMoveEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._pointerDownEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._pointerUpEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._pointerCancelEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._pointerWheelEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._pointerBlurEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._pointerMacOSChromeOutEvent = (evt) => { };
        this._eventsAttached = false;
        this._mouseId = -1;
        this._isUsingFirefox = (0,domManagement/* IsNavigatorAvailable */.XD)() && navigator.userAgent && navigator.userAgent.indexOf("Firefox") !== -1;
        this._isUsingChromium = (0,domManagement/* IsNavigatorAvailable */.XD)() && navigator.userAgent && navigator.userAgent.indexOf("Chrome") !== -1;
        this._maxTouchPoints = 0;
        this._pointerInputClearObserver = null;
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._gamepadConnectedEvent = (evt) => { };
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._gamepadDisconnectedEvent = (evt) => { };
        this._eventPrefix = tools/* Tools */.S0.GetPointerPrefix(engine);
        this._engine = engine;
        this._onDeviceConnected = onDeviceConnected;
        this._onDeviceDisconnected = onDeviceDisconnected;
        this._onInputChanged = onInputChanged;
        // If we need a pointerId, set one for future use
        this._mouseId = this._isUsingFirefox ? 0 : 1;
        this._enableEvents();
        if (this._usingMacOS) {
            this._metaKeys = [];
        }
        // Set callback to enable event handler switching when inputElement changes
        if (!this._engine._onEngineViewChanged) {
            this._engine._onEngineViewChanged = () => {
                this._enableEvents();
            };
        }
    }
    // Public functions
    /**
     * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
     * @param deviceType Enum specifying device type
     * @param deviceSlot "Slot" or index that device is referenced in
     * @param inputIndex Id of input to be checked
     * @returns Current value of input
     */
    pollInput(deviceType, deviceSlot, inputIndex) {
        const device = this._inputs[deviceType][deviceSlot];
        if (!device) {
            // eslint-disable-next-line no-throw-literal
            throw `Unable to find device ${deviceEnums/* DeviceType */.bq[deviceType]}`;
        }
        if (deviceType >= deviceEnums/* DeviceType */.bq.DualShock && deviceType <= deviceEnums/* DeviceType */.bq.DualSense) {
            this._updateDevice(deviceType, deviceSlot, inputIndex);
        }
        const currentValue = device[inputIndex];
        if (currentValue === undefined) {
            // eslint-disable-next-line no-throw-literal
            throw `Unable to find input ${inputIndex} for device ${deviceEnums/* DeviceType */.bq[deviceType]} in slot ${deviceSlot}`;
        }
        if (inputIndex === deviceEnums/* PointerInput */.ST.Move) {
            tools/* Tools */.S0.Warn(`Unable to provide information for PointerInput.Move.  Try using PointerInput.Horizontal or PointerInput.Vertical for move data.`);
        }
        return currentValue;
    }
    /**
     * Check for a specific device in the DeviceInputSystem
     * @param deviceType Type of device to check for
     * @returns bool with status of device's existence
     */
    isDeviceAvailable(deviceType) {
        return this._inputs[deviceType] !== undefined;
    }
    /**
     * Dispose of all the eventlisteners
     */
    dispose() {
        // Callbacks
        this._onDeviceConnected = () => { };
        this._onDeviceDisconnected = () => { };
        this._onInputChanged = () => { };
        delete this._engine._onEngineViewChanged;
        if (this._elementToAttachTo) {
            this._disableEvents();
        }
    }
    /**
     * Enable listening for user input events
     */
    _enableEvents() {
        const inputElement = this?._engine.getInputElement();
        if (inputElement && (!this._eventsAttached || this._elementToAttachTo !== inputElement)) {
            // Remove events before adding to avoid double events or simultaneous events on multiple canvases
            this._disableEvents();
            // If the inputs array has already been created, zero it out to before setting up events
            if (this._inputs) {
                for (const inputs of this._inputs) {
                    if (inputs) {
                        for (const deviceSlotKey in inputs) {
                            const deviceSlot = +deviceSlotKey;
                            const device = inputs[deviceSlot];
                            if (device) {
                                for (let inputIndex = 0; inputIndex < device.length; inputIndex++) {
                                    device[inputIndex] = 0;
                                }
                            }
                        }
                    }
                }
            }
            this._elementToAttachTo = inputElement;
            // Set tab index for the inputElement to the engine's canvasTabIndex, if and only if the element's tab index is -1
            this._elementToAttachTo.tabIndex = this._elementToAttachTo.tabIndex !== -1 ? this._elementToAttachTo.tabIndex : this._engine.canvasTabIndex;
            this._handleKeyActions();
            this._handlePointerActions();
            this._handleGamepadActions();
            this._eventsAttached = true;
            // Check for devices that are already connected but aren't registered. Currently, only checks for gamepads and mouse
            this._checkForConnectedDevices();
        }
    }
    /**
     * Disable listening for user input events
     */
    _disableEvents() {
        if (this._elementToAttachTo) {
            // Blur Events
            this._elementToAttachTo.removeEventListener("blur", this._keyboardBlurEvent);
            this._elementToAttachTo.removeEventListener("blur", this._pointerBlurEvent);
            // Keyboard Events
            this._elementToAttachTo.removeEventListener("keydown", this._keyboardDownEvent);
            this._elementToAttachTo.removeEventListener("keyup", this._keyboardUpEvent);
            // Pointer Events
            this._elementToAttachTo.removeEventListener(this._eventPrefix + "move", this._pointerMoveEvent);
            this._elementToAttachTo.removeEventListener(this._eventPrefix + "down", this._pointerDownEvent);
            this._elementToAttachTo.removeEventListener(this._eventPrefix + "up", this._pointerUpEvent);
            this._elementToAttachTo.removeEventListener(this._eventPrefix + "cancel", this._pointerCancelEvent);
            this._elementToAttachTo.removeEventListener(this._wheelEventName, this._pointerWheelEvent);
            if (this._usingMacOS && this._isUsingChromium) {
                this._elementToAttachTo.removeEventListener("lostpointercapture", this._pointerMacOSChromeOutEvent);
            }
            // Gamepad Events
            window.removeEventListener("gamepadconnected", this._gamepadConnectedEvent);
            window.removeEventListener("gamepaddisconnected", this._gamepadDisconnectedEvent);
        }
        if (this._pointerInputClearObserver) {
            this._engine.onEndFrameObservable.remove(this._pointerInputClearObserver);
        }
        this._eventsAttached = false;
    }
    /**
     * Checks for existing connections to devices and register them, if necessary
     * Currently handles gamepads and mouse
     */
    _checkForConnectedDevices() {
        if (navigator.getGamepads) {
            const gamepads = navigator.getGamepads();
            for (const gamepad of gamepads) {
                if (gamepad) {
                    this._addGamePad(gamepad);
                }
            }
        }
        // If the device in use has mouse capabilities, pre-register mouse
        if (typeof matchMedia === "function" && matchMedia("(pointer:fine)").matches) {
            // This will provide a dummy value for the cursor position and is expected to be overridden when the first mouse event happens.
            // There isn't any good way to get the current position outside of a pointer event so that's why this was done.
            this._addPointerDevice(deviceEnums/* DeviceType */.bq.Mouse, 0, 0, 0);
        }
    }
    // Private functions
    /**
     * Add a gamepad to the DeviceInputSystem
     * @param gamepad A single DOM Gamepad object
     */
    _addGamePad(gamepad) {
        const deviceType = this._getGamepadDeviceType(gamepad.id);
        const deviceSlot = gamepad.index;
        this._gamepads = this._gamepads || new Array(gamepad.index + 1);
        this._registerDevice(deviceType, deviceSlot, gamepad.buttons.length + gamepad.axes.length);
        this._gamepads[deviceSlot] = deviceType;
    }
    /**
     * Add pointer device to DeviceInputSystem
     * @param deviceType Type of Pointer to add
     * @param deviceSlot Pointer ID (0 for mouse, pointerId for Touch)
     * @param currentX Current X at point of adding
     * @param currentY Current Y at point of adding
     */
    _addPointerDevice(deviceType, deviceSlot, currentX, currentY) {
        if (!this._pointerActive) {
            this._pointerActive = true;
        }
        this._registerDevice(deviceType, deviceSlot, MAX_POINTER_INPUTS);
        const pointer = this._inputs[deviceType][deviceSlot]; /* initialize our pointer position immediately after registration */
        pointer[0] = currentX;
        pointer[1] = currentY;
    }
    /**
     * Add device and inputs to device array
     * @param deviceType Enum specifying device type
     * @param deviceSlot "Slot" or index that device is referenced in
     * @param numberOfInputs Number of input entries to create for given device
     */
    _registerDevice(deviceType, deviceSlot, numberOfInputs) {
        if (deviceSlot === undefined) {
            // eslint-disable-next-line no-throw-literal
            throw `Unable to register device ${deviceEnums/* DeviceType */.bq[deviceType]} to undefined slot.`;
        }
        if (!this._inputs[deviceType]) {
            this._inputs[deviceType] = {};
        }
        if (!this._inputs[deviceType][deviceSlot]) {
            const device = new Array(numberOfInputs);
            device.fill(0);
            this._inputs[deviceType][deviceSlot] = device;
            this._onDeviceConnected(deviceType, deviceSlot);
        }
    }
    /**
     * Given a specific device name, remove that device from the device map
     * @param deviceType Enum specifying device type
     * @param deviceSlot "Slot" or index that device is referenced in
     */
    _unregisterDevice(deviceType, deviceSlot) {
        if (this._inputs[deviceType][deviceSlot]) {
            delete this._inputs[deviceType][deviceSlot];
            this._onDeviceDisconnected(deviceType, deviceSlot);
        }
    }
    /**
     * Handle all actions that come from keyboard interaction
     */
    _handleKeyActions() {
        this._keyboardDownEvent = (evt) => {
            if (!this._keyboardActive) {
                this._keyboardActive = true;
                this._registerDevice(deviceEnums/* DeviceType */.bq.Keyboard, 0, MAX_KEYCODES);
            }
            const kbKey = this._inputs[deviceEnums/* DeviceType */.bq.Keyboard][0];
            if (kbKey) {
                kbKey[evt.keyCode] = 1;
                const deviceEvent = evt;
                deviceEvent.inputIndex = evt.keyCode;
                if (this._usingMacOS && evt.metaKey && evt.key !== "Meta") {
                    if (!this._metaKeys.includes(evt.keyCode)) {
                        this._metaKeys.push(evt.keyCode);
                    }
                }
                this._onInputChanged(deviceEnums/* DeviceType */.bq.Keyboard, 0, deviceEvent);
            }
        };
        this._keyboardUpEvent = (evt) => {
            if (!this._keyboardActive) {
                this._keyboardActive = true;
                this._registerDevice(deviceEnums/* DeviceType */.bq.Keyboard, 0, MAX_KEYCODES);
            }
            const kbKey = this._inputs[deviceEnums/* DeviceType */.bq.Keyboard][0];
            if (kbKey) {
                kbKey[evt.keyCode] = 0;
                const deviceEvent = evt;
                deviceEvent.inputIndex = evt.keyCode;
                if (this._usingMacOS && evt.key === "Meta" && this._metaKeys.length > 0) {
                    for (const keyCode of this._metaKeys) {
                        const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType */.bq.Keyboard, 0, keyCode, 0, this, this._elementToAttachTo);
                        kbKey[keyCode] = 0;
                        this._onInputChanged(deviceEnums/* DeviceType */.bq.Keyboard, 0, deviceEvent);
                    }
                    this._metaKeys.splice(0, this._metaKeys.length);
                }
                this._onInputChanged(deviceEnums/* DeviceType */.bq.Keyboard, 0, deviceEvent);
            }
        };
        this._keyboardBlurEvent = () => {
            if (this._keyboardActive) {
                const kbKey = this._inputs[deviceEnums/* DeviceType */.bq.Keyboard][0];
                for (let i = 0; i < kbKey.length; i++) {
                    if (kbKey[i] !== 0) {
                        kbKey[i] = 0;
                        const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType */.bq.Keyboard, 0, i, 0, this, this._elementToAttachTo);
                        this._onInputChanged(deviceEnums/* DeviceType */.bq.Keyboard, 0, deviceEvent);
                    }
                }
                if (this._usingMacOS) {
                    this._metaKeys.splice(0, this._metaKeys.length);
                }
            }
        };
        this._elementToAttachTo.addEventListener("keydown", this._keyboardDownEvent);
        this._elementToAttachTo.addEventListener("keyup", this._keyboardUpEvent);
        this._elementToAttachTo.addEventListener("blur", this._keyboardBlurEvent);
    }
    /**
     * Handle all actions that come from pointer interaction
     */
    _handlePointerActions() {
        // If maxTouchPoints is defined, use that value.  Otherwise, allow for a minimum for supported gestures like pinch
        this._maxTouchPoints = ((0,domManagement/* IsNavigatorAvailable */.XD)() && navigator.maxTouchPoints) || 2;
        if (!this._activeTouchIds) {
            this._activeTouchIds = new Array(this._maxTouchPoints);
        }
        for (let i = 0; i < this._maxTouchPoints; i++) {
            this._activeTouchIds[i] = -1;
        }
        this._pointerMoveEvent = (evt) => {
            const deviceType = this._getPointerType(evt);
            let deviceSlot = deviceType === deviceEnums/* DeviceType */.bq.Mouse ? 0 : this._activeTouchIds.indexOf(evt.pointerId);
            // In the event that we're getting pointermove events from touch inputs that we aren't tracking,
            // look for an available slot and retroactively connect it.
            if (deviceType === deviceEnums/* DeviceType */.bq.Touch && deviceSlot === -1) {
                const idx = this._activeTouchIds.indexOf(-1);
                if (idx >= 0) {
                    deviceSlot = idx;
                    this._activeTouchIds[idx] = evt.pointerId;
                    // Because this is a "new" input, inform the connected callback
                    this._onDeviceConnected(deviceType, deviceSlot);
                }
                else {
                    // We can't find an open slot to store new pointer so just return (can only support max number of touches)
                    tools/* Tools */.S0.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);
                    return;
                }
            }
            if (!this._inputs[deviceType]) {
                this._inputs[deviceType] = {};
            }
            if (!this._inputs[deviceType][deviceSlot]) {
                this._addPointerDevice(deviceType, deviceSlot, evt.clientX, evt.clientY);
            }
            const pointer = this._inputs[deviceType][deviceSlot];
            if (pointer) {
                const deviceEvent = evt;
                deviceEvent.inputIndex = deviceEnums/* PointerInput */.ST.Move;
                pointer[deviceEnums/* PointerInput */.ST.Horizontal] = evt.clientX;
                pointer[deviceEnums/* PointerInput */.ST.Vertical] = evt.clientY;
                // For touches that aren't started with a down, we need to set the button state to 1
                if (deviceType === deviceEnums/* DeviceType */.bq.Touch && pointer[deviceEnums/* PointerInput */.ST.LeftClick] === 0) {
                    pointer[deviceEnums/* PointerInput */.ST.LeftClick] = 1;
                }
                if (evt.pointerId === undefined) {
                    evt.pointerId = this._mouseId;
                }
                this._onInputChanged(deviceType, deviceSlot, deviceEvent);
                // Lets Propagate the event for move with same position.
                if (!this._usingSafari && evt.button !== -1) {
                    deviceEvent.inputIndex = evt.button + 2;
                    pointer[evt.button + 2] = pointer[evt.button + 2] ? 0 : 1; // Reverse state of button if evt.button has value
                    this._onInputChanged(deviceType, deviceSlot, deviceEvent);
                }
            }
        };
        this._pointerDownEvent = (evt) => {
            const deviceType = this._getPointerType(evt);
            let deviceSlot = deviceType === deviceEnums/* DeviceType */.bq.Mouse ? 0 : evt.pointerId;
            if (deviceType === deviceEnums/* DeviceType */.bq.Touch) {
                // See if this pointerId is already using an existing slot
                // (possible on some devices which raise the pointerMove event before the pointerDown event, e.g. when using a pen)
                let idx = this._activeTouchIds.indexOf(evt.pointerId);
                if (idx === -1) {
                    // If the pointerId wasn't already using a slot, find an open one
                    idx = this._activeTouchIds.indexOf(-1);
                }
                if (idx >= 0) {
                    deviceSlot = idx;
                    this._activeTouchIds[idx] = evt.pointerId;
                }
                else {
                    // We can't find an open slot to store new pointer so just return (can only support max number of touches)
                    tools/* Tools */.S0.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);
                    return;
                }
            }
            if (!this._inputs[deviceType]) {
                this._inputs[deviceType] = {};
            }
            if (!this._inputs[deviceType][deviceSlot]) {
                this._addPointerDevice(deviceType, deviceSlot, evt.clientX, evt.clientY);
            }
            else if (deviceType === deviceEnums/* DeviceType */.bq.Touch) {
                this._onDeviceConnected(deviceType, deviceSlot);
            }
            const pointer = this._inputs[deviceType][deviceSlot];
            if (pointer) {
                const previousHorizontal = pointer[deviceEnums/* PointerInput */.ST.Horizontal];
                const previousVertical = pointer[deviceEnums/* PointerInput */.ST.Vertical];
                if (deviceType === deviceEnums/* DeviceType */.bq.Mouse) {
                    // Mouse; Set pointerId if undefined
                    if (evt.pointerId === undefined) {
                        evt.pointerId = this._mouseId;
                    }
                    if (!document.pointerLockElement) {
                        try {
                            this._elementToAttachTo.setPointerCapture(this._mouseId);
                        }
                        catch (e) {
                            // DO NOTHING
                        }
                    }
                }
                else {
                    // Touch; Since touches are dynamically assigned, only set capture if we have an id
                    if (evt.pointerId && !document.pointerLockElement) {
                        try {
                            this._elementToAttachTo.setPointerCapture(evt.pointerId);
                        }
                        catch (e) {
                            // DO NOTHING
                        }
                    }
                }
                pointer[deviceEnums/* PointerInput */.ST.Horizontal] = evt.clientX;
                pointer[deviceEnums/* PointerInput */.ST.Vertical] = evt.clientY;
                pointer[evt.button + 2] = 1;
                const deviceEvent = evt;
                // NOTE: The +2 used here to is because PointerInput has the same value progression for its mouse buttons as PointerEvent.button
                // However, we have our X and Y values front-loaded to group together the touch inputs but not break this progression
                // EG. ([X, Y, Left-click], Middle-click, etc...)
                deviceEvent.inputIndex = evt.button + 2;
                this._onInputChanged(deviceType, deviceSlot, deviceEvent);
                if (previousHorizontal !== evt.clientX || previousVertical !== evt.clientY) {
                    deviceEvent.inputIndex = deviceEnums/* PointerInput */.ST.Move;
                    this._onInputChanged(deviceType, deviceSlot, deviceEvent);
                }
            }
        };
        this._pointerUpEvent = (evt) => {
            const deviceType = this._getPointerType(evt);
            const deviceSlot = deviceType === deviceEnums/* DeviceType */.bq.Mouse ? 0 : this._activeTouchIds.indexOf(evt.pointerId);
            if (deviceType === deviceEnums/* DeviceType */.bq.Touch) {
                // If we're getting a pointerup event for a touch that isn't active, just return.
                if (deviceSlot === -1) {
                    return;
                }
                else {
                    this._activeTouchIds[deviceSlot] = -1;
                }
            }
            const pointer = this._inputs[deviceType]?.[deviceSlot];
            if (pointer && pointer[evt.button + 2] !== 0) {
                const previousHorizontal = pointer[deviceEnums/* PointerInput */.ST.Horizontal];
                const previousVertical = pointer[deviceEnums/* PointerInput */.ST.Vertical];
                pointer[deviceEnums/* PointerInput */.ST.Horizontal] = evt.clientX;
                pointer[deviceEnums/* PointerInput */.ST.Vertical] = evt.clientY;
                pointer[evt.button + 2] = 0;
                const deviceEvent = evt;
                if (evt.pointerId === undefined) {
                    evt.pointerId = this._mouseId;
                }
                if (previousHorizontal !== evt.clientX || previousVertical !== evt.clientY) {
                    deviceEvent.inputIndex = deviceEnums/* PointerInput */.ST.Move;
                    this._onInputChanged(deviceType, deviceSlot, deviceEvent);
                }
                // NOTE: The +2 used here to is because PointerInput has the same value progression for its mouse buttons as PointerEvent.button
                // However, we have our X and Y values front-loaded to group together the touch inputs but not break this progression
                // EG. ([X, Y, Left-click], Middle-click, etc...)
                deviceEvent.inputIndex = evt.button + 2;
                if (deviceType === deviceEnums/* DeviceType */.bq.Mouse && this._mouseId >= 0 && this._elementToAttachTo.hasPointerCapture?.(this._mouseId)) {
                    this._elementToAttachTo.releasePointerCapture(this._mouseId);
                }
                else if (evt.pointerId && this._elementToAttachTo.hasPointerCapture?.(evt.pointerId)) {
                    this._elementToAttachTo.releasePointerCapture(evt.pointerId);
                }
                this._onInputChanged(deviceType, deviceSlot, deviceEvent);
                if (deviceType === deviceEnums/* DeviceType */.bq.Touch) {
                    this._onDeviceDisconnected(deviceType, deviceSlot);
                }
            }
        };
        this._pointerCancelEvent = (evt) => {
            if (evt.pointerType === "mouse") {
                const pointer = this._inputs[deviceEnums/* DeviceType */.bq.Mouse][0];
                if (this._mouseId >= 0 && this._elementToAttachTo.hasPointerCapture?.(this._mouseId)) {
                    this._elementToAttachTo.releasePointerCapture(this._mouseId);
                }
                for (let inputIndex = deviceEnums/* PointerInput */.ST.LeftClick; inputIndex <= deviceEnums/* PointerInput */.ST.BrowserForward; inputIndex++) {
                    if (pointer[inputIndex] === 1) {
                        pointer[inputIndex] = 0;
                        const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType */.bq.Mouse, 0, inputIndex, 0, this, this._elementToAttachTo);
                        this._onInputChanged(deviceEnums/* DeviceType */.bq.Mouse, 0, deviceEvent);
                    }
                }
            }
            else {
                const deviceSlot = this._activeTouchIds.indexOf(evt.pointerId);
                // If we're getting a pointercancel event for a touch that isn't active, just return
                if (deviceSlot === -1) {
                    return;
                }
                if (this._elementToAttachTo.hasPointerCapture?.(evt.pointerId)) {
                    this._elementToAttachTo.releasePointerCapture(evt.pointerId);
                }
                this._inputs[deviceEnums/* DeviceType */.bq.Touch][deviceSlot][deviceEnums/* PointerInput */.ST.LeftClick] = 0;
                const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType */.bq.Touch, deviceSlot, deviceEnums/* PointerInput */.ST.LeftClick, 0, this, this._elementToAttachTo, evt.pointerId);
                this._onInputChanged(deviceEnums/* DeviceType */.bq.Touch, deviceSlot, deviceEvent);
                this._activeTouchIds[deviceSlot] = -1;
                this._onDeviceDisconnected(deviceEnums/* DeviceType */.bq.Touch, deviceSlot);
            }
        };
        // Set Wheel Event Name, code originally from scene.inputManager
        this._wheelEventName =
            "onwheel" in document.createElement("div")
                ? "wheel" // Modern browsers support "wheel"
                : document.onmousewheel !== undefined
                    ? "mousewheel" // Webkit and IE support at least "mousewheel"
                    : "DOMMouseScroll"; // let's assume that remaining browsers are older Firefox
        // Code originally in scene.inputManager.ts
        // Chrome reports warning in console if wheel listener doesn't set an explicit passive option.
        // IE11 only supports captureEvent:boolean, not options:object, and it defaults to false.
        // Feature detection technique copied from: https://github.com/github/eventlistener-polyfill (MIT license)
        let passiveSupported = false;
        const noop = function () { };
        try {
            const options = Object.defineProperty({}, "passive", {
                get: function () {
                    passiveSupported = true;
                },
            });
            this._elementToAttachTo.addEventListener("test", noop, options);
            this._elementToAttachTo.removeEventListener("test", noop, options);
        }
        catch (e) {
            /* */
        }
        this._pointerBlurEvent = () => {
            // Handle mouse buttons
            if (this.isDeviceAvailable(deviceEnums/* DeviceType */.bq.Mouse)) {
                const pointer = this._inputs[deviceEnums/* DeviceType */.bq.Mouse][0];
                if (this._mouseId >= 0 && this._elementToAttachTo.hasPointerCapture?.(this._mouseId)) {
                    this._elementToAttachTo.releasePointerCapture(this._mouseId);
                }
                for (let inputIndex = deviceEnums/* PointerInput */.ST.LeftClick; inputIndex <= deviceEnums/* PointerInput */.ST.BrowserForward; inputIndex++) {
                    if (pointer[inputIndex] === 1) {
                        pointer[inputIndex] = 0;
                        const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType */.bq.Mouse, 0, inputIndex, 0, this, this._elementToAttachTo);
                        this._onInputChanged(deviceEnums/* DeviceType */.bq.Mouse, 0, deviceEvent);
                    }
                }
            }
            // Handle Active Touches
            if (this.isDeviceAvailable(deviceEnums/* DeviceType */.bq.Touch)) {
                const pointer = this._inputs[deviceEnums/* DeviceType */.bq.Touch];
                for (let deviceSlot = 0; deviceSlot < this._activeTouchIds.length; deviceSlot++) {
                    const pointerId = this._activeTouchIds[deviceSlot];
                    if (this._elementToAttachTo.hasPointerCapture?.(pointerId)) {
                        this._elementToAttachTo.releasePointerCapture(pointerId);
                    }
                    if (pointerId !== -1 && pointer[deviceSlot]?.[deviceEnums/* PointerInput */.ST.LeftClick] === 1) {
                        pointer[deviceSlot][deviceEnums/* PointerInput */.ST.LeftClick] = 0;
                        const deviceEvent = DeviceEventFactory.CreateDeviceEvent(deviceEnums/* DeviceType */.bq.Touch, deviceSlot, deviceEnums/* PointerInput */.ST.LeftClick, 0, this, this._elementToAttachTo, pointerId);
                        this._onInputChanged(deviceEnums/* DeviceType */.bq.Touch, deviceSlot, deviceEvent);
                        this._activeTouchIds[deviceSlot] = -1;
                        this._onDeviceDisconnected(deviceEnums/* DeviceType */.bq.Touch, deviceSlot);
                    }
                }
            }
        };
        this._pointerWheelEvent = (evt) => {
            const deviceType = deviceEnums/* DeviceType */.bq.Mouse;
            const deviceSlot = 0;
            if (!this._inputs[deviceType]) {
                this._inputs[deviceType] = [];
            }
            if (!this._inputs[deviceType][deviceSlot]) {
                this._pointerActive = true;
                this._registerDevice(deviceType, deviceSlot, MAX_POINTER_INPUTS);
            }
            const pointer = this._inputs[deviceType][deviceSlot];
            if (pointer) {
                pointer[deviceEnums/* PointerInput */.ST.MouseWheelX] = evt.deltaX || 0;
                pointer[deviceEnums/* PointerInput */.ST.MouseWheelY] = evt.deltaY || evt.wheelDelta || 0;
                pointer[deviceEnums/* PointerInput */.ST.MouseWheelZ] = evt.deltaZ || 0;
                const deviceEvent = evt;
                // By default, there is no pointerId for mouse wheel events so we'll add one here
                // This logic was originally in the InputManager but was added here to make the
                // InputManager more platform-agnostic
                if (evt.pointerId === undefined) {
                    evt.pointerId = this._mouseId;
                }
                if (pointer[deviceEnums/* PointerInput */.ST.MouseWheelX] !== 0) {
                    deviceEvent.inputIndex = deviceEnums/* PointerInput */.ST.MouseWheelX;
                    this._onInputChanged(deviceType, deviceSlot, deviceEvent);
                }
                if (pointer[deviceEnums/* PointerInput */.ST.MouseWheelY] !== 0) {
                    deviceEvent.inputIndex = deviceEnums/* PointerInput */.ST.MouseWheelY;
                    this._onInputChanged(deviceType, deviceSlot, deviceEvent);
                }
                if (pointer[deviceEnums/* PointerInput */.ST.MouseWheelZ] !== 0) {
                    deviceEvent.inputIndex = deviceEnums/* PointerInput */.ST.MouseWheelZ;
                    this._onInputChanged(deviceType, deviceSlot, deviceEvent);
                }
            }
        };
        // Workaround for MacOS Chromium Browsers for lost pointer capture bug
        if (this._usingMacOS && this._isUsingChromium) {
            this._pointerMacOSChromeOutEvent = (evt) => {
                if (evt.buttons > 1) {
                    this._pointerCancelEvent(evt);
                }
            };
            this._elementToAttachTo.addEventListener("lostpointercapture", this._pointerMacOSChromeOutEvent);
        }
        this._elementToAttachTo.addEventListener(this._eventPrefix + "move", this._pointerMoveEvent);
        this._elementToAttachTo.addEventListener(this._eventPrefix + "down", this._pointerDownEvent);
        this._elementToAttachTo.addEventListener(this._eventPrefix + "up", this._pointerUpEvent);
        this._elementToAttachTo.addEventListener(this._eventPrefix + "cancel", this._pointerCancelEvent);
        this._elementToAttachTo.addEventListener("blur", this._pointerBlurEvent);
        this._elementToAttachTo.addEventListener(this._wheelEventName, this._pointerWheelEvent, passiveSupported ? { passive: false } : false);
        // Since there's no up or down event for mouse wheel or delta x/y, clear mouse values at end of frame
        this._pointerInputClearObserver = this._engine.onEndFrameObservable.add(() => {
            if (this.isDeviceAvailable(deviceEnums/* DeviceType */.bq.Mouse)) {
                const pointer = this._inputs[deviceEnums/* DeviceType */.bq.Mouse][0];
                pointer[deviceEnums/* PointerInput */.ST.MouseWheelX] = 0;
                pointer[deviceEnums/* PointerInput */.ST.MouseWheelY] = 0;
                pointer[deviceEnums/* PointerInput */.ST.MouseWheelZ] = 0;
            }
        });
    }
    /**
     * Handle all actions that come from gamepad interaction
     */
    _handleGamepadActions() {
        this._gamepadConnectedEvent = (evt) => {
            this._addGamePad(evt.gamepad);
        };
        this._gamepadDisconnectedEvent = (evt) => {
            if (this._gamepads) {
                const deviceType = this._getGamepadDeviceType(evt.gamepad.id);
                const deviceSlot = evt.gamepad.index;
                this._unregisterDevice(deviceType, deviceSlot);
                delete this._gamepads[deviceSlot];
            }
        };
        window.addEventListener("gamepadconnected", this._gamepadConnectedEvent);
        window.addEventListener("gamepaddisconnected", this._gamepadDisconnectedEvent);
    }
    /**
     * Update all non-event based devices with each frame
     * @param deviceType Enum specifying device type
     * @param deviceSlot "Slot" or index that device is referenced in
     * @param inputIndex Id of input to be checked
     */
    _updateDevice(deviceType, deviceSlot, inputIndex) {
        // Gamepads
        const gp = navigator.getGamepads()[deviceSlot];
        if (gp && deviceType === this._gamepads[deviceSlot]) {
            const device = this._inputs[deviceType][deviceSlot];
            if (inputIndex >= gp.buttons.length) {
                device[inputIndex] = gp.axes[inputIndex - gp.buttons.length].valueOf();
            }
            else {
                device[inputIndex] = gp.buttons[inputIndex].value;
            }
        }
    }
    /**
     * Gets DeviceType from the device name
     * @param deviceName Name of Device from DeviceInputSystem
     * @returns DeviceType enum value
     */
    _getGamepadDeviceType(deviceName) {
        if (deviceName.indexOf("054c") !== -1) {
            // DualShock 4 Gamepad
            return deviceName.indexOf("0ce6") !== -1 ? deviceEnums/* DeviceType */.bq.DualSense : deviceEnums/* DeviceType */.bq.DualShock;
        }
        else if (deviceName.indexOf("Xbox One") !== -1 || deviceName.search("Xbox 360") !== -1 || deviceName.search("xinput") !== -1) {
            // Xbox Gamepad
            return deviceEnums/* DeviceType */.bq.Xbox;
        }
        else if (deviceName.indexOf("057e") !== -1) {
            // Switch Gamepad
            return deviceEnums/* DeviceType */.bq.Switch;
        }
        return deviceEnums/* DeviceType */.bq.Generic;
    }
    /**
     * Get DeviceType from a given pointer/mouse/touch event.
     * @param evt PointerEvent to evaluate
     * @returns DeviceType interpreted from event
     */
    _getPointerType(evt) {
        let deviceType = deviceEnums/* DeviceType */.bq.Mouse;
        if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) {
            deviceType = deviceEnums/* DeviceType */.bq.Touch;
        }
        return deviceType;
    }
}
//# sourceMappingURL=webDeviceInputSystem.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.js
var InputDevices_deviceSource = __webpack_require__(51314);
;// ./node_modules/@babylonjs/core/DeviceInput/internalDeviceSourceManager.js




/** @internal */
class InternalDeviceSourceManager {
    constructor(engine) {
        this._registeredManagers = new Array();
        this._refCount = 0;
        // Public Functions
        this.registerManager = (manager) => {
            for (let deviceType = 0; deviceType < this._devices.length; deviceType++) {
                const device = this._devices[deviceType];
                for (const deviceSlotKey in device) {
                    const deviceSlot = +deviceSlotKey;
                    manager._addDevice(new InputDevices_deviceSource/* DeviceSource */.c(this._deviceInputSystem, deviceType, deviceSlot));
                }
            }
            this._registeredManagers.push(manager);
        };
        this.unregisterManager = (manager) => {
            const idx = this._registeredManagers.indexOf(manager);
            if (idx > -1) {
                this._registeredManagers.splice(idx, 1);
            }
        };
        const numberOfDeviceTypes = Object.keys(deviceEnums/* DeviceType */.bq).length / 2;
        this._devices = new Array(numberOfDeviceTypes);
        const onDeviceConnected = (deviceType, deviceSlot) => {
            if (!this._devices[deviceType]) {
                this._devices[deviceType] = new Array();
            }
            if (!this._devices[deviceType][deviceSlot]) {
                this._devices[deviceType][deviceSlot] = deviceSlot;
            }
            for (const manager of this._registeredManagers) {
                const deviceSource = new InputDevices_deviceSource/* DeviceSource */.c(this._deviceInputSystem, deviceType, deviceSlot);
                manager._addDevice(deviceSource);
            }
        };
        const onDeviceDisconnected = (deviceType, deviceSlot) => {
            if (this._devices[deviceType]?.[deviceSlot]) {
                delete this._devices[deviceType][deviceSlot];
            }
            for (const manager of this._registeredManagers) {
                manager._removeDevice(deviceType, deviceSlot);
            }
        };
        const onInputChanged = (deviceType, deviceSlot, eventData) => {
            if (eventData) {
                for (const manager of this._registeredManagers) {
                    manager._onInputChanged(deviceType, deviceSlot, eventData);
                }
            }
        };
        if (typeof _native !== "undefined") {
            this._deviceInputSystem = new NativeDeviceInputSystem(onDeviceConnected, onDeviceDisconnected, onInputChanged);
        }
        else {
            this._deviceInputSystem = new WebDeviceInputSystem(engine, onDeviceConnected, onDeviceDisconnected, onInputChanged);
        }
    }
    dispose() {
        this._deviceInputSystem.dispose();
    }
}
//# sourceMappingURL=internalDeviceSourceManager.js.map
;// ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js



/**
 * Class to keep track of devices
 */
class DeviceSourceManager {
    // Public Functions
    /**
     * Gets a DeviceSource, given a type and slot
     * @param deviceType - Type of Device
     * @param deviceSlot - Slot or ID of device
     * @returns DeviceSource
     */
    getDeviceSource(deviceType, deviceSlot) {
        if (deviceSlot === undefined) {
            if (this._firstDevice[deviceType] === undefined) {
                return null;
            }
            deviceSlot = this._firstDevice[deviceType];
        }
        if (!this._devices[deviceType] || this._devices[deviceType][deviceSlot] === undefined) {
            return null;
        }
        return this._devices[deviceType][deviceSlot];
    }
    /**
     * Gets an array of DeviceSource objects for a given device type
     * @param deviceType - Type of Device
     * @returns All available DeviceSources of a given type
     */
    getDeviceSources(deviceType) {
        // If device type hasn't had any devices connected yet, return empty array.
        if (!this._devices[deviceType]) {
            return [];
        }
        return this._devices[deviceType].filter((source) => {
            return !!source;
        });
    }
    /**
     * Default constructor
     * @param engine - Used to get canvas (if applicable)
     */
    constructor(engine) {
        const numberOfDeviceTypes = Object.keys(deviceEnums/* DeviceType */.bq).length / 2;
        this._devices = new Array(numberOfDeviceTypes);
        this._firstDevice = new Array(numberOfDeviceTypes);
        this._engine = engine;
        if (!this._engine._deviceSourceManager) {
            this._engine._deviceSourceManager = new InternalDeviceSourceManager(engine);
        }
        this._engine._deviceSourceManager._refCount++;
        // Observables
        this.onDeviceConnectedObservable = new observable/* Observable */.cP((observer) => {
            for (const devices of this._devices) {
                if (devices) {
                    for (const device of devices) {
                        if (device) {
                            this.onDeviceConnectedObservable.notifyObserver(observer, device);
                        }
                    }
                }
            }
        });
        this.onDeviceDisconnectedObservable = new observable/* Observable */.cP();
        this._engine._deviceSourceManager.registerManager(this);
        this._onDisposeObserver = engine.onDisposeObservable.add(() => {
            this.dispose();
        });
    }
    /**
     * Dispose of DeviceSourceManager
     */
    dispose() {
        // Null out observable refs
        this.onDeviceConnectedObservable.clear();
        this.onDeviceDisconnectedObservable.clear();
        if (this._engine._deviceSourceManager) {
            this._engine._deviceSourceManager.unregisterManager(this);
            if (--this._engine._deviceSourceManager._refCount < 1) {
                this._engine._deviceSourceManager.dispose();
                delete this._engine._deviceSourceManager;
            }
        }
        this._engine.onDisposeObservable.remove(this._onDisposeObserver);
    }
    // Hidden Functions
    /**
     * @param deviceSource - Source to add
     * @internal
     */
    _addDevice(deviceSource) {
        if (!this._devices[deviceSource.deviceType]) {
            this._devices[deviceSource.deviceType] = new Array();
        }
        if (!this._devices[deviceSource.deviceType][deviceSource.deviceSlot]) {
            this._devices[deviceSource.deviceType][deviceSource.deviceSlot] = deviceSource;
            this._updateFirstDevices(deviceSource.deviceType);
        }
        this.onDeviceConnectedObservable.notifyObservers(deviceSource);
    }
    /**
     * @param deviceType - DeviceType
     * @param deviceSlot - DeviceSlot
     * @internal
     */
    _removeDevice(deviceType, deviceSlot) {
        const deviceSource = this._devices[deviceType]?.[deviceSlot]; // Grab local reference to use before removing from devices
        this.onDeviceDisconnectedObservable.notifyObservers(deviceSource);
        if (this._devices[deviceType]?.[deviceSlot]) {
            delete this._devices[deviceType][deviceSlot];
        }
        // Even if we don't delete a device, we should still check for the first device as things may have gotten out of sync.
        this._updateFirstDevices(deviceType);
    }
    /**
     * @param deviceType - DeviceType
     * @param deviceSlot - DeviceSlot
     * @param eventData - Event
     * @internal
     */
    _onInputChanged(deviceType, deviceSlot, eventData) {
        this._devices[deviceType]?.[deviceSlot]?.onInputChangedObservable.notifyObservers(eventData);
    }
    // Private Functions
    _updateFirstDevices(type) {
        switch (type) {
            case deviceEnums/* DeviceType */.bq.Keyboard:
            case deviceEnums/* DeviceType */.bq.Mouse:
                this._firstDevice[type] = 0;
                break;
            case deviceEnums/* DeviceType */.bq.Touch:
            case deviceEnums/* DeviceType */.bq.DualSense:
            case deviceEnums/* DeviceType */.bq.DualShock:
            case deviceEnums/* DeviceType */.bq.Xbox:
            case deviceEnums/* DeviceType */.bq.Switch:
            case deviceEnums/* DeviceType */.bq.Generic: {
                delete this._firstDevice[type];
                // eslint-disable-next-line no-case-declarations
                const devices = this._devices[type];
                if (devices) {
                    for (let i = 0; i < devices.length; i++) {
                        if (devices[i]) {
                            this._firstDevice[type] = i;
                            break;
                        }
                    }
                }
                break;
            }
        }
    }
}
//# sourceMappingURL=deviceSourceManager.js.map

/***/ }),

/***/ 94363:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32206);


_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setAlphaEquation = function (equation) {
    if (this._alphaEquation === equation) {
        return;
    }
    switch (equation) {
        case 0:
            this._alphaState.setAlphaEquationParameters(32774, 32774);
            break;
        case 1:
            this._alphaState.setAlphaEquationParameters(32778, 32778);
            break;
        case 2:
            this._alphaState.setAlphaEquationParameters(32779, 32779);
            break;
        case 3:
            this._alphaState.setAlphaEquationParameters(32776, 32776);
            break;
        case 4:
            this._alphaState.setAlphaEquationParameters(32775, 32775);
            break;
        case 5:
            this._alphaState.setAlphaEquationParameters(32775, 32774);
            break;
    }
    this._alphaEquation = equation;
};
//# sourceMappingURL=abstractEngine.alpha.js.map

/***/ }),

/***/ 69195:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81194);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);
/* harmony import */ var _Misc_fileTools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8532);
/* harmony import */ var _Misc_guid_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38688);
/* harmony import */ var _abstractEngine_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32206);
/* harmony import */ var _Materials_Textures_Loaders_textureLoaderManager_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18454);






_abstractEngine_js__WEBPACK_IMPORTED_MODULE_4__/* .AbstractEngine */ .$.prototype._partialLoadFile = function (url, index, loadedFiles, onfinish, onErrorCallBack = null) {
    const onload = (data) => {
        loadedFiles[index] = data;
        loadedFiles._internalCount++;
        if (loadedFiles._internalCount === 6) {
            onfinish(loadedFiles);
        }
    };
    const onerror = (request, exception) => {
        if (onErrorCallBack && request) {
            onErrorCallBack(request.status + " " + request.statusText, exception);
        }
    };
    this._loadFile(url, onload, undefined, undefined, true, onerror);
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_4__/* .AbstractEngine */ .$.prototype._cascadeLoadFiles = function (scene, onfinish, files, onError = null) {
    const loadedFiles = [];
    loadedFiles._internalCount = 0;
    for (let index = 0; index < 6; index++) {
        this._partialLoadFile(files[index], index, loadedFiles, onfinish, onError);
    }
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_4__/* .AbstractEngine */ .$.prototype._cascadeLoadImgs = function (scene, texture, onfinish, files, onError = null, mimeType) {
    const loadedImages = [];
    loadedImages._internalCount = 0;
    for (let index = 0; index < 6; index++) {
        this._partialLoadImg(files[index], index, loadedImages, scene, texture, onfinish, onError, mimeType);
    }
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_4__/* .AbstractEngine */ .$.prototype._partialLoadImg = function (url, index, loadedImages, scene, texture, onfinish, onErrorCallBack = null, mimeType) {
    const tokenPendingData = (0,_Misc_guid_js__WEBPACK_IMPORTED_MODULE_3__/* .RandomGUID */ .z)();
    const onload = (img) => {
        loadedImages[index] = img;
        loadedImages._internalCount++;
        if (scene) {
            scene.removePendingData(tokenPendingData);
        }
        if (loadedImages._internalCount === 6 && onfinish) {
            onfinish(texture, loadedImages);
        }
    };
    const onerror = (message, exception) => {
        if (scene) {
            scene.removePendingData(tokenPendingData);
        }
        if (onErrorCallBack) {
            onErrorCallBack(message, exception);
        }
    };
    (0,_Misc_fileTools_js__WEBPACK_IMPORTED_MODULE_2__/* .LoadImage */ .W$)(url, onload, onerror, scene ? scene.offlineProvider : null, mimeType);
    if (scene) {
        scene.addPendingData(tokenPendingData);
    }
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_4__/* .AbstractEngine */ .$.prototype.createCubeTextureBase = function (rootUrl, scene, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, beforeLoadCubeDataCallback = null, imageHandler = null, useSRGBBuffer = false, buffer = null) {
    const texture = fallback ? fallback : new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .hV(this, 7 /* InternalTextureSource.Cube */);
    texture.isCube = true;
    texture.url = rootUrl;
    texture.generateMipMaps = !noMipmap;
    texture._lodGenerationScale = lodScale;
    texture._lodGenerationOffset = lodOffset;
    texture._useSRGBBuffer = !!useSRGBBuffer && this._caps.supportSRGBBuffers && (this.version > 1 || this.isWebGPU || !!noMipmap);
    if (texture !== fallback) {
        texture.label = rootUrl.substring(0, 60); // default label, can be overriden by the caller
    }
    if (!this._doNotHandleContextLost) {
        texture._extension = forcedExtension;
        texture._files = files;
        texture._buffer = buffer;
    }
    const originalRootUrl = rootUrl;
    if (this._transformTextureUrl && !fallback) {
        rootUrl = this._transformTextureUrl(rootUrl);
    }
    const rootUrlWithoutUriParams = rootUrl.split("?")[0];
    const lastDot = rootUrlWithoutUriParams.lastIndexOf(".");
    const extension = forcedExtension ? forcedExtension : lastDot > -1 ? rootUrlWithoutUriParams.substring(lastDot).toLowerCase() : "";
    const loaderPromise = (0,_Materials_Textures_Loaders_textureLoaderManager_js__WEBPACK_IMPORTED_MODULE_5__/* ._GetCompatibleTextureLoader */ .gT)(extension);
    const onInternalError = (request, exception) => {
        if (rootUrl === originalRootUrl) {
            if (onError && request) {
                onError(request.status + " " + request.statusText, exception);
            }
        }
        else {
            // fall back to the original url if the transformed url fails to load
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn(`Failed to load ${rootUrl}, falling back to the ${originalRootUrl}`);
            this.createCubeTextureBase(originalRootUrl, scene, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, texture, beforeLoadCubeDataCallback, imageHandler, useSRGBBuffer, buffer);
        }
    };
    if (loaderPromise) {
        loaderPromise.then((loader) => {
            const onloaddata = (data) => {
                if (beforeLoadCubeDataCallback) {
                    beforeLoadCubeDataCallback(texture, data);
                }
                loader.loadCubeData(data, texture, createPolynomials, onLoad, onError);
            };
            if (buffer) {
                onloaddata(buffer);
            }
            else if (files && files.length === 6) {
                if (loader.supportCascades) {
                    this._cascadeLoadFiles(scene, (images) => onloaddata(images.map((image) => new Uint8Array(image))), files, onError);
                }
                else {
                    if (onError) {
                        onError("Textures type does not support cascades.");
                    }
                    else {
                        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("Texture loader does not support cascades.");
                    }
                }
            }
            else {
                this._loadFile(rootUrl, (data) => onloaddata(new Uint8Array(data)), undefined, undefined, true, onInternalError);
            }
        });
    }
    else {
        if (!files || files.length === 0) {
            throw new Error("Cannot load cubemap because files were not defined, or the correct loader was not found.");
        }
        this._cascadeLoadImgs(scene, texture, (texture, imgs) => {
            if (imageHandler) {
                imageHandler(texture, imgs);
            }
        }, files, onError);
    }
    this._internalTexturesCache.push(texture);
    return texture;
};
//# sourceMappingURL=abstractEngine.cubeTexture.js.map

/***/ }),

/***/ 28019:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32206);

_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getInputElement = function () {
    return this._renderingCanvas;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getRenderingCanvasClientRect = function () {
    if (!this._renderingCanvas) {
        return null;
    }
    return this._renderingCanvas.getBoundingClientRect();
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getInputElementClientRect = function () {
    if (!this._renderingCanvas) {
        return null;
    }
    return this.getInputElement().getBoundingClientRect();
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getAspectRatio = function (viewportOwner, useScreen = false) {
    const viewport = viewportOwner.viewport;
    return (this.getRenderWidth(useScreen) * viewport.width) / (this.getRenderHeight(useScreen) * viewport.height);
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getScreenAspectRatio = function () {
    return this.getRenderWidth(true) / this.getRenderHeight(true);
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype._verifyPointerLock = function () {
    this._onPointerLockChange?.();
};
//# sourceMappingURL=abstractEngine.dom.js.map

/***/ }),

/***/ 29967:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18790);
/* harmony import */ var _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32206);


_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.prototype.displayLoadingUI = function () {
    if (!(0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .IsWindowObjectExist */ .BA)()) {
        return;
    }
    const loadingScreen = this.loadingScreen;
    if (loadingScreen) {
        loadingScreen.displayLoadingUI();
    }
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.prototype.hideLoadingUI = function () {
    if (!(0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .IsWindowObjectExist */ .BA)()) {
        return;
    }
    const loadingScreen = this._loadingScreen;
    if (loadingScreen) {
        loadingScreen.hideLoadingUI();
    }
};
Object.defineProperty(_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.prototype, "loadingScreen", {
    get: function () {
        if (!this._loadingScreen && this._renderingCanvas) {
            this._loadingScreen = _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.DefaultLoadingScreenFactory(this._renderingCanvas);
        }
        return this._loadingScreen;
    },
    set: function (value) {
        this._loadingScreen = value;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.prototype, "loadingUIText", {
    set: function (value) {
        this.loadingScreen.loadingUIText = value;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.prototype, "loadingUIBackgroundColor", {
    set: function (value) {
        this.loadingScreen.loadingUIBackgroundColor = value;
    },
    enumerable: true,
    configurable: true,
});
//# sourceMappingURL=abstractEngine.loadingScreen.js.map

/***/ }),

/***/ 97298:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32206);

_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getRenderPassNames = function () {
    return this._renderPassNames;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getCurrentRenderPassName = function () {
    return this._renderPassNames[this.currentRenderPassId];
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.createRenderPassId = function (name) {
    // Note: render pass id == 0 is always for the main render pass
    const id = ++_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$._RenderPassIdCounter;
    this._renderPassNames[id] = name ?? "NONAME";
    return id;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.releaseRenderPassId = function (id) {
    this._renderPassNames[id] = undefined;
    for (let s = 0; s < this.scenes.length; ++s) {
        const scene = this.scenes[s];
        for (let m = 0; m < scene.meshes.length; ++m) {
            const mesh = scene.meshes[m];
            if (mesh.subMeshes) {
                for (let b = 0; b < mesh.subMeshes.length; ++b) {
                    const subMesh = mesh.subMeshes[b];
                    subMesh._removeDrawWrapper(id);
                }
            }
        }
    }
};
//# sourceMappingURL=abstractEngine.renderPass.js.map

/***/ }),

/***/ 46125:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32206);
/* harmony import */ var _abstractEngine_alpha_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94363);



_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getInputElement = function () {
    return this._renderingCanvas;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getDepthFunction = function () {
    return this._depthCullingState.depthFunc;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setDepthFunction = function (depthFunc) {
    this._depthCullingState.depthFunc = depthFunc;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setDepthFunctionToGreater = function () {
    this.setDepthFunction(516);
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setDepthFunctionToGreaterOrEqual = function () {
    this.setDepthFunction(518);
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setDepthFunctionToLess = function () {
    this.setDepthFunction(513);
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setDepthFunctionToLessOrEqual = function () {
    this.setDepthFunction(515);
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getDepthWrite = function () {
    return this._depthCullingState.depthMask;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setDepthWrite = function (enable) {
    this._depthCullingState.depthMask = enable;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getStencilBuffer = function () {
    return this._stencilState.stencilTest;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setStencilBuffer = function (enable) {
    this._stencilState.stencilTest = enable;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getStencilMask = function () {
    return this._stencilState.stencilMask;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setStencilMask = function (mask) {
    this._stencilState.stencilMask = mask;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getStencilFunction = function () {
    return this._stencilState.stencilFunc;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getStencilFunctionReference = function () {
    return this._stencilState.stencilFuncRef;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getStencilFunctionMask = function () {
    return this._stencilState.stencilFuncMask;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setStencilFunction = function (stencilFunc) {
    this._stencilState.stencilFunc = stencilFunc;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setStencilFunctionReference = function (reference) {
    this._stencilState.stencilFuncRef = reference;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setStencilFunctionMask = function (mask) {
    this._stencilState.stencilFuncMask = mask;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getStencilOperationFail = function () {
    return this._stencilState.stencilOpStencilFail;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getStencilOperationDepthFail = function () {
    return this._stencilState.stencilOpDepthFail;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getStencilOperationPass = function () {
    return this._stencilState.stencilOpStencilDepthPass;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setStencilOperationFail = function (operation) {
    this._stencilState.stencilOpStencilFail = operation;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setStencilOperationDepthFail = function (operation) {
    this._stencilState.stencilOpDepthFail = operation;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setStencilOperationPass = function (operation) {
    this._stencilState.stencilOpStencilDepthPass = operation;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.cacheStencilState = function () {
    this._cachedStencilBuffer = this.getStencilBuffer();
    this._cachedStencilFunction = this.getStencilFunction();
    this._cachedStencilMask = this.getStencilMask();
    this._cachedStencilOperationPass = this.getStencilOperationPass();
    this._cachedStencilOperationFail = this.getStencilOperationFail();
    this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail();
    this._cachedStencilReference = this.getStencilFunctionReference();
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.restoreStencilState = function () {
    this.setStencilFunction(this._cachedStencilFunction);
    this.setStencilMask(this._cachedStencilMask);
    this.setStencilBuffer(this._cachedStencilBuffer);
    this.setStencilOperationPass(this._cachedStencilOperationPass);
    this.setStencilOperationFail(this._cachedStencilOperationFail);
    this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail);
    this.setStencilFunctionReference(this._cachedStencilReference);
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.setAlphaConstants = function (r, g, b, a) {
    this._alphaState.setAlphaBlendConstants(r, g, b, a);
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getAlphaMode = function () {
    return this._alphaMode;
};
_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.getAlphaEquation = function () {
    return this._alphaEquation;
};
//# sourceMappingURL=abstractEngine.states.js.map

/***/ }),

/***/ 9696:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32206);

_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.prototype.createDepthStencilTexture = function (size, options, rtWrapper) {
    if (options.isCube) {
        const width = size.width || size;
        return this._createDepthStencilCubeTexture(width, options);
    }
    else {
        return this._createDepthStencilTexture(size, options, rtWrapper);
    }
};
//# sourceMappingURL=abstractEngine.texture.js.map

/***/ }),

/***/ 41843:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86514);


_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.setAlphaMode = function (mode, noDepthWriteChange = false) {
    if (this._alphaMode === mode) {
        if (!noDepthWriteChange) {
            // Make sure we still have the correct depth mask according to the alpha mode (a transparent material could have forced writting to the depth buffer, for instance)
            const depthMask = mode === 0;
            if (this.depthCullingState.depthMask !== depthMask) {
                this.depthCullingState.depthMask = depthMask;
            }
        }
        return;
    }
    switch (mode) {
        case 0:
            this._alphaState.alphaBlend = false;
            break;
        case 7:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE);
            this._alphaState.alphaBlend = true;
            break;
        case 8:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);
            this._alphaState.alphaBlend = true;
            break;
        case 2:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE);
            this._alphaState.alphaBlend = true;
            break;
        case 6:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE);
            this._alphaState.alphaBlend = true;
            break;
        case 1:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE);
            this._alphaState.alphaBlend = true;
            break;
        case 3:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE);
            this._alphaState.alphaBlend = true;
            break;
        case 4:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE);
            this._alphaState.alphaBlend = true;
            break;
        case 5:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE);
            this._alphaState.alphaBlend = true;
            break;
        case 9:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA);
            this._alphaState.alphaBlend = true;
            break;
        case 10:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);
            this._alphaState.alphaBlend = true;
            break;
        case 11:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE);
            this._alphaState.alphaBlend = true;
            break;
        case 12:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO);
            this._alphaState.alphaBlend = true;
            break;
        case 13:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA);
            this._alphaState.alphaBlend = true;
            break;
        case 14:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);
            this._alphaState.alphaBlend = true;
            break;
        case 15:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO);
            this._alphaState.alphaBlend = true;
            break;
        case 16:
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ZERO, this._gl.ONE);
            this._alphaState.alphaBlend = true;
            break;
        case 17:
            // Same as ALPHA_COMBINE but accumulates (1 - alpha) values in the alpha channel for a later readout in order independant transparency
            this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);
            this._alphaState.alphaBlend = true;
            break;
    }
    if (!noDepthWriteChange) {
        this.depthCullingState.depthMask = mode === 0;
    }
    this._alphaMode = mode;
};
//# sourceMappingURL=engine.alpha.js.map

/***/ }),

/***/ 83155:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86514);
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81194);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51137);
/* harmony import */ var _Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91597);





_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype._createDepthStencilCubeTexture = function (size, options) {
    const internalTexture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTexture */ .hV(this, 12 /* InternalTextureSource.DepthStencil */);
    internalTexture.isCube = true;
    if (this.webGLVersion === 1) {
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Error("Depth cube texture is not supported by WebGL 1.");
        return internalTexture;
    }
    const internalOptions = {
        bilinearFiltering: false,
        comparisonFunction: 0,
        generateStencil: false,
        ...options,
    };
    const gl = this._gl;
    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, internalTexture, true);
    this._setupDepthStencilTexture(internalTexture, size, internalOptions.bilinearFiltering, internalOptions.comparisonFunction);
    // Create the depth/stencil buffer
    for (let face = 0; face < 6; face++) {
        if (internalOptions.generateStencil) {
            gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH24_STENCIL8, size, size, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8, null);
        }
        else {
            gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH_COMPONENT24, size, size, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null);
        }
    }
    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
    this._internalTexturesCache.push(internalTexture);
    return internalTexture;
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype._setCubeMapTextureParams = function (texture, loadMipmap, maxLevel) {
    const gl = this._gl;
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    texture.samplingMode = loadMipmap ? 3 : 2;
    if (loadMipmap && this.getCaps().textureMaxLevel && maxLevel !== undefined && maxLevel > 0) {
        gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAX_LEVEL, maxLevel);
        texture._maxLodLevel = maxLevel;
    }
    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.createCubeTexture = function (rootUrl, scene, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, loaderOptions, useSRGBBuffer = false, buffer = null) {
    const gl = this._gl;
    return this.createCubeTextureBase(rootUrl, scene, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback, (texture) => this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true), (texture, imgs) => {
        const width = this.needPOTTextures ? (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .GetExponentOfTwo */ .R)(imgs[0].width, this._caps.maxCubemapTextureSize) : imgs[0].width;
        const height = width;
        const faces = [
            gl.TEXTURE_CUBE_MAP_POSITIVE_X,
            gl.TEXTURE_CUBE_MAP_POSITIVE_Y,
            gl.TEXTURE_CUBE_MAP_POSITIVE_Z,
            gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
            gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
            gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,
        ];
        this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);
        this._unpackFlipY(false);
        const internalFormat = format ? this._getInternalFormat(format, texture._useSRGBBuffer) : texture._useSRGBBuffer ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : gl.RGBA;
        let texelFormat = format ? this._getInternalFormat(format) : gl.RGBA;
        if (texture._useSRGBBuffer && this.webGLVersion === 1) {
            texelFormat = internalFormat;
        }
        for (let index = 0; index < faces.length; index++) {
            if (imgs[index].width !== width || imgs[index].height !== height) {
                this._prepareWorkingCanvas();
                if (!this._workingCanvas || !this._workingContext) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Warn("Cannot create canvas to resize texture.");
                    return;
                }
                this._workingCanvas.width = width;
                this._workingCanvas.height = height;
                this._workingContext.drawImage(imgs[index], 0, 0, imgs[index].width, imgs[index].height, 0, 0, width, height);
                gl.texImage2D(faces[index], 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, this._workingCanvas);
            }
            else {
                gl.texImage2D(faces[index], 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, imgs[index]);
            }
        }
        if (!noMipmap) {
            gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
        }
        this._setCubeMapTextureParams(texture, !noMipmap);
        texture.width = width;
        texture.height = height;
        texture.isReady = true;
        if (format) {
            texture.format = format;
        }
        texture.onLoadedObservable.notifyObservers(texture);
        texture.onLoadedObservable.clear();
        if (onLoad) {
            onLoad();
        }
    }, !!useSRGBBuffer, buffer);
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.generateMipMapsForCubemap = function (texture, unbind = true) {
    if (texture.generateMipMaps) {
        const gl = this._gl;
        this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);
        gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
        if (unbind) {
            this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
        }
    }
};
//# sourceMappingURL=engine.cubeTexture.js.map

/***/ }),

/***/ 86556:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86514);

// eslint-disable-next-line @typescript-eslint/no-unused-vars
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.updateDynamicIndexBuffer = function (indexBuffer, indices, offset = 0) {
    // Force cache update
    this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null;
    this.bindIndexBuffer(indexBuffer);
    let view;
    if (indexBuffer.is32Bits) {
        // anything else than Uint32Array needs to be converted to Uint32Array
        view = indices instanceof Uint32Array ? indices : new Uint32Array(indices);
    }
    else {
        // anything else than Uint16Array needs to be converted to Uint16Array
        view = indices instanceof Uint16Array ? indices : new Uint16Array(indices);
    }
    this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, view, this._gl.DYNAMIC_DRAW);
    this._resetIndexBufferBinding();
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.updateDynamicVertexBuffer = function (vertexBuffer, data, byteOffset, byteLength) {
    this.bindArrayBuffer(vertexBuffer);
    if (byteOffset === undefined) {
        byteOffset = 0;
    }
    const dataLength = data.byteLength || data.length;
    if (byteLength === undefined || (byteLength >= dataLength && byteOffset === 0)) {
        if (data instanceof Array) {
            this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, new Float32Array(data));
        }
        else {
            this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, data);
        }
    }
    else {
        if (data instanceof Array) {
            this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(data).subarray(byteOffset, byteOffset + byteLength));
        }
        else {
            if (data instanceof ArrayBuffer) {
                data = new Uint8Array(data, byteOffset, byteLength);
            }
            else {
                data = new Uint8Array(data.buffer, data.byteOffset + byteOffset, byteLength);
            }
            this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data);
        }
    }
    this._resetVertexBufferBinding();
};
//# sourceMappingURL=engine.dynamicBuffer.js.map

/***/ }),

/***/ 27079:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91597);
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86514);
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81194);



_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_1__.ThinEngine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {
    const texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_2__/* .InternalTexture */ .hV(this, 4 /* InternalTextureSource.Dynamic */);
    texture.baseWidth = width;
    texture.baseHeight = height;
    if (generateMipMaps) {
        width = this.needPOTTextures ? (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_0__/* .GetExponentOfTwo */ .R)(width, this._caps.maxTextureSize) : width;
        height = this.needPOTTextures ? (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_0__/* .GetExponentOfTwo */ .R)(height, this._caps.maxTextureSize) : height;
    }
    //  this.resetTextureCache();
    texture.width = width;
    texture.height = height;
    texture.isReady = false;
    texture.generateMipMaps = generateMipMaps;
    texture.samplingMode = samplingMode;
    this.updateTextureSamplingMode(samplingMode, texture);
    this._internalTexturesCache.push(texture);
    return texture;
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_1__.ThinEngine.prototype.updateDynamicTexture = function (texture, source, invertY, premulAlpha = false, format, forceBindTexture = false, 
// eslint-disable-next-line @typescript-eslint/no-unused-vars
allowGPUOptimization = false) {
    if (!texture) {
        return;
    }
    const gl = this._gl;
    const target = gl.TEXTURE_2D;
    const wasPreviouslyBound = this._bindTextureDirectly(target, texture, true, forceBindTexture);
    this._unpackFlipY(invertY === undefined ? texture.invertY : invertY);
    if (premulAlpha) {
        gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
    }
    const textureType = this._getWebGLTextureType(texture.type);
    const glformat = this._getInternalFormat(format ? format : texture.format);
    const internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, glformat);
    gl.texImage2D(target, 0, internalFormat, glformat, textureType, source);
    if (texture.generateMipMaps) {
        gl.generateMipmap(target);
    }
    if (!wasPreviouslyBound) {
        this._bindTextureDirectly(target, null);
    }
    if (premulAlpha) {
        gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0);
    }
    if (format) {
        texture.format = format;
    }
    texture._dynamicTextureSource = source;
    texture._premulAlpha = premulAlpha;
    texture.invertY = invertY || false;
    texture.isReady = true;
};
//# sourceMappingURL=engine.dynamicTexture.js.map

/***/ }),

/***/ 51881:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86514);
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81194);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51137);
/* harmony import */ var _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77517);
/* harmony import */ var _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56526);






_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.createPrefilteredCubeTexture = function (rootUrl, scene, lodScale, lodOffset, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = true) {
    const callback = async (loadData) => {
        if (!loadData) {
            if (onLoad) {
                onLoad(null);
            }
            return;
        }
        const texture = loadData.texture;
        if (!createPolynomials) {
            texture._sphericalPolynomial = new _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_3__/* .SphericalPolynomial */ .Q();
        }
        else if (loadData.info.sphericalPolynomial) {
            texture._sphericalPolynomial = loadData.info.sphericalPolynomial;
        }
        texture._source = 9 /* InternalTextureSource.CubePrefiltered */;
        if (this.getCaps().textureLOD) {
            // Do not add extra process if texture lod is supported.
            if (onLoad) {
                onLoad(texture);
            }
            return;
        }
        const mipSlices = 3;
        const gl = this._gl;
        const width = loadData.width;
        if (!width) {
            return;
        }
        // eslint-disable-next-line @typescript-eslint/naming-convention
        const { DDSTools } = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 36464));
        const textures = [];
        for (let i = 0; i < mipSlices; i++) {
            //compute LOD from even spacing in smoothness (matching shader calculation)
            const smoothness = i / (mipSlices - 1);
            const roughness = 1 - smoothness;
            const minLODIndex = lodOffset; // roughness = 0
            const maxLODIndex = Math.log2(width) * lodScale + lodOffset; // roughness = 1
            const lodIndex = minLODIndex + (maxLODIndex - minLODIndex) * roughness;
            const mipmapIndex = Math.round(Math.min(Math.max(lodIndex, 0), maxLODIndex));
            const glTextureFromLod = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .InternalTexture */ .hV(this, 2 /* InternalTextureSource.Temp */);
            glTextureFromLod.type = texture.type;
            glTextureFromLod.format = texture.format;
            glTextureFromLod.width = Math.pow(2, Math.max(Math.log2(width) - mipmapIndex, 0));
            glTextureFromLod.height = glTextureFromLod.width;
            glTextureFromLod.isCube = true;
            glTextureFromLod._cachedWrapU = 0;
            glTextureFromLod._cachedWrapV = 0;
            this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, glTextureFromLod, true);
            glTextureFromLod.samplingMode = 2;
            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
            if (loadData.isDDS) {
                const info = loadData.info;
                const data = loadData.data;
                this._unpackFlipY(info.isCompressed);
                DDSTools.UploadDDSLevels(this, glTextureFromLod, data, info, true, 6, mipmapIndex);
            }
            else {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Warn("DDS is the only prefiltered cube map supported so far.");
            }
            this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
            // Wrap in a base texture for easy binding.
            const lodTexture = new _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__/* .BaseTexture */ .t(scene);
            lodTexture._isCube = true;
            lodTexture._texture = glTextureFromLod;
            glTextureFromLod.isReady = true;
            textures.push(lodTexture);
        }
        texture._lodTextureHigh = textures[2];
        texture._lodTextureMid = textures[1];
        texture._lodTextureLow = textures[0];
        if (onLoad) {
            onLoad(texture);
        }
    };
    return this.createCubeTexture(rootUrl, scene, null, false, callback, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset);
};
//# sourceMappingURL=engine.prefilteredCubeTexture.js.map

/***/ }),

/***/ 52426:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81194);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);
/* harmony import */ var _thinEngine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86514);
/* harmony import */ var _Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91597);





_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.updateRawTexture = function (texture, data, format, invertY, compression = null, type = 0, useSRGBBuffer = false) {
    if (!texture) {
        return;
    }
    // Babylon's internalSizedFomat but gl's texImage2D internalFormat
    const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer);
    // Babylon's internalFormat but gl's texImage2D format
    const internalFormat = this._getInternalFormat(format);
    const textureType = this._getWebGLTextureType(type);
    this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);
    this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);
    if (!this._doNotHandleContextLost) {
        texture._bufferView = data;
        texture.format = format;
        texture.type = type;
        texture.invertY = invertY;
        texture._compression = compression;
    }
    if (texture.width % 4 !== 0) {
        this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1);
    }
    if (compression && data) {
        this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, 0, data);
    }
    else {
        this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, data);
    }
    if (texture.generateMipMaps) {
        this._gl.generateMipmap(this._gl.TEXTURE_2D);
    }
    this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
    //  this.resetTextureCache();
    texture.isReady = true;
};
_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, 
// eslint-disable-next-line @typescript-eslint/no-unused-vars
creationFlags = 0, useSRGBBuffer = false) {
    const texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .hV(this, 3 /* InternalTextureSource.Raw */);
    texture.baseWidth = width;
    texture.baseHeight = height;
    texture.width = width;
    texture.height = height;
    texture.format = format;
    texture.generateMipMaps = generateMipMaps;
    texture.samplingMode = samplingMode;
    texture.invertY = invertY;
    texture._compression = compression;
    texture.type = type;
    texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps);
    if (!this._doNotHandleContextLost) {
        texture._bufferView = data;
    }
    this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer);
    this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);
    // Filters
    const filters = this._getSamplingParameters(samplingMode, generateMipMaps);
    this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag);
    this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min);
    if (generateMipMaps) {
        this._gl.generateMipmap(this._gl.TEXTURE_2D);
    }
    this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
    this._internalTexturesCache.push(texture);
    return texture;
};
_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.createRawCubeTexture = function (data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) {
    const gl = this._gl;
    const texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .hV(this, 8 /* InternalTextureSource.CubeRaw */);
    texture.isCube = true;
    texture.format = format;
    texture.type = type;
    if (!this._doNotHandleContextLost) {
        texture._bufferViewArray = data;
    }
    const textureType = this._getWebGLTextureType(type);
    let internalFormat = this._getInternalFormat(format);
    if (internalFormat === gl.RGB) {
        internalFormat = gl.RGBA;
    }
    // Mipmap generation needs a sized internal format that is both color-renderable and texture-filterable
    if (textureType === gl.FLOAT && !this._caps.textureFloatLinearFiltering) {
        generateMipMaps = false;
        samplingMode = 1;
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
    }
    else if (textureType === this._gl.HALF_FLOAT_OES && !this._caps.textureHalfFloatLinearFiltering) {
        generateMipMaps = false;
        samplingMode = 1;
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
    }
    else if (textureType === gl.FLOAT && !this._caps.textureFloatRender) {
        generateMipMaps = false;
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("Render to float textures is not supported. Mipmap generation forced to false.");
    }
    else if (textureType === gl.HALF_FLOAT && !this._caps.colorBufferFloat) {
        generateMipMaps = false;
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("Render to half float textures is not supported. Mipmap generation forced to false.");
    }
    const width = size;
    const height = width;
    texture.width = width;
    texture.height = height;
    texture.invertY = invertY;
    texture._compression = compression;
    // Double check on POT to generate Mips.
    const isPot = !this.needPOTTextures || ((0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .IsExponentOfTwo */ .L8)(texture.width) && (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .IsExponentOfTwo */ .L8)(texture.height));
    if (!isPot) {
        generateMipMaps = false;
    }
    // Upload data if needed. The texture won't be ready until then.
    if (data) {
        this.updateRawCubeTexture(texture, data, format, type, invertY, compression);
    }
    else {
        const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);
        const level = 0;
        this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);
        for (let faceIndex = 0; faceIndex < 6; faceIndex++) {
            if (compression) {
                gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, undefined);
            }
            else {
                gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, null);
            }
        }
        this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
    }
    this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true);
    // Filters
    if (data && generateMipMaps) {
        this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);
    }
    const filters = this._getSamplingParameters(samplingMode, generateMipMaps);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
    texture.generateMipMaps = generateMipMaps;
    texture.samplingMode = samplingMode;
    texture.isReady = true;
    return texture;
};
_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.updateRawCubeTexture = function (texture, data, format, type, invertY, compression = null, level = 0) {
    texture._bufferViewArray = data;
    texture.format = format;
    texture.type = type;
    texture.invertY = invertY;
    texture._compression = compression;
    const gl = this._gl;
    const textureType = this._getWebGLTextureType(type);
    let internalFormat = this._getInternalFormat(format);
    const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);
    let needConversion = false;
    if (internalFormat === gl.RGB) {
        internalFormat = gl.RGBA;
        needConversion = true;
    }
    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);
    this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);
    if (texture.width % 4 !== 0) {
        gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
    }
    // Data are known to be in +X +Y +Z -X -Y -Z
    for (let faceIndex = 0; faceIndex < 6; faceIndex++) {
        let faceData = data[faceIndex];
        if (compression) {
            gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, faceData);
        }
        else {
            if (needConversion) {
                faceData = _convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type);
            }
            gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, faceData);
        }
    }
    const isPot = !this.needPOTTextures || ((0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .IsExponentOfTwo */ .L8)(texture.width) && (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .IsExponentOfTwo */ .L8)(texture.height));
    if (isPot && texture.generateMipMaps && level === 0) {
        this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);
    }
    this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
    // this.resetTextureCache();
    texture.isReady = true;
};
_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.createRawCubeTextureFromUrl = function (url, scene, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = 3, invertY = false) {
    const gl = this._gl;
    const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);
    scene?.addPendingData(texture);
    texture.url = url;
    texture.isReady = false;
    this._internalTexturesCache.push(texture);
    const onerror = (request, exception) => {
        scene?.removePendingData(texture);
        if (onError && request) {
            onError(request.status + " " + request.statusText, exception);
        }
    };
    const internalCallback = (data) => {
        const width = texture.width;
        const faceDataArrays = callback(data);
        if (!faceDataArrays) {
            return;
        }
        if (mipmapGenerator) {
            const textureType = this._getWebGLTextureType(type);
            let internalFormat = this._getInternalFormat(format);
            const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);
            let needConversion = false;
            if (internalFormat === gl.RGB) {
                internalFormat = gl.RGBA;
                needConversion = true;
            }
            this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);
            this._unpackFlipY(false);
            const mipData = mipmapGenerator(faceDataArrays);
            for (let level = 0; level < mipData.length; level++) {
                const mipSize = width >> level;
                for (let faceIndex = 0; faceIndex < 6; faceIndex++) {
                    let mipFaceData = mipData[level][faceIndex];
                    if (needConversion) {
                        mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);
                    }
                    gl.texImage2D(faceIndex, level, internalSizedFomat, mipSize, mipSize, 0, internalFormat, textureType, mipFaceData);
                }
            }
            this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
        }
        else {
            this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY);
        }
        texture.isReady = true;
        // this.resetTextureCache();
        scene?.removePendingData(texture);
        texture.onLoadedObservable.notifyObservers(texture);
        texture.onLoadedObservable.clear();
        if (onLoad) {
            onLoad();
        }
    };
    this._loadFile(url, (data) => {
        internalCallback(data);
    }, undefined, scene?.offlineProvider, true, onerror);
    return texture;
};
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function _convertRGBtoRGBATextureData(rgbData, width, height, textureType) {
    // Create new RGBA data container.
    let rgbaData;
    let val1 = 1;
    if (textureType === 1) {
        rgbaData = new Float32Array(width * height * 4);
    }
    else if (textureType === 2) {
        rgbaData = new Uint16Array(width * height * 4);
        val1 = 15360; // 15360 is the encoding of 1 in half float
    }
    else if (textureType === 7) {
        rgbaData = new Uint32Array(width * height * 4);
    }
    else {
        rgbaData = new Uint8Array(width * height * 4);
    }
    // Convert each pixel.
    for (let x = 0; x < width; x++) {
        for (let y = 0; y < height; y++) {
            const index = (y * width + x) * 3;
            const newIndex = (y * width + x) * 4;
            // Map Old Value to new value.
            rgbaData[newIndex + 0] = rgbData[index + 0];
            rgbaData[newIndex + 1] = rgbData[index + 1];
            rgbaData[newIndex + 2] = rgbData[index + 2];
            // Add fully opaque alpha channel.
            rgbaData[newIndex + 3] = val1;
        }
    }
    return rgbaData;
}
/**
 * Create a function for createRawTexture3D/createRawTexture2DArray
 * @param is3D true for TEXTURE_3D and false for TEXTURE_2D_ARRAY
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function _makeCreateRawTextureFunction(is3D) {
    return function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0) {
        const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY;
        const source = is3D ? 10 /* InternalTextureSource.Raw3D */ : 11 /* InternalTextureSource.Raw2DArray */;
        const texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .hV(this, source);
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.baseDepth = depth;
        texture.width = width;
        texture.height = height;
        texture.depth = depth;
        texture.format = format;
        texture.type = textureType;
        texture.generateMipMaps = generateMipMaps;
        texture.samplingMode = samplingMode;
        if (is3D) {
            texture.is3D = true;
        }
        else {
            texture.is2DArray = true;
        }
        if (!this._doNotHandleContextLost) {
            texture._bufferView = data;
        }
        if (is3D) {
            this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);
        }
        else {
            this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);
        }
        this._bindTextureDirectly(target, texture, true);
        // Filters
        const filters = this._getSamplingParameters(samplingMode, generateMipMaps);
        this._gl.texParameteri(target, this._gl.TEXTURE_MAG_FILTER, filters.mag);
        this._gl.texParameteri(target, this._gl.TEXTURE_MIN_FILTER, filters.min);
        if (generateMipMaps) {
            this._gl.generateMipmap(target);
        }
        this._bindTextureDirectly(target, null);
        this._internalTexturesCache.push(texture);
        return texture;
    };
}
_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.createRawTexture2DArray = _makeCreateRawTextureFunction(false);
_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.createRawTexture3D = _makeCreateRawTextureFunction(true);
/**
 * Create a function for updateRawTexture3D/updateRawTexture2DArray
 * @param is3D true for TEXTURE_3D and false for TEXTURE_2D_ARRAY
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function _makeUpdateRawTextureFunction(is3D) {
    return function (texture, data, format, invertY, compression = null, textureType = 0) {
        const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY;
        const internalType = this._getWebGLTextureType(textureType);
        const internalFormat = this._getInternalFormat(format);
        const internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);
        this._bindTextureDirectly(target, texture, true);
        this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);
        if (!this._doNotHandleContextLost) {
            texture._bufferView = data;
            texture.format = format;
            texture.invertY = invertY;
            texture._compression = compression;
        }
        if (texture.width % 4 !== 0) {
            this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1);
        }
        if (compression && data) {
            this._gl.compressedTexImage3D(target, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data);
        }
        else {
            this._gl.texImage3D(target, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data);
        }
        if (texture.generateMipMaps) {
            this._gl.generateMipmap(target);
        }
        this._bindTextureDirectly(target, null);
        // this.resetTextureCache();
        texture.isReady = true;
    };
}
_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.updateRawTexture2DArray = _makeUpdateRawTextureFunction(false);
_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.updateRawTexture3D = _makeUpdateRawTextureFunction(true);
//# sourceMappingURL=engine.rawTexture.js.map

/***/ }),

/***/ 52212:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   k: () => (/* reexport safe */ _Engines_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_1__.kZ)
/* harmony export */ });
/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86514);
/* harmony import */ var _Engines_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16741);

// back-compat


_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype._readTexturePixelsSync = function (texture, width, height, faceIndex = -1, level = 0, buffer = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) {
    const gl = this._gl;
    if (!gl) {
        throw new Error("Engine does not have gl rendering context.");
    }
    if (!this._dummyFramebuffer) {
        const dummy = gl.createFramebuffer();
        if (!dummy) {
            throw new Error("Unable to create dummy framebuffer");
        }
        this._dummyFramebuffer = dummy;
    }
    gl.bindFramebuffer(gl.FRAMEBUFFER, this._dummyFramebuffer);
    if (faceIndex > -1) {
        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, texture._hardwareTexture?.underlyingResource, level);
    }
    else {
        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture._hardwareTexture?.underlyingResource, level);
    }
    let readType = texture.type !== undefined ? this._getWebGLTextureType(texture.type) : gl.UNSIGNED_BYTE;
    if (!noDataConversion) {
        switch (readType) {
            case gl.UNSIGNED_BYTE:
                if (!buffer) {
                    buffer = new Uint8Array(4 * width * height);
                }
                readType = gl.UNSIGNED_BYTE;
                break;
            default:
                if (!buffer) {
                    buffer = new Float32Array(4 * width * height);
                }
                readType = gl.FLOAT;
                break;
        }
    }
    else if (!buffer) {
        buffer = (0,_Engines_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_1__/* .allocateAndCopyTypedBuffer */ .kZ)(texture.type, 4 * width * height);
    }
    if (flushRenderer) {
        this.flushFramebuffer();
    }
    gl.readPixels(x, y, width, height, gl.RGBA, readType, buffer);
    gl.bindFramebuffer(gl.FRAMEBUFFER, this._currentFramebuffer);
    return buffer;
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype._readTexturePixels = function (texture, width, height, faceIndex = -1, level = 0, buffer = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) {
    return Promise.resolve(this._readTexturePixelsSync(texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion, x, y));
};
//# sourceMappingURL=engine.readTexture.js.map

/***/ }),

/***/ 44176:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {


// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js
var Textures_internalTexture = __webpack_require__(81194);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__(51137);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/thinEngine.js + 1 modules
var thinEngine = __webpack_require__(86514);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/renderTargetWrapper.js
var renderTargetWrapper = __webpack_require__(61760);
;// ./node_modules/@babylonjs/core/Engines/WebGL/webGLRenderTargetWrapper.js



/** @internal */
class WebGLRenderTargetWrapper extends renderTargetWrapper/* RenderTargetWrapper */.v {
    setDepthStencilTexture(texture, disposeExisting = true) {
        super.setDepthStencilTexture(texture, disposeExisting);
        if (!texture) {
            return;
        }
        const engine = this._engine;
        const gl = this._context;
        const hardwareTexture = texture._hardwareTexture;
        if (hardwareTexture && texture._autoMSAAManagement && this._MSAAFramebuffer) {
            const currentFB = engine._currentFramebuffer;
            engine._bindUnboundFramebuffer(this._MSAAFramebuffer);
            gl.framebufferRenderbuffer(gl.FRAMEBUFFER, (0,Textures_internalTexture/* HasStencilAspect */.$l)(texture.format) ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, hardwareTexture.getMSAARenderBuffer());
            engine._bindUnboundFramebuffer(currentFB);
        }
    }
    constructor(isMulti, isCube, size, engine, context) {
        super(isMulti, isCube, size, engine);
        /**
         * @internal
         */
        this._framebuffer = null;
        /**
         * @internal
         */
        this._depthStencilBuffer = null;
        // eslint-disable-next-line @typescript-eslint/naming-convention
        /**
         * @internal
         */
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this._MSAAFramebuffer = null;
        // Multiview
        /**
         * @internal
         */
        this._colorTextureArray = null;
        /**
         * @internal
         */
        this._depthStencilTextureArray = null;
        /**
         * @internal
         */
        this._disposeOnlyFramebuffers = false;
        /**
         * @internal
         */
        this._currentLOD = 0;
        this._context = context;
    }
    _cloneRenderTargetWrapper() {
        let rtw = null;
        if (this._colorTextureArray && this._depthStencilTextureArray) {
            rtw = this._engine.createMultiviewRenderTargetTexture(this.width, this.height);
            rtw.texture.isReady = true;
        }
        else {
            rtw = super._cloneRenderTargetWrapper();
        }
        return rtw;
    }
    _swapRenderTargetWrapper(target) {
        super._swapRenderTargetWrapper(target);
        target._framebuffer = this._framebuffer;
        target._depthStencilBuffer = this._depthStencilBuffer;
        target._MSAAFramebuffer = this._MSAAFramebuffer;
        target._colorTextureArray = this._colorTextureArray;
        target._depthStencilTextureArray = this._depthStencilTextureArray;
        this._framebuffer = this._depthStencilBuffer = this._MSAAFramebuffer = this._colorTextureArray = this._depthStencilTextureArray = null;
    }
    /**
     * Creates the depth/stencil texture
     * @param comparisonFunction Comparison function to use for the texture
     * @param bilinearFiltering true if bilinear filtering should be used when sampling the texture
     * @param generateStencil true if the stencil aspect should also be created
     * @param samples sample count to use when creating the texture
     * @param format format of the depth texture
     * @param label defines the label to use for the texture (for debugging purpose only)
     * @returns the depth/stencil created texture
     */
    createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = true, generateStencil = false, samples = 1, format = 14, label) {
        if (this._depthStencilBuffer) {
            const engine = this._engine;
            // Dispose previous depth/stencil render buffers and clear the corresponding attachment.
            // Next time this framebuffer is bound, the new depth/stencil texture will be attached.
            const currentFrameBuffer = engine._currentFramebuffer;
            const gl = this._context;
            engine._bindUnboundFramebuffer(this._framebuffer);
            gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, null);
            gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null);
            gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, null);
            engine._bindUnboundFramebuffer(currentFrameBuffer);
            gl.deleteRenderbuffer(this._depthStencilBuffer);
            this._depthStencilBuffer = null;
        }
        return super.createDepthStencilTexture(comparisonFunction, bilinearFiltering, generateStencil, samples, format, label);
    }
    /**
     * Shares the depth buffer of this render target with another render target.
     * @param renderTarget Destination renderTarget
     */
    shareDepth(renderTarget) {
        super.shareDepth(renderTarget);
        const gl = this._context;
        const depthbuffer = this._depthStencilBuffer;
        const framebuffer = renderTarget._MSAAFramebuffer || renderTarget._framebuffer;
        const engine = this._engine;
        if (renderTarget._depthStencilBuffer && renderTarget._depthStencilBuffer !== depthbuffer) {
            gl.deleteRenderbuffer(renderTarget._depthStencilBuffer);
        }
        renderTarget._depthStencilBuffer = depthbuffer;
        const attachment = renderTarget._generateStencilBuffer ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
        engine._bindUnboundFramebuffer(framebuffer);
        gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, depthbuffer);
        engine._bindUnboundFramebuffer(null);
    }
    /**
     * Binds a texture to this render target on a specific attachment
     * @param texture The texture to bind to the framebuffer
     * @param attachmentIndex Index of the attachment
     * @param faceIndexOrLayer The face or layer of the texture to render to in case of cube texture or array texture
     * @param lodLevel defines the lod level to bind to the frame buffer
     */
    _bindTextureRenderTarget(texture, attachmentIndex = 0, faceIndexOrLayer, lodLevel = 0) {
        const hardwareTexture = texture._hardwareTexture;
        if (!hardwareTexture) {
            return;
        }
        const framebuffer = this._framebuffer;
        const engine = this._engine;
        const currentFB = engine._currentFramebuffer;
        engine._bindUnboundFramebuffer(framebuffer);
        let attachment;
        if (engine.webGLVersion > 1) {
            const gl = this._context;
            attachment = gl["COLOR_ATTACHMENT" + attachmentIndex];
            if (texture.is2DArray || texture.is3D) {
                faceIndexOrLayer = faceIndexOrLayer ?? this.layerIndices?.[attachmentIndex] ?? 0;
                gl.framebufferTextureLayer(gl.FRAMEBUFFER, attachment, hardwareTexture.underlyingResource, lodLevel, faceIndexOrLayer);
            }
            else if (texture.isCube) {
                // if face index is not specified, try to query it from faceIndices
                // default is face 0
                faceIndexOrLayer = faceIndexOrLayer ?? this.faceIndices?.[attachmentIndex] ?? 0;
                gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndexOrLayer, hardwareTexture.underlyingResource, lodLevel);
            }
            else {
                gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, hardwareTexture.underlyingResource, lodLevel);
            }
        }
        else {
            // Default behavior (WebGL)
            const gl = this._context;
            attachment = gl["COLOR_ATTACHMENT" + attachmentIndex + "_WEBGL"];
            const target = faceIndexOrLayer !== undefined ? gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndexOrLayer : gl.TEXTURE_2D;
            gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, target, hardwareTexture.underlyingResource, lodLevel);
        }
        if (texture._autoMSAAManagement && this._MSAAFramebuffer) {
            const gl = this._context;
            engine._bindUnboundFramebuffer(this._MSAAFramebuffer);
            gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, hardwareTexture.getMSAARenderBuffer());
        }
        engine._bindUnboundFramebuffer(currentFB);
    }
    /**
     * Set a texture in the textures array
     * @param texture the texture to set
     * @param index the index in the textures array to set
     * @param disposePrevious If this function should dispose the previous texture
     */
    setTexture(texture, index = 0, disposePrevious = true) {
        super.setTexture(texture, index, disposePrevious);
        this._bindTextureRenderTarget(texture, index);
    }
    /**
     * Sets the layer and face indices of every render target texture
     * @param layers The layer of the texture to be set (make negative to not modify)
     * @param faces The face of the texture to be set (make negative to not modify)
     */
    setLayerAndFaceIndices(layers, faces) {
        super.setLayerAndFaceIndices(layers, faces);
        if (!this.textures || !this.layerIndices || !this.faceIndices) {
            return;
        }
        // the length of this._attachments is the right one as it does not count the depth texture, in case we generated it
        const textureCount = this._attachments?.length ?? this.textures.length;
        for (let index = 0; index < textureCount; index++) {
            const texture = this.textures[index];
            if (!texture) {
                // The target type was probably -1 at creation time and setTexture has not been called yet for this index
                continue;
            }
            if (texture.is2DArray || texture.is3D) {
                this._bindTextureRenderTarget(texture, index, this.layerIndices[index]);
            }
            else if (texture.isCube) {
                this._bindTextureRenderTarget(texture, index, this.faceIndices[index]);
            }
            else {
                this._bindTextureRenderTarget(texture, index);
            }
        }
    }
    /**
     * Set the face and layer indices of a texture in the textures array
     * @param index The index of the texture in the textures array to modify
     * @param layer The layer of the texture to be set
     * @param face The face of the texture to be set
     */
    setLayerAndFaceIndex(index = 0, layer, face) {
        super.setLayerAndFaceIndex(index, layer, face);
        if (!this.textures || !this.layerIndices || !this.faceIndices) {
            return;
        }
        const texture = this.textures[index];
        if (texture.is2DArray || texture.is3D) {
            this._bindTextureRenderTarget(this.textures[index], index, this.layerIndices[index]);
        }
        else if (texture.isCube) {
            this._bindTextureRenderTarget(this.textures[index], index, this.faceIndices[index]);
        }
    }
    resolveMSAATextures() {
        const engine = this._engine;
        const currentFramebuffer = engine._currentFramebuffer;
        engine._bindUnboundFramebuffer(this._MSAAFramebuffer);
        super.resolveMSAATextures();
        engine._bindUnboundFramebuffer(currentFramebuffer);
    }
    dispose(disposeOnlyFramebuffers = this._disposeOnlyFramebuffers) {
        const gl = this._context;
        if (!disposeOnlyFramebuffers) {
            if (this._colorTextureArray) {
                this._context.deleteTexture(this._colorTextureArray);
                this._colorTextureArray = null;
            }
            if (this._depthStencilTextureArray) {
                this._context.deleteTexture(this._depthStencilTextureArray);
                this._depthStencilTextureArray = null;
            }
        }
        if (this._framebuffer) {
            gl.deleteFramebuffer(this._framebuffer);
            this._framebuffer = null;
        }
        if (this._depthStencilBuffer) {
            gl.deleteRenderbuffer(this._depthStencilBuffer);
            this._depthStencilBuffer = null;
        }
        if (this._MSAAFramebuffer) {
            gl.deleteFramebuffer(this._MSAAFramebuffer);
            this._MSAAFramebuffer = null;
        }
        super.dispose(disposeOnlyFramebuffers);
    }
}
//# sourceMappingURL=webGLRenderTargetWrapper.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.texture.js
var abstractEngine_texture = __webpack_require__(9696);
;// ./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js






thinEngine.ThinEngine.prototype._createHardwareRenderTargetWrapper = function (isMulti, isCube, size) {
    const rtWrapper = new WebGLRenderTargetWrapper(isMulti, isCube, size, this, this._gl);
    this._renderTargetWrapperCache.push(rtWrapper);
    return rtWrapper;
};
thinEngine.ThinEngine.prototype.createRenderTargetTexture = function (size, options) {
    const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size);
    let generateDepthBuffer = true;
    let generateStencilBuffer = false;
    let noColorAttachment = false;
    let colorAttachment = undefined;
    let samples = 1;
    let label = undefined;
    if (options !== undefined && typeof options === "object") {
        generateDepthBuffer = options.generateDepthBuffer ?? true;
        generateStencilBuffer = !!options.generateStencilBuffer;
        noColorAttachment = !!options.noColorAttachment;
        colorAttachment = options.colorAttachment;
        samples = options.samples ?? 1;
        label = options.label;
    }
    const texture = colorAttachment || (noColorAttachment ? null : this._createInternalTexture(size, options, true, 5 /* InternalTextureSource.RenderTarget */));
    const width = size.width || size;
    const height = size.height || size;
    const currentFrameBuffer = this._currentFramebuffer;
    const gl = this._gl;
    // Create the framebuffer
    const framebuffer = gl.createFramebuffer();
    this._bindUnboundFramebuffer(framebuffer);
    rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(generateStencilBuffer, generateDepthBuffer, width, height);
    // No need to rebind on every frame
    if (texture && !texture.is2DArray && !texture.is3D) {
        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture._hardwareTexture.underlyingResource, 0);
    }
    this._bindUnboundFramebuffer(currentFrameBuffer);
    rtWrapper.label = label ?? "RenderTargetWrapper";
    rtWrapper._framebuffer = framebuffer;
    rtWrapper._generateDepthBuffer = generateDepthBuffer;
    rtWrapper._generateStencilBuffer = generateStencilBuffer;
    rtWrapper.setTextures(texture);
    if (!colorAttachment) {
        this.updateRenderTargetTextureSampleCount(rtWrapper, samples);
    }
    else {
        rtWrapper._samples = colorAttachment.samples;
        if (colorAttachment.samples > 1) {
            const msaaRenderBuffer = colorAttachment._hardwareTexture.getMSAARenderBuffer(0);
            rtWrapper._MSAAFramebuffer = gl.createFramebuffer();
            this._bindUnboundFramebuffer(rtWrapper._MSAAFramebuffer);
            gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, msaaRenderBuffer);
            this._bindUnboundFramebuffer(null);
        }
    }
    return rtWrapper;
};
thinEngine.ThinEngine.prototype._createDepthStencilTexture = function (size, options, rtWrapper) {
    const gl = this._gl;
    const layers = size.layers || 0;
    const depth = size.depth || 0;
    let target = gl.TEXTURE_2D;
    if (layers !== 0) {
        target = gl.TEXTURE_2D_ARRAY;
    }
    else if (depth !== 0) {
        target = gl.TEXTURE_3D;
    }
    const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(this, 12 /* InternalTextureSource.DepthStencil */);
    internalTexture.label = options.label;
    if (!this._caps.depthTextureExtension) {
        logger/* Logger */.V.Error("Depth texture is not supported by your browser or hardware.");
        return internalTexture;
    }
    const internalOptions = {
        bilinearFiltering: false,
        comparisonFunction: 0,
        generateStencil: false,
        ...options,
    };
    this._bindTextureDirectly(target, internalTexture, true);
    this._setupDepthStencilTexture(internalTexture, size, internalOptions.comparisonFunction === 0 ? false : internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples);
    if (internalOptions.depthTextureFormat !== undefined) {
        if (internalOptions.depthTextureFormat !== 15 &&
            internalOptions.depthTextureFormat !== 16 &&
            internalOptions.depthTextureFormat !== 17 &&
            internalOptions.depthTextureFormat !== 13 &&
            internalOptions.depthTextureFormat !== 14 &&
            internalOptions.depthTextureFormat !== 18) {
            logger/* Logger */.V.Error(`Depth texture ${internalOptions.depthTextureFormat} format is not supported.`);
            return internalTexture;
        }
        internalTexture.format = internalOptions.depthTextureFormat;
    }
    else {
        internalTexture.format = internalOptions.generateStencil ? 13 : 16;
    }
    const hasStencil = internalTexture.format === 17 ||
        internalTexture.format === 13 ||
        internalTexture.format === 18;
    const type = this._getWebGLTextureTypeFromDepthTextureFormat(internalTexture.format);
    const format = hasStencil ? gl.DEPTH_STENCIL : gl.DEPTH_COMPONENT;
    const internalFormat = this._getInternalFormatFromDepthTextureFormat(internalTexture.format, true, hasStencil);
    if (internalTexture.is2DArray) {
        gl.texImage3D(target, 0, internalFormat, internalTexture.width, internalTexture.height, layers, 0, format, type, null);
    }
    else if (internalTexture.is3D) {
        gl.texImage3D(target, 0, internalFormat, internalTexture.width, internalTexture.height, depth, 0, format, type, null);
    }
    else {
        gl.texImage2D(target, 0, internalFormat, internalTexture.width, internalTexture.height, 0, format, type, null);
    }
    this._bindTextureDirectly(target, null);
    this._internalTexturesCache.push(internalTexture);
    if (rtWrapper._depthStencilBuffer) {
        gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer);
        rtWrapper._depthStencilBuffer = null;
    }
    this._bindUnboundFramebuffer(rtWrapper._MSAAFramebuffer ?? rtWrapper._framebuffer);
    rtWrapper._generateStencilBuffer = hasStencil;
    rtWrapper._depthStencilTextureWithStencil = hasStencil;
    rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.width, rtWrapper.height, rtWrapper.samples, internalTexture.format);
    this._bindUnboundFramebuffer(null);
    return internalTexture;
};
thinEngine.ThinEngine.prototype.updateRenderTargetTextureSampleCount = function (rtWrapper, samples) {
    if (this.webGLVersion < 2 || !rtWrapper) {
        return 1;
    }
    if (rtWrapper.samples === samples) {
        return samples;
    }
    const gl = this._gl;
    samples = Math.min(samples, this.getCaps().maxMSAASamples);
    // Dispose previous render buffers
    if (rtWrapper._depthStencilBuffer) {
        gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer);
        rtWrapper._depthStencilBuffer = null;
    }
    if (rtWrapper._MSAAFramebuffer) {
        gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer);
        rtWrapper._MSAAFramebuffer = null;
    }
    const hardwareTexture = rtWrapper.texture?._hardwareTexture;
    hardwareTexture?.releaseMSAARenderBuffers();
    if (rtWrapper.texture && samples > 1 && typeof gl.renderbufferStorageMultisample === "function") {
        const framebuffer = gl.createFramebuffer();
        if (!framebuffer) {
            throw new Error("Unable to create multi sampled framebuffer");
        }
        rtWrapper._MSAAFramebuffer = framebuffer;
        this._bindUnboundFramebuffer(rtWrapper._MSAAFramebuffer);
        const colorRenderbuffer = this._createRenderBuffer(rtWrapper.texture.width, rtWrapper.texture.height, samples, -1 /* not used */, this._getRGBABufferInternalSizedFormat(rtWrapper.texture.type, rtWrapper.texture.format, rtWrapper.texture._useSRGBBuffer), gl.COLOR_ATTACHMENT0, false);
        if (!colorRenderbuffer) {
            throw new Error("Unable to create multi sampled framebuffer");
        }
        hardwareTexture?.addMSAARenderBuffer(colorRenderbuffer);
    }
    this._bindUnboundFramebuffer(rtWrapper._MSAAFramebuffer ?? rtWrapper._framebuffer);
    if (rtWrapper.texture) {
        rtWrapper.texture.samples = samples;
    }
    rtWrapper._samples = samples;
    const depthFormat = rtWrapper._depthStencilTexture ? rtWrapper._depthStencilTexture.format : undefined;
    rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.width, rtWrapper.height, samples, depthFormat);
    this._bindUnboundFramebuffer(null);
    return samples;
};
thinEngine.ThinEngine.prototype._setupDepthStencilTexture = function (internalTexture, size, bilinearFiltering, comparisonFunction, samples = 1) {
    const width = size.width ?? size;
    const height = size.height ?? size;
    const layers = size.layers || 0;
    const depth = size.depth || 0;
    internalTexture.baseWidth = width;
    internalTexture.baseHeight = height;
    internalTexture.width = width;
    internalTexture.height = height;
    internalTexture.is2DArray = layers > 0;
    internalTexture.depth = layers || depth;
    internalTexture.isReady = true;
    internalTexture.samples = samples;
    internalTexture.generateMipMaps = false;
    internalTexture.samplingMode = bilinearFiltering ? 2 : 1;
    internalTexture.type = 0;
    internalTexture._comparisonFunction = comparisonFunction;
    const gl = this._gl;
    const target = this._getTextureTarget(internalTexture);
    const samplingParameters = this._getSamplingParameters(internalTexture.samplingMode, false);
    gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, samplingParameters.mag);
    gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, samplingParameters.min);
    gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    // TEXTURE_COMPARE_FUNC/MODE are only availble in WebGL2.
    if (this.webGLVersion > 1) {
        if (comparisonFunction === 0) {
            gl.texParameteri(target, gl.TEXTURE_COMPARE_FUNC, 515);
            gl.texParameteri(target, gl.TEXTURE_COMPARE_MODE, gl.NONE);
        }
        else {
            gl.texParameteri(target, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);
            gl.texParameteri(target, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
        }
    }
};
//# sourceMappingURL=engine.renderTarget.js.map

/***/ }),

/***/ 79779:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81194);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);
/* harmony import */ var _thinEngine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86514);




_thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine.prototype.createRenderTargetCubeTexture = function (size, options) {
    const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size);
    const fullOptions = {
        generateMipMaps: true,
        generateDepthBuffer: true,
        generateStencilBuffer: false,
        type: 0,
        samplingMode: 3,
        format: 5,
        ...options,
    };
    fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;
    if (fullOptions.type === 1 && !this._caps.textureFloatLinearFiltering) {
        // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
        fullOptions.samplingMode = 1;
    }
    else if (fullOptions.type === 2 && !this._caps.textureHalfFloatLinearFiltering) {
        // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
        fullOptions.samplingMode = 1;
    }
    const gl = this._gl;
    const texture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .hV(this, 5 /* InternalTextureSource.RenderTarget */);
    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);
    const filters = this._getSamplingParameters(fullOptions.samplingMode, fullOptions.generateMipMaps);
    if (fullOptions.type === 1 && !this._caps.textureFloat) {
        fullOptions.type = 0;
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type");
    }
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    for (let face = 0; face < 6; face++) {
        gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, this._getRGBABufferInternalSizedFormat(fullOptions.type, fullOptions.format), size, size, 0, this._getInternalFormat(fullOptions.format), this._getWebGLTextureType(fullOptions.type), null);
    }
    // Create the framebuffer
    const framebuffer = gl.createFramebuffer();
    this._bindUnboundFramebuffer(framebuffer);
    rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(fullOptions.generateStencilBuffer, fullOptions.generateDepthBuffer, size, size);
    // MipMaps
    if (fullOptions.generateMipMaps) {
        gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
    }
    // Unbind
    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
    this._bindUnboundFramebuffer(null);
    rtWrapper._framebuffer = framebuffer;
    rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;
    rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer;
    texture.width = size;
    texture.height = size;
    texture.isReady = true;
    texture.isCube = true;
    texture.samples = 1;
    texture.generateMipMaps = fullOptions.generateMipMaps;
    texture.samplingMode = fullOptions.samplingMode;
    texture.type = fullOptions.type;
    texture.format = fullOptions.format;
    this._internalTexturesCache.push(texture);
    rtWrapper.setTextures(texture);
    return rtWrapper;
};
//# sourceMappingURL=engine.renderTargetCube.js.map

/***/ }),

/***/ 15183:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86514);

_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.setDepthStencilTexture = function (channel, uniform, texture, name) {
    if (channel === undefined) {
        return;
    }
    if (uniform) {
        this._boundUniforms[channel] = uniform;
    }
    if (!texture || !texture.depthStencilTexture) {
        this._setTexture(channel, null, undefined, undefined, name);
    }
    else {
        this._setTexture(channel, texture, false, true, name);
    }
};
//# sourceMappingURL=engine.renderTargetTexture.js.map

/***/ }),

/***/ 36317:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86514);
/* harmony import */ var _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54329);


_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.createUniformBuffer = function (elements, _label) {
    const ubo = this._gl.createBuffer();
    if (!ubo) {
        throw new Error("Unable to create uniform buffer");
    }
    const result = new _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_1__/* .WebGLDataBuffer */ .A(ubo);
    this.bindUniformBuffer(result);
    if (elements instanceof Float32Array) {
        this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.STATIC_DRAW);
    }
    else {
        this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.STATIC_DRAW);
    }
    this.bindUniformBuffer(null);
    result.references = 1;
    return result;
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.createDynamicUniformBuffer = function (elements, _label) {
    const ubo = this._gl.createBuffer();
    if (!ubo) {
        throw new Error("Unable to create dynamic uniform buffer");
    }
    const result = new _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_1__/* .WebGLDataBuffer */ .A(ubo);
    this.bindUniformBuffer(result);
    if (elements instanceof Float32Array) {
        this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.DYNAMIC_DRAW);
    }
    else {
        this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.DYNAMIC_DRAW);
    }
    this.bindUniformBuffer(null);
    result.references = 1;
    return result;
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.updateUniformBuffer = function (uniformBuffer, elements, offset, count) {
    this.bindUniformBuffer(uniformBuffer);
    if (offset === undefined) {
        offset = 0;
    }
    if (count === undefined) {
        if (elements instanceof Float32Array) {
            this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, elements);
        }
        else {
            this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, new Float32Array(elements));
        }
    }
    else {
        if (elements instanceof Float32Array) {
            this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, elements.subarray(offset, offset + count));
        }
        else {
            this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(elements).subarray(offset, offset + count));
        }
    }
    this.bindUniformBuffer(null);
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.bindUniformBuffer = function (buffer) {
    this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, buffer ? buffer.underlyingResource : null);
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.bindUniformBufferBase = function (buffer, location, name) {
    this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, location, buffer ? buffer.underlyingResource : null);
};
_Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.prototype.bindUniformBlock = function (pipelineContext, blockName, index) {
    const program = pipelineContext.program;
    const uniformLocation = this._gl.getUniformBlockIndex(program, blockName);
    if (uniformLocation !== 0xffffffff) {
        this._gl.uniformBlockBinding(program, uniformLocation, index);
    }
};
//# sourceMappingURL=engine.uniformBuffer.js.map

/***/ }),

/***/ 56617:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Y: () => (/* binding */ ShaderCodeInliner)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);
/* harmony import */ var _Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65394);


/**
 * Class used to inline functions in shader code
 */
class ShaderCodeInliner {
    /** Gets the code after the inlining process */
    get code() {
        return this._sourceCode;
    }
    /**
     * Initializes the inliner
     * @param sourceCode shader code source to inline
     * @param numMaxIterations maximum number of iterations (used to detect recursive calls)
     */
    constructor(sourceCode, numMaxIterations = 20) {
        /** Gets or sets the debug mode */
        this.debug = false;
        this._sourceCode = sourceCode;
        this._numMaxIterations = numMaxIterations;
        this._functionDescr = [];
        this.inlineToken = "#define inline";
    }
    /**
     * Start the processing of the shader code
     */
    processCode() {
        if (this.debug) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Log(`Start inlining process (code size=${this._sourceCode.length})...`);
        }
        this._collectFunctions();
        this._processInlining(this._numMaxIterations);
        if (this.debug) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Log("End of inlining process.");
        }
    }
    _collectFunctions() {
        let startIndex = 0;
        while (startIndex < this._sourceCode.length) {
            // locate the function to inline and extract its name
            const inlineTokenIndex = this._sourceCode.indexOf(this.inlineToken, startIndex);
            if (inlineTokenIndex < 0) {
                break;
            }
            const funcParamsStartIndex = this._sourceCode.indexOf("(", inlineTokenIndex + this.inlineToken.length);
            if (funcParamsStartIndex < 0) {
                if (this.debug) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Could not find the opening parenthesis after the token. startIndex=${startIndex}`);
                }
                startIndex = inlineTokenIndex + this.inlineToken.length;
                continue;
            }
            const funcNameMatch = ShaderCodeInliner._RegexpFindFunctionNameAndType.exec(this._sourceCode.substring(inlineTokenIndex + this.inlineToken.length, funcParamsStartIndex));
            if (!funcNameMatch) {
                if (this.debug) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Could not extract the name/type of the function from: ${this._sourceCode.substring(inlineTokenIndex + this.inlineToken.length, funcParamsStartIndex)}`);
                }
                startIndex = inlineTokenIndex + this.inlineToken.length;
                continue;
            }
            const [funcType, funcName] = [funcNameMatch[3], funcNameMatch[4]];
            // extract the parameters of the function as a whole string (without the leading / trailing parenthesis)
            const funcParamsEndIndex = (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .ExtractBetweenMarkers */ .VW)("(", ")", this._sourceCode, funcParamsStartIndex);
            if (funcParamsEndIndex < 0) {
                if (this.debug) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Could not extract the parameters the function '${funcName}' (type=${funcType}). funcParamsStartIndex=${funcParamsStartIndex}`);
                }
                startIndex = inlineTokenIndex + this.inlineToken.length;
                continue;
            }
            const funcParams = this._sourceCode.substring(funcParamsStartIndex + 1, funcParamsEndIndex);
            // extract the body of the function (with the curly brackets)
            const funcBodyStartIndex = (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .SkipWhitespaces */ .sz)(this._sourceCode, funcParamsEndIndex + 1);
            if (funcBodyStartIndex === this._sourceCode.length) {
                if (this.debug) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Could not extract the body of the function '${funcName}' (type=${funcType}). funcParamsEndIndex=${funcParamsEndIndex}`);
                }
                startIndex = inlineTokenIndex + this.inlineToken.length;
                continue;
            }
            const funcBodyEndIndex = (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .ExtractBetweenMarkers */ .VW)("{", "}", this._sourceCode, funcBodyStartIndex);
            if (funcBodyEndIndex < 0) {
                if (this.debug) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Could not extract the body of the function '${funcName}' (type=${funcType}). funcBodyStartIndex=${funcBodyStartIndex}`);
                }
                startIndex = inlineTokenIndex + this.inlineToken.length;
                continue;
            }
            const funcBody = this._sourceCode.substring(funcBodyStartIndex, funcBodyEndIndex + 1);
            // process the parameters: extract each names
            const params = (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .RemoveComments */ .RJ)(funcParams).split(",");
            const paramNames = [];
            for (let p = 0; p < params.length; ++p) {
                const param = params[p].trim();
                const idx = param.lastIndexOf(" ");
                if (idx >= 0) {
                    paramNames.push(param.substring(idx + 1));
                }
            }
            if (funcType !== "void") {
                // for functions that return a value, we will replace "return" by "tempvarname = ", tempvarname being a unique generated name
                paramNames.push("return");
            }
            // collect the function
            this._functionDescr.push({
                name: funcName,
                type: funcType,
                parameters: paramNames,
                body: funcBody,
                callIndex: 0,
            });
            startIndex = funcBodyEndIndex + 1;
            // remove the function from the source code
            const partBefore = inlineTokenIndex > 0 ? this._sourceCode.substring(0, inlineTokenIndex) : "";
            const partAfter = funcBodyEndIndex + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(funcBodyEndIndex + 1) : "";
            this._sourceCode = partBefore + partAfter;
            startIndex -= funcBodyEndIndex + 1 - inlineTokenIndex;
        }
        if (this.debug) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Log(`Collect functions: ${this._functionDescr.length} functions found. functionDescr=${this._functionDescr}`);
        }
    }
    _processInlining(numMaxIterations = 20) {
        while (numMaxIterations-- >= 0) {
            if (!this._replaceFunctionCallsByCode()) {
                break;
            }
        }
        if (this.debug) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Log(`numMaxIterations is ${numMaxIterations} after inlining process`);
        }
        return numMaxIterations >= 0;
    }
    _replaceFunctionCallsByCode() {
        let doAgain = false;
        for (const func of this._functionDescr) {
            const { name, type, parameters, body } = func;
            let startIndex = 0;
            while (startIndex < this._sourceCode.length) {
                // Look for the function name in the source code
                const functionCallIndex = this._sourceCode.indexOf(name, startIndex);
                if (functionCallIndex < 0) {
                    break;
                }
                // Make sure "name" is not part of a bigger string
                if (functionCallIndex === 0 || (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .IsIdentifierChar */ ._Z)(this._sourceCode.charAt(functionCallIndex - 1))) {
                    startIndex = functionCallIndex + name.length;
                    continue;
                }
                // Find the opening parenthesis
                const callParamsStartIndex = (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .SkipWhitespaces */ .sz)(this._sourceCode, functionCallIndex + name.length);
                if (callParamsStartIndex === this._sourceCode.length || this._sourceCode.charAt(callParamsStartIndex) !== "(") {
                    startIndex = functionCallIndex + name.length;
                    continue;
                }
                // extract the parameters of the function call as a whole string (without the leading / trailing parenthesis)
                const callParamsEndIndex = (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .ExtractBetweenMarkers */ .VW)("(", ")", this._sourceCode, callParamsStartIndex);
                if (callParamsEndIndex < 0) {
                    if (this.debug) {
                        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Could not extract the parameters of the function call. Function '${name}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}`);
                    }
                    startIndex = functionCallIndex + name.length;
                    continue;
                }
                const callParams = this._sourceCode.substring(callParamsStartIndex + 1, callParamsEndIndex);
                // process the parameter call: extract each names
                // this function split the parameter list used in the function call at ',' boundaries by taking care of potential parenthesis like in:
                //      myfunc(a, vec2(1., 0.), 4.)
                const splitParameterCall = (s) => {
                    const parameters = [];
                    let curIdx = 0, startParamIdx = 0;
                    while (curIdx < s.length) {
                        if (s.charAt(curIdx) === "(") {
                            const idx2 = (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .ExtractBetweenMarkers */ .VW)("(", ")", s, curIdx);
                            if (idx2 < 0) {
                                return null;
                            }
                            curIdx = idx2;
                        }
                        else if (s.charAt(curIdx) === ",") {
                            parameters.push(s.substring(startParamIdx, curIdx));
                            startParamIdx = curIdx + 1;
                        }
                        curIdx++;
                    }
                    if (startParamIdx < curIdx) {
                        parameters.push(s.substring(startParamIdx, curIdx));
                    }
                    return parameters;
                };
                const params = splitParameterCall((0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .RemoveComments */ .RJ)(callParams));
                if (params === null) {
                    if (this.debug) {
                        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Invalid function call: can't extract the parameters of the function call. Function '${name}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}, callParams=` +
                            callParams);
                    }
                    startIndex = functionCallIndex + name.length;
                    continue;
                }
                const paramNames = [];
                for (let p = 0; p < params.length; ++p) {
                    const param = params[p].trim();
                    paramNames.push(param);
                }
                const retParamName = type !== "void" ? name + "_" + func.callIndex++ : null;
                if (retParamName) {
                    paramNames.push(retParamName + " =");
                }
                if (paramNames.length !== parameters.length) {
                    if (this.debug) {
                        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '${name}' (type=${type}). function parameters=${parameters}, call parameters=${paramNames}`);
                    }
                    startIndex = functionCallIndex + name.length;
                    continue;
                }
                startIndex = callParamsEndIndex + 1;
                // replace the function call by the body function
                const funcBody = this._replaceNames(body, parameters, paramNames);
                let partBefore = functionCallIndex > 0 ? this._sourceCode.substring(0, functionCallIndex) : "";
                const partAfter = callParamsEndIndex + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(callParamsEndIndex + 1) : "";
                if (retParamName) {
                    // case where the function returns a value. We generate:
                    // FUNCTYPE retParamName;
                    // {function body}
                    // and replace the function call by retParamName
                    const injectDeclarationIndex = (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .FindBackward */ .rU)(this._sourceCode, functionCallIndex - 1, "\n", "{");
                    partBefore = this._sourceCode.substring(0, injectDeclarationIndex + 1);
                    const partBetween = this._sourceCode.substring(injectDeclarationIndex + 1, functionCallIndex);
                    this._sourceCode = partBefore + type + " " + retParamName + ";\n" + funcBody + "\n" + partBetween + retParamName + partAfter;
                    if (this.debug) {
                        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Log(`Replace function call by code. Function '${name}' (type=${type}). injectDeclarationIndex=${injectDeclarationIndex}, call parameters=${paramNames}`);
                    }
                }
                else {
                    // simple case where the return value of the function is "void"
                    this._sourceCode = partBefore + funcBody + partAfter;
                    startIndex += funcBody.length - (callParamsEndIndex + 1 - functionCallIndex);
                    if (this.debug) {
                        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Log(`Replace function call by code. Function '${name}' (type=${type}). functionCallIndex=${functionCallIndex}, call parameters=${paramNames}`);
                    }
                }
                doAgain = true;
            }
        }
        return doAgain;
    }
    _replaceNames(code, sources, destinations) {
        for (let i = 0; i < sources.length; ++i) {
            const source = new RegExp((0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .EscapeRegExp */ .V3)(sources[i]), "g"), sourceLen = sources[i].length, destination = destinations[i];
            code = code.replace(source, (match, ...args) => {
                const offset = args[0];
                // Make sure "source" is not part of a bigger identifier (for eg, if source=view and we matched it with viewDirection)
                if ((0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .IsIdentifierChar */ ._Z)(code.charAt(offset - 1)) || (0,_Misc_codeStringParsingTools_js__WEBPACK_IMPORTED_MODULE_1__/* .IsIdentifierChar */ ._Z)(code.charAt(offset + sourceLen))) {
                    return sources[i];
                }
                return destination;
            });
        }
        return code;
    }
}
ShaderCodeInliner._RegexpFindFunctionNameAndType = /((\s+?)(\w+)\s+(\w+)\s*?)$/;
//# sourceMappingURL=shaderCodeInliner.js.map

/***/ }),

/***/ 19125:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  nO: () => (/* binding */ Finalize),
  pB: () => (/* binding */ Initialize),
  jC: () => (/* binding */ PreProcess),
  M0: () => (/* binding */ Process),
  Iq: () => (/* binding */ _ProcessIncludes),
  J: () => (/* binding */ _functionContainer)
});

;// ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeNode.js
const defaultAttributeKeywordName = "attribute";
const defaultVaryingKeywordName = "varying";
/** @internal */
class ShaderCodeNode {
    constructor() {
        this.children = [];
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    isValid(preprocessors) {
        return true;
    }
    process(preprocessors, options) {
        let result = "";
        if (this.line) {
            let value = this.line;
            const processor = options.processor;
            if (processor) {
                // This must be done before other replacements to avoid mistakenly changing something that was already changed.
                if (processor.lineProcessor) {
                    value = processor.lineProcessor(value, options.isFragment, options.processingContext);
                }
                const attributeKeyword = options.processor?.attributeKeywordName ?? defaultAttributeKeywordName;
                const varyingKeyword = options.isFragment && options.processor?.varyingFragmentKeywordName
                    ? options.processor?.varyingFragmentKeywordName
                    : !options.isFragment && options.processor?.varyingVertexKeywordName
                        ? options.processor?.varyingVertexKeywordName
                        : defaultVaryingKeywordName;
                if (!options.isFragment && processor.attributeProcessor && this.line.startsWith(attributeKeyword)) {
                    value = processor.attributeProcessor(this.line, preprocessors, options.processingContext);
                }
                else if (processor.varyingProcessor &&
                    (processor.varyingCheck?.(this.line, options.isFragment) || (!processor.varyingCheck && this.line.startsWith(varyingKeyword)))) {
                    value = processor.varyingProcessor(this.line, options.isFragment, preprocessors, options.processingContext);
                }
                else if (processor.uniformProcessor && processor.uniformRegexp && processor.uniformRegexp.test(this.line)) {
                    if (!options.lookForClosingBracketForUniformBuffer) {
                        value = processor.uniformProcessor(this.line, options.isFragment, preprocessors, options.processingContext);
                    }
                }
                else if (processor.uniformBufferProcessor && processor.uniformBufferRegexp && processor.uniformBufferRegexp.test(this.line)) {
                    if (!options.lookForClosingBracketForUniformBuffer) {
                        value = processor.uniformBufferProcessor(this.line, options.isFragment, options.processingContext);
                        options.lookForClosingBracketForUniformBuffer = true;
                    }
                }
                else if (processor.textureProcessor && processor.textureRegexp && processor.textureRegexp.test(this.line)) {
                    value = processor.textureProcessor(this.line, options.isFragment, preprocessors, options.processingContext);
                }
                else if ((processor.uniformProcessor || processor.uniformBufferProcessor) && this.line.startsWith("uniform") && !options.lookForClosingBracketForUniformBuffer) {
                    const regex = /uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/;
                    if (regex.test(this.line)) {
                        // uniform
                        if (processor.uniformProcessor) {
                            value = processor.uniformProcessor(this.line, options.isFragment, preprocessors, options.processingContext);
                        }
                    }
                    else {
                        // Uniform buffer
                        if (processor.uniformBufferProcessor) {
                            value = processor.uniformBufferProcessor(this.line, options.isFragment, options.processingContext);
                            options.lookForClosingBracketForUniformBuffer = true;
                        }
                    }
                }
                if (options.lookForClosingBracketForUniformBuffer && this.line.indexOf("}") !== -1) {
                    options.lookForClosingBracketForUniformBuffer = false;
                    if (processor.endOfUniformBufferProcessor) {
                        value = processor.endOfUniformBufferProcessor(this.line, options.isFragment, options.processingContext);
                    }
                }
            }
            result += value + "\n";
        }
        this.children.forEach((child) => {
            result += child.process(preprocessors, options);
        });
        if (this.additionalDefineKey) {
            preprocessors[this.additionalDefineKey] = this.additionalDefineValue || "true";
        }
        return result;
    }
}
//# sourceMappingURL=shaderCodeNode.js.map
;// ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeCursor.js
/** @internal */
class ShaderCodeCursor {
    constructor() {
        this._lines = [];
    }
    get currentLine() {
        return this._lines[this.lineIndex];
    }
    get canRead() {
        return this.lineIndex < this._lines.length - 1;
    }
    set lines(value) {
        this._lines.length = 0;
        for (const line of value) {
            // Skip empty lines
            if (!line || line === "\r") {
                continue;
            }
            // Prevent removing line break in macros.
            if (line[0] === "#") {
                this._lines.push(line);
                continue;
            }
            // Do not split single line comments
            const trimmedLine = line.trim();
            if (!trimmedLine) {
                continue;
            }
            if (trimmedLine.startsWith("//")) {
                this._lines.push(line);
                continue;
            }
            // Work with semicolon in the line
            const semicolonIndex = trimmedLine.indexOf(";");
            if (semicolonIndex === -1) {
                // No semicolon in the line
                this._lines.push(trimmedLine);
            }
            else if (semicolonIndex === trimmedLine.length - 1) {
                // Single semicolon at the end of the line
                // If trimmedLine == ";", we must not push, to be backward compatible with the old code!
                if (trimmedLine.length > 1) {
                    this._lines.push(trimmedLine);
                }
            }
            else {
                // Semicolon in the middle of the line
                const split = line.split(";");
                for (let index = 0; index < split.length; index++) {
                    let subLine = split[index];
                    if (!subLine) {
                        continue;
                    }
                    subLine = subLine.trim();
                    if (!subLine) {
                        continue;
                    }
                    this._lines.push(subLine + (index !== split.length - 1 ? ";" : ""));
                }
            }
        }
    }
}
//# sourceMappingURL=shaderCodeCursor.js.map
;// ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeConditionNode.js

/** @internal */
class ShaderCodeConditionNode extends ShaderCodeNode {
    process(preprocessors, options) {
        for (let index = 0; index < this.children.length; index++) {
            const node = this.children[index];
            if (node.isValid(preprocessors)) {
                return node.process(preprocessors, options);
            }
        }
        return "";
    }
}
//# sourceMappingURL=shaderCodeConditionNode.js.map
;// ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeTestNode.js

/** @internal */
class ShaderCodeTestNode extends ShaderCodeNode {
    isValid(preprocessors) {
        return this.testExpression.isTrue(preprocessors);
    }
}
//# sourceMappingURL=shaderCodeTestNode.js.map
;// ./node_modules/@babylonjs/core/Engines/Processors/Expressions/shaderDefineExpression.js
/* eslint-disable @typescript-eslint/naming-convention */
/** @internal */
class ShaderDefineExpression {
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    isTrue(preprocessors) {
        return true;
    }
    static postfixToInfix(postfix) {
        const stack = [];
        for (const c of postfix) {
            if (ShaderDefineExpression._OperatorPriority[c] === undefined) {
                stack.push(c);
            }
            else {
                const v1 = stack[stack.length - 1], v2 = stack[stack.length - 2];
                stack.length -= 2;
                stack.push(`(${v2}${c}${v1})`);
            }
        }
        return stack[stack.length - 1];
    }
    /**
     * Converts an infix expression to a postfix expression.
     *
     * This method is used to transform infix expressions, which are more human-readable,
     * into postfix expressions, also known as Reverse Polish Notation (RPN), that can be
     * evaluated more efficiently by a computer. The conversion is based on the operator
     * priority defined in _OperatorPriority.
     *
     * The function employs a stack-based algorithm for the conversion and caches the result
     * to improve performance. The cache keeps track of each converted expression's access time
     * to manage the cache size and optimize memory usage. When the cache size exceeds a specified
     * limit, the least recently accessed items in the cache are deleted.
     *
     * The cache mechanism is particularly helpful for shader compilation, where the same infix
     * expressions might be encountered repeatedly, hence the caching can speed up the process.
     *
     * @param infix - The infix expression to be converted.
     * @returns The postfix expression as an array of strings.
     */
    static infixToPostfix(infix) {
        // Is infix already in cache
        const cacheItem = ShaderDefineExpression._InfixToPostfixCache.get(infix);
        if (cacheItem) {
            cacheItem.accessTime = Date.now();
            return cacheItem.result;
        }
        // Is infix contain any operator
        if (!infix.includes("&&") && !infix.includes("||") && !infix.includes(")") && !infix.includes("(")) {
            return [infix];
        }
        const result = [];
        let stackIdx = -1;
        const pushOperand = () => {
            operand = operand.trim();
            if (operand !== "") {
                result.push(operand);
                operand = "";
            }
        };
        const push = (s) => {
            if (stackIdx < ShaderDefineExpression._Stack.length - 1) {
                ShaderDefineExpression._Stack[++stackIdx] = s;
            }
        };
        const peek = () => ShaderDefineExpression._Stack[stackIdx];
        const pop = () => (stackIdx === -1 ? "!!INVALID EXPRESSION!!" : ShaderDefineExpression._Stack[stackIdx--]);
        let idx = 0, operand = "";
        while (idx < infix.length) {
            const c = infix.charAt(idx), token = idx < infix.length - 1 ? infix.substring(idx, 2 + idx) : "";
            if (c === "(") {
                operand = "";
                push(c);
            }
            else if (c === ")") {
                pushOperand();
                while (stackIdx !== -1 && peek() !== "(") {
                    result.push(pop());
                }
                pop();
            }
            else if (ShaderDefineExpression._OperatorPriority[token] > 1) {
                pushOperand();
                while (stackIdx !== -1 && ShaderDefineExpression._OperatorPriority[peek()] >= ShaderDefineExpression._OperatorPriority[token]) {
                    result.push(pop());
                }
                push(token);
                idx++;
            }
            else {
                operand += c;
            }
            idx++;
        }
        pushOperand();
        while (stackIdx !== -1) {
            if (peek() === "(") {
                pop();
            }
            else {
                result.push(pop());
            }
        }
        // If the cache is at capacity, clear it before adding a new item
        if (ShaderDefineExpression._InfixToPostfixCache.size >= ShaderDefineExpression.InfixToPostfixCacheLimitSize) {
            ShaderDefineExpression.ClearCache();
        }
        // Add the new item to the cache, including the current time as the last access time
        ShaderDefineExpression._InfixToPostfixCache.set(infix, { result, accessTime: Date.now() });
        return result;
    }
    static ClearCache() {
        // Convert the cache to an array and sort by last access time
        const sortedCache = Array.from(ShaderDefineExpression._InfixToPostfixCache.entries()).sort((a, b) => a[1].accessTime - b[1].accessTime);
        // Remove the least recently accessed half of the cache
        for (let i = 0; i < ShaderDefineExpression.InfixToPostfixCacheCleanupSize; i++) {
            ShaderDefineExpression._InfixToPostfixCache.delete(sortedCache[i][0]);
        }
    }
}
/**
 * Cache items count limit for the InfixToPostfix cache.
 * It uses to improve the performance of the shader compilation.
 * For details see PR: https://github.com/BabylonJS/Babylon.js/pull/13936
 */
ShaderDefineExpression.InfixToPostfixCacheLimitSize = 50000;
/**
 * When the cache size is exceeded, a cache cleanup will be triggered
 * and the cache will be reduced by the size specified
 * in the InfixToPostfixCacheCleanupSize variable, removing entries
 * that have not been accessed the longest.
 */
ShaderDefineExpression.InfixToPostfixCacheCleanupSize = 25000;
ShaderDefineExpression._InfixToPostfixCache = new Map();
ShaderDefineExpression._OperatorPriority = {
    ")": 0,
    "(": 1,
    "||": 2,
    "&&": 3,
};
ShaderDefineExpression._Stack = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""];
//# sourceMappingURL=shaderDefineExpression.js.map
;// ./node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.js

/** @internal */
class ShaderDefineIsDefinedOperator extends ShaderDefineExpression {
    constructor(define, not = false) {
        super();
        this.define = define;
        this.not = not;
    }
    isTrue(preprocessors) {
        let condition = preprocessors[this.define] !== undefined;
        if (this.not) {
            condition = !condition;
        }
        return condition;
    }
}
//# sourceMappingURL=shaderDefineIsDefinedOperator.js.map
;// ./node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineOrOperator.js

/** @internal */
class ShaderDefineOrOperator extends ShaderDefineExpression {
    isTrue(preprocessors) {
        return this.leftOperand.isTrue(preprocessors) || this.rightOperand.isTrue(preprocessors);
    }
}
//# sourceMappingURL=shaderDefineOrOperator.js.map
;// ./node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineAndOperator.js

/** @internal */
class ShaderDefineAndOperator extends ShaderDefineExpression {
    isTrue(preprocessors) {
        return this.leftOperand.isTrue(preprocessors) && this.rightOperand.isTrue(preprocessors);
    }
}
//# sourceMappingURL=shaderDefineAndOperator.js.map
;// ./node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js

/** @internal */
class ShaderDefineArithmeticOperator extends ShaderDefineExpression {
    constructor(define, operand, testValue) {
        super();
        this.define = define;
        this.operand = operand;
        this.testValue = testValue;
    }
    isTrue(preprocessors) {
        let value = preprocessors[this.define];
        if (value === undefined) {
            value = this.define;
        }
        let condition = false;
        const left = parseInt(value);
        const right = parseInt(this.testValue);
        switch (this.operand) {
            case ">":
                condition = left > right;
                break;
            case "<":
                condition = left < right;
                break;
            case "<=":
                condition = left <= right;
                break;
            case ">=":
                condition = left >= right;
                break;
            case "==":
                condition = left === right;
                break;
            case "!=":
                condition = left !== right;
                break;
        }
        return condition;
    }
}
//# sourceMappingURL=shaderDefineArithmeticOperator.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/devTools.js
var devTools = __webpack_require__(45503);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/abstractEngine.functions.js
var abstractEngine_functions = __webpack_require__(16741);
;// ./node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js
/* eslint-disable @typescript-eslint/no-unused-vars */











const regexSE = /defined\s*?\((.+?)\)/g;
const regexSERevert = /defined\s*?\[(.+?)\]/g;
const regexShaderInclude = /#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g;
const regexShaderDecl = /__decl__/;
const regexLightX = /light\{X\}.(\w*)/g;
const regexX = /\{X\}/g;
const reusableMatches = [];
const _MoveCursorRegex = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;
/** @internal */
function Initialize(options) {
    if (options.processor && options.processor.initializeShaders) {
        options.processor.initializeShaders(options.processingContext);
    }
}
/** @internal */
function Process(sourceCode, options, callback, engine) {
    if (options.processor?.preProcessShaderCode) {
        sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);
    }
    _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {
        if (options.processCodeAfterIncludes) {
            codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? "fragment" : "vertex", codeWithIncludes, options.defines);
        }
        const migratedCode = _ProcessShaderConversion(codeWithIncludes, options, engine);
        callback(migratedCode, codeWithIncludes);
    });
}
/** @internal */
function PreProcess(sourceCode, options, callback, engine) {
    if (options.processor?.preProcessShaderCode) {
        sourceCode = options.processor.preProcessShaderCode(sourceCode, options.isFragment);
    }
    _ProcessIncludes(sourceCode, options, (codeWithIncludes) => {
        if (options.processCodeAfterIncludes) {
            codeWithIncludes = options.processCodeAfterIncludes(options.isFragment ? "fragment" : "vertex", codeWithIncludes, options.defines);
        }
        const migratedCode = _ApplyPreProcessing(codeWithIncludes, options, engine);
        callback(migratedCode, codeWithIncludes);
    });
}
/** @internal */
function Finalize(vertexCode, fragmentCode, options) {
    if (!options.processor || !options.processor.finalizeShaders) {
        return { vertexCode, fragmentCode };
    }
    return options.processor.finalizeShaders(vertexCode, fragmentCode, options.processingContext);
}
function _ProcessPrecision(source, options) {
    if (options.processor?.noPrecision) {
        return source;
    }
    const shouldUseHighPrecisionShader = options.shouldUseHighPrecisionShader;
    if (source.indexOf("precision highp float") === -1) {
        if (!shouldUseHighPrecisionShader) {
            source = "precision mediump float;\n" + source;
        }
        else {
            source = "precision highp float;\n" + source;
        }
    }
    else {
        if (!shouldUseHighPrecisionShader) {
            // Moving highp to mediump
            source = source.replace("precision highp float", "precision mediump float");
        }
    }
    return source;
}
function _ExtractOperation(expression) {
    const regex = /defined\((.+)\)/;
    const match = regex.exec(expression);
    if (match && match.length) {
        return new ShaderDefineIsDefinedOperator(match[1].trim(), expression[0] === "!");
    }
    const operators = ["==", "!=", ">=", "<=", "<", ">"];
    let operator = "";
    let indexOperator = 0;
    for (operator of operators) {
        indexOperator = expression.indexOf(operator);
        if (indexOperator > -1) {
            break;
        }
    }
    if (indexOperator === -1) {
        return new ShaderDefineIsDefinedOperator(expression);
    }
    const define = expression.substring(0, indexOperator).trim();
    const value = expression.substring(indexOperator + operator.length).trim();
    return new ShaderDefineArithmeticOperator(define, operator, value);
}
function _BuildSubExpression(expression) {
    expression = expression.replace(regexSE, "defined[$1]");
    const postfix = ShaderDefineExpression.infixToPostfix(expression);
    const stack = [];
    for (const c of postfix) {
        if (c !== "||" && c !== "&&") {
            stack.push(c);
        }
        else if (stack.length >= 2) {
            let v1 = stack[stack.length - 1], v2 = stack[stack.length - 2];
            stack.length -= 2;
            const operator = c == "&&" ? new ShaderDefineAndOperator() : new ShaderDefineOrOperator();
            if (typeof v1 === "string") {
                v1 = v1.replace(regexSERevert, "defined($1)");
            }
            if (typeof v2 === "string") {
                v2 = v2.replace(regexSERevert, "defined($1)");
            }
            operator.leftOperand = typeof v2 === "string" ? _ExtractOperation(v2) : v2;
            operator.rightOperand = typeof v1 === "string" ? _ExtractOperation(v1) : v1;
            stack.push(operator);
        }
    }
    let result = stack[stack.length - 1];
    if (typeof result === "string") {
        result = result.replace(regexSERevert, "defined($1)");
    }
    // note: stack.length !== 1 if there was an error in the parsing
    return typeof result === "string" ? _ExtractOperation(result) : result;
}
function _BuildExpression(line, start) {
    const node = new ShaderCodeTestNode();
    const command = line.substring(0, start);
    let expression = line.substring(start);
    expression = expression.substring(0, (expression.indexOf("//") + 1 || expression.length + 1) - 1).trim();
    if (command === "#ifdef") {
        node.testExpression = new ShaderDefineIsDefinedOperator(expression);
    }
    else if (command === "#ifndef") {
        node.testExpression = new ShaderDefineIsDefinedOperator(expression, true);
    }
    else {
        node.testExpression = _BuildSubExpression(expression);
    }
    return node;
}
function _MoveCursorWithinIf(cursor, rootNode, ifNode) {
    let line = cursor.currentLine;
    while (_MoveCursor(cursor, ifNode)) {
        line = cursor.currentLine;
        const first5 = line.substring(0, 5).toLowerCase();
        if (first5 === "#else") {
            const elseNode = new ShaderCodeNode();
            rootNode.children.push(elseNode);
            _MoveCursor(cursor, elseNode);
            return;
        }
        else if (first5 === "#elif") {
            const elifNode = _BuildExpression(line, 5);
            rootNode.children.push(elifNode);
            ifNode = elifNode;
        }
    }
}
function _MoveCursor(cursor, rootNode) {
    while (cursor.canRead) {
        cursor.lineIndex++;
        const line = cursor.currentLine;
        if (line.indexOf("#") >= 0) {
            const matches = _MoveCursorRegex.exec(line);
            if (matches && matches.length) {
                const keyword = matches[0];
                switch (keyword) {
                    case "#ifdef": {
                        const newRootNode = new ShaderCodeConditionNode();
                        rootNode.children.push(newRootNode);
                        const ifNode = _BuildExpression(line, 6);
                        newRootNode.children.push(ifNode);
                        _MoveCursorWithinIf(cursor, newRootNode, ifNode);
                        break;
                    }
                    case "#else":
                    case "#elif":
                        return true;
                    case "#endif":
                        return false;
                    case "#ifndef": {
                        const newRootNode = new ShaderCodeConditionNode();
                        rootNode.children.push(newRootNode);
                        const ifNode = _BuildExpression(line, 7);
                        newRootNode.children.push(ifNode);
                        _MoveCursorWithinIf(cursor, newRootNode, ifNode);
                        break;
                    }
                    case "#if": {
                        const newRootNode = new ShaderCodeConditionNode();
                        const ifNode = _BuildExpression(line, 3);
                        rootNode.children.push(newRootNode);
                        newRootNode.children.push(ifNode);
                        _MoveCursorWithinIf(cursor, newRootNode, ifNode);
                        break;
                    }
                }
                continue;
            }
        }
        const newNode = new ShaderCodeNode();
        newNode.line = line;
        rootNode.children.push(newNode);
        // Detect additional defines
        if (line[0] === "#" && line[1] === "d") {
            const split = line.replace(";", "").split(" ");
            newNode.additionalDefineKey = split[1];
            if (split.length === 3) {
                newNode.additionalDefineValue = split[2];
            }
        }
    }
    return false;
}
function _EvaluatePreProcessors(sourceCode, preprocessors, options) {
    const rootNode = new ShaderCodeNode();
    const cursor = new ShaderCodeCursor();
    cursor.lineIndex = -1;
    cursor.lines = sourceCode.split("\n");
    // Decompose (We keep it in 2 steps so it is easier to maintain and perf hit is insignificant)
    _MoveCursor(cursor, rootNode);
    // Recompose
    return rootNode.process(preprocessors, options);
}
function _PreparePreProcessors(options, engine) {
    const defines = options.defines;
    const preprocessors = {};
    for (const define of defines) {
        const keyValue = define.replace("#define", "").replace(";", "").trim();
        const split = keyValue.split(" ");
        preprocessors[split[0]] = split.length > 1 ? split[1] : "";
    }
    if (options.processor?.shaderLanguage === 0 /* ShaderLanguage.GLSL */) {
        preprocessors["GL_ES"] = "true";
    }
    preprocessors["__VERSION__"] = options.version;
    preprocessors[options.platformName] = "true";
    (0,abstractEngine_functions/* _getGlobalDefines */.xt)(preprocessors, engine?.isNDCHalfZRange, engine?.useReverseDepthBuffer, engine?.useExactSrgbConversions);
    return preprocessors;
}
function _ProcessShaderConversion(sourceCode, options, engine) {
    let preparedSourceCode = _ProcessPrecision(sourceCode, options);
    if (!options.processor) {
        return preparedSourceCode;
    }
    // Already converted
    if (options.processor.shaderLanguage === 0 /* ShaderLanguage.GLSL */ && preparedSourceCode.indexOf("#version 3") !== -1) {
        preparedSourceCode = preparedSourceCode.replace("#version 300 es", "");
        if (!options.processor.parseGLES3) {
            return preparedSourceCode;
        }
    }
    const defines = options.defines;
    const preprocessors = _PreparePreProcessors(options, engine);
    // General pre processing
    if (options.processor.preProcessor) {
        preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);
    }
    preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);
    // Post processing
    if (options.processor.postProcessor) {
        preparedSourceCode = options.processor.postProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext, engine
            ? {
                drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,
            }
            : {});
    }
    // Inline functions tagged with #define inline
    if (engine?._features.needShaderCodeInlining) {
        preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);
    }
    return preparedSourceCode;
}
function _ApplyPreProcessing(sourceCode, options, engine) {
    let preparedSourceCode = sourceCode;
    const defines = options.defines;
    const preprocessors = _PreparePreProcessors(options, engine);
    // General pre processing
    if (options.processor?.preProcessor) {
        preparedSourceCode = options.processor.preProcessor(preparedSourceCode, defines, preprocessors, options.isFragment, options.processingContext);
    }
    preparedSourceCode = _EvaluatePreProcessors(preparedSourceCode, preprocessors, options);
    // Post processing
    if (options.processor?.postProcessor) {
        preparedSourceCode = options.processor.postProcessor(preparedSourceCode, defines, options.isFragment, options.processingContext, engine
            ? {
                drawBuffersExtensionDisabled: engine.getCaps().drawBuffersExtension ? false : true,
            }
            : {});
    }
    // Inline functions tagged with #define inline
    if (engine._features.needShaderCodeInlining) {
        preparedSourceCode = engine.inlineShaderCode(preparedSourceCode);
    }
    return preparedSourceCode;
}
/** @internal */
function _ProcessIncludes(sourceCode, options, callback) {
    reusableMatches.length = 0;
    let match;
    // stay back-compat to the old matchAll syntax
    while ((match = regexShaderInclude.exec(sourceCode)) !== null) {
        reusableMatches.push(match);
    }
    let returnValue = String(sourceCode);
    let parts = [sourceCode];
    let keepProcessing = false;
    for (const match of reusableMatches) {
        let includeFile = match[1];
        // Uniform declaration
        if (includeFile.indexOf("__decl__") !== -1) {
            includeFile = includeFile.replace(regexShaderDecl, "");
            if (options.supportsUniformBuffers) {
                includeFile = includeFile.replace("Vertex", "Ubo").replace("Fragment", "Ubo");
            }
            includeFile = includeFile + "Declaration";
        }
        if (options.includesShadersStore[includeFile]) {
            // Substitution
            let includeContent = options.includesShadersStore[includeFile];
            if (match[2]) {
                const splits = match[3].split(",");
                for (let index = 0; index < splits.length; index += 2) {
                    const source = new RegExp(splits[index], "g");
                    const dest = splits[index + 1];
                    includeContent = includeContent.replace(source, dest);
                }
            }
            if (match[4]) {
                const indexString = match[5];
                if (indexString.indexOf("..") !== -1) {
                    const indexSplits = indexString.split("..");
                    const minIndex = parseInt(indexSplits[0]);
                    let maxIndex = parseInt(indexSplits[1]);
                    let sourceIncludeContent = includeContent.slice(0);
                    includeContent = "";
                    if (isNaN(maxIndex)) {
                        maxIndex = options.indexParameters[indexSplits[1]];
                    }
                    for (let i = minIndex; i < maxIndex; i++) {
                        if (!options.supportsUniformBuffers) {
                            // Ubo replacement
                            sourceIncludeContent = sourceIncludeContent.replace(regexLightX, (str, p1) => {
                                return p1 + "{X}";
                            });
                        }
                        includeContent += sourceIncludeContent.replace(regexX, i.toString()) + "\n";
                    }
                }
                else {
                    if (!options.supportsUniformBuffers) {
                        // Ubo replacement
                        includeContent = includeContent.replace(regexLightX, (str, p1) => {
                            return p1 + "{X}";
                        });
                    }
                    includeContent = includeContent.replace(regexX, indexString);
                }
            }
            // Replace
            // Split all parts on match[0] and intersperse the parts with the include content
            const newParts = [];
            for (const part of parts) {
                const splitPart = part.split(match[0]);
                for (let i = 0; i < splitPart.length - 1; i++) {
                    newParts.push(splitPart[i]);
                    newParts.push(includeContent);
                }
                newParts.push(splitPart[splitPart.length - 1]);
            }
            parts = newParts;
            keepProcessing = keepProcessing || includeContent.indexOf("#include<") >= 0 || includeContent.indexOf("#include <") >= 0;
        }
        else {
            const includeShaderUrl = options.shadersRepository + "ShadersInclude/" + includeFile + ".fx";
            _functionContainer.loadFile(includeShaderUrl, (fileContent) => {
                options.includesShadersStore[includeFile] = fileContent;
                _ProcessIncludes(parts.join(""), options, callback);
            });
            return;
        }
    }
    reusableMatches.length = 0;
    returnValue = parts.join("");
    if (keepProcessing) {
        _ProcessIncludes(returnValue.toString(), options, callback);
    }
    else {
        callback(returnValue);
    }
}
/** @internal */
const _functionContainer = {
    /**
     * Loads a file from a url
     * @param url url to load
     * @param onSuccess callback called when the file successfully loads
     * @param onProgress callback called while file is loading (if the server supports this mode)
     * @param offlineProvider defines the offline provider for caching
     * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
     * @param onError callback called when the file fails to load
     * @returns a file request object
     * @internal
     */
    loadFile: (url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError) => {
        throw (0,devTools/* _WarnImport */.n)("FileTools");
    },
};
//# sourceMappingURL=shaderProcessor.js.map

/***/ }),

/***/ 58349:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ WebGL2ShaderProcessor)
/* harmony export */ });
const varyingRegex = /(flat\s)?\s*varying\s*.*/;
/** @internal */
class WebGL2ShaderProcessor {
    constructor() {
        this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;
    }
    attributeProcessor(attribute) {
        return attribute.replace("attribute", "in");
    }
    varyingCheck(varying, _isFragment) {
        return varyingRegex.test(varying);
    }
    varyingProcessor(varying, isFragment) {
        return varying.replace("varying", isFragment ? "in" : "out");
    }
    postProcessor(code, defines, isFragment) {
        const hasDrawBuffersExtension = code.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1;
        // Remove extensions
        const regex = /#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;
        code = code.replace(regex, "");
        // Replace instructions
        code = code.replace(/texture2D\s*\(/g, "texture(");
        if (isFragment) {
            const hasOutput = code.search(/layout *\(location *= *0\) *out/g) !== -1;
            code = code.replace(/texture2DLodEXT\s*\(/g, "textureLod(");
            code = code.replace(/textureCubeLodEXT\s*\(/g, "textureLod(");
            code = code.replace(/textureCube\s*\(/g, "texture(");
            code = code.replace(/gl_FragDepthEXT/g, "gl_FragDepth");
            code = code.replace(/gl_FragColor/g, "glFragColor");
            code = code.replace(/gl_FragData/g, "glFragData");
            code = code.replace(/void\s+?main\s*\(/g, (hasDrawBuffersExtension || hasOutput ? "" : "layout(location = 0) out vec4 glFragColor;\n") + "void main(");
        }
        else {
            const hasMultiviewExtension = defines.indexOf("#define MULTIVIEW") !== -1;
            if (hasMultiviewExtension) {
                return "#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n" + code;
            }
        }
        return code;
    }
}
//# sourceMappingURL=webGL2ShaderProcessors.js.map

/***/ }),

/***/ 67716:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   d: () => (/* binding */ WebGLHardwareTexture)
/* harmony export */ });
/** @internal */
class WebGLHardwareTexture {
    get underlyingResource() {
        return this._webGLTexture;
    }
    constructor(existingTexture = null, context) {
        // There can be multiple buffers for a single WebGL texture because different layers of a 2DArrayTexture / 3DTexture
        // or different faces of a cube texture can be bound to different render targets at the same time.
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this._MSAARenderBuffers = null;
        this._context = context;
        if (!existingTexture) {
            existingTexture = context.createTexture();
            if (!existingTexture) {
                throw new Error("Unable to create webGL texture");
            }
        }
        this.set(existingTexture);
    }
    setUsage() { }
    set(hardwareTexture) {
        this._webGLTexture = hardwareTexture;
    }
    reset() {
        this._webGLTexture = null;
        this._MSAARenderBuffers = null;
    }
    addMSAARenderBuffer(buffer) {
        if (!this._MSAARenderBuffers) {
            this._MSAARenderBuffers = [];
        }
        this._MSAARenderBuffers.push(buffer);
    }
    releaseMSAARenderBuffers() {
        if (this._MSAARenderBuffers) {
            for (const buffer of this._MSAARenderBuffers) {
                this._context.deleteRenderbuffer(buffer);
            }
            this._MSAARenderBuffers = null;
        }
    }
    getMSAARenderBuffer(index = 0) {
        return this._MSAARenderBuffers?.[index] ?? null;
    }
    release() {
        this.releaseMSAARenderBuffers();
        if (this._webGLTexture) {
            this._context.deleteTexture(this._webGLTexture);
        }
        this.reset();
    }
}
//# sourceMappingURL=webGLHardwareTexture.js.map

/***/ }),

/***/ 1886:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   x: () => (/* binding */ WebGLPipelineContext)
/* harmony export */ });
/** @internal */
class WebGLPipelineContext {
    constructor() {
        this._valueCache = {};
        this.vertexCompilationError = null;
        this.fragmentCompilationError = null;
        this.programLinkError = null;
        this.programValidationError = null;
        /** @internal */
        this._isDisposed = false;
    }
    get isAsync() {
        return this.isParallelCompiled;
    }
    get isReady() {
        if (this.program) {
            if (this.isParallelCompiled) {
                return this.engine._isRenderingStateCompiled(this);
            }
            return true;
        }
        return false;
    }
    _handlesSpectorRebuildCallback(onCompiled) {
        if (onCompiled && this.program) {
            onCompiled(this.program);
        }
    }
    setEngine(engine) {
        this.engine = engine;
    }
    _fillEffectInformation(effect, uniformBuffersNames, uniformsNames, uniforms, samplerList, samplers, attributesNames, attributes) {
        const engine = this.engine;
        if (engine.supportsUniformBuffers) {
            for (const name in uniformBuffersNames) {
                effect.bindUniformBlock(name, uniformBuffersNames[name]);
            }
        }
        const effectAvailableUniforms = this.engine.getUniforms(this, uniformsNames);
        effectAvailableUniforms.forEach((uniform, index) => {
            uniforms[uniformsNames[index]] = uniform;
        });
        this._uniforms = uniforms;
        let index;
        for (index = 0; index < samplerList.length; index++) {
            const sampler = effect.getUniform(samplerList[index]);
            if (sampler == null) {
                samplerList.splice(index, 1);
                index--;
            }
        }
        samplerList.forEach((name, index) => {
            samplers[name] = index;
        });
        for (const attr of engine.getAttributes(this, attributesNames)) {
            attributes.push(attr);
        }
    }
    /**
     * Release all associated resources.
     **/
    dispose() {
        this._uniforms = {};
        this._isDisposed = true;
    }
    /**
     * @internal
     */
    _cacheMatrix(uniformName, matrix) {
        const cache = this._valueCache[uniformName];
        const flag = matrix.updateFlag;
        if (cache !== undefined && cache === flag) {
            return false;
        }
        this._valueCache[uniformName] = flag;
        return true;
    }
    /**
     * @internal
     */
    _cacheFloat2(uniformName, x, y) {
        let cache = this._valueCache[uniformName];
        if (!cache || cache.length !== 2) {
            cache = [x, y];
            this._valueCache[uniformName] = cache;
            return true;
        }
        let changed = false;
        if (cache[0] !== x) {
            cache[0] = x;
            changed = true;
        }
        if (cache[1] !== y) {
            cache[1] = y;
            changed = true;
        }
        return changed;
    }
    /**
     * @internal
     */
    _cacheFloat3(uniformName, x, y, z) {
        let cache = this._valueCache[uniformName];
        if (!cache || cache.length !== 3) {
            cache = [x, y, z];
            this._valueCache[uniformName] = cache;
            return true;
        }
        let changed = false;
        if (cache[0] !== x) {
            cache[0] = x;
            changed = true;
        }
        if (cache[1] !== y) {
            cache[1] = y;
            changed = true;
        }
        if (cache[2] !== z) {
            cache[2] = z;
            changed = true;
        }
        return changed;
    }
    /**
     * @internal
     */
    _cacheFloat4(uniformName, x, y, z, w) {
        let cache = this._valueCache[uniformName];
        if (!cache || cache.length !== 4) {
            cache = [x, y, z, w];
            this._valueCache[uniformName] = cache;
            return true;
        }
        let changed = false;
        if (cache[0] !== x) {
            cache[0] = x;
            changed = true;
        }
        if (cache[1] !== y) {
            cache[1] = y;
            changed = true;
        }
        if (cache[2] !== z) {
            cache[2] = z;
            changed = true;
        }
        if (cache[3] !== w) {
            cache[3] = w;
            changed = true;
        }
        return changed;
    }
    /**
     * Sets an integer value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value Value to be set.
     */
    setInt(uniformName, value) {
        const cache = this._valueCache[uniformName];
        if (cache !== undefined && cache === value) {
            return;
        }
        if (this.engine.setInt(this._uniforms[uniformName], value)) {
            this._valueCache[uniformName] = value;
        }
    }
    /**
     * Sets a int2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int2.
     * @param y Second int in int2.
     */
    setInt2(uniformName, x, y) {
        if (this._cacheFloat2(uniformName, x, y)) {
            if (!this.engine.setInt2(this._uniforms[uniformName], x, y)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a int3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int3.
     * @param y Second int in int3.
     * @param z Third int in int3.
     */
    setInt3(uniformName, x, y, z) {
        if (this._cacheFloat3(uniformName, x, y, z)) {
            if (!this.engine.setInt3(this._uniforms[uniformName], x, y, z)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a int4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int4.
     * @param y Second int in int4.
     * @param z Third int in int4.
     * @param w Fourth int in int4.
     */
    setInt4(uniformName, x, y, z, w) {
        if (this._cacheFloat4(uniformName, x, y, z, w)) {
            if (!this.engine.setInt4(this._uniforms[uniformName], x, y, z, w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets an int array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setIntArray(this._uniforms[uniformName], array);
    }
    /**
     * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray2(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setIntArray2(this._uniforms[uniformName], array);
    }
    /**
     * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray3(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setIntArray3(this._uniforms[uniformName], array);
    }
    /**
     * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray4(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setIntArray4(this._uniforms[uniformName], array);
    }
    /**
     * Sets an unsigned integer value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value Value to be set.
     */
    setUInt(uniformName, value) {
        const cache = this._valueCache[uniformName];
        if (cache !== undefined && cache === value) {
            return;
        }
        if (this.engine.setUInt(this._uniforms[uniformName], value)) {
            this._valueCache[uniformName] = value;
        }
    }
    /**
     * Sets an unsigned int2 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint2.
     * @param y Second unsigned int in uint2.
     */
    setUInt2(uniformName, x, y) {
        if (this._cacheFloat2(uniformName, x, y)) {
            if (!this.engine.setUInt2(this._uniforms[uniformName], x, y)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets an unsigned int3 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint3.
     * @param y Second unsigned int in uint3.
     * @param z Third unsigned int in uint3.
     */
    setUInt3(uniformName, x, y, z) {
        if (this._cacheFloat3(uniformName, x, y, z)) {
            if (!this.engine.setUInt3(this._uniforms[uniformName], x, y, z)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets an unsigned int4 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint4.
     * @param y Second unsigned int in uint4.
     * @param z Third unsigned int in uint4.
     * @param w Fourth unsigned int in uint4.
     */
    setUInt4(uniformName, x, y, z, w) {
        if (this._cacheFloat4(uniformName, x, y, z, w)) {
            if (!this.engine.setUInt4(this._uniforms[uniformName], x, y, z, w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets an unsigned int array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setUIntArray(this._uniforms[uniformName], array);
    }
    /**
     * Sets an unsigned int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray2(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setUIntArray2(this._uniforms[uniformName], array);
    }
    /**
     * Sets an unsigned int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray3(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setUIntArray3(this._uniforms[uniformName], array);
    }
    /**
     * Sets an unsigned int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray4(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setUIntArray4(this._uniforms[uniformName], array);
    }
    /**
     * Sets an array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setArray(this._uniforms[uniformName], array);
    }
    /**
     * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray2(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setArray2(this._uniforms[uniformName], array);
    }
    /**
     * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray3(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setArray3(this._uniforms[uniformName], array);
    }
    /**
     * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray4(uniformName, array) {
        this._valueCache[uniformName] = null;
        this.engine.setArray4(this._uniforms[uniformName], array);
    }
    /**
     * Sets matrices on a uniform variable.
     * @param uniformName Name of the variable.
     * @param matrices matrices to be set.
     */
    setMatrices(uniformName, matrices) {
        if (!matrices) {
            return;
        }
        this._valueCache[uniformName] = null;
        this.engine.setMatrices(this._uniforms[uniformName], matrices);
    }
    /**
     * Sets matrix on a uniform variable.
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     */
    setMatrix(uniformName, matrix) {
        if (this._cacheMatrix(uniformName, matrix)) {
            if (!this.engine.setMatrices(this._uniforms[uniformName], matrix.asArray())) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     */
    setMatrix3x3(uniformName, matrix) {
        this._valueCache[uniformName] = null;
        this.engine.setMatrix3x3(this._uniforms[uniformName], matrix);
    }
    /**
     * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     */
    setMatrix2x2(uniformName, matrix) {
        this._valueCache[uniformName] = null;
        this.engine.setMatrix2x2(this._uniforms[uniformName], matrix);
    }
    /**
     * Sets a float on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value value to be set.
     */
    setFloat(uniformName, value) {
        const cache = this._valueCache[uniformName];
        if (cache !== undefined && cache === value) {
            return;
        }
        if (this.engine.setFloat(this._uniforms[uniformName], value)) {
            this._valueCache[uniformName] = value;
        }
    }
    /**
     * Sets a Vector2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector2 vector2 to be set.
     */
    setVector2(uniformName, vector2) {
        if (this._cacheFloat2(uniformName, vector2.x, vector2.y)) {
            if (!this.engine.setFloat2(this._uniforms[uniformName], vector2.x, vector2.y)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a float2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float2.
     * @param y Second float in float2.
     */
    setFloat2(uniformName, x, y) {
        if (this._cacheFloat2(uniformName, x, y)) {
            if (!this.engine.setFloat2(this._uniforms[uniformName], x, y)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Vector3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector3 Value to be set.
     */
    setVector3(uniformName, vector3) {
        if (this._cacheFloat3(uniformName, vector3.x, vector3.y, vector3.z)) {
            if (!this.engine.setFloat3(this._uniforms[uniformName], vector3.x, vector3.y, vector3.z)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a float3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float3.
     * @param y Second float in float3.
     * @param z Third float in float3.
     */
    setFloat3(uniformName, x, y, z) {
        if (this._cacheFloat3(uniformName, x, y, z)) {
            if (!this.engine.setFloat3(this._uniforms[uniformName], x, y, z)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Vector4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector4 Value to be set.
     */
    setVector4(uniformName, vector4) {
        if (this._cacheFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w)) {
            if (!this.engine.setFloat4(this._uniforms[uniformName], vector4.x, vector4.y, vector4.z, vector4.w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Quaternion on a uniform variable.
     * @param uniformName Name of the variable.
     * @param quaternion Value to be set.
     */
    setQuaternion(uniformName, quaternion) {
        if (this._cacheFloat4(uniformName, quaternion.x, quaternion.y, quaternion.z, quaternion.w)) {
            if (!this.engine.setFloat4(this._uniforms[uniformName], quaternion.x, quaternion.y, quaternion.z, quaternion.w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a float4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float4.
     * @param y Second float in float4.
     * @param z Third float in float4.
     * @param w Fourth float in float4.
     */
    setFloat4(uniformName, x, y, z, w) {
        if (this._cacheFloat4(uniformName, x, y, z, w)) {
            if (!this.engine.setFloat4(this._uniforms[uniformName], x, y, z, w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Color3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param color3 Value to be set.
     */
    setColor3(uniformName, color3) {
        if (this._cacheFloat3(uniformName, color3.r, color3.g, color3.b)) {
            if (!this.engine.setFloat3(this._uniforms[uniformName], color3.r, color3.g, color3.b)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Color4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param color3 Value to be set.
     * @param alpha Alpha value to be set.
     */
    setColor4(uniformName, color3, alpha) {
        if (this._cacheFloat4(uniformName, color3.r, color3.g, color3.b, alpha)) {
            if (!this.engine.setFloat4(this._uniforms[uniformName], color3.r, color3.g, color3.b, alpha)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Color4 on a uniform variable
     * @param uniformName defines the name of the variable
     * @param color4 defines the value to be set
     */
    setDirectColor4(uniformName, color4) {
        if (this._cacheFloat4(uniformName, color4.r, color4.g, color4.b, color4.a)) {
            if (!this.engine.setFloat4(this._uniforms[uniformName], color4.r, color4.g, color4.b, color4.a)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    _getVertexShaderCode() {
        return this.vertexShader ? this.engine._getShaderSource(this.vertexShader) : null;
    }
    _getFragmentShaderCode() {
        return this.fragmentShader ? this.engine._getShaderSource(this.fragmentShader) : null;
    }
}
//# sourceMappingURL=webGLPipelineContext.js.map

/***/ }),

/***/ 39176:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   e: () => (/* binding */ WebGPUPerfCounter)
/* harmony export */ });
/* harmony import */ var _Misc_perfCounter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24296);

/**
 * Class used to define a WebGPU performance counter
 */
class WebGPUPerfCounter {
    constructor() {
        this._gpuTimeInFrameId = -1;
        /**
         * The GPU time in nanoseconds spent in the last frame
         */
        this.counter = new _Misc_perfCounter_js__WEBPACK_IMPORTED_MODULE_0__/* .PerfCounter */ .A();
    }
    /**
     * @internal
     */
    _addDuration(currentFrameId, duration) {
        if (currentFrameId < this._gpuTimeInFrameId) {
            return;
        }
        if (this._gpuTimeInFrameId !== currentFrameId) {
            this.counter._fetchResult();
            this.counter.fetchNewFrame();
            this.counter.addCount(duration, false);
            this._gpuTimeInFrameId = currentFrameId;
        }
        else {
            this.counter.addCount(duration, false);
        }
    }
}
//# sourceMappingURL=webgpuPerfCounter.js.map

/***/ }),

/***/ 16741:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   W0: () => (/* binding */ _loadFile),
/* harmony export */   iL: () => (/* binding */ _ConcatenateShader),
/* harmony export */   kZ: () => (/* binding */ allocateAndCopyTypedBuffer),
/* harmony export */   sg: () => (/* binding */ EngineFunctionContext),
/* harmony export */   xt: () => (/* binding */ _getGlobalDefines)
/* harmony export */ });
/* unused harmony export getHostDocument */
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45503);
/* harmony import */ var _Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18790);



const EngineFunctionContext = {};
/**
 * @internal
 */
function _ConcatenateShader(source, defines, shaderVersion = "") {
    return shaderVersion + (defines ? defines + "\n" : "") + source;
}
/**
 * @internal
 */
function _loadFile(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, injectedLoadFile) {
    const loadFile = injectedLoadFile || EngineFunctionContext.loadFile;
    if (loadFile) {
        const request = loadFile(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError);
        return request;
    }
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_0__/* ._WarnImport */ .n)("FileTools");
}
/**
 * Gets host document
 * @param renderingCanvas if provided, the canvas' owner document will be returned
 * @returns the host document object
 */
function getHostDocument(renderingCanvas = null) {
    if (renderingCanvas && renderingCanvas.ownerDocument) {
        return renderingCanvas.ownerDocument;
    }
    return IsDocumentAvailable() ? document : null;
}
/** @internal */
function _getGlobalDefines(defines, isNDCHalfZRange, useReverseDepthBuffer, useExactSrgbConversions) {
    if (defines) {
        if (isNDCHalfZRange) {
            defines["IS_NDC_HALF_ZRANGE"] = "";
        }
        else {
            delete defines["IS_NDC_HALF_ZRANGE"];
        }
        if (useReverseDepthBuffer) {
            defines["USE_REVERSE_DEPTHBUFFER"] = "";
        }
        else {
            delete defines["USE_REVERSE_DEPTHBUFFER"];
        }
        if (useExactSrgbConversions) {
            defines["USE_EXACT_SRGB_CONVERSIONS"] = "";
        }
        else {
            delete defines["USE_EXACT_SRGB_CONVERSIONS"];
        }
        return;
    }
    else {
        let s = "";
        if (isNDCHalfZRange) {
            s += "#define IS_NDC_HALF_ZRANGE";
        }
        if (useReverseDepthBuffer) {
            if (s) {
                s += "\n";
            }
            s += "#define USE_REVERSE_DEPTHBUFFER";
        }
        if (useExactSrgbConversions) {
            if (s) {
                s += "\n";
            }
            s += "#define USE_EXACT_SRGB_CONVERSIONS";
        }
        return s;
    }
}
/**
 * Allocate a typed array depending on a texture type. Optionally can copy existing data in the buffer.
 * @param type type of the texture
 * @param sizeOrDstBuffer size of the array OR an existing buffer that will be used as the destination of the copy (if copyBuffer is provided)
 * @param sizeInBytes true if the size of the array is given in bytes, false if it is the number of elements of the array
 * @param copyBuffer if provided, buffer to copy into the destination buffer (either a newly allocated buffer if sizeOrDstBuffer is a number or use sizeOrDstBuffer as the destination buffer otherwise)
 * @returns the allocated buffer or sizeOrDstBuffer if the latter is an ArrayBuffer
 */
function allocateAndCopyTypedBuffer(type, sizeOrDstBuffer, sizeInBytes = false, copyBuffer) {
    switch (type) {
        case 3: {
            const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Int8Array(sizeOrDstBuffer) : new Int8Array(sizeOrDstBuffer);
            if (copyBuffer) {
                buffer.set(new Int8Array(copyBuffer));
            }
            return buffer;
        }
        case 0: {
            const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint8Array(sizeOrDstBuffer) : new Uint8Array(sizeOrDstBuffer);
            if (copyBuffer) {
                buffer.set(new Uint8Array(copyBuffer));
            }
            return buffer;
        }
        case 4: {
            const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Int16Array(sizeOrDstBuffer) : new Int16Array(sizeInBytes ? sizeOrDstBuffer / 2 : sizeOrDstBuffer);
            if (copyBuffer) {
                buffer.set(new Int16Array(copyBuffer));
            }
            return buffer;
        }
        case 5:
        case 8:
        case 9:
        case 10:
        case 2: {
            const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint16Array(sizeOrDstBuffer) : new Uint16Array(sizeInBytes ? sizeOrDstBuffer / 2 : sizeOrDstBuffer);
            if (copyBuffer) {
                buffer.set(new Uint16Array(copyBuffer));
            }
            return buffer;
        }
        case 6: {
            const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Int32Array(sizeOrDstBuffer) : new Int32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer);
            if (copyBuffer) {
                buffer.set(new Int32Array(copyBuffer));
            }
            return buffer;
        }
        case 7:
        case 11:
        case 12:
        case 13:
        case 14:
        case 15: {
            const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint32Array(sizeOrDstBuffer) : new Uint32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer);
            if (copyBuffer) {
                buffer.set(new Uint32Array(copyBuffer));
            }
            return buffer;
        }
        case 1: {
            const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Float32Array(sizeOrDstBuffer) : new Float32Array(sizeInBytes ? sizeOrDstBuffer / 4 : sizeOrDstBuffer);
            if (copyBuffer) {
                buffer.set(new Float32Array(copyBuffer));
            }
            return buffer;
        }
    }
    const buffer = sizeOrDstBuffer instanceof ArrayBuffer ? new Uint8Array(sizeOrDstBuffer) : new Uint8Array(sizeOrDstBuffer);
    if (copyBuffer) {
        buffer.set(new Uint8Array(copyBuffer));
    }
    return buffer;
}
//# sourceMappingURL=abstractEngine.functions.js.map

/***/ }),

/***/ 32206:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $: () => (/* binding */ AbstractEngine),
/* harmony export */   r: () => (/* binding */ QueueNewFrame)
/* harmony export */ });
/* harmony import */ var _engineStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6315);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);
/* harmony import */ var _Materials_effect_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74420);
/* harmony import */ var _performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20215);
/* harmony import */ var _Misc_precisionDate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(76237);
/* harmony import */ var _States_depthCullingState_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(86867);
/* harmony import */ var _States_stencilStateComposer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(82724);
/* harmony import */ var _States_stencilState_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56194);
/* harmony import */ var _States_alphaCullingState_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(26614);
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(45503);
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(81194);
/* harmony import */ var _Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(18790);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(99848);
/* harmony import */ var _abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(16741);
/* harmony import */ var _Materials_Textures_Loaders_textureLoaderManager_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(18454);
















/**
 * Queue a new function into the requested animation frame pool (ie. this function will be executed by the browser (or the javascript engine) for the next frame)
 * @param func - the function to be called
 * @param requester - the object that will request the next frame. Falls back to window.
 * @returns frame number
 */
function QueueNewFrame(func, requester) {
    // Note that there is kind of a typing issue here, as `setTimeout` might return something else than a number (NodeJs returns a NodeJS.Timeout object).
    // Also if the global `requestAnimationFrame`'s returnType is number, `requester.requestPostAnimationFrame` and `requester.requestAnimationFrame` types
    // are `any`.
    if (!(0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsWindowObjectExist */ .BA)()) {
        if (typeof requestAnimationFrame === "function") {
            return requestAnimationFrame(func);
        }
    }
    else {
        const { requestAnimationFrame } = requester || window;
        if (typeof requestAnimationFrame === "function") {
            return requestAnimationFrame(func);
        }
    }
    // fallback to the global `setTimeout`.
    // In most cases (aka in the browser), `window` is the global object, so instead of calling `window.setTimeout` we could call the global `setTimeout`.
    return setTimeout(func, 16);
}
/**
 * The parent class for specialized engines (WebGL, WebGPU)
 */
class AbstractEngine {
    /**
     * Gets the current frame id
     */
    get frameId() {
        return this._frameId;
    }
    /**
     * Gets a boolean indicating if the engine runs in WebGPU or not.
     */
    get isWebGPU() {
        return this._isWebGPU;
    }
    /**
     * @internal
     */
    _getShaderProcessor(shaderLanguage) {
        return this._shaderProcessor;
    }
    /**
     * Gets the shader platform name used by the effects.
     */
    get shaderPlatformName() {
        return this._shaderPlatformName;
    }
    _clearEmptyResources() {
        this._emptyTexture = null;
        this._emptyCubeTexture = null;
        this._emptyTexture3D = null;
        this._emptyTexture2DArray = null;
    }
    /**
     * Gets or sets a boolean indicating if depth buffer should be reverse, going from far to near.
     * This can provide greater z depth for distant objects.
     */
    get useReverseDepthBuffer() {
        return this._useReverseDepthBuffer;
    }
    set useReverseDepthBuffer(useReverse) {
        if (useReverse === this._useReverseDepthBuffer) {
            return;
        }
        this._useReverseDepthBuffer = useReverse;
        if (useReverse) {
            this._depthCullingState.depthFunc = 518;
        }
        else {
            this._depthCullingState.depthFunc = 515;
        }
    }
    /**
     * Enable or disable color writing
     * @param enable defines the state to set
     */
    setColorWrite(enable) {
        if (enable !== this._colorWrite) {
            this._colorWriteChanged = true;
            this._colorWrite = enable;
        }
    }
    /**
     * Gets a boolean indicating if color writing is enabled
     * @returns the current color writing state
     */
    getColorWrite() {
        return this._colorWrite;
    }
    /**
     * Gets the depth culling state manager
     */
    get depthCullingState() {
        return this._depthCullingState;
    }
    /**
     * Gets the alpha state manager
     */
    get alphaState() {
        return this._alphaState;
    }
    /**
     * Gets the stencil state manager
     */
    get stencilState() {
        return this._stencilState;
    }
    /**
     * Gets the stencil state composer
     */
    get stencilStateComposer() {
        return this._stencilStateComposer;
    }
    /** @internal */
    _getGlobalDefines(defines) {
        if (defines) {
            if (this.isNDCHalfZRange) {
                defines["IS_NDC_HALF_ZRANGE"] = "";
            }
            else {
                delete defines["IS_NDC_HALF_ZRANGE"];
            }
            if (this.useReverseDepthBuffer) {
                defines["USE_REVERSE_DEPTHBUFFER"] = "";
            }
            else {
                delete defines["USE_REVERSE_DEPTHBUFFER"];
            }
            if (this.useExactSrgbConversions) {
                defines["USE_EXACT_SRGB_CONVERSIONS"] = "";
            }
            else {
                delete defines["USE_EXACT_SRGB_CONVERSIONS"];
            }
            return;
        }
        else {
            let s = "";
            if (this.isNDCHalfZRange) {
                s += "#define IS_NDC_HALF_ZRANGE";
            }
            if (this.useReverseDepthBuffer) {
                if (s) {
                    s += "\n";
                }
                s += "#define USE_REVERSE_DEPTHBUFFER";
            }
            if (this.useExactSrgbConversions) {
                if (s) {
                    s += "\n";
                }
                s += "#define USE_EXACT_SRGB_CONVERSIONS";
            }
            return s;
        }
    }
    _rebuildInternalTextures() {
        const currentState = this._internalTexturesCache.slice(); // Do a copy because the rebuild will add proxies
        for (const internalTexture of currentState) {
            internalTexture._rebuild();
        }
    }
    _rebuildRenderTargetWrappers() {
        const currentState = this._renderTargetWrapperCache.slice(); // Do a copy because the rebuild will add proxies
        for (const renderTargetWrapper of currentState) {
            renderTargetWrapper._rebuild();
        }
    }
    _rebuildEffects() {
        for (const key in this._compiledEffects) {
            const effect = this._compiledEffects[key];
            effect._pipelineContext = null; // because _prepareEffect will try to dispose this pipeline before recreating it and that would lead to webgl errors
            effect._prepareEffect();
        }
        _Materials_effect_js__WEBPACK_IMPORTED_MODULE_2__/* .Effect */ .M.ResetCache();
    }
    _rebuildGraphicsResources() {
        // Ensure webgl and engine states are matching
        this.wipeCaches(true);
        // Rebuild effects
        this._rebuildEffects();
        this._rebuildComputeEffects?.();
        // Note:
        //  The call to _rebuildBuffers must be made before the call to _rebuildInternalTextures because in the process of _rebuildBuffers the buffers used by the post process managers will be rebuilt
        //  and we may need to use the post process manager of the scene during _rebuildInternalTextures (in WebGL1, non-POT textures are rescaled using a post process + post process manager of the scene)
        // Rebuild buffers
        this._rebuildBuffers();
        // Rebuild textures
        this._rebuildInternalTextures();
        // Rebuild textures
        this._rebuildTextures();
        // Rebuild textures
        this._rebuildRenderTargetWrappers();
        // Reset engine states after all the buffer/textures/... have been rebuilt
        this.wipeCaches(true);
    }
    _flagContextRestored() {
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn(this.name + " context successfully restored.");
        this.onContextRestoredObservable.notifyObservers(this);
        this._contextWasLost = false;
    }
    _restoreEngineAfterContextLost(initEngine) {
        // Adding a timeout to avoid race condition at browser level
        setTimeout(async () => {
            this._clearEmptyResources();
            const depthTest = this._depthCullingState.depthTest; // backup those values because the call to initEngine / wipeCaches will reset them
            const depthFunc = this._depthCullingState.depthFunc;
            const depthMask = this._depthCullingState.depthMask;
            const stencilTest = this._stencilState.stencilTest;
            // Rebuild context
            await initEngine();
            this._rebuildGraphicsResources();
            this._depthCullingState.depthTest = depthTest;
            this._depthCullingState.depthFunc = depthFunc;
            this._depthCullingState.depthMask = depthMask;
            this._stencilState.stencilTest = stencilTest;
            this._flagContextRestored();
        }, 0);
    }
    /** Gets a boolean indicating if the engine was disposed */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Enables or disables the snapshot rendering mode
     * Note that the WebGL engine does not support snapshot rendering so setting the value won't have any effect for this engine
     */
    get snapshotRendering() {
        return false;
    }
    set snapshotRendering(activate) {
        // Do nothing
    }
    /**
     * Gets or sets the snapshot rendering mode
     */
    get snapshotRenderingMode() {
        return 0;
    }
    set snapshotRenderingMode(mode) { }
    /**
     * Returns the string "AbstractEngine"
     * @returns "AbstractEngine"
     */
    getClassName() {
        return "AbstractEngine";
    }
    /**
     * Gets the default empty texture
     */
    get emptyTexture() {
        if (!this._emptyTexture) {
            this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, 5, false, false, 1);
        }
        return this._emptyTexture;
    }
    /**
     * Gets the default empty 3D texture
     */
    get emptyTexture3D() {
        if (!this._emptyTexture3D) {
            this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, 5, false, false, 1);
        }
        return this._emptyTexture3D;
    }
    /**
     * Gets the default empty 2D array texture
     */
    get emptyTexture2DArray() {
        if (!this._emptyTexture2DArray) {
            this._emptyTexture2DArray = this.createRawTexture2DArray(new Uint8Array(4), 1, 1, 1, 5, false, false, 1);
        }
        return this._emptyTexture2DArray;
    }
    /**
     * Gets the default empty cube texture
     */
    get emptyCubeTexture() {
        if (!this._emptyCubeTexture) {
            const faceData = new Uint8Array(4);
            const cubeData = [faceData, faceData, faceData, faceData, faceData, faceData];
            this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, 5, 0, false, false, 1);
        }
        return this._emptyCubeTexture;
    }
    /**
     * Gets the list of current active render loop functions
     * @returns a read only array with the current render loop functions
     */
    get activeRenderLoops() {
        return this._activeRenderLoops;
    }
    /**
     * stop executing a render loop function and remove it from the execution array
     * @param renderFunction defines the function to be removed. If not provided all functions will be removed.
     */
    stopRenderLoop(renderFunction) {
        if (!renderFunction) {
            this._activeRenderLoops.length = 0;
            this._cancelFrame();
            return;
        }
        const index = this._activeRenderLoops.indexOf(renderFunction);
        if (index >= 0) {
            this._activeRenderLoops.splice(index, 1);
            if (this._activeRenderLoops.length == 0) {
                this._cancelFrame();
            }
        }
    }
    _cancelFrame() {
        if (this._frameHandler !== 0) {
            const handlerToCancel = this._frameHandler;
            this._frameHandler = 0;
            if (!(0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsWindowObjectExist */ .BA)()) {
                if (typeof cancelAnimationFrame === "function") {
                    return cancelAnimationFrame(handlerToCancel);
                }
            }
            else {
                const { cancelAnimationFrame } = this.getHostWindow() || window;
                if (typeof cancelAnimationFrame === "function") {
                    return cancelAnimationFrame(handlerToCancel);
                }
            }
            return clearTimeout(handlerToCancel);
        }
    }
    /**
     * Begin a new frame
     */
    beginFrame() {
        this.onBeginFrameObservable.notifyObservers(this);
    }
    /**
     * End the current frame
     */
    endFrame() {
        this._frameId++;
        this.onEndFrameObservable.notifyObservers(this);
    }
    /** @internal */
    _renderLoop() {
        // Reset the frame handler before rendering a frame to determine if a new frame has been queued.
        this._frameHandler = 0;
        if (!this._contextWasLost) {
            let shouldRender = true;
            if (this._isDisposed || (!this.renderEvenInBackground && this._windowIsBackground)) {
                shouldRender = false;
            }
            if (shouldRender) {
                // Start new frame
                this.beginFrame();
                // Child canvases
                if (!this._renderViews()) {
                    // Main frame
                    this._renderFrame();
                }
                // Present
                this.endFrame();
            }
        }
        // The first condition prevents queuing another frame if we no longer have active render loops (e.g., if
        // `stopRenderLoop` is called mid frame). The second condition prevents queuing another frame if one has
        // already been queued (e.g., if `stopRenderLoop` and `runRenderLoop` is called mid frame).
        if (this._activeRenderLoops.length > 0 && this._frameHandler === 0) {
            this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());
        }
    }
    /** @internal */
    _renderFrame() {
        for (let index = 0; index < this._activeRenderLoops.length; index++) {
            const renderFunction = this._activeRenderLoops[index];
            renderFunction();
        }
    }
    /** @internal */
    _renderViews() {
        return false;
    }
    /**
     * Can be used to override the current requestAnimationFrame requester.
     * @internal
     */
    _queueNewFrame(bindedRenderFunction, requester) {
        return QueueNewFrame(bindedRenderFunction, requester);
    }
    /**
     * Register and execute a render loop. The engine can have more than one render function
     * @param renderFunction defines the function to continuously execute
     */
    runRenderLoop(renderFunction) {
        if (this._activeRenderLoops.indexOf(renderFunction) !== -1) {
            return;
        }
        this._activeRenderLoops.push(renderFunction);
        // On the first added function, start the render loop.
        if (this._activeRenderLoops.length === 1 && this._frameHandler === 0) {
            this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());
        }
    }
    /**
     * Gets a boolean indicating if depth testing is enabled
     * @returns the current state
     */
    getDepthBuffer() {
        return this._depthCullingState.depthTest;
    }
    /**
     * Enable or disable depth buffering
     * @param enable defines the state to set
     */
    setDepthBuffer(enable) {
        this._depthCullingState.depthTest = enable;
    }
    /**
     * Set the z offset Factor to apply to current rendering
     * @param value defines the offset to apply
     */
    setZOffset(value) {
        this._depthCullingState.zOffset = this.useReverseDepthBuffer ? -value : value;
    }
    /**
     * Gets the current value of the zOffset Factor
     * @returns the current zOffset Factor state
     */
    getZOffset() {
        const zOffset = this._depthCullingState.zOffset;
        return this.useReverseDepthBuffer ? -zOffset : zOffset;
    }
    /**
     * Set the z offset Units to apply to current rendering
     * @param value defines the offset to apply
     */
    setZOffsetUnits(value) {
        this._depthCullingState.zOffsetUnits = this.useReverseDepthBuffer ? -value : value;
    }
    /**
     * Gets the current value of the zOffset Units
     * @returns the current zOffset Units state
     */
    getZOffsetUnits() {
        const zOffsetUnits = this._depthCullingState.zOffsetUnits;
        return this.useReverseDepthBuffer ? -zOffsetUnits : zOffsetUnits;
    }
    /**
     * Gets host window
     * @returns the host window object
     */
    getHostWindow() {
        if (!(0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsWindowObjectExist */ .BA)()) {
            return null;
        }
        if (this._renderingCanvas && this._renderingCanvas.ownerDocument && this._renderingCanvas.ownerDocument.defaultView) {
            return this._renderingCanvas.ownerDocument.defaultView;
        }
        return window;
    }
    /**
     * (WebGPU only) True (default) to be in compatibility mode, meaning rendering all existing scenes without artifacts (same rendering than WebGL).
     * Setting the property to false will improve performances but may not work in some scenes if some precautions are not taken.
     * See https://doc.babylonjs.com/setup/support/webGPU/webGPUOptimization/webGPUNonCompatibilityMode for more details
     */
    get compatibilityMode() {
        return this._compatibilityMode;
    }
    set compatibilityMode(mode) {
        // not supported in WebGL
        this._compatibilityMode = true;
    }
    _rebuildTextures() {
        for (const scene of this.scenes) {
            scene._rebuildTextures();
        }
        for (const scene of this._virtualScenes) {
            scene._rebuildTextures();
        }
    }
    /**
     * @internal
     */
    _releaseRenderTargetWrapper(rtWrapper) {
        const index = this._renderTargetWrapperCache.indexOf(rtWrapper);
        if (index !== -1) {
            this._renderTargetWrapperCache.splice(index, 1);
        }
    }
    /**
     * Gets the current viewport
     */
    get currentViewport() {
        return this._cachedViewport;
    }
    /**
     * Set the WebGL's viewport
     * @param viewport defines the viewport element to be used
     * @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used
     * @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used
     */
    setViewport(viewport, requiredWidth, requiredHeight) {
        const width = requiredWidth || this.getRenderWidth();
        const height = requiredHeight || this.getRenderHeight();
        const x = viewport.x || 0;
        const y = viewport.y || 0;
        this._cachedViewport = viewport;
        this._viewport(x * width, y * height, width * viewport.width, height * viewport.height);
    }
    /**
     * Create an image to use with canvas
     * @returns IImage interface
     */
    createCanvasImage() {
        return document.createElement("img");
    }
    /**
     * Returns a string describing the current engine
     */
    get description() {
        let description = this.name + this.version;
        if (this._caps.parallelShaderCompile) {
            description += " - Parallel shader compilation";
        }
        return description;
    }
    _createTextureBase(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, prepareTexture, prepareTextureProcess, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, useSRGBBuffer) {
        url = url || "";
        const fromData = url.substr(0, 5) === "data:";
        const fromBlob = url.substr(0, 5) === "blob:";
        const isBase64 = fromData && url.indexOf(";base64,") !== -1;
        const texture = fallback ? fallback : new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_10__/* .InternalTexture */ .hV(this, 1 /* InternalTextureSource.Url */);
        if (texture !== fallback) {
            texture.label = url.substring(0, 60); // default label, can be overriden by the caller
        }
        const originalUrl = url;
        if (this._transformTextureUrl && !isBase64 && !fallback && !buffer) {
            url = this._transformTextureUrl(url);
        }
        if (originalUrl !== url) {
            texture._originalUrl = originalUrl;
        }
        // establish the file extension, if possible
        const lastDot = url.lastIndexOf(".");
        let extension = forcedExtension ? forcedExtension : lastDot > -1 ? url.substring(lastDot).toLowerCase() : "";
        // Remove query string
        const queryStringIndex = extension.indexOf("?");
        if (queryStringIndex > -1) {
            extension = extension.split("?")[0];
        }
        const loaderPromise = (0,_Materials_Textures_Loaders_textureLoaderManager_js__WEBPACK_IMPORTED_MODULE_14__/* ._GetCompatibleTextureLoader */ .gT)(extension, mimeType);
        if (scene) {
            scene.addPendingData(texture);
        }
        texture.url = url;
        texture.generateMipMaps = !noMipmap;
        texture.samplingMode = samplingMode;
        texture.invertY = invertY;
        texture._useSRGBBuffer = this._getUseSRGBBuffer(!!useSRGBBuffer, noMipmap);
        if (!this._doNotHandleContextLost) {
            // Keep a link to the buffer only if we plan to handle context lost
            texture._buffer = buffer;
        }
        let onLoadObserver = null;
        if (onLoad && !fallback) {
            onLoadObserver = texture.onLoadedObservable.add(onLoad);
        }
        if (!fallback) {
            this._internalTexturesCache.push(texture);
        }
        const onInternalError = (message, exception) => {
            if (scene) {
                scene.removePendingData(texture);
            }
            if (url === originalUrl) {
                if (onLoadObserver) {
                    texture.onLoadedObservable.remove(onLoadObserver);
                }
                if (_engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.UseFallbackTexture && url !== _engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.FallbackTexture) {
                    this._createTextureBase(_engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.FallbackTexture, noMipmap, texture.invertY, scene, samplingMode, null, onError, prepareTexture, prepareTextureProcess, buffer, texture);
                }
                message = (message || "Unknown error") + (_engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.UseFallbackTexture ? " - Fallback texture was used" : "");
                texture.onErrorObservable.notifyObservers({ message, exception });
                if (onError) {
                    onError(message, exception);
                }
            }
            else {
                // fall back to the original url if the transformed url fails to load
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn(`Failed to load ${url}, falling back to ${originalUrl}`);
                this._createTextureBase(originalUrl, noMipmap, texture.invertY, scene, samplingMode, onLoad, onError, prepareTexture, prepareTextureProcess, buffer, texture, format, forcedExtension, mimeType, loaderOptions, useSRGBBuffer);
            }
        };
        // processing for non-image formats
        if (loaderPromise) {
            const callback = async (data) => {
                const loader = await loaderPromise;
                loader.loadData(data, texture, (width, height, loadMipmap, isCompressed, done, loadFailed) => {
                    if (loadFailed) {
                        onInternalError("TextureLoader failed to load data");
                    }
                    else {
                        prepareTexture(texture, extension, scene, { width, height }, texture.invertY, !loadMipmap, isCompressed, () => {
                            done();
                            return false;
                        }, samplingMode);
                    }
                }, loaderOptions);
            };
            if (!buffer) {
                this._loadFile(url, (data) => callback(new Uint8Array(data)), undefined, scene ? scene.offlineProvider : undefined, true, (request, exception) => {
                    onInternalError("Unable to load " + (request ? request.responseURL : url, exception));
                });
            }
            else {
                if (buffer instanceof ArrayBuffer) {
                    callback(new Uint8Array(buffer));
                }
                else if (ArrayBuffer.isView(buffer)) {
                    callback(buffer);
                }
                else {
                    if (onError) {
                        onError("Unable to load: only ArrayBuffer or ArrayBufferView is supported", null);
                    }
                }
            }
        }
        else {
            const onload = (img) => {
                if (fromBlob && !this._doNotHandleContextLost) {
                    // We need to store the image if we need to rebuild the texture
                    // in case of a webgl context lost
                    texture._buffer = img;
                }
                prepareTexture(texture, extension, scene, img, texture.invertY, noMipmap, false, prepareTextureProcess, samplingMode);
            };
            // According to the WebGL spec section 6.10, ImageBitmaps must be inverted on creation.
            // So, we pass imageOrientation to _FileToolsLoadImage() as it may create an ImageBitmap.
            if (!fromData || isBase64) {
                if (buffer && (typeof buffer.decoding === "string" || buffer.close)) {
                    onload(buffer);
                }
                else {
                    AbstractEngine._FileToolsLoadImage(url || "", onload, onInternalError, scene ? scene.offlineProvider : null, mimeType, texture.invertY && this._features.needsInvertingBitmap ? { imageOrientation: "flipY" } : undefined);
                }
            }
            else if (typeof buffer === "string" || buffer instanceof ArrayBuffer || ArrayBuffer.isView(buffer) || buffer instanceof Blob) {
                AbstractEngine._FileToolsLoadImage(buffer, onload, onInternalError, scene ? scene.offlineProvider : null, mimeType, texture.invertY && this._features.needsInvertingBitmap ? { imageOrientation: "flipY" } : undefined);
            }
            else if (buffer) {
                onload(buffer);
            }
        }
        return texture;
    }
    _rebuildBuffers() {
        // Uniforms
        for (const uniformBuffer of this._uniformBuffers) {
            uniformBuffer._rebuildAfterContextLost();
        }
    }
    /** @internal */
    get _shouldUseHighPrecisionShader() {
        return !!(this._caps.highPrecisionShaderSupported && this._highPrecisionShadersAllowed);
    }
    /**
     * Gets host document
     * @returns the host document object
     */
    getHostDocument() {
        if (this._renderingCanvas && this._renderingCanvas.ownerDocument) {
            return this._renderingCanvas.ownerDocument;
        }
        return (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsDocumentAvailable */ .Nf)() ? document : null;
    }
    /**
     * Gets the list of loaded textures
     * @returns an array containing all loaded textures
     */
    getLoadedTexturesCache() {
        return this._internalTexturesCache;
    }
    /**
     * Clears the list of texture accessible through engine.
     * This can help preventing texture load conflict due to name collision.
     */
    clearInternalTexturesCache() {
        this._internalTexturesCache.length = 0;
    }
    /**
     * Gets the object containing all engine capabilities
     * @returns the EngineCapabilities object
     */
    getCaps() {
        return this._caps;
    }
    /**
     * Reset the texture cache to empty state
     */
    resetTextureCache() {
        for (const key in this._boundTexturesCache) {
            if (!Object.prototype.hasOwnProperty.call(this._boundTexturesCache, key)) {
                continue;
            }
            this._boundTexturesCache[key] = null;
        }
        this._currentTextureChannel = -1;
    }
    /**
     * Gets or sets the name of the engine
     */
    get name() {
        return this._name;
    }
    set name(value) {
        this._name = value;
    }
    /**
     * Returns the current npm package of the sdk
     */
    // Not mixed with Version for tooling purpose.
    static get NpmPackage() {
        return "babylonjs@7.37.0";
    }
    /**
     * Returns the current version of the framework
     */
    static get Version() {
        return "7.37.0";
    }
    /**
     * Gets the HTML canvas attached with the current webGL context
     * @returns a HTML canvas
     */
    getRenderingCanvas() {
        return this._renderingCanvas;
    }
    /**
     * Gets the audio context specified in engine initialization options
     * @returns an Audio Context
     */
    getAudioContext() {
        return this._audioContext;
    }
    /**
     * Gets the audio destination specified in engine initialization options
     * @returns an audio destination node
     */
    getAudioDestination() {
        return this._audioDestination;
    }
    /**
     * Defines the hardware scaling level.
     * By default the hardware scaling level is computed from the window device ratio.
     * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.
     * @param level defines the level to use
     */
    setHardwareScalingLevel(level) {
        this._hardwareScalingLevel = level;
        this.resize();
    }
    /**
     * Gets the current hardware scaling level.
     * By default the hardware scaling level is computed from the window device ratio.
     * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.
     * @returns a number indicating the current hardware scaling level
     */
    getHardwareScalingLevel() {
        return this._hardwareScalingLevel;
    }
    /**
     * Gets or sets a boolean indicating if resources should be retained to be able to handle context lost events
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#handling-webgl-context-lost
     */
    get doNotHandleContextLost() {
        return this._doNotHandleContextLost;
    }
    set doNotHandleContextLost(value) {
        this._doNotHandleContextLost = value;
    }
    /**
     * Returns true if the stencil buffer has been enabled through the creation option of the context.
     */
    get isStencilEnable() {
        return this._isStencilEnable;
    }
    /**
     * Gets the options used for engine creation
     * @returns EngineOptions object
     */
    getCreationOptions() {
        return this._creationOptions;
    }
    /**
     * Creates a new engine
     * @param antialias defines whether anti-aliasing should be enabled. If undefined, it means that the underlying engine is free to enable it or not
     * @param options defines further options to be sent to the creation context
     * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
     */
    constructor(antialias, options, adaptToDeviceRatio) {
        // States
        /** @internal */
        this._colorWrite = true;
        /** @internal */
        this._colorWriteChanged = true;
        /** @internal */
        this._depthCullingState = new _States_depthCullingState_js__WEBPACK_IMPORTED_MODULE_5__/* .DepthCullingState */ .N();
        /** @internal */
        this._stencilStateComposer = new _States_stencilStateComposer_js__WEBPACK_IMPORTED_MODULE_6__/* .StencilStateComposer */ .u();
        /** @internal */
        this._stencilState = new _States_stencilState_js__WEBPACK_IMPORTED_MODULE_7__/* .StencilState */ .K();
        /** @internal */
        this._alphaState = new _States_alphaCullingState_js__WEBPACK_IMPORTED_MODULE_8__/* .AlphaState */ .i();
        /** @internal */
        this._alphaMode = 1;
        /** @internal */
        this._alphaEquation = 0;
        this._activeRequests = [];
        /** @internal */
        this._badOS = false;
        /** @internal */
        this._badDesktopOS = false;
        this._compatibilityMode = true;
        /** @internal */
        this._internalTexturesCache = new Array();
        /** @internal */
        this._currentRenderTarget = null;
        /** @internal */
        this._boundTexturesCache = {};
        /** @internal */
        this._activeChannel = 0;
        /** @internal */
        this._currentTextureChannel = -1;
        /** @internal */
        this._viewportCached = { x: 0, y: 0, z: 0, w: 0 };
        /** @internal */
        this._isWebGPU = false;
        /**
         * Observable event triggered each time the canvas loses focus
         */
        this.onCanvasBlurObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Observable event triggered each time the canvas gains focus
         */
        this.onCanvasFocusObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Event raised when a new scene is created
         */
        this.onNewSceneAddedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Observable event triggered each time the rendering canvas is resized
         */
        this.onResizeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Observable event triggered each time the canvas receives pointerout event
         */
        this.onCanvasPointerOutObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Turn this value on if you want to pause FPS computation when in background
         */
        this.disablePerformanceMonitorInBackground = false;
        /**
         * Gets or sets a boolean indicating that vertex array object must be disabled even if they are supported
         */
        this.disableVertexArrayObjects = false;
        /** @internal */
        this._frameId = 0;
        /**
         * Gets information about the current host
         */
        this.hostInformation = {
            isMobile: false,
        };
        /**
         * Gets a boolean indicating if the engine is currently rendering in fullscreen mode
         */
        this.isFullscreen = false;
        /**
         * Gets or sets a boolean to enable/disable IndexedDB support and avoid XHR on .manifest
         **/
        this.enableOfflineSupport = false;
        /**
         * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (js will always consider the database is up to date)
         **/
        this.disableManifestCheck = false;
        /**
         * Gets or sets a boolean to enable/disable the context menu (right-click) from appearing on the main canvas
         */
        this.disableContextMenu = true;
        /**
         * Gets or sets the current render pass id
         */
        this.currentRenderPassId = 0;
        /**
         * Gets a boolean indicating if the pointer is currently locked
         */
        this.isPointerLock = false;
        /**
         * Gets the list of created postprocesses
         */
        this.postProcesses = [];
        /** Gets or sets the tab index to set to the rendering canvas. 1 is the minimum value to set to be able to capture keyboard events */
        this.canvasTabIndex = 1;
        /** @internal */
        this._contextWasLost = false;
        this._useReverseDepthBuffer = false;
        /**
         * Indicates if the z range in NDC space is 0..1 (value: true) or -1..1 (value: false)
         */
        this.isNDCHalfZRange = false;
        /**
         * Indicates that the origin of the texture/framebuffer space is the bottom left corner. If false, the origin is top left
         */
        this.hasOriginBottomLeft = true;
        /** @internal */
        this._renderTargetWrapperCache = new Array();
        /** @internal */
        this._compiledEffects = {};
        /** @internal */
        this._isDisposed = false;
        /**
         * Gets the list of created scenes
         */
        this.scenes = [];
        /** @internal */
        this._virtualScenes = new Array();
        /**
         * Observable event triggered before each texture is initialized
         */
        this.onBeforeTextureInitObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Gets or sets a boolean indicating if the engine must keep rendering even if the window is not in foreground
         */
        this.renderEvenInBackground = true;
        /**
         * Gets or sets a boolean indicating that cache can be kept between frames
         */
        this.preventCacheWipeBetweenFrames = false;
        /** @internal */
        this._frameHandler = 0;
        /** @internal */
        this._activeRenderLoops = new Array();
        /** @internal */
        this._windowIsBackground = false;
        /** @internal */
        this._boundRenderFunction = () => this._renderLoop();
        /**
         * Observable raised when the engine is about to compile a shader
         */
        this.onBeforeShaderCompilationObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Observable raised when the engine has just compiled a shader
         */
        this.onAfterShaderCompilationObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Observable raised when the engine begins a new frame
         */
        this.onBeginFrameObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Observable raised when the engine ends the current frame
         */
        this.onEndFrameObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /** @internal */
        this._transformTextureUrl = null;
        /** @internal */
        this._uniformBuffers = new Array();
        /** @internal */
        this._storageBuffers = new Array();
        this._highPrecisionShadersAllowed = true;
        // Lost context
        /**
         * Observable signaled when a context lost event is raised
         */
        this.onContextLostObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /**
         * Observable signaled when a context restored event is raised
         */
        this.onContextRestoredObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        /** @internal */
        this._name = "";
        /**
         * Defines whether the engine has been created with the premultipliedAlpha option on or not.
         */
        this.premultipliedAlpha = true;
        /**
         * If set to true zooming in and out in the browser will rescale the hardware-scaling correctly.
         */
        this.adaptToDeviceRatio = false;
        /** @internal */
        this._lastDevicePixelRatio = 1.0;
        /** @internal */
        this._doNotHandleContextLost = false;
        /**
         * Gets or sets a boolean indicating if back faces must be culled. If false, front faces are culled instead (true by default)
         * If non null, this takes precedence over the value from the material
         */
        this.cullBackFaces = null;
        /** @internal */
        this._renderPassNames = ["main"];
        // FPS
        this._fps = 60;
        this._deltaTime = 0;
        // Deterministic lockstepMaxSteps
        /** @internal */
        this._deterministicLockstep = false;
        /** @internal */
        this._lockstepMaxSteps = 4;
        /** @internal */
        this._timeStep = 1 / 60;
        /**
         * An event triggered when the engine is disposed.
         */
        this.onDisposeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_12__/* .Observable */ .cP();
        _engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.Instances.push(this);
        this.startTime = _Misc_precisionDate_js__WEBPACK_IMPORTED_MODULE_4__/* .PrecisionDate */ .j.Now;
        this._stencilStateComposer.stencilGlobal = this._stencilState;
        _performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_3__/* .PerformanceConfigurator */ .I.SetMatrixPrecision(!!options.useHighPrecisionMatrix);
        if ((0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsNavigatorAvailable */ .XD)() && navigator.userAgent) {
            // Detect if we are running on a faulty buggy OS.
            this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent);
            // Detect if we are running on a faulty buggy desktop OS.
            this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
        }
        // Save this off for use in resize().
        this.adaptToDeviceRatio = adaptToDeviceRatio ?? false;
        options.antialias = antialias ?? options.antialias;
        options.deterministicLockstep = options.deterministicLockstep ?? false;
        options.lockstepMaxSteps = options.lockstepMaxSteps ?? 4;
        options.timeStep = options.timeStep ?? 1 / 60;
        options.audioEngine = options.audioEngine ?? true;
        options.stencil = options.stencil ?? true;
        this._audioContext = options.audioEngineOptions?.audioContext ?? null;
        this._audioDestination = options.audioEngineOptions?.audioDestination ?? null;
        this.premultipliedAlpha = options.premultipliedAlpha ?? true;
        this._doNotHandleContextLost = !!options.doNotHandleContextLost;
        this._isStencilEnable = options.stencil ? true : false;
        this.useExactSrgbConversions = options.useExactSrgbConversions ?? false;
        const devicePixelRatio = (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsWindowObjectExist */ .BA)() ? window.devicePixelRatio || 1.0 : 1.0;
        const limitDeviceRatio = options.limitDeviceRatio || devicePixelRatio;
        // Viewport
        adaptToDeviceRatio = adaptToDeviceRatio || options.adaptToDeviceRatio || false;
        this._hardwareScalingLevel = adaptToDeviceRatio ? 1.0 / Math.min(limitDeviceRatio, devicePixelRatio) : 1.0;
        this._lastDevicePixelRatio = devicePixelRatio;
        this._creationOptions = options;
    }
    /**
     * Resize the view according to the canvas' size
     * @param forceSetSize true to force setting the sizes of the underlying canvas
     */
    resize(forceSetSize = false) {
        let width;
        let height;
        // Re-query hardware scaling level to handle zoomed-in resizing.
        if (this.adaptToDeviceRatio) {
            const devicePixelRatio = (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsWindowObjectExist */ .BA)() ? window.devicePixelRatio || 1.0 : 1.0;
            const changeRatio = this._lastDevicePixelRatio / devicePixelRatio;
            this._lastDevicePixelRatio = devicePixelRatio;
            this._hardwareScalingLevel *= changeRatio;
        }
        if ((0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsWindowObjectExist */ .BA)() && (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsDocumentAvailable */ .Nf)()) {
            // make sure it is a Node object, and is a part of the document.
            if (this._renderingCanvas) {
                const boundingRect = this._renderingCanvas.getBoundingClientRect
                    ? this._renderingCanvas.getBoundingClientRect()
                    : {
                        // fallback to last solution in case the function doesn't exist
                        width: this._renderingCanvas.width * this._hardwareScalingLevel,
                        height: this._renderingCanvas.height * this._hardwareScalingLevel,
                    };
                width = this._renderingCanvas.clientWidth || boundingRect.width || this._renderingCanvas.width || 100;
                height = this._renderingCanvas.clientHeight || boundingRect.height || this._renderingCanvas.height || 100;
            }
            else {
                width = window.innerWidth;
                height = window.innerHeight;
            }
        }
        else {
            width = this._renderingCanvas ? this._renderingCanvas.width : 100;
            height = this._renderingCanvas ? this._renderingCanvas.height : 100;
        }
        this.setSize(width / this._hardwareScalingLevel, height / this._hardwareScalingLevel, forceSetSize);
    }
    /**
     * Force a specific size of the canvas
     * @param width defines the new canvas' width
     * @param height defines the new canvas' height
     * @param forceSetSize true to force setting the sizes of the underlying canvas
     * @returns true if the size was changed
     */
    setSize(width, height, forceSetSize = false) {
        if (!this._renderingCanvas) {
            return false;
        }
        width = width | 0;
        height = height | 0;
        if (!forceSetSize && this._renderingCanvas.width === width && this._renderingCanvas.height === height) {
            return false;
        }
        this._renderingCanvas.width = width;
        this._renderingCanvas.height = height;
        if (this.scenes) {
            for (let index = 0; index < this.scenes.length; index++) {
                const scene = this.scenes[index];
                for (let camIndex = 0; camIndex < scene.cameras.length; camIndex++) {
                    const cam = scene.cameras[camIndex];
                    cam._currentRenderId = 0;
                }
            }
            if (this.onResizeObservable.hasObservers()) {
                this.onResizeObservable.notifyObservers(this);
            }
        }
        return true;
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Creates a raw texture
     * @param data defines the data to store in the texture
     * @param width defines the width of the texture
     * @param height defines the height of the texture
     * @param format defines the format of the data
     * @param generateMipMaps defines if the engine should generate the mip levels
     * @param invertY defines if data must be stored with Y axis inverted
     * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
     * @param compression defines the compression used (null by default)
     * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     * @returns the raw texture inside an InternalTexture
     */
    createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type, creationFlags, useSRGBBuffer) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("engine.rawTexture");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Creates a new raw cube texture
     * @param data defines the array of data to use to create each face
     * @param size defines the size of the textures
     * @param format defines the format of the data
     * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_BYTE)
     * @param generateMipMaps  defines if the engine should generate the mip levels
     * @param invertY defines if data must be stored with Y axis inverted
     * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
     * @param compression defines the compression used (null by default)
     * @returns the cube texture as an InternalTexture
     */
    createRawCubeTexture(data, size, format, type, generateMipMaps, invertY, samplingMode, compression) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("engine.rawTexture");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Creates a new raw 3D texture
     * @param data defines the data used to create the texture
     * @param width defines the width of the texture
     * @param height defines the height of the texture
     * @param depth defines the depth of the texture
     * @param format defines the format of the texture
     * @param generateMipMaps defines if the engine must generate mip levels
     * @param invertY defines if data must be stored with Y axis inverted
     * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
     * @param compression defines the compressed used (can be null)
     * @param textureType defines the compressed used (can be null)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @returns a new raw 3D texture (stored in an InternalTexture)
     */
    createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression, textureType, creationFlags) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("engine.rawTexture");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Creates a new raw 2D array texture
     * @param data defines the data used to create the texture
     * @param width defines the width of the texture
     * @param height defines the height of the texture
     * @param depth defines the number of layers of the texture
     * @param format defines the format of the texture
     * @param generateMipMaps defines if the engine must generate mip levels
     * @param invertY defines if data must be stored with Y axis inverted
     * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
     * @param compression defines the compressed used (can be null)
     * @param textureType defines the compressed used (can be null)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @returns a new raw 2D array texture (stored in an InternalTexture)
     */
    createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression, textureType, creationFlags) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("engine.rawTexture");
    }
    /**
     * Shared initialization across engines types.
     * @param canvas The canvas associated with this instance of the engine.
     */
    _sharedInit(canvas) {
        this._renderingCanvas = canvas;
    }
    _setupMobileChecks() {
        if (!(navigator && navigator.userAgent)) {
            return;
        }
        // Function to check if running on mobile device
        this._checkForMobile = () => {
            const currentUA = navigator.userAgent;
            this.hostInformation.isMobile =
                currentUA.indexOf("Mobile") !== -1 ||
                    // Needed for iOS 13+ detection on iPad (inspired by solution from https://stackoverflow.com/questions/9038625/detect-if-device-is-ios)
                    (currentUA.indexOf("Mac") !== -1 && (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsDocumentAvailable */ .Nf)() && "ontouchend" in document);
        };
        // Set initial isMobile value
        this._checkForMobile();
        // Set up event listener to check when window is resized (used to get emulator activation to work properly)
        if ((0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsWindowObjectExist */ .BA)()) {
            window.addEventListener("resize", this._checkForMobile);
        }
    }
    /**
     * creates and returns a new video element
     * @param constraints video constraints
     * @returns video element
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    createVideoElement(constraints) {
        return document.createElement("video");
    }
    /**
     * @internal
     */
    _reportDrawCall(numDrawCalls = 1) {
        this._drawCalls?.addCount(numDrawCalls, false);
    }
    /**
     * Gets the current framerate
     * @returns a number representing the framerate
     */
    getFps() {
        return this._fps;
    }
    /**
     * Gets the time spent between current and previous frame
     * @returns a number representing the delta time in ms
     */
    getDeltaTime() {
        return this._deltaTime;
    }
    /**
     * Gets a boolean indicating that the engine is running in deterministic lock step mode
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
     * @returns true if engine is in deterministic lock step mode
     */
    isDeterministicLockStep() {
        return this._deterministicLockstep;
    }
    /**
     * Gets the max steps when engine is running in deterministic lock step
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
     * @returns the max steps
     */
    getLockstepMaxSteps() {
        return this._lockstepMaxSteps;
    }
    /**
     * Returns the time in ms between steps when using deterministic lock step.
     * @returns time step in (ms)
     */
    getTimeStep() {
        return this._timeStep * 1000;
    }
    /**
     * Engine abstraction for loading and creating an image bitmap from a given source string.
     * @param imageSource source to load the image from.
     * @param options An object that sets options for the image's extraction.
     */
    _createImageBitmapFromSource(imageSource, options) {
        throw new Error("createImageBitmapFromSource is not implemented");
    }
    /**
     * Engine abstraction for createImageBitmap
     * @param image source for image
     * @param options An object that sets options for the image's extraction.
     * @returns ImageBitmap
     */
    createImageBitmap(image, options) {
        return createImageBitmap(image, options);
    }
    /**
     * Resize an image and returns the image data as an uint8array
     * @param image image to resize
     * @param bufferWidth destination buffer width
     * @param bufferHeight destination buffer height
     */
    resizeImageBitmap(image, bufferWidth, bufferHeight) {
        throw new Error("resizeImageBitmap is not implemented");
    }
    /**
     * Get Font size information
     * @param font font name
     */
    getFontOffset(font) {
        throw new Error("getFontOffset is not implemented");
    }
    static _CreateCanvas(width, height) {
        if (typeof document === "undefined") {
            return new OffscreenCanvas(width, height);
        }
        const canvas = document.createElement("canvas");
        canvas.width = width;
        canvas.height = height;
        return canvas;
    }
    /**
     * Create a canvas. This method is overridden by other engines
     * @param width width
     * @param height height
     * @returns ICanvas interface
     */
    createCanvas(width, height) {
        return AbstractEngine._CreateCanvas(width, height);
    }
    /**
     * Loads an image as an HTMLImageElement.
     * @param input url string, ArrayBuffer, or Blob to load
     * @param onLoad callback called when the image successfully loads
     * @param onError callback called when the image fails to load
     * @param offlineProvider offline provider for caching
     * @param mimeType optional mime type
     * @param imageBitmapOptions optional the options to use when creating an ImageBitmap
     * @returns the HTMLImageElement of the loaded image
     * @internal
     */
    static _FileToolsLoadImage(input, onLoad, onError, offlineProvider, mimeType, imageBitmapOptions) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("FileTools");
    }
    /**
     * @internal
     */
    _loadFile(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError) {
        const request = (0,_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_13__/* ._loadFile */ .W0)(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError);
        this._activeRequests.push(request);
        request.onCompleteObservable.add(() => {
            const index = this._activeRequests.indexOf(request);
            if (index !== -1) {
                this._activeRequests.splice(index, 1);
            }
        });
        return request;
    }
    /**
     * Loads a file from a url
     * @param url url to load
     * @param onSuccess callback called when the file successfully loads
     * @param onProgress callback called while file is loading (if the server supports this mode)
     * @param offlineProvider defines the offline provider for caching
     * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
     * @param onError callback called when the file fails to load
     * @returns a file request object
     * @internal
     */
    static _FileToolsLoadFile(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError) {
        if (_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_13__/* .EngineFunctionContext */ .sg.loadFile) {
            return _abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_13__/* .EngineFunctionContext */ .sg.loadFile(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError);
        }
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("FileTools");
    }
    /**
     * Dispose and release all associated resources
     */
    dispose() {
        this.releaseEffects();
        this._isDisposed = true;
        this.stopRenderLoop();
        // Empty texture
        if (this._emptyTexture) {
            this._releaseTexture(this._emptyTexture);
            this._emptyTexture = null;
        }
        if (this._emptyCubeTexture) {
            this._releaseTexture(this._emptyCubeTexture);
            this._emptyCubeTexture = null;
        }
        this._renderingCanvas = null;
        // Clear observables
        if (this.onBeforeTextureInitObservable) {
            this.onBeforeTextureInitObservable.clear();
        }
        // Release postProcesses
        while (this.postProcesses.length) {
            this.postProcesses[0].dispose();
        }
        // Release scenes
        while (this.scenes.length) {
            this.scenes[0].dispose();
        }
        while (this._virtualScenes.length) {
            this._virtualScenes[0].dispose();
        }
        // Release effects
        this.releaseComputeEffects?.();
        _Materials_effect_js__WEBPACK_IMPORTED_MODULE_2__/* .Effect */ .M.ResetCache();
        // Abort active requests
        for (const request of this._activeRequests) {
            request.abort();
        }
        this._boundRenderFunction = null;
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
        this.onResizeObservable.clear();
        this.onCanvasBlurObservable.clear();
        this.onCanvasFocusObservable.clear();
        this.onCanvasPointerOutObservable.clear();
        this.onNewSceneAddedObservable.clear();
        if ((0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_11__/* .IsWindowObjectExist */ .BA)()) {
            window.removeEventListener("resize", this._checkForMobile);
        }
        // Remove from Instances
        const index = _engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.Instances.indexOf(this);
        if (index >= 0) {
            _engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.Instances.splice(index, 1);
        }
        // no more engines left in the engine store? Notify!
        if (!_engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.Instances.length) {
            _engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.OnEnginesDisposedObservable.notifyObservers(this);
            _engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.OnEnginesDisposedObservable.clear();
        }
        // Observables
        this.onBeginFrameObservable.clear();
        this.onEndFrameObservable.clear();
    }
    /**
     * Method called to create the default loading screen.
     * This can be overridden in your own app.
     * @param canvas The rendering canvas element
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static DefaultLoadingScreenFactory(canvas) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_9__/* ._WarnImport */ .n)("LoadingScreen");
    }
    /**
     * Will flag all materials in all scenes in all engines as dirty to trigger new shader compilation
     * @param flag defines which part of the materials must be marked as dirty
     * @param predicate defines a predicate used to filter which materials should be affected
     */
    static MarkAllMaterialsAsDirty(flag, predicate) {
        for (let engineIndex = 0; engineIndex < _engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.Instances.length; engineIndex++) {
            const engine = _engineStore_js__WEBPACK_IMPORTED_MODULE_0__/* .EngineStore */ .q.Instances[engineIndex];
            for (let sceneIndex = 0; sceneIndex < engine.scenes.length; sceneIndex++) {
                engine.scenes[sceneIndex].markAllMaterialsAsDirty(flag, predicate);
            }
        }
    }
}
// eslint-disable-next-line @typescript-eslint/naming-convention
/** @internal */
AbstractEngine._RenderPassIdCounter = 0;
/**
 * Method called to create the default rescale post process on each engine.
 */
AbstractEngine._RescalePostProcessFactory = null;
// Updatable statics so stick with vars here
/**
 * Gets or sets the epsilon value used by collision engine
 */
AbstractEngine.CollisionsEpsilon = 0.001;
/**
 * Queue a new function into the requested animation frame pool (ie. this function will be executed by the browser (or the javascript engine) for the next frame)
 * @param func - the function to be called
 * @param requester - the object that will request the next frame. Falls back to window.
 * @returns frame number
 */
AbstractEngine.QueueNewFrame = QueueNewFrame;
//# sourceMappingURL=abstractEngine.js.map

/***/ }),

/***/ 96125:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Y: () => (/* binding */ Constants)
/* harmony export */ });
/* eslint-disable @typescript-eslint/naming-convention */
/** Defines the cross module used constants to avoid circular dependencies */
class Constants {
}
/** Sampler suffix when associated with a texture name */
Constants.AUTOSAMPLERSUFFIX = "Sampler";
/** Flag used to disable diagnostics for WebGPU */
Constants.DISABLEUA = "#define DISABLE_UNIFORMITY_ANALYSIS";
/** Defines that alpha blending is disabled */
Constants.ALPHA_DISABLE = 0;
/** Defines that alpha blending is SRC ALPHA * SRC + DEST */
Constants.ALPHA_ADD = 1;
/** Defines that alpha blending is SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
Constants.ALPHA_COMBINE = 2;
/** Defines that alpha blending is DEST - SRC * DEST */
Constants.ALPHA_SUBTRACT = 3;
/** Defines that alpha blending is SRC * DEST */
Constants.ALPHA_MULTIPLY = 4;
/** Defines that alpha blending is SRC ALPHA * SRC + (1 - SRC) * DEST */
Constants.ALPHA_MAXIMIZED = 5;
/** Defines that alpha blending is SRC + DEST */
Constants.ALPHA_ONEONE = 6;
/** Defines that alpha blending is SRC + (1 - SRC ALPHA) * DEST */
Constants.ALPHA_PREMULTIPLIED = 7;
/**
 * Defines that alpha blending is SRC + (1 - SRC ALPHA) * DEST
 * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
 */
Constants.ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
/** Defines that alpha blending is CST * SRC + (1 - CST) * DEST */
Constants.ALPHA_INTERPOLATE = 9;
/**
 * Defines that alpha blending is SRC + (1 - SRC) * DEST
 * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
 */
Constants.ALPHA_SCREENMODE = 10;
/**
 * Defines that alpha blending is SRC + DST
 * Alpha will be set to SRC ALPHA + DST ALPHA
 */
Constants.ALPHA_ONEONE_ONEONE = 11;
/**
 * Defines that alpha blending is SRC * DST ALPHA + DST
 * Alpha will be set to 0
 */
Constants.ALPHA_ALPHATOCOLOR = 12;
/**
 * Defines that alpha blending is SRC * (1 - DST) + DST * (1 - SRC)
 */
Constants.ALPHA_REVERSEONEMINUS = 13;
/**
 * Defines that alpha blending is SRC + DST * (1 - SRC ALPHA)
 * Alpha will be set to SRC ALPHA + DST ALPHA * (1 - SRC ALPHA)
 */
Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA = 14;
/**
 * Defines that alpha blending is SRC + DST
 * Alpha will be set to SRC ALPHA
 */
Constants.ALPHA_ONEONE_ONEZERO = 15;
/**
 * Defines that alpha blending is SRC * (1 - DST) + DST * (1 - SRC)
 * Alpha will be set to DST ALPHA
 */
Constants.ALPHA_EXCLUSION = 16;
/**
 * Defines that alpha blending is SRC * SRC ALPHA + DST * (1 - SRC ALPHA)
 * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DST ALPHA
 */
Constants.ALPHA_LAYER_ACCUMULATE = 17;
/** Defines that alpha blending equation a SUM */
Constants.ALPHA_EQUATION_ADD = 0;
/** Defines that alpha blending equation a SUBSTRACTION */
Constants.ALPHA_EQUATION_SUBSTRACT = 1;
/** Defines that alpha blending equation a REVERSE SUBSTRACTION */
Constants.ALPHA_EQUATION_REVERSE_SUBTRACT = 2;
/** Defines that alpha blending equation a MAX operation */
Constants.ALPHA_EQUATION_MAX = 3;
/** Defines that alpha blending equation a MIN operation */
Constants.ALPHA_EQUATION_MIN = 4;
/**
 * Defines that alpha blending equation a DARKEN operation:
 * It takes the min of the src and sums the alpha channels.
 */
Constants.ALPHA_EQUATION_DARKEN = 5;
/** Defines that the resource is not delayed*/
Constants.DELAYLOADSTATE_NONE = 0;
/** Defines that the resource was successfully delay loaded */
Constants.DELAYLOADSTATE_LOADED = 1;
/** Defines that the resource is currently delay loading */
Constants.DELAYLOADSTATE_LOADING = 2;
/** Defines that the resource is delayed and has not started loading */
Constants.DELAYLOADSTATE_NOTLOADED = 4;
// Depth or Stencil test Constants.
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
Constants.NEVER = 0x0200;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
Constants.ALWAYS = 0x0207;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
Constants.LESS = 0x0201;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
Constants.EQUAL = 0x0202;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
Constants.LEQUAL = 0x0203;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
Constants.GREATER = 0x0204;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
Constants.GEQUAL = 0x0206;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
Constants.NOTEQUAL = 0x0205;
// Stencil Actions Constants.
/** Passed to stencilOperation to specify that stencil value must be kept */
Constants.KEEP = 0x1e00;
/** Passed to stencilOperation to specify that stencil value must be zero */
Constants.ZERO = 0x0000;
/** Passed to stencilOperation to specify that stencil value must be replaced */
Constants.REPLACE = 0x1e01;
/** Passed to stencilOperation to specify that stencil value must be incremented */
Constants.INCR = 0x1e02;
/** Passed to stencilOperation to specify that stencil value must be decremented */
Constants.DECR = 0x1e03;
/** Passed to stencilOperation to specify that stencil value must be inverted */
Constants.INVERT = 0x150a;
/** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
Constants.INCR_WRAP = 0x8507;
/** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
Constants.DECR_WRAP = 0x8508;
/** Texture is not repeating outside of 0..1 UVs */
Constants.TEXTURE_CLAMP_ADDRESSMODE = 0;
/** Texture is repeating outside of 0..1 UVs */
Constants.TEXTURE_WRAP_ADDRESSMODE = 1;
/** Texture is repeating and mirrored */
Constants.TEXTURE_MIRROR_ADDRESSMODE = 2;
/** Flag to create a storage texture */
Constants.TEXTURE_CREATIONFLAG_STORAGE = 1;
/** ALPHA */
Constants.TEXTUREFORMAT_ALPHA = 0;
/** LUMINANCE */
Constants.TEXTUREFORMAT_LUMINANCE = 1;
/** LUMINANCE_ALPHA */
Constants.TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
/** RGB */
Constants.TEXTUREFORMAT_RGB = 4;
/** RGBA */
Constants.TEXTUREFORMAT_RGBA = 5;
/** RED */
Constants.TEXTUREFORMAT_RED = 6;
/** RED (2nd reference) */
Constants.TEXTUREFORMAT_R = 6;
/** RED unsigned short normed to [0, 1] **/
Constants.TEXTUREFORMAT_R16_UNORM = 0x822a;
/** RG unsigned short normed to [0, 1] **/
Constants.TEXTUREFORMAT_RG16_UNORM = 0x822c;
/** RGB unsigned short normed to [0, 1] **/
Constants.TEXTUREFORMAT_RGB16_UNORM = 0x8054;
/** RGBA unsigned short normed to [0, 1] **/
Constants.TEXTUREFORMAT_RGBA16_UNORM = 0x805b;
/** RED signed short normed to [-1, 1] **/
Constants.TEXTUREFORMAT_R16_SNORM = 0x8f98;
/** RG signed short normed to [-1, 1] **/
Constants.TEXTUREFORMAT_RG16_SNORM = 0x8f99;
/** RGB signed short normed to [-1, 1] **/
Constants.TEXTUREFORMAT_RGB16_SNORM = 0x8f9a;
/** RGBA signed short normed to [-1, 1] **/
Constants.TEXTUREFORMAT_RGBA16_SNORM = 0x8f9b;
/** RG */
Constants.TEXTUREFORMAT_RG = 7;
/** RED_INTEGER */
Constants.TEXTUREFORMAT_RED_INTEGER = 8;
/** RED_INTEGER (2nd reference) */
Constants.TEXTUREFORMAT_R_INTEGER = 8;
/** RG_INTEGER */
Constants.TEXTUREFORMAT_RG_INTEGER = 9;
/** RGB_INTEGER */
Constants.TEXTUREFORMAT_RGB_INTEGER = 10;
/** RGBA_INTEGER */
Constants.TEXTUREFORMAT_RGBA_INTEGER = 11;
/** BGRA */
Constants.TEXTUREFORMAT_BGRA = 12;
/** Depth 24 bits + Stencil 8 bits */
Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 = 13;
/** Depth 32 bits float */
Constants.TEXTUREFORMAT_DEPTH32_FLOAT = 14;
/** Depth 16 bits */
Constants.TEXTUREFORMAT_DEPTH16 = 15;
/** Depth 24 bits */
Constants.TEXTUREFORMAT_DEPTH24 = 16;
/** Depth 24 bits unorm + Stencil 8 bits */
Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8 = 17;
/** Depth 32 bits float + Stencil 8 bits */
Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8 = 18;
/** Stencil 8 bits */
Constants.TEXTUREFORMAT_STENCIL8 = 19;
/** UNDEFINED */
Constants.TEXTUREFORMAT_UNDEFINED = 0xffffffff;
/** Compressed BC7 */
Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM = 36492;
/** Compressed BC7 (SRGB) */
Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 36493;
/** Compressed BC6 unsigned float */
Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 36495;
/** Compressed BC6 signed float */
Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 36494;
/** Compressed BC3 */
Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5 = 33779;
/** Compressed BC3 (SRGB) */
Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919;
/** Compressed BC2 */
Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3 = 33778;
/** Compressed BC2 (SRGB) */
Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918;
/** Compressed BC1 (RGBA) */
Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1 = 33777;
/** Compressed BC1 (RGB) */
Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1 = 33776;
/** Compressed BC1 (SRGB+A) */
Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917;
/** Compressed BC1 (SRGB) */
Constants.TEXTUREFORMAT_COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916;
/** Compressed ASTC 4x4 */
Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4 = 37808;
/** Compressed ASTC 4x4 (SRGB) */
Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840;
/** Compressed ETC1 (RGB) */
Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL = 36196;
/** Compressed ETC2 (RGB) */
Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2 = 37492;
/** Compressed ETC2 (SRGB) */
Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ETC2 = 37493;
/** Compressed ETC2 (RGB+A1) */
Constants.TEXTUREFORMAT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494;
/** Compressed ETC2 (SRGB+A1)*/
Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495;
/** Compressed ETC2 (RGB+A) */
Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC = 37496;
/** Compressed ETC2 (SRGB+1) */
Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497;
/** UNSIGNED_BYTE */
Constants.TEXTURETYPE_UNSIGNED_BYTE = 0;
/** @deprecated use more explicit TEXTURETYPE_UNSIGNED_BYTE instead. Use TEXTURETYPE_UNSIGNED_INTEGER for 32bits values.*/
Constants.TEXTURETYPE_UNSIGNED_INT = 0;
/** FLOAT */
Constants.TEXTURETYPE_FLOAT = 1;
/** HALF_FLOAT */
Constants.TEXTURETYPE_HALF_FLOAT = 2;
/** BYTE */
Constants.TEXTURETYPE_BYTE = 3;
/** SHORT */
Constants.TEXTURETYPE_SHORT = 4;
/** UNSIGNED_SHORT */
Constants.TEXTURETYPE_UNSIGNED_SHORT = 5;
/** INT */
Constants.TEXTURETYPE_INT = 6;
/** UNSIGNED_INT */
Constants.TEXTURETYPE_UNSIGNED_INTEGER = 7;
/** UNSIGNED_SHORT_4_4_4_4 */
Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8;
/** UNSIGNED_SHORT_5_5_5_1 */
Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9;
/** UNSIGNED_SHORT_5_6_5 */
Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10;
/** UNSIGNED_INT_2_10_10_10_REV */
Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11;
/** UNSIGNED_INT_24_8 */
Constants.TEXTURETYPE_UNSIGNED_INT_24_8 = 12;
/** UNSIGNED_INT_10F_11F_11F_REV */
Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13;
/** UNSIGNED_INT_5_9_9_9_REV */
Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14;
/** FLOAT_32_UNSIGNED_INT_24_8_REV */
Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15;
/** UNDEFINED */
Constants.TEXTURETYPE_UNDEFINED = 16;
/** 2D Texture target*/
Constants.TEXTURE_2D = 3553;
/** 2D Array Texture target */
Constants.TEXTURE_2D_ARRAY = 35866;
/** Cube Map Texture target */
Constants.TEXTURE_CUBE_MAP = 34067;
/** Cube Map Array Texture target */
Constants.TEXTURE_CUBE_MAP_ARRAY = 0xdeadbeef;
/** 3D Texture target */
Constants.TEXTURE_3D = 32879;
/** nearest is mag = nearest and min = nearest and no mip */
Constants.TEXTURE_NEAREST_SAMPLINGMODE = 1;
/** mag = nearest and min = nearest and mip = none */
Constants.TEXTURE_NEAREST_NEAREST = 1;
/** Bilinear is mag = linear and min = linear and no mip */
Constants.TEXTURE_BILINEAR_SAMPLINGMODE = 2;
/** mag = linear and min = linear and mip = none */
Constants.TEXTURE_LINEAR_LINEAR = 2;
/** Trilinear is mag = linear and min = linear and mip = linear */
Constants.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
/** Trilinear is mag = linear and min = linear and mip = linear */
Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
/** mag = nearest and min = nearest and mip = nearest */
Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;
/** mag = nearest and min = linear and mip = nearest */
Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;
/** mag = nearest and min = linear and mip = linear */
Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
/** mag = nearest and min = linear and mip = none */
Constants.TEXTURE_NEAREST_LINEAR = 7;
/** nearest is mag = nearest and min = nearest and mip = linear */
Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8;
/** mag = linear and min = nearest and mip = nearest */
Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
/** mag = linear and min = nearest and mip = linear */
Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
/** Bilinear is mag = linear and min = linear and mip = nearest */
Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11;
/** mag = linear and min = nearest and mip = none */
Constants.TEXTURE_LINEAR_NEAREST = 12;
/** Explicit coordinates mode */
Constants.TEXTURE_EXPLICIT_MODE = 0;
/** Spherical coordinates mode */
Constants.TEXTURE_SPHERICAL_MODE = 1;
/** Planar coordinates mode */
Constants.TEXTURE_PLANAR_MODE = 2;
/** Cubic coordinates mode */
Constants.TEXTURE_CUBIC_MODE = 3;
/** Projection coordinates mode */
Constants.TEXTURE_PROJECTION_MODE = 4;
/** Skybox coordinates mode */
Constants.TEXTURE_SKYBOX_MODE = 5;
/** Inverse Cubic coordinates mode */
Constants.TEXTURE_INVCUBIC_MODE = 6;
/** Equirectangular coordinates mode */
Constants.TEXTURE_EQUIRECTANGULAR_MODE = 7;
/** Equirectangular Fixed coordinates mode */
Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;
/** Equirectangular Fixed Mirrored coordinates mode */
Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
/** Offline (baking) quality for texture filtering */
Constants.TEXTURE_FILTERING_QUALITY_OFFLINE = 4096;
/** High quality for texture filtering */
Constants.TEXTURE_FILTERING_QUALITY_HIGH = 64;
/** Medium quality for texture filtering */
Constants.TEXTURE_FILTERING_QUALITY_MEDIUM = 16;
/** Low quality for texture filtering */
Constants.TEXTURE_FILTERING_QUALITY_LOW = 8;
// Texture rescaling mode
/** Defines that texture rescaling will use a floor to find the closer power of 2 size */
Constants.SCALEMODE_FLOOR = 1;
/** Defines that texture rescaling will look for the nearest power of 2 size */
Constants.SCALEMODE_NEAREST = 2;
/** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
Constants.SCALEMODE_CEILING = 3;
/**
 * The dirty texture flag value
 */
Constants.MATERIAL_TextureDirtyFlag = 1;
/**
 * The dirty light flag value
 */
Constants.MATERIAL_LightDirtyFlag = 2;
/**
 * The dirty fresnel flag value
 */
Constants.MATERIAL_FresnelDirtyFlag = 4;
/**
 * The dirty attribute flag value
 */
Constants.MATERIAL_AttributesDirtyFlag = 8;
/**
 * The dirty misc flag value
 */
Constants.MATERIAL_MiscDirtyFlag = 16;
/**
 * The dirty prepass flag value
 */
Constants.MATERIAL_PrePassDirtyFlag = 32;
/**
 * The all dirty flag value
 */
Constants.MATERIAL_AllDirtyFlag = 63;
/**
 * Returns the triangle fill mode
 */
Constants.MATERIAL_TriangleFillMode = 0;
/**
 * Returns the wireframe mode
 */
Constants.MATERIAL_WireFrameFillMode = 1;
/**
 * Returns the point fill mode
 */
Constants.MATERIAL_PointFillMode = 2;
/**
 * Returns the point list draw mode
 */
Constants.MATERIAL_PointListDrawMode = 3;
/**
 * Returns the line list draw mode
 */
Constants.MATERIAL_LineListDrawMode = 4;
/**
 * Returns the line loop draw mode
 */
Constants.MATERIAL_LineLoopDrawMode = 5;
/**
 * Returns the line strip draw mode
 */
Constants.MATERIAL_LineStripDrawMode = 6;
/**
 * Returns the triangle strip draw mode
 */
Constants.MATERIAL_TriangleStripDrawMode = 7;
/**
 * Returns the triangle fan draw mode
 */
Constants.MATERIAL_TriangleFanDrawMode = 8;
/**
 * Stores the clock-wise side orientation
 */
Constants.MATERIAL_ClockWiseSideOrientation = 0;
/**
 * Stores the counter clock-wise side orientation
 */
Constants.MATERIAL_CounterClockWiseSideOrientation = 1;
/**
 * Nothing
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_NothingTrigger = 0;
/**
 * On pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnPickTrigger = 1;
/**
 * On left pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnLeftPickTrigger = 2;
/**
 * On right pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnRightPickTrigger = 3;
/**
 * On center pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnCenterPickTrigger = 4;
/**
 * On pick down
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnPickDownTrigger = 5;
/**
 * On double pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnDoublePickTrigger = 6;
/**
 * On pick up
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnPickUpTrigger = 7;
/**
 * On pick out.
 * This trigger will only be raised if you also declared a OnPickDown
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnPickOutTrigger = 16;
/**
 * On long press
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnLongPressTrigger = 8;
/**
 * On pointer over
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnPointerOverTrigger = 9;
/**
 * On pointer out
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnPointerOutTrigger = 10;
/**
 * On every frame
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnEveryFrameTrigger = 11;
/**
 * On intersection enter
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnIntersectionEnterTrigger = 12;
/**
 * On intersection exit
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnIntersectionExitTrigger = 13;
/**
 * On key down
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnKeyDownTrigger = 14;
/**
 * On key up
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
Constants.ACTION_OnKeyUpTrigger = 15;
/**
 * Billboard mode will only apply to Y axis
 */
Constants.PARTICLES_BILLBOARDMODE_Y = 2;
/**
 * Billboard mode will apply to all axes
 */
Constants.PARTICLES_BILLBOARDMODE_ALL = 7;
/**
 * Special billboard mode where the particle will be biilboard to the camera but rotated to align with direction
 */
Constants.PARTICLES_BILLBOARDMODE_STRETCHED = 8;
/**
 * Special billboard mode where the particle will be billboard to the camera but only around the axis of the direction of particle emission
 */
Constants.PARTICLES_BILLBOARDMODE_STRETCHED_LOCAL = 9;
/** Default culling strategy : this is an exclusion test and it's the more accurate.
 *  Test order :
 *  Is the bounding sphere outside the frustum ?
 *  If not, are the bounding box vertices outside the frustum ?
 *  It not, then the cullable object is in the frustum.
 */
Constants.MESHES_CULLINGSTRATEGY_STANDARD = 0;
/** Culling strategy : Bounding Sphere Only.
 *  This is an exclusion test. It's faster than the standard strategy because the bounding box is not tested.
 *  It's also less accurate than the standard because some not visible objects can still be selected.
 *  Test : is the bounding sphere outside the frustum ?
 *  If not, then the cullable object is in the frustum.
 */
Constants.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1;
/** Culling strategy : Optimistic Inclusion.
 *  This in an inclusion test first, then the standard exclusion test.
 *  This can be faster when a cullable object is expected to be almost always in the camera frustum.
 *  This could also be a little slower than the standard test when the tested object center is not the frustum but one of its bounding box vertex is still inside.
 *  Anyway, it's as accurate as the standard strategy.
 *  Test :
 *  Is the cullable object bounding sphere center in the frustum ?
 *  If not, apply the default culling strategy.
 */
Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2;
/** Culling strategy : Optimistic Inclusion then Bounding Sphere Only.
 *  This in an inclusion test first, then the bounding sphere only exclusion test.
 *  This can be the fastest test when a cullable object is expected to be almost always in the camera frustum.
 *  This could also be a little slower than the BoundingSphereOnly strategy when the tested object center is not in the frustum but its bounding sphere still intersects it.
 *  It's less accurate than the standard strategy and as accurate as the BoundingSphereOnly strategy.
 *  Test :
 *  Is the cullable object bounding sphere center in the frustum ?
 *  If not, apply the Bounding Sphere Only strategy. No Bounding Box is tested here.
 */
Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3;
/**
 * No logging while loading
 */
Constants.SCENELOADER_NO_LOGGING = 0;
/**
 * Minimal logging while loading
 */
Constants.SCENELOADER_MINIMAL_LOGGING = 1;
/**
 * Summary logging while loading
 */
Constants.SCENELOADER_SUMMARY_LOGGING = 2;
/**
 * Detailed logging while loading
 */
Constants.SCENELOADER_DETAILED_LOGGING = 3;
/**
 * Constant used to retrieve the irradiance texture index in the textures array in the prepass
 * using getIndex(Constants.PREPASS_IRRADIANCE_TEXTURE_TYPE)
 */
Constants.PREPASS_IRRADIANCE_TEXTURE_TYPE = 0;
/**
 * Constant used to retrieve the position texture index in the textures array in the prepass
 * using getIndex(Constants.PREPASS_POSITION_TEXTURE_INDEX)
 */
Constants.PREPASS_POSITION_TEXTURE_TYPE = 1;
/**
 * Constant used to retrieve the velocity texture index in the textures array in the prepass
 * using getIndex(Constants.PREPASS_VELOCITY_TEXTURE_TYPE)
 */
Constants.PREPASS_VELOCITY_TEXTURE_TYPE = 2;
/**
 * Constant used to retrieve the reflectivity texture index in the textures array in the prepass
 * using the getIndex(Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE)
 */
Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE = 3;
/**
 * Constant used to retrieve the lit color texture index in the textures array in the prepass
 * using the getIndex(Constants.PREPASS_COLOR_TEXTURE_TYPE)
 */
Constants.PREPASS_COLOR_TEXTURE_TYPE = 4;
/**
 * Constant used to retrieve depth index in the textures array in the prepass
 * using the getIndex(Constants.PREPASS_DEPTH_TEXTURE_TYPE)
 */
Constants.PREPASS_DEPTH_TEXTURE_TYPE = 5;
/**
 * Constant used to retrieve normal index in the textures array in the prepass
 * using the getIndex(Constants.PREPASS_NORMAL_TEXTURE_TYPE)
 */
Constants.PREPASS_NORMAL_TEXTURE_TYPE = 6;
/**
 * Constant used to retrieve (sqrt) albedo index in the textures array in the prepass
 * using the getIndex(Constants.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE)
 */
Constants.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE = 7;
/**
 * Constant used to retrieve world normal index in the textures array in the prepass
 * using the getIndex(Constants.PREPASS_WORLD_NORMAL_TEXTURE_TYPE)
 */
Constants.PREPASS_WORLD_NORMAL_TEXTURE_TYPE = 8;
/**
 * Constant used to retrieve the local position texture index in the textures array in the prepass
 * using getIndex(Constants.PREPASS_LOCAL_POSITION_TEXTURE_TYPE)
 */
Constants.PREPASS_LOCAL_POSITION_TEXTURE_TYPE = 9;
/**
 * Constant used to retrieve screen-space (non-linear) depth index in the textures array in the prepass
 * using the getIndex(Constants.PREPASS_SCREENSPACE_DEPTH_TEXTURE_TYPE)
 */
Constants.PREPASS_SCREENSPACE_DEPTH_TEXTURE_TYPE = 10;
/**
 * Constant used to retrieve the velocity texture index in the textures array in the prepass
 * using getIndex(Constants.PREPASS_VELOCITY_LINEAR_TEXTURE_TYPE)
 */
Constants.PREPASS_VELOCITY_LINEAR_TEXTURE_TYPE = 11;
/**
 * Constant used to retrieve albedo index in the textures array in the prepass
 * using the getIndex(Constants.PREPASS_ALBEDO_TEXTURE_TYPE)
 */
Constants.PREPASS_ALBEDO_TEXTURE_TYPE = 12;
/** Flag to create a readable buffer (the buffer can be the source of a copy) */
Constants.BUFFER_CREATIONFLAG_READ = 1;
/** Flag to create a writable buffer (the buffer can be the destination of a copy) */
Constants.BUFFER_CREATIONFLAG_WRITE = 2;
/** Flag to create a readable and writable buffer */
Constants.BUFFER_CREATIONFLAG_READWRITE = 3;
/** Flag to create a buffer suitable to be used as a uniform buffer */
Constants.BUFFER_CREATIONFLAG_UNIFORM = 4;
/** Flag to create a buffer suitable to be used as a vertex buffer */
Constants.BUFFER_CREATIONFLAG_VERTEX = 8;
/** Flag to create a buffer suitable to be used as an index buffer */
Constants.BUFFER_CREATIONFLAG_INDEX = 16;
/** Flag to create a buffer suitable to be used as a storage buffer */
Constants.BUFFER_CREATIONFLAG_STORAGE = 32;
/** Flag to create a buffer suitable to be used for indirect calls, such as `dispatchIndirect` */
Constants.BUFFER_CREATIONFLAG_INDIRECT = 64;
/**
 * Prefixes used by the engine for sub mesh draw wrappers
 */
/** @internal */
Constants.RENDERPASS_MAIN = 0;
/**
 * Constant used as key code for Alt key
 */
Constants.INPUT_ALT_KEY = 18;
/**
 * Constant used as key code for Ctrl key
 */
Constants.INPUT_CTRL_KEY = 17;
/**
 * Constant used as key code for Meta key (Left Win, Left Cmd)
 */
Constants.INPUT_META_KEY1 = 91;
/**
 * Constant used as key code for Meta key (Right Win)
 */
Constants.INPUT_META_KEY2 = 92;
/**
 * Constant used as key code for Meta key (Right Win, Right Cmd)
 */
Constants.INPUT_META_KEY3 = 93;
/**
 * Constant used as key code for Shift key
 */
Constants.INPUT_SHIFT_KEY = 16;
/** Standard snapshot rendering. In this mode, some form of dynamic behavior is possible (for eg, uniform buffers are still updated) */
Constants.SNAPSHOTRENDERING_STANDARD = 0;
/** Fast snapshot rendering. In this mode, everything is static and only some limited form of dynamic behaviour is possible */
Constants.SNAPSHOTRENDERING_FAST = 1;
/**
 * This is the default projection mode used by the cameras.
 * It helps recreating a feeling of perspective and better appreciate depth.
 * This is the best way to simulate real life cameras.
 */
Constants.PERSPECTIVE_CAMERA = 0;
/**
 * This helps creating camera with an orthographic mode.
 * Orthographic is commonly used in engineering as a means to produce object specifications that communicate dimensions unambiguously, each line of 1 unit length (cm, meter..whatever) will appear to have the same length everywhere on the drawing. This allows the drafter to dimension only a subset of lines and let the reader know that other lines of that length on the drawing are also that length in reality. Every parallel line in the drawing is also parallel in the object.
 */
Constants.ORTHOGRAPHIC_CAMERA = 1;
/**
 * This is the default FOV mode for perspective cameras.
 * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.
 */
Constants.FOVMODE_VERTICAL_FIXED = 0;
/**
 * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.
 */
Constants.FOVMODE_HORIZONTAL_FIXED = 1;
/**
 * This specifies there is no need for a camera rig.
 * Basically only one eye is rendered corresponding to the camera.
 */
Constants.RIG_MODE_NONE = 0;
/**
 * Simulates a camera Rig with one blue eye and one red eye.
 * This can be use with 3d blue and red glasses.
 */
Constants.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10;
/**
 * Defines that both eyes of the camera will be rendered side by side with a parallel target.
 */
Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11;
/**
 * Defines that both eyes of the camera will be rendered side by side with a none parallel target.
 */
Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12;
/**
 * Defines that both eyes of the camera will be rendered over under each other.
 */
Constants.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13;
/**
 * Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.
 */
Constants.RIG_MODE_STEREOSCOPIC_INTERLACED = 14;
/**
 * Defines that both eyes of the camera should be renderered in a VR mode (carbox).
 */
Constants.RIG_MODE_VR = 20;
/**
 * Custom rig mode allowing rig cameras to be populated manually with any number of cameras
 */
Constants.RIG_MODE_CUSTOM = 22;
/**
 * Maximum number of uv sets supported
 */
Constants.MAX_SUPPORTED_UV_SETS = 6;
/**
 * GL constants
 */
/** Alpha blend equation: ADD */
Constants.GL_ALPHA_EQUATION_ADD = 0x8006;
/** Alpha equation: MIN */
Constants.GL_ALPHA_EQUATION_MIN = 0x8007;
/** Alpha equation: MAX */
Constants.GL_ALPHA_EQUATION_MAX = 0x8008;
/** Alpha equation: SUBTRACT */
Constants.GL_ALPHA_EQUATION_SUBTRACT = 0x800a;
/** Alpha equation: REVERSE_SUBTRACT */
Constants.GL_ALPHA_EQUATION_REVERSE_SUBTRACT = 0x800b;
/** Alpha blend function: SRC */
Constants.GL_ALPHA_FUNCTION_SRC = 0x0300;
/** Alpha blend function: ONE_MINUS_SRC */
Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR = 0x0301;
/** Alpha blend function: SRC_ALPHA */
Constants.GL_ALPHA_FUNCTION_SRC_ALPHA = 0x0302;
/** Alpha blend function: ONE_MINUS_SRC_ALPHA */
Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA = 0x0303;
/** Alpha blend function: DST_ALPHA */
Constants.GL_ALPHA_FUNCTION_DST_ALPHA = 0x0304;
/** Alpha blend function: ONE_MINUS_DST_ALPHA */
Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA = 0x0305;
/** Alpha blend function: ONE_MINUS_DST */
Constants.GL_ALPHA_FUNCTION_DST_COLOR = 0x0306;
/** Alpha blend function: ONE_MINUS_DST */
Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR = 0x0307;
/** Alpha blend function: SRC_ALPHA_SATURATED */
Constants.GL_ALPHA_FUNCTION_SRC_ALPHA_SATURATED = 0x0308;
/** Alpha blend function: CONSTANT */
Constants.GL_ALPHA_FUNCTION_CONSTANT_COLOR = 0x8001;
/** Alpha blend function: ONE_MINUS_CONSTANT */
Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR = 0x8002;
/** Alpha blend function: CONSTANT_ALPHA */
Constants.GL_ALPHA_FUNCTION_CONSTANT_ALPHA = 0x8003;
/** Alpha blend function: ONE_MINUS_CONSTANT_ALPHA */
Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA = 0x8004;
/** Alpha blend function: SRC1 */
Constants.GL_ALPHA_FUNCTION_SRC1_COLOR = 0x88f9;
/** Alpha blend function: SRC1 */
Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC1_COLOR = 0x88fa;
/** Alpha blend function: SRC1 */
Constants.GL_ALPHA_FUNCTION_SRC1_ALPHA = 0x8589;
/** Alpha blend function: SRC1 */
Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC1_ALPHA = 0x88fb;
/** URL to the snippet server. Points to the public snippet server by default */
Constants.SnippetUrl = "https://snippet.babylonjs.com";
/** The fog is deactivated */
Constants.FOGMODE_NONE = 0;
/** The fog density is following an exponential function */
Constants.FOGMODE_EXP = 1;
/** The fog density is following an exponential function faster than FOGMODE_EXP */
Constants.FOGMODE_EXP2 = 2;
/** The fog density is following a linear function. */
Constants.FOGMODE_LINEAR = 3;
/**
 * The byte type.
 */
Constants.BYTE = 5120;
/**
 * The unsigned byte type.
 */
Constants.UNSIGNED_BYTE = 5121;
/**
 * The short type.
 */
Constants.SHORT = 5122;
/**
 * The unsigned short type.
 */
Constants.UNSIGNED_SHORT = 5123;
/**
 * The integer type.
 */
Constants.INT = 5124;
/**
 * The unsigned integer type.
 */
Constants.UNSIGNED_INT = 5125;
/**
 * The float type.
 */
Constants.FLOAT = 5126;
/**
 * Positions
 */
Constants.PositionKind = "position";
/**
 * Normals
 */
Constants.NormalKind = "normal";
/**
 * Tangents
 */
Constants.TangentKind = "tangent";
/**
 * Texture coordinates
 */
Constants.UVKind = "uv";
/**
 * Texture coordinates 2
 */
Constants.UV2Kind = "uv2";
/**
 * Texture coordinates 3
 */
Constants.UV3Kind = "uv3";
/**
 * Texture coordinates 4
 */
Constants.UV4Kind = "uv4";
/**
 * Texture coordinates 5
 */
Constants.UV5Kind = "uv5";
/**
 * Texture coordinates 6
 */
Constants.UV6Kind = "uv6";
/**
 * Colors
 */
Constants.ColorKind = "color";
/**
 * Instance Colors
 */
Constants.ColorInstanceKind = "instanceColor";
/**
 * Matrix indices (for bones)
 */
Constants.MatricesIndicesKind = "matricesIndices";
/**
 * Matrix weights (for bones)
 */
Constants.MatricesWeightsKind = "matricesWeights";
/**
 * Additional matrix indices (for bones)
 */
Constants.MatricesIndicesExtraKind = "matricesIndicesExtra";
/**
 * Additional matrix weights (for bones)
 */
Constants.MatricesWeightsExtraKind = "matricesWeightsExtra";
//# sourceMappingURL=constants.js.map

/***/ }),

/***/ 79161:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BG: () => (/* binding */ _CommonInit),
/* harmony export */   PR: () => (/* binding */ GetFontOffset),
/* harmony export */   eG: () => (/* binding */ RequestPointerlock),
/* harmony export */   g7: () => (/* binding */ ExitFullscreen),
/* harmony export */   jf: () => (/* binding */ ResizeImageBitmap),
/* harmony export */   kF: () => (/* binding */ CreateImageBitmapFromSource),
/* harmony export */   kX: () => (/* binding */ _CommonDispose),
/* harmony export */   rT: () => (/* binding */ ExitPointerlock),
/* harmony export */   tl: () => (/* binding */ RequestFullscreen)
/* harmony export */ });
/* harmony import */ var _Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18790);
/* harmony import */ var _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32206);
/* harmony import */ var _engineStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6315);



/** @internal */
function _DisableTouchAction(canvas) {
    if (!canvas || !canvas.setAttribute) {
        return;
    }
    canvas.setAttribute("touch-action", "none");
    canvas.style.touchAction = "none";
    canvas.style.webkitTapHighlightColor = "transparent";
}
/** @internal */
function _CommonInit(commonEngine, canvas, creationOptions) {
    commonEngine._onCanvasFocus = () => {
        commonEngine.onCanvasFocusObservable.notifyObservers(commonEngine);
    };
    commonEngine._onCanvasBlur = () => {
        commonEngine.onCanvasBlurObservable.notifyObservers(commonEngine);
    };
    commonEngine._onCanvasContextMenu = (evt) => {
        if (commonEngine.disableContextMenu) {
            evt.preventDefault();
        }
    };
    canvas.addEventListener("focus", commonEngine._onCanvasFocus);
    canvas.addEventListener("blur", commonEngine._onCanvasBlur);
    canvas.addEventListener("contextmenu", commonEngine._onCanvasContextMenu);
    commonEngine._onBlur = () => {
        if (commonEngine.disablePerformanceMonitorInBackground) {
            commonEngine.performanceMonitor.disable();
        }
        commonEngine._windowIsBackground = true;
    };
    commonEngine._onFocus = () => {
        if (commonEngine.disablePerformanceMonitorInBackground) {
            commonEngine.performanceMonitor.enable();
        }
        commonEngine._windowIsBackground = false;
    };
    commonEngine._onCanvasPointerOut = (ev) => {
        // Check that the element at the point of the pointer out isn't the canvas and if it isn't, notify observers
        // Note: This is a workaround for a bug with Safari
        if (document.elementFromPoint(ev.clientX, ev.clientY) !== canvas) {
            commonEngine.onCanvasPointerOutObservable.notifyObservers(ev);
        }
    };
    const hostWindow = commonEngine.getHostWindow(); // it calls IsWindowObjectExist()
    if (hostWindow && typeof hostWindow.addEventListener === "function") {
        hostWindow.addEventListener("blur", commonEngine._onBlur);
        hostWindow.addEventListener("focus", commonEngine._onFocus);
    }
    canvas.addEventListener("pointerout", commonEngine._onCanvasPointerOut);
    if (!creationOptions.doNotHandleTouchAction) {
        _DisableTouchAction(canvas);
    }
    // Create Audio Engine if needed.
    if (!_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine && creationOptions.audioEngine && _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.AudioEngineFactory) {
        _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine = _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.AudioEngineFactory(commonEngine.getRenderingCanvas(), commonEngine.getAudioContext(), commonEngine.getAudioDestination());
    }
    if ((0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .IsDocumentAvailable */ .Nf)()) {
        // Fullscreen
        commonEngine._onFullscreenChange = () => {
            commonEngine.isFullscreen = !!document.fullscreenElement;
            // Pointer lock
            if (commonEngine.isFullscreen && commonEngine._pointerLockRequested && canvas) {
                RequestPointerlock(canvas);
            }
        };
        document.addEventListener("fullscreenchange", commonEngine._onFullscreenChange, false);
        document.addEventListener("webkitfullscreenchange", commonEngine._onFullscreenChange, false);
        // Pointer lock
        commonEngine._onPointerLockChange = () => {
            commonEngine.isPointerLock = document.pointerLockElement === canvas;
        };
        document.addEventListener("pointerlockchange", commonEngine._onPointerLockChange, false);
        document.addEventListener("webkitpointerlockchange", commonEngine._onPointerLockChange, false);
    }
    commonEngine.enableOfflineSupport = _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.OfflineProviderFactory !== undefined;
    commonEngine._deterministicLockstep = !!creationOptions.deterministicLockstep;
    commonEngine._lockstepMaxSteps = creationOptions.lockstepMaxSteps || 0;
    commonEngine._timeStep = creationOptions.timeStep || 1 / 60;
}
/** @internal */
function _CommonDispose(commonEngine, canvas) {
    // Release audio engine
    if (_engineStore_js__WEBPACK_IMPORTED_MODULE_2__/* .EngineStore */ .q.Instances.length === 1 && _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine) {
        _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine.dispose();
        _abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$.audioEngine = null;
    }
    // Events
    const hostWindow = commonEngine.getHostWindow(); // it calls IsWindowObjectExist()
    if (hostWindow && typeof hostWindow.removeEventListener === "function") {
        hostWindow.removeEventListener("blur", commonEngine._onBlur);
        hostWindow.removeEventListener("focus", commonEngine._onFocus);
    }
    if (canvas) {
        canvas.removeEventListener("focus", commonEngine._onCanvasFocus);
        canvas.removeEventListener("blur", commonEngine._onCanvasBlur);
        canvas.removeEventListener("pointerout", commonEngine._onCanvasPointerOut);
        canvas.removeEventListener("contextmenu", commonEngine._onCanvasContextMenu);
    }
    if ((0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .IsDocumentAvailable */ .Nf)()) {
        document.removeEventListener("fullscreenchange", commonEngine._onFullscreenChange);
        document.removeEventListener("mozfullscreenchange", commonEngine._onFullscreenChange);
        document.removeEventListener("webkitfullscreenchange", commonEngine._onFullscreenChange);
        document.removeEventListener("msfullscreenchange", commonEngine._onFullscreenChange);
        document.removeEventListener("pointerlockchange", commonEngine._onPointerLockChange);
        document.removeEventListener("mspointerlockchange", commonEngine._onPointerLockChange);
        document.removeEventListener("mozpointerlockchange", commonEngine._onPointerLockChange);
        document.removeEventListener("webkitpointerlockchange", commonEngine._onPointerLockChange);
    }
}
/**
 * Get Font size information
 * @param font font name
 * @returns an object containing ascent, height and descent
 */
function GetFontOffset(font) {
    const text = document.createElement("span");
    text.textContent = "Hg";
    text.style.font = font;
    const block = document.createElement("div");
    block.style.display = "inline-block";
    block.style.width = "1px";
    block.style.height = "0px";
    block.style.verticalAlign = "bottom";
    const div = document.createElement("div");
    div.style.whiteSpace = "nowrap";
    div.appendChild(text);
    div.appendChild(block);
    document.body.appendChild(div);
    let fontAscent = 0;
    let fontHeight = 0;
    try {
        fontHeight = block.getBoundingClientRect().top - text.getBoundingClientRect().top;
        block.style.verticalAlign = "baseline";
        fontAscent = block.getBoundingClientRect().top - text.getBoundingClientRect().top;
    }
    finally {
        document.body.removeChild(div);
    }
    return { ascent: fontAscent, height: fontHeight, descent: fontHeight - fontAscent };
}
/** @internal */
function CreateImageBitmapFromSource(engine, imageSource, options) {
    const promise = new Promise((resolve, reject) => {
        const image = new Image();
        image.onload = () => {
            image.decode().then(() => {
                engine.createImageBitmap(image, options).then((imageBitmap) => {
                    resolve(imageBitmap);
                });
            });
        };
        image.onerror = () => {
            reject(`Error loading image ${image.src}`);
        };
        image.src = imageSource;
    });
    return promise;
}
/** @internal */
function ResizeImageBitmap(engine, image, bufferWidth, bufferHeight) {
    const canvas = engine.createCanvas(bufferWidth, bufferHeight);
    const context = canvas.getContext("2d");
    if (!context) {
        throw new Error("Unable to get 2d context for resizeImageBitmap");
    }
    context.drawImage(image, 0, 0);
    // Create VertexData from map data
    // Cast is due to wrong definition in lib.d.ts from ts 1.3 - https://github.com/Microsoft/TypeScript/issues/949
    const buffer = context.getImageData(0, 0, bufferWidth, bufferHeight).data;
    return buffer;
}
/**
 * Ask the browser to promote the current element to fullscreen rendering mode
 * @param element defines the DOM element to promote
 */
function RequestFullscreen(element) {
    const requestFunction = element.requestFullscreen || element.webkitRequestFullscreen;
    if (!requestFunction) {
        return;
    }
    requestFunction.call(element);
}
/**
 * Asks the browser to exit fullscreen mode
 */
function ExitFullscreen() {
    const anyDoc = document;
    if (document.exitFullscreen) {
        document.exitFullscreen();
    }
    else if (anyDoc.webkitCancelFullScreen) {
        anyDoc.webkitCancelFullScreen();
    }
}
/**
 * Ask the browser to promote the current element to pointerlock mode
 * @param element defines the DOM element to promote
 */
function RequestPointerlock(element) {
    if (element.requestPointerLock) {
        // In some browsers, requestPointerLock returns a promise.
        // Handle possible rejections to avoid an unhandled top-level exception.
        const promise = element.requestPointerLock();
        if (promise instanceof Promise)
            promise
                .then(() => {
                element.focus();
            })
                .catch(() => { });
        else
            element.focus();
    }
}
/**
 * Asks the browser to exit pointerlock mode
 */
function ExitPointerlock() {
    if (document.exitPointerLock) {
        document.exitPointerLock();
    }
}
//# sourceMappingURL=engine.common.js.map

/***/ }),

/***/ 93856:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   N: () => (/* binding */ Engine)
/* harmony export */ });
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81194);
/* harmony import */ var _engineStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6315);
/* harmony import */ var _thinEngine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86514);
/* harmony import */ var _Misc_performanceMonitor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84085);
/* harmony import */ var _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(54329);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(51137);
/* harmony import */ var _WebGL_webGLHardwareTexture_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67716);
/* harmony import */ var _Extensions_engine_alpha_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(41843);
/* harmony import */ var _Extensions_engine_rawTexture_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52426);
/* harmony import */ var _Extensions_engine_readTexture_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(52212);
/* harmony import */ var _Extensions_engine_dynamicBuffer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(86556);
/* harmony import */ var _Extensions_engine_cubeTexture_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(83155);
/* harmony import */ var _Extensions_engine_renderTarget_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(44176);
/* harmony import */ var _Extensions_engine_renderTargetTexture_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(15183);
/* harmony import */ var _Extensions_engine_renderTargetCube_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(79779);
/* harmony import */ var _Extensions_engine_prefilteredCubeTexture_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(51881);
/* harmony import */ var _Extensions_engine_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(36317);
/* harmony import */ var _AbstractEngine_abstractEngine_loadingScreen_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(29967);
/* harmony import */ var _AbstractEngine_abstractEngine_dom_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(28019);
/* harmony import */ var _AbstractEngine_abstractEngine_states_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(46125);
/* harmony import */ var _AbstractEngine_abstractEngine_renderPass_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(97298);
/* harmony import */ var _AbstractEngine_abstractEngine_texture_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(9696);
/* harmony import */ var _abstractEngine_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(32206);
/* harmony import */ var _engine_common_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(79161);
/* harmony import */ var _Misc_perfCounter_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(24296);
/* harmony import */ var _Audio_audioEngine_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(47841);



























/**
 * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio
 */
class Engine extends _thinEngine_js__WEBPACK_IMPORTED_MODULE_2__.ThinEngine {
    /**
     * Returns the current npm package of the sdk
     */
    // Not mixed with Version for tooling purpose.
    static get NpmPackage() {
        return _abstractEngine_js__WEBPACK_IMPORTED_MODULE_22__/* .AbstractEngine */ .$.NpmPackage;
    }
    /**
     * Returns the current version of the framework
     */
    static get Version() {
        return _abstractEngine_js__WEBPACK_IMPORTED_MODULE_22__/* .AbstractEngine */ .$.Version;
    }
    /** Gets the list of created engines */
    static get Instances() {
        return _engineStore_js__WEBPACK_IMPORTED_MODULE_1__/* .EngineStore */ .q.Instances;
    }
    /**
     * Gets the latest created engine
     */
    static get LastCreatedEngine() {
        return _engineStore_js__WEBPACK_IMPORTED_MODULE_1__/* .EngineStore */ .q.LastCreatedEngine;
    }
    /**
     * Gets the latest created scene
     */
    static get LastCreatedScene() {
        return _engineStore_js__WEBPACK_IMPORTED_MODULE_1__/* .EngineStore */ .q.LastCreatedScene;
    }
    /** @internal */
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Method called to create the default loading screen.
     * This can be overridden in your own app.
     * @param canvas The rendering canvas element
     * @returns The loading screen
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static DefaultLoadingScreenFactory(canvas) {
        return _abstractEngine_js__WEBPACK_IMPORTED_MODULE_22__/* .AbstractEngine */ .$.DefaultLoadingScreenFactory(canvas);
    }
    get _supportsHardwareTextureRescaling() {
        return !!Engine._RescalePostProcessFactory;
    }
    _measureFps() {
        this._performanceMonitor.sampleFrame();
        this._fps = this._performanceMonitor.averageFPS;
        this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;
    }
    /**
     * Gets the performance monitor attached to this engine
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
     */
    get performanceMonitor() {
        return this._performanceMonitor;
    }
    // Events
    /**
     * Creates a new engine
     * @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which already used the WebGL context
     * @param antialias defines enable antialiasing (default: false)
     * @param options defines further options to be sent to the getContext() function
     * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
     */
    constructor(canvasOrContext, antialias, options, adaptToDeviceRatio = false) {
        super(canvasOrContext, antialias, options, adaptToDeviceRatio);
        // Members
        /**
         * If set, will be used to request the next animation frame for the render loop
         */
        this.customAnimationFrameRequester = null;
        this._performanceMonitor = new _Misc_performanceMonitor_js__WEBPACK_IMPORTED_MODULE_3__/* .PerformanceMonitor */ .r();
        this._drawCalls = new _Misc_perfCounter_js__WEBPACK_IMPORTED_MODULE_24__/* .PerfCounter */ .A();
        if (!canvasOrContext) {
            return;
        }
        this._features.supportRenderPasses = true;
        options = this._creationOptions;
        if (canvasOrContext.getContext) {
            const canvas = canvasOrContext;
            this._sharedInit(canvas);
        }
    }
    _initGLContext() {
        super._initGLContext();
        this._rescalePostProcess = null;
    }
    /**
     * Shared initialization across engines types.
     * @param canvas The canvas associated with this instance of the engine.
     */
    _sharedInit(canvas) {
        super._sharedInit(canvas);
        (0,_engine_common_js__WEBPACK_IMPORTED_MODULE_23__/* ._CommonInit */ .BG)(this, canvas, this._creationOptions);
    }
    /**
     * Resize an image and returns the image data as an uint8array
     * @param image image to resize
     * @param bufferWidth destination buffer width
     * @param bufferHeight destination buffer height
     * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size
     */
    resizeImageBitmap(image, bufferWidth, bufferHeight) {
        return (0,_engine_common_js__WEBPACK_IMPORTED_MODULE_23__/* .ResizeImageBitmap */ .jf)(this, image, bufferWidth, bufferHeight);
    }
    /**
     * Engine abstraction for loading and creating an image bitmap from a given source string.
     * @param imageSource source to load the image from.
     * @param options An object that sets options for the image's extraction.
     * @returns ImageBitmap
     */
    _createImageBitmapFromSource(imageSource, options) {
        return (0,_engine_common_js__WEBPACK_IMPORTED_MODULE_23__/* .CreateImageBitmapFromSource */ .kF)(this, imageSource, options);
    }
    /**
     * Toggle full screen mode
     * @param requestPointerLock defines if a pointer lock should be requested from the user
     */
    switchFullscreen(requestPointerLock) {
        if (this.isFullscreen) {
            this.exitFullscreen();
        }
        else {
            this.enterFullscreen(requestPointerLock);
        }
    }
    /**
     * Enters full screen mode
     * @param requestPointerLock defines if a pointer lock should be requested from the user
     */
    enterFullscreen(requestPointerLock) {
        if (!this.isFullscreen) {
            this._pointerLockRequested = requestPointerLock;
            if (this._renderingCanvas) {
                (0,_engine_common_js__WEBPACK_IMPORTED_MODULE_23__/* .RequestFullscreen */ .tl)(this._renderingCanvas);
            }
        }
    }
    /**
     * Exits full screen mode
     */
    exitFullscreen() {
        if (this.isFullscreen) {
            (0,_engine_common_js__WEBPACK_IMPORTED_MODULE_23__/* .ExitFullscreen */ .g7)();
        }
    }
    /** States */
    /**
     * Sets a boolean indicating if the dithering state is enabled or disabled
     * @param value defines the dithering state
     */
    setDitheringState(value) {
        if (value) {
            this._gl.enable(this._gl.DITHER);
        }
        else {
            this._gl.disable(this._gl.DITHER);
        }
    }
    /**
     * Sets a boolean indicating if the rasterizer state is enabled or disabled
     * @param value defines the rasterizer state
     */
    setRasterizerState(value) {
        if (value) {
            this._gl.disable(this._gl.RASTERIZER_DISCARD);
        }
        else {
            this._gl.enable(this._gl.RASTERIZER_DISCARD);
        }
    }
    /**
     * Directly set the WebGL Viewport
     * @param x defines the x coordinate of the viewport (in screen space)
     * @param y defines the y coordinate of the viewport (in screen space)
     * @param width defines the width of the viewport (in screen space)
     * @param height defines the height of the viewport (in screen space)
     * @returns the current viewport Object (if any) that is being replaced by this call. You can restore this viewport later on to go back to the original state
     */
    setDirectViewport(x, y, width, height) {
        const currentViewport = this._cachedViewport;
        this._cachedViewport = null;
        this._viewport(x, y, width, height);
        return currentViewport;
    }
    /**
     * Executes a scissor clear (ie. a clear on a specific portion of the screen)
     * @param x defines the x-coordinate of the bottom left corner of the clear rectangle
     * @param y defines the y-coordinate of the corner of the clear rectangle
     * @param width defines the width of the clear rectangle
     * @param height defines the height of the clear rectangle
     * @param clearColor defines the clear color
     */
    scissorClear(x, y, width, height, clearColor) {
        this.enableScissor(x, y, width, height);
        this.clear(clearColor, true, true, true);
        this.disableScissor();
    }
    /**
     * Enable scissor test on a specific rectangle (ie. render will only be executed on a specific portion of the screen)
     * @param x defines the x-coordinate of the bottom left corner of the clear rectangle
     * @param y defines the y-coordinate of the corner of the clear rectangle
     * @param width defines the width of the clear rectangle
     * @param height defines the height of the clear rectangle
     */
    enableScissor(x, y, width, height) {
        const gl = this._gl;
        // Change state
        gl.enable(gl.SCISSOR_TEST);
        gl.scissor(x, y, width, height);
    }
    /**
     * Disable previously set scissor test rectangle
     */
    disableScissor() {
        const gl = this._gl;
        gl.disable(gl.SCISSOR_TEST);
    }
    /**
     * @internal
     */
    _loadFileAsync(url, offlineProvider, useArrayBuffer) {
        return new Promise((resolve, reject) => {
            this._loadFile(url, (data) => {
                resolve(data);
            }, undefined, offlineProvider, useArrayBuffer, (request, exception) => {
                reject(exception);
            });
        });
    }
    /**
     * Gets the source code of the vertex shader associated with a specific webGL program
     * @param program defines the program to use
     * @returns a string containing the source code of the vertex shader associated with the program
     */
    getVertexShaderSource(program) {
        const shaders = this._gl.getAttachedShaders(program);
        if (!shaders) {
            return null;
        }
        return this._gl.getShaderSource(shaders[0]);
    }
    /**
     * Gets the source code of the fragment shader associated with a specific webGL program
     * @param program defines the program to use
     * @returns a string containing the source code of the fragment shader associated with the program
     */
    getFragmentShaderSource(program) {
        const shaders = this._gl.getAttachedShaders(program);
        if (!shaders) {
            return null;
        }
        return this._gl.getShaderSource(shaders[1]);
    }
    /**
     * sets the object from which width and height will be taken from when getting render width and height
     * Will fallback to the gl object
     * @param dimensions the framebuffer width and height that will be used.
     */
    set framebufferDimensionsObject(dimensions) {
        this._framebufferDimensionsObject = dimensions;
        if (this._framebufferDimensionsObject) {
            this.onResizeObservable.notifyObservers(this);
        }
    }
    _rebuildBuffers() {
        // Index / Vertex
        for (const scene of this.scenes) {
            scene.resetCachedMaterial();
            scene._rebuildGeometries();
        }
        for (const scene of this._virtualScenes) {
            scene.resetCachedMaterial();
            scene._rebuildGeometries();
        }
        super._rebuildBuffers();
    }
    /**
     * Get Font size information
     * @param font font name
     * @returns an object containing ascent, height and descent
     */
    getFontOffset(font) {
        return (0,_engine_common_js__WEBPACK_IMPORTED_MODULE_23__/* .GetFontOffset */ .PR)(font);
    }
    _cancelFrame() {
        if (this.customAnimationFrameRequester) {
            if (this._frameHandler !== 0) {
                this._frameHandler = 0;
                const { cancelAnimationFrame } = this.customAnimationFrameRequester;
                if (cancelAnimationFrame) {
                    cancelAnimationFrame(this.customAnimationFrameRequester.requestID);
                }
            }
        }
        else {
            super._cancelFrame();
        }
    }
    _renderLoop() {
        // Reset the frame handler before rendering a frame to determine if a new frame has been queued.
        this._frameHandler = 0;
        if (!this._contextWasLost) {
            let shouldRender = true;
            if (this.isDisposed || (!this.renderEvenInBackground && this._windowIsBackground)) {
                shouldRender = false;
            }
            if (shouldRender) {
                // Start new frame
                this.beginFrame();
                // Child canvases
                if (!this._renderViews()) {
                    // Main frame
                    this._renderFrame();
                }
                // Present
                this.endFrame();
            }
        }
        // The first condition prevents queuing another frame if we no longer have active render loops (e.g., if
        // `stopRenderLoop` is called mid frame). The second condition prevents queuing another frame if one has
        // already been queued (e.g., if `stopRenderLoop` and `runRenderLoop` is called mid frame).
        if (this._activeRenderLoops.length > 0 && this._frameHandler === 0) {
            if (this.customAnimationFrameRequester) {
                this.customAnimationFrameRequester.requestID = this._queueNewFrame(this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction, this.customAnimationFrameRequester);
                this._frameHandler = this.customAnimationFrameRequester.requestID;
            }
            else {
                this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());
            }
        }
    }
    /**
     * Enters Pointerlock mode
     */
    enterPointerlock() {
        if (this._renderingCanvas) {
            (0,_engine_common_js__WEBPACK_IMPORTED_MODULE_23__/* .RequestPointerlock */ .eG)(this._renderingCanvas);
        }
    }
    /**
     * Exits Pointerlock mode
     */
    exitPointerlock() {
        (0,_engine_common_js__WEBPACK_IMPORTED_MODULE_23__/* .ExitPointerlock */ .rT)();
    }
    /**
     * Begin a new frame
     */
    beginFrame() {
        this._measureFps();
        super.beginFrame();
    }
    _deletePipelineContext(pipelineContext) {
        const webGLPipelineContext = pipelineContext;
        if (webGLPipelineContext && webGLPipelineContext.program) {
            if (webGLPipelineContext.transformFeedback) {
                this.deleteTransformFeedback(webGLPipelineContext.transformFeedback);
                webGLPipelineContext.transformFeedback = null;
            }
        }
        super._deletePipelineContext(pipelineContext);
    }
    createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings = null) {
        context = context || this._gl;
        this.onBeforeShaderCompilationObservable.notifyObservers(this);
        const program = super.createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings);
        this.onAfterShaderCompilationObservable.notifyObservers(this);
        return program;
    }
    _createShaderProgram(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings = null) {
        const shaderProgram = context.createProgram();
        pipelineContext.program = shaderProgram;
        if (!shaderProgram) {
            throw new Error("Unable to create program");
        }
        context.attachShader(shaderProgram, vertexShader);
        context.attachShader(shaderProgram, fragmentShader);
        if (this.webGLVersion > 1 && transformFeedbackVaryings) {
            const transformFeedback = this.createTransformFeedback();
            this.bindTransformFeedback(transformFeedback);
            this.setTranformFeedbackVaryings(shaderProgram, transformFeedbackVaryings);
            pipelineContext.transformFeedback = transformFeedback;
        }
        context.linkProgram(shaderProgram);
        if (this.webGLVersion > 1 && transformFeedbackVaryings) {
            this.bindTransformFeedback(null);
        }
        pipelineContext.context = context;
        pipelineContext.vertexShader = vertexShader;
        pipelineContext.fragmentShader = fragmentShader;
        if (!pipelineContext.isParallelCompiled) {
            this._finalizePipelineContext(pipelineContext);
        }
        return shaderProgram;
    }
    /**
     * @internal
     */
    _releaseTexture(texture) {
        super._releaseTexture(texture);
    }
    /**
     * @internal
     */
    _releaseRenderTargetWrapper(rtWrapper) {
        super._releaseRenderTargetWrapper(rtWrapper);
        // Set output texture of post process to null if the framebuffer has been released/disposed
        this.scenes.forEach((scene) => {
            scene.postProcesses.forEach((postProcess) => {
                if (postProcess._outputTexture === rtWrapper) {
                    postProcess._outputTexture = null;
                }
            });
            scene.cameras.forEach((camera) => {
                camera._postProcesses.forEach((postProcess) => {
                    if (postProcess) {
                        if (postProcess._outputTexture === rtWrapper) {
                            postProcess._outputTexture = null;
                        }
                    }
                });
            });
        });
    }
    /**
     * @internal
     * Rescales a texture
     * @param source input texture
     * @param destination destination texture
     * @param scene scene to use to render the resize
     * @param internalFormat format to use when resizing
     * @param onComplete callback to be called when resize has completed
     */
    _rescaleTexture(source, destination, scene, internalFormat, onComplete) {
        this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR);
        this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR);
        this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE);
        this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE);
        const rtt = this.createRenderTargetTexture({
            width: destination.width,
            height: destination.height,
        }, {
            generateMipMaps: false,
            type: 0,
            samplingMode: 2,
            generateDepthBuffer: false,
            generateStencilBuffer: false,
        });
        if (!this._rescalePostProcess && Engine._RescalePostProcessFactory) {
            this._rescalePostProcess = Engine._RescalePostProcessFactory(this);
        }
        if (this._rescalePostProcess) {
            this._rescalePostProcess.externalTextureSamplerBinding = true;
            const onCompiled = () => {
                this._rescalePostProcess.onApply = function (effect) {
                    effect._bindTexture("textureSampler", source);
                };
                let hostingScene = scene;
                if (!hostingScene) {
                    hostingScene = this.scenes[this.scenes.length - 1];
                }
                hostingScene.postProcessManager.directRender([this._rescalePostProcess], rtt, true);
                this._bindTextureDirectly(this._gl.TEXTURE_2D, destination, true);
                this._gl.copyTexImage2D(this._gl.TEXTURE_2D, 0, internalFormat, 0, 0, destination.width, destination.height, 0);
                this.unBindFramebuffer(rtt);
                rtt.dispose();
                if (onComplete) {
                    onComplete();
                }
            };
            const effect = this._rescalePostProcess.getEffect();
            if (effect) {
                effect.executeWhenCompiled(onCompiled);
            }
            else {
                this._rescalePostProcess.onEffectCreatedObservable.addOnce((effect) => {
                    effect.executeWhenCompiled(onCompiled);
                });
            }
        }
    }
    /**
     * Wraps an external web gl texture in a Babylon texture.
     * @param texture defines the external texture
     * @param hasMipMaps defines whether the external texture has mip maps (default: false)
     * @param samplingMode defines the sampling mode for the external texture (default: 3)
     * @param width defines the width for the external texture (default: 0)
     * @param height defines the height for the external texture (default: 0)
     * @returns the babylon internal texture
     */
    wrapWebGLTexture(texture, hasMipMaps = false, samplingMode = 3, width = 0, height = 0) {
        const hardwareTexture = new _WebGL_webGLHardwareTexture_js__WEBPACK_IMPORTED_MODULE_6__/* .WebGLHardwareTexture */ .d(texture, this._gl);
        const internalTexture = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .InternalTexture */ .hV(this, 0 /* InternalTextureSource.Unknown */, true);
        internalTexture._hardwareTexture = hardwareTexture;
        internalTexture.baseWidth = width;
        internalTexture.baseHeight = height;
        internalTexture.width = width;
        internalTexture.height = height;
        internalTexture.isReady = true;
        internalTexture.useMipMaps = hasMipMaps;
        this.updateTextureSamplingMode(samplingMode, internalTexture);
        return internalTexture;
    }
    /**
     * @internal
     */
    _uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) {
        const gl = this._gl;
        const textureType = this._getWebGLTextureType(texture.type);
        const format = this._getInternalFormat(texture.format);
        const internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, format);
        const bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
        this._bindTextureDirectly(bindTarget, texture, true);
        this._unpackFlipY(texture.invertY);
        let target = gl.TEXTURE_2D;
        if (texture.isCube) {
            target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex;
        }
        gl.texImage2D(target, lod, internalFormat, format, textureType, image);
        this._bindTextureDirectly(bindTarget, null, true);
    }
    /**
     * Updates a depth texture Comparison Mode and Function.
     * If the comparison Function is equal to 0, the mode will be set to none.
     * Otherwise, this only works in webgl 2 and requires a shadow sampler in the shader.
     * @param texture The texture to set the comparison function for
     * @param comparisonFunction The comparison function to set, 0 if no comparison required
     */
    updateTextureComparisonFunction(texture, comparisonFunction) {
        if (this.webGLVersion === 1) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger */ .V.Error("WebGL 1 does not support texture comparison.");
            return;
        }
        const gl = this._gl;
        if (texture.isCube) {
            this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true);
            if (comparisonFunction === 0) {
                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, 515);
                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.NONE);
            }
            else {
                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);
                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
            }
            this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
        }
        else {
            this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);
            if (comparisonFunction === 0) {
                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, 515);
                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.NONE);
            }
            else {
                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);
                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
            }
            this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
        }
        texture._comparisonFunction = comparisonFunction;
    }
    /**
     * Creates a webGL buffer to use with instantiation
     * @param capacity defines the size of the buffer
     * @returns the webGL buffer
     */
    createInstancesBuffer(capacity) {
        const buffer = this._gl.createBuffer();
        if (!buffer) {
            throw new Error("Unable to create instance buffer");
        }
        const result = new _Meshes_WebGL_webGLDataBuffer_js__WEBPACK_IMPORTED_MODULE_4__/* .WebGLDataBuffer */ .A(buffer);
        result.capacity = capacity;
        this.bindArrayBuffer(result);
        this._gl.bufferData(this._gl.ARRAY_BUFFER, capacity, this._gl.DYNAMIC_DRAW);
        result.references = 1;
        return result;
    }
    /**
     * Delete a webGL buffer used with instantiation
     * @param buffer defines the webGL buffer to delete
     */
    deleteInstancesBuffer(buffer) {
        this._gl.deleteBuffer(buffer);
    }
    _clientWaitAsync(sync, flags = 0, intervalms = 10) {
        const gl = this._gl;
        return new Promise((resolve, reject) => {
            const check = () => {
                const res = gl.clientWaitSync(sync, flags, 0);
                if (res == gl.WAIT_FAILED) {
                    reject();
                    return;
                }
                if (res == gl.TIMEOUT_EXPIRED) {
                    setTimeout(check, intervalms);
                    return;
                }
                resolve();
            };
            check();
        });
    }
    /**
     * @internal
     */
    _readPixelsAsync(x, y, w, h, format, type, outputBuffer) {
        if (this._webGLVersion < 2) {
            throw new Error("_readPixelsAsync only work on WebGL2+");
        }
        const gl = this._gl;
        const buf = gl.createBuffer();
        gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);
        gl.bufferData(gl.PIXEL_PACK_BUFFER, outputBuffer.byteLength, gl.STREAM_READ);
        gl.readPixels(x, y, w, h, format, type, 0);
        gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);
        const sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
        if (!sync) {
            return null;
        }
        gl.flush();
        return this._clientWaitAsync(sync, 0, 10).then(() => {
            gl.deleteSync(sync);
            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);
            gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, outputBuffer);
            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);
            gl.deleteBuffer(buf);
            return outputBuffer;
        });
    }
    dispose() {
        this.hideLoadingUI();
        // Rescale PP
        if (this._rescalePostProcess) {
            this._rescalePostProcess.dispose();
        }
        (0,_engine_common_js__WEBPACK_IMPORTED_MODULE_23__/* ._CommonDispose */ .kX)(this, this._renderingCanvas);
        super.dispose();
    }
}
// Const statics
/** Defines that alpha blending is disabled */
Engine.ALPHA_DISABLE = 0;
/** Defines that alpha blending to SRC ALPHA * SRC + DEST */
Engine.ALPHA_ADD = 1;
/** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
Engine.ALPHA_COMBINE = 2;
/** Defines that alpha blending to DEST - SRC * DEST */
Engine.ALPHA_SUBTRACT = 3;
/** Defines that alpha blending to SRC * DEST */
Engine.ALPHA_MULTIPLY = 4;
/** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
Engine.ALPHA_MAXIMIZED = 5;
/** Defines that alpha blending to SRC + DEST */
Engine.ALPHA_ONEONE = 6;
/** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
Engine.ALPHA_PREMULTIPLIED = 7;
/**
 * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
 * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
 */
Engine.ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
/** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
Engine.ALPHA_INTERPOLATE = 9;
/**
 * Defines that alpha blending to SRC + (1 - SRC) * DEST
 * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
 */
Engine.ALPHA_SCREENMODE = 10;
/** Defines that the resource is not delayed*/
Engine.DELAYLOADSTATE_NONE = 0;
/** Defines that the resource was successfully delay loaded */
Engine.DELAYLOADSTATE_LOADED = 1;
/** Defines that the resource is currently delay loading */
Engine.DELAYLOADSTATE_LOADING = 2;
/** Defines that the resource is delayed and has not started loading */
Engine.DELAYLOADSTATE_NOTLOADED = 4;
// Depht or Stencil test Constants.
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
Engine.NEVER = 512;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
Engine.ALWAYS = 519;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
Engine.LESS = 513;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
Engine.EQUAL = 514;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
Engine.LEQUAL = 515;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
Engine.GREATER = 516;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
Engine.GEQUAL = 518;
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
Engine.NOTEQUAL = 517;
// Stencil Actions Constants.
/** Passed to stencilOperation to specify that stencil value must be kept */
Engine.KEEP = 7680;
/** Passed to stencilOperation to specify that stencil value must be replaced */
Engine.REPLACE = 7681;
/** Passed to stencilOperation to specify that stencil value must be incremented */
Engine.INCR = 7682;
/** Passed to stencilOperation to specify that stencil value must be decremented */
Engine.DECR = 7683;
/** Passed to stencilOperation to specify that stencil value must be inverted */
Engine.INVERT = 5386;
/** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
Engine.INCR_WRAP = 34055;
/** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
Engine.DECR_WRAP = 34056;
/** Texture is not repeating outside of 0..1 UVs */
Engine.TEXTURE_CLAMP_ADDRESSMODE = 0;
/** Texture is repeating outside of 0..1 UVs */
Engine.TEXTURE_WRAP_ADDRESSMODE = 1;
/** Texture is repeating and mirrored */
Engine.TEXTURE_MIRROR_ADDRESSMODE = 2;
/** ALPHA */
Engine.TEXTUREFORMAT_ALPHA = 0;
/** LUMINANCE */
Engine.TEXTUREFORMAT_LUMINANCE = 1;
/** LUMINANCE_ALPHA */
Engine.TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
/** RGB */
Engine.TEXTUREFORMAT_RGB = 4;
/** RGBA */
Engine.TEXTUREFORMAT_RGBA = 5;
/** RED */
Engine.TEXTUREFORMAT_RED = 6;
/** RED (2nd reference) */
Engine.TEXTUREFORMAT_R = 6;
/** RED unsigned short normed to [0, 1] **/
Engine.TEXTUREFORMAT_R16_UNORM = 33322;
/** RG unsigned short normed to [0, 1] **/
Engine.TEXTUREFORMAT_RG16_UNORM = 33324;
/** RGB unsigned short normed to [0, 1] **/
Engine.TEXTUREFORMAT_RGB16_UNORM = 32852;
/** RGBA unsigned short normed to [0, 1] **/
Engine.TEXTUREFORMAT_RGBA16_UNORM = 32859;
/** RED signed short normed to [-1, 1] **/
Engine.TEXTUREFORMAT_R16_SNORM = 36760;
/** RG signed short normed to [-1, 1] **/
Engine.TEXTUREFORMAT_RG16_SNORM = 36761;
/** RGB signed short normed to [-1, 1] **/
Engine.TEXTUREFORMAT_RGB16_SNORM = 36762;
/** RGBA signed short normed to [-1, 1] **/
Engine.TEXTUREFORMAT_RGBA16_SNORM = 36763;
/** RG */
Engine.TEXTUREFORMAT_RG = 7;
/** RED_INTEGER */
Engine.TEXTUREFORMAT_RED_INTEGER = 8;
/** RED_INTEGER (2nd reference) */
Engine.TEXTUREFORMAT_R_INTEGER = 8;
/** RG_INTEGER */
Engine.TEXTUREFORMAT_RG_INTEGER = 9;
/** RGB_INTEGER */
Engine.TEXTUREFORMAT_RGB_INTEGER = 10;
/** RGBA_INTEGER */
Engine.TEXTUREFORMAT_RGBA_INTEGER = 11;
/** UNSIGNED_BYTE */
Engine.TEXTURETYPE_UNSIGNED_BYTE = 0;
/** @deprecated use more explicit TEXTURETYPE_UNSIGNED_BYTE instead. Use TEXTURETYPE_UNSIGNED_INTEGER for 32bits values.*/
Engine.TEXTURETYPE_UNSIGNED_INT = 0;
/** FLOAT */
Engine.TEXTURETYPE_FLOAT = 1;
/** HALF_FLOAT */
Engine.TEXTURETYPE_HALF_FLOAT = 2;
/** BYTE */
Engine.TEXTURETYPE_BYTE = 3;
/** SHORT */
Engine.TEXTURETYPE_SHORT = 4;
/** UNSIGNED_SHORT */
Engine.TEXTURETYPE_UNSIGNED_SHORT = 5;
/** INT */
Engine.TEXTURETYPE_INT = 6;
/** UNSIGNED_INT */
Engine.TEXTURETYPE_UNSIGNED_INTEGER = 7;
/** UNSIGNED_SHORT_4_4_4_4 */
Engine.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8;
/** UNSIGNED_SHORT_5_5_5_1 */
Engine.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9;
/** UNSIGNED_SHORT_5_6_5 */
Engine.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10;
/** UNSIGNED_INT_2_10_10_10_REV */
Engine.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11;
/** UNSIGNED_INT_24_8 */
Engine.TEXTURETYPE_UNSIGNED_INT_24_8 = 12;
/** UNSIGNED_INT_10F_11F_11F_REV */
Engine.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13;
/** UNSIGNED_INT_5_9_9_9_REV */
Engine.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14;
/** FLOAT_32_UNSIGNED_INT_24_8_REV */
Engine.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15;
/** nearest is mag = nearest and min = nearest and mip = none */
Engine.TEXTURE_NEAREST_SAMPLINGMODE = 1;
/** Bilinear is mag = linear and min = linear and mip = nearest */
Engine.TEXTURE_BILINEAR_SAMPLINGMODE = 2;
/** Trilinear is mag = linear and min = linear and mip = linear */
Engine.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
/** nearest is mag = nearest and min = nearest and mip = linear */
Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8;
/** Bilinear is mag = linear and min = linear and mip = nearest */
Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11;
/** Trilinear is mag = linear and min = linear and mip = linear */
Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
/** mag = nearest and min = nearest and mip = nearest */
Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;
/** mag = nearest and min = linear and mip = nearest */
Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;
/** mag = nearest and min = linear and mip = linear */
Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
/** mag = nearest and min = linear and mip = none */
Engine.TEXTURE_NEAREST_LINEAR = 7;
/** mag = nearest and min = nearest and mip = none */
Engine.TEXTURE_NEAREST_NEAREST = 1;
/** mag = linear and min = nearest and mip = nearest */
Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
/** mag = linear and min = nearest and mip = linear */
Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
/** mag = linear and min = linear and mip = none */
Engine.TEXTURE_LINEAR_LINEAR = 2;
/** mag = linear and min = nearest and mip = none */
Engine.TEXTURE_LINEAR_NEAREST = 12;
/** Explicit coordinates mode */
Engine.TEXTURE_EXPLICIT_MODE = 0;
/** Spherical coordinates mode */
Engine.TEXTURE_SPHERICAL_MODE = 1;
/** Planar coordinates mode */
Engine.TEXTURE_PLANAR_MODE = 2;
/** Cubic coordinates mode */
Engine.TEXTURE_CUBIC_MODE = 3;
/** Projection coordinates mode */
Engine.TEXTURE_PROJECTION_MODE = 4;
/** Skybox coordinates mode */
Engine.TEXTURE_SKYBOX_MODE = 5;
/** Inverse Cubic coordinates mode */
Engine.TEXTURE_INVCUBIC_MODE = 6;
/** Equirectangular coordinates mode */
Engine.TEXTURE_EQUIRECTANGULAR_MODE = 7;
/** Equirectangular Fixed coordinates mode */
Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;
/** Equirectangular Fixed Mirrored coordinates mode */
Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
// Texture rescaling mode
/** Defines that texture rescaling will use a floor to find the closer power of 2 size */
Engine.SCALEMODE_FLOOR = 1;
/** Defines that texture rescaling will look for the nearest power of 2 size */
Engine.SCALEMODE_NEAREST = 2;
/** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
Engine.SCALEMODE_CEILING = 3;
//# sourceMappingURL=engine.js.map

/***/ }),

/***/ 6315:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   q: () => (/* binding */ EngineStore)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);

/**
 * The engine store class is responsible to hold all the instances of Engine and Scene created
 * during the life time of the application.
 */
class EngineStore {
    /**
     * Gets the latest created engine
     */
    static get LastCreatedEngine() {
        if (this.Instances.length === 0) {
            return null;
        }
        return this.Instances[this.Instances.length - 1];
    }
    /**
     * Gets the latest created scene
     */
    static get LastCreatedScene() {
        return this._LastCreatedScene;
    }
}
/** Gets the list of created engines */
EngineStore.Instances = [];
/**
 * Notifies when an engine was disposed.
 * Mainly used for static/cache cleanup
 */
EngineStore.OnEnginesDisposedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
/** @internal */
EngineStore._LastCreatedScene = null;
/**
 * Gets or sets a global variable indicating if fallback texture must be used when a texture cannot be loaded
 * @ignorenaming
 */
EngineStore.UseFallbackTexture = true;
/**
 * Texture content used if a texture cannot loaded
 * @ignorenaming
 */
EngineStore.FallbackTexture = "";
//# sourceMappingURL=engineStore.js.map

/***/ }),

/***/ 20215:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   I: () => (/* binding */ PerformanceConfigurator)
/* harmony export */ });
/** @internal */
class PerformanceConfigurator {
    /**
     * @internal
     */
    static SetMatrixPrecision(use64bits) {
        PerformanceConfigurator.MatrixTrackPrecisionChange = false;
        if (use64bits && !PerformanceConfigurator.MatrixUse64Bits) {
            if (PerformanceConfigurator.MatrixTrackedMatrices) {
                for (let m = 0; m < PerformanceConfigurator.MatrixTrackedMatrices.length; ++m) {
                    const matrix = PerformanceConfigurator.MatrixTrackedMatrices[m];
                    const values = matrix._m;
                    matrix._m = new Array(16);
                    for (let i = 0; i < 16; ++i) {
                        matrix._m[i] = values[i];
                    }
                }
            }
        }
        PerformanceConfigurator.MatrixUse64Bits = use64bits;
        PerformanceConfigurator.MatrixCurrentType = PerformanceConfigurator.MatrixUse64Bits ? Array : Float32Array;
        PerformanceConfigurator.MatrixTrackedMatrices = null; // reclaim some memory, as we don't need _TrackedMatrices anymore
    }
}
/** @internal */
PerformanceConfigurator.MatrixUse64Bits = false;
/** @internal */
PerformanceConfigurator.MatrixTrackPrecisionChange = true;
/** @internal */
PerformanceConfigurator.MatrixCurrentType = Float32Array;
/** @internal */
PerformanceConfigurator.MatrixTrackedMatrices = [];
//# sourceMappingURL=performanceConfigurator.js.map

/***/ }),

/***/ 61760:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   v: () => (/* binding */ RenderTargetWrapper)
/* harmony export */ });
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81194);


/**
 * Wrapper around a render target (either single or multi textures)
 */
class RenderTargetWrapper {
    /**
     * Gets the depth/stencil texture
     */
    get depthStencilTexture() {
        return this._depthStencilTexture;
    }
    /**
     * Sets the depth/stencil texture
     * @param texture The depth/stencil texture to set
     * @param disposeExisting True to dispose the existing depth/stencil texture (if any) before replacing it (default: true)
     */
    setDepthStencilTexture(texture, disposeExisting = true) {
        if (disposeExisting && this._depthStencilTexture) {
            this._depthStencilTexture.dispose();
        }
        this._depthStencilTexture = texture;
        this._generateDepthBuffer = this._generateStencilBuffer = false;
        if (texture) {
            this._generateDepthBuffer = true;
            this._generateStencilBuffer = (0,_Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_0__/* .HasStencilAspect */ .$l)(texture.format);
        }
    }
    /**
     * Indicates if the depth/stencil texture has a stencil aspect
     */
    get depthStencilTextureWithStencil() {
        return this._depthStencilTextureWithStencil;
    }
    /**
     * Defines if the render target wrapper is for a cube texture or if false a 2d texture
     */
    get isCube() {
        return this._isCube;
    }
    /**
     * Defines if the render target wrapper is for a single or multi target render wrapper
     */
    get isMulti() {
        return this._isMulti;
    }
    /**
     * Defines if the render target wrapper is for a single or an array of textures
     */
    get is2DArray() {
        return this.layers > 0;
    }
    /**
     * Defines if the render target wrapper is for a 3D texture
     */
    get is3D() {
        return this.depth > 0;
    }
    /**
     * Gets the size of the render target wrapper (used for cubes, as width=height in this case)
     */
    get size() {
        return this.width;
    }
    /**
     * Gets the width of the render target wrapper
     */
    get width() {
        return this._size.width ?? this._size;
    }
    /**
     * Gets the height of the render target wrapper
     */
    get height() {
        return this._size.height ?? this._size;
    }
    /**
     * Gets the number of layers of the render target wrapper (only used if is2DArray is true and wrapper is not a multi render target)
     */
    get layers() {
        return this._size.layers || 0;
    }
    /**
     * Gets the depth of the render target wrapper (only used if is3D is true and wrapper is not a multi render target)
     */
    get depth() {
        return this._size.depth || 0;
    }
    /**
     * Gets the render texture. If this is a multi render target, gets the first texture
     */
    get texture() {
        return this._textures?.[0] ?? null;
    }
    /**
     * Gets the list of render textures. If we are not in a multi render target, the list will be null (use the texture getter instead)
     */
    get textures() {
        return this._textures;
    }
    /**
     * Gets the face indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null
     */
    get faceIndices() {
        return this._faceIndices;
    }
    /**
     * Gets the layer indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null
     */
    get layerIndices() {
        return this._layerIndices;
    }
    /**
     * Gets the base array layer of a texture in the textures array
     * This is an number that is calculated based on the layer and face indices set for this texture at that index
     * @param index The index of the texture in the textures array to get the base array layer for
     * @returns the base array layer of the texture at the given index
     */
    getBaseArrayLayer(index) {
        if (!this._textures) {
            return -1;
        }
        const texture = this._textures[index];
        const layerIndex = this._layerIndices?.[index] ?? 0;
        const faceIndex = this._faceIndices?.[index] ?? 0;
        return texture.isCube ? layerIndex * 6 + faceIndex : texture.is3D ? 0 : layerIndex;
    }
    /**
     * Gets the sample count of the render target
     */
    get samples() {
        return this._samples;
    }
    /**
     * Sets the sample count of the render target
     * @param value sample count
     * @param initializeBuffers If set to true, the engine will make an initializing call to drawBuffers (only used when isMulti=true).
     * @param force true to force calling the update sample count engine function even if the current sample count is equal to value
     * @returns the sample count that has been set
     */
    setSamples(value, initializeBuffers = true, force = false) {
        if (this.samples === value && !force) {
            return value;
        }
        const result = this._isMulti
            ? this._engine.updateMultipleRenderTargetTextureSampleCount(this, value, initializeBuffers)
            : this._engine.updateRenderTargetTextureSampleCount(this, value);
        this._samples = value;
        return result;
    }
    /**
     * Resolves the MSAA textures into their non-MSAA version.
     * Note that if samples equals 1 (no MSAA), no resolve is performed.
     */
    resolveMSAATextures() {
        if (this.isMulti) {
            this._engine.resolveMultiFramebuffer(this);
        }
        else {
            this._engine.resolveFramebuffer(this);
        }
    }
    /**
     * Generates mipmaps for each texture of the render target
     */
    generateMipMaps() {
        if (this._engine._currentRenderTarget === this) {
            this._engine.unBindFramebuffer(this, true);
        }
        if (this.isMulti) {
            this._engine.generateMipMapsMultiFramebuffer(this);
        }
        else {
            this._engine.generateMipMapsFramebuffer(this);
        }
    }
    /**
     * Initializes the render target wrapper
     * @param isMulti true if the wrapper is a multi render target
     * @param isCube true if the wrapper should render to a cube texture
     * @param size size of the render target (width/height/layers)
     * @param engine engine used to create the render target
     * @param label defines the label to use for the wrapper (for debugging purpose only)
     */
    constructor(isMulti, isCube, size, engine, label) {
        this._textures = null;
        this._faceIndices = null;
        this._layerIndices = null;
        /** @internal */
        this._samples = 1;
        /** @internal */
        this._attachments = null;
        /** @internal */
        this._generateStencilBuffer = false;
        /** @internal */
        this._generateDepthBuffer = false;
        /** @internal */
        this._depthStencilTextureWithStencil = false;
        /**
         * Sets this property to true to disable the automatic MSAA resolve that happens when the render target wrapper is unbound (default is false)
         */
        this.disableAutomaticMSAAResolve = false;
        /**
         * Indicates if MSAA color texture(s) should be resolved when a resolve occur (either automatically by the engine or manually by the user) (default is true)
         * Note that you can trigger a MSAA resolve at any time by calling resolveMSAATextures()
         */
        this.resolveMSAAColors = true;
        /**
         * Indicates if MSAA depth texture should be resolved when a resolve occur (either automatically by the engine or manually by the user) (default is false)
         */
        this.resolveMSAADepth = false;
        /**
         * Indicates if MSAA stencil texture should be resolved when a resolve occur (either automatically by the engine or manually by the user) (default is false)
         */
        this.resolveMSAAStencil = false;
        this._isMulti = isMulti;
        this._isCube = isCube;
        this._size = size;
        this._engine = engine;
        this._depthStencilTexture = null;
        this.label = label;
    }
    /**
     * Sets the render target texture(s)
     * @param textures texture(s) to set
     */
    setTextures(textures) {
        if (Array.isArray(textures)) {
            this._textures = textures;
        }
        else if (textures) {
            this._textures = [textures];
        }
        else {
            this._textures = null;
        }
    }
    /**
     * Set a texture in the textures array
     * @param texture The texture to set
     * @param index The index in the textures array to set
     * @param disposePrevious If this function should dispose the previous texture
     */
    setTexture(texture, index = 0, disposePrevious = true) {
        if (!this._textures) {
            this._textures = [];
        }
        if (this._textures[index] === texture) {
            return;
        }
        if (this._textures[index] && disposePrevious) {
            this._textures[index].dispose();
        }
        this._textures[index] = texture;
    }
    /**
     * Sets the layer and face indices of every render target texture bound to each color attachment
     * @param layers The layers of each texture to be set
     * @param faces The faces of each texture to be set
     */
    setLayerAndFaceIndices(layers, faces) {
        this._layerIndices = layers;
        this._faceIndices = faces;
    }
    /**
     * Sets the layer and face indices of a texture in the textures array that should be bound to each color attachment
     * @param index The index of the texture in the textures array to modify
     * @param layer The layer of the texture to be set
     * @param face The face of the texture to be set
     */
    setLayerAndFaceIndex(index = 0, layer, face) {
        if (!this._layerIndices) {
            this._layerIndices = [];
        }
        if (!this._faceIndices) {
            this._faceIndices = [];
        }
        if (layer !== undefined && layer >= 0) {
            this._layerIndices[index] = layer;
        }
        if (face !== undefined && face >= 0) {
            this._faceIndices[index] = face;
        }
    }
    /**
     * Creates the depth/stencil texture
     * @param comparisonFunction Comparison function to use for the texture
     * @param bilinearFiltering true if bilinear filtering should be used when sampling the texture
     * @param generateStencil Not used anymore. "format" will be used to determine if stencil should be created
     * @param samples sample count to use when creating the texture (default: 1)
     * @param format format of the depth texture (default: 14)
     * @param label defines the label to use for the texture (for debugging purpose only)
     * @returns the depth/stencil created texture
     */
    createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = true, generateStencil = false, samples = 1, format = 14, label) {
        this._depthStencilTexture?.dispose();
        this._depthStencilTextureWithStencil = generateStencil;
        this._depthStencilTextureLabel = label;
        this._depthStencilTexture = this._engine.createDepthStencilTexture(this._size, {
            bilinearFiltering,
            comparisonFunction,
            generateStencil,
            isCube: this._isCube,
            samples,
            depthTextureFormat: format,
            label,
        }, this);
        return this._depthStencilTexture;
    }
    /**
     * @deprecated Use shareDepth instead
     * @param renderTarget Destination renderTarget
     */
    _shareDepth(renderTarget) {
        this.shareDepth(renderTarget);
    }
    /**
     * Shares the depth buffer of this render target with another render target.
     * @param renderTarget Destination renderTarget
     */
    shareDepth(renderTarget) {
        if (this._depthStencilTexture) {
            if (renderTarget._depthStencilTexture) {
                renderTarget._depthStencilTexture.dispose();
            }
            renderTarget._depthStencilTexture = this._depthStencilTexture;
            renderTarget._depthStencilTextureWithStencil = this._depthStencilTextureWithStencil;
            this._depthStencilTexture.incrementReferences();
        }
    }
    /**
     * @internal
     */
    _swapAndDie(target) {
        if (this.texture) {
            this.texture._swapAndDie(target);
        }
        this._textures = null;
        this.dispose(true);
    }
    _cloneRenderTargetWrapper() {
        let rtw = null;
        if (this._isMulti) {
            const textureArray = this.textures;
            if (textureArray && textureArray.length > 0) {
                let generateDepthTexture = false;
                let textureCount = textureArray.length;
                let depthTextureFormat = -1;
                const lastTextureSource = textureArray[textureArray.length - 1]._source;
                if (lastTextureSource === 14 /* InternalTextureSource.Depth */ || lastTextureSource === 12 /* InternalTextureSource.DepthStencil */) {
                    generateDepthTexture = true;
                    depthTextureFormat = textureArray[textureArray.length - 1].format;
                    textureCount--;
                }
                const samplingModes = [];
                const types = [];
                const formats = [];
                const targetTypes = [];
                const faceIndex = [];
                const layerIndex = [];
                const layerCounts = [];
                const internalTexture2Index = {};
                for (let i = 0; i < textureCount; ++i) {
                    const texture = textureArray[i];
                    samplingModes.push(texture.samplingMode);
                    types.push(texture.type);
                    formats.push(texture.format);
                    const index = internalTexture2Index[texture.uniqueId];
                    if (index !== undefined) {
                        targetTypes.push(-1);
                        layerCounts.push(0);
                    }
                    else {
                        internalTexture2Index[texture.uniqueId] = i;
                        if (texture.is2DArray) {
                            targetTypes.push(35866);
                            layerCounts.push(texture.depth);
                        }
                        else if (texture.isCube) {
                            targetTypes.push(34067);
                            layerCounts.push(0);
                        } /*else if (texture.isCubeArray) {
                            targetTypes.push(3735928559);
                            layerCounts.push(texture.depth);
                        }*/
                        else if (texture.is3D) {
                            targetTypes.push(32879);
                            layerCounts.push(texture.depth);
                        }
                        else {
                            targetTypes.push(3553);
                            layerCounts.push(0);
                        }
                    }
                    if (this._faceIndices) {
                        faceIndex.push(this._faceIndices[i] ?? 0);
                    }
                    if (this._layerIndices) {
                        layerIndex.push(this._layerIndices[i] ?? 0);
                    }
                }
                const optionsMRT = {
                    samplingModes,
                    generateMipMaps: textureArray[0].generateMipMaps,
                    generateDepthBuffer: this._generateDepthBuffer,
                    generateStencilBuffer: this._generateStencilBuffer,
                    generateDepthTexture,
                    depthTextureFormat,
                    types,
                    formats,
                    textureCount,
                    targetTypes,
                    faceIndex,
                    layerIndex,
                    layerCounts,
                    label: this.label,
                };
                const size = {
                    width: this.width,
                    height: this.height,
                    depth: this.depth,
                };
                rtw = this._engine.createMultipleRenderTarget(size, optionsMRT);
                for (let i = 0; i < textureCount; ++i) {
                    if (targetTypes[i] !== -1) {
                        continue;
                    }
                    const index = internalTexture2Index[textureArray[i].uniqueId];
                    rtw.setTexture(rtw.textures[index], i);
                }
            }
        }
        else {
            const options = {};
            options.generateDepthBuffer = this._generateDepthBuffer;
            options.generateMipMaps = this.texture?.generateMipMaps ?? false;
            options.generateStencilBuffer = this._generateStencilBuffer;
            options.samplingMode = this.texture?.samplingMode;
            options.type = this.texture?.type;
            options.format = this.texture?.format;
            options.noColorAttachment = !this._textures;
            options.label = this.label;
            if (this.isCube) {
                rtw = this._engine.createRenderTargetCubeTexture(this.width, options);
            }
            else {
                const size = {
                    width: this.width,
                    height: this.height,
                    layers: this.is2DArray || this.is3D ? this.texture?.depth : undefined,
                };
                rtw = this._engine.createRenderTargetTexture(size, options);
            }
            if (rtw.texture) {
                rtw.texture.isReady = true;
            }
        }
        return rtw;
    }
    _swapRenderTargetWrapper(target) {
        if (this._textures && target._textures) {
            for (let i = 0; i < this._textures.length; ++i) {
                this._textures[i]._swapAndDie(target._textures[i], false);
                target._textures[i].isReady = true;
            }
        }
        if (this._depthStencilTexture && target._depthStencilTexture) {
            this._depthStencilTexture._swapAndDie(target._depthStencilTexture);
            target._depthStencilTexture.isReady = true;
        }
        this._textures = null;
        this._depthStencilTexture = null;
    }
    /** @internal */
    _rebuild() {
        const rtw = this._cloneRenderTargetWrapper();
        if (!rtw) {
            return;
        }
        if (this._depthStencilTexture) {
            const samplingMode = this._depthStencilTexture.samplingMode;
            const format = this._depthStencilTexture.format;
            const bilinear = samplingMode === 2 ||
                samplingMode === 3 ||
                samplingMode === 11;
            rtw.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction, bilinear, this._depthStencilTextureWithStencil, this._depthStencilTexture.samples, format, this._depthStencilTextureLabel);
        }
        if (this.samples > 1) {
            rtw.setSamples(this.samples);
        }
        rtw._swapRenderTargetWrapper(this);
        rtw.dispose();
    }
    /**
     * Releases the internal render textures
     */
    releaseTextures() {
        if (this._textures) {
            for (let i = 0; i < this._textures.length; ++i) {
                this._textures[i].dispose();
            }
        }
        this._textures = null;
    }
    /**
     * Disposes the whole render target wrapper
     * @param disposeOnlyFramebuffers true if only the frame buffers should be released (used for the WebGL engine). If false, all the textures will also be released
     */
    dispose(disposeOnlyFramebuffers = false) {
        if (!disposeOnlyFramebuffers) {
            this._depthStencilTexture?.dispose();
            this._depthStencilTexture = null;
            this.releaseTextures();
        }
        this._engine._releaseRenderTargetWrapper(this);
    }
}
//# sourceMappingURL=renderTargetWrapper.js.map

/***/ }),

/***/ 69610:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   l: () => (/* binding */ ShaderStore)
/* harmony export */ });
/**
 * Defines the shader related stores and directory
 */
class ShaderStore {
    /**
     * Gets the shaders repository path for a given shader language
     * @param shaderLanguage the shader language
     * @returns the path to the shaders repository
     */
    static GetShadersRepository(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        return shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? ShaderStore.ShadersRepository : ShaderStore.ShadersRepositoryWGSL;
    }
    /**
     * Gets the shaders store of a given shader language
     * @param shaderLanguage the shader language
     * @returns the shaders store
     */
    static GetShadersStore(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        return shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? ShaderStore.ShadersStore : ShaderStore.ShadersStoreWGSL;
    }
    /**
     * Gets the include shaders store of a given shader language
     * @param shaderLanguage the shader language
     * @returns the include shaders store
     */
    static GetIncludesShadersStore(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        return shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL;
    }
}
/**
 * Gets or sets the relative url used to load shaders if using the engine in non-minified mode
 */
ShaderStore.ShadersRepository = "src/Shaders/";
/**
 * Store of each shader (The can be looked up using effect.key)
 */
ShaderStore.ShadersStore = {};
/**
 * Store of each included file for a shader (The can be looked up using effect.key)
 */
ShaderStore.IncludesShadersStore = {};
/**
 * Gets or sets the relative url used to load shaders (WGSL) if using the engine in non-minified mode
 */
ShaderStore.ShadersRepositoryWGSL = "src/ShadersWGSL/";
/**
 * Store of each shader  (WGSL)
 */
ShaderStore.ShadersStoreWGSL = {};
/**
 * Store of each included file for a shader (WGSL)
 */
ShaderStore.IncludesShadersStoreWGSL = {};
//# sourceMappingURL=shaderStore.js.map

/***/ }),

/***/ 62484:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A5: () => (/* binding */ _isRenderingStateCompiled),
/* harmony export */   C5: () => (/* binding */ _setProgram),
/* harmony export */   Cm: () => (/* binding */ deleteStateObject),
/* harmony export */   EX: () => (/* binding */ createShaderProgram),
/* harmony export */   GX: () => (/* binding */ createPipelineContext),
/* harmony export */   N5: () => (/* binding */ getStateObject),
/* harmony export */   YM: () => (/* binding */ _preparePipelineContext),
/* harmony export */   bS: () => (/* binding */ _executeWhenRenderingStateIsCompiled),
/* harmony export */   kf: () => (/* binding */ createRawShaderProgram),
/* harmony export */   tI: () => (/* binding */ _createShaderProgram),
/* harmony export */   tg: () => (/* binding */ _finalizePipelineContext)
/* harmony export */ });
/* harmony import */ var _WebGL_webGLPipelineContext_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1886);
/* harmony import */ var _abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16741);


/**
 * @internal
 */
const _stateObject = new WeakMap();
/**
 * This will be used in cases where the engine doesn't have a context (like the nullengine)
 */
const singleStateObject = {
    _webGLVersion: 2,
    cachedPipelines: {},
};
/**
 * get or create a state object for the given context
 * Note - Used in WebGL only at the moment.
 * @param context The context to get the state object from
 * @returns the state object
 * @internal
 */
function getStateObject(context) {
    let state = _stateObject.get(context);
    if (!state) {
        if (!context) {
            return singleStateObject;
        }
        state = {
            // use feature detection. instanceof returns false. This only exists on WebGL2 context
            _webGLVersion: context.TEXTURE_BINDING_3D ? 2 : 1,
            _context: context,
            // when using the function without an engine we need to set it to enable parallel compilation
            parallelShaderCompile: context.getExtension("KHR_parallel_shader_compile") || undefined,
            cachedPipelines: {},
        };
        _stateObject.set(context, state);
    }
    return state;
}
/**
 * Remove the state object that belongs to the specific context
 * @param context the context that is being
 */
function deleteStateObject(context) {
    _stateObject.delete(context);
}
/**
 * Directly creates a webGL program
 * @param pipelineContext  defines the pipeline context to attach to
 * @param vertexCode defines the vertex shader code to use
 * @param fragmentCode defines the fragment shader code to use
 * @param context defines the webGL context to use (if not set, the current one will be used)
 * @param transformFeedbackVaryings defines the list of transform feedback varyings to use
 * @param _createShaderProgramInjection defines an optional injection to use to create the shader program
 * @returns the new webGL program
 */
function createRawShaderProgram(pipelineContext, vertexCode, fragmentCode, context, transformFeedbackVaryings, _createShaderProgramInjection) {
    const stateObject = getStateObject(context);
    if (!_createShaderProgramInjection) {
        _createShaderProgramInjection = stateObject._createShaderProgramInjection ?? _createShaderProgram;
    }
    const vertexShader = _compileRawShader(vertexCode, "vertex", context, stateObject._contextWasLost);
    const fragmentShader = _compileRawShader(fragmentCode, "fragment", context, stateObject._contextWasLost);
    return _createShaderProgramInjection(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings, stateObject.validateShaderPrograms);
}
/**
 * Creates a webGL program
 * @param pipelineContext  defines the pipeline context to attach to
 * @param vertexCode  defines the vertex shader code to use
 * @param fragmentCode defines the fragment shader code to use
 * @param defines defines the string containing the defines to use to compile the shaders
 * @param context defines the webGL context to use (if not set, the current one will be used)
 * @param transformFeedbackVaryings defines the list of transform feedback varyings to use
 * @param _createShaderProgramInjection defines an optional injection to use to create the shader program
 * @returns the new webGL program
 */
function createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings = null, _createShaderProgramInjection) {
    const stateObject = getStateObject(context);
    if (!_createShaderProgramInjection) {
        _createShaderProgramInjection = stateObject._createShaderProgramInjection ?? _createShaderProgram;
    }
    const shaderVersion = stateObject._webGLVersion > 1 ? "#version 300 es\n#define WEBGL2 \n" : "";
    const vertexShader = _compileShader(vertexCode, "vertex", defines, shaderVersion, context, stateObject._contextWasLost);
    const fragmentShader = _compileShader(fragmentCode, "fragment", defines, shaderVersion, context, stateObject._contextWasLost);
    return _createShaderProgramInjection(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings, stateObject.validateShaderPrograms);
}
/**
 * Creates a new pipeline context. Note, make sure to attach an engine instance to the created context
 * @param context defines the webGL context to use (if not set, the current one will be used)
 * @param _shaderProcessingContext defines the shader processing context used during the processing if available
 * @returns the new pipeline
 */
function createPipelineContext(context, _shaderProcessingContext) {
    const pipelineContext = new _WebGL_webGLPipelineContext_js__WEBPACK_IMPORTED_MODULE_0__/* .WebGLPipelineContext */ .x();
    const stateObject = getStateObject(context);
    if (stateObject.parallelShaderCompile) {
        pipelineContext.isParallelCompiled = true;
    }
    pipelineContext.context = stateObject._context;
    return pipelineContext;
}
/**
 * @internal
 */
function _createShaderProgram(pipelineContext, vertexShader, fragmentShader, context, _transformFeedbackVaryings = null, validateShaderPrograms) {
    const shaderProgram = context.createProgram();
    pipelineContext.program = shaderProgram;
    if (!shaderProgram) {
        throw new Error("Unable to create program");
    }
    context.attachShader(shaderProgram, vertexShader);
    context.attachShader(shaderProgram, fragmentShader);
    context.linkProgram(shaderProgram);
    pipelineContext.context = context;
    pipelineContext.vertexShader = vertexShader;
    pipelineContext.fragmentShader = fragmentShader;
    if (!pipelineContext.isParallelCompiled) {
        _finalizePipelineContext(pipelineContext, context, validateShaderPrograms);
    }
    return shaderProgram;
}
/**
 * @internal
 */
function _isRenderingStateCompiled(pipelineContext, gl, validateShaderPrograms) {
    const webGLPipelineContext = pipelineContext;
    if (webGLPipelineContext._isDisposed) {
        return false;
    }
    const stateObject = getStateObject(gl);
    if (gl.getProgramParameter(webGLPipelineContext.program, stateObject.parallelShaderCompile.COMPLETION_STATUS_KHR)) {
        _finalizePipelineContext(webGLPipelineContext, gl, validateShaderPrograms);
        return true;
    }
    return false;
}
/**
 * @internal
 */
function _finalizePipelineContext(pipelineContext, gl, validateShaderPrograms) {
    const context = pipelineContext.context;
    const vertexShader = pipelineContext.vertexShader;
    const fragmentShader = pipelineContext.fragmentShader;
    const program = pipelineContext.program;
    const linked = context.getProgramParameter(program, context.LINK_STATUS);
    if (!linked) {
        // Get more info
        // Vertex
        if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
            const log = gl.getShaderInfoLog(vertexShader);
            if (log) {
                pipelineContext.vertexCompilationError = log;
                throw new Error("VERTEX SHADER " + log);
            }
        }
        // Fragment
        if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
            const log = gl.getShaderInfoLog(fragmentShader);
            if (log) {
                pipelineContext.fragmentCompilationError = log;
                throw new Error("FRAGMENT SHADER " + log);
            }
        }
        const error = context.getProgramInfoLog(program);
        if (error) {
            pipelineContext.programLinkError = error;
            throw new Error(error);
        }
    }
    if ( /*this.*/validateShaderPrograms) {
        context.validateProgram(program);
        const validated = context.getProgramParameter(program, context.VALIDATE_STATUS);
        if (!validated) {
            const error = context.getProgramInfoLog(program);
            if (error) {
                pipelineContext.programValidationError = error;
                throw new Error(error);
            }
        }
    }
    context.deleteShader(vertexShader);
    context.deleteShader(fragmentShader);
    pipelineContext.vertexShader = undefined;
    pipelineContext.fragmentShader = undefined;
    if (pipelineContext.onCompiled) {
        pipelineContext.onCompiled();
        pipelineContext.onCompiled = undefined;
    }
}
/**
 * @internal
 */
function _preparePipelineContext(pipelineContext, vertexSourceCode, fragmentSourceCode, createAsRaw, _rawVertexSourceCode, _rawFragmentSourceCode, rebuildRebind, defines, transformFeedbackVaryings, _key = "", onReady, createRawShaderProgramInjection, createShaderProgramInjection) {
    const stateObject = getStateObject(pipelineContext.context);
    if (!createRawShaderProgramInjection) {
        createRawShaderProgramInjection = stateObject.createRawShaderProgramInjection ?? createRawShaderProgram;
    }
    if (!createShaderProgramInjection) {
        createShaderProgramInjection = stateObject.createShaderProgramInjection ?? createShaderProgram;
    }
    const webGLRenderingState = pipelineContext;
    if (createAsRaw) {
        webGLRenderingState.program = createRawShaderProgramInjection(webGLRenderingState, vertexSourceCode, fragmentSourceCode, webGLRenderingState.context, transformFeedbackVaryings);
    }
    else {
        webGLRenderingState.program = createShaderProgramInjection(webGLRenderingState, vertexSourceCode, fragmentSourceCode, defines, webGLRenderingState.context, transformFeedbackVaryings);
    }
    webGLRenderingState.program.__SPECTOR_rebuildProgram = rebuildRebind;
    onReady();
}
function _compileShader(source, type, defines, shaderVersion, gl, _contextWasLost) {
    return _compileRawShader((0,_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_1__/* ._ConcatenateShader */ .iL)(source, defines, shaderVersion), type, gl, _contextWasLost);
}
function _compileRawShader(source, type, gl, _contextWasLost) {
    const shader = gl.createShader(type === "vertex" ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);
    if (!shader) {
        let error = gl.NO_ERROR;
        let tempError = gl.NO_ERROR;
        while ((tempError = gl.getError()) !== gl.NO_ERROR) {
            error = tempError;
        }
        throw new Error(`Something went wrong while creating a gl ${type} shader object. gl error=${error}, gl isContextLost=${gl.isContextLost()}, _contextWasLost=${_contextWasLost}`);
    }
    gl.shaderSource(shader, source);
    gl.compileShader(shader);
    return shader;
}
/**
 * @internal
 */
function _setProgram(program, gl) {
    gl.useProgram(program);
}
/**
 * @internal
 */
function _executeWhenRenderingStateIsCompiled(pipelineContext, action) {
    const webGLPipelineContext = pipelineContext;
    if (!webGLPipelineContext.isParallelCompiled) {
        action(pipelineContext);
        return;
    }
    const oldHandler = webGLPipelineContext.onCompiled;
    webGLPipelineContext.onCompiled = () => {
        oldHandler?.();
        action(pipelineContext);
    };
}
//# sourceMappingURL=thinEngine.functions.js.map

/***/ }),

/***/ 86514:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  ThinEngine: () => (/* binding */ ThinEngine)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/thinEngine.functions.js
var thinEngine_functions = __webpack_require__(62484);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/drawWrapper.functions.js
var drawWrapper_functions = __webpack_require__(70767);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__(51137);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/domManagement.js
var domManagement = __webpack_require__(18790);
;// ./node_modules/@babylonjs/core/Engines/WebGL/webGLShaderProcessors.js
/** @internal */
class WebGLShaderProcessor {
    constructor() {
        this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;
    }
    postProcessor(code, defines, isFragment, processingContext, parameters) {
        // Remove extensions
        if (parameters.drawBuffersExtensionDisabled) {
            // even if enclosed in #if/#endif, IE11 does parse the #extension declaration, so we need to remove it altogether
            const regex = /#extension.+GL_EXT_draw_buffers.+(enable|require)/g;
            code = code.replace(regex, "");
        }
        return code;
    }
}
//# sourceMappingURL=webGLShaderProcessors.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGL2ShaderProcessors.js
var webGL2ShaderProcessors = __webpack_require__(58349);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js
var webGLDataBuffer = __webpack_require__(54329);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.functions.js
var tools_functions = __webpack_require__(91597);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/abstractEngine.js
var abstractEngine = __webpack_require__(32206);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.js
var webGLHardwareTexture = __webpack_require__(67716);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js
var internalTexture = __webpack_require__(81194);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effect.js
var Materials_effect = __webpack_require__(74420);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/abstractEngine.functions.js
var abstractEngine_functions = __webpack_require__(16741);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effect.functions.js
var effect_functions = __webpack_require__(57647);
;// ./node_modules/@babylonjs/core/Engines/thinEngine.js















/**
 * Keeps track of all the buffer info used in engine.
 */
class BufferPointer {
}
/**
 * The base engine class (root of all engines)
 */
class ThinEngine extends abstractEngine/* AbstractEngine */.$ {
    /**
     * Gets or sets the name of the engine
     */
    get name() {
        return this._name;
    }
    set name(value) {
        this._name = value;
    }
    /**
     * Returns the version of the engine
     */
    get version() {
        return this._webGLVersion;
    }
    /**
     * Gets or sets the relative url used to load shaders if using the engine in non-minified mode
     */
    static get ShadersRepository() {
        return Materials_effect/* Effect */.M.ShadersRepository;
    }
    static set ShadersRepository(value) {
        Materials_effect/* Effect */.M.ShadersRepository = value;
    }
    /**
     * Gets a boolean indicating that the engine supports uniform buffers
     * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
     */
    get supportsUniformBuffers() {
        return this.webGLVersion > 1 && !this.disableUniformBuffers;
    }
    /**
     * Gets a boolean indicating that only power of 2 textures are supported
     * Please note that you can still use non power of 2 textures but in this case the engine will forcefully convert them
     */
    get needPOTTextures() {
        return this._webGLVersion < 2 || this.forcePOTTextures;
    }
    get _supportsHardwareTextureRescaling() {
        return false;
    }
    /**
     * sets the object from which width and height will be taken from when getting render width and height
     * Will fallback to the gl object
     * @param dimensions the framebuffer width and height that will be used.
     */
    set framebufferDimensionsObject(dimensions) {
        this._framebufferDimensionsObject = dimensions;
    }
    /**
     * Creates a new snapshot at the next frame using the current snapshotRenderingMode
     */
    snapshotRenderingReset() {
        this.snapshotRendering = false;
    }
    /**
     * Creates a new engine
     * @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which already used the WebGL context
     * @param antialias defines whether anti-aliasing should be enabled (default value is "undefined", meaning that the browser may or may not enable it)
     * @param options defines further options to be sent to the getContext() function
     * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
     */
    constructor(canvasOrContext, antialias, options, adaptToDeviceRatio) {
        options = options || {};
        super(antialias ?? options.antialias, options, adaptToDeviceRatio);
        /** @internal */
        this._name = "WebGL";
        /**
         * Gets or sets a boolean that indicates if textures must be forced to power of 2 size even if not required
         */
        this.forcePOTTextures = false;
        /** Gets or sets a boolean indicating if the engine should validate programs after compilation */
        this.validateShaderPrograms = false;
        /**
         * Gets or sets a boolean indicating that uniform buffers must be disabled even if they are supported
         */
        this.disableUniformBuffers = false;
        /** @internal */
        this._webGLVersion = 1.0;
        this._vertexAttribArraysEnabled = [];
        this._uintIndicesCurrentlySet = false;
        this._currentBoundBuffer = new Array();
        /** @internal */
        this._currentFramebuffer = null;
        /** @internal */
        this._dummyFramebuffer = null;
        this._currentBufferPointers = new Array();
        this._currentInstanceLocations = new Array();
        this._currentInstanceBuffers = new Array();
        this._vaoRecordInProgress = false;
        this._mustWipeVertexAttributes = false;
        this._nextFreeTextureSlots = new Array();
        this._maxSimultaneousTextures = 0;
        this._maxMSAASamplesOverride = null;
        this._unpackFlipYCached = null;
        /**
         * In case you are sharing the context with other applications, it might
         * be interested to not cache the unpack flip y state to ensure a consistent
         * value would be set.
         */
        this.enableUnpackFlipYCached = true;
        /**
         * @internal
         */
        this._boundUniforms = {};
        if (!canvasOrContext) {
            return;
        }
        let canvas = null;
        if (canvasOrContext.getContext) {
            canvas = canvasOrContext;
            this._renderingCanvas = canvas;
            if (options.preserveDrawingBuffer === undefined) {
                options.preserveDrawingBuffer = false;
            }
            if (options.xrCompatible === undefined) {
                options.xrCompatible = false;
            }
            // Exceptions
            if (navigator && navigator.userAgent) {
                this._setupMobileChecks();
                const ua = navigator.userAgent;
                for (const exception of ThinEngine.ExceptionList) {
                    const key = exception.key;
                    const targets = exception.targets;
                    const check = new RegExp(key);
                    if (check.test(ua)) {
                        if (exception.capture && exception.captureConstraint) {
                            const capture = exception.capture;
                            const constraint = exception.captureConstraint;
                            const regex = new RegExp(capture);
                            const matches = regex.exec(ua);
                            if (matches && matches.length > 0) {
                                const capturedValue = parseInt(matches[matches.length - 1]);
                                if (capturedValue >= constraint) {
                                    continue;
                                }
                            }
                        }
                        for (const target of targets) {
                            switch (target) {
                                case "uniformBuffer":
                                    this.disableUniformBuffers = true;
                                    break;
                                case "vao":
                                    this.disableVertexArrayObjects = true;
                                    break;
                                case "antialias":
                                    options.antialias = false;
                                    break;
                                case "maxMSAASamples":
                                    this._maxMSAASamplesOverride = 1;
                                    break;
                            }
                        }
                    }
                }
            }
            // Context lost
            if (!this._doNotHandleContextLost) {
                this._onContextLost = (evt) => {
                    evt.preventDefault();
                    this._contextWasLost = true;
                    logger/* Logger */.V.Warn("WebGL context lost.");
                    this.onContextLostObservable.notifyObservers(this);
                };
                this._onContextRestored = () => {
                    this._restoreEngineAfterContextLost(() => this._initGLContext());
                };
                canvas.addEventListener("webglcontextlost", this._onContextLost, false);
                canvas.addEventListener("webglcontextrestored", this._onContextRestored, false);
                options.powerPreference = options.powerPreference || "high-performance";
            }
            if (this._badDesktopOS) {
                options.xrCompatible = false;
            }
            // GL
            if (!options.disableWebGL2Support) {
                try {
                    this._gl = (canvas.getContext("webgl2", options) || canvas.getContext("experimental-webgl2", options));
                    if (this._gl) {
                        this._webGLVersion = 2.0;
                        this._shaderPlatformName = "WEBGL2";
                        // Prevent weird browsers to lie (yeah that happens!)
                        if (!this._gl.deleteQuery) {
                            this._webGLVersion = 1.0;
                            this._shaderPlatformName = "WEBGL1";
                        }
                    }
                }
                catch (e) {
                    // Do nothing
                }
            }
            if (!this._gl) {
                if (!canvas) {
                    throw new Error("The provided canvas is null or undefined.");
                }
                try {
                    this._gl = (canvas.getContext("webgl", options) || canvas.getContext("experimental-webgl", options));
                }
                catch (e) {
                    throw new Error("WebGL not supported");
                }
            }
            if (!this._gl) {
                throw new Error("WebGL not supported");
            }
        }
        else {
            this._gl = canvasOrContext;
            this._renderingCanvas = this._gl.canvas;
            if (this._gl.renderbufferStorageMultisample) {
                this._webGLVersion = 2.0;
                this._shaderPlatformName = "WEBGL2";
            }
            else {
                this._shaderPlatformName = "WEBGL1";
            }
            const attributes = this._gl.getContextAttributes();
            if (attributes) {
                options.stencil = attributes.stencil;
            }
        }
        // Ensures a consistent color space unpacking of textures cross browser.
        this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE);
        if (options.useHighPrecisionFloats !== undefined) {
            this._highPrecisionShadersAllowed = options.useHighPrecisionFloats;
        }
        this.resize();
        this._initGLContext();
        this._initFeatures();
        // Prepare buffer pointers
        for (let i = 0; i < this._caps.maxVertexAttribs; i++) {
            this._currentBufferPointers[i] = new BufferPointer();
        }
        // Shader processor
        this._shaderProcessor = this.webGLVersion > 1 ? new webGL2ShaderProcessors/* WebGL2ShaderProcessor */.B() : new WebGLShaderProcessor();
        // Starting with iOS 14, we can trust the browser
        // let matches = navigator.userAgent.match(/Version\/(\d+)/);
        // if (matches && matches.length === 2) {
        //     if (parseInt(matches[1]) >= 14) {
        //         this._badOS = false;
        //     }
        // }
        const versionToLog = `Babylon.js v${ThinEngine.Version}`;
        logger/* Logger */.V.Log(versionToLog + ` - ${this.description}`);
        // Check setAttribute in case of workers
        if (this._renderingCanvas && this._renderingCanvas.setAttribute) {
            this._renderingCanvas.setAttribute("data-engine", versionToLog);
        }
        const stateObject = (0,thinEngine_functions/* getStateObject */.N5)(this._gl);
        // update state object with the current engine state
        stateObject.validateShaderPrograms = this.validateShaderPrograms;
        stateObject.parallelShaderCompile = this._caps.parallelShaderCompile;
    }
    _clearEmptyResources() {
        this._dummyFramebuffer = null;
        super._clearEmptyResources();
    }
    /**
     * @internal
     */
    _getShaderProcessingContext(shaderLanguage) {
        return null;
    }
    /**
     * Gets a boolean indicating if all created effects are ready
     * @returns true if all effects are ready
     */
    areAllEffectsReady() {
        for (const key in this._compiledEffects) {
            const effect = this._compiledEffects[key];
            if (!effect.isReady()) {
                return false;
            }
        }
        return true;
    }
    _initGLContext() {
        // Caps
        this._caps = {
            maxTexturesImageUnits: this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),
            maxCombinedTexturesImageUnits: this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),
            maxVertexTextureImageUnits: this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
            maxTextureSize: this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),
            maxSamples: this._webGLVersion > 1 ? this._gl.getParameter(this._gl.MAX_SAMPLES) : 1,
            maxCubemapTextureSize: this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),
            maxRenderTextureSize: this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),
            maxVertexAttribs: this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),
            maxVaryingVectors: this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),
            maxFragmentUniformVectors: this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),
            maxVertexUniformVectors: this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),
            parallelShaderCompile: this._gl.getExtension("KHR_parallel_shader_compile") || undefined,
            standardDerivatives: this._webGLVersion > 1 || this._gl.getExtension("OES_standard_derivatives") !== null,
            maxAnisotropy: 1,
            astc: this._gl.getExtension("WEBGL_compressed_texture_astc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),
            bptc: this._gl.getExtension("EXT_texture_compression_bptc") || this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),
            s3tc: this._gl.getExtension("WEBGL_compressed_texture_s3tc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),
            // eslint-disable-next-line @typescript-eslint/naming-convention
            s3tc_srgb: this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),
            pvrtc: this._gl.getExtension("WEBGL_compressed_texture_pvrtc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
            etc1: this._gl.getExtension("WEBGL_compressed_texture_etc1") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),
            etc2: this._gl.getExtension("WEBGL_compressed_texture_etc") ||
                this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc") ||
                this._gl.getExtension("WEBGL_compressed_texture_es3_0"), // also a requirement of OpenGL ES 3
            textureAnisotropicFilterExtension: this._gl.getExtension("EXT_texture_filter_anisotropic") ||
                this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic") ||
                this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),
            uintIndices: this._webGLVersion > 1 || this._gl.getExtension("OES_element_index_uint") !== null,
            fragmentDepthSupported: this._webGLVersion > 1 || this._gl.getExtension("EXT_frag_depth") !== null,
            highPrecisionShaderSupported: false,
            timerQuery: this._gl.getExtension("EXT_disjoint_timer_query_webgl2") || this._gl.getExtension("EXT_disjoint_timer_query"),
            supportOcclusionQuery: this._webGLVersion > 1,
            canUseTimestampForTimerQuery: false,
            drawBuffersExtension: false,
            maxMSAASamples: 1,
            colorBufferFloat: !!(this._webGLVersion > 1 && this._gl.getExtension("EXT_color_buffer_float")),
            supportFloatTexturesResolve: false,
            rg11b10ufColorRenderable: false,
            colorBufferHalfFloat: !!(this._webGLVersion > 1 && this._gl.getExtension("EXT_color_buffer_half_float")),
            textureFloat: this._webGLVersion > 1 || this._gl.getExtension("OES_texture_float") ? true : false,
            textureHalfFloat: this._webGLVersion > 1 || this._gl.getExtension("OES_texture_half_float") ? true : false,
            textureHalfFloatRender: false,
            textureFloatLinearFiltering: false,
            textureFloatRender: false,
            textureHalfFloatLinearFiltering: false,
            vertexArrayObject: false,
            instancedArrays: false,
            textureLOD: this._webGLVersion > 1 || this._gl.getExtension("EXT_shader_texture_lod") ? true : false,
            texelFetch: this._webGLVersion !== 1,
            blendMinMax: false,
            multiview: this._gl.getExtension("OVR_multiview2"),
            oculusMultiview: this._gl.getExtension("OCULUS_multiview"),
            depthTextureExtension: false,
            canUseGLInstanceID: this._webGLVersion > 1,
            canUseGLVertexID: this._webGLVersion > 1,
            supportComputeShaders: false,
            supportSRGBBuffers: false,
            supportTransformFeedbacks: this._webGLVersion > 1,
            textureMaxLevel: this._webGLVersion > 1,
            texture2DArrayMaxLayerCount: this._webGLVersion > 1 ? this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS) : 128,
            disableMorphTargetTexture: false,
            textureNorm16: this._gl.getExtension("EXT_texture_norm16") ? true : false,
        };
        this._caps.supportFloatTexturesResolve = this._caps.colorBufferFloat;
        this._caps.rg11b10ufColorRenderable = this._caps.colorBufferFloat;
        // Infos
        this._glVersion = this._gl.getParameter(this._gl.VERSION);
        const rendererInfo = this._gl.getExtension("WEBGL_debug_renderer_info");
        if (rendererInfo != null) {
            this._glRenderer = this._gl.getParameter(rendererInfo.UNMASKED_RENDERER_WEBGL);
            this._glVendor = this._gl.getParameter(rendererInfo.UNMASKED_VENDOR_WEBGL);
        }
        if (!this._glVendor) {
            this._glVendor = this._gl.getParameter(this._gl.VENDOR) || "Unknown vendor";
        }
        if (!this._glRenderer) {
            this._glRenderer = this._gl.getParameter(this._gl.RENDERER) || "Unknown renderer";
        }
        // Constants
        if (this._gl.HALF_FLOAT_OES !== 0x8d61) {
            this._gl.HALF_FLOAT_OES = 0x8d61; // Half floating-point type (16-bit).
        }
        if (this._gl.RGBA16F !== 0x881a) {
            this._gl.RGBA16F = 0x881a; // RGBA 16-bit floating-point color-renderable internal sized format.
        }
        if (this._gl.RGBA32F !== 0x8814) {
            this._gl.RGBA32F = 0x8814; // RGBA 32-bit floating-point color-renderable internal sized format.
        }
        if (this._gl.DEPTH24_STENCIL8 !== 35056) {
            this._gl.DEPTH24_STENCIL8 = 35056;
        }
        // Extensions
        if (this._caps.timerQuery) {
            if (this._webGLVersion === 1) {
                this._gl.getQuery = this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery);
            }
            // WebGLQuery casted to number to avoid TS error
            this._caps.canUseTimestampForTimerQuery = (this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT, this._caps.timerQuery.QUERY_COUNTER_BITS_EXT) ?? 0) > 0;
        }
        this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension
            ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT)
            : 0;
        this._caps.textureFloatLinearFiltering = this._caps.textureFloat && this._gl.getExtension("OES_texture_float_linear") ? true : false;
        this._caps.textureFloatRender = this._caps.textureFloat && this._canRenderToFloatFramebuffer() ? true : false;
        this._caps.textureHalfFloatLinearFiltering =
            this._webGLVersion > 1 || (this._caps.textureHalfFloat && this._gl.getExtension("OES_texture_half_float_linear")) ? true : false;
        if (this._caps.textureNorm16) {
            this._gl.R16_EXT = 0x822a;
            this._gl.RG16_EXT = 0x822c;
            this._gl.RGB16_EXT = 0x8054;
            this._gl.RGBA16_EXT = 0x805b;
            this._gl.R16_SNORM_EXT = 0x8f98;
            this._gl.RG16_SNORM_EXT = 0x8f99;
            this._gl.RGB16_SNORM_EXT = 0x8f9a;
            this._gl.RGBA16_SNORM_EXT = 0x8f9b;
        }
        // Compressed formats
        if (this._caps.astc) {
            this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
        }
        if (this._caps.bptc) {
            this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;
        }
        if (this._caps.s3tc_srgb) {
            this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT;
            this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
            this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
        }
        if (this._caps.etc2) {
            this._gl.COMPRESSED_SRGB8_ETC2 = this._caps.etc2.COMPRESSED_SRGB8_ETC2;
            this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
        }
        // Checks if some of the format renders first to allow the use of webgl inspector.
        if (this._webGLVersion > 1) {
            if (this._gl.HALF_FLOAT_OES !== 0x140b) {
                this._gl.HALF_FLOAT_OES = 0x140b;
            }
        }
        this._caps.textureHalfFloatRender = this._caps.textureHalfFloat && this._canRenderToHalfFloatFramebuffer();
        // Draw buffers
        if (this._webGLVersion > 1) {
            this._caps.drawBuffersExtension = true;
            this._caps.maxMSAASamples = this._maxMSAASamplesOverride !== null ? this._maxMSAASamplesOverride : this._gl.getParameter(this._gl.MAX_SAMPLES);
            this._caps.maxDrawBuffers = this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);
        }
        else {
            const drawBuffersExtension = this._gl.getExtension("WEBGL_draw_buffers");
            if (drawBuffersExtension !== null) {
                this._caps.drawBuffersExtension = true;
                this._gl.drawBuffers = drawBuffersExtension.drawBuffersWEBGL.bind(drawBuffersExtension);
                this._caps.maxDrawBuffers = this._gl.getParameter(drawBuffersExtension.MAX_DRAW_BUFFERS_WEBGL);
                this._gl.DRAW_FRAMEBUFFER = this._gl.FRAMEBUFFER;
                for (let i = 0; i < 16; i++) {
                    this._gl["COLOR_ATTACHMENT" + i + "_WEBGL"] = drawBuffersExtension["COLOR_ATTACHMENT" + i + "_WEBGL"];
                }
            }
        }
        // Depth Texture
        if (this._webGLVersion > 1) {
            this._caps.depthTextureExtension = true;
        }
        else {
            const depthTextureExtension = this._gl.getExtension("WEBGL_depth_texture");
            if (depthTextureExtension != null) {
                this._caps.depthTextureExtension = true;
                this._gl.UNSIGNED_INT_24_8 = depthTextureExtension.UNSIGNED_INT_24_8_WEBGL;
            }
        }
        // Vertex array object
        if (this.disableVertexArrayObjects) {
            this._caps.vertexArrayObject = false;
        }
        else if (this._webGLVersion > 1) {
            this._caps.vertexArrayObject = true;
        }
        else {
            const vertexArrayObjectExtension = this._gl.getExtension("OES_vertex_array_object");
            if (vertexArrayObjectExtension != null) {
                this._caps.vertexArrayObject = true;
                this._gl.createVertexArray = vertexArrayObjectExtension.createVertexArrayOES.bind(vertexArrayObjectExtension);
                this._gl.bindVertexArray = vertexArrayObjectExtension.bindVertexArrayOES.bind(vertexArrayObjectExtension);
                this._gl.deleteVertexArray = vertexArrayObjectExtension.deleteVertexArrayOES.bind(vertexArrayObjectExtension);
            }
        }
        // Instances count
        if (this._webGLVersion > 1) {
            this._caps.instancedArrays = true;
        }
        else {
            const instanceExtension = this._gl.getExtension("ANGLE_instanced_arrays");
            if (instanceExtension != null) {
                this._caps.instancedArrays = true;
                this._gl.drawArraysInstanced = instanceExtension.drawArraysInstancedANGLE.bind(instanceExtension);
                this._gl.drawElementsInstanced = instanceExtension.drawElementsInstancedANGLE.bind(instanceExtension);
                this._gl.vertexAttribDivisor = instanceExtension.vertexAttribDivisorANGLE.bind(instanceExtension);
            }
            else {
                this._caps.instancedArrays = false;
            }
        }
        if (this._gl.getShaderPrecisionFormat) {
            const vertexhighp = this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER, this._gl.HIGH_FLOAT);
            const fragmenthighp = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT);
            if (vertexhighp && fragmenthighp) {
                this._caps.highPrecisionShaderSupported = vertexhighp.precision !== 0 && fragmenthighp.precision !== 0;
            }
        }
        if (this._webGLVersion > 1) {
            this._caps.blendMinMax = true;
        }
        else {
            const blendMinMaxExtension = this._gl.getExtension("EXT_blend_minmax");
            if (blendMinMaxExtension != null) {
                this._caps.blendMinMax = true;
                this._gl.MAX = blendMinMaxExtension.MAX_EXT;
                this._gl.MIN = blendMinMaxExtension.MIN_EXT;
            }
        }
        // sRGB buffers
        // only run this if not already set to true (in the constructor, for example)
        if (!this._caps.supportSRGBBuffers) {
            if (this._webGLVersion > 1) {
                this._caps.supportSRGBBuffers = true;
                this._glSRGBExtensionValues = {
                    SRGB: WebGL2RenderingContext.SRGB,
                    SRGB8: WebGL2RenderingContext.SRGB8,
                    SRGB8_ALPHA8: WebGL2RenderingContext.SRGB8_ALPHA8,
                };
            }
            else {
                const sRGBExtension = this._gl.getExtension("EXT_sRGB");
                if (sRGBExtension != null) {
                    this._caps.supportSRGBBuffers = true;
                    this._glSRGBExtensionValues = {
                        SRGB: sRGBExtension.SRGB_EXT,
                        SRGB8: sRGBExtension.SRGB_ALPHA_EXT,
                        SRGB8_ALPHA8: sRGBExtension.SRGB_ALPHA_EXT,
                    };
                }
            }
            // take into account the forced state that was provided in options
            if (this._creationOptions) {
                const forceSRGBBufferSupportState = this._creationOptions.forceSRGBBufferSupportState;
                if (forceSRGBBufferSupportState !== undefined) {
                    this._caps.supportSRGBBuffers = this._caps.supportSRGBBuffers && forceSRGBBufferSupportState;
                }
            }
        }
        // Depth buffer
        this._depthCullingState.depthTest = true;
        this._depthCullingState.depthFunc = this._gl.LEQUAL;
        this._depthCullingState.depthMask = true;
        // Texture maps
        this._maxSimultaneousTextures = this._caps.maxCombinedTexturesImageUnits;
        for (let slot = 0; slot < this._maxSimultaneousTextures; slot++) {
            this._nextFreeTextureSlots.push(slot);
        }
        if (this._glRenderer === "Mali-G72") {
            // Overcome a bug when using a texture to store morph targets on Mali-G72
            this._caps.disableMorphTargetTexture = true;
        }
    }
    _initFeatures() {
        this._features = {
            forceBitmapOverHTMLImageElement: typeof HTMLImageElement === "undefined",
            supportRenderAndCopyToLodForFloatTextures: this._webGLVersion !== 1,
            supportDepthStencilTexture: this._webGLVersion !== 1,
            supportShadowSamplers: this._webGLVersion !== 1,
            uniformBufferHardCheckMatrix: false,
            allowTexturePrefiltering: this._webGLVersion !== 1,
            trackUbosInFrame: false,
            checkUbosContentBeforeUpload: false,
            supportCSM: this._webGLVersion !== 1,
            basisNeedsPOT: this._webGLVersion === 1,
            support3DTextures: this._webGLVersion !== 1,
            needTypeSuffixInShaderConstants: this._webGLVersion !== 1,
            supportMSAA: this._webGLVersion !== 1,
            supportSSAO2: this._webGLVersion !== 1,
            supportIBLShadows: this._webGLVersion !== 1,
            supportExtendedTextureFormats: this._webGLVersion !== 1,
            supportSwitchCaseInShader: this._webGLVersion !== 1,
            supportSyncTextureRead: true,
            needsInvertingBitmap: true,
            useUBOBindingCache: true,
            needShaderCodeInlining: false,
            needToAlwaysBindUniformBuffers: false,
            supportRenderPasses: false,
            supportSpriteInstancing: true,
            forceVertexBufferStrideAndOffsetMultiple4Bytes: false,
            _checkNonFloatVertexBuffersDontRecreatePipelineContext: false,
            _collectUbosUpdatedInFrame: false,
        };
    }
    /**
     * Gets version of the current webGL context
     * Keep it for back compat - use version instead
     */
    get webGLVersion() {
        return this._webGLVersion;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "Engine" string
     */
    getClassName() {
        return "ThinEngine";
    }
    /** @internal */
    _prepareWorkingCanvas() {
        if (this._workingCanvas) {
            return;
        }
        this._workingCanvas = this.createCanvas(1, 1);
        const context = this._workingCanvas.getContext("2d");
        if (context) {
            this._workingContext = context;
        }
    }
    /**
     * Gets an object containing information about the current engine context
     * @returns an object containing the vendor, the renderer and the version of the current engine context
     */
    getInfo() {
        return this.getGlInfo();
    }
    /**
     * Gets an object containing information about the current webGL context
     * @returns an object containing the vendor, the renderer and the version of the current webGL context
     */
    getGlInfo() {
        return {
            vendor: this._glVendor,
            renderer: this._glRenderer,
            version: this._glVersion,
        };
    }
    /**Gets driver info if available */
    extractDriverInfo() {
        const glInfo = this.getGlInfo();
        if (glInfo && glInfo.renderer) {
            return glInfo.renderer;
        }
        return "";
    }
    /**
     * Gets the current render width
     * @param useScreen defines if screen size must be used (or the current render target if any)
     * @returns a number defining the current render width
     */
    getRenderWidth(useScreen = false) {
        if (!useScreen && this._currentRenderTarget) {
            return this._currentRenderTarget.width;
        }
        return this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferWidth : this._gl.drawingBufferWidth;
    }
    /**
     * Gets the current render height
     * @param useScreen defines if screen size must be used (or the current render target if any)
     * @returns a number defining the current render height
     */
    getRenderHeight(useScreen = false) {
        if (!useScreen && this._currentRenderTarget) {
            return this._currentRenderTarget.height;
        }
        return this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferHeight : this._gl.drawingBufferHeight;
    }
    /**
     * Clear the current render buffer or the current render target (if any is set up)
     * @param color defines the color to use
     * @param backBuffer defines if the back buffer must be cleared
     * @param depth defines if the depth buffer must be cleared
     * @param stencil defines if the stencil buffer must be cleared
     */
    clear(color, backBuffer, depth, stencil = false) {
        const useStencilGlobalOnly = this.stencilStateComposer.useStencilGlobalOnly;
        this.stencilStateComposer.useStencilGlobalOnly = true; // make sure the stencil mask is coming from the global stencil and not from a material (effect) which would currently be in effect
        this.applyStates();
        this.stencilStateComposer.useStencilGlobalOnly = useStencilGlobalOnly;
        let mode = 0;
        if (backBuffer && color) {
            let setBackBufferColor = true;
            if (this._currentRenderTarget) {
                const textureFormat = this._currentRenderTarget.texture?.format;
                if (textureFormat === 8 ||
                    textureFormat === 9 ||
                    textureFormat === 10 ||
                    textureFormat === 11) {
                    const textureType = this._currentRenderTarget.texture?.type;
                    if (textureType === 7 || textureType === 5) {
                        ThinEngine._TempClearColorUint32[0] = color.r * 255;
                        ThinEngine._TempClearColorUint32[1] = color.g * 255;
                        ThinEngine._TempClearColorUint32[2] = color.b * 255;
                        ThinEngine._TempClearColorUint32[3] = color.a * 255;
                        this._gl.clearBufferuiv(this._gl.COLOR, 0, ThinEngine._TempClearColorUint32);
                        setBackBufferColor = false;
                    }
                    else {
                        ThinEngine._TempClearColorInt32[0] = color.r * 255;
                        ThinEngine._TempClearColorInt32[1] = color.g * 255;
                        ThinEngine._TempClearColorInt32[2] = color.b * 255;
                        ThinEngine._TempClearColorInt32[3] = color.a * 255;
                        this._gl.clearBufferiv(this._gl.COLOR, 0, ThinEngine._TempClearColorInt32);
                        setBackBufferColor = false;
                    }
                }
            }
            if (setBackBufferColor) {
                this._gl.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0);
                mode |= this._gl.COLOR_BUFFER_BIT;
            }
        }
        if (depth) {
            if (this.useReverseDepthBuffer) {
                this._depthCullingState.depthFunc = this._gl.GEQUAL;
                this._gl.clearDepth(0.0);
            }
            else {
                this._gl.clearDepth(1.0);
            }
            mode |= this._gl.DEPTH_BUFFER_BIT;
        }
        if (stencil) {
            this._gl.clearStencil(0);
            mode |= this._gl.STENCIL_BUFFER_BIT;
        }
        this._gl.clear(mode);
    }
    /**
     * @internal
     */
    _viewport(x, y, width, height) {
        if (x !== this._viewportCached.x || y !== this._viewportCached.y || width !== this._viewportCached.z || height !== this._viewportCached.w) {
            this._viewportCached.x = x;
            this._viewportCached.y = y;
            this._viewportCached.z = width;
            this._viewportCached.w = height;
            this._gl.viewport(x, y, width, height);
        }
    }
    /**
     * End the current frame
     */
    endFrame() {
        super.endFrame();
        // Force a flush in case we are using a bad OS.
        if (this._badOS) {
            this.flushFramebuffer();
        }
    }
    /**
     * Gets the performance monitor attached to this engine
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
     */
    get performanceMonitor() {
        throw new Error("Not Supported by ThinEngine");
    }
    /**
     * Binds the frame buffer to the specified texture.
     * @param rtWrapper The render target wrapper to render to
     * @param faceIndex The face of the texture to render to in case of cube texture and if the render target wrapper is not a multi render target
     * @param requiredWidth The width of the target to render to
     * @param requiredHeight The height of the target to render to
     * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true
     * @param lodLevel Defines the lod level to bind to the frame buffer
     * @param layer Defines the 2d array index to bind to the frame buffer if the render target wrapper is not a multi render target
     */
    bindFramebuffer(rtWrapper, faceIndex = 0, requiredWidth, requiredHeight, forceFullscreenViewport, lodLevel = 0, layer = 0) {
        const webglRTWrapper = rtWrapper;
        if (this._currentRenderTarget) {
            this.unBindFramebuffer(this._currentRenderTarget);
        }
        this._currentRenderTarget = rtWrapper;
        this._bindUnboundFramebuffer(webglRTWrapper._framebuffer);
        const gl = this._gl;
        if (!rtWrapper.isMulti) {
            if (rtWrapper.is2DArray || rtWrapper.is3D) {
                gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, rtWrapper.texture._hardwareTexture?.underlyingResource, lodLevel, layer);
                webglRTWrapper._currentLOD = lodLevel;
            }
            else if (rtWrapper.isCube) {
                gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, rtWrapper.texture._hardwareTexture?.underlyingResource, lodLevel);
            }
            else if (webglRTWrapper._currentLOD !== lodLevel) {
                gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, rtWrapper.texture._hardwareTexture?.underlyingResource, lodLevel);
                webglRTWrapper._currentLOD = lodLevel;
            }
        }
        const depthStencilTexture = rtWrapper._depthStencilTexture;
        if (depthStencilTexture) {
            if (rtWrapper.is3D) {
                if (rtWrapper.texture.width !== depthStencilTexture.width ||
                    rtWrapper.texture.height !== depthStencilTexture.height ||
                    rtWrapper.texture.depth !== depthStencilTexture.depth) {
                    logger/* Logger */.V.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");
                }
            }
            const attachment = rtWrapper._depthStencilTextureWithStencil ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
            if (rtWrapper.is2DArray || rtWrapper.is3D) {
                gl.framebufferTextureLayer(gl.FRAMEBUFFER, attachment, depthStencilTexture._hardwareTexture?.underlyingResource, lodLevel, layer);
            }
            else if (rtWrapper.isCube) {
                gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, depthStencilTexture._hardwareTexture?.underlyingResource, lodLevel);
            }
            else {
                gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, depthStencilTexture._hardwareTexture?.underlyingResource, lodLevel);
            }
        }
        if (webglRTWrapper._MSAAFramebuffer) {
            this._bindUnboundFramebuffer(webglRTWrapper._MSAAFramebuffer);
        }
        if (this._cachedViewport && !forceFullscreenViewport) {
            this.setViewport(this._cachedViewport, requiredWidth, requiredHeight);
        }
        else {
            if (!requiredWidth) {
                requiredWidth = rtWrapper.width;
                if (lodLevel) {
                    requiredWidth = requiredWidth / Math.pow(2, lodLevel);
                }
            }
            if (!requiredHeight) {
                requiredHeight = rtWrapper.height;
                if (lodLevel) {
                    requiredHeight = requiredHeight / Math.pow(2, lodLevel);
                }
            }
            this._viewport(0, 0, requiredWidth, requiredHeight);
        }
        this.wipeCaches();
    }
    /**
     * Set various states to the webGL context
     * @param culling defines culling state: true to enable culling, false to disable it
     * @param zOffset defines the value to apply to zOffset (0 by default)
     * @param force defines if states must be applied even if cache is up to date
     * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)
     * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)
     * @param stencil stencil states to set
     * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)
     */
    setState(culling, zOffset = 0, force, reverseSide = false, cullBackFaces, stencil, zOffsetUnits = 0) {
        // Culling
        if (this._depthCullingState.cull !== culling || force) {
            this._depthCullingState.cull = culling;
        }
        // Cull face
        const cullFace = (this.cullBackFaces ?? cullBackFaces ?? true) ? this._gl.BACK : this._gl.FRONT;
        if (this._depthCullingState.cullFace !== cullFace || force) {
            this._depthCullingState.cullFace = cullFace;
        }
        // Z offset
        this.setZOffset(zOffset);
        this.setZOffsetUnits(zOffsetUnits);
        // Front face
        const frontFace = reverseSide ? this._gl.CW : this._gl.CCW;
        if (this._depthCullingState.frontFace !== frontFace || force) {
            this._depthCullingState.frontFace = frontFace;
        }
        this._stencilStateComposer.stencilMaterial = stencil;
    }
    /**
     * @internal
     */
    _bindUnboundFramebuffer(framebuffer) {
        if (this._currentFramebuffer !== framebuffer) {
            this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, framebuffer);
            this._currentFramebuffer = framebuffer;
        }
    }
    /** @internal */
    _currentFrameBufferIsDefaultFrameBuffer() {
        return this._currentFramebuffer === null;
    }
    /**
     * Generates the mipmaps for a texture
     * @param texture texture to generate the mipmaps for
     */
    generateMipmaps(texture) {
        const target = this._getTextureTarget(texture);
        this._bindTextureDirectly(target, texture, true);
        this._gl.generateMipmap(target);
        this._bindTextureDirectly(target, null);
    }
    /**
     * Unbind the current render target texture from the webGL context
     * @param texture defines the render target wrapper to unbind
     * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
     * @param onBeforeUnbind defines a function which will be called before the effective unbind
     */
    unBindFramebuffer(texture, disableGenerateMipMaps = false, onBeforeUnbind) {
        const webglRTWrapper = texture;
        this._currentRenderTarget = null;
        if (!webglRTWrapper.disableAutomaticMSAAResolve) {
            if (texture.isMulti) {
                this.resolveMultiFramebuffer(texture);
            }
            else {
                this.resolveFramebuffer(texture);
            }
        }
        if (!disableGenerateMipMaps) {
            if (texture.isMulti) {
                this.generateMipMapsMultiFramebuffer(texture);
            }
            else {
                this.generateMipMapsFramebuffer(texture);
            }
        }
        if (onBeforeUnbind) {
            if (webglRTWrapper._MSAAFramebuffer) {
                // Bind the correct framebuffer
                this._bindUnboundFramebuffer(webglRTWrapper._framebuffer);
            }
            onBeforeUnbind();
        }
        this._bindUnboundFramebuffer(null);
    }
    /**
     * Generates mipmaps for the texture of the (single) render target
     * @param texture The render target containing the texture to generate the mipmaps for
     */
    generateMipMapsFramebuffer(texture) {
        if (!texture.isMulti && texture.texture?.generateMipMaps && !texture.isCube) {
            this.generateMipmaps(texture.texture);
        }
    }
    /**
     * Resolves the MSAA texture of the (single) render target into its non-MSAA version.
     * Note that if "texture" is not a MSAA render target, no resolve is performed.
     * @param texture  The render target texture containing the MSAA textures to resolve
     */
    resolveFramebuffer(texture) {
        const rtWrapper = texture;
        const gl = this._gl;
        if (!rtWrapper._MSAAFramebuffer || rtWrapper.isMulti) {
            return;
        }
        let bufferBits = rtWrapper.resolveMSAAColors ? gl.COLOR_BUFFER_BIT : 0;
        bufferBits |= rtWrapper._generateDepthBuffer && rtWrapper.resolveMSAADepth ? gl.DEPTH_BUFFER_BIT : 0;
        bufferBits |= rtWrapper._generateStencilBuffer && rtWrapper.resolveMSAAStencil ? gl.STENCIL_BUFFER_BIT : 0;
        gl.bindFramebuffer(gl.READ_FRAMEBUFFER, rtWrapper._MSAAFramebuffer);
        gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, rtWrapper._framebuffer);
        gl.blitFramebuffer(0, 0, texture.width, texture.height, 0, 0, texture.width, texture.height, bufferBits, gl.NEAREST);
    }
    /**
     * Force a webGL flush (ie. a flush of all waiting webGL commands)
     */
    flushFramebuffer() {
        this._gl.flush();
    }
    /**
     * Unbind the current render target and bind the default framebuffer
     */
    restoreDefaultFramebuffer() {
        if (this._currentRenderTarget) {
            this.unBindFramebuffer(this._currentRenderTarget);
        }
        else {
            this._bindUnboundFramebuffer(null);
        }
        if (this._cachedViewport) {
            this.setViewport(this._cachedViewport);
        }
        this.wipeCaches();
    }
    // VBOs
    /** @internal */
    _resetVertexBufferBinding() {
        this.bindArrayBuffer(null);
        this._cachedVertexBuffers = null;
    }
    /**
     * Creates a vertex buffer
     * @param data the data or size for the vertex buffer
     * @param _updatable whether the buffer should be created as updatable
     * @param _label defines the label of the buffer (for debug purpose)
     * @returns the new WebGL static buffer
     */
    createVertexBuffer(data, _updatable, _label) {
        return this._createVertexBuffer(data, this._gl.STATIC_DRAW);
    }
    _createVertexBuffer(data, usage) {
        const vbo = this._gl.createBuffer();
        if (!vbo) {
            throw new Error("Unable to create vertex buffer");
        }
        const dataBuffer = new webGLDataBuffer/* WebGLDataBuffer */.A(vbo);
        this.bindArrayBuffer(dataBuffer);
        if (typeof data !== "number") {
            if (data instanceof Array) {
                this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(data), usage);
                dataBuffer.capacity = data.length * 4;
            }
            else {
                this._gl.bufferData(this._gl.ARRAY_BUFFER, data, usage);
                dataBuffer.capacity = data.byteLength;
            }
        }
        else {
            this._gl.bufferData(this._gl.ARRAY_BUFFER, new Uint8Array(data), usage);
            dataBuffer.capacity = data;
        }
        this._resetVertexBufferBinding();
        dataBuffer.references = 1;
        return dataBuffer;
    }
    /**
     * Creates a dynamic vertex buffer
     * @param data the data for the dynamic vertex buffer
     * @param _label defines the label of the buffer (for debug purpose)
     * @returns the new WebGL dynamic buffer
     */
    createDynamicVertexBuffer(data, _label) {
        return this._createVertexBuffer(data, this._gl.DYNAMIC_DRAW);
    }
    _resetIndexBufferBinding() {
        this.bindIndexBuffer(null);
        this._cachedIndexBuffer = null;
    }
    /**
     * Creates a new index buffer
     * @param indices defines the content of the index buffer
     * @param updatable defines if the index buffer must be updatable
     * @param _label defines the label of the buffer (for debug purpose)
     * @returns a new webGL buffer
     */
    createIndexBuffer(indices, updatable, _label) {
        const vbo = this._gl.createBuffer();
        const dataBuffer = new webGLDataBuffer/* WebGLDataBuffer */.A(vbo);
        if (!vbo) {
            throw new Error("Unable to create index buffer");
        }
        this.bindIndexBuffer(dataBuffer);
        const data = this._normalizeIndexData(indices);
        this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, data, updatable ? this._gl.DYNAMIC_DRAW : this._gl.STATIC_DRAW);
        this._resetIndexBufferBinding();
        dataBuffer.references = 1;
        dataBuffer.is32Bits = data.BYTES_PER_ELEMENT === 4;
        return dataBuffer;
    }
    _normalizeIndexData(indices) {
        const bytesPerElement = indices.BYTES_PER_ELEMENT;
        if (bytesPerElement === 2) {
            return indices;
        }
        // Check 32 bit support
        if (this._caps.uintIndices) {
            if (indices instanceof Uint32Array) {
                return indices;
            }
            else {
                // number[] or Int32Array, check if 32 bit is necessary
                for (let index = 0; index < indices.length; index++) {
                    if (indices[index] >= 65535) {
                        return new Uint32Array(indices);
                    }
                }
                return new Uint16Array(indices);
            }
        }
        // No 32 bit support, force conversion to 16 bit (values greater 16 bit are lost)
        return new Uint16Array(indices);
    }
    /**
     * Bind a webGL buffer to the webGL context
     * @param buffer defines the buffer to bind
     */
    bindArrayBuffer(buffer) {
        if (!this._vaoRecordInProgress) {
            this._unbindVertexArrayObject();
        }
        this._bindBuffer(buffer, this._gl.ARRAY_BUFFER);
    }
    /**
     * Bind a specific block at a given index in a specific shader program
     * @param pipelineContext defines the pipeline context to use
     * @param blockName defines the block name
     * @param index defines the index where to bind the block
     */
    bindUniformBlock(pipelineContext, blockName, index) {
        const program = pipelineContext.program;
        const uniformLocation = this._gl.getUniformBlockIndex(program, blockName);
        this._gl.uniformBlockBinding(program, uniformLocation, index);
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    bindIndexBuffer(buffer) {
        if (!this._vaoRecordInProgress) {
            this._unbindVertexArrayObject();
        }
        this._bindBuffer(buffer, this._gl.ELEMENT_ARRAY_BUFFER);
    }
    _bindBuffer(buffer, target) {
        if (this._vaoRecordInProgress || this._currentBoundBuffer[target] !== buffer) {
            this._gl.bindBuffer(target, buffer ? buffer.underlyingResource : null);
            this._currentBoundBuffer[target] = buffer;
        }
    }
    /**
     * update the bound buffer with the given data
     * @param data defines the data to update
     */
    updateArrayBuffer(data) {
        this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data);
    }
    _vertexAttribPointer(buffer, indx, size, type, normalized, stride, offset) {
        const pointer = this._currentBufferPointers[indx];
        if (!pointer) {
            return;
        }
        let changed = false;
        if (!pointer.active) {
            changed = true;
            pointer.active = true;
            pointer.index = indx;
            pointer.size = size;
            pointer.type = type;
            pointer.normalized = normalized;
            pointer.stride = stride;
            pointer.offset = offset;
            pointer.buffer = buffer;
        }
        else {
            if (pointer.buffer !== buffer) {
                pointer.buffer = buffer;
                changed = true;
            }
            if (pointer.size !== size) {
                pointer.size = size;
                changed = true;
            }
            if (pointer.type !== type) {
                pointer.type = type;
                changed = true;
            }
            if (pointer.normalized !== normalized) {
                pointer.normalized = normalized;
                changed = true;
            }
            if (pointer.stride !== stride) {
                pointer.stride = stride;
                changed = true;
            }
            if (pointer.offset !== offset) {
                pointer.offset = offset;
                changed = true;
            }
        }
        if (changed || this._vaoRecordInProgress) {
            this.bindArrayBuffer(buffer);
            if (type === this._gl.UNSIGNED_INT || type === this._gl.INT) {
                this._gl.vertexAttribIPointer(indx, size, type, stride, offset);
            }
            else {
                this._gl.vertexAttribPointer(indx, size, type, normalized, stride, offset);
            }
        }
    }
    /**
     * @internal
     */
    _bindIndexBufferWithCache(indexBuffer) {
        if (indexBuffer == null) {
            return;
        }
        if (this._cachedIndexBuffer !== indexBuffer) {
            this._cachedIndexBuffer = indexBuffer;
            this.bindIndexBuffer(indexBuffer);
            this._uintIndicesCurrentlySet = indexBuffer.is32Bits;
        }
    }
    _bindVertexBuffersAttributes(vertexBuffers, effect, overrideVertexBuffers) {
        const attributes = effect.getAttributesNames();
        if (!this._vaoRecordInProgress) {
            this._unbindVertexArrayObject();
        }
        this.unbindAllAttributes();
        for (let index = 0; index < attributes.length; index++) {
            const order = effect.getAttributeLocation(index);
            if (order >= 0) {
                const ai = attributes[index];
                let vertexBuffer = null;
                if (overrideVertexBuffers) {
                    vertexBuffer = overrideVertexBuffers[ai];
                }
                if (!vertexBuffer) {
                    vertexBuffer = vertexBuffers[ai];
                }
                if (!vertexBuffer) {
                    continue;
                }
                this._gl.enableVertexAttribArray(order);
                if (!this._vaoRecordInProgress) {
                    this._vertexAttribArraysEnabled[order] = true;
                }
                const buffer = vertexBuffer.getBuffer();
                if (buffer) {
                    this._vertexAttribPointer(buffer, order, vertexBuffer.getSize(), vertexBuffer.type, vertexBuffer.normalized, vertexBuffer.byteStride, vertexBuffer.byteOffset);
                    if (vertexBuffer.getIsInstanced()) {
                        this._gl.vertexAttribDivisor(order, vertexBuffer.getInstanceDivisor());
                        if (!this._vaoRecordInProgress) {
                            this._currentInstanceLocations.push(order);
                            this._currentInstanceBuffers.push(buffer);
                        }
                    }
                }
            }
        }
    }
    /**
     * Records a vertex array object
     * @see https://doc.babylonjs.com/setup/support/webGL2#vertex-array-objects
     * @param vertexBuffers defines the list of vertex buffers to store
     * @param indexBuffer defines the index buffer to store
     * @param effect defines the effect to store
     * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
     * @returns the new vertex array object
     */
    recordVertexArrayObject(vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {
        const vao = this._gl.createVertexArray();
        if (!vao) {
            throw new Error("Unable to create VAO");
        }
        this._vaoRecordInProgress = true;
        this._gl.bindVertexArray(vao);
        this._mustWipeVertexAttributes = true;
        this._bindVertexBuffersAttributes(vertexBuffers, effect, overrideVertexBuffers);
        this.bindIndexBuffer(indexBuffer);
        this._vaoRecordInProgress = false;
        this._gl.bindVertexArray(null);
        return vao;
    }
    /**
     * Bind a specific vertex array object
     * @see https://doc.babylonjs.com/setup/support/webGL2#vertex-array-objects
     * @param vertexArrayObject defines the vertex array object to bind
     * @param indexBuffer defines the index buffer to bind
     */
    bindVertexArrayObject(vertexArrayObject, indexBuffer) {
        if (this._cachedVertexArrayObject !== vertexArrayObject) {
            this._cachedVertexArrayObject = vertexArrayObject;
            this._gl.bindVertexArray(vertexArrayObject);
            this._cachedVertexBuffers = null;
            this._cachedIndexBuffer = null;
            this._uintIndicesCurrentlySet = indexBuffer != null && indexBuffer.is32Bits;
            this._mustWipeVertexAttributes = true;
        }
    }
    /**
     * Bind webGl buffers directly to the webGL context
     * @param vertexBuffer defines the vertex buffer to bind
     * @param indexBuffer defines the index buffer to bind
     * @param vertexDeclaration defines the vertex declaration to use with the vertex buffer
     * @param vertexStrideSize defines the vertex stride of the vertex buffer
     * @param effect defines the effect associated with the vertex buffer
     */
    bindBuffersDirectly(vertexBuffer, indexBuffer, vertexDeclaration, vertexStrideSize, effect) {
        if (this._cachedVertexBuffers !== vertexBuffer || this._cachedEffectForVertexBuffers !== effect) {
            this._cachedVertexBuffers = vertexBuffer;
            this._cachedEffectForVertexBuffers = effect;
            const attributesCount = effect.getAttributesCount();
            this._unbindVertexArrayObject();
            this.unbindAllAttributes();
            let offset = 0;
            for (let index = 0; index < attributesCount; index++) {
                if (index < vertexDeclaration.length) {
                    const order = effect.getAttributeLocation(index);
                    if (order >= 0) {
                        this._gl.enableVertexAttribArray(order);
                        this._vertexAttribArraysEnabled[order] = true;
                        this._vertexAttribPointer(vertexBuffer, order, vertexDeclaration[index], this._gl.FLOAT, false, vertexStrideSize, offset);
                    }
                    offset += vertexDeclaration[index] * 4;
                }
            }
        }
        this._bindIndexBufferWithCache(indexBuffer);
    }
    _unbindVertexArrayObject() {
        if (!this._cachedVertexArrayObject) {
            return;
        }
        this._cachedVertexArrayObject = null;
        this._gl.bindVertexArray(null);
    }
    /**
     * Bind a list of vertex buffers to the webGL context
     * @param vertexBuffers defines the list of vertex buffers to bind
     * @param indexBuffer defines the index buffer to bind
     * @param effect defines the effect associated with the vertex buffers
     * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
     */
    bindBuffers(vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {
        if (this._cachedVertexBuffers !== vertexBuffers || this._cachedEffectForVertexBuffers !== effect) {
            this._cachedVertexBuffers = vertexBuffers;
            this._cachedEffectForVertexBuffers = effect;
            this._bindVertexBuffersAttributes(vertexBuffers, effect, overrideVertexBuffers);
        }
        this._bindIndexBufferWithCache(indexBuffer);
    }
    /**
     * Unbind all instance attributes
     */
    unbindInstanceAttributes() {
        let boundBuffer;
        for (let i = 0, ul = this._currentInstanceLocations.length; i < ul; i++) {
            const instancesBuffer = this._currentInstanceBuffers[i];
            if (boundBuffer != instancesBuffer && instancesBuffer.references) {
                boundBuffer = instancesBuffer;
                this.bindArrayBuffer(instancesBuffer);
            }
            const offsetLocation = this._currentInstanceLocations[i];
            this._gl.vertexAttribDivisor(offsetLocation, 0);
        }
        this._currentInstanceBuffers.length = 0;
        this._currentInstanceLocations.length = 0;
    }
    /**
     * Release and free the memory of a vertex array object
     * @param vao defines the vertex array object to delete
     */
    releaseVertexArrayObject(vao) {
        this._gl.deleteVertexArray(vao);
    }
    /**
     * @internal
     */
    _releaseBuffer(buffer) {
        buffer.references--;
        if (buffer.references === 0) {
            this._deleteBuffer(buffer);
            return true;
        }
        return false;
    }
    _deleteBuffer(buffer) {
        this._gl.deleteBuffer(buffer.underlyingResource);
    }
    /**
     * Update the content of a webGL buffer used with instantiation and bind it to the webGL context
     * @param instancesBuffer defines the webGL buffer to update and bind
     * @param data defines the data to store in the buffer
     * @param offsetLocations defines the offsets or attributes information used to determine where data must be stored in the buffer
     */
    updateAndBindInstancesBuffer(instancesBuffer, data, offsetLocations) {
        this.bindArrayBuffer(instancesBuffer);
        if (data) {
            this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data);
        }
        if (offsetLocations[0].index !== undefined) {
            this.bindInstancesBuffer(instancesBuffer, offsetLocations, true);
        }
        else {
            for (let index = 0; index < 4; index++) {
                const offsetLocation = offsetLocations[index];
                if (!this._vertexAttribArraysEnabled[offsetLocation]) {
                    this._gl.enableVertexAttribArray(offsetLocation);
                    this._vertexAttribArraysEnabled[offsetLocation] = true;
                }
                this._vertexAttribPointer(instancesBuffer, offsetLocation, 4, this._gl.FLOAT, false, 64, index * 16);
                this._gl.vertexAttribDivisor(offsetLocation, 1);
                this._currentInstanceLocations.push(offsetLocation);
                this._currentInstanceBuffers.push(instancesBuffer);
            }
        }
    }
    /**
     * Bind the content of a webGL buffer used with instantiation
     * @param instancesBuffer defines the webGL buffer to bind
     * @param attributesInfo defines the offsets or attributes information used to determine where data must be stored in the buffer
     * @param computeStride defines Whether to compute the strides from the info or use the default 0
     */
    bindInstancesBuffer(instancesBuffer, attributesInfo, computeStride = true) {
        this.bindArrayBuffer(instancesBuffer);
        let stride = 0;
        if (computeStride) {
            for (let i = 0; i < attributesInfo.length; i++) {
                const ai = attributesInfo[i];
                stride += ai.attributeSize * 4;
            }
        }
        for (let i = 0; i < attributesInfo.length; i++) {
            const ai = attributesInfo[i];
            if (ai.index === undefined) {
                ai.index = this._currentEffect.getAttributeLocationByName(ai.attributeName);
            }
            if (ai.index < 0) {
                continue;
            }
            if (!this._vertexAttribArraysEnabled[ai.index]) {
                this._gl.enableVertexAttribArray(ai.index);
                this._vertexAttribArraysEnabled[ai.index] = true;
            }
            this._vertexAttribPointer(instancesBuffer, ai.index, ai.attributeSize, ai.attributeType || this._gl.FLOAT, ai.normalized || false, stride, ai.offset);
            this._gl.vertexAttribDivisor(ai.index, ai.divisor === undefined ? 1 : ai.divisor);
            this._currentInstanceLocations.push(ai.index);
            this._currentInstanceBuffers.push(instancesBuffer);
        }
    }
    /**
     * Disable the instance attribute corresponding to the name in parameter
     * @param name defines the name of the attribute to disable
     */
    disableInstanceAttributeByName(name) {
        if (!this._currentEffect) {
            return;
        }
        const attributeLocation = this._currentEffect.getAttributeLocationByName(name);
        this.disableInstanceAttribute(attributeLocation);
    }
    /**
     * Disable the instance attribute corresponding to the location in parameter
     * @param attributeLocation defines the attribute location of the attribute to disable
     */
    disableInstanceAttribute(attributeLocation) {
        let shouldClean = false;
        let index;
        while ((index = this._currentInstanceLocations.indexOf(attributeLocation)) !== -1) {
            this._currentInstanceLocations.splice(index, 1);
            this._currentInstanceBuffers.splice(index, 1);
            shouldClean = true;
            index = this._currentInstanceLocations.indexOf(attributeLocation);
        }
        if (shouldClean) {
            this._gl.vertexAttribDivisor(attributeLocation, 0);
            this.disableAttributeByIndex(attributeLocation);
        }
    }
    /**
     * Disable the attribute corresponding to the location in parameter
     * @param attributeLocation defines the attribute location of the attribute to disable
     */
    disableAttributeByIndex(attributeLocation) {
        this._gl.disableVertexAttribArray(attributeLocation);
        this._vertexAttribArraysEnabled[attributeLocation] = false;
        this._currentBufferPointers[attributeLocation].active = false;
    }
    /**
     * Send a draw order
     * @param useTriangles defines if triangles must be used to draw (else wireframe will be used)
     * @param indexStart defines the starting index
     * @param indexCount defines the number of index to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    draw(useTriangles, indexStart, indexCount, instancesCount) {
        this.drawElementsType(useTriangles ? 0 : 1, indexStart, indexCount, instancesCount);
    }
    /**
     * Draw a list of points
     * @param verticesStart defines the index of first vertex to draw
     * @param verticesCount defines the count of vertices to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawPointClouds(verticesStart, verticesCount, instancesCount) {
        this.drawArraysType(2, verticesStart, verticesCount, instancesCount);
    }
    /**
     * Draw a list of unindexed primitives
     * @param useTriangles defines if triangles must be used to draw (else wireframe will be used)
     * @param verticesStart defines the index of first vertex to draw
     * @param verticesCount defines the count of vertices to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawUnIndexed(useTriangles, verticesStart, verticesCount, instancesCount) {
        this.drawArraysType(useTriangles ? 0 : 1, verticesStart, verticesCount, instancesCount);
    }
    /**
     * Draw a list of indexed primitives
     * @param fillMode defines the primitive to use
     * @param indexStart defines the starting index
     * @param indexCount defines the number of index to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawElementsType(fillMode, indexStart, indexCount, instancesCount) {
        // Apply states
        this.applyStates();
        this._reportDrawCall();
        // Render
        const drawMode = this._drawMode(fillMode);
        const indexFormat = this._uintIndicesCurrentlySet ? this._gl.UNSIGNED_INT : this._gl.UNSIGNED_SHORT;
        const mult = this._uintIndicesCurrentlySet ? 4 : 2;
        if (instancesCount) {
            this._gl.drawElementsInstanced(drawMode, indexCount, indexFormat, indexStart * mult, instancesCount);
        }
        else {
            this._gl.drawElements(drawMode, indexCount, indexFormat, indexStart * mult);
        }
    }
    /**
     * Draw a list of unindexed primitives
     * @param fillMode defines the primitive to use
     * @param verticesStart defines the index of first vertex to draw
     * @param verticesCount defines the count of vertices to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawArraysType(fillMode, verticesStart, verticesCount, instancesCount) {
        // Apply states
        this.applyStates();
        this._reportDrawCall();
        const drawMode = this._drawMode(fillMode);
        if (instancesCount) {
            this._gl.drawArraysInstanced(drawMode, verticesStart, verticesCount, instancesCount);
        }
        else {
            this._gl.drawArrays(drawMode, verticesStart, verticesCount);
        }
    }
    _drawMode(fillMode) {
        switch (fillMode) {
            // Triangle views
            case 0:
                return this._gl.TRIANGLES;
            case 2:
                return this._gl.POINTS;
            case 1:
                return this._gl.LINES;
            // Draw modes
            case 3:
                return this._gl.POINTS;
            case 4:
                return this._gl.LINES;
            case 5:
                return this._gl.LINE_LOOP;
            case 6:
                return this._gl.LINE_STRIP;
            case 7:
                return this._gl.TRIANGLE_STRIP;
            case 8:
                return this._gl.TRIANGLE_FAN;
            default:
                return this._gl.TRIANGLES;
        }
    }
    // Shaders
    /**
     * @internal
     */
    _releaseEffect(effect) {
        if (this._compiledEffects[effect._key]) {
            delete this._compiledEffects[effect._key];
        }
        const pipelineContext = effect.getPipelineContext();
        if (pipelineContext) {
            this._deletePipelineContext(pipelineContext);
        }
    }
    /**
     * @internal
     */
    _deletePipelineContext(pipelineContext) {
        const webGLPipelineContext = pipelineContext;
        if (webGLPipelineContext && webGLPipelineContext.program) {
            webGLPipelineContext.program.__SPECTOR_rebuildProgram = null;
            (0,effect_functions/* resetCachedPipeline */.mO)(webGLPipelineContext);
            if (this._gl) {
                this._gl.deleteProgram(webGLPipelineContext.program);
            }
        }
    }
    /**
     * @internal
     */
    _getGlobalDefines(defines) {
        return (0,abstractEngine_functions/* _getGlobalDefines */.xt)(defines, this.isNDCHalfZRange, this.useReverseDepthBuffer, this.useExactSrgbConversions);
    }
    /**
     * Create a new effect (used to store vertex/fragment shaders)
     * @param baseName defines the base name of the effect (The name of file without .fragment.fx or .vertex.fx)
     * @param attributesNamesOrOptions defines either a list of attribute names or an IEffectCreationOptions object
     * @param uniformsNamesOrEngine defines either a list of uniform names or the engine to use
     * @param samplers defines an array of string used to represent textures
     * @param defines defines the string containing the defines to use to compile the shaders
     * @param fallbacks defines the list of potential fallbacks to use if shader compilation fails
     * @param onCompiled defines a function to call when the effect creation is successful
     * @param onError defines a function to call when the effect creation has failed
     * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
     * @param shaderLanguage the language the shader is written in (default: GLSL)
     * @param extraInitializationsAsync additional async code to run before preparing the effect
     * @returns the new Effect
     */
    createEffect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, defines, fallbacks, onCompiled, onError, indexParameters, shaderLanguage = 0 /* ShaderLanguage.GLSL */, extraInitializationsAsync) {
        const vertex = typeof baseName === "string" ? baseName : baseName.vertexToken || baseName.vertexSource || baseName.vertexElement || baseName.vertex;
        const fragment = typeof baseName === "string" ? baseName : baseName.fragmentToken || baseName.fragmentSource || baseName.fragmentElement || baseName.fragment;
        const globalDefines = this._getGlobalDefines();
        let fullDefines = defines ?? attributesNamesOrOptions.defines ?? "";
        if (globalDefines) {
            fullDefines += globalDefines;
        }
        const name = vertex + "+" + fragment + "@" + fullDefines;
        if (this._compiledEffects[name]) {
            const compiledEffect = this._compiledEffects[name];
            if (onCompiled && compiledEffect.isReady()) {
                onCompiled(compiledEffect);
            }
            compiledEffect._refCount++;
            return compiledEffect;
        }
        if (this._gl) {
            (0,thinEngine_functions/* getStateObject */.N5)(this._gl);
        }
        const effect = new Materials_effect/* Effect */.M(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters, name, attributesNamesOrOptions.shaderLanguage ?? shaderLanguage, attributesNamesOrOptions.extraInitializationsAsync ?? extraInitializationsAsync);
        this._compiledEffects[name] = effect;
        return effect;
    }
    /**
     * @internal
     */
    _getShaderSource(shader) {
        return this._gl.getShaderSource(shader);
    }
    /**
     * Directly creates a webGL program
     * @param pipelineContext  defines the pipeline context to attach to
     * @param vertexCode defines the vertex shader code to use
     * @param fragmentCode defines the fragment shader code to use
     * @param context defines the webGL context to use (if not set, the current one will be used)
     * @param transformFeedbackVaryings defines the list of transform feedback varyings to use
     * @returns the new webGL program
     */
    createRawShaderProgram(pipelineContext, vertexCode, fragmentCode, context, transformFeedbackVaryings = null) {
        const stateObject = (0,thinEngine_functions/* getStateObject */.N5)(this._gl);
        stateObject._contextWasLost = this._contextWasLost;
        stateObject.validateShaderPrograms = this.validateShaderPrograms;
        return (0,thinEngine_functions/* createRawShaderProgram */.kf)(pipelineContext, vertexCode, fragmentCode, context || this._gl, transformFeedbackVaryings);
    }
    /**
     * Creates a webGL program
     * @param pipelineContext  defines the pipeline context to attach to
     * @param vertexCode  defines the vertex shader code to use
     * @param fragmentCode defines the fragment shader code to use
     * @param defines defines the string containing the defines to use to compile the shaders
     * @param context defines the webGL context to use (if not set, the current one will be used)
     * @param transformFeedbackVaryings defines the list of transform feedback varyings to use
     * @returns the new webGL program
     */
    createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings = null) {
        const stateObject = (0,thinEngine_functions/* getStateObject */.N5)(this._gl);
        // assure the state object is correct
        stateObject._contextWasLost = this._contextWasLost;
        stateObject.validateShaderPrograms = this.validateShaderPrograms;
        return (0,thinEngine_functions/* createShaderProgram */.EX)(pipelineContext, vertexCode, fragmentCode, defines, context || this._gl, transformFeedbackVaryings);
    }
    /**
     * Inline functions in shader code that are marked to be inlined
     * @param code code to inline
     * @returns inlined code
     */
    inlineShaderCode(code) {
        // no inlining needed in the WebGL engine
        return code;
    }
    /**
     * Creates a new pipeline context
     * @param shaderProcessingContext defines the shader processing context used during the processing if available
     * @returns the new pipeline
     */
    createPipelineContext(shaderProcessingContext) {
        if (this._gl) {
            const stateObject = (0,thinEngine_functions/* getStateObject */.N5)(this._gl);
            stateObject.parallelShaderCompile = this._caps.parallelShaderCompile;
        }
        const context = (0,thinEngine_functions/* createPipelineContext */.GX)(this._gl, shaderProcessingContext);
        context.engine = this;
        return context;
    }
    /**
     * Creates a new material context
     * @returns the new context
     */
    createMaterialContext() {
        return undefined;
    }
    /**
     * Creates a new draw context
     * @returns the new context
     */
    createDrawContext() {
        return undefined;
    }
    _finalizePipelineContext(pipelineContext) {
        return (0,thinEngine_functions/* _finalizePipelineContext */.tg)(pipelineContext, this._gl, this.validateShaderPrograms);
    }
    /**
     * @internal
     */
    _preparePipelineContext(pipelineContext, vertexSourceCode, fragmentSourceCode, createAsRaw, rawVertexSourceCode, rawFragmentSourceCode, rebuildRebind, defines, transformFeedbackVaryings, key, onReady) {
        const stateObject = (0,thinEngine_functions/* getStateObject */.N5)(this._gl);
        stateObject._contextWasLost = this._contextWasLost;
        stateObject.validateShaderPrograms = this.validateShaderPrograms;
        stateObject._createShaderProgramInjection = this._createShaderProgram.bind(this);
        stateObject.createRawShaderProgramInjection = this.createRawShaderProgram.bind(this);
        stateObject.createShaderProgramInjection = this.createShaderProgram.bind(this);
        stateObject.loadFileInjection = this._loadFile.bind(this);
        return (0,thinEngine_functions/* _preparePipelineContext */.YM)(pipelineContext, vertexSourceCode, fragmentSourceCode, createAsRaw, rawVertexSourceCode, rawFragmentSourceCode, rebuildRebind, defines, transformFeedbackVaryings, key, onReady);
    }
    _createShaderProgram(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings = null) {
        return (0,thinEngine_functions/* _createShaderProgram */.tI)(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings);
    }
    /**
     * @internal
     */
    _isRenderingStateCompiled(pipelineContext) {
        if (this._isDisposed) {
            return false;
        }
        return (0,thinEngine_functions/* _isRenderingStateCompiled */.A5)(pipelineContext, this._gl, this.validateShaderPrograms);
    }
    /**
     * @internal
     */
    _executeWhenRenderingStateIsCompiled(pipelineContext, action) {
        (0,thinEngine_functions/* _executeWhenRenderingStateIsCompiled */.bS)(pipelineContext, action);
    }
    /**
     * Gets the list of webGL uniform locations associated with a specific program based on a list of uniform names
     * @param pipelineContext defines the pipeline context to use
     * @param uniformsNames defines the list of uniform names
     * @returns an array of webGL uniform locations
     */
    getUniforms(pipelineContext, uniformsNames) {
        const results = new Array();
        const webGLPipelineContext = pipelineContext;
        for (let index = 0; index < uniformsNames.length; index++) {
            results.push(this._gl.getUniformLocation(webGLPipelineContext.program, uniformsNames[index]));
        }
        return results;
    }
    /**
     * Gets the list of active attributes for a given webGL program
     * @param pipelineContext defines the pipeline context to use
     * @param attributesNames defines the list of attribute names to get
     * @returns an array of indices indicating the offset of each attribute
     */
    getAttributes(pipelineContext, attributesNames) {
        const results = [];
        const webGLPipelineContext = pipelineContext;
        for (let index = 0; index < attributesNames.length; index++) {
            try {
                results.push(this._gl.getAttribLocation(webGLPipelineContext.program, attributesNames[index]));
            }
            catch (e) {
                results.push(-1);
            }
        }
        return results;
    }
    /**
     * Activates an effect, making it the current one (ie. the one used for rendering)
     * @param effect defines the effect to activate
     */
    enableEffect(effect) {
        effect = effect !== null && (0,drawWrapper_functions/* IsWrapper */.E)(effect) ? effect.effect : effect; // get only the effect, we don't need a Wrapper in the WebGL engine
        if (!effect || effect === this._currentEffect) {
            return;
        }
        this._stencilStateComposer.stencilMaterial = undefined;
        effect = effect;
        // Use program
        this.bindSamplers(effect);
        this._currentEffect = effect;
        if (effect.onBind) {
            effect.onBind(effect);
        }
        if (effect._onBindObservable) {
            effect._onBindObservable.notifyObservers(effect);
        }
    }
    /**
     * Set the value of an uniform to a number (int)
     * @param uniform defines the webGL uniform location where to store the value
     * @param value defines the int number to store
     * @returns true if the value was set
     */
    setInt(uniform, value) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform1i(uniform, value);
        return true;
    }
    /**
     * Set the value of an uniform to a int2
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @returns true if the value was set
     */
    setInt2(uniform, x, y) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform2i(uniform, x, y);
        return true;
    }
    /**
     * Set the value of an uniform to a int3
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @param z defines the 3rd component of the value
     * @returns true if the value was set
     */
    setInt3(uniform, x, y, z) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform3i(uniform, x, y, z);
        return true;
    }
    /**
     * Set the value of an uniform to a int4
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @param z defines the 3rd component of the value
     * @param w defines the 4th component of the value
     * @returns true if the value was set
     */
    setInt4(uniform, x, y, z, w) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform4i(uniform, x, y, z, w);
        return true;
    }
    /**
     * Set the value of an uniform to an array of int32
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of int32 to store
     * @returns true if the value was set
     */
    setIntArray(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform1iv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of int32 (stored as vec2)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of int32 to store
     * @returns true if the value was set
     */
    setIntArray2(uniform, array) {
        if (!uniform || array.length % 2 !== 0) {
            return false;
        }
        this._gl.uniform2iv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of int32 (stored as vec3)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of int32 to store
     * @returns true if the value was set
     */
    setIntArray3(uniform, array) {
        if (!uniform || array.length % 3 !== 0) {
            return false;
        }
        this._gl.uniform3iv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of int32 (stored as vec4)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of int32 to store
     * @returns true if the value was set
     */
    setIntArray4(uniform, array) {
        if (!uniform || array.length % 4 !== 0) {
            return false;
        }
        this._gl.uniform4iv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to a number (unsigned int)
     * @param uniform defines the webGL uniform location where to store the value
     * @param value defines the unsigned int number to store
     * @returns true if the value was set
     */
    setUInt(uniform, value) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform1ui(uniform, value);
        return true;
    }
    /**
     * Set the value of an uniform to a unsigned int2
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @returns true if the value was set
     */
    setUInt2(uniform, x, y) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform2ui(uniform, x, y);
        return true;
    }
    /**
     * Set the value of an uniform to a unsigned int3
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @param z defines the 3rd component of the value
     * @returns true if the value was set
     */
    setUInt3(uniform, x, y, z) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform3ui(uniform, x, y, z);
        return true;
    }
    /**
     * Set the value of an uniform to a unsigned int4
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @param z defines the 3rd component of the value
     * @param w defines the 4th component of the value
     * @returns true if the value was set
     */
    setUInt4(uniform, x, y, z, w) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform4ui(uniform, x, y, z, w);
        return true;
    }
    /**
     * Set the value of an uniform to an array of unsigned int32
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of unsigned int32 to store
     * @returns true if the value was set
     */
    setUIntArray(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform1uiv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of unsigned int32 (stored as vec2)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of unsigned int32 to store
     * @returns true if the value was set
     */
    setUIntArray2(uniform, array) {
        if (!uniform || array.length % 2 !== 0) {
            return false;
        }
        this._gl.uniform2uiv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of unsigned int32 (stored as vec3)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of unsigned int32 to store
     * @returns true if the value was set
     */
    setUIntArray3(uniform, array) {
        if (!uniform || array.length % 3 !== 0) {
            return false;
        }
        this._gl.uniform3uiv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of unsigned int32 (stored as vec4)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of unsigned int32 to store
     * @returns true if the value was set
     */
    setUIntArray4(uniform, array) {
        if (!uniform || array.length % 4 !== 0) {
            return false;
        }
        this._gl.uniform4uiv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of number
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of number to store
     * @returns true if the value was set
     */
    setArray(uniform, array) {
        if (!uniform) {
            return false;
        }
        if (array.length < 1) {
            return false;
        }
        this._gl.uniform1fv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of number (stored as vec2)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of number to store
     * @returns true if the value was set
     */
    setArray2(uniform, array) {
        if (!uniform || array.length % 2 !== 0) {
            return false;
        }
        this._gl.uniform2fv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of number (stored as vec3)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of number to store
     * @returns true if the value was set
     */
    setArray3(uniform, array) {
        if (!uniform || array.length % 3 !== 0) {
            return false;
        }
        this._gl.uniform3fv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of number (stored as vec4)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of number to store
     * @returns true if the value was set
     */
    setArray4(uniform, array) {
        if (!uniform || array.length % 4 !== 0) {
            return false;
        }
        this._gl.uniform4fv(uniform, array);
        return true;
    }
    /**
     * Set the value of an uniform to an array of float32 (stored as matrices)
     * @param uniform defines the webGL uniform location where to store the value
     * @param matrices defines the array of float32 to store
     * @returns true if the value was set
     */
    setMatrices(uniform, matrices) {
        if (!uniform) {
            return false;
        }
        this._gl.uniformMatrix4fv(uniform, false, matrices);
        return true;
    }
    /**
     * Set the value of an uniform to a matrix (3x3)
     * @param uniform defines the webGL uniform location where to store the value
     * @param matrix defines the Float32Array representing the 3x3 matrix to store
     * @returns true if the value was set
     */
    setMatrix3x3(uniform, matrix) {
        if (!uniform) {
            return false;
        }
        this._gl.uniformMatrix3fv(uniform, false, matrix);
        return true;
    }
    /**
     * Set the value of an uniform to a matrix (2x2)
     * @param uniform defines the webGL uniform location where to store the value
     * @param matrix defines the Float32Array representing the 2x2 matrix to store
     * @returns true if the value was set
     */
    setMatrix2x2(uniform, matrix) {
        if (!uniform) {
            return false;
        }
        this._gl.uniformMatrix2fv(uniform, false, matrix);
        return true;
    }
    /**
     * Set the value of an uniform to a number (float)
     * @param uniform defines the webGL uniform location where to store the value
     * @param value defines the float number to store
     * @returns true if the value was transferred
     */
    setFloat(uniform, value) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform1f(uniform, value);
        return true;
    }
    /**
     * Set the value of an uniform to a vec2
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @returns true if the value was set
     */
    setFloat2(uniform, x, y) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform2f(uniform, x, y);
        return true;
    }
    /**
     * Set the value of an uniform to a vec3
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @param z defines the 3rd component of the value
     * @returns true if the value was set
     */
    setFloat3(uniform, x, y, z) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform3f(uniform, x, y, z);
        return true;
    }
    /**
     * Set the value of an uniform to a vec4
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @param z defines the 3rd component of the value
     * @param w defines the 4th component of the value
     * @returns true if the value was set
     */
    setFloat4(uniform, x, y, z, w) {
        if (!uniform) {
            return false;
        }
        this._gl.uniform4f(uniform, x, y, z, w);
        return true;
    }
    // States
    /**
     * Apply all cached states (depth, culling, stencil and alpha)
     */
    applyStates() {
        this._depthCullingState.apply(this._gl);
        this._stencilStateComposer.apply(this._gl);
        this._alphaState.apply(this._gl);
        if (this._colorWriteChanged) {
            this._colorWriteChanged = false;
            const enable = this._colorWrite;
            this._gl.colorMask(enable, enable, enable, enable);
        }
    }
    // Textures
    /**
     * Force the entire cache to be cleared
     * You should not have to use this function unless your engine needs to share the webGL context with another engine
     * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)
     */
    wipeCaches(bruteForce) {
        if (this.preventCacheWipeBetweenFrames && !bruteForce) {
            return;
        }
        this._currentEffect = null;
        this._viewportCached.x = 0;
        this._viewportCached.y = 0;
        this._viewportCached.z = 0;
        this._viewportCached.w = 0;
        // Done before in case we clean the attributes
        this._unbindVertexArrayObject();
        if (bruteForce) {
            this._currentProgram = null;
            this.resetTextureCache();
            this._stencilStateComposer.reset();
            this._depthCullingState.reset();
            this._depthCullingState.depthFunc = this._gl.LEQUAL;
            this._alphaState.reset();
            this._alphaMode = 1;
            this._alphaEquation = 0;
            this._colorWrite = true;
            this._colorWriteChanged = true;
            this._unpackFlipYCached = null;
            this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE);
            this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0);
            this._mustWipeVertexAttributes = true;
            this.unbindAllAttributes();
        }
        this._resetVertexBufferBinding();
        this._cachedIndexBuffer = null;
        this._cachedEffectForVertexBuffers = null;
        this.bindIndexBuffer(null);
    }
    /**
     * @internal
     */
    _getSamplingParameters(samplingMode, generateMipMaps) {
        const gl = this._gl;
        let magFilter = gl.NEAREST;
        let minFilter = gl.NEAREST;
        switch (samplingMode) {
            case 11:
                magFilter = gl.LINEAR;
                if (generateMipMaps) {
                    minFilter = gl.LINEAR_MIPMAP_NEAREST;
                }
                else {
                    minFilter = gl.LINEAR;
                }
                break;
            case 3:
                magFilter = gl.LINEAR;
                if (generateMipMaps) {
                    minFilter = gl.LINEAR_MIPMAP_LINEAR;
                }
                else {
                    minFilter = gl.LINEAR;
                }
                break;
            case 8:
                magFilter = gl.NEAREST;
                if (generateMipMaps) {
                    minFilter = gl.NEAREST_MIPMAP_LINEAR;
                }
                else {
                    minFilter = gl.NEAREST;
                }
                break;
            case 4:
                magFilter = gl.NEAREST;
                if (generateMipMaps) {
                    minFilter = gl.NEAREST_MIPMAP_NEAREST;
                }
                else {
                    minFilter = gl.NEAREST;
                }
                break;
            case 5:
                magFilter = gl.NEAREST;
                if (generateMipMaps) {
                    minFilter = gl.LINEAR_MIPMAP_NEAREST;
                }
                else {
                    minFilter = gl.LINEAR;
                }
                break;
            case 6:
                magFilter = gl.NEAREST;
                if (generateMipMaps) {
                    minFilter = gl.LINEAR_MIPMAP_LINEAR;
                }
                else {
                    minFilter = gl.LINEAR;
                }
                break;
            case 7:
                magFilter = gl.NEAREST;
                minFilter = gl.LINEAR;
                break;
            case 1:
                magFilter = gl.NEAREST;
                minFilter = gl.NEAREST;
                break;
            case 9:
                magFilter = gl.LINEAR;
                if (generateMipMaps) {
                    minFilter = gl.NEAREST_MIPMAP_NEAREST;
                }
                else {
                    minFilter = gl.NEAREST;
                }
                break;
            case 10:
                magFilter = gl.LINEAR;
                if (generateMipMaps) {
                    minFilter = gl.NEAREST_MIPMAP_LINEAR;
                }
                else {
                    minFilter = gl.NEAREST;
                }
                break;
            case 2:
                magFilter = gl.LINEAR;
                minFilter = gl.LINEAR;
                break;
            case 12:
                magFilter = gl.LINEAR;
                minFilter = gl.NEAREST;
                break;
        }
        return {
            min: minFilter,
            mag: magFilter,
        };
    }
    /** @internal */
    _createTexture() {
        const texture = this._gl.createTexture();
        if (!texture) {
            throw new Error("Unable to create texture");
        }
        return texture;
    }
    /** @internal */
    _createHardwareTexture() {
        return new webGLHardwareTexture/* WebGLHardwareTexture */.d(this._createTexture(), this._gl);
    }
    /**
     * Creates an internal texture without binding it to a framebuffer
     * @internal
     * @param size defines the size of the texture
     * @param options defines the options used to create the texture
     * @param delayGPUTextureCreation true to delay the texture creation the first time it is really needed. false to create it right away
     * @param source source type of the texture
     * @returns a new internal texture
     */
    _createInternalTexture(size, options, delayGPUTextureCreation = true, source = 0 /* InternalTextureSource.Unknown */) {
        let generateMipMaps = false;
        let createMipMaps = false;
        let type = 0;
        let samplingMode = 3;
        let format = 5;
        let useSRGBBuffer = false;
        let samples = 1;
        let label;
        let createMSAATexture = false;
        let comparisonFunction = 0;
        if (options !== undefined && typeof options === "object") {
            generateMipMaps = !!options.generateMipMaps;
            createMipMaps = !!options.createMipMaps;
            type = options.type === undefined ? 0 : options.type;
            samplingMode = options.samplingMode === undefined ? 3 : options.samplingMode;
            format = options.format === undefined ? 5 : options.format;
            useSRGBBuffer = options.useSRGBBuffer === undefined ? false : options.useSRGBBuffer;
            samples = options.samples ?? 1;
            label = options.label;
            createMSAATexture = !!options.createMSAATexture;
            comparisonFunction = options.comparisonFunction || 0;
        }
        else {
            generateMipMaps = !!options;
        }
        useSRGBBuffer && (useSRGBBuffer = this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU));
        if (type === 1 && !this._caps.textureFloatLinearFiltering) {
            // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
            samplingMode = 1;
        }
        else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) {
            // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
            samplingMode = 1;
        }
        if (type === 1 && !this._caps.textureFloat) {
            type = 0;
            logger/* Logger */.V.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE");
        }
        const isDepthTexture = (0,internalTexture/* IsDepthTexture */.vl)(format);
        const hasStencil = (0,internalTexture/* HasStencilAspect */.$l)(format);
        const gl = this._gl;
        const texture = new internalTexture/* InternalTexture */.hV(this, source);
        const width = size.width || size;
        const height = size.height || size;
        const depth = size.depth || 0;
        const layers = size.layers || 0;
        const filters = this._getSamplingParameters(samplingMode, (generateMipMaps || createMipMaps) && !isDepthTexture);
        const target = layers !== 0 ? gl.TEXTURE_2D_ARRAY : depth !== 0 ? gl.TEXTURE_3D : gl.TEXTURE_2D;
        const sizedFormat = isDepthTexture
            ? this._getInternalFormatFromDepthTextureFormat(format, true, hasStencil)
            : this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer);
        const internalFormat = isDepthTexture ? (hasStencil ? gl.DEPTH_STENCIL : gl.DEPTH_COMPONENT) : this._getInternalFormat(format);
        const textureType = isDepthTexture ? this._getWebGLTextureTypeFromDepthTextureFormat(format) : this._getWebGLTextureType(type);
        // Bind
        this._bindTextureDirectly(target, texture);
        if (layers !== 0) {
            texture.is2DArray = true;
            gl.texImage3D(target, 0, sizedFormat, width, height, layers, 0, internalFormat, textureType, null);
        }
        else if (depth !== 0) {
            texture.is3D = true;
            gl.texImage3D(target, 0, sizedFormat, width, height, depth, 0, internalFormat, textureType, null);
        }
        else {
            gl.texImage2D(target, 0, sizedFormat, width, height, 0, internalFormat, textureType, null);
        }
        gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filters.mag);
        gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filters.min);
        gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
        gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
        if (isDepthTexture && this.webGLVersion > 1) {
            if (comparisonFunction === 0) {
                gl.texParameteri(target, gl.TEXTURE_COMPARE_FUNC, 515);
                gl.texParameteri(target, gl.TEXTURE_COMPARE_MODE, gl.NONE);
            }
            else {
                gl.texParameteri(target, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);
                gl.texParameteri(target, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
            }
        }
        // MipMaps
        if (generateMipMaps || createMipMaps) {
            this._gl.generateMipmap(target);
        }
        this._bindTextureDirectly(target, null);
        texture._useSRGBBuffer = useSRGBBuffer;
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.width = width;
        texture.height = height;
        texture.depth = layers || depth;
        texture.isReady = true;
        texture.samples = samples;
        texture.generateMipMaps = generateMipMaps;
        texture.samplingMode = samplingMode;
        texture.type = type;
        texture.format = format;
        texture.label = label;
        texture.comparisonFunction = comparisonFunction;
        this._internalTexturesCache.push(texture);
        if (createMSAATexture) {
            let renderBuffer = null;
            if ((0,internalTexture/* IsDepthTexture */.vl)(texture.format)) {
                renderBuffer = this._setupFramebufferDepthAttachments((0,internalTexture/* HasStencilAspect */.$l)(texture.format), texture.format !== 19, texture.width, texture.height, samples, texture.format, true);
            }
            else {
                renderBuffer = this._createRenderBuffer(texture.width, texture.height, samples, -1 /* not used */, this._getRGBABufferInternalSizedFormat(texture.type, texture.format, texture._useSRGBBuffer), -1 /* attachment */);
            }
            if (!renderBuffer) {
                throw new Error("Unable to create render buffer");
            }
            texture._autoMSAAManagement = true;
            let hardwareTexture = texture._hardwareTexture;
            if (!hardwareTexture) {
                hardwareTexture = texture._hardwareTexture = this._createHardwareTexture();
            }
            hardwareTexture.addMSAARenderBuffer(renderBuffer);
        }
        return texture;
    }
    /**
     * @internal
     */
    _getUseSRGBBuffer(useSRGBBuffer, noMipmap) {
        // Generating mipmaps for sRGB textures is not supported in WebGL1 so we must disable the support if mipmaps is enabled
        return useSRGBBuffer && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || noMipmap);
    }
    /**
     * Usually called from Texture.ts.
     * Passed information to create a WebGLTexture
     * @param url defines a value which contains one of the following:
     * * A conventional http URL, e.g. 'http://...' or 'file://...'
     * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
     * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
     * @param noMipmap defines a boolean indicating that no mipmaps shall be generated.  Ignored for compressed textures.  They must be in the file
     * @param invertY when true, image is flipped when loaded.  You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
     * @param scene needed for loading to the correct scene
     * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
     * @param onLoad optional callback to be called upon successful completion
     * @param onError optional callback to be called upon failure
     * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
     * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
     * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
     * @param forcedExtension defines the extension to use to pick the right loader
     * @param mimeType defines an optional mime type
     * @param loaderOptions options to be passed to the loader
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     * @returns a InternalTexture for assignment back into BABYLON.Texture
     */
    createTexture(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, creationFlags, useSRGBBuffer) {
        return this._createTextureBase(url, noMipmap, invertY, scene, samplingMode, onLoad, onError, (...args) => this._prepareWebGLTexture(...args, format), (potWidth, potHeight, img, extension, texture, continuationCallback) => {
            const gl = this._gl;
            const isPot = img.width === potWidth && img.height === potHeight;
            texture._creationFlags = creationFlags ?? 0;
            const tip = this._getTexImageParametersForCreateTexture(texture.format, texture._useSRGBBuffer);
            if (isPot) {
                gl.texImage2D(gl.TEXTURE_2D, 0, tip.internalFormat, tip.format, tip.type, img);
                return false;
            }
            const maxTextureSize = this._caps.maxTextureSize;
            if (img.width > maxTextureSize || img.height > maxTextureSize || !this._supportsHardwareTextureRescaling) {
                this._prepareWorkingCanvas();
                if (!this._workingCanvas || !this._workingContext) {
                    return false;
                }
                this._workingCanvas.width = potWidth;
                this._workingCanvas.height = potHeight;
                this._workingContext.drawImage(img, 0, 0, img.width, img.height, 0, 0, potWidth, potHeight);
                gl.texImage2D(gl.TEXTURE_2D, 0, tip.internalFormat, tip.format, tip.type, this._workingCanvas);
                texture.width = potWidth;
                texture.height = potHeight;
                return false;
            }
            else {
                // Using shaders when possible to rescale because canvas.drawImage is lossy
                const source = new internalTexture/* InternalTexture */.hV(this, 2 /* InternalTextureSource.Temp */);
                this._bindTextureDirectly(gl.TEXTURE_2D, source, true);
                gl.texImage2D(gl.TEXTURE_2D, 0, tip.internalFormat, tip.format, tip.type, img);
                this._rescaleTexture(source, texture, scene, tip.format, () => {
                    this._releaseTexture(source);
                    this._bindTextureDirectly(gl.TEXTURE_2D, texture, true);
                    continuationCallback();
                });
            }
            return true;
        }, buffer, fallback, format, forcedExtension, mimeType, loaderOptions, useSRGBBuffer);
    }
    /**
     * Calls to the GL texImage2D and texImage3D functions require three arguments describing the pixel format of the texture.
     * createTexture derives these from the babylonFormat and useSRGBBuffer arguments and also the file extension of the URL it's working with.
     * This function encapsulates that derivation for easy unit testing.
     * @param babylonFormat Babylon's format enum, as specified in ITextureCreationOptions.
     * @param fileExtension The file extension including the dot, e.g. .jpg.
     * @param useSRGBBuffer Use SRGB not linear.
     * @returns The options to pass to texImage2D or texImage3D calls.
     * @internal
     */
    _getTexImageParametersForCreateTexture(babylonFormat, useSRGBBuffer) {
        let format, internalFormat;
        if (this.webGLVersion === 1) {
            // In WebGL 1, format and internalFormat must be the same and taken from a limited set of values, see https://docs.gl/es2/glTexImage2D.
            // The SRGB extension (https://developer.mozilla.org/en-US/docs/Web/API/EXT_sRGB) adds some extra values, hence passing useSRGBBuffer
            // to getInternalFormat.
            format = this._getInternalFormat(babylonFormat, useSRGBBuffer);
            internalFormat = format;
        }
        else {
            // In WebGL 2, format has a wider range of values and internal format can be one of the sized formats, see
            // https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml.
            // SRGB is included in the sized format and should not be passed in "format", hence always passing useSRGBBuffer as false.
            format = this._getInternalFormat(babylonFormat, false);
            internalFormat = this._getRGBABufferInternalSizedFormat(0, babylonFormat, useSRGBBuffer);
        }
        return {
            internalFormat,
            format,
            type: this._gl.UNSIGNED_BYTE,
        };
    }
    /**
     * @internal
     */
    _rescaleTexture(source, destination, scene, internalFormat, onComplete) { }
    /**
     * @internal
     */
    _unpackFlipY(value) {
        if (this._unpackFlipYCached !== value) {
            this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, value ? 1 : 0);
            if (this.enableUnpackFlipYCached) {
                this._unpackFlipYCached = value;
            }
        }
    }
    /** @internal */
    _getUnpackAlignement() {
        return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT);
    }
    /** @internal */
    _getTextureTarget(texture) {
        if (texture.isCube) {
            return this._gl.TEXTURE_CUBE_MAP;
        }
        else if (texture.is3D) {
            return this._gl.TEXTURE_3D;
        }
        else if (texture.is2DArray || texture.isMultiview) {
            return this._gl.TEXTURE_2D_ARRAY;
        }
        return this._gl.TEXTURE_2D;
    }
    /**
     * Update the sampling mode of a given texture
     * @param samplingMode defines the required sampling mode
     * @param texture defines the texture to update
     * @param generateMipMaps defines whether to generate mipmaps for the texture
     */
    updateTextureSamplingMode(samplingMode, texture, generateMipMaps = false) {
        const target = this._getTextureTarget(texture);
        const filters = this._getSamplingParameters(samplingMode, texture.useMipMaps || generateMipMaps);
        this._setTextureParameterInteger(target, this._gl.TEXTURE_MAG_FILTER, filters.mag, texture);
        this._setTextureParameterInteger(target, this._gl.TEXTURE_MIN_FILTER, filters.min);
        if (generateMipMaps) {
            texture.generateMipMaps = true;
            this._gl.generateMipmap(target);
        }
        this._bindTextureDirectly(target, null);
        texture.samplingMode = samplingMode;
    }
    /**
     * Update the dimensions of a texture
     * @param texture texture to update
     * @param width new width of the texture
     * @param height new height of the texture
     * @param depth new depth of the texture
     */
    updateTextureDimensions(texture, width, height, depth = 1) { }
    /**
     * Update the sampling mode of a given texture
     * @param texture defines the texture to update
     * @param wrapU defines the texture wrap mode of the u coordinates
     * @param wrapV defines the texture wrap mode of the v coordinates
     * @param wrapR defines the texture wrap mode of the r coordinates
     */
    updateTextureWrappingMode(texture, wrapU, wrapV = null, wrapR = null) {
        const target = this._getTextureTarget(texture);
        if (wrapU !== null) {
            this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(wrapU), texture);
            texture._cachedWrapU = wrapU;
        }
        if (wrapV !== null) {
            this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(wrapV), texture);
            texture._cachedWrapV = wrapV;
        }
        if ((texture.is2DArray || texture.is3D) && wrapR !== null) {
            this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(wrapR), texture);
            texture._cachedWrapR = wrapR;
        }
        this._bindTextureDirectly(target, null);
    }
    /**
     * @internal
     */
    _uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, data, faceIndex = 0, lod = 0) {
        const gl = this._gl;
        let target = gl.TEXTURE_2D;
        if (texture.isCube) {
            target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex;
        }
        if (texture._useSRGBBuffer) {
            switch (internalFormat) {
                case 37492:
                case 36196:
                    // Note, if using ETC1 and sRGB is requested, this will use ETC2 if available.
                    if (this._caps.etc2) {
                        internalFormat = gl.COMPRESSED_SRGB8_ETC2;
                    }
                    else {
                        texture._useSRGBBuffer = false;
                    }
                    break;
                case 37496:
                    if (this._caps.etc2) {
                        internalFormat = gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
                    }
                    else {
                        texture._useSRGBBuffer = false;
                    }
                    break;
                case 36492:
                    internalFormat = gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;
                    break;
                case 37808:
                    internalFormat = gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
                    break;
                case 33776:
                    if (this._caps.s3tc_srgb) {
                        internalFormat = gl.COMPRESSED_SRGB_S3TC_DXT1_EXT;
                    }
                    else {
                        // S3TC sRGB extension not supported
                        texture._useSRGBBuffer = false;
                    }
                    break;
                case 33777:
                    if (this._caps.s3tc_srgb) {
                        internalFormat = gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
                    }
                    else {
                        // S3TC sRGB extension not supported
                        texture._useSRGBBuffer = false;
                    }
                    break;
                case 33779:
                    if (this._caps.s3tc_srgb) {
                        internalFormat = gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
                    }
                    else {
                        // S3TC sRGB extension not supported
                        texture._useSRGBBuffer = false;
                    }
                    break;
                default:
                    // We don't support a sRGB format corresponding to internalFormat, so revert to non sRGB format
                    texture._useSRGBBuffer = false;
                    break;
            }
        }
        this._gl.compressedTexImage2D(target, lod, internalFormat, width, height, 0, data);
    }
    /**
     * @internal
     */
    _uploadDataToTextureDirectly(texture, imageData, faceIndex = 0, lod = 0, babylonInternalFormat, useTextureWidthAndHeight = false) {
        const gl = this._gl;
        const textureType = this._getWebGLTextureType(texture.type);
        const format = this._getInternalFormat(texture.format);
        const internalFormat = babylonInternalFormat === undefined
            ? this._getRGBABufferInternalSizedFormat(texture.type, texture.format, texture._useSRGBBuffer)
            : this._getInternalFormat(babylonInternalFormat, texture._useSRGBBuffer);
        this._unpackFlipY(texture.invertY);
        let target = gl.TEXTURE_2D;
        if (texture.isCube) {
            target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex;
        }
        const lodMaxWidth = Math.round(Math.log(texture.width) * Math.LOG2E);
        const lodMaxHeight = Math.round(Math.log(texture.height) * Math.LOG2E);
        const width = useTextureWidthAndHeight ? texture.width : Math.pow(2, Math.max(lodMaxWidth - lod, 0));
        const height = useTextureWidthAndHeight ? texture.height : Math.pow(2, Math.max(lodMaxHeight - lod, 0));
        gl.texImage2D(target, lod, internalFormat, width, height, 0, format, textureType, imageData);
    }
    /**
     * Update a portion of an internal texture
     * @param texture defines the texture to update
     * @param imageData defines the data to store into the texture
     * @param xOffset defines the x coordinates of the update rectangle
     * @param yOffset defines the y coordinates of the update rectangle
     * @param width defines the width of the update rectangle
     * @param height defines the height of the update rectangle
     * @param faceIndex defines the face index if texture is a cube (0 by default)
     * @param lod defines the lod level to update (0 by default)
     * @param generateMipMaps defines whether to generate mipmaps or not
     */
    updateTextureData(texture, imageData, xOffset, yOffset, width, height, faceIndex = 0, lod = 0, generateMipMaps = false) {
        const gl = this._gl;
        const textureType = this._getWebGLTextureType(texture.type);
        const format = this._getInternalFormat(texture.format);
        this._unpackFlipY(texture.invertY);
        let targetForBinding = gl.TEXTURE_2D;
        let target = gl.TEXTURE_2D;
        if (texture.isCube) {
            target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex;
            targetForBinding = gl.TEXTURE_CUBE_MAP;
        }
        this._bindTextureDirectly(targetForBinding, texture, true);
        gl.texSubImage2D(target, lod, xOffset, yOffset, width, height, format, textureType, imageData);
        if (generateMipMaps) {
            this._gl.generateMipmap(target);
        }
        this._bindTextureDirectly(targetForBinding, null);
    }
    /**
     * @internal
     */
    _uploadArrayBufferViewToTexture(texture, imageData, faceIndex = 0, lod = 0) {
        const gl = this._gl;
        const bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
        this._bindTextureDirectly(bindTarget, texture, true);
        this._uploadDataToTextureDirectly(texture, imageData, faceIndex, lod);
        this._bindTextureDirectly(bindTarget, null, true);
    }
    _prepareWebGLTextureContinuation(texture, scene, noMipmap, isCompressed, samplingMode) {
        const gl = this._gl;
        if (!gl) {
            return;
        }
        const filters = this._getSamplingParameters(samplingMode, !noMipmap);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filters.mag);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filters.min);
        if (!noMipmap && !isCompressed) {
            gl.generateMipmap(gl.TEXTURE_2D);
        }
        this._bindTextureDirectly(gl.TEXTURE_2D, null);
        // this.resetTextureCache();
        if (scene) {
            scene.removePendingData(texture);
        }
        texture.onLoadedObservable.notifyObservers(texture);
        texture.onLoadedObservable.clear();
    }
    _prepareWebGLTexture(texture, extension, scene, img, invertY, noMipmap, isCompressed, processFunction, samplingMode, format) {
        const maxTextureSize = this.getCaps().maxTextureSize;
        const potWidth = Math.min(maxTextureSize, this.needPOTTextures ? (0,tools_functions/* GetExponentOfTwo */.R)(img.width, maxTextureSize) : img.width);
        const potHeight = Math.min(maxTextureSize, this.needPOTTextures ? (0,tools_functions/* GetExponentOfTwo */.R)(img.height, maxTextureSize) : img.height);
        const gl = this._gl;
        if (!gl) {
            return;
        }
        if (!texture._hardwareTexture) {
            //  this.resetTextureCache();
            if (scene) {
                scene.removePendingData(texture);
            }
            return;
        }
        this._bindTextureDirectly(gl.TEXTURE_2D, texture, true);
        this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);
        texture.baseWidth = img.width;
        texture.baseHeight = img.height;
        texture.width = potWidth;
        texture.height = potHeight;
        texture.isReady = true;
        texture.type = texture.type !== -1 ? texture.type : 0;
        texture.format =
            texture.format !== -1 ? texture.format : (format ?? (extension === ".jpg" && !texture._useSRGBBuffer ? 4 : 5));
        if (processFunction(potWidth, potHeight, img, extension, texture, () => {
            this._prepareWebGLTextureContinuation(texture, scene, noMipmap, isCompressed, samplingMode);
        })) {
            // Returning as texture needs extra async steps
            return;
        }
        this._prepareWebGLTextureContinuation(texture, scene, noMipmap, isCompressed, samplingMode);
    }
    _getInternalFormatFromDepthTextureFormat(textureFormat, hasDepth, hasStencil) {
        const gl = this._gl;
        if (!hasDepth) {
            return gl.STENCIL_INDEX8;
        }
        const format = hasStencil ? gl.DEPTH_STENCIL : gl.DEPTH_COMPONENT;
        let internalFormat = format;
        if (this.webGLVersion > 1) {
            if (textureFormat === 15) {
                internalFormat = gl.DEPTH_COMPONENT16;
            }
            else if (textureFormat === 16) {
                internalFormat = gl.DEPTH_COMPONENT24;
            }
            else if (textureFormat === 17 || textureFormat === 13) {
                internalFormat = hasStencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
            }
            else if (textureFormat === 14) {
                internalFormat = gl.DEPTH_COMPONENT32F;
            }
            else if (textureFormat === 18) {
                internalFormat = hasStencil ? gl.DEPTH32F_STENCIL8 : gl.DEPTH_COMPONENT32F;
            }
        }
        else {
            internalFormat = gl.DEPTH_COMPONENT16;
        }
        return internalFormat;
    }
    _getWebGLTextureTypeFromDepthTextureFormat(textureFormat) {
        const gl = this._gl;
        let type = gl.UNSIGNED_INT;
        if (textureFormat === 15) {
            type = gl.UNSIGNED_SHORT;
        }
        else if (textureFormat === 17 || textureFormat === 13) {
            type = gl.UNSIGNED_INT_24_8;
        }
        else if (textureFormat === 14) {
            type = gl.FLOAT;
        }
        else if (textureFormat === 18) {
            type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV;
        }
        else if (textureFormat === 19) {
            type = gl.UNSIGNED_BYTE;
        }
        return type;
    }
    /**
     * @internal
     */
    _setupFramebufferDepthAttachments(generateStencilBuffer, generateDepthBuffer, width, height, samples = 1, depthTextureFormat, dontBindRenderBufferToFrameBuffer = false) {
        const gl = this._gl;
        depthTextureFormat = depthTextureFormat ?? (generateStencilBuffer ? 13 : 14);
        const internalFormat = this._getInternalFormatFromDepthTextureFormat(depthTextureFormat, generateDepthBuffer, generateStencilBuffer);
        // Create the depth/stencil buffer
        if (generateStencilBuffer && generateDepthBuffer) {
            return this._createRenderBuffer(width, height, samples, gl.DEPTH_STENCIL, internalFormat, dontBindRenderBufferToFrameBuffer ? -1 : gl.DEPTH_STENCIL_ATTACHMENT);
        }
        if (generateDepthBuffer) {
            return this._createRenderBuffer(width, height, samples, internalFormat, internalFormat, dontBindRenderBufferToFrameBuffer ? -1 : gl.DEPTH_ATTACHMENT);
        }
        if (generateStencilBuffer) {
            return this._createRenderBuffer(width, height, samples, internalFormat, internalFormat, dontBindRenderBufferToFrameBuffer ? -1 : gl.STENCIL_ATTACHMENT);
        }
        return null;
    }
    /**
     * @internal
     */
    _createRenderBuffer(width, height, samples, internalFormat, msInternalFormat, attachment, unbindBuffer = true) {
        const gl = this._gl;
        const renderBuffer = gl.createRenderbuffer();
        return this._updateRenderBuffer(renderBuffer, width, height, samples, internalFormat, msInternalFormat, attachment, unbindBuffer);
    }
    _updateRenderBuffer(renderBuffer, width, height, samples, internalFormat, msInternalFormat, attachment, unbindBuffer = true) {
        const gl = this._gl;
        gl.bindRenderbuffer(gl.RENDERBUFFER, renderBuffer);
        if (samples > 1 && gl.renderbufferStorageMultisample) {
            gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, msInternalFormat, width, height);
        }
        else {
            gl.renderbufferStorage(gl.RENDERBUFFER, internalFormat, width, height);
        }
        if (attachment !== -1) {
            gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, renderBuffer);
        }
        if (unbindBuffer) {
            gl.bindRenderbuffer(gl.RENDERBUFFER, null);
        }
        return renderBuffer;
    }
    /**
     * @internal
     */
    _releaseTexture(texture) {
        this._deleteTexture(texture._hardwareTexture);
        // Unbind channels
        this.unbindAllTextures();
        const index = this._internalTexturesCache.indexOf(texture);
        if (index !== -1) {
            this._internalTexturesCache.splice(index, 1);
        }
        // Integrated fixed lod samplers.
        if (texture._lodTextureHigh) {
            texture._lodTextureHigh.dispose();
        }
        if (texture._lodTextureMid) {
            texture._lodTextureMid.dispose();
        }
        if (texture._lodTextureLow) {
            texture._lodTextureLow.dispose();
        }
        // Integrated irradiance map.
        if (texture._irradianceTexture) {
            texture._irradianceTexture.dispose();
        }
    }
    _deleteTexture(texture) {
        texture?.release();
    }
    _setProgram(program) {
        if (this._currentProgram !== program) {
            (0,thinEngine_functions/* _setProgram */.C5)(program, this._gl);
            this._currentProgram = program;
        }
    }
    /**
     * Binds an effect to the webGL context
     * @param effect defines the effect to bind
     */
    bindSamplers(effect) {
        const webGLPipelineContext = effect.getPipelineContext();
        this._setProgram(webGLPipelineContext.program);
        const samplers = effect.getSamplers();
        for (let index = 0; index < samplers.length; index++) {
            const uniform = effect.getUniform(samplers[index]);
            if (uniform) {
                this._boundUniforms[index] = uniform;
            }
        }
        this._currentEffect = null;
    }
    _activateCurrentTexture() {
        if (this._currentTextureChannel !== this._activeChannel) {
            this._gl.activeTexture(this._gl.TEXTURE0 + this._activeChannel);
            this._currentTextureChannel = this._activeChannel;
        }
    }
    /**
     * @internal
     */
    _bindTextureDirectly(target, texture, forTextureDataUpdate = false, force = false) {
        let wasPreviouslyBound = false;
        const isTextureForRendering = texture && texture._associatedChannel > -1;
        if (forTextureDataUpdate && isTextureForRendering) {
            this._activeChannel = texture._associatedChannel;
        }
        const currentTextureBound = this._boundTexturesCache[this._activeChannel];
        if (currentTextureBound !== texture || force) {
            this._activateCurrentTexture();
            if (texture && texture.isMultiview) {
                //this._gl.bindTexture(target, texture ? texture._colorTextureArray : null);
                logger/* Logger */.V.Error(["_bindTextureDirectly called with a multiview texture!", target, texture]);
                // eslint-disable-next-line no-throw-literal
                throw "_bindTextureDirectly called with a multiview texture!";
            }
            else {
                this._gl.bindTexture(target, texture?._hardwareTexture?.underlyingResource ?? null);
            }
            this._boundTexturesCache[this._activeChannel] = texture;
            if (texture) {
                texture._associatedChannel = this._activeChannel;
            }
        }
        else if (forTextureDataUpdate) {
            wasPreviouslyBound = true;
            this._activateCurrentTexture();
        }
        if (isTextureForRendering && !forTextureDataUpdate) {
            this._bindSamplerUniformToChannel(texture._associatedChannel, this._activeChannel);
        }
        return wasPreviouslyBound;
    }
    /**
     * @internal
     */
    _bindTexture(channel, texture, name) {
        if (channel === undefined) {
            return;
        }
        if (texture) {
            texture._associatedChannel = channel;
        }
        this._activeChannel = channel;
        const target = texture ? this._getTextureTarget(texture) : this._gl.TEXTURE_2D;
        this._bindTextureDirectly(target, texture);
    }
    /**
     * Unbind all textures from the webGL context
     */
    unbindAllTextures() {
        for (let channel = 0; channel < this._maxSimultaneousTextures; channel++) {
            this._activeChannel = channel;
            this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
            this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
            if (this.webGLVersion > 1) {
                this._bindTextureDirectly(this._gl.TEXTURE_3D, null);
                this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null);
            }
        }
    }
    /**
     * Sets a texture to the according uniform.
     * @param channel The texture channel
     * @param uniform The uniform to set
     * @param texture The texture to apply
     * @param name The name of the uniform in the effect
     */
    setTexture(channel, uniform, texture, name) {
        if (channel === undefined) {
            return;
        }
        if (uniform) {
            this._boundUniforms[channel] = uniform;
        }
        this._setTexture(channel, texture);
    }
    _bindSamplerUniformToChannel(sourceSlot, destination) {
        const uniform = this._boundUniforms[sourceSlot];
        if (!uniform || uniform._currentState === destination) {
            return;
        }
        this._gl.uniform1i(uniform, destination);
        uniform._currentState = destination;
    }
    _getTextureWrapMode(mode) {
        switch (mode) {
            case 1:
                return this._gl.REPEAT;
            case 0:
                return this._gl.CLAMP_TO_EDGE;
            case 2:
                return this._gl.MIRRORED_REPEAT;
        }
        return this._gl.REPEAT;
    }
    _setTexture(channel, texture, isPartOfTextureArray = false, depthStencilTexture = false, name = "") {
        // Not ready?
        if (!texture) {
            if (this._boundTexturesCache[channel] != null) {
                this._activeChannel = channel;
                this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
                this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
                if (this.webGLVersion > 1) {
                    this._bindTextureDirectly(this._gl.TEXTURE_3D, null);
                    this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null);
                }
            }
            return false;
        }
        // Video
        if (texture.video) {
            this._activeChannel = channel;
            const videoInternalTexture = texture.getInternalTexture();
            if (videoInternalTexture) {
                videoInternalTexture._associatedChannel = channel;
            }
            texture.update();
        }
        else if (texture.delayLoadState === 4) {
            // Delay loading
            texture.delayLoad();
            return false;
        }
        let internalTexture;
        if (depthStencilTexture) {
            internalTexture = texture.depthStencilTexture;
        }
        else if (texture.isReady()) {
            internalTexture = texture.getInternalTexture();
        }
        else if (texture.isCube) {
            internalTexture = this.emptyCubeTexture;
        }
        else if (texture.is3D) {
            internalTexture = this.emptyTexture3D;
        }
        else if (texture.is2DArray) {
            internalTexture = this.emptyTexture2DArray;
        }
        else {
            internalTexture = this.emptyTexture;
        }
        if (!isPartOfTextureArray && internalTexture) {
            internalTexture._associatedChannel = channel;
        }
        let needToBind = true;
        if (this._boundTexturesCache[channel] === internalTexture) {
            if (!isPartOfTextureArray) {
                this._bindSamplerUniformToChannel(internalTexture._associatedChannel, channel);
            }
            needToBind = false;
        }
        this._activeChannel = channel;
        const target = this._getTextureTarget(internalTexture);
        if (needToBind) {
            this._bindTextureDirectly(target, internalTexture, isPartOfTextureArray);
        }
        if (internalTexture && !internalTexture.isMultiview) {
            // CUBIC_MODE and SKYBOX_MODE both require CLAMP_TO_EDGE.  All other modes use REPEAT.
            if (internalTexture.isCube && internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) {
                internalTexture._cachedCoordinatesMode = texture.coordinatesMode;
                const textureWrapMode = texture.coordinatesMode !== 3 && texture.coordinatesMode !== 5
                    ? 1
                    : 0;
                texture.wrapU = textureWrapMode;
                texture.wrapV = textureWrapMode;
            }
            if (internalTexture._cachedWrapU !== texture.wrapU) {
                internalTexture._cachedWrapU = texture.wrapU;
                this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(texture.wrapU), internalTexture);
            }
            if (internalTexture._cachedWrapV !== texture.wrapV) {
                internalTexture._cachedWrapV = texture.wrapV;
                this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(texture.wrapV), internalTexture);
            }
            if (internalTexture.is3D && internalTexture._cachedWrapR !== texture.wrapR) {
                internalTexture._cachedWrapR = texture.wrapR;
                this._setTextureParameterInteger(target, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(texture.wrapR), internalTexture);
            }
            this._setAnisotropicLevel(target, internalTexture, texture.anisotropicFilteringLevel);
        }
        return true;
    }
    /**
     * Sets an array of texture to the webGL context
     * @param channel defines the channel where the texture array must be set
     * @param uniform defines the associated uniform location
     * @param textures defines the array of textures to bind
     * @param name name of the channel
     */
    setTextureArray(channel, uniform, textures, name) {
        if (channel === undefined || !uniform) {
            return;
        }
        if (!this._textureUnits || this._textureUnits.length !== textures.length) {
            this._textureUnits = new Int32Array(textures.length);
        }
        for (let i = 0; i < textures.length; i++) {
            const texture = textures[i].getInternalTexture();
            if (texture) {
                this._textureUnits[i] = channel + i;
                texture._associatedChannel = channel + i;
            }
            else {
                this._textureUnits[i] = -1;
            }
        }
        this._gl.uniform1iv(uniform, this._textureUnits);
        for (let index = 0; index < textures.length; index++) {
            this._setTexture(this._textureUnits[index], textures[index], true);
        }
    }
    /**
     * @internal
     */
    _setAnisotropicLevel(target, internalTexture, anisotropicFilteringLevel) {
        const anisotropicFilterExtension = this._caps.textureAnisotropicFilterExtension;
        if (internalTexture.samplingMode !== 11 &&
            internalTexture.samplingMode !== 3 &&
            internalTexture.samplingMode !== 2) {
            anisotropicFilteringLevel = 1; // Forcing the anisotropic to 1 because else webgl will force filters to linear
        }
        if (anisotropicFilterExtension && internalTexture._cachedAnisotropicFilteringLevel !== anisotropicFilteringLevel) {
            this._setTextureParameterFloat(target, anisotropicFilterExtension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(anisotropicFilteringLevel, this._caps.maxAnisotropy), internalTexture);
            internalTexture._cachedAnisotropicFilteringLevel = anisotropicFilteringLevel;
        }
    }
    _setTextureParameterFloat(target, parameter, value, texture) {
        this._bindTextureDirectly(target, texture, true, true);
        this._gl.texParameterf(target, parameter, value);
    }
    _setTextureParameterInteger(target, parameter, value, texture) {
        if (texture) {
            this._bindTextureDirectly(target, texture, true, true);
        }
        this._gl.texParameteri(target, parameter, value);
    }
    /**
     * Unbind all vertex attributes from the webGL context
     */
    unbindAllAttributes() {
        if (this._mustWipeVertexAttributes) {
            this._mustWipeVertexAttributes = false;
            for (let i = 0; i < this._caps.maxVertexAttribs; i++) {
                this.disableAttributeByIndex(i);
            }
            return;
        }
        for (let i = 0, ul = this._vertexAttribArraysEnabled.length; i < ul; i++) {
            if (i >= this._caps.maxVertexAttribs || !this._vertexAttribArraysEnabled[i]) {
                continue;
            }
            this.disableAttributeByIndex(i);
        }
    }
    /**
     * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled
     */
    releaseEffects() {
        const keys = Object.keys(this._compiledEffects);
        for (const name of keys) {
            const effect = this._compiledEffects[name];
            effect.dispose(true);
        }
        this._compiledEffects = {};
    }
    /**
     * Dispose and release all associated resources
     */
    dispose() {
        // Events
        if ((0,domManagement/* IsWindowObjectExist */.BA)()) {
            if (this._renderingCanvas) {
                if (!this._doNotHandleContextLost) {
                    this._renderingCanvas.removeEventListener("webglcontextlost", this._onContextLost);
                    this._renderingCanvas.removeEventListener("webglcontextrestored", this._onContextRestored);
                }
            }
        }
        // Should not be moved up of renderingCanvas will be null.
        super.dispose();
        if (this._dummyFramebuffer) {
            this._gl.deleteFramebuffer(this._dummyFramebuffer);
        }
        // Unbind
        this.unbindAllAttributes();
        this._boundUniforms = {};
        this._workingCanvas = null;
        this._workingContext = null;
        this._currentBufferPointers.length = 0;
        this._currentProgram = null;
        if (this._creationOptions.loseContextOnDispose) {
            this._gl.getExtension("WEBGL_lose_context")?.loseContext();
        }
        // clear the state object
        (0,thinEngine_functions/* deleteStateObject */.Cm)(this._gl);
    }
    /**
     * Attach a new callback raised when context lost event is fired
     * @param callback defines the callback to call
     */
    attachContextLostEvent(callback) {
        if (this._renderingCanvas) {
            this._renderingCanvas.addEventListener("webglcontextlost", callback, false);
        }
    }
    /**
     * Attach a new callback raised when context restored event is fired
     * @param callback defines the callback to call
     */
    attachContextRestoredEvent(callback) {
        if (this._renderingCanvas) {
            this._renderingCanvas.addEventListener("webglcontextrestored", callback, false);
        }
    }
    /**
     * Get the current error code of the webGL context
     * @returns the error code
     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError
     */
    getError() {
        return this._gl.getError();
    }
    _canRenderToFloatFramebuffer() {
        if (this._webGLVersion > 1) {
            return this._caps.colorBufferFloat;
        }
        return this._canRenderToFramebuffer(1);
    }
    _canRenderToHalfFloatFramebuffer() {
        if (this._webGLVersion > 1) {
            return this._caps.colorBufferFloat;
        }
        return this._canRenderToFramebuffer(2);
    }
    // Thank you : http://stackoverflow.com/questions/28827511/webgl-ios-render-to-floating-point-texture
    _canRenderToFramebuffer(type) {
        const gl = this._gl;
        //clear existing errors
        // eslint-disable-next-line no-empty
        while (gl.getError() !== gl.NO_ERROR) { }
        let successful = true;
        const texture = gl.createTexture();
        gl.bindTexture(gl.TEXTURE_2D, texture);
        gl.texImage2D(gl.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(type), 1, 1, 0, gl.RGBA, this._getWebGLTextureType(type), null);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
        const fb = gl.createFramebuffer();
        gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
        const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
        successful = successful && status === gl.FRAMEBUFFER_COMPLETE;
        successful = successful && gl.getError() === gl.NO_ERROR;
        //try render by clearing frame buffer's color buffer
        if (successful) {
            gl.clear(gl.COLOR_BUFFER_BIT);
            successful = successful && gl.getError() === gl.NO_ERROR;
        }
        //try reading from frame to ensure render occurs (just creating the FBO is not sufficient to determine if rendering is supported)
        if (successful) {
            //in practice it's sufficient to just read from the backbuffer rather than handle potentially issues reading from the texture
            gl.bindFramebuffer(gl.FRAMEBUFFER, null);
            const readFormat = gl.RGBA;
            const readType = gl.UNSIGNED_BYTE;
            const buffer = new Uint8Array(4);
            gl.readPixels(0, 0, 1, 1, readFormat, readType, buffer);
            successful = successful && gl.getError() === gl.NO_ERROR;
        }
        //clean up
        gl.deleteTexture(texture);
        gl.deleteFramebuffer(fb);
        gl.bindFramebuffer(gl.FRAMEBUFFER, null);
        //clear accumulated errors
        // eslint-disable-next-line no-empty
        while (!successful && gl.getError() !== gl.NO_ERROR) { }
        return successful;
    }
    /**
     * @internal
     */
    _getWebGLTextureType(type) {
        if (this._webGLVersion === 1) {
            switch (type) {
                case 1:
                    return this._gl.FLOAT;
                case 2:
                    return this._gl.HALF_FLOAT_OES;
                case 0:
                    return this._gl.UNSIGNED_BYTE;
                case 8:
                    return this._gl.UNSIGNED_SHORT_4_4_4_4;
                case 9:
                    return this._gl.UNSIGNED_SHORT_5_5_5_1;
                case 10:
                    return this._gl.UNSIGNED_SHORT_5_6_5;
            }
            return this._gl.UNSIGNED_BYTE;
        }
        switch (type) {
            case 3:
                return this._gl.BYTE;
            case 0:
                return this._gl.UNSIGNED_BYTE;
            case 4:
                return this._gl.SHORT;
            case 5:
                return this._gl.UNSIGNED_SHORT;
            case 6:
                return this._gl.INT;
            case 7: // Refers to UNSIGNED_INT
                return this._gl.UNSIGNED_INT;
            case 1:
                return this._gl.FLOAT;
            case 2:
                return this._gl.HALF_FLOAT;
            case 8:
                return this._gl.UNSIGNED_SHORT_4_4_4_4;
            case 9:
                return this._gl.UNSIGNED_SHORT_5_5_5_1;
            case 10:
                return this._gl.UNSIGNED_SHORT_5_6_5;
            case 11:
                return this._gl.UNSIGNED_INT_2_10_10_10_REV;
            case 12:
                return this._gl.UNSIGNED_INT_24_8;
            case 13:
                return this._gl.UNSIGNED_INT_10F_11F_11F_REV;
            case 14:
                return this._gl.UNSIGNED_INT_5_9_9_9_REV;
            case 15:
                return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV;
        }
        return this._gl.UNSIGNED_BYTE;
    }
    /**
     * @internal
     */
    _getInternalFormat(format, useSRGBBuffer = false) {
        let internalFormat = useSRGBBuffer ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : this._gl.RGBA;
        switch (format) {
            case 0:
                internalFormat = this._gl.ALPHA;
                break;
            case 1:
                internalFormat = this._gl.LUMINANCE;
                break;
            case 2:
                internalFormat = this._gl.LUMINANCE_ALPHA;
                break;
            case 6:
            case 33322:
            case 36760:
                internalFormat = this._gl.RED;
                break;
            case 7:
            case 33324:
            case 36761:
                internalFormat = this._gl.RG;
                break;
            case 4:
            case 32852:
            case 36762:
                internalFormat = useSRGBBuffer ? this._glSRGBExtensionValues.SRGB : this._gl.RGB;
                break;
            case 5:
            case 32859:
            case 36763:
                internalFormat = useSRGBBuffer ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : this._gl.RGBA;
                break;
        }
        if (this._webGLVersion > 1) {
            switch (format) {
                case 8:
                    internalFormat = this._gl.RED_INTEGER;
                    break;
                case 9:
                    internalFormat = this._gl.RG_INTEGER;
                    break;
                case 10:
                    internalFormat = this._gl.RGB_INTEGER;
                    break;
                case 11:
                    internalFormat = this._gl.RGBA_INTEGER;
                    break;
            }
        }
        return internalFormat;
    }
    /**
     * @internal
     */
    _getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer = false) {
        if (this._webGLVersion === 1) {
            if (format !== undefined) {
                switch (format) {
                    case 0:
                        return this._gl.ALPHA;
                    case 1:
                        return this._gl.LUMINANCE;
                    case 2:
                        return this._gl.LUMINANCE_ALPHA;
                    case 4:
                        return useSRGBBuffer ? this._glSRGBExtensionValues.SRGB : this._gl.RGB;
                }
            }
            return this._gl.RGBA;
        }
        switch (type) {
            case 3:
                switch (format) {
                    case 6:
                        return this._gl.R8_SNORM;
                    case 7:
                        return this._gl.RG8_SNORM;
                    case 4:
                        return this._gl.RGB8_SNORM;
                    case 8:
                        return this._gl.R8I;
                    case 9:
                        return this._gl.RG8I;
                    case 10:
                        return this._gl.RGB8I;
                    case 11:
                        return this._gl.RGBA8I;
                    default:
                        return this._gl.RGBA8_SNORM;
                }
            case 0:
                switch (format) {
                    case 6:
                        return this._gl.R8;
                    case 7:
                        return this._gl.RG8;
                    case 4:
                        return useSRGBBuffer ? this._glSRGBExtensionValues.SRGB8 : this._gl.RGB8; // By default. Other possibilities are RGB565, SRGB8.
                    case 5:
                        return useSRGBBuffer ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : this._gl.RGBA8; // By default. Other possibilities are RGB5_A1, RGBA4, SRGB8_ALPHA8.
                    case 8:
                        return this._gl.R8UI;
                    case 9:
                        return this._gl.RG8UI;
                    case 10:
                        return this._gl.RGB8UI;
                    case 11:
                        return this._gl.RGBA8UI;
                    case 0:
                        return this._gl.ALPHA;
                    case 1:
                        return this._gl.LUMINANCE;
                    case 2:
                        return this._gl.LUMINANCE_ALPHA;
                    default:
                        return this._gl.RGBA8;
                }
            case 4:
                switch (format) {
                    case 8:
                        return this._gl.R16I;
                    case 36760:
                        return this._gl.R16_SNORM_EXT;
                    case 36761:
                        return this._gl.RG16_SNORM_EXT;
                    case 36762:
                        return this._gl.RGB16_SNORM_EXT;
                    case 36763:
                        return this._gl.RGBA16_SNORM_EXT;
                    case 9:
                        return this._gl.RG16I;
                    case 10:
                        return this._gl.RGB16I;
                    case 11:
                        return this._gl.RGBA16I;
                    default:
                        return this._gl.RGBA16I;
                }
            case 5:
                switch (format) {
                    case 8:
                        return this._gl.R16UI;
                    case 33322:
                        return this._gl.R16_EXT;
                    case 33324:
                        return this._gl.RG16_EXT;
                    case 32852:
                        return this._gl.RGB16_EXT;
                    case 32859:
                        return this._gl.RGBA16_EXT;
                    case 9:
                        return this._gl.RG16UI;
                    case 10:
                        return this._gl.RGB16UI;
                    case 11:
                        return this._gl.RGBA16UI;
                    default:
                        return this._gl.RGBA16UI;
                }
            case 6:
                switch (format) {
                    case 8:
                        return this._gl.R32I;
                    case 9:
                        return this._gl.RG32I;
                    case 10:
                        return this._gl.RGB32I;
                    case 11:
                        return this._gl.RGBA32I;
                    default:
                        return this._gl.RGBA32I;
                }
            case 7: // Refers to UNSIGNED_INT
                switch (format) {
                    case 8:
                        return this._gl.R32UI;
                    case 9:
                        return this._gl.RG32UI;
                    case 10:
                        return this._gl.RGB32UI;
                    case 11:
                        return this._gl.RGBA32UI;
                    default:
                        return this._gl.RGBA32UI;
                }
            case 1:
                switch (format) {
                    case 6:
                        return this._gl.R32F; // By default. Other possibility is R16F.
                    case 7:
                        return this._gl.RG32F; // By default. Other possibility is RG16F.
                    case 4:
                        return this._gl.RGB32F; // By default. Other possibilities are RGB16F, R11F_G11F_B10F, RGB9_E5.
                    case 5:
                        return this._gl.RGBA32F; // By default. Other possibility is RGBA16F.
                    default:
                        return this._gl.RGBA32F;
                }
            case 2:
                switch (format) {
                    case 6:
                        return this._gl.R16F;
                    case 7:
                        return this._gl.RG16F;
                    case 4:
                        return this._gl.RGB16F; // By default. Other possibilities are R11F_G11F_B10F, RGB9_E5.
                    case 5:
                        return this._gl.RGBA16F;
                    default:
                        return this._gl.RGBA16F;
                }
            case 10:
                return this._gl.RGB565;
            case 13:
                return this._gl.R11F_G11F_B10F;
            case 14:
                return this._gl.RGB9_E5;
            case 8:
                return this._gl.RGBA4;
            case 9:
                return this._gl.RGB5_A1;
            case 11:
                switch (format) {
                    case 5:
                        return this._gl.RGB10_A2; // By default. Other possibility is RGB5_A1.
                    case 11:
                        return this._gl.RGB10_A2UI;
                    default:
                        return this._gl.RGB10_A2;
                }
        }
        return useSRGBBuffer ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : this._gl.RGBA8;
    }
    /**
     * Reads pixels from the current frame buffer. Please note that this function can be slow
     * @param x defines the x coordinate of the rectangle where pixels must be read
     * @param y defines the y coordinate of the rectangle where pixels must be read
     * @param width defines the width of the rectangle where pixels must be read
     * @param height defines the height of the rectangle where pixels must be read
     * @param hasAlpha defines whether the output should have alpha or not (defaults to true)
     * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
     * @returns a ArrayBufferView promise (Uint8Array) containing RGBA colors
     */
    readPixels(x, y, width, height, hasAlpha = true, flushRenderer = true) {
        const numChannels = hasAlpha ? 4 : 3;
        const format = hasAlpha ? this._gl.RGBA : this._gl.RGB;
        const data = new Uint8Array(height * width * numChannels);
        if (flushRenderer) {
            this.flushFramebuffer();
        }
        this._gl.readPixels(x, y, width, height, format, this._gl.UNSIGNED_BYTE, data);
        return Promise.resolve(data);
    }
    /**
     * Gets a Promise<boolean> indicating if the engine can be instantiated (ie. if a webGL context can be found)
     */
    static get IsSupportedAsync() {
        return Promise.resolve(this.isSupported());
    }
    /**
     * Gets a boolean indicating if the engine can be instantiated (ie. if a webGL context can be found)
     */
    static get IsSupported() {
        return this.isSupported(); // Backward compat
    }
    /**
     * Gets a boolean indicating if the engine can be instantiated (ie. if a webGL context can be found)
     * @returns true if the engine can be created
     * @ignorenaming
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static isSupported() {
        if (this._HasMajorPerformanceCaveat !== null) {
            return !this._HasMajorPerformanceCaveat; // We know it is performant so WebGL is supported
        }
        if (this._IsSupported === null) {
            try {
                const tempcanvas = abstractEngine/* AbstractEngine */.$._CreateCanvas(1, 1);
                const gl = tempcanvas.getContext("webgl") || tempcanvas.getContext("experimental-webgl");
                this._IsSupported = gl != null && !!window.WebGLRenderingContext;
            }
            catch (e) {
                this._IsSupported = false;
            }
        }
        return this._IsSupported;
    }
    /**
     * Gets a boolean indicating if the engine can be instantiated on a performant device (ie. if a webGL context can be found and it does not use a slow implementation)
     */
    static get HasMajorPerformanceCaveat() {
        if (this._HasMajorPerformanceCaveat === null) {
            try {
                const tempcanvas = abstractEngine/* AbstractEngine */.$._CreateCanvas(1, 1);
                const gl = tempcanvas.getContext("webgl", { failIfMajorPerformanceCaveat: true }) ||
                    tempcanvas.getContext("experimental-webgl", { failIfMajorPerformanceCaveat: true });
                this._HasMajorPerformanceCaveat = !gl;
            }
            catch (e) {
                this._HasMajorPerformanceCaveat = false;
            }
        }
        return this._HasMajorPerformanceCaveat;
    }
}
ThinEngine._TempClearColorUint32 = new Uint32Array(4);
ThinEngine._TempClearColorInt32 = new Int32Array(4);
/** Use this array to turn off some WebGL2 features on known buggy browsers version */
ThinEngine.ExceptionList = [
    { key: "Chrome/63.0", capture: "63\\.0\\.3239\\.(\\d+)", captureConstraint: 108, targets: ["uniformBuffer"] },
    { key: "Firefox/58", capture: null, captureConstraint: null, targets: ["uniformBuffer"] },
    { key: "Firefox/59", capture: null, captureConstraint: null, targets: ["uniformBuffer"] },
    { key: "Chrome/72.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] },
    { key: "Chrome/73.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] },
    { key: "Chrome/74.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] },
    { key: "Mac OS.+Chrome/71", capture: null, captureConstraint: null, targets: ["vao"] },
    { key: "Mac OS.+Chrome/72", capture: null, captureConstraint: null, targets: ["vao"] },
    { key: "Mac OS.+Chrome", capture: null, captureConstraint: null, targets: ["uniformBuffer"] },
    { key: "Chrome/12\\d\\..+?Mobile", capture: null, captureConstraint: null, targets: ["uniformBuffer"] },
    // desktop osx safari 15.4
    { key: ".*AppleWebKit.*(15.4).*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] },
    // mobile browsers using safari 15.4 on ios
    { key: ".*(15.4).*AppleWebKit.*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] },
];
// eslint-disable-next-line @typescript-eslint/naming-convention
ThinEngine._ConcatenateShader = abstractEngine_functions/* _ConcatenateShader */.iL;
// Statics
ThinEngine._IsSupported = null;
ThinEngine._HasMajorPerformanceCaveat = null;
//# sourceMappingURL=thinEngine.js.map

/***/ }),

/***/ 69579:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   G: () => (/* binding */ ClipboardEventTypes),
/* harmony export */   f: () => (/* binding */ ClipboardInfo)
/* harmony export */ });
/**
 * Gather the list of clipboard event types as constants.
 */
class ClipboardEventTypes {
}
/**
 * The clipboard event is fired when a copy command is active (pressed).
 */
ClipboardEventTypes.COPY = 0x01; //
/**
 *  The clipboard event is fired when a cut command is active (pressed).
 */
ClipboardEventTypes.CUT = 0x02;
/**
 * The clipboard event is fired when a paste command is active (pressed).
 */
ClipboardEventTypes.PASTE = 0x03;
/**
 * This class is used to store clipboard related info for the onClipboardObservable event.
 */
class ClipboardInfo {
    /**
     *Creates an instance of ClipboardInfo.
     * @param type Defines the type of event (BABYLON.ClipboardEventTypes)
     * @param event Defines the related dom event
     */
    constructor(
    /**
     * Defines the type of event (BABYLON.ClipboardEventTypes)
     */
    type, 
    /**
     * Defines the related dom event
     */
    event) {
        this.type = type;
        this.event = event;
    }
    /**
     *  Get the clipboard event's type from the keycode.
     * @param keyCode Defines the keyCode for the current keyboard event.
     * @returns {number}
     */
    static GetTypeFromCharacter(keyCode) {
        const charCode = keyCode;
        //TODO: add codes for extended ASCII
        switch (charCode) {
            case 67:
                return ClipboardEventTypes.COPY;
            case 86:
                return ClipboardEventTypes.PASTE;
            case 88:
                return ClipboardEventTypes.CUT;
            default:
                return -1;
        }
    }
}
//# sourceMappingURL=clipboardEvents.js.map

/***/ }),

/***/ 38123:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   b: () => (/* binding */ DeviceInputEventType),
/* harmony export */   s: () => (/* binding */ EventConstants)
/* harmony export */ });
/**
 * Event Types
 */
var DeviceInputEventType;
(function (DeviceInputEventType) {
    // Pointers
    /** PointerMove */
    DeviceInputEventType[DeviceInputEventType["PointerMove"] = 0] = "PointerMove";
    /** PointerDown */
    DeviceInputEventType[DeviceInputEventType["PointerDown"] = 1] = "PointerDown";
    /** PointerUp */
    DeviceInputEventType[DeviceInputEventType["PointerUp"] = 2] = "PointerUp";
})(DeviceInputEventType || (DeviceInputEventType = {}));
/**
 * Constants used for Events
 */
class EventConstants {
}
/**
 * Pixel delta for Wheel Events (Default)
 */
EventConstants.DOM_DELTA_PIXEL = 0x00;
/**
 * Line delta for Wheel Events
 */
EventConstants.DOM_DELTA_LINE = 0x01;
/**
 * Page delta for Wheel Events
 */
EventConstants.DOM_DELTA_PAGE = 0x02;
//# sourceMappingURL=deviceInputEvents.js.map

/***/ }),

/***/ 24146:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Bu: () => (/* binding */ KeyboardInfoPre),
/* harmony export */   TB: () => (/* binding */ KeyboardEventTypes),
/* harmony export */   W0: () => (/* binding */ KeyboardInfo)
/* harmony export */ });
/**
 * Gather the list of keyboard event types as constants.
 */
class KeyboardEventTypes {
}
/**
 * The keydown event is fired when a key becomes active (pressed).
 */
KeyboardEventTypes.KEYDOWN = 0x01;
/**
 * The keyup event is fired when a key has been released.
 */
KeyboardEventTypes.KEYUP = 0x02;
/**
 * This class is used to store keyboard related info for the onKeyboardObservable event.
 */
class KeyboardInfo {
    /**
     * Instantiates a new keyboard info.
     * This class is used to store keyboard related info for the onKeyboardObservable event.
     * @param type Defines the type of event (KeyboardEventTypes)
     * @param event Defines the related dom event
     */
    constructor(
    /**
     * Defines the type of event (KeyboardEventTypes)
     */
    type, 
    /**
     * Defines the related dom event
     */
    event) {
        this.type = type;
        this.event = event;
    }
}
/**
 * This class is used to store keyboard related info for the onPreKeyboardObservable event.
 * Set the skipOnKeyboardObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onKeyboardObservable
 */
class KeyboardInfoPre extends KeyboardInfo {
    /**
     * Defines whether the engine should skip the next onKeyboardObservable associated to this pre.
     * @deprecated use skipOnKeyboardObservable property instead
     */
    get skipOnPointerObservable() {
        return this.skipOnKeyboardObservable;
    }
    set skipOnPointerObservable(value) {
        this.skipOnKeyboardObservable = value;
    }
    /**
     * Instantiates a new keyboard pre info.
     * This class is used to store keyboard related info for the onPreKeyboardObservable event.
     * @param type Defines the type of event (KeyboardEventTypes)
     * @param event Defines the related dom event
     */
    constructor(
    /**
     * Defines the type of event (KeyboardEventTypes)
     */
    type, 
    /**
     * Defines the related dom event
     */
    event) {
        super(type, event);
        this.type = type;
        this.event = event;
        this.skipOnKeyboardObservable = false;
    }
}
//# sourceMappingURL=keyboardEvents.js.map

/***/ }),

/***/ 66240:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Vn: () => (/* binding */ PointerInfoBase),
/* harmony export */   Zp: () => (/* binding */ PointerEventTypes),
/* harmony export */   mx: () => (/* binding */ PointerInfo),
/* harmony export */   tT: () => (/* binding */ PointerInfoPre)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);

/**
 * Gather the list of pointer event types as constants.
 */
class PointerEventTypes {
}
/**
 * The pointerdown event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer.
 */
PointerEventTypes.POINTERDOWN = 0x01;
/**
 * The pointerup event is fired when a pointer is no longer active.
 */
PointerEventTypes.POINTERUP = 0x02;
/**
 * The pointermove event is fired when a pointer changes coordinates.
 */
PointerEventTypes.POINTERMOVE = 0x04;
/**
 * The pointerwheel event is fired when a mouse wheel has been rotated.
 */
PointerEventTypes.POINTERWHEEL = 0x08;
/**
 * The pointerpick event is fired when a mesh or sprite has been picked by the pointer.
 */
PointerEventTypes.POINTERPICK = 0x10;
/**
 * The pointertap event is fired when a the object has been touched and released without drag.
 */
PointerEventTypes.POINTERTAP = 0x20;
/**
 * The pointerdoubletap event is fired when a the object has been touched and released twice without drag.
 */
PointerEventTypes.POINTERDOUBLETAP = 0x40;
/**
 * Base class of pointer info types.
 */
class PointerInfoBase {
    /**
     * Instantiates the base class of pointers info.
     * @param type Defines the type of event (PointerEventTypes)
     * @param event Defines the related dom event
     */
    constructor(
    /**
     * Defines the type of event (PointerEventTypes)
     */
    type, 
    /**
     * Defines the related dom event
     */
    event) {
        this.type = type;
        this.event = event;
    }
}
/**
 * This class is used to store pointer related info for the onPrePointerObservable event.
 * Set the skipOnPointerObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onPointerObservable
 */
class PointerInfoPre extends PointerInfoBase {
    /**
     * Instantiates a PointerInfoPre to store pointer related info to the onPrePointerObservable event.
     * @param type Defines the type of event (PointerEventTypes)
     * @param event Defines the related dom event
     * @param localX Defines the local x coordinates of the pointer when the event occured
     * @param localY Defines the local y coordinates of the pointer when the event occured
     */
    constructor(type, event, localX, localY) {
        super(type, event);
        /**
         * Ray from a pointer if available (eg. 6dof controller)
         */
        this.ray = null;
        /**
         * The original picking info that was used to trigger the pointer event
         */
        this.originalPickingInfo = null;
        this.skipOnPointerObservable = false;
        this.localPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9(localX, localY);
    }
}
/**
 * This type contains all the data related to a pointer event in Babylon.js.
 * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The different event types can be found in the PointerEventTypes class.
 */
class PointerInfo extends PointerInfoBase {
    /**
     * Defines the picking info associated with this PointerInfo object (if applicable)
     */
    get pickInfo() {
        if (!this._pickInfo) {
            this._generatePickInfo();
        }
        return this._pickInfo;
    }
    /**
     * Instantiates a PointerInfo to store pointer related info to the onPointerObservable event.
     * @param type Defines the type of event (PointerEventTypes)
     * @param event Defines the related dom event
     * @param pickInfo Defines the picking info associated to the info (if any)
     * @param inputManager Defines the InputManager to use if there is no pickInfo
     */
    constructor(type, event, pickInfo, inputManager = null) {
        super(type, event);
        this._pickInfo = pickInfo;
        this._inputManager = inputManager;
    }
    /**
     * Generates the picking info if needed
     */
    /** @internal */
    _generatePickInfo() {
        if (this._inputManager) {
            this._pickInfo = this._inputManager._pickMove(this.event);
            this._inputManager._setRayOnPointerInfo(this._pickInfo, this.event);
            this._inputManager = null;
        }
    }
}
//# sourceMappingURL=pointerEvents.js.map

/***/ }),

/***/ 98334:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  IC: () => (/* binding */ FlowGraphAbsBlock),
  eR: () => (/* binding */ FlowGraphAcosBlock),
  c5: () => (/* binding */ FlowGraphAcoshBlock),
  nm: () => (/* binding */ FlowGraphAddBlock),
  P3: () => (/* binding */ FlowGraphAsinBlock),
  dm: () => (/* binding */ FlowGraphAsinhBlock),
  CN: () => (/* binding */ FlowGraphAtan2Block),
  Q6: () => (/* binding */ FlowGraphAtanBlock),
  yq: () => (/* binding */ FlowGraphAtanhBlock),
  EX: () => (/* binding */ FlowGraphBitwiseAndBlock),
  Mq: () => (/* binding */ FlowGraphBitwiseLeftShiftBlock),
  uk: () => (/* binding */ FlowGraphBitwiseNotBlock),
  YT: () => (/* binding */ FlowGraphBitwiseOrBlock),
  xi: () => (/* binding */ FlowGraphBitwiseRightShiftBlock),
  w1: () => (/* binding */ FlowGraphBitwiseXorBlock),
  Bz: () => (/* binding */ FlowGraphCeilBlock),
  FZ: () => (/* binding */ FlowGraphClampBlock),
  fk: () => (/* binding */ FlowGraphCosBlock),
  ro: () => (/* binding */ FlowGraphCoshBlock),
  _I: () => (/* binding */ FlowGraphCountLeadingZerosBlock),
  j: () => (/* binding */ FlowGraphCountOneBitsBlock),
  KJ: () => (/* binding */ FlowGraphCountTrailingZerosBlock),
  M: () => (/* binding */ FlowGraphCrossBlock),
  T2: () => (/* binding */ FlowGraphCubeRootBlock),
  i2: () => (/* binding */ FlowGraphDegToRadBlock),
  Rl: () => (/* binding */ FlowGraphDeterminantBlock),
  VZ: () => (/* binding */ FlowGraphDivideBlock),
  xv: () => (/* binding */ FlowGraphDotBlock),
  nc: () => (/* binding */ FlowGraphEBlock),
  ud: () => (/* binding */ FlowGraphEqBlock),
  B5: () => (/* binding */ FlowGraphExpBlock),
  my: () => (/* binding */ FlowGraphFloorBlock),
  _L: () => (/* binding */ FlowGraphFractBlock),
  Vu: () => (/* binding */ FlowGraphGreaterThanBlock),
  ct: () => (/* binding */ FlowGraphGreaterThanOrEqualBlock),
  vs: () => (/* binding */ FlowGraphInfBlock),
  rY: () => (/* binding */ FlowGraphInterpolateBlock),
  P_: () => (/* binding */ FlowGraphInvertMatrixBlock),
  hH: () => (/* binding */ FlowGraphIsInfBlock),
  JA: () => (/* binding */ FlowGraphIsNanBlock),
  EF: () => (/* binding */ FlowGraphLengthBlock),
  ws: () => (/* binding */ FlowGraphLessThanBlock),
  dq: () => (/* binding */ FlowGraphLessThanOrEqualBlock),
  l9: () => (/* binding */ FlowGraphLog10Block),
  w$: () => (/* binding */ FlowGraphLog2Block),
  uE: () => (/* binding */ FlowGraphLogBlock),
  Ix: () => (/* binding */ FlowGraphMatMulBlock),
  OK: () => (/* binding */ FlowGraphMaxBlock),
  WR: () => (/* binding */ FlowGraphMinBlock),
  yW: () => (/* binding */ FlowGraphMultiplyBlock),
  pg: () => (/* binding */ FlowGraphNaNBlock),
  Oi: () => (/* binding */ FlowGraphNegBlock),
  TK: () => (/* binding */ FlowGraphNormalizeBlock),
  L7: () => (/* binding */ FlowGraphPiBlock),
  sV: () => (/* binding */ FlowGraphPowBlock),
  Qe: () => (/* binding */ FlowGraphRadToDegBlock),
  Je: () => (/* binding */ FlowGraphRandomBlock),
  fG: () => (/* binding */ FlowGraphRemainderBlock),
  z6: () => (/* binding */ FlowGraphRotate2DBlock),
  g1: () => (/* binding */ FlowGraphRotate3DBlock),
  ns: () => (/* binding */ FlowGraphSaturateBlock),
  Fz: () => (/* binding */ FlowGraphSignBlock),
  sR: () => (/* binding */ FlowGraphSinBlock),
  Mk: () => (/* binding */ FlowGraphSinhBlock),
  qJ: () => (/* binding */ FlowGraphSqrtBlock),
  Cu: () => (/* binding */ FlowGraphSubtractBlock),
  Vb: () => (/* binding */ FlowGraphTanBlock),
  Vl: () => (/* binding */ FlowGraphTanhBlock),
  F9: () => (/* binding */ FlowGraphTransposeBlock),
  CM: () => (/* binding */ FlowGraphTruncBlock)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/typeStore.js
var typeStore = __webpack_require__(56552);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphRichTypes.js
var flowGraphRichTypes = __webpack_require__(4720);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js
var flowGraphBinaryOperationBlock = __webpack_require__(77467);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js
var flowGraphCachedOperationBlock = __webpack_require__(94423);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js

/**
 * @experimental
 * Block that outputs a value of type ResultT, resulting of an operation with no inputs.
 */
class FlowGraphConstantOperationBlock extends flowGraphCachedOperationBlock/* FlowGraphCachedOperationBlock */.r {
    constructor(richType, _operation, _className, config) {
        super(richType, config);
        this._operation = _operation;
        this._className = _className;
    }
    /**
     * the operation performed by this block
     * @param _context the graph context
     * @returns the result of the operation
     */
    _doOperation(_context) {
        return this._operation();
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return this._className;
    }
}
//# sourceMappingURL=flowGraphConstantOperationBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__(79923);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js
var flowGraphUnaryOperationBlock = __webpack_require__(63318);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js

/**
 * @experimental
 * The base block for all ternary operation blocks.
 */
class FlowGraphTernaryOperationBlock extends flowGraphCachedOperationBlock/* FlowGraphCachedOperationBlock */.r {
    constructor(t1Type, t2Type, t3Type, resultRichType, _operation, _className, config) {
        super(resultRichType, config);
        this._operation = _operation;
        this._className = _className;
        this.a = this.registerDataInput("a", t1Type);
        this.b = this.registerDataInput("b", t2Type);
        this.c = this.registerDataInput("c", t3Type);
    }
    /**
     * the operation performed by this block
     * @param context the graph context
     * @returns the result of the operation
     */
    _doOperation(context) {
        return this._operation(this.a.getValue(context), this.b.getValue(context), this.c.getValue(context));
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return this._className;
    }
}
//# sourceMappingURL=flowGraphTernaryOperationBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphInteger.js
var flowGraphInteger = __webpack_require__(20033);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js








/**
 * @internal
 */
function _getClassNameOf(v) {
    if (v.getClassName) {
        return v.getClassName();
    }
    return "";
}
/**
 * @internal
 * @returns
 */
function _areSameVectorClass(className, className2) {
    return (className === "Vector2" && className2 === "Vector2") || (className === "Vector3" && className2 === "Vector3") || (className === "Vector4" && className2 === "Vector4");
}
/**
 * @internal
 * @returns
 */
function _areSameMatrixClass(className, className2) {
    return className === "Matrix" && className2 === "Matrix";
}
/**
 * @internal
 * @returns
 */
function _areSameIntegerClass(className, className2) {
    return className === "FlowGraphInteger" && className2 === "FlowGraphInteger";
}
/**
 * @experimental
 * Polymorphic add block.
 */
class FlowGraphAddBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b) => this._polymorphicAdd(a, b), FlowGraphAddBlock.ClassName, config);
    }
    _polymorphicAdd(a, b) {
        const aClassName = _getClassNameOf(a);
        const bClassName = _getClassNameOf(b);
        if (_areSameVectorClass(aClassName, bClassName) || _areSameMatrixClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName)) {
            return a.add(b);
        }
        else {
            return a + b;
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphAddBlock.ClassName = "FGAddBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphAddBlock.ClassName, FlowGraphAddBlock);
/**
 * @experimental
 * Polymorphic add block.
 */
class FlowGraphSubtractBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b) => this._polymorphicAdd(a, b), FlowGraphSubtractBlock.ClassName, config);
    }
    _polymorphicAdd(a, b) {
        const aClassName = _getClassNameOf(a);
        const bClassName = _getClassNameOf(b);
        if (_areSameVectorClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName)) {
            return a.subtract(b);
        }
        else if (_areSameMatrixClass(aClassName, bClassName)) {
            return a.add(b.scale(-1));
        }
        else {
            return a - b;
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphSubtractBlock.ClassName = "FGSubBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphSubtractBlock.ClassName, FlowGraphSubtractBlock);
/**
 * @experimental
 * Polymorphic multiply block.
 * In case of matrix, it is a component wise multiplication.
 */
class FlowGraphMultiplyBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b) => this._polymorphicMultiply(a, b), FlowGraphMultiplyBlock.ClassName, config);
    }
    _polymorphicMultiply(a, b) {
        const aClassName = _getClassNameOf(a);
        const bClassName = _getClassNameOf(b);
        if (_areSameVectorClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName)) {
            return a.multiply(b);
        }
        else if (_areSameMatrixClass(aClassName, bClassName)) {
            return math_vector/* Matrix */.uq.FromValues(a.m[0] * b.m[0], a.m[4] * b.m[4], a.m[8] * b.m[8], a.m[12] * b.m[12], a.m[1] * b.m[1], a.m[5] * b.m[5], a.m[9] * b.m[9], a.m[13] * b.m[13], a.m[2] * b.m[2], a.m[6] * b.m[6], a.m[10] * b.m[10], a.m[14] * b.m[14], a.m[3] * b.m[3], a.m[7] * b.m[7], a.m[11] * b.m[11], a.m[15] * b.m[15]);
        }
        else {
            return a * b;
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphMultiplyBlock.ClassName = "FGMultiplyBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphMultiplyBlock.ClassName, FlowGraphMultiplyBlock);
/**
 * @experimental
 * Polymorphic division block.
 */
class FlowGraphDivideBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b) => this._polymorphicDivide(a, b), FlowGraphDivideBlock.ClassName, config);
    }
    _polymorphicDivide(a, b) {
        const aClassName = _getClassNameOf(a);
        const bClassName = _getClassNameOf(b);
        if (_areSameVectorClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName)) {
            return a.divide(b);
        }
        else if (_areSameMatrixClass(aClassName, bClassName)) {
            return math_vector/* Matrix */.uq.FromValues(a.m[0] / b.m[0], a.m[4] / b.m[4], a.m[8] / b.m[8], a.m[12] / b.m[12], a.m[1] / b.m[1], a.m[5] / b.m[5], a.m[9] / b.m[9], a.m[13] / b.m[13], a.m[2] / b.m[2], a.m[6] / b.m[6], a.m[10] / b.m[10], a.m[14] / b.m[14], a.m[3] / b.m[3], a.m[7] / b.m[7], a.m[11] / b.m[11], a.m[15] / b.m[15]);
        }
        else {
            return a / b;
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphDivideBlock.ClassName = "FGDivideBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphDivideBlock.ClassName, FlowGraphDivideBlock);
/**
 * @experimental
 * Random number between 0 and 1.
 */
class FlowGraphRandomBlock extends FlowGraphConstantOperationBlock {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeNumber */.Es, () => Math.random(), FlowGraphRandomBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphRandomBlock.ClassName = "FGRandomBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphRandomBlock.ClassName, FlowGraphRandomBlock);
/**
 * @experimental
 * Dot product block.
 */
class FlowGraphDotBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a, b) => this._polymorphicDot(a, b), FlowGraphDotBlock.ClassName, config);
    }
    _polymorphicDot(a, b) {
        const className = _getClassNameOf(a);
        switch (className) {
            case "Vector2":
                return math_vector/* Vector2 */.I9.Dot(a, b);
            case "Vector3":
                return math_vector/* Vector3 */.Pq.Dot(a, b);
            case "Vector4":
                return math_vector/* Vector4 */.IU.Dot(a, b);
            default:
                throw new Error(`Cannot get dot product of ${a} and ${b}`);
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphDotBlock.ClassName = "FGDotBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphDotBlock.ClassName, FlowGraphDotBlock);
/**
 * @experimental
 * E constant.
 */
class FlowGraphEBlock extends FlowGraphConstantOperationBlock {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeNumber */.Es, () => Math.E, FlowGraphEBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphEBlock.ClassName = "FGEBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphEBlock.ClassName, FlowGraphEBlock);
/**
 * @experimental
 * Pi constant.
 */
class FlowGraphPiBlock extends FlowGraphConstantOperationBlock {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeNumber */.Es, () => Math.PI, FlowGraphPiBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphPiBlock.ClassName = "FGPIBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphPiBlock.ClassName, FlowGraphPiBlock);
/**
 * @experimental
 * Positive inf constant.
 */
class FlowGraphInfBlock extends FlowGraphConstantOperationBlock {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeNumber */.Es, () => Number.POSITIVE_INFINITY, FlowGraphInfBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphInfBlock.ClassName = "FGInfBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphInfBlock.ClassName, FlowGraphInfBlock);
/**
 * @experimental
 * NaN constant.
 */
class FlowGraphNaNBlock extends FlowGraphConstantOperationBlock {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeNumber */.Es, () => Number.NaN, FlowGraphNaNBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphNaNBlock.ClassName = "FGNaNBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphNaNBlock.ClassName, FlowGraphNaNBlock);
function _componentWiseUnaryOperation(a, op) {
    const aClassName = _getClassNameOf(a);
    switch (aClassName) {
        case "FlowGraphInteger":
            return new flowGraphInteger/* FlowGraphInteger */.P(op(a.value));
        case "Vector2":
            return new math_vector/* Vector2 */.I9(op(a.x), op(a.y));
        case "Vector3":
            return new math_vector/* Vector3 */.Pq(op(a.x), op(a.y), op(a.z));
        case "Vector4":
            return new math_vector/* Vector4 */.IU(op(a.x), op(a.y), op(a.z), op(a.w));
        case "Matrix":
            return math_vector/* Matrix */.uq.FromValues(op(a.m[0]), op(a.m[4]), op(a.m[8]), op(a.m[12]), op(a.m[1]), op(a.m[5]), op(a.m[9]), op(a.m[13]), op(a.m[2]), op(a.m[6]), op(a.m[10]), op(a.m[14]), op(a.m[3]), op(a.m[7]), op(a.m[11]), op(a.m[15]));
        default:
            return op(a);
    }
}
/**
 * @experimental
 * Absolute value block.
 */
class FlowGraphAbsBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicAbs(a), FlowGraphAbsBlock.ClassName, config);
    }
    _polymorphicAbs(a) {
        return _componentWiseUnaryOperation(a, Math.abs);
    }
}
/**
 * the class name of the block.
 */
FlowGraphAbsBlock.ClassName = "FGAbsBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphAbsBlock.ClassName, FlowGraphAbsBlock);
/**
 * @experimental
 * Sign block.
 */
class FlowGraphSignBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicSign(a), FlowGraphSignBlock.ClassName, config);
    }
    _polymorphicSign(a) {
        return _componentWiseUnaryOperation(a, Math.sign);
    }
}
/**
 * the class name of the block.
 */
FlowGraphSignBlock.ClassName = "FGSignBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphSignBlock.ClassName, FlowGraphSignBlock);
/**
 * @experimental
 * Truncation block.
 */
class FlowGraphTruncBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicTrunc(a), FlowGraphTruncBlock.ClassName, config);
    }
    _polymorphicTrunc(a) {
        return _componentWiseUnaryOperation(a, Math.trunc);
    }
}
/**
 * the class name of the block.
 */
FlowGraphTruncBlock.ClassName = "FGTruncBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphTruncBlock.ClassName, FlowGraphTruncBlock);
/**
 * @experimental
 * Floor block.
 */
class FlowGraphFloorBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicFloor(a), FlowGraphFloorBlock.ClassName, config);
    }
    _polymorphicFloor(a) {
        return _componentWiseUnaryOperation(a, Math.floor);
    }
}
/**
 * the class name of the block.
 */
FlowGraphFloorBlock.ClassName = "FGFloorBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphFloorBlock.ClassName, FlowGraphFloorBlock);
/**
 * @experimental
 * Ceiling block.
 */
class FlowGraphCeilBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicCeiling(a), FlowGraphCeilBlock.ClassName, config);
    }
    _polymorphicCeiling(a) {
        return _componentWiseUnaryOperation(a, Math.ceil);
    }
}
/**
 * the class name of the block.
 */
FlowGraphCeilBlock.ClassName = "FGCeilBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphCeilBlock.ClassName, FlowGraphCeilBlock);
/**
 * @experimental
 * Fract block.
 */
class FlowGraphFractBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicFract(a), FlowGraphFractBlock.ClassName, config);
    }
    _polymorphicFract(a) {
        return _componentWiseUnaryOperation(a, (a) => a - Math.floor(a));
    }
}
/**
 * the class name of the block.
 */
FlowGraphFractBlock.ClassName = "FGFractBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphFractBlock.ClassName, FlowGraphFractBlock);
/**
 * @experimental
 * Negation block.
 */
class FlowGraphNegBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    /**
     * construct a new negation block.
     * @param config optional configuration
     */
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicNeg(a), FlowGraphNegBlock.ClassName, config);
    }
    _polymorphicNeg(a) {
        return _componentWiseUnaryOperation(a, (a) => -a);
    }
}
/**
 * the class name of the block.
 */
FlowGraphNegBlock.ClassName = "FGNegBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphNegBlock.ClassName, FlowGraphNegBlock);
function _componentWiseBinaryOperation(a, b, op) {
    const aClassName = _getClassNameOf(a);
    switch (aClassName) {
        case "FlowGraphInteger":
            return new flowGraphInteger/* FlowGraphInteger */.P(op(a.value, b.value));
        case "Vector2":
            return new math_vector/* Vector2 */.I9(op(a.x, b.x), op(a.y, b.y));
        case "Vector3":
            return new math_vector/* Vector3 */.Pq(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));
        case "Vector4":
            return new math_vector/* Vector4 */.IU(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));
        case "Matrix":
            return math_vector/* Matrix */.uq.FromValues(op(a.m[0], b.m[0]), op(a.m[4], b.m[4]), op(a.m[8], b.m[8]), op(a.m[12], b.m[12]), op(a.m[1], b.m[1]), op(a.m[5], b.m[5]), op(a.m[9], b.m[9]), op(a.m[13], b.m[13]), op(a.m[2], b.m[2]), op(a.m[6], b.m[6]), op(a.m[10], b.m[10]), op(a.m[14], b.m[14]), op(a.m[3], b.m[3]), op(a.m[7], b.m[7]), op(a.m[11], b.m[11]), op(a.m[15], b.m[15]));
        default:
            return op(a, b);
    }
}
/**
 * @experimental
 * Remainder block.
 */
class FlowGraphRemainderBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b) => this._polymorphicRemainder(a, b), FlowGraphRemainderBlock.ClassName, config);
    }
    _polymorphicRemainder(a, b) {
        return _componentWiseBinaryOperation(a, b, (a, b) => a % b);
    }
}
/**
 * the class name of the block.
 */
FlowGraphRemainderBlock.ClassName = "FGRemainderBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphRemainderBlock.ClassName, FlowGraphRemainderBlock);
/**
 * @experimental
 * Min block.
 */
class FlowGraphMinBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b) => this._polymorphicMin(a, b), FlowGraphMinBlock.ClassName, config);
    }
    _polymorphicMin(a, b) {
        return _componentWiseBinaryOperation(a, b, Math.min);
    }
}
/**
 * the class name of the block.
 */
FlowGraphMinBlock.ClassName = "FGMinBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphMinBlock.ClassName, FlowGraphMinBlock);
/**
 * @experimental
 * Max block
 */
class FlowGraphMaxBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b) => this._polymorphicMax(a, b), FlowGraphMaxBlock.ClassName, config);
    }
    _polymorphicMax(a, b) {
        return _componentWiseBinaryOperation(a, b, Math.max);
    }
}
/**
 * the class name of the block.
 */
FlowGraphMaxBlock.ClassName = "FGMaxBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphMaxBlock.ClassName, FlowGraphMaxBlock);
function _clamp(a, b, c) {
    return Math.min(Math.max(a, Math.min(b, c)), Math.max(b, c));
}
function _componentWiseTernaryOperation(a, b, c, op) {
    const aClassName = _getClassNameOf(a);
    switch (aClassName) {
        case "FlowGraphInteger":
            return new flowGraphInteger/* FlowGraphInteger */.P(op(a.value, b.value, c.value));
        case "Vector2":
            return new math_vector/* Vector2 */.I9(op(a.x, b.x, c.x), op(a.y, b.y, c.y));
        case "Vector3":
            return new math_vector/* Vector3 */.Pq(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z));
        case "Vector4":
            return new math_vector/* Vector4 */.IU(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z), op(a.w, b.w, c.w));
        case "Matrix":
            return math_vector/* Matrix */.uq.FromValues(op(a.m[0], b.m[0], c.m[0]), op(a.m[4], b.m[4], c.m[4]), op(a.m[8], b.m[8], c.m[8]), op(a.m[12], b.m[12], c.m[12]), op(a.m[1], b.m[1], c.m[1]), op(a.m[5], b.m[5], c.m[5]), op(a.m[9], b.m[9], c.m[9]), op(a.m[13], b.m[13], c.m[13]), op(a.m[2], b.m[2], c.m[2]), op(a.m[6], b.m[6], c.m[6]), op(a.m[10], b.m[10], c.m[10]), op(a.m[14], b.m[14], c.m[14]), op(a.m[3], b.m[3], c.m[3]), op(a.m[7], b.m[7], c.m[7]), op(a.m[11], b.m[11], c.m[11]), op(a.m[15], b.m[15], c.m[15]));
        default:
            return op(a, b, c);
    }
}
/**
 * @experimental
 * Clamp block.
 */
class FlowGraphClampBlock extends FlowGraphTernaryOperationBlock {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b, c) => this._polymorphicClamp(a, b, c), FlowGraphClampBlock.ClassName, config);
    }
    _polymorphicClamp(a, b, c) {
        return _componentWiseTernaryOperation(a, b, c, _clamp);
    }
}
/**
 * the class name of the block.
 */
FlowGraphClampBlock.ClassName = "FGClampBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphClampBlock.ClassName, FlowGraphClampBlock);
function _saturate(a) {
    return Math.min(Math.max(a, 0), 1);
}
/**
 * @experimental
 * Saturate block.
 */
class FlowGraphSaturateBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicSaturate(a), FlowGraphSaturateBlock.ClassName, config);
    }
    _polymorphicSaturate(a) {
        return _componentWiseUnaryOperation(a, _saturate);
    }
}
/**
 * the class name of the block.
 */
FlowGraphSaturateBlock.ClassName = "FGSaturateBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphSaturateBlock.ClassName, FlowGraphSaturateBlock);
/**
 * @experimental
 * Interpolate block.
 */
class FlowGraphInterpolateBlock extends FlowGraphTernaryOperationBlock {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b, c) => this._polymorphicInterpolate(a, b, c), FlowGraphInterpolateBlock.ClassName, config);
    }
    _interpolate(a, b, c) {
        return (1 - c) * a + c * b;
    }
    _polymorphicInterpolate(a, b, c) {
        return _componentWiseTernaryOperation(a, b, c, this._interpolate);
    }
}
/**
 * the class name of the block.
 */
FlowGraphInterpolateBlock.ClassName = "FGInterpolateBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphInterpolateBlock.ClassName, FlowGraphInterpolateBlock);
/**
 * @experimental
 * Equals block.
 */
class FlowGraphEqBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeBoolean */.RI, (a, b) => this._polymorphicEq(a, b), FlowGraphEqBlock.ClassName, config);
    }
    _polymorphicEq(a, b) {
        const aClassName = _getClassNameOf(a);
        const bClassName = _getClassNameOf(b);
        if (_areSameVectorClass(aClassName, bClassName) || _areSameMatrixClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName)) {
            return a.equals(b);
        }
        else {
            return a === b;
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphEqBlock.ClassName = "FGEqBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphEqBlock.ClassName, FlowGraphEqBlock);
function _comparisonOperators(a, b, op) {
    const aClassName = _getClassNameOf(a);
    const bClassName = _getClassNameOf(b);
    if (aClassName === bClassName) {
        // float
        if (aClassName === "") {
            return op(a, b);
        }
        else if (aClassName === "FlowGraphInteger") {
            return op(a.value, b.value);
        }
        else {
            throw new Error(`Cannot compare ${a} and ${b}`);
        }
    }
    throw new Error(`${a} and ${b} are of different types.`);
}
/**
 * @experimental
 * Less than block.
 */
class FlowGraphLessThanBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeBoolean */.RI, (a, b) => this._polymorphicLessThan(a, b), FlowGraphLessThanBlock.ClassName, config);
    }
    _polymorphicLessThan(a, b) {
        return _comparisonOperators(a, b, (a, b) => a < b);
    }
}
/**
 * the class name of the block.
 */
FlowGraphLessThanBlock.ClassName = "FGLessThanBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphLessThanBlock.ClassName, FlowGraphLessThanBlock);
/**
 * @experimental
 * Less than or equal block.
 */
class FlowGraphLessThanOrEqualBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeBoolean */.RI, (a, b) => this._polymorphicLessThanOrEqual(a, b), FlowGraphLessThanOrEqualBlock.ClassName, config);
    }
    _polymorphicLessThanOrEqual(a, b) {
        return _comparisonOperators(a, b, (a, b) => a <= b);
    }
}
/**
 * the class name of the block.
 */
FlowGraphLessThanOrEqualBlock.ClassName = "FGLessThanOrEqualBlock";
/**
 * @experimental
 * Greater than block.
 */
class FlowGraphGreaterThanBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeBoolean */.RI, (a, b) => this._polymorphicGreaterThan(a, b), FlowGraphGreaterThanBlock.ClassName, config);
    }
    _polymorphicGreaterThan(a, b) {
        return _comparisonOperators(a, b, (a, b) => a > b);
    }
}
/**
 * the class name of the block.
 */
FlowGraphGreaterThanBlock.ClassName = "FGGreaterThanBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphGreaterThanBlock.ClassName, FlowGraphGreaterThanBlock);
/**
 * @experimental
 * Greater than or equal block.
 */
class FlowGraphGreaterThanOrEqualBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeBoolean */.RI, (a, b) => this._polymorphicGreaterThanOrEqual(a, b), FlowGraphGreaterThanOrEqualBlock.ClassName, config);
    }
    _polymorphicGreaterThanOrEqual(a, b) {
        return _comparisonOperators(a, b, (a, b) => a >= b);
    }
}
/**
 * the class name of the block.
 */
FlowGraphGreaterThanOrEqualBlock.ClassName = "FGGreaterThanOrEqualBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphGreaterThanOrEqualBlock.ClassName, FlowGraphGreaterThanOrEqualBlock);
/**
 * @experimental
 * Is NaN block.
 */
class FlowGraphIsNanBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeBoolean */.RI, (a) => this._polymorphicIsNan(a), FlowGraphIsNanBlock.ClassName, config);
    }
    _polymorphicIsNan(a) {
        const aClassName = _getClassNameOf(a);
        if (aClassName === "") {
            return isNaN(a);
        }
        else if (aClassName === "FlowGraphInteger") {
            return isNaN(a.value);
        }
        else {
            throw new Error(`Cannot get NaN of ${a}`);
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphIsNanBlock.ClassName = "FGIsNanBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphIsNanBlock.ClassName, FlowGraphIsNanBlock);
/**
 * @experimental
 * Is Inf block.
 */
class FlowGraphIsInfBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeBoolean */.RI, (a) => this._polymorphicIsInf(a), FlowGraphIsInfBlock.ClassName, config);
    }
    _polymorphicIsInf(a) {
        const aClassName = _getClassNameOf(a);
        if (aClassName === "") {
            return !isFinite(a);
        }
        else if (aClassName === "FlowGraphInteger") {
            return !isFinite(a.value);
        }
        else {
            throw new Error(`Cannot get isInf of ${a}`);
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphIsInfBlock.ClassName = "FGIsInfBlock";
/**
 * @experimental
 * Convert degrees to radians block.
 */
class FlowGraphDegToRadBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicDegToRad(a), FlowGraphDegToRadBlock.ClassName, config);
    }
    _degToRad(a) {
        return (a * Math.PI) / 180;
    }
    _polymorphicDegToRad(a) {
        return _componentWiseUnaryOperation(a, this._degToRad);
    }
}
/**
 * the class name of the block.
 */
FlowGraphDegToRadBlock.ClassName = "FGDegToRadBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphDegToRadBlock.ClassName, FlowGraphDegToRadBlock);
/**
 * @experimental
 * Convert radians to degrees block.
 */
class FlowGraphRadToDegBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicRadToDeg(a), FlowGraphRadToDegBlock.ClassName, config);
    }
    _radToDeg(a) {
        return (a * 180) / Math.PI;
    }
    _polymorphicRadToDeg(a) {
        return _componentWiseUnaryOperation(a, this._radToDeg);
    }
}
/**
 * the class name of the block.
 */
FlowGraphRadToDegBlock.ClassName = "FGRadToDegBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphRadToDegBlock.ClassName, FlowGraphRadToDegBlock);
/**
 * @experimental
 * Sin block.
 */
class FlowGraphSinBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicSin(a), FlowGraphSinBlock.ClassName, config);
    }
    _polymorphicSin(a) {
        return _componentWiseUnaryOperation(a, Math.sin);
    }
}
/**
 * the class name of the block.
 */
FlowGraphSinBlock.ClassName = "FGSinBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphSinBlock.ClassName, FlowGraphSinBlock);
/**
 * @experimental
 * Cos block.
 */
class FlowGraphCosBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicCos(a), FlowGraphCosBlock.ClassName, config);
    }
    _polymorphicCos(a) {
        return _componentWiseUnaryOperation(a, Math.cos);
    }
}
/**
 * the class name of the block.
 */
FlowGraphCosBlock.ClassName = "FGCosBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphCosBlock.ClassName, FlowGraphCosBlock);
/**
 * @experimental
 * Tan block.
 */
class FlowGraphTanBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicTan(a), FlowGraphTanBlock.ClassName, config);
    }
    _polymorphicTan(a) {
        return _componentWiseUnaryOperation(a, Math.tan);
    }
}
/**
 * the class name of the block.
 */
FlowGraphTanBlock.ClassName = "FGTanBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphTanBlock.ClassName, FlowGraphTanBlock);
/**
 * @experimental
 * Arcsin block.
 */
class FlowGraphAsinBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicAsin(a), FlowGraphAsinBlock.ClassName, config);
    }
    _polymorphicAsin(a) {
        return _componentWiseUnaryOperation(a, Math.asin);
    }
}
/**
 * the class name of the block.
 */
FlowGraphAsinBlock.ClassName = "FGAsinBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphAsinBlock.ClassName, FlowGraphAsinBlock);
/**
 * @experimental
 * Arccos block.
 */
class FlowGraphAcosBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicAcos(a), FlowGraphAcosBlock.ClassName, config);
    }
    _polymorphicAcos(a) {
        return _componentWiseUnaryOperation(a, Math.acos);
    }
}
/**
 * the class name of the block.
 */
FlowGraphAcosBlock.ClassName = "FGAcosBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphAcosBlock.ClassName, FlowGraphAcosBlock);
/**
 * @experimental
 * Arctan block.
 */
class FlowGraphAtanBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicAtan(a), FlowGraphAtanBlock.ClassName, config);
    }
    _polymorphicAtan(a) {
        return _componentWiseUnaryOperation(a, Math.atan);
    }
}
/**
 * the class name of the block.
 */
FlowGraphAtanBlock.ClassName = "FGAtanBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphAtanBlock.ClassName, FlowGraphAtanBlock);
/**
 * @experimental
 * Arctan2 block.
 */
class FlowGraphAtan2Block extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a, b) => this._polymorphicAtan2(a, b), FlowGraphAtan2Block.ClassName, config);
    }
    _polymorphicAtan2(a, b) {
        return _componentWiseBinaryOperation(a, b, Math.atan2);
    }
}
/**
 * the class name of the block.
 */
FlowGraphAtan2Block.ClassName = "FGAtan2Block";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphAtan2Block.ClassName, FlowGraphAtan2Block);
/**
 * @experimental
 * Hyperbolic sin block.
 */
class FlowGraphSinhBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicSinh(a), FlowGraphSinhBlock.ClassName, config);
    }
    _polymorphicSinh(a) {
        return _componentWiseUnaryOperation(a, Math.sinh);
    }
}
/**
 * the class name of the block.
 */
FlowGraphSinhBlock.ClassName = "FGSinhBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphSinhBlock.ClassName, FlowGraphSinhBlock);
/**
 * @experimental
 * Hyperbolic cos block.
 */
class FlowGraphCoshBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicCosh(a), FlowGraphCoshBlock.ClassName, config);
    }
    _polymorphicCosh(a) {
        return _componentWiseUnaryOperation(a, Math.cosh);
    }
}
/**
 * the class name of the block.
 */
FlowGraphCoshBlock.ClassName = "FGCoshBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphCoshBlock.ClassName, FlowGraphCoshBlock);
/**
 * @experimental
 * Hyperbolic tan block.
 */
class FlowGraphTanhBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicTanh(a), FlowGraphTanhBlock.ClassName, config);
    }
    _polymorphicTanh(a) {
        return _componentWiseUnaryOperation(a, Math.tanh);
    }
}
/**
 * the class name of the block.
 */
FlowGraphTanhBlock.ClassName = "FGTanhBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphTanhBlock.ClassName, FlowGraphTanhBlock);
/**
 * @experimental
 * Hyperbolic arcsin block.
 */
class FlowGraphAsinhBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicAsinh(a), FlowGraphAsinhBlock.ClassName, config);
    }
    _polymorphicAsinh(a) {
        return _componentWiseUnaryOperation(a, Math.asinh);
    }
}
/**
 * the class name of the block.
 */
FlowGraphAsinhBlock.ClassName = "FGAsinhBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphAsinhBlock.ClassName, FlowGraphAsinhBlock);
/**
 * @experimental
 * Hyperbolic arccos block.
 */
class FlowGraphAcoshBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicAcosh(a), FlowGraphAcoshBlock.ClassName, config);
    }
    _polymorphicAcosh(a) {
        return _componentWiseUnaryOperation(a, Math.acosh);
    }
}
/**
 * the class name of the block.
 */
FlowGraphAcoshBlock.ClassName = "FGAcoshBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphAcoshBlock.ClassName, FlowGraphAcoshBlock);
/**
 * @experimental
 * Hyperbolic arctan block.
 */
class FlowGraphAtanhBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicAtanh(a), FlowGraphAtanhBlock.ClassName, config);
    }
    _polymorphicAtanh(a) {
        return _componentWiseUnaryOperation(a, Math.atanh);
    }
}
/**
 * the class name of the block.
 */
FlowGraphAtanhBlock.ClassName = "FGAtanhBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphAtanhBlock.ClassName, FlowGraphAtanhBlock);
/**
 * @experimental
 * Exponential block.
 */
class FlowGraphExpBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicExp(a), FlowGraphExpBlock.ClassName, config);
    }
    _polymorphicExp(a) {
        return _componentWiseUnaryOperation(a, Math.exp);
    }
}
/**
 * the class name of the block.
 */
FlowGraphExpBlock.ClassName = "FGExpBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphExpBlock.ClassName, FlowGraphExpBlock);
/**
 * @experimental
 * Logarithm block.
 */
class FlowGraphLogBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicLog(a), FlowGraphLogBlock.ClassName, config);
    }
    _polymorphicLog(a) {
        return _componentWiseUnaryOperation(a, Math.log);
    }
}
/**
 * the class name of the block.
 */
FlowGraphLogBlock.ClassName = "FGLogBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphLogBlock.ClassName, FlowGraphLogBlock);
/**
 * @experimental
 * Base 2 logarithm block.
 */
class FlowGraphLog2Block extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicLog2(a), FlowGraphLog2Block.ClassName, config);
    }
    _polymorphicLog2(a) {
        return _componentWiseUnaryOperation(a, Math.log2);
    }
}
/**
 * the class name of the block.
 */
FlowGraphLog2Block.ClassName = "FGLog2Block";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphLog2Block.ClassName, FlowGraphLog2Block);
/**
 * @experimental
 * Base 10 logarithm block.
 */
class FlowGraphLog10Block extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicLog10(a), FlowGraphLog10Block.ClassName, config);
    }
    _polymorphicLog10(a) {
        return _componentWiseUnaryOperation(a, Math.log10);
    }
}
/**
 * the class name of the block.
 */
FlowGraphLog10Block.ClassName = "FGLog10Block";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphLog10Block.ClassName, FlowGraphLog10Block);
/**
 * @experimental
 * Square root block.
 */
class FlowGraphSqrtBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicSqrt(a), FlowGraphSqrtBlock.ClassName, config);
    }
    _polymorphicSqrt(a) {
        return _componentWiseUnaryOperation(a, Math.sqrt);
    }
}
/**
 * the class name of the block.
 */
FlowGraphSqrtBlock.ClassName = "FGSqrtBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphSqrtBlock.ClassName, FlowGraphSqrtBlock);
/**
 * @experimental
 * Cube root block.
 */
class FlowGraphCubeRootBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicCubeRoot(a), FlowGraphCubeRootBlock.ClassName, config);
    }
    _polymorphicCubeRoot(a) {
        return _componentWiseUnaryOperation(a, Math.cbrt);
    }
}
/**
 * the class name of the block.
 */
FlowGraphCubeRootBlock.ClassName = "FGCubeRootBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphCubeRootBlock.ClassName, FlowGraphCubeRootBlock);
/**
 * @experimental
 * Power block.
 */
class FlowGraphPowBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, flowGraphRichTypes/* RichTypeNumber */.Es, (a, b) => this._polymorphicPow(a, b), FlowGraphPowBlock.ClassName, config);
    }
    _polymorphicPow(a, b) {
        return _componentWiseBinaryOperation(a, b, Math.pow);
    }
}
/**
 * the class name of the block.
 */
FlowGraphPowBlock.ClassName = "FGPowBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphPowBlock.ClassName, FlowGraphPowBlock);
/**
 * @experimental
 * Vector length block.
 */
class FlowGraphLengthBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => this._polymorphicLength(a), FlowGraphLengthBlock.ClassName, config);
    }
    _polymorphicLength(a) {
        const aClassName = _getClassNameOf(a);
        switch (aClassName) {
            case "Vector2":
            case "Vector3":
            case "Vector4":
                return a.length();
            default:
                throw new Error(`Cannot compute length of value ${a}`);
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphLengthBlock.ClassName = "FGLengthBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphLengthBlock.ClassName, FlowGraphLengthBlock);
/**
 * @experimental
 * Vector normalize block.
 */
class FlowGraphNormalizeBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeAny */.Vv, flowGraphRichTypes/* RichTypeAny */.Vv, (a) => this._polymorphicNormalize(a), FlowGraphNormalizeBlock.ClassName, config);
    }
    _polymorphicNormalize(a) {
        const aClassName = _getClassNameOf(a);
        switch (aClassName) {
            case "Vector2":
            case "Vector3":
            case "Vector4":
                return a.normalize();
            default:
                throw new Error(`Cannot normalize value ${a}`);
        }
    }
}
/**
 * the class name of the block.
 */
FlowGraphNormalizeBlock.ClassName = "FGNormalizeBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphNormalizeBlock.ClassName, FlowGraphNormalizeBlock);
/**
 * @experimental
 * Cross product block.
 */
class FlowGraphCrossBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeVector3 */.Dx, flowGraphRichTypes/* RichTypeVector3 */.Dx, flowGraphRichTypes/* RichTypeVector3 */.Dx, (a, b) => math_vector/* Vector3 */.Pq.Cross(a, b), FlowGraphCrossBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphCrossBlock.ClassName = "FGCrossBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphCrossBlock.ClassName, FlowGraphCrossBlock);
/**
 * @experimental
 * 2D rotation block.
 */
class FlowGraphRotate2DBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeVector2 */.K$, flowGraphRichTypes/* RichTypeNumber */.Es, flowGraphRichTypes/* RichTypeVector2 */.K$, (a, b) => math_vector/* Vector2 */.I9.Transform(a, math_vector/* Matrix */.uq.RotationZ(b)), FlowGraphRotate2DBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphRotate2DBlock.ClassName = "FGRotate2DBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphRotate2DBlock.ClassName, FlowGraphRotate2DBlock);
/**
 * @experimental
 * 3D rotation block.
 */
class FlowGraphRotate3DBlock extends FlowGraphTernaryOperationBlock {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeVector3 */.Dx, flowGraphRichTypes/* RichTypeVector3 */.Dx, flowGraphRichTypes/* RichTypeNumber */.Es, flowGraphRichTypes/* RichTypeVector3 */.Dx, (a, b, c) => math_vector/* Vector3 */.Pq.TransformCoordinates(a, math_vector/* Matrix */.uq.RotationAxis(b, c)), FlowGraphRotate3DBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphRotate3DBlock.ClassName = "FGRotate3DBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphRotate3DBlock.ClassName, FlowGraphRotate3DBlock);
/**
 * @experimental
 * Transposes a matrix.
 */
class FlowGraphTransposeBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeMatrix */.Sp, flowGraphRichTypes/* RichTypeMatrix */.Sp, (a) => math_vector/* Matrix */.uq.Transpose(a), FlowGraphTransposeBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphTransposeBlock.ClassName = "FGTransposeBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphTransposeBlock.ClassName, FlowGraphTransposeBlock);
/**
 * @experimental
 * Gets the determinant of a matrix.
 */
class FlowGraphDeterminantBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeMatrix */.Sp, flowGraphRichTypes/* RichTypeNumber */.Es, (a) => a.determinant(), FlowGraphDeterminantBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphDeterminantBlock.ClassName = "FGDeterminantBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphDeterminantBlock.ClassName, FlowGraphDeterminantBlock);
/**
 * @experimental
 * Inverts a matrix.
 */
class FlowGraphInvertMatrixBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeMatrix */.Sp, flowGraphRichTypes/* RichTypeMatrix */.Sp, (a) => math_vector/* Matrix */.uq.Invert(a), FlowGraphInvertMatrixBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphInvertMatrixBlock.ClassName = "FGInvertMatrixBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphInvertMatrixBlock.ClassName, FlowGraphInvertMatrixBlock);
/**
 * @experimental
 * Multiplies two matrices.
 */
class FlowGraphMatMulBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeMatrix */.Sp, flowGraphRichTypes/* RichTypeMatrix */.Sp, flowGraphRichTypes/* RichTypeMatrix */.Sp, (a, b) => b.multiply(a), FlowGraphMatMulBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphMatMulBlock.ClassName = "FGMatMulBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphMatMulBlock.ClassName, FlowGraphMatMulBlock);
/**
 * @experimental
 * Bitwise NOT operation
 */
class FlowGraphBitwiseNotBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, (a) => new flowGraphInteger/* FlowGraphInteger */.P(~a.value), FlowGraphBitwiseNotBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphBitwiseNotBlock.ClassName = "FGBitwiseNotBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphBitwiseNotBlock.ClassName, FlowGraphBitwiseNotBlock);
/**
 * @experimental
 * Bitwise AND operation
 */
class FlowGraphBitwiseAndBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, (a, b) => new flowGraphInteger/* FlowGraphInteger */.P(a.value & b.value), FlowGraphBitwiseAndBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphBitwiseAndBlock.ClassName = "FGBitwiseAndBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphBitwiseAndBlock.ClassName, FlowGraphBitwiseAndBlock);
/**
 * @experimental
 * Bitwise OR operation
 */
class FlowGraphBitwiseOrBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, (a, b) => new flowGraphInteger/* FlowGraphInteger */.P(a.value | b.value), FlowGraphBitwiseOrBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphBitwiseOrBlock.ClassName = "FGBitwiseOrBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphBitwiseOrBlock.ClassName, FlowGraphBitwiseOrBlock);
/**
 * @experimental
 * Bitwise XOR operation
 */
class FlowGraphBitwiseXorBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, (a, b) => new flowGraphInteger/* FlowGraphInteger */.P(a.value ^ b.value), FlowGraphBitwiseXorBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphBitwiseXorBlock.ClassName = "FGBitwiseXorBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphBitwiseXorBlock.ClassName, FlowGraphBitwiseXorBlock);
/**
 * @experimental
 * Bitwise left shift operation
 */
class FlowGraphBitwiseLeftShiftBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, (a, b) => new flowGraphInteger/* FlowGraphInteger */.P(a.value << b.value), FlowGraphBitwiseLeftShiftBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphBitwiseLeftShiftBlock.ClassName = "FGBitwiseLeftShiftBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphBitwiseLeftShiftBlock.ClassName, FlowGraphBitwiseLeftShiftBlock);
/**
 * @experimental
 * Bitwise right shift operation
 */
class FlowGraphBitwiseRightShiftBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, (a, b) => new flowGraphInteger/* FlowGraphInteger */.P(a.value >> b.value), FlowGraphBitwiseRightShiftBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphBitwiseRightShiftBlock.ClassName = "FGBitwiseRightShiftBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphBitwiseRightShiftBlock.ClassName, FlowGraphBitwiseRightShiftBlock);
/**
 * @experimental
 * Count leading zeros operation
 */
class FlowGraphCountLeadingZerosBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, (a) => new flowGraphInteger/* FlowGraphInteger */.P(Math.clz32(a.value)), FlowGraphCountLeadingZerosBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphCountLeadingZerosBlock.ClassName = "FGCountLeadingZerosBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphCountLeadingZerosBlock.ClassName, FlowGraphCountLeadingZerosBlock);
/**
 * @experimental
 * Count trailing zeros operation
 */
class FlowGraphCountTrailingZerosBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, (a) => new flowGraphInteger/* FlowGraphInteger */.P(a.value ? 31 - Math.clz32(a.value & -a.value) : 32), FlowGraphCountTrailingZerosBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphCountTrailingZerosBlock.ClassName = "FGCountTrailingZerosBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphCountTrailingZerosBlock.ClassName, FlowGraphCountTrailingZerosBlock);
/**
 * Given a number (which is converted to a 32-bit integer), return the
 * number of bits set to one on that number.
 * @internal
 * @param n
 */
function _countOnes(n) {
    let result = 0;
    while (n) {
        // This zeroes out all bits except for the least significant one.
        // So if the bit is set, it will be 1, otherwise it will be 0.
        result += n & 1;
        // This shifts n's bits to the right by one
        n >>= 1;
    }
    return result;
}
/**
 * @experimental
 * Count one bits operation
 */
class FlowGraphCountOneBitsBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2, (a) => new flowGraphInteger/* FlowGraphInteger */.P(_countOnes(a.value)), FlowGraphCountOneBitsBlock.ClassName, config);
    }
}
/**
 * the class name of the block.
 */
FlowGraphCountOneBitsBlock.ClassName = "FGCountOneBitsBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphCountOneBitsBlock.ClassName, FlowGraphCountOneBitsBlock);
//# sourceMappingURL=flowGraphMathBlocks.js.map

/***/ }),

/***/ 77467:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   W: () => (/* binding */ FlowGraphBinaryOperationBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphCachedOperationBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94423);

/**
 * @experimental
 * The base block for all binary operation blocks. Receives an input of type
 * LeftT, one of type RightT, and outputs a value of type ResultT.
 */
class FlowGraphBinaryOperationBlock extends _flowGraphCachedOperationBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphCachedOperationBlock */ .r {
    constructor(leftRichType, rightRichType, resultRichType, _operation, _className, config) {
        super(resultRichType, config);
        this._operation = _operation;
        this._className = _className;
        this.a = this.registerDataInput("a", leftRichType);
        this.b = this.registerDataInput("b", rightRichType);
    }
    /**
     * the operation performed by this block
     * @param context the graph context
     * @returns the result of the operation
     */
    _doOperation(context) {
        return this._operation(this.a.getValue(context), this.b.getValue(context));
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return this._className;
    }
}
//# sourceMappingURL=flowGraphBinaryOperationBlock.js.map

/***/ }),

/***/ 94423:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   r: () => (/* binding */ FlowGraphCachedOperationBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71294);

const cacheName = "cachedOperationValue";
const cacheExecIdName = "cachedExecutionId";
/**
 * @experimental
 */
class FlowGraphCachedOperationBlock extends _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphBlock */ .e {
    constructor(outputRichType, config) {
        super(config);
        this.value = this.registerDataOutput("value", outputRichType);
    }
    _updateOutputs(context) {
        const cachedExecutionId = context._getExecutionVariable(this, cacheExecIdName);
        const cachedValue = context._getExecutionVariable(this, cacheName);
        if (cachedValue !== undefined && cachedExecutionId === context.executionId) {
            this.value.setValue(cachedValue, context);
        }
        else {
            const calculatedValue = this._doOperation(context);
            context._setExecutionVariable(this, cacheName, calculatedValue);
            context._setExecutionVariable(this, cacheExecIdName, context.executionId);
            this.value.setValue(calculatedValue, context);
        }
    }
}
//# sourceMappingURL=flowGraphCachedOperationBlock.js.map

/***/ }),

/***/ 98285:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   v: () => (/* binding */ FlowGraphGetPropertyBlock)
/* harmony export */ });
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56552);
/* harmony import */ var _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71294);
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4720);
/* harmony import */ var _flowGraphPathConverterComponent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92579);




/**
 * @experimental
 */
class FlowGraphGetPropertyBlock extends _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphBlock */ .e {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        this.value = this.registerDataOutput("value", _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_2__/* .RichTypeAny */ .Vv);
        this.templateComponent = new _flowGraphPathConverterComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .FlowGraphPathConverterComponent */ .H(config.path, this);
    }
    _updateOutputs(context) {
        const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);
        const value = accessorContainer.info.get(accessorContainer.object);
        this.value.setValue(value, context);
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return FlowGraphGetPropertyBlock.ClassName;
    }
    /**
     * Serializes this block
     * @param serializationObject the object to serialize to
     */
    serialize(serializationObject = {}) {
        super.serialize(serializationObject);
        serializationObject.config.path = this.config.path;
    }
}
/**
 * Class name of the block.
 */
FlowGraphGetPropertyBlock.ClassName = "FGGetPropertyBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_0__/* .RegisterClass */ .Y5)(FlowGraphGetPropertyBlock.ClassName, FlowGraphGetPropertyBlock);
//# sourceMappingURL=flowGraphGetPropertyBlock.js.map

/***/ }),

/***/ 50926:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   g: () => (/* binding */ FlowGraphGetVariableBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71294);
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4720);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56552);



/**
 * A block that gets the value of a variable.
 * @experimental
 */
class FlowGraphGetVariableBlock extends _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphBlock */ .e {
    /**
     * Construct a FlowGraphGetVariableBlock.
     * @param config construction parameters
     */
    constructor(config) {
        super(config);
        this.config = config;
        // The output connection has to have the name of the variable.
        this.output = this.registerDataOutput(config.variableName, _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_1__/* .RichTypeAny */ .Vv);
    }
    /**
     * @internal
     */
    _updateOutputs(context) {
        const variableNameValue = this.config.variableName;
        if (context.hasVariable(variableNameValue)) {
            this.output.setValue(context.getVariable(variableNameValue), context);
        }
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return FlowGraphGetVariableBlock.ClassName;
    }
    /**
     * Serializes this block
     * @param serializationObject the object to serialize to
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.config.variableName = this.config.variableName;
    }
}
/**
 * Class name of the block.
 */
FlowGraphGetVariableBlock.ClassName = "FGGetVariableBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)(FlowGraphGetVariableBlock.ClassName, FlowGraphGetVariableBlock);
//# sourceMappingURL=flowGraphGetVariableBlock.js.map

/***/ }),

/***/ 63318:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   a: () => (/* binding */ FlowGraphUnaryOperationBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphCachedOperationBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94423);

/**
 * @experimental
 * The base block for all unary operation blocks. Receives an input of type InputT, and outputs a value of type ResultT.
 */
class FlowGraphUnaryOperationBlock extends _flowGraphCachedOperationBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphCachedOperationBlock */ .r {
    constructor(inputRichType, resultRichType, _operation, _className, config) {
        super(resultRichType, config);
        this._operation = _operation;
        this._className = _className;
        this.a = this.registerDataInput("a", inputRichType);
    }
    /**
     * the operation performed by this block
     * @param context the graph context
     * @returns the result of the operation
     */
    _doOperation(context) {
        return this._operation(this.a.getValue(context));
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return this._className;
    }
}
//# sourceMappingURL=flowGraphUnaryOperationBlock.js.map

/***/ }),

/***/ 72536:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   i: () => (/* binding */ FlowGraphMeshPickEventBlock)
/* harmony export */ });
/* harmony import */ var _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35985);
/* harmony import */ var _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22086);
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66240);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56552);
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4686);





/**
 * @experimental
 * A block that activates when a mesh is picked.
 */
class FlowGraphMeshPickEventBlock extends _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphEventBlock */ .i {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
    }
    _getReferencedMesh() {
        const iAccessor = this.config.pathConverter.convert(this.config.path);
        const mesh = iAccessor.info.getObject(iAccessor.object);
        if (!mesh || !(mesh instanceof _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractMesh */ .u)) {
            throw new Error("Mesh pick event block requires a valid mesh");
        }
        return mesh;
    }
    /**
     * @internal
     */
    _preparePendingTasks(context) {
        let pickObserver = context._getExecutionVariable(this, "meshPickObserver");
        if (!pickObserver) {
            const mesh = this._getReferencedMesh();
            context._setExecutionVariable(this, "mesh", mesh);
            pickObserver = mesh.getScene().onPointerObservable.add((pointerInfo) => {
                if (pointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERPICK &&
                    pointerInfo.pickInfo?.pickedMesh &&
                    (pointerInfo.pickInfo?.pickedMesh === mesh || (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__/* ._isADescendantOf */ .r)(pointerInfo.pickInfo?.pickedMesh, mesh))) {
                    this._execute(context);
                }
            });
            const disposeObserver = mesh.onDisposeObservable.add(() => this._onDispose);
            context._setExecutionVariable(this, "meshPickObserver", pickObserver);
            context._setExecutionVariable(this, "meshDisposeObserver", disposeObserver);
        }
    }
    _onDispose(context) {
        this._cancelPendingTasks(context);
        context._removePendingBlock(this);
    }
    /**
     * @internal
     */
    _cancelPendingTasks(context) {
        const mesh = context._getExecutionVariable(this, "mesh");
        const pickObserver = context._getExecutionVariable(this, "meshPickObserver");
        const disposeObserver = context._getExecutionVariable(this, "meshDisposeObserver");
        mesh.getScene().onPointerObservable.remove(pickObserver);
        mesh.onDisposeObservable.remove(disposeObserver);
        context._deleteExecutionVariable(this, "mesh");
        context._deleteExecutionVariable(this, "meshPickObserver");
        context._deleteExecutionVariable(this, "meshDisposeObserver");
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphMeshPickEventBlock.ClassName;
    }
    /**
     * Serializes the block to a JSON object.
     * @param serializationObject the object to serialize to.
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.config.path = this.config.path;
    }
}
/**
 * Class name of the block.
 */
FlowGraphMeshPickEventBlock.ClassName = "FGMeshPickEventBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .Y5)(FlowGraphMeshPickEventBlock.ClassName, FlowGraphMeshPickEventBlock);
//# sourceMappingURL=flowGraphMeshPickEventBlock.js.map

/***/ }),

/***/ 33314:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   W: () => (/* binding */ FlowGraphReceiveCustomEventBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22086);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(998);
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4720);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56552);




/**
 * @experimental
 * A block that receives a custom event. It saves the data sent in the eventData output.
 */
class FlowGraphReceiveCustomEventBlock extends _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphEventBlock */ .i {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        for (let i = 0; i < this.config.eventData.length; i++) {
            const dataName = this.config.eventData[i];
            this.registerDataOutput(dataName, _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_2__/* .RichTypeAny */ .Vv);
        }
    }
    _preparePendingTasks(context) {
        const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);
        this._eventObserver = observable.add((eventDatas) => {
            for (let i = 0; i < eventDatas.length; i++) {
                this.dataOutputs[i].setValue(eventDatas[i], context);
            }
            this._execute(context);
        });
    }
    _cancelPendingTasks(context) {
        const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);
        if (observable) {
            observable.remove(this._eventObserver);
        }
        else {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this.config.eventId}`);
        }
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphReceiveCustomEventBlock.ClassName;
    }
    /**
     * Serializes this block
     * @param serializationObject the object to serialize to
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.eventId = this.config.eventId;
        serializationObject.eventData = this.config.eventData;
    }
}
/**
 * the class name of the block.
 */
FlowGraphReceiveCustomEventBlock.ClassName = "FGReceiveCustomEventBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_3__/* .RegisterClass */ .Y5)(FlowGraphReceiveCustomEventBlock.ClassName, FlowGraphReceiveCustomEventBlock);
//# sourceMappingURL=flowGraphReceiveCustomEventBlock.js.map

/***/ }),

/***/ 15583:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   b: () => (/* binding */ FlowGraphSceneReadyEventBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22086);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56552);


/**
 * @experimental
 * Block that triggers when a scene is ready.
 */
class FlowGraphSceneReadyEventBlock extends _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphEventBlock */ .i {
    /**
     * @internal
     */
    _preparePendingTasks(context) {
        if (!context._getExecutionVariable(this, "sceneReadyObserver")) {
            const scene = context.configuration.scene;
            const contextObserver = scene.onReadyObservable.add(() => {
                this._execute(context);
            });
            context._setExecutionVariable(this, "sceneReadyObserver", contextObserver);
        }
    }
    /**
     * @internal
     */
    _cancelPendingTasks(context) {
        const contextObserver = context._getExecutionVariable(this, "sceneReadyObserver");
        const scene = context.configuration.scene;
        scene.onReadyObservable.remove(contextObserver);
        context._deleteExecutionVariable(this, "sceneReadyObserver");
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphSceneReadyEventBlock.ClassName;
    }
}
/**
 * the class name of the block.
 */
FlowGraphSceneReadyEventBlock.ClassName = "FGSceneReadyEventBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__/* .RegisterClass */ .Y5)("FGSceneReadyEventBlock", FlowGraphSceneReadyEventBlock);
//# sourceMappingURL=flowGraphSceneReadyEventBlock.js.map

/***/ }),

/***/ 69569:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ FlowGraphSceneTickEventBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22086);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56552);


/**
 * @experimental
 * Block that triggers on scene tick (before each render).
 */
class FlowGraphSceneTickEventBlock extends _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphEventBlock */ .i {
    /**
     * @internal
     */
    _preparePendingTasks(context) {
        if (!context._getExecutionVariable(this, "sceneBeforeRender")) {
            const scene = context.configuration.scene;
            const contextObserver = scene.onBeforeRenderObservable.add(() => {
                this._execute(context);
            });
            context._setExecutionVariable(this, "sceneBeforeRender", contextObserver);
        }
    }
    /**
     * @internal
     */
    _cancelPendingTasks(context) {
        const contextObserver = context._getExecutionVariable(this, "sceneBeforeRender");
        const scene = context.configuration.scene;
        scene.onBeforeRenderObservable.remove(contextObserver);
        context._deleteExecutionVariable(this, "sceneBeforeRender");
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphSceneTickEventBlock.ClassName;
    }
}
/**
 * the class name of the block.
 */
FlowGraphSceneTickEventBlock.ClassName = "FGSceneTickEventBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__/* .RegisterClass */ .Y5)(FlowGraphSceneTickEventBlock.ClassName, FlowGraphSceneTickEventBlock);
//# sourceMappingURL=flowGraphSceneTickEventBlock.js.map

/***/ }),

/***/ 84679:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   V: () => (/* binding */ FlowGraphDoNBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4720);
/* harmony import */ var _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33006);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56552);
/* harmony import */ var _flowGraphInteger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20033);




/**
 * A block that executes a branch a set number of times.
 * @experimental
 */
class FlowGraphDoNBlock extends _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphExecutionBlockWithOutSignal */ .w {
    constructor(
    /**
     * [Object] the configuration of the block
     */
    config = { startIndex: new _flowGraphInteger_js__WEBPACK_IMPORTED_MODULE_3__/* .FlowGraphInteger */ .P(0) }) {
        super(config);
        this.config = config;
        this.reset = this._registerSignalInput("reset");
        this.n = this.registerDataInput("n", _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__/* .RichTypeFlowGraphInteger */ .x2);
        this.value = this.registerDataOutput("value", _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__/* .RichTypeFlowGraphInteger */ .x2);
    }
    _execute(context, callingSignal) {
        if (callingSignal === this.reset) {
            this.value.setValue(this.config.startIndex, context);
        }
        else {
            const currentCountValue = this.value.getValue(context);
            if (currentCountValue.value < this.n.getValue(context).value) {
                this.value.setValue(new _flowGraphInteger_js__WEBPACK_IMPORTED_MODULE_3__/* .FlowGraphInteger */ .P(currentCountValue.value + 1), context);
                this.out._activateSignal(context);
            }
        }
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphDoNBlock.ClassName;
    }
}
/**
 * the class name of the block.
 */
FlowGraphDoNBlock.ClassName = "FGDoNBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)(FlowGraphDoNBlock.ClassName, FlowGraphDoNBlock);
//# sourceMappingURL=flowGraphDoNBlock.js.map

/***/ }),

/***/ 78855:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   v: () => (/* binding */ FlowGraphSequenceBlock)
/* harmony export */ });
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56552);
/* harmony import */ var _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16972);


/**
 * @experimental
 * A block that executes its output flows in sequence.
 */
class FlowGraphSequenceBlock extends _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphExecutionBlock */ .u {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        this.outFlows = [];
        for (let i = 0; i < this.config.numberOutputFlows; i++) {
            this.outFlows.push(this._registerSignalOutput(`${i}`));
        }
    }
    _execute(context) {
        for (let i = 0; i < this.config.numberOutputFlows; i++) {
            this.outFlows[i]._activateSignal(context);
        }
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphSequenceBlock.ClassName;
    }
}
/**
 * the class name of the block.
 */
FlowGraphSequenceBlock.ClassName = "FGSequenceBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_0__/* .RegisterClass */ .Y5)(FlowGraphSequenceBlock.ClassName, FlowGraphSequenceBlock);
//# sourceMappingURL=flowGraphSequenceBlock.js.map

/***/ }),

/***/ 91263:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ FlowGraphTimerBlock)
/* harmony export */ });
/* harmony import */ var _Misc_timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20472);
/* harmony import */ var _flowGraphAsyncExecutionBlock_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51000);
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4720);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(998);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56552);





/**
 * @experimental
 * Block that provides two different output flows. One is started immediately once the block is executed,
 * and the other is executed after a set time. The timer for this block runs based on the scene's render loop.
 */
class FlowGraphTimerBlock extends _flowGraphAsyncExecutionBlock_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphAsyncExecutionBlock */ .M {
    constructor(config) {
        super(config);
        this.timeout = this.registerDataInput("timeout", _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_2__/* .RichTypeNumber */ .Es);
    }
    _preparePendingTasks(context) {
        const currentTimeout = this.timeout.getValue(context);
        if (currentTimeout !== undefined && currentTimeout >= 0) {
            const timers = context._getExecutionVariable(this, "runningTimers") || [];
            const scene = context.configuration.scene;
            const timer = new _Misc_timer_js__WEBPACK_IMPORTED_MODULE_0__/* .AdvancedTimer */ .Qz({
                timeout: currentTimeout,
                contextObservable: scene.onBeforeRenderObservable,
                onEnded: () => this._onEnded(timer, context),
            });
            timer.start();
            timers.push(timer);
            context._setExecutionVariable(this, "runningTimers", timers);
        }
    }
    /**
     * @internal
     */
    _execute(context) {
        this._startPendingTasks(context);
        this.out._activateSignal(context);
    }
    _onEnded(timer, context) {
        const timers = context._getExecutionVariable(this, "runningTimers") || [];
        const index = timers.indexOf(timer);
        if (index !== -1) {
            timers.splice(index, 1);
        }
        else {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools */ .S0.Warn("FlowGraphTimerBlock: Timer ended but was not found in the running timers list");
        }
        context._removePendingBlock(this);
        this.done._activateSignal(context);
    }
    _cancelPendingTasks(context) {
        const timers = context._getExecutionVariable(this, "runningTimers") || [];
        for (const timer of timers) {
            timer.dispose();
        }
        context._deleteExecutionVariable(this, "runningTimers");
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphTimerBlock.ClassName;
    }
}
/**
 * the class name of the block.
 */
FlowGraphTimerBlock.ClassName = "FGTimerBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_4__/* .RegisterClass */ .Y5)("FGTimerBlock", FlowGraphTimerBlock);
//# sourceMappingURL=flowGraphTimerBlock.js.map

/***/ }),

/***/ 87593:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   J: () => (/* binding */ FlowGraphWhileLoopBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4720);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56552);
/* harmony import */ var _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33006);



/**
 * @experimental
 * A block that executes a branch while a condition is true.
 */
class FlowGraphWhileLoopBlock extends _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_2__/* .FlowGraphExecutionBlockWithOutSignal */ .w {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        this.condition = this.registerDataInput("condition", _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__/* .RichTypeBoolean */ .RI);
        this.loopBody = this._registerSignalOutput("loopBody");
    }
    _execute(context, _callingSignal) {
        let conditionValue = this.condition.getValue(context);
        if (this.config?.isDo && !conditionValue) {
            this.loopBody._activateSignal(context);
        }
        while (conditionValue) {
            this.loopBody._activateSignal(context);
            conditionValue = this.condition.getValue(context);
        }
        this.out._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphWhileLoopBlock.ClassName;
    }
    /**
     * Serializes the block to a JSON object.
     * @param serializationObject the object to serialize to.
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.isDo = this.config?.isDo;
    }
}
/**
 * the class name of the block.
 */
FlowGraphWhileLoopBlock.ClassName = "FGWhileLoopBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__/* .RegisterClass */ .Y5)(FlowGraphWhileLoopBlock.ClassName, FlowGraphWhileLoopBlock);
//# sourceMappingURL=flowGraphWhileLoopBlock.js.map

/***/ }),

/***/ 59693:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ FlowGraphConsoleLogBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33006);
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4720);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56552);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51137);




/**
 * @experimental
 * Block that logs a message to the console.
 */
class FlowGraphConsoleLogBlock extends _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphExecutionBlockWithOutSignal */ .w {
    constructor(config) {
        super(config);
        this.message = this.registerDataInput("message", _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_1__/* .RichTypeAny */ .Vv);
    }
    /**
     * @internal
     */
    _execute(context) {
        const messageValue = this.message.getValue(context);
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Log(messageValue);
        // activate the output flow block
        this.out._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphConsoleLogBlock.ClassName;
    }
}
/**
 * the class name of the block.
 */
FlowGraphConsoleLogBlock.ClassName = "FGConsoleLogBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)(FlowGraphConsoleLogBlock.ClassName, FlowGraphConsoleLogBlock);
//# sourceMappingURL=flowGraphConsoleLogBlock.js.map

/***/ }),

/***/ 74015:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   z: () => (/* binding */ FlowGraphSendCustomEventBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4720);
/* harmony import */ var _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33006);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56552);



/**
 * @experimental
 */
class FlowGraphSendCustomEventBlock extends _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphExecutionBlockWithOutSignal */ .w {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        for (let i = 0; i < this.config.eventData.length; i++) {
            const dataName = this.config.eventData[i];
            this.registerDataInput(dataName, _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__/* .RichTypeAny */ .Vv);
        }
    }
    _execute(context) {
        const eventId = this.config.eventId;
        const eventDatas = this.dataInputs.map((port) => port.getValue(context));
        context.configuration.coordinator.notifyCustomEvent(eventId, eventDatas);
        this.out._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphSendCustomEventBlock.ClassName;
    }
}
/**
 * the class name of the block.
 */
FlowGraphSendCustomEventBlock.ClassName = "FGSendCustomEventBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)("FGSendCustomEventBlock", FlowGraphSendCustomEventBlock);
//# sourceMappingURL=flowGraphSendCustomEventBlock.js.map

/***/ }),

/***/ 481:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   L: () => (/* binding */ FlowGraphSetPropertyBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4720);
/* harmony import */ var _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33006);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56552);
/* harmony import */ var _flowGraphPathConverterComponent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(92579);




/**
 * @experimental
 * Block that sets a property on a target object.
 */
class FlowGraphSetPropertyBlock extends _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphExecutionBlockWithOutSignal */ .w {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        this.a = this.registerDataInput("a", _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__/* .RichTypeAny */ .Vv);
        this.templateComponent = new _flowGraphPathConverterComponent_js__WEBPACK_IMPORTED_MODULE_3__/* .FlowGraphPathConverterComponent */ .H(config.path, this);
    }
    _execute(context) {
        const value = this.a.getValue(context);
        const accessor = this.templateComponent.getAccessor(this.config.pathConverter, context);
        accessor.info.set(value, accessor.object);
        this.out._activateSignal(context);
    }
    /**
     * Serializes the block to a JSON object.
     * @param serializationObject the object to serialize to.
     */
    serialize(serializationObject = {}) {
        super.serialize(serializationObject);
        serializationObject.config.path = this.config.path;
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphSetPropertyBlock.ClassName;
    }
}
/**
 * Class name of the block.
 */
FlowGraphSetPropertyBlock.ClassName = "FGSetPropertyBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)("FGSetPropertyBlock", FlowGraphSetPropertyBlock);
//# sourceMappingURL=flowGraphSetPropertyBlock.js.map

/***/ }),

/***/ 15682:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   U: () => (/* binding */ FlowGraphSetVariableBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4720);
/* harmony import */ var _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33006);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56552);



/**
 * Block to set a variable.
 * @experimental
 */
class FlowGraphSetVariableBlock extends _flowGraphExecutionBlockWithOutSignal_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphExecutionBlockWithOutSignal */ .w {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        this.input = this.registerDataInput(config.variableName, _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__/* .RichTypeAny */ .Vv);
    }
    _execute(context) {
        const variableNameValue = this.config.variableName;
        const inputValue = this.input.getValue(context);
        context.setVariable(variableNameValue, inputValue);
        this.out._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphSetVariableBlock.ClassName;
    }
}
/**
 * the class name of the block.
 */
FlowGraphSetVariableBlock.ClassName = "FGSetVariableBlock";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)(FlowGraphSetVariableBlock.ClassName, FlowGraphSetVariableBlock);
//# sourceMappingURL=flowGraphSetVariableBlock.js.map

/***/ }),

/***/ 10243:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $: () => (/* binding */ FlowGraph),
/* harmony export */   I: () => (/* binding */ FlowGraphState)
/* harmony export */ });
/* harmony import */ var _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22086);
/* harmony import */ var _flowGraphContext_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5788);
/* harmony import */ var _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71294);
/* harmony import */ var _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16972);
/* harmony import */ var _Blocks_Event_flowGraphMeshPickEventBlock_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(72536);
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4686);
/* harmony import */ var _serialization_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(339);







var FlowGraphState;
(function (FlowGraphState) {
    /**
     * The graph is stopped
     */
    FlowGraphState[FlowGraphState["Stopped"] = 0] = "Stopped";
    /**
     * The graph is running
     */
    FlowGraphState[FlowGraphState["Started"] = 1] = "Started";
})(FlowGraphState || (FlowGraphState = {}));
/**
 * @experimental
 * Class used to represent a flow graph.
 * A flow graph is a graph of blocks that can be used to create complex logic.
 * Blocks can be added to the graph and connected to each other.
 * The graph can then be started, which will init and start all of its event blocks.
 */
class FlowGraph {
    /**
     * Construct a Flow Graph
     * @param params construction parameters. currently only the scene
     */
    constructor(params) {
        /** @internal */
        this._eventBlocks = [];
        this._executionContexts = [];
        /**
         * The state of the graph
         */
        this.state = 0 /* FlowGraphState.Stopped */;
        this._scene = params.scene;
        this._coordinator = params.coordinator;
        this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => this.dispose());
    }
    /**
     * Create a context. A context represents one self contained execution for the graph, with its own variables.
     * @returns the context, where you can get and set variables
     */
    createContext() {
        const context = new _flowGraphContext_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphContext */ .Y({ scene: this._scene, coordinator: this._coordinator });
        this._executionContexts.push(context);
        return context;
    }
    /**
     * Returns the execution context at a given index
     * @param index the index of the context
     * @returns the execution context at that index
     */
    getContext(index) {
        return this._executionContexts[index];
    }
    /**
     * Add an event block. When the graph is started, it will start listening to events
     * from the block and execute the graph when they are triggered.
     * @param block the event block to be added
     */
    addEventBlock(block) {
        this._eventBlocks.push(block);
    }
    /**
     * Starts the flow graph. Initializes the event blocks and starts listening to events.
     */
    start() {
        if (this.state === 1 /* FlowGraphState.Started */) {
            return;
        }
        this.state = 1 /* FlowGraphState.Started */;
        if (this._executionContexts.length === 0) {
            this.createContext();
        }
        for (const context of this._executionContexts) {
            const contextualOrder = this._getContextualOrder();
            for (const block of contextualOrder) {
                block._startPendingTasks(context);
            }
        }
    }
    _getContextualOrder() {
        const order = [];
        for (const block1 of this._eventBlocks) {
            // If the block is a mesh pick, guarantee that picks of children meshes come before picks of parent meshes
            if (block1.getClassName() === _Blocks_Event_flowGraphMeshPickEventBlock_js__WEBPACK_IMPORTED_MODULE_4__/* .FlowGraphMeshPickEventBlock */ .i.ClassName) {
                const mesh1 = block1._getReferencedMesh();
                let i = 0;
                for (; i < order.length; i++) {
                    const block2 = order[i];
                    const mesh2 = block2._getReferencedMesh();
                    if (mesh1 && mesh2 && (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__/* ._isADescendantOf */ .r)(mesh1, mesh2)) {
                        break;
                    }
                }
                order.splice(i, 0, block1);
            }
            else {
                order.push(block1);
            }
        }
        return order;
    }
    /**
     * Disposes of the flow graph. Cancels any pending tasks and removes all event listeners.
     */
    dispose() {
        if (this.state === 0 /* FlowGraphState.Stopped */) {
            return;
        }
        this.state = 0 /* FlowGraphState.Stopped */;
        for (const context of this._executionContexts) {
            context._clearPendingBlocks();
        }
        this._executionContexts.length = 0;
        this._eventBlocks.length = 0;
        this._scene.onDisposeObservable.remove(this._sceneDisposeObserver);
        this._sceneDisposeObserver = null;
    }
    /**
     * Executes a function in all blocks of a flow graph, starting with the event blocks.
     * @param visitor the function to execute.
     */
    visitAllBlocks(visitor) {
        const visitList = [];
        const idsAddedToVisitList = new Set();
        for (const block of this._eventBlocks) {
            visitList.push(block);
            idsAddedToVisitList.add(block.uniqueId);
        }
        while (visitList.length > 0) {
            const block = visitList.pop();
            visitor(block);
            for (const dataIn of block.dataInputs) {
                for (const connection of dataIn._connectedPoint) {
                    if (!idsAddedToVisitList.has(connection._ownerBlock.uniqueId)) {
                        visitList.push(connection._ownerBlock);
                        idsAddedToVisitList.add(connection._ownerBlock.uniqueId);
                    }
                }
            }
            if (block instanceof _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_3__/* .FlowGraphExecutionBlock */ .u) {
                for (const signalOut of block.signalOutputs) {
                    for (const connection of signalOut._connectedPoint) {
                        if (!idsAddedToVisitList.has(connection._ownerBlock.uniqueId)) {
                            visitList.push(connection._ownerBlock);
                            idsAddedToVisitList.add(connection._ownerBlock.uniqueId);
                        }
                    }
                }
            }
        }
    }
    /**
     * Serializes a graph
     * @param serializationObject the object to write the values in
     * @param valueSerializeFunction a function to serialize complex values
     */
    serialize(serializationObject = {}, valueSerializeFunction) {
        serializationObject.allBlocks = [];
        this.visitAllBlocks((block) => {
            const serializedBlock = {};
            block.serialize(serializedBlock);
            serializationObject.allBlocks.push(serializedBlock);
        });
        serializationObject.executionContexts = [];
        for (const context of this._executionContexts) {
            const serializedContext = {};
            context.serialize(serializedContext, valueSerializeFunction);
            serializationObject.executionContexts.push(serializedContext);
        }
    }
    /**
     * Given a list of blocks, find an output data connection that has a specific unique id
     * @param blocks a list of flow graph blocks
     * @param uniqueId the unique id of a connection
     * @returns the connection that has this unique id. throws an error if none was found
     */
    static GetDataOutConnectionByUniqueId(blocks, uniqueId) {
        for (const block of blocks) {
            for (const dataOut of block.dataOutputs) {
                if (dataOut.uniqueId === uniqueId) {
                    return dataOut;
                }
            }
        }
        throw new Error("Could not find data out connection with unique id " + uniqueId);
    }
    /**
     * Given a list of blocks, find an input signal connection that has a specific unique id
     * @param blocks a list of flow graph blocks
     * @param uniqueId the unique id of a connection
     * @returns the connection that has this unique id. throws an error if none was found
     */
    static GetSignalInConnectionByUniqueId(blocks, uniqueId) {
        for (const block of blocks) {
            if (block instanceof _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_3__/* .FlowGraphExecutionBlock */ .u) {
                for (const signalIn of block.signalInputs) {
                    if (signalIn.uniqueId === uniqueId) {
                        return signalIn;
                    }
                }
            }
        }
        throw new Error("Could not find signal in connection with unique id " + uniqueId);
    }
    /**
     * Parses a graph from a given serialization object
     * @param serializationObject the object where the values are written
     * @param options options for parsing the graph
     * @returns the parsed graph
     */
    static Parse(serializationObject, options) {
        const graph = options.coordinator.createGraph();
        const blocks = [];
        const valueParseFunction = options.valueParseFunction ?? _serialization_js__WEBPACK_IMPORTED_MODULE_6__/* .defaultValueParseFunction */ .wk;
        // Parse all blocks
        for (const serializedBlock of serializationObject.allBlocks) {
            const block = _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_2__/* .FlowGraphBlock */ .e.Parse(serializedBlock, { scene: options.coordinator.config.scene, pathConverter: options.pathConverter, valueParseFunction });
            blocks.push(block);
            if (block instanceof _flowGraphEventBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphEventBlock */ .i) {
                graph.addEventBlock(block);
            }
        }
        // After parsing all blocks, connect them
        for (const block of blocks) {
            for (const dataIn of block.dataInputs) {
                for (const serializedConnection of dataIn.connectedPointIds) {
                    const connection = FlowGraph.GetDataOutConnectionByUniqueId(blocks, serializedConnection);
                    dataIn.connectTo(connection);
                }
            }
            if (block instanceof _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_3__/* .FlowGraphExecutionBlock */ .u) {
                for (const signalOut of block.signalOutputs) {
                    for (const serializedConnection of signalOut.connectedPointIds) {
                        const connection = FlowGraph.GetSignalInConnectionByUniqueId(blocks, serializedConnection);
                        signalOut.connectTo(connection);
                    }
                }
            }
        }
        for (const serializedContext of serializationObject.executionContexts) {
            _flowGraphContext_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphContext */ .Y.Parse(serializedContext, { graph, valueParseFunction });
        }
        return graph;
    }
}
//# sourceMappingURL=flowGraph.js.map

/***/ }),

/***/ 51000:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   M: () => (/* binding */ FlowGraphAsyncExecutionBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16972);

/**
 * An async execution block can start tasks that will be executed asynchronously.
 * It should also be responsible for clearing it in _cancelPendingTasks.
 * @experimental
 */
class FlowGraphAsyncExecutionBlock extends _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphExecutionBlock */ .u {
    constructor(config) {
        super(config);
        this.out = this._registerSignalOutput("out");
        this.done = this._registerSignalOutput("done");
    }
    /**
     * @internal
     * @param context
     */
    _startPendingTasks(context) {
        this._preparePendingTasks(context);
        context._addPendingBlock(this);
    }
}
//# sourceMappingURL=flowGraphAsyncExecutionBlock.js.map

/***/ }),

/***/ 71294:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   e: () => (/* binding */ FlowGraphBlock)
/* harmony export */ });
/* harmony import */ var _Misc_guid_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38688);
/* harmony import */ var _flowGraphDataConnection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60707);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(998);
/* harmony import */ var _serialization_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(339);




/**
 * @experimental
 * A block in a flow graph. The most basic form
 * of a block has inputs and outputs that contain
 * data.
 */
class FlowGraphBlock {
    /** Constructor is protected so only subclasses can be instantiated
     * @param config optional configuration for this block
     */
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        this.config = config;
        /**
         * A randomly generated GUID for each block.
         */
        this.uniqueId = (0,_Misc_guid_js__WEBPACK_IMPORTED_MODULE_0__/* .RandomGUID */ .z)();
        this.name = this.config?.name ?? this.getClassName();
        this.dataInputs = [];
        this.dataOutputs = [];
    }
    /**
     * @internal
     */
    _updateOutputs(_context) {
        // empty by default, overriden in data blocks
    }
    /**
     * Registers a data input on the block.
     * @param name the name of the input
     * @param richType the type of the input
     * @returns the created connection
     */
    registerDataInput(name, richType) {
        const input = new _flowGraphDataConnection_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphDataConnection */ .l(name, 0 /* FlowGraphConnectionType.Input */, this, richType);
        this.dataInputs.push(input);
        return input;
    }
    /**
     * Registers a data output on the block.
     * @param name the name of the input
     * @param richType the type of the input
     * @returns the created connection
     */
    registerDataOutput(name, richType) {
        const output = new _flowGraphDataConnection_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphDataConnection */ .l(name, 1 /* FlowGraphConnectionType.Output */, this, richType);
        this.dataOutputs.push(output);
        return output;
    }
    /**
     * Given the name of a data input, returns the connection if it exists
     * @param name the name of the input
     * @returns the connection if it exists, undefined otherwise
     */
    getDataInput(name) {
        return this.dataInputs.find((i) => i.name === name);
    }
    /**
     * Given the name of a data output, returns the connection if it exists
     * @param name the name of the output
     * @returns the connection if it exists, undefined otherwise
     */
    getDataOutput(name) {
        return this.dataOutputs.find((i) => i.name === name);
    }
    /**
     * Serializes this block
     * @param serializationObject the object to serialize to
     * @param _valueSerializeFunction a function that serializes a specific value
     */
    serialize(serializationObject = {}, _valueSerializeFunction = _serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .defaultValueSerializationFunction */ .X5) {
        serializationObject.uniqueId = this.uniqueId;
        serializationObject.config = {};
        if (this.config) {
            serializationObject.config["name"] = this.config.name;
        }
        serializationObject.dataInputs = [];
        serializationObject.dataOutputs = [];
        serializationObject.className = this.getClassName();
        for (const input of this.dataInputs) {
            const serializedInput = {};
            input.serialize(serializedInput);
            serializationObject.dataInputs.push(serializedInput);
        }
        for (const output of this.dataOutputs) {
            const serializedOutput = {};
            output.serialize(serializedOutput);
            serializationObject.dataOutputs.push(serializedOutput);
        }
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return "FGBlock";
    }
    /**
     * Parses a block from a serialization object
     * @param serializationObject the object to parse from
     * @param parseOptions options for parsing the block
     * @returns the parsed block
     */
    static Parse(serializationObject, parseOptions) {
        const classType = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools */ .S0.Instantiate(serializationObject.className);
        const parsedConfig = {};
        const valueParseFunction = parseOptions.valueParseFunction ?? _serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .defaultValueParseFunction */ .wk;
        if (serializationObject.config) {
            for (const key in serializationObject.config) {
                parsedConfig[key] = valueParseFunction(key, serializationObject.config, parseOptions.scene);
            }
        }
        if ((0,_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .needsPathConverter */ .$Q)(serializationObject.className)) {
            parsedConfig.pathConverter = parseOptions.pathConverter;
        }
        const obj = new classType(parsedConfig);
        obj.uniqueId = serializationObject.uniqueId;
        for (let i = 0; i < serializationObject.dataInputs.length; i++) {
            const dataInput = obj.getDataInput(serializationObject.dataInputs[i].name);
            if (dataInput) {
                dataInput.deserialize(serializationObject.dataInputs[i]);
            }
            else {
                throw new Error("Could not find data input with name " + serializationObject.dataInputs[i].name + " in block " + serializationObject.className);
            }
        }
        for (let i = 0; i < serializationObject.dataOutputs.length; i++) {
            const dataOutput = obj.getDataOutput(serializationObject.dataOutputs[i].name);
            if (dataOutput) {
                dataOutput.deserialize(serializationObject.dataOutputs[i]);
            }
            else {
                throw new Error("Could not find data output with name " + serializationObject.dataOutputs[i].name + " in block " + serializationObject.className);
            }
        }
        obj.metadata = serializationObject.metadata;
        obj.deserialize && obj.deserialize(serializationObject);
        return obj;
    }
}
//# sourceMappingURL=flowGraphBlock.js.map

/***/ }),

/***/ 54011:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   H: () => (/* binding */ FlowGraphConnectionType),
/* harmony export */   X: () => (/* binding */ FlowGraphConnection)
/* harmony export */ });
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(998);
/* harmony import */ var _Misc_guid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38688);


/**
 * @experimental
 * The type of a connection point - inpput or output.
 */
var FlowGraphConnectionType;
(function (FlowGraphConnectionType) {
    FlowGraphConnectionType[FlowGraphConnectionType["Input"] = 0] = "Input";
    FlowGraphConnectionType[FlowGraphConnectionType["Output"] = 1] = "Output";
})(FlowGraphConnectionType || (FlowGraphConnectionType = {}));
/**
 * @experimental
 * The base connection class.
 */
class FlowGraphConnection {
    constructor(name, _connectionType, 
    /* @internal */ _ownerBlock) {
        this._ownerBlock = _ownerBlock;
        /** @internal */
        this._connectedPoint = [];
        /**
         * A uniquely identifying string for the connection.
         */
        this.uniqueId = (0,_Misc_guid_js__WEBPACK_IMPORTED_MODULE_1__/* .RandomGUID */ .z)();
        /**
         * Used for parsing connections.
         * @internal
         */
        // disable warning as this is used for parsing
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this.connectedPointIds = [];
        this.name = name;
        this._connectionType = _connectionType;
    }
    /**
     * The type of the connection
     */
    get connectionType() {
        return this._connectionType;
    }
    /**
     * @internal
     * Override this to indicate if a point can connect to more than one point.
     */
    _isSingularConnection() {
        return true;
    }
    /**
     * Returns if a point is connected to any other point.
     * @returns boolean indicating if the point is connected.
     */
    isConnected() {
        return this._connectedPoint.length > 0;
    }
    /**
     * Connects two connections together.
     * @param point the connection to connect to.
     */
    connectTo(point) {
        if (this._connectionType === point._connectionType) {
            throw new Error(`Cannot connect two points of type ${this.connectionType}`);
        }
        if ((this._isSingularConnection() && this._connectedPoint.length > 0) || (point._isSingularConnection() && point._connectedPoint.length > 0)) {
            throw new Error("Max number of connections for point reached");
        }
        this._connectedPoint.push(point);
        point._connectedPoint.push(this);
    }
    /**
     * Saves the connection to a JSON object.
     * @param serializationObject the object to serialize to.
     */
    serialize(serializationObject = {}) {
        serializationObject.uniqueId = this.uniqueId;
        serializationObject.name = this.name;
        serializationObject._connectionType = this._connectionType;
        serializationObject.connectedPointIds = [];
        serializationObject.className = this.getClassName();
        for (const point of this._connectedPoint) {
            serializationObject.connectedPointIds.push(point.uniqueId);
        }
    }
    /**
     * @returns class name of the connection.
     */
    getClassName() {
        return "FGConnection";
    }
    /**
     * Deserialize from a object into this
     * @param serializationObject the object to deserialize from.
     */
    deserialize(serializationObject) {
        this.uniqueId = serializationObject.uniqueId;
        this.name = serializationObject.name;
        this._connectionType = serializationObject._connectionType;
        this.connectedPointIds = serializationObject.connectedPointIds;
    }
    /**
     * Parses a connection from an object
     * @param serializationObject the object to parse from.
     * @param ownerBlock the block that owns the connection.
     * @returns the parsed connection.
     */
    static Parse(serializationObject = {}, ownerBlock) {
        const type = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0.Instantiate(serializationObject.className);
        const connection = new type(serializationObject.name, serializationObject._connectionType, ownerBlock);
        connection.deserialize(serializationObject);
        return connection;
    }
}
//# sourceMappingURL=flowGraphConnection.js.map

/***/ }),

/***/ 5788:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Y: () => (/* binding */ FlowGraphContext)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_guid_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38688);
/* harmony import */ var _serialization_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(339);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99848);





/**
 * @experimental
 * The context represents the current state and execution of the flow graph.
 * It contains both user-defined variables, which are derived from
 * a more general variable definition, and execution variables that
 * are set by the blocks.
 */
class FlowGraphContext {
    constructor(params) {
        /**
         * A randomly generated GUID for each context.
         */
        this.uniqueId = (0,_Misc_guid_js__WEBPACK_IMPORTED_MODULE_2__/* .RandomGUID */ .z)();
        /**
         * These are the variables defined by a user.
         */
        this._userVariables = {};
        /**
         * These are the variables set by the blocks.
         */
        this._executionVariables = {};
        /**
         * These are the values for the data connection points
         */
        this._connectionValues = {};
        /**
         * These are blocks that have currently pending tasks/listeners that need to be cleaned up.
         */
        this._pendingBlocks = [];
        /**
         * A monotonically increasing ID for each execution.
         * Incremented for every block executed.
         */
        this._executionId = 0;
        /**
         * Observable that is triggered when a node is executed.
         */
        this.onNodeExecutedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_4__/* .Observable */ .cP();
        this._configuration = params;
    }
    /**
     * Check if a user-defined variable is defined.
     * @param name the name of the variable
     * @returns true if the variable is defined
     */
    hasVariable(name) {
        return name in this._userVariables;
    }
    /**
     * Set a user-defined variable.
     * @param name the name of the variable
     * @param value the value of the variable
     */
    setVariable(name, value) {
        this._userVariables[name] = value;
    }
    /**
     * Get a user-defined variable.
     * @param name the name of the variable
     * @returns the value of the variable
     */
    getVariable(name) {
        return this._userVariables[name];
    }
    /**
     * Gets all user variables map
     */
    get userVariables() {
        return this._userVariables;
    }
    _getUniqueIdPrefixedName(obj, name) {
        return `${obj.uniqueId}_${name}`;
    }
    /**
     * Set an internal execution variable
     * @internal
     * @param name
     * @param value
     */
    _setExecutionVariable(block, name, value) {
        this._executionVariables[this._getUniqueIdPrefixedName(block, name)] = value;
    }
    /**
     * Get an internal execution variable
     * @internal
     * @param name
     * @returns
     */
    _getExecutionVariable(block, name, defaultValue) {
        if (this._hasExecutionVariable(block, name)) {
            return this._executionVariables[this._getUniqueIdPrefixedName(block, name)];
        }
        else {
            return defaultValue;
        }
    }
    /**
     * Delete an internal execution variable
     * @internal
     * @param block
     * @param name
     */
    _deleteExecutionVariable(block, name) {
        delete this._executionVariables[this._getUniqueIdPrefixedName(block, name)];
    }
    /**
     * Check if an internal execution variable is defined
     * @internal
     * @param block
     * @param name
     * @returns
     */
    _hasExecutionVariable(block, name) {
        return this._getUniqueIdPrefixedName(block, name) in this._executionVariables;
    }
    /**
     * Check if a connection value is defined
     * @internal
     * @param connectionPoint
     * @returns
     */
    _hasConnectionValue(connectionPoint) {
        return connectionPoint.uniqueId in this._connectionValues;
    }
    /**
     * Set a connection value
     * @internal
     * @param connectionPoint
     * @param value
     */
    _setConnectionValue(connectionPoint, value) {
        this._connectionValues[connectionPoint.uniqueId] = value;
    }
    /**
     * Get a connection value
     * @internal
     * @param connectionPoint
     * @returns
     */
    _getConnectionValue(connectionPoint) {
        return this._connectionValues[connectionPoint.uniqueId];
    }
    /**
     * Get the configuration
     * @internal
     * @param name
     * @param value
     */
    get configuration() {
        return this._configuration;
    }
    /**
     * Add a block to the list of blocks that have pending tasks.
     * @internal
     * @param block
     */
    _addPendingBlock(block) {
        this._pendingBlocks.push(block);
    }
    /**
     * Remove a block from the list of blocks that have pending tasks.
     * @internal
     * @param block
     */
    _removePendingBlock(block) {
        const index = this._pendingBlocks.indexOf(block);
        if (index !== -1) {
            this._pendingBlocks.splice(index, 1);
        }
    }
    /**
     * Clear all pending blocks.
     * @internal
     */
    _clearPendingBlocks() {
        for (const block of this._pendingBlocks) {
            block._cancelPendingTasks(this);
        }
        this._pendingBlocks.length = 0;
    }
    /**
     * @internal
     * Function that notifies the node executed observable
     * @param node
     */
    _notifyExecuteNode(node) {
        this.onNodeExecutedObservable.notifyObservers(node);
    }
    /**
     * @internal
     */
    _increaseExecutionId() {
        this._executionId++;
    }
    /**
     * A monotonically increasing ID for each execution.
     * Incremented for every block executed.
     */
    get executionId() {
        return this._executionId;
    }
    /**
     * Serializes a context
     * @param serializationObject the object to write the values in
     * @param valueSerializationFunction a function to serialize complex values
     */
    serialize(serializationObject = {}, valueSerializationFunction = _serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .defaultValueSerializationFunction */ .X5) {
        serializationObject.uniqueId = this.uniqueId;
        serializationObject._userVariables = {};
        for (const key in this._userVariables) {
            valueSerializationFunction(key, this._userVariables[key], serializationObject._userVariables);
        }
        serializationObject._connectionValues = {};
        for (const key in this._connectionValues) {
            valueSerializationFunction(key, this._connectionValues[key], serializationObject._connectionValues);
        }
    }
    /**
     * @returns the class name of the object.
     */
    getClassName() {
        return "FGContext";
    }
    /**
     * Parses a context
     * @param serializationObject the object containing the context serialization values
     * @param options the options for parsing the context
     * @returns
     */
    static Parse(serializationObject, options) {
        const result = options.graph.createContext();
        const valueParseFunction = options.valueParseFunction ?? _serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .defaultValueParseFunction */ .wk;
        result.uniqueId = serializationObject.uniqueId;
        for (const key in serializationObject._userVariables) {
            const value = valueParseFunction(key, serializationObject._userVariables, result._configuration.scene);
            result._userVariables[key] = value;
        }
        for (const key in serializationObject._connectionValues) {
            const value = valueParseFunction(key, serializationObject._connectionValues, result._configuration.scene);
            result._connectionValues[key] = value;
        }
        return result;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], FlowGraphContext.prototype, "uniqueId", void 0);
//# sourceMappingURL=flowGraphContext.js.map

/***/ }),

/***/ 84813:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   x: () => (/* binding */ FlowGraphCoordinator)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _flowGraph_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10243);
/* harmony import */ var _serialization_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(339);



/**
 * This class holds all of the existing flow graphs and is responsible for creating new ones.
 * It also handles starting/stopping multiple graphs and communication between them through an Event Coordinator
 */
class FlowGraphCoordinator {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        this.config = config;
        this._flowGraphs = [];
        this._customEventsMap = new Map();
        // When the scene is disposed, dispose all graphs currently running on it.
        this.config.scene.onDisposeObservable.add(() => {
            this.dispose();
        });
        // Add itself to the SceneCoordinators list for the Inspector.
        const coordinators = FlowGraphCoordinator.SceneCoordinators.get(this.config.scene) ?? [];
        coordinators.push(this);
    }
    /**
     * Creates a new flow graph and adds it to the list of existing flow graphs
     * @returns a new flow graph
     */
    createGraph() {
        const graph = new _flowGraph_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraph */ .$({ scene: this.config.scene, coordinator: this });
        this._flowGraphs.push(graph);
        return graph;
    }
    /**
     * Removes a flow graph from the list of existing flow graphs and disposes it
     * @param graph the graph to remove
     */
    removeGraph(graph) {
        const index = this._flowGraphs.indexOf(graph);
        if (index !== -1) {
            graph.dispose();
            this._flowGraphs.splice(index, 1);
        }
    }
    /**
     * Starts all graphs
     */
    start() {
        this._flowGraphs.forEach((graph) => graph.start());
    }
    /**
     * Disposes all graphs
     */
    dispose() {
        this._flowGraphs.forEach((graph) => graph.dispose());
        this._flowGraphs.length = 0;
        // Remove itself from the SceneCoordinators list for the Inspector.
        const coordinators = FlowGraphCoordinator.SceneCoordinators.get(this.config.scene) ?? [];
        const index = coordinators.indexOf(this);
        if (index !== -1) {
            coordinators.splice(index, 1);
        }
    }
    /**
     * Serializes this coordinator to a JSON object.
     * @param serializationObject the object to serialize to
     * @param valueSerializeFunction the function to use to serialize the value
     */
    serialize(serializationObject, valueSerializeFunction) {
        serializationObject._flowGraphs = [];
        this._flowGraphs.forEach((graph) => {
            const serializedGraph = {};
            graph.serialize(serializedGraph, valueSerializeFunction);
            serializationObject._flowGraphs.push(serializedGraph);
        });
    }
    /**
     * Parses a serialized coordinator.
     * @param serializedObject the object to parse
     * @param options the options to use when parsing
     * @returns the parsed coordinator
     */
    static Parse(serializedObject, options) {
        const valueParseFunction = options.valueParseFunction ?? _serialization_js__WEBPACK_IMPORTED_MODULE_2__/* .defaultValueParseFunction */ .wk;
        const coordinator = new FlowGraphCoordinator({ scene: options.scene });
        serializedObject._flowGraphs?.forEach((serializedGraph) => {
            _flowGraph_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraph */ .$.Parse(serializedGraph, { coordinator, valueParseFunction, pathConverter: options.pathConverter });
        });
        return coordinator;
    }
    /**
     * Gets the list of flow graphs
     */
    get flowGraphs() {
        return this._flowGraphs;
    }
    /**
     * Get an observable that will be notified when the event with the given id is fired.
     * @param id the id of the event
     * @returns the observable for the event
     */
    getCustomEventObservable(id) {
        let observable = this._customEventsMap.get(id);
        if (!observable) {
            observable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
            this._customEventsMap.set(id, observable);
        }
        return observable;
    }
    /**
     * Notifies the observable for the given event id with the given data.
     * @param id the id of the event
     * @param data the data to send with the event
     */
    notifyCustomEvent(id, data) {
        const observable = this._customEventsMap.get(id);
        if (observable) {
            observable.notifyObservers(data);
        }
    }
}
/**
 * @internal
 * A list of all the coordinators per scene. Will be used by the inspector
 */
FlowGraphCoordinator.SceneCoordinators = new Map();
//# sourceMappingURL=flowGraphCoordinator.js.map

/***/ }),

/***/ 60707:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   l: () => (/* binding */ FlowGraphDataConnection)
/* harmony export */ });
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56552);
/* harmony import */ var _flowGraphConnection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54011);
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4720);



/**
 * @experimental
 * Represents a connection point for data.
 * An unconnected input point can have a default value.
 * An output point will only have a value if it is connected to an input point. Furthermore,
 * if the point belongs to a "function" node, the node will run its function to update the value.
 */
class FlowGraphDataConnection extends _flowGraphConnection_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphConnection */ .X {
    /**
     * Create a new data connection point.
     * @param name
     * @param connectionType
     * @param ownerBlock
     * @param richType
     */
    constructor(name, connectionType, ownerBlock, 
    /**
     * the type of the data in this block
     */
    richType) {
        super(name, connectionType, ownerBlock);
        this.richType = richType;
    }
    /**
     * An output data block can connect to multiple input data blocks,
     * but an input data block can only connect to one output data block.
     * @returns true if the connection is singular
     */
    _isSingularConnection() {
        return this.connectionType === 0 /* FlowGraphConnectionType.Input */;
    }
    /**
     * Set the value of the connection in a specific context.
     * @param value the value to set
     * @param context the context to which the value is set
     */
    setValue(value, context) {
        context._setConnectionValue(this, value);
    }
    /**
     * Connect this point to another point.
     * @param point the point to connect to.
     */
    connectTo(point) {
        super.connectTo(point);
    }
    _getValueOrDefault(context) {
        if (context._hasConnectionValue(this)) {
            return context._getConnectionValue(this);
        }
        else {
            return this.richType.defaultValue;
        }
    }
    /**
     * Gets the value of the connection in a specific context.
     * @param context the context from which the value is retrieved
     * @returns the value of the connection
     */
    getValue(context) {
        if (this.connectionType === 1 /* FlowGraphConnectionType.Output */) {
            context._notifyExecuteNode(this._ownerBlock);
            this._ownerBlock._updateOutputs(context);
            return this._getValueOrDefault(context);
        }
        if (!this.isConnected()) {
            return this._getValueOrDefault(context);
        }
        else {
            return this._connectedPoint[0].getValue(context);
        }
    }
    /**
     * @returns class name of the object.
     */
    getClassName() {
        return "FGDataConnection";
    }
    /**
     * Serializes this object.
     * @param serializationObject the object to serialize to
     */
    serialize(serializationObject = {}) {
        super.serialize(serializationObject);
        serializationObject.richType = {};
        this.richType.serialize(serializationObject.richType);
    }
    /**
     * Parses a data connection from a serialized object.
     * @param serializationObject the object to parse from
     * @param ownerBlock the block that owns the connection
     * @returns the parsed connection
     */
    static Parse(serializationObject, ownerBlock) {
        const obj = _flowGraphConnection_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphConnection */ .X.Parse(serializationObject, ownerBlock);
        obj.richType = _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_2__/* .RichType */ .D.Parse(serializationObject.richType);
        return obj;
    }
}
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_0__/* .RegisterClass */ .Y5)("FGDataConnection", FlowGraphDataConnection);
//# sourceMappingURL=flowGraphDataConnection.js.map

/***/ }),

/***/ 22086:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   i: () => (/* binding */ FlowGraphEventBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphAsyncExecutionBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51000);

/**
 * @experimental
 * A type of block that listens to an event observable and activates
 * its output signal when the event is triggered.
 */
class FlowGraphEventBlock extends _flowGraphAsyncExecutionBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphAsyncExecutionBlock */ .M {
    /**
     * @internal
     */
    _execute(context) {
        context._notifyExecuteNode(this);
        this.out._activateSignal(context);
    }
}
//# sourceMappingURL=flowGraphEventBlock.js.map

/***/ }),

/***/ 16972:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   u: () => (/* binding */ FlowGraphExecutionBlock)
/* harmony export */ });
/* harmony import */ var _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71294);
/* harmony import */ var _flowGraphSignalConnection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22767);


/**
 * @experimental
 * A block that executes some action. Always has an input signal (which is not used by event blocks).
 * Can have one or more output signals.
 */
class FlowGraphExecutionBlock extends _flowGraphBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphBlock */ .e {
    constructor(config) {
        super(config);
        this.signalInputs = [];
        this.signalOutputs = [];
        this.in = this._registerSignalInput("in");
    }
    _registerSignalInput(name) {
        const input = new _flowGraphSignalConnection_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphSignalConnection */ .R(name, 0 /* FlowGraphConnectionType.Input */, this);
        this.signalInputs.push(input);
        return input;
    }
    _registerSignalOutput(name) {
        const output = new _flowGraphSignalConnection_js__WEBPACK_IMPORTED_MODULE_1__/* .FlowGraphSignalConnection */ .R(name, 1 /* FlowGraphConnectionType.Output */, this);
        this.signalOutputs.push(output);
        return output;
    }
    /**
     * Given a name of a signal input, return that input if it exists
     * @param name the name of the input
     * @returns if the input exists, the input. Otherwise, undefined.
     */
    getSignalInput(name) {
        return this.signalInputs.find((input) => input.name === name);
    }
    /**
     * Given a name of a signal output, return that input if it exists
     * @param name the name of the input
     * @returns if the input exists, the input. Otherwise, undefined.
     */
    getSignalOutput(name) {
        return this.signalOutputs.find((output) => output.name === name);
    }
    /**
     * Serializes this block
     * @param serializationObject the object to serialize in
     */
    serialize(serializationObject = {}) {
        super.serialize(serializationObject);
        serializationObject.signalInputs = [];
        serializationObject.signalOutputs = [];
        for (const input of this.signalInputs) {
            const serializedInput = {};
            input.serialize(serializedInput);
            serializationObject.signalInputs.push(serializedInput);
        }
        for (const output of this.signalOutputs) {
            const serializedOutput = {};
            output.serialize(serializedOutput);
            serializationObject.signalOutputs.push(serializedOutput);
        }
    }
    /**
     * Deserializes from an object
     * @param serializationObject the object to deserialize from
     */
    deserialize(serializationObject) {
        for (let i = 0; i < serializationObject.signalInputs.length; i++) {
            const signalInput = this.getSignalInput(serializationObject.signalInputs[i].name);
            if (signalInput) {
                signalInput.deserialize(serializationObject.signalInputs[i]);
            }
            else {
                throw new Error("Could not find signal input with name " + serializationObject.signalInputs[i].name + " in block " + serializationObject.className);
            }
        }
        for (let i = 0; i < serializationObject.signalOutputs.length; i++) {
            const signalOutput = this.getSignalOutput(serializationObject.signalOutputs[i].name);
            if (signalOutput) {
                signalOutput.deserialize(serializationObject.signalOutputs[i]);
            }
            else {
                throw new Error("Could not find signal output with name " + serializationObject.signalOutputs[i].name + " in block " + serializationObject.className);
            }
        }
    }
    /**
     * @returns the class name
     */
    getClassName() {
        return "FGExecutionBlock";
    }
}
//# sourceMappingURL=flowGraphExecutionBlock.js.map

/***/ }),

/***/ 33006:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   w: () => (/* binding */ FlowGraphExecutionBlockWithOutSignal)
/* harmony export */ });
/* harmony import */ var _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16972);

/**
 * @experimental
 * An execution block that has an out signal. This signal is triggered when the synchronous execution of this block is done.
 * Most execution blocks will inherit from this, except for the ones that have multiple signals to be triggered.
 * (such as if blocks)
 */
class FlowGraphExecutionBlockWithOutSignal extends _flowGraphExecutionBlock_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphExecutionBlock */ .u {
    constructor(config) {
        super(config);
        this.out = this._registerSignalOutput("out");
    }
}
//# sourceMappingURL=flowGraphExecutionBlockWithOutSignal.js.map

/***/ }),

/***/ 20033:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   P: () => (/* binding */ FlowGraphInteger)
/* harmony export */ });
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56552);

/**
 * @experimental
 * Class that represents an integer value.
 */
class FlowGraphInteger {
    constructor(value) {
        this.value = this._toInt(value);
    }
    /**
     * Converts a float to an integer.
     * @param n the float to convert
     * @returns the result of n | 0 - converting it to a int
     */
    _toInt(n) {
        return n | 0;
    }
    /**
     * Adds two integers together.
     * @param other the other integer to add
     * @returns a FlowGraphInteger with the result of the addition
     */
    add(other) {
        return new FlowGraphInteger(this.value + other.value);
    }
    /**
     * Subtracts two integers.
     * @param other the other integer to subtract
     * @returns a FlowGraphInteger with the result of the subtraction
     */
    subtract(other) {
        return new FlowGraphInteger(this.value - other.value);
    }
    /**
     * Multiplies two integers.
     * @param other the other integer to multiply
     * @returns a FlowGraphInteger with the result of the multiplication
     */
    multiply(other) {
        return new FlowGraphInteger(Math.imul(this.value, other.value));
    }
    /**
     * Divides two integers.
     * @param other the other integer to divide
     * @returns a FlowGraphInteger with the result of the division
     */
    divide(other) {
        return new FlowGraphInteger(this.value / other.value);
    }
    /**
     * The class name of this type.
     * @returns
     */
    getClassName() {
        return FlowGraphInteger.ClassName;
    }
    /**
     * Compares two integers for equality.
     * @param other the other integer to compare
     * @returns
     */
    equals(other) {
        return this.value === other.value;
    }
    /**
     * Parses a FlowGraphInteger from a serialization object.
     * @param serializationObject
     * @returns
     */
    static Parse(serializationObject) {
        return new FlowGraphInteger(serializationObject.value);
    }
}
FlowGraphInteger.ClassName = "FlowGraphInteger";
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_0__/* .RegisterClass */ .Y5)("FlowGraphInteger", FlowGraphInteger);
//# sourceMappingURL=flowGraphInteger.js.map

/***/ }),

/***/ 92579:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   H: () => (/* binding */ FlowGraphPathConverterComponent)
/* harmony export */ });
/* harmony import */ var _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4720);

const pathHasTemplatesRegex = new RegExp(/\{(\w+)\}/g);
/**
 * @experimental
 * A component that converts a path to an object accessor.
 */
class FlowGraphPathConverterComponent {
    constructor(path, ownerBlock) {
        this.path = path;
        this.ownerBlock = ownerBlock;
        /**
         * The templated inputs for the provided path.
         */
        this.templatedInputs = [];
        let match = pathHasTemplatesRegex.exec(path);
        while (match) {
            const [, matchGroup] = match;
            this.templatedInputs.push(ownerBlock.registerDataInput(matchGroup, _flowGraphRichTypes_js__WEBPACK_IMPORTED_MODULE_0__/* .RichTypeFlowGraphInteger */ .x2));
            match = pathHasTemplatesRegex.exec(path);
        }
    }
    getAccessor(pathConverter, context) {
        let finalPath = this.path;
        for (const templatedInput of this.templatedInputs) {
            const valueToReplace = templatedInput.getValue(context).value;
            finalPath = finalPath.replace(`{${templatedInput.name}}`, valueToReplace.toString());
        }
        return pathConverter.convert(finalPath);
    }
}
//# sourceMappingURL=flowGraphPathConverterComponent.js.map

/***/ }),

/***/ 4720:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   D: () => (/* binding */ RichType),
/* harmony export */   Dx: () => (/* binding */ RichTypeVector3),
/* harmony export */   Es: () => (/* binding */ RichTypeNumber),
/* harmony export */   Gx: () => (/* binding */ RichTypeColor4),
/* harmony export */   K$: () => (/* binding */ RichTypeVector2),
/* harmony export */   KV: () => (/* binding */ RichTypeString),
/* harmony export */   Ko: () => (/* binding */ RichTypeVector4),
/* harmony export */   Nf: () => (/* binding */ RichTypeColor3),
/* harmony export */   P_: () => (/* binding */ RichTypeQuaternion),
/* harmony export */   RI: () => (/* binding */ RichTypeBoolean),
/* harmony export */   Sp: () => (/* binding */ RichTypeMatrix),
/* harmony export */   Vv: () => (/* binding */ RichTypeAny),
/* harmony export */   k4: () => (/* binding */ getRichTypeFromValue),
/* harmony export */   x2: () => (/* binding */ RichTypeFlowGraphInteger)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26041);
/* harmony import */ var _flowGraphInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20033);



/**
 * A rich type represents extra information about a type,
 * such as its name and a default value constructor.
 * @experimental
 */
class RichType {
    constructor(
    /**
     * The name given to the type.
     */
    typeName, 
    /**
     * The default value of the type.
     */
    defaultValue) {
        this.typeName = typeName;
        this.defaultValue = defaultValue;
    }
    /**
     * Serializes this rich type into a serialization object.
     * @param serializationObject the object to serialize to
     */
    serialize(serializationObject) {
        serializationObject.typeName = this.typeName;
        serializationObject.defaultValue = this.defaultValue;
    }
    /**
     * Parses a rich type from a serialization object.
     * @param serializationObject a serialization object
     * @returns the parsed rich type
     */
    static Parse(serializationObject) {
        return new RichType(serializationObject.typeName, serializationObject.defaultValue);
    }
}
const RichTypeAny = new RichType("any", undefined);
const RichTypeString = new RichType("string", "");
const RichTypeNumber = new RichType("number", 0);
const RichTypeBoolean = new RichType("boolean", false);
const RichTypeVector2 = new RichType("Vector2", _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9.Zero());
const RichTypeVector3 = new RichType("Vector3", _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero());
const RichTypeVector4 = new RichType("Vector4", _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector4 */ .IU.Zero());
const RichTypeMatrix = new RichType("Matrix", _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Identity());
const RichTypeColor3 = new RichType("Color3", _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9.Black());
const RichTypeColor4 = new RichType("Color4", new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov(0, 0, 0, 0));
const RichTypeQuaternion = new RichType("Quaternion", _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Identity());
const RichTypeFlowGraphInteger = new RichType("FlowGraphInteger", new _flowGraphInteger_js__WEBPACK_IMPORTED_MODULE_2__/* .FlowGraphInteger */ .P(0));
/**
 * Given a value, try to deduce its rich type.
 * @param value the value to deduce the rich type from
 * @returns the value's rich type, or RichTypeAny if the type could not be deduced.
 */
function getRichTypeFromValue(value) {
    switch (typeof value) {
        case "string":
            return RichTypeString;
        case "number":
            return RichTypeNumber;
        case "boolean":
            return RichTypeBoolean;
        case "object":
            if (value instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9) {
                return RichTypeVector2;
            }
            else if (value instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq) {
                return RichTypeVector3;
            }
            else if (value instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector4 */ .IU) {
                return RichTypeVector4;
            }
            else if (value instanceof _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9) {
                return RichTypeColor3;
            }
            else if (value instanceof _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov) {
                return RichTypeColor4;
            }
            else if (value instanceof _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT) {
                return RichTypeQuaternion;
            }
            else if (value instanceof _flowGraphInteger_js__WEBPACK_IMPORTED_MODULE_2__/* .FlowGraphInteger */ .P) {
                return RichTypeFlowGraphInteger;
            }
            else {
                return RichTypeAny;
            }
        default:
            return RichTypeAny;
    }
}
//# sourceMappingURL=flowGraphRichTypes.js.map

/***/ }),

/***/ 22767:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   R: () => (/* binding */ FlowGraphSignalConnection)
/* harmony export */ });
/* harmony import */ var _flowGraphConnection_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54011);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56552);


/**
 * @experimental
 * Represents a connection point for a signal.
 * When an output point is activated, it will activate the connected input point.
 * When an input point is activated, it will execute the block it belongs to.
 */
class FlowGraphSignalConnection extends _flowGraphConnection_js__WEBPACK_IMPORTED_MODULE_0__/* .FlowGraphConnection */ .X {
    /**
     * @internal
     * A signal input can be connected to more than one signal output,
     * but a signal output can only connect to one signal input
     * @returns true if the connection is singular
     */
    _isSingularConnection() {
        return this.connectionType === 1 /* FlowGraphConnectionType.Output */;
    }
    /**
     * @internal
     */
    _activateSignal(context) {
        if (this.connectionType === 0 /* FlowGraphConnectionType.Input */) {
            context._notifyExecuteNode(this._ownerBlock);
            this._ownerBlock._execute(context, this);
            context._increaseExecutionId();
        }
        else {
            this._connectedPoint[0]?._activateSignal(context);
        }
    }
}
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__/* .RegisterClass */ .Y5)("FlowGraphSignalConnection", FlowGraphSignalConnection);
//# sourceMappingURL=flowGraphSignalConnection.js.map

/***/ }),

/***/ 339:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $Q: () => (/* binding */ needsPathConverter),
/* harmony export */   X5: () => (/* binding */ defaultValueSerializationFunction),
/* harmony export */   wk: () => (/* binding */ defaultValueParseFunction)
/* harmony export */ });
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26041);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _flowGraphInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20033);



function isMeshClassName(className) {
    return (className === "Mesh" ||
        className === "AbstractMesh" ||
        className === "GroundMesh" ||
        className === "InstanceMesh" ||
        className === "LinesMesh" ||
        className === "GoldbergMesh" ||
        className === "GreasedLineMesh" ||
        className === "TrailMesh");
}
function isVectorClassName(className) {
    return className === "Vector2" || className === "Vector3" || className === "Vector4" || className === "Quaternion" || className === "Color3" || className === "Color4";
}
function parseVector(className, value) {
    if (className === "Vector2") {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9.FromArray(value);
    }
    else if (className === "Vector3") {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArray(value);
    }
    else if (className === "Vector4") {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU.FromArray(value);
    }
    else if (className === "Quaternion") {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.FromArray(value);
    }
    else if (className === "Color3") {
        return new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_0__/* .Color3 */ .v9(value[0], value[1], value[2]);
    }
    else if (className === "Color4") {
        return new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov(value[0], value[1], value[2], value[3]);
    }
    else {
        throw new Error(`Unknown vector class name ${className}`);
    }
}
/**
 * The default function that serializes values in a context object to a serialization object
 * @param key the key where the value should be stored in the serialization object
 * @param value the value to store
 * @param serializationObject the object where the value will be stored
 */
function defaultValueSerializationFunction(key, value, serializationObject) {
    const className = value?.getClassName?.() ?? "";
    if (isMeshClassName(className)) {
        serializationObject[key] = {
            name: value.name,
            className,
        };
    }
    else if (isVectorClassName(className)) {
        serializationObject[key] = {
            value: value.asArray(),
            className,
        };
    }
    else {
        serializationObject[key] = value;
    }
}
/**
 * The default function that parses values stored in a serialization object
 * @param key the key to the value that will be parsed
 * @param serializationObject the object that will be parsed
 * @param scene
 * @returns
 */
function defaultValueParseFunction(key, serializationObject, scene) {
    const intermediateValue = serializationObject[key];
    let finalValue;
    const className = intermediateValue?.className;
    if (isMeshClassName(className)) {
        finalValue = scene.getMeshByName(intermediateValue.name);
    }
    else if (isVectorClassName(className)) {
        finalValue = parseVector(className, intermediateValue.value);
    }
    else if (className === "Matrix") {
        finalValue = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.FromArray(intermediateValue.value);
    }
    else if (className === _flowGraphInteger_js__WEBPACK_IMPORTED_MODULE_2__/* .FlowGraphInteger */ .P.ClassName) {
        finalValue = _flowGraphInteger_js__WEBPACK_IMPORTED_MODULE_2__/* .FlowGraphInteger */ .P.Parse(intermediateValue);
    }
    else if (intermediateValue && intermediateValue.value !== undefined) {
        finalValue = intermediateValue.value;
    }
    else {
        finalValue = intermediateValue;
    }
    return finalValue;
}
/**
 * Given a name of a flow graph block class, return if this
 * class needs to be created with a path converter. Used in
 * parsing.
 * @param className the name of the flow graph block class
 * @returns a boolean indicating if the class needs a path converter
 */
function needsPathConverter(className) {
    // I am not using the ClassName property here because it was causing a circular dependency
    // that jest didn't like!
    return className === "FGSetPropertyBlock" || className === "FGGetPropertyBlock" || className === "FGPlayAnimationBlock" || className === "FGMeshPickEventBlock";
}
//# sourceMappingURL=serialization.js.map

/***/ }),

/***/ 4686:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   r: () => (/* binding */ _isADescendantOf)
/* harmony export */ });
/**
 * @internal
 * Returns if mesh1 is a descendant of mesh2
 * @param mesh1
 * @param mesh2
 * @returns
 */
function _isADescendantOf(mesh1, mesh2) {
    return !!(mesh1.parent && (mesh1.parent === mesh2 || _isADescendantOf(mesh1.parent, mesh2)));
}
//# sourceMappingURL=utils.js.map

/***/ }),

/***/ 29388:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Kc: () => (/* binding */ NodeRenderGraphConnectionPointDirection),
/* harmony export */   X_: () => (/* binding */ NodeRenderGraphConnectionPointCompatibilityStates),
/* harmony export */   tp: () => (/* binding */ NodeRenderGraphBlockConnectionPointTypes)
/* harmony export */ });
/**
 * Defines the kind of connection point for node render graph nodes
 */
var NodeRenderGraphBlockConnectionPointTypes;
(function (NodeRenderGraphBlockConnectionPointTypes) {
    /** General purpose texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["Texture"] = 1] = "Texture";
    /** Back buffer color texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureBackBuffer"] = 2] = "TextureBackBuffer";
    /** Back buffer depth/stencil attachment */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureBackBufferDepthStencilAttachment"] = 4] = "TextureBackBufferDepthStencilAttachment";
    /** Depth/stencil attachment */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureDepthStencilAttachment"] = 8] = "TextureDepthStencilAttachment";
    /** Depth (in view space) geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureViewDepth"] = 16] = "TextureViewDepth";
    /** Normal (in view space) geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureViewNormal"] = 32] = "TextureViewNormal";
    /** Albedo geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAlbedo"] = 64] = "TextureAlbedo";
    /** Reflectivity geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureReflectivity"] = 128] = "TextureReflectivity";
    /** Position (in world space) geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureWorldPosition"] = 256] = "TextureWorldPosition";
    /** Velocity geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureVelocity"] = 512] = "TextureVelocity";
    /** Irradiance geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureIrradiance"] = 1024] = "TextureIrradiance";
    /** Albedo (sqrt) geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAlbedoSqrt"] = 2048] = "TextureAlbedoSqrt";
    /** Depth (in screen space) geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureScreenDepth"] = 4096] = "TextureScreenDepth";
    /** Normal (in world space) geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureWorldNormal"] = 8192] = "TextureWorldNormal";
    /** Position (in local space) geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureLocalPosition"] = 16384] = "TextureLocalPosition";
    /** Linear velocity geometry texture */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureLinearVelocity"] = 32768] = "TextureLinearVelocity";
    /** Bit field for all textures but back buffer depth/stencil */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAllButBackBufferDepthStencil"] = 16777211] = "TextureAllButBackBufferDepthStencil";
    /** Bit field for all textures but back buffer */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAllButBackBuffer"] = 16777209] = "TextureAllButBackBuffer";
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["TextureAll"] = 16777215] = "TextureAll";
    /** Camera */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["Camera"] = 16777216] = "Camera";
    /** List of objects (meshes, particle systems, sprites) */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["ObjectList"] = 33554432] = "ObjectList";
    /** Detect type based on connection */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["AutoDetect"] = 268435456] = "AutoDetect";
    /** Output type that will be defined by input type */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["BasedOnInput"] = 536870912] = "BasedOnInput";
    /** Undefined */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["Undefined"] = 1073741824] = "Undefined";
    /** Bitmask of all types */
    NodeRenderGraphBlockConnectionPointTypes[NodeRenderGraphBlockConnectionPointTypes["All"] = 4294967295] = "All";
})(NodeRenderGraphBlockConnectionPointTypes || (NodeRenderGraphBlockConnectionPointTypes = {}));
/**
 * Enum used to define the compatibility state between two connection points
 */
var NodeRenderGraphConnectionPointCompatibilityStates;
(function (NodeRenderGraphConnectionPointCompatibilityStates) {
    /** Points are compatibles */
    NodeRenderGraphConnectionPointCompatibilityStates[NodeRenderGraphConnectionPointCompatibilityStates["Compatible"] = 0] = "Compatible";
    /** Points are incompatible because of their types */
    NodeRenderGraphConnectionPointCompatibilityStates[NodeRenderGraphConnectionPointCompatibilityStates["TypeIncompatible"] = 1] = "TypeIncompatible";
    /** Points are incompatible because they are in the same hierarchy **/
    NodeRenderGraphConnectionPointCompatibilityStates[NodeRenderGraphConnectionPointCompatibilityStates["HierarchyIssue"] = 2] = "HierarchyIssue";
})(NodeRenderGraphConnectionPointCompatibilityStates || (NodeRenderGraphConnectionPointCompatibilityStates = {}));
/**
 * Defines the direction of a connection point
 */
var NodeRenderGraphConnectionPointDirection;
(function (NodeRenderGraphConnectionPointDirection) {
    /** Input */
    NodeRenderGraphConnectionPointDirection[NodeRenderGraphConnectionPointDirection["Input"] = 0] = "Input";
    /** Output */
    NodeRenderGraphConnectionPointDirection[NodeRenderGraphConnectionPointDirection["Output"] = 1] = "Output";
})(NodeRenderGraphConnectionPointDirection || (NodeRenderGraphConnectionPointDirection = {}));
//# sourceMappingURL=nodeRenderGraphTypes.js.map

/***/ }),

/***/ 95166:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   E: () => (/* binding */ NodeRenderGraphBlock)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56552);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79259);
/* harmony import */ var _Misc_uniqueIdGenerator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82678);
/* harmony import */ var _Types_nodeRenderGraphTypes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29388);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(99848);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51137);
/* harmony import */ var _nodeRenderGraphBlockConnectionPoint_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(46566);








/**
 * Defines a block that can be used inside a node render graph
 */
class NodeRenderGraphBlock {
    /**
     * Gets or sets the disable flag of the task associated with this block
     */
    get disabled() {
        return !!this._frameGraphTask?.disabled;
    }
    set disabled(value) {
        if (this._frameGraphTask) {
            this._frameGraphTask.disabled = value;
        }
    }
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Gets the list of input points
     */
    get inputs() {
        return this._inputs;
    }
    /** Gets the list of output points */
    get outputs() {
        return this._outputs;
    }
    /**
     * Gets or set the name of the block
     */
    get name() {
        return this._name;
    }
    set name(value) {
        this._name = value;
    }
    /**
     * Gets a boolean indicating if this block is an input
     */
    get isInput() {
        return this._isInput;
    }
    /**
     * Gets a boolean indicating if this block is a teleport out
     */
    get isTeleportOut() {
        return this._isTeleportOut;
    }
    /**
     * Gets a boolean indicating if this block is a teleport in
     */
    get isTeleportIn() {
        return this._isTeleportIn;
    }
    /**
     * Gets a boolean indicating if this block is a debug block
     */
    get isDebug() {
        return this._isDebug;
    }
    /**
     * Gets a boolean indicating that this block can only be used once per node render graph
     */
    get isUnique() {
        return this._isUnique;
    }
    /**
     * Gets the current class name e.g. "NodeRenderGraphBlock"
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphBlock";
    }
    _inputRename(name) {
        return name;
    }
    _outputRename(name) {
        return name;
    }
    /**
     * Checks if the current block is an ancestor of a given block
     * @param block defines the potential descendant block to check
     * @returns true if block is a descendant
     */
    isAnAncestorOf(block) {
        for (const output of this._outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                if (endpoint.ownerBlock === block) {
                    return true;
                }
                if (endpoint.ownerBlock.isAnAncestorOf(block)) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Checks if the current block is an ancestor of a given type
     * @param type defines the potential type to check
     * @returns true if block is a descendant
     */
    isAnAncestorOfType(type) {
        if (this.getClassName() === type) {
            return true;
        }
        for (const output of this._outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                if (endpoint.ownerBlock.isAnAncestorOfType(type)) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Get the first descendant using a predicate
     * @param predicate defines the predicate to check
     * @returns descendant or null if none found
     */
    getDescendantOfPredicate(predicate) {
        if (predicate(this)) {
            return this;
        }
        for (const output of this._outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                const descendant = endpoint.ownerBlock.getDescendantOfPredicate(predicate);
                if (descendant) {
                    return descendant;
                }
            }
        }
        return null;
    }
    /**
     * Creates a new NodeRenderGraphBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     * @param _additionalConstructionParameters defines additional parameters to pass to the block constructor
     */
    constructor(name, frameGraph, scene, ..._additionalConstructionParameters) {
        this._name = "";
        this._isInput = false;
        this._isTeleportOut = false;
        this._isTeleportIn = false;
        this._isDebug = false;
        this._isUnique = false;
        /**
         * Gets an observable raised when the block is built
         */
        this.onBuildObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_5__/* .Observable */ .cP();
        /** @internal */
        this._inputs = new Array();
        /** @internal */
        this._outputs = new Array();
        /** @internal */
        this._codeVariableName = "";
        /** @internal */
        this._additionalConstructionParameters = null;
        /** Gets or sets a boolean indicating that this input can be edited from a collapsed frame */
        this.visibleOnFrame = false;
        this._name = name;
        this._frameGraph = frameGraph;
        this._scene = scene;
        this._engine = scene.getEngine();
        this.uniqueId = _Misc_uniqueIdGenerator_js__WEBPACK_IMPORTED_MODULE_3__/* .UniqueIdGenerator */ .K.UniqueId;
    }
    /**
     * Register a new input. Must be called inside a block constructor
     * @param name defines the connection point name
     * @param type defines the connection point type
     * @param isOptional defines a boolean indicating that this input can be omitted
     * @param point an already created connection point. If not provided, create a new one
     * @returns the current block
     */
    registerInput(name, type, isOptional = false, point) {
        point = point ?? new _nodeRenderGraphBlockConnectionPoint_js__WEBPACK_IMPORTED_MODULE_7__/* .NodeRenderGraphConnectionPoint */ .t(name, this, 0 /* NodeRenderGraphConnectionPointDirection.Input */);
        point.type = type;
        point.isOptional = isOptional;
        this._inputs.push(point);
        return this;
    }
    /**
     * Register a new output. Must be called inside a block constructor
     * @param name defines the connection point name
     * @param type defines the connection point type
     * @param point an already created connection point. If not provided, create a new one
     * @returns the current block
     */
    registerOutput(name, type, point) {
        point = point ?? new _nodeRenderGraphBlockConnectionPoint_js__WEBPACK_IMPORTED_MODULE_7__/* .NodeRenderGraphConnectionPoint */ .t(name, this, 1 /* NodeRenderGraphConnectionPointDirection.Output */);
        point.type = type;
        this._outputs.push(point);
        return this;
    }
    _buildBlock(_state) {
        // Empty. Must be defined by child nodes
    }
    _customBuildStep(_state) {
        // Must be implemented by children
    }
    _propagateInputValueToOutput(inputConnectionPoint, outputConnectionPoint) {
        if (inputConnectionPoint.connectedPoint) {
            outputConnectionPoint.value = inputConnectionPoint.connectedPoint.value;
        }
    }
    /**
     * Build the current node and generate the vertex data
     * @param state defines the current generation state
     * @returns true if already built
     */
    build(state) {
        if (this._buildId === state.buildId) {
            return true;
        }
        this._buildId = state.buildId;
        // Check if "parent" blocks are compiled
        for (const input of this._inputs) {
            if (!input.connectedPoint) {
                if (!input.isOptional) {
                    // Emit a warning
                    state._notConnectedNonOptionalInputs.push(input);
                }
                continue;
            }
            const block = input.connectedPoint.ownerBlock;
            if (block && block !== this) {
                block.build(state);
            }
        }
        this._customBuildStep(state);
        // Logs
        if (state.verbose) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_6__/* .Logger */ .V.Log(`Building ${this.name} [${this.getClassName()}]`);
        }
        this._buildBlock(state);
        if (this._frameGraphTask) {
            this._frameGraph.addTask(this._frameGraphTask);
        }
        this.onBuildObservable.notifyObservers(this);
        return false;
    }
    _linkConnectionTypes(inputIndex0, inputIndex1, looseCoupling = false) {
        if (looseCoupling) {
            this._inputs[inputIndex1]._acceptedConnectionPointType = this._inputs[inputIndex0];
        }
        else {
            this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1];
        }
        this._inputs[inputIndex1]._linkedConnectionSource = this._inputs[inputIndex0];
    }
    /**
     * Initialize the block and prepare the context for build
     */
    initialize() {
        // Do nothing
    }
    /**
     * Lets the block try to connect some inputs automatically
     */
    autoConfigure() {
        // Do nothing
    }
    /**
     * Find an input by its name
     * @param name defines the name of the input to look for
     * @returns the input or null if not found
     */
    getInputByName(name) {
        const filter = this._inputs.filter((e) => e.name === name);
        if (filter.length) {
            return filter[0];
        }
        return null;
    }
    /**
     * Find an output by its name
     * @param name defines the name of the output to look for
     * @returns the output or null if not found
     */
    getOutputByName(name) {
        const filter = this._outputs.filter((e) => e.name === name);
        if (filter.length) {
            return filter[0];
        }
        return null;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.customType = "BABYLON." + this.getClassName();
        serializationObject.id = this.uniqueId;
        serializationObject.name = this.name;
        serializationObject.visibleOnFrame = this.visibleOnFrame;
        serializationObject.disabled = this.disabled;
        if (this._additionalConstructionParameters) {
            serializationObject.additionalConstructionParameters = this._additionalConstructionParameters;
        }
        serializationObject.inputs = [];
        serializationObject.outputs = [];
        for (const input of this.inputs) {
            serializationObject.inputs.push(input.serialize());
        }
        for (const output of this.outputs) {
            serializationObject.outputs.push(output.serialize(false));
        }
        return serializationObject;
    }
    /**
     * @internal
     */
    _deserialize(serializationObject) {
        this._name = serializationObject.name;
        this.comments = serializationObject.comments;
        this.visibleOnFrame = serializationObject.visibleOnFrame;
        this.disabled = serializationObject.disabled;
        this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);
    }
    _deserializePortDisplayNamesAndExposedOnFrame(serializationObject) {
        const serializedInputs = serializationObject.inputs;
        const serializedOutputs = serializationObject.outputs;
        if (serializedInputs) {
            serializedInputs.forEach((port) => {
                const input = this.inputs.find((i) => i.name === port.name);
                if (!input) {
                    return;
                }
                if (port.displayName) {
                    input.displayName = port.displayName;
                }
                if (port.isExposedOnFrame) {
                    input.isExposedOnFrame = port.isExposedOnFrame;
                    input.exposedPortPosition = port.exposedPortPosition;
                }
            });
        }
        if (serializedOutputs) {
            serializedOutputs.forEach((port, i) => {
                if (port.displayName) {
                    this.outputs[i].displayName = port.displayName;
                }
                if (port.isExposedOnFrame) {
                    this.outputs[i].isExposedOnFrame = port.isExposedOnFrame;
                    this.outputs[i].exposedPortPosition = port.exposedPortPosition;
                }
            });
        }
    }
    _dumpPropertiesCode() {
        const variableName = this._codeVariableName;
        return `${variableName}.visibleOnFrame = ${this.visibleOnFrame};\n${variableName}.disabled = ${this.disabled};\n`;
    }
    /**
     * @internal
     */
    _dumpCodeForOutputConnections(alreadyDumped) {
        let codeString = "";
        if (alreadyDumped.indexOf(this) !== -1) {
            return codeString;
        }
        alreadyDumped.push(this);
        for (const input of this.inputs) {
            if (!input.isConnected) {
                continue;
            }
            const connectedOutput = input.connectedPoint;
            const connectedBlock = connectedOutput.ownerBlock;
            codeString += connectedBlock._dumpCodeForOutputConnections(alreadyDumped);
            codeString += `${connectedBlock._codeVariableName}.${connectedBlock._outputRename(connectedOutput.name)}.connectTo(${this._codeVariableName}.${this._inputRename(input.name)});\n`;
        }
        return codeString;
    }
    /**
     * @internal
     */
    _dumpCode(uniqueNames, alreadyDumped) {
        alreadyDumped.push(this);
        // Get unique name
        const nameAsVariableName = this.name.replace(/[^A-Za-z_]+/g, "");
        this._codeVariableName = nameAsVariableName || `${this.getClassName()}_${this.uniqueId}`;
        if (uniqueNames.indexOf(this._codeVariableName) !== -1) {
            let index = 0;
            do {
                index++;
                this._codeVariableName = nameAsVariableName + index;
            } while (uniqueNames.indexOf(this._codeVariableName) !== -1);
        }
        uniqueNames.push(this._codeVariableName);
        // Declaration
        let codeString = `\n// ${this.getClassName()}\n`;
        if (this.comments) {
            codeString += `// ${this.comments}\n`;
        }
        const className = this.getClassName();
        if (className === "RenderGraphInputBlock") {
            const block = this;
            const blockType = block.type;
            codeString += `var ${this._codeVariableName} = new BABYLON.NodeRenderGraphInputBlock("${this.name}", nodeRenderGraph.frameGraph, scene, BABYLON.NodeRenderGraphBlockConnectionPointTypes.${_Types_nodeRenderGraphTypes_js__WEBPACK_IMPORTED_MODULE_4__/* .NodeRenderGraphBlockConnectionPointTypes */ .tp[blockType]});\n`;
        }
        else {
            if (this._additionalConstructionParameters) {
                codeString += `var ${this._codeVariableName} = new BABYLON.${className}("${this.name}", nodeRenderGraph.frameGraph, scene, ...${JSON.stringify(this._additionalConstructionParameters)});\n`;
            }
            else {
                codeString += `var ${this._codeVariableName} = new BABYLON.${className}("${this.name}", nodeRenderGraph.frameGraph, scene);\n`;
            }
        }
        // Properties
        codeString += this._dumpPropertiesCode() + "\n";
        // Inputs
        for (const input of this.inputs) {
            if (!input.isConnected) {
                continue;
            }
            const connectedOutput = input.connectedPoint;
            const connectedBlock = connectedOutput.ownerBlock;
            if (alreadyDumped.indexOf(connectedBlock) === -1) {
                codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        // Outputs
        for (const output of this.outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                const connectedBlock = endpoint.ownerBlock;
                if (connectedBlock && alreadyDumped.indexOf(connectedBlock) === -1) {
                    codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);
                }
            }
        }
        return codeString;
    }
    /**
     * Clone the current block to a new identical block
     * @returns a copy of the current block
     */
    clone() {
        const serializationObject = this.serialize();
        const blockType = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__/* .GetClass */ .n9)(serializationObject.customType);
        if (blockType) {
            const additionalConstructionParameters = serializationObject.additionalConstructionParameters;
            const block = additionalConstructionParameters
                ? new blockType("", this._frameGraph, this._scene, ...additionalConstructionParameters)
                : new blockType("", this._frameGraph, this._scene);
            block._deserialize(serializationObject);
            return block;
        }
        return null;
    }
    /**
     * Release resources
     */
    dispose() {
        for (const input of this.inputs) {
            input.dispose();
        }
        for (const output of this.outputs) {
            output.dispose();
        }
        this._frameGraphTask?.dispose();
        this._frameGraphTask = undefined;
        this.onBuildObservable.clear();
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)("comment")
], NodeRenderGraphBlock.prototype, "comments", void 0);
//# sourceMappingURL=nodeRenderGraphBlock.js.map

/***/ }),

/***/ 46566:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   t: () => (/* binding */ NodeRenderGraphConnectionPoint)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _Types_nodeRenderGraphTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29388);


/**
 * Defines a connection point for a block
 */
class NodeRenderGraphConnectionPoint {
    /** Gets the direction of the point */
    get direction() {
        return this._direction;
    }
    /**
     * Gets or sets the connection point type (default is Undefined)
     */
    get type() {
        if (this._type === _Types_nodeRenderGraphTypes_js__WEBPACK_IMPORTED_MODULE_1__/* .NodeRenderGraphBlockConnectionPointTypes */ .tp.AutoDetect) {
            if (this._ownerBlock.isInput) {
                return this._ownerBlock.type;
            }
            if (this._connectedPoint) {
                return this._connectedPoint.type;
            }
            if (this._linkedConnectionSource) {
                if (this._linkedConnectionSource.isConnected) {
                    return this._linkedConnectionSource.type;
                }
                if (this._linkedConnectionSource._defaultConnectionPointType) {
                    return this._linkedConnectionSource._defaultConnectionPointType;
                }
            }
            if (this._defaultConnectionPointType) {
                return this._defaultConnectionPointType;
            }
        }
        if (this._type === _Types_nodeRenderGraphTypes_js__WEBPACK_IMPORTED_MODULE_1__/* .NodeRenderGraphBlockConnectionPointTypes */ .tp.BasedOnInput) {
            if (this._typeConnectionSource) {
                const typeConnectionSource = typeof this._typeConnectionSource === "function" ? this._typeConnectionSource() : this._typeConnectionSource;
                if (!typeConnectionSource.isConnected) {
                    return this._defaultConnectionPointType ?? typeConnectionSource.type;
                }
                return typeConnectionSource._connectedPoint.type;
            }
            else if (this._defaultConnectionPointType) {
                return this._defaultConnectionPointType;
            }
        }
        return this._type;
    }
    set type(value) {
        this._type = value;
    }
    /**
     * Gets a boolean indicating that the current point is connected to another NodeRenderGraphBlock
     */
    get isConnected() {
        return this.connectedPoint !== null || this.hasEndpoints;
    }
    /** Get the other side of the connection (if any) */
    get connectedPoint() {
        return this._connectedPoint;
    }
    /** Get the block that owns this connection point */
    get ownerBlock() {
        return this._ownerBlock;
    }
    /** Get the block connected on the other side of this connection (if any) */
    get sourceBlock() {
        if (!this._connectedPoint) {
            return null;
        }
        return this._connectedPoint.ownerBlock;
    }
    /** Get the block connected on the endpoints of this connection (if any) */
    get connectedBlocks() {
        if (this._endpoints.length === 0) {
            return [];
        }
        return this._endpoints.map((e) => e.ownerBlock);
    }
    /** Gets the list of connected endpoints */
    get endpoints() {
        return this._endpoints;
    }
    /** Gets a boolean indicating if that output point is connected to at least one input */
    get hasEndpoints() {
        return this._endpoints && this._endpoints.length > 0;
    }
    /** Get the inner type (ie AutoDetect for instance instead of the inferred one) */
    get innerType() {
        if (this._linkedConnectionSource && this._linkedConnectionSource.isConnected) {
            return this.type;
        }
        return this._type;
    }
    /**
     * Creates a new connection point
     * @param name defines the connection point name
     * @param ownerBlock defines the block hosting this connection point
     * @param direction defines the direction of the connection point
     */
    constructor(name, ownerBlock, direction) {
        this._connectedPoint = null;
        /** @internal */
        this._acceptedConnectionPointType = null;
        this._endpoints = new Array();
        this._type = _Types_nodeRenderGraphTypes_js__WEBPACK_IMPORTED_MODULE_1__/* .NodeRenderGraphBlockConnectionPointTypes */ .tp.Undefined;
        /** @internal */
        this._linkedConnectionSource = null;
        /** @internal */
        this._typeConnectionSource = null;
        /** @internal */
        this._defaultConnectionPointType = null;
        /**
         * Gets or sets the additional types supported by this connection point
         */
        this.acceptedConnectionPointTypes = [];
        /**
         * Gets or sets the additional types excluded by this connection point
         */
        this.excludedConnectionPointTypes = [];
        /**
         * Observable triggered when this point is connected
         */
        this.onConnectionObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * Observable triggered when this point is disconnected
         */
        this.onDisconnectionObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * Gets or sets a boolean indicating that this connection point is exposed on a frame
         */
        this.isExposedOnFrame = false;
        /**
         * Gets or sets number indicating the position that the port is exposed to on a frame
         */
        this.exposedPortPosition = -1;
        this._ownerBlock = ownerBlock;
        this.name = name;
        this._direction = direction;
    }
    /**
     * Gets the current class name e.g. "NodeRenderGraphConnectionPoint"
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphConnectionPoint";
    }
    /**
     * Gets a boolean indicating if the current point can be connected to another point
     * @param connectionPoint defines the other connection point
     * @returns a boolean
     */
    canConnectTo(connectionPoint) {
        return this.checkCompatibilityState(connectionPoint) === 0 /* NodeRenderGraphConnectionPointCompatibilityStates.Compatible */;
    }
    /**
     * Gets a number indicating if the current point can be connected to another point
     * @param connectionPoint defines the other connection point
     * @returns a number defining the compatibility state
     */
    checkCompatibilityState(connectionPoint) {
        const ownerBlock = this._ownerBlock;
        const otherBlock = connectionPoint.ownerBlock;
        if (this.type !== connectionPoint.type && connectionPoint.innerType !== _Types_nodeRenderGraphTypes_js__WEBPACK_IMPORTED_MODULE_1__/* .NodeRenderGraphBlockConnectionPointTypes */ .tp.AutoDetect) {
            // Accepted types
            if (connectionPoint.acceptedConnectionPointTypes && connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) !== -1) {
                return 0 /* NodeRenderGraphConnectionPointCompatibilityStates.Compatible */;
            }
            else {
                return 1 /* NodeRenderGraphConnectionPointCompatibilityStates.TypeIncompatible */;
            }
        }
        // Excluded
        if (connectionPoint.excludedConnectionPointTypes && connectionPoint.excludedConnectionPointTypes.indexOf(this.type) !== -1) {
            return 1 /* NodeRenderGraphConnectionPointCompatibilityStates.TypeIncompatible */;
        }
        // Check hierarchy
        let targetBlock = otherBlock;
        let sourceBlock = ownerBlock;
        if (this.direction === 0 /* NodeRenderGraphConnectionPointDirection.Input */) {
            targetBlock = ownerBlock;
            sourceBlock = otherBlock;
        }
        if (targetBlock.isAnAncestorOf(sourceBlock)) {
            return 2 /* NodeRenderGraphConnectionPointCompatibilityStates.HierarchyIssue */;
        }
        return 0 /* NodeRenderGraphConnectionPointCompatibilityStates.Compatible */;
    }
    /**
     * Connect this point to another connection point
     * @param connectionPoint defines the other connection point
     * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)
     * @returns the current connection point
     */
    connectTo(connectionPoint, ignoreConstraints = false) {
        if (!ignoreConstraints && !this.canConnectTo(connectionPoint)) {
            // eslint-disable-next-line no-throw-literal
            throw "Cannot connect these two connectors.";
        }
        this._endpoints.push(connectionPoint);
        connectionPoint._connectedPoint = this;
        this.onConnectionObservable.notifyObservers(connectionPoint);
        connectionPoint.onConnectionObservable.notifyObservers(this);
        return this;
    }
    /**
     * Disconnect this point from one of his endpoint
     * @param endpoint defines the other connection point
     * @returns the current connection point
     */
    disconnectFrom(endpoint) {
        const index = this._endpoints.indexOf(endpoint);
        if (index === -1) {
            return this;
        }
        this._endpoints.splice(index, 1);
        endpoint._connectedPoint = null;
        this.onDisconnectionObservable.notifyObservers(endpoint);
        endpoint.onDisconnectionObservable.notifyObservers(this);
        return this;
    }
    /**
     * Fills the list of excluded connection point types with all types other than those passed in the parameter
     * @param mask Types (ORed values of NodeRenderGraphBlockConnectionPointTypes) that are allowed, and thus will not be pushed to the excluded list
     */
    addExcludedConnectionPointFromAllowedTypes(mask) {
        let bitmask = 0;
        let val = 2 ** bitmask;
        // Note: don't use 1 << bitmask instead of 2 ** bitmask, as it will cause an infinite loop because 1 << 31 is negative!
        while (val < _Types_nodeRenderGraphTypes_js__WEBPACK_IMPORTED_MODULE_1__/* .NodeRenderGraphBlockConnectionPointTypes */ .tp.All) {
            if (!(mask & val)) {
                this.excludedConnectionPointTypes.push(val);
            }
            bitmask++;
            val = 2 ** bitmask;
        }
    }
    /**
     * Adds accepted connection point types
     * @param mask Types (ORed values of NodeRenderGraphBlockConnectionPointTypes) that are allowed to connect to this point
     */
    addAcceptedConnectionPointTypes(mask) {
        let bitmask = 0;
        let val = 2 ** bitmask;
        // Note: don't use 1 << bitmask instead of 2 ** bitmask, as it will cause an infinite loop because 1 << 31 is negative!
        while (val < _Types_nodeRenderGraphTypes_js__WEBPACK_IMPORTED_MODULE_1__/* .NodeRenderGraphBlockConnectionPointTypes */ .tp.All) {
            if (mask & val && this.acceptedConnectionPointTypes.indexOf(val) === -1) {
                this.acceptedConnectionPointTypes.push(val);
            }
            bitmask++;
            val = 2 ** bitmask;
        }
    }
    /**
     * Serializes this point in a JSON representation
     * @param isInput defines if the connection point is an input (default is true)
     * @returns the serialized point object
     */
    serialize(isInput = true) {
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.displayName = this.displayName;
        if (isInput && this.connectedPoint) {
            serializationObject.inputName = this.name;
            serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId;
            serializationObject.targetConnectionName = this.connectedPoint.name;
            serializationObject.isExposedOnFrame = true;
            serializationObject.exposedPortPosition = this.exposedPortPosition;
        }
        if (this.isExposedOnFrame || this.exposedPortPosition >= 0) {
            serializationObject.isExposedOnFrame = true;
            serializationObject.exposedPortPosition = this.exposedPortPosition;
        }
        return serializationObject;
    }
    /**
     * Release resources
     */
    dispose() {
        this.onConnectionObservable.clear();
        this.onDisconnectionObservable.clear();
    }
}
//# sourceMappingURL=nodeRenderGraphBlockConnectionPoint.js.map

/***/ }),

/***/ 65021:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   x: () => (/* binding */ FrameGraphCullPass)
/* harmony export */ });
/* harmony import */ var _pass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6785);

/**
 * Cull pass used to filter objects that are not visible.
 */
class FrameGraphCullPass extends _pass_js__WEBPACK_IMPORTED_MODULE_0__/* .FrameGraphPass */ .X {
    /**
     * Checks if a pass is a cull pass.
     * @param pass The pass to check.
     * @returns True if the pass is a cull pass, else false.
     */
    static IsCullPass(pass) {
        return pass.setObjectList !== undefined;
    }
    /**
     * Gets the object list used by the cull pass.
     */
    get objectList() {
        return this._objectList;
    }
    /**
     * Sets the object list to use for culling.
     * @param objectList The object list to use for culling.
     */
    setObjectList(objectList) {
        this._objectList = objectList;
    }
    /** @internal */
    constructor(name, parentTask, context, engine) {
        super(name, parentTask, context);
        this._engine = engine;
    }
    /** @internal */
    _isValid() {
        const errMsg = super._isValid();
        return errMsg ? errMsg : this._objectList !== undefined ? null : "Object list is not set (call setObjectList to set it)";
    }
}
//# sourceMappingURL=cullPass.js.map

/***/ }),

/***/ 6785:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   X: () => (/* binding */ FrameGraphPass)
/* harmony export */ });
/**
 * @internal
 */
class FrameGraphPass {
    constructor(name, _parentTask, _context) {
        this.name = name;
        this._parentTask = _parentTask;
        this._context = _context;
    }
    setExecuteFunc(func) {
        this._executeFunc = func;
    }
    _execute() {
        this._executeFunc(this._context);
    }
    _isValid() {
        return this._executeFunc !== undefined ? null : "Execute function is not set (call setExecuteFunc to set it)";
    }
}
//# sourceMappingURL=pass.js.map

/***/ }),

/***/ 91133:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   p: () => (/* binding */ FrameGraphRenderPass)
/* harmony export */ });
/* harmony import */ var _pass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6785);

/**
 * Render pass used to render objects.
 */
class FrameGraphRenderPass extends _pass_js__WEBPACK_IMPORTED_MODULE_0__/* .FrameGraphPass */ .X {
    /**
     * Checks if a pass is a render pass.
     * @param pass The pass to check.
     * @returns True if the pass is a render pass, else false.
     */
    static IsRenderPass(pass) {
        return pass.setRenderTarget !== undefined;
    }
    /**
     * Gets the render target(s) used by the render pass.
     */
    get renderTarget() {
        return this._renderTarget;
    }
    /**
     * Gets the render target depth used by the render pass.
     */
    get renderTargetDepth() {
        return this._renderTargetDepth;
    }
    /** @internal */
    constructor(name, parentTask, context, engine) {
        super(name, parentTask, context);
        this._usedTextures = [];
        this._engine = engine;
    }
    /**
     * Indicates that the pass will use the given texture.
     * Use this method to indicate that the pass will use a texture so that the frame graph can handle the texture's lifecycle.
     * You don't have to call this method for the render target / render target depth textures.
     * @param texture The texture used.
     */
    useTexture(texture) {
        this._usedTextures.push(texture);
    }
    /**
     * Sets the render target(s) to use for rendering.
     * @param renderTargetHandle The render target to use for rendering, or an array of render targets to use for multi render target rendering.
     */
    setRenderTarget(renderTargetHandle) {
        this._renderTarget = renderTargetHandle;
    }
    /**
     * Sets the render target depth to use for rendering.
     * @param renderTargetHandle The render target depth to use for rendering.
     */
    setRenderTargetDepth(renderTargetHandle) {
        this._renderTargetDepth = renderTargetHandle;
    }
    /** @internal */
    _execute() {
        this._frameGraphRenderTarget = this._frameGraphRenderTarget || this._context.createRenderTarget(this.name, this._renderTarget, this._renderTargetDepth);
        this._context.bindRenderTarget(this._frameGraphRenderTarget, `frame graph render pass - ${this.name}`);
        super._execute();
        this._context._flushDebugMessages();
    }
    /** @internal */
    _isValid() {
        const errMsg = super._isValid();
        return errMsg
            ? errMsg
            : this._renderTarget !== undefined || this.renderTargetDepth !== undefined
                ? null
                : "Render target and render target depth cannot both be undefined.";
    }
}
//# sourceMappingURL=renderPass.js.map

/***/ }),

/***/ 43314:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   L: () => (/* binding */ FrameGraphTask)
/* harmony export */ });
/* harmony import */ var _Passes_cullPass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65021);
/* harmony import */ var _Passes_renderPass_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(91133);


/**
 * Represents a task in a frame graph.
 * @experimental
 */
class FrameGraphTask {
    /**
     * The name of the task.
     */
    get name() {
        return this._name;
    }
    set name(value) {
        this._name = value;
    }
    /**
     * Whether the task is disabled.
     */
    get disabled() {
        return this._disabled;
    }
    set disabled(value) {
        this._disabled = value;
    }
    /**
     * Checks if the task is ready to be executed.
     * @returns True if the task is ready to be executed, else false.
     */
    isReady() {
        return true;
    }
    /**
     * Disposes of the task.
     */
    dispose() {
        this._reset();
    }
    /**
     * Constructs a new frame graph task.
     * @param name The name of the task.
     * @param frameGraph The frame graph this task is associated with.
     */
    constructor(name, frameGraph) {
        this._passes = [];
        this._passesDisabled = [];
        this._disabled = false;
        this.name = name;
        this._frameGraph = frameGraph;
        this._reset();
    }
    /** @internal */
    _reset() {
        this._passes.length = 0;
        this._passesDisabled.length = 0;
    }
    /** @internal */
    _addPass(pass, disabled) {
        if (disabled) {
            this._passesDisabled.push(pass);
        }
        else {
            this._passes.push(pass);
        }
    }
    /** @internal */
    _checkTask() {
        let outputTexture = null;
        let outputDepthTexture = null;
        let outputObjectList;
        for (const pass of this._passes) {
            const errMsg = pass._isValid();
            if (errMsg) {
                throw new Error(`Pass "${pass.name}" is not valid. ${errMsg}`);
            }
            if (_Passes_renderPass_js__WEBPACK_IMPORTED_MODULE_1__/* .FrameGraphRenderPass */ .p.IsRenderPass(pass)) {
                const handles = Array.isArray(pass.renderTarget) ? pass.renderTarget : [pass.renderTarget];
                outputTexture = [];
                for (const handle of handles) {
                    if (handle !== undefined) {
                        outputTexture.push(this._frameGraph.textureManager.getTextureFromHandle(handle));
                    }
                }
                outputDepthTexture = pass.renderTargetDepth !== undefined ? this._frameGraph.textureManager.getTextureFromHandle(pass.renderTargetDepth) : null;
            }
            else if (_Passes_cullPass_js__WEBPACK_IMPORTED_MODULE_0__/* .FrameGraphCullPass */ .x.IsCullPass(pass)) {
                outputObjectList = pass.objectList;
            }
        }
        let disabledOutputTexture = null;
        let disabledOutputTextureHandle = [];
        let disabledOutputDepthTexture = null;
        let disabledOutputObjectList;
        for (const pass of this._passesDisabled) {
            const errMsg = pass._isValid();
            if (errMsg) {
                throw new Error(`Pass "${pass.name}" is not valid. ${errMsg}`);
            }
            if (_Passes_renderPass_js__WEBPACK_IMPORTED_MODULE_1__/* .FrameGraphRenderPass */ .p.IsRenderPass(pass)) {
                const handles = Array.isArray(pass.renderTarget) ? pass.renderTarget : [pass.renderTarget];
                disabledOutputTexture = [];
                for (const handle of handles) {
                    if (handle !== undefined) {
                        disabledOutputTexture.push(this._frameGraph.textureManager.getTextureFromHandle(handle));
                    }
                }
                disabledOutputTextureHandle = handles;
                disabledOutputDepthTexture = pass.renderTargetDepth !== undefined ? this._frameGraph.textureManager.getTextureFromHandle(pass.renderTargetDepth) : null;
            }
            else if (_Passes_cullPass_js__WEBPACK_IMPORTED_MODULE_0__/* .FrameGraphCullPass */ .x.IsCullPass(pass)) {
                disabledOutputObjectList = pass.objectList;
            }
        }
        if (this._passesDisabled.length > 0) {
            if (!this._checkSameRenderTarget(outputTexture, disabledOutputTexture)) {
                let ok = true;
                for (const handle of disabledOutputTextureHandle) {
                    if (handle !== undefined && !this._frameGraph.textureManager.isHistoryTexture(handle)) {
                        ok = false;
                        break;
                    }
                }
                if (!ok) {
                    throw new Error(`The output texture of the task "${this.name}" is different when it is enabled or disabled.`);
                }
            }
            if (outputDepthTexture !== disabledOutputDepthTexture) {
                throw new Error(`The output depth texture of the task "${this.name}" is different when it is enabled or disabled.`);
            }
            if (outputObjectList !== disabledOutputObjectList) {
                throw new Error(`The output object list of the task "${this.name}" is different when it is enabled or disabled.`);
            }
        }
    }
    /** @internal */
    _getPasses() {
        return this.disabled && this._passesDisabled.length > 0 ? this._passesDisabled : this._passes;
    }
    _checkSameRenderTarget(src, dst) {
        if (src === null || dst === null) {
            return src === dst;
        }
        if (src.length !== dst.length) {
            return false;
        }
        for (let i = 0; i < src.length; i++) {
            if (src[i] !== dst[i]) {
                return false;
            }
        }
        return true;
    }
}
//# sourceMappingURL=frameGraphTask.js.map

/***/ }),

/***/ 56956:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Fq: () => (/* binding */ Gizmo),
/* harmony export */   oO: () => (/* binding */ GizmoAnchorPoint),
/* harmony export */   ry: () => (/* binding */ GizmoCoordinatesMode)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76595);
/* harmony import */ var _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30388);
/* harmony import */ var _Rendering_utilityLayerRenderer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14797);
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66240);
/* harmony import */ var _Lights_light_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64704);






/**
 * Anchor options where the Gizmo can be positioned in relation to its anchored node
 */
var GizmoAnchorPoint;
(function (GizmoAnchorPoint) {
    /** The origin of the attached node */
    GizmoAnchorPoint[GizmoAnchorPoint["Origin"] = 0] = "Origin";
    /** The pivot point of the attached node*/
    GizmoAnchorPoint[GizmoAnchorPoint["Pivot"] = 1] = "Pivot";
})(GizmoAnchorPoint || (GizmoAnchorPoint = {}));
/**
 * Coordinates mode: Local or World. Defines how axis is aligned: either on world axis or transform local axis
 */
var GizmoCoordinatesMode;
(function (GizmoCoordinatesMode) {
    GizmoCoordinatesMode[GizmoCoordinatesMode["World"] = 0] = "World";
    GizmoCoordinatesMode[GizmoCoordinatesMode["Local"] = 1] = "Local";
})(GizmoCoordinatesMode || (GizmoCoordinatesMode = {}));
/**
 * Renders gizmos on top of an existing scene which provide controls for position, rotation, etc.
 */
class Gizmo {
    /**
     * Ratio for the scale of the gizmo (Default: 1)
     */
    set scaleRatio(value) {
        this._scaleRatio = value;
    }
    get scaleRatio() {
        return this._scaleRatio;
    }
    /**
     * True when the mouse pointer is hovered a gizmo mesh
     */
    get isHovered() {
        return this._isHovered;
    }
    /**
     * Mesh that the gizmo will be attached to. (eg. on a drag gizmo the mesh that will be dragged)
     * * When set, interactions will be enabled
     */
    get attachedMesh() {
        return this._attachedMesh;
    }
    set attachedMesh(value) {
        this._attachedMesh = value;
        if (value) {
            this._attachedNode = value;
        }
        this._rootMesh.setEnabled(value ? true : false);
        this._attachedNodeChanged(value);
    }
    /**
     * Node that the gizmo will be attached to. (eg. on a drag gizmo the mesh, bone or NodeTransform that will be dragged)
     * * When set, interactions will be enabled
     */
    get attachedNode() {
        return this._attachedNode;
    }
    set attachedNode(value) {
        this._attachedNode = value;
        this._attachedMesh = null;
        this._rootMesh.setEnabled(value ? true : false);
        this._attachedNodeChanged(value);
    }
    /**
     * Disposes and replaces the current meshes in the gizmo with the specified mesh
     * @param mesh The mesh to replace the default mesh of the gizmo
     */
    setCustomMesh(mesh) {
        if (mesh.getScene() != this.gizmoLayer.utilityLayerScene) {
            // eslint-disable-next-line no-throw-literal
            throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";
        }
        this._rootMesh.getChildMeshes().forEach((c) => {
            c.dispose();
        });
        mesh.parent = this._rootMesh;
        this._customMeshSet = true;
    }
    /**
     * Additional transform applied to the gizmo.
     * It's useful when the gizmo is attached to a bone: if the bone is part of a skeleton attached to a mesh, you should define the mesh as additionalTransformNode if you want the gizmo to be displayed at the bone's correct location.
     * Otherwise, as the gizmo is relative to the skeleton root, the mesh transformation will not be taken into account.
     */
    get additionalTransformNode() {
        return this._additionalTransformNode;
    }
    set additionalTransformNode(value) {
        this._additionalTransformNode = value;
    }
    /**
     * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
     * NOTE: This is only possible for meshes with uniform scaling, as otherwise it's not possible to decompose the rotation
     */
    set updateGizmoRotationToMatchAttachedMesh(value) {
        this._updateGizmoRotationToMatchAttachedMesh = value;
    }
    get updateGizmoRotationToMatchAttachedMesh() {
        return this._updateGizmoRotationToMatchAttachedMesh;
    }
    /**
     * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
     */
    set updateGizmoPositionToMatchAttachedMesh(value) {
        this._updateGizmoPositionToMatchAttachedMesh = value;
    }
    get updateGizmoPositionToMatchAttachedMesh() {
        return this._updateGizmoPositionToMatchAttachedMesh;
    }
    /**
     * Defines where the gizmo will be positioned if `updateGizmoPositionToMatchAttachedMesh` is enabled.
     * (Default: GizmoAnchorPoint.Origin)
     */
    set anchorPoint(value) {
        this._anchorPoint = value;
    }
    get anchorPoint() {
        return this._anchorPoint;
    }
    /**
     * Set the coordinate system to use. By default it's local.
     * But it's possible for a user to tweak so its local for translation and world for rotation.
     * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
     */
    set coordinatesMode(coordinatesMode) {
        this._coordinatesMode = coordinatesMode;
        const local = coordinatesMode == 1 /* GizmoCoordinatesMode.Local */;
        this.updateGizmoRotationToMatchAttachedMesh = local;
        this.updateGizmoPositionToMatchAttachedMesh = true;
    }
    get coordinatesMode() {
        return this._coordinatesMode;
    }
    /**
     * When set, the gizmo will always appear the same size no matter where the camera is (default: true)
     */
    set updateScale(value) {
        this._updateScale = value;
    }
    get updateScale() {
        return this._updateScale;
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _attachedNodeChanged(value) { }
    /**
     * Creates a gizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     */
    constructor(
    /** [Object] The utility layer the gizmo will be added to */
    gizmoLayer = _Rendering_utilityLayerRenderer_js__WEBPACK_IMPORTED_MODULE_3__/* .UtilityLayerRenderer */ .j.DefaultUtilityLayer) {
        this.gizmoLayer = gizmoLayer;
        this._attachedMesh = null;
        this._attachedNode = null;
        this._customRotationQuaternion = null;
        /**
         * Ratio for the scale of the gizmo (Default: 1)
         */
        this._scaleRatio = 1;
        /**
         * boolean updated by pointermove when a gizmo mesh is hovered
         */
        this._isHovered = false;
        /**
         * If a custom mesh has been set (Default: false)
         */
        this._customMeshSet = false;
        this._updateGizmoRotationToMatchAttachedMesh = true;
        this._updateGizmoPositionToMatchAttachedMesh = true;
        this._anchorPoint = 0 /* GizmoAnchorPoint.Origin */;
        this._updateScale = true;
        this._coordinatesMode = 1 /* GizmoCoordinatesMode.Local */;
        this._interactionsEnabled = true;
        this._rightHandtoLeftHandMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.RotationY(Math.PI);
        this._rootMesh = new _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_1__/* .Mesh */ .e("gizmoRootNode", gizmoLayer.utilityLayerScene);
        this._rootMesh.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.Identity();
        this._beforeRenderObserver = this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(() => {
            this._update();
        });
    }
    /**
     * posture that the gizmo will be display
     * When set null, default value will be used (Quaternion(0, 0, 0, 1))
     */
    get customRotationQuaternion() {
        return this._customRotationQuaternion;
    }
    set customRotationQuaternion(customRotationQuaternion) {
        this._customRotationQuaternion = customRotationQuaternion;
    }
    /**
     * Updates the gizmo to match the attached mesh's position/rotation
     */
    _update() {
        if (this.attachedNode) {
            let effectiveNode = this.attachedNode;
            if (this.attachedMesh) {
                effectiveNode = this.attachedMesh || this.attachedNode;
            }
            // Position
            if (this.updateGizmoPositionToMatchAttachedMesh) {
                if (this.anchorPoint == 1 /* GizmoAnchorPoint.Pivot */ && effectiveNode.getAbsolutePivotPoint) {
                    const position = effectiveNode.getAbsolutePivotPoint();
                    this._rootMesh.position.copyFrom(position);
                }
                else {
                    const row = effectiveNode.getWorldMatrix().getRow(3);
                    const position = row ? row.toVector3() : new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, 0);
                    this._rootMesh.position.copyFrom(position);
                }
            }
            // Rotation
            if (this.updateGizmoRotationToMatchAttachedMesh) {
                const supportedNode = effectiveNode._isMesh ||
                    effectiveNode.getClassName() === "AbstractMesh" ||
                    effectiveNode.getClassName() === "TransformNode" ||
                    effectiveNode.getClassName() === "InstancedMesh";
                const transformNode = supportedNode ? effectiveNode : undefined;
                effectiveNode.getWorldMatrix().decompose(undefined, this._rootMesh.rotationQuaternion, undefined, Gizmo.PreserveScaling ? transformNode : undefined);
                this._rootMesh.rotationQuaternion.normalize();
            }
            else {
                if (this._customRotationQuaternion) {
                    this._rootMesh.rotationQuaternion.copyFrom(this._customRotationQuaternion);
                }
                else {
                    this._rootMesh.rotationQuaternion.set(0, 0, 0, 1);
                }
            }
            // Scale
            if (this.updateScale) {
                const activeCamera = this.gizmoLayer.utilityLayerScene.activeCamera;
                const cameraPosition = activeCamera.globalPosition;
                this._rootMesh.position.subtractToRef(cameraPosition, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0]);
                let scale = this.scaleRatio;
                if (activeCamera.mode == _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_2__/* .Camera */ .i.ORTHOGRAPHIC_CAMERA) {
                    if (activeCamera.orthoTop && activeCamera.orthoBottom) {
                        const orthoHeight = activeCamera.orthoTop - activeCamera.orthoBottom;
                        scale *= orthoHeight;
                    }
                }
                else {
                    const camForward = activeCamera.getScene().useRightHandedSystem ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.RightHandedForwardReadOnly : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.LeftHandedForwardReadOnly;
                    const direction = activeCamera.getDirection(camForward);
                    scale *= _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Dot(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0], direction);
                }
                this._rootMesh.scaling.setAll(scale);
                // Account for handedness, similar to Matrix.decompose
                if (effectiveNode._getWorldMatrixDeterminant() < 0 && !Gizmo.PreserveScaling) {
                    this._rootMesh.scaling.y *= -1;
                }
            }
            else {
                this._rootMesh.scaling.setAll(this.scaleRatio);
            }
        }
        if (this.additionalTransformNode) {
            this._rootMesh.computeWorldMatrix(true);
            this._rootMesh.getWorldMatrix().multiplyToRef(this.additionalTransformNode.getWorldMatrix(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0].decompose(this._rootMesh.scaling, this._rootMesh.rotationQuaternion, this._rootMesh.position);
        }
    }
    /**
     * if transform has a pivot and is not using PostMultiplyPivotMatrix, then the worldMatrix contains the pivot matrix (it's not cancelled at the end)
     * so, when extracting the world matrix component, the translation (and other components) is containing the pivot translation.
     * And the pivot is applied each frame. Removing it anyway here makes it applied only in computeWorldMatrix.
     * @param transform local transform that needs to be transform by the pivot inverse matrix
     * @param localMatrix local matrix that needs to be transform by the pivot inverse matrix
     * @param result resulting matrix transformed by pivot inverse if the transform node is using pivot without using post Multiply Pivot Matrix
     */
    _handlePivotMatrixInverse(transform, localMatrix, result) {
        if (transform.isUsingPivotMatrix() && !transform.isUsingPostMultiplyPivotMatrix()) {
            transform.getPivotMatrix().invertToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[5]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[5].multiplyToRef(localMatrix, result);
            return;
        }
        result.copyFrom(localMatrix);
    }
    /**
     * computes the rotation/scaling/position of the transform once the Node world matrix has changed.
     */
    _matrixChanged() {
        if (!this._attachedNode) {
            return;
        }
        if (this._attachedNode._isCamera) {
            const camera = this._attachedNode;
            let worldMatrix;
            let worldMatrixUC;
            if (camera.parent) {
                const parentInv = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[1];
                camera.parent._worldMatrix.invertToRef(parentInv);
                this._attachedNode._worldMatrix.multiplyToRef(parentInv, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0]);
                worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0];
            }
            else {
                worldMatrix = this._attachedNode._worldMatrix;
            }
            if (camera.getScene().useRightHandedSystem) {
                // avoid desync with RH matrix computation. Otherwise, rotation of PI around Y axis happens each frame resulting in axis flipped because worldMatrix is computed as inverse of viewMatrix.
                this._rightHandtoLeftHandMatrix.multiplyToRef(worldMatrix, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[1]);
                worldMatrixUC = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[1];
            }
            else {
                worldMatrixUC = worldMatrix;
            }
            worldMatrixUC.decompose(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[1], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0]);
            const inheritsTargetCamera = this._attachedNode.getClassName() === "FreeCamera" ||
                this._attachedNode.getClassName() === "FlyCamera" ||
                this._attachedNode.getClassName() === "ArcFollowCamera" ||
                this._attachedNode.getClassName() === "TargetCamera" ||
                this._attachedNode.getClassName() === "TouchCamera" ||
                this._attachedNode.getClassName() === "UniversalCamera";
            if (inheritsTargetCamera) {
                const targetCamera = this._attachedNode;
                targetCamera.rotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0].toEulerAngles();
                if (targetCamera.rotationQuaternion) {
                    targetCamera.rotationQuaternion.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0]);
                    targetCamera.rotationQuaternion.normalize();
                }
            }
            camera.position.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0]);
        }
        else if (this._attachedNode._isMesh ||
            this._attachedNode.getClassName() === "AbstractMesh" ||
            this._attachedNode.getClassName() === "TransformNode" ||
            this._attachedNode.getClassName() === "InstancedMesh") {
            const transform = this._attachedNode;
            if (transform.parent) {
                const parentInv = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0];
                const localMat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[1];
                transform.parent.getWorldMatrix().invertToRef(parentInv);
                this._attachedNode.getWorldMatrix().multiplyToRef(parentInv, localMat);
                const matrixToDecompose = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[4];
                this._handlePivotMatrixInverse(transform, localMat, matrixToDecompose);
                matrixToDecompose.decompose(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0], transform.position, Gizmo.PreserveScaling ? transform : undefined, Gizmo.UseAbsoluteScaling);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0].normalize();
                if (transform.isUsingPivotMatrix()) {
                    // Calculate the local matrix without the translation.
                    // Copied from TranslateNode.computeWorldMatrix
                    const r = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[1];
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationYawPitchRollToRef(transform.rotation.y, transform.rotation.x, transform.rotation.z, r);
                    const scaleMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[2];
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.ScalingToRef(transform.scaling.x, transform.scaling.y, transform.scaling.z, scaleMatrix);
                    const rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[2];
                    r.toRotationMatrix(rotationMatrix);
                    const pivotMatrix = transform.getPivotMatrix();
                    const invPivotMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[3];
                    pivotMatrix.invertToRef(invPivotMatrix);
                    pivotMatrix.multiplyToRef(scaleMatrix, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[4]);
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[4].multiplyToRef(rotationMatrix, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[5]);
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[5].multiplyToRef(invPivotMatrix, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[6]);
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[6].getTranslationToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[1]);
                    transform.position.subtractInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[1]);
                }
            }
            else {
                const matrixToDecompose = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[4];
                this._handlePivotMatrixInverse(transform, this._attachedNode._worldMatrix, matrixToDecompose);
                matrixToDecompose.decompose(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0], transform.position, Gizmo.PreserveScaling ? transform : undefined, Gizmo.UseAbsoluteScaling);
            }
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0].scaleInPlace(1.0 / transform.scalingDeterminant);
            transform.scaling.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0]);
            if (!transform.billboardMode) {
                if (transform.rotationQuaternion) {
                    transform.rotationQuaternion.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0]);
                    transform.rotationQuaternion.normalize();
                }
                else {
                    transform.rotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0].toEulerAngles();
                }
            }
        }
        else if (this._attachedNode.getClassName() === "Bone") {
            const bone = this._attachedNode;
            const parent = bone.getParent();
            if (parent) {
                const invParent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0];
                const boneLocalMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[1];
                parent.getFinalMatrix().invertToRef(invParent);
                bone.getFinalMatrix().multiplyToRef(invParent, boneLocalMatrix);
                const lmat = bone.getLocalMatrix();
                lmat.copyFrom(boneLocalMatrix);
            }
            else {
                const lmat = bone.getLocalMatrix();
                lmat.copyFrom(bone.getFinalMatrix());
            }
            bone.markAsDirty();
        }
        else {
            const light = this._attachedNode;
            if (light.getTypeID) {
                const type = light.getTypeID();
                if (type === _Lights_light_js__WEBPACK_IMPORTED_MODULE_5__/* .Light */ .v.LIGHTTYPEID_DIRECTIONALLIGHT || type === _Lights_light_js__WEBPACK_IMPORTED_MODULE_5__/* .Light */ .v.LIGHTTYPEID_SPOTLIGHT || type === _Lights_light_js__WEBPACK_IMPORTED_MODULE_5__/* .Light */ .v.LIGHTTYPEID_POINTLIGHT) {
                    const parent = light.parent;
                    if (parent) {
                        const invParent = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[0];
                        const nodeLocalMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[1];
                        parent.getWorldMatrix().invertToRef(invParent);
                        light.getWorldMatrix().multiplyToRef(invParent, nodeLocalMatrix);
                        nodeLocalMatrix.decompose(undefined, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0]);
                    }
                    else {
                        this._attachedNode._worldMatrix.decompose(undefined, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0]);
                    }
                    // setter doesn't copy values. Need a new Vector3
                    light.position = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0].x, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0].y, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0].z);
                    if (light.direction) {
                        light.direction = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(light.direction.x, light.direction.y, light.direction.z);
                    }
                }
            }
        }
    }
    /**
     * refresh gizmo mesh material
     * @param gizmoMeshes
     * @param material material to apply
     */
    _setGizmoMeshMaterial(gizmoMeshes, material) {
        if (gizmoMeshes) {
            gizmoMeshes.forEach((m) => {
                m.material = material;
                if (m.color) {
                    m.color = material.diffuseColor;
                }
            });
        }
    }
    /**
     * Subscribes to pointer up, down, and hover events. Used for responsive gizmos.
     * @param gizmoLayer The utility layer the gizmo will be added to
     * @param gizmoAxisCache Gizmo axis definition used for reactive gizmo UI
     * @returns {Observer<PointerInfo>} pointerObserver
     */
    static GizmoAxisPointerObserver(gizmoLayer, gizmoAxisCache) {
        let dragging = false;
        const pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
            if (pointerInfo.pickInfo) {
                // On Hover Logic
                if (pointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERMOVE) {
                    if (dragging) {
                        return;
                    }
                    gizmoAxisCache.forEach((cache) => {
                        if (cache.colliderMeshes && cache.gizmoMeshes) {
                            const isHovered = cache.colliderMeshes?.indexOf(pointerInfo?.pickInfo?.pickedMesh) != -1;
                            const material = cache.dragBehavior.enabled ? (isHovered || cache.active ? cache.hoverMaterial : cache.material) : cache.disableMaterial;
                            cache.gizmoMeshes.forEach((m) => {
                                m.material = material;
                                if (m.color) {
                                    m.color = material.diffuseColor;
                                }
                            });
                        }
                    });
                }
                // On Mouse Down
                if (pointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERDOWN) {
                    // If user Clicked Gizmo
                    if (gizmoAxisCache.has(pointerInfo.pickInfo.pickedMesh?.parent)) {
                        dragging = true;
                        const statusMap = gizmoAxisCache.get(pointerInfo.pickInfo.pickedMesh?.parent);
                        statusMap.active = true;
                        gizmoAxisCache.forEach((cache) => {
                            const isHovered = cache.colliderMeshes?.indexOf(pointerInfo?.pickInfo?.pickedMesh) != -1;
                            const material = (isHovered || cache.active) && cache.dragBehavior.enabled ? cache.hoverMaterial : cache.disableMaterial;
                            cache.gizmoMeshes.forEach((m) => {
                                m.material = material;
                                if (m.color) {
                                    m.color = material.diffuseColor;
                                }
                            });
                        });
                    }
                }
                // On Mouse Up
                if (pointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_4__/* .PointerEventTypes */ .Zp.POINTERUP) {
                    gizmoAxisCache.forEach((cache) => {
                        cache.active = false;
                        dragging = false;
                        cache.gizmoMeshes.forEach((m) => {
                            m.material = cache.dragBehavior.enabled ? cache.material : cache.disableMaterial;
                            if (m.color) {
                                m.color = cache.material.diffuseColor;
                            }
                        });
                    });
                }
            }
        });
        return pointerObserver;
    }
    /**
     * Disposes of the gizmo
     */
    dispose() {
        this._rootMesh.dispose();
        if (this._beforeRenderObserver) {
            this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver);
        }
    }
}
/**
 * When enabled, any gizmo operation will perserve scaling sign. Default is off.
 * Only valid for TransformNode derived classes (Mesh, AbstractMesh, ...)
 */
Gizmo.PreserveScaling = false;
/**
 * There are 2 ways to preserve scaling: using mesh scaling or absolute scaling. Depending of hierarchy, non uniform scaling and LH or RH coordinates. One is preferable than the other.
 * If the scaling to be preserved is the local scaling, then set this value to false.
 * Default is true which means scaling to be preserved is absolute one (with hierarchy applied)
 */
Gizmo.UseAbsoluteScaling = true;
//# sourceMappingURL=gizmo.js.map

/***/ }),

/***/ 22230:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   W: () => (/* binding */ Layer)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26041);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6315);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95616);
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28986);
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7481);
/* harmony import */ var _sceneComponent_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(16945);
/* harmony import */ var _layerSceneComponent_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(75561);
/* harmony import */ var _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(35476);











/**
 * This represents a full screen 2d layer.
 * This can be useful to display a picture in the  background of your scene for instance.
 * @see https://www.babylonjs-playground.com/#08A2BS#1
 */
class Layer {
    /**
     * Determines if the layer is drawn before (true) or after (false) post-processing.
     * If the layer is background, it is always before.
     */
    set applyPostProcess(value) {
        this._applyPostProcess = value;
    }
    get applyPostProcess() {
        return this.isBackground || this._applyPostProcess;
    }
    /**
     * Back compatibility with callback before the onDisposeObservable existed.
     * The set callback will be triggered when the layer has been disposed.
     */
    set onDispose(callback) {
        if (this._onDisposeObserver) {
            this.onDisposeObservable.remove(this._onDisposeObserver);
        }
        this._onDisposeObserver = this.onDisposeObservable.add(callback);
    }
    /**
     * Back compatibility with callback before the onBeforeRenderObservable existed.
     * The set callback will be triggered just before rendering the layer.
     */
    set onBeforeRender(callback) {
        if (this._onBeforeRenderObserver) {
            this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
        }
        this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);
    }
    /**
     * Back compatibility with callback before the onAfterRenderObservable existed.
     * The set callback will be triggered just after rendering the layer.
     */
    set onAfterRender(callback) {
        if (this._onAfterRenderObserver) {
            this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
        }
        this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);
    }
    /**
     * Gets the shader language used in this material.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Instantiates a new layer.
     * This represents a full screen 2d layer.
     * This can be useful to display a picture in the  background of your scene for instance.
     * @see https://www.babylonjs-playground.com/#08A2BS#1
     * @param name Define the name of the layer in the scene
     * @param imgUrl Define the url of the texture to display in the layer
     * @param scene Define the scene the layer belongs to
     * @param isBackground Defines whether the layer is displayed in front or behind the scene
     * @param color Defines a color for the layer
     * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
     */
    constructor(
    /**
     * Define the name of the layer.
     */
    name, imgUrl, scene, isBackground, color, forceGLSL = false) {
        this.name = name;
        this._applyPostProcess = true;
        /**
         * Define the scale of the layer in order to zoom in out of the texture.
         */
        this.scale = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9(1, 1);
        /**
         * Define an offset for the layer in order to shift the texture.
         */
        this.offset = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9(0, 0);
        /**
         * Define the alpha blending mode used in the layer in case the texture or color has an alpha.
         */
        this.alphaBlendingMode = 2;
        /**
         * Define a mask to restrict the layer to only some of the scene cameras.
         */
        this.layerMask = 0x0fffffff;
        /**
         * Define the list of render target the layer is visible into.
         */
        this.renderTargetTextures = [];
        /**
         * Define if the layer is only used in renderTarget or if it also
         * renders in the main frame buffer of the canvas.
         */
        this.renderOnlyInRenderTargetTextures = false;
        /**
         * Define if the colors of the layer should be generated in linear space (default: false)
         */
        this.convertToLinearSpace = false;
        /**
         * Define if the layer is enabled (ie. should be displayed). Default: true
         */
        this.isEnabled = true;
        this._vertexBuffers = {};
        /**
         * An event triggered when the layer is disposed.
         */
        this.onDisposeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * An event triggered before rendering the scene
         */
        this.onBeforeRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * An event triggered after rendering the scene
         */
        this.onAfterRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._shadersLoaded = false;
        this.texture = imgUrl ? new _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_6__/* .Texture */ .g(imgUrl, scene, true) : null;
        this.isBackground = isBackground === undefined ? true : isBackground;
        this.color = color === undefined ? new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .ov(1, 1, 1, 1) : color;
        this._scene = (scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore */ .q.LastCreatedScene);
        const engine = this._scene.getEngine();
        if (engine.isWebGPU && !forceGLSL && !Layer.ForceGLSL) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
        let layerComponent = this._scene._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_7__/* .SceneComponentConstants */ .v.NAME_LAYER);
        if (!layerComponent) {
            layerComponent = new _layerSceneComponent_js__WEBPACK_IMPORTED_MODULE_8__/* .LayerSceneComponent */ .b(this._scene);
            this._scene._addComponent(layerComponent);
        }
        this._scene.layers.push(this);
        this._drawWrapper = new _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_9__/* .DrawWrapper */ .E(engine);
        // VBO
        const vertices = [];
        vertices.push(1, 1);
        vertices.push(-1, 1);
        vertices.push(-1, -1);
        vertices.push(1, -1);
        const vertexBuffer = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer */ .R(engine, vertices, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer */ .R.PositionKind, false, false, 2);
        this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer */ .R.PositionKind] = vertexBuffer;
        this._createIndexBuffer();
    }
    _createIndexBuffer() {
        const engine = this._scene.getEngine();
        // Indices
        const indices = [];
        indices.push(0);
        indices.push(1);
        indices.push(2);
        indices.push(0);
        indices.push(2);
        indices.push(3);
        this._indexBuffer = engine.createIndexBuffer(indices);
    }
    /** @internal */
    _rebuild() {
        const vb = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer */ .R.PositionKind];
        if (vb) {
            vb._rebuild();
        }
        this._createIndexBuffer();
    }
    /**
     * Checks if the layer is ready to be rendered
     * @returns true if the layer is ready. False otherwise.
     */
    isReady() {
        const engine = this._scene.getEngine();
        let defines = "";
        if (this.alphaTest) {
            defines = "#define ALPHATEST";
        }
        if (this.texture) {
            if (this.texture.gammaSpace) {
                if (this.convertToLinearSpace) {
                    defines += "\n#define CONVERT_TO_LINEAR";
                }
            }
            else if (!this.convertToLinearSpace) {
                defines += "\n#define CONVERT_TO_GAMMA";
            }
        }
        if (this._previousDefines !== defines) {
            this._previousDefines = defines;
            this._drawWrapper.effect = engine.createEffect("layer", [_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer */ .R.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], defines, undefined, undefined, undefined, undefined, this._shaderLanguage, this._shadersLoaded
                ? undefined
                : async () => {
                    if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 16913)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 70711))]);
                    }
                    else {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22614)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 35256))]);
                    }
                    this._shadersLoaded = true;
                });
        }
        const currentEffect = this._drawWrapper.effect;
        return !!currentEffect?.isReady() && (!this.texture || this.texture.isReady());
    }
    /**
     * Renders the layer in the scene.
     */
    render() {
        if (!this.isEnabled) {
            return;
        }
        const engine = this._scene.getEngine();
        // Check
        if (!this.isReady()) {
            return;
        }
        const currentEffect = this._drawWrapper.effect;
        this.onBeforeRenderObservable.notifyObservers(this);
        // Render
        engine.enableEffect(this._drawWrapper);
        engine.setState(false);
        // Texture
        if (this.texture) {
            currentEffect.setTexture("textureSampler", this.texture);
            currentEffect.setMatrix("textureMatrix", this.texture.getTextureMatrix());
        }
        // Color
        currentEffect.setFloat4("color", this.color.r, this.color.g, this.color.b, this.color.a);
        // Scale / offset
        currentEffect.setVector2("offset", this.offset);
        currentEffect.setVector2("scale", this.scale);
        // VBOs
        engine.bindBuffers(this._vertexBuffers, this._indexBuffer, currentEffect);
        // Draw order
        if (!this.alphaTest) {
            engine.setAlphaMode(this.alphaBlendingMode);
            engine.drawElementsType(_Materials_material_js__WEBPACK_IMPORTED_MODULE_5__/* .Material */ .i.TriangleFillMode, 0, 6);
            engine.setAlphaMode(0);
        }
        else {
            engine.drawElementsType(_Materials_material_js__WEBPACK_IMPORTED_MODULE_5__/* .Material */ .i.TriangleFillMode, 0, 6);
        }
        this.onAfterRenderObservable.notifyObservers(this);
    }
    /**
     * Disposes and releases the associated resources.
     */
    dispose() {
        const vertexBuffer = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer */ .R.PositionKind];
        if (vertexBuffer) {
            vertexBuffer.dispose();
            this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexBuffer */ .R.PositionKind] = null;
        }
        if (this._indexBuffer) {
            this._scene.getEngine()._releaseBuffer(this._indexBuffer);
            this._indexBuffer = null;
        }
        if (this.texture) {
            this.texture.dispose();
            this.texture = null;
        }
        // Clean RTT list
        this.renderTargetTextures = [];
        // Remove from scene
        const index = this._scene.layers.indexOf(this);
        this._scene.layers.splice(index, 1);
        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
        this.onAfterRenderObservable.clear();
        this.onBeforeRenderObservable.clear();
    }
}
/**
 * Force all the layers to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
Layer.ForceGLSL = false;
//# sourceMappingURL=layer.js.map

/***/ }),

/***/ 75561:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   b: () => (/* binding */ LayerSceneComponent)
/* harmony export */ });
/* harmony import */ var _sceneComponent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16945);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6315);


/**
 * Defines the layer scene component responsible to manage any layers
 * in a given scene.
 */
class LayerSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = _sceneComponent_js__WEBPACK_IMPORTED_MODULE_0__/* .SceneComponentConstants */ .v.NAME_LAYER;
        this.scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_1__/* .EngineStore */ .q.LastCreatedScene;
        if (!this.scene) {
            return;
        }
        this._engine = this.scene.getEngine();
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._beforeCameraDrawStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_0__/* .SceneComponentConstants */ .v.STEP_BEFORECAMERADRAW_LAYER, this, this._drawCameraBackground);
        this.scene._afterCameraDrawStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_0__/* .SceneComponentConstants */ .v.STEP_AFTERCAMERADRAW_LAYER, this, this._drawCameraForegroundWithPostProcessing);
        this.scene._afterCameraPostProcessStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_0__/* .SceneComponentConstants */ .v.STEP_AFTERCAMERAPOSTPROCESS_LAYER, this, this._drawCameraForegroundWithoutPostProcessing);
        this.scene._beforeRenderTargetDrawStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_0__/* .SceneComponentConstants */ .v.STEP_BEFORERENDERTARGETDRAW_LAYER, this, this._drawRenderTargetBackground);
        this.scene._afterRenderTargetDrawStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_0__/* .SceneComponentConstants */ .v.STEP_AFTERRENDERTARGETDRAW_LAYER, this, this._drawRenderTargetForegroundWithPostProcessing);
        this.scene._afterRenderTargetPostProcessStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_0__/* .SceneComponentConstants */ .v.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER, this, this._drawRenderTargetForegroundWithoutPostProcessing);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        const layers = this.scene.layers;
        for (const layer of layers) {
            layer._rebuild();
        }
    }
    /**
     * Disposes the component and the associated resources.
     */
    dispose() {
        const layers = this.scene.layers;
        while (layers.length) {
            layers[0].dispose();
        }
    }
    _draw(predicate) {
        const layers = this.scene.layers;
        if (layers.length) {
            this._engine.setDepthBuffer(false);
            for (const layer of layers) {
                if (predicate(layer)) {
                    layer.render();
                }
            }
            this._engine.setDepthBuffer(true);
        }
    }
    _drawCameraPredicate(layer, isBackground, applyPostProcess, cameraLayerMask) {
        return (!layer.renderOnlyInRenderTargetTextures &&
            layer.isBackground === isBackground &&
            layer.applyPostProcess === applyPostProcess &&
            (layer.layerMask & cameraLayerMask) !== 0);
    }
    _drawCameraBackground(camera) {
        this._draw((layer) => {
            return this._drawCameraPredicate(layer, true, true, camera.layerMask);
        });
    }
    _drawCameraForegroundWithPostProcessing(camera) {
        this._draw((layer) => {
            return this._drawCameraPredicate(layer, false, true, camera.layerMask);
        });
    }
    _drawCameraForegroundWithoutPostProcessing(camera) {
        this._draw((layer) => {
            return this._drawCameraPredicate(layer, false, false, camera.layerMask);
        });
    }
    _drawRenderTargetPredicate(layer, isBackground, applyPostProcess, cameraLayerMask, renderTargetTexture) {
        return (layer.renderTargetTextures.length > 0 &&
            layer.isBackground === isBackground &&
            layer.applyPostProcess === applyPostProcess &&
            layer.renderTargetTextures.indexOf(renderTargetTexture) > -1 &&
            (layer.layerMask & cameraLayerMask) !== 0);
    }
    _drawRenderTargetBackground(renderTarget) {
        this._draw((layer) => {
            return this._drawRenderTargetPredicate(layer, true, true, this.scene.activeCamera.layerMask, renderTarget);
        });
    }
    _drawRenderTargetForegroundWithPostProcessing(renderTarget) {
        this._draw((layer) => {
            return this._drawRenderTargetPredicate(layer, false, true, this.scene.activeCamera.layerMask, renderTarget);
        });
    }
    _drawRenderTargetForegroundWithoutPostProcessing(renderTarget) {
        this._draw((layer) => {
            return this._drawRenderTargetPredicate(layer, false, false, this.scene.activeCamera.layerMask, renderTarget);
        });
    }
    /**
     * Adds all the elements from the container to the scene
     * @param container the container holding the elements
     */
    addFromContainer(container) {
        if (!container.layers) {
            return;
        }
        container.layers.forEach((layer) => {
            this.scene.layers.push(layer);
        });
    }
    /**
     * Removes all the elements in the container from the scene
     * @param container contains the elements to remove
     * @param dispose if the removed element should be disposed (default: false)
     */
    removeFromContainer(container, dispose = false) {
        if (!container.layers) {
            return;
        }
        container.layers.forEach((layer) => {
            const index = this.scene.layers.indexOf(layer);
            if (index !== -1) {
                this.scene.layers.splice(index, 1);
            }
            if (dispose) {
                layer.dispose();
            }
        });
    }
}
//# sourceMappingURL=layerSceneComponent.js.map

/***/ }),

/***/ 52046:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (/* binding */ DirectionalLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4870);
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(64704);
/* harmony import */ var _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(83316);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56552);







_node_js__WEBPACK_IMPORTED_MODULE_3__/* .Node */ .b.AddNodeConstructor("Light_Type_1", (name, scene) => {
    return () => new DirectionalLight(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero(), scene);
});
/**
 * A directional light is defined by a direction (what a surprise!).
 * The light is emitted from everywhere in the specified direction, and has an infinite range.
 * An example of a directional light is when a distance planet is lit by the apparently parallel lines of light from its sun. Light in a downward direction will light the top of an object.
 * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
 */
class DirectionalLight extends _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__/* .ShadowLight */ .p {
    /**
     * Fix frustum size for the shadow generation. This is disabled if the value is 0.
     */
    get shadowFrustumSize() {
        return this._shadowFrustumSize;
    }
    /**
     * Specifies a fix frustum size for the shadow generation.
     */
    set shadowFrustumSize(value) {
        this._shadowFrustumSize = value;
        this.forceProjectionMatrixCompute();
    }
    /**
     * Gets the shadow projection scale against the optimal computed one.
     * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
     * This does not impact in fixed frustum size (shadowFrustumSize being set)
     */
    get shadowOrthoScale() {
        return this._shadowOrthoScale;
    }
    /**
     * Sets the shadow projection scale against the optimal computed one.
     * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
     * This does not impact in fixed frustum size (shadowFrustumSize being set)
     */
    set shadowOrthoScale(value) {
        this._shadowOrthoScale = value;
        this.forceProjectionMatrixCompute();
    }
    /**
     * Gets or sets the orthoLeft property used to build the light frustum
     */
    get orthoLeft() {
        return this._orthoLeft;
    }
    set orthoLeft(left) {
        this._orthoLeft = left;
    }
    /**
     * Gets or sets the orthoRight property used to build the light frustum
     */
    get orthoRight() {
        return this._orthoRight;
    }
    set orthoRight(right) {
        this._orthoRight = right;
    }
    /**
     * Gets or sets the orthoTop property used to build the light frustum
     */
    get orthoTop() {
        return this._orthoTop;
    }
    set orthoTop(top) {
        this._orthoTop = top;
    }
    /**
     * Gets or sets the orthoBottom property used to build the light frustum
     */
    get orthoBottom() {
        return this._orthoBottom;
    }
    set orthoBottom(bottom) {
        this._orthoBottom = bottom;
    }
    /**
     * Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3).
     * The directional light is emitted from everywhere in the given direction.
     * It can cast shadows.
     * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
     * @param name The friendly name of the light
     * @param direction The direction of the light
     * @param scene The scene the light belongs to
     */
    constructor(name, direction, scene) {
        super(name, scene);
        this._shadowFrustumSize = 0;
        this._shadowOrthoScale = 0.1;
        /**
         * Automatically compute the projection matrix to best fit (including all the casters)
         * on each frame.
         */
        this.autoUpdateExtends = true;
        /**
         * Automatically compute the shadowMinZ and shadowMaxZ for the projection matrix to best fit (including all the casters)
         * on each frame. autoUpdateExtends must be set to true for this to work
         */
        this.autoCalcShadowZBounds = false;
        // Cache
        this._orthoLeft = Number.MAX_VALUE;
        this._orthoRight = Number.MIN_VALUE;
        this._orthoTop = Number.MIN_VALUE;
        this._orthoBottom = Number.MAX_VALUE;
        this.position = direction.scale(-1.0);
        this.direction = direction;
    }
    /**
     * Returns the string "DirectionalLight".
     * @returns The class name
     */
    getClassName() {
        return "DirectionalLight";
    }
    /**
     * Returns the integer 1.
     * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
     */
    getTypeID() {
        return _light_js__WEBPACK_IMPORTED_MODULE_4__/* .Light */ .v.LIGHTTYPEID_DIRECTIONALLIGHT;
    }
    /**
     * Sets the passed matrix "matrix" as projection matrix for the shadows cast by the light according to the passed view matrix.
     * Returns the DirectionalLight Shadow projection matrix.
     * @param matrix
     * @param viewMatrix
     * @param renderList
     */
    _setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {
        if (this.shadowFrustumSize > 0) {
            this._setDefaultFixedFrustumShadowProjectionMatrix(matrix);
        }
        else {
            this._setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList);
        }
    }
    /**
     * Sets the passed matrix "matrix" as fixed frustum projection matrix for the shadows cast by the light according to the passed view matrix.
     * Returns the DirectionalLight Shadow projection matrix.
     * @param matrix
     */
    _setDefaultFixedFrustumShadowProjectionMatrix(matrix) {
        const activeCamera = this.getScene().activeCamera;
        if (!activeCamera) {
            return;
        }
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.OrthoLHToRef(this.shadowFrustumSize, this.shadowFrustumSize, this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ, this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ, matrix, this.getScene().getEngine().isNDCHalfZRange);
    }
    /**
     * Sets the passed matrix "matrix" as auto extend projection matrix for the shadows cast by the light according to the passed view matrix.
     * Returns the DirectionalLight Shadow projection matrix.
     * @param matrix
     * @param viewMatrix
     * @param renderList
     */
    _setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList) {
        const activeCamera = this.getScene().activeCamera;
        if (!activeCamera) {
            return;
        }
        // Check extends
        if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {
            const tempVector3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
            this._orthoLeft = Number.MAX_VALUE;
            this._orthoRight = -Number.MAX_VALUE;
            this._orthoTop = -Number.MAX_VALUE;
            this._orthoBottom = Number.MAX_VALUE;
            let shadowMinZ = Number.MAX_VALUE;
            let shadowMaxZ = -Number.MAX_VALUE;
            for (let meshIndex = 0; meshIndex < renderList.length; meshIndex++) {
                const mesh = renderList[meshIndex];
                if (!mesh) {
                    continue;
                }
                const boundingInfo = mesh.getBoundingInfo();
                const boundingBox = boundingInfo.boundingBox;
                for (let index = 0; index < boundingBox.vectorsWorld.length; index++) {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesToRef(boundingBox.vectorsWorld[index], viewMatrix, tempVector3);
                    if (tempVector3.x < this._orthoLeft) {
                        this._orthoLeft = tempVector3.x;
                    }
                    if (tempVector3.y < this._orthoBottom) {
                        this._orthoBottom = tempVector3.y;
                    }
                    if (tempVector3.x > this._orthoRight) {
                        this._orthoRight = tempVector3.x;
                    }
                    if (tempVector3.y > this._orthoTop) {
                        this._orthoTop = tempVector3.y;
                    }
                    if (this.autoCalcShadowZBounds) {
                        if (tempVector3.z < shadowMinZ) {
                            shadowMinZ = tempVector3.z;
                        }
                        if (tempVector3.z > shadowMaxZ) {
                            shadowMaxZ = tempVector3.z;
                        }
                    }
                }
            }
            if (this.autoCalcShadowZBounds) {
                this._shadowMinZ = shadowMinZ;
                this._shadowMaxZ = shadowMaxZ;
            }
        }
        const xOffset = this._orthoRight - this._orthoLeft;
        const yOffset = this._orthoTop - this._orthoBottom;
        const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
        const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
        const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.OrthoOffCenterLHToRef(this._orthoLeft - xOffset * this.shadowOrthoScale, this._orthoRight + xOffset * this.shadowOrthoScale, this._orthoBottom - yOffset * this.shadowOrthoScale, this._orthoTop + yOffset * this.shadowOrthoScale, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, this.getScene().getEngine().isNDCHalfZRange);
    }
    _buildUniformLayout() {
        this._uniformBuffer.addUniform("vLightData", 4);
        this._uniformBuffer.addUniform("vLightDiffuse", 4);
        this._uniformBuffer.addUniform("vLightSpecular", 4);
        this._uniformBuffer.addUniform("shadowsInfo", 3);
        this._uniformBuffer.addUniform("depthValues", 2);
        this._uniformBuffer.create();
    }
    /**
     * Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name.
     * @param effect The effect to update
     * @param lightIndex The index of the light in the effect to update
     * @returns The directional light
     */
    transferToEffect(effect, lightIndex) {
        if (this.computeTransformedInformation()) {
            this._uniformBuffer.updateFloat4("vLightData", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, lightIndex);
            return this;
        }
        this._uniformBuffer.updateFloat4("vLightData", this.direction.x, this.direction.y, this.direction.z, 1, lightIndex);
        return this;
    }
    transferToNodeMaterialEffect(effect, lightDataUniformName) {
        if (this.computeTransformedInformation()) {
            effect.setFloat3(lightDataUniformName, this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z);
            return this;
        }
        effect.setFloat3(lightDataUniformName, this.direction.x, this.direction.y, this.direction.z);
        return this;
    }
    /**
     * Gets the minZ used for shadow according to both the scene and the light.
     *
     * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
     * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
     * (when not using reverse depth buffer / NDC half Z range)
     * @param activeCamera The camera we are returning the min for
     * @returns the depth min z
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    getDepthMinZ(activeCamera) {
        const engine = this._scene.getEngine();
        return !engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
    }
    /**
     * Gets the maxZ used for shadow according to both the scene and the light.
     *
     * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
     * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
     * (when not using reverse depth buffer / NDC half Z range)
     * @param activeCamera The camera we are returning the max for
     * @returns the depth max z
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    getDepthMaxZ(activeCamera) {
        const engine = this._scene.getEngine();
        return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
    }
    /**
     * Prepares the list of defines specific to the light type.
     * @param defines the list of defines
     * @param lightIndex defines the index of the light for the effect
     */
    prepareLightSpecificDefines(defines, lightIndex) {
        defines["DIRLIGHT" + lightIndex] = true;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], DirectionalLight.prototype, "shadowFrustumSize", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], DirectionalLight.prototype, "shadowOrthoScale", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], DirectionalLight.prototype, "autoUpdateExtends", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], DirectionalLight.prototype, "autoCalcShadowZBounds", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("orthoLeft")
], DirectionalLight.prototype, "_orthoLeft", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("orthoRight")
], DirectionalLight.prototype, "_orthoRight", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("orthoTop")
], DirectionalLight.prototype, "_orthoTop", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("orthoBottom")
], DirectionalLight.prototype, "_orthoBottom", void 0);
// Register Class Name
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .RegisterClass */ .Y5)("BABYLON.DirectionalLight", DirectionalLight);
//# sourceMappingURL=directionalLight.js.map

/***/ }),

/***/ 71513:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   g: () => (/* binding */ HemisphericLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26041);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4870);
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64704);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56552);







_node_js__WEBPACK_IMPORTED_MODULE_4__/* .Node */ .b.AddNodeConstructor("Light_Type_3", (name, scene) => {
    return () => new HemisphericLight(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero(), scene);
});
/**
 * The HemisphericLight simulates the ambient environment light,
 * so the passed direction is the light reflection direction, not the incoming direction.
 */
class HemisphericLight extends _light_js__WEBPACK_IMPORTED_MODULE_5__/* .Light */ .v {
    /**
     * Creates a HemisphericLight object in the scene according to the passed direction (Vector3).
     * The HemisphericLight simulates the ambient environment light, so the passed direction is the light reflection direction, not the incoming direction.
     * The HemisphericLight can't cast shadows.
     * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
     * @param name The friendly name of the light
     * @param direction The direction of the light reflection
     * @param scene The scene the light belongs to
     */
    constructor(name, direction, scene) {
        super(name, scene);
        /**
         * The groundColor is the light in the opposite direction to the one specified during creation.
         * You can think of the diffuse and specular light as coming from the centre of the object in the given direction and the groundColor light in the opposite direction.
         */
        this.groundColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .v9(0.0, 0.0, 0.0);
        this.direction = direction || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Up();
    }
    _buildUniformLayout() {
        this._uniformBuffer.addUniform("vLightData", 4);
        this._uniformBuffer.addUniform("vLightDiffuse", 4);
        this._uniformBuffer.addUniform("vLightSpecular", 4);
        this._uniformBuffer.addUniform("vLightGround", 3);
        this._uniformBuffer.addUniform("shadowsInfo", 3);
        this._uniformBuffer.addUniform("depthValues", 2);
        this._uniformBuffer.create();
    }
    /**
     * Returns the string "HemisphericLight".
     * @returns The class name
     */
    getClassName() {
        return "HemisphericLight";
    }
    /**
     * Sets the HemisphericLight direction towards the passed target (Vector3).
     * Returns the updated direction.
     * @param target The target the direction should point to
     * @returns The computed direction
     */
    setDirectionToTarget(target) {
        this.direction = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Normalize(target.subtract(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero()));
        return this.direction;
    }
    /**
     * Returns the shadow generator associated to the light.
     * @returns Always null for hemispheric lights because it does not support shadows.
     */
    getShadowGenerator() {
        return null;
    }
    /**
     * Sets the passed Effect object with the HemisphericLight normalized direction and color and the passed name (string).
     * @param _effect The effect to update
     * @param lightIndex The index of the light in the effect to update
     * @returns The hemispheric light
     */
    transferToEffect(_effect, lightIndex) {
        const normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Normalize(this.direction);
        this._uniformBuffer.updateFloat4("vLightData", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0.0, lightIndex);
        this._uniformBuffer.updateColor3("vLightGround", this.groundColor.scale(this.intensity), lightIndex);
        return this;
    }
    transferToNodeMaterialEffect(effect, lightDataUniformName) {
        const normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Normalize(this.direction);
        effect.setFloat3(lightDataUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z);
        return this;
    }
    /**
     * Computes the world matrix of the node
     * @returns the world matrix
     */
    computeWorldMatrix() {
        if (!this._worldMatrix) {
            this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.Identity();
        }
        return this._worldMatrix;
    }
    /**
     * Returns the integer 3.
     * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
     */
    getTypeID() {
        return _light_js__WEBPACK_IMPORTED_MODULE_5__/* .Light */ .v.LIGHTTYPEID_HEMISPHERICLIGHT;
    }
    /**
     * Prepares the list of defines specific to the light type.
     * @param defines the list of defines
     * @param lightIndex defines the index of the light for the effect
     */
    prepareLightSpecificDefines(defines, lightIndex) {
        defines["HEMILIGHT" + lightIndex] = true;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)()
], HemisphericLight.prototype, "groundColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)()
], HemisphericLight.prototype, "direction", void 0);
// Register Class Name
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .RegisterClass */ .Y5)("BABYLON.HemisphericLight", HemisphericLight);
//# sourceMappingURL=hemisphericLight.js.map

/***/ }),

/***/ 64704:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   v: () => (/* binding */ Light)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26041);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4870);
/* harmony import */ var _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80935);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56552);
/* harmony import */ var _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(75515);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(26877);









/**
 * Base class of all the lights in Babylon. It groups all the generic information about lights.
 * Lights are used, as you would expect, to affect how meshes are seen, in terms of both illumination and colour.
 * All meshes allow light to pass through them unless shadow generation is activated. The default number of lights allowed is four but this can be increased.
 */
class Light extends _node_js__WEBPACK_IMPORTED_MODULE_4__/* .Node */ .b {
    /**
     * Defines how far from the source the light is impacting in scene units.
     * Note: Unused in PBR material as the distance light falloff is defined following the inverse squared falloff.
     */
    get range() {
        return this._range;
    }
    /**
     * Defines how far from the source the light is impacting in scene units.
     * Note: Unused in PBR material as the distance light falloff is defined following the inverse squared falloff.
     */
    set range(value) {
        this._range = value;
        this._inverseSquaredRange = 1.0 / (this.range * this.range);
    }
    /**
     * Gets the photometric scale used to interpret the intensity.
     * This is only relevant with PBR Materials where the light intensity can be defined in a physical way.
     */
    get intensityMode() {
        return this._intensityMode;
    }
    /**
     * Sets the photometric scale used to interpret the intensity.
     * This is only relevant with PBR Materials where the light intensity can be defined in a physical way.
     */
    set intensityMode(value) {
        this._intensityMode = value;
        this._computePhotometricScale();
    }
    /**
     * Gets the light radius used by PBR Materials to simulate soft area lights.
     */
    get radius() {
        return this._radius;
    }
    /**
     * sets the light radius used by PBR Materials to simulate soft area lights.
     */
    set radius(value) {
        this._radius = value;
        this._computePhotometricScale();
    }
    /**
     * Gets whether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching
     * the current shadow generator.
     */
    get shadowEnabled() {
        return this._shadowEnabled;
    }
    /**
     * Sets whether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching
     * the current shadow generator.
     */
    set shadowEnabled(value) {
        if (this._shadowEnabled === value) {
            return;
        }
        this._shadowEnabled = value;
        this._markMeshesAsLightDirty();
    }
    /**
     * Gets the only meshes impacted by this light.
     */
    get includedOnlyMeshes() {
        return this._includedOnlyMeshes;
    }
    /**
     * Sets the only meshes impacted by this light.
     */
    set includedOnlyMeshes(value) {
        this._includedOnlyMeshes = value;
        this._hookArrayForIncludedOnly(value);
    }
    /**
     * Gets the meshes not impacted by this light.
     */
    get excludedMeshes() {
        return this._excludedMeshes;
    }
    /**
     * Sets the meshes not impacted by this light.
     */
    set excludedMeshes(value) {
        this._excludedMeshes = value;
        this._hookArrayForExcluded(value);
    }
    /**
     * Gets the layer id use to find what meshes are not impacted by the light.
     * Inactive if 0
     */
    get excludeWithLayerMask() {
        return this._excludeWithLayerMask;
    }
    /**
     * Sets the layer id use to find what meshes are not impacted by the light.
     * Inactive if 0
     */
    set excludeWithLayerMask(value) {
        this._excludeWithLayerMask = value;
        this._resyncMeshes();
    }
    /**
     * Gets the layer id use to find what meshes are impacted by the light.
     * Inactive if 0
     */
    get includeOnlyWithLayerMask() {
        return this._includeOnlyWithLayerMask;
    }
    /**
     * Sets the layer id use to find what meshes are impacted by the light.
     * Inactive if 0
     */
    set includeOnlyWithLayerMask(value) {
        this._includeOnlyWithLayerMask = value;
        this._resyncMeshes();
    }
    /**
     * Gets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x)
     */
    get lightmapMode() {
        return this._lightmapMode;
    }
    /**
     * Sets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x)
     */
    set lightmapMode(value) {
        if (this._lightmapMode === value) {
            return;
        }
        this._lightmapMode = value;
        this._markMeshesAsLightDirty();
    }
    /**
     * Returns the view matrix.
     * @param _faceIndex The index of the face for which we want to extract the view matrix. Only used for point light types.
     * @returns The view matrix. Can be null, if a view matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
     */
    getViewMatrix(_faceIndex) {
        return null;
    }
    /**
     * Returns the projection matrix.
     * Note that viewMatrix and renderList are optional and are only used by lights that calculate the projection matrix from a list of meshes (e.g. directional lights with automatic extents calculation).
     * @param _viewMatrix The view transform matrix of the light (optional).
     * @param _renderList The list of meshes to take into account when calculating the projection matrix (optional).
     * @returns The projection matrix. Can be null, if a projection matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
     */
    getProjectionMatrix(_viewMatrix, _renderList) {
        return null;
    }
    /**
     * Creates a Light object in the scene.
     * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
     * @param name The friendly name of the light
     * @param scene The scene the light belongs too
     */
    constructor(name, scene) {
        super(name, scene, false);
        /**
         * Diffuse gives the basic color to an object.
         */
        this.diffuse = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .v9(1.0, 1.0, 1.0);
        /**
         * Specular produces a highlight color on an object.
         * Note: This is not affecting PBR materials.
         */
        this.specular = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .v9(1.0, 1.0, 1.0);
        /**
         * Defines the falloff type for this light. This lets overriding how punctual light are
         * falling off base on range or angle.
         * This can be set to any values in Light.FALLOFF_x.
         *
         * Note: This is only useful for PBR Materials at the moment. This could be extended if required to
         * other types of materials.
         */
        this.falloffType = Light.FALLOFF_DEFAULT;
        /**
         * Strength of the light.
         * Note: By default it is define in the framework own unit.
         * Note: In PBR materials the intensityMode can be use to chose what unit the intensity is defined in.
         */
        this.intensity = 1.0;
        this._range = Number.MAX_VALUE;
        this._inverseSquaredRange = 0;
        /**
         * Cached photometric scale default to 1.0 as the automatic intensity mode defaults to 1.0 for every type
         * of light.
         */
        this._photometricScale = 1.0;
        this._intensityMode = Light.INTENSITYMODE_AUTOMATIC;
        this._radius = 0.00001;
        /**
         * Defines the rendering priority of the lights. It can help in case of fallback or number of lights
         * exceeding the number allowed of the materials.
         */
        this.renderPriority = 0;
        this._shadowEnabled = true;
        this._excludeWithLayerMask = 0;
        this._includeOnlyWithLayerMask = 0;
        this._lightmapMode = 0;
        /**
         * Shadow generators associated to the light.
         * @internal Internal use only.
         */
        this._shadowGenerators = null;
        /**
         * @internal Internal use only.
         */
        this._excludedMeshesIds = new Array();
        /**
         * @internal Internal use only.
         */
        this._includedOnlyMeshesIds = new Array();
        /** @internal */
        this._isLight = true;
        this.getScene().addLight(this);
        this._uniformBuffer = new _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_5__/* .UniformBuffer */ .D(this.getScene().getEngine(), undefined, undefined, name);
        this._buildUniformLayout();
        this.includedOnlyMeshes = [];
        this.excludedMeshes = [];
        this._resyncMeshes();
    }
    /**
     * Sets the passed Effect "effect" with the Light textures.
     * @param effect The effect to update
     * @param lightIndex The index of the light in the effect to update
     * @returns The light
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    transferTexturesToEffect(effect, lightIndex) {
        // Do nothing by default.
        return this;
    }
    /**
     * Binds the lights information from the scene to the effect for the given mesh.
     * @param lightIndex Light index
     * @param scene The scene where the light belongs to
     * @param effect The effect we are binding the data to
     * @param useSpecular Defines if specular is supported
     * @param receiveShadows Defines if the effect (mesh) we bind the light for receives shadows
     */
    _bindLight(lightIndex, scene, effect, useSpecular, receiveShadows = true) {
        const iAsString = lightIndex.toString();
        let needUpdate = false;
        this._uniformBuffer.bindToEffect(effect, "Light" + iAsString);
        if (this._renderId !== scene.getRenderId() || this._lastUseSpecular !== useSpecular || !this._uniformBuffer.useUbo) {
            this._renderId = scene.getRenderId();
            this._lastUseSpecular = useSpecular;
            const scaledIntensity = this.getScaledIntensity();
            this.transferToEffect(effect, iAsString);
            this.diffuse.scaleToRef(scaledIntensity, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpColors */ .IG.Color3[0]);
            this._uniformBuffer.updateColor4("vLightDiffuse", _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpColors */ .IG.Color3[0], this.range, iAsString);
            if (useSpecular) {
                this.specular.scaleToRef(scaledIntensity, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpColors */ .IG.Color3[1]);
                this._uniformBuffer.updateColor4("vLightSpecular", _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpColors */ .IG.Color3[1], this.radius, iAsString);
            }
            needUpdate = true;
        }
        // Textures might still need to be rebound.
        this.transferTexturesToEffect(effect, iAsString);
        // Shadows
        if (scene.shadowsEnabled && this.shadowEnabled && receiveShadows) {
            const shadowGenerator = this.getShadowGenerator(scene.activeCamera) ?? this.getShadowGenerator();
            if (shadowGenerator) {
                shadowGenerator.bindShadowLight(iAsString, effect);
                needUpdate = true;
            }
        }
        if (needUpdate) {
            this._uniformBuffer.update();
        }
        else {
            this._uniformBuffer.bindUniformBuffer();
        }
    }
    /**
     * Returns the string "Light".
     * @returns the class name
     */
    getClassName() {
        return "Light";
    }
    /**
     * Converts the light information to a readable string for debug purpose.
     * @param fullDetails Supports for multiple levels of logging within scene loading
     * @returns the human readable light info
     */
    toString(fullDetails) {
        let ret = "Name: " + this.name;
        ret += ", type: " + ["Point", "Directional", "Spot", "Hemispheric"][this.getTypeID()];
        if (this.animations) {
            for (let i = 0; i < this.animations.length; i++) {
                ret += ", animation[0]: " + this.animations[i].toString(fullDetails);
            }
        }
        return ret;
    }
    /** @internal */
    _syncParentEnabledState() {
        super._syncParentEnabledState();
        if (!this.isDisposed()) {
            this._resyncMeshes();
        }
    }
    /**
     * Set the enabled state of this node.
     * @param value - the new enabled state
     */
    setEnabled(value) {
        super.setEnabled(value);
        this._resyncMeshes();
    }
    /**
     * Returns the Light associated shadow generator if any.
     * @param camera Camera for which the shadow generator should be retrieved (default: null). If null, retrieves the default shadow generator
     * @returns the associated shadow generator.
     */
    getShadowGenerator(camera = null) {
        if (this._shadowGenerators === null) {
            return null;
        }
        return this._shadowGenerators.get(camera) ?? null;
    }
    /**
     * Returns all the shadow generators associated to this light
     * @returns
     */
    getShadowGenerators() {
        return this._shadowGenerators;
    }
    /**
     * Returns a Vector3, the absolute light position in the World.
     * @returns the world space position of the light
     */
    getAbsolutePosition() {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
    }
    /**
     * Specifies if the light will affect the passed mesh.
     * @param mesh The mesh to test against the light
     * @returns true the mesh is affected otherwise, false.
     */
    canAffectMesh(mesh) {
        if (!mesh) {
            return true;
        }
        if (this.includedOnlyMeshes && this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(mesh) === -1) {
            return false;
        }
        if (this.excludedMeshes && this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) {
            return false;
        }
        if (this.includeOnlyWithLayerMask !== 0 && (this.includeOnlyWithLayerMask & mesh.layerMask) === 0) {
            return false;
        }
        if (this.excludeWithLayerMask !== 0 && this.excludeWithLayerMask & mesh.layerMask) {
            return false;
        }
        return true;
    }
    /**
     * Releases resources associated with this node.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        if (this._shadowGenerators) {
            const iterator = this._shadowGenerators.values();
            for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
                const shadowGenerator = key.value;
                shadowGenerator.dispose();
            }
            this._shadowGenerators = null;
        }
        // Animations
        this.getScene().stopAnimation(this);
        if (this._parentContainer) {
            const index = this._parentContainer.lights.indexOf(this);
            if (index > -1) {
                this._parentContainer.lights.splice(index, 1);
            }
            this._parentContainer = null;
        }
        // Remove from meshes
        for (const mesh of this.getScene().meshes) {
            mesh._removeLightSource(this, true);
        }
        this._uniformBuffer.dispose();
        // Remove from scene
        this.getScene().removeLight(this);
        super.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
    /**
     * Returns the light type ID (integer).
     * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
     */
    getTypeID() {
        return 0;
    }
    /**
     * Returns the intensity scaled by the Photometric Scale according to the light type and intensity mode.
     * @returns the scaled intensity in intensity mode unit
     */
    getScaledIntensity() {
        return this._photometricScale * this.intensity;
    }
    /**
     * Returns a new Light object, named "name", from the current one.
     * @param name The name of the cloned light
     * @param newParent The parent of this light, if it has one
     * @returns the new created light
     */
    clone(name, newParent = null) {
        const constructor = Light.GetConstructorFromName(this.getTypeID(), name, this.getScene());
        if (!constructor) {
            return null;
        }
        const clonedLight = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__/* .SerializationHelper */ .p.Clone(constructor, this);
        if (name) {
            clonedLight.name = name;
        }
        if (newParent) {
            clonedLight.parent = newParent;
        }
        clonedLight.setEnabled(this.isEnabled());
        this.onClonedObservable.notifyObservers(clonedLight);
        return clonedLight;
    }
    /**
     * Serializes the current light into a Serialization object.
     * @returns the serialized object.
     */
    serialize() {
        const serializationObject = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__/* .SerializationHelper */ .p.Serialize(this);
        serializationObject.uniqueId = this.uniqueId;
        // Type
        serializationObject.type = this.getTypeID();
        // Parent
        if (this.parent) {
            this.parent._serializeAsParent(serializationObject);
        }
        // Inclusion / exclusions
        if (this.excludedMeshes.length > 0) {
            serializationObject.excludedMeshesIds = [];
            this.excludedMeshes.forEach((mesh) => {
                serializationObject.excludedMeshesIds.push(mesh.id);
            });
        }
        if (this.includedOnlyMeshes.length > 0) {
            serializationObject.includedOnlyMeshesIds = [];
            this.includedOnlyMeshes.forEach((mesh) => {
                serializationObject.includedOnlyMeshesIds.push(mesh.id);
            });
        }
        // Animations
        _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__/* .SerializationHelper */ .p.AppendSerializedAnimations(this, serializationObject);
        serializationObject.ranges = this.serializeAnimationRanges();
        serializationObject.isEnabled = this.isEnabled();
        return serializationObject;
    }
    /**
     * Creates a new typed light from the passed type (integer) : point light = 0, directional light = 1, spot light = 2, hemispheric light = 3.
     * This new light is named "name" and added to the passed scene.
     * @param type Type according to the types available in Light.LIGHTTYPEID_x
     * @param name The friendly name of the light
     * @param scene The scene the new light will belong to
     * @returns the constructor function
     */
    static GetConstructorFromName(type, name, scene) {
        const constructorFunc = _node_js__WEBPACK_IMPORTED_MODULE_4__/* .Node */ .b.Construct("Light_Type_" + type, name, scene);
        if (constructorFunc) {
            return constructorFunc;
        }
        // Default to no light for none present once.
        return null;
    }
    /**
     * Parses the passed "parsedLight" and returns a new instanced Light from this parsing.
     * @param parsedLight The JSON representation of the light
     * @param scene The scene to create the parsed light in
     * @returns the created light after parsing
     */
    static Parse(parsedLight, scene) {
        const constructor = Light.GetConstructorFromName(parsedLight.type, parsedLight.name, scene);
        if (!constructor) {
            return null;
        }
        const light = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__/* .SerializationHelper */ .p.Parse(constructor, parsedLight, scene);
        // Inclusion / exclusions
        if (parsedLight.excludedMeshesIds) {
            light._excludedMeshesIds = parsedLight.excludedMeshesIds;
        }
        if (parsedLight.includedOnlyMeshesIds) {
            light._includedOnlyMeshesIds = parsedLight.includedOnlyMeshesIds;
        }
        // Parent
        if (parsedLight.parentId !== undefined) {
            light._waitingParentId = parsedLight.parentId;
        }
        if (parsedLight.parentInstanceIndex !== undefined) {
            light._waitingParentInstanceIndex = parsedLight.parentInstanceIndex;
        }
        // Falloff
        if (parsedLight.falloffType !== undefined) {
            light.falloffType = parsedLight.falloffType;
        }
        // Lightmaps
        if (parsedLight.lightmapMode !== undefined) {
            light.lightmapMode = parsedLight.lightmapMode;
        }
        // Animations
        if (parsedLight.animations) {
            for (let animationIndex = 0; animationIndex < parsedLight.animations.length; animationIndex++) {
                const parsedAnimation = parsedLight.animations[animationIndex];
                const internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .GetClass */ .n9)("BABYLON.Animation");
                if (internalClass) {
                    light.animations.push(internalClass.Parse(parsedAnimation));
                }
            }
            _node_js__WEBPACK_IMPORTED_MODULE_4__/* .Node */ .b.ParseAnimationRanges(light, parsedLight, scene);
        }
        if (parsedLight.autoAnimate) {
            scene.beginAnimation(light, parsedLight.autoAnimateFrom, parsedLight.autoAnimateTo, parsedLight.autoAnimateLoop, parsedLight.autoAnimateSpeed || 1.0);
        }
        // Check if isEnabled is defined to be back compatible with prior serialized versions.
        if (parsedLight.isEnabled !== undefined) {
            light.setEnabled(parsedLight.isEnabled);
        }
        return light;
    }
    _hookArrayForExcluded(array) {
        const oldPush = array.push;
        array.push = (...items) => {
            const result = oldPush.apply(array, items);
            for (const item of items) {
                item._resyncLightSource(this);
            }
            return result;
        };
        const oldSplice = array.splice;
        array.splice = (index, deleteCount) => {
            const deleted = oldSplice.apply(array, [index, deleteCount]);
            for (const item of deleted) {
                item._resyncLightSource(this);
            }
            return deleted;
        };
        for (const item of array) {
            item._resyncLightSource(this);
        }
    }
    _hookArrayForIncludedOnly(array) {
        const oldPush = array.push;
        array.push = (...items) => {
            const result = oldPush.apply(array, items);
            this._resyncMeshes();
            return result;
        };
        const oldSplice = array.splice;
        array.splice = (index, deleteCount) => {
            const deleted = oldSplice.apply(array, [index, deleteCount]);
            this._resyncMeshes();
            return deleted;
        };
        this._resyncMeshes();
    }
    _resyncMeshes() {
        for (const mesh of this.getScene().meshes) {
            mesh._resyncLightSource(this);
        }
    }
    /**
     * Forces the meshes to update their light related information in their rendering used effects
     * @internal Internal Use Only
     */
    _markMeshesAsLightDirty() {
        for (const mesh of this.getScene().meshes) {
            if (mesh.lightSources.indexOf(this) !== -1) {
                mesh._markSubMeshesAsLightDirty();
            }
        }
    }
    /**
     * Recomputes the cached photometric scale if needed.
     */
    _computePhotometricScale() {
        this._photometricScale = this._getPhotometricScale();
        this.getScene().resetCachedMaterial();
    }
    /**
     * @returns the Photometric Scale according to the light type and intensity mode.
     */
    _getPhotometricScale() {
        let photometricScale = 0.0;
        const lightTypeID = this.getTypeID();
        //get photometric mode
        let photometricMode = this.intensityMode;
        if (photometricMode === Light.INTENSITYMODE_AUTOMATIC) {
            if (lightTypeID === Light.LIGHTTYPEID_DIRECTIONALLIGHT) {
                photometricMode = Light.INTENSITYMODE_ILLUMINANCE;
            }
            else {
                photometricMode = Light.INTENSITYMODE_LUMINOUSINTENSITY;
            }
        }
        //compute photometric scale
        switch (lightTypeID) {
            case Light.LIGHTTYPEID_POINTLIGHT:
            case Light.LIGHTTYPEID_SPOTLIGHT:
                switch (photometricMode) {
                    case Light.INTENSITYMODE_LUMINOUSPOWER:
                        photometricScale = 1.0 / (4.0 * Math.PI);
                        break;
                    case Light.INTENSITYMODE_LUMINOUSINTENSITY:
                        photometricScale = 1.0;
                        break;
                    case Light.INTENSITYMODE_LUMINANCE:
                        photometricScale = this.radius * this.radius;
                        break;
                }
                break;
            case Light.LIGHTTYPEID_DIRECTIONALLIGHT:
                switch (photometricMode) {
                    case Light.INTENSITYMODE_ILLUMINANCE:
                        photometricScale = 1.0;
                        break;
                    case Light.INTENSITYMODE_LUMINANCE: {
                        // When radius (and therefore solid angle) is non-zero a directional lights brightness can be specified via central (peak) luminance.
                        // For a directional light the 'radius' defines the angular radius (in radians) rather than world-space radius (e.g. in metres).
                        let apexAngleRadians = this.radius;
                        // Impose a minimum light angular size to avoid the light becoming an infinitely small angular light source (i.e. a dirac delta function).
                        apexAngleRadians = Math.max(apexAngleRadians, 0.001);
                        const solidAngle = 2.0 * Math.PI * (1.0 - Math.cos(apexAngleRadians));
                        photometricScale = solidAngle;
                        break;
                    }
                }
                break;
            case Light.LIGHTTYPEID_HEMISPHERICLIGHT:
                // No fall off in hemispheric light.
                photometricScale = 1.0;
                break;
        }
        return photometricScale;
    }
    /**
     * Reorder the light in the scene according to their defined priority.
     * @internal Internal Use Only
     */
    _reorderLightsInScene() {
        const scene = this.getScene();
        if (this._renderPriority != 0) {
            scene.requireLightSorting = true;
        }
        this.getScene().sortLightsByPriority();
    }
}
/**
 * Falloff Default: light is falling off following the material specification:
 * standard material is using standard falloff whereas pbr material can request special falloff per materials.
 */
Light.FALLOFF_DEFAULT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.FALLOFF_DEFAULT;
/**
 * Falloff Physical: light is falling off following the inverse squared distance law.
 */
Light.FALLOFF_PHYSICAL = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.FALLOFF_PHYSICAL;
/**
 * Falloff gltf: light is falling off as described in the gltf moving to PBR document
 * to enhance interoperability with other engines.
 */
Light.FALLOFF_GLTF = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.FALLOFF_GLTF;
/**
 * Falloff Standard: light is falling off like in the standard material
 * to enhance interoperability with other materials.
 */
Light.FALLOFF_STANDARD = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.FALLOFF_STANDARD;
//lightmapMode Consts
/**
 * If every light affecting the material is in this lightmapMode,
 * material.lightmapTexture adds or multiplies
 * (depends on material.useLightmapAsShadowmap)
 * after every other light calculations.
 */
Light.LIGHTMAP_DEFAULT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.LIGHTMAP_DEFAULT;
/**
 * material.lightmapTexture as only diffuse lighting from this light
 * adds only specular lighting from this light
 * adds dynamic shadows
 */
Light.LIGHTMAP_SPECULAR = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.LIGHTMAP_SPECULAR;
/**
 * material.lightmapTexture as only lighting
 * no light calculation from this light
 * only adds dynamic shadows from this light
 */
Light.LIGHTMAP_SHADOWSONLY = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.LIGHTMAP_SHADOWSONLY;
// Intensity Mode Consts
/**
 * Each light type uses the default quantity according to its type:
 *      point/spot lights use luminous intensity
 *      directional lights use illuminance
 */
Light.INTENSITYMODE_AUTOMATIC = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.INTENSITYMODE_AUTOMATIC;
/**
 * lumen (lm)
 */
Light.INTENSITYMODE_LUMINOUSPOWER = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.INTENSITYMODE_LUMINOUSPOWER;
/**
 * candela (lm/sr)
 */
Light.INTENSITYMODE_LUMINOUSINTENSITY = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.INTENSITYMODE_LUMINOUSINTENSITY;
/**
 * lux (lm/m^2)
 */
Light.INTENSITYMODE_ILLUMINANCE = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.INTENSITYMODE_ILLUMINANCE;
/**
 * nit (cd/m^2)
 */
Light.INTENSITYMODE_LUMINANCE = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.INTENSITYMODE_LUMINANCE;
// Light types ids const.
/**
 * Light type const id of the point light.
 */
Light.LIGHTTYPEID_POINTLIGHT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.LIGHTTYPEID_POINTLIGHT;
/**
 * Light type const id of the directional light.
 */
Light.LIGHTTYPEID_DIRECTIONALLIGHT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.LIGHTTYPEID_DIRECTIONALLIGHT;
/**
 * Light type const id of the spot light.
 */
Light.LIGHTTYPEID_SPOTLIGHT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.LIGHTTYPEID_SPOTLIGHT;
/**
 * Light type const id of the hemispheric light.
 */
Light.LIGHTTYPEID_HEMISPHERICLIGHT = _lightConstants_js__WEBPACK_IMPORTED_MODULE_7__/* .LightConstants */ .c.LIGHTTYPEID_HEMISPHERICLIGHT;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)()
], Light.prototype, "diffuse", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)()
], Light.prototype, "specular", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Light.prototype, "falloffType", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Light.prototype, "intensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Light.prototype, "range", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Light.prototype, "intensityMode", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Light.prototype, "radius", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Light.prototype, "_renderPriority", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_reorderLightsInScene")
], Light.prototype, "renderPriority", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("shadowEnabled")
], Light.prototype, "_shadowEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("excludeWithLayerMask")
], Light.prototype, "_excludeWithLayerMask", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("includeOnlyWithLayerMask")
], Light.prototype, "_includeOnlyWithLayerMask", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("lightmapMode")
], Light.prototype, "_lightmapMode", void 0);
//# sourceMappingURL=light.js.map

/***/ }),

/***/ 75515:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   c: () => (/* binding */ LightConstants)
/* harmony export */ });
/** Defines the cross module constantsused by lights to avoid circular dependencies */
class LightConstants {
    /**
     * Sort function to order lights for rendering.
     * @param a First Light object to compare to second.
     * @param b Second Light object to compare first.
     * @returns -1 to reduce's a's index relative to be, 0 for no change, 1 to increase a's index relative to b.
     */
    static CompareLightsPriority(a, b) {
        //shadow-casting lights have priority over non-shadow-casting lights
        //the renderPriority is a secondary sort criterion
        if (a.shadowEnabled !== b.shadowEnabled) {
            return (b.shadowEnabled ? 1 : 0) - (a.shadowEnabled ? 1 : 0);
        }
        return b.renderPriority - a.renderPriority;
    }
}
/**
 * Falloff Default: light is falling off following the material specification:
 * standard material is using standard falloff whereas pbr material can request special falloff per materials.
 */
LightConstants.FALLOFF_DEFAULT = 0;
/**
 * Falloff Physical: light is falling off following the inverse squared distance law.
 */
LightConstants.FALLOFF_PHYSICAL = 1;
/**
 * Falloff gltf: light is falling off as described in the gltf moving to PBR document
 * to enhance interoperability with other engines.
 */
LightConstants.FALLOFF_GLTF = 2;
/**
 * Falloff Standard: light is falling off like in the standard material
 * to enhance interoperability with other materials.
 */
LightConstants.FALLOFF_STANDARD = 3;
//lightmapMode Consts
/**
 * If every light affecting the material is in this lightmapMode,
 * material.lightmapTexture adds or multiplies
 * (depends on material.useLightmapAsShadowmap)
 * after every other light calculations.
 */
LightConstants.LIGHTMAP_DEFAULT = 0;
/**
 * material.lightmapTexture as only diffuse lighting from this light
 * adds only specular lighting from this light
 * adds dynamic shadows
 */
LightConstants.LIGHTMAP_SPECULAR = 1;
/**
 * material.lightmapTexture as only lighting
 * no light calculation from this light
 * only adds dynamic shadows from this light
 */
LightConstants.LIGHTMAP_SHADOWSONLY = 2;
// Intensity Mode Consts
/**
 * Each light type uses the default quantity according to its type:
 *      point/spot lights use luminous intensity
 *      directional lights use illuminance
 */
LightConstants.INTENSITYMODE_AUTOMATIC = 0;
/**
 * lumen (lm)
 */
LightConstants.INTENSITYMODE_LUMINOUSPOWER = 1;
/**
 * candela (lm/sr)
 */
LightConstants.INTENSITYMODE_LUMINOUSINTENSITY = 2;
/**
 * lux (lm/m^2)
 */
LightConstants.INTENSITYMODE_ILLUMINANCE = 3;
/**
 * nit (cd/m^2)
 */
LightConstants.INTENSITYMODE_LUMINANCE = 4;
// Light types ids const.
/**
 * Light type const id of the point light.
 */
LightConstants.LIGHTTYPEID_POINTLIGHT = 0;
/**
 * Light type const id of the directional light.
 */
LightConstants.LIGHTTYPEID_DIRECTIONALLIGHT = 1;
/**
 * Light type const id of the spot light.
 */
LightConstants.LIGHTTYPEID_SPOTLIGHT = 2;
/**
 * Light type const id of the hemispheric light.
 */
LightConstants.LIGHTTYPEID_HEMISPHERICLIGHT = 3;
//# sourceMappingURL=lightConstants.js.map

/***/ }),

/***/ 67524:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   H: () => (/* binding */ PointLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4870);
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(64704);
/* harmony import */ var _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(83316);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56552);







_node_js__WEBPACK_IMPORTED_MODULE_3__/* .Node */ .b.AddNodeConstructor("Light_Type_0", (name, scene) => {
    return () => new PointLight(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero(), scene);
});
/**
 * A point light is a light defined by an unique point in world space.
 * The light is emitted in every direction from this point.
 * A good example of a point light is a standard light bulb.
 * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
 */
class PointLight extends _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__/* .ShadowLight */ .p {
    /**
     * Getter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
     * This specifies what angle the shadow will use to be created.
     *
     * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.
     */
    get shadowAngle() {
        return this._shadowAngle;
    }
    /**
     * Setter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
     * This specifies what angle the shadow will use to be created.
     *
     * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.
     */
    set shadowAngle(value) {
        this._shadowAngle = value;
        this.forceProjectionMatrixCompute();
    }
    /**
     * Gets the direction if it has been set.
     * In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
     */
    get direction() {
        return this._direction;
    }
    /**
     * In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
     */
    set direction(value) {
        const previousNeedCube = this.needCube();
        this._direction = value;
        if (this.needCube() !== previousNeedCube && this._shadowGenerators) {
            const iterator = this._shadowGenerators.values();
            for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
                const shadowGenerator = key.value;
                shadowGenerator.recreateShadowMap();
            }
        }
    }
    /**
     * Creates a PointLight object from the passed name and position (Vector3) and adds it in the scene.
     * A PointLight emits the light in every direction.
     * It can cast shadows.
     * If the scene camera is already defined and you want to set your PointLight at the camera position, just set it :
     * ```javascript
     * var pointLight = new PointLight("pl", camera.position, scene);
     * ```
     * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
     * @param name The light friendly name
     * @param position The position of the point light in the scene
     * @param scene The scene the lights belongs to
     */
    constructor(name, position, scene) {
        super(name, scene);
        this._shadowAngle = Math.PI / 2;
        this.position = position;
    }
    /**
     * Returns the string "PointLight"
     * @returns the class name
     */
    getClassName() {
        return "PointLight";
    }
    /**
     * Returns the integer 0.
     * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
     */
    getTypeID() {
        return _light_js__WEBPACK_IMPORTED_MODULE_4__/* .Light */ .v.LIGHTTYPEID_POINTLIGHT;
    }
    /**
     * Specifies whether or not the shadowmap should be a cube texture.
     * @returns true if the shadowmap needs to be a cube texture.
     */
    needCube() {
        return !this.direction;
    }
    /**
     * Returns a new Vector3 aligned with the PointLight cube system according to the passed cube face index (integer).
     * @param faceIndex The index of the face we are computed the direction to generate shadow
     * @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true
     */
    getShadowDirection(faceIndex) {
        if (this.direction) {
            return super.getShadowDirection(faceIndex);
        }
        else {
            switch (faceIndex) {
                case 0:
                    return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(1.0, 0.0, 0.0);
                case 1:
                    return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(-1.0, 0.0, 0.0);
                case 2:
                    return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0.0, -1.0, 0.0);
                case 3:
                    return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0.0, 1.0, 0.0);
                case 4:
                    return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0.0, 0.0, 1.0);
                case 5:
                    return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0.0, 0.0, -1.0);
            }
        }
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
    }
    /**
     * Sets the passed matrix "matrix" as a left-handed perspective projection matrix with the following settings :
     * - fov = PI / 2
     * - aspect ratio : 1.0
     * - z-near and far equal to the active camera minZ and maxZ.
     * Returns the PointLight.
     * @param matrix
     * @param viewMatrix
     * @param renderList
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {
        const activeCamera = this.getScene().activeCamera;
        if (!activeCamera) {
            return;
        }
        const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
        const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
        const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.PerspectiveFovLHToRef(this.shadowAngle, 1.0, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, true, this._scene.getEngine().isNDCHalfZRange, undefined, useReverseDepthBuffer);
    }
    _buildUniformLayout() {
        this._uniformBuffer.addUniform("vLightData", 4);
        this._uniformBuffer.addUniform("vLightDiffuse", 4);
        this._uniformBuffer.addUniform("vLightSpecular", 4);
        this._uniformBuffer.addUniform("vLightFalloff", 4);
        this._uniformBuffer.addUniform("shadowsInfo", 3);
        this._uniformBuffer.addUniform("depthValues", 2);
        this._uniformBuffer.create();
    }
    /**
     * Sets the passed Effect "effect" with the PointLight transformed position (or position, if none) and passed name (string).
     * @param effect The effect to update
     * @param lightIndex The index of the light in the effect to update
     * @returns The point light
     */
    transferToEffect(effect, lightIndex) {
        if (this.computeTransformedInformation()) {
            this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0.0, lightIndex);
        }
        else {
            this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, 0, lightIndex);
        }
        this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, 0, 0, lightIndex);
        return this;
    }
    transferToNodeMaterialEffect(effect, lightDataUniformName) {
        if (this.computeTransformedInformation()) {
            effect.setFloat3(lightDataUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z);
        }
        else {
            effect.setFloat3(lightDataUniformName, this.position.x, this.position.y, this.position.z);
        }
        return this;
    }
    /**
     * Prepares the list of defines specific to the light type.
     * @param defines the list of defines
     * @param lightIndex defines the index of the light for the effect
     */
    prepareLightSpecificDefines(defines, lightIndex) {
        defines["POINTLIGHT" + lightIndex] = true;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PointLight.prototype, "shadowAngle", null);
// Register Class Name
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .RegisterClass */ .Y5)("BABYLON.PointLight", PointLight);
//# sourceMappingURL=pointLight.js.map

/***/ }),

/***/ 83316:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   p: () => (/* binding */ ShadowLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(64704);
/* harmony import */ var _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18733);





/**
 * Base implementation IShadowLight
 * It groups all the common behaviour in order to reduce duplication and better follow the DRY pattern.
 */
class ShadowLight extends _light_js__WEBPACK_IMPORTED_MODULE_3__/* .Light */ .v {
    constructor() {
        super(...arguments);
        this._needProjectionMatrixCompute = true;
        this._viewMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.Identity();
        this._projectionMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.Identity();
    }
    _setPosition(value) {
        this._position = value;
    }
    /**
     * Sets the position the shadow will be casted from. Also use as the light position for both
     * point and spot lights.
     */
    get position() {
        return this._position;
    }
    /**
     * Sets the position the shadow will be casted from. Also use as the light position for both
     * point and spot lights.
     */
    set position(value) {
        this._setPosition(value);
    }
    _setDirection(value) {
        this._direction = value;
    }
    /**
     * In 2d mode (needCube being false), gets the direction used to cast the shadow.
     * Also use as the light direction on spot and directional lights.
     */
    get direction() {
        return this._direction;
    }
    /**
     * In 2d mode (needCube being false), sets the direction used to cast the shadow.
     * Also use as the light direction on spot and directional lights.
     */
    set direction(value) {
        this._setDirection(value);
    }
    /**
     * Gets the shadow projection clipping minimum z value.
     */
    get shadowMinZ() {
        return this._shadowMinZ;
    }
    /**
     * Sets the shadow projection clipping minimum z value.
     */
    set shadowMinZ(value) {
        this._shadowMinZ = value;
        this.forceProjectionMatrixCompute();
    }
    /**
     * Sets the shadow projection clipping maximum z value.
     */
    get shadowMaxZ() {
        return this._shadowMaxZ;
    }
    /**
     * Gets the shadow projection clipping maximum z value.
     */
    set shadowMaxZ(value) {
        this._shadowMaxZ = value;
        this.forceProjectionMatrixCompute();
    }
    /**
     * Computes the transformed information (transformedPosition and transformedDirection in World space) of the current light
     * @returns true if the information has been computed, false if it does not need to (no parenting)
     */
    computeTransformedInformation() {
        if (this.parent && this.parent.getWorldMatrix) {
            if (!this.transformedPosition) {
                this.transformedPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
            }
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition);
            // In case the direction is present.
            if (this.direction) {
                if (!this.transformedDirection) {
                    this.transformedDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
                }
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection);
            }
            return true;
        }
        return false;
    }
    /**
     * Return the depth scale used for the shadow map.
     * @returns the depth scale.
     */
    getDepthScale() {
        return 50.0;
    }
    /**
     * Get the direction to use to render the shadow map. In case of cube texture, the face index can be passed.
     * @param faceIndex The index of the face we are computed the direction to generate shadow
     * @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    getShadowDirection(faceIndex) {
        return this.transformedDirection ? this.transformedDirection : this.direction;
    }
    /**
     * If computeTransformedInformation has been called, returns the ShadowLight absolute position in the world. Otherwise, returns the local position.
     * @returns the position vector in world space
     */
    getAbsolutePosition() {
        return this.transformedPosition ? this.transformedPosition : this.position;
    }
    /**
     * Sets the ShadowLight direction toward the passed target.
     * @param target The point to target in local space
     * @returns the updated ShadowLight direction
     */
    setDirectionToTarget(target) {
        this.direction = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Normalize(target.subtract(this.position));
        return this.direction;
    }
    /**
     * Returns the light rotation in euler definition.
     * @returns the x y z rotation in local space.
     */
    getRotation() {
        this.direction.normalize();
        const xaxis = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Cross(this.direction, _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_4__/* .Axis */ ._0.Y);
        const yaxis = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Cross(xaxis, this.direction);
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.RotationFromAxis(xaxis, yaxis, this.direction);
    }
    /**
     * Returns whether or not the shadow generation require a cube texture or a 2d texture.
     * @returns true if a cube texture needs to be use
     */
    needCube() {
        return false;
    }
    /**
     * Detects if the projection matrix requires to be recomputed this frame.
     * @returns true if it requires to be recomputed otherwise, false.
     */
    needProjectionMatrixCompute() {
        return this._needProjectionMatrixCompute;
    }
    /**
     * Forces the shadow generator to recompute the projection matrix even if position and direction did not changed.
     */
    forceProjectionMatrixCompute() {
        this._needProjectionMatrixCompute = true;
    }
    /** @internal */
    _initCache() {
        super._initCache();
        this._cache.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
    }
    /** @internal */
    _isSynchronized() {
        if (!this._cache.position.equals(this.position)) {
            return false;
        }
        return true;
    }
    /**
     * Computes the world matrix of the node
     * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch
     * @returns the world matrix
     */
    computeWorldMatrix(force) {
        if (!force && this.isSynchronized()) {
            this._currentRenderId = this.getScene().getRenderId();
            return this._worldMatrix;
        }
        this._updateCache();
        this._cache.position.copyFrom(this.position);
        if (!this._worldMatrix) {
            this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.Identity();
        }
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix);
        if (this.parent && this.parent.getWorldMatrix) {
            this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix);
            this._markSyncedWithParent();
        }
        // Cache the determinant
        this._worldMatrixDeterminantIsDirty = true;
        return this._worldMatrix;
    }
    /**
     * Gets the minZ used for shadow according to both the scene and the light.
     * @param activeCamera The camera we are returning the min for
     * @returns the depth min z
     */
    getDepthMinZ(activeCamera) {
        return this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
    }
    /**
     * Gets the maxZ used for shadow according to both the scene and the light.
     * @param activeCamera The camera we are returning the max for
     * @returns the depth max z
     */
    getDepthMaxZ(activeCamera) {
        return this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
    }
    /**
     * Sets the shadow projection matrix in parameter to the generated projection matrix.
     * @param matrix The matrix to updated with the projection information
     * @param viewMatrix The transform matrix of the light
     * @param renderList The list of mesh to render in the map
     * @returns The current light
     */
    setShadowProjectionMatrix(matrix, viewMatrix, renderList) {
        if (this.customProjectionMatrixBuilder) {
            this.customProjectionMatrixBuilder(viewMatrix, renderList, matrix);
        }
        else {
            this._setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList);
        }
        return this;
    }
    /** @internal */
    _syncParentEnabledState() {
        super._syncParentEnabledState();
        if (!this.parent || !this.parent.getWorldMatrix) {
            this.transformedPosition = null;
            this.transformedDirection = null;
        }
    }
    /**
     * Returns the view matrix.
     * @param faceIndex The index of the face for which we want to extract the view matrix. Only used for point light types.
     * @returns The view matrix. Can be null, if a view matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
     */
    getViewMatrix(faceIndex) {
        const lightDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0];
        let lightPosition = this.position;
        if (this.computeTransformedInformation()) {
            lightPosition = this.transformedPosition;
        }
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.NormalizeToRef(this.getShadowDirection(faceIndex), lightDirection);
        if (Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Dot(lightDirection, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Up())) === 1.0) {
            lightDirection.z = 0.0000000000001; // Required to avoid perfectly perpendicular light
        }
        const lightTarget = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[1];
        lightPosition.addToRef(lightDirection, lightTarget);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.LookAtLHToRef(lightPosition, lightTarget, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Up(), this._viewMatrix);
        return this._viewMatrix;
    }
    /**
     * Returns the projection matrix.
     * Note that viewMatrix and renderList are optional and are only used by lights that calculate the projection matrix from a list of meshes (e.g. directional lights with automatic extents calculation).
     * @param viewMatrix The view transform matrix of the light (optional).
     * @param renderList The list of meshes to take into account when calculating the projection matrix (optional).
     * @returns The projection matrix. Can be null, if a projection matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
     */
    getProjectionMatrix(viewMatrix, renderList) {
        this.setShadowProjectionMatrix(this._projectionMatrix, viewMatrix ?? this._viewMatrix, renderList ?? []);
        return this._projectionMatrix;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)()
], ShadowLight.prototype, "position", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)()
], ShadowLight.prototype, "direction", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ShadowLight.prototype, "shadowMinZ", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ShadowLight.prototype, "shadowMaxZ", null);
//# sourceMappingURL=shadowLight.js.map

/***/ }),

/***/ 40136:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   n: () => (/* binding */ SpotLight)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4870);
/* harmony import */ var _light_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(64704);
/* harmony import */ var _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(83316);
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7481);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56552);








_node_js__WEBPACK_IMPORTED_MODULE_3__/* .Node */ .b.AddNodeConstructor("Light_Type_2", (name, scene) => {
    return () => new SpotLight(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero(), 0, 0, scene);
});
/**
 * A spot light is defined by a position, a direction, an angle, and an exponent.
 * These values define a cone of light starting from the position, emitting toward the direction.
 * The angle, in radians, defines the size (field of illumination) of the spotlight's conical beam,
 * and the exponent defines the speed of the decay of the light with distance (reach).
 * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
 */
class SpotLight extends _shadowLight_js__WEBPACK_IMPORTED_MODULE_5__/* .ShadowLight */ .p {
    /**
     * Gets the cone angle of the spot light in Radians.
     */
    get angle() {
        return this._angle;
    }
    /**
     * Sets the cone angle of the spot light in Radians.
     */
    set angle(value) {
        this._angle = value;
        this._cosHalfAngle = Math.cos(value * 0.5);
        this._projectionTextureProjectionLightDirty = true;
        this.forceProjectionMatrixCompute();
        this._computeAngleValues();
    }
    /**
     * Only used in gltf falloff mode, this defines the angle where
     * the directional falloff will start before cutting at angle which could be seen
     * as outer angle.
     */
    get innerAngle() {
        return this._innerAngle;
    }
    /**
     * Only used in gltf falloff mode, this defines the angle where
     * the directional falloff will start before cutting at angle which could be seen
     * as outer angle.
     */
    set innerAngle(value) {
        this._innerAngle = value;
        this._computeAngleValues();
    }
    /**
     * Allows scaling the angle of the light for shadow generation only.
     */
    get shadowAngleScale() {
        return this._shadowAngleScale;
    }
    /**
     * Allows scaling the angle of the light for shadow generation only.
     */
    set shadowAngleScale(value) {
        this._shadowAngleScale = value;
        this.forceProjectionMatrixCompute();
    }
    /**
     * Allows reading the projection texture
     */
    get projectionTextureMatrix() {
        return this._projectionTextureMatrix;
    }
    /**
     * Gets the near clip of the Spotlight for texture projection.
     */
    get projectionTextureLightNear() {
        return this._projectionTextureLightNear;
    }
    /**
     * Sets the near clip of the Spotlight for texture projection.
     */
    set projectionTextureLightNear(value) {
        this._projectionTextureLightNear = value;
        this._projectionTextureProjectionLightDirty = true;
    }
    /**
     * Gets the far clip of the Spotlight for texture projection.
     */
    get projectionTextureLightFar() {
        return this._projectionTextureLightFar;
    }
    /**
     * Sets the far clip of the Spotlight for texture projection.
     */
    set projectionTextureLightFar(value) {
        this._projectionTextureLightFar = value;
        this._projectionTextureProjectionLightDirty = true;
    }
    /**
     * Gets the Up vector of the Spotlight for texture projection.
     */
    get projectionTextureUpDirection() {
        return this._projectionTextureUpDirection;
    }
    /**
     * Sets the Up vector of the Spotlight for texture projection.
     */
    set projectionTextureUpDirection(value) {
        this._projectionTextureUpDirection = value;
        this._projectionTextureProjectionLightDirty = true;
    }
    /**
     * Gets the projection texture of the light.
     */
    get projectionTexture() {
        return this._projectionTexture;
    }
    /**
     * Sets the projection texture of the light.
     */
    set projectionTexture(value) {
        if (this._projectionTexture === value) {
            return;
        }
        this._projectionTexture = value;
        this._projectionTextureDirty = true;
        if (this._projectionTexture && !this._projectionTexture.isReady()) {
            if (SpotLight._IsProceduralTexture(this._projectionTexture)) {
                this._projectionTexture.getEffect().executeWhenCompiled(() => {
                    this._markMeshesAsLightDirty();
                });
            }
            else if (SpotLight._IsTexture(this._projectionTexture)) {
                this._projectionTexture.onLoadObservable.addOnce(() => {
                    this._markMeshesAsLightDirty();
                });
            }
        }
    }
    static _IsProceduralTexture(texture) {
        return texture.onGeneratedObservable !== undefined;
    }
    static _IsTexture(texture) {
        return texture.onLoadObservable !== undefined;
    }
    /**
     * Gets or sets the light projection matrix as used by the projection texture
     */
    get projectionTextureProjectionLightMatrix() {
        return this._projectionTextureProjectionLightMatrix;
    }
    set projectionTextureProjectionLightMatrix(projection) {
        this._projectionTextureProjectionLightMatrix = projection;
        this._projectionTextureProjectionLightDirty = false;
        this._projectionTextureDirty = true;
    }
    /**
     * Creates a SpotLight object in the scene. A spot light is a simply light oriented cone.
     * It can cast shadows.
     * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
     * @param name The light friendly name
     * @param position The position of the spot light in the scene
     * @param direction The direction of the light in the scene
     * @param angle The cone angle of the light in Radians
     * @param exponent The light decay speed with the distance from the emission spot
     * @param scene The scene the lights belongs to
     */
    constructor(name, position, direction, angle, exponent, scene) {
        super(name, scene);
        this._innerAngle = 0;
        this._projectionTextureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.Zero();
        this._projectionTextureLightNear = 1e-6;
        this._projectionTextureLightFar = 1000.0;
        this._projectionTextureUpDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Up();
        this._projectionTextureViewLightDirty = true;
        this._projectionTextureProjectionLightDirty = true;
        this._projectionTextureDirty = true;
        this._projectionTextureViewTargetVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        this._projectionTextureViewLightMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.Zero();
        this._projectionTextureProjectionLightMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.Zero();
        this._projectionTextureScalingMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromValues(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);
        this.position = position;
        this.direction = direction;
        this.angle = angle;
        this.exponent = exponent;
    }
    /**
     * Returns the string "SpotLight".
     * @returns the class name
     */
    getClassName() {
        return "SpotLight";
    }
    /**
     * Returns the integer 2.
     * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
     */
    getTypeID() {
        return _light_js__WEBPACK_IMPORTED_MODULE_4__/* .Light */ .v.LIGHTTYPEID_SPOTLIGHT;
    }
    /**
     * Overrides the direction setter to recompute the projection texture view light Matrix.
     * @param value
     */
    _setDirection(value) {
        super._setDirection(value);
        this._projectionTextureViewLightDirty = true;
    }
    /**
     * Overrides the position setter to recompute the projection texture view light Matrix.
     * @param value
     */
    _setPosition(value) {
        super._setPosition(value);
        this._projectionTextureViewLightDirty = true;
    }
    /**
     * Sets the passed matrix "matrix" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.
     * Returns the SpotLight.
     * @param matrix
     * @param viewMatrix
     * @param renderList
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {
        const activeCamera = this.getScene().activeCamera;
        if (!activeCamera) {
            return;
        }
        this._shadowAngleScale = this._shadowAngleScale || 1;
        const angle = this._shadowAngleScale * this._angle;
        const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
        const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
        const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.PerspectiveFovLHToRef(angle, 1.0, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, true, this._scene.getEngine().isNDCHalfZRange, undefined, useReverseDepthBuffer);
    }
    _computeProjectionTextureViewLightMatrix() {
        this._projectionTextureViewLightDirty = false;
        this._projectionTextureDirty = true;
        this.getAbsolutePosition().addToRef(this.getShadowDirection(), this._projectionTextureViewTargetVector);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.LookAtLHToRef(this.getAbsolutePosition(), this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix);
    }
    _computeProjectionTextureProjectionLightMatrix() {
        this._projectionTextureProjectionLightDirty = false;
        this._projectionTextureDirty = true;
        const lightFar = this.projectionTextureLightFar;
        const lightNear = this.projectionTextureLightNear;
        const P = lightFar / (lightFar - lightNear);
        const Q = -P * lightNear;
        const S = 1.0 / Math.tan(this._angle / 2.0);
        const A = 1.0;
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromValuesToRef(S / A, 0.0, 0.0, 0.0, 0.0, S, 0.0, 0.0, 0.0, 0.0, P, 1.0, 0.0, 0.0, Q, 0.0, this._projectionTextureProjectionLightMatrix);
    }
    /**
     * Main function for light texture projection matrix computing.
     */
    _computeProjectionTextureMatrix() {
        this._projectionTextureDirty = false;
        this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix);
        if (this._projectionTexture instanceof _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_6__/* .Texture */ .g) {
            const u = this._projectionTexture.uScale / 2.0;
            const v = this._projectionTexture.vScale / 2.0;
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromValuesToRef(u, 0.0, 0.0, 0.0, 0.0, v, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0, this._projectionTextureScalingMatrix);
        }
        this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix);
    }
    _buildUniformLayout() {
        this._uniformBuffer.addUniform("vLightData", 4);
        this._uniformBuffer.addUniform("vLightDiffuse", 4);
        this._uniformBuffer.addUniform("vLightSpecular", 4);
        this._uniformBuffer.addUniform("vLightDirection", 3);
        this._uniformBuffer.addUniform("vLightFalloff", 4);
        this._uniformBuffer.addUniform("shadowsInfo", 3);
        this._uniformBuffer.addUniform("depthValues", 2);
        this._uniformBuffer.create();
    }
    _computeAngleValues() {
        this._lightAngleScale = 1.0 / Math.max(0.001, Math.cos(this._innerAngle * 0.5) - this._cosHalfAngle);
        this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale;
    }
    /**
     * Sets the passed Effect "effect" with the Light textures.
     * @param effect The effect to update
     * @param lightIndex The index of the light in the effect to update
     * @returns The light
     */
    transferTexturesToEffect(effect, lightIndex) {
        if (this.projectionTexture && this.projectionTexture.isReady()) {
            if (this._projectionTextureViewLightDirty) {
                this._computeProjectionTextureViewLightMatrix();
            }
            if (this._projectionTextureProjectionLightDirty) {
                this._computeProjectionTextureProjectionLightMatrix();
            }
            if (this._projectionTextureDirty) {
                this._computeProjectionTextureMatrix();
            }
            effect.setMatrix("textureProjectionMatrix" + lightIndex, this._projectionTextureMatrix);
            effect.setTexture("projectionLightTexture" + lightIndex, this.projectionTexture);
        }
        return this;
    }
    /**
     * Sets the passed Effect object with the SpotLight transformed position (or position if not parented) and normalized direction.
     * @param effect The effect to update
     * @param lightIndex The index of the light in the effect to update
     * @returns The spot light
     */
    transferToEffect(effect, lightIndex) {
        let normalizeDirection;
        if (this.computeTransformedInformation()) {
            this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, lightIndex);
            normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Normalize(this.transformedDirection);
        }
        else {
            this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, this.exponent, lightIndex);
            normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Normalize(this.direction);
        }
        this._uniformBuffer.updateFloat4("vLightDirection", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, this._cosHalfAngle, lightIndex);
        this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, lightIndex);
        return this;
    }
    transferToNodeMaterialEffect(effect, lightDataUniformName) {
        let normalizeDirection;
        if (this.computeTransformedInformation()) {
            normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Normalize(this.transformedDirection);
        }
        else {
            normalizeDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Normalize(this.direction);
        }
        if (this.getScene().useRightHandedSystem) {
            effect.setFloat3(lightDataUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z);
        }
        else {
            effect.setFloat3(lightDataUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z);
        }
        return this;
    }
    /**
     * Disposes the light and the associated resources.
     */
    dispose() {
        super.dispose();
        if (this._projectionTexture) {
            this._projectionTexture.dispose();
        }
    }
    /**
     * Gets the minZ used for shadow according to both the scene and the light.
     * @param activeCamera The camera we are returning the min for
     * @returns the depth min z
     */
    getDepthMinZ(activeCamera) {
        const engine = this._scene.getEngine();
        const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
        return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? minZ : this._scene.getEngine().isNDCHalfZRange ? 0 : minZ;
    }
    /**
     * Gets the maxZ used for shadow according to both the scene and the light.
     * @param activeCamera The camera we are returning the max for
     * @returns the depth max z
     */
    getDepthMaxZ(activeCamera) {
        const engine = this._scene.getEngine();
        const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
        return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : maxZ;
    }
    /**
     * Prepares the list of defines specific to the light type.
     * @param defines the list of defines
     * @param lightIndex defines the index of the light for the effect
     */
    prepareLightSpecificDefines(defines, lightIndex) {
        defines["SPOTLIGHT" + lightIndex] = true;
        defines["PROJECTEDLIGHTTEXTURE" + lightIndex] = this.projectionTexture && this.projectionTexture.isReady() ? true : false;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], SpotLight.prototype, "angle", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], SpotLight.prototype, "innerAngle", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], SpotLight.prototype, "shadowAngleScale", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], SpotLight.prototype, "exponent", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], SpotLight.prototype, "projectionTextureLightNear", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], SpotLight.prototype, "projectionTextureLightFar", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], SpotLight.prototype, "projectionTextureUpDirection", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("projectedLightTexture")
], SpotLight.prototype, "_projectionTexture", void 0);
// Register Class Name
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_7__/* .RegisterClass */ .Y5)("BABYLON.SpotLight", SpotLight);
//# sourceMappingURL=spotLight.js.map

/***/ }),

/***/ 93084:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Iz: () => (/* binding */ GetParser),
/* harmony export */   LO: () => (/* binding */ GetIndividualParser),
/* harmony export */   cf: () => (/* binding */ AddIndividualParser),
/* harmony export */   ji: () => (/* binding */ AddParser),
/* harmony export */   oj: () => (/* binding */ Parse)
/* harmony export */ });
/**
 * Stores the list of available parsers in the application.
 */
const _BabylonFileParsers = {};
/**
 * Stores the list of available individual parsers in the application.
 */
const _IndividualBabylonFileParsers = {};
/**
 * Adds a parser in the list of available ones
 * @param name Defines the name of the parser
 * @param parser Defines the parser to add
 */
function AddParser(name, parser) {
    _BabylonFileParsers[name] = parser;
}
/**
 * Gets a general parser from the list of available ones
 * @param name Defines the name of the parser
 * @returns the requested parser or null
 */
function GetParser(name) {
    if (_BabylonFileParsers[name]) {
        return _BabylonFileParsers[name];
    }
    return null;
}
/**
 * Adds n individual parser in the list of available ones
 * @param name Defines the name of the parser
 * @param parser Defines the parser to add
 */
function AddIndividualParser(name, parser) {
    _IndividualBabylonFileParsers[name] = parser;
}
/**
 * Gets an individual parser from the list of available ones
 * @param name Defines the name of the parser
 * @returns the requested parser or null
 */
function GetIndividualParser(name) {
    if (_IndividualBabylonFileParsers[name]) {
        return _IndividualBabylonFileParsers[name];
    }
    return null;
}
/**
 * Parser json data and populate both a scene and its associated container object
 * @param jsonData Defines the data to parse
 * @param scene Defines the scene to parse the data for
 * @param container Defines the container attached to the parsing sequence
 * @param rootUrl Defines the root url of the data
 */
function Parse(jsonData, scene, container, rootUrl) {
    for (const parserName in _BabylonFileParsers) {
        if (Object.prototype.hasOwnProperty.call(_BabylonFileParsers, parserName)) {
            _BabylonFileParsers[parserName](jsonData, scene, container, rootUrl);
        }
    }
}
//# sourceMappingURL=babylonFileParser.function.js.map

/***/ }),

/***/ 15909:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  cn: () => (/* binding */ SceneLoader),
  gD: () => (/* binding */ SceneLoaderAnimationGroupLoadingMode),
  VU: () => (/* binding */ appendSceneAsync),
  fV: () => (/* binding */ importAnimationsAsync),
  kS: () => (/* binding */ loadAssetContainerAsync),
  VA: () => (/* binding */ loadSceneAsync),
  cH: () => (/* binding */ registerSceneLoaderPlugin)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__(998);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__(99848);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/scene.js + 2 modules
var scene = __webpack_require__(87491);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engineStore.js
var engineStore = __webpack_require__(6315);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__(51137);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Loading/sceneLoaderFlags.js
var sceneLoaderFlags = __webpack_require__(7597);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/fileTools.js
var fileTools = __webpack_require__(8532);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/error.js
var error = __webpack_require__(88563);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/guid.js
var guid = __webpack_require__(38688);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/abstractEngine.js
var abstractEngine = __webpack_require__(32206);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/webRequest.js
var webRequest = __webpack_require__(62366);
;// ./node_modules/@babylonjs/core/Misc/webRequest.fetch.js

/**
 * Fetches a resource from the network
 * @param url defines the url to fetch the resource from
 * @param options defines the options to use when fetching the resource
 * @returns a promise that resolves when the resource is fetched
 * @internal
 */
function _FetchAsync(url, options) {
    const method = options.method || "GET";
    return new Promise((resolve, reject) => {
        const request = new webRequest/* WebRequest */.u();
        request.addEventListener("readystatechange", () => {
            if (request.readyState == 4) {
                if (request.status == 200) {
                    const headerValues = {};
                    if (options.responseHeaders) {
                        for (const header of options.responseHeaders) {
                            headerValues[header] = request.getResponseHeader(header) || "";
                        }
                    }
                    resolve({ response: request.response, headerValues: headerValues });
                }
                else {
                    reject(`Unable to fetch data from ${url}. Error code: ${request.status}`);
                }
            }
        });
        request.open(method, url);
        request.send();
    });
}
//# sourceMappingURL=webRequest.fetch.js.map
;// ./node_modules/@babylonjs/core/Loading/sceneLoader.js












/**
 * Mode that determines how to handle old animation groups before loading new ones.
 */
var SceneLoaderAnimationGroupLoadingMode;
(function (SceneLoaderAnimationGroupLoadingMode) {
    /**
     * Reset all old animations to initial state then dispose them.
     */
    SceneLoaderAnimationGroupLoadingMode[SceneLoaderAnimationGroupLoadingMode["Clean"] = 0] = "Clean";
    /**
     * Stop all old animations.
     */
    SceneLoaderAnimationGroupLoadingMode[SceneLoaderAnimationGroupLoadingMode["Stop"] = 1] = "Stop";
    /**
     * Restart old animations from first frame.
     */
    SceneLoaderAnimationGroupLoadingMode[SceneLoaderAnimationGroupLoadingMode["Sync"] = 2] = "Sync";
    /**
     * Old animations remains untouched.
     */
    SceneLoaderAnimationGroupLoadingMode[SceneLoaderAnimationGroupLoadingMode["NoSync"] = 3] = "NoSync";
})(SceneLoaderAnimationGroupLoadingMode || (SceneLoaderAnimationGroupLoadingMode = {}));
function isFactory(pluginOrFactory) {
    return !!pluginOrFactory.createPlugin;
}
function isFile(value) {
    return !!value.name;
}
const onPluginActivatedObservable = new observable/* Observable */.cP();
const registeredPlugins = {};
let showingLoadingScreen = false;
function getDefaultPlugin() {
    return registeredPlugins[".babylon"];
}
function getPluginForMimeType(mimeType) {
    for (const registeredPluginKey in registeredPlugins) {
        const registeredPlugin = registeredPlugins[registeredPluginKey];
        if (registeredPlugin.mimeType === mimeType) {
            return registeredPlugin;
        }
    }
    return undefined;
}
function getPluginForExtension(extension, returnDefault) {
    const registeredPlugin = registeredPlugins[extension];
    if (registeredPlugin) {
        return registeredPlugin;
    }
    logger/* Logger */.V.Warn("Unable to find a plugin to load " +
        extension +
        " files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes");
    return returnDefault ? getDefaultPlugin() : undefined;
}
function isPluginForExtensionAvailable(extension) {
    return !!registeredPlugins[extension];
}
function getPluginForDirectLoad(data) {
    for (const extension in registeredPlugins) {
        const plugin = registeredPlugins[extension].plugin;
        if (plugin.canDirectLoad && plugin.canDirectLoad(data)) {
            return registeredPlugins[extension];
        }
    }
    return getDefaultPlugin();
}
function getFilenameExtension(sceneFilename) {
    const queryStringPosition = sceneFilename.indexOf("?");
    if (queryStringPosition !== -1) {
        sceneFilename = sceneFilename.substring(0, queryStringPosition);
    }
    const dotPosition = sceneFilename.lastIndexOf(".");
    return sceneFilename.substring(dotPosition, sceneFilename.length).toLowerCase();
}
function getDirectLoad(sceneFilename) {
    if (sceneFilename.substring(0, 5) === "data:") {
        return sceneFilename.substring(5);
    }
    return null;
}
function formatErrorMessage(fileInfo, message, exception) {
    const fromLoad = fileInfo.rawData ? "binary data" : fileInfo.url;
    let errorMessage = "Unable to load from " + fromLoad;
    if (message) {
        errorMessage += `: ${message}`;
    }
    else if (exception) {
        errorMessage += `: ${exception}`;
    }
    return errorMessage;
}
async function loadDataAsync(fileInfo, scene, onSuccess, onProgress, onError, onDispose, pluginExtension, name, pluginOptions) {
    const directLoad = getDirectLoad(fileInfo.url);
    if (fileInfo.rawData && !pluginExtension) {
        // eslint-disable-next-line no-throw-literal
        throw "When using ArrayBufferView to load data the file extension must be provided.";
    }
    const fileExtension = !directLoad && !pluginExtension ? getFilenameExtension(fileInfo.url) : "";
    let registeredPlugin = pluginExtension
        ? getPluginForExtension(pluginExtension, true)
        : directLoad
            ? getPluginForDirectLoad(fileInfo.url)
            : getPluginForExtension(fileExtension, false);
    if (!registeredPlugin && fileExtension) {
        if (fileInfo.url && !fileInfo.url.startsWith("blob:")) {
            // Fetching head content to get the mime type
            const response = await _FetchAsync(fileInfo.url, { method: "HEAD", responseHeaders: ["Content-Type"] });
            const mimeType = response.headerValues ? response.headerValues["Content-Type"] : "";
            if (mimeType) {
                registeredPlugin = getPluginForMimeType(mimeType);
            }
        }
        if (!registeredPlugin) {
            registeredPlugin = getDefaultPlugin();
        }
    }
    if (!registeredPlugin) {
        throw new Error(`No plugin or fallback for ${pluginExtension ?? fileInfo.url}`);
    }
    if (pluginOptions?.[registeredPlugin.plugin.name]?.enabled === false) {
        throw new Error(`The '${registeredPlugin.plugin.name}' plugin is disabled via the loader options passed to the loading operation.`);
    }
    if (fileInfo.rawData && !registeredPlugin.isBinary) {
        // eslint-disable-next-line no-throw-literal
        throw "Loading from ArrayBufferView can not be used with plugins that don't support binary loading.";
    }
    const getPluginInstance = (callback) => {
        // For plugin factories, the plugin is instantiated on each SceneLoader operation. This makes options handling
        // much simpler as we can just pass the options to the factory, rather than passing options through to every possible
        // plugin call. Given this, options are only supported for plugins that provide a factory function.
        if (isFactory(registeredPlugin.plugin)) {
            const pluginFactory = registeredPlugin.plugin;
            const partialPlugin = pluginFactory.createPlugin(pluginOptions ?? {});
            if (partialPlugin instanceof Promise) {
                partialPlugin.then(callback).catch((error) => {
                    onError("Error instantiating plugin.", error);
                });
                // When async factories are used, the plugin instance cannot be returned synchronously.
                // In this case, the legacy loader functions will return null.
                return null;
            }
            else {
                callback(partialPlugin);
                return partialPlugin;
            }
        }
        else {
            callback(registeredPlugin.plugin);
            return registeredPlugin.plugin;
        }
    };
    return getPluginInstance((plugin) => {
        if (!plugin) {
            // eslint-disable-next-line no-throw-literal
            throw `The loader plugin corresponding to the '${pluginExtension}' file type has not been found. If using es6, please import the plugin you wish to use before.`;
        }
        onPluginActivatedObservable.notifyObservers(plugin);
        // Check if we have a direct load url. If the plugin is registered to handle
        // it or it's not a base64 data url, then pass it through the direct load path.
        if (directLoad && ((plugin.canDirectLoad && plugin.canDirectLoad(fileInfo.url)) || !(0,fileTools/* IsBase64DataUrl */.f2)(fileInfo.url))) {
            if (plugin.directLoad) {
                const result = plugin.directLoad(scene, directLoad);
                if (result instanceof Promise) {
                    result
                        .then((data) => {
                        onSuccess(plugin, data);
                    })
                        .catch((error) => {
                        onError("Error in directLoad of _loadData: " + error, error);
                    });
                }
                else {
                    onSuccess(plugin, result);
                }
            }
            else {
                onSuccess(plugin, directLoad);
            }
            return;
        }
        const useArrayBuffer = registeredPlugin.isBinary;
        const dataCallback = (data, responseURL) => {
            if (scene.isDisposed) {
                onError("Scene has been disposed");
                return;
            }
            onSuccess(plugin, data, responseURL);
        };
        let request = null;
        let pluginDisposed = false;
        plugin.onDisposeObservable?.add(() => {
            pluginDisposed = true;
            if (request) {
                request.abort();
                request = null;
            }
            onDispose();
        });
        const manifestChecked = () => {
            if (pluginDisposed) {
                return;
            }
            const errorCallback = (request, exception) => {
                onError(request?.statusText, exception);
            };
            if (!plugin.loadFile && fileInfo.rawData) {
                // eslint-disable-next-line no-throw-literal
                throw "Plugin does not support loading ArrayBufferView.";
            }
            request = plugin.loadFile
                ? plugin.loadFile(scene, fileInfo.rawData || fileInfo.file || fileInfo.url, fileInfo.rootUrl, dataCallback, onProgress, useArrayBuffer, errorCallback, name)
                : scene._loadFile(fileInfo.file || fileInfo.url, dataCallback, onProgress, true, useArrayBuffer, errorCallback);
        };
        const engine = scene.getEngine();
        let canUseOfflineSupport = engine.enableOfflineSupport;
        if (canUseOfflineSupport) {
            // Also check for exceptions
            let exceptionFound = false;
            for (const regex of scene.disableOfflineSupportExceptionRules) {
                if (regex.test(fileInfo.url)) {
                    exceptionFound = true;
                    break;
                }
            }
            canUseOfflineSupport = !exceptionFound;
        }
        if (canUseOfflineSupport && abstractEngine/* AbstractEngine */.$.OfflineProviderFactory) {
            // Checking if a manifest file has been set for this scene and if offline mode has been requested
            scene.offlineProvider = abstractEngine/* AbstractEngine */.$.OfflineProviderFactory(fileInfo.url, manifestChecked, engine.disableManifestCheck);
        }
        else {
            manifestChecked();
        }
    });
}
function _getFileInfo(rootUrl, sceneSource) {
    let url;
    let name;
    let file = null;
    let rawData = null;
    if (!sceneSource) {
        url = rootUrl;
        name = tools/* Tools */.S0.GetFilename(rootUrl);
        rootUrl = tools/* Tools */.S0.GetFolderPath(rootUrl);
    }
    else if (isFile(sceneSource)) {
        url = `file:${sceneSource.name}`;
        name = sceneSource.name;
        file = sceneSource;
    }
    else if (ArrayBuffer.isView(sceneSource)) {
        url = "";
        name = (0,guid/* RandomGUID */.z)();
        rawData = sceneSource;
    }
    else if (sceneSource.startsWith("data:")) {
        url = sceneSource;
        name = "";
    }
    else if (rootUrl) {
        const filename = sceneSource;
        if (filename.substring(0, 1) === "/") {
            tools/* Tools */.S0.Error("Wrong sceneFilename parameter");
            return null;
        }
        url = rootUrl + filename;
        name = filename;
    }
    else {
        url = sceneSource;
        name = tools/* Tools */.S0.GetFilename(sceneSource);
        rootUrl = tools/* Tools */.S0.GetFolderPath(sceneSource);
    }
    return {
        url: url,
        rootUrl: rootUrl,
        name: name,
        file: file,
        rawData,
    };
}
/**
 * Adds a new plugin to the list of registered plugins
 * @param plugin defines the plugin to add
 */
function registerSceneLoaderPlugin(plugin) {
    if (typeof plugin.extensions === "string") {
        const extension = plugin.extensions;
        registeredPlugins[extension.toLowerCase()] = {
            plugin: plugin,
            isBinary: false,
        };
    }
    else {
        const extensions = plugin.extensions;
        Object.keys(extensions).forEach((extension) => {
            registeredPlugins[extension.toLowerCase()] = {
                plugin: plugin,
                isBinary: extensions[extension].isBinary,
                mimeType: extensions[extension].mimeType,
            };
        });
    }
}
async function importMeshAsync(meshNames, rootUrl, sceneFilename = "", scene = engineStore/* EngineStore */.q.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "", pluginOptions = {}) {
    if (!scene) {
        logger/* Logger */.V.Error("No scene available to import mesh to");
        return null;
    }
    const fileInfo = _getFileInfo(rootUrl, sceneFilename);
    if (!fileInfo) {
        return null;
    }
    const loadingToken = {};
    scene.addPendingData(loadingToken);
    const disposeHandler = () => {
        scene.removePendingData(loadingToken);
    };
    const errorHandler = (message, exception) => {
        const errorMessage = formatErrorMessage(fileInfo, message, exception);
        if (onError) {
            onError(scene, errorMessage, new error/* RuntimeError */.bu(errorMessage, error/* ErrorCodes */.tG.SceneLoaderError, exception));
        }
        else {
            logger/* Logger */.V.Error(errorMessage);
            // should the exception be thrown?
        }
        disposeHandler();
    };
    const progressHandler = onProgress
        ? (event) => {
            try {
                onProgress(event);
            }
            catch (e) {
                errorHandler("Error in onProgress callback: " + e, e);
            }
        }
        : undefined;
    const successHandler = (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights, spriteManagers) => {
        scene.importedMeshesFiles.push(fileInfo.url);
        if (onSuccess) {
            try {
                onSuccess(meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights, spriteManagers);
            }
            catch (e) {
                errorHandler("Error in onSuccess callback: " + e, e);
            }
        }
        scene.removePendingData(loadingToken);
    };
    return await loadDataAsync(fileInfo, scene, (plugin, data, responseURL) => {
        if (plugin.rewriteRootURL) {
            fileInfo.rootUrl = plugin.rewriteRootURL(fileInfo.rootUrl, responseURL);
        }
        if (plugin.importMesh) {
            const syncedPlugin = plugin;
            const meshes = [];
            const particleSystems = [];
            const skeletons = [];
            if (!syncedPlugin.importMesh(meshNames, scene, data, fileInfo.rootUrl, meshes, particleSystems, skeletons, errorHandler)) {
                return;
            }
            scene.loadingPluginName = plugin.name;
            successHandler(meshes, particleSystems, skeletons, [], [], [], [], []);
        }
        else {
            const asyncedPlugin = plugin;
            asyncedPlugin
                .importMeshAsync(meshNames, scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)
                .then((result) => {
                scene.loadingPluginName = plugin.name;
                successHandler(result.meshes, result.particleSystems, result.skeletons, result.animationGroups, result.transformNodes, result.geometries, result.lights, result.spriteManagers);
            })
                .catch((error) => {
                errorHandler(error.message, error);
            });
        }
    }, progressHandler, errorHandler, disposeHandler, pluginExtension, name, pluginOptions);
}
function importMeshAsyncCore(meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension, name, pluginOptions) {
    return new Promise((resolve, reject) => {
        importMeshAsync(meshNames, rootUrl, sceneFilename, scene, (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights, spriteManagers) => {
            resolve({
                meshes: meshes,
                particleSystems: particleSystems,
                skeletons: skeletons,
                animationGroups: animationGroups,
                transformNodes: transformNodes,
                geometries: geometries,
                lights: lights,
                spriteManagers: spriteManagers,
            });
        }, onProgress, (scene, message, exception) => {
            reject(exception || new Error(message));
        }, pluginExtension, name, pluginOptions);
    });
}
function loadScene(rootUrl, sceneFilename = "", engine = engineStore/* EngineStore */.q.LastCreatedEngine, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "", pluginOptions = {}) {
    if (!engine) {
        tools/* Tools */.S0.Error("No engine available");
        return;
    }
    appendAsync(rootUrl, sceneFilename, new scene/* Scene */.Z(engine), onSuccess, onProgress, onError, pluginExtension, name, pluginOptions);
}
/**
 * Load a scene
 * @experimental
 * @param source a string that defines the name of the scene file, or starts with "data:" following by the stringified version of the scene, or a File object, or an ArrayBufferView
 * @param engine is the instance of BABYLON.Engine to use to create the scene
 * @param options an object that configures aspects of how the scene is loaded
 * @returns The loaded scene
 */
function loadSceneAsync(source, engine, options) {
    const { rootUrl = "", onProgress, pluginExtension, name, pluginOptions } = options ?? {};
    return loadSceneAsyncCore(rootUrl, source, engine, onProgress, pluginExtension, name, pluginOptions);
}
function loadSceneAsyncCore(rootUrl, sceneFilename, engine, onProgress, pluginExtension, name, pluginOptions) {
    return new Promise((resolve, reject) => {
        loadScene(rootUrl, sceneFilename, engine, (scene) => {
            resolve(scene);
        }, onProgress, (scene, message, exception) => {
            reject(exception || new Error(message));
        }, pluginExtension, name, pluginOptions);
    });
}
async function appendAsync(rootUrl, sceneFilename = "", scene = engineStore/* EngineStore */.q.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "", pluginOptions = {}) {
    if (!scene) {
        logger/* Logger */.V.Error("No scene available to append to");
        return null;
    }
    const fileInfo = _getFileInfo(rootUrl, sceneFilename);
    if (!fileInfo) {
        return null;
    }
    const loadingToken = {};
    scene.addPendingData(loadingToken);
    const disposeHandler = () => {
        scene.removePendingData(loadingToken);
    };
    if (sceneLoaderFlags/* SceneLoaderFlags */.B.ShowLoadingScreen && !showingLoadingScreen) {
        showingLoadingScreen = true;
        scene.getEngine().displayLoadingUI();
        scene.executeWhenReady(() => {
            scene.getEngine().hideLoadingUI();
            showingLoadingScreen = false;
        });
    }
    const errorHandler = (message, exception) => {
        const errorMessage = formatErrorMessage(fileInfo, message, exception);
        if (onError) {
            onError(scene, errorMessage, new error/* RuntimeError */.bu(errorMessage, error/* ErrorCodes */.tG.SceneLoaderError, exception));
        }
        else {
            logger/* Logger */.V.Error(errorMessage);
            // should the exception be thrown?
        }
        disposeHandler();
    };
    const progressHandler = onProgress
        ? (event) => {
            try {
                onProgress(event);
            }
            catch (e) {
                errorHandler("Error in onProgress callback", e);
            }
        }
        : undefined;
    const successHandler = () => {
        if (onSuccess) {
            try {
                onSuccess(scene);
            }
            catch (e) {
                errorHandler("Error in onSuccess callback", e);
            }
        }
        scene.removePendingData(loadingToken);
    };
    return await loadDataAsync(fileInfo, scene, (plugin, data) => {
        if (plugin.load) {
            const syncedPlugin = plugin;
            if (!syncedPlugin.load(scene, data, fileInfo.rootUrl, errorHandler)) {
                return;
            }
            scene.loadingPluginName = plugin.name;
            successHandler();
        }
        else {
            const asyncedPlugin = plugin;
            asyncedPlugin
                .loadAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)
                .then(() => {
                scene.loadingPluginName = plugin.name;
                successHandler();
            })
                .catch((error) => {
                errorHandler(error.message, error);
            });
        }
    }, progressHandler, errorHandler, disposeHandler, pluginExtension, name, pluginOptions);
}
/**
 * Append a scene
 * @experimental
 * @param source a string that defines the name of the scene file, or starts with "data:" following by the stringified version of the scene, or a File object, or an ArrayBufferView
 * @param scene is the instance of BABYLON.Scene to append to
 * @param options an object that configures aspects of how the scene is loaded
 */
async function appendSceneAsync(source, scene, options) {
    const { rootUrl = "", onProgress, pluginExtension, name, pluginOptions } = options ?? {};
    await appendSceneAsyncCore(rootUrl, source, scene, onProgress, pluginExtension, name, pluginOptions);
}
function appendSceneAsyncCore(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name, pluginOptions) {
    return new Promise((resolve, reject) => {
        appendAsync(rootUrl, sceneFilename, scene, (scene) => {
            resolve(scene);
        }, onProgress, (scene, message, exception) => {
            reject(exception || new Error(message));
        }, pluginExtension, name, pluginOptions);
    });
}
async function loadAssetContainerCoreAsync(rootUrl, sceneFilename = "", scene = engineStore/* EngineStore */.q.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "", pluginOptions = {}) {
    if (!scene) {
        logger/* Logger */.V.Error("No scene available to load asset container to");
        return null;
    }
    const fileInfo = _getFileInfo(rootUrl, sceneFilename);
    if (!fileInfo) {
        return null;
    }
    const loadingToken = {};
    scene.addPendingData(loadingToken);
    const disposeHandler = () => {
        scene.removePendingData(loadingToken);
    };
    const errorHandler = (message, exception) => {
        const errorMessage = formatErrorMessage(fileInfo, message, exception);
        if (onError) {
            onError(scene, errorMessage, new error/* RuntimeError */.bu(errorMessage, error/* ErrorCodes */.tG.SceneLoaderError, exception));
        }
        else {
            logger/* Logger */.V.Error(errorMessage);
            // should the exception be thrown?
        }
        disposeHandler();
    };
    const progressHandler = onProgress
        ? (event) => {
            try {
                onProgress(event);
            }
            catch (e) {
                errorHandler("Error in onProgress callback", e);
            }
        }
        : undefined;
    const successHandler = (assets) => {
        if (onSuccess) {
            try {
                onSuccess(assets);
            }
            catch (e) {
                errorHandler("Error in onSuccess callback", e);
            }
        }
        scene.removePendingData(loadingToken);
    };
    return await loadDataAsync(fileInfo, scene, (plugin, data) => {
        if (plugin.loadAssetContainer) {
            const syncedPlugin = plugin;
            const assetContainer = syncedPlugin.loadAssetContainer(scene, data, fileInfo.rootUrl, errorHandler);
            if (!assetContainer) {
                return;
            }
            assetContainer.populateRootNodes();
            scene.loadingPluginName = plugin.name;
            successHandler(assetContainer);
        }
        else if (plugin.loadAssetContainerAsync) {
            const asyncedPlugin = plugin;
            asyncedPlugin
                .loadAssetContainerAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)
                .then((assetContainer) => {
                assetContainer.populateRootNodes();
                scene.loadingPluginName = plugin.name;
                successHandler(assetContainer);
            })
                .catch((error) => {
                errorHandler(error.message, error);
            });
        }
        else {
            errorHandler("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.");
        }
    }, progressHandler, errorHandler, disposeHandler, pluginExtension, name, pluginOptions);
}
/**
 * Load a scene into an asset container
 * @experimental
 * @param source a string that defines the name of the scene file, or starts with "data:" following by the stringified version of the scene, or a File object, or an ArrayBufferView
 * @param scene is the instance of Scene to append to
 * @param options an object that configures aspects of how the scene is loaded
 * @returns The loaded asset container
 */
function loadAssetContainerAsync(source, scene, options) {
    const { rootUrl = "", onProgress, pluginExtension, name, pluginOptions } = options ?? {};
    return internalLoadAssetContainerAsync(rootUrl, source, scene, onProgress, pluginExtension, name, pluginOptions);
}
function internalLoadAssetContainerAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name, pluginOptions) {
    return new Promise((resolve, reject) => {
        loadAssetContainerCoreAsync(rootUrl, sceneFilename, scene, (assets) => {
            resolve(assets);
        }, onProgress, (scene, message, exception) => {
            reject(exception || new Error(message));
        }, pluginExtension, name, pluginOptions);
    });
}
function importAnimations(rootUrl, sceneFilename = "", scene = engineStore/* EngineStore */.q.LastCreatedScene, overwriteAnimations = true, animationGroupLoadingMode = 0 /* SceneLoaderAnimationGroupLoadingMode.Clean */, targetConverter = null, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "", pluginOptions = {}) {
    if (!scene) {
        logger/* Logger */.V.Error("No scene available to load animations to");
        return;
    }
    if (overwriteAnimations) {
        // Reset, stop and dispose all animations before loading new ones
        for (const animatable of scene.animatables) {
            animatable.reset();
        }
        scene.stopAllAnimations();
        scene.animationGroups.slice().forEach((animationGroup) => {
            animationGroup.dispose();
        });
        const nodes = scene.getNodes();
        nodes.forEach((node) => {
            if (node.animations) {
                node.animations = [];
            }
        });
    }
    else {
        switch (animationGroupLoadingMode) {
            case 0 /* SceneLoaderAnimationGroupLoadingMode.Clean */:
                scene.animationGroups.slice().forEach((animationGroup) => {
                    animationGroup.dispose();
                });
                break;
            case 1 /* SceneLoaderAnimationGroupLoadingMode.Stop */:
                scene.animationGroups.forEach((animationGroup) => {
                    animationGroup.stop();
                });
                break;
            case 2 /* SceneLoaderAnimationGroupLoadingMode.Sync */:
                scene.animationGroups.forEach((animationGroup) => {
                    animationGroup.reset();
                    animationGroup.restart();
                });
                break;
            case 3 /* SceneLoaderAnimationGroupLoadingMode.NoSync */:
                // nothing to do
                break;
            default:
                logger/* Logger */.V.Error("Unknown animation group loading mode value '" + animationGroupLoadingMode + "'");
                return;
        }
    }
    const startingIndexForNewAnimatables = scene.animatables.length;
    const onAssetContainerLoaded = (container) => {
        container.mergeAnimationsTo(scene, scene.animatables.slice(startingIndexForNewAnimatables), targetConverter);
        container.dispose();
        scene.onAnimationFileImportedObservable.notifyObservers(scene);
        if (onSuccess) {
            onSuccess(scene);
        }
    };
    loadAssetContainerCoreAsync(rootUrl, sceneFilename, scene, onAssetContainerLoaded, onProgress, onError, pluginExtension, name, pluginOptions);
}
/**
 * Import animations from a file into a scene
 * @experimental
 * @param source a string that defines the name of the scene file, or starts with "data:" following by the stringified version of the scene, or a File object, or an ArrayBufferView
 * @param scene is the instance of BABYLON.Scene to append to
 * @param options an object that configures aspects of how the scene is loaded
 */
async function importAnimationsAsync(source, scene, options) {
    const { rootUrl = "", overwriteAnimations, animationGroupLoadingMode, targetConverter, onProgress, pluginExtension, name, pluginOptions } = options ?? {};
    await importAnimationsAsyncCore(rootUrl, source, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onProgress, pluginExtension, name, pluginOptions);
}
function importAnimationsAsyncCore(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onProgress, pluginExtension, name, pluginOptions) {
    return new Promise((resolve, reject) => {
        importAnimations(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, (scene) => {
            resolve(scene);
        }, onProgress, (scene, message, exception) => {
            reject(exception || new Error(message));
        }, pluginExtension, name, pluginOptions);
    });
}
/**
 * Class used to load scene from various file formats using registered plugins
 * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes
 */
class SceneLoader {
    /**
     * Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data
     */
    static get ForceFullSceneLoadingForIncremental() {
        return sceneLoaderFlags/* SceneLoaderFlags */.B.ForceFullSceneLoadingForIncremental;
    }
    static set ForceFullSceneLoadingForIncremental(value) {
        sceneLoaderFlags/* SceneLoaderFlags */.B.ForceFullSceneLoadingForIncremental = value;
    }
    /**
     * Gets or sets a boolean indicating if loading screen must be displayed while loading a scene
     */
    static get ShowLoadingScreen() {
        return sceneLoaderFlags/* SceneLoaderFlags */.B.ShowLoadingScreen;
    }
    static set ShowLoadingScreen(value) {
        sceneLoaderFlags/* SceneLoaderFlags */.B.ShowLoadingScreen = value;
    }
    /**
     * Defines the current logging level (while loading the scene)
     * @ignorenaming
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static get loggingLevel() {
        return sceneLoaderFlags/* SceneLoaderFlags */.B.loggingLevel;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static set loggingLevel(value) {
        sceneLoaderFlags/* SceneLoaderFlags */.B.loggingLevel = value;
    }
    /**
     * Gets or set a boolean indicating if matrix weights must be cleaned upon loading
     */
    static get CleanBoneMatrixWeights() {
        return sceneLoaderFlags/* SceneLoaderFlags */.B.CleanBoneMatrixWeights;
    }
    static set CleanBoneMatrixWeights(value) {
        sceneLoaderFlags/* SceneLoaderFlags */.B.CleanBoneMatrixWeights = value;
    }
    /**
     * Gets the default plugin (used to load Babylon files)
     * @returns the .babylon plugin
     */
    static GetDefaultPlugin() {
        return getDefaultPlugin();
    }
    // Public functions
    /**
     * Gets a plugin that can load the given extension
     * @param extension defines the extension to load
     * @returns a plugin or null if none works
     */
    static GetPluginForExtension(extension) {
        return getPluginForExtension(extension, true)?.plugin;
    }
    /**
     * Gets a boolean indicating that the given extension can be loaded
     * @param extension defines the extension to load
     * @returns true if the extension is supported
     */
    static IsPluginForExtensionAvailable(extension) {
        return isPluginForExtensionAvailable(extension);
    }
    /**
     * Adds a new plugin to the list of registered plugins
     * @param plugin defines the plugin to add
     */
    static RegisterPlugin(plugin) {
        registerSceneLoaderPlugin(plugin);
    }
    /**
     * Import meshes into a scene
     * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
     * @param scene the instance of BABYLON.Scene to append to
     * @param onSuccess a callback with a list of imported meshes, particleSystems, skeletons, and animationGroups when import succeeds
     * @param onProgress a callback with a progress event for each file being loaded
     * @param onError a callback with the scene, a message, and possibly an exception when import fails
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the name of the file, if the data is binary
     * @deprecated Please use ImportMeshAsync instead
     */
    static ImportMesh(meshNames, rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name) {
        importMeshAsync(meshNames, rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name);
    }
    /**
     * Import meshes into a scene
     * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
     * @param scene the instance of BABYLON.Scene to append to
     * @param onProgress a callback with a progress event for each file being loaded
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the name of the file
     * @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups
     */
    static ImportMeshAsync(meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension, name) {
        return importMeshAsyncCore(meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension, name);
    }
    /**
     * Load a scene
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
     * @param engine is the instance of BABYLON.Engine to use to create the scene
     * @param onSuccess a callback with the scene when import succeeds
     * @param onProgress a callback with a progress event for each file being loaded
     * @param onError a callback with the scene, a message, and possibly an exception when import fails
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the filename, if the data is binary
     * @deprecated Please use LoadAsync instead
     */
    static Load(rootUrl, sceneFilename, engine, onSuccess, onProgress, onError, pluginExtension, name) {
        loadScene(rootUrl, sceneFilename, engine, onSuccess, onProgress, onError, pluginExtension, name);
    }
    /**
     * Load a scene
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
     * @param engine is the instance of BABYLON.Engine to use to create the scene
     * @param onProgress a callback with a progress event for each file being loaded
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the filename, if the data is binary
     * @returns The loaded scene
     */
    static LoadAsync(rootUrl, sceneFilename, engine, onProgress, pluginExtension, name) {
        return loadSceneAsyncCore(rootUrl, sceneFilename, engine, onProgress, pluginExtension, name);
    }
    /**
     * Append a scene
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
     * @param scene is the instance of BABYLON.Scene to append to
     * @param onSuccess a callback with the scene when import succeeds
     * @param onProgress a callback with a progress event for each file being loaded
     * @param onError a callback with the scene, a message, and possibly an exception when import fails
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the name of the file, if the data is binary
     * @deprecated Please use AppendAsync instead
     */
    static Append(rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name) {
        appendAsync(rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name);
    }
    /**
     * Append a scene
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
     * @param scene is the instance of BABYLON.Scene to append to
     * @param onProgress a callback with a progress event for each file being loaded
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the name of the file, if the data is binary
     * @returns The given scene
     */
    static AppendAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name) {
        return appendSceneAsyncCore(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name);
    }
    /**
     * Load a scene into an asset container
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
     * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
     * @param onSuccess a callback with the scene when import succeeds
     * @param onProgress a callback with a progress event for each file being loaded
     * @param onError a callback with the scene, a message, and possibly an exception when import fails
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the filename, if the data is binary
     * @deprecated Please use LoadAssetContainerAsync instead
     */
    static LoadAssetContainer(rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name) {
        loadAssetContainerCoreAsync(rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name);
    }
    /**
     * Load a scene into an asset container
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
     * @param scene is the instance of Scene to append to
     * @param onProgress a callback with a progress event for each file being loaded
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the filename, if the data is binary
     * @returns The loaded asset container
     */
    static LoadAssetContainerAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name) {
        return internalLoadAssetContainerAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name);
    }
    /**
     * Import animations from a file into a scene
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
     * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
     * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise
     * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones
     * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
     * @param onSuccess a callback with the scene when import succeeds
     * @param onProgress a callback with a progress event for each file being loaded
     * @param onError a callback with the scene, a message, and possibly an exception when import fails
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the filename, if the data is binary
     * @deprecated Please use ImportAnimationsAsync instead
     */
    static ImportAnimations(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onSuccess, onProgress, onError, pluginExtension, name) {
        importAnimations(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onSuccess, onProgress, onError, pluginExtension, name);
    }
    /**
     * Import animations from a file into a scene
     * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
     * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
     * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
     * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise
     * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones
     * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
     * @param onSuccess a callback with the scene when import succeeds
     * @param onProgress a callback with a progress event for each file being loaded
     * @param onError a callback with the scene, a message, and possibly an exception when import fails
     * @param pluginExtension the extension used to determine the plugin
     * @param name defines the filename, if the data is binary
     * @returns the updated scene with imported animations
     */
    static ImportAnimationsAsync(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, 
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onSuccess, onProgress, 
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onError, pluginExtension, name) {
        return importAnimationsAsyncCore(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onProgress, pluginExtension, name);
    }
}
/**
 * No logging while loading
 */
SceneLoader.NO_LOGGING = 0;
/**
 * Minimal logging while loading
 */
SceneLoader.MINIMAL_LOGGING = 1;
/**
 * Summary logging while loading
 */
SceneLoader.SUMMARY_LOGGING = 2;
/**
 * Detailed logging while loading
 */
SceneLoader.DETAILED_LOGGING = 3;
// Members
/**
 * Event raised when a plugin is used to load a scene
 */
SceneLoader.OnPluginActivatedObservable = onPluginActivatedObservable;
//# sourceMappingURL=sceneLoader.js.map

/***/ }),

/***/ 7597:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ SceneLoaderFlags)
/* harmony export */ });

/**
 * Class used to represent data loading progression
 */
class SceneLoaderFlags {
    /**
     * Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data
     */
    static get ForceFullSceneLoadingForIncremental() {
        return SceneLoaderFlags._ForceFullSceneLoadingForIncremental;
    }
    static set ForceFullSceneLoadingForIncremental(value) {
        SceneLoaderFlags._ForceFullSceneLoadingForIncremental = value;
    }
    /**
     * Gets or sets a boolean indicating if loading screen must be displayed while loading a scene
     */
    static get ShowLoadingScreen() {
        return SceneLoaderFlags._ShowLoadingScreen;
    }
    static set ShowLoadingScreen(value) {
        SceneLoaderFlags._ShowLoadingScreen = value;
    }
    /**
     * Defines the current logging level (while loading the scene)
     * @ignorenaming
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static get loggingLevel() {
        return SceneLoaderFlags._LoggingLevel;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static set loggingLevel(value) {
        SceneLoaderFlags._LoggingLevel = value;
    }
    /**
     * Gets or set a boolean indicating if matrix weights must be cleaned upon loading
     */
    static get CleanBoneMatrixWeights() {
        return SceneLoaderFlags._CleanBoneMatrixWeights;
    }
    static set CleanBoneMatrixWeights(value) {
        SceneLoaderFlags._CleanBoneMatrixWeights = value;
    }
}
// Flags
SceneLoaderFlags._ForceFullSceneLoadingForIncremental = false;
SceneLoaderFlags._ShowLoadingScreen = true;
SceneLoaderFlags._CleanBoneMatrixWeights = false;
SceneLoaderFlags._LoggingLevel = 0;
//# sourceMappingURL=sceneLoaderFlags.js.map

/***/ }),

/***/ 20927:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   b: () => (/* binding */ GaussianSplattingMaterial)
/* harmony export */ });
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26877);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95616);
/* harmony import */ var _Materials_materialDefines_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79526);
/* harmony import */ var _Materials_pushMaterial_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21644);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56552);
/* harmony import */ var _clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(30492);
/* harmony import */ var _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30388);
/* harmony import */ var _Shaders_gaussianSplatting_fragment_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18335);
/* harmony import */ var _Shaders_gaussianSplatting_vertex_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(97215);
/* harmony import */ var _ShadersWGSL_gaussianSplatting_fragment_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23758);
/* harmony import */ var _ShadersWGSL_gaussianSplatting_vertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(55597);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(80467);












/**
 * @internal
 */
class GaussianSplattingMaterialDefines extends _Materials_materialDefines_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialDefines */ .M {
    /**
     * Constructor of the defines.
     */
    constructor() {
        super();
        this.FOG = false;
        this.THIN_INSTANCES = true;
        this.LOGARITHMICDEPTH = false;
        this.CLIPPLANE = false;
        this.CLIPPLANE2 = false;
        this.CLIPPLANE3 = false;
        this.CLIPPLANE4 = false;
        this.CLIPPLANE5 = false;
        this.CLIPPLANE6 = false;
        this.rebuild();
    }
}
/**
 * GaussianSplattingMaterial material used to render Gaussian Splatting
 * @experimental
 */
class GaussianSplattingMaterial extends _Materials_pushMaterial_js__WEBPACK_IMPORTED_MODULE_3__/* .PushMaterial */ .E {
    /**
     * Instantiates a Gaussian Splatting Material in the given scene
     * @param name The friendly name of the material
     * @param scene The scene to add the material to
     */
    constructor(name, scene) {
        super(name, scene);
        this.backFaceCulling = false;
    }
    /**
     * Gets a boolean indicating that current material needs to register RTT
     */
    get hasRenderTargetTextures() {
        return false;
    }
    /**
     * Specifies whether or not this material should be rendered in alpha test mode.
     * @returns false
     */
    needAlphaTesting() {
        return false;
    }
    /**
     * Specifies whether or not this material should be rendered in alpha blend mode.
     * @returns true
     */
    needAlphaBlending() {
        return true;
    }
    /**
     * Checks whether the material is ready to be rendered for a given mesh.
     * @param mesh The mesh to render
     * @param subMesh The submesh to check against
     * @returns true if all the dependencies are ready (Textures, Effects...)
     */
    isReadyForSubMesh(mesh, subMesh) {
        const useInstances = true;
        const drawWrapper = subMesh._drawWrapper;
        if (drawWrapper.effect && this.isFrozen) {
            if (drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            subMesh.materialDefines = new GaussianSplattingMaterialDefines();
        }
        const scene = this.getScene();
        const defines = subMesh.materialDefines;
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        const engine = scene.getEngine();
        // Misc.
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_11__/* .PrepareDefinesForMisc */ .fm)(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, false, defines);
        // Values that need to be evaluated on every frame
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_11__/* .PrepareDefinesForFrameBoundValues */ .OR)(scene, engine, this, defines, useInstances, null, true);
        // Attribs
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_11__/* .PrepareDefinesForAttributes */ .qB)(mesh, defines, false, false);
        // Get correct effect
        if (defines.isDirty) {
            defines.markAsProcessed();
            scene.resetCachedMaterial();
            //Attributes
            const attribs = [_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind, "splatIndex"];
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_11__/* .PrepareAttributesForInstances */ .ER)(attribs, defines);
            const uniforms = ["world", "view", "projection", "vFogInfos", "vFogColor", "logarithmicDepthConstant", "invViewport", "dataTextureSize", "focal"];
            const samplers = ["covariancesATexture", "covariancesBTexture", "centersTexture", "colorsTexture"];
            const uniformBuffers = ["Scene", "Mesh"];
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_11__/* .PrepareUniformsAndSamplersList */ .Bb)({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
            });
            (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_5__/* .addClipPlaneUniforms */ .TV)(uniforms);
            const join = defines.toString();
            const effect = scene.getEngine().createEffect("gaussianSplatting", {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: {},
                shaderLanguage: this._shaderLanguage,
                extraInitializationsAsync: async () => {
                    if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 23758)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 55597))]);
                    }
                    else {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 18335)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 97215))]);
                    }
                },
            }, engine);
            subMesh.setEffect(effect, defines, this._materialContext);
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        drawWrapper._wasPreviouslyReady = true;
        drawWrapper._wasPreviouslyUsingInstances = useInstances;
        return true;
    }
    /**
     * Bind material effect for a specific Gaussian Splatting mesh
     * @param mesh Gaussian splatting mesh
     * @param effect Splatting material or node material
     * @param scene scene that contains mesh and camera used for rendering
     */
    static BindEffect(mesh, effect, scene) {
        const engine = scene.getEngine();
        const camera = scene.activeCamera;
        const renderWidth = engine.getRenderWidth();
        const renderHeight = engine.getRenderHeight();
        // check if rigcamera, get number of rigs
        const numberOfRigs = camera?.rigParent?.rigCameras.length || 1;
        effect.setFloat2("invViewport", 1 / (renderWidth / numberOfRigs), 1 / renderHeight);
        let focal = 1000;
        if (camera) {
            /*
            more explicit version:
            const t = camera.getProjectionMatrix().m[5];
            const FovY = Math.atan(1.0 / t) * 2.0;
            focal = renderHeight / 2.0 / Math.tan(FovY / 2.0);
            Using a shorter version here to not have tan(atan) and 2.0 factor
            */
            const t = camera.getProjectionMatrix().m[5];
            if (camera.fovMode == _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_6__/* .Camera */ .i.FOVMODE_VERTICAL_FIXED) {
                focal = (renderHeight * t) / 2.0;
            }
            else {
                focal = (renderWidth * t) / 2.0;
            }
        }
        effect.setFloat2("focal", focal, focal);
        const gsMesh = mesh;
        if (gsMesh.covariancesATexture) {
            const textureSize = gsMesh.covariancesATexture.getSize();
            effect.setFloat2("dataTextureSize", textureSize.width, textureSize.height);
            effect.setTexture("covariancesATexture", gsMesh.covariancesATexture);
            effect.setTexture("covariancesBTexture", gsMesh.covariancesBTexture);
            effect.setTexture("centersTexture", gsMesh.centersTexture);
            effect.setTexture("colorsTexture", gsMesh.colorsTexture);
        }
    }
    /**
     * Binds the submesh to this material by preparing the effect and shader to draw
     * @param world defines the world transformation matrix
     * @param mesh defines the mesh containing the submesh
     * @param subMesh defines the submesh to bind the material to
     */
    bindForSubMesh(world, mesh, subMesh) {
        const scene = this.getScene();
        const defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        const effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices Mesh.
        mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
        mesh.transferToEffect(world);
        // Bind data
        const mustRebind = this._mustRebind(scene, effect, subMesh, mesh.visibility);
        if (mustRebind) {
            this.bindView(effect);
            this.bindViewProjection(effect);
            GaussianSplattingMaterial.BindEffect(mesh, this._activeEffect, scene);
            // Clip plane
            (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_5__/* .bindClipPlane */ .gS)(effect, this, scene);
        }
        else if (scene.getEngine()._features.needToAlwaysBindUniformBuffers) {
            this._needToBindSceneUbo = true;
        }
        // Fog
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_11__/* .BindFogParameters */ .Yy)(scene, mesh, effect);
        // Log. depth
        if (this.useLogarithmicDepth) {
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_11__/* .BindLogDepth */ .DL)(defines, effect, scene);
        }
        this._afterBind(mesh, this._activeEffect, subMesh);
    }
    /**
     * Clones the material.
     * @param name The cloned name.
     * @returns The cloned material.
     */
    clone(name) {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper */ .p.Clone(() => new GaussianSplattingMaterial(name, this.getScene()), this);
    }
    /**
     * Serializes the current material to its JSON representation.
     * @returns The JSON representation.
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.customType = "BABYLON.GaussianSplattingMaterial";
        return serializationObject;
    }
    /**
     * Gets the class name of the material
     * @returns "GaussianSplattingMaterial"
     */
    getClassName() {
        return "GaussianSplattingMaterial";
    }
    /**
     * Parse a JSON input to create back a Gaussian Splatting material.
     * @param source The JSON data to parse
     * @param scene The scene to create the parsed material in
     * @param rootUrl The root url of the assets the material depends upon
     * @returns the instantiated GaussianSplattingMaterial.
     */
    static Parse(source, scene, rootUrl) {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper */ .p.Parse(() => new GaussianSplattingMaterial(source.name, scene), source, scene, rootUrl);
    }
}
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_4__/* .RegisterClass */ .Y5)("BABYLON.GaussianSplattingMaterial", GaussianSplattingMaterial);
//# sourceMappingURL=gaussianSplattingMaterial.js.map

/***/ }),

/***/ 92895:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   i: () => (/* binding */ PBRAnisotropicConfiguration),
/* harmony export */   v: () => (/* binding */ MaterialAnisotropicDefines)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95616);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10633);
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50074);
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(79526);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80467);

/* eslint-disable @typescript-eslint/naming-convention */








/**
 * @internal
 */
class MaterialAnisotropicDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_6__/* .MaterialDefines */ .M {
    constructor() {
        super(...arguments);
        this.ANISOTROPIC = false;
        this.ANISOTROPIC_TEXTURE = false;
        this.ANISOTROPIC_TEXTUREDIRECTUV = 0;
        this.ANISOTROPIC_LEGACY = false;
        this.MAINUV1 = false;
    }
}
/**
 * Plugin that implements the anisotropic component of the PBR material
 */
class PBRAnisotropicConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialPluginBase */ .y {
    /**
     * Sets the anisotropy direction as an angle.
     */
    set angle(value) {
        this.direction.x = Math.cos(value);
        this.direction.y = Math.sin(value);
    }
    /**
     * Gets the anisotropy angle value in radians.
     * @returns the anisotropy angle value in radians.
     */
    get angle() {
        return Math.atan2(this.direction.y, this.direction.x);
    }
    /** @internal */
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /** @internal */
    _markAllSubMeshesAsMiscDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsMiscDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    constructor(material, addToPluginList = true) {
        super(material, "PBRAnisotropic", 110, new MaterialAnisotropicDefines(), addToPluginList);
        this._isEnabled = false;
        /**
         * Defines if the anisotropy is enabled in the material.
         */
        this.isEnabled = false;
        /**
         * Defines the anisotropy strength (between 0 and 1) it defaults to 1.
         */
        this.intensity = 1;
        /**
         * Defines if the effect is along the tangents, bitangents or in between.
         * By default, the effect is "stretching" the highlights along the tangents.
         */
        this.direction = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2 */ .I9(1, 0);
        this._texture = null;
        /**
         * Stores the anisotropy values in a texture.
         * rg is direction (like normal from -1 to 1)
         * b is a intensity
         */
        this.texture = null;
        this._legacy = false;
        /**
         * Defines if the anisotropy is in legacy mode for backwards compatibility before 6.4.0.
         */
        this.legacy = false;
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
        this._internalMarkAllSubMeshesAsMiscDirty = material._dirtyCallbacks[16];
    }
    isReadyForSubMesh(defines, scene) {
        if (!this._isEnabled) {
            return true;
        }
        if (defines._areTexturesDirty) {
            if (scene.texturesEnabled) {
                if (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialFlags */ .h.AnisotropicTextureEnabled) {
                    if (!this._texture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
    prepareDefinesBeforeAttributes(defines, scene, mesh) {
        if (this._isEnabled) {
            defines.ANISOTROPIC = this._isEnabled;
            if (this._isEnabled && !mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind)) {
                defines._needUVs = true;
                defines.MAINUV1 = true;
            }
            if (defines._areTexturesDirty) {
                if (scene.texturesEnabled) {
                    if (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialFlags */ .h.AnisotropicTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .PrepareDefinesForMergedUV */ .YT)(this._texture, defines, "ANISOTROPIC_TEXTURE");
                    }
                    else {
                        defines.ANISOTROPIC_TEXTURE = false;
                    }
                }
            }
            if (defines._areMiscDirty) {
                defines.ANISOTROPIC_LEGACY = this._legacy;
            }
        }
        else {
            defines.ANISOTROPIC = false;
            defines.ANISOTROPIC_TEXTURE = false;
            defines.ANISOTROPIC_TEXTUREDIRECTUV = 0;
            defines.ANISOTROPIC_LEGACY = false;
        }
    }
    bindForSubMesh(uniformBuffer, scene) {
        if (!this._isEnabled) {
            return;
        }
        const isFrozen = this._material.isFrozen;
        if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {
            if (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialFlags */ .h.AnisotropicTextureEnabled) {
                uniformBuffer.updateFloat2("vAnisotropyInfos", this._texture.coordinatesIndex, this._texture.level);
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .BindTextureMatrix */ .mA)(this._texture, uniformBuffer, "anisotropy");
            }
            // Anisotropy
            uniformBuffer.updateFloat3("vAnisotropy", this.direction.x, this.direction.y, this.intensity);
        }
        // Textures
        if (scene.texturesEnabled) {
            if (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialFlags */ .h.AnisotropicTextureEnabled) {
                uniformBuffer.setTexture("anisotropySampler", this._texture);
            }
        }
    }
    hasTexture(texture) {
        if (this._texture === texture) {
            return true;
        }
        return false;
    }
    getActiveTextures(activeTextures) {
        if (this._texture) {
            activeTextures.push(this._texture);
        }
    }
    getAnimatables(animatables) {
        if (this._texture && this._texture.animations && this._texture.animations.length > 0) {
            animatables.push(this._texture);
        }
    }
    dispose(forceDisposeTextures) {
        if (forceDisposeTextures) {
            if (this._texture) {
                this._texture.dispose();
            }
        }
    }
    getClassName() {
        return "PBRAnisotropicConfiguration";
    }
    addFallbacks(defines, fallbacks, currentRank) {
        if (defines.ANISOTROPIC) {
            fallbacks.addFallback(currentRank++, "ANISOTROPIC");
        }
        return currentRank;
    }
    getSamplers(samplers) {
        samplers.push("anisotropySampler");
    }
    getUniforms() {
        return {
            ubo: [
                { name: "vAnisotropy", size: 3, type: "vec3" },
                { name: "vAnisotropyInfos", size: 2, type: "vec2" },
                { name: "anisotropyMatrix", size: 16, type: "mat4" },
            ],
        };
    }
    /**
     * Parses a anisotropy Configuration from a serialized object.
     * @param source - Serialized object.
     * @param scene Defines the scene we are parsing for
     * @param rootUrl Defines the rootUrl to load from
     */
    parse(source, scene, rootUrl) {
        super.parse(source, scene, rootUrl);
        // Backward compatibility
        if (source.legacy === undefined) {
            this.legacy = true;
        }
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRAnisotropicConfiguration.prototype, "isEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRAnisotropicConfiguration.prototype, "intensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector2 */ .WM)()
], PBRAnisotropicConfiguration.prototype, "direction", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRAnisotropicConfiguration.prototype, "texture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsMiscDirty")
], PBRAnisotropicConfiguration.prototype, "legacy", void 0);
//# sourceMappingURL=pbrAnisotropicConfiguration.js.map

/***/ }),

/***/ 1500:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   j: () => (/* binding */ PBRBRDFConfiguration)
/* harmony export */ });
/* unused harmony export MaterialBRDFDefines */
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79526);
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(50074);

/* eslint-disable @typescript-eslint/naming-convention */




/**
 * @internal
 */
class MaterialBRDFDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialDefines */ .M {
    constructor() {
        super(...arguments);
        this.BRDF_V_HEIGHT_CORRELATED = false;
        this.MS_BRDF_ENERGY_CONSERVATION = false;
        this.SPHERICAL_HARMONICS = false;
        this.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = false;
    }
}
/**
 * Plugin that implements the BRDF component of the PBR material
 */
class PBRBRDFConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialPluginBase */ .y {
    /** @internal */
    _markAllSubMeshesAsMiscDirty() {
        this._internalMarkAllSubMeshesAsMiscDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    constructor(material, addToPluginList = true) {
        super(material, "PBRBRDF", 90, new MaterialBRDFDefines(), addToPluginList);
        this._useEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION;
        /**
         * Defines if the material uses energy conservation.
         */
        this.useEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION;
        this._useSmithVisibilityHeightCorrelated = PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED;
        /**
         * LEGACY Mode set to false
         * Defines if the material uses height smith correlated visibility term.
         * If you intent to not use our default BRDF, you need to load a separate BRDF Texture for the PBR
         * You can either load https://assets.babylonjs.com/environments/uncorrelatedBRDF.png
         * or https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds to have more precision
         * Not relying on height correlated will also disable energy conservation.
         */
        this.useSmithVisibilityHeightCorrelated = PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED;
        this._useSphericalHarmonics = PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS;
        /**
         * LEGACY Mode set to false
         * Defines if the material uses spherical harmonics vs spherical polynomials for the
         * diffuse part of the IBL.
         * The harmonics despite a tiny bigger cost has been proven to provide closer results
         * to the ground truth.
         */
        this.useSphericalHarmonics = PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS;
        this._useSpecularGlossinessInputEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION;
        /**
         * Defines if the material uses energy conservation, when the specular workflow is active.
         * If activated, the albedo color is multiplied with (1. - maxChannel(specular color)).
         * If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.
         * In the deactivated case, the material author has to ensure energy conservation, for a physically plausible rendering.
         */
        this.useSpecularGlossinessInputEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION;
        this._internalMarkAllSubMeshesAsMiscDirty = material._dirtyCallbacks[16];
        this._enable(true);
    }
    prepareDefines(defines) {
        defines.BRDF_V_HEIGHT_CORRELATED = this._useSmithVisibilityHeightCorrelated;
        defines.MS_BRDF_ENERGY_CONSERVATION = this._useEnergyConservation && this._useSmithVisibilityHeightCorrelated;
        defines.SPHERICAL_HARMONICS = this._useSphericalHarmonics;
        defines.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = this._useSpecularGlossinessInputEnergyConservation;
    }
    getClassName() {
        return "PBRBRDFConfiguration";
    }
}
/**
 * Default value used for the energy conservation.
 * This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.
 */
PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION = true;
/**
 * Default value used for the Smith Visibility Height Correlated mode.
 * This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.
 */
PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED = true;
/**
 * Default value used for the IBL diffuse part.
 * This can help switching back to the polynomials mode globally which is a tiny bit
 * less GPU intensive at the drawback of a lower quality.
 */
PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS = true;
/**
 * Default value used for activating energy conservation for the specular workflow.
 * If activated, the albedo color is multiplied with (1. - maxChannel(specular color)).
 * If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.
 */
PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION = true;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsMiscDirty")
], PBRBRDFConfiguration.prototype, "useEnergyConservation", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsMiscDirty")
], PBRBRDFConfiguration.prototype, "useSmithVisibilityHeightCorrelated", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsMiscDirty")
], PBRBRDFConfiguration.prototype, "useSphericalHarmonics", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsMiscDirty")
], PBRBRDFConfiguration.prototype, "useSpecularGlossinessInputEnergyConservation", void 0);
//# sourceMappingURL=pbrBRDFConfiguration.js.map

/***/ }),

/***/ 1018:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   d: () => (/* binding */ PBRBaseMaterial),
/* harmony export */   g: () => (/* binding */ PBRMaterialDefines)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51137);
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17931);
/* harmony import */ var _Misc_brdfTextureTools_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4109);
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87491);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(79923);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(95616);
/* harmony import */ var _pbrBRDFConfiguration_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1500);
/* harmony import */ var _prePassConfiguration_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(97667);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(26041);
/* harmony import */ var _Materials_imageProcessingConfiguration_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(32033);
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(28986);
/* harmony import */ var _Materials_materialDefines_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(79526);
/* harmony import */ var _Materials_pushMaterial_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(21644);
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7481);
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10633);
/* harmony import */ var _Materials_Textures_baseTexture_polynomial_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(69764);
/* harmony import */ var _effectFallbacks_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(82565);
/* harmony import */ var _pbrClearCoatConfiguration_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(83670);
/* harmony import */ var _pbrIridescenceConfiguration_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(89696);
/* harmony import */ var _pbrAnisotropicConfiguration_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(92895);
/* harmony import */ var _pbrSheenConfiguration_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(84307);
/* harmony import */ var _pbrSubSurfaceConfiguration_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(86097);
/* harmony import */ var _material_detailMapConfiguration_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(97841);
/* harmony import */ var _clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(30492);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(80467);
/* harmony import */ var _materialHelper_geometryrendering_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(18598);

/* eslint-disable @typescript-eslint/naming-convention */




























const onCreatedEffectParameters = { effect: null, subMesh: null };
/**
 * Manages the defines for the PBR Material.
 * @internal
 */
class PBRMaterialDefines extends _Materials_materialDefines_js__WEBPACK_IMPORTED_MODULE_13__/* .MaterialDefines */ .M {
    /**
     * Initializes the PBR Material defines.
     * @param externalProperties The external properties
     */
    constructor(externalProperties) {
        super(externalProperties);
        this.PBR = true;
        this.NUM_SAMPLES = "0";
        this.REALTIME_FILTERING = false;
        this.MAINUV1 = false;
        this.MAINUV2 = false;
        this.MAINUV3 = false;
        this.MAINUV4 = false;
        this.MAINUV5 = false;
        this.MAINUV6 = false;
        this.UV1 = false;
        this.UV2 = false;
        this.UV3 = false;
        this.UV4 = false;
        this.UV5 = false;
        this.UV6 = false;
        this.ALBEDO = false;
        this.GAMMAALBEDO = false;
        this.ALBEDODIRECTUV = 0;
        this.VERTEXCOLOR = false;
        this.BAKED_VERTEX_ANIMATION_TEXTURE = false;
        this.AMBIENT = false;
        this.AMBIENTDIRECTUV = 0;
        this.AMBIENTINGRAYSCALE = false;
        this.OPACITY = false;
        this.VERTEXALPHA = false;
        this.OPACITYDIRECTUV = 0;
        this.OPACITYRGB = false;
        this.ALPHATEST = false;
        this.DEPTHPREPASS = false;
        this.ALPHABLEND = false;
        this.ALPHAFROMALBEDO = false;
        this.ALPHATESTVALUE = "0.5";
        this.SPECULAROVERALPHA = false;
        this.RADIANCEOVERALPHA = false;
        this.ALPHAFRESNEL = false;
        this.LINEARALPHAFRESNEL = false;
        this.PREMULTIPLYALPHA = false;
        this.EMISSIVE = false;
        this.EMISSIVEDIRECTUV = 0;
        this.GAMMAEMISSIVE = false;
        this.REFLECTIVITY = false;
        this.REFLECTIVITY_GAMMA = false;
        this.REFLECTIVITYDIRECTUV = 0;
        this.SPECULARTERM = false;
        this.MICROSURFACEFROMREFLECTIVITYMAP = false;
        this.MICROSURFACEAUTOMATIC = false;
        this.LODBASEDMICROSFURACE = false;
        this.MICROSURFACEMAP = false;
        this.MICROSURFACEMAPDIRECTUV = 0;
        this.METALLICWORKFLOW = false;
        this.ROUGHNESSSTOREINMETALMAPALPHA = false;
        this.ROUGHNESSSTOREINMETALMAPGREEN = false;
        this.METALLNESSSTOREINMETALMAPBLUE = false;
        this.AOSTOREINMETALMAPRED = false;
        this.METALLIC_REFLECTANCE = false;
        this.METALLIC_REFLECTANCE_GAMMA = false;
        this.METALLIC_REFLECTANCEDIRECTUV = 0;
        this.METALLIC_REFLECTANCE_USE_ALPHA_ONLY = false;
        this.REFLECTANCE = false;
        this.REFLECTANCE_GAMMA = false;
        this.REFLECTANCEDIRECTUV = 0;
        this.ENVIRONMENTBRDF = false;
        this.ENVIRONMENTBRDF_RGBD = false;
        this.NORMAL = false;
        this.TANGENT = false;
        this.BUMP = false;
        this.BUMPDIRECTUV = 0;
        this.OBJECTSPACE_NORMALMAP = false;
        this.PARALLAX = false;
        this.PARALLAX_RHS = false;
        this.PARALLAXOCCLUSION = false;
        this.NORMALXYSCALE = true;
        this.LIGHTMAP = false;
        this.LIGHTMAPDIRECTUV = 0;
        this.USELIGHTMAPASSHADOWMAP = false;
        this.GAMMALIGHTMAP = false;
        this.RGBDLIGHTMAP = false;
        this.REFLECTION = false;
        this.REFLECTIONMAP_3D = false;
        this.REFLECTIONMAP_SPHERICAL = false;
        this.REFLECTIONMAP_PLANAR = false;
        this.REFLECTIONMAP_CUBIC = false;
        this.USE_LOCAL_REFLECTIONMAP_CUBIC = false;
        this.REFLECTIONMAP_PROJECTION = false;
        this.REFLECTIONMAP_SKYBOX = false;
        this.REFLECTIONMAP_EXPLICIT = false;
        this.REFLECTIONMAP_EQUIRECTANGULAR = false;
        this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
        this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
        this.INVERTCUBICMAP = false;
        this.USESPHERICALFROMREFLECTIONMAP = false;
        this.USEIRRADIANCEMAP = false;
        this.USESPHERICALINVERTEX = false;
        this.REFLECTIONMAP_OPPOSITEZ = false;
        this.LODINREFLECTIONALPHA = false;
        this.GAMMAREFLECTION = false;
        this.RGBDREFLECTION = false;
        this.LINEARSPECULARREFLECTION = false;
        this.RADIANCEOCCLUSION = false;
        this.HORIZONOCCLUSION = false;
        this.INSTANCES = false;
        this.THIN_INSTANCES = false;
        this.INSTANCESCOLOR = false;
        this.PREPASS = false;
        this.PREPASS_COLOR = false;
        this.PREPASS_COLOR_INDEX = -1;
        this.PREPASS_IRRADIANCE = false;
        this.PREPASS_IRRADIANCE_INDEX = -1;
        this.PREPASS_ALBEDO = false;
        this.PREPASS_ALBEDO_INDEX = -1;
        this.PREPASS_ALBEDO_SQRT = false;
        this.PREPASS_ALBEDO_SQRT_INDEX = -1;
        this.PREPASS_DEPTH = false;
        this.PREPASS_DEPTH_INDEX = -1;
        this.PREPASS_SCREENSPACE_DEPTH = false;
        this.PREPASS_SCREENSPACE_DEPTH_INDEX = -1;
        this.PREPASS_NORMAL = false;
        this.PREPASS_NORMAL_INDEX = -1;
        this.PREPASS_NORMAL_WORLDSPACE = false;
        this.PREPASS_WORLD_NORMAL = false;
        this.PREPASS_WORLD_NORMAL_INDEX = -1;
        this.PREPASS_POSITION = false;
        this.PREPASS_POSITION_INDEX = -1;
        this.PREPASS_LOCAL_POSITION = false;
        this.PREPASS_LOCAL_POSITION_INDEX = -1;
        this.PREPASS_VELOCITY = false;
        this.PREPASS_VELOCITY_INDEX = -1;
        this.PREPASS_VELOCITY_LINEAR = false;
        this.PREPASS_VELOCITY_LINEAR_INDEX = -1;
        this.PREPASS_REFLECTIVITY = false;
        this.PREPASS_REFLECTIVITY_INDEX = -1;
        this.SCENE_MRT_COUNT = 0;
        this.NUM_BONE_INFLUENCERS = 0;
        this.BonesPerMesh = 0;
        this.BONETEXTURE = false;
        this.BONES_VELOCITY_ENABLED = false;
        this.NONUNIFORMSCALING = false;
        this.MORPHTARGETS = false;
        this.MORPHTARGETS_NORMAL = false;
        this.MORPHTARGETS_TANGENT = false;
        this.MORPHTARGETS_UV = false;
        this.NUM_MORPH_INFLUENCERS = 0;
        this.MORPHTARGETS_TEXTURE = false;
        this.IMAGEPROCESSING = false;
        this.VIGNETTE = false;
        this.VIGNETTEBLENDMODEMULTIPLY = false;
        this.VIGNETTEBLENDMODEOPAQUE = false;
        this.TONEMAPPING = 0;
        this.CONTRAST = false;
        this.COLORCURVES = false;
        this.COLORGRADING = false;
        this.COLORGRADING3D = false;
        this.SAMPLER3DGREENDEPTH = false;
        this.SAMPLER3DBGRMAP = false;
        this.DITHER = false;
        this.IMAGEPROCESSINGPOSTPROCESS = false;
        this.SKIPFINALCOLORCLAMP = false;
        this.EXPOSURE = false;
        this.MULTIVIEW = false;
        this.ORDER_INDEPENDENT_TRANSPARENCY = false;
        this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = false;
        this.USEPHYSICALLIGHTFALLOFF = false;
        this.USEGLTFLIGHTFALLOFF = false;
        this.TWOSIDEDLIGHTING = false;
        this.SHADOWFLOAT = false;
        this.CLIPPLANE = false;
        this.CLIPPLANE2 = false;
        this.CLIPPLANE3 = false;
        this.CLIPPLANE4 = false;
        this.CLIPPLANE5 = false;
        this.CLIPPLANE6 = false;
        this.POINTSIZE = false;
        this.FOG = false;
        this.LOGARITHMICDEPTH = false;
        this.CAMERA_ORTHOGRAPHIC = false;
        this.CAMERA_PERSPECTIVE = false;
        this.FORCENORMALFORWARD = false;
        this.SPECULARAA = false;
        this.UNLIT = false;
        this.DECAL_AFTER_DETAIL = false;
        this.DEBUGMODE = 0;
        this.rebuild();
    }
    /**
     * Resets the PBR Material defines.
     */
    reset() {
        super.reset();
        this.ALPHATESTVALUE = "0.5";
        this.PBR = true;
        this.NORMALXYSCALE = true;
    }
}
/**
 * The Physically based material base class of BJS.
 *
 * This offers the main features of a standard PBR material.
 * For more information, please refer to the documentation :
 * https://doc.babylonjs.com/features/featuresDeepDive/materials/using/introToPBR
 * #CGHTSM#1 : WebGL
 * #CGHTSM#2 : WebGPU
 */
class PBRBaseMaterial extends _Materials_pushMaterial_js__WEBPACK_IMPORTED_MODULE_14__/* .PushMaterial */ .E {
    /**
     * Enables realtime filtering on the texture.
     */
    get realTimeFiltering() {
        return this._realTimeFiltering;
    }
    set realTimeFiltering(b) {
        this._realTimeFiltering = b;
        this.markAsDirty(1);
    }
    /**
     * Quality switch for realtime filtering
     */
    get realTimeFilteringQuality() {
        return this._realTimeFilteringQuality;
    }
    set realTimeFilteringQuality(n) {
        this._realTimeFilteringQuality = n;
        this.markAsDirty(1);
    }
    /**
     * Can this material render to several textures at once
     */
    get canRenderToMRT() {
        return true;
    }
    /**
     * Attaches a new image processing configuration to the PBR Material.
     * @param configuration
     */
    _attachImageProcessingConfiguration(configuration) {
        if (configuration === this._imageProcessingConfiguration) {
            return;
        }
        // Detaches observer.
        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
        }
        // Pick the scene configuration if needed.
        if (!configuration) {
            this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration;
        }
        else {
            this._imageProcessingConfiguration = configuration;
        }
        // Attaches observer.
        if (this._imageProcessingConfiguration) {
            this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
                this._markAllSubMeshesAsImageProcessingDirty();
            });
        }
    }
    /**
     * Instantiates a new PBRMaterial instance.
     *
     * @param name The material name
     * @param scene The scene the material will be use in.
     * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
     */
    constructor(name, scene, forceGLSL = false) {
        super(name, scene, undefined, forceGLSL || PBRBaseMaterial.ForceGLSL);
        /**
         * Intensity of the direct lights e.g. the four lights available in your scene.
         * This impacts both the direct diffuse and specular highlights.
         * @internal
         */
        this._directIntensity = 1.0;
        /**
         * Intensity of the emissive part of the material.
         * This helps controlling the emissive effect without modifying the emissive color.
         * @internal
         */
        this._emissiveIntensity = 1.0;
        /**
         * Intensity of the environment e.g. how much the environment will light the object
         * either through harmonics for rough material or through the reflection for shiny ones.
         * @internal
         */
        this._environmentIntensity = 1.0;
        /**
         * This is a special control allowing the reduction of the specular highlights coming from the
         * four lights of the scene. Those highlights may not be needed in full environment lighting.
         * @internal
         */
        this._specularIntensity = 1.0;
        /**
         * This stores the direct, emissive, environment, and specular light intensities into a Vector4.
         */
        this._lightingInfos = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector4 */ .IU(this._directIntensity, this._emissiveIntensity, this._environmentIntensity, this._specularIntensity);
        /**
         * Debug Control allowing disabling the bump map on this material.
         * @internal
         */
        this._disableBumpMap = false;
        /**
         * AKA Diffuse Texture in standard nomenclature.
         * @internal
         */
        this._albedoTexture = null;
        /**
         * AKA Occlusion Texture in other nomenclature.
         * @internal
         */
        this._ambientTexture = null;
        /**
         * AKA Occlusion Texture Intensity in other nomenclature.
         * @internal
         */
        this._ambientTextureStrength = 1.0;
        /**
         * Defines how much the AO map is occluding the analytical lights (point spot...).
         * 1 means it completely occludes it
         * 0 mean it has no impact
         * @internal
         */
        this._ambientTextureImpactOnAnalyticalLights = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;
        /**
         * Stores the alpha values in a texture.
         * @internal
         */
        this._opacityTexture = null;
        /**
         * Stores the reflection values in a texture.
         * @internal
         */
        this._reflectionTexture = null;
        /**
         * Stores the emissive values in a texture.
         * @internal
         */
        this._emissiveTexture = null;
        /**
         * AKA Specular texture in other nomenclature.
         * @internal
         */
        this._reflectivityTexture = null;
        /**
         * Used to switch from specular/glossiness to metallic/roughness workflow.
         * @internal
         */
        this._metallicTexture = null;
        /**
         * Specifies the metallic scalar of the metallic/roughness workflow.
         * Can also be used to scale the metalness values of the metallic texture.
         * @internal
         */
        this._metallic = null;
        /**
         * Specifies the roughness scalar of the metallic/roughness workflow.
         * Can also be used to scale the roughness values of the metallic texture.
         * @internal
         */
        this._roughness = null;
        /**
         * In metallic workflow, specifies an F0 factor to help configuring the material F0.
         * By default the indexOfrefraction is used to compute F0;
         *
         * This is used as a factor against the default reflectance at normal incidence to tweak it.
         *
         * F0 = defaultF0 * metallicF0Factor * metallicReflectanceColor;
         * F90 = metallicReflectanceColor;
         * @internal
         */
        this._metallicF0Factor = 1;
        /**
         * In metallic workflow, specifies an F0 color.
         * By default the F90 is always 1;
         *
         * Please note that this factor is also used as a factor against the default reflectance at normal incidence.
         *
         * F0 = defaultF0_from_IOR * metallicF0Factor * metallicReflectanceColor
         * F90 = metallicF0Factor;
         * @internal
         */
        this._metallicReflectanceColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .Color3 */ .v9.White();
        /**
         * Specifies that only the A channel from _metallicReflectanceTexture should be used.
         * If false, both RGB and A channels will be used
         * @internal
         */
        this._useOnlyMetallicFromMetallicReflectanceTexture = false;
        /**
         * Defines to store metallicReflectanceColor in RGB and metallicF0Factor in A
         * This is multiply against the scalar values defined in the material.
         * @internal
         */
        this._metallicReflectanceTexture = null;
        /**
         * Defines to store reflectanceColor in RGB
         * This is multiplied against the scalar values defined in the material.
         * If both _reflectanceTexture and _metallicReflectanceTexture textures are provided and _useOnlyMetallicFromMetallicReflectanceTexture
         * is false, _metallicReflectanceTexture takes precedence and _reflectanceTexture is not used
         * @internal
         */
        this._reflectanceTexture = null;
        /**
         * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.
         * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
         * @internal
         */
        this._microSurfaceTexture = null;
        /**
         * Stores surface normal data used to displace a mesh in a texture.
         * @internal
         */
        this._bumpTexture = null;
        /**
         * Stores the pre-calculated light information of a mesh in a texture.
         * @internal
         */
        this._lightmapTexture = null;
        /**
         * The color of a material in ambient lighting.
         * @internal
         */
        this._ambientColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .Color3 */ .v9(0, 0, 0);
        /**
         * AKA Diffuse Color in other nomenclature.
         * @internal
         */
        this._albedoColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .Color3 */ .v9(1, 1, 1);
        /**
         * AKA Specular Color in other nomenclature.
         * @internal
         */
        this._reflectivityColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .Color3 */ .v9(1, 1, 1);
        /**
         * The color applied when light is reflected from a material.
         * @internal
         */
        this._reflectionColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .Color3 */ .v9(1, 1, 1);
        /**
         * The color applied when light is emitted from a material.
         * @internal
         */
        this._emissiveColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .Color3 */ .v9(0, 0, 0);
        /**
         * AKA Glossiness in other nomenclature.
         * @internal
         */
        this._microSurface = 0.9;
        /**
         * Specifies that the material will use the light map as a show map.
         * @internal
         */
        this._useLightmapAsShadowmap = false;
        /**
         * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal
         * makes the reflect vector face the model (under horizon).
         * @internal
         */
        this._useHorizonOcclusion = true;
        /**
         * This parameters will enable/disable radiance occlusion by preventing the radiance to lit
         * too much the area relying on ambient texture to define their ambient occlusion.
         * @internal
         */
        this._useRadianceOcclusion = true;
        /**
         * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.
         * @internal
         */
        this._useAlphaFromAlbedoTexture = false;
        /**
         * Specifies that the material will keeps the specular highlights over a transparent surface (only the most luminous ones).
         * A car glass is a good example of that. When sun reflects on it you can not see what is behind.
         * @internal
         */
        this._useSpecularOverAlpha = true;
        /**
         * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.
         * @internal
         */
        this._useMicroSurfaceFromReflectivityMapAlpha = false;
        /**
         * Specifies if the metallic texture contains the roughness information in its alpha channel.
         * @internal
         */
        this._useRoughnessFromMetallicTextureAlpha = true;
        /**
         * Specifies if the metallic texture contains the roughness information in its green channel.
         * @internal
         */
        this._useRoughnessFromMetallicTextureGreen = false;
        /**
         * Specifies if the metallic texture contains the metallness information in its blue channel.
         * @internal
         */
        this._useMetallnessFromMetallicTextureBlue = false;
        /**
         * Specifies if the metallic texture contains the ambient occlusion information in its red channel.
         * @internal
         */
        this._useAmbientOcclusionFromMetallicTextureRed = false;
        /**
         * Specifies if the ambient texture contains the ambient occlusion information in its red channel only.
         * @internal
         */
        this._useAmbientInGrayScale = false;
        /**
         * In case the reflectivity map does not contain the microsurface information in its alpha channel,
         * The material will try to infer what glossiness each pixel should be.
         * @internal
         */
        this._useAutoMicroSurfaceFromReflectivityMap = false;
        /**
         * Defines the  falloff type used in this material.
         * It by default is Physical.
         * @internal
         */
        this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL;
        /**
         * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones).
         * A car glass is a good example of that. When the street lights reflects on it you can not see what is behind.
         * @internal
         */
        this._useRadianceOverAlpha = true;
        /**
         * Allows using an object space normal map (instead of tangent space).
         * @internal
         */
        this._useObjectSpaceNormalMap = false;
        /**
         * Allows using the bump map in parallax mode.
         * @internal
         */
        this._useParallax = false;
        /**
         * Allows using the bump map in parallax occlusion mode.
         * @internal
         */
        this._useParallaxOcclusion = false;
        /**
         * Controls the scale bias of the parallax mode.
         * @internal
         */
        this._parallaxScaleBias = 0.05;
        /**
         * If sets to true, disables all the lights affecting the material.
         * @internal
         */
        this._disableLighting = false;
        /**
         * Number of Simultaneous lights allowed on the material.
         * @internal
         */
        this._maxSimultaneousLights = 4;
        /**
         * If sets to true, x component of normal map value will be inverted (x = 1.0 - x).
         * @internal
         */
        this._invertNormalMapX = false;
        /**
         * If sets to true, y component of normal map value will be inverted (y = 1.0 - y).
         * @internal
         */
        this._invertNormalMapY = false;
        /**
         * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
         * @internal
         */
        this._twoSidedLighting = false;
        /**
         * Defines the alpha limits in alpha test mode.
         * @internal
         */
        this._alphaCutOff = 0.4;
        /**
         * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations.
         * @internal
         */
        this._forceAlphaTest = false;
        /**
         * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.
         * And/Or occlude the blended part. (alpha is converted to gamma to compute the fresnel)
         * @internal
         */
        this._useAlphaFresnel = false;
        /**
         * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.
         * And/Or occlude the blended part. (alpha stays linear to compute the fresnel)
         * @internal
         */
        this._useLinearAlphaFresnel = false;
        /**
         * Specifies the environment BRDF texture used to compute the scale and offset roughness values
         * from cos theta and roughness:
         * http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf
         * @internal
         */
        this._environmentBRDFTexture = null;
        /**
         * Force the shader to compute irradiance in the fragment shader in order to take bump in account.
         * @internal
         */
        this._forceIrradianceInFragment = false;
        this._realTimeFiltering = false;
        this._realTimeFilteringQuality = 8;
        /**
         * Force normal to face away from face.
         * @internal
         */
        this._forceNormalForward = false;
        /**
         * Enables specular anti aliasing in the PBR shader.
         * It will both interacts on the Geometry for analytical and IBL lighting.
         * It also prefilter the roughness map based on the bump values.
         * @internal
         */
        this._enableSpecularAntiAliasing = false;
        /**
         * Keep track of the image processing observer to allow dispose and replace.
         */
        this._imageProcessingObserver = null;
        /**
         * Stores the available render targets.
         */
        this._renderTargets = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_3__/* .SmartArray */ .L(16);
        /**
         * Sets the global ambient color for the material used in lighting calculations.
         */
        this._globalAmbientColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .Color3 */ .v9(0, 0, 0);
        /**
         * If set to true, no lighting calculations will be applied.
         */
        this._unlit = false;
        /**
         * If sets to true, the decal map will be applied after the detail map. Else, it is applied before (default: false)
         */
        this._applyDecalMapAfterDetailMap = false;
        this._debugMode = 0;
        this._shadersLoaded = false;
        this._breakShaderLoadedCheck = false;
        /**
         * @internal
         * This is reserved for the inspector.
         * Defines the material debug mode.
         * It helps seeing only some components of the material while troubleshooting.
         */
        this.debugMode = 0;
        /**
         * @internal
         * This is reserved for the inspector.
         * Specify from where on screen the debug mode should start.
         * The value goes from -1 (full screen) to 1 (not visible)
         * It helps with side by side comparison against the final render
         * This defaults to -1
         */
        this.debugLimit = -1;
        /**
         * @internal
         * This is reserved for the inspector.
         * As the default viewing range might not be enough (if the ambient is really small for instance)
         * You can use the factor to better multiply the final value.
         */
        this.debugFactor = 1;
        this._cacheHasRenderTargetTextures = false;
        this.brdf = new _pbrBRDFConfiguration_js__WEBPACK_IMPORTED_MODULE_8__/* .PBRBRDFConfiguration */ .j(this);
        this.clearCoat = new _pbrClearCoatConfiguration_js__WEBPACK_IMPORTED_MODULE_19__/* .PBRClearCoatConfiguration */ .t(this);
        this.iridescence = new _pbrIridescenceConfiguration_js__WEBPACK_IMPORTED_MODULE_20__/* .PBRIridescenceConfiguration */ .z(this);
        this.anisotropy = new _pbrAnisotropicConfiguration_js__WEBPACK_IMPORTED_MODULE_21__/* .PBRAnisotropicConfiguration */ .i(this);
        this.sheen = new _pbrSheenConfiguration_js__WEBPACK_IMPORTED_MODULE_22__/* .PBRSheenConfiguration */ .C(this);
        this.subSurface = new _pbrSubSurfaceConfiguration_js__WEBPACK_IMPORTED_MODULE_23__/* .PBRSubSurfaceConfiguration */ .I(this);
        this.detailMap = new _material_detailMapConfiguration_js__WEBPACK_IMPORTED_MODULE_24__/* .DetailMapConfiguration */ .c(this);
        // Setup the default processing configuration to the scene.
        this._attachImageProcessingConfiguration(null);
        this.getRenderTargetTextures = () => {
            this._renderTargets.reset();
            if (_materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
                this._renderTargets.push(this._reflectionTexture);
            }
            this._eventInfo.renderTargets = this._renderTargets;
            this._callbackPluginEventFillRenderTargetTextures(this._eventInfo);
            return this._renderTargets;
        };
        this._environmentBRDFTexture = (0,_Misc_brdfTextureTools_js__WEBPACK_IMPORTED_MODULE_4__/* .GetEnvironmentBRDFTexture */ .X)(this.getScene());
        this.prePassConfiguration = new _prePassConfiguration_js__WEBPACK_IMPORTED_MODULE_9__/* .PrePassConfiguration */ .J();
    }
    /**
     * Gets a boolean indicating that current material needs to register RTT
     */
    get hasRenderTargetTextures() {
        if (_materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
            return true;
        }
        return this._cacheHasRenderTargetTextures;
    }
    /**
     * Can this material render to prepass
     */
    get isPrePassCapable() {
        return !this.disableDepthWrite;
    }
    /**
     * @returns the name of the material class.
     */
    getClassName() {
        return "PBRBaseMaterial";
    }
    /**
     * Returns true if alpha blending should be disabled.
     */
    get _disableAlphaBlending() {
        return (this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_OPAQUE ||
            this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_ALPHATEST ||
            this.subSurface?.disableAlphaBlending);
    }
    /**
     * @returns whether or not this material should be rendered in alpha blend mode.
     */
    needAlphaBlending() {
        if (this._disableAlphaBlending) {
            return false;
        }
        return this.alpha < 1.0 || this._opacityTexture != null || this._shouldUseAlphaFromAlbedoTexture();
    }
    /**
     * @returns whether or not this material should be rendered in alpha test mode.
     */
    needAlphaTesting() {
        if (this._forceAlphaTest) {
            return true;
        }
        if (this.subSurface?.disableAlphaBlending) {
            return false;
        }
        return this._hasAlphaChannel() && (this._transparencyMode == null || this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_ALPHATEST);
    }
    /**
     * @returns whether or not the alpha value of the albedo texture should be used for alpha blending.
     */
    _shouldUseAlphaFromAlbedoTexture() {
        return this._albedoTexture != null && this._albedoTexture.hasAlpha && this._useAlphaFromAlbedoTexture && this._transparencyMode !== PBRBaseMaterial.PBRMATERIAL_OPAQUE;
    }
    /**
     * @returns whether or not there is a usable alpha channel for transparency.
     */
    _hasAlphaChannel() {
        return (this._albedoTexture != null && this._albedoTexture.hasAlpha) || this._opacityTexture != null;
    }
    /**
     * @returns the texture used for the alpha test.
     */
    getAlphaTestTexture() {
        return this._albedoTexture;
    }
    /**
     * Specifies that the submesh is ready to be used.
     * @param mesh - BJS mesh.
     * @param subMesh - A submesh of the BJS mesh.  Used to check if it is ready.
     * @param useInstances - Specifies that instances should be used.
     * @returns - boolean indicating that the submesh is ready or not.
     */
    isReadyForSubMesh(mesh, subMesh, useInstances) {
        if (!this._uniformBufferLayoutBuilt) {
            this.buildUniformLayout();
        }
        const drawWrapper = subMesh._drawWrapper;
        if (drawWrapper.effect && this.isFrozen) {
            if (drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            this._callbackPluginEventGeneric(4 /* MaterialPluginEvent.GetDefineNames */, this._eventInfo);
            subMesh.materialDefines = new PBRMaterialDefines(this._eventInfo.defineNames);
        }
        const defines = subMesh.materialDefines;
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        const scene = this.getScene();
        const engine = scene.getEngine();
        if (defines._areTexturesDirty) {
            this._eventInfo.hasRenderTargetTextures = false;
            this._callbackPluginEventHasRenderTargetTextures(this._eventInfo);
            this._cacheHasRenderTargetTextures = this._eventInfo.hasRenderTargetTextures;
            if (scene.texturesEnabled) {
                if (this._albedoTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.DiffuseTextureEnabled) {
                    if (!this._albedoTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (this._ambientTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.AmbientTextureEnabled) {
                    if (!this._ambientTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (this._opacityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.OpacityTextureEnabled) {
                    if (!this._opacityTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                const reflectionTexture = this._getReflectionTexture();
                if (reflectionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.ReflectionTextureEnabled) {
                    if (!reflectionTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    if (reflectionTexture.irradianceTexture) {
                        if (!reflectionTexture.irradianceTexture.isReadyOrNotBlocking()) {
                            return false;
                        }
                    }
                    else {
                        // Not ready until spherical are ready too.
                        if (!reflectionTexture.sphericalPolynomial && reflectionTexture.getInternalTexture()?._sphericalPolynomialPromise) {
                            return false;
                        }
                    }
                }
                if (this._lightmapTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.LightmapTextureEnabled) {
                    if (!this._lightmapTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (this._emissiveTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.EmissiveTextureEnabled) {
                    if (!this._emissiveTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (_materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.SpecularTextureEnabled) {
                    if (this._metallicTexture) {
                        if (!this._metallicTexture.isReadyOrNotBlocking()) {
                            return false;
                        }
                    }
                    else if (this._reflectivityTexture) {
                        if (!this._reflectivityTexture.isReadyOrNotBlocking()) {
                            return false;
                        }
                    }
                    if (this._metallicReflectanceTexture) {
                        if (!this._metallicReflectanceTexture.isReadyOrNotBlocking()) {
                            return false;
                        }
                    }
                    if (this._reflectanceTexture) {
                        if (!this._reflectanceTexture.isReadyOrNotBlocking()) {
                            return false;
                        }
                    }
                    if (this._microSurfaceTexture) {
                        if (!this._microSurfaceTexture.isReadyOrNotBlocking()) {
                            return false;
                        }
                    }
                }
                if (engine.getCaps().standardDerivatives && this._bumpTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.BumpTextureEnabled && !this._disableBumpMap) {
                    // Bump texture cannot be not blocking.
                    if (!this._bumpTexture.isReady()) {
                        return false;
                    }
                }
                if (this._environmentBRDFTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.ReflectionTextureEnabled) {
                    // This is blocking.
                    if (!this._environmentBRDFTexture.isReady()) {
                        return false;
                    }
                }
            }
        }
        this._eventInfo.isReadyForSubMesh = true;
        this._eventInfo.defines = defines;
        this._eventInfo.subMesh = subMesh;
        this._callbackPluginEventIsReadyForSubMesh(this._eventInfo);
        if (!this._eventInfo.isReadyForSubMesh) {
            return false;
        }
        if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {
            if (!this._imageProcessingConfiguration.isReady()) {
                return false;
            }
        }
        if (!engine.getCaps().standardDerivatives && !mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_7__/* .VertexBuffer */ .R.NormalKind)) {
            mesh.createNormals(true);
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Warn("PBRMaterial: Normals have been created for the mesh: " + mesh.name);
        }
        const previousEffect = subMesh.effect;
        const lightDisposed = defines._areLightsDisposed;
        let effect = this._prepareEffect(mesh, defines, this.onCompiled, this.onError, useInstances, null, subMesh.getRenderingMesh().hasThinInstances);
        let forceWasNotReadyPreviously = false;
        if (effect) {
            if (this._onEffectCreatedObservable) {
                onCreatedEffectParameters.effect = effect;
                onCreatedEffectParameters.subMesh = subMesh;
                this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters);
            }
            // Use previous effect while new one is compiling
            if (this.allowShaderHotSwapping && previousEffect && !effect.isReady()) {
                effect = previousEffect;
                defines.markAsUnprocessed();
                forceWasNotReadyPreviously = this.isFrozen;
                if (lightDisposed) {
                    // re register in case it takes more than one frame.
                    defines._areLightsDisposed = true;
                    return false;
                }
            }
            else {
                scene.resetCachedMaterial();
                subMesh.setEffect(effect, defines, this._materialContext);
            }
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        drawWrapper._wasPreviouslyReady = forceWasNotReadyPreviously ? false : true;
        drawWrapper._wasPreviouslyUsingInstances = !!useInstances;
        this._checkScenePerformancePriority();
        return true;
    }
    /**
     * Specifies if the material uses metallic roughness workflow.
     * @returns boolean specifying if the material uses metallic roughness workflow.
     */
    isMetallicWorkflow() {
        if (this._metallic != null || this._roughness != null || this._metallicTexture) {
            return true;
        }
        return false;
    }
    _prepareEffect(mesh, defines, onCompiled = null, onError = null, useInstances = null, useClipPlane = null, useThinInstances) {
        this._prepareDefines(mesh, defines, useInstances, useClipPlane, useThinInstances);
        if (!defines.isDirty) {
            return null;
        }
        defines.markAsProcessed();
        const scene = this.getScene();
        const engine = scene.getEngine();
        // Fallbacks
        const fallbacks = new _effectFallbacks_js__WEBPACK_IMPORTED_MODULE_18__/* .EffectFallbacks */ .J();
        let fallbackRank = 0;
        if (defines.USESPHERICALINVERTEX) {
            fallbacks.addFallback(fallbackRank++, "USESPHERICALINVERTEX");
        }
        if (defines.FOG) {
            fallbacks.addFallback(fallbackRank, "FOG");
        }
        if (defines.SPECULARAA) {
            fallbacks.addFallback(fallbackRank, "SPECULARAA");
        }
        if (defines.POINTSIZE) {
            fallbacks.addFallback(fallbackRank, "POINTSIZE");
        }
        if (defines.LOGARITHMICDEPTH) {
            fallbacks.addFallback(fallbackRank, "LOGARITHMICDEPTH");
        }
        if (defines.PARALLAX) {
            fallbacks.addFallback(fallbackRank, "PARALLAX");
        }
        if (defines.PARALLAX_RHS) {
            fallbacks.addFallback(fallbackRank, "PARALLAX_RHS");
        }
        if (defines.PARALLAXOCCLUSION) {
            fallbacks.addFallback(fallbackRank++, "PARALLAXOCCLUSION");
        }
        if (defines.ENVIRONMENTBRDF) {
            fallbacks.addFallback(fallbackRank++, "ENVIRONMENTBRDF");
        }
        if (defines.TANGENT) {
            fallbacks.addFallback(fallbackRank++, "TANGENT");
        }
        if (defines.BUMP) {
            fallbacks.addFallback(fallbackRank++, "BUMP");
        }
        fallbackRank = (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .HandleFallbacksForShadows */ .c4)(defines, fallbacks, this._maxSimultaneousLights, fallbackRank++);
        if (defines.SPECULARTERM) {
            fallbacks.addFallback(fallbackRank++, "SPECULARTERM");
        }
        if (defines.USESPHERICALFROMREFLECTIONMAP) {
            fallbacks.addFallback(fallbackRank++, "USESPHERICALFROMREFLECTIONMAP");
        }
        if (defines.USEIRRADIANCEMAP) {
            fallbacks.addFallback(fallbackRank++, "USEIRRADIANCEMAP");
        }
        if (defines.LIGHTMAP) {
            fallbacks.addFallback(fallbackRank++, "LIGHTMAP");
        }
        if (defines.NORMAL) {
            fallbacks.addFallback(fallbackRank++, "NORMAL");
        }
        if (defines.AMBIENT) {
            fallbacks.addFallback(fallbackRank++, "AMBIENT");
        }
        if (defines.EMISSIVE) {
            fallbacks.addFallback(fallbackRank++, "EMISSIVE");
        }
        if (defines.VERTEXCOLOR) {
            fallbacks.addFallback(fallbackRank++, "VERTEXCOLOR");
        }
        if (defines.MORPHTARGETS) {
            fallbacks.addFallback(fallbackRank++, "MORPHTARGETS");
        }
        if (defines.MULTIVIEW) {
            fallbacks.addFallback(0, "MULTIVIEW");
        }
        //Attributes
        const attribs = [_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_7__/* .VertexBuffer */ .R.PositionKind];
        if (defines.NORMAL) {
            attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_7__/* .VertexBuffer */ .R.NormalKind);
        }
        if (defines.TANGENT) {
            attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_7__/* .VertexBuffer */ .R.TangentKind);
        }
        for (let i = 1; i <= 6; ++i) {
            if (defines["UV" + i]) {
                attribs.push(`uv${i === 1 ? "" : i}`);
            }
        }
        if (defines.VERTEXCOLOR) {
            attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_7__/* .VertexBuffer */ .R.ColorKind);
        }
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareAttributesForBones */ .ni)(attribs, mesh, defines, fallbacks);
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareAttributesForInstances */ .ER)(attribs, defines);
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareAttributesForMorphTargets */ .IF)(attribs, mesh, defines);
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareAttributesForBakedVertexAnimation */ .J2)(attribs, mesh, defines);
        let shaderName = "pbr";
        const uniforms = [
            "world",
            "view",
            "viewProjection",
            "vEyePosition",
            "vLightsType",
            "vAmbientColor",
            "vAlbedoColor",
            "vReflectivityColor",
            "vMetallicReflectanceFactors",
            "vEmissiveColor",
            "visibility",
            "vReflectionColor",
            "vFogInfos",
            "vFogColor",
            "pointSize",
            "vAlbedoInfos",
            "vAmbientInfos",
            "vOpacityInfos",
            "vReflectionInfos",
            "vReflectionPosition",
            "vReflectionSize",
            "vEmissiveInfos",
            "vReflectivityInfos",
            "vReflectionFilteringInfo",
            "vMetallicReflectanceInfos",
            "vReflectanceInfos",
            "vMicroSurfaceSamplerInfos",
            "vBumpInfos",
            "vLightmapInfos",
            "mBones",
            "albedoMatrix",
            "ambientMatrix",
            "opacityMatrix",
            "reflectionMatrix",
            "emissiveMatrix",
            "reflectivityMatrix",
            "normalMatrix",
            "microSurfaceSamplerMatrix",
            "bumpMatrix",
            "lightmapMatrix",
            "metallicReflectanceMatrix",
            "reflectanceMatrix",
            "vLightingIntensity",
            "logarithmicDepthConstant",
            "vSphericalX",
            "vSphericalY",
            "vSphericalZ",
            "vSphericalXX_ZZ",
            "vSphericalYY_ZZ",
            "vSphericalZZ",
            "vSphericalXY",
            "vSphericalYZ",
            "vSphericalZX",
            "vSphericalL00",
            "vSphericalL1_1",
            "vSphericalL10",
            "vSphericalL11",
            "vSphericalL2_2",
            "vSphericalL2_1",
            "vSphericalL20",
            "vSphericalL21",
            "vSphericalL22",
            "vReflectionMicrosurfaceInfos",
            "vTangentSpaceParams",
            "boneTextureWidth",
            "vDebugMode",
            "morphTargetTextureInfo",
            "morphTargetTextureIndices",
        ];
        const samplers = [
            "albedoSampler",
            "reflectivitySampler",
            "ambientSampler",
            "emissiveSampler",
            "bumpSampler",
            "lightmapSampler",
            "opacitySampler",
            "reflectionSampler",
            "reflectionSamplerLow",
            "reflectionSamplerHigh",
            "irradianceSampler",
            "microSurfaceSampler",
            "environmentBrdfSampler",
            "boneSampler",
            "metallicReflectanceSampler",
            "reflectanceSampler",
            "morphTargets",
            "oitDepthSampler",
            "oitFrontColorSampler",
        ];
        const uniformBuffers = ["Material", "Scene", "Mesh"];
        const indexParameters = { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS };
        this._eventInfo.fallbacks = fallbacks;
        this._eventInfo.fallbackRank = fallbackRank;
        this._eventInfo.defines = defines;
        this._eventInfo.uniforms = uniforms;
        this._eventInfo.attributes = attribs;
        this._eventInfo.samplers = samplers;
        this._eventInfo.uniformBuffersNames = uniformBuffers;
        this._eventInfo.customCode = undefined;
        this._eventInfo.mesh = mesh;
        this._eventInfo.indexParameters = indexParameters;
        this._callbackPluginEventGeneric(128 /* MaterialPluginEvent.PrepareEffect */, this._eventInfo);
        _materialHelper_geometryrendering_js__WEBPACK_IMPORTED_MODULE_27__/* .MaterialHelperGeometryRendering */ .m.AddUniformsAndSamplers(uniforms, samplers);
        _prePassConfiguration_js__WEBPACK_IMPORTED_MODULE_9__/* .PrePassConfiguration */ .J.AddUniforms(uniforms);
        _prePassConfiguration_js__WEBPACK_IMPORTED_MODULE_9__/* .PrePassConfiguration */ .J.AddSamplers(samplers);
        (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_25__/* .addClipPlaneUniforms */ .TV)(uniforms);
        if (_Materials_imageProcessingConfiguration_js__WEBPACK_IMPORTED_MODULE_11__/* .ImageProcessingConfiguration */ .p) {
            _Materials_imageProcessingConfiguration_js__WEBPACK_IMPORTED_MODULE_11__/* .ImageProcessingConfiguration */ .p.PrepareUniforms(uniforms, defines);
            _Materials_imageProcessingConfiguration_js__WEBPACK_IMPORTED_MODULE_11__/* .ImageProcessingConfiguration */ .p.PrepareSamplers(samplers, defines);
        }
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareUniformsAndSamplersList */ .Bb)({
            uniformsNames: uniforms,
            uniformBuffersNames: uniformBuffers,
            samplers: samplers,
            defines: defines,
            maxSimultaneousLights: this._maxSimultaneousLights,
        });
        const csnrOptions = {};
        if (this.customShaderNameResolve) {
            shaderName = this.customShaderNameResolve(shaderName, uniforms, uniformBuffers, samplers, defines, attribs, csnrOptions);
        }
        const join = defines.toString();
        const effect = engine.createEffect(shaderName, {
            attributes: attribs,
            uniformsNames: uniforms,
            uniformBuffersNames: uniformBuffers,
            samplers: samplers,
            defines: join,
            fallbacks: fallbacks,
            onCompiled: onCompiled,
            onError: onError,
            indexParameters,
            processFinalCode: csnrOptions.processFinalCode,
            processCodeAfterIncludes: this._eventInfo.customCode,
            multiTarget: defines.PREPASS,
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: this._shadersLoaded
                ? undefined
                : async () => {
                    if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 39174)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22625))]);
                    }
                    else {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 81448)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 84037))]);
                    }
                    this._shadersLoaded = true;
                },
        }, engine);
        this._eventInfo.customCode = undefined;
        return effect;
    }
    _prepareDefines(mesh, defines, useInstances = null, useClipPlane = null, useThinInstances = false) {
        const scene = this.getScene();
        const engine = scene.getEngine();
        // Lights
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForLights */ .az)(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting);
        defines._needNormals = true;
        // Multiview
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMultiview */ .VO)(scene, defines);
        // PrePass
        const oit = this.needAlphaBlendingForMesh(mesh) && this.getScene().useOrderIndependentTransparency;
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForPrePass */ .N4)(scene, defines, this.canRenderToMRT && !oit);
        // Order independant transparency
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForOIT */ .Nc)(scene, defines, oit);
        _materialHelper_geometryrendering_js__WEBPACK_IMPORTED_MODULE_27__/* .MaterialHelperGeometryRendering */ .m.PrepareDefines(engine.currentRenderPassId, mesh, defines);
        // Textures
        defines.METALLICWORKFLOW = this.isMetallicWorkflow();
        if (defines._areTexturesDirty) {
            defines._needUVs = false;
            for (let i = 1; i <= 6; ++i) {
                defines["MAINUV" + i] = false;
            }
            if (scene.texturesEnabled) {
                defines.ALBEDODIRECTUV = 0;
                defines.AMBIENTDIRECTUV = 0;
                defines.OPACITYDIRECTUV = 0;
                defines.EMISSIVEDIRECTUV = 0;
                defines.REFLECTIVITYDIRECTUV = 0;
                defines.MICROSURFACEMAPDIRECTUV = 0;
                defines.METALLIC_REFLECTANCEDIRECTUV = 0;
                defines.REFLECTANCEDIRECTUV = 0;
                defines.BUMPDIRECTUV = 0;
                defines.LIGHTMAPDIRECTUV = 0;
                if (engine.getCaps().textureLOD) {
                    defines.LODBASEDMICROSFURACE = true;
                }
                if (this._albedoTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.DiffuseTextureEnabled) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._albedoTexture, defines, "ALBEDO");
                    defines.GAMMAALBEDO = this._albedoTexture.gammaSpace;
                }
                else {
                    defines.ALBEDO = false;
                }
                if (this._ambientTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.AmbientTextureEnabled) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._ambientTexture, defines, "AMBIENT");
                    defines.AMBIENTINGRAYSCALE = this._useAmbientInGrayScale;
                }
                else {
                    defines.AMBIENT = false;
                }
                if (this._opacityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.OpacityTextureEnabled) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._opacityTexture, defines, "OPACITY");
                    defines.OPACITYRGB = this._opacityTexture.getAlphaFromRGB;
                }
                else {
                    defines.OPACITY = false;
                }
                const reflectionTexture = this._getReflectionTexture();
                if (reflectionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.ReflectionTextureEnabled) {
                    defines.REFLECTION = true;
                    defines.GAMMAREFLECTION = reflectionTexture.gammaSpace;
                    defines.RGBDREFLECTION = reflectionTexture.isRGBD;
                    defines.LODINREFLECTIONALPHA = reflectionTexture.lodLevelInAlpha;
                    defines.LINEARSPECULARREFLECTION = reflectionTexture.linearSpecularLOD;
                    if (this.realTimeFiltering && this.realTimeFilteringQuality > 0) {
                        defines.NUM_SAMPLES = "" + this.realTimeFilteringQuality;
                        if (engine._features.needTypeSuffixInShaderConstants) {
                            defines.NUM_SAMPLES = defines.NUM_SAMPLES + "u";
                        }
                        defines.REALTIME_FILTERING = true;
                    }
                    else {
                        defines.REALTIME_FILTERING = false;
                    }
                    defines.INVERTCUBICMAP = reflectionTexture.coordinatesMode === _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.INVCUBIC_MODE;
                    defines.REFLECTIONMAP_3D = reflectionTexture.isCube;
                    defines.REFLECTIONMAP_OPPOSITEZ = defines.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !reflectionTexture.invertZ : reflectionTexture.invertZ;
                    defines.REFLECTIONMAP_CUBIC = false;
                    defines.REFLECTIONMAP_EXPLICIT = false;
                    defines.REFLECTIONMAP_PLANAR = false;
                    defines.REFLECTIONMAP_PROJECTION = false;
                    defines.REFLECTIONMAP_SKYBOX = false;
                    defines.REFLECTIONMAP_SPHERICAL = false;
                    defines.REFLECTIONMAP_EQUIRECTANGULAR = false;
                    defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
                    defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
                    switch (reflectionTexture.coordinatesMode) {
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.EXPLICIT_MODE:
                            defines.REFLECTIONMAP_EXPLICIT = true;
                            break;
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.PLANAR_MODE:
                            defines.REFLECTIONMAP_PLANAR = true;
                            break;
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.PROJECTION_MODE:
                            defines.REFLECTIONMAP_PROJECTION = true;
                            break;
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.SKYBOX_MODE:
                            defines.REFLECTIONMAP_SKYBOX = true;
                            break;
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.SPHERICAL_MODE:
                            defines.REFLECTIONMAP_SPHERICAL = true;
                            break;
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.EQUIRECTANGULAR_MODE:
                            defines.REFLECTIONMAP_EQUIRECTANGULAR = true;
                            break;
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.FIXED_EQUIRECTANGULAR_MODE:
                            defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = true;
                            break;
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
                            defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = true;
                            break;
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.CUBIC_MODE:
                        case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.INVCUBIC_MODE:
                        default:
                            defines.REFLECTIONMAP_CUBIC = true;
                            defines.USE_LOCAL_REFLECTIONMAP_CUBIC = reflectionTexture.boundingBoxSize ? true : false;
                            break;
                    }
                    if (reflectionTexture.coordinatesMode !== _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_15__/* .Texture */ .g.SKYBOX_MODE) {
                        if (reflectionTexture.irradianceTexture) {
                            defines.USEIRRADIANCEMAP = true;
                            defines.USESPHERICALFROMREFLECTIONMAP = false;
                        }
                        // Assume using spherical polynomial if the reflection texture is a cube map
                        else if (reflectionTexture.isCube) {
                            defines.USESPHERICALFROMREFLECTIONMAP = true;
                            defines.USEIRRADIANCEMAP = false;
                            if (this._forceIrradianceInFragment || this.realTimeFiltering || this._twoSidedLighting || engine.getCaps().maxVaryingVectors <= 8) {
                                defines.USESPHERICALINVERTEX = false;
                            }
                            else {
                                defines.USESPHERICALINVERTEX = true;
                            }
                        }
                    }
                }
                else {
                    defines.REFLECTION = false;
                    defines.REFLECTIONMAP_3D = false;
                    defines.REFLECTIONMAP_SPHERICAL = false;
                    defines.REFLECTIONMAP_PLANAR = false;
                    defines.REFLECTIONMAP_CUBIC = false;
                    defines.USE_LOCAL_REFLECTIONMAP_CUBIC = false;
                    defines.REFLECTIONMAP_PROJECTION = false;
                    defines.REFLECTIONMAP_SKYBOX = false;
                    defines.REFLECTIONMAP_EXPLICIT = false;
                    defines.REFLECTIONMAP_EQUIRECTANGULAR = false;
                    defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
                    defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
                    defines.INVERTCUBICMAP = false;
                    defines.USESPHERICALFROMREFLECTIONMAP = false;
                    defines.USEIRRADIANCEMAP = false;
                    defines.USESPHERICALINVERTEX = false;
                    defines.REFLECTIONMAP_OPPOSITEZ = false;
                    defines.LODINREFLECTIONALPHA = false;
                    defines.GAMMAREFLECTION = false;
                    defines.RGBDREFLECTION = false;
                    defines.LINEARSPECULARREFLECTION = false;
                }
                if (this._lightmapTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.LightmapTextureEnabled) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._lightmapTexture, defines, "LIGHTMAP");
                    defines.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap;
                    defines.GAMMALIGHTMAP = this._lightmapTexture.gammaSpace;
                    defines.RGBDLIGHTMAP = this._lightmapTexture.isRGBD;
                }
                else {
                    defines.LIGHTMAP = false;
                }
                if (this._emissiveTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.EmissiveTextureEnabled) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._emissiveTexture, defines, "EMISSIVE");
                    defines.GAMMAEMISSIVE = this._emissiveTexture.gammaSpace;
                }
                else {
                    defines.EMISSIVE = false;
                }
                if (_materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.SpecularTextureEnabled) {
                    if (this._metallicTexture) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._metallicTexture, defines, "REFLECTIVITY");
                        defines.ROUGHNESSSTOREINMETALMAPALPHA = this._useRoughnessFromMetallicTextureAlpha;
                        defines.ROUGHNESSSTOREINMETALMAPGREEN = !this._useRoughnessFromMetallicTextureAlpha && this._useRoughnessFromMetallicTextureGreen;
                        defines.METALLNESSSTOREINMETALMAPBLUE = this._useMetallnessFromMetallicTextureBlue;
                        defines.AOSTOREINMETALMAPRED = this._useAmbientOcclusionFromMetallicTextureRed;
                        defines.REFLECTIVITY_GAMMA = false;
                    }
                    else if (this._reflectivityTexture) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._reflectivityTexture, defines, "REFLECTIVITY");
                        defines.MICROSURFACEFROMREFLECTIVITYMAP = this._useMicroSurfaceFromReflectivityMapAlpha;
                        defines.MICROSURFACEAUTOMATIC = this._useAutoMicroSurfaceFromReflectivityMap;
                        defines.REFLECTIVITY_GAMMA = this._reflectivityTexture.gammaSpace;
                    }
                    else {
                        defines.REFLECTIVITY = false;
                    }
                    if (this._metallicReflectanceTexture || this._reflectanceTexture) {
                        defines.METALLIC_REFLECTANCE_USE_ALPHA_ONLY = this._useOnlyMetallicFromMetallicReflectanceTexture;
                        if (this._metallicReflectanceTexture) {
                            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._metallicReflectanceTexture, defines, "METALLIC_REFLECTANCE");
                            defines.METALLIC_REFLECTANCE_GAMMA = this._metallicReflectanceTexture.gammaSpace;
                        }
                        else {
                            defines.METALLIC_REFLECTANCE = false;
                        }
                        if (this._reflectanceTexture &&
                            (!this._metallicReflectanceTexture || (this._metallicReflectanceTexture && this._useOnlyMetallicFromMetallicReflectanceTexture))) {
                            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._reflectanceTexture, defines, "REFLECTANCE");
                            defines.REFLECTANCE_GAMMA = this._reflectanceTexture.gammaSpace;
                        }
                        else {
                            defines.REFLECTANCE = false;
                        }
                    }
                    else {
                        defines.METALLIC_REFLECTANCE = false;
                        defines.REFLECTANCE = false;
                    }
                    if (this._microSurfaceTexture) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._microSurfaceTexture, defines, "MICROSURFACEMAP");
                    }
                    else {
                        defines.MICROSURFACEMAP = false;
                    }
                }
                else {
                    defines.REFLECTIVITY = false;
                    defines.MICROSURFACEMAP = false;
                }
                if (engine.getCaps().standardDerivatives && this._bumpTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.BumpTextureEnabled && !this._disableBumpMap) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMergedUV */ .YT)(this._bumpTexture, defines, "BUMP");
                    if (this._useParallax && this._albedoTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.DiffuseTextureEnabled) {
                        defines.PARALLAX = true;
                        defines.PARALLAX_RHS = scene.useRightHandedSystem;
                        defines.PARALLAXOCCLUSION = !!this._useParallaxOcclusion;
                    }
                    else {
                        defines.PARALLAX = false;
                    }
                    defines.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap;
                }
                else {
                    defines.BUMP = false;
                    defines.PARALLAX = false;
                    defines.PARALLAX_RHS = false;
                    defines.PARALLAXOCCLUSION = false;
                    defines.OBJECTSPACE_NORMALMAP = false;
                }
                if (this._environmentBRDFTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.ReflectionTextureEnabled) {
                    defines.ENVIRONMENTBRDF = true;
                    defines.ENVIRONMENTBRDF_RGBD = this._environmentBRDFTexture.isRGBD;
                }
                else {
                    defines.ENVIRONMENTBRDF = false;
                    defines.ENVIRONMENTBRDF_RGBD = false;
                }
                if (this._shouldUseAlphaFromAlbedoTexture()) {
                    defines.ALPHAFROMALBEDO = true;
                }
                else {
                    defines.ALPHAFROMALBEDO = false;
                }
            }
            defines.SPECULAROVERALPHA = this._useSpecularOverAlpha;
            if (this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_STANDARD) {
                defines.USEPHYSICALLIGHTFALLOFF = false;
                defines.USEGLTFLIGHTFALLOFF = false;
            }
            else if (this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_GLTF) {
                defines.USEPHYSICALLIGHTFALLOFF = false;
                defines.USEGLTFLIGHTFALLOFF = true;
            }
            else {
                defines.USEPHYSICALLIGHTFALLOFF = true;
                defines.USEGLTFLIGHTFALLOFF = false;
            }
            defines.RADIANCEOVERALPHA = this._useRadianceOverAlpha;
            if (!this.backFaceCulling && this._twoSidedLighting) {
                defines.TWOSIDEDLIGHTING = true;
            }
            else {
                defines.TWOSIDEDLIGHTING = false;
            }
            defines.SPECULARAA = engine.getCaps().standardDerivatives && this._enableSpecularAntiAliasing;
        }
        if (defines._areTexturesDirty || defines._areMiscDirty) {
            defines.ALPHATESTVALUE = `${this._alphaCutOff}${this._alphaCutOff % 1 === 0 ? "." : ""}`;
            defines.PREMULTIPLYALPHA = this.alphaMode === 7 || this.alphaMode === 8;
            defines.ALPHABLEND = this.needAlphaBlendingForMesh(mesh);
            defines.ALPHAFRESNEL = this._useAlphaFresnel || this._useLinearAlphaFresnel;
            defines.LINEARALPHAFRESNEL = this._useLinearAlphaFresnel;
        }
        if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {
            this._imageProcessingConfiguration.prepareDefines(defines);
        }
        defines.FORCENORMALFORWARD = this._forceNormalForward;
        defines.RADIANCEOCCLUSION = this._useRadianceOcclusion;
        defines.HORIZONOCCLUSION = this._useHorizonOcclusion;
        // Misc.
        if (defines._areMiscDirty) {
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForMisc */ .fm)(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh) || this._forceAlphaTest, defines, this._applyDecalMapAfterDetailMap);
            defines.UNLIT = this._unlit || ((this.pointsCloud || this.wireframe) && !mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_7__/* .VertexBuffer */ .R.NormalKind));
            defines.DEBUGMODE = this._debugMode;
        }
        // Values that need to be evaluated on every frame
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForFrameBoundValues */ .OR)(scene, engine, this, defines, useInstances ? true : false, useClipPlane, useThinInstances);
        // External config
        this._eventInfo.defines = defines;
        this._eventInfo.mesh = mesh;
        this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo);
        // Attribs
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .PrepareDefinesForAttributes */ .qB)(mesh, defines, true, true, true, this._transparencyMode !== PBRBaseMaterial.PBRMATERIAL_OPAQUE);
        // External config
        this._callbackPluginEventPrepareDefines(this._eventInfo);
    }
    /**
     * Force shader compilation
     * @param mesh - Define the mesh we want to force the compilation for
     * @param onCompiled - Define a callback triggered when the compilation completes
     * @param options - Define the options used to create the compilation
     */
    forceCompilation(mesh, onCompiled, options) {
        const localOptions = {
            clipPlane: false,
            useInstances: false,
            ...options,
        };
        if (!this._uniformBufferLayoutBuilt) {
            this.buildUniformLayout();
        }
        this._callbackPluginEventGeneric(4 /* MaterialPluginEvent.GetDefineNames */, this._eventInfo);
        const checkReady = () => {
            if (this._breakShaderLoadedCheck) {
                return;
            }
            const defines = new PBRMaterialDefines(this._eventInfo.defineNames);
            const effect = this._prepareEffect(mesh, defines, undefined, undefined, localOptions.useInstances, localOptions.clipPlane, mesh.hasThinInstances);
            if (this._onEffectCreatedObservable) {
                onCreatedEffectParameters.effect = effect;
                onCreatedEffectParameters.subMesh = null;
                this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters);
            }
            if (effect.isReady()) {
                if (onCompiled) {
                    onCompiled(this);
                }
            }
            else {
                effect.onCompileObservable.add(() => {
                    if (onCompiled) {
                        onCompiled(this);
                    }
                });
            }
        };
        checkReady();
    }
    /**
     * Initializes the uniform buffer layout for the shader.
     */
    buildUniformLayout() {
        // Order is important !
        const ubo = this._uniformBuffer;
        ubo.addUniform("vAlbedoInfos", 2);
        ubo.addUniform("vAmbientInfos", 4);
        ubo.addUniform("vOpacityInfos", 2);
        ubo.addUniform("vEmissiveInfos", 2);
        ubo.addUniform("vLightmapInfos", 2);
        ubo.addUniform("vReflectivityInfos", 3);
        ubo.addUniform("vMicroSurfaceSamplerInfos", 2);
        ubo.addUniform("vReflectionInfos", 2);
        ubo.addUniform("vReflectionFilteringInfo", 2);
        ubo.addUniform("vReflectionPosition", 3);
        ubo.addUniform("vReflectionSize", 3);
        ubo.addUniform("vBumpInfos", 3);
        ubo.addUniform("albedoMatrix", 16);
        ubo.addUniform("ambientMatrix", 16);
        ubo.addUniform("opacityMatrix", 16);
        ubo.addUniform("emissiveMatrix", 16);
        ubo.addUniform("lightmapMatrix", 16);
        ubo.addUniform("reflectivityMatrix", 16);
        ubo.addUniform("microSurfaceSamplerMatrix", 16);
        ubo.addUniform("bumpMatrix", 16);
        ubo.addUniform("vTangentSpaceParams", 2);
        ubo.addUniform("reflectionMatrix", 16);
        ubo.addUniform("vReflectionColor", 3);
        ubo.addUniform("vAlbedoColor", 4);
        ubo.addUniform("vLightingIntensity", 4);
        ubo.addUniform("vReflectionMicrosurfaceInfos", 3);
        ubo.addUniform("pointSize", 1);
        ubo.addUniform("vReflectivityColor", 4);
        ubo.addUniform("vEmissiveColor", 3);
        ubo.addUniform("vAmbientColor", 3);
        ubo.addUniform("vDebugMode", 2);
        ubo.addUniform("vMetallicReflectanceFactors", 4);
        ubo.addUniform("vMetallicReflectanceInfos", 2);
        ubo.addUniform("metallicReflectanceMatrix", 16);
        ubo.addUniform("vReflectanceInfos", 2);
        ubo.addUniform("reflectanceMatrix", 16);
        ubo.addUniform("vSphericalL00", 3);
        ubo.addUniform("vSphericalL1_1", 3);
        ubo.addUniform("vSphericalL10", 3);
        ubo.addUniform("vSphericalL11", 3);
        ubo.addUniform("vSphericalL2_2", 3);
        ubo.addUniform("vSphericalL2_1", 3);
        ubo.addUniform("vSphericalL20", 3);
        ubo.addUniform("vSphericalL21", 3);
        ubo.addUniform("vSphericalL22", 3);
        ubo.addUniform("vSphericalX", 3);
        ubo.addUniform("vSphericalY", 3);
        ubo.addUniform("vSphericalZ", 3);
        ubo.addUniform("vSphericalXX_ZZ", 3);
        ubo.addUniform("vSphericalYY_ZZ", 3);
        ubo.addUniform("vSphericalZZ", 3);
        ubo.addUniform("vSphericalXY", 3);
        ubo.addUniform("vSphericalYZ", 3);
        ubo.addUniform("vSphericalZX", 3);
        super.buildUniformLayout();
    }
    /**
     * Binds the submesh data.
     * @param world - The world matrix.
     * @param mesh - The BJS mesh.
     * @param subMesh - A submesh of the BJS mesh.
     */
    bindForSubMesh(world, mesh, subMesh) {
        const scene = this.getScene();
        const defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        const effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices Mesh.
        mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
        mesh.transferToEffect(world);
        const engine = scene.getEngine();
        // Binding unconditionally
        this._uniformBuffer.bindToEffect(effect, "Material");
        this.prePassConfiguration.bindForSubMesh(this._activeEffect, scene, mesh, world, this.isFrozen);
        _materialHelper_geometryrendering_js__WEBPACK_IMPORTED_MODULE_27__/* .MaterialHelperGeometryRendering */ .m.Bind(engine.currentRenderPassId, this._activeEffect, mesh, world);
        this._eventInfo.subMesh = subMesh;
        this._callbackPluginEventHardBindForSubMesh(this._eventInfo);
        // Normal Matrix
        if (defines.OBJECTSPACE_NORMALMAP) {
            world.toNormalMatrix(this._normalMatrix);
            this.bindOnlyNormalMatrix(this._normalMatrix);
        }
        const mustRebind = this._mustRebind(scene, effect, subMesh, mesh.visibility);
        // Bones
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindBonesParameters */ .f$)(mesh, this._activeEffect, this.prePassConfiguration);
        let reflectionTexture = null;
        const ubo = this._uniformBuffer;
        if (mustRebind) {
            this.bindViewProjection(effect);
            reflectionTexture = this._getReflectionTexture();
            if (!ubo.useUbo || !this.isFrozen || !ubo.isSync || subMesh._drawWrapper._forceRebindOnNextCall) {
                // Texture uniforms
                if (scene.texturesEnabled) {
                    if (this._albedoTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.DiffuseTextureEnabled) {
                        ubo.updateFloat2("vAlbedoInfos", this._albedoTexture.coordinatesIndex, this._albedoTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._albedoTexture, ubo, "albedo");
                    }
                    if (this._ambientTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.AmbientTextureEnabled) {
                        ubo.updateFloat4("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level, this._ambientTextureStrength, this._ambientTextureImpactOnAnalyticalLights);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._ambientTexture, ubo, "ambient");
                    }
                    if (this._opacityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.OpacityTextureEnabled) {
                        ubo.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._opacityTexture, ubo, "opacity");
                    }
                    if (reflectionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.ReflectionTextureEnabled) {
                        ubo.updateMatrix("reflectionMatrix", reflectionTexture.getReflectionTextureMatrix());
                        ubo.updateFloat2("vReflectionInfos", reflectionTexture.level, 0);
                        if (reflectionTexture.boundingBoxSize) {
                            const cubeTexture = reflectionTexture;
                            ubo.updateVector3("vReflectionPosition", cubeTexture.boundingBoxPosition);
                            ubo.updateVector3("vReflectionSize", cubeTexture.boundingBoxSize);
                        }
                        if (this.realTimeFiltering) {
                            const width = reflectionTexture.getSize().width;
                            ubo.updateFloat2("vReflectionFilteringInfo", width, Math.log2(width));
                        }
                        if (!defines.USEIRRADIANCEMAP) {
                            const polynomials = reflectionTexture.sphericalPolynomial;
                            if (defines.USESPHERICALFROMREFLECTIONMAP && polynomials) {
                                if (defines.SPHERICAL_HARMONICS) {
                                    const preScaledHarmonics = polynomials.preScaledHarmonics;
                                    ubo.updateVector3("vSphericalL00", preScaledHarmonics.l00);
                                    ubo.updateVector3("vSphericalL1_1", preScaledHarmonics.l1_1);
                                    ubo.updateVector3("vSphericalL10", preScaledHarmonics.l10);
                                    ubo.updateVector3("vSphericalL11", preScaledHarmonics.l11);
                                    ubo.updateVector3("vSphericalL2_2", preScaledHarmonics.l2_2);
                                    ubo.updateVector3("vSphericalL2_1", preScaledHarmonics.l2_1);
                                    ubo.updateVector3("vSphericalL20", preScaledHarmonics.l20);
                                    ubo.updateVector3("vSphericalL21", preScaledHarmonics.l21);
                                    ubo.updateVector3("vSphericalL22", preScaledHarmonics.l22);
                                }
                                else {
                                    ubo.updateFloat3("vSphericalX", polynomials.x.x, polynomials.x.y, polynomials.x.z);
                                    ubo.updateFloat3("vSphericalY", polynomials.y.x, polynomials.y.y, polynomials.y.z);
                                    ubo.updateFloat3("vSphericalZ", polynomials.z.x, polynomials.z.y, polynomials.z.z);
                                    ubo.updateFloat3("vSphericalXX_ZZ", polynomials.xx.x - polynomials.zz.x, polynomials.xx.y - polynomials.zz.y, polynomials.xx.z - polynomials.zz.z);
                                    ubo.updateFloat3("vSphericalYY_ZZ", polynomials.yy.x - polynomials.zz.x, polynomials.yy.y - polynomials.zz.y, polynomials.yy.z - polynomials.zz.z);
                                    ubo.updateFloat3("vSphericalZZ", polynomials.zz.x, polynomials.zz.y, polynomials.zz.z);
                                    ubo.updateFloat3("vSphericalXY", polynomials.xy.x, polynomials.xy.y, polynomials.xy.z);
                                    ubo.updateFloat3("vSphericalYZ", polynomials.yz.x, polynomials.yz.y, polynomials.yz.z);
                                    ubo.updateFloat3("vSphericalZX", polynomials.zx.x, polynomials.zx.y, polynomials.zx.z);
                                }
                            }
                        }
                        ubo.updateFloat3("vReflectionMicrosurfaceInfos", reflectionTexture.getSize().width, reflectionTexture.lodGenerationScale, reflectionTexture.lodGenerationOffset);
                    }
                    if (this._emissiveTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.EmissiveTextureEnabled) {
                        ubo.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._emissiveTexture, ubo, "emissive");
                    }
                    if (this._lightmapTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.LightmapTextureEnabled) {
                        ubo.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._lightmapTexture, ubo, "lightmap");
                    }
                    if (_materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.SpecularTextureEnabled) {
                        if (this._metallicTexture) {
                            ubo.updateFloat3("vReflectivityInfos", this._metallicTexture.coordinatesIndex, this._metallicTexture.level, this._ambientTextureStrength);
                            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._metallicTexture, ubo, "reflectivity");
                        }
                        else if (this._reflectivityTexture) {
                            ubo.updateFloat3("vReflectivityInfos", this._reflectivityTexture.coordinatesIndex, this._reflectivityTexture.level, 1.0);
                            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._reflectivityTexture, ubo, "reflectivity");
                        }
                        if (this._metallicReflectanceTexture) {
                            ubo.updateFloat2("vMetallicReflectanceInfos", this._metallicReflectanceTexture.coordinatesIndex, this._metallicReflectanceTexture.level);
                            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._metallicReflectanceTexture, ubo, "metallicReflectance");
                        }
                        if (this._reflectanceTexture && defines.REFLECTANCE) {
                            ubo.updateFloat2("vReflectanceInfos", this._reflectanceTexture.coordinatesIndex, this._reflectanceTexture.level);
                            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._reflectanceTexture, ubo, "reflectance");
                        }
                        if (this._microSurfaceTexture) {
                            ubo.updateFloat2("vMicroSurfaceSamplerInfos", this._microSurfaceTexture.coordinatesIndex, this._microSurfaceTexture.level);
                            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._microSurfaceTexture, ubo, "microSurfaceSampler");
                        }
                    }
                    if (this._bumpTexture && engine.getCaps().standardDerivatives && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.BumpTextureEnabled && !this._disableBumpMap) {
                        ubo.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, this._bumpTexture.level, this._parallaxScaleBias);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindTextureMatrix */ .mA)(this._bumpTexture, ubo, "bump");
                        if (scene._mirroredCameraPosition) {
                            ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0);
                        }
                        else {
                            ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0);
                        }
                    }
                }
                // Point size
                if (this.pointsCloud) {
                    ubo.updateFloat("pointSize", this.pointSize);
                }
                // Colors
                if (defines.METALLICWORKFLOW) {
                    _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .TmpColors */ .IG.Color3[0].r = this._metallic === undefined || this._metallic === null ? 1 : this._metallic;
                    _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .TmpColors */ .IG.Color3[0].g = this._roughness === undefined || this._roughness === null ? 1 : this._roughness;
                    ubo.updateColor4("vReflectivityColor", _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .TmpColors */ .IG.Color3[0], 1);
                    const ior = this.subSurface?._indexOfRefraction ?? 1.5;
                    const outsideIOR = 1; // consider air as clear coat and other layers would remap in the shader.
                    // We are here deriving our default reflectance from a common value for none metallic surface.
                    // Based of the schlick fresnel approximation model
                    // for dielectrics.
                    const f0 = Math.pow((ior - outsideIOR) / (ior + outsideIOR), 2);
                    // Tweak the default F0 and F90 based on our given setup
                    this._metallicReflectanceColor.scaleToRef(f0 * this._metallicF0Factor, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .TmpColors */ .IG.Color3[0]);
                    const metallicF90 = this._metallicF0Factor;
                    ubo.updateColor4("vMetallicReflectanceFactors", _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .TmpColors */ .IG.Color3[0], metallicF90);
                }
                else {
                    ubo.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface);
                }
                ubo.updateColor3("vEmissiveColor", _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.EmissiveTextureEnabled ? this._emissiveColor : _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_10__/* .Color3 */ .v9.BlackReadOnly);
                ubo.updateColor3("vReflectionColor", this._reflectionColor);
                if (!defines.SS_REFRACTION && this.subSurface?._linkRefractionWithTransparency) {
                    ubo.updateColor4("vAlbedoColor", this._albedoColor, 1);
                }
                else {
                    ubo.updateColor4("vAlbedoColor", this._albedoColor, this.alpha);
                }
                // Misc
                this._lightingInfos.x = this._directIntensity;
                this._lightingInfos.y = this._emissiveIntensity;
                this._lightingInfos.z = this._environmentIntensity * scene.environmentIntensity;
                this._lightingInfos.w = this._specularIntensity;
                ubo.updateVector4("vLightingIntensity", this._lightingInfos);
                // Colors
                scene.ambientColor.multiplyToRef(this._ambientColor, this._globalAmbientColor);
                ubo.updateColor3("vAmbientColor", this._globalAmbientColor);
                ubo.updateFloat2("vDebugMode", this.debugLimit, this.debugFactor);
            }
            // Textures
            if (scene.texturesEnabled) {
                if (this._albedoTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.DiffuseTextureEnabled) {
                    ubo.setTexture("albedoSampler", this._albedoTexture);
                }
                if (this._ambientTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.AmbientTextureEnabled) {
                    ubo.setTexture("ambientSampler", this._ambientTexture);
                }
                if (this._opacityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.OpacityTextureEnabled) {
                    ubo.setTexture("opacitySampler", this._opacityTexture);
                }
                if (reflectionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.ReflectionTextureEnabled) {
                    if (defines.LODBASEDMICROSFURACE) {
                        ubo.setTexture("reflectionSampler", reflectionTexture);
                    }
                    else {
                        ubo.setTexture("reflectionSampler", reflectionTexture._lodTextureMid || reflectionTexture);
                        ubo.setTexture("reflectionSamplerLow", reflectionTexture._lodTextureLow || reflectionTexture);
                        ubo.setTexture("reflectionSamplerHigh", reflectionTexture._lodTextureHigh || reflectionTexture);
                    }
                    if (defines.USEIRRADIANCEMAP) {
                        ubo.setTexture("irradianceSampler", reflectionTexture.irradianceTexture);
                    }
                }
                if (defines.ENVIRONMENTBRDF) {
                    ubo.setTexture("environmentBrdfSampler", this._environmentBRDFTexture);
                }
                if (this._emissiveTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.EmissiveTextureEnabled) {
                    ubo.setTexture("emissiveSampler", this._emissiveTexture);
                }
                if (this._lightmapTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.LightmapTextureEnabled) {
                    ubo.setTexture("lightmapSampler", this._lightmapTexture);
                }
                if (_materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.SpecularTextureEnabled) {
                    if (this._metallicTexture) {
                        ubo.setTexture("reflectivitySampler", this._metallicTexture);
                    }
                    else if (this._reflectivityTexture) {
                        ubo.setTexture("reflectivitySampler", this._reflectivityTexture);
                    }
                    if (this._metallicReflectanceTexture) {
                        ubo.setTexture("metallicReflectanceSampler", this._metallicReflectanceTexture);
                    }
                    if (this._reflectanceTexture && defines.REFLECTANCE) {
                        ubo.setTexture("reflectanceSampler", this._reflectanceTexture);
                    }
                    if (this._microSurfaceTexture) {
                        ubo.setTexture("microSurfaceSampler", this._microSurfaceTexture);
                    }
                }
                if (this._bumpTexture && engine.getCaps().standardDerivatives && _materialFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .MaterialFlags */ .h.BumpTextureEnabled && !this._disableBumpMap) {
                    ubo.setTexture("bumpSampler", this._bumpTexture);
                }
            }
            // OIT with depth peeling
            if (this.getScene().useOrderIndependentTransparency && this.needAlphaBlendingForMesh(mesh)) {
                this.getScene().depthPeelingRenderer.bind(effect);
            }
            this._eventInfo.subMesh = subMesh;
            this._callbackPluginEventBindForSubMesh(this._eventInfo);
            // Clip plane
            (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_25__/* .bindClipPlane */ .gS)(this._activeEffect, this, scene);
            this.bindEyePosition(effect);
        }
        else if (scene.getEngine()._features.needToAlwaysBindUniformBuffers) {
            this._needToBindSceneUbo = true;
        }
        if (mustRebind || !this.isFrozen) {
            // Lights
            if (scene.lightsEnabled && !this._disableLighting) {
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindLights */ .RL)(scene, mesh, this._activeEffect, defines, this._maxSimultaneousLights);
            }
            // View
            if ((scene.fogEnabled && mesh.applyFog && scene.fogMode !== _scene_js__WEBPACK_IMPORTED_MODULE_5__/* .Scene */ .Z.FOGMODE_NONE) ||
                reflectionTexture ||
                this.subSurface.refractionTexture ||
                mesh.receiveShadows ||
                defines.PREPASS) {
                this.bindView(effect);
            }
            // Fog
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindFogParameters */ .Yy)(scene, mesh, this._activeEffect, true);
            // Morph targets
            if (defines.NUM_MORPH_INFLUENCERS) {
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindMorphTargetParameters */ .nR)(mesh, this._activeEffect);
            }
            if (defines.BAKED_VERTEX_ANIMATION_TEXTURE) {
                mesh.bakedVertexAnimationManager?.bind(effect, defines.INSTANCES);
            }
            // image processing
            this._imageProcessingConfiguration.bind(this._activeEffect);
            // Log. depth
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_26__/* .BindLogDepth */ .DL)(defines, this._activeEffect, scene);
        }
        this._afterBind(mesh, this._activeEffect, subMesh);
        ubo.update();
    }
    /**
     * Returns the animatable textures.
     * If material have animatable metallic texture, then reflectivity texture will not be returned, even if it has animations.
     * @returns - Array of animatable textures.
     */
    getAnimatables() {
        const results = super.getAnimatables();
        if (this._albedoTexture && this._albedoTexture.animations && this._albedoTexture.animations.length > 0) {
            results.push(this._albedoTexture);
        }
        if (this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0) {
            results.push(this._ambientTexture);
        }
        if (this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0) {
            results.push(this._opacityTexture);
        }
        if (this._reflectionTexture && this._reflectionTexture.animations && this._reflectionTexture.animations.length > 0) {
            results.push(this._reflectionTexture);
        }
        if (this._emissiveTexture && this._emissiveTexture.animations && this._emissiveTexture.animations.length > 0) {
            results.push(this._emissiveTexture);
        }
        if (this._metallicTexture && this._metallicTexture.animations && this._metallicTexture.animations.length > 0) {
            results.push(this._metallicTexture);
        }
        else if (this._reflectivityTexture && this._reflectivityTexture.animations && this._reflectivityTexture.animations.length > 0) {
            results.push(this._reflectivityTexture);
        }
        if (this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0) {
            results.push(this._bumpTexture);
        }
        if (this._lightmapTexture && this._lightmapTexture.animations && this._lightmapTexture.animations.length > 0) {
            results.push(this._lightmapTexture);
        }
        if (this._metallicReflectanceTexture && this._metallicReflectanceTexture.animations && this._metallicReflectanceTexture.animations.length > 0) {
            results.push(this._metallicReflectanceTexture);
        }
        if (this._reflectanceTexture && this._reflectanceTexture.animations && this._reflectanceTexture.animations.length > 0) {
            results.push(this._reflectanceTexture);
        }
        if (this._microSurfaceTexture && this._microSurfaceTexture.animations && this._microSurfaceTexture.animations.length > 0) {
            results.push(this._microSurfaceTexture);
        }
        return results;
    }
    /**
     * Returns the texture used for reflections.
     * @returns - Reflection texture if present.  Otherwise, returns the environment texture.
     */
    _getReflectionTexture() {
        if (this._reflectionTexture) {
            return this._reflectionTexture;
        }
        return this.getScene().environmentTexture;
    }
    /**
     * Returns an array of the actively used textures.
     * @returns - Array of BaseTextures
     */
    getActiveTextures() {
        const activeTextures = super.getActiveTextures();
        if (this._albedoTexture) {
            activeTextures.push(this._albedoTexture);
        }
        if (this._ambientTexture) {
            activeTextures.push(this._ambientTexture);
        }
        if (this._opacityTexture) {
            activeTextures.push(this._opacityTexture);
        }
        if (this._reflectionTexture) {
            activeTextures.push(this._reflectionTexture);
        }
        if (this._emissiveTexture) {
            activeTextures.push(this._emissiveTexture);
        }
        if (this._reflectivityTexture) {
            activeTextures.push(this._reflectivityTexture);
        }
        if (this._metallicTexture) {
            activeTextures.push(this._metallicTexture);
        }
        if (this._metallicReflectanceTexture) {
            activeTextures.push(this._metallicReflectanceTexture);
        }
        if (this._reflectanceTexture) {
            activeTextures.push(this._reflectanceTexture);
        }
        if (this._microSurfaceTexture) {
            activeTextures.push(this._microSurfaceTexture);
        }
        if (this._bumpTexture) {
            activeTextures.push(this._bumpTexture);
        }
        if (this._lightmapTexture) {
            activeTextures.push(this._lightmapTexture);
        }
        return activeTextures;
    }
    /**
     * Checks to see if a texture is used in the material.
     * @param texture - Base texture to use.
     * @returns - Boolean specifying if a texture is used in the material.
     */
    hasTexture(texture) {
        if (super.hasTexture(texture)) {
            return true;
        }
        if (this._albedoTexture === texture) {
            return true;
        }
        if (this._ambientTexture === texture) {
            return true;
        }
        if (this._opacityTexture === texture) {
            return true;
        }
        if (this._reflectionTexture === texture) {
            return true;
        }
        if (this._emissiveTexture === texture) {
            return true;
        }
        if (this._reflectivityTexture === texture) {
            return true;
        }
        if (this._metallicTexture === texture) {
            return true;
        }
        if (this._metallicReflectanceTexture === texture) {
            return true;
        }
        if (this._reflectanceTexture === texture) {
            return true;
        }
        if (this._microSurfaceTexture === texture) {
            return true;
        }
        if (this._bumpTexture === texture) {
            return true;
        }
        if (this._lightmapTexture === texture) {
            return true;
        }
        return false;
    }
    /**
     * Sets the required values to the prepass renderer.
     * It can't be sets when subsurface scattering of this material is disabled.
     * When scene have ability to enable subsurface prepass effect, it will enable.
     * @returns - If prepass is enabled or not.
     */
    setPrePassRenderer() {
        if (!this.subSurface?.isScatteringEnabled) {
            return false;
        }
        const subSurfaceConfiguration = this.getScene().enableSubSurfaceForPrePass();
        if (subSurfaceConfiguration) {
            subSurfaceConfiguration.enabled = true;
        }
        return true;
    }
    /**
     * Disposes the resources of the material.
     * @param forceDisposeEffect - Forces the disposal of effects.
     * @param forceDisposeTextures - Forces the disposal of all textures.
     */
    dispose(forceDisposeEffect, forceDisposeTextures) {
        this._breakShaderLoadedCheck = true;
        if (forceDisposeTextures) {
            if (this._environmentBRDFTexture && this.getScene().environmentBRDFTexture !== this._environmentBRDFTexture) {
                this._environmentBRDFTexture.dispose();
            }
            this._albedoTexture?.dispose();
            this._ambientTexture?.dispose();
            this._opacityTexture?.dispose();
            this._reflectionTexture?.dispose();
            this._emissiveTexture?.dispose();
            this._metallicTexture?.dispose();
            this._reflectivityTexture?.dispose();
            this._bumpTexture?.dispose();
            this._lightmapTexture?.dispose();
            this._metallicReflectanceTexture?.dispose();
            this._reflectanceTexture?.dispose();
            this._microSurfaceTexture?.dispose();
        }
        this._renderTargets.dispose();
        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
        }
        super.dispose(forceDisposeEffect, forceDisposeTextures);
    }
}
/**
 * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use.
 */
PBRBaseMaterial.PBRMATERIAL_OPAQUE = _Materials_material_js__WEBPACK_IMPORTED_MODULE_12__/* .Material */ .i.MATERIAL_OPAQUE;
/**
 * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.
 */
PBRBaseMaterial.PBRMATERIAL_ALPHATEST = _Materials_material_js__WEBPACK_IMPORTED_MODULE_12__/* .Material */ .i.MATERIAL_ALPHATEST;
/**
 * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
 */
PBRBaseMaterial.PBRMATERIAL_ALPHABLEND = _Materials_material_js__WEBPACK_IMPORTED_MODULE_12__/* .Material */ .i.MATERIAL_ALPHABLEND;
/**
 * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
 * They are also discarded below the alpha cutoff threshold to improve performances.
 */
PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND = _Materials_material_js__WEBPACK_IMPORTED_MODULE_12__/* .Material */ .i.MATERIAL_ALPHATESTANDBLEND;
/**
 * Defines the default value of how much AO map is occluding the analytical lights
 * (point spot...).
 */
PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 0;
/**
 * PBRMaterialLightFalloff Physical: light is falling off following the inverse squared distance law.
 */
PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL = 0;
/**
 * PBRMaterialLightFalloff gltf: light is falling off as described in the gltf moving to PBR document
 * to enhance interoperability with other engines.
 */
PBRBaseMaterial.LIGHTFALLOFF_GLTF = 1;
/**
 * PBRMaterialLightFalloff Standard: light is falling off like in the standard material
 * to enhance interoperability with other materials.
 */
PBRBaseMaterial.LIGHTFALLOFF_STANDARD = 2;
/**
 * Force all the PBR materials to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
PBRBaseMaterial.ForceGLSL = false;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsImageProcessingConfiguration */ .n1)()
], PBRBaseMaterial.prototype, "_imageProcessingConfiguration", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsMiscDirty")
], PBRBaseMaterial.prototype, "debugMode", void 0);
//# sourceMappingURL=pbrBaseMaterial.js.map

/***/ }),

/***/ 83670:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   a: () => (/* binding */ MaterialClearCoatDefines),
/* harmony export */   t: () => (/* binding */ PBRClearCoatConfiguration)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26041);
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10633);
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50074);
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79526);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80467);








/**
 * @internal
 */
class MaterialClearCoatDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialDefines */ .M {
    constructor() {
        super(...arguments);
        this.CLEARCOAT = false;
        this.CLEARCOAT_DEFAULTIOR = false;
        this.CLEARCOAT_TEXTURE = false;
        this.CLEARCOAT_TEXTURE_ROUGHNESS = false;
        this.CLEARCOAT_TEXTUREDIRECTUV = 0;
        this.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV = 0;
        this.CLEARCOAT_BUMP = false;
        this.CLEARCOAT_BUMPDIRECTUV = 0;
        this.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = false;
        this.CLEARCOAT_REMAP_F0 = false;
        this.CLEARCOAT_TINT = false;
        this.CLEARCOAT_TINT_TEXTURE = false;
        this.CLEARCOAT_TINT_TEXTUREDIRECTUV = 0;
        this.CLEARCOAT_TINT_GAMMATEXTURE = false;
    }
}
/**
 * Plugin that implements the clear coat component of the PBR material
 */
class PBRClearCoatConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialPluginBase */ .y {
    /** @internal */
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    constructor(material, addToPluginList = true) {
        super(material, "PBRClearCoat", 100, new MaterialClearCoatDefines(), addToPluginList);
        this._isEnabled = false;
        /**
         * Defines if the clear coat is enabled in the material.
         */
        this.isEnabled = false;
        /**
         * Defines the clear coat layer strength (between 0 and 1) it defaults to 1.
         */
        this.intensity = 1;
        /**
         * Defines the clear coat layer roughness.
         */
        this.roughness = 0;
        this._indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;
        /**
         * Defines the index of refraction of the clear coat.
         * This defaults to 1.5 corresponding to a 0.04 f0 or a 4% reflectance at normal incidence
         * The default fits with a polyurethane material.
         * Changing the default value is more performance intensive.
         */
        this.indexOfRefraction = PBRClearCoatConfiguration._DefaultIndexOfRefraction;
        this._texture = null;
        /**
         * Stores the clear coat values in a texture (red channel is intensity and green channel is roughness)
         * If useRoughnessFromMainTexture is false, the green channel of texture is not used and the green channel of textureRoughness is used instead
         * if textureRoughness is not empty, else no texture roughness is used
         */
        this.texture = null;
        this._useRoughnessFromMainTexture = true;
        /**
         * Indicates that the green channel of the texture property will be used for roughness (default: true)
         * If false, the green channel from textureRoughness is used for roughness
         */
        this.useRoughnessFromMainTexture = true;
        this._textureRoughness = null;
        /**
         * Stores the clear coat roughness in a texture (green channel)
         * Not used if useRoughnessFromMainTexture is true
         */
        this.textureRoughness = null;
        this._remapF0OnInterfaceChange = true;
        /**
         * Defines if the F0 value should be remapped to account for the interface change in the material.
         */
        this.remapF0OnInterfaceChange = true;
        this._bumpTexture = null;
        /**
         * Define the clear coat specific bump texture.
         */
        this.bumpTexture = null;
        this._isTintEnabled = false;
        /**
         * Defines if the clear coat tint is enabled in the material.
         */
        this.isTintEnabled = false;
        /**
         * Defines the clear coat tint of the material.
         * This is only use if tint is enabled
         */
        this.tintColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color3 */ .v9.White();
        /**
         * Defines the distance at which the tint color should be found in the
         * clear coat media.
         * This is only use if tint is enabled
         */
        this.tintColorAtDistance = 1;
        /**
         * Defines the clear coat layer thickness.
         * This is only use if tint is enabled
         */
        this.tintThickness = 1;
        this._tintTexture = null;
        /**
         * Stores the clear tint values in a texture.
         * rgb is tint
         * a is a thickness factor
         */
        this.tintTexture = null;
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
    }
    isReadyForSubMesh(defines, scene, engine) {
        if (!this._isEnabled) {
            return true;
        }
        const disableBumpMap = this._material._disableBumpMap;
        if (defines._areTexturesDirty) {
            if (scene.texturesEnabled) {
                if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTextureEnabled) {
                    if (!this._texture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (this._textureRoughness && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTextureEnabled) {
                    if (!this._textureRoughness.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (engine.getCaps().standardDerivatives && this._bumpTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatBumpTextureEnabled && !disableBumpMap) {
                    // Bump texture cannot be not blocking.
                    if (!this._bumpTexture.isReady()) {
                        return false;
                    }
                }
                if (this._isTintEnabled && this._tintTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTintTextureEnabled) {
                    if (!this._tintTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
    prepareDefinesBeforeAttributes(defines, scene) {
        if (this._isEnabled) {
            defines.CLEARCOAT = true;
            defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture;
            defines.CLEARCOAT_REMAP_F0 = this._remapF0OnInterfaceChange;
            if (defines._areTexturesDirty) {
                if (scene.texturesEnabled) {
                    if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .PrepareDefinesForMergedUV */ .YT)(this._texture, defines, "CLEARCOAT_TEXTURE");
                    }
                    else {
                        defines.CLEARCOAT_TEXTURE = false;
                    }
                    if (this._textureRoughness && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .PrepareDefinesForMergedUV */ .YT)(this._textureRoughness, defines, "CLEARCOAT_TEXTURE_ROUGHNESS");
                    }
                    else {
                        defines.CLEARCOAT_TEXTURE_ROUGHNESS = false;
                    }
                    if (this._bumpTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatBumpTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .PrepareDefinesForMergedUV */ .YT)(this._bumpTexture, defines, "CLEARCOAT_BUMP");
                    }
                    else {
                        defines.CLEARCOAT_BUMP = false;
                    }
                    defines.CLEARCOAT_DEFAULTIOR = this._indexOfRefraction === PBRClearCoatConfiguration._DefaultIndexOfRefraction;
                    if (this._isTintEnabled) {
                        defines.CLEARCOAT_TINT = true;
                        if (this._tintTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTintTextureEnabled) {
                            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .PrepareDefinesForMergedUV */ .YT)(this._tintTexture, defines, "CLEARCOAT_TINT_TEXTURE");
                            defines.CLEARCOAT_TINT_GAMMATEXTURE = this._tintTexture.gammaSpace;
                        }
                        else {
                            defines.CLEARCOAT_TINT_TEXTURE = false;
                        }
                    }
                    else {
                        defines.CLEARCOAT_TINT = false;
                        defines.CLEARCOAT_TINT_TEXTURE = false;
                    }
                }
            }
        }
        else {
            defines.CLEARCOAT = false;
            defines.CLEARCOAT_TEXTURE = false;
            defines.CLEARCOAT_TEXTURE_ROUGHNESS = false;
            defines.CLEARCOAT_BUMP = false;
            defines.CLEARCOAT_TINT = false;
            defines.CLEARCOAT_TINT_TEXTURE = false;
            defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = false;
            defines.CLEARCOAT_DEFAULTIOR = false;
            defines.CLEARCOAT_TEXTUREDIRECTUV = 0;
            defines.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV = 0;
            defines.CLEARCOAT_BUMPDIRECTUV = 0;
            defines.CLEARCOAT_REMAP_F0 = false;
            defines.CLEARCOAT_TINT_TEXTUREDIRECTUV = 0;
            defines.CLEARCOAT_TINT_GAMMATEXTURE = false;
        }
    }
    bindForSubMesh(uniformBuffer, scene, engine, subMesh) {
        if (!this._isEnabled) {
            return;
        }
        const defines = subMesh.materialDefines;
        const isFrozen = this._material.isFrozen;
        const disableBumpMap = this._material._disableBumpMap;
        const invertNormalMapX = this._material._invertNormalMapX;
        const invertNormalMapY = this._material._invertNormalMapY;
        if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {
            if ((this._texture || this._textureRoughness) && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTextureEnabled) {
                uniformBuffer.updateFloat4("vClearCoatInfos", this._texture?.coordinatesIndex ?? 0, this._texture?.level ?? 0, this._textureRoughness?.coordinatesIndex ?? 0, this._textureRoughness?.level ?? 0);
                if (this._texture) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .BindTextureMatrix */ .mA)(this._texture, uniformBuffer, "clearCoat");
                }
                if (this._textureRoughness && !defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .BindTextureMatrix */ .mA)(this._textureRoughness, uniformBuffer, "clearCoatRoughness");
                }
            }
            if (this._bumpTexture && engine.getCaps().standardDerivatives && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTextureEnabled && !disableBumpMap) {
                uniformBuffer.updateFloat2("vClearCoatBumpInfos", this._bumpTexture.coordinatesIndex, this._bumpTexture.level);
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .BindTextureMatrix */ .mA)(this._bumpTexture, uniformBuffer, "clearCoatBump");
                if (scene._mirroredCameraPosition) {
                    uniformBuffer.updateFloat2("vClearCoatTangentSpaceParams", invertNormalMapX ? 1.0 : -1.0, invertNormalMapY ? 1.0 : -1.0);
                }
                else {
                    uniformBuffer.updateFloat2("vClearCoatTangentSpaceParams", invertNormalMapX ? -1.0 : 1.0, invertNormalMapY ? -1.0 : 1.0);
                }
            }
            if (this._tintTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTintTextureEnabled) {
                uniformBuffer.updateFloat2("vClearCoatTintInfos", this._tintTexture.coordinatesIndex, this._tintTexture.level);
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .BindTextureMatrix */ .mA)(this._tintTexture, uniformBuffer, "clearCoatTint");
            }
            // Clear Coat General params
            uniformBuffer.updateFloat2("vClearCoatParams", this.intensity, this.roughness);
            // Clear Coat Refraction params
            const a = 1 - this._indexOfRefraction;
            const b = 1 + this._indexOfRefraction;
            const f0 = Math.pow(-a / b, 2); // Schlicks approx: (ior1 - ior2) / (ior1 + ior2) where ior2 for air is close to vacuum = 1.
            const eta = 1 / this._indexOfRefraction;
            uniformBuffer.updateFloat4("vClearCoatRefractionParams", f0, eta, a, b);
            if (this._isTintEnabled) {
                uniformBuffer.updateFloat4("vClearCoatTintParams", this.tintColor.r, this.tintColor.g, this.tintColor.b, Math.max(0.00001, this.tintThickness));
                uniformBuffer.updateFloat("clearCoatColorAtDistance", Math.max(0.00001, this.tintColorAtDistance));
            }
        }
        // Textures
        if (scene.texturesEnabled) {
            if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTextureEnabled) {
                uniformBuffer.setTexture("clearCoatSampler", this._texture);
            }
            if (this._textureRoughness && !defines.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTextureEnabled) {
                uniformBuffer.setTexture("clearCoatRoughnessSampler", this._textureRoughness);
            }
            if (this._bumpTexture && engine.getCaps().standardDerivatives && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatBumpTextureEnabled && !disableBumpMap) {
                uniformBuffer.setTexture("clearCoatBumpSampler", this._bumpTexture);
            }
            if (this._isTintEnabled && this._tintTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ClearCoatTintTextureEnabled) {
                uniformBuffer.setTexture("clearCoatTintSampler", this._tintTexture);
            }
        }
    }
    hasTexture(texture) {
        if (this._texture === texture) {
            return true;
        }
        if (this._textureRoughness === texture) {
            return true;
        }
        if (this._bumpTexture === texture) {
            return true;
        }
        if (this._tintTexture === texture) {
            return true;
        }
        return false;
    }
    getActiveTextures(activeTextures) {
        if (this._texture) {
            activeTextures.push(this._texture);
        }
        if (this._textureRoughness) {
            activeTextures.push(this._textureRoughness);
        }
        if (this._bumpTexture) {
            activeTextures.push(this._bumpTexture);
        }
        if (this._tintTexture) {
            activeTextures.push(this._tintTexture);
        }
    }
    getAnimatables(animatables) {
        if (this._texture && this._texture.animations && this._texture.animations.length > 0) {
            animatables.push(this._texture);
        }
        if (this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0) {
            animatables.push(this._textureRoughness);
        }
        if (this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0) {
            animatables.push(this._bumpTexture);
        }
        if (this._tintTexture && this._tintTexture.animations && this._tintTexture.animations.length > 0) {
            animatables.push(this._tintTexture);
        }
    }
    dispose(forceDisposeTextures) {
        if (forceDisposeTextures) {
            this._texture?.dispose();
            this._textureRoughness?.dispose();
            this._bumpTexture?.dispose();
            this._tintTexture?.dispose();
        }
    }
    getClassName() {
        return "PBRClearCoatConfiguration";
    }
    addFallbacks(defines, fallbacks, currentRank) {
        if (defines.CLEARCOAT_BUMP) {
            fallbacks.addFallback(currentRank++, "CLEARCOAT_BUMP");
        }
        if (defines.CLEARCOAT_TINT) {
            fallbacks.addFallback(currentRank++, "CLEARCOAT_TINT");
        }
        if (defines.CLEARCOAT) {
            fallbacks.addFallback(currentRank++, "CLEARCOAT");
        }
        return currentRank;
    }
    getSamplers(samplers) {
        samplers.push("clearCoatSampler", "clearCoatRoughnessSampler", "clearCoatBumpSampler", "clearCoatTintSampler");
    }
    getUniforms() {
        return {
            ubo: [
                { name: "vClearCoatParams", size: 2, type: "vec2" },
                { name: "vClearCoatRefractionParams", size: 4, type: "vec4" },
                { name: "vClearCoatInfos", size: 4, type: "vec4" },
                { name: "clearCoatMatrix", size: 16, type: "mat4" },
                { name: "clearCoatRoughnessMatrix", size: 16, type: "mat4" },
                { name: "vClearCoatBumpInfos", size: 2, type: "vec2" },
                { name: "vClearCoatTangentSpaceParams", size: 2, type: "vec2" },
                { name: "clearCoatBumpMatrix", size: 16, type: "mat4" },
                { name: "vClearCoatTintParams", size: 4, type: "vec4" },
                { name: "clearCoatColorAtDistance", size: 1, type: "float" },
                { name: "vClearCoatTintInfos", size: 2, type: "vec2" },
                { name: "clearCoatTintMatrix", size: 16, type: "mat4" },
            ],
        };
    }
}
/**
 * This defaults to 1.5 corresponding to a 0.04 f0 or a 4% reflectance at normal incidence
 * The default fits with a polyurethane material.
 * @internal
 */
PBRClearCoatConfiguration._DefaultIndexOfRefraction = 1.5;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRClearCoatConfiguration.prototype, "isEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRClearCoatConfiguration.prototype, "intensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRClearCoatConfiguration.prototype, "roughness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRClearCoatConfiguration.prototype, "indexOfRefraction", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRClearCoatConfiguration.prototype, "texture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRClearCoatConfiguration.prototype, "useRoughnessFromMainTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRClearCoatConfiguration.prototype, "textureRoughness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRClearCoatConfiguration.prototype, "remapF0OnInterfaceChange", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRClearCoatConfiguration.prototype, "bumpTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRClearCoatConfiguration.prototype, "isTintEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)()
], PBRClearCoatConfiguration.prototype, "tintColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRClearCoatConfiguration.prototype, "tintColorAtDistance", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRClearCoatConfiguration.prototype, "tintThickness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRClearCoatConfiguration.prototype, "tintTexture", void 0);
//# sourceMappingURL=pbrClearCoatConfiguration.js.map

/***/ }),

/***/ 89696:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   m: () => (/* binding */ MaterialIridescenceDefines),
/* harmony export */   z: () => (/* binding */ PBRIridescenceConfiguration)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10633);
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(50074);
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79526);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80467);







/**
 * @internal
 */
class MaterialIridescenceDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialDefines */ .M {
    constructor() {
        super(...arguments);
        this.IRIDESCENCE = false;
        this.IRIDESCENCE_TEXTURE = false;
        this.IRIDESCENCE_TEXTUREDIRECTUV = 0;
        this.IRIDESCENCE_THICKNESS_TEXTURE = false;
        this.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV = 0;
    }
}
/**
 * Plugin that implements the iridescence (thin film) component of the PBR material
 */
class PBRIridescenceConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialPluginBase */ .y {
    /** @internal */
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    constructor(material, addToPluginList = true) {
        super(material, "PBRIridescence", 110, new MaterialIridescenceDefines(), addToPluginList);
        this._isEnabled = false;
        /**
         * Defines if the iridescence is enabled in the material.
         */
        this.isEnabled = false;
        /**
         * Defines the iridescence layer strength (between 0 and 1) it defaults to 1.
         */
        this.intensity = 1;
        /**
         * Defines the minimum thickness of the thin-film layer given in nanometers (nm).
         */
        this.minimumThickness = PBRIridescenceConfiguration._DefaultMinimumThickness;
        /**
         * Defines the maximum thickness of the thin-film layer given in nanometers (nm). This will be the thickness used if not thickness texture has been set.
         */
        this.maximumThickness = PBRIridescenceConfiguration._DefaultMaximumThickness;
        /**
         * Defines the maximum thickness of the thin-film layer given in nanometers (nm).
         */
        this.indexOfRefraction = PBRIridescenceConfiguration._DefaultIndexOfRefraction;
        this._texture = null;
        /**
         * Stores the iridescence intensity in a texture (red channel)
         */
        this.texture = null;
        this._thicknessTexture = null;
        /**
         * Stores the iridescence thickness in a texture (green channel)
         */
        this.thicknessTexture = null;
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
    }
    isReadyForSubMesh(defines, scene) {
        if (!this._isEnabled) {
            return true;
        }
        if (defines._areTexturesDirty) {
            if (scene.texturesEnabled) {
                if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags */ .h.IridescenceTextureEnabled) {
                    if (!this._texture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags */ .h.IridescenceTextureEnabled) {
                    if (!this._thicknessTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
    prepareDefinesBeforeAttributes(defines, scene) {
        if (this._isEnabled) {
            defines.IRIDESCENCE = true;
            if (defines._areTexturesDirty) {
                if (scene.texturesEnabled) {
                    if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags */ .h.IridescenceTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_5__/* .PrepareDefinesForMergedUV */ .YT)(this._texture, defines, "IRIDESCENCE_TEXTURE");
                    }
                    else {
                        defines.IRIDESCENCE_TEXTURE = false;
                    }
                    if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags */ .h.IridescenceTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_5__/* .PrepareDefinesForMergedUV */ .YT)(this._thicknessTexture, defines, "IRIDESCENCE_THICKNESS_TEXTURE");
                    }
                    else {
                        defines.IRIDESCENCE_THICKNESS_TEXTURE = false;
                    }
                }
            }
        }
        else {
            defines.IRIDESCENCE = false;
            defines.IRIDESCENCE_TEXTURE = false;
            defines.IRIDESCENCE_THICKNESS_TEXTURE = false;
            defines.IRIDESCENCE_TEXTUREDIRECTUV = 0;
            defines.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV = 0;
        }
    }
    bindForSubMesh(uniformBuffer, scene) {
        if (!this._isEnabled) {
            return;
        }
        const isFrozen = this._material.isFrozen;
        if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {
            if ((this._texture || this._thicknessTexture) && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags */ .h.IridescenceTextureEnabled) {
                uniformBuffer.updateFloat4("vIridescenceInfos", this._texture?.coordinatesIndex ?? 0, this._texture?.level ?? 0, this._thicknessTexture?.coordinatesIndex ?? 0, this._thicknessTexture?.level ?? 0);
                if (this._texture) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_5__/* .BindTextureMatrix */ .mA)(this._texture, uniformBuffer, "iridescence");
                }
                if (this._thicknessTexture) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_5__/* .BindTextureMatrix */ .mA)(this._thicknessTexture, uniformBuffer, "iridescenceThickness");
                }
            }
            // Clear Coat General params
            uniformBuffer.updateFloat4("vIridescenceParams", this.intensity, this.indexOfRefraction, this.minimumThickness, this.maximumThickness);
        }
        // Textures
        if (scene.texturesEnabled) {
            if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags */ .h.IridescenceTextureEnabled) {
                uniformBuffer.setTexture("iridescenceSampler", this._texture);
            }
            if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialFlags */ .h.IridescenceTextureEnabled) {
                uniformBuffer.setTexture("iridescenceThicknessSampler", this._thicknessTexture);
            }
        }
    }
    hasTexture(texture) {
        if (this._texture === texture) {
            return true;
        }
        if (this._thicknessTexture === texture) {
            return true;
        }
        return false;
    }
    getActiveTextures(activeTextures) {
        if (this._texture) {
            activeTextures.push(this._texture);
        }
        if (this._thicknessTexture) {
            activeTextures.push(this._thicknessTexture);
        }
    }
    getAnimatables(animatables) {
        if (this._texture && this._texture.animations && this._texture.animations.length > 0) {
            animatables.push(this._texture);
        }
        if (this._thicknessTexture && this._thicknessTexture.animations && this._thicknessTexture.animations.length > 0) {
            animatables.push(this._thicknessTexture);
        }
    }
    dispose(forceDisposeTextures) {
        if (forceDisposeTextures) {
            this._texture?.dispose();
            this._thicknessTexture?.dispose();
        }
    }
    getClassName() {
        return "PBRIridescenceConfiguration";
    }
    addFallbacks(defines, fallbacks, currentRank) {
        if (defines.IRIDESCENCE) {
            fallbacks.addFallback(currentRank++, "IRIDESCENCE");
        }
        return currentRank;
    }
    getSamplers(samplers) {
        samplers.push("iridescenceSampler", "iridescenceThicknessSampler");
    }
    getUniforms() {
        return {
            ubo: [
                { name: "vIridescenceParams", size: 4, type: "vec4" },
                { name: "vIridescenceInfos", size: 4, type: "vec4" },
                { name: "iridescenceMatrix", size: 16, type: "mat4" },
                { name: "iridescenceThicknessMatrix", size: 16, type: "mat4" },
            ],
        };
    }
}
/**
 * The default minimum thickness of the thin-film layer given in nanometers (nm).
 * Defaults to 100 nm.
 * @internal
 */
PBRIridescenceConfiguration._DefaultMinimumThickness = 100;
/**
 * The default maximum thickness of the thin-film layer given in nanometers (nm).
 * Defaults to 400 nm.
 * @internal
 */
PBRIridescenceConfiguration._DefaultMaximumThickness = 400;
/**
 * The default index of refraction of the thin-film layer.
 * Defaults to 1.3
 * @internal
 */
PBRIridescenceConfiguration._DefaultIndexOfRefraction = 1.3;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRIridescenceConfiguration.prototype, "isEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRIridescenceConfiguration.prototype, "intensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRIridescenceConfiguration.prototype, "minimumThickness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRIridescenceConfiguration.prototype, "maximumThickness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRIridescenceConfiguration.prototype, "indexOfRefraction", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRIridescenceConfiguration.prototype, "texture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRIridescenceConfiguration.prototype, "thicknessTexture", void 0);
//# sourceMappingURL=pbrIridescenceConfiguration.js.map

/***/ }),

/***/ 23975:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Y: () => (/* binding */ PBRMaterial)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_brdfTextureTools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4109);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26041);
/* harmony import */ var _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1018);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(56552);
/* harmony import */ var _material_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28986);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(26877);








/**
 * The Physically based material of BJS.
 *
 * This offers the main features of a standard PBR material.
 * For more information, please refer to the documentation :
 * https://doc.babylonjs.com/features/featuresDeepDive/materials/using/introToPBR
 */
class PBRMaterial extends _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d {
    /**
     * Stores the refracted light information in a texture.
     */
    get refractionTexture() {
        return this.subSurface.refractionTexture;
    }
    set refractionTexture(value) {
        this.subSurface.refractionTexture = value;
        if (value) {
            this.subSurface.isRefractionEnabled = true;
        }
        else if (!this.subSurface.linkRefractionWithTransparency) {
            this.subSurface.isRefractionEnabled = false;
        }
    }
    /**
     * Index of refraction of the material base layer.
     * https://en.wikipedia.org/wiki/List_of_refractive_indices
     *
     * This does not only impact refraction but also the Base F0 of Dielectric Materials.
     *
     * From dielectric fresnel rules: F0 = square((iorT - iorI) / (iorT + iorI))
     */
    get indexOfRefraction() {
        return this.subSurface.indexOfRefraction;
    }
    set indexOfRefraction(value) {
        this.subSurface.indexOfRefraction = value;
    }
    /**
     * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
     */
    get invertRefractionY() {
        return this.subSurface.invertRefractionY;
    }
    set invertRefractionY(value) {
        this.subSurface.invertRefractionY = value;
    }
    /**
     * This parameters will make the material used its opacity to control how much it is refracting against not.
     * Materials half opaque for instance using refraction could benefit from this control.
     */
    get linkRefractionWithTransparency() {
        return this.subSurface.linkRefractionWithTransparency;
    }
    set linkRefractionWithTransparency(value) {
        this.subSurface.linkRefractionWithTransparency = value;
        if (value) {
            this.subSurface.isRefractionEnabled = true;
        }
    }
    /**
     * BJS is using an hardcoded light falloff based on a manually sets up range.
     * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.
     * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.
     */
    get usePhysicalLightFalloff() {
        return this._lightFalloff === _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.LIGHTFALLOFF_PHYSICAL;
    }
    /**
     * BJS is using an hardcoded light falloff based on a manually sets up range.
     * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.
     * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.
     */
    set usePhysicalLightFalloff(value) {
        if (value !== this.usePhysicalLightFalloff) {
            // Ensure the effect will be rebuilt.
            this._markAllSubMeshesAsTexturesDirty();
            if (value) {
                this._lightFalloff = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.LIGHTFALLOFF_PHYSICAL;
            }
            else {
                this._lightFalloff = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.LIGHTFALLOFF_STANDARD;
            }
        }
    }
    /**
     * In order to support the falloff compatibility with gltf, a special mode has been added
     * to reproduce the gltf light falloff.
     */
    get useGLTFLightFalloff() {
        return this._lightFalloff === _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.LIGHTFALLOFF_GLTF;
    }
    /**
     * In order to support the falloff compatibility with gltf, a special mode has been added
     * to reproduce the gltf light falloff.
     */
    set useGLTFLightFalloff(value) {
        if (value !== this.useGLTFLightFalloff) {
            // Ensure the effect will be rebuilt.
            this._markAllSubMeshesAsTexturesDirty();
            if (value) {
                this._lightFalloff = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.LIGHTFALLOFF_GLTF;
            }
            else {
                this._lightFalloff = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.LIGHTFALLOFF_STANDARD;
            }
        }
    }
    /**
     * Gets the image processing configuration used either in this material.
     */
    get imageProcessingConfiguration() {
        return this._imageProcessingConfiguration;
    }
    /**
     * Sets the Default image processing configuration used either in the this material.
     *
     * If sets to null, the scene one is in use.
     */
    set imageProcessingConfiguration(value) {
        this._attachImageProcessingConfiguration(value);
        // Ensure the effect will be rebuilt.
        this._markAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets whether the color curves effect is enabled.
     */
    get cameraColorCurvesEnabled() {
        return this.imageProcessingConfiguration.colorCurvesEnabled;
    }
    /**
     * Sets whether the color curves effect is enabled.
     */
    set cameraColorCurvesEnabled(value) {
        this.imageProcessingConfiguration.colorCurvesEnabled = value;
    }
    /**
     * Gets whether the color grading effect is enabled.
     */
    get cameraColorGradingEnabled() {
        return this.imageProcessingConfiguration.colorGradingEnabled;
    }
    /**
     * Gets whether the color grading effect is enabled.
     */
    set cameraColorGradingEnabled(value) {
        this.imageProcessingConfiguration.colorGradingEnabled = value;
    }
    /**
     * Gets whether tonemapping is enabled or not.
     */
    get cameraToneMappingEnabled() {
        return this._imageProcessingConfiguration.toneMappingEnabled;
    }
    /**
     * Sets whether tonemapping is enabled or not
     */
    set cameraToneMappingEnabled(value) {
        this._imageProcessingConfiguration.toneMappingEnabled = value;
    }
    /**
     * The camera exposure used on this material.
     * This property is here and not in the camera to allow controlling exposure without full screen post process.
     * This corresponds to a photographic exposure.
     */
    get cameraExposure() {
        return this._imageProcessingConfiguration.exposure;
    }
    /**
     * The camera exposure used on this material.
     * This property is here and not in the camera to allow controlling exposure without full screen post process.
     * This corresponds to a photographic exposure.
     */
    set cameraExposure(value) {
        this._imageProcessingConfiguration.exposure = value;
    }
    /**
     * Gets The camera contrast used on this material.
     */
    get cameraContrast() {
        return this._imageProcessingConfiguration.contrast;
    }
    /**
     * Sets The camera contrast used on this material.
     */
    set cameraContrast(value) {
        this._imageProcessingConfiguration.contrast = value;
    }
    /**
     * Gets the Color Grading 2D Lookup Texture.
     */
    get cameraColorGradingTexture() {
        return this._imageProcessingConfiguration.colorGradingTexture;
    }
    /**
     * Sets the Color Grading 2D Lookup Texture.
     */
    set cameraColorGradingTexture(value) {
        this._imageProcessingConfiguration.colorGradingTexture = value;
    }
    /**
     * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
     * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
     * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
     * corresponding to low luminance, medium luminance, and high luminance areas respectively.
     */
    get cameraColorCurves() {
        return this._imageProcessingConfiguration.colorCurves;
    }
    /**
     * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
     * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
     * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
     * corresponding to low luminance, medium luminance, and high luminance areas respectively.
     */
    set cameraColorCurves(value) {
        this._imageProcessingConfiguration.colorCurves = value;
    }
    /**
     * Instantiates a new PBRMaterial instance.
     *
     * @param name The material name
     * @param scene The scene the material will be use in.
     * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
     */
    constructor(name, scene, forceGLSL = false) {
        super(name, scene, forceGLSL);
        /**
         * Intensity of the direct lights e.g. the four lights available in your scene.
         * This impacts both the direct diffuse and specular highlights.
         */
        this.directIntensity = 1.0;
        /**
         * Intensity of the emissive part of the material.
         * This helps controlling the emissive effect without modifying the emissive color.
         */
        this.emissiveIntensity = 1.0;
        /**
         * Intensity of the environment e.g. how much the environment will light the object
         * either through harmonics for rough material or through the reflection for shiny ones.
         */
        this.environmentIntensity = 1.0;
        /**
         * This is a special control allowing the reduction of the specular highlights coming from the
         * four lights of the scene. Those highlights may not be needed in full environment lighting.
         */
        this.specularIntensity = 1.0;
        /**
         * Debug Control allowing disabling the bump map on this material.
         */
        this.disableBumpMap = false;
        /**
         * AKA Occlusion Texture Intensity in other nomenclature.
         */
        this.ambientTextureStrength = 1.0;
        /**
         * Defines how much the AO map is occluding the analytical lights (point spot...).
         * 1 means it completely occludes it
         * 0 mean it has no impact
         */
        this.ambientTextureImpactOnAnalyticalLights = PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;
        /**
         * In metallic workflow, specifies an F0 factor to help configuring the material F0.
         * By default the indexOfrefraction is used to compute F0;
         *
         * This is used as a factor against the default reflectance at normal incidence to tweak it.
         *
         * F0 = defaultF0 * metallicF0Factor * metallicReflectanceColor;
         * F90 = metallicReflectanceColor;
         */
        this.metallicF0Factor = 1;
        /**
         * In metallic workflow, specifies an F0 color.
         * By default the F90 is always 1;
         *
         * Please note that this factor is also used as a factor against the default reflectance at normal incidence.
         *
         * F0 = defaultF0_from_IOR * metallicF0Factor * metallicReflectanceColor
         * F90 = metallicF0Factor;
         */
        this.metallicReflectanceColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .v9.White();
        /**
         * Specifies that only the A channel from metallicReflectanceTexture should be used.
         * If false, both RGB and A channels will be used
         */
        this.useOnlyMetallicFromMetallicReflectanceTexture = false;
        /**
         * The color of a material in ambient lighting.
         */
        this.ambientColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .v9(0, 0, 0);
        /**
         * AKA Diffuse Color in other nomenclature.
         */
        this.albedoColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .v9(1, 1, 1);
        /**
         * AKA Specular Color in other nomenclature.
         */
        this.reflectivityColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .v9(1, 1, 1);
        /**
         * The color reflected from the material.
         */
        this.reflectionColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .v9(1.0, 1.0, 1.0);
        /**
         * The color emitted from the material.
         */
        this.emissiveColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color3 */ .v9(0, 0, 0);
        /**
         * AKA Glossiness in other nomenclature.
         */
        this.microSurface = 1.0;
        /**
         * If true, the light map contains occlusion information instead of lighting info.
         */
        this.useLightmapAsShadowmap = false;
        /**
         * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.
         */
        this.useAlphaFromAlbedoTexture = false;
        /**
         * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations.
         */
        this.forceAlphaTest = false;
        /**
         * Defines the alpha limits in alpha test mode.
         */
        this.alphaCutOff = 0.4;
        /**
         * Specifies that the material will keep the specular highlights over a transparent surface (only the most luminous ones).
         * A car glass is a good example of that. When sun reflects on it you can not see what is behind.
         */
        this.useSpecularOverAlpha = true;
        /**
         * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.
         */
        this.useMicroSurfaceFromReflectivityMapAlpha = false;
        /**
         * Specifies if the metallic texture contains the roughness information in its alpha channel.
         */
        this.useRoughnessFromMetallicTextureAlpha = true;
        /**
         * Specifies if the metallic texture contains the roughness information in its green channel.
         * Needs useRoughnessFromMetallicTextureAlpha to be false.
         */
        this.useRoughnessFromMetallicTextureGreen = false;
        /**
         * Specifies if the metallic texture contains the metallness information in its blue channel.
         */
        this.useMetallnessFromMetallicTextureBlue = false;
        /**
         * Specifies if the metallic texture contains the ambient occlusion information in its red channel.
         */
        this.useAmbientOcclusionFromMetallicTextureRed = false;
        /**
         * Specifies if the ambient texture contains the ambient occlusion information in its red channel only.
         */
        this.useAmbientInGrayScale = false;
        /**
         * In case the reflectivity map does not contain the microsurface information in its alpha channel,
         * The material will try to infer what glossiness each pixel should be.
         */
        this.useAutoMicroSurfaceFromReflectivityMap = false;
        /**
         * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones).
         * A car glass is a good example of that. When the street lights reflects on it you can not see what is behind.
         */
        this.useRadianceOverAlpha = true;
        /**
         * Allows using an object space normal map (instead of tangent space).
         */
        this.useObjectSpaceNormalMap = false;
        /**
         * Allows using the bump map in parallax mode.
         */
        this.useParallax = false;
        /**
         * Allows using the bump map in parallax occlusion mode.
         */
        this.useParallaxOcclusion = false;
        /**
         * Controls the scale bias of the parallax mode.
         */
        this.parallaxScaleBias = 0.05;
        /**
         * If sets to true, disables all the lights affecting the material.
         */
        this.disableLighting = false;
        /**
         * Force the shader to compute irradiance in the fragment shader in order to take bump in account.
         */
        this.forceIrradianceInFragment = false;
        /**
         * Number of Simultaneous lights allowed on the material.
         */
        this.maxSimultaneousLights = 4;
        /**
         * If sets to true, x component of normal map value will invert (x = 1.0 - x).
         */
        this.invertNormalMapX = false;
        /**
         * If sets to true, y component of normal map value will invert (y = 1.0 - y).
         */
        this.invertNormalMapY = false;
        /**
         * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
         */
        this.twoSidedLighting = false;
        /**
         * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.
         * And/Or occlude the blended part. (alpha is converted to gamma to compute the fresnel)
         */
        this.useAlphaFresnel = false;
        /**
         * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.
         * And/Or occlude the blended part. (alpha stays linear to compute the fresnel)
         */
        this.useLinearAlphaFresnel = false;
        /**
         * Let user defines the brdf lookup texture used for IBL.
         * A default 8bit version is embedded but you could point at :
         * * Default texture: https://assets.babylonjs.com/environments/correlatedMSBRDF_RGBD.png
         * * Default 16bit pixel depth texture: https://assets.babylonjs.com/environments/correlatedMSBRDF.dds
         * * LEGACY Default None correlated https://assets.babylonjs.com/environments/uncorrelatedBRDF_RGBD.png
         * * LEGACY Default None correlated 16bit pixel depth https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds
         */
        this.environmentBRDFTexture = null;
        /**
         * Force normal to face away from face.
         */
        this.forceNormalForward = false;
        /**
         * Enables specular anti aliasing in the PBR shader.
         * It will both interacts on the Geometry for analytical and IBL lighting.
         * It also prefilter the roughness map based on the bump values.
         */
        this.enableSpecularAntiAliasing = false;
        /**
         * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal
         * makes the reflect vector face the model (under horizon).
         */
        this.useHorizonOcclusion = true;
        /**
         * This parameters will enable/disable radiance occlusion by preventing the radiance to lit
         * too much the area relying on ambient texture to define their ambient occlusion.
         */
        this.useRadianceOcclusion = true;
        /**
         * If set to true, no lighting calculations will be applied.
         */
        this.unlit = false;
        /**
         * If sets to true, the decal map will be applied after the detail map. Else, it is applied before (default: false)
         */
        this.applyDecalMapAfterDetailMap = false;
        this._environmentBRDFTexture = (0,_Misc_brdfTextureTools_js__WEBPACK_IMPORTED_MODULE_2__/* .GetEnvironmentBRDFTexture */ .X)(this.getScene());
    }
    /**
     * @returns the name of this material class.
     */
    getClassName() {
        return "PBRMaterial";
    }
    /**
     * Makes a duplicate of the current material.
     * @param name - name to use for the new material.
     * @param cloneTexturesOnlyOnce - if a texture is used in more than one channel (e.g diffuse and opacity), only clone it once and reuse it on the other channels. Default false.
     * @param rootUrl defines the root URL to use to load textures
     * @returns cloned material instance
     */
    clone(name, cloneTexturesOnlyOnce = true, rootUrl = "") {
        const clone = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_7__/* .SerializationHelper */ .p.Clone(() => new PBRMaterial(name, this.getScene()), this, { cloneTexturesOnlyOnce });
        clone.id = name;
        clone.name = name;
        this.stencil.copyTo(clone.stencil);
        this._clonePlugins(clone, rootUrl);
        return clone;
    }
    /**
     * Serializes this PBR Material.
     * @returns - An object with the serialized material.
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.customType = "BABYLON.PBRMaterial";
        return serializationObject;
    }
    // Statics
    /**
     * Parses a PBR Material from a serialized object.
     * @param source - Serialized object.
     * @param scene - BJS scene instance.
     * @param rootUrl - url for the scene object
     * @returns - PBRMaterial
     */
    static Parse(source, scene, rootUrl) {
        const material = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_7__/* .SerializationHelper */ .p.Parse(() => new PBRMaterial(source.name, scene), source, scene, rootUrl);
        if (source.stencil) {
            material.stencil.parse(source.stencil, scene, rootUrl);
        }
        _material_js__WEBPACK_IMPORTED_MODULE_6__/* .Material */ .i._ParsePlugins(source, material, scene, rootUrl);
        // The code block below ensures backward compatibility with serialized materials before plugins are automatically serialized.
        if (source.clearCoat) {
            material.clearCoat.parse(source.clearCoat, scene, rootUrl);
        }
        if (source.anisotropy) {
            material.anisotropy.parse(source.anisotropy, scene, rootUrl);
        }
        if (source.brdf) {
            material.brdf.parse(source.brdf, scene, rootUrl);
        }
        if (source.sheen) {
            material.sheen.parse(source.sheen, scene, rootUrl);
        }
        if (source.subSurface) {
            material.subSurface.parse(source.subSurface, scene, rootUrl);
        }
        if (source.iridescence) {
            material.iridescence.parse(source.iridescence, scene, rootUrl);
        }
        return material;
    }
}
/**
 * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use.
 */
PBRMaterial.PBRMATERIAL_OPAQUE = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.PBRMATERIAL_OPAQUE;
/**
 * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.
 */
PBRMaterial.PBRMATERIAL_ALPHATEST = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.PBRMATERIAL_ALPHATEST;
/**
 * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
 */
PBRMaterial.PBRMATERIAL_ALPHABLEND = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.PBRMATERIAL_ALPHABLEND;
/**
 * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
 * They are also discarded below the alpha cutoff threshold to improve performances.
 */
PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.PBRMATERIAL_ALPHATESTANDBLEND;
/**
 * Defines the default value of how much AO map is occluding the analytical lights
 * (point spot...).
 */
PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = _pbrBaseMaterial_js__WEBPACK_IMPORTED_MODULE_4__/* .PBRBaseMaterial */ .d.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "directIntensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "emissiveIntensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "environmentIntensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "specularIntensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "disableBumpMap", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "albedoTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "ambientTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "ambientTextureStrength", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "ambientTextureImpactOnAnalyticalLights", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesAndMiscDirty")
], PBRMaterial.prototype, "opacityTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "reflectionTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "emissiveTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "reflectivityTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "metallicTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "metallic", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "roughness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "metallicF0Factor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "metallicReflectanceColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useOnlyMetallicFromMetallicReflectanceTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "metallicReflectanceTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "reflectanceTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "microSurfaceTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "bumpTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty", null)
], PBRMaterial.prototype, "lightmapTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)("ambient"),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "ambientColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)("albedo"),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "albedoColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)("reflectivity"),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "reflectivityColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)("reflection"),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "reflectionColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)("emissive"),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "emissiveColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "microSurface", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useLightmapAsShadowmap", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesAndMiscDirty")
], PBRMaterial.prototype, "useAlphaFromAlbedoTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesAndMiscDirty")
], PBRMaterial.prototype, "forceAlphaTest", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesAndMiscDirty")
], PBRMaterial.prototype, "alphaCutOff", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useSpecularOverAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useMicroSurfaceFromReflectivityMapAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useRoughnessFromMetallicTextureAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useRoughnessFromMetallicTextureGreen", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useMetallnessFromMetallicTextureBlue", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useAmbientOcclusionFromMetallicTextureRed", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useAmbientInGrayScale", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useAutoMicroSurfaceFromReflectivityMap", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRMaterial.prototype, "usePhysicalLightFalloff", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRMaterial.prototype, "useGLTFLightFalloff", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useRadianceOverAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useObjectSpaceNormalMap", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useParallax", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useParallaxOcclusion", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "parallaxScaleBias", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsLightsDirty")
], PBRMaterial.prototype, "disableLighting", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "forceIrradianceInFragment", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsLightsDirty")
], PBRMaterial.prototype, "maxSimultaneousLights", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "invertNormalMapX", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "invertNormalMapY", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "twoSidedLighting", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useAlphaFresnel", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useLinearAlphaFresnel", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "environmentBRDFTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "forceNormalForward", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "enableSpecularAntiAliasing", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useHorizonOcclusion", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMaterial.prototype, "useRadianceOcclusion", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsMiscDirty")
], PBRMaterial.prototype, "unlit", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsMiscDirty")
], PBRMaterial.prototype, "applyDecalMapAfterDetailMap", void 0);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__/* .RegisterClass */ .Y5)("BABYLON.PBRMaterial", PBRMaterial);
//# sourceMappingURL=pbrMaterial.js.map

/***/ }),

/***/ 84307:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   C: () => (/* binding */ PBRSheenConfiguration),
/* harmony export */   Z: () => (/* binding */ MaterialSheenDefines)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26041);
/* harmony import */ var _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10633);
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50074);
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79526);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80467);

/* eslint-disable @typescript-eslint/naming-convention */







/**
 * @internal
 */
class MaterialSheenDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialDefines */ .M {
    constructor() {
        super(...arguments);
        this.SHEEN = false;
        this.SHEEN_TEXTURE = false;
        this.SHEEN_GAMMATEXTURE = false;
        this.SHEEN_TEXTURE_ROUGHNESS = false;
        this.SHEEN_TEXTUREDIRECTUV = 0;
        this.SHEEN_TEXTURE_ROUGHNESSDIRECTUV = 0;
        this.SHEEN_LINKWITHALBEDO = false;
        this.SHEEN_ROUGHNESS = false;
        this.SHEEN_ALBEDOSCALING = false;
        this.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = false;
    }
}
/**
 * Plugin that implements the sheen component of the PBR material.
 */
class PBRSheenConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialPluginBase */ .y {
    /** @internal */
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    constructor(material, addToPluginList = true) {
        super(material, "Sheen", 120, new MaterialSheenDefines(), addToPluginList);
        this._isEnabled = false;
        /**
         * Defines if the material uses sheen.
         */
        this.isEnabled = false;
        this._linkSheenWithAlbedo = false;
        /**
         * Defines if the sheen is linked to the sheen color.
         */
        this.linkSheenWithAlbedo = false;
        /**
         * Defines the sheen intensity.
         */
        this.intensity = 1;
        /**
         * Defines the sheen color.
         */
        this.color = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color3 */ .v9.White();
        this._texture = null;
        /**
         * Stores the sheen tint values in a texture.
         * rgb is tint
         * a is a intensity or roughness if the roughness property has been defined and useRoughnessFromTexture is true (in that case, textureRoughness won't be used)
         * If the roughness property has been defined and useRoughnessFromTexture is false then the alpha channel is not used to modulate roughness
         */
        this.texture = null;
        this._useRoughnessFromMainTexture = true;
        /**
         * Indicates that the alpha channel of the texture property will be used for roughness.
         * Has no effect if the roughness (and texture!) property is not defined
         */
        this.useRoughnessFromMainTexture = true;
        this._roughness = null;
        /**
         * Defines the sheen roughness.
         * It is not taken into account if linkSheenWithAlbedo is true.
         * To stay backward compatible, material roughness is used instead if sheen roughness = null
         */
        this.roughness = null;
        this._textureRoughness = null;
        /**
         * Stores the sheen roughness in a texture.
         * alpha channel is the roughness. This texture won't be used if the texture property is not empty and useRoughnessFromTexture is true
         */
        this.textureRoughness = null;
        this._albedoScaling = false;
        /**
         * If true, the sheen effect is layered above the base BRDF with the albedo-scaling technique.
         * It allows the strength of the sheen effect to not depend on the base color of the material,
         * making it easier to setup and tweak the effect
         */
        this.albedoScaling = false;
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
    }
    isReadyForSubMesh(defines, scene) {
        if (!this._isEnabled) {
            return true;
        }
        if (defines._areTexturesDirty) {
            if (scene.texturesEnabled) {
                if (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.SheenTextureEnabled) {
                    if (!this._texture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (this._textureRoughness && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.SheenTextureEnabled) {
                    if (!this._textureRoughness.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
    prepareDefinesBeforeAttributes(defines, scene) {
        if (this._isEnabled) {
            defines.SHEEN = true;
            defines.SHEEN_LINKWITHALBEDO = this._linkSheenWithAlbedo;
            defines.SHEEN_ROUGHNESS = this._roughness !== null;
            defines.SHEEN_ALBEDOSCALING = this._albedoScaling;
            defines.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture;
            if (defines._areTexturesDirty) {
                if (scene.texturesEnabled) {
                    if (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.SheenTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .PrepareDefinesForMergedUV */ .YT)(this._texture, defines, "SHEEN_TEXTURE");
                        defines.SHEEN_GAMMATEXTURE = this._texture.gammaSpace;
                    }
                    else {
                        defines.SHEEN_TEXTURE = false;
                    }
                    if (this._textureRoughness && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.SheenTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .PrepareDefinesForMergedUV */ .YT)(this._textureRoughness, defines, "SHEEN_TEXTURE_ROUGHNESS");
                    }
                    else {
                        defines.SHEEN_TEXTURE_ROUGHNESS = false;
                    }
                }
            }
        }
        else {
            defines.SHEEN = false;
            defines.SHEEN_TEXTURE = false;
            defines.SHEEN_TEXTURE_ROUGHNESS = false;
            defines.SHEEN_LINKWITHALBEDO = false;
            defines.SHEEN_ROUGHNESS = false;
            defines.SHEEN_ALBEDOSCALING = false;
            defines.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = false;
            defines.SHEEN_GAMMATEXTURE = false;
            defines.SHEEN_TEXTUREDIRECTUV = 0;
            defines.SHEEN_TEXTURE_ROUGHNESSDIRECTUV = 0;
        }
    }
    bindForSubMesh(uniformBuffer, scene, engine, subMesh) {
        if (!this._isEnabled) {
            return;
        }
        const defines = subMesh.materialDefines;
        const isFrozen = this._material.isFrozen;
        if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {
            if ((this._texture || this._textureRoughness) && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.SheenTextureEnabled) {
                uniformBuffer.updateFloat4("vSheenInfos", this._texture?.coordinatesIndex ?? 0, this._texture?.level ?? 0, this._textureRoughness?.coordinatesIndex ?? 0, this._textureRoughness?.level ?? 0);
                if (this._texture) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .BindTextureMatrix */ .mA)(this._texture, uniformBuffer, "sheen");
                }
                if (this._textureRoughness && !defines.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .BindTextureMatrix */ .mA)(this._textureRoughness, uniformBuffer, "sheenRoughness");
                }
            }
            // Sheen
            uniformBuffer.updateFloat4("vSheenColor", this.color.r, this.color.g, this.color.b, this.intensity);
            if (this._roughness !== null) {
                uniformBuffer.updateFloat("vSheenRoughness", this._roughness);
            }
        }
        // Textures
        if (scene.texturesEnabled) {
            if (this._texture && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.SheenTextureEnabled) {
                uniformBuffer.setTexture("sheenSampler", this._texture);
            }
            if (this._textureRoughness && !defines.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE && _Materials_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.SheenTextureEnabled) {
                uniformBuffer.setTexture("sheenRoughnessSampler", this._textureRoughness);
            }
        }
    }
    hasTexture(texture) {
        if (this._texture === texture) {
            return true;
        }
        if (this._textureRoughness === texture) {
            return true;
        }
        return false;
    }
    getActiveTextures(activeTextures) {
        if (this._texture) {
            activeTextures.push(this._texture);
        }
        if (this._textureRoughness) {
            activeTextures.push(this._textureRoughness);
        }
    }
    getAnimatables(animatables) {
        if (this._texture && this._texture.animations && this._texture.animations.length > 0) {
            animatables.push(this._texture);
        }
        if (this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0) {
            animatables.push(this._textureRoughness);
        }
    }
    dispose(forceDisposeTextures) {
        if (forceDisposeTextures) {
            this._texture?.dispose();
            this._textureRoughness?.dispose();
        }
    }
    getClassName() {
        return "PBRSheenConfiguration";
    }
    addFallbacks(defines, fallbacks, currentRank) {
        if (defines.SHEEN) {
            fallbacks.addFallback(currentRank++, "SHEEN");
        }
        return currentRank;
    }
    getSamplers(samplers) {
        samplers.push("sheenSampler", "sheenRoughnessSampler");
    }
    getUniforms() {
        return {
            ubo: [
                { name: "vSheenColor", size: 4, type: "vec4" },
                { name: "vSheenRoughness", size: 1, type: "float" },
                { name: "vSheenInfos", size: 4, type: "vec4" },
                { name: "sheenMatrix", size: 16, type: "mat4" },
                { name: "sheenRoughnessMatrix", size: 16, type: "mat4" },
            ],
        };
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSheenConfiguration.prototype, "isEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSheenConfiguration.prototype, "linkSheenWithAlbedo", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSheenConfiguration.prototype, "intensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)()
], PBRSheenConfiguration.prototype, "color", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSheenConfiguration.prototype, "texture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSheenConfiguration.prototype, "useRoughnessFromMainTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSheenConfiguration.prototype, "roughness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSheenConfiguration.prototype, "textureRoughness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSheenConfiguration.prototype, "albedoScaling", void 0);
//# sourceMappingURL=pbrSheenConfiguration.js.map

/***/ }),

/***/ 86097:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   I: () => (/* binding */ PBRSubSurfaceConfiguration),
/* harmony export */   p: () => (/* binding */ MaterialSubSurfaceDefines)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26041);
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10633);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79923);
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50074);
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(79526);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80467);









/**
 * @internal
 */
class MaterialSubSurfaceDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_6__/* .MaterialDefines */ .M {
    constructor() {
        super(...arguments);
        this.SUBSURFACE = false;
        this.SS_REFRACTION = false;
        this.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS = false;
        this.SS_TRANSLUCENCY = false;
        this.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS = false;
        this.SS_SCATTERING = false;
        this.SS_DISPERSION = false;
        this.SS_THICKNESSANDMASK_TEXTURE = false;
        this.SS_THICKNESSANDMASK_TEXTUREDIRECTUV = 0;
        this.SS_HAS_THICKNESS = false;
        this.SS_REFRACTIONINTENSITY_TEXTURE = false;
        this.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV = 0;
        this.SS_TRANSLUCENCYINTENSITY_TEXTURE = false;
        this.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV = 0;
        this.SS_TRANSLUCENCYCOLOR_TEXTURE = false;
        this.SS_TRANSLUCENCYCOLOR_TEXTUREDIRECTUV = 0;
        this.SS_REFRACTIONMAP_3D = false;
        this.SS_REFRACTIONMAP_OPPOSITEZ = false;
        this.SS_LODINREFRACTIONALPHA = false;
        this.SS_GAMMAREFRACTION = false;
        this.SS_RGBDREFRACTION = false;
        this.SS_LINEARSPECULARREFRACTION = false;
        this.SS_LINKREFRACTIONTOTRANSPARENCY = false;
        this.SS_ALBEDOFORREFRACTIONTINT = false;
        this.SS_ALBEDOFORTRANSLUCENCYTINT = false;
        this.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = false;
        this.SS_USE_THICKNESS_AS_DEPTH = false;
        this.SS_USE_GLTF_TEXTURES = false;
    }
}
/**
 * Plugin that implements the sub surface component of the PBR material
 */
class PBRSubSurfaceConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialPluginBase */ .y {
    /**
     * Diffusion profile for subsurface scattering.
     * Useful for better scattering in the skins or foliages.
     */
    get scatteringDiffusionProfile() {
        if (!this._scene.subSurfaceConfiguration) {
            return null;
        }
        return this._scene.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex];
    }
    set scatteringDiffusionProfile(c) {
        if (!this._scene.enableSubSurfaceForPrePass()) {
            // Not supported
            return;
        }
        // addDiffusionProfile automatically checks for doubles
        if (c) {
            this._scatteringDiffusionProfileIndex = this._scene.subSurfaceConfiguration.addDiffusionProfile(c);
        }
    }
    /**
     * Index of refraction of the material's volume.
     * https://en.wikipedia.org/wiki/List_of_refractive_indices
     *
     * This ONLY impacts refraction. If not provided or given a non-valid value,
     * the volume will use the same IOR as the surface.
     */
    get volumeIndexOfRefraction() {
        if (this._volumeIndexOfRefraction >= 1.0) {
            return this._volumeIndexOfRefraction;
        }
        return this._indexOfRefraction;
    }
    set volumeIndexOfRefraction(value) {
        if (value >= 1.0) {
            this._volumeIndexOfRefraction = value;
        }
        else {
            this._volumeIndexOfRefraction = -1.0;
        }
    }
    /** @internal */
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isRefractionEnabled || this._isTranslucencyEnabled || this._isScatteringEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /** @internal */
    _markScenePrePassDirty() {
        this._enable(this._isRefractionEnabled || this._isTranslucencyEnabled || this._isScatteringEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
        this._internalMarkScenePrePassDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    constructor(material, addToPluginList = true) {
        super(material, "PBRSubSurface", 130, new MaterialSubSurfaceDefines(), addToPluginList);
        this._isRefractionEnabled = false;
        /**
         * Defines if the refraction is enabled in the material.
         */
        this.isRefractionEnabled = false;
        this._isTranslucencyEnabled = false;
        /**
         * Defines if the translucency is enabled in the material.
         */
        this.isTranslucencyEnabled = false;
        this._isDispersionEnabled = false;
        /**
         * Defines if dispersion is enabled in the material.
         */
        this.isDispersionEnabled = false;
        this._isScatteringEnabled = false;
        /**
         * Defines if the sub surface scattering is enabled in the material.
         */
        this.isScatteringEnabled = false;
        this._scatteringDiffusionProfileIndex = 0;
        /**
         * Defines the refraction intensity of the material.
         * The refraction when enabled replaces the Diffuse part of the material.
         * The intensity helps transitioning between diffuse and refraction.
         */
        this.refractionIntensity = 1;
        /**
         * Defines the translucency intensity of the material.
         * When translucency has been enabled, this defines how much of the "translucency"
         * is added to the diffuse part of the material.
         */
        this.translucencyIntensity = 1;
        /**
         * When enabled, transparent surfaces will be tinted with the albedo colour (independent of thickness)
         */
        this.useAlbedoToTintRefraction = false;
        /**
         * When enabled, translucent surfaces will be tinted with the albedo colour (independent of thickness)
         */
        this.useAlbedoToTintTranslucency = false;
        this._thicknessTexture = null;
        /**
         * Stores the average thickness of a mesh in a texture (The texture is holding the values linearly).
         * The red (or green if useGltfStyleTextures=true) channel of the texture should contain the thickness remapped between 0 and 1.
         * 0 would mean minimumThickness
         * 1 would mean maximumThickness
         * The other channels might be use as a mask to vary the different effects intensity.
         */
        this.thicknessTexture = null;
        this._refractionTexture = null;
        /**
         * Defines the texture to use for refraction.
         */
        this.refractionTexture = null;
        /** @internal */
        this._indexOfRefraction = 1.5;
        /**
         * Index of refraction of the material base layer.
         * https://en.wikipedia.org/wiki/List_of_refractive_indices
         *
         * This does not only impact refraction but also the Base F0 of Dielectric Materials.
         *
         * From dielectric fresnel rules: F0 = square((iorT - iorI) / (iorT + iorI))
         */
        this.indexOfRefraction = 1.5;
        this._volumeIndexOfRefraction = -1.0;
        this._invertRefractionY = false;
        /**
         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
         */
        this.invertRefractionY = false;
        /** @internal */
        this._linkRefractionWithTransparency = false;
        /**
         * This parameters will make the material used its opacity to control how much it is refracting against not.
         * Materials half opaque for instance using refraction could benefit from this control.
         */
        this.linkRefractionWithTransparency = false;
        /**
         * Defines the minimum thickness stored in the thickness map.
         * If no thickness map is defined, this value will be used to simulate thickness.
         */
        this.minimumThickness = 0;
        /**
         * Defines the maximum thickness stored in the thickness map.
         */
        this.maximumThickness = 1;
        /**
         * Defines that the thickness should be used as a measure of the depth volume.
         */
        this.useThicknessAsDepth = false;
        /**
         * Defines the volume tint of the material.
         * This is used for both translucency and scattering.
         */
        this.tintColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color3 */ .v9.White();
        /**
         * Defines the distance at which the tint color should be found in the media.
         * This is used for refraction only.
         */
        this.tintColorAtDistance = 1;
        /**
         * Defines the Abbe number for the volume.
         */
        this.dispersion = 0;
        /**
         * Defines how far each channel transmit through the media.
         * It is defined as a color to simplify it selection.
         */
        this.diffusionDistance = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color3 */ .v9.White();
        this._useMaskFromThicknessTexture = false;
        /**
         * Stores the intensity of the different subsurface effects in the thickness texture.
         * Note that if refractionIntensityTexture and/or translucencyIntensityTexture is provided it takes precedence over thicknessTexture + useMaskFromThicknessTexture
         * * the green (red if useGltfStyleTextures = true) channel is the refraction intensity.
         * * the blue (alpha if useGltfStyleTextures = true) channel is the translucency intensity.
         */
        this.useMaskFromThicknessTexture = false;
        this._refractionIntensityTexture = null;
        /**
         * Stores the intensity of the refraction. If provided, it takes precedence over thicknessTexture + useMaskFromThicknessTexture
         * * the green (red if useGltfStyleTextures = true) channel is the refraction intensity.
         */
        this.refractionIntensityTexture = null;
        this._translucencyIntensityTexture = null;
        /**
         * Stores the intensity of the translucency. If provided, it takes precedence over thicknessTexture + useMaskFromThicknessTexture
         * * the blue (alpha if useGltfStyleTextures = true) channel is the translucency intensity.
         */
        this.translucencyIntensityTexture = null;
        /**
         * Defines the translucency tint of the material.
         * If not set, the tint color will be used instead.
         */
        this.translucencyColor = null;
        this._translucencyColorTexture = null;
        /**
         * Defines the translucency tint color of the material as a texture.
         * This is multiplied against the translucency color to add variety and realism to the material.
         * If translucencyColor is not set, the tint color will be used instead.
         */
        this.translucencyColorTexture = null;
        this._useGltfStyleTextures = true;
        /**
         * Use channels layout used by glTF:
         * * thicknessTexture: the green (instead of red) channel is the thickness
         * * thicknessTexture/refractionIntensityTexture: the red (instead of green) channel is the refraction intensity
         * * thicknessTexture/translucencyIntensityTexture: the alpha (instead of blue) channel is the translucency intensity
         */
        this.useGltfStyleTextures = true;
        this._scene = material.getScene();
        this.registerForExtraEvents = true;
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
        this._internalMarkScenePrePassDirty = material._dirtyCallbacks[32];
    }
    isReadyForSubMesh(defines, scene) {
        if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled) {
            return true;
        }
        if (defines._areTexturesDirty) {
            if (scene.texturesEnabled) {
                if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ThicknessTextureEnabled) {
                    if (!this._thicknessTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (this._translucencyColorTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.TranslucencyColorTextureEnabled) {
                    if (!this._translucencyColorTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                if (this._translucencyIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.TranslucencyIntensityTextureEnabled) {
                    if (!this._translucencyIntensityTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
                const refractionTexture = this._getRefractionTexture(scene);
                if (refractionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.RefractionTextureEnabled) {
                    if (!refractionTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
    prepareDefinesBeforeAttributes(defines, scene) {
        if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled) {
            defines.SUBSURFACE = false;
            defines.SS_DISPERSION = false;
            defines.SS_TRANSLUCENCY = false;
            defines.SS_SCATTERING = false;
            defines.SS_REFRACTION = false;
            defines.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS = false;
            defines.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS = false;
            defines.SS_THICKNESSANDMASK_TEXTURE = false;
            defines.SS_THICKNESSANDMASK_TEXTUREDIRECTUV = 0;
            defines.SS_HAS_THICKNESS = false;
            defines.SS_REFRACTIONINTENSITY_TEXTURE = false;
            defines.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV = 0;
            defines.SS_TRANSLUCENCYINTENSITY_TEXTURE = false;
            defines.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV = 0;
            defines.SS_REFRACTIONMAP_3D = false;
            defines.SS_REFRACTIONMAP_OPPOSITEZ = false;
            defines.SS_LODINREFRACTIONALPHA = false;
            defines.SS_GAMMAREFRACTION = false;
            defines.SS_RGBDREFRACTION = false;
            defines.SS_LINEARSPECULARREFRACTION = false;
            defines.SS_LINKREFRACTIONTOTRANSPARENCY = false;
            defines.SS_ALBEDOFORREFRACTIONTINT = false;
            defines.SS_ALBEDOFORTRANSLUCENCYTINT = false;
            defines.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = false;
            defines.SS_USE_THICKNESS_AS_DEPTH = false;
            defines.SS_USE_GLTF_TEXTURES = false;
            defines.SS_TRANSLUCENCYCOLOR_TEXTURE = false;
            defines.SS_TRANSLUCENCYCOLOR_TEXTUREDIRECTUV = 0;
            return;
        }
        if (defines._areTexturesDirty) {
            defines.SUBSURFACE = true;
            defines.SS_DISPERSION = this._isDispersionEnabled;
            defines.SS_TRANSLUCENCY = this._isTranslucencyEnabled;
            defines.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS = false;
            defines.SS_SCATTERING = this._isScatteringEnabled;
            defines.SS_THICKNESSANDMASK_TEXTURE = false;
            defines.SS_REFRACTIONINTENSITY_TEXTURE = false;
            defines.SS_TRANSLUCENCYINTENSITY_TEXTURE = false;
            defines.SS_HAS_THICKNESS = false;
            defines.SS_USE_GLTF_TEXTURES = false;
            defines.SS_REFRACTION = false;
            defines.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS = false;
            defines.SS_REFRACTIONMAP_3D = false;
            defines.SS_GAMMAREFRACTION = false;
            defines.SS_RGBDREFRACTION = false;
            defines.SS_LINEARSPECULARREFRACTION = false;
            defines.SS_REFRACTIONMAP_OPPOSITEZ = false;
            defines.SS_LODINREFRACTIONALPHA = false;
            defines.SS_LINKREFRACTIONTOTRANSPARENCY = false;
            defines.SS_ALBEDOFORREFRACTIONTINT = false;
            defines.SS_ALBEDOFORTRANSLUCENCYTINT = false;
            defines.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = false;
            defines.SS_USE_THICKNESS_AS_DEPTH = false;
            defines.SS_TRANSLUCENCYCOLOR_TEXTURE = false;
            if (defines._areTexturesDirty) {
                if (scene.texturesEnabled) {
                    if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ThicknessTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .PrepareDefinesForMergedUV */ .YT)(this._thicknessTexture, defines, "SS_THICKNESSANDMASK_TEXTURE");
                    }
                    if (this._refractionIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.RefractionIntensityTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .PrepareDefinesForMergedUV */ .YT)(this._refractionIntensityTexture, defines, "SS_REFRACTIONINTENSITY_TEXTURE");
                    }
                    if (this._translucencyIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.TranslucencyIntensityTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .PrepareDefinesForMergedUV */ .YT)(this._translucencyIntensityTexture, defines, "SS_TRANSLUCENCYINTENSITY_TEXTURE");
                    }
                    if (this._translucencyColorTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.TranslucencyColorTextureEnabled) {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .PrepareDefinesForMergedUV */ .YT)(this._translucencyColorTexture, defines, "SS_TRANSLUCENCYCOLOR_TEXTURE");
                    }
                }
            }
            defines.SS_HAS_THICKNESS = this.maximumThickness - this.minimumThickness !== 0.0;
            defines.SS_USE_GLTF_TEXTURES = this._useGltfStyleTextures;
            defines.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS = this._useMaskFromThicknessTexture && !this._refractionIntensityTexture;
            defines.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS = this._useMaskFromThicknessTexture && !this._translucencyIntensityTexture;
            if (this._isRefractionEnabled) {
                if (scene.texturesEnabled) {
                    const refractionTexture = this._getRefractionTexture(scene);
                    if (refractionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.RefractionTextureEnabled) {
                        defines.SS_REFRACTION = true;
                        defines.SS_REFRACTIONMAP_3D = refractionTexture.isCube;
                        defines.SS_GAMMAREFRACTION = refractionTexture.gammaSpace;
                        defines.SS_RGBDREFRACTION = refractionTexture.isRGBD;
                        defines.SS_LINEARSPECULARREFRACTION = refractionTexture.linearSpecularLOD;
                        defines.SS_REFRACTIONMAP_OPPOSITEZ = this._scene.useRightHandedSystem && refractionTexture.isCube ? !refractionTexture.invertZ : refractionTexture.invertZ;
                        defines.SS_LODINREFRACTIONALPHA = refractionTexture.lodLevelInAlpha;
                        defines.SS_LINKREFRACTIONTOTRANSPARENCY = this._linkRefractionWithTransparency;
                        defines.SS_ALBEDOFORREFRACTIONTINT = this.useAlbedoToTintRefraction;
                        defines.SS_USE_LOCAL_REFRACTIONMAP_CUBIC = refractionTexture.isCube && refractionTexture.boundingBoxSize;
                        defines.SS_USE_THICKNESS_AS_DEPTH = this.useThicknessAsDepth;
                    }
                }
            }
            if (this._isTranslucencyEnabled) {
                defines.SS_ALBEDOFORTRANSLUCENCYTINT = this.useAlbedoToTintTranslucency;
            }
        }
    }
    /**
     * Binds the material data (this function is called even if mustRebind() returns false)
     * @param uniformBuffer defines the Uniform buffer to fill in.
     * @param scene defines the scene the material belongs to.
     * @param engine defines the engine the material belongs to.
     * @param subMesh the submesh to bind data for
     */
    hardBindForSubMesh(uniformBuffer, scene, engine, subMesh) {
        if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled) {
            return;
        }
        // If min/max thickness is 0, avoid decompising to determine the scaled thickness (it's always zero).
        if (this.maximumThickness === 0.0 && this.minimumThickness === 0.0) {
            uniformBuffer.updateFloat2("vThicknessParam", 0, 0);
        }
        else {
            subMesh.getRenderingMesh().getWorldMatrix().decompose(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0]);
            const thicknessScale = Math.max(Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0].x), Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0].y), Math.abs(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0].z));
            uniformBuffer.updateFloat2("vThicknessParam", this.minimumThickness * thicknessScale, (this.maximumThickness - this.minimumThickness) * thicknessScale);
        }
    }
    bindForSubMesh(uniformBuffer, scene, engine, subMesh) {
        if (!this._isRefractionEnabled && !this._isTranslucencyEnabled && !this._isScatteringEnabled) {
            return;
        }
        const defines = subMesh.materialDefines;
        const isFrozen = this._material.isFrozen;
        const realTimeFiltering = this._material.realTimeFiltering;
        const lodBasedMicrosurface = defines.LODBASEDMICROSFURACE;
        const refractionTexture = this._getRefractionTexture(scene);
        if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {
            if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ThicknessTextureEnabled) {
                uniformBuffer.updateFloat2("vThicknessInfos", this._thicknessTexture.coordinatesIndex, this._thicknessTexture.level);
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .BindTextureMatrix */ .mA)(this._thicknessTexture, uniformBuffer, "thickness");
            }
            if (this._refractionIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.RefractionIntensityTextureEnabled && defines.SS_REFRACTIONINTENSITY_TEXTURE) {
                uniformBuffer.updateFloat2("vRefractionIntensityInfos", this._refractionIntensityTexture.coordinatesIndex, this._refractionIntensityTexture.level);
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .BindTextureMatrix */ .mA)(this._refractionIntensityTexture, uniformBuffer, "refractionIntensity");
            }
            if (this._translucencyColorTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.TranslucencyColorTextureEnabled && defines.SS_TRANSLUCENCYCOLOR_TEXTURE) {
                uniformBuffer.updateFloat2("vTranslucencyColorInfos", this._translucencyColorTexture.coordinatesIndex, this._translucencyColorTexture.level);
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .BindTextureMatrix */ .mA)(this._translucencyColorTexture, uniformBuffer, "translucencyColor");
            }
            if (this._translucencyIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.TranslucencyIntensityTextureEnabled && defines.SS_TRANSLUCENCYINTENSITY_TEXTURE) {
                uniformBuffer.updateFloat2("vTranslucencyIntensityInfos", this._translucencyIntensityTexture.coordinatesIndex, this._translucencyIntensityTexture.level);
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .BindTextureMatrix */ .mA)(this._translucencyIntensityTexture, uniformBuffer, "translucencyIntensity");
            }
            if (refractionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.RefractionTextureEnabled) {
                uniformBuffer.updateMatrix("refractionMatrix", refractionTexture.getRefractionTextureMatrix());
                let depth = 1.0;
                if (!refractionTexture.isCube) {
                    if (refractionTexture.depth) {
                        depth = refractionTexture.depth;
                    }
                }
                const width = refractionTexture.getSize().width;
                const refractionIor = this.volumeIndexOfRefraction;
                uniformBuffer.updateFloat4("vRefractionInfos", refractionTexture.level, 1 / refractionIor, depth, this._invertRefractionY ? -1 : 1);
                uniformBuffer.updateFloat4("vRefractionMicrosurfaceInfos", width, refractionTexture.lodGenerationScale, refractionTexture.lodGenerationOffset, 1.0 / this.indexOfRefraction);
                if (realTimeFiltering) {
                    uniformBuffer.updateFloat2("vRefractionFilteringInfo", width, Math.log2(width));
                }
                if (refractionTexture.boundingBoxSize) {
                    const cubeTexture = refractionTexture;
                    uniformBuffer.updateVector3("vRefractionPosition", cubeTexture.boundingBoxPosition);
                    uniformBuffer.updateVector3("vRefractionSize", cubeTexture.boundingBoxSize);
                }
            }
            if (this._isScatteringEnabled) {
                uniformBuffer.updateFloat("scatteringDiffusionProfile", this._scatteringDiffusionProfileIndex);
            }
            uniformBuffer.updateColor3("vDiffusionDistance", this.diffusionDistance);
            uniformBuffer.updateFloat4("vTintColor", this.tintColor.r, this.tintColor.g, this.tintColor.b, Math.max(0.00001, this.tintColorAtDistance));
            uniformBuffer.updateColor4("vTranslucencyColor", this.translucencyColor ?? this.tintColor, 0);
            uniformBuffer.updateFloat3("vSubSurfaceIntensity", this.refractionIntensity, this.translucencyIntensity, 0);
            uniformBuffer.updateFloat("dispersion", this.dispersion);
        }
        // Textures
        if (scene.texturesEnabled) {
            if (this._thicknessTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.ThicknessTextureEnabled) {
                uniformBuffer.setTexture("thicknessSampler", this._thicknessTexture);
            }
            if (this._refractionIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.RefractionIntensityTextureEnabled && defines.SS_REFRACTIONINTENSITY_TEXTURE) {
                uniformBuffer.setTexture("refractionIntensitySampler", this._refractionIntensityTexture);
            }
            if (this._translucencyIntensityTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.TranslucencyIntensityTextureEnabled && defines.SS_TRANSLUCENCYINTENSITY_TEXTURE) {
                uniformBuffer.setTexture("translucencyIntensitySampler", this._translucencyIntensityTexture);
            }
            if (this._translucencyColorTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.TranslucencyColorTextureEnabled && defines.SS_TRANSLUCENCYCOLOR_TEXTURE) {
                uniformBuffer.setTexture("translucencyColorSampler", this._translucencyColorTexture);
            }
            if (refractionTexture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.RefractionTextureEnabled) {
                if (lodBasedMicrosurface) {
                    uniformBuffer.setTexture("refractionSampler", refractionTexture);
                }
                else {
                    uniformBuffer.setTexture("refractionSampler", refractionTexture._lodTextureMid || refractionTexture);
                    uniformBuffer.setTexture("refractionSamplerLow", refractionTexture._lodTextureLow || refractionTexture);
                    uniformBuffer.setTexture("refractionSamplerHigh", refractionTexture._lodTextureHigh || refractionTexture);
                }
            }
        }
    }
    /**
     * Returns the texture used for refraction or null if none is used.
     * @param scene defines the scene the material belongs to.
     * @returns - Refraction texture if present.  If no refraction texture and refraction
     * is linked with transparency, returns environment texture.  Otherwise, returns null.
     */
    _getRefractionTexture(scene) {
        if (this._refractionTexture) {
            return this._refractionTexture;
        }
        if (this._isRefractionEnabled) {
            return scene.environmentTexture;
        }
        return null;
    }
    /**
     * Returns true if alpha blending should be disabled.
     */
    get disableAlphaBlending() {
        return this._isRefractionEnabled && this._linkRefractionWithTransparency;
    }
    /**
     * Fills the list of render target textures.
     * @param renderTargets the list of render targets to update
     */
    fillRenderTargetTextures(renderTargets) {
        if (_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) {
            renderTargets.push(this._refractionTexture);
        }
    }
    hasTexture(texture) {
        if (this._thicknessTexture === texture) {
            return true;
        }
        if (this._refractionTexture === texture) {
            return true;
        }
        if (this._refractionIntensityTexture === texture) {
            return true;
        }
        if (this._translucencyIntensityTexture === texture) {
            return true;
        }
        if (this._translucencyColorTexture === texture) {
            return true;
        }
        return false;
    }
    hasRenderTargetTextures() {
        if (_materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) {
            return true;
        }
        return false;
    }
    getActiveTextures(activeTextures) {
        if (this._thicknessTexture) {
            activeTextures.push(this._thicknessTexture);
        }
        if (this._refractionTexture) {
            activeTextures.push(this._refractionTexture);
        }
        if (this._translucencyColorTexture) {
            activeTextures.push(this._translucencyColorTexture);
        }
        if (this._translucencyIntensityTexture) {
            activeTextures.push(this._translucencyIntensityTexture);
        }
    }
    getAnimatables(animatables) {
        if (this._thicknessTexture && this._thicknessTexture.animations && this._thicknessTexture.animations.length > 0) {
            animatables.push(this._thicknessTexture);
        }
        if (this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0) {
            animatables.push(this._refractionTexture);
        }
        if (this._translucencyColorTexture && this._translucencyColorTexture.animations && this._translucencyColorTexture.animations.length > 0) {
            animatables.push(this._translucencyColorTexture);
        }
        if (this._translucencyIntensityTexture && this._translucencyIntensityTexture.animations && this._translucencyIntensityTexture.animations.length > 0) {
            animatables.push(this._translucencyIntensityTexture);
        }
    }
    dispose(forceDisposeTextures) {
        if (forceDisposeTextures) {
            if (this._thicknessTexture) {
                this._thicknessTexture.dispose();
            }
            if (this._refractionTexture) {
                this._refractionTexture.dispose();
            }
            if (this._translucencyColorTexture) {
                this._translucencyColorTexture.dispose();
            }
            if (this._translucencyIntensityTexture) {
                this._translucencyIntensityTexture.dispose();
            }
        }
    }
    getClassName() {
        return "PBRSubSurfaceConfiguration";
    }
    addFallbacks(defines, fallbacks, currentRank) {
        if (defines.SS_SCATTERING) {
            fallbacks.addFallback(currentRank++, "SS_SCATTERING");
        }
        if (defines.SS_TRANSLUCENCY) {
            fallbacks.addFallback(currentRank++, "SS_TRANSLUCENCY");
        }
        return currentRank;
    }
    getSamplers(samplers) {
        samplers.push("thicknessSampler", "refractionIntensitySampler", "translucencyIntensitySampler", "refractionSampler", "refractionSamplerLow", "refractionSamplerHigh", "translucencyColorSampler");
    }
    getUniforms() {
        return {
            ubo: [
                { name: "vRefractionMicrosurfaceInfos", size: 4, type: "vec4" },
                { name: "vRefractionFilteringInfo", size: 2, type: "vec2" },
                { name: "vTranslucencyIntensityInfos", size: 2, type: "vec2" },
                { name: "vRefractionInfos", size: 4, type: "vec4" },
                { name: "refractionMatrix", size: 16, type: "mat4" },
                { name: "vThicknessInfos", size: 2, type: "vec2" },
                { name: "vRefractionIntensityInfos", size: 2, type: "vec2" },
                { name: "thicknessMatrix", size: 16, type: "mat4" },
                { name: "refractionIntensityMatrix", size: 16, type: "mat4" },
                { name: "translucencyIntensityMatrix", size: 16, type: "mat4" },
                { name: "vThicknessParam", size: 2, type: "vec2" },
                { name: "vDiffusionDistance", size: 3, type: "vec3" },
                { name: "vTintColor", size: 4, type: "vec4" },
                { name: "vSubSurfaceIntensity", size: 3, type: "vec3" },
                { name: "vRefractionPosition", size: 3, type: "vec3" },
                { name: "vRefractionSize", size: 3, type: "vec3" },
                { name: "scatteringDiffusionProfile", size: 1, type: "float" },
                { name: "dispersion", size: 1, type: "float" },
                { name: "vTranslucencyColor", size: 4, type: "vec4" },
                { name: "vTranslucencyColorInfos", size: 2, type: "vec2" },
                { name: "translucencyColorMatrix", size: 16, type: "mat4" },
            ],
        };
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "isRefractionEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "isTranslucencyEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "isDispersionEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markScenePrePassDirty")
], PBRSubSurfaceConfiguration.prototype, "isScatteringEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "_scatteringDiffusionProfileIndex", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "refractionIntensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "translucencyIntensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "useAlbedoToTintRefraction", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "useAlbedoToTintTranslucency", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "thicknessTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "refractionTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "indexOfRefraction", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "_volumeIndexOfRefraction", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "volumeIndexOfRefraction", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "invertRefractionY", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "linkRefractionWithTransparency", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "minimumThickness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "maximumThickness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "useThicknessAsDepth", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)()
], PBRSubSurfaceConfiguration.prototype, "tintColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "tintColorAtDistance", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], PBRSubSurfaceConfiguration.prototype, "dispersion", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)()
], PBRSubSurfaceConfiguration.prototype, "diffusionDistance", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "useMaskFromThicknessTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "refractionIntensityTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "translucencyIntensityTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)()
], PBRSubSurfaceConfiguration.prototype, "translucencyColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "translucencyColorTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], PBRSubSurfaceConfiguration.prototype, "useGltfStyleTextures", void 0);
//# sourceMappingURL=pbrSubSurfaceConfiguration.js.map

/***/ }),

/***/ 72156:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   FG: () => (/* binding */ ReverseLutFromBitmap),
/* harmony export */   Kq: () => (/* binding */ ApplyLut),
/* harmony export */   ZR: () => (/* binding */ HufUncompress),
/* harmony export */   tb: () => (/* binding */ Wav2Decode)
/* harmony export */ });
/* harmony import */ var _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86700);
/* harmony import */ var _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3687);


/**
 * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
 * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
 * implementation.
 */
// /*
// Copyright (c) 2014 - 2017, Syoyo Fujita
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of the Syoyo Fujita nor the
//       names of its contributors may be used to endorse or promote products
//       derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// */
// // TinyEXR contains some OpenEXR code, which is licensed under ------------
// ///////////////////////////////////////////////////////////////////////////
// //
// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// // Digital Ltd. LLC
// //
// // All rights reserved.
// //
// // Redistribution and use in source and binary forms, with or without
// // modification, are permitted provided that the following conditions are
// // met:
// // *       Redistributions of source code must retain the above copyright
// // notice, this list of conditions and the following disclaimer.
// // *       Redistributions in binary form must reproduce the above
// // copyright notice, this list of conditions and the following disclaimer
// // in the documentation and/or other materials provided with the
// // distribution.
// // *       Neither the name of Industrial Light & Magic nor the names of
// // its contributors may be used to endorse or promote products derived
// // from this software without specific prior written permission.
// //
// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
// ///////////////////////////////////////////////////////////////////////////
// // End of OpenEXR license -------------------------------------------------
const NBITS = 16;
const A_OFFSET = 1 << (NBITS - 1);
const MOD_MASK = (1 << NBITS) - 1;
/** @internal */
function ReverseLutFromBitmap(bitmap, lut) {
    let k = 0;
    for (let i = 0; i < _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .USHORT_RANGE */ .Ez; ++i) {
        if (i == 0 || bitmap[i >> 3] & (1 << (i & 7))) {
            lut[k++] = i;
        }
    }
    const n = k - 1;
    while (k < _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .USHORT_RANGE */ .Ez)
        lut[k++] = 0;
    return n;
}
function HufClearDecTable(hdec) {
    for (let i = 0; i < _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECSIZE */ .A_; i++) {
        hdec[i] = {};
        hdec[i].len = 0;
        hdec[i].lit = 0;
        hdec[i].p = null;
    }
}
function GetBits(nBits, c, lc, array, offset) {
    while (lc < nBits) {
        c = (c << 8) | (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseUint8Array */ .fz)(array, offset);
        lc += 8;
    }
    lc -= nBits;
    return {
        l: (c >> lc) & ((1 << nBits) - 1),
        c,
        lc,
    };
}
function GetChar(c, lc, array, offset) {
    c = (c << 8) | (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseUint8Array */ .fz)(array, offset);
    lc += 8;
    return {
        c,
        lc,
    };
}
function GetCode(po, rlc, c, lc, array, offset, outBuffer, outBufferOffset, outBufferEndOffset) {
    if (po == rlc) {
        if (lc < 8) {
            const gc = GetChar(c, lc, array, offset);
            c = gc.c;
            lc = gc.lc;
        }
        lc -= 8;
        let cs = c >> lc;
        cs = new Uint8Array([cs])[0];
        if (outBufferOffset.value + cs > outBufferEndOffset) {
            return null;
        }
        const s = outBuffer[outBufferOffset.value - 1];
        while (cs-- > 0) {
            outBuffer[outBufferOffset.value++] = s;
        }
    }
    else if (outBufferOffset.value < outBufferEndOffset) {
        outBuffer[outBufferOffset.value++] = po;
    }
    else {
        return null;
    }
    return { c, lc };
}
const HufTableBuffer = new Array(59);
function HufCanonicalCodeTable(hcode) {
    for (let i = 0; i <= 58; ++i)
        HufTableBuffer[i] = 0;
    for (let i = 0; i < _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_ENCSIZE */ .U0; ++i)
        HufTableBuffer[hcode[i]] += 1;
    let c = 0;
    for (let i = 58; i > 0; --i) {
        const nc = (c + HufTableBuffer[i]) >> 1;
        HufTableBuffer[i] = c;
        c = nc;
    }
    for (let i = 0; i < _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_ENCSIZE */ .U0; ++i) {
        const l = hcode[i];
        if (l > 0)
            hcode[i] = l | (HufTableBuffer[l]++ << 6);
    }
}
function HufUnpackEncTable(array, offset, ni, im, iM, hcode) {
    const p = offset;
    let c = 0;
    let lc = 0;
    for (; im <= iM; im++) {
        if (p.value - offset.value > ni) {
            return;
        }
        let gb = GetBits(6, c, lc, array, p);
        const l = gb.l;
        c = gb.c;
        lc = gb.lc;
        hcode[im] = l;
        if (l == _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .LONG_ZEROCODE_RUN */ .Hh) {
            if (p.value - offset.value > ni) {
                throw new Error("Error in HufUnpackEncTable");
            }
            gb = GetBits(8, c, lc, array, p);
            let zerun = gb.l + _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .SHORTEST_LONG_RUN */ .gn;
            c = gb.c;
            lc = gb.lc;
            if (im + zerun > iM + 1) {
                throw new Error("Error in HufUnpackEncTable");
            }
            while (zerun--)
                hcode[im++] = 0;
            im--;
        }
        else if (l >= _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .SHORT_ZEROCODE_RUN */ .LU) {
            let zerun = l - _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .SHORT_ZEROCODE_RUN */ .LU + 2;
            if (im + zerun > iM + 1) {
                throw new Error("Error in HufUnpackEncTable");
            }
            while (zerun--)
                hcode[im++] = 0;
            im--;
        }
    }
    HufCanonicalCodeTable(hcode);
}
function HufLength(code) {
    return code & 63;
}
function HufCode(code) {
    return code >> 6;
}
function HufBuildDecTable(hcode, im, iM, hdecod) {
    for (; im <= iM; im++) {
        const c = HufCode(hcode[im]);
        const l = HufLength(hcode[im]);
        if (c >> l) {
            throw new Error("Invalid table entry");
        }
        if (l > _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECBITS */ .LK) {
            const pl = hdecod[c >> (l - _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECBITS */ .LK)];
            if (pl.len) {
                throw new Error("Invalid table entry");
            }
            pl.lit++;
            if (pl.p) {
                const p = pl.p;
                pl.p = new Array(pl.lit);
                for (let i = 0; i < pl.lit - 1; ++i) {
                    pl.p[i] = p[i];
                }
            }
            else {
                pl.p = new Array(1);
            }
            pl.p[pl.lit - 1] = im;
        }
        else if (l) {
            let plOffset = 0;
            for (let i = 1 << (_exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECBITS */ .LK - l); i > 0; i--) {
                const pl = hdecod[(c << (_exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECBITS */ .LK - l)) + plOffset];
                if (pl.len || pl.p) {
                    throw new Error("Invalid table entry");
                }
                pl.len = l;
                pl.lit = im;
                plOffset++;
            }
        }
    }
    return true;
}
function HufDecode(encodingTable, decodingTable, array, offset, ni, rlc, no, outBuffer, outOffset) {
    let c = 0;
    let lc = 0;
    const outBufferEndOffset = no;
    const inOffsetEnd = Math.trunc(offset.value + (ni + 7) / 8);
    while (offset.value < inOffsetEnd) {
        let gc = GetChar(c, lc, array, offset);
        c = gc.c;
        lc = gc.lc;
        while (lc >= _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECBITS */ .LK) {
            const index = (c >> (lc - _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECBITS */ .LK)) & _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECMASK */ .lR;
            const pl = decodingTable[index];
            if (pl.len) {
                lc -= pl.len;
                const gCode = GetCode(pl.lit, rlc, c, lc, array, offset, outBuffer, outOffset, outBufferEndOffset);
                if (gCode) {
                    c = gCode.c;
                    lc = gCode.lc;
                }
            }
            else {
                if (!pl.p) {
                    throw new Error("hufDecode issues");
                }
                let j;
                for (j = 0; j < pl.lit; j++) {
                    const l = HufLength(encodingTable[pl.p[j]]);
                    while (lc < l && offset.value < inOffsetEnd) {
                        gc = GetChar(c, lc, array, offset);
                        c = gc.c;
                        lc = gc.lc;
                    }
                    if (lc >= l) {
                        if (HufCode(encodingTable[pl.p[j]]) == ((c >> (lc - l)) & ((1 << l) - 1))) {
                            lc -= l;
                            const gCode = GetCode(pl.p[j], rlc, c, lc, array, offset, outBuffer, outOffset, outBufferEndOffset);
                            if (gCode) {
                                c = gCode.c;
                                lc = gCode.lc;
                            }
                            break;
                        }
                    }
                }
                if (j == pl.lit) {
                    throw new Error("HufDecode issues");
                }
            }
        }
    }
    const i = (8 - ni) & 7;
    c >>= i;
    lc -= i;
    while (lc > 0) {
        const pl = decodingTable[(c << (_exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECBITS */ .LK - lc)) & _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECMASK */ .lR];
        if (pl.len) {
            lc -= pl.len;
            const gCode = GetCode(pl.lit, rlc, c, lc, array, offset, outBuffer, outOffset, outBufferEndOffset);
            if (gCode) {
                c = gCode.c;
                lc = gCode.lc;
            }
        }
        else {
            throw new Error("HufDecode issues");
        }
    }
    return true;
}
/** @internal */
function HufUncompress(array, dataView, offset, nCompressed, outBuffer, nRaw) {
    const outOffset = { value: 0 };
    const initialInOffset = offset.value;
    const im = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseUint32 */ .PX)(dataView, offset);
    const iM = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseUint32 */ .PX)(dataView, offset);
    offset.value += 4;
    const nBits = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseUint32 */ .PX)(dataView, offset);
    offset.value += 4;
    if (im < 0 || im >= _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_ENCSIZE */ .U0 || iM < 0 || iM >= _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_ENCSIZE */ .U0) {
        throw new Error("Wrong HUF_ENCSIZE");
    }
    const freq = new Array(_exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_ENCSIZE */ .U0);
    const hdec = new Array(_exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .HUF_DECSIZE */ .A_);
    HufClearDecTable(hdec);
    const ni = nCompressed - (offset.value - initialInOffset);
    HufUnpackEncTable(array, offset, ni, im, iM, freq);
    if (nBits > 8 * (nCompressed - (offset.value - initialInOffset))) {
        throw new Error("Wrong hufUncompress");
    }
    HufBuildDecTable(freq, im, iM, hdec);
    HufDecode(freq, hdec, array, offset, nBits, iM, nRaw, outBuffer, outOffset);
}
function UInt16(value) {
    return value & 0xffff;
}
function Int16(value) {
    const ref = UInt16(value);
    return ref > 0x7fff ? ref - 0x10000 : ref;
}
function Wdec14(l, h) {
    const ls = Int16(l);
    const hs = Int16(h);
    const hi = hs;
    const ai = ls + (hi & 1) + (hi >> 1);
    const as = ai;
    const bs = ai - hi;
    return { a: as, b: bs };
}
function Wdec16(l, h) {
    const m = UInt16(l);
    const d = UInt16(h);
    const bb = (m - (d >> 1)) & MOD_MASK;
    const aa = (d + bb - A_OFFSET) & MOD_MASK;
    return { a: aa, b: bb };
}
/** @internal */
function Wav2Decode(buffer, j, nx, ox, ny, oy, mx) {
    const w14 = mx < 1 << 14;
    const n = nx > ny ? ny : nx;
    let p = 1;
    let p2;
    let py;
    while (p <= n)
        p <<= 1;
    p >>= 1;
    p2 = p;
    p >>= 1;
    while (p >= 1) {
        py = 0;
        const ey = py + oy * (ny - p2);
        const oy1 = oy * p;
        const oy2 = oy * p2;
        const ox1 = ox * p;
        const ox2 = ox * p2;
        let i00, i01, i10, i11;
        for (; py <= ey; py += oy2) {
            let px = py;
            const ex = py + ox * (nx - p2);
            for (; px <= ex; px += ox2) {
                const p01 = px + ox1;
                const p10 = px + oy1;
                const p11 = p10 + ox1;
                if (w14) {
                    let result = Wdec14(buffer[px + j], buffer[p10 + j]);
                    i00 = result.a;
                    i10 = result.b;
                    result = Wdec14(buffer[p01 + j], buffer[p11 + j]);
                    i01 = result.a;
                    i11 = result.b;
                    result = Wdec14(i00, i01);
                    buffer[px + j] = result.a;
                    buffer[p01 + j] = result.b;
                    result = Wdec14(i10, i11);
                    buffer[p10 + j] = result.a;
                    buffer[p11 + j] = result.b;
                }
                else {
                    let result = Wdec16(buffer[px + j], buffer[p10 + j]);
                    i00 = result.a;
                    i10 = result.b;
                    result = Wdec16(buffer[p01 + j], buffer[p11 + j]);
                    i01 = result.a;
                    i11 = result.b;
                    result = Wdec16(i00, i01);
                    buffer[px + j] = result.a;
                    buffer[p01 + j] = result.b;
                    result = Wdec16(i10, i11);
                    buffer[p10 + j] = result.a;
                    buffer[p11 + j] = result.b;
                }
            }
            if (nx & p) {
                const p10 = px + oy1;
                let result;
                if (w14) {
                    result = Wdec14(buffer[px + j], buffer[p10 + j]);
                }
                else {
                    result = Wdec16(buffer[px + j], buffer[p10 + j]);
                }
                i00 = result.a;
                buffer[p10 + j] = result.b;
                buffer[px + j] = i00;
            }
        }
        if (ny & p) {
            let px = py;
            const ex = py + ox * (nx - p2);
            for (; px <= ex; px += ox2) {
                const p01 = px + ox1;
                let result;
                if (w14) {
                    result = Wdec14(buffer[px + j], buffer[p01 + j]);
                }
                else {
                    result = Wdec16(buffer[px + j], buffer[p01 + j]);
                }
                i00 = result.a;
                buffer[p01 + j] = result.b;
                buffer[px + j] = i00;
            }
        }
        p2 = p;
        p >>= 1;
    }
    return py;
}
/** @internal */
function ApplyLut(lut, data, nData) {
    for (let i = 0; i < nData; ++i) {
        data[i] = lut[data[i]];
    }
}
//# sourceMappingURL=exrLoader.compression.huf.js.map

/***/ }),

/***/ 52093:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   S4: () => (/* binding */ UncompressRAW),
/* harmony export */   VE: () => (/* binding */ UncompressZIP),
/* harmony export */   _k: () => (/* binding */ UncompressPXR),
/* harmony export */   r: () => (/* binding */ UncompressRLE),
/* harmony export */   tg: () => (/* binding */ UncompressPIZ)
/* harmony export */ });
/* harmony import */ var _exrLoader_compression_huf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72156);
/* harmony import */ var _exrLoader_compression_rle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64942);
/* harmony import */ var _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86700);
/* harmony import */ var _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3687);




/**
 * No compression
 * @param decoder defines the decoder to use
 * @returns a decompressed data view
 */
function UncompressRAW(decoder) {
    return new DataView(decoder.array.buffer, decoder.offset.value, decoder.size);
}
/**
 * RLE compression
 * @param decoder defines the decoder to use
 * @returns a decompressed data view
 */
function UncompressRLE(decoder) {
    const compressed = decoder.viewer.buffer.slice(decoder.offset.value, decoder.offset.value + decoder.size);
    const rawBuffer = new Uint8Array((0,_exrLoader_compression_rle_js__WEBPACK_IMPORTED_MODULE_1__/* .DecodeRunLength */ ._)(compressed));
    const tmpBuffer = new Uint8Array(rawBuffer.length);
    (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_2__/* .Predictor */ .XE)(rawBuffer);
    (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_2__/* .InterleaveScalar */ .KA)(rawBuffer, tmpBuffer);
    return new DataView(tmpBuffer.buffer);
}
/**
 * Zip compression
 * @param decoder defines the decoder to use
 * @returns a decompressed data view
 */
function UncompressZIP(decoder) {
    const compressed = decoder.array.slice(decoder.offset.value, decoder.offset.value + decoder.size);
    const rawBuffer = fflate.unzlibSync(compressed);
    const tmpBuffer = new Uint8Array(rawBuffer.length);
    (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_2__/* .Predictor */ .XE)(rawBuffer);
    (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_2__/* .InterleaveScalar */ .KA)(rawBuffer, tmpBuffer);
    return new DataView(tmpBuffer.buffer);
}
/**
 * PXR compression
 * @param decoder defines the decoder to use
 * @returns a decompressed data view
 */
function UncompressPXR(decoder) {
    const compressed = decoder.array.slice(decoder.offset.value, decoder.offset.value + decoder.size);
    const rawBuffer = fflate.unzlibSync(compressed);
    const sz = decoder.lines * decoder.channels * decoder.width;
    const tmpBuffer = decoder.type == 1 ? new Uint16Array(sz) : new Uint32Array(sz);
    let tmpBufferEnd = 0;
    let writePtr = 0;
    const ptr = new Array(4);
    for (let y = 0; y < decoder.lines; y++) {
        for (let c = 0; c < decoder.channels; c++) {
            let pixel = 0;
            switch (decoder.type) {
                case 1:
                    ptr[0] = tmpBufferEnd;
                    ptr[1] = ptr[0] + decoder.width;
                    tmpBufferEnd = ptr[1] + decoder.width;
                    for (let j = 0; j < decoder.width; ++j) {
                        const diff = (rawBuffer[ptr[0]++] << 8) | rawBuffer[ptr[1]++];
                        pixel += diff;
                        tmpBuffer[writePtr] = pixel;
                        writePtr++;
                    }
                    break;
                case 2:
                    ptr[0] = tmpBufferEnd;
                    ptr[1] = ptr[0] + decoder.width;
                    ptr[2] = ptr[1] + decoder.width;
                    tmpBufferEnd = ptr[2] + decoder.width;
                    for (let j = 0; j < decoder.width; ++j) {
                        const diff = (rawBuffer[ptr[0]++] << 24) | (rawBuffer[ptr[1]++] << 16) | (rawBuffer[ptr[2]++] << 8);
                        pixel += diff;
                        tmpBuffer[writePtr] = pixel;
                        writePtr++;
                    }
                    break;
            }
        }
    }
    return new DataView(tmpBuffer.buffer);
}
/**
 * PIZ compression
 * @param decoder defines the decoder to use
 * @returns a decompressed data view
 */
function UncompressPIZ(decoder) {
    const inDataView = decoder.viewer;
    const inOffset = { value: decoder.offset.value };
    const outBuffer = new Uint16Array(decoder.width * decoder.scanlineBlockSize * (decoder.channels * decoder.type));
    const bitmap = new Uint8Array(_exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_3__/* .BITMAP_SIZE */ .cQ);
    // Setup channel info
    let outBufferEnd = 0;
    const pizChannelData = new Array(decoder.channels);
    for (let i = 0; i < decoder.channels; i++) {
        pizChannelData[i] = {};
        pizChannelData[i]["start"] = outBufferEnd;
        pizChannelData[i]["end"] = pizChannelData[i]["start"];
        pizChannelData[i]["nx"] = decoder.width;
        pizChannelData[i]["ny"] = decoder.lines;
        pizChannelData[i]["size"] = decoder.type;
        outBufferEnd += pizChannelData[i].nx * pizChannelData[i].ny * pizChannelData[i].size;
    }
    // Read range compression data
    const minNonZero = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_2__/* .ParseUint16 */ .Jn)(inDataView, inOffset);
    const maxNonZero = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_2__/* .ParseUint16 */ .Jn)(inDataView, inOffset);
    if (maxNonZero >= _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_3__/* .BITMAP_SIZE */ .cQ) {
        throw new Error("Wrong PIZ_COMPRESSION BITMAP_SIZE");
    }
    if (minNonZero <= maxNonZero) {
        for (let i = 0; i < maxNonZero - minNonZero + 1; i++) {
            bitmap[i + minNonZero] = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_2__/* .ParseUint8 */ ._S)(inDataView, inOffset);
        }
    }
    // Reverse LUT
    const lut = new Uint16Array(_exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_3__/* .USHORT_RANGE */ .Ez);
    const maxValue = (0,_exrLoader_compression_huf_js__WEBPACK_IMPORTED_MODULE_0__/* .ReverseLutFromBitmap */ .FG)(bitmap, lut);
    const length = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_2__/* .ParseUint32 */ .PX)(inDataView, inOffset);
    // Huffman decoding
    (0,_exrLoader_compression_huf_js__WEBPACK_IMPORTED_MODULE_0__/* .HufUncompress */ .ZR)(decoder.array, inDataView, inOffset, length, outBuffer, outBufferEnd);
    // Wavelet decoding
    for (let i = 0; i < decoder.channels; ++i) {
        const cd = pizChannelData[i];
        for (let j = 0; j < pizChannelData[i].size; ++j) {
            (0,_exrLoader_compression_huf_js__WEBPACK_IMPORTED_MODULE_0__/* .Wav2Decode */ .tb)(outBuffer, cd.start + j, cd.nx, cd.size, cd.ny, cd.nx * cd.size, maxValue);
        }
    }
    // Expand the pixel data to their original range
    (0,_exrLoader_compression_huf_js__WEBPACK_IMPORTED_MODULE_0__/* .ApplyLut */ .Kq)(lut, outBuffer, outBufferEnd);
    // Rearrange the pixel data into the format expected by the caller.
    let tmpOffset = 0;
    const tmpBuffer = new Uint8Array(outBuffer.buffer.byteLength);
    for (let y = 0; y < decoder.lines; y++) {
        for (let c = 0; c < decoder.channels; c++) {
            const cd = pizChannelData[c];
            const n = cd.nx * cd.size;
            const cp = new Uint8Array(outBuffer.buffer, cd.end * _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_3__/* .INT16_SIZE */ .JH, n * _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_3__/* .INT16_SIZE */ .JH);
            tmpBuffer.set(cp, tmpOffset);
            tmpOffset += n * _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_3__/* .INT16_SIZE */ .JH;
            cd.end += n;
        }
    }
    return new DataView(tmpBuffer.buffer);
}
//# sourceMappingURL=exrLoader.compression.js.map

/***/ }),

/***/ 64942:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _: () => (/* binding */ DecodeRunLength)
/* harmony export */ });
/**
 * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
 * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
 * implementation.
 */
// /*
// Copyright (c) 2014 - 2017, Syoyo Fujita
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of the Syoyo Fujita nor the
//       names of its contributors may be used to endorse or promote products
//       derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// */
// // TinyEXR contains some OpenEXR code, which is licensed under ------------
// ///////////////////////////////////////////////////////////////////////////
// //
// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// // Digital Ltd. LLC
// //
// // All rights reserved.
// //
// // Redistribution and use in source and binary forms, with or without
// // modification, are permitted provided that the following conditions are
// // met:
// // *       Redistributions of source code must retain the above copyright
// // notice, this list of conditions and the following disclaimer.
// // *       Redistributions in binary form must reproduce the above
// // copyright notice, this list of conditions and the following disclaimer
// // in the documentation and/or other materials provided with the
// // distribution.
// // *       Neither the name of Industrial Light & Magic nor the names of
// // its contributors may be used to endorse or promote products derived
// // from this software without specific prior written permission.
// //
// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
// ///////////////////////////////////////////////////////////////////////////
// // End of OpenEXR license -------------------------------------------------
/** @internal */
function DecodeRunLength(source) {
    let size = source.byteLength;
    const out = new Array();
    let p = 0;
    const reader = new DataView(source);
    while (size > 0) {
        const l = reader.getInt8(p++);
        if (l < 0) {
            const count = -l;
            size -= count + 1;
            for (let i = 0; i < count; i++) {
                out.push(reader.getUint8(p++));
            }
        }
        else {
            const count = l;
            size -= 2;
            const value = reader.getUint8(p++);
            for (let i = 0; i < count + 1; i++) {
                out.push(value);
            }
        }
    }
    return out;
}
//# sourceMappingURL=exrLoader.compression.rle.js.map

/***/ }),

/***/ 9629:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   V: () => (/* binding */ EXROutputType),
/* harmony export */   u: () => (/* binding */ ExrLoaderGlobalConfiguration)
/* harmony export */ });
var EXROutputType;
(function (EXROutputType) {
    EXROutputType[EXROutputType["Float"] = 0] = "Float";
    EXROutputType[EXROutputType["HalfFloat"] = 1] = "HalfFloat";
})(EXROutputType || (EXROutputType = {}));
/**
 * Class used to store configuration of the exr loader
 */
class ExrLoaderGlobalConfiguration {
}
/**
 * Defines the default output type to use (Half float by default)
 */
ExrLoaderGlobalConfiguration.DefaultOutputType = EXROutputType.HalfFloat;
/**
 * Url to use to load the fflate library (for zip decompression)
 */
ExrLoaderGlobalConfiguration.FFLATEUrl = "https://unpkg.com/fflate@0.8.2";
//# sourceMappingURL=exrLoader.configuration.js.map

/***/ }),

/***/ 86700:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Ff: () => (/* binding */ ParseFloat32),
/* harmony export */   Jn: () => (/* binding */ ParseUint16),
/* harmony export */   KA: () => (/* binding */ InterleaveScalar),
/* harmony export */   LD: () => (/* binding */ ParseFloat16),
/* harmony export */   PX: () => (/* binding */ ParseUint32),
/* harmony export */   Sn: () => (/* binding */ DecodeFloat32),
/* harmony export */   T$: () => (/* binding */ ParseNullTerminatedString),
/* harmony export */   XE: () => (/* binding */ Predictor),
/* harmony export */   _S: () => (/* binding */ ParseUint8),
/* harmony export */   cL: () => (/* binding */ ParseInt32),
/* harmony export */   fz: () => (/* binding */ ParseUint8Array),
/* harmony export */   he: () => (/* binding */ CompressionCodes),
/* harmony export */   tB: () => (/* binding */ ParseInt64),
/* harmony export */   zX: () => (/* binding */ ParseValue)
/* harmony export */ });
/* harmony import */ var _Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84867);
/* harmony import */ var _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3687);


/**
 * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
 * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
 * implementation.
 */
// /*
// Copyright (c) 2014 - 2017, Syoyo Fujita
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of the Syoyo Fujita nor the
//       names of its contributors may be used to endorse or promote products
//       derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// */
// // TinyEXR contains some OpenEXR code, which is licensed under ------------
// ///////////////////////////////////////////////////////////////////////////
// //
// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// // Digital Ltd. LLC
// //
// // All rights reserved.
// //
// // Redistribution and use in source and binary forms, with or without
// // modification, are permitted provided that the following conditions are
// // met:
// // *       Redistributions of source code must retain the above copyright
// // notice, this list of conditions and the following disclaimer.
// // *       Redistributions in binary form must reproduce the above
// // copyright notice, this list of conditions and the following disclaimer
// // in the documentation and/or other materials provided with the
// // distribution.
// // *       Neither the name of Industrial Light & Magic nor the names of
// // its contributors may be used to endorse or promote products derived
// // from this software without specific prior written permission.
// //
// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
// ///////////////////////////////////////////////////////////////////////////
// // End of OpenEXR license -------------------------------------------------
var CompressionCodes;
(function (CompressionCodes) {
    CompressionCodes[CompressionCodes["NO_COMPRESSION"] = 0] = "NO_COMPRESSION";
    CompressionCodes[CompressionCodes["RLE_COMPRESSION"] = 1] = "RLE_COMPRESSION";
    CompressionCodes[CompressionCodes["ZIPS_COMPRESSION"] = 2] = "ZIPS_COMPRESSION";
    CompressionCodes[CompressionCodes["ZIP_COMPRESSION"] = 3] = "ZIP_COMPRESSION";
    CompressionCodes[CompressionCodes["PIZ_COMPRESSION"] = 4] = "PIZ_COMPRESSION";
    CompressionCodes[CompressionCodes["PXR24_COMPRESSION"] = 5] = "PXR24_COMPRESSION";
})(CompressionCodes || (CompressionCodes = {}));
var LineOrders;
(function (LineOrders) {
    LineOrders[LineOrders["INCREASING_Y"] = 0] = "INCREASING_Y";
    LineOrders[LineOrders["DECREASING_Y"] = 1] = "DECREASING_Y";
})(LineOrders || (LineOrders = {}));
const _tables = _GenerateTables();
// Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf
function _GenerateTables() {
    // float32 to float16 helpers
    const buffer = new ArrayBuffer(4);
    const floatView = new Float32Array(buffer);
    const uint32View = new Uint32Array(buffer);
    const baseTable = new Uint32Array(512);
    const shiftTable = new Uint32Array(512);
    for (let i = 0; i < 256; ++i) {
        const e = i - 127;
        // very small number (0, -0)
        if (e < -27) {
            baseTable[i] = 0x0000;
            baseTable[i | 0x100] = 0x8000;
            shiftTable[i] = 24;
            shiftTable[i | 0x100] = 24;
            // small number (denorm)
        }
        else if (e < -14) {
            baseTable[i] = 0x0400 >> (-e - 14);
            baseTable[i | 0x100] = (0x0400 >> (-e - 14)) | 0x8000;
            shiftTable[i] = -e - 1;
            shiftTable[i | 0x100] = -e - 1;
            // normal number
        }
        else if (e <= 15) {
            baseTable[i] = (e + 15) << 10;
            baseTable[i | 0x100] = ((e + 15) << 10) | 0x8000;
            shiftTable[i] = 13;
            shiftTable[i | 0x100] = 13;
            // large number (Infinity, -Infinity)
        }
        else if (e < 128) {
            baseTable[i] = 0x7c00;
            baseTable[i | 0x100] = 0xfc00;
            shiftTable[i] = 24;
            shiftTable[i | 0x100] = 24;
            // stay (NaN, Infinity, -Infinity)
        }
        else {
            baseTable[i] = 0x7c00;
            baseTable[i | 0x100] = 0xfc00;
            shiftTable[i] = 13;
            shiftTable[i | 0x100] = 13;
        }
    }
    // float16 to float32 helpers
    const mantissaTable = new Uint32Array(2048);
    const exponentTable = new Uint32Array(64);
    const offsetTable = new Uint32Array(64);
    for (let i = 1; i < 1024; ++i) {
        let m = i << 13; // zero pad mantissa bits
        let e = 0; // zero exponent
        // normalized
        while ((m & 0x00800000) === 0) {
            m <<= 1;
            e -= 0x00800000; // decrement exponent
        }
        m &= ~0x00800000; // clear leading 1 bit
        e += 0x38800000; // adjust bias
        mantissaTable[i] = m | e;
    }
    for (let i = 1024; i < 2048; ++i) {
        mantissaTable[i] = 0x38000000 + ((i - 1024) << 13);
    }
    for (let i = 1; i < 31; ++i) {
        exponentTable[i] = i << 23;
    }
    exponentTable[31] = 0x47800000;
    exponentTable[32] = 0x80000000;
    for (let i = 33; i < 63; ++i) {
        exponentTable[i] = 0x80000000 + ((i - 32) << 23);
    }
    exponentTable[63] = 0xc7800000;
    for (let i = 1; i < 64; ++i) {
        if (i !== 32) {
            offsetTable[i] = 1024;
        }
    }
    return {
        floatView: floatView,
        uint32View: uint32View,
        baseTable: baseTable,
        shiftTable: shiftTable,
        mantissaTable: mantissaTable,
        exponentTable: exponentTable,
        offsetTable: offsetTable,
    };
}
/**
 * Parse a null terminated string from the buffer
 * @param buffer buffer to read from
 * @param offset current offset in the buffer
 * @returns a string
 */
function ParseNullTerminatedString(buffer, offset) {
    const uintBuffer = new Uint8Array(buffer);
    let endOffset = 0;
    while (uintBuffer[offset.value + endOffset] != 0) {
        endOffset += 1;
    }
    const stringValue = new TextDecoder().decode(uintBuffer.slice(offset.value, offset.value + endOffset));
    offset.value = offset.value + endOffset + 1;
    return stringValue;
}
/**
 * Parse an int32 from the buffer
 * @param dataView dataview on the data
 * @param offset current offset in the data view
 * @returns an int32
 */
function ParseInt32(dataView, offset) {
    const value = dataView.getInt32(offset.value, true);
    offset.value += _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .INT32_SIZE */ .b7;
    return value;
}
/**
 * Parse an uint32 from the buffer
 * @param dataView data view to read from
 * @param offset offset in the data view
 * @returns an uint32
 */
function ParseUint32(dataView, offset) {
    const value = dataView.getUint32(offset.value, true);
    offset.value += _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .INT32_SIZE */ .b7;
    return value;
}
/**
 * Parse an uint8 from the buffer
 * @param dataView dataview on the data
 * @param offset current offset in the data view
 * @returns an uint8
 */
function ParseUint8(dataView, offset) {
    const value = dataView.getUint8(offset.value);
    offset.value += _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .INT8_SIZE */ .aN;
    return value;
}
/**
 * Parse an uint16 from the buffer
 * @param dataView dataview on the data
 * @param offset current offset in the data view
 * @returns an uint16
 */
function ParseUint16(dataView, offset) {
    const value = dataView.getUint16(offset.value, true);
    offset.value += _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .INT16_SIZE */ .JH;
    return value;
}
/**
 * Parse an uint8 from an array buffer
 * @param array array buffer
 * @param offset current offset in the data view
 * @returns an uint16
 */
function ParseUint8Array(array, offset) {
    const value = array[offset.value];
    offset.value += _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .INT8_SIZE */ .aN;
    return value;
}
/**
 * Parse an int64 from the buffer
 * @param dataView dataview on the data
 * @param offset current offset in the data view
 * @returns an int64
 */
function ParseInt64(dataView, offset) {
    let int;
    if ("getBigInt64" in DataView.prototype) {
        int = Number(dataView.getBigInt64(offset.value, true));
    }
    else {
        int = dataView.getUint32(offset.value + 4, true) + Number(dataView.getUint32(offset.value, true) << 32);
    }
    offset.value += _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .ULONG_SIZE */ .Kl;
    return int;
}
/**
 * Parse a float32 from the buffer
 * @param dataView dataview on the data
 * @param offset current offset in the data view
 * @returns a float32
 */
function ParseFloat32(dataView, offset) {
    const value = dataView.getFloat32(offset.value, true);
    offset.value += _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_1__/* .FLOAT32_SIZE */ .Y3;
    return value;
}
/**
 * Parse a float16 from the buffer
 * @param dataView dataview on the data
 * @param offset current offset in the data view
 * @returns a float16
 */
function ParseFloat16(dataView, offset) {
    return DecodeFloat16(ParseUint16(dataView, offset));
}
function DecodeFloat16(binary) {
    const exponent = (binary & 0x7c00) >> 10;
    const fraction = binary & 0x03ff;
    return ((binary >> 15 ? -1 : 1) *
        (exponent ? (exponent === 0x1f ? (fraction ? NaN : Infinity) : Math.pow(2, exponent - 15) * (1 + fraction / 0x400)) : 6.103515625e-5 * (fraction / 0x400)));
}
function ToHalfFloat(value) {
    if (Math.abs(value) > 65504) {
        throw new Error("Value out of range.Consider using float instead of half-float.");
    }
    value = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)(value, -65504, 65504);
    _tables.floatView[0] = value;
    const f = _tables.uint32View[0];
    const e = (f >> 23) & 0x1ff;
    return _tables.baseTable[e] + ((f & 0x007fffff) >> _tables.shiftTable[e]);
}
/**
 * Decode a float32 from the buffer
 * @param dataView dataview on the data
 * @param offset current offset in the data view
 * @returns a float32
 */
function DecodeFloat32(dataView, offset) {
    return ToHalfFloat(ParseFloat32(dataView, offset));
}
function ParseFixedLengthString(buffer, offset, size) {
    const stringValue = new TextDecoder().decode(new Uint8Array(buffer).slice(offset.value, offset.value + size));
    offset.value = offset.value + size;
    return stringValue;
}
function ParseRational(dataView, offset) {
    const x = ParseInt32(dataView, offset);
    const y = ParseUint32(dataView, offset);
    return [x, y];
}
function ParseTimecode(dataView, offset) {
    const x = ParseUint32(dataView, offset);
    const y = ParseUint32(dataView, offset);
    return [x, y];
}
function ParseV2f(dataView, offset) {
    const x = ParseFloat32(dataView, offset);
    const y = ParseFloat32(dataView, offset);
    return [x, y];
}
function ParseV3f(dataView, offset) {
    const x = ParseFloat32(dataView, offset);
    const y = ParseFloat32(dataView, offset);
    const z = ParseFloat32(dataView, offset);
    return [x, y, z];
}
function ParseChlist(dataView, offset, size) {
    const startOffset = offset.value;
    const channels = [];
    while (offset.value < startOffset + size - 1) {
        const name = ParseNullTerminatedString(dataView.buffer, offset);
        const pixelType = ParseInt32(dataView, offset);
        const pLinear = ParseUint8(dataView, offset);
        offset.value += 3; // reserved, three chars
        const xSampling = ParseInt32(dataView, offset);
        const ySampling = ParseInt32(dataView, offset);
        channels.push({
            name: name,
            pixelType: pixelType,
            pLinear: pLinear,
            xSampling: xSampling,
            ySampling: ySampling,
        });
    }
    offset.value += 1;
    return channels;
}
function ParseChromaticities(dataView, offset) {
    const redX = ParseFloat32(dataView, offset);
    const redY = ParseFloat32(dataView, offset);
    const greenX = ParseFloat32(dataView, offset);
    const greenY = ParseFloat32(dataView, offset);
    const blueX = ParseFloat32(dataView, offset);
    const blueY = ParseFloat32(dataView, offset);
    const whiteX = ParseFloat32(dataView, offset);
    const whiteY = ParseFloat32(dataView, offset);
    return { redX: redX, redY: redY, greenX: greenX, greenY: greenY, blueX: blueX, blueY: blueY, whiteX: whiteX, whiteY: whiteY };
}
function ParseCompression(dataView, offset) {
    return ParseUint8(dataView, offset);
}
function ParseBox2i(dataView, offset) {
    const xMin = ParseInt32(dataView, offset);
    const yMin = ParseInt32(dataView, offset);
    const xMax = ParseInt32(dataView, offset);
    const yMax = ParseInt32(dataView, offset);
    return { xMin: xMin, yMin: yMin, xMax: xMax, yMax: yMax };
}
function ParseLineOrder(dataView, offset) {
    const lineOrder = ParseUint8(dataView, offset);
    return LineOrders[lineOrder];
}
/**
 * Parse a value from the data view
 * @param dataView defines the data view to read from
 * @param offset defines the current offset in the data view
 * @param type defines the type of the value to read
 * @param size defines the size of the value to read
 * @returns the parsed value
 */
function ParseValue(dataView, offset, type, size) {
    switch (type) {
        case "string":
        case "stringvector":
        case "iccProfile":
            return ParseFixedLengthString(dataView.buffer, offset, size);
        case "chlist":
            return ParseChlist(dataView, offset, size);
        case "chromaticities":
            return ParseChromaticities(dataView, offset);
        case "compression":
            return ParseCompression(dataView, offset);
        case "box2i":
            return ParseBox2i(dataView, offset);
        case "lineOrder":
            return ParseLineOrder(dataView, offset);
        case "float":
            return ParseFloat32(dataView, offset);
        case "v2f":
            return ParseV2f(dataView, offset);
        case "v3f":
            return ParseV3f(dataView, offset);
        case "int":
            return ParseInt32(dataView, offset);
        case "rational":
            return ParseRational(dataView, offset);
        case "timecode":
            return ParseTimecode(dataView, offset);
        case "preview":
            offset.value += size;
            return "skipped";
        default:
            offset.value += size;
            return undefined;
    }
}
/**
 * Revert the endianness of the data
 * @param source defines the source
 */
function Predictor(source) {
    for (let t = 1; t < source.length; t++) {
        const d = source[t - 1] + source[t] - 128;
        source[t] = d;
    }
}
/**
 * Interleave pixels
 * @param source defines the data source
 * @param out defines the output
 */
function InterleaveScalar(source, out) {
    let t1 = 0;
    let t2 = Math.floor((source.length + 1) / 2);
    let s = 0;
    const stop = source.length - 1;
    // eslint-disable-next-line no-constant-condition
    while (true) {
        if (s > stop) {
            break;
        }
        out[s++] = source[t1++];
        if (s > stop) {
            break;
        }
        out[s++] = source[t2++];
    }
}
//# sourceMappingURL=exrLoader.core.js.map

/***/ }),

/***/ 50863:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   d: () => (/* binding */ CreateDecoderAsync),
/* harmony export */   u: () => (/* binding */ ScanData)
/* harmony export */ });
/* harmony import */ var _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86700);
/* harmony import */ var _exrLoader_compression_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(52093);
/* harmony import */ var _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3687);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(998);
/* harmony import */ var _exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9629);






/**
 * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
 * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
 * implementation.
 */
// /*
// Copyright (c) 2014 - 2017, Syoyo Fujita
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of the Syoyo Fujita nor the
//       names of its contributors may be used to endorse or promote products
//       derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// */
// // TinyEXR contains some OpenEXR code, which is licensed under ------------
// ///////////////////////////////////////////////////////////////////////////
// //
// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// // Digital Ltd. LLC
// //
// // All rights reserved.
// //
// // Redistribution and use in source and binary forms, with or without
// // modification, are permitted provided that the following conditions are
// // met:
// // *       Redistributions of source code must retain the above copyright
// // notice, this list of conditions and the following disclaimer.
// // *       Redistributions in binary form must reproduce the above
// // copyright notice, this list of conditions and the following disclaimer
// // in the documentation and/or other materials provided with the
// // distribution.
// // *       Neither the name of Industrial Light & Magic nor the names of
// // its contributors may be used to endorse or promote products derived
// // from this software without specific prior written permission.
// //
// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
// ///////////////////////////////////////////////////////////////////////////
// // End of OpenEXR license -------------------------------------------------
/**
 * Create a decoder for the exr file
 * @param header header of the exr file
 * @param dataView dataview of the exr file
 * @param offset current offset
 * @param outputType expected output type (float or half float)
 * @returns a promise that resolves with the decoder
 */
async function CreateDecoderAsync(header, dataView, offset, outputType) {
    const decoder = {
        size: 0,
        viewer: dataView,
        array: new Uint8Array(dataView.buffer),
        offset: offset,
        width: header.dataWindow.xMax - header.dataWindow.xMin + 1,
        height: header.dataWindow.yMax - header.dataWindow.yMin + 1,
        channels: header.channels.length,
        channelLineOffsets: {},
        scanOrder: () => 0,
        bytesPerLine: 0,
        outLineWidth: 0,
        lines: 0,
        scanlineBlockSize: 0,
        inputSize: null,
        type: 0,
        uncompress: null,
        getter: () => 0,
        format: 5,
        outputChannels: 0,
        decodeChannels: {},
        blockCount: null,
        byteArray: null,
        linearSpace: false,
        textureType: 0,
    };
    switch (header.compression) {
        case _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .CompressionCodes */ .he.NO_COMPRESSION:
            decoder.lines = 1;
            decoder.uncompress = _exrLoader_compression_js__WEBPACK_IMPORTED_MODULE_1__/* .UncompressRAW */ .S4;
            break;
        case _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .CompressionCodes */ .he.RLE_COMPRESSION:
            decoder.lines = 1;
            decoder.uncompress = _exrLoader_compression_js__WEBPACK_IMPORTED_MODULE_1__/* .UncompressRLE */ .r;
            break;
        case _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .CompressionCodes */ .he.ZIPS_COMPRESSION:
            decoder.lines = 1;
            decoder.uncompress = _exrLoader_compression_js__WEBPACK_IMPORTED_MODULE_1__/* .UncompressZIP */ .VE;
            await _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools */ .S0.LoadScriptAsync(_exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__/* .ExrLoaderGlobalConfiguration */ .u.FFLATEUrl);
            break;
        case _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .CompressionCodes */ .he.ZIP_COMPRESSION:
            decoder.lines = 16;
            decoder.uncompress = _exrLoader_compression_js__WEBPACK_IMPORTED_MODULE_1__/* .UncompressZIP */ .VE;
            await _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools */ .S0.LoadScriptAsync(_exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__/* .ExrLoaderGlobalConfiguration */ .u.FFLATEUrl);
            break;
        case _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .CompressionCodes */ .he.PIZ_COMPRESSION:
            decoder.lines = 32;
            decoder.uncompress = _exrLoader_compression_js__WEBPACK_IMPORTED_MODULE_1__/* .UncompressPIZ */ .tg;
            break;
        case _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .CompressionCodes */ .he.PXR24_COMPRESSION:
            decoder.lines = 16;
            decoder.uncompress = _exrLoader_compression_js__WEBPACK_IMPORTED_MODULE_1__/* .UncompressPXR */ ._k;
            await _Misc_tools_js__WEBPACK_IMPORTED_MODULE_3__/* .Tools */ .S0.LoadScriptAsync(_exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__/* .ExrLoaderGlobalConfiguration */ .u.FFLATEUrl);
            break;
        default:
            throw new Error(_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .CompressionCodes */ .he[header.compression] + " is unsupported");
    }
    decoder.scanlineBlockSize = decoder.lines;
    const channels = {};
    for (const channel of header.channels) {
        switch (channel.name) {
            case "Y":
            case "R":
            case "G":
            case "B":
            case "A":
                channels[channel.name] = true;
                decoder.type = channel.pixelType;
        }
    }
    // RGB images will be converted to RGBA format, preventing software emulation in select devices.
    let fillAlpha = false;
    if (channels.R && channels.G && channels.B) {
        fillAlpha = !channels.A;
        decoder.outputChannels = 4;
        decoder.decodeChannels = { R: 0, G: 1, B: 2, A: 3 };
    }
    else if (channels.Y) {
        decoder.outputChannels = 1;
        decoder.decodeChannels = { Y: 0 };
    }
    else {
        throw new Error("EXRLoader.parse: file contains unsupported data channels.");
    }
    if (decoder.type === 1) {
        // half
        switch (outputType) {
            case _exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__/* .EXROutputType */ .V.Float:
                decoder.getter = _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseFloat16 */ .LD;
                decoder.inputSize = _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_2__/* .INT16_SIZE */ .JH;
                break;
            case _exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__/* .EXROutputType */ .V.HalfFloat:
                decoder.getter = _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseUint16 */ .Jn;
                decoder.inputSize = _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_2__/* .INT16_SIZE */ .JH;
                break;
        }
    }
    else if (decoder.type === 2) {
        // float
        switch (outputType) {
            case _exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__/* .EXROutputType */ .V.Float:
                decoder.getter = _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseFloat32 */ .Ff;
                decoder.inputSize = _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_2__/* .FLOAT32_SIZE */ .Y3;
                break;
            case _exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__/* .EXROutputType */ .V.HalfFloat:
                decoder.getter = _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .DecodeFloat32 */ .Sn;
                decoder.inputSize = _exrLoader_interfaces_js__WEBPACK_IMPORTED_MODULE_2__/* .FLOAT32_SIZE */ .Y3;
        }
    }
    else {
        throw new Error("Unsupported pixelType " + decoder.type + " for " + header.compression);
    }
    decoder.blockCount = decoder.height / decoder.scanlineBlockSize;
    for (let i = 0; i < decoder.blockCount; i++) {
        (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseInt64 */ .tB)(dataView, offset); // scanlineOffset
    }
    // we should be passed the scanline offset table, ready to start reading pixel data.
    const size = decoder.width * decoder.height * decoder.outputChannels;
    switch (outputType) {
        case _exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__/* .EXROutputType */ .V.Float:
            decoder.byteArray = new Float32Array(size);
            decoder.textureType = 1;
            // Fill initially with 1s for the alpha value if the texture is not RGBA, RGB values will be overwritten
            if (fillAlpha) {
                decoder.byteArray.fill(1, 0, size);
            }
            break;
        case _exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_4__/* .EXROutputType */ .V.HalfFloat:
            decoder.byteArray = new Uint16Array(size);
            decoder.textureType = 2;
            if (fillAlpha) {
                decoder.byteArray.fill(0x3c00, 0, size); // Uint16Array holds half float data, 0x3C00 is 1
            }
            break;
        default:
            throw new Error("Unsupported type: " + outputType);
    }
    let byteOffset = 0;
    for (const channel of header.channels) {
        if (decoder.decodeChannels[channel.name] !== undefined) {
            decoder.channelLineOffsets[channel.name] = byteOffset * decoder.width;
        }
        byteOffset += channel.pixelType * 2;
    }
    decoder.bytesPerLine = decoder.width * byteOffset;
    decoder.outLineWidth = decoder.width * decoder.outputChannels;
    if (header.lineOrder === "INCREASING_Y") {
        decoder.scanOrder = (y) => y;
    }
    else {
        decoder.scanOrder = (y) => decoder.height - 1 - y;
    }
    if (decoder.outputChannels == 4) {
        decoder.format = 5;
        decoder.linearSpace = true;
    }
    else {
        decoder.format = 6;
        decoder.linearSpace = false;
    }
    return decoder;
}
/**
 * Scan the data of the exr file
 * @param decoder decoder to use
 * @param header header of the exr file
 * @param dataView dataview of the exr file
 * @param offset current offset
 */
function ScanData(decoder, header, dataView, offset) {
    const tmpOffset = { value: 0 };
    for (let scanlineBlockIdx = 0; scanlineBlockIdx < decoder.height / decoder.scanlineBlockSize; scanlineBlockIdx++) {
        const line = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseInt32 */ .cL)(dataView, offset) - header.dataWindow.yMin; // line_no
        decoder.size = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_0__/* .ParseUint32 */ .PX)(dataView, offset); // data_len
        decoder.lines = line + decoder.scanlineBlockSize > decoder.height ? decoder.height - line : decoder.scanlineBlockSize;
        const isCompressed = decoder.size < decoder.lines * decoder.bytesPerLine;
        const viewer = isCompressed && decoder.uncompress ? decoder.uncompress(decoder) : (0,_exrLoader_compression_js__WEBPACK_IMPORTED_MODULE_1__/* .UncompressRAW */ .S4)(decoder);
        offset.value += decoder.size;
        for (let line_y = 0; line_y < decoder.scanlineBlockSize; line_y++) {
            const scan_y = scanlineBlockIdx * decoder.scanlineBlockSize;
            const true_y = line_y + decoder.scanOrder(scan_y);
            if (true_y >= decoder.height) {
                continue;
            }
            const lineOffset = line_y * decoder.bytesPerLine;
            const outLineOffset = (decoder.height - 1 - true_y) * decoder.outLineWidth;
            for (let channelID = 0; channelID < decoder.channels; channelID++) {
                const name = header.channels[channelID].name;
                const lOff = decoder.channelLineOffsets[name];
                const cOff = decoder.decodeChannels[name];
                if (cOff === undefined) {
                    continue;
                }
                tmpOffset.value = lineOffset + lOff;
                for (let x = 0; x < decoder.width; x++) {
                    const outIndex = outLineOffset + x * decoder.outputChannels + cOff;
                    if (decoder.byteArray) {
                        decoder.byteArray[outIndex] = decoder.getter(viewer, tmpOffset);
                    }
                }
            }
        }
    }
}
//# sourceMappingURL=exrLoader.decoder.js.map

/***/ }),

/***/ 98078:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   V: () => (/* binding */ GetExrHeader)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);
/* harmony import */ var _exrLoader_core_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86700);
/* eslint-disable @typescript-eslint/naming-convention */


/**
 * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
 * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
 * implementation.
 */
// /*
// Copyright (c) 2014 - 2017, Syoyo Fujita
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of the Syoyo Fujita nor the
//       names of its contributors may be used to endorse or promote products
//       derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// */
// // TinyEXR contains some OpenEXR code, which is licensed under ------------
// ///////////////////////////////////////////////////////////////////////////
// //
// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// // Digital Ltd. LLC
// //
// // All rights reserved.
// //
// // Redistribution and use in source and binary forms, with or without
// // modification, are permitted provided that the following conditions are
// // met:
// // *       Redistributions of source code must retain the above copyright
// // notice, this list of conditions and the following disclaimer.
// // *       Redistributions in binary form must reproduce the above
// // copyright notice, this list of conditions and the following disclaimer
// // in the documentation and/or other materials provided with the
// // distribution.
// // *       Neither the name of Industrial Light & Magic nor the names of
// // its contributors may be used to endorse or promote products derived
// // from this software without specific prior written permission.
// //
// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
// ///////////////////////////////////////////////////////////////////////////
// // End of OpenEXR license -------------------------------------------------
const EXR_MAGIC = 20000630;
/**
 * Gets the EXR header
 * @param dataView defines the data view to read from
 * @param offset defines the offset to start reading from
 * @returns the header
 */
function GetExrHeader(dataView, offset) {
    if (dataView.getUint32(0, true) != EXR_MAGIC) {
        throw new Error("Incorrect OpenEXR format");
    }
    const version = dataView.getUint8(4);
    const specData = dataView.getUint8(5); // fullMask
    const spec = {
        singleTile: !!(specData & 2),
        longName: !!(specData & 4),
        deepFormat: !!(specData & 8),
        multiPart: !!(specData & 16),
    };
    offset.value = 8;
    const headerData = {};
    let keepReading = true;
    while (keepReading) {
        const attributeName = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_1__/* .ParseNullTerminatedString */ .T$)(dataView.buffer, offset);
        if (!attributeName) {
            keepReading = false;
        }
        else {
            const attributeType = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_1__/* .ParseNullTerminatedString */ .T$)(dataView.buffer, offset);
            const attributeSize = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_1__/* .ParseUint32 */ .PX)(dataView, offset);
            const attributeValue = (0,_exrLoader_core_js__WEBPACK_IMPORTED_MODULE_1__/* .ParseValue */ .zX)(dataView, offset, attributeType, attributeSize);
            if (attributeValue === undefined) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Unknown header attribute type ${attributeType}'.`);
            }
            else {
                headerData[attributeName] = attributeValue;
            }
        }
    }
    if ((specData & ~0x04) != 0) {
        throw new Error("Unsupported file format");
    }
    return { version: version, spec: spec, ...headerData };
}
//# sourceMappingURL=exrLoader.header.js.map

/***/ }),

/***/ 3687:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A_: () => (/* binding */ HUF_DECSIZE),
/* harmony export */   Ez: () => (/* binding */ USHORT_RANGE),
/* harmony export */   Hh: () => (/* binding */ LONG_ZEROCODE_RUN),
/* harmony export */   JH: () => (/* binding */ INT16_SIZE),
/* harmony export */   Kl: () => (/* binding */ ULONG_SIZE),
/* harmony export */   LK: () => (/* binding */ HUF_DECBITS),
/* harmony export */   LU: () => (/* binding */ SHORT_ZEROCODE_RUN),
/* harmony export */   U0: () => (/* binding */ HUF_ENCSIZE),
/* harmony export */   Y3: () => (/* binding */ FLOAT32_SIZE),
/* harmony export */   aN: () => (/* binding */ INT8_SIZE),
/* harmony export */   b7: () => (/* binding */ INT32_SIZE),
/* harmony export */   cQ: () => (/* binding */ BITMAP_SIZE),
/* harmony export */   gn: () => (/* binding */ SHORTEST_LONG_RUN),
/* harmony export */   lR: () => (/* binding */ HUF_DECMASK)
/* harmony export */ });
/* unused harmony export HUF_ENCBITS */
const INT32_SIZE = 4;
const FLOAT32_SIZE = 4;
const INT8_SIZE = 1;
const INT16_SIZE = 2;
const ULONG_SIZE = 8;
const USHORT_RANGE = 1 << 16;
const BITMAP_SIZE = USHORT_RANGE >> 3;
const HUF_ENCBITS = 16;
const HUF_DECBITS = 14;
const HUF_ENCSIZE = (1 << HUF_ENCBITS) + 1;
const HUF_DECSIZE = 1 << HUF_DECBITS;
const HUF_DECMASK = HUF_DECSIZE - 1;
const SHORT_ZEROCODE_RUN = 59;
const LONG_ZEROCODE_RUN = 63;
const SHORTEST_LONG_RUN = 2 + LONG_ZEROCODE_RUN - SHORT_ZEROCODE_RUN;
//# sourceMappingURL=exrLoader.interfaces.js.map

/***/ }),

/***/ 41427:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _BasisTextureLoader: () => (/* binding */ _BasisTextureLoader)
/* harmony export */ });
/* harmony import */ var _Misc_basis_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59057);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(998);


/**
 * Loader for .basis file format
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _BasisTextureLoader {
    constructor() {
        /**
         * Defines whether the loader supports cascade loading the different faces.
         */
        this.supportCascades = false;
    }
    /**
     * Uploads the cube texture data to the WebGL texture. It has already been bound.
     * @param data contains the texture data
     * @param texture defines the BabylonJS internal texture
     * @param createPolynomials will be true if polynomials have been requested
     * @param onLoad defines the callback to trigger once the texture is ready
     * @param onError defines the callback to trigger in case of error
     */
    loadCubeData(data, texture, createPolynomials, onLoad, onError) {
        if (Array.isArray(data)) {
            return;
        }
        const caps = texture.getEngine().getCaps();
        const transcodeConfig = {
            supportedCompressionFormats: {
                etc1: caps.etc1 ? true : false,
                s3tc: caps.s3tc ? true : false,
                pvrtc: caps.pvrtc ? true : false,
                etc2: caps.etc2 ? true : false,
                astc: caps.astc ? true : false,
                bc7: caps.bptc ? true : false,
            },
        };
        (0,_Misc_basis_js__WEBPACK_IMPORTED_MODULE_0__/* .TranscodeAsync */ .yk)(data, transcodeConfig)
            .then((result) => {
            const hasMipmap = result.fileInfo.images[0].levels.length > 1 && texture.generateMipMaps;
            (0,_Misc_basis_js__WEBPACK_IMPORTED_MODULE_0__/* .LoadTextureFromTranscodeResult */ .aB)(texture, result);
            texture.getEngine()._setCubeMapTextureParams(texture, hasMipmap);
            texture.isReady = true;
            texture.onLoadedObservable.notifyObservers(texture);
            texture.onLoadedObservable.clear();
            if (onLoad) {
                onLoad();
            }
        })
            .catch((err) => {
            const errorMessage = "Failed to transcode Basis file, transcoding may not be supported on this device";
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.Warn(errorMessage);
            texture.isReady = true;
            if (onError) {
                onError(err);
            }
        });
    }
    /**
     * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
     * @param data contains the texture data
     * @param texture defines the BabylonJS internal texture
     * @param callback defines the method to call once ready to upload
     */
    loadData(data, texture, callback) {
        const caps = texture.getEngine().getCaps();
        const transcodeConfig = {
            supportedCompressionFormats: {
                etc1: caps.etc1 ? true : false,
                s3tc: caps.s3tc ? true : false,
                pvrtc: caps.pvrtc ? true : false,
                etc2: caps.etc2 ? true : false,
                astc: caps.astc ? true : false,
                bc7: caps.bptc ? true : false,
            },
        };
        (0,_Misc_basis_js__WEBPACK_IMPORTED_MODULE_0__/* .TranscodeAsync */ .yk)(data, transcodeConfig)
            .then((result) => {
            const rootImage = result.fileInfo.images[0].levels[0];
            const hasMipmap = result.fileInfo.images[0].levels.length > 1 && texture.generateMipMaps;
            callback(rootImage.width, rootImage.height, hasMipmap, result.format !== -1, () => {
                (0,_Misc_basis_js__WEBPACK_IMPORTED_MODULE_0__/* .LoadTextureFromTranscodeResult */ .aB)(texture, result);
            });
        })
            .catch((err) => {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.Warn("Failed to transcode Basis file, transcoding may not be supported on this device");
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.Warn(`Failed to transcode Basis file: ${err}`);
            callback(0, 0, false, false, () => { }, true);
        });
    }
}
//# sourceMappingURL=basisTextureLoader.js.map

/***/ }),

/***/ 50994:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _DDSTextureLoader: () => (/* binding */ _DDSTextureLoader)
/* harmony export */ });
/* harmony import */ var _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77517);
/* harmony import */ var _Misc_dds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36464);


/**
 * Implementation of the DDS Texture Loader.
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _DDSTextureLoader {
    constructor() {
        /**
         * Defines whether the loader supports cascade loading the different faces.
         */
        this.supportCascades = true;
    }
    /**
     * Uploads the cube texture data to the WebGL texture. It has already been bound.
     * @param imgs contains the cube maps
     * @param texture defines the BabylonJS internal texture
     * @param createPolynomials will be true if polynomials have been requested
     * @param onLoad defines the callback to trigger once the texture is ready
     */
    loadCubeData(imgs, texture, createPolynomials, onLoad) {
        const engine = texture.getEngine();
        let info;
        let loadMipmap = false;
        let maxLevel = 1000;
        if (Array.isArray(imgs)) {
            for (let index = 0; index < imgs.length; index++) {
                const data = imgs[index];
                info = _Misc_dds_js__WEBPACK_IMPORTED_MODULE_1__.DDSTools.GetDDSInfo(data);
                texture.width = info.width;
                texture.height = info.height;
                loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && texture.generateMipMaps;
                engine._unpackFlipY(info.isCompressed);
                _Misc_dds_js__WEBPACK_IMPORTED_MODULE_1__.DDSTools.UploadDDSLevels(engine, texture, data, info, loadMipmap, 6, -1, index);
                if (!info.isFourCC && info.mipmapCount === 1) {
                    engine.generateMipMapsForCubemap(texture);
                }
                else {
                    maxLevel = info.mipmapCount - 1;
                }
            }
        }
        else {
            const data = imgs;
            info = _Misc_dds_js__WEBPACK_IMPORTED_MODULE_1__.DDSTools.GetDDSInfo(data);
            texture.width = info.width;
            texture.height = info.height;
            if (createPolynomials) {
                info.sphericalPolynomial = new _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_0__/* .SphericalPolynomial */ .Q();
            }
            loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && texture.generateMipMaps;
            engine._unpackFlipY(info.isCompressed);
            _Misc_dds_js__WEBPACK_IMPORTED_MODULE_1__.DDSTools.UploadDDSLevels(engine, texture, data, info, loadMipmap, 6);
            if (!info.isFourCC && info.mipmapCount === 1) {
                // Do not unbind as we still need to set the parameters.
                engine.generateMipMapsForCubemap(texture, false);
            }
            else {
                maxLevel = info.mipmapCount - 1;
            }
        }
        engine._setCubeMapTextureParams(texture, loadMipmap, maxLevel);
        texture.isReady = true;
        texture.onLoadedObservable.notifyObservers(texture);
        texture.onLoadedObservable.clear();
        if (onLoad) {
            onLoad({ isDDS: true, width: texture.width, info, data: imgs, texture });
        }
    }
    /**
     * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
     * @param data contains the texture data
     * @param texture defines the BabylonJS internal texture
     * @param callback defines the method to call once ready to upload
     */
    loadData(data, texture, callback) {
        const info = _Misc_dds_js__WEBPACK_IMPORTED_MODULE_1__.DDSTools.GetDDSInfo(data);
        const loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && texture.generateMipMaps && Math.max(info.width, info.height) >> (info.mipmapCount - 1) === 1;
        callback(info.width, info.height, loadMipmap, info.isFourCC, () => {
            _Misc_dds_js__WEBPACK_IMPORTED_MODULE_1__.DDSTools.UploadDDSLevels(texture.getEngine(), texture, data, info, loadMipmap, 1);
        });
    }
}
//# sourceMappingURL=ddsTextureLoader.js.map

/***/ }),

/***/ 17136:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _ENVTextureLoader: () => (/* binding */ _ENVTextureLoader)
/* harmony export */ });
/* harmony import */ var _Misc_environmentTextureTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32853);

/**
 * Implementation of the ENV Texture Loader.
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _ENVTextureLoader {
    constructor() {
        /**
         * Defines whether the loader supports cascade loading the different faces.
         */
        this.supportCascades = false;
    }
    /**
     * Uploads the cube texture data to the WebGL texture. It has already been bound.
     * @param data contains the texture data
     * @param texture defines the BabylonJS internal texture
     * @param createPolynomials will be true if polynomials have been requested
     * @param onLoad defines the callback to trigger once the texture is ready
     * @param onError defines the callback to trigger in case of error
     */
    loadCubeData(data, texture, createPolynomials, onLoad, onError) {
        if (Array.isArray(data)) {
            return;
        }
        const info = (0,_Misc_environmentTextureTools_js__WEBPACK_IMPORTED_MODULE_0__/* .GetEnvInfo */ .cU)(data);
        if (info) {
            texture.width = info.width;
            texture.height = info.width;
            try {
                (0,_Misc_environmentTextureTools_js__WEBPACK_IMPORTED_MODULE_0__/* .UploadEnvSpherical */ .ow)(texture, info);
                (0,_Misc_environmentTextureTools_js__WEBPACK_IMPORTED_MODULE_0__/* .UploadEnvLevelsAsync */ .o5)(texture, data, info).then(() => {
                    texture.isReady = true;
                    texture.onLoadedObservable.notifyObservers(texture);
                    texture.onLoadedObservable.clear();
                    if (onLoad) {
                        onLoad();
                    }
                }, (reason) => {
                    onError?.("Can not upload environment levels", reason);
                });
            }
            catch (e) {
                onError?.("Can not upload environment file", e);
            }
        }
        else if (onError) {
            onError("Can not parse the environment file", null);
        }
    }
    /**
     * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
     */
    loadData() {
        // eslint-disable-next-line no-throw-literal
        throw ".env not supported in 2d.";
    }
}
//# sourceMappingURL=envTextureLoader.js.map

/***/ }),

/***/ 51958:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _ExrTextureLoader: () => (/* binding */ _ExrTextureLoader)
/* harmony export */ });
/* harmony import */ var _EXR_exrLoader_header_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98078);
/* harmony import */ var _EXR_exrLoader_decoder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50863);
/* harmony import */ var _EXR_exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9629);



/**
 * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
 * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
 * implementation.
 */
// /*
// Copyright (c) 2014 - 2017, Syoyo Fujita
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of the Syoyo Fujita nor the
//       names of its contributors may be used to endorse or promote products
//       derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// */
// // TinyEXR contains some OpenEXR code, which is licensed under ------------
// ///////////////////////////////////////////////////////////////////////////
// //
// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// // Digital Ltd. LLC
// //
// // All rights reserved.
// //
// // Redistribution and use in source and binary forms, with or without
// // modification, are permitted provided that the following conditions are
// // met:
// // *       Redistributions of source code must retain the above copyright
// // notice, this list of conditions and the following disclaimer.
// // *       Redistributions in binary form must reproduce the above
// // copyright notice, this list of conditions and the following disclaimer
// // in the documentation and/or other materials provided with the
// // distribution.
// // *       Neither the name of Industrial Light & Magic nor the names of
// // its contributors may be used to endorse or promote products derived
// // from this software without specific prior written permission.
// //
// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
// ///////////////////////////////////////////////////////////////////////////
// // End of OpenEXR license -------------------------------------------------
/**
 * Loader for .exr file format
 * #4RN0VF#151: PIZ compression
 * #4RN0VF#146: ZIP compression
 * #4RN0VF#149: RLE compression
 * #4RN0VF#150: PXR24 compression
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _ExrTextureLoader {
    constructor() {
        /**
         * Defines whether the loader supports cascade loading the different faces.
         */
        this.supportCascades = false;
    }
    /**
     * Uploads the cube texture data to the WebGL texture. It has already been bound.
     * @param _data contains the texture data
     * @param _texture defines the BabylonJS internal texture
     * @param _createPolynomials will be true if polynomials have been requested
     * @param _onLoad defines the callback to trigger once the texture is ready
     * @param _onError defines the callback to trigger in case of error
     */
    loadCubeData(_data, _texture, _createPolynomials, _onLoad, _onError) {
        // eslint-disable-next-line no-throw-literal
        throw ".exr not supported in Cube.";
    }
    /**
     * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
     * @param data contains the texture data
     * @param texture defines the BabylonJS internal texture
     * @param callback defines the method to call once ready to upload
     */
    async loadData(data, texture, callback) {
        const dataView = new DataView(data.buffer);
        const offset = { value: 0 };
        const header = (0,_EXR_exrLoader_header_js__WEBPACK_IMPORTED_MODULE_0__/* .GetExrHeader */ .V)(dataView, offset);
        const decoder = await (0,_EXR_exrLoader_decoder_js__WEBPACK_IMPORTED_MODULE_1__/* .CreateDecoderAsync */ .d)(header, dataView, offset, _EXR_exrLoader_configuration_js__WEBPACK_IMPORTED_MODULE_2__/* .ExrLoaderGlobalConfiguration */ .u.DefaultOutputType);
        (0,_EXR_exrLoader_decoder_js__WEBPACK_IMPORTED_MODULE_1__/* .ScanData */ .u)(decoder, header, dataView, offset);
        // Updating texture
        const width = header.dataWindow.xMax - header.dataWindow.xMin + 1;
        const height = header.dataWindow.yMax - header.dataWindow.yMin + 1;
        callback(width, height, texture.generateMipMaps, false, () => {
            const engine = texture.getEngine();
            texture.format = header.format;
            texture.type = decoder.textureType;
            texture.invertY = false;
            texture._gammaSpace = !header.linearSpace;
            if (decoder.byteArray) {
                engine._uploadDataToTextureDirectly(texture, decoder.byteArray, 0, 0, undefined, true);
            }
        });
    }
}
//# sourceMappingURL=exrTextureLoader.js.map

/***/ }),

/***/ 27911:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _HDRTextureLoader: () => (/* binding */ _HDRTextureLoader)
/* harmony export */ });
/* harmony import */ var _Misc_HighDynamicRange_hdr_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82814);


/**
 * Implementation of the HDR Texture Loader.
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _HDRTextureLoader {
    constructor() {
        /**
         * Defines whether the loader supports cascade loading the different faces.
         */
        this.supportCascades = false;
    }
    /**
     * Uploads the cube texture data to the WebGL texture. It has already been bound.
     */
    loadCubeData() {
        // eslint-disable-next-line no-throw-literal
        throw ".env not supported in Cube.";
    }
    /**
     * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
     * @param data contains the texture data
     * @param texture defines the BabylonJS internal texture
     * @param callback defines the method to call once ready to upload
     */
    loadData(data, texture, callback) {
        const uint8array = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
        const hdrInfo = (0,_Misc_HighDynamicRange_hdr_js__WEBPACK_IMPORTED_MODULE_0__/* .RGBE_ReadHeader */ .NK)(uint8array);
        const pixelsDataRGB32 = (0,_Misc_HighDynamicRange_hdr_js__WEBPACK_IMPORTED_MODULE_0__/* .RGBE_ReadPixels */ .LT)(uint8array, hdrInfo);
        const pixels = hdrInfo.width * hdrInfo.height;
        const pixelsDataRGBA32 = new Float32Array(pixels * 4);
        for (let i = 0; i < pixels; i += 1) {
            pixelsDataRGBA32[i * 4] = pixelsDataRGB32[i * 3];
            pixelsDataRGBA32[i * 4 + 1] = pixelsDataRGB32[i * 3 + 1];
            pixelsDataRGBA32[i * 4 + 2] = pixelsDataRGB32[i * 3 + 2];
            pixelsDataRGBA32[i * 4 + 3] = 1;
        }
        callback(hdrInfo.width, hdrInfo.height, texture.generateMipMaps, false, () => {
            const engine = texture.getEngine();
            texture.type = 1;
            texture.format = 5;
            texture._gammaSpace = false;
            engine._uploadDataToTextureDirectly(texture, pixelsDataRGBA32);
        });
    }
}
//# sourceMappingURL=hdrTextureLoader.js.map

/***/ }),

/***/ 29158:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _KTXTextureLoader: () => (/* binding */ _KTXTextureLoader)
/* harmony export */ });
/* harmony import */ var _Misc_khronosTextureContainer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6443);
/* harmony import */ var _Misc_khronosTextureContainer2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77502);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51137);




function mapSRGBToLinear(format) {
    switch (format) {
        case 35916:
            return 33776;
        case 35918:
            return 33778;
        case 35919:
            return 33779;
        case 37493:
            return 37492;
        case 37497:
            return 37496;
        case 37495:
            return 37494;
        case 37840:
            return 37808;
        case 36493:
            return 36492;
    }
    return null;
}
/**
 * Implementation of the KTX Texture Loader.
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _KTXTextureLoader {
    constructor() {
        /**
         * Defines whether the loader supports cascade loading the different faces.
         */
        this.supportCascades = false;
    }
    /**
     * Uploads the cube texture data to the WebGL texture. It has already been bound.
     * @param data contains the texture data
     * @param texture defines the BabylonJS internal texture
     * @param createPolynomials will be true if polynomials have been requested
     * @param onLoad defines the callback to trigger once the texture is ready
     */
    loadCubeData(data, texture, createPolynomials, onLoad) {
        if (Array.isArray(data)) {
            return;
        }
        // Need to invert vScale as invertY via UNPACK_FLIP_Y_WEBGL is not supported by compressed texture
        texture._invertVScale = !texture.invertY;
        const engine = texture.getEngine();
        const ktx = new _Misc_khronosTextureContainer_js__WEBPACK_IMPORTED_MODULE_0__/* .KhronosTextureContainer */ .H(data, 6);
        const loadMipmap = ktx.numberOfMipmapLevels > 1 && texture.generateMipMaps;
        engine._unpackFlipY(true);
        ktx.uploadLevels(texture, texture.generateMipMaps);
        texture.width = ktx.pixelWidth;
        texture.height = ktx.pixelHeight;
        engine._setCubeMapTextureParams(texture, loadMipmap, ktx.numberOfMipmapLevels - 1);
        texture.isReady = true;
        texture.onLoadedObservable.notifyObservers(texture);
        texture.onLoadedObservable.clear();
        if (onLoad) {
            onLoad();
        }
    }
    /**
     * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
     * @param data contains the texture data
     * @param texture defines the BabylonJS internal texture
     * @param callback defines the method to call once ready to upload
     * @param options
     */
    loadData(data, texture, callback, options) {
        if (_Misc_khronosTextureContainer_js__WEBPACK_IMPORTED_MODULE_0__/* .KhronosTextureContainer */ .H.IsValid(data)) {
            // Need to invert vScale as invertY via UNPACK_FLIP_Y_WEBGL is not supported by compressed texture
            texture._invertVScale = !texture.invertY;
            const ktx = new _Misc_khronosTextureContainer_js__WEBPACK_IMPORTED_MODULE_0__/* .KhronosTextureContainer */ .H(data, 1);
            const mappedFormat = mapSRGBToLinear(ktx.glInternalFormat);
            if (mappedFormat) {
                texture.format = mappedFormat;
                texture._useSRGBBuffer = texture.getEngine()._getUseSRGBBuffer(true, texture.generateMipMaps);
                texture._gammaSpace = true;
            }
            else {
                texture.format = ktx.glInternalFormat;
            }
            callback(ktx.pixelWidth, ktx.pixelHeight, texture.generateMipMaps, true, () => {
                ktx.uploadLevels(texture, texture.generateMipMaps);
            }, ktx.isInvalid);
        }
        else if (_Misc_khronosTextureContainer2_js__WEBPACK_IMPORTED_MODULE_1__/* .KhronosTextureContainer2 */ .Z.IsValid(data)) {
            const ktx2 = new _Misc_khronosTextureContainer2_js__WEBPACK_IMPORTED_MODULE_1__/* .KhronosTextureContainer2 */ .Z(texture.getEngine());
            ktx2._uploadAsync(data, texture, options).then(() => {
                callback(texture.width, texture.height, texture.generateMipMaps, true, () => { }, false);
            }, (error) => {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Warn(`Failed to load KTX2 texture data: ${error.message}`);
                callback(0, 0, false, false, () => { }, true);
            });
        }
        else {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Error("texture missing KTX identifier");
            callback(0, 0, false, false, () => { }, true);
        }
    }
}
//# sourceMappingURL=ktxTextureLoader.js.map

/***/ }),

/***/ 18454:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   gT: () => (/* binding */ _GetCompatibleTextureLoader),
/* harmony export */   hy: () => (/* binding */ unregisterTextureLoader),
/* harmony export */   kf: () => (/* binding */ registerTextureLoader)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);

const _registeredTextureLoaders = new Map();
/**
 * Registers a texture loader.
 * If a loader for the extension exists in the registry, it will be replaced.
 * @param extension The name of the loader extension.
 * @param loaderFactory The factory function that creates the loader extension.
 */
function registerTextureLoader(extension, loaderFactory) {
    if (unregisterTextureLoader(extension)) {
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(`Extension with the name '${name}' already exists`);
    }
    _registeredTextureLoaders.set(extension, loaderFactory);
}
/**
 * Unregisters a texture loader.
 * @param extension The name of the loader extension.
 * @returns A boolean indicating whether the extension has been unregistered
 */
function unregisterTextureLoader(extension) {
    return _registeredTextureLoaders.delete(extension);
}
/**
 * Function used to get the correct texture loader for a specific extension.
 * @param extension defines the file extension of the file being loaded
 * @param mimeType defines the optional mime type of the file being loaded
 * @returns the IInternalTextureLoader or null if it wasn't found
 */
function _GetCompatibleTextureLoader(extension, mimeType) {
    if (mimeType === "image/ktx" || mimeType === "image/ktx2") {
        extension = ".ktx";
    }
    if (!_registeredTextureLoaders.has(extension)) {
        if (extension.endsWith(".dds")) {
            registerTextureLoader(".dds", () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 50994)).then((module) => new module._DDSTextureLoader()));
        }
        if (extension.endsWith(".basis")) {
            registerTextureLoader(".basis", () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 41427)).then((module) => new module._BasisTextureLoader()));
        }
        if (extension.endsWith(".env")) {
            registerTextureLoader(".env", () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 17136)).then((module) => new module._ENVTextureLoader()));
        }
        if (extension.endsWith(".hdr")) {
            registerTextureLoader(".hdr", () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 27911)).then((module) => new module._HDRTextureLoader()));
        }
        // The ".ktx2" file extension is still up for debate: https://github.com/KhronosGroup/KTX-Specification/issues/18
        if (extension.endsWith(".ktx") || extension.endsWith(".ktx2")) {
            registerTextureLoader(".ktx", () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 29158)).then((module) => new module._KTXTextureLoader()));
            registerTextureLoader(".ktx2", () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 29158)).then((module) => new module._KTXTextureLoader()));
        }
        if (extension.endsWith(".tga")) {
            registerTextureLoader(".tga", () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 7169)).then((module) => new module._TGATextureLoader()));
        }
        if (extension.endsWith(".exr")) {
            registerTextureLoader(".exr", () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 51958)).then((module) => new module._ExrTextureLoader()));
        }
    }
    const registered = _registeredTextureLoaders.get(extension);
    return registered ? Promise.resolve(registered(mimeType)) : null;
}
//# sourceMappingURL=textureLoaderManager.js.map

/***/ }),

/***/ 7169:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _TGATextureLoader: () => (/* binding */ _TGATextureLoader)
/* harmony export */ });
/* harmony import */ var _Misc_tga_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52053);

/**
 * Implementation of the TGA Texture Loader.
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _TGATextureLoader {
    constructor() {
        /**
         * Defines whether the loader supports cascade loading the different faces.
         */
        this.supportCascades = false;
    }
    /**
     * Uploads the cube texture data to the WebGL texture. It has already been bound.
     */
    loadCubeData() {
        // eslint-disable-next-line no-throw-literal
        throw ".env not supported in Cube.";
    }
    /**
     * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
     * @param data contains the texture data
     * @param texture defines the BabylonJS internal texture
     * @param callback defines the method to call once ready to upload
     */
    loadData(data, texture, callback) {
        const bytes = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
        const header = (0,_Misc_tga_js__WEBPACK_IMPORTED_MODULE_0__/* .GetTGAHeader */ .O_)(bytes);
        callback(header.width, header.height, texture.generateMipMaps, false, () => {
            (0,_Misc_tga_js__WEBPACK_IMPORTED_MODULE_0__/* .UploadContent */ .FA)(texture, bytes);
        });
    }
}
//# sourceMappingURL=tgaTextureLoader.js.map

/***/ }),

/***/ 56526:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   t: () => (/* binding */ BaseTexture)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6315);
/* harmony import */ var _Misc_guid_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(38688);
/* harmony import */ var _Misc_fileTools_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8532);
/* harmony import */ var _thinTexture_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(35928);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(26877);










/**
 * Base class of all the textures in babylon.
 * It groups all the common properties the materials, post process, lights... might need
 * in order to make a correct use of the texture.
 */
class BaseTexture extends _thinTexture_js__WEBPACK_IMPORTED_MODULE_7__/* .ThinTexture */ .D {
    /**
     * Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).
     */
    set hasAlpha(value) {
        if (this._hasAlpha === value) {
            return;
        }
        this._hasAlpha = value;
        if (this._scene) {
            this._scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this);
            });
        }
    }
    get hasAlpha() {
        return this._hasAlpha;
    }
    /**
     * Defines if the alpha value should be determined via the rgb values.
     * If true the luminance of the pixel might be used to find the corresponding alpha value.
     */
    set getAlphaFromRGB(value) {
        if (this._getAlphaFromRGB === value) {
            return;
        }
        this._getAlphaFromRGB = value;
        if (this._scene) {
            this._scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this);
            });
        }
    }
    get getAlphaFromRGB() {
        return this._getAlphaFromRGB;
    }
    /**
     * Define the UV channel to use starting from 0 and defaulting to 0.
     * This is part of the texture as textures usually maps to one uv set.
     */
    set coordinatesIndex(value) {
        if (this._coordinatesIndex === value) {
            return;
        }
        this._coordinatesIndex = value;
        if (this._scene) {
            this._scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this);
            });
        }
    }
    get coordinatesIndex() {
        return this._coordinatesIndex;
    }
    /**
     * How a texture is mapped.
     *
     * | Value | Type                                | Description |
     * | ----- | ----------------------------------- | ----------- |
     * | 0     | EXPLICIT_MODE                       |             |
     * | 1     | SPHERICAL_MODE                      |             |
     * | 2     | PLANAR_MODE                         |             |
     * | 3     | CUBIC_MODE                          |             |
     * | 4     | PROJECTION_MODE                     |             |
     * | 5     | SKYBOX_MODE                         |             |
     * | 6     | INVCUBIC_MODE                       |             |
     * | 7     | EQUIRECTANGULAR_MODE                |             |
     * | 8     | FIXED_EQUIRECTANGULAR_MODE          |             |
     * | 9     | FIXED_EQUIRECTANGULAR_MIRRORED_MODE |             |
     */
    set coordinatesMode(value) {
        if (this._coordinatesMode === value) {
            return;
        }
        this._coordinatesMode = value;
        if (this._scene) {
            this._scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this);
            });
        }
    }
    get coordinatesMode() {
        return this._coordinatesMode;
    }
    /**
     * | Value | Type               | Description |
     * | ----- | ------------------ | ----------- |
     * | 0     | CLAMP_ADDRESSMODE  |             |
     * | 1     | WRAP_ADDRESSMODE   |             |
     * | 2     | MIRROR_ADDRESSMODE |             |
     */
    get wrapU() {
        return this._wrapU;
    }
    set wrapU(value) {
        this._wrapU = value;
    }
    /**
     * | Value | Type               | Description |
     * | ----- | ------------------ | ----------- |
     * | 0     | CLAMP_ADDRESSMODE  |             |
     * | 1     | WRAP_ADDRESSMODE   |             |
     * | 2     | MIRROR_ADDRESSMODE |             |
     */
    get wrapV() {
        return this._wrapV;
    }
    set wrapV(value) {
        this._wrapV = value;
    }
    /**
     * Define if the texture is a cube texture or if false a 2d texture.
     */
    get isCube() {
        if (!this._texture) {
            return this._isCube;
        }
        return this._texture.isCube;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    set isCube(value) {
        if (!this._texture) {
            this._isCube = value;
        }
        else {
            this._texture.isCube = value;
        }
    }
    /**
     * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
     */
    get is3D() {
        if (!this._texture) {
            return false;
        }
        return this._texture.is3D;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    set is3D(value) {
        if (!this._texture) {
            return;
        }
        this._texture.is3D = value;
    }
    /**
     * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.
     */
    get is2DArray() {
        if (!this._texture) {
            return false;
        }
        return this._texture.is2DArray;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    set is2DArray(value) {
        if (!this._texture) {
            return;
        }
        this._texture.is2DArray = value;
    }
    /**
     * Define if the texture contains data in gamma space (most of the png/jpg aside bump).
     * HDR texture are usually stored in linear space.
     * This only impacts the PBR and Background materials
     */
    get gammaSpace() {
        if (!this._texture) {
            return this._gammaSpace;
        }
        else {
            if (this._texture._gammaSpace === null) {
                this._texture._gammaSpace = this._gammaSpace;
            }
        }
        return this._texture._gammaSpace && !this._texture._useSRGBBuffer;
    }
    set gammaSpace(gamma) {
        if (!this._texture) {
            if (this._gammaSpace === gamma) {
                return;
            }
            this._gammaSpace = gamma;
        }
        else {
            if (this._texture._gammaSpace === gamma) {
                return;
            }
            this._texture._gammaSpace = gamma;
        }
        this.getScene()?.markAllMaterialsAsDirty(1, (mat) => {
            return mat.hasTexture(this);
        });
    }
    /**
     * Gets or sets whether or not the texture contains RGBD data.
     */
    get isRGBD() {
        return this._texture != null && this._texture._isRGBD;
    }
    set isRGBD(value) {
        if (value === this.isRGBD) {
            return;
        }
        if (this._texture) {
            this._texture._isRGBD = value;
        }
        this.getScene()?.markAllMaterialsAsDirty(1, (mat) => {
            return mat.hasTexture(this);
        });
    }
    /**
     * Are mip maps generated for this texture or not.
     */
    get noMipmap() {
        return false;
    }
    /**
     * With prefiltered texture, defined the offset used during the prefiltering steps.
     */
    get lodGenerationOffset() {
        if (this._texture) {
            return this._texture._lodGenerationOffset;
        }
        return 0.0;
    }
    set lodGenerationOffset(value) {
        if (this._texture) {
            this._texture._lodGenerationOffset = value;
        }
    }
    /**
     * With prefiltered texture, defined the scale used during the prefiltering steps.
     */
    get lodGenerationScale() {
        if (this._texture) {
            return this._texture._lodGenerationScale;
        }
        return 0.0;
    }
    set lodGenerationScale(value) {
        if (this._texture) {
            this._texture._lodGenerationScale = value;
        }
    }
    /**
     * With prefiltered texture, defined if the specular generation is based on a linear ramp.
     * By default we are using a log2 of the linear roughness helping to keep a better resolution for
     * average roughness values.
     */
    get linearSpecularLOD() {
        if (this._texture) {
            return this._texture._linearSpecularLOD;
        }
        return false;
    }
    set linearSpecularLOD(value) {
        if (this._texture) {
            this._texture._linearSpecularLOD = value;
        }
    }
    /**
     * In case a better definition than spherical harmonics is required for the diffuse part of the environment.
     * You can set the irradiance texture to rely on a texture instead of the spherical approach.
     * This texture need to have the same characteristics than its parent (Cube vs 2d, coordinates mode, Gamma/Linear, RGBD).
     */
    get irradianceTexture() {
        if (this._texture) {
            return this._texture._irradianceTexture;
        }
        return null;
    }
    set irradianceTexture(value) {
        if (this._texture) {
            this._texture._irradianceTexture = value;
        }
    }
    /**
     * Define the unique id of the texture in the scene.
     */
    get uid() {
        if (!this._uid) {
            this._uid = (0,_Misc_guid_js__WEBPACK_IMPORTED_MODULE_5__/* .RandomGUID */ .z)();
        }
        return this._uid;
    }
    /**
     * Return a string representation of the texture.
     * @returns the texture as a string
     */
    toString() {
        return this.name;
    }
    /**
     * Get the class name of the texture.
     * @returns "BaseTexture"
     */
    getClassName() {
        return "BaseTexture";
    }
    /**
     * Callback triggered when the texture has been disposed.
     * Kept for back compatibility, you can use the onDisposeObservable instead.
     */
    set onDispose(callback) {
        if (this._onDisposeObserver) {
            this.onDisposeObservable.remove(this._onDisposeObserver);
        }
        this._onDisposeObserver = this.onDisposeObservable.add(callback);
    }
    /**
     * Define if the texture is preventing a material to render or not.
     * If not and the texture is not ready, the engine will use a default black texture instead.
     */
    get isBlocking() {
        return true;
    }
    /**
     * Was there any loading error?
     */
    get loadingError() {
        return this._loadingError;
    }
    /**
     * If a loading error occurred this object will be populated with information about the error.
     */
    get errorObject() {
        return this._errorObject;
    }
    /**
     * Instantiates a new BaseTexture.
     * Base class of all the textures in babylon.
     * It groups all the common properties the materials, post process, lights... might need
     * in order to make a correct use of the texture.
     * @param sceneOrEngine Define the scene or engine the texture belongs to
     * @param internalTexture Define the internal texture associated with the texture
     */
    constructor(sceneOrEngine, internalTexture = null) {
        super(null);
        /**
         * Gets or sets an object used to store user defined information.
         */
        this.metadata = null;
        /**
         * For internal use only. Please do not use.
         */
        this.reservedDataStore = null;
        this._hasAlpha = false;
        this._getAlphaFromRGB = false;
        /**
         * Intensity or strength of the texture.
         * It is commonly used by materials to fine tune the intensity of the texture
         */
        this.level = 1;
        this._coordinatesIndex = 0;
        /**
         * Gets or sets a boolean indicating that the texture should try to reduce shader code if there is no UV manipulation.
         * (ie. when texture.getTextureMatrix().isIdentityAs3x2() returns true)
         */
        this.optimizeUVAllocation = true;
        this._coordinatesMode = 0;
        /**
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | 0     | CLAMP_ADDRESSMODE  |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
        this.wrapR = 1;
        /**
         * With compliant hardware and browser (supporting anisotropic filtering)
         * this defines the level of anisotropic filtering in the texture.
         * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff.
         */
        this.anisotropicFilteringLevel = BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL;
        /** @internal */
        this._isCube = false;
        /** @internal */
        this._gammaSpace = true;
        /**
         * Is Z inverted in the texture (useful in a cube texture).
         */
        this.invertZ = false;
        /**
         * @internal
         */
        this.lodLevelInAlpha = false;
        /**
         * Define if the texture is a render target.
         */
        this.isRenderTarget = false;
        /** @internal */
        this._prefiltered = false;
        /** @internal */
        this._forceSerialize = false;
        /**
         * Define the list of animation attached to the texture.
         */
        this.animations = [];
        /**
         * An event triggered when the texture is disposed.
         */
        this.onDisposeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        this._onDisposeObserver = null;
        this._scene = null;
        /** @internal */
        this._uid = null;
        /** @internal */
        this._parentContainer = null;
        this._loadingError = false;
        if (sceneOrEngine) {
            if (BaseTexture._IsScene(sceneOrEngine)) {
                this._scene = sceneOrEngine;
            }
            else {
                this._engine = sceneOrEngine;
            }
        }
        else {
            this._scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore */ .q.LastCreatedScene;
        }
        if (this._scene) {
            this.uniqueId = this._scene.getUniqueId();
            this._scene.addTexture(this);
            this._engine = this._scene.getEngine();
        }
        this._texture = internalTexture;
        this._uid = null;
    }
    /**
     * Get the scene the texture belongs to.
     * @returns the scene or null if undefined
     */
    getScene() {
        return this._scene;
    }
    /** @internal */
    _getEngine() {
        return this._engine;
    }
    /**
     * Get the texture transform matrix used to offset tile the texture for instance.
     * @returns the transformation matrix
     */
    getTextureMatrix() {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.IdentityReadOnly;
    }
    /**
     * Get the texture reflection matrix used to rotate/transform the reflection.
     * @returns the reflection matrix
     */
    getReflectionTextureMatrix() {
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.IdentityReadOnly;
    }
    /**
     * Gets a suitable rotate/transform matrix when the texture is used for refraction.
     * There's a separate function from getReflectionTextureMatrix because refraction requires a special configuration of the matrix in right-handed mode.
     * @returns The refraction matrix
     */
    getRefractionTextureMatrix() {
        return this.getReflectionTextureMatrix();
    }
    /**
     * Get if the texture is ready to be consumed (either it is ready or it is not blocking)
     * @returns true if ready, not blocking or if there was an error loading the texture
     */
    isReadyOrNotBlocking() {
        return !this.isBlocking || this.isReady() || this.loadingError;
    }
    /**
     * Scales the texture if is `canRescale()`
     * @param ratio the resize factor we want to use to rescale
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    scale(ratio) { }
    /**
     * Get if the texture can rescale.
     */
    get canRescale() {
        return false;
    }
    /**
     * @internal
     */
    _getFromCache(url, noMipmap, sampling, invertY, useSRGBBuffer, isCube) {
        const engine = this._getEngine();
        if (!engine) {
            return null;
        }
        const correctedUseSRGBBuffer = engine._getUseSRGBBuffer(!!useSRGBBuffer, noMipmap);
        const texturesCache = engine.getLoadedTexturesCache();
        for (let index = 0; index < texturesCache.length; index++) {
            const texturesCacheEntry = texturesCache[index];
            if (useSRGBBuffer === undefined || correctedUseSRGBBuffer === texturesCacheEntry._useSRGBBuffer) {
                if (invertY === undefined || invertY === texturesCacheEntry.invertY) {
                    if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {
                        if (!sampling || sampling === texturesCacheEntry.samplingMode) {
                            if (isCube === undefined || isCube === texturesCacheEntry.isCube) {
                                texturesCacheEntry.incrementReferences();
                                return texturesCacheEntry;
                            }
                        }
                    }
                }
            }
        }
        return null;
    }
    /** @internal */
    _rebuild(_fromContextLost = false) { }
    /**
     * Clones the texture.
     * @returns the cloned texture
     */
    clone() {
        return null;
    }
    /**
     * Get the texture underlying type (INT, FLOAT...)
     */
    get textureType() {
        if (!this._texture) {
            return 0;
        }
        return this._texture.type !== undefined ? this._texture.type : 0;
    }
    /**
     * Get the texture underlying format (RGB, RGBA...)
     */
    get textureFormat() {
        if (!this._texture) {
            return 5;
        }
        return this._texture.format !== undefined ? this._texture.format : 5;
    }
    /**
     * Indicates that textures need to be re-calculated for all materials
     */
    _markAllSubMeshesAsTexturesDirty() {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        scene.markAllMaterialsAsDirty(1);
    }
    /**
     * Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer.
     * This will returns an RGBA array buffer containing either in values (0-255) or
     * float values (0-1) depending of the underlying buffer type.
     * @param faceIndex defines the face of the texture to read (in case of cube texture)
     * @param level defines the LOD level of the texture to read (in case of Mip Maps)
     * @param buffer defines a user defined buffer to fill with data (can be null)
     * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
     * @param noDataConversion false to convert the data to Uint8Array (if texture type is UNSIGNED_BYTE) or to Float32Array (if texture type is anything but UNSIGNED_BYTE). If true, the type of the generated buffer (if buffer==null) will depend on the type of the texture
     * @param x defines the region x coordinates to start reading from (default to 0)
     * @param y defines the region y coordinates to start reading from (default to 0)
     * @param width defines the region width to read from (default to the texture size at level)
     * @param height defines the region width to read from (default to the texture size at level)
     * @returns The Array buffer promise containing the pixels data.
     */
    readPixels(faceIndex = 0, level = 0, buffer = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0, width = Number.MAX_VALUE, height = Number.MAX_VALUE) {
        if (!this._texture) {
            return null;
        }
        const engine = this._getEngine();
        if (!engine) {
            return null;
        }
        const size = this.getSize();
        let maxWidth = size.width;
        let maxHeight = size.height;
        if (level !== 0) {
            maxWidth = maxWidth / Math.pow(2, level);
            maxHeight = maxHeight / Math.pow(2, level);
            maxWidth = Math.round(maxWidth);
            maxHeight = Math.round(maxHeight);
        }
        width = Math.min(maxWidth, width);
        height = Math.min(maxHeight, height);
        try {
            if (this._texture.isCube) {
                return engine._readTexturePixels(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion, x, y);
            }
            return engine._readTexturePixels(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion, x, y);
        }
        catch (e) {
            return null;
        }
    }
    /**
     * @internal
     */
    _readPixelsSync(faceIndex = 0, level = 0, buffer = null, flushRenderer = true, noDataConversion = false) {
        if (!this._texture) {
            return null;
        }
        const size = this.getSize();
        let width = size.width;
        let height = size.height;
        const engine = this._getEngine();
        if (!engine) {
            return null;
        }
        if (level != 0) {
            width = width / Math.pow(2, level);
            height = height / Math.pow(2, level);
            width = Math.round(width);
            height = Math.round(height);
        }
        try {
            if (this._texture.isCube) {
                return engine._readTexturePixelsSync(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion);
            }
            return engine._readTexturePixelsSync(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion);
        }
        catch (e) {
            return null;
        }
    }
    /** @internal */
    get _lodTextureHigh() {
        if (this._texture) {
            return this._texture._lodTextureHigh;
        }
        return null;
    }
    /** @internal */
    get _lodTextureMid() {
        if (this._texture) {
            return this._texture._lodTextureMid;
        }
        return null;
    }
    /** @internal */
    get _lodTextureLow() {
        if (this._texture) {
            return this._texture._lodTextureLow;
        }
        return null;
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() {
        if (this._scene) {
            // Animations
            if (this._scene.stopAnimation) {
                this._scene.stopAnimation(this);
            }
            // Remove from scene
            this._scene.removePendingData(this);
            const index = this._scene.textures.indexOf(this);
            if (index >= 0) {
                this._scene.textures.splice(index, 1);
            }
            this._scene.onTextureRemovedObservable.notifyObservers(this);
            this._scene = null;
            if (this._parentContainer) {
                const index = this._parentContainer.textures.indexOf(this);
                if (index > -1) {
                    this._parentContainer.textures.splice(index, 1);
                }
                this._parentContainer = null;
            }
        }
        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
        this.metadata = null;
        super.dispose();
    }
    /**
     * Serialize the texture into a JSON representation that can be parsed later on.
     * @param allowEmptyName True to force serialization even if name is empty. Default: false
     * @returns the JSON representation of the texture
     */
    serialize(allowEmptyName = false) {
        if (!this.name && !allowEmptyName) {
            return null;
        }
        const serializationObject = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__/* .SerializationHelper */ .p.Serialize(this);
        // Animations
        _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__/* .SerializationHelper */ .p.AppendSerializedAnimations(this, serializationObject);
        return serializationObject;
    }
    /**
     * Helper function to be called back once a list of texture contains only ready textures.
     * @param textures Define the list of textures to wait for
     * @param callback Define the callback triggered once the entire list will be ready
     */
    static WhenAllReady(textures, callback) {
        let numRemaining = textures.length;
        if (numRemaining === 0) {
            callback();
            return;
        }
        for (let i = 0; i < textures.length; i++) {
            const texture = textures[i];
            if (texture.isReady()) {
                if (--numRemaining === 0) {
                    callback();
                }
            }
            else {
                const onLoadObservable = texture.onLoadObservable;
                if (onLoadObservable) {
                    onLoadObservable.addOnce(() => {
                        if (--numRemaining === 0) {
                            callback();
                        }
                    });
                }
                else {
                    if (--numRemaining === 0) {
                        callback();
                    }
                }
            }
        }
    }
    static _IsScene(sceneOrEngine) {
        return sceneOrEngine.getClassName() === "Scene";
    }
}
/**
 * Default anisotropic filtering level for the application.
 * It is set to 4 as a good tradeoff between perf and quality.
 */
BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "uniqueId", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "name", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "displayName", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "metadata", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("hasAlpha")
], BaseTexture.prototype, "_hasAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("getAlphaFromRGB")
], BaseTexture.prototype, "_getAlphaFromRGB", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "level", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("coordinatesIndex")
], BaseTexture.prototype, "_coordinatesIndex", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "optimizeUVAllocation", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("coordinatesMode")
], BaseTexture.prototype, "_coordinatesMode", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "wrapU", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "wrapV", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "wrapR", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "anisotropicFilteringLevel", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "isCube", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "is3D", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "is2DArray", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "gammaSpace", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "invertZ", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "lodLevelInAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "lodGenerationOffset", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "lodGenerationScale", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "linearSpecularLOD", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)()
], BaseTexture.prototype, "irradianceTexture", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], BaseTexture.prototype, "isRenderTarget", void 0);
//# sourceMappingURL=baseTexture.js.map

/***/ }),

/***/ 69764:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Misc_HighDynamicRange_cubemapToSphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36755);
/* harmony import */ var _baseTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56526);


_baseTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .BaseTexture */ .t.prototype.forceSphericalPolynomialsRecompute = function () {
    if (this._texture) {
        this._texture._sphericalPolynomial = null;
        this._texture._sphericalPolynomialPromise = null;
        this._texture._sphericalPolynomialComputed = false;
    }
};
Object.defineProperty(_baseTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .BaseTexture */ .t.prototype, "sphericalPolynomial", {
    get: function () {
        if (this._texture) {
            if (this._texture._sphericalPolynomial || this._texture._sphericalPolynomialComputed) {
                return this._texture._sphericalPolynomial;
            }
            if (this._texture.isReady) {
                if (!this._texture._sphericalPolynomialPromise) {
                    this._texture._sphericalPolynomialPromise = _Misc_HighDynamicRange_cubemapToSphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_0__/* .CubeMapToSphericalPolynomialTools */ .d.ConvertCubeMapTextureToSphericalPolynomial(this);
                    if (this._texture._sphericalPolynomialPromise === null) {
                        this._texture._sphericalPolynomialComputed = true;
                    }
                    else {
                        this._texture._sphericalPolynomialPromise.then((sphericalPolynomial) => {
                            this._texture._sphericalPolynomial = sphericalPolynomial;
                            this._texture._sphericalPolynomialComputed = true;
                        });
                    }
                }
                return null;
            }
        }
        return null;
    },
    set: function (value) {
        if (this._texture) {
            this._texture._sphericalPolynomial = value;
        }
    },
    enumerable: true,
    configurable: true,
});
//# sourceMappingURL=baseTexture.polynomial.js.map

/***/ }),

/***/ 34294:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   b: () => (/* binding */ CubeTexture)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(998);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56526);
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7481);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56552);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(99848);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(26877);
/* harmony import */ var _Engines_AbstractEngine_abstractEngine_cubeTexture_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(69195);











// The default scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
const defaultLodScale = 0.8;
/**
 * Class for creating a cube texture
 */
class CubeTexture extends _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__/* .BaseTexture */ .t {
    /**
     * Gets or sets the size of the bounding box associated with the cube texture
     * When defined, the cubemap will switch to local mode
     * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity
     * @example https://www.babylonjs-playground.com/#RNASML
     */
    set boundingBoxSize(value) {
        if (this._boundingBoxSize && this._boundingBoxSize.equals(value)) {
            return;
        }
        this._boundingBoxSize = value;
        const scene = this.getScene();
        if (scene) {
            scene.markAllMaterialsAsDirty(1);
        }
    }
    /**
     * Returns the bounding box size
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#using-local-cubemap-mode
     */
    get boundingBoxSize() {
        return this._boundingBoxSize;
    }
    /**
     * Sets texture matrix rotation angle around Y axis in radians.
     */
    set rotationY(value) {
        this._rotationY = value;
        this.setReflectionTextureMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.RotationY(this._rotationY));
    }
    /**
     * Gets texture matrix rotation angle around Y axis radians.
     */
    get rotationY() {
        return this._rotationY;
    }
    /**
     * Are mip maps generated for this texture or not.
     */
    get noMipmap() {
        return this._noMipmap;
    }
    /**
     * Gets the forced extension (if any)
     */
    get forcedExtension() {
        return this._forcedExtension;
    }
    /**
     * Creates a cube texture from an array of image urls
     * @param files defines an array of image urls
     * @param scene defines the hosting scene
     * @param noMipmap specifies if mip maps are not used
     * @returns a cube texture
     */
    static CreateFromImages(files, scene, noMipmap) {
        let rootUrlKey = "";
        files.forEach((url) => (rootUrlKey += url));
        return new CubeTexture(rootUrlKey, scene, null, noMipmap, files);
    }
    /**
     * Creates and return a texture created from prefilterd data by tools like IBL Baker or Lys.
     * @param url defines the url of the prefiltered texture
     * @param scene defines the scene the texture is attached to
     * @param forcedExtension defines the extension of the file if different from the url
     * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary
     * @returns the prefiltered texture
     */
    static CreateFromPrefilteredData(url, scene, forcedExtension = null, createPolynomials = true) {
        const oldValue = scene.useDelayedTextureLoading;
        scene.useDelayedTextureLoading = false;
        const result = new CubeTexture(url, scene, null, false, null, null, null, undefined, true, forcedExtension, createPolynomials);
        scene.useDelayedTextureLoading = oldValue;
        return result;
    }
    /**
     * Creates a cube texture to use with reflection for instance. It can be based upon dds or six images as well
     * as prefiltered data.
     * @param rootUrl defines the url of the texture or the root name of the six images
     * @param sceneOrEngine defines the scene or engine the texture is attached to
     * @param extensionsOrOptions defines the suffixes add to the picture name in case six images are in use like _px.jpg or set of all options to create the cube texture
     * @param noMipmap defines if mipmaps should be created or not
     * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz
     * @param onLoad defines a callback triggered at the end of the file load if no errors occurred
     * @param onError defines a callback triggered in case of error during load
     * @param format defines the internal format to use for the texture once loaded
     * @param prefiltered defines whether or not the texture is created from prefiltered data
     * @param forcedExtension defines the extensions to use (force a special type of file to load) in case it is different from the file name
     * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary
     * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
     * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
     * @param loaderOptions options to be passed to the loader
     * @param useSRGBBuffer Defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU) (default: false)
     * @returns the cube texture
     */
    constructor(rootUrl, sceneOrEngine, extensionsOrOptions = null, noMipmap = false, files = null, onLoad = null, onError = null, format = 5, prefiltered = false, forcedExtension = null, createPolynomials = false, lodScale = defaultLodScale, lodOffset = 0, loaderOptions, useSRGBBuffer) {
        super(sceneOrEngine);
        /**
         * Observable triggered once the texture has been loaded.
         */
        this.onLoadObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_7__/* .Observable */ .cP();
        /**
         * Gets or sets the center of the bounding box associated with the cube texture.
         * It must define where the camera used to render the texture was set
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#using-local-cubemap-mode
         */
        this.boundingBoxPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Zero();
        this._rotationY = 0;
        /** @internal */
        this._files = null;
        this._forcedExtension = null;
        this._extensions = null;
        this._textureMatrixRefraction = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq();
        this._buffer = null;
        this.name = rootUrl;
        this.url = rootUrl;
        this._noMipmap = noMipmap;
        this.hasAlpha = false;
        this.isCube = true;
        this._textureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Identity();
        this.coordinatesMode = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_5__/* .Texture */ .g.CUBIC_MODE;
        let extensions = null;
        let buffer = null;
        if (extensionsOrOptions !== null && !Array.isArray(extensionsOrOptions)) {
            extensions = extensionsOrOptions.extensions ?? null;
            this._noMipmap = extensionsOrOptions.noMipmap ?? false;
            files = extensionsOrOptions.files ?? null;
            buffer = extensionsOrOptions.buffer ?? null;
            this._format = extensionsOrOptions.format ?? 5;
            prefiltered = extensionsOrOptions.prefiltered ?? false;
            forcedExtension = extensionsOrOptions.forcedExtension ?? null;
            this._createPolynomials = extensionsOrOptions.createPolynomials ?? false;
            this._lodScale = extensionsOrOptions.lodScale ?? defaultLodScale;
            this._lodOffset = extensionsOrOptions.lodOffset ?? 0;
            this._loaderOptions = extensionsOrOptions.loaderOptions;
            this._useSRGBBuffer = extensionsOrOptions.useSRGBBuffer;
            onLoad = extensionsOrOptions.onLoad ?? null;
            onError = extensionsOrOptions.onError ?? null;
        }
        else {
            this._noMipmap = noMipmap;
            this._format = format;
            this._createPolynomials = createPolynomials;
            extensions = extensionsOrOptions;
            this._loaderOptions = loaderOptions;
            this._useSRGBBuffer = useSRGBBuffer;
            this._lodScale = lodScale;
            this._lodOffset = lodOffset;
        }
        if (!rootUrl && !files) {
            return;
        }
        this.updateURL(rootUrl, forcedExtension, onLoad, prefiltered, onError, extensions, this.getScene()?.useDelayedTextureLoading, files, buffer);
    }
    /**
     * Get the current class name of the texture useful for serialization or dynamic coding.
     * @returns "CubeTexture"
     */
    getClassName() {
        return "CubeTexture";
    }
    /**
     * Update the url (and optional buffer) of this texture if url was null during construction.
     * @param url the url of the texture
     * @param forcedExtension defines the extension to use
     * @param onLoad callback called when the texture is loaded  (defaults to null)
     * @param prefiltered Defines whether the updated texture is prefiltered or not
     * @param onError callback called if there was an error during the loading process (defaults to null)
     * @param extensions defines the suffixes add to the picture name in case six images are in use like _px.jpg...
     * @param delayLoad defines if the texture should be loaded now (false by default)
     * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz
     * @param buffer the buffer to use instead of loading from the url
     */
    updateURL(url, forcedExtension = null, onLoad = null, prefiltered = false, onError = null, extensions = null, delayLoad = false, files = null, buffer = null) {
        if (!this.name || this.name.startsWith("data:")) {
            this.name = url;
        }
        this.url = url;
        if (forcedExtension) {
            this._forcedExtension = forcedExtension;
        }
        const lastDot = url.lastIndexOf(".");
        const extension = forcedExtension ? forcedExtension : lastDot > -1 ? url.substring(lastDot).toLowerCase() : "";
        const isDDS = extension.indexOf(".dds") === 0;
        const isEnv = extension.indexOf(".env") === 0;
        const isBasis = extension.indexOf(".basis") === 0;
        if (isEnv) {
            this.gammaSpace = false;
            this._prefiltered = false;
            this.anisotropicFilteringLevel = 1;
        }
        else {
            this._prefiltered = prefiltered;
            if (prefiltered) {
                this.gammaSpace = false;
                this.anisotropicFilteringLevel = 1;
            }
        }
        if (files) {
            this._files = files;
        }
        else {
            if (!isBasis && !isEnv && !isDDS && !extensions) {
                extensions = ["_px.jpg", "_py.jpg", "_pz.jpg", "_nx.jpg", "_ny.jpg", "_nz.jpg"];
            }
            this._files = this._files || [];
            this._files.length = 0;
            if (extensions) {
                for (let index = 0; index < extensions.length; index++) {
                    this._files.push(url + extensions[index]);
                }
                this._extensions = extensions;
            }
        }
        this._buffer = buffer;
        if (delayLoad) {
            this.delayLoadState = 4;
            this._delayedOnLoad = onLoad;
            this._delayedOnError = onError;
        }
        else {
            this._loadTexture(onLoad, onError);
        }
    }
    /**
     * Delays loading of the cube texture
     * @param forcedExtension defines the extension to use
     */
    delayLoad(forcedExtension) {
        if (this.delayLoadState !== 4) {
            return;
        }
        if (forcedExtension) {
            this._forcedExtension = forcedExtension;
        }
        this.delayLoadState = 1;
        this._loadTexture(this._delayedOnLoad, this._delayedOnError);
    }
    /**
     * Returns the reflection texture matrix
     * @returns the reflection texture matrix
     */
    getReflectionTextureMatrix() {
        return this._textureMatrix;
    }
    /**
     * Sets the reflection texture matrix
     * @param value Reflection texture matrix
     */
    setReflectionTextureMatrix(value) {
        if (value.updateFlag === this._textureMatrix.updateFlag) {
            return;
        }
        if (value.isIdentity() !== this._textureMatrix.isIdentity()) {
            this.getScene()?.markAllMaterialsAsDirty(1, (mat) => mat.getActiveTextures().indexOf(this) !== -1);
        }
        this._textureMatrix = value;
        if (!this.getScene()?.useRightHandedSystem) {
            return;
        }
        const scale = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[0];
        const quat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Quaternion[0];
        const trans = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[1];
        this._textureMatrix.decompose(scale, quat, trans);
        quat.z *= -1; // these two operations correspond to negating the x and y euler angles
        quat.w *= -1;
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.ComposeToRef(scale, quat, trans, this._textureMatrixRefraction);
    }
    /**
     * Gets a suitable rotate/transform matrix when the texture is used for refraction.
     * There's a separate function from getReflectionTextureMatrix because refraction requires a special configuration of the matrix in right-handed mode.
     * @returns The refraction matrix
     */
    getRefractionTextureMatrix() {
        return this.getScene()?.useRightHandedSystem ? this._textureMatrixRefraction : this._textureMatrix;
    }
    _loadTexture(onLoad = null, onError = null) {
        const scene = this.getScene();
        const oldTexture = this._texture;
        this._texture = this._getFromCache(this.url, this._noMipmap, undefined, undefined, this._useSRGBBuffer, this.isCube);
        const onLoadProcessing = () => {
            this.onLoadObservable.notifyObservers(this);
            if (oldTexture) {
                oldTexture.dispose();
                this.getScene()?.markAllMaterialsAsDirty(1);
            }
            if (onLoad) {
                onLoad();
            }
        };
        const errorHandler = (message, exception) => {
            this._loadingError = true;
            this._errorObject = { message, exception };
            if (onError) {
                onError(message, exception);
            }
            _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_5__/* .Texture */ .g.OnTextureLoadErrorObservable.notifyObservers(this);
        };
        if (!this._texture) {
            if (this._prefiltered) {
                this._texture = this._getEngine().createPrefilteredCubeTexture(this.url, scene, this._lodScale, this._lodOffset, onLoad, errorHandler, this._format, this._forcedExtension, this._createPolynomials);
            }
            else {
                this._texture = this._getEngine().createCubeTexture(this.url, scene, this._files, this._noMipmap, onLoad, errorHandler, this._format, this._forcedExtension, false, this._lodScale, this._lodOffset, null, this._loaderOptions, !!this._useSRGBBuffer, this._buffer);
            }
            this._texture?.onLoadedObservable.add(() => this.onLoadObservable.notifyObservers(this));
        }
        else {
            if (this._texture.isReady) {
                _Misc_tools_js__WEBPACK_IMPORTED_MODULE_2__/* .Tools */ .S0.SetImmediate(() => onLoadProcessing());
            }
            else {
                this._texture.onLoadedObservable.add(() => onLoadProcessing());
            }
        }
    }
    /**
     * Parses text to create a cube texture
     * @param parsedTexture define the serialized text to read from
     * @param scene defines the hosting scene
     * @param rootUrl defines the root url of the cube texture
     * @returns a cube texture
     */
    static Parse(parsedTexture, scene, rootUrl) {
        const texture = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__/* .SerializationHelper */ .p.Parse(() => {
            let prefiltered = false;
            if (parsedTexture.prefiltered) {
                prefiltered = parsedTexture.prefiltered;
            }
            return new CubeTexture(rootUrl + (parsedTexture.url ?? parsedTexture.name), scene, parsedTexture.extensions, false, parsedTexture.files || null, null, null, undefined, prefiltered, parsedTexture.forcedExtension);
        }, parsedTexture, scene);
        // Local Cubemaps
        if (parsedTexture.boundingBoxPosition) {
            texture.boundingBoxPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.FromArray(parsedTexture.boundingBoxPosition);
        }
        if (parsedTexture.boundingBoxSize) {
            texture.boundingBoxSize = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.FromArray(parsedTexture.boundingBoxSize);
        }
        // Animations
        if (parsedTexture.animations) {
            for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {
                const parsedAnimation = parsedTexture.animations[animationIndex];
                const internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .GetClass */ .n9)("BABYLON.Animation");
                if (internalClass) {
                    texture.animations.push(internalClass.Parse(parsedAnimation));
                }
            }
        }
        return texture;
    }
    /**
     * Makes a clone, or deep copy, of the cube texture
     * @returns a new cube texture
     */
    clone() {
        let uniqueId = 0;
        const newCubeTexture = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_8__/* .SerializationHelper */ .p.Clone(() => {
            const cubeTexture = new CubeTexture(this.url, this.getScene() || this._getEngine(), this._extensions, this._noMipmap, this._files);
            uniqueId = cubeTexture.uniqueId;
            return cubeTexture;
        }, this);
        newCubeTexture.uniqueId = uniqueId;
        return newCubeTexture;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], CubeTexture.prototype, "url", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)()
], CubeTexture.prototype, "boundingBoxPosition", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)()
], CubeTexture.prototype, "boundingBoxSize", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("rotationY")
], CubeTexture.prototype, "rotationY", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("files")
], CubeTexture.prototype, "_files", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("forcedExtension")
], CubeTexture.prototype, "_forcedExtension", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("extensions")
], CubeTexture.prototype, "_extensions", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsMatrix */ .GG)("textureMatrix")
], CubeTexture.prototype, "_textureMatrix", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsMatrix */ .GG)("textureMatrixRefraction")
], CubeTexture.prototype, "_textureMatrixRefraction", void 0);
_Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_5__/* .Texture */ .g._CubeTextureParser = CubeTexture.Parse;
// Some exporters relies on Tools.Instantiate
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .RegisterClass */ .Y5)("BABYLON.CubeTexture", CubeTexture);
//# sourceMappingURL=cubeTexture.js.map

/***/ }),

/***/ 47532:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   R: () => (/* binding */ DynamicTexture)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7481);
/* harmony import */ var _Engines_Extensions_engine_dynamicTexture_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27079);




/**
 * A class extending Texture allowing drawing on a texture
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/dynamicTexture
 */
class DynamicTexture extends _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_1__/* .Texture */ .g {
    /** @internal */
    constructor(name, canvasOrSize, sceneOrOptions, generateMipMaps = false, samplingMode = 3, format = 5, invertY) {
        const isScene = !sceneOrOptions || sceneOrOptions._isScene;
        const scene = isScene ? sceneOrOptions : sceneOrOptions?.scene;
        const noMipmap = isScene ? !generateMipMaps : sceneOrOptions;
        super(null, scene, noMipmap, invertY, samplingMode, undefined, undefined, undefined, undefined, format);
        this.name = name;
        this.wrapU = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_1__/* .Texture */ .g.CLAMP_ADDRESSMODE;
        this.wrapV = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_1__/* .Texture */ .g.CLAMP_ADDRESSMODE;
        this._generateMipMaps = generateMipMaps;
        const engine = this._getEngine();
        if (!engine) {
            return;
        }
        if (canvasOrSize.getContext) {
            this._canvas = canvasOrSize;
            this._ownCanvas = false;
            this._texture = engine.createDynamicTexture(this._canvas.width, this._canvas.height, generateMipMaps, samplingMode);
        }
        else {
            this._canvas = engine.createCanvas(1, 1);
            this._ownCanvas = true;
            const optionsAsSize = canvasOrSize;
            if (optionsAsSize.width || optionsAsSize.width === 0) {
                this._texture = engine.createDynamicTexture(optionsAsSize.width, optionsAsSize.height, generateMipMaps, samplingMode);
            }
            else {
                this._texture = engine.createDynamicTexture(canvasOrSize, canvasOrSize, generateMipMaps, samplingMode);
            }
        }
        const textureSize = this.getSize();
        if (this._canvas.width !== textureSize.width) {
            this._canvas.width = textureSize.width;
        }
        if (this._canvas.height !== textureSize.height) {
            this._canvas.height = textureSize.height;
        }
        this._context = this._canvas.getContext("2d");
    }
    /**
     * Get the current class name of the texture useful for serialization or dynamic coding.
     * @returns "DynamicTexture"
     */
    getClassName() {
        return "DynamicTexture";
    }
    /**
     * Gets the current state of canRescale
     */
    get canRescale() {
        return true;
    }
    _recreate(textureSize) {
        this._canvas.width = textureSize.width;
        this._canvas.height = textureSize.height;
        this.releaseInternalTexture();
        this._texture = this._getEngine().createDynamicTexture(textureSize.width, textureSize.height, this._generateMipMaps, this.samplingMode);
    }
    /**
     * Scales the texture
     * @param ratio the scale factor to apply to both width and height
     */
    scale(ratio) {
        const textureSize = this.getSize();
        textureSize.width *= ratio;
        textureSize.height *= ratio;
        this._recreate(textureSize);
    }
    /**
     * Resizes the texture
     * @param width the new width
     * @param height the new height
     */
    scaleTo(width, height) {
        const textureSize = this.getSize();
        textureSize.width = width;
        textureSize.height = height;
        this._recreate(textureSize);
    }
    /**
     * Gets the context of the canvas used by the texture
     * @returns the canvas context of the dynamic texture
     */
    getContext() {
        return this._context;
    }
    /**
     * Clears the texture
     * @param clearColor Defines the clear color to use
     */
    clear(clearColor) {
        const size = this.getSize();
        if (clearColor) {
            this._context.fillStyle = clearColor;
        }
        this._context.clearRect(0, 0, size.width, size.height);
    }
    /**
     * Updates the texture
     * @param invertY defines the direction for the Y axis (default is true - y increases downwards)
     * @param premulAlpha defines if alpha is stored as premultiplied (default is false)
     * @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature "allowGPUOptimizationsForGUI" being true)
     */
    update(invertY, premulAlpha = false, allowGPUOptimization = false) {
        this._getEngine().updateDynamicTexture(this._texture, this._canvas, invertY === undefined ? true : invertY, premulAlpha, this._format || undefined, undefined, allowGPUOptimization);
    }
    /**
     * Draws text onto the texture
     * @param text defines the text to be drawn
     * @param x defines the placement of the text from the left
     * @param y defines the placement of the text from the top when invertY is true and from the bottom when false
     * @param font defines the font to be used with font-style, font-size, font-name
     * @param color defines the color used for the text
     * @param fillColor defines the color for the canvas, use null to not overwrite canvas (this bleands with the background to replace, use the clear function)
     * @param invertY defines the direction for the Y axis (default is true - y increases downwards)
     * @param update defines whether texture is immediately update (default is true)
     */
    drawText(text, x, y, font, color, fillColor, invertY, update = true) {
        const size = this.getSize();
        if (fillColor) {
            this._context.fillStyle = fillColor;
            this._context.fillRect(0, 0, size.width, size.height);
        }
        this._context.font = font;
        if (x === null || x === undefined) {
            const textSize = this._context.measureText(text);
            x = (size.width - textSize.width) / 2;
        }
        if (y === null || y === undefined) {
            const fontSize = parseInt(font.replace(/\D/g, ""));
            y = size.height / 2 + fontSize / 3.65;
        }
        this._context.fillStyle = color || "";
        this._context.fillText(text, x, y);
        if (update) {
            this.update(invertY);
        }
    }
    /**
     * Disposes the dynamic texture.
     */
    dispose() {
        super.dispose();
        if (this._ownCanvas) {
            this._canvas?.remove?.();
        }
        this._canvas = null;
        this._context = null;
    }
    /**
     * Clones the texture
     * @returns the clone of the texture.
     */
    clone() {
        const scene = this.getScene();
        if (!scene) {
            return this;
        }
        const textureSize = this.getSize();
        const newTexture = new DynamicTexture(this.name, textureSize, scene, this._generateMipMaps);
        // Base texture
        newTexture.hasAlpha = this.hasAlpha;
        newTexture.level = this.level;
        // Dynamic Texture
        newTexture.wrapU = this.wrapU;
        newTexture.wrapV = this.wrapV;
        return newTexture;
    }
    /**
     * Serializes the dynamic texture.  The scene should be ready before the dynamic texture is serialized
     * @returns a serialized dynamic texture object
     */
    serialize() {
        const scene = this.getScene();
        if (scene && !scene.isReady()) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn("The scene must be ready before serializing the dynamic texture");
        }
        const serializationObject = super.serialize();
        if (DynamicTexture._IsCanvasElement(this._canvas)) {
            serializationObject.base64String = this._canvas.toDataURL();
        }
        serializationObject.invertY = this._invertY;
        serializationObject.samplingMode = this.samplingMode;
        return serializationObject;
    }
    static _IsCanvasElement(canvas) {
        return canvas.toDataURL !== undefined;
    }
    /** @internal */
    _rebuild() {
        this.update();
    }
}
//# sourceMappingURL=dynamicTexture.js.map

/***/ }),

/***/ 81194:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $l: () => (/* binding */ HasStencilAspect),
/* harmony export */   GV: () => (/* binding */ InternalTextureSource),
/* harmony export */   GX: () => (/* binding */ GetTypeForDepthTexture),
/* harmony export */   hV: () => (/* binding */ InternalTexture),
/* harmony export */   vl: () => (/* binding */ IsDepthTexture)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _textureSampler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38573);



/**
 * Defines the source of the internal texture
 */
var InternalTextureSource;
(function (InternalTextureSource) {
    /**
     * The source of the texture data is unknown
     */
    InternalTextureSource[InternalTextureSource["Unknown"] = 0] = "Unknown";
    /**
     * Texture data comes from an URL
     */
    InternalTextureSource[InternalTextureSource["Url"] = 1] = "Url";
    /**
     * Texture data is only used for temporary storage
     */
    InternalTextureSource[InternalTextureSource["Temp"] = 2] = "Temp";
    /**
     * Texture data comes from raw data (ArrayBuffer)
     */
    InternalTextureSource[InternalTextureSource["Raw"] = 3] = "Raw";
    /**
     * Texture content is dynamic (video or dynamic texture)
     */
    InternalTextureSource[InternalTextureSource["Dynamic"] = 4] = "Dynamic";
    /**
     * Texture content is generated by rendering to it
     */
    InternalTextureSource[InternalTextureSource["RenderTarget"] = 5] = "RenderTarget";
    /**
     * Texture content is part of a multi render target process
     */
    InternalTextureSource[InternalTextureSource["MultiRenderTarget"] = 6] = "MultiRenderTarget";
    /**
     * Texture data comes from a cube data file
     */
    InternalTextureSource[InternalTextureSource["Cube"] = 7] = "Cube";
    /**
     * Texture data comes from a raw cube data
     */
    InternalTextureSource[InternalTextureSource["CubeRaw"] = 8] = "CubeRaw";
    /**
     * Texture data come from a prefiltered cube data file
     */
    InternalTextureSource[InternalTextureSource["CubePrefiltered"] = 9] = "CubePrefiltered";
    /**
     * Texture content is raw 3D data
     */
    InternalTextureSource[InternalTextureSource["Raw3D"] = 10] = "Raw3D";
    /**
     * Texture content is raw 2D array data
     */
    InternalTextureSource[InternalTextureSource["Raw2DArray"] = 11] = "Raw2DArray";
    /**
     * Texture content is a depth/stencil texture
     */
    InternalTextureSource[InternalTextureSource["DepthStencil"] = 12] = "DepthStencil";
    /**
     * Texture data comes from a raw cube data encoded with RGBD
     */
    InternalTextureSource[InternalTextureSource["CubeRawRGBD"] = 13] = "CubeRawRGBD";
    /**
     * Texture content is a depth texture
     */
    InternalTextureSource[InternalTextureSource["Depth"] = 14] = "Depth";
})(InternalTextureSource || (InternalTextureSource = {}));
/**
 * Checks if a given format is a depth texture format
 * @param format Format to check
 * @returns True if the format is a depth texture format
 */
function IsDepthTexture(format) {
    return (format === 13 ||
        format === 14 ||
        format === 15 ||
        format === 16 ||
        format === 17 ||
        format === 18 ||
        format === 19);
}
/**
 * Gets the type of a depth texture for a given format
 * @param format Format of the texture
 * @returns The type of the depth texture
 */
function GetTypeForDepthTexture(format) {
    switch (format) {
        case 13:
        case 17:
        case 18:
        case 14:
        case 16:
            return 1;
        case 15:
            return 5;
        case 19:
            return 0;
    }
    return 0;
}
/**
 * Checks if a given format has a stencil aspect
 * @param format Format to check
 * @returns True if the format has a stencil aspect
 */
function HasStencilAspect(format) {
    return (format === 13 ||
        format === 17 ||
        format === 18 ||
        format === 19);
}
/**
 * Class used to store data associated with WebGL texture data for the engine
 * This class should not be used directly
 */
class InternalTexture extends _textureSampler_js__WEBPACK_IMPORTED_MODULE_1__/* .TextureSampler */ .u {
    /**
     * Gets a boolean indicating if the texture uses mipmaps
     * TODO implements useMipMaps as a separate setting from generateMipMaps
     */
    get useMipMaps() {
        return this.generateMipMaps;
    }
    set useMipMaps(value) {
        this.generateMipMaps = value;
    }
    /** Gets the unique id of the internal texture */
    get uniqueId() {
        return this._uniqueId;
    }
    /** @internal */
    _setUniqueId(id) {
        this._uniqueId = id;
    }
    /**
     * Gets the Engine the texture belongs to.
     * @returns The babylon engine
     */
    getEngine() {
        return this._engine;
    }
    /**
     * Gets the data source type of the texture
     */
    get source() {
        return this._source;
    }
    /**
     * Creates a new InternalTexture
     * @param engine defines the engine to use
     * @param source defines the type of data that will be used
     * @param delayAllocation if the texture allocation should be delayed (default: false)
     */
    constructor(engine, source, delayAllocation = false) {
        super();
        /**
         * Defines if the texture is ready
         */
        this.isReady = false;
        /**
         * Defines if the texture is a cube texture
         */
        this.isCube = false;
        /**
         * Defines if the texture contains 3D data
         */
        this.is3D = false;
        /**
         * Defines if the texture contains 2D array data
         */
        this.is2DArray = false;
        /**
         * Defines if the texture contains multiview data
         */
        this.isMultiview = false;
        /**
         * Gets the URL used to load this texture
         */
        this.url = "";
        /**
         * Gets a boolean indicating if the texture needs mipmaps generation
         */
        this.generateMipMaps = false;
        /**
         * Gets the number of samples used by the texture (WebGL2+ only)
         */
        this.samples = 0;
        /**
         * Gets the type of the texture (int, float...)
         */
        this.type = -1;
        /**
         * Gets the format of the texture (RGB, RGBA...)
         */
        this.format = -1;
        /**
         * Observable called when the texture is loaded
         */
        this.onLoadedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * Observable called when the texture load is raising an error
         */
        this.onErrorObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * If this callback is defined it will be called instead of the default _rebuild function
         */
        this.onRebuildCallback = null;
        /**
         * Gets the width of the texture
         */
        this.width = 0;
        /**
         * Gets the height of the texture
         */
        this.height = 0;
        /**
         * Gets the depth of the texture
         */
        this.depth = 0;
        /**
         * Gets the initial width of the texture (It could be rescaled if the current system does not support non power of two textures)
         */
        this.baseWidth = 0;
        /**
         * Gets the initial height of the texture (It could be rescaled if the current system does not support non power of two textures)
         */
        this.baseHeight = 0;
        /**
         * Gets the initial depth of the texture (It could be rescaled if the current system does not support non power of two textures)
         */
        this.baseDepth = 0;
        /**
         * Gets a boolean indicating if the texture is inverted on Y axis
         */
        this.invertY = false;
        // Private
        /** @internal */
        this._invertVScale = false;
        /** @internal */
        this._associatedChannel = -1;
        /** @internal */
        this._source = 0 /* InternalTextureSource.Unknown */;
        /** @internal */
        this._buffer = null;
        /** @internal */
        this._bufferView = null;
        /** @internal */
        this._bufferViewArray = null;
        /** @internal */
        this._bufferViewArrayArray = null;
        /** @internal */
        this._size = 0;
        /** @internal */
        this._extension = "";
        /** @internal */
        this._files = null;
        /** @internal */
        this._workingCanvas = null;
        /** @internal */
        this._workingContext = null;
        /** @internal */
        this._cachedCoordinatesMode = null;
        /** @internal */
        this._isDisabled = false;
        /** @internal */
        this._compression = null;
        /** @internal */
        this._sphericalPolynomial = null;
        /** @internal */
        this._sphericalPolynomialPromise = null;
        /** @internal */
        this._sphericalPolynomialComputed = false;
        /** @internal */
        this._lodGenerationScale = 0;
        /** @internal */
        this._lodGenerationOffset = 0;
        /** @internal */
        this._useSRGBBuffer = false;
        /** @internal */
        this._creationFlags = 0;
        // The following three fields helps sharing generated fixed LODs for texture filtering
        // In environment not supporting the textureLOD extension like EDGE. They are for internal use only.
        // They are at the level of the gl texture to benefit from the cache.
        /** @internal */
        this._lodTextureHigh = null;
        /** @internal */
        this._lodTextureMid = null;
        /** @internal */
        this._lodTextureLow = null;
        /** @internal */
        this._isRGBD = false;
        /** @internal */
        this._linearSpecularLOD = false;
        /** @internal */
        this._irradianceTexture = null;
        /** @internal */
        this._hardwareTexture = null;
        /** @internal */
        this._maxLodLevel = null;
        /** @internal */
        this._references = 1;
        /** @internal */
        this._gammaSpace = null;
        /** @internal */
        this._premulAlpha = false;
        /** @internal */
        this._dynamicTextureSource = null;
        /** @internal */
        this._autoMSAAManagement = false;
        this._engine = engine;
        this._source = source;
        this._uniqueId = InternalTexture._Counter++;
        if (!delayAllocation) {
            this._hardwareTexture = engine._createHardwareTexture();
        }
    }
    /**
     * Increments the number of references (ie. the number of Texture that point to it)
     */
    incrementReferences() {
        this._references++;
    }
    /**
     * Change the size of the texture (not the size of the content)
     * @param width defines the new width
     * @param height defines the new height
     * @param depth defines the new depth (1 by default)
     */
    updateSize(width, height, depth = 1) {
        this._engine.updateTextureDimensions(this, width, height, depth);
        this.width = width;
        this.height = height;
        this.depth = depth;
        this.baseWidth = width;
        this.baseHeight = height;
        this.baseDepth = depth;
        this._size = width * height * depth;
    }
    /** @internal */
    _rebuild() {
        this.isReady = false;
        this._cachedCoordinatesMode = null;
        this._cachedWrapU = null;
        this._cachedWrapV = null;
        this._cachedWrapR = null;
        this._cachedAnisotropicFilteringLevel = null;
        if (this.onRebuildCallback) {
            const data = this.onRebuildCallback(this);
            const swapAndSetIsReady = (proxyInternalTexture) => {
                proxyInternalTexture._swapAndDie(this, false);
                this.isReady = data.isReady;
            };
            if (data.isAsync) {
                data.proxy.then(swapAndSetIsReady);
            }
            else {
                swapAndSetIsReady(data.proxy);
            }
            return;
        }
        let proxy;
        switch (this.source) {
            case 2 /* InternalTextureSource.Temp */:
                break;
            case 1 /* InternalTextureSource.Url */:
                proxy = this._engine.createTexture(this._originalUrl ?? this.url, !this.generateMipMaps, this.invertY, null, this.samplingMode, 
                // Do not use Proxy here as it could be fully synchronous
                // and proxy would be undefined.
                (temp) => {
                    temp._swapAndDie(this, false);
                    this.isReady = true;
                }, null, this._buffer, undefined, this.format, this._extension, undefined, undefined, undefined, this._useSRGBBuffer);
                return;
            case 3 /* InternalTextureSource.Raw */:
                proxy = this._engine.createRawTexture(this._bufferView, this.baseWidth, this.baseHeight, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type, this._creationFlags, this._useSRGBBuffer);
                proxy._swapAndDie(this, false);
                this.isReady = true;
                break;
            case 10 /* InternalTextureSource.Raw3D */:
                proxy = this._engine.createRawTexture3D(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type);
                proxy._swapAndDie(this, false);
                this.isReady = true;
                break;
            case 11 /* InternalTextureSource.Raw2DArray */:
                proxy = this._engine.createRawTexture2DArray(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type);
                proxy._swapAndDie(this, false);
                this.isReady = true;
                break;
            case 4 /* InternalTextureSource.Dynamic */:
                proxy = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode);
                proxy._swapAndDie(this, false);
                if (this._dynamicTextureSource) {
                    this._engine.updateDynamicTexture(this, this._dynamicTextureSource, this.invertY, this._premulAlpha, this.format, true);
                }
                // The engine will make sure to update content so no need to flag it as isReady = true
                break;
            case 7 /* InternalTextureSource.Cube */:
                proxy = this._engine.createCubeTexture(this.url, null, this._files, !this.generateMipMaps, () => {
                    proxy._swapAndDie(this, false);
                    this.isReady = true;
                }, null, this.format, this._extension, false, 0, 0, null, undefined, this._useSRGBBuffer, ArrayBuffer.isView(this._buffer) ? this._buffer : null);
                return;
            case 8 /* InternalTextureSource.CubeRaw */:
                proxy = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this._originalFormat ?? this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression);
                proxy._swapAndDie(this, false);
                this.isReady = true;
                break;
            case 13 /* InternalTextureSource.CubeRawRGBD */:
                // This case is being handeled by the environment texture tools and is not a part of the rebuild process.
                // To use CubeRawRGBD use updateRGBDAsync on the cube texture.
                return;
            case 9 /* InternalTextureSource.CubePrefiltered */:
                proxy = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, (proxy) => {
                    if (proxy) {
                        proxy._swapAndDie(this, false);
                    }
                    this.isReady = true;
                }, null, this.format, this._extension);
                proxy._sphericalPolynomial = this._sphericalPolynomial;
                return;
            case 12 /* InternalTextureSource.DepthStencil */:
            case 14 /* InternalTextureSource.Depth */: {
                // Will be handled at the RenderTargetWrapper level
                break;
            }
        }
    }
    /**
     * @internal
     */
    _swapAndDie(target, swapAll = true) {
        // TODO what about refcount on target?
        this._hardwareTexture?.setUsage(target._source, this.generateMipMaps, this.is2DArray, this.isCube, this.is3D, this.width, this.height, this.depth);
        target._hardwareTexture = this._hardwareTexture;
        if (swapAll) {
            target._isRGBD = this._isRGBD;
        }
        if (this._lodTextureHigh) {
            if (target._lodTextureHigh) {
                target._lodTextureHigh.dispose();
            }
            target._lodTextureHigh = this._lodTextureHigh;
        }
        if (this._lodTextureMid) {
            if (target._lodTextureMid) {
                target._lodTextureMid.dispose();
            }
            target._lodTextureMid = this._lodTextureMid;
        }
        if (this._lodTextureLow) {
            if (target._lodTextureLow) {
                target._lodTextureLow.dispose();
            }
            target._lodTextureLow = this._lodTextureLow;
        }
        if (this._irradianceTexture) {
            if (target._irradianceTexture) {
                target._irradianceTexture.dispose();
            }
            target._irradianceTexture = this._irradianceTexture;
        }
        const cache = this._engine.getLoadedTexturesCache();
        let index = cache.indexOf(this);
        if (index !== -1) {
            cache.splice(index, 1);
        }
        index = cache.indexOf(target);
        if (index === -1) {
            cache.push(target);
        }
    }
    /**
     * Dispose the current allocated resources
     */
    dispose() {
        this._references--;
        this.onLoadedObservable.clear();
        this.onErrorObservable.clear();
        if (this._references === 0) {
            this._engine._releaseTexture(this);
            this._hardwareTexture = null;
            this._dynamicTextureSource = null;
        }
    }
}
/** @internal */
InternalTexture._Counter = 0;
//# sourceMappingURL=internalTexture.js.map

/***/ }),

/***/ 60572:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   GQ: () => (/* binding */ EngineFormat),
/* harmony export */   Ok: () => (/* binding */ SourceTextureFormat),
/* harmony export */   Xl: () => (/* binding */ TranscodeTarget)
/* harmony export */ });
var SourceTextureFormat;
(function (SourceTextureFormat) {
    SourceTextureFormat[SourceTextureFormat["ETC1S"] = 0] = "ETC1S";
    SourceTextureFormat[SourceTextureFormat["UASTC4x4"] = 1] = "UASTC4x4";
})(SourceTextureFormat || (SourceTextureFormat = {}));
var TranscodeTarget;
(function (TranscodeTarget) {
    TranscodeTarget[TranscodeTarget["ASTC_4X4_RGBA"] = 0] = "ASTC_4X4_RGBA";
    TranscodeTarget[TranscodeTarget["BC7_RGBA"] = 1] = "BC7_RGBA";
    TranscodeTarget[TranscodeTarget["BC3_RGBA"] = 2] = "BC3_RGBA";
    TranscodeTarget[TranscodeTarget["BC1_RGB"] = 3] = "BC1_RGB";
    TranscodeTarget[TranscodeTarget["PVRTC1_4_RGBA"] = 4] = "PVRTC1_4_RGBA";
    TranscodeTarget[TranscodeTarget["PVRTC1_4_RGB"] = 5] = "PVRTC1_4_RGB";
    TranscodeTarget[TranscodeTarget["ETC2_RGBA"] = 6] = "ETC2_RGBA";
    TranscodeTarget[TranscodeTarget["ETC1_RGB"] = 7] = "ETC1_RGB";
    TranscodeTarget[TranscodeTarget["RGBA32"] = 8] = "RGBA32";
    TranscodeTarget[TranscodeTarget["R8"] = 9] = "R8";
    TranscodeTarget[TranscodeTarget["RG8"] = 10] = "RG8";
})(TranscodeTarget || (TranscodeTarget = {}));
var EngineFormat;
(function (EngineFormat) {
    EngineFormat[EngineFormat["COMPRESSED_RGBA_BPTC_UNORM_EXT"] = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT";
    EngineFormat[EngineFormat["COMPRESSED_RGBA_ASTC_4X4_KHR"] = 37808] = "COMPRESSED_RGBA_ASTC_4X4_KHR";
    EngineFormat[EngineFormat["COMPRESSED_RGB_S3TC_DXT1_EXT"] = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT";
    EngineFormat[EngineFormat["COMPRESSED_RGBA_S3TC_DXT5_EXT"] = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT";
    EngineFormat[EngineFormat["COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"] = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG";
    EngineFormat[EngineFormat["COMPRESSED_RGB_PVRTC_4BPPV1_IMG"] = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG";
    EngineFormat[EngineFormat["COMPRESSED_RGBA8_ETC2_EAC"] = 37496] = "COMPRESSED_RGBA8_ETC2_EAC";
    EngineFormat[EngineFormat["COMPRESSED_RGB8_ETC2"] = 37492] = "COMPRESSED_RGB8_ETC2";
    EngineFormat[EngineFormat["COMPRESSED_RGB_ETC1_WEBGL"] = 36196] = "COMPRESSED_RGB_ETC1_WEBGL";
    EngineFormat[EngineFormat["RGBA8Format"] = 32856] = "RGBA8Format";
    EngineFormat[EngineFormat["R8Format"] = 33321] = "R8Format";
    EngineFormat[EngineFormat["RG8Format"] = 33323] = "RG8Format";
})(EngineFormat || (EngineFormat = {}));
//# sourceMappingURL=ktx2decoderTypes.js.map

/***/ }),

/***/ 61094:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   p: () => (/* binding */ RawCubeTexture)
/* harmony export */ });
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26877);
/* harmony import */ var _Misc_environmentTextureTools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32853);
/* harmony import */ var _cubeTexture_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34294);




/**
 * Raw cube texture where the raw buffers are passed in
 */
class RawCubeTexture extends _cubeTexture_js__WEBPACK_IMPORTED_MODULE_2__/* .CubeTexture */ .b {
    /**
     * Creates a cube texture where the raw buffers are passed in.
     * @param scene defines the scene the texture is attached to
     * @param data defines the array of data to use to create each face
     * @param size defines the size of the textures
     * @param format defines the format of the data
     * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_BYTE)
     * @param generateMipMaps  defines if the engine should generate the mip levels
     * @param invertY defines if data must be stored with Y axis inverted
     * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
     * @param compression defines the compression used (null by default)
     */
    constructor(scene, data, size, format = 5, type = 0, generateMipMaps = false, invertY = false, samplingMode = 3, compression = null) {
        super("", scene);
        this._texture = scene.getEngine().createRawCubeTexture(data, size, format, type, generateMipMaps, invertY, samplingMode, compression);
    }
    /**
     * Updates the raw cube texture.
     * @param data defines the data to store
     * @param format defines the data format
     * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)
     * @param invertY defines if data must be stored with Y axis inverted
     * @param compression defines the compression used (null by default)
     */
    update(data, format, type, invertY, compression = null) {
        this._texture.getEngine().updateRawCubeTexture(this._texture, data, format, type, invertY, compression);
    }
    /**
     * Updates a raw cube texture with RGBD encoded data.
     * @param data defines the array of data [mipmap][face] to use to create each face
     * @param sphericalPolynomial defines the spherical polynomial for irradiance
     * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
     * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
     * @returns a promise that resolves when the operation is complete
     */
    updateRGBDAsync(data, sphericalPolynomial = null, lodScale = 0.8, lodOffset = 0) {
        return (0,_Misc_environmentTextureTools_js__WEBPACK_IMPORTED_MODULE_1__/* ._UpdateRGBDAsync */ .gW)(this._texture, data, sphericalPolynomial, lodScale, lodOffset).then(() => { });
    }
    /**
     * Clones the raw cube texture.
     * @returns a new cube texture
     */
    clone() {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper */ .p.Clone(() => {
            const scene = this.getScene();
            const internalTexture = this._texture;
            const texture = new RawCubeTexture(scene, internalTexture._bufferViewArray, internalTexture.width, internalTexture.format, internalTexture.type, internalTexture.generateMipMaps, internalTexture.invertY, internalTexture.samplingMode, internalTexture._compression);
            if (internalTexture.source === 13 /* InternalTextureSource.CubeRawRGBD */) {
                texture.updateRGBDAsync(internalTexture._bufferViewArrayArray, internalTexture._sphericalPolynomial, internalTexture._lodGenerationScale, internalTexture._lodGenerationOffset);
            }
            return texture;
        }, this);
    }
}
//# sourceMappingURL=rawCubeTexture.js.map

/***/ }),

/***/ 96041:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   I: () => (/* binding */ RawTexture)
/* harmony export */ });
/* harmony import */ var _texture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7481);


/**
 * Raw texture can help creating a texture directly from an array of data.
 * This can be super useful if you either get the data from an uncompressed source or
 * if you wish to create your texture pixel by pixel.
 */
class RawTexture extends _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g {
    /**
     * Instantiates a new RawTexture.
     * Raw texture can help creating a texture directly from an array of data.
     * This can be super useful if you either get the data from an uncompressed source or
     * if you wish to create your texture pixel by pixel.
     * @param data define the array of data to use to create the texture (null to create an empty texture)
     * @param width define the width of the texture
     * @param height define the height of the texture
     * @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param generateMipMaps define whether mip maps should be generated or not
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     */
    constructor(data, width, height, 
    /**
     * Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)
     */
    format, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = 3, type = 0, creationFlags, useSRGBBuffer) {
        super(null, sceneOrEngine, !generateMipMaps, invertY, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, creationFlags);
        this.format = format;
        if (!this._engine) {
            return;
        }
        if (!this._engine._caps.textureFloatLinearFiltering && type === 1) {
            samplingMode = 1;
        }
        if (!this._engine._caps.textureHalfFloatLinearFiltering && type === 2) {
            samplingMode = 1;
        }
        this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false);
        this.wrapU = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.CLAMP_ADDRESSMODE;
        this.wrapV = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.CLAMP_ADDRESSMODE;
    }
    /**
     * Updates the texture underlying data.
     * @param data Define the new data of the texture
     */
    update(data) {
        this._getEngine().updateRawTexture(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type, this._texture._useSRGBBuffer);
    }
    /**
     * Clones the texture.
     * @returns the cloned texture
     */
    clone() {
        if (!this._texture) {
            return super.clone();
        }
        const rawTexture = new RawTexture(null, this.getSize().width, this.getSize().height, this.format, this.getScene(), this._texture.generateMipMaps, this._invertY, this.samplingMode, this._texture.type, this._texture._creationFlags, this._useSRGBBuffer);
        rawTexture._texture = this._texture;
        this._texture.incrementReferences();
        return rawTexture;
    }
    /**
     * Creates a luminance texture from some data.
     * @param data Define the texture data
     * @param width Define the width of the texture
     * @param height Define the height of the texture
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param generateMipMaps Define whether or not to create mip maps for the texture
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @returns the luminance texture
     */
    static CreateLuminanceTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = 3) {
        return new RawTexture(data, width, height, 1, sceneOrEngine, generateMipMaps, invertY, samplingMode);
    }
    /**
     * Creates a luminance alpha texture from some data.
     * @param data Define the texture data
     * @param width Define the width of the texture
     * @param height Define the height of the texture
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param generateMipMaps Define whether or not to create mip maps for the texture
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @returns the luminance alpha texture
     */
    static CreateLuminanceAlphaTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = 3) {
        return new RawTexture(data, width, height, 2, sceneOrEngine, generateMipMaps, invertY, samplingMode);
    }
    /**
     * Creates an alpha texture from some data.
     * @param data Define the texture data
     * @param width Define the width of the texture
     * @param height Define the height of the texture
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param generateMipMaps Define whether or not to create mip maps for the texture
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @returns the alpha texture
     */
    static CreateAlphaTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = 3) {
        return new RawTexture(data, width, height, 0, sceneOrEngine, generateMipMaps, invertY, samplingMode);
    }
    /**
     * Creates a RGB texture from some data.
     * @param data Define the texture data
     * @param width Define the width of the texture
     * @param height Define the height of the texture
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param generateMipMaps Define whether or not to create mip maps for the texture
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     * @returns the RGB alpha texture
     */
    static CreateRGBTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = 3, type = 0, creationFlags = 0, useSRGBBuffer = false) {
        return new RawTexture(data, width, height, 4, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);
    }
    /**
     * Creates a RGBA texture from some data.
     * @param data Define the texture data
     * @param width Define the width of the texture
     * @param height Define the height of the texture
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param generateMipMaps Define whether or not to create mip maps for the texture
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     * @returns the RGBA texture
     */
    static CreateRGBATexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = 3, type = 0, creationFlags = 0, useSRGBBuffer = false) {
        return new RawTexture(data, width, height, 5, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);
    }
    /**
     * Creates a RGBA storage texture from some data.
     * @param data Define the texture data
     * @param width Define the width of the texture
     * @param height Define the height of the texture
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param generateMipMaps Define whether or not to create mip maps for the texture
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     * @returns the RGBA texture
     */
    static CreateRGBAStorageTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = 3, type = 0, useSRGBBuffer = false) {
        return new RawTexture(data, width, height, 5, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, 1, useSRGBBuffer);
    }
    /**
     * Creates a R texture from some data.
     * @param data Define the texture data
     * @param width Define the width of the texture
     * @param height Define the height of the texture
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param generateMipMaps Define whether or not to create mip maps for the texture
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
     * @returns the R texture
     */
    static CreateRTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.TRILINEAR_SAMPLINGMODE, type = 1) {
        return new RawTexture(data, width, height, 6, sceneOrEngine, generateMipMaps, invertY, samplingMode, type);
    }
    /**
     * Creates a R storage texture from some data.
     * @param data Define the texture data
     * @param width Define the width of the texture
     * @param height Define the height of the texture
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param generateMipMaps Define whether or not to create mip maps for the texture
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
     * @returns the R texture
     */
    static CreateRStorageTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.TRILINEAR_SAMPLINGMODE, type = 1) {
        return new RawTexture(data, width, height, 6, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, 1);
    }
}
//# sourceMappingURL=rawTexture.js.map

/***/ }),

/***/ 12462:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   L: () => (/* binding */ RawTexture2DArray)
/* harmony export */ });
/* harmony import */ var _texture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7481);


/**
 * Class used to store 2D array textures containing user data
 */
class RawTexture2DArray extends _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g {
    /**
     * Gets the number of layers of the texture
     */
    get depth() {
        return this._depth;
    }
    /**
     * Create a new RawTexture2DArray
     * @param data defines the data of the texture
     * @param width defines the width of the texture
     * @param height defines the height of the texture
     * @param depth defines the number of layers of the texture
     * @param format defines the texture format to use
     * @param scene defines the hosting scene
     * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
     * @param invertY defines if texture must be stored with Y axis inverted
     * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)
     * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     */
    constructor(data, width, height, depth, 
    /** Gets or sets the texture format to use */
    format, scene, generateMipMaps = true, invertY = false, samplingMode = _texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.TRILINEAR_SAMPLINGMODE, textureType = 0, creationFlags) {
        super(null, scene, !generateMipMaps, invertY);
        this.format = format;
        this._texture = scene.getEngine().createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);
        this._depth = depth;
        this.is2DArray = true;
    }
    /**
     * Update the texture with new data
     * @param data defines the data to store in the texture
     */
    update(data) {
        if (!this._texture) {
            return;
        }
        this._getEngine().updateRawTexture2DArray(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);
    }
    /**
     * Creates a RGBA texture from some data.
     * @param data Define the texture data
     * @param width Define the width of the texture
     * @param height Define the height of the texture
     * @param depth defines the number of layers of the texture
     * @param scene defines the scene the texture will belong to
     * @param generateMipMaps Define whether or not to create mip maps for the texture
     * @param invertY define if the data should be flipped on Y when uploaded to the GPU
     * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
     * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
     * @returns the RGBA texture
     */
    static CreateRGBATexture(data, width, height, depth, scene, generateMipMaps = true, invertY = false, samplingMode = 3, type = 0) {
        return new RawTexture2DArray(data, width, height, depth, 5, scene, generateMipMaps, invertY, samplingMode, type);
    }
}
//# sourceMappingURL=rawTexture2DArray.js.map

/***/ }),

/***/ 75474:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $: () => (/* binding */ RenderTargetTexture)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7481);
/* harmony import */ var _PostProcesses_postProcessManager_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36096);
/* harmony import */ var _Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(91597);
/* harmony import */ var _effect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74420);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51137);
/* harmony import */ var _Rendering_objectRenderer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81283);









/**
 * Sets a depth stencil texture from a render target on the engine to be used in the shader.
 * @param channel Name of the sampler variable.
 * @param texture Texture to set.
 */
_effect_js__WEBPACK_IMPORTED_MODULE_5__/* .Effect */ .M.prototype.setDepthStencilTexture = function (channel, texture) {
    this._engine.setDepthStencilTexture(this._samplers[channel], this._uniforms[channel], texture, channel);
};
/**
 * This Helps creating a texture that will be created from a camera in your scene.
 * It is basically a dynamic texture that could be used to create special effects for instance.
 * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
 */
class RenderTargetTexture extends _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .g {
    /**
     * Use this predicate to dynamically define the list of mesh you want to render.
     * If set, the renderList property will be overwritten.
     */
    get renderListPredicate() {
        return this._objectRenderer.renderListPredicate;
    }
    set renderListPredicate(value) {
        this._objectRenderer.renderListPredicate = value;
    }
    /**
     * Use this list to define the list of mesh you want to render.
     */
    get renderList() {
        return this._objectRenderer.renderList;
    }
    set renderList(value) {
        this._objectRenderer.renderList = value;
    }
    /**
     * Define the list of particle systems to render in the texture. If not provided, will render all the particle systems of the scene.
     * Note that the particle systems are rendered only if renderParticles is set to true.
     */
    get particleSystemList() {
        return this._objectRenderer.particleSystemList;
    }
    set particleSystemList(value) {
        this._objectRenderer.particleSystemList = value;
    }
    /**
     * Use this function to overload the renderList array at rendering time.
     * Return null to render with the current renderList, else return the list of meshes to use for rendering.
     * For 2DArray RTT, layerOrFace is the index of the layer that is going to be rendered, else it is the faceIndex of
     * the cube (if the RTT is a cube, else layerOrFace=0).
     * The renderList passed to the function is the current render list (the one that will be used if the function returns null).
     * The length of this list is passed through renderListLength: don't use renderList.length directly because the array can
     * hold dummy elements!
     */
    get getCustomRenderList() {
        return this._objectRenderer.getCustomRenderList;
    }
    set getCustomRenderList(value) {
        this._objectRenderer.getCustomRenderList = value;
    }
    /**
     * Define if particles should be rendered in your texture (default: true).
     */
    get renderParticles() {
        return this._objectRenderer.renderParticles;
    }
    set renderParticles(value) {
        this._objectRenderer.renderParticles = value;
    }
    /**
     * Define if sprites should be rendered in your texture (default: false).
     */
    get renderSprites() {
        return this._objectRenderer.renderSprites;
    }
    set renderSprites(value) {
        this._objectRenderer.renderSprites = value;
    }
    /**
     * Force checking the layerMask property even if a custom list of meshes is provided (ie. if renderList is not undefined) (default: false).
     */
    get forceLayerMaskCheck() {
        return this._objectRenderer.forceLayerMaskCheck;
    }
    set forceLayerMaskCheck(value) {
        this._objectRenderer.forceLayerMaskCheck = value;
    }
    /**
     * Define the camera used to render the texture.
     */
    get activeCamera() {
        return this._objectRenderer.activeCamera;
    }
    set activeCamera(value) {
        this._objectRenderer.activeCamera = value;
    }
    /**
     * Override the mesh isReady function with your own one.
     */
    get customIsReadyFunction() {
        return this._objectRenderer.customIsReadyFunction;
    }
    set customIsReadyFunction(value) {
        this._objectRenderer.customIsReadyFunction = value;
    }
    /**
     * Override the render function of the texture with your own one.
     */
    get customRenderFunction() {
        return this._objectRenderer.customRenderFunction;
    }
    set customRenderFunction(value) {
        this._objectRenderer.customRenderFunction = value;
    }
    /**
     * Post-processes for this render target
     */
    get postProcesses() {
        return this._postProcesses;
    }
    get _prePassEnabled() {
        return !!this._prePassRenderTarget && this._prePassRenderTarget.enabled;
    }
    /**
     * Set a after unbind callback in the texture.
     * This has been kept for backward compatibility and use of onAfterUnbindObservable is recommended.
     */
    set onAfterUnbind(callback) {
        if (this._onAfterUnbindObserver) {
            this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver);
        }
        this._onAfterUnbindObserver = this.onAfterUnbindObservable.add(callback);
    }
    /**
     * An event triggered before rendering the texture
     */
    get onBeforeRenderObservable() {
        return this._objectRenderer.onBeforeRenderObservable;
    }
    /**
     * Set a before render callback in the texture.
     * This has been kept for backward compatibility and use of onBeforeRenderObservable is recommended.
     */
    set onBeforeRender(callback) {
        if (this._onBeforeRenderObserver) {
            this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
        }
        this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);
    }
    /**
     * An event triggered after rendering the texture
     */
    get onAfterRenderObservable() {
        return this._objectRenderer.onAfterRenderObservable;
    }
    /**
     * Set a after render callback in the texture.
     * This has been kept for backward compatibility and use of onAfterRenderObservable is recommended.
     */
    set onAfterRender(callback) {
        if (this._onAfterRenderObserver) {
            this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
        }
        this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);
    }
    /**
     * Set a clear callback in the texture.
     * This has been kept for backward compatibility and use of onClearObservable is recommended.
     */
    set onClear(callback) {
        if (this._onClearObserver) {
            this.onClearObservable.remove(this._onClearObserver);
        }
        this._onClearObserver = this.onClearObservable.add(callback);
    }
    /** @internal */
    get _waitingRenderList() {
        return this._objectRenderer._waitingRenderList;
    }
    /** @internal */
    set _waitingRenderList(value) {
        this._objectRenderer._waitingRenderList = value;
    }
    /**
     * Current render pass id of the render target texture. Note it can change over the rendering as there's a separate id for each face of a cube / each layer of an array layer!
     */
    get renderPassId() {
        return this._objectRenderer.renderPassId;
    }
    /**
     * Gets the render pass ids used by the render target texture. For a single render target the array length will be 1, for a cube texture it will be 6 and for
     * a 2D texture array it will return an array of ids the size of the 2D texture array
     */
    get renderPassIds() {
        return this._objectRenderer.renderPassIds;
    }
    /**
     * Gets the current value of the refreshId counter
     */
    get currentRefreshId() {
        return this._objectRenderer.currentRefreshId;
    }
    /**
     * Sets a specific material to be used to render a mesh/a list of meshes in this render target texture
     * @param mesh mesh or array of meshes
     * @param material material or array of materials to use for this render pass. If undefined is passed, no specific material will be used but the regular material instead (mesh.material). It's possible to provide an array of materials to use a different material for each rendering in the case of a cube texture (6 rendering) and a 2D texture array (as many rendering as the length of the array)
     */
    setMaterialForRendering(mesh, material) {
        this._objectRenderer.setMaterialForRendering(mesh, material);
    }
    /**
     * Define if the texture has multiple draw buffers or if false a single draw buffer.
     */
    get isMulti() {
        return this._renderTarget?.isMulti ?? false;
    }
    /**
     * Gets render target creation options that were used.
     */
    get renderTargetOptions() {
        return this._renderTargetOptions;
    }
    /**
     * Gets the render target wrapper associated with this render target
     */
    get renderTarget() {
        return this._renderTarget;
    }
    _onRatioRescale() {
        if (this._sizeRatio) {
            this.resize(this._initialSizeParameter);
        }
    }
    /**
     * Gets or sets the size of the bounding box associated with the texture (when in cube mode)
     * When defined, the cubemap will switch to local mode
     * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity
     * @example https://www.babylonjs-playground.com/#RNASML
     */
    set boundingBoxSize(value) {
        if (this._boundingBoxSize && this._boundingBoxSize.equals(value)) {
            return;
        }
        this._boundingBoxSize = value;
        const scene = this.getScene();
        if (scene) {
            scene.markAllMaterialsAsDirty(1);
        }
    }
    get boundingBoxSize() {
        return this._boundingBoxSize;
    }
    /**
     * In case the RTT has been created with a depth texture, get the associated
     * depth texture.
     * Otherwise, return null.
     */
    get depthStencilTexture() {
        return this._renderTarget?._depthStencilTexture ?? null;
    }
    /** @internal */
    constructor(name, size, scene, generateMipMaps = false, doNotChangeAspectRatio = true, type = 0, isCube = false, samplingMode = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .g.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = true, generateStencilBuffer = false, isMulti = false, format = 5, delayAllocation = false, samples, creationFlags, noColorAttachment = false, useSRGBBuffer = false) {
        let colorAttachment = undefined;
        let gammaSpace = true;
        if (typeof generateMipMaps === "object") {
            const options = generateMipMaps;
            generateMipMaps = !!options.generateMipMaps;
            doNotChangeAspectRatio = options.doNotChangeAspectRatio ?? true;
            type = options.type ?? 0;
            isCube = !!options.isCube;
            samplingMode = options.samplingMode ?? _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .g.TRILINEAR_SAMPLINGMODE;
            generateDepthBuffer = options.generateDepthBuffer ?? true;
            generateStencilBuffer = !!options.generateStencilBuffer;
            isMulti = !!options.isMulti;
            format = options.format ?? 5;
            delayAllocation = !!options.delayAllocation;
            samples = options.samples;
            creationFlags = options.creationFlags;
            noColorAttachment = !!options.noColorAttachment;
            useSRGBBuffer = !!options.useSRGBBuffer;
            colorAttachment = options.colorAttachment;
            gammaSpace = options.gammaSpace ?? gammaSpace;
        }
        super(null, scene, !generateMipMaps, undefined, samplingMode, undefined, undefined, undefined, undefined, format);
        /**
         * Define if the camera viewport should be respected while rendering the texture or if the render should be done to the entire texture.
         */
        this.ignoreCameraViewport = false;
        /**
         * An event triggered when the texture is unbind.
         */
        this.onBeforeBindObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * An event triggered when the texture is unbind.
         */
        this.onAfterUnbindObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * An event triggered after the texture clear
         */
        this.onClearObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * An event triggered when the texture is resized.
         */
        this.onResizeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /** @internal */
        this._cleared = false;
        /**
         * Skip the initial clear of the rtt at the beginning of the frame render loop
         */
        this.skipInitialClear = false;
        this._samples = 1;
        this._canRescale = true;
        this._renderTarget = null;
        /**
         * Gets or sets the center of the bounding box associated with the texture (when in cube mode)
         * It must define where the camera used to render the texture is set
         */
        this.boundingBoxPosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        this._dumpToolsLoading = false;
        scene = this.getScene();
        if (!scene) {
            return;
        }
        const engine = this.getScene().getEngine();
        this._gammaSpace = gammaSpace;
        this._coordinatesMode = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .g.PROJECTION_MODE;
        this.name = name;
        this.isRenderTarget = true;
        this._initialSizeParameter = size;
        this._processSizeParameter(size);
        this._objectRenderer = new _Rendering_objectRenderer_js__WEBPACK_IMPORTED_MODULE_7__/* .ObjectRenderer */ .P(name, scene, {
            numPasses: isCube ? 6 : this.getRenderLayers() || 1,
            doNotChangeAspectRatio,
        });
        this._objectRenderer.onBeforeRenderingManagerRenderObservable.add(() => {
            // Before clear
            for (const step of this._scene._beforeRenderTargetClearStage) {
                step.action(this, this._currentFaceIndex, this._currentLayer);
            }
            // Clear
            if (this.onClearObservable.hasObservers()) {
                this.onClearObservable.notifyObservers(engine);
            }
            else if (!this.skipInitialClear) {
                engine.clear(this.clearColor || this._scene.clearColor, true, true, true);
            }
            if (!this._doNotChangeAspectRatio) {
                this._scene.updateTransformMatrix(true);
            }
            // Before Camera Draw
            for (const step of this._scene._beforeRenderTargetDrawStage) {
                step.action(this, this._currentFaceIndex, this._currentLayer);
            }
        });
        this._objectRenderer.onAfterRenderingManagerRenderObservable.add(() => {
            // After Camera Draw
            for (const step of this._scene._afterRenderTargetDrawStage) {
                step.action(this, this._currentFaceIndex, this._currentLayer);
            }
            const saveGenerateMipMaps = this._texture?.generateMipMaps ?? false;
            if (this._texture) {
                this._texture.generateMipMaps = false; // if left true, the mipmaps will be generated (if this._texture.generateMipMaps = true) when the first post process binds its own RTT: by doing so it will unbind the current RTT,
                // which will trigger a mipmap generation. We don't want this because it's a wasted work, we will do an unbind of the current RTT at the end of the process (see unbindFrameBuffer) which will
                // trigger the generation of the final mipmaps
            }
            if (this._postProcessManager) {
                this._postProcessManager._finalizeFrame(false, this._renderTarget ?? undefined, this._currentFaceIndex, this._postProcesses, this.ignoreCameraViewport);
            }
            else if (this._currentUseCameraPostProcess) {
                this._scene.postProcessManager._finalizeFrame(false, this._renderTarget ?? undefined, this._currentFaceIndex);
            }
            for (const step of this._scene._afterRenderTargetPostProcessStage) {
                step.action(this, this._currentFaceIndex, this._currentLayer);
            }
            if (this._texture) {
                this._texture.generateMipMaps = saveGenerateMipMaps;
            }
            if (!this._doNotChangeAspectRatio) {
                this._scene.updateTransformMatrix(true);
            }
            // Dump ?
            if (this._currentDumpForDebug) {
                if (!this._dumpTools) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_6__/* .Logger */ .V.Error("dumpTools module is still being loaded. To speed up the process import dump tools directly in your project");
                }
                else {
                    this._dumpTools.DumpFramebuffer(this.getRenderWidth(), this.getRenderHeight(), engine);
                }
            }
        });
        this._objectRenderer.onFastPathRenderObservable.add(() => {
            if (this.onClearObservable.hasObservers()) {
                this.onClearObservable.notifyObservers(engine);
            }
            else {
                if (!this.skipInitialClear) {
                    engine.clear(this.clearColor || this._scene.clearColor, true, true, true);
                }
            }
        });
        this._resizeObserver = engine.onResizeObservable.add(() => { });
        this._generateMipMaps = generateMipMaps ? true : false;
        this._doNotChangeAspectRatio = doNotChangeAspectRatio;
        if (isMulti) {
            return;
        }
        this._renderTargetOptions = {
            generateMipMaps: generateMipMaps,
            type: type,
            format: this._format ?? undefined,
            samplingMode: this.samplingMode,
            generateDepthBuffer: generateDepthBuffer,
            generateStencilBuffer: generateStencilBuffer,
            samples,
            creationFlags,
            noColorAttachment: noColorAttachment,
            useSRGBBuffer,
            colorAttachment: colorAttachment,
            label: this.name,
        };
        if (this.samplingMode === _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .g.NEAREST_SAMPLINGMODE) {
            this.wrapU = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .g.CLAMP_ADDRESSMODE;
            this.wrapV = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .g.CLAMP_ADDRESSMODE;
        }
        if (!delayAllocation) {
            if (isCube) {
                this._renderTarget = scene.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions);
                this.coordinatesMode = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .g.INVCUBIC_MODE;
                this._textureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity();
            }
            else {
                this._renderTarget = scene.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions);
            }
            this._texture = this._renderTarget.texture;
            if (samples !== undefined) {
                this.samples = samples;
            }
        }
    }
    /**
     * Creates a depth stencil texture.
     * This is only available in WebGL 2 or with the depth texture extension available.
     * @param comparisonFunction Specifies the comparison function to set on the texture. If 0 or undefined, the texture is not in comparison mode (default: 0)
     * @param bilinearFiltering Specifies whether or not bilinear filtering is enable on the texture (default: true)
     * @param generateStencil Specifies whether or not a stencil should be allocated in the texture (default: false)
     * @param samples sample count of the depth/stencil texture (default: 1)
     * @param format format of the depth texture (default: 14)
     * @param label defines the label of the texture (for debugging purpose)
     */
    createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = true, generateStencil = false, samples = 1, format = 14, label) {
        this._renderTarget?.createDepthStencilTexture(comparisonFunction, bilinearFiltering, generateStencil, samples, format, label);
    }
    _processSizeParameter(size) {
        if (size.ratio) {
            this._sizeRatio = size.ratio;
            const engine = this._getEngine();
            this._size = {
                width: this._bestReflectionRenderTargetDimension(engine.getRenderWidth(), this._sizeRatio),
                height: this._bestReflectionRenderTargetDimension(engine.getRenderHeight(), this._sizeRatio),
            };
        }
        else {
            this._size = size;
        }
    }
    /**
     * Define the number of samples to use in case of MSAA.
     * It defaults to one meaning no MSAA has been enabled.
     */
    get samples() {
        return this._renderTarget?.samples ?? this._samples;
    }
    set samples(value) {
        if (this._renderTarget) {
            this._samples = this._renderTarget.setSamples(value);
        }
    }
    /**
     * Adds a post process to the render target rendering passes.
     * @param postProcess define the post process to add
     */
    addPostProcess(postProcess) {
        if (!this._postProcessManager) {
            const scene = this.getScene();
            if (!scene) {
                return;
            }
            this._postProcessManager = new _PostProcesses_postProcessManager_js__WEBPACK_IMPORTED_MODULE_3__/* .PostProcessManager */ .X(scene);
            this._postProcesses = new Array();
        }
        this._postProcesses.push(postProcess);
        this._postProcesses[0].autoClear = false;
    }
    /**
     * Clear all the post processes attached to the render target
     * @param dispose define if the cleared post processes should also be disposed (false by default)
     */
    clearPostProcesses(dispose = false) {
        if (!this._postProcesses) {
            return;
        }
        if (dispose) {
            for (const postProcess of this._postProcesses) {
                postProcess.dispose();
            }
        }
        this._postProcesses = [];
    }
    /**
     * Remove one of the post process from the list of attached post processes to the texture
     * @param postProcess define the post process to remove from the list
     */
    removePostProcess(postProcess) {
        if (!this._postProcesses) {
            return;
        }
        const index = this._postProcesses.indexOf(postProcess);
        if (index === -1) {
            return;
        }
        this._postProcesses.splice(index, 1);
        if (this._postProcesses.length > 0) {
            this._postProcesses[0].autoClear = false;
        }
    }
    /**
     * Resets the refresh counter of the texture and start bak from scratch.
     * Could be useful to regenerate the texture if it is setup to render only once.
     */
    resetRefreshCounter() {
        this._objectRenderer.resetRefreshCounter();
    }
    /**
     * Define the refresh rate of the texture or the rendering frequency.
     * Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...
     */
    get refreshRate() {
        return this._objectRenderer.refreshRate;
    }
    set refreshRate(value) {
        this._objectRenderer.refreshRate = value;
    }
    /** @internal */
    _shouldRender() {
        return this._objectRenderer.shouldRender();
    }
    /**
     * Gets the actual render size of the texture.
     * @returns the width of the render size
     */
    getRenderSize() {
        return this.getRenderWidth();
    }
    /**
     * Gets the actual render width of the texture.
     * @returns the width of the render size
     */
    getRenderWidth() {
        if (this._size.width) {
            return this._size.width;
        }
        return this._size;
    }
    /**
     * Gets the actual render height of the texture.
     * @returns the height of the render size
     */
    getRenderHeight() {
        if (this._size.width) {
            return this._size.height;
        }
        return this._size;
    }
    /**
     * Gets the actual number of layers of the texture or, in the case of a 3D texture, return the depth.
     * @returns the number of layers
     */
    getRenderLayers() {
        const layers = this._size.layers;
        if (layers) {
            return layers;
        }
        const depth = this._size.depth;
        if (depth) {
            return depth;
        }
        return 0;
    }
    /**
     * Don't allow this render target texture to rescale. Mainly used to prevent rescaling by the scene optimizer.
     */
    disableRescaling() {
        this._canRescale = false;
    }
    /**
     * Get if the texture can be rescaled or not.
     */
    get canRescale() {
        return this._canRescale;
    }
    /**
     * Resize the texture using a ratio.
     * @param ratio the ratio to apply to the texture size in order to compute the new target size
     */
    scale(ratio) {
        const newSize = Math.max(1, this.getRenderSize() * ratio);
        this.resize(newSize);
    }
    /**
     * Get the texture reflection matrix used to rotate/transform the reflection.
     * @returns the reflection matrix
     */
    getReflectionTextureMatrix() {
        if (this.isCube) {
            return this._textureMatrix;
        }
        return super.getReflectionTextureMatrix();
    }
    /**
     * Resize the texture to a new desired size.
     * Be careful as it will recreate all the data in the new texture.
     * @param size Define the new size. It can be:
     *   - a number for squared texture,
     *   - an object containing { width: number, height: number }
     *   - or an object containing a ratio { ratio: number }
     */
    resize(size) {
        const wasCube = this.isCube;
        this._renderTarget?.dispose();
        this._renderTarget = null;
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        this._processSizeParameter(size);
        if (wasCube) {
            this._renderTarget = scene.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions);
        }
        else {
            this._renderTarget = scene.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions);
        }
        this._texture = this._renderTarget.texture;
        if (this._renderTargetOptions.samples !== undefined) {
            this.samples = this._renderTargetOptions.samples;
        }
        if (this.onResizeObservable.hasObservers()) {
            this.onResizeObservable.notifyObservers(this);
        }
    }
    /**
     * Renders all the objects from the render list into the texture.
     * @param useCameraPostProcess Define if camera post processes should be used during the rendering
     * @param dumpForDebug Define if the rendering result should be dumped (copied) for debugging purpose
     */
    render(useCameraPostProcess = false, dumpForDebug = false) {
        this._render(useCameraPostProcess, dumpForDebug);
    }
    /**
     * This function will check if the render target texture can be rendered (textures are loaded, shaders are compiled)
     * @returns true if all required resources are ready
     */
    isReadyForRendering() {
        if (!this._dumpToolsLoading) {
            this._dumpToolsLoading = true;
            // avoid a static import to allow ignoring the import in some cases
            Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 89928)).then((module) => (this._dumpTools = module));
        }
        this._objectRenderer.prepareRenderList();
        this.onBeforeBindObservable.notifyObservers(this);
        this._objectRenderer.initRender(this.getRenderWidth(), this.getRenderHeight());
        const isReady = this._objectRenderer._checkReadiness();
        this.onAfterUnbindObservable.notifyObservers(this);
        this._objectRenderer.finishRender();
        return isReady;
    }
    _render(useCameraPostProcess = false, dumpForDebug = false) {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        if (this.useCameraPostProcesses !== undefined) {
            useCameraPostProcess = this.useCameraPostProcesses;
        }
        this._objectRenderer.prepareRenderList();
        this.onBeforeBindObservable.notifyObservers(this);
        this._objectRenderer.initRender(this.getRenderWidth(), this.getRenderHeight());
        if ((this.is2DArray || this.is3D) && !this.isMulti) {
            for (let layer = 0; layer < this.getRenderLayers(); layer++) {
                this._renderToTarget(0, useCameraPostProcess, dumpForDebug, layer);
                scene.incrementRenderId();
                scene.resetCachedMaterial();
            }
        }
        else if (this.isCube && !this.isMulti) {
            for (let face = 0; face < 6; face++) {
                this._renderToTarget(face, useCameraPostProcess, dumpForDebug);
                scene.incrementRenderId();
                scene.resetCachedMaterial();
            }
        }
        else {
            this._renderToTarget(0, useCameraPostProcess, dumpForDebug);
        }
        this.onAfterUnbindObservable.notifyObservers(this);
        this._objectRenderer.finishRender();
    }
    _bestReflectionRenderTargetDimension(renderDimension, scale) {
        const minimum = 128;
        const x = renderDimension * scale;
        const curved = (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_4__/* .NearestPOT */ .OG)(x + (minimum * minimum) / (minimum + x));
        // Ensure we don't exceed the render dimension (while staying POT)
        return Math.min((0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_4__/* .FloorPOT */ .C4)(renderDimension), curved);
    }
    /**
     * @internal
     * @param faceIndex face index to bind to if this is a cubetexture
     * @param layer defines the index of the texture to bind in the array
     */
    _bindFrameBuffer(faceIndex = 0, layer = 0) {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        const engine = scene.getEngine();
        if (this._renderTarget) {
            engine.bindFramebuffer(this._renderTarget, this.isCube ? faceIndex : undefined, undefined, undefined, this.ignoreCameraViewport, 0, layer);
        }
    }
    _unbindFrameBuffer(engine, faceIndex) {
        if (!this._renderTarget) {
            return;
        }
        engine.unBindFramebuffer(this._renderTarget, this.isCube, () => {
            this.onAfterRenderObservable.notifyObservers(faceIndex);
        });
    }
    /**
     * @internal
     */
    _prepareFrame(scene, faceIndex, layer, useCameraPostProcess) {
        if (this._postProcessManager) {
            if (!this._prePassEnabled) {
                this._postProcessManager._prepareFrame(this._texture, this._postProcesses);
            }
        }
        else if (!useCameraPostProcess || !scene.postProcessManager._prepareFrame(this._texture)) {
            this._bindFrameBuffer(faceIndex, layer);
        }
    }
    _renderToTarget(faceIndex, useCameraPostProcess, dumpForDebug, layer = 0) {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        const engine = scene.getEngine();
        this._currentFaceIndex = faceIndex;
        this._currentLayer = layer;
        this._currentUseCameraPostProcess = useCameraPostProcess;
        this._currentDumpForDebug = dumpForDebug;
        this._prepareFrame(scene, faceIndex, layer, useCameraPostProcess);
        engine._debugPushGroup?.(`render to face #${faceIndex} layer #${layer}`, 2);
        this._objectRenderer.render(faceIndex + layer, true); // only faceIndex or layer (if any) will be different from 0 (we don't support array of cubes), so it's safe to add them to get the pass index
        engine._debugPopGroup?.(2);
        this._unbindFrameBuffer(engine, faceIndex);
        if (this._texture && this.isCube && faceIndex === 5) {
            engine.generateMipMapsForCubemap(this._texture, true);
        }
    }
    /**
     * Overrides the default sort function applied in the rendering group to prepare the meshes.
     * This allowed control for front to back rendering or reversely depending of the special needs.
     *
     * @param renderingGroupId The rendering group id corresponding to its index
     * @param opaqueSortCompareFn The opaque queue comparison function use to sort.
     * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
     * @param transparentSortCompareFn The transparent queue comparison function use to sort.
     */
    setRenderingOrder(renderingGroupId, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {
        this._objectRenderer.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn);
    }
    /**
     * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
     *
     * @param renderingGroupId The rendering group id corresponding to its index
     * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
     */
    setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil) {
        this._objectRenderer.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil);
    }
    /**
     * Clones the texture.
     * @returns the cloned texture
     */
    clone() {
        const textureSize = this.getSize();
        const newTexture = new RenderTargetTexture(this.name, textureSize, this.getScene(), this._renderTargetOptions.generateMipMaps, this._doNotChangeAspectRatio, this._renderTargetOptions.type, this.isCube, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer, this._renderTargetOptions.generateStencilBuffer, undefined, this._renderTargetOptions.format, undefined, this._renderTargetOptions.samples);
        // Base texture
        newTexture.hasAlpha = this.hasAlpha;
        newTexture.level = this.level;
        // RenderTarget Texture
        newTexture.coordinatesMode = this.coordinatesMode;
        if (this.renderList) {
            newTexture.renderList = this.renderList.slice(0);
        }
        return newTexture;
    }
    /**
     * Serialize the texture to a JSON representation we can easily use in the respective Parse function.
     * @returns The JSON representation of the texture
     */
    serialize() {
        if (!this.name) {
            return null;
        }
        const serializationObject = super.serialize();
        serializationObject.renderTargetSize = this.getRenderSize();
        serializationObject.renderList = [];
        if (this.renderList) {
            for (let index = 0; index < this.renderList.length; index++) {
                serializationObject.renderList.push(this.renderList[index].id);
            }
        }
        return serializationObject;
    }
    /**
     *  This will remove the attached framebuffer objects. The texture will not be able to be used as render target anymore
     */
    disposeFramebufferObjects() {
        this._renderTarget?.dispose(true);
    }
    /**
     * Release and destroy the underlying lower level texture aka internalTexture.
     */
    releaseInternalTexture() {
        this._renderTarget?.releaseTextures();
        this._texture = null;
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() {
        this.onResizeObservable.clear();
        this.onClearObservable.clear();
        this.onAfterUnbindObservable.clear();
        this.onBeforeBindObservable.clear();
        if (this._postProcessManager) {
            this._postProcessManager.dispose();
            this._postProcessManager = null;
        }
        if (this._prePassRenderTarget) {
            this._prePassRenderTarget.dispose();
        }
        this._objectRenderer.dispose();
        this.clearPostProcesses(true);
        if (this._resizeObserver) {
            this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver);
            this._resizeObserver = null;
        }
        // Remove from custom render targets
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        let index = scene.customRenderTargets.indexOf(this);
        if (index >= 0) {
            scene.customRenderTargets.splice(index, 1);
        }
        for (const camera of scene.cameras) {
            index = camera.customRenderTargets.indexOf(this);
            if (index >= 0) {
                camera.customRenderTargets.splice(index, 1);
            }
        }
        this._renderTarget?.dispose();
        this._renderTarget = null;
        this._texture = null;
        super.dispose();
    }
    /** @internal */
    _rebuild() {
        this._objectRenderer._rebuild();
        if (this._postProcessManager) {
            this._postProcessManager._rebuild();
        }
    }
    /**
     * Clear the info related to rendering groups preventing retention point in material dispose.
     */
    freeRenderingGroups() {
        this._objectRenderer.freeRenderingGroups();
    }
    /**
     * Gets the number of views the corresponding to the texture (eg. a MultiviewRenderTarget will have > 1)
     * @returns the view count
     */
    getViewCount() {
        return 1;
    }
}
/**
 * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
 */
RenderTargetTexture.REFRESHRATE_RENDER_ONCE = _Rendering_objectRenderer_js__WEBPACK_IMPORTED_MODULE_7__/* .ObjectRenderer */ .P.REFRESHRATE_RENDER_ONCE;
/**
 * The texture will be rendered every frame and is recommended for dynamic contents.
 */
RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME = _Rendering_objectRenderer_js__WEBPACK_IMPORTED_MODULE_7__/* .ObjectRenderer */ .P.REFRESHRATE_RENDER_ONEVERYFRAME;
/**
 * The texture will be rendered every 2 frames which could be enough if your dynamic objects are not
 * the central point of your effect and can save a lot of performances.
 */
RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = _Rendering_objectRenderer_js__WEBPACK_IMPORTED_MODULE_7__/* .ObjectRenderer */ .P.REFRESHRATE_RENDER_ONEVERYTWOFRAMES;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_2__/* .Texture */ .g._CreateRenderTargetTexture = (name, renderTargetSize, scene, generateMipMaps, creationFlags) => {
    return new RenderTargetTexture(name, renderTargetSize, scene, generateMipMaps);
};
//# sourceMappingURL=renderTargetTexture.js.map

/***/ }),

/***/ 7481:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   g: () => (/* binding */ Texture)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56526);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(56552);
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(45503);
/* harmony import */ var _Misc_timingTools_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2940);
/* harmony import */ var _Misc_instantiationTools_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(79337);
/* harmony import */ var _Maths_math_plane_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(94100);
/* harmony import */ var _Misc_stringTools_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(36181);
/* harmony import */ var _Misc_copyTools_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(95625);
/* harmony import */ var _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91313);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(26877);















/**
 * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture
 */
class Texture extends _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_4__/* .BaseTexture */ .t {
    /**
     * @internal
     */
    static _CreateVideoTexture(name, src, scene, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_6__/* ._WarnImport */ .n)("VideoTexture");
    }
    /**
     * Are mip maps generated for this texture or not.
     */
    get noMipmap() {
        return this._noMipmap;
    }
    /** Returns the texture mime type if it was defined by a loader (undefined else) */
    get mimeType() {
        return this._mimeType;
    }
    /**
     * Is the texture preventing material to render while loading.
     * If false, a default texture will be used instead of the loading one during the preparation step.
     */
    set isBlocking(value) {
        this._isBlocking = value;
    }
    get isBlocking() {
        return this._isBlocking;
    }
    /**
     * Gets a boolean indicating if the texture needs to be inverted on the y axis during loading
     */
    get invertY() {
        return this._invertY;
    }
    /**
     * Instantiates a new texture.
     * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture
     * @param url defines the url of the picture to load as a texture
     * @param sceneOrEngine defines the scene or engine the texture will belong to
     * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
     * @param invertY defines if the texture needs to be inverted on the y axis during loading
     * @param samplingMode defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
     * @param onLoad defines a callback triggered when the texture has been loaded
     * @param onError defines a callback triggered when an error occurred during the loading session
     * @param buffer defines the buffer to load the texture from in case the texture is loaded from a buffer representation
     * @param deleteBuffer defines if the buffer we are loading the texture from should be deleted after load
     * @param format defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
     * @param mimeType defines an optional mime type information
     * @param loaderOptions options to be passed to the loader
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param forcedExtension defines the extension to use to pick the right loader
     */
    constructor(url, sceneOrEngine, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, buffer = null, deleteBuffer = false, format, mimeType, loaderOptions, creationFlags, forcedExtension) {
        super(sceneOrEngine);
        /**
         * Define the url of the texture.
         */
        this.url = null;
        /**
         * Define an offset on the texture to offset the u coordinates of the UVs
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting
         */
        this.uOffset = 0;
        /**
         * Define an offset on the texture to offset the v coordinates of the UVs
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting
         */
        this.vOffset = 0;
        /**
         * Define an offset on the texture to scale the u coordinates of the UVs
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling
         */
        this.uScale = 1.0;
        /**
         * Define an offset on the texture to scale the v coordinates of the UVs
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling
         */
        this.vScale = 1.0;
        /**
         * Define an offset on the texture to rotate around the u coordinates of the UVs
         * The angle is defined in radians.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials
         */
        this.uAng = 0;
        /**
         * Define an offset on the texture to rotate around the v coordinates of the UVs
         * The angle is defined in radians.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials
         */
        this.vAng = 0;
        /**
         * Define an offset on the texture to rotate around the w coordinates of the UVs (in case of 3d texture)
         * The angle is defined in radians.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials
         */
        this.wAng = 0;
        /**
         * Defines the center of rotation (U)
         */
        this.uRotationCenter = 0.5;
        /**
         * Defines the center of rotation (V)
         */
        this.vRotationCenter = 0.5;
        /**
         * Defines the center of rotation (W)
         */
        this.wRotationCenter = 0.5;
        /**
         * Sets this property to true to avoid deformations when rotating the texture with non-uniform scaling
         */
        this.homogeneousRotationInUVTransform = false;
        /**
         * List of inspectable custom properties (used by the Inspector)
         * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility
         */
        this.inspectableCustomProperties = null;
        /** @internal */
        this._noMipmap = false;
        /** @internal */
        this._invertY = false;
        this._rowGenerationMatrix = null;
        this._cachedTextureMatrix = null;
        this._projectionModeMatrix = null;
        this._t0 = null;
        this._t1 = null;
        this._t2 = null;
        this._cachedUOffset = -1;
        this._cachedVOffset = -1;
        this._cachedUScale = 0;
        this._cachedVScale = 0;
        this._cachedUAng = -1;
        this._cachedVAng = -1;
        this._cachedWAng = -1;
        this._cachedReflectionProjectionMatrixId = -1;
        this._cachedURotationCenter = -1;
        this._cachedVRotationCenter = -1;
        this._cachedWRotationCenter = -1;
        this._cachedHomogeneousRotationInUVTransform = false;
        this._cachedIdentity3x2 = true;
        this._cachedReflectionTextureMatrix = null;
        this._cachedReflectionUOffset = -1;
        this._cachedReflectionVOffset = -1;
        this._cachedReflectionUScale = 0;
        this._cachedReflectionVScale = 0;
        this._cachedReflectionCoordinatesMode = -1;
        /** @internal */
        this._buffer = null;
        this._deleteBuffer = false;
        this._format = null;
        this._delayedOnLoad = null;
        this._delayedOnError = null;
        /**
         * Observable triggered once the texture has been loaded.
         */
        this.onLoadObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        this._isBlocking = true;
        this.name = url || "";
        this.url = url;
        let noMipmap;
        let useSRGBBuffer = false;
        let internalTexture = null;
        let gammaSpace = true;
        if (typeof noMipmapOrOptions === "object" && noMipmapOrOptions !== null) {
            noMipmap = noMipmapOrOptions.noMipmap ?? false;
            invertY = noMipmapOrOptions.invertY ?? !_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_12__/* .useOpenGLOrientationForUV */ .rX;
            samplingMode = noMipmapOrOptions.samplingMode ?? Texture.TRILINEAR_SAMPLINGMODE;
            onLoad = noMipmapOrOptions.onLoad ?? null;
            onError = noMipmapOrOptions.onError ?? null;
            buffer = noMipmapOrOptions.buffer ?? null;
            deleteBuffer = noMipmapOrOptions.deleteBuffer ?? false;
            format = noMipmapOrOptions.format;
            mimeType = noMipmapOrOptions.mimeType;
            loaderOptions = noMipmapOrOptions.loaderOptions;
            creationFlags = noMipmapOrOptions.creationFlags;
            useSRGBBuffer = noMipmapOrOptions.useSRGBBuffer ?? false;
            internalTexture = noMipmapOrOptions.internalTexture ?? null;
            gammaSpace = noMipmapOrOptions.gammaSpace ?? gammaSpace;
            forcedExtension = noMipmapOrOptions.forcedExtension ?? forcedExtension;
        }
        else {
            noMipmap = !!noMipmapOrOptions;
        }
        this._gammaSpace = gammaSpace;
        this._noMipmap = noMipmap;
        this._invertY = invertY === undefined ? !_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_12__/* .useOpenGLOrientationForUV */ .rX : invertY;
        this._initialSamplingMode = samplingMode;
        this._buffer = buffer;
        this._deleteBuffer = deleteBuffer;
        this._mimeType = mimeType;
        this._loaderOptions = loaderOptions;
        this._creationFlags = creationFlags;
        this._useSRGBBuffer = useSRGBBuffer;
        this._forcedExtension = forcedExtension;
        if (format) {
            this._format = format;
        }
        const scene = this.getScene();
        const engine = this._getEngine();
        if (!engine) {
            return;
        }
        engine.onBeforeTextureInitObservable.notifyObservers(this);
        const load = () => {
            if (this._texture) {
                if (this._texture._invertVScale) {
                    this.vScale *= -1;
                    this.vOffset += 1;
                }
                // Update texture to match internal texture's wrapping
                if (this._texture._cachedWrapU !== null) {
                    this.wrapU = this._texture._cachedWrapU;
                    this._texture._cachedWrapU = null;
                }
                if (this._texture._cachedWrapV !== null) {
                    this.wrapV = this._texture._cachedWrapV;
                    this._texture._cachedWrapV = null;
                }
                if (this._texture._cachedWrapR !== null) {
                    this.wrapR = this._texture._cachedWrapR;
                    this._texture._cachedWrapR = null;
                }
            }
            if (this.onLoadObservable.hasObservers()) {
                this.onLoadObservable.notifyObservers(this);
            }
            if (onLoad) {
                onLoad();
            }
            if (!this.isBlocking && scene) {
                scene.resetCachedMaterial();
            }
        };
        const errorHandler = (message, exception) => {
            this._loadingError = true;
            this._errorObject = { message, exception };
            if (onError) {
                onError(message, exception);
            }
            Texture.OnTextureLoadErrorObservable.notifyObservers(this);
        };
        if (!this.url && !internalTexture) {
            this._delayedOnLoad = load;
            this._delayedOnError = errorHandler;
            return;
        }
        this._texture = internalTexture ?? this._getFromCache(this.url, noMipmap, samplingMode, this._invertY, useSRGBBuffer, this.isCube);
        if (!this._texture) {
            if (!scene || !scene.useDelayedTextureLoading) {
                try {
                    this._texture = engine.createTexture(this.url, noMipmap, this._invertY, scene, samplingMode, load, errorHandler, this._buffer, undefined, this._format, this._forcedExtension, mimeType, loaderOptions, creationFlags, useSRGBBuffer);
                }
                catch (e) {
                    errorHandler("error loading", e);
                    throw e;
                }
                if (deleteBuffer) {
                    this._buffer = null;
                }
            }
            else {
                this.delayLoadState = 4;
                this._delayedOnLoad = load;
                this._delayedOnError = errorHandler;
            }
        }
        else {
            if (this._texture.isReady) {
                _Misc_timingTools_js__WEBPACK_IMPORTED_MODULE_7__/* .TimingTools */ ._.SetImmediate(() => load());
            }
            else {
                const loadObserver = this._texture.onLoadedObservable.add(load);
                this._texture.onErrorObservable.add((e) => {
                    errorHandler(e.message, e.exception);
                    this._texture?.onLoadedObservable.remove(loadObserver);
                });
            }
        }
    }
    /**
     * Update the url (and optional buffer) of this texture if url was null during construction.
     * @param url the url of the texture
     * @param buffer the buffer of the texture (defaults to null)
     * @param onLoad callback called when the texture is loaded  (defaults to null)
     * @param forcedExtension defines the extension to use to pick the right loader
     */
    updateURL(url, buffer = null, onLoad, forcedExtension) {
        if (this.url) {
            this.releaseInternalTexture();
            this.getScene().markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this);
            });
        }
        if (!this.name || this.name.startsWith("data:")) {
            this.name = url;
        }
        this.url = url;
        this._buffer = buffer;
        this._forcedExtension = forcedExtension;
        this.delayLoadState = 4;
        if (onLoad) {
            this._delayedOnLoad = onLoad;
        }
        this.delayLoad();
    }
    /**
     * Finish the loading sequence of a texture flagged as delayed load.
     * @internal
     */
    delayLoad() {
        if (this.delayLoadState !== 4) {
            return;
        }
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        this.delayLoadState = 1;
        this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode, this._invertY, this._useSRGBBuffer, this.isCube);
        if (!this._texture) {
            this._texture = scene
                .getEngine()
                .createTexture(this.url, this._noMipmap, this._invertY, scene, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, this._forcedExtension, this._mimeType, this._loaderOptions, this._creationFlags, this._useSRGBBuffer);
            if (this._deleteBuffer) {
                this._buffer = null;
            }
        }
        else {
            if (this._delayedOnLoad) {
                if (this._texture.isReady) {
                    _Misc_timingTools_js__WEBPACK_IMPORTED_MODULE_7__/* .TimingTools */ ._.SetImmediate(this._delayedOnLoad);
                }
                else {
                    this._texture.onLoadedObservable.add(this._delayedOnLoad);
                }
            }
        }
        this._delayedOnLoad = null;
        this._delayedOnError = null;
    }
    _prepareRowForTextureGeneration(x, y, z, t) {
        x *= this._cachedUScale;
        y *= this._cachedVScale;
        x -= this.uRotationCenter * this._cachedUScale;
        y -= this.vRotationCenter * this._cachedVScale;
        z -= this.wRotationCenter;
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t);
        t.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset;
        t.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset;
        t.z += this.wRotationCenter;
    }
    /**
     * Get the current texture matrix which includes the requested offsetting, tiling and rotation components.
     * @param uBase The horizontal base offset multiplier (1 by default)
     * @returns the transform matrix of the texture.
     */
    getTextureMatrix(uBase = 1) {
        if (this.uOffset === this._cachedUOffset &&
            this.vOffset === this._cachedVOffset &&
            this.uScale * uBase === this._cachedUScale &&
            this.vScale === this._cachedVScale &&
            this.uAng === this._cachedUAng &&
            this.vAng === this._cachedVAng &&
            this.wAng === this._cachedWAng &&
            this.uRotationCenter === this._cachedURotationCenter &&
            this.vRotationCenter === this._cachedVRotationCenter &&
            this.wRotationCenter === this._cachedWRotationCenter &&
            this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform) {
            return this._cachedTextureMatrix;
        }
        this._cachedUOffset = this.uOffset;
        this._cachedVOffset = this.vOffset;
        this._cachedUScale = this.uScale * uBase;
        this._cachedVScale = this.vScale;
        this._cachedUAng = this.uAng;
        this._cachedVAng = this.vAng;
        this._cachedWAng = this.wAng;
        this._cachedURotationCenter = this.uRotationCenter;
        this._cachedVRotationCenter = this.vRotationCenter;
        this._cachedWRotationCenter = this.wRotationCenter;
        this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform;
        if (!this._cachedTextureMatrix || !this._rowGenerationMatrix) {
            this._cachedTextureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Zero();
            this._rowGenerationMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq();
            this._t0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Zero();
            this._t1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Zero();
            this._t2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Zero();
        }
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix);
        if (this.homogeneousRotationInUVTransform) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[0]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[1]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[2]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[3]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[0].multiplyToRef(this._rowGenerationMatrix, this._cachedTextureMatrix);
            this._cachedTextureMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[1], this._cachedTextureMatrix);
            this._cachedTextureMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[2], this._cachedTextureMatrix);
            this._cachedTextureMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[3], this._cachedTextureMatrix);
            // copy the translation row to the 3rd row of the matrix so that we don't need to update the shaders (which expects the translation to be on the 3rd row)
            this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1);
        }
        else {
            this._prepareRowForTextureGeneration(0, 0, 0, this._t0);
            this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1);
            this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2);
            this._t1.subtractInPlace(this._t0);
            this._t2.subtractInPlace(this._t0);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0.0, this._t2.x, this._t2.y, this._t2.z, 0.0, this._t0.x, this._t0.y, this._t0.z, 0.0, 0.0, 0.0, 0.0, 1.0, this._cachedTextureMatrix);
        }
        const scene = this.getScene();
        if (!scene) {
            return this._cachedTextureMatrix;
        }
        const previousIdentity3x2 = this._cachedIdentity3x2;
        this._cachedIdentity3x2 = this._cachedTextureMatrix.isIdentityAs3x2();
        if (this.optimizeUVAllocation && previousIdentity3x2 !== this._cachedIdentity3x2) {
            // We flag the materials that are using this texture as "texture dirty" because depending on the fact that the matrix is the identity or not, some defines
            // will get different values (see PrepareDefinesForMergedUV), meaning we should regenerate the effect accordingly
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this);
            });
        }
        return this._cachedTextureMatrix;
    }
    /**
     * Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance.
     * @returns The reflection texture transform
     */
    getReflectionTextureMatrix() {
        const scene = this.getScene();
        if (!scene) {
            return this._cachedReflectionTextureMatrix;
        }
        if (this.uOffset === this._cachedReflectionUOffset &&
            this.vOffset === this._cachedReflectionVOffset &&
            this.uScale === this._cachedReflectionUScale &&
            this.vScale === this._cachedReflectionVScale &&
            this.coordinatesMode === this._cachedReflectionCoordinatesMode) {
            if (this.coordinatesMode === Texture.PROJECTION_MODE) {
                if (this._cachedReflectionProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {
                    return this._cachedReflectionTextureMatrix;
                }
            }
            else {
                return this._cachedReflectionTextureMatrix;
            }
        }
        if (!this._cachedReflectionTextureMatrix) {
            this._cachedReflectionTextureMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Zero();
        }
        if (!this._projectionModeMatrix) {
            this._projectionModeMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Zero();
        }
        const flagMaterialsAsTextureDirty = this._cachedReflectionCoordinatesMode !== this.coordinatesMode;
        this._cachedReflectionUOffset = this.uOffset;
        this._cachedReflectionVOffset = this.vOffset;
        this._cachedReflectionUScale = this.uScale;
        this._cachedReflectionVScale = this.vScale;
        this._cachedReflectionCoordinatesMode = this.coordinatesMode;
        switch (this.coordinatesMode) {
            case Texture.PLANAR_MODE: {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.IdentityToRef(this._cachedReflectionTextureMatrix);
                this._cachedReflectionTextureMatrix[0] = this.uScale;
                this._cachedReflectionTextureMatrix[5] = this.vScale;
                this._cachedReflectionTextureMatrix[12] = this.uOffset;
                this._cachedReflectionTextureMatrix[13] = this.vOffset;
                break;
            }
            case Texture.PROJECTION_MODE: {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.FromValuesToRef(0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 1.0, 1.0, this._projectionModeMatrix);
                const projectionMatrix = scene.getProjectionMatrix();
                this._cachedReflectionProjectionMatrixId = projectionMatrix.updateFlag;
                projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedReflectionTextureMatrix);
                break;
            }
            default:
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.IdentityToRef(this._cachedReflectionTextureMatrix);
                break;
        }
        if (flagMaterialsAsTextureDirty) {
            // We flag the materials that are using this texture as "texture dirty" if the coordinatesMode has changed.
            // Indeed, this property is used to set the value of some defines used to generate the effect (in material.isReadyForSubMesh), so we must make sure this code will be re-executed and the effect recreated if necessary
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this);
            });
        }
        return this._cachedReflectionTextureMatrix;
    }
    /**
     * Clones the texture.
     * @returns the cloned texture
     */
    clone() {
        const options = {
            noMipmap: this._noMipmap,
            invertY: this._invertY,
            samplingMode: this.samplingMode,
            onLoad: undefined,
            onError: undefined,
            buffer: this._texture ? this._texture._buffer : undefined,
            deleteBuffer: this._deleteBuffer,
            format: this.textureFormat,
            mimeType: this.mimeType,
            loaderOptions: this._loaderOptions,
            creationFlags: this._creationFlags,
            useSRGBBuffer: this._useSRGBBuffer,
        };
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_13__/* .SerializationHelper */ .p.Clone(() => {
            return new Texture(this._texture ? this._texture.url : null, this.getScene(), options);
        }, this);
    }
    /**
     * Serialize the texture to a JSON representation we can easily use in the respective Parse function.
     * @returns The JSON representation of the texture
     */
    serialize() {
        const savedName = this.name;
        if (!Texture.SerializeBuffers) {
            if (this.name.startsWith("data:")) {
                this.name = "";
            }
        }
        if (this.name.startsWith("data:") && this.url === this.name) {
            this.url = "";
        }
        const serializationObject = super.serialize(Texture._SerializeInternalTextureUniqueId);
        if (!serializationObject) {
            return null;
        }
        if (Texture.SerializeBuffers || Texture.ForceSerializeBuffers) {
            if (typeof this._buffer === "string" && this._buffer.substring(0, 5) === "data:") {
                serializationObject.base64String = this._buffer;
                serializationObject.name = serializationObject.name.replace("data:", "");
            }
            else if (this.url && this.url.startsWith("data:") && this._buffer instanceof Uint8Array) {
                serializationObject.base64String = "data:image/png;base64," + (0,_Misc_stringTools_js__WEBPACK_IMPORTED_MODULE_10__/* .EncodeArrayBufferToBase64 */ .EL)(this._buffer);
            }
            else if (Texture.ForceSerializeBuffers || (this.url && this.url.startsWith("blob:")) || this._forceSerialize) {
                serializationObject.base64String =
                    !this._engine || this._engine._features.supportSyncTextureRead ? (0,_Misc_copyTools_js__WEBPACK_IMPORTED_MODULE_11__/* .GenerateBase64StringFromTexture */ .lP)(this) : (0,_Misc_copyTools_js__WEBPACK_IMPORTED_MODULE_11__/* .GenerateBase64StringFromTextureAsync */ .nh)(this);
            }
        }
        serializationObject.invertY = this._invertY;
        serializationObject.samplingMode = this.samplingMode;
        serializationObject._creationFlags = this._creationFlags;
        serializationObject._useSRGBBuffer = this._useSRGBBuffer;
        if (Texture._SerializeInternalTextureUniqueId) {
            serializationObject.internalTextureUniqueId = this._texture?.uniqueId;
        }
        serializationObject.internalTextureLabel = this._texture?.label;
        serializationObject.noMipmap = this._noMipmap;
        this.name = savedName;
        return serializationObject;
    }
    /**
     * Get the current class name of the texture useful for serialization or dynamic coding.
     * @returns "Texture"
     */
    getClassName() {
        return "Texture";
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() {
        super.dispose();
        this.onLoadObservable.clear();
        this._delayedOnLoad = null;
        this._delayedOnError = null;
        this._buffer = null;
    }
    /**
     * Parse the JSON representation of a texture in order to recreate the texture in the given scene.
     * @param parsedTexture Define the JSON representation of the texture
     * @param scene Define the scene the parsed texture should be instantiated in
     * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies
     * @returns The parsed texture if successful
     */
    static Parse(parsedTexture, scene, rootUrl) {
        if (parsedTexture.customType) {
            const customTexture = _Misc_instantiationTools_js__WEBPACK_IMPORTED_MODULE_8__/* .InstantiationTools */ .n.Instantiate(parsedTexture.customType);
            // Update Sampling Mode
            const parsedCustomTexture = customTexture.Parse(parsedTexture, scene, rootUrl);
            if (parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode && parsedCustomTexture._samplingMode) {
                if (parsedCustomTexture._samplingMode !== parsedTexture.samplingMode) {
                    parsedCustomTexture.updateSamplingMode(parsedTexture.samplingMode);
                }
            }
            return parsedCustomTexture;
        }
        if (parsedTexture.isCube && !parsedTexture.isRenderTarget) {
            return Texture._CubeTextureParser(parsedTexture, scene, rootUrl);
        }
        const hasInternalTextureUniqueId = parsedTexture.internalTextureUniqueId !== undefined;
        if (!parsedTexture.name && !parsedTexture.isRenderTarget && !hasInternalTextureUniqueId) {
            return null;
        }
        let internalTexture;
        if (hasInternalTextureUniqueId) {
            const cache = scene.getEngine().getLoadedTexturesCache();
            for (const texture of cache) {
                if (texture.uniqueId === parsedTexture.internalTextureUniqueId) {
                    internalTexture = texture;
                    break;
                }
            }
        }
        const onLoaded = (texture) => {
            // Clear cache
            if (texture && texture._texture) {
                texture._texture._cachedWrapU = null;
                texture._texture._cachedWrapV = null;
                texture._texture._cachedWrapR = null;
            }
            // Update Sampling Mode
            if (parsedTexture.samplingMode) {
                const sampling = parsedTexture.samplingMode;
                if (texture && texture.samplingMode !== sampling) {
                    texture.updateSamplingMode(sampling);
                }
            }
            // Animations
            if (texture && parsedTexture.animations) {
                for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {
                    const parsedAnimation = parsedTexture.animations[animationIndex];
                    const internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__/* .GetClass */ .n9)("BABYLON.Animation");
                    if (internalClass) {
                        texture.animations.push(internalClass.Parse(parsedAnimation));
                    }
                }
            }
            if (texture && texture._texture) {
                if (hasInternalTextureUniqueId && !internalTexture) {
                    texture._texture._setUniqueId(parsedTexture.internalTextureUniqueId);
                }
                texture._texture.label = parsedTexture.internalTextureLabel;
            }
        };
        const texture = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_13__/* .SerializationHelper */ .p.Parse(() => {
            let generateMipMaps = true;
            if (parsedTexture.noMipmap) {
                generateMipMaps = false;
            }
            if (parsedTexture.mirrorPlane) {
                const mirrorTexture = Texture._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);
                mirrorTexture._waitingRenderList = parsedTexture.renderList;
                mirrorTexture.mirrorPlane = _Maths_math_plane_js__WEBPACK_IMPORTED_MODULE_9__/* .Plane */ .Z.FromArray(parsedTexture.mirrorPlane);
                onLoaded(mirrorTexture);
                return mirrorTexture;
            }
            else if (parsedTexture.isRenderTarget) {
                let renderTargetTexture = null;
                if (parsedTexture.isCube) {
                    // Search for an existing reflection probe (which contains a cube render target texture)
                    if (scene.reflectionProbes) {
                        for (let index = 0; index < scene.reflectionProbes.length; index++) {
                            const probe = scene.reflectionProbes[index];
                            if (probe.name === parsedTexture.name) {
                                return probe.cubeTexture;
                            }
                        }
                    }
                }
                else {
                    renderTargetTexture = Texture._CreateRenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps, parsedTexture._creationFlags ?? 0);
                    renderTargetTexture._waitingRenderList = parsedTexture.renderList;
                }
                onLoaded(renderTargetTexture);
                return renderTargetTexture;
            }
            else if (parsedTexture.isVideo) {
                const texture = Texture._CreateVideoTexture(rootUrl + (parsedTexture.url || parsedTexture.name), rootUrl + (parsedTexture.src || parsedTexture.url), scene, generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, parsedTexture.settings || {});
                onLoaded(texture);
                return texture;
            }
            else {
                let texture;
                if (parsedTexture.base64String && !internalTexture) {
                    // name and url are the same to ensure caching happens from the actual base64 string
                    texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.base64String, scene, !generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, () => {
                        onLoaded(texture);
                    }, parsedTexture._creationFlags ?? 0, parsedTexture._useSRGBBuffer ?? false);
                    // prettier name to fit with the loaded data
                    texture.name = parsedTexture.name;
                }
                else {
                    let url;
                    if (parsedTexture.name && (parsedTexture.name.indexOf("://") > 0 || parsedTexture.name.startsWith("data:"))) {
                        url = parsedTexture.name;
                    }
                    else {
                        url = rootUrl + parsedTexture.name;
                    }
                    if (parsedTexture.url && (parsedTexture.url.startsWith("data:") || Texture.UseSerializedUrlIfAny)) {
                        url = parsedTexture.url;
                    }
                    const options = {
                        noMipmap: !generateMipMaps,
                        invertY: parsedTexture.invertY,
                        samplingMode: parsedTexture.samplingMode,
                        onLoad: () => {
                            onLoaded(texture);
                        },
                        internalTexture,
                    };
                    texture = new Texture(url, scene, options);
                }
                return texture;
            }
        }, parsedTexture, scene);
        return texture;
    }
    /**
     * Creates a texture from its base 64 representation.
     * @param data Define the base64 payload without the data: prefix
     * @param name Define the name of the texture in the scene useful fo caching purpose for instance
     * @param scene Define the scene the texture should belong to
     * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
     * @param invertY define if the texture needs to be inverted on the y axis during loading
     * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
     * @param onLoad define a callback triggered when the texture has been loaded
     * @param onError define a callback triggered when an error occurred during the loading session
     * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param forcedExtension defines the extension to use to pick the right loader
     * @returns the created texture
     */
    static CreateFromBase64String(data, name, scene, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {
        return new Texture("data:" + name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags, forcedExtension);
    }
    /**
     * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)
     * @param name Define the name of the texture in the scene useful fo caching purpose for instance
     * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation
     * @param scene Define the scene the texture should belong to
     * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load
     * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture
     * @param invertY define if the texture needs to be inverted on the y axis during loading
     * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)
     * @param onLoad define a callback triggered when the texture has been loaded
     * @param onError define a callback triggered when an error occurred during the loading session
     * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param forcedExtension defines the extension to use to pick the right loader
     * @returns the created texture
     */
    static LoadFromDataString(name, buffer, scene, deleteBuffer = false, noMipmapOrOptions, invertY = true, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {
        if (name.substring(0, 5) !== "data:") {
            name = "data:" + name;
        }
        return new Texture(name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format, undefined, undefined, creationFlags, forcedExtension);
    }
}
/**
 * Gets or sets a general boolean used to indicate that textures containing direct data (buffers) must be saved as part of the serialization process
 */
Texture.SerializeBuffers = true;
/**
 * Gets or sets a general boolean used to indicate that texture buffers must be saved as part of the serialization process.
 * If no buffer exists, one will be created as base64 string from the internal webgl data.
 */
Texture.ForceSerializeBuffers = false;
/**
 * This observable will notify when any texture had a loading error
 */
Texture.OnTextureLoadErrorObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
/** @internal */
Texture._SerializeInternalTextureUniqueId = false;
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Texture._CubeTextureParser = (jsonTexture, scene, rootUrl) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_6__/* ._WarnImport */ .n)("CubeTexture");
};
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Texture._CreateMirror = (name, renderTargetSize, scene, generateMipMaps) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_6__/* ._WarnImport */ .n)("MirrorTexture");
};
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Texture._CreateRenderTargetTexture = (name, renderTargetSize, scene, generateMipMaps, creationFlags) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_6__/* ._WarnImport */ .n)("RenderTargetTexture");
};
/** nearest is mag = nearest and min = nearest and no mip */
Texture.NEAREST_SAMPLINGMODE = 1;
/** nearest is mag = nearest and min = nearest and mip = linear */
Texture.NEAREST_NEAREST_MIPLINEAR = 8; // nearest is mag = nearest and min = nearest and mip = linear
/** Bilinear is mag = linear and min = linear and no mip */
Texture.BILINEAR_SAMPLINGMODE = 2;
/** Bilinear is mag = linear and min = linear and mip = nearest */
Texture.LINEAR_LINEAR_MIPNEAREST = 11; // Bilinear is mag = linear and min = linear and mip = nearest
/** Trilinear is mag = linear and min = linear and mip = linear */
Texture.TRILINEAR_SAMPLINGMODE = 3;
/** Trilinear is mag = linear and min = linear and mip = linear */
Texture.LINEAR_LINEAR_MIPLINEAR = 3; // Trilinear is mag = linear and min = linear and mip = linear
/** mag = nearest and min = nearest and mip = nearest */
Texture.NEAREST_NEAREST_MIPNEAREST = 4;
/** mag = nearest and min = linear and mip = nearest */
Texture.NEAREST_LINEAR_MIPNEAREST = 5;
/** mag = nearest and min = linear and mip = linear */
Texture.NEAREST_LINEAR_MIPLINEAR = 6;
/** mag = nearest and min = linear and mip = none */
Texture.NEAREST_LINEAR = 7;
/** mag = nearest and min = nearest and mip = none */
Texture.NEAREST_NEAREST = 1;
/** mag = linear and min = nearest and mip = nearest */
Texture.LINEAR_NEAREST_MIPNEAREST = 9;
/** mag = linear and min = nearest and mip = linear */
Texture.LINEAR_NEAREST_MIPLINEAR = 10;
/** mag = linear and min = linear and mip = none */
Texture.LINEAR_LINEAR = 2;
/** mag = linear and min = nearest and mip = none */
Texture.LINEAR_NEAREST = 12;
/** Explicit coordinates mode */
Texture.EXPLICIT_MODE = 0;
/** Spherical coordinates mode */
Texture.SPHERICAL_MODE = 1;
/** Planar coordinates mode */
Texture.PLANAR_MODE = 2;
/** Cubic coordinates mode */
Texture.CUBIC_MODE = 3;
/** Projection coordinates mode */
Texture.PROJECTION_MODE = 4;
/** Inverse Cubic coordinates mode */
Texture.SKYBOX_MODE = 5;
/** Inverse Cubic coordinates mode */
Texture.INVCUBIC_MODE = 6;
/** Equirectangular coordinates mode */
Texture.EQUIRECTANGULAR_MODE = 7;
/** Equirectangular Fixed coordinates mode */
Texture.FIXED_EQUIRECTANGULAR_MODE = 8;
/** Equirectangular Fixed Mirrored coordinates mode */
Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
/** Texture is not repeating outside of 0..1 UVs */
Texture.CLAMP_ADDRESSMODE = 0;
/** Texture is repeating outside of 0..1 UVs */
Texture.WRAP_ADDRESSMODE = 1;
/** Texture is repeating and mirrored */
Texture.MIRROR_ADDRESSMODE = 2;
/**
 * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file
 */
Texture.UseSerializedUrlIfAny = false;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "url", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "uOffset", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "vOffset", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "uScale", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "vScale", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "uAng", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "vAng", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "wAng", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "uRotationCenter", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "vRotationCenter", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "wRotationCenter", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "homogeneousRotationInUVTransform", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], Texture.prototype, "isBlocking", null);
// References the dependencies.
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__/* .RegisterClass */ .Y5)("BABYLON.Texture", Texture);
_Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_13__/* .SerializationHelper */ .p._TextureParser = Texture.Parse;
//# sourceMappingURL=texture.js.map

/***/ }),

/***/ 38573:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   u: () => (/* binding */ TextureSampler)
/* harmony export */ });

/**
 * Class used to store a texture sampler data
 */
class TextureSampler {
    /**
     * | Value | Type               | Description |
     * | ----- | ------------------ | ----------- |
     * | 0     | CLAMP_ADDRESSMODE  |             |
     * | 1     | WRAP_ADDRESSMODE   |             |
     * | 2     | MIRROR_ADDRESSMODE |             |
     */
    get wrapU() {
        return this._cachedWrapU;
    }
    set wrapU(value) {
        this._cachedWrapU = value;
    }
    /**
     * | Value | Type               | Description |
     * | ----- | ------------------ | ----------- |
     * | 0     | CLAMP_ADDRESSMODE  |             |
     * | 1     | WRAP_ADDRESSMODE   |             |
     * | 2     | MIRROR_ADDRESSMODE |             |
     */
    get wrapV() {
        return this._cachedWrapV;
    }
    set wrapV(value) {
        this._cachedWrapV = value;
    }
    /**
     * | Value | Type               | Description |
     * | ----- | ------------------ | ----------- |
     * | 0     | CLAMP_ADDRESSMODE  |             |
     * | 1     | WRAP_ADDRESSMODE   |             |
     * | 2     | MIRROR_ADDRESSMODE |             |
     */
    get wrapR() {
        return this._cachedWrapR;
    }
    set wrapR(value) {
        this._cachedWrapR = value;
    }
    /**
     * With compliant hardware and browser (supporting anisotropic filtering)
     * this defines the level of anisotropic filtering in the texture.
     * The higher the better but the slower.
     */
    get anisotropicFilteringLevel() {
        return this._cachedAnisotropicFilteringLevel;
    }
    set anisotropicFilteringLevel(value) {
        this._cachedAnisotropicFilteringLevel = value;
    }
    /**
     * Gets or sets the comparison function (513, 514, etc). Set 0 to not use a comparison function
     */
    get comparisonFunction() {
        return this._comparisonFunction;
    }
    set comparisonFunction(value) {
        this._comparisonFunction = value;
    }
    /**
     * Indicates to use the mip maps (if available on the texture).
     * Thanks to this flag, you can instruct the sampler to not sample the mipmaps even if they exist (and if the sampling mode is set to a value that normally samples the mipmaps!)
     */
    get useMipMaps() {
        return this._useMipMaps;
    }
    set useMipMaps(value) {
        this._useMipMaps = value;
    }
    /**
     * Creates a Sampler instance
     */
    constructor() {
        /**
         * Gets the sampling mode of the texture
         */
        this.samplingMode = -1;
        this._useMipMaps = true;
        /** @internal */
        this._cachedWrapU = null;
        /** @internal */
        this._cachedWrapV = null;
        /** @internal */
        this._cachedWrapR = null;
        /** @internal */
        this._cachedAnisotropicFilteringLevel = null;
        /** @internal */
        this._comparisonFunction = 0;
    }
    /**
     * Sets all the parameters of the sampler
     * @param wrapU u address mode (default: TEXTURE_WRAP_ADDRESSMODE)
     * @param wrapV v address mode (default: TEXTURE_WRAP_ADDRESSMODE)
     * @param wrapR r address mode (default: TEXTURE_WRAP_ADDRESSMODE)
     * @param anisotropicFilteringLevel anisotropic level (default: 1)
     * @param samplingMode sampling mode (default: 2)
     * @param comparisonFunction comparison function (default: 0 - no comparison function)
     * @returns the current sampler instance
     */
    setParameters(wrapU = 1, wrapV = 1, wrapR = 1, anisotropicFilteringLevel = 1, samplingMode = 2, comparisonFunction = 0) {
        this._cachedWrapU = wrapU;
        this._cachedWrapV = wrapV;
        this._cachedWrapR = wrapR;
        this._cachedAnisotropicFilteringLevel = anisotropicFilteringLevel;
        this.samplingMode = samplingMode;
        this._comparisonFunction = comparisonFunction;
        return this;
    }
    /**
     * Compares this sampler with another one
     * @param other sampler to compare with
     * @returns true if the samplers have the same parametres, else false
     */
    compareSampler(other) {
        return (this._cachedWrapU === other._cachedWrapU &&
            this._cachedWrapV === other._cachedWrapV &&
            this._cachedWrapR === other._cachedWrapR &&
            this._cachedAnisotropicFilteringLevel === other._cachedAnisotropicFilteringLevel &&
            this.samplingMode === other.samplingMode &&
            this._comparisonFunction === other._comparisonFunction &&
            this._useMipMaps === other._useMipMaps);
    }
}
//# sourceMappingURL=textureSampler.js.map

/***/ }),

/***/ 35928:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   D: () => (/* binding */ ThinTexture)
/* harmony export */ });
/* harmony import */ var _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70521);


/**
 * Base class of all the textures in babylon.
 * It groups all the common properties required to work with Thin Engine.
 */
class ThinTexture {
    /**
     * | Value | Type               | Description |
     * | ----- | ------------------ | ----------- |
     * | 0     | CLAMP_ADDRESSMODE  |             |
     * | 1     | WRAP_ADDRESSMODE   |             |
     * | 2     | MIRROR_ADDRESSMODE |             |
     */
    get wrapU() {
        return this._wrapU;
    }
    set wrapU(value) {
        this._wrapU = value;
    }
    /**
     * | Value | Type               | Description |
     * | ----- | ------------------ | ----------- |
     * | 0     | CLAMP_ADDRESSMODE  |             |
     * | 1     | WRAP_ADDRESSMODE   |             |
     * | 2     | MIRROR_ADDRESSMODE |             |
     */
    get wrapV() {
        return this._wrapV;
    }
    set wrapV(value) {
        this._wrapV = value;
    }
    /**
     * How a texture is mapped.
     * Unused in thin texture mode.
     */
    get coordinatesMode() {
        return 0;
    }
    /**
     * Define if the texture is a cube texture or if false a 2d texture.
     */
    get isCube() {
        if (!this._texture) {
            return false;
        }
        return this._texture.isCube;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    set isCube(value) {
        if (!this._texture) {
            return;
        }
        this._texture.isCube = value;
    }
    /**
     * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
     */
    get is3D() {
        if (!this._texture) {
            return false;
        }
        return this._texture.is3D;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    set is3D(value) {
        if (!this._texture) {
            return;
        }
        this._texture.is3D = value;
    }
    /**
     * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.
     */
    get is2DArray() {
        if (!this._texture) {
            return false;
        }
        return this._texture.is2DArray;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    set is2DArray(value) {
        if (!this._texture) {
            return;
        }
        this._texture.is2DArray = value;
    }
    /**
     * Get the class name of the texture.
     * @returns "ThinTexture"
     */
    getClassName() {
        return "ThinTexture";
    }
    static _IsRenderTargetWrapper(texture) {
        return texture?.shareDepth !== undefined;
    }
    /**
     * Instantiates a new ThinTexture.
     * Base class of all the textures in babylon.
     * This can be used as an internal texture wrapper in AbstractEngine to benefit from the cache
     * @param internalTexture Define the internalTexture to wrap. You can also pass a RenderTargetWrapper, in which case the texture will be the render target's texture
     */
    constructor(internalTexture) {
        this._wrapU = 1;
        this._wrapV = 1;
        /**
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | 0     | CLAMP_ADDRESSMODE  |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
        this.wrapR = 1;
        /**
         * With compliant hardware and browser (supporting anisotropic filtering)
         * this defines the level of anisotropic filtering in the texture.
         * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff.
         */
        this.anisotropicFilteringLevel = 4;
        /**
         * Define the current state of the loading sequence when in delayed load mode.
         */
        this.delayLoadState = 0;
        /** @internal */
        this._texture = null;
        this._engine = null;
        this._cachedSize = _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_0__/* .Size */ .o.Zero();
        this._cachedBaseSize = _Maths_math_size_js__WEBPACK_IMPORTED_MODULE_0__/* .Size */ .o.Zero();
        /** @internal */
        this._initialSamplingMode = 2;
        this._texture = ThinTexture._IsRenderTargetWrapper(internalTexture) ? internalTexture.texture : internalTexture;
        if (this._texture) {
            this._engine = this._texture.getEngine();
        }
    }
    /**
     * Get if the texture is ready to be used (downloaded, converted, mip mapped...).
     * @returns true if fully ready
     */
    isReady() {
        if (this.delayLoadState === 4) {
            this.delayLoad();
            return false;
        }
        if (this._texture) {
            return this._texture.isReady;
        }
        return false;
    }
    /**
     * Triggers the load sequence in delayed load mode.
     */
    delayLoad() { }
    /**
     * Get the underlying lower level texture from Babylon.
     * @returns the internal texture
     */
    getInternalTexture() {
        return this._texture;
    }
    /**
     * Get the size of the texture.
     * @returns the texture size.
     */
    getSize() {
        if (this._texture) {
            if (this._texture.width) {
                this._cachedSize.width = this._texture.width;
                this._cachedSize.height = this._texture.height;
                return this._cachedSize;
            }
            if (this._texture._size) {
                this._cachedSize.width = this._texture._size;
                this._cachedSize.height = this._texture._size;
                return this._cachedSize;
            }
        }
        return this._cachedSize;
    }
    /**
     * Get the base size of the texture.
     * It can be different from the size if the texture has been resized for POT for instance
     * @returns the base size
     */
    getBaseSize() {
        if (!this.isReady() || !this._texture) {
            this._cachedBaseSize.width = 0;
            this._cachedBaseSize.height = 0;
            return this._cachedBaseSize;
        }
        if (this._texture._size) {
            this._cachedBaseSize.width = this._texture._size;
            this._cachedBaseSize.height = this._texture._size;
            return this._cachedBaseSize;
        }
        this._cachedBaseSize.width = this._texture.baseWidth;
        this._cachedBaseSize.height = this._texture.baseHeight;
        return this._cachedBaseSize;
    }
    /**
     * Get the current sampling mode associated with the texture.
     */
    get samplingMode() {
        if (!this._texture) {
            return this._initialSamplingMode;
        }
        return this._texture.samplingMode;
    }
    /**
     * Update the sampling mode of the texture.
     * Default is Trilinear mode.
     *
     * | Value | Type               | Description |
     * | ----- | ------------------ | ----------- |
     * | 1     | NEAREST_SAMPLINGMODE or NEAREST_NEAREST_MIPLINEAR  | Nearest is: mag = nearest, min = nearest, mip = linear |
     * | 2     | BILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPNEAREST | Bilinear is: mag = linear, min = linear, mip = nearest |
     * | 3     | TRILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPLINEAR | Trilinear is: mag = linear, min = linear, mip = linear |
     * | 4     | NEAREST_NEAREST_MIPNEAREST |             |
     * | 5    | NEAREST_LINEAR_MIPNEAREST |             |
     * | 6    | NEAREST_LINEAR_MIPLINEAR |             |
     * | 7    | NEAREST_LINEAR |             |
     * | 8    | NEAREST_NEAREST |             |
     * | 9   | LINEAR_NEAREST_MIPNEAREST |             |
     * | 10   | LINEAR_NEAREST_MIPLINEAR |             |
     * | 11   | LINEAR_LINEAR |             |
     * | 12   | LINEAR_NEAREST |             |
     *
     *    > _mag_: magnification filter (close to the viewer)
     *    > _min_: minification filter (far from the viewer)
     *    > _mip_: filter used between mip map levels
     *@param samplingMode Define the new sampling mode of the texture
     */
    updateSamplingMode(samplingMode) {
        if (this._texture && this._engine) {
            this._engine.updateTextureSamplingMode(samplingMode, this._texture);
        }
    }
    /**
     * Release and destroy the underlying lower level texture aka internalTexture.
     */
    releaseInternalTexture() {
        if (this._texture) {
            this._texture.dispose();
            this._texture = null;
        }
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() {
        if (this._texture) {
            this.releaseInternalTexture();
            this._engine = null;
        }
    }
}
//# sourceMappingURL=thinTexture.js.map

/***/ }),

/***/ 30492:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Eq: () => (/* binding */ prepareDefinesForClipPlanes),
/* harmony export */   TV: () => (/* binding */ addClipPlaneUniforms),
/* harmony export */   gS: () => (/* binding */ bindClipPlane),
/* harmony export */   tv: () => (/* binding */ prepareStringDefinesForClipPlanes)
/* harmony export */ });
/** @internal */
function addClipPlaneUniforms(uniforms) {
    if (uniforms.indexOf("vClipPlane") === -1) {
        uniforms.push("vClipPlane");
    }
    if (uniforms.indexOf("vClipPlane2") === -1) {
        uniforms.push("vClipPlane2");
    }
    if (uniforms.indexOf("vClipPlane3") === -1) {
        uniforms.push("vClipPlane3");
    }
    if (uniforms.indexOf("vClipPlane4") === -1) {
        uniforms.push("vClipPlane4");
    }
    if (uniforms.indexOf("vClipPlane5") === -1) {
        uniforms.push("vClipPlane5");
    }
    if (uniforms.indexOf("vClipPlane6") === -1) {
        uniforms.push("vClipPlane6");
    }
}
/** @internal */
function prepareStringDefinesForClipPlanes(primaryHolder, secondaryHolder, defines) {
    const clipPlane = !!(primaryHolder.clipPlane ?? secondaryHolder.clipPlane);
    const clipPlane2 = !!(primaryHolder.clipPlane2 ?? secondaryHolder.clipPlane2);
    const clipPlane3 = !!(primaryHolder.clipPlane3 ?? secondaryHolder.clipPlane3);
    const clipPlane4 = !!(primaryHolder.clipPlane4 ?? secondaryHolder.clipPlane4);
    const clipPlane5 = !!(primaryHolder.clipPlane5 ?? secondaryHolder.clipPlane5);
    const clipPlane6 = !!(primaryHolder.clipPlane6 ?? secondaryHolder.clipPlane6);
    if (clipPlane)
        defines.push("#define CLIPPLANE");
    if (clipPlane2)
        defines.push("#define CLIPPLANE2");
    if (clipPlane3)
        defines.push("#define CLIPPLANE3");
    if (clipPlane4)
        defines.push("#define CLIPPLANE4");
    if (clipPlane5)
        defines.push("#define CLIPPLANE5");
    if (clipPlane6)
        defines.push("#define CLIPPLANE6");
}
/** @internal */
function prepareDefinesForClipPlanes(primaryHolder, secondaryHolder, defines) {
    let changed = false;
    const clipPlane = !!(primaryHolder.clipPlane ?? secondaryHolder.clipPlane);
    const clipPlane2 = !!(primaryHolder.clipPlane2 ?? secondaryHolder.clipPlane2);
    const clipPlane3 = !!(primaryHolder.clipPlane3 ?? secondaryHolder.clipPlane3);
    const clipPlane4 = !!(primaryHolder.clipPlane4 ?? secondaryHolder.clipPlane4);
    const clipPlane5 = !!(primaryHolder.clipPlane5 ?? secondaryHolder.clipPlane5);
    const clipPlane6 = !!(primaryHolder.clipPlane6 ?? secondaryHolder.clipPlane6);
    // Do not factorize this code, it breaks browsers optimizations.
    if (defines["CLIPPLANE"] !== clipPlane) {
        defines["CLIPPLANE"] = clipPlane;
        changed = true;
    }
    if (defines["CLIPPLANE2"] !== clipPlane2) {
        defines["CLIPPLANE2"] = clipPlane2;
        changed = true;
    }
    if (defines["CLIPPLANE3"] !== clipPlane3) {
        defines["CLIPPLANE3"] = clipPlane3;
        changed = true;
    }
    if (defines["CLIPPLANE4"] !== clipPlane4) {
        defines["CLIPPLANE4"] = clipPlane4;
        changed = true;
    }
    if (defines["CLIPPLANE5"] !== clipPlane5) {
        defines["CLIPPLANE5"] = clipPlane5;
        changed = true;
    }
    if (defines["CLIPPLANE6"] !== clipPlane6) {
        defines["CLIPPLANE6"] = clipPlane6;
        changed = true;
    }
    return changed;
}
/** @internal */
function bindClipPlane(effect, primaryHolder, secondaryHolder) {
    let clipPlane = primaryHolder.clipPlane ?? secondaryHolder.clipPlane;
    setClipPlane(effect, "vClipPlane", clipPlane);
    clipPlane = primaryHolder.clipPlane2 ?? secondaryHolder.clipPlane2;
    setClipPlane(effect, "vClipPlane2", clipPlane);
    clipPlane = primaryHolder.clipPlane3 ?? secondaryHolder.clipPlane3;
    setClipPlane(effect, "vClipPlane3", clipPlane);
    clipPlane = primaryHolder.clipPlane4 ?? secondaryHolder.clipPlane4;
    setClipPlane(effect, "vClipPlane4", clipPlane);
    clipPlane = primaryHolder.clipPlane5 ?? secondaryHolder.clipPlane5;
    setClipPlane(effect, "vClipPlane5", clipPlane);
    clipPlane = primaryHolder.clipPlane6 ?? secondaryHolder.clipPlane6;
    setClipPlane(effect, "vClipPlane6", clipPlane);
}
function setClipPlane(effect, uniformName, clipPlane) {
    if (clipPlane) {
        effect.setFloat4(uniformName, clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);
    }
}
//# sourceMappingURL=clipPlaneMaterialHelper.js.map

/***/ }),

/***/ 16629:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ PrepareUniformsForColorCurves)
/* harmony export */ });
/**
 * Prepare the list of uniforms associated with the ColorCurves effects.
 * @param uniformsList The list of uniforms used in the effect
 */
function PrepareUniformsForColorCurves(uniformsList) {
    uniformsList.push("vCameraColorCurveNeutral", "vCameraColorCurvePositive", "vCameraColorCurveNegative");
}
//# sourceMappingURL=colorCurves.functions.js.map

/***/ }),

/***/ 35198:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Q: () => (/* binding */ ColorCurves)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26041);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26877);
/* harmony import */ var _colorCurves_functions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16629);





/**
 * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
 * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
 * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
 * corresponding to low luminance, medium luminance, and high luminance areas respectively.
 */
class ColorCurves {
    constructor() {
        this._dirty = true;
        this._tempColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .ov(0, 0, 0, 0);
        this._globalCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .ov(0, 0, 0, 0);
        this._highlightsCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .ov(0, 0, 0, 0);
        this._midtonesCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .ov(0, 0, 0, 0);
        this._shadowsCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .ov(0, 0, 0, 0);
        this._positiveCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .ov(0, 0, 0, 0);
        this._negativeCurve = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .ov(0, 0, 0, 0);
        this._globalHue = 30;
        this._globalDensity = 0;
        this._globalSaturation = 0;
        this._globalExposure = 0;
        this._highlightsHue = 30;
        this._highlightsDensity = 0;
        this._highlightsSaturation = 0;
        this._highlightsExposure = 0;
        this._midtonesHue = 30;
        this._midtonesDensity = 0;
        this._midtonesSaturation = 0;
        this._midtonesExposure = 0;
        this._shadowsHue = 30;
        this._shadowsDensity = 0;
        this._shadowsSaturation = 0;
        this._shadowsExposure = 0;
    }
    /**
     * Gets the global Hue value.
     * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
     */
    get globalHue() {
        return this._globalHue;
    }
    /**
     * Sets the global Hue value.
     * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
     */
    set globalHue(value) {
        this._globalHue = value;
        this._dirty = true;
    }
    /**
     * Gets the global Density value.
     * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
     * Values less than zero provide a filter of opposite hue.
     */
    get globalDensity() {
        return this._globalDensity;
    }
    /**
     * Sets the global Density value.
     * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
     * Values less than zero provide a filter of opposite hue.
     */
    set globalDensity(value) {
        this._globalDensity = value;
        this._dirty = true;
    }
    /**
     * Gets the global Saturation value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
     */
    get globalSaturation() {
        return this._globalSaturation;
    }
    /**
     * Sets the global Saturation value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
     */
    set globalSaturation(value) {
        this._globalSaturation = value;
        this._dirty = true;
    }
    /**
     * Gets the global Exposure value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
     */
    get globalExposure() {
        return this._globalExposure;
    }
    /**
     * Sets the global Exposure value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
     */
    set globalExposure(value) {
        this._globalExposure = value;
        this._dirty = true;
    }
    /**
     * Gets the highlights Hue value.
     * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
     */
    get highlightsHue() {
        return this._highlightsHue;
    }
    /**
     * Sets the highlights Hue value.
     * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
     */
    set highlightsHue(value) {
        this._highlightsHue = value;
        this._dirty = true;
    }
    /**
     * Gets the highlights Density value.
     * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
     * Values less than zero provide a filter of opposite hue.
     */
    get highlightsDensity() {
        return this._highlightsDensity;
    }
    /**
     * Sets the highlights Density value.
     * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
     * Values less than zero provide a filter of opposite hue.
     */
    set highlightsDensity(value) {
        this._highlightsDensity = value;
        this._dirty = true;
    }
    /**
     * Gets the highlights Saturation value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
     */
    get highlightsSaturation() {
        return this._highlightsSaturation;
    }
    /**
     * Sets the highlights Saturation value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
     */
    set highlightsSaturation(value) {
        this._highlightsSaturation = value;
        this._dirty = true;
    }
    /**
     * Gets the highlights Exposure value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
     */
    get highlightsExposure() {
        return this._highlightsExposure;
    }
    /**
     * Sets the highlights Exposure value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
     */
    set highlightsExposure(value) {
        this._highlightsExposure = value;
        this._dirty = true;
    }
    /**
     * Gets the midtones Hue value.
     * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
     */
    get midtonesHue() {
        return this._midtonesHue;
    }
    /**
     * Sets the midtones Hue value.
     * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
     */
    set midtonesHue(value) {
        this._midtonesHue = value;
        this._dirty = true;
    }
    /**
     * Gets the midtones Density value.
     * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
     * Values less than zero provide a filter of opposite hue.
     */
    get midtonesDensity() {
        return this._midtonesDensity;
    }
    /**
     * Sets the midtones Density value.
     * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
     * Values less than zero provide a filter of opposite hue.
     */
    set midtonesDensity(value) {
        this._midtonesDensity = value;
        this._dirty = true;
    }
    /**
     * Gets the midtones Saturation value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
     */
    get midtonesSaturation() {
        return this._midtonesSaturation;
    }
    /**
     * Sets the midtones Saturation value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
     */
    set midtonesSaturation(value) {
        this._midtonesSaturation = value;
        this._dirty = true;
    }
    /**
     * Gets the midtones Exposure value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
     */
    get midtonesExposure() {
        return this._midtonesExposure;
    }
    /**
     * Sets the midtones Exposure value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
     */
    set midtonesExposure(value) {
        this._midtonesExposure = value;
        this._dirty = true;
    }
    /**
     * Gets the shadows Hue value.
     * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
     */
    get shadowsHue() {
        return this._shadowsHue;
    }
    /**
     * Sets the shadows Hue value.
     * The hue value is a standard HSB hue in the range [0,360] where 0=red, 120=green and 240=blue. The default value is 30 degrees (orange).
     */
    set shadowsHue(value) {
        this._shadowsHue = value;
        this._dirty = true;
    }
    /**
     * Gets the shadows Density value.
     * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
     * Values less than zero provide a filter of opposite hue.
     */
    get shadowsDensity() {
        return this._shadowsDensity;
    }
    /**
     * Sets the shadows Density value.
     * The density value is in range [-100,+100] where 0 means the color filter has no effect and +100 means the color filter has maximum effect.
     * Values less than zero provide a filter of opposite hue.
     */
    set shadowsDensity(value) {
        this._shadowsDensity = value;
        this._dirty = true;
    }
    /**
     * Gets the shadows Saturation value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
     */
    get shadowsSaturation() {
        return this._shadowsSaturation;
    }
    /**
     * Sets the shadows Saturation value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase saturation and negative values decrease saturation.
     */
    set shadowsSaturation(value) {
        this._shadowsSaturation = value;
        this._dirty = true;
    }
    /**
     * Gets the shadows Exposure value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
     */
    get shadowsExposure() {
        return this._shadowsExposure;
    }
    /**
     * Sets the shadows Exposure value.
     * This is an adjustment value in the range [-100,+100], where the default value of 0.0 makes no adjustment, positive values increase exposure and negative values decrease exposure.
     */
    set shadowsExposure(value) {
        this._shadowsExposure = value;
        this._dirty = true;
    }
    /**
     * Returns the class name
     * @returns The class name
     */
    getClassName() {
        return "ColorCurves";
    }
    /**
     * Binds the color curves to the shader.
     * @param colorCurves The color curve to bind
     * @param effect The effect to bind to
     * @param positiveUniform The positive uniform shader parameter
     * @param neutralUniform The neutral uniform shader parameter
     * @param negativeUniform The negative uniform shader parameter
     */
    static Bind(colorCurves, effect, positiveUniform = "vCameraColorCurvePositive", neutralUniform = "vCameraColorCurveNeutral", negativeUniform = "vCameraColorCurveNegative") {
        if (colorCurves._dirty) {
            colorCurves._dirty = false;
            // Fill in global info.
            colorCurves._getColorGradingDataToRef(colorCurves._globalHue, colorCurves._globalDensity, colorCurves._globalSaturation, colorCurves._globalExposure, colorCurves._globalCurve);
            // Compute highlights info.
            colorCurves._getColorGradingDataToRef(colorCurves._highlightsHue, colorCurves._highlightsDensity, colorCurves._highlightsSaturation, colorCurves._highlightsExposure, colorCurves._tempColor);
            colorCurves._tempColor.multiplyToRef(colorCurves._globalCurve, colorCurves._highlightsCurve);
            // Compute midtones info.
            colorCurves._getColorGradingDataToRef(colorCurves._midtonesHue, colorCurves._midtonesDensity, colorCurves._midtonesSaturation, colorCurves._midtonesExposure, colorCurves._tempColor);
            colorCurves._tempColor.multiplyToRef(colorCurves._globalCurve, colorCurves._midtonesCurve);
            // Compute shadows info.
            colorCurves._getColorGradingDataToRef(colorCurves._shadowsHue, colorCurves._shadowsDensity, colorCurves._shadowsSaturation, colorCurves._shadowsExposure, colorCurves._tempColor);
            colorCurves._tempColor.multiplyToRef(colorCurves._globalCurve, colorCurves._shadowsCurve);
            // Compute deltas (neutral is midtones).
            colorCurves._highlightsCurve.subtractToRef(colorCurves._midtonesCurve, colorCurves._positiveCurve);
            colorCurves._midtonesCurve.subtractToRef(colorCurves._shadowsCurve, colorCurves._negativeCurve);
        }
        if (effect) {
            effect.setFloat4(positiveUniform, colorCurves._positiveCurve.r, colorCurves._positiveCurve.g, colorCurves._positiveCurve.b, colorCurves._positiveCurve.a);
            effect.setFloat4(neutralUniform, colorCurves._midtonesCurve.r, colorCurves._midtonesCurve.g, colorCurves._midtonesCurve.b, colorCurves._midtonesCurve.a);
            effect.setFloat4(negativeUniform, colorCurves._negativeCurve.r, colorCurves._negativeCurve.g, colorCurves._negativeCurve.b, colorCurves._negativeCurve.a);
        }
    }
    /**
     * Returns color grading data based on a hue, density, saturation and exposure value.
     * @param hue
     * @param density
     * @param saturation The saturation.
     * @param exposure The exposure.
     * @param result The result data container.
     */
    _getColorGradingDataToRef(hue, density, saturation, exposure, result) {
        if (hue == null) {
            return;
        }
        hue = ColorCurves._Clamp(hue, 0, 360);
        density = ColorCurves._Clamp(density, -100, 100);
        saturation = ColorCurves._Clamp(saturation, -100, 100);
        exposure = ColorCurves._Clamp(exposure, -100, 100);
        // Remap the slider/config filter density with non-linear mapping and also scale by half
        // so that the maximum filter density is only 50% control. This provides fine control
        // for small values and reasonable range.
        density = ColorCurves._ApplyColorGradingSliderNonlinear(density);
        density *= 0.5;
        exposure = ColorCurves._ApplyColorGradingSliderNonlinear(exposure);
        if (density < 0) {
            density *= -1;
            hue = (hue + 180) % 360;
        }
        ColorCurves._FromHSBToRef(hue, density, 50 + 0.25 * exposure, result);
        result.scaleToRef(2, result);
        result.a = 1 + 0.01 * saturation;
    }
    /**
     * Takes an input slider value and returns an adjusted value that provides extra control near the centre.
     * @param value The input slider value in range [-100,100].
     * @returns Adjusted value.
     */
    static _ApplyColorGradingSliderNonlinear(value) {
        value /= 100;
        let x = Math.abs(value);
        x = Math.pow(x, 2);
        if (value < 0) {
            x *= -1;
        }
        x *= 100;
        return x;
    }
    /**
     * Returns an RGBA Color4 based on Hue, Saturation and Brightness (also referred to as value, HSV).
     * @param hue The hue (H) input.
     * @param saturation The saturation (S) input.
     * @param brightness The brightness (B) input.
     * @param result
     * @result An RGBA color represented as Vector4.
     */
    static _FromHSBToRef(hue, saturation, brightness, result) {
        let h = ColorCurves._Clamp(hue, 0, 360);
        const s = ColorCurves._Clamp(saturation / 100, 0, 1);
        const v = ColorCurves._Clamp(brightness / 100, 0, 1);
        if (s === 0) {
            result.r = v;
            result.g = v;
            result.b = v;
        }
        else {
            // sector 0 to 5
            h /= 60;
            const i = Math.floor(h);
            // fractional part of h
            const f = h - i;
            const p = v * (1 - s);
            const q = v * (1 - s * f);
            const t = v * (1 - s * (1 - f));
            switch (i) {
                case 0:
                    result.r = v;
                    result.g = t;
                    result.b = p;
                    break;
                case 1:
                    result.r = q;
                    result.g = v;
                    result.b = p;
                    break;
                case 2:
                    result.r = p;
                    result.g = v;
                    result.b = t;
                    break;
                case 3:
                    result.r = p;
                    result.g = q;
                    result.b = v;
                    break;
                case 4:
                    result.r = t;
                    result.g = p;
                    result.b = v;
                    break;
                default:
                    // case 5:
                    result.r = v;
                    result.g = p;
                    result.b = q;
                    break;
            }
        }
        result.a = 1;
    }
    /**
     * Returns a value clamped between min and max
     * @param value The value to clamp
     * @param min The minimum of value
     * @param max The maximum of value
     * @returns The clamped value.
     */
    static _Clamp(value, min, max) {
        return Math.min(Math.max(value, min), max);
    }
    /**
     * Clones the current color curve instance.
     * @returns The cloned curves
     */
    clone() {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper */ .p.Clone(() => new ColorCurves(), this);
    }
    /**
     * Serializes the current color curve instance to a json representation.
     * @returns a JSON representation
     */
    serialize() {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper */ .p.Serialize(this);
    }
    /**
     * Parses the color curve from a json representation.
     * @param source the JSON source to parse
     * @returns The parsed curves
     */
    static Parse(source) {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper */ .p.Parse(() => new ColorCurves(), source, null, null);
    }
}
/**
 * Prepare the list of uniforms associated with the ColorCurves effects.
 * @param uniformsList The list of uniforms used in the effect
 */
ColorCurves.PrepareUniforms = _colorCurves_functions_js__WEBPACK_IMPORTED_MODULE_4__/* .PrepareUniformsForColorCurves */ .B;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_globalHue", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_globalDensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_globalSaturation", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_globalExposure", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_highlightsHue", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_highlightsDensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_highlightsSaturation", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_highlightsExposure", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_midtonesHue", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_midtonesDensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_midtonesSaturation", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ColorCurves.prototype, "_midtonesExposure", void 0);
// References the dependencies.
_Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper */ .p._ColorCurvesParser = ColorCurves.Parse;
//# sourceMappingURL=colorCurves.js.map

/***/ }),

/***/ 70767:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   E: () => (/* binding */ IsWrapper)
/* harmony export */ });
/**
 * Detect if the effect is a DrawWrapper
 * @param effect defines the entity to test
 * @returns if the entity is a DrawWrapper
 */
function IsWrapper(effect) {
    return effect.getPipelineContext === undefined;
}
//# sourceMappingURL=drawWrapper.functions.js.map

/***/ }),

/***/ 35476:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   E: () => (/* binding */ DrawWrapper)
/* harmony export */ });
/* harmony import */ var _Misc_timingTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2940);

/** @internal */
class DrawWrapper {
    static GetEffect(effect) {
        return effect.getPipelineContext === undefined ? effect.effect : effect;
    }
    constructor(engine, createMaterialContext = true) {
        /**
         * @internal
         * Specifies if the effect was previously ready
         */
        this._wasPreviouslyReady = false;
        /**
         * @internal
         * Forces the code from bindForSubMesh to be fully run the next time it is called
         */
        this._forceRebindOnNextCall = true;
        /**
         * @internal
         * Specifies if the effect was previously using instances
         */
        this._wasPreviouslyUsingInstances = null;
        this.effect = null;
        this.defines = null;
        this.drawContext = engine.createDrawContext();
        if (createMaterialContext) {
            this.materialContext = engine.createMaterialContext();
        }
    }
    setEffect(effect, defines, resetContext = true) {
        this.effect = effect;
        if (defines !== undefined) {
            this.defines = defines;
        }
        if (resetContext) {
            this.drawContext?.reset();
        }
    }
    /**
     * Dispose the effect wrapper and its resources
     * @param immediate if the effect should be disposed immediately or on the next frame.
     * If dispose() is not called during a scene or engine dispose, we want to delay the dispose of the underlying effect. Mostly to give a chance to user code to reuse the effect in some way.
     */
    dispose(immediate = false) {
        if (this.effect) {
            const effect = this.effect;
            if (immediate) {
                effect.dispose();
            }
            else {
                _Misc_timingTools_js__WEBPACK_IMPORTED_MODULE_0__/* .TimingTools */ ._.SetImmediate(() => {
                    effect.getEngine().onEndFrameObservable.addOnce(() => {
                        effect.dispose();
                    });
                });
            }
            this.effect = null;
        }
        this.drawContext?.dispose();
    }
}
//# sourceMappingURL=drawWrapper.js.map

/***/ }),

/***/ 57647:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   FK: () => (/* binding */ _retryWithInterval),
/* harmony export */   b4: () => (/* binding */ getCachedPipeline),
/* harmony export */   bu: () => (/* binding */ _processShaderCode),
/* harmony export */   mO: () => (/* binding */ resetCachedPipeline),
/* harmony export */   uR: () => (/* binding */ createAndPreparePipelineContext)
/* harmony export */ });
/* harmony import */ var _Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18790);
/* harmony import */ var _Engines_thinEngine_functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62484);
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69610);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51137);
/* harmony import */ var _Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19125);
/* harmony import */ var _Engines_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16741);






/**
 * Get a cached pipeline context
 * @param name the pipeline name
 * @param context the context to be used when creating the pipeline
 * @returns the cached pipeline context if it exists
 * @internal
 */
function getCachedPipeline(name, context) {
    const stateObject = (0,_Engines_thinEngine_functions_js__WEBPACK_IMPORTED_MODULE_1__/* .getStateObject */ .N5)(context);
    return stateObject.cachedPipelines[name];
}
/**
 * @internal
 */
function resetCachedPipeline(pipeline) {
    const name = pipeline._name;
    const context = pipeline.context;
    if (name && context) {
        const stateObject = (0,_Engines_thinEngine_functions_js__WEBPACK_IMPORTED_MODULE_1__/* .getStateObject */ .N5)(context);
        const cachedPipeline = stateObject.cachedPipelines[name];
        cachedPipeline?.dispose();
        delete stateObject.cachedPipelines[name];
    }
}
/** @internal */
function _processShaderCode(processorOptions, baseName, processFinalCode, onFinalCodeReady, shaderLanguage, engine, effectContext) {
    let vertexSource;
    let fragmentSource;
    // const baseName = this.name;
    const hostDocument = (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .IsWindowObjectExist */ .BA)() ? engine?.getHostDocument() : null;
    if (typeof baseName === "string") {
        vertexSource = baseName;
    }
    else if (baseName.vertexSource) {
        vertexSource = "source:" + baseName.vertexSource;
    }
    else if (baseName.vertexElement) {
        vertexSource = hostDocument?.getElementById(baseName.vertexElement) || baseName.vertexElement;
    }
    else {
        vertexSource = baseName.vertex || baseName;
    }
    if (typeof baseName === "string") {
        fragmentSource = baseName;
    }
    else if (baseName.fragmentSource) {
        fragmentSource = "source:" + baseName.fragmentSource;
    }
    else if (baseName.fragmentElement) {
        fragmentSource = hostDocument?.getElementById(baseName.fragmentElement) || baseName.fragmentElement;
    }
    else {
        fragmentSource = baseName.fragment || baseName;
    }
    const shaderCodes = [undefined, undefined];
    const shadersLoaded = () => {
        if (shaderCodes[0] && shaderCodes[1]) {
            processorOptions.isFragment = true;
            const [migratedVertexCode, fragmentCode] = shaderCodes;
            (0,_Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_4__/* .Process */ .M0)(fragmentCode, processorOptions, (migratedFragmentCode, codeBeforeMigration) => {
                if (effectContext) {
                    effectContext._fragmentSourceCodeBeforeMigration = codeBeforeMigration;
                }
                if (processFinalCode) {
                    migratedFragmentCode = processFinalCode("fragment", migratedFragmentCode);
                }
                const finalShaders = (0,_Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_4__/* .Finalize */ .nO)(migratedVertexCode, migratedFragmentCode, processorOptions);
                processorOptions = null;
                const finalCode = _useFinalCode(finalShaders.vertexCode, finalShaders.fragmentCode, baseName, shaderLanguage);
                onFinalCodeReady?.(finalCode.vertexSourceCode, finalCode.fragmentSourceCode);
            }, engine);
        }
    };
    _loadShader(vertexSource, "Vertex", "", (vertexCode) => {
        (0,_Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_4__/* .Initialize */ .pB)(processorOptions);
        (0,_Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_4__/* .Process */ .M0)(vertexCode, processorOptions, (migratedVertexCode, codeBeforeMigration) => {
            if (effectContext) {
                effectContext._rawVertexSourceCode = vertexCode;
                effectContext._vertexSourceCodeBeforeMigration = codeBeforeMigration;
            }
            if (processFinalCode) {
                migratedVertexCode = processFinalCode("vertex", migratedVertexCode);
            }
            shaderCodes[0] = migratedVertexCode;
            shadersLoaded();
        }, engine);
    }, shaderLanguage);
    _loadShader(fragmentSource, "Fragment", "Pixel", (fragmentCode) => {
        if (effectContext) {
            effectContext._rawFragmentSourceCode = fragmentCode;
        }
        shaderCodes[1] = fragmentCode;
        shadersLoaded();
    }, shaderLanguage);
}
function _loadShader(shader, key, optionalKey, callback, shaderLanguage, _loadFileInjection) {
    if (typeof HTMLElement !== "undefined") {
        // DOM element ?
        if (shader instanceof HTMLElement) {
            const shaderCode = (0,_Misc_domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .GetDOMTextContent */ .Zl)(shader);
            callback(shaderCode);
            return;
        }
    }
    // Direct source ?
    if (shader.substring(0, 7) === "source:") {
        callback(shader.substring(7));
        return;
    }
    // Base64 encoded ?
    if (shader.substring(0, 7) === "base64:") {
        const shaderBinary = window.atob(shader.substring(7));
        callback(shaderBinary);
        return;
    }
    const shaderStore = _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.GetShadersStore(shaderLanguage);
    // Is in local store ?
    if (shaderStore[shader + key + "Shader"]) {
        callback(shaderStore[shader + key + "Shader"]);
        return;
    }
    if (optionalKey && shaderStore[shader + optionalKey + "Shader"]) {
        callback(shaderStore[shader + optionalKey + "Shader"]);
        return;
    }
    let shaderUrl;
    if (shader[0] === "." || shader[0] === "/" || shader.indexOf("http") > -1) {
        shaderUrl = shader;
    }
    else {
        shaderUrl = _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.GetShadersRepository(shaderLanguage) + shader;
    }
    _loadFileInjection = _loadFileInjection || _Engines_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_5__/* ._loadFile */ .W0;
    if (!_loadFileInjection) {
        // we got to this point and loadFile was not injected - throw an error
        throw new Error("loadFileInjection is not defined");
    }
    // Vertex shader
    _loadFileInjection(shaderUrl + "." + key.toLowerCase() + ".fx", callback);
}
function _useFinalCode(migratedVertexCode, migratedFragmentCode, baseName, shaderLanguage) {
    if (baseName) {
        const vertex = baseName.vertexElement || baseName.vertex || baseName.spectorName || baseName;
        const fragment = baseName.fragmentElement || baseName.fragment || baseName.spectorName || baseName;
        return {
            vertexSourceCode: (shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "//" : "") + "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode,
            fragmentSourceCode: (shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "//" : "") + "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode,
        };
    }
    else {
        return {
            vertexSourceCode: migratedVertexCode,
            fragmentSourceCode: migratedFragmentCode,
        };
    }
}
/**
 * Creates and prepares a pipeline context
 * @internal
 */
const createAndPreparePipelineContext = (options, createPipelineContext, _preparePipelineContext, _executeWhenRenderingStateIsCompiled) => {
    try {
        const pipelineContext = options.existingPipelineContext || createPipelineContext(options.shaderProcessingContext);
        pipelineContext._name = options.name;
        if (options.name && options.context) {
            const stateObject = (0,_Engines_thinEngine_functions_js__WEBPACK_IMPORTED_MODULE_1__/* .getStateObject */ .N5)(options.context);
            stateObject.cachedPipelines[options.name] = pipelineContext;
        }
        // Flagged as async as we may need to delay load some processing tools
        // This does not break anything as the execution is waiting for _executeWhenRenderingStateIsCompiled
        _preparePipelineContext(pipelineContext, options.vertex, options.fragment, !!options.createAsRaw, "", "", options.rebuildRebind, options.defines, options.transformFeedbackVaryings, "", () => {
            _executeWhenRenderingStateIsCompiled(pipelineContext, () => {
                options.onRenderingStateCompiled?.(pipelineContext);
            });
        });
        return pipelineContext;
    }
    catch (e) {
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("Error compiling effect");
        throw e;
    }
};
const _retryWithInterval = (condition, onSuccess, onError, step = 16, maxTimeout = 1000) => {
    const int = setInterval(() => {
        try {
            if (condition()) {
                clearInterval(int);
                onSuccess();
            }
        }
        catch (e) {
            clearInterval(int);
            onError?.(e);
        }
        maxTimeout -= step;
        if (maxTimeout < 0) {
            clearInterval(int);
            onError?.();
        }
    }, step);
};
//# sourceMappingURL=effect.functions.js.map

/***/ }),

/***/ 74420:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   M: () => (/* binding */ Effect)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69610);
/* harmony import */ var _effect_functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57647);





/**
 * Effect containing vertex and fragment shader that can be executed on an object.
 */
class Effect {
    /**
     * Gets or sets the relative url used to load shaders if using the engine in non-minified mode
     */
    static get ShadersRepository() {
        return _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.ShadersRepository;
    }
    static set ShadersRepository(repo) {
        _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.ShadersRepository = repo;
    }
    /**
     * Gets a boolean indicating that the effect was already disposed
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Observable that will be called when effect is bound.
     */
    get onBindObservable() {
        if (!this._onBindObservable) {
            this._onBindObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        }
        return this._onBindObservable;
    }
    /**
     * Gets the shader language type used to write vertex and fragment source code.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Instantiates an effect.
     * An effect can be used to create/manage/execute vertex and fragment shaders.
     * @param baseName Name of the effect.
     * @param attributesNamesOrOptions List of attribute names that will be passed to the shader or set of all options to create the effect.
     * @param uniformsNamesOrEngine List of uniform variable names that will be passed to the shader or the engine that will be used to render effect.
     * @param samplers List of sampler variables that will be passed to the shader.
     * @param engine Engine to be used to render the effect
     * @param defines Define statements to be added to the shader.
     * @param fallbacks Possible fallbacks for this effect to improve performance when needed.
     * @param onCompiled Callback that will be called when the shader is compiled.
     * @param onError Callback that will be called if an error occurs during shader compilation.
     * @param indexParameters Parameters to be used with Babylons include syntax to iterate over an array (eg. \{lights: 10\})
     * @param key Effect Key identifying uniquely compiled shader variants
     * @param shaderLanguage the language the shader is written in (default: GLSL)
     * @param extraInitializationsAsync additional async code to run before preparing the effect
     */
    constructor(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers = null, engine, defines = null, fallbacks = null, onCompiled = null, onError = null, indexParameters, key = "", shaderLanguage = 0 /* ShaderLanguage.GLSL */, extraInitializationsAsync) {
        /**
         * String container all the define statements that should be set on the shader.
         */
        this.defines = "";
        /**
         * Callback that will be called when the shader is compiled.
         */
        this.onCompiled = null;
        /**
         * Callback that will be called if an error occurs during shader compilation.
         */
        this.onError = null;
        /**
         * Callback that will be called when effect is bound.
         */
        this.onBind = null;
        /**
         * Unique ID of the effect.
         */
        this.uniqueId = 0;
        /**
         * Observable that will be called when the shader is compiled.
         * It is recommended to use executeWhenCompile() or to make sure that scene.isReady() is called to get this observable raised.
         */
        this.onCompileObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * Observable that will be called if an error occurs during shader compilation.
         */
        this.onErrorObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /** @internal */
        this._onBindObservable = null;
        this._isDisposed = false;
        /** @internal */
        this._refCount = 1;
        /** @internal */
        this._bonesComputationForcedToCPU = false;
        /** @internal */
        this._uniformBuffersNames = {};
        /** @internal */
        this._multiTarget = false;
        /** @internal */
        this._samplers = {};
        this._isReady = false;
        this._compilationError = "";
        this._allFallbacksProcessed = false;
        /** @internal */
        this._uniforms = {};
        /**
         * Key for the effect.
         * @internal
         */
        this._key = "";
        this._fallbacks = null;
        this._vertexSourceCodeOverride = "";
        this._fragmentSourceCodeOverride = "";
        this._transformFeedbackVaryings = null;
        /**
         * Compiled shader to webGL program.
         * @internal
         */
        this._pipelineContext = null;
        /** @internal */
        this._vertexSourceCode = "";
        /** @internal */
        this._fragmentSourceCode = "";
        /** @internal */
        this._vertexSourceCodeBeforeMigration = "";
        /** @internal */
        this._fragmentSourceCodeBeforeMigration = "";
        /** @internal */
        this._rawVertexSourceCode = "";
        /** @internal */
        this._rawFragmentSourceCode = "";
        this._processCodeAfterIncludes = undefined;
        this._processFinalCode = null;
        this.name = baseName;
        this._key = key;
        const pipelineName = this._key.replace(/\r/g, "").replace(/\n/g, "|");
        let cachedPipeline = undefined;
        if (attributesNamesOrOptions.attributes) {
            const options = attributesNamesOrOptions;
            this._engine = uniformsNamesOrEngine;
            this._attributesNames = options.attributes;
            this._uniformsNames = options.uniformsNames.concat(options.samplers);
            this._samplerList = options.samplers.slice();
            this.defines = options.defines;
            this.onError = options.onError;
            this.onCompiled = options.onCompiled;
            this._fallbacks = options.fallbacks;
            this._indexParameters = options.indexParameters;
            this._transformFeedbackVaryings = options.transformFeedbackVaryings || null;
            this._multiTarget = !!options.multiTarget;
            this._shaderLanguage = options.shaderLanguage ?? 0 /* ShaderLanguage.GLSL */;
            if (options.uniformBuffersNames) {
                this._uniformBuffersNamesList = options.uniformBuffersNames.slice();
                for (let i = 0; i < options.uniformBuffersNames.length; i++) {
                    this._uniformBuffersNames[options.uniformBuffersNames[i]] = i;
                }
            }
            this._processFinalCode = options.processFinalCode ?? null;
            this._processCodeAfterIncludes = options.processCodeAfterIncludes ?? undefined;
            cachedPipeline = options.existingPipelineContext;
        }
        else {
            this._engine = engine;
            this.defines = defines == null ? "" : defines;
            this._uniformsNames = uniformsNamesOrEngine.concat(samplers);
            this._samplerList = samplers ? samplers.slice() : [];
            this._attributesNames = attributesNamesOrOptions;
            this._uniformBuffersNamesList = [];
            this._shaderLanguage = shaderLanguage;
            this.onError = onError;
            this.onCompiled = onCompiled;
            this._indexParameters = indexParameters;
            this._fallbacks = fallbacks;
        }
        // Use the cache if we can. For now, WebGL2 only.
        if (this._engine.shaderPlatformName === "WEBGL2") {
            cachedPipeline = (0,_effect_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .getCachedPipeline */ .b4)(pipelineName, this._engine._gl) ?? cachedPipeline;
        }
        this._attributeLocationByName = {};
        this.uniqueId = Effect._UniqueIdSeed++;
        if (!cachedPipeline) {
            this._processShaderCodeAsync(null, false, null, extraInitializationsAsync);
        }
        else {
            this._pipelineContext = cachedPipeline;
            this._pipelineContext.setEngine(this._engine);
            this._onRenderingStateCompiled(this._pipelineContext);
            // rebuildRebind for spector
            if (this._pipelineContext.program) {
                this._pipelineContext.program.__SPECTOR_rebuildProgram = this._rebuildProgram.bind(this);
            }
        }
    }
    /** @internal */
    async _processShaderCodeAsync(shaderProcessor = null, keepExistingPipelineContext = false, shaderProcessingContext = null, extraInitializationsAsync) {
        if (extraInitializationsAsync) {
            await extraInitializationsAsync();
        }
        this._processingContext = shaderProcessingContext || this._engine._getShaderProcessingContext(this._shaderLanguage, false);
        const processorOptions = {
            defines: this.defines.split("\n"),
            indexParameters: this._indexParameters,
            isFragment: false,
            shouldUseHighPrecisionShader: this._engine._shouldUseHighPrecisionShader,
            processor: shaderProcessor ?? this._engine._getShaderProcessor(this._shaderLanguage),
            supportsUniformBuffers: this._engine.supportsUniformBuffers,
            shadersRepository: _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.GetShadersRepository(this._shaderLanguage),
            includesShadersStore: _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.GetIncludesShadersStore(this._shaderLanguage),
            version: (this._engine.version * 100).toString(),
            platformName: this._engine.shaderPlatformName,
            processingContext: this._processingContext,
            isNDCHalfZRange: this._engine.isNDCHalfZRange,
            useReverseDepthBuffer: this._engine.useReverseDepthBuffer,
            processCodeAfterIncludes: this._processCodeAfterIncludes,
        };
        (0,_effect_functions_js__WEBPACK_IMPORTED_MODULE_3__/* ._processShaderCode */ .bu)(processorOptions, this.name, this._processFinalCode, (migratedVertexCode, migratedFragmentCode) => {
            this._vertexSourceCode = migratedVertexCode;
            this._fragmentSourceCode = migratedFragmentCode;
            this._prepareEffect(keepExistingPipelineContext);
        }, this._shaderLanguage, this._engine, this);
    }
    /**
     * Unique key for this effect
     */
    get key() {
        return this._key;
    }
    /**
     * If the effect has been compiled and prepared.
     * @returns if the effect is compiled and prepared.
     */
    isReady() {
        try {
            return this._isReadyInternal();
        }
        catch {
            return false;
        }
    }
    _isReadyInternal() {
        if (this._engine.isDisposed) {
            // Engine is disposed, we return true to prevent looping over the setTimeout call in _checkIsReady
            return true;
        }
        if (this._isReady) {
            return true;
        }
        if (this._pipelineContext) {
            return this._pipelineContext.isReady;
        }
        return false;
    }
    /**
     * The engine the effect was initialized with.
     * @returns the engine.
     */
    getEngine() {
        return this._engine;
    }
    /**
     * The pipeline context for this effect
     * @returns the associated pipeline context
     */
    getPipelineContext() {
        return this._pipelineContext;
    }
    /**
     * The set of names of attribute variables for the shader.
     * @returns An array of attribute names.
     */
    getAttributesNames() {
        return this._attributesNames;
    }
    /**
     * Returns the attribute at the given index.
     * @param index The index of the attribute.
     * @returns The location of the attribute.
     */
    getAttributeLocation(index) {
        return this._attributes[index];
    }
    /**
     * Returns the attribute based on the name of the variable.
     * @param name of the attribute to look up.
     * @returns the attribute location.
     */
    getAttributeLocationByName(name) {
        return this._attributeLocationByName[name];
    }
    /**
     * The number of attributes.
     * @returns the number of attributes.
     */
    getAttributesCount() {
        return this._attributes.length;
    }
    /**
     * Gets the index of a uniform variable.
     * @param uniformName of the uniform to look up.
     * @returns the index.
     */
    getUniformIndex(uniformName) {
        return this._uniformsNames.indexOf(uniformName);
    }
    /**
     * Returns the attribute based on the name of the variable.
     * @param uniformName of the uniform to look up.
     * @returns the location of the uniform.
     */
    getUniform(uniformName) {
        return this._uniforms[uniformName];
    }
    /**
     * Returns an array of sampler variable names
     * @returns The array of sampler variable names.
     */
    getSamplers() {
        return this._samplerList;
    }
    /**
     * Returns an array of uniform variable names
     * @returns The array of uniform variable names.
     */
    getUniformNames() {
        return this._uniformsNames;
    }
    /**
     * Returns an array of uniform buffer variable names
     * @returns The array of uniform buffer variable names.
     */
    getUniformBuffersNames() {
        return this._uniformBuffersNamesList;
    }
    /**
     * Returns the index parameters used to create the effect
     * @returns The index parameters object
     */
    getIndexParameters() {
        return this._indexParameters;
    }
    /**
     * The error from the last compilation.
     * @returns the error string.
     */
    getCompilationError() {
        return this._compilationError;
    }
    /**
     * Gets a boolean indicating that all fallbacks were used during compilation
     * @returns true if all fallbacks were used
     */
    allFallbacksProcessed() {
        return this._allFallbacksProcessed;
    }
    /**
     * Adds a callback to the onCompiled observable and call the callback immediately if already ready.
     * @param func The callback to be used.
     */
    executeWhenCompiled(func) {
        if (this.isReady()) {
            func(this);
            return;
        }
        this.onCompileObservable.add((effect) => {
            func(effect);
        });
        if (!this._pipelineContext || this._pipelineContext.isAsync) {
            this._checkIsReady(null);
        }
    }
    _checkIsReady(previousPipelineContext) {
        (0,_effect_functions_js__WEBPACK_IMPORTED_MODULE_3__/* ._retryWithInterval */ .FK)(() => {
            return this._isReadyInternal() || this._isDisposed;
        }, () => {
            // no-op - done in the _isReadyInternal call
        }, (e) => {
            this._processCompilationErrors(e, previousPipelineContext);
        });
    }
    /**
     * Gets the vertex shader source code of this effect
     * This is the final source code that will be compiled, after all the processing has been done (pre-processing applied, code injection/replacement, etc)
     */
    get vertexSourceCode() {
        return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride
            ? this._vertexSourceCodeOverride
            : (this._pipelineContext?._getVertexShaderCode() ?? this._vertexSourceCode);
    }
    /**
     * Gets the fragment shader source code of this effect
     * This is the final source code that will be compiled, after all the processing has been done (pre-processing applied, code injection/replacement, etc)
     */
    get fragmentSourceCode() {
        return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride
            ? this._fragmentSourceCodeOverride
            : (this._pipelineContext?._getFragmentShaderCode() ?? this._fragmentSourceCode);
    }
    /**
     * Gets the vertex shader source code before migration.
     * This is the source code after the include directives have been replaced by their contents but before the code is migrated, i.e. before ShaderProcess._ProcessShaderConversion is executed.
     * This method is, among other things, responsible for parsing #if/#define directives as well as converting GLES2 syntax to GLES3 (in the case of WebGL).
     */
    get vertexSourceCodeBeforeMigration() {
        return this._vertexSourceCodeBeforeMigration;
    }
    /**
     * Gets the fragment shader source code before migration.
     * This is the source code after the include directives have been replaced by their contents but before the code is migrated, i.e. before ShaderProcess._ProcessShaderConversion is executed.
     * This method is, among other things, responsible for parsing #if/#define directives as well as converting GLES2 syntax to GLES3 (in the case of WebGL).
     */
    get fragmentSourceCodeBeforeMigration() {
        return this._fragmentSourceCodeBeforeMigration;
    }
    /**
     * Gets the vertex shader source code before it has been modified by any processing
     */
    get rawVertexSourceCode() {
        return this._rawVertexSourceCode;
    }
    /**
     * Gets the fragment shader source code before it has been modified by any processing
     */
    get rawFragmentSourceCode() {
        return this._rawFragmentSourceCode;
    }
    getPipelineGenerationOptions() {
        return {
            platformName: this._engine.shaderPlatformName,
            shaderLanguage: this._shaderLanguage,
            shaderNameOrContent: this.name,
            key: this._key,
            defines: this.defines.split("\n"),
            addGlobalDefines: false,
            extendedProcessingOptions: {
                indexParameters: this._indexParameters,
                isNDCHalfZRange: this._engine.isNDCHalfZRange,
                useReverseDepthBuffer: this._engine.useReverseDepthBuffer,
                supportsUniformBuffers: this._engine.supportsUniformBuffers,
            },
            extendedCreatePipelineOptions: {
                transformFeedbackVaryings: this._transformFeedbackVaryings,
                createAsRaw: !!(this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride),
            },
        };
    }
    /**
     * Recompiles the webGL program
     * @param vertexSourceCode The source code for the vertex shader.
     * @param fragmentSourceCode The source code for the fragment shader.
     * @param onCompiled Callback called when completed.
     * @param onError Callback called on error.
     * @internal
     */
    _rebuildProgram(vertexSourceCode, fragmentSourceCode, onCompiled, onError) {
        this._isReady = false;
        this._vertexSourceCodeOverride = vertexSourceCode;
        this._fragmentSourceCodeOverride = fragmentSourceCode;
        this.onError = (effect, error) => {
            if (onError) {
                onError(error);
            }
        };
        this.onCompiled = () => {
            const scenes = this.getEngine().scenes;
            if (scenes) {
                for (let i = 0; i < scenes.length; i++) {
                    scenes[i].markAllMaterialsAsDirty(63);
                }
            }
            this._pipelineContext._handlesSpectorRebuildCallback?.(onCompiled);
        };
        this._fallbacks = null;
        this._prepareEffect();
    }
    _onRenderingStateCompiled(pipelineContext) {
        this._pipelineContext = pipelineContext;
        this._pipelineContext.setEngine(this._engine);
        this._attributes = [];
        this._pipelineContext._fillEffectInformation(this, this._uniformBuffersNames, this._uniformsNames, this._uniforms, this._samplerList, this._samplers, this._attributesNames, this._attributes);
        // Caches attribute locations.
        if (this._attributesNames) {
            for (let i = 0; i < this._attributesNames.length; i++) {
                const name = this._attributesNames[i];
                this._attributeLocationByName[name] = this._attributes[i];
            }
        }
        this._engine.bindSamplers(this);
        this._compilationError = "";
        this._isReady = true;
        if (this.onCompiled) {
            this.onCompiled(this);
        }
        this.onCompileObservable.notifyObservers(this);
        this.onCompileObservable.clear();
        // Unbind mesh reference in fallbacks
        if (this._fallbacks) {
            this._fallbacks.unBindMesh();
        }
        if (Effect.AutomaticallyClearCodeCache) {
            this.clearCodeCache();
        }
    }
    /**
     * Prepares the effect
     * @internal
     */
    _prepareEffect(keepExistingPipelineContext = false) {
        const previousPipelineContext = this._pipelineContext;
        this._isReady = false;
        try {
            const overrides = !!(this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride);
            const defines = overrides ? null : this.defines;
            const vertex = overrides ? this._vertexSourceCodeOverride : this._vertexSourceCode;
            const fragment = overrides ? this._fragmentSourceCodeOverride : this._fragmentSourceCode;
            const engine = this._engine;
            this._pipelineContext = (0,_effect_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .createAndPreparePipelineContext */ .uR)({
                existingPipelineContext: keepExistingPipelineContext ? previousPipelineContext : null,
                vertex,
                fragment,
                context: engine.shaderPlatformName === "WEBGL2" ? engine._gl : undefined,
                rebuildRebind: (vertexSourceCode, fragmentSourceCode, onCompiled, onError) => this._rebuildProgram(vertexSourceCode, fragmentSourceCode, onCompiled, onError),
                defines,
                transformFeedbackVaryings: this._transformFeedbackVaryings,
                name: this._key.replace(/\r/g, "").replace(/\n/g, "|"),
                createAsRaw: overrides,
                parallelShaderCompile: engine._caps.parallelShaderCompile,
                shaderProcessingContext: this._processingContext,
                onRenderingStateCompiled: (pipelineContext) => {
                    if (previousPipelineContext && !keepExistingPipelineContext) {
                        this._engine._deletePipelineContext(previousPipelineContext);
                    }
                    if (pipelineContext) {
                        this._onRenderingStateCompiled(pipelineContext);
                    }
                },
            }, this._engine.createPipelineContext.bind(this._engine), this._engine._preparePipelineContext.bind(this._engine), this._engine._executeWhenRenderingStateIsCompiled.bind(this._engine));
            if (this._pipelineContext.isAsync) {
                this._checkIsReady(previousPipelineContext);
            }
        }
        catch (e) {
            this._processCompilationErrors(e, previousPipelineContext);
        }
    }
    _getShaderCodeAndErrorLine(code, error, isFragment) {
        const regexp = isFragment ? /FRAGMENT SHADER ERROR: 0:(\d+?):/ : /VERTEX SHADER ERROR: 0:(\d+?):/;
        let errorLine = null;
        if (error && code) {
            const res = error.match(regexp);
            if (res && res.length === 2) {
                const lineNumber = parseInt(res[1]);
                const lines = code.split("\n", -1);
                if (lines.length >= lineNumber) {
                    errorLine = `Offending line [${lineNumber}] in ${isFragment ? "fragment" : "vertex"} code: ${lines[lineNumber - 1]}`;
                }
            }
        }
        return [code, errorLine];
    }
    _processCompilationErrors(e, previousPipelineContext = null) {
        this._compilationError = e.message;
        const attributesNames = this._attributesNames;
        const fallbacks = this._fallbacks;
        // Let's go through fallbacks then
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Unable to compile effect:");
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Uniforms: " +
            this._uniformsNames.map(function (uniform) {
                return " " + uniform;
            }));
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Attributes: " +
            attributesNames.map(function (attribute) {
                return " " + attribute;
            }));
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Defines:\n" + this.defines);
        if (Effect.LogShaderCodeOnCompilationError) {
            let lineErrorVertex = null, lineErrorFragment = null, code = null;
            if (this._pipelineContext?._getVertexShaderCode()) {
                [code, lineErrorVertex] = this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(), this._compilationError, false);
                if (code) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Vertex code:");
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error(code);
                }
            }
            if (this._pipelineContext?._getFragmentShaderCode()) {
                [code, lineErrorFragment] = this._getShaderCodeAndErrorLine(this._pipelineContext?._getFragmentShaderCode(), this._compilationError, true);
                if (code) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Fragment code:");
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error(code);
                }
            }
            if (lineErrorVertex) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error(lineErrorVertex);
            }
            if (lineErrorFragment) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error(lineErrorFragment);
            }
        }
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Error: " + this._compilationError);
        const notifyErrors = () => {
            if (this.onError) {
                this.onError(this, this._compilationError);
            }
            this.onErrorObservable.notifyObservers(this);
        };
        // In case a previous compilation was successful, we need to restore the previous pipeline context
        if (previousPipelineContext) {
            this._pipelineContext = previousPipelineContext;
            this._isReady = true;
            notifyErrors();
        }
        // Lets try to compile fallbacks as long as we have some.
        if (fallbacks) {
            this._pipelineContext = null;
            if (fallbacks.hasMoreFallbacks) {
                this._allFallbacksProcessed = false;
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Trying next fallback.");
                this.defines = fallbacks.reduce(this.defines, this);
                this._prepareEffect();
            }
            else {
                // Sorry we did everything we can
                this._allFallbacksProcessed = true;
                notifyErrors();
                this.onErrorObservable.clear();
                // Unbind mesh reference in fallbacks
                if (this._fallbacks) {
                    this._fallbacks.unBindMesh();
                }
            }
        }
        else {
            this._allFallbacksProcessed = true;
            // In case of error, without any prior successful compilation, let s notify observers
            if (!previousPipelineContext) {
                notifyErrors();
            }
        }
    }
    /**
     * Checks if the effect is supported. (Must be called after compilation)
     */
    get isSupported() {
        return this._compilationError === "";
    }
    /**
     * Binds a texture to the engine to be used as output of the shader.
     * @param channel Name of the output variable.
     * @param texture Texture to bind.
     * @internal
     */
    _bindTexture(channel, texture) {
        this._engine._bindTexture(this._samplers[channel], texture, channel);
    }
    /**
     * Sets a texture on the engine to be used in the shader.
     * @param channel Name of the sampler variable.
     * @param texture Texture to set.
     */
    setTexture(channel, texture) {
        this._engine.setTexture(this._samplers[channel], this._uniforms[channel], texture, channel);
    }
    /**
     * Sets an array of textures on the engine to be used in the shader.
     * @param channel Name of the variable.
     * @param textures Textures to set.
     */
    setTextureArray(channel, textures) {
        const exName = channel + "Ex";
        if (this._samplerList.indexOf(exName + "0") === -1) {
            const initialPos = this._samplerList.indexOf(channel);
            for (let index = 1; index < textures.length; index++) {
                const currentExName = exName + (index - 1).toString();
                this._samplerList.splice(initialPos + index, 0, currentExName);
            }
            // Reset every channels
            let channelIndex = 0;
            for (const key of this._samplerList) {
                this._samplers[key] = channelIndex;
                channelIndex += 1;
            }
        }
        this._engine.setTextureArray(this._samplers[channel], this._uniforms[channel], textures, channel);
    }
    /**
     * Binds a buffer to a uniform.
     * @param buffer Buffer to bind.
     * @param name Name of the uniform variable to bind to.
     */
    bindUniformBuffer(buffer, name) {
        const bufferName = this._uniformBuffersNames[name];
        if (bufferName === undefined || (Effect._BaseCache[bufferName] === buffer && this._engine._features.useUBOBindingCache)) {
            return;
        }
        Effect._BaseCache[bufferName] = buffer;
        this._engine.bindUniformBufferBase(buffer, bufferName, name);
    }
    /**
     * Binds block to a uniform.
     * @param blockName Name of the block to bind.
     * @param index Index to bind.
     */
    bindUniformBlock(blockName, index) {
        this._engine.bindUniformBlock(this._pipelineContext, blockName, index);
    }
    /**
     * Sets an integer value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value Value to be set.
     * @returns this effect.
     */
    setInt(uniformName, value) {
        this._pipelineContext.setInt(uniformName, value);
        return this;
    }
    /**
     * Sets an int2 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int2.
     * @param y Second int in int2.
     * @returns this effect.
     */
    setInt2(uniformName, x, y) {
        this._pipelineContext.setInt2(uniformName, x, y);
        return this;
    }
    /**
     * Sets an int3 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int3.
     * @param y Second int in int3.
     * @param z Third int in int3.
     * @returns this effect.
     */
    setInt3(uniformName, x, y, z) {
        this._pipelineContext.setInt3(uniformName, x, y, z);
        return this;
    }
    /**
     * Sets an int4 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int4.
     * @param y Second int in int4.
     * @param z Third int in int4.
     * @param w Fourth int in int4.
     * @returns this effect.
     */
    setInt4(uniformName, x, y, z, w) {
        this._pipelineContext.setInt4(uniformName, x, y, z, w);
        return this;
    }
    /**
     * Sets an int array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setIntArray(uniformName, array) {
        this._pipelineContext.setIntArray(uniformName, array);
        return this;
    }
    /**
     * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setIntArray2(uniformName, array) {
        this._pipelineContext.setIntArray2(uniformName, array);
        return this;
    }
    /**
     * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setIntArray3(uniformName, array) {
        this._pipelineContext.setIntArray3(uniformName, array);
        return this;
    }
    /**
     * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setIntArray4(uniformName, array) {
        this._pipelineContext.setIntArray4(uniformName, array);
        return this;
    }
    /**
     * Sets an unsigned integer value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value Value to be set.
     * @returns this effect.
     */
    setUInt(uniformName, value) {
        this._pipelineContext.setUInt(uniformName, value);
        return this;
    }
    /**
     * Sets an unsigned int2 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint2.
     * @param y Second unsigned int in uint2.
     * @returns this effect.
     */
    setUInt2(uniformName, x, y) {
        this._pipelineContext.setUInt2(uniformName, x, y);
        return this;
    }
    /**
     * Sets an unsigned int3 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint3.
     * @param y Second unsigned int in uint3.
     * @param z Third unsigned int in uint3.
     * @returns this effect.
     */
    setUInt3(uniformName, x, y, z) {
        this._pipelineContext.setUInt3(uniformName, x, y, z);
        return this;
    }
    /**
     * Sets an unsigned int4 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint4.
     * @param y Second unsigned int in uint4.
     * @param z Third unsigned int in uint4.
     * @param w Fourth unsigned int in uint4.
     * @returns this effect.
     */
    setUInt4(uniformName, x, y, z, w) {
        this._pipelineContext.setUInt4(uniformName, x, y, z, w);
        return this;
    }
    /**
     * Sets an unsigned int array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setUIntArray(uniformName, array) {
        this._pipelineContext.setUIntArray(uniformName, array);
        return this;
    }
    /**
     * Sets an unsigned int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setUIntArray2(uniformName, array) {
        this._pipelineContext.setUIntArray2(uniformName, array);
        return this;
    }
    /**
     * Sets an unsigned int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setUIntArray3(uniformName, array) {
        this._pipelineContext.setUIntArray3(uniformName, array);
        return this;
    }
    /**
     * Sets an unsigned int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setUIntArray4(uniformName, array) {
        this._pipelineContext.setUIntArray4(uniformName, array);
        return this;
    }
    /**
     * Sets an float array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setFloatArray(uniformName, array) {
        this._pipelineContext.setArray(uniformName, array);
        return this;
    }
    /**
     * Sets an float array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setFloatArray2(uniformName, array) {
        this._pipelineContext.setArray2(uniformName, array);
        return this;
    }
    /**
     * Sets an float array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setFloatArray3(uniformName, array) {
        this._pipelineContext.setArray3(uniformName, array);
        return this;
    }
    /**
     * Sets an float array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setFloatArray4(uniformName, array) {
        this._pipelineContext.setArray4(uniformName, array);
        return this;
    }
    /**
     * Sets an array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setArray(uniformName, array) {
        this._pipelineContext.setArray(uniformName, array);
        return this;
    }
    /**
     * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setArray2(uniformName, array) {
        this._pipelineContext.setArray2(uniformName, array);
        return this;
    }
    /**
     * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setArray3(uniformName, array) {
        this._pipelineContext.setArray3(uniformName, array);
        return this;
    }
    /**
     * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     * @returns this effect.
     */
    setArray4(uniformName, array) {
        this._pipelineContext.setArray4(uniformName, array);
        return this;
    }
    /**
     * Sets matrices on a uniform variable.
     * @param uniformName Name of the variable.
     * @param matrices matrices to be set.
     * @returns this effect.
     */
    setMatrices(uniformName, matrices) {
        this._pipelineContext.setMatrices(uniformName, matrices);
        return this;
    }
    /**
     * Sets matrix on a uniform variable.
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     * @returns this effect.
     */
    setMatrix(uniformName, matrix) {
        this._pipelineContext.setMatrix(uniformName, matrix);
        return this;
    }
    /**
     * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     * @returns this effect.
     */
    setMatrix3x3(uniformName, matrix) {
        // the cast is ok because it is gl.uniformMatrix3fv() which is called at the end, and this function accepts Float32Array and Array<number>
        this._pipelineContext.setMatrix3x3(uniformName, matrix);
        return this;
    }
    /**
     * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     * @returns this effect.
     */
    setMatrix2x2(uniformName, matrix) {
        // the cast is ok because it is gl.uniformMatrix3fv() which is called at the end, and this function accepts Float32Array and Array<number>
        this._pipelineContext.setMatrix2x2(uniformName, matrix);
        return this;
    }
    /**
     * Sets a float on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value value to be set.
     * @returns this effect.
     */
    setFloat(uniformName, value) {
        this._pipelineContext.setFloat(uniformName, value);
        return this;
    }
    /**
     * Sets a boolean on a uniform variable.
     * @param uniformName Name of the variable.
     * @param bool value to be set.
     * @returns this effect.
     */
    setBool(uniformName, bool) {
        this._pipelineContext.setInt(uniformName, bool ? 1 : 0);
        return this;
    }
    /**
     * Sets a Vector2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector2 vector2 to be set.
     * @returns this effect.
     */
    setVector2(uniformName, vector2) {
        this._pipelineContext.setVector2(uniformName, vector2);
        return this;
    }
    /**
     * Sets a float2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float2.
     * @param y Second float in float2.
     * @returns this effect.
     */
    setFloat2(uniformName, x, y) {
        this._pipelineContext.setFloat2(uniformName, x, y);
        return this;
    }
    /**
     * Sets a Vector3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector3 Value to be set.
     * @returns this effect.
     */
    setVector3(uniformName, vector3) {
        this._pipelineContext.setVector3(uniformName, vector3);
        return this;
    }
    /**
     * Sets a float3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float3.
     * @param y Second float in float3.
     * @param z Third float in float3.
     * @returns this effect.
     */
    setFloat3(uniformName, x, y, z) {
        this._pipelineContext.setFloat3(uniformName, x, y, z);
        return this;
    }
    /**
     * Sets a Vector4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector4 Value to be set.
     * @returns this effect.
     */
    setVector4(uniformName, vector4) {
        this._pipelineContext.setVector4(uniformName, vector4);
        return this;
    }
    /**
     * Sets a Quaternion on a uniform variable.
     * @param uniformName Name of the variable.
     * @param quaternion Value to be set.
     * @returns this effect.
     */
    setQuaternion(uniformName, quaternion) {
        this._pipelineContext.setQuaternion(uniformName, quaternion);
        return this;
    }
    /**
     * Sets a float4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float4.
     * @param y Second float in float4.
     * @param z Third float in float4.
     * @param w Fourth float in float4.
     * @returns this effect.
     */
    setFloat4(uniformName, x, y, z, w) {
        this._pipelineContext.setFloat4(uniformName, x, y, z, w);
        return this;
    }
    /**
     * Sets a Color3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param color3 Value to be set.
     * @returns this effect.
     */
    setColor3(uniformName, color3) {
        this._pipelineContext.setColor3(uniformName, color3);
        return this;
    }
    /**
     * Sets a Color4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param color3 Value to be set.
     * @param alpha Alpha value to be set.
     * @returns this effect.
     */
    setColor4(uniformName, color3, alpha) {
        this._pipelineContext.setColor4(uniformName, color3, alpha);
        return this;
    }
    /**
     * Sets a Color4 on a uniform variable
     * @param uniformName defines the name of the variable
     * @param color4 defines the value to be set
     * @returns this effect.
     */
    setDirectColor4(uniformName, color4) {
        this._pipelineContext.setDirectColor4(uniformName, color4);
        return this;
    }
    /**
     * Use this wisely: It will remove the cached code from this effect
     * It is probably ok to call it if you are not using ShadowDepthWrapper or if everything is already up and running
     * DO NOT CALL IT if you want to have support for context lost recovery
     */
    clearCodeCache() {
        this._vertexSourceCode = "";
        this._fragmentSourceCode = "";
        this._fragmentSourceCodeBeforeMigration = "";
        this._vertexSourceCodeBeforeMigration = "";
    }
    /**
     * Release all associated resources.
     * @param force specifies if the effect must be released no matter what
     **/
    dispose(force = false) {
        if (force) {
            this._refCount = 0;
        }
        else {
            this._refCount--;
        }
        if (this._refCount > 0 || this._isDisposed) {
            // Others are still using the effect or the effect was already disposed
            return;
        }
        if (this._pipelineContext) {
            (0,_effect_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .resetCachedPipeline */ .mO)(this._pipelineContext);
        }
        this._engine._releaseEffect(this);
        this.clearCodeCache();
        this._isDisposed = true;
    }
    /**
     * This function will add a new shader to the shader store
     * @param name the name of the shader
     * @param pixelShader optional pixel shader content
     * @param vertexShader optional vertex shader content
     * @param shaderLanguage the language the shader is written in (default: GLSL)
     */
    static RegisterShader(name, pixelShader, vertexShader, shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        if (pixelShader) {
            _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.GetShadersStore(shaderLanguage)[`${name}PixelShader`] = pixelShader;
        }
        if (vertexShader) {
            _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.GetShadersStore(shaderLanguage)[`${name}VertexShader`] = vertexShader;
        }
    }
    /**
     * Resets the cache of effects.
     */
    static ResetCache() {
        Effect._BaseCache = {};
    }
}
/**
 * Enable logging of the shader code when a compilation error occurs
 */
Effect.LogShaderCodeOnCompilationError = true;
/**
 * Use this with caution
 * See ClearCodeCache function comments
 */
Effect.AutomaticallyClearCodeCache = false;
Effect._UniqueIdSeed = 0;
Effect._BaseCache = {};
/**
 * Store of each shader (The can be looked up using effect.key)
 */
Effect.ShadersStore = _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.ShadersStore;
/**
 * Store of each included file for a shader (The can be looked up using effect.key)
 */
Effect.IncludesShadersStore = _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_2__/* .ShaderStore */ .l.IncludesShadersStore;
//# sourceMappingURL=effect.js.map

/***/ }),

/***/ 82565:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   J: () => (/* binding */ EffectFallbacks)
/* harmony export */ });
/**
 * EffectFallbacks can be used to add fallbacks (properties to disable) to certain properties when desired to improve performance.
 * (Eg. Start at high quality with reflection and fog, if fps is low, remove reflection, if still low remove fog)
 */
class EffectFallbacks {
    constructor() {
        this._defines = {};
        this._currentRank = 32;
        this._maxRank = -1;
        this._mesh = null;
    }
    /**
     * Removes the fallback from the bound mesh.
     */
    unBindMesh() {
        this._mesh = null;
    }
    /**
     * Adds a fallback on the specified property.
     * @param rank The rank of the fallback (Lower ranks will be fallbacked to first)
     * @param define The name of the define in the shader
     */
    addFallback(rank, define) {
        if (!this._defines[rank]) {
            if (rank < this._currentRank) {
                this._currentRank = rank;
            }
            if (rank > this._maxRank) {
                this._maxRank = rank;
            }
            this._defines[rank] = new Array();
        }
        this._defines[rank].push(define);
    }
    /**
     * Sets the mesh to use CPU skinning when needing to fallback.
     * @param rank The rank of the fallback (Lower ranks will be fallbacked to first)
     * @param mesh The mesh to use the fallbacks.
     */
    addCPUSkinningFallback(rank, mesh) {
        this._mesh = mesh;
        if (rank < this._currentRank) {
            this._currentRank = rank;
        }
        if (rank > this._maxRank) {
            this._maxRank = rank;
        }
    }
    /**
     * Checks to see if more fallbacks are still available.
     */
    get hasMoreFallbacks() {
        return this._currentRank <= this._maxRank;
    }
    /**
     * Removes the defines that should be removed when falling back.
     * @param currentDefines defines the current define statements for the shader.
     * @param effect defines the current effect we try to compile
     * @returns The resulting defines with defines of the current rank removed.
     */
    reduce(currentDefines, effect) {
        // First we try to switch to CPU skinning
        if (this._mesh && this._mesh.computeBonesUsingShaders && this._mesh.numBoneInfluencers > 0) {
            this._mesh.computeBonesUsingShaders = false;
            currentDefines = currentDefines.replace("#define NUM_BONE_INFLUENCERS " + this._mesh.numBoneInfluencers, "#define NUM_BONE_INFLUENCERS 0");
            effect._bonesComputationForcedToCPU = true;
            const scene = this._mesh.getScene();
            for (let index = 0; index < scene.meshes.length; index++) {
                const otherMesh = scene.meshes[index];
                if (!otherMesh.material) {
                    if (!this._mesh.material && otherMesh.computeBonesUsingShaders && otherMesh.numBoneInfluencers > 0) {
                        otherMesh.computeBonesUsingShaders = false;
                    }
                    continue;
                }
                if (!otherMesh.computeBonesUsingShaders || otherMesh.numBoneInfluencers === 0) {
                    continue;
                }
                if (otherMesh.material.getEffect() === effect) {
                    otherMesh.computeBonesUsingShaders = false;
                }
                else if (otherMesh.subMeshes) {
                    for (const subMesh of otherMesh.subMeshes) {
                        const subMeshEffect = subMesh.effect;
                        if (subMeshEffect === effect) {
                            otherMesh.computeBonesUsingShaders = false;
                            break;
                        }
                    }
                }
            }
        }
        else {
            const currentFallbacks = this._defines[this._currentRank];
            if (currentFallbacks) {
                for (let index = 0; index < currentFallbacks.length; index++) {
                    currentDefines = currentDefines.replace("#define " + currentFallbacks[index], "");
                }
            }
            this._currentRank++;
        }
        return currentDefines;
    }
}
//# sourceMappingURL=effectFallbacks.js.map

/***/ }),

/***/ 84255:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $: () => (/* binding */ EffectWrapper),
/* harmony export */   J: () => (/* binding */ EffectRenderer)
/* harmony export */ });
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95616);
/* harmony import */ var _Maths_math_viewport_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54494);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99848);
/* harmony import */ var _effect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74420);
/* harmony import */ var _drawWrapper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35476);
/* harmony import */ var _Shaders_postprocess_vertex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16612);






// Prevents ES6 issue if not imported.

// Fullscreen quad buffers by default.
const defaultOptions = {
    positions: [1, 1, -1, 1, -1, -1, 1, -1],
    indices: [0, 1, 2, 0, 2, 3],
};
/**
 * Helper class to render one or more effects.
 * You can access the previous rendering in your shader by declaring a sampler named textureSampler
 */
class EffectRenderer {
    /**
     * Creates an effect renderer
     * @param engine the engine to use for rendering
     * @param options defines the options of the effect renderer
     */
    constructor(engine, options = defaultOptions) {
        this._fullscreenViewport = new _Maths_math_viewport_js__WEBPACK_IMPORTED_MODULE_1__/* .Viewport */ .L(0, 0, 1, 1);
        const positions = options.positions ?? defaultOptions.positions;
        const indices = options.indices ?? defaultOptions.indices;
        this.engine = engine;
        this._vertexBuffers = {
            [_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind]: new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R(engine, positions, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind, false, false, 2),
        };
        this._indexBuffer = engine.createIndexBuffer(indices);
        this._onContextRestoredObserver = engine.onContextRestoredObservable.add(() => {
            this._indexBuffer = engine.createIndexBuffer(indices);
            for (const key in this._vertexBuffers) {
                const vertexBuffer = this._vertexBuffers[key];
                vertexBuffer._rebuild();
            }
        });
    }
    /**
     * Sets the current viewport in normalized coordinates 0-1
     * @param viewport Defines the viewport to set (defaults to 0 0 1 1)
     */
    setViewport(viewport = this._fullscreenViewport) {
        this.engine.setViewport(viewport);
    }
    /**
     * Binds the embedded attributes buffer to the effect.
     * @param effect Defines the effect to bind the attributes for
     */
    bindBuffers(effect) {
        this.engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect);
    }
    /**
     * Sets the current effect wrapper to use during draw.
     * The effect needs to be ready before calling this api.
     * This also sets the default full screen position attribute.
     * @param effectWrapper Defines the effect to draw with
     */
    applyEffectWrapper(effectWrapper) {
        this.engine.setState(true);
        this.engine.depthCullingState.depthTest = false;
        this.engine.stencilState.stencilTest = false;
        this.engine.enableEffect(effectWrapper.drawWrapper);
        this.bindBuffers(effectWrapper.effect);
        effectWrapper.onApplyObservable.notifyObservers({});
    }
    /**
     * Saves engine states
     */
    saveStates() {
        this._savedStateDepthTest = this.engine.depthCullingState.depthTest;
        this._savedStateStencilTest = this.engine.stencilState.stencilTest;
    }
    /**
     * Restores engine states
     */
    restoreStates() {
        this.engine.depthCullingState.depthTest = this._savedStateDepthTest;
        this.engine.stencilState.stencilTest = this._savedStateStencilTest;
    }
    /**
     * Draws a full screen quad.
     */
    draw() {
        this.engine.drawElementsType(0, 0, 6);
    }
    _isRenderTargetTexture(texture) {
        return texture.renderTarget !== undefined;
    }
    /**
     * renders one or more effects to a specified texture
     * @param effectWrapper the effect to renderer
     * @param outputTexture texture to draw to, if null it will render to the currently bound frame buffer
     */
    render(effectWrapper, outputTexture = null) {
        // Ensure effect is ready
        if (!effectWrapper.effect.isReady()) {
            return;
        }
        this.saveStates();
        // Reset state
        this.setViewport();
        const out = outputTexture === null ? null : this._isRenderTargetTexture(outputTexture) ? outputTexture.renderTarget : outputTexture;
        if (out) {
            this.engine.bindFramebuffer(out);
        }
        this.applyEffectWrapper(effectWrapper);
        this.draw();
        if (out) {
            this.engine.unBindFramebuffer(out);
        }
        this.restoreStates();
    }
    /**
     * Disposes of the effect renderer
     */
    dispose() {
        const vertexBuffer = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind];
        if (vertexBuffer) {
            vertexBuffer.dispose();
            delete this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind];
        }
        if (this._indexBuffer) {
            this.engine._releaseBuffer(this._indexBuffer);
        }
        if (this._onContextRestoredObserver) {
            this.engine.onContextRestoredObservable.remove(this._onContextRestoredObserver);
            this._onContextRestoredObserver = null;
        }
    }
}
/**
 * Wraps an effect to be used for rendering
 */
class EffectWrapper {
    /**
     * Registers a shader code processing with an effect wrapper name.
     * @param effectWrapperName name of the effect wrapper. Use null for the fallback shader code processing. This is the shader code processing that will be used in case no specific shader code processing has been associated to an effect wrapper name
     * @param customShaderCodeProcessing shader code processing to associate to the effect wrapper name
     */
    static RegisterShaderCodeProcessing(effectWrapperName, customShaderCodeProcessing) {
        if (!customShaderCodeProcessing) {
            delete EffectWrapper._CustomShaderCodeProcessing[effectWrapperName ?? ""];
            return;
        }
        EffectWrapper._CustomShaderCodeProcessing[effectWrapperName ?? ""] = customShaderCodeProcessing;
    }
    static _GetShaderCodeProcessing(effectWrapperName) {
        return EffectWrapper._CustomShaderCodeProcessing[effectWrapperName] ?? EffectWrapper._CustomShaderCodeProcessing[""];
    }
    /**
     * Gets or sets the name of the effect wrapper
     */
    get name() {
        return this.options.name;
    }
    set name(value) {
        this.options.name = value;
    }
    /**
     * Get a value indicating if the effect is ready to be used
     * @returns true if the post-process is ready (shader is compiled)
     */
    isReady() {
        return this._drawWrapper.effect?.isReady() ?? false;
    }
    /**
     * Get the draw wrapper associated with the effect wrapper
     * @returns the draw wrapper associated with the effect wrapper
     */
    get drawWrapper() {
        return this._drawWrapper;
    }
    /**
     * The underlying effect
     */
    get effect() {
        return this._drawWrapper.effect;
    }
    set effect(effect) {
        this._drawWrapper.effect = effect;
    }
    /**
     * Creates an effect to be rendered
     * @param creationOptions options to create the effect
     */
    constructor(creationOptions) {
        /**
         * Type of alpha mode to use when applying the effect (default: Engine.ALPHA_DISABLE). Used only if useAsPostProcess is true.
         */
        this.alphaMode = 0;
        /**
         * Executed when the effect is created
         * @returns effect that was created for this effect wrapper
         */
        this.onEffectCreatedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP(undefined, true);
        /**
         * Event that is fired (only when the EffectWrapper is used with an EffectRenderer) right before the effect is drawn (should be used to update uniforms)
         */
        this.onApplyObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        this._shadersLoaded = false;
        /** @internal */
        this._webGPUReady = false;
        this._importPromises = [];
        this.options = {
            ...creationOptions,
            name: creationOptions.name || "effectWrapper",
            engine: creationOptions.engine,
            uniforms: creationOptions.uniforms || creationOptions.uniformNames || [],
            uniformNames: undefined,
            samplers: creationOptions.samplers || creationOptions.samplerNames || [],
            samplerNames: undefined,
            attributeNames: creationOptions.attributeNames || ["position"],
            uniformBuffers: creationOptions.uniformBuffers || [],
            defines: creationOptions.defines || "",
            useShaderStore: creationOptions.useShaderStore || false,
            vertexUrl: creationOptions.vertexUrl || creationOptions.vertexShader || "postprocess",
            vertexShader: undefined,
            fragmentShader: creationOptions.fragmentShader || "pass",
            indexParameters: creationOptions.indexParameters,
            blockCompilation: creationOptions.blockCompilation || false,
            shaderLanguage: creationOptions.shaderLanguage || 0 /* ShaderLanguage.GLSL */,
            onCompiled: creationOptions.onCompiled || undefined,
            extraInitializations: creationOptions.extraInitializations || undefined,
            extraInitializationsAsync: creationOptions.extraInitializationsAsync || undefined,
            useAsPostProcess: creationOptions.useAsPostProcess ?? false,
        };
        this.options.uniformNames = this.options.uniforms;
        this.options.samplerNames = this.options.samplers;
        this.options.vertexShader = this.options.vertexUrl;
        if (this.options.useAsPostProcess) {
            if (this.options.samplers.indexOf("textureSampler") === -1) {
                this.options.samplers.push("textureSampler");
            }
            if (this.options.uniforms.indexOf("scale") === -1) {
                this.options.uniforms.push("scale");
            }
        }
        if (creationOptions.vertexUrl || creationOptions.vertexShader) {
            this._shaderPath = {
                vertexSource: this.options.vertexShader,
            };
        }
        else {
            if (!this.options.useAsPostProcess) {
                this.options.uniforms.push("scale");
                this.onApplyObservable.add(() => {
                    this.effect.setFloat2("scale", 1, 1);
                });
            }
            this._shaderPath = {
                vertex: this.options.vertexShader,
            };
        }
        this._shaderPath.fragmentSource = this.options.fragmentShader;
        this._shaderPath.spectorName = this.options.name;
        if (this.options.useShaderStore) {
            this._shaderPath.fragment = this._shaderPath.fragmentSource;
            if (!this._shaderPath.vertex) {
                this._shaderPath.vertex = this._shaderPath.vertexSource;
            }
            delete this._shaderPath.fragmentSource;
            delete this._shaderPath.vertexSource;
        }
        this.onApplyObservable.add(() => {
            this.bind();
        });
        if (!this.options.useShaderStore) {
            this._onContextRestoredObserver = this.options.engine.onContextRestoredObservable.add(() => {
                this.effect._pipelineContext = null; // because _prepareEffect will try to dispose this pipeline before recreating it and that would lead to webgl errors
                this.effect._prepareEffect();
            });
        }
        this._drawWrapper = new _drawWrapper_js__WEBPACK_IMPORTED_MODULE_4__/* .DrawWrapper */ .E(this.options.engine);
        this._webGPUReady = this.options.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        const defines = Array.isArray(this.options.defines) ? this.options.defines.join("\n") : this.options.defines;
        this._postConstructor(this.options.blockCompilation, defines, this.options.extraInitializations);
    }
    _gatherImports(useWebGPU = false, list) {
        if (!this.options.useAsPostProcess) {
            return;
        }
        // this._webGPUReady is used to detect when an effect wrapper is intended to be used with WebGPU
        if (useWebGPU && this._webGPUReady) {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 32083))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 16612))]));
        }
    }
    /** @internal */
    _postConstructor(blockCompilation, defines = null, extraInitializations, importPromises) {
        this._importPromises.length = 0;
        if (importPromises) {
            this._importPromises.push(...importPromises);
        }
        const useWebGPU = this.options.engine.isWebGPU && !EffectWrapper.ForceGLSL;
        this._gatherImports(useWebGPU, this._importPromises);
        if (extraInitializations !== undefined) {
            extraInitializations(useWebGPU, this._importPromises);
        }
        if (useWebGPU && this._webGPUReady) {
            this.options.shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
        if (!blockCompilation) {
            this.updateEffect(defines);
        }
    }
    /**
     * Updates the effect with the current effect wrapper compile time values and recompiles the shader.
     * @param defines Define statements that should be added at the beginning of the shader. (default: null)
     * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)
     * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)
     * @param indexParameters The index parameters to be used for babylons include syntax "#include<kernelBlurVaryingDeclaration>[0..varyingCount]". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx
     * @param onCompiled Called when the shader has been compiled.
     * @param onError Called if there is an error when compiling a shader.
     * @param vertexUrl The url of the vertex shader to be used (default: the one given at construction time)
     * @param fragmentUrl The url of the fragment shader to be used (default: the one given at construction time)
     */
    updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl) {
        const customShaderCodeProcessing = EffectWrapper._GetShaderCodeProcessing(this.name);
        if (customShaderCodeProcessing?.defineCustomBindings) {
            const newUniforms = uniforms?.slice() ?? [];
            newUniforms.push(...this.options.uniforms);
            const newSamplers = samplers?.slice() ?? [];
            newSamplers.push(...this.options.samplers);
            defines = customShaderCodeProcessing.defineCustomBindings(this.name, defines, newUniforms, newSamplers);
            uniforms = newUniforms;
            samplers = newSamplers;
        }
        this.options.defines = defines || "";
        const waitImportsLoaded = this._shadersLoaded || this._importPromises.length === 0
            ? undefined
            : async () => {
                await Promise.all(this._importPromises);
                this._shadersLoaded = true;
            };
        let extraInitializationsAsync;
        if (this.options.extraInitializationsAsync) {
            extraInitializationsAsync = async () => {
                waitImportsLoaded?.();
                await this.options.extraInitializationsAsync;
            };
        }
        else {
            extraInitializationsAsync = waitImportsLoaded;
        }
        if (this.options.useShaderStore) {
            this._drawWrapper.effect = this.options.engine.createEffect({ vertex: vertexUrl ?? this._shaderPath.vertex, fragment: fragmentUrl ?? this._shaderPath.fragment }, {
                attributes: this.options.attributeNames,
                uniformsNames: uniforms || this.options.uniforms,
                uniformBuffersNames: this.options.uniformBuffers,
                samplers: samplers || this.options.samplers,
                defines: defines !== null ? defines : "",
                fallbacks: null,
                onCompiled: onCompiled ?? this.options.onCompiled,
                onError: onError ?? null,
                indexParameters: indexParameters || this.options.indexParameters,
                processCodeAfterIncludes: customShaderCodeProcessing?.processCodeAfterIncludes
                    ? (shaderType, code) => customShaderCodeProcessing.processCodeAfterIncludes(this.name, shaderType, code)
                    : null,
                processFinalCode: customShaderCodeProcessing?.processFinalCode
                    ? (shaderType, code) => customShaderCodeProcessing.processFinalCode(this.name, shaderType, code)
                    : null,
                shaderLanguage: this.options.shaderLanguage,
                extraInitializationsAsync,
            }, this.options.engine);
        }
        else {
            this._drawWrapper.effect = new _effect_js__WEBPACK_IMPORTED_MODULE_3__/* .Effect */ .M(this._shaderPath, this.options.attributeNames, uniforms || this.options.uniforms, samplers || this.options.samplerNames, this.options.engine, defines, undefined, onCompiled || this.options.onCompiled, undefined, undefined, undefined, this.options.shaderLanguage, extraInitializationsAsync);
        }
        this.onEffectCreatedObservable.notifyObservers(this._drawWrapper.effect);
    }
    /**
     * Binds the data to the effect.
     */
    bind() {
        if (this.options.useAsPostProcess) {
            this.options.engine.setAlphaMode(this.alphaMode);
            this.drawWrapper.effect.setFloat2("scale", 1, 1);
        }
        EffectWrapper._GetShaderCodeProcessing(this.name)?.bindCustomBindings?.(this.name, this._drawWrapper.effect);
    }
    /**
     * Disposes of the effect wrapper
     * @param _ignored kept for backward compatibility
     */
    dispose(_ignored = false) {
        if (this._onContextRestoredObserver) {
            this.effect.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver);
            this._onContextRestoredObserver = null;
        }
        this.onEffectCreatedObservable.clear();
        this.effect.dispose();
    }
}
/**
 * Force code to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
EffectWrapper.ForceGLSL = false;
EffectWrapper._CustomShaderCodeProcessing = {};
//# sourceMappingURL=effectRenderer.js.map

/***/ }),

/***/ 80010:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   C: () => (/* binding */ PrepareSamplersForImageProcessing),
/* harmony export */   _: () => (/* binding */ PrepareUniformsForImageProcessing)
/* harmony export */ });
/* harmony import */ var _colorCurves_functions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16629);

/**
 * Prepare the list of uniforms associated with the Image Processing effects.
 * @param uniforms The list of uniforms used in the effect
 * @param defines the list of defines currently in use
 */
function PrepareUniformsForImageProcessing(uniforms, defines) {
    if (defines.EXPOSURE) {
        uniforms.push("exposureLinear");
    }
    if (defines.CONTRAST) {
        uniforms.push("contrast");
    }
    if (defines.COLORGRADING) {
        uniforms.push("colorTransformSettings");
    }
    if (defines.VIGNETTE || defines.DITHER) {
        uniforms.push("vInverseScreenSize");
    }
    if (defines.VIGNETTE) {
        uniforms.push("vignetteSettings1");
        uniforms.push("vignetteSettings2");
    }
    if (defines.COLORCURVES) {
        (0,_colorCurves_functions_js__WEBPACK_IMPORTED_MODULE_0__/* .PrepareUniformsForColorCurves */ .B)(uniforms);
    }
    if (defines.DITHER) {
        uniforms.push("ditherIntensity");
    }
}
/**
 * Prepare the list of samplers associated with the Image Processing effects.
 * @param samplersList The list of uniforms used in the effect
 * @param defines the list of defines currently in use
 */
function PrepareSamplersForImageProcessing(samplersList, defines) {
    if (defines.COLORGRADING) {
        samplersList.push("txColorTransform");
    }
}
//# sourceMappingURL=imageProcessingConfiguration.functions.js.map

/***/ }),

/***/ 32033:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   p: () => (/* binding */ ImageProcessingConfiguration)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26041);
/* harmony import */ var _Materials_colorCurves_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35198);
/* harmony import */ var _Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91597);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26877);
/* harmony import */ var _imageProcessingConfiguration_functions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80010);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56552);

/* eslint-disable @typescript-eslint/naming-convention */








/**
 * This groups together the common properties used for image processing either in direct forward pass
 * or through post processing effect depending on the use of the image processing pipeline in your scene
 * or not.
 */
class ImageProcessingConfiguration {
    constructor() {
        /**
         * Color curves setup used in the effect if colorCurvesEnabled is set to true
         */
        this.colorCurves = new _Materials_colorCurves_js__WEBPACK_IMPORTED_MODULE_4__/* .ColorCurves */ .Q();
        this._colorCurvesEnabled = false;
        this._colorGradingEnabled = false;
        this._colorGradingWithGreenDepth = true;
        this._colorGradingBGR = true;
        /** @internal */
        this._exposure = 1.0;
        this._toneMappingEnabled = false;
        this._toneMappingType = ImageProcessingConfiguration.TONEMAPPING_STANDARD;
        this._contrast = 1.0;
        /**
         * Vignette stretch size.
         */
        this.vignetteStretch = 0;
        /**
         * Vignette center X Offset.
         */
        this.vignetteCenterX = 0;
        /**
         * Vignette center Y Offset.
         */
        this.vignetteCenterY = 0;
        /**
         * Vignette weight or intensity of the vignette effect.
         */
        this.vignetteWeight = 1.5;
        /**
         * Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)
         * if vignetteEnabled is set to true.
         */
        this.vignetteColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_3__/* .Color4 */ .ov(0, 0, 0, 0);
        /**
         * Camera field of view used by the Vignette effect.
         */
        this.vignetteCameraFov = 0.5;
        this._vignetteBlendMode = ImageProcessingConfiguration.VIGNETTEMODE_MULTIPLY;
        this._vignetteEnabled = false;
        this._ditheringEnabled = false;
        this._ditheringIntensity = 1.0 / 255.0;
        /** @internal */
        this._skipFinalColorClamp = false;
        /** @internal */
        this._applyByPostProcess = false;
        this._isEnabled = true;
        /**
         * An event triggered when the configuration changes and requires Shader to Update some parameters.
         */
        this.onUpdateParameters = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
    }
    /**
     * Gets whether the color curves effect is enabled.
     */
    get colorCurvesEnabled() {
        return this._colorCurvesEnabled;
    }
    /**
     * Sets whether the color curves effect is enabled.
     */
    set colorCurvesEnabled(value) {
        if (this._colorCurvesEnabled === value) {
            return;
        }
        this._colorCurvesEnabled = value;
        this._updateParameters();
    }
    /**
     * Color grading LUT texture used in the effect if colorGradingEnabled is set to true
     */
    get colorGradingTexture() {
        return this._colorGradingTexture;
    }
    /**
     * Color grading LUT texture used in the effect if colorGradingEnabled is set to true
     */
    set colorGradingTexture(value) {
        if (this._colorGradingTexture === value) {
            return;
        }
        this._colorGradingTexture = value;
        this._updateParameters();
    }
    /**
     * Gets whether the color grading effect is enabled.
     */
    get colorGradingEnabled() {
        return this._colorGradingEnabled;
    }
    /**
     * Sets whether the color grading effect is enabled.
     */
    set colorGradingEnabled(value) {
        if (this._colorGradingEnabled === value) {
            return;
        }
        this._colorGradingEnabled = value;
        this._updateParameters();
    }
    /**
     * Gets whether the color grading effect is using a green depth for the 3d Texture.
     */
    get colorGradingWithGreenDepth() {
        return this._colorGradingWithGreenDepth;
    }
    /**
     * Sets whether the color grading effect is using a green depth for the 3d Texture.
     */
    set colorGradingWithGreenDepth(value) {
        if (this._colorGradingWithGreenDepth === value) {
            return;
        }
        this._colorGradingWithGreenDepth = value;
        this._updateParameters();
    }
    /**
     * Gets whether the color grading texture contains BGR values.
     */
    get colorGradingBGR() {
        return this._colorGradingBGR;
    }
    /**
     * Sets whether the color grading texture contains BGR values.
     */
    set colorGradingBGR(value) {
        if (this._colorGradingBGR === value) {
            return;
        }
        this._colorGradingBGR = value;
        this._updateParameters();
    }
    /**
     * Gets the Exposure used in the effect.
     */
    get exposure() {
        return this._exposure;
    }
    /**
     * Sets the Exposure used in the effect.
     */
    set exposure(value) {
        if (this._exposure === value) {
            return;
        }
        this._exposure = value;
        this._updateParameters();
    }
    /**
     * Gets whether the tone mapping effect is enabled.
     */
    get toneMappingEnabled() {
        return this._toneMappingEnabled;
    }
    /**
     * Sets whether the tone mapping effect is enabled.
     */
    set toneMappingEnabled(value) {
        if (this._toneMappingEnabled === value) {
            return;
        }
        this._toneMappingEnabled = value;
        this._updateParameters();
    }
    /**
     * Gets the type of tone mapping effect.
     */
    get toneMappingType() {
        return this._toneMappingType;
    }
    /**
     * Sets the type of tone mapping effect used in BabylonJS.
     */
    set toneMappingType(value) {
        if (this._toneMappingType === value) {
            return;
        }
        this._toneMappingType = value;
        this._updateParameters();
    }
    /**
     * Gets the contrast used in the effect.
     */
    get contrast() {
        return this._contrast;
    }
    /**
     * Sets the contrast used in the effect.
     */
    set contrast(value) {
        if (this._contrast === value) {
            return;
        }
        this._contrast = value;
        this._updateParameters();
    }
    /**
     * Back Compat: Vignette center Y Offset.
     * @deprecated use vignetteCenterY instead
     */
    get vignetteCentreY() {
        return this.vignetteCenterY;
    }
    set vignetteCentreY(value) {
        this.vignetteCenterY = value;
    }
    /**
     * Back Compat: Vignette center X Offset.
     * @deprecated use vignetteCenterX instead
     */
    get vignetteCentreX() {
        return this.vignetteCenterX;
    }
    set vignetteCentreX(value) {
        this.vignetteCenterX = value;
    }
    /**
     * Gets the vignette blend mode allowing different kind of effect.
     */
    get vignetteBlendMode() {
        return this._vignetteBlendMode;
    }
    /**
     * Sets the vignette blend mode allowing different kind of effect.
     */
    set vignetteBlendMode(value) {
        if (this._vignetteBlendMode === value) {
            return;
        }
        this._vignetteBlendMode = value;
        this._updateParameters();
    }
    /**
     * Gets whether the vignette effect is enabled.
     */
    get vignetteEnabled() {
        return this._vignetteEnabled;
    }
    /**
     * Sets whether the vignette effect is enabled.
     */
    set vignetteEnabled(value) {
        if (this._vignetteEnabled === value) {
            return;
        }
        this._vignetteEnabled = value;
        this._updateParameters();
    }
    /**
     * Gets whether the dithering effect is enabled.
     * The dithering effect can be used to reduce banding.
     */
    get ditheringEnabled() {
        return this._ditheringEnabled;
    }
    /**
     * Sets whether the dithering effect is enabled.
     * The dithering effect can be used to reduce banding.
     */
    set ditheringEnabled(value) {
        if (this._ditheringEnabled === value) {
            return;
        }
        this._ditheringEnabled = value;
        this._updateParameters();
    }
    /**
     * Gets the dithering intensity. 0 is no dithering. Default is 1.0 / 255.0.
     */
    get ditheringIntensity() {
        return this._ditheringIntensity;
    }
    /**
     * Sets the dithering intensity. 0 is no dithering. Default is 1.0 / 255.0.
     */
    set ditheringIntensity(value) {
        if (this._ditheringIntensity === value) {
            return;
        }
        this._ditheringIntensity = value;
        this._updateParameters();
    }
    /**
     * If apply by post process is set to true, setting this to true will skip the final color clamp step in the fragment shader
     * Applies to PBR materials.
     */
    get skipFinalColorClamp() {
        return this._skipFinalColorClamp;
    }
    /**
     * If apply by post process is set to true, setting this to true will skip the final color clamp step in the fragment shader
     * Applies to PBR materials.
     */
    set skipFinalColorClamp(value) {
        if (this._skipFinalColorClamp === value) {
            return;
        }
        this._skipFinalColorClamp = value;
        this._updateParameters();
    }
    /**
     * Gets whether the image processing is applied through a post process or not.
     */
    get applyByPostProcess() {
        return this._applyByPostProcess;
    }
    /**
     * Sets whether the image processing is applied through a post process or not.
     */
    set applyByPostProcess(value) {
        if (this._applyByPostProcess === value) {
            return;
        }
        this._applyByPostProcess = value;
        this._updateParameters();
    }
    /**
     * Gets whether the image processing is enabled or not.
     */
    get isEnabled() {
        return this._isEnabled;
    }
    /**
     * Sets whether the image processing is enabled or not.
     */
    set isEnabled(value) {
        if (this._isEnabled === value) {
            return;
        }
        this._isEnabled = value;
        this._updateParameters();
    }
    /**
     * Method called each time the image processing information changes requires to recompile the effect.
     */
    _updateParameters() {
        this.onUpdateParameters.notifyObservers(this);
    }
    /**
     * Gets the current class name.
     * @returns "ImageProcessingConfiguration"
     */
    getClassName() {
        return "ImageProcessingConfiguration";
    }
    /**
     * Prepare the list of defines associated to the shader.
     * @param defines the list of defines to complete
     * @param forPostProcess Define if we are currently in post process mode or not
     */
    prepareDefines(defines, forPostProcess = false) {
        if (forPostProcess !== this.applyByPostProcess || !this._isEnabled) {
            defines.VIGNETTE = false;
            defines.TONEMAPPING = 0;
            defines.CONTRAST = false;
            defines.EXPOSURE = false;
            defines.COLORCURVES = false;
            defines.COLORGRADING = false;
            defines.COLORGRADING3D = false;
            defines.DITHER = false;
            defines.IMAGEPROCESSING = false;
            defines.SKIPFINALCOLORCLAMP = this.skipFinalColorClamp;
            defines.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess && this._isEnabled;
            return;
        }
        defines.VIGNETTE = this.vignetteEnabled;
        defines.VIGNETTEBLENDMODEMULTIPLY = this.vignetteBlendMode === ImageProcessingConfiguration._VIGNETTEMODE_MULTIPLY;
        defines.VIGNETTEBLENDMODEOPAQUE = !defines.VIGNETTEBLENDMODEMULTIPLY;
        if (!this._toneMappingEnabled) {
            defines.TONEMAPPING = 0;
        }
        else {
            switch (this._toneMappingType) {
                case ImageProcessingConfiguration.TONEMAPPING_KHR_PBR_NEUTRAL:
                    defines.TONEMAPPING = 3;
                    break;
                case ImageProcessingConfiguration.TONEMAPPING_ACES:
                    defines.TONEMAPPING = 2;
                    break;
                default:
                    defines.TONEMAPPING = 1;
                    break;
            }
        }
        defines.CONTRAST = this.contrast !== 1.0;
        defines.EXPOSURE = this.exposure !== 1.0;
        defines.COLORCURVES = this.colorCurvesEnabled && !!this.colorCurves;
        defines.COLORGRADING = this.colorGradingEnabled && !!this.colorGradingTexture;
        if (defines.COLORGRADING) {
            defines.COLORGRADING3D = this.colorGradingTexture.is3D;
        }
        else {
            defines.COLORGRADING3D = false;
        }
        defines.SAMPLER3DGREENDEPTH = this.colorGradingWithGreenDepth;
        defines.SAMPLER3DBGRMAP = this.colorGradingBGR;
        defines.DITHER = this._ditheringEnabled;
        defines.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess;
        defines.SKIPFINALCOLORCLAMP = this.skipFinalColorClamp;
        defines.IMAGEPROCESSING =
            defines.VIGNETTE || !!defines.TONEMAPPING || defines.CONTRAST || defines.EXPOSURE || defines.COLORCURVES || defines.COLORGRADING || defines.DITHER;
    }
    /**
     * Returns true if all the image processing information are ready.
     * @returns True if ready, otherwise, false
     */
    isReady() {
        // Color Grading texture can not be none blocking.
        return !this.colorGradingEnabled || !this.colorGradingTexture || this.colorGradingTexture.isReady();
    }
    /**
     * Binds the image processing to the shader.
     * @param effect The effect to bind to
     * @param overrideAspectRatio Override the aspect ratio of the effect
     */
    bind(effect, overrideAspectRatio) {
        // Color Curves
        if (this._colorCurvesEnabled && this.colorCurves) {
            _Materials_colorCurves_js__WEBPACK_IMPORTED_MODULE_4__/* .ColorCurves */ .Q.Bind(this.colorCurves, effect);
        }
        // Vignette and dither handled together due to common uniform.
        if (this._vignetteEnabled || this._ditheringEnabled) {
            const inverseWidth = 1 / effect.getEngine().getRenderWidth();
            const inverseHeight = 1 / effect.getEngine().getRenderHeight();
            effect.setFloat2("vInverseScreenSize", inverseWidth, inverseHeight);
            if (this._ditheringEnabled) {
                effect.setFloat("ditherIntensity", 0.5 * this._ditheringIntensity);
            }
            if (this._vignetteEnabled) {
                const aspectRatio = overrideAspectRatio != null ? overrideAspectRatio : inverseHeight / inverseWidth;
                let vignetteScaleY = Math.tan(this.vignetteCameraFov * 0.5);
                let vignetteScaleX = vignetteScaleY * aspectRatio;
                const vignetteScaleGeometricMean = Math.sqrt(vignetteScaleX * vignetteScaleY);
                vignetteScaleX = (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_5__/* .Mix */ .zF)(vignetteScaleX, vignetteScaleGeometricMean, this.vignetteStretch);
                vignetteScaleY = (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_5__/* .Mix */ .zF)(vignetteScaleY, vignetteScaleGeometricMean, this.vignetteStretch);
                effect.setFloat4("vignetteSettings1", vignetteScaleX, vignetteScaleY, -vignetteScaleX * this.vignetteCenterX, -vignetteScaleY * this.vignetteCenterY);
                const vignettePower = -2.0 * this.vignetteWeight;
                effect.setFloat4("vignetteSettings2", this.vignetteColor.r, this.vignetteColor.g, this.vignetteColor.b, vignettePower);
            }
        }
        // Exposure
        effect.setFloat("exposureLinear", this.exposure);
        // Contrast
        effect.setFloat("contrast", this.contrast);
        // Color transform settings
        if (this.colorGradingTexture) {
            effect.setTexture("txColorTransform", this.colorGradingTexture);
            const textureSize = this.colorGradingTexture.getSize().height;
            effect.setFloat4("colorTransformSettings", (textureSize - 1) / textureSize, // textureScale
            0.5 / textureSize, // textureOffset
            textureSize, // textureSize
            this.colorGradingTexture.level // weight
            );
        }
    }
    /**
     * Clones the current image processing instance.
     * @returns The cloned image processing
     */
    clone() {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__/* .SerializationHelper */ .p.Clone(() => new ImageProcessingConfiguration(), this);
    }
    /**
     * Serializes the current image processing instance to a json representation.
     * @returns a JSON representation
     */
    serialize() {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__/* .SerializationHelper */ .p.Serialize(this);
    }
    /**
     * Parses the image processing from a json representation.
     * @param source the JSON source to parse
     * @returns The parsed image processing
     */
    static Parse(source) {
        const parsed = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__/* .SerializationHelper */ .p.Parse(() => new ImageProcessingConfiguration(), source, null, null);
        // Backward compatibility
        if (source.vignetteCentreX !== undefined) {
            parsed.vignetteCenterX = source.vignetteCentreX;
        }
        if (source.vignetteCentreY !== undefined) {
            parsed.vignetteCenterY = source.vignetteCentreY;
        }
        return parsed;
    }
    /**
     * Used to apply the vignette as a mix with the pixel color.
     */
    static get VIGNETTEMODE_MULTIPLY() {
        return this._VIGNETTEMODE_MULTIPLY;
    }
    /**
     * Used to apply the vignette as a replacement of the pixel color.
     */
    static get VIGNETTEMODE_OPAQUE() {
        return this._VIGNETTEMODE_OPAQUE;
    }
}
/**
 * Default tone mapping applied in BabylonJS.
 */
ImageProcessingConfiguration.TONEMAPPING_STANDARD = 0;
/**
 * ACES Tone mapping (used by default in unreal and unity). This can help getting closer
 * to other engines rendering to increase portability.
 */
ImageProcessingConfiguration.TONEMAPPING_ACES = 1;
/**
 * Neutral Tone mapping developped by the Khronos group in order to constrain
 * values between 0 and 1 without shifting Hue.
 */
ImageProcessingConfiguration.TONEMAPPING_KHR_PBR_NEUTRAL = 2;
/**
 * Prepare the list of uniforms associated with the Image Processing effects.
 * @param uniforms The list of uniforms used in the effect
 * @param defines the list of defines currently in use
 */
ImageProcessingConfiguration.PrepareUniforms = _imageProcessingConfiguration_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .PrepareUniformsForImageProcessing */ ._;
/**
 * Prepare the list of samplers associated with the Image Processing effects.
 * @param samplersList The list of uniforms used in the effect
 * @param defines the list of defines currently in use
 */
ImageProcessingConfiguration.PrepareSamplers = _imageProcessingConfiguration_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .PrepareSamplersForImageProcessing */ .C;
// Static constants associated to the image processing.
ImageProcessingConfiguration._VIGNETTEMODE_MULTIPLY = 0;
ImageProcessingConfiguration._VIGNETTEMODE_OPAQUE = 1;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColorCurves */ .wL)()
], ImageProcessingConfiguration.prototype, "colorCurves", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_colorCurvesEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("colorGradingTexture")
], ImageProcessingConfiguration.prototype, "_colorGradingTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_colorGradingEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_colorGradingWithGreenDepth", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_colorGradingBGR", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_exposure", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_toneMappingEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_toneMappingType", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_contrast", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "vignetteStretch", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "vignetteCenterX", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "vignetteCenterY", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "vignetteWeight", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor4 */ .qK)()
], ImageProcessingConfiguration.prototype, "vignetteColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "vignetteCameraFov", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_vignetteBlendMode", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_vignetteEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_ditheringEnabled", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_ditheringIntensity", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_skipFinalColorClamp", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_applyByPostProcess", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], ImageProcessingConfiguration.prototype, "_isEnabled", void 0);
// References the dependencies.
_Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__/* .SerializationHelper */ .p._ImageProcessingConfigurationParser = ImageProcessingConfiguration.Parse;
// Register Class Name
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__/* .RegisterClass */ .Y5)("BABYLON.ImageProcessingConfiguration", ImageProcessingConfiguration);
//# sourceMappingURL=imageProcessingConfiguration.js.map

/***/ }),

/***/ 97841:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   H: () => (/* binding */ MaterialDetailMapDefines),
/* harmony export */   c: () => (/* binding */ DetailMapConfiguration)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _material_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28986);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79259);
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10633);
/* harmony import */ var _materialDefines_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79526);
/* harmony import */ var _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50074);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80467);








/**
 * @internal
 */
class MaterialDetailMapDefines extends _materialDefines_js__WEBPACK_IMPORTED_MODULE_4__/* .MaterialDefines */ .M {
    constructor() {
        super(...arguments);
        this.DETAIL = false;
        this.DETAILDIRECTUV = 0;
        this.DETAIL_NORMALBLENDMETHOD = 0;
    }
}
/**
 * Plugin that implements the detail map component of a material
 *
 * Inspired from:
 *   Unity: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@9.0/manual/Mask-Map-and-Detail-Map.html and https://docs.unity3d.com/Manual/StandardShaderMaterialParameterDetail.html
 *   Unreal: https://docs.unrealengine.com/en-US/Engine/Rendering/Materials/HowTo/DetailTexturing/index.html
 *   Cryengine: https://docs.cryengine.com/display/SDKDOC2/Detail+Maps
 */
class DetailMapConfiguration extends _materialPluginBase_js__WEBPACK_IMPORTED_MODULE_5__/* .MaterialPluginBase */ .y {
    /** @internal */
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    constructor(material, addToPluginList = true) {
        super(material, "DetailMap", 140, new MaterialDetailMapDefines(), addToPluginList);
        this._texture = null;
        /**
         * Defines how strongly the detail diffuse/albedo channel is blended with the regular diffuse/albedo texture
         * Bigger values mean stronger blending
         */
        this.diffuseBlendLevel = 1;
        /**
         * Defines how strongly the detail roughness channel is blended with the regular roughness value
         * Bigger values mean stronger blending. Only used with PBR materials
         */
        this.roughnessBlendLevel = 1;
        /**
         * Defines how strong the bump effect from the detail map is
         * Bigger values mean stronger effect
         */
        this.bumpLevel = 1;
        this._normalBlendMethod = _material_js__WEBPACK_IMPORTED_MODULE_1__/* .Material */ .i.MATERIAL_NORMALBLENDMETHOD_WHITEOUT;
        this._isEnabled = false;
        /**
         * Enable or disable the detail map on this material
         */
        this.isEnabled = false;
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
    }
    isReadyForSubMesh(defines, scene, engine) {
        if (!this._isEnabled) {
            return true;
        }
        if (defines._areTexturesDirty && scene.texturesEnabled) {
            if (engine.getCaps().standardDerivatives && this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.DetailTextureEnabled) {
                // Detail texture cannot be not blocking.
                if (!this._texture.isReady()) {
                    return false;
                }
            }
        }
        return true;
    }
    prepareDefines(defines, scene) {
        if (this._isEnabled) {
            defines.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod;
            const engine = scene.getEngine();
            if (defines._areTexturesDirty) {
                if (engine.getCaps().standardDerivatives && this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.DetailTextureEnabled && this._isEnabled) {
                    (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .PrepareDefinesForMergedUV */ .YT)(this._texture, defines, "DETAIL");
                    defines.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod;
                }
                else {
                    defines.DETAIL = false;
                }
            }
        }
        else {
            defines.DETAIL = false;
        }
    }
    bindForSubMesh(uniformBuffer, scene) {
        if (!this._isEnabled) {
            return;
        }
        const isFrozen = this._material.isFrozen;
        if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {
            if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.DetailTextureEnabled) {
                uniformBuffer.updateFloat4("vDetailInfos", this._texture.coordinatesIndex, this.diffuseBlendLevel, this.bumpLevel, this.roughnessBlendLevel);
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_6__/* .BindTextureMatrix */ .mA)(this._texture, uniformBuffer, "detail");
            }
        }
        // Textures
        if (scene.texturesEnabled) {
            if (this._texture && _materialFlags_js__WEBPACK_IMPORTED_MODULE_3__/* .MaterialFlags */ .h.DetailTextureEnabled) {
                uniformBuffer.setTexture("detailSampler", this._texture);
            }
        }
    }
    hasTexture(texture) {
        if (this._texture === texture) {
            return true;
        }
        return false;
    }
    getActiveTextures(activeTextures) {
        if (this._texture) {
            activeTextures.push(this._texture);
        }
    }
    getAnimatables(animatables) {
        if (this._texture && this._texture.animations && this._texture.animations.length > 0) {
            animatables.push(this._texture);
        }
    }
    dispose(forceDisposeTextures) {
        if (forceDisposeTextures) {
            this._texture?.dispose();
        }
    }
    getClassName() {
        return "DetailMapConfiguration";
    }
    getSamplers(samplers) {
        samplers.push("detailSampler");
    }
    getUniforms() {
        return {
            ubo: [
                { name: "vDetailInfos", size: 4, type: "vec4" },
                { name: "detailMatrix", size: 16, type: "mat4" },
            ],
        };
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serializeAsTexture */ .uM)("detailTexture"),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], DetailMapConfiguration.prototype, "texture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], DetailMapConfiguration.prototype, "diffuseBlendLevel", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], DetailMapConfiguration.prototype, "roughnessBlendLevel", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], DetailMapConfiguration.prototype, "bumpLevel", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], DetailMapConfiguration.prototype, "normalBlendMethod", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)(),
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], DetailMapConfiguration.prototype, "isEnabled", void 0);
//# sourceMappingURL=material.detailMapConfiguration.js.map

/***/ }),

/***/ 28986:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  i: () => (/* binding */ Material)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/tslib.es6.js
var tslib_es6 = __webpack_require__(75524);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/decorators.js
var decorators = __webpack_require__(79259);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__(998);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__(99848);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engineStore.js
var engineStore = __webpack_require__(6315);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/subMesh.js
var subMesh = __webpack_require__(65907);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/uniformBuffer.js
var uniformBuffer = __webpack_require__(80935);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__(51137);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.plane.js
var math_plane = __webpack_require__(94100);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/drawWrapper.js
var drawWrapper = __webpack_require__(35476);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/decorators.serialization.js
var decorators_serialization = __webpack_require__(26877);
;// ./node_modules/@babylonjs/core/Materials/materialStencilState.js




/**
 * Class that holds the different stencil states of a material
 * Usage example: https://playground.babylonjs.com/#CW5PRI#10
 */
class MaterialStencilState {
    /**
     * Creates a material stencil state instance
     */
    constructor() {
        this.reset();
    }
    /**
     * Resets all the stencil states to default values
     */
    reset() {
        this.enabled = false;
        this.mask = 0xff;
        this.func = 519;
        this.funcRef = 1;
        this.funcMask = 0xff;
        this.opStencilFail = 7680;
        this.opDepthFail = 7680;
        this.opStencilDepthPass = 7681;
    }
    /**
     * Gets or sets the stencil function
     */
    get func() {
        return this._func;
    }
    set func(value) {
        this._func = value;
    }
    /**
     * Gets or sets the stencil function reference
     */
    get funcRef() {
        return this._funcRef;
    }
    set funcRef(value) {
        this._funcRef = value;
    }
    /**
     * Gets or sets the stencil function mask
     */
    get funcMask() {
        return this._funcMask;
    }
    set funcMask(value) {
        this._funcMask = value;
    }
    /**
     * Gets or sets the operation when the stencil test fails
     */
    get opStencilFail() {
        return this._opStencilFail;
    }
    set opStencilFail(value) {
        this._opStencilFail = value;
    }
    /**
     * Gets or sets the operation when the depth test fails
     */
    get opDepthFail() {
        return this._opDepthFail;
    }
    set opDepthFail(value) {
        this._opDepthFail = value;
    }
    /**
     * Gets or sets the operation when the stencil+depth test succeeds
     */
    get opStencilDepthPass() {
        return this._opStencilDepthPass;
    }
    set opStencilDepthPass(value) {
        this._opStencilDepthPass = value;
    }
    /**
     * Gets or sets the stencil mask
     */
    get mask() {
        return this._mask;
    }
    set mask(value) {
        this._mask = value;
    }
    /**
     * Enables or disables the stencil test
     */
    get enabled() {
        return this._enabled;
    }
    set enabled(value) {
        this._enabled = value;
    }
    /**
     * Get the current class name, useful for serialization or dynamic coding.
     * @returns "MaterialStencilState"
     */
    getClassName() {
        return "MaterialStencilState";
    }
    /**
     * Makes a duplicate of the current configuration into another one.
     * @param stencilState defines stencil state where to copy the info
     */
    copyTo(stencilState) {
        decorators_serialization/* SerializationHelper */.p.Clone(() => stencilState, this);
    }
    /**
     * Serializes this stencil configuration.
     * @returns - An object with the serialized config.
     */
    serialize() {
        return decorators_serialization/* SerializationHelper */.p.Serialize(this);
    }
    /**
     * Parses a stencil state configuration from a serialized object.
     * @param source - Serialized object.
     * @param scene Defines the scene we are parsing for
     * @param rootUrl Defines the rootUrl to load from
     */
    parse(source, scene, rootUrl) {
        decorators_serialization/* SerializationHelper */.p.Parse(() => this, source, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MaterialStencilState.prototype, "func", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MaterialStencilState.prototype, "funcRef", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MaterialStencilState.prototype, "funcMask", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MaterialStencilState.prototype, "opStencilFail", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MaterialStencilState.prototype, "opDepthFail", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MaterialStencilState.prototype, "opStencilDepthPass", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MaterialStencilState.prototype, "mask", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MaterialStencilState.prototype, "enabled", null);
//# sourceMappingURL=materialStencilState.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialHelper.functions.js
var materialHelper_functions = __webpack_require__(80467);
;// ./node_modules/@babylonjs/core/Materials/material.js














/**
 * Base class for the main features of a material in Babylon.js
 */
class Material {
    /**
     * Gets the shader language used in this material.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * If the material can be rendered to several textures with MRT extension
     */
    get canRenderToMRT() {
        // By default, shaders are not compatible with MRTs
        // Base classes should override that if their shader supports MRT
        return false;
    }
    /**
     * Sets the alpha value of the material
     */
    set alpha(value) {
        if (this._alpha === value) {
            return;
        }
        const oldValue = this._alpha;
        this._alpha = value;
        // Only call dirty when there is a state change (no alpha / alpha)
        if (oldValue === 1 || value === 1) {
            this.markAsDirty(Material.MiscDirtyFlag + Material.PrePassDirtyFlag);
        }
    }
    /**
     * Gets the alpha value of the material
     */
    get alpha() {
        return this._alpha;
    }
    /**
     * Sets the culling state (true to enable culling, false to disable)
     */
    set backFaceCulling(value) {
        if (this._backFaceCulling === value) {
            return;
        }
        this._backFaceCulling = value;
        this.markAsDirty(Material.TextureDirtyFlag);
    }
    /**
     * Gets the culling state
     */
    get backFaceCulling() {
        return this._backFaceCulling;
    }
    /**
     * Sets the type of faces that should be culled (true for back faces, false for front faces)
     */
    set cullBackFaces(value) {
        if (this._cullBackFaces === value) {
            return;
        }
        this._cullBackFaces = value;
        this.markAsDirty(Material.TextureDirtyFlag);
    }
    /**
     * Gets the type of faces that should be culled
     */
    get cullBackFaces() {
        return this._cullBackFaces;
    }
    /**
     * Block the dirty-mechanism for this specific material
     * When set to false after being true the material will be marked as dirty.
     */
    get blockDirtyMechanism() {
        return this._blockDirtyMechanism;
    }
    set blockDirtyMechanism(value) {
        if (this._blockDirtyMechanism === value) {
            return;
        }
        this._blockDirtyMechanism = value;
        if (!value) {
            this.markDirty();
        }
    }
    /**
     * This allows you to modify the material without marking it as dirty after every change.
     * This function should be used if you need to make more than one dirty-enabling change to the material - adding a texture, setting a new fill mode and so on.
     * The callback will pass the material as an argument, so you can make your changes to it.
     * @param callback the callback to be executed that will update the material
     */
    atomicMaterialsUpdate(callback) {
        this.blockDirtyMechanism = true;
        try {
            callback(this);
        }
        finally {
            this.blockDirtyMechanism = false;
        }
    }
    /**
     * Gets a boolean indicating that current material needs to register RTT
     */
    get hasRenderTargetTextures() {
        this._eventInfo.hasRenderTargetTextures = false;
        this._callbackPluginEventHasRenderTargetTextures(this._eventInfo);
        return this._eventInfo.hasRenderTargetTextures;
    }
    /**
     * Called during a dispose event
     */
    set onDispose(callback) {
        if (this._onDisposeObserver) {
            this.onDisposeObservable.remove(this._onDisposeObserver);
        }
        this._onDisposeObserver = this.onDisposeObservable.add(callback);
    }
    /**
     * An event triggered when the material is bound
     */
    get onBindObservable() {
        if (!this._onBindObservable) {
            this._onBindObservable = new observable/* Observable */.cP();
        }
        return this._onBindObservable;
    }
    /**
     * Called during a bind event
     */
    set onBind(callback) {
        if (this._onBindObserver) {
            this.onBindObservable.remove(this._onBindObserver);
        }
        this._onBindObserver = this.onBindObservable.add(callback);
    }
    /**
     * An event triggered when the material is unbound
     */
    get onUnBindObservable() {
        if (!this._onUnBindObservable) {
            this._onUnBindObservable = new observable/* Observable */.cP();
        }
        return this._onUnBindObservable;
    }
    /**
     * An event triggered when the effect is (re)created
     */
    get onEffectCreatedObservable() {
        if (!this._onEffectCreatedObservable) {
            this._onEffectCreatedObservable = new observable/* Observable */.cP();
        }
        return this._onEffectCreatedObservable;
    }
    /**
     * Sets the value of the alpha mode.
     *
     * | Value | Type | Description |
     * | --- | --- | --- |
     * | 0 | ALPHA_DISABLE |   |
     * | 1 | ALPHA_ADD |   |
     * | 2 | ALPHA_COMBINE |   |
     * | 3 | ALPHA_SUBTRACT |   |
     * | 4 | ALPHA_MULTIPLY |   |
     * | 5 | ALPHA_MAXIMIZED |   |
     * | 6 | ALPHA_ONEONE |   |
     * | 7 | ALPHA_PREMULTIPLIED |   |
     * | 8 | ALPHA_PREMULTIPLIED_PORTERDUFF |   |
     * | 9 | ALPHA_INTERPOLATE |   |
     * | 10 | ALPHA_SCREENMODE |   |
     *
     */
    set alphaMode(value) {
        if (this._alphaMode === value) {
            return;
        }
        this._alphaMode = value;
        this.markAsDirty(Material.TextureDirtyFlag);
    }
    /**
     * Gets the value of the alpha mode
     */
    get alphaMode() {
        return this._alphaMode;
    }
    /**
     * Sets the need depth pre-pass value
     */
    set needDepthPrePass(value) {
        if (this._needDepthPrePass === value) {
            return;
        }
        this._needDepthPrePass = value;
        if (this._needDepthPrePass) {
            this.checkReadyOnEveryCall = true;
        }
    }
    /**
     * Gets the depth pre-pass value
     */
    get needDepthPrePass() {
        return this._needDepthPrePass;
    }
    /**
     * Can this material render to prepass
     */
    get isPrePassCapable() {
        return false;
    }
    /**
     * Sets the state for enabling fog
     */
    set fogEnabled(value) {
        if (this._fogEnabled === value) {
            return;
        }
        this._fogEnabled = value;
        this.markAsDirty(Material.MiscDirtyFlag);
    }
    /**
     * Gets the value of the fog enabled state
     */
    get fogEnabled() {
        return this._fogEnabled;
    }
    get wireframe() {
        switch (this._fillMode) {
            case Material.WireFrameFillMode:
            case Material.LineListDrawMode:
            case Material.LineLoopDrawMode:
            case Material.LineStripDrawMode:
                return true;
        }
        return this._scene.forceWireframe;
    }
    /**
     * Sets the state of wireframe mode
     */
    set wireframe(value) {
        this.fillMode = value ? Material.WireFrameFillMode : Material.TriangleFillMode;
    }
    /**
     * Gets the value specifying if point clouds are enabled
     */
    get pointsCloud() {
        switch (this._fillMode) {
            case Material.PointFillMode:
            case Material.PointListDrawMode:
                return true;
        }
        return this._scene.forcePointsCloud;
    }
    /**
     * Sets the state of point cloud mode
     */
    set pointsCloud(value) {
        this.fillMode = value ? Material.PointFillMode : Material.TriangleFillMode;
    }
    /**
     * Gets the material fill mode
     */
    get fillMode() {
        return this._fillMode;
    }
    /**
     * Sets the material fill mode
     */
    set fillMode(value) {
        if (this._fillMode === value) {
            return;
        }
        this._fillMode = value;
        this.markAsDirty(Material.MiscDirtyFlag);
    }
    /**
     * In case the depth buffer does not allow enough depth precision for your scene (might be the case in large scenes)
     * You can try switching to logarithmic depth.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/logarithmicDepthBuffer
     */
    get useLogarithmicDepth() {
        return this._useLogarithmicDepth;
    }
    set useLogarithmicDepth(value) {
        const fragmentDepthSupported = this.getScene().getEngine().getCaps().fragmentDepthSupported;
        if (value && !fragmentDepthSupported) {
            logger/* Logger */.V.Warn("Logarithmic depth has been requested for a material on a device that doesn't support it.");
        }
        this._useLogarithmicDepth = value && fragmentDepthSupported;
        this._markAllSubMeshesAsMiscDirty();
    }
    /** @internal */
    _getDrawWrapper() {
        return this._drawWrapper;
    }
    /**
     * @internal
     */
    _setDrawWrapper(drawWrapper) {
        this._drawWrapper = drawWrapper;
    }
    /**
     * Creates a material instance
     * @param name defines the name of the material
     * @param scene defines the scene to reference
     * @param doNotAdd specifies if the material should be added to the scene
     * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
     */
    constructor(name, scene, doNotAdd, forceGLSL = false) {
        /**
         * Custom shadow depth material to use for shadow rendering instead of the in-built one
         */
        this.shadowDepthWrapper = null;
        /**
         * Gets or sets a boolean indicating that the material is allowed (if supported) to do shader hot swapping.
         * This means that the material can keep using a previous shader while a new one is being compiled.
         * This is mostly used when shader parallel compilation is supported (true by default)
         */
        this.allowShaderHotSwapping = true;
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._forceGLSL = false;
        /**
         * Gets or sets user defined metadata
         */
        this.metadata = null;
        /**
         * For internal use only. Please do not use.
         */
        this.reservedDataStore = null;
        /**
         * Specifies if the ready state should be checked on each call
         */
        this.checkReadyOnEveryCall = false;
        /**
         * Specifies if the ready state should be checked once
         */
        this.checkReadyOnlyOnce = false;
        /**
         * The state of the material
         */
        this.state = "";
        /**
         * The alpha value of the material
         */
        this._alpha = 1.0;
        /**
         * Specifies if back face culling is enabled
         */
        this._backFaceCulling = true;
        /**
         * Specifies if back or front faces should be culled (when culling is enabled)
         */
        this._cullBackFaces = true;
        this._blockDirtyMechanism = false;
        /**
         * Stores the value for side orientation
         */
        this.sideOrientation = null;
        /**
         * Callback triggered when the material is compiled
         */
        this.onCompiled = null;
        /**
         * Callback triggered when an error occurs
         */
        this.onError = null;
        /**
         * Callback triggered to get the render target textures
         */
        this.getRenderTargetTextures = null;
        /**
         * Specifies if the material should be serialized
         */
        this.doNotSerialize = false;
        /**
         * @internal
         */
        this._storeEffectOnSubMeshes = false;
        /**
         * Stores the animations for the material
         */
        this.animations = null;
        /**
         * An event triggered when the material is disposed
         */
        this.onDisposeObservable = new observable/* Observable */.cP();
        /**
         * An observer which watches for dispose events
         */
        this._onDisposeObserver = null;
        this._onUnBindObservable = null;
        /**
         * An observer which watches for bind events
         */
        this._onBindObserver = null;
        /**
         * Stores the value of the alpha mode
         */
        this._alphaMode = 2;
        /**
         * Stores the state of the need depth pre-pass value
         */
        this._needDepthPrePass = false;
        /**
         * Specifies if depth writing should be disabled
         */
        this.disableDepthWrite = false;
        /**
         * Specifies if color writing should be disabled
         */
        this.disableColorWrite = false;
        /**
         * Specifies if depth writing should be forced
         */
        this.forceDepthWrite = false;
        /**
         * Specifies the depth function that should be used. 0 means the default engine function
         */
        this.depthFunction = 0;
        /**
         * Specifies if there should be a separate pass for culling
         */
        this.separateCullingPass = false;
        /**
         * Stores the state specifying if fog should be enabled
         */
        this._fogEnabled = true;
        /**
         * Stores the size of points
         */
        this.pointSize = 1.0;
        /**
         * Stores the z offset Factor value
         */
        this.zOffset = 0;
        /**
         * Stores the z offset Units value
         */
        this.zOffsetUnits = 0;
        /**
         * Gives access to the stencil properties of the material
         */
        this.stencil = new MaterialStencilState();
        /**
         * Specifies if uniform buffers should be used
         */
        this._useUBO = false;
        /**
         * Stores the fill mode state
         */
        this._fillMode = Material.TriangleFillMode;
        /**
         * Specifies if the depth write state should be cached
         */
        this._cachedDepthWriteState = false;
        /**
         * Specifies if the color write state should be cached
         */
        this._cachedColorWriteState = false;
        /**
         * Specifies if the depth function state should be cached
         */
        this._cachedDepthFunctionState = 0;
        /** @internal */
        this._indexInSceneMaterialArray = -1;
        /** @internal */
        this.meshMap = null;
        /** @internal */
        this._parentContainer = null;
        /** @internal */
        this._uniformBufferLayoutBuilt = false;
        this._eventInfo = {}; // will be initialized before each event notification
        /** @internal */
        this._callbackPluginEventGeneric = () => void 0;
        /** @internal */
        this._callbackPluginEventIsReadyForSubMesh = () => void 0;
        /** @internal */
        this._callbackPluginEventPrepareDefines = () => void 0;
        /** @internal */
        this._callbackPluginEventPrepareDefinesBeforeAttributes = () => void 0;
        /** @internal */
        this._callbackPluginEventHardBindForSubMesh = () => void 0;
        /** @internal */
        this._callbackPluginEventBindForSubMesh = () => void 0;
        /** @internal */
        this._callbackPluginEventHasRenderTargetTextures = () => void 0;
        /** @internal */
        this._callbackPluginEventFillRenderTargetTextures = () => void 0;
        /**
         * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations.
         */
        this._forceAlphaTest = false;
        /**
         * The transparency mode of the material.
         */
        this._transparencyMode = null;
        this.name = name;
        const setScene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        if (!setScene) {
            return;
        }
        this._scene = setScene;
        this._dirtyCallbacks = {};
        this._forceGLSL = forceGLSL;
        this._dirtyCallbacks[1] = this._markAllSubMeshesAsTexturesDirty.bind(this);
        this._dirtyCallbacks[2] = this._markAllSubMeshesAsLightsDirty.bind(this);
        this._dirtyCallbacks[4] = this._markAllSubMeshesAsFresnelDirty.bind(this);
        this._dirtyCallbacks[8] = this._markAllSubMeshesAsAttributesDirty.bind(this);
        this._dirtyCallbacks[16] = this._markAllSubMeshesAsMiscDirty.bind(this);
        this._dirtyCallbacks[32] = this._markAllSubMeshesAsPrePassDirty.bind(this);
        this._dirtyCallbacks[63] = this._markAllSubMeshesAsAllDirty.bind(this);
        this.id = name || tools/* Tools */.S0.RandomId();
        this.uniqueId = this._scene.getUniqueId();
        this._materialContext = this._scene.getEngine().createMaterialContext();
        this._drawWrapper = new drawWrapper/* DrawWrapper */.E(this._scene.getEngine(), false);
        this._drawWrapper.materialContext = this._materialContext;
        this._uniformBuffer = new uniformBuffer/* UniformBuffer */.D(this._scene.getEngine(), undefined, undefined, name);
        this._useUBO = this.getScene().getEngine().supportsUniformBuffers;
        this._createUniformBuffer();
        if (!doNotAdd) {
            this._scene.addMaterial(this);
        }
        if (this._scene.useMaterialMeshMap) {
            this.meshMap = {};
        }
        Material.OnEventObservable.notifyObservers(this, 1 /* MaterialPluginEvent.Created */);
    }
    /** @internal */
    _createUniformBuffer() {
        const engine = this.getScene().getEngine();
        this._uniformBuffer?.dispose();
        if (engine.isWebGPU && !this._forceGLSL) {
            // Switch main UBO to non UBO to connect to leftovers UBO in webgpu
            this._uniformBuffer = new uniformBuffer/* UniformBuffer */.D(engine, undefined, undefined, this.name, true);
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
        else {
            this._uniformBuffer = new uniformBuffer/* UniformBuffer */.D(this._scene.getEngine(), undefined, undefined, this.name);
        }
        this._uniformBufferLayoutBuilt = false;
    }
    /**
     * Returns a string representation of the current material
     * @param fullDetails defines a boolean indicating which levels of logging is desired
     * @returns a string with material information
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    toString(fullDetails) {
        const ret = "Name: " + this.name;
        return ret;
    }
    /**
     * Gets the class name of the material
     * @returns a string with the class name of the material
     */
    getClassName() {
        return "Material";
    }
    /** @internal */
    get _isMaterial() {
        return true;
    }
    /**
     * Specifies if updates for the material been locked
     */
    get isFrozen() {
        return this.checkReadyOnlyOnce;
    }
    /**
     * Locks updates for the material
     */
    freeze() {
        this.markDirty();
        this.checkReadyOnlyOnce = true;
    }
    /**
     * Unlocks updates for the material
     */
    unfreeze() {
        this.markDirty();
        this.checkReadyOnlyOnce = false;
    }
    /**
     * Specifies if the material is ready to be used
     * @param mesh defines the mesh to check
     * @param useInstances specifies if instances should be used
     * @returns a boolean indicating if the material is ready to be used
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    isReady(mesh, useInstances) {
        return true;
    }
    /**
     * Specifies that the submesh is ready to be used
     * @param mesh defines the mesh to check
     * @param subMesh defines which submesh to check
     * @param useInstances specifies that instances should be used
     * @returns a boolean indicating that the submesh is ready or not
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    isReadyForSubMesh(mesh, subMesh, useInstances) {
        const defines = subMesh.materialDefines;
        if (!defines) {
            return false;
        }
        this._eventInfo.isReadyForSubMesh = true;
        this._eventInfo.defines = defines;
        this._callbackPluginEventIsReadyForSubMesh(this._eventInfo);
        return this._eventInfo.isReadyForSubMesh;
    }
    /**
     * Returns the material effect
     * @returns the effect associated with the material
     */
    getEffect() {
        return this._drawWrapper.effect;
    }
    /**
     * Returns the current scene
     * @returns a Scene
     */
    getScene() {
        return this._scene;
    }
    /** @internal */
    _getEffectiveOrientation(mesh) {
        return this.sideOrientation !== null ? this.sideOrientation : mesh.sideOrientation;
    }
    /**
     * Gets the current transparency mode.
     */
    get transparencyMode() {
        return this._transparencyMode;
    }
    /**
     * Sets the transparency mode of the material.
     *
     * | Value | Type                                | Description |
     * | ----- | ----------------------------------- | ----------- |
     * | 0     | OPAQUE                              |             |
     * | 1     | ALPHATEST                           |             |
     * | 2     | ALPHABLEND                          |             |
     * | 3     | ALPHATESTANDBLEND                   |             |
     *
     */
    set transparencyMode(value) {
        if (this._transparencyMode === value) {
            return;
        }
        this._transparencyMode = value;
        this._forceAlphaTest = value === Material.MATERIAL_ALPHATESTANDBLEND;
        this._markAllSubMeshesAsTexturesAndMiscDirty();
    }
    /**
     * Returns true if alpha blending should be disabled.
     */
    get _disableAlphaBlending() {
        return this._transparencyMode === Material.MATERIAL_OPAQUE || this._transparencyMode === Material.MATERIAL_ALPHATEST;
    }
    /**
     * Specifies whether or not this material should be rendered in alpha blend mode.
     * @returns a boolean specifying if alpha blending is needed
     */
    needAlphaBlending() {
        if (this._disableAlphaBlending) {
            return false;
        }
        return this.alpha < 1.0;
    }
    /**
     * Specifies if the mesh will require alpha blending
     * @param mesh defines the mesh to check
     * @returns a boolean specifying if alpha blending is needed for the mesh
     */
    needAlphaBlendingForMesh(mesh) {
        if (mesh.visibility < 1.0) {
            return true;
        }
        if (this._disableAlphaBlending) {
            return false;
        }
        return mesh.hasVertexAlpha || this.needAlphaBlending();
    }
    /**
     * Specifies whether or not this material should be rendered in alpha test mode.
     * @returns a boolean specifying if an alpha test is needed.
     */
    needAlphaTesting() {
        if (this._forceAlphaTest) {
            return true;
        }
        return false;
    }
    /**
     * Specifies if material alpha testing should be turned on for the mesh
     * @param mesh defines the mesh to check
     * @returns a boolean specifying if alpha testing should be turned on for the mesh
     */
    _shouldTurnAlphaTestOn(mesh) {
        return !this.needAlphaBlendingForMesh(mesh) && this.needAlphaTesting();
    }
    /**
     * Gets the texture used for the alpha test
     * @returns the texture to use for alpha testing
     */
    getAlphaTestTexture() {
        return null;
    }
    /**
     * Marks the material to indicate that it needs to be re-calculated
     * @param forceMaterialDirty - Forces the material to be marked as dirty for all components (same as this.markAsDirty(Material.AllDirtyFlag)). You should use this flag if the material is frozen and you want to force a recompilation.
     */
    markDirty(forceMaterialDirty = false) {
        const meshes = this.getScene().meshes;
        for (const mesh of meshes) {
            if (!mesh.subMeshes) {
                continue;
            }
            for (const subMesh of mesh.subMeshes) {
                if (subMesh.getMaterial() !== this) {
                    continue;
                }
                for (const drawWrapper of subMesh._drawWrappers) {
                    if (!drawWrapper) {
                        continue;
                    }
                    if (this._materialContext === drawWrapper.materialContext) {
                        drawWrapper._wasPreviouslyReady = false;
                        drawWrapper._wasPreviouslyUsingInstances = null;
                        drawWrapper._forceRebindOnNextCall = forceMaterialDirty;
                    }
                }
            }
        }
        if (forceMaterialDirty) {
            this.markAsDirty(Material.AllDirtyFlag);
        }
    }
    /**
     * @internal
     */
    _preBind(effect, overrideOrientation = null) {
        const engine = this._scene.getEngine();
        const orientation = overrideOrientation == null ? this.sideOrientation : overrideOrientation;
        const reverse = orientation === Material.ClockWiseSideOrientation;
        engine.enableEffect(effect ? effect : this._getDrawWrapper());
        engine.setState(this.backFaceCulling, this.zOffset, false, reverse, this._scene._mirroredCameraPosition ? !this.cullBackFaces : this.cullBackFaces, this.stencil, this.zOffsetUnits);
        return reverse;
    }
    /**
     * Binds the material to the mesh
     * @param world defines the world transformation matrix
     * @param mesh defines the mesh to bind the material to
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    bind(world, mesh) { }
    /**
     * Initializes the uniform buffer layout for the shader.
     */
    buildUniformLayout() {
        const ubo = this._uniformBuffer;
        this._eventInfo.ubo = ubo;
        this._callbackPluginEventGeneric(8 /* MaterialPluginEvent.PrepareUniformBuffer */, this._eventInfo);
        ubo.create();
        this._uniformBufferLayoutBuilt = true;
    }
    /**
     * Binds the submesh to the material
     * @param world defines the world transformation matrix
     * @param mesh defines the mesh containing the submesh
     * @param subMesh defines the submesh to bind the material to
     */
    bindForSubMesh(world, mesh, subMesh) {
        const drawWrapper = subMesh._drawWrapper;
        this._eventInfo.subMesh = subMesh;
        this._callbackPluginEventBindForSubMesh(this._eventInfo);
        drawWrapper._forceRebindOnNextCall = false;
    }
    /**
     * Binds the world matrix to the material
     * @param world defines the world transformation matrix
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    bindOnlyWorldMatrix(world) { }
    /**
     * Binds the view matrix to the effect
     * @param effect defines the effect to bind the view matrix to
     */
    bindView(effect) {
        if (!this._useUBO) {
            effect.setMatrix("view", this.getScene().getViewMatrix());
        }
        else {
            this._needToBindSceneUbo = true;
        }
    }
    /**
     * Binds the view projection and projection matrices to the effect
     * @param effect defines the effect to bind the view projection and projection matrices to
     */
    bindViewProjection(effect) {
        if (!this._useUBO) {
            effect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
            effect.setMatrix("projection", this.getScene().getProjectionMatrix());
        }
        else {
            this._needToBindSceneUbo = true;
        }
    }
    /**
     * Binds the view matrix to the effect
     * @param effect defines the effect to bind the view matrix to
     * @param variableName name of the shader variable that will hold the eye position
     */
    bindEyePosition(effect, variableName) {
        if (!this._useUBO) {
            this._scene.bindEyePosition(effect, variableName);
        }
        else {
            this._needToBindSceneUbo = true;
        }
    }
    /**
     * Processes to execute after binding the material to a mesh
     * @param mesh defines the rendered mesh
     * @param effect defines the effect used to bind the material
     * @param _subMesh defines the subMesh that the material has been bound for
     */
    _afterBind(mesh, effect = null, _subMesh) {
        this._scene._cachedMaterial = this;
        if (this._needToBindSceneUbo) {
            if (effect) {
                this._needToBindSceneUbo = false;
                (0,materialHelper_functions/* BindSceneUniformBuffer */._8)(effect, this.getScene().getSceneUniformBuffer());
                this._scene.finalizeSceneUbo();
            }
        }
        if (mesh) {
            this._scene._cachedVisibility = mesh.visibility;
        }
        else {
            this._scene._cachedVisibility = 1;
        }
        if (this._onBindObservable && mesh) {
            this._onBindObservable.notifyObservers(mesh);
        }
        if (this.disableDepthWrite) {
            const engine = this._scene.getEngine();
            this._cachedDepthWriteState = engine.getDepthWrite();
            engine.setDepthWrite(false);
        }
        if (this.disableColorWrite) {
            const engine = this._scene.getEngine();
            this._cachedColorWriteState = engine.getColorWrite();
            engine.setColorWrite(false);
        }
        if (this.depthFunction !== 0) {
            const engine = this._scene.getEngine();
            this._cachedDepthFunctionState = engine.getDepthFunction() || 0;
            engine.setDepthFunction(this.depthFunction);
        }
    }
    /**
     * Unbinds the material from the mesh
     */
    unbind() {
        if (this._onUnBindObservable) {
            this._onUnBindObservable.notifyObservers(this);
        }
        if (this.depthFunction !== 0) {
            const engine = this._scene.getEngine();
            engine.setDepthFunction(this._cachedDepthFunctionState);
        }
        if (this.disableDepthWrite) {
            const engine = this._scene.getEngine();
            engine.setDepthWrite(this._cachedDepthWriteState);
        }
        if (this.disableColorWrite) {
            const engine = this._scene.getEngine();
            engine.setColorWrite(this._cachedColorWriteState);
        }
    }
    /**
     * Returns the animatable textures.
     * @returns - Array of animatable textures.
     */
    getAnimatables() {
        this._eventInfo.animatables = [];
        this._callbackPluginEventGeneric(256 /* MaterialPluginEvent.GetAnimatables */, this._eventInfo);
        return this._eventInfo.animatables;
    }
    /**
     * Gets the active textures from the material
     * @returns an array of textures
     */
    getActiveTextures() {
        this._eventInfo.activeTextures = [];
        this._callbackPluginEventGeneric(512 /* MaterialPluginEvent.GetActiveTextures */, this._eventInfo);
        return this._eventInfo.activeTextures;
    }
    /**
     * Specifies if the material uses a texture
     * @param texture defines the texture to check against the material
     * @returns a boolean specifying if the material uses the texture
     */
    hasTexture(texture) {
        this._eventInfo.hasTexture = false;
        this._eventInfo.texture = texture;
        this._callbackPluginEventGeneric(1024 /* MaterialPluginEvent.HasTexture */, this._eventInfo);
        return this._eventInfo.hasTexture;
    }
    /**
     * Makes a duplicate of the material, and gives it a new name
     * @param name defines the new name for the duplicated material
     * @returns the cloned material
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    clone(name) {
        return null;
    }
    _clonePlugins(targetMaterial, rootUrl) {
        const serializationObject = {};
        // Create plugins in targetMaterial in case they don't exist
        this._serializePlugins(serializationObject);
        Material._ParsePlugins(serializationObject, targetMaterial, this._scene, rootUrl);
        // Copy the properties of the current plugins to the cloned material's plugins
        if (this.pluginManager) {
            for (const plugin of this.pluginManager._plugins) {
                const targetPlugin = targetMaterial.pluginManager.getPlugin(plugin.name);
                if (targetPlugin) {
                    plugin.copyTo(targetPlugin);
                }
            }
        }
    }
    /**
     * Gets the meshes bound to the material
     * @returns an array of meshes bound to the material
     */
    getBindedMeshes() {
        if (this.meshMap) {
            const result = [];
            for (const meshId in this.meshMap) {
                const mesh = this.meshMap[meshId];
                if (mesh) {
                    result.push(mesh);
                }
            }
            return result;
        }
        else {
            const meshes = this._scene.meshes;
            return meshes.filter((mesh) => mesh.material === this);
        }
    }
    /**
     * Force shader compilation
     * @param mesh defines the mesh associated with this material
     * @param onCompiled defines a function to execute once the material is compiled
     * @param options defines the options to configure the compilation
     * @param onError defines a function to execute if the material fails compiling
     */
    forceCompilation(mesh, onCompiled, options, onError) {
        const localOptions = {
            clipPlane: false,
            useInstances: false,
            ...options,
        };
        const scene = this.getScene();
        const currentHotSwapingState = this.allowShaderHotSwapping;
        this.allowShaderHotSwapping = false; // Turned off to let us evaluate the real compilation state
        const checkReady = () => {
            if (!this._scene || !this._scene.getEngine()) {
                return;
            }
            const clipPlaneState = scene.clipPlane;
            if (localOptions.clipPlane) {
                scene.clipPlane = new math_plane/* Plane */.Z(0, 0, 0, 1);
            }
            if (this._storeEffectOnSubMeshes) {
                let allDone = true, lastError = null;
                if (mesh.subMeshes) {
                    const tempSubMesh = new subMesh/* SubMesh */.K(0, 0, 0, 0, 0, mesh, undefined, false, false);
                    if (tempSubMesh.materialDefines) {
                        tempSubMesh.materialDefines._renderId = -1;
                    }
                    if (!this.isReadyForSubMesh(mesh, tempSubMesh, localOptions.useInstances)) {
                        if (tempSubMesh.effect && tempSubMesh.effect.getCompilationError() && tempSubMesh.effect.allFallbacksProcessed()) {
                            lastError = tempSubMesh.effect.getCompilationError();
                        }
                        else {
                            allDone = false;
                            setTimeout(checkReady, 16);
                        }
                    }
                }
                if (allDone) {
                    this.allowShaderHotSwapping = currentHotSwapingState;
                    if (lastError) {
                        if (onError) {
                            onError(lastError);
                        }
                    }
                    if (onCompiled) {
                        onCompiled(this);
                    }
                }
            }
            else {
                if (this.isReady()) {
                    this.allowShaderHotSwapping = currentHotSwapingState;
                    if (onCompiled) {
                        onCompiled(this);
                    }
                }
                else {
                    setTimeout(checkReady, 16);
                }
            }
            if (localOptions.clipPlane) {
                scene.clipPlane = clipPlaneState;
            }
        };
        checkReady();
    }
    /**
     * Force shader compilation
     * @param mesh defines the mesh that will use this material
     * @param options defines additional options for compiling the shaders
     * @returns a promise that resolves when the compilation completes
     */
    forceCompilationAsync(mesh, options) {
        return new Promise((resolve, reject) => {
            this.forceCompilation(mesh, () => {
                resolve();
            }, options, (reason) => {
                reject(reason);
            });
        });
    }
    /**
     * Marks a define in the material to indicate that it needs to be re-computed
     * @param flag defines a flag used to determine which parts of the material have to be marked as dirty
     */
    markAsDirty(flag) {
        if (this.getScene().blockMaterialDirtyMechanism || this._blockDirtyMechanism) {
            return;
        }
        Material._DirtyCallbackArray.length = 0;
        if (flag & Material.TextureDirtyFlag) {
            Material._DirtyCallbackArray.push(Material._TextureDirtyCallBack);
        }
        if (flag & Material.LightDirtyFlag) {
            Material._DirtyCallbackArray.push(Material._LightsDirtyCallBack);
        }
        if (flag & Material.FresnelDirtyFlag) {
            Material._DirtyCallbackArray.push(Material._FresnelDirtyCallBack);
        }
        if (flag & Material.AttributesDirtyFlag) {
            Material._DirtyCallbackArray.push(Material._AttributeDirtyCallBack);
        }
        if (flag & Material.MiscDirtyFlag) {
            Material._DirtyCallbackArray.push(Material._MiscDirtyCallBack);
        }
        if (flag & Material.PrePassDirtyFlag) {
            Material._DirtyCallbackArray.push(Material._PrePassDirtyCallBack);
        }
        if (Material._DirtyCallbackArray.length) {
            this._markAllSubMeshesAsDirty(Material._RunDirtyCallBacks);
        }
        this.getScene().resetCachedMaterial();
    }
    /**
     * Resets the draw wrappers cache for all submeshes that are using this material
     */
    resetDrawCache() {
        const meshes = this.getScene().meshes;
        for (const mesh of meshes) {
            if (!mesh.subMeshes) {
                continue;
            }
            for (const subMesh of mesh.subMeshes) {
                if (subMesh.getMaterial() !== this) {
                    continue;
                }
                subMesh.resetDrawCache();
            }
        }
    }
    /**
     * Marks all submeshes of a material to indicate that their material defines need to be re-calculated
     * @param func defines a function which checks material defines against the submeshes
     */
    _markAllSubMeshesAsDirty(func) {
        if (this.getScene().blockMaterialDirtyMechanism || this._blockDirtyMechanism) {
            return;
        }
        const meshes = this.getScene().meshes;
        for (const mesh of meshes) {
            if (!mesh.subMeshes) {
                continue;
            }
            for (const subMesh of mesh.subMeshes) {
                // We want to skip the submeshes which are not using this material or which have not yet rendered at least once
                if (subMesh.getMaterial(false) !== this) {
                    continue;
                }
                for (const drawWrapper of subMesh._drawWrappers) {
                    if (!drawWrapper || !drawWrapper.defines || !drawWrapper.defines.markAllAsDirty) {
                        continue;
                    }
                    if (this._materialContext === drawWrapper.materialContext) {
                        func(drawWrapper.defines);
                    }
                }
            }
        }
    }
    /**
     * Indicates that the scene should check if the rendering now needs a prepass
     */
    _markScenePrePassDirty() {
        if (this.getScene().blockMaterialDirtyMechanism || this._blockDirtyMechanism) {
            return;
        }
        const prePassRenderer = this.getScene().enablePrePassRenderer();
        if (prePassRenderer) {
            prePassRenderer.markAsDirty();
        }
    }
    /**
     * Indicates that we need to re-calculated for all submeshes
     */
    _markAllSubMeshesAsAllDirty() {
        this._markAllSubMeshesAsDirty(Material._AllDirtyCallBack);
    }
    /**
     * Indicates that image processing needs to be re-calculated for all submeshes
     */
    _markAllSubMeshesAsImageProcessingDirty() {
        this._markAllSubMeshesAsDirty(Material._ImageProcessingDirtyCallBack);
    }
    /**
     * Indicates that textures need to be re-calculated for all submeshes
     */
    _markAllSubMeshesAsTexturesDirty() {
        this._markAllSubMeshesAsDirty(Material._TextureDirtyCallBack);
    }
    /**
     * Indicates that fresnel needs to be re-calculated for all submeshes
     */
    _markAllSubMeshesAsFresnelDirty() {
        this._markAllSubMeshesAsDirty(Material._FresnelDirtyCallBack);
    }
    /**
     * Indicates that fresnel and misc need to be re-calculated for all submeshes
     */
    _markAllSubMeshesAsFresnelAndMiscDirty() {
        this._markAllSubMeshesAsDirty(Material._FresnelAndMiscDirtyCallBack);
    }
    /**
     * Indicates that lights need to be re-calculated for all submeshes
     */
    _markAllSubMeshesAsLightsDirty() {
        this._markAllSubMeshesAsDirty(Material._LightsDirtyCallBack);
    }
    /**
     * Indicates that attributes need to be re-calculated for all submeshes
     */
    _markAllSubMeshesAsAttributesDirty() {
        this._markAllSubMeshesAsDirty(Material._AttributeDirtyCallBack);
    }
    /**
     * Indicates that misc needs to be re-calculated for all submeshes
     */
    _markAllSubMeshesAsMiscDirty() {
        this._markAllSubMeshesAsDirty(Material._MiscDirtyCallBack);
    }
    /**
     * Indicates that prepass needs to be re-calculated for all submeshes
     */
    _markAllSubMeshesAsPrePassDirty() {
        this._markAllSubMeshesAsDirty(Material._MiscDirtyCallBack);
    }
    /**
     * Indicates that textures and misc need to be re-calculated for all submeshes
     */
    _markAllSubMeshesAsTexturesAndMiscDirty() {
        this._markAllSubMeshesAsDirty(Material._TextureAndMiscDirtyCallBack);
    }
    _checkScenePerformancePriority() {
        if (this._scene.performancePriority !== 0 /* ScenePerformancePriority.BackwardCompatible */) {
            this.checkReadyOnlyOnce = true;
            // re-set the flag when the perf priority changes
            const observer = this._scene.onScenePerformancePriorityChangedObservable.addOnce(() => {
                this.checkReadyOnlyOnce = false;
            });
            // if this material is disposed before the scene is disposed, cleanup the observer
            this.onDisposeObservable.add(() => {
                this._scene.onScenePerformancePriorityChangedObservable.remove(observer);
            });
        }
    }
    /**
     * Sets the required values to the prepass renderer.
     * @param prePassRenderer defines the prepass renderer to setup.
     * @returns true if the pre pass is needed.
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    setPrePassRenderer(prePassRenderer) {
        // Do Nothing by default
        return false;
    }
    /**
     * Disposes the material
     * @param _forceDisposeEffect kept for backward compat. We reference count the effect now.
     * @param forceDisposeTextures specifies if textures should be forcefully disposed
     * @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
     */
    dispose(_forceDisposeEffect, forceDisposeTextures, notBoundToMesh) {
        const scene = this.getScene();
        // Animations
        scene.stopAnimation(this);
        scene.freeProcessedMaterials();
        // Remove from scene
        scene.removeMaterial(this);
        this._eventInfo.forceDisposeTextures = forceDisposeTextures;
        this._callbackPluginEventGeneric(2 /* MaterialPluginEvent.Disposed */, this._eventInfo);
        if (this._parentContainer) {
            const index = this._parentContainer.materials.indexOf(this);
            if (index > -1) {
                this._parentContainer.materials.splice(index, 1);
            }
            this._parentContainer = null;
        }
        if (notBoundToMesh !== true) {
            // Remove from meshes
            if (this.meshMap) {
                for (const meshId in this.meshMap) {
                    const mesh = this.meshMap[meshId];
                    if (mesh) {
                        this.releaseVertexArrayObject(mesh, true);
                        mesh.material = null; // will set the entry in the map to undefined
                    }
                }
            }
            else {
                const meshes = scene.meshes;
                for (const mesh of meshes) {
                    if (mesh.material === this && !mesh.sourceMesh) {
                        this.releaseVertexArrayObject(mesh, true);
                        mesh.material = null;
                    }
                }
            }
        }
        this._uniformBuffer.dispose();
        // Shader are kept in cache for further use but we can get rid of this by using forceDisposeEffect
        if (this._drawWrapper.effect) {
            if (!this._storeEffectOnSubMeshes) {
                this._drawWrapper.effect.dispose();
            }
            this._drawWrapper.effect = null;
        }
        this.metadata = null;
        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
        if (this._onBindObservable) {
            this._onBindObservable.clear();
        }
        if (this._onUnBindObservable) {
            this._onUnBindObservable.clear();
        }
        if (this._onEffectCreatedObservable) {
            this._onEffectCreatedObservable.clear();
        }
        if (this._eventInfo) {
            this._eventInfo = {};
        }
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    releaseVertexArrayObject(mesh, forceDisposeEffect) {
        const geometry = mesh.geometry;
        if (geometry) {
            if (this._storeEffectOnSubMeshes) {
                if (mesh.subMeshes) {
                    for (const subMesh of mesh.subMeshes) {
                        geometry._releaseVertexArrayObject(subMesh.effect);
                        if (forceDisposeEffect && subMesh.effect) {
                            subMesh.effect.dispose();
                        }
                    }
                }
            }
            else {
                geometry._releaseVertexArrayObject(this._drawWrapper.effect);
            }
        }
    }
    /**
     * Serializes this material
     * @returns the serialized material object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.stencil = this.stencil.serialize();
        serializationObject.uniqueId = this.uniqueId;
        this._serializePlugins(serializationObject);
        return serializationObject;
    }
    _serializePlugins(serializationObject) {
        serializationObject.plugins = {};
        if (this.pluginManager) {
            for (const plugin of this.pluginManager._plugins) {
                serializationObject.plugins[plugin.getClassName()] = plugin.serialize();
            }
        }
    }
    /**
     * Creates a material from parsed material data
     * @param parsedMaterial defines parsed material data
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures
     * @returns a new material
     */
    static Parse(parsedMaterial, scene, rootUrl) {
        if (!parsedMaterial.customType) {
            parsedMaterial.customType = "BABYLON.StandardMaterial";
        }
        else if (parsedMaterial.customType === "BABYLON.PBRMaterial" && parsedMaterial.overloadedAlbedo) {
            parsedMaterial.customType = "BABYLON.LegacyPBRMaterial";
            if (!BABYLON.LegacyPBRMaterial) {
                logger/* Logger */.V.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library.");
                return null;
            }
        }
        const materialType = tools/* Tools */.S0.Instantiate(parsedMaterial.customType);
        const material = materialType.Parse(parsedMaterial, scene, rootUrl);
        material._loadedUniqueId = parsedMaterial.uniqueId;
        return material;
    }
    static _ParsePlugins(serializationObject, material, scene, rootUrl) {
        if (!serializationObject.plugins) {
            return;
        }
        for (const pluginClassName in serializationObject.plugins) {
            const pluginData = serializationObject.plugins[pluginClassName];
            let plugin = material.pluginManager?.getPlugin(pluginData.name);
            if (!plugin) {
                const pluginClassType = tools/* Tools */.S0.Instantiate("BABYLON." + pluginClassName);
                if (pluginClassType) {
                    plugin = new pluginClassType(material);
                }
            }
            plugin?.parse(pluginData, scene, rootUrl);
        }
    }
}
/**
 * Returns the triangle fill mode
 */
Material.TriangleFillMode = 0;
/**
 * Returns the wireframe mode
 */
Material.WireFrameFillMode = 1;
/**
 * Returns the point fill mode
 */
Material.PointFillMode = 2;
/**
 * Returns the point list draw mode
 */
Material.PointListDrawMode = 3;
/**
 * Returns the line list draw mode
 */
Material.LineListDrawMode = 4;
/**
 * Returns the line loop draw mode
 */
Material.LineLoopDrawMode = 5;
/**
 * Returns the line strip draw mode
 */
Material.LineStripDrawMode = 6;
/**
 * Returns the triangle strip draw mode
 */
Material.TriangleStripDrawMode = 7;
/**
 * Returns the triangle fan draw mode
 */
Material.TriangleFanDrawMode = 8;
/**
 * Stores the clock-wise side orientation
 */
Material.ClockWiseSideOrientation = 0;
/**
 * Stores the counter clock-wise side orientation
 */
Material.CounterClockWiseSideOrientation = 1;
/**
 * The dirty texture flag value
 */
Material.TextureDirtyFlag = 1;
/**
 * The dirty light flag value
 */
Material.LightDirtyFlag = 2;
/**
 * The dirty fresnel flag value
 */
Material.FresnelDirtyFlag = 4;
/**
 * The dirty attribute flag value
 */
Material.AttributesDirtyFlag = 8;
/**
 * The dirty misc flag value
 */
Material.MiscDirtyFlag = 16;
/**
 * The dirty prepass flag value
 */
Material.PrePassDirtyFlag = 32;
/**
 * The all dirty flag value
 */
Material.AllDirtyFlag = 63;
/**
 * MaterialTransparencyMode: No transparency mode, Alpha channel is not use.
 */
Material.MATERIAL_OPAQUE = 0;
/**
 * MaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.
 */
Material.MATERIAL_ALPHATEST = 1;
/**
 * MaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
 */
Material.MATERIAL_ALPHABLEND = 2;
/**
 * MaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
 * They are also discarded below the alpha cutoff threshold to improve performances.
 */
Material.MATERIAL_ALPHATESTANDBLEND = 3;
/**
 * The Whiteout method is used to blend normals.
 * Details of the algorithm can be found here: https://blog.selfshadow.com/publications/blending-in-detail/
 */
Material.MATERIAL_NORMALBLENDMETHOD_WHITEOUT = 0;
/**
 * The Reoriented Normal Mapping method is used to blend normals.
 * Details of the algorithm can be found here: https://blog.selfshadow.com/publications/blending-in-detail/
 */
Material.MATERIAL_NORMALBLENDMETHOD_RNM = 1;
/**
 * Event observable which raises global events common to all materials (like MaterialPluginEvent.Created)
 */
Material.OnEventObservable = new observable/* Observable */.cP();
Material._AllDirtyCallBack = (defines) => defines.markAllAsDirty();
Material._ImageProcessingDirtyCallBack = (defines) => defines.markAsImageProcessingDirty();
Material._TextureDirtyCallBack = (defines) => defines.markAsTexturesDirty();
Material._FresnelDirtyCallBack = (defines) => defines.markAsFresnelDirty();
Material._MiscDirtyCallBack = (defines) => defines.markAsMiscDirty();
Material._PrePassDirtyCallBack = (defines) => defines.markAsPrePassDirty();
Material._LightsDirtyCallBack = (defines) => defines.markAsLightDirty();
Material._AttributeDirtyCallBack = (defines) => defines.markAsAttributesDirty();
Material._FresnelAndMiscDirtyCallBack = (defines) => {
    Material._FresnelDirtyCallBack(defines);
    Material._MiscDirtyCallBack(defines);
};
Material._TextureAndMiscDirtyCallBack = (defines) => {
    Material._TextureDirtyCallBack(defines);
    Material._MiscDirtyCallBack(defines);
};
Material._DirtyCallbackArray = [];
Material._RunDirtyCallBacks = (defines) => {
    for (const cb of Material._DirtyCallbackArray) {
        cb(defines);
    }
};
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "id", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "uniqueId", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "name", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "metadata", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "checkReadyOnEveryCall", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "checkReadyOnlyOnce", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "state", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("alpha")
], Material.prototype, "_alpha", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("backFaceCulling")
], Material.prototype, "_backFaceCulling", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("cullBackFaces")
], Material.prototype, "_cullBackFaces", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "sideOrientation", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("alphaMode")
], Material.prototype, "_alphaMode", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "_needDepthPrePass", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "disableDepthWrite", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "disableColorWrite", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "forceDepthWrite", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "depthFunction", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "separateCullingPass", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("fogEnabled")
], Material.prototype, "_fogEnabled", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "pointSize", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "zOffset", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "zOffsetUnits", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "pointsCloud", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "fillMode", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "useLogarithmicDepth", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], Material.prototype, "transparencyMode", null);
//# sourceMappingURL=material.js.map

/***/ }),

/***/ 79526:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   M: () => (/* binding */ MaterialDefines)
/* harmony export */ });
/**
 * Manages the defines for the Material
 */
class MaterialDefines {
    /**
     * Creates a new instance
     * @param externalProperties list of external properties to inject into the object
     */
    constructor(externalProperties) {
        /** @internal */
        this._keys = [];
        this._isDirty = true;
        /** @internal */
        this._areLightsDirty = true;
        /** @internal */
        this._areLightsDisposed = false;
        /** @internal */
        this._areAttributesDirty = true;
        /** @internal */
        this._areTexturesDirty = true;
        /** @internal */
        this._areFresnelDirty = true;
        /** @internal */
        this._areMiscDirty = true;
        /** @internal */
        this._arePrePassDirty = true;
        /** @internal */
        this._areImageProcessingDirty = true;
        /** @internal */
        this._normals = false;
        /** @internal */
        this._uvs = false;
        /** @internal */
        this._needNormals = false;
        /** @internal */
        this._needUVs = false;
        this._externalProperties = externalProperties;
        // Initialize External Properties
        if (externalProperties) {
            for (const prop in externalProperties) {
                if (Object.prototype.hasOwnProperty.call(externalProperties, prop)) {
                    this._setDefaultValue(prop);
                }
            }
        }
    }
    /**
     * Specifies if the material needs to be re-calculated
     */
    get isDirty() {
        return this._isDirty;
    }
    /**
     * Marks the material to indicate that it has been re-calculated
     */
    markAsProcessed() {
        this._isDirty = false;
        this._areAttributesDirty = false;
        this._areTexturesDirty = false;
        this._areFresnelDirty = false;
        this._areLightsDirty = false;
        this._areLightsDisposed = false;
        this._areMiscDirty = false;
        this._arePrePassDirty = false;
        this._areImageProcessingDirty = false;
    }
    /**
     * Marks the material to indicate that it needs to be re-calculated
     */
    markAsUnprocessed() {
        this._isDirty = true;
    }
    /**
     * Marks the material to indicate all of its defines need to be re-calculated
     */
    markAllAsDirty() {
        this._areTexturesDirty = true;
        this._areAttributesDirty = true;
        this._areLightsDirty = true;
        this._areFresnelDirty = true;
        this._areMiscDirty = true;
        this._arePrePassDirty = false;
        this._areImageProcessingDirty = true;
        this._isDirty = true;
    }
    /**
     * Marks the material to indicate that image processing needs to be re-calculated
     */
    markAsImageProcessingDirty() {
        this._areImageProcessingDirty = true;
        this._isDirty = true;
    }
    /**
     * Marks the material to indicate the lights need to be re-calculated
     * @param disposed Defines whether the light is dirty due to dispose or not
     */
    markAsLightDirty(disposed = false) {
        this._areLightsDirty = true;
        this._areLightsDisposed = this._areLightsDisposed || disposed;
        this._isDirty = true;
    }
    /**
     * Marks the attribute state as changed
     */
    markAsAttributesDirty() {
        this._areAttributesDirty = true;
        this._isDirty = true;
    }
    /**
     * Marks the texture state as changed
     */
    markAsTexturesDirty() {
        this._areTexturesDirty = true;
        this._isDirty = true;
    }
    /**
     * Marks the fresnel state as changed
     */
    markAsFresnelDirty() {
        this._areFresnelDirty = true;
        this._isDirty = true;
    }
    /**
     * Marks the misc state as changed
     */
    markAsMiscDirty() {
        this._areMiscDirty = true;
        this._isDirty = true;
    }
    /**
     * Marks the prepass state as changed
     */
    markAsPrePassDirty() {
        this._arePrePassDirty = true;
        this._isDirty = true;
    }
    /**
     * Rebuilds the material defines
     */
    rebuild() {
        this._keys.length = 0;
        for (const key of Object.keys(this)) {
            if (key[0] === "_") {
                continue;
            }
            this._keys.push(key);
        }
        if (this._externalProperties) {
            for (const name in this._externalProperties) {
                if (this._keys.indexOf(name) === -1) {
                    this._keys.push(name);
                }
            }
        }
    }
    /**
     * Specifies if two material defines are equal
     * @param other - A material define instance to compare to
     * @returns - Boolean indicating if the material defines are equal (true) or not (false)
     */
    isEqual(other) {
        if (this._keys.length !== other._keys.length) {
            return false;
        }
        for (let index = 0; index < this._keys.length; index++) {
            const prop = this._keys[index];
            if (this[prop] !== other[prop]) {
                return false;
            }
        }
        return true;
    }
    /**
     * Clones this instance's defines to another instance
     * @param other - material defines to clone values to
     */
    cloneTo(other) {
        if (this._keys.length !== other._keys.length) {
            other._keys = this._keys.slice(0);
        }
        for (let index = 0; index < this._keys.length; index++) {
            const prop = this._keys[index];
            other[prop] = this[prop];
        }
    }
    /**
     * Resets the material define values
     */
    reset() {
        this._keys.forEach((prop) => this._setDefaultValue(prop));
    }
    _setDefaultValue(prop) {
        const type = this._externalProperties?.[prop]?.type ?? typeof this[prop];
        const defValue = this._externalProperties?.[prop]?.default;
        switch (type) {
            case "number":
                this[prop] = defValue ?? 0;
                break;
            case "string":
                this[prop] = defValue ?? "";
                break;
            default:
                this[prop] = defValue ?? false;
                break;
        }
    }
    /**
     * Converts the material define values to a string
     * @returns - String of material define information
     */
    toString() {
        let result = "";
        for (let index = 0; index < this._keys.length; index++) {
            const prop = this._keys[index];
            const value = this[prop];
            const type = typeof value;
            switch (type) {
                case "number":
                case "string":
                    result += "#define " + prop + " " + value + "\n";
                    break;
                default:
                    if (value) {
                        result += "#define " + prop + "\n";
                    }
                    break;
            }
        }
        return result;
    }
}
//# sourceMappingURL=materialDefines.js.map

/***/ }),

/***/ 10633:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   h: () => (/* binding */ MaterialFlags)
/* harmony export */ });
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32206);


/**
 * This groups all the flags used to control the materials channel.
 */
class MaterialFlags {
    /**
     * Are diffuse textures enabled in the application.
     */
    static get DiffuseTextureEnabled() {
        return this._DiffuseTextureEnabled;
    }
    static set DiffuseTextureEnabled(value) {
        if (this._DiffuseTextureEnabled === value) {
            return;
        }
        this._DiffuseTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are detail textures enabled in the application.
     */
    static get DetailTextureEnabled() {
        return this._DetailTextureEnabled;
    }
    static set DetailTextureEnabled(value) {
        if (this._DetailTextureEnabled === value) {
            return;
        }
        this._DetailTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are decal maps enabled in the application.
     */
    static get DecalMapEnabled() {
        return this._DecalMapEnabled;
    }
    static set DecalMapEnabled(value) {
        if (this._DecalMapEnabled === value) {
            return;
        }
        this._DecalMapEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are ambient textures enabled in the application.
     */
    static get AmbientTextureEnabled() {
        return this._AmbientTextureEnabled;
    }
    static set AmbientTextureEnabled(value) {
        if (this._AmbientTextureEnabled === value) {
            return;
        }
        this._AmbientTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are opacity textures enabled in the application.
     */
    static get OpacityTextureEnabled() {
        return this._OpacityTextureEnabled;
    }
    static set OpacityTextureEnabled(value) {
        if (this._OpacityTextureEnabled === value) {
            return;
        }
        this._OpacityTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are reflection textures enabled in the application.
     */
    static get ReflectionTextureEnabled() {
        return this._ReflectionTextureEnabled;
    }
    static set ReflectionTextureEnabled(value) {
        if (this._ReflectionTextureEnabled === value) {
            return;
        }
        this._ReflectionTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are emissive textures enabled in the application.
     */
    static get EmissiveTextureEnabled() {
        return this._EmissiveTextureEnabled;
    }
    static set EmissiveTextureEnabled(value) {
        if (this._EmissiveTextureEnabled === value) {
            return;
        }
        this._EmissiveTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are specular textures enabled in the application.
     */
    static get SpecularTextureEnabled() {
        return this._SpecularTextureEnabled;
    }
    static set SpecularTextureEnabled(value) {
        if (this._SpecularTextureEnabled === value) {
            return;
        }
        this._SpecularTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are bump textures enabled in the application.
     */
    static get BumpTextureEnabled() {
        return this._BumpTextureEnabled;
    }
    static set BumpTextureEnabled(value) {
        if (this._BumpTextureEnabled === value) {
            return;
        }
        this._BumpTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are lightmap textures enabled in the application.
     */
    static get LightmapTextureEnabled() {
        return this._LightmapTextureEnabled;
    }
    static set LightmapTextureEnabled(value) {
        if (this._LightmapTextureEnabled === value) {
            return;
        }
        this._LightmapTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are refraction textures enabled in the application.
     */
    static get RefractionTextureEnabled() {
        return this._RefractionTextureEnabled;
    }
    static set RefractionTextureEnabled(value) {
        if (this._RefractionTextureEnabled === value) {
            return;
        }
        this._RefractionTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are color grading textures enabled in the application.
     */
    static get ColorGradingTextureEnabled() {
        return this._ColorGradingTextureEnabled;
    }
    static set ColorGradingTextureEnabled(value) {
        if (this._ColorGradingTextureEnabled === value) {
            return;
        }
        this._ColorGradingTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are fresnels enabled in the application.
     */
    static get FresnelEnabled() {
        return this._FresnelEnabled;
    }
    static set FresnelEnabled(value) {
        if (this._FresnelEnabled === value) {
            return;
        }
        this._FresnelEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(4);
    }
    /**
     * Are clear coat textures enabled in the application.
     */
    static get ClearCoatTextureEnabled() {
        return this._ClearCoatTextureEnabled;
    }
    static set ClearCoatTextureEnabled(value) {
        if (this._ClearCoatTextureEnabled === value) {
            return;
        }
        this._ClearCoatTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are clear coat bump textures enabled in the application.
     */
    static get ClearCoatBumpTextureEnabled() {
        return this._ClearCoatBumpTextureEnabled;
    }
    static set ClearCoatBumpTextureEnabled(value) {
        if (this._ClearCoatBumpTextureEnabled === value) {
            return;
        }
        this._ClearCoatBumpTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are clear coat tint textures enabled in the application.
     */
    static get ClearCoatTintTextureEnabled() {
        return this._ClearCoatTintTextureEnabled;
    }
    static set ClearCoatTintTextureEnabled(value) {
        if (this._ClearCoatTintTextureEnabled === value) {
            return;
        }
        this._ClearCoatTintTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are sheen textures enabled in the application.
     */
    static get SheenTextureEnabled() {
        return this._SheenTextureEnabled;
    }
    static set SheenTextureEnabled(value) {
        if (this._SheenTextureEnabled === value) {
            return;
        }
        this._SheenTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are anisotropic textures enabled in the application.
     */
    static get AnisotropicTextureEnabled() {
        return this._AnisotropicTextureEnabled;
    }
    static set AnisotropicTextureEnabled(value) {
        if (this._AnisotropicTextureEnabled === value) {
            return;
        }
        this._AnisotropicTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are thickness textures enabled in the application.
     */
    static get ThicknessTextureEnabled() {
        return this._ThicknessTextureEnabled;
    }
    static set ThicknessTextureEnabled(value) {
        if (this._ThicknessTextureEnabled === value) {
            return;
        }
        this._ThicknessTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are refraction intensity textures enabled in the application.
     */
    static get RefractionIntensityTextureEnabled() {
        return this._ThicknessTextureEnabled;
    }
    static set RefractionIntensityTextureEnabled(value) {
        if (this._RefractionIntensityTextureEnabled === value) {
            return;
        }
        this._RefractionIntensityTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are translucency intensity textures enabled in the application.
     */
    static get TranslucencyIntensityTextureEnabled() {
        return this._TranslucencyIntensityTextureEnabled;
    }
    static set TranslucencyIntensityTextureEnabled(value) {
        if (this._TranslucencyIntensityTextureEnabled === value) {
            return;
        }
        this._TranslucencyIntensityTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are translucency tint textures enabled in the application.
     */
    static get TranslucencyColorTextureEnabled() {
        return this._TranslucencyColorTextureEnabled;
    }
    static set TranslucencyColorTextureEnabled(value) {
        if (this._TranslucencyColorTextureEnabled === value) {
            return;
        }
        this._TranslucencyColorTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
    /**
     * Are translucency intensity textures enabled in the application.
     */
    static get IridescenceTextureEnabled() {
        return this._IridescenceTextureEnabled;
    }
    static set IridescenceTextureEnabled(value) {
        if (this._IridescenceTextureEnabled === value) {
            return;
        }
        this._IridescenceTextureEnabled = value;
        _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_0__/* .AbstractEngine */ .$.MarkAllMaterialsAsDirty(1);
    }
}
// Flags used to enable or disable a type of texture for all Standard Materials
MaterialFlags._DiffuseTextureEnabled = true;
MaterialFlags._DetailTextureEnabled = true;
MaterialFlags._DecalMapEnabled = true;
MaterialFlags._AmbientTextureEnabled = true;
MaterialFlags._OpacityTextureEnabled = true;
MaterialFlags._ReflectionTextureEnabled = true;
MaterialFlags._EmissiveTextureEnabled = true;
MaterialFlags._SpecularTextureEnabled = true;
MaterialFlags._BumpTextureEnabled = true;
MaterialFlags._LightmapTextureEnabled = true;
MaterialFlags._RefractionTextureEnabled = true;
MaterialFlags._ColorGradingTextureEnabled = true;
MaterialFlags._FresnelEnabled = true;
MaterialFlags._ClearCoatTextureEnabled = true;
MaterialFlags._ClearCoatBumpTextureEnabled = true;
MaterialFlags._ClearCoatTintTextureEnabled = true;
MaterialFlags._SheenTextureEnabled = true;
MaterialFlags._AnisotropicTextureEnabled = true;
MaterialFlags._ThicknessTextureEnabled = true;
MaterialFlags._RefractionIntensityTextureEnabled = true;
MaterialFlags._TranslucencyIntensityTextureEnabled = true;
MaterialFlags._TranslucencyColorTextureEnabled = true;
MaterialFlags._IridescenceTextureEnabled = true;
//# sourceMappingURL=materialFlags.js.map

/***/ }),

/***/ 80467:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Bb: () => (/* binding */ PrepareUniformsAndSamplersList),
/* harmony export */   DL: () => (/* binding */ BindLogDepth),
/* harmony export */   ER: () => (/* binding */ PrepareAttributesForInstances),
/* harmony export */   GD: () => (/* binding */ PrepareUniformsAndSamplersForLight),
/* harmony export */   IC: () => (/* binding */ PrepareDefinesForBones),
/* harmony export */   IF: () => (/* binding */ PrepareAttributesForMorphTargets),
/* harmony export */   J2: () => (/* binding */ PrepareAttributesForBakedVertexAnimation),
/* harmony export */   Jz: () => (/* binding */ PrepareDefinesForMorphTargets),
/* harmony export */   Kd: () => (/* binding */ BindLight),
/* harmony export */   L0: () => (/* binding */ BindLightProperties),
/* harmony export */   MF: () => (/* binding */ PrepareAttributesForMorphTargetsInfluencers),
/* harmony export */   N4: () => (/* binding */ PrepareDefinesForPrePass),
/* harmony export */   Nc: () => (/* binding */ PrepareDefinesForOIT),
/* harmony export */   OR: () => (/* binding */ PrepareDefinesForFrameBoundValues),
/* harmony export */   RL: () => (/* binding */ BindLights),
/* harmony export */   VO: () => (/* binding */ PrepareDefinesForMultiview),
/* harmony export */   Y7: () => (/* binding */ PrepareDefinesForCamera),
/* harmony export */   YT: () => (/* binding */ PrepareDefinesForMergedUV),
/* harmony export */   Yy: () => (/* binding */ BindFogParameters),
/* harmony export */   _8: () => (/* binding */ BindSceneUniformBuffer),
/* harmony export */   az: () => (/* binding */ PrepareDefinesForLights),
/* harmony export */   c4: () => (/* binding */ HandleFallbacksForShadows),
/* harmony export */   f$: () => (/* binding */ BindBonesParameters),
/* harmony export */   fm: () => (/* binding */ PrepareDefinesForMisc),
/* harmony export */   lo: () => (/* binding */ PrepareDefinesForLight),
/* harmony export */   mA: () => (/* binding */ BindTextureMatrix),
/* harmony export */   nR: () => (/* binding */ BindMorphTargetParameters),
/* harmony export */   ni: () => (/* binding */ PrepareAttributesForBones),
/* harmony export */   qB: () => (/* binding */ PrepareDefinesForAttributes),
/* harmony export */   qL: () => (/* binding */ GetFogState),
/* harmony export */   te: () => (/* binding */ PushAttributesForInstances),
/* harmony export */   wu: () => (/* binding */ PrepareDefinesForBakedVertexAnimation)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26041);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6315);
/* harmony import */ var _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75515);
/* harmony import */ var _clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30492);






// Temps
const _TempFogColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9.Black();
const _TmpMorphInfluencers = { NUM_MORPH_INFLUENCERS: 0 };
/**
 * Binds the logarithmic depth information from the scene to the effect for the given defines.
 * @param defines The generated defines used in the effect
 * @param effect The effect we are binding the data to
 * @param scene The scene we are willing to render with logarithmic scale for
 */
function BindLogDepth(defines, effect, scene) {
    if (!defines || defines["LOGARITHMICDEPTH"] || (defines.indexOf && defines.indexOf("LOGARITHMICDEPTH") >= 0)) {
        const camera = scene.activeCamera;
        if (camera.mode === 1) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("Logarithmic depth is not compatible with orthographic cameras!", 20);
        }
        effect.setFloat("logarithmicDepthConstant", 2.0 / (Math.log(camera.maxZ + 1.0) / Math.LN2));
    }
}
/**
 * Binds the fog information from the scene to the effect for the given mesh.
 * @param scene The scene the lights belongs to
 * @param mesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 * @param linearSpace Defines if the fog effect is applied in linear space
 */
function BindFogParameters(scene, mesh, effect, linearSpace = false) {
    if (effect && scene.fogEnabled && (!mesh || mesh.applyFog) && scene.fogMode !== 0) {
        effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity);
        // Convert fog color to linear space if used in a linear space computed shader.
        if (linearSpace) {
            scene.fogColor.toLinearSpaceToRef(_TempFogColor, scene.getEngine().useExactSrgbConversions);
            effect.setColor3("vFogColor", _TempFogColor);
        }
        else {
            effect.setColor3("vFogColor", scene.fogColor);
        }
    }
}
/**
 * Prepares the list of attributes required for morph targets according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare the morph targets attributes for
 * @param influencers The number of influencers
 */
function PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, influencers) {
    _TmpMorphInfluencers.NUM_MORPH_INFLUENCERS = influencers;
    PrepareAttributesForMorphTargets(attribs, mesh, _TmpMorphInfluencers);
}
/**
 * Prepares the list of attributes required for morph targets according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare the morph targets attributes for
 * @param defines The current Defines of the effect
 */
function PrepareAttributesForMorphTargets(attribs, mesh, defines) {
    const influencers = defines["NUM_MORPH_INFLUENCERS"];
    if (influencers > 0 && _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__/* .EngineStore */ .q.LastCreatedEngine) {
        const maxAttributesCount = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__/* .EngineStore */ .q.LastCreatedEngine.getCaps().maxVertexAttribs;
        const manager = mesh.morphTargetManager;
        if (manager?.isUsingTextureForTargets) {
            return;
        }
        const normal = manager && manager.supportsNormals && defines["NORMAL"];
        const tangent = manager && manager.supportsTangents && defines["TANGENT"];
        const uv = manager && manager.supportsUVs && defines["UV1"];
        for (let index = 0; index < influencers; index++) {
            attribs.push(`position` + index);
            if (normal) {
                attribs.push(`normal` + index);
            }
            if (tangent) {
                attribs.push(`tangent` + index);
            }
            if (uv) {
                attribs.push(`uv` + "_" + index);
            }
            if (attribs.length > maxAttributesCount) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("Cannot add more vertex attributes for mesh " + mesh.name);
            }
        }
    }
}
/**
 * Add the list of attributes required for instances to the attribs array.
 * @param attribs The current list of supported attribs
 * @param needsPreviousMatrices If the shader needs previous matrices
 */
function PushAttributesForInstances(attribs, needsPreviousMatrices = false) {
    attribs.push("world0");
    attribs.push("world1");
    attribs.push("world2");
    attribs.push("world3");
    if (needsPreviousMatrices) {
        attribs.push("previousWorld0");
        attribs.push("previousWorld1");
        attribs.push("previousWorld2");
        attribs.push("previousWorld3");
    }
}
/**
 * Binds the morph targets information from the mesh to the effect.
 * @param abstractMesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 */
function BindMorphTargetParameters(abstractMesh, effect) {
    const manager = abstractMesh.morphTargetManager;
    if (!abstractMesh || !manager) {
        return;
    }
    effect.setFloatArray("morphTargetInfluences", manager.influences);
}
/**
 * Binds the scene's uniform buffer to the effect.
 * @param effect defines the effect to bind to the scene uniform buffer
 * @param sceneUbo defines the uniform buffer storing scene data
 */
function BindSceneUniformBuffer(effect, sceneUbo) {
    sceneUbo.bindToEffect(effect, "Scene");
}
/**
 * Helps preparing the defines values about the UVs in used in the effect.
 * UVs are shared as much as we can across channels in the shaders.
 * @param texture The texture we are preparing the UVs for
 * @param defines The defines to update
 * @param key The channel key "diffuse", "specular"... used in the shader
 */
function PrepareDefinesForMergedUV(texture, defines, key) {
    defines._needUVs = true;
    defines[key] = true;
    if (texture.optimizeUVAllocation && texture.getTextureMatrix().isIdentityAs3x2()) {
        defines[key + "DIRECTUV"] = texture.coordinatesIndex + 1;
        defines["MAINUV" + (texture.coordinatesIndex + 1)] = true;
    }
    else {
        defines[key + "DIRECTUV"] = 0;
    }
}
/**
 * Binds a texture matrix value to its corresponding uniform
 * @param texture The texture to bind the matrix for
 * @param uniformBuffer The uniform buffer receiving the data
 * @param key The channel key "diffuse", "specular"... used in the shader
 */
function BindTextureMatrix(texture, uniformBuffer, key) {
    const matrix = texture.getTextureMatrix();
    uniformBuffer.updateMatrix(key + "Matrix", matrix);
}
/**
 * Prepares the list of attributes required for baked vertex animations according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare for baked vertex animations
 * @param defines The current Defines of the effect
 */
function PrepareAttributesForBakedVertexAnimation(attribs, mesh, defines) {
    const enabled = defines["BAKED_VERTEX_ANIMATION_TEXTURE"] && defines["INSTANCES"];
    if (enabled) {
        attribs.push("bakedVertexAnimationSettingsInstanced");
    }
}
// Copies the bones transformation matrices into the target array and returns the target's reference
function _CopyBonesTransformationMatrices(source, target) {
    target.set(source);
    return target;
}
/**
 * Binds the bones information from the mesh to the effect.
 * @param mesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 * @param prePassConfiguration Configuration for the prepass, in case prepass is activated
 */
function BindBonesParameters(mesh, effect, prePassConfiguration) {
    if (!effect || !mesh) {
        return;
    }
    if (mesh.computeBonesUsingShaders && effect._bonesComputationForcedToCPU) {
        mesh.computeBonesUsingShaders = false;
    }
    if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
        const skeleton = mesh.skeleton;
        if (skeleton.isUsingTextureForMatrices && effect.getUniformIndex("boneTextureWidth") > -1) {
            const boneTexture = skeleton.getTransformMatrixTexture(mesh);
            effect.setTexture("boneSampler", boneTexture);
            effect.setFloat("boneTextureWidth", 4.0 * (skeleton.bones.length + 1));
        }
        else {
            const matrices = skeleton.getTransformMatrices(mesh);
            if (matrices) {
                effect.setMatrices("mBones", matrices);
                if (prePassConfiguration && mesh.getScene().prePassRenderer && mesh.getScene().prePassRenderer.getIndex(2)) {
                    if (!prePassConfiguration.previousBones[mesh.uniqueId]) {
                        prePassConfiguration.previousBones[mesh.uniqueId] = matrices.slice();
                    }
                    effect.setMatrices("mPreviousBones", prePassConfiguration.previousBones[mesh.uniqueId]);
                    _CopyBonesTransformationMatrices(matrices, prePassConfiguration.previousBones[mesh.uniqueId]);
                }
            }
        }
    }
}
/**
 * Binds the light information to the effect.
 * @param light The light containing the generator
 * @param effect The effect we are binding the data to
 * @param lightIndex The light index in the effect used to render
 */
function BindLightProperties(light, effect, lightIndex) {
    light.transferToEffect(effect, lightIndex + "");
}
/**
 * Binds the lights information from the scene to the effect for the given mesh.
 * @param light Light to bind
 * @param lightIndex Light index
 * @param scene The scene where the light belongs to
 * @param effect The effect we are binding the data to
 * @param useSpecular Defines if specular is supported
 * @param receiveShadows Defines if the effect (mesh) we bind the light for receives shadows
 */
function BindLight(light, lightIndex, scene, effect, useSpecular, receiveShadows = true) {
    light._bindLight(lightIndex, scene, effect, useSpecular, receiveShadows);
}
/**
 * Binds the lights information from the scene to the effect for the given mesh.
 * @param scene The scene the lights belongs to
 * @param mesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 * @param defines The generated defines for the effect
 * @param maxSimultaneousLights The maximum number of light that can be bound to the effect
 */
function BindLights(scene, mesh, effect, defines, maxSimultaneousLights = 4) {
    const len = Math.min(mesh.lightSources.length, maxSimultaneousLights);
    for (let i = 0; i < len; i++) {
        const light = mesh.lightSources[i];
        BindLight(light, i, scene, effect, typeof defines === "boolean" ? defines : defines["SPECULARTERM"], mesh.receiveShadows);
    }
}
/**
 * Prepares the list of attributes required for bones according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare the bones attributes for
 * @param defines The current Defines of the effect
 * @param fallbacks The current effect fallback strategy
 */
function PrepareAttributesForBones(attribs, mesh, defines, fallbacks) {
    if (defines["NUM_BONE_INFLUENCERS"] > 0) {
        fallbacks.addCPUSkinningFallback(0, mesh);
        attribs.push(`matricesIndices`);
        attribs.push(`matricesWeights`);
        if (defines["NUM_BONE_INFLUENCERS"] > 4) {
            attribs.push(`matricesIndicesExtra`);
            attribs.push(`matricesWeightsExtra`);
        }
    }
}
/**
 * Check and prepare the list of attributes required for instances according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param defines The current MaterialDefines of the effect
 */
function PrepareAttributesForInstances(attribs, defines) {
    if (defines["INSTANCES"] || defines["THIN_INSTANCES"]) {
        PushAttributesForInstances(attribs, !!defines["PREPASS_VELOCITY"]);
    }
    if (defines.INSTANCESCOLOR) {
        attribs.push(`instanceColor`);
    }
}
/**
 * This helps decreasing rank by rank the shadow quality (0 being the highest rank and quality)
 * @param defines The defines to update while falling back
 * @param fallbacks The authorized effect fallbacks
 * @param maxSimultaneousLights The maximum number of lights allowed
 * @param rank the current rank of the Effect
 * @returns The newly affected rank
 */
function HandleFallbacksForShadows(defines, fallbacks, maxSimultaneousLights = 4, rank = 0) {
    let lightFallbackRank = 0;
    for (let lightIndex = 0; lightIndex < maxSimultaneousLights; lightIndex++) {
        if (!defines["LIGHT" + lightIndex]) {
            break;
        }
        if (lightIndex > 0) {
            lightFallbackRank = rank + lightIndex;
            fallbacks.addFallback(lightFallbackRank, "LIGHT" + lightIndex);
        }
        if (!defines["SHADOWS"]) {
            if (defines["SHADOW" + lightIndex]) {
                fallbacks.addFallback(rank, "SHADOW" + lightIndex);
            }
            if (defines["SHADOWPCF" + lightIndex]) {
                fallbacks.addFallback(rank, "SHADOWPCF" + lightIndex);
            }
            if (defines["SHADOWPCSS" + lightIndex]) {
                fallbacks.addFallback(rank, "SHADOWPCSS" + lightIndex);
            }
            if (defines["SHADOWPOISSON" + lightIndex]) {
                fallbacks.addFallback(rank, "SHADOWPOISSON" + lightIndex);
            }
            if (defines["SHADOWESM" + lightIndex]) {
                fallbacks.addFallback(rank, "SHADOWESM" + lightIndex);
            }
            if (defines["SHADOWCLOSEESM" + lightIndex]) {
                fallbacks.addFallback(rank, "SHADOWCLOSEESM" + lightIndex);
            }
        }
    }
    return lightFallbackRank++;
}
/**
 * Gets the current status of the fog (should it be enabled?)
 * @param mesh defines the mesh to evaluate for fog support
 * @param scene defines the hosting scene
 * @returns true if fog must be enabled
 */
function GetFogState(mesh, scene) {
    return scene.fogEnabled && mesh.applyFog && scene.fogMode !== 0;
}
/**
 * Helper used to prepare the list of defines associated with misc. values for shader compilation
 * @param mesh defines the current mesh
 * @param scene defines the current scene
 * @param useLogarithmicDepth defines if logarithmic depth has to be turned on
 * @param pointsCloud defines if point cloud rendering has to be turned on
 * @param fogEnabled defines if fog has to be turned on
 * @param alphaTest defines if alpha testing has to be turned on
 * @param defines defines the current list of defines
 * @param applyDecalAfterDetail Defines if the decal is applied after or before the detail
 */
function PrepareDefinesForMisc(mesh, scene, useLogarithmicDepth, pointsCloud, fogEnabled, alphaTest, defines, applyDecalAfterDetail = false) {
    if (defines._areMiscDirty) {
        defines["LOGARITHMICDEPTH"] = useLogarithmicDepth;
        defines["POINTSIZE"] = pointsCloud;
        defines["FOG"] = fogEnabled && GetFogState(mesh, scene);
        defines["NONUNIFORMSCALING"] = mesh.nonUniformScaling;
        defines["ALPHATEST"] = alphaTest;
        defines["DECAL_AFTER_DETAIL"] = applyDecalAfterDetail;
    }
}
/**
 * Prepares the defines related to the light information passed in parameter
 * @param scene The scene we are intending to draw
 * @param mesh The mesh the effect is compiling for
 * @param defines The defines to update
 * @param specularSupported Specifies whether specular is supported or not (override lights data)
 * @param maxSimultaneousLights Specifies how manuy lights can be added to the effect at max
 * @param disableLighting Specifies whether the lighting is disabled (override scene and light)
 * @returns true if normals will be required for the rest of the effect
 */
function PrepareDefinesForLights(scene, mesh, defines, specularSupported, maxSimultaneousLights = 4, disableLighting = false) {
    if (!defines._areLightsDirty) {
        return defines._needNormals;
    }
    let lightIndex = 0;
    const state = {
        needNormals: defines._needNormals, // prevents overriding previous reflection or other needs for normals
        needRebuild: false,
        lightmapMode: false,
        shadowEnabled: false,
        specularEnabled: false,
    };
    if (scene.lightsEnabled && !disableLighting) {
        for (const light of mesh.lightSources) {
            PrepareDefinesForLight(scene, mesh, light, lightIndex, defines, specularSupported, state);
            lightIndex++;
            if (lightIndex === maxSimultaneousLights) {
                break;
            }
        }
    }
    defines["SPECULARTERM"] = state.specularEnabled;
    defines["SHADOWS"] = state.shadowEnabled;
    // Resetting all other lights if any
    for (let index = lightIndex; index < maxSimultaneousLights; index++) {
        if (defines["LIGHT" + index] !== undefined) {
            defines["LIGHT" + index] = false;
            defines["HEMILIGHT" + index] = false;
            defines["POINTLIGHT" + index] = false;
            defines["DIRLIGHT" + index] = false;
            defines["SPOTLIGHT" + index] = false;
            defines["SHADOW" + index] = false;
            defines["SHADOWCSM" + index] = false;
            defines["SHADOWCSMDEBUG" + index] = false;
            defines["SHADOWCSMNUM_CASCADES" + index] = false;
            defines["SHADOWCSMUSESHADOWMAXZ" + index] = false;
            defines["SHADOWCSMNOBLEND" + index] = false;
            defines["SHADOWCSM_RIGHTHANDED" + index] = false;
            defines["SHADOWPCF" + index] = false;
            defines["SHADOWPCSS" + index] = false;
            defines["SHADOWPOISSON" + index] = false;
            defines["SHADOWESM" + index] = false;
            defines["SHADOWCLOSEESM" + index] = false;
            defines["SHADOWCUBE" + index] = false;
            defines["SHADOWLOWQUALITY" + index] = false;
            defines["SHADOWMEDIUMQUALITY" + index] = false;
        }
    }
    const caps = scene.getEngine().getCaps();
    if (defines["SHADOWFLOAT"] === undefined) {
        state.needRebuild = true;
    }
    defines["SHADOWFLOAT"] =
        state.shadowEnabled && ((caps.textureFloatRender && caps.textureFloatLinearFiltering) || (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering));
    defines["LIGHTMAPEXCLUDED"] = state.lightmapMode;
    if (state.needRebuild) {
        defines.rebuild();
    }
    return state.needNormals;
}
/**
 * Prepares the defines related to the light information passed in parameter
 * @param scene The scene we are intending to draw
 * @param mesh The mesh the effect is compiling for
 * @param light The light the effect is compiling for
 * @param lightIndex The index of the light
 * @param defines The defines to update
 * @param specularSupported Specifies whether specular is supported or not (override lights data)
 * @param state Defines the current state regarding what is needed (normals, etc...)
 * @param state.needNormals
 * @param state.needRebuild
 * @param state.shadowEnabled
 * @param state.specularEnabled
 * @param state.lightmapMode
 */
function PrepareDefinesForLight(scene, mesh, light, lightIndex, defines, specularSupported, state) {
    state.needNormals = true;
    if (defines["LIGHT" + lightIndex] === undefined) {
        state.needRebuild = true;
    }
    defines["LIGHT" + lightIndex] = true;
    defines["SPOTLIGHT" + lightIndex] = false;
    defines["HEMILIGHT" + lightIndex] = false;
    defines["POINTLIGHT" + lightIndex] = false;
    defines["DIRLIGHT" + lightIndex] = false;
    light.prepareLightSpecificDefines(defines, lightIndex);
    // FallOff.
    defines["LIGHT_FALLOFF_PHYSICAL" + lightIndex] = false;
    defines["LIGHT_FALLOFF_GLTF" + lightIndex] = false;
    defines["LIGHT_FALLOFF_STANDARD" + lightIndex] = false;
    switch (light.falloffType) {
        case _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_3__/* .LightConstants */ .c.FALLOFF_GLTF:
            defines["LIGHT_FALLOFF_GLTF" + lightIndex] = true;
            break;
        case _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_3__/* .LightConstants */ .c.FALLOFF_PHYSICAL:
            defines["LIGHT_FALLOFF_PHYSICAL" + lightIndex] = true;
            break;
        case _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_3__/* .LightConstants */ .c.FALLOFF_STANDARD:
            defines["LIGHT_FALLOFF_STANDARD" + lightIndex] = true;
            break;
    }
    // Specular
    if (specularSupported && !light.specular.equalsFloats(0, 0, 0)) {
        state.specularEnabled = true;
    }
    // Shadows
    defines["SHADOW" + lightIndex] = false;
    defines["SHADOWCSM" + lightIndex] = false;
    defines["SHADOWCSMDEBUG" + lightIndex] = false;
    defines["SHADOWCSMNUM_CASCADES" + lightIndex] = false;
    defines["SHADOWCSMUSESHADOWMAXZ" + lightIndex] = false;
    defines["SHADOWCSMNOBLEND" + lightIndex] = false;
    defines["SHADOWCSM_RIGHTHANDED" + lightIndex] = false;
    defines["SHADOWPCF" + lightIndex] = false;
    defines["SHADOWPCSS" + lightIndex] = false;
    defines["SHADOWPOISSON" + lightIndex] = false;
    defines["SHADOWESM" + lightIndex] = false;
    defines["SHADOWCLOSEESM" + lightIndex] = false;
    defines["SHADOWCUBE" + lightIndex] = false;
    defines["SHADOWLOWQUALITY" + lightIndex] = false;
    defines["SHADOWMEDIUMQUALITY" + lightIndex] = false;
    if (mesh && mesh.receiveShadows && scene.shadowsEnabled && light.shadowEnabled) {
        const shadowGenerator = light.getShadowGenerator(scene.activeCamera) ?? light.getShadowGenerator();
        if (shadowGenerator) {
            const shadowMap = shadowGenerator.getShadowMap();
            if (shadowMap) {
                if (shadowMap.renderList && shadowMap.renderList.length > 0) {
                    state.shadowEnabled = true;
                    shadowGenerator.prepareDefines(defines, lightIndex);
                }
            }
        }
    }
    if (light.lightmapMode != _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_3__/* .LightConstants */ .c.LIGHTMAP_DEFAULT) {
        state.lightmapMode = true;
        defines["LIGHTMAPEXCLUDED" + lightIndex] = true;
        defines["LIGHTMAPNOSPECULAR" + lightIndex] = light.lightmapMode == _Lights_lightConstants_js__WEBPACK_IMPORTED_MODULE_3__/* .LightConstants */ .c.LIGHTMAP_SHADOWSONLY;
    }
    else {
        defines["LIGHTMAPEXCLUDED" + lightIndex] = false;
        defines["LIGHTMAPNOSPECULAR" + lightIndex] = false;
    }
}
/**
 * Helper used to prepare the list of defines associated with frame values for shader compilation
 * @param scene defines the current scene
 * @param engine defines the current engine
 * @param material defines the material we are compiling the shader for
 * @param defines specifies the list of active defines
 * @param useInstances defines if instances have to be turned on
 * @param useClipPlane defines if clip plane have to be turned on
 * @param useThinInstances defines if thin instances have to be turned on
 */
function PrepareDefinesForFrameBoundValues(scene, engine, material, defines, useInstances, useClipPlane = null, useThinInstances = false) {
    let changed = PrepareDefinesForCamera(scene, defines);
    if (useClipPlane !== false) {
        changed = (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_4__/* .prepareDefinesForClipPlanes */ .Eq)(material, scene, defines);
    }
    if (defines["DEPTHPREPASS"] !== !engine.getColorWrite()) {
        defines["DEPTHPREPASS"] = !defines["DEPTHPREPASS"];
        changed = true;
    }
    if (defines["INSTANCES"] !== useInstances) {
        defines["INSTANCES"] = useInstances;
        changed = true;
    }
    if (defines["THIN_INSTANCES"] !== useThinInstances) {
        defines["THIN_INSTANCES"] = useThinInstances;
        changed = true;
    }
    if (changed) {
        defines.markAsUnprocessed();
    }
}
/**
 * Prepares the defines for bones
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 */
function PrepareDefinesForBones(mesh, defines) {
    if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
        defines["NUM_BONE_INFLUENCERS"] = mesh.numBoneInfluencers;
        const materialSupportsBoneTexture = defines["BONETEXTURE"] !== undefined;
        if (mesh.skeleton.isUsingTextureForMatrices && materialSupportsBoneTexture) {
            defines["BONETEXTURE"] = true;
        }
        else {
            defines["BonesPerMesh"] = mesh.skeleton.bones.length + 1;
            defines["BONETEXTURE"] = materialSupportsBoneTexture ? false : undefined;
            const prePassRenderer = mesh.getScene().prePassRenderer;
            if (prePassRenderer && prePassRenderer.enabled) {
                const nonExcluded = prePassRenderer.excludedSkinnedMesh.indexOf(mesh) === -1;
                defines["BONES_VELOCITY_ENABLED"] = nonExcluded;
            }
        }
    }
    else {
        defines["NUM_BONE_INFLUENCERS"] = 0;
        defines["BonesPerMesh"] = 0;
        if (defines["BONETEXTURE"] !== undefined) {
            defines["BONETEXTURE"] = false;
        }
    }
}
/**
 * Prepares the defines for morph targets
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 */
function PrepareDefinesForMorphTargets(mesh, defines) {
    const manager = mesh.morphTargetManager;
    if (manager) {
        defines["MORPHTARGETS_UV"] = manager.supportsUVs && defines["UV1"];
        defines["MORPHTARGETS_TANGENT"] = manager.supportsTangents && defines["TANGENT"];
        defines["MORPHTARGETS_NORMAL"] = manager.supportsNormals && defines["NORMAL"];
        defines["NUM_MORPH_INFLUENCERS"] = manager.numMaxInfluencers || manager.numInfluencers;
        defines["MORPHTARGETS"] = defines["NUM_MORPH_INFLUENCERS"] > 0;
        defines["MORPHTARGETS_TEXTURE"] = manager.isUsingTextureForTargets;
    }
    else {
        defines["MORPHTARGETS_UV"] = false;
        defines["MORPHTARGETS_TANGENT"] = false;
        defines["MORPHTARGETS_NORMAL"] = false;
        defines["MORPHTARGETS"] = false;
        defines["NUM_MORPH_INFLUENCERS"] = 0;
    }
}
/**
 * Prepares the defines for baked vertex animation
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 */
function PrepareDefinesForBakedVertexAnimation(mesh, defines) {
    const manager = mesh.bakedVertexAnimationManager;
    defines["BAKED_VERTEX_ANIMATION_TEXTURE"] = manager && manager.isEnabled ? true : false;
}
/**
 * Prepares the defines used in the shader depending on the attributes data available in the mesh
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 * @param useVertexColor Precise whether vertex colors should be used or not (override mesh info)
 * @param useBones Precise whether bones should be used or not (override mesh info)
 * @param useMorphTargets Precise whether morph targets should be used or not (override mesh info)
 * @param useVertexAlpha Precise whether vertex alpha should be used or not (override mesh info)
 * @param useBakedVertexAnimation Precise whether baked vertex animation should be used or not (override mesh info)
 * @returns false if defines are considered not dirty and have not been checked
 */
function PrepareDefinesForAttributes(mesh, defines, useVertexColor, useBones, useMorphTargets = false, useVertexAlpha = true, useBakedVertexAnimation = true) {
    if (!defines._areAttributesDirty && defines._needNormals === defines._normals && defines._needUVs === defines._uvs) {
        return false;
    }
    defines._normals = defines._needNormals;
    defines._uvs = defines._needUVs;
    defines["NORMAL"] = defines._needNormals && mesh.isVerticesDataPresent(`normal`);
    if (defines._needNormals && mesh.isVerticesDataPresent(`tangent`)) {
        defines["TANGENT"] = true;
    }
    for (let i = 1; i <= 6; ++i) {
        defines["UV" + i] = defines._needUVs ? mesh.isVerticesDataPresent(`uv${i === 1 ? "" : i}`) : false;
    }
    if (useVertexColor) {
        const hasVertexColors = mesh.useVertexColors && mesh.isVerticesDataPresent(`color`);
        defines["VERTEXCOLOR"] = hasVertexColors;
        defines["VERTEXALPHA"] = mesh.hasVertexAlpha && hasVertexColors && useVertexAlpha;
    }
    if (mesh.isVerticesDataPresent(`instanceColor`) && (mesh.hasInstances || mesh.hasThinInstances)) {
        defines["INSTANCESCOLOR"] = true;
    }
    if (useBones) {
        PrepareDefinesForBones(mesh, defines);
    }
    if (useMorphTargets) {
        PrepareDefinesForMorphTargets(mesh, defines);
    }
    if (useBakedVertexAnimation) {
        PrepareDefinesForBakedVertexAnimation(mesh, defines);
    }
    return true;
}
/**
 * Prepares the defines related to multiview
 * @param scene The scene we are intending to draw
 * @param defines The defines to update
 */
function PrepareDefinesForMultiview(scene, defines) {
    if (scene.activeCamera) {
        const previousMultiview = defines.MULTIVIEW;
        defines.MULTIVIEW = scene.activeCamera.outputRenderTarget !== null && scene.activeCamera.outputRenderTarget.getViewCount() > 1;
        if (defines.MULTIVIEW != previousMultiview) {
            defines.markAsUnprocessed();
        }
    }
}
/**
 * Prepares the defines related to order independant transparency
 * @param scene The scene we are intending to draw
 * @param defines The defines to update
 * @param needAlphaBlending Determines if the material needs alpha blending
 */
function PrepareDefinesForOIT(scene, defines, needAlphaBlending) {
    const previousDefine = defines.ORDER_INDEPENDENT_TRANSPARENCY;
    const previousDefine16Bits = defines.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;
    defines.ORDER_INDEPENDENT_TRANSPARENCY = scene.useOrderIndependentTransparency && needAlphaBlending;
    defines.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = !scene.getEngine().getCaps().textureFloatLinearFiltering;
    if (previousDefine !== defines.ORDER_INDEPENDENT_TRANSPARENCY || previousDefine16Bits !== defines.ORDER_INDEPENDENT_TRANSPARENCY_16BITS) {
        defines.markAsUnprocessed();
    }
}
/**
 * Prepares the defines related to the prepass
 * @param scene The scene we are intending to draw
 * @param defines The defines to update
 * @param canRenderToMRT Indicates if this material renders to several textures in the prepass
 */
function PrepareDefinesForPrePass(scene, defines, canRenderToMRT) {
    const previousPrePass = defines.PREPASS;
    if (!defines._arePrePassDirty) {
        return;
    }
    const texturesList = [
        {
            type: 1,
            define: "PREPASS_POSITION",
            index: "PREPASS_POSITION_INDEX",
        },
        {
            type: 9,
            define: "PREPASS_LOCAL_POSITION",
            index: "PREPASS_LOCAL_POSITION_INDEX",
        },
        {
            type: 2,
            define: "PREPASS_VELOCITY",
            index: "PREPASS_VELOCITY_INDEX",
        },
        {
            type: 11,
            define: "PREPASS_VELOCITY_LINEAR",
            index: "PREPASS_VELOCITY_LINEAR_INDEX",
        },
        {
            type: 3,
            define: "PREPASS_REFLECTIVITY",
            index: "PREPASS_REFLECTIVITY_INDEX",
        },
        {
            type: 0,
            define: "PREPASS_IRRADIANCE",
            index: "PREPASS_IRRADIANCE_INDEX",
        },
        {
            type: 7,
            define: "PREPASS_ALBEDO_SQRT",
            index: "PREPASS_ALBEDO_SQRT_INDEX",
        },
        {
            type: 5,
            define: "PREPASS_DEPTH",
            index: "PREPASS_DEPTH_INDEX",
        },
        {
            type: 10,
            define: "PREPASS_SCREENSPACE_DEPTH",
            index: "PREPASS_SCREENSPACE_DEPTH_INDEX",
        },
        {
            type: 6,
            define: "PREPASS_NORMAL",
            index: "PREPASS_NORMAL_INDEX",
        },
        {
            type: 8,
            define: "PREPASS_WORLD_NORMAL",
            index: "PREPASS_WORLD_NORMAL_INDEX",
        },
    ];
    if (scene.prePassRenderer && scene.prePassRenderer.enabled && canRenderToMRT) {
        defines.PREPASS = true;
        defines.SCENE_MRT_COUNT = scene.prePassRenderer.mrtCount;
        defines.PREPASS_NORMAL_WORLDSPACE = scene.prePassRenderer.generateNormalsInWorldSpace;
        defines.PREPASS_COLOR = true;
        defines.PREPASS_COLOR_INDEX = 0;
        for (let i = 0; i < texturesList.length; i++) {
            const index = scene.prePassRenderer.getIndex(texturesList[i].type);
            if (index !== -1) {
                defines[texturesList[i].define] = true;
                defines[texturesList[i].index] = index;
            }
            else {
                defines[texturesList[i].define] = false;
            }
        }
    }
    else {
        defines.PREPASS = false;
        for (let i = 0; i < texturesList.length; i++) {
            defines[texturesList[i].define] = false;
        }
    }
    if (defines.PREPASS != previousPrePass) {
        defines.markAsUnprocessed();
        defines.markAsImageProcessingDirty();
    }
}
/**
 * Helper used to prepare the defines relative to the active camera
 * @param scene defines the current scene
 * @param defines specifies the list of active defines
 * @returns true if the defines have been updated, else false
 */
function PrepareDefinesForCamera(scene, defines) {
    let changed = false;
    if (scene.activeCamera) {
        const wasOrtho = defines["CAMERA_ORTHOGRAPHIC"] ? 1 : 0;
        const wasPersp = defines["CAMERA_PERSPECTIVE"] ? 1 : 0;
        const isOrtho = scene.activeCamera.mode === 1 ? 1 : 0;
        const isPersp = scene.activeCamera.mode === 0 ? 1 : 0;
        if (wasOrtho ^ isOrtho || wasPersp ^ isPersp) {
            defines["CAMERA_ORTHOGRAPHIC"] = isOrtho === 1;
            defines["CAMERA_PERSPECTIVE"] = isPersp === 1;
            changed = true;
        }
    }
    return changed;
}
/**
 * Prepares the uniforms and samplers list to be used in the effect (for a specific light)
 * @param lightIndex defines the light index
 * @param uniformsList The uniform list
 * @param samplersList The sampler list
 * @param projectedLightTexture defines if projected texture must be used
 * @param uniformBuffersList defines an optional list of uniform buffers
 * @param updateOnlyBuffersList True to only update the uniformBuffersList array
 */
function PrepareUniformsAndSamplersForLight(lightIndex, uniformsList, samplersList, projectedLightTexture, uniformBuffersList = null, updateOnlyBuffersList = false) {
    if (uniformBuffersList) {
        uniformBuffersList.push("Light" + lightIndex);
    }
    if (updateOnlyBuffersList) {
        return;
    }
    uniformsList.push("vLightData" + lightIndex, "vLightDiffuse" + lightIndex, "vLightSpecular" + lightIndex, "vLightDirection" + lightIndex, "vLightFalloff" + lightIndex, "vLightGround" + lightIndex, "lightMatrix" + lightIndex, "shadowsInfo" + lightIndex, "depthValues" + lightIndex);
    samplersList.push("shadowTexture" + lightIndex);
    samplersList.push("depthTexture" + lightIndex);
    uniformsList.push("viewFrustumZ" + lightIndex, "cascadeBlendFactor" + lightIndex, "lightSizeUVCorrection" + lightIndex, "depthCorrection" + lightIndex, "penumbraDarkness" + lightIndex, "frustumLengths" + lightIndex);
    if (projectedLightTexture) {
        samplersList.push("projectionLightTexture" + lightIndex);
        uniformsList.push("textureProjectionMatrix" + lightIndex);
    }
}
/**
 * Prepares the uniforms and samplers list to be used in the effect
 * @param uniformsListOrOptions The uniform names to prepare or an EffectCreationOptions containing the list and extra information
 * @param samplersList The sampler list
 * @param defines The defines helping in the list generation
 * @param maxSimultaneousLights The maximum number of simultaneous light allowed in the effect
 */
function PrepareUniformsAndSamplersList(uniformsListOrOptions, samplersList, defines, maxSimultaneousLights = 4) {
    let uniformsList;
    let uniformBuffersList = null;
    if (uniformsListOrOptions.uniformsNames) {
        const options = uniformsListOrOptions;
        uniformsList = options.uniformsNames;
        uniformBuffersList = options.uniformBuffersNames;
        samplersList = options.samplers;
        defines = options.defines;
        maxSimultaneousLights = options.maxSimultaneousLights || 0;
    }
    else {
        uniformsList = uniformsListOrOptions;
        if (!samplersList) {
            samplersList = [];
        }
    }
    for (let lightIndex = 0; lightIndex < maxSimultaneousLights; lightIndex++) {
        if (!defines["LIGHT" + lightIndex]) {
            break;
        }
        PrepareUniformsAndSamplersForLight(lightIndex, uniformsList, samplersList, defines["PROJECTEDLIGHTTEXTURE" + lightIndex], uniformBuffersList);
    }
    if (defines["NUM_MORPH_INFLUENCERS"]) {
        uniformsList.push("morphTargetInfluences");
        uniformsList.push("morphTargetCount");
    }
    if (defines["BAKED_VERTEX_ANIMATION_TEXTURE"]) {
        uniformsList.push("bakedVertexAnimationSettings");
        uniformsList.push("bakedVertexAnimationTextureSizeInverted");
        uniformsList.push("bakedVertexAnimationTime");
        samplersList.push("bakedVertexAnimationTexture");
    }
}
//# sourceMappingURL=materialHelper.functions.js.map

/***/ }),

/***/ 18598:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (/* binding */ GeometryRenderingTextureClearType),
/* harmony export */   m: () => (/* binding */ MaterialHelperGeometryRendering)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);


/**
 * Type of clear operation to perform on a geometry texture.
 */
var GeometryRenderingTextureClearType;
(function (GeometryRenderingTextureClearType) {
    /**
     * Clear the texture with zero.
     */
    GeometryRenderingTextureClearType[GeometryRenderingTextureClearType["Zero"] = 0] = "Zero";
    /**
     * Clear the texture with one.
     */
    GeometryRenderingTextureClearType[GeometryRenderingTextureClearType["One"] = 1] = "One";
    /**
     * Clear the texture with the maximum view Z value.
     */
    GeometryRenderingTextureClearType[GeometryRenderingTextureClearType["MaxViewZ"] = 2] = "MaxViewZ";
})(GeometryRenderingTextureClearType || (GeometryRenderingTextureClearType = {}));
/**
 * Helper class to manage geometry rendering.
 */
class MaterialHelperGeometryRendering {
    /**
     * Creates a new geometry rendering configuration.
     * @param renderPassId Render pass id the configuration is created for.
     * @returns The created configuration.
     */
    static CreateConfiguration(renderPassId) {
        MaterialHelperGeometryRendering._Configurations[renderPassId] = {
            defines: {},
            previousWorldMatrices: {},
            previousViewProjection: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Zero(),
            currentViewProjection: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Zero(),
            previousBones: {},
            lastUpdateFrameId: -1,
            excludedSkinnedMesh: [],
        };
        return MaterialHelperGeometryRendering._Configurations[renderPassId];
    }
    /**
     * Deletes a geometry rendering configuration.
     * @param renderPassId The render pass id of the configuration to delete.
     */
    static DeleteConfiguration(renderPassId) {
        delete MaterialHelperGeometryRendering._Configurations[renderPassId];
    }
    /**
     * Gets a geometry rendering configuration.
     * @param renderPassId The render pass id of the configuration to get.
     * @returns The configuration.
     */
    static GetConfiguration(renderPassId) {
        return MaterialHelperGeometryRendering._Configurations[renderPassId];
    }
    /**
     * Adds uniforms and samplers for geometry rendering.
     * @param uniforms The array of uniforms to add to.
     * @param _samplers The array of samplers to add to.
     */
    static AddUniformsAndSamplers(uniforms, _samplers) {
        uniforms.push("previousWorld", "previousViewProjection", "mPreviousBones");
    }
    /**
     * Marks a list of meshes as dirty for geometry rendering.
     * @param renderPassId The render pass id the meshes are marked as dirty for.
     * @param meshes The list of meshes to mark as dirty.
     */
    static MarkAsDirty(renderPassId, meshes) {
        for (const mesh of meshes) {
            if (!mesh.subMeshes) {
                continue;
            }
            for (const subMesh of mesh.subMeshes) {
                subMesh._removeDrawWrapper(renderPassId);
            }
        }
    }
    /**
     * Prepares defines for geometry rendering.
     * @param renderPassId The render pass id the defines are prepared for.
     * @param mesh The mesh the defines are prepared for.
     * @param defines The defines to update according to the geometry rendering configuration.
     */
    static PrepareDefines(renderPassId, mesh, defines) {
        if (!defines._arePrePassDirty) {
            return;
        }
        const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];
        if (!configuration) {
            return;
        }
        defines["PREPASS"] = true;
        defines["PREPASS_COLOR"] = false;
        defines["PREPASS_COLOR_INDEX"] = -1;
        let numMRT = 0;
        for (let i = 0; i < MaterialHelperGeometryRendering.GeometryTextureDescriptions.length; i++) {
            const geometryTextureDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[i];
            const defineName = geometryTextureDescription.define;
            const defineIndex = geometryTextureDescription.defineIndex;
            const index = configuration.defines[defineIndex];
            if (index !== undefined) {
                defines[defineName] = true;
                defines[defineIndex] = index;
                numMRT++;
            }
            else {
                defines[defineName] = false;
                delete defines[defineIndex];
            }
        }
        defines["SCENE_MRT_COUNT"] = numMRT;
        defines["BONES_VELOCITY_ENABLED"] =
            mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton && !mesh.skeleton.isUsingTextureForMatrices && configuration.excludedSkinnedMesh.indexOf(mesh) === -1;
    }
    /**
     * Binds geometry rendering data for a mesh.
     * @param renderPassId The render pass id the geometry rendering data is bound for.
     * @param effect The effect to bind the geometry rendering data to.
     * @param mesh The mesh to bind the geometry rendering data for.
     * @param world The world matrix of the mesh.
     */
    static Bind(renderPassId, effect, mesh, world) {
        const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];
        if (!configuration) {
            return;
        }
        if (configuration.defines["PREPASS_VELOCITY_INDEX"] !== undefined || configuration.defines["PREPASS_VELOCITY_LINEAR_INDEX"] !== undefined) {
            if (!configuration.previousWorldMatrices[mesh.uniqueId]) {
                configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();
            }
            const scene = mesh.getScene();
            if (!configuration.previousViewProjection) {
                configuration.previousViewProjection = scene.getTransformMatrix().clone();
                configuration.currentViewProjection = scene.getTransformMatrix().clone();
            }
            const engine = scene.getEngine();
            if (configuration.currentViewProjection.updateFlag !== scene.getTransformMatrix().updateFlag) {
                // First update of the prepass configuration for this rendering pass
                configuration.lastUpdateFrameId = engine.frameId;
                configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);
                configuration.currentViewProjection.copyFrom(scene.getTransformMatrix());
            }
            else if (configuration.lastUpdateFrameId !== engine.frameId) {
                // The scene transformation did not change from the previous frame (so no camera motion), we must update previousViewProjection accordingly
                configuration.lastUpdateFrameId = engine.frameId;
                configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);
            }
            effect.setMatrix("previousWorld", configuration.previousWorldMatrices[mesh.uniqueId]);
            effect.setMatrix("previousViewProjection", configuration.previousViewProjection);
            configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();
            if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
                const skeleton = mesh.skeleton;
                if (!skeleton.isUsingTextureForMatrices || effect.getUniformIndex("boneTextureWidth") === -1) {
                    const matrices = skeleton.getTransformMatrices(mesh);
                    if (matrices) {
                        if (!configuration.previousBones[mesh.uniqueId]) {
                            configuration.previousBones[mesh.uniqueId] = matrices.slice();
                        }
                        effect.setMatrices("mPreviousBones", configuration.previousBones[mesh.uniqueId]);
                        configuration.previousBones[mesh.uniqueId].set(matrices);
                    }
                }
            }
        }
    }
}
/**
 * Descriptions of the geometry textures.
 */
MaterialHelperGeometryRendering.GeometryTextureDescriptions = [
    {
        type: 0,
        name: "Irradiance",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_IRRADIANCE",
        defineIndex: "PREPASS_IRRADIANCE_INDEX",
    },
    {
        type: 1,
        name: "WorldPosition",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_POSITION",
        defineIndex: "PREPASS_POSITION_INDEX",
    },
    {
        type: 2,
        name: "Velocity",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_VELOCITY",
        defineIndex: "PREPASS_VELOCITY_INDEX",
    },
    {
        type: 3,
        name: "Reflectivity",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_REFLECTIVITY",
        defineIndex: "PREPASS_REFLECTIVITY_INDEX",
    },
    {
        type: 5,
        name: "ViewDepth",
        clearType: 2 /* GeometryRenderingTextureClearType.MaxViewZ */,
        define: "PREPASS_DEPTH",
        defineIndex: "PREPASS_DEPTH_INDEX",
    },
    {
        type: 6,
        name: "ViewNormal",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_NORMAL",
        defineIndex: "PREPASS_NORMAL_INDEX",
    },
    {
        type: 7,
        name: "AlbedoSqrt",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_ALBEDO_SQRT",
        defineIndex: "PREPASS_ALBEDO_SQRT_INDEX",
    },
    {
        type: 8,
        name: "WorldNormal",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_WORLD_NORMAL",
        defineIndex: "PREPASS_WORLD_NORMAL_INDEX",
    },
    {
        type: 9,
        name: "LocalPosition",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_LOCAL_POSITION",
        defineIndex: "PREPASS_LOCAL_POSITION_INDEX",
    },
    {
        type: 10,
        name: "ScreenDepth",
        clearType: 1 /* GeometryRenderingTextureClearType.One */,
        define: "PREPASS_SCREENSPACE_DEPTH",
        defineIndex: "PREPASS_SCREENSPACE_DEPTH_INDEX",
    },
    {
        type: 11,
        name: "LinearVelocity",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_VELOCITY_LINEAR",
        defineIndex: "PREPASS_VELOCITY_LINEAR_INDEX",
    },
    {
        type: 12,
        name: "Albedo",
        clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
        define: "PREPASS_ALBEDO",
        defineIndex: "PREPASS_ALBEDO_INDEX",
    },
];
MaterialHelperGeometryRendering._Configurations = {};
//# sourceMappingURL=materialHelper.geometryrendering.js.map

/***/ }),

/***/ 50074:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   y: () => (/* binding */ MaterialPluginBase)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _materialPluginManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83040);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26877);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56552);






/**
 * Base class for material plugins.
 * @since 5.0
 */
class MaterialPluginBase {
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @param shaderLanguage The shader language to use.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible(shaderLanguage) {
        switch (shaderLanguage) {
            case 0 /* ShaderLanguage.GLSL */:
                return true;
            default:
                return false;
        }
    }
    _enable(enable) {
        if (enable) {
            this._pluginManager._activatePlugin(this);
        }
    }
    /**
     * Creates a new material plugin
     * @param material parent material of the plugin
     * @param name name of the plugin
     * @param priority priority of the plugin
     * @param defines list of defines used by the plugin. The value of the property is the default value for this property
     * @param addToPluginList true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)
     * @param enable true to enable the plugin (it is handy if the plugin does not handle properties to switch its current activation)
     * @param resolveIncludes Indicates that any #include directive in the plugin code must be replaced by the corresponding code (default: false)
     */
    constructor(material, name, priority, defines, addToPluginList = true, enable = false, resolveIncludes = false) {
        /**
         * Defines the priority of the plugin. Lower numbers run first.
         */
        this.priority = 500;
        /**
         * Indicates that any #include directive in the plugin code must be replaced by the corresponding code.
         */
        this.resolveIncludes = false;
        /**
         * Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
         */
        this.registerForExtraEvents = false;
        this._material = material;
        this.name = name;
        this.priority = priority;
        this.resolveIncludes = resolveIncludes;
        if (!material.pluginManager) {
            material.pluginManager = new _materialPluginManager_js__WEBPACK_IMPORTED_MODULE_2__/* .MaterialPluginManager */ .uZ(material);
            material.onDisposeObservable.add(() => {
                material.pluginManager = undefined;
            });
        }
        this._pluginDefineNames = defines;
        this._pluginManager = material.pluginManager;
        if (addToPluginList) {
            this._pluginManager._addPlugin(this);
        }
        if (enable) {
            this._enable(true);
        }
        this.markAllDefinesAsDirty = material._dirtyCallbacks[63];
    }
    /**
     * Gets the current class name useful for serialization or dynamic coding.
     * @returns The class name.
     */
    getClassName() {
        return "MaterialPluginBase";
    }
    /**
     * Specifies that the submesh is ready to be used.
     * @param _defines the list of "defines" to update.
     * @param _scene defines the scene the material belongs to.
     * @param _engine the engine this scene belongs to.
     * @param _subMesh the submesh to check for readiness
     * @returns - boolean indicating that the submesh is ready or not.
     */
    isReadyForSubMesh(_defines, _scene, _engine, _subMesh) {
        return true;
    }
    /**
     * Binds the material data (this function is called even if mustRebind() returns false)
     * @param _uniformBuffer defines the Uniform buffer to fill in.
     * @param _scene defines the scene the material belongs to.
     * @param _engine defines the engine the material belongs to.
     * @param _subMesh the submesh to bind data for
     */
    hardBindForSubMesh(_uniformBuffer, _scene, _engine, _subMesh) { }
    /**
     * Binds the material data.
     * @param _uniformBuffer defines the Uniform buffer to fill in.
     * @param _scene defines the scene the material belongs to.
     * @param _engine the engine this scene belongs to.
     * @param _subMesh the submesh to bind data for
     */
    bindForSubMesh(_uniformBuffer, _scene, _engine, _subMesh) { }
    /**
     * Disposes the resources of the material.
     * @param _forceDisposeTextures - Forces the disposal of all textures.
     */
    dispose(_forceDisposeTextures) { }
    /**
     * Returns a list of custom shader code fragments to customize the shader.
     * @param _shaderType "vertex" or "fragment"
     * @param _shaderLanguage The shader language to use.
     * @returns null if no code to be added, or a list of pointName =\> code.
     * Note that `pointName` can also be a regular expression if it starts with a `!`.
     * In that case, the string found by the regular expression (if any) will be
     * replaced by the code provided.
     */
    getCustomCode(_shaderType, _shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        return null;
    }
    /**
     * Collects all defines.
     * @param defines The object to append to.
     */
    collectDefines(defines) {
        if (!this._pluginDefineNames) {
            return;
        }
        for (const key of Object.keys(this._pluginDefineNames)) {
            if (key[0] === "_") {
                continue;
            }
            const type = typeof this._pluginDefineNames[key];
            defines[key] = {
                type: type === "number" ? "number" : type === "string" ? "string" : type === "boolean" ? "boolean" : "object",
                default: this._pluginDefineNames[key],
            };
        }
    }
    /**
     * Sets the defines for the next rendering. Called before PrepareDefinesForAttributes is called.
     * @param _defines the list of "defines" to update.
     * @param _scene defines the scene to the material belongs to.
     * @param _mesh the mesh being rendered
     */
    prepareDefinesBeforeAttributes(_defines, _scene, _mesh) { }
    /**
     * Sets the defines for the next rendering
     * @param _defines the list of "defines" to update.
     * @param _scene defines the scene to the material belongs to.
     * @param _mesh the mesh being rendered
     */
    prepareDefines(_defines, _scene, _mesh) { }
    /**
     * Checks to see if a texture is used in the material.
     * @param _texture - Base texture to use.
     * @returns - Boolean specifying if a texture is used in the material.
     */
    hasTexture(_texture) {
        return false;
    }
    /**
     * Gets a boolean indicating that current material needs to register RTT
     * @returns true if this uses a render target otherwise false.
     */
    hasRenderTargetTextures() {
        return false;
    }
    /**
     * Fills the list of render target textures.
     * @param _renderTargets the list of render targets to update
     */
    fillRenderTargetTextures(_renderTargets) { }
    /**
     * Returns an array of the actively used textures.
     * @param _activeTextures Array of BaseTextures
     */
    getActiveTextures(_activeTextures) { }
    /**
     * Returns the animatable textures.
     * @param _animatables Array of animatable textures.
     */
    getAnimatables(_animatables) { }
    /**
     * Add fallbacks to the effect fallbacks list.
     * @param defines defines the Base texture to use.
     * @param fallbacks defines the current fallback list.
     * @param currentRank defines the current fallback rank.
     * @returns the new fallback rank.
     */
    addFallbacks(defines, fallbacks, currentRank) {
        return currentRank;
    }
    /**
     * Gets the samplers used by the plugin.
     * @param _samplers list that the sampler names should be added to.
     */
    getSamplers(_samplers) { }
    /**
     * Gets the attributes used by the plugin.
     * @param _attributes list that the attribute names should be added to.
     * @param _scene the scene that the material belongs to.
     * @param _mesh the mesh being rendered.
     */
    getAttributes(_attributes, _scene, _mesh) { }
    /**
     * Gets the uniform buffers names added by the plugin.
     * @param _ubos list that the ubo names should be added to.
     */
    getUniformBuffersNames(_ubos) { }
    /**
     * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)
     * @param _shaderLanguage The shader language to use.
     * @returns the description of the uniforms
     */
    getUniforms(_shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        return {};
    }
    /**
     * Makes a duplicate of the current configuration into another one.
     * @param plugin define the config where to copy the info
     */
    copyTo(plugin) {
        _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper */ .p.Clone(() => plugin, this);
    }
    /**
     * Serializes this plugin configuration.
     * @returns - An object with the serialized config.
     */
    serialize() {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper */ .p.Serialize(this);
    }
    /**
     * Parses a plugin configuration from a serialized object.
     * @param source - Serialized object.
     * @param scene Defines the scene we are parsing for
     * @param rootUrl Defines the rootUrl to load from
     */
    parse(source, scene, rootUrl) {
        _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper */ .p.Parse(() => this, source, scene, rootUrl);
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], MaterialPluginBase.prototype, "name", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], MaterialPluginBase.prototype, "priority", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], MaterialPluginBase.prototype, "resolveIncludes", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], MaterialPluginBase.prototype, "registerForExtraEvents", void 0);
// Register Class Name
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_4__/* .RegisterClass */ .Y5)("BABYLON.MaterialPluginBase", MaterialPluginBase);
//# sourceMappingURL=materialPluginBase.js.map

/***/ }),

/***/ 83040:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   YC: () => (/* binding */ RegisterMaterialPlugin),
/* harmony export */   lM: () => (/* binding */ UnregisterMaterialPlugin),
/* harmony export */   tC: () => (/* binding */ UnregisterAllMaterialPlugins),
/* harmony export */   uZ: () => (/* binding */ MaterialPluginManager)
/* harmony export */ });
/* harmony import */ var _material_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28986);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6315);
/* harmony import */ var _Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(19125);
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69610);




const rxOption = new RegExp("^([gimus]+)!");
/**
 * Class that manages the plugins of a material
 * @since 5.0
 */
class MaterialPluginManager {
    /**
     * Creates a new instance of the plugin manager
     * @param material material that this manager will manage the plugins for
     */
    constructor(material) {
        /** @internal */
        this._plugins = [];
        this._activePlugins = [];
        this._activePluginsForExtraEvents = [];
        this._material = material;
        this._scene = material.getScene();
        this._engine = this._scene.getEngine();
    }
    /**
     * @internal
     */
    _addPlugin(plugin) {
        for (let i = 0; i < this._plugins.length; ++i) {
            if (this._plugins[i].name === plugin.name) {
                return false;
            }
        }
        if (this._material._uniformBufferLayoutBuilt) {
            this._material.resetDrawCache();
            this._material._createUniformBuffer();
        }
        if (!plugin.isCompatible(this._material.shaderLanguage)) {
            // eslint-disable-next-line no-throw-literal
            throw `The plugin "${plugin.name}" can't be added to the material "${this._material.name}" because the plugin is not compatible with the shader language of the material.`;
        }
        const pluginClassName = plugin.getClassName();
        if (!MaterialPluginManager._MaterialPluginClassToMainDefine[pluginClassName]) {
            MaterialPluginManager._MaterialPluginClassToMainDefine[pluginClassName] = "MATERIALPLUGIN_" + ++MaterialPluginManager._MaterialPluginCounter;
        }
        this._material._callbackPluginEventGeneric = (id, info) => this._handlePluginEvent(id, info);
        this._plugins.push(plugin);
        this._plugins.sort((a, b) => a.priority - b.priority);
        this._codeInjectionPoints = {};
        const defineNamesFromPlugins = {};
        defineNamesFromPlugins[MaterialPluginManager._MaterialPluginClassToMainDefine[pluginClassName]] = {
            type: "boolean",
            default: true,
        };
        for (const plugin of this._plugins) {
            plugin.collectDefines(defineNamesFromPlugins);
            this._collectPointNames("vertex", plugin.getCustomCode("vertex", this._material.shaderLanguage));
            this._collectPointNames("fragment", plugin.getCustomCode("fragment", this._material.shaderLanguage));
        }
        this._defineNamesFromPlugins = defineNamesFromPlugins;
        return true;
    }
    /**
     * @internal
     */
    _activatePlugin(plugin) {
        if (this._activePlugins.indexOf(plugin) === -1) {
            this._activePlugins.push(plugin);
            this._activePlugins.sort((a, b) => a.priority - b.priority);
            this._material._callbackPluginEventIsReadyForSubMesh = this._handlePluginEventIsReadyForSubMesh.bind(this);
            this._material._callbackPluginEventPrepareDefinesBeforeAttributes = this._handlePluginEventPrepareDefinesBeforeAttributes.bind(this);
            this._material._callbackPluginEventPrepareDefines = this._handlePluginEventPrepareDefines.bind(this);
            this._material._callbackPluginEventBindForSubMesh = this._handlePluginEventBindForSubMesh.bind(this);
            if (plugin.registerForExtraEvents) {
                this._activePluginsForExtraEvents.push(plugin);
                this._activePluginsForExtraEvents.sort((a, b) => a.priority - b.priority);
                this._material._callbackPluginEventHasRenderTargetTextures = this._handlePluginEventHasRenderTargetTextures.bind(this);
                this._material._callbackPluginEventFillRenderTargetTextures = this._handlePluginEventFillRenderTargetTextures.bind(this);
                this._material._callbackPluginEventHardBindForSubMesh = this._handlePluginEventHardBindForSubMesh.bind(this);
            }
        }
    }
    /**
     * Gets a plugin from the list of plugins managed by this manager
     * @param name name of the plugin
     * @returns the plugin if found, else null
     */
    getPlugin(name) {
        for (let i = 0; i < this._plugins.length; ++i) {
            if (this._plugins[i].name === name) {
                return this._plugins[i];
            }
        }
        return null;
    }
    _handlePluginEventIsReadyForSubMesh(eventData) {
        let isReady = true;
        for (const plugin of this._activePlugins) {
            isReady = isReady && plugin.isReadyForSubMesh(eventData.defines, this._scene, this._engine, eventData.subMesh);
        }
        eventData.isReadyForSubMesh = isReady;
    }
    _handlePluginEventPrepareDefinesBeforeAttributes(eventData) {
        for (const plugin of this._activePlugins) {
            plugin.prepareDefinesBeforeAttributes(eventData.defines, this._scene, eventData.mesh);
        }
    }
    _handlePluginEventPrepareDefines(eventData) {
        for (const plugin of this._activePlugins) {
            plugin.prepareDefines(eventData.defines, this._scene, eventData.mesh);
        }
    }
    _handlePluginEventHardBindForSubMesh(eventData) {
        for (const plugin of this._activePluginsForExtraEvents) {
            plugin.hardBindForSubMesh(this._material._uniformBuffer, this._scene, this._engine, eventData.subMesh);
        }
    }
    _handlePluginEventBindForSubMesh(eventData) {
        for (const plugin of this._activePlugins) {
            plugin.bindForSubMesh(this._material._uniformBuffer, this._scene, this._engine, eventData.subMesh);
        }
    }
    _handlePluginEventHasRenderTargetTextures(eventData) {
        let hasRenderTargetTextures = false;
        for (const plugin of this._activePluginsForExtraEvents) {
            hasRenderTargetTextures = plugin.hasRenderTargetTextures();
            if (hasRenderTargetTextures) {
                break;
            }
        }
        eventData.hasRenderTargetTextures = hasRenderTargetTextures;
    }
    _handlePluginEventFillRenderTargetTextures(eventData) {
        for (const plugin of this._activePluginsForExtraEvents) {
            plugin.fillRenderTargetTextures(eventData.renderTargets);
        }
    }
    _handlePluginEvent(id, info) {
        switch (id) {
            case 512 /* MaterialPluginEvent.GetActiveTextures */: {
                const eventData = info;
                for (const plugin of this._activePlugins) {
                    plugin.getActiveTextures(eventData.activeTextures);
                }
                break;
            }
            case 256 /* MaterialPluginEvent.GetAnimatables */: {
                const eventData = info;
                for (const plugin of this._activePlugins) {
                    plugin.getAnimatables(eventData.animatables);
                }
                break;
            }
            case 1024 /* MaterialPluginEvent.HasTexture */: {
                const eventData = info;
                let hasTexture = false;
                for (const plugin of this._activePlugins) {
                    hasTexture = plugin.hasTexture(eventData.texture);
                    if (hasTexture) {
                        break;
                    }
                }
                eventData.hasTexture = hasTexture;
                break;
            }
            case 2 /* MaterialPluginEvent.Disposed */: {
                const eventData = info;
                for (const plugin of this._plugins) {
                    plugin.dispose(eventData.forceDisposeTextures);
                }
                break;
            }
            case 4 /* MaterialPluginEvent.GetDefineNames */: {
                const eventData = info;
                eventData.defineNames = this._defineNamesFromPlugins;
                break;
            }
            case 128 /* MaterialPluginEvent.PrepareEffect */: {
                const eventData = info;
                for (const plugin of this._activePlugins) {
                    eventData.fallbackRank = plugin.addFallbacks(eventData.defines, eventData.fallbacks, eventData.fallbackRank);
                    plugin.getAttributes(eventData.attributes, this._scene, eventData.mesh);
                }
                if (this._uniformList.length > 0) {
                    eventData.uniforms.push(...this._uniformList);
                }
                if (this._samplerList.length > 0) {
                    eventData.samplers.push(...this._samplerList);
                }
                if (this._uboList.length > 0) {
                    eventData.uniformBuffersNames.push(...this._uboList);
                }
                eventData.customCode = this._injectCustomCode(eventData, eventData.customCode);
                break;
            }
            case 8 /* MaterialPluginEvent.PrepareUniformBuffer */: {
                const eventData = info;
                this._uboDeclaration = "";
                this._vertexDeclaration = "";
                this._fragmentDeclaration = "";
                this._uniformList = [];
                this._samplerList = [];
                this._uboList = [];
                const isWebGPU = this._material.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
                for (const plugin of this._plugins) {
                    const uniforms = plugin.getUniforms(this._material.shaderLanguage);
                    if (uniforms) {
                        if (uniforms.ubo) {
                            for (const uniform of uniforms.ubo) {
                                if (uniform.size && uniform.type) {
                                    const arraySize = uniform.arraySize ?? 0;
                                    eventData.ubo.addUniform(uniform.name, uniform.size, arraySize);
                                    if (isWebGPU) {
                                        let type;
                                        switch (uniform.type) {
                                            case "mat4":
                                                type = "mat4x4f";
                                                break;
                                            case "float":
                                                type = "f32";
                                                break;
                                            default:
                                                type = `${uniform.type}f`;
                                                break;
                                        }
                                        this._uboDeclaration += `uniform ${uniform.name}: ${type}${arraySize > 0 ? `[${arraySize}]` : ""};\n`;
                                    }
                                    else {
                                        this._uboDeclaration += `${uniform.type} ${uniform.name}${arraySize > 0 ? `[${arraySize}]` : ""};\n`;
                                    }
                                }
                                this._uniformList.push(uniform.name);
                            }
                        }
                        if (uniforms.vertex) {
                            this._vertexDeclaration += uniforms.vertex + "\n";
                        }
                        if (uniforms.fragment) {
                            this._fragmentDeclaration += uniforms.fragment + "\n";
                        }
                    }
                    plugin.getSamplers(this._samplerList);
                    plugin.getUniformBuffersNames(this._uboList);
                }
                break;
            }
        }
    }
    _collectPointNames(shaderType, customCode) {
        if (!customCode) {
            return;
        }
        for (const pointName in customCode) {
            if (!this._codeInjectionPoints[shaderType]) {
                this._codeInjectionPoints[shaderType] = {};
            }
            this._codeInjectionPoints[shaderType][pointName] = true;
        }
    }
    _injectCustomCode(eventData, existingCallback) {
        return (shaderType, code) => {
            if (existingCallback) {
                code = existingCallback(shaderType, code);
            }
            if (this._uboDeclaration) {
                code = code.replace("#define ADDITIONAL_UBO_DECLARATION", this._uboDeclaration);
            }
            if (this._vertexDeclaration) {
                code = code.replace("#define ADDITIONAL_VERTEX_DECLARATION", this._vertexDeclaration);
            }
            if (this._fragmentDeclaration) {
                code = code.replace("#define ADDITIONAL_FRAGMENT_DECLARATION", this._fragmentDeclaration);
            }
            const points = this._codeInjectionPoints?.[shaderType];
            if (!points) {
                return code;
            }
            let processorOptions = null;
            for (let pointName in points) {
                let injectedCode = "";
                for (const plugin of this._activePlugins) {
                    let customCode = plugin.getCustomCode(shaderType, this._material.shaderLanguage)?.[pointName];
                    if (!customCode) {
                        continue;
                    }
                    if (plugin.resolveIncludes) {
                        if (processorOptions === null) {
                            const shaderLanguage = 0 /* ShaderLanguage.GLSL */;
                            processorOptions = {
                                defines: [], // not used by _ProcessIncludes
                                indexParameters: eventData.indexParameters,
                                isFragment: false,
                                shouldUseHighPrecisionShader: this._engine._shouldUseHighPrecisionShader,
                                processor: undefined, // not used by _ProcessIncludes
                                supportsUniformBuffers: this._engine.supportsUniformBuffers,
                                shadersRepository: _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_3__/* .ShaderStore */ .l.GetShadersRepository(shaderLanguage),
                                includesShadersStore: _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_3__/* .ShaderStore */ .l.GetIncludesShadersStore(shaderLanguage),
                                version: undefined, // not used by _ProcessIncludes
                                platformName: this._engine.shaderPlatformName,
                                processingContext: undefined, // not used by _ProcessIncludes
                                isNDCHalfZRange: this._engine.isNDCHalfZRange,
                                useReverseDepthBuffer: this._engine.useReverseDepthBuffer,
                                processCodeAfterIncludes: undefined, // not used by _ProcessIncludes
                            };
                        }
                        processorOptions.isFragment = shaderType === "fragment";
                        (0,_Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_2__/* ._ProcessIncludes */ .Iq)(customCode, processorOptions, (code) => (customCode = code));
                    }
                    injectedCode += customCode + "\n";
                }
                if (injectedCode.length > 0) {
                    if (pointName.charAt(0) === "!") {
                        // pointName is a regular expression
                        pointName = pointName.substring(1);
                        let regexFlags = "g";
                        if (pointName.charAt(0) === "!") {
                            // no flags
                            regexFlags = "";
                            pointName = pointName.substring(1);
                        }
                        else {
                            // get the flag(s)
                            const matchOption = rxOption.exec(pointName);
                            if (matchOption && matchOption.length >= 2) {
                                regexFlags = matchOption[1];
                                pointName = pointName.substring(regexFlags.length + 1);
                            }
                        }
                        if (regexFlags.indexOf("g") < 0) {
                            // we force the "g" flag so that the regexp object is stateful!
                            regexFlags += "g";
                        }
                        const sourceCode = code;
                        const rx = new RegExp(pointName, regexFlags);
                        let match = rx.exec(sourceCode);
                        while (match !== null) {
                            let newCode = injectedCode;
                            for (let i = 0; i < match.length; ++i) {
                                newCode = newCode.replace("$" + i, match[i]);
                            }
                            code = code.replace(match[0], newCode);
                            match = rx.exec(sourceCode);
                        }
                    }
                    else {
                        const fullPointName = "#define " + pointName;
                        code = code.replace(fullPointName, "\n" + injectedCode + "\n" + fullPointName);
                    }
                }
            }
            return code;
        };
    }
}
/** Map a plugin class name to a #define name (used in the vertex/fragment shaders as a marker of the plugin usage) */
MaterialPluginManager._MaterialPluginClassToMainDefine = {};
MaterialPluginManager._MaterialPluginCounter = 0;
(() => {
    _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_1__/* .EngineStore */ .q.OnEnginesDisposedObservable.add(() => {
        UnregisterAllMaterialPlugins();
    });
})();
const plugins = [];
let inited = false;
let observer = null;
/**
 * Registers a new material plugin through a factory, or updates it. This makes the plugin available to all materials instantiated after its registration.
 * @param pluginName The plugin name
 * @param factory The factory function which allows to create the plugin
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function RegisterMaterialPlugin(pluginName, factory) {
    if (!inited) {
        observer = _material_js__WEBPACK_IMPORTED_MODULE_0__/* .Material */ .i.OnEventObservable.add((material) => {
            for (const [, factory] of plugins) {
                factory(material);
            }
        }, 1 /* MaterialPluginEvent.Created */);
        inited = true;
    }
    const existing = plugins.filter(([name, _factory]) => name === pluginName);
    if (existing.length > 0) {
        existing[0][1] = factory;
    }
    else {
        plugins.push([pluginName, factory]);
    }
}
/**
 * Removes a material plugin from the list of global plugins.
 * @param pluginName The plugin name
 * @returns true if the plugin has been removed, else false
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function UnregisterMaterialPlugin(pluginName) {
    for (let i = 0; i < plugins.length; ++i) {
        if (plugins[i][0] === pluginName) {
            plugins.splice(i, 1);
            if (plugins.length === 0) {
                UnregisterAllMaterialPlugins();
            }
            return true;
        }
    }
    return false;
}
/**
 * Clear the list of global material plugins
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function UnregisterAllMaterialPlugins() {
    plugins.length = 0;
    inited = false;
    _material_js__WEBPACK_IMPORTED_MODULE_0__/* .Material */ .i.OnEventObservable.remove(observer);
    observer = null;
}
//# sourceMappingURL=materialPluginManager.js.map

/***/ }),

/***/ 55157:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   F: () => (/* binding */ MultiMaterial)
/* harmony export */ });
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28986);
/* harmony import */ var _Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27152);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56552);



/**
 * A multi-material is used to apply different materials to different parts of the same object without the need of
 * separate meshes. This can be use to improve performances.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials
 */
class MultiMaterial extends _Materials_material_js__WEBPACK_IMPORTED_MODULE_0__/* .Material */ .i {
    /**
     * Gets or Sets the list of Materials used within the multi material.
     * They need to be ordered according to the submeshes order in the associated mesh
     */
    get subMaterials() {
        return this._subMaterials;
    }
    set subMaterials(value) {
        this._subMaterials = value;
        this._hookArray(value);
    }
    /**
     * Function used to align with Node.getChildren()
     * @returns the list of Materials used within the multi material
     */
    getChildren() {
        return this.subMaterials;
    }
    /**
     * Instantiates a new Multi Material
     * A multi-material is used to apply different materials to different parts of the same object without the need of
     * separate meshes. This can be use to improve performances.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials
     * @param name Define the name in the scene
     * @param scene Define the scene the material belongs to
     */
    constructor(name, scene) {
        super(name, scene, true);
        /** @internal */
        this._waitingSubMaterialsUniqueIds = [];
        this.getScene().addMultiMaterial(this);
        this.subMaterials = [];
        this._storeEffectOnSubMeshes = true; // multimaterial is considered like a push material
    }
    _hookArray(array) {
        const oldPush = array.push;
        array.push = (...items) => {
            const result = oldPush.apply(array, items);
            this._markAllSubMeshesAsTexturesDirty();
            return result;
        };
        const oldSplice = array.splice;
        array.splice = (index, deleteCount) => {
            const deleted = oldSplice.apply(array, [index, deleteCount]);
            this._markAllSubMeshesAsTexturesDirty();
            return deleted;
        };
    }
    /**
     * Get one of the submaterial by its index in the submaterials array
     * @param index The index to look the sub material at
     * @returns The Material if the index has been defined
     */
    getSubMaterial(index) {
        if (index < 0 || index >= this.subMaterials.length) {
            return this.getScene().defaultMaterial;
        }
        return this.subMaterials[index];
    }
    /**
     * Get the list of active textures for the whole sub materials list.
     * @returns All the textures that will be used during the rendering
     */
    getActiveTextures() {
        return super.getActiveTextures().concat(...this.subMaterials.map((subMaterial) => {
            if (subMaterial) {
                return subMaterial.getActiveTextures();
            }
            else {
                return [];
            }
        }));
    }
    /**
     * Specifies if any sub-materials of this multi-material use a given texture.
     * @param texture Defines the texture to check against this multi-material's sub-materials.
     * @returns A boolean specifying if any sub-material of this multi-material uses the texture.
     */
    hasTexture(texture) {
        if (super.hasTexture(texture)) {
            return true;
        }
        for (let i = 0; i < this.subMaterials.length; i++) {
            if (this.subMaterials[i]?.hasTexture(texture)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Gets the current class name of the material e.g. "MultiMaterial"
     * Mainly use in serialization.
     * @returns the class name
     */
    getClassName() {
        return "MultiMaterial";
    }
    /**
     * Checks if the material is ready to render the requested sub mesh
     * @param mesh Define the mesh the submesh belongs to
     * @param subMesh Define the sub mesh to look readiness for
     * @param useInstances Define whether or not the material is used with instances
     * @returns true if ready, otherwise false
     */
    isReadyForSubMesh(mesh, subMesh, useInstances) {
        for (let index = 0; index < this.subMaterials.length; index++) {
            const subMaterial = this.subMaterials[index];
            if (subMaterial) {
                if (subMaterial._storeEffectOnSubMeshes) {
                    if (!subMaterial.isReadyForSubMesh(mesh, subMesh, useInstances)) {
                        return false;
                    }
                    continue;
                }
                if (!subMaterial.isReady(mesh)) {
                    return false;
                }
            }
        }
        return true;
    }
    /**
     * Clones the current material and its related sub materials
     * @param name Define the name of the newly cloned material
     * @param cloneChildren Define if submaterial will be cloned or shared with the parent instance
     * @returns the cloned material
     */
    clone(name, cloneChildren) {
        const newMultiMaterial = new MultiMaterial(name, this.getScene());
        for (let index = 0; index < this.subMaterials.length; index++) {
            let subMaterial = null;
            const current = this.subMaterials[index];
            if (cloneChildren && current) {
                subMaterial = current.clone(name + "-" + current.name);
            }
            else {
                subMaterial = this.subMaterials[index];
            }
            newMultiMaterial.subMaterials.push(subMaterial);
        }
        return newMultiMaterial;
    }
    /**
     * Serializes the materials into a JSON representation.
     * @returns the JSON representation
     */
    serialize() {
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.id = this.id;
        serializationObject.uniqueId = this.uniqueId;
        if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y) {
            serializationObject.tags = _Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y.GetTags(this);
        }
        serializationObject.materialsUniqueIds = [];
        serializationObject.materials = [];
        for (let matIndex = 0; matIndex < this.subMaterials.length; matIndex++) {
            const subMat = this.subMaterials[matIndex];
            if (subMat) {
                serializationObject.materialsUniqueIds.push(subMat.uniqueId);
                serializationObject.materials.push(subMat.id);
            }
            else {
                serializationObject.materialsUniqueIds.push(null);
                serializationObject.materials.push(null);
            }
        }
        return serializationObject;
    }
    /**
     * Dispose the material and release its associated resources
     * @param forceDisposeEffect Define if we want to force disposing the associated effect (if false the shader is not released and could be reuse later on)
     * @param forceDisposeTextures Define if we want to force disposing the associated textures (if false, they will not be disposed and can still be use elsewhere in the app)
     * @param forceDisposeChildren Define if we want to force disposing the associated submaterials (if false, they will not be disposed and can still be use elsewhere in the app)
     */
    dispose(forceDisposeEffect, forceDisposeTextures, forceDisposeChildren) {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        if (forceDisposeChildren) {
            for (let index = 0; index < this.subMaterials.length; index++) {
                const subMaterial = this.subMaterials[index];
                if (subMaterial) {
                    subMaterial.dispose(forceDisposeEffect, forceDisposeTextures);
                }
            }
        }
        const index = scene.multiMaterials.indexOf(this);
        if (index >= 0) {
            scene.multiMaterials.splice(index, 1);
        }
        super.dispose(forceDisposeEffect, forceDisposeTextures);
    }
    /**
     * Creates a MultiMaterial from parsed MultiMaterial data.
     * @param parsedMultiMaterial defines parsed MultiMaterial data.
     * @param scene defines the hosting scene
     * @returns a new MultiMaterial
     */
    static ParseMultiMaterial(parsedMultiMaterial, scene) {
        const multiMaterial = new MultiMaterial(parsedMultiMaterial.name, scene);
        multiMaterial.id = parsedMultiMaterial.id;
        multiMaterial._loadedUniqueId = parsedMultiMaterial.uniqueId;
        if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y) {
            _Misc_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y.AddTagsTo(multiMaterial, parsedMultiMaterial.tags);
        }
        if (parsedMultiMaterial.materialsUniqueIds) {
            multiMaterial._waitingSubMaterialsUniqueIds = parsedMultiMaterial.materialsUniqueIds;
        }
        else {
            parsedMultiMaterial.materials.forEach((subMatId) => multiMaterial.subMaterials.push(scene.getLastMaterialById(subMatId)));
        }
        return multiMaterial;
    }
}
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)("BABYLON.MultiMaterial", MultiMaterial);
//# sourceMappingURL=multiMaterial.js.map

/***/ }),

/***/ 97667:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   J: () => (/* binding */ PrePassConfiguration)
/* harmony export */ });

/**
 * Configuration needed for prepass-capable materials
 */
class PrePassConfiguration {
    constructor() {
        /**
         * Previous world matrices of meshes carrying this material
         * Used for computing velocity
         */
        this.previousWorldMatrices = {};
        /**
         * Previous bones of meshes carrying this material
         * Used for computing velocity
         */
        this.previousBones = {};
    }
    /**
     * Add the required uniforms to the current list.
     * @param uniforms defines the current uniform list.
     */
    static AddUniforms(uniforms) {
        uniforms.push("previousWorld", "previousViewProjection", "mPreviousBones");
    }
    /**
     * Add the required samplers to the current list.
     * @param samplers defines the current sampler list.
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static AddSamplers(samplers) {
        // pass
    }
    /**
     * Binds the material data.
     * @param effect defines the effect to update
     * @param scene defines the scene the material belongs to.
     * @param mesh The mesh
     * @param world World matrix of this mesh
     * @param isFrozen Is the material frozen
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    bindForSubMesh(effect, scene, mesh, world, isFrozen) {
        if (scene.prePassRenderer && scene.prePassRenderer.enabled && scene.prePassRenderer.currentRTisSceneRT) {
            if (scene.prePassRenderer.getIndex(2) !== -1 ||
                scene.prePassRenderer.getIndex(11) !== -1) {
                if (!this.previousWorldMatrices[mesh.uniqueId]) {
                    this.previousWorldMatrices[mesh.uniqueId] = world.clone();
                }
                if (!this.previousViewProjection) {
                    this.previousViewProjection = scene.getTransformMatrix().clone();
                    this.currentViewProjection = scene.getTransformMatrix().clone();
                }
                const engine = scene.getEngine();
                if (this.currentViewProjection.updateFlag !== scene.getTransformMatrix().updateFlag) {
                    // First update of the prepass configuration for this rendering pass
                    this._lastUpdateFrameId = engine.frameId;
                    this.previousViewProjection.copyFrom(this.currentViewProjection);
                    this.currentViewProjection.copyFrom(scene.getTransformMatrix());
                }
                else if (this._lastUpdateFrameId !== engine.frameId) {
                    // The scene transformation did not change from the previous frame (so no camera motion), we must update previousViewProjection accordingly
                    this._lastUpdateFrameId = engine.frameId;
                    this.previousViewProjection.copyFrom(this.currentViewProjection);
                }
                effect.setMatrix("previousWorld", this.previousWorldMatrices[mesh.uniqueId]);
                effect.setMatrix("previousViewProjection", this.previousViewProjection);
                this.previousWorldMatrices[mesh.uniqueId] = world.clone();
            }
        }
    }
}
//# sourceMappingURL=prePassConfiguration.js.map

/***/ }),

/***/ 21644:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   E: () => (/* binding */ PushMaterial)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28986);


/**
 * Base class of materials working in push mode in babylon JS
 * @internal
 */
class PushMaterial extends _Materials_material_js__WEBPACK_IMPORTED_MODULE_1__/* .Material */ .i {
    constructor(name, scene, storeEffectOnSubMeshes = true, forceGLSL = false) {
        super(name, scene, undefined, forceGLSL);
        this._normalMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
        this._storeEffectOnSubMeshes = storeEffectOnSubMeshes;
    }
    getEffect() {
        return this._storeEffectOnSubMeshes ? this._activeEffect : super.getEffect();
    }
    isReady(mesh, useInstances) {
        if (!mesh) {
            return false;
        }
        if (!this._storeEffectOnSubMeshes) {
            return true;
        }
        if (!mesh.subMeshes || mesh.subMeshes.length === 0) {
            return true;
        }
        return this.isReadyForSubMesh(mesh, mesh.subMeshes[0], useInstances);
    }
    _isReadyForSubMesh(subMesh) {
        const defines = subMesh.materialDefines;
        if (!this.checkReadyOnEveryCall && subMesh.effect && defines) {
            if (defines._renderId === this.getScene().getRenderId()) {
                return true;
            }
        }
        return false;
    }
    /**
     * Binds the given world matrix to the active effect
     *
     * @param world the matrix to bind
     */
    bindOnlyWorldMatrix(world) {
        this._activeEffect.setMatrix("world", world);
    }
    /**
     * Binds the given normal matrix to the active effect
     *
     * @param normalMatrix the matrix to bind
     */
    bindOnlyNormalMatrix(normalMatrix) {
        this._activeEffect.setMatrix("normalMatrix", normalMatrix);
    }
    bind(world, mesh) {
        if (!mesh) {
            return;
        }
        this.bindForSubMesh(world, mesh, mesh.subMeshes[0]);
    }
    _afterBind(mesh, effect = null, subMesh) {
        super._afterBind(mesh, effect, subMesh);
        this.getScene()._cachedEffect = effect;
        if (subMesh) {
            subMesh._drawWrapper._forceRebindOnNextCall = false;
        }
        else {
            this._drawWrapper._forceRebindOnNextCall = false;
        }
    }
    _mustRebind(scene, effect, subMesh, visibility = 1) {
        return subMesh._drawWrapper._forceRebindOnNextCall || scene.isCachedMaterialInvalid(this, effect, visibility);
    }
    dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh) {
        this._activeEffect = undefined;
        super.dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh);
    }
}
//# sourceMappingURL=pushMaterial.js.map

/***/ }),

/***/ 10917:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ ShaderMaterial)
/* harmony export */ });
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26877);
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87491);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95616);
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7481);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(56552);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26041);
/* harmony import */ var _effectFallbacks_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(82565);
/* harmony import */ var _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(62366);
/* harmony import */ var _pushMaterial_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(21644);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6315);
/* harmony import */ var _clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30492);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(80467);














const onCreatedEffectParameters = { effect: null, subMesh: null };
/**
 * The ShaderMaterial object has the necessary methods to pass data from your scene to the Vertex and Fragment Shaders and returns a material that can be applied to any mesh.
 *
 * This returned material effects how the mesh will look based on the code in the shaders.
 *
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/shaders/shaderMaterial
 */
class ShaderMaterial extends _pushMaterial_js__WEBPACK_IMPORTED_MODULE_9__/* .PushMaterial */ .E {
    /**
     * Instantiate a new shader material.
     * The ShaderMaterial object has the necessary methods to pass data from your scene to the Vertex and Fragment Shaders and returns a material that can be applied to any mesh.
     * This returned material effects how the mesh will look based on the code in the shaders.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/shaders/shaderMaterial
     * @param name Define the name of the material in the scene
     * @param scene Define the scene the material belongs to
     * @param shaderPath Defines  the route to the shader code.
     * @param options Define the options used to create the shader
     * @param storeEffectOnSubMeshes true to store effect on submeshes, false to store the effect directly in the material class.
     */
    constructor(name, scene, shaderPath, options = {}, storeEffectOnSubMeshes = true) {
        super(name, scene, storeEffectOnSubMeshes);
        this._textures = {};
        this._textureArrays = {};
        this._externalTextures = {};
        this._floats = {};
        this._ints = {};
        this._uints = {};
        this._floatsArrays = {};
        this._colors3 = {};
        this._colors3Arrays = {};
        this._colors4 = {};
        this._colors4Arrays = {};
        this._vectors2 = {};
        this._vectors3 = {};
        this._vectors4 = {};
        this._quaternions = {};
        this._quaternionsArrays = {};
        this._matrices = {};
        this._matrixArrays = {};
        this._matrices3x3 = {};
        this._matrices2x2 = {};
        this._vectors2Arrays = {};
        this._vectors3Arrays = {};
        this._vectors4Arrays = {};
        this._uniformBuffers = {};
        this._textureSamplers = {};
        this._storageBuffers = {};
        this._cachedWorldViewMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq();
        this._cachedWorldViewProjectionMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq();
        this._multiview = false;
        /**
         * @internal
         */
        this._materialHelperNeedsPreviousMatrices = false;
        this._shaderPath = shaderPath;
        this._options = {
            needAlphaBlending: false,
            needAlphaTesting: false,
            attributes: ["position", "normal", "uv"],
            uniforms: ["worldViewProjection"],
            uniformBuffers: [],
            samplers: [],
            externalTextures: [],
            samplerObjects: [],
            storageBuffers: [],
            defines: [],
            useClipPlane: false,
            ...options,
        };
    }
    /**
     * Gets the shader path used to define the shader code
     * It can be modified to trigger a new compilation
     */
    get shaderPath() {
        return this._shaderPath;
    }
    /**
     * Sets the shader path used to define the shader code
     * It can be modified to trigger a new compilation
     */
    set shaderPath(shaderPath) {
        this._shaderPath = shaderPath;
    }
    /**
     * Gets the options used to compile the shader.
     * They can be modified to trigger a new compilation
     */
    get options() {
        return this._options;
    }
    /**
     * is multiview set to true?
     */
    get isMultiview() {
        return this._multiview;
    }
    /**
     * Gets the current class name of the material e.g. "ShaderMaterial"
     * Mainly use in serialization.
     * @returns the class name
     */
    getClassName() {
        return "ShaderMaterial";
    }
    /**
     * Specifies if the material will require alpha blending
     * @returns a boolean specifying if alpha blending is needed
     */
    needAlphaBlending() {
        return this.alpha < 1.0 || this._options.needAlphaBlending;
    }
    /**
     * Specifies if this material should be rendered in alpha test mode
     * @returns a boolean specifying if an alpha test is needed.
     */
    needAlphaTesting() {
        return this._options.needAlphaTesting;
    }
    _checkUniform(uniformName) {
        if (this._options.uniforms.indexOf(uniformName) === -1) {
            this._options.uniforms.push(uniformName);
        }
    }
    /**
     * Set a texture in the shader.
     * @param name Define the name of the uniform samplers as defined in the shader
     * @param texture Define the texture to bind to this sampler
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setTexture(name, texture) {
        if (this._options.samplers.indexOf(name) === -1) {
            this._options.samplers.push(name);
        }
        this._textures[name] = texture;
        return this;
    }
    /**
     * Remove a texture from the material.
     * @param name Define the name of the texture to remove
     */
    removeTexture(name) {
        delete this._textures[name];
    }
    /**
     * Set a texture array in the shader.
     * @param name Define the name of the uniform sampler array as defined in the shader
     * @param textures Define the list of textures to bind to this sampler
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setTextureArray(name, textures) {
        if (this._options.samplers.indexOf(name) === -1) {
            this._options.samplers.push(name);
        }
        this._checkUniform(name);
        this._textureArrays[name] = textures;
        return this;
    }
    /**
     * Set an internal texture in the shader.
     * @param name Define the name of the uniform samplers as defined in the shader
     * @param texture Define the texture to bind to this sampler
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setExternalTexture(name, texture) {
        if (this._options.externalTextures.indexOf(name) === -1) {
            this._options.externalTextures.push(name);
        }
        this._externalTextures[name] = texture;
        return this;
    }
    /**
     * Set a float in the shader.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setFloat(name, value) {
        this._checkUniform(name);
        this._floats[name] = value;
        return this;
    }
    /**
     * Set a int in the shader.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setInt(name, value) {
        this._checkUniform(name);
        this._ints[name] = value;
        return this;
    }
    /**
     * Set a unsigned int in the shader.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setUInt(name, value) {
        this._checkUniform(name);
        this._uints[name] = value;
        return this;
    }
    /**
     * Set an array of floats in the shader.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setFloats(name, value) {
        this._checkUniform(name);
        this._floatsArrays[name] = value;
        return this;
    }
    /**
     * Set a vec3 in the shader from a Color3.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setColor3(name, value) {
        this._checkUniform(name);
        this._colors3[name] = value;
        return this;
    }
    /**
     * Set a vec3 array in the shader from a Color3 array.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setColor3Array(name, value) {
        this._checkUniform(name);
        this._colors3Arrays[name] = value.reduce((arr, color) => {
            color.toArray(arr, arr.length);
            return arr;
        }, []);
        return this;
    }
    /**
     * Set a vec4 in the shader from a Color4.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setColor4(name, value) {
        this._checkUniform(name);
        this._colors4[name] = value;
        return this;
    }
    /**
     * Set a vec4 array in the shader from a Color4 array.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setColor4Array(name, value) {
        this._checkUniform(name);
        this._colors4Arrays[name] = value.reduce((arr, color) => {
            color.toArray(arr, arr.length);
            return arr;
        }, []);
        return this;
    }
    /**
     * Set a vec2 in the shader from a Vector2.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setVector2(name, value) {
        this._checkUniform(name);
        this._vectors2[name] = value;
        return this;
    }
    /**
     * Set a vec3 in the shader from a Vector3.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setVector3(name, value) {
        this._checkUniform(name);
        this._vectors3[name] = value;
        return this;
    }
    /**
     * Set a vec4 in the shader from a Vector4.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setVector4(name, value) {
        this._checkUniform(name);
        this._vectors4[name] = value;
        return this;
    }
    /**
     * Set a vec4 in the shader from a Quaternion.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setQuaternion(name, value) {
        this._checkUniform(name);
        this._quaternions[name] = value;
        return this;
    }
    /**
     * Set a vec4 array in the shader from a Quaternion array.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setQuaternionArray(name, value) {
        this._checkUniform(name);
        this._quaternionsArrays[name] = value.reduce((arr, quaternion) => {
            quaternion.toArray(arr, arr.length);
            return arr;
        }, []);
        return this;
    }
    /**
     * Set a mat4 in the shader from a Matrix.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setMatrix(name, value) {
        this._checkUniform(name);
        this._matrices[name] = value;
        return this;
    }
    /**
     * Set a float32Array in the shader from a matrix array.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setMatrices(name, value) {
        this._checkUniform(name);
        const float32Array = new Float32Array(value.length * 16);
        for (let index = 0; index < value.length; index++) {
            const matrix = value[index];
            matrix.copyToArray(float32Array, index * 16);
        }
        this._matrixArrays[name] = float32Array;
        return this;
    }
    /**
     * Set a mat3 in the shader from a Float32Array.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setMatrix3x3(name, value) {
        this._checkUniform(name);
        this._matrices3x3[name] = value;
        return this;
    }
    /**
     * Set a mat2 in the shader from a Float32Array.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setMatrix2x2(name, value) {
        this._checkUniform(name);
        this._matrices2x2[name] = value;
        return this;
    }
    /**
     * Set a vec2 array in the shader from a number array.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setArray2(name, value) {
        this._checkUniform(name);
        this._vectors2Arrays[name] = value;
        return this;
    }
    /**
     * Set a vec3 array in the shader from a number array.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setArray3(name, value) {
        this._checkUniform(name);
        this._vectors3Arrays[name] = value;
        return this;
    }
    /**
     * Set a vec4 array in the shader from a number array.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setArray4(name, value) {
        this._checkUniform(name);
        this._vectors4Arrays[name] = value;
        return this;
    }
    /**
     * Set a uniform buffer in the shader
     * @param name Define the name of the uniform as defined in the shader
     * @param buffer Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setUniformBuffer(name, buffer) {
        if (this._options.uniformBuffers.indexOf(name) === -1) {
            this._options.uniformBuffers.push(name);
        }
        this._uniformBuffers[name] = buffer;
        return this;
    }
    /**
     * Set a texture sampler in the shader
     * @param name Define the name of the uniform as defined in the shader
     * @param sampler Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setTextureSampler(name, sampler) {
        if (this._options.samplerObjects.indexOf(name) === -1) {
            this._options.samplerObjects.push(name);
        }
        this._textureSamplers[name] = sampler;
        return this;
    }
    /**
     * Set a storage buffer in the shader
     * @param name Define the name of the storage buffer as defined in the shader
     * @param buffer Define the value to give to the uniform
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setStorageBuffer(name, buffer) {
        if (this._options.storageBuffers.indexOf(name) === -1) {
            this._options.storageBuffers.push(name);
        }
        this._storageBuffers[name] = buffer;
        return this;
    }
    /**
     * Adds, removes, or replaces the specified shader define and value.
     * * setDefine("MY_DEFINE", true); // enables a boolean define
     * * setDefine("MY_DEFINE", "0.5"); // adds "#define MY_DEFINE 0.5" to the shader (or sets and replaces the value of any existing define with that name)
     * * setDefine("MY_DEFINE", false); // disables and removes the define
     * Note if the active defines do change, the shader will be recompiled and this can be expensive.
     * @param define the define name e.g., "OUTPUT_TO_SRGB" or "#define OUTPUT_TO_SRGB". If the define was passed into the constructor already, the version used should match that, and in either case, it should not include any appended value.
     * @param value either the value of the define (e.g. a numerical value) or for booleans, true if the define should be enabled or false if it should be disabled
     * @returns the material itself allowing "fluent" like uniform updates
     */
    setDefine(define, value) {
        // First remove any existing define with this name.
        const defineName = define.trimEnd() + " ";
        const existingDefineIdx = this.options.defines.findIndex((x) => x === define || x.startsWith(defineName));
        if (existingDefineIdx >= 0) {
            this.options.defines.splice(existingDefineIdx, 1);
        }
        // Then add the new define value. (If it's a boolean value and false, don't add it.)
        if (typeof value !== "boolean" || value) {
            this.options.defines.push(defineName + value);
        }
        return this;
    }
    /**
     * Specifies that the submesh is ready to be used
     * @param mesh defines the mesh to check
     * @param subMesh defines which submesh to check
     * @param useInstances specifies that instances should be used
     * @returns a boolean indicating that the submesh is ready or not
     */
    isReadyForSubMesh(mesh, subMesh, useInstances) {
        return this.isReady(mesh, useInstances, subMesh);
    }
    /**
     * Checks if the material is ready to render the requested mesh
     * @param mesh Define the mesh to render
     * @param useInstances Define whether or not the material is used with instances
     * @param subMesh defines which submesh to render
     * @returns true if ready, otherwise false
     */
    isReady(mesh, useInstances, subMesh) {
        const storeEffectOnSubMeshes = subMesh && this._storeEffectOnSubMeshes;
        if (this.isFrozen) {
            const drawWrapper = storeEffectOnSubMeshes ? subMesh._drawWrapper : this._drawWrapper;
            if (drawWrapper.effect && drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {
                return true;
            }
        }
        const scene = this.getScene();
        const engine = scene.getEngine();
        // Instances
        const defines = [];
        const attribs = [];
        const fallbacks = new _effectFallbacks_js__WEBPACK_IMPORTED_MODULE_7__/* .EffectFallbacks */ .J();
        let shaderName = this._shaderPath, uniforms = this._options.uniforms, uniformBuffers = this._options.uniformBuffers, samplers = this._options.samplers;
        // global multiview
        if (engine.getCaps().multiview && scene.activeCamera && scene.activeCamera.outputRenderTarget && scene.activeCamera.outputRenderTarget.getViewCount() > 1) {
            this._multiview = true;
            defines.push("#define MULTIVIEW");
            if (uniforms.indexOf("viewProjection") !== -1 && uniforms.indexOf("viewProjectionR") === -1) {
                uniforms.push("viewProjectionR");
            }
        }
        for (let index = 0; index < this._options.defines.length; index++) {
            const defineToAdd = this._options.defines[index].indexOf("#define") === 0 ? this._options.defines[index] : `#define ${this._options.defines[index]}`;
            defines.push(defineToAdd);
        }
        for (let index = 0; index < this._options.attributes.length; index++) {
            attribs.push(this._options.attributes[index]);
        }
        if (mesh && mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind)) {
            if (attribs.indexOf(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind) === -1) {
                attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind);
            }
            defines.push("#define VERTEXCOLOR");
        }
        if (useInstances) {
            defines.push("#define INSTANCES");
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .PushAttributesForInstances */ .te)(attribs, this._materialHelperNeedsPreviousMatrices);
            if (mesh?.hasThinInstances) {
                defines.push("#define THIN_INSTANCES");
                if (mesh && mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorInstanceKind)) {
                    attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorInstanceKind);
                    defines.push("#define INSTANCESCOLOR");
                }
            }
        }
        // Bones
        if (mesh && mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
            attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind);
            attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsKind);
            if (mesh.numBoneInfluencers > 4) {
                attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesExtraKind);
                attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsExtraKind);
            }
            const skeleton = mesh.skeleton;
            defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
            fallbacks.addCPUSkinningFallback(0, mesh);
            if (skeleton.isUsingTextureForMatrices) {
                defines.push("#define BONETEXTURE");
                if (uniforms.indexOf("boneTextureWidth") === -1) {
                    uniforms.push("boneTextureWidth");
                }
                if (this._options.samplers.indexOf("boneSampler") === -1) {
                    this._options.samplers.push("boneSampler");
                }
            }
            else {
                defines.push("#define BonesPerMesh " + (skeleton.bones.length + 1));
                if (uniforms.indexOf("mBones") === -1) {
                    uniforms.push("mBones");
                }
            }
        }
        else {
            defines.push("#define NUM_BONE_INFLUENCERS 0");
        }
        // Morph
        let numInfluencers = 0;
        const manager = mesh ? mesh.morphTargetManager : null;
        if (manager) {
            const uv = manager.supportsUVs && defines.indexOf("#define UV1") !== -1;
            const tangent = manager.supportsTangents && defines.indexOf("#define TANGENT") !== -1;
            const normal = manager.supportsNormals && defines.indexOf("#define NORMAL") !== -1;
            numInfluencers = manager.numMaxInfluencers || manager.numInfluencers;
            if (uv) {
                defines.push("#define MORPHTARGETS_UV");
            }
            if (tangent) {
                defines.push("#define MORPHTARGETS_TANGENT");
            }
            if (normal) {
                defines.push("#define MORPHTARGETS_NORMAL");
            }
            if (numInfluencers > 0) {
                defines.push("#define MORPHTARGETS");
            }
            if (manager.isUsingTextureForTargets) {
                defines.push("#define MORPHTARGETS_TEXTURE");
                if (uniforms.indexOf("morphTargetTextureIndices") === -1) {
                    uniforms.push("morphTargetTextureIndices");
                }
                if (this._options.samplers.indexOf("morphTargets") === -1) {
                    this._options.samplers.push("morphTargets");
                }
            }
            defines.push("#define NUM_MORPH_INFLUENCERS " + numInfluencers);
            for (let index = 0; index < numInfluencers; index++) {
                attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind + index);
                if (normal) {
                    attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind + index);
                }
                if (tangent) {
                    attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.TangentKind + index);
                }
                if (uv) {
                    attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind + "_" + index);
                }
            }
            if (numInfluencers > 0) {
                uniforms = uniforms.slice();
                uniforms.push("morphTargetInfluences");
                uniforms.push("morphTargetCount");
                uniforms.push("morphTargetTextureInfo");
                uniforms.push("morphTargetTextureIndices");
            }
        }
        else {
            defines.push("#define NUM_MORPH_INFLUENCERS 0");
        }
        // Baked Vertex Animation
        if (mesh) {
            const bvaManager = mesh.bakedVertexAnimationManager;
            if (bvaManager && bvaManager.isEnabled) {
                defines.push("#define BAKED_VERTEX_ANIMATION_TEXTURE");
                if (uniforms.indexOf("bakedVertexAnimationSettings") === -1) {
                    uniforms.push("bakedVertexAnimationSettings");
                }
                if (uniforms.indexOf("bakedVertexAnimationTextureSizeInverted") === -1) {
                    uniforms.push("bakedVertexAnimationTextureSizeInverted");
                }
                if (uniforms.indexOf("bakedVertexAnimationTime") === -1) {
                    uniforms.push("bakedVertexAnimationTime");
                }
                if (this._options.samplers.indexOf("bakedVertexAnimationTexture") === -1) {
                    this._options.samplers.push("bakedVertexAnimationTexture");
                }
            }
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .PrepareAttributesForBakedVertexAnimation */ .J2)(attribs, mesh, defines);
        }
        // Textures
        for (const name in this._textures) {
            if (!this._textures[name].isReady()) {
                return false;
            }
        }
        // Alpha test
        if (mesh && this._shouldTurnAlphaTestOn(mesh)) {
            defines.push("#define ALPHATEST");
        }
        // Clip planes
        if (this._options.useClipPlane !== false) {
            (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_11__/* .addClipPlaneUniforms */ .TV)(uniforms);
            (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_11__/* .prepareStringDefinesForClipPlanes */ .tv)(this, scene, defines);
        }
        // Fog
        if (scene.fogEnabled && mesh?.applyFog && scene.fogMode !== _scene_js__WEBPACK_IMPORTED_MODULE_1__/* .Scene */ .Z.FOGMODE_NONE) {
            defines.push("#define FOG");
            if (uniforms.indexOf("view") === -1) {
                uniforms.push("view");
            }
            if (uniforms.indexOf("vFogInfos") === -1) {
                uniforms.push("vFogInfos");
            }
            if (uniforms.indexOf("vFogColor") === -1) {
                uniforms.push("vFogColor");
            }
        }
        // Misc
        if (this._useLogarithmicDepth) {
            defines.push("#define LOGARITHMICDEPTH");
            if (uniforms.indexOf("logarithmicDepthConstant") === -1) {
                uniforms.push("logarithmicDepthConstant");
            }
        }
        if (this.customShaderNameResolve) {
            uniforms = uniforms.slice();
            uniformBuffers = uniformBuffers.slice();
            samplers = samplers.slice();
            shaderName = this.customShaderNameResolve(this.name, uniforms, uniformBuffers, samplers, defines, attribs);
        }
        const drawWrapper = storeEffectOnSubMeshes ? subMesh._getDrawWrapper(undefined, true) : this._drawWrapper;
        const previousEffect = drawWrapper?.effect ?? null;
        const previousDefines = drawWrapper?.defines ?? null;
        const join = defines.join("\n");
        let effect = previousEffect;
        if (previousDefines !== join) {
            effect = engine.createEffect(shaderName, {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: { maxSimultaneousMorphTargets: numInfluencers },
                shaderLanguage: this._options.shaderLanguage,
                extraInitializationsAsync: this._options.extraInitializationsAsync,
            }, engine);
            if (storeEffectOnSubMeshes) {
                subMesh.setEffect(effect, join, this._materialContext);
            }
            else if (drawWrapper) {
                drawWrapper.setEffect(effect, join);
            }
            if (this._onEffectCreatedObservable) {
                onCreatedEffectParameters.effect = effect;
                onCreatedEffectParameters.subMesh = subMesh ?? mesh?.subMeshes[0] ?? null;
                this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters);
            }
        }
        drawWrapper._wasPreviouslyUsingInstances = !!useInstances;
        if (!effect?.isReady() ?? true) {
            return false;
        }
        if (previousEffect !== effect) {
            scene.resetCachedMaterial();
        }
        drawWrapper._wasPreviouslyReady = true;
        return true;
    }
    /**
     * Binds the world matrix to the material
     * @param world defines the world transformation matrix
     * @param effectOverride - If provided, use this effect instead of internal effect
     */
    bindOnlyWorldMatrix(world, effectOverride) {
        const scene = this.getScene();
        const effect = effectOverride ?? this.getEffect();
        if (!effect) {
            return;
        }
        if (this._options.uniforms.indexOf("world") !== -1) {
            effect.setMatrix("world", world);
        }
        if (this._options.uniforms.indexOf("worldView") !== -1) {
            world.multiplyToRef(scene.getViewMatrix(), this._cachedWorldViewMatrix);
            effect.setMatrix("worldView", this._cachedWorldViewMatrix);
        }
        if (this._options.uniforms.indexOf("worldViewProjection") !== -1) {
            world.multiplyToRef(scene.getTransformMatrix(), this._cachedWorldViewProjectionMatrix);
            effect.setMatrix("worldViewProjection", this._cachedWorldViewProjectionMatrix);
        }
        if (this._options.uniforms.indexOf("view") !== -1) {
            effect.setMatrix("view", scene.getViewMatrix());
        }
    }
    /**
     * Binds the submesh to this material by preparing the effect and shader to draw
     * @param world defines the world transformation matrix
     * @param mesh defines the mesh containing the submesh
     * @param subMesh defines the submesh to bind the material to
     */
    bindForSubMesh(world, mesh, subMesh) {
        this.bind(world, mesh, subMesh._drawWrapperOverride?.effect, subMesh);
    }
    /**
     * Binds the material to the mesh
     * @param world defines the world transformation matrix
     * @param mesh defines the mesh to bind the material to
     * @param effectOverride - If provided, use this effect instead of internal effect
     * @param subMesh defines the submesh to bind the material to
     */
    bind(world, mesh, effectOverride, subMesh) {
        // Std values
        const storeEffectOnSubMeshes = subMesh && this._storeEffectOnSubMeshes;
        const effect = effectOverride ?? (storeEffectOnSubMeshes ? subMesh.effect : this.getEffect());
        if (!effect) {
            return;
        }
        const scene = this.getScene();
        this._activeEffect = effect;
        this.bindOnlyWorldMatrix(world, effectOverride);
        const uniformBuffers = this._options.uniformBuffers;
        let useSceneUBO = false;
        if (effect && uniformBuffers && uniformBuffers.length > 0 && scene.getEngine().supportsUniformBuffers) {
            for (let i = 0; i < uniformBuffers.length; ++i) {
                const bufferName = uniformBuffers[i];
                switch (bufferName) {
                    case "Mesh":
                        if (mesh) {
                            mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
                            mesh.transferToEffect(world);
                        }
                        break;
                    case "Scene":
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .BindSceneUniformBuffer */ ._8)(effect, scene.getSceneUniformBuffer());
                        scene.finalizeSceneUbo();
                        useSceneUBO = true;
                        break;
                }
            }
        }
        const mustRebind = mesh && storeEffectOnSubMeshes ? this._mustRebind(scene, effect, subMesh, mesh.visibility) : scene.getCachedMaterial() !== this;
        if (effect && mustRebind) {
            if (!useSceneUBO && this._options.uniforms.indexOf("view") !== -1) {
                effect.setMatrix("view", scene.getViewMatrix());
            }
            if (!useSceneUBO && this._options.uniforms.indexOf("projection") !== -1) {
                effect.setMatrix("projection", scene.getProjectionMatrix());
            }
            if (!useSceneUBO && this._options.uniforms.indexOf("viewProjection") !== -1) {
                effect.setMatrix("viewProjection", scene.getTransformMatrix());
                if (this._multiview) {
                    effect.setMatrix("viewProjectionR", scene._transformMatrixR);
                }
            }
            if (scene.activeCamera && this._options.uniforms.indexOf("cameraPosition") !== -1) {
                effect.setVector3("cameraPosition", scene.activeCamera.globalPosition);
            }
            // Bones
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .BindBonesParameters */ .f$)(mesh, effect);
            // Clip plane
            (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_11__/* .bindClipPlane */ .gS)(effect, this, scene);
            // Misc
            if (this._useLogarithmicDepth) {
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .BindLogDepth */ .DL)(storeEffectOnSubMeshes ? subMesh.materialDefines : effect.defines, effect, scene);
            }
            // Fog
            if (mesh) {
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .BindFogParameters */ .Yy)(scene, mesh, effect);
            }
            let name;
            // Texture
            for (name in this._textures) {
                effect.setTexture(name, this._textures[name]);
            }
            // Texture arrays
            for (name in this._textureArrays) {
                effect.setTextureArray(name, this._textureArrays[name]);
            }
            // Int
            for (name in this._ints) {
                effect.setInt(name, this._ints[name]);
            }
            // UInt
            for (name in this._uints) {
                effect.setUInt(name, this._uints[name]);
            }
            // Float
            for (name in this._floats) {
                effect.setFloat(name, this._floats[name]);
            }
            // Floats
            for (name in this._floatsArrays) {
                effect.setArray(name, this._floatsArrays[name]);
            }
            // Color3
            for (name in this._colors3) {
                effect.setColor3(name, this._colors3[name]);
            }
            // Color3Array
            for (name in this._colors3Arrays) {
                effect.setArray3(name, this._colors3Arrays[name]);
            }
            // Color4
            for (name in this._colors4) {
                const color = this._colors4[name];
                effect.setFloat4(name, color.r, color.g, color.b, color.a);
            }
            // Color4Array
            for (name in this._colors4Arrays) {
                effect.setArray4(name, this._colors4Arrays[name]);
            }
            // Vector2
            for (name in this._vectors2) {
                effect.setVector2(name, this._vectors2[name]);
            }
            // Vector3
            for (name in this._vectors3) {
                effect.setVector3(name, this._vectors3[name]);
            }
            // Vector4
            for (name in this._vectors4) {
                effect.setVector4(name, this._vectors4[name]);
            }
            // Quaternion
            for (name in this._quaternions) {
                effect.setQuaternion(name, this._quaternions[name]);
            }
            // Matrix
            for (name in this._matrices) {
                effect.setMatrix(name, this._matrices[name]);
            }
            // MatrixArray
            for (name in this._matrixArrays) {
                effect.setMatrices(name, this._matrixArrays[name]);
            }
            // Matrix 3x3
            for (name in this._matrices3x3) {
                effect.setMatrix3x3(name, this._matrices3x3[name]);
            }
            // Matrix 2x2
            for (name in this._matrices2x2) {
                effect.setMatrix2x2(name, this._matrices2x2[name]);
            }
            // Vector2Array
            for (name in this._vectors2Arrays) {
                effect.setArray2(name, this._vectors2Arrays[name]);
            }
            // Vector3Array
            for (name in this._vectors3Arrays) {
                effect.setArray3(name, this._vectors3Arrays[name]);
            }
            // Vector4Array
            for (name in this._vectors4Arrays) {
                effect.setArray4(name, this._vectors4Arrays[name]);
            }
            // QuaternionArray
            for (name in this._quaternionsArrays) {
                effect.setArray4(name, this._quaternionsArrays[name]);
            }
            // Uniform buffers
            for (name in this._uniformBuffers) {
                const buffer = this._uniformBuffers[name].getBuffer();
                if (buffer) {
                    effect.bindUniformBuffer(buffer, name);
                }
            }
            const engineWebGPU = scene.getEngine();
            // External texture
            const setExternalTexture = engineWebGPU.setExternalTexture;
            if (setExternalTexture) {
                for (name in this._externalTextures) {
                    setExternalTexture.call(engineWebGPU, name, this._externalTextures[name]);
                }
            }
            // Samplers
            const setTextureSampler = engineWebGPU.setTextureSampler;
            if (setTextureSampler) {
                for (name in this._textureSamplers) {
                    setTextureSampler.call(engineWebGPU, name, this._textureSamplers[name]);
                }
            }
            // Storage buffers
            const setStorageBuffer = engineWebGPU.setStorageBuffer;
            if (setStorageBuffer) {
                for (name in this._storageBuffers) {
                    setStorageBuffer.call(engineWebGPU, name, this._storageBuffers[name]);
                }
            }
        }
        if (effect && mesh && (mustRebind || !this.isFrozen)) {
            // Morph targets
            const manager = mesh.morphTargetManager;
            if (manager && manager.numInfluencers > 0) {
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .BindMorphTargetParameters */ .nR)(mesh, effect);
            }
            const bvaManager = mesh.bakedVertexAnimationManager;
            if (bvaManager && bvaManager.isEnabled) {
                const drawWrapper = storeEffectOnSubMeshes ? subMesh._drawWrapper : this._drawWrapper;
                mesh.bakedVertexAnimationManager?.bind(effect, !!drawWrapper._wasPreviouslyUsingInstances);
            }
        }
        this._afterBind(mesh, effect, subMesh);
    }
    /**
     * Gets the active textures from the material
     * @returns an array of textures
     */
    getActiveTextures() {
        const activeTextures = super.getActiveTextures();
        for (const name in this._textures) {
            activeTextures.push(this._textures[name]);
        }
        for (const name in this._textureArrays) {
            const array = this._textureArrays[name];
            for (let index = 0; index < array.length; index++) {
                activeTextures.push(array[index]);
            }
        }
        return activeTextures;
    }
    /**
     * Specifies if the material uses a texture
     * @param texture defines the texture to check against the material
     * @returns a boolean specifying if the material uses the texture
     */
    hasTexture(texture) {
        if (super.hasTexture(texture)) {
            return true;
        }
        for (const name in this._textures) {
            if (this._textures[name] === texture) {
                return true;
            }
        }
        for (const name in this._textureArrays) {
            const array = this._textureArrays[name];
            for (let index = 0; index < array.length; index++) {
                if (array[index] === texture) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Makes a duplicate of the material, and gives it a new name
     * @param name defines the new name for the duplicated material
     * @returns the cloned material
     */
    clone(name) {
        const result = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper */ .p.Clone(() => new ShaderMaterial(name, this.getScene(), this._shaderPath, this._options, this._storeEffectOnSubMeshes), this);
        result.name = name;
        result.id = name;
        // Shader code path
        if (typeof result._shaderPath === "object") {
            result._shaderPath = { ...result._shaderPath };
        }
        // Options
        this._options = { ...this._options };
        Object.keys(this._options).forEach((propName) => {
            const propValue = this._options[propName];
            if (Array.isArray(propValue)) {
                this._options[propName] = propValue.slice(0);
            }
        });
        // Stencil
        this.stencil.copyTo(result.stencil);
        // Texture
        for (const key in this._textures) {
            result.setTexture(key, this._textures[key]);
        }
        // TextureArray
        for (const key in this._textureArrays) {
            result.setTextureArray(key, this._textureArrays[key]);
        }
        // External texture
        for (const key in this._externalTextures) {
            result.setExternalTexture(key, this._externalTextures[key]);
        }
        // Int
        for (const key in this._ints) {
            result.setInt(key, this._ints[key]);
        }
        // UInt
        for (const key in this._uints) {
            result.setUInt(key, this._uints[key]);
        }
        // Float
        for (const key in this._floats) {
            result.setFloat(key, this._floats[key]);
        }
        // Floats
        for (const key in this._floatsArrays) {
            result.setFloats(key, this._floatsArrays[key]);
        }
        // Color3
        for (const key in this._colors3) {
            result.setColor3(key, this._colors3[key]);
        }
        // Color3Array
        for (const key in this._colors3Arrays) {
            result._colors3Arrays[key] = this._colors3Arrays[key];
        }
        // Color4
        for (const key in this._colors4) {
            result.setColor4(key, this._colors4[key]);
        }
        // Color4Array
        for (const key in this._colors4Arrays) {
            result._colors4Arrays[key] = this._colors4Arrays[key];
        }
        // Vector2
        for (const key in this._vectors2) {
            result.setVector2(key, this._vectors2[key]);
        }
        // Vector3
        for (const key in this._vectors3) {
            result.setVector3(key, this._vectors3[key]);
        }
        // Vector4
        for (const key in this._vectors4) {
            result.setVector4(key, this._vectors4[key]);
        }
        // Quaternion
        for (const key in this._quaternions) {
            result.setQuaternion(key, this._quaternions[key]);
        }
        // QuaternionArray
        for (const key in this._quaternionsArrays) {
            result._quaternionsArrays[key] = this._quaternionsArrays[key];
        }
        // Matrix
        for (const key in this._matrices) {
            result.setMatrix(key, this._matrices[key]);
        }
        // MatrixArray
        for (const key in this._matrixArrays) {
            result._matrixArrays[key] = this._matrixArrays[key].slice();
        }
        // Matrix 3x3
        for (const key in this._matrices3x3) {
            result.setMatrix3x3(key, this._matrices3x3[key]);
        }
        // Matrix 2x2
        for (const key in this._matrices2x2) {
            result.setMatrix2x2(key, this._matrices2x2[key]);
        }
        // Vector2Array
        for (const key in this._vectors2Arrays) {
            result.setArray2(key, this._vectors2Arrays[key]);
        }
        // Vector3Array
        for (const key in this._vectors3Arrays) {
            result.setArray3(key, this._vectors3Arrays[key]);
        }
        // Vector4Array
        for (const key in this._vectors4Arrays) {
            result.setArray4(key, this._vectors4Arrays[key]);
        }
        // Uniform buffers
        for (const key in this._uniformBuffers) {
            result.setUniformBuffer(key, this._uniformBuffers[key]);
        }
        // Samplers
        for (const key in this._textureSamplers) {
            result.setTextureSampler(key, this._textureSamplers[key]);
        }
        // Storag buffers
        for (const key in this._storageBuffers) {
            result.setStorageBuffer(key, this._storageBuffers[key]);
        }
        return result;
    }
    /**
     * Disposes the material
     * @param forceDisposeEffect specifies if effects should be forcefully disposed
     * @param forceDisposeTextures specifies if textures should be forcefully disposed
     * @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
     */
    dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh) {
        if (forceDisposeTextures) {
            let name;
            for (name in this._textures) {
                this._textures[name].dispose();
            }
            for (name in this._textureArrays) {
                const array = this._textureArrays[name];
                for (let index = 0; index < array.length; index++) {
                    array[index].dispose();
                }
            }
        }
        this._textures = {};
        super.dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh);
    }
    /**
     * Serializes this material in a JSON representation
     * @returns the serialized material object
     */
    serialize() {
        const serializationObject = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper */ .p.Serialize(this);
        serializationObject.customType = "BABYLON.ShaderMaterial";
        serializationObject.uniqueId = this.uniqueId;
        serializationObject.options = this._options;
        serializationObject.shaderPath = this._shaderPath;
        serializationObject.storeEffectOnSubMeshes = this._storeEffectOnSubMeshes;
        let name;
        // Stencil
        serializationObject.stencil = this.stencil.serialize();
        // Texture
        serializationObject.textures = {};
        for (name in this._textures) {
            serializationObject.textures[name] = this._textures[name].serialize();
        }
        // Texture arrays
        serializationObject.textureArrays = {};
        for (name in this._textureArrays) {
            serializationObject.textureArrays[name] = [];
            const array = this._textureArrays[name];
            for (let index = 0; index < array.length; index++) {
                serializationObject.textureArrays[name].push(array[index].serialize());
            }
        }
        // Int
        serializationObject.ints = {};
        for (name in this._ints) {
            serializationObject.ints[name] = this._ints[name];
        }
        // UInt
        serializationObject.uints = {};
        for (name in this._uints) {
            serializationObject.uints[name] = this._uints[name];
        }
        // Float
        serializationObject.floats = {};
        for (name in this._floats) {
            serializationObject.floats[name] = this._floats[name];
        }
        // Floats
        serializationObject.floatsArrays = {};
        for (name in this._floatsArrays) {
            serializationObject.floatsArrays[name] = this._floatsArrays[name];
        }
        // Color3
        serializationObject.colors3 = {};
        for (name in this._colors3) {
            serializationObject.colors3[name] = this._colors3[name].asArray();
        }
        // Color3 array
        serializationObject.colors3Arrays = {};
        for (name in this._colors3Arrays) {
            serializationObject.colors3Arrays[name] = this._colors3Arrays[name];
        }
        // Color4
        serializationObject.colors4 = {};
        for (name in this._colors4) {
            serializationObject.colors4[name] = this._colors4[name].asArray();
        }
        // Color4 array
        serializationObject.colors4Arrays = {};
        for (name in this._colors4Arrays) {
            serializationObject.colors4Arrays[name] = this._colors4Arrays[name];
        }
        // Vector2
        serializationObject.vectors2 = {};
        for (name in this._vectors2) {
            serializationObject.vectors2[name] = this._vectors2[name].asArray();
        }
        // Vector3
        serializationObject.vectors3 = {};
        for (name in this._vectors3) {
            serializationObject.vectors3[name] = this._vectors3[name].asArray();
        }
        // Vector4
        serializationObject.vectors4 = {};
        for (name in this._vectors4) {
            serializationObject.vectors4[name] = this._vectors4[name].asArray();
        }
        // Quaternion
        serializationObject.quaternions = {};
        for (name in this._quaternions) {
            serializationObject.quaternions[name] = this._quaternions[name].asArray();
        }
        // Matrix
        serializationObject.matrices = {};
        for (name in this._matrices) {
            serializationObject.matrices[name] = this._matrices[name].asArray();
        }
        // MatrixArray
        serializationObject.matrixArray = {};
        for (name in this._matrixArrays) {
            serializationObject.matrixArray[name] = this._matrixArrays[name];
        }
        // Matrix 3x3
        serializationObject.matrices3x3 = {};
        for (name in this._matrices3x3) {
            serializationObject.matrices3x3[name] = this._matrices3x3[name];
        }
        // Matrix 2x2
        serializationObject.matrices2x2 = {};
        for (name in this._matrices2x2) {
            serializationObject.matrices2x2[name] = this._matrices2x2[name];
        }
        // Vector2Array
        serializationObject.vectors2Arrays = {};
        for (name in this._vectors2Arrays) {
            serializationObject.vectors2Arrays[name] = this._vectors2Arrays[name];
        }
        // Vector3Array
        serializationObject.vectors3Arrays = {};
        for (name in this._vectors3Arrays) {
            serializationObject.vectors3Arrays[name] = this._vectors3Arrays[name];
        }
        // Vector4Array
        serializationObject.vectors4Arrays = {};
        for (name in this._vectors4Arrays) {
            serializationObject.vectors4Arrays[name] = this._vectors4Arrays[name];
        }
        // QuaternionArray
        serializationObject.quaternionsArrays = {};
        for (name in this._quaternionsArrays) {
            serializationObject.quaternionsArrays[name] = this._quaternionsArrays[name];
        }
        return serializationObject;
    }
    /**
     * Creates a shader material from parsed shader material data
     * @param source defines the JSON representation of the material
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @returns a new material
     */
    static Parse(source, scene, rootUrl) {
        const material = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_0__/* .SerializationHelper */ .p.Parse(() => new ShaderMaterial(source.name, scene, source.shaderPath, source.options, source.storeEffectOnSubMeshes), source, scene, rootUrl);
        let name;
        // Stencil
        if (source.stencil) {
            material.stencil.parse(source.stencil, scene, rootUrl);
        }
        // Texture
        for (name in source.textures) {
            material.setTexture(name, _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_4__/* .Texture */ .g.Parse(source.textures[name], scene, rootUrl));
        }
        // Texture arrays
        for (name in source.textureArrays) {
            const array = source.textureArrays[name];
            const textureArray = [];
            for (let index = 0; index < array.length; index++) {
                textureArray.push(_Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_4__/* .Texture */ .g.Parse(array[index], scene, rootUrl));
            }
            material.setTextureArray(name, textureArray);
        }
        // Int
        for (name in source.ints) {
            material.setInt(name, source.ints[name]);
        }
        // UInt
        for (name in source.uints) {
            material.setUInt(name, source.uints[name]);
        }
        // Float
        for (name in source.floats) {
            material.setFloat(name, source.floats[name]);
        }
        // Floats
        for (name in source.floatsArrays) {
            material.setFloats(name, source.floatsArrays[name]);
        }
        // Color3
        for (name in source.colors3) {
            material.setColor3(name, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__/* .Color3 */ .v9.FromArray(source.colors3[name]));
        }
        // Color3 arrays
        for (name in source.colors3Arrays) {
            const colors = source.colors3Arrays[name]
                .reduce((arr, num, i) => {
                if (i % 3 === 0) {
                    arr.push([num]);
                }
                else {
                    arr[arr.length - 1].push(num);
                }
                return arr;
            }, [])
                .map((color) => _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__/* .Color3 */ .v9.FromArray(color));
            material.setColor3Array(name, colors);
        }
        // Color4
        for (name in source.colors4) {
            material.setColor4(name, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__/* .Color4 */ .ov.FromArray(source.colors4[name]));
        }
        // Color4 arrays
        for (name in source.colors4Arrays) {
            const colors = source.colors4Arrays[name]
                .reduce((arr, num, i) => {
                if (i % 4 === 0) {
                    arr.push([num]);
                }
                else {
                    arr[arr.length - 1].push(num);
                }
                return arr;
            }, [])
                .map((color) => _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_6__/* .Color4 */ .ov.FromArray(color));
            material.setColor4Array(name, colors);
        }
        // Vector2
        for (name in source.vectors2) {
            material.setVector2(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector2 */ .I9.FromArray(source.vectors2[name]));
        }
        // Vector3
        for (name in source.vectors3) {
            material.setVector3(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.FromArray(source.vectors3[name]));
        }
        // Vector4
        for (name in source.vectors4) {
            material.setVector4(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector4 */ .IU.FromArray(source.vectors4[name]));
        }
        // Quaternion
        for (name in source.quaternions) {
            material.setQuaternion(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion */ .PT.FromArray(source.quaternions[name]));
        }
        // Matrix
        for (name in source.matrices) {
            material.setMatrix(name, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromArray(source.matrices[name]));
        }
        // MatrixArray
        for (name in source.matrixArray) {
            material._matrixArrays[name] = new Float32Array(source.matrixArray[name]);
        }
        // Matrix 3x3
        for (name in source.matrices3x3) {
            material.setMatrix3x3(name, source.matrices3x3[name]);
        }
        // Matrix 2x2
        for (name in source.matrices2x2) {
            material.setMatrix2x2(name, source.matrices2x2[name]);
        }
        // Vector2Array
        for (name in source.vectors2Arrays) {
            material.setArray2(name, source.vectors2Arrays[name]);
        }
        // Vector3Array
        for (name in source.vectors3Arrays) {
            material.setArray3(name, source.vectors3Arrays[name]);
        }
        // Vector4Array
        for (name in source.vectors4Arrays) {
            material.setArray4(name, source.vectors4Arrays[name]);
        }
        // QuaternionArray
        for (name in source.quaternionsArrays) {
            material.setArray4(name, source.quaternionsArrays[name]);
        }
        return material;
    }
    /**
     * Creates a new ShaderMaterial from a snippet saved in a remote file
     * @param name defines the name of the ShaderMaterial to create (can be null or empty to use the one from the json data)
     * @param url defines the url to load from
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @returns a promise that will resolve to the new ShaderMaterial
     */
    static ParseFromFileAsync(name, url, scene, rootUrl = "") {
        return new Promise((resolve, reject) => {
            const request = new _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_8__/* .WebRequest */ .u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const serializationObject = JSON.parse(request.responseText);
                        const output = this.Parse(serializationObject, scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__/* .EngineStore */ .q.LastCreatedScene, rootUrl);
                        if (name) {
                            output.name = name;
                        }
                        resolve(output);
                    }
                    else {
                        reject("Unable to load the ShaderMaterial");
                    }
                }
            });
            request.open("GET", url);
            request.send();
        });
    }
    /**
     * Creates a ShaderMaterial from a snippet saved by the Inspector
     * @param snippetId defines the snippet to load
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @returns a promise that will resolve to the new ShaderMaterial
     */
    static ParseFromSnippetAsync(snippetId, scene, rootUrl = "") {
        return new Promise((resolve, reject) => {
            const request = new _Misc_webRequest_js__WEBPACK_IMPORTED_MODULE_8__/* .WebRequest */ .u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);
                        const serializationObject = JSON.parse(snippet.shaderMaterial);
                        const output = this.Parse(serializationObject, scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__/* .EngineStore */ .q.LastCreatedScene, rootUrl);
                        output.snippetId = snippetId;
                        resolve(output);
                    }
                    else {
                        reject("Unable to load the snippet " + snippetId);
                    }
                }
            });
            request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/"));
            request.send();
        });
    }
}
/** Define the Url to load snippets */
ShaderMaterial.SnippetUrl = `https://snippet.babylonjs.com`;
/**
 * Creates a ShaderMaterial from a snippet saved by the Inspector
 * @deprecated Please use ParseFromSnippetAsync instead
 * @param snippetId defines the snippet to load
 * @param scene defines the hosting scene
 * @param rootUrl defines the root URL to use to load textures and relative dependencies
 * @returns a promise that will resolve to the new ShaderMaterial
 */
ShaderMaterial.CreateFromSnippetAsync = ShaderMaterial.ParseFromSnippetAsync;
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_5__/* .RegisterClass */ .Y5)("BABYLON.ShaderMaterial", ShaderMaterial);
//# sourceMappingURL=shaderMaterial.js.map

/***/ }),

/***/ 2093:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   F: () => (/* binding */ StandardMaterial),
/* harmony export */   f: () => (/* binding */ StandardMaterialDefines)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17931);
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(87491);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26041);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95616);
/* harmony import */ var _prePassConfiguration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97667);
/* harmony import */ var _imageProcessingConfiguration_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(32033);
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28986);
/* harmony import */ var _Materials_materialDefines_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(79526);
/* harmony import */ var _pushMaterial_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(21644);
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7481);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(56552);
/* harmony import */ var _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(10633);
/* harmony import */ var _effectFallbacks_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(82565);
/* harmony import */ var _material_detailMapConfiguration_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(97841);
/* harmony import */ var _clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(30492);
/* harmony import */ var _materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(80467);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(26877);
/* harmony import */ var _materialHelper_geometryrendering_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(18598);

/* eslint-disable @typescript-eslint/naming-convention */





















const onCreatedEffectParameters = { effect: null, subMesh: null };
/** @internal */
class StandardMaterialDefines extends _Materials_materialDefines_js__WEBPACK_IMPORTED_MODULE_10__/* .MaterialDefines */ .M {
    /**
     * Initializes the Standard Material defines.
     * @param externalProperties The external properties
     */
    constructor(externalProperties) {
        super(externalProperties);
        this.MAINUV1 = false;
        this.MAINUV2 = false;
        this.MAINUV3 = false;
        this.MAINUV4 = false;
        this.MAINUV5 = false;
        this.MAINUV6 = false;
        this.DIFFUSE = false;
        this.DIFFUSEDIRECTUV = 0;
        this.BAKED_VERTEX_ANIMATION_TEXTURE = false;
        this.AMBIENT = false;
        this.AMBIENTDIRECTUV = 0;
        this.OPACITY = false;
        this.OPACITYDIRECTUV = 0;
        this.OPACITYRGB = false;
        this.REFLECTION = false;
        this.EMISSIVE = false;
        this.EMISSIVEDIRECTUV = 0;
        this.SPECULAR = false;
        this.SPECULARDIRECTUV = 0;
        this.BUMP = false;
        this.BUMPDIRECTUV = 0;
        this.PARALLAX = false;
        this.PARALLAX_RHS = false;
        this.PARALLAXOCCLUSION = false;
        this.SPECULAROVERALPHA = false;
        this.CLIPPLANE = false;
        this.CLIPPLANE2 = false;
        this.CLIPPLANE3 = false;
        this.CLIPPLANE4 = false;
        this.CLIPPLANE5 = false;
        this.CLIPPLANE6 = false;
        this.ALPHATEST = false;
        this.DEPTHPREPASS = false;
        this.ALPHAFROMDIFFUSE = false;
        this.POINTSIZE = false;
        this.FOG = false;
        this.SPECULARTERM = false;
        this.DIFFUSEFRESNEL = false;
        this.OPACITYFRESNEL = false;
        this.REFLECTIONFRESNEL = false;
        this.REFRACTIONFRESNEL = false;
        this.EMISSIVEFRESNEL = false;
        this.FRESNEL = false;
        this.NORMAL = false;
        this.TANGENT = false;
        this.UV1 = false;
        this.UV2 = false;
        this.UV3 = false;
        this.UV4 = false;
        this.UV5 = false;
        this.UV6 = false;
        this.VERTEXCOLOR = false;
        this.VERTEXALPHA = false;
        this.NUM_BONE_INFLUENCERS = 0;
        this.BonesPerMesh = 0;
        this.BONETEXTURE = false;
        this.BONES_VELOCITY_ENABLED = false;
        this.INSTANCES = false;
        this.THIN_INSTANCES = false;
        this.INSTANCESCOLOR = false;
        this.GLOSSINESS = false;
        this.ROUGHNESS = false;
        this.EMISSIVEASILLUMINATION = false;
        this.LINKEMISSIVEWITHDIFFUSE = false;
        this.REFLECTIONFRESNELFROMSPECULAR = false;
        this.LIGHTMAP = false;
        this.LIGHTMAPDIRECTUV = 0;
        this.OBJECTSPACE_NORMALMAP = false;
        this.USELIGHTMAPASSHADOWMAP = false;
        this.REFLECTIONMAP_3D = false;
        this.REFLECTIONMAP_SPHERICAL = false;
        this.REFLECTIONMAP_PLANAR = false;
        this.REFLECTIONMAP_CUBIC = false;
        this.USE_LOCAL_REFLECTIONMAP_CUBIC = false;
        this.USE_LOCAL_REFRACTIONMAP_CUBIC = false;
        this.REFLECTIONMAP_PROJECTION = false;
        this.REFLECTIONMAP_SKYBOX = false;
        this.REFLECTIONMAP_EXPLICIT = false;
        this.REFLECTIONMAP_EQUIRECTANGULAR = false;
        this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
        this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
        this.REFLECTIONMAP_OPPOSITEZ = false;
        this.INVERTCUBICMAP = false;
        this.LOGARITHMICDEPTH = false;
        this.REFRACTION = false;
        this.REFRACTIONMAP_3D = false;
        this.REFLECTIONOVERALPHA = false;
        this.TWOSIDEDLIGHTING = false;
        this.SHADOWFLOAT = false;
        this.MORPHTARGETS = false;
        this.MORPHTARGETS_NORMAL = false;
        this.MORPHTARGETS_TANGENT = false;
        this.MORPHTARGETS_UV = false;
        this.NUM_MORPH_INFLUENCERS = 0;
        this.MORPHTARGETS_TEXTURE = false;
        this.NONUNIFORMSCALING = false; // https://playground.babylonjs.com#V6DWIH
        this.PREMULTIPLYALPHA = false; // https://playground.babylonjs.com#LNVJJ7
        this.ALPHATEST_AFTERALLALPHACOMPUTATIONS = false;
        this.ALPHABLEND = true;
        this.PREPASS = false;
        this.PREPASS_COLOR = false;
        this.PREPASS_COLOR_INDEX = -1;
        this.PREPASS_IRRADIANCE = false;
        this.PREPASS_IRRADIANCE_INDEX = -1;
        this.PREPASS_ALBEDO = false;
        this.PREPASS_ALBEDO_INDEX = -1;
        this.PREPASS_ALBEDO_SQRT = false;
        this.PREPASS_ALBEDO_SQRT_INDEX = -1;
        this.PREPASS_DEPTH = false;
        this.PREPASS_DEPTH_INDEX = -1;
        this.PREPASS_SCREENSPACE_DEPTH = false;
        this.PREPASS_SCREENSPACE_DEPTH_INDEX = -1;
        this.PREPASS_NORMAL = false;
        this.PREPASS_NORMAL_INDEX = -1;
        this.PREPASS_NORMAL_WORLDSPACE = false;
        this.PREPASS_WORLD_NORMAL = false;
        this.PREPASS_WORLD_NORMAL_INDEX = -1;
        this.PREPASS_POSITION = false;
        this.PREPASS_POSITION_INDEX = -1;
        this.PREPASS_LOCAL_POSITION = false;
        this.PREPASS_LOCAL_POSITION_INDEX = -1;
        this.PREPASS_VELOCITY = false;
        this.PREPASS_VELOCITY_INDEX = -1;
        this.PREPASS_VELOCITY_LINEAR = false;
        this.PREPASS_VELOCITY_LINEAR_INDEX = -1;
        this.PREPASS_REFLECTIVITY = false;
        this.PREPASS_REFLECTIVITY_INDEX = -1;
        this.SCENE_MRT_COUNT = 0;
        this.RGBDLIGHTMAP = false;
        this.RGBDREFLECTION = false;
        this.RGBDREFRACTION = false;
        this.IMAGEPROCESSING = false;
        this.VIGNETTE = false;
        this.VIGNETTEBLENDMODEMULTIPLY = false;
        this.VIGNETTEBLENDMODEOPAQUE = false;
        this.TONEMAPPING = 0;
        this.CONTRAST = false;
        this.COLORCURVES = false;
        this.COLORGRADING = false;
        this.COLORGRADING3D = false;
        this.SAMPLER3DGREENDEPTH = false;
        this.SAMPLER3DBGRMAP = false;
        this.DITHER = false;
        this.IMAGEPROCESSINGPOSTPROCESS = false;
        this.SKIPFINALCOLORCLAMP = false;
        this.MULTIVIEW = false;
        this.ORDER_INDEPENDENT_TRANSPARENCY = false;
        this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = false;
        this.CAMERA_ORTHOGRAPHIC = false;
        this.CAMERA_PERSPECTIVE = false;
        /**
         * If the reflection texture on this material is in linear color space
         * @internal
         */
        this.IS_REFLECTION_LINEAR = false;
        /**
         * If the refraction texture on this material is in linear color space
         * @internal
         */
        this.IS_REFRACTION_LINEAR = false;
        this.EXPOSURE = false;
        this.DECAL_AFTER_DETAIL = false;
        this.rebuild();
    }
    setReflectionMode(modeToEnable) {
        const modes = [
            "REFLECTIONMAP_CUBIC",
            "REFLECTIONMAP_EXPLICIT",
            "REFLECTIONMAP_PLANAR",
            "REFLECTIONMAP_PROJECTION",
            "REFLECTIONMAP_PROJECTION",
            "REFLECTIONMAP_SKYBOX",
            "REFLECTIONMAP_SPHERICAL",
            "REFLECTIONMAP_EQUIRECTANGULAR",
            "REFLECTIONMAP_EQUIRECTANGULAR_FIXED",
            "REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED",
        ];
        for (const mode of modes) {
            this[mode] = mode === modeToEnable;
        }
    }
}
/**
 * This is the default material used in Babylon. It is the best trade off between quality
 * and performances.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
 */
class StandardMaterial extends _pushMaterial_js__WEBPACK_IMPORTED_MODULE_11__/* .PushMaterial */ .E {
    /**
     * Gets the image processing configuration used either in this material.
     */
    get imageProcessingConfiguration() {
        return this._imageProcessingConfiguration;
    }
    /**
     * Sets the Default image processing configuration used either in the this material.
     *
     * If sets to null, the scene one is in use.
     */
    set imageProcessingConfiguration(value) {
        this._attachImageProcessingConfiguration(value);
        // Ensure the effect will be rebuilt.
        this._markAllSubMeshesAsTexturesDirty();
    }
    /**
     * Attaches a new image processing configuration to the Standard Material.
     * @param configuration
     */
    _attachImageProcessingConfiguration(configuration) {
        if (configuration === this._imageProcessingConfiguration) {
            return;
        }
        // Detaches observer
        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
        }
        // Pick the scene configuration if needed
        if (!configuration) {
            this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration;
        }
        else {
            this._imageProcessingConfiguration = configuration;
        }
        // Attaches observer
        if (this._imageProcessingConfiguration) {
            this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
                this._markAllSubMeshesAsImageProcessingDirty();
            });
        }
    }
    /**
     * Can this material render to prepass
     */
    get isPrePassCapable() {
        return !this.disableDepthWrite;
    }
    /**
     * Gets whether the color curves effect is enabled.
     */
    get cameraColorCurvesEnabled() {
        return this.imageProcessingConfiguration.colorCurvesEnabled;
    }
    /**
     * Sets whether the color curves effect is enabled.
     */
    set cameraColorCurvesEnabled(value) {
        this.imageProcessingConfiguration.colorCurvesEnabled = value;
    }
    /**
     * Gets whether the color grading effect is enabled.
     */
    get cameraColorGradingEnabled() {
        return this.imageProcessingConfiguration.colorGradingEnabled;
    }
    /**
     * Gets whether the color grading effect is enabled.
     */
    set cameraColorGradingEnabled(value) {
        this.imageProcessingConfiguration.colorGradingEnabled = value;
    }
    /**
     * Gets whether tonemapping is enabled or not.
     */
    get cameraToneMappingEnabled() {
        return this._imageProcessingConfiguration.toneMappingEnabled;
    }
    /**
     * Sets whether tonemapping is enabled or not
     */
    set cameraToneMappingEnabled(value) {
        this._imageProcessingConfiguration.toneMappingEnabled = value;
    }
    /**
     * The camera exposure used on this material.
     * This property is here and not in the camera to allow controlling exposure without full screen post process.
     * This corresponds to a photographic exposure.
     */
    get cameraExposure() {
        return this._imageProcessingConfiguration.exposure;
    }
    /**
     * The camera exposure used on this material.
     * This property is here and not in the camera to allow controlling exposure without full screen post process.
     * This corresponds to a photographic exposure.
     */
    set cameraExposure(value) {
        this._imageProcessingConfiguration.exposure = value;
    }
    /**
     * Gets The camera contrast used on this material.
     */
    get cameraContrast() {
        return this._imageProcessingConfiguration.contrast;
    }
    /**
     * Sets The camera contrast used on this material.
     */
    set cameraContrast(value) {
        this._imageProcessingConfiguration.contrast = value;
    }
    /**
     * Gets the Color Grading 2D Lookup Texture.
     */
    get cameraColorGradingTexture() {
        return this._imageProcessingConfiguration.colorGradingTexture;
    }
    /**
     * Sets the Color Grading 2D Lookup Texture.
     */
    set cameraColorGradingTexture(value) {
        this._imageProcessingConfiguration.colorGradingTexture = value;
    }
    /**
     * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
     * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
     * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
     * corresponding to low luminance, medium luminance, and high luminance areas respectively.
     */
    get cameraColorCurves() {
        return this._imageProcessingConfiguration.colorCurves;
    }
    /**
     * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
     * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
     * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
     * corresponding to low luminance, medium luminance, and high luminance areas respectively.
     */
    set cameraColorCurves(value) {
        this._imageProcessingConfiguration.colorCurves = value;
    }
    /**
     * Can this material render to several textures at once
     */
    get canRenderToMRT() {
        return true;
    }
    /**
     * Instantiates a new standard material.
     * This is the default material used in Babylon. It is the best trade off between quality
     * and performances.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
     * @param name Define the name of the material in the scene
     * @param scene Define the scene the material belong to
     * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
     */
    constructor(name, scene, forceGLSL = false) {
        super(name, scene, undefined, forceGLSL || StandardMaterial.ForceGLSL);
        this._diffuseTexture = null;
        this._ambientTexture = null;
        this._opacityTexture = null;
        this._reflectionTexture = null;
        this._emissiveTexture = null;
        this._specularTexture = null;
        this._bumpTexture = null;
        this._lightmapTexture = null;
        this._refractionTexture = null;
        /**
         * The color of the material lit by the environmental background lighting.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#ambient-color-example
         */
        this.ambientColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_5__/* .Color3 */ .v9(0, 0, 0);
        /**
         * The basic color of the material as viewed under a light.
         */
        this.diffuseColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_5__/* .Color3 */ .v9(1, 1, 1);
        /**
         * Define how the color and intensity of the highlight given by the light in the material.
         */
        this.specularColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_5__/* .Color3 */ .v9(1, 1, 1);
        /**
         * Define the color of the material as if self lit.
         * This will be mixed in the final result even in the absence of light.
         */
        this.emissiveColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_5__/* .Color3 */ .v9(0, 0, 0);
        /**
         * Defines how sharp are the highlights in the material.
         * The bigger the value the sharper giving a more glossy feeling to the result.
         * Reversely, the smaller the value the blurrier giving a more rough feeling to the result.
         */
        this.specularPower = 64;
        this._useAlphaFromDiffuseTexture = false;
        this._useEmissiveAsIllumination = false;
        this._linkEmissiveWithDiffuse = false;
        this._useSpecularOverAlpha = false;
        this._useReflectionOverAlpha = false;
        this._disableLighting = false;
        this._useObjectSpaceNormalMap = false;
        this._useParallax = false;
        this._useParallaxOcclusion = false;
        /**
         * Apply a scaling factor that determine which "depth" the height map should reprensent. A value between 0.05 and 0.1 is reasonnable in Parallax, you can reach 0.2 using Parallax Occlusion.
         */
        this.parallaxScaleBias = 0.05;
        this._roughness = 0;
        /**
         * In case of refraction, define the value of the index of refraction.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#how-to-obtain-reflections-and-refractions
         */
        this.indexOfRefraction = 0.98;
        /**
         * Invert the refraction texture alongside the y axis.
         * It can be useful with procedural textures or probe for instance.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#how-to-obtain-reflections-and-refractions
         */
        this.invertRefractionY = true;
        /**
         * Defines the alpha limits in alpha test mode.
         */
        this.alphaCutOff = 0.4;
        this._useLightmapAsShadowmap = false;
        this._useReflectionFresnelFromSpecular = false;
        this._useGlossinessFromSpecularMapAlpha = false;
        this._maxSimultaneousLights = 4;
        this._invertNormalMapX = false;
        this._invertNormalMapY = false;
        this._twoSidedLighting = false;
        this._applyDecalMapAfterDetailMap = false;
        this._shadersLoaded = false;
        this._renderTargets = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_2__/* .SmartArray */ .L(16);
        this._worldViewProjectionMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Zero();
        this._globalAmbientColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_5__/* .Color3 */ .v9(0, 0, 0);
        this._cacheHasRenderTargetTextures = false;
        this.detailMap = new _material_detailMapConfiguration_js__WEBPACK_IMPORTED_MODULE_16__/* .DetailMapConfiguration */ .c(this);
        // Setup the default processing configuration to the scene.
        this._attachImageProcessingConfiguration(null);
        this.prePassConfiguration = new _prePassConfiguration_js__WEBPACK_IMPORTED_MODULE_7__/* .PrePassConfiguration */ .J();
        this.getRenderTargetTextures = () => {
            this._renderTargets.reset();
            if (StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
                this._renderTargets.push(this._reflectionTexture);
            }
            if (StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) {
                this._renderTargets.push(this._refractionTexture);
            }
            this._eventInfo.renderTargets = this._renderTargets;
            this._callbackPluginEventFillRenderTargetTextures(this._eventInfo);
            return this._renderTargets;
        };
    }
    /**
     * Gets a boolean indicating that current material needs to register RTT
     */
    get hasRenderTargetTextures() {
        if (StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
            return true;
        }
        if (StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) {
            return true;
        }
        return this._cacheHasRenderTargetTextures;
    }
    /**
     * Gets the current class name of the material e.g. "StandardMaterial"
     * Mainly use in serialization.
     * @returns the class name
     */
    getClassName() {
        return "StandardMaterial";
    }
    /**
     * Specifies if the material will require alpha blending
     * @returns a boolean specifying if alpha blending is needed
     */
    needAlphaBlending() {
        if (this._disableAlphaBlending) {
            return false;
        }
        return (this.alpha < 1.0 ||
            this._opacityTexture != null ||
            this._shouldUseAlphaFromDiffuseTexture() ||
            (this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled));
    }
    /**
     * Specifies if this material should be rendered in alpha test mode
     * @returns a boolean specifying if an alpha test is needed.
     */
    needAlphaTesting() {
        if (this._forceAlphaTest) {
            return true;
        }
        return this._hasAlphaChannel() && (this._transparencyMode == null || this._transparencyMode === _Materials_material_js__WEBPACK_IMPORTED_MODULE_9__/* .Material */ .i.MATERIAL_ALPHATEST);
    }
    /**
     * @returns whether or not the alpha value of the diffuse texture should be used for alpha blending.
     */
    _shouldUseAlphaFromDiffuseTexture() {
        return this._diffuseTexture != null && this._diffuseTexture.hasAlpha && this._useAlphaFromDiffuseTexture && this._transparencyMode !== _Materials_material_js__WEBPACK_IMPORTED_MODULE_9__/* .Material */ .i.MATERIAL_OPAQUE;
    }
    /**
     * @returns whether or not there is a usable alpha channel for transparency.
     */
    _hasAlphaChannel() {
        return (this._diffuseTexture != null && this._diffuseTexture.hasAlpha) || this._opacityTexture != null;
    }
    /**
     * Get the texture used for alpha test purpose.
     * @returns the diffuse texture in case of the standard material.
     */
    getAlphaTestTexture() {
        return this._diffuseTexture;
    }
    /**
     * Get if the submesh is ready to be used and all its information available.
     * Child classes can use it to update shaders
     * @param mesh defines the mesh to check
     * @param subMesh defines which submesh to check
     * @param useInstances specifies that instances should be used
     * @returns a boolean indicating that the submesh is ready or not
     */
    isReadyForSubMesh(mesh, subMesh, useInstances = false) {
        if (!this._uniformBufferLayoutBuilt) {
            this.buildUniformLayout();
        }
        const drawWrapper = subMesh._drawWrapper;
        if (drawWrapper.effect && this.isFrozen) {
            if (drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            this._callbackPluginEventGeneric(4 /* MaterialPluginEvent.GetDefineNames */, this._eventInfo);
            subMesh.materialDefines = new StandardMaterialDefines(this._eventInfo.defineNames);
        }
        const scene = this.getScene();
        const defines = subMesh.materialDefines;
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        const engine = scene.getEngine();
        // Lights
        defines._needNormals = (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForLights */ .az)(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting);
        // Multiview
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForMultiview */ .VO)(scene, defines);
        // PrePass
        const oit = this.needAlphaBlendingForMesh(mesh) && this.getScene().useOrderIndependentTransparency;
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForPrePass */ .N4)(scene, defines, this.canRenderToMRT && !oit);
        // Order independant transparency
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForOIT */ .Nc)(scene, defines, oit);
        _materialHelper_geometryrendering_js__WEBPACK_IMPORTED_MODULE_20__/* .MaterialHelperGeometryRendering */ .m.PrepareDefines(engine.currentRenderPassId, mesh, defines);
        // Textures
        if (defines._areTexturesDirty) {
            this._eventInfo.hasRenderTargetTextures = false;
            this._callbackPluginEventHasRenderTargetTextures(this._eventInfo);
            this._cacheHasRenderTargetTextures = this._eventInfo.hasRenderTargetTextures;
            defines._needUVs = false;
            for (let i = 1; i <= 6; ++i) {
                defines["MAINUV" + i] = false;
            }
            if (scene.texturesEnabled) {
                defines.DIFFUSEDIRECTUV = 0;
                defines.BUMPDIRECTUV = 0;
                defines.AMBIENTDIRECTUV = 0;
                defines.OPACITYDIRECTUV = 0;
                defines.EMISSIVEDIRECTUV = 0;
                defines.SPECULARDIRECTUV = 0;
                defines.LIGHTMAPDIRECTUV = 0;
                if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
                    if (!this._diffuseTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    else {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForMergedUV */ .YT)(this._diffuseTexture, defines, "DIFFUSE");
                    }
                }
                else {
                    defines.DIFFUSE = false;
                }
                if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) {
                    if (!this._ambientTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    else {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForMergedUV */ .YT)(this._ambientTexture, defines, "AMBIENT");
                    }
                }
                else {
                    defines.AMBIENT = false;
                }
                if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) {
                    if (!this._opacityTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    else {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForMergedUV */ .YT)(this._opacityTexture, defines, "OPACITY");
                        defines.OPACITYRGB = this._opacityTexture.getAlphaFromRGB;
                    }
                }
                else {
                    defines.OPACITY = false;
                }
                if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {
                    if (!this._reflectionTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    else {
                        defines._needNormals = true;
                        defines.REFLECTION = true;
                        defines.ROUGHNESS = this._roughness > 0;
                        defines.REFLECTIONOVERALPHA = this._useReflectionOverAlpha;
                        defines.INVERTCUBICMAP = this._reflectionTexture.coordinatesMode === _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.INVCUBIC_MODE;
                        defines.REFLECTIONMAP_3D = this._reflectionTexture.isCube;
                        defines.REFLECTIONMAP_OPPOSITEZ =
                            defines.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !this._reflectionTexture.invertZ : this._reflectionTexture.invertZ;
                        defines.RGBDREFLECTION = this._reflectionTexture.isRGBD;
                        switch (this._reflectionTexture.coordinatesMode) {
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.EXPLICIT_MODE:
                                defines.setReflectionMode("REFLECTIONMAP_EXPLICIT");
                                break;
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.PLANAR_MODE:
                                defines.setReflectionMode("REFLECTIONMAP_PLANAR");
                                break;
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.PROJECTION_MODE:
                                defines.setReflectionMode("REFLECTIONMAP_PROJECTION");
                                break;
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.SKYBOX_MODE:
                                defines.setReflectionMode("REFLECTIONMAP_SKYBOX");
                                break;
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.SPHERICAL_MODE:
                                defines.setReflectionMode("REFLECTIONMAP_SPHERICAL");
                                break;
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.EQUIRECTANGULAR_MODE:
                                defines.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");
                                break;
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.FIXED_EQUIRECTANGULAR_MODE:
                                defines.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");
                                break;
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
                                defines.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");
                                break;
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.CUBIC_MODE:
                            case _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_12__/* .Texture */ .g.INVCUBIC_MODE:
                            default:
                                defines.setReflectionMode("REFLECTIONMAP_CUBIC");
                                break;
                        }
                        defines.USE_LOCAL_REFLECTIONMAP_CUBIC = this._reflectionTexture.boundingBoxSize ? true : false;
                    }
                }
                else {
                    defines.REFLECTION = false;
                    defines.REFLECTIONMAP_OPPOSITEZ = false;
                }
                if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) {
                    if (!this._emissiveTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    else {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForMergedUV */ .YT)(this._emissiveTexture, defines, "EMISSIVE");
                    }
                }
                else {
                    defines.EMISSIVE = false;
                }
                if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) {
                    if (!this._lightmapTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    else {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForMergedUV */ .YT)(this._lightmapTexture, defines, "LIGHTMAP");
                        defines.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap;
                        defines.RGBDLIGHTMAP = this._lightmapTexture.isRGBD;
                    }
                }
                else {
                    defines.LIGHTMAP = false;
                }
                if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) {
                    if (!this._specularTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    else {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForMergedUV */ .YT)(this._specularTexture, defines, "SPECULAR");
                        defines.GLOSSINESS = this._useGlossinessFromSpecularMapAlpha;
                    }
                }
                else {
                    defines.SPECULAR = false;
                }
                if (scene.getEngine().getCaps().standardDerivatives && this._bumpTexture && StandardMaterial.BumpTextureEnabled) {
                    // Bump texture can not be not blocking.
                    if (!this._bumpTexture.isReady()) {
                        return false;
                    }
                    else {
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForMergedUV */ .YT)(this._bumpTexture, defines, "BUMP");
                        defines.PARALLAX = this._useParallax;
                        defines.PARALLAX_RHS = scene.useRightHandedSystem;
                        defines.PARALLAXOCCLUSION = this._useParallaxOcclusion;
                    }
                    defines.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap;
                }
                else {
                    defines.BUMP = false;
                    defines.PARALLAX = false;
                    defines.PARALLAX_RHS = false;
                    defines.PARALLAXOCCLUSION = false;
                }
                if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {
                    if (!this._refractionTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    else {
                        defines._needUVs = true;
                        defines.REFRACTION = true;
                        defines.REFRACTIONMAP_3D = this._refractionTexture.isCube;
                        defines.RGBDREFRACTION = this._refractionTexture.isRGBD;
                        defines.USE_LOCAL_REFRACTIONMAP_CUBIC = this._refractionTexture.boundingBoxSize ? true : false;
                    }
                }
                else {
                    defines.REFRACTION = false;
                }
                defines.TWOSIDEDLIGHTING = !this._backFaceCulling && this._twoSidedLighting;
            }
            else {
                defines.DIFFUSE = false;
                defines.AMBIENT = false;
                defines.OPACITY = false;
                defines.REFLECTION = false;
                defines.EMISSIVE = false;
                defines.LIGHTMAP = false;
                defines.BUMP = false;
                defines.REFRACTION = false;
            }
            defines.ALPHAFROMDIFFUSE = this._shouldUseAlphaFromDiffuseTexture();
            defines.EMISSIVEASILLUMINATION = this._useEmissiveAsIllumination;
            defines.LINKEMISSIVEWITHDIFFUSE = this._linkEmissiveWithDiffuse;
            defines.SPECULAROVERALPHA = this._useSpecularOverAlpha;
            defines.PREMULTIPLYALPHA = this.alphaMode === 7 || this.alphaMode === 8;
            defines.ALPHATEST_AFTERALLALPHACOMPUTATIONS = this.transparencyMode !== null;
            defines.ALPHABLEND = this.transparencyMode === null || this.needAlphaBlendingForMesh(mesh); // check on null for backward compatibility
        }
        this._eventInfo.isReadyForSubMesh = true;
        this._eventInfo.defines = defines;
        this._eventInfo.subMesh = subMesh;
        this._callbackPluginEventIsReadyForSubMesh(this._eventInfo);
        if (!this._eventInfo.isReadyForSubMesh) {
            return false;
        }
        if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {
            if (!this._imageProcessingConfiguration.isReady()) {
                return false;
            }
            this._imageProcessingConfiguration.prepareDefines(defines);
            defines.IS_REFLECTION_LINEAR = this.reflectionTexture != null && !this.reflectionTexture.gammaSpace;
            defines.IS_REFRACTION_LINEAR = this.refractionTexture != null && !this.refractionTexture.gammaSpace;
        }
        if (defines._areFresnelDirty) {
            if (StandardMaterial.FresnelEnabled) {
                // Fresnel
                if (this._diffuseFresnelParameters ||
                    this._opacityFresnelParameters ||
                    this._emissiveFresnelParameters ||
                    this._refractionFresnelParameters ||
                    this._reflectionFresnelParameters) {
                    defines.DIFFUSEFRESNEL = this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled;
                    defines.OPACITYFRESNEL = this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled;
                    defines.REFLECTIONFRESNEL = this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled;
                    defines.REFLECTIONFRESNELFROMSPECULAR = this._useReflectionFresnelFromSpecular;
                    defines.REFRACTIONFRESNEL = this._refractionFresnelParameters && this._refractionFresnelParameters.isEnabled;
                    defines.EMISSIVEFRESNEL = this._emissiveFresnelParameters && this._emissiveFresnelParameters.isEnabled;
                    defines._needNormals = true;
                    defines.FRESNEL = true;
                }
            }
            else {
                defines.FRESNEL = false;
            }
        }
        // Misc.
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForMisc */ .fm)(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh) || this._forceAlphaTest, defines, this._applyDecalMapAfterDetailMap);
        // Values that need to be evaluated on every frame
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForFrameBoundValues */ .OR)(scene, engine, this, defines, useInstances, null, subMesh.getRenderingMesh().hasThinInstances);
        // External config
        this._eventInfo.defines = defines;
        this._eventInfo.mesh = mesh;
        this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo);
        // Attribs
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareDefinesForAttributes */ .qB)(mesh, defines, true, true, true);
        // External config
        this._callbackPluginEventPrepareDefines(this._eventInfo);
        // Get correct effect
        let forceWasNotReadyPreviously = false;
        if (defines.isDirty) {
            const lightDisposed = defines._areLightsDisposed;
            defines.markAsProcessed();
            // Fallbacks
            const fallbacks = new _effectFallbacks_js__WEBPACK_IMPORTED_MODULE_15__/* .EffectFallbacks */ .J();
            if (defines.REFLECTION) {
                fallbacks.addFallback(0, "REFLECTION");
            }
            if (defines.SPECULAR) {
                fallbacks.addFallback(0, "SPECULAR");
            }
            if (defines.BUMP) {
                fallbacks.addFallback(0, "BUMP");
            }
            if (defines.PARALLAX) {
                fallbacks.addFallback(1, "PARALLAX");
            }
            if (defines.PARALLAX_RHS) {
                fallbacks.addFallback(1, "PARALLAX_RHS");
            }
            if (defines.PARALLAXOCCLUSION) {
                fallbacks.addFallback(0, "PARALLAXOCCLUSION");
            }
            if (defines.SPECULAROVERALPHA) {
                fallbacks.addFallback(0, "SPECULAROVERALPHA");
            }
            if (defines.FOG) {
                fallbacks.addFallback(1, "FOG");
            }
            if (defines.POINTSIZE) {
                fallbacks.addFallback(0, "POINTSIZE");
            }
            if (defines.LOGARITHMICDEPTH) {
                fallbacks.addFallback(0, "LOGARITHMICDEPTH");
            }
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .HandleFallbacksForShadows */ .c4)(defines, fallbacks, this._maxSimultaneousLights);
            if (defines.SPECULARTERM) {
                fallbacks.addFallback(0, "SPECULARTERM");
            }
            if (defines.DIFFUSEFRESNEL) {
                fallbacks.addFallback(1, "DIFFUSEFRESNEL");
            }
            if (defines.OPACITYFRESNEL) {
                fallbacks.addFallback(2, "OPACITYFRESNEL");
            }
            if (defines.REFLECTIONFRESNEL) {
                fallbacks.addFallback(3, "REFLECTIONFRESNEL");
            }
            if (defines.EMISSIVEFRESNEL) {
                fallbacks.addFallback(4, "EMISSIVEFRESNEL");
            }
            if (defines.FRESNEL) {
                fallbacks.addFallback(4, "FRESNEL");
            }
            if (defines.MULTIVIEW) {
                fallbacks.addFallback(0, "MULTIVIEW");
            }
            //Attributes
            const attribs = [_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__/* .VertexBuffer */ .R.PositionKind];
            if (defines.NORMAL) {
                attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__/* .VertexBuffer */ .R.NormalKind);
            }
            if (defines.TANGENT) {
                attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__/* .VertexBuffer */ .R.TangentKind);
            }
            for (let i = 1; i <= 6; ++i) {
                if (defines["UV" + i]) {
                    attribs.push(`uv${i === 1 ? "" : i}`);
                }
            }
            if (defines.VERTEXCOLOR) {
                attribs.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__/* .VertexBuffer */ .R.ColorKind);
            }
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareAttributesForBones */ .ni)(attribs, mesh, defines, fallbacks);
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareAttributesForInstances */ .ER)(attribs, defines);
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareAttributesForMorphTargets */ .IF)(attribs, mesh, defines);
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareAttributesForBakedVertexAnimation */ .J2)(attribs, mesh, defines);
            let shaderName = "default";
            const uniforms = [
                "world",
                "view",
                "viewProjection",
                "vEyePosition",
                "vLightsType",
                "vAmbientColor",
                "vDiffuseColor",
                "vSpecularColor",
                "vEmissiveColor",
                "visibility",
                "vFogInfos",
                "vFogColor",
                "pointSize",
                "vDiffuseInfos",
                "vAmbientInfos",
                "vOpacityInfos",
                "vReflectionInfos",
                "vEmissiveInfos",
                "vSpecularInfos",
                "vBumpInfos",
                "vLightmapInfos",
                "vRefractionInfos",
                "mBones",
                "diffuseMatrix",
                "ambientMatrix",
                "opacityMatrix",
                "reflectionMatrix",
                "emissiveMatrix",
                "specularMatrix",
                "bumpMatrix",
                "normalMatrix",
                "lightmapMatrix",
                "refractionMatrix",
                "diffuseLeftColor",
                "diffuseRightColor",
                "opacityParts",
                "reflectionLeftColor",
                "reflectionRightColor",
                "emissiveLeftColor",
                "emissiveRightColor",
                "refractionLeftColor",
                "refractionRightColor",
                "vReflectionPosition",
                "vReflectionSize",
                "vRefractionPosition",
                "vRefractionSize",
                "logarithmicDepthConstant",
                "vTangentSpaceParams",
                "alphaCutOff",
                "boneTextureWidth",
                "morphTargetTextureInfo",
                "morphTargetTextureIndices",
            ];
            const samplers = [
                "diffuseSampler",
                "ambientSampler",
                "opacitySampler",
                "reflectionCubeSampler",
                "reflection2DSampler",
                "emissiveSampler",
                "specularSampler",
                "bumpSampler",
                "lightmapSampler",
                "refractionCubeSampler",
                "refraction2DSampler",
                "boneSampler",
                "morphTargets",
                "oitDepthSampler",
                "oitFrontColorSampler",
            ];
            const uniformBuffers = ["Material", "Scene", "Mesh"];
            const indexParameters = { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS };
            this._eventInfo.fallbacks = fallbacks;
            this._eventInfo.fallbackRank = 0;
            this._eventInfo.defines = defines;
            this._eventInfo.uniforms = uniforms;
            this._eventInfo.attributes = attribs;
            this._eventInfo.samplers = samplers;
            this._eventInfo.uniformBuffersNames = uniformBuffers;
            this._eventInfo.customCode = undefined;
            this._eventInfo.mesh = mesh;
            this._eventInfo.indexParameters = indexParameters;
            this._callbackPluginEventGeneric(128 /* MaterialPluginEvent.PrepareEffect */, this._eventInfo);
            _materialHelper_geometryrendering_js__WEBPACK_IMPORTED_MODULE_20__/* .MaterialHelperGeometryRendering */ .m.AddUniformsAndSamplers(uniforms, samplers);
            _prePassConfiguration_js__WEBPACK_IMPORTED_MODULE_7__/* .PrePassConfiguration */ .J.AddUniforms(uniforms);
            _prePassConfiguration_js__WEBPACK_IMPORTED_MODULE_7__/* .PrePassConfiguration */ .J.AddSamplers(samplers);
            if (_imageProcessingConfiguration_js__WEBPACK_IMPORTED_MODULE_8__/* .ImageProcessingConfiguration */ .p) {
                _imageProcessingConfiguration_js__WEBPACK_IMPORTED_MODULE_8__/* .ImageProcessingConfiguration */ .p.PrepareUniforms(uniforms, defines);
                _imageProcessingConfiguration_js__WEBPACK_IMPORTED_MODULE_8__/* .ImageProcessingConfiguration */ .p.PrepareSamplers(samplers, defines);
            }
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .PrepareUniformsAndSamplersList */ .Bb)({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
                maxSimultaneousLights: this._maxSimultaneousLights,
            });
            (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_17__/* .addClipPlaneUniforms */ .TV)(uniforms);
            const csnrOptions = {};
            if (this.customShaderNameResolve) {
                shaderName = this.customShaderNameResolve(shaderName, uniforms, uniformBuffers, samplers, defines, attribs, csnrOptions);
            }
            const join = defines.toString();
            const previousEffect = subMesh.effect;
            let effect = scene.getEngine().createEffect(shaderName, {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters,
                processFinalCode: csnrOptions.processFinalCode,
                processCodeAfterIncludes: this._eventInfo.customCode,
                multiTarget: defines.PREPASS,
                shaderLanguage: this._shaderLanguage,
                extraInitializationsAsync: this._shadersLoaded
                    ? undefined
                    : async () => {
                        if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 59235)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 45791))]);
                        }
                        else {
                            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 14268)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 42319))]);
                        }
                        this._shadersLoaded = true;
                    },
            }, engine);
            this._eventInfo.customCode = undefined;
            if (effect) {
                if (this._onEffectCreatedObservable) {
                    onCreatedEffectParameters.effect = effect;
                    onCreatedEffectParameters.subMesh = subMesh;
                    this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters);
                }
                // Use previous effect while new one is compiling
                if (this.allowShaderHotSwapping && previousEffect && !effect.isReady()) {
                    effect = previousEffect;
                    defines.markAsUnprocessed();
                    forceWasNotReadyPreviously = this.isFrozen;
                    if (lightDisposed) {
                        // re register in case it takes more than one frame.
                        defines._areLightsDisposed = true;
                        return false;
                    }
                }
                else {
                    scene.resetCachedMaterial();
                    subMesh.setEffect(effect, defines, this._materialContext);
                }
            }
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        drawWrapper._wasPreviouslyReady = forceWasNotReadyPreviously ? false : true;
        drawWrapper._wasPreviouslyUsingInstances = useInstances;
        this._checkScenePerformancePriority();
        return true;
    }
    /**
     * Builds the material UBO layouts.
     * Used internally during the effect preparation.
     */
    buildUniformLayout() {
        // Order is important !
        const ubo = this._uniformBuffer;
        ubo.addUniform("diffuseLeftColor", 4);
        ubo.addUniform("diffuseRightColor", 4);
        ubo.addUniform("opacityParts", 4);
        ubo.addUniform("reflectionLeftColor", 4);
        ubo.addUniform("reflectionRightColor", 4);
        ubo.addUniform("refractionLeftColor", 4);
        ubo.addUniform("refractionRightColor", 4);
        ubo.addUniform("emissiveLeftColor", 4);
        ubo.addUniform("emissiveRightColor", 4);
        ubo.addUniform("vDiffuseInfos", 2);
        ubo.addUniform("vAmbientInfos", 2);
        ubo.addUniform("vOpacityInfos", 2);
        ubo.addUniform("vReflectionInfos", 2);
        ubo.addUniform("vReflectionPosition", 3);
        ubo.addUniform("vReflectionSize", 3);
        ubo.addUniform("vEmissiveInfos", 2);
        ubo.addUniform("vLightmapInfos", 2);
        ubo.addUniform("vSpecularInfos", 2);
        ubo.addUniform("vBumpInfos", 3);
        ubo.addUniform("diffuseMatrix", 16);
        ubo.addUniform("ambientMatrix", 16);
        ubo.addUniform("opacityMatrix", 16);
        ubo.addUniform("reflectionMatrix", 16);
        ubo.addUniform("emissiveMatrix", 16);
        ubo.addUniform("lightmapMatrix", 16);
        ubo.addUniform("specularMatrix", 16);
        ubo.addUniform("bumpMatrix", 16);
        ubo.addUniform("vTangentSpaceParams", 2);
        ubo.addUniform("pointSize", 1);
        ubo.addUniform("alphaCutOff", 1);
        ubo.addUniform("refractionMatrix", 16);
        ubo.addUniform("vRefractionInfos", 4);
        ubo.addUniform("vRefractionPosition", 3);
        ubo.addUniform("vRefractionSize", 3);
        ubo.addUniform("vSpecularColor", 4);
        ubo.addUniform("vEmissiveColor", 3);
        ubo.addUniform("vDiffuseColor", 4);
        ubo.addUniform("vAmbientColor", 3);
        super.buildUniformLayout();
    }
    /**
     * Binds the submesh to this material by preparing the effect and shader to draw
     * @param world defines the world transformation matrix
     * @param mesh defines the mesh containing the submesh
     * @param subMesh defines the submesh to bind the material to
     */
    bindForSubMesh(world, mesh, subMesh) {
        const scene = this.getScene();
        const defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        const effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices Mesh.
        mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
        mesh.transferToEffect(world);
        // Binding unconditionally
        this._uniformBuffer.bindToEffect(effect, "Material");
        this.prePassConfiguration.bindForSubMesh(this._activeEffect, scene, mesh, world, this.isFrozen);
        _materialHelper_geometryrendering_js__WEBPACK_IMPORTED_MODULE_20__/* .MaterialHelperGeometryRendering */ .m.Bind(scene.getEngine().currentRenderPassId, this._activeEffect, mesh, world);
        this._eventInfo.subMesh = subMesh;
        this._callbackPluginEventHardBindForSubMesh(this._eventInfo);
        // Normal Matrix
        if (defines.OBJECTSPACE_NORMALMAP) {
            world.toNormalMatrix(this._normalMatrix);
            this.bindOnlyNormalMatrix(this._normalMatrix);
        }
        const mustRebind = this._mustRebind(scene, effect, subMesh, mesh.visibility);
        // Bones
        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindBonesParameters */ .f$)(mesh, effect);
        const ubo = this._uniformBuffer;
        if (mustRebind) {
            this.bindViewProjection(effect);
            if (!ubo.useUbo || !this.isFrozen || !ubo.isSync || subMesh._drawWrapper._forceRebindOnNextCall) {
                if (StandardMaterial.FresnelEnabled && defines.FRESNEL) {
                    // Fresnel
                    if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled) {
                        ubo.updateColor4("diffuseLeftColor", this.diffuseFresnelParameters.leftColor, this.diffuseFresnelParameters.power);
                        ubo.updateColor4("diffuseRightColor", this.diffuseFresnelParameters.rightColor, this.diffuseFresnelParameters.bias);
                    }
                    if (this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled) {
                        ubo.updateColor4("opacityParts", new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_5__/* .Color3 */ .v9(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power);
                    }
                    if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) {
                        ubo.updateColor4("reflectionLeftColor", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power);
                        ubo.updateColor4("reflectionRightColor", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias);
                    }
                    if (this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled) {
                        ubo.updateColor4("refractionLeftColor", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power);
                        ubo.updateColor4("refractionRightColor", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias);
                    }
                    if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) {
                        ubo.updateColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power);
                        ubo.updateColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias);
                    }
                }
                // Textures
                if (scene.texturesEnabled) {
                    if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
                        ubo.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindTextureMatrix */ .mA)(this._diffuseTexture, ubo, "diffuse");
                    }
                    if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) {
                        ubo.updateFloat2("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindTextureMatrix */ .mA)(this._ambientTexture, ubo, "ambient");
                    }
                    if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) {
                        ubo.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindTextureMatrix */ .mA)(this._opacityTexture, ubo, "opacity");
                    }
                    if (this._hasAlphaChannel()) {
                        ubo.updateFloat("alphaCutOff", this.alphaCutOff);
                    }
                    if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {
                        ubo.updateFloat2("vReflectionInfos", this._reflectionTexture.level, this.roughness);
                        ubo.updateMatrix("reflectionMatrix", this._reflectionTexture.getReflectionTextureMatrix());
                        if (this._reflectionTexture.boundingBoxSize) {
                            const cubeTexture = this._reflectionTexture;
                            ubo.updateVector3("vReflectionPosition", cubeTexture.boundingBoxPosition);
                            ubo.updateVector3("vReflectionSize", cubeTexture.boundingBoxSize);
                        }
                    }
                    if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) {
                        ubo.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindTextureMatrix */ .mA)(this._emissiveTexture, ubo, "emissive");
                    }
                    if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) {
                        ubo.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindTextureMatrix */ .mA)(this._lightmapTexture, ubo, "lightmap");
                    }
                    if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) {
                        ubo.updateFloat2("vSpecularInfos", this._specularTexture.coordinatesIndex, this._specularTexture.level);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindTextureMatrix */ .mA)(this._specularTexture, ubo, "specular");
                    }
                    if (this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled) {
                        ubo.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, 1.0 / this._bumpTexture.level, this.parallaxScaleBias);
                        (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindTextureMatrix */ .mA)(this._bumpTexture, ubo, "bump");
                        if (scene._mirroredCameraPosition) {
                            ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0);
                        }
                        else {
                            ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0);
                        }
                    }
                    if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {
                        let depth = 1.0;
                        if (!this._refractionTexture.isCube) {
                            ubo.updateMatrix("refractionMatrix", this._refractionTexture.getReflectionTextureMatrix());
                            if (this._refractionTexture.depth) {
                                depth = this._refractionTexture.depth;
                            }
                        }
                        ubo.updateFloat4("vRefractionInfos", this._refractionTexture.level, this.indexOfRefraction, depth, this.invertRefractionY ? -1 : 1);
                        if (this._refractionTexture.boundingBoxSize) {
                            const cubeTexture = this._refractionTexture;
                            ubo.updateVector3("vRefractionPosition", cubeTexture.boundingBoxPosition);
                            ubo.updateVector3("vRefractionSize", cubeTexture.boundingBoxSize);
                        }
                    }
                }
                // Point size
                if (this.pointsCloud) {
                    ubo.updateFloat("pointSize", this.pointSize);
                }
                ubo.updateColor4("vSpecularColor", this.specularColor, this.specularPower);
                ubo.updateColor3("vEmissiveColor", StandardMaterial.EmissiveTextureEnabled ? this.emissiveColor : _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_5__/* .Color3 */ .v9.BlackReadOnly);
                ubo.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha);
                scene.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor);
                ubo.updateColor3("vAmbientColor", this._globalAmbientColor);
            }
            // Textures
            if (scene.texturesEnabled) {
                if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
                    effect.setTexture("diffuseSampler", this._diffuseTexture);
                }
                if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) {
                    effect.setTexture("ambientSampler", this._ambientTexture);
                }
                if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) {
                    effect.setTexture("opacitySampler", this._opacityTexture);
                }
                if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {
                    if (this._reflectionTexture.isCube) {
                        effect.setTexture("reflectionCubeSampler", this._reflectionTexture);
                    }
                    else {
                        effect.setTexture("reflection2DSampler", this._reflectionTexture);
                    }
                }
                if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) {
                    effect.setTexture("emissiveSampler", this._emissiveTexture);
                }
                if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) {
                    effect.setTexture("lightmapSampler", this._lightmapTexture);
                }
                if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) {
                    effect.setTexture("specularSampler", this._specularTexture);
                }
                if (this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled) {
                    effect.setTexture("bumpSampler", this._bumpTexture);
                }
                if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {
                    if (this._refractionTexture.isCube) {
                        effect.setTexture("refractionCubeSampler", this._refractionTexture);
                    }
                    else {
                        effect.setTexture("refraction2DSampler", this._refractionTexture);
                    }
                }
            }
            // OIT with depth peeling
            if (this.getScene().useOrderIndependentTransparency && this.needAlphaBlendingForMesh(mesh)) {
                this.getScene().depthPeelingRenderer.bind(effect);
            }
            this._eventInfo.subMesh = subMesh;
            this._callbackPluginEventBindForSubMesh(this._eventInfo);
            // Clip plane
            (0,_clipPlaneMaterialHelper_js__WEBPACK_IMPORTED_MODULE_17__/* .bindClipPlane */ .gS)(effect, this, scene);
            // Colors
            this.bindEyePosition(effect);
        }
        else if (scene.getEngine()._features.needToAlwaysBindUniformBuffers) {
            this._needToBindSceneUbo = true;
        }
        if (mustRebind || !this.isFrozen) {
            // Lights
            if (scene.lightsEnabled && !this._disableLighting) {
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindLights */ .RL)(scene, mesh, effect, defines, this._maxSimultaneousLights);
            }
            // View
            if ((scene.fogEnabled && mesh.applyFog && scene.fogMode !== _scene_js__WEBPACK_IMPORTED_MODULE_3__/* .Scene */ .Z.FOGMODE_NONE) ||
                this._reflectionTexture ||
                this._refractionTexture ||
                mesh.receiveShadows ||
                defines.PREPASS) {
                this.bindView(effect);
            }
            // Fog
            (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindFogParameters */ .Yy)(scene, mesh, effect);
            // Morph targets
            if (defines.NUM_MORPH_INFLUENCERS) {
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindMorphTargetParameters */ .nR)(mesh, effect);
            }
            if (defines.BAKED_VERTEX_ANIMATION_TEXTURE) {
                mesh.bakedVertexAnimationManager?.bind(effect, defines.INSTANCES);
            }
            // Log. depth
            if (this.useLogarithmicDepth) {
                (0,_materialHelper_functions_js__WEBPACK_IMPORTED_MODULE_18__/* .BindLogDepth */ .DL)(defines, effect, scene);
            }
            // image processing
            if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) {
                this._imageProcessingConfiguration.bind(this._activeEffect);
            }
        }
        this._afterBind(mesh, this._activeEffect, subMesh);
        ubo.update();
    }
    /**
     * Get the list of animatables in the material.
     * @returns the list of animatables object used in the material
     */
    getAnimatables() {
        const results = super.getAnimatables();
        if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) {
            results.push(this._diffuseTexture);
        }
        if (this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0) {
            results.push(this._ambientTexture);
        }
        if (this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0) {
            results.push(this._opacityTexture);
        }
        if (this._reflectionTexture && this._reflectionTexture.animations && this._reflectionTexture.animations.length > 0) {
            results.push(this._reflectionTexture);
        }
        if (this._emissiveTexture && this._emissiveTexture.animations && this._emissiveTexture.animations.length > 0) {
            results.push(this._emissiveTexture);
        }
        if (this._specularTexture && this._specularTexture.animations && this._specularTexture.animations.length > 0) {
            results.push(this._specularTexture);
        }
        if (this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0) {
            results.push(this._bumpTexture);
        }
        if (this._lightmapTexture && this._lightmapTexture.animations && this._lightmapTexture.animations.length > 0) {
            results.push(this._lightmapTexture);
        }
        if (this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0) {
            results.push(this._refractionTexture);
        }
        return results;
    }
    /**
     * Gets the active textures from the material
     * @returns an array of textures
     */
    getActiveTextures() {
        const activeTextures = super.getActiveTextures();
        if (this._diffuseTexture) {
            activeTextures.push(this._diffuseTexture);
        }
        if (this._ambientTexture) {
            activeTextures.push(this._ambientTexture);
        }
        if (this._opacityTexture) {
            activeTextures.push(this._opacityTexture);
        }
        if (this._reflectionTexture) {
            activeTextures.push(this._reflectionTexture);
        }
        if (this._emissiveTexture) {
            activeTextures.push(this._emissiveTexture);
        }
        if (this._specularTexture) {
            activeTextures.push(this._specularTexture);
        }
        if (this._bumpTexture) {
            activeTextures.push(this._bumpTexture);
        }
        if (this._lightmapTexture) {
            activeTextures.push(this._lightmapTexture);
        }
        if (this._refractionTexture) {
            activeTextures.push(this._refractionTexture);
        }
        return activeTextures;
    }
    /**
     * Specifies if the material uses a texture
     * @param texture defines the texture to check against the material
     * @returns a boolean specifying if the material uses the texture
     */
    hasTexture(texture) {
        if (super.hasTexture(texture)) {
            return true;
        }
        if (this._diffuseTexture === texture) {
            return true;
        }
        if (this._ambientTexture === texture) {
            return true;
        }
        if (this._opacityTexture === texture) {
            return true;
        }
        if (this._reflectionTexture === texture) {
            return true;
        }
        if (this._emissiveTexture === texture) {
            return true;
        }
        if (this._specularTexture === texture) {
            return true;
        }
        if (this._bumpTexture === texture) {
            return true;
        }
        if (this._lightmapTexture === texture) {
            return true;
        }
        if (this._refractionTexture === texture) {
            return true;
        }
        return false;
    }
    /**
     * Disposes the material
     * @param forceDisposeEffect specifies if effects should be forcefully disposed
     * @param forceDisposeTextures specifies if textures should be forcefully disposed
     */
    dispose(forceDisposeEffect, forceDisposeTextures) {
        if (forceDisposeTextures) {
            this._diffuseTexture?.dispose();
            this._ambientTexture?.dispose();
            this._opacityTexture?.dispose();
            this._reflectionTexture?.dispose();
            this._emissiveTexture?.dispose();
            this._specularTexture?.dispose();
            this._bumpTexture?.dispose();
            this._lightmapTexture?.dispose();
            this._refractionTexture?.dispose();
        }
        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
        }
        super.dispose(forceDisposeEffect, forceDisposeTextures);
    }
    /**
     * Makes a duplicate of the material, and gives it a new name
     * @param name defines the new name for the duplicated material
     * @param cloneTexturesOnlyOnce - if a texture is used in more than one channel (e.g diffuse and opacity), only clone it once and reuse it on the other channels. Default false.
     * @param rootUrl defines the root URL to use to load textures
     * @returns the cloned material
     */
    clone(name, cloneTexturesOnlyOnce = true, rootUrl = "") {
        const result = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_19__/* .SerializationHelper */ .p.Clone(() => new StandardMaterial(name, this.getScene()), this, { cloneTexturesOnlyOnce });
        result.name = name;
        result.id = name;
        this.stencil.copyTo(result.stencil);
        this._clonePlugins(result, rootUrl);
        return result;
    }
    /**
     * Creates a standard material from parsed material data
     * @param source defines the JSON representation of the material
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @returns a new standard material
     */
    static Parse(source, scene, rootUrl) {
        const material = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_19__/* .SerializationHelper */ .p.Parse(() => new StandardMaterial(source.name, scene), source, scene, rootUrl);
        if (source.stencil) {
            material.stencil.parse(source.stencil, scene, rootUrl);
        }
        _Materials_material_js__WEBPACK_IMPORTED_MODULE_9__/* .Material */ .i._ParsePlugins(source, material, scene, rootUrl);
        return material;
    }
    // Flags used to enable or disable a type of texture for all Standard Materials
    /**
     * Are diffuse textures enabled in the application.
     */
    static get DiffuseTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.DiffuseTextureEnabled;
    }
    static set DiffuseTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.DiffuseTextureEnabled = value;
    }
    /**
     * Are detail textures enabled in the application.
     */
    static get DetailTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.DetailTextureEnabled;
    }
    static set DetailTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.DetailTextureEnabled = value;
    }
    /**
     * Are ambient textures enabled in the application.
     */
    static get AmbientTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.AmbientTextureEnabled;
    }
    static set AmbientTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.AmbientTextureEnabled = value;
    }
    /**
     * Are opacity textures enabled in the application.
     */
    static get OpacityTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.OpacityTextureEnabled;
    }
    static set OpacityTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.OpacityTextureEnabled = value;
    }
    /**
     * Are reflection textures enabled in the application.
     */
    static get ReflectionTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.ReflectionTextureEnabled;
    }
    static set ReflectionTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.ReflectionTextureEnabled = value;
    }
    /**
     * Are emissive textures enabled in the application.
     */
    static get EmissiveTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.EmissiveTextureEnabled;
    }
    static set EmissiveTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.EmissiveTextureEnabled = value;
    }
    /**
     * Are specular textures enabled in the application.
     */
    static get SpecularTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.SpecularTextureEnabled;
    }
    static set SpecularTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.SpecularTextureEnabled = value;
    }
    /**
     * Are bump textures enabled in the application.
     */
    static get BumpTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.BumpTextureEnabled;
    }
    static set BumpTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.BumpTextureEnabled = value;
    }
    /**
     * Are lightmap textures enabled in the application.
     */
    static get LightmapTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.LightmapTextureEnabled;
    }
    static set LightmapTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.LightmapTextureEnabled = value;
    }
    /**
     * Are refraction textures enabled in the application.
     */
    static get RefractionTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.RefractionTextureEnabled;
    }
    static set RefractionTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.RefractionTextureEnabled = value;
    }
    /**
     * Are color grading textures enabled in the application.
     */
    static get ColorGradingTextureEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.ColorGradingTextureEnabled;
    }
    static set ColorGradingTextureEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.ColorGradingTextureEnabled = value;
    }
    /**
     * Are fresnels enabled in the application.
     */
    static get FresnelEnabled() {
        return _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.FresnelEnabled;
    }
    static set FresnelEnabled(value) {
        _materialFlags_js__WEBPACK_IMPORTED_MODULE_14__/* .MaterialFlags */ .h.FresnelEnabled = value;
    }
}
/**
 * Force all the standard materials to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
StandardMaterial.ForceGLSL = false;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("diffuseTexture")
], StandardMaterial.prototype, "_diffuseTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesAndMiscDirty")
], StandardMaterial.prototype, "diffuseTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("ambientTexture")
], StandardMaterial.prototype, "_ambientTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "ambientTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("opacityTexture")
], StandardMaterial.prototype, "_opacityTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesAndMiscDirty")
], StandardMaterial.prototype, "opacityTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("reflectionTexture")
], StandardMaterial.prototype, "_reflectionTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "reflectionTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("emissiveTexture")
], StandardMaterial.prototype, "_emissiveTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "emissiveTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("specularTexture")
], StandardMaterial.prototype, "_specularTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "specularTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("bumpTexture")
], StandardMaterial.prototype, "_bumpTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "bumpTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("lightmapTexture")
], StandardMaterial.prototype, "_lightmapTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "lightmapTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsTexture */ .uM)("refractionTexture")
], StandardMaterial.prototype, "_refractionTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "refractionTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)("ambient")
], StandardMaterial.prototype, "ambientColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)("diffuse")
], StandardMaterial.prototype, "diffuseColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)("specular")
], StandardMaterial.prototype, "specularColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsColor3 */ .jT)("emissive")
], StandardMaterial.prototype, "emissiveColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], StandardMaterial.prototype, "specularPower", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useAlphaFromDiffuseTexture")
], StandardMaterial.prototype, "_useAlphaFromDiffuseTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesAndMiscDirty")
], StandardMaterial.prototype, "useAlphaFromDiffuseTexture", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useEmissiveAsIllumination")
], StandardMaterial.prototype, "_useEmissiveAsIllumination", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "useEmissiveAsIllumination", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("linkEmissiveWithDiffuse")
], StandardMaterial.prototype, "_linkEmissiveWithDiffuse", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "linkEmissiveWithDiffuse", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useSpecularOverAlpha")
], StandardMaterial.prototype, "_useSpecularOverAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "useSpecularOverAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useReflectionOverAlpha")
], StandardMaterial.prototype, "_useReflectionOverAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "useReflectionOverAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("disableLighting")
], StandardMaterial.prototype, "_disableLighting", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsLightsDirty")
], StandardMaterial.prototype, "disableLighting", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useObjectSpaceNormalMap")
], StandardMaterial.prototype, "_useObjectSpaceNormalMap", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "useObjectSpaceNormalMap", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useParallax")
], StandardMaterial.prototype, "_useParallax", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "useParallax", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useParallaxOcclusion")
], StandardMaterial.prototype, "_useParallaxOcclusion", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "useParallaxOcclusion", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], StandardMaterial.prototype, "parallaxScaleBias", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("roughness")
], StandardMaterial.prototype, "_roughness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "roughness", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], StandardMaterial.prototype, "indexOfRefraction", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], StandardMaterial.prototype, "invertRefractionY", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], StandardMaterial.prototype, "alphaCutOff", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useLightmapAsShadowmap")
], StandardMaterial.prototype, "_useLightmapAsShadowmap", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "useLightmapAsShadowmap", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsFresnelParameters */ .Y9)("diffuseFresnelParameters")
], StandardMaterial.prototype, "_diffuseFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsFresnelDirty")
], StandardMaterial.prototype, "diffuseFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsFresnelParameters */ .Y9)("opacityFresnelParameters")
], StandardMaterial.prototype, "_opacityFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsFresnelAndMiscDirty")
], StandardMaterial.prototype, "opacityFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsFresnelParameters */ .Y9)("reflectionFresnelParameters")
], StandardMaterial.prototype, "_reflectionFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsFresnelDirty")
], StandardMaterial.prototype, "reflectionFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsFresnelParameters */ .Y9)("refractionFresnelParameters")
], StandardMaterial.prototype, "_refractionFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsFresnelDirty")
], StandardMaterial.prototype, "refractionFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsFresnelParameters */ .Y9)("emissiveFresnelParameters")
], StandardMaterial.prototype, "_emissiveFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsFresnelDirty")
], StandardMaterial.prototype, "emissiveFresnelParameters", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useReflectionFresnelFromSpecular")
], StandardMaterial.prototype, "_useReflectionFresnelFromSpecular", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsFresnelDirty")
], StandardMaterial.prototype, "useReflectionFresnelFromSpecular", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("useGlossinessFromSpecularMapAlpha")
], StandardMaterial.prototype, "_useGlossinessFromSpecularMapAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "useGlossinessFromSpecularMapAlpha", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("maxSimultaneousLights")
], StandardMaterial.prototype, "_maxSimultaneousLights", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsLightsDirty")
], StandardMaterial.prototype, "maxSimultaneousLights", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("invertNormalMapX")
], StandardMaterial.prototype, "_invertNormalMapX", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "invertNormalMapX", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("invertNormalMapY")
], StandardMaterial.prototype, "_invertNormalMapY", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "invertNormalMapY", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("twoSidedLighting")
], StandardMaterial.prototype, "_twoSidedLighting", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsTexturesDirty")
], StandardMaterial.prototype, "twoSidedLighting", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("applyDecalMapAfterDetailMap")
], StandardMaterial.prototype, "_applyDecalMapAfterDetailMap", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .expandToProperty */ .$z)("_markAllSubMeshesAsMiscDirty")
], StandardMaterial.prototype, "applyDecalMapAfterDetailMap", void 0);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_13__/* .RegisterClass */ .Y5)("BABYLON.StandardMaterial", StandardMaterial);
_scene_js__WEBPACK_IMPORTED_MODULE_3__/* .Scene */ .Z.DefaultMaterialFactory = (scene) => {
    return new StandardMaterial("default material", scene);
};
//# sourceMappingURL=standardMaterial.js.map

/***/ }),

/***/ 80935:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   D: () => (/* binding */ UniformBuffer)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(998);


/**
 * Uniform buffer objects.
 *
 * Handles blocks of uniform on the GPU.
 *
 * If WebGL 2 is not available, this class falls back on traditional setUniformXXX calls.
 *
 * For more information, please refer to :
 * https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object
 */
class UniformBuffer {
    /**
     * Instantiates a new Uniform buffer objects.
     *
     * Handles blocks of uniform on the GPU.
     *
     * If WebGL 2 is not available, this class falls back on traditional setUniformXXX calls.
     *
     * For more information, please refer to :
     * @see https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object
     * @param engine Define the engine the buffer is associated with
     * @param data Define the data contained in the buffer
     * @param dynamic Define if the buffer is updatable
     * @param name to assign to the buffer (debugging purpose)
     * @param forceNoUniformBuffer define that this object must not rely on UBO objects
     */
    constructor(engine, data, dynamic, name, forceNoUniformBuffer = false) {
        // Matrix cache
        this._valueCache = {};
        this._engine = engine;
        this._noUBO = !engine.supportsUniformBuffers || forceNoUniformBuffer;
        this._dynamic = dynamic;
        this._name = name ?? "no-name";
        this._data = data || [];
        this._uniformLocations = {};
        this._uniformSizes = {};
        this._uniformArraySizes = {};
        this._uniformLocationPointer = 0;
        this._needSync = false;
        if (this._engine._features.trackUbosInFrame) {
            this._buffers = [];
            this._bufferIndex = -1;
            this._createBufferOnWrite = false;
            this._currentFrameId = 0;
        }
        if (this._noUBO) {
            this.updateMatrix3x3 = this._updateMatrix3x3ForEffect;
            this.updateMatrix2x2 = this._updateMatrix2x2ForEffect;
            this.updateFloat = this._updateFloatForEffect;
            this.updateFloat2 = this._updateFloat2ForEffect;
            this.updateFloat3 = this._updateFloat3ForEffect;
            this.updateFloat4 = this._updateFloat4ForEffect;
            this.updateFloatArray = this._updateFloatArrayForEffect;
            this.updateArray = this._updateArrayForEffect;
            this.updateIntArray = this._updateIntArrayForEffect;
            this.updateUIntArray = this._updateUIntArrayForEffect;
            this.updateMatrix = this._updateMatrixForEffect;
            this.updateMatrices = this._updateMatricesForEffect;
            this.updateVector3 = this._updateVector3ForEffect;
            this.updateVector4 = this._updateVector4ForEffect;
            this.updateColor3 = this._updateColor3ForEffect;
            this.updateColor4 = this._updateColor4ForEffect;
            this.updateDirectColor4 = this._updateDirectColor4ForEffect;
            this.updateInt = this._updateIntForEffect;
            this.updateInt2 = this._updateInt2ForEffect;
            this.updateInt3 = this._updateInt3ForEffect;
            this.updateInt4 = this._updateInt4ForEffect;
            this.updateUInt = this._updateUIntForEffect;
            this.updateUInt2 = this._updateUInt2ForEffect;
            this.updateUInt3 = this._updateUInt3ForEffect;
            this.updateUInt4 = this._updateUInt4ForEffect;
        }
        else {
            this._engine._uniformBuffers.push(this);
            this.updateMatrix3x3 = this._updateMatrix3x3ForUniform;
            this.updateMatrix2x2 = this._updateMatrix2x2ForUniform;
            this.updateFloat = this._updateFloatForUniform;
            this.updateFloat2 = this._updateFloat2ForUniform;
            this.updateFloat3 = this._updateFloat3ForUniform;
            this.updateFloat4 = this._updateFloat4ForUniform;
            this.updateFloatArray = this._updateFloatArrayForUniform;
            this.updateArray = this._updateArrayForUniform;
            this.updateIntArray = this._updateIntArrayForUniform;
            this.updateUIntArray = this._updateUIntArrayForUniform;
            this.updateMatrix = this._updateMatrixForUniform;
            this.updateMatrices = this._updateMatricesForUniform;
            this.updateVector3 = this._updateVector3ForUniform;
            this.updateVector4 = this._updateVector4ForUniform;
            this.updateColor3 = this._updateColor3ForUniform;
            this.updateColor4 = this._updateColor4ForUniform;
            this.updateDirectColor4 = this._updateDirectColor4ForUniform;
            this.updateInt = this._updateIntForUniform;
            this.updateInt2 = this._updateInt2ForUniform;
            this.updateInt3 = this._updateInt3ForUniform;
            this.updateInt4 = this._updateInt4ForUniform;
            this.updateUInt = this._updateUIntForUniform;
            this.updateUInt2 = this._updateUInt2ForUniform;
            this.updateUInt3 = this._updateUInt3ForUniform;
            this.updateUInt4 = this._updateUInt4ForUniform;
        }
    }
    /**
     * Indicates if the buffer is using the WebGL2 UBO implementation,
     * or just falling back on setUniformXXX calls.
     */
    get useUbo() {
        return !this._noUBO;
    }
    /**
     * Indicates if the WebGL underlying uniform buffer is in sync
     * with the javascript cache data.
     */
    get isSync() {
        return !this._needSync;
    }
    /**
     * Indicates if the WebGL underlying uniform buffer is dynamic.
     * Also, a dynamic UniformBuffer will disable cache verification and always
     * update the underlying WebGL uniform buffer to the GPU.
     * @returns if Dynamic, otherwise false
     */
    isDynamic() {
        return this._dynamic !== undefined;
    }
    /**
     * The data cache on JS side.
     * @returns the underlying data as a float array
     */
    getData() {
        return this._bufferData;
    }
    /**
     * The underlying WebGL Uniform buffer.
     * @returns the webgl buffer
     */
    getBuffer() {
        return this._buffer;
    }
    /**
     * std140 layout specifies how to align data within an UBO structure.
     * See https://khronos.org/registry/OpenGL/specs/gl/glspec45.core.pdf#page=159
     * for specs.
     * @param size
     */
    _fillAlignment(size) {
        // This code has been simplified because we only use floats, vectors of 1, 2, 3, 4 components
        // and 4x4 matrices
        // TODO : change if other types are used
        let alignment;
        if (size <= 2) {
            alignment = size;
        }
        else {
            alignment = 4;
        }
        if (this._uniformLocationPointer % alignment !== 0) {
            const oldPointer = this._uniformLocationPointer;
            this._uniformLocationPointer += alignment - (this._uniformLocationPointer % alignment);
            const diff = this._uniformLocationPointer - oldPointer;
            for (let i = 0; i < diff; i++) {
                this._data.push(0);
            }
        }
    }
    /**
     * Adds an uniform in the buffer.
     * Warning : the subsequents calls of this function must be in the same order as declared in the shader
     * for the layout to be correct ! The addUniform function only handles types like float, vec2, vec3, vec4, mat4,
     * meaning size=1,2,3,4 or 16. It does not handle struct types.
     * @param name Name of the uniform, as used in the uniform block in the shader.
     * @param size Data size, or data directly.
     * @param arraySize The number of elements in the array, 0 if not an array.
     */
    addUniform(name, size, arraySize = 0) {
        if (this._noUBO) {
            return;
        }
        if (this._uniformLocations[name] !== undefined) {
            // Already existing uniform
            return;
        }
        // This function must be called in the order of the shader layout !
        // size can be the size of the uniform, or data directly
        let data;
        // std140 FTW...
        if (arraySize > 0) {
            if (size instanceof Array) {
                // eslint-disable-next-line no-throw-literal
                throw "addUniform should not be use with Array in UBO: " + name;
            }
            this._fillAlignment(4);
            this._uniformArraySizes[name] = { strideSize: size, arraySize };
            if (size == 16) {
                size = size * arraySize;
            }
            else {
                const perElementPadding = 4 - size;
                const totalPadding = perElementPadding * arraySize;
                size = size * arraySize + totalPadding;
            }
            data = [];
            // Fill with zeros
            for (let i = 0; i < size; i++) {
                data.push(0);
            }
        }
        else {
            if (size instanceof Array) {
                data = size;
                size = data.length;
            }
            else {
                size = size;
                data = [];
                // Fill with zeros
                for (let i = 0; i < size; i++) {
                    data.push(0);
                }
            }
            this._fillAlignment(size);
        }
        this._uniformSizes[name] = size;
        this._uniformLocations[name] = this._uniformLocationPointer;
        this._uniformLocationPointer += size;
        for (let i = 0; i < size; i++) {
            this._data.push(data[i]);
        }
        this._needSync = true;
    }
    /**
     * Adds a Matrix 4x4 to the uniform buffer.
     * @param name Name of the uniform, as used in the uniform block in the shader.
     * @param mat A 4x4 matrix.
     */
    addMatrix(name, mat) {
        this.addUniform(name, Array.prototype.slice.call(mat.asArray()));
    }
    /**
     * Adds a vec2 to the uniform buffer.
     * @param name Name of the uniform, as used in the uniform block in the shader.
     * @param x Define the x component value of the vec2
     * @param y Define the y component value of the vec2
     */
    addFloat2(name, x, y) {
        const temp = [x, y];
        this.addUniform(name, temp);
    }
    /**
     * Adds a vec3 to the uniform buffer.
     * @param name Name of the uniform, as used in the uniform block in the shader.
     * @param x Define the x component value of the vec3
     * @param y Define the y component value of the vec3
     * @param z Define the z component value of the vec3
     */
    addFloat3(name, x, y, z) {
        const temp = [x, y, z];
        this.addUniform(name, temp);
    }
    /**
     * Adds a vec3 to the uniform buffer.
     * @param name Name of the uniform, as used in the uniform block in the shader.
     * @param color Define the vec3 from a Color
     */
    addColor3(name, color) {
        const temp = [color.r, color.g, color.b];
        this.addUniform(name, temp);
    }
    /**
     * Adds a vec4 to the uniform buffer.
     * @param name Name of the uniform, as used in the uniform block in the shader.
     * @param color Define the rgb components from a Color
     * @param alpha Define the a component of the vec4
     */
    addColor4(name, color, alpha) {
        const temp = [color.r, color.g, color.b, alpha];
        this.addUniform(name, temp);
    }
    /**
     * Adds a vec3 to the uniform buffer.
     * @param name Name of the uniform, as used in the uniform block in the shader.
     * @param vector Define the vec3 components from a Vector
     */
    addVector3(name, vector) {
        const temp = [vector.x, vector.y, vector.z];
        this.addUniform(name, temp);
    }
    /**
     * Adds a Matrix 3x3 to the uniform buffer.
     * @param name Name of the uniform, as used in the uniform block in the shader.
     */
    addMatrix3x3(name) {
        this.addUniform(name, 12);
    }
    /**
     * Adds a Matrix 2x2 to the uniform buffer.
     * @param name Name of the uniform, as used in the uniform block in the shader.
     */
    addMatrix2x2(name) {
        this.addUniform(name, 8);
    }
    /**
     * Effectively creates the WebGL Uniform Buffer, once layout is completed with `addUniform`.
     */
    create() {
        if (this._noUBO) {
            return;
        }
        if (this._buffer) {
            return; // nothing to do
        }
        // See spec, alignment must be filled as a vec4
        this._fillAlignment(4);
        this._bufferData = new Float32Array(this._data);
        this._rebuild();
        this._needSync = true;
    }
    // The result of this method is used for debugging purpose, as part of the buffer name
    // It is meant to more easily know what this buffer is about when debugging
    // Some buffers can have a lot of uniforms (several dozens), so the method only returns the first 10 of them
    // (should be enough to understand what the buffer is for)
    _getNames() {
        const names = [];
        let i = 0;
        for (const name in this._uniformLocations) {
            names.push(name);
            if (++i === 10) {
                break;
            }
        }
        return names.join(",");
    }
    /** @internal */
    _rebuild() {
        if (this._noUBO || !this._bufferData) {
            return;
        }
        if (this._dynamic) {
            this._buffer = this._engine.createDynamicUniformBuffer(this._bufferData, this._name + "_UniformList:" + this._getNames());
        }
        else {
            this._buffer = this._engine.createUniformBuffer(this._bufferData, this._name + "_UniformList:" + this._getNames());
        }
        if (this._engine._features.trackUbosInFrame) {
            this._buffers.push([this._buffer, this._engine._features.checkUbosContentBeforeUpload ? this._bufferData.slice() : undefined]);
            this._bufferIndex = this._buffers.length - 1;
            this._createBufferOnWrite = false;
        }
    }
    /** @internal */
    _rebuildAfterContextLost() {
        if (this._engine._features.trackUbosInFrame) {
            this._buffers = [];
            this._currentFrameId = 0;
        }
        this._rebuild();
    }
    /** @internal */
    get _numBuffers() {
        return this._buffers.length;
    }
    /** @internal */
    get _indexBuffer() {
        return this._bufferIndex;
    }
    /** Gets the name of this buffer */
    get name() {
        return this._name;
    }
    /** Gets the current effect */
    get currentEffect() {
        return this._currentEffect;
    }
    _buffersEqual(buf1, buf2) {
        for (let i = 0; i < buf1.length; ++i) {
            if (buf1[i] !== buf2[i]) {
                return false;
            }
        }
        return true;
    }
    _copyBuffer(src, dst) {
        for (let i = 0; i < src.length; ++i) {
            dst[i] = src[i];
        }
    }
    /**
     * Updates the WebGL Uniform Buffer on the GPU.
     * If the `dynamic` flag is set to true, no cache comparison is done.
     * Otherwise, the buffer will be updated only if the cache differs.
     */
    update() {
        if (this._noUBO) {
            return;
        }
        this.bindUniformBuffer();
        if (!this._buffer) {
            this.create();
            return;
        }
        if (!this._dynamic && !this._needSync) {
            this._createBufferOnWrite = this._engine._features.trackUbosInFrame;
            return;
        }
        if (this._buffers && this._buffers.length > 1 && this._buffers[this._bufferIndex][1]) {
            if (this._buffersEqual(this._bufferData, this._buffers[this._bufferIndex][1])) {
                this._needSync = false;
                this._createBufferOnWrite = this._engine._features.trackUbosInFrame;
                return;
            }
            else {
                this._copyBuffer(this._bufferData, this._buffers[this._bufferIndex][1]);
            }
        }
        this._engine.updateUniformBuffer(this._buffer, this._bufferData);
        if (this._engine._features._collectUbosUpdatedInFrame) {
            if (!UniformBuffer._UpdatedUbosInFrame[this._name]) {
                UniformBuffer._UpdatedUbosInFrame[this._name] = 0;
            }
            UniformBuffer._UpdatedUbosInFrame[this._name]++;
        }
        this._needSync = false;
        this._createBufferOnWrite = this._engine._features.trackUbosInFrame;
    }
    _createNewBuffer() {
        if (this._bufferIndex + 1 < this._buffers.length) {
            this._bufferIndex++;
            this._buffer = this._buffers[this._bufferIndex][0];
            this._createBufferOnWrite = false;
            this._needSync = true;
        }
        else {
            this._rebuild();
        }
    }
    _checkNewFrame() {
        if (this._engine._features.trackUbosInFrame && this._currentFrameId !== this._engine.frameId) {
            this._currentFrameId = this._engine.frameId;
            this._createBufferOnWrite = false;
            if (this._buffers && this._buffers.length > 0) {
                this._needSync = this._bufferIndex !== 0;
                this._bufferIndex = 0;
                this._buffer = this._buffers[this._bufferIndex][0];
            }
            else {
                this._bufferIndex = -1;
            }
        }
    }
    /**
     * Updates the value of an uniform. The `update` method must be called afterwards to make it effective in the GPU.
     * @param uniformName Define the name of the uniform, as used in the uniform block in the shader.
     * @param data Define the flattened data
     * @param size Define the size of the data.
     */
    updateUniform(uniformName, data, size) {
        this._checkNewFrame();
        let location = this._uniformLocations[uniformName];
        if (location === undefined) {
            if (this._buffer) {
                // Cannot add an uniform if the buffer is already created
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("Cannot add an uniform after UBO has been created. uniformName=" + uniformName);
                return;
            }
            this.addUniform(uniformName, size);
            location = this._uniformLocations[uniformName];
        }
        if (!this._buffer) {
            this.create();
        }
        if (!this._dynamic) {
            // Cache for static uniform buffers
            let changed = false;
            for (let i = 0; i < size; i++) {
                // We are checking the matrix cache before calling updateUniform so we do not need to check it here
                // Hence the test for size === 16 to simply commit the matrix values
                if ((size === 16 && !this._engine._features.uniformBufferHardCheckMatrix) || this._bufferData[location + i] !== Math.fround(data[i])) {
                    changed = true;
                    if (this._createBufferOnWrite) {
                        this._createNewBuffer();
                    }
                    this._bufferData[location + i] = data[i];
                }
            }
            this._needSync = this._needSync || changed;
        }
        else {
            // No cache for dynamic
            for (let i = 0; i < size; i++) {
                this._bufferData[location + i] = data[i];
            }
        }
    }
    /**
     * Updates the value of an uniform. The `update` method must be called afterwards to make it effective in the GPU.
     * @param uniformName Define the name of the uniform, as used in the uniform block in the shader.
     * @param data Define the flattened data
     * @param size Define the size of the data.
     */
    updateUniformArray(uniformName, data, size) {
        this._checkNewFrame();
        const location = this._uniformLocations[uniformName];
        if (location === undefined) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");
            return;
        }
        if (!this._buffer) {
            this.create();
        }
        const arraySizes = this._uniformArraySizes[uniformName];
        if (!this._dynamic) {
            // Cache for static uniform buffers
            let changed = false;
            let countToFour = 0;
            let baseStride = 0;
            for (let i = 0; i < size; i++) {
                if (this._bufferData[location + baseStride * 4 + countToFour] !== _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.FloatRound(data[i])) {
                    changed = true;
                    if (this._createBufferOnWrite) {
                        this._createNewBuffer();
                    }
                    this._bufferData[location + baseStride * 4 + countToFour] = data[i];
                }
                countToFour++;
                if (countToFour === arraySizes.strideSize) {
                    for (; countToFour < 4; countToFour++) {
                        this._bufferData[location + baseStride * 4 + countToFour] = 0;
                    }
                    countToFour = 0;
                    baseStride++;
                }
            }
            this._needSync = this._needSync || changed;
        }
        else {
            // No cache for dynamic
            for (let i = 0; i < size; i++) {
                this._bufferData[location + i] = data[i];
            }
        }
    }
    _cacheMatrix(name, matrix) {
        this._checkNewFrame();
        const cache = this._valueCache[name];
        const flag = matrix.updateFlag;
        if (cache !== undefined && cache === flag) {
            return false;
        }
        this._valueCache[name] = flag;
        return true;
    }
    // Update methods
    _updateMatrix3x3ForUniform(name, matrix) {
        // To match std140, matrix must be realigned
        for (let i = 0; i < 3; i++) {
            UniformBuffer._TempBuffer[i * 4] = matrix[i * 3];
            UniformBuffer._TempBuffer[i * 4 + 1] = matrix[i * 3 + 1];
            UniformBuffer._TempBuffer[i * 4 + 2] = matrix[i * 3 + 2];
            UniformBuffer._TempBuffer[i * 4 + 3] = 0.0;
        }
        this.updateUniform(name, UniformBuffer._TempBuffer, 12);
    }
    _updateMatrix3x3ForEffect(name, matrix) {
        this._currentEffect.setMatrix3x3(name, matrix);
    }
    _updateMatrix2x2ForEffect(name, matrix) {
        this._currentEffect.setMatrix2x2(name, matrix);
    }
    _updateMatrix2x2ForUniform(name, matrix) {
        // To match std140, matrix must be realigned
        for (let i = 0; i < 2; i++) {
            UniformBuffer._TempBuffer[i * 4] = matrix[i * 2];
            UniformBuffer._TempBuffer[i * 4 + 1] = matrix[i * 2 + 1];
            UniformBuffer._TempBuffer[i * 4 + 2] = 0.0;
            UniformBuffer._TempBuffer[i * 4 + 3] = 0.0;
        }
        this.updateUniform(name, UniformBuffer._TempBuffer, 8);
    }
    _updateFloatForEffect(name, x) {
        this._currentEffect.setFloat(name, x);
    }
    _updateFloatForUniform(name, x) {
        UniformBuffer._TempBuffer[0] = x;
        this.updateUniform(name, UniformBuffer._TempBuffer, 1);
    }
    _updateFloat2ForEffect(name, x, y, suffix = "") {
        this._currentEffect.setFloat2(name + suffix, x, y);
    }
    _updateFloat2ForUniform(name, x, y) {
        UniformBuffer._TempBuffer[0] = x;
        UniformBuffer._TempBuffer[1] = y;
        this.updateUniform(name, UniformBuffer._TempBuffer, 2);
    }
    _updateFloat3ForEffect(name, x, y, z, suffix = "") {
        this._currentEffect.setFloat3(name + suffix, x, y, z);
    }
    _updateFloat3ForUniform(name, x, y, z) {
        UniformBuffer._TempBuffer[0] = x;
        UniformBuffer._TempBuffer[1] = y;
        UniformBuffer._TempBuffer[2] = z;
        this.updateUniform(name, UniformBuffer._TempBuffer, 3);
    }
    _updateFloat4ForEffect(name, x, y, z, w, suffix = "") {
        this._currentEffect.setFloat4(name + suffix, x, y, z, w);
    }
    _updateFloat4ForUniform(name, x, y, z, w) {
        UniformBuffer._TempBuffer[0] = x;
        UniformBuffer._TempBuffer[1] = y;
        UniformBuffer._TempBuffer[2] = z;
        UniformBuffer._TempBuffer[3] = w;
        this.updateUniform(name, UniformBuffer._TempBuffer, 4);
    }
    _updateFloatArrayForEffect(name, array) {
        this._currentEffect.setFloatArray(name, array);
    }
    _updateFloatArrayForUniform(name, array) {
        this.updateUniformArray(name, array, array.length);
    }
    _updateArrayForEffect(name, array) {
        this._currentEffect.setArray(name, array);
    }
    _updateArrayForUniform(name, array) {
        this.updateUniformArray(name, array, array.length);
    }
    _updateIntArrayForEffect(name, array) {
        this._currentEffect.setIntArray(name, array);
    }
    _updateIntArrayForUniform(name, array) {
        UniformBuffer._TempBufferInt32View.set(array);
        this.updateUniformArray(name, UniformBuffer._TempBuffer, array.length);
    }
    _updateUIntArrayForEffect(name, array) {
        this._currentEffect.setUIntArray(name, array);
    }
    _updateUIntArrayForUniform(name, array) {
        UniformBuffer._TempBufferUInt32View.set(array);
        this.updateUniformArray(name, UniformBuffer._TempBuffer, array.length);
    }
    _updateMatrixForEffect(name, mat) {
        this._currentEffect.setMatrix(name, mat);
    }
    _updateMatrixForUniform(name, mat) {
        if (this._cacheMatrix(name, mat)) {
            this.updateUniform(name, mat.asArray(), 16);
        }
    }
    _updateMatricesForEffect(name, mat) {
        this._currentEffect.setMatrices(name, mat);
    }
    _updateMatricesForUniform(name, mat) {
        this.updateUniform(name, mat, mat.length);
    }
    _updateVector3ForEffect(name, vector) {
        this._currentEffect.setVector3(name, vector);
    }
    _updateVector3ForUniform(name, vector) {
        UniformBuffer._TempBuffer[0] = vector.x;
        UniformBuffer._TempBuffer[1] = vector.y;
        UniformBuffer._TempBuffer[2] = vector.z;
        this.updateUniform(name, UniformBuffer._TempBuffer, 3);
    }
    _updateVector4ForEffect(name, vector) {
        this._currentEffect.setVector4(name, vector);
    }
    _updateVector4ForUniform(name, vector) {
        UniformBuffer._TempBuffer[0] = vector.x;
        UniformBuffer._TempBuffer[1] = vector.y;
        UniformBuffer._TempBuffer[2] = vector.z;
        UniformBuffer._TempBuffer[3] = vector.w;
        this.updateUniform(name, UniformBuffer._TempBuffer, 4);
    }
    _updateColor3ForEffect(name, color, suffix = "") {
        this._currentEffect.setColor3(name + suffix, color);
    }
    _updateColor3ForUniform(name, color) {
        UniformBuffer._TempBuffer[0] = color.r;
        UniformBuffer._TempBuffer[1] = color.g;
        UniformBuffer._TempBuffer[2] = color.b;
        this.updateUniform(name, UniformBuffer._TempBuffer, 3);
    }
    _updateColor4ForEffect(name, color, alpha, suffix = "") {
        this._currentEffect.setColor4(name + suffix, color, alpha);
    }
    _updateDirectColor4ForEffect(name, color, suffix = "") {
        this._currentEffect.setDirectColor4(name + suffix, color);
    }
    _updateColor4ForUniform(name, color, alpha) {
        UniformBuffer._TempBuffer[0] = color.r;
        UniformBuffer._TempBuffer[1] = color.g;
        UniformBuffer._TempBuffer[2] = color.b;
        UniformBuffer._TempBuffer[3] = alpha;
        this.updateUniform(name, UniformBuffer._TempBuffer, 4);
    }
    _updateDirectColor4ForUniform(name, color) {
        UniformBuffer._TempBuffer[0] = color.r;
        UniformBuffer._TempBuffer[1] = color.g;
        UniformBuffer._TempBuffer[2] = color.b;
        UniformBuffer._TempBuffer[3] = color.a;
        this.updateUniform(name, UniformBuffer._TempBuffer, 4);
    }
    _updateIntForEffect(name, x, suffix = "") {
        this._currentEffect.setInt(name + suffix, x);
    }
    _updateIntForUniform(name, x) {
        UniformBuffer._TempBufferInt32View[0] = x;
        this.updateUniform(name, UniformBuffer._TempBuffer, 1);
    }
    _updateInt2ForEffect(name, x, y, suffix = "") {
        this._currentEffect.setInt2(name + suffix, x, y);
    }
    _updateInt2ForUniform(name, x, y) {
        UniformBuffer._TempBufferInt32View[0] = x;
        UniformBuffer._TempBufferInt32View[1] = y;
        this.updateUniform(name, UniformBuffer._TempBuffer, 2);
    }
    _updateInt3ForEffect(name, x, y, z, suffix = "") {
        this._currentEffect.setInt3(name + suffix, x, y, z);
    }
    _updateInt3ForUniform(name, x, y, z) {
        UniformBuffer._TempBufferInt32View[0] = x;
        UniformBuffer._TempBufferInt32View[1] = y;
        UniformBuffer._TempBufferInt32View[2] = z;
        this.updateUniform(name, UniformBuffer._TempBuffer, 3);
    }
    _updateInt4ForEffect(name, x, y, z, w, suffix = "") {
        this._currentEffect.setInt4(name + suffix, x, y, z, w);
    }
    _updateInt4ForUniform(name, x, y, z, w) {
        UniformBuffer._TempBufferInt32View[0] = x;
        UniformBuffer._TempBufferInt32View[1] = y;
        UniformBuffer._TempBufferInt32View[2] = z;
        UniformBuffer._TempBufferInt32View[3] = w;
        this.updateUniform(name, UniformBuffer._TempBuffer, 4);
    }
    _updateUIntForEffect(name, x, suffix = "") {
        this._currentEffect.setUInt(name + suffix, x);
    }
    _updateUIntForUniform(name, x) {
        UniformBuffer._TempBufferUInt32View[0] = x;
        this.updateUniform(name, UniformBuffer._TempBuffer, 1);
    }
    _updateUInt2ForEffect(name, x, y, suffix = "") {
        this._currentEffect.setUInt2(name + suffix, x, y);
    }
    _updateUInt2ForUniform(name, x, y) {
        UniformBuffer._TempBufferUInt32View[0] = x;
        UniformBuffer._TempBufferUInt32View[1] = y;
        this.updateUniform(name, UniformBuffer._TempBuffer, 2);
    }
    _updateUInt3ForEffect(name, x, y, z, suffix = "") {
        this._currentEffect.setUInt3(name + suffix, x, y, z);
    }
    _updateUInt3ForUniform(name, x, y, z) {
        UniformBuffer._TempBufferUInt32View[0] = x;
        UniformBuffer._TempBufferUInt32View[1] = y;
        UniformBuffer._TempBufferUInt32View[2] = z;
        this.updateUniform(name, UniformBuffer._TempBuffer, 3);
    }
    _updateUInt4ForEffect(name, x, y, z, w, suffix = "") {
        this._currentEffect.setUInt4(name + suffix, x, y, z, w);
    }
    _updateUInt4ForUniform(name, x, y, z, w) {
        UniformBuffer._TempBufferUInt32View[0] = x;
        UniformBuffer._TempBufferUInt32View[1] = y;
        UniformBuffer._TempBufferUInt32View[2] = z;
        UniformBuffer._TempBufferUInt32View[3] = w;
        this.updateUniform(name, UniformBuffer._TempBuffer, 4);
    }
    /**
     * Sets a sampler uniform on the effect.
     * @param name Define the name of the sampler.
     * @param texture Define the texture to set in the sampler
     */
    setTexture(name, texture) {
        this._currentEffect.setTexture(name, texture);
    }
    /**
     * Sets an array of sampler uniforms on the effect.
     * @param name Define the name of uniform.
     * @param textures Define the textures to set in the array of samplers
     */
    setTextureArray(name, textures) {
        this._currentEffect.setTextureArray(name, textures);
    }
    /**
     * Sets a sampler uniform on the effect.
     * @param name Define the name of the sampler.
     * @param texture Define the (internal) texture to set in the sampler
     */
    bindTexture(name, texture) {
        this._currentEffect._bindTexture(name, texture);
    }
    /**
     * Directly updates the value of the uniform in the cache AND on the GPU.
     * @param uniformName Define the name of the uniform, as used in the uniform block in the shader.
     * @param data Define the flattened data
     */
    updateUniformDirectly(uniformName, data) {
        this.updateUniform(uniformName, data, data.length);
        this.update();
    }
    /**
     * Associates an effect to this uniform buffer
     * @param effect Define the effect to associate the buffer to
     * @param name Name of the uniform block in the shader.
     */
    bindToEffect(effect, name) {
        this._currentEffect = effect;
        this._currentEffectName = name;
    }
    /**
     * Binds the current (GPU) buffer to the effect
     */
    bindUniformBuffer() {
        if (!this._noUBO && this._buffer && this._currentEffect) {
            this._currentEffect.bindUniformBuffer(this._buffer, this._currentEffectName);
        }
    }
    /**
     * Dissociates the current effect from this uniform buffer
     */
    unbindEffect() {
        this._currentEffect = undefined;
        this._currentEffectName = undefined;
    }
    /**
     * Sets the current state of the class (_bufferIndex, _buffer) to point to the data buffer passed in parameter if this buffer is one of the buffers handled by the class (meaning if it can be found in the _buffers array)
     * This method is meant to be able to update a buffer at any time: just call setDataBuffer to set the class in the right state, call some updateXXX methods and then call udpate() => that will update the GPU buffer on the graphic card
     * @param dataBuffer buffer to look for
     * @returns true if the buffer has been found and the class internal state points to it, else false
     */
    setDataBuffer(dataBuffer) {
        if (!this._buffers) {
            return this._buffer === dataBuffer;
        }
        for (let b = 0; b < this._buffers.length; ++b) {
            const buffer = this._buffers[b];
            if (buffer[0] === dataBuffer) {
                this._bufferIndex = b;
                this._buffer = dataBuffer;
                this._createBufferOnWrite = false;
                this._currentEffect = undefined;
                return true;
            }
        }
        return false;
    }
    /**
     * Disposes the uniform buffer.
     */
    dispose() {
        if (this._noUBO) {
            return;
        }
        const uniformBuffers = this._engine._uniformBuffers;
        const index = uniformBuffers.indexOf(this);
        if (index !== -1) {
            uniformBuffers[index] = uniformBuffers[uniformBuffers.length - 1];
            uniformBuffers.pop();
        }
        if (this._engine._features.trackUbosInFrame && this._buffers) {
            for (let i = 0; i < this._buffers.length; ++i) {
                const buffer = this._buffers[i][0];
                this._engine._releaseBuffer(buffer);
            }
        }
        else if (this._buffer && this._engine._releaseBuffer(this._buffer)) {
            this._buffer = null;
        }
    }
}
/** @internal */
UniformBuffer._UpdatedUbosInFrame = {};
// Pool for avoiding memory leaks
UniformBuffer._MAX_UNIFORM_SIZE = 256;
UniformBuffer._TempBuffer = new Float32Array(UniformBuffer._MAX_UNIFORM_SIZE);
UniformBuffer._TempBufferInt32View = new Int32Array(UniformBuffer._TempBuffer.buffer);
UniformBuffer._TempBufferUInt32View = new Uint32Array(UniformBuffer._TempBuffer.buffer);
//# sourceMappingURL=uniformBuffer.js.map

/***/ }),

/***/ 18733:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $x: () => (/* binding */ Space),
/* harmony export */   _0: () => (/* binding */ Axis),
/* harmony export */   xp: () => (/* binding */ Coordinate)
/* harmony export */ });
/* harmony import */ var _math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);

/** Defines supported spaces */
var Space;
(function (Space) {
    /** Local (object) space */
    Space[Space["LOCAL"] = 0] = "LOCAL";
    /** World space */
    Space[Space["WORLD"] = 1] = "WORLD";
    /** Bone space */
    Space[Space["BONE"] = 2] = "BONE";
})(Space || (Space = {}));
/** Defines the 3 main axes */
class Axis {
}
/** X axis */
Axis.X = new _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, 0.0, 0.0);
/** Y axis */
Axis.Y = new _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0.0, 1.0, 0.0);
/** Z axis */
Axis.Z = new _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0.0, 0.0, 1.0);
/**
 * Defines cartesian components.
 */
var Coordinate;
(function (Coordinate) {
    /** X axis */
    Coordinate[Coordinate["X"] = 0] = "X";
    /** Y axis */
    Coordinate[Coordinate["Y"] = 1] = "Y";
    /** Z axis */
    Coordinate[Coordinate["Z"] = 2] = "Z";
})(Coordinate || (Coordinate = {}));
//# sourceMappingURL=math.axis.js.map

/***/ }),

/***/ 26041:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   IG: () => (/* binding */ TmpColors),
/* harmony export */   ov: () => (/* binding */ Color4),
/* harmony export */   v9: () => (/* binding */ Color3)
/* harmony export */ });
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27309);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56552);
/* harmony import */ var _math_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65559);
/* harmony import */ var _math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84867);




function colorChannelToLinearSpace(color) {
    return Math.pow(color, _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .ToLinearSpace */ .tk);
}
function colorChannelToLinearSpaceExact(color) {
    if (color <= 0.04045) {
        return 0.0773993808 * color;
    }
    return Math.pow(0.947867299 * (color + 0.055), 2.4);
}
function colorChannelToGammaSpace(color) {
    return Math.pow(color, _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .ToGammaSpace */ .rv);
}
function colorChannelToGammaSpaceExact(color) {
    if (color <= 0.0031308) {
        return 12.92 * color;
    }
    return 1.055 * Math.pow(color, 0.41666) - 0.055;
}
/**
 * Class used to hold a RGB color
 */
class Color3 {
    /**
     * Creates a new Color3 object from red, green, blue values, all between 0 and 1
     * @param r defines the red component (between 0 and 1, default is 0)
     * @param g defines the green component (between 0 and 1, default is 0)
     * @param b defines the blue component (between 0 and 1, default is 0)
     */
    constructor(
    /**
     * [0] Defines the red component (between 0 and 1, default is 0)
     */
    r = 0, 
    /**
     * [0] Defines the green component (between 0 and 1, default is 0)
     */
    g = 0, 
    /**
     * [0] Defines the blue component (between 0 and 1, default is 0)
     */
    b = 0) {
        this.r = r;
        this.g = g;
        this.b = b;
    }
    /**
     * Creates a string with the Color3 current values
     * @returns the string representation of the Color3 object
     */
    toString() {
        return "{R: " + this.r + " G:" + this.g + " B:" + this.b + "}";
    }
    /**
     * Returns the string "Color3"
     * @returns "Color3"
     */
    getClassName() {
        return "Color3";
    }
    /**
     * Compute the Color3 hash code
     * @returns an unique number that can be used to hash Color3 objects
     */
    getHashCode() {
        let hash = (this.r * 255) | 0;
        hash = (hash * 397) ^ ((this.g * 255) | 0);
        hash = (hash * 397) ^ ((this.b * 255) | 0);
        return hash;
    }
    // Operators
    /**
     * Stores in the given array from the given starting index the red, green, blue values as successive elements
     * @param array defines the array where to store the r,g,b components
     * @param index defines an optional index in the target array to define where to start storing values
     * @returns the current Color3 object
     */
    toArray(array, index = 0) {
        array[index] = this.r;
        array[index + 1] = this.g;
        array[index + 2] = this.b;
        return this;
    }
    /**
     * Update the current color with values stored in an array from the starting index of the given array
     * @param array defines the source array
     * @param offset defines an offset in the source array
     * @returns the current Color3 object
     */
    fromArray(array, offset = 0) {
        Color3.FromArrayToRef(array, offset, this);
        return this;
    }
    /**
     * Returns a new Color4 object from the current Color3 and the given alpha
     * @param alpha defines the alpha component on the new Color4 object (default is 1)
     * @returns a new Color4 object
     */
    toColor4(alpha = 1) {
        return new Color4(this.r, this.g, this.b, alpha);
    }
    /**
     * Returns a new array populated with 3 numeric elements : red, green and blue values
     * @returns the new array
     */
    asArray() {
        return [this.r, this.g, this.b];
    }
    /**
     * Returns the luminance value
     * @returns a float value
     */
    toLuminance() {
        return this.r * 0.3 + this.g * 0.59 + this.b * 0.11;
    }
    /**
     * Multiply each Color3 rgb values by the given Color3 rgb values in a new Color3 object
     * @param otherColor defines the second operand
     * @returns the new Color3 object
     */
    multiply(otherColor) {
        return new Color3(this.r * otherColor.r, this.g * otherColor.g, this.b * otherColor.b);
    }
    /**
     * Multiply the rgb values of the Color3 and the given Color3 and stores the result in the object "result"
     * @param otherColor defines the second operand
     * @param result defines the Color3 object where to store the result
     * @returns the result Color3
     */
    multiplyToRef(otherColor, result) {
        result.r = this.r * otherColor.r;
        result.g = this.g * otherColor.g;
        result.b = this.b * otherColor.b;
        return result;
    }
    /**
     * Multiplies the current Color3 coordinates by the given ones
     * @param otherColor defines the second operand
     * @returns the current updated Color3
     */
    multiplyInPlace(otherColor) {
        this.r *= otherColor.r;
        this.g *= otherColor.g;
        this.b *= otherColor.b;
        return this;
    }
    /**
     * Returns a new Color3 set with the result of the multiplication of the current Color3 coordinates by the given floats
     * @param r defines the r coordinate of the operand
     * @param g defines the g coordinate of the operand
     * @param b defines the b coordinate of the operand
     * @returns the new Color3
     */
    multiplyByFloats(r, g, b) {
        return new Color3(this.r * r, this.g * g, this.b * b);
    }
    /**
     * @internal
     * Do not use
     */
    divide(_other) {
        throw new ReferenceError("Can not divide a color");
    }
    /**
     * @internal
     * Do not use
     */
    divideToRef(_other, _result) {
        throw new ReferenceError("Can not divide a color");
    }
    /**
     * @internal
     * Do not use
     */
    divideInPlace(_other) {
        throw new ReferenceError("Can not divide a color");
    }
    /**
     * Updates the current Color3 with the minimal coordinate values between its and the given color ones
     * @param other defines the second operand
     * @returns the current updated Color3
     */
    minimizeInPlace(other) {
        return this.minimizeInPlaceFromFloats(other.r, other.g, other.b);
    }
    /**
     * Updates the current Color3 with the maximal coordinate values between its and the given color ones.
     * @param other defines the second operand
     * @returns the current updated Color3
     */
    maximizeInPlace(other) {
        return this.maximizeInPlaceFromFloats(other.r, other.g, other.b);
    }
    /**
     * Updates the current Color3 with the minimal coordinate values between its and the given coordinates
     * @param r defines the r coordinate of the operand
     * @param g defines the g coordinate of the operand
     * @param b defines the b coordinate of the operand
     * @returns the current updated Color3
     */
    minimizeInPlaceFromFloats(r, g, b) {
        this.r = Math.min(r, this.r);
        this.g = Math.min(g, this.g);
        this.b = Math.min(b, this.b);
        return this;
    }
    /**
     * Updates the current Color3 with the maximal coordinate values between its and the given coordinates.
     * @param r defines the r coordinate of the operand
     * @param g defines the g coordinate of the operand
     * @param b defines the b coordinate of the operand
     * @returns the current updated Color3
     */
    maximizeInPlaceFromFloats(r, g, b) {
        this.r = Math.max(r, this.r);
        this.g = Math.max(g, this.g);
        this.b = Math.max(b, this.b);
        return this;
    }
    /**
     * @internal
     * Do not use
     */
    floorToRef(_result) {
        throw new ReferenceError("Can not floor a color");
    }
    /**
     * @internal
     * Do not use
     */
    floor() {
        throw new ReferenceError("Can not floor a color");
    }
    /**
     * @internal
     * Do not use
     */
    fractToRef(_result) {
        throw new ReferenceError("Can not fract a color");
    }
    /**
     * @internal
     * Do not use
     */
    fract() {
        throw new ReferenceError("Can not fract a color");
    }
    /**
     * Determines equality between Color3 objects
     * @param otherColor defines the second operand
     * @returns true if the rgb values are equal to the given ones
     */
    equals(otherColor) {
        return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b;
    }
    /**
     * Alias for equalsToFloats
     * @param r red color component
     * @param g green color component
     * @param b blue color component
     * @returns boolean
     */
    equalsFloats(r, g, b) {
        return this.equalsToFloats(r, g, b);
    }
    /**
     * Determines equality between the current Color3 object and a set of r,b,g values
     * @param r defines the red component to check
     * @param g defines the green component to check
     * @param b defines the blue component to check
     * @returns true if the rgb values are equal to the given ones
     */
    equalsToFloats(r, g, b) {
        return this.r === r && this.g === g && this.b === b;
    }
    /**
     * Returns true if the current Color3 and the given color coordinates are distant less than epsilon
     * @param otherColor defines the second operand
     * @param epsilon defines the minimal distance to define values as equals
     * @returns true if both colors are distant less than epsilon
     */
    equalsWithEpsilon(otherColor, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .bH) {
        return (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.WithinEpsilon)(this.r, otherColor.r, epsilon) && (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.WithinEpsilon)(this.g, otherColor.g, epsilon) && (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.WithinEpsilon)(this.b, otherColor.b, epsilon);
    }
    /**
     * @internal
     * Do not use
     */
    negate() {
        throw new ReferenceError("Can not negate a color");
    }
    /**
     * @internal
     * Do not use
     */
    negateInPlace() {
        throw new ReferenceError("Can not negate a color");
    }
    /**
     * @internal
     * Do not use
     */
    negateToRef(_result) {
        throw new ReferenceError("Can not negate a color");
    }
    /**
     * Creates a new Color3 with the current Color3 values multiplied by scale
     * @param scale defines the scaling factor to apply
     * @returns a new Color3 object
     */
    scale(scale) {
        return new Color3(this.r * scale, this.g * scale, this.b * scale);
    }
    /**
     * Multiplies the Color3 values by the float "scale"
     * @param scale defines the scaling factor to apply
     * @returns the current updated Color3
     */
    scaleInPlace(scale) {
        this.r *= scale;
        this.g *= scale;
        this.b *= scale;
        return this;
    }
    /**
     * Multiplies the rgb values by scale and stores the result into "result"
     * @param scale defines the scaling factor
     * @param result defines the Color3 object where to store the result
     * @returns the result Color3
     */
    scaleToRef(scale, result) {
        result.r = this.r * scale;
        result.g = this.g * scale;
        result.b = this.b * scale;
        return result;
    }
    /**
     * Scale the current Color3 values by a factor and add the result to a given Color3
     * @param scale defines the scale factor
     * @param result defines color to store the result into
     * @returns the result Color3
     */
    scaleAndAddToRef(scale, result) {
        result.r += this.r * scale;
        result.g += this.g * scale;
        result.b += this.b * scale;
        return result;
    }
    /**
     * Clamps the rgb values by the min and max values and stores the result into "result"
     * @param min defines minimum clamping value (default is 0)
     * @param max defines maximum clamping value (default is 1)
     * @param result defines color to store the result into
     * @returns the result Color3
     */
    clampToRef(min = 0, max = 1, result) {
        result.r = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.Clamp)(this.r, min, max);
        result.g = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.Clamp)(this.g, min, max);
        result.b = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.Clamp)(this.b, min, max);
        return result;
    }
    /**
     * Creates a new Color3 set with the added values of the current Color3 and of the given one
     * @param otherColor defines the second operand
     * @returns the new Color3
     */
    add(otherColor) {
        return new Color3(this.r + otherColor.r, this.g + otherColor.g, this.b + otherColor.b);
    }
    /**
     * Adds the given color to the current Color3
     * @param otherColor defines the second operand
     * @returns the current updated Color3
     */
    addInPlace(otherColor) {
        this.r += otherColor.r;
        this.g += otherColor.g;
        this.b += otherColor.b;
        return this;
    }
    /**
     * Adds the given coordinates to the current Color3
     * @param r defines the r coordinate of the operand
     * @param g defines the g coordinate of the operand
     * @param b defines the b coordinate of the operand
     * @returns the current updated Color3
     */
    addInPlaceFromFloats(r, g, b) {
        this.r += r;
        this.g += g;
        this.b += b;
        return this;
    }
    /**
     * Stores the result of the addition of the current Color3 and given one rgb values into "result"
     * @param otherColor defines the second operand
     * @param result defines Color3 object to store the result into
     * @returns the unmodified current Color3
     */
    addToRef(otherColor, result) {
        result.r = this.r + otherColor.r;
        result.g = this.g + otherColor.g;
        result.b = this.b + otherColor.b;
        return result;
    }
    /**
     * Returns a new Color3 set with the subtracted values of the given one from the current Color3
     * @param otherColor defines the second operand
     * @returns the new Color3
     */
    subtract(otherColor) {
        return new Color3(this.r - otherColor.r, this.g - otherColor.g, this.b - otherColor.b);
    }
    /**
     * Stores the result of the subtraction of given one from the current Color3 rgb values into "result"
     * @param otherColor defines the second operand
     * @param result defines Color3 object to store the result into
     * @returns the unmodified current Color3
     */
    subtractToRef(otherColor, result) {
        result.r = this.r - otherColor.r;
        result.g = this.g - otherColor.g;
        result.b = this.b - otherColor.b;
        return result;
    }
    /**
     * Subtract the given color from the current Color3
     * @param otherColor defines the second operand
     * @returns the current updated Color3
     */
    subtractInPlace(otherColor) {
        this.r -= otherColor.r;
        this.g -= otherColor.g;
        this.b -= otherColor.b;
        return this;
    }
    /**
     * Returns a new Color3 set with the subtraction of the given floats from the current Color3 coordinates
     * @param r defines the r coordinate of the operand
     * @param g defines the g coordinate of the operand
     * @param b defines the b coordinate of the operand
     * @returns the resulting Color3
     */
    subtractFromFloats(r, g, b) {
        return new Color3(this.r - r, this.g - g, this.b - b);
    }
    /**
     * Subtracts the given floats from the current Color3 coordinates and set the given color "result" with this result
     * @param r defines the r coordinate of the operand
     * @param g defines the g coordinate of the operand
     * @param b defines the b coordinate of the operand
     * @param result defines the Color3 object where to store the result
     * @returns the result
     */
    subtractFromFloatsToRef(r, g, b, result) {
        result.r = this.r - r;
        result.g = this.g - g;
        result.b = this.b - b;
        return result;
    }
    /**
     * Copy the current object
     * @returns a new Color3 copied the current one
     */
    clone() {
        return new Color3(this.r, this.g, this.b);
    }
    /**
     * Copies the rgb values from the source in the current Color3
     * @param source defines the source Color3 object
     * @returns the updated Color3 object
     */
    copyFrom(source) {
        this.r = source.r;
        this.g = source.g;
        this.b = source.b;
        return this;
    }
    /**
     * Updates the Color3 rgb values from the given floats
     * @param r defines the red component to read from
     * @param g defines the green component to read from
     * @param b defines the blue component to read from
     * @returns the current Color3 object
     */
    copyFromFloats(r, g, b) {
        this.r = r;
        this.g = g;
        this.b = b;
        return this;
    }
    /**
     * Updates the Color3 rgb values from the given floats
     * @param r defines the red component to read from
     * @param g defines the green component to read from
     * @param b defines the blue component to read from
     * @returns the current Color3 object
     */
    set(r, g, b) {
        return this.copyFromFloats(r, g, b);
    }
    /**
     * Copies the given float to the current Color3 coordinates
     * @param v defines the r, g and b coordinates of the operand
     * @returns the current updated Color3
     */
    setAll(v) {
        this.r = this.g = this.b = v;
        return this;
    }
    /**
     * Compute the Color3 hexadecimal code as a string
     * @returns a string containing the hexadecimal representation of the Color3 object
     */
    toHexString() {
        const intR = Math.round(this.r * 255);
        const intG = Math.round(this.g * 255);
        const intB = Math.round(this.b * 255);
        return "#" + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intR) + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intG) + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intB);
    }
    /**
     * Updates the Color3 rgb values from the string containing valid hexadecimal values
     * @param hex defines a string containing valid hexadecimal values
     * @returns the current Color3 object
     */
    fromHexString(hex) {
        if (hex.substring(0, 1) !== "#" || hex.length !== 7) {
            return this;
        }
        this.r = parseInt(hex.substring(1, 3), 16) / 255;
        this.g = parseInt(hex.substring(3, 5), 16) / 255;
        this.b = parseInt(hex.substring(5, 7), 16) / 255;
        return this;
    }
    /**
     * Converts current color in rgb space to HSV values
     * @returns a new color3 representing the HSV values
     */
    toHSV() {
        return this.toHSVToRef(new Color3());
    }
    /**
     * Converts current color in rgb space to HSV values
     * @param result defines the Color3 where to store the HSV values
     * @returns the updated result
     */
    toHSVToRef(result) {
        const r = this.r;
        const g = this.g;
        const b = this.b;
        const max = Math.max(r, g, b);
        const min = Math.min(r, g, b);
        let h = 0;
        let s = 0;
        const v = max;
        const dm = max - min;
        if (max !== 0) {
            s = dm / max;
        }
        if (max != min) {
            if (max == r) {
                h = (g - b) / dm;
                if (g < b) {
                    h += 6;
                }
            }
            else if (max == g) {
                h = (b - r) / dm + 2;
            }
            else if (max == b) {
                h = (r - g) / dm + 4;
            }
            h *= 60;
        }
        result.r = h;
        result.g = s;
        result.b = v;
        return result;
    }
    /**
     * Computes a new Color3 converted from the current one to linear space
     * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
     * @returns a new Color3 object
     */
    toLinearSpace(exact = false) {
        const convertedColor = new Color3();
        this.toLinearSpaceToRef(convertedColor, exact);
        return convertedColor;
    }
    /**
     * Converts the Color3 values to linear space and stores the result in "convertedColor"
     * @param convertedColor defines the Color3 object where to store the linear space version
     * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
     * @returns the unmodified Color3
     */
    toLinearSpaceToRef(convertedColor, exact = false) {
        if (exact) {
            convertedColor.r = colorChannelToLinearSpaceExact(this.r);
            convertedColor.g = colorChannelToLinearSpaceExact(this.g);
            convertedColor.b = colorChannelToLinearSpaceExact(this.b);
        }
        else {
            convertedColor.r = colorChannelToLinearSpace(this.r);
            convertedColor.g = colorChannelToLinearSpace(this.g);
            convertedColor.b = colorChannelToLinearSpace(this.b);
        }
        return this;
    }
    /**
     * Computes a new Color3 converted from the current one to gamma space
     * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
     * @returns a new Color3 object
     */
    toGammaSpace(exact = false) {
        const convertedColor = new Color3();
        this.toGammaSpaceToRef(convertedColor, exact);
        return convertedColor;
    }
    /**
     * Converts the Color3 values to gamma space and stores the result in "convertedColor"
     * @param convertedColor defines the Color3 object where to store the gamma space version
     * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
     * @returns the unmodified Color3
     */
    toGammaSpaceToRef(convertedColor, exact = false) {
        if (exact) {
            convertedColor.r = colorChannelToGammaSpaceExact(this.r);
            convertedColor.g = colorChannelToGammaSpaceExact(this.g);
            convertedColor.b = colorChannelToGammaSpaceExact(this.b);
        }
        else {
            convertedColor.r = colorChannelToGammaSpace(this.r);
            convertedColor.g = colorChannelToGammaSpace(this.g);
            convertedColor.b = colorChannelToGammaSpace(this.b);
        }
        return this;
    }
    /**
     * Converts Hue, saturation and value to a Color3 (RGB)
     * @param hue defines the hue (value between 0 and 360)
     * @param saturation defines the saturation (value between 0 and 1)
     * @param value defines the value (value between 0 and 1)
     * @param result defines the Color3 where to store the RGB values
     * @returns the updated result
     */
    static HSVtoRGBToRef(hue, saturation, value, result) {
        const chroma = value * saturation;
        const h = hue / 60;
        const x = chroma * (1 - Math.abs((h % 2) - 1));
        let r = 0;
        let g = 0;
        let b = 0;
        if (h >= 0 && h <= 1) {
            r = chroma;
            g = x;
        }
        else if (h >= 1 && h <= 2) {
            r = x;
            g = chroma;
        }
        else if (h >= 2 && h <= 3) {
            g = chroma;
            b = x;
        }
        else if (h >= 3 && h <= 4) {
            g = x;
            b = chroma;
        }
        else if (h >= 4 && h <= 5) {
            r = x;
            b = chroma;
        }
        else if (h >= 5 && h <= 6) {
            r = chroma;
            b = x;
        }
        const m = value - chroma;
        result.r = r + m;
        result.g = g + m;
        result.b = b + m;
        return result;
    }
    /**
     * Converts Hue, saturation and value to a new Color3 (RGB)
     * @param hue defines the hue (value between 0 and 360)
     * @param saturation defines the saturation (value between 0 and 1)
     * @param value defines the value (value between 0 and 1)
     * @returns a new Color3 object
     */
    static FromHSV(hue, saturation, value) {
        const result = new Color3(0, 0, 0);
        Color3.HSVtoRGBToRef(hue, saturation, value, result);
        return result;
    }
    /**
     * Creates a new Color3 from the string containing valid hexadecimal values
     * @param hex defines a string containing valid hexadecimal values
     * @returns a new Color3 object
     */
    static FromHexString(hex) {
        return new Color3(0, 0, 0).fromHexString(hex);
    }
    /**
     * Creates a new Color3 from the starting index of the given array
     * @param array defines the source array
     * @param offset defines an offset in the source array
     * @returns a new Color3 object
     */
    static FromArray(array, offset = 0) {
        return new Color3(array[offset], array[offset + 1], array[offset + 2]);
    }
    /**
     * Creates a new Color3 from the starting index element of the given array
     * @param array defines the source array to read from
     * @param offset defines the offset in the source array
     * @param result defines the target Color3 object
     */
    static FromArrayToRef(array, offset = 0, result) {
        result.r = array[offset];
        result.g = array[offset + 1];
        result.b = array[offset + 2];
    }
    /**
     * Creates a new Color3 from integer values (\< 256)
     * @param r defines the red component to read from (value between 0 and 255)
     * @param g defines the green component to read from (value between 0 and 255)
     * @param b defines the blue component to read from (value between 0 and 255)
     * @returns a new Color3 object
     */
    static FromInts(r, g, b) {
        return new Color3(r / 255.0, g / 255.0, b / 255.0);
    }
    /**
     * Creates a new Color3 with values linearly interpolated of "amount" between the start Color3 and the end Color3
     * @param start defines the start Color3 value
     * @param end defines the end Color3 value
     * @param amount defines the gradient value between start and end
     * @returns a new Color3 object
     */
    static Lerp(start, end, amount) {
        const result = new Color3(0.0, 0.0, 0.0);
        Color3.LerpToRef(start, end, amount, result);
        return result;
    }
    /**
     * Creates a new Color3 with values linearly interpolated of "amount" between the start Color3 and the end Color3
     * @param left defines the start value
     * @param right defines the end value
     * @param amount defines the gradient factor
     * @param result defines the Color3 object where to store the result
     */
    static LerpToRef(left, right, amount, result) {
        result.r = left.r + (right.r - left.r) * amount;
        result.g = left.g + (right.g - left.g) * amount;
        result.b = left.b + (right.b - left.b) * amount;
    }
    /**
     * Returns a new Color3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2"
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent Color3
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent Color3
     * @param amount defines the amount on the interpolation spline (between 0 and 1)
     * @returns the new Color3
     */
    static Hermite(value1, tangent1, value2, tangent2, amount) {
        const squared = amount * amount;
        const cubed = amount * squared;
        const part1 = 2.0 * cubed - 3.0 * squared + 1.0;
        const part2 = -2.0 * cubed + 3.0 * squared;
        const part3 = cubed - 2.0 * squared + amount;
        const part4 = cubed - squared;
        const r = value1.r * part1 + value2.r * part2 + tangent1.r * part3 + tangent2.r * part4;
        const g = value1.g * part1 + value2.g * part2 + tangent1.g * part3 + tangent2.g * part4;
        const b = value1.b * part1 + value2.b * part2 + tangent1.b * part3 + tangent2.b * part4;
        return new Color3(r, g, b);
    }
    /**
     * Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @returns 1st derivative
     */
    static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {
        const result = Color3.Black();
        this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);
        return result;
    }
    /**
     * Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @param result define where to store the derivative
     */
    static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {
        const t2 = time * time;
        result.r = (t2 - time) * 6 * value1.r + (3 * t2 - 4 * time + 1) * tangent1.r + (-t2 + time) * 6 * value2.r + (3 * t2 - 2 * time) * tangent2.r;
        result.g = (t2 - time) * 6 * value1.g + (3 * t2 - 4 * time + 1) * tangent1.g + (-t2 + time) * 6 * value2.g + (3 * t2 - 2 * time) * tangent2.g;
        result.b = (t2 - time) * 6 * value1.b + (3 * t2 - 4 * time + 1) * tangent1.b + (-t2 + time) * 6 * value2.b + (3 * t2 - 2 * time) * tangent2.b;
    }
    /**
     * Returns a Color3 value containing a red color
     * @returns a new Color3 object
     */
    static Red() {
        return new Color3(1, 0, 0);
    }
    /**
     * Returns a Color3 value containing a green color
     * @returns a new Color3 object
     */
    static Green() {
        return new Color3(0, 1, 0);
    }
    /**
     * Returns a Color3 value containing a blue color
     * @returns a new Color3 object
     */
    static Blue() {
        return new Color3(0, 0, 1);
    }
    /**
     * Returns a Color3 value containing a black color
     * @returns a new Color3 object
     */
    static Black() {
        return new Color3(0, 0, 0);
    }
    /**
     * Gets a Color3 value containing a black color that must not be updated
     */
    static get BlackReadOnly() {
        return Color3._BlackReadOnly;
    }
    /**
     * Returns a Color3 value containing a white color
     * @returns a new Color3 object
     */
    static White() {
        return new Color3(1, 1, 1);
    }
    /**
     * Returns a Color3 value containing a purple color
     * @returns a new Color3 object
     */
    static Purple() {
        return new Color3(0.5, 0, 0.5);
    }
    /**
     * Returns a Color3 value containing a magenta color
     * @returns a new Color3 object
     */
    static Magenta() {
        return new Color3(1, 0, 1);
    }
    /**
     * Returns a Color3 value containing a yellow color
     * @returns a new Color3 object
     */
    static Yellow() {
        return new Color3(1, 1, 0);
    }
    /**
     * Returns a Color3 value containing a gray color
     * @returns a new Color3 object
     */
    static Gray() {
        return new Color3(0.5, 0.5, 0.5);
    }
    /**
     * Returns a Color3 value containing a teal color
     * @returns a new Color3 object
     */
    static Teal() {
        return new Color3(0, 1.0, 1.0);
    }
    /**
     * Returns a Color3 value containing a random color
     * @returns a new Color3 object
     */
    static Random() {
        return new Color3(Math.random(), Math.random(), Math.random());
    }
}
/**
 * If the first color is flagged with integers (as everything is 0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
 * If subsequent colors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
 * and henceforth it will use floating-point representation for all color instances that it creates.
 * But the original color instances are unchanged and has a "deprecated map".
 * If we keep using the color instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
 */
Color3._V8PerformanceHack = new Color3(0.5, 0.5, 0.5);
// Statics
Color3._BlackReadOnly = Color3.Black();
Object.defineProperties(Color3.prototype, {
    dimension: { value: [3] },
    rank: { value: 1 },
});
/**
 * Class used to hold a RBGA color
 */
class Color4 {
    /**
     * Creates a new Color4 object from red, green, blue values, all between 0 and 1
     * @param r defines the red component (between 0 and 1, default is 0)
     * @param g defines the green component (between 0 and 1, default is 0)
     * @param b defines the blue component (between 0 and 1, default is 0)
     * @param a defines the alpha component (between 0 and 1, default is 1)
     */
    constructor(
    /**
     * [0] Defines the red component (between 0 and 1, default is 0)
     */
    r = 0, 
    /**
     * [0] Defines the green component (between 0 and 1, default is 0)
     */
    g = 0, 
    /**
     * [0] Defines the blue component (between 0 and 1, default is 0)
     */
    b = 0, 
    /**
     * [1] Defines the alpha component (between 0 and 1, default is 1)
     */
    a = 1) {
        this.r = r;
        this.g = g;
        this.b = b;
        this.a = a;
    }
    // Operators
    /**
     * Creates a new array populated with 4 numeric elements : red, green, blue, alpha values
     * @returns the new array
     */
    asArray() {
        return [this.r, this.g, this.b, this.a];
    }
    /**
     * Stores from the starting index in the given array the Color4 successive values
     * @param array defines the array where to store the r,g,b components
     * @param index defines an optional index in the target array to define where to start storing values
     * @returns the current Color4 object
     */
    toArray(array, index = 0) {
        array[index] = this.r;
        array[index + 1] = this.g;
        array[index + 2] = this.b;
        array[index + 3] = this.a;
        return this;
    }
    /**
     * Update the current color with values stored in an array from the starting index of the given array
     * @param array defines the source array
     * @param offset defines an offset in the source array
     * @returns the current Color4 object
     */
    fromArray(array, offset = 0) {
        this.r = array[offset];
        this.g = array[offset + 1];
        this.b = array[offset + 2];
        this.a = array[offset + 3];
        return this;
    }
    /**
     * Determines equality between Color4 objects
     * @param otherColor defines the second operand
     * @returns true if the rgba values are equal to the given ones
     */
    equals(otherColor) {
        return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b && this.a === otherColor.a;
    }
    /**
     * Creates a new Color4 set with the added values of the current Color4 and of the given one
     * @param otherColor defines the second operand
     * @returns a new Color4 object
     */
    add(otherColor) {
        return new Color4(this.r + otherColor.r, this.g + otherColor.g, this.b + otherColor.b, this.a + otherColor.a);
    }
    /**
     * Updates the given color "result" with the result of the addition of the current Color4 and the given one.
     * @param otherColor the color to add
     * @param result the color to store the result
     * @returns result input
     */
    addToRef(otherColor, result) {
        result.r = this.r + otherColor.r;
        result.g = this.g + otherColor.g;
        result.b = this.b + otherColor.b;
        result.a = this.a + otherColor.a;
        return result;
    }
    /**
     * Adds in place the given Color4 values to the current Color4 object
     * @param otherColor defines the second operand
     * @returns the current updated Color4 object
     */
    addInPlace(otherColor) {
        this.r += otherColor.r;
        this.g += otherColor.g;
        this.b += otherColor.b;
        this.a += otherColor.a;
        return this;
    }
    /**
     * Adds the given coordinates to the current Color4
     * @param r defines the r coordinate of the operand
     * @param g defines the g coordinate of the operand
     * @param b defines the b coordinate of the operand
     * @param a defines the a coordinate of the operand
     * @returns the current updated Color4
     */
    addInPlaceFromFloats(r, g, b, a) {
        this.r += r;
        this.g += g;
        this.b += b;
        this.a += a;
        return this;
    }
    /**
     * Creates a new Color4 set with the subtracted values of the given one from the current Color4
     * @param otherColor defines the second operand
     * @returns a new Color4 object
     */
    subtract(otherColor) {
        return new Color4(this.r - otherColor.r, this.g - otherColor.g, this.b - otherColor.b, this.a - otherColor.a);
    }
    /**
     * Subtracts the given ones from the current Color4 values and stores the results in "result"
     * @param otherColor defines the second operand
     * @param result defines the Color4 object where to store the result
     * @returns the result Color4 object
     */
    subtractToRef(otherColor, result) {
        result.r = this.r - otherColor.r;
        result.g = this.g - otherColor.g;
        result.b = this.b - otherColor.b;
        result.a = this.a - otherColor.a;
        return result;
    }
    /**
     * Subtract in place the given color from the current Color4.
     * @param otherColor the color to subtract
     * @returns the updated Color4.
     */
    subtractInPlace(otherColor) {
        this.r -= otherColor.r;
        this.g -= otherColor.g;
        this.b -= otherColor.b;
        this.a -= otherColor.a;
        return this;
    }
    /**
     * Returns a new Color4 set with the result of the subtraction of the given floats from the current Color4 coordinates.
     * @param r value to subtract
     * @param g value to subtract
     * @param b value to subtract
     * @param a value to subtract
     * @returns new color containing the result
     */
    subtractFromFloats(r, g, b, a) {
        return new Color4(this.r - r, this.g - g, this.b - b, this.a - a);
    }
    /**
     * Sets the given color "result" set with the result of the subtraction of the given floats from the current Color4 coordinates.
     * @param r value to subtract
     * @param g value to subtract
     * @param b value to subtract
     * @param a value to subtract
     * @param result the color to store the result in
     * @returns result input
     */
    subtractFromFloatsToRef(r, g, b, a, result) {
        result.r = this.r - r;
        result.g = this.g - g;
        result.b = this.b - b;
        result.a = this.a - a;
        return result;
    }
    /**
     * Creates a new Color4 with the current Color4 values multiplied by scale
     * @param scale defines the scaling factor to apply
     * @returns a new Color4 object
     */
    scale(scale) {
        return new Color4(this.r * scale, this.g * scale, this.b * scale, this.a * scale);
    }
    /**
     * Multiplies the Color4 values by the float "scale"
     * @param scale defines the scaling factor to apply
     * @returns the current updated Color4
     */
    scaleInPlace(scale) {
        this.r *= scale;
        this.g *= scale;
        this.b *= scale;
        this.a *= scale;
        return this;
    }
    /**
     * Multiplies the current Color4 values by scale and stores the result in "result"
     * @param scale defines the scaling factor to apply
     * @param result defines the Color4 object where to store the result
     * @returns the result Color4
     */
    scaleToRef(scale, result) {
        result.r = this.r * scale;
        result.g = this.g * scale;
        result.b = this.b * scale;
        result.a = this.a * scale;
        return result;
    }
    /**
     * Scale the current Color4 values by a factor and add the result to a given Color4
     * @param scale defines the scale factor
     * @param result defines the Color4 object where to store the result
     * @returns the result Color4
     */
    scaleAndAddToRef(scale, result) {
        result.r += this.r * scale;
        result.g += this.g * scale;
        result.b += this.b * scale;
        result.a += this.a * scale;
        return result;
    }
    /**
     * Clamps the rgb values by the min and max values and stores the result into "result"
     * @param min defines minimum clamping value (default is 0)
     * @param max defines maximum clamping value (default is 1)
     * @param result defines color to store the result into.
     * @returns the result Color4
     */
    clampToRef(min = 0, max = 1, result) {
        result.r = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.Clamp)(this.r, min, max);
        result.g = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.Clamp)(this.g, min, max);
        result.b = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.Clamp)(this.b, min, max);
        result.a = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.Clamp)(this.a, min, max);
        return result;
    }
    /**
     * Multiply an Color4 value by another and return a new Color4 object
     * @param color defines the Color4 value to multiply by
     * @returns a new Color4 object
     */
    multiply(color) {
        return new Color4(this.r * color.r, this.g * color.g, this.b * color.b, this.a * color.a);
    }
    /**
     * Multiply a Color4 value by another and push the result in a reference value
     * @param color defines the Color4 value to multiply by
     * @param result defines the Color4 to fill the result in
     * @returns the result Color4
     */
    multiplyToRef(color, result) {
        result.r = this.r * color.r;
        result.g = this.g * color.g;
        result.b = this.b * color.b;
        result.a = this.a * color.a;
        return result;
    }
    /**
     * Multiplies in place the current Color4 by the given one.
     * @param otherColor color to multiple with
     * @returns the updated Color4.
     */
    multiplyInPlace(otherColor) {
        this.r *= otherColor.r;
        this.g *= otherColor.g;
        this.b *= otherColor.b;
        this.a *= otherColor.a;
        return this;
    }
    /**
     * Returns a new Color4 set with the multiplication result of the given floats and the current Color4 coordinates.
     * @param r value multiply with
     * @param g value multiply with
     * @param b value multiply with
     * @param a value multiply with
     * @returns resulting new color
     */
    multiplyByFloats(r, g, b, a) {
        return new Color4(this.r * r, this.g * g, this.b * b, this.a * a);
    }
    /**
     * @internal
     * Do not use
     */
    divide(_other) {
        throw new ReferenceError("Can not divide a color");
    }
    /**
     * @internal
     * Do not use
     */
    divideToRef(_other, _result) {
        throw new ReferenceError("Can not divide a color");
    }
    /**
     * @internal
     * Do not use
     */
    divideInPlace(_other) {
        throw new ReferenceError("Can not divide a color");
    }
    /**
     * Updates the Color4 coordinates with the minimum values between its own and the given color ones
     * @param other defines the second operand
     * @returns the current updated Color4
     */
    minimizeInPlace(other) {
        this.r = Math.min(this.r, other.r);
        this.g = Math.min(this.g, other.g);
        this.b = Math.min(this.b, other.b);
        this.a = Math.min(this.a, other.a);
        return this;
    }
    /**
     * Updates the Color4 coordinates with the maximum values between its own and the given color ones
     * @param other defines the second operand
     * @returns the current updated Color4
     */
    maximizeInPlace(other) {
        this.r = Math.max(this.r, other.r);
        this.g = Math.max(this.g, other.g);
        this.b = Math.max(this.b, other.b);
        this.a = Math.max(this.a, other.a);
        return this;
    }
    /**
     * Updates the current Color4 with the minimal coordinate values between its and the given coordinates
     * @param r defines the r coordinate of the operand
     * @param g defines the g coordinate of the operand
     * @param b defines the b coordinate of the operand
     * @param a defines the a coordinate of the operand
     * @returns the current updated Color4
     */
    minimizeInPlaceFromFloats(r, g, b, a) {
        this.r = Math.min(r, this.r);
        this.g = Math.min(g, this.g);
        this.b = Math.min(b, this.b);
        this.a = Math.min(a, this.a);
        return this;
    }
    /**
     * Updates the current Color4 with the maximal coordinate values between its and the given coordinates.
     * @param r defines the r coordinate of the operand
     * @param g defines the g coordinate of the operand
     * @param b defines the b coordinate of the operand
     * @param a defines the a coordinate of the operand
     * @returns the current updated Color4
     */
    maximizeInPlaceFromFloats(r, g, b, a) {
        this.r = Math.max(r, this.r);
        this.g = Math.max(g, this.g);
        this.b = Math.max(b, this.b);
        this.a = Math.max(a, this.a);
        return this;
    }
    /**
     * @internal
     * Do not use
     */
    floorToRef(_result) {
        throw new ReferenceError("Can not floor a color");
    }
    /**
     * @internal
     * Do not use
     */
    floor() {
        throw new ReferenceError("Can not floor a color");
    }
    /**
     * @internal
     * Do not use
     */
    fractToRef(_result) {
        throw new ReferenceError("Can not fract a color");
    }
    /**
     * @internal
     * Do not use
     */
    fract() {
        throw new ReferenceError("Can not fract a color");
    }
    /**
     * @internal
     * Do not use
     */
    negate() {
        throw new ReferenceError("Can not negate a color");
    }
    /**
     * @internal
     * Do not use
     */
    negateInPlace() {
        throw new ReferenceError("Can not negate a color");
    }
    /**
     * @internal
     * Do not use
     */
    negateToRef(_result) {
        throw new ReferenceError("Can not negate a color");
    }
    /**
     * Boolean : True if the current Color4 coordinates are each beneath the distance "epsilon" from the given color ones.
     * @param otherColor color to compare against
     * @param epsilon (Default: very small number)
     * @returns true if they are equal
     */
    equalsWithEpsilon(otherColor, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .bH) {
        return ((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.WithinEpsilon)(this.r, otherColor.r, epsilon) &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.WithinEpsilon)(this.g, otherColor.g, epsilon) &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.WithinEpsilon)(this.b, otherColor.b, epsilon) &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.WithinEpsilon)(this.a, otherColor.a, epsilon));
    }
    /**
     * Boolean : True if the given floats are strictly equal to the current Color4 coordinates.
     * @param x x value to compare against
     * @param y y value to compare against
     * @param z z value to compare against
     * @param w w value to compare against
     * @returns true if equal
     */
    equalsToFloats(x, y, z, w) {
        return this.r === x && this.g === y && this.b === z && this.a === w;
    }
    /**
     * Creates a string with the Color4 current values
     * @returns the string representation of the Color4 object
     */
    toString() {
        return "{R: " + this.r + " G:" + this.g + " B:" + this.b + " A:" + this.a + "}";
    }
    /**
     * Returns the string "Color4"
     * @returns "Color4"
     */
    getClassName() {
        return "Color4";
    }
    /**
     * Compute the Color4 hash code
     * @returns an unique number that can be used to hash Color4 objects
     */
    getHashCode() {
        let hash = (this.r * 255) | 0;
        hash = (hash * 397) ^ ((this.g * 255) | 0);
        hash = (hash * 397) ^ ((this.b * 255) | 0);
        hash = (hash * 397) ^ ((this.a * 255) | 0);
        return hash;
    }
    /**
     * Creates a new Color4 copied from the current one
     * @returns a new Color4 object
     */
    clone() {
        const result = new Color4();
        return result.copyFrom(this);
    }
    /**
     * Copies the given Color4 values into the current one
     * @param source defines the source Color4 object
     * @returns the current updated Color4 object
     */
    copyFrom(source) {
        this.r = source.r;
        this.g = source.g;
        this.b = source.b;
        this.a = source.a;
        return this;
    }
    /**
     * Copies the given float values into the current one
     * @param r defines the red component to read from
     * @param g defines the green component to read from
     * @param b defines the blue component to read from
     * @param a defines the alpha component to read from
     * @returns the current updated Color4 object
     */
    copyFromFloats(r, g, b, a) {
        this.r = r;
        this.g = g;
        this.b = b;
        this.a = a;
        return this;
    }
    /**
     * Copies the given float values into the current one
     * @param r defines the red component to read from
     * @param g defines the green component to read from
     * @param b defines the blue component to read from
     * @param a defines the alpha component to read from
     * @returns the current updated Color4 object
     */
    set(r, g, b, a) {
        return this.copyFromFloats(r, g, b, a);
    }
    /**
     * Copies the given float to the current Vector4 coordinates
     * @param v defines the r, g, b, and a coordinates of the operand
     * @returns the current updated Vector4
     */
    setAll(v) {
        this.r = this.g = this.b = this.a = v;
        return this;
    }
    /**
     * Compute the Color4 hexadecimal code as a string
     * @param returnAsColor3 defines if the string should only contains RGB values (off by default)
     * @returns a string containing the hexadecimal representation of the Color4 object
     */
    toHexString(returnAsColor3 = false) {
        const intR = Math.round(this.r * 255);
        const intG = Math.round(this.g * 255);
        const intB = Math.round(this.b * 255);
        if (returnAsColor3) {
            return "#" + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intR) + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intG) + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intB);
        }
        const intA = Math.round(this.a * 255);
        return "#" + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intR) + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intG) + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intB) + (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_3__.ToHex)(intA);
    }
    /**
     * Updates the Color4 rgba values from the string containing valid hexadecimal values.
     *
     * A valid hex string is either in the format #RRGGBB or #RRGGBBAA.
     *
     * When a hex string without alpha is passed, the resulting Color4 keeps
     * its previous alpha value.
     *
     * An invalid string does not modify this object
     *
     * @param hex defines a string containing valid hexadecimal values
     * @returns the current updated Color4 object
     */
    fromHexString(hex) {
        if (hex.substring(0, 1) !== "#" || (hex.length !== 9 && hex.length !== 7)) {
            return this;
        }
        this.r = parseInt(hex.substring(1, 3), 16) / 255;
        this.g = parseInt(hex.substring(3, 5), 16) / 255;
        this.b = parseInt(hex.substring(5, 7), 16) / 255;
        if (hex.length === 9) {
            this.a = parseInt(hex.substring(7, 9), 16) / 255;
        }
        return this;
    }
    /**
     * Computes a new Color4 converted from the current one to linear space
     * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
     * @returns a new Color4 object
     */
    toLinearSpace(exact = false) {
        const convertedColor = new Color4();
        this.toLinearSpaceToRef(convertedColor, exact);
        return convertedColor;
    }
    /**
     * Converts the Color4 values to linear space and stores the result in "convertedColor"
     * @param convertedColor defines the Color4 object where to store the linear space version
     * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
     * @returns the unmodified Color4
     */
    toLinearSpaceToRef(convertedColor, exact = false) {
        if (exact) {
            convertedColor.r = colorChannelToLinearSpaceExact(this.r);
            convertedColor.g = colorChannelToLinearSpaceExact(this.g);
            convertedColor.b = colorChannelToLinearSpaceExact(this.b);
        }
        else {
            convertedColor.r = colorChannelToLinearSpace(this.r);
            convertedColor.g = colorChannelToLinearSpace(this.g);
            convertedColor.b = colorChannelToLinearSpace(this.b);
        }
        convertedColor.a = this.a;
        return this;
    }
    /**
     * Computes a new Color4 converted from the current one to gamma space
     * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
     * @returns a new Color4 object
     */
    toGammaSpace(exact = false) {
        const convertedColor = new Color4();
        this.toGammaSpaceToRef(convertedColor, exact);
        return convertedColor;
    }
    /**
     * Converts the Color4 values to gamma space and stores the result in "convertedColor"
     * @param convertedColor defines the Color4 object where to store the gamma space version
     * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
     * @returns the unmodified Color4
     */
    toGammaSpaceToRef(convertedColor, exact = false) {
        if (exact) {
            convertedColor.r = colorChannelToGammaSpaceExact(this.r);
            convertedColor.g = colorChannelToGammaSpaceExact(this.g);
            convertedColor.b = colorChannelToGammaSpaceExact(this.b);
        }
        else {
            convertedColor.r = colorChannelToGammaSpace(this.r);
            convertedColor.g = colorChannelToGammaSpace(this.g);
            convertedColor.b = colorChannelToGammaSpace(this.b);
        }
        convertedColor.a = this.a;
        return this;
    }
    // Statics
    /**
     * Creates a new Color4 from the string containing valid hexadecimal values.
     *
     * A valid hex string is either in the format #RRGGBB or #RRGGBBAA.
     *
     * When a hex string without alpha is passed, the resulting Color4 has
     * its alpha value set to 1.0.
     *
     * An invalid string results in a Color with all its channels set to 0.0,
     * i.e. "transparent black".
     *
     * @param hex defines a string containing valid hexadecimal values
     * @returns a new Color4 object
     */
    static FromHexString(hex) {
        if (hex.substring(0, 1) !== "#" || (hex.length !== 9 && hex.length !== 7)) {
            return new Color4(0.0, 0.0, 0.0, 0.0);
        }
        return new Color4(0.0, 0.0, 0.0, 1.0).fromHexString(hex);
    }
    /**
     * Creates a new Color4 object set with the linearly interpolated values of "amount" between the left Color4 object and the right Color4 object
     * @param left defines the start value
     * @param right defines the end value
     * @param amount defines the gradient factor
     * @returns a new Color4 object
     */
    static Lerp(left, right, amount) {
        return Color4.LerpToRef(left, right, amount, new Color4());
    }
    /**
     * Set the given "result" with the linearly interpolated values of "amount" between the left Color4 object and the right Color4 object
     * @param left defines the start value
     * @param right defines the end value
     * @param amount defines the gradient factor
     * @param result defines the Color4 object where to store data
     * @returns the updated result
     */
    static LerpToRef(left, right, amount, result) {
        result.r = left.r + (right.r - left.r) * amount;
        result.g = left.g + (right.g - left.g) * amount;
        result.b = left.b + (right.b - left.b) * amount;
        result.a = left.a + (right.a - left.a) * amount;
        return result;
    }
    /**
     * Interpolate between two Color4 using Hermite interpolation
     * @param value1 defines first Color4
     * @param tangent1 defines the incoming tangent
     * @param value2 defines second Color4
     * @param tangent2 defines the outgoing tangent
     * @param amount defines the target Color4
     * @returns the new interpolated Color4
     */
    static Hermite(value1, tangent1, value2, tangent2, amount) {
        const squared = amount * amount;
        const cubed = amount * squared;
        const part1 = 2.0 * cubed - 3.0 * squared + 1.0;
        const part2 = -2.0 * cubed + 3.0 * squared;
        const part3 = cubed - 2.0 * squared + amount;
        const part4 = cubed - squared;
        const r = value1.r * part1 + value2.r * part2 + tangent1.r * part3 + tangent2.r * part4;
        const g = value1.g * part1 + value2.g * part2 + tangent1.g * part3 + tangent2.g * part4;
        const b = value1.b * part1 + value2.b * part2 + tangent1.b * part3 + tangent2.b * part4;
        const a = value1.a * part1 + value2.a * part2 + tangent1.a * part3 + tangent2.a * part4;
        return new Color4(r, g, b, a);
    }
    /**
     * Returns a new Color4 which is the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @returns 1st derivative
     */
    static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {
        const result = new Color4();
        this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);
        return result;
    }
    /**
     * Update a Color4 with the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @param result define where to store the derivative
     */
    static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {
        const t2 = time * time;
        result.r = (t2 - time) * 6 * value1.r + (3 * t2 - 4 * time + 1) * tangent1.r + (-t2 + time) * 6 * value2.r + (3 * t2 - 2 * time) * tangent2.r;
        result.g = (t2 - time) * 6 * value1.g + (3 * t2 - 4 * time + 1) * tangent1.g + (-t2 + time) * 6 * value2.g + (3 * t2 - 2 * time) * tangent2.g;
        result.b = (t2 - time) * 6 * value1.b + (3 * t2 - 4 * time + 1) * tangent1.b + (-t2 + time) * 6 * value2.b + (3 * t2 - 2 * time) * tangent2.b;
        result.a = (t2 - time) * 6 * value1.a + (3 * t2 - 4 * time + 1) * tangent1.a + (-t2 + time) * 6 * value2.a + (3 * t2 - 2 * time) * tangent2.a;
    }
    /**
     * Creates a new Color4 from a Color3 and an alpha value
     * @param color3 defines the source Color3 to read from
     * @param alpha defines the alpha component (1.0 by default)
     * @returns a new Color4 object
     */
    static FromColor3(color3, alpha = 1.0) {
        return new Color4(color3.r, color3.g, color3.b, alpha);
    }
    /**
     * Creates a new Color4 from the starting index element of the given array
     * @param array defines the source array to read from
     * @param offset defines the offset in the source array
     * @returns a new Color4 object
     */
    static FromArray(array, offset = 0) {
        return new Color4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);
    }
    /**
     * Creates a new Color4 from the starting index element of the given array
     * @param array defines the source array to read from
     * @param offset defines the offset in the source array
     * @param result defines the target Color4 object
     */
    static FromArrayToRef(array, offset = 0, result) {
        result.r = array[offset];
        result.g = array[offset + 1];
        result.b = array[offset + 2];
        result.a = array[offset + 3];
    }
    /**
     * Creates a new Color3 from integer values (less than 256)
     * @param r defines the red component to read from (value between 0 and 255)
     * @param g defines the green component to read from (value between 0 and 255)
     * @param b defines the blue component to read from (value between 0 and 255)
     * @param a defines the alpha component to read from (value between 0 and 255)
     * @returns a new Color3 object
     */
    static FromInts(r, g, b, a) {
        return new Color4(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
    }
    /**
     * Check the content of a given array and convert it to an array containing RGBA data
     * If the original array was already containing count * 4 values then it is returned directly
     * @param colors defines the array to check
     * @param count defines the number of RGBA data to expect
     * @returns an array containing count * 4 values (RGBA)
     */
    static CheckColors4(colors, count) {
        // Check if color3 was used
        if (colors.length === count * 3) {
            const colors4 = [];
            for (let index = 0; index < colors.length; index += 3) {
                const newIndex = (index / 3) * 4;
                colors4[newIndex] = colors[index];
                colors4[newIndex + 1] = colors[index + 1];
                colors4[newIndex + 2] = colors[index + 2];
                colors4[newIndex + 3] = 1.0;
            }
            return colors4;
        }
        return colors;
    }
}
/**
 * If the first color is flagged with integers (as everything is 0,0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
 * If subsequent colors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
 * and henceforth it will use floating-point representation for all color instances that it creates.
 * But the original color instances are unchanged and has a "deprecated map".
 * If we keep using the color instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
 */
Color4._V8PerformanceHack = new Color4(0.5, 0.5, 0.5, 0.5);
Object.defineProperties(Color4.prototype, {
    dimension: { value: [4] },
    rank: { value: 1 },
});
/**
 * @internal
 */
class TmpColors {
}
TmpColors.Color3 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .BuildArray */ .mI)(3, Color3.Black);
TmpColors.Color4 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_0__/* .BuildArray */ .mI)(3, () => new Color4(0, 0, 0, 0));
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__/* .RegisterClass */ .Y5)("BABYLON.Color3", Color3);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_1__/* .RegisterClass */ .Y5)("BABYLON.Color4", Color4);
//# sourceMappingURL=math.color.js.map

/***/ }),

/***/ 65559:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   a6: () => (/* binding */ PHI),
/* harmony export */   bH: () => (/* binding */ Epsilon),
/* harmony export */   rv: () => (/* binding */ ToGammaSpace),
/* harmony export */   tk: () => (/* binding */ ToLinearSpace)
/* harmony export */ });
/**
 * Constant used to convert a value to gamma space
 * @ignorenaming
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
const ToGammaSpace = 1 / 2.2;
/**
 * Constant used to convert a value to linear space
 * @ignorenaming
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
const ToLinearSpace = 2.2;
/**
 * Constant Golden Ratio value in Babylon.js
 * @ignorenaming
 */
const PHI = (1 + Math.sqrt(5)) / 2;
/**
 * Constant used to define the minimal number value in Babylon.js
 * @ignorenaming
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
const Epsilon = 0.001;
//# sourceMappingURL=math.constants.js.map

/***/ }),

/***/ 22572:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   P: () => (/* binding */ Frustum)
/* harmony export */ });
/* harmony import */ var _math_plane_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94100);

/**
 * Represents a camera frustum
 */
class Frustum {
    /**
     * Gets the planes representing the frustum
     * @param transform matrix to be applied to the returned planes
     * @returns a new array of 6 Frustum planes computed by the given transformation matrix.
     */
    static GetPlanes(transform) {
        const frustumPlanes = [];
        for (let index = 0; index < 6; index++) {
            frustumPlanes.push(new _math_plane_js__WEBPACK_IMPORTED_MODULE_0__/* .Plane */ .Z(0.0, 0.0, 0.0, 0.0));
        }
        Frustum.GetPlanesToRef(transform, frustumPlanes);
        return frustumPlanes;
    }
    /**
     * Gets the near frustum plane transformed by the transform matrix
     * @param transform transformation matrix to be applied to the resulting frustum plane
     * @param frustumPlane the resulting frustum plane
     */
    static GetNearPlaneToRef(transform, frustumPlane) {
        const m = transform.m;
        frustumPlane.normal.x = m[3] + m[2];
        frustumPlane.normal.y = m[7] + m[6];
        frustumPlane.normal.z = m[11] + m[10];
        frustumPlane.d = m[15] + m[14];
        frustumPlane.normalize();
    }
    /**
     * Gets the far frustum plane transformed by the transform matrix
     * @param transform transformation matrix to be applied to the resulting frustum plane
     * @param frustumPlane the resulting frustum plane
     */
    static GetFarPlaneToRef(transform, frustumPlane) {
        const m = transform.m;
        frustumPlane.normal.x = m[3] - m[2];
        frustumPlane.normal.y = m[7] - m[6];
        frustumPlane.normal.z = m[11] - m[10];
        frustumPlane.d = m[15] - m[14];
        frustumPlane.normalize();
    }
    /**
     * Gets the left frustum plane transformed by the transform matrix
     * @param transform transformation matrix to be applied to the resulting frustum plane
     * @param frustumPlane the resulting frustum plane
     */
    static GetLeftPlaneToRef(transform, frustumPlane) {
        const m = transform.m;
        frustumPlane.normal.x = m[3] + m[0];
        frustumPlane.normal.y = m[7] + m[4];
        frustumPlane.normal.z = m[11] + m[8];
        frustumPlane.d = m[15] + m[12];
        frustumPlane.normalize();
    }
    /**
     * Gets the right frustum plane transformed by the transform matrix
     * @param transform transformation matrix to be applied to the resulting frustum plane
     * @param frustumPlane the resulting frustum plane
     */
    static GetRightPlaneToRef(transform, frustumPlane) {
        const m = transform.m;
        frustumPlane.normal.x = m[3] - m[0];
        frustumPlane.normal.y = m[7] - m[4];
        frustumPlane.normal.z = m[11] - m[8];
        frustumPlane.d = m[15] - m[12];
        frustumPlane.normalize();
    }
    /**
     * Gets the top frustum plane transformed by the transform matrix
     * @param transform transformation matrix to be applied to the resulting frustum plane
     * @param frustumPlane the resulting frustum plane
     */
    static GetTopPlaneToRef(transform, frustumPlane) {
        const m = transform.m;
        frustumPlane.normal.x = m[3] - m[1];
        frustumPlane.normal.y = m[7] - m[5];
        frustumPlane.normal.z = m[11] - m[9];
        frustumPlane.d = m[15] - m[13];
        frustumPlane.normalize();
    }
    /**
     * Gets the bottom frustum plane transformed by the transform matrix
     * @param transform transformation matrix to be applied to the resulting frustum plane
     * @param frustumPlane the resulting frustum plane
     */
    static GetBottomPlaneToRef(transform, frustumPlane) {
        const m = transform.m;
        frustumPlane.normal.x = m[3] + m[1];
        frustumPlane.normal.y = m[7] + m[5];
        frustumPlane.normal.z = m[11] + m[9];
        frustumPlane.d = m[15] + m[13];
        frustumPlane.normalize();
    }
    /**
     * Sets the given array "frustumPlanes" with the 6 Frustum planes computed by the given transformation matrix.
     * @param transform transformation matrix to be applied to the resulting frustum planes
     * @param frustumPlanes the resulting frustum planes
     */
    static GetPlanesToRef(transform, frustumPlanes) {
        // Near
        Frustum.GetNearPlaneToRef(transform, frustumPlanes[0]);
        // Far
        Frustum.GetFarPlaneToRef(transform, frustumPlanes[1]);
        // Left
        Frustum.GetLeftPlaneToRef(transform, frustumPlanes[2]);
        // Right
        Frustum.GetRightPlaneToRef(transform, frustumPlanes[3]);
        // Top
        Frustum.GetTopPlaneToRef(transform, frustumPlanes[4]);
        // Bottom
        Frustum.GetBottomPlaneToRef(transform, frustumPlanes[5]);
    }
    /**
     * Tests if a point is located between the frustum planes.
     * @param point defines the point to test
     * @param frustumPlanes defines the frustum planes to test
     * @returns true if the point is located between the frustum planes
     */
    static IsPointInFrustum(point, frustumPlanes) {
        for (let i = 0; i < 6; i++) {
            if (frustumPlanes[i].dotCoordinate(point) < 0) {
                return false;
            }
        }
        return true;
    }
}
//# sourceMappingURL=math.frustum.js.map

/***/ }),

/***/ 71139:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Y4: () => (/* binding */ FixFlippedFaces),
/* harmony export */   b8: () => (/* binding */ extractMinAndMax),
/* harmony export */   cD: () => (/* binding */ extractMinAndMaxIndexed)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79259);



// This helper class is only here so we can apply the nativeOverride decorator to functions.
class MathHelpers {
    static extractMinAndMaxIndexed(positions, indices, indexStart, indexCount, minimum, maximum) {
        for (let index = indexStart; index < indexStart + indexCount; index++) {
            const offset = indices[index] * 3;
            const x = positions[offset];
            const y = positions[offset + 1];
            const z = positions[offset + 2];
            minimum.minimizeInPlaceFromFloats(x, y, z);
            maximum.maximizeInPlaceFromFloats(x, y, z);
        }
    }
    static extractMinAndMax(positions, start, count, stride, minimum, maximum) {
        for (let index = start, offset = start * stride; index < start + count; index++, offset += stride) {
            const x = positions[offset];
            const y = positions[offset + 1];
            const z = positions[offset + 2];
            minimum.minimizeInPlaceFromFloats(x, y, z);
            maximum.maximizeInPlaceFromFloats(x, y, z);
        }
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .nativeOverride */ .Cx.filter((...[positions, indices]) => !Array.isArray(positions) && !Array.isArray(indices))
    // eslint-disable-next-line @typescript-eslint/naming-convention
], MathHelpers, "extractMinAndMaxIndexed", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .nativeOverride */ .Cx.filter((...[positions]) => !Array.isArray(positions))
    // eslint-disable-next-line @typescript-eslint/naming-convention
], MathHelpers, "extractMinAndMax", null);
/**
 * Extracts minimum and maximum values from a list of indexed positions
 * @param positions defines the positions to use
 * @param indices defines the indices to the positions
 * @param indexStart defines the start index
 * @param indexCount defines the end index
 * @param bias defines bias value to add to the result
 * @returns minimum and maximum values
 */
function extractMinAndMaxIndexed(positions, indices, indexStart, indexCount, bias = null) {
    const minimum = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
    const maximum = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
    MathHelpers.extractMinAndMaxIndexed(positions, indices, indexStart, indexCount, minimum, maximum);
    if (bias) {
        minimum.x -= minimum.x * bias.x + bias.y;
        minimum.y -= minimum.y * bias.x + bias.y;
        minimum.z -= minimum.z * bias.x + bias.y;
        maximum.x += maximum.x * bias.x + bias.y;
        maximum.y += maximum.y * bias.x + bias.y;
        maximum.z += maximum.z * bias.x + bias.y;
    }
    return {
        minimum: minimum,
        maximum: maximum,
    };
}
/**
 * Extracts minimum and maximum values from a list of positions
 * @param positions defines the positions to use
 * @param start defines the start index in the positions array
 * @param count defines the number of positions to handle
 * @param bias defines bias value to add to the result
 * @param stride defines the stride size to use (distance between two positions in the positions array)
 * @returns minimum and maximum values
 */
function extractMinAndMax(positions, start, count, bias = null, stride) {
    const minimum = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
    const maximum = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
    if (!stride) {
        stride = 3;
    }
    MathHelpers.extractMinAndMax(positions, start, count, stride, minimum, maximum);
    if (bias) {
        minimum.x -= minimum.x * bias.x + bias.y;
        minimum.y -= minimum.y * bias.x + bias.y;
        minimum.z -= minimum.z * bias.x + bias.y;
        maximum.x += maximum.x * bias.x + bias.y;
        maximum.y += maximum.y * bias.x + bias.y;
        maximum.z += maximum.z * bias.x + bias.y;
    }
    return {
        minimum: minimum,
        maximum: maximum,
    };
}
/**
 * Flip flipped faces
 * @param positions defines the positions to use
 * @param indices defines the indices to use and update
 */
function FixFlippedFaces(positions, indices) {
    const boundingInfo = extractMinAndMax(positions, 0, positions.length / 3);
    const inside = boundingInfo.maximum.subtract(boundingInfo.minimum).scale(0.5).add(boundingInfo.minimum);
    const tmpVectorA = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
    const tmpVectorB = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
    const tmpVectorC = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
    const tmpVectorAB = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
    const tmpVectorAC = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
    const tmpVectorNormal = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
    const tmpVectorAvgNormal = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq();
    // Clean indices
    for (let index = 0; index < indices.length; index += 3) {
        const a = indices[index];
        const b = indices[index + 1];
        const c = indices[index + 2];
        // Evaluate face normal
        tmpVectorA.fromArray(positions, a * 3);
        tmpVectorB.fromArray(positions, b * 3);
        tmpVectorC.fromArray(positions, c * 3);
        tmpVectorB.subtractToRef(tmpVectorA, tmpVectorAB);
        tmpVectorC.subtractToRef(tmpVectorA, tmpVectorAC);
        _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CrossToRef(tmpVectorAB, tmpVectorAC, tmpVectorNormal);
        tmpVectorNormal.normalize();
        // Calculate normal from face center to the inside of the geometry
        const avgX = tmpVectorA.x + tmpVectorB.x + tmpVectorC.x;
        const avgY = tmpVectorA.y + tmpVectorB.y + tmpVectorC.y;
        const avgZ = tmpVectorA.z + tmpVectorB.z + tmpVectorC.z;
        tmpVectorAvgNormal.set(avgX / 3, avgY / 3, avgZ / 3);
        tmpVectorAvgNormal.subtractInPlace(inside);
        tmpVectorAvgNormal.normalize();
        if (_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(tmpVectorNormal, tmpVectorAvgNormal) >= 0) {
            // Flip!
            indices[index] = c;
            indices[index + 2] = a;
        }
    }
}
//# sourceMappingURL=math.functions.js.map

/***/ }),

/***/ 62956:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  uM: () => (/* reexport */ math_path/* Angle */.uM),
  Xy: () => (/* reexport */ math_path/* Arc2 */.Xy),
  _0: () => (/* reexport */ math_axis/* Axis */._0),
  vr: () => (/* reexport */ math_path/* BezierCurve */.vr),
  v9: () => (/* reexport */ math_color/* Color3 */.v9),
  ov: () => (/* reexport */ math_color/* Color4 */.ov),
  xp: () => (/* reexport */ math_axis/* Coordinate */.xp),
  jj: () => (/* reexport */ math_path/* Curve3 */.jj),
  bH: () => (/* reexport */ math_constants/* Epsilon */.bH),
  PP: () => (/* reexport */ math_frustum/* Frustum */.P),
  uq: () => (/* reexport */ math_vector/* Matrix */.uq),
  t4: () => (/* reexport */ math_path/* Orientation */.t4),
  a6: () => (/* reexport */ math_constants/* PHI */.a6),
  Cu: () => (/* reexport */ math_path/* Path2 */.Cu),
  tO: () => (/* reexport */ math_path/* Path3D */.tO),
  Zc: () => (/* reexport */ math_plane/* Plane */.Z),
  k0: () => (/* reexport */ PositionNormalTextureVertex),
  B5: () => (/* reexport */ PositionNormalVertex),
  PT: () => (/* reexport */ math_vector/* Quaternion */.PT),
  or: () => (/* reexport */ math_size/* Size */.o),
  $x: () => (/* reexport */ math_axis/* Space */.$x),
  IG: () => (/* reexport */ math_color/* TmpColors */.IG),
  AA: () => (/* reexport */ math_vector/* TmpVectors */.AA),
  rv: () => (/* reexport */ math_constants/* ToGammaSpace */.rv),
  tk: () => (/* reexport */ math_constants/* ToLinearSpace */.tk),
  I9: () => (/* reexport */ math_vector/* Vector2 */.I9),
  Pq: () => (/* reexport */ math_vector/* Vector3 */.Pq),
  IU: () => (/* reexport */ math_vector/* Vector4 */.IU),
  LM: () => (/* reexport */ math_viewport/* Viewport */.L)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.axis.js
var math_axis = __webpack_require__(18733);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.color.js
var math_color = __webpack_require__(26041);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.constants.js
var math_constants = __webpack_require__(65559);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.frustum.js
var math_frustum = __webpack_require__(22572);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.path.js
var math_path = __webpack_require__(21903);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.plane.js
var math_plane = __webpack_require__(94100);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.size.js
var math_size = __webpack_require__(70521);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__(79923);
;// ./node_modules/@babylonjs/core/Maths/math.vertexFormat.js

/**
 * Contains position and normal vectors for a vertex
 */
class PositionNormalVertex {
    /**
     * Creates a PositionNormalVertex
     * @param position the position of the vertex (defaut: 0,0,0)
     * @param normal the normal of the vertex (defaut: 0,1,0)
     */
    constructor(
    /** [Vector3.Zero()] the position of the vertex (defaut: 0,0,0) */
    position = math_vector/* Vector3 */.Pq.Zero(), 
    /** [Vector3.Up()] the normal of the vertex (defaut: 0,1,0) */
    normal = math_vector/* Vector3 */.Pq.Up()) {
        this.position = position;
        this.normal = normal;
    }
    /**
     * Clones the PositionNormalVertex
     * @returns the cloned PositionNormalVertex
     */
    clone() {
        return new PositionNormalVertex(this.position.clone(), this.normal.clone());
    }
}
/**
 * Contains position, normal and uv vectors for a vertex
 */
class PositionNormalTextureVertex {
    /**
     * Creates a PositionNormalTextureVertex
     * @param position the position of the vertex (defaut: 0,0,0)
     * @param normal the normal of the vertex (defaut: 0,1,0)
     * @param uv the uv of the vertex (default: 0,0)
     */
    constructor(
    /** [Vector3.Zero()] the position of the vertex (defaut: 0,0,0) */
    position = math_vector/* Vector3 */.Pq.Zero(), 
    /** [Vector3.Up()] the normal of the vertex (defaut: 0,1,0) */
    normal = math_vector/* Vector3 */.Pq.Up(), 
    /** [Vector3.Zero()] the uv of the vertex (default: 0,0) */
    uv = math_vector/* Vector2 */.I9.Zero()) {
        this.position = position;
        this.normal = normal;
        this.uv = uv;
    }
    /**
     * Clones the PositionNormalTextureVertex
     * @returns the cloned PositionNormalTextureVertex
     */
    clone() {
        return new PositionNormalTextureVertex(this.position.clone(), this.normal.clone(), this.uv.clone());
    }
}
//# sourceMappingURL=math.vertexFormat.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.viewport.js
var math_viewport = __webpack_require__(54494);
;// ./node_modules/@babylonjs/core/Maths/math.js










//# sourceMappingURL=math.js.map

/***/ }),

/***/ 21903:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Cu: () => (/* binding */ Path2),
/* harmony export */   Xy: () => (/* binding */ Arc2),
/* harmony export */   jj: () => (/* binding */ Curve3),
/* harmony export */   t4: () => (/* binding */ Orientation),
/* harmony export */   tO: () => (/* binding */ Path3D),
/* harmony export */   uM: () => (/* binding */ Angle),
/* harmony export */   vr: () => (/* binding */ BezierCurve)
/* harmony export */ });
/* harmony import */ var _math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84867);
/* harmony import */ var _math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _math_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65559);



/**
 * Defines potential orientation for back face culling
 */
var Orientation;
(function (Orientation) {
    /**
     * Clockwise
     */
    Orientation[Orientation["CW"] = 0] = "CW";
    /** Counter clockwise */
    Orientation[Orientation["CCW"] = 1] = "CCW";
})(Orientation || (Orientation = {}));
/** Class used to represent a Bezier curve */
class BezierCurve {
    /**
     * Returns the cubic Bezier interpolated value (float) at "t" (float) from the given x1, y1, x2, y2 floats
     * @param t defines the time
     * @param x1 defines the left coordinate on X axis
     * @param y1 defines the left coordinate on Y axis
     * @param x2 defines the right coordinate on X axis
     * @param y2 defines the right coordinate on Y axis
     * @returns the interpolated value
     */
    static Interpolate(t, x1, y1, x2, y2) {
        // Extract X (which is equal to time here)
        const f0 = 1 - 3 * x2 + 3 * x1;
        const f1 = 3 * x2 - 6 * x1;
        const f2 = 3 * x1;
        let refinedT = t;
        for (let i = 0; i < 5; i++) {
            const refinedT2 = refinedT * refinedT;
            const refinedT3 = refinedT2 * refinedT;
            const x = f0 * refinedT3 + f1 * refinedT2 + f2 * refinedT;
            const slope = 1.0 / (3.0 * f0 * refinedT2 + 2.0 * f1 * refinedT + f2);
            refinedT -= (x - t) * slope;
            refinedT = Math.min(1, Math.max(0, refinedT));
        }
        // Resolve cubic bezier for the given x
        return 3 * Math.pow(1 - refinedT, 2) * refinedT * y1 + 3 * (1 - refinedT) * Math.pow(refinedT, 2) * y2 + Math.pow(refinedT, 3);
    }
}
/**
 * Defines angle representation
 */
class Angle {
    /**
     * Creates an Angle object of "radians" radians (float).
     * @param radians the angle in radians
     */
    constructor(radians) {
        this._radians = radians;
        if (this._radians < 0.0) {
            this._radians += 2.0 * Math.PI;
        }
    }
    /**
     * Get value in degrees
     * @returns the Angle value in degrees (float)
     */
    degrees() {
        return (this._radians * 180.0) / Math.PI;
    }
    /**
     * Get value in radians
     * @returns the Angle value in radians (float)
     */
    radians() {
        return this._radians;
    }
    /**
     * Gets a new Angle object with a value of the angle (in radians) between the line connecting the two points and the x-axis
     * @param a defines first point as the origin
     * @param b defines point
     * @returns a new Angle
     */
    static BetweenTwoPoints(a, b) {
        const delta = b.subtract(a);
        const theta = Math.atan2(delta.y, delta.x);
        return new Angle(theta);
    }
    /**
     * Gets the angle between the two vectors
     * @param a defines first vector
     * @param b defines vector
     * @returns Returns an new Angle between 0 and PI
     */
    static BetweenTwoVectors(a, b) {
        let product = a.lengthSquared() * b.lengthSquared();
        if (product === 0)
            return new Angle(Math.PI / 2);
        product = Math.sqrt(product);
        let cosVal = a.dot(b) / product;
        cosVal = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)(cosVal, -1, 1);
        const angle = Math.acos(cosVal);
        return new Angle(angle);
    }
    /**
     * Gets a new Angle object from the given float in radians
     * @param radians defines the angle value in radians
     * @returns a new Angle
     */
    static FromRadians(radians) {
        return new Angle(radians);
    }
    /**
     * Gets a new Angle object from the given float in degrees
     * @param degrees defines the angle value in degrees
     * @returns a new Angle
     */
    static FromDegrees(degrees) {
        return new Angle((degrees * Math.PI) / 180.0);
    }
}
/**
 * This represents an arc in a 2d space.
 */
class Arc2 {
    /**
     * Creates an Arc object from the three given points : start, middle and end.
     * @param startPoint Defines the start point of the arc
     * @param midPoint Defines the middle point of the arc
     * @param endPoint Defines the end point of the arc
     */
    constructor(
    /** Defines the start point of the arc */
    startPoint, 
    /** Defines the mid point of the arc */
    midPoint, 
    /** Defines the end point of the arc */
    endPoint) {
        this.startPoint = startPoint;
        this.midPoint = midPoint;
        this.endPoint = endPoint;
        const temp = Math.pow(midPoint.x, 2) + Math.pow(midPoint.y, 2);
        const startToMid = (Math.pow(startPoint.x, 2) + Math.pow(startPoint.y, 2) - temp) / 2;
        const midToEnd = (temp - Math.pow(endPoint.x, 2) - Math.pow(endPoint.y, 2)) / 2;
        const det = (startPoint.x - midPoint.x) * (midPoint.y - endPoint.y) - (midPoint.x - endPoint.x) * (startPoint.y - midPoint.y);
        this.centerPoint = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9((startToMid * (midPoint.y - endPoint.y) - midToEnd * (startPoint.y - midPoint.y)) / det, ((startPoint.x - midPoint.x) * midToEnd - (midPoint.x - endPoint.x) * startToMid) / det);
        this.radius = this.centerPoint.subtract(this.startPoint).length();
        this.startAngle = Angle.BetweenTwoPoints(this.centerPoint, this.startPoint);
        const a1 = this.startAngle.degrees();
        let a2 = Angle.BetweenTwoPoints(this.centerPoint, this.midPoint).degrees();
        let a3 = Angle.BetweenTwoPoints(this.centerPoint, this.endPoint).degrees();
        // angles correction
        if (a2 - a1 > +180.0) {
            a2 -= 360.0;
        }
        if (a2 - a1 < -180.0) {
            a2 += 360.0;
        }
        if (a3 - a2 > +180.0) {
            a3 -= 360.0;
        }
        if (a3 - a2 < -180.0) {
            a3 += 360.0;
        }
        this.orientation = a2 - a1 < 0 ? 0 /* Orientation.CW */ : 1 /* Orientation.CCW */;
        this.angle = Angle.FromDegrees(this.orientation === 0 /* Orientation.CW */ ? a1 - a3 : a3 - a1);
    }
}
/**
 * Represents a 2D path made up of multiple 2D points
 */
class Path2 {
    /**
     * Creates a Path2 object from the starting 2D coordinates x and y.
     * @param x the starting points x value
     * @param y the starting points y value
     */
    constructor(x, y) {
        this._points = new Array();
        this._length = 0.0;
        /**
         * If the path start and end point are the same
         */
        this.closed = false;
        this._points.push(new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9(x, y));
    }
    /**
     * Adds a new segment until the given coordinates (x, y) to the current Path2.
     * @param x the added points x value
     * @param y the added points y value
     * @returns the updated Path2.
     */
    addLineTo(x, y) {
        if (this.closed) {
            return this;
        }
        const newPoint = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9(x, y);
        const previousPoint = this._points[this._points.length - 1];
        this._points.push(newPoint);
        this._length += newPoint.subtract(previousPoint).length();
        return this;
    }
    /**
     * Adds _numberOfSegments_ segments according to the arc definition (middle point coordinates, end point coordinates, the arc start point being the current Path2 last point) to the current Path2.
     * @param midX middle point x value
     * @param midY middle point y value
     * @param endX end point x value
     * @param endY end point y value
     * @param numberOfSegments (default: 36)
     * @returns the updated Path2.
     */
    addArcTo(midX, midY, endX, endY, numberOfSegments = 36) {
        if (this.closed) {
            return this;
        }
        const startPoint = this._points[this._points.length - 1];
        const midPoint = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9(midX, midY);
        const endPoint = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9(endX, endY);
        const arc = new Arc2(startPoint, midPoint, endPoint);
        let increment = arc.angle.radians() / numberOfSegments;
        if (arc.orientation === 0 /* Orientation.CW */) {
            increment *= -1;
        }
        let currentAngle = arc.startAngle.radians() + increment;
        for (let i = 0; i < numberOfSegments; i++) {
            const x = Math.cos(currentAngle) * arc.radius + arc.centerPoint.x;
            const y = Math.sin(currentAngle) * arc.radius + arc.centerPoint.y;
            this.addLineTo(x, y);
            currentAngle += increment;
        }
        return this;
    }
    /**
     * Adds _numberOfSegments_ segments according to the quadratic curve definition to the current Path2.
     * @param controlX control point x value
     * @param controlY control point y value
     * @param endX end point x value
     * @param endY end point y value
     * @param numberOfSegments (default: 36)
     * @returns the updated Path2.
     */
    addQuadraticCurveTo(controlX, controlY, endX, endY, numberOfSegments = 36) {
        if (this.closed) {
            return this;
        }
        const equation = (t, val0, val1, val2) => {
            const res = (1.0 - t) * (1.0 - t) * val0 + 2.0 * t * (1.0 - t) * val1 + t * t * val2;
            return res;
        };
        const startPoint = this._points[this._points.length - 1];
        for (let i = 0; i <= numberOfSegments; i++) {
            const step = i / numberOfSegments;
            const x = equation(step, startPoint.x, controlX, endX);
            const y = equation(step, startPoint.y, controlY, endY);
            this.addLineTo(x, y);
        }
        return this;
    }
    /**
     * Adds _numberOfSegments_ segments according to the bezier curve definition to the current Path2.
     * @param originTangentX tangent vector at the origin point x value
     * @param originTangentY tangent vector at the origin point y value
     * @param destinationTangentX tangent vector at the destination point x value
     * @param destinationTangentY tangent vector at the destination point y value
     * @param endX end point x value
     * @param endY end point y value
     * @param numberOfSegments (default: 36)
     * @returns the updated Path2.
     */
    addBezierCurveTo(originTangentX, originTangentY, destinationTangentX, destinationTangentY, endX, endY, numberOfSegments = 36) {
        if (this.closed) {
            return this;
        }
        const equation = (t, val0, val1, val2, val3) => {
            const res = (1.0 - t) * (1.0 - t) * (1.0 - t) * val0 + 3.0 * t * (1.0 - t) * (1.0 - t) * val1 + 3.0 * t * t * (1.0 - t) * val2 + t * t * t * val3;
            return res;
        };
        const startPoint = this._points[this._points.length - 1];
        for (let i = 0; i <= numberOfSegments; i++) {
            const step = i / numberOfSegments;
            const x = equation(step, startPoint.x, originTangentX, destinationTangentX, endX);
            const y = equation(step, startPoint.y, originTangentY, destinationTangentY, endY);
            this.addLineTo(x, y);
        }
        return this;
    }
    /**
     * Defines if a given point is inside the polygon defines by the path
     * @param point defines the point to test
     * @returns true if the point is inside
     */
    isPointInside(point) {
        let isInside = false;
        const count = this._points.length;
        for (let p = count - 1, q = 0; q < count; p = q++) {
            let edgeLow = this._points[p];
            let edgeHigh = this._points[q];
            let edgeDx = edgeHigh.x - edgeLow.x;
            let edgeDy = edgeHigh.y - edgeLow.y;
            if (Math.abs(edgeDy) > Number.EPSILON) {
                // Not parallel
                if (edgeDy < 0) {
                    edgeLow = this._points[q];
                    edgeDx = -edgeDx;
                    edgeHigh = this._points[p];
                    edgeDy = -edgeDy;
                }
                if (point.y < edgeLow.y || point.y > edgeHigh.y) {
                    continue;
                }
                if (point.y === edgeLow.y && point.x === edgeLow.x) {
                    return true;
                }
                else {
                    const perpEdge = edgeDy * (point.x - edgeLow.x) - edgeDx * (point.y - edgeLow.y);
                    if (perpEdge === 0) {
                        return true;
                    }
                    if (perpEdge < 0) {
                        continue;
                    }
                    isInside = !isInside;
                }
            }
            else {
                // parallel or collinear
                if (point.y !== edgeLow.y) {
                    continue;
                }
                if ((edgeHigh.x <= point.x && point.x <= edgeLow.x) || (edgeLow.x <= point.x && point.x <= edgeHigh.x)) {
                    return true;
                }
            }
        }
        return isInside;
    }
    /**
     * Closes the Path2.
     * @returns the Path2.
     */
    close() {
        this.closed = true;
        return this;
    }
    /**
     * Gets the sum of the distance between each sequential point in the path
     * @returns the Path2 total length (float).
     */
    length() {
        let result = this._length;
        if (this.closed) {
            const lastPoint = this._points[this._points.length - 1];
            const firstPoint = this._points[0];
            result += firstPoint.subtract(lastPoint).length();
        }
        return result;
    }
    /**
     * Gets the area of the polygon defined by the path
     * @returns area value
     */
    area() {
        const n = this._points.length;
        let value = 0.0;
        for (let p = n - 1, q = 0; q < n; p = q++) {
            value += this._points[p].x * this._points[q].y - this._points[q].x * this._points[p].y;
        }
        return value * 0.5;
    }
    /**
     * Gets the points which construct the path
     * @returns the Path2 internal array of points.
     */
    getPoints() {
        return this._points;
    }
    /**
     * Retrieves the point at the distance aways from the starting point
     * @param normalizedLengthPosition the length along the path to retrieve the point from
     * @returns a new Vector2 located at a percentage of the Path2 total length on this path.
     */
    getPointAtLengthPosition(normalizedLengthPosition) {
        if (normalizedLengthPosition < 0 || normalizedLengthPosition > 1) {
            return _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9.Zero();
        }
        const lengthPosition = normalizedLengthPosition * this.length();
        let previousOffset = 0;
        for (let i = 0; i < this._points.length; i++) {
            const j = (i + 1) % this._points.length;
            const a = this._points[i];
            const b = this._points[j];
            const bToA = b.subtract(a);
            const nextOffset = bToA.length() + previousOffset;
            if (lengthPosition >= previousOffset && lengthPosition <= nextOffset) {
                const dir = bToA.normalize();
                const localOffset = lengthPosition - previousOffset;
                return new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9(a.x + dir.x * localOffset, a.y + dir.y * localOffset);
            }
            previousOffset = nextOffset;
        }
        return _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9.Zero();
    }
    /**
     * Creates a new path starting from an x and y position
     * @param x starting x value
     * @param y starting y value
     * @returns a new Path2 starting at the coordinates (x, y).
     */
    static StartingAt(x, y) {
        return new Path2(x, y);
    }
}
/**
 * Represents a 3D path made up of multiple 3D points
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/path3D
 */
class Path3D {
    /**
     * new Path3D(path, normal, raw)
     * Creates a Path3D. A Path3D is a logical math object, so not a mesh.
     * please read the description in the tutorial : https://doc.babylonjs.com/features/featuresDeepDive/mesh/path3D
     * @param path an array of Vector3, the curve axis of the Path3D
     * @param firstNormal (options) Vector3, the first wanted normal to the curve. Ex (0, 1, 0) for a vertical normal.
     * @param raw (optional, default false) : boolean, if true the returned Path3D isn't normalized. Useful to depict path acceleration or speed.
     * @param alignTangentsWithPath (optional, default false) : boolean, if true the tangents will be aligned with the path.
     */
    constructor(
    /**
     * an array of Vector3, the curve axis of the Path3D
     */
    path, firstNormal = null, raw, alignTangentsWithPath = false) {
        this.path = path;
        this._curve = new Array();
        this._distances = new Array();
        this._tangents = new Array();
        this._normals = new Array();
        this._binormals = new Array();
        // holds interpolated point data
        this._pointAtData = {
            id: 0,
            point: _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero(),
            previousPointArrayIndex: 0,
            position: 0,
            subPosition: 0,
            interpolateReady: false,
            interpolationMatrix: _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity(),
        };
        for (let p = 0; p < path.length; p++) {
            this._curve[p] = path[p].clone(); // hard copy
        }
        this._raw = raw || false;
        this._alignTangentsWithPath = alignTangentsWithPath;
        this._compute(firstNormal, alignTangentsWithPath);
    }
    /**
     * Returns the Path3D array of successive Vector3 designing its curve.
     * @returns the Path3D array of successive Vector3 designing its curve.
     */
    getCurve() {
        return this._curve;
    }
    /**
     * Returns the Path3D array of successive Vector3 designing its curve.
     * @returns the Path3D array of successive Vector3 designing its curve.
     */
    getPoints() {
        return this._curve;
    }
    /**
     * @returns the computed length (float) of the path.
     */
    length() {
        return this._distances[this._distances.length - 1];
    }
    /**
     * Returns an array populated with tangent vectors on each Path3D curve point.
     * @returns an array populated with tangent vectors on each Path3D curve point.
     */
    getTangents() {
        return this._tangents;
    }
    /**
     * Returns an array populated with normal vectors on each Path3D curve point.
     * @returns an array populated with normal vectors on each Path3D curve point.
     */
    getNormals() {
        return this._normals;
    }
    /**
     * Returns an array populated with binormal vectors on each Path3D curve point.
     * @returns an array populated with binormal vectors on each Path3D curve point.
     */
    getBinormals() {
        return this._binormals;
    }
    /**
     * Returns an array populated with distances (float) of the i-th point from the first curve point.
     * @returns an array populated with distances (float) of the i-th point from the first curve point.
     */
    getDistances() {
        return this._distances;
    }
    /**
     * Returns an interpolated point along this path
     * @param position the position of the point along this path, from 0.0 to 1.0
     * @returns a new Vector3 as the point
     */
    getPointAt(position) {
        return this._updatePointAtData(position).point;
    }
    /**
     * Returns the tangent vector of an interpolated Path3D curve point at the specified position along this path.
     * @param position the position of the point along this path, from 0.0 to 1.0
     * @param interpolated (optional, default false) : boolean, if true returns an interpolated tangent instead of the tangent of the previous path point.
     * @returns a tangent vector corresponding to the interpolated Path3D curve point, if not interpolated, the tangent is taken from the precomputed tangents array.
     */
    getTangentAt(position, interpolated = false) {
        this._updatePointAtData(position, interpolated);
        return interpolated ? _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinates(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Forward(), this._pointAtData.interpolationMatrix) : this._tangents[this._pointAtData.previousPointArrayIndex];
    }
    /**
     * Returns the tangent vector of an interpolated Path3D curve point at the specified position along this path.
     * @param position the position of the point along this path, from 0.0 to 1.0
     * @param interpolated (optional, default false) : boolean, if true returns an interpolated normal instead of the normal of the previous path point.
     * @returns a normal vector corresponding to the interpolated Path3D curve point, if not interpolated, the normal is taken from the precomputed normals array.
     */
    getNormalAt(position, interpolated = false) {
        this._updatePointAtData(position, interpolated);
        return interpolated ? _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinates(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Right(), this._pointAtData.interpolationMatrix) : this._normals[this._pointAtData.previousPointArrayIndex];
    }
    /**
     * Returns the binormal vector of an interpolated Path3D curve point at the specified position along this path.
     * @param position the position of the point along this path, from 0.0 to 1.0
     * @param interpolated (optional, default false) : boolean, if true returns an interpolated binormal instead of the binormal of the previous path point.
     * @returns a binormal vector corresponding to the interpolated Path3D curve point, if not interpolated, the binormal is taken from the precomputed binormals array.
     */
    getBinormalAt(position, interpolated = false) {
        this._updatePointAtData(position, interpolated);
        return interpolated ? _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinates(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.UpReadOnly, this._pointAtData.interpolationMatrix) : this._binormals[this._pointAtData.previousPointArrayIndex];
    }
    /**
     * Returns the distance (float) of an interpolated Path3D curve point at the specified position along this path.
     * @param position the position of the point along this path, from 0.0 to 1.0
     * @returns the distance of the interpolated Path3D curve point at the specified position along this path.
     */
    getDistanceAt(position) {
        return this.length() * position;
    }
    /**
     * Returns the array index of the previous point of an interpolated point along this path
     * @param position the position of the point to interpolate along this path, from 0.0 to 1.0
     * @returns the array index
     */
    getPreviousPointIndexAt(position) {
        this._updatePointAtData(position);
        return this._pointAtData.previousPointArrayIndex;
    }
    /**
     * Returns the position of an interpolated point relative to the two path points it lies between, from 0.0 (point A) to 1.0 (point B)
     * @param position the position of the point to interpolate along this path, from 0.0 to 1.0
     * @returns the sub position
     */
    getSubPositionAt(position) {
        this._updatePointAtData(position);
        return this._pointAtData.subPosition;
    }
    /**
     * Returns the position of the closest virtual point on this path to an arbitrary Vector3, from 0.0 to 1.0
     * @param target the vector of which to get the closest position to
     * @returns the position of the closest virtual point on this path to the target vector
     */
    getClosestPositionTo(target) {
        let smallestDistance = Number.MAX_VALUE;
        let closestPosition = 0.0;
        for (let i = 0; i < this._curve.length - 1; i++) {
            const point = this._curve[i + 0];
            const tangent = this._curve[i + 1].subtract(point).normalize();
            const subLength = this._distances[i + 1] - this._distances[i + 0];
            const subPosition = Math.min((Math.max(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(tangent, target.subtract(point).normalize()), 0.0) * _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Distance(point, target)) / subLength, 1.0);
            const distance = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Distance(point.add(tangent.scale(subPosition * subLength)), target);
            if (distance < smallestDistance) {
                smallestDistance = distance;
                closestPosition = (this._distances[i + 0] + subLength * subPosition) / this.length();
            }
        }
        return closestPosition;
    }
    /**
     * Returns a sub path (slice) of this path
     * @param start the position of the fist path point, from 0.0 to 1.0, or a negative value, which will get wrapped around from the end of the path to 0.0 to 1.0 values
     * @param end the position of the last path point, from 0.0 to 1.0, or a negative value, which will get wrapped around from the end of the path to 0.0 to 1.0 values
     * @returns a sub path (slice) of this path
     */
    slice(start = 0.0, end = 1.0) {
        if (start < 0.0) {
            start = 1 - ((start * -1.0) % 1.0);
        }
        if (end < 0.0) {
            end = 1 - ((end * -1.0) % 1.0);
        }
        if (start > end) {
            const _start = start;
            start = end;
            end = _start;
        }
        const curvePoints = this.getCurve();
        const startPoint = this.getPointAt(start);
        let startIndex = this.getPreviousPointIndexAt(start);
        const endPoint = this.getPointAt(end);
        const endIndex = this.getPreviousPointIndexAt(end) + 1;
        const slicePoints = [];
        if (start !== 0.0) {
            startIndex++;
            slicePoints.push(startPoint);
        }
        slicePoints.push(...curvePoints.slice(startIndex, endIndex));
        if (end !== 1.0 || start === 1.0) {
            slicePoints.push(endPoint);
        }
        return new Path3D(slicePoints, this.getNormalAt(start), this._raw, this._alignTangentsWithPath);
    }
    /**
     * Forces the Path3D tangent, normal, binormal and distance recomputation.
     * @param path path which all values are copied into the curves points
     * @param firstNormal which should be projected onto the curve
     * @param alignTangentsWithPath (optional, default false) : boolean, if true the tangents will be aligned with the path
     * @returns the same object updated.
     */
    update(path, firstNormal = null, alignTangentsWithPath = false) {
        for (let p = 0; p < path.length; p++) {
            this._curve[p].x = path[p].x;
            this._curve[p].y = path[p].y;
            this._curve[p].z = path[p].z;
        }
        this._compute(firstNormal, alignTangentsWithPath);
        return this;
    }
    // private function compute() : computes tangents, normals and binormals
    _compute(firstNormal, alignTangentsWithPath = false) {
        const l = this._curve.length;
        if (l < 2) {
            return;
        }
        // first and last tangents
        this._tangents[0] = this._getFirstNonNullVector(0);
        if (!this._raw) {
            this._tangents[0].normalize();
        }
        this._tangents[l - 1] = this._curve[l - 1].subtract(this._curve[l - 2]);
        if (!this._raw) {
            this._tangents[l - 1].normalize();
        }
        // normals and binormals at first point : arbitrary vector with _normalVector()
        const tg0 = this._tangents[0];
        const pp0 = this._normalVector(tg0, firstNormal);
        this._normals[0] = pp0;
        if (!this._raw) {
            this._normals[0].normalize();
        }
        this._binormals[0] = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(tg0, this._normals[0]);
        if (!this._raw) {
            this._binormals[0].normalize();
        }
        this._distances[0] = 0.0;
        // normals and binormals : next points
        let prev; // previous vector (segment)
        let cur; // current vector (segment)
        let curTang; // current tangent
        // previous normal
        let prevNor; // previous normal
        let prevBinor; // previous binormal
        for (let i = 1; i < l; i++) {
            // tangents
            prev = this._getLastNonNullVector(i);
            if (i < l - 1) {
                cur = this._getFirstNonNullVector(i);
                this._tangents[i] = alignTangentsWithPath ? cur : prev.add(cur);
                this._tangents[i].normalize();
            }
            this._distances[i] = this._distances[i - 1] + this._curve[i].subtract(this._curve[i - 1]).length();
            // normals and binormals
            // http://www.cs.cmu.edu/afs/andrew/scs/cs/15-462/web/old/asst2camera.html
            curTang = this._tangents[i];
            prevBinor = this._binormals[i - 1];
            this._normals[i] = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(prevBinor, curTang);
            if (!this._raw) {
                if (this._normals[i].length() === 0) {
                    prevNor = this._normals[i - 1];
                    this._normals[i] = prevNor.clone();
                }
                else {
                    this._normals[i].normalize();
                }
            }
            this._binormals[i] = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(curTang, this._normals[i]);
            if (!this._raw) {
                this._binormals[i].normalize();
            }
        }
        this._pointAtData.id = NaN;
    }
    // private function getFirstNonNullVector(index)
    // returns the first non null vector from index : curve[index + N].subtract(curve[index])
    _getFirstNonNullVector(index) {
        let i = 1;
        let nNVector = this._curve[index + i].subtract(this._curve[index]);
        while (nNVector.length() === 0 && index + i + 1 < this._curve.length) {
            i++;
            nNVector = this._curve[index + i].subtract(this._curve[index]);
        }
        return nNVector;
    }
    // private function getLastNonNullVector(index)
    // returns the last non null vector from index : curve[index].subtract(curve[index - N])
    _getLastNonNullVector(index) {
        let i = 1;
        let nLVector = this._curve[index].subtract(this._curve[index - i]);
        while (nLVector.length() === 0 && index > i + 1) {
            i++;
            nLVector = this._curve[index].subtract(this._curve[index - i]);
        }
        return nLVector;
    }
    // private function normalVector(v0, vt, va) :
    // returns an arbitrary point in the plane defined by the point v0 and the vector vt orthogonal to this plane
    // if va is passed, it returns the va projection on the plane orthogonal to vt at the point v0
    _normalVector(vt, va) {
        let normal0;
        let tgl = vt.length();
        if (tgl === 0.0) {
            tgl = 1.0;
        }
        if (va === undefined || va === null) {
            let point;
            if (!(0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.WithinEpsilon)(Math.abs(vt.y) / tgl, 1.0, _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .bH)) {
                // search for a point in the plane
                point = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(0.0, -1.0, 0.0);
            }
            else if (!(0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.WithinEpsilon)(Math.abs(vt.x) / tgl, 1.0, _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .bH)) {
                point = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(1.0, 0.0, 0.0);
            }
            else if (!(0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.WithinEpsilon)(Math.abs(vt.z) / tgl, 1.0, _math_constants_js__WEBPACK_IMPORTED_MODULE_2__/* .Epsilon */ .bH)) {
                point = new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(0.0, 0.0, 1.0);
            }
            else {
                point = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
            }
            normal0 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(vt, point);
        }
        else {
            normal0 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(vt, va);
            _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CrossToRef(normal0, vt, normal0);
        }
        normal0.normalize();
        return normal0;
    }
    /**
     * Updates the point at data for an interpolated point along this curve
     * @param position the position of the point along this curve, from 0.0 to 1.0
     * @param interpolateTNB
     * @interpolateTNB whether to compute the interpolated tangent, normal and binormal
     * @returns the (updated) point at data
     */
    _updatePointAtData(position, interpolateTNB = false) {
        // set an id for caching the result
        if (this._pointAtData.id === position) {
            if (!this._pointAtData.interpolateReady) {
                this._updateInterpolationMatrix();
            }
            return this._pointAtData;
        }
        else {
            this._pointAtData.id = position;
        }
        const curvePoints = this.getPoints();
        // clamp position between 0.0 and 1.0
        if (position <= 0.0) {
            return this._setPointAtData(0.0, 0.0, curvePoints[0], 0, interpolateTNB);
        }
        else if (position >= 1.0) {
            return this._setPointAtData(1.0, 1.0, curvePoints[curvePoints.length - 1], curvePoints.length - 1, interpolateTNB);
        }
        let previousPoint = curvePoints[0];
        let currentPoint;
        let currentLength = 0.0;
        const targetLength = position * this.length();
        for (let i = 1; i < curvePoints.length; i++) {
            currentPoint = curvePoints[i];
            const distance = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Distance(previousPoint, currentPoint);
            currentLength += distance;
            if (currentLength === targetLength) {
                return this._setPointAtData(position, 1.0, currentPoint, i, interpolateTNB);
            }
            else if (currentLength > targetLength) {
                const toLength = currentLength - targetLength;
                const diff = toLength / distance;
                const dir = previousPoint.subtract(currentPoint);
                const point = currentPoint.add(dir.scaleInPlace(diff));
                return this._setPointAtData(position, 1 - diff, point, i - 1, interpolateTNB);
            }
            previousPoint = currentPoint;
        }
        return this._pointAtData;
    }
    /**
     * Updates the point at data from the specified parameters
     * @param position where along the path the interpolated point is, from 0.0 to 1.0
     * @param subPosition
     * @param point the interpolated point
     * @param parentIndex the index of an existing curve point that is on, or else positionally the first behind, the interpolated point
     * @param interpolateTNB whether to compute the interpolated tangent, normal and binormal
     * @returns the (updated) point at data
     */
    _setPointAtData(position, subPosition, point, parentIndex, interpolateTNB) {
        this._pointAtData.point = point;
        this._pointAtData.position = position;
        this._pointAtData.subPosition = subPosition;
        this._pointAtData.previousPointArrayIndex = parentIndex;
        this._pointAtData.interpolateReady = interpolateTNB;
        if (interpolateTNB) {
            this._updateInterpolationMatrix();
        }
        return this._pointAtData;
    }
    /**
     * Updates the point at interpolation matrix for the tangents, normals and binormals
     */
    _updateInterpolationMatrix() {
        this._pointAtData.interpolationMatrix = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity();
        const parentIndex = this._pointAtData.previousPointArrayIndex;
        if (parentIndex !== this._tangents.length - 1) {
            const index = parentIndex + 1;
            const tangentFrom = this._tangents[parentIndex].clone();
            const normalFrom = this._normals[parentIndex].clone();
            const binormalFrom = this._binormals[parentIndex].clone();
            const tangentTo = this._tangents[index].clone();
            const normalTo = this._normals[index].clone();
            const binormalTo = this._binormals[index].clone();
            const quatFrom = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.RotationQuaternionFromAxis(normalFrom, binormalFrom, tangentFrom);
            const quatTo = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.RotationQuaternionFromAxis(normalTo, binormalTo, tangentTo);
            const quatAt = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Quaternion */ .PT.Slerp(quatFrom, quatTo, this._pointAtData.subPosition);
            quatAt.toRotationMatrix(this._pointAtData.interpolationMatrix);
        }
    }
}
/**
 * A Curve3 object is a logical object, so not a mesh, to handle curves in the 3D geometric space.
 * A Curve3 is designed from a series of successive Vector3.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves
 */
class Curve3 {
    /**
     * Returns a Curve3 object along a Quadratic Bezier curve : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#quadratic-bezier-curve
     * @param v0 (Vector3) the origin point of the Quadratic Bezier
     * @param v1 (Vector3) the control point
     * @param v2 (Vector3) the end point of the Quadratic Bezier
     * @param nbPoints (integer) the wanted number of points in the curve
     * @returns the created Curve3
     */
    static CreateQuadraticBezier(v0, v1, v2, nbPoints) {
        nbPoints = nbPoints > 2 ? nbPoints : 3;
        const bez = [];
        const equation = (t, val0, val1, val2) => {
            const res = (1.0 - t) * (1.0 - t) * val0 + 2.0 * t * (1.0 - t) * val1 + t * t * val2;
            return res;
        };
        for (let i = 0; i <= nbPoints; i++) {
            bez.push(new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(equation(i / nbPoints, v0.x, v1.x, v2.x), equation(i / nbPoints, v0.y, v1.y, v2.y), equation(i / nbPoints, v0.z, v1.z, v2.z)));
        }
        return new Curve3(bez);
    }
    /**
     * Returns a Curve3 object along a Cubic Bezier curve : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#cubic-bezier-curve
     * @param v0 (Vector3) the origin point of the Cubic Bezier
     * @param v1 (Vector3) the first control point
     * @param v2 (Vector3) the second control point
     * @param v3 (Vector3) the end point of the Cubic Bezier
     * @param nbPoints (integer) the wanted number of points in the curve
     * @returns the created Curve3
     */
    static CreateCubicBezier(v0, v1, v2, v3, nbPoints) {
        nbPoints = nbPoints > 3 ? nbPoints : 4;
        const bez = [];
        const equation = (t, val0, val1, val2, val3) => {
            const res = (1.0 - t) * (1.0 - t) * (1.0 - t) * val0 + 3.0 * t * (1.0 - t) * (1.0 - t) * val1 + 3.0 * t * t * (1.0 - t) * val2 + t * t * t * val3;
            return res;
        };
        for (let i = 0; i <= nbPoints; i++) {
            bez.push(new _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(equation(i / nbPoints, v0.x, v1.x, v2.x, v3.x), equation(i / nbPoints, v0.y, v1.y, v2.y, v3.y), equation(i / nbPoints, v0.z, v1.z, v2.z, v3.z)));
        }
        return new Curve3(bez);
    }
    /**
     * Returns a Curve3 object along a Hermite Spline curve : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#hermite-spline
     * @param p1 (Vector3) the origin point of the Hermite Spline
     * @param t1 (Vector3) the tangent vector at the origin point
     * @param p2 (Vector3) the end point of the Hermite Spline
     * @param t2 (Vector3) the tangent vector at the end point
     * @param nSeg (integer) the number of curve segments or nSeg + 1 points in the array
     * @returns the created Curve3
     */
    static CreateHermiteSpline(p1, t1, p2, t2, nSeg) {
        const hermite = [];
        const step = 1.0 / nSeg;
        for (let i = 0; i <= nSeg; i++) {
            hermite.push(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Hermite(p1, t1, p2, t2, i * step));
        }
        return new Curve3(hermite);
    }
    /**
     * Returns a Curve3 object along a CatmullRom Spline curve :
     * @param points (array of Vector3) the points the spline must pass through. At least, four points required
     * @param nbPoints (integer) the wanted number of points between each curve control points
     * @param closed (boolean) optional with default false, when true forms a closed loop from the points
     * @returns the created Curve3
     */
    static CreateCatmullRomSpline(points, nbPoints, closed) {
        const catmullRom = [];
        const step = 1.0 / nbPoints;
        let amount = 0.0;
        if (closed) {
            const pointsCount = points.length;
            for (let i = 0; i < pointsCount; i++) {
                amount = 0;
                for (let c = 0; c < nbPoints; c++) {
                    catmullRom.push(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CatmullRom(points[i % pointsCount], points[(i + 1) % pointsCount], points[(i + 2) % pointsCount], points[(i + 3) % pointsCount], amount));
                    amount += step;
                }
            }
            catmullRom.push(catmullRom[0]);
        }
        else {
            const totalPoints = [];
            totalPoints.push(points[0].clone());
            Array.prototype.push.apply(totalPoints, points);
            totalPoints.push(points[points.length - 1].clone());
            let i = 0;
            for (; i < totalPoints.length - 3; i++) {
                amount = 0;
                for (let c = 0; c < nbPoints; c++) {
                    catmullRom.push(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount));
                    amount += step;
                }
            }
            i--;
            catmullRom.push(_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount));
        }
        return new Curve3(catmullRom);
    }
    /**
     * Returns a Curve3 object along an arc through three vector3 points:
     * The three points should not be colinear. When they are the Curve3 is empty.
     * @param first (Vector3) the first point the arc must pass through.
     * @param second (Vector3) the second point the arc must pass through.
     * @param third (Vector3) the third point the arc must pass through.
     * @param steps (number) the larger the number of steps the more detailed the arc.
     * @param closed (boolean) optional with default false, when true forms the chord from the first and third point
     * @param fullCircle Circle (boolean) optional with default false, when true forms the complete circle through the three points
     * @returns the created Curve3
     */
    static ArcThru3Points(first, second, third, steps = 32, closed = false, fullCircle = false) {
        const arc = [];
        const vec1 = second.subtract(first);
        const vec2 = third.subtract(second);
        const vec3 = first.subtract(third);
        const zAxis = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(vec1, vec2);
        const len4 = zAxis.length();
        if (len4 < Math.pow(10, -8)) {
            return new Curve3(arc); // colinear points arc is empty
        }
        const len1_sq = vec1.lengthSquared();
        const len2_sq = vec2.lengthSquared();
        const len3_sq = vec3.lengthSquared();
        const len4_sq = zAxis.lengthSquared();
        const len1 = vec1.length();
        const len2 = vec2.length();
        const len3 = vec3.length();
        const radius = (0.5 * len1 * len2 * len3) / len4;
        const dot1 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(vec1, vec3);
        const dot2 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(vec1, vec2);
        const dot3 = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Dot(vec2, vec3);
        const a = (-0.5 * len2_sq * dot1) / len4_sq;
        const b = (-0.5 * len3_sq * dot2) / len4_sq;
        const c = (-0.5 * len1_sq * dot3) / len4_sq;
        const center = first.scale(a).add(second.scale(b)).add(third.scale(c));
        const radiusVec = first.subtract(center);
        const xAxis = radiusVec.normalize();
        const yAxis = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(zAxis, xAxis).normalize();
        if (fullCircle) {
            const dStep = (2 * Math.PI) / steps;
            for (let theta = 0; theta <= 2 * Math.PI; theta += dStep) {
                arc.push(center.add(xAxis.scale(radius * Math.cos(theta)).add(yAxis.scale(radius * Math.sin(theta)))));
            }
            arc.push(first);
        }
        else {
            const dStep = 1 / steps;
            let theta = 0;
            let point = _math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
            do {
                point = center.add(xAxis.scale(radius * Math.cos(theta)).add(yAxis.scale(radius * Math.sin(theta))));
                arc.push(point);
                theta += dStep;
            } while (!point.equalsWithEpsilon(third, radius * dStep * 1.1));
            arc.push(third);
            if (closed) {
                arc.push(first);
            }
        }
        return new Curve3(arc);
    }
    /**
     * A Curve3 object is a logical object, so not a mesh, to handle curves in the 3D geometric space.
     * A Curve3 is designed from a series of successive Vector3.
     * Tuto : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#curve3-object
     * @param points points which make up the curve
     */
    constructor(points) {
        this._length = 0.0;
        this._points = points;
        this._length = this._computeLength(points);
    }
    /**
     * @returns the Curve3 stored array of successive Vector3
     */
    getPoints() {
        return this._points;
    }
    /**
     * @returns the computed length (float) of the curve.
     */
    length() {
        return this._length;
    }
    /**
     * Returns a new instance of Curve3 object : var curve = curveA.continue(curveB);
     * This new Curve3 is built by translating and sticking the curveB at the end of the curveA.
     * curveA and curveB keep unchanged.
     * @param curve the curve to continue from this curve
     * @returns the newly constructed curve
     */
    continue(curve) {
        const lastPoint = this._points[this._points.length - 1];
        const continuedPoints = this._points.slice();
        const curvePoints = curve.getPoints();
        for (let i = 1; i < curvePoints.length; i++) {
            continuedPoints.push(curvePoints[i].subtract(curvePoints[0]).add(lastPoint));
        }
        const continuedCurve = new Curve3(continuedPoints);
        return continuedCurve;
    }
    _computeLength(path) {
        let l = 0;
        for (let i = 1; i < path.length; i++) {
            l += path[i].subtract(path[i - 1]).length();
        }
        return l;
    }
}
//# sourceMappingURL=math.path.js.map

/***/ }),

/***/ 94100:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (/* binding */ Plane)
/* harmony export */ });
/* harmony import */ var _math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);

/**
 * Represents a plane by the equation ax + by + cz + d = 0
 */
class Plane {
    /**
     * Creates a Plane object according to the given floats a, b, c, d and the plane equation : ax + by + cz + d = 0
     * @param a a component of the plane
     * @param b b component of the plane
     * @param c c component of the plane
     * @param d d component of the plane
     */
    constructor(a, b, c, d) {
        this.normal = new _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(a, b, c);
        this.d = d;
    }
    /**
     * @returns the plane coordinates as a new array of 4 elements [a, b, c, d].
     */
    asArray() {
        return [this.normal.x, this.normal.y, this.normal.z, this.d];
    }
    // Methods
    /**
     * @returns a new plane copied from the current Plane.
     */
    clone() {
        return new Plane(this.normal.x, this.normal.y, this.normal.z, this.d);
    }
    /**
     * @returns the string "Plane".
     */
    getClassName() {
        return "Plane";
    }
    /**
     * @returns the Plane hash code.
     */
    getHashCode() {
        let hash = this.normal.getHashCode();
        hash = (hash * 397) ^ (this.d | 0);
        return hash;
    }
    /**
     * Normalize the current Plane in place.
     * @returns the updated Plane.
     */
    normalize() {
        const norm = Math.sqrt(this.normal.x * this.normal.x + this.normal.y * this.normal.y + this.normal.z * this.normal.z);
        let magnitude = 0.0;
        if (norm !== 0) {
            magnitude = 1.0 / norm;
        }
        this.normal.x *= magnitude;
        this.normal.y *= magnitude;
        this.normal.z *= magnitude;
        this.d *= magnitude;
        return this;
    }
    /**
     * Applies a transformation the plane and returns the result
     * @param transformation the transformation matrix to be applied to the plane
     * @returns a new Plane as the result of the transformation of the current Plane by the given matrix.
     */
    transform(transformation) {
        const invertedMatrix = Plane._TmpMatrix;
        transformation.invertToRef(invertedMatrix);
        const m = invertedMatrix.m;
        const x = this.normal.x;
        const y = this.normal.y;
        const z = this.normal.z;
        const d = this.d;
        const normalX = x * m[0] + y * m[1] + z * m[2] + d * m[3];
        const normalY = x * m[4] + y * m[5] + z * m[6] + d * m[7];
        const normalZ = x * m[8] + y * m[9] + z * m[10] + d * m[11];
        const finalD = x * m[12] + y * m[13] + z * m[14] + d * m[15];
        return new Plane(normalX, normalY, normalZ, finalD);
    }
    /**
     * Compute the dot product between the point and the plane normal
     * @param point point to calculate the dot product with
     * @returns the dot product (float) of the point coordinates and the plane normal.
     */
    dotCoordinate(point) {
        return this.normal.x * point.x + this.normal.y * point.y + this.normal.z * point.z + this.d;
    }
    /**
     * Updates the current Plane from the plane defined by the three given points.
     * @param point1 one of the points used to construct the plane
     * @param point2 one of the points used to construct the plane
     * @param point3 one of the points used to construct the plane
     * @returns the updated Plane.
     */
    copyFromPoints(point1, point2, point3) {
        const x1 = point2.x - point1.x;
        const y1 = point2.y - point1.y;
        const z1 = point2.z - point1.z;
        const x2 = point3.x - point1.x;
        const y2 = point3.y - point1.y;
        const z2 = point3.z - point1.z;
        const yz = y1 * z2 - z1 * y2;
        const xz = z1 * x2 - x1 * z2;
        const xy = x1 * y2 - y1 * x2;
        const pyth = Math.sqrt(yz * yz + xz * xz + xy * xy);
        let invPyth;
        if (pyth !== 0) {
            invPyth = 1.0 / pyth;
        }
        else {
            invPyth = 0.0;
        }
        this.normal.x = yz * invPyth;
        this.normal.y = xz * invPyth;
        this.normal.z = xy * invPyth;
        this.d = -(this.normal.x * point1.x + this.normal.y * point1.y + this.normal.z * point1.z);
        return this;
    }
    /**
     * Checks if the plane is facing a given direction (meaning if the plane's normal is pointing in the opposite direction of the given vector).
     * Note that for this function to work as expected you should make sure that:
     *   - direction and the plane normal are normalized
     *   - epsilon is a number just bigger than -1, something like -0.99 for eg
     * @param direction the direction to check if the plane is facing
     * @param epsilon value the dot product is compared against (returns true if dot <= epsilon)
     * @returns True if the plane is facing the given direction
     */
    isFrontFacingTo(direction, epsilon) {
        const dot = _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Dot(this.normal, direction);
        return dot <= epsilon;
    }
    /**
     * Calculates the distance to a point
     * @param point point to calculate distance to
     * @returns the signed distance (float) from the given point to the Plane.
     */
    signedDistanceTo(point) {
        return _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Dot(point, this.normal) + this.d;
    }
    // Statics
    /**
     * Creates a plane from an  array
     * @param array the array to create a plane from
     * @returns a new Plane from the given array.
     */
    static FromArray(array) {
        return new Plane(array[0], array[1], array[2], array[3]);
    }
    /**
     * Creates a plane from three points
     * @param point1 point used to create the plane
     * @param point2 point used to create the plane
     * @param point3 point used to create the plane
     * @returns a new Plane defined by the three given points.
     */
    static FromPoints(point1, point2, point3) {
        const result = new Plane(0.0, 0.0, 0.0, 0.0);
        result.copyFromPoints(point1, point2, point3);
        return result;
    }
    /**
     * Creates a plane from an origin point and a normal
     * @param origin origin of the plane to be constructed
     * @param normal normal of the plane to be constructed
     * @returns a new Plane the normal vector to this plane at the given origin point.
     */
    static FromPositionAndNormal(origin, normal) {
        const plane = new Plane(0.0, 0.0, 0.0, 0.0);
        return this.FromPositionAndNormalToRef(origin, normal, plane);
    }
    /**
     * Updates the given Plane "result" from an origin point and a normal.
     * @param origin origin of the plane to be constructed
     * @param normal the normalized normals of the plane to be constructed
     * @param result defines the Plane where to store the result
     * @returns result input
     */
    static FromPositionAndNormalToRef(origin, normal, result) {
        result.normal.copyFrom(normal);
        result.normal.normalize();
        result.d = -origin.dot(result.normal);
        return result;
    }
    /**
     * Calculates the distance from a plane and a point
     * @param origin origin of the plane to be constructed
     * @param normal normal of the plane to be constructed
     * @param point point to calculate distance to
     * @returns the signed distance between the plane defined by the normal vector at the "origin"" point and the given other point.
     */
    static SignedDistanceToPlaneFromPositionAndNormal(origin, normal, point) {
        const d = -(normal.x * origin.x + normal.y * origin.y + normal.z * origin.z);
        return _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Dot(point, normal) + d;
    }
}
Plane._TmpMatrix = _math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.Identity();
//# sourceMappingURL=math.plane.js.map

/***/ }),

/***/ 84867:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Clamp: () => (/* binding */ Clamp),
/* harmony export */   DeltaAngle: () => (/* binding */ DeltaAngle),
/* harmony export */   Denormalize: () => (/* binding */ Denormalize),
/* harmony export */   ExtractAsInt: () => (/* binding */ ExtractAsInt),
/* harmony export */   Hermite: () => (/* binding */ Hermite),
/* harmony export */   Hermite1stDerivative: () => (/* binding */ Hermite1stDerivative),
/* harmony export */   HighestCommonFactor: () => (/* binding */ HighestCommonFactor),
/* harmony export */   ILog2: () => (/* binding */ ILog2),
/* harmony export */   InverseLerp: () => (/* binding */ InverseLerp),
/* harmony export */   Lerp: () => (/* binding */ Lerp),
/* harmony export */   LerpAngle: () => (/* binding */ LerpAngle),
/* harmony export */   MoveTowards: () => (/* binding */ MoveTowards),
/* harmony export */   MoveTowardsAngle: () => (/* binding */ MoveTowardsAngle),
/* harmony export */   Normalize: () => (/* binding */ Normalize),
/* harmony export */   NormalizeRadians: () => (/* binding */ NormalizeRadians),
/* harmony export */   PercentToRange: () => (/* binding */ PercentToRange),
/* harmony export */   PingPong: () => (/* binding */ PingPong),
/* harmony export */   RandomRange: () => (/* binding */ RandomRange),
/* harmony export */   RangeToPercent: () => (/* binding */ RangeToPercent),
/* harmony export */   Repeat: () => (/* binding */ Repeat),
/* harmony export */   SmoothStep: () => (/* binding */ SmoothStep),
/* harmony export */   ToHex: () => (/* binding */ ToHex),
/* harmony export */   WithinEpsilon: () => (/* binding */ WithinEpsilon)
/* harmony export */ });
/**
 * Extract int value
 * @param value number value
 * @returns int value
 */
function ExtractAsInt(value) {
    return parseInt(value.toString().replace(/\W/g, ""));
}
/**
 * Boolean : true if the absolute difference between a and b is lower than epsilon (default = 1.401298E-45)
 * @param a number
 * @param b number
 * @param epsilon (default = 1.401298E-45)
 * @returns true if the absolute difference between a and b is lower than epsilon (default = 1.401298E-45)
 */
function WithinEpsilon(a, b, epsilon = 1.401298e-45) {
    return Math.abs(a - b) <= epsilon;
}
/**
 * Returns a random float number between and min and max values
 * @param min min value of random
 * @param max max value of random
 * @returns random value
 */
function RandomRange(min, max) {
    if (min === max) {
        return min;
    }
    return Math.random() * (max - min) + min;
}
/**
 * Creates a new scalar with values linearly interpolated of "amount" between the start scalar and the end scalar.
 * @param start start value
 * @param end target value
 * @param amount amount to lerp between
 * @returns the lerped value
 */
function Lerp(start, end, amount) {
    return start + (end - start) * amount;
}
/**
 * Same as Lerp but makes sure the values interpolate correctly when they wrap around 360 degrees.
 * The parameter t is clamped to the range [0, 1]. Variables a and b are assumed to be in degrees.
 * @param start start value
 * @param end target value
 * @param amount amount to lerp between
 * @returns the lerped value
 */
function LerpAngle(start, end, amount) {
    let num = Repeat(end - start, 360.0);
    if (num > 180.0) {
        num -= 360.0;
    }
    return start + num * Clamp(amount);
}
/**
 * Calculates the linear parameter t that produces the interpolant value within the range [a, b].
 * @param a start value
 * @param b target value
 * @param value value between a and b
 * @returns the inverseLerp value
 */
function InverseLerp(a, b, value) {
    let result = 0;
    if (a != b) {
        result = Clamp((value - a) / (b - a));
    }
    else {
        result = 0.0;
    }
    return result;
}
/**
 * Returns a new scalar located for "amount" (float) on the Hermite spline defined by the scalars "value1", "value3", "tangent1", "tangent2".
 * @see http://mathworld.wolfram.com/HermitePolynomial.html
 * @param value1 defines the first control point
 * @param tangent1 defines the first tangent
 * @param value2 defines the second control point
 * @param tangent2 defines the second tangent
 * @param amount defines the amount on the interpolation spline (between 0 and 1)
 * @returns hermite result
 */
function Hermite(value1, tangent1, value2, tangent2, amount) {
    const squared = amount * amount;
    const cubed = amount * squared;
    const part1 = 2.0 * cubed - 3.0 * squared + 1.0;
    const part2 = -2.0 * cubed + 3.0 * squared;
    const part3 = cubed - 2.0 * squared + amount;
    const part4 = cubed - squared;
    return value1 * part1 + value2 * part2 + tangent1 * part3 + tangent2 * part4;
}
/**
 * Returns a new scalar which is the 1st derivative of the Hermite spline defined by the scalars "value1", "value2", "tangent1", "tangent2".
 * @param value1 defines the first control point
 * @param tangent1 defines the first tangent
 * @param value2 defines the second control point
 * @param tangent2 defines the second tangent
 * @param time define where the derivative must be done
 * @returns 1st derivative
 */
function Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {
    const t2 = time * time;
    return (t2 - time) * 6 * value1 + (3 * t2 - 4 * time + 1) * tangent1 + (-t2 + time) * 6 * value2 + (3 * t2 - 2 * time) * tangent2;
}
/**
 * Returns the value itself if it's between min and max.
 * Returns min if the value is lower than min.
 * Returns max if the value is greater than max.
 * @param value the value to clmap
 * @param min the min value to clamp to (default: 0)
 * @param max the max value to clamp to (default: 1)
 * @returns the clamped value
 */
function Clamp(value, min = 0, max = 1) {
    return Math.min(max, Math.max(min, value));
}
/**
 * Returns the angle converted to equivalent value between -Math.PI and Math.PI radians.
 * @param angle The angle to normalize in radian.
 * @returns The converted angle.
 */
function NormalizeRadians(angle) {
    // More precise but slower version kept for reference.
    // angle = angle % Tools.TwoPi;
    // angle = (angle + Tools.TwoPi) % Tools.TwoPi;
    //if (angle > Math.PI) {
    //	angle -= Tools.TwoPi;
    //}
    angle -= Math.PI * 2 * Math.floor((angle + Math.PI) / (Math.PI * 2));
    return angle;
}
/**
 * Returns a string : the upper case translation of the number i to hexadecimal.
 * @param i number
 * @returns the upper case translation of the number i to hexadecimal.
 */
function ToHex(i) {
    const str = i.toString(16);
    if (i <= 15) {
        return ("0" + str).toUpperCase();
    }
    return str.toUpperCase();
}
/**
 * the floor part of a log2 value.
 * @param value the value to compute log2 of
 * @returns the log2 of value.
 */
function ILog2(value) {
    if (Math.log2) {
        return Math.floor(Math.log2(value));
    }
    if (value < 0) {
        return NaN;
    }
    else if (value === 0) {
        return -Infinity;
    }
    let n = 0;
    if (value < 1) {
        while (value < 1) {
            n++;
            value = value * 2;
        }
        n = -n;
    }
    else if (value > 1) {
        while (value > 1) {
            n++;
            value = Math.floor(value / 2);
        }
    }
    return n;
}
/**
 * Loops the value, so that it is never larger than length and never smaller than 0.
 *
 * This is similar to the modulo operator but it works with floating point numbers.
 * For example, using 3.0 for t and 2.5 for length, the result would be 0.5.
 * With t = 5 and length = 2.5, the result would be 0.0.
 * Note, however, that the behaviour is not defined for negative numbers as it is for the modulo operator
 * @param value the value
 * @param length the length
 * @returns the looped value
 */
function Repeat(value, length) {
    return value - Math.floor(value / length) * length;
}
/**
 * Normalize the value between 0.0 and 1.0 using min and max values
 * @param value value to normalize
 * @param min max to normalize between
 * @param max min to normalize between
 * @returns the normalized value
 */
function Normalize(value, min, max) {
    return (value - min) / (max - min);
}
/**
 * Denormalize the value from 0.0 and 1.0 using min and max values
 * @param normalized value to denormalize
 * @param min max to denormalize between
 * @param max min to denormalize between
 * @returns the denormalized value
 */
function Denormalize(normalized, min, max) {
    return normalized * (max - min) + min;
}
/**
 * Calculates the shortest difference between two given angles given in degrees.
 * @param current current angle in degrees
 * @param target target angle in degrees
 * @returns the delta
 */
function DeltaAngle(current, target) {
    let num = Repeat(target - current, 360.0);
    if (num > 180.0) {
        num -= 360.0;
    }
    return num;
}
/**
 * PingPongs the value t, so that it is never larger than length and never smaller than 0.
 * @param tx value
 * @param length length
 * @returns The returned value will move back and forth between 0 and length
 */
function PingPong(tx, length) {
    const t = Repeat(tx, length * 2.0);
    return length - Math.abs(t - length);
}
/**
 * Interpolates between min and max with smoothing at the limits.
 *
 * This function interpolates between min and max in a similar way to Lerp. However, the interpolation will gradually speed up
 * from the start and slow down toward the end. This is useful for creating natural-looking animation, fading and other transitions.
 * @param from from
 * @param to to
 * @param tx value
 * @returns the smooth stepped value
 */
function SmoothStep(from, to, tx) {
    let t = Clamp(tx);
    t = -2.0 * t * t * t + 3.0 * t * t;
    return to * t + from * (1.0 - t);
}
/**
 * Moves a value current towards target.
 *
 * This is essentially the same as Mathf.Lerp but instead the function will ensure that the speed never exceeds maxDelta.
 * Negative values of maxDelta pushes the value away from target.
 * @param current current value
 * @param target target value
 * @param maxDelta max distance to move
 * @returns resulting value
 */
function MoveTowards(current, target, maxDelta) {
    let result = 0;
    if (Math.abs(target - current) <= maxDelta) {
        result = target;
    }
    else {
        result = current + Math.sign(target - current) * maxDelta;
    }
    return result;
}
/**
 * Same as MoveTowards but makes sure the values interpolate correctly when they wrap around 360 degrees.
 *
 * Variables current and target are assumed to be in degrees. For optimization reasons, negative values of maxDelta
 *  are not supported and may cause oscillation. To push current away from a target angle, add 180 to that angle instead.
 * @param current current value
 * @param target target value
 * @param maxDelta max distance to move
 * @returns resulting angle
 */
function MoveTowardsAngle(current, target, maxDelta) {
    const num = DeltaAngle(current, target);
    let result = 0;
    if (-maxDelta < num && num < maxDelta) {
        result = target;
    }
    else {
        target = current + num;
        result = MoveTowards(current, target, maxDelta);
    }
    return result;
}
/**
 * This function returns percentage of a number in a given range.
 *
 * RangeToPercent(40,20,60) will return 0.5 (50%)
 * RangeToPercent(34,0,100) will return 0.34 (34%)
 * @param number to convert to percentage
 * @param min min range
 * @param max max range
 * @returns the percentage
 */
function RangeToPercent(number, min, max) {
    return (number - min) / (max - min);
}
/**
 * This function returns number that corresponds to the percentage in a given range.
 *
 * PercentToRange(0.34,0,100) will return 34.
 * @param percent to convert to number
 * @param min min range
 * @param max max range
 * @returns the number
 */
function PercentToRange(percent, min, max) {
    return (max - min) * percent + min;
}
/**
 * Returns the highest common factor of two integers.
 * @param a first parameter
 * @param b second parameter
 * @returns HCF of a and b
 */
function HighestCommonFactor(a, b) {
    const r = a % b;
    if (r === 0) {
        return b;
    }
    return HighestCommonFactor(b, r);
}
//# sourceMappingURL=math.scalar.functions.js.map

/***/ }),

/***/ 62128:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   X: () => (/* binding */ Scalar)
/* harmony export */ });
/* harmony import */ var _math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84867);

const HCF = _math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.HighestCommonFactor;
/**
 * Scalar computation library
 * @deprecated Please use the scalar functions
 */
/* eslint-disable @typescript-eslint/naming-convention */
const Scalar = {
    ..._math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__,
    /**
     * Two pi constants convenient for computation.
     */
    TwoPi: Math.PI * 2,
    /**
     * Returns -1 if value is negative and +1 is value is positive.
     * @param value the value
     * @returns the value itself if it's equal to zero.
     */
    Sign: Math.sign,
    /**
     * the log2 of value.
     * @param value the value to compute log2 of
     * @returns the log2 of value.
     */
    Log2: Math.log2,
    /**
     * Returns the highest common factor of two integers.
     * @param a first parameter
     * @param b second parameter
     * @returns HCF of a and b
     */
    HCF,
};
/* eslint-enable @typescript-eslint/naming-convention */
//# sourceMappingURL=math.scalar.js.map

/***/ }),

/***/ 70521:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   o: () => (/* binding */ Size)
/* harmony export */ });
/**
 * Size containing width and height
 */
class Size {
    /**
     * Creates a Size object from the given width and height (floats).
     * @param width width of the new size
     * @param height height of the new size
     */
    constructor(width, height) {
        this.width = width;
        this.height = height;
    }
    /**
     * Returns a string with the Size width and height
     * @returns a string with the Size width and height
     */
    toString() {
        return `{W: ${this.width}, H: ${this.height}}`;
    }
    /**
     * "Size"
     * @returns the string "Size"
     */
    getClassName() {
        return "Size";
    }
    /**
     * Returns the Size hash code.
     * @returns a hash code for a unique width and height
     */
    getHashCode() {
        let hash = this.width | 0;
        hash = (hash * 397) ^ (this.height | 0);
        return hash;
    }
    /**
     * Updates the current size from the given one.
     * @param src the given size
     */
    copyFrom(src) {
        this.width = src.width;
        this.height = src.height;
    }
    /**
     * Updates in place the current Size from the given floats.
     * @param width width of the new size
     * @param height height of the new size
     * @returns the updated Size.
     */
    copyFromFloats(width, height) {
        this.width = width;
        this.height = height;
        return this;
    }
    /**
     * Updates in place the current Size from the given floats.
     * @param width width to set
     * @param height height to set
     * @returns the updated Size.
     */
    set(width, height) {
        return this.copyFromFloats(width, height);
    }
    /**
     * Multiplies the width and height by numbers
     * @param w factor to multiple the width by
     * @param h factor to multiple the height by
     * @returns a new Size set with the multiplication result of the current Size and the given floats.
     */
    multiplyByFloats(w, h) {
        return new Size(this.width * w, this.height * h);
    }
    /**
     * Clones the size
     * @returns a new Size copied from the given one.
     */
    clone() {
        return new Size(this.width, this.height);
    }
    /**
     * True if the current Size and the given one width and height are strictly equal.
     * @param other the other size to compare against
     * @returns True if the current Size and the given one width and height are strictly equal.
     */
    equals(other) {
        if (!other) {
            return false;
        }
        return this.width === other.width && this.height === other.height;
    }
    /**
     * The surface of the Size : width * height (float).
     */
    get surface() {
        return this.width * this.height;
    }
    /**
     * Create a new size of zero
     * @returns a new Size set to (0.0, 0.0)
     */
    static Zero() {
        return new Size(0.0, 0.0);
    }
    /**
     * Sums the width and height of two sizes
     * @param otherSize size to add to this size
     * @returns a new Size set as the addition result of the current Size and the given one.
     */
    add(otherSize) {
        const r = new Size(this.width + otherSize.width, this.height + otherSize.height);
        return r;
    }
    /**
     * Subtracts the width and height of two
     * @param otherSize size to subtract to this size
     * @returns a new Size set as the subtraction result of  the given one from the current Size.
     */
    subtract(otherSize) {
        const r = new Size(this.width - otherSize.width, this.height - otherSize.height);
        return r;
    }
    /**
     * Scales the width and height
     * @param scale the scale to multiply the width and height by
     * @returns a new Size set with the multiplication result of the current Size and the given floats.
     */
    scale(scale) {
        return new Size(this.width * scale, this.height * scale);
    }
    /**
     * Creates a new Size set at the linear interpolation "amount" between "start" and "end"
     * @param start starting size to lerp between
     * @param end end size to lerp between
     * @param amount amount to lerp between the start and end values
     * @returns a new Size set at the linear interpolation "amount" between "start" and "end"
     */
    static Lerp(start, end, amount) {
        const w = start.width + (end.width - start.width) * amount;
        const h = start.height + (end.height - start.height) * amount;
        return new Size(w, h);
    }
}
//# sourceMappingURL=math.size.js.map

/***/ }),

/***/ 79923:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AA: () => (/* binding */ TmpVectors),
/* harmony export */   I9: () => (/* binding */ Vector2),
/* harmony export */   IU: () => (/* binding */ Vector4),
/* harmony export */   PT: () => (/* binding */ Quaternion),
/* harmony export */   Pq: () => (/* binding */ Vector3),
/* harmony export */   uq: () => (/* binding */ Matrix)
/* harmony export */ });
/* harmony import */ var _math_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65559);
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27309);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56552);
/* harmony import */ var _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20215);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6315);
/* harmony import */ var _math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84867);
/* eslint-disable @typescript-eslint/naming-convention */






// eslint-disable-next-line @typescript-eslint/naming-convention
const _ExtractAsInt = (value) => {
    return parseInt(value.toString().replace(/\W/g, ""));
};
/**
 * Class representing a vector containing 2 coordinates
 * Example Playground - Overview -  https://playground.babylonjs.com/#QYBWV4#9
 */
class Vector2 {
    /**
     * Creates a new Vector2 from the given x and y coordinates
     * @param x defines the first coordinate
     * @param y defines the second coordinate
     */
    constructor(
    /** [0] defines the first coordinate */
    x = 0, 
    /** [0] defines the second coordinate */
    y = 0) {
        this.x = x;
        this.y = y;
    }
    /**
     * Gets a string with the Vector2 coordinates
     * @returns a string with the Vector2 coordinates
     */
    toString() {
        return `{X: ${this.x} Y: ${this.y}}`;
    }
    /**
     * Gets class name
     * @returns the string "Vector2"
     */
    getClassName() {
        return "Vector2";
    }
    /**
     * Gets current vector hash code
     * @returns the Vector2 hash code as a number
     */
    getHashCode() {
        const x = _ExtractAsInt(this.x);
        const y = _ExtractAsInt(this.y);
        let hash = x;
        hash = (hash * 397) ^ y;
        return hash;
    }
    // Operators
    /**
     * Sets the Vector2 coordinates in the given array or Float32Array from the given index.
     * Example Playground https://playground.babylonjs.com/#QYBWV4#15
     * @param array defines the source array
     * @param index defines the offset in source array
     * @returns the current Vector2
     */
    toArray(array, index = 0) {
        array[index] = this.x;
        array[index + 1] = this.y;
        return this;
    }
    /**
     * Update the current vector from an array
     * Example Playground https://playground.babylonjs.com/#QYBWV4#39
     * @param array defines the destination array
     * @param offset defines the offset in the destination array
     * @returns the current Vector2
     */
    fromArray(array, offset = 0) {
        Vector2.FromArrayToRef(array, offset, this);
        return this;
    }
    /**
     * Copy the current vector to an array
     * Example Playground https://playground.babylonjs.com/#QYBWV4#40
     * @returns a new array with 2 elements: the Vector2 coordinates.
     */
    asArray() {
        return [this.x, this.y];
    }
    /**
     * Sets the Vector2 coordinates with the given Vector2 coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#24
     * @param source defines the source Vector2
     * @returns the current updated Vector2
     */
    copyFrom(source) {
        this.x = source.x;
        this.y = source.y;
        return this;
    }
    /**
     * Sets the Vector2 coordinates with the given floats
     * Example Playground https://playground.babylonjs.com/#QYBWV4#25
     * @param x defines the first coordinate
     * @param y defines the second coordinate
     * @returns the current updated Vector2
     */
    copyFromFloats(x, y) {
        this.x = x;
        this.y = y;
        return this;
    }
    /**
     * Sets the Vector2 coordinates with the given floats
     * Example Playground https://playground.babylonjs.com/#QYBWV4#62
     * @param x defines the first coordinate
     * @param y defines the second coordinate
     * @returns the current updated Vector2
     */
    set(x, y) {
        return this.copyFromFloats(x, y);
    }
    /**
     * Copies the given float to the current Vector2 coordinates
     * @param v defines the x and y coordinates of the operand
     * @returns the current updated Vector2
     */
    setAll(v) {
        return this.copyFromFloats(v, v);
    }
    /**
     * Add another vector with the current one
     * Example Playground https://playground.babylonjs.com/#QYBWV4#11
     * @param otherVector defines the other vector
     * @returns a new Vector2 set with the addition of the current Vector2 and the given one coordinates
     */
    add(otherVector) {
        return new Vector2(this.x + otherVector.x, this.y + otherVector.y);
    }
    /**
     * Sets the "result" coordinates with the addition of the current Vector2 and the given one coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#12
     * @param otherVector defines the other vector
     * @param result defines the target vector
     * @returns result input
     */
    addToRef(otherVector, result) {
        result.x = this.x + otherVector.x;
        result.y = this.y + otherVector.y;
        return result;
    }
    /**
     * Set the Vector2 coordinates by adding the given Vector2 coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#13
     * @param otherVector defines the other vector
     * @returns the current updated Vector2
     */
    addInPlace(otherVector) {
        this.x += otherVector.x;
        this.y += otherVector.y;
        return this;
    }
    /**
     * Adds the given coordinates to the current Vector2
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @returns the current updated Vector2
     */
    addInPlaceFromFloats(x, y) {
        this.x += x;
        this.y += y;
        return this;
    }
    /**
     * Gets a new Vector2 by adding the current Vector2 coordinates to the given Vector3 x, y coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#14
     * @param otherVector defines the other vector
     * @returns a new Vector2
     */
    addVector3(otherVector) {
        return new Vector2(this.x + otherVector.x, this.y + otherVector.y);
    }
    /**
     * Gets a new Vector2 set with the subtracted coordinates of the given one from the current Vector2
     * Example Playground https://playground.babylonjs.com/#QYBWV4#61
     * @param otherVector defines the other vector
     * @returns a new Vector2
     */
    subtract(otherVector) {
        return new Vector2(this.x - otherVector.x, this.y - otherVector.y);
    }
    /**
     * Sets the "result" coordinates with the subtraction of the given one from the current Vector2 coordinates.
     * Example Playground https://playground.babylonjs.com/#QYBWV4#63
     * @param otherVector defines the other vector
     * @param result defines the target vector
     * @returns result input
     */
    subtractToRef(otherVector, result) {
        result.x = this.x - otherVector.x;
        result.y = this.y - otherVector.y;
        return result;
    }
    /**
     * Sets the current Vector2 coordinates by subtracting from it the given one coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#88
     * @param otherVector defines the other vector
     * @returns the current updated Vector2
     */
    subtractInPlace(otherVector) {
        this.x -= otherVector.x;
        this.y -= otherVector.y;
        return this;
    }
    /**
     * Multiplies in place the current Vector2 coordinates by the given ones
     * Example Playground https://playground.babylonjs.com/#QYBWV4#43
     * @param otherVector defines the other vector
     * @returns the current updated Vector2
     */
    multiplyInPlace(otherVector) {
        this.x *= otherVector.x;
        this.y *= otherVector.y;
        return this;
    }
    /**
     * Returns a new Vector2 set with the multiplication of the current Vector2 and the given one coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#42
     * @param otherVector defines the other vector
     * @returns a new Vector2
     */
    multiply(otherVector) {
        return new Vector2(this.x * otherVector.x, this.y * otherVector.y);
    }
    /**
     * Sets "result" coordinates with the multiplication of the current Vector2 and the given one coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#44
     * @param otherVector defines the other vector
     * @param result defines the target vector
     * @returns result input
     */
    multiplyToRef(otherVector, result) {
        result.x = this.x * otherVector.x;
        result.y = this.y * otherVector.y;
        return result;
    }
    /**
     * Gets a new Vector2 set with the Vector2 coordinates multiplied by the given floats
     * Example Playground https://playground.babylonjs.com/#QYBWV4#89
     * @param x defines the first coordinate
     * @param y defines the second coordinate
     * @returns a new Vector2
     */
    multiplyByFloats(x, y) {
        return new Vector2(this.x * x, this.y * y);
    }
    /**
     * Returns a new Vector2 set with the Vector2 coordinates divided by the given one coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#27
     * @param otherVector defines the other vector
     * @returns a new Vector2
     */
    divide(otherVector) {
        return new Vector2(this.x / otherVector.x, this.y / otherVector.y);
    }
    /**
     * Sets the "result" coordinates with the Vector2 divided by the given one coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#30
     * @param otherVector defines the other vector
     * @param result defines the target vector
     * @returns result input
     */
    divideToRef(otherVector, result) {
        result.x = this.x / otherVector.x;
        result.y = this.y / otherVector.y;
        return result;
    }
    /**
     * Divides the current Vector2 coordinates by the given ones
     * Example Playground https://playground.babylonjs.com/#QYBWV4#28
     * @param otherVector defines the other vector
     * @returns the current updated Vector2
     */
    divideInPlace(otherVector) {
        this.x = this.x / otherVector.x;
        this.y = this.y / otherVector.y;
        return this;
    }
    /**
     * Updates the current Vector2 with the minimal coordinate values between its and the given vector ones
     * @param other defines the second operand
     * @returns the current updated Vector2
     */
    minimizeInPlace(other) {
        return this.minimizeInPlaceFromFloats(other.x, other.y);
    }
    /**
     * Updates the current Vector2 with the maximal coordinate values between its and the given vector ones.
     * @param other defines the second operand
     * @returns the current updated Vector2
     */
    maximizeInPlace(other) {
        return this.maximizeInPlaceFromFloats(other.x, other.y);
    }
    /**
     * Updates the current Vector2 with the minimal coordinate values between its and the given coordinates
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @returns the current updated Vector2
     */
    minimizeInPlaceFromFloats(x, y) {
        this.x = Math.min(x, this.x);
        this.y = Math.min(y, this.y);
        return this;
    }
    /**
     * Updates the current Vector2 with the maximal coordinate values between its and the given coordinates.
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @returns the current updated Vector2
     */
    maximizeInPlaceFromFloats(x, y) {
        this.x = Math.max(x, this.x);
        this.y = Math.max(y, this.y);
        return this;
    }
    /**
     * Returns a new Vector2 set with the subtraction of the given floats from the current Vector2 coordinates
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @returns the resulting Vector2
     */
    subtractFromFloats(x, y) {
        return new Vector2(this.x - x, this.y - y);
    }
    /**
     * Subtracts the given floats from the current Vector2 coordinates and set the given vector "result" with this result
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param result defines the Vector2 object where to store the result
     * @returns the result
     */
    subtractFromFloatsToRef(x, y, result) {
        result.x = this.x - x;
        result.y = this.y - y;
        return result;
    }
    /**
     * Gets a new Vector2 with current Vector2 negated coordinates
     * @returns a new Vector2
     */
    negate() {
        return new Vector2(-this.x, -this.y);
    }
    /**
     * Negate this vector in place
     * Example Playground https://playground.babylonjs.com/#QYBWV4#23
     * @returns this
     */
    negateInPlace() {
        this.x *= -1;
        this.y *= -1;
        return this;
    }
    /**
     * Negate the current Vector2 and stores the result in the given vector "result" coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#41
     * @param result defines the Vector3 object where to store the result
     * @returns the result
     */
    negateToRef(result) {
        result.x = -this.x;
        result.y = -this.y;
        return result;
    }
    /**
     * Multiply the Vector2 coordinates by
     * Example Playground https://playground.babylonjs.com/#QYBWV4#59
     * @param scale defines the scaling factor
     * @returns the current updated Vector2
     */
    scaleInPlace(scale) {
        this.x *= scale;
        this.y *= scale;
        return this;
    }
    /**
     * Returns a new Vector2 scaled by "scale" from the current Vector2
     * Example Playground https://playground.babylonjs.com/#QYBWV4#52
     * @param scale defines the scaling factor
     * @returns a new Vector2
     */
    scale(scale) {
        return new Vector2(this.x * scale, this.y * scale);
    }
    /**
     * Scale the current Vector2 values by a factor to a given Vector2
     * Example Playground https://playground.babylonjs.com/#QYBWV4#57
     * @param scale defines the scale factor
     * @param result defines the Vector2 object where to store the result
     * @returns result input
     */
    scaleToRef(scale, result) {
        result.x = this.x * scale;
        result.y = this.y * scale;
        return result;
    }
    /**
     * Scale the current Vector2 values by a factor and add the result to a given Vector2
     * Example Playground https://playground.babylonjs.com/#QYBWV4#58
     * @param scale defines the scale factor
     * @param result defines the Vector2 object where to store the result
     * @returns result input
     */
    scaleAndAddToRef(scale, result) {
        result.x += this.x * scale;
        result.y += this.y * scale;
        return result;
    }
    /**
     * Gets a boolean if two vectors are equals
     * Example Playground https://playground.babylonjs.com/#QYBWV4#31
     * @param otherVector defines the other vector
     * @returns true if the given vector coordinates strictly equal the current Vector2 ones
     */
    equals(otherVector) {
        return otherVector && this.x === otherVector.x && this.y === otherVector.y;
    }
    /**
     * Gets a boolean if two vectors are equals (using an epsilon value)
     * Example Playground https://playground.babylonjs.com/#QYBWV4#32
     * @param otherVector defines the other vector
     * @param epsilon defines the minimal distance to consider equality
     * @returns true if the given vector coordinates are close to the current ones by a distance of epsilon.
     */
    equalsWithEpsilon(otherVector, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
        return otherVector && (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this.x, otherVector.x, epsilon) && (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this.y, otherVector.y, epsilon);
    }
    /**
     * Returns true if the current Vector2 coordinates equals the given floats
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @returns true if both vectors are equal
     */
    equalsToFloats(x, y) {
        return this.x === x && this.y === y;
    }
    /**
     * Gets a new Vector2 from current Vector2 floored values
     * Example Playground https://playground.babylonjs.com/#QYBWV4#35
     * eg (1.2, 2.31) returns (1, 2)
     * @returns a new Vector2
     */
    floor() {
        return new Vector2(Math.floor(this.x), Math.floor(this.y));
    }
    /**
     * Gets the current Vector2's floored values and stores them in result
     * @param result the Vector2 to store the result in
     * @returns the result Vector2
     */
    floorToRef(result) {
        result.x = Math.floor(this.x);
        result.y = Math.floor(this.y);
        return result;
    }
    /**
     * Gets a new Vector2 from current Vector2 fractional values
     * Example Playground https://playground.babylonjs.com/#QYBWV4#34
     * eg (1.2, 2.31) returns (0.2, 0.31)
     * @returns a new Vector2
     */
    fract() {
        return new Vector2(this.x - Math.floor(this.x), this.y - Math.floor(this.y));
    }
    /**
     * Gets the current Vector2's fractional values and stores them in result
     * @param result the Vector2 to store the result in
     * @returns the result Vector2
     */
    fractToRef(result) {
        result.x = this.x - Math.floor(this.x);
        result.y = this.y - Math.floor(this.y);
        return result;
    }
    /**
     * Rotate the current vector into a given result vector
     * Example Playground https://playground.babylonjs.com/#QYBWV4#49
     * @param angle defines the rotation angle
     * @param result defines the result vector where to store the rotated vector
     * @returns result input
     */
    rotateToRef(angle, result) {
        const cos = Math.cos(angle);
        const sin = Math.sin(angle);
        const x = cos * this.x - sin * this.y;
        const y = sin * this.x + cos * this.y;
        result.x = x;
        result.y = y;
        return result;
    }
    // Properties
    /**
     * Gets the length of the vector
     * @returns the vector length (float)
     */
    length() {
        return Math.sqrt(this.x * this.x + this.y * this.y);
    }
    /**
     * Gets the vector squared length
     * @returns the vector squared length (float)
     */
    lengthSquared() {
        return this.x * this.x + this.y * this.y;
    }
    // Methods
    /**
     * Normalize the vector
     * Example Playground https://playground.babylonjs.com/#QYBWV4#48
     * @returns the current updated Vector2
     */
    normalize() {
        return this.normalizeFromLength(this.length());
    }
    /**
     * Normalize the current Vector2 with the given input length.
     * Please note that this is an in place operation.
     * @param len the length of the vector
     * @returns the current updated Vector2
     */
    normalizeFromLength(len) {
        if (len === 0 || len === 1.0) {
            return this;
        }
        return this.scaleInPlace(1.0 / len);
    }
    /**
     * Normalize the current Vector2 to a new vector
     * @returns the new Vector2
     */
    normalizeToNew() {
        const normalized = new Vector2();
        this.normalizeToRef(normalized);
        return normalized;
    }
    /**
     * Normalize the current Vector2 to the reference
     * @param result define the Vector to update
     * @returns the updated Vector2
     */
    normalizeToRef(result) {
        const len = this.length();
        if (len === 0) {
            result.x = this.x;
            result.y = this.y;
        }
        return this.scaleToRef(1.0 / len, result);
    }
    /**
     * Gets a new Vector2 copied from the Vector2
     * Example Playground https://playground.babylonjs.com/#QYBWV4#20
     * @returns a new Vector2
     */
    clone() {
        return new Vector2(this.x, this.y);
    }
    /**
     * Gets the dot product of the current vector and the vector "otherVector"
     * @param otherVector defines second vector
     * @returns the dot product (float)
     */
    dot(otherVector) {
        return this.x * otherVector.x + this.y * otherVector.y;
    }
    // Statics
    /**
     * Gets a new Vector2(0, 0)
     * @returns a new Vector2
     */
    static Zero() {
        return new Vector2(0, 0);
    }
    /**
     * Gets a new Vector2(1, 1)
     * @returns a new Vector2
     */
    static One() {
        return new Vector2(1, 1);
    }
    /**
     * Returns a new Vector2 with random values between min and max
     * @param min the minimum random value
     * @param max the maximum random value
     * @returns a Vector2 with random values between min and max
     */
    static Random(min = 0, max = 1) {
        return new Vector2((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max));
    }
    /**
     * Sets a Vector2 with random values between min and max
     * @param min the minimum random value
     * @param max the maximum random value
     * @param ref the ref to store the values in
     * @returns the ref with random values between min and max
     */
    static RandomToRef(min = 0, max = 1, ref) {
        return ref.copyFromFloats((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max));
    }
    /**
     * Gets a zero Vector2 that must not be updated
     */
    static get ZeroReadOnly() {
        return Vector2._ZeroReadOnly;
    }
    /**
     * Gets a new Vector2 set from the given index element of the given array
     * Example Playground https://playground.babylonjs.com/#QYBWV4#79
     * @param array defines the data source
     * @param offset defines the offset in the data source
     * @returns a new Vector2
     */
    static FromArray(array, offset = 0) {
        return new Vector2(array[offset], array[offset + 1]);
    }
    /**
     * Sets "result" from the given index element of the given array
     * Example Playground https://playground.babylonjs.com/#QYBWV4#80
     * @param array defines the data source
     * @param offset defines the offset in the data source
     * @param result defines the target vector
     * @returns result input
     */
    static FromArrayToRef(array, offset, result) {
        result.x = array[offset];
        result.y = array[offset + 1];
        return result;
    }
    /**
     * Sets the given vector "result" with the given floats.
     * @param x defines the x coordinate of the source
     * @param y defines the y coordinate of the source
     * @param result defines the Vector2 where to store the result
     * @returns the result vector
     */
    static FromFloatsToRef(x, y, result) {
        result.copyFromFloats(x, y);
        return result;
    }
    /**
     * Gets a new Vector2 located for "amount" (float) on the CatmullRom spline defined by the given four Vector2
     * Example Playground https://playground.babylonjs.com/#QYBWV4#65
     * @param value1 defines 1st point of control
     * @param value2 defines 2nd point of control
     * @param value3 defines 3rd point of control
     * @param value4 defines 4th point of control
     * @param amount defines the interpolation factor
     * @returns a new Vector2
     */
    static CatmullRom(value1, value2, value3, value4, amount) {
        const squared = amount * amount;
        const cubed = amount * squared;
        const x = 0.5 *
            (2.0 * value2.x +
                (-value1.x + value3.x) * amount +
                (2.0 * value1.x - 5.0 * value2.x + 4.0 * value3.x - value4.x) * squared +
                (-value1.x + 3.0 * value2.x - 3.0 * value3.x + value4.x) * cubed);
        const y = 0.5 *
            (2.0 * value2.y +
                (-value1.y + value3.y) * amount +
                (2.0 * value1.y - 5.0 * value2.y + 4.0 * value3.y - value4.y) * squared +
                (-value1.y + 3.0 * value2.y - 3.0 * value3.y + value4.y) * cubed);
        return new Vector2(x, y);
    }
    /**
     * Sets reference with same the coordinates than "value" ones if the vector "value" is in the square defined by "min" and "max".
     * If a coordinate of "value" is lower than "min" coordinates, the returned Vector2 is given this "min" coordinate.
     * If a coordinate of "value" is greater than "max" coordinates, the returned Vector2 is given this "max" coordinate
     * @param value defines the value to clamp
     * @param min defines the lower limit
     * @param max defines the upper limit
     * @param ref the reference
     * @returns the reference
     */
    static ClampToRef(value, min, max, ref) {
        ref.x = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.x, min.x, max.x);
        ref.y = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.y, min.y, max.y);
        return ref;
    }
    /**
     * Returns a new Vector2 set with same the coordinates than "value" ones if the vector "value" is in the square defined by "min" and "max".
     * If a coordinate of "value" is lower than "min" coordinates, the returned Vector2 is given this "min" coordinate.
     * If a coordinate of "value" is greater than "max" coordinates, the returned Vector2 is given this "max" coordinate
     * Example Playground https://playground.babylonjs.com/#QYBWV4#76
     * @param value defines the value to clamp
     * @param min defines the lower limit
     * @param max defines the upper limit
     * @returns a new Vector2
     */
    static Clamp(value, min, max) {
        const x = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.x, min.x, max.x);
        const y = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.y, min.y, max.y);
        return new Vector2(x, y);
    }
    /**
     * Returns a new Vector2 located for "amount" (float) on the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2"
     * Example Playground https://playground.babylonjs.com/#QYBWV4#81
     * @param value1 defines the 1st control point
     * @param tangent1 defines the outgoing tangent
     * @param value2 defines the 2nd control point
     * @param tangent2 defines the incoming tangent
     * @param amount defines the interpolation factor
     * @returns a new Vector2
     */
    static Hermite(value1, tangent1, value2, tangent2, amount) {
        const squared = amount * amount;
        const cubed = amount * squared;
        const part1 = 2.0 * cubed - 3.0 * squared + 1.0;
        const part2 = -2.0 * cubed + 3.0 * squared;
        const part3 = cubed - 2.0 * squared + amount;
        const part4 = cubed - squared;
        const x = value1.x * part1 + value2.x * part2 + tangent1.x * part3 + tangent2.x * part4;
        const y = value1.y * part1 + value2.y * part2 + tangent1.y * part3 + tangent2.y * part4;
        return new Vector2(x, y);
    }
    /**
     * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
     * Example Playground https://playground.babylonjs.com/#QYBWV4#82
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @returns 1st derivative
     */
    static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {
        return this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, new Vector2());
    }
    /**
     * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
     * Example Playground https://playground.babylonjs.com/#QYBWV4#83
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @param result define where the derivative will be stored
     * @returns result input
     */
    static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {
        const t2 = time * time;
        result.x = (t2 - time) * 6 * value1.x + (3 * t2 - 4 * time + 1) * tangent1.x + (-t2 + time) * 6 * value2.x + (3 * t2 - 2 * time) * tangent2.x;
        result.y = (t2 - time) * 6 * value1.y + (3 * t2 - 4 * time + 1) * tangent1.y + (-t2 + time) * 6 * value2.y + (3 * t2 - 2 * time) * tangent2.y;
        return result;
    }
    /**
     * Returns a new Vector2 located for "amount" (float) on the linear interpolation between the vector "start" adn the vector "end".
     * Example Playground https://playground.babylonjs.com/#QYBWV4#84
     * @param start defines the start vector
     * @param end defines the end vector
     * @param amount defines the interpolation factor
     * @returns a new Vector2
     */
    static Lerp(start, end, amount) {
        return Vector2.LerpToRef(start, end, amount, new Vector2());
    }
    /**
     * Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
     * @param start defines the start value
     * @param end defines the end value
     * @param amount max defines amount between both (between 0 and 1)
     * @param result defines the Vector2 where to store the result
     * @returns result input
     */
    static LerpToRef(start, end, amount, result) {
        result.x = start.x + (end.x - start.x) * amount;
        result.y = start.y + (end.y - start.y) * amount;
        return result;
    }
    /**
     * Gets the dot product of the vector "left" and the vector "right"
     * Example Playground https://playground.babylonjs.com/#QYBWV4#90
     * @param left defines first vector
     * @param right defines second vector
     * @returns the dot product (float)
     */
    static Dot(left, right) {
        return left.x * right.x + left.y * right.y;
    }
    /**
     * Returns a new Vector2 equal to the normalized given vector
     * Example Playground https://playground.babylonjs.com/#QYBWV4#46
     * @param vector defines the vector to normalize
     * @returns a new Vector2
     */
    static Normalize(vector) {
        return Vector2.NormalizeToRef(vector, new Vector2());
    }
    /**
     * Normalize a given vector into a second one
     * Example Playground https://playground.babylonjs.com/#QYBWV4#50
     * @param vector defines the vector to normalize
     * @param result defines the vector where to store the result
     * @returns result input
     */
    static NormalizeToRef(vector, result) {
        vector.normalizeToRef(result);
        return result;
    }
    /**
     * Gets a new Vector2 set with the minimal coordinate values from the "left" and "right" vectors
     * Example Playground https://playground.babylonjs.com/#QYBWV4#86
     * @param left defines 1st vector
     * @param right defines 2nd vector
     * @returns a new Vector2
     */
    static Minimize(left, right) {
        const x = left.x < right.x ? left.x : right.x;
        const y = left.y < right.y ? left.y : right.y;
        return new Vector2(x, y);
    }
    /**
     * Gets a new Vector2 set with the maximal coordinate values from the "left" and "right" vectors
     * Example Playground https://playground.babylonjs.com/#QYBWV4#86
     * @param left defines 1st vector
     * @param right defines 2nd vector
     * @returns a new Vector2
     */
    static Maximize(left, right) {
        const x = left.x > right.x ? left.x : right.x;
        const y = left.y > right.y ? left.y : right.y;
        return new Vector2(x, y);
    }
    /**
     * Gets a new Vector2 set with the transformed coordinates of the given vector by the given transformation matrix
     * Example Playground https://playground.babylonjs.com/#QYBWV4#17
     * @param vector defines the vector to transform
     * @param transformation defines the matrix to apply
     * @returns a new Vector2
     */
    static Transform(vector, transformation) {
        return Vector2.TransformToRef(vector, transformation, new Vector2());
    }
    /**
     * Transforms the given vector coordinates by the given transformation matrix and stores the result in the vector "result" coordinates
     * Example Playground https://playground.babylonjs.com/#QYBWV4#19
     * @param vector defines the vector to transform
     * @param transformation defines the matrix to apply
     * @param result defines the target vector
     * @returns result input
     */
    static TransformToRef(vector, transformation, result) {
        const m = transformation.m;
        const x = vector.x * m[0] + vector.y * m[4] + m[12];
        const y = vector.x * m[1] + vector.y * m[5] + m[13];
        result.x = x;
        result.y = y;
        return result;
    }
    /**
     * Determines if a given vector is included in a triangle
     * Example Playground https://playground.babylonjs.com/#QYBWV4#87
     * @param p defines the vector to test
     * @param p0 defines 1st triangle point
     * @param p1 defines 2nd triangle point
     * @param p2 defines 3rd triangle point
     * @returns true if the point "p" is in the triangle defined by the vectors "p0", "p1", "p2"
     */
    static PointInTriangle(p, p0, p1, p2) {
        const a = (1 / 2) * (-p1.y * p2.x + p0.y * (-p1.x + p2.x) + p0.x * (p1.y - p2.y) + p1.x * p2.y);
        const sign = a < 0 ? -1 : 1;
        const s = (p0.y * p2.x - p0.x * p2.y + (p2.y - p0.y) * p.x + (p0.x - p2.x) * p.y) * sign;
        const t = (p0.x * p1.y - p0.y * p1.x + (p0.y - p1.y) * p.x + (p1.x - p0.x) * p.y) * sign;
        return s > 0 && t > 0 && s + t < 2 * a * sign;
    }
    /**
     * Gets the distance between the vectors "value1" and "value2"
     * Example Playground https://playground.babylonjs.com/#QYBWV4#71
     * @param value1 defines first vector
     * @param value2 defines second vector
     * @returns the distance between vectors
     */
    static Distance(value1, value2) {
        return Math.sqrt(Vector2.DistanceSquared(value1, value2));
    }
    /**
     * Returns the squared distance between the vectors "value1" and "value2"
     * Example Playground https://playground.babylonjs.com/#QYBWV4#72
     * @param value1 defines first vector
     * @param value2 defines second vector
     * @returns the squared distance between vectors
     */
    static DistanceSquared(value1, value2) {
        const x = value1.x - value2.x;
        const y = value1.y - value2.y;
        return x * x + y * y;
    }
    /**
     * Gets a new Vector2 located at the center of the vectors "value1" and "value2"
     * Example Playground https://playground.babylonjs.com/#QYBWV4#86
     * Example Playground https://playground.babylonjs.com/#QYBWV4#66
     * @param value1 defines first vector
     * @param value2 defines second vector
     * @returns a new Vector2
     */
    static Center(value1, value2) {
        return Vector2.CenterToRef(value1, value2, new Vector2());
    }
    /**
     * Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
     * Example Playground https://playground.babylonjs.com/#QYBWV4#66
     * @param value1 defines first vector
     * @param value2 defines second vector
     * @param ref defines third vector
     * @returns ref
     */
    static CenterToRef(value1, value2, ref) {
        return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2);
    }
    /**
     * Gets the shortest distance (float) between the point "p" and the segment defined by the two points "segA" and "segB".
     * Example Playground https://playground.babylonjs.com/#QYBWV4#77
     * @param p defines the middle point
     * @param segA defines one point of the segment
     * @param segB defines the other point of the segment
     * @returns the shortest distance
     */
    static DistanceOfPointFromSegment(p, segA, segB) {
        const l2 = Vector2.DistanceSquared(segA, segB);
        if (l2 === 0.0) {
            return Vector2.Distance(p, segA);
        }
        const v = segB.subtract(segA);
        const t = Math.max(0, Math.min(1, Vector2.Dot(p.subtract(segA), v) / l2));
        const proj = segA.add(v.multiplyByFloats(t, t));
        return Vector2.Distance(p, proj);
    }
}
/**
 * If the first vector is flagged with integers (as everything is 0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
 * If subsequent vectors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
 * and henceforth it will use floating-point representation for all Vector2 instances that it creates.
 * But the original Vector2 instances are unchanged and has a "deprecated map".
 * If we keep using the Vector2 instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
 */
Vector2._V8PerformanceHack = new Vector2(0.5, 0.5);
Vector2._ZeroReadOnly = Vector2.Zero();
Vector2;
Object.defineProperties(Vector2.prototype, {
    dimension: { value: [2] },
    rank: { value: 1 },
});
/**
 * Class used to store (x,y,z) vector representation
 * A Vector3 is the main object used in 3D geometry
 * It can represent either the coordinates of a point the space, either a direction
 * Reminder: js uses a left handed forward facing system
 * Example Playground - Overview - https://playground.babylonjs.com/#R1F8YU
 */
class Vector3 {
    /** Gets or sets the x coordinate */
    get x() {
        return this._x;
    }
    set x(value) {
        this._x = value;
        this._isDirty = true;
    }
    /** Gets or sets the y coordinate */
    get y() {
        return this._y;
    }
    set y(value) {
        this._y = value;
        this._isDirty = true;
    }
    /** Gets or sets the z coordinate */
    get z() {
        return this._z;
    }
    set z(value) {
        this._z = value;
        this._isDirty = true;
    }
    /**
     * Creates a new Vector3 object from the given x, y, z (floats) coordinates.
     * @param x defines the first coordinates (on X axis)
     * @param y defines the second coordinates (on Y axis)
     * @param z defines the third coordinates (on Z axis)
     */
    constructor(x = 0, y = 0, z = 0) {
        /** @internal */
        this._isDirty = true;
        this._x = x;
        this._y = y;
        this._z = z;
    }
    /**
     * Creates a string representation of the Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#67
     * @returns a string with the Vector3 coordinates.
     */
    toString() {
        return `{X: ${this._x} Y: ${this._y} Z: ${this._z}}`;
    }
    /**
     * Gets the class name
     * @returns the string "Vector3"
     */
    getClassName() {
        return "Vector3";
    }
    /**
     * Creates the Vector3 hash code
     * @returns a number which tends to be unique between Vector3 instances
     */
    getHashCode() {
        const x = _ExtractAsInt(this._x);
        const y = _ExtractAsInt(this._y);
        const z = _ExtractAsInt(this._z);
        let hash = x;
        hash = (hash * 397) ^ y;
        hash = (hash * 397) ^ z;
        return hash;
    }
    // Operators
    /**
     * Creates an array containing three elements : the coordinates of the Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#10
     * @returns a new array of numbers
     */
    asArray() {
        return [this._x, this._y, this._z];
    }
    /**
     * Populates the given array or Float32Array from the given index with the successive coordinates of the Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#65
     * @param array defines the destination array
     * @param index defines the offset in the destination array
     * @returns the current Vector3
     */
    toArray(array, index = 0) {
        array[index] = this._x;
        array[index + 1] = this._y;
        array[index + 2] = this._z;
        return this;
    }
    /**
     * Update the current vector from an array
     * Example Playground https://playground.babylonjs.com/#R1F8YU#24
     * @param array defines the destination array
     * @param offset defines the offset in the destination array
     * @returns the current Vector3
     */
    fromArray(array, offset = 0) {
        Vector3.FromArrayToRef(array, offset, this);
        return this;
    }
    /**
     * Converts the current Vector3 into a quaternion (considering that the Vector3 contains Euler angles representation of a rotation)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#66
     * @returns a new Quaternion object, computed from the Vector3 coordinates
     */
    toQuaternion() {
        return Quaternion.RotationYawPitchRoll(this._y, this._x, this._z);
    }
    /**
     * Adds the given vector to the current Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#4
     * @param otherVector defines the second operand
     * @returns the current updated Vector3
     */
    addInPlace(otherVector) {
        this._x += otherVector._x;
        this._y += otherVector._y;
        this._z += otherVector._z;
        this._isDirty = true;
        return this;
    }
    /**
     * Adds the given coordinates to the current Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#5
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @returns the current updated Vector3
     */
    addInPlaceFromFloats(x, y, z) {
        this._x += x;
        this._y += y;
        this._z += z;
        this._isDirty = true;
        return this;
    }
    /**
     * Gets a new Vector3, result of the addition the current Vector3 and the given vector
     * Example Playground https://playground.babylonjs.com/#R1F8YU#3
     * @param otherVector defines the second operand
     * @returns the resulting Vector3
     */
    add(otherVector) {
        return new Vector3(this._x + otherVector._x, this._y + otherVector._y, this._z + otherVector._z);
    }
    /**
     * Adds the current Vector3 to the given one and stores the result in the vector "result"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#6
     * @param otherVector defines the second operand
     * @param result defines the Vector3 object where to store the result
     * @returns the result
     */
    addToRef(otherVector, result) {
        result._x = this._x + otherVector._x;
        result._y = this._y + otherVector._y;
        result._z = this._z + otherVector._z;
        result._isDirty = true;
        return result;
    }
    /**
     * Subtract the given vector from the current Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#61
     * @param otherVector defines the second operand
     * @returns the current updated Vector3
     */
    subtractInPlace(otherVector) {
        this._x -= otherVector._x;
        this._y -= otherVector._y;
        this._z -= otherVector._z;
        this._isDirty = true;
        return this;
    }
    /**
     * Returns a new Vector3, result of the subtraction of the given vector from the current Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#60
     * @param otherVector defines the second operand
     * @returns the resulting Vector3
     */
    subtract(otherVector) {
        return new Vector3(this._x - otherVector._x, this._y - otherVector._y, this._z - otherVector._z);
    }
    /**
     * Subtracts the given vector from the current Vector3 and stores the result in the vector "result".
     * Example Playground https://playground.babylonjs.com/#R1F8YU#63
     * @param otherVector defines the second operand
     * @param result defines the Vector3 object where to store the result
     * @returns the result
     */
    subtractToRef(otherVector, result) {
        return this.subtractFromFloatsToRef(otherVector._x, otherVector._y, otherVector._z, result);
    }
    /**
     * Returns a new Vector3 set with the subtraction of the given floats from the current Vector3 coordinates
     * Example Playground https://playground.babylonjs.com/#R1F8YU#62
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @returns the resulting Vector3
     */
    subtractFromFloats(x, y, z) {
        return new Vector3(this._x - x, this._y - y, this._z - z);
    }
    /**
     * Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result
     * Example Playground https://playground.babylonjs.com/#R1F8YU#64
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @param result defines the Vector3 object where to store the result
     * @returns the result
     */
    subtractFromFloatsToRef(x, y, z, result) {
        result._x = this._x - x;
        result._y = this._y - y;
        result._z = this._z - z;
        result._isDirty = true;
        return result;
    }
    /**
     * Gets a new Vector3 set with the current Vector3 negated coordinates
     * Example Playground https://playground.babylonjs.com/#R1F8YU#35
     * @returns a new Vector3
     */
    negate() {
        return new Vector3(-this._x, -this._y, -this._z);
    }
    /**
     * Negate this vector in place
     * Example Playground https://playground.babylonjs.com/#R1F8YU#36
     * @returns this
     */
    negateInPlace() {
        this._x *= -1;
        this._y *= -1;
        this._z *= -1;
        this._isDirty = true;
        return this;
    }
    /**
     * Negate the current Vector3 and stores the result in the given vector "result" coordinates
     * Example Playground https://playground.babylonjs.com/#R1F8YU#37
     * @param result defines the Vector3 object where to store the result
     * @returns the result
     */
    negateToRef(result) {
        result._x = this._x * -1;
        result._y = this._y * -1;
        result._z = this._z * -1;
        result._isDirty = true;
        return result;
    }
    /**
     * Multiplies the Vector3 coordinates by the float "scale"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#56
     * @param scale defines the multiplier factor
     * @returns the current updated Vector3
     */
    scaleInPlace(scale) {
        this._x *= scale;
        this._y *= scale;
        this._z *= scale;
        this._isDirty = true;
        return this;
    }
    /**
     * Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float "scale"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#53
     * @param scale defines the multiplier factor
     * @returns a new Vector3
     */
    scale(scale) {
        return new Vector3(this._x * scale, this._y * scale, this._z * scale);
    }
    /**
     * Multiplies the current Vector3 coordinates by the float "scale" and stores the result in the given vector "result" coordinates
     * Example Playground https://playground.babylonjs.com/#R1F8YU#57
     * @param scale defines the multiplier factor
     * @param result defines the Vector3 object where to store the result
     * @returns the result
     */
    scaleToRef(scale, result) {
        result._x = this._x * scale;
        result._y = this._y * scale;
        result._z = this._z * scale;
        result._isDirty = true;
        return result;
    }
    /**
     * Creates a vector normal (perpendicular) to the current Vector3 and stores the result in the given vector
     * Out of the infinite possibilities the normal chosen is the one formed by rotating the current vector
     * 90 degrees about an axis which lies perpendicular to the current vector
     * and its projection on the xz plane. In the case of a current vector in the xz plane
     * the normal is calculated to be along the y axis.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#230
     * Example Playground https://playground.babylonjs.com/#R1F8YU#231
     * @param result defines the Vector3 object where to store the resultant normal
     * @returns the result
     */
    getNormalToRef(result) {
        /**
         * Calculates the spherical coordinates of the current vector
         * so saves on memory rather than importing whole Spherical Class
         */
        const radius = this.length();
        let theta = Math.acos(this.y / radius);
        const phi = Math.atan2(this.z, this.x);
        //makes angle 90 degs to current vector
        if (theta > Math.PI / 2) {
            theta -= Math.PI / 2;
        }
        else {
            theta += Math.PI / 2;
        }
        //Calculates resutant normal vector from spherical coordinate of perpendicular vector
        const x = radius * Math.sin(theta) * Math.cos(phi);
        const y = radius * Math.cos(theta);
        const z = radius * Math.sin(theta) * Math.sin(phi);
        result.set(x, y, z);
        return result;
    }
    /**
     * Rotates the vector using the given unit quaternion and stores the new vector in result
     * Example Playground https://playground.babylonjs.com/#R1F8YU#9
     * @param q the unit quaternion representing the rotation
     * @param result the output vector
     * @returns the result
     */
    applyRotationQuaternionToRef(q, result) {
        // Derived from https://raw.org/proof/vector-rotation-using-quaternions/
        const vx = this._x, vy = this._y, vz = this._z;
        const qx = q._x, qy = q._y, qz = q._z, qw = q._w;
        // t = 2q x v
        const tx = 2 * (qy * vz - qz * vy);
        const ty = 2 * (qz * vx - qx * vz);
        const tz = 2 * (qx * vy - qy * vx);
        // v + w t + q x t
        result._x = vx + qw * tx + qy * tz - qz * ty;
        result._y = vy + qw * ty + qz * tx - qx * tz;
        result._z = vz + qw * tz + qx * ty - qy * tx;
        result._isDirty = true;
        return result;
    }
    /**
     * Rotates the vector in place using the given unit quaternion
     * Example Playground https://playground.babylonjs.com/#R1F8YU#8
     * @param q the unit quaternion representing the rotation
     * @returns the current updated Vector3
     */
    applyRotationQuaternionInPlace(q) {
        return this.applyRotationQuaternionToRef(q, this);
    }
    /**
     * Rotates the vector using the given unit quaternion and returns the new vector
     * Example Playground https://playground.babylonjs.com/#R1F8YU#7
     * @param q the unit quaternion representing the rotation
     * @returns a new Vector3
     */
    applyRotationQuaternion(q) {
        return this.applyRotationQuaternionToRef(q, new Vector3());
    }
    /**
     * Scale the current Vector3 values by a factor and add the result to a given Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#55
     * @param scale defines the scale factor
     * @param result defines the Vector3 object where to store the result
     * @returns result input
     */
    scaleAndAddToRef(scale, result) {
        result._x += this._x * scale;
        result._y += this._y * scale;
        result._z += this._z * scale;
        result._isDirty = true;
        return result;
    }
    /**
     * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#48
     * @param plane defines the plane to project to
     * @param origin defines the origin of the projection ray
     * @returns the projected vector3
     */
    projectOnPlane(plane, origin) {
        return this.projectOnPlaneToRef(plane, origin, new Vector3());
    }
    /**
     * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#49
     * @param plane defines the plane to project to
     * @param origin defines the origin of the projection ray
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    projectOnPlaneToRef(plane, origin, result) {
        const n = plane.normal;
        const d = plane.d;
        const V = MathTmp.Vector3[0];
        // ray direction
        this.subtractToRef(origin, V);
        V.normalize();
        const denom = Vector3.Dot(V, n);
        //When the ray is close to parallel to the plane return infinity vector
        if (Math.abs(denom) < 0.0000000001) {
            result.setAll(Infinity);
        }
        else {
            const t = -(Vector3.Dot(origin, n) + d) / denom;
            // P = P0 + t*V
            const scaledV = V.scaleInPlace(t);
            origin.addToRef(scaledV, result);
        }
        return result;
    }
    /**
     * Returns true if the current Vector3 and the given vector coordinates are strictly equal
     * Example Playground https://playground.babylonjs.com/#R1F8YU#19
     * @param otherVector defines the second operand
     * @returns true if both vectors are equals
     */
    equals(otherVector) {
        return otherVector && this._x === otherVector._x && this._y === otherVector._y && this._z === otherVector._z;
    }
    /**
     * Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon
     * Example Playground https://playground.babylonjs.com/#R1F8YU#21
     * @param otherVector defines the second operand
     * @param epsilon defines the minimal distance to define values as equals
     * @returns true if both vectors are distant less than epsilon
     */
    equalsWithEpsilon(otherVector, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
        return otherVector && (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this._x, otherVector._x, epsilon) && (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this._y, otherVector._y, epsilon) && (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this._z, otherVector._z, epsilon);
    }
    /**
     * Returns true if the current Vector3 coordinates equals the given floats
     * Example Playground https://playground.babylonjs.com/#R1F8YU#20
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @returns true if both vectors are equal
     */
    equalsToFloats(x, y, z) {
        return this._x === x && this._y === y && this._z === z;
    }
    /**
     * Multiplies the current Vector3 coordinates by the given ones
     * Example Playground https://playground.babylonjs.com/#R1F8YU#32
     * @param otherVector defines the second operand
     * @returns the current updated Vector3
     */
    multiplyInPlace(otherVector) {
        this._x *= otherVector._x;
        this._y *= otherVector._y;
        this._z *= otherVector._z;
        this._isDirty = true;
        return this;
    }
    /**
     * Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector
     * Example Playground https://playground.babylonjs.com/#R1F8YU#31
     * @param otherVector defines the second operand
     * @returns the new Vector3
     */
    multiply(otherVector) {
        return this.multiplyByFloats(otherVector._x, otherVector._y, otherVector._z);
    }
    /**
     * Multiplies the current Vector3 by the given one and stores the result in the given vector "result"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#33
     * @param otherVector defines the second operand
     * @param result defines the Vector3 object where to store the result
     * @returns the result
     */
    multiplyToRef(otherVector, result) {
        result._x = this._x * otherVector._x;
        result._y = this._y * otherVector._y;
        result._z = this._z * otherVector._z;
        result._isDirty = true;
        return result;
    }
    /**
     * Returns a new Vector3 set with the result of the multiplication of the current Vector3 coordinates by the given floats
     * Example Playground https://playground.babylonjs.com/#R1F8YU#34
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @returns the new Vector3
     */
    multiplyByFloats(x, y, z) {
        return new Vector3(this._x * x, this._y * y, this._z * z);
    }
    /**
     * Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones
     * Example Playground https://playground.babylonjs.com/#R1F8YU#16
     * @param otherVector defines the second operand
     * @returns the new Vector3
     */
    divide(otherVector) {
        return new Vector3(this._x / otherVector._x, this._y / otherVector._y, this._z / otherVector._z);
    }
    /**
     * Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#18
     * @param otherVector defines the second operand
     * @param result defines the Vector3 object where to store the result
     * @returns the result
     */
    divideToRef(otherVector, result) {
        result._x = this._x / otherVector._x;
        result._y = this._y / otherVector._y;
        result._z = this._z / otherVector._z;
        result._isDirty = true;
        return result;
    }
    /**
     * Divides the current Vector3 coordinates by the given ones.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#17
     * @param otherVector defines the second operand
     * @returns the current updated Vector3
     */
    divideInPlace(otherVector) {
        this._x = this._x / otherVector._x;
        this._y = this._y / otherVector._y;
        this._z = this._z / otherVector._z;
        this._isDirty = true;
        return this;
    }
    /**
     * Updates the current Vector3 with the minimal coordinate values between its and the given vector ones
     * Example Playground https://playground.babylonjs.com/#R1F8YU#29
     * @param other defines the second operand
     * @returns the current updated Vector3
     */
    minimizeInPlace(other) {
        return this.minimizeInPlaceFromFloats(other._x, other._y, other._z);
    }
    /**
     * Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#27
     * @param other defines the second operand
     * @returns the current updated Vector3
     */
    maximizeInPlace(other) {
        return this.maximizeInPlaceFromFloats(other._x, other._y, other._z);
    }
    /**
     * Updates the current Vector3 with the minimal coordinate values between its and the given coordinates
     * Example Playground https://playground.babylonjs.com/#R1F8YU#30
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @returns the current updated Vector3
     */
    minimizeInPlaceFromFloats(x, y, z) {
        if (x < this._x) {
            this.x = x;
        }
        if (y < this._y) {
            this.y = y;
        }
        if (z < this._z) {
            this.z = z;
        }
        return this;
    }
    /**
     * Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#28
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @returns the current updated Vector3
     */
    maximizeInPlaceFromFloats(x, y, z) {
        if (x > this._x) {
            this.x = x;
        }
        if (y > this._y) {
            this.y = y;
        }
        if (z > this._z) {
            this.z = z;
        }
        return this;
    }
    /**
     * Due to float precision, scale of a mesh could be uniform but float values are off by a small fraction
     * Check if is non uniform within a certain amount of decimal places to account for this
     * @param epsilon the amount the values can differ
     * @returns if the vector is non uniform to a certain number of decimal places
     */
    isNonUniformWithinEpsilon(epsilon) {
        const absX = Math.abs(this._x);
        const absY = Math.abs(this._y);
        if (!(0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(absX, absY, epsilon)) {
            return true;
        }
        const absZ = Math.abs(this._z);
        if (!(0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(absX, absZ, epsilon)) {
            return true;
        }
        if (!(0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(absY, absZ, epsilon)) {
            return true;
        }
        return false;
    }
    /**
     * Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same
     */
    get isNonUniform() {
        const absX = Math.abs(this._x);
        const absY = Math.abs(this._y);
        if (absX !== absY) {
            return true;
        }
        const absZ = Math.abs(this._z);
        if (absX !== absZ) {
            return true;
        }
        return false;
    }
    /**
     * Gets the current Vector3's floored values and stores them in result
     * @param result the vector to store the result in
     * @returns the result vector
     */
    floorToRef(result) {
        result._x = Math.floor(this._x);
        result._y = Math.floor(this._y);
        result._z = Math.floor(this._z);
        result._isDirty = true;
        return result;
    }
    /**
     * Gets a new Vector3 from current Vector3 floored values
     * Example Playground https://playground.babylonjs.com/#R1F8YU#22
     * @returns a new Vector3
     */
    floor() {
        return new Vector3(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z));
    }
    /**
     * Gets the current Vector3's fractional values and stores them in result
     * @param result the vector to store the result in
     * @returns the result vector
     */
    fractToRef(result) {
        result._x = this.x - Math.floor(this._x);
        result._y = this.y - Math.floor(this._y);
        result._z = this.z - Math.floor(this._z);
        result._isDirty = true;
        return result;
    }
    /**
     * Gets a new Vector3 from current Vector3 fractional values
     * Example Playground https://playground.babylonjs.com/#R1F8YU#23
     * @returns a new Vector3
     */
    fract() {
        return new Vector3(this.x - Math.floor(this._x), this.y - Math.floor(this._y), this.z - Math.floor(this._z));
    }
    // Properties
    /**
     * Gets the length of the Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#25
     * @returns the length of the Vector3
     */
    length() {
        return Math.sqrt(this.lengthSquared());
    }
    /**
     * Gets the squared length of the Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#26
     * @returns squared length of the Vector3
     */
    lengthSquared() {
        return this._x * this._x + this._y * this._y + this._z * this._z;
    }
    /**
     * Gets a boolean indicating if the vector contains a zero in one of its components
     * Example Playground https://playground.babylonjs.com/#R1F8YU#1
     */
    get hasAZeroComponent() {
        return this._x * this._y * this._z === 0;
    }
    /**
     * Normalize the current Vector3.
     * Please note that this is an in place operation.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#122
     * @returns the current updated Vector3
     */
    normalize() {
        return this.normalizeFromLength(this.length());
    }
    /**
     * Reorders the x y z properties of the vector in place
     * Example Playground https://playground.babylonjs.com/#R1F8YU#44
     * @param order new ordering of the properties (eg. for vector 1,2,3 with "ZYX" will produce 3,2,1)
     * @returns the current updated vector
     */
    reorderInPlace(order) {
        order = order.toLowerCase();
        if (order === "xyz") {
            return this;
        }
        const tem = MathTmp.Vector3[0].copyFrom(this);
        this.x = tem[order[0]];
        this.y = tem[order[1]];
        this.z = tem[order[2]];
        return this;
    }
    /**
     * Rotates the vector around 0,0,0 by a quaternion
     * Example Playground https://playground.babylonjs.com/#R1F8YU#47
     * @param quaternion the rotation quaternion
     * @param result vector to store the result
     * @returns the resulting vector
     */
    rotateByQuaternionToRef(quaternion, result) {
        quaternion.toRotationMatrix(MathTmp.Matrix[0]);
        Vector3.TransformCoordinatesToRef(this, MathTmp.Matrix[0], result);
        return result;
    }
    /**
     * Rotates a vector around a given point
     * Example Playground https://playground.babylonjs.com/#R1F8YU#46
     * @param quaternion the rotation quaternion
     * @param point the point to rotate around
     * @param result vector to store the result
     * @returns the resulting vector
     */
    rotateByQuaternionAroundPointToRef(quaternion, point, result) {
        this.subtractToRef(point, MathTmp.Vector3[0]);
        MathTmp.Vector3[0].rotateByQuaternionToRef(quaternion, MathTmp.Vector3[0]);
        point.addToRef(MathTmp.Vector3[0], result);
        return result;
    }
    /**
     * Returns a new Vector3 as the cross product of the current vector and the "other" one
     * The cross product is then orthogonal to both current and "other"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#14
     * @param other defines the right operand
     * @returns the cross product
     */
    cross(other) {
        return Vector3.CrossToRef(this, other, new Vector3());
    }
    /**
     * Normalize the current Vector3 with the given input length.
     * Please note that this is an in place operation.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#123
     * @param len the length of the vector
     * @returns the current updated Vector3
     */
    normalizeFromLength(len) {
        if (len === 0 || len === 1.0) {
            return this;
        }
        return this.scaleInPlace(1.0 / len);
    }
    /**
     * Normalize the current Vector3 to a new vector
     * Example Playground https://playground.babylonjs.com/#R1F8YU#124
     * @returns the new Vector3
     */
    normalizeToNew() {
        return this.normalizeToRef(new Vector3());
    }
    /**
     * Normalize the current Vector3 to the reference
     * Example Playground https://playground.babylonjs.com/#R1F8YU#125
     * @param result define the Vector3 to update
     * @returns the updated Vector3
     */
    normalizeToRef(result) {
        const len = this.length();
        if (len === 0 || len === 1.0) {
            result._x = this._x;
            result._y = this._y;
            result._z = this._z;
            result._isDirty = true;
            return result;
        }
        return this.scaleToRef(1.0 / len, result);
    }
    /**
     * Creates a new Vector3 copied from the current Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#11
     * @returns the new Vector3
     */
    clone() {
        return new Vector3(this._x, this._y, this._z);
    }
    /**
     * Copies the given vector coordinates to the current Vector3 ones
     * Example Playground https://playground.babylonjs.com/#R1F8YU#12
     * @param source defines the source Vector3
     * @returns the current updated Vector3
     */
    copyFrom(source) {
        return this.copyFromFloats(source._x, source._y, source._z);
    }
    /**
     * Copies the given floats to the current Vector3 coordinates
     * Example Playground https://playground.babylonjs.com/#R1F8YU#13
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @returns the current updated Vector3
     */
    copyFromFloats(x, y, z) {
        this._x = x;
        this._y = y;
        this._z = z;
        this._isDirty = true;
        return this;
    }
    /**
     * Copies the given floats to the current Vector3 coordinates
     * Example Playground https://playground.babylonjs.com/#R1F8YU#58
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @returns the current updated Vector3
     */
    set(x, y, z) {
        return this.copyFromFloats(x, y, z);
    }
    /**
     * Copies the given float to the current Vector3 coordinates
     * Example Playground https://playground.babylonjs.com/#R1F8YU#59
     * @param v defines the x, y and z coordinates of the operand
     * @returns the current updated Vector3
     */
    setAll(v) {
        this._x = this._y = this._z = v;
        this._isDirty = true;
        return this;
    }
    // Statics
    /**
     * Get the clip factor between two vectors
     * Example Playground https://playground.babylonjs.com/#R1F8YU#126
     * @param vector0 defines the first operand
     * @param vector1 defines the second operand
     * @param axis defines the axis to use
     * @param size defines the size along the axis
     * @returns the clip factor
     */
    static GetClipFactor(vector0, vector1, axis, size) {
        const d0 = Vector3.Dot(vector0, axis);
        const d1 = Vector3.Dot(vector1, axis);
        return (d0 - size) / (d0 - d1);
    }
    /**
     * Get angle between two vectors
     * Example Playground https://playground.babylonjs.com/#R1F8YU#86
     * @param vector0 the starting point
     * @param vector1 the ending point
     * @param normal direction of the normal
     * @returns the angle between vector0 and vector1
     */
    static GetAngleBetweenVectors(vector0, vector1, normal) {
        const v0 = vector0.normalizeToRef(MathTmp.Vector3[1]);
        const v1 = vector1.normalizeToRef(MathTmp.Vector3[2]);
        let dot = Vector3.Dot(v0, v1);
        // Vectors are normalized so dot will be in [-1, 1] (aside precision issues enough to break the result which explains the below clamp)
        dot = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(dot, -1, 1);
        const angle = Math.acos(dot);
        const n = MathTmp.Vector3[3];
        Vector3.CrossToRef(v0, v1, n);
        if (Vector3.Dot(n, normal) > 0) {
            return isNaN(angle) ? 0 : angle;
        }
        return isNaN(angle) ? -Math.PI : -Math.acos(dot);
    }
    /**
     * Get angle between two vectors projected on a plane
     * Example Playground https://playground.babylonjs.com/#R1F8YU#87
     * Expectation compute time: 0.01 ms (median) and 0.02 ms (percentile 95%)
     * @param vector0 angle between vector0 and vector1
     * @param vector1 angle between vector0 and vector1
     * @param normal Normal of the projection plane
     * @returns the angle in radians (float) between vector0 and vector1 projected on the plane with the specified normal
     */
    static GetAngleBetweenVectorsOnPlane(vector0, vector1, normal) {
        MathTmp.Vector3[0].copyFrom(vector0);
        const v0 = MathTmp.Vector3[0];
        MathTmp.Vector3[1].copyFrom(vector1);
        const v1 = MathTmp.Vector3[1];
        MathTmp.Vector3[2].copyFrom(normal);
        const vNormal = MathTmp.Vector3[2];
        const right = MathTmp.Vector3[3];
        const forward = MathTmp.Vector3[4];
        v0.normalize();
        v1.normalize();
        vNormal.normalize();
        Vector3.CrossToRef(vNormal, v0, right);
        Vector3.CrossToRef(right, vNormal, forward);
        const angle = Math.atan2(Vector3.Dot(v1, right), Vector3.Dot(v1, forward));
        return (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.NormalizeRadians)(angle);
    }
    /**
     * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point and stores it in the ref Vector3
     * Example PG https://playground.babylonjs.com/#R1F8YU#189
     * @param start the starting point
     * @param target the target point
     * @param ref the vector3 to store the result
     * @returns ref in the form (pitch, yaw, 0)
     */
    static PitchYawRollToMoveBetweenPointsToRef(start, target, ref) {
        const diff = TmpVectors.Vector3[0];
        target.subtractToRef(start, diff);
        ref._y = Math.atan2(diff.x, diff.z) || 0;
        ref._x = Math.atan2(Math.sqrt(diff.x ** 2 + diff.z ** 2), diff.y) || 0;
        ref._z = 0;
        ref._isDirty = true;
        return ref;
    }
    /**
     * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point
     * Example PG https://playground.babylonjs.com/#R1F8YU#188
     * @param start the starting point
     * @param target the target point
     * @returns the rotation in the form (pitch, yaw, 0)
     */
    static PitchYawRollToMoveBetweenPoints(start, target) {
        const ref = Vector3.Zero();
        return Vector3.PitchYawRollToMoveBetweenPointsToRef(start, target, ref);
    }
    /**
     * Slerp between two vectors. See also `SmoothToRef`
     * Slerp is a spherical linear interpolation
     * giving a slow in and out effect
     * Example Playground 1 https://playground.babylonjs.com/#R1F8YU#108
     * Example Playground 2 https://playground.babylonjs.com/#R1F8YU#109
     * @param vector0 Start vector
     * @param vector1 End vector
     * @param slerp amount (will be clamped between 0 and 1)
     * @param result The slerped vector
     * @returns The slerped vector
     */
    static SlerpToRef(vector0, vector1, slerp, result) {
        slerp = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(slerp, 0, 1);
        const vector0Dir = MathTmp.Vector3[0];
        const vector1Dir = MathTmp.Vector3[1];
        vector0Dir.copyFrom(vector0);
        const vector0Length = vector0Dir.length();
        vector0Dir.normalizeFromLength(vector0Length);
        vector1Dir.copyFrom(vector1);
        const vector1Length = vector1Dir.length();
        vector1Dir.normalizeFromLength(vector1Length);
        const dot = Vector3.Dot(vector0Dir, vector1Dir);
        let scale0;
        let scale1;
        if (dot < 1 - _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
            const omega = Math.acos(dot);
            const invSin = 1 / Math.sin(omega);
            scale0 = Math.sin((1 - slerp) * omega) * invSin;
            scale1 = Math.sin(slerp * omega) * invSin;
        }
        else {
            // Use linear interpolation
            scale0 = 1 - slerp;
            scale1 = slerp;
        }
        vector0Dir.scaleInPlace(scale0);
        vector1Dir.scaleInPlace(scale1);
        result.copyFrom(vector0Dir).addInPlace(vector1Dir);
        result.scaleInPlace((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Lerp)(vector0Length, vector1Length, slerp));
        return result;
    }
    /**
     * Smooth interpolation between two vectors using Slerp
     * Example Playground https://playground.babylonjs.com/#R1F8YU#110
     * @param source source vector
     * @param goal goal vector
     * @param deltaTime current interpolation frame
     * @param lerpTime total interpolation time
     * @param result the smoothed vector
     * @returns the smoothed vector
     */
    static SmoothToRef(source, goal, deltaTime, lerpTime, result) {
        Vector3.SlerpToRef(source, goal, lerpTime === 0 ? 1 : deltaTime / lerpTime, result);
        return result;
    }
    /**
     * Returns a new Vector3 set from the index "offset" of the given array
     * Example Playground https://playground.babylonjs.com/#R1F8YU#83
     * @param array defines the source array
     * @param offset defines the offset in the source array
     * @returns the new Vector3
     */
    static FromArray(array, offset = 0) {
        return new Vector3(array[offset], array[offset + 1], array[offset + 2]);
    }
    /**
     * Returns a new Vector3 set from the index "offset" of the given Float32Array
     * @param array defines the source array
     * @param offset defines the offset in the source array
     * @returns the new Vector3
     * @deprecated Please use FromArray instead.
     */
    static FromFloatArray(array, offset) {
        return Vector3.FromArray(array, offset);
    }
    /**
     * Sets the given vector "result" with the element values from the index "offset" of the given array
     * Example Playground https://playground.babylonjs.com/#R1F8YU#84
     * @param array defines the source array
     * @param offset defines the offset in the source array
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static FromArrayToRef(array, offset, result) {
        result._x = array[offset];
        result._y = array[offset + 1];
        result._z = array[offset + 2];
        result._isDirty = true;
        return result;
    }
    /**
     * Sets the given vector "result" with the element values from the index "offset" of the given Float32Array
     * @param array defines the source array
     * @param offset defines the offset in the source array
     * @param result defines the Vector3 where to store the result
     * @deprecated Please use FromArrayToRef instead.
     * @returns result input
     */
    static FromFloatArrayToRef(array, offset, result) {
        return Vector3.FromArrayToRef(array, offset, result);
    }
    /**
     * Sets the given vector "result" with the given floats.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#85
     * @param x defines the x coordinate of the source
     * @param y defines the y coordinate of the source
     * @param z defines the z coordinate of the source
     * @param result defines the Vector3 where to store the result
     * @returns the result vector
     */
    static FromFloatsToRef(x, y, z, result) {
        result.copyFromFloats(x, y, z);
        return result;
    }
    /**
     * Returns a new Vector3 set to (0.0, 0.0, 0.0)
     * @returns a new empty Vector3
     */
    static Zero() {
        return new Vector3(0.0, 0.0, 0.0);
    }
    /**
     * Returns a new Vector3 set to (1.0, 1.0, 1.0)
     * @returns a new Vector3
     */
    static One() {
        return new Vector3(1.0, 1.0, 1.0);
    }
    /**
     * Returns a new Vector3 set to (0.0, 1.0, 0.0)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#71
     * @returns a new up Vector3
     */
    static Up() {
        return new Vector3(0.0, 1.0, 0.0);
    }
    /**
     * Gets an up Vector3 that must not be updated
     */
    static get UpReadOnly() {
        return Vector3._UpReadOnly;
    }
    /**
     * Gets a down Vector3 that must not be updated
     */
    static get DownReadOnly() {
        return Vector3._DownReadOnly;
    }
    /**
     * Gets a right Vector3 that must not be updated
     */
    static get RightReadOnly() {
        return Vector3._RightReadOnly;
    }
    /**
     * Gets a left Vector3 that must not be updated
     */
    static get LeftReadOnly() {
        return Vector3._LeftReadOnly;
    }
    /**
     * Gets a forward Vector3 that must not be updated
     */
    static get LeftHandedForwardReadOnly() {
        return Vector3._LeftHandedForwardReadOnly;
    }
    /**
     * Gets a forward Vector3 that must not be updated
     */
    static get RightHandedForwardReadOnly() {
        return Vector3._RightHandedForwardReadOnly;
    }
    /**
     * Gets a backward Vector3 that must not be updated
     */
    static get LeftHandedBackwardReadOnly() {
        return Vector3._LeftHandedBackwardReadOnly;
    }
    /**
     * Gets a backward Vector3 that must not be updated
     */
    static get RightHandedBackwardReadOnly() {
        return Vector3._RightHandedBackwardReadOnly;
    }
    /**
     * Gets a zero Vector3 that must not be updated
     */
    static get ZeroReadOnly() {
        return Vector3._ZeroReadOnly;
    }
    /**
     * Gets a one Vector3 that must not be updated
     */
    static get OneReadOnly() {
        return Vector3._OneReadOnly;
    }
    /**
     * Returns a new Vector3 set to (0.0, -1.0, 0.0)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#71
     * @returns a new down Vector3
     */
    static Down() {
        return new Vector3(0.0, -1.0, 0.0);
    }
    /**
     * Returns a new Vector3 set to (0.0, 0.0, 1.0)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#71
     * @param rightHandedSystem is the scene right-handed (negative z)
     * @returns a new forward Vector3
     */
    static Forward(rightHandedSystem = false) {
        return new Vector3(0.0, 0.0, rightHandedSystem ? -1.0 : 1.0);
    }
    /**
     * Returns a new Vector3 set to (0.0, 0.0, -1.0)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#71
     * @param rightHandedSystem is the scene right-handed (negative-z)
     * @returns a new Backward Vector3
     */
    static Backward(rightHandedSystem = false) {
        return new Vector3(0.0, 0.0, rightHandedSystem ? 1.0 : -1.0);
    }
    /**
     * Returns a new Vector3 set to (1.0, 0.0, 0.0)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#71
     * @returns a new right Vector3
     */
    static Right() {
        return new Vector3(1.0, 0.0, 0.0);
    }
    /**
     * Returns a new Vector3 set to (-1.0, 0.0, 0.0)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#71
     * @returns a new left Vector3
     */
    static Left() {
        return new Vector3(-1.0, 0.0, 0.0);
    }
    /**
     * Returns a new Vector3 with random values between min and max
     * @param min the minimum random value
     * @param max the maximum random value
     * @returns a Vector3 with random values between min and max
     */
    static Random(min = 0, max = 1) {
        return new Vector3((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max));
    }
    /**
     * Sets a Vector3 with random values between min and max
     * @param min the minimum random value
     * @param max the maximum random value
     * @param ref the ref to store the values in
     * @returns the ref with random values between min and max
     */
    static RandomToRef(min = 0, max = 1, ref) {
        return ref.copyFromFloats((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max));
    }
    /**
     * Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector.
     * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#111
     * @param vector defines the Vector3 to transform
     * @param transformation defines the transformation matrix
     * @returns the transformed Vector3
     */
    static TransformCoordinates(vector, transformation) {
        const result = Vector3.Zero();
        Vector3.TransformCoordinatesToRef(vector, transformation, result);
        return result;
    }
    /**
     * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
     * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#113
     * @param vector defines the Vector3 to transform
     * @param transformation defines the transformation matrix
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static TransformCoordinatesToRef(vector, transformation, result) {
        Vector3.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);
        return result;
    }
    /**
     * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
     * This method computes transformed coordinates only, not transformed direction vectors
     * Example Playground https://playground.babylonjs.com/#R1F8YU#115
     * @param x define the x coordinate of the source vector
     * @param y define the y coordinate of the source vector
     * @param z define the z coordinate of the source vector
     * @param transformation defines the transformation matrix
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static TransformCoordinatesFromFloatsToRef(x, y, z, transformation, result) {
        const m = transformation.m;
        const rx = x * m[0] + y * m[4] + z * m[8] + m[12];
        const ry = x * m[1] + y * m[5] + z * m[9] + m[13];
        const rz = x * m[2] + y * m[6] + z * m[10] + m[14];
        const rw = 1 / (x * m[3] + y * m[7] + z * m[11] + m[15]);
        result._x = rx * rw;
        result._y = ry * rw;
        result._z = rz * rw;
        result._isDirty = true;
        return result;
    }
    /**
     * Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector
     * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#112
     * @param vector defines the Vector3 to transform
     * @param transformation defines the transformation matrix
     * @returns the new Vector3
     */
    static TransformNormal(vector, transformation) {
        const result = Vector3.Zero();
        Vector3.TransformNormalToRef(vector, transformation, result);
        return result;
    }
    /**
     * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector
     * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#114
     * @param vector defines the Vector3 to transform
     * @param transformation defines the transformation matrix
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static TransformNormalToRef(vector, transformation, result) {
        this.TransformNormalFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);
        return result;
    }
    /**
     * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z)
     * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
     * Example Playground https://playground.babylonjs.com/#R1F8YU#116
     * @param x define the x coordinate of the source vector
     * @param y define the y coordinate of the source vector
     * @param z define the z coordinate of the source vector
     * @param transformation defines the transformation matrix
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static TransformNormalFromFloatsToRef(x, y, z, transformation, result) {
        const m = transformation.m;
        result._x = x * m[0] + y * m[4] + z * m[8];
        result._y = x * m[1] + y * m[5] + z * m[9];
        result._z = x * m[2] + y * m[6] + z * m[10];
        result._isDirty = true;
        return result;
    }
    /**
     * Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#69
     * @param value1 defines the first control point
     * @param value2 defines the second control point
     * @param value3 defines the third control point
     * @param value4 defines the fourth control point
     * @param amount defines the amount on the spline to use
     * @returns the new Vector3
     */
    static CatmullRom(value1, value2, value3, value4, amount) {
        const squared = amount * amount;
        const cubed = amount * squared;
        const x = 0.5 *
            (2.0 * value2._x +
                (-value1._x + value3._x) * amount +
                (2.0 * value1._x - 5.0 * value2._x + 4.0 * value3._x - value4._x) * squared +
                (-value1._x + 3.0 * value2._x - 3.0 * value3._x + value4._x) * cubed);
        const y = 0.5 *
            (2.0 * value2._y +
                (-value1._y + value3._y) * amount +
                (2.0 * value1._y - 5.0 * value2._y + 4.0 * value3._y - value4._y) * squared +
                (-value1._y + 3.0 * value2._y - 3.0 * value3._y + value4._y) * cubed);
        const z = 0.5 *
            (2.0 * value2._z +
                (-value1._z + value3._z) * amount +
                (2.0 * value1._z - 5.0 * value2._z + 4.0 * value3._z - value4._z) * squared +
                (-value1._z + 3.0 * value2._z - 3.0 * value3._z + value4._z) * cubed);
        return new Vector3(x, y, z);
    }
    /**
     * Returns a new Vector3 set with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
     * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
     * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
     * Example Playground https://playground.babylonjs.com/#R1F8YU#76
     * @param value defines the current value
     * @param min defines the lower range value
     * @param max defines the upper range value
     * @returns the new Vector3
     */
    static Clamp(value, min, max) {
        const result = new Vector3();
        Vector3.ClampToRef(value, min, max, result);
        return result;
    }
    /**
     * Sets the given vector "result" with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
     * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
     * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
     * Example Playground https://playground.babylonjs.com/#R1F8YU#77
     * @param value defines the current value
     * @param min defines the lower range value
     * @param max defines the upper range value
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static ClampToRef(value, min, max, result) {
        let x = value._x;
        x = x > max._x ? max._x : x;
        x = x < min._x ? min._x : x;
        let y = value._y;
        y = y > max._y ? max._y : y;
        y = y < min._y ? min._y : y;
        let z = value._z;
        z = z > max._z ? max._z : z;
        z = z < min._z ? min._z : z;
        result.copyFromFloats(x, y, z);
        return result;
    }
    /**
     * Checks if a given vector is inside a specific range
     * Example Playground https://playground.babylonjs.com/#R1F8YU#75
     * @param v defines the vector to test
     * @param min defines the minimum range
     * @param max defines the maximum range
     */
    static CheckExtends(v, min, max) {
        min.minimizeInPlace(v);
        max.maximizeInPlace(v);
    }
    /**
     * Returns a new Vector3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#89
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent vector
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent vector
     * @param amount defines the amount on the interpolation spline (between 0 and 1)
     * @returns the new Vector3
     */
    static Hermite(value1, tangent1, value2, tangent2, amount) {
        const squared = amount * amount;
        const cubed = amount * squared;
        const part1 = 2.0 * cubed - 3.0 * squared + 1.0;
        const part2 = -2.0 * cubed + 3.0 * squared;
        const part3 = cubed - 2.0 * squared + amount;
        const part4 = cubed - squared;
        const x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4;
        const y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4;
        const z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4;
        return new Vector3(x, y, z);
    }
    /**
     * Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
     * Example Playground https://playground.babylonjs.com/#R1F8YU#90
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @returns 1st derivative
     */
    static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {
        const result = new Vector3();
        this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);
        return result;
    }
    /**
     * Update a Vector3 with the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
     * Example Playground https://playground.babylonjs.com/#R1F8YU#91
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @param result define where to store the derivative
     * @returns result input
     */
    static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {
        const t2 = time * time;
        result._x = (t2 - time) * 6 * value1._x + (3 * t2 - 4 * time + 1) * tangent1._x + (-t2 + time) * 6 * value2._x + (3 * t2 - 2 * time) * tangent2._x;
        result._y = (t2 - time) * 6 * value1._y + (3 * t2 - 4 * time + 1) * tangent1._y + (-t2 + time) * 6 * value2._y + (3 * t2 - 2 * time) * tangent2._y;
        result._z = (t2 - time) * 6 * value1._z + (3 * t2 - 4 * time + 1) * tangent1._z + (-t2 + time) * 6 * value2._z + (3 * t2 - 2 * time) * tangent2._z;
        result._isDirty = true;
        return result;
    }
    /**
     * Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#95
     * @param start defines the start value
     * @param end defines the end value
     * @param amount max defines amount between both (between 0 and 1)
     * @returns the new Vector3
     */
    static Lerp(start, end, amount) {
        const result = new Vector3(0, 0, 0);
        Vector3.LerpToRef(start, end, amount, result);
        return result;
    }
    /**
     * Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#93
     * @param start defines the start value
     * @param end defines the end value
     * @param amount max defines amount between both (between 0 and 1)
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static LerpToRef(start, end, amount, result) {
        result._x = start._x + (end._x - start._x) * amount;
        result._y = start._y + (end._y - start._y) * amount;
        result._z = start._z + (end._z - start._z) * amount;
        result._isDirty = true;
        return result;
    }
    /**
     * Returns the dot product (float) between the vectors "left" and "right"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#82
     * @param left defines the left operand
     * @param right defines the right operand
     * @returns the dot product
     */
    static Dot(left, right) {
        return left._x * right._x + left._y * right._y + left._z * right._z;
    }
    /**
     * Returns the dot product (float) between the current vectors and "otherVector"
     * @param otherVector defines the right operand
     * @returns the dot product
     */
    dot(otherVector) {
        return this._x * otherVector._x + this._y * otherVector._y + this._z * otherVector._z;
    }
    /**
     * Returns a new Vector3 as the cross product of the vectors "left" and "right"
     * The cross product is then orthogonal to both "left" and "right"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#15
     * @param left defines the left operand
     * @param right defines the right operand
     * @returns the cross product
     */
    static Cross(left, right) {
        const result = new Vector3();
        Vector3.CrossToRef(left, right, result);
        return result;
    }
    /**
     * Sets the given vector "result" with the cross product of "left" and "right"
     * The cross product is then orthogonal to both "left" and "right"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#78
     * @param left defines the left operand
     * @param right defines the right operand
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static CrossToRef(left, right, result) {
        const x = left._y * right._z - left._z * right._y;
        const y = left._z * right._x - left._x * right._z;
        const z = left._x * right._y - left._y * right._x;
        result.copyFromFloats(x, y, z);
        return result;
    }
    /**
     * Returns a new Vector3 as the normalization of the given vector
     * Example Playground https://playground.babylonjs.com/#R1F8YU#98
     * @param vector defines the Vector3 to normalize
     * @returns the new Vector3
     */
    static Normalize(vector) {
        const result = Vector3.Zero();
        Vector3.NormalizeToRef(vector, result);
        return result;
    }
    /**
     * Sets the given vector "result" with the normalization of the given first vector
     * Example Playground https://playground.babylonjs.com/#R1F8YU#98
     * @param vector defines the Vector3 to normalize
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static NormalizeToRef(vector, result) {
        vector.normalizeToRef(result);
        return result;
    }
    /**
     * Project a Vector3 onto screen space
     * Example Playground https://playground.babylonjs.com/#R1F8YU#101
     * @param vector defines the Vector3 to project
     * @param world defines the world matrix to use
     * @param transform defines the transform (view x projection) matrix to use
     * @param viewport defines the screen viewport to use
     * @returns the new Vector3
     */
    static Project(vector, world, transform, viewport) {
        const result = new Vector3();
        Vector3.ProjectToRef(vector, world, transform, viewport, result);
        return result;
    }
    /**
     * Project a Vector3 onto screen space to reference
     * Example Playground https://playground.babylonjs.com/#R1F8YU#102
     * @param vector defines the Vector3 to project
     * @param world defines the world matrix to use
     * @param transform defines the transform (view x projection) matrix to use
     * @param viewport defines the screen viewport to use
     * @param result the vector in which the screen space will be stored
     * @returns result input
     */
    static ProjectToRef(vector, world, transform, viewport, result) {
        const cw = viewport.width;
        const ch = viewport.height;
        const cx = viewport.x;
        const cy = viewport.y;
        const viewportMatrix = MathTmp.Matrix[1];
        const isNDCHalfZRange = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore */ .q.LastCreatedEngine?.isNDCHalfZRange;
        const zScale = isNDCHalfZRange ? 1 : 0.5;
        const zOffset = isNDCHalfZRange ? 0 : 0.5;
        Matrix.FromValuesToRef(cw / 2.0, 0, 0, 0, 0, -ch / 2.0, 0, 0, 0, 0, zScale, 0, cx + cw / 2.0, ch / 2.0 + cy, zOffset, 1, viewportMatrix);
        const matrix = MathTmp.Matrix[0];
        world.multiplyToRef(transform, matrix);
        matrix.multiplyToRef(viewportMatrix, matrix);
        Vector3.TransformCoordinatesToRef(vector, matrix, result);
        return result;
    }
    /**
     * Reflects a vector off the plane defined by a normalized normal
     * @param inDirection defines the vector direction
     * @param normal defines the normal - Must be normalized
     * @returns the resulting vector
     */
    static Reflect(inDirection, normal) {
        return this.ReflectToRef(inDirection, normal, new Vector3());
    }
    /**
     * Reflects a vector off the plane defined by a normalized normal to reference
     * @param inDirection defines the vector direction
     * @param normal defines the normal - Must be normalized
     * @param ref defines the Vector3 where to store the result
     * @returns the resulting vector
     */
    static ReflectToRef(inDirection, normal, ref) {
        const tmp = TmpVectors.Vector3[0];
        tmp.copyFrom(normal).scaleInPlace(2 * Vector3.Dot(inDirection, normal));
        return ref.copyFrom(inDirection).subtractInPlace(tmp);
    }
    /**
     * @internal
     */
    static _UnprojectFromInvertedMatrixToRef(source, matrix, result) {
        Vector3.TransformCoordinatesToRef(source, matrix, result);
        const m = matrix.m;
        const num = source._x * m[3] + source._y * m[7] + source._z * m[11] + m[15];
        if ((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(num, 1.0)) {
            result.scaleInPlace(1.0 / num);
        }
        return result;
    }
    /**
     * Unproject from screen space to object space
     * Example Playground https://playground.babylonjs.com/#R1F8YU#121
     * @param source defines the screen space Vector3 to use
     * @param viewportWidth defines the current width of the viewport
     * @param viewportHeight defines the current height of the viewport
     * @param world defines the world matrix to use (can be set to Identity to go to world space)
     * @param transform defines the transform (view x projection) matrix to use
     * @returns the new Vector3
     */
    static UnprojectFromTransform(source, viewportWidth, viewportHeight, world, transform) {
        return this.Unproject(source, viewportWidth, viewportHeight, world, transform, Matrix.IdentityReadOnly);
    }
    /**
     * Unproject from screen space to object space
     * Example Playground https://playground.babylonjs.com/#R1F8YU#117
     * @param source defines the screen space Vector3 to use
     * @param viewportWidth defines the current width of the viewport
     * @param viewportHeight defines the current height of the viewport
     * @param world defines the world matrix to use (can be set to Identity to go to world space)
     * @param view defines the view matrix to use
     * @param projection defines the projection matrix to use
     * @returns the new Vector3
     */
    static Unproject(source, viewportWidth, viewportHeight, world, view, projection) {
        const result = new Vector3();
        Vector3.UnprojectToRef(source, viewportWidth, viewportHeight, world, view, projection, result);
        return result;
    }
    /**
     * Unproject from screen space to object space
     * Example Playground https://playground.babylonjs.com/#R1F8YU#119
     * @param source defines the screen space Vector3 to use
     * @param viewportWidth defines the current width of the viewport
     * @param viewportHeight defines the current height of the viewport
     * @param world defines the world matrix to use (can be set to Identity to go to world space)
     * @param view defines the view matrix to use
     * @param projection defines the projection matrix to use
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static UnprojectToRef(source, viewportWidth, viewportHeight, world, view, projection, result) {
        Vector3.UnprojectFloatsToRef(source._x, source._y, source._z, viewportWidth, viewportHeight, world, view, projection, result);
        return result;
    }
    /**
     * Unproject from screen space to object space
     * Example Playground https://playground.babylonjs.com/#R1F8YU#120
     * @param sourceX defines the screen space x coordinate to use
     * @param sourceY defines the screen space y coordinate to use
     * @param sourceZ defines the screen space z coordinate to use
     * @param viewportWidth defines the current width of the viewport
     * @param viewportHeight defines the current height of the viewport
     * @param world defines the world matrix to use (can be set to Identity to go to world space)
     * @param view defines the view matrix to use
     * @param projection defines the projection matrix to use
     * @param result defines the Vector3 where to store the result
     * @returns result input
     */
    static UnprojectFloatsToRef(sourceX, sourceY, sourceZ, viewportWidth, viewportHeight, world, view, projection, result) {
        const matrix = MathTmp.Matrix[0];
        world.multiplyToRef(view, matrix);
        matrix.multiplyToRef(projection, matrix);
        matrix.invert();
        const screenSource = MathTmp.Vector3[0];
        screenSource.x = (sourceX / viewportWidth) * 2 - 1;
        screenSource.y = -((sourceY / viewportHeight) * 2 - 1);
        if (_Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore */ .q.LastCreatedEngine?.isNDCHalfZRange) {
            screenSource.z = sourceZ;
        }
        else {
            screenSource.z = 2 * sourceZ - 1.0;
        }
        Vector3._UnprojectFromInvertedMatrixToRef(screenSource, matrix, result);
        return result;
    }
    /**
     * Gets the minimal coordinate values between two Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#97
     * @param left defines the first operand
     * @param right defines the second operand
     * @returns the new Vector3
     */
    static Minimize(left, right) {
        const min = new Vector3();
        min.copyFrom(left);
        min.minimizeInPlace(right);
        return min;
    }
    /**
     * Gets the maximal coordinate values between two Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#96
     * @param left defines the first operand
     * @param right defines the second operand
     * @returns the new Vector3
     */
    static Maximize(left, right) {
        const max = new Vector3();
        max.copyFrom(left);
        max.maximizeInPlace(right);
        return max;
    }
    /**
     * Returns the distance between the vectors "value1" and "value2"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#81
     * @param value1 defines the first operand
     * @param value2 defines the second operand
     * @returns the distance
     */
    static Distance(value1, value2) {
        return Math.sqrt(Vector3.DistanceSquared(value1, value2));
    }
    /**
     * Returns the squared distance between the vectors "value1" and "value2"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#80
     * @param value1 defines the first operand
     * @param value2 defines the second operand
     * @returns the squared distance
     */
    static DistanceSquared(value1, value2) {
        const x = value1._x - value2._x;
        const y = value1._y - value2._y;
        const z = value1._z - value2._z;
        return x * x + y * y + z * z;
    }
    /**
     * Projects "vector" on the triangle determined by its extremities "p0", "p1" and "p2", stores the result in "ref"
     * and returns the distance to the projected point.
     * Example Playground https://playground.babylonjs.com/#R1F8YU#104
     * From http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.4264&rep=rep1&type=pdf
     *
     * @param vector the vector to get distance from
     * @param p0 extremity of the triangle
     * @param p1 extremity of the triangle
     * @param p2 extremity of the triangle
     * @param ref variable to store the result to
     * @returns The distance between "ref" and "vector"
     */
    static ProjectOnTriangleToRef(vector, p0, p1, p2, ref) {
        const p1p0 = MathTmp.Vector3[0];
        const p2p0 = MathTmp.Vector3[1];
        const p2p1 = MathTmp.Vector3[2];
        const normal = MathTmp.Vector3[3];
        const vectorp0 = MathTmp.Vector3[4];
        // Triangle vectors
        p1.subtractToRef(p0, p1p0);
        p2.subtractToRef(p0, p2p0);
        p2.subtractToRef(p1, p2p1);
        const p1p0L = p1p0.length();
        const p2p0L = p2p0.length();
        const p2p1L = p2p1.length();
        if (p1p0L < _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH || p2p0L < _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH || p2p1L < _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
            // This is a degenerate triangle. As we assume this is part of a non-degenerate mesh,
            // we will find a better intersection later.
            // Let's just return one of the extremities
            ref.copyFrom(p0);
            return Vector3.Distance(vector, p0);
        }
        // Compute normal and vector to p0
        vector.subtractToRef(p0, vectorp0);
        Vector3.CrossToRef(p1p0, p2p0, normal);
        const nl = normal.length();
        if (nl < _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
            // Extremities are aligned, we are back on the case of a degenerate triangle
            ref.copyFrom(p0);
            return Vector3.Distance(vector, p0);
        }
        normal.normalizeFromLength(nl);
        let l = vectorp0.length();
        if (l < _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
            // Vector is p0
            ref.copyFrom(p0);
            return 0;
        }
        vectorp0.normalizeFromLength(l);
        // Project to "proj" that lies on the triangle plane
        const cosA = Vector3.Dot(normal, vectorp0);
        const projVector = MathTmp.Vector3[5];
        const proj = MathTmp.Vector3[6];
        projVector.copyFrom(normal).scaleInPlace(-l * cosA);
        proj.copyFrom(vector).addInPlace(projVector);
        // Compute barycentric coordinates (v0, v1 and v2 are axis from barycenter to extremities)
        const v0 = MathTmp.Vector3[4];
        const v1 = MathTmp.Vector3[5];
        const v2 = MathTmp.Vector3[7];
        const tmp = MathTmp.Vector3[8];
        v0.copyFrom(p1p0).scaleInPlace(1 / p1p0L);
        tmp.copyFrom(p2p0).scaleInPlace(1 / p2p0L);
        v0.addInPlace(tmp).scaleInPlace(-1);
        v1.copyFrom(p1p0).scaleInPlace(-1 / p1p0L);
        tmp.copyFrom(p2p1).scaleInPlace(1 / p2p1L);
        v1.addInPlace(tmp).scaleInPlace(-1);
        v2.copyFrom(p2p1).scaleInPlace(-1 / p2p1L);
        tmp.copyFrom(p2p0).scaleInPlace(-1 / p2p0L);
        v2.addInPlace(tmp).scaleInPlace(-1);
        // Determines which edge of the triangle is closest to "proj"
        const projP = MathTmp.Vector3[9];
        let dot;
        projP.copyFrom(proj).subtractInPlace(p0);
        Vector3.CrossToRef(v0, projP, tmp);
        dot = Vector3.Dot(tmp, normal);
        const s0 = dot;
        projP.copyFrom(proj).subtractInPlace(p1);
        Vector3.CrossToRef(v1, projP, tmp);
        dot = Vector3.Dot(tmp, normal);
        const s1 = dot;
        projP.copyFrom(proj).subtractInPlace(p2);
        Vector3.CrossToRef(v2, projP, tmp);
        dot = Vector3.Dot(tmp, normal);
        const s2 = dot;
        const edge = MathTmp.Vector3[10];
        let e0, e1;
        if (s0 > 0 && s1 < 0) {
            edge.copyFrom(p1p0);
            e0 = p0;
            e1 = p1;
        }
        else if (s1 > 0 && s2 < 0) {
            edge.copyFrom(p2p1);
            e0 = p1;
            e1 = p2;
        }
        else {
            edge.copyFrom(p2p0).scaleInPlace(-1);
            e0 = p2;
            e1 = p0;
        }
        // Determines if "proj" lies inside the triangle
        const tmp2 = MathTmp.Vector3[9];
        const tmp3 = MathTmp.Vector3[4];
        e0.subtractToRef(proj, tmp);
        e1.subtractToRef(proj, tmp2);
        Vector3.CrossToRef(tmp, tmp2, tmp3);
        const isOutside = Vector3.Dot(tmp3, normal) < 0;
        // If inside, we already found the projected point, "proj"
        if (!isOutside) {
            ref.copyFrom(proj);
            return Math.abs(l * cosA);
        }
        // If outside, we find "triProj", the closest point from "proj" on the closest edge
        const r = MathTmp.Vector3[5];
        Vector3.CrossToRef(edge, tmp3, r);
        r.normalize();
        const e0proj = MathTmp.Vector3[9];
        e0proj.copyFrom(e0).subtractInPlace(proj);
        const e0projL = e0proj.length();
        if (e0projL < _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
            // Proj is e0
            ref.copyFrom(e0);
            return Vector3.Distance(vector, e0);
        }
        e0proj.normalizeFromLength(e0projL);
        const cosG = Vector3.Dot(r, e0proj);
        const triProj = MathTmp.Vector3[7];
        triProj.copyFrom(proj).addInPlace(r.scaleInPlace(e0projL * cosG));
        // Now we clamp "triProj" so it lies between e0 and e1
        tmp.copyFrom(triProj).subtractInPlace(e0);
        l = edge.length();
        edge.normalizeFromLength(l);
        let t = Vector3.Dot(tmp, edge) / Math.max(l, _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH);
        t = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(t, 0, 1);
        triProj.copyFrom(e0).addInPlace(edge.scaleInPlace(t * l));
        ref.copyFrom(triProj);
        return Vector3.Distance(vector, triProj);
    }
    /**
     * Returns a new Vector3 located at the center between "value1" and "value2"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#72
     * @param value1 defines the first operand
     * @param value2 defines the second operand
     * @returns the new Vector3
     */
    static Center(value1, value2) {
        return Vector3.CenterToRef(value1, value2, Vector3.Zero());
    }
    /**
     * Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
     * Example Playground https://playground.babylonjs.com/#R1F8YU#73
     * @param value1 defines first vector
     * @param value2 defines second vector
     * @param ref defines third vector
     * @returns ref
     */
    static CenterToRef(value1, value2, ref) {
        return ref.copyFromFloats((value1._x + value2._x) / 2, (value1._y + value2._y) / 2, (value1._z + value2._z) / 2);
    }
    /**
     * Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),
     * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply
     * to something in order to rotate it from its local system to the given target system
     * Note: axis1, axis2 and axis3 are normalized during this operation
     * Example Playground https://playground.babylonjs.com/#R1F8YU#106
     * @param axis1 defines the first axis
     * @param axis2 defines the second axis
     * @param axis3 defines the third axis
     * @returns a new Vector3
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/target_align
     */
    static RotationFromAxis(axis1, axis2, axis3) {
        const rotation = new Vector3();
        Vector3.RotationFromAxisToRef(axis1, axis2, axis3, rotation);
        return rotation;
    }
    /**
     * The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3
     * Example Playground https://playground.babylonjs.com/#R1F8YU#107
     * @param axis1 defines the first axis
     * @param axis2 defines the second axis
     * @param axis3 defines the third axis
     * @param ref defines the Vector3 where to store the result
     * @returns result input
     */
    static RotationFromAxisToRef(axis1, axis2, axis3, ref) {
        const quat = MathTmp.Quaternion[0];
        Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);
        quat.toEulerAnglesToRef(ref);
        return ref;
    }
}
/**
 * If the first vector is flagged with integers (as everything is 0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
 * If subsequent vectors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
 * and henceforth it will use floating-point representation for all Vector3 instances that it creates.
 * But the original Vector3 instances are unchanged and has a "deprecated map".
 * If we keep using the Vector3 instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
 */
Vector3._V8PerformanceHack = new Vector3(0.5, 0.5, 0.5);
Vector3._UpReadOnly = Vector3.Up();
Vector3._DownReadOnly = Vector3.Down();
Vector3._LeftHandedForwardReadOnly = Vector3.Forward(false);
Vector3._RightHandedForwardReadOnly = Vector3.Forward(true);
Vector3._LeftHandedBackwardReadOnly = Vector3.Backward(false);
Vector3._RightHandedBackwardReadOnly = Vector3.Backward(true);
Vector3._RightReadOnly = Vector3.Right();
Vector3._LeftReadOnly = Vector3.Left();
Vector3._ZeroReadOnly = Vector3.Zero();
Vector3._OneReadOnly = Vector3.One();
Vector3;
Object.defineProperties(Vector3.prototype, {
    dimension: { value: [3] },
    rank: { value: 1 },
});
/**
 * Vector4 class created for EulerAngle class conversion to Quaternion
 */
class Vector4 {
    /**
     * Creates a Vector4 object from the given floats.
     * @param x x value of the vector
     * @param y y value of the vector
     * @param z z value of the vector
     * @param w w value of the vector
     */
    constructor(
    /** [0] x value of the vector */
    x = 0, 
    /** [0] y value of the vector */
    y = 0, 
    /** [0] z value of the vector */
    z = 0, 
    /** [0] w value of the vector */
    w = 0) {
        this.x = x;
        this.y = y;
        this.z = z;
        this.w = w;
    }
    /**
     * Returns the string with the Vector4 coordinates.
     * @returns a string containing all the vector values
     */
    toString() {
        return `{X: ${this.x} Y: ${this.y} Z: ${this.z} W: ${this.w}}`;
    }
    /**
     * Returns the string "Vector4".
     * @returns "Vector4"
     */
    getClassName() {
        return "Vector4";
    }
    /**
     * Returns the Vector4 hash code.
     * @returns a unique hash code
     */
    getHashCode() {
        const x = _ExtractAsInt(this.x);
        const y = _ExtractAsInt(this.y);
        const z = _ExtractAsInt(this.z);
        const w = _ExtractAsInt(this.w);
        let hash = x;
        hash = (hash * 397) ^ y;
        hash = (hash * 397) ^ z;
        hash = (hash * 397) ^ w;
        return hash;
    }
    // Operators
    /**
     * Returns a new array populated with 4 elements : the Vector4 coordinates.
     * @returns the resulting array
     */
    asArray() {
        return [this.x, this.y, this.z, this.w];
    }
    /**
     * Populates the given array from the given index with the Vector4 coordinates.
     * @param array array to populate
     * @param index index of the array to start at (default: 0)
     * @returns the Vector4.
     */
    toArray(array, index) {
        if (index === undefined) {
            index = 0;
        }
        array[index] = this.x;
        array[index + 1] = this.y;
        array[index + 2] = this.z;
        array[index + 3] = this.w;
        return this;
    }
    /**
     * Update the current vector from an array
     * @param array defines the destination array
     * @param offset defines the offset in the destination array
     * @returns the current Vector3
     */
    fromArray(array, offset = 0) {
        Vector4.FromArrayToRef(array, offset, this);
        return this;
    }
    /**
     * Adds the given vector to the current Vector4.
     * @param otherVector the vector to add
     * @returns the updated Vector4.
     */
    addInPlace(otherVector) {
        this.x += otherVector.x;
        this.y += otherVector.y;
        this.z += otherVector.z;
        this.w += otherVector.w;
        return this;
    }
    /**
     * Adds the given coordinates to the current Vector4
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @param w defines the w coordinate of the operand
     * @returns the current updated Vector4
     */
    addInPlaceFromFloats(x, y, z, w) {
        this.x += x;
        this.y += y;
        this.z += z;
        this.w += w;
        return this;
    }
    /**
     * Returns a new Vector4 as the result of the addition of the current Vector4 and the given one.
     * @param otherVector the vector to add
     * @returns the resulting vector
     */
    add(otherVector) {
        return new Vector4(this.x + otherVector.x, this.y + otherVector.y, this.z + otherVector.z, this.w + otherVector.w);
    }
    /**
     * Updates the given vector "result" with the result of the addition of the current Vector4 and the given one.
     * @param otherVector the vector to add
     * @param result the vector to store the result
     * @returns result input
     */
    addToRef(otherVector, result) {
        result.x = this.x + otherVector.x;
        result.y = this.y + otherVector.y;
        result.z = this.z + otherVector.z;
        result.w = this.w + otherVector.w;
        return result;
    }
    /**
     * Subtract in place the given vector from the current Vector4.
     * @param otherVector the vector to subtract
     * @returns the updated Vector4.
     */
    subtractInPlace(otherVector) {
        this.x -= otherVector.x;
        this.y -= otherVector.y;
        this.z -= otherVector.z;
        this.w -= otherVector.w;
        return this;
    }
    /**
     * Returns a new Vector4 with the result of the subtraction of the given vector from the current Vector4.
     * @param otherVector the vector to add
     * @returns the new vector with the result
     */
    subtract(otherVector) {
        return new Vector4(this.x - otherVector.x, this.y - otherVector.y, this.z - otherVector.z, this.w - otherVector.w);
    }
    /**
     * Sets the given vector "result" with the result of the subtraction of the given vector from the current Vector4.
     * @param otherVector the vector to subtract
     * @param result the vector to store the result
     * @returns result input
     */
    subtractToRef(otherVector, result) {
        result.x = this.x - otherVector.x;
        result.y = this.y - otherVector.y;
        result.z = this.z - otherVector.z;
        result.w = this.w - otherVector.w;
        return result;
    }
    /**
     * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.
     * @param x value to subtract
     * @param y value to subtract
     * @param z value to subtract
     * @param w value to subtract
     * @returns new vector containing the result
     */
    subtractFromFloats(x, y, z, w) {
        return new Vector4(this.x - x, this.y - y, this.z - z, this.w - w);
    }
    /**
     * Sets the given vector "result" set with the result of the subtraction of the given floats from the current Vector4 coordinates.
     * @param x value to subtract
     * @param y value to subtract
     * @param z value to subtract
     * @param w value to subtract
     * @param result the vector to store the result in
     * @returns result input
     */
    subtractFromFloatsToRef(x, y, z, w, result) {
        result.x = this.x - x;
        result.y = this.y - y;
        result.z = this.z - z;
        result.w = this.w - w;
        return result;
    }
    /**
     * Returns a new Vector4 set with the current Vector4 negated coordinates.
     * @returns a new vector with the negated values
     */
    negate() {
        return new Vector4(-this.x, -this.y, -this.z, -this.w);
    }
    /**
     * Negate this vector in place
     * @returns this
     */
    negateInPlace() {
        this.x *= -1;
        this.y *= -1;
        this.z *= -1;
        this.w *= -1;
        return this;
    }
    /**
     * Negate the current Vector4 and stores the result in the given vector "result" coordinates
     * @param result defines the Vector3 object where to store the result
     * @returns the result
     */
    negateToRef(result) {
        result.x = -this.x;
        result.y = -this.y;
        result.z = -this.z;
        result.w = -this.w;
        return result;
    }
    /**
     * Multiplies the current Vector4 coordinates by scale (float).
     * @param scale the number to scale with
     * @returns the updated Vector4.
     */
    scaleInPlace(scale) {
        this.x *= scale;
        this.y *= scale;
        this.z *= scale;
        this.w *= scale;
        return this;
    }
    /**
     * Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float).
     * @param scale the number to scale with
     * @returns a new vector with the result
     */
    scale(scale) {
        return new Vector4(this.x * scale, this.y * scale, this.z * scale, this.w * scale);
    }
    /**
     * Sets the given vector "result" with the current Vector4 coordinates multiplied by scale (float).
     * @param scale the number to scale with
     * @param result a vector to store the result in
     * @returns result input
     */
    scaleToRef(scale, result) {
        result.x = this.x * scale;
        result.y = this.y * scale;
        result.z = this.z * scale;
        result.w = this.w * scale;
        return result;
    }
    /**
     * Scale the current Vector4 values by a factor and add the result to a given Vector4
     * @param scale defines the scale factor
     * @param result defines the Vector4 object where to store the result
     * @returns result input
     */
    scaleAndAddToRef(scale, result) {
        result.x += this.x * scale;
        result.y += this.y * scale;
        result.z += this.z * scale;
        result.w += this.w * scale;
        return result;
    }
    /**
     * Boolean : True if the current Vector4 coordinates are stricly equal to the given ones.
     * @param otherVector the vector to compare against
     * @returns true if they are equal
     */
    equals(otherVector) {
        return otherVector && this.x === otherVector.x && this.y === otherVector.y && this.z === otherVector.z && this.w === otherVector.w;
    }
    /**
     * Boolean : True if the current Vector4 coordinates are each beneath the distance "epsilon" from the given vector ones.
     * @param otherVector vector to compare against
     * @param epsilon (Default: very small number)
     * @returns true if they are equal
     */
    equalsWithEpsilon(otherVector, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
        return (otherVector &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this.x, otherVector.x, epsilon) &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this.y, otherVector.y, epsilon) &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this.z, otherVector.z, epsilon) &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this.w, otherVector.w, epsilon));
    }
    /**
     * Boolean : True if the given floats are strictly equal to the current Vector4 coordinates.
     * @param x x value to compare against
     * @param y y value to compare against
     * @param z z value to compare against
     * @param w w value to compare against
     * @returns true if equal
     */
    equalsToFloats(x, y, z, w) {
        return this.x === x && this.y === y && this.z === z && this.w === w;
    }
    /**
     * Multiplies in place the current Vector4 by the given one.
     * @param otherVector vector to multiple with
     * @returns the updated Vector4.
     */
    multiplyInPlace(otherVector) {
        this.x *= otherVector.x;
        this.y *= otherVector.y;
        this.z *= otherVector.z;
        this.w *= otherVector.w;
        return this;
    }
    /**
     * Returns a new Vector4 set with the multiplication result of the current Vector4 and the given one.
     * @param otherVector vector to multiple with
     * @returns resulting new vector
     */
    multiply(otherVector) {
        return new Vector4(this.x * otherVector.x, this.y * otherVector.y, this.z * otherVector.z, this.w * otherVector.w);
    }
    /**
     * Updates the given vector "result" with the multiplication result of the current Vector4 and the given one.
     * @param otherVector vector to multiple with
     * @param result vector to store the result
     * @returns result input
     */
    multiplyToRef(otherVector, result) {
        result.x = this.x * otherVector.x;
        result.y = this.y * otherVector.y;
        result.z = this.z * otherVector.z;
        result.w = this.w * otherVector.w;
        return result;
    }
    /**
     * Returns a new Vector4 set with the multiplication result of the given floats and the current Vector4 coordinates.
     * @param x x value multiply with
     * @param y y value multiply with
     * @param z z value multiply with
     * @param w w value multiply with
     * @returns resulting new vector
     */
    multiplyByFloats(x, y, z, w) {
        return new Vector4(this.x * x, this.y * y, this.z * z, this.w * w);
    }
    /**
     * Returns a new Vector4 set with the division result of the current Vector4 by the given one.
     * @param otherVector vector to devide with
     * @returns resulting new vector
     */
    divide(otherVector) {
        return new Vector4(this.x / otherVector.x, this.y / otherVector.y, this.z / otherVector.z, this.w / otherVector.w);
    }
    /**
     * Updates the given vector "result" with the division result of the current Vector4 by the given one.
     * @param otherVector vector to devide with
     * @param result vector to store the result
     * @returns result input
     */
    divideToRef(otherVector, result) {
        result.x = this.x / otherVector.x;
        result.y = this.y / otherVector.y;
        result.z = this.z / otherVector.z;
        result.w = this.w / otherVector.w;
        return result;
    }
    /**
     * Divides the current Vector3 coordinates by the given ones.
     * @param otherVector vector to devide with
     * @returns the updated Vector3.
     */
    divideInPlace(otherVector) {
        return this.divideToRef(otherVector, this);
    }
    /**
     * Updates the Vector4 coordinates with the minimum values between its own and the given vector ones
     * @param other defines the second operand
     * @returns the current updated Vector4
     */
    minimizeInPlace(other) {
        if (other.x < this.x) {
            this.x = other.x;
        }
        if (other.y < this.y) {
            this.y = other.y;
        }
        if (other.z < this.z) {
            this.z = other.z;
        }
        if (other.w < this.w) {
            this.w = other.w;
        }
        return this;
    }
    /**
     * Updates the Vector4 coordinates with the maximum values between its own and the given vector ones
     * @param other defines the second operand
     * @returns the current updated Vector4
     */
    maximizeInPlace(other) {
        if (other.x > this.x) {
            this.x = other.x;
        }
        if (other.y > this.y) {
            this.y = other.y;
        }
        if (other.z > this.z) {
            this.z = other.z;
        }
        if (other.w > this.w) {
            this.w = other.w;
        }
        return this;
    }
    /**
     * Updates the current Vector4 with the minimal coordinate values between its and the given coordinates
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @param w defines the w coordinate of the operand
     * @returns the current updated Vector4
     */
    minimizeInPlaceFromFloats(x, y, z, w) {
        this.x = Math.min(x, this.x);
        this.y = Math.min(y, this.y);
        this.z = Math.min(z, this.z);
        this.w = Math.min(w, this.w);
        return this;
    }
    /**
     * Updates the current Vector4 with the maximal coordinate values between its and the given coordinates.
     * @param x defines the x coordinate of the operand
     * @param y defines the y coordinate of the operand
     * @param z defines the z coordinate of the operand
     * @param w defines the w coordinate of the operand
     * @returns the current updated Vector4
     */
    maximizeInPlaceFromFloats(x, y, z, w) {
        this.x = Math.max(x, this.x);
        this.y = Math.max(y, this.y);
        this.z = Math.max(z, this.z);
        this.w = Math.max(w, this.w);
        return this;
    }
    /**
     * Gets the current Vector4's floored values and stores them in result
     * @param result the vector to store the result in
     * @returns the result vector
     */
    floorToRef(result) {
        result.x = Math.floor(this.x);
        result.y = Math.floor(this.y);
        result.z = Math.floor(this.z);
        result.w = Math.floor(this.w);
        return result;
    }
    /**
     * Gets a new Vector4 from current Vector4 floored values
     * @returns a new Vector4
     */
    floor() {
        return new Vector4(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));
    }
    /**
     * Gets the current Vector4's fractional values and stores them in result
     * @param result the vector to store the result in
     * @returns the result vector
     */
    fractToRef(result) {
        result.x = this.x - Math.floor(this.x);
        result.y = this.y - Math.floor(this.y);
        result.z = this.z - Math.floor(this.z);
        result.w = this.w - Math.floor(this.w);
        return result;
    }
    /**
     * Gets a new Vector4 from current Vector4 fractional values
     * @returns a new Vector4
     */
    fract() {
        return new Vector4(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w));
    }
    // Properties
    /**
     * Returns the Vector4 length (float).
     * @returns the length
     */
    length() {
        return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
    }
    /**
     * Returns the Vector4 squared length (float).
     * @returns the length squared
     */
    lengthSquared() {
        return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
    }
    // Methods
    /**
     * Normalizes in place the Vector4.
     * @returns the updated Vector4.
     */
    normalize() {
        return this.normalizeFromLength(this.length());
    }
    /**
     * Normalize the current Vector4 with the given input length.
     * Please note that this is an in place operation.
     * @param len the length of the vector
     * @returns the current updated Vector4
     */
    normalizeFromLength(len) {
        if (len === 0 || len === 1.0) {
            return this;
        }
        return this.scaleInPlace(1.0 / len);
    }
    /**
     * Normalize the current Vector4 to a new vector
     * @returns the new Vector4
     */
    normalizeToNew() {
        return this.normalizeToRef(new Vector4());
    }
    /**
     * Normalize the current Vector4 to the reference
     * @param reference define the Vector4 to update
     * @returns the updated Vector4
     */
    normalizeToRef(reference) {
        const len = this.length();
        if (len === 0 || len === 1.0) {
            reference.x = this.x;
            reference.y = this.y;
            reference.z = this.z;
            reference.w = this.w;
            return reference;
        }
        return this.scaleToRef(1.0 / len, reference);
    }
    /**
     * Returns a new Vector3 from the Vector4 (x, y, z) coordinates.
     * @returns this converted to a new vector3
     */
    toVector3() {
        return new Vector3(this.x, this.y, this.z);
    }
    /**
     * Returns a new Vector4 copied from the current one.
     * @returns the new cloned vector
     */
    clone() {
        return new Vector4(this.x, this.y, this.z, this.w);
    }
    /**
     * Updates the current Vector4 with the given one coordinates.
     * @param source the source vector to copy from
     * @returns the updated Vector4.
     */
    copyFrom(source) {
        this.x = source.x;
        this.y = source.y;
        this.z = source.z;
        this.w = source.w;
        return this;
    }
    /**
     * Updates the current Vector4 coordinates with the given floats.
     * @param x float to copy from
     * @param y float to copy from
     * @param z float to copy from
     * @param w float to copy from
     * @returns the updated Vector4.
     */
    copyFromFloats(x, y, z, w) {
        this.x = x;
        this.y = y;
        this.z = z;
        this.w = w;
        return this;
    }
    /**
     * Updates the current Vector4 coordinates with the given floats.
     * @param x float to set from
     * @param y float to set from
     * @param z float to set from
     * @param w float to set from
     * @returns the updated Vector4.
     */
    set(x, y, z, w) {
        return this.copyFromFloats(x, y, z, w);
    }
    /**
     * Copies the given float to the current Vector4 coordinates
     * @param v defines the x, y, z and w coordinates of the operand
     * @returns the current updated Vector4
     */
    setAll(v) {
        this.x = this.y = this.z = this.w = v;
        return this;
    }
    /**
     * Returns the dot product (float) between the current vectors and "otherVector"
     * @param otherVector defines the right operand
     * @returns the dot product
     */
    dot(otherVector) {
        return this.x * otherVector.x + this.y * otherVector.y + this.z * otherVector.z + this.w * otherVector.w;
    }
    // Statics
    /**
     * Returns a new Vector4 set from the starting index of the given array.
     * @param array the array to pull values from
     * @param offset the offset into the array to start at
     * @returns the new vector
     */
    static FromArray(array, offset) {
        if (!offset) {
            offset = 0;
        }
        return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);
    }
    /**
     * Updates the given vector "result" from the starting index of the given array.
     * @param array the array to pull values from
     * @param offset the offset into the array to start at
     * @param result the vector to store the result in
     * @returns result input
     */
    static FromArrayToRef(array, offset, result) {
        result.x = array[offset];
        result.y = array[offset + 1];
        result.z = array[offset + 2];
        result.w = array[offset + 3];
        return result;
    }
    /**
     * Updates the given vector "result" from the starting index of the given Float32Array.
     * @param array the array to pull values from
     * @param offset the offset into the array to start at
     * @param result the vector to store the result in
     * @returns result input
     */
    static FromFloatArrayToRef(array, offset, result) {
        Vector4.FromArrayToRef(array, offset, result);
        return result;
    }
    /**
     * Updates the given vector "result" coordinates from the given floats.
     * @param x float to set from
     * @param y float to set from
     * @param z float to set from
     * @param w float to set from
     * @param result the vector to the floats in
     * @returns result input
     */
    static FromFloatsToRef(x, y, z, w, result) {
        result.x = x;
        result.y = y;
        result.z = z;
        result.w = w;
        return result;
    }
    /**
     * Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0)
     * @returns the new vector
     */
    static Zero() {
        return new Vector4(0.0, 0.0, 0.0, 0.0);
    }
    /**
     * Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0)
     * @returns the new vector
     */
    static One() {
        return new Vector4(1.0, 1.0, 1.0, 1.0);
    }
    /**
     * Returns a new Vector4 with random values between min and max
     * @param min the minimum random value
     * @param max the maximum random value
     * @returns a Vector4 with random values between min and max
     */
    static Random(min = 0, max = 1) {
        return new Vector4((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max));
    }
    /**
     * Sets a Vector4 with random values between min and max
     * @param min the minimum random value
     * @param max the maximum random value
     * @param ref the ref to store the values in
     * @returns the ref with random values between min and max
     */
    static RandomToRef(min = 0, max = 1, ref) {
        ref.x = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max);
        ref.y = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max);
        ref.z = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max);
        ref.w = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max);
        return ref;
    }
    /**
     * Returns a new Vector4 set with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
     * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
     * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
     * @param value defines the current value
     * @param min defines the lower range value
     * @param max defines the upper range value
     * @returns the new Vector4
     */
    static Clamp(value, min, max) {
        return Vector4.ClampToRef(value, min, max, new Vector4());
    }
    /**
     * Sets the given vector "result" with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
     * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
     * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
     * @param value defines the current value
     * @param min defines the lower range value
     * @param max defines the upper range value
     * @param result defines the Vector4 where to store the result
     * @returns result input
     */
    static ClampToRef(value, min, max, result) {
        result.x = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.x, min.x, max.x);
        result.y = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.y, min.y, max.y);
        result.z = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.z, min.z, max.z);
        result.w = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.w, min.w, max.w);
        return result;
    }
    /**
     * Checks if a given vector is inside a specific range
     * Example Playground https://playground.babylonjs.com/#R1F8YU#75
     * @param v defines the vector to test
     * @param min defines the minimum range
     * @param max defines the maximum range
     */
    static CheckExtends(v, min, max) {
        min.minimizeInPlace(v);
        max.maximizeInPlace(v);
    }
    /**
     * Gets a zero Vector4 that must not be updated
     */
    static get ZeroReadOnly() {
        return Vector4._ZeroReadOnly;
    }
    /**
     * Returns a new normalized Vector4 from the given one.
     * @param vector the vector to normalize
     * @returns the vector
     */
    static Normalize(vector) {
        return Vector4.NormalizeToRef(vector, new Vector4());
    }
    /**
     * Updates the given vector "result" from the normalization of the given one.
     * @param vector the vector to normalize
     * @param result the vector to store the result in
     * @returns result input
     */
    static NormalizeToRef(vector, result) {
        vector.normalizeToRef(result);
        return result;
    }
    /**
     * Returns a vector with the minimum values from the left and right vectors
     * @param left left vector to minimize
     * @param right right vector to minimize
     * @returns a new vector with the minimum of the left and right vector values
     */
    static Minimize(left, right) {
        const min = new Vector4();
        min.copyFrom(left);
        min.minimizeInPlace(right);
        return min;
    }
    /**
     * Returns a vector with the maximum values from the left and right vectors
     * @param left left vector to maximize
     * @param right right vector to maximize
     * @returns a new vector with the maximum of the left and right vector values
     */
    static Maximize(left, right) {
        const max = new Vector4();
        max.copyFrom(left);
        max.maximizeInPlace(right);
        return max;
    }
    /**
     * Returns the distance (float) between the vectors "value1" and "value2".
     * @param value1 value to calulate the distance between
     * @param value2 value to calulate the distance between
     * @returns the distance between the two vectors
     */
    static Distance(value1, value2) {
        return Math.sqrt(Vector4.DistanceSquared(value1, value2));
    }
    /**
     * Returns the squared distance (float) between the vectors "value1" and "value2".
     * @param value1 value to calulate the distance between
     * @param value2 value to calulate the distance between
     * @returns the distance between the two vectors squared
     */
    static DistanceSquared(value1, value2) {
        const x = value1.x - value2.x;
        const y = value1.y - value2.y;
        const z = value1.z - value2.z;
        const w = value1.w - value2.w;
        return x * x + y * y + z * z + w * w;
    }
    /**
     * Returns a new Vector4 located at the center between the vectors "value1" and "value2".
     * @param value1 value to calulate the center between
     * @param value2 value to calulate the center between
     * @returns the center between the two vectors
     */
    static Center(value1, value2) {
        return Vector4.CenterToRef(value1, value2, new Vector4());
    }
    /**
     * Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
     * @param value1 defines first vector
     * @param value2 defines second vector
     * @param ref defines third vector
     * @returns ref
     */
    static CenterToRef(value1, value2, ref) {
        ref.x = (value1.x + value2.x) / 2;
        ref.y = (value1.y + value2.y) / 2;
        ref.z = (value1.z + value2.z) / 2;
        ref.w = (value1.w + value2.w) / 2;
        return ref;
    }
    /**
     * Returns a new Vector4 set with the result of the transformation by the given matrix of the given vector.
     * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
     * The difference with Vector3.TransformCoordinates is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead
     * @param vector defines the Vector3 to transform
     * @param transformation defines the transformation matrix
     * @returns the transformed Vector4
     */
    static TransformCoordinates(vector, transformation) {
        return Vector4.TransformCoordinatesToRef(vector, transformation, new Vector4());
    }
    /**
     * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
     * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
     * The difference with Vector3.TransformCoordinatesToRef is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead
     * @param vector defines the Vector3 to transform
     * @param transformation defines the transformation matrix
     * @param result defines the Vector4 where to store the result
     * @returns result input
     */
    static TransformCoordinatesToRef(vector, transformation, result) {
        Vector4.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);
        return result;
    }
    /**
     * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
     * This method computes tranformed coordinates only, not transformed direction vectors
     * The difference with Vector3.TransformCoordinatesFromFloatsToRef is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead
     * @param x define the x coordinate of the source vector
     * @param y define the y coordinate of the source vector
     * @param z define the z coordinate of the source vector
     * @param transformation defines the transformation matrix
     * @param result defines the Vector4 where to store the result
     * @returns result input
     */
    static TransformCoordinatesFromFloatsToRef(x, y, z, transformation, result) {
        const m = transformation.m;
        const rx = x * m[0] + y * m[4] + z * m[8] + m[12];
        const ry = x * m[1] + y * m[5] + z * m[9] + m[13];
        const rz = x * m[2] + y * m[6] + z * m[10] + m[14];
        const rw = x * m[3] + y * m[7] + z * m[11] + m[15];
        result.x = rx;
        result.y = ry;
        result.z = rz;
        result.w = rw;
        return result;
    }
    /**
     * Returns a new Vector4 set with the result of the normal transformation by the given matrix of the given vector.
     * This methods computes transformed normalized direction vectors only.
     * @param vector the vector to transform
     * @param transformation the transformation matrix to apply
     * @returns the new vector
     */
    static TransformNormal(vector, transformation) {
        return Vector4.TransformNormalToRef(vector, transformation, new Vector4());
    }
    /**
     * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector.
     * This methods computes transformed normalized direction vectors only.
     * @param vector the vector to transform
     * @param transformation the transformation matrix to apply
     * @param result the vector to store the result in
     * @returns result input
     */
    static TransformNormalToRef(vector, transformation, result) {
        const m = transformation.m;
        const x = vector.x * m[0] + vector.y * m[4] + vector.z * m[8];
        const y = vector.x * m[1] + vector.y * m[5] + vector.z * m[9];
        const z = vector.x * m[2] + vector.y * m[6] + vector.z * m[10];
        result.x = x;
        result.y = y;
        result.z = z;
        result.w = vector.w;
        return result;
    }
    /**
     * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z, w).
     * This methods computes transformed normalized direction vectors only.
     * @param x value to transform
     * @param y value to transform
     * @param z value to transform
     * @param w value to transform
     * @param transformation the transformation matrix to apply
     * @param result the vector to store the results in
     * @returns result input
     */
    static TransformNormalFromFloatsToRef(x, y, z, w, transformation, result) {
        const m = transformation.m;
        result.x = x * m[0] + y * m[4] + z * m[8];
        result.y = x * m[1] + y * m[5] + z * m[9];
        result.z = x * m[2] + y * m[6] + z * m[10];
        result.w = w;
        return result;
    }
    /**
     * Creates a new Vector4 from a Vector3
     * @param source defines the source data
     * @param w defines the 4th component (default is 0)
     * @returns a new Vector4
     */
    static FromVector3(source, w = 0) {
        return new Vector4(source._x, source._y, source._z, w);
    }
    /**
     * Returns the dot product (float) between the vectors "left" and "right"
     * @param left defines the left operand
     * @param right defines the right operand
     * @returns the dot product
     */
    static Dot(left, right) {
        return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;
    }
}
/**
 * If the first vector is flagged with integers (as everything is 0,0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
 * If subsequent vectors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
 * and henceforth it will use floating-point representation for all Vector4 instances that it creates.
 * But the original Vector4 instances are unchanged and has a "deprecated map".
 * If we keep using the Vector4 instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
 */
Vector4._V8PerformanceHack = new Vector4(0.5, 0.5, 0.5, 0.5);
Vector4._ZeroReadOnly = Vector4.Zero();
Vector4;
Object.defineProperties(Vector4.prototype, {
    dimension: { value: [4] },
    rank: { value: 1 },
});
/**
 * Class used to store quaternion data
 * Example Playground - Overview - https://playground.babylonjs.com/#L49EJ7#100
 * @see https://en.wikipedia.org/wiki/Quaternion
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms
 */
class Quaternion {
    /** Gets or sets the x coordinate */
    get x() {
        return this._x;
    }
    set x(value) {
        this._x = value;
        this._isDirty = true;
    }
    /** Gets or sets the y coordinate */
    get y() {
        return this._y;
    }
    set y(value) {
        this._y = value;
        this._isDirty = true;
    }
    /** Gets or sets the z coordinate */
    get z() {
        return this._z;
    }
    set z(value) {
        this._z = value;
        this._isDirty = true;
    }
    /** Gets or sets the w coordinate */
    get w() {
        return this._w;
    }
    set w(value) {
        this._w = value;
        this._isDirty = true;
    }
    /**
     * Creates a new Quaternion from the given floats
     * @param x defines the first component (0 by default)
     * @param y defines the second component (0 by default)
     * @param z defines the third component (0 by default)
     * @param w defines the fourth component (1.0 by default)
     */
    constructor(x = 0.0, y = 0.0, z = 0.0, w = 1.0) {
        /** @internal */
        this._isDirty = true;
        this._x = x;
        this._y = y;
        this._z = z;
        this._w = w;
    }
    /**
     * Gets a string representation for the current quaternion
     * @returns a string with the Quaternion coordinates
     */
    toString() {
        return `{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`;
    }
    /**
     * Gets the class name of the quaternion
     * @returns the string "Quaternion"
     */
    getClassName() {
        return "Quaternion";
    }
    /**
     * Gets a hash code for this quaternion
     * @returns the quaternion hash code
     */
    getHashCode() {
        const x = _ExtractAsInt(this._x);
        const y = _ExtractAsInt(this._y);
        const z = _ExtractAsInt(this._z);
        const w = _ExtractAsInt(this._w);
        let hash = x;
        hash = (hash * 397) ^ y;
        hash = (hash * 397) ^ z;
        hash = (hash * 397) ^ w;
        return hash;
    }
    /**
     * Copy the quaternion to an array
     * Example Playground https://playground.babylonjs.com/#L49EJ7#13
     * @returns a new array populated with 4 elements from the quaternion coordinates
     */
    asArray() {
        return [this._x, this._y, this._z, this._w];
    }
    /**
     * Stores from the starting index in the given array the Quaternion successive values
     * Example Playground https://playground.babylonjs.com/#L49EJ7#59
     * @param array defines the array where to store the x,y,z,w components
     * @param index defines an optional index in the target array to define where to start storing values
     * @returns the current Quaternion object
     */
    toArray(array, index = 0) {
        array[index] = this._x;
        array[index + 1] = this._y;
        array[index + 2] = this._z;
        array[index + 3] = this._w;
        return this;
    }
    fromArray(array, index = 0) {
        return Quaternion.FromArrayToRef(array, index, this);
    }
    /**
     * Check if two quaternions are equals
     * Example Playground https://playground.babylonjs.com/#L49EJ7#38
     * @param otherQuaternion defines the second operand
     * @returns true if the current quaternion and the given one coordinates are strictly equals
     */
    equals(otherQuaternion) {
        return otherQuaternion && this._x === otherQuaternion._x && this._y === otherQuaternion._y && this._z === otherQuaternion._z && this._w === otherQuaternion._w;
    }
    /**
     * Gets a boolean if two quaternions are equals (using an epsilon value)
     * Example Playground https://playground.babylonjs.com/#L49EJ7#37
     * @param otherQuaternion defines the other quaternion
     * @param epsilon defines the minimal distance to consider equality
     * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.
     */
    equalsWithEpsilon(otherQuaternion, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
        return (otherQuaternion &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this._x, otherQuaternion._x, epsilon) &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this._y, otherQuaternion._y, epsilon) &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this._z, otherQuaternion._z, epsilon) &&
            (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(this._w, otherQuaternion._w, epsilon));
    }
    /**
     * Clone the current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#12
     * @returns a new quaternion copied from the current one
     */
    clone() {
        return new Quaternion(this._x, this._y, this._z, this._w);
    }
    /**
     * Copy a quaternion to the current one
     * Example Playground https://playground.babylonjs.com/#L49EJ7#86
     * @param other defines the other quaternion
     * @returns the updated current quaternion
     */
    copyFrom(other) {
        this._x = other._x;
        this._y = other._y;
        this._z = other._z;
        this._w = other._w;
        this._isDirty = true;
        return this;
    }
    /**
     * Updates the current quaternion with the given float coordinates
     * Example Playground https://playground.babylonjs.com/#L49EJ7#87
     * @param x defines the x coordinate
     * @param y defines the y coordinate
     * @param z defines the z coordinate
     * @param w defines the w coordinate
     * @returns the updated current quaternion
     */
    copyFromFloats(x, y, z, w) {
        this._x = x;
        this._y = y;
        this._z = z;
        this._w = w;
        this._isDirty = true;
        return this;
    }
    /**
     * Updates the current quaternion from the given float coordinates
     * Example Playground https://playground.babylonjs.com/#L49EJ7#56
     * @param x defines the x coordinate
     * @param y defines the y coordinate
     * @param z defines the z coordinate
     * @param w defines the w coordinate
     * @returns the updated current quaternion
     */
    set(x, y, z, w) {
        return this.copyFromFloats(x, y, z, w);
    }
    setAll(value) {
        return this.copyFromFloats(value, value, value, value);
    }
    /**
     * Adds two quaternions
     * Example Playground https://playground.babylonjs.com/#L49EJ7#10
     * @param other defines the second operand
     * @returns a new quaternion as the addition result of the given one and the current quaternion
     */
    add(other) {
        return new Quaternion(this._x + other._x, this._y + other._y, this._z + other._z, this._w + other._w);
    }
    /**
     * Add a quaternion to the current one
     * Example Playground https://playground.babylonjs.com/#L49EJ7#11
     * @param other defines the quaternion to add
     * @returns the current quaternion
     */
    addInPlace(other) {
        this._x += other._x;
        this._y += other._y;
        this._z += other._z;
        this._w += other._w;
        this._isDirty = true;
        return this;
    }
    addToRef(other, result) {
        result._x = this._x + other._x;
        result._y = this._y + other._y;
        result._z = this._z + other._z;
        result._w = this._w + other._w;
        result._isDirty = true;
        return result;
    }
    addInPlaceFromFloats(x, y, z, w) {
        this._x += x;
        this._y += y;
        this._z += z;
        this._w += w;
        this._isDirty = true;
        return this;
    }
    subtractToRef(other, result) {
        result._x = this._x - other._x;
        result._y = this._y - other._y;
        result._z = this._z - other._z;
        result._w = this._w - other._w;
        result._isDirty = true;
        return result;
    }
    subtractFromFloats(x, y, z, w) {
        return this.subtractFromFloatsToRef(x, y, z, w, new Quaternion());
    }
    subtractFromFloatsToRef(x, y, z, w, result) {
        result._x = this._x - x;
        result._y = this._y - y;
        result._z = this._z - z;
        result._w = this._w - w;
        result._isDirty = true;
        return result;
    }
    /**
     * Subtract two quaternions
     * Example Playground https://playground.babylonjs.com/#L49EJ7#57
     * @param other defines the second operand
     * @returns a new quaternion as the subtraction result of the given one from the current one
     */
    subtract(other) {
        return new Quaternion(this._x - other._x, this._y - other._y, this._z - other._z, this._w - other._w);
    }
    /**
     * Subtract a quaternion to the current one
     * Example Playground https://playground.babylonjs.com/#L49EJ7#58
     * @param other defines the quaternion to subtract
     * @returns the current quaternion
     */
    subtractInPlace(other) {
        this._x -= other._x;
        this._y -= other._y;
        this._z -= other._z;
        this._w -= other._w;
        this._isDirty = true;
        return this;
    }
    /**
     * Multiplies the current quaternion by a scale factor
     * Example Playground https://playground.babylonjs.com/#L49EJ7#88
     * @param value defines the scale factor
     * @returns a new quaternion set by multiplying the current quaternion coordinates by the float "scale"
     */
    scale(value) {
        return new Quaternion(this._x * value, this._y * value, this._z * value, this._w * value);
    }
    /**
     * Scale the current quaternion values by a factor and stores the result to a given quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#89
     * @param scale defines the scale factor
     * @param result defines the Quaternion object where to store the result
     * @returns result input
     */
    scaleToRef(scale, result) {
        result._x = this._x * scale;
        result._y = this._y * scale;
        result._z = this._z * scale;
        result._w = this._w * scale;
        result._isDirty = true;
        return result;
    }
    /**
     * Multiplies in place the current quaternion by a scale factor
     * Example Playground https://playground.babylonjs.com/#L49EJ7#90
     * @param value defines the scale factor
     * @returns the current modified quaternion
     */
    scaleInPlace(value) {
        this._x *= value;
        this._y *= value;
        this._z *= value;
        this._w *= value;
        this._isDirty = true;
        return this;
    }
    /**
     * Scale the current quaternion values by a factor and add the result to a given quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#91
     * @param scale defines the scale factor
     * @param result defines the Quaternion object where to store the result
     * @returns result input
     */
    scaleAndAddToRef(scale, result) {
        result._x += this._x * scale;
        result._y += this._y * scale;
        result._z += this._z * scale;
        result._w += this._w * scale;
        result._isDirty = true;
        return result;
    }
    /**
     * Multiplies two quaternions
     * Example Playground https://playground.babylonjs.com/#L49EJ7#43
     * @param q1 defines the second operand
     * @returns a new quaternion set as the multiplication result of the current one with the given one "q1"
     */
    multiply(q1) {
        const result = new Quaternion(0, 0, 0, 1.0);
        this.multiplyToRef(q1, result);
        return result;
    }
    /**
     * Sets the given "result" as the multiplication result of the current one with the given one "q1"
     * Example Playground https://playground.babylonjs.com/#L49EJ7#45
     * @param q1 defines the second operand
     * @param result defines the target quaternion
     * @returns the current quaternion
     */
    multiplyToRef(q1, result) {
        const x = this._x * q1._w + this._y * q1._z - this._z * q1._y + this._w * q1._x;
        const y = -this._x * q1._z + this._y * q1._w + this._z * q1._x + this._w * q1._y;
        const z = this._x * q1._y - this._y * q1._x + this._z * q1._w + this._w * q1._z;
        const w = -this._x * q1._x - this._y * q1._y - this._z * q1._z + this._w * q1._w;
        result.copyFromFloats(x, y, z, w);
        return result;
    }
    /**
     * Updates the current quaternion with the multiplication of itself with the given one "q1"
     * Example Playground https://playground.babylonjs.com/#L49EJ7#46
     * @param other defines the second operand
     * @returns the currentupdated quaternion
     */
    multiplyInPlace(other) {
        return this.multiplyToRef(other, this);
    }
    multiplyByFloats(x, y, z, w) {
        this._x *= x;
        this._y *= y;
        this._z *= z;
        this._w *= w;
        this._isDirty = true;
        return this;
    }
    /**
     * @internal
     * Do not use
     */
    divide(_other) {
        throw new ReferenceError("Can not divide a quaternion");
    }
    /**
     * @internal
     * Do not use
     */
    divideToRef(_other, _result) {
        throw new ReferenceError("Can not divide a quaternion");
    }
    /**
     * @internal
     * Do not use
     */
    divideInPlace(_other) {
        throw new ReferenceError("Can not divide a quaternion");
    }
    /**
     * @internal
     * Do not use
     */
    minimizeInPlace() {
        throw new ReferenceError("Can not minimize a quaternion");
    }
    /**
     * @internal
     * Do not use
     */
    minimizeInPlaceFromFloats() {
        throw new ReferenceError("Can not minimize a quaternion");
    }
    /**
     * @internal
     * Do not use
     */
    maximizeInPlace() {
        throw new ReferenceError("Can not maximize a quaternion");
    }
    /**
     * @internal
     * Do not use
     */
    maximizeInPlaceFromFloats() {
        throw new ReferenceError("Can not maximize a quaternion");
    }
    negate() {
        return this.negateToRef(new Quaternion());
    }
    negateInPlace() {
        this._x = -this._x;
        this._y = -this._y;
        this._z = -this._z;
        this._w = -this._w;
        this._isDirty = true;
        return this;
    }
    negateToRef(result) {
        result._x = -this._x;
        result._y = -this._y;
        result._z = -this._z;
        result._w = -this._w;
        result._isDirty = true;
        return result;
    }
    equalsToFloats(x, y, z, w) {
        return this._x === x && this._y === y && this._z === z && this._w === w;
    }
    /**
     * @internal
     * Do not use
     */
    floorToRef(_result) {
        throw new ReferenceError("Can not floor a quaternion");
    }
    /**
     * @internal
     * Do not use
     */
    floor() {
        throw new ReferenceError("Can not floor a quaternion");
    }
    /**
     * @internal
     * Do not use
     */
    fractToRef(_result) {
        throw new ReferenceError("Can not fract a quaternion");
    }
    /**
     * @internal
     * Do not use
     */
    fract() {
        throw new ReferenceError("Can not fract a quaternion");
    }
    /**
     * Conjugates the current quaternion and stores the result in the given quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#81
     * @param ref defines the target quaternion
     * @returns result input
     */
    conjugateToRef(ref) {
        ref.copyFromFloats(-this._x, -this._y, -this._z, this._w);
        return ref;
    }
    /**
     * Conjugates in place the current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#82
     * @returns the current updated quaternion
     */
    conjugateInPlace() {
        this._x *= -1;
        this._y *= -1;
        this._z *= -1;
        this._isDirty = true;
        return this;
    }
    /**
     * Conjugates (1-q) the current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#83
     * @returns a new quaternion
     */
    conjugate() {
        return new Quaternion(-this._x, -this._y, -this._z, this._w);
    }
    /**
     * Returns the inverse of the current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#84
     * @returns a new quaternion
     */
    invert() {
        const conjugate = this.conjugate();
        const lengthSquared = this.lengthSquared();
        if (lengthSquared == 0 || lengthSquared == 1) {
            return conjugate;
        }
        conjugate.scaleInPlace(1 / lengthSquared);
        return conjugate;
    }
    /**
     * Invert in place the current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#85
     * @returns this quaternion
     */
    invertInPlace() {
        this.conjugateInPlace();
        const lengthSquared = this.lengthSquared();
        if (lengthSquared == 0 || lengthSquared == 1) {
            return this;
        }
        this.scaleInPlace(1 / lengthSquared);
        return this;
    }
    /**
     * Gets squared length of current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#29
     * @returns the quaternion length (float)
     */
    lengthSquared() {
        return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
    }
    /**
     * Gets length of current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#28
     * @returns the quaternion length (float)
     */
    length() {
        return Math.sqrt(this.lengthSquared());
    }
    /**
     * Normalize in place the current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#54
     * @returns the current updated quaternion
     */
    normalize() {
        return this.normalizeFromLength(this.length());
    }
    /**
     * Normalize the current quaternion with the given input length.
     * Please note that this is an in place operation.
     * @param len the length of the quaternion
     * @returns the current updated Quaternion
     */
    normalizeFromLength(len) {
        if (len === 0 || len === 1.0) {
            return this;
        }
        return this.scaleInPlace(1.0 / len);
    }
    /**
     * Normalize a copy of the current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#55
     * @returns the normalized quaternion
     */
    normalizeToNew() {
        const normalized = new Quaternion(0, 0, 0, 1);
        this.normalizeToRef(normalized);
        return normalized;
    }
    /**
     * Normalize the current Quaternion to the reference
     * @param reference define the Quaternion to update
     * @returns the updated Quaternion
     */
    normalizeToRef(reference) {
        const len = this.length();
        if (len === 0 || len === 1.0) {
            return reference.copyFromFloats(this._x, this._y, this._z, this._w);
        }
        return this.scaleToRef(1.0 / len, reference);
    }
    /**
     * Returns a new Vector3 set with the Euler angles translated from the current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#32
     * @returns a new Vector3 containing the Euler angles
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions
     */
    toEulerAngles() {
        const result = Vector3.Zero();
        this.toEulerAnglesToRef(result);
        return result;
    }
    /**
     * Sets the given vector3 "result" with the Euler angles translated from the current quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#31
     * @param result defines the vector which will be filled with the Euler angles
     * @returns result input
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions
     */
    toEulerAnglesToRef(result) {
        const qz = this._z;
        const qx = this._x;
        const qy = this._y;
        const qw = this._w;
        const zAxisY = qy * qz - qx * qw;
        const limit = 0.4999999;
        if (zAxisY < -limit) {
            result._y = 2 * Math.atan2(qy, qw);
            result._x = Math.PI / 2;
            result._z = 0;
            result._isDirty = true;
        }
        else if (zAxisY > limit) {
            result._y = 2 * Math.atan2(qy, qw);
            result._x = -Math.PI / 2;
            result._z = 0;
            result._isDirty = true;
        }
        else {
            const sqw = qw * qw;
            const sqz = qz * qz;
            const sqx = qx * qx;
            const sqy = qy * qy;
            result._z = Math.atan2(2.0 * (qx * qy + qz * qw), -sqz - sqx + sqy + sqw);
            result._x = Math.asin(-2.0 * zAxisY);
            result._y = Math.atan2(2.0 * (qz * qx + qy * qw), sqz - sqx - sqy + sqw);
            result._isDirty = true;
        }
        return result;
    }
    /**
     * Sets the given vector3 "result" with the Alpha, Beta, Gamma Euler angles translated from the current quaternion
     * @param result defines the vector which will be filled with the Euler angles
     * @returns result input
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions
     */
    toAlphaBetaGammaToRef(result) {
        const qz = this._z;
        const qx = this._x;
        const qy = this._y;
        const qw = this._w;
        // Compute intermediate values
        const sinHalfBeta = Math.sqrt(qx * qx + qy * qy);
        const cosHalfBeta = Math.sqrt(qz * qz + qw * qw);
        // Calculate beta
        const beta = 2 * Math.atan2(sinHalfBeta, cosHalfBeta);
        // Calculate gamma + alpha
        const gammaPlusAlpha = 2 * Math.atan2(qz, qw);
        // Calculate gamma - alpha
        const gammaMinusAlpha = 2 * Math.atan2(qy, qx);
        // Calculate gamma and alpha
        const gamma = (gammaPlusAlpha + gammaMinusAlpha) / 2;
        const alpha = (gammaPlusAlpha - gammaMinusAlpha) / 2;
        result.set(alpha, beta, gamma);
        return result;
    }
    /**
     * Updates the given rotation matrix with the current quaternion values
     * Example Playground https://playground.babylonjs.com/#L49EJ7#67
     * @param result defines the target matrix
     * @returns the updated matrix with the rotation
     */
    toRotationMatrix(result) {
        Matrix.FromQuaternionToRef(this, result);
        return result;
    }
    /**
     * Updates the current quaternion from the given rotation matrix values
     * Example Playground https://playground.babylonjs.com/#L49EJ7#41
     * @param matrix defines the source matrix
     * @returns the current updated quaternion
     */
    fromRotationMatrix(matrix) {
        Quaternion.FromRotationMatrixToRef(matrix, this);
        return this;
    }
    /**
     * Returns the dot product (float) between the current quaternions and "other"
     * @param other defines the right operand
     * @returns the dot product
     */
    dot(other) {
        return this._x * other._x + this._y * other._y + this._z * other._z + this._w * other._w;
    }
    // Statics
    /**
     * Creates a new quaternion from a rotation matrix
     * Example Playground https://playground.babylonjs.com/#L49EJ7#101
     * @param matrix defines the source matrix
     * @returns a new quaternion created from the given rotation matrix values
     */
    static FromRotationMatrix(matrix) {
        const result = new Quaternion();
        Quaternion.FromRotationMatrixToRef(matrix, result);
        return result;
    }
    /**
     * Updates the given quaternion with the given rotation matrix values
     * Example Playground https://playground.babylonjs.com/#L49EJ7#102
     * @param matrix defines the source matrix
     * @param result defines the target quaternion
     * @returns result input
     */
    static FromRotationMatrixToRef(matrix, result) {
        const data = matrix.m;
        const m11 = data[0], m12 = data[4], m13 = data[8];
        const m21 = data[1], m22 = data[5], m23 = data[9];
        const m31 = data[2], m32 = data[6], m33 = data[10];
        const trace = m11 + m22 + m33;
        let s;
        if (trace > 0) {
            s = 0.5 / Math.sqrt(trace + 1.0);
            result._w = 0.25 / s;
            result._x = (m32 - m23) * s;
            result._y = (m13 - m31) * s;
            result._z = (m21 - m12) * s;
            result._isDirty = true;
        }
        else if (m11 > m22 && m11 > m33) {
            s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);
            result._w = (m32 - m23) / s;
            result._x = 0.25 * s;
            result._y = (m12 + m21) / s;
            result._z = (m13 + m31) / s;
            result._isDirty = true;
        }
        else if (m22 > m33) {
            s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);
            result._w = (m13 - m31) / s;
            result._x = (m12 + m21) / s;
            result._y = 0.25 * s;
            result._z = (m23 + m32) / s;
            result._isDirty = true;
        }
        else {
            s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);
            result._w = (m21 - m12) / s;
            result._x = (m13 + m31) / s;
            result._y = (m23 + m32) / s;
            result._z = 0.25 * s;
            result._isDirty = true;
        }
        return result;
    }
    /**
     * Returns the dot product (float) between the quaternions "left" and "right"
     * Example Playground https://playground.babylonjs.com/#L49EJ7#61
     * @param left defines the left operand
     * @param right defines the right operand
     * @returns the dot product
     */
    static Dot(left, right) {
        return left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w;
    }
    /**
     * Checks if the orientations of two rotation quaternions are close to each other
     * Example Playground https://playground.babylonjs.com/#L49EJ7#60
     * @param quat0 defines the first quaternion to check
     * @param quat1 defines the second quaternion to check
     * @param epsilon defines closeness, 0 same orientation, 1 PI apart, default 0.1
     * @returns true if the two quaternions are close to each other within epsilon
     */
    static AreClose(quat0, quat1, epsilon = 0.1) {
        const dot = Quaternion.Dot(quat0, quat1);
        return 1 - dot * dot <= epsilon;
    }
    /**
     * Smooth interpolation between two quaternions using Slerp
     * Example Playground https://playground.babylonjs.com/#L49EJ7#93
     * @param source source quaternion
     * @param goal goal quaternion
     * @param deltaTime current interpolation frame
     * @param lerpTime total interpolation time
     * @param result the smoothed quaternion
     * @returns the smoothed quaternion
     */
    static SmoothToRef(source, goal, deltaTime, lerpTime, result) {
        let slerp = lerpTime === 0 ? 1 : deltaTime / lerpTime;
        slerp = (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(slerp, 0, 1);
        Quaternion.SlerpToRef(source, goal, slerp, result);
        return result;
    }
    /**
     * Creates an empty quaternion
     * @returns a new quaternion set to (0.0, 0.0, 0.0)
     */
    static Zero() {
        return new Quaternion(0.0, 0.0, 0.0, 0.0);
    }
    /**
     * Inverse a given quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#103
     * @param q defines the source quaternion
     * @returns a new quaternion as the inverted current quaternion
     */
    static Inverse(q) {
        return new Quaternion(-q._x, -q._y, -q._z, q._w);
    }
    /**
     * Inverse a given quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#104
     * @param q defines the source quaternion
     * @param result the quaternion the result will be stored in
     * @returns the result quaternion
     */
    static InverseToRef(q, result) {
        result.set(-q._x, -q._y, -q._z, q._w);
        return result;
    }
    /**
     * Creates an identity quaternion
     * @returns the identity quaternion
     */
    static Identity() {
        return new Quaternion(0.0, 0.0, 0.0, 1.0);
    }
    /**
     * Gets a boolean indicating if the given quaternion is identity
     * @param quaternion defines the quaternion to check
     * @returns true if the quaternion is identity
     */
    static IsIdentity(quaternion) {
        return quaternion && quaternion._x === 0 && quaternion._y === 0 && quaternion._z === 0 && quaternion._w === 1;
    }
    /**
     * Creates a quaternion from a rotation around an axis
     * Example Playground https://playground.babylonjs.com/#L49EJ7#72
     * @param axis defines the axis to use
     * @param angle defines the angle to use
     * @returns a new quaternion created from the given axis (Vector3) and angle in radians (float)
     */
    static RotationAxis(axis, angle) {
        return Quaternion.RotationAxisToRef(axis, angle, new Quaternion());
    }
    /**
     * Creates a rotation around an axis and stores it into the given quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#73
     * @param axis defines the axis to use
     * @param angle defines the angle to use
     * @param result defines the target quaternion
     * @returns the target quaternion
     */
    static RotationAxisToRef(axis, angle, result) {
        result._w = Math.cos(angle / 2);
        const sinByLength = Math.sin(angle / 2) / axis.length();
        result._x = axis._x * sinByLength;
        result._y = axis._y * sinByLength;
        result._z = axis._z * sinByLength;
        result._isDirty = true;
        return result;
    }
    /**
     * Creates a new quaternion from data stored into an array
     * Example Playground https://playground.babylonjs.com/#L49EJ7#63
     * @param array defines the data source
     * @param offset defines the offset in the source array where the data starts
     * @returns a new quaternion
     */
    static FromArray(array, offset) {
        if (!offset) {
            offset = 0;
        }
        return new Quaternion(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);
    }
    /**
     * Updates the given quaternion "result" from the starting index of the given array.
     * Example Playground https://playground.babylonjs.com/#L49EJ7#64
     * @param array the array to pull values from
     * @param offset the offset into the array to start at
     * @param result the quaternion to store the result in
     * @returns result input
     */
    static FromArrayToRef(array, offset, result) {
        result._x = array[offset];
        result._y = array[offset + 1];
        result._z = array[offset + 2];
        result._w = array[offset + 3];
        result._isDirty = true;
        return result;
    }
    /**
     * Sets the given quaternion "result" with the given floats.
     * @param x defines the x coordinate of the source
     * @param y defines the y coordinate of the source
     * @param z defines the z coordinate of the source
     * @param w defines the w coordinate of the source
     * @param result defines the quaternion where to store the result
     * @returns the result quaternion
     */
    static FromFloatsToRef(x, y, z, w, result) {
        result.copyFromFloats(x, y, z, w);
        return result;
    }
    /**
     * Create a quaternion from Euler rotation angles
     * Example Playground https://playground.babylonjs.com/#L49EJ7#33
     * @param x Pitch
     * @param y Yaw
     * @param z Roll
     * @returns the new Quaternion
     */
    static FromEulerAngles(x, y, z) {
        const q = new Quaternion();
        Quaternion.RotationYawPitchRollToRef(y, x, z, q);
        return q;
    }
    /**
     * Updates a quaternion from Euler rotation angles
     * Example Playground https://playground.babylonjs.com/#L49EJ7#34
     * @param x Pitch
     * @param y Yaw
     * @param z Roll
     * @param result the quaternion to store the result
     * @returns the updated quaternion
     */
    static FromEulerAnglesToRef(x, y, z, result) {
        Quaternion.RotationYawPitchRollToRef(y, x, z, result);
        return result;
    }
    /**
     * Create a quaternion from Euler rotation vector
     * Example Playground https://playground.babylonjs.com/#L49EJ7#35
     * @param vec the Euler vector (x Pitch, y Yaw, z Roll)
     * @returns the new Quaternion
     */
    static FromEulerVector(vec) {
        const q = new Quaternion();
        Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, q);
        return q;
    }
    /**
     * Updates a quaternion from Euler rotation vector
     * Example Playground https://playground.babylonjs.com/#L49EJ7#36
     * @param vec the Euler vector (x Pitch, y Yaw, z Roll)
     * @param result the quaternion to store the result
     * @returns the updated quaternion
     */
    static FromEulerVectorToRef(vec, result) {
        Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, result);
        return result;
    }
    /**
     * Updates a quaternion so that it rotates vector vecFrom to vector vecTo
     * Example Playground - https://playground.babylonjs.com/#L49EJ7#70
     * @param vecFrom defines the direction vector from which to rotate
     * @param vecTo defines the direction vector to which to rotate
     * @param result the quaternion to store the result
     * @param epsilon defines the minimal dot value to define vecs as opposite. Default: `BABYLON.Epsilon`
     * @returns the updated quaternion
     */
    static FromUnitVectorsToRef(vecFrom, vecTo, result, epsilon = _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
        const r = Vector3.Dot(vecFrom, vecTo) + 1;
        if (r < epsilon) {
            if (Math.abs(vecFrom.x) > Math.abs(vecFrom.z)) {
                result.set(-vecFrom.y, vecFrom.x, 0, 0);
            }
            else {
                result.set(0, -vecFrom.z, vecFrom.y, 0);
            }
        }
        else {
            Vector3.CrossToRef(vecFrom, vecTo, TmpVectors.Vector3[0]);
            result.set(TmpVectors.Vector3[0].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[0].z, r);
        }
        return result.normalize();
    }
    /**
     * Creates a new quaternion from the given Euler float angles (y, x, z)
     * Example Playground https://playground.babylonjs.com/#L49EJ7#77
     * @param yaw defines the rotation around Y axis
     * @param pitch defines the rotation around X axis
     * @param roll defines the rotation around Z axis
     * @returns the new quaternion
     */
    static RotationYawPitchRoll(yaw, pitch, roll) {
        const q = new Quaternion();
        Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, q);
        return q;
    }
    /**
     * Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#78
     * @param yaw defines the rotation around Y axis
     * @param pitch defines the rotation around X axis
     * @param roll defines the rotation around Z axis
     * @param result defines the target quaternion
     * @returns result input
     */
    static RotationYawPitchRollToRef(yaw, pitch, roll, result) {
        // Produces a quaternion from Euler angles in the z-y-x orientation (Tait-Bryan angles)
        const halfRoll = roll * 0.5;
        const halfPitch = pitch * 0.5;
        const halfYaw = yaw * 0.5;
        const sinRoll = Math.sin(halfRoll);
        const cosRoll = Math.cos(halfRoll);
        const sinPitch = Math.sin(halfPitch);
        const cosPitch = Math.cos(halfPitch);
        const sinYaw = Math.sin(halfYaw);
        const cosYaw = Math.cos(halfYaw);
        result._x = cosYaw * sinPitch * cosRoll + sinYaw * cosPitch * sinRoll;
        result._y = sinYaw * cosPitch * cosRoll - cosYaw * sinPitch * sinRoll;
        result._z = cosYaw * cosPitch * sinRoll - sinYaw * sinPitch * cosRoll;
        result._w = cosYaw * cosPitch * cosRoll + sinYaw * sinPitch * sinRoll;
        result._isDirty = true;
        return result;
    }
    /**
     * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation
     * Example Playground https://playground.babylonjs.com/#L49EJ7#68
     * @param alpha defines the rotation around first axis
     * @param beta defines the rotation around second axis
     * @param gamma defines the rotation around third axis
     * @returns the new quaternion
     */
    static RotationAlphaBetaGamma(alpha, beta, gamma) {
        const result = new Quaternion();
        Quaternion.RotationAlphaBetaGammaToRef(alpha, beta, gamma, result);
        return result;
    }
    /**
     * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation and stores it in the target quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#69
     * @param alpha defines the rotation around first axis
     * @param beta defines the rotation around second axis
     * @param gamma defines the rotation around third axis
     * @param result defines the target quaternion
     * @returns result input
     */
    static RotationAlphaBetaGammaToRef(alpha, beta, gamma, result) {
        // Produces a quaternion from Euler angles in the z-x-z orientation
        const halfGammaPlusAlpha = (gamma + alpha) * 0.5;
        const halfGammaMinusAlpha = (gamma - alpha) * 0.5;
        const halfBeta = beta * 0.5;
        result._x = Math.cos(halfGammaMinusAlpha) * Math.sin(halfBeta);
        result._y = Math.sin(halfGammaMinusAlpha) * Math.sin(halfBeta);
        result._z = Math.sin(halfGammaPlusAlpha) * Math.cos(halfBeta);
        result._w = Math.cos(halfGammaPlusAlpha) * Math.cos(halfBeta);
        result._isDirty = true;
        return result;
    }
    /**
     * Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation)
     * Example Playground https://playground.babylonjs.com/#L49EJ7#75
     * @param axis1 defines the first axis
     * @param axis2 defines the second axis
     * @param axis3 defines the third axis
     * @returns the new quaternion
     */
    static RotationQuaternionFromAxis(axis1, axis2, axis3) {
        const quat = new Quaternion(0.0, 0.0, 0.0, 0.0);
        Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);
        return quat;
    }
    /**
     * Creates a rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) and stores it in the target quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#76
     * @param axis1 defines the first axis
     * @param axis2 defines the second axis
     * @param axis3 defines the third axis
     * @param ref defines the target quaternion
     * @returns result input
     */
    static RotationQuaternionFromAxisToRef(axis1, axis2, axis3, ref) {
        const rotMat = MathTmp.Matrix[0];
        axis1 = axis1.normalizeToRef(MathTmp.Vector3[0]);
        axis2 = axis2.normalizeToRef(MathTmp.Vector3[1]);
        axis3 = axis3.normalizeToRef(MathTmp.Vector3[2]);
        Matrix.FromXYZAxesToRef(axis1, axis2, axis3, rotMat);
        Quaternion.FromRotationMatrixToRef(rotMat, ref);
        return ref;
    }
    /**
     * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up".
     * This function works in left handed mode
     * Example Playground https://playground.babylonjs.com/#L49EJ7#96
     * @param forward defines the forward direction - Must be normalized and orthogonal to up.
     * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
     * @returns A new quaternion oriented toward the specified forward and up.
     */
    static FromLookDirectionLH(forward, up) {
        const quat = new Quaternion();
        Quaternion.FromLookDirectionLHToRef(forward, up, quat);
        return quat;
    }
    /**
     * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion.
     * This function works in left handed mode
     * Example Playground https://playground.babylonjs.com/#L49EJ7#97
     * @param forward defines the forward direction - Must be normalized and orthogonal to up.
     * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
     * @param ref defines the target quaternion.
     * @returns result input
     */
    static FromLookDirectionLHToRef(forward, up, ref) {
        const rotMat = MathTmp.Matrix[0];
        Matrix.LookDirectionLHToRef(forward, up, rotMat);
        Quaternion.FromRotationMatrixToRef(rotMat, ref);
        return ref;
    }
    /**
     * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up".
     * This function works in right handed mode
     * Example Playground https://playground.babylonjs.com/#L49EJ7#98
     * @param forward defines the forward direction - Must be normalized and orthogonal to up.
     * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
     * @returns A new quaternion oriented toward the specified forward and up.
     */
    static FromLookDirectionRH(forward, up) {
        const quat = new Quaternion();
        Quaternion.FromLookDirectionRHToRef(forward, up, quat);
        return quat;
    }
    /**
     * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion.
     * This function works in right handed mode
     * Example Playground https://playground.babylonjs.com/#L49EJ7#105
     * @param forward defines the forward direction - Must be normalized and orthogonal to up.
     * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
     * @param ref defines the target quaternion.
     * @returns result input
     */
    static FromLookDirectionRHToRef(forward, up, ref) {
        const rotMat = MathTmp.Matrix[0];
        Matrix.LookDirectionRHToRef(forward, up, rotMat);
        return Quaternion.FromRotationMatrixToRef(rotMat, ref);
    }
    /**
     * Interpolates between two quaternions
     * Example Playground https://playground.babylonjs.com/#L49EJ7#79
     * @param left defines first quaternion
     * @param right defines second quaternion
     * @param amount defines the gradient to use
     * @returns the new interpolated quaternion
     */
    static Slerp(left, right, amount) {
        const result = Quaternion.Identity();
        Quaternion.SlerpToRef(left, right, amount, result);
        return result;
    }
    /**
     * Interpolates between two quaternions and stores it into a target quaternion
     * Example Playground https://playground.babylonjs.com/#L49EJ7#92
     * @param left defines first quaternion
     * @param right defines second quaternion
     * @param amount defines the gradient to use
     * @param result defines the target quaternion
     * @returns result input
     */
    static SlerpToRef(left, right, amount, result) {
        let num2;
        let num3;
        let num4 = left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w;
        let flag = false;
        if (num4 < 0) {
            flag = true;
            num4 = -num4;
        }
        if (num4 > 0.999999) {
            num3 = 1 - amount;
            num2 = flag ? -amount : amount;
        }
        else {
            const num5 = Math.acos(num4);
            const num6 = 1.0 / Math.sin(num5);
            num3 = Math.sin((1.0 - amount) * num5) * num6;
            num2 = flag ? -Math.sin(amount * num5) * num6 : Math.sin(amount * num5) * num6;
        }
        result._x = num3 * left._x + num2 * right._x;
        result._y = num3 * left._y + num2 * right._y;
        result._z = num3 * left._z + num2 * right._z;
        result._w = num3 * left._w + num2 * right._w;
        result._isDirty = true;
        return result;
    }
    /**
     * Interpolate between two quaternions using Hermite interpolation
     * Example Playground https://playground.babylonjs.com/#L49EJ7#47
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#hermite-quaternion-spline
     * @param value1 defines first quaternion
     * @param tangent1 defines the incoming tangent
     * @param value2 defines second quaternion
     * @param tangent2 defines the outgoing tangent
     * @param amount defines the target quaternion
     * @returns the new interpolated quaternion
     */
    static Hermite(value1, tangent1, value2, tangent2, amount) {
        const squared = amount * amount;
        const cubed = amount * squared;
        const part1 = 2.0 * cubed - 3.0 * squared + 1.0;
        const part2 = -2.0 * cubed + 3.0 * squared;
        const part3 = cubed - 2.0 * squared + amount;
        const part4 = cubed - squared;
        const x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4;
        const y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4;
        const z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4;
        const w = value1._w * part1 + value2._w * part2 + tangent1._w * part3 + tangent2._w * part4;
        return new Quaternion(x, y, z, w);
    }
    /**
     * Returns a new Quaternion which is the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2".
     * Example Playground https://playground.babylonjs.com/#L49EJ7#48
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @returns 1st derivative
     */
    static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {
        const result = new Quaternion();
        this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);
        return result;
    }
    /**
     * Update a Quaternion with the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2".
     * Example Playground https://playground.babylonjs.com/#L49EJ7#49
     * @param value1 defines the first control point
     * @param tangent1 defines the first tangent
     * @param value2 defines the second control point
     * @param tangent2 defines the second tangent
     * @param time define where the derivative must be done
     * @param result define where to store the derivative
     * @returns result input
     */
    static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {
        const t2 = time * time;
        result._x = (t2 - time) * 6 * value1._x + (3 * t2 - 4 * time + 1) * tangent1._x + (-t2 + time) * 6 * value2._x + (3 * t2 - 2 * time) * tangent2._x;
        result._y = (t2 - time) * 6 * value1._y + (3 * t2 - 4 * time + 1) * tangent1._y + (-t2 + time) * 6 * value2._y + (3 * t2 - 2 * time) * tangent2._y;
        result._z = (t2 - time) * 6 * value1._z + (3 * t2 - 4 * time + 1) * tangent1._z + (-t2 + time) * 6 * value2._z + (3 * t2 - 2 * time) * tangent2._z;
        result._w = (t2 - time) * 6 * value1._w + (3 * t2 - 4 * time + 1) * tangent1._w + (-t2 + time) * 6 * value2._w + (3 * t2 - 2 * time) * tangent2._w;
        result._isDirty = true;
        return result;
    }
    /**
     * Returns a new Quaternion as the normalization of the given Quaternion
     * @param quat defines the Quaternion to normalize
     * @returns the new Quaternion
     */
    static Normalize(quat) {
        const result = Quaternion.Zero();
        Quaternion.NormalizeToRef(quat, result);
        return result;
    }
    /**
     * Sets the given Quaternion "result" with the normalization of the given first Quaternion
     * @param quat defines the Quaternion to normalize
     * @param result defines the Quaternion where to store the result
     * @returns result input
     */
    static NormalizeToRef(quat, result) {
        quat.normalizeToRef(result);
        return result;
    }
    /**
     * Returns a new Quaternion set with the coordinates of "value", if the quaternion "value" is in the cube defined by the quaternions "min" and "max"
     * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
     * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
     * @param value defines the current value
     * @param min defines the lower range value
     * @param max defines the upper range value
     * @returns the new Quaternion
     */
    static Clamp(value, min, max) {
        const result = new Quaternion();
        Quaternion.ClampToRef(value, min, max, result);
        return result;
    }
    /**
     * Sets the given quaternion "result" with the coordinates of "value", if the quaternion "value" is in the cube defined by the quaternions "min" and "max"
     * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
     * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
     * @param value defines the current value
     * @param min defines the lower range value
     * @param max defines the upper range value
     * @param result defines the Quaternion where to store the result
     * @returns result input
     */
    static ClampToRef(value, min, max, result) {
        return result.copyFromFloats((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.x, min.x, max.x), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.y, min.y, max.y), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.z, min.z, max.z), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.Clamp)(value.w, min.w, max.w));
    }
    /**
     * Returns a new Quaternion with random values between min and max
     * @param min the minimum random value
     * @param max the maximum random value
     * @returns a Quaternion with random values between min and max
     */
    static Random(min = 0, max = 1) {
        return new Quaternion((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max));
    }
    /**
     * Sets a Quaternion with random values between min and max
     * @param min the minimum random value
     * @param max the maximum random value
     * @param ref the ref to store the values in
     * @returns the ref with random values between min and max
     */
    static RandomToRef(min = 0, max = 1, ref) {
        return ref.copyFromFloats((0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max), (0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.RandomRange)(min, max));
    }
    /**
     * Do not use
     * @internal
     */
    static Minimize() {
        throw new ReferenceError("Quaternion.Minimize does not make sense");
    }
    /**
     * Do not use
     * @internal
     */
    static Maximize() {
        throw new ReferenceError("Quaternion.Maximize does not make sense");
    }
    /**
     * Returns the distance (float) between the quaternions "value1" and "value2".
     * @param value1 value to calulate the distance between
     * @param value2 value to calulate the distance between
     * @returns the distance between the two quaternions
     */
    static Distance(value1, value2) {
        return Math.sqrt(Quaternion.DistanceSquared(value1, value2));
    }
    /**
     * Returns the squared distance (float) between the quaternions "value1" and "value2".
     * @param value1 value to calulate the distance between
     * @param value2 value to calulate the distance between
     * @returns the distance between the two quaternions squared
     */
    static DistanceSquared(value1, value2) {
        const x = value1.x - value2.x;
        const y = value1.y - value2.y;
        const z = value1.z - value2.z;
        const w = value1.w - value2.w;
        return x * x + y * y + z * z + w * w;
    }
    /**
     * Returns a new Quaternion located at the center between the quaternions "value1" and "value2".
     * @param value1 value to calulate the center between
     * @param value2 value to calulate the center between
     * @returns the center between the two quaternions
     */
    static Center(value1, value2) {
        return Quaternion.CenterToRef(value1, value2, Quaternion.Zero());
    }
    /**
     * Gets the center of the quaternions "value1" and "value2" and stores the result in the quaternion "ref"
     * @param value1 defines first quaternion
     * @param value2 defines second quaternion
     * @param ref defines third quaternion
     * @returns ref
     */
    static CenterToRef(value1, value2, ref) {
        return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2, (value1.z + value2.z) / 2, (value1.w + value2.w) / 2);
    }
}
/**
 * If the first quaternion is flagged with integers (as everything is 0,0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
 * If subsequent quaternion are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
 * and henceforth it will use floating-point representation for all quaternion instances that it creates.
 * But the original quaternion instances are unchanged and has a "deprecated map".
 * If we keep using the quaternion instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
 */
Quaternion._V8PerformanceHack = new Quaternion(0.5, 0.5, 0.5, 0.5);
Quaternion;
Object.defineProperties(Quaternion.prototype, {
    dimension: { value: [4] },
    rank: { value: 1 },
});
/**
 * Class used to store matrix data (4x4)
 * Note on matrix definitions in Babylon.js for setting values directly
 * rather than using one of the methods available.
 * Matrix size is given by rows x columns.
 * A Vector3 is a 1 X 3 matrix [x, y, z].
 *
 * In Babylon.js multiplying a 1 x 3 matrix by a 4 x 4 matrix
 * is done using BABYLON.Vector4.TransformCoordinates(Vector3, Matrix).
 * and extending the passed Vector3 to a Vector4, V = [x, y, z, 1].
 * Let M be a matrix with elements m(row, column), so that
 * m(2, 3) is the element in row 2 column 3 of M.
 *
 * Multiplication is of the form VM and has the resulting Vector4
 * VM = [xm(0, 0) + ym(1, 0) + zm(2, 0) + m(3, 0), xm(0, 1) + ym(1, 1) + zm(2, 1) + m(3, 1), xm(0, 2) + ym(1, 2) + zm(2, 2) + m(3, 2), xm(0, 3) + ym(1, 3) + zm(2, 3) + m(3, 3)].
 * On the web you will find many examples that use the opposite convention of MV,
 * in which case to make use of the examples you will need to transpose the matrix.
 *
 * Example Playground - Overview Linear Algebra - https://playground.babylonjs.com/#AV9X17
 * Example Playground - Overview Transformation - https://playground.babylonjs.com/#AV9X17#1
 * Example Playground - Overview Projection - https://playground.babylonjs.com/#AV9X17#2
 */
class Matrix {
    /**
     * Gets the precision of matrix computations
     */
    static get Use64Bits() {
        return _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_3__/* .PerformanceConfigurator */ .I.MatrixUse64Bits;
    }
    /**
     * Gets the internal data of the matrix
     */
    get m() {
        return this._m;
    }
    /**
     * Update the updateFlag to indicate that the matrix has been updated
     */
    markAsUpdated() {
        this.updateFlag = Matrix._UpdateFlagSeed++;
        this._isIdentity = false;
        this._isIdentity3x2 = false;
        this._isIdentityDirty = true;
        this._isIdentity3x2Dirty = true;
    }
    _updateIdentityStatus(isIdentity, isIdentityDirty = false, isIdentity3x2 = false, isIdentity3x2Dirty = true) {
        this._isIdentity = isIdentity;
        this._isIdentity3x2 = isIdentity || isIdentity3x2;
        this._isIdentityDirty = this._isIdentity ? false : isIdentityDirty;
        this._isIdentity3x2Dirty = this._isIdentity3x2 ? false : isIdentity3x2Dirty;
    }
    /**
     * Creates an empty matrix (filled with zeros)
     */
    constructor() {
        this._isIdentity = false;
        this._isIdentityDirty = true;
        this._isIdentity3x2 = true;
        this._isIdentity3x2Dirty = true;
        /**
         * Gets the update flag of the matrix which is an unique number for the matrix.
         * It will be incremented every time the matrix data change.
         * You can use it to speed the comparison between two versions of the same matrix.
         */
        this.updateFlag = -1;
        if (_Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_3__/* .PerformanceConfigurator */ .I.MatrixTrackPrecisionChange) {
            _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_3__/* .PerformanceConfigurator */ .I.MatrixTrackedMatrices.push(this);
        }
        this._m = new _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_3__/* .PerformanceConfigurator */ .I.MatrixCurrentType(16);
        this.markAsUpdated();
    }
    // Properties
    /**
     * Check if the current matrix is identity
     * @returns true is the matrix is the identity matrix
     */
    isIdentity() {
        if (this._isIdentityDirty) {
            this._isIdentityDirty = false;
            const m = this._m;
            this._isIdentity =
                m[0] === 1.0 &&
                    m[1] === 0.0 &&
                    m[2] === 0.0 &&
                    m[3] === 0.0 &&
                    m[4] === 0.0 &&
                    m[5] === 1.0 &&
                    m[6] === 0.0 &&
                    m[7] === 0.0 &&
                    m[8] === 0.0 &&
                    m[9] === 0.0 &&
                    m[10] === 1.0 &&
                    m[11] === 0.0 &&
                    m[12] === 0.0 &&
                    m[13] === 0.0 &&
                    m[14] === 0.0 &&
                    m[15] === 1.0;
        }
        return this._isIdentity;
    }
    /**
     * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)
     * @returns true is the matrix is the identity matrix
     */
    isIdentityAs3x2() {
        if (this._isIdentity3x2Dirty) {
            this._isIdentity3x2Dirty = false;
            if (this._m[0] !== 1.0 || this._m[5] !== 1.0 || this._m[15] !== 1.0) {
                this._isIdentity3x2 = false;
            }
            else if (this._m[1] !== 0.0 ||
                this._m[2] !== 0.0 ||
                this._m[3] !== 0.0 ||
                this._m[4] !== 0.0 ||
                this._m[6] !== 0.0 ||
                this._m[7] !== 0.0 ||
                this._m[8] !== 0.0 ||
                this._m[9] !== 0.0 ||
                this._m[10] !== 0.0 ||
                this._m[11] !== 0.0 ||
                this._m[12] !== 0.0 ||
                this._m[13] !== 0.0 ||
                this._m[14] !== 0.0) {
                this._isIdentity3x2 = false;
            }
            else {
                this._isIdentity3x2 = true;
            }
        }
        return this._isIdentity3x2;
    }
    /**
     * Gets the determinant of the matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#34
     * @returns the matrix determinant
     */
    determinant() {
        if (this._isIdentity === true) {
            return 1;
        }
        const m = this._m;
        const m00 = m[0], m01 = m[1], m02 = m[2], m03 = m[3];
        const m10 = m[4], m11 = m[5], m12 = m[6], m13 = m[7];
        const m20 = m[8], m21 = m[9], m22 = m[10], m23 = m[11];
        const m30 = m[12], m31 = m[13], m32 = m[14], m33 = m[15];
        // https://en.wikipedia.org/wiki/Laplace_expansion
        // to compute the deterrminant of a 4x4 Matrix we compute the cofactors of any row or column,
        // then we multiply each Cofactor by its corresponding matrix value and sum them all to get the determinant
        // Cofactor(i, j) = sign(i,j) * det(Minor(i, j))
        // where
        //  - sign(i,j) = (i+j) % 2 === 0 ? 1 : -1
        //  - Minor(i, j) is the 3x3 matrix we get by removing row i and column j from current Matrix
        //
        // Here we do that for the 1st row.
        const det_22_33 = m22 * m33 - m32 * m23;
        const det_21_33 = m21 * m33 - m31 * m23;
        const det_21_32 = m21 * m32 - m31 * m22;
        const det_20_33 = m20 * m33 - m30 * m23;
        const det_20_32 = m20 * m32 - m22 * m30;
        const det_20_31 = m20 * m31 - m30 * m21;
        const cofact_00 = +(m11 * det_22_33 - m12 * det_21_33 + m13 * det_21_32);
        const cofact_01 = -(m10 * det_22_33 - m12 * det_20_33 + m13 * det_20_32);
        const cofact_02 = +(m10 * det_21_33 - m11 * det_20_33 + m13 * det_20_31);
        const cofact_03 = -(m10 * det_21_32 - m11 * det_20_32 + m12 * det_20_31);
        return m00 * cofact_00 + m01 * cofact_01 + m02 * cofact_02 + m03 * cofact_03;
    }
    // Methods
    /**
     * Gets a string with the Matrix values
     * @returns a string with the Matrix values
     */
    toString() {
        return `{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}\n${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}\n${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}\n${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`;
    }
    toArray(array = null, index = 0) {
        if (!array) {
            return this._m;
        }
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            array[index + i] = m[i];
        }
        return this;
    }
    /**
     * Returns the matrix as a Float32Array or Array<number>
     * Example Playground - https://playground.babylonjs.com/#AV9X17#114
     * @returns the matrix underlying array.
     */
    asArray() {
        return this._m;
    }
    fromArray(array, index = 0) {
        return Matrix.FromArrayToRef(array, index, this);
    }
    copyFromFloats(...floats) {
        return Matrix.FromArrayToRef(floats, 0, this);
    }
    set(...values) {
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            m[i] = values[i];
        }
        this.markAsUpdated();
        return this;
    }
    setAll(value) {
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            m[i] = value;
        }
        this.markAsUpdated();
        return this;
    }
    /**
     * Inverts the current matrix in place
     * Example Playground - https://playground.babylonjs.com/#AV9X17#118
     * @returns the current inverted matrix
     */
    invert() {
        this.invertToRef(this);
        return this;
    }
    /**
     * Sets all the matrix elements to zero
     * @returns the current matrix
     */
    reset() {
        Matrix.FromValuesToRef(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, this);
        this._updateIdentityStatus(false);
        return this;
    }
    /**
     * Adds the current matrix with a second one
     * Example Playground - https://playground.babylonjs.com/#AV9X17#44
     * @param other defines the matrix to add
     * @returns a new matrix as the addition of the current matrix and the given one
     */
    add(other) {
        const result = new Matrix();
        this.addToRef(other, result);
        return result;
    }
    /**
     * Sets the given matrix "result" to the addition of the current matrix and the given one
     * Example Playground - https://playground.babylonjs.com/#AV9X17#45
     * @param other defines the matrix to add
     * @param result defines the target matrix
     * @returns result input
     */
    addToRef(other, result) {
        const m = this._m;
        const resultM = result._m;
        const otherM = other.m;
        for (let index = 0; index < 16; index++) {
            resultM[index] = m[index] + otherM[index];
        }
        result.markAsUpdated();
        return result;
    }
    /**
     * Adds in place the given matrix to the current matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#46
     * @param other defines the second operand
     * @returns the current updated matrix
     */
    addToSelf(other) {
        const m = this._m;
        const otherM = other.m;
        m[0] += otherM[0];
        m[1] += otherM[1];
        m[2] += otherM[2];
        m[3] += otherM[3];
        m[4] += otherM[4];
        m[5] += otherM[5];
        m[6] += otherM[6];
        m[7] += otherM[7];
        m[8] += otherM[8];
        m[9] += otherM[9];
        m[10] += otherM[10];
        m[11] += otherM[11];
        m[12] += otherM[12];
        m[13] += otherM[13];
        m[14] += otherM[14];
        m[15] += otherM[15];
        this.markAsUpdated();
        return this;
    }
    addInPlace(other) {
        const m = this._m, otherM = other.m;
        for (let i = 0; i < 16; i++) {
            m[i] += otherM[i];
        }
        this.markAsUpdated();
        return this;
    }
    addInPlaceFromFloats(...floats) {
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            m[i] += floats[i];
        }
        this.markAsUpdated();
        return this;
    }
    subtract(other) {
        const m = this._m, otherM = other.m;
        for (let i = 0; i < 16; i++) {
            m[i] -= otherM[i];
        }
        this.markAsUpdated();
        return this;
    }
    subtractToRef(other, result) {
        const m = this._m, otherM = other.m, resultM = result._m;
        for (let i = 0; i < 16; i++) {
            resultM[i] = m[i] - otherM[i];
        }
        result.markAsUpdated();
        return result;
    }
    subtractInPlace(other) {
        const m = this._m, otherM = other.m;
        for (let i = 0; i < 16; i++) {
            m[i] -= otherM[i];
        }
        this.markAsUpdated();
        return this;
    }
    subtractFromFloats(...floats) {
        return this.subtractFromFloatsToRef(...floats, new Matrix());
    }
    subtractFromFloatsToRef(...args) {
        const result = args.pop(), m = this._m, resultM = result._m, values = args;
        for (let i = 0; i < 16; i++) {
            resultM[i] = m[i] - values[i];
        }
        result.markAsUpdated();
        return result;
    }
    /**
     * Sets the given matrix to the current inverted Matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#119
     * @param other defines the target matrix
     * @returns result input
     */
    invertToRef(other) {
        if (this._isIdentity === true) {
            Matrix.IdentityToRef(other);
            return other;
        }
        // the inverse of a Matrix is the transpose of cofactor matrix divided by the determinant
        const m = this._m;
        const m00 = m[0], m01 = m[1], m02 = m[2], m03 = m[3];
        const m10 = m[4], m11 = m[5], m12 = m[6], m13 = m[7];
        const m20 = m[8], m21 = m[9], m22 = m[10], m23 = m[11];
        const m30 = m[12], m31 = m[13], m32 = m[14], m33 = m[15];
        const det_22_33 = m22 * m33 - m32 * m23;
        const det_21_33 = m21 * m33 - m31 * m23;
        const det_21_32 = m21 * m32 - m31 * m22;
        const det_20_33 = m20 * m33 - m30 * m23;
        const det_20_32 = m20 * m32 - m22 * m30;
        const det_20_31 = m20 * m31 - m30 * m21;
        const cofact_00 = +(m11 * det_22_33 - m12 * det_21_33 + m13 * det_21_32);
        const cofact_01 = -(m10 * det_22_33 - m12 * det_20_33 + m13 * det_20_32);
        const cofact_02 = +(m10 * det_21_33 - m11 * det_20_33 + m13 * det_20_31);
        const cofact_03 = -(m10 * det_21_32 - m11 * det_20_32 + m12 * det_20_31);
        const det = m00 * cofact_00 + m01 * cofact_01 + m02 * cofact_02 + m03 * cofact_03;
        if (det === 0) {
            // not invertible
            other.copyFrom(this);
            return other;
        }
        const detInv = 1 / det;
        const det_12_33 = m12 * m33 - m32 * m13;
        const det_11_33 = m11 * m33 - m31 * m13;
        const det_11_32 = m11 * m32 - m31 * m12;
        const det_10_33 = m10 * m33 - m30 * m13;
        const det_10_32 = m10 * m32 - m30 * m12;
        const det_10_31 = m10 * m31 - m30 * m11;
        const det_12_23 = m12 * m23 - m22 * m13;
        const det_11_23 = m11 * m23 - m21 * m13;
        const det_11_22 = m11 * m22 - m21 * m12;
        const det_10_23 = m10 * m23 - m20 * m13;
        const det_10_22 = m10 * m22 - m20 * m12;
        const det_10_21 = m10 * m21 - m20 * m11;
        const cofact_10 = -(m01 * det_22_33 - m02 * det_21_33 + m03 * det_21_32);
        const cofact_11 = +(m00 * det_22_33 - m02 * det_20_33 + m03 * det_20_32);
        const cofact_12 = -(m00 * det_21_33 - m01 * det_20_33 + m03 * det_20_31);
        const cofact_13 = +(m00 * det_21_32 - m01 * det_20_32 + m02 * det_20_31);
        const cofact_20 = +(m01 * det_12_33 - m02 * det_11_33 + m03 * det_11_32);
        const cofact_21 = -(m00 * det_12_33 - m02 * det_10_33 + m03 * det_10_32);
        const cofact_22 = +(m00 * det_11_33 - m01 * det_10_33 + m03 * det_10_31);
        const cofact_23 = -(m00 * det_11_32 - m01 * det_10_32 + m02 * det_10_31);
        const cofact_30 = -(m01 * det_12_23 - m02 * det_11_23 + m03 * det_11_22);
        const cofact_31 = +(m00 * det_12_23 - m02 * det_10_23 + m03 * det_10_22);
        const cofact_32 = -(m00 * det_11_23 - m01 * det_10_23 + m03 * det_10_21);
        const cofact_33 = +(m00 * det_11_22 - m01 * det_10_22 + m02 * det_10_21);
        Matrix.FromValuesToRef(cofact_00 * detInv, cofact_10 * detInv, cofact_20 * detInv, cofact_30 * detInv, cofact_01 * detInv, cofact_11 * detInv, cofact_21 * detInv, cofact_31 * detInv, cofact_02 * detInv, cofact_12 * detInv, cofact_22 * detInv, cofact_32 * detInv, cofact_03 * detInv, cofact_13 * detInv, cofact_23 * detInv, cofact_33 * detInv, other);
        return other;
    }
    /**
     * add a value at the specified position in the current Matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#47
     * @param index the index of the value within the matrix. between 0 and 15.
     * @param value the value to be added
     * @returns the current updated matrix
     */
    addAtIndex(index, value) {
        this._m[index] += value;
        this.markAsUpdated();
        return this;
    }
    /**
     * mutiply the specified position in the current Matrix by a value
     * @param index the index of the value within the matrix. between 0 and 15.
     * @param value the value to be added
     * @returns the current updated matrix
     */
    multiplyAtIndex(index, value) {
        this._m[index] *= value;
        this.markAsUpdated();
        return this;
    }
    /**
     * Inserts the translation vector (using 3 floats) in the current matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#120
     * @param x defines the 1st component of the translation
     * @param y defines the 2nd component of the translation
     * @param z defines the 3rd component of the translation
     * @returns the current updated matrix
     */
    setTranslationFromFloats(x, y, z) {
        this._m[12] = x;
        this._m[13] = y;
        this._m[14] = z;
        this.markAsUpdated();
        return this;
    }
    /**
     * Adds the translation vector (using 3 floats) in the current matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#20
     * Example Playground - https://playground.babylonjs.com/#AV9X17#48
     * @param x defines the 1st component of the translation
     * @param y defines the 2nd component of the translation
     * @param z defines the 3rd component of the translation
     * @returns the current updated matrix
     */
    addTranslationFromFloats(x, y, z) {
        this._m[12] += x;
        this._m[13] += y;
        this._m[14] += z;
        this.markAsUpdated();
        return this;
    }
    /**
     * Inserts the translation vector in the current matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#121
     * @param vector3 defines the translation to insert
     * @returns the current updated matrix
     */
    setTranslation(vector3) {
        return this.setTranslationFromFloats(vector3._x, vector3._y, vector3._z);
    }
    /**
     * Gets the translation value of the current matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#122
     * @returns a new Vector3 as the extracted translation from the matrix
     */
    getTranslation() {
        return new Vector3(this._m[12], this._m[13], this._m[14]);
    }
    /**
     * Fill a Vector3 with the extracted translation from the matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#123
     * @param result defines the Vector3 where to store the translation
     * @returns the current matrix
     */
    getTranslationToRef(result) {
        result.x = this._m[12];
        result.y = this._m[13];
        result.z = this._m[14];
        return result;
    }
    /**
     * Remove rotation and scaling part from the matrix
     * @returns the updated matrix
     */
    removeRotationAndScaling() {
        const m = this.m;
        Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, m[12], m[13], m[14], m[15], this);
        this._updateIdentityStatus(m[12] === 0 && m[13] === 0 && m[14] === 0 && m[15] === 1);
        return this;
    }
    /**
     * Copy the current matrix from the given one
     * Example Playground - https://playground.babylonjs.com/#AV9X17#21
     * @param other defines the source matrix
     * @returns the current updated matrix
     */
    copyFrom(other) {
        other.copyToArray(this._m);
        const o = other;
        this.updateFlag = o.updateFlag;
        this._updateIdentityStatus(o._isIdentity, o._isIdentityDirty, o._isIdentity3x2, o._isIdentity3x2Dirty);
        return this;
    }
    /**
     * Populates the given array from the starting index with the current matrix values
     * @param array defines the target array
     * @param offset defines the offset in the target array where to start storing values
     * @returns the current matrix
     */
    copyToArray(array, offset = 0) {
        const source = this._m;
        array[offset] = source[0];
        array[offset + 1] = source[1];
        array[offset + 2] = source[2];
        array[offset + 3] = source[3];
        array[offset + 4] = source[4];
        array[offset + 5] = source[5];
        array[offset + 6] = source[6];
        array[offset + 7] = source[7];
        array[offset + 8] = source[8];
        array[offset + 9] = source[9];
        array[offset + 10] = source[10];
        array[offset + 11] = source[11];
        array[offset + 12] = source[12];
        array[offset + 13] = source[13];
        array[offset + 14] = source[14];
        array[offset + 15] = source[15];
        return this;
    }
    /**
     * Multiply two matrices
     * Example Playground - https://playground.babylonjs.com/#AV9X17#15
     * A.multiply(B) means apply B to A so result is B x A
     * @param other defines the second operand
     * @returns a new matrix set with the multiplication result of the current Matrix and the given one
     */
    multiply(other) {
        const result = new Matrix();
        this.multiplyToRef(other, result);
        return result;
    }
    /**
     * This method performs component-by-component in-place multiplication, rather than true matrix multiplication.
     * Use multiply or multiplyToRef for matrix multiplication.
     * @param other defines the second operand
     * @returns the current updated matrix
     */
    multiplyInPlace(other) {
        const m = this._m, otherM = other.m;
        for (let i = 0; i < 16; i++) {
            m[i] *= otherM[i];
        }
        this.markAsUpdated();
        return this;
    }
    /**
     * This method performs a component-by-component multiplication of the current matrix with the array of transmitted numbers.
     * Use multiply or multiplyToRef for matrix multiplication.
     * @param floats defines the array of numbers to multiply the matrix by
     * @returns the current updated matrix
     */
    multiplyByFloats(...floats) {
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            m[i] *= floats[i];
        }
        this.markAsUpdated();
        return this;
    }
    /**
     * Multiples the current matrix by the given floats and stores them in the given ref
     * @param args The floats and ref
     * @returns The updated ref
     */
    multiplyByFloatsToRef(...args) {
        const result = args.pop(), m = this._m, resultM = result._m, values = args;
        for (let i = 0; i < 16; i++) {
            resultM[i] = m[i] * values[i];
        }
        result.markAsUpdated();
        return result;
    }
    /**
     * Sets the given matrix "result" with the multiplication result of the current Matrix and the given one
     * A.multiplyToRef(B, R) means apply B to A and store in R and R = B x A
     * Example Playground - https://playground.babylonjs.com/#AV9X17#16
     * @param other defines the second operand
     * @param result defines the matrix where to store the multiplication
     * @returns result input
     */
    multiplyToRef(other, result) {
        if (this._isIdentity) {
            result.copyFrom(other);
            return result;
        }
        if (other._isIdentity) {
            result.copyFrom(this);
            return result;
        }
        this.multiplyToArray(other, result._m, 0);
        result.markAsUpdated();
        return result;
    }
    /**
     * Sets the Float32Array "result" from the given index "offset" with the multiplication of the current matrix and the given one
     * @param other defines the second operand
     * @param result defines the array where to store the multiplication
     * @param offset defines the offset in the target array where to start storing values
     * @returns the current matrix
     */
    multiplyToArray(other, result, offset) {
        const m = this._m;
        const otherM = other.m;
        const tm0 = m[0], tm1 = m[1], tm2 = m[2], tm3 = m[3];
        const tm4 = m[4], tm5 = m[5], tm6 = m[6], tm7 = m[7];
        const tm8 = m[8], tm9 = m[9], tm10 = m[10], tm11 = m[11];
        const tm12 = m[12], tm13 = m[13], tm14 = m[14], tm15 = m[15];
        const om0 = otherM[0], om1 = otherM[1], om2 = otherM[2], om3 = otherM[3];
        const om4 = otherM[4], om5 = otherM[5], om6 = otherM[6], om7 = otherM[7];
        const om8 = otherM[8], om9 = otherM[9], om10 = otherM[10], om11 = otherM[11];
        const om12 = otherM[12], om13 = otherM[13], om14 = otherM[14], om15 = otherM[15];
        result[offset] = tm0 * om0 + tm1 * om4 + tm2 * om8 + tm3 * om12;
        result[offset + 1] = tm0 * om1 + tm1 * om5 + tm2 * om9 + tm3 * om13;
        result[offset + 2] = tm0 * om2 + tm1 * om6 + tm2 * om10 + tm3 * om14;
        result[offset + 3] = tm0 * om3 + tm1 * om7 + tm2 * om11 + tm3 * om15;
        result[offset + 4] = tm4 * om0 + tm5 * om4 + tm6 * om8 + tm7 * om12;
        result[offset + 5] = tm4 * om1 + tm5 * om5 + tm6 * om9 + tm7 * om13;
        result[offset + 6] = tm4 * om2 + tm5 * om6 + tm6 * om10 + tm7 * om14;
        result[offset + 7] = tm4 * om3 + tm5 * om7 + tm6 * om11 + tm7 * om15;
        result[offset + 8] = tm8 * om0 + tm9 * om4 + tm10 * om8 + tm11 * om12;
        result[offset + 9] = tm8 * om1 + tm9 * om5 + tm10 * om9 + tm11 * om13;
        result[offset + 10] = tm8 * om2 + tm9 * om6 + tm10 * om10 + tm11 * om14;
        result[offset + 11] = tm8 * om3 + tm9 * om7 + tm10 * om11 + tm11 * om15;
        result[offset + 12] = tm12 * om0 + tm13 * om4 + tm14 * om8 + tm15 * om12;
        result[offset + 13] = tm12 * om1 + tm13 * om5 + tm14 * om9 + tm15 * om13;
        result[offset + 14] = tm12 * om2 + tm13 * om6 + tm14 * om10 + tm15 * om14;
        result[offset + 15] = tm12 * om3 + tm13 * om7 + tm14 * om11 + tm15 * om15;
        return this;
    }
    divide(other) {
        return this.divideToRef(other, new Matrix());
    }
    divideToRef(other, result) {
        const m = this._m, otherM = other.m, resultM = result._m;
        for (let i = 0; i < 16; i++) {
            resultM[i] = m[i] / otherM[i];
        }
        result.markAsUpdated();
        return result;
    }
    divideInPlace(other) {
        const m = this._m, otherM = other.m;
        for (let i = 0; i < 16; i++) {
            m[i] /= otherM[i];
        }
        this.markAsUpdated();
        return this;
    }
    minimizeInPlace(other) {
        const m = this._m, otherM = other.m;
        for (let i = 0; i < 16; i++) {
            m[i] = Math.min(m[i], otherM[i]);
        }
        this.markAsUpdated();
        return this;
    }
    minimizeInPlaceFromFloats(...floats) {
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            m[i] = Math.min(m[i], floats[i]);
        }
        this.markAsUpdated();
        return this;
    }
    maximizeInPlace(other) {
        const m = this._m, otherM = other.m;
        for (let i = 0; i < 16; i++) {
            m[i] = Math.min(m[i], otherM[i]);
        }
        this.markAsUpdated();
        return this;
    }
    maximizeInPlaceFromFloats(...floats) {
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            m[i] = Math.min(m[i], floats[i]);
        }
        this.markAsUpdated();
        return this;
    }
    negate() {
        return this.negateToRef(new Matrix());
    }
    negateInPlace() {
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            m[i] = -m[i];
        }
        this.markAsUpdated();
        return this;
    }
    negateToRef(result) {
        const m = this._m, resultM = result._m;
        for (let i = 0; i < 16; i++) {
            resultM[i] = -m[i];
        }
        result.markAsUpdated();
        return result;
    }
    /**
     * Check equality between this matrix and a second one
     * @param value defines the second matrix to compare
     * @returns true is the current matrix and the given one values are strictly equal
     */
    equals(value) {
        const other = value;
        if (!other) {
            return false;
        }
        if (this._isIdentity || other._isIdentity) {
            if (!this._isIdentityDirty && !other._isIdentityDirty) {
                return this._isIdentity && other._isIdentity;
            }
        }
        const m = this.m;
        const om = other.m;
        return (m[0] === om[0] &&
            m[1] === om[1] &&
            m[2] === om[2] &&
            m[3] === om[3] &&
            m[4] === om[4] &&
            m[5] === om[5] &&
            m[6] === om[6] &&
            m[7] === om[7] &&
            m[8] === om[8] &&
            m[9] === om[9] &&
            m[10] === om[10] &&
            m[11] === om[11] &&
            m[12] === om[12] &&
            m[13] === om[13] &&
            m[14] === om[14] &&
            m[15] === om[15]);
    }
    equalsWithEpsilon(other, epsilon = 0) {
        const m = this._m, otherM = other.m;
        for (let i = 0; i < 16; i++) {
            if (!(0,_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_5__.WithinEpsilon)(m[i], otherM[i], epsilon)) {
                return false;
            }
        }
        return true;
    }
    equalsToFloats(...floats) {
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            if (m[i] != floats[i]) {
                return false;
            }
        }
        return true;
    }
    floor() {
        return this.floorToRef(new Matrix());
    }
    floorToRef(result) {
        const m = this._m, resultM = result._m;
        for (let i = 0; i < 16; i++) {
            resultM[i] = Math.floor(m[i]);
        }
        result.markAsUpdated();
        return result;
    }
    fract() {
        return this.fractToRef(new Matrix());
    }
    fractToRef(result) {
        const m = this._m, resultM = result._m;
        for (let i = 0; i < 16; i++) {
            resultM[i] = m[i] - Math.floor(m[i]);
        }
        result.markAsUpdated();
        return result;
    }
    /**
     * Clone the current matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#18
     * @returns a new matrix from the current matrix
     */
    clone() {
        const matrix = new Matrix();
        matrix.copyFrom(this);
        return matrix;
    }
    /**
     * Returns the name of the current matrix class
     * @returns the string "Matrix"
     */
    getClassName() {
        return "Matrix";
    }
    /**
     * Gets the hash code of the current matrix
     * @returns the hash code
     */
    getHashCode() {
        let hash = _ExtractAsInt(this._m[0]);
        for (let i = 1; i < 16; i++) {
            hash = (hash * 397) ^ _ExtractAsInt(this._m[i]);
        }
        return hash;
    }
    /**
     * Decomposes the current Matrix into a translation, rotation and scaling components of the provided node
     * Example Playground - https://playground.babylonjs.com/#AV9X17#13
     * @param node the node to decompose the matrix to
     * @returns true if operation was successful
     */
    decomposeToTransformNode(node) {
        node.rotationQuaternion = node.rotationQuaternion || new Quaternion();
        return this.decompose(node.scaling, node.rotationQuaternion, node.position);
    }
    /**
     * Decomposes the current Matrix into a translation, rotation and scaling components
     * Example Playground - https://playground.babylonjs.com/#AV9X17#12
     * @param scale defines the scale vector3 given as a reference to update
     * @param rotation defines the rotation quaternion given as a reference to update
     * @param translation defines the translation vector3 given as a reference to update
     * @param preserveScalingNode Use scaling sign coming from this node. Otherwise scaling sign might change.
     * @param useAbsoluteScaling Use scaling sign coming from this absoluteScaling when true or scaling otherwise.
     * @returns true if operation was successful
     */
    decompose(scale, rotation, translation, preserveScalingNode, useAbsoluteScaling = true) {
        if (this._isIdentity) {
            if (translation) {
                translation.setAll(0);
            }
            if (scale) {
                scale.setAll(1);
            }
            if (rotation) {
                rotation.copyFromFloats(0, 0, 0, 1);
            }
            return true;
        }
        const m = this._m;
        if (translation) {
            translation.copyFromFloats(m[12], m[13], m[14]);
        }
        scale = scale || MathTmp.Vector3[0];
        scale.x = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);
        scale.y = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]);
        scale.z = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]);
        if (preserveScalingNode) {
            const signX = (useAbsoluteScaling ? preserveScalingNode.absoluteScaling.x : preserveScalingNode.scaling.x) < 0 ? -1 : 1;
            const signY = (useAbsoluteScaling ? preserveScalingNode.absoluteScaling.y : preserveScalingNode.scaling.y) < 0 ? -1 : 1;
            const signZ = (useAbsoluteScaling ? preserveScalingNode.absoluteScaling.z : preserveScalingNode.scaling.z) < 0 ? -1 : 1;
            scale.x *= signX;
            scale.y *= signY;
            scale.z *= signZ;
        }
        else {
            if (this.determinant() <= 0) {
                scale.y *= -1;
            }
        }
        if (scale._x === 0 || scale._y === 0 || scale._z === 0) {
            if (rotation) {
                rotation.copyFromFloats(0.0, 0.0, 0.0, 1.0);
            }
            return false;
        }
        if (rotation) {
            const sx = 1 / scale._x, sy = 1 / scale._y, sz = 1 / scale._z;
            Matrix.FromValuesToRef(m[0] * sx, m[1] * sx, m[2] * sx, 0.0, m[4] * sy, m[5] * sy, m[6] * sy, 0.0, m[8] * sz, m[9] * sz, m[10] * sz, 0.0, 0.0, 0.0, 0.0, 1.0, MathTmp.Matrix[0]);
            Quaternion.FromRotationMatrixToRef(MathTmp.Matrix[0], rotation);
        }
        return true;
    }
    /**
     * Gets specific row of the matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#36
     * @param index defines the number of the row to get
     * @returns the index-th row of the current matrix as a new Vector4
     */
    getRow(index) {
        if (index < 0 || index > 3) {
            return null;
        }
        const i = index * 4;
        return new Vector4(this._m[i + 0], this._m[i + 1], this._m[i + 2], this._m[i + 3]);
    }
    /**
     * Gets specific row of the matrix to ref
     * Example Playground - https://playground.babylonjs.com/#AV9X17#36
     * @param index defines the number of the row to get
     * @param rowVector vector to store the index-th row of the current matrix
     * @returns result input
     */
    getRowToRef(index, rowVector) {
        if (index >= 0 && index <= 3) {
            const i = index * 4;
            rowVector.x = this._m[i + 0];
            rowVector.y = this._m[i + 1];
            rowVector.z = this._m[i + 2];
            rowVector.w = this._m[i + 3];
        }
        return rowVector;
    }
    /**
     * Sets the index-th row of the current matrix to the vector4 values
     * Example Playground - https://playground.babylonjs.com/#AV9X17#36
     * @param index defines the number of the row to set
     * @param row defines the target vector4
     * @returns the updated current matrix
     */
    setRow(index, row) {
        return this.setRowFromFloats(index, row.x, row.y, row.z, row.w);
    }
    /**
     * Compute the transpose of the matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#40
     * @returns the new transposed matrix
     */
    transpose() {
        const result = new Matrix();
        Matrix.TransposeToRef(this, result);
        return result;
    }
    /**
     * Compute the transpose of the matrix and store it in a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#41
     * @param result defines the target matrix
     * @returns result input
     */
    transposeToRef(result) {
        Matrix.TransposeToRef(this, result);
        return result;
    }
    /**
     * Sets the index-th row of the current matrix with the given 4 x float values
     * Example Playground - https://playground.babylonjs.com/#AV9X17#36
     * @param index defines the row index
     * @param x defines the x component to set
     * @param y defines the y component to set
     * @param z defines the z component to set
     * @param w defines the w component to set
     * @returns the updated current matrix
     */
    setRowFromFloats(index, x, y, z, w) {
        if (index < 0 || index > 3) {
            return this;
        }
        const i = index * 4;
        this._m[i + 0] = x;
        this._m[i + 1] = y;
        this._m[i + 2] = z;
        this._m[i + 3] = w;
        this.markAsUpdated();
        return this;
    }
    /**
     * Compute a new matrix set with the current matrix values multiplied by scale (float)
     * @param scale defines the scale factor
     * @returns a new matrix
     */
    scale(scale) {
        const result = new Matrix();
        this.scaleToRef(scale, result);
        return result;
    }
    /**
     * Scale the current matrix values by a factor to a given result matrix
     * @param scale defines the scale factor
     * @param result defines the matrix to store the result
     * @returns result input
     */
    scaleToRef(scale, result) {
        for (let index = 0; index < 16; index++) {
            result._m[index] = this._m[index] * scale;
        }
        result.markAsUpdated();
        return result;
    }
    /**
     * Scale the current matrix values by a factor and add the result to a given matrix
     * @param scale defines the scale factor
     * @param result defines the Matrix to store the result
     * @returns result input
     */
    scaleAndAddToRef(scale, result) {
        for (let index = 0; index < 16; index++) {
            result._m[index] += this._m[index] * scale;
        }
        result.markAsUpdated();
        return result;
    }
    scaleInPlace(scale) {
        const m = this._m;
        for (let i = 0; i < 16; i++) {
            m[i] *= scale;
        }
        this.markAsUpdated();
        return this;
    }
    /**
     * Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column).
     * Example Playground - https://playground.babylonjs.com/#AV9X17#17
     * @param ref matrix to store the result
     * @returns the reference matrix
     */
    toNormalMatrix(ref) {
        const tmp = MathTmp.Matrix[0];
        this.invertToRef(tmp);
        tmp.transposeToRef(ref);
        const m = ref._m;
        Matrix.FromValuesToRef(m[0], m[1], m[2], 0.0, m[4], m[5], m[6], 0.0, m[8], m[9], m[10], 0.0, 0.0, 0.0, 0.0, 1.0, ref);
        return ref;
    }
    /**
     * Gets only rotation part of the current matrix
     * @returns a new matrix sets to the extracted rotation matrix from the current one
     */
    getRotationMatrix() {
        const result = new Matrix();
        this.getRotationMatrixToRef(result);
        return result;
    }
    /**
     * Extracts the rotation matrix from the current one and sets it as the given "result"
     * @param result defines the target matrix to store data to
     * @returns result input
     */
    getRotationMatrixToRef(result) {
        const scale = MathTmp.Vector3[0];
        if (!this.decompose(scale)) {
            Matrix.IdentityToRef(result);
            return result;
        }
        const m = this._m;
        const sx = 1 / scale._x, sy = 1 / scale._y, sz = 1 / scale._z;
        Matrix.FromValuesToRef(m[0] * sx, m[1] * sx, m[2] * sx, 0.0, m[4] * sy, m[5] * sy, m[6] * sy, 0.0, m[8] * sz, m[9] * sz, m[10] * sz, 0.0, 0.0, 0.0, 0.0, 1.0, result);
        return result;
    }
    /**
     * Toggles model matrix from being right handed to left handed in place and vice versa
     * @returns the current updated matrix
     */
    toggleModelMatrixHandInPlace() {
        const m = this._m;
        m[2] *= -1;
        m[6] *= -1;
        m[8] *= -1;
        m[9] *= -1;
        m[14] *= -1;
        this.markAsUpdated();
        return this;
    }
    /**
     * Toggles projection matrix from being right handed to left handed in place and vice versa
     * @returns the current updated matrix
     */
    toggleProjectionMatrixHandInPlace() {
        const m = this._m;
        m[8] *= -1;
        m[9] *= -1;
        m[10] *= -1;
        m[11] *= -1;
        this.markAsUpdated();
        return this;
    }
    // Statics
    /**
     * Creates a matrix from an array
     * Example Playground - https://playground.babylonjs.com/#AV9X17#42
     * @param array defines the source array
     * @param offset defines an offset in the source array
     * @returns a new Matrix set from the starting index of the given array
     */
    static FromArray(array, offset = 0) {
        const result = new Matrix();
        Matrix.FromArrayToRef(array, offset, result);
        return result;
    }
    /**
     * Copy the content of an array into a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#43
     * @param array defines the source array
     * @param offset defines an offset in the source array
     * @param result defines the target matrix
     * @returns result input
     */
    static FromArrayToRef(array, offset, result) {
        for (let index = 0; index < 16; index++) {
            result._m[index] = array[index + offset];
        }
        result.markAsUpdated();
        return result;
    }
    /**
     * Stores an array into a matrix after having multiplied each component by a given factor
     * Example Playground - https://playground.babylonjs.com/#AV9X17#50
     * @param array defines the source array
     * @param offset defines the offset in the source array
     * @param scale defines the scaling factor
     * @param result defines the target matrix
     * @returns result input
     */
    static FromFloat32ArrayToRefScaled(array, offset, scale, result) {
        result._m[0] = array[0 + offset] * scale;
        result._m[1] = array[1 + offset] * scale;
        result._m[2] = array[2 + offset] * scale;
        result._m[3] = array[3 + offset] * scale;
        result._m[4] = array[4 + offset] * scale;
        result._m[5] = array[5 + offset] * scale;
        result._m[6] = array[6 + offset] * scale;
        result._m[7] = array[7 + offset] * scale;
        result._m[8] = array[8 + offset] * scale;
        result._m[9] = array[9 + offset] * scale;
        result._m[10] = array[10 + offset] * scale;
        result._m[11] = array[11 + offset] * scale;
        result._m[12] = array[12 + offset] * scale;
        result._m[13] = array[13 + offset] * scale;
        result._m[14] = array[14 + offset] * scale;
        result._m[15] = array[15 + offset] * scale;
        result.markAsUpdated();
        return result;
    }
    /**
     * Gets an identity matrix that must not be updated
     */
    static get IdentityReadOnly() {
        return Matrix._IdentityReadOnly;
    }
    /**
     * Stores a list of values (16) inside a given matrix
     * @param initialM11 defines 1st value of 1st row
     * @param initialM12 defines 2nd value of 1st row
     * @param initialM13 defines 3rd value of 1st row
     * @param initialM14 defines 4th value of 1st row
     * @param initialM21 defines 1st value of 2nd row
     * @param initialM22 defines 2nd value of 2nd row
     * @param initialM23 defines 3rd value of 2nd row
     * @param initialM24 defines 4th value of 2nd row
     * @param initialM31 defines 1st value of 3rd row
     * @param initialM32 defines 2nd value of 3rd row
     * @param initialM33 defines 3rd value of 3rd row
     * @param initialM34 defines 4th value of 3rd row
     * @param initialM41 defines 1st value of 4th row
     * @param initialM42 defines 2nd value of 4th row
     * @param initialM43 defines 3rd value of 4th row
     * @param initialM44 defines 4th value of 4th row
     * @param result defines the target matrix
     */
    static FromValuesToRef(initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44, result) {
        const m = result._m;
        m[0] = initialM11;
        m[1] = initialM12;
        m[2] = initialM13;
        m[3] = initialM14;
        m[4] = initialM21;
        m[5] = initialM22;
        m[6] = initialM23;
        m[7] = initialM24;
        m[8] = initialM31;
        m[9] = initialM32;
        m[10] = initialM33;
        m[11] = initialM34;
        m[12] = initialM41;
        m[13] = initialM42;
        m[14] = initialM43;
        m[15] = initialM44;
        result.markAsUpdated();
    }
    /**
     * Creates new matrix from a list of values (16)
     * @param initialM11 defines 1st value of 1st row
     * @param initialM12 defines 2nd value of 1st row
     * @param initialM13 defines 3rd value of 1st row
     * @param initialM14 defines 4th value of 1st row
     * @param initialM21 defines 1st value of 2nd row
     * @param initialM22 defines 2nd value of 2nd row
     * @param initialM23 defines 3rd value of 2nd row
     * @param initialM24 defines 4th value of 2nd row
     * @param initialM31 defines 1st value of 3rd row
     * @param initialM32 defines 2nd value of 3rd row
     * @param initialM33 defines 3rd value of 3rd row
     * @param initialM34 defines 4th value of 3rd row
     * @param initialM41 defines 1st value of 4th row
     * @param initialM42 defines 2nd value of 4th row
     * @param initialM43 defines 3rd value of 4th row
     * @param initialM44 defines 4th value of 4th row
     * @returns the new matrix
     */
    static FromValues(initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44) {
        const result = new Matrix();
        const m = result._m;
        m[0] = initialM11;
        m[1] = initialM12;
        m[2] = initialM13;
        m[3] = initialM14;
        m[4] = initialM21;
        m[5] = initialM22;
        m[6] = initialM23;
        m[7] = initialM24;
        m[8] = initialM31;
        m[9] = initialM32;
        m[10] = initialM33;
        m[11] = initialM34;
        m[12] = initialM41;
        m[13] = initialM42;
        m[14] = initialM43;
        m[15] = initialM44;
        result.markAsUpdated();
        return result;
    }
    /**
     * Creates a new matrix composed by merging scale (vector3), rotation (quaternion) and translation (vector3)
     * Example Playground - https://playground.babylonjs.com/#AV9X17#24
     * @param scale defines the scale vector3
     * @param rotation defines the rotation quaternion
     * @param translation defines the translation vector3
     * @returns a new matrix
     */
    static Compose(scale, rotation, translation) {
        const result = new Matrix();
        Matrix.ComposeToRef(scale, rotation, translation, result);
        return result;
    }
    /**
     * Sets a matrix to a value composed by merging scale (vector3), rotation (quaternion) and translation (vector3)
     * Example Playground - https://playground.babylonjs.com/#AV9X17#25
     * @param scale defines the scale vector3
     * @param rotation defines the rotation quaternion
     * @param translation defines the translation vector3
     * @param result defines the target matrix
     * @returns result input
     */
    static ComposeToRef(scale, rotation, translation, result) {
        const m = result._m;
        const x = rotation._x, y = rotation._y, z = rotation._z, w = rotation._w;
        const x2 = x + x, y2 = y + y, z2 = z + z;
        const xx = x * x2, xy = x * y2, xz = x * z2;
        const yy = y * y2, yz = y * z2, zz = z * z2;
        const wx = w * x2, wy = w * y2, wz = w * z2;
        const sx = scale._x, sy = scale._y, sz = scale._z;
        m[0] = (1 - (yy + zz)) * sx;
        m[1] = (xy + wz) * sx;
        m[2] = (xz - wy) * sx;
        m[3] = 0;
        m[4] = (xy - wz) * sy;
        m[5] = (1 - (xx + zz)) * sy;
        m[6] = (yz + wx) * sy;
        m[7] = 0;
        m[8] = (xz + wy) * sz;
        m[9] = (yz - wx) * sz;
        m[10] = (1 - (xx + yy)) * sz;
        m[11] = 0;
        m[12] = translation._x;
        m[13] = translation._y;
        m[14] = translation._z;
        m[15] = 1;
        result.markAsUpdated();
        return result;
    }
    /**
     * Creates a new identity matrix
     * @returns a new identity matrix
     */
    static Identity() {
        const identity = Matrix.FromValues(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
        identity._updateIdentityStatus(true);
        return identity;
    }
    /**
     * Creates a new identity matrix and stores the result in a given matrix
     * @param result defines the target matrix
     * @returns result input
     */
    static IdentityToRef(result) {
        Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, result);
        result._updateIdentityStatus(true);
        return result;
    }
    /**
     * Creates a new zero matrix
     * @returns a new zero matrix
     */
    static Zero() {
        const zero = Matrix.FromValues(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
        zero._updateIdentityStatus(false);
        return zero;
    }
    /**
     * Creates a new rotation matrix for "angle" radians around the X axis
     * Example Playground - https://playground.babylonjs.com/#AV9X17#97
     * @param angle defines the angle (in radians) to use
     * @returns the new matrix
     */
    static RotationX(angle) {
        const result = new Matrix();
        Matrix.RotationXToRef(angle, result);
        return result;
    }
    /**
     * Creates a new matrix as the invert of a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#124
     * @param source defines the source matrix
     * @returns the new matrix
     */
    static Invert(source) {
        const result = new Matrix();
        source.invertToRef(result);
        return result;
    }
    /**
     * Creates a new rotation matrix for "angle" radians around the X axis and stores it in a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#98
     * @param angle defines the angle (in radians) to use
     * @param result defines the target matrix
     * @returns result input
     */
    static RotationXToRef(angle, result) {
        const s = Math.sin(angle);
        const c = Math.cos(angle);
        Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, c, s, 0.0, 0.0, -s, c, 0.0, 0.0, 0.0, 0.0, 1.0, result);
        result._updateIdentityStatus(c === 1 && s === 0);
        return result;
    }
    /**
     * Creates a new rotation matrix for "angle" radians around the Y axis
     * Example Playground - https://playground.babylonjs.com/#AV9X17#99
     * @param angle defines the angle (in radians) to use
     * @returns the new matrix
     */
    static RotationY(angle) {
        const result = new Matrix();
        Matrix.RotationYToRef(angle, result);
        return result;
    }
    /**
     * Creates a new rotation matrix for "angle" radians around the Y axis and stores it in a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#100
     * @param angle defines the angle (in radians) to use
     * @param result defines the target matrix
     * @returns result input
     */
    static RotationYToRef(angle, result) {
        const s = Math.sin(angle);
        const c = Math.cos(angle);
        Matrix.FromValuesToRef(c, 0.0, -s, 0.0, 0.0, 1.0, 0.0, 0.0, s, 0.0, c, 0.0, 0.0, 0.0, 0.0, 1.0, result);
        result._updateIdentityStatus(c === 1 && s === 0);
        return result;
    }
    /**
     * Creates a new rotation matrix for "angle" radians around the Z axis
     * Example Playground - https://playground.babylonjs.com/#AV9X17#101
     * @param angle defines the angle (in radians) to use
     * @returns the new matrix
     */
    static RotationZ(angle) {
        const result = new Matrix();
        Matrix.RotationZToRef(angle, result);
        return result;
    }
    /**
     * Creates a new rotation matrix for "angle" radians around the Z axis and stores it in a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#102
     * @param angle defines the angle (in radians) to use
     * @param result defines the target matrix
     * @returns result input
     */
    static RotationZToRef(angle, result) {
        const s = Math.sin(angle);
        const c = Math.cos(angle);
        Matrix.FromValuesToRef(c, s, 0.0, 0.0, -s, c, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, result);
        result._updateIdentityStatus(c === 1 && s === 0);
        return result;
    }
    /**
     * Creates a new rotation matrix for "angle" radians around the given axis
     * Example Playground - https://playground.babylonjs.com/#AV9X17#96
     * @param axis defines the axis to use
     * @param angle defines the angle (in radians) to use
     * @returns the new matrix
     */
    static RotationAxis(axis, angle) {
        const result = new Matrix();
        Matrix.RotationAxisToRef(axis, angle, result);
        return result;
    }
    /**
     * Creates a new rotation matrix for "angle" radians around the given axis and stores it in a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#94
     * @param axis defines the axis to use
     * @param angle defines the angle (in radians) to use
     * @param result defines the target matrix
     * @returns result input
     */
    static RotationAxisToRef(axis, angle, result) {
        const s = Math.sin(-angle);
        const c = Math.cos(-angle);
        const c1 = 1 - c;
        axis = axis.normalizeToRef(MathTmp.Vector3[0]);
        const m = result._m;
        m[0] = axis._x * axis._x * c1 + c;
        m[1] = axis._x * axis._y * c1 - axis._z * s;
        m[2] = axis._x * axis._z * c1 + axis._y * s;
        m[3] = 0.0;
        m[4] = axis._y * axis._x * c1 + axis._z * s;
        m[5] = axis._y * axis._y * c1 + c;
        m[6] = axis._y * axis._z * c1 - axis._x * s;
        m[7] = 0.0;
        m[8] = axis._z * axis._x * c1 - axis._y * s;
        m[9] = axis._z * axis._y * c1 + axis._x * s;
        m[10] = axis._z * axis._z * c1 + c;
        m[11] = 0.0;
        m[12] = 0.0;
        m[13] = 0.0;
        m[14] = 0.0;
        m[15] = 1.0;
        result.markAsUpdated();
        return result;
    }
    /**
     * Takes normalised vectors and returns a rotation matrix to align "from" with "to".
     * Taken from http://www.iquilezles.org/www/articles/noacos/noacos.htm
     * Example Playground - https://playground.babylonjs.com/#AV9X17#93
     * @param from defines the vector to align
     * @param to defines the vector to align to
     * @param result defines the target matrix
     * @param useYAxisForCoplanar defines a boolean indicating that we should favor Y axis for coplanar vectors (default is false)
     * @returns result input
     */
    static RotationAlignToRef(from, to, result, useYAxisForCoplanar = false) {
        const c = Vector3.Dot(to, from);
        const m = result._m;
        if (c < -1 + _math_constants_js__WEBPACK_IMPORTED_MODULE_0__/* .Epsilon */ .bH) {
            // from and to are colinear and opposite direction.
            // compute a PI rotation on Y axis
            m[0] = -1;
            m[1] = 0;
            m[2] = 0;
            m[3] = 0;
            m[4] = 0;
            m[5] = useYAxisForCoplanar ? 1 : -1;
            m[6] = 0;
            m[7] = 0;
            m[8] = 0;
            m[9] = 0;
            m[10] = useYAxisForCoplanar ? -1 : 1;
            m[11] = 0;
        }
        else {
            const v = Vector3.Cross(to, from);
            const k = 1 / (1 + c);
            m[0] = v._x * v._x * k + c;
            m[1] = v._y * v._x * k - v._z;
            m[2] = v._z * v._x * k + v._y;
            m[3] = 0;
            m[4] = v._x * v._y * k + v._z;
            m[5] = v._y * v._y * k + c;
            m[6] = v._z * v._y * k - v._x;
            m[7] = 0;
            m[8] = v._x * v._z * k - v._y;
            m[9] = v._y * v._z * k + v._x;
            m[10] = v._z * v._z * k + c;
            m[11] = 0;
        }
        m[12] = 0;
        m[13] = 0;
        m[14] = 0;
        m[15] = 1;
        result.markAsUpdated();
        return result;
    }
    /**
     * Creates a rotation matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#103
     * Example Playground - https://playground.babylonjs.com/#AV9X17#105
     * @param yaw defines the yaw angle in radians (Y axis)
     * @param pitch defines the pitch angle in radians (X axis)
     * @param roll defines the roll angle in radians (Z axis)
     * @returns the new rotation matrix
     */
    static RotationYawPitchRoll(yaw, pitch, roll) {
        const result = new Matrix();
        Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, result);
        return result;
    }
    /**
     * Creates a rotation matrix and stores it in a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#104
     * @param yaw defines the yaw angle in radians (Y axis)
     * @param pitch defines the pitch angle in radians (X axis)
     * @param roll defines the roll angle in radians (Z axis)
     * @param result defines the target matrix
     * @returns result input
     */
    static RotationYawPitchRollToRef(yaw, pitch, roll, result) {
        Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, MathTmp.Quaternion[0]);
        MathTmp.Quaternion[0].toRotationMatrix(result);
        return result;
    }
    /**
     * Creates a scaling matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#107
     * @param x defines the scale factor on X axis
     * @param y defines the scale factor on Y axis
     * @param z defines the scale factor on Z axis
     * @returns the new matrix
     */
    static Scaling(x, y, z) {
        const result = new Matrix();
        Matrix.ScalingToRef(x, y, z, result);
        return result;
    }
    /**
     * Creates a scaling matrix and stores it in a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#108
     * @param x defines the scale factor on X axis
     * @param y defines the scale factor on Y axis
     * @param z defines the scale factor on Z axis
     * @param result defines the target matrix
     * @returns result input
     */
    static ScalingToRef(x, y, z, result) {
        Matrix.FromValuesToRef(x, 0.0, 0.0, 0.0, 0.0, y, 0.0, 0.0, 0.0, 0.0, z, 0.0, 0.0, 0.0, 0.0, 1.0, result);
        result._updateIdentityStatus(x === 1 && y === 1 && z === 1);
        return result;
    }
    /**
     * Creates a translation matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#109
     * @param x defines the translation on X axis
     * @param y defines the translation on Y axis
     * @param z defines the translationon Z axis
     * @returns the new matrix
     */
    static Translation(x, y, z) {
        const result = new Matrix();
        Matrix.TranslationToRef(x, y, z, result);
        return result;
    }
    /**
     * Creates a translation matrix and stores it in a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#110
     * @param x defines the translation on X axis
     * @param y defines the translation on Y axis
     * @param z defines the translationon Z axis
     * @param result defines the target matrix
     * @returns result input
     */
    static TranslationToRef(x, y, z, result) {
        Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, x, y, z, 1.0, result);
        result._updateIdentityStatus(x === 0 && y === 0 && z === 0);
        return result;
    }
    /**
     * Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
     * Example Playground - https://playground.babylonjs.com/#AV9X17#55
     * @param startValue defines the start value
     * @param endValue defines the end value
     * @param gradient defines the gradient factor
     * @returns the new matrix
     */
    static Lerp(startValue, endValue, gradient) {
        const result = new Matrix();
        Matrix.LerpToRef(startValue, endValue, gradient, result);
        return result;
    }
    /**
     * Set the given matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
     * Example Playground - https://playground.babylonjs.com/#AV9X17#54
     * @param startValue defines the start value
     * @param endValue defines the end value
     * @param gradient defines the gradient factor
     * @param result defines the Matrix object where to store data
     * @returns result input
     */
    static LerpToRef(startValue, endValue, gradient, result) {
        const resultM = result._m;
        const startM = startValue.m;
        const endM = endValue.m;
        for (let index = 0; index < 16; index++) {
            resultM[index] = startM[index] * (1.0 - gradient) + endM[index] * gradient;
        }
        result.markAsUpdated();
        return result;
    }
    /**
     * Builds a new matrix whose values are computed by:
     * * decomposing the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
     * * interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end
     * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices
     * Example Playground - https://playground.babylonjs.com/#AV9X17#22
     * Example Playground - https://playground.babylonjs.com/#AV9X17#51
     * @param startValue defines the first matrix
     * @param endValue defines the second matrix
     * @param gradient defines the gradient between the two matrices
     * @returns the new matrix
     */
    static DecomposeLerp(startValue, endValue, gradient) {
        const result = new Matrix();
        Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result);
        return result;
    }
    /**
     * Update a matrix to values which are computed by:
     * * decomposing the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
     * * interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end
     * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices
     * Example Playground - https://playground.babylonjs.com/#AV9X17#23
     * Example Playground - https://playground.babylonjs.com/#AV9X17#53
     * @param startValue defines the first matrix
     * @param endValue defines the second matrix
     * @param gradient defines the gradient between the two matrices
     * @param result defines the target matrix
     * @returns result input
     */
    static DecomposeLerpToRef(startValue, endValue, gradient, result) {
        const startScale = MathTmp.Vector3[0];
        const startRotation = MathTmp.Quaternion[0];
        const startTranslation = MathTmp.Vector3[1];
        startValue.decompose(startScale, startRotation, startTranslation);
        const endScale = MathTmp.Vector3[2];
        const endRotation = MathTmp.Quaternion[1];
        const endTranslation = MathTmp.Vector3[3];
        endValue.decompose(endScale, endRotation, endTranslation);
        const resultScale = MathTmp.Vector3[4];
        Vector3.LerpToRef(startScale, endScale, gradient, resultScale);
        const resultRotation = MathTmp.Quaternion[2];
        Quaternion.SlerpToRef(startRotation, endRotation, gradient, resultRotation);
        const resultTranslation = MathTmp.Vector3[5];
        Vector3.LerpToRef(startTranslation, endTranslation, gradient, resultTranslation);
        Matrix.ComposeToRef(resultScale, resultRotation, resultTranslation, result);
        return result;
    }
    /**
     * Creates a new matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.
     * This function generates a matrix suitable for a left handed coordinate system
     * Example Playground - https://playground.babylonjs.com/#AV9X17#58
     * Example Playground - https://playground.babylonjs.com/#AV9X17#59
     * @param eye defines the final position of the entity
     * @param target defines where the entity should look at
     * @param up defines the up vector for the entity
     * @returns the new matrix
     */
    static LookAtLH(eye, target, up) {
        const result = new Matrix();
        Matrix.LookAtLHToRef(eye, target, up, result);
        return result;
    }
    /**
     * Sets the given "result" Matrix to a matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.
     * This function generates a matrix suitable for a left handed coordinate system
     * Example Playground - https://playground.babylonjs.com/#AV9X17#60
     * Example Playground - https://playground.babylonjs.com/#AV9X17#61
     * @param eye defines the final position of the entity
     * @param target defines where the entity should look at
     * @param up defines the up vector for the entity
     * @param result defines the target matrix
     * @returns result input
     */
    static LookAtLHToRef(eye, target, up, result) {
        const xAxis = MathTmp.Vector3[0];
        const yAxis = MathTmp.Vector3[1];
        const zAxis = MathTmp.Vector3[2];
        // Z axis
        target.subtractToRef(eye, zAxis);
        zAxis.normalize();
        // X axis
        Vector3.CrossToRef(up, zAxis, xAxis);
        const xSquareLength = xAxis.lengthSquared();
        if (xSquareLength === 0) {
            xAxis.x = 1.0;
        }
        else {
            xAxis.normalizeFromLength(Math.sqrt(xSquareLength));
        }
        // Y axis
        Vector3.CrossToRef(zAxis, xAxis, yAxis);
        yAxis.normalize();
        // Eye angles
        const ex = -Vector3.Dot(xAxis, eye);
        const ey = -Vector3.Dot(yAxis, eye);
        const ez = -Vector3.Dot(zAxis, eye);
        Matrix.FromValuesToRef(xAxis._x, yAxis._x, zAxis._x, 0.0, xAxis._y, yAxis._y, zAxis._y, 0.0, xAxis._z, yAxis._z, zAxis._z, 0.0, ex, ey, ez, 1.0, result);
        return result;
    }
    /**
     * Creates a new matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.
     * This function generates a matrix suitable for a right handed coordinate system
     * Example Playground - https://playground.babylonjs.com/#AV9X17#62
     * Example Playground - https://playground.babylonjs.com/#AV9X17#63
     * @param eye defines the final position of the entity
     * @param target defines where the entity should look at
     * @param up defines the up vector for the entity
     * @returns the new matrix
     */
    static LookAtRH(eye, target, up) {
        const result = new Matrix();
        Matrix.LookAtRHToRef(eye, target, up, result);
        return result;
    }
    /**
     * Sets the given "result" Matrix to a matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.
     * This function generates a matrix suitable for a right handed coordinate system
     * Example Playground - https://playground.babylonjs.com/#AV9X17#64
     * Example Playground - https://playground.babylonjs.com/#AV9X17#65
     * @param eye defines the final position of the entity
     * @param target defines where the entity should look at
     * @param up defines the up vector for the entity
     * @param result defines the target matrix
     * @returns result input
     */
    static LookAtRHToRef(eye, target, up, result) {
        const xAxis = MathTmp.Vector3[0];
        const yAxis = MathTmp.Vector3[1];
        const zAxis = MathTmp.Vector3[2];
        // Z axis
        eye.subtractToRef(target, zAxis);
        zAxis.normalize();
        // X axis
        Vector3.CrossToRef(up, zAxis, xAxis);
        const xSquareLength = xAxis.lengthSquared();
        if (xSquareLength === 0) {
            xAxis.x = 1.0;
        }
        else {
            xAxis.normalizeFromLength(Math.sqrt(xSquareLength));
        }
        // Y axis
        Vector3.CrossToRef(zAxis, xAxis, yAxis);
        yAxis.normalize();
        // Eye angles
        const ex = -Vector3.Dot(xAxis, eye);
        const ey = -Vector3.Dot(yAxis, eye);
        const ez = -Vector3.Dot(zAxis, eye);
        Matrix.FromValuesToRef(xAxis._x, yAxis._x, zAxis._x, 0.0, xAxis._y, yAxis._y, zAxis._y, 0.0, xAxis._z, yAxis._z, zAxis._z, 0.0, ex, ey, ez, 1.0, result);
        return result;
    }
    /**
     * Creates a new matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)
     * This function generates a matrix suitable for a left handed coordinate system
     * Example Playground - https://playground.babylonjs.com/#AV9X17#66
     * @param forward defines the forward direction - Must be normalized and orthogonal to up.
     * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
     * @returns the new matrix
     */
    static LookDirectionLH(forward, up) {
        const result = new Matrix();
        Matrix.LookDirectionLHToRef(forward, up, result);
        return result;
    }
    /**
     * Sets the given "result" Matrix to a matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)
     * This function generates a matrix suitable for a left handed coordinate system
     * Example Playground - https://playground.babylonjs.com/#AV9X17#67
     * @param forward defines the forward direction - Must be normalized and orthogonal to up.
     * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
     * @param result defines the target matrix
     * @returns result input
     */
    static LookDirectionLHToRef(forward, up, result) {
        const back = MathTmp.Vector3[0];
        back.copyFrom(forward);
        back.scaleInPlace(-1);
        const left = MathTmp.Vector3[1];
        Vector3.CrossToRef(up, back, left);
        // Generate the rotation matrix.
        Matrix.FromValuesToRef(left._x, left._y, left._z, 0.0, up._x, up._y, up._z, 0.0, back._x, back._y, back._z, 0.0, 0, 0, 0, 1.0, result);
        return result;
    }
    /**
     * Creates a new matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)
     * This function generates a matrix suitable for a right handed coordinate system
     * Example Playground - https://playground.babylonjs.com/#AV9X17#68
     * @param forward defines the forward direction - Must be normalized and orthogonal to up.
     * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
     * @returns the new matrix
     */
    static LookDirectionRH(forward, up) {
        const result = new Matrix();
        Matrix.LookDirectionRHToRef(forward, up, result);
        return result;
    }
    /**
     * Sets the given "result" Matrix to a matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)
     * This function generates a matrix suitable for a right handed coordinate system
     * Example Playground - https://playground.babylonjs.com/#AV9X17#69
     * @param forward defines the forward direction - Must be normalized and orthogonal to up.
     * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
     * @param result defines the target matrix
     * @returns result input
     */
    static LookDirectionRHToRef(forward, up, result) {
        const right = MathTmp.Vector3[2];
        Vector3.CrossToRef(up, forward, right);
        // Generate the rotation matrix.
        Matrix.FromValuesToRef(right._x, right._y, right._z, 0.0, up._x, up._y, up._z, 0.0, forward._x, forward._y, forward._z, 0.0, 0, 0, 0, 1.0, result);
        return result;
    }
    /**
     * Create a left-handed orthographic projection matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#70
     * @param width defines the viewport width
     * @param height defines the viewport height
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @returns a new matrix as a left-handed orthographic projection matrix
     */
    static OrthoLH(width, height, znear, zfar, halfZRange) {
        const matrix = new Matrix();
        Matrix.OrthoLHToRef(width, height, znear, zfar, matrix, halfZRange);
        return matrix;
    }
    /**
     * Store a left-handed orthographic projection to a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#71
     * @param width defines the viewport width
     * @param height defines the viewport height
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane
     * @param result defines the target matrix
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @returns result input
     */
    static OrthoLHToRef(width, height, znear, zfar, result, halfZRange) {
        const n = znear;
        const f = zfar;
        const a = 2.0 / width;
        const b = 2.0 / height;
        const c = 2.0 / (f - n);
        const d = -(f + n) / (f - n);
        Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, 0.0, 0.0, d, 1.0, result);
        if (halfZRange) {
            result.multiplyToRef(mtxConvertNDCToHalfZRange, result);
        }
        result._updateIdentityStatus(a === 1 && b === 1 && c === 1 && d === 0);
        return result;
    }
    /**
     * Create a left-handed orthographic projection matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#72
     * @param left defines the viewport left coordinate
     * @param right defines the viewport right coordinate
     * @param bottom defines the viewport bottom coordinate
     * @param top defines the viewport top coordinate
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @returns a new matrix as a left-handed orthographic projection matrix
     */
    static OrthoOffCenterLH(left, right, bottom, top, znear, zfar, halfZRange) {
        const matrix = new Matrix();
        Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange);
        return matrix;
    }
    /**
     * Stores a left-handed orthographic projection into a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#73
     * @param left defines the viewport left coordinate
     * @param right defines the viewport right coordinate
     * @param bottom defines the viewport bottom coordinate
     * @param top defines the viewport top coordinate
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane
     * @param result defines the target matrix
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @returns result input
     */
    static OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange) {
        const n = znear;
        const f = zfar;
        const a = 2.0 / (right - left);
        const b = 2.0 / (top - bottom);
        const c = 2.0 / (f - n);
        const d = -(f + n) / (f - n);
        const i0 = (left + right) / (left - right);
        const i1 = (top + bottom) / (bottom - top);
        Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, i0, i1, d, 1.0, result);
        if (halfZRange) {
            result.multiplyToRef(mtxConvertNDCToHalfZRange, result);
        }
        result.markAsUpdated();
        return result;
    }
    /**
     * Stores a left-handed oblique projection into a given matrix
     * @param left defines the viewport left coordinate
     * @param right defines the viewport right coordinate
     * @param bottom defines the viewport bottom coordinate
     * @param top defines the viewport top coordinate
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane
     * @param length Length of the shear
     * @param angle Angle (along X/Y Plane) to apply shear
     * @param distance Distance from shear point
     * @param result defines the target matrix
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @returns result input
     */
    static ObliqueOffCenterLHToRef(left, right, bottom, top, znear, zfar, length, angle, distance, result, halfZRange) {
        const a = -length * Math.cos(angle);
        const b = -length * Math.sin(angle);
        Matrix.TranslationToRef(0, 0, -distance, MathTmp.Matrix[1]);
        Matrix.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, a, b, 1, 0, 0, 0, 0, 1, MathTmp.Matrix[0]);
        MathTmp.Matrix[1].multiplyToRef(MathTmp.Matrix[0], MathTmp.Matrix[0]);
        Matrix.TranslationToRef(0, 0, distance, MathTmp.Matrix[1]);
        MathTmp.Matrix[0].multiplyToRef(MathTmp.Matrix[1], MathTmp.Matrix[0]);
        Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);
        MathTmp.Matrix[0].multiplyToRef(result, result);
        return result;
    }
    /**
     * Creates a right-handed orthographic projection matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#76
     * @param left defines the viewport left coordinate
     * @param right defines the viewport right coordinate
     * @param bottom defines the viewport bottom coordinate
     * @param top defines the viewport top coordinate
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @returns a new matrix as a right-handed orthographic projection matrix
     */
    static OrthoOffCenterRH(left, right, bottom, top, znear, zfar, halfZRange) {
        const matrix = new Matrix();
        Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange);
        return matrix;
    }
    /**
     * Stores a right-handed orthographic projection into a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#77
     * @param left defines the viewport left coordinate
     * @param right defines the viewport right coordinate
     * @param bottom defines the viewport bottom coordinate
     * @param top defines the viewport top coordinate
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane
     * @param result defines the target matrix
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @returns result input
     */
    static OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, result, halfZRange) {
        Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);
        result._m[10] *= -1; // No need to call markAsUpdated as previous function already called it and let _isIdentityDirty to true
        return result;
    }
    /**
     * Stores a right-handed oblique projection into a given matrix
     * @param left defines the viewport left coordinate
     * @param right defines the viewport right coordinate
     * @param bottom defines the viewport bottom coordinate
     * @param top defines the viewport top coordinate
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane
     * @param length Length of the shear
     * @param angle Angle (along X/Y Plane) to apply shear
     * @param distance Distance from shear point
     * @param result defines the target matrix
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @returns result input
     */
    static ObliqueOffCenterRHToRef(left, right, bottom, top, znear, zfar, length, angle, distance, result, halfZRange) {
        const a = length * Math.cos(angle);
        const b = length * Math.sin(angle);
        Matrix.TranslationToRef(0, 0, distance, MathTmp.Matrix[1]);
        Matrix.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, a, b, 1, 0, 0, 0, 0, 1, MathTmp.Matrix[0]);
        MathTmp.Matrix[1].multiplyToRef(MathTmp.Matrix[0], MathTmp.Matrix[0]);
        Matrix.TranslationToRef(0, 0, -distance, MathTmp.Matrix[1]);
        MathTmp.Matrix[0].multiplyToRef(MathTmp.Matrix[1], MathTmp.Matrix[0]);
        Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);
        MathTmp.Matrix[0].multiplyToRef(result, result);
        return result;
    }
    /**
     * Creates a left-handed perspective projection matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#85
     * @param width defines the viewport width
     * @param height defines the viewport height
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
     * @returns a new matrix as a left-handed perspective projection matrix
     */
    static PerspectiveLH(width, height, znear, zfar, halfZRange, projectionPlaneTilt = 0) {
        const matrix = new Matrix();
        const n = znear;
        const f = zfar;
        const a = (2.0 * n) / width;
        const b = (2.0 * n) / height;
        const c = (f + n) / (f - n);
        const d = (-2.0 * f * n) / (f - n);
        const rot = Math.tan(projectionPlaneTilt);
        Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, matrix);
        if (halfZRange) {
            matrix.multiplyToRef(mtxConvertNDCToHalfZRange, matrix);
        }
        matrix._updateIdentityStatus(false);
        return matrix;
    }
    /**
     * Creates a left-handed perspective projection matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#78
     * @param fov defines the horizontal field of view
     * @param aspect defines the aspect ratio
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane. If 0, assume we are in "infinite zfar" mode
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
     * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
     * @returns a new matrix as a left-handed perspective projection matrix
     */
    static PerspectiveFovLH(fov, aspect, znear, zfar, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = false) {
        const matrix = new Matrix();
        Matrix.PerspectiveFovLHToRef(fov, aspect, znear, zfar, matrix, true, halfZRange, projectionPlaneTilt, reverseDepthBufferMode);
        return matrix;
    }
    /**
     * Stores a left-handed perspective projection into a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#81
     * @param fov defines the horizontal field of view
     * @param aspect defines the aspect ratio
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane. If 0, assume we are in "infinite zfar" mode
     * @param result defines the target matrix
     * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
     * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
     * @returns result input
     */
    static PerspectiveFovLHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = true, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = false) {
        const n = znear;
        const f = zfar;
        const t = 1.0 / Math.tan(fov * 0.5);
        const a = isVerticalFovFixed ? t / aspect : t;
        const b = isVerticalFovFixed ? t : t * aspect;
        const c = reverseDepthBufferMode && n === 0 ? -1 : f !== 0 ? (f + n) / (f - n) : 1;
        const d = reverseDepthBufferMode && n === 0 ? 2 * f : f !== 0 ? (-2.0 * f * n) / (f - n) : -2 * n;
        const rot = Math.tan(projectionPlaneTilt);
        Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, result);
        if (halfZRange) {
            result.multiplyToRef(mtxConvertNDCToHalfZRange, result);
        }
        result._updateIdentityStatus(false);
        return result;
    }
    /**
     * Stores a left-handed perspective projection into a given matrix with depth reversed
     * Example Playground - https://playground.babylonjs.com/#AV9X17#89
     * @param fov defines the horizontal field of view
     * @param aspect defines the aspect ratio
     * @param znear defines the near clip plane
     * @param zfar not used as infinity is used as far clip
     * @param result defines the target matrix
     * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
     * @returns result input
     */
    static PerspectiveFovReverseLHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = true, halfZRange, projectionPlaneTilt = 0) {
        const t = 1.0 / Math.tan(fov * 0.5);
        const a = isVerticalFovFixed ? t / aspect : t;
        const b = isVerticalFovFixed ? t : t * aspect;
        const rot = Math.tan(projectionPlaneTilt);
        Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, -znear, 1.0, 0.0, 0.0, 1.0, 0.0, result);
        if (halfZRange) {
            result.multiplyToRef(mtxConvertNDCToHalfZRange, result);
        }
        result._updateIdentityStatus(false);
        return result;
    }
    /**
     * Creates a right-handed perspective projection matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#83
     * @param fov defines the horizontal field of view
     * @param aspect defines the aspect ratio
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane. If 0, assume we are in "infinite zfar" mode
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
     * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
     * @returns a new matrix as a right-handed perspective projection matrix
     */
    static PerspectiveFovRH(fov, aspect, znear, zfar, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = false) {
        const matrix = new Matrix();
        Matrix.PerspectiveFovRHToRef(fov, aspect, znear, zfar, matrix, true, halfZRange, projectionPlaneTilt, reverseDepthBufferMode);
        return matrix;
    }
    /**
     * Stores a right-handed perspective projection into a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#84
     * @param fov defines the horizontal field of view
     * @param aspect defines the aspect ratio
     * @param znear defines the near clip plane
     * @param zfar defines the far clip plane. If 0, assume we are in "infinite zfar" mode
     * @param result defines the target matrix
     * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
     * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
     * @returns result input
     */
    static PerspectiveFovRHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = true, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = false) {
        //alternatively this could be expressed as:
        //    m = PerspectiveFovLHToRef
        //    m[10] *= -1.0;
        //    m[11] *= -1.0;
        const n = znear;
        const f = zfar;
        const t = 1.0 / Math.tan(fov * 0.5);
        const a = isVerticalFovFixed ? t / aspect : t;
        const b = isVerticalFovFixed ? t : t * aspect;
        const c = reverseDepthBufferMode && n === 0 ? 1 : f !== 0 ? -(f + n) / (f - n) : -1;
        const d = reverseDepthBufferMode && n === 0 ? 2 * f : f !== 0 ? (-2 * f * n) / (f - n) : -2 * n;
        const rot = Math.tan(projectionPlaneTilt);
        Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, c, -1.0, 0.0, 0.0, d, 0.0, result);
        if (halfZRange) {
            result.multiplyToRef(mtxConvertNDCToHalfZRange, result);
        }
        result._updateIdentityStatus(false);
        return result;
    }
    /**
     * Stores a right-handed perspective projection into a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#90
     * @param fov defines the horizontal field of view
     * @param aspect defines the aspect ratio
     * @param znear defines the near clip plane
     * @param zfar not used as infinity is used as far clip
     * @param result defines the target matrix
     * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
     * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
     * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
     * @returns result input
     */
    static PerspectiveFovReverseRHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = true, halfZRange, projectionPlaneTilt = 0) {
        const t = 1.0 / Math.tan(fov * 0.5);
        const a = isVerticalFovFixed ? t / aspect : t;
        const b = isVerticalFovFixed ? t : t * aspect;
        const rot = Math.tan(projectionPlaneTilt);
        Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, -znear, -1.0, 0.0, 0.0, -1.0, 0.0, result);
        if (halfZRange) {
            result.multiplyToRef(mtxConvertNDCToHalfZRange, result);
        }
        result._updateIdentityStatus(false);
        return result;
    }
    /**
     * Computes a complete transformation matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#113
     * @param viewport defines the viewport to use
     * @param world defines the world matrix
     * @param view defines the view matrix
     * @param projection defines the projection matrix
     * @param zmin defines the near clip plane
     * @param zmax defines the far clip plane
     * @returns the transformation matrix
     */
    static GetFinalMatrix(viewport, world, view, projection, zmin, zmax) {
        const cw = viewport.width;
        const ch = viewport.height;
        const cx = viewport.x;
        const cy = viewport.y;
        const viewportMatrix = Matrix.FromValues(cw / 2.0, 0.0, 0.0, 0.0, 0.0, -ch / 2.0, 0.0, 0.0, 0.0, 0.0, zmax - zmin, 0.0, cx + cw / 2.0, ch / 2.0 + cy, zmin, 1.0);
        const matrix = new Matrix();
        world.multiplyToRef(view, matrix);
        matrix.multiplyToRef(projection, matrix);
        return matrix.multiplyToRef(viewportMatrix, matrix);
    }
    /**
     * Extracts a 2x2 matrix from a given matrix and store the result in a Float32Array
     * @param matrix defines the matrix to use
     * @returns a new Float32Array array with 4 elements : the 2x2 matrix extracted from the given matrix
     */
    static GetAsMatrix2x2(matrix) {
        const m = matrix.m;
        const arr = [m[0], m[1], m[4], m[5]];
        return _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_3__/* .PerformanceConfigurator */ .I.MatrixUse64Bits ? arr : new Float32Array(arr);
    }
    /**
     * Extracts a 3x3 matrix from a given matrix and store the result in a Float32Array
     * @param matrix defines the matrix to use
     * @returns a new Float32Array array with 9 elements : the 3x3 matrix extracted from the given matrix
     */
    static GetAsMatrix3x3(matrix) {
        const m = matrix.m;
        const arr = [m[0], m[1], m[2], m[4], m[5], m[6], m[8], m[9], m[10]];
        return _Engines_performanceConfigurator_js__WEBPACK_IMPORTED_MODULE_3__/* .PerformanceConfigurator */ .I.MatrixUse64Bits ? arr : new Float32Array(arr);
    }
    /**
     * Compute the transpose of a given matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#111
     * @param matrix defines the matrix to transpose
     * @returns the new matrix
     */
    static Transpose(matrix) {
        const result = new Matrix();
        Matrix.TransposeToRef(matrix, result);
        return result;
    }
    /**
     * Compute the transpose of a matrix and store it in a target matrix
     * Example Playground - https://playground.babylonjs.com/#AV9X17#112
     * @param matrix defines the matrix to transpose
     * @param result defines the target matrix
     * @returns result input
     */
    static TransposeToRef(matrix, result) {
        const mm = matrix.m;
        const rm0 = mm[0];
        const rm1 = mm[4];
        const rm2 = mm[8];
        const rm3 = mm[12];
        const rm4 = mm[1];
        const rm5 = mm[5];
        const rm6 = mm[9];
        const rm7 = mm[13];
        const rm8 = mm[2];
        const rm9 = mm[6];
        const rm10 = mm[10];
        const rm11 = mm[14];
        const rm12 = mm[3];
        const rm13 = mm[7];
        const rm14 = mm[11];
        const rm15 = mm[15];
        const rm = result._m;
        rm[0] = rm0;
        rm[1] = rm1;
        rm[2] = rm2;
        rm[3] = rm3;
        rm[4] = rm4;
        rm[5] = rm5;
        rm[6] = rm6;
        rm[7] = rm7;
        rm[8] = rm8;
        rm[9] = rm9;
        rm[10] = rm10;
        rm[11] = rm11;
        rm[12] = rm12;
        rm[13] = rm13;
        rm[14] = rm14;
        rm[15] = rm15;
        result.markAsUpdated();
        // identity-ness does not change when transposing
        result._updateIdentityStatus(matrix._isIdentity, matrix._isIdentityDirty);
        return result;
    }
    /**
     * Computes a reflection matrix from a plane
     * Example Playground - https://playground.babylonjs.com/#AV9X17#87
     * @param plane defines the reflection plane
     * @returns a new matrix
     */
    static Reflection(plane) {
        const matrix = new Matrix();
        Matrix.ReflectionToRef(plane, matrix);
        return matrix;
    }
    /**
     * Computes a reflection matrix from a plane
     * Example Playground - https://playground.babylonjs.com/#AV9X17#88
     * @param plane defines the reflection plane
     * @param result defines the target matrix
     * @returns result input
     */
    static ReflectionToRef(plane, result) {
        plane.normalize();
        const x = plane.normal.x;
        const y = plane.normal.y;
        const z = plane.normal.z;
        const temp = -2 * x;
        const temp2 = -2 * y;
        const temp3 = -2 * z;
        Matrix.FromValuesToRef(temp * x + 1, temp2 * x, temp3 * x, 0.0, temp * y, temp2 * y + 1, temp3 * y, 0.0, temp * z, temp2 * z, temp3 * z + 1, 0.0, temp * plane.d, temp2 * plane.d, temp3 * plane.d, 1.0, result);
        return result;
    }
    /**
     * Sets the given matrix as a rotation matrix composed from the 3 left handed axes
     * @param xaxis defines the value of the 1st axis
     * @param yaxis defines the value of the 2nd axis
     * @param zaxis defines the value of the 3rd axis
     * @param result defines the target matrix
     * @returns result input
     */
    static FromXYZAxesToRef(xaxis, yaxis, zaxis, result) {
        Matrix.FromValuesToRef(xaxis._x, xaxis._y, xaxis._z, 0.0, yaxis._x, yaxis._y, yaxis._z, 0.0, zaxis._x, zaxis._y, zaxis._z, 0.0, 0.0, 0.0, 0.0, 1.0, result);
        return result;
    }
    /**
     * Creates a rotation matrix from a quaternion and stores it in a target matrix
     * @param quat defines the quaternion to use
     * @param result defines the target matrix
     * @returns result input
     */
    static FromQuaternionToRef(quat, result) {
        const xx = quat._x * quat._x;
        const yy = quat._y * quat._y;
        const zz = quat._z * quat._z;
        const xy = quat._x * quat._y;
        const zw = quat._z * quat._w;
        const zx = quat._z * quat._x;
        const yw = quat._y * quat._w;
        const yz = quat._y * quat._z;
        const xw = quat._x * quat._w;
        result._m[0] = 1.0 - 2.0 * (yy + zz);
        result._m[1] = 2.0 * (xy + zw);
        result._m[2] = 2.0 * (zx - yw);
        result._m[3] = 0.0;
        result._m[4] = 2.0 * (xy - zw);
        result._m[5] = 1.0 - 2.0 * (zz + xx);
        result._m[6] = 2.0 * (yz + xw);
        result._m[7] = 0.0;
        result._m[8] = 2.0 * (zx + yw);
        result._m[9] = 2.0 * (yz - xw);
        result._m[10] = 1.0 - 2.0 * (yy + xx);
        result._m[11] = 0.0;
        result._m[12] = 0.0;
        result._m[13] = 0.0;
        result._m[14] = 0.0;
        result._m[15] = 1.0;
        result.markAsUpdated();
        return result;
    }
}
Matrix._UpdateFlagSeed = 0;
Matrix._IdentityReadOnly = Matrix.Identity();
Object.defineProperties(Matrix.prototype, {
    dimension: { value: [4, 4] },
    rank: { value: 2 },
});
/**
 * @internal
 * Same as Tmp but not exported to keep it only for math functions to avoid conflicts
 */
class MathTmp {
}
// Temporary Vector3s
MathTmp.Vector3 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildTuple */ .ln)(11, Vector3.Zero);
// Temporary Matricies
MathTmp.Matrix = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildTuple */ .ln)(2, Matrix.Identity);
// Temporary Quaternions
MathTmp.Quaternion = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildTuple */ .ln)(3, Quaternion.Zero);
/**
 * @internal
 */
class TmpVectors {
}
/** 3 temp Vector2 at once should be enough */
TmpVectors.Vector2 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildTuple */ .ln)(3, Vector2.Zero);
/** 13 temp Vector3 at once should be enough */
TmpVectors.Vector3 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildTuple */ .ln)(13, Vector3.Zero);
/** 3 temp Vector4 at once should be enough */
TmpVectors.Vector4 = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildTuple */ .ln)(3, Vector4.Zero);
/** 3 temp Quaternion at once should be enough */
TmpVectors.Quaternion = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildTuple */ .ln)(3, Quaternion.Zero);
/** 8 temp Matrices at once should be enough */
TmpVectors.Matrix = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_1__/* .BuildTuple */ .ln)(8, Matrix.Identity);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)("BABYLON.Vector2", Vector2);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)("BABYLON.Vector3", Vector3);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)("BABYLON.Vector4", Vector4);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)("BABYLON.Matrix", Matrix);
const mtxConvertNDCToHalfZRange = Matrix.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1);
//# sourceMappingURL=math.vector.js.map

/***/ }),

/***/ 54494:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   L: () => (/* binding */ Viewport)
/* harmony export */ });
/**
 * Class used to represent a viewport on screen
 */
class Viewport {
    /**
     * Creates a Viewport object located at (x, y) and sized (width, height)
     * @param x defines viewport left coordinate
     * @param y defines viewport top coordinate
     * @param width defines the viewport width
     * @param height defines the viewport height
     */
    constructor(
    /** viewport left coordinate */
    x, 
    /** viewport top coordinate */
    y, 
    /**viewport width */
    width, 
    /** viewport height */
    height) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
    }
    /**
     * Creates a new viewport using absolute sizing (from 0-> width, 0-> height instead of 0->1)
     * @param renderWidth defines the rendering width
     * @param renderHeight defines the rendering height
     * @returns a new Viewport
     */
    toGlobal(renderWidth, renderHeight) {
        return new Viewport(this.x * renderWidth, this.y * renderHeight, this.width * renderWidth, this.height * renderHeight);
    }
    /**
     * Stores absolute viewport value into a target viewport (from 0-> width, 0-> height instead of 0->1)
     * @param renderWidth defines the rendering width
     * @param renderHeight defines the rendering height
     * @param ref defines the target viewport
     * @returns the current viewport
     */
    toGlobalToRef(renderWidth, renderHeight, ref) {
        ref.x = this.x * renderWidth;
        ref.y = this.y * renderHeight;
        ref.width = this.width * renderWidth;
        ref.height = this.height * renderHeight;
        return this;
    }
    /**
     * Returns a new Viewport copied from the current one
     * @returns a new Viewport
     */
    clone() {
        return new Viewport(this.x, this.y, this.width, this.height);
    }
}
//# sourceMappingURL=math.viewport.js.map

/***/ }),

/***/ 77517:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   O: () => (/* binding */ SphericalHarmonics),
/* harmony export */   Q: () => (/* binding */ SphericalPolynomial)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62956);
/* eslint-disable @typescript-eslint/naming-convention */


// https://dickyjim.wordpress.com/2013/09/04/spherical-harmonics-for-beginners/
// http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf
// https://www.ppsloan.org/publications/StupidSH36.pdf
// http://cseweb.ucsd.edu/~ravir/papers/envmap/envmap.pdf
// https://www.ppsloan.org/publications/SHJCGT.pdf
// https://www.ppsloan.org/publications/shdering.pdf
// https://google.github.io/filament/Filament.md.html#annex/sphericalharmonics
// https://patapom.com/blog/SHPortal/
// https://imdoingitwrong.wordpress.com/2011/04/14/spherical-harmonics-wtf/
// Using real SH basis:
//  m>0             m   m
// y   = sqrt(2) * K * P * cos(m*phi) * cos(theta)
//  l               l   l
//
//  m<0             m   |m|
// y   = sqrt(2) * K * P * sin(m*phi) * cos(theta)
//  l               l   l
//
//  m=0   0   0
// y   = K * P * trigono terms
//  l     l   l
//
//  m       (2l + 1)(l - |m|)!
// K = sqrt(------------------)
//  l           4pi(l + |m|)!
//
// and P by recursion:
//
// P00(x) = 1
// P01(x) = x
// Pll(x) = (-1^l)(2l - 1)!!(1-x*x)^(1/2)
//          ((2l - 1)x[Pl-1/m]-(l + m - 1)[Pl-2/m])
// Plm(x) = ---------------------------------------
//                         l - m
// Leaving the trigonometric terms aside we can precompute the constants to :
const SH3ylmBasisConstants = [
    Math.sqrt(1 / (4 * Math.PI)), // l00
    -Math.sqrt(3 / (4 * Math.PI)), // l1_1
    Math.sqrt(3 / (4 * Math.PI)), // l10
    -Math.sqrt(3 / (4 * Math.PI)), // l11
    Math.sqrt(15 / (4 * Math.PI)), // l2_2
    -Math.sqrt(15 / (4 * Math.PI)), // l2_1
    Math.sqrt(5 / (16 * Math.PI)), // l20
    -Math.sqrt(15 / (4 * Math.PI)), // l21
    Math.sqrt(15 / (16 * Math.PI)), // l22
];
// cm = cos(m * phi)
// sm = sin(m * phi)
// {x,y,z} = {cos(phi)sin(theta), sin(phi)sin(theta), cos(theta)}
// By recursion on using trigo identities:
const SH3ylmBasisTrigonometricTerms = [
    () => 1, // l00
    (direction) => direction.y, // l1_1
    (direction) => direction.z, // l10
    (direction) => direction.x, // l11
    (direction) => direction.x * direction.y, // l2_2
    (direction) => direction.y * direction.z, // l2_1
    (direction) => 3 * direction.z * direction.z - 1, // l20
    (direction) => direction.x * direction.z, // l21
    (direction) => direction.x * direction.x - direction.y * direction.y, // l22
];
// Wrap the full compute
const applySH3 = (lm, direction) => {
    return SH3ylmBasisConstants[lm] * SH3ylmBasisTrigonometricTerms[lm](direction);
};
// Derived from the integration of the a kernel convolution to SH.
// Great explanation here: https://patapom.com/blog/SHPortal/#about-distant-radiance-and-irradiance-environments
const SHCosKernelConvolution = [Math.PI, (2 * Math.PI) / 3, (2 * Math.PI) / 3, (2 * Math.PI) / 3, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4];
/**
 * Class representing spherical harmonics coefficients to the 3rd degree
 */
class SphericalHarmonics {
    constructor() {
        /**
         * Defines whether or not the harmonics have been prescaled for rendering.
         */
        this.preScaled = false;
        /**
         * The l0,0 coefficients of the spherical harmonics
         */
        this.l00 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The l1,-1 coefficients of the spherical harmonics
         */
        this.l1_1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The l1,0 coefficients of the spherical harmonics
         */
        this.l10 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The l1,1 coefficients of the spherical harmonics
         */
        this.l11 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The l2,-2 coefficients of the spherical harmonics
         */
        this.l2_2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The l2,-1 coefficients of the spherical harmonics
         */
        this.l2_1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The l2,0 coefficients of the spherical harmonics
         */
        this.l20 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The l2,1 coefficients of the spherical harmonics
         */
        this.l21 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The l2,2 coefficients of the spherical harmonics
         */
        this.l22 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
    }
    /**
     * Adds a light to the spherical harmonics
     * @param direction the direction of the light
     * @param color the color of the light
     * @param deltaSolidAngle the delta solid angle of the light
     */
    addLight(direction, color, deltaSolidAngle) {
        _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0].set(color.r, color.g, color.b);
        const colorVector = _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
        const c = _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1];
        colorVector.scaleToRef(deltaSolidAngle, c);
        c.scaleToRef(applySH3(0, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        this.l00.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        c.scaleToRef(applySH3(1, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        this.l1_1.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        c.scaleToRef(applySH3(2, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        this.l10.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        c.scaleToRef(applySH3(3, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        this.l11.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        c.scaleToRef(applySH3(4, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        this.l2_2.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        c.scaleToRef(applySH3(5, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        this.l2_1.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        c.scaleToRef(applySH3(6, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        this.l20.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        c.scaleToRef(applySH3(7, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        this.l21.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        c.scaleToRef(applySH3(8, direction), _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
        this.l22.addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[2]);
    }
    /**
     * Scales the spherical harmonics by the given amount
     * @param scale the amount to scale
     */
    scaleInPlace(scale) {
        this.l00.scaleInPlace(scale);
        this.l1_1.scaleInPlace(scale);
        this.l10.scaleInPlace(scale);
        this.l11.scaleInPlace(scale);
        this.l2_2.scaleInPlace(scale);
        this.l2_1.scaleInPlace(scale);
        this.l20.scaleInPlace(scale);
        this.l21.scaleInPlace(scale);
        this.l22.scaleInPlace(scale);
    }
    /**
     * Convert from incident radiance (Li) to irradiance (E) by applying convolution with the cosine-weighted hemisphere.
     *
     * ```
     * E_lm = A_l * L_lm
     * ```
     *
     * In spherical harmonics this convolution amounts to scaling factors for each frequency band.
     * This corresponds to equation 5 in "An Efficient Representation for Irradiance Environment Maps", where
     * the scaling factors are given in equation 9.
     */
    convertIncidentRadianceToIrradiance() {
        // Constant (Band 0)
        this.l00.scaleInPlace(SHCosKernelConvolution[0]);
        // Linear (Band 1)
        this.l1_1.scaleInPlace(SHCosKernelConvolution[1]);
        this.l10.scaleInPlace(SHCosKernelConvolution[2]);
        this.l11.scaleInPlace(SHCosKernelConvolution[3]);
        // Quadratic (Band 2)
        this.l2_2.scaleInPlace(SHCosKernelConvolution[4]);
        this.l2_1.scaleInPlace(SHCosKernelConvolution[5]);
        this.l20.scaleInPlace(SHCosKernelConvolution[6]);
        this.l21.scaleInPlace(SHCosKernelConvolution[7]);
        this.l22.scaleInPlace(SHCosKernelConvolution[8]);
    }
    /**
     * Convert from irradiance to outgoing radiance for Lambertian BDRF, suitable for efficient shader evaluation.
     *
     * ```
     * L = (1/pi) * E * rho
     * ```
     *
     * This is done by an additional scale by 1/pi, so is a fairly trivial operation but important conceptually.
     */
    convertIrradianceToLambertianRadiance() {
        this.scaleInPlace(1.0 / Math.PI);
        // The resultant SH now represents outgoing radiance, so includes the Lambert 1/pi normalisation factor but without albedo (rho) applied
        // (The pixel shader must apply albedo after texture fetches, etc).
    }
    /**
     * Integrates the reconstruction coefficients directly in to the SH preventing further
     * required operations at run time.
     *
     * This is simply done by scaling back the SH with Ylm constants parameter.
     * The trigonometric part being applied by the shader at run time.
     */
    preScaleForRendering() {
        this.preScaled = true;
        this.l00.scaleInPlace(SH3ylmBasisConstants[0]);
        this.l1_1.scaleInPlace(SH3ylmBasisConstants[1]);
        this.l10.scaleInPlace(SH3ylmBasisConstants[2]);
        this.l11.scaleInPlace(SH3ylmBasisConstants[3]);
        this.l2_2.scaleInPlace(SH3ylmBasisConstants[4]);
        this.l2_1.scaleInPlace(SH3ylmBasisConstants[5]);
        this.l20.scaleInPlace(SH3ylmBasisConstants[6]);
        this.l21.scaleInPlace(SH3ylmBasisConstants[7]);
        this.l22.scaleInPlace(SH3ylmBasisConstants[8]);
    }
    /**
     * update the spherical harmonics coefficients from the given array
     * @param data defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
     * @returns the spherical harmonics (this)
     */
    updateFromArray(data) {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[0], 0, this.l00);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[1], 0, this.l1_1);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[2], 0, this.l10);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[3], 0, this.l11);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[4], 0, this.l2_2);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[5], 0, this.l2_1);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[6], 0, this.l20);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[7], 0, this.l21);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[8], 0, this.l22);
        return this;
    }
    /**
     * update the spherical harmonics coefficients from the given floats array
     * @param data defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
     * @returns the spherical harmonics (this)
     */
    updateFromFloatsArray(data) {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromFloatsToRef(data[0], data[1], data[2], this.l00);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromFloatsToRef(data[3], data[4], data[5], this.l1_1);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromFloatsToRef(data[6], data[7], data[8], this.l10);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromFloatsToRef(data[9], data[10], data[11], this.l11);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromFloatsToRef(data[12], data[13], data[14], this.l2_2);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromFloatsToRef(data[15], data[16], data[17], this.l2_1);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromFloatsToRef(data[18], data[19], data[20], this.l20);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromFloatsToRef(data[21], data[22], data[23], this.l21);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromFloatsToRef(data[24], data[25], data[26], this.l22);
        return this;
    }
    /**
     * Constructs a spherical harmonics from an array.
     * @param data defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
     * @returns the spherical harmonics
     */
    static FromArray(data) {
        const sh = new SphericalHarmonics();
        return sh.updateFromArray(data);
    }
    // Keep for references.
    /**
     * Gets the spherical harmonics from polynomial
     * @param polynomial the spherical polynomial
     * @returns the spherical harmonics
     */
    static FromPolynomial(polynomial) {
        const result = new SphericalHarmonics();
        result.l00 = polynomial.xx.scale(0.376127).add(polynomial.yy.scale(0.376127)).add(polynomial.zz.scale(0.376126));
        result.l1_1 = polynomial.y.scale(0.977204);
        result.l10 = polynomial.z.scale(0.977204);
        result.l11 = polynomial.x.scale(0.977204);
        result.l2_2 = polynomial.xy.scale(1.16538);
        result.l2_1 = polynomial.yz.scale(1.16538);
        result.l20 = polynomial.zz.scale(1.34567).subtract(polynomial.xx.scale(0.672834)).subtract(polynomial.yy.scale(0.672834));
        result.l21 = polynomial.zx.scale(1.16538);
        result.l22 = polynomial.xx.scale(1.16538).subtract(polynomial.yy.scale(1.16538));
        result.l1_1.scaleInPlace(-1);
        result.l11.scaleInPlace(-1);
        result.l2_1.scaleInPlace(-1);
        result.l21.scaleInPlace(-1);
        result.scaleInPlace(Math.PI);
        return result;
    }
}
/**
 * Class representing spherical polynomial coefficients to the 3rd degree
 */
class SphericalPolynomial {
    constructor() {
        /**
         * The x coefficients of the spherical polynomial
         */
        this.x = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The y coefficients of the spherical polynomial
         */
        this.y = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The z coefficients of the spherical polynomial
         */
        this.z = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The xx coefficients of the spherical polynomial
         */
        this.xx = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The yy coefficients of the spherical polynomial
         */
        this.yy = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The zz coefficients of the spherical polynomial
         */
        this.zz = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The xy coefficients of the spherical polynomial
         */
        this.xy = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The yz coefficients of the spherical polynomial
         */
        this.yz = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The zx coefficients of the spherical polynomial
         */
        this.zx = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
    }
    /**
     * The spherical harmonics used to create the polynomials.
     */
    get preScaledHarmonics() {
        if (!this._harmonics) {
            this._harmonics = SphericalHarmonics.FromPolynomial(this);
        }
        if (!this._harmonics.preScaled) {
            this._harmonics.preScaleForRendering();
        }
        return this._harmonics;
    }
    /**
     * Adds an ambient color to the spherical polynomial
     * @param color the color to add
     */
    addAmbient(color) {
        _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0].copyFromFloats(color.r, color.g, color.b);
        const colorVector = _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
        this.xx.addInPlace(colorVector);
        this.yy.addInPlace(colorVector);
        this.zz.addInPlace(colorVector);
    }
    /**
     * Scales the spherical polynomial by the given amount
     * @param scale the amount to scale
     */
    scaleInPlace(scale) {
        this.x.scaleInPlace(scale);
        this.y.scaleInPlace(scale);
        this.z.scaleInPlace(scale);
        this.xx.scaleInPlace(scale);
        this.yy.scaleInPlace(scale);
        this.zz.scaleInPlace(scale);
        this.yz.scaleInPlace(scale);
        this.zx.scaleInPlace(scale);
        this.xy.scaleInPlace(scale);
    }
    /**
     * Updates the spherical polynomial from harmonics
     * @param harmonics the spherical harmonics
     * @returns the spherical polynomial
     */
    updateFromHarmonics(harmonics) {
        this._harmonics = harmonics;
        this.x.copyFrom(harmonics.l11);
        this.x.scaleInPlace(1.02333).scaleInPlace(-1);
        this.y.copyFrom(harmonics.l1_1);
        this.y.scaleInPlace(1.02333).scaleInPlace(-1);
        this.z.copyFrom(harmonics.l10);
        this.z.scaleInPlace(1.02333);
        this.xx.copyFrom(harmonics.l00);
        _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0].copyFrom(harmonics.l20).scaleInPlace(0.247708);
        _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1].copyFrom(harmonics.l22).scaleInPlace(0.429043);
        this.xx.scaleInPlace(0.886277).subtractInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0]).addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1]);
        this.yy.copyFrom(harmonics.l00);
        this.yy.scaleInPlace(0.886277).subtractInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0]).subtractInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1]);
        this.zz.copyFrom(harmonics.l00);
        _math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0].copyFrom(harmonics.l20).scaleInPlace(0.495417);
        this.zz.scaleInPlace(0.886277).addInPlace(_math_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0]);
        this.yz.copyFrom(harmonics.l2_1);
        this.yz.scaleInPlace(0.858086).scaleInPlace(-1);
        this.zx.copyFrom(harmonics.l21);
        this.zx.scaleInPlace(0.858086).scaleInPlace(-1);
        this.xy.copyFrom(harmonics.l2_2);
        this.xy.scaleInPlace(0.858086);
        this.scaleInPlace(1.0 / Math.PI);
        return this;
    }
    /**
     * Gets the spherical polynomial from harmonics
     * @param harmonics the spherical harmonics
     * @returns the spherical polynomial
     */
    static FromHarmonics(harmonics) {
        const result = new SphericalPolynomial();
        return result.updateFromHarmonics(harmonics);
    }
    /**
     * Constructs a spherical polynomial from an array.
     * @param data defines the 9x3 coefficients (x, y, z, xx, yy, zz, yz, zx, xy)
     * @returns the spherical polynomial
     */
    static FromArray(data) {
        const sp = new SphericalPolynomial();
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[0], 0, sp.x);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[1], 0, sp.y);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[2], 0, sp.z);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[3], 0, sp.xx);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[4], 0, sp.yy);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[5], 0, sp.zz);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[6], 0, sp.yz);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[7], 0, sp.zx);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArrayToRef(data[8], 0, sp.xy);
        return sp;
    }
}
//# sourceMappingURL=sphericalPolynomial.js.map

/***/ }),

/***/ 96793:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   G$: () => (/* binding */ CreateSegmentedBoxVertexData),
/* harmony export */   Jo: () => (/* binding */ BoxBuilder),
/* harmony export */   KA: () => (/* binding */ CreateBoxVertexData),
/* harmony export */   an: () => (/* binding */ CreateBox)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26041);
/* harmony import */ var _mesh_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76595);
/* harmony import */ var _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36803);
/* harmony import */ var _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(91313);
/* harmony import */ var _groundBuilder_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(66423);






/**
 * Creates the VertexData for a box
 * @param options an object used to set the following optional parameters for the box, required but can be empty
 * * size sets the width, height and depth of the box to the value of size, optional default 1
 * * width sets the width (x direction) of the box, overwrites the width set by size, optional, default size
 * * height sets the height (y direction) of the box, overwrites the height set by size, optional, default size
 * * depth sets the depth (z direction) of the box, overwrites the depth set by size, optional, default size
 * * faceUV an array of 6 Vector4 elements used to set different images to each box side
 * * faceColors an array of 6 Color3 elements used to set different colors to each box side
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @returns the VertexData of the box
 */
function CreateBoxVertexData(options) {
    const nbFaces = 6;
    let indices = [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23];
    const normals = [
        0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0,
        1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0,
    ];
    const uvs = [];
    let positions = [];
    const width = options.width || options.size || 1;
    const height = options.height || options.size || 1;
    const depth = options.depth || options.size || 1;
    const wrap = options.wrap || false;
    let topBaseAt = options.topBaseAt === void 0 ? 1 : options.topBaseAt;
    let bottomBaseAt = options.bottomBaseAt === void 0 ? 0 : options.bottomBaseAt;
    topBaseAt = (topBaseAt + 4) % 4; // places values as 0 to 3
    bottomBaseAt = (bottomBaseAt + 4) % 4; // places values as 0 to 3
    const topOrder = [2, 0, 3, 1];
    const bottomOrder = [2, 0, 1, 3];
    let topIndex = topOrder[topBaseAt];
    let bottomIndex = bottomOrder[bottomBaseAt];
    let basePositions = [
        1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1,
        1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1,
    ];
    if (wrap) {
        indices = [2, 3, 0, 2, 0, 1, 4, 5, 6, 4, 6, 7, 9, 10, 11, 9, 11, 8, 12, 14, 15, 12, 13, 14];
        basePositions = [
            -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1,
        ];
        let topFaceBase = [
            [1, 1, 1],
            [-1, 1, 1],
            [-1, 1, -1],
            [1, 1, -1],
        ];
        let bottomFaceBase = [
            [-1, -1, 1],
            [1, -1, 1],
            [1, -1, -1],
            [-1, -1, -1],
        ];
        const topFaceOrder = [17, 18, 19, 16];
        const bottomFaceOrder = [22, 23, 20, 21];
        while (topIndex > 0) {
            topFaceBase.unshift(topFaceBase.pop());
            topFaceOrder.unshift(topFaceOrder.pop());
            topIndex--;
        }
        while (bottomIndex > 0) {
            bottomFaceBase.unshift(bottomFaceBase.pop());
            bottomFaceOrder.unshift(bottomFaceOrder.pop());
            bottomIndex--;
        }
        topFaceBase = topFaceBase.flat();
        bottomFaceBase = bottomFaceBase.flat();
        basePositions = basePositions.concat(topFaceBase).concat(bottomFaceBase);
        indices.push(topFaceOrder[0], topFaceOrder[2], topFaceOrder[3], topFaceOrder[0], topFaceOrder[1], topFaceOrder[2]);
        indices.push(bottomFaceOrder[0], bottomFaceOrder[2], bottomFaceOrder[3], bottomFaceOrder[0], bottomFaceOrder[1], bottomFaceOrder[2]);
    }
    const scaleArray = [width / 2, height / 2, depth / 2];
    positions = basePositions.reduce((accumulator, currentValue, currentIndex) => accumulator.concat(currentValue * scaleArray[currentIndex % 3]), []);
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P.DEFAULTSIDE;
    const faceUV = options.faceUV || new Array(6);
    const faceColors = options.faceColors;
    const colors = [];
    // default face colors and UV if undefined
    for (let f = 0; f < 6; f++) {
        if (faceUV[f] === undefined) {
            faceUV[f] = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector4 */ .IU(0, 0, 1, 1);
        }
        if (faceColors && faceColors[f] === undefined) {
            faceColors[f] = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov(1, 1, 1, 1);
        }
    }
    // Create each face in turn.
    for (let index = 0; index < nbFaces; index++) {
        uvs.push(faceUV[index].z, _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_4__/* .useOpenGLOrientationForUV */ .rX ? 1.0 - faceUV[index].w : faceUV[index].w);
        uvs.push(faceUV[index].x, _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_4__/* .useOpenGLOrientationForUV */ .rX ? 1.0 - faceUV[index].w : faceUV[index].w);
        uvs.push(faceUV[index].x, _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_4__/* .useOpenGLOrientationForUV */ .rX ? 1.0 - faceUV[index].y : faceUV[index].y);
        uvs.push(faceUV[index].z, _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_4__/* .useOpenGLOrientationForUV */ .rX ? 1.0 - faceUV[index].y : faceUV[index].y);
        if (faceColors) {
            for (let c = 0; c < 4; c++) {
                colors.push(faceColors[index].r, faceColors[index].g, faceColors[index].b, faceColors[index].a);
            }
        }
    }
    // sides
    _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    // Result
    const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    if (faceColors) {
        const totalColors = sideOrientation === _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P.DOUBLESIDE ? colors.concat(colors) : colors;
        vertexData.colors = totalColors;
    }
    return vertexData;
}
/**
 * Creates the VertexData for a segmented box
 * @param options an object used to set the following optional parameters for the box, required but can be empty
 * * size sets the width, height and depth of the box to the value of size, optional default 1
 * * width sets the width (x direction) of the box, overwrites the width set by size, optional, default size
 * * height sets the height (y direction) of the box, overwrites the height set by size, optional, default size
 * * depth sets the depth (z direction) of the box, overwrites the depth set by size, optional, default size
 * * segments sets the number of segments on the all axis (1 by default)
 * * widthSegments sets the number of segments on the x axis (1 by default)
 * * heightSegments sets the number of segments on the y axis (1 by default)
 * * depthSegments sets the number of segments on the z axis (1 by default)
 * @returns the VertexData of the box
 */
function CreateSegmentedBoxVertexData(options) {
    const width = options.width || options.size || 1;
    const height = options.height || options.size || 1;
    const depth = options.depth || options.size || 1;
    const widthSegments = (options.widthSegments || options.segments || 1) | 0;
    const heightSegments = (options.heightSegments || options.segments || 1) | 0;
    const depthSegments = (options.depthSegments || options.segments || 1) | 0;
    const rotationMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
    const translationMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
    const transformMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
    const bottomPlane = (0,_groundBuilder_js__WEBPACK_IMPORTED_MODULE_5__/* .CreateGroundVertexData */ .EH)({ width: width, height: depth, subdivisionsX: widthSegments, subdivisionsY: depthSegments });
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.TranslationToRef(0, -height / 2, 0, translationMatrix);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.RotationZToRef(Math.PI, rotationMatrix);
    rotationMatrix.multiplyToRef(translationMatrix, transformMatrix);
    bottomPlane.transform(transformMatrix);
    const topPlane = (0,_groundBuilder_js__WEBPACK_IMPORTED_MODULE_5__/* .CreateGroundVertexData */ .EH)({ width: width, height: depth, subdivisionsX: widthSegments, subdivisionsY: depthSegments });
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.TranslationToRef(0, height / 2, 0, transformMatrix);
    topPlane.transform(transformMatrix);
    const negXPlane = (0,_groundBuilder_js__WEBPACK_IMPORTED_MODULE_5__/* .CreateGroundVertexData */ .EH)({ width: height, height: depth, subdivisionsX: heightSegments, subdivisionsY: depthSegments });
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.TranslationToRef(-width / 2, 0, 0, translationMatrix);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.RotationZToRef(Math.PI / 2, rotationMatrix);
    rotationMatrix.multiplyToRef(translationMatrix, transformMatrix);
    negXPlane.transform(transformMatrix);
    const posXPlane = (0,_groundBuilder_js__WEBPACK_IMPORTED_MODULE_5__/* .CreateGroundVertexData */ .EH)({ width: height, height: depth, subdivisionsX: heightSegments, subdivisionsY: depthSegments });
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.TranslationToRef(width / 2, 0, 0, translationMatrix);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.RotationZToRef(-Math.PI / 2, rotationMatrix);
    rotationMatrix.multiplyToRef(translationMatrix, transformMatrix);
    posXPlane.transform(transformMatrix);
    const negZPlane = (0,_groundBuilder_js__WEBPACK_IMPORTED_MODULE_5__/* .CreateGroundVertexData */ .EH)({ width: width, height: height, subdivisionsX: widthSegments, subdivisionsY: heightSegments });
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.TranslationToRef(0, 0, -depth / 2, translationMatrix);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.RotationXToRef(-Math.PI / 2, rotationMatrix);
    rotationMatrix.multiplyToRef(translationMatrix, transformMatrix);
    negZPlane.transform(transformMatrix);
    const posZPlane = (0,_groundBuilder_js__WEBPACK_IMPORTED_MODULE_5__/* .CreateGroundVertexData */ .EH)({ width: width, height: height, subdivisionsX: widthSegments, subdivisionsY: heightSegments });
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.TranslationToRef(0, 0, depth / 2, translationMatrix);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.RotationXToRef(Math.PI / 2, rotationMatrix);
    rotationMatrix.multiplyToRef(translationMatrix, transformMatrix);
    posZPlane.transform(transformMatrix);
    // Result
    bottomPlane.merge([topPlane, posXPlane, negXPlane, negZPlane, posZPlane], true);
    return bottomPlane;
}
/**
 * Creates a box mesh
 * * The parameter `size` sets the size (float) of each box side (default 1)
 * * You can set some different box dimensions by using the parameters `width`, `height` and `depth` (all by default have the same value of `size`)
 * * You can set different colors and different images to each box side by using the parameters `faceColors` (an array of 6 Color3 elements) and `faceUV` (an array of 6 Vector4 elements)
 * * Please read this tutorial : https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#box
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the box mesh
 */
function CreateBox(name, options = {}, scene = null) {
    const box = new _mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e(name, scene);
    options.sideOrientation = _mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e._GetDefaultSideOrientation(options.sideOrientation);
    box._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateBoxVertexData(options);
    vertexData.applyToMesh(box, options.updatable);
    return box;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated please use CreateBox directly
 */
const BoxBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateBox,
};
// Side effects
_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P.CreateBox = CreateBoxVertexData;
_mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e.CreateBox = (name, size, scene = null, updatable, sideOrientation) => {
    const options = {
        size,
        sideOrientation,
        updatable,
    };
    return CreateBox(name, options, scene);
};
//# sourceMappingURL=boxBuilder.js.map

/***/ }),

/***/ 66423:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   EH: () => (/* binding */ CreateGroundVertexData),
/* harmony export */   LL: () => (/* binding */ GroundBuilder),
/* harmony export */   RI: () => (/* binding */ CreateGroundFromHeightMap),
/* harmony export */   k: () => (/* binding */ CreateTiledGroundVertexData),
/* harmony export */   km: () => (/* binding */ CreateGround),
/* harmony export */   ol: () => (/* binding */ CreateTiledGround),
/* harmony export */   r_: () => (/* binding */ CreateGroundFromHeightMapVertexData)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26041);
/* harmony import */ var _mesh_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76595);
/* harmony import */ var _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36803);
/* harmony import */ var _groundMesh_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11420);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(998);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6315);
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65559);
/* harmony import */ var _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91313);









/**
 * Creates the VertexData for a Ground
 * @param options an object used to set the following optional parameters for the Ground, required but can be empty
 * @param options.width the width (x direction) of the ground, optional, default 1
 * @param options.height the height (z direction) of the ground, optional, default 1
 * @param options.subdivisions the number of subdivisions per side, optional, default 1
 * @param options.subdivisionsX the number of subdivisions in the x direction, overrides options.subdivisions, optional, default undefined
 * @param options.subdivisionsY the number of subdivisions in the y direction, overrides options.subdivisions, optional, default undefined
 * @returns the VertexData of the Ground
 */
function CreateGroundVertexData(options) {
    const indices = [];
    const positions = [];
    const normals = [];
    const uvs = [];
    let row, col;
    const width = options.width || options.size || 1;
    const height = options.height || options.size || 1;
    const subdivisionsX = (options.subdivisionsX || options.subdivisions || 1) | 0;
    const subdivisionsY = (options.subdivisionsY || options.subdivisions || 1) | 0;
    for (row = 0; row <= subdivisionsY; row++) {
        for (col = 0; col <= subdivisionsX; col++) {
            const position = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq((col * width) / subdivisionsX - width / 2.0, 0, ((subdivisionsY - row) * height) / subdivisionsY - height / 2.0);
            const normal = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 1.0, 0);
            positions.push(position.x, position.y, position.z);
            normals.push(normal.x, normal.y, normal.z);
            uvs.push(col / subdivisionsX, _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_8__/* .useOpenGLOrientationForUV */ .rX ? row / subdivisionsY : 1.0 - row / subdivisionsY);
        }
    }
    for (row = 0; row < subdivisionsY; row++) {
        for (col = 0; col < subdivisionsX; col++) {
            indices.push(col + 1 + (row + 1) * (subdivisionsX + 1));
            indices.push(col + 1 + row * (subdivisionsX + 1));
            indices.push(col + row * (subdivisionsX + 1));
            indices.push(col + (row + 1) * (subdivisionsX + 1));
            indices.push(col + 1 + (row + 1) * (subdivisionsX + 1));
            indices.push(col + row * (subdivisionsX + 1));
        }
    }
    // Result
    const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates the VertexData for a TiledGround by subdividing the ground into tiles
 * @param options an object used to set the following optional parameters for the Ground
 * @param options.xmin ground minimum X coordinate, default -1
 * @param options.zmin ground minimum Z coordinate, default -1
 * @param options.xmax ground maximum X coordinate, default 1
 * @param options.zmax ground maximum Z coordinate, default 1
 * @param options.subdivisions a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the ground width and height creating 'tiles', default {w: 6, h: 6}
 * @param options.subdivisions.w positive integer, default 6
 * @param options.subdivisions.h positive integer, default 6
 * @param options.precision a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the tile width and height, default {w: 2, h: 2}
 * @param options.precision.w positive integer, default 2
 * @param options.precision.h positive integer, default 2
 * @returns the VertexData of the TiledGround
 */
function CreateTiledGroundVertexData(options) {
    const xmin = options.xmin !== undefined && options.xmin !== null ? options.xmin : -1.0;
    const zmin = options.zmin !== undefined && options.zmin !== null ? options.zmin : -1.0;
    const xmax = options.xmax !== undefined && options.xmax !== null ? options.xmax : 1.0;
    const zmax = options.zmax !== undefined && options.zmax !== null ? options.zmax : 1.0;
    const subdivisions = options.subdivisions || { w: 1, h: 1 };
    const precision = options.precision || { w: 1, h: 1 };
    const indices = [];
    const positions = [];
    const normals = [];
    const uvs = [];
    let row, col, tileRow, tileCol;
    subdivisions.h = subdivisions.h < 1 ? 1 : subdivisions.h;
    subdivisions.w = subdivisions.w < 1 ? 1 : subdivisions.w;
    precision.w = precision.w < 1 ? 1 : precision.w;
    precision.h = precision.h < 1 ? 1 : precision.h;
    const tileSize = {
        w: (xmax - xmin) / subdivisions.w,
        h: (zmax - zmin) / subdivisions.h,
    };
    function applyTile(xTileMin, zTileMin, xTileMax, zTileMax) {
        // Indices
        const base = positions.length / 3;
        const rowLength = precision.w + 1;
        for (row = 0; row < precision.h; row++) {
            for (col = 0; col < precision.w; col++) {
                const square = [base + col + row * rowLength, base + (col + 1) + row * rowLength, base + (col + 1) + (row + 1) * rowLength, base + col + (row + 1) * rowLength];
                indices.push(square[1]);
                indices.push(square[2]);
                indices.push(square[3]);
                indices.push(square[0]);
                indices.push(square[1]);
                indices.push(square[3]);
            }
        }
        // Position, normals and uvs
        const position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        const normal = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 1.0, 0);
        for (row = 0; row <= precision.h; row++) {
            position.z = (row * (zTileMax - zTileMin)) / precision.h + zTileMin;
            for (col = 0; col <= precision.w; col++) {
                position.x = (col * (xTileMax - xTileMin)) / precision.w + xTileMin;
                position.y = 0;
                positions.push(position.x, position.y, position.z);
                normals.push(normal.x, normal.y, normal.z);
                uvs.push(col / precision.w, row / precision.h);
            }
        }
    }
    for (tileRow = 0; tileRow < subdivisions.h; tileRow++) {
        for (tileCol = 0; tileCol < subdivisions.w; tileCol++) {
            applyTile(xmin + tileCol * tileSize.w, zmin + tileRow * tileSize.h, xmin + (tileCol + 1) * tileSize.w, zmin + (tileRow + 1) * tileSize.h);
        }
    }
    // Result
    const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates the VertexData of the Ground designed from a heightmap
 * @param options an object used to set the following parameters for the Ground, required and provided by CreateGroundFromHeightMap
 * @param options.width the width (x direction) of the ground
 * @param options.height the height (z direction) of the ground
 * @param options.subdivisions the number of subdivisions per side
 * @param options.minHeight the minimum altitude on the ground, optional, default 0
 * @param options.maxHeight the maximum altitude on the ground, optional default 1
 * @param options.colorFilter the filter to apply to the image pixel colors to compute the height, optional Color3, default (0.3, 0.59, 0.11)
 * @param options.buffer the array holding the image color data
 * @param options.bufferWidth the width of image
 * @param options.bufferHeight the height of image
 * @param options.alphaFilter Remove any data where the alpha channel is below this value, defaults 0 (all data visible)
 * @param options.heightBuffer a array of floats where the height data can be saved, if its length is greater than zero.
 * @returns the VertexData of the Ground designed from a heightmap
 */
function CreateGroundFromHeightMapVertexData(options) {
    const indices = [];
    const positions = [];
    const normals = [];
    const uvs = [];
    let row, col;
    const filter = options.colorFilter || new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9(0.3, 0.59, 0.11);
    const alphaFilter = options.alphaFilter || 0.0;
    let invert = false;
    if (options.minHeight > options.maxHeight) {
        invert = true;
        const temp = options.maxHeight;
        options.maxHeight = options.minHeight;
        options.minHeight = temp;
    }
    // Vertices
    for (row = 0; row <= options.subdivisions; row++) {
        for (col = 0; col <= options.subdivisions; col++) {
            const position = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq((col * options.width) / options.subdivisions - options.width / 2.0, 0, ((options.subdivisions - row) * options.height) / options.subdivisions - options.height / 2.0);
            // Compute height
            const heightMapX = (((position.x + options.width / 2) / options.width) * (options.bufferWidth - 1)) | 0;
            const heightMapY = ((1.0 - (position.z + options.height / 2) / options.height) * (options.bufferHeight - 1)) | 0;
            const pos = (heightMapX + heightMapY * options.bufferWidth) * 4;
            let r = options.buffer[pos] / 255.0;
            let g = options.buffer[pos + 1] / 255.0;
            let b = options.buffer[pos + 2] / 255.0;
            const a = options.buffer[pos + 3] / 255.0;
            if (invert) {
                r = 1.0 - r;
                g = 1.0 - g;
                b = 1.0 - b;
            }
            const gradient = r * filter.r + g * filter.g + b * filter.b;
            // If our alpha channel is not within our filter then we will assign a 'special' height
            // Then when building the indices, we will ignore any vertex that is using the special height
            if (a >= alphaFilter) {
                position.y = options.minHeight + (options.maxHeight - options.minHeight) * gradient;
            }
            else {
                position.y = options.minHeight - _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .Epsilon */ .bH; // We can't have a height below minHeight, normally.
            }
            if (options.heightBuffer) {
                // set the height buffer information in row major order.
                options.heightBuffer[row * (options.subdivisions + 1) + col] = position.y;
            }
            // Add  vertex
            positions.push(position.x, position.y, position.z);
            normals.push(0, 0, 0);
            uvs.push(col / options.subdivisions, 1.0 - row / options.subdivisions);
        }
    }
    // Indices
    for (row = 0; row < options.subdivisions; row++) {
        for (col = 0; col < options.subdivisions; col++) {
            // Calculate Indices
            const idx1 = col + 1 + (row + 1) * (options.subdivisions + 1);
            const idx2 = col + 1 + row * (options.subdivisions + 1);
            const idx3 = col + row * (options.subdivisions + 1);
            const idx4 = col + (row + 1) * (options.subdivisions + 1);
            // Check that all indices are visible (based on our special height)
            // Only display the vertex if all Indices are visible
            // Positions are stored x,y,z for each vertex, hence the * 3 and + 1 for height
            const isVisibleIdx1 = positions[idx1 * 3 + 1] >= options.minHeight;
            const isVisibleIdx2 = positions[idx2 * 3 + 1] >= options.minHeight;
            const isVisibleIdx3 = positions[idx3 * 3 + 1] >= options.minHeight;
            if (isVisibleIdx1 && isVisibleIdx2 && isVisibleIdx3) {
                indices.push(idx1);
                indices.push(idx2);
                indices.push(idx3);
            }
            const isVisibleIdx4 = positions[idx4 * 3 + 1] >= options.minHeight;
            if (isVisibleIdx4 && isVisibleIdx1 && isVisibleIdx3) {
                indices.push(idx4);
                indices.push(idx1);
                indices.push(idx3);
            }
        }
    }
    // Normals
    _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P.ComputeNormals(positions, indices, normals);
    // Result
    const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates a ground mesh
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param options.width set the width size (float, default 1)
 * @param options.height set the height size (float, default 1)
 * @param options.subdivisions sets the number of subdivision per side (default 1)
 * @param options.subdivisionsX sets the number of subdivision on the X axis (overrides subdivisions)
 * @param options.subdivisionsY sets the number of subdivision on the Y axis (overrides subdivisions)
 * @param options.updatable defines if the mesh must be flagged as updatable (default false)
 * @param scene defines the hosting scene
 * @returns the ground mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#ground
 */
function CreateGround(name, options = {}, scene) {
    const ground = new _groundMesh_js__WEBPACK_IMPORTED_MODULE_4__/* .GroundMesh */ .f(name, scene);
    ground._setReady(false);
    ground._subdivisionsX = options.subdivisionsX || options.subdivisions || 1;
    ground._subdivisionsY = options.subdivisionsY || options.subdivisions || 1;
    ground._width = options.width || 1;
    ground._height = options.height || 1;
    ground._maxX = ground._width / 2;
    ground._maxZ = ground._height / 2;
    ground._minX = -ground._maxX;
    ground._minZ = -ground._maxZ;
    const vertexData = CreateGroundVertexData(options);
    vertexData.applyToMesh(ground, options.updatable);
    ground._setReady(true);
    return ground;
}
/**
 * Creates a tiled ground mesh
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param options.xmin ground minimum X coordinate (float, default -1)
 * @param options.zmin ground minimum Z coordinate (float, default -1)
 * @param options.xmax ground maximum X coordinate (float, default 1)
 * @param options.zmax ground maximum Z coordinate (float, default 1)
 * @param options.subdivisions a javascript object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile
 * @param options.subdivisions.w positive integer, default 6
 * @param options.subdivisions.h positive integer, default 6
 * @param options.precision a javascript object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile
 * @param options.precision.w positive integer, default 2
 * @param options.precision.h positive integer, default 2
 * @param options.updatable boolean, default false, true if the mesh must be flagged as updatable
 * @param scene defines the hosting scene
 * @returns the tiled ground mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#tiled-ground
 */
function CreateTiledGround(name, options, scene = null) {
    const tiledGround = new _mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e(name, scene);
    const vertexData = CreateTiledGroundVertexData(options);
    vertexData.applyToMesh(tiledGround, options.updatable);
    return tiledGround;
}
/**
 * Creates a ground mesh from a height map. The height map download can take some frames,
 * so the mesh is not immediately ready. To wait for the mesh to be completely built,
 * you should use the `onReady` callback option.
 * @param name defines the name of the mesh
 * @param url sets the URL of the height map image resource.
 * @param options defines the options used to create the mesh
 * @param options.width sets the ground width size (positive float, default 10)
 * @param options.height sets the ground height size (positive float, default 10)
 * @param options.subdivisions sets the number of subdivision per side (positive integer, default 1)
 * @param options.minHeight is the minimum altitude on the ground (float, default 0)
 * @param options.maxHeight is the maximum altitude on the ground (float, default 1)
 * @param options.colorFilter is the filter to apply to the image pixel colors to compute the height (optional Color3, default (0.3, 0.59, 0.11) )
 * @param options.alphaFilter will filter any data where the alpha channel is below this value, defaults 0 (all data visible)
 * @param options.updatable defines if the mesh must be flagged as updatable
 * @param options.onReady is a javascript callback function that will be called once the mesh is just built (the height map download can last some time)
 * @param options.onError is a javascript callback function that will be called if there is an error
 * @param options.passHeightBufferInCallback a boolean that indicates if the calculated height data will be passed in the onReady callback. Useful if you need the height data for physics, for example.
 * @param scene defines the hosting scene
 * @returns the ground mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/height_map
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#ground-from-a-height-map
 */
function CreateGroundFromHeightMap(name, url, options = {}, scene = null) {
    const width = options.width || 10.0;
    const height = options.height || 10.0;
    const subdivisions = options.subdivisions || 1 | 0;
    const minHeight = options.minHeight || 0.0;
    const maxHeight = options.maxHeight || 1.0;
    const filter = options.colorFilter || new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color3 */ .v9(0.3, 0.59, 0.11);
    const alphaFilter = options.alphaFilter || 0.0;
    const updatable = options.updatable;
    const onReady = options.onReady;
    scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__/* .EngineStore */ .q.LastCreatedScene;
    const ground = new _groundMesh_js__WEBPACK_IMPORTED_MODULE_4__/* .GroundMesh */ .f(name, scene);
    ground._subdivisionsX = subdivisions;
    ground._subdivisionsY = subdivisions;
    ground._width = width;
    ground._height = height;
    ground._maxX = ground._width / 2.0;
    ground._maxZ = ground._height / 2.0;
    ground._minX = -ground._maxX;
    ground._minZ = -ground._maxZ;
    ground._setReady(false);
    let heightBuffer;
    if (options.passHeightBufferInCallback) {
        heightBuffer = new Float32Array((subdivisions + 1) * (subdivisions + 1));
    }
    const onBufferLoaded = (buffer, bufferWidth, bufferHeight) => {
        const vertexData = CreateGroundFromHeightMapVertexData({
            width: width,
            height: height,
            subdivisions: subdivisions,
            minHeight: minHeight,
            maxHeight: maxHeight,
            colorFilter: filter,
            buffer: buffer,
            bufferWidth: bufferWidth,
            bufferHeight: bufferHeight,
            alphaFilter: alphaFilter,
            heightBuffer,
        });
        vertexData.applyToMesh(ground, updatable);
        //execute ready callback, if set
        if (onReady) {
            onReady(ground, heightBuffer);
        }
        ground._setReady(true);
    };
    if (typeof url === "string") {
        const onload = (img) => {
            const bufferWidth = img.width;
            const bufferHeight = img.height;
            if (scene.isDisposed) {
                return;
            }
            const buffer = scene?.getEngine().resizeImageBitmap(img, bufferWidth, bufferHeight);
            onBufferLoaded(buffer, bufferWidth, bufferHeight);
        };
        _Misc_tools_js__WEBPACK_IMPORTED_MODULE_5__/* .Tools */ .S0.LoadImage(url, onload, options.onError ? options.onError : () => { }, scene.offlineProvider);
    }
    else {
        onBufferLoaded(url.data, url.width, url.height);
    }
    return ground;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use the functions directly from the module
 */
const GroundBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateGround,
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateGroundFromHeightMap,
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateTiledGround,
};
_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P.CreateGround = CreateGroundVertexData;
_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P.CreateTiledGround = CreateTiledGroundVertexData;
_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexData */ .P.CreateGroundFromHeightMap = CreateGroundFromHeightMapVertexData;
_mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e.CreateGround = (name, width, height, subdivisions, scene, updatable) => {
    const options = {
        width,
        height,
        subdivisions,
        updatable,
    };
    return CreateGround(name, options, scene);
};
_mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e.CreateTiledGround = (name, xmin, zmin, xmax, zmax, subdivisions, precision, scene, updatable) => {
    const options = {
        xmin,
        zmin,
        xmax,
        zmax,
        subdivisions,
        precision,
        updatable,
    };
    return CreateTiledGround(name, options, scene);
};
_mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e.CreateGroundFromHeightMap = (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady, alphaFilter) => {
    const options = {
        width,
        height,
        subdivisions,
        minHeight,
        maxHeight,
        updatable,
        onReady,
        alphaFilter,
    };
    return CreateGroundFromHeightMap(name, url, options, scene);
};
//# sourceMappingURL=groundBuilder.js.map

/***/ }),

/***/ 58144:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   LG: () => (/* binding */ CreatePlaneVertexData),
/* harmony export */   QX: () => (/* binding */ PlaneBuilder),
/* harmony export */   x: () => (/* binding */ CreatePlane)
/* harmony export */ });
/* harmony import */ var _mesh_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76595);
/* harmony import */ var _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36803);
/* harmony import */ var _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91313);



/**
 * Creates the VertexData for a Plane
 * @param options an object used to set the following optional parameters for the plane, required but can be empty
 * * size sets the width and height of the plane to the value of size, optional default 1
 * * width sets the width (x direction) of the plane, overwrites the width set by size, optional, default size
 * * height sets the height (y direction) of the plane, overwrites the height set by size, optional, default size
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @returns the VertexData of the box
 */
function CreatePlaneVertexData(options) {
    const indices = [];
    const positions = [];
    const normals = [];
    const uvs = [];
    const width = options.width || options.size || 1;
    const height = options.height || options.size || 1;
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexData */ .P.DEFAULTSIDE;
    // Vertices
    const halfWidth = width / 2.0;
    const halfHeight = height / 2.0;
    positions.push(-halfWidth, -halfHeight, 0);
    normals.push(0, 0, -1.0);
    uvs.push(0.0, _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_2__/* .useOpenGLOrientationForUV */ .rX ? 1.0 : 0.0);
    positions.push(halfWidth, -halfHeight, 0);
    normals.push(0, 0, -1.0);
    uvs.push(1.0, _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_2__/* .useOpenGLOrientationForUV */ .rX ? 1.0 : 0.0);
    positions.push(halfWidth, halfHeight, 0);
    normals.push(0, 0, -1.0);
    uvs.push(1.0, _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_2__/* .useOpenGLOrientationForUV */ .rX ? 0.0 : 1.0);
    positions.push(-halfWidth, halfHeight, 0);
    normals.push(0, 0, -1.0);
    uvs.push(0.0, _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_2__/* .useOpenGLOrientationForUV */ .rX ? 0.0 : 1.0);
    // Indices
    indices.push(0);
    indices.push(1);
    indices.push(2);
    indices.push(0);
    indices.push(2);
    indices.push(3);
    // Sides
    _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexData */ .P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    // Result
    const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexData */ .P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates a plane mesh
 * * The parameter `size` sets the size (float) of both sides of the plane at once (default 1)
 * * You can set some different plane dimensions by using the parameters `width` and `height` (both by default have the same value of `size`)
 * * The parameter `sourcePlane` is a Plane instance. It builds a mesh plane from a Math plane
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the plane mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#plane
 */
function CreatePlane(name, options = {}, scene = null) {
    const plane = new _mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e(name, scene);
    options.sideOrientation = _mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e._GetDefaultSideOrientation(options.sideOrientation);
    plane._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreatePlaneVertexData(options);
    vertexData.applyToMesh(plane, options.updatable);
    if (options.sourcePlane) {
        plane.translate(options.sourcePlane.normal, -options.sourcePlane.d);
        plane.setDirection(options.sourcePlane.normal.scale(-1));
    }
    return plane;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use the function directly from the module
 */
const PlaneBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreatePlane,
};
_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexData */ .P.CreatePlane = CreatePlaneVertexData;
_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.CreatePlane = (name, size, scene, updatable, sideOrientation) => {
    const options = {
        size,
        width: size,
        height: size,
        sideOrientation,
        updatable,
    };
    return CreatePlane(name, options, scene);
};
//# sourceMappingURL=planeBuilder.js.map

/***/ }),

/***/ 74498:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  g: () => (/* binding */ DracoCompression)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__(998);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/workerPool.js
var workerPool = __webpack_require__(97573);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/geometry.js
var Meshes_geometry = __webpack_require__(27050);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/buffer.js
var buffer = __webpack_require__(56608);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js
var mesh_vertexData = __webpack_require__(36803);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__(51137);
;// ./node_modules/@babylonjs/core/Meshes/Compression/dracoCompressionWorker.js
/**
 * @internal
 */
function decodeMesh(decoderModule /*DecoderModule*/, data, attributes, onIndicesData, onAttributeData) {
    let decoder = null;
    let buffer = null;
    let geometry = null;
    try {
        decoder = new decoderModule.Decoder();
        buffer = new decoderModule.DecoderBuffer();
        buffer.Init(data, data.byteLength);
        let status;
        const type = decoder.GetEncodedGeometryType(buffer);
        switch (type) {
            case decoderModule.TRIANGULAR_MESH: {
                const mesh = new decoderModule.Mesh();
                status = decoder.DecodeBufferToMesh(buffer, mesh);
                if (!status.ok() || mesh.ptr === 0) {
                    throw new Error(status.error_msg());
                }
                const numFaces = mesh.num_faces();
                const numIndices = numFaces * 3;
                const byteLength = numIndices * 4;
                const ptr = decoderModule._malloc(byteLength);
                try {
                    decoder.GetTrianglesUInt32Array(mesh, byteLength, ptr);
                    const indices = new Uint32Array(numIndices);
                    indices.set(new Uint32Array(decoderModule.HEAPF32.buffer, ptr, numIndices));
                    onIndicesData(indices);
                }
                finally {
                    decoderModule._free(ptr);
                }
                geometry = mesh;
                break;
            }
            case decoderModule.POINT_CLOUD: {
                const pointCloud = new decoderModule.PointCloud();
                status = decoder.DecodeBufferToPointCloud(buffer, pointCloud);
                if (!status.ok() || !pointCloud.ptr) {
                    throw new Error(status.error_msg());
                }
                geometry = pointCloud;
                break;
            }
            default: {
                throw new Error(`Invalid geometry type ${type}`);
            }
        }
        const numPoints = geometry.num_points();
        const processAttribute = (decoder, geometry, kind, attribute) => {
            const dataType = attribute.data_type();
            const numComponents = attribute.num_components();
            const normalized = attribute.normalized();
            const byteStride = attribute.byte_stride();
            const byteOffset = attribute.byte_offset();
            const dataTypeInfo = {
                [decoderModule.DT_FLOAT32]: { typedArrayConstructor: Float32Array, heap: decoderModule.HEAPF32 },
                [decoderModule.DT_INT8]: { typedArrayConstructor: Int8Array, heap: decoderModule.HEAP8 },
                [decoderModule.DT_INT16]: { typedArrayConstructor: Int16Array, heap: decoderModule.HEAP16 },
                [decoderModule.DT_INT32]: { typedArrayConstructor: Int32Array, heap: decoderModule.HEAP32 },
                [decoderModule.DT_UINT8]: { typedArrayConstructor: Uint8Array, heap: decoderModule.HEAPU8 },
                [decoderModule.DT_UINT16]: { typedArrayConstructor: Uint16Array, heap: decoderModule.HEAPU16 },
                [decoderModule.DT_UINT32]: { typedArrayConstructor: Uint32Array, heap: decoderModule.HEAPU32 },
            };
            const info = dataTypeInfo[dataType];
            if (!info) {
                throw new Error(`Invalid data type ${dataType}`);
            }
            const numValues = numPoints * numComponents;
            const byteLength = numValues * info.typedArrayConstructor.BYTES_PER_ELEMENT;
            const ptr = decoderModule._malloc(byteLength);
            try {
                decoder.GetAttributeDataArrayForAllPoints(geometry, attribute, dataType, byteLength, ptr);
                const data = new info.typedArrayConstructor(info.heap.buffer, ptr, numValues);
                onAttributeData(kind, data.slice(), numComponents, byteOffset, byteStride, normalized);
            }
            finally {
                decoderModule._free(ptr);
            }
        };
        if (attributes) {
            for (const kind in attributes) {
                const id = attributes[kind];
                const attribute = decoder.GetAttributeByUniqueId(geometry, id);
                processAttribute(decoder, geometry, kind, attribute);
            }
        }
        else {
            const dracoAttributeTypes = {
                position: decoderModule.POSITION,
                normal: decoderModule.NORMAL,
                color: decoderModule.COLOR,
                uv: decoderModule.TEX_COORD,
            };
            for (const kind in dracoAttributeTypes) {
                const id = decoder.GetAttributeId(geometry, dracoAttributeTypes[kind]);
                if (id !== -1) {
                    const attribute = decoder.GetAttribute(geometry, id);
                    processAttribute(decoder, geometry, kind, attribute);
                }
            }
        }
        return numPoints;
    }
    finally {
        if (geometry) {
            decoderModule.destroy(geometry);
        }
        if (buffer) {
            decoderModule.destroy(buffer);
        }
        if (decoder) {
            decoderModule.destroy(decoder);
        }
    }
}
/**
 * The worker function that gets converted to a blob url to pass into a worker.
 * To be used if a developer wants to create their own worker instance and inject it instead of using the default worker.
 */
function workerFunction() {
    let decoderPromise;
    onmessage = (event) => {
        const message = event.data;
        switch (message.id) {
            case "init": {
                const decoder = message.decoder;
                // if URL is provided then load the script. Otherwise expect the script to be loaded already
                if (decoder.url) {
                    importScripts(decoder.url);
                }
                const initDecoderObject = decoder.wasmBinary ? { wasmBinary: decoder.wasmBinary } : {};
                decoderPromise = DracoDecoderModule(initDecoderObject);
                postMessage({ id: "initDone" });
                break;
            }
            case "decodeMesh": {
                if (!decoderPromise) {
                    throw new Error("Draco decoder module is not available");
                }
                decoderPromise.then((decoder) => {
                    const numPoints = decodeMesh(decoder, message.dataView, message.attributes, (indices) => {
                        postMessage({ id: "indices", data: indices }, [indices.buffer]);
                    }, (kind, data, size, offset, stride, normalized) => {
                        postMessage({ id: "attribute", kind, data, size, byteOffset: offset, byteStride: stride, normalized }, [data.buffer]);
                    });
                    postMessage({ id: "decodeMeshDone", totalVertices: numPoints });
                });
                break;
            }
        }
    };
}
/**
 * Initializes a worker that was created for the draco agent pool
 * @param worker  The worker to initialize
 * @param decoderWasmBinary The wasm binary to load into the worker
 * @param moduleUrl The url to the draco decoder module (optional)
 * @returns A promise that resolves when the worker is initialized
 */
function initializeWebWorker(worker, decoderWasmBinary, moduleUrl) {
    return new Promise((resolve, reject) => {
        const onError = (error) => {
            worker.removeEventListener("error", onError);
            worker.removeEventListener("message", onMessage);
            reject(error);
        };
        const onMessage = (event) => {
            if (event.data.id === "initDone") {
                worker.removeEventListener("error", onError);
                worker.removeEventListener("message", onMessage);
                resolve(worker);
            }
        };
        worker.addEventListener("error", onError);
        worker.addEventListener("message", onMessage);
        if (!decoderWasmBinary) {
            worker.postMessage({
                id: "init",
                decoder: {
                    url: moduleUrl,
                },
            });
        }
        else {
            // clone the array buffer to make it transferable
            const clone = decoderWasmBinary.slice(0);
            worker.postMessage({
                id: "init",
                decoder: {
                    url: moduleUrl,
                    wasmBinary: clone,
                },
            }, [clone]);
        }
        // note: no transfer list as the ArrayBuffer is shared across main thread and pool workers
    });
}
//# sourceMappingURL=dracoCompressionWorker.js.map
;// ./node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.js







function createDecoderAsync(wasmBinary, jsModule) {
    return new Promise((resolve) => {
        (jsModule || DracoDecoderModule)({ wasmBinary }).then((module) => {
            resolve({ module });
        });
    });
}
/**
 * Draco compression (https://google.github.io/draco/)
 *
 * This class wraps the Draco module.
 *
 * **Encoder**
 *
 * The encoder is not currently implemented.
 *
 * **Decoder**
 *
 * By default, the configuration points to a copy of the Draco decoder files for glTF from the babylon.js preview cdn https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js.
 *
 * To update the configuration, use the following code:
 * ```javascript
 *     DracoCompression.Configuration = {
 *         decoder: {
 *             wasmUrl: "<url to the WebAssembly library>",
 *             wasmBinaryUrl: "<url to the WebAssembly binary>",
 *             fallbackUrl: "<url to the fallback JavaScript library>",
 *         }
 *     };
 * ```
 *
 * Draco has two versions, one for WebAssembly and one for JavaScript. The decoder configuration can be set to only support WebAssembly or only support the JavaScript version.
 * Decoding will automatically fallback to the JavaScript version if WebAssembly version is not configured or if WebAssembly is not supported by the browser.
 * Use `DracoCompression.DecoderAvailable` to determine if the decoder configuration is available for the current context.
 *
 * To decode Draco compressed data, get the default DracoCompression object and call decodeMeshToGeometryAsync:
 * ```javascript
 *     var geometry = await DracoCompression.Default.decodeMeshToGeometryAsync(data);
 * ```
 *
 * @see https://playground.babylonjs.com/#DMZIBD#0
 */
class DracoCompression {
    /**
     * Returns true if the decoder configuration is available.
     */
    static get DecoderAvailable() {
        const decoder = DracoCompression.Configuration.decoder;
        return !!((decoder.wasmUrl && decoder.wasmBinaryUrl && typeof WebAssembly === "object") || decoder.fallbackUrl);
    }
    static GetDefaultNumWorkers() {
        if (typeof navigator !== "object" || !navigator.hardwareConcurrency) {
            return 1;
        }
        // Use 50% of the available logical processors but capped at 4.
        return Math.min(Math.floor(navigator.hardwareConcurrency * 0.5), 4);
    }
    /**
     * Default instance for the draco compression object.
     */
    static get Default() {
        if (!DracoCompression._Default) {
            DracoCompression._Default = new DracoCompression();
        }
        return DracoCompression._Default;
    }
    /**
     * Reset the default draco compression object to null and disposing the removed default instance.
     * Note that if the workerPool is a member of the static Configuration object it is recommended not to run dispose,
     * unless the static worker pool is no longer needed.
     * @param skipDispose set to true to not dispose the removed default instance
     */
    static ResetDefault(skipDispose) {
        if (DracoCompression._Default) {
            if (!skipDispose) {
                DracoCompression._Default.dispose();
            }
            DracoCompression._Default = null;
        }
    }
    /**
     * Constructor
     * @param numWorkers The number of workers for async operations Or an options object. Specify `0` to disable web workers and run synchronously in the current context.
     */
    constructor(numWorkers = DracoCompression.DefaultNumWorkers) {
        const decoder = DracoCompression.Configuration.decoder;
        // check if the decoder binary and worker pool was injected
        // Note - it is expected that the developer checked if WebWorker, WebAssembly and the URL object are available
        if (decoder.workerPool || (typeof numWorkers === "object" && numWorkers.workerPool)) {
            // set the promise accordingly
            this._workerPoolPromise = Promise.resolve(decoder.workerPool || numWorkers.workerPool);
        }
        else {
            // to avoid making big changes to the decider, if wasmBinary is provided use it in the wasmBinaryPromise
            const wasmBinaryProvided = decoder.wasmBinary || (typeof numWorkers === "object" && numWorkers.wasmBinary);
            const numberOfWorkers = typeof numWorkers === "number" ? numWorkers : numWorkers.numWorkers;
            const useWorkers = numberOfWorkers && typeof Worker === "function" && typeof URL === "function";
            const urlNeeded = useWorkers || (!useWorkers && !decoder.jsModule);
            // code maintained here for back-compat with no changes
            const decoderInfo = decoder.wasmUrl && decoder.wasmBinaryUrl && typeof WebAssembly === "object"
                ? {
                    url: urlNeeded ? tools/* Tools */.S0.GetBabylonScriptURL(decoder.wasmUrl, true) : "",
                    wasmBinaryPromise: wasmBinaryProvided ? Promise.resolve(wasmBinaryProvided) : tools/* Tools */.S0.LoadFileAsync(tools/* Tools */.S0.GetBabylonScriptURL(decoder.wasmBinaryUrl, true)),
                }
                : {
                    url: urlNeeded ? tools/* Tools */.S0.GetBabylonScriptURL(decoder.fallbackUrl) : "",
                    wasmBinaryPromise: Promise.resolve(undefined),
                };
            if (useWorkers) {
                this._workerPoolPromise = decoderInfo.wasmBinaryPromise.then((decoderWasmBinary) => {
                    const workerContent = `${decodeMesh}(${workerFunction})()`;
                    const workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: "application/javascript" }));
                    return new workerPool/* AutoReleaseWorkerPool */.h(numberOfWorkers, () => {
                        const worker = new Worker(workerBlobUrl);
                        return initializeWebWorker(worker, decoderWasmBinary, decoderInfo.url);
                    });
                });
            }
            else {
                this._decoderModulePromise = decoderInfo.wasmBinaryPromise.then(async (decoderWasmBinary) => {
                    if (typeof DracoDecoderModule === "undefined") {
                        if (!decoder.jsModule) {
                            if (!decoderInfo.url) {
                                throw new Error("Draco decoder module is not available");
                            }
                            await tools/* Tools */.S0.LoadBabylonScriptAsync(decoderInfo.url);
                        }
                    }
                    return await createDecoderAsync(decoderWasmBinary, decoder.jsModule);
                });
            }
        }
    }
    /**
     * Stop all async operations and release resources.
     */
    dispose() {
        if (this._workerPoolPromise) {
            this._workerPoolPromise.then((workerPool) => {
                workerPool.dispose();
            });
        }
        delete this._workerPoolPromise;
        delete this._decoderModulePromise;
    }
    /**
     * Returns a promise that resolves when ready. Call this manually to ensure draco compression is ready before use.
     * @returns a promise that resolves when ready
     */
    async whenReadyAsync() {
        if (this._workerPoolPromise) {
            await this._workerPoolPromise;
            return;
        }
        if (this._decoderModulePromise) {
            await this._decoderModulePromise;
            return;
        }
    }
    /**
     * Decode Draco compressed mesh data to mesh data.
     * @param data The ArrayBuffer or ArrayBufferView for the Draco compression data
     * @param attributes A map of attributes from vertex buffer kinds to Draco unique ids
     * @param gltfNormalizedOverride A map of attributes from vertex buffer kinds to normalized flags to override the Draco normalization
     * @returns A promise that resolves with the decoded mesh data
     */
    decodeMeshToMeshDataAsync(data, attributes, gltfNormalizedOverride) {
        const dataView = data instanceof ArrayBuffer ? new Int8Array(data) : new Int8Array(data.buffer, data.byteOffset, data.byteLength);
        const applyGltfNormalizedOverride = (kind, normalized) => {
            if (gltfNormalizedOverride && gltfNormalizedOverride[kind] !== undefined) {
                if (normalized !== gltfNormalizedOverride[kind]) {
                    logger/* Logger */.V.Warn(`Normalized flag from Draco data (${normalized}) does not match normalized flag from glTF accessor (${gltfNormalizedOverride[kind]}). Using flag from glTF accessor.`);
                }
                return gltfNormalizedOverride[kind];
            }
            else {
                return normalized;
            }
        };
        if (this._workerPoolPromise) {
            return this._workerPoolPromise.then((workerPool) => {
                return new Promise((resolve, reject) => {
                    workerPool.push((worker, onComplete) => {
                        let resultIndices = null;
                        const resultAttributes = [];
                        const onError = (error) => {
                            worker.removeEventListener("error", onError);
                            worker.removeEventListener("message", onMessage);
                            reject(error);
                            onComplete();
                        };
                        const onMessage = (event) => {
                            const message = event.data;
                            switch (message.id) {
                                case "decodeMeshDone": {
                                    worker.removeEventListener("error", onError);
                                    worker.removeEventListener("message", onMessage);
                                    resolve({ indices: resultIndices, attributes: resultAttributes, totalVertices: message.totalVertices });
                                    onComplete();
                                    break;
                                }
                                case "indices": {
                                    resultIndices = message.data;
                                    break;
                                }
                                case "attribute": {
                                    resultAttributes.push({
                                        kind: message.kind,
                                        data: message.data,
                                        size: message.size,
                                        byteOffset: message.byteOffset,
                                        byteStride: message.byteStride,
                                        normalized: applyGltfNormalizedOverride(message.kind, message.normalized),
                                    });
                                    break;
                                }
                            }
                        };
                        worker.addEventListener("error", onError);
                        worker.addEventListener("message", onMessage);
                        const dataViewCopy = dataView.slice();
                        worker.postMessage({ id: "decodeMesh", dataView: dataViewCopy, attributes: attributes }, [dataViewCopy.buffer]);
                    });
                });
            });
        }
        if (this._decoderModulePromise) {
            return this._decoderModulePromise.then((decoder) => {
                let resultIndices = null;
                const resultAttributes = [];
                const numPoints = decodeMesh(decoder.module, dataView, attributes, (indices) => {
                    resultIndices = indices;
                }, (kind, data, size, byteOffset, byteStride, normalized) => {
                    resultAttributes.push({
                        kind,
                        data,
                        size,
                        byteOffset,
                        byteStride,
                        normalized,
                    });
                });
                return { indices: resultIndices, attributes: resultAttributes, totalVertices: numPoints };
            });
        }
        throw new Error("Draco decoder module is not available");
    }
    /**
     * Decode Draco compressed mesh data to Babylon geometry.
     * @param name The name to use when creating the geometry
     * @param scene The scene to use when creating the geometry
     * @param data The ArrayBuffer or ArrayBufferView for the Draco compression data
     * @param attributes A map of attributes from vertex buffer kinds to Draco unique ids
     * @returns A promise that resolves with the decoded geometry
     */
    async decodeMeshToGeometryAsync(name, scene, data, attributes) {
        const meshData = await this.decodeMeshToMeshDataAsync(data, attributes);
        const geometry = new Meshes_geometry/* Geometry */.V(name, scene);
        if (meshData.indices) {
            geometry.setIndices(meshData.indices);
        }
        for (const attribute of meshData.attributes) {
            geometry.setVerticesBuffer(new buffer/* VertexBuffer */.R(scene.getEngine(), attribute.data, attribute.kind, false, undefined, attribute.byteStride, undefined, attribute.byteOffset, attribute.size, undefined, attribute.normalized, true), meshData.totalVertices);
        }
        return geometry;
    }
    /** @internal */
    async _decodeMeshToGeometryForGltfAsync(name, scene, data, attributes, gltfNormalizedOverride, boundingInfo) {
        const meshData = await this.decodeMeshToMeshDataAsync(data, attributes, gltfNormalizedOverride);
        const geometry = new Meshes_geometry/* Geometry */.V(name, scene);
        if (boundingInfo) {
            geometry._boundingInfo = boundingInfo;
            geometry.useBoundingInfoFromGeometry = true;
        }
        if (meshData.indices) {
            geometry.setIndices(meshData.indices);
        }
        for (const attribute of meshData.attributes) {
            geometry.setVerticesBuffer(new buffer/* VertexBuffer */.R(scene.getEngine(), attribute.data, attribute.kind, false, undefined, attribute.byteStride, undefined, attribute.byteOffset, attribute.size, undefined, attribute.normalized, true), meshData.totalVertices);
        }
        return geometry;
    }
    /**
     * Decode Draco compressed mesh data to Babylon vertex data.
     * @param data The ArrayBuffer or ArrayBufferView for the Draco compression data
     * @param attributes A map of attributes from vertex buffer kinds to Draco unique ids
     * @returns A promise that resolves with the decoded vertex data
     * @deprecated Use {@link decodeMeshToGeometryAsync} for better performance in some cases
     */
    async decodeMeshAsync(data, attributes) {
        const meshData = await this.decodeMeshToMeshDataAsync(data, attributes);
        const vertexData = new mesh_vertexData/* VertexData */.P();
        if (meshData.indices) {
            vertexData.indices = meshData.indices;
        }
        for (const attribute of meshData.attributes) {
            const floatData = buffer/* VertexBuffer */.R.GetFloatData(attribute.data, attribute.size, buffer/* VertexBuffer */.R.GetDataType(attribute.data), attribute.byteOffset, attribute.byteStride, attribute.normalized, meshData.totalVertices);
            vertexData.set(floatData, attribute.kind);
        }
        return vertexData;
    }
}
/**
 * The configuration. Defaults to the following urls:
 * - wasmUrl: "https://cdn.babylonjs.com/draco_wasm_wrapper_gltf.js"
 * - wasmBinaryUrl: "https://cdn.babylonjs.com/draco_decoder_gltf.wasm"
 * - fallbackUrl: "https://cdn.babylonjs.com/draco_decoder_gltf.js"
 */
DracoCompression.Configuration = {
    decoder: {
        wasmUrl: `${tools/* Tools */.S0._DefaultCdnUrl}/draco_wasm_wrapper_gltf.js`,
        wasmBinaryUrl: `${tools/* Tools */.S0._DefaultCdnUrl}/draco_decoder_gltf.wasm`,
        fallbackUrl: `${tools/* Tools */.S0._DefaultCdnUrl}/draco_decoder_gltf.js`,
    },
};
/**
 * Default number of workers to create when creating the draco compression object.
 */
DracoCompression.DefaultNumWorkers = DracoCompression.GetDefaultNumWorkers();
DracoCompression._Default = null;
//# sourceMappingURL=dracoCompression.js.map

/***/ }),

/***/ 59185:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   v: () => (/* binding */ MeshoptCompression)
/* harmony export */ });
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(998);

/**
 * Meshopt compression (https://github.com/zeux/meshoptimizer)
 *
 * This class wraps the meshopt library from https://github.com/zeux/meshoptimizer/tree/master/js.
 *
 * **Encoder**
 *
 * The encoder is not currently implemented.
 *
 * **Decoder**
 *
 * By default, the configuration points to a copy of the meshopt files on the Babylon.js preview CDN (e.g. https://preview.babylonjs.com/meshopt_decoder.js).
 *
 * To update the configuration, use the following code:
 * ```javascript
 *     MeshoptCompression.Configuration = {
 *         decoder: {
 *             url: "<url to the meshopt decoder library>"
 *         }
 *     };
 * ```
 */
class MeshoptCompression {
    /**
     * Default instance for the meshoptimizer object.
     */
    static get Default() {
        if (!MeshoptCompression._Default) {
            MeshoptCompression._Default = new MeshoptCompression();
        }
        return MeshoptCompression._Default;
    }
    /**
     * Constructor
     */
    constructor() {
        const decoder = MeshoptCompression.Configuration.decoder;
        this._decoderModulePromise = _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0.LoadBabylonScriptAsync(decoder.url).then(() => {
            // Wait for WebAssembly compilation before resolving promise
            return MeshoptDecoder.ready;
        });
    }
    /**
     * Stop all async operations and release resources.
     */
    dispose() {
        delete this._decoderModulePromise;
    }
    /**
     * Decode meshopt data.
     * @see https://github.com/zeux/meshoptimizer/tree/master/js#decoder
     * @param source The input data.
     * @param count The number of elements.
     * @param stride The stride in bytes.
     * @param mode The compression mode.
     * @param filter The compression filter.
     * @returns a Promise<Uint8Array> that resolves to the decoded data
     */
    decodeGltfBufferAsync(source, count, stride, mode, filter) {
        return this._decoderModulePromise.then(async () => {
            MeshoptDecoder.useWorkers(1);
            const result = await MeshoptDecoder.decodeGltfBufferAsync(count, stride, source, mode, filter);
            MeshoptDecoder.useWorkers(0);
            return result;
        });
    }
}
/**
 * The configuration. Defaults to the following:
 * ```javascript
 * decoder: {
 *   url: "https://cdn.babylonjs.com/meshopt_decoder.js"
 * }
 * ```
 */
MeshoptCompression.Configuration = {
    decoder: {
        url: `${_Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0._DefaultCdnUrl}/meshopt_decoder.js`,
    },
};
MeshoptCompression._Default = null;
//# sourceMappingURL=meshoptCompression.js.map

/***/ }),

/***/ 98058:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   t: () => (/* binding */ GaussianSplattingMesh)
/* harmony export */ });
/* harmony import */ var _subMesh_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65907);
/* harmony import */ var _mesh_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76595);
/* harmony import */ var _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36803);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51137);
/* harmony import */ var _Materials_GaussianSplatting_gaussianSplattingMaterial_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(20927);
/* harmony import */ var _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96041);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(998);
/* harmony import */ var _thinInstanceMesh_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90203);
/* harmony import */ var _Misc_textureTools_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(42683);
/* harmony import */ var _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(62128);
/* harmony import */ var _Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(80163);













// @internal
const unpackUnorm = (value, bits) => {
    const t = (1 << bits) - 1;
    return (value & t) / t;
};
// @internal
const unpack111011 = (value, result) => {
    result.x = unpackUnorm(value >>> 21, 11);
    result.y = unpackUnorm(value >>> 11, 10);
    result.z = unpackUnorm(value, 11);
};
// @internal
const unpack8888 = (value, result) => {
    result[0] = unpackUnorm(value >>> 24, 8) * 255;
    result[1] = unpackUnorm(value >>> 16, 8) * 255;
    result[2] = unpackUnorm(value >>> 8, 8) * 255;
    result[3] = unpackUnorm(value, 8) * 255;
};
// @internal
// unpack quaternion with 2,10,10,10 format (largest element, 3x10bit element)
const unpackRot = (value, result) => {
    const norm = 1.0 / (Math.sqrt(2) * 0.5);
    const a = (unpackUnorm(value >>> 20, 10) - 0.5) * norm;
    const b = (unpackUnorm(value >>> 10, 10) - 0.5) * norm;
    const c = (unpackUnorm(value, 10) - 0.5) * norm;
    const m = Math.sqrt(1.0 - (a * a + b * b + c * c));
    switch (value >>> 30) {
        case 0:
            result.set(m, a, b, c);
            break;
        case 1:
            result.set(a, m, b, c);
            break;
        case 2:
            result.set(a, b, m, c);
            break;
        case 3:
            result.set(a, b, c, m);
            break;
    }
};
/**
 * Representation of the types
 */
var PLYType;
(function (PLYType) {
    PLYType[PLYType["FLOAT"] = 0] = "FLOAT";
    PLYType[PLYType["INT"] = 1] = "INT";
    PLYType[PLYType["UINT"] = 2] = "UINT";
    PLYType[PLYType["DOUBLE"] = 3] = "DOUBLE";
    PLYType[PLYType["UCHAR"] = 4] = "UCHAR";
    PLYType[PLYType["UNDEFINED"] = 5] = "UNDEFINED";
})(PLYType || (PLYType = {}));
/**
 * Usage types of the PLY values
 */
var PLYValue;
(function (PLYValue) {
    PLYValue[PLYValue["MIN_X"] = 0] = "MIN_X";
    PLYValue[PLYValue["MIN_Y"] = 1] = "MIN_Y";
    PLYValue[PLYValue["MIN_Z"] = 2] = "MIN_Z";
    PLYValue[PLYValue["MAX_X"] = 3] = "MAX_X";
    PLYValue[PLYValue["MAX_Y"] = 4] = "MAX_Y";
    PLYValue[PLYValue["MAX_Z"] = 5] = "MAX_Z";
    PLYValue[PLYValue["MIN_SCALE_X"] = 6] = "MIN_SCALE_X";
    PLYValue[PLYValue["MIN_SCALE_Y"] = 7] = "MIN_SCALE_Y";
    PLYValue[PLYValue["MIN_SCALE_Z"] = 8] = "MIN_SCALE_Z";
    PLYValue[PLYValue["MAX_SCALE_X"] = 9] = "MAX_SCALE_X";
    PLYValue[PLYValue["MAX_SCALE_Y"] = 10] = "MAX_SCALE_Y";
    PLYValue[PLYValue["MAX_SCALE_Z"] = 11] = "MAX_SCALE_Z";
    PLYValue[PLYValue["PACKED_POSITION"] = 12] = "PACKED_POSITION";
    PLYValue[PLYValue["PACKED_ROTATION"] = 13] = "PACKED_ROTATION";
    PLYValue[PLYValue["PACKED_SCALE"] = 14] = "PACKED_SCALE";
    PLYValue[PLYValue["PACKED_COLOR"] = 15] = "PACKED_COLOR";
    PLYValue[PLYValue["X"] = 16] = "X";
    PLYValue[PLYValue["Y"] = 17] = "Y";
    PLYValue[PLYValue["Z"] = 18] = "Z";
    PLYValue[PLYValue["SCALE_0"] = 19] = "SCALE_0";
    PLYValue[PLYValue["SCALE_1"] = 20] = "SCALE_1";
    PLYValue[PLYValue["SCALE_2"] = 21] = "SCALE_2";
    PLYValue[PLYValue["DIFFUSE_RED"] = 22] = "DIFFUSE_RED";
    PLYValue[PLYValue["DIFFUSE_GREEN"] = 23] = "DIFFUSE_GREEN";
    PLYValue[PLYValue["DIFFUSE_BLUE"] = 24] = "DIFFUSE_BLUE";
    PLYValue[PLYValue["OPACITY"] = 25] = "OPACITY";
    PLYValue[PLYValue["F_DC_0"] = 26] = "F_DC_0";
    PLYValue[PLYValue["F_DC_1"] = 27] = "F_DC_1";
    PLYValue[PLYValue["F_DC_2"] = 28] = "F_DC_2";
    PLYValue[PLYValue["F_DC_3"] = 29] = "F_DC_3";
    PLYValue[PLYValue["ROT_0"] = 30] = "ROT_0";
    PLYValue[PLYValue["ROT_1"] = 31] = "ROT_1";
    PLYValue[PLYValue["ROT_2"] = 32] = "ROT_2";
    PLYValue[PLYValue["ROT_3"] = 33] = "ROT_3";
    PLYValue[PLYValue["UNDEFINED"] = 34] = "UNDEFINED";
})(PLYValue || (PLYValue = {}));
/**
 * Class used to render a gaussian splatting mesh
 */
class GaussianSplattingMesh extends _mesh_js__WEBPACK_IMPORTED_MODULE_1__/* .Mesh */ .e {
    /**
     * Gets the covariancesA texture
     */
    get covariancesATexture() {
        return this._covariancesATexture;
    }
    /**
     * Gets the covariancesB texture
     */
    get covariancesBTexture() {
        return this._covariancesBTexture;
    }
    /**
     * Gets the centers texture
     */
    get centersTexture() {
        return this._centersTexture;
    }
    /**
     * Gets the colors texture
     */
    get colorsTexture() {
        return this._colorsTexture;
    }
    /**
     * set rendering material
     */
    set material(value) {
        this._material = value;
        this._material.backFaceCulling = true;
        this._material.cullBackFaces = false;
        value.resetDrawCache();
    }
    /**
     * get rendering material
     */
    get material() {
        return this._material;
    }
    /**
     * Creates a new gaussian splatting mesh
     * @param name defines the name of the mesh
     * @param url defines the url to load from (optional)
     * @param scene defines the hosting scene (optional)
     * @param keepInRam keep datas in ram for editing purpose
     */
    constructor(name, url = null, scene = null, keepInRam = false) {
        super(name, scene);
        this._vertexCount = 0;
        this._worker = null;
        this._frameIdLastUpdate = -1;
        this._modelViewMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Identity();
        this._canPostToWorker = true;
        this._readyToDisplay = false;
        this._covariancesATexture = null;
        this._covariancesBTexture = null;
        this._centersTexture = null;
        this._colorsTexture = null;
        this._splatPositions = null;
        this._splatIndex = null;
        //@ts-expect-error
        this._covariancesA = null;
        //@ts-expect-error
        this._covariancesB = null;
        //@ts-expect-error
        this._colors = null;
        this._keepInRam = false;
        this._delayedTextureUpdate = null;
        this._oldDirection = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq();
        this._useRGBACovariants = false;
        this._material = null;
        this._tmpCovariances = [0, 0, 0, 0, 0, 0];
        this._sortIsDirty = false;
        const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexData */ .P();
        // Use an intanced quad or triangle. Triangle might be a bit faster because of less shader invocation but I didn't see any difference.
        // Keeping both and use triangle for now.
        // for quad, use following lines
        //vertexData.positions = [-2, -2, 0, 2, -2, 0, 2, 2, 0, -2, 2, 0];
        //vertexData.indices = [0, 1, 2, 0, 2, 3];
        vertexData.positions = [-3, -2, 0, 3, -2, 0, 0, 4, 0];
        vertexData.indices = [0, 1, 2];
        vertexData.applyToMesh(this);
        this.subMeshes = [];
        // for quad, use following line
        //new SubMesh(0, 0, 4, 0, 6, this);
        new _subMesh_js__WEBPACK_IMPORTED_MODULE_0__/* .SubMesh */ .K(0, 0, 3, 0, 3, this);
        this.setEnabled(false);
        // webGL2 and webGPU support for RG texture with float16 is fine. not webGL1
        this._useRGBACovariants = !this.getEngine().isWebGPU && this.getEngine().version === 1.0;
        this._keepInRam = keepInRam;
        if (url) {
            this.loadFileAsync(url);
        }
        this._material = new _Materials_GaussianSplatting_gaussianSplattingMaterial_js__WEBPACK_IMPORTED_MODULE_5__/* .GaussianSplattingMaterial */ .b(this.name + "_material", this._scene);
    }
    /**
     * Returns the class name
     * @returns "GaussianSplattingMesh"
     */
    getClassName() {
        return "GaussianSplattingMesh";
    }
    /**
     * Returns the total number of vertices (splats) within the mesh
     * @returns the total number of vertices
     */
    getTotalVertices() {
        return this._vertexCount;
    }
    /**
     * Is this node ready to be used/rendered
     * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
     * @returns true when ready
     */
    isReady(completeCheck = false) {
        if (!super.isReady(completeCheck, true)) {
            return false;
        }
        if (!this._readyToDisplay) {
            // mesh is ready when worker has done at least 1 sorting
            this._postToWorker(true);
            return false;
        }
        return true;
    }
    /** @internal */
    _postToWorker(forced = false) {
        const frameId = this.getScene().getFrameId();
        if ((forced || frameId !== this._frameIdLastUpdate) && this._worker && this._scene.activeCamera && this._canPostToWorker) {
            const cameraMatrix = this._scene.activeCamera.getViewMatrix();
            this.getWorldMatrix().multiplyToRef(cameraMatrix, this._modelViewMatrix);
            cameraMatrix.invertToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[0]);
            this.getWorldMatrix().multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[1]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.TransformNormalToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Forward(this._scene.useRightHandedSystem), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[1], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[2]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[2].normalize();
            const dot = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.Dot(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[2], this._oldDirection);
            if (forced || Math.abs(dot - 1) >= 0.01) {
                this._oldDirection.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[2]);
                this._frameIdLastUpdate = frameId;
                this._canPostToWorker = false;
                this._worker.postMessage({ view: this._modelViewMatrix.m, depthMix: this._depthMix, useRightHandedSystem: this._scene.useRightHandedSystem }, [
                    this._depthMix.buffer,
                ]);
            }
        }
    }
    /**
     * Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager
     * @param subMesh defines the subMesh to render
     * @param enableAlphaMode defines if alpha mode can be changed
     * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering
     * @returns the current mesh
     */
    render(subMesh, enableAlphaMode, effectiveMeshReplacement) {
        this._postToWorker();
        return super.render(subMesh, enableAlphaMode, effectiveMeshReplacement);
    }
    static _TypeNameToEnum(name) {
        switch (name) {
            case "float":
                return 0 /* PLYType.FLOAT */;
            case "int":
                return 1 /* PLYType.INT */;
                break;
            case "uint":
                return 2 /* PLYType.UINT */;
            case "double":
                return 3 /* PLYType.DOUBLE */;
            case "uchar":
                return 4 /* PLYType.UCHAR */;
        }
        return 5 /* PLYType.UNDEFINED */;
    }
    static _ValueNameToEnum(name) {
        switch (name) {
            case "min_x":
                return 0 /* PLYValue.MIN_X */;
            case "min_y":
                return 1 /* PLYValue.MIN_Y */;
            case "min_z":
                return 2 /* PLYValue.MIN_Z */;
            case "max_x":
                return 3 /* PLYValue.MAX_X */;
            case "max_y":
                return 4 /* PLYValue.MAX_Y */;
            case "max_z":
                return 5 /* PLYValue.MAX_Z */;
            case "min_scale_x":
                return 6 /* PLYValue.MIN_SCALE_X */;
            case "min_scale_y":
                return 7 /* PLYValue.MIN_SCALE_Y */;
            case "min_scale_z":
                return 8 /* PLYValue.MIN_SCALE_Z */;
            case "max_scale_x":
                return 9 /* PLYValue.MAX_SCALE_X */;
            case "max_scale_y":
                return 10 /* PLYValue.MAX_SCALE_Y */;
            case "max_scale_z":
                return 11 /* PLYValue.MAX_SCALE_Z */;
            case "packed_position":
                return 12 /* PLYValue.PACKED_POSITION */;
            case "packed_rotation":
                return 13 /* PLYValue.PACKED_ROTATION */;
            case "packed_scale":
                return 14 /* PLYValue.PACKED_SCALE */;
            case "packed_color":
                return 15 /* PLYValue.PACKED_COLOR */;
            case "x":
                return 16 /* PLYValue.X */;
            case "y":
                return 17 /* PLYValue.Y */;
            case "z":
                return 18 /* PLYValue.Z */;
            case "scale_0":
                return 19 /* PLYValue.SCALE_0 */;
            case "scale_1":
                return 20 /* PLYValue.SCALE_1 */;
            case "scale_2":
                return 21 /* PLYValue.SCALE_2 */;
            case "diffuse_red":
            case "red":
                return 22 /* PLYValue.DIFFUSE_RED */;
            case "diffuse_green":
            case "green":
                return 23 /* PLYValue.DIFFUSE_GREEN */;
            case "diffuse_blue":
            case "blue":
                return 24 /* PLYValue.DIFFUSE_BLUE */;
            case "f_dc_0":
                return 26 /* PLYValue.F_DC_0 */;
            case "f_dc_1":
                return 27 /* PLYValue.F_DC_1 */;
            case "f_dc_2":
                return 28 /* PLYValue.F_DC_2 */;
            case "f_dc_3":
                return 29 /* PLYValue.F_DC_3 */;
            case "opacity":
                return 25 /* PLYValue.OPACITY */;
            case "rot_0":
                return 30 /* PLYValue.ROT_0 */;
            case "rot_1":
                return 31 /* PLYValue.ROT_1 */;
            case "rot_2":
                return 32 /* PLYValue.ROT_2 */;
            case "rot_3":
                return 33 /* PLYValue.ROT_3 */;
        }
        return 34 /* PLYValue.UNDEFINED */;
    }
    /**
     * Parse a PLY file header and returns metas infos on splats and chunks
     * @param data the loaded buffer
     * @returns a PLYHeader
     */
    static ParseHeader(data) {
        const ubuf = new Uint8Array(data);
        const header = new TextDecoder().decode(ubuf.slice(0, 1024 * 10));
        const headerEnd = "end_header\n";
        const headerEndIndex = header.indexOf(headerEnd);
        if (headerEndIndex < 0 || !header) {
            // standard splat
            return null;
        }
        const vertexCount = parseInt(/element vertex (\d+)\n/.exec(header)[1]);
        const chunkElement = /element chunk (\d+)\n/.exec(header);
        let chunkCount = 0;
        if (chunkElement) {
            chunkCount = parseInt(chunkElement[1]);
        }
        let rowVertexOffset = 0;
        let rowChunkOffset = 0;
        const offsets = {
            double: 8,
            int: 4,
            uint: 4,
            float: 4,
            short: 2,
            ushort: 2,
            uchar: 1,
            list: 0,
        };
        let ElementMode;
        (function (ElementMode) {
            ElementMode[ElementMode["Vertex"] = 0] = "Vertex";
            ElementMode[ElementMode["Chunk"] = 1] = "Chunk";
        })(ElementMode || (ElementMode = {}));
        let chunkMode = 1 /* ElementMode.Chunk */;
        const vertexProperties = [];
        const chunkProperties = [];
        const filtered = header.slice(0, headerEndIndex).split("\n");
        for (const prop of filtered) {
            if (prop.startsWith("property ")) {
                const [, typeName, name] = prop.split(" ");
                const value = GaussianSplattingMesh._ValueNameToEnum(name);
                const type = GaussianSplattingMesh._TypeNameToEnum(typeName);
                if (chunkMode == 1 /* ElementMode.Chunk */) {
                    chunkProperties.push({ value, type, offset: rowChunkOffset });
                    rowChunkOffset += offsets[typeName];
                }
                else if (chunkMode == 0 /* ElementMode.Vertex */) {
                    vertexProperties.push({ value, type, offset: rowVertexOffset });
                    rowVertexOffset += offsets[typeName];
                }
                if (!offsets[typeName]) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger */ .V.Warn(`Unsupported property type: ${typeName}.`);
                }
            }
            else if (prop.startsWith("element ")) {
                const [, type] = prop.split(" ");
                if (type == "chunk") {
                    chunkMode = 1 /* ElementMode.Chunk */;
                }
                else if (type == "vertex") {
                    chunkMode = 0 /* ElementMode.Vertex */;
                }
            }
        }
        const dataView = new DataView(data, headerEndIndex + headerEnd.length);
        const buffer = new ArrayBuffer(GaussianSplattingMesh._RowOutputLength * vertexCount);
        return {
            vertexCount: vertexCount,
            chunkCount: chunkCount,
            rowVertexLength: rowVertexOffset,
            rowChunkLength: rowChunkOffset,
            vertexProperties: vertexProperties,
            chunkProperties: chunkProperties,
            dataView: dataView,
            buffer: buffer,
        };
    }
    static _GetCompressedChunks(header, offset) {
        if (!header.chunkCount) {
            return null;
        }
        const dataView = header.dataView;
        const compressedChunks = new Array(header.chunkCount);
        for (let i = 0; i < header.chunkCount; i++) {
            const currentChunk = { min: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(), max: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(), minScale: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(), maxScale: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq() };
            compressedChunks[i] = currentChunk;
            for (let propertyIndex = 0; propertyIndex < header.chunkProperties.length; propertyIndex++) {
                const property = header.chunkProperties[propertyIndex];
                let value;
                switch (property.type) {
                    case 0 /* PLYType.FLOAT */:
                        value = dataView.getFloat32(property.offset + offset.value, true);
                        break;
                    default:
                        continue;
                }
                switch (property.value) {
                    case 0 /* PLYValue.MIN_X */:
                        currentChunk.min.x = value;
                        break;
                    case 1 /* PLYValue.MIN_Y */:
                        currentChunk.min.y = value;
                        break;
                    case 2 /* PLYValue.MIN_Z */:
                        currentChunk.min.z = value;
                        break;
                    case 3 /* PLYValue.MAX_X */:
                        currentChunk.max.x = value;
                        break;
                    case 4 /* PLYValue.MAX_Y */:
                        currentChunk.max.y = value;
                        break;
                    case 5 /* PLYValue.MAX_Z */:
                        currentChunk.max.z = value;
                        break;
                    case 6 /* PLYValue.MIN_SCALE_X */:
                        currentChunk.minScale.x = value;
                        break;
                    case 7 /* PLYValue.MIN_SCALE_Y */:
                        currentChunk.minScale.y = value;
                        break;
                    case 8 /* PLYValue.MIN_SCALE_Z */:
                        currentChunk.minScale.z = value;
                        break;
                    case 9 /* PLYValue.MAX_SCALE_X */:
                        currentChunk.maxScale.x = value;
                        break;
                    case 10 /* PLYValue.MAX_SCALE_Y */:
                        currentChunk.maxScale.y = value;
                        break;
                    case 11 /* PLYValue.MAX_SCALE_Z */:
                        currentChunk.maxScale.z = value;
                        break;
                }
            }
            offset.value += header.rowChunkLength;
        }
        return compressedChunks;
    }
    static _GetSplat(header, index, compressedChunks, offset) {
        const q = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Quaternion[0];
        const temp3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Vector3[0];
        const rowOutputLength = GaussianSplattingMesh._RowOutputLength;
        const buffer = header.buffer;
        const dataView = header.dataView;
        const position = new Float32Array(buffer, index * rowOutputLength, 3);
        const scale = new Float32Array(buffer, index * rowOutputLength + 12, 3);
        const rgba = new Uint8ClampedArray(buffer, index * rowOutputLength + 24, 4);
        const rot = new Uint8ClampedArray(buffer, index * rowOutputLength + 28, 4);
        const chunkIndex = index >> 8;
        let r0 = 255;
        let r1 = 0;
        let r2 = 0;
        let r3 = 0;
        for (let propertyIndex = 0; propertyIndex < header.vertexProperties.length; propertyIndex++) {
            const property = header.vertexProperties[propertyIndex];
            let value;
            switch (property.type) {
                case 0 /* PLYType.FLOAT */:
                    value = dataView.getFloat32(offset.value + property.offset, true);
                    break;
                case 1 /* PLYType.INT */:
                    value = dataView.getInt32(offset.value + property.offset, true);
                    break;
                case 2 /* PLYType.UINT */:
                    value = dataView.getUint32(offset.value + property.offset, true);
                    break;
                case 3 /* PLYType.DOUBLE */:
                    value = dataView.getFloat64(offset.value + property.offset, true);
                    break;
                case 4 /* PLYType.UCHAR */:
                    value = dataView.getUint8(offset.value + property.offset);
                    break;
                default:
                    continue;
            }
            switch (property.value) {
                case 12 /* PLYValue.PACKED_POSITION */:
                    {
                        const compressedChunk = compressedChunks[chunkIndex];
                        unpack111011(value, temp3);
                        position[0] = _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_10__/* .Scalar */ .X.Lerp(compressedChunk.min.x, compressedChunk.max.x, temp3.x);
                        position[1] = -_Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_10__/* .Scalar */ .X.Lerp(compressedChunk.min.y, compressedChunk.max.y, temp3.y);
                        position[2] = _Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_10__/* .Scalar */ .X.Lerp(compressedChunk.min.z, compressedChunk.max.z, temp3.z);
                    }
                    break;
                case 13 /* PLYValue.PACKED_ROTATION */:
                    {
                        unpackRot(value, q);
                        r0 = q.w;
                        r1 = q.z;
                        r2 = q.y;
                        r3 = q.x;
                    }
                    break;
                case 14 /* PLYValue.PACKED_SCALE */:
                    {
                        const compressedChunk = compressedChunks[chunkIndex];
                        unpack111011(value, temp3);
                        scale[0] = Math.exp(_Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_10__/* .Scalar */ .X.Lerp(compressedChunk.minScale.x, compressedChunk.maxScale.x, temp3.x));
                        scale[1] = Math.exp(_Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_10__/* .Scalar */ .X.Lerp(compressedChunk.minScale.y, compressedChunk.maxScale.y, temp3.y));
                        scale[2] = Math.exp(_Maths_math_scalar_js__WEBPACK_IMPORTED_MODULE_10__/* .Scalar */ .X.Lerp(compressedChunk.minScale.z, compressedChunk.maxScale.z, temp3.z));
                    }
                    break;
                case 15 /* PLYValue.PACKED_COLOR */:
                    unpack8888(value, rgba);
                    break;
                case 16 /* PLYValue.X */:
                    position[0] = value;
                    break;
                case 17 /* PLYValue.Y */:
                    position[1] = value;
                    break;
                case 18 /* PLYValue.Z */:
                    position[2] = value;
                    break;
                case 19 /* PLYValue.SCALE_0 */:
                    scale[0] = Math.exp(value);
                    break;
                case 20 /* PLYValue.SCALE_1 */:
                    scale[1] = Math.exp(value);
                    break;
                case 21 /* PLYValue.SCALE_2 */:
                    scale[2] = Math.exp(value);
                    break;
                case 22 /* PLYValue.DIFFUSE_RED */:
                    rgba[0] = value;
                    break;
                case 23 /* PLYValue.DIFFUSE_GREEN */:
                    rgba[1] = value;
                    break;
                case 24 /* PLYValue.DIFFUSE_BLUE */:
                    rgba[2] = value;
                    break;
                case 26 /* PLYValue.F_DC_0 */:
                    rgba[0] = (0.5 + GaussianSplattingMesh._SH_C0 * value) * 255;
                    break;
                case 27 /* PLYValue.F_DC_1 */:
                    rgba[1] = (0.5 + GaussianSplattingMesh._SH_C0 * value) * 255;
                    break;
                case 28 /* PLYValue.F_DC_2 */:
                    rgba[2] = (0.5 + GaussianSplattingMesh._SH_C0 * value) * 255;
                    break;
                case 29 /* PLYValue.F_DC_3 */:
                    rgba[3] = (0.5 + GaussianSplattingMesh._SH_C0 * value) * 255;
                    break;
                case 25 /* PLYValue.OPACITY */:
                    rgba[3] = (1 / (1 + Math.exp(-value))) * 255;
                    break;
                case 30 /* PLYValue.ROT_0 */:
                    r0 = value;
                    break;
                case 31 /* PLYValue.ROT_1 */:
                    r1 = value;
                    break;
                case 32 /* PLYValue.ROT_2 */:
                    r2 = value;
                    break;
                case 33 /* PLYValue.ROT_3 */:
                    r3 = value;
                    break;
            }
        }
        q.set(r1, r2, r3, r0);
        q.normalize();
        rot[0] = q.w * 128 + 128;
        rot[1] = q.x * 128 + 128;
        rot[2] = q.y * 128 + 128;
        rot[3] = q.z * 128 + 128;
        offset.value += header.rowVertexLength;
    }
    /**
     * Converts a .ply data array buffer to splat
     * if data array buffer is not ply, returns the original buffer
     * @param data the .ply data to load
     * @param useCoroutine use coroutine and yield
     * @returns the loaded splat buffer
     */
    static *ConvertPLYToSplat(data, useCoroutine = false) {
        const header = GaussianSplattingMesh.ParseHeader(data);
        if (!header) {
            return data;
        }
        const offset = { value: 0 };
        const compressedChunks = GaussianSplattingMesh._GetCompressedChunks(header, offset);
        for (let i = 0; i < header.vertexCount; i++) {
            GaussianSplattingMesh._GetSplat(header, i, compressedChunks, offset);
            if (i % GaussianSplattingMesh._PlyConversionBatchSize === 0 && useCoroutine) {
                yield;
            }
        }
        return header.buffer;
    }
    /**
     * Converts a .ply data array buffer to splat
     * if data array buffer is not ply, returns the original buffer
     * @param data the .ply data to load
     * @returns the loaded splat buffer
     */
    static async ConvertPLYToSplatAsync(data) {
        return (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_11__/* .runCoroutineAsync */ .kj)(GaussianSplattingMesh.ConvertPLYToSplat(data, true), (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_11__/* .createYieldingScheduler */ .VP)());
    }
    /**
     * Loads a .splat Gaussian Splatting array buffer asynchronously
     * @param data arraybuffer containing splat file
     * @returns a promise that resolves when the operation is complete
     */
    loadDataAsync(data) {
        return this.updateDataAsync(data);
    }
    /**
     * Loads a .splat Gaussian or .ply Splatting file asynchronously
     * @param url path to the splat file to load
     * @returns a promise that resolves when the operation is complete
     * @deprecated Please use SceneLoader.ImportMeshAsync instead
     */
    loadFileAsync(url) {
        return _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__/* .Tools */ .S0.LoadFileAsync(url, true).then(async (plyBuffer) => {
            GaussianSplattingMesh.ConvertPLYToSplatAsync(plyBuffer).then((splatsData) => {
                this.updateDataAsync(splatsData);
            });
        });
    }
    /**
     * Releases resources associated with this mesh.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     */
    dispose(doNotRecurse) {
        this._covariancesATexture?.dispose();
        this._covariancesBTexture?.dispose();
        this._centersTexture?.dispose();
        this._colorsTexture?.dispose();
        this._covariancesATexture = null;
        this._covariancesBTexture = null;
        this._centersTexture = null;
        this._colorsTexture = null;
        this._worker?.terminate();
        this._worker = null;
        super.dispose(doNotRecurse, true);
    }
    _copyTextures(source) {
        this._covariancesATexture = source.covariancesATexture?.clone();
        this._covariancesBTexture = source.covariancesBTexture?.clone();
        this._centersTexture = source.centersTexture?.clone();
        this._colorsTexture = source.colorsTexture?.clone();
    }
    /**
     * Returns a new Mesh object generated from the current mesh properties.
     * @param name is a string, the name given to the new mesh
     * @returns a new Gaussian Splatting Mesh
     */
    clone(name = "") {
        const newGS = new GaussianSplattingMesh(name, undefined, this.getScene());
        newGS._copySource(this);
        newGS.makeGeometryUnique();
        newGS._vertexCount = this._vertexCount;
        newGS._copyTextures(this);
        newGS._modelViewMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Identity();
        newGS._splatPositions = this._splatPositions;
        newGS._readyToDisplay = false;
        newGS._instanciateWorker();
        const binfo = this.getBoundingInfo();
        newGS.getBoundingInfo().reConstruct(binfo.minimum, binfo.maximum, this.getWorldMatrix());
        newGS.forcedInstanceCount = newGS._vertexCount;
        newGS.setEnabled(true);
        return newGS;
    }
    _makeSplat(sourceIndex, destinationIndex, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum) {
        const matrixRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[0];
        const matrixScale = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[1];
        const quaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Quaternion[0];
        const covBSItemSize = this._useRGBACovariants ? 4 : 2;
        const x = fBuffer[8 * sourceIndex + 0];
        const y = -fBuffer[8 * sourceIndex + 1];
        const z = fBuffer[8 * sourceIndex + 2];
        this._splatPositions[4 * sourceIndex + 0] = x;
        this._splatPositions[4 * sourceIndex + 1] = y;
        this._splatPositions[4 * sourceIndex + 2] = z;
        minimum.minimizeInPlaceFromFloats(x, y, z);
        maximum.maximizeInPlaceFromFloats(x, y, z);
        quaternion.set((uBuffer[32 * sourceIndex + 28 + 1] - 128) / 128, (uBuffer[32 * sourceIndex + 28 + 2] - 128) / 128, (uBuffer[32 * sourceIndex + 28 + 3] - 128) / 128, -(uBuffer[32 * sourceIndex + 28 + 0] - 128) / 128);
        quaternion.toRotationMatrix(matrixRotation);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.ScalingToRef(fBuffer[8 * sourceIndex + 3 + 0] * 2, fBuffer[8 * sourceIndex + 3 + 1] * 2, fBuffer[8 * sourceIndex + 3 + 2] * 2, matrixScale);
        const M = matrixRotation.multiplyToRef(matrixScale, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .TmpVectors */ .AA.Matrix[0]).m;
        const covariances = this._tmpCovariances;
        covariances[0] = M[0] * M[0] + M[1] * M[1] + M[2] * M[2];
        covariances[1] = M[0] * M[4] + M[1] * M[5] + M[2] * M[6];
        covariances[2] = M[0] * M[8] + M[1] * M[9] + M[2] * M[10];
        covariances[3] = M[4] * M[4] + M[5] * M[5] + M[6] * M[6];
        covariances[4] = M[4] * M[8] + M[5] * M[9] + M[6] * M[10];
        covariances[5] = M[8] * M[8] + M[9] * M[9] + M[10] * M[10];
        // normalize covA, covB
        let factor = -10000;
        for (let covIndex = 0; covIndex < 6; covIndex++) {
            factor = Math.max(factor, Math.abs(covariances[covIndex]));
        }
        this._splatPositions[4 * sourceIndex + 3] = factor;
        const transform = factor;
        covA[destinationIndex * 4 + 0] = (0,_Misc_textureTools_js__WEBPACK_IMPORTED_MODULE_9__/* .ToHalfFloat */ .LZ)(covariances[0] / transform);
        covA[destinationIndex * 4 + 1] = (0,_Misc_textureTools_js__WEBPACK_IMPORTED_MODULE_9__/* .ToHalfFloat */ .LZ)(covariances[1] / transform);
        covA[destinationIndex * 4 + 2] = (0,_Misc_textureTools_js__WEBPACK_IMPORTED_MODULE_9__/* .ToHalfFloat */ .LZ)(covariances[2] / transform);
        covA[destinationIndex * 4 + 3] = (0,_Misc_textureTools_js__WEBPACK_IMPORTED_MODULE_9__/* .ToHalfFloat */ .LZ)(covariances[3] / transform);
        covB[destinationIndex * covBSItemSize + 0] = (0,_Misc_textureTools_js__WEBPACK_IMPORTED_MODULE_9__/* .ToHalfFloat */ .LZ)(covariances[4] / transform);
        covB[destinationIndex * covBSItemSize + 1] = (0,_Misc_textureTools_js__WEBPACK_IMPORTED_MODULE_9__/* .ToHalfFloat */ .LZ)(covariances[5] / transform);
        // colors
        colorArray[destinationIndex * 4 + 0] = uBuffer[32 * sourceIndex + 24 + 0];
        colorArray[destinationIndex * 4 + 1] = uBuffer[32 * sourceIndex + 24 + 1];
        colorArray[destinationIndex * 4 + 2] = uBuffer[32 * sourceIndex + 24 + 2];
        colorArray[destinationIndex * 4 + 3] = uBuffer[32 * sourceIndex + 24 + 3];
    }
    _updateTextures(covA, covB, colorArray) {
        const textureSize = this._getTextureSize(this._vertexCount);
        // Update the textures
        const createTextureFromData = (data, width, height, format) => {
            return new _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_6__/* .RawTexture */ .I(data, width, height, format, this._scene, false, false, 2, 1);
        };
        const createTextureFromDataU8 = (data, width, height, format) => {
            return new _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_6__/* .RawTexture */ .I(data, width, height, format, this._scene, false, false, 2, 0);
        };
        const createTextureFromDataF16 = (data, width, height, format) => {
            return new _Materials_Textures_rawTexture_js__WEBPACK_IMPORTED_MODULE_6__/* .RawTexture */ .I(data, width, height, format, this._scene, false, false, 2, 2);
        };
        if (this._keepInRam) {
            this._covariancesA = covA;
            this._covariancesB = covB;
            this._colors = colorArray;
        }
        if (this._covariancesATexture) {
            this._delayedTextureUpdate = { covA: covA, covB: covB, colors: colorArray, centers: this._splatPositions };
            const positions = Float32Array.from(this._splatPositions);
            const vertexCount = this._vertexCount;
            this._worker.postMessage({ positions, vertexCount }, [positions.buffer]);
            this._postToWorker(true);
        }
        else {
            this._covariancesATexture = createTextureFromDataF16(covA, textureSize.x, textureSize.y, 5);
            this._covariancesBTexture = createTextureFromDataF16(covB, textureSize.x, textureSize.y, this._useRGBACovariants ? 5 : 7);
            this._centersTexture = createTextureFromData(this._splatPositions, textureSize.x, textureSize.y, 5);
            this._colorsTexture = createTextureFromDataU8(colorArray, textureSize.x, textureSize.y, 5);
            this._instanciateWorker();
        }
    }
    *_updateData(data, isAsync) {
        // if a covariance texture is present, then it's not a creation but an update
        if (!this._covariancesATexture) {
            this._readyToDisplay = false;
        }
        // Parse the data
        const uBuffer = new Uint8Array(data);
        const fBuffer = new Float32Array(uBuffer.buffer);
        const vertexCount = uBuffer.length / GaussianSplattingMesh._RowOutputLength;
        if (vertexCount != this._vertexCount) {
            this._updateSplatIndexBuffer(vertexCount);
        }
        this._vertexCount = vertexCount;
        const textureSize = this._getTextureSize(vertexCount);
        const textureLength = textureSize.x * textureSize.y;
        const lineCountUpdate = GaussianSplattingMesh.ProgressiveUpdateAmount ?? textureSize.y;
        const textureLengthPerUpdate = textureSize.x * lineCountUpdate;
        this._splatPositions = new Float32Array(4 * textureLength);
        const covA = new Uint16Array(textureLength * 4);
        const covB = new Uint16Array((this._useRGBACovariants ? 4 : 2) * textureLength);
        const colorArray = new Uint8Array(textureLength * 4);
        const minimum = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        const maximum = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
        if (GaussianSplattingMesh.ProgressiveUpdateAmount) {
            // create textures with not filled-yet array, then update directly portions of it
            this._updateTextures(covA, covB, colorArray);
            this.setEnabled(true);
            const partCount = Math.ceil(textureSize.y / lineCountUpdate);
            for (let partIndex = 0; partIndex < partCount; partIndex++) {
                const updateLine = partIndex * lineCountUpdate;
                const splatIndexBase = updateLine * textureSize.x;
                for (let i = 0; i < textureLengthPerUpdate; i++) {
                    this._makeSplat(splatIndexBase + i, splatIndexBase + i, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum);
                }
                this._updateSubTextures(this._splatPositions, covA, covB, colorArray, updateLine, Math.min(lineCountUpdate, textureSize.y - updateLine));
                // Update the binfo
                this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());
                if (isAsync) {
                    yield;
                }
            }
            // sort will be dirty here as just finished filled positions will not be sorted
            const positions = Float32Array.from(this._splatPositions);
            const vertexCount = this._vertexCount;
            this._worker.postMessage({ positions, vertexCount }, [positions.buffer]);
            this._sortIsDirty = true;
        }
        else {
            for (let i = 0; i < vertexCount; i++) {
                this._makeSplat(i, i, fBuffer, uBuffer, covA, covB, colorArray, minimum, maximum);
                if (isAsync && i % GaussianSplattingMesh._SplatBatchSize === 0) {
                    yield;
                }
            }
            // textures
            this._updateTextures(covA, covB, colorArray);
            // Update the binfo
            this.getBoundingInfo().reConstruct(minimum, maximum, this.getWorldMatrix());
            this.setEnabled(true);
        }
        this._postToWorker(true);
    }
    /**
     * Update asynchronously the buffer
     * @param data array buffer containing center, color, orientation and scale of splats
     * @returns a promise
     */
    async updateDataAsync(data) {
        return (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_11__/* .runCoroutineAsync */ .kj)(this._updateData(data, true), (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_11__/* .createYieldingScheduler */ .VP)());
    }
    /**
     * @experimental
     * Update data from GS (position, orientation, color, scaling)
     * @param data array that contain all the datas
     */
    updateData(data) {
        (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_11__/* .runCoroutineSync */ .V1)(this._updateData(data, false));
    }
    // in case size is different
    _updateSplatIndexBuffer(vertexCount) {
        if (!this._splatIndex || vertexCount > this._splatIndex.length) {
            this._splatIndex = new Float32Array(vertexCount);
            this.thinInstanceSetBuffer("splatIndex", this._splatIndex, 1, false);
        }
        this.forcedInstanceCount = vertexCount;
    }
    _updateSubTextures(centers, covA, covB, colors, lineStart, lineCount) {
        const updateTextureFromData = (texture, data, width, lineStart, lineCount) => {
            this.getEngine().updateTextureData(texture.getInternalTexture(), data, 0, lineStart, width, lineCount, 0, 0, false);
        };
        const updateTextureFromDataU8 = (texture, data, width, lineStart, lineCount) => {
            this.getEngine().updateTextureData(texture.getInternalTexture(), data, 0, lineStart, width, lineCount, 0, 0, false);
        };
        const updateTextureFromDataF16 = (texture, data, width, lineStart, lineCount) => {
            this.getEngine().updateTextureData(texture.getInternalTexture(), data, 0, lineStart, width, lineCount, 0, 0, false);
        };
        const textureSize = this._getTextureSize(this._vertexCount);
        const covBSItemSize = this._useRGBACovariants ? 4 : 2;
        const texelStart = lineStart * textureSize.x;
        const texelCount = lineCount * textureSize.x;
        const covAView = new Uint16Array(covA.buffer, texelStart * 4 * Uint16Array.BYTES_PER_ELEMENT, texelCount * 4);
        const covBView = new Uint16Array(covB.buffer, texelStart * covBSItemSize * Uint16Array.BYTES_PER_ELEMENT, texelCount * covBSItemSize);
        const colorsView = new Uint8Array(colors.buffer, texelStart * 4, texelCount * 4);
        const centersView = new Float32Array(centers.buffer, texelStart * 4 * Float32Array.BYTES_PER_ELEMENT, texelCount * 4);
        updateTextureFromDataF16(this._covariancesATexture, covAView, textureSize.x, lineStart, lineCount);
        updateTextureFromDataF16(this._covariancesBTexture, covBView, textureSize.x, lineStart, lineCount);
        updateTextureFromData(this._centersTexture, centersView, textureSize.x, lineStart, lineCount);
        updateTextureFromDataU8(this._colorsTexture, colorsView, textureSize.x, lineStart, lineCount);
    }
    _instanciateWorker() {
        if (!this._vertexCount) {
            return;
        }
        this._updateSplatIndexBuffer(this._vertexCount);
        // Start the worker thread
        this._worker?.terminate();
        this._worker = new Worker(URL.createObjectURL(new Blob(["(", GaussianSplattingMesh._CreateWorker.toString(), ")(self)"], {
            type: "application/javascript",
        })));
        this._depthMix = new BigInt64Array(this._vertexCount);
        const positions = Float32Array.from(this._splatPositions);
        const vertexCount = this._vertexCount;
        this._worker.postMessage({ positions, vertexCount }, [positions.buffer]);
        this._worker.onmessage = (e) => {
            this._depthMix = e.data.depthMix;
            const indexMix = new Uint32Array(e.data.depthMix.buffer);
            if (this._splatIndex) {
                for (let j = 0; j < this._vertexCount; j++) {
                    this._splatIndex[j] = indexMix[2 * j];
                }
            }
            if (this._delayedTextureUpdate) {
                const textureSize = this._getTextureSize(vertexCount);
                this._updateSubTextures(this._delayedTextureUpdate.centers, this._delayedTextureUpdate.covA, this._delayedTextureUpdate.covB, this._delayedTextureUpdate.colors, 0, textureSize.y);
                this._delayedTextureUpdate = null;
            }
            this.thinInstanceBufferUpdated("splatIndex");
            this._canPostToWorker = true;
            this._readyToDisplay = true;
            // sort is dirty when GS is visible for progressive update with a this message arriving but positions were partially filled
            // another update needs to be kicked. The kick can't happen just when the position buffer is ready because _canPostToWorker might be false.
            if (this._sortIsDirty) {
                this._postToWorker(true);
                this._sortIsDirty = false;
            }
        };
    }
    _getTextureSize(length) {
        const engine = this._scene.getEngine();
        const width = engine.getCaps().maxTextureSize;
        let height = 1;
        if (engine.version === 1 && !engine.isWebGPU) {
            while (width * height < length) {
                height *= 2;
            }
        }
        else {
            height = Math.ceil(length / width);
        }
        if (height > width) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_4__/* .Logger */ .V.Error("GaussianSplatting texture size: (" + width + ", " + height + "), maxTextureSize: " + width);
            height = width;
        }
        return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2 */ .I9(width, height);
    }
}
GaussianSplattingMesh._RowOutputLength = 3 * 4 + 3 * 4 + 4 + 4; // Vector3 position, Vector3 scale, 1 u8 quaternion, 1 color with alpha
GaussianSplattingMesh._SH_C0 = 0.28209479177387814;
// batch size between 2 yield calls. This value is a tradeoff between updates overhead and framerate hiccups
// This step is faster the PLY conversion. So batch size can be bigger
GaussianSplattingMesh._SplatBatchSize = 327680;
// batch size between 2 yield calls during the PLY to splat conversion.
GaussianSplattingMesh._PlyConversionBatchSize = 32768;
/**
 * Set the number of batch (a batch is 16384 splats) after which a display update is performed
 * A value of 0 (default) means display update will not happens before splat is ready.
 */
GaussianSplattingMesh.ProgressiveUpdateAmount = 0;
GaussianSplattingMesh._CreateWorker = function (self) {
    let vertexCount = 0;
    let positions;
    let depthMix;
    let indices;
    let floatMix;
    self.onmessage = (e) => {
        // updated on init
        if (e.data.positions) {
            positions = e.data.positions;
            vertexCount = e.data.vertexCount;
        }
        // udpate on view changed
        else {
            const viewProj = e.data.view;
            if (!positions || !viewProj) {
                // Sanity check, it shouldn't happen!
                throw new Error("positions or view is not defined!");
            }
            depthMix = e.data.depthMix;
            indices = new Uint32Array(depthMix.buffer);
            floatMix = new Float32Array(depthMix.buffer);
            // Sort
            for (let j = 0; j < vertexCount; j++) {
                indices[2 * j] = j;
            }
            let depthFactor = -1;
            if (e.data.useRightHandedSystem) {
                depthFactor = 1;
            }
            for (let j = 0; j < vertexCount; j++) {
                floatMix[2 * j + 1] = 10000 + (viewProj[2] * positions[4 * j + 0] + viewProj[6] * positions[4 * j + 1] + viewProj[10] * positions[4 * j + 2]) * depthFactor;
            }
            depthMix.sort();
            self.postMessage({ depthMix }, [depthMix.buffer]);
        }
    };
};
//# sourceMappingURL=gaussianSplattingMesh.js.map

/***/ }),

/***/ 54329:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (/* binding */ WebGLDataBuffer)
/* harmony export */ });
/* harmony import */ var _Buffers_dataBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71504);

/** @internal */
class WebGLDataBuffer extends _Buffers_dataBuffer_js__WEBPACK_IMPORTED_MODULE_0__/* .DataBuffer */ .n {
    constructor(resource) {
        super();
        this._buffer = resource;
    }
    get underlyingResource() {
        return this._buffer;
    }
}
//# sourceMappingURL=webGLDataBuffer.js.map

/***/ }),

/***/ 35985:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   u: () => (/* binding */ AbstractMesh)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95616);
/* harmony import */ var _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(36803);
/* harmony import */ var _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97328);
/* harmony import */ var _Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30311);
/* harmony import */ var _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(20863);
/* harmony import */ var _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80935);
/* harmony import */ var _Collisions_meshCollisionData_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(76439);
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(45503);
/* harmony import */ var _Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(71139);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(26041);
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65559);
/* harmony import */ var _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(18733);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(56552);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(79259);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(32206);



















function applyMorph(data, kind, morphTargetManager) {
    let getTargetData = null;
    switch (kind) {
        case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind:
            getTargetData = (target) => target.getPositions();
            break;
        case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind:
            getTargetData = (target) => target.getNormals();
            break;
        case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.TangentKind:
            getTargetData = (target) => target.getTangents();
            break;
        case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind:
            getTargetData = (target) => target.getUVs();
            break;
        default:
            return;
    }
    for (let index = 0; index < data.length; index++) {
        let value = data[index];
        for (let targetCount = 0; targetCount < morphTargetManager.numTargets; targetCount++) {
            const target = morphTargetManager.getTarget(targetCount);
            const influence = target.influence;
            if (influence !== 0) {
                const targetData = getTargetData(target);
                if (targetData) {
                    value += (targetData[index] - data[index]) * influence;
                }
            }
        }
        data[index] = value;
    }
}
function applySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData) {
    const tempVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0];
    const finalMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Matrix[0];
    const tempMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Matrix[1];
    const transformFromFloatsToRef = kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind ? _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformNormalFromFloatsToRef : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef;
    for (let index = 0, matWeightIdx = 0; index < data.length; index += 3, matWeightIdx += 4) {
        finalMatrix.reset();
        let inf;
        let weight;
        for (inf = 0; inf < 4; inf++) {
            weight = matricesWeightsData[matWeightIdx + inf];
            if (weight > 0) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);
                finalMatrix.addToSelf(tempMatrix);
            }
        }
        if (matricesIndicesExtraData && matricesWeightsExtraData) {
            for (inf = 0; inf < 4; inf++) {
                weight = matricesWeightsExtraData[matWeightIdx + inf];
                if (weight > 0) {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);
                    finalMatrix.addToSelf(tempMatrix);
                }
            }
        }
        transformFromFloatsToRef(data[index], data[index + 1], data[index + 2], finalMatrix, tempVector);
        tempVector.toArray(data, index);
    }
}
/** @internal */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _FacetDataStorage {
    constructor() {
        this.facetNb = 0; // facet number
        this.partitioningSubdivisions = 10; // number of subdivisions per axis in the partitioning space
        this.partitioningBBoxRatio = 1.01; // the partitioning array space is by default 1% bigger than the bounding box
        this.facetDataEnabled = false; // is the facet data feature enabled on this mesh ?
        this.facetParameters = {}; // keep a reference to the object parameters to avoid memory re-allocation
        this.bbSize = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero(); // bbox size approximated for facet data
        this.subDiv = {
            // actual number of subdivisions per axis for ComputeNormals()
            max: 1,
            // eslint-disable-next-line @typescript-eslint/naming-convention
            X: 1,
            // eslint-disable-next-line @typescript-eslint/naming-convention
            Y: 1,
            // eslint-disable-next-line @typescript-eslint/naming-convention
            Z: 1,
        };
        this.facetDepthSort = false; // is the facet depth sort to be computed
        this.facetDepthSortEnabled = false; // is the facet depth sort initialized
    }
}
/**
 * @internal
 **/
// eslint-disable-next-line @typescript-eslint/naming-convention
class _InternalAbstractMeshDataInfo {
    constructor() {
        this._hasVertexAlpha = false;
        this._useVertexColors = true;
        this._numBoneInfluencers = 4;
        this._applyFog = true;
        this._receiveShadows = false;
        this._facetData = new _FacetDataStorage();
        this._visibility = 1.0;
        this._skeleton = null;
        this._layerMask = 0x0fffffff;
        this._computeBonesUsingShaders = true;
        this._isActive = false;
        this._onlyForInstances = false;
        this._isActiveIntermediate = false;
        this._onlyForInstancesIntermediate = false;
        this._actAsRegularMesh = false;
        this._currentLOD = null;
        this._currentLODIsUpToDate = false;
        this._collisionRetryCount = 3;
        this._morphTargetManager = null;
        this._renderingGroupId = 0;
        this._bakedVertexAnimationManager = null;
        this._material = null;
        this._positions = null;
        this._pointerOverDisableMeshTesting = false;
        // Collisions
        this._meshCollisionData = new _Collisions_meshCollisionData_js__WEBPACK_IMPORTED_MODULE_9__/* ._MeshCollisionData */ .j();
        this._enableDistantPicking = false;
        /** @internal
         * Bounding info that is unnafected by the addition of thin instances
         */
        this._rawBoundingInfo = null;
        /** @internal
         * This value will indicate us that at some point, the mesh was specifically used with the opposite winding order
         * We use that as a clue to force the material to sideOrientation = null
         */
        this._sideOrientationHint = false;
        /**
         * @internal
         * if this is set to true, the mesh will be visible only if its parent(s) are also visible
         */
        this._inheritVisibility = false;
    }
}
/**
 * Class used to store all common mesh properties
 */
class AbstractMesh extends _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V {
    /**
     * No billboard
     */
    static get BILLBOARDMODE_NONE() {
        return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V.BILLBOARDMODE_NONE;
    }
    /** Billboard on X axis */
    static get BILLBOARDMODE_X() {
        return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V.BILLBOARDMODE_X;
    }
    /** Billboard on Y axis */
    static get BILLBOARDMODE_Y() {
        return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V.BILLBOARDMODE_Y;
    }
    /** Billboard on Z axis */
    static get BILLBOARDMODE_Z() {
        return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V.BILLBOARDMODE_Z;
    }
    /** Billboard on all axes */
    static get BILLBOARDMODE_ALL() {
        return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V.BILLBOARDMODE_ALL;
    }
    /** Billboard on using position instead of orientation */
    static get BILLBOARDMODE_USE_POSITION() {
        return _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V.BILLBOARDMODE_USE_POSITION;
    }
    /**
     * Gets the number of facets in the mesh
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet
     */
    get facetNb() {
        return this._internalAbstractMeshDataInfo._facetData.facetNb;
    }
    /**
     * Gets or set the number (integer) of subdivisions per axis in the partitioning space
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning
     */
    get partitioningSubdivisions() {
        return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions;
    }
    set partitioningSubdivisions(nb) {
        this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions = nb;
    }
    /**
     * The ratio (float) to apply to the bounding box size to set to the partitioning space.
     * Ex : 1.01 (default) the partitioning space is 1% bigger than the bounding box
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning
     */
    get partitioningBBoxRatio() {
        return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio;
    }
    set partitioningBBoxRatio(ratio) {
        this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio = ratio;
    }
    /**
     * Gets or sets a boolean indicating that the facets must be depth sorted on next call to `updateFacetData()`.
     * Works only for updatable meshes.
     * Doesn't work with multi-materials
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort
     */
    get mustDepthSortFacets() {
        return this._internalAbstractMeshDataInfo._facetData.facetDepthSort;
    }
    set mustDepthSortFacets(sort) {
        this._internalAbstractMeshDataInfo._facetData.facetDepthSort = sort;
    }
    /**
     * The location (Vector3) where the facet depth sort must be computed from.
     * By default, the active camera position.
     * Used only when facet depth sort is enabled
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort
     */
    get facetDepthSortFrom() {
        return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom;
    }
    set facetDepthSortFrom(location) {
        this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom = location;
    }
    /** number of collision detection tries. Change this value if not all collisions are detected and handled properly */
    get collisionRetryCount() {
        return this._internalAbstractMeshDataInfo._collisionRetryCount;
    }
    set collisionRetryCount(retryCount) {
        this._internalAbstractMeshDataInfo._collisionRetryCount = retryCount;
    }
    /**
     * gets a boolean indicating if facetData is enabled
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet
     */
    get isFacetDataEnabled() {
        return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled;
    }
    /**
     * Gets or sets the morph target manager
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/morphTargets
     */
    get morphTargetManager() {
        return this._internalAbstractMeshDataInfo._morphTargetManager;
    }
    set morphTargetManager(value) {
        if (this._internalAbstractMeshDataInfo._morphTargetManager === value) {
            return;
        }
        this._internalAbstractMeshDataInfo._morphTargetManager = value;
        this._syncGeometryWithMorphTargetManager();
    }
    /**
     * Gets or sets the baked vertex animation manager
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/baked_texture_animations
     */
    get bakedVertexAnimationManager() {
        return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager;
    }
    set bakedVertexAnimationManager(value) {
        if (this._internalAbstractMeshDataInfo._bakedVertexAnimationManager === value) {
            return;
        }
        this._internalAbstractMeshDataInfo._bakedVertexAnimationManager = value;
        this._markSubMeshesAsAttributesDirty();
    }
    /** @internal */
    _syncGeometryWithMorphTargetManager() { }
    /**
     * @internal
     */
    _updateNonUniformScalingState(value) {
        if (!super._updateNonUniformScalingState(value)) {
            return false;
        }
        this._markSubMeshesAsMiscDirty();
        return true;
    }
    /** @internal */
    get rawBoundingInfo() {
        return this._internalAbstractMeshDataInfo._rawBoundingInfo;
    }
    set rawBoundingInfo(boundingInfo) {
        this._internalAbstractMeshDataInfo._rawBoundingInfo = boundingInfo;
    }
    /** Set a function to call when this mesh collides with another one */
    set onCollide(callback) {
        if (this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver) {
            this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver);
        }
        this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver = this.onCollideObservable.add(callback);
    }
    /** Set a function to call when the collision's position changes */
    set onCollisionPositionChange(callback) {
        if (this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver) {
            this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver);
        }
        this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(callback);
    }
    /**
     * Gets or sets mesh visibility between 0 and 1 (default is 1)
     */
    get visibility() {
        return this._internalAbstractMeshDataInfo._visibility;
    }
    /**
     * Gets or sets mesh visibility between 0 and 1 (default is 1)
     */
    set visibility(value) {
        if (this._internalAbstractMeshDataInfo._visibility === value) {
            return;
        }
        const oldValue = this._internalAbstractMeshDataInfo._visibility;
        this._internalAbstractMeshDataInfo._visibility = value;
        if ((oldValue === 1 && value !== 1) || (oldValue !== 1 && value === 1)) {
            this._markSubMeshesAsDirty((defines) => {
                defines.markAsMiscDirty();
                defines.markAsPrePassDirty();
            });
        }
    }
    /**
     * If set to true, a mesh will only be visible only if its parent(s) are also visible (default is false)
     */
    get inheritVisibility() {
        return this._internalAbstractMeshDataInfo._inheritVisibility;
    }
    set inheritVisibility(value) {
        this._internalAbstractMeshDataInfo._inheritVisibility = value;
    }
    /**
     * Gets or sets a boolean indicating if the mesh is visible (renderable). Default is true
     */
    get isVisible() {
        if (!this._isVisible || !this.inheritVisibility || !this._parentNode) {
            return this._isVisible;
        }
        if (this._isVisible) {
            let parent = this._parentNode;
            while (parent) {
                const parentVisible = parent.isVisible;
                if (typeof parentVisible !== "undefined") {
                    return parentVisible;
                }
                parent = parent.parent;
            }
        }
        return this._isVisible;
    }
    set isVisible(value) {
        this._isVisible = value;
    }
    /**
     * Gets or sets the property which disables the test that is checking that the mesh under the pointer is the same than the previous time we tested for it (default: false).
     * Set this property to true if you want thin instances picking to be reported accurately when moving over the mesh.
     * Note that setting this property to true will incur some performance penalties when dealing with pointer events for this mesh so use it sparingly.
     */
    get pointerOverDisableMeshTesting() {
        return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting;
    }
    set pointerOverDisableMeshTesting(disable) {
        this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting = disable;
    }
    /**
     * Specifies the rendering group id for this mesh (0 by default)
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering#rendering-groups
     */
    get renderingGroupId() {
        return this._internalAbstractMeshDataInfo._renderingGroupId;
    }
    set renderingGroupId(value) {
        this._internalAbstractMeshDataInfo._renderingGroupId = value;
    }
    /** Gets or sets current material */
    get material() {
        return this._internalAbstractMeshDataInfo._material;
    }
    set material(value) {
        this._setMaterial(value);
    }
    /** @internal */
    _setMaterial(value) {
        if (this._internalAbstractMeshDataInfo._material === value) {
            return;
        }
        // remove from material mesh map id needed
        if (this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap) {
            this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = undefined;
        }
        this._internalAbstractMeshDataInfo._material = value;
        if (value && value.meshMap) {
            value.meshMap[this.uniqueId] = this;
        }
        if (this.onMaterialChangedObservable.hasObservers()) {
            this.onMaterialChangedObservable.notifyObservers(this);
        }
        if (!this.subMeshes) {
            return;
        }
        this.resetDrawCache(undefined, value == null);
        this._unBindEffect();
    }
    /**
     * Gets the material used to render the mesh in a specific render pass
     * @param renderPassId render pass id
     * @returns material used for the render pass. If no specific material is used for this render pass, undefined is returned (meaning mesh.material is used for this pass)
     */
    getMaterialForRenderPass(renderPassId) {
        return this._internalAbstractMeshDataInfo._materialForRenderPass?.[renderPassId];
    }
    /**
     * Sets the material to be used to render the mesh in a specific render pass
     * @param renderPassId render pass id
     * @param material material to use for this render pass. If undefined is passed, no specific material will be used for this render pass but the regular material will be used instead (mesh.material)
     */
    setMaterialForRenderPass(renderPassId, material) {
        this.resetDrawCache(renderPassId);
        if (!this._internalAbstractMeshDataInfo._materialForRenderPass) {
            this._internalAbstractMeshDataInfo._materialForRenderPass = [];
        }
        this._internalAbstractMeshDataInfo._materialForRenderPass[renderPassId] = material;
    }
    /**
     * Gets or sets a boolean indicating that this mesh can receive realtime shadows
     * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
     */
    get receiveShadows() {
        return this._internalAbstractMeshDataInfo._receiveShadows;
    }
    set receiveShadows(value) {
        if (this._internalAbstractMeshDataInfo._receiveShadows === value) {
            return;
        }
        this._internalAbstractMeshDataInfo._receiveShadows = value;
        this._markSubMeshesAsLightDirty();
    }
    /**
     * Gets or sets a boolean indicating that this mesh needs to use vertex alpha data to render.
     * This property is misnamed and should be `useVertexAlpha`. Note that the mesh will be rendered
     * with alpha blending when this flag is set even if vertex alpha data is missing from the geometry.
     */
    get hasVertexAlpha() {
        return this._internalAbstractMeshDataInfo._hasVertexAlpha;
    }
    set hasVertexAlpha(value) {
        if (this._internalAbstractMeshDataInfo._hasVertexAlpha === value) {
            return;
        }
        this._internalAbstractMeshDataInfo._hasVertexAlpha = value;
        this._markSubMeshesAsAttributesDirty();
        this._markSubMeshesAsMiscDirty();
    }
    /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */
    get useVertexColors() {
        return this._internalAbstractMeshDataInfo._useVertexColors;
    }
    set useVertexColors(value) {
        if (this._internalAbstractMeshDataInfo._useVertexColors === value) {
            return;
        }
        this._internalAbstractMeshDataInfo._useVertexColors = value;
        this._markSubMeshesAsAttributesDirty();
    }
    /**
     * Gets or sets a boolean indicating that bone animations must be computed by the GPU (true by default)
     */
    get computeBonesUsingShaders() {
        return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;
    }
    set computeBonesUsingShaders(value) {
        if (this._internalAbstractMeshDataInfo._computeBonesUsingShaders === value) {
            return;
        }
        this._internalAbstractMeshDataInfo._computeBonesUsingShaders = value;
        this._markSubMeshesAsAttributesDirty();
    }
    /** Gets or sets the number of allowed bone influences per vertex (4 by default) */
    get numBoneInfluencers() {
        return this._internalAbstractMeshDataInfo._numBoneInfluencers;
    }
    set numBoneInfluencers(value) {
        if (this._internalAbstractMeshDataInfo._numBoneInfluencers === value) {
            return;
        }
        this._internalAbstractMeshDataInfo._numBoneInfluencers = value;
        this._markSubMeshesAsAttributesDirty();
    }
    /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */
    get applyFog() {
        return this._internalAbstractMeshDataInfo._applyFog;
    }
    set applyFog(value) {
        if (this._internalAbstractMeshDataInfo._applyFog === value) {
            return;
        }
        this._internalAbstractMeshDataInfo._applyFog = value;
        this._markSubMeshesAsMiscDirty();
    }
    /** When enabled, decompose picking matrices for better precision with large values for mesh position and scling */
    get enableDistantPicking() {
        return this._internalAbstractMeshDataInfo._enableDistantPicking;
    }
    set enableDistantPicking(value) {
        this._internalAbstractMeshDataInfo._enableDistantPicking = value;
    }
    /**
     * Gets or sets the current layer mask (default is 0x0FFFFFFF)
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/layerMasksAndMultiCam
     */
    get layerMask() {
        return this._internalAbstractMeshDataInfo._layerMask;
    }
    set layerMask(value) {
        if (value === this._internalAbstractMeshDataInfo._layerMask) {
            return;
        }
        this._internalAbstractMeshDataInfo._layerMask = value;
        this._resyncLightSources();
    }
    /**
     * Gets or sets a collision mask used to mask collisions (default is -1).
     * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
     */
    get collisionMask() {
        return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask;
    }
    set collisionMask(mask) {
        this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask = !isNaN(mask) ? mask : -1;
    }
    /**
     * Gets or sets a collision response flag (default is true).
     * when collisionResponse is false, events are still triggered but colliding entity has no response
     * This helps creating trigger volume when user wants collision feedback events but not position/velocity
     * to respond to the collision.
     */
    get collisionResponse() {
        return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse;
    }
    set collisionResponse(response) {
        this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse = response;
    }
    /**
     * Gets or sets the current collision group mask (-1 by default).
     * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
     */
    get collisionGroup() {
        return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup;
    }
    set collisionGroup(mask) {
        this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup = !isNaN(mask) ? mask : -1;
    }
    /**
     * Gets or sets current surrounding meshes (null by default).
     *
     * By default collision detection is tested against every mesh in the scene.
     * It is possible to set surroundingMeshes to a defined list of meshes and then only these specified
     * meshes will be tested for the collision.
     *
     * Note: if set to an empty array no collision will happen when this mesh is moved.
     */
    get surroundingMeshes() {
        return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes;
    }
    set surroundingMeshes(meshes) {
        this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes = meshes;
    }
    /** Gets the list of lights affecting that mesh */
    get lightSources() {
        return this._lightSources;
    }
    /**
     * Gets or sets a skeleton to apply skinning transformations
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
     */
    set skeleton(value) {
        const skeleton = this._internalAbstractMeshDataInfo._skeleton;
        if (skeleton && skeleton.needInitialSkinMatrix) {
            skeleton._unregisterMeshWithPoseMatrix(this);
        }
        if (value && value.needInitialSkinMatrix) {
            value._registerMeshWithPoseMatrix(this);
        }
        this._internalAbstractMeshDataInfo._skeleton = value;
        if (!this._internalAbstractMeshDataInfo._skeleton) {
            this._bonesTransformMatrices = null;
        }
        this._markSubMeshesAsAttributesDirty();
    }
    get skeleton() {
        return this._internalAbstractMeshDataInfo._skeleton;
    }
    // Constructor
    /**
     * Creates a new AbstractMesh
     * @param name defines the name of the mesh
     * @param scene defines the hosting scene
     */
    constructor(name, scene = null) {
        super(name, scene, false);
        // Internal data
        /** @internal */
        this._internalAbstractMeshDataInfo = new _InternalAbstractMeshDataInfo();
        /** @internal */
        this._waitingMaterialId = null;
        /** @internal */
        this._waitingMorphTargetManagerId = null;
        /**
         * The culling strategy to use to check whether the mesh must be rendered or not.
         * This value can be changed at any time and will be used on the next render mesh selection.
         * The possible values are :
         * - AbstractMesh.CULLINGSTRATEGY_STANDARD
         * - AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY
         * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION
         * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY
         * Please read each static variable documentation to get details about the culling process.
         * */
        this.cullingStrategy = AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY;
        // Events
        /**
         * An event triggered when this mesh collides with another one
         */
        this.onCollideObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * An event triggered when the collision's position changes
         */
        this.onCollisionPositionChangeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /**
         * An event triggered when material is changed
         */
        this.onMaterialChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        // Properties
        /**
         * Gets or sets the orientation for POV movement & rotation
         */
        this.definedFacingForward = true;
        /** @internal */
        this._occlusionQuery = null;
        /** @internal */
        this._renderingGroup = null;
        /** Gets or sets the alpha index used to sort transparent meshes
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering#alpha-index
         */
        this.alphaIndex = Number.MAX_VALUE;
        this._isVisible = true;
        /**
         * Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
         */
        this.isPickable = true;
        /**
         * Gets or sets a boolean indicating if the mesh can be near picked (touched by the XR controller or hands). Default is false
         */
        this.isNearPickable = false;
        /**
         * Gets or sets a boolean indicating if the mesh can be grabbed. Default is false.
         * Setting this to true, while using the XR near interaction feature, will trigger a pointer event when the mesh is grabbed.
         * Grabbing means that the controller is using the squeeze or main trigger button to grab the mesh.
         * This is different from nearPickable which only triggers the event when the mesh is touched by the controller
         */
        this.isNearGrabbable = false;
        /** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */
        this.showSubMeshesBoundingBox = false;
        /** Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
         * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
         */
        this.isBlocker = false;
        /**
         * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
         */
        this.enablePointerMoveEvents = false;
        /** Defines color to use when rendering outline */
        this.outlineColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_12__/* .Color3 */ .v9.Red();
        /** Define width to use when rendering outline */
        this.outlineWidth = 0.02;
        /** Defines color to use when rendering overlay */
        this.overlayColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_12__/* .Color3 */ .v9.Red();
        /** Defines alpha to use when rendering overlay */
        this.overlayAlpha = 0.5;
        /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */
        this.useOctreeForRenderingSelection = true;
        /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes picking (true by default) */
        this.useOctreeForPicking = true;
        /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */
        this.useOctreeForCollisions = true;
        /**
         * True if the mesh must be rendered in any case (this will shortcut the frustum clipping phase)
         */
        this.alwaysSelectAsActiveMesh = false;
        /**
         * Gets or sets a boolean indicating that the bounding info does not need to be kept in sync (for performance reason)
         */
        this.doNotSyncBoundingInfo = false;
        /**
         * Gets or sets the current action manager
         * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
         */
        this.actionManager = null;
        /**
         * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
         */
        this.ellipsoid = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0.5, 1, 0.5);
        /**
         * Gets or sets the ellipsoid offset used to impersonate this mesh when using collision engine (default is (0, 0, 0))
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
         */
        this.ellipsoidOffset = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(0, 0, 0);
        // Edges
        /**
         * Defines edge width used when edgesRenderer is enabled
         * @see https://www.babylonjs-playground.com/#10OJSG#13
         */
        this.edgesWidth = 1;
        /**
         * Defines edge color used when edgesRenderer is enabled
         * @see https://www.babylonjs-playground.com/#10OJSG#13
         */
        this.edgesColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_12__/* .Color4 */ .ov(1, 0, 0, 1);
        /** @internal */
        this._edgesRenderer = null;
        /** @internal */
        this._masterMesh = null;
        this._boundingInfo = null;
        this._boundingInfoIsDirty = true;
        /** @internal */
        this._renderId = 0;
        /** @internal */
        this._intersectionsInProgress = new Array();
        /** @internal */
        this._unIndexed = false;
        /** @internal */
        this._lightSources = new Array();
        // Loading properties
        /** @internal */
        this._waitingData = {
            lods: null,
            actions: null,
            freezeWorldMatrix: null,
        };
        /** @internal */
        this._bonesTransformMatrices = null;
        /** @internal */
        this._transformMatrixTexture = null;
        /**
         * An event triggered when the mesh is rebuilt.
         */
        this.onRebuildObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {
            newPosition.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions);
            if (this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length() > _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_17__/* .AbstractEngine */ .$.CollisionsEpsilon) {
                this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions);
            }
            if (collidedMesh) {
                this.onCollideObservable.notifyObservers(collidedMesh);
            }
            this.onCollisionPositionChangeObservable.notifyObservers(this.position);
        };
        scene = this.getScene();
        scene.addMesh(this);
        this._resyncLightSources();
        // Mesh Uniform Buffer.
        this._uniformBuffer = new _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_8__/* .UniformBuffer */ .D(this.getScene().getEngine(), undefined, undefined, name, !this.getScene().getEngine().isWebGPU);
        this._buildUniformLayout();
        switch (scene.performancePriority) {
            case 2 /* ScenePerformancePriority.Aggressive */:
                this.doNotSyncBoundingInfo = true;
            // eslint-disable-next-line no-fallthrough
            case 1 /* ScenePerformancePriority.Intermediate */:
                this.alwaysSelectAsActiveMesh = true;
                this.isPickable = false;
                break;
        }
    }
    _buildUniformLayout() {
        this._uniformBuffer.addUniform("world", 16);
        this._uniformBuffer.addUniform("visibility", 1);
        this._uniformBuffer.create();
    }
    /**
     * Transfer the mesh values to its UBO.
     * @param world The world matrix associated with the mesh
     */
    transferToEffect(world) {
        const ubo = this._uniformBuffer;
        ubo.updateMatrix("world", world);
        ubo.updateFloat("visibility", this._internalAbstractMeshDataInfo._visibility);
        ubo.update();
    }
    /**
     * Gets the mesh uniform buffer.
     * @returns the uniform buffer of the mesh.
     */
    getMeshUniformBuffer() {
        return this._uniformBuffer;
    }
    /**
     * Returns the string "AbstractMesh"
     * @returns "AbstractMesh"
     */
    getClassName() {
        return "AbstractMesh";
    }
    /**
     * Gets a string representation of the current mesh
     * @param fullDetails defines a boolean indicating if full details must be included
     * @returns a string representation of the current mesh
     */
    toString(fullDetails) {
        let ret = "Name: " + this.name + ", isInstance: " + (this.getClassName() !== "InstancedMesh" ? "YES" : "NO");
        ret += ", # of submeshes: " + (this.subMeshes ? this.subMeshes.length : 0);
        const skeleton = this._internalAbstractMeshDataInfo._skeleton;
        if (skeleton) {
            ret += ", skeleton: " + skeleton.name;
        }
        if (fullDetails) {
            ret += ", billboard mode: " + ["NONE", "X", "Y", null, "Z", null, null, "ALL"][this.billboardMode];
            ret += ", freeze wrld mat: " + (this._isWorldMatrixFrozen || this._waitingData.freezeWorldMatrix ? "YES" : "NO");
        }
        return ret;
    }
    /**
     * @internal
     */
    _getEffectiveParent() {
        if (this._masterMesh && this.billboardMode !== _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V.BILLBOARDMODE_NONE) {
            return this._masterMesh;
        }
        return super._getEffectiveParent();
    }
    /**
     * @internal
     */
    _getActionManagerForTrigger(trigger, initialCall = true) {
        if (this.actionManager && (initialCall || this.actionManager.isRecursive)) {
            if (trigger) {
                if (this.actionManager.hasSpecificTrigger(trigger)) {
                    return this.actionManager;
                }
            }
            else {
                return this.actionManager;
            }
        }
        if (!this.parent) {
            return null;
        }
        return this.parent._getActionManagerForTrigger(trigger, false);
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _rebuild(dispose = false) {
        this.onRebuildObservable.notifyObservers(this);
        if (this._occlusionQuery !== null) {
            this._occlusionQuery = null;
        }
        if (!this.subMeshes) {
            return;
        }
        for (const subMesh of this.subMeshes) {
            subMesh._rebuild();
        }
        this.resetDrawCache();
    }
    /** @internal */
    _resyncLightSources() {
        this._lightSources.length = 0;
        for (const light of this.getScene().lights) {
            if (!light.isEnabled()) {
                continue;
            }
            if (light.canAffectMesh(this)) {
                this._lightSources.push(light);
            }
        }
        this._markSubMeshesAsLightDirty();
    }
    /**
     * @internal
     */
    _resyncLightSource(light) {
        const isIn = light.isEnabled() && light.canAffectMesh(this);
        const index = this._lightSources.indexOf(light);
        let removed = false;
        if (index === -1) {
            if (!isIn) {
                return;
            }
            this._lightSources.push(light);
        }
        else {
            if (isIn) {
                return;
            }
            removed = true;
            this._lightSources.splice(index, 1);
        }
        this._markSubMeshesAsLightDirty(removed);
    }
    /** @internal */
    _unBindEffect() {
        for (const subMesh of this.subMeshes) {
            subMesh.setEffect(null);
        }
    }
    /**
     * @internal
     */
    _removeLightSource(light, dispose) {
        const index = this._lightSources.indexOf(light);
        if (index === -1) {
            return;
        }
        this._lightSources.splice(index, 1);
        this._markSubMeshesAsLightDirty(dispose);
    }
    _markSubMeshesAsDirty(func) {
        if (!this.subMeshes) {
            return;
        }
        for (const subMesh of this.subMeshes) {
            for (let i = 0; i < subMesh._drawWrappers.length; ++i) {
                const drawWrapper = subMesh._drawWrappers[i];
                if (!drawWrapper || !drawWrapper.defines || !drawWrapper.defines.markAllAsDirty) {
                    continue;
                }
                func(drawWrapper.defines);
            }
        }
    }
    /**
     * @internal
     */
    _markSubMeshesAsLightDirty(dispose = false) {
        this._markSubMeshesAsDirty((defines) => defines.markAsLightDirty(dispose));
    }
    /** @internal */
    _markSubMeshesAsAttributesDirty() {
        this._markSubMeshesAsDirty((defines) => defines.markAsAttributesDirty());
    }
    /** @internal */
    _markSubMeshesAsMiscDirty() {
        this._markSubMeshesAsDirty((defines) => defines.markAsMiscDirty());
    }
    /**
     * Flag the AbstractMesh as dirty (Forcing it to update everything)
     * @param property if set to "rotation" the objects rotationQuaternion will be set to null
     * @returns this AbstractMesh
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    markAsDirty(property) {
        this._currentRenderId = Number.MAX_VALUE;
        super.markAsDirty(property);
        this._isDirty = true;
        return this;
    }
    /**
     * Resets the draw wrappers cache for all submeshes of this abstract mesh
     * @param passId If provided, releases only the draw wrapper corresponding to this render pass id
     * @param immediate If true, the effect will be released immediately, otherwise it will be released at the next frame
     */
    resetDrawCache(passId, immediate = false) {
        if (!this.subMeshes) {
            return;
        }
        for (const subMesh of this.subMeshes) {
            subMesh.resetDrawCache(passId, immediate);
        }
    }
    // Methods
    /**
     * Returns true if the mesh is blocked. Implemented by child classes
     */
    get isBlocked() {
        return false;
    }
    /**
     * Returns the mesh itself by default. Implemented by child classes
     * @param camera defines the camera to use to pick the right LOD level
     * @returns the currentAbstractMesh
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    getLOD(camera) {
        return this;
    }
    /**
     * Returns 0 by default. Implemented by child classes
     * @returns an integer
     */
    getTotalVertices() {
        return 0;
    }
    /**
     * Returns a positive integer : the total number of indices in this mesh geometry.
     * @returns the number of indices or zero if the mesh has no geometry.
     */
    getTotalIndices() {
        return 0;
    }
    /**
     * Returns null by default. Implemented by child classes
     * @returns null
     */
    getIndices() {
        return null;
    }
    /**
     * Returns the array of the requested vertex data kind. Implemented by child classes
     * @param kind defines the vertex data kind to use
     * @returns null
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    getVerticesData(kind) {
        return null;
    }
    /**
     * Sets the vertex data of the mesh geometry for the requested `kind`.
     * If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data.
     * Note that a new underlying VertexBuffer object is created each call.
     * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
     * @param kind defines vertex data kind:
     * * VertexBuffer.PositionKind
     * * VertexBuffer.UVKind
     * * VertexBuffer.UV2Kind
     * * VertexBuffer.UV3Kind
     * * VertexBuffer.UV4Kind
     * * VertexBuffer.UV5Kind
     * * VertexBuffer.UV6Kind
     * * VertexBuffer.ColorKind
     * * VertexBuffer.MatricesIndicesKind
     * * VertexBuffer.MatricesIndicesExtraKind
     * * VertexBuffer.MatricesWeightsKind
     * * VertexBuffer.MatricesWeightsExtraKind
     * @param data defines the data source
     * @param updatable defines if the data must be flagged as updatable (or static)
     * @param stride defines the vertex stride (size of an entire vertex). Can be null and in this case will be deduced from vertex data kind
     * @returns the current mesh
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    setVerticesData(kind, data, updatable, stride) {
        return this;
    }
    /**
     * Updates the existing vertex data of the mesh geometry for the requested `kind`.
     * If the mesh has no geometry, it is simply returned as it is.
     * @param kind defines vertex data kind:
     * * VertexBuffer.PositionKind
     * * VertexBuffer.UVKind
     * * VertexBuffer.UV2Kind
     * * VertexBuffer.UV3Kind
     * * VertexBuffer.UV4Kind
     * * VertexBuffer.UV5Kind
     * * VertexBuffer.UV6Kind
     * * VertexBuffer.ColorKind
     * * VertexBuffer.MatricesIndicesKind
     * * VertexBuffer.MatricesIndicesExtraKind
     * * VertexBuffer.MatricesWeightsKind
     * * VertexBuffer.MatricesWeightsExtraKind
     * @param data defines the data source
     * @param updateExtends If `kind` is `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed
     * @param makeItUnique If true, a new global geometry is created from this data and is set to the mesh
     * @returns the current mesh
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    updateVerticesData(kind, data, updateExtends, makeItUnique) {
        return this;
    }
    /**
     * Sets the mesh indices,
     * If the mesh has no geometry, a new Geometry object is created and set to the mesh.
     * @param indices Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array)
     * @param totalVertices Defines the total number of vertices
     * @returns the current mesh
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    setIndices(indices, totalVertices) {
        return this;
    }
    /**
     * Gets a boolean indicating if specific vertex data is present
     * @param kind defines the vertex data kind to use
     * @returns true is data kind is present
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    isVerticesDataPresent(kind) {
        return false;
    }
    /**
     * Returns the mesh BoundingInfo object or creates a new one and returns if it was undefined.
     * Note that it returns a shallow bounding of the mesh (i.e. it does not include children).
     * However, if the mesh contains thin instances, it will be expanded to include them. If you want the "raw" bounding data instead, then use `getRawBoundingInfo()`.
     * To get the full bounding of all children, call `getHierarchyBoundingVectors` instead.
     * @returns a BoundingInfo
     */
    getBoundingInfo() {
        if (this._masterMesh) {
            return this._masterMesh.getBoundingInfo();
        }
        if (this._boundingInfoIsDirty) {
            this._boundingInfoIsDirty = false;
            // this._boundingInfo is being created if undefined
            this._updateBoundingInfo();
        }
        // cannot be null.
        return this._boundingInfo;
    }
    /**
     * Returns the bounding info unnafected by instance data.
     * @returns the bounding info of the mesh unaffected by instance data.
     */
    getRawBoundingInfo() {
        return this.rawBoundingInfo ?? this.getBoundingInfo();
    }
    /**
     * Overwrite the current bounding info
     * @param boundingInfo defines the new bounding info
     * @returns the current mesh
     */
    setBoundingInfo(boundingInfo) {
        this._boundingInfo = boundingInfo;
        return this;
    }
    /**
     * Returns true if there is already a bounding info
     */
    get hasBoundingInfo() {
        return this._boundingInfo !== null;
    }
    /**
     * Creates a new bounding info for the mesh
     * @param minimum min vector of the bounding box/sphere
     * @param maximum max vector of the bounding box/sphere
     * @param worldMatrix defines the new world matrix
     * @returns the new bounding info
     */
    buildBoundingInfo(minimum, maximum, worldMatrix) {
        this._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_7__/* .BoundingInfo */ .j(minimum, maximum, worldMatrix);
        return this._boundingInfo;
    }
    /**
     * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
     * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
     * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
     * @param predicate predicate that is passed in to getHierarchyBoundingVectors when selecting which object should be included when scaling
     * @returns the current mesh
     */
    normalizeToUnitCube(includeDescendants = true, ignoreRotation = false, predicate) {
        return super.normalizeToUnitCube(includeDescendants, ignoreRotation, predicate);
    }
    /** Gets a boolean indicating if this mesh has skinning data and an attached skeleton */
    get useBones() {
        return ((this.skeleton &&
            this.getScene().skeletonsEnabled &&
            this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind) &&
            this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsKind)));
    }
    /** @internal */
    _preActivate() { }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _preActivateForIntermediateRendering(renderId) { }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _activate(renderId, intermediateRendering) {
        this._renderId = renderId;
        return true;
    }
    /** @internal */
    _postActivate() {
        // Do nothing
    }
    /** @internal */
    _freeze() {
        // Do nothing
    }
    /** @internal */
    _unFreeze() {
        // Do nothing
    }
    /**
     * Gets the current world matrix
     * @returns a Matrix
     */
    getWorldMatrix() {
        if (this._masterMesh && this.billboardMode === _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V.BILLBOARDMODE_NONE) {
            return this._masterMesh.getWorldMatrix();
        }
        return super.getWorldMatrix();
    }
    /** @internal */
    _getWorldMatrixDeterminant() {
        if (this._masterMesh) {
            return this._masterMesh._getWorldMatrixDeterminant();
        }
        return super._getWorldMatrixDeterminant();
    }
    /**
     * Gets a boolean indicating if this mesh is an instance or a regular mesh
     */
    get isAnInstance() {
        return false;
    }
    /**
     * Gets a boolean indicating if this mesh has instances
     */
    get hasInstances() {
        return false;
    }
    /**
     * Gets a boolean indicating if this mesh has thin instances
     */
    get hasThinInstances() {
        return false;
    }
    // ================================== Point of View Movement =================================
    /**
     * Perform relative position change from the point of view of behind the front of the mesh.
     * This is performed taking into account the meshes current rotation, so you do not have to care.
     * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
     * @param amountRight defines the distance on the right axis
     * @param amountUp defines the distance on the up axis
     * @param amountForward defines the distance on the forward axis
     * @returns the current mesh
     */
    movePOV(amountRight, amountUp, amountForward) {
        this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));
        return this;
    }
    /**
     * Calculate relative position change from the point of view of behind the front of the mesh.
     * This is performed taking into account the meshes current rotation, so you do not have to care.
     * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
     * @param amountRight defines the distance on the right axis
     * @param amountUp defines the distance on the up axis
     * @param amountForward defines the distance on the forward axis
     * @returns the new displacement vector
     */
    calcMovePOV(amountRight, amountUp, amountForward) {
        const rotMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq();
        const rotQuaternion = this.rotationQuaternion ? this.rotationQuaternion : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion */ .PT.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);
        rotQuaternion.toRotationMatrix(rotMatrix);
        const translationDelta = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        const defForwardMult = this.definedFacingForward ? -1 : 1;
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);
        return translationDelta;
    }
    // ================================== Point of View Rotation =================================
    /**
     * Perform relative rotation change from the point of view of behind the front of the mesh.
     * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
     * @param flipBack defines the flip
     * @param twirlClockwise defines the twirl
     * @param tiltRight defines the tilt
     * @returns the current mesh
     */
    rotatePOV(flipBack, twirlClockwise, tiltRight) {
        this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));
        return this;
    }
    /**
     * Calculate relative rotation change from the point of view of behind the front of the mesh.
     * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
     * @param flipBack defines the flip
     * @param twirlClockwise defines the twirl
     * @param tiltRight defines the tilt
     * @returns the new rotation vector
     */
    calcRotatePOV(flipBack, twirlClockwise, tiltRight) {
        const defForwardMult = this.definedFacingForward ? 1 : -1;
        return new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);
    }
    /**
     * @internal
     */
    _refreshBoundingInfo(data, bias) {
        if (data) {
            const extend = (0,_Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_11__/* .extractMinAndMax */ .b8)(data, 0, this.getTotalVertices(), bias);
            if (this._boundingInfo) {
                this._boundingInfo.reConstruct(extend.minimum, extend.maximum);
            }
            else {
                this._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_7__/* .BoundingInfo */ .j(extend.minimum, extend.maximum);
            }
        }
        if (this.subMeshes) {
            for (let index = 0; index < this.subMeshes.length; index++) {
                this.subMeshes[index].refreshBoundingInfo(data);
            }
        }
        this._updateBoundingInfo();
    }
    /**
     * @internal
     */
    _refreshBoundingInfoDirect(extend) {
        if (this._boundingInfo) {
            this._boundingInfo.reConstruct(extend.minimum, extend.maximum);
        }
        else {
            this._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_7__/* .BoundingInfo */ .j(extend.minimum, extend.maximum);
        }
        if (this.subMeshes) {
            for (let index = 0; index < this.subMeshes.length; index++) {
                this.subMeshes[index].refreshBoundingInfo(null);
            }
        }
        this._updateBoundingInfo();
    }
    // This function is only here so we can apply the nativeOverride decorator.
    static _ApplySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData) {
        applySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData);
    }
    /** @internal */
    _getData(options, data, kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind) {
        const cache = options.cache;
        const getVertexData = (kind) => {
            if (cache) {
                const vertexData = (cache._vertexData || (cache._vertexData = {}));
                if (!vertexData[kind]) {
                    this.copyVerticesData(kind, vertexData);
                }
                return vertexData[kind];
            }
            return this.getVerticesData(kind);
        };
        data || (data = getVertexData(kind));
        if (!data) {
            return null;
        }
        if (cache) {
            if (cache._outputData) {
                cache._outputData.set(data);
            }
            else {
                cache._outputData = new Float32Array(data);
            }
            data = cache._outputData;
        }
        else if ((options.applyMorph && this.morphTargetManager) || (options.applySkeleton && this.skeleton)) {
            data = data.slice();
        }
        if (options.applyMorph && this.morphTargetManager) {
            applyMorph(data, kind, this.morphTargetManager);
        }
        if (options.applySkeleton && this.skeleton) {
            const matricesIndicesData = getVertexData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind);
            const matricesWeightsData = getVertexData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsKind);
            if (matricesWeightsData && matricesIndicesData) {
                const needExtras = this.numBoneInfluencers > 4;
                const matricesIndicesExtraData = needExtras ? getVertexData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesExtraKind) : null;
                const matricesWeightsExtraData = needExtras ? getVertexData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsExtraKind) : null;
                const skeletonMatrices = this.skeleton.getTransformMatrices(this);
                AbstractMesh._ApplySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData);
            }
        }
        if (options.updatePositionsArray !== false && kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind) {
            const positions = this._internalAbstractMeshDataInfo._positions || [];
            const previousLength = positions.length;
            positions.length = data.length / 3;
            if (previousLength < positions.length) {
                for (let positionIndex = previousLength; positionIndex < positions.length; positionIndex++) {
                    positions[positionIndex] = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq();
                }
            }
            for (let positionIndex = 0, dataIndex = 0; positionIndex < positions.length; positionIndex++, dataIndex += 3) {
                positions[positionIndex].copyFromFloats(data[dataIndex], data[dataIndex + 1], data[dataIndex + 2]);
            }
            this._internalAbstractMeshDataInfo._positions = positions;
        }
        return data;
    }
    /**
     * Get the normals vertex data and optionally apply skeleton and morphing.
     * @param applySkeleton defines whether to apply the skeleton
     * @param applyMorph  defines whether to apply the morph target
     * @returns the normals data
     */
    getNormalsData(applySkeleton = false, applyMorph = false) {
        return this._getData({ applySkeleton, applyMorph, updatePositionsArray: false }, null, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind);
    }
    /**
     * Get the position vertex data and optionally apply skeleton and morphing.
     * @param applySkeleton defines whether to apply the skeleton
     * @param applyMorph  defines whether to apply the morph target
     * @param data defines the position data to apply the skeleton and morph to
     * @returns the position data
     */
    getPositionData(applySkeleton = false, applyMorph = false, data = null) {
        return this._getData({ applySkeleton, applyMorph, updatePositionsArray: false }, data, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind);
    }
    /** @internal */
    _updateBoundingInfo() {
        if (this._boundingInfo) {
            this._boundingInfo.update(this.worldMatrixFromCache);
        }
        else {
            this._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_7__/* .BoundingInfo */ .j(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero(), this.worldMatrixFromCache);
        }
        this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);
        return this;
    }
    /**
     * @internal
     */
    _updateSubMeshesBoundingInfo(matrix) {
        if (!this.subMeshes) {
            return this;
        }
        const count = this.subMeshes.length;
        for (let subIndex = 0; subIndex < count; subIndex++) {
            const subMesh = this.subMeshes[subIndex];
            if (count > 1 || !subMesh.IsGlobal) {
                subMesh.updateBoundingInfo(matrix);
            }
        }
        return this;
    }
    /** @internal */
    _afterComputeWorldMatrix() {
        if (this.doNotSyncBoundingInfo) {
            return;
        }
        // Bounding info
        this._boundingInfoIsDirty = true;
    }
    /**
     * Returns `true` if the mesh is within the frustum defined by the passed array of planes.
     * A mesh is in the frustum if its bounding box intersects the frustum
     * @param frustumPlanes defines the frustum to test
     * @returns true if the mesh is in the frustum planes
     */
    isInFrustum(frustumPlanes) {
        return this.getBoundingInfo().isInFrustum(frustumPlanes, this.cullingStrategy);
    }
    /**
     * Returns `true` if the mesh is completely in the frustum defined be the passed array of planes.
     * A mesh is completely in the frustum if its bounding box it completely inside the frustum.
     * @param frustumPlanes defines the frustum to test
     * @returns true if the mesh is completely in the frustum planes
     */
    isCompletelyInFrustum(frustumPlanes) {
        return this.getBoundingInfo().isCompletelyInFrustum(frustumPlanes);
    }
    /**
     * True if the mesh intersects another mesh or a SolidParticle object
     * @param mesh defines a target mesh or SolidParticle to test
     * @param precise Unless the parameter `precise` is set to `true` the intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes)
     * @param includeDescendants Can be set to true to test if the mesh defined in parameters intersects with the current mesh or any child meshes
     * @returns true if there is an intersection
     */
    intersectsMesh(mesh, precise = false, includeDescendants) {
        const boundingInfo = this.getBoundingInfo();
        const otherBoundingInfo = mesh.getBoundingInfo();
        if (boundingInfo.intersects(otherBoundingInfo, precise)) {
            return true;
        }
        if (includeDescendants) {
            for (const child of this.getChildMeshes()) {
                if (child.intersectsMesh(mesh, precise, true)) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Returns true if the passed point (Vector3) is inside the mesh bounding box
     * @param point defines the point to test
     * @returns true if there is an intersection
     */
    intersectsPoint(point) {
        return this.getBoundingInfo().intersectsPoint(point);
    }
    // Collisions
    /**
     * Gets or sets a boolean indicating that this mesh can be used in the collision engine
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
     */
    get checkCollisions() {
        return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions;
    }
    set checkCollisions(collisionEnabled) {
        this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions = collisionEnabled;
    }
    /**
     * Gets Collider object used to compute collisions (not physics)
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
     */
    get collider() {
        return this._internalAbstractMeshDataInfo._meshCollisionData._collider;
    }
    /**
     * Move the mesh using collision engine
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
     * @param displacement defines the requested displacement vector
     * @returns the current mesh
     */
    moveWithCollisions(displacement) {
        const globalPosition = this.getAbsolutePosition();
        globalPosition.addToRef(this.ellipsoidOffset, this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);
        const coordinator = this.getScene().collisionCoordinator;
        if (!this._internalAbstractMeshDataInfo._meshCollisionData._collider) {
            this._internalAbstractMeshDataInfo._meshCollisionData._collider = coordinator.createCollider();
        }
        this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius = this.ellipsoid;
        coordinator.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, displacement, this._internalAbstractMeshDataInfo._meshCollisionData._collider, this.collisionRetryCount, this, this._onCollisionPositionChange, this.uniqueId);
        return this;
    }
    // Collisions
    /**
     * @internal
     */
    _collideForSubMesh(subMesh, transformMatrix, collider) {
        this._generatePointsArray();
        if (!this._positions) {
            return this;
        }
        // Transformation
        if (!subMesh._lastColliderWorldVertices || !subMesh._lastColliderTransformMatrix.equals(transformMatrix)) {
            subMesh._lastColliderTransformMatrix = transformMatrix.clone();
            subMesh._lastColliderWorldVertices = [];
            subMesh._trianglePlanes = [];
            const start = subMesh.verticesStart;
            const end = subMesh.verticesStart + subMesh.verticesCount;
            for (let i = start; i < end; i++) {
                subMesh._lastColliderWorldVertices.push(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinates(this._positions[i], transformMatrix));
            }
        }
        // Collide
        collider._collide(subMesh._trianglePlanes, subMesh._lastColliderWorldVertices, this.getIndices(), subMesh.indexStart, subMesh.indexStart + subMesh.indexCount, subMesh.verticesStart, !!subMesh.getMaterial(), this, this._shouldConvertRHS(), subMesh.getMaterial()?.fillMode === 7);
        return this;
    }
    /**
     * @internal
     */
    _processCollisionsForSubMeshes(collider, transformMatrix) {
        const subMeshes = this._scene.getCollidingSubMeshCandidates(this, collider);
        const len = subMeshes.length;
        for (let index = 0; index < len; index++) {
            const subMesh = subMeshes.data[index];
            // Bounding test
            if (len > 1 && !subMesh._checkCollision(collider)) {
                continue;
            }
            this._collideForSubMesh(subMesh, transformMatrix, collider);
        }
        return this;
    }
    /** @internal */
    _shouldConvertRHS() {
        return false;
    }
    /**
     * @internal
     */
    _checkCollision(collider) {
        // Bounding box test
        if (!this.getBoundingInfo()._checkCollision(collider)) {
            return this;
        }
        // Transformation matrix
        const collisionsScalingMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Matrix[0];
        const collisionsTransformMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Matrix[1];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.ScalingToRef(1.0 / collider._radius.x, 1.0 / collider._radius.y, 1.0 / collider._radius.z, collisionsScalingMatrix);
        this.worldMatrixFromCache.multiplyToRef(collisionsScalingMatrix, collisionsTransformMatrix);
        this._processCollisionsForSubMeshes(collider, collisionsTransformMatrix);
        return this;
    }
    // Picking
    /** @internal */
    _generatePointsArray() {
        return false;
    }
    /**
     * Checks if the passed Ray intersects with the mesh. A mesh triangle can be picked both from its front and back sides,
     * irrespective of orientation.
     * @param ray defines the ray to use. It should be in the mesh's LOCAL coordinate space.
     * @param fastCheck defines if fast mode (but less precise) must be used (false by default)
     * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
     * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
     * @param worldToUse defines the world matrix to use to get the world coordinate of the intersection point
     * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
     * @returns the picking info
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect
     */
    intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo = false, worldToUse, skipBoundingInfo = false) {
        const pickingInfo = new _Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_6__/* .PickingInfo */ .G();
        const className = this.getClassName();
        const intersectionThreshold = className === "InstancedLinesMesh" || className === "LinesMesh" || className === "GreasedLineMesh" ? this.intersectionThreshold : 0;
        const boundingInfo = this.getBoundingInfo();
        if (!this.subMeshes) {
            return pickingInfo;
        }
        if (!skipBoundingInfo &&
            (!ray.intersectsSphere(boundingInfo.boundingSphere, intersectionThreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionThreshold))) {
            return pickingInfo;
        }
        if (onlyBoundingInfo) {
            pickingInfo.hit = skipBoundingInfo ? false : true;
            pickingInfo.pickedMesh = skipBoundingInfo ? null : this;
            pickingInfo.distance = skipBoundingInfo ? 0 : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Distance(ray.origin, boundingInfo.boundingSphere.center);
            pickingInfo.subMeshId = 0;
            return pickingInfo;
        }
        if (!this._generatePointsArray()) {
            return pickingInfo;
        }
        let intersectInfo = null;
        const subMeshes = this._scene.getIntersectingSubMeshCandidates(this, ray);
        const len = subMeshes.length;
        // Check if all submeshes are using a material that don't allow picking (point/lines rendering)
        // if no submesh can be picked that way, then fallback to BBox picking
        let anySubmeshSupportIntersect = false;
        for (let index = 0; index < len; index++) {
            const subMesh = subMeshes.data[index];
            const material = subMesh.getMaterial();
            if (!material) {
                continue;
            }
            if (material.fillMode == 7 ||
                material.fillMode == 0 ||
                material.fillMode == 1 ||
                material.fillMode == 2 ||
                material.fillMode == 4) {
                anySubmeshSupportIntersect = true;
                break;
            }
        }
        // no sub mesh support intersection, fallback to BBox that has already be done
        if (!anySubmeshSupportIntersect) {
            pickingInfo.hit = true;
            pickingInfo.pickedMesh = this;
            pickingInfo.distance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Distance(ray.origin, boundingInfo.boundingSphere.center);
            pickingInfo.subMeshId = -1;
            return pickingInfo;
        }
        // at least 1 submesh supports intersection, keep going
        for (let index = 0; index < len; index++) {
            const subMesh = subMeshes.data[index];
            // Bounding test
            if (len > 1 && !skipBoundingInfo && !subMesh.canIntersects(ray)) {
                continue;
            }
            const currentIntersectInfo = subMesh.intersects(ray, this._positions, this.getIndices(), fastCheck, trianglePredicate);
            if (currentIntersectInfo) {
                if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) {
                    intersectInfo = currentIntersectInfo;
                    intersectInfo.subMeshId = index;
                    if (fastCheck) {
                        break;
                    }
                }
            }
        }
        if (intersectInfo) {
            // Get picked point
            const world = worldToUse ?? this.getWorldMatrix();
            const worldOrigin = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0];
            const direction = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[1];
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesToRef(ray.origin, world, worldOrigin);
            ray.direction.scaleToRef(intersectInfo.distance, direction);
            const worldDirection = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformNormal(direction, world);
            const pickedPoint = worldDirection.addInPlace(worldOrigin);
            // Return result
            pickingInfo.hit = true;
            pickingInfo.distance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Distance(worldOrigin, pickedPoint);
            pickingInfo.pickedPoint = pickedPoint;
            pickingInfo.pickedMesh = this;
            pickingInfo.bu = intersectInfo.bu || 0;
            pickingInfo.bv = intersectInfo.bv || 0;
            pickingInfo.subMeshFaceId = intersectInfo.faceId;
            pickingInfo.faceId = intersectInfo.faceId + subMeshes.data[intersectInfo.subMeshId].indexStart / (this.getClassName().indexOf("LinesMesh") !== -1 ? 2 : 3);
            pickingInfo.subMeshId = intersectInfo.subMeshId;
            return pickingInfo;
        }
        return pickingInfo;
    }
    /**
     * Clones the current mesh
     * @param name defines the mesh name
     * @param newParent defines the new mesh parent
     * @param doNotCloneChildren defines a boolean indicating that children must not be cloned (false by default)
     * @returns the new mesh
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    clone(name, newParent, doNotCloneChildren) {
        return null;
    }
    /**
     * Disposes all the submeshes of the current mesh
     * @param immediate should dispose the effects immediately or not
     * @returns the current mesh
     */
    releaseSubMeshes(immediate = false) {
        if (this.subMeshes) {
            while (this.subMeshes.length) {
                this.subMeshes[0].dispose(immediate);
            }
        }
        else {
            this.subMeshes = [];
        }
        return this;
    }
    /**
     * Releases resources associated with this abstract mesh.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        let index;
        const scene = this.getScene();
        // mesh map release.
        if (this._scene.useMaterialMeshMap) {
            // remove from material mesh map id needed
            if (this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap) {
                this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = undefined;
            }
        }
        // Smart Array Retainers.
        scene.freeActiveMeshes();
        scene.freeRenderingGroups();
        if (scene.renderingManager.maintainStateBetweenFrames) {
            scene.renderingManager.restoreDispachedFlags();
        }
        // Action manager
        if (this.actionManager !== undefined && this.actionManager !== null) {
            // If we are the only mesh using the action manager, dispose of the action manager too unless it has opted out from that behavior
            if (this.actionManager.disposeWhenUnowned && !this._scene.meshes.some((m) => m !== this && m.actionManager === this.actionManager)) {
                this.actionManager.dispose();
            }
            this.actionManager = null;
        }
        // Skeleton
        this._internalAbstractMeshDataInfo._skeleton = null;
        if (this._transformMatrixTexture) {
            this._transformMatrixTexture.dispose();
            this._transformMatrixTexture = null;
        }
        // Intersections in progress
        for (index = 0; index < this._intersectionsInProgress.length; index++) {
            const other = this._intersectionsInProgress[index];
            const pos = other._intersectionsInProgress.indexOf(this);
            other._intersectionsInProgress.splice(pos, 1);
        }
        this._intersectionsInProgress.length = 0;
        // Lights
        const lights = scene.lights;
        lights.forEach((light) => {
            let meshIndex = light.includedOnlyMeshes.indexOf(this);
            if (meshIndex !== -1) {
                light.includedOnlyMeshes.splice(meshIndex, 1);
            }
            meshIndex = light.excludedMeshes.indexOf(this);
            if (meshIndex !== -1) {
                light.excludedMeshes.splice(meshIndex, 1);
            }
            // Shadow generators
            const generators = light.getShadowGenerators();
            if (generators) {
                const iterator = generators.values();
                for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
                    const generator = key.value;
                    const shadowMap = generator.getShadowMap();
                    if (shadowMap && shadowMap.renderList) {
                        meshIndex = shadowMap.renderList.indexOf(this);
                        if (meshIndex !== -1) {
                            shadowMap.renderList.splice(meshIndex, 1);
                        }
                    }
                }
            }
        });
        // SubMeshes
        if (this.getClassName() !== "InstancedMesh" || this.getClassName() !== "InstancedLinesMesh") {
            this.releaseSubMeshes(true);
        }
        // Query
        const engine = scene.getEngine();
        if (this._occlusionQuery !== null) {
            this.isOcclusionQueryInProgress = false;
            engine.deleteQuery(this._occlusionQuery);
            this._occlusionQuery = null;
        }
        // Engine
        engine.wipeCaches();
        // Remove from scene
        scene.removeMesh(this);
        if (this._parentContainer) {
            const index = this._parentContainer.meshes.indexOf(this);
            if (index > -1) {
                this._parentContainer.meshes.splice(index, 1);
            }
            this._parentContainer = null;
        }
        if (disposeMaterialAndTextures) {
            if (this.material) {
                if (this.material.getClassName() === "MultiMaterial") {
                    this.material.dispose(false, true, true);
                }
                else {
                    this.material.dispose(false, true);
                }
            }
        }
        if (!doNotRecurse) {
            // Particles
            for (index = 0; index < scene.particleSystems.length; index++) {
                if (scene.particleSystems[index].emitter === this) {
                    scene.particleSystems[index].dispose();
                    index--;
                }
            }
        }
        // facet data
        if (this._internalAbstractMeshDataInfo._facetData.facetDataEnabled) {
            this.disableFacetData();
        }
        this._uniformBuffer.dispose();
        this.onAfterWorldMatrixUpdateObservable.clear();
        this.onCollideObservable.clear();
        this.onCollisionPositionChangeObservable.clear();
        this.onRebuildObservable.clear();
        super.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
    // Facet data
    /** @internal */
    _initFacetData() {
        const data = this._internalAbstractMeshDataInfo._facetData;
        if (!data.facetNormals) {
            data.facetNormals = [];
        }
        if (!data.facetPositions) {
            data.facetPositions = [];
        }
        if (!data.facetPartitioning) {
            data.facetPartitioning = new Array();
        }
        data.facetNb = (this.getIndices().length / 3) | 0;
        data.partitioningSubdivisions = data.partitioningSubdivisions ? data.partitioningSubdivisions : 10; // default nb of partitioning subdivisions = 10
        data.partitioningBBoxRatio = data.partitioningBBoxRatio ? data.partitioningBBoxRatio : 1.01; // default ratio 1.01 = the partitioning is 1% bigger than the bounding box
        for (let f = 0; f < data.facetNb; f++) {
            data.facetNormals[f] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
            data.facetPositions[f] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        }
        data.facetDataEnabled = true;
        return this;
    }
    /**
     * Updates the mesh facetData arrays and the internal partitioning when the mesh is morphed or updated.
     * This method can be called within the render loop.
     * You don't need to call this method by yourself in the render loop when you update/morph a mesh with the methods CreateXXX() as they automatically manage this computation
     * @returns the current mesh
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    updateFacetData() {
        const data = this._internalAbstractMeshDataInfo._facetData;
        if (!data.facetDataEnabled) {
            this._initFacetData();
        }
        const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind);
        const indices = this.getIndices();
        const normals = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind);
        const bInfo = this.getBoundingInfo();
        if (data.facetDepthSort && !data.facetDepthSortEnabled) {
            // init arrays, matrix and sort function on first call
            data.facetDepthSortEnabled = true;
            if (indices instanceof Uint16Array) {
                data.depthSortedIndices = new Uint16Array(indices);
            }
            else if (indices instanceof Uint32Array) {
                data.depthSortedIndices = new Uint32Array(indices);
            }
            else {
                let needs32bits = false;
                for (let i = 0; i < indices.length; i++) {
                    if (indices[i] > 65535) {
                        needs32bits = true;
                        break;
                    }
                }
                if (needs32bits) {
                    data.depthSortedIndices = new Uint32Array(indices);
                }
                else {
                    data.depthSortedIndices = new Uint16Array(indices);
                }
            }
            data.facetDepthSortFunction = function (f1, f2) {
                return f2.sqDistance - f1.sqDistance;
            };
            if (!data.facetDepthSortFrom) {
                const camera = this.getScene().activeCamera;
                data.facetDepthSortFrom = camera ? camera.position : _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
            }
            data.depthSortedFacets = [];
            for (let f = 0; f < data.facetNb; f++) {
                const depthSortedFacet = { ind: f * 3, sqDistance: 0.0 };
                data.depthSortedFacets.push(depthSortedFacet);
            }
            data.invertedMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.Identity();
            data.facetDepthSortOrigin = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        }
        data.bbSize.x = bInfo.maximum.x - bInfo.minimum.x > _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_13__/* .Epsilon */ .bH ? bInfo.maximum.x - bInfo.minimum.x : _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_13__/* .Epsilon */ .bH;
        data.bbSize.y = bInfo.maximum.y - bInfo.minimum.y > _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_13__/* .Epsilon */ .bH ? bInfo.maximum.y - bInfo.minimum.y : _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_13__/* .Epsilon */ .bH;
        data.bbSize.z = bInfo.maximum.z - bInfo.minimum.z > _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_13__/* .Epsilon */ .bH ? bInfo.maximum.z - bInfo.minimum.z : _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_13__/* .Epsilon */ .bH;
        let bbSizeMax = data.bbSize.x > data.bbSize.y ? data.bbSize.x : data.bbSize.y;
        bbSizeMax = bbSizeMax > data.bbSize.z ? bbSizeMax : data.bbSize.z;
        data.subDiv.max = data.partitioningSubdivisions;
        data.subDiv.X = Math.floor((data.subDiv.max * data.bbSize.x) / bbSizeMax); // adjust the number of subdivisions per axis
        data.subDiv.Y = Math.floor((data.subDiv.max * data.bbSize.y) / bbSizeMax); // according to each bbox size per axis
        data.subDiv.Z = Math.floor((data.subDiv.max * data.bbSize.z) / bbSizeMax);
        data.subDiv.X = data.subDiv.X < 1 ? 1 : data.subDiv.X; // at least one subdivision
        data.subDiv.Y = data.subDiv.Y < 1 ? 1 : data.subDiv.Y;
        data.subDiv.Z = data.subDiv.Z < 1 ? 1 : data.subDiv.Z;
        // set the parameters for ComputeNormals()
        data.facetParameters.facetNormals = this.getFacetLocalNormals();
        data.facetParameters.facetPositions = this.getFacetLocalPositions();
        data.facetParameters.facetPartitioning = this.getFacetLocalPartitioning();
        data.facetParameters.bInfo = bInfo;
        data.facetParameters.bbSize = data.bbSize;
        data.facetParameters.subDiv = data.subDiv;
        data.facetParameters.ratio = this.partitioningBBoxRatio;
        data.facetParameters.depthSort = data.facetDepthSort;
        if (data.facetDepthSort && data.facetDepthSortEnabled) {
            this.computeWorldMatrix(true);
            this._worldMatrix.invertToRef(data.invertedMatrix);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesToRef(data.facetDepthSortFrom, data.invertedMatrix, data.facetDepthSortOrigin);
            data.facetParameters.distanceTo = data.facetDepthSortOrigin;
        }
        data.facetParameters.depthSortedFacets = data.depthSortedFacets;
        if (normals) {
            _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexData */ .P.ComputeNormals(positions, indices, normals, data.facetParameters);
        }
        if (data.facetDepthSort && data.facetDepthSortEnabled) {
            data.depthSortedFacets.sort(data.facetDepthSortFunction);
            const l = (data.depthSortedIndices.length / 3) | 0;
            for (let f = 0; f < l; f++) {
                const sind = data.depthSortedFacets[f].ind;
                data.depthSortedIndices[f * 3] = indices[sind];
                data.depthSortedIndices[f * 3 + 1] = indices[sind + 1];
                data.depthSortedIndices[f * 3 + 2] = indices[sind + 2];
            }
            this.updateIndices(data.depthSortedIndices, undefined, true);
        }
        return this;
    }
    /**
     * Returns the facetLocalNormals array.
     * The normals are expressed in the mesh local spac
     * @returns an array of Vector3
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getFacetLocalNormals() {
        const facetData = this._internalAbstractMeshDataInfo._facetData;
        if (!facetData.facetNormals) {
            this.updateFacetData();
        }
        return facetData.facetNormals;
    }
    /**
     * Returns the facetLocalPositions array.
     * The facet positions are expressed in the mesh local space
     * @returns an array of Vector3
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getFacetLocalPositions() {
        const facetData = this._internalAbstractMeshDataInfo._facetData;
        if (!facetData.facetPositions) {
            this.updateFacetData();
        }
        return facetData.facetPositions;
    }
    /**
     * Returns the facetLocalPartitioning array
     * @returns an array of array of numbers
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getFacetLocalPartitioning() {
        const facetData = this._internalAbstractMeshDataInfo._facetData;
        if (!facetData.facetPartitioning) {
            this.updateFacetData();
        }
        return facetData.facetPartitioning;
    }
    /**
     * Returns the i-th facet position in the world system.
     * This method allocates a new Vector3 per call
     * @param i defines the facet index
     * @returns a new Vector3
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getFacetPosition(i) {
        const pos = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        this.getFacetPositionToRef(i, pos);
        return pos;
    }
    /**
     * Sets the reference Vector3 with the i-th facet position in the world system
     * @param i defines the facet index
     * @param ref defines the target vector
     * @returns the current mesh
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getFacetPositionToRef(i, ref) {
        const localPos = this.getFacetLocalPositions()[i];
        const world = this.getWorldMatrix();
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesToRef(localPos, world, ref);
        return this;
    }
    /**
     * Returns the i-th facet normal in the world system.
     * This method allocates a new Vector3 per call
     * @param i defines the facet index
     * @returns a new Vector3
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getFacetNormal(i) {
        const norm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.Zero();
        this.getFacetNormalToRef(i, norm);
        return norm;
    }
    /**
     * Sets the reference Vector3 with the i-th facet normal in the world system
     * @param i defines the facet index
     * @param ref defines the target vector
     * @returns the current mesh
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getFacetNormalToRef(i, ref) {
        const localNorm = this.getFacetLocalNormals()[i];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformNormalToRef(localNorm, this.getWorldMatrix(), ref);
        return this;
    }
    /**
     * Returns the facets (in an array) in the same partitioning block than the one the passed coordinates are located (expressed in the mesh local system)
     * @param x defines x coordinate
     * @param y defines y coordinate
     * @param z defines z coordinate
     * @returns the array of facet indexes
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getFacetsAtLocalCoordinates(x, y, z) {
        const bInfo = this.getBoundingInfo();
        const data = this._internalAbstractMeshDataInfo._facetData;
        const ox = Math.floor(((x - bInfo.minimum.x * data.partitioningBBoxRatio) * data.subDiv.X * data.partitioningBBoxRatio) / data.bbSize.x);
        const oy = Math.floor(((y - bInfo.minimum.y * data.partitioningBBoxRatio) * data.subDiv.Y * data.partitioningBBoxRatio) / data.bbSize.y);
        const oz = Math.floor(((z - bInfo.minimum.z * data.partitioningBBoxRatio) * data.subDiv.Z * data.partitioningBBoxRatio) / data.bbSize.z);
        if (ox < 0 || ox > data.subDiv.max || oy < 0 || oy > data.subDiv.max || oz < 0 || oz > data.subDiv.max) {
            return null;
        }
        return data.facetPartitioning[ox + data.subDiv.max * oy + data.subDiv.max * data.subDiv.max * oz];
    }
    /**
     * Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found
     * @param x defines x coordinate
     * @param y defines y coordinate
     * @param z defines z coordinate
     * @param projected sets as the (x,y,z) world projection on the facet
     * @param checkFace if true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned
     * @param facing if facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position
     * @returns the face index if found (or null instead)
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getClosestFacetAtCoordinates(x, y, z, projected, checkFace = false, facing = true) {
        const world = this.getWorldMatrix();
        const invMat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Matrix[5];
        world.invertToRef(invMat);
        const invVect = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[8];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(x, y, z, invMat, invVect); // transform (x,y,z) to coordinates in the mesh local space
        const closest = this.getClosestFacetAtLocalCoordinates(invVect.x, invVect.y, invVect.z, projected, checkFace, facing);
        if (projected) {
            // transform the local computed projected vector to world coordinates
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(projected.x, projected.y, projected.z, world, projected);
        }
        return closest;
    }
    /**
     * Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found
     * @param x defines x coordinate
     * @param y defines y coordinate
     * @param z defines z coordinate
     * @param projected sets as the (x,y,z) local projection on the facet
     * @param checkFace if true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned
     * @param facing if facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position
     * @returns the face index if found (or null instead)
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getClosestFacetAtLocalCoordinates(x, y, z, projected, checkFace = false, facing = true) {
        let closest = null;
        let tmpx = 0.0;
        let tmpy = 0.0;
        let tmpz = 0.0;
        let d = 0.0; // tmp dot facet normal * facet position
        let t0 = 0.0;
        let projx = 0.0;
        let projy = 0.0;
        let projz = 0.0;
        // Get all the facets in the same partitioning block than (x, y, z)
        const facetPositions = this.getFacetLocalPositions();
        const facetNormals = this.getFacetLocalNormals();
        const facetsInBlock = this.getFacetsAtLocalCoordinates(x, y, z);
        if (!facetsInBlock) {
            return null;
        }
        // Get the closest facet to (x, y, z)
        let shortest = Number.MAX_VALUE; // init distance vars
        let tmpDistance = shortest;
        let fib; // current facet in the block
        let norm; // current facet normal
        let p0; // current facet barycenter position
        // loop on all the facets in the current partitioning block
        for (let idx = 0; idx < facetsInBlock.length; idx++) {
            fib = facetsInBlock[idx];
            norm = facetNormals[fib];
            p0 = facetPositions[fib];
            d = (x - p0.x) * norm.x + (y - p0.y) * norm.y + (z - p0.z) * norm.z;
            if (!checkFace || (checkFace && facing && d >= 0.0) || (checkFace && !facing && d <= 0.0)) {
                // compute (x,y,z) projection on the facet = (projx, projy, projz)
                d = norm.x * p0.x + norm.y * p0.y + norm.z * p0.z;
                t0 = -(norm.x * x + norm.y * y + norm.z * z - d) / (norm.x * norm.x + norm.y * norm.y + norm.z * norm.z);
                projx = x + norm.x * t0;
                projy = y + norm.y * t0;
                projz = z + norm.z * t0;
                tmpx = projx - x;
                tmpy = projy - y;
                tmpz = projz - z;
                tmpDistance = tmpx * tmpx + tmpy * tmpy + tmpz * tmpz; // compute length between (x, y, z) and its projection on the facet
                if (tmpDistance < shortest) {
                    // just keep the closest facet to (x, y, z)
                    shortest = tmpDistance;
                    closest = fib;
                    if (projected) {
                        projected.x = projx;
                        projected.y = projy;
                        projected.z = projz;
                    }
                }
            }
        }
        return closest;
    }
    /**
     * Returns the object "parameter" set with all the expected parameters for facetData computation by ComputeNormals()
     * @returns the parameters
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    getFacetDataParameters() {
        return this._internalAbstractMeshDataInfo._facetData.facetParameters;
    }
    /**
     * Disables the feature FacetData and frees the related memory
     * @returns the current mesh
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
     */
    disableFacetData() {
        const facetData = this._internalAbstractMeshDataInfo._facetData;
        if (facetData.facetDataEnabled) {
            facetData.facetDataEnabled = false;
            facetData.facetPositions = [];
            facetData.facetNormals = [];
            facetData.facetPartitioning = new Array();
            facetData.facetParameters = {};
            facetData.depthSortedIndices = new Uint32Array(0);
        }
        return this;
    }
    /**
     * Updates the AbstractMesh indices array
     * @param indices defines the data source
     * @param offset defines the offset in the index buffer where to store the new data (can be null)
     * @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
     * @returns the current mesh
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    updateIndices(indices, offset, gpuMemoryOnly = false) {
        return this;
    }
    /**
     * Creates new normals data for the mesh
     * @param updatable defines if the normal vertex buffer must be flagged as updatable
     * @returns the current mesh
     */
    createNormals(updatable) {
        const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind);
        const indices = this.getIndices();
        let normals;
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind)) {
            normals = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind);
        }
        else {
            normals = [];
        }
        _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexData */ .P.ComputeNormals(positions, indices, normals, { useRightHandedSystem: this.getScene().useRightHandedSystem });
        this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind, normals, updatable);
        return this;
    }
    /**
     * Align the mesh with a normal
     * @param normal defines the normal to use
     * @param upDirection can be used to redefined the up vector to use (will use the (0, 1, 0) by default)
     * @returns the current mesh
     */
    alignWithNormal(normal, upDirection) {
        if (!upDirection) {
            upDirection = _Maths_math_axis_js__WEBPACK_IMPORTED_MODULE_14__/* .Axis */ ._0.Y;
        }
        const axisX = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0];
        const axisZ = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[1];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.CrossToRef(upDirection, normal, axisZ);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.CrossToRef(normal, axisZ, axisX);
        if (this.rotationQuaternion) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Quaternion */ .PT.RotationQuaternionFromAxisToRef(axisX, normal, axisZ, this.rotationQuaternion);
        }
        else {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.RotationFromAxisToRef(axisX, normal, axisZ, this.rotation);
        }
        return this;
    }
    /** @internal */
    _checkOcclusionQuery() {
        // Will be replaced by correct code if Occlusion queries are referenced
        return false;
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Disables the mesh edge rendering mode
     * @returns the currentAbstractMesh
     */
    disableEdgesRendering() {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_10__/* ._WarnImport */ .n)("EdgesRenderer");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Enables the edge rendering mode on the mesh.
     * This mode makes the mesh edges visible
     * @param epsilon defines the maximal distance between two angles to detect a face
     * @param checkVerticesInsteadOfIndices indicates that we should check vertex list directly instead of faces
     * @param options options to the edge renderer
     * @returns the currentAbstractMesh
     * @see https://www.babylonjs-playground.com/#19O9TU#0
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    enableEdgesRendering(epsilon, checkVerticesInsteadOfIndices, options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_10__/* ._WarnImport */ .n)("EdgesRenderer");
    }
    /**
     * This function returns all of the particle systems in the scene that use the mesh as an emitter.
     * @returns an array of particle systems in the scene that use the mesh as an emitter
     */
    getConnectedParticleSystems() {
        return this._scene.particleSystems.filter((particleSystem) => particleSystem.emitter === this);
    }
}
/** No occlusion */
AbstractMesh.OCCLUSION_TYPE_NONE = 0;
/** Occlusion set to optimistic */
AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC = 1;
/** Occlusion set to strict */
AbstractMesh.OCCLUSION_TYPE_STRICT = 2;
/** Use an accurate occlusion algorithm */
AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0;
/** Use a conservative occlusion algorithm */
AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1;
/** Default culling strategy : this is an exclusion test and it's the more accurate.
 *  Test order :
 *  Is the bounding sphere outside the frustum ?
 *  If not, are the bounding box vertices outside the frustum ?
 *  It not, then the cullable object is in the frustum.
 */
AbstractMesh.CULLINGSTRATEGY_STANDARD = 0;
/** Culling strategy : Bounding Sphere Only.
 *  This is an exclusion test. It's faster than the standard strategy because the bounding box is not tested.
 *  It's also less accurate than the standard because some not visible objects can still be selected.
 *  Test : is the bounding sphere outside the frustum ?
 *  If not, then the cullable object is in the frustum.
 */
AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1;
/** Culling strategy : Optimistic Inclusion.
 *  This in an inclusion test first, then the standard exclusion test.
 *  This can be faster when a cullable object is expected to be almost always in the camera frustum.
 *  This could also be a little slower than the standard test when the tested object center is not the frustum but one of its bounding box vertex is still inside.
 *  Anyway, it's as accurate as the standard strategy.
 *  Test :
 *  Is the cullable object bounding sphere center in the frustum ?
 *  If not, apply the default culling strategy.
 */
AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2;
/** Culling strategy : Optimistic Inclusion then Bounding Sphere Only.
 *  This in an inclusion test first, then the bounding sphere only exclusion test.
 *  This can be the fastest test when a cullable object is expected to be almost always in the camera frustum.
 *  This could also be a little slower than the BoundingSphereOnly strategy when the tested object center is not in the frustum but its bounding sphere still intersects it.
 *  It's less accurate than the standard strategy and as accurate as the BoundingSphereOnly strategy.
 *  Test :
 *  Is the cullable object bounding sphere center in the frustum ?
 *  If not, apply the Bounding Sphere Only strategy. No Bounding Box is tested here.
 */
AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_16__/* .nativeOverride */ .Cx.filter((...[data, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData]) => !Array.isArray(data) &&
        !Array.isArray(matricesIndicesData) &&
        !Array.isArray(matricesWeightsData) &&
        !Array.isArray(matricesIndicesExtraData) &&
        !Array.isArray(matricesWeightsExtraData))
], AbstractMesh, "_ApplySkeleton", null);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_15__/* .RegisterClass */ .Y5)("BABYLON.AbstractMesh", AbstractMesh);
//# sourceMappingURL=abstractMesh.js.map

/***/ }),

/***/ 56608:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   R: () => (/* reexport safe */ _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__.R)
/* harmony export */ });
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95616);
/**
 * This is here for backwards compatibility with 4.2
 * @internal
 */

//# sourceMappingURL=buffer.js.map

/***/ }),

/***/ 27050:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   V: () => (/* binding */ Geometry)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26041);
/* harmony import */ var _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36803);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95616);
/* harmony import */ var _Meshes_subMesh_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65907);
/* harmony import */ var _Loading_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7597);
/* harmony import */ var _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(20863);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(998);
/* harmony import */ var _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27152);
/* harmony import */ var _Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(71139);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6315);
/* harmony import */ var _Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(91313);
/* harmony import */ var _Buffers_bufferUtils_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(11675);














/**
 * Class used to store geometry data (vertex buffers + index buffer)
 */
class Geometry {
    /**
     *  Gets or sets the Bias Vector to apply on the bounding elements (box/sphere), the max extend is computed as v += v * bias.x + bias.y, the min is computed as v -= v * bias.x + bias.y
     */
    get boundingBias() {
        return this._boundingBias;
    }
    /**
     *  Gets or sets the Bias Vector to apply on the bounding elements (box/sphere), the max extend is computed as v += v * bias.x + bias.y, the min is computed as v -= v * bias.x + bias.y
     */
    set boundingBias(value) {
        if (this._boundingBias) {
            this._boundingBias.copyFrom(value);
        }
        else {
            this._boundingBias = value.clone();
        }
        this._updateBoundingInfo(true, null);
    }
    /**
     * Static function used to attach a new empty geometry to a mesh
     * @param mesh defines the mesh to attach the geometry to
     * @returns the new Geometry
     */
    static CreateGeometryForMesh(mesh) {
        const geometry = new Geometry(Geometry.RandomId(), mesh.getScene());
        geometry.applyToMesh(mesh);
        return geometry;
    }
    /** Get the list of meshes using this geometry */
    get meshes() {
        return this._meshes;
    }
    /**
     * Creates a new geometry
     * @param id defines the unique ID
     * @param scene defines the hosting scene
     * @param vertexData defines the VertexData used to get geometry data
     * @param updatable defines if geometry must be updatable (false by default)
     * @param mesh defines the mesh that will be associated with the geometry
     */
    constructor(id, scene, vertexData, updatable = false, mesh = null) {
        /**
         * Gets the delay loading state of the geometry (none by default which means not delayed)
         */
        this.delayLoadState = 0;
        this._totalVertices = 0;
        this._isDisposed = false;
        this._indexBufferIsUpdatable = false;
        this._positionsCache = [];
        /** @internal */
        this._parentContainer = null;
        /**
         * If set to true (false by default), the bounding info applied to the meshes sharing this geometry will be the bounding info defined at the class level
         * and won't be computed based on the vertex positions (which is what we get when useBoundingInfoFromGeometry = false)
         */
        this.useBoundingInfoFromGeometry = false;
        this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_10__/* .EngineStore */ .q.LastCreatedScene;
        if (!this._scene) {
            return;
        }
        this.id = id;
        this.uniqueId = this._scene.getUniqueId();
        this._engine = this._scene.getEngine();
        this._meshes = [];
        //Init vertex buffer cache
        this._vertexBuffers = {};
        this._indices = [];
        this._updatable = updatable;
        // vertexData
        if (vertexData) {
            this.setAllVerticesData(vertexData, updatable);
        }
        else {
            this._totalVertices = 0;
        }
        if (this._engine.getCaps().vertexArrayObject) {
            this._vertexArrayObjects = {};
        }
        // applyToMesh
        if (mesh) {
            this.applyToMesh(mesh);
            mesh.computeWorldMatrix(true);
        }
    }
    /**
     * Gets the current extend of the geometry
     */
    get extend() {
        return this._extend;
    }
    /**
     * Gets the hosting scene
     * @returns the hosting Scene
     */
    getScene() {
        return this._scene;
    }
    /**
     * Gets the hosting engine
     * @returns the hosting Engine
     */
    getEngine() {
        return this._engine;
    }
    /**
     * Defines if the geometry is ready to use
     * @returns true if the geometry is ready to be used
     */
    isReady() {
        return this.delayLoadState === 1 || this.delayLoadState === 0;
    }
    /**
     * Gets a value indicating that the geometry should not be serialized
     */
    get doNotSerialize() {
        for (let index = 0; index < this._meshes.length; index++) {
            if (!this._meshes[index].doNotSerialize) {
                return false;
            }
        }
        return true;
    }
    /** @internal */
    _rebuild() {
        if (this._vertexArrayObjects) {
            this._vertexArrayObjects = {};
        }
        // Index buffer
        if (this._meshes.length !== 0 && this._indices) {
            this._indexBuffer = this._engine.createIndexBuffer(this._indices, this._updatable, "Geometry_" + this.id + "_IndexBuffer");
        }
        // Vertex buffers
        const buffers = new Set();
        for (const key in this._vertexBuffers) {
            buffers.add(this._vertexBuffers[key].getWrapperBuffer());
        }
        buffers.forEach((buffer) => {
            buffer._rebuild();
        });
    }
    /**
     * Affects all geometry data in one call
     * @param vertexData defines the geometry data
     * @param updatable defines if the geometry must be flagged as updatable (false as default)
     */
    setAllVerticesData(vertexData, updatable) {
        vertexData.applyToGeometry(this, updatable);
        this._notifyUpdate();
    }
    /**
     * Set specific vertex data
     * @param kind defines the data kind (Position, normal, etc...)
     * @param data defines the vertex data to use
     * @param updatable defines if the vertex must be flagged as updatable (false as default)
     * @param stride defines the stride to use (0 by default). This value is deduced from the kind value if not specified
     */
    setVerticesData(kind, data, updatable = false, stride) {
        if (updatable && Array.isArray(data)) {
            // to avoid converting to Float32Array at each draw call in engine.updateDynamicVertexBuffer, we make the conversion a single time here
            data = new Float32Array(data);
        }
        const buffer = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R(this._engine, data, kind, {
            updatable,
            postponeInternalCreation: this._meshes.length === 0,
            stride,
            label: "Geometry_" + this.id + "_" + kind,
        });
        this.setVerticesBuffer(buffer);
    }
    /**
     * Removes a specific vertex data
     * @param kind defines the data kind (Position, normal, etc...)
     */
    removeVerticesData(kind) {
        if (this._vertexBuffers[kind]) {
            this._vertexBuffers[kind].dispose();
            delete this._vertexBuffers[kind];
        }
        if (this._vertexArrayObjects) {
            this._disposeVertexArrayObjects();
        }
    }
    /**
     * Affect a vertex buffer to the geometry. the vertexBuffer.getKind() function is used to determine where to store the data
     * @param buffer defines the vertex buffer to use
     * @param totalVertices defines the total number of vertices for position kind (could be null)
     * @param disposeExistingBuffer disposes the existing buffer, if any (default: true)
     */
    setVerticesBuffer(buffer, totalVertices = null, disposeExistingBuffer = true) {
        const kind = buffer.getKind();
        if (this._vertexBuffers[kind] && disposeExistingBuffer) {
            this._vertexBuffers[kind].dispose();
        }
        if (buffer._buffer) {
            buffer._buffer._increaseReferences();
        }
        this._vertexBuffers[kind] = buffer;
        const meshes = this._meshes;
        const numOfMeshes = meshes.length;
        if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind) {
            this._totalVertices = totalVertices ?? buffer._maxVerticesCount;
            this._updateExtend(buffer.getFloatData(this._totalVertices));
            this._resetPointsArrayCache();
            // this._extend can be empty if buffer.getFloatData(this._totalVertices) returned null
            const minimum = (this._extend && this._extend.minimum) || new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
            const maximum = (this._extend && this._extend.maximum) || new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
            for (let index = 0; index < numOfMeshes; index++) {
                const mesh = meshes[index];
                mesh.buildBoundingInfo(minimum, maximum);
                mesh._createGlobalSubMesh(mesh.isUnIndexed);
                mesh.computeWorldMatrix(true);
                mesh.synchronizeInstances();
            }
        }
        this._notifyUpdate(kind);
    }
    /**
     * Update a specific vertex buffer
     * This function will directly update the underlying DataBuffer according to the passed numeric array or Float32Array
     * It will do nothing if the buffer is not updatable
     * @param kind defines the data kind (Position, normal, etc...)
     * @param data defines the data to use
     * @param offset defines the offset in the target buffer where to store the data
     * @param useBytes set to true if the offset is in bytes
     */
    updateVerticesDataDirectly(kind, data, offset, useBytes = false) {
        const vertexBuffer = this.getVertexBuffer(kind);
        if (!vertexBuffer) {
            return;
        }
        vertexBuffer.updateDirectly(data, offset, useBytes);
        this._notifyUpdate(kind);
    }
    /**
     * Update a specific vertex buffer
     * This function will create a new buffer if the current one is not updatable
     * @param kind defines the data kind (Position, normal, etc...)
     * @param data defines the data to use
     * @param updateExtends defines if the geometry extends must be recomputed (false by default)
     */
    updateVerticesData(kind, data, updateExtends = false) {
        const vertexBuffer = this.getVertexBuffer(kind);
        if (!vertexBuffer) {
            return;
        }
        vertexBuffer.update(data);
        if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind) {
            this._updateBoundingInfo(updateExtends, data);
        }
        this._notifyUpdate(kind);
    }
    _updateBoundingInfo(updateExtends, data) {
        if (updateExtends) {
            this._updateExtend(data);
        }
        this._resetPointsArrayCache();
        if (updateExtends) {
            const meshes = this._meshes;
            for (const mesh of meshes) {
                if (mesh.hasBoundingInfo) {
                    mesh.getBoundingInfo().reConstruct(this._extend.minimum, this._extend.maximum);
                }
                else {
                    mesh.buildBoundingInfo(this._extend.minimum, this._extend.maximum);
                }
                const subMeshes = mesh.subMeshes;
                for (const subMesh of subMeshes) {
                    subMesh.refreshBoundingInfo();
                }
            }
        }
    }
    /**
     * @internal
     */
    _bind(effect, indexToBind, overrideVertexBuffers, overrideVertexArrayObjects) {
        if (!effect) {
            return;
        }
        if (indexToBind === undefined) {
            indexToBind = this._indexBuffer;
        }
        const vbs = this.getVertexBuffers();
        if (!vbs) {
            return;
        }
        if (indexToBind != this._indexBuffer || (!this._vertexArrayObjects && !overrideVertexArrayObjects)) {
            this._engine.bindBuffers(vbs, indexToBind, effect, overrideVertexBuffers);
            return;
        }
        const vaos = overrideVertexArrayObjects ? overrideVertexArrayObjects : this._vertexArrayObjects;
        const engine = this._engine;
        // Using VAO
        if (!vaos[effect.key]) {
            vaos[effect.key] = engine.recordVertexArrayObject(vbs, indexToBind, effect, overrideVertexBuffers);
        }
        engine.bindVertexArrayObject(vaos[effect.key], indexToBind);
    }
    /**
     * Gets total number of vertices
     * @returns the total number of vertices
     */
    getTotalVertices() {
        if (!this.isReady()) {
            return 0;
        }
        return this._totalVertices;
    }
    /**
     * Gets a specific vertex data attached to this geometry. Float data is constructed if the vertex buffer data cannot be returned directly.
     * @param kind defines the data kind (Position, normal, etc...)
     * @param copyWhenShared defines if the returned array must be cloned upon returning it if the current geometry is shared between multiple meshes
     * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
     * @returns a float array containing vertex data
     */
    getVerticesData(kind, copyWhenShared, forceCopy) {
        const vertexBuffer = this.getVertexBuffer(kind);
        if (!vertexBuffer) {
            return null;
        }
        return vertexBuffer.getFloatData(this._totalVertices, forceCopy || (copyWhenShared && this._meshes.length !== 1));
    }
    /**
     * Copies the requested vertex data kind into the given vertex data map. Float data is constructed if the map doesn't have the data.
     * @param kind defines the data kind (Position, normal, etc...)
     * @param vertexData defines the map that stores the resulting data
     */
    copyVerticesData(kind, vertexData) {
        const vertexBuffer = this.getVertexBuffer(kind);
        if (!vertexBuffer) {
            return;
        }
        vertexData[kind] || (vertexData[kind] = new Float32Array(this._totalVertices * vertexBuffer.getSize()));
        const data = vertexBuffer.getData();
        if (data) {
            (0,_Buffers_bufferUtils_js__WEBPACK_IMPORTED_MODULE_12__/* .CopyFloatData */ .g)(data, vertexBuffer.getSize(), vertexBuffer.type, vertexBuffer.byteOffset, vertexBuffer.byteStride, vertexBuffer.normalized, this._totalVertices, vertexData[kind]);
        }
    }
    /**
     * Returns a boolean defining if the vertex data for the requested `kind` is updatable
     * @param kind defines the data kind (Position, normal, etc...)
     * @returns true if the vertex buffer with the specified kind is updatable
     */
    isVertexBufferUpdatable(kind) {
        const vb = this._vertexBuffers[kind];
        if (!vb) {
            return false;
        }
        return vb.isUpdatable();
    }
    /**
     * Gets a specific vertex buffer
     * @param kind defines the data kind (Position, normal, etc...)
     * @returns a VertexBuffer
     */
    getVertexBuffer(kind) {
        if (!this.isReady()) {
            return null;
        }
        return this._vertexBuffers[kind];
    }
    /**
     * Returns all vertex buffers
     * @returns an object holding all vertex buffers indexed by kind
     */
    getVertexBuffers() {
        if (!this.isReady()) {
            return null;
        }
        return this._vertexBuffers;
    }
    /**
     * Gets a boolean indicating if specific vertex buffer is present
     * @param kind defines the data kind (Position, normal, etc...)
     * @returns true if data is present
     */
    isVerticesDataPresent(kind) {
        if (!this._vertexBuffers) {
            if (this._delayInfo) {
                return this._delayInfo.indexOf(kind) !== -1;
            }
            return false;
        }
        return this._vertexBuffers[kind] !== undefined;
    }
    /**
     * Gets a list of all attached data kinds (Position, normal, etc...)
     * @returns a list of string containing all kinds
     */
    getVerticesDataKinds() {
        const result = [];
        let kind;
        if (!this._vertexBuffers && this._delayInfo) {
            for (kind in this._delayInfo) {
                result.push(kind);
            }
        }
        else {
            for (kind in this._vertexBuffers) {
                result.push(kind);
            }
        }
        return result;
    }
    /**
     * Update index buffer
     * @param indices defines the indices to store in the index buffer
     * @param offset defines the offset in the target buffer where to store the data
     * @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
     */
    updateIndices(indices, offset, gpuMemoryOnly = false) {
        if (!this._indexBuffer) {
            return;
        }
        if (!this._indexBufferIsUpdatable) {
            this.setIndices(indices, null, true);
        }
        else {
            const needToUpdateSubMeshes = indices.length !== this._indices.length;
            if (!gpuMemoryOnly) {
                this._indices = indices.slice();
            }
            this._engine.updateDynamicIndexBuffer(this._indexBuffer, indices, offset);
            if (needToUpdateSubMeshes) {
                for (const mesh of this._meshes) {
                    mesh._createGlobalSubMesh(true);
                }
            }
        }
    }
    /**
     * Sets the index buffer for this geometry.
     * @param indexBuffer Defines the index buffer to use for this geometry
     * @param totalVertices Defines the total number of vertices used by the buffer
     * @param totalIndices Defines the total number of indices in the index buffer
     */
    setIndexBuffer(indexBuffer, totalVertices, totalIndices) {
        this._indices = [];
        this._indexBufferIsUpdatable = false;
        this._indexBuffer = indexBuffer;
        this._totalVertices = totalVertices;
        this._totalIndices = totalIndices;
        indexBuffer.is32Bits || (indexBuffer.is32Bits = this._totalIndices > 65535);
        for (const mesh of this._meshes) {
            mesh._createGlobalSubMesh(true);
            mesh.synchronizeInstances();
        }
        this._notifyUpdate();
    }
    /**
     * Creates a new index buffer
     * @param indices defines the indices to store in the index buffer
     * @param totalVertices defines the total number of vertices (could be null)
     * @param updatable defines if the index buffer must be flagged as updatable (false by default)
     * @param dontForceSubMeshRecreation defines a boolean indicating that we don't want to force the recreation of sub-meshes if we don't have to (false by default)
     */
    setIndices(indices, totalVertices = null, updatable = false, dontForceSubMeshRecreation = false) {
        if (this._indexBuffer) {
            this._engine._releaseBuffer(this._indexBuffer);
        }
        this._indices = indices;
        this._indexBufferIsUpdatable = updatable;
        if (this._meshes.length !== 0 && this._indices) {
            this._indexBuffer = this._engine.createIndexBuffer(this._indices, updatable, "Geometry_" + this.id + "_IndexBuffer");
        }
        if (totalVertices != undefined) {
            // including null and undefined
            this._totalVertices = totalVertices;
        }
        for (const mesh of this._meshes) {
            mesh._createGlobalSubMesh(!dontForceSubMeshRecreation);
            mesh.synchronizeInstances();
        }
        this._notifyUpdate();
    }
    /**
     * Return the total number of indices
     * @returns the total number of indices
     */
    getTotalIndices() {
        if (!this.isReady()) {
            return 0;
        }
        return this._totalIndices !== undefined ? this._totalIndices : this._indices.length;
    }
    /**
     * Gets the index buffer array
     * @param copyWhenShared defines if the returned array must be cloned upon returning it if the current geometry is shared between multiple meshes
     * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
     * @returns the index buffer array
     */
    getIndices(copyWhenShared, forceCopy) {
        if (!this.isReady()) {
            return null;
        }
        const orig = this._indices;
        if (!forceCopy && (!copyWhenShared || this._meshes.length === 1)) {
            return orig;
        }
        else {
            return orig.slice();
        }
    }
    /**
     * Gets the index buffer
     * @returns the index buffer
     */
    getIndexBuffer() {
        if (!this.isReady()) {
            return null;
        }
        return this._indexBuffer;
    }
    /**
     * @internal
     */
    _releaseVertexArrayObject(effect = null) {
        if (!effect || !this._vertexArrayObjects) {
            return;
        }
        if (this._vertexArrayObjects[effect.key]) {
            this._engine.releaseVertexArrayObject(this._vertexArrayObjects[effect.key]);
            delete this._vertexArrayObjects[effect.key];
        }
    }
    /**
     * Release the associated resources for a specific mesh
     * @param mesh defines the source mesh
     * @param shouldDispose defines if the geometry must be disposed if there is no more mesh pointing to it
     */
    releaseForMesh(mesh, shouldDispose) {
        const meshes = this._meshes;
        const index = meshes.indexOf(mesh);
        if (index === -1) {
            return;
        }
        meshes.splice(index, 1);
        if (this._vertexArrayObjects) {
            mesh._invalidateInstanceVertexArrayObject();
        }
        mesh._geometry = null;
        if (meshes.length === 0 && shouldDispose) {
            this.dispose();
        }
    }
    /**
     * Apply current geometry to a given mesh
     * @param mesh defines the mesh to apply geometry to
     */
    applyToMesh(mesh) {
        if (mesh._geometry === this) {
            return;
        }
        const previousGeometry = mesh._geometry;
        if (previousGeometry) {
            previousGeometry.releaseForMesh(mesh);
        }
        if (this._vertexArrayObjects) {
            mesh._invalidateInstanceVertexArrayObject();
        }
        const meshes = this._meshes;
        // must be done before setting vertexBuffers because of mesh._createGlobalSubMesh()
        mesh._geometry = this;
        mesh._internalAbstractMeshDataInfo._positions = null;
        this._scene.pushGeometry(this);
        meshes.push(mesh);
        if (this.isReady()) {
            this._applyToMesh(mesh);
        }
        else if (this._boundingInfo) {
            mesh.setBoundingInfo(this._boundingInfo);
        }
    }
    _updateExtend(data = null) {
        if (this.useBoundingInfoFromGeometry && this._boundingInfo) {
            this._extend = {
                minimum: this._boundingInfo.minimum.clone(),
                maximum: this._boundingInfo.maximum.clone(),
            };
        }
        else {
            if (!data) {
                data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind);
                // This can happen if the buffer comes from a Hardware Buffer where
                // The data have not been uploaded by Babylon. (ex: Compute Shaders and Storage Buffers)
                if (!data) {
                    return;
                }
            }
            this._extend = (0,_Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_9__/* .extractMinAndMax */ .b8)(data, 0, this._totalVertices, this.boundingBias, 3);
        }
    }
    _applyToMesh(mesh) {
        const numOfMeshes = this._meshes.length;
        // vertexBuffers
        for (const kind in this._vertexBuffers) {
            if (numOfMeshes === 1) {
                this._vertexBuffers[kind].create();
            }
            if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind) {
                if (!this._extend) {
                    this._updateExtend();
                }
                mesh.buildBoundingInfo(this._extend.minimum, this._extend.maximum);
                mesh._createGlobalSubMesh(mesh.isUnIndexed);
                //bounding info was just created again, world matrix should be applied again.
                mesh._updateBoundingInfo();
            }
        }
        // indexBuffer
        if (numOfMeshes === 1 && this._indices && this._indices.length > 0) {
            this._indexBuffer = this._engine.createIndexBuffer(this._indices, this._updatable, "Geometry_" + this.id + "_IndexBuffer");
        }
        // morphTargets
        mesh._syncGeometryWithMorphTargetManager();
        // instances
        mesh.synchronizeInstances();
    }
    _notifyUpdate(kind) {
        if (this.onGeometryUpdated) {
            this.onGeometryUpdated(this, kind);
        }
        if (this._vertexArrayObjects) {
            this._disposeVertexArrayObjects();
        }
        for (const mesh of this._meshes) {
            mesh._markSubMeshesAsAttributesDirty();
        }
    }
    /**
     * Load the geometry if it was flagged as delay loaded
     * @param scene defines the hosting scene
     * @param onLoaded defines a callback called when the geometry is loaded
     */
    load(scene, onLoaded) {
        if (this.delayLoadState === 2) {
            return;
        }
        if (this.isReady()) {
            if (onLoaded) {
                onLoaded();
            }
            return;
        }
        this.delayLoadState = 2;
        this._queueLoad(scene, onLoaded);
    }
    _queueLoad(scene, onLoaded) {
        if (!this.delayLoadingFile) {
            return;
        }
        scene.addPendingData(this);
        scene._loadFile(this.delayLoadingFile, (data) => {
            if (!this._delayLoadingFunction) {
                return;
            }
            this._delayLoadingFunction(JSON.parse(data), this);
            this.delayLoadState = 1;
            this._delayInfo = [];
            scene.removePendingData(this);
            const meshes = this._meshes;
            const numOfMeshes = meshes.length;
            for (let index = 0; index < numOfMeshes; index++) {
                this._applyToMesh(meshes[index]);
            }
            if (onLoaded) {
                onLoaded();
            }
        }, undefined, true);
    }
    /**
     * Invert the geometry to move from a right handed system to a left handed one.
     */
    toLeftHanded() {
        // Flip faces
        const tIndices = this.getIndices(false);
        if (tIndices != null && tIndices.length > 0) {
            for (let i = 0; i < tIndices.length; i += 3) {
                const tTemp = tIndices[i + 0];
                tIndices[i + 0] = tIndices[i + 2];
                tIndices[i + 2] = tTemp;
            }
            this.setIndices(tIndices);
        }
        // Negate position.z
        const tPositions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind, false);
        if (tPositions != null && tPositions.length > 0) {
            for (let i = 0; i < tPositions.length; i += 3) {
                tPositions[i + 2] = -tPositions[i + 2];
            }
            this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind, tPositions, false);
        }
        // Negate normal.z
        const tNormals = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind, false);
        if (tNormals != null && tNormals.length > 0) {
            for (let i = 0; i < tNormals.length; i += 3) {
                tNormals[i + 2] = -tNormals[i + 2];
            }
            this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind, tNormals, false);
        }
    }
    // Cache
    /** @internal */
    _resetPointsArrayCache() {
        this._positions = null;
    }
    /** @internal */
    _generatePointsArray() {
        if (this._positions) {
            return true;
        }
        const data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind);
        if (!data || data.length === 0) {
            return false;
        }
        for (let index = this._positionsCache.length * 3, arrayIdx = this._positionsCache.length; index < data.length; index += 3, ++arrayIdx) {
            this._positionsCache[arrayIdx] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArray(data, index);
        }
        for (let index = 0, arrayIdx = 0; index < data.length; index += 3, ++arrayIdx) {
            this._positionsCache[arrayIdx].set(data[0 + index], data[1 + index], data[2 + index]);
        }
        // just in case the number of positions was reduced, splice the array
        this._positionsCache.length = data.length / 3;
        this._positions = this._positionsCache;
        return true;
    }
    /**
     * Gets a value indicating if the geometry is disposed
     * @returns true if the geometry was disposed
     */
    isDisposed() {
        return this._isDisposed;
    }
    _disposeVertexArrayObjects() {
        if (this._vertexArrayObjects) {
            for (const kind in this._vertexArrayObjects) {
                this._engine.releaseVertexArrayObject(this._vertexArrayObjects[kind]);
            }
            this._vertexArrayObjects = {}; // Will trigger a rebuild of the VAO if supported
            const meshes = this._meshes;
            const numOfMeshes = meshes.length;
            for (let index = 0; index < numOfMeshes; index++) {
                meshes[index]._invalidateInstanceVertexArrayObject();
            }
        }
    }
    /**
     * Free all associated resources
     */
    dispose() {
        const meshes = this._meshes;
        const numOfMeshes = meshes.length;
        let index;
        for (index = 0; index < numOfMeshes; index++) {
            this.releaseForMesh(meshes[index]);
        }
        this._meshes.length = 0;
        this._disposeVertexArrayObjects();
        for (const kind in this._vertexBuffers) {
            this._vertexBuffers[kind].dispose();
        }
        this._vertexBuffers = {};
        this._totalVertices = 0;
        if (this._indexBuffer) {
            this._engine._releaseBuffer(this._indexBuffer);
        }
        this._indexBuffer = null;
        this._indices = [];
        this.delayLoadState = 0;
        this.delayLoadingFile = null;
        this._delayLoadingFunction = null;
        this._delayInfo = [];
        this._boundingInfo = null;
        this._scene.removeGeometry(this);
        if (this._parentContainer) {
            const index = this._parentContainer.geometries.indexOf(this);
            if (index > -1) {
                this._parentContainer.geometries.splice(index, 1);
            }
            this._parentContainer = null;
        }
        this._isDisposed = true;
    }
    /**
     * Clone the current geometry into a new geometry
     * @param id defines the unique ID of the new geometry
     * @returns a new geometry object
     */
    copy(id) {
        const vertexData = new _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexData */ .P();
        vertexData.indices = [];
        const indices = this.getIndices();
        if (indices) {
            for (let index = 0; index < indices.length; index++) {
                vertexData.indices.push(indices[index]);
            }
        }
        let updatable = false;
        let stopChecking = false;
        let kind;
        for (kind in this._vertexBuffers) {
            // using slice() to make a copy of the array and not just reference it
            const data = this.getVerticesData(kind);
            if (data) {
                if (data instanceof Float32Array) {
                    vertexData.set(new Float32Array(data), kind);
                }
                else {
                    vertexData.set(data.slice(0), kind);
                }
                if (!stopChecking) {
                    const vb = this.getVertexBuffer(kind);
                    if (vb) {
                        updatable = vb.isUpdatable();
                        stopChecking = !updatable;
                    }
                }
            }
        }
        const geometry = new Geometry(id, this._scene, vertexData, updatable);
        geometry.delayLoadState = this.delayLoadState;
        geometry.delayLoadingFile = this.delayLoadingFile;
        geometry._delayLoadingFunction = this._delayLoadingFunction;
        for (kind in this._delayInfo) {
            geometry._delayInfo = geometry._delayInfo || [];
            geometry._delayInfo.push(kind);
        }
        // Bounding info
        geometry._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_6__/* .BoundingInfo */ .j(this._extend.minimum, this._extend.maximum);
        return geometry;
    }
    /**
     * Serialize the current geometry info (and not the vertices data) into a JSON object
     * @returns a JSON representation of the current geometry data (without the vertices data)
     */
    serialize() {
        const serializationObject = {};
        serializationObject.id = this.id;
        serializationObject.uniqueId = this.uniqueId;
        serializationObject.updatable = this._updatable;
        if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags */ .Y && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags */ .Y.HasTags(this)) {
            serializationObject.tags = _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags */ .Y.GetTags(this);
        }
        return serializationObject;
    }
    _toNumberArray(origin) {
        if (Array.isArray(origin)) {
            return origin;
        }
        else {
            return Array.prototype.slice.call(origin);
        }
    }
    /**
     * Release any memory retained by the cached data on the Geometry.
     *
     * Call this function to reduce memory footprint of the mesh.
     * Vertex buffers will not store CPU data anymore (this will prevent picking, collisions or physics to work correctly)
     */
    clearCachedData() {
        this._indices = [];
        this._resetPointsArrayCache();
        for (const vbName in this._vertexBuffers) {
            if (!Object.prototype.hasOwnProperty.call(this._vertexBuffers, vbName)) {
                continue;
            }
            this._vertexBuffers[vbName]._buffer._data = null;
        }
    }
    /**
     * Serialize all vertices data into a JSON object
     * @returns a JSON representation of the current geometry data
     */
    serializeVerticeData() {
        const serializationObject = this.serialize();
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind)) {
            serializationObject.positions = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind)) {
                serializationObject.positions._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind)) {
            serializationObject.normals = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind)) {
                serializationObject.normals._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.TangentKind)) {
            serializationObject.tangents = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.TangentKind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.TangentKind)) {
                serializationObject.tangents._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind)) {
            serializationObject.uvs = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind)) {
                serializationObject.uvs._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV2Kind)) {
            serializationObject.uvs2 = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV2Kind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV2Kind)) {
                serializationObject.uvs2._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV3Kind)) {
            serializationObject.uvs3 = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV3Kind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV3Kind)) {
                serializationObject.uvs3._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV4Kind)) {
            serializationObject.uvs4 = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV4Kind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV4Kind)) {
                serializationObject.uvs4._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV5Kind)) {
            serializationObject.uvs5 = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV5Kind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV5Kind)) {
                serializationObject.uvs5._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV6Kind)) {
            serializationObject.uvs6 = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV6Kind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV6Kind)) {
                serializationObject.uvs6._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind)) {
            serializationObject.colors = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind)) {
                serializationObject.colors._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind)) {
            serializationObject.matricesIndices = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind));
            serializationObject.matricesIndices._isExpanded = true;
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind)) {
                serializationObject.matricesIndices._updatable = true;
            }
        }
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsKind)) {
            serializationObject.matricesWeights = this._toNumberArray(this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsKind));
            if (this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsKind)) {
                serializationObject.matricesWeights._updatable = true;
            }
        }
        serializationObject.indices = this._toNumberArray(this.getIndices());
        return serializationObject;
    }
    // Statics
    /**
     * Extracts a clone of a mesh geometry
     * @param mesh defines the source mesh
     * @param id defines the unique ID of the new geometry object
     * @returns the new geometry object
     */
    static ExtractFromMesh(mesh, id) {
        const geometry = mesh._geometry;
        if (!geometry) {
            return null;
        }
        return geometry.copy(id);
    }
    /**
     * You should now use Tools.RandomId(), this method is still here for legacy reasons.
     * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523
     * Be aware Math.random() could cause collisions, but:
     * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide"
     * @returns a string containing a new GUID
     */
    static RandomId() {
        return _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__/* .Tools */ .S0.RandomId();
    }
    static _GetGeometryByLoadedUniqueId(uniqueId, scene) {
        for (let index = 0; index < scene.geometries.length; index++) {
            if (scene.geometries[index]._loadedUniqueId === uniqueId) {
                return scene.geometries[index];
            }
        }
        return null;
    }
    /**
     * @internal
     */
    static _ImportGeometry(parsedGeometry, mesh) {
        const scene = mesh.getScene();
        // Geometry
        const geometryUniqueId = parsedGeometry.geometryUniqueId;
        const geometryId = parsedGeometry.geometryId;
        if (geometryUniqueId || geometryId) {
            const geometry = geometryUniqueId ? this._GetGeometryByLoadedUniqueId(geometryUniqueId, scene) : scene.getGeometryById(geometryId);
            if (geometry) {
                geometry.applyToMesh(mesh);
            }
        }
        else if (parsedGeometry instanceof ArrayBuffer) {
            const binaryInfo = mesh._binaryInfo;
            if (binaryInfo.positionsAttrDesc && binaryInfo.positionsAttrDesc.count > 0) {
                const positionsData = new Float32Array(parsedGeometry, binaryInfo.positionsAttrDesc.offset, binaryInfo.positionsAttrDesc.count);
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind, positionsData, false);
            }
            if (binaryInfo.normalsAttrDesc && binaryInfo.normalsAttrDesc.count > 0) {
                const normalsData = new Float32Array(parsedGeometry, binaryInfo.normalsAttrDesc.offset, binaryInfo.normalsAttrDesc.count);
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind, normalsData, false);
            }
            if (binaryInfo.tangetsAttrDesc && binaryInfo.tangetsAttrDesc.count > 0) {
                const tangentsData = new Float32Array(parsedGeometry, binaryInfo.tangetsAttrDesc.offset, binaryInfo.tangetsAttrDesc.count);
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.TangentKind, tangentsData, false);
            }
            if (binaryInfo.uvsAttrDesc && binaryInfo.uvsAttrDesc.count > 0) {
                const uvsData = new Float32Array(parsedGeometry, binaryInfo.uvsAttrDesc.offset, binaryInfo.uvsAttrDesc.count);
                if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .useOpenGLOrientationForUV */ .rX) {
                    for (let index = 1; index < uvsData.length; index += 2) {
                        uvsData[index] = 1 - uvsData[index];
                    }
                }
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind, uvsData, false);
            }
            if (binaryInfo.uvs2AttrDesc && binaryInfo.uvs2AttrDesc.count > 0) {
                const uvs2Data = new Float32Array(parsedGeometry, binaryInfo.uvs2AttrDesc.offset, binaryInfo.uvs2AttrDesc.count);
                if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .useOpenGLOrientationForUV */ .rX) {
                    for (let index = 1; index < uvs2Data.length; index += 2) {
                        uvs2Data[index] = 1 - uvs2Data[index];
                    }
                }
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV2Kind, uvs2Data, false);
            }
            if (binaryInfo.uvs3AttrDesc && binaryInfo.uvs3AttrDesc.count > 0) {
                const uvs3Data = new Float32Array(parsedGeometry, binaryInfo.uvs3AttrDesc.offset, binaryInfo.uvs3AttrDesc.count);
                if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .useOpenGLOrientationForUV */ .rX) {
                    for (let index = 1; index < uvs3Data.length; index += 2) {
                        uvs3Data[index] = 1 - uvs3Data[index];
                    }
                }
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV3Kind, uvs3Data, false);
            }
            if (binaryInfo.uvs4AttrDesc && binaryInfo.uvs4AttrDesc.count > 0) {
                const uvs4Data = new Float32Array(parsedGeometry, binaryInfo.uvs4AttrDesc.offset, binaryInfo.uvs4AttrDesc.count);
                if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .useOpenGLOrientationForUV */ .rX) {
                    for (let index = 1; index < uvs4Data.length; index += 2) {
                        uvs4Data[index] = 1 - uvs4Data[index];
                    }
                }
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV4Kind, uvs4Data, false);
            }
            if (binaryInfo.uvs5AttrDesc && binaryInfo.uvs5AttrDesc.count > 0) {
                const uvs5Data = new Float32Array(parsedGeometry, binaryInfo.uvs5AttrDesc.offset, binaryInfo.uvs5AttrDesc.count);
                if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .useOpenGLOrientationForUV */ .rX) {
                    for (let index = 1; index < uvs5Data.length; index += 2) {
                        uvs5Data[index] = 1 - uvs5Data[index];
                    }
                }
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV5Kind, uvs5Data, false);
            }
            if (binaryInfo.uvs6AttrDesc && binaryInfo.uvs6AttrDesc.count > 0) {
                const uvs6Data = new Float32Array(parsedGeometry, binaryInfo.uvs6AttrDesc.offset, binaryInfo.uvs6AttrDesc.count);
                if (_Compat_compatibilityOptions_js__WEBPACK_IMPORTED_MODULE_11__/* .useOpenGLOrientationForUV */ .rX) {
                    for (let index = 1; index < uvs6Data.length; index += 2) {
                        uvs6Data[index] = 1 - uvs6Data[index];
                    }
                }
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV6Kind, uvs6Data, false);
            }
            if (binaryInfo.colorsAttrDesc && binaryInfo.colorsAttrDesc.count > 0) {
                const colorsData = new Float32Array(parsedGeometry, binaryInfo.colorsAttrDesc.offset, binaryInfo.colorsAttrDesc.count);
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind, colorsData, false, binaryInfo.colorsAttrDesc.stride);
            }
            if (binaryInfo.matricesIndicesAttrDesc && binaryInfo.matricesIndicesAttrDesc.count > 0) {
                const matricesIndicesData = new Int32Array(parsedGeometry, binaryInfo.matricesIndicesAttrDesc.offset, binaryInfo.matricesIndicesAttrDesc.count);
                const floatIndices = [];
                for (let i = 0; i < matricesIndicesData.length; i++) {
                    const index = matricesIndicesData[i];
                    floatIndices.push(index & 0x000000ff);
                    floatIndices.push((index & 0x0000ff00) >> 8);
                    floatIndices.push((index & 0x00ff0000) >> 16);
                    floatIndices.push((index >> 24) & 0xff); // & 0xFF to convert to v + 256 if v < 0
                }
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind, floatIndices, false);
            }
            if (binaryInfo.matricesIndicesExtraAttrDesc && binaryInfo.matricesIndicesExtraAttrDesc.count > 0) {
                const matricesIndicesData = new Int32Array(parsedGeometry, binaryInfo.matricesIndicesExtraAttrDesc.offset, binaryInfo.matricesIndicesExtraAttrDesc.count);
                const floatIndices = [];
                for (let i = 0; i < matricesIndicesData.length; i++) {
                    const index = matricesIndicesData[i];
                    floatIndices.push(index & 0x000000ff);
                    floatIndices.push((index & 0x0000ff00) >> 8);
                    floatIndices.push((index & 0x00ff0000) >> 16);
                    floatIndices.push((index >> 24) & 0xff); // & 0xFF to convert to v + 256 if v < 0
                }
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesExtraKind, floatIndices, false);
            }
            if (binaryInfo.matricesWeightsAttrDesc && binaryInfo.matricesWeightsAttrDesc.count > 0) {
                const matricesWeightsData = new Float32Array(parsedGeometry, binaryInfo.matricesWeightsAttrDesc.offset, binaryInfo.matricesWeightsAttrDesc.count);
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsKind, matricesWeightsData, false);
            }
            if (binaryInfo.indicesAttrDesc && binaryInfo.indicesAttrDesc.count > 0) {
                const indicesData = new Int32Array(parsedGeometry, binaryInfo.indicesAttrDesc.offset, binaryInfo.indicesAttrDesc.count);
                mesh.setIndices(indicesData, null);
            }
            if (binaryInfo.subMeshesAttrDesc && binaryInfo.subMeshesAttrDesc.count > 0) {
                const subMeshesData = new Int32Array(parsedGeometry, binaryInfo.subMeshesAttrDesc.offset, binaryInfo.subMeshesAttrDesc.count * 5);
                mesh.subMeshes = [];
                for (let i = 0; i < binaryInfo.subMeshesAttrDesc.count; i++) {
                    const materialIndex = subMeshesData[i * 5 + 0];
                    const verticesStart = subMeshesData[i * 5 + 1];
                    const verticesCount = subMeshesData[i * 5 + 2];
                    const indexStart = subMeshesData[i * 5 + 3];
                    const indexCount = subMeshesData[i * 5 + 4];
                    _Meshes_subMesh_js__WEBPACK_IMPORTED_MODULE_4__/* .SubMesh */ .K.AddToMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh);
                }
            }
        }
        else if (parsedGeometry.positions && parsedGeometry.normals && parsedGeometry.indices) {
            mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind, parsedGeometry.positions, parsedGeometry.positions._updatable);
            mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind, parsedGeometry.normals, parsedGeometry.normals._updatable);
            if (parsedGeometry.tangents) {
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.TangentKind, parsedGeometry.tangents, parsedGeometry.tangents._updatable);
            }
            if (parsedGeometry.uvs) {
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind, parsedGeometry.uvs, parsedGeometry.uvs._updatable);
            }
            if (parsedGeometry.uvs2) {
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV2Kind, parsedGeometry.uvs2, parsedGeometry.uvs2._updatable);
            }
            if (parsedGeometry.uvs3) {
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV3Kind, parsedGeometry.uvs3, parsedGeometry.uvs3._updatable);
            }
            if (parsedGeometry.uvs4) {
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV4Kind, parsedGeometry.uvs4, parsedGeometry.uvs4._updatable);
            }
            if (parsedGeometry.uvs5) {
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV5Kind, parsedGeometry.uvs5, parsedGeometry.uvs5._updatable);
            }
            if (parsedGeometry.uvs6) {
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV6Kind, parsedGeometry.uvs6, parsedGeometry.uvs6._updatable);
            }
            if (parsedGeometry.colors) {
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind, _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_1__/* .Color4 */ .ov.CheckColors4(parsedGeometry.colors, parsedGeometry.positions.length / 3), parsedGeometry.colors._updatable);
            }
            if (parsedGeometry.matricesIndices) {
                if (!parsedGeometry.matricesIndices._isExpanded) {
                    const floatIndices = [];
                    for (let i = 0; i < parsedGeometry.matricesIndices.length; i++) {
                        const matricesIndex = parsedGeometry.matricesIndices[i];
                        floatIndices.push(matricesIndex & 0x000000ff);
                        floatIndices.push((matricesIndex & 0x0000ff00) >> 8);
                        floatIndices.push((matricesIndex & 0x00ff0000) >> 16);
                        floatIndices.push((matricesIndex >> 24) & 0xff); // & 0xFF to convert to v + 256 if v < 0
                    }
                    mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind, floatIndices, parsedGeometry.matricesIndices._updatable);
                }
                else {
                    delete parsedGeometry.matricesIndices._isExpanded;
                    mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind, parsedGeometry.matricesIndices, parsedGeometry.matricesIndices._updatable);
                }
            }
            if (parsedGeometry.matricesIndicesExtra) {
                if (!parsedGeometry.matricesIndicesExtra._isExpanded) {
                    const floatIndices = [];
                    for (let i = 0; i < parsedGeometry.matricesIndicesExtra.length; i++) {
                        const matricesIndex = parsedGeometry.matricesIndicesExtra[i];
                        floatIndices.push(matricesIndex & 0x000000ff);
                        floatIndices.push((matricesIndex & 0x0000ff00) >> 8);
                        floatIndices.push((matricesIndex & 0x00ff0000) >> 16);
                        floatIndices.push((matricesIndex >> 24) & 0xff); // & 0xFF to convert to v + 256 if v < 0
                    }
                    mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesExtraKind, floatIndices, parsedGeometry.matricesIndicesExtra._updatable);
                }
                else {
                    delete parsedGeometry.matricesIndices._isExpanded;
                    mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesExtraKind, parsedGeometry.matricesIndicesExtra, parsedGeometry.matricesIndicesExtra._updatable);
                }
            }
            if (parsedGeometry.matricesWeights) {
                Geometry._CleanMatricesWeights(parsedGeometry, mesh);
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsKind, parsedGeometry.matricesWeights, parsedGeometry.matricesWeights._updatable);
            }
            if (parsedGeometry.matricesWeightsExtra) {
                mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsExtraKind, parsedGeometry.matricesWeightsExtra, parsedGeometry.matricesWeights._updatable);
            }
            mesh.setIndices(parsedGeometry.indices, null);
        }
        // SubMeshes
        if (parsedGeometry.subMeshes) {
            mesh.subMeshes = [];
            for (let subIndex = 0; subIndex < parsedGeometry.subMeshes.length; subIndex++) {
                const parsedSubMesh = parsedGeometry.subMeshes[subIndex];
                _Meshes_subMesh_js__WEBPACK_IMPORTED_MODULE_4__/* .SubMesh */ .K.AddToMesh(parsedSubMesh.materialIndex, parsedSubMesh.verticesStart, parsedSubMesh.verticesCount, parsedSubMesh.indexStart, parsedSubMesh.indexCount, mesh);
            }
        }
        // Flat shading
        if (mesh._shouldGenerateFlatShading) {
            mesh.convertToFlatShadedMesh();
            mesh._shouldGenerateFlatShading = false;
        }
        // Update
        mesh.computeWorldMatrix(true);
        scene.onMeshImportedObservable.notifyObservers(mesh);
    }
    static _CleanMatricesWeights(parsedGeometry, mesh) {
        const epsilon = 1e-3;
        if (!_Loading_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_5__/* .SceneLoaderFlags */ .B.CleanBoneMatrixWeights) {
            return;
        }
        let noInfluenceBoneIndex = 0.0;
        if (parsedGeometry.skeletonId > -1) {
            const skeleton = mesh.getScene().getLastSkeletonById(parsedGeometry.skeletonId);
            if (!skeleton) {
                return;
            }
            noInfluenceBoneIndex = skeleton.bones.length;
        }
        else {
            return;
        }
        const matricesIndices = mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind);
        const matricesIndicesExtra = mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesExtraKind);
        const matricesWeights = parsedGeometry.matricesWeights;
        const matricesWeightsExtra = parsedGeometry.matricesWeightsExtra;
        const influencers = parsedGeometry.numBoneInfluencer;
        const size = matricesWeights.length;
        for (let i = 0; i < size; i += 4) {
            let weight = 0.0;
            let firstZeroWeight = -1;
            for (let j = 0; j < 4; j++) {
                const w = matricesWeights[i + j];
                weight += w;
                if (w < epsilon && firstZeroWeight < 0) {
                    firstZeroWeight = j;
                }
            }
            if (matricesWeightsExtra) {
                for (let j = 0; j < 4; j++) {
                    const w = matricesWeightsExtra[i + j];
                    weight += w;
                    if (w < epsilon && firstZeroWeight < 0) {
                        firstZeroWeight = j + 4;
                    }
                }
            }
            if (firstZeroWeight < 0 || firstZeroWeight > influencers - 1) {
                firstZeroWeight = influencers - 1;
            }
            if (weight > epsilon) {
                const mweight = 1.0 / weight;
                for (let j = 0; j < 4; j++) {
                    matricesWeights[i + j] *= mweight;
                }
                if (matricesWeightsExtra) {
                    for (let j = 0; j < 4; j++) {
                        matricesWeightsExtra[i + j] *= mweight;
                    }
                }
            }
            else {
                if (firstZeroWeight >= 4) {
                    matricesWeightsExtra[i + firstZeroWeight - 4] = 1.0 - weight;
                    matricesIndicesExtra[i + firstZeroWeight - 4] = noInfluenceBoneIndex;
                }
                else {
                    matricesWeights[i + firstZeroWeight] = 1.0 - weight;
                    matricesIndices[i + firstZeroWeight] = noInfluenceBoneIndex;
                }
            }
        }
        mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind, matricesIndices);
        if (parsedGeometry.matricesWeightsExtra) {
            mesh.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesExtraKind, matricesIndicesExtra);
        }
    }
    /**
     * Create a new geometry from persisted data (Using .babylon file format)
     * @param parsedVertexData defines the persisted data
     * @param scene defines the hosting scene
     * @param rootUrl defines the root url to use to load assets (like delayed data)
     * @returns the new geometry object
     */
    static Parse(parsedVertexData, scene, rootUrl) {
        const geometry = new Geometry(parsedVertexData.id, scene, undefined, parsedVertexData.updatable);
        geometry._loadedUniqueId = parsedVertexData.uniqueId;
        if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags */ .Y) {
            _Misc_tags_js__WEBPACK_IMPORTED_MODULE_8__/* .Tags */ .Y.AddTagsTo(geometry, parsedVertexData.tags);
        }
        if (parsedVertexData.delayLoadingFile) {
            geometry.delayLoadState = 4;
            geometry.delayLoadingFile = rootUrl + parsedVertexData.delayLoadingFile;
            geometry._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_6__/* .BoundingInfo */ .j(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArray(parsedVertexData.boundingBoxMinimum), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.FromArray(parsedVertexData.boundingBoxMaximum));
            geometry._delayInfo = [];
            if (parsedVertexData.hasUVs) {
                geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind);
            }
            if (parsedVertexData.hasUVs2) {
                geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV2Kind);
            }
            if (parsedVertexData.hasUVs3) {
                geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV3Kind);
            }
            if (parsedVertexData.hasUVs4) {
                geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV4Kind);
            }
            if (parsedVertexData.hasUVs5) {
                geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV5Kind);
            }
            if (parsedVertexData.hasUVs6) {
                geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UV6Kind);
            }
            if (parsedVertexData.hasColors) {
                geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind);
            }
            if (parsedVertexData.hasMatricesIndices) {
                geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesIndicesKind);
            }
            if (parsedVertexData.hasMatricesWeights) {
                geometry._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.MatricesWeightsKind);
            }
            geometry._delayLoadingFunction = _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexData */ .P.ImportVertexData;
        }
        else {
            _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexData */ .P.ImportVertexData(parsedVertexData, geometry);
        }
        scene.pushGeometry(geometry, true);
        return geometry;
    }
}
//# sourceMappingURL=geometry.js.map

/***/ }),

/***/ 11420:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   f: () => (/* binding */ GroundMesh)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95616);
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76595);



_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e._GroundMeshParser = (parsedMesh, scene) => {
    return GroundMesh.Parse(parsedMesh, scene);
};
/**
 * Mesh representing the ground
 */
class GroundMesh extends _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e {
    constructor(name, scene) {
        super(name, scene);
        /** If octree should be generated */
        this.generateOctree = false;
    }
    /**
     * "GroundMesh"
     * @returns "GroundMesh"
     */
    getClassName() {
        return "GroundMesh";
    }
    /**
     * The minimum of x and y subdivisions
     */
    get subdivisions() {
        return Math.min(this._subdivisionsX, this._subdivisionsY);
    }
    /**
     * X subdivisions
     */
    get subdivisionsX() {
        return this._subdivisionsX;
    }
    /**
     * Y subdivisions
     */
    get subdivisionsY() {
        return this._subdivisionsY;
    }
    /**
     * This function will divide the mesh into submeshes and update an octree to help to select the right submeshes
     * for rendering, picking and collision computations. Please note that you must have a decent number of submeshes
     * to get performance improvements when using an octree.
     * @param chunksCount the number of submeshes the mesh will be divided into
     * @param octreeBlocksSize the maximum size of the octree blocks (Default: 32)
     */
    optimize(chunksCount, octreeBlocksSize = 32) {
        this._subdivisionsX = chunksCount;
        this._subdivisionsY = chunksCount;
        this.subdivide(chunksCount);
        // Call the octree system optimization if it is defined.
        const thisAsAny = this;
        if (thisAsAny.createOrUpdateSubmeshesOctree) {
            thisAsAny.createOrUpdateSubmeshesOctree(octreeBlocksSize);
        }
    }
    /**
     * Returns a height (y) value in the World system :
     * the ground altitude at the coordinates (x, z) expressed in the World system.
     * @param x x coordinate
     * @param z z coordinate
     * @returns the ground y position if (x, z) are outside the ground surface.
     */
    getHeightAtCoordinates(x, z) {
        const world = this.getWorldMatrix();
        const invMat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[5];
        world.invertToRef(invMat);
        const tmpVect = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[8];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(x, 0.0, z, invMat, tmpVect); // transform x,z in the mesh local space
        x = tmpVect.x;
        z = tmpVect.z;
        if (x < this._minX || x >= this._maxX || z <= this._minZ || z > this._maxZ) {
            return this.position.y;
        }
        if (!this._heightQuads || this._heightQuads.length == 0) {
            this._initHeightQuads();
            this._computeHeightQuads();
        }
        const facet = this._getFacetAt(x, z);
        const y = -(facet.x * x + facet.z * z + facet.w) / facet.y;
        // return y in the World system
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(0.0, y, 0.0, world, tmpVect);
        return tmpVect.y;
    }
    /**
     * Returns a normalized vector (Vector3) orthogonal to the ground
     * at the ground coordinates (x, z) expressed in the World system.
     * @param x x coordinate
     * @param z z coordinate
     * @returns Vector3(0.0, 1.0, 0.0) if (x, z) are outside the ground surface.
     */
    getNormalAtCoordinates(x, z) {
        const normal = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0.0, 1.0, 0.0);
        this.getNormalAtCoordinatesToRef(x, z, normal);
        return normal;
    }
    /**
     * Updates the Vector3 passed a reference with a normalized vector orthogonal to the ground
     * at the ground coordinates (x, z) expressed in the World system.
     * Doesn't update the reference Vector3 if (x, z) are outside the ground surface.
     * @param x x coordinate
     * @param z z coordinate
     * @param ref vector to store the result
     * @returns the GroundMesh.
     */
    getNormalAtCoordinatesToRef(x, z, ref) {
        const world = this.getWorldMatrix();
        const tmpMat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Matrix[5];
        world.invertToRef(tmpMat);
        const tmpVect = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[8];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(x, 0.0, z, tmpMat, tmpVect); // transform x,z in the mesh local space
        x = tmpVect.x;
        z = tmpVect.z;
        if (x < this._minX || x > this._maxX || z < this._minZ || z > this._maxZ) {
            return this;
        }
        if (!this._heightQuads || this._heightQuads.length == 0) {
            this._initHeightQuads();
            this._computeHeightQuads();
        }
        const facet = this._getFacetAt(x, z);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.TransformNormalFromFloatsToRef(facet.x, facet.y, facet.z, world, ref);
        return this;
    }
    /**
     * Force the heights to be recomputed for getHeightAtCoordinates() or getNormalAtCoordinates()
     * if the ground has been updated.
     * This can be used in the render loop.
     * @returns the GroundMesh.
     */
    updateCoordinateHeights() {
        if (!this._heightQuads || this._heightQuads.length == 0) {
            this._initHeightQuads();
        }
        this._computeHeightQuads();
        return this;
    }
    // Returns the element "facet" from the heightQuads array relative to (x, z) local coordinates
    _getFacetAt(x, z) {
        // retrieve col and row from x, z coordinates in the ground local system
        const col = Math.floor(((x + this._maxX) * this._subdivisionsX) / this._width);
        const row = Math.floor((-(z + this._maxZ) * this._subdivisionsY) / this._height + this._subdivisionsY);
        const quad = this._heightQuads[row * this._subdivisionsX + col];
        let facet;
        if (z < quad.slope.x * x + quad.slope.y) {
            facet = quad.facet1;
        }
        else {
            facet = quad.facet2;
        }
        return facet;
    }
    //  Creates and populates the heightMap array with "facet" elements :
    // a quad is two triangular facets separated by a slope, so a "facet" element is 1 slope + 2 facets
    // slope : Vector2(c, h) = 2D diagonal line equation setting apart two triangular facets in a quad : z = cx + h
    // facet1 : Vector4(a, b, c, d) = first facet 3D plane equation : ax + by + cz + d = 0
    // facet2 :  Vector4(a, b, c, d) = second facet 3D plane equation : ax + by + cz + d = 0
    // Returns the GroundMesh.
    _initHeightQuads() {
        const subdivisionsX = this._subdivisionsX;
        const subdivisionsY = this._subdivisionsY;
        this._heightQuads = new Array();
        for (let row = 0; row < subdivisionsY; row++) {
            for (let col = 0; col < subdivisionsX; col++) {
                const quad = { slope: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9.Zero(), facet1: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector4 */ .IU(0.0, 0.0, 0.0, 0.0), facet2: new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector4 */ .IU(0.0, 0.0, 0.0, 0.0) };
                this._heightQuads[row * subdivisionsX + col] = quad;
            }
        }
        return this;
    }
    // Compute each quad element values and update the heightMap array :
    // slope : Vector2(c, h) = 2D diagonal line equation setting apart two triangular facets in a quad : z = cx + h
    // facet1 : Vector4(a, b, c, d) = first facet 3D plane equation : ax + by + cz + d = 0
    // facet2 :  Vector4(a, b, c, d) = second facet 3D plane equation : ax + by + cz + d = 0
    // Returns the GroundMesh.
    _computeHeightQuads() {
        const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind);
        if (!positions) {
            return this;
        }
        const v1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[3];
        const v2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[2];
        const v3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[1];
        const v4 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[0];
        const v1v2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[4];
        const v1v3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[5];
        const v1v4 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[6];
        const norm1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[7];
        const norm2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[8];
        let i = 0;
        let j = 0;
        let k = 0;
        let cd = 0; // 2D slope coefficient : z = cd * x + h
        let h = 0;
        let d1 = 0; // facet plane equation : ax + by + cz + d = 0
        let d2 = 0;
        const subdivisionsX = this._subdivisionsX;
        const subdivisionsY = this._subdivisionsY;
        for (let row = 0; row < subdivisionsY; row++) {
            for (let col = 0; col < subdivisionsX; col++) {
                i = col * 3;
                j = row * (subdivisionsX + 1) * 3;
                k = (row + 1) * (subdivisionsX + 1) * 3;
                v1.x = positions[j + i];
                v1.y = positions[j + i + 1];
                v1.z = positions[j + i + 2];
                v2.x = positions[j + i + 3];
                v2.y = positions[j + i + 4];
                v2.z = positions[j + i + 5];
                v3.x = positions[k + i];
                v3.y = positions[k + i + 1];
                v3.z = positions[k + i + 2];
                v4.x = positions[k + i + 3];
                v4.y = positions[k + i + 4];
                v4.z = positions[k + i + 5];
                // 2D slope V1V4
                cd = (v4.z - v1.z) / (v4.x - v1.x);
                h = v1.z - cd * v1.x; // v1 belongs to the slope
                // facet equations :
                // we compute each facet normal vector
                // the equation of the facet plane is : norm.x * x + norm.y * y + norm.z * z + d = 0
                // we compute the value d by applying the equation to v1 which belongs to the plane
                // then we store the facet equation in a Vector4
                v2.subtractToRef(v1, v1v2);
                v3.subtractToRef(v1, v1v3);
                v4.subtractToRef(v1, v1v4);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.CrossToRef(v1v4, v1v3, norm1); // caution : CrossToRef uses the Tmp class
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.CrossToRef(v1v2, v1v4, norm2);
                norm1.normalize();
                norm2.normalize();
                d1 = -(norm1.x * v1.x + norm1.y * v1.y + norm1.z * v1.z);
                d2 = -(norm2.x * v2.x + norm2.y * v2.y + norm2.z * v2.z);
                const quad = this._heightQuads[row * subdivisionsX + col];
                quad.slope.copyFromFloats(cd, h);
                quad.facet1.copyFromFloats(norm1.x, norm1.y, norm1.z, d1);
                quad.facet2.copyFromFloats(norm2.x, norm2.y, norm2.z, d2);
            }
        }
        return this;
    }
    /**
     * Serializes this ground mesh
     * @param serializationObject object to write serialization to
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.subdivisionsX = this._subdivisionsX;
        serializationObject.subdivisionsY = this._subdivisionsY;
        serializationObject.minX = this._minX;
        serializationObject.maxX = this._maxX;
        serializationObject.minZ = this._minZ;
        serializationObject.maxZ = this._maxZ;
        serializationObject.width = this._width;
        serializationObject.height = this._height;
    }
    /**
     * Parses a serialized ground mesh
     * @param parsedMesh the serialized mesh
     * @param scene the scene to create the ground mesh in
     * @returns the created ground mesh
     */
    static Parse(parsedMesh, scene) {
        const result = new GroundMesh(parsedMesh.name, scene);
        result._subdivisionsX = parsedMesh.subdivisionsX || 1;
        result._subdivisionsY = parsedMesh.subdivisionsY || 1;
        result._minX = parsedMesh.minX;
        result._maxX = parsedMesh.maxX;
        result._minZ = parsedMesh.minZ;
        result._maxZ = parsedMesh.maxZ;
        result._width = parsedMesh.width;
        result._height = parsedMesh.height;
        return result;
    }
}
//# sourceMappingURL=groundMesh.js.map

/***/ }),

/***/ 61440:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (/* binding */ InstancedMesh)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);
/* harmony import */ var _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35985);
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76595);
/* harmony import */ var _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74609);
/* harmony import */ var _transformNode_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97328);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95616);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(998);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56552);









_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh */ .e._instancedMeshFactory = (name, mesh) => {
    const instance = new InstancedMesh(name, mesh);
    if (mesh.instancedBuffers) {
        instance.instancedBuffers = {};
        for (const key in mesh.instancedBuffers) {
            instance.instancedBuffers[key] = mesh.instancedBuffers[key];
        }
    }
    return instance;
};
/**
 * Creates an instance based on a source mesh.
 */
class InstancedMesh extends _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_2__/* .AbstractMesh */ .u {
    /**
     * Creates a new InstancedMesh object from the mesh source.
     * @param name defines the name of the instance
     * @param source the mesh to create the instance from
     */
    constructor(name, source) {
        super(name, source.getScene());
        /** @internal */
        this._indexInSourceMeshInstanceArray = -1;
        /** @internal */
        this._distanceToCamera = 0;
        source.addInstance(this);
        this._sourceMesh = source;
        this._unIndexed = source._unIndexed;
        this.position.copyFrom(source.position);
        this.rotation.copyFrom(source.rotation);
        this.scaling.copyFrom(source.scaling);
        if (source.rotationQuaternion) {
            this.rotationQuaternion = source.rotationQuaternion.clone();
        }
        this.animations = source.animations.slice();
        for (const range of source.getAnimationRanges()) {
            if (range != null) {
                this.createAnimationRange(range.name, range.from, range.to);
            }
        }
        this.infiniteDistance = source.infiniteDistance;
        this.setPivotMatrix(source.getPivotMatrix());
        this.refreshBoundingInfo(true, true);
        this._syncSubMeshes();
    }
    /**
     * @returns the string "InstancedMesh".
     */
    getClassName() {
        return "InstancedMesh";
    }
    /** Gets the list of lights affecting that mesh */
    get lightSources() {
        return this._sourceMesh._lightSources;
    }
    _resyncLightSources() {
        // Do nothing as all the work will be done by source mesh
    }
    _resyncLightSource() {
        // Do nothing as all the work will be done by source mesh
    }
    _removeLightSource() {
        // Do nothing as all the work will be done by source mesh
    }
    // Methods
    /**
     * If the source mesh receives shadows
     */
    get receiveShadows() {
        return this._sourceMesh.receiveShadows;
    }
    set receiveShadows(_value) {
        if (this._sourceMesh?.receiveShadows !== _value) {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__/* .Tools */ .S0.Warn("Setting receiveShadows on an instanced mesh has no effect");
        }
    }
    /**
     * The material of the source mesh
     */
    get material() {
        return this._sourceMesh.material;
    }
    set material(_value) {
        if (this._sourceMesh?.material !== _value) {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__/* .Tools */ .S0.Warn("Setting material on an instanced mesh has no effect");
        }
    }
    /**
     * Visibility of the source mesh
     */
    get visibility() {
        return this._sourceMesh.visibility;
    }
    set visibility(_value) {
        if (this._sourceMesh?.visibility !== _value) {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__/* .Tools */ .S0.Warn("Setting visibility on an instanced mesh has no effect");
        }
    }
    /**
     * Skeleton of the source mesh
     */
    get skeleton() {
        return this._sourceMesh.skeleton;
    }
    set skeleton(_value) {
        if (this._sourceMesh?.skeleton !== _value) {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_7__/* .Tools */ .S0.Warn("Setting skeleton on an instanced mesh has no effect");
        }
    }
    /**
     * Rendering ground id of the source mesh
     */
    get renderingGroupId() {
        return this._sourceMesh.renderingGroupId;
    }
    set renderingGroupId(value) {
        if (!this._sourceMesh || value === this._sourceMesh.renderingGroupId) {
            return;
        }
        //no-op with warning
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene");
    }
    /**
     * @returns the total number of vertices (integer).
     */
    getTotalVertices() {
        return this._sourceMesh ? this._sourceMesh.getTotalVertices() : 0;
    }
    /**
     * Returns a positive integer : the total number of indices in this mesh geometry.
     * @returns the number of indices or zero if the mesh has no geometry.
     */
    getTotalIndices() {
        return this._sourceMesh.getTotalIndices();
    }
    /**
     * The source mesh of the instance
     */
    get sourceMesh() {
        return this._sourceMesh;
    }
    /**
     * Creates a new InstancedMesh object from the mesh model.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
     * @param name defines the name of the new instance
     * @returns a new InstancedMesh
     */
    createInstance(name) {
        return this._sourceMesh.createInstance(name);
    }
    /**
     * Is this node ready to be used/rendered
     * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
     * @returns {boolean} is it ready
     */
    isReady(completeCheck = false) {
        return this._sourceMesh.isReady(completeCheck, true);
    }
    /**
     * Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
     * @param kind kind of verticies to retrieve (eg. positions, normals, uvs, etc.)
     * @param copyWhenShared If true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.
     * @param forceCopy defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
     * @returns a float array or a Float32Array of the requested kind of data : positions, normals, uvs, etc.
     */
    getVerticesData(kind, copyWhenShared, forceCopy) {
        return this._sourceMesh.getVerticesData(kind, copyWhenShared, forceCopy);
    }
    copyVerticesData(kind, vertexData) {
        this._sourceMesh.copyVerticesData(kind, vertexData);
    }
    /**
     * Sets the vertex data of the mesh geometry for the requested `kind`.
     * If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data.
     * The `data` are either a numeric array either a Float32Array.
     * The parameter `updatable` is passed as is to the underlying Geometry object constructor (if initially none) or updater.
     * The parameter `stride` is an optional positive integer, it is usually automatically deducted from the `kind` (3 for positions or normals, 2 for UV, etc).
     * Note that a new underlying VertexBuffer object is created each call.
     * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
     *
     * Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     *
     * Returns the Mesh.
     * @param kind defines vertex data kind
     * @param data defines the data source
     * @param updatable defines if the data must be flagged as updatable (false as default)
     * @param stride defines the vertex stride (optional)
     * @returns the current mesh
     */
    setVerticesData(kind, data, updatable, stride) {
        if (this.sourceMesh) {
            this.sourceMesh.setVerticesData(kind, data, updatable, stride);
        }
        return this.sourceMesh;
    }
    /**
     * Updates the existing vertex data of the mesh geometry for the requested `kind`.
     * If the mesh has no geometry, it is simply returned as it is.
     * The `data` are either a numeric array either a Float32Array.
     * No new underlying VertexBuffer object is created.
     * If the `kind` is the `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
     * If the parameter `makeItUnique` is true, a new global geometry is created from this positions and is set to the mesh.
     *
     * Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     *
     * Returns the Mesh.
     * @param kind defines vertex data kind
     * @param data defines the data source
     * @param updateExtends defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
     * @param makeItUnique defines it the updated vertex buffer must be flagged as unique (false by default)
     * @returns the source mesh
     */
    updateVerticesData(kind, data, updateExtends, makeItUnique) {
        if (this.sourceMesh) {
            this.sourceMesh.updateVerticesData(kind, data, updateExtends, makeItUnique);
        }
        return this.sourceMesh;
    }
    /**
     * Sets the mesh indices.
     * Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array).
     * If the mesh has no geometry, a new Geometry object is created and set to the mesh.
     * This method creates a new index buffer each call.
     * Returns the Mesh.
     * @param indices the source data
     * @param totalVertices defines the total number of vertices referenced by indices (could be null)
     * @returns source mesh
     */
    setIndices(indices, totalVertices = null) {
        if (this.sourceMesh) {
            this.sourceMesh.setIndices(indices, totalVertices);
        }
        return this.sourceMesh;
    }
    /**
     * Boolean : True if the mesh owns the requested kind of data.
     * @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     * @returns true if data kind is present
     */
    isVerticesDataPresent(kind) {
        return this._sourceMesh.isVerticesDataPresent(kind);
    }
    /**
     * @returns an array of indices (IndicesArray).
     */
    getIndices() {
        return this._sourceMesh.getIndices();
    }
    get _positions() {
        return this._sourceMesh._positions;
    }
    refreshBoundingInfo(applySkeletonOrOptions = false, applyMorph = false) {
        if (this.hasBoundingInfo && this.getBoundingInfo().isLocked) {
            return this;
        }
        let options;
        if (typeof applySkeletonOrOptions === "object") {
            options = applySkeletonOrOptions;
        }
        else {
            options = {
                applySkeleton: applySkeletonOrOptions,
                applyMorph: applyMorph,
            };
        }
        const bias = this._sourceMesh.geometry ? this._sourceMesh.geometry.boundingBias : null;
        this._refreshBoundingInfo(this._sourceMesh._getData(options, null, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__/* .VertexBuffer */ .R.PositionKind), bias);
        return this;
    }
    /** @internal */
    _preActivate() {
        if (this._currentLOD) {
            this._currentLOD._preActivate();
        }
        return this;
    }
    /**
     * @internal
     */
    _activate(renderId, intermediateRendering) {
        super._activate(renderId, intermediateRendering);
        if (!this._sourceMesh.subMeshes) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Warn("Instances should only be created for meshes with geometry.");
        }
        if (this._currentLOD) {
            const differentSign = this._currentLOD._getWorldMatrixDeterminant() >= 0 !== this._getWorldMatrixDeterminant() >= 0;
            if (differentSign) {
                this._internalAbstractMeshDataInfo._actAsRegularMesh = true;
                return true;
            }
            this._internalAbstractMeshDataInfo._actAsRegularMesh = false;
            this._currentLOD._registerInstanceForRenderId(this, renderId);
            if (intermediateRendering) {
                if (!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate) {
                    this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = true;
                    return true;
                }
            }
            else {
                if (!this._currentLOD._internalAbstractMeshDataInfo._isActive) {
                    this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances = true;
                    return true;
                }
            }
        }
        return false;
    }
    /** @internal */
    _postActivate() {
        if (this._sourceMesh.edgesShareWithInstances && this._sourceMesh._edgesRenderer && this._sourceMesh._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup) {
            // we are using the edge renderer of the source mesh
            this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer);
            this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix());
        }
        else if (this._edgesRenderer && this._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup) {
            // we are using the edge renderer defined for this instance
            this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer);
        }
    }
    getWorldMatrix() {
        if (this._currentLOD && this._currentLOD.billboardMode !== _transformNode_js__WEBPACK_IMPORTED_MODULE_5__/* .TransformNode */ .V.BILLBOARDMODE_NONE && this._currentLOD._masterMesh !== this) {
            if (!this._billboardWorldMatrix) {
                this._billboardWorldMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq();
            }
            const tempMaster = this._currentLOD._masterMesh;
            this._currentLOD._masterMesh = this;
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[7].copyFrom(this._currentLOD.position);
            this._currentLOD.position.set(0, 0, 0);
            this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(true));
            this._currentLOD.position.copyFrom(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Vector3[7]);
            this._currentLOD._masterMesh = tempMaster;
            return this._billboardWorldMatrix;
        }
        return super.getWorldMatrix();
    }
    get isAnInstance() {
        return true;
    }
    /**
     * Returns the current associated LOD AbstractMesh.
     * @param camera defines the camera to use to pick the LOD level
     * @returns a Mesh or `null` if no LOD is associated with the AbstractMesh
     */
    getLOD(camera) {
        if (!camera) {
            return this;
        }
        const sourceMeshLODLevels = this.sourceMesh.getLODLevels();
        if (!sourceMeshLODLevels || sourceMeshLODLevels.length === 0) {
            this._currentLOD = this.sourceMesh;
        }
        else {
            const boundingInfo = this.getBoundingInfo();
            this._currentLOD = this.sourceMesh.getLOD(camera, boundingInfo.boundingSphere);
        }
        return this._currentLOD;
    }
    /**
     * @internal
     */
    _preActivateForIntermediateRendering(renderId) {
        return this.sourceMesh._preActivateForIntermediateRendering(renderId);
    }
    /** @internal */
    _syncSubMeshes() {
        this.releaseSubMeshes();
        if (this._sourceMesh.subMeshes) {
            for (let index = 0; index < this._sourceMesh.subMeshes.length; index++) {
                this._sourceMesh.subMeshes[index].clone(this, this._sourceMesh);
            }
        }
        return this;
    }
    /** @internal */
    _generatePointsArray() {
        return this._sourceMesh._generatePointsArray();
    }
    /** @internal */
    _updateBoundingInfo() {
        if (this.hasBoundingInfo) {
            this.getBoundingInfo().update(this.worldMatrixFromCache);
        }
        else {
            this.buildBoundingInfo(this.absolutePosition, this.absolutePosition, this.worldMatrixFromCache);
        }
        this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);
        return this;
    }
    /**
     * Creates a new InstancedMesh from the current mesh.
     *
     * Returns the clone.
     * @param name the cloned mesh name
     * @param newParent the optional Node to parent the clone to.
     * @param doNotCloneChildren if `true` the model children aren't cloned.
     * @param newSourceMesh if set this mesh will be used as the source mesh instead of ths instance's one
     * @returns the clone
     */
    clone(name, newParent = null, doNotCloneChildren, newSourceMesh) {
        const result = (newSourceMesh || this._sourceMesh).createInstance(name);
        // Deep copy
        _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_4__/* .DeepCopier */ .r.DeepCopy(this, result, [
            "name",
            "subMeshes",
            "uniqueId",
            "parent",
            "lightSources",
            "receiveShadows",
            "material",
            "visibility",
            "skeleton",
            "sourceMesh",
            "isAnInstance",
            "facetNb",
            "isFacetDataEnabled",
            "isBlocked",
            "useBones",
            "hasInstances",
            "collider",
            "edgesRenderer",
            "forward",
            "up",
            "right",
            "absolutePosition",
            "absoluteScaling",
            "absoluteRotationQuaternion",
            "isWorldMatrixFrozen",
            "nonUniformScaling",
            "behaviors",
            "worldMatrixFromCache",
            "hasThinInstances",
            "hasBoundingInfo",
        ], []);
        // Bounding info
        this.refreshBoundingInfo();
        // Parent
        if (newParent) {
            result.parent = newParent;
        }
        if (!doNotCloneChildren) {
            // Children
            for (let index = 0; index < this.getScene().meshes.length; index++) {
                const mesh = this.getScene().meshes[index];
                if (mesh.parent === this) {
                    mesh.clone(mesh.name, result);
                }
            }
        }
        result.computeWorldMatrix(true);
        this.onClonedObservable.notifyObservers(result);
        return result;
    }
    /**
     * Disposes the InstancedMesh.
     * Returns nothing.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        // Remove from mesh
        this._sourceMesh.removeInstance(this);
        super.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
    /**
     * @internal
     */
    _serializeAsParent(serializationObject) {
        super._serializeAsParent(serializationObject);
        serializationObject.parentId = this._sourceMesh.uniqueId;
        serializationObject.parentInstanceIndex = this._indexInSourceMeshInstanceArray;
    }
    /**
     * Instantiate (when possible) or clone that node with its hierarchy
     * @param newParent defines the new parent to use for the instance (or clone)
     * @param options defines options to configure how copy is done
     * @param options.doNotInstantiate defines if the model must be instantiated or just cloned
     * @param options.newSourcedMesh newSourcedMesh the new source mesh for the instance (or clone)
     * @param onNewNodeCreated defines an option callback to call when a clone or an instance is created
     * @returns an instance (or a clone) of the current node with its hierarchy
     */
    instantiateHierarchy(newParent = null, options, onNewNodeCreated) {
        const clone = this.clone("Clone of " + (this.name || this.id), newParent || this.parent, true, options && options.newSourcedMesh);
        if (clone) {
            if (onNewNodeCreated) {
                onNewNodeCreated(this, clone);
            }
        }
        for (const child of this.getChildTransformNodes(true)) {
            child.instantiateHierarchy(clone, options, onNewNodeCreated);
        }
        return clone;
    }
}
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh */ .e.prototype.registerInstancedBuffer = function (kind, stride) {
    // Remove existing one
    this._userInstancedBuffersStorage?.vertexBuffers[kind]?.dispose();
    // Creates the instancedBuffer field if not present
    if (!this.instancedBuffers) {
        this.instancedBuffers = {};
        for (const instance of this.instances) {
            instance.instancedBuffers = {};
        }
    }
    if (!this._userInstancedBuffersStorage) {
        this._userInstancedBuffersStorage = {
            data: {},
            vertexBuffers: {},
            strides: {},
            sizes: {},
            vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : undefined,
        };
    }
    // Creates an empty property for this kind
    this.instancedBuffers[kind] = null;
    this._userInstancedBuffersStorage.strides[kind] = stride;
    this._userInstancedBuffersStorage.sizes[kind] = stride * 32; // Initial size
    this._userInstancedBuffersStorage.data[kind] = new Float32Array(this._userInstancedBuffersStorage.sizes[kind]);
    this._userInstancedBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__/* .VertexBuffer */ .R(this.getEngine(), this._userInstancedBuffersStorage.data[kind], kind, true, false, stride, true);
    for (const instance of this.instances) {
        instance.instancedBuffers[kind] = null;
    }
    this._invalidateInstanceVertexArrayObject();
    this._markSubMeshesAsAttributesDirty();
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh */ .e.prototype._processInstancedBuffers = function (visibleInstances, renderSelf) {
    const instanceCount = visibleInstances ? visibleInstances.length : 0;
    for (const kind in this.instancedBuffers) {
        let size = this._userInstancedBuffersStorage.sizes[kind];
        const stride = this._userInstancedBuffersStorage.strides[kind];
        // Resize if required
        const expectedSize = (instanceCount + 1) * stride;
        while (size < expectedSize) {
            size *= 2;
        }
        if (this._userInstancedBuffersStorage.data[kind].length != size) {
            this._userInstancedBuffersStorage.data[kind] = new Float32Array(size);
            this._userInstancedBuffersStorage.sizes[kind] = size;
            if (this._userInstancedBuffersStorage.vertexBuffers[kind]) {
                this._userInstancedBuffersStorage.vertexBuffers[kind].dispose();
                this._userInstancedBuffersStorage.vertexBuffers[kind] = null;
            }
        }
        const data = this._userInstancedBuffersStorage.data[kind];
        // Update data buffer
        let offset = 0;
        if (renderSelf) {
            const value = this.instancedBuffers[kind];
            if (value.toArray) {
                value.toArray(data, offset);
            }
            else if (value.copyToArray) {
                value.copyToArray(data, offset);
            }
            else {
                data[offset] = value;
            }
            offset += stride;
        }
        for (let instanceIndex = 0; instanceIndex < instanceCount; instanceIndex++) {
            const instance = visibleInstances[instanceIndex];
            const value = instance.instancedBuffers[kind];
            if (value.toArray) {
                value.toArray(data, offset);
            }
            else if (value.copyToArray) {
                value.copyToArray(data, offset);
            }
            else {
                data[offset] = value;
            }
            offset += stride;
        }
        // Update vertex buffer
        if (!this._userInstancedBuffersStorage.vertexBuffers[kind]) {
            this._userInstancedBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_6__/* .VertexBuffer */ .R(this.getEngine(), this._userInstancedBuffersStorage.data[kind], kind, true, false, stride, true);
            this._invalidateInstanceVertexArrayObject();
        }
        else {
            this._userInstancedBuffersStorage.vertexBuffers[kind].updateDirectly(data, 0);
        }
    }
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh */ .e.prototype._invalidateInstanceVertexArrayObject = function () {
    if (!this._userInstancedBuffersStorage || this._userInstancedBuffersStorage.vertexArrayObjects === undefined) {
        return;
    }
    for (const kind in this._userInstancedBuffersStorage.vertexArrayObjects) {
        this.getEngine().releaseVertexArrayObject(this._userInstancedBuffersStorage.vertexArrayObjects[kind]);
    }
    this._userInstancedBuffersStorage.vertexArrayObjects = {};
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_3__/* .Mesh */ .e.prototype._disposeInstanceSpecificData = function () {
    if (this._instanceDataStorage.instancesBuffer) {
        this._instanceDataStorage.instancesBuffer.dispose();
        this._instanceDataStorage.instancesBuffer = null;
    }
    while (this.instances.length) {
        this.instances[0].dispose();
    }
    for (const kind in this.instancedBuffers) {
        if (this._userInstancedBuffersStorage.vertexBuffers[kind]) {
            this._userInstancedBuffersStorage.vertexBuffers[kind].dispose();
        }
    }
    this._invalidateInstanceVertexArrayObject();
    this.instancedBuffers = {};
};
// Register Class Name
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_8__/* .RegisterClass */ .Y5)("BABYLON.InstancedMesh", InstancedMesh);
//# sourceMappingURL=instancedMesh.js.map

/***/ }),

/***/ 92986:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Q: () => (/* binding */ InstancedLinesMesh),
/* harmony export */   l: () => (/* binding */ LinesMesh)
/* harmony export */ });
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26041);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95616);
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76595);
/* harmony import */ var _Meshes_instancedMesh_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(61440);
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28986);
/* harmony import */ var _Materials_shaderMaterial_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10917);






_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e._LinesMeshParser = (parsedMesh, scene) => {
    return LinesMesh.Parse(parsedMesh, scene);
};
/**
 * Line mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
 */
class LinesMesh extends _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_2__/* .Mesh */ .e {
    _isShaderMaterial(shader) {
        return shader.getClassName() === "ShaderMaterial";
    }
    /**
     * Creates a new LinesMesh
     * @param name defines the name
     * @param scene defines the hosting scene
     * @param parent defines the parent mesh if any
     * @param source defines the optional source LinesMesh used to clone data from
     * @param doNotCloneChildren When cloning, skip cloning child meshes of source, default False.
     * When false, achieved by calling a clone(), also passing False.
     * This will make creation of children, recursive.
     * @param useVertexColor defines if this LinesMesh supports vertex color
     * @param useVertexAlpha defines if this LinesMesh supports vertex alpha
     * @param material material to use to draw the line. If not provided, will create a new one
     */
    constructor(name, scene = null, parent = null, source = null, doNotCloneChildren, 
    /**
     * If vertex color should be applied to the mesh
     */
    useVertexColor, 
    /**
     * If vertex alpha should be applied to the mesh
     */
    useVertexAlpha, material) {
        super(name, scene, parent, source, doNotCloneChildren);
        this.useVertexColor = useVertexColor;
        this.useVertexAlpha = useVertexAlpha;
        /**
         * Color of the line (Default: White)
         */
        this.color = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_0__/* .Color3 */ .v9(1, 1, 1);
        /**
         * Alpha of the line (Default: 1)
         */
        this.alpha = 1;
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        if (source) {
            this.color = source.color.clone();
            this.alpha = source.alpha;
            this.useVertexColor = source.useVertexColor;
            this.useVertexAlpha = source.useVertexAlpha;
        }
        this.intersectionThreshold = 0.1;
        const defines = [];
        const options = {
            attributes: [_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind],
            uniforms: ["world", "viewProjection"],
            needAlphaBlending: true,
            defines: defines,
            useClipPlane: null,
            shaderLanguage: 0 /* ShaderLanguage.GLSL */,
        };
        if (useVertexAlpha === false) {
            options.needAlphaBlending = false;
        }
        else {
            options.defines.push("#define VERTEXALPHA");
        }
        if (!useVertexColor) {
            options.uniforms.push("color");
            this._color4 = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov();
        }
        else {
            options.defines.push("#define VERTEXCOLOR");
            options.attributes.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorKind);
        }
        if (material) {
            this.material = material;
        }
        else {
            const engine = this.getScene().getEngine();
            if (engine.isWebGPU && !LinesMesh.ForceGLSL) {
                this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            }
            options.shaderLanguage = this._shaderLanguage;
            options.extraInitializationsAsync = async () => {
                if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 84935)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 50861))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 5216)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 15450))]);
                }
            };
            this.material = new _Materials_shaderMaterial_js__WEBPACK_IMPORTED_MODULE_5__/* .ShaderMaterial */ .B("colorShader", this.getScene(), "color", options, false);
            this.material.doNotSerialize = true;
        }
    }
    isReady() {
        if (!this._lineMaterial.isReady(this, !!this._userInstancedBuffersStorage || this.hasThinInstances)) {
            return false;
        }
        return super.isReady();
    }
    /**
     * @returns the string "LineMesh"
     */
    getClassName() {
        return "LinesMesh";
    }
    /**
     * @internal
     */
    get material() {
        return this._lineMaterial;
    }
    /**
     * @internal
     */
    set material(value) {
        this._lineMaterial = value;
        this._lineMaterial.fillMode = _Materials_material_js__WEBPACK_IMPORTED_MODULE_4__/* .Material */ .i.LineListDrawMode;
    }
    /**
     * @internal
     */
    get checkCollisions() {
        return false;
    }
    set checkCollisions(value) {
        // Just ignore it
    }
    /**
     * @internal
     */
    _bind(_subMesh, colorEffect) {
        if (!this._geometry) {
            return this;
        }
        // VBOs
        const indexToBind = this.isUnIndexed ? null : this._geometry.getIndexBuffer();
        if (!this._userInstancedBuffersStorage || this.hasThinInstances) {
            this._geometry._bind(colorEffect, indexToBind);
        }
        else {
            this._geometry._bind(colorEffect, indexToBind, this._userInstancedBuffersStorage.vertexBuffers, this._userInstancedBuffersStorage.vertexArrayObjects);
        }
        // Color
        if (!this.useVertexColor && this._isShaderMaterial(this._lineMaterial)) {
            const { r, g, b } = this.color;
            this._color4.set(r, g, b, this.alpha);
            this._lineMaterial.setColor4("color", this._color4);
        }
        return this;
    }
    /**
     * @internal
     */
    _draw(subMesh, fillMode, instancesCount) {
        if (!this._geometry || !this._geometry.getVertexBuffers() || (!this._unIndexed && !this._geometry.getIndexBuffer())) {
            return this;
        }
        const engine = this.getScene().getEngine();
        // Draw order
        if (this._unIndexed) {
            engine.drawArraysType(_Materials_material_js__WEBPACK_IMPORTED_MODULE_4__/* .Material */ .i.LineListDrawMode, subMesh.verticesStart, subMesh.verticesCount, instancesCount);
        }
        else {
            engine.drawElementsType(_Materials_material_js__WEBPACK_IMPORTED_MODULE_4__/* .Material */ .i.LineListDrawMode, subMesh.indexStart, subMesh.indexCount, instancesCount);
        }
        return this;
    }
    /**
     * Disposes of the line mesh
     * @param doNotRecurse If children should be disposed
     * @param disposeMaterialAndTextures This parameter is not used by the LineMesh class
     * @param doNotDisposeMaterial If the material should not be disposed (default: false, meaning the material is disposed)
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    dispose(doNotRecurse, disposeMaterialAndTextures = false, doNotDisposeMaterial) {
        if (!doNotDisposeMaterial) {
            this._lineMaterial.dispose(false, false, true);
        }
        super.dispose(doNotRecurse);
    }
    /**
     * Returns a new LineMesh object cloned from the current one.
     * @param name defines the cloned mesh name
     * @param newParent defines the new mesh parent
     * @param doNotCloneChildren if set to true, none of the mesh children are cloned (false by default)
     * @returns the new mesh
     */
    clone(name, newParent = null, doNotCloneChildren) {
        return new LinesMesh(name, this.getScene(), newParent, this, doNotCloneChildren);
    }
    /**
     * Creates a new InstancedLinesMesh object from the mesh model.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
     * @param name defines the name of the new instance
     * @returns a new InstancedLinesMesh
     */
    createInstance(name) {
        const instance = new InstancedLinesMesh(name, this);
        if (this.instancedBuffers) {
            instance.instancedBuffers = {};
            for (const key in this.instancedBuffers) {
                instance.instancedBuffers[key] = this.instancedBuffers[key];
            }
        }
        return instance;
    }
    /**
     * Serializes this ground mesh
     * @param serializationObject object to write serialization to
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.color = this.color.asArray();
        serializationObject.alpha = this.alpha;
    }
    /**
     * Parses a serialized ground mesh
     * @param parsedMesh the serialized mesh
     * @param scene the scene to create the ground mesh in
     * @returns the created ground mesh
     */
    static Parse(parsedMesh, scene) {
        const result = new LinesMesh(parsedMesh.name, scene);
        result.color = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_0__/* .Color3 */ .v9.FromArray(parsedMesh.color);
        result.alpha = parsedMesh.alpha;
        return result;
    }
}
/**
 * Force all the LineMeshes to compile their default color material to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
LinesMesh.ForceGLSL = false;
/**
 * Creates an instance based on a source LinesMesh
 */
class InstancedLinesMesh extends _Meshes_instancedMesh_js__WEBPACK_IMPORTED_MODULE_3__/* .InstancedMesh */ .Z {
    constructor(name, source) {
        super(name, source);
        this.intersectionThreshold = source.intersectionThreshold;
    }
    /**
     * @returns the string "InstancedLinesMesh".
     */
    getClassName() {
        return "InstancedLinesMesh";
    }
}
//# sourceMappingURL=linesMesh.js.map

/***/ }),

/***/ 76595:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Ez: () => (/* binding */ _CreationDataStorage),
/* harmony export */   _h: () => (/* binding */ _InstancesBatch),
/* harmony export */   e: () => (/* binding */ Mesh)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(998);
/* harmony import */ var _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74609);
/* harmony import */ var _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27152);
/* harmony import */ var _Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80163);
/* harmony import */ var _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(30388);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(26041);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4870);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(95616);
/* harmony import */ var _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(36803);
/* harmony import */ var _geometry_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(27050);
/* harmony import */ var _abstractMesh_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(35985);
/* harmony import */ var _subMesh_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65907);
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(28986);
/* harmony import */ var _Materials_multiMaterial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(55157);
/* harmony import */ var _Loading_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7597);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26877);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(51137);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(56552);
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(45503);
/* harmony import */ var _sceneComponent_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(16945);
/* harmony import */ var _meshLODLevel_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(16400);
























/**
 * @internal
 **/
class _CreationDataStorage {
}
/**
 * @internal
 **/
class _InstanceDataStorage {
    constructor() {
        this.visibleInstances = {};
        this.batchCache = new _InstancesBatch();
        this.batchCacheReplacementModeInFrozenMode = new _InstancesBatch();
        this.instancesBufferSize = 32 * 16 * 4; // let's start with a maximum of 32 instances
    }
}
/**
 * @internal
 **/
class _InstancesBatch {
    constructor() {
        this.mustReturn = false;
        this.visibleInstances = new Array();
        this.renderSelf = [];
        this.hardwareInstancedRendering = [];
    }
}
/**
 * @internal
 **/
class _ThinInstanceDataStorage {
    constructor() {
        this.instancesCount = 0;
        this.matrixBuffer = null;
        this.previousMatrixBuffer = null;
        this.matrixBufferSize = 32 * 16; // let's start with a maximum of 32 thin instances
        this.matrixData = null;
        this.boundingVectors = [];
        this.worldMatrices = null;
    }
}
/**
 * @internal
 **/
class _InternalMeshDataInfo {
    constructor() {
        this._areNormalsFrozen = false; // Will be used by ribbons mainly
        // Will be used to save a source mesh reference, If any
        this._source = null;
        // Will be used to for fast cloned mesh lookup
        this.meshMap = null;
        this._preActivateId = -1;
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this._LODLevels = new Array();
        /** Alternative definition of LOD level, using screen coverage instead of distance */
        this._useLODScreenCoverage = false;
        this._effectiveMaterial = null;
        this._forcedInstanceCount = 0;
        this._overrideRenderingFillMode = null;
    }
}
/**
 * Class used to represent renderable models
 */
class Mesh extends _abstractMesh_js__WEBPACK_IMPORTED_MODULE_12__/* .AbstractMesh */ .u {
    /**
     * Gets the default side orientation.
     * @param orientation the orientation to value to attempt to get
     * @returns the default orientation
     * @internal
     */
    static _GetDefaultSideOrientation(orientation) {
        return orientation || Mesh.FRONTSIDE; // works as Mesh.FRONTSIDE is 0
    }
    /**
     * Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.
     */
    get useLODScreenCoverage() {
        return this._internalMeshDataInfo._useLODScreenCoverage;
    }
    set useLODScreenCoverage(value) {
        this._internalMeshDataInfo._useLODScreenCoverage = value;
        this._sortLODLevels();
    }
    get computeBonesUsingShaders() {
        return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;
    }
    set computeBonesUsingShaders(value) {
        if (this._internalAbstractMeshDataInfo._computeBonesUsingShaders === value) {
            return;
        }
        if (value && this._internalMeshDataInfo._sourcePositions) {
            // switch from software to GPU computation: we need to reset the vertex and normal buffers that have been updated by the software process
            this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind, this._internalMeshDataInfo._sourcePositions, true);
            if (this._internalMeshDataInfo._sourceNormals) {
                this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind, this._internalMeshDataInfo._sourceNormals, true);
            }
            this._internalMeshDataInfo._sourcePositions = null;
            this._internalMeshDataInfo._sourceNormals = null;
        }
        this._internalAbstractMeshDataInfo._computeBonesUsingShaders = value;
        this._markSubMeshesAsAttributesDirty();
    }
    /**
     * An event triggered before rendering the mesh
     */
    get onBeforeRenderObservable() {
        if (!this._internalMeshDataInfo._onBeforeRenderObservable) {
            this._internalMeshDataInfo._onBeforeRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        }
        return this._internalMeshDataInfo._onBeforeRenderObservable;
    }
    /**
     * An event triggered before binding the mesh
     */
    get onBeforeBindObservable() {
        if (!this._internalMeshDataInfo._onBeforeBindObservable) {
            this._internalMeshDataInfo._onBeforeBindObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        }
        return this._internalMeshDataInfo._onBeforeBindObservable;
    }
    /**
     * An event triggered after rendering the mesh
     */
    get onAfterRenderObservable() {
        if (!this._internalMeshDataInfo._onAfterRenderObservable) {
            this._internalMeshDataInfo._onAfterRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        }
        return this._internalMeshDataInfo._onAfterRenderObservable;
    }
    /**
     * An event triggeredbetween rendering pass when using separateCullingPass = true
     */
    get onBetweenPassObservable() {
        if (!this._internalMeshDataInfo._onBetweenPassObservable) {
            this._internalMeshDataInfo._onBetweenPassObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        }
        return this._internalMeshDataInfo._onBetweenPassObservable;
    }
    /**
     * An event triggered before drawing the mesh
     */
    get onBeforeDrawObservable() {
        if (!this._internalMeshDataInfo._onBeforeDrawObservable) {
            this._internalMeshDataInfo._onBeforeDrawObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        }
        return this._internalMeshDataInfo._onBeforeDrawObservable;
    }
    /**
     * Sets a callback to call before drawing the mesh. It is recommended to use onBeforeDrawObservable instead
     */
    set onBeforeDraw(callback) {
        if (this._onBeforeDrawObserver) {
            this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver);
        }
        this._onBeforeDrawObserver = this.onBeforeDrawObservable.add(callback);
    }
    get hasInstances() {
        return this.instances.length > 0;
    }
    get hasThinInstances() {
        return (this.forcedInstanceCount || this._thinInstanceDataStorage.instancesCount || 0) > 0;
    }
    /**
     * Gets or sets the forced number of instances to display.
     * If 0 (default value), the number of instances is not forced and depends on the draw type
     * (regular / instance / thin instances mesh)
     */
    get forcedInstanceCount() {
        return this._internalMeshDataInfo._forcedInstanceCount;
    }
    set forcedInstanceCount(count) {
        this._internalMeshDataInfo._forcedInstanceCount = count;
    }
    /**
     * Use this property to change the original side orientation defined at construction time
     * Material.sideOrientation will override this value if set
     * User will still be able to change the material sideOrientation afterwards if they really need it
     */
    get sideOrientation() {
        return this._internalMeshDataInfo._sideOrientation;
    }
    set sideOrientation(value) {
        this._internalMeshDataInfo._sideOrientation = value;
        this._internalAbstractMeshDataInfo._sideOrientationHint =
            (this._scene.useRightHandedSystem && value === 1) ||
                (!this._scene.useRightHandedSystem && value === 0);
    }
    /**
     * @deprecated Please use sideOrientation instead.
     * @see https://doc.babylonjs.com/breaking-changes#7110
     */
    get overrideMaterialSideOrientation() {
        return this.sideOrientation;
    }
    set overrideMaterialSideOrientation(value) {
        this.sideOrientation = value;
        if (this.material) {
            this.material.sideOrientation = null;
        }
    }
    /**
     * Use this property to override the Material's fillMode value
     */
    get overrideRenderingFillMode() {
        return this._internalMeshDataInfo._overrideRenderingFillMode;
    }
    set overrideRenderingFillMode(fillMode) {
        this._internalMeshDataInfo._overrideRenderingFillMode = fillMode;
    }
    get material() {
        return this._internalAbstractMeshDataInfo._material;
    }
    set material(value) {
        if (value && ((this.material && this.material.sideOrientation === null) || this._internalAbstractMeshDataInfo._sideOrientationHint)) {
            value.sideOrientation = null;
        }
        this._setMaterial(value);
    }
    /**
     * Gets the source mesh (the one used to clone this one from)
     */
    get source() {
        return this._internalMeshDataInfo._source;
    }
    /**
     * Gets the list of clones of this mesh
     * The scene must have been constructed with useClonedMeshMap=true for this to work!
     * Note that useClonedMeshMap=true is the default setting
     */
    get cloneMeshMap() {
        return this._internalMeshDataInfo.meshMap;
    }
    /**
     * Gets or sets a boolean indicating that this mesh does not use index buffer
     */
    get isUnIndexed() {
        return this._unIndexed;
    }
    set isUnIndexed(value) {
        if (this._unIndexed !== value) {
            this._unIndexed = value;
            this._markSubMeshesAsAttributesDirty();
        }
    }
    /** Gets the array buffer used to store the instanced buffer used for instances' world matrices */
    get worldMatrixInstancedBuffer() {
        return this._instanceDataStorage.instancesData;
    }
    /** Gets the array buffer used to store the instanced buffer used for instances' previous world matrices */
    get previousWorldMatrixInstancedBuffer() {
        return this._instanceDataStorage.instancesPreviousData;
    }
    /** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual */
    get manualUpdateOfWorldMatrixInstancedBuffer() {
        return this._instanceDataStorage.manualUpdate;
    }
    set manualUpdateOfWorldMatrixInstancedBuffer(value) {
        this._instanceDataStorage.manualUpdate = value;
    }
    /** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual */
    get manualUpdateOfPreviousWorldMatrixInstancedBuffer() {
        return this._instanceDataStorage.previousManualUpdate;
    }
    set manualUpdateOfPreviousWorldMatrixInstancedBuffer(value) {
        this._instanceDataStorage.previousManualUpdate = value;
    }
    /** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices must be performed in all cases (and notably even in frozen mode) */
    get forceWorldMatrixInstancedBufferUpdate() {
        return this._instanceDataStorage.forceMatrixUpdates;
    }
    set forceWorldMatrixInstancedBufferUpdate(value) {
        this._instanceDataStorage.forceMatrixUpdates = value;
    }
    _copySource(source, doNotCloneChildren, clonePhysicsImpostor = true) {
        const scene = this.getScene();
        // Geometry
        if (source._geometry) {
            source._geometry.applyToMesh(this);
        }
        // Deep copy
        _Misc_deepCopier_js__WEBPACK_IMPORTED_MODULE_2__/* .DeepCopier */ .r.DeepCopy(source, this, [
            "name",
            "material",
            "skeleton",
            "instances",
            "parent",
            "uniqueId",
            "source",
            "metadata",
            "morphTargetManager",
            "hasInstances",
            "worldMatrixInstancedBuffer",
            "previousWorldMatrixInstancedBuffer",
            "hasLODLevels",
            "geometry",
            "isBlocked",
            "areNormalsFrozen",
            "facetNb",
            "isFacetDataEnabled",
            "lightSources",
            "useBones",
            "isAnInstance",
            "collider",
            "edgesRenderer",
            "forward",
            "up",
            "right",
            "absolutePosition",
            "absoluteScaling",
            "absoluteRotationQuaternion",
            "isWorldMatrixFrozen",
            "nonUniformScaling",
            "behaviors",
            "worldMatrixFromCache",
            "hasThinInstances",
            "cloneMeshMap",
            "hasBoundingInfo",
            "physicsBody",
            "physicsImpostor",
        ], ["_poseMatrix"]);
        // Source mesh
        this._internalMeshDataInfo._source = source;
        if (scene.useClonedMeshMap) {
            if (!source._internalMeshDataInfo.meshMap) {
                source._internalMeshDataInfo.meshMap = {};
            }
            source._internalMeshDataInfo.meshMap[this.uniqueId] = this;
        }
        // Construction Params
        // Clone parameters allowing mesh to be updated in case of parametric shapes.
        this._originalBuilderSideOrientation = source._originalBuilderSideOrientation;
        this._creationDataStorage = source._creationDataStorage;
        // Animation ranges
        if (source._ranges) {
            const ranges = source._ranges;
            for (const name in ranges) {
                if (!Object.prototype.hasOwnProperty.call(ranges, name)) {
                    continue;
                }
                if (!ranges[name]) {
                    continue;
                }
                this.createAnimationRange(name, ranges[name].from, ranges[name].to);
            }
        }
        // Metadata
        if (source.metadata && source.metadata.clone) {
            this.metadata = source.metadata.clone();
        }
        else {
            this.metadata = source.metadata;
        }
        this._internalMetadata = source._internalMetadata;
        // Tags
        if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.HasTags(source)) {
            _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.AddTagsTo(this, _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.GetTags(source, true));
        }
        // Enabled. We shouldn't need to check the source's ancestors, as this mesh
        // will have the same ones.
        this.setEnabled(source.isEnabled(false));
        // Parent
        this.parent = source.parent;
        // Pivot
        this.setPivotMatrix(source.getPivotMatrix(), this._postMultiplyPivotMatrix);
        this.id = this.name + "." + source.id;
        // Material
        this.material = source.material;
        if (!doNotCloneChildren) {
            // Children
            const directDescendants = source.getDescendants(true);
            for (let index = 0; index < directDescendants.length; index++) {
                const child = directDescendants[index];
                if (child.clone) {
                    child.clone(this.name + "." + child.name, this);
                }
            }
        }
        // Morphs
        if (source.morphTargetManager) {
            this.morphTargetManager = source.morphTargetManager;
        }
        // Physics clone
        if (scene.getPhysicsEngine) {
            const physicsEngine = scene.getPhysicsEngine();
            if (clonePhysicsImpostor && physicsEngine) {
                if (physicsEngine.getPluginVersion() === 1) {
                    const impostor = physicsEngine.getImpostorForPhysicsObject(source);
                    if (impostor) {
                        this.physicsImpostor = impostor.clone(this);
                    }
                }
                else if (physicsEngine.getPluginVersion() === 2) {
                    if (source.physicsBody) {
                        source.physicsBody.clone(this);
                    }
                }
            }
        }
        // Particles
        for (let index = 0; index < scene.particleSystems.length; index++) {
            const system = scene.particleSystems[index];
            if (system.emitter === source) {
                system.clone(system.name, this);
            }
        }
        // Skeleton
        this.skeleton = source.skeleton;
        this.refreshBoundingInfo(true, true);
        this.computeWorldMatrix(true);
    }
    /**
     * Constructor
     * @param name The value used by scene.getMeshByName() to do a lookup.
     * @param scene The scene to add this mesh to.
     * @param parent The parent of this mesh, if it has one
     * @param source An optional Mesh from which geometry is shared, cloned.
     * @param doNotCloneChildren When cloning, skip cloning child meshes of source, default False.
     *                  When false, achieved by calling a clone(), also passing False.
     *                  This will make creation of children, recursive.
     * @param clonePhysicsImpostor When cloning, include cloning mesh physics impostor, default True.
     */
    constructor(name, scene = null, parent = null, source = null, doNotCloneChildren, clonePhysicsImpostor = true) {
        super(name, scene);
        // Internal data
        this._internalMeshDataInfo = new _InternalMeshDataInfo();
        // Members
        /**
         * Gets the delay loading state of the mesh (when delay loading is turned on)
         * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/incrementalLoading
         */
        this.delayLoadState = 0;
        /**
         * Gets the list of instances created from this mesh
         * it is not supposed to be modified manually.
         * Note also that the order of the InstancedMesh wihin the array is not significant and might change.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
         */
        this.instances = [];
        // Private
        /** @internal */
        this._creationDataStorage = null;
        /** @internal */
        this._geometry = null;
        /** @internal */
        this._instanceDataStorage = new _InstanceDataStorage();
        /** @internal */
        this._thinInstanceDataStorage = new _ThinInstanceDataStorage();
        /** @internal */
        this._shouldGenerateFlatShading = false;
        // Use by builder only to know what orientation were the mesh build in.
        /** @internal */
        this._originalBuilderSideOrientation = Mesh.DEFAULTSIDE;
        /**
         * Gets or sets a boolean indicating whether to render ignoring the active camera's max z setting. (false by default)
         * You should not mix meshes that have this property set to true with meshes that have it set to false if they all write
         * to the depth buffer, because the z-values are not comparable in the two cases and you will get rendering artifacts if you do.
         * You can set the property to true for meshes that do not write to the depth buffer, or set the same value (either false or true) otherwise.
         * Note this will reduce performance when set to true.
         */
        this.ignoreCameraMaxZ = false;
        scene = this.getScene();
        if (this._scene.useRightHandedSystem) {
            this.sideOrientation = 0;
        }
        else {
            this.sideOrientation = 1;
        }
        this._onBeforeDraw = (isInstance, world, effectiveMaterial) => {
            if (isInstance && effectiveMaterial) {
                if (this._uniformBuffer) {
                    this.transferToEffect(world);
                }
                else {
                    effectiveMaterial.bindOnlyWorldMatrix(world);
                }
            }
        };
        if (source) {
            this._copySource(source, doNotCloneChildren, clonePhysicsImpostor);
        }
        // Parent
        if (parent !== null) {
            this.parent = parent;
        }
        this._instanceDataStorage.hardwareInstancedRendering = this.getEngine().getCaps().instancedArrays;
        this._internalMeshDataInfo._onMeshReadyObserverAdded = (observer) => {
            // only notify once! then unregister the observer
            observer.unregisterOnNextCall = true;
            if (this.isReady(true)) {
                this.onMeshReadyObservable.notifyObservers(this);
            }
            else {
                if (!this._internalMeshDataInfo._checkReadinessObserver) {
                    this._internalMeshDataInfo._checkReadinessObserver = this._scene.onBeforeRenderObservable.add(() => {
                        // check for complete readiness
                        if (this.isReady(true)) {
                            this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver);
                            this._internalMeshDataInfo._checkReadinessObserver = null;
                            this.onMeshReadyObservable.notifyObservers(this);
                        }
                    });
                }
            }
        };
        this.onMeshReadyObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP(this._internalMeshDataInfo._onMeshReadyObserverAdded);
        if (source) {
            source.onClonedObservable.notifyObservers(this);
        }
    }
    instantiateHierarchy(newParent = null, options, onNewNodeCreated) {
        const instance = this.getTotalVertices() === 0 || (options && options.doNotInstantiate && (options.doNotInstantiate === true || options.doNotInstantiate(this)))
            ? this.clone("Clone of " + (this.name || this.id), newParent || this.parent, true)
            : this.createInstance("instance of " + (this.name || this.id));
        instance.parent = newParent || this.parent;
        instance.position = this.position.clone();
        instance.scaling = this.scaling.clone();
        if (this.rotationQuaternion) {
            instance.rotationQuaternion = this.rotationQuaternion.clone();
        }
        else {
            instance.rotation = this.rotation.clone();
        }
        if (onNewNodeCreated) {
            onNewNodeCreated(this, instance);
        }
        for (const child of this.getChildTransformNodes(true)) {
            // instancedMesh should have a different sourced mesh
            if (child.getClassName() === "InstancedMesh" && instance.getClassName() === "Mesh" && child.sourceMesh === this) {
                child.instantiateHierarchy(instance, {
                    doNotInstantiate: (options && options.doNotInstantiate) || false,
                    newSourcedMesh: instance,
                }, onNewNodeCreated);
            }
            else {
                child.instantiateHierarchy(instance, options, onNewNodeCreated);
            }
        }
        return instance;
    }
    /**
     * Gets the class name
     * @returns the string "Mesh".
     */
    getClassName() {
        return "Mesh";
    }
    /** @internal */
    get _isMesh() {
        return true;
    }
    /**
     * Returns a description of this mesh
     * @param fullDetails define if full details about this mesh must be used
     * @returns a descriptive string representing this mesh
     */
    toString(fullDetails) {
        let ret = super.toString(fullDetails);
        ret += ", n vertices: " + this.getTotalVertices();
        ret += ", parent: " + (this._waitingParentId ? this._waitingParentId : this.parent ? this.parent.name : "NONE");
        if (this.animations) {
            for (let i = 0; i < this.animations.length; i++) {
                ret += ", animation[0]: " + this.animations[i].toString(fullDetails);
            }
        }
        if (fullDetails) {
            if (this._geometry) {
                const ib = this.getIndices();
                const vb = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind);
                if (vb && ib) {
                    ret += ", flat shading: " + (vb.length / 3 === ib.length ? "YES" : "NO");
                }
            }
            else {
                ret += ", flat shading: UNKNOWN";
            }
        }
        return ret;
    }
    /** @internal */
    _unBindEffect() {
        super._unBindEffect();
        for (const instance of this.instances) {
            instance._unBindEffect();
        }
    }
    /**
     * Gets a boolean indicating if this mesh has LOD
     */
    get hasLODLevels() {
        return this._internalMeshDataInfo._LODLevels.length > 0;
    }
    /**
     * Gets the list of MeshLODLevel associated with the current mesh
     * @returns an array of MeshLODLevel
     */
    getLODLevels() {
        return this._internalMeshDataInfo._LODLevels;
    }
    _sortLODLevels() {
        const sortingOrderFactor = this._internalMeshDataInfo._useLODScreenCoverage ? -1 : 1;
        this._internalMeshDataInfo._LODLevels.sort((a, b) => {
            if (a.distanceOrScreenCoverage < b.distanceOrScreenCoverage) {
                return sortingOrderFactor;
            }
            if (a.distanceOrScreenCoverage > b.distanceOrScreenCoverage) {
                return -sortingOrderFactor;
            }
            return 0;
        });
    }
    /**
     * Add a mesh as LOD level triggered at the given distance.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
     * @param distanceOrScreenCoverage Either distance from the center of the object to show this level or the screen coverage if `useScreenCoverage` is set to `true`.
     * If screen coverage, value is a fraction of the screen's total surface, between 0 and 1.
     * Example Playground for distance https://playground.babylonjs.com/#QE7KM#197
     * Example Playground for screen coverage https://playground.babylonjs.com/#QE7KM#196
     * @param mesh The mesh to be added as LOD level (can be null)
     * @returns This mesh (for chaining)
     */
    addLODLevel(distanceOrScreenCoverage, mesh) {
        if (mesh && mesh._masterMesh) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__/* .Logger */ .V.Warn("You cannot use a mesh as LOD level twice");
            return this;
        }
        const level = new _meshLODLevel_js__WEBPACK_IMPORTED_MODULE_22__/* .MeshLODLevel */ .L(distanceOrScreenCoverage, mesh);
        this._internalMeshDataInfo._LODLevels.push(level);
        if (mesh) {
            mesh._masterMesh = this;
        }
        this._sortLODLevels();
        return this;
    }
    /**
     * Returns the LOD level mesh at the passed distance or null if not found.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
     * @param distance The distance from the center of the object to show this level
     * @returns a Mesh or `null`
     */
    getLODLevelAtDistance(distance) {
        const internalDataInfo = this._internalMeshDataInfo;
        for (let index = 0; index < internalDataInfo._LODLevels.length; index++) {
            const level = internalDataInfo._LODLevels[index];
            if (level.distanceOrScreenCoverage === distance) {
                return level.mesh;
            }
        }
        return null;
    }
    /**
     * Remove a mesh from the LOD array
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
     * @param mesh defines the mesh to be removed
     * @returns This mesh (for chaining)
     */
    removeLODLevel(mesh) {
        const internalDataInfo = this._internalMeshDataInfo;
        for (let index = 0; index < internalDataInfo._LODLevels.length; index++) {
            if (internalDataInfo._LODLevels[index].mesh === mesh) {
                internalDataInfo._LODLevels.splice(index, 1);
                if (mesh) {
                    mesh._masterMesh = null;
                }
            }
        }
        this._sortLODLevels();
        return this;
    }
    /**
     * Returns the registered LOD mesh distant from the parameter `camera` position if any, else returns the current mesh.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
     * @param camera defines the camera to use to compute distance
     * @param boundingSphere defines a custom bounding sphere to use instead of the one from this mesh
     * @returns This mesh (for chaining)
     */
    getLOD(camera, boundingSphere) {
        const internalDataInfo = this._internalMeshDataInfo;
        if (!internalDataInfo._LODLevels || internalDataInfo._LODLevels.length === 0) {
            return this;
        }
        const bSphere = boundingSphere || this.getBoundingInfo().boundingSphere;
        const distanceToCamera = camera.mode === _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_5__/* .Camera */ .i.ORTHOGRAPHIC_CAMERA ? camera.minZ : bSphere.centerWorld.subtract(camera.globalPosition).length();
        let compareValue = distanceToCamera;
        let compareSign = 1;
        if (internalDataInfo._useLODScreenCoverage) {
            const screenArea = camera.screenArea;
            let meshArea = (bSphere.radiusWorld * camera.minZ) / distanceToCamera;
            meshArea = meshArea * meshArea * Math.PI;
            compareValue = meshArea / screenArea;
            compareSign = -1;
        }
        if (compareSign * internalDataInfo._LODLevels[internalDataInfo._LODLevels.length - 1].distanceOrScreenCoverage > compareSign * compareValue) {
            if (this.onLODLevelSelection) {
                this.onLODLevelSelection(compareValue, this, this);
            }
            return this;
        }
        for (let index = 0; index < internalDataInfo._LODLevels.length; index++) {
            const level = internalDataInfo._LODLevels[index];
            if (compareSign * level.distanceOrScreenCoverage < compareSign * compareValue) {
                if (level.mesh) {
                    if (level.mesh.delayLoadState === 4) {
                        level.mesh._checkDelayState();
                        return this;
                    }
                    if (level.mesh.delayLoadState === 2) {
                        return this;
                    }
                    level.mesh._preActivate();
                    level.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);
                }
                if (this.onLODLevelSelection) {
                    this.onLODLevelSelection(compareValue, this, level.mesh);
                }
                return level.mesh;
            }
        }
        if (this.onLODLevelSelection) {
            this.onLODLevelSelection(compareValue, this, this);
        }
        return this;
    }
    /**
     * Gets the mesh internal Geometry object
     */
    get geometry() {
        return this._geometry;
    }
    /**
     * Returns the total number of vertices within the mesh geometry or zero if the mesh has no geometry.
     * @returns the total number of vertices
     */
    getTotalVertices() {
        if (this._geometry === null || this._geometry === undefined) {
            return 0;
        }
        return this._geometry.getTotalVertices();
    }
    /**
     * Returns the content of an associated vertex buffer
     * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     * @param copyWhenShared defines a boolean indicating that if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one
     * @param forceCopy defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
     * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
     * @returns a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind.
     */
    getVerticesData(kind, copyWhenShared, forceCopy, bypassInstanceData) {
        if (!this._geometry) {
            return null;
        }
        let data = bypassInstanceData
            ? undefined
            : this._userInstancedBuffersStorage?.vertexBuffers[kind]?.getFloatData(this.instances.length + 1, // +1 because the master mesh is not included in the instances array
            forceCopy || (copyWhenShared && this._geometry.meshes.length !== 1));
        if (!data) {
            data = this._geometry.getVerticesData(kind, copyWhenShared, forceCopy);
        }
        return data;
    }
    copyVerticesData(kind, vertexData) {
        if (this._geometry) {
            this._geometry.copyVerticesData(kind, vertexData);
        }
    }
    /**
     * Returns the mesh VertexBuffer object from the requested `kind`
     * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.NormalKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
     * @returns a FloatArray or null if the mesh has no vertex buffer for this kind.
     */
    getVertexBuffer(kind, bypassInstanceData) {
        if (!this._geometry) {
            return null;
        }
        return (bypassInstanceData ? undefined : this._userInstancedBuffersStorage?.vertexBuffers[kind]) ?? this._geometry.getVertexBuffer(kind);
    }
    /**
     * Tests if a specific vertex buffer is associated with this mesh
     * @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.NormalKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
     * @returns a boolean
     */
    isVerticesDataPresent(kind, bypassInstanceData) {
        if (!this._geometry) {
            if (this._delayInfo) {
                return this._delayInfo.indexOf(kind) !== -1;
            }
            return false;
        }
        return (!bypassInstanceData && this._userInstancedBuffersStorage?.vertexBuffers[kind] !== undefined) || this._geometry.isVerticesDataPresent(kind);
    }
    /**
     * Returns a boolean defining if the vertex data for the requested `kind` is updatable.
     * @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
     * @returns a boolean
     */
    isVertexBufferUpdatable(kind, bypassInstanceData) {
        if (!this._geometry) {
            if (this._delayInfo) {
                return this._delayInfo.indexOf(kind) !== -1;
            }
            return false;
        }
        if (!bypassInstanceData) {
            const buffer = this._userInstancedBuffersStorage?.vertexBuffers[kind];
            if (buffer) {
                return buffer.isUpdatable();
            }
        }
        return this._geometry.isVertexBufferUpdatable(kind);
    }
    /**
     * Returns a string which contains the list of existing `kinds` of Vertex Data associated with this mesh.
     * @param bypassInstanceData defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
     * @returns an array of strings
     */
    getVerticesDataKinds(bypassInstanceData) {
        if (!this._geometry) {
            const result = [];
            if (this._delayInfo) {
                this._delayInfo.forEach(function (kind) {
                    result.push(kind);
                });
            }
            return result;
        }
        const kinds = this._geometry.getVerticesDataKinds();
        if (!bypassInstanceData && this._userInstancedBuffersStorage) {
            for (const kind in this._userInstancedBuffersStorage.vertexBuffers) {
                if (kinds.indexOf(kind) === -1) {
                    kinds.push(kind);
                }
            }
        }
        return kinds;
    }
    /**
     * Returns a positive integer : the total number of indices in this mesh geometry.
     * @returns the numner of indices or zero if the mesh has no geometry.
     */
    getTotalIndices() {
        if (!this._geometry) {
            return 0;
        }
        return this._geometry.getTotalIndices();
    }
    /**
     * Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
     * @param copyWhenShared If true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.
     * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
     * @returns the indices array or an empty array if the mesh has no geometry
     */
    getIndices(copyWhenShared, forceCopy) {
        if (!this._geometry) {
            return [];
        }
        return this._geometry.getIndices(copyWhenShared, forceCopy);
    }
    get isBlocked() {
        return this._masterMesh !== null && this._masterMesh !== undefined;
    }
    /**
     * Determine if the current mesh is ready to be rendered
     * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
     * @param forceInstanceSupport will check if the mesh will be ready when used with instances (false by default)
     * @returns true if all associated assets are ready (material, textures, shaders)
     */
    isReady(completeCheck = false, forceInstanceSupport = false) {
        if (this.delayLoadState === 2) {
            return false;
        }
        if (!super.isReady(completeCheck)) {
            return false;
        }
        if (!this.subMeshes || this.subMeshes.length === 0) {
            return true;
        }
        if (!completeCheck) {
            return true;
        }
        const engine = this.getEngine();
        const scene = this.getScene();
        const hardwareInstancedRendering = forceInstanceSupport || (engine.getCaps().instancedArrays && (this.instances.length > 0 || this.hasThinInstances));
        this.computeWorldMatrix();
        const mat = this.material || scene.defaultMaterial;
        if (mat) {
            if (mat._storeEffectOnSubMeshes) {
                for (const subMesh of this.subMeshes) {
                    const effectiveMaterial = subMesh.getMaterial();
                    if (effectiveMaterial) {
                        if (effectiveMaterial._storeEffectOnSubMeshes) {
                            if (!effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) {
                                return false;
                            }
                        }
                        else {
                            if (!effectiveMaterial.isReady(this, hardwareInstancedRendering)) {
                                return false;
                            }
                        }
                    }
                }
            }
            else {
                if (!mat.isReady(this, hardwareInstancedRendering)) {
                    return false;
                }
            }
        }
        // Shadows
        const currentRenderPassId = engine.currentRenderPassId;
        for (const light of this.lightSources) {
            const generators = light.getShadowGenerators();
            if (!generators) {
                continue;
            }
            const iterator = generators.values();
            for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
                const generator = key.value;
                if (generator && (!generator.getShadowMap()?.renderList || (generator.getShadowMap()?.renderList && generator.getShadowMap()?.renderList?.indexOf(this) !== -1))) {
                    const shadowMap = generator.getShadowMap();
                    const renderPassIds = shadowMap.renderPassIds ?? [engine.currentRenderPassId];
                    for (let p = 0; p < renderPassIds.length; ++p) {
                        engine.currentRenderPassId = renderPassIds[p];
                        for (const subMesh of this.subMeshes) {
                            if (!generator.isReady(subMesh, hardwareInstancedRendering, subMesh.getMaterial()?.needAlphaBlendingForMesh(this) ?? false)) {
                                engine.currentRenderPassId = currentRenderPassId;
                                return false;
                            }
                        }
                    }
                    engine.currentRenderPassId = currentRenderPassId;
                }
            }
        }
        // LOD
        for (const lod of this._internalMeshDataInfo._LODLevels) {
            if (lod.mesh && !lod.mesh.isReady(hardwareInstancedRendering)) {
                return false;
            }
        }
        return true;
    }
    /**
     * Gets a boolean indicating if the normals aren't to be recomputed on next mesh `positions` array update. This property is pertinent only for updatable parametric shapes.
     */
    get areNormalsFrozen() {
        return this._internalMeshDataInfo._areNormalsFrozen;
    }
    /**
     * This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It prevents the mesh normals from being recomputed on next `positions` array update.
     * @returns the current mesh
     */
    freezeNormals() {
        this._internalMeshDataInfo._areNormalsFrozen = true;
        return this;
    }
    /**
     * This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It reactivates the mesh normals computation if it was previously frozen
     * @returns the current mesh
     */
    unfreezeNormals() {
        this._internalMeshDataInfo._areNormalsFrozen = false;
        return this;
    }
    /**
     * Sets a value overriding the instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs
     */
    set overridenInstanceCount(count) {
        this._instanceDataStorage.overridenInstanceCount = count;
    }
    // Methods
    /** @internal */
    _preActivate() {
        const internalDataInfo = this._internalMeshDataInfo;
        const sceneRenderId = this.getScene().getRenderId();
        if (internalDataInfo._preActivateId === sceneRenderId) {
            return this;
        }
        internalDataInfo._preActivateId = sceneRenderId;
        this._instanceDataStorage.visibleInstances = null;
        return this;
    }
    /**
     * @internal
     */
    _preActivateForIntermediateRendering(renderId) {
        if (this._instanceDataStorage.visibleInstances) {
            this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId = renderId;
        }
        return this;
    }
    /**
     * @internal
     */
    _registerInstanceForRenderId(instance, renderId) {
        if (!this._instanceDataStorage.visibleInstances) {
            this._instanceDataStorage.visibleInstances = {
                defaultRenderId: renderId,
                selfDefaultRenderId: this._renderId,
            };
        }
        if (!this._instanceDataStorage.visibleInstances[renderId]) {
            if (this._instanceDataStorage.previousRenderId !== undefined && this._instanceDataStorage.isFrozen) {
                this._instanceDataStorage.visibleInstances[this._instanceDataStorage.previousRenderId] = null;
            }
            this._instanceDataStorage.previousRenderId = renderId;
            this._instanceDataStorage.visibleInstances[renderId] = new Array();
        }
        this._instanceDataStorage.visibleInstances[renderId].push(instance);
        return this;
    }
    _afterComputeWorldMatrix() {
        super._afterComputeWorldMatrix();
        if (!this.hasThinInstances) {
            return;
        }
        if (!this.doNotSyncBoundingInfo) {
            this.thinInstanceRefreshBoundingInfo(false);
        }
    }
    /** @internal */
    _postActivate() {
        if (this.edgesShareWithInstances && this.edgesRenderer && this.edgesRenderer.isEnabled && this._renderingGroup) {
            this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer);
            this.edgesRenderer.customInstances.push(this.getWorldMatrix());
        }
    }
    /**
     * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
     * This means the mesh underlying bounding box and sphere are recomputed.
     * @param applySkeletonOrOptions defines whether to apply the skeleton before computing the bounding info or a set of options
     * @param applyMorph defines whether to apply the morph target before computing the bounding info
     * @returns the current mesh
     */
    refreshBoundingInfo(applySkeletonOrOptions = false, applyMorph = false) {
        if (this.hasBoundingInfo && this.getBoundingInfo().isLocked) {
            return this;
        }
        let options;
        if (typeof applySkeletonOrOptions === "object") {
            options = applySkeletonOrOptions;
        }
        else {
            options = {
                applySkeleton: applySkeletonOrOptions,
                applyMorph: applyMorph,
            };
        }
        const bias = this.geometry ? this.geometry.boundingBias : null;
        this._refreshBoundingInfo(this._getData(options, null, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind), bias);
        return this;
    }
    /**
     * @internal
     */
    _createGlobalSubMesh(force) {
        const totalVertices = this.getTotalVertices();
        if (!totalVertices || !this.getIndices()) {
            return null;
        }
        // Check if we need to recreate the submeshes
        if (this.subMeshes && this.subMeshes.length > 0) {
            const ib = this.getIndices();
            if (!ib) {
                return null;
            }
            const totalIndices = ib.length;
            let needToRecreate = false;
            if (force) {
                needToRecreate = true;
            }
            else {
                for (const submesh of this.subMeshes) {
                    if (submesh.indexStart + submesh.indexCount > totalIndices) {
                        needToRecreate = true;
                        break;
                    }
                    if (submesh.verticesStart + submesh.verticesCount > totalVertices) {
                        needToRecreate = true;
                        break;
                    }
                }
            }
            if (!needToRecreate) {
                return this.subMeshes[0];
            }
        }
        this.releaseSubMeshes();
        return new _subMesh_js__WEBPACK_IMPORTED_MODULE_13__/* .SubMesh */ .K(0, 0, totalVertices, 0, this.getTotalIndices(), this);
    }
    /**
     * This function will subdivide the mesh into multiple submeshes
     * @param count defines the expected number of submeshes
     */
    subdivide(count) {
        if (count < 1) {
            return;
        }
        const totalIndices = this.getTotalIndices();
        let subdivisionSize = (totalIndices / count) | 0;
        let offset = 0;
        // Ensure that subdivisionSize is a multiple of 3
        while (subdivisionSize % 3 !== 0) {
            subdivisionSize++;
        }
        this.releaseSubMeshes();
        for (let index = 0; index < count; index++) {
            if (offset >= totalIndices) {
                break;
            }
            _subMesh_js__WEBPACK_IMPORTED_MODULE_13__/* .SubMesh */ .K.CreateFromIndices(0, offset, index === count - 1 ? totalIndices - offset : subdivisionSize, this, undefined, false);
            offset += subdivisionSize;
        }
        this.refreshBoundingInfo();
        this.synchronizeInstances();
    }
    /**
     * Copy a FloatArray into a specific associated vertex buffer
     * @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     * @param data defines the data source
     * @param updatable defines if the updated vertex buffer must be flagged as updatable
     * @param stride defines the data stride size (can be null)
     * @returns the current mesh
     */
    setVerticesData(kind, data, updatable = false, stride) {
        if (!this._geometry) {
            const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P();
            vertexData.set(data, kind);
            const scene = this.getScene();
            new _geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V(_geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V.RandomId(), scene, vertexData, updatable, this);
        }
        else {
            this._geometry.setVerticesData(kind, data, updatable, stride);
        }
        return this;
    }
    /**
     * Delete a vertex buffer associated with this mesh
     * @param kind defines which buffer to delete (positions, indices, normals, etc). Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     */
    removeVerticesData(kind) {
        if (!this._geometry) {
            return;
        }
        this._geometry.removeVerticesData(kind);
    }
    /**
     * Flags an associated vertex buffer as updatable
     * @param kind defines which buffer to use (positions, indices, normals, etc). Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     * @param updatable defines if the updated vertex buffer must be flagged as updatable
     */
    markVerticesDataAsUpdatable(kind, updatable = true) {
        const vb = this.getVertexBuffer(kind);
        if (!vb || vb.isUpdatable() === updatable) {
            return;
        }
        this.setVerticesData(kind, this.getVerticesData(kind), updatable);
    }
    /**
     * Sets the mesh global Vertex Buffer
     * @param buffer defines the buffer to use
     * @param disposeExistingBuffer disposes the existing buffer, if any (default: true)
     * @returns the current mesh
     */
    setVerticesBuffer(buffer, disposeExistingBuffer = true) {
        if (!this._geometry) {
            this._geometry = _geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V.CreateGeometryForMesh(this);
        }
        this._geometry.setVerticesBuffer(buffer, null, disposeExistingBuffer);
        return this;
    }
    /**
     * Update a specific associated vertex buffer
     * @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values :
     * - VertexBuffer.PositionKind
     * - VertexBuffer.UVKind
     * - VertexBuffer.UV2Kind
     * - VertexBuffer.UV3Kind
     * - VertexBuffer.UV4Kind
     * - VertexBuffer.UV5Kind
     * - VertexBuffer.UV6Kind
     * - VertexBuffer.ColorKind
     * - VertexBuffer.MatricesIndicesKind
     * - VertexBuffer.MatricesIndicesExtraKind
     * - VertexBuffer.MatricesWeightsKind
     * - VertexBuffer.MatricesWeightsExtraKind
     * @param data defines the data source
     * @param updateExtends defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
     * @param makeItUnique defines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry)
     * @returns the current mesh
     */
    updateVerticesData(kind, data, updateExtends, makeItUnique) {
        if (!this._geometry) {
            return this;
        }
        if (!makeItUnique) {
            this._geometry.updateVerticesData(kind, data, updateExtends);
        }
        else {
            this.makeGeometryUnique();
            this.updateVerticesData(kind, data, updateExtends, false);
        }
        return this;
    }
    /**
     * This method updates the vertex positions of an updatable mesh according to the `positionFunction` returned values.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#other-shapes-updatemeshpositions
     * @param positionFunction is a simple JS function what is passed the mesh `positions` array. It doesn't need to return anything
     * @param computeNormals is a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update
     * @returns the current mesh
     */
    updateMeshPositions(positionFunction, computeNormals = true) {
        const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind);
        if (!positions) {
            return this;
        }
        positionFunction(positions);
        this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind, positions, false, false);
        if (computeNormals) {
            const indices = this.getIndices();
            const normals = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind);
            if (!normals) {
                return this;
            }
            _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.ComputeNormals(positions, indices, normals);
            this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind, normals, false, false);
        }
        return this;
    }
    /**
     * Creates a un-shared specific occurence of the geometry for the mesh.
     * @returns the current mesh
     */
    makeGeometryUnique() {
        if (!this._geometry) {
            return this;
        }
        if (this._geometry.meshes.length === 1) {
            return this;
        }
        const oldGeometry = this._geometry;
        const geometry = this._geometry.copy(_geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V.RandomId());
        oldGeometry.releaseForMesh(this, true);
        geometry.applyToMesh(this);
        return this;
    }
    /**
     * Sets the index buffer of this mesh.
     * @param indexBuffer Defines the index buffer to use for this mesh
     * @param totalVertices Defines the total number of vertices used by the buffer
     * @param totalIndices Defines the total number of indices in the index buffer
     */
    setIndexBuffer(indexBuffer, totalVertices, totalIndices) {
        let geometry = this._geometry;
        if (!geometry) {
            geometry = new _geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V(_geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V.RandomId(), this.getScene(), undefined, undefined, this);
        }
        geometry.setIndexBuffer(indexBuffer, totalVertices, totalIndices);
    }
    /**
     * Set the index buffer of this mesh
     * @param indices defines the source data
     * @param totalVertices defines the total number of vertices referenced by this index data (can be null)
     * @param updatable defines if the updated index buffer must be flagged as updatable (default is false)
     * @param dontForceSubMeshRecreation defines a boolean indicating that we don't want to force the recreation of sub-meshes if we don't have to (false by default)
     * @returns the current mesh
     */
    setIndices(indices, totalVertices = null, updatable = false, dontForceSubMeshRecreation = false) {
        if (!this._geometry) {
            const vertexData = new _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P();
            vertexData.indices = indices;
            const scene = this.getScene();
            new _geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V(_geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V.RandomId(), scene, vertexData, updatable, this);
        }
        else {
            this._geometry.setIndices(indices, totalVertices, updatable, dontForceSubMeshRecreation);
        }
        return this;
    }
    /**
     * Update the current index buffer
     * @param indices defines the source data
     * @param offset defines the offset in the index buffer where to store the new data (can be null)
     * @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
     * @returns the current mesh
     */
    updateIndices(indices, offset, gpuMemoryOnly = false) {
        if (!this._geometry) {
            return this;
        }
        this._geometry.updateIndices(indices, offset, gpuMemoryOnly);
        return this;
    }
    /**
     * Invert the geometry to move from a right handed system to a left handed one.
     * @returns the current mesh
     */
    toLeftHanded() {
        if (!this._geometry) {
            return this;
        }
        this._geometry.toLeftHanded();
        return this;
    }
    /**
     * @internal
     */
    _bind(subMesh, effect, fillMode, allowInstancedRendering = true) {
        if (!this._geometry) {
            return this;
        }
        const engine = this.getScene().getEngine();
        // Wireframe
        let indexToBind;
        if (this._unIndexed) {
            switch (this._getRenderingFillMode(fillMode)) {
                case _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.WireFrameFillMode:
                    indexToBind = subMesh._getLinesIndexBuffer(this.getIndices(), engine);
                    break;
                default:
                    indexToBind = null;
                    break;
            }
        }
        else {
            switch (this._getRenderingFillMode(fillMode)) {
                case _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.PointFillMode:
                    indexToBind = null;
                    break;
                case _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.WireFrameFillMode:
                    indexToBind = subMesh._getLinesIndexBuffer(this.getIndices(), engine);
                    break;
                default:
                case _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.TriangleFillMode:
                    indexToBind = this._geometry.getIndexBuffer();
                    break;
            }
        }
        return this._bindDirect(effect, indexToBind, allowInstancedRendering);
    }
    /**
     * @internal
     */
    _bindDirect(effect, indexToBind, allowInstancedRendering = true) {
        if (!this._geometry) {
            return this;
        }
        // Morph targets
        if (this.morphTargetManager && this.morphTargetManager.isUsingTextureForTargets) {
            this.morphTargetManager._bind(effect);
        }
        // VBOs
        if (!allowInstancedRendering || !this._userInstancedBuffersStorage || this.hasThinInstances) {
            this._geometry._bind(effect, indexToBind);
        }
        else {
            this._geometry._bind(effect, indexToBind, this._userInstancedBuffersStorage.vertexBuffers, this._userInstancedBuffersStorage.vertexArrayObjects);
        }
        return this;
    }
    /**
     * @internal
     */
    _draw(subMesh, fillMode, instancesCount) {
        if (!this._geometry || !this._geometry.getVertexBuffers() || (!this._unIndexed && !this._geometry.getIndexBuffer())) {
            return this;
        }
        if (this._internalMeshDataInfo._onBeforeDrawObservable) {
            this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);
        }
        const scene = this.getScene();
        const engine = scene.getEngine();
        if ((this._unIndexed && fillMode !== _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.WireFrameFillMode) || fillMode == _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.PointFillMode) {
            // or triangles as points
            engine.drawArraysType(fillMode, subMesh.verticesStart, subMesh.verticesCount, this.forcedInstanceCount || instancesCount);
        }
        else if (fillMode == _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.WireFrameFillMode) {
            // Triangles as wireframe
            engine.drawElementsType(fillMode, 0, subMesh._linesIndexCount, this.forcedInstanceCount || instancesCount);
        }
        else {
            engine.drawElementsType(fillMode, subMesh.indexStart, subMesh.indexCount, this.forcedInstanceCount || instancesCount);
        }
        return this;
    }
    /**
     * Registers for this mesh a javascript function called just before the rendering process
     * @param func defines the function to call before rendering this mesh
     * @returns the current mesh
     */
    registerBeforeRender(func) {
        this.onBeforeRenderObservable.add(func);
        return this;
    }
    /**
     * Disposes a previously registered javascript function called before the rendering
     * @param func defines the function to remove
     * @returns the current mesh
     */
    unregisterBeforeRender(func) {
        this.onBeforeRenderObservable.removeCallback(func);
        return this;
    }
    /**
     * Registers for this mesh a javascript function called just after the rendering is complete
     * @param func defines the function to call after rendering this mesh
     * @returns the current mesh
     */
    registerAfterRender(func) {
        this.onAfterRenderObservable.add(func);
        return this;
    }
    /**
     * Disposes a previously registered javascript function called after the rendering.
     * @param func defines the function to remove
     * @returns the current mesh
     */
    unregisterAfterRender(func) {
        this.onAfterRenderObservable.removeCallback(func);
        return this;
    }
    /**
     * @internal
     */
    _getInstancesRenderList(subMeshId, isReplacementMode = false) {
        if (this._instanceDataStorage.isFrozen) {
            if (isReplacementMode) {
                this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[subMeshId] = false;
                this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.renderSelf[subMeshId] = true;
                return this._instanceDataStorage.batchCacheReplacementModeInFrozenMode;
            }
            if (this._instanceDataStorage.previousBatch) {
                return this._instanceDataStorage.previousBatch;
            }
        }
        const scene = this.getScene();
        const isInIntermediateRendering = scene._isInIntermediateRendering();
        const onlyForInstances = isInIntermediateRendering
            ? this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate
            : this._internalAbstractMeshDataInfo._onlyForInstances;
        const batchCache = this._instanceDataStorage.batchCache;
        batchCache.mustReturn = false;
        batchCache.renderSelf[subMeshId] = isReplacementMode || (!onlyForInstances && this.isEnabled() && this.isVisible);
        batchCache.visibleInstances[subMeshId] = null;
        if (this._instanceDataStorage.visibleInstances && !isReplacementMode) {
            const visibleInstances = this._instanceDataStorage.visibleInstances;
            const currentRenderId = scene.getRenderId();
            const defaultRenderId = isInIntermediateRendering ? visibleInstances.intermediateDefaultRenderId : visibleInstances.defaultRenderId;
            batchCache.visibleInstances[subMeshId] = visibleInstances[currentRenderId];
            if (!batchCache.visibleInstances[subMeshId] && defaultRenderId) {
                batchCache.visibleInstances[subMeshId] = visibleInstances[defaultRenderId];
            }
        }
        batchCache.hardwareInstancedRendering[subMeshId] =
            !isReplacementMode &&
                this._instanceDataStorage.hardwareInstancedRendering &&
                batchCache.visibleInstances[subMeshId] !== null &&
                batchCache.visibleInstances[subMeshId] !== undefined;
        this._instanceDataStorage.previousBatch = batchCache;
        return batchCache;
    }
    /**
     * @internal
     */
    _renderWithInstances(subMesh, fillMode, batch, effect, engine) {
        const visibleInstances = batch.visibleInstances[subMesh._id];
        const visibleInstanceCount = visibleInstances ? visibleInstances.length : 0;
        const instanceStorage = this._instanceDataStorage;
        const currentInstancesBufferSize = instanceStorage.instancesBufferSize;
        let instancesBuffer = instanceStorage.instancesBuffer;
        let instancesPreviousBuffer = instanceStorage.instancesPreviousBuffer;
        const matricesCount = visibleInstanceCount + 1;
        const bufferSize = matricesCount * 16 * 4;
        while (instanceStorage.instancesBufferSize < bufferSize) {
            instanceStorage.instancesBufferSize *= 2;
        }
        if (!instanceStorage.instancesData || currentInstancesBufferSize != instanceStorage.instancesBufferSize) {
            instanceStorage.instancesData = new Float32Array(instanceStorage.instancesBufferSize / 4);
        }
        if ((this._scene.needsPreviousWorldMatrices && !instanceStorage.instancesPreviousData) || currentInstancesBufferSize != instanceStorage.instancesBufferSize) {
            instanceStorage.instancesPreviousData = new Float32Array(instanceStorage.instancesBufferSize / 4);
        }
        let offset = 0;
        let instancesCount = 0;
        const renderSelf = batch.renderSelf[subMesh._id];
        const needUpdateBuffer = !instancesBuffer ||
            currentInstancesBufferSize !== instanceStorage.instancesBufferSize ||
            (this._scene.needsPreviousWorldMatrices && !instanceStorage.instancesPreviousBuffer);
        if (!this._instanceDataStorage.manualUpdate && (!instanceStorage.isFrozen || needUpdateBuffer)) {
            const world = this.getWorldMatrix();
            if (renderSelf) {
                if (this._scene.needsPreviousWorldMatrices) {
                    if (!instanceStorage.masterMeshPreviousWorldMatrix) {
                        instanceStorage.masterMeshPreviousWorldMatrix = world.clone();
                        instanceStorage.masterMeshPreviousWorldMatrix.copyToArray(instanceStorage.instancesPreviousData, offset);
                    }
                    else {
                        instanceStorage.masterMeshPreviousWorldMatrix.copyToArray(instanceStorage.instancesPreviousData, offset);
                        instanceStorage.masterMeshPreviousWorldMatrix.copyFrom(world);
                    }
                }
                world.copyToArray(instanceStorage.instancesData, offset);
                offset += 16;
                instancesCount++;
            }
            if (visibleInstances) {
                if (Mesh.INSTANCEDMESH_SORT_TRANSPARENT && this._scene.activeCamera && subMesh.getMaterial()?.needAlphaBlendingForMesh(subMesh.getRenderingMesh())) {
                    const cameraPosition = this._scene.activeCamera.globalPosition;
                    for (let instanceIndex = 0; instanceIndex < visibleInstances.length; instanceIndex++) {
                        const instanceMesh = visibleInstances[instanceIndex];
                        instanceMesh._distanceToCamera = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Distance(instanceMesh.getBoundingInfo().boundingSphere.centerWorld, cameraPosition);
                    }
                    visibleInstances.sort((m1, m2) => {
                        return m1._distanceToCamera > m2._distanceToCamera ? -1 : m1._distanceToCamera < m2._distanceToCamera ? 1 : 0;
                    });
                }
                for (let instanceIndex = 0; instanceIndex < visibleInstances.length; instanceIndex++) {
                    const instance = visibleInstances[instanceIndex];
                    const matrix = instance.getWorldMatrix();
                    matrix.copyToArray(instanceStorage.instancesData, offset);
                    if (this._scene.needsPreviousWorldMatrices) {
                        if (!instance._previousWorldMatrix) {
                            instance._previousWorldMatrix = matrix.clone();
                            instance._previousWorldMatrix.copyToArray(instanceStorage.instancesPreviousData, offset);
                        }
                        else {
                            instance._previousWorldMatrix.copyToArray(instanceStorage.instancesPreviousData, offset);
                            instance._previousWorldMatrix.copyFrom(matrix);
                        }
                    }
                    offset += 16;
                    instancesCount++;
                }
            }
        }
        else {
            instancesCount = (renderSelf ? 1 : 0) + visibleInstanceCount;
        }
        if (needUpdateBuffer) {
            if (instancesBuffer) {
                instancesBuffer.dispose();
            }
            if (instancesPreviousBuffer) {
                instancesPreviousBuffer.dispose();
            }
            instancesBuffer = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .Buffer */ .h(engine, instanceStorage.instancesData, true, 16, false, true);
            instanceStorage.instancesBuffer = instancesBuffer;
            if (!this._userInstancedBuffersStorage) {
                this._userInstancedBuffersStorage = {
                    data: {},
                    vertexBuffers: {},
                    strides: {},
                    sizes: {},
                    vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : undefined,
                };
            }
            this._userInstancedBuffersStorage.vertexBuffers["world0"] = instancesBuffer.createVertexBuffer("world0", 0, 4);
            this._userInstancedBuffersStorage.vertexBuffers["world1"] = instancesBuffer.createVertexBuffer("world1", 4, 4);
            this._userInstancedBuffersStorage.vertexBuffers["world2"] = instancesBuffer.createVertexBuffer("world2", 8, 4);
            this._userInstancedBuffersStorage.vertexBuffers["world3"] = instancesBuffer.createVertexBuffer("world3", 12, 4);
            if (this._scene.needsPreviousWorldMatrices) {
                instancesPreviousBuffer = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .Buffer */ .h(engine, instanceStorage.instancesPreviousData, true, 16, false, true);
                instanceStorage.instancesPreviousBuffer = instancesPreviousBuffer;
                this._userInstancedBuffersStorage.vertexBuffers["previousWorld0"] = instancesPreviousBuffer.createVertexBuffer("previousWorld0", 0, 4);
                this._userInstancedBuffersStorage.vertexBuffers["previousWorld1"] = instancesPreviousBuffer.createVertexBuffer("previousWorld1", 4, 4);
                this._userInstancedBuffersStorage.vertexBuffers["previousWorld2"] = instancesPreviousBuffer.createVertexBuffer("previousWorld2", 8, 4);
                this._userInstancedBuffersStorage.vertexBuffers["previousWorld3"] = instancesPreviousBuffer.createVertexBuffer("previousWorld3", 12, 4);
            }
            this._invalidateInstanceVertexArrayObject();
        }
        else {
            if (!this._instanceDataStorage.isFrozen || this._instanceDataStorage.forceMatrixUpdates) {
                instancesBuffer.updateDirectly(instanceStorage.instancesData, 0, instancesCount);
                if (this._scene.needsPreviousWorldMatrices && (!this._instanceDataStorage.manualUpdate || this._instanceDataStorage.previousManualUpdate)) {
                    instancesPreviousBuffer.updateDirectly(instanceStorage.instancesPreviousData, 0, instancesCount);
                }
            }
        }
        this._processInstancedBuffers(visibleInstances, renderSelf);
        // Stats
        this.getScene()._activeIndices.addCount(subMesh.indexCount * instancesCount, false);
        // Draw
        if (engine._currentDrawContext) {
            engine._currentDrawContext.useInstancing = true;
        }
        this._bind(subMesh, effect, fillMode);
        this._draw(subMesh, fillMode, instancesCount);
        // Write current matrices as previous matrices in case of manual update
        // Default behaviour when previous matrices are not specified explicitly
        // Will break if instances number/order changes
        if (this._scene.needsPreviousWorldMatrices &&
            !needUpdateBuffer &&
            this._instanceDataStorage.manualUpdate &&
            (!this._instanceDataStorage.isFrozen || this._instanceDataStorage.forceMatrixUpdates) &&
            !this._instanceDataStorage.previousManualUpdate) {
            instancesPreviousBuffer.updateDirectly(instanceStorage.instancesData, 0, instancesCount);
        }
        engine.unbindInstanceAttributes();
        return this;
    }
    /**
     * @internal
     */
    _renderWithThinInstances(subMesh, fillMode, effect, engine) {
        // Stats
        const instancesCount = this._thinInstanceDataStorage?.instancesCount ?? 0;
        this.getScene()._activeIndices.addCount(subMesh.indexCount * instancesCount, false);
        // Draw
        if (engine._currentDrawContext) {
            engine._currentDrawContext.useInstancing = true;
        }
        this._bind(subMesh, effect, fillMode);
        this._draw(subMesh, fillMode, instancesCount);
        // Write current matrices as previous matrices
        // Default behaviour when previous matrices are not specified explicitly
        // Will break if instances number/order changes
        if (this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData && this._thinInstanceDataStorage.matrixData) {
            if (!this._thinInstanceDataStorage.previousMatrixBuffer) {
                this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", this._thinInstanceDataStorage.matrixData, false);
            }
            else {
                this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, instancesCount);
            }
        }
        engine.unbindInstanceAttributes();
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _processInstancedBuffers(visibleInstances, renderSelf) {
        // Do nothing
    }
    /**
     * @internal
     */
    _processRendering(renderingMesh, subMesh, effect, fillMode, batch, hardwareInstancedRendering, onBeforeDraw, effectiveMaterial) {
        const scene = this.getScene();
        const engine = scene.getEngine();
        fillMode = this._getRenderingFillMode(fillMode);
        if (hardwareInstancedRendering && subMesh.getRenderingMesh().hasThinInstances) {
            this._renderWithThinInstances(subMesh, fillMode, effect, engine);
            return this;
        }
        if (hardwareInstancedRendering) {
            this._renderWithInstances(subMesh, fillMode, batch, effect, engine);
        }
        else {
            if (engine._currentDrawContext) {
                engine._currentDrawContext.useInstancing = false;
            }
            let instanceCount = 0;
            if (batch.renderSelf[subMesh._id]) {
                // Draw
                if (onBeforeDraw) {
                    onBeforeDraw(false, renderingMesh.getWorldMatrix(), effectiveMaterial);
                }
                instanceCount++;
                this._draw(subMesh, fillMode, this._instanceDataStorage.overridenInstanceCount);
            }
            const visibleInstancesForSubMesh = batch.visibleInstances[subMesh._id];
            if (visibleInstancesForSubMesh) {
                const visibleInstanceCount = visibleInstancesForSubMesh.length;
                instanceCount += visibleInstanceCount;
                // Stats
                for (let instanceIndex = 0; instanceIndex < visibleInstanceCount; instanceIndex++) {
                    const instance = visibleInstancesForSubMesh[instanceIndex];
                    // World
                    const world = instance.getWorldMatrix();
                    if (onBeforeDraw) {
                        onBeforeDraw(true, world, effectiveMaterial);
                    }
                    // Draw
                    this._draw(subMesh, fillMode);
                }
            }
            // Stats
            scene._activeIndices.addCount(subMesh.indexCount * instanceCount, false);
        }
        return this;
    }
    /**
     * @internal
     */
    _rebuild(dispose = false) {
        if (this._instanceDataStorage.instancesBuffer) {
            // Dispose instance buffer to be recreated in _renderWithInstances when rendered
            if (dispose) {
                this._instanceDataStorage.instancesBuffer.dispose();
            }
            this._instanceDataStorage.instancesBuffer = null;
        }
        if (this._userInstancedBuffersStorage) {
            for (const kind in this._userInstancedBuffersStorage.vertexBuffers) {
                const buffer = this._userInstancedBuffersStorage.vertexBuffers[kind];
                if (buffer) {
                    // Dispose instance buffer to be recreated in _renderWithInstances when rendered
                    if (dispose) {
                        buffer.dispose();
                    }
                    this._userInstancedBuffersStorage.vertexBuffers[kind] = null;
                }
            }
            if (this._userInstancedBuffersStorage.vertexArrayObjects) {
                this._userInstancedBuffersStorage.vertexArrayObjects = {};
            }
        }
        this._internalMeshDataInfo._effectiveMaterial = null;
        super._rebuild(dispose);
    }
    /** @internal */
    _freeze() {
        if (!this.subMeshes) {
            return;
        }
        // Prepare batches
        for (let index = 0; index < this.subMeshes.length; index++) {
            this._getInstancesRenderList(index);
        }
        this._internalMeshDataInfo._effectiveMaterial = null;
        this._instanceDataStorage.isFrozen = true;
    }
    /** @internal */
    _unFreeze() {
        this._instanceDataStorage.isFrozen = false;
        this._instanceDataStorage.previousBatch = null;
    }
    /**
     * Triggers the draw call for the mesh (or a submesh), for a specific render pass id
     * @param renderPassId defines the render pass id to use to draw the mesh / submesh. If not provided, use the current renderPassId of the engine.
     * @param enableAlphaMode defines if alpha mode can be changed (default: false)
     * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering (default: undefined)
     * @param subMesh defines the subMesh to render. If not provided, draw all mesh submeshes (default: undefined)
     * @param checkFrustumCulling defines if frustum culling must be checked (default: true). If you know the mesh is in the frustum (or if you don't care!), you can pass false to optimize.
     * @returns the current mesh
     */
    renderWithRenderPassId(renderPassId, enableAlphaMode, effectiveMeshReplacement, subMesh, checkFrustumCulling = true) {
        const engine = this._scene.getEngine();
        const currentRenderPassId = engine.currentRenderPassId;
        if (renderPassId !== undefined) {
            engine.currentRenderPassId = renderPassId;
        }
        if (subMesh) {
            if (!checkFrustumCulling || (checkFrustumCulling && subMesh.isInFrustum(this._scene._frustumPlanes))) {
                this.render(subMesh, !!enableAlphaMode, effectiveMeshReplacement);
            }
        }
        else {
            for (let s = 0; s < this.subMeshes.length; s++) {
                const subMesh = this.subMeshes[s];
                if (!checkFrustumCulling || (checkFrustumCulling && subMesh.isInFrustum(this._scene._frustumPlanes))) {
                    this.render(subMesh, !!enableAlphaMode, effectiveMeshReplacement);
                }
            }
        }
        if (renderPassId !== undefined) {
            engine.currentRenderPassId = currentRenderPassId;
        }
        return this;
    }
    /**
     * Render a complete mesh by going through all submeshes
     * @returns the current mesh
     * #5SPY1V#2: simple test
     * #5SPY1V#5: perf test
     */
    directRender() {
        if (!this.subMeshes) {
            return this;
        }
        for (const submesh of this.subMeshes) {
            this.render(submesh, false);
        }
        return this;
    }
    /**
     * Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager
     * @param subMesh defines the subMesh to render
     * @param enableAlphaMode defines if alpha mode can be changed
     * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering
     * @returns the current mesh
     */
    render(subMesh, enableAlphaMode, effectiveMeshReplacement) {
        const scene = this.getScene();
        if (this._internalAbstractMeshDataInfo._isActiveIntermediate) {
            this._internalAbstractMeshDataInfo._isActiveIntermediate = false;
        }
        else {
            this._internalAbstractMeshDataInfo._isActive = false;
        }
        const numActiveCameras = scene.activeCameras?.length ?? 0;
        const canCheckOcclusionQuery = (numActiveCameras > 1 && scene.activeCamera === scene.activeCameras[0]) || numActiveCameras <= 1;
        if (canCheckOcclusionQuery && this._checkOcclusionQuery() && !this._occlusionDataStorage.forceRenderingWhenOccluded) {
            return this;
        }
        // Managing instances
        const batch = this._getInstancesRenderList(subMesh._id, !!effectiveMeshReplacement);
        if (batch.mustReturn) {
            return this;
        }
        // Checking geometry state
        if (!this._geometry || !this._geometry.getVertexBuffers() || (!this._unIndexed && !this._geometry.getIndexBuffer())) {
            return this;
        }
        const engine = scene.getEngine();
        let oldCameraMaxZ = 0;
        let oldCamera = null;
        if (this.ignoreCameraMaxZ && scene.activeCamera && !scene._isInIntermediateRendering()) {
            oldCameraMaxZ = scene.activeCamera.maxZ;
            oldCamera = scene.activeCamera;
            scene.activeCamera.maxZ = 0;
            scene.updateTransformMatrix(true);
        }
        if (this._internalMeshDataInfo._onBeforeRenderObservable) {
            this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);
        }
        const renderingMesh = subMesh.getRenderingMesh();
        const hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] ||
            renderingMesh.hasThinInstances ||
            (!!this._userInstancedBuffersStorage && !subMesh.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh);
        const instanceDataStorage = this._instanceDataStorage;
        const material = subMesh.getMaterial();
        if (!material) {
            if (oldCamera) {
                oldCamera.maxZ = oldCameraMaxZ;
                scene.updateTransformMatrix(true);
            }
            return this;
        }
        // Material
        if (!instanceDataStorage.isFrozen || !this._internalMeshDataInfo._effectiveMaterial || this._internalMeshDataInfo._effectiveMaterial !== material) {
            if (material._storeEffectOnSubMeshes) {
                if (!material.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) {
                    if (oldCamera) {
                        oldCamera.maxZ = oldCameraMaxZ;
                        scene.updateTransformMatrix(true);
                    }
                    return this;
                }
            }
            else if (!material.isReady(this, hardwareInstancedRendering)) {
                if (oldCamera) {
                    oldCamera.maxZ = oldCameraMaxZ;
                    scene.updateTransformMatrix(true);
                }
                return this;
            }
            this._internalMeshDataInfo._effectiveMaterial = material;
        }
        else if ((material._storeEffectOnSubMeshes && !subMesh._drawWrapper?._wasPreviouslyReady) ||
            (!material._storeEffectOnSubMeshes && !material._getDrawWrapper()._wasPreviouslyReady)) {
            if (oldCamera) {
                oldCamera.maxZ = oldCameraMaxZ;
                scene.updateTransformMatrix(true);
            }
            return this;
        }
        // Alpha mode
        if (enableAlphaMode) {
            engine.setAlphaMode(this._internalMeshDataInfo._effectiveMaterial.alphaMode);
        }
        let drawWrapper;
        if (this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes) {
            drawWrapper = subMesh._drawWrapper;
        }
        else {
            drawWrapper = this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();
        }
        const effect = drawWrapper?.effect ?? null;
        for (const step of scene._beforeRenderingMeshStage) {
            step.action(this, subMesh, batch, effect);
        }
        if (!drawWrapper || !effect) {
            if (oldCamera) {
                oldCamera.maxZ = oldCameraMaxZ;
                scene.updateTransformMatrix(true);
            }
            return this;
        }
        const effectiveMesh = effectiveMeshReplacement || this;
        let sideOrientation;
        if (!instanceDataStorage.isFrozen &&
            (this._internalMeshDataInfo._effectiveMaterial.backFaceCulling ||
                this._internalMeshDataInfo._effectiveMaterial.sideOrientation !== null ||
                this._internalMeshDataInfo._effectiveMaterial.twoSidedLighting)) {
            // Note: if two sided lighting is enabled, we need to ensure that the normal will point in the right direction even if the determinant of the world matrix is negative
            const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();
            sideOrientation = this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this);
            if (mainDeterminant < 0) {
                sideOrientation = sideOrientation === _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.ClockWiseSideOrientation ? _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.CounterClockWiseSideOrientation : _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.ClockWiseSideOrientation;
            }
            instanceDataStorage.sideOrientation = sideOrientation;
        }
        else {
            sideOrientation = instanceDataStorage.sideOrientation;
        }
        const reverse = this._internalMeshDataInfo._effectiveMaterial._preBind(drawWrapper, sideOrientation);
        if (this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite) {
            engine.setDepthWrite(true);
        }
        // Bind
        const effectiveMaterial = this._internalMeshDataInfo._effectiveMaterial;
        const fillMode = effectiveMaterial.fillMode;
        if (this._internalMeshDataInfo._onBeforeBindObservable) {
            this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this);
        }
        if (!hardwareInstancedRendering) {
            // Binding will be done later because we need to add more info to the VB
            this._bind(subMesh, effect, fillMode, false);
        }
        const world = effectiveMesh.getWorldMatrix();
        if (effectiveMaterial._storeEffectOnSubMeshes) {
            effectiveMaterial.bindForSubMesh(world, this, subMesh);
        }
        else {
            effectiveMaterial.bind(world, this);
        }
        if (!effectiveMaterial.backFaceCulling && effectiveMaterial.separateCullingPass) {
            engine.setState(true, effectiveMaterial.zOffset, false, !reverse, effectiveMaterial.cullBackFaces, effectiveMaterial.stencil, effectiveMaterial.zOffsetUnits);
            this._processRendering(this, subMesh, effect, fillMode, batch, hardwareInstancedRendering, this._onBeforeDraw, this._internalMeshDataInfo._effectiveMaterial);
            engine.setState(true, effectiveMaterial.zOffset, false, reverse, effectiveMaterial.cullBackFaces, effectiveMaterial.stencil, effectiveMaterial.zOffsetUnits);
            if (this._internalMeshDataInfo._onBetweenPassObservable) {
                this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(subMesh);
            }
        }
        // Draw
        this._processRendering(this, subMesh, effect, fillMode, batch, hardwareInstancedRendering, this._onBeforeDraw, this._internalMeshDataInfo._effectiveMaterial);
        // Unbind
        this._internalMeshDataInfo._effectiveMaterial.unbind();
        for (const step of scene._afterRenderingMeshStage) {
            step.action(this, subMesh, batch, effect);
        }
        if (this._internalMeshDataInfo._onAfterRenderObservable) {
            this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this);
        }
        if (oldCamera) {
            oldCamera.maxZ = oldCameraMaxZ;
            scene.updateTransformMatrix(true);
        }
        if (scene.performancePriority === 2 /* ScenePerformancePriority.Aggressive */ && !instanceDataStorage.isFrozen) {
            this._freeze();
        }
        return this;
    }
    /**
     *   Renormalize the mesh and patch it up if there are no weights
     *   Similar to normalization by adding the weights compute the reciprocal and multiply all elements, this wil ensure that everything adds to 1.
     *   However in the case of zero weights then we set just a single influence to 1.
     *   We check in the function for extra's present and if so we use the normalizeSkinWeightsWithExtras rather than the FourWeights version.
     */
    cleanMatrixWeights() {
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind)) {
            if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsExtraKind)) {
                this._normalizeSkinWeightsAndExtra();
            }
            else {
                this._normalizeSkinFourWeights();
            }
        }
    }
    // faster 4 weight version.
    _normalizeSkinFourWeights() {
        const matricesWeights = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind);
        const numWeights = matricesWeights.length;
        for (let a = 0; a < numWeights; a += 4) {
            // accumulate weights
            const t = matricesWeights[a] + matricesWeights[a + 1] + matricesWeights[a + 2] + matricesWeights[a + 3];
            // check for invalid weight and just set it to 1.
            if (t === 0) {
                matricesWeights[a] = 1;
            }
            else {
                // renormalize so everything adds to 1 use reciprocal
                const recip = 1 / t;
                matricesWeights[a] *= recip;
                matricesWeights[a + 1] *= recip;
                matricesWeights[a + 2] *= recip;
                matricesWeights[a + 3] *= recip;
            }
        }
        this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind, matricesWeights);
    }
    // handle special case of extra verts.  (in theory gltf can handle 12 influences)
    _normalizeSkinWeightsAndExtra() {
        const matricesWeightsExtra = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsExtraKind);
        const matricesWeights = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind);
        const numWeights = matricesWeights.length;
        for (let a = 0; a < numWeights; a += 4) {
            // accumulate weights
            let t = matricesWeights[a] + matricesWeights[a + 1] + matricesWeights[a + 2] + matricesWeights[a + 3];
            t += matricesWeightsExtra[a] + matricesWeightsExtra[a + 1] + matricesWeightsExtra[a + 2] + matricesWeightsExtra[a + 3];
            // check for invalid weight and just set it to 1.
            if (t === 0) {
                matricesWeights[a] = 1;
            }
            else {
                // renormalize so everything adds to 1 use reciprocal
                const recip = 1 / t;
                matricesWeights[a] *= recip;
                matricesWeights[a + 1] *= recip;
                matricesWeights[a + 2] *= recip;
                matricesWeights[a + 3] *= recip;
                // same goes for extras
                matricesWeightsExtra[a] *= recip;
                matricesWeightsExtra[a + 1] *= recip;
                matricesWeightsExtra[a + 2] *= recip;
                matricesWeightsExtra[a + 3] *= recip;
            }
        }
        this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind, matricesWeights);
        this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind, matricesWeightsExtra);
    }
    /**
     * ValidateSkinning is used to determine that a mesh has valid skinning data along with skin metrics, if missing weights,
     * or not normalized it is returned as invalid mesh the string can be used for console logs, or on screen messages to let
     * the user know there was an issue with importing the mesh
     * @returns a validation object with skinned, valid and report string
     */
    validateSkinning() {
        const matricesWeightsExtra = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsExtraKind);
        const matricesWeights = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind);
        if (matricesWeights === null || this.skeleton == null) {
            return { skinned: false, valid: true, report: "not skinned" };
        }
        const numWeights = matricesWeights.length;
        let numberNotSorted = 0;
        let missingWeights = 0;
        let maxUsedWeights = 0;
        let numberNotNormalized = 0;
        const numInfluences = matricesWeightsExtra === null ? 4 : 8;
        const usedWeightCounts = [];
        for (let a = 0; a <= numInfluences; a++) {
            usedWeightCounts[a] = 0;
        }
        const toleranceEpsilon = 0.001;
        for (let a = 0; a < numWeights; a += 4) {
            let lastWeight = matricesWeights[a];
            let t = lastWeight;
            let usedWeights = t === 0 ? 0 : 1;
            for (let b = 1; b < numInfluences; b++) {
                const d = b < 4 ? matricesWeights[a + b] : matricesWeightsExtra[a + b - 4];
                if (d > lastWeight) {
                    numberNotSorted++;
                }
                if (d !== 0) {
                    usedWeights++;
                }
                t += d;
                lastWeight = d;
            }
            // count the buffer weights usage
            usedWeightCounts[usedWeights]++;
            // max influences
            if (usedWeights > maxUsedWeights) {
                maxUsedWeights = usedWeights;
            }
            // check for invalid weight and just set it to 1.
            if (t === 0) {
                missingWeights++;
            }
            else {
                // renormalize so everything adds to 1 use reciprocal
                const recip = 1 / t;
                let tolerance = 0;
                for (let b = 0; b < numInfluences; b++) {
                    if (b < 4) {
                        tolerance += Math.abs(matricesWeights[a + b] - matricesWeights[a + b] * recip);
                    }
                    else {
                        tolerance += Math.abs(matricesWeightsExtra[a + b - 4] - matricesWeightsExtra[a + b - 4] * recip);
                    }
                }
                // arbitrary epsilon value for dictating not normalized
                if (tolerance > toleranceEpsilon) {
                    numberNotNormalized++;
                }
            }
        }
        // validate bone indices are in range of the skeleton
        const numBones = this.skeleton.bones.length;
        const matricesIndices = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesIndicesKind);
        const matricesIndicesExtra = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesIndicesExtraKind);
        let numBadBoneIndices = 0;
        for (let a = 0; a < numWeights; a += 4) {
            for (let b = 0; b < numInfluences; b++) {
                const index = b < 4 ? matricesIndices[a + b] : matricesIndicesExtra[a + b - 4];
                if (index >= numBones || index < 0) {
                    numBadBoneIndices++;
                }
            }
        }
        // log mesh stats
        const output = "Number of Weights = " +
            numWeights / 4 +
            "\nMaximum influences = " +
            maxUsedWeights +
            "\nMissing Weights = " +
            missingWeights +
            "\nNot Sorted = " +
            numberNotSorted +
            "\nNot Normalized = " +
            numberNotNormalized +
            "\nWeightCounts = [" +
            usedWeightCounts +
            "]" +
            "\nNumber of bones = " +
            numBones +
            "\nBad Bone Indices = " +
            numBadBoneIndices;
        return { skinned: true, valid: missingWeights === 0 && numberNotNormalized === 0 && numBadBoneIndices === 0, report: output };
    }
    /** @internal */
    _checkDelayState() {
        const scene = this.getScene();
        if (this._geometry) {
            this._geometry.load(scene);
        }
        else if (this.delayLoadState === 4) {
            this.delayLoadState = 2;
            this._queueLoad(scene);
        }
        return this;
    }
    _queueLoad(scene) {
        scene.addPendingData(this);
        const getBinaryData = this.delayLoadingFile.indexOf(".babylonbinarymeshdata") !== -1;
        _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.LoadFile(this.delayLoadingFile, (data) => {
            if (data instanceof ArrayBuffer) {
                this._delayLoadingFunction(data, this);
            }
            else {
                this._delayLoadingFunction(JSON.parse(data), this);
            }
            this.instances.forEach((instance) => {
                instance.refreshBoundingInfo();
                instance._syncSubMeshes();
            });
            this.delayLoadState = 1;
            scene.removePendingData(this);
        }, () => { }, scene.offlineProvider, getBinaryData);
        return this;
    }
    /**
     * Returns `true` if the mesh is within the frustum defined by the passed array of planes.
     * A mesh is in the frustum if its bounding box intersects the frustum
     * @param frustumPlanes defines the frustum to test
     * @returns true if the mesh is in the frustum planes
     */
    isInFrustum(frustumPlanes) {
        if (this.delayLoadState === 2) {
            return false;
        }
        if (!super.isInFrustum(frustumPlanes)) {
            return false;
        }
        this._checkDelayState();
        return true;
    }
    /**
     * Sets the mesh material by the material or multiMaterial `id` property
     * @param id is a string identifying the material or the multiMaterial
     * @returns the current mesh
     */
    setMaterialById(id) {
        const materials = this.getScene().materials;
        let index;
        for (index = materials.length - 1; index > -1; index--) {
            if (materials[index].id === id) {
                this.material = materials[index];
                return this;
            }
        }
        // Multi
        const multiMaterials = this.getScene().multiMaterials;
        for (index = multiMaterials.length - 1; index > -1; index--) {
            if (multiMaterials[index].id === id) {
                this.material = multiMaterials[index];
                return this;
            }
        }
        return this;
    }
    /**
     * Returns as a new array populated with the mesh material and/or skeleton, if any.
     * @returns an array of IAnimatable
     */
    getAnimatables() {
        const results = [];
        if (this.material) {
            results.push(this.material);
        }
        if (this.skeleton) {
            results.push(this.skeleton);
        }
        return results;
    }
    /**
     * Modifies the mesh geometry according to the passed transformation matrix.
     * This method returns nothing, but it really modifies the mesh even if it's originally not set as updatable.
     * The mesh normals are modified using the same transformation.
     * Note that, under the hood, this method sets a new VertexBuffer each call.
     * @param transform defines the transform matrix to use
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
     * @returns the current mesh
     */
    bakeTransformIntoVertices(transform) {
        // Position
        if (!this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind)) {
            return this;
        }
        const submeshes = this.subMeshes.splice(0);
        this._resetPointsArrayCache();
        let data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind);
        const temp = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Zero();
        let index;
        for (index = 0; index < data.length; index += 3) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(data[index], data[index + 1], data[index + 2], transform, temp).toArray(data, index);
        }
        this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind, data, this.getVertexBuffer(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind).isUpdatable());
        // Normals
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind)) {
            data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind);
            for (index = 0; index < data.length; index += 3) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.TransformNormalFromFloatsToRef(data[index], data[index + 1], data[index + 2], transform, temp)
                    .normalize()
                    .toArray(data, index);
            }
            this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind, data, this.getVertexBuffer(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind).isUpdatable());
        }
        // Tangents
        if (this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.TangentKind)) {
            data = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.TangentKind);
            for (index = 0; index < data.length; index += 4) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.TransformNormalFromFloatsToRef(data[index], data[index + 1], data[index + 2], transform, temp)
                    .normalize()
                    .toArray(data, index);
            }
            this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.TangentKind, data, this.getVertexBuffer(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.TangentKind).isUpdatable());
        }
        // flip faces?
        if (transform.determinant() < 0) {
            this.flipFaces();
        }
        // Restore submeshes
        this.releaseSubMeshes();
        this.subMeshes = submeshes;
        return this;
    }
    /**
     * Modifies the mesh geometry according to its own current World Matrix.
     * The mesh World Matrix is then reset.
     * This method returns nothing but really modifies the mesh even if it's originally not set as updatable.
     * Note that, under the hood, this method sets a new VertexBuffer each call.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
     * @param bakeIndependentlyOfChildren indicates whether to preserve all child nodes' World Matrix during baking
     * @returns the current mesh
     */
    bakeCurrentTransformIntoVertices(bakeIndependentlyOfChildren = true) {
        this.bakeTransformIntoVertices(this.computeWorldMatrix(true));
        this.resetLocalMatrix(bakeIndependentlyOfChildren);
        return this;
    }
    // Cache
    /** @internal */
    get _positions() {
        return this._internalAbstractMeshDataInfo._positions || (this._geometry && this._geometry._positions) || null;
    }
    /** @internal */
    _resetPointsArrayCache() {
        if (this._geometry) {
            this._geometry._resetPointsArrayCache();
        }
        return this;
    }
    /** @internal */
    _generatePointsArray() {
        if (this._geometry) {
            return this._geometry._generatePointsArray();
        }
        return false;
    }
    /**
     * Returns a new Mesh object generated from the current mesh properties.
     * This method must not get confused with createInstance()
     * @param name is a string, the name given to the new mesh
     * @param newParent can be any Node object (default `null`)
     * @param doNotCloneChildren allows/denies the recursive cloning of the original mesh children if any (default `false`)
     * @param clonePhysicsImpostor allows/denies the cloning in the same time of the original mesh `body` used by the physics engine, if any (default `true`)
     * @returns a new mesh
     */
    clone(name = "", newParent = null, doNotCloneChildren, clonePhysicsImpostor = true) {
        return new Mesh(name, this.getScene(), newParent, this, doNotCloneChildren, clonePhysicsImpostor);
    }
    /**
     * Releases resources associated with this mesh.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        this.morphTargetManager = null;
        if (this._geometry) {
            this._geometry.releaseForMesh(this, true);
        }
        const internalDataInfo = this._internalMeshDataInfo;
        if (internalDataInfo._onBeforeDrawObservable) {
            internalDataInfo._onBeforeDrawObservable.clear();
        }
        if (internalDataInfo._onBeforeBindObservable) {
            internalDataInfo._onBeforeBindObservable.clear();
        }
        if (internalDataInfo._onBeforeRenderObservable) {
            internalDataInfo._onBeforeRenderObservable.clear();
        }
        if (internalDataInfo._onAfterRenderObservable) {
            internalDataInfo._onAfterRenderObservable.clear();
        }
        if (internalDataInfo._onBetweenPassObservable) {
            internalDataInfo._onBetweenPassObservable.clear();
        }
        // Sources
        if (this._scene.useClonedMeshMap) {
            if (internalDataInfo.meshMap) {
                for (const uniqueId in internalDataInfo.meshMap) {
                    const mesh = internalDataInfo.meshMap[uniqueId];
                    if (mesh) {
                        mesh._internalMeshDataInfo._source = null;
                        internalDataInfo.meshMap[uniqueId] = undefined;
                    }
                }
            }
            if (internalDataInfo._source && internalDataInfo._source._internalMeshDataInfo.meshMap) {
                internalDataInfo._source._internalMeshDataInfo.meshMap[this.uniqueId] = undefined;
            }
        }
        else {
            const meshes = this.getScene().meshes;
            for (const abstractMesh of meshes) {
                const mesh = abstractMesh;
                if (mesh._internalMeshDataInfo && mesh._internalMeshDataInfo._source && mesh._internalMeshDataInfo._source === this) {
                    mesh._internalMeshDataInfo._source = null;
                }
            }
        }
        internalDataInfo._source = null;
        this._instanceDataStorage.visibleInstances = {};
        // Instances
        this._disposeInstanceSpecificData();
        // Thin instances
        this._disposeThinInstanceSpecificData();
        if (this._internalMeshDataInfo._checkReadinessObserver) {
            this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver);
        }
        super.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
    /** @internal */
    _disposeInstanceSpecificData() {
        // Do nothing
    }
    /** @internal */
    _disposeThinInstanceSpecificData() {
        // Do nothing
    }
    /** @internal */
    _invalidateInstanceVertexArrayObject() {
        // Do nothing
    }
    /**
     * Modifies the mesh geometry according to a displacement map.
     * A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex.
     * The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.
     * @param url is a string, the URL from the image file is to be downloaded.
     * @param minHeight is the lower limit of the displacement.
     * @param maxHeight is the upper limit of the displacement.
     * @param onSuccess is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing.
     * @param uvOffset is an optional vector2 used to offset UV.
     * @param uvScale is an optional vector2 used to scale UV.
     * @param forceUpdate defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
     * @param onError defines a callback called when an error occurs during the processing of the request.
     * @returns the Mesh.
     */
    applyDisplacementMap(url, minHeight, maxHeight, onSuccess, uvOffset, uvScale, forceUpdate = false, onError) {
        const scene = this.getScene();
        const onload = (img) => {
            // Getting height map data
            const heightMapWidth = img.width;
            const heightMapHeight = img.height;
            const canvas = this.getEngine().createCanvas(heightMapWidth, heightMapHeight);
            const context = canvas.getContext("2d");
            context.drawImage(img, 0, 0);
            // Create VertexData from map data
            //Cast is due to wrong definition in lib.d.ts from ts 1.3 - https://github.com/Microsoft/TypeScript/issues/949
            const buffer = context.getImageData(0, 0, heightMapWidth, heightMapHeight).data;
            this.applyDisplacementMapFromBuffer(buffer, heightMapWidth, heightMapHeight, minHeight, maxHeight, uvOffset, uvScale, forceUpdate);
            //execute success callback, if set
            if (onSuccess) {
                onSuccess(this);
            }
        };
        _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.LoadImage(url, onload, onError ? onError : () => { }, scene.offlineProvider);
        return this;
    }
    /**
     * Modifies the mesh geometry according to a displacementMap buffer.
     * A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex.
     * The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.
     * @param buffer is a `Uint8Array` buffer containing series of `Uint8` lower than 255, the red, green, blue and alpha values of each successive pixel.
     * @param heightMapWidth is the width of the buffer image.
     * @param heightMapHeight is the height of the buffer image.
     * @param minHeight is the lower limit of the displacement.
     * @param maxHeight is the upper limit of the displacement.
     * @param uvOffset is an optional vector2 used to offset UV.
     * @param uvScale is an optional vector2 used to scale UV.
     * @param forceUpdate defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
     * @returns the Mesh.
     */
    applyDisplacementMapFromBuffer(buffer, heightMapWidth, heightMapHeight, minHeight, maxHeight, uvOffset, uvScale, forceUpdate = false) {
        if (!this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind) || !this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind) || !this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UVKind)) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__/* .Logger */ .V.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing");
            return this;
        }
        const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind, true, true);
        const normals = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind);
        const uvs = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UVKind);
        let position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Zero();
        const normal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Zero();
        const uv = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector2 */ .I9.Zero();
        uvOffset = uvOffset || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector2 */ .I9.Zero();
        uvScale = uvScale || new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector2 */ .I9(1, 1);
        for (let index = 0; index < positions.length; index += 3) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArrayToRef(positions, index, position);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArrayToRef(normals, index, normal);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector2 */ .I9.FromArrayToRef(uvs, (index / 3) * 2, uv);
            // Compute height
            const u = (Math.abs(uv.x * uvScale.x + (uvOffset.x % 1)) * (heightMapWidth - 1)) % heightMapWidth | 0;
            const v = (Math.abs(uv.y * uvScale.y + (uvOffset.y % 1)) * (heightMapHeight - 1)) % heightMapHeight | 0;
            const pos = (u + v * heightMapWidth) * 4;
            const r = buffer[pos] / 255.0;
            const g = buffer[pos + 1] / 255.0;
            const b = buffer[pos + 2] / 255.0;
            const gradient = r * 0.3 + g * 0.59 + b * 0.11;
            normal.normalize();
            normal.scaleInPlace(minHeight + (maxHeight - minHeight) * gradient);
            position = position.add(normal);
            position.toArray(positions, index);
        }
        _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.ComputeNormals(positions, this.getIndices(), normals);
        if (forceUpdate) {
            this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind, positions);
            this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind, normals);
            this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UVKind, uvs);
        }
        else {
            this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind, positions);
            this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind, normals);
        }
        return this;
    }
    _getFlattenedNormals(indices, positions) {
        const normals = new Float32Array(indices.length * 3);
        let normalsCount = 0;
        // Decide if normals should be flipped
        const flipNormalGeneration = this.sideOrientation === (this._scene.useRightHandedSystem ? 1 : 0);
        // Generate new normals
        for (let index = 0; index < indices.length; index += 3) {
            const p1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(positions, indices[index] * 3);
            const p2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(positions, indices[index + 1] * 3);
            const p3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(positions, indices[index + 2] * 3);
            const p1p2 = p1.subtract(p2);
            const p3p2 = p3.subtract(p2);
            const normal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Normalize(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Cross(p1p2, p3p2));
            if (flipNormalGeneration) {
                normal.scaleInPlace(-1);
            }
            // Store same normals for every vertex
            for (let localIndex = 0; localIndex < 3; localIndex++) {
                normals[normalsCount++] = normal.x;
                normals[normalsCount++] = normal.y;
                normals[normalsCount++] = normal.z;
            }
        }
        return normals;
    }
    _convertToUnIndexedMesh(flattenNormals = false) {
        const kinds = this.getVerticesDataKinds().filter((kind) => !this.getVertexBuffer(kind)?.getIsInstanced());
        const indices = this.getIndices();
        const data = {};
        const separateVertices = (data, size) => {
            const newData = new Float32Array(indices.length * size);
            let count = 0;
            for (let index = 0; index < indices.length; index++) {
                for (let offset = 0; offset < size; offset++) {
                    newData[count++] = data[indices[index] * size + offset];
                }
            }
            return newData;
        };
        // Save mesh bounding info
        const meshBoundingInfo = this.getBoundingInfo();
        // Save previous submeshes
        const previousSubmeshes = this.geometry ? this.subMeshes.slice(0) : [];
        // Cache vertex data
        for (const kind of kinds) {
            data[kind] = this.getVerticesData(kind);
        }
        // Update vertex data
        for (const kind of kinds) {
            const vertexBuffer = this.getVertexBuffer(kind);
            const size = vertexBuffer.getSize();
            if (flattenNormals && kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind) {
                const normals = this._getFlattenedNormals(indices, data[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind]);
                this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind, normals, vertexBuffer.isUpdatable(), size);
            }
            else {
                this.setVerticesData(kind, separateVertices(data[kind], size), vertexBuffer.isUpdatable(), size);
            }
        }
        // Update morph targets
        if (this.morphTargetManager) {
            for (let targetIndex = 0; targetIndex < this.morphTargetManager.numTargets; targetIndex++) {
                const target = this.morphTargetManager.getTarget(targetIndex);
                const positions = target.getPositions();
                target.setPositions(separateVertices(positions, 3));
                const normals = target.getNormals();
                if (normals) {
                    target.setNormals(flattenNormals ? this._getFlattenedNormals(indices, positions) : separateVertices(normals, 3));
                }
                const tangents = target.getTangents();
                if (tangents) {
                    target.setTangents(separateVertices(tangents, 3));
                }
                const uvs = target.getUVs();
                if (uvs) {
                    target.setUVs(separateVertices(uvs, 2));
                }
            }
            this.morphTargetManager.synchronize();
        }
        // Update indices
        for (let index = 0; index < indices.length; index++) {
            indices[index] = index;
        }
        this.setIndices(indices);
        this._unIndexed = true;
        // Update submeshes
        this.releaseSubMeshes();
        for (const previousOne of previousSubmeshes) {
            const boundingInfo = previousOne.getBoundingInfo();
            const subMesh = _subMesh_js__WEBPACK_IMPORTED_MODULE_13__/* .SubMesh */ .K.AddToMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this);
            subMesh.setBoundingInfo(boundingInfo);
        }
        this.setBoundingInfo(meshBoundingInfo);
        this.synchronizeInstances();
        return this;
    }
    /**
     * Modify the mesh to get a flat shading rendering.
     * This means each mesh facet will then have its own normals. Usually new vertices are added in the mesh geometry to get this result.
     * Warning : the mesh is really modified even if not set originally as updatable and, under the hood, a new VertexBuffer is allocated.
     * @returns current mesh
     */
    convertToFlatShadedMesh() {
        return this._convertToUnIndexedMesh(true);
    }
    /**
     * This method removes all the mesh indices and add new vertices (duplication) in order to unfold facets into buffers.
     * In other words, more vertices, no more indices and a single bigger VBO.
     * The mesh is really modified even if not set originally as updatable. Under the hood, a new VertexBuffer is allocated.
     * @returns current mesh
     */
    convertToUnIndexedMesh() {
        return this._convertToUnIndexedMesh();
    }
    /**
     * Inverses facet orientations.
     * Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
     * @param flipNormals will also inverts the normals
     * @returns current mesh
     */
    flipFaces(flipNormals = false) {
        const vertex_data = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.ExtractFromMesh(this);
        let i;
        if (flipNormals && this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind) && vertex_data.normals) {
            for (i = 0; i < vertex_data.normals.length; i++) {
                vertex_data.normals[i] *= -1;
            }
            this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind, vertex_data.normals, this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind));
        }
        if (vertex_data.indices) {
            let temp;
            for (i = 0; i < vertex_data.indices.length; i += 3) {
                // reassign indices
                temp = vertex_data.indices[i + 1];
                vertex_data.indices[i + 1] = vertex_data.indices[i + 2];
                vertex_data.indices[i + 2] = temp;
            }
            this.setIndices(vertex_data.indices, null, this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind), true);
        }
        return this;
    }
    /**
     * Increase the number of facets and hence vertices in a mesh
     * Vertex normals are interpolated from existing vertex normals
     * Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
     * @param numberPerEdge the number of new vertices to add to each edge of a facet, optional default 1
     */
    increaseVertices(numberPerEdge = 1) {
        const vertex_data = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.ExtractFromMesh(this);
        const currentIndices = vertex_data.indices && !Array.isArray(vertex_data.indices) && Array.from ? Array.from(vertex_data.indices) : vertex_data.indices;
        const positions = vertex_data.positions && !Array.isArray(vertex_data.positions) && Array.from ? Array.from(vertex_data.positions) : vertex_data.positions;
        const uvs = vertex_data.uvs && !Array.isArray(vertex_data.uvs) && Array.from ? Array.from(vertex_data.uvs) : vertex_data.uvs;
        const normals = vertex_data.normals && !Array.isArray(vertex_data.normals) && Array.from ? Array.from(vertex_data.normals) : vertex_data.normals;
        if (!currentIndices || !positions) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__/* .Logger */ .V.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions");
        }
        else {
            vertex_data.indices = currentIndices;
            vertex_data.positions = positions;
            if (uvs) {
                vertex_data.uvs = uvs;
            }
            if (normals) {
                vertex_data.normals = normals;
            }
            const segments = numberPerEdge + 1; //segments per current facet edge, become sides of new facets
            const tempIndices = new Array();
            for (let i = 0; i < segments + 1; i++) {
                tempIndices[i] = new Array();
            }
            let a; //vertex index of one end of a side
            let b; //vertex index of other end of the side
            const deltaPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq(0, 0, 0);
            const deltaNormal = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq(0, 0, 0);
            const deltaUV = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector2 */ .I9(0, 0);
            const indices = new Array();
            const vertexIndex = new Array();
            const side = new Array();
            let len;
            let positionPtr = positions.length;
            let uvPtr;
            if (uvs) {
                uvPtr = uvs.length;
            }
            let normalsPtr;
            if (normals) {
                normalsPtr = normals.length;
            }
            for (let i = 0; i < currentIndices.length; i += 3) {
                vertexIndex[0] = currentIndices[i];
                vertexIndex[1] = currentIndices[i + 1];
                vertexIndex[2] = currentIndices[i + 2];
                for (let j = 0; j < 3; j++) {
                    a = vertexIndex[j];
                    b = vertexIndex[(j + 1) % 3];
                    if (side[a] === undefined && side[b] === undefined) {
                        side[a] = new Array();
                        side[b] = new Array();
                    }
                    else {
                        if (side[a] === undefined) {
                            side[a] = new Array();
                        }
                        if (side[b] === undefined) {
                            side[b] = new Array();
                        }
                    }
                    if (side[a][b] === undefined && side[b][a] === undefined) {
                        side[a][b] = [];
                        deltaPosition.x = (positions[3 * b] - positions[3 * a]) / segments;
                        deltaPosition.y = (positions[3 * b + 1] - positions[3 * a + 1]) / segments;
                        deltaPosition.z = (positions[3 * b + 2] - positions[3 * a + 2]) / segments;
                        if (normals) {
                            deltaNormal.x = (normals[3 * b] - normals[3 * a]) / segments;
                            deltaNormal.y = (normals[3 * b + 1] - normals[3 * a + 1]) / segments;
                            deltaNormal.z = (normals[3 * b + 2] - normals[3 * a + 2]) / segments;
                        }
                        if (uvs) {
                            deltaUV.x = (uvs[2 * b] - uvs[2 * a]) / segments;
                            deltaUV.y = (uvs[2 * b + 1] - uvs[2 * a + 1]) / segments;
                        }
                        side[a][b].push(a);
                        for (let k = 1; k < segments; k++) {
                            side[a][b].push(positions.length / 3);
                            positions[positionPtr++] = positions[3 * a] + k * deltaPosition.x;
                            positions[positionPtr++] = positions[3 * a + 1] + k * deltaPosition.y;
                            positions[positionPtr++] = positions[3 * a + 2] + k * deltaPosition.z;
                            if (normals) {
                                normals[normalsPtr++] = normals[3 * a] + k * deltaNormal.x;
                                normals[normalsPtr++] = normals[3 * a + 1] + k * deltaNormal.y;
                                normals[normalsPtr++] = normals[3 * a + 2] + k * deltaNormal.z;
                            }
                            if (uvs) {
                                uvs[uvPtr++] = uvs[2 * a] + k * deltaUV.x;
                                uvs[uvPtr++] = uvs[2 * a + 1] + k * deltaUV.y;
                            }
                        }
                        side[a][b].push(b);
                        side[b][a] = new Array();
                        len = side[a][b].length;
                        for (let idx = 0; idx < len; idx++) {
                            side[b][a][idx] = side[a][b][len - 1 - idx];
                        }
                    }
                }
                //Calculate positions, normals and uvs of new internal vertices
                tempIndices[0][0] = currentIndices[i];
                tempIndices[1][0] = side[currentIndices[i]][currentIndices[i + 1]][1];
                tempIndices[1][1] = side[currentIndices[i]][currentIndices[i + 2]][1];
                for (let k = 2; k < segments; k++) {
                    tempIndices[k][0] = side[currentIndices[i]][currentIndices[i + 1]][k];
                    tempIndices[k][k] = side[currentIndices[i]][currentIndices[i + 2]][k];
                    deltaPosition.x = (positions[3 * tempIndices[k][k]] - positions[3 * tempIndices[k][0]]) / k;
                    deltaPosition.y = (positions[3 * tempIndices[k][k] + 1] - positions[3 * tempIndices[k][0] + 1]) / k;
                    deltaPosition.z = (positions[3 * tempIndices[k][k] + 2] - positions[3 * tempIndices[k][0] + 2]) / k;
                    if (normals) {
                        deltaNormal.x = (normals[3 * tempIndices[k][k]] - normals[3 * tempIndices[k][0]]) / k;
                        deltaNormal.y = (normals[3 * tempIndices[k][k] + 1] - normals[3 * tempIndices[k][0] + 1]) / k;
                        deltaNormal.z = (normals[3 * tempIndices[k][k] + 2] - normals[3 * tempIndices[k][0] + 2]) / k;
                    }
                    if (uvs) {
                        deltaUV.x = (uvs[2 * tempIndices[k][k]] - uvs[2 * tempIndices[k][0]]) / k;
                        deltaUV.y = (uvs[2 * tempIndices[k][k] + 1] - uvs[2 * tempIndices[k][0] + 1]) / k;
                    }
                    for (let j = 1; j < k; j++) {
                        tempIndices[k][j] = positions.length / 3;
                        positions[positionPtr++] = positions[3 * tempIndices[k][0]] + j * deltaPosition.x;
                        positions[positionPtr++] = positions[3 * tempIndices[k][0] + 1] + j * deltaPosition.y;
                        positions[positionPtr++] = positions[3 * tempIndices[k][0] + 2] + j * deltaPosition.z;
                        if (normals) {
                            normals[normalsPtr++] = normals[3 * tempIndices[k][0]] + j * deltaNormal.x;
                            normals[normalsPtr++] = normals[3 * tempIndices[k][0] + 1] + j * deltaNormal.y;
                            normals[normalsPtr++] = normals[3 * tempIndices[k][0] + 2] + j * deltaNormal.z;
                        }
                        if (uvs) {
                            uvs[uvPtr++] = uvs[2 * tempIndices[k][0]] + j * deltaUV.x;
                            uvs[uvPtr++] = uvs[2 * tempIndices[k][0] + 1] + j * deltaUV.y;
                        }
                    }
                }
                tempIndices[segments] = side[currentIndices[i + 1]][currentIndices[i + 2]];
                // reform indices
                indices.push(tempIndices[0][0], tempIndices[1][0], tempIndices[1][1]);
                for (let k = 1; k < segments; k++) {
                    let j;
                    for (j = 0; j < k; j++) {
                        indices.push(tempIndices[k][j], tempIndices[k + 1][j], tempIndices[k + 1][j + 1]);
                        indices.push(tempIndices[k][j], tempIndices[k + 1][j + 1], tempIndices[k][j + 1]);
                    }
                    indices.push(tempIndices[k][j], tempIndices[k + 1][j], tempIndices[k + 1][j + 1]);
                }
            }
            vertex_data.indices = indices;
            vertex_data.applyToMesh(this, this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind));
        }
    }
    /**
     * Force adjacent facets to share vertices and remove any facets that have all vertices in a line
     * This will undo any application of covertToFlatShadedMesh
     * Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
     */
    forceSharedVertices() {
        const vertex_data = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.ExtractFromMesh(this);
        const currentUVs = vertex_data.uvs;
        const currentIndices = vertex_data.indices;
        const currentPositions = vertex_data.positions;
        const currentColors = vertex_data.colors;
        const currentMatrixIndices = vertex_data.matricesIndices;
        const currentMatrixWeights = vertex_data.matricesWeights;
        const currentMatrixIndicesExtra = vertex_data.matricesIndicesExtra;
        const currentMatrixWeightsExtra = vertex_data.matricesWeightsExtra;
        if (currentIndices === void 0 || currentPositions === void 0 || currentIndices === null || currentPositions === null) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__/* .Logger */ .V.Warn("VertexData contains empty entries");
        }
        else {
            const positions = new Array();
            const indices = new Array();
            const uvs = new Array();
            const colors = new Array();
            const matrixIndices = new Array();
            const matrixWeights = new Array();
            const matrixIndicesExtra = new Array();
            const matrixWeightsExtra = new Array();
            let pstring = new Array(); //lists facet vertex positions (a,b,c) as string "a|b|c"
            let indexPtr = 0; // pointer to next available index value
            const uniquePositions = {}; // unique vertex positions
            let ptr; // pointer to element in uniquePositions
            let facet;
            for (let i = 0; i < currentIndices.length; i += 3) {
                facet = [currentIndices[i], currentIndices[i + 1], currentIndices[i + 2]]; //facet vertex indices
                pstring = [];
                for (let j = 0; j < 3; j++) {
                    pstring[j] = "";
                    for (let k = 0; k < 3; k++) {
                        //small values make 0
                        if (Math.abs(currentPositions[3 * facet[j] + k]) < 0.00000001) {
                            currentPositions[3 * facet[j] + k] = 0;
                        }
                        pstring[j] += currentPositions[3 * facet[j] + k] + "|";
                    }
                }
                //check facet vertices to see that none are repeated
                // do not process any facet that has a repeated vertex, ie is a line
                if (!(pstring[0] == pstring[1] || pstring[0] == pstring[2] || pstring[1] == pstring[2])) {
                    //for each facet position check if already listed in uniquePositions
                    // if not listed add to uniquePositions and set index pointer
                    // if listed use its index in uniquePositions and new index pointer
                    for (let j = 0; j < 3; j++) {
                        ptr = uniquePositions[pstring[j]];
                        if (ptr === undefined) {
                            uniquePositions[pstring[j]] = indexPtr;
                            ptr = indexPtr++;
                            //not listed so add individual x, y, z coordinates to positions
                            for (let k = 0; k < 3; k++) {
                                positions.push(currentPositions[3 * facet[j] + k]);
                            }
                            if (currentColors !== null && currentColors !== void 0) {
                                for (let k = 0; k < 4; k++) {
                                    colors.push(currentColors[4 * facet[j] + k]);
                                }
                            }
                            if (currentUVs !== null && currentUVs !== void 0) {
                                for (let k = 0; k < 2; k++) {
                                    uvs.push(currentUVs[2 * facet[j] + k]);
                                }
                            }
                            if (currentMatrixIndices !== null && currentMatrixIndices !== void 0) {
                                for (let k = 0; k < 4; k++) {
                                    matrixIndices.push(currentMatrixIndices[4 * facet[j] + k]);
                                }
                            }
                            if (currentMatrixWeights !== null && currentMatrixWeights !== void 0) {
                                for (let k = 0; k < 4; k++) {
                                    matrixWeights.push(currentMatrixWeights[4 * facet[j] + k]);
                                }
                            }
                            if (currentMatrixIndicesExtra !== null && currentMatrixIndicesExtra !== void 0) {
                                for (let k = 0; k < 4; k++) {
                                    matrixIndicesExtra.push(currentMatrixIndicesExtra[4 * facet[j] + k]);
                                }
                            }
                            if (currentMatrixWeightsExtra !== null && currentMatrixWeightsExtra !== void 0) {
                                for (let k = 0; k < 4; k++) {
                                    matrixWeightsExtra.push(currentMatrixWeightsExtra[4 * facet[j] + k]);
                                }
                            }
                        }
                        // add new index pointer to indices array
                        indices.push(ptr);
                    }
                }
            }
            const normals = new Array();
            _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.ComputeNormals(positions, indices, normals);
            //create new vertex data object and update
            vertex_data.positions = positions;
            vertex_data.indices = indices;
            vertex_data.normals = normals;
            if (currentUVs !== null && currentUVs !== void 0) {
                vertex_data.uvs = uvs;
            }
            if (currentColors !== null && currentColors !== void 0) {
                vertex_data.colors = colors;
            }
            if (currentMatrixIndices !== null && currentMatrixIndices !== void 0) {
                vertex_data.matricesIndices = matrixIndices;
            }
            if (currentMatrixWeights !== null && currentMatrixWeights !== void 0) {
                vertex_data.matricesWeights = matrixWeights;
            }
            if (currentMatrixIndicesExtra !== null && currentMatrixIndicesExtra !== void 0) {
                vertex_data.matricesIndicesExtra = matrixIndicesExtra;
            }
            if (currentMatrixWeights !== null && currentMatrixWeights !== void 0) {
                vertex_data.matricesWeightsExtra = matrixWeightsExtra;
            }
            vertex_data.applyToMesh(this, this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind));
        }
    }
    // Instances
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/naming-convention
    static _instancedMeshFactory(name, mesh) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_20__/* ._WarnImport */ .n)("InstancedMesh");
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static _PhysicsImpostorParser(scene, physicObject, jsonObject) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_20__/* ._WarnImport */ .n)("PhysicsImpostor");
    }
    /**
     * Creates a new InstancedMesh object from the mesh model.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
     * @param name defines the name of the new instance
     * @returns a new InstancedMesh
     */
    createInstance(name) {
        const instance = Mesh._instancedMeshFactory(name, this);
        instance.parent = this.parent;
        return instance;
    }
    /**
     * Synchronises all the mesh instance submeshes to the current mesh submeshes, if any.
     * After this call, all the mesh instances have the same submeshes than the current mesh.
     * @returns the current mesh
     */
    synchronizeInstances() {
        for (let instanceIndex = 0; instanceIndex < this.instances.length; instanceIndex++) {
            const instance = this.instances[instanceIndex];
            instance._syncSubMeshes();
        }
        return this;
    }
    /**
     * Optimization of the mesh's indices, in case a mesh has duplicated vertices.
     * The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes.
     * This should be used together with the simplification to avoid disappearing triangles.
     * @param successCallback an optional success callback to be called after the optimization finished.
     * @returns the current mesh
     */
    optimizeIndices(successCallback) {
        const indices = this.getIndices();
        const positions = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind);
        if (!positions || !indices) {
            return this;
        }
        const vectorPositions = [];
        for (let pos = 0; pos < positions.length; pos = pos + 3) {
            vectorPositions.push(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(positions, pos));
        }
        const dupes = [];
        _Misc_tools_js__WEBPACK_IMPORTED_MODULE_1__/* .AsyncLoop */ .LV.SyncAsyncForLoop(vectorPositions.length, 40, (iteration) => {
            const realPos = vectorPositions.length - 1 - iteration;
            const testedPosition = vectorPositions[realPos];
            for (let j = 0; j < realPos; ++j) {
                const againstPosition = vectorPositions[j];
                if (testedPosition.equals(againstPosition)) {
                    dupes[realPos] = j;
                    break;
                }
            }
        }, () => {
            for (let i = 0; i < indices.length; ++i) {
                indices[i] = dupes[indices[i]] || indices[i];
            }
            //indices are now reordered
            const originalSubMeshes = this.subMeshes.slice(0);
            this.setIndices(indices);
            this.subMeshes = originalSubMeshes;
            if (successCallback) {
                successCallback(this);
            }
        });
        return this;
    }
    /**
     * Serialize current mesh
     * @param serializationObject defines the object which will receive the serialization data
     * @returns the serialized object
     */
    serialize(serializationObject = {}) {
        serializationObject.name = this.name;
        serializationObject.id = this.id;
        serializationObject.uniqueId = this.uniqueId;
        serializationObject.type = this.getClassName();
        if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y && _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.HasTags(this)) {
            serializationObject.tags = _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.GetTags(this);
        }
        serializationObject.position = this.position.asArray();
        if (this.rotationQuaternion) {
            serializationObject.rotationQuaternion = this.rotationQuaternion.asArray();
        }
        else if (this.rotation) {
            serializationObject.rotation = this.rotation.asArray();
        }
        serializationObject.scaling = this.scaling.asArray();
        if (this._postMultiplyPivotMatrix) {
            serializationObject.pivotMatrix = this.getPivotMatrix().asArray();
        }
        else {
            serializationObject.localMatrix = this.getPivotMatrix().asArray();
        }
        serializationObject.isEnabled = this.isEnabled(false);
        serializationObject.isVisible = this.isVisible;
        serializationObject.infiniteDistance = this.infiniteDistance;
        serializationObject.pickable = this.isPickable;
        serializationObject.receiveShadows = this.receiveShadows;
        serializationObject.billboardMode = this.billboardMode;
        serializationObject.visibility = this.visibility;
        serializationObject.alwaysSelectAsActiveMesh = this.alwaysSelectAsActiveMesh;
        serializationObject.checkCollisions = this.checkCollisions;
        serializationObject.ellipsoid = this.ellipsoid.asArray();
        serializationObject.ellipsoidOffset = this.ellipsoidOffset.asArray();
        serializationObject.doNotSyncBoundingInfo = this.doNotSyncBoundingInfo;
        serializationObject.isBlocker = this.isBlocker;
        serializationObject.sideOrientation = this.sideOrientation;
        // Parent
        if (this.parent) {
            this.parent._serializeAsParent(serializationObject);
        }
        // Geometry
        serializationObject.isUnIndexed = this.isUnIndexed;
        const geometry = this._geometry;
        if (geometry && this.subMeshes) {
            serializationObject.geometryUniqueId = geometry.uniqueId;
            serializationObject.geometryId = geometry.id;
            // SubMeshes
            serializationObject.subMeshes = [];
            for (let subIndex = 0; subIndex < this.subMeshes.length; subIndex++) {
                const subMesh = this.subMeshes[subIndex];
                serializationObject.subMeshes.push({
                    materialIndex: subMesh.materialIndex,
                    verticesStart: subMesh.verticesStart,
                    verticesCount: subMesh.verticesCount,
                    indexStart: subMesh.indexStart,
                    indexCount: subMesh.indexCount,
                });
            }
        }
        // Material
        if (this.material) {
            if (!this.material.doNotSerialize) {
                serializationObject.materialUniqueId = this.material.uniqueId;
                serializationObject.materialId = this.material.id; // back compat
            }
        }
        else {
            this.material = null;
            serializationObject.materialUniqueId = this._scene.defaultMaterial.uniqueId;
            serializationObject.materialId = this._scene.defaultMaterial.id; // back compat
        }
        // Morph targets
        if (this.morphTargetManager) {
            serializationObject.morphTargetManagerId = this.morphTargetManager.uniqueId;
        }
        // Skeleton
        if (this.skeleton) {
            serializationObject.skeletonId = this.skeleton.id;
            serializationObject.numBoneInfluencers = this.numBoneInfluencers;
        }
        // Physics
        //TODO implement correct serialization for physics impostors.
        if (this.getScene()._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_21__/* .SceneComponentConstants */ .v.NAME_PHYSICSENGINE)) {
            const impostor = this.getPhysicsImpostor();
            if (impostor) {
                serializationObject.physicsMass = impostor.getParam("mass");
                serializationObject.physicsFriction = impostor.getParam("friction");
                serializationObject.physicsRestitution = impostor.getParam("mass");
                serializationObject.physicsImpostor = impostor.type;
            }
        }
        // Metadata
        if (this.metadata) {
            serializationObject.metadata = this.metadata;
        }
        // Instances
        serializationObject.instances = [];
        for (let index = 0; index < this.instances.length; index++) {
            const instance = this.instances[index];
            if (instance.doNotSerialize) {
                continue;
            }
            const serializationInstance = {
                name: instance.name,
                id: instance.id,
                isEnabled: instance.isEnabled(false),
                isVisible: instance.isVisible,
                isPickable: instance.isPickable,
                checkCollisions: instance.checkCollisions,
                position: instance.position.asArray(),
                scaling: instance.scaling.asArray(),
            };
            if (instance.parent) {
                instance.parent._serializeAsParent(serializationInstance);
            }
            if (instance.rotationQuaternion) {
                serializationInstance.rotationQuaternion = instance.rotationQuaternion.asArray();
            }
            else if (instance.rotation) {
                serializationInstance.rotation = instance.rotation.asArray();
            }
            // Physics
            //TODO implement correct serialization for physics impostors.
            if (this.getScene()._getComponent(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_21__/* .SceneComponentConstants */ .v.NAME_PHYSICSENGINE)) {
                const impostor = instance.getPhysicsImpostor();
                if (impostor) {
                    serializationInstance.physicsMass = impostor.getParam("mass");
                    serializationInstance.physicsFriction = impostor.getParam("friction");
                    serializationInstance.physicsRestitution = impostor.getParam("mass");
                    serializationInstance.physicsImpostor = impostor.type;
                }
            }
            // Metadata
            if (instance.metadata) {
                serializationInstance.metadata = instance.metadata;
            }
            // Action Manager
            if (instance.actionManager) {
                serializationInstance.actions = instance.actionManager.serialize(instance.name);
            }
            serializationObject.instances.push(serializationInstance);
            // Animations
            _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_17__/* .SerializationHelper */ .p.AppendSerializedAnimations(instance, serializationInstance);
            serializationInstance.ranges = instance.serializeAnimationRanges();
        }
        // Thin instances
        if (this._thinInstanceDataStorage.instancesCount && this._thinInstanceDataStorage.matrixData) {
            serializationObject.thinInstances = {
                instancesCount: this._thinInstanceDataStorage.instancesCount,
                matrixData: Array.from(this._thinInstanceDataStorage.matrixData),
                matrixBufferSize: this._thinInstanceDataStorage.matrixBufferSize,
                enablePicking: this.thinInstanceEnablePicking,
            };
            if (this._userThinInstanceBuffersStorage) {
                const userThinInstance = {
                    data: {},
                    sizes: {},
                    strides: {},
                };
                for (const kind in this._userThinInstanceBuffersStorage.data) {
                    userThinInstance.data[kind] = Array.from(this._userThinInstanceBuffersStorage.data[kind]);
                    userThinInstance.sizes[kind] = this._userThinInstanceBuffersStorage.sizes[kind];
                    userThinInstance.strides[kind] = this._userThinInstanceBuffersStorage.strides[kind];
                }
                serializationObject.thinInstances.userThinInstance = userThinInstance;
            }
        }
        // Animations
        _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_17__/* .SerializationHelper */ .p.AppendSerializedAnimations(this, serializationObject);
        serializationObject.ranges = this.serializeAnimationRanges();
        // Layer mask
        serializationObject.layerMask = this.layerMask;
        // Alpha
        serializationObject.alphaIndex = this.alphaIndex;
        serializationObject.hasVertexAlpha = this.hasVertexAlpha;
        // Overlay
        serializationObject.overlayAlpha = this.overlayAlpha;
        serializationObject.overlayColor = this.overlayColor.asArray();
        serializationObject.renderOverlay = this.renderOverlay;
        // Fog
        serializationObject.applyFog = this.applyFog;
        // Action Manager
        if (this.actionManager) {
            serializationObject.actions = this.actionManager.serialize(this.name);
        }
        return serializationObject;
    }
    /** @internal */
    _syncGeometryWithMorphTargetManager() {
        if (!this.geometry) {
            return;
        }
        this._markSubMeshesAsAttributesDirty();
        const morphTargetManager = this._internalAbstractMeshDataInfo._morphTargetManager;
        if (morphTargetManager && morphTargetManager.vertexCount) {
            if (morphTargetManager.vertexCount !== this.getTotalVertices()) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__/* .Logger */ .V.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count.");
                this.morphTargetManager = null;
                return;
            }
            if (morphTargetManager.isUsingTextureForTargets) {
                return;
            }
            for (let index = 0; index < morphTargetManager.numInfluencers; index++) {
                const morphTarget = morphTargetManager.getActiveTarget(index);
                const positions = morphTarget.getPositions();
                if (!positions) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__/* .Logger */ .V.Error("Invalid morph target. Target must have positions.");
                    return;
                }
                this.geometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind + index, positions, false, 3);
                const normals = morphTarget.getNormals();
                if (normals) {
                    this.geometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind + index, normals, false, 3);
                }
                const tangents = morphTarget.getTangents();
                if (tangents) {
                    this.geometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.TangentKind + index, tangents, false, 3);
                }
                const uvs = morphTarget.getUVs();
                if (uvs) {
                    this.geometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UVKind + "_" + index, uvs, false, 2);
                }
            }
        }
        else {
            let index = 0;
            // Positions
            while (this.geometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind + index)) {
                this.geometry.removeVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind + index);
                if (this.geometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind + index)) {
                    this.geometry.removeVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind + index);
                }
                if (this.geometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.TangentKind + index)) {
                    this.geometry.removeVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.TangentKind + index);
                }
                if (this.geometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UVKind + index)) {
                    this.geometry.removeVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UVKind + "_" + index);
                }
                index++;
            }
        }
    }
    /**
     * Returns a new Mesh object parsed from the source provided.
     * @param parsedMesh is the source
     * @param scene defines the hosting scene
     * @param rootUrl is the root URL to prefix the `delayLoadingFile` property with
     * @returns a new Mesh
     */
    static Parse(parsedMesh, scene, rootUrl) {
        let mesh;
        if (parsedMesh.type && parsedMesh.type === "LinesMesh") {
            mesh = Mesh._LinesMeshParser(parsedMesh, scene);
        }
        else if (parsedMesh.type && parsedMesh.type === "GroundMesh") {
            mesh = Mesh._GroundMeshParser(parsedMesh, scene);
        }
        else if (parsedMesh.type && parsedMesh.type === "GoldbergMesh") {
            mesh = Mesh._GoldbergMeshParser(parsedMesh, scene);
        }
        else if (parsedMesh.type && parsedMesh.type === "GreasedLineMesh") {
            mesh = Mesh._GreasedLineMeshParser(parsedMesh, scene);
        }
        else if (parsedMesh.type && parsedMesh.type === "TrailMesh") {
            mesh = Mesh._TrailMeshParser(parsedMesh, scene);
        }
        else {
            mesh = new Mesh(parsedMesh.name, scene);
        }
        mesh.id = parsedMesh.id;
        mesh._waitingParsedUniqueId = parsedMesh.uniqueId;
        if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y) {
            _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.AddTagsTo(mesh, parsedMesh.tags);
        }
        mesh.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedMesh.position);
        if (parsedMesh.metadata !== undefined) {
            mesh.metadata = parsedMesh.metadata;
        }
        if (parsedMesh.rotationQuaternion) {
            mesh.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Quaternion */ .PT.FromArray(parsedMesh.rotationQuaternion);
        }
        else if (parsedMesh.rotation) {
            mesh.rotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedMesh.rotation);
        }
        mesh.scaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedMesh.scaling);
        if (parsedMesh.localMatrix) {
            mesh.setPreTransformMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Matrix */ .uq.FromArray(parsedMesh.localMatrix));
        }
        else if (parsedMesh.pivotMatrix) {
            mesh.setPivotMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Matrix */ .uq.FromArray(parsedMesh.pivotMatrix));
        }
        mesh.setEnabled(parsedMesh.isEnabled);
        mesh.isVisible = parsedMesh.isVisible;
        mesh.infiniteDistance = parsedMesh.infiniteDistance;
        mesh.alwaysSelectAsActiveMesh = !!parsedMesh.alwaysSelectAsActiveMesh;
        mesh.showBoundingBox = parsedMesh.showBoundingBox;
        mesh.showSubMeshesBoundingBox = parsedMesh.showSubMeshesBoundingBox;
        if (parsedMesh.applyFog !== undefined) {
            mesh.applyFog = parsedMesh.applyFog;
        }
        if (parsedMesh.pickable !== undefined) {
            mesh.isPickable = parsedMesh.pickable;
        }
        if (parsedMesh.alphaIndex !== undefined) {
            mesh.alphaIndex = parsedMesh.alphaIndex;
        }
        mesh.receiveShadows = parsedMesh.receiveShadows;
        if (parsedMesh.billboardMode !== undefined) {
            mesh.billboardMode = parsedMesh.billboardMode;
        }
        if (parsedMesh.visibility !== undefined) {
            mesh.visibility = parsedMesh.visibility;
        }
        mesh.checkCollisions = parsedMesh.checkCollisions;
        mesh.doNotSyncBoundingInfo = !!parsedMesh.doNotSyncBoundingInfo;
        if (parsedMesh.ellipsoid) {
            mesh.ellipsoid = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedMesh.ellipsoid);
        }
        if (parsedMesh.ellipsoidOffset) {
            mesh.ellipsoidOffset = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedMesh.ellipsoidOffset);
        }
        // For Backward compatibility ("!=" to exclude null and undefined)
        if (parsedMesh.overrideMaterialSideOrientation != null) {
            mesh.sideOrientation = parsedMesh.overrideMaterialSideOrientation;
        }
        if (parsedMesh.sideOrientation !== undefined) {
            mesh.sideOrientation = parsedMesh.sideOrientation;
        }
        if (parsedMesh.isBlocker !== undefined) {
            mesh.isBlocker = parsedMesh.isBlocker;
        }
        mesh._shouldGenerateFlatShading = parsedMesh.useFlatShading;
        // freezeWorldMatrix
        if (parsedMesh.freezeWorldMatrix) {
            mesh._waitingData.freezeWorldMatrix = parsedMesh.freezeWorldMatrix;
        }
        // Parent
        if (parsedMesh.parentId !== undefined) {
            mesh._waitingParentId = parsedMesh.parentId;
        }
        if (parsedMesh.parentInstanceIndex !== undefined) {
            mesh._waitingParentInstanceIndex = parsedMesh.parentInstanceIndex;
        }
        // Actions
        if (parsedMesh.actions !== undefined) {
            mesh._waitingData.actions = parsedMesh.actions;
        }
        // Overlay
        if (parsedMesh.overlayAlpha !== undefined) {
            mesh.overlayAlpha = parsedMesh.overlayAlpha;
        }
        if (parsedMesh.overlayColor !== undefined) {
            mesh.overlayColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_7__/* .Color3 */ .v9.FromArray(parsedMesh.overlayColor);
        }
        if (parsedMesh.renderOverlay !== undefined) {
            mesh.renderOverlay = parsedMesh.renderOverlay;
        }
        // Geometry
        mesh.isUnIndexed = !!parsedMesh.isUnIndexed;
        mesh.hasVertexAlpha = parsedMesh.hasVertexAlpha;
        if (parsedMesh.delayLoadingFile) {
            mesh.delayLoadState = 4;
            mesh.delayLoadingFile = rootUrl + parsedMesh.delayLoadingFile;
            mesh.buildBoundingInfo(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedMesh.boundingBoxMinimum), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedMesh.boundingBoxMaximum));
            if (parsedMesh._binaryInfo) {
                mesh._binaryInfo = parsedMesh._binaryInfo;
            }
            mesh._delayInfo = [];
            if (parsedMesh.hasUVs) {
                mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UVKind);
            }
            if (parsedMesh.hasUVs2) {
                mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UV2Kind);
            }
            if (parsedMesh.hasUVs3) {
                mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UV3Kind);
            }
            if (parsedMesh.hasUVs4) {
                mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UV4Kind);
            }
            if (parsedMesh.hasUVs5) {
                mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UV5Kind);
            }
            if (parsedMesh.hasUVs6) {
                mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.UV6Kind);
            }
            if (parsedMesh.hasColors) {
                mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.ColorKind);
            }
            if (parsedMesh.hasMatricesIndices) {
                mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesIndicesKind);
            }
            if (parsedMesh.hasMatricesWeights) {
                mesh._delayInfo.push(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind);
            }
            mesh._delayLoadingFunction = _geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V._ImportGeometry;
            if (_Loading_sceneLoaderFlags_js__WEBPACK_IMPORTED_MODULE_16__/* .SceneLoaderFlags */ .B.ForceFullSceneLoadingForIncremental) {
                mesh._checkDelayState();
            }
        }
        else {
            _geometry_js__WEBPACK_IMPORTED_MODULE_11__/* .Geometry */ .V._ImportGeometry(parsedMesh, mesh);
        }
        // Material
        if (parsedMesh.materialUniqueId) {
            mesh._waitingMaterialId = parsedMesh.materialUniqueId;
        }
        else if (parsedMesh.materialId) {
            mesh._waitingMaterialId = parsedMesh.materialId;
        }
        // Morph targets
        if (parsedMesh.morphTargetManagerId > -1) {
            mesh._waitingMorphTargetManagerId = parsedMesh.morphTargetManagerId;
        }
        // Skeleton
        if (parsedMesh.skeletonId !== undefined && parsedMesh.skeletonId !== null) {
            mesh.skeleton = scene.getLastSkeletonById(parsedMesh.skeletonId);
            if (parsedMesh.numBoneInfluencers) {
                mesh.numBoneInfluencers = parsedMesh.numBoneInfluencers;
            }
        }
        // Animations
        if (parsedMesh.animations) {
            for (let animationIndex = 0; animationIndex < parsedMesh.animations.length; animationIndex++) {
                const parsedAnimation = parsedMesh.animations[animationIndex];
                const internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_19__/* .GetClass */ .n9)("BABYLON.Animation");
                if (internalClass) {
                    mesh.animations.push(internalClass.Parse(parsedAnimation));
                }
            }
            _node_js__WEBPACK_IMPORTED_MODULE_8__/* .Node */ .b.ParseAnimationRanges(mesh, parsedMesh, scene);
        }
        if (parsedMesh.autoAnimate) {
            scene.beginAnimation(mesh, parsedMesh.autoAnimateFrom, parsedMesh.autoAnimateTo, parsedMesh.autoAnimateLoop, parsedMesh.autoAnimateSpeed || 1.0);
        }
        // Layer Mask
        if (parsedMesh.layerMask && !isNaN(parsedMesh.layerMask)) {
            mesh.layerMask = Math.abs(parseInt(parsedMesh.layerMask));
        }
        else {
            mesh.layerMask = 0x0fffffff;
        }
        // Physics
        if (parsedMesh.physicsImpostor) {
            mesh.physicsImpostor = Mesh._PhysicsImpostorParser(scene, mesh, parsedMesh);
        }
        // Levels
        if (parsedMesh.lodMeshIds) {
            mesh._waitingData.lods = {
                ids: parsedMesh.lodMeshIds,
                distances: parsedMesh.lodDistances ? parsedMesh.lodDistances : null,
                coverages: parsedMesh.lodCoverages ? parsedMesh.lodCoverages : null,
            };
        }
        // Instances
        if (parsedMesh.instances) {
            for (let index = 0; index < parsedMesh.instances.length; index++) {
                const parsedInstance = parsedMesh.instances[index];
                const instance = mesh.createInstance(parsedInstance.name);
                if (parsedInstance.id) {
                    instance.id = parsedInstance.id;
                }
                if (_Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y) {
                    if (parsedInstance.tags) {
                        _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.AddTagsTo(instance, parsedInstance.tags);
                    }
                    else {
                        _Misc_tags_js__WEBPACK_IMPORTED_MODULE_3__/* .Tags */ .Y.AddTagsTo(instance, parsedMesh.tags);
                    }
                }
                instance.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedInstance.position);
                if (parsedInstance.metadata !== undefined) {
                    instance.metadata = parsedInstance.metadata;
                }
                if (parsedInstance.parentId !== undefined) {
                    instance._waitingParentId = parsedInstance.parentId;
                }
                if (parsedInstance.parentInstanceIndex !== undefined) {
                    instance._waitingParentInstanceIndex = parsedInstance.parentInstanceIndex;
                }
                if (parsedInstance.isEnabled !== undefined && parsedInstance.isEnabled !== null) {
                    instance.setEnabled(parsedInstance.isEnabled);
                }
                if (parsedInstance.isVisible !== undefined && parsedInstance.isVisible !== null) {
                    instance.isVisible = parsedInstance.isVisible;
                }
                if (parsedInstance.isPickable !== undefined && parsedInstance.isPickable !== null) {
                    instance.isPickable = parsedInstance.isPickable;
                }
                if (parsedInstance.rotationQuaternion) {
                    instance.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Quaternion */ .PT.FromArray(parsedInstance.rotationQuaternion);
                }
                else if (parsedInstance.rotation) {
                    instance.rotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedInstance.rotation);
                }
                instance.scaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.FromArray(parsedInstance.scaling);
                if (parsedInstance.checkCollisions != undefined && parsedInstance.checkCollisions != null) {
                    instance.checkCollisions = parsedInstance.checkCollisions;
                }
                if (parsedInstance.pickable != undefined && parsedInstance.pickable != null) {
                    instance.isPickable = parsedInstance.pickable;
                }
                if (parsedInstance.showBoundingBox != undefined && parsedInstance.showBoundingBox != null) {
                    instance.showBoundingBox = parsedInstance.showBoundingBox;
                }
                if (parsedInstance.showSubMeshesBoundingBox != undefined && parsedInstance.showSubMeshesBoundingBox != null) {
                    instance.showSubMeshesBoundingBox = parsedInstance.showSubMeshesBoundingBox;
                }
                if (parsedInstance.alphaIndex != undefined && parsedInstance.showSubMeshesBoundingBox != null) {
                    instance.alphaIndex = parsedInstance.alphaIndex;
                }
                // Physics
                if (parsedInstance.physicsImpostor) {
                    instance.physicsImpostor = Mesh._PhysicsImpostorParser(scene, instance, parsedInstance);
                }
                // Actions
                if (parsedInstance.actions !== undefined) {
                    instance._waitingData.actions = parsedInstance.actions;
                }
                // Animation
                if (parsedInstance.animations) {
                    for (let animationIndex = 0; animationIndex < parsedInstance.animations.length; animationIndex++) {
                        const parsedAnimation = parsedInstance.animations[animationIndex];
                        const internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_19__/* .GetClass */ .n9)("BABYLON.Animation");
                        if (internalClass) {
                            instance.animations.push(internalClass.Parse(parsedAnimation));
                        }
                    }
                    _node_js__WEBPACK_IMPORTED_MODULE_8__/* .Node */ .b.ParseAnimationRanges(instance, parsedInstance, scene);
                    if (parsedInstance.autoAnimate) {
                        scene.beginAnimation(instance, parsedInstance.autoAnimateFrom, parsedInstance.autoAnimateTo, parsedInstance.autoAnimateLoop, parsedInstance.autoAnimateSpeed || 1.0);
                    }
                }
            }
        }
        // Thin instances
        if (parsedMesh.thinInstances) {
            const thinInstances = parsedMesh.thinInstances;
            mesh.thinInstanceEnablePicking = !!thinInstances.enablePicking;
            if (thinInstances.matrixData) {
                mesh.thinInstanceSetBuffer("matrix", new Float32Array(thinInstances.matrixData), 16, false);
                mesh._thinInstanceDataStorage.matrixBufferSize = thinInstances.matrixBufferSize;
                mesh._thinInstanceDataStorage.instancesCount = thinInstances.instancesCount;
            }
            else {
                mesh._thinInstanceDataStorage.matrixBufferSize = thinInstances.matrixBufferSize;
            }
            if (parsedMesh.thinInstances.userThinInstance) {
                const userThinInstance = parsedMesh.thinInstances.userThinInstance;
                for (const kind in userThinInstance.data) {
                    mesh.thinInstanceSetBuffer(kind, new Float32Array(userThinInstance.data[kind]), userThinInstance.strides[kind], false);
                    mesh._userThinInstanceBuffersStorage.sizes[kind] = userThinInstance.sizes[kind];
                }
            }
        }
        return mesh;
    }
    // Skeletons
    /**
     * Prepare internal position array for software CPU skinning
     * @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh
     */
    setPositionsForCPUSkinning() {
        const internalDataInfo = this._internalMeshDataInfo;
        if (!internalDataInfo._sourcePositions) {
            const source = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind);
            if (!source) {
                return internalDataInfo._sourcePositions;
            }
            internalDataInfo._sourcePositions = new Float32Array(source);
            if (!this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind)) {
                this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind, source, true);
            }
        }
        return internalDataInfo._sourcePositions;
    }
    /**
     * Prepare internal normal array for software CPU skinning
     * @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
     */
    setNormalsForCPUSkinning() {
        const internalDataInfo = this._internalMeshDataInfo;
        if (!internalDataInfo._sourceNormals) {
            const source = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind);
            if (!source) {
                return internalDataInfo._sourceNormals;
            }
            internalDataInfo._sourceNormals = new Float32Array(source);
            if (!this.isVertexBufferUpdatable(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind)) {
                this.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind, source, true);
            }
        }
        return internalDataInfo._sourceNormals;
    }
    /**
     * Updates the vertex buffer by applying transformation from the bones
     * @param skeleton defines the skeleton to apply to current mesh
     * @returns the current mesh
     */
    applySkeleton(skeleton) {
        if (!this.geometry) {
            return this;
        }
        if (this.geometry._softwareSkinningFrameId == this.getScene().getFrameId()) {
            return this;
        }
        this.geometry._softwareSkinningFrameId = this.getScene().getFrameId();
        if (!this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind)) {
            return this;
        }
        if (!this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesIndicesKind)) {
            return this;
        }
        if (!this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind)) {
            return this;
        }
        const hasNormals = this.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind);
        const internalDataInfo = this._internalMeshDataInfo;
        if (!internalDataInfo._sourcePositions) {
            const submeshes = this.subMeshes.slice();
            this.setPositionsForCPUSkinning();
            this.subMeshes = submeshes;
        }
        if (hasNormals && !internalDataInfo._sourceNormals) {
            this.setNormalsForCPUSkinning();
        }
        // positionsData checks for not being Float32Array will only pass at most once
        let positionsData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind);
        if (!positionsData) {
            return this;
        }
        if (!(positionsData instanceof Float32Array)) {
            positionsData = new Float32Array(positionsData);
        }
        // normalsData checks for not being Float32Array will only pass at most once
        let normalsData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind);
        if (hasNormals) {
            if (!normalsData) {
                return this;
            }
            if (!(normalsData instanceof Float32Array)) {
                normalsData = new Float32Array(normalsData);
            }
        }
        const matricesIndicesData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesIndicesKind);
        const matricesWeightsData = this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsKind);
        if (!matricesWeightsData || !matricesIndicesData) {
            return this;
        }
        const needExtras = this.numBoneInfluencers > 4;
        const matricesIndicesExtraData = needExtras ? this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesIndicesExtraKind) : null;
        const matricesWeightsExtraData = needExtras ? this.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.MatricesWeightsExtraKind) : null;
        const skeletonMatrices = skeleton.getTransformMatrices(this);
        const tempVector3 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Zero();
        const finalMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Matrix */ .uq();
        const tempMatrix = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Matrix */ .uq();
        let matWeightIdx = 0;
        let inf;
        for (let index = 0; index < positionsData.length; index += 3, matWeightIdx += 4) {
            let weight;
            for (inf = 0; inf < 4; inf++) {
                weight = matricesWeightsData[matWeightIdx + inf];
                if (weight > 0) {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Matrix */ .uq.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);
                    finalMatrix.addToSelf(tempMatrix);
                }
            }
            if (needExtras) {
                for (inf = 0; inf < 4; inf++) {
                    weight = matricesWeightsExtraData[matWeightIdx + inf];
                    if (weight > 0) {
                        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Matrix */ .uq.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);
                        finalMatrix.addToSelf(tempMatrix);
                    }
                }
            }
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(internalDataInfo._sourcePositions[index], internalDataInfo._sourcePositions[index + 1], internalDataInfo._sourcePositions[index + 2], finalMatrix, tempVector3);
            tempVector3.toArray(positionsData, index);
            if (hasNormals) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.TransformNormalFromFloatsToRef(internalDataInfo._sourceNormals[index], internalDataInfo._sourceNormals[index + 1], internalDataInfo._sourceNormals[index + 2], finalMatrix, tempVector3);
                tempVector3.toArray(normalsData, index);
            }
            finalMatrix.reset();
        }
        this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.PositionKind, positionsData);
        if (hasNormals) {
            this.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_9__/* .VertexBuffer */ .R.NormalKind, normalsData);
        }
        return this;
    }
    // Tools
    /**
     * Returns an object containing a min and max Vector3 which are the minimum and maximum vectors of each mesh bounding box from the passed array, in the world coordinates
     * @param meshes defines the list of meshes to scan
     * @returns an object `{min:` Vector3`, max:` Vector3`}`
     */
    static MinMax(meshes) {
        let minVector = null;
        let maxVector = null;
        meshes.forEach(function (mesh) {
            const boundingInfo = mesh.getBoundingInfo();
            const boundingBox = boundingInfo.boundingBox;
            if (!minVector || !maxVector) {
                minVector = boundingBox.minimumWorld;
                maxVector = boundingBox.maximumWorld;
            }
            else {
                minVector.minimizeInPlace(boundingBox.minimumWorld);
                maxVector.maximizeInPlace(boundingBox.maximumWorld);
            }
        });
        if (!minVector || !maxVector) {
            return {
                min: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Zero(),
                max: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Zero(),
            };
        }
        return {
            min: minVector,
            max: maxVector,
        };
    }
    /**
     * Returns the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array
     * @param meshesOrMinMaxVector could be an array of meshes or a `{min:` Vector3`, max:` Vector3`}` object
     * @returns a vector3
     */
    static Center(meshesOrMinMaxVector) {
        const minMaxVector = meshesOrMinMaxVector instanceof Array ? Mesh.MinMax(meshesOrMinMaxVector) : meshesOrMinMaxVector;
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq.Center(minMaxVector.min, minMaxVector.max);
    }
    /**
     * Merge the array of meshes into a single mesh for performance reasons.
     * @param meshes array of meshes with the vertices to merge. Entries cannot be empty meshes.
     * @param disposeSource when true (default), dispose of the vertices from the source meshes.
     * @param allow32BitsIndices when the sum of the vertices > 64k, this must be set to true.
     * @param meshSubclass (optional) can be set to a Mesh where the merged vertices will be inserted.
     * @param subdivideWithSubMeshes when true (false default), subdivide mesh into subMeshes.
     * @param multiMultiMaterials when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
     * @returns a new mesh
     */
    static MergeMeshes(meshes, disposeSource = true, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials) {
        return (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_4__/* .runCoroutineSync */ .V1)(Mesh._MergeMeshesCoroutine(meshes, disposeSource, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials, false));
    }
    /**
     * Merge the array of meshes into a single mesh for performance reasons.
     * @param meshes array of meshes with the vertices to merge. Entries cannot be empty meshes.
     * @param disposeSource when true (default), dispose of the vertices from the source meshes.
     * @param allow32BitsIndices when the sum of the vertices > 64k, this must be set to true.
     * @param meshSubclass (optional) can be set to a Mesh where the merged vertices will be inserted.
     * @param subdivideWithSubMeshes when true (false default), subdivide mesh into subMeshes.
     * @param multiMultiMaterials when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
     * @returns a new mesh
     */
    static MergeMeshesAsync(meshes, disposeSource = true, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials) {
        return (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_4__/* .runCoroutineAsync */ .kj)(Mesh._MergeMeshesCoroutine(meshes, disposeSource, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials, true), (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_4__/* .createYieldingScheduler */ .VP)());
    }
    static *_MergeMeshesCoroutine(meshes, disposeSource = true, allow32BitsIndices, meshSubclass, subdivideWithSubMeshes, multiMultiMaterials, isAsync) {
        // Remove any null/undefined entries from the mesh array
        meshes = meshes.filter(Boolean);
        if (meshes.length === 0) {
            return null;
        }
        let index;
        if (!allow32BitsIndices) {
            let totalVertices = 0;
            // Counting vertices
            for (index = 0; index < meshes.length; index++) {
                totalVertices += meshes[index].getTotalVertices();
                if (totalVertices >= 65536) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__/* .Logger */ .V.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices");
                    return null;
                }
            }
        }
        if (multiMultiMaterials) {
            subdivideWithSubMeshes = false;
        }
        const materialArray = new Array();
        const materialIndexArray = new Array();
        // Merge
        const indiceArray = new Array();
        const currentsideOrientation = meshes[0].sideOrientation;
        for (index = 0; index < meshes.length; index++) {
            const mesh = meshes[index];
            if (mesh.isAnInstance) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__/* .Logger */ .V.Warn("Cannot merge instance meshes.");
                return null;
            }
            if (currentsideOrientation !== mesh.sideOrientation) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_18__/* .Logger */ .V.Warn("Cannot merge meshes with different sideOrientation values.");
                return null;
            }
            if (subdivideWithSubMeshes) {
                indiceArray.push(mesh.getTotalIndices());
            }
            if (multiMultiMaterials) {
                if (mesh.material) {
                    const material = mesh.material;
                    if (material instanceof _Materials_multiMaterial_js__WEBPACK_IMPORTED_MODULE_15__/* .MultiMaterial */ .F) {
                        for (let matIndex = 0; matIndex < material.subMaterials.length; matIndex++) {
                            if (materialArray.indexOf(material.subMaterials[matIndex]) < 0) {
                                materialArray.push(material.subMaterials[matIndex]);
                            }
                        }
                        for (let subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
                            materialIndexArray.push(materialArray.indexOf(material.subMaterials[mesh.subMeshes[subIndex].materialIndex]));
                            indiceArray.push(mesh.subMeshes[subIndex].indexCount);
                        }
                    }
                    else {
                        if (materialArray.indexOf(material) < 0) {
                            materialArray.push(material);
                        }
                        for (let subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
                            materialIndexArray.push(materialArray.indexOf(material));
                            indiceArray.push(mesh.subMeshes[subIndex].indexCount);
                        }
                    }
                }
                else {
                    for (let subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
                        materialIndexArray.push(0);
                        indiceArray.push(mesh.subMeshes[subIndex].indexCount);
                    }
                }
            }
        }
        const source = meshes[0];
        const getVertexDataFromMesh = (mesh) => {
            const wm = mesh.computeWorldMatrix(true);
            const vertexData = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.ExtractFromMesh(mesh, false, false);
            return { vertexData, transform: wm };
        };
        const { vertexData: sourceVertexData, transform: sourceTransform } = getVertexDataFromMesh(source);
        if (isAsync) {
            yield;
        }
        const meshVertexDatas = new Array(meshes.length - 1);
        for (let i = 1; i < meshes.length; i++) {
            meshVertexDatas[i - 1] = getVertexDataFromMesh(meshes[i]);
            if (isAsync) {
                yield;
            }
        }
        const mergeCoroutine = sourceVertexData._mergeCoroutine(sourceTransform, meshVertexDatas, allow32BitsIndices, isAsync, !disposeSource);
        let mergeCoroutineStep = mergeCoroutine.next();
        while (!mergeCoroutineStep.done) {
            if (isAsync) {
                yield;
            }
            mergeCoroutineStep = mergeCoroutine.next();
        }
        const vertexData = mergeCoroutineStep.value;
        if (!meshSubclass) {
            meshSubclass = new Mesh(source.name + "_merged", source.getScene());
        }
        const applyToCoroutine = vertexData._applyToCoroutine(meshSubclass, undefined, isAsync);
        let applyToCoroutineStep = applyToCoroutine.next();
        while (!applyToCoroutineStep.done) {
            if (isAsync) {
                yield;
            }
            applyToCoroutineStep = applyToCoroutine.next();
        }
        // Setting properties
        meshSubclass.checkCollisions = source.checkCollisions;
        meshSubclass.sideOrientation = source.sideOrientation;
        // Cleaning
        if (disposeSource) {
            for (index = 0; index < meshes.length; index++) {
                meshes[index].dispose();
            }
        }
        // Subdivide
        if (subdivideWithSubMeshes || multiMultiMaterials) {
            //-- removal of global submesh
            meshSubclass.releaseSubMeshes();
            index = 0;
            let offset = 0;
            //-- apply subdivision according to index table
            while (index < indiceArray.length) {
                _subMesh_js__WEBPACK_IMPORTED_MODULE_13__/* .SubMesh */ .K.CreateFromIndices(0, offset, indiceArray[index], meshSubclass, undefined, false);
                offset += indiceArray[index];
                index++;
            }
            for (const subMesh of meshSubclass.subMeshes) {
                subMesh.refreshBoundingInfo();
            }
            meshSubclass.computeWorldMatrix(true);
        }
        if (multiMultiMaterials) {
            const newMultiMaterial = new _Materials_multiMaterial_js__WEBPACK_IMPORTED_MODULE_15__/* .MultiMaterial */ .F(source.name + "_merged", source.getScene());
            newMultiMaterial.subMaterials = materialArray;
            for (let subIndex = 0; subIndex < meshSubclass.subMeshes.length; subIndex++) {
                meshSubclass.subMeshes[subIndex].materialIndex = materialIndexArray[subIndex];
            }
            meshSubclass.material = newMultiMaterial;
        }
        else {
            meshSubclass.material = source.material;
        }
        return meshSubclass;
    }
    /**
     * @internal
     */
    addInstance(instance) {
        instance._indexInSourceMeshInstanceArray = this.instances.length;
        this.instances.push(instance);
    }
    /**
     * @internal
     */
    removeInstance(instance) {
        // Remove from mesh
        const index = instance._indexInSourceMeshInstanceArray;
        if (index != -1) {
            if (index !== this.instances.length - 1) {
                const last = this.instances[this.instances.length - 1];
                this.instances[index] = last;
                last._indexInSourceMeshInstanceArray = index;
            }
            instance._indexInSourceMeshInstanceArray = -1;
            this.instances.pop();
        }
    }
    /** @internal */
    _shouldConvertRHS() {
        return this._scene.useRightHandedSystem && this.sideOrientation === _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.CounterClockWiseSideOrientation;
    }
    /** @internal */
    _getRenderingFillMode(fillMode) {
        const scene = this.getScene();
        if (scene.forcePointsCloud)
            return _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.PointFillMode;
        if (scene.forceWireframe)
            return _Materials_material_js__WEBPACK_IMPORTED_MODULE_14__/* .Material */ .i.WireFrameFillMode;
        return this.overrideRenderingFillMode ?? fillMode;
    }
    // deprecated methods
    /**
     * Sets the mesh material by the material or multiMaterial `id` property
     * @param id is a string identifying the material or the multiMaterial
     * @returns the current mesh
     * @deprecated Please use MeshBuilder instead Please use setMaterialById instead
     */
    setMaterialByID(id) {
        return this.setMaterialById(id);
    }
    /**
     * Creates a ribbon mesh.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
     * @param name defines the name of the mesh to create
     * @param pathArray is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry.
     * @param closeArray creates a seam between the first and the last paths of the path array (default is false)
     * @param closePath creates a seam between the first and the last points of each path of the path array
     * @param offset is taken in account only if the `pathArray` is containing a single path
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @param instance defines an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#ribbon)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateRibbon(name, pathArray, closeArray, closePath, offset, scene, updatable, sideOrientation, instance) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a plane polygonal mesh.  By default, this is a disc.
     * @param name defines the name of the mesh to create
     * @param radius sets the radius size (float) of the polygon (default 0.5)
     * @param tessellation sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateDisc(name, radius, tessellation, scene, updatable, sideOrientation) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a box mesh.
     * @param name defines the name of the mesh to create
     * @param size sets the size (float) of each box side (default 1)
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateBox(name, size, scene, updatable, sideOrientation) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a sphere mesh.
     * @param name defines the name of the mesh to create
     * @param segments sets the sphere number of horizontal stripes (positive integer, default 32)
     * @param diameter sets the diameter size (float) of the sphere (default 1)
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateSphere(name, segments, diameter, scene, updatable, sideOrientation) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a hemisphere mesh.
     * @param name defines the name of the mesh to create
     * @param segments sets the sphere number of horizontal stripes (positive integer, default 32)
     * @param diameter sets the diameter size (float) of the sphere (default 1)
     * @param scene defines the hosting scene
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateHemisphere(name, segments, diameter, scene) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a cylinder or a cone mesh.
     * @param name defines the name of the mesh to create
     * @param height sets the height size (float) of the cylinder/cone (float, default 2)
     * @param diameterTop set the top cap diameter (floats, default 1)
     * @param diameterBottom set the bottom cap diameter (floats, default 1). This value can't be zero
     * @param tessellation sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance
     * @param subdivisions sets the number of rings along the cylinder height (positive integer, default 1)
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateCylinder(name, height, diameterTop, diameterBottom, tessellation, subdivisions, scene, updatable, sideOrientation) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    // Torus  (Code from SharpDX.org)
    /**
     * Creates a torus mesh.
     * @param name defines the name of the mesh to create
     * @param diameter sets the diameter size (float) of the torus (default 1)
     * @param thickness sets the diameter size of the tube of the torus (float, default 0.5)
     * @param tessellation sets the number of torus sides (positive integer, default 16)
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateTorus(name, diameter, thickness, tessellation, scene, updatable, sideOrientation) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a torus knot mesh.
     * @param name defines the name of the mesh to create
     * @param radius sets the global radius size (float) of the torus knot (default 2)
     * @param tube sets the diameter size of the tube of the torus (float, default 0.5)
     * @param radialSegments sets the number of sides on each tube segments (positive integer, default 32)
     * @param tubularSegments sets the number of tubes to decompose the knot into (positive integer, default 32)
     * @param p the number of windings on X axis (positive integers, default 2)
     * @param q the number of windings on Y axis (positive integers, default 3)
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateTorusKnot(name, radius, tube, radialSegments, tubularSegments, p, q, scene, updatable, sideOrientation) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a line mesh..
     * @param name defines the name of the mesh to create
     * @param points is an array successive Vector3
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param instance is an instance of an existing LineMesh object to be updated with the passed `points` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines).
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateLines(name, points, scene, updatable, instance) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a dashed line mesh.
     * @param name defines the name of the mesh to create
     * @param points is an array successive Vector3
     * @param dashSize is the size of the dashes relatively the dash number (positive float, default 3)
     * @param gapSize is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)
     * @param dashNb is the intended total number of dashes (positive integer, default 200)
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param instance is an instance of an existing LineMesh object to be updated with the passed `points` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateDashedLines(name, points, dashSize, gapSize, dashNb, scene, updatable, instance) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a polygon mesh.Please consider using the same method from the MeshBuilder class instead
     * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh.
     * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors.
     * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
     * Remember you can only change the shape positions, not their number when updating a polygon.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#non-regular-polygon
     * @param name defines the name of the mesh to create
     * @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
     * @param scene defines the hosting scene
     * @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @param earcutInjection can be used to inject your own earcut reference
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreatePolygon(name, shape, scene, holes, updatable, sideOrientation, earcutInjection) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates an extruded polygon mesh, with depth in the Y direction..
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-non-regular-polygon
     * @param name defines the name of the mesh to create
     * @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
     * @param depth defines the height of extrusion
     * @param scene defines the hosting scene
     * @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @param earcutInjection can be used to inject your own earcut reference
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static ExtrudePolygon(name, shape, depth, scene, holes, updatable, sideOrientation, earcutInjection) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates an extruded shape mesh.
     * The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
     * @param name defines the name of the mesh to create
     * @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
     * @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along
     * @param scale is the value to scale the shape
     * @param rotation is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve
     * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#extruded-shape)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static ExtrudeShape(name, shape, path, scale, rotation, cap, scene, updatable, sideOrientation, instance) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates an custom extruded shape mesh.
     * The custom extrusion is a parametric shape.
     * It has no predefined shape. Its final shape will depend on the input parameters.
     *
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
     * @param name defines the name of the mesh to create
     * @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
     * @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along
     * @param scaleFunction is a custom Javascript function called on each path point
     * @param rotationFunction is a custom Javascript function called on each path point
     * @param ribbonCloseArray forces the extrusion underlying ribbon to close all the paths in its `pathArray`
     * @param ribbonClosePath forces the extrusion underlying ribbon to close its `pathArray`
     * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static ExtrudeShapeCustom(name, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene, updatable, sideOrientation, instance) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates lathe mesh.
     * The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe.
     * @param name defines the name of the mesh to create
     * @param shape is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero
     * @param radius is the radius value of the lathe
     * @param tessellation is the side number of the lathe.
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateLathe(name, shape, radius, tessellation, scene, updatable, sideOrientation) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a plane mesh.
     * @param name defines the name of the mesh to create
     * @param size sets the size (float) of both sides of the plane at once (default 1)
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreatePlane(name, size, scene, updatable, sideOrientation) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a ground mesh.
     * @param name defines the name of the mesh to create
     * @param width set the width of the ground
     * @param height set the height of the ground
     * @param subdivisions sets the number of subdivisions per side
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateGround(name, width, height, subdivisions, scene, updatable) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a tiled ground mesh.
     * @param name defines the name of the mesh to create
     * @param xmin set the ground minimum X coordinate
     * @param zmin set the ground minimum Y coordinate
     * @param xmax set the ground maximum X coordinate
     * @param zmax set the ground maximum Z coordinate
     * @param subdivisions is an object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile
     * @param precision is an object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateTiledGround(name, xmin, zmin, xmax, zmax, subdivisions, precision, scene, updatable) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a ground mesh from a height map.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/height_map
     * @param name defines the name of the mesh to create
     * @param url sets the URL of the height map image resource
     * @param width set the ground width size
     * @param height set the ground height size
     * @param subdivisions sets the number of subdivision per side
     * @param minHeight is the minimum altitude on the ground
     * @param maxHeight is the maximum altitude on the ground
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param onReady  is a callback function that will be called  once the mesh is built (the height map download can last some time)
     * @param alphaFilter will filter any data where the alpha channel is below this value, defaults 0 (all data visible)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateGroundFromHeightMap(name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady, alphaFilter) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a tube mesh.
     * The tube is a parametric shape.
     * It has no predefined shape. Its final shape will depend on the input parameters.
     *
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
     * @param name defines the name of the mesh to create
     * @param path is a required array of successive Vector3. It is the curve used as the axis of the tube
     * @param radius sets the tube radius size
     * @param tessellation is the number of sides on the tubular surface
     * @param radiusFunction is a custom function. If it is not null, it overrides the parameter `radius`. This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path
     * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
     * @param scene defines the hosting scene
     * @param updatable defines if the mesh must be flagged as updatable
     * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
     * @param instance is an instance of an existing Tube object to be updated with the passed `pathArray` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#tube)
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateTube(name, path, radius, tessellation, radiusFunction, cap, scene, updatable, sideOrientation, instance) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a polyhedron mesh.
     *.
     * * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embedded types. Please refer to the type sheet in the tutorial to choose the wanted type
     * * The parameter `size` (positive float, default 1) sets the polygon size
     * * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value)
     * * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`
     * * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
     * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
     * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
     * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
     * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
     * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
     * @param name defines the name of the mesh to create
     * @param options defines the options used to create the mesh
     * @param scene defines the hosting scene
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreatePolyhedron(name, options, scene) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided
     * * The parameter `radius` sets the radius size (float) of the icosphere (default 1)
     * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value than `radius`)
     * * The parameter `subdivisions` sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
     * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
     * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
     * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere
     * @param name defines the name of the mesh
     * @param options defines the options used to create the mesh
     * @param scene defines the hosting scene
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateIcoSphere(name, options, scene) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Creates a decal mesh.
     *.
     * A decal is a mesh usually applied as a model onto the surface of another mesh
     * @param name  defines the name of the mesh
     * @param sourceMesh defines the mesh receiving the decal
     * @param position sets the position of the decal in world coordinates
     * @param normal sets the normal of the mesh where the decal is applied onto in world coordinates
     * @param size sets the decal scaling
     * @param angle sets the angle to rotate the decal
     * @returns a new Mesh
     * @deprecated Please use MeshBuilder instead
     */
    static CreateDecal(name, sourceMesh, position, normal, size, angle) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /** Creates a Capsule Mesh
     * @param name defines the name of the mesh.
     * @param options the constructors options used to shape the mesh.
     * @param scene defines the scene the mesh is scoped to.
     * @returns the capsule mesh
     * @see https://doc.babylonjs.com/how_to/capsule_shape
     * @deprecated Please use MeshBuilder instead
     */
    static CreateCapsule(name, options, scene) {
        throw new Error("Import MeshBuilder to populate this function");
    }
    /**
     * Extends a mesh to a Goldberg mesh
     * Warning  the mesh to convert MUST be an import of a perviously exported Goldberg mesh
     * @param mesh the mesh to convert
     * @returns the extended mesh
     * @deprecated Please use ExtendMeshToGoldberg instead
     */
    static ExtendToGoldberg(mesh) {
        throw new Error("Import MeshBuilder to populate this function");
    }
}
// Consts
/**
 * Mesh side orientation : usually the external or front surface
 */
Mesh.FRONTSIDE = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.FRONTSIDE;
/**
 * Mesh side orientation : usually the internal or back surface
 */
Mesh.BACKSIDE = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.BACKSIDE;
/**
 * Mesh side orientation : both internal and external or front and back surfaces
 */
Mesh.DOUBLESIDE = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.DOUBLESIDE;
/**
 * Mesh side orientation : by default, `FRONTSIDE`
 */
Mesh.DEFAULTSIDE = _mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_10__/* .VertexData */ .P.DEFAULTSIDE;
/**
 * Mesh cap setting : no cap
 */
Mesh.NO_CAP = 0;
/**
 * Mesh cap setting : one cap at the beginning of the mesh
 */
Mesh.CAP_START = 1;
/**
 * Mesh cap setting : one cap at the end of the mesh
 */
Mesh.CAP_END = 2;
/**
 * Mesh cap setting : two caps, one at the beginning  and one at the end of the mesh
 */
Mesh.CAP_ALL = 3;
/**
 * Mesh pattern setting : no flip or rotate
 */
Mesh.NO_FLIP = 0;
/**
 * Mesh pattern setting : flip (reflect in y axis) alternate tiles on each row or column
 */
Mesh.FLIP_TILE = 1;
/**
 * Mesh pattern setting : rotate (180degs) alternate tiles on each row or column
 */
Mesh.ROTATE_TILE = 2;
/**
 * Mesh pattern setting : flip (reflect in y axis) all tiles on alternate rows
 */
Mesh.FLIP_ROW = 3;
/**
 * Mesh pattern setting : rotate (180degs) all tiles on alternate rows
 */
Mesh.ROTATE_ROW = 4;
/**
 * Mesh pattern setting : flip and rotate alternate tiles on each row or column
 */
Mesh.FLIP_N_ROTATE_TILE = 5;
/**
 * Mesh pattern setting : rotate pattern and rotate
 */
Mesh.FLIP_N_ROTATE_ROW = 6;
/**
 * Mesh tile positioning : part tiles same on left/right or top/bottom
 */
Mesh.CENTER = 0;
/**
 * Mesh tile positioning : part tiles on left
 */
Mesh.LEFT = 1;
/**
 * Mesh tile positioning : part tiles on right
 */
Mesh.RIGHT = 2;
/**
 * Mesh tile positioning : part tiles on top
 */
Mesh.TOP = 3;
/**
 * Mesh tile positioning : part tiles on bottom
 */
Mesh.BOTTOM = 4;
/**
 * Indicates that the instanced meshes should be sorted from back to front before rendering if their material is transparent
 */
Mesh.INSTANCEDMESH_SORT_TRANSPARENT = false;
// Statics
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Mesh._GroundMeshParser = (parsedMesh, scene) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_20__/* ._WarnImport */ .n)("GroundMesh");
};
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Mesh._GoldbergMeshParser = (parsedMesh, scene) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_20__/* ._WarnImport */ .n)("GoldbergMesh");
};
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Mesh._LinesMeshParser = (parsedMesh, scene) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_20__/* ._WarnImport */ .n)("LinesMesh");
};
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Mesh._GreasedLineMeshParser = (parsedMesh, scene) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_20__/* ._WarnImport */ .n)("GreasedLineMesh");
};
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Mesh._GreasedLineRibbonMeshParser = (parsedMesh, scene) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_20__/* ._WarnImport */ .n)("GreasedLineRibbonMesh");
};
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Mesh._TrailMeshParser = (parsedMesh, scene) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_20__/* ._WarnImport */ .n)("TrailMesh");
};
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_19__/* .RegisterClass */ .Y5)("BABYLON.Mesh", Mesh);
//# sourceMappingURL=mesh.js.map

/***/ }),

/***/ 36803:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   P: () => (/* binding */ VertexData),
/* harmony export */   o: () => (/* binding */ VertexDataMaterialInfo)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95616);
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(45503);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26041);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(51137);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(79259);
/* harmony import */ var _Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80163);
/* harmony import */ var _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(88563);
/* harmony import */ var _subMesh_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65907);










/** Class used to attach material info to sub section of a vertex data class */
class VertexDataMaterialInfo {
}
/**
 * This class contains the various kinds of data on every vertex of a mesh used in determining its shape and appearance
 */
class VertexData {
    /**
     * Creates a new VertexData
     */
    constructor() {
        /**
         * Gets the unique ID of this vertex Data
         */
        this.uniqueId = 0;
        /**
         * Metadata used to store contextual values
         */
        this.metadata = {};
        this._applyTo = (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_7__/* .makeSyncFunction */ .Aj)(this._applyToCoroutine.bind(this));
        this.uniqueId = VertexData._UniqueIDGenerator;
        VertexData._UniqueIDGenerator++;
    }
    /**
     * Uses the passed data array to set the set the values for the specified kind of data
     * @param data a linear array of floating numbers
     * @param kind the type of data that is being set, eg positions, colors etc
     */
    set(data, kind) {
        if (!data.length) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_5__/* .Logger */ .V.Warn(`Setting vertex data kind '${kind}' with an empty array`);
        }
        switch (kind) {
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.PositionKind:
                this.positions = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.NormalKind:
                this.normals = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind:
                this.tangents = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UVKind:
                this.uvs = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV2Kind:
                this.uvs2 = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV3Kind:
                this.uvs3 = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV4Kind:
                this.uvs4 = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV5Kind:
                this.uvs5 = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV6Kind:
                this.uvs6 = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.ColorKind:
                this.colors = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesKind:
                this.matricesIndices = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsKind:
                this.matricesWeights = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesExtraKind:
                this.matricesIndicesExtra = data;
                break;
            case _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsExtraKind:
                this.matricesWeightsExtra = data;
                break;
        }
    }
    /**
     * Associates the vertexData to the passed Mesh.
     * Sets it as updatable or not (default `false`)
     * @param mesh the mesh the vertexData is applied to
     * @param updatable when used and having the value true allows new data to update the vertexData
     * @returns the VertexData
     */
    applyToMesh(mesh, updatable) {
        this._applyTo(mesh, updatable, false);
        return this;
    }
    /**
     * Associates the vertexData to the passed Geometry.
     * Sets it as updatable or not (default `false`)
     * @param geometry the geometry the vertexData is applied to
     * @param updatable when used and having the value true allows new data to update the vertexData
     * @returns VertexData
     */
    applyToGeometry(geometry, updatable) {
        this._applyTo(geometry, updatable, false);
        return this;
    }
    /**
     * Updates the associated mesh
     * @param mesh the mesh to be updated
     * @returns VertexData
     */
    updateMesh(mesh) {
        this._update(mesh);
        return this;
    }
    /**
     * Updates the associated geometry
     * @param geometry the geometry to be updated
     * @returns VertexData.
     */
    updateGeometry(geometry) {
        this._update(geometry);
        return this;
    }
    /**
     * @internal
     */
    *_applyToCoroutine(meshOrGeometry, updatable = false, isAsync) {
        if (this.positions) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.PositionKind, this.positions, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.normals) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.NormalKind, this.normals, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.tangents) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind, this.tangents, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.uvs) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UVKind, this.uvs, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.uvs2) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV2Kind, this.uvs2, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.uvs3) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV3Kind, this.uvs3, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.uvs4) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV4Kind, this.uvs4, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.uvs5) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV5Kind, this.uvs5, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.uvs6) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV6Kind, this.uvs6, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.colors) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.ColorKind, this.colors, updatable);
            if (this.hasVertexAlpha && meshOrGeometry.hasVertexAlpha !== undefined) {
                meshOrGeometry.hasVertexAlpha = true;
            }
            if (isAsync) {
                yield;
            }
        }
        if (this.matricesIndices) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesKind, this.matricesIndices, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.matricesWeights) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsKind, this.matricesWeights, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.matricesIndicesExtra) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesExtraKind, this.matricesIndicesExtra, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.matricesWeightsExtra) {
            meshOrGeometry.setVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsExtraKind, this.matricesWeightsExtra, updatable);
            if (isAsync) {
                yield;
            }
        }
        if (this.indices) {
            meshOrGeometry.setIndices(this.indices, null, updatable);
            if (isAsync) {
                yield;
            }
        }
        else {
            meshOrGeometry.setIndices([], null);
        }
        if (meshOrGeometry.subMeshes && this.materialInfos && this.materialInfos.length > 1) {
            const mesh = meshOrGeometry;
            mesh.subMeshes = [];
            for (const matInfo of this.materialInfos) {
                new _subMesh_js__WEBPACK_IMPORTED_MODULE_9__/* .SubMesh */ .K(matInfo.materialIndex, matInfo.verticesStart, matInfo.verticesCount, matInfo.indexStart, matInfo.indexCount, mesh);
            }
        }
        return this;
    }
    _update(meshOrGeometry, updateExtends, makeItUnique) {
        if (this.positions) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.PositionKind, this.positions, updateExtends, makeItUnique);
        }
        if (this.normals) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.NormalKind, this.normals, updateExtends, makeItUnique);
        }
        if (this.tangents) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind, this.tangents, updateExtends, makeItUnique);
        }
        if (this.uvs) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UVKind, this.uvs, updateExtends, makeItUnique);
        }
        if (this.uvs2) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV2Kind, this.uvs2, updateExtends, makeItUnique);
        }
        if (this.uvs3) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV3Kind, this.uvs3, updateExtends, makeItUnique);
        }
        if (this.uvs4) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV4Kind, this.uvs4, updateExtends, makeItUnique);
        }
        if (this.uvs5) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV5Kind, this.uvs5, updateExtends, makeItUnique);
        }
        if (this.uvs6) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV6Kind, this.uvs6, updateExtends, makeItUnique);
        }
        if (this.colors) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.ColorKind, this.colors, updateExtends, makeItUnique);
        }
        if (this.matricesIndices) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesKind, this.matricesIndices, updateExtends, makeItUnique);
        }
        if (this.matricesWeights) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsKind, this.matricesWeights, updateExtends, makeItUnique);
        }
        if (this.matricesIndicesExtra) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesExtraKind, this.matricesIndicesExtra, updateExtends, makeItUnique);
        }
        if (this.matricesWeightsExtra) {
            meshOrGeometry.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsExtraKind, this.matricesWeightsExtra, updateExtends, makeItUnique);
        }
        if (this.indices) {
            meshOrGeometry.setIndices(this.indices, null);
        }
        return this;
    }
    static _TransformVector3Coordinates(coordinates, transformation, offset = 0, length = coordinates.length) {
        const coordinate = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
        const transformedCoordinate = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1];
        for (let index = offset; index < offset + length; index += 3) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(coordinates, index, coordinate);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinatesToRef(coordinate, transformation, transformedCoordinate);
            coordinates[index] = transformedCoordinate.x;
            coordinates[index + 1] = transformedCoordinate.y;
            coordinates[index + 2] = transformedCoordinate.z;
        }
    }
    static _TransformVector3Normals(normals, transformation, offset = 0, length = normals.length) {
        const normal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[0];
        const transformedNormal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3[1];
        for (let index = offset; index < offset + length; index += 3) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(normals, index, normal);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformNormalToRef(normal, transformation, transformedNormal);
            normals[index] = transformedNormal.x;
            normals[index + 1] = transformedNormal.y;
            normals[index + 2] = transformedNormal.z;
        }
    }
    static _TransformVector4Normals(normals, transformation, offset = 0, length = normals.length) {
        const normal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector4[0];
        const transformedNormal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector4[1];
        for (let index = offset; index < offset + length; index += 4) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU.FromArrayToRef(normals, index, normal);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU.TransformNormalToRef(normal, transformation, transformedNormal);
            normals[index] = transformedNormal.x;
            normals[index + 1] = transformedNormal.y;
            normals[index + 2] = transformedNormal.z;
            normals[index + 3] = transformedNormal.w;
        }
    }
    static _FlipFaces(indices, offset = 0, length = indices.length) {
        for (let index = offset; index < offset + length; index += 3) {
            const tmp = indices[index + 1];
            indices[index + 1] = indices[index + 2];
            indices[index + 2] = tmp;
        }
    }
    /**
     * Transforms each position and each normal of the vertexData according to the passed Matrix
     * @param matrix the transforming matrix
     * @returns the VertexData
     */
    transform(matrix) {
        const flip = matrix.determinant() < 0;
        if (this.positions) {
            VertexData._TransformVector3Coordinates(this.positions, matrix);
        }
        if (this.normals) {
            VertexData._TransformVector3Normals(this.normals, matrix);
        }
        if (this.tangents) {
            VertexData._TransformVector4Normals(this.tangents, matrix);
        }
        if (flip && this.indices) {
            VertexData._FlipFaces(this.indices);
        }
        return this;
    }
    /**
     * Generates an array of vertex data where each vertex data only has one material info
     * @returns An array of VertexData
     */
    splitBasedOnMaterialID() {
        if (!this.materialInfos || this.materialInfos.length < 2) {
            return [this];
        }
        const result = [];
        for (const materialInfo of this.materialInfos) {
            const vertexData = new VertexData();
            if (this.positions) {
                vertexData.positions = this.positions.slice(materialInfo.verticesStart * 3, (materialInfo.verticesCount + materialInfo.verticesStart) * 3);
            }
            if (this.normals) {
                vertexData.normals = this.normals.slice(materialInfo.verticesStart * 3, (materialInfo.verticesCount + materialInfo.verticesStart) * 3);
            }
            if (this.tangents) {
                vertexData.tangents = this.tangents.slice(materialInfo.verticesStart * 4, (materialInfo.verticesCount + materialInfo.verticesStart) * 4);
            }
            if (this.colors) {
                vertexData.colors = this.colors.slice(materialInfo.verticesStart * 4, (materialInfo.verticesCount + materialInfo.verticesStart) * 4);
            }
            if (this.uvs) {
                vertexData.uvs = this.uvs.slice(materialInfo.verticesStart * 2, (materialInfo.verticesCount + materialInfo.verticesStart) * 2);
            }
            if (this.uvs2) {
                vertexData.uvs2 = this.uvs2.slice(materialInfo.verticesStart * 2, (materialInfo.verticesCount + materialInfo.verticesStart) * 2);
            }
            if (this.uvs3) {
                vertexData.uvs3 = this.uvs3.slice(materialInfo.verticesStart * 2, (materialInfo.verticesCount + materialInfo.verticesStart) * 2);
            }
            if (this.uvs4) {
                vertexData.uvs4 = this.uvs4.slice(materialInfo.verticesStart * 2, (materialInfo.verticesCount + materialInfo.verticesStart) * 2);
            }
            if (this.uvs5) {
                vertexData.uvs5 = this.uvs5.slice(materialInfo.verticesStart * 2, (materialInfo.verticesCount + materialInfo.verticesStart) * 2);
            }
            if (this.uvs6) {
                vertexData.uvs6 = this.uvs6.slice(materialInfo.verticesStart * 2, (materialInfo.verticesCount + materialInfo.verticesStart) * 2);
            }
            if (this.matricesIndices) {
                vertexData.matricesIndices = this.matricesIndices.slice(materialInfo.verticesStart * 4, (materialInfo.verticesCount + materialInfo.verticesStart) * 4);
            }
            if (this.matricesIndicesExtra) {
                vertexData.matricesIndicesExtra = this.matricesIndicesExtra.slice(materialInfo.verticesStart * 4, (materialInfo.verticesCount + materialInfo.verticesStart) * 4);
            }
            if (this.matricesWeights) {
                vertexData.matricesWeights = this.matricesWeights.slice(materialInfo.verticesStart * 4, (materialInfo.verticesCount + materialInfo.verticesStart) * 4);
            }
            if (this.matricesWeightsExtra) {
                vertexData.matricesWeightsExtra = this.matricesWeightsExtra.slice(materialInfo.verticesStart * 4, (materialInfo.verticesCount + materialInfo.verticesStart) * 4);
            }
            if (this.indices) {
                vertexData.indices = [];
                for (let index = materialInfo.indexStart; index < materialInfo.indexStart + materialInfo.indexCount; index++) {
                    vertexData.indices.push(this.indices[index] - materialInfo.verticesStart);
                }
            }
            const newMaterialInfo = new VertexDataMaterialInfo();
            newMaterialInfo.indexStart = 0;
            newMaterialInfo.indexCount = vertexData.indices ? vertexData.indices.length : 0;
            newMaterialInfo.materialIndex = materialInfo.materialIndex;
            newMaterialInfo.verticesStart = 0;
            newMaterialInfo.verticesCount = (vertexData.positions ? vertexData.positions.length : 0) / 3;
            vertexData.materialInfos = [newMaterialInfo];
            result.push(vertexData);
        }
        return result;
    }
    /**
     * Merges the passed VertexData into the current one
     * @param others the VertexData to be merged into the current one
     * @param use32BitsIndices defines a boolean indicating if indices must be store in a 32 bits array
     * @param forceCloneIndices defines a boolean indicating if indices are forced to be cloned
     * @param mergeMaterialIds defines a boolean indicating if we need to merge the material infos
     * @param enableCompletion defines a boolean indicating if the vertex data should be completed to be compatible
     * @returns the modified VertexData
     */
    merge(others, use32BitsIndices = false, forceCloneIndices = false, mergeMaterialIds = false, enableCompletion = false) {
        const vertexDatas = Array.isArray(others)
            ? others.map((other) => {
                return { vertexData: other };
            })
            : [{ vertexData: others }];
        return (0,_Misc_coroutine_js__WEBPACK_IMPORTED_MODULE_7__/* .runCoroutineSync */ .V1)(this._mergeCoroutine(undefined, vertexDatas, use32BitsIndices, false, forceCloneIndices, mergeMaterialIds, enableCompletion));
    }
    /**
     * @internal
     */
    *_mergeCoroutine(transform, vertexDatas, use32BitsIndices = false, isAsync, forceCloneIndices, mergeMaterialIds = false, enableCompletion = false) {
        this._validate();
        let others = vertexDatas.map((vertexData) => vertexData.vertexData);
        // eslint-disable-next-line @typescript-eslint/no-this-alias
        let root = this;
        if (enableCompletion) {
            // First let's make sure we have the max set of attributes on the main vertex data
            for (const other of others) {
                if (!other) {
                    continue;
                }
                other._validate();
                if (!this.normals && other.normals) {
                    this.normals = new Float32Array(this.positions.length);
                }
                if (!this.tangents && other.tangents) {
                    this.tangents = new Float32Array((this.positions.length / 3) * 4);
                }
                if (!this.uvs && other.uvs) {
                    this.uvs = new Float32Array((this.positions.length / 3) * 2);
                }
                if (!this.uvs2 && other.uvs2) {
                    this.uvs2 = new Float32Array((this.positions.length / 3) * 2);
                }
                if (!this.uvs3 && other.uvs3) {
                    this.uvs3 = new Float32Array((this.positions.length / 3) * 2);
                }
                if (!this.uvs4 && other.uvs4) {
                    this.uvs4 = new Float32Array((this.positions.length / 3) * 2);
                }
                if (!this.uvs5 && other.uvs5) {
                    this.uvs5 = new Float32Array((this.positions.length / 3) * 2);
                }
                if (!this.uvs6 && other.uvs6) {
                    this.uvs6 = new Float32Array((this.positions.length / 3) * 2);
                }
                if (!this.colors && other.colors) {
                    this.colors = new Float32Array((this.positions.length / 3) * 4);
                    this.colors.fill(1); // Set to white by default
                }
                if (!this.matricesIndices && other.matricesIndices) {
                    this.matricesIndices = new Float32Array((this.positions.length / 3) * 4);
                }
                if (!this.matricesWeights && other.matricesWeights) {
                    this.matricesWeights = new Float32Array((this.positions.length / 3) * 4);
                }
                if (!this.matricesIndicesExtra && other.matricesIndicesExtra) {
                    this.matricesIndicesExtra = new Float32Array((this.positions.length / 3) * 4);
                }
                if (!this.matricesWeightsExtra && other.matricesWeightsExtra) {
                    this.matricesWeightsExtra = new Float32Array((this.positions.length / 3) * 4);
                }
            }
        }
        for (const other of others) {
            if (!other) {
                continue;
            }
            if (!enableCompletion) {
                other._validate();
                if (!this.normals !== !other.normals ||
                    !this.tangents !== !other.tangents ||
                    !this.uvs !== !other.uvs ||
                    !this.uvs2 !== !other.uvs2 ||
                    !this.uvs3 !== !other.uvs3 ||
                    !this.uvs4 !== !other.uvs4 ||
                    !this.uvs5 !== !other.uvs5 ||
                    !this.uvs6 !== !other.uvs6 ||
                    !this.colors !== !other.colors ||
                    !this.matricesIndices !== !other.matricesIndices ||
                    !this.matricesWeights !== !other.matricesWeights ||
                    !this.matricesIndicesExtra !== !other.matricesIndicesExtra ||
                    !this.matricesWeightsExtra !== !other.matricesWeightsExtra) {
                    throw new Error("Cannot merge vertex data that do not have the same set of attributes");
                }
            }
            else {
                // Align the others with main set of attributes
                if (this.normals && !other.normals) {
                    other.normals = new Float32Array(other.positions.length);
                }
                if (this.tangents && !other.tangents) {
                    other.tangents = new Float32Array((other.positions.length / 3) * 4);
                }
                if (this.uvs && !other.uvs) {
                    other.uvs = new Float32Array((other.positions.length / 3) * 2);
                }
                if (this.uvs2 && !other.uvs2) {
                    other.uvs2 = new Float32Array((other.positions.length / 3) * 2);
                }
                if (this.uvs3 && !other.uvs3) {
                    other.uvs3 = new Float32Array((other.positions.length / 3) * 2);
                }
                if (this.uvs4 && !other.uvs4) {
                    other.uvs4 = new Float32Array((other.positions.length / 3) * 2);
                }
                if (this.uvs5 && !other.uvs5) {
                    other.uvs5 = new Float32Array((other.positions.length / 3) * 2);
                }
                if (this.uvs6 && !other.uvs6) {
                    other.uvs6 = new Float32Array((other.positions.length / 3) * 2);
                }
                if (this.colors && !other.colors) {
                    other.colors = new Float32Array((other.positions.length / 3) * 4);
                    other.colors.fill(1); // Set to white by default
                }
                if (this.matricesIndices && !other.matricesIndices) {
                    other.matricesIndices = new Float32Array((other.positions.length / 3) * 4);
                }
                if (this.matricesWeights && !other.matricesWeights) {
                    other.matricesWeights = new Float32Array((other.positions.length / 3) * 4);
                }
                if (this.matricesIndicesExtra && !other.matricesIndicesExtra) {
                    other.matricesIndicesExtra = new Float32Array((other.positions.length / 3) * 4);
                }
                if (this.matricesWeightsExtra && !other.matricesWeightsExtra) {
                    other.matricesWeightsExtra = new Float32Array((other.positions.length / 3) * 4);
                }
            }
        }
        if (mergeMaterialIds) {
            // Merge material infos
            let materialIndex = 0;
            let indexOffset = 0;
            let vertexOffset = 0;
            const materialInfos = [];
            let currentMaterialInfo = null;
            const vertexDataList = [];
            // We need to split vertexData with more than one materialInfo
            for (const split of this.splitBasedOnMaterialID()) {
                vertexDataList.push({ vertexData: split, transform: transform });
            }
            for (const data of vertexDatas) {
                if (!data.vertexData) {
                    continue;
                }
                for (const split of data.vertexData.splitBasedOnMaterialID()) {
                    vertexDataList.push({ vertexData: split, transform: data.transform });
                }
            }
            // Sort by material IDs
            vertexDataList.sort((a, b) => {
                const matInfoA = a.vertexData.materialInfos ? a.vertexData.materialInfos[0].materialIndex : 0;
                const matInfoB = b.vertexData.materialInfos ? b.vertexData.materialInfos[0].materialIndex : 0;
                if (matInfoA > matInfoB) {
                    return 1;
                }
                if (matInfoA === matInfoB) {
                    return 0;
                }
                return -1;
            });
            // Build the new material info
            for (const vertexDataSource of vertexDataList) {
                const vertexData = vertexDataSource.vertexData;
                if (vertexData.materialInfos) {
                    materialIndex = vertexData.materialInfos[0].materialIndex;
                }
                else {
                    materialIndex = 0;
                }
                if (currentMaterialInfo && currentMaterialInfo.materialIndex === materialIndex) {
                    currentMaterialInfo.indexCount += vertexData.indices.length;
                    currentMaterialInfo.verticesCount += vertexData.positions.length / 3;
                }
                else {
                    const materialInfo = new VertexDataMaterialInfo();
                    materialInfo.materialIndex = materialIndex;
                    materialInfo.indexStart = indexOffset;
                    materialInfo.indexCount = vertexData.indices.length;
                    materialInfo.verticesStart = vertexOffset;
                    materialInfo.verticesCount = vertexData.positions.length / 3;
                    materialInfos.push(materialInfo);
                    currentMaterialInfo = materialInfo;
                }
                indexOffset += vertexData.indices.length;
                vertexOffset += vertexData.positions.length / 3;
            }
            // Extract sorted values
            const first = vertexDataList.splice(0, 1)[0];
            root = first.vertexData;
            transform = first.transform;
            others = vertexDataList.map((v) => v.vertexData);
            vertexDatas = vertexDataList;
            this.materialInfos = materialInfos;
        }
        // Merge geometries
        const totalIndices = others.reduce((indexSum, vertexData) => indexSum + (vertexData.indices?.length ?? 0), root.indices?.length ?? 0);
        const sliceIndices = forceCloneIndices || others.some((vertexData) => vertexData.indices === root.indices);
        let indices = sliceIndices ? root.indices?.slice() : root.indices;
        if (totalIndices > 0) {
            let indicesOffset = indices?.length ?? 0;
            if (!indices) {
                indices = new Array(totalIndices);
            }
            if (indices.length !== totalIndices) {
                if (Array.isArray(indices)) {
                    indices.length = totalIndices;
                }
                else {
                    const temp = use32BitsIndices || indices instanceof Uint32Array ? new Uint32Array(totalIndices) : new Uint16Array(totalIndices);
                    temp.set(indices);
                    indices = temp;
                }
                if (transform && transform.determinant() < 0) {
                    VertexData._FlipFaces(indices, 0, indicesOffset);
                }
            }
            let positionsOffset = root.positions ? root.positions.length / 3 : 0;
            for (const { vertexData: other, transform } of vertexDatas) {
                if (other.indices) {
                    for (let index = 0; index < other.indices.length; index++) {
                        indices[indicesOffset + index] = other.indices[index] + positionsOffset;
                    }
                    if (transform && transform.determinant() < 0) {
                        VertexData._FlipFaces(indices, indicesOffset, other.indices.length);
                    }
                    // The call to _validate already checked for positions
                    positionsOffset += other.positions.length / 3;
                    indicesOffset += other.indices.length;
                    if (isAsync) {
                        yield;
                    }
                }
            }
        }
        this.indices = indices;
        this.positions = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.PositionKind, root.positions, transform, vertexDatas.map((other) => [other.vertexData.positions, other.transform]));
        if (isAsync) {
            yield;
        }
        if (root.normals) {
            this.normals = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.NormalKind, root.normals, transform, vertexDatas.map((other) => [other.vertexData.normals, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.tangents) {
            this.tangents = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind, root.tangents, transform, vertexDatas.map((other) => [other.vertexData.tangents, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.uvs) {
            this.uvs = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UVKind, root.uvs, transform, vertexDatas.map((other) => [other.vertexData.uvs, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.uvs2) {
            this.uvs2 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV2Kind, root.uvs2, transform, vertexDatas.map((other) => [other.vertexData.uvs2, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.uvs3) {
            this.uvs3 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV3Kind, root.uvs3, transform, vertexDatas.map((other) => [other.vertexData.uvs3, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.uvs4) {
            this.uvs4 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV4Kind, root.uvs4, transform, vertexDatas.map((other) => [other.vertexData.uvs4, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.uvs5) {
            this.uvs5 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV5Kind, root.uvs5, transform, vertexDatas.map((other) => [other.vertexData.uvs5, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.uvs6) {
            this.uvs6 = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV6Kind, root.uvs6, transform, vertexDatas.map((other) => [other.vertexData.uvs6, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.colors) {
            this.colors = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.ColorKind, root.colors, transform, vertexDatas.map((other) => [other.vertexData.colors, other.transform]));
            if (root.hasVertexAlpha !== undefined || vertexDatas.some((other) => other.vertexData.hasVertexAlpha !== undefined)) {
                this.hasVertexAlpha = root.hasVertexAlpha || vertexDatas.some((other) => other.vertexData.hasVertexAlpha);
            }
            if (isAsync) {
                yield;
            }
        }
        if (root.matricesIndices) {
            this.matricesIndices = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesKind, root.matricesIndices, transform, vertexDatas.map((other) => [other.vertexData.matricesIndices, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.matricesWeights) {
            this.matricesWeights = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsKind, root.matricesWeights, transform, vertexDatas.map((other) => [other.vertexData.matricesWeights, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.matricesIndicesExtra) {
            this.matricesIndicesExtra = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesExtraKind, root.matricesIndicesExtra, transform, vertexDatas.map((other) => [other.vertexData.matricesIndicesExtra, other.transform]));
            if (isAsync) {
                yield;
            }
        }
        if (root.matricesWeightsExtra) {
            this.matricesWeightsExtra = VertexData._MergeElement(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsExtraKind, root.matricesWeightsExtra, transform, vertexDatas.map((other) => [other.vertexData.matricesWeightsExtra, other.transform]));
        }
        return this;
    }
    static _MergeElement(kind, source, transform, others) {
        const nonNullOthers = others.filter((other) => other[0] !== null && other[0] !== undefined);
        // If there is no source to copy and no other non-null sources then skip this element.
        if (!source && nonNullOthers.length == 0) {
            return source;
        }
        if (!source) {
            return this._MergeElement(kind, nonNullOthers[0][0], nonNullOthers[0][1], nonNullOthers.slice(1));
        }
        const len = nonNullOthers.reduce((sumLen, elements) => sumLen + elements[0].length, source.length);
        const transformRange = kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.PositionKind
            ? VertexData._TransformVector3Coordinates
            : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.NormalKind
                ? VertexData._TransformVector3Normals
                : kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind
                    ? VertexData._TransformVector4Normals
                    : () => { };
        if (source instanceof Float32Array) {
            // use non-loop method when the source is Float32Array
            const ret32 = new Float32Array(len);
            ret32.set(source);
            transform && transformRange(ret32, transform, 0, source.length);
            let offset = source.length;
            for (const [vertexData, transform] of nonNullOthers) {
                ret32.set(vertexData, offset);
                transform && transformRange(ret32, transform, offset, vertexData.length);
                offset += vertexData.length;
            }
            return ret32;
        }
        else {
            // don't use concat as it is super slow, just loop for other cases
            const ret = new Array(len);
            for (let i = 0; i < source.length; i++) {
                ret[i] = source[i];
            }
            transform && transformRange(ret, transform, 0, source.length);
            let offset = source.length;
            for (const [vertexData, transform] of nonNullOthers) {
                for (let i = 0; i < vertexData.length; i++) {
                    ret[offset + i] = vertexData[i];
                }
                transform && transformRange(ret, transform, offset, vertexData.length);
                offset += vertexData.length;
            }
            return ret;
        }
    }
    _validate() {
        if (!this.positions) {
            throw new _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .RuntimeError */ .bu("Positions are required", _Misc_error_js__WEBPACK_IMPORTED_MODULE_8__/* .ErrorCodes */ .tG.MeshInvalidPositionsError);
        }
        const getElementCount = (kind, values) => {
            const stride = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.DeduceStride(kind);
            if (values.length % stride !== 0) {
                throw new Error("The " + kind + "s array count must be a multiple of " + stride);
            }
            return values.length / stride;
        };
        const positionsElementCount = getElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.PositionKind, this.positions);
        const validateElementCount = (kind, values) => {
            const elementCount = getElementCount(kind, values);
            if (elementCount !== positionsElementCount) {
                throw new Error("The " + kind + "s element count (" + elementCount + ") does not match the positions count (" + positionsElementCount + ")");
            }
        };
        if (this.normals) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.NormalKind, this.normals);
        }
        if (this.tangents) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind, this.tangents);
        }
        if (this.uvs) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UVKind, this.uvs);
        }
        if (this.uvs2) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV2Kind, this.uvs2);
        }
        if (this.uvs3) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV3Kind, this.uvs3);
        }
        if (this.uvs4) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV4Kind, this.uvs4);
        }
        if (this.uvs5) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV5Kind, this.uvs5);
        }
        if (this.uvs6) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV6Kind, this.uvs6);
        }
        if (this.colors) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.ColorKind, this.colors);
        }
        if (this.matricesIndices) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesKind, this.matricesIndices);
        }
        if (this.matricesWeights) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsKind, this.matricesWeights);
        }
        if (this.matricesIndicesExtra) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesExtraKind, this.matricesIndicesExtra);
        }
        if (this.matricesWeightsExtra) {
            validateElementCount(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsExtraKind, this.matricesWeightsExtra);
        }
    }
    /**
     * Clone the current vertex data
     * @returns a copy of the current data
     */
    clone() {
        const serializationObject = this.serialize();
        return VertexData.Parse(serializationObject);
    }
    /**
     * Serializes the VertexData
     * @returns a serialized object
     */
    serialize() {
        const serializationObject = {};
        if (this.positions) {
            serializationObject.positions = Array.from(this.positions);
        }
        if (this.normals) {
            serializationObject.normals = Array.from(this.normals);
        }
        if (this.tangents) {
            serializationObject.tangents = Array.from(this.tangents);
        }
        if (this.uvs) {
            serializationObject.uvs = Array.from(this.uvs);
        }
        if (this.uvs2) {
            serializationObject.uvs2 = Array.from(this.uvs2);
        }
        if (this.uvs3) {
            serializationObject.uvs3 = Array.from(this.uvs3);
        }
        if (this.uvs4) {
            serializationObject.uvs4 = Array.from(this.uvs4);
        }
        if (this.uvs5) {
            serializationObject.uvs5 = Array.from(this.uvs5);
        }
        if (this.uvs6) {
            serializationObject.uvs6 = Array.from(this.uvs6);
        }
        if (this.colors) {
            serializationObject.colors = Array.from(this.colors);
            serializationObject.hasVertexAlpha = this.hasVertexAlpha;
        }
        if (this.matricesIndices) {
            serializationObject.matricesIndices = Array.from(this.matricesIndices);
            serializationObject.matricesIndices._isExpanded = true;
        }
        if (this.matricesWeights) {
            serializationObject.matricesWeights = Array.from(this.matricesWeights);
        }
        if (this.matricesIndicesExtra) {
            serializationObject.matricesIndicesExtra = Array.from(this.matricesIndicesExtra);
            serializationObject.matricesIndicesExtra._isExpanded = true;
        }
        if (this.matricesWeightsExtra) {
            serializationObject.matricesWeightsExtra = Array.from(this.matricesWeightsExtra);
        }
        serializationObject.indices = Array.from(this.indices);
        if (this.materialInfos) {
            serializationObject.materialInfos = [];
            for (const materialInfo of this.materialInfos) {
                const materialInfoSerializationObject = {
                    indexStart: materialInfo.indexStart,
                    indexCount: materialInfo.indexCount,
                    materialIndex: materialInfo.materialIndex,
                    verticesStart: materialInfo.verticesStart,
                    verticesCount: materialInfo.verticesCount,
                };
                serializationObject.materialInfos.push(materialInfoSerializationObject);
            }
        }
        return serializationObject;
    }
    // Statics
    /**
     * Extracts the vertexData from a mesh
     * @param mesh the mesh from which to extract the VertexData
     * @param copyWhenShared defines if the VertexData must be cloned when shared between multiple meshes, optional, default false
     * @param forceCopy indicating that the VertexData must be cloned, optional, default false
     * @returns the object VertexData associated to the passed mesh
     */
    static ExtractFromMesh(mesh, copyWhenShared, forceCopy) {
        return VertexData._ExtractFrom(mesh, copyWhenShared, forceCopy);
    }
    /**
     * Extracts the vertexData from the geometry
     * @param geometry the geometry from which to extract the VertexData
     * @param copyWhenShared defines if the VertexData must be cloned when the geometry is shared between multiple meshes, optional, default false
     * @param forceCopy indicating that the VertexData must be cloned, optional, default false
     * @returns the object VertexData associated to the passed mesh
     */
    static ExtractFromGeometry(geometry, copyWhenShared, forceCopy) {
        return VertexData._ExtractFrom(geometry, copyWhenShared, forceCopy);
    }
    static _ExtractFrom(meshOrGeometry, copyWhenShared, forceCopy) {
        const result = new VertexData();
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.PositionKind)) {
            result.positions = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.PositionKind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.NormalKind)) {
            result.normals = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.NormalKind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind)) {
            result.tangents = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UVKind)) {
            result.uvs = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UVKind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV2Kind)) {
            result.uvs2 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV2Kind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV3Kind)) {
            result.uvs3 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV3Kind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV4Kind)) {
            result.uvs4 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV4Kind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV5Kind)) {
            result.uvs5 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV5Kind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV6Kind)) {
            result.uvs6 = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV6Kind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.ColorKind)) {
            const geometry = meshOrGeometry.geometry || meshOrGeometry;
            const vertexBuffer = geometry.getVertexBuffer(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.ColorKind);
            const colors = geometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.ColorKind, copyWhenShared, forceCopy);
            if (vertexBuffer.getSize() === 3) {
                const newColors = new Float32Array((colors.length * 4) / 3);
                for (let i = 0, j = 0; i < colors.length; i += 3, j += 4) {
                    newColors[j] = colors[i];
                    newColors[j + 1] = colors[i + 1];
                    newColors[j + 2] = colors[i + 2];
                    newColors[j + 3] = 1;
                }
                result.colors = newColors;
            }
            else if (vertexBuffer.getSize() === 4) {
                result.colors = colors;
            }
            else {
                throw new Error(`Unexpected number of color components: ${vertexBuffer.getSize()}`);
            }
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesKind)) {
            result.matricesIndices = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesKind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsKind)) {
            result.matricesWeights = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsKind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesExtraKind)) {
            result.matricesIndicesExtra = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesExtraKind, copyWhenShared, forceCopy);
        }
        if (meshOrGeometry.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsExtraKind)) {
            result.matricesWeightsExtra = meshOrGeometry.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsExtraKind, copyWhenShared, forceCopy);
        }
        result.indices = meshOrGeometry.getIndices(copyWhenShared, forceCopy);
        return result;
    }
    /**
     * Creates the VertexData for a Ribbon
     * @param options an object used to set the following optional parameters for the ribbon, required but can be empty
     * * pathArray array of paths, each of which an array of successive Vector3
     * * closeArray creates a seam between the first and the last paths of the pathArray, optional, default false
     * * closePath creates a seam between the first and the last points of each path of the path array, optional, default false
     * * offset a positive integer, only used when pathArray contains a single path (offset = 10 means the point 1 is joined to the point 11), default rounded half size of the pathArray length
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * * invertUV swaps in the U and V coordinates when applying a texture, optional, default false
     * * uvs a linear array, of length 2 * number of vertices, of custom UV values, optional
     * * colors a linear array, of length 4 * number of vertices, of custom color values, optional
     * @returns the VertexData of the ribbon
     * @deprecated use CreateRibbonVertexData instead
     */
    static CreateRibbon(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("ribbonBuilder");
    }
    /**
     * Creates the VertexData for a box
     * @param options an object used to set the following optional parameters for the box, required but can be empty
     * * size sets the width, height and depth of the box to the value of size, optional default 1
     * * width sets the width (x direction) of the box, overwrites the width set by size, optional, default size
     * * height sets the height (y direction) of the box, overwrites the height set by size, optional, default size
     * * depth sets the depth (z direction) of the box, overwrites the depth set by size, optional, default size
     * * faceUV an array of 6 Vector4 elements used to set different images to each box side
     * * faceColors an array of 6 Color3 elements used to set different colors to each box side
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the box
     * @deprecated Please use CreateBoxVertexData from the BoxBuilder file instead
     */
    static CreateBox(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("boxBuilder");
    }
    /**
     * Creates the VertexData for a tiled box
     * @param options an object used to set the following optional parameters for the box, required but can be empty
     * * faceTiles sets the pattern, tile size and number of tiles for a face
     * * faceUV an array of 6 Vector4 elements used to set different images to each box side
     * * faceColors an array of 6 Color3 elements used to set different colors to each box side
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * @param options.pattern
     * @param options.width
     * @param options.height
     * @param options.depth
     * @param options.tileSize
     * @param options.tileWidth
     * @param options.tileHeight
     * @param options.alignHorizontal
     * @param options.alignVertical
     * @param options.faceUV
     * @param options.faceColors
     * @param options.sideOrientation
     * @returns the VertexData of the box
     * @deprecated Please use CreateTiledBoxVertexData instead
     */
    static CreateTiledBox(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("tiledBoxBuilder");
    }
    /**
     * Creates the VertexData for a tiled plane
     * @param options an object used to set the following optional parameters for the box, required but can be empty
     * * pattern a limited pattern arrangement depending on the number
     * * tileSize sets the width, height and depth of the tile to the value of size, optional default 1
     * * tileWidth sets the width (x direction) of the tile, overwrites the width set by size, optional, default size
     * * tileHeight sets the height (y direction) of the tile, overwrites the height set by size, optional, default size
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the tiled plane
     * @deprecated use CreateTiledPlaneVertexData instead
     */
    static CreateTiledPlane(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("tiledPlaneBuilder");
    }
    /**
     * Creates the VertexData for an ellipsoid, defaults to a sphere
     * @param options an object used to set the following optional parameters for the box, required but can be empty
     * * segments sets the number of horizontal strips optional, default 32
     * * diameter sets the axes dimensions, diameterX, diameterY and diameterZ to the value of diameter, optional default 1
     * * diameterX sets the diameterX (x direction) of the ellipsoid, overwrites the diameterX set by diameter, optional, default diameter
     * * diameterY sets the diameterY (y direction) of the ellipsoid, overwrites the diameterY set by diameter, optional, default diameter
     * * diameterZ sets the diameterZ (z direction) of the ellipsoid, overwrites the diameterZ set by diameter, optional, default diameter
     * * arc a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the circumference (latitude) given by the arc value, optional, default 1
     * * slice a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the height (latitude) given by the arc value, optional, default 1
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the ellipsoid
     * @deprecated use CreateSphereVertexData instead
     */
    static CreateSphere(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("sphereBuilder");
    }
    /**
     * Creates the VertexData for a cylinder, cone or prism
     * @param options an object used to set the following optional parameters for the box, required but can be empty
     * * height sets the height (y direction) of the cylinder, optional, default 2
     * * diameterTop sets the diameter of the top of the cone, overwrites diameter,  optional, default diameter
     * * diameterBottom sets the diameter of the bottom of the cone, overwrites diameter,  optional, default diameter
     * * diameter sets the diameter of the top and bottom of the cone, optional default 1
     * * tessellation the number of prism sides, 3 for a triangular prism, optional, default 24
     * * subdivisions` the number of rings along the cylinder height, optional, default 1
     * * arc a number from 0 to 1, to create an unclosed cylinder based on the fraction of the circumference given by the arc value, optional, default 1
     * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
     * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
     * * hasRings when true makes each subdivision independently treated as a face for faceUV and faceColors, optional, default false
     * * enclose when true closes an open cylinder by adding extra flat faces between the height axis and vertical edges, think cut cake
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the cylinder, cone or prism
     * @deprecated please use CreateCylinderVertexData instead
     */
    static CreateCylinder(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("cylinderBuilder");
    }
    /**
     * Creates the VertexData for a torus
     * @param options an object used to set the following optional parameters for the box, required but can be empty
     * * diameter the diameter of the torus, optional default 1
     * * thickness the diameter of the tube forming the torus, optional default 0.5
     * * tessellation the number of prism sides, 3 for a triangular prism, optional, default 24
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the torus
     * @deprecated use CreateTorusVertexData instead
     */
    static CreateTorus(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("torusBuilder");
    }
    /**
     * Creates the VertexData of the LineSystem
     * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty
     *  - lines an array of lines, each line being an array of successive Vector3
     *  - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point
     * @returns the VertexData of the LineSystem
     * @deprecated use CreateLineSystemVertexData instead
     */
    static CreateLineSystem(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("linesBuilder");
    }
    /**
     * Create the VertexData for a DashedLines
     * @param options an object used to set the following optional parameters for the DashedLines, required but can be empty
     *  - points an array successive Vector3
     *  - dashSize the size of the dashes relative to the dash number, optional, default 3
     *  - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1
     *  - dashNb the intended total number of dashes, optional, default 200
     * @returns the VertexData for the DashedLines
     * @deprecated use CreateDashedLinesVertexData instead
     */
    static CreateDashedLines(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("linesBuilder");
    }
    /**
     * Creates the VertexData for a Ground
     * @param options an object used to set the following optional parameters for the Ground, required but can be empty
     *  - width the width (x direction) of the ground, optional, default 1
     *  - height the height (z direction) of the ground, optional, default 1
     *  - subdivisions the number of subdivisions per side, optional, default 1
     * @returns the VertexData of the Ground
     * @deprecated Please use CreateGroundVertexData instead
     */
    static CreateGround(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("groundBuilder");
    }
    /**
     * Creates the VertexData for a TiledGround by subdividing the ground into tiles
     * @param options an object used to set the following optional parameters for the Ground, required but can be empty
     * * xmin the ground minimum X coordinate, optional, default -1
     * * zmin the ground minimum Z coordinate, optional, default -1
     * * xmax the ground maximum X coordinate, optional, default 1
     * * zmax the ground maximum Z coordinate, optional, default 1
     * * subdivisions a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the ground width and height creating 'tiles', default {w: 6, h: 6}
     * * precision a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the tile width and height, default {w: 2, h: 2}
     * @returns the VertexData of the TiledGround
     * @deprecated use CreateTiledGroundVertexData instead
     */
    static CreateTiledGround(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("groundBuilder");
    }
    /**
     * Creates the VertexData of the Ground designed from a heightmap
     * @param options an object used to set the following parameters for the Ground, required and provided by CreateGroundFromHeightMap
     * * width the width (x direction) of the ground
     * * height the height (z direction) of the ground
     * * subdivisions the number of subdivisions per side
     * * minHeight the minimum altitude on the ground, optional, default 0
     * * maxHeight the maximum altitude on the ground, optional default 1
     * * colorFilter the filter to apply to the image pixel colors to compute the height, optional Color3, default (0.3, 0.59, 0.11)
     * * buffer the array holding the image color data
     * * bufferWidth the width of image
     * * bufferHeight the height of image
     * * alphaFilter Remove any data where the alpha channel is below this value, defaults 0 (all data visible)
     * @returns the VertexData of the Ground designed from a heightmap
     * @deprecated use CreateGroundFromHeightMapVertexData instead
     */
    static CreateGroundFromHeightMap(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("groundBuilder");
    }
    /**
     * Creates the VertexData for a Plane
     * @param options an object used to set the following optional parameters for the plane, required but can be empty
     * * size sets the width and height of the plane to the value of size, optional default 1
     * * width sets the width (x direction) of the plane, overwrites the width set by size, optional, default size
     * * height sets the height (y direction) of the plane, overwrites the height set by size, optional, default size
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the box
     * @deprecated use CreatePlaneVertexData instead
     */
    static CreatePlane(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("planeBuilder");
    }
    /**
     * Creates the VertexData of the Disc or regular Polygon
     * @param options an object used to set the following optional parameters for the disc, required but can be empty
     * * radius the radius of the disc, optional default 0.5
     * * tessellation the number of polygon sides, optional, default 64
     * * arc a number from 0 to 1, to create an unclosed polygon based on the fraction of the circumference given by the arc value, optional, default 1
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the box
     * @deprecated use CreateDiscVertexData instead
     */
    static CreateDisc(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("discBuilder");
    }
    /**
     * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()
     * All parameters are provided by CreatePolygon as needed
     * @param polygon a mesh built from polygonTriangulation.build()
     * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
     * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
     * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @param wrap a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side
     * @returns the VertexData of the Polygon
     * @deprecated use CreatePolygonVertexData instead
     */
    static CreatePolygon(polygon, sideOrientation, fUV, fColors, frontUVs, backUVs, wrap) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("polygonBuilder");
    }
    /**
     * Creates the VertexData of the IcoSphere
     * @param options an object used to set the following optional parameters for the IcoSphere, required but can be empty
     * * radius the radius of the IcoSphere, optional default 1
     * * radiusX allows stretching in the x direction, optional, default radius
     * * radiusY allows stretching in the y direction, optional, default radius
     * * radiusZ allows stretching in the z direction, optional, default radius
     * * flat when true creates a flat shaded mesh, optional, default true
     * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the IcoSphere
     * @deprecated use CreateIcoSphereVertexData instead
     */
    static CreateIcoSphere(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("icoSphereBuilder");
    }
    // inspired from // http://stemkoski.github.io/Three.js/Polyhedra.html
    /**
     * Creates the VertexData for a Polyhedron
     * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
     * * type provided types are:
     *  * 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1)
     *  * 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20)
     * * size the size of the IcoSphere, optional default 1
     * * sizeX allows stretching in the x direction, optional, default size
     * * sizeY allows stretching in the y direction, optional, default size
     * * sizeZ allows stretching in the z direction, optional, default size
     * * custom a number that overwrites the type to create from an extended set of polyhedron from https://www.babylonjs-playground.com/#21QRSK#15 with minimised editor
     * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
     * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
     * * flat when true creates a flat shaded mesh, optional, default true
     * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the Polyhedron
     * @deprecated use CreatePolyhedronVertexData instead
     */
    static CreatePolyhedron(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("polyhedronBuilder");
    }
    /**
     * Creates the VertexData for a Capsule, inspired from https://github.com/maximeq/three-js-capsule-geometry/blob/master/src/CapsuleBufferGeometry.js
     * @param options an object used to set the following optional parameters for the capsule, required but can be empty
     * @returns the VertexData of the Capsule
     * @deprecated Please use CreateCapsuleVertexData from the capsuleBuilder file instead
     */
    static CreateCapsule(options = {
        orientation: _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Up(),
        subdivisions: 2,
        tessellation: 16,
        height: 1,
        radius: 0.25,
        capSubdivisions: 6,
    }) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("capsuleBuilder");
    }
    // based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3D/src/away3d/primitives/TorusKnot.as?spec=svn2473&r=2473
    /**
     * Creates the VertexData for a TorusKnot
     * @param options an object used to set the following optional parameters for the TorusKnot, required but can be empty
     * * radius the radius of the torus knot, optional, default 2
     * * tube the thickness of the tube, optional, default 0.5
     * * radialSegments the number of sides on each tube segments, optional, default 32
     * * tubularSegments the number of tubes to decompose the knot into, optional, default 32
     * * p the number of windings around the z axis, optional,  default 2
     * * q the number of windings around the x axis, optional,  default 3
     * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
     * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
     * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
     * @returns the VertexData of the Torus Knot
     * @deprecated use CreateTorusKnotVertexData instead
     */
    static CreateTorusKnot(options) {
        throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_3__/* ._WarnImport */ .n)("torusKnotBuilder");
    }
    // Tools
    /**
     * Compute normals for given positions and indices
     * @param positions an array of vertex positions, [...., x, y, z, ......]
     * @param indices an array of indices in groups of three for each triangular facet, [...., i, j, k, ......]
     * @param normals an array of vertex normals, [...., x, y, z, ......]
     * @param options an object used to set the following optional parameters for the TorusKnot, optional
     * * facetNormals : optional array of facet normals (vector3)
     * * facetPositions : optional array of facet positions (vector3)
     * * facetPartitioning : optional partitioning array. facetPositions is required for facetPartitioning computation
     * * ratio : optional partitioning ratio / bounding box, required for facetPartitioning computation
     * * bInfo : optional bounding info, required for facetPartitioning computation
     * * bbSize : optional bounding box size data, required for facetPartitioning computation
     * * subDiv : optional partitioning data about subdivisions on  each axis (int), required for facetPartitioning computation
     * * useRightHandedSystem: optional boolean to for right handed system computation
     * * depthSort : optional boolean to enable the facet depth sort computation
     * * distanceTo : optional Vector3 to compute the facet depth from this location
     * * depthSortedFacets : optional array of depthSortedFacets to store the facet distances from the reference location
     */
    static ComputeNormals(positions, indices, normals, options) {
        // temporary scalar variables
        let index = 0; // facet index
        let p1p2x = 0.0; // p1p2 vector x coordinate
        let p1p2y = 0.0; // p1p2 vector y coordinate
        let p1p2z = 0.0; // p1p2 vector z coordinate
        let p3p2x = 0.0; // p3p2 vector x coordinate
        let p3p2y = 0.0; // p3p2 vector y coordinate
        let p3p2z = 0.0; // p3p2 vector z coordinate
        let faceNormalx = 0.0; // facet normal x coordinate
        let faceNormaly = 0.0; // facet normal y coordinate
        let faceNormalz = 0.0; // facet normal z coordinate
        let length = 0.0; // facet normal length before normalization
        let v1x = 0; // vector1 x index in the positions array
        let v1y = 0; // vector1 y index in the positions array
        let v1z = 0; // vector1 z index in the positions array
        let v2x = 0; // vector2 x index in the positions array
        let v2y = 0; // vector2 y index in the positions array
        let v2z = 0; // vector2 z index in the positions array
        let v3x = 0; // vector3 x index in the positions array
        let v3y = 0; // vector3 y index in the positions array
        let v3z = 0; // vector3 z index in the positions array
        let computeFacetNormals = false;
        let computeFacetPositions = false;
        let computeFacetPartitioning = false;
        let computeDepthSort = false;
        let faceNormalSign = 1;
        let ratio = 0;
        let distanceTo = null;
        if (options) {
            computeFacetNormals = options.facetNormals ? true : false;
            computeFacetPositions = options.facetPositions ? true : false;
            computeFacetPartitioning = options.facetPartitioning ? true : false;
            faceNormalSign = options.useRightHandedSystem === true ? -1 : 1;
            ratio = options.ratio || 0;
            computeDepthSort = options.depthSort ? true : false;
            distanceTo = options.distanceTo;
            if (computeDepthSort) {
                if (distanceTo === undefined) {
                    distanceTo = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
                }
            }
        }
        // facetPartitioning reinit if needed
        let xSubRatio = 0;
        let ySubRatio = 0;
        let zSubRatio = 0;
        let subSq = 0;
        if (computeFacetPartitioning && options && options.bbSize) {
            //let bbSizeMax = options.bbSize.x > options.bbSize.y ? options.bbSize.x : options.bbSize.y;
            //bbSizeMax = bbSizeMax > options.bbSize.z ? bbSizeMax : options.bbSize.z;
            xSubRatio = (options.subDiv.X * ratio) / options.bbSize.x;
            ySubRatio = (options.subDiv.Y * ratio) / options.bbSize.y;
            zSubRatio = (options.subDiv.Z * ratio) / options.bbSize.z;
            subSq = options.subDiv.max * options.subDiv.max;
            options.facetPartitioning.length = 0;
        }
        // reset the normals
        for (index = 0; index < positions.length; index++) {
            normals[index] = 0.0;
        }
        // Loop : 1 indice triplet = 1 facet
        const nbFaces = (indices.length / 3) | 0;
        for (index = 0; index < nbFaces; index++) {
            // get the indexes of the coordinates of each vertex of the facet
            v1x = indices[index * 3] * 3;
            v1y = v1x + 1;
            v1z = v1x + 2;
            v2x = indices[index * 3 + 1] * 3;
            v2y = v2x + 1;
            v2z = v2x + 2;
            v3x = indices[index * 3 + 2] * 3;
            v3y = v3x + 1;
            v3z = v3x + 2;
            p1p2x = positions[v1x] - positions[v2x]; // compute two vectors per facet : p1p2 and p3p2
            p1p2y = positions[v1y] - positions[v2y];
            p1p2z = positions[v1z] - positions[v2z];
            p3p2x = positions[v3x] - positions[v2x];
            p3p2y = positions[v3y] - positions[v2y];
            p3p2z = positions[v3z] - positions[v2z];
            // compute the face normal with the cross product
            faceNormalx = faceNormalSign * (p1p2y * p3p2z - p1p2z * p3p2y);
            faceNormaly = faceNormalSign * (p1p2z * p3p2x - p1p2x * p3p2z);
            faceNormalz = faceNormalSign * (p1p2x * p3p2y - p1p2y * p3p2x);
            // normalize this normal and store it in the array facetData
            length = Math.sqrt(faceNormalx * faceNormalx + faceNormaly * faceNormaly + faceNormalz * faceNormalz);
            length = length === 0 ? 1.0 : length;
            faceNormalx /= length;
            faceNormaly /= length;
            faceNormalz /= length;
            if (computeFacetNormals && options) {
                options.facetNormals[index].x = faceNormalx;
                options.facetNormals[index].y = faceNormaly;
                options.facetNormals[index].z = faceNormalz;
            }
            if (computeFacetPositions && options) {
                // compute and the facet barycenter coordinates in the array facetPositions
                options.facetPositions[index].x = (positions[v1x] + positions[v2x] + positions[v3x]) / 3.0;
                options.facetPositions[index].y = (positions[v1y] + positions[v2y] + positions[v3y]) / 3.0;
                options.facetPositions[index].z = (positions[v1z] + positions[v2z] + positions[v3z]) / 3.0;
            }
            if (computeFacetPartitioning && options) {
                // store the facet indexes in arrays in the main facetPartitioning array :
                // compute each facet vertex (+ facet barycenter) index in the partiniong array
                const ox = Math.floor((options.facetPositions[index].x - options.bInfo.minimum.x * ratio) * xSubRatio);
                const oy = Math.floor((options.facetPositions[index].y - options.bInfo.minimum.y * ratio) * ySubRatio);
                const oz = Math.floor((options.facetPositions[index].z - options.bInfo.minimum.z * ratio) * zSubRatio);
                const b1x = Math.floor((positions[v1x] - options.bInfo.minimum.x * ratio) * xSubRatio);
                const b1y = Math.floor((positions[v1y] - options.bInfo.minimum.y * ratio) * ySubRatio);
                const b1z = Math.floor((positions[v1z] - options.bInfo.minimum.z * ratio) * zSubRatio);
                const b2x = Math.floor((positions[v2x] - options.bInfo.minimum.x * ratio) * xSubRatio);
                const b2y = Math.floor((positions[v2y] - options.bInfo.minimum.y * ratio) * ySubRatio);
                const b2z = Math.floor((positions[v2z] - options.bInfo.minimum.z * ratio) * zSubRatio);
                const b3x = Math.floor((positions[v3x] - options.bInfo.minimum.x * ratio) * xSubRatio);
                const b3y = Math.floor((positions[v3y] - options.bInfo.minimum.y * ratio) * ySubRatio);
                const b3z = Math.floor((positions[v3z] - options.bInfo.minimum.z * ratio) * zSubRatio);
                const block_idx_v1 = b1x + options.subDiv.max * b1y + subSq * b1z;
                const block_idx_v2 = b2x + options.subDiv.max * b2y + subSq * b2z;
                const block_idx_v3 = b3x + options.subDiv.max * b3y + subSq * b3z;
                const block_idx_o = ox + options.subDiv.max * oy + subSq * oz;
                options.facetPartitioning[block_idx_o] = options.facetPartitioning[block_idx_o] ? options.facetPartitioning[block_idx_o] : new Array();
                options.facetPartitioning[block_idx_v1] = options.facetPartitioning[block_idx_v1] ? options.facetPartitioning[block_idx_v1] : new Array();
                options.facetPartitioning[block_idx_v2] = options.facetPartitioning[block_idx_v2] ? options.facetPartitioning[block_idx_v2] : new Array();
                options.facetPartitioning[block_idx_v3] = options.facetPartitioning[block_idx_v3] ? options.facetPartitioning[block_idx_v3] : new Array();
                // push each facet index in each block containing the vertex
                options.facetPartitioning[block_idx_v1].push(index);
                if (block_idx_v2 != block_idx_v1) {
                    options.facetPartitioning[block_idx_v2].push(index);
                }
                if (!(block_idx_v3 == block_idx_v2 || block_idx_v3 == block_idx_v1)) {
                    options.facetPartitioning[block_idx_v3].push(index);
                }
                if (!(block_idx_o == block_idx_v1 || block_idx_o == block_idx_v2 || block_idx_o == block_idx_v3)) {
                    options.facetPartitioning[block_idx_o].push(index);
                }
            }
            if (computeDepthSort && options && options.facetPositions) {
                const dsf = options.depthSortedFacets[index];
                dsf.ind = index * 3;
                dsf.sqDistance = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.DistanceSquared(options.facetPositions[index], distanceTo);
            }
            // compute the normals anyway
            normals[v1x] += faceNormalx; // accumulate all the normals per face
            normals[v1y] += faceNormaly;
            normals[v1z] += faceNormalz;
            normals[v2x] += faceNormalx;
            normals[v2y] += faceNormaly;
            normals[v2z] += faceNormalz;
            normals[v3x] += faceNormalx;
            normals[v3y] += faceNormaly;
            normals[v3z] += faceNormalz;
        }
        // last normalization of each normal
        for (index = 0; index < normals.length / 3; index++) {
            faceNormalx = normals[index * 3];
            faceNormaly = normals[index * 3 + 1];
            faceNormalz = normals[index * 3 + 2];
            length = Math.sqrt(faceNormalx * faceNormalx + faceNormaly * faceNormaly + faceNormalz * faceNormalz);
            length = length === 0 ? 1.0 : length;
            faceNormalx /= length;
            faceNormaly /= length;
            faceNormalz /= length;
            normals[index * 3] = faceNormalx;
            normals[index * 3 + 1] = faceNormaly;
            normals[index * 3 + 2] = faceNormalz;
        }
    }
    /**
     * @internal
     */
    static _ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs) {
        const li = indices.length;
        const ln = normals.length;
        let i;
        let n;
        sideOrientation = sideOrientation || VertexData.DEFAULTSIDE;
        switch (sideOrientation) {
            case VertexData.FRONTSIDE:
                // nothing changed
                break;
            case VertexData.BACKSIDE:
                // indices
                for (i = 0; i < li; i += 3) {
                    const tmp = indices[i];
                    indices[i] = indices[i + 2];
                    indices[i + 2] = tmp;
                }
                // normals
                for (n = 0; n < ln; n++) {
                    normals[n] = -normals[n];
                }
                break;
            case VertexData.DOUBLESIDE: {
                // positions
                const lp = positions.length;
                const l = lp / 3;
                for (let p = 0; p < lp; p++) {
                    positions[lp + p] = positions[p];
                }
                // indices
                for (i = 0; i < li; i += 3) {
                    indices[i + li] = indices[i + 2] + l;
                    indices[i + 1 + li] = indices[i + 1] + l;
                    indices[i + 2 + li] = indices[i] + l;
                }
                // normals
                for (n = 0; n < ln; n++) {
                    normals[ln + n] = -normals[n];
                }
                // uvs
                const lu = uvs.length;
                let u = 0;
                for (u = 0; u < lu; u++) {
                    uvs[u + lu] = uvs[u];
                }
                frontUVs = frontUVs ? frontUVs : new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU(0.0, 0.0, 1.0, 1.0);
                backUVs = backUVs ? backUVs : new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU(0.0, 0.0, 1.0, 1.0);
                u = 0;
                for (i = 0; i < lu / 2; i++) {
                    uvs[u] = frontUVs.x + (frontUVs.z - frontUVs.x) * uvs[u];
                    uvs[u + 1] = frontUVs.y + (frontUVs.w - frontUVs.y) * uvs[u + 1];
                    uvs[u + lu] = backUVs.x + (backUVs.z - backUVs.x) * uvs[u + lu];
                    uvs[u + lu + 1] = backUVs.y + (backUVs.w - backUVs.y) * uvs[u + lu + 1];
                    u += 2;
                }
                break;
            }
        }
    }
    /**
     * Creates a VertexData from serialized data
     * @param parsedVertexData the parsed data from an imported file
     * @returns a VertexData
     */
    static Parse(parsedVertexData) {
        const vertexData = new VertexData();
        // positions
        const positions = parsedVertexData.positions;
        if (positions) {
            vertexData.set(positions, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.PositionKind);
        }
        // normals
        const normals = parsedVertexData.normals;
        if (normals) {
            vertexData.set(normals, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.NormalKind);
        }
        // tangents
        const tangents = parsedVertexData.tangents;
        if (tangents) {
            vertexData.set(tangents, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.TangentKind);
        }
        // uvs
        const uvs = parsedVertexData.uvs;
        if (uvs) {
            vertexData.set(uvs, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UVKind);
        }
        // uv2s
        const uvs2 = parsedVertexData.uvs2;
        if (uvs2) {
            vertexData.set(uvs2, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV2Kind);
        }
        // uv3s
        const uvs3 = parsedVertexData.uvs3;
        if (uvs3) {
            vertexData.set(uvs3, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV3Kind);
        }
        // uv4s
        const uvs4 = parsedVertexData.uvs4;
        if (uvs4) {
            vertexData.set(uvs4, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV4Kind);
        }
        // uv5s
        const uvs5 = parsedVertexData.uvs5;
        if (uvs5) {
            vertexData.set(uvs5, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV5Kind);
        }
        // uv6s
        const uvs6 = parsedVertexData.uvs6;
        if (uvs6) {
            vertexData.set(uvs6, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.UV6Kind);
        }
        // colors
        const colors = parsedVertexData.colors;
        if (colors) {
            vertexData.set(_Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__/* .Color4 */ .ov.CheckColors4(colors, positions.length / 3), _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.ColorKind);
            if (parsedVertexData.hasVertexAlpha !== undefined) {
                vertexData.hasVertexAlpha = parsedVertexData.hasVertexAlpha;
            }
        }
        // matricesIndices
        const matricesIndices = parsedVertexData.matricesIndices;
        if (matricesIndices) {
            vertexData.set(matricesIndices, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesIndicesKind);
        }
        // matricesWeights
        const matricesWeights = parsedVertexData.matricesWeights;
        if (matricesWeights) {
            vertexData.set(matricesWeights, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_2__/* .VertexBuffer */ .R.MatricesWeightsKind);
        }
        // indices
        const indices = parsedVertexData.indices;
        if (indices) {
            vertexData.indices = indices;
        }
        // MaterialInfos
        const materialInfos = parsedVertexData.materialInfos;
        if (materialInfos) {
            vertexData.materialInfos = [];
            for (const materialInfoFromJSON of materialInfos) {
                const materialInfo = new VertexDataMaterialInfo();
                materialInfo.indexCount = materialInfoFromJSON.indexCount;
                materialInfo.indexStart = materialInfoFromJSON.indexStart;
                materialInfo.verticesCount = materialInfoFromJSON.verticesCount;
                materialInfo.verticesStart = materialInfoFromJSON.verticesStart;
                materialInfo.materialIndex = materialInfoFromJSON.materialIndex;
                vertexData.materialInfos.push(materialInfo);
            }
        }
        return vertexData;
    }
    /**
     * Applies VertexData created from the imported parameters to the geometry
     * @param parsedVertexData the parsed data from an imported file
     * @param geometry the geometry to apply the VertexData to
     */
    static ImportVertexData(parsedVertexData, geometry) {
        const vertexData = VertexData.Parse(parsedVertexData);
        geometry.setAllVerticesData(vertexData, parsedVertexData.updatable);
    }
}
/**
 * Mesh side orientation : usually the external or front surface
 */
VertexData.FRONTSIDE = 0;
/**
 * Mesh side orientation : usually the internal or back surface
 */
VertexData.BACKSIDE = 1;
/**
 * Mesh side orientation : both internal and external or front and back surfaces
 */
VertexData.DOUBLESIDE = 2;
/**
 * Mesh side orientation : by default, `FRONTSIDE`
 */
VertexData.DEFAULTSIDE = 0;
VertexData._UniqueIDGenerator = 0;
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__/* .nativeOverride */ .Cx.filter((...[coordinates]) => !Array.isArray(coordinates))
], VertexData, "_TransformVector3Coordinates", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__/* .nativeOverride */ .Cx.filter((...[normals]) => !Array.isArray(normals))
], VertexData, "_TransformVector3Normals", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__/* .nativeOverride */ .Cx.filter((...[normals]) => !Array.isArray(normals))
], VertexData, "_TransformVector4Normals", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_6__/* .nativeOverride */ .Cx.filter((...[indices]) => !Array.isArray(indices))
], VertexData, "_FlipFaces", null);
//# sourceMappingURL=mesh.vertexData.js.map

/***/ }),

/***/ 16400:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   L: () => (/* binding */ MeshLODLevel)
/* harmony export */ });
/**
 * Class used to represent a specific level of detail of a mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
 */
class MeshLODLevel {
    /**
     * Creates a new LOD level
     * @param distanceOrScreenCoverage defines either the distance or the screen coverage where this level should start being displayed
     * @param mesh defines the mesh to use to render this level
     */
    constructor(
    /** Either distance from the center of the object to show this level or the screen coverage if `useLODScreenCoverage` is set to `true` on the mesh*/
    distanceOrScreenCoverage, 
    /** Defines the mesh to use to render this level */
    mesh) {
        this.distanceOrScreenCoverage = distanceOrScreenCoverage;
        this.mesh = mesh;
    }
}
//# sourceMappingURL=meshLODLevel.js.map

/***/ }),

/***/ 65907:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   K: () => (/* binding */ SubMesh)
/* harmony export */ });
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95616);
/* harmony import */ var _Collisions_intersectionInfo_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77103);
/* harmony import */ var _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20863);
/* harmony import */ var _Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71139);
/* harmony import */ var _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35476);






/**
 * Defines a subdivision inside a mesh
 */
class SubMesh {
    /**
     * Gets material defines used by the effect associated to the sub mesh
     */
    get materialDefines() {
        return this._mainDrawWrapperOverride ? this._mainDrawWrapperOverride.defines : this._getDrawWrapper()?.defines;
    }
    /**
     * Sets material defines used by the effect associated to the sub mesh
     */
    set materialDefines(defines) {
        const drawWrapper = this._mainDrawWrapperOverride ?? this._getDrawWrapper(undefined, true);
        drawWrapper.defines = defines;
    }
    /**
     * @internal
     */
    _getDrawWrapper(passId, createIfNotExisting = false) {
        passId = passId ?? this._engine.currentRenderPassId;
        let drawWrapper = this._drawWrappers[passId];
        if (!drawWrapper && createIfNotExisting) {
            this._drawWrappers[passId] = drawWrapper = new _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_4__/* .DrawWrapper */ .E(this._mesh.getScene().getEngine());
        }
        return drawWrapper;
    }
    /**
     * @internal
     */
    _removeDrawWrapper(passId, disposeWrapper = true, immediate = false) {
        if (disposeWrapper) {
            this._drawWrappers[passId]?.dispose(immediate);
        }
        this._drawWrappers[passId] = undefined;
    }
    /**
     * Gets associated (main) effect (possibly the effect override if defined)
     */
    get effect() {
        return this._mainDrawWrapperOverride ? this._mainDrawWrapperOverride.effect : (this._getDrawWrapper()?.effect ?? null);
    }
    /** @internal */
    get _drawWrapper() {
        return this._mainDrawWrapperOverride ?? this._getDrawWrapper(undefined, true);
    }
    /** @internal */
    get _drawWrapperOverride() {
        return this._mainDrawWrapperOverride;
    }
    /**
     * @internal
     */
    _setMainDrawWrapperOverride(wrapper) {
        this._mainDrawWrapperOverride = wrapper;
    }
    /**
     * Sets associated effect (effect used to render this submesh)
     * @param effect defines the effect to associate with
     * @param defines defines the set of defines used to compile this effect
     * @param materialContext material context associated to the effect
     * @param resetContext true to reset the draw context
     */
    setEffect(effect, defines = null, materialContext, resetContext = true) {
        const drawWrapper = this._drawWrapper;
        drawWrapper.setEffect(effect, defines, resetContext);
        if (materialContext !== undefined) {
            drawWrapper.materialContext = materialContext;
        }
        if (!effect) {
            drawWrapper.defines = null;
            drawWrapper.materialContext = undefined;
        }
    }
    /**
     * Resets the draw wrappers cache
     * @param passId If provided, releases only the draw wrapper corresponding to this render pass id
     * @param immediate If true, the draw wrapper will dispose the effect immediately (false by default)
     */
    resetDrawCache(passId, immediate = false) {
        if (this._drawWrappers) {
            if (passId !== undefined) {
                this._removeDrawWrapper(passId, true, immediate);
                return;
            }
            else {
                for (const drawWrapper of this._drawWrappers) {
                    drawWrapper?.dispose(immediate);
                }
            }
        }
        this._drawWrappers = [];
    }
    /**
     * Add a new submesh to a mesh
     * @param materialIndex defines the material index to use
     * @param verticesStart defines vertex index start
     * @param verticesCount defines vertices count
     * @param indexStart defines index start
     * @param indexCount defines indices count
     * @param mesh defines the parent mesh
     * @param renderingMesh defines an optional rendering mesh
     * @param createBoundingBox defines if bounding box should be created for this submesh
     * @returns the new submesh
     */
    static AddToMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox = true) {
        return new SubMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox);
    }
    /**
     * Creates a new submesh
     * @param materialIndex defines the material index to use
     * @param verticesStart defines vertex index start
     * @param verticesCount defines vertices count
     * @param indexStart defines index start
     * @param indexCount defines indices count
     * @param mesh defines the parent mesh
     * @param renderingMesh defines an optional rendering mesh
     * @param createBoundingBox defines if bounding box should be created for this submesh
     * @param addToMesh defines a boolean indicating that the submesh must be added to the mesh.subMeshes array (true by default)
     */
    constructor(
    /** the material index to use */
    materialIndex, 
    /** vertex index start */
    verticesStart, 
    /** vertices count */
    verticesCount, 
    /** index start */
    indexStart, 
    /** indices count */
    indexCount, mesh, renderingMesh, createBoundingBox = true, addToMesh = true) {
        this.materialIndex = materialIndex;
        this.verticesStart = verticesStart;
        this.verticesCount = verticesCount;
        this.indexStart = indexStart;
        this.indexCount = indexCount;
        this._mainDrawWrapperOverride = null;
        /** @internal */
        this._linesIndexCount = 0;
        this._linesIndexBuffer = null;
        /** @internal */
        this._lastColliderWorldVertices = null;
        /** @internal */
        this._lastColliderTransformMatrix = null;
        /** @internal */
        this._wasDispatched = false;
        /** @internal */
        this._renderId = 0;
        /** @internal */
        this._alphaIndex = 0;
        /** @internal */
        this._distanceToCamera = 0;
        this._currentMaterial = null;
        this._mesh = mesh;
        this._renderingMesh = renderingMesh || mesh;
        if (addToMesh) {
            mesh.subMeshes.push(this);
        }
        this._engine = this._mesh.getScene().getEngine();
        this.resetDrawCache();
        this._trianglePlanes = [];
        this._id = mesh.subMeshes.length - 1;
        if (createBoundingBox) {
            this.refreshBoundingInfo();
            mesh.computeWorldMatrix(true);
        }
    }
    /**
     * Returns true if this submesh covers the entire parent mesh
     * @ignorenaming
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    get IsGlobal() {
        return this.verticesStart === 0 && this.verticesCount === this._mesh.getTotalVertices() && this.indexStart === 0 && this.indexCount === this._mesh.getTotalIndices();
    }
    /**
     * Returns the submesh BoundingInfo object
     * @returns current bounding info (or mesh's one if the submesh is global)
     */
    getBoundingInfo() {
        if (this.IsGlobal || this._mesh.hasThinInstances) {
            return this._mesh.getBoundingInfo();
        }
        return this._boundingInfo;
    }
    /**
     * Sets the submesh BoundingInfo
     * @param boundingInfo defines the new bounding info to use
     * @returns the SubMesh
     */
    setBoundingInfo(boundingInfo) {
        this._boundingInfo = boundingInfo;
        return this;
    }
    /**
     * Returns the mesh of the current submesh
     * @returns the parent mesh
     */
    getMesh() {
        return this._mesh;
    }
    /**
     * Returns the rendering mesh of the submesh
     * @returns the rendering mesh (could be different from parent mesh)
     */
    getRenderingMesh() {
        return this._renderingMesh;
    }
    /**
     * Returns the replacement mesh of the submesh
     * @returns the replacement mesh (could be different from parent mesh)
     */
    getReplacementMesh() {
        return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;
    }
    /**
     * Returns the effective mesh of the submesh
     * @returns the effective mesh (could be different from parent mesh)
     */
    getEffectiveMesh() {
        const replacementMesh = this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;
        return replacementMesh ? replacementMesh : this._renderingMesh;
    }
    /**
     * Returns the submesh material
     * @param getDefaultMaterial Defines whether or not to get the default material if nothing has been defined.
     * @returns null or the current material
     */
    getMaterial(getDefaultMaterial = true) {
        const rootMaterial = this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId) ?? this._renderingMesh.material;
        if (!rootMaterial) {
            return getDefaultMaterial ? this._mesh.getScene().defaultMaterial : null;
        }
        else if (this._isMultiMaterial(rootMaterial)) {
            const effectiveMaterial = rootMaterial.getSubMaterial(this.materialIndex);
            if (this._currentMaterial !== effectiveMaterial) {
                this._currentMaterial = effectiveMaterial;
                this.resetDrawCache();
            }
            return effectiveMaterial;
        }
        return rootMaterial;
    }
    _isMultiMaterial(material) {
        return material.getSubMaterial !== undefined;
    }
    // Methods
    /**
     * Sets a new updated BoundingInfo object to the submesh
     * @param data defines an optional position array to use to determine the bounding info
     * @returns the SubMesh
     */
    refreshBoundingInfo(data = null) {
        this._lastColliderWorldVertices = null;
        if (this.IsGlobal || !this._renderingMesh || !this._renderingMesh.geometry) {
            return this;
        }
        if (!data) {
            data = this._renderingMesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind);
        }
        if (!data) {
            this._boundingInfo = this._mesh.getBoundingInfo();
            return this;
        }
        const indices = this._renderingMesh.getIndices();
        let extend;
        //is this the only submesh?
        if (this.indexStart === 0 && this.indexCount === indices.length) {
            const boundingInfo = this._renderingMesh.getBoundingInfo();
            //the rendering mesh's bounding info can be used, it is the standard submesh for all indices.
            extend = { minimum: boundingInfo.minimum.clone(), maximum: boundingInfo.maximum.clone() };
        }
        else {
            extend = (0,_Maths_math_functions_js__WEBPACK_IMPORTED_MODULE_3__/* .extractMinAndMaxIndexed */ .cD)(data, indices, this.indexStart, this.indexCount, this._renderingMesh.geometry.boundingBias);
        }
        if (this._boundingInfo) {
            this._boundingInfo.reConstruct(extend.minimum, extend.maximum);
        }
        else {
            this._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_2__/* .BoundingInfo */ .j(extend.minimum, extend.maximum);
        }
        return this;
    }
    /**
     * @internal
     */
    _checkCollision(collider) {
        const boundingInfo = this.getBoundingInfo();
        return boundingInfo._checkCollision(collider);
    }
    /**
     * Updates the submesh BoundingInfo
     * @param world defines the world matrix to use to update the bounding info
     * @returns the submesh
     */
    updateBoundingInfo(world) {
        let boundingInfo = this.getBoundingInfo();
        if (!boundingInfo) {
            this.refreshBoundingInfo();
            boundingInfo = this.getBoundingInfo();
        }
        if (boundingInfo) {
            boundingInfo.update(world);
        }
        return this;
    }
    /**
     * True is the submesh bounding box intersects the frustum defined by the passed array of planes.
     * @param frustumPlanes defines the frustum planes
     * @returns true if the submesh is intersecting with the frustum
     */
    isInFrustum(frustumPlanes) {
        const boundingInfo = this.getBoundingInfo();
        if (!boundingInfo) {
            return false;
        }
        return boundingInfo.isInFrustum(frustumPlanes, this._mesh.cullingStrategy);
    }
    /**
     * True is the submesh bounding box is completely inside the frustum defined by the passed array of planes
     * @param frustumPlanes defines the frustum planes
     * @returns true if the submesh is inside the frustum
     */
    isCompletelyInFrustum(frustumPlanes) {
        const boundingInfo = this.getBoundingInfo();
        if (!boundingInfo) {
            return false;
        }
        return boundingInfo.isCompletelyInFrustum(frustumPlanes);
    }
    /**
     * Renders the submesh
     * @param enableAlphaMode defines if alpha needs to be used
     * @returns the submesh
     */
    render(enableAlphaMode) {
        this._renderingMesh.render(this, enableAlphaMode, this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : undefined);
        return this;
    }
    /**
     * @internal
     */
    _getLinesIndexBuffer(indices, engine) {
        if (!this._linesIndexBuffer) {
            const linesIndices = [];
            for (let index = this.indexStart; index < this.indexStart + this.indexCount; index += 3) {
                linesIndices.push(indices[index], indices[index + 1], indices[index + 1], indices[index + 2], indices[index + 2], indices[index]);
            }
            this._linesIndexBuffer = engine.createIndexBuffer(linesIndices);
            this._linesIndexCount = linesIndices.length;
        }
        return this._linesIndexBuffer;
    }
    /**
     * Checks if the submesh intersects with a ray
     * @param ray defines the ray to test
     * @returns true is the passed ray intersects the submesh bounding box
     */
    canIntersects(ray) {
        const boundingInfo = this.getBoundingInfo();
        if (!boundingInfo) {
            return false;
        }
        return ray.intersectsBox(boundingInfo.boundingBox);
    }
    /**
     * Intersects current submesh with a ray
     * @param ray defines the ray to test
     * @param positions defines mesh's positions array
     * @param indices defines mesh's indices array
     * @param fastCheck defines if the first intersection will be used (and not the closest)
     * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
     * @returns intersection info or null if no intersection
     */
    intersects(ray, positions, indices, fastCheck, trianglePredicate) {
        const material = this.getMaterial();
        if (!material) {
            return null;
        }
        let step = 3;
        let checkStopper = false;
        switch (material.fillMode) {
            case 3:
            case 5:
            case 6:
            case 8:
                return null;
            case 7:
                step = 1;
                checkStopper = true;
                break;
            default:
                break;
        }
        // LineMesh first as it's also a Mesh...
        if (material.fillMode === 4) {
            // Check if mesh is unindexed
            if (!indices.length) {
                return this._intersectUnIndexedLines(ray, positions, indices, this._mesh.intersectionThreshold, fastCheck);
            }
            return this._intersectLines(ray, positions, indices, this._mesh.intersectionThreshold, fastCheck);
        }
        else {
            // Check if mesh is unindexed
            if (!indices.length && this._mesh._unIndexed) {
                return this._intersectUnIndexedTriangles(ray, positions, indices, fastCheck, trianglePredicate);
            }
            return this._intersectTriangles(ray, positions, indices, step, checkStopper, fastCheck, trianglePredicate);
        }
    }
    /**
     * @internal
     */
    _intersectLines(ray, positions, indices, intersectionThreshold, fastCheck) {
        let intersectInfo = null;
        // Line test
        for (let index = this.indexStart; index < this.indexStart + this.indexCount; index += 2) {
            const p0 = positions[indices[index]];
            const p1 = positions[indices[index + 1]];
            const length = ray.intersectionSegment(p0, p1, intersectionThreshold);
            if (length < 0) {
                continue;
            }
            if (fastCheck || !intersectInfo || length < intersectInfo.distance) {
                intersectInfo = new _Collisions_intersectionInfo_js__WEBPACK_IMPORTED_MODULE_1__/* .IntersectionInfo */ .w(null, null, length);
                intersectInfo.faceId = index / 2;
                if (fastCheck) {
                    break;
                }
            }
        }
        return intersectInfo;
    }
    /**
     * @internal
     */
    _intersectUnIndexedLines(ray, positions, indices, intersectionThreshold, fastCheck) {
        let intersectInfo = null;
        // Line test
        for (let index = this.verticesStart; index < this.verticesStart + this.verticesCount; index += 2) {
            const p0 = positions[index];
            const p1 = positions[index + 1];
            const length = ray.intersectionSegment(p0, p1, intersectionThreshold);
            if (length < 0) {
                continue;
            }
            if (fastCheck || !intersectInfo || length < intersectInfo.distance) {
                intersectInfo = new _Collisions_intersectionInfo_js__WEBPACK_IMPORTED_MODULE_1__/* .IntersectionInfo */ .w(null, null, length);
                intersectInfo.faceId = index / 2;
                if (fastCheck) {
                    break;
                }
            }
        }
        return intersectInfo;
    }
    /**
     * @internal
     */
    _intersectTriangles(ray, positions, indices, step, checkStopper, fastCheck, trianglePredicate) {
        let intersectInfo = null;
        // Triangles test
        let faceId = -1;
        for (let index = this.indexStart; index < this.indexStart + this.indexCount - (3 - step); index += step) {
            faceId++;
            const indexA = indices[index];
            const indexB = indices[index + 1];
            const indexC = indices[index + 2];
            if (checkStopper && indexC === 0xffffffff) {
                index += 2;
                continue;
            }
            const p0 = positions[indexA];
            const p1 = positions[indexB];
            const p2 = positions[indexC];
            // stay defensive and don't check against undefined positions.
            if (!p0 || !p1 || !p2) {
                continue;
            }
            if (trianglePredicate && !trianglePredicate(p0, p1, p2, ray, indexA, indexB, indexC)) {
                continue;
            }
            const currentIntersectInfo = ray.intersectsTriangle(p0, p1, p2);
            if (currentIntersectInfo) {
                if (currentIntersectInfo.distance < 0) {
                    continue;
                }
                if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) {
                    intersectInfo = currentIntersectInfo;
                    intersectInfo.faceId = faceId;
                    if (fastCheck) {
                        break;
                    }
                }
            }
        }
        return intersectInfo;
    }
    /**
     * @internal
     */
    _intersectUnIndexedTriangles(ray, positions, indices, fastCheck, trianglePredicate) {
        let intersectInfo = null;
        // Triangles test
        for (let index = this.verticesStart; index < this.verticesStart + this.verticesCount; index += 3) {
            const p0 = positions[index];
            const p1 = positions[index + 1];
            const p2 = positions[index + 2];
            if (trianglePredicate && !trianglePredicate(p0, p1, p2, ray, -1, -1, -1)) {
                continue;
            }
            const currentIntersectInfo = ray.intersectsTriangle(p0, p1, p2);
            if (currentIntersectInfo) {
                if (currentIntersectInfo.distance < 0) {
                    continue;
                }
                if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) {
                    intersectInfo = currentIntersectInfo;
                    intersectInfo.faceId = index / 3;
                    if (fastCheck) {
                        break;
                    }
                }
            }
        }
        return intersectInfo;
    }
    /** @internal */
    _rebuild() {
        if (this._linesIndexBuffer) {
            this._linesIndexBuffer = null;
        }
    }
    // Clone
    /**
     * Creates a new submesh from the passed mesh
     * @param newMesh defines the new hosting mesh
     * @param newRenderingMesh defines an optional rendering mesh
     * @returns the new submesh
     */
    clone(newMesh, newRenderingMesh) {
        const result = new SubMesh(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, newMesh, newRenderingMesh, false);
        if (!this.IsGlobal) {
            const boundingInfo = this.getBoundingInfo();
            if (!boundingInfo) {
                return result;
            }
            result._boundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_2__/* .BoundingInfo */ .j(boundingInfo.minimum, boundingInfo.maximum);
        }
        return result;
    }
    // Dispose
    /**
     * Release associated resources
     * @param immediate If true, the effect will be disposed immediately (false by default)
     */
    dispose(immediate = false) {
        if (this._linesIndexBuffer) {
            this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer);
            this._linesIndexBuffer = null;
        }
        // Remove from mesh
        const index = this._mesh.subMeshes.indexOf(this);
        this._mesh.subMeshes.splice(index, 1);
        this.resetDrawCache(undefined, immediate);
    }
    /**
     * Gets the class name
     * @returns the string "SubMesh".
     */
    getClassName() {
        return "SubMesh";
    }
    // Statics
    /**
     * Creates a new submesh from indices data
     * @param materialIndex the index of the main mesh material
     * @param startIndex the index where to start the copy in the mesh indices array
     * @param indexCount the number of indices to copy then from the startIndex
     * @param mesh the main mesh to create the submesh from
     * @param renderingMesh the optional rendering mesh
     * @param createBoundingBox defines if bounding box should be created for this submesh
     * @returns a new submesh
     */
    static CreateFromIndices(materialIndex, startIndex, indexCount, mesh, renderingMesh, createBoundingBox = true) {
        let minVertexIndex = Number.MAX_VALUE;
        let maxVertexIndex = -Number.MAX_VALUE;
        const whatWillRender = renderingMesh || mesh;
        const indices = whatWillRender.getIndices();
        for (let index = startIndex; index < startIndex + indexCount; index++) {
            const vertexIndex = indices[index];
            if (vertexIndex < minVertexIndex) {
                minVertexIndex = vertexIndex;
            }
            if (vertexIndex > maxVertexIndex) {
                maxVertexIndex = vertexIndex;
            }
        }
        return new SubMesh(materialIndex, minVertexIndex, maxVertexIndex - minVertexIndex + 1, startIndex, indexCount, mesh, renderingMesh, createBoundingBox);
    }
}
//# sourceMappingURL=subMesh.js.map

/***/ }),

/***/ 90203:
/***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {

/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76595);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95616);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79923);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51137);
/* harmony import */ var _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20863);





_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstanceAdd = function (matrix, refresh = true) {
    if (!this.getScene().getEngine().getCaps().instancedArrays) {
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("Thin Instances are not supported on this device as Instanced Array extension not supported");
        return -1;
    }
    this._thinInstanceUpdateBufferSize("matrix", Array.isArray(matrix) ? matrix.length : 1);
    const index = this._thinInstanceDataStorage.instancesCount;
    if (Array.isArray(matrix)) {
        for (let i = 0; i < matrix.length; ++i) {
            this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix[i], i === matrix.length - 1 && refresh);
        }
    }
    else {
        this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix, refresh);
    }
    return index;
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstanceAddSelf = function (refresh = true) {
    return this.thinInstanceAdd(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.IdentityReadOnly, refresh);
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstanceRegisterAttribute = function (kind, stride) {
    // preserve backward compatibility
    if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorKind) {
        kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorInstanceKind;
    }
    this.removeVerticesData(kind);
    this._thinInstanceInitializeUserStorage();
    this._userThinInstanceBuffersStorage.strides[kind] = stride;
    this._userThinInstanceBuffersStorage.sizes[kind] = stride * Math.max(32, this._thinInstanceDataStorage.instancesCount); // Initial size
    this._userThinInstanceBuffersStorage.data[kind] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[kind]);
    this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R(this.getEngine(), this._userThinInstanceBuffersStorage.data[kind], kind, true, false, stride, true);
    this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]);
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstanceSetMatrixAt = function (index, matrix, refresh = true) {
    if (!this._thinInstanceDataStorage.matrixData || index >= this._thinInstanceDataStorage.instancesCount) {
        return false;
    }
    const matrixData = this._thinInstanceDataStorage.matrixData;
    matrix.copyToArray(matrixData, index * 16);
    if (this._thinInstanceDataStorage.worldMatrices) {
        this._thinInstanceDataStorage.worldMatrices[index] = matrix;
    }
    if (refresh) {
        this.thinInstanceBufferUpdated("matrix");
        if (!this.doNotSyncBoundingInfo) {
            this.thinInstanceRefreshBoundingInfo(false);
        }
    }
    return true;
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstanceSetAttributeAt = function (kind, index, value, refresh = true) {
    // preserve backward compatibility
    if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorKind) {
        kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorInstanceKind;
    }
    if (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.data[kind] || index >= this._thinInstanceDataStorage.instancesCount) {
        return false;
    }
    this._thinInstanceUpdateBufferSize(kind, 0); // make sur the buffer for the kind attribute is big enough
    this._userThinInstanceBuffersStorage.data[kind].set(value, index * this._userThinInstanceBuffersStorage.strides[kind]);
    if (refresh) {
        this.thinInstanceBufferUpdated(kind);
    }
    return true;
};
Object.defineProperty(_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype, "thinInstanceCount", {
    get: function () {
        return this._thinInstanceDataStorage.instancesCount;
    },
    set: function (value) {
        const matrixData = this._thinInstanceDataStorage.matrixData ?? this.source?._thinInstanceDataStorage.matrixData;
        const numMaxInstances = matrixData ? matrixData.length / 16 : 0;
        if (value <= numMaxInstances) {
            this._thinInstanceDataStorage.instancesCount = value;
        }
    },
    enumerable: true,
    configurable: true,
});
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype._thinInstanceCreateMatrixBuffer = function (kind, buffer, staticBuffer = true) {
    const matrixBuffer = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .Buffer */ .h(this.getEngine(), buffer, !staticBuffer, 16, false, true);
    for (let i = 0; i < 4; i++) {
        this.setVerticesBuffer(matrixBuffer.createVertexBuffer(kind + i, i * 4, 4));
    }
    return matrixBuffer;
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstanceSetBuffer = function (kind, buffer, stride = 0, staticBuffer = true) {
    stride = stride || 16;
    if (kind === "matrix") {
        this._thinInstanceDataStorage.matrixBuffer?.dispose();
        this._thinInstanceDataStorage.matrixBuffer = null;
        this._thinInstanceDataStorage.matrixBufferSize = buffer ? buffer.length : 32 * stride;
        this._thinInstanceDataStorage.matrixData = buffer;
        this._thinInstanceDataStorage.worldMatrices = null;
        if (buffer !== null) {
            this._thinInstanceDataStorage.instancesCount = buffer.length / stride;
            this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", buffer, staticBuffer);
            if (!this.doNotSyncBoundingInfo) {
                this.thinInstanceRefreshBoundingInfo(false);
            }
        }
        else {
            this._thinInstanceDataStorage.instancesCount = 0;
            if (!this.doNotSyncBoundingInfo) {
                // mesh has no more thin instances, so need to recompute the bounding box because it's the regular mesh that will now be displayed
                this.refreshBoundingInfo();
            }
        }
    }
    else if (kind === "previousMatrix") {
        this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();
        this._thinInstanceDataStorage.previousMatrixBuffer = null;
        this._thinInstanceDataStorage.previousMatrixData = buffer;
        if (buffer !== null) {
            this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", buffer, staticBuffer);
        }
    }
    else {
        // color for instanced mesh is ColorInstanceKind and not ColorKind because of native that needs to do the differenciation
        // hot switching kind here to preserve backward compatibility
        if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorKind) {
            kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorInstanceKind;
        }
        if (buffer === null) {
            if (this._userThinInstanceBuffersStorage?.data[kind]) {
                this.removeVerticesData(kind);
                delete this._userThinInstanceBuffersStorage.data[kind];
                delete this._userThinInstanceBuffersStorage.strides[kind];
                delete this._userThinInstanceBuffersStorage.sizes[kind];
                delete this._userThinInstanceBuffersStorage.vertexBuffers[kind];
            }
        }
        else {
            this._thinInstanceInitializeUserStorage();
            this._userThinInstanceBuffersStorage.data[kind] = buffer;
            this._userThinInstanceBuffersStorage.strides[kind] = stride;
            this._userThinInstanceBuffersStorage.sizes[kind] = buffer.length;
            this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R(this.getEngine(), buffer, kind, !staticBuffer, false, stride, true);
            this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]);
        }
    }
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstanceBufferUpdated = function (kind) {
    if (kind === "matrix") {
        if (this.thinInstanceAllowAutomaticStaticBufferRecreation && this._thinInstanceDataStorage.matrixBuffer && !this._thinInstanceDataStorage.matrixBuffer.isUpdatable()) {
            this._thinInstanceRecreateBuffer(kind);
        }
        this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, this._thinInstanceDataStorage.instancesCount);
    }
    else if (kind === "previousMatrix") {
        if (this.thinInstanceAllowAutomaticStaticBufferRecreation &&
            this._thinInstanceDataStorage.previousMatrixBuffer &&
            !this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()) {
            this._thinInstanceRecreateBuffer(kind);
        }
        this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData, 0, this._thinInstanceDataStorage.instancesCount);
    }
    else {
        // preserve backward compatibility
        if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorKind) {
            kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorInstanceKind;
        }
        if (this._userThinInstanceBuffersStorage?.vertexBuffers[kind]) {
            if (this.thinInstanceAllowAutomaticStaticBufferRecreation && !this._userThinInstanceBuffersStorage.vertexBuffers[kind].isUpdatable()) {
                this._thinInstanceRecreateBuffer(kind);
            }
            this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(this._userThinInstanceBuffersStorage.data[kind], 0);
        }
    }
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstancePartialBufferUpdate = function (kind, data, offset) {
    if (kind === "matrix") {
        if (this._thinInstanceDataStorage.matrixBuffer) {
            this._thinInstanceDataStorage.matrixBuffer.updateDirectly(data, offset);
        }
    }
    else {
        // preserve backward compatibility
        if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorKind) {
            kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorInstanceKind;
        }
        if (this._userThinInstanceBuffersStorage?.vertexBuffers[kind]) {
            this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(data, offset);
        }
    }
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstanceGetWorldMatrices = function () {
    if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) {
        return [];
    }
    const matrixData = this._thinInstanceDataStorage.matrixData;
    if (!this._thinInstanceDataStorage.worldMatrices) {
        this._thinInstanceDataStorage.worldMatrices = [];
        for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) {
            this._thinInstanceDataStorage.worldMatrices[i] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromArray(matrixData, i * 16);
        }
    }
    return this._thinInstanceDataStorage.worldMatrices;
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype.thinInstanceRefreshBoundingInfo = function (forceRefreshParentInfo = false, applySkeleton = false, applyMorph = false) {
    if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) {
        return;
    }
    const vectors = this._thinInstanceDataStorage.boundingVectors;
    if (forceRefreshParentInfo || !this.rawBoundingInfo) {
        vectors.length = 0;
        this.refreshBoundingInfo(applySkeleton, applyMorph);
        const boundingInfo = this.getBoundingInfo();
        this.rawBoundingInfo = new _Culling_boundingInfo_js__WEBPACK_IMPORTED_MODULE_4__/* .BoundingInfo */ .j(boundingInfo.minimum, boundingInfo.maximum);
    }
    const boundingInfo = this.getBoundingInfo();
    const matrixData = this._thinInstanceDataStorage.matrixData;
    if (vectors.length === 0) {
        for (let v = 0; v < boundingInfo.boundingBox.vectors.length; ++v) {
            vectors.push(boundingInfo.boundingBox.vectors[v].clone());
        }
    }
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0].setAll(Number.POSITIVE_INFINITY); // min
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[1].setAll(Number.NEGATIVE_INFINITY); // max
    for (let i = 0; i < this._thinInstanceDataStorage.instancesCount; ++i) {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Matrix */ .uq.FromArrayToRef(matrixData, i * 16, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Matrix[0]);
        for (let v = 0; v < vectors.length; ++v) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .Vector3 */ .Pq.TransformCoordinatesToRef(vectors[v], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Matrix[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[2]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0].minimizeInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[2]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[1].maximizeInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[2]);
        }
    }
    boundingInfo.reConstruct(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_2__/* .TmpVectors */ .AA.Vector3[1]);
    this._updateBoundingInfo();
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype._thinInstanceRecreateBuffer = function (kind, staticBuffer = true) {
    if (kind === "matrix") {
        this._thinInstanceDataStorage.matrixBuffer?.dispose();
        this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", this._thinInstanceDataStorage.matrixData, staticBuffer);
    }
    else if (kind === "previousMatrix") {
        if (this._scene.needsPreviousWorldMatrices) {
            this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();
            this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", this._thinInstanceDataStorage.previousMatrixData ?? this._thinInstanceDataStorage.matrixData, staticBuffer);
        }
    }
    else {
        if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorKind) {
            kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorInstanceKind;
        }
        this._userThinInstanceBuffersStorage.vertexBuffers[kind]?.dispose();
        this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R(this.getEngine(), this._userThinInstanceBuffersStorage.data[kind], kind, !staticBuffer, false, this._userThinInstanceBuffersStorage.strides[kind], true);
        this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]);
    }
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype._thinInstanceUpdateBufferSize = function (kind, numInstances = 1) {
    // preserve backward compatibility
    if (kind === _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorKind) {
        kind = _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.ColorInstanceKind;
    }
    const kindIsMatrix = kind === "matrix";
    if (!kindIsMatrix && (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.strides[kind])) {
        return;
    }
    const stride = kindIsMatrix ? 16 : this._userThinInstanceBuffersStorage.strides[kind];
    const currentSize = kindIsMatrix ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[kind];
    let data = kindIsMatrix ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[kind];
    const bufferSize = (this._thinInstanceDataStorage.instancesCount + numInstances) * stride;
    let newSize = currentSize;
    while (newSize < bufferSize) {
        newSize *= 2;
    }
    if (!data || currentSize != newSize) {
        if (!data) {
            data = new Float32Array(newSize);
        }
        else {
            const newData = new Float32Array(newSize);
            newData.set(data, 0);
            data = newData;
        }
        if (kindIsMatrix) {
            this._thinInstanceDataStorage.matrixBuffer?.dispose();
            this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", data, false);
            this._thinInstanceDataStorage.matrixData = data;
            this._thinInstanceDataStorage.matrixBufferSize = newSize;
            if (this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData) {
                this._thinInstanceDataStorage.previousMatrixBuffer?.dispose();
                this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", data, false);
            }
        }
        else {
            this._userThinInstanceBuffersStorage.vertexBuffers[kind]?.dispose();
            this._userThinInstanceBuffersStorage.data[kind] = data;
            this._userThinInstanceBuffersStorage.sizes[kind] = newSize;
            this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R(this.getEngine(), data, kind, true, false, stride, true);
            this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]);
        }
    }
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype._thinInstanceInitializeUserStorage = function () {
    if (!this._userThinInstanceBuffersStorage) {
        this._userThinInstanceBuffersStorage = {
            data: {},
            sizes: {},
            vertexBuffers: {},
            strides: {},
        };
    }
};
_Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e.prototype._disposeThinInstanceSpecificData = function () {
    if (this._thinInstanceDataStorage?.matrixBuffer) {
        this._thinInstanceDataStorage.matrixBuffer.dispose();
        this._thinInstanceDataStorage.matrixBuffer = null;
    }
};
//# sourceMappingURL=thinInstanceMesh.js.map

/***/ }),

/***/ 97328:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   V: () => (/* binding */ TransformNode)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79259);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26877);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79923);
/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4870);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56552);







const convertRHSToLHS = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Compose(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.One(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.FromEulerAngles(0, Math.PI, 0), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero());
/**
 * A TransformNode is an object that is not rendered but can be used as a center of transformation. This can decrease memory usage and increase rendering speed compared to using an empty mesh as a parent and is less complicated than using a pivot matrix.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/transform_node
 */
class TransformNode extends _node_js__WEBPACK_IMPORTED_MODULE_5__/* .Node */ .b {
    /**
     * Gets or sets the billboard mode. Default is 0.
     *
     * | Value | Type | Description |
     * | --- | --- | --- |
     * | 0 | BILLBOARDMODE_NONE |  |
     * | 1 | BILLBOARDMODE_X |  |
     * | 2 | BILLBOARDMODE_Y |  |
     * | 4 | BILLBOARDMODE_Z |  |
     * | 7 | BILLBOARDMODE_ALL |  |
     *
     */
    get billboardMode() {
        return this._billboardMode;
    }
    set billboardMode(value) {
        if (this._billboardMode === value) {
            return;
        }
        this._billboardMode = value;
        this._cache.useBillboardPosition = (this._billboardMode & TransformNode.BILLBOARDMODE_USE_POSITION) !== 0;
        this._computeUseBillboardPath();
    }
    /**
     * Gets or sets a boolean indicating that parent rotation should be preserved when using billboards.
     * This could be useful for glTF objects where parent rotation helps converting from right handed to left handed
     */
    get preserveParentRotationForBillboard() {
        return this._preserveParentRotationForBillboard;
    }
    set preserveParentRotationForBillboard(value) {
        if (value === this._preserveParentRotationForBillboard) {
            return;
        }
        this._preserveParentRotationForBillboard = value;
        this._computeUseBillboardPath();
    }
    _computeUseBillboardPath() {
        this._cache.useBillboardPath = this._billboardMode !== TransformNode.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard;
    }
    /**
     * Gets or sets the distance of the object to max, often used by skybox
     */
    get infiniteDistance() {
        return this._infiniteDistance;
    }
    set infiniteDistance(value) {
        if (this._infiniteDistance === value) {
            return;
        }
        this._infiniteDistance = value;
    }
    constructor(name, scene = null, isPure = true) {
        super(name, scene, false);
        this._forward = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq(0, 0, 1);
        this._up = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq(0, 1, 0);
        this._right = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq(1, 0, 0);
        // Properties
        this._position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        this._rotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        this._rotationQuaternion = null;
        this._scaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.One();
        this._transformToBoneReferal = null;
        this._isAbsoluteSynced = false;
        this._billboardMode = TransformNode.BILLBOARDMODE_NONE;
        this._preserveParentRotationForBillboard = false;
        /**
         * Multiplication factor on scale x/y/z when computing the world matrix. Eg. for a 1x1x1 cube setting this to 2 will make it a 2x2x2 cube
         */
        this.scalingDeterminant = 1;
        this._infiniteDistance = false;
        /**
         * Gets or sets a boolean indicating that non uniform scaling (when at least one component is different from others) should be ignored.
         * By default the system will update normals to compensate
         */
        this.ignoreNonUniformScaling = false;
        /**
         * Gets or sets a boolean indicating that even if rotationQuaternion is defined, you can keep updating rotation property and Babylon.js will just mix both
         */
        this.reIntegrateRotationIntoRotationQuaternion = false;
        // Cache
        /** @internal */
        this._poseMatrix = null;
        /** @internal */
        this._localMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Zero();
        this._usePivotMatrix = false;
        this._absolutePosition = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        this._absoluteScaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        this._absoluteRotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.Identity();
        this._pivotMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Identity();
        /** @internal */
        this._postMultiplyPivotMatrix = false;
        this._isWorldMatrixFrozen = false;
        /** @internal */
        this._indexInSceneTransformNodesArray = -1;
        /**
         * An event triggered after the world matrix is updated
         */
        this.onAfterWorldMatrixUpdateObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .cP();
        this._nonUniformScaling = false;
        if (isPure) {
            this.getScene().addTransformNode(this);
        }
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "TransformNode" string
     */
    getClassName() {
        return "TransformNode";
    }
    /**
     * Gets or set the node position (default is (0.0, 0.0, 0.0))
     */
    get position() {
        return this._position;
    }
    set position(newPosition) {
        this._position = newPosition;
        this._markAsDirtyInternal();
    }
    /**
     * return true if a pivot has been set
     * @returns true if a pivot matrix is used
     */
    isUsingPivotMatrix() {
        return this._usePivotMatrix;
    }
    /**
     * @returns true if pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect.
     */
    isUsingPostMultiplyPivotMatrix() {
        return this._postMultiplyPivotMatrix;
    }
    /**
     * Gets or sets the rotation property : a Vector3 defining the rotation value in radians around each local axis X, Y, Z  (default is (0.0, 0.0, 0.0)).
     * If rotation quaternion is set, this Vector3 will be ignored and copy from the quaternion
     */
    get rotation() {
        return this._rotation;
    }
    set rotation(newRotation) {
        this._rotation = newRotation;
        this._rotationQuaternion = null;
        this._markAsDirtyInternal();
    }
    /**
     * Gets or sets the scaling property : a Vector3 defining the node scaling along each local axis X, Y, Z (default is (1.0, 1.0, 1.0)).
     */
    get scaling() {
        return this._scaling;
    }
    set scaling(newScaling) {
        this._scaling = newScaling;
        this._markAsDirtyInternal();
    }
    /**
     * Gets or sets the rotation Quaternion property : this a Quaternion object defining the node rotation by using a unit quaternion (undefined by default, but can be null).
     * If set, only the rotationQuaternion is then used to compute the node rotation (ie. node.rotation will be ignored)
     */
    get rotationQuaternion() {
        return this._rotationQuaternion;
    }
    set rotationQuaternion(quaternion) {
        this._rotationQuaternion = quaternion;
        //reset the rotation vector.
        if (quaternion) {
            this._rotation.setAll(0.0);
        }
        this._markAsDirtyInternal();
    }
    _markAsDirtyInternal() {
        if (this._isDirty) {
            return;
        }
        this._isDirty = true;
        if (this.customMarkAsDirty) {
            this.customMarkAsDirty();
        }
    }
    /**
     * The forward direction of that transform in world space.
     */
    get forward() {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformNormalFromFloatsToRef(0, 0, this.getScene().useRightHandedSystem ? -1.0 : 1.0, this.getWorldMatrix(), this._forward);
        return this._forward.normalize();
    }
    /**
     * The up direction of that transform in world space.
     */
    get up() {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformNormalFromFloatsToRef(0, 1, 0, this.getWorldMatrix(), this._up);
        return this._up.normalize();
    }
    /**
     * The right direction of that transform in world space.
     */
    get right() {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem ? -1.0 : 1.0, 0, 0, this.getWorldMatrix(), this._right);
        return this._right.normalize();
    }
    /**
     * Copies the parameter passed Matrix into the mesh Pose matrix.
     * @param matrix the matrix to copy the pose from
     * @returns this TransformNode.
     */
    updatePoseMatrix(matrix) {
        if (!this._poseMatrix) {
            this._poseMatrix = matrix.clone();
            return this;
        }
        this._poseMatrix.copyFrom(matrix);
        return this;
    }
    /**
     * Returns the mesh Pose matrix.
     * @returns the pose matrix
     */
    getPoseMatrix() {
        if (!this._poseMatrix) {
            this._poseMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Identity();
        }
        return this._poseMatrix;
    }
    /** @internal */
    _isSynchronized() {
        const cache = this._cache;
        if (this._billboardMode !== cache.billboardMode || this._billboardMode !== TransformNode.BILLBOARDMODE_NONE) {
            return false;
        }
        if (cache.pivotMatrixUpdated) {
            return false;
        }
        if (this._infiniteDistance) {
            return false;
        }
        if (this._position._isDirty) {
            return false;
        }
        if (this._scaling._isDirty) {
            return false;
        }
        if ((this._rotationQuaternion && this._rotationQuaternion._isDirty) || this._rotation._isDirty) {
            return false;
        }
        return true;
    }
    /** @internal */
    _initCache() {
        super._initCache();
        const cache = this._cache;
        cache.localMatrixUpdated = false;
        cache.billboardMode = -1;
        cache.infiniteDistance = false;
        cache.useBillboardPosition = false;
        cache.useBillboardPath = false;
    }
    /**
     * Returns the current mesh absolute position.
     * Returns a Vector3.
     */
    get absolutePosition() {
        return this.getAbsolutePosition();
    }
    /**
     * Returns the current mesh absolute scaling.
     * Returns a Vector3.
     */
    get absoluteScaling() {
        this._syncAbsoluteScalingAndRotation();
        return this._absoluteScaling;
    }
    /**
     * Returns the current mesh absolute rotation.
     * Returns a Quaternion.
     */
    get absoluteRotationQuaternion() {
        this._syncAbsoluteScalingAndRotation();
        return this._absoluteRotationQuaternion;
    }
    /**
     * Sets a new matrix to apply before all other transformation
     * @param matrix defines the transform matrix
     * @returns the current TransformNode
     */
    setPreTransformMatrix(matrix) {
        return this.setPivotMatrix(matrix, false);
    }
    /**
     * Sets a new pivot matrix to the current node
     * @param matrix defines the new pivot matrix to use
     * @param postMultiplyPivotMatrix defines if the pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect
     * @returns the current TransformNode
     */
    setPivotMatrix(matrix, postMultiplyPivotMatrix = true) {
        this._pivotMatrix.copyFrom(matrix);
        this._usePivotMatrix = !this._pivotMatrix.isIdentity();
        this._cache.pivotMatrixUpdated = true;
        this._postMultiplyPivotMatrix = postMultiplyPivotMatrix;
        if (this._postMultiplyPivotMatrix) {
            if (!this._pivotMatrixInverse) {
                this._pivotMatrixInverse = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Invert(this._pivotMatrix);
            }
            else {
                this._pivotMatrix.invertToRef(this._pivotMatrixInverse);
            }
        }
        return this;
    }
    /**
     * Returns the mesh pivot matrix.
     * Default : Identity.
     * @returns the matrix
     */
    getPivotMatrix() {
        return this._pivotMatrix;
    }
    /**
     * Instantiate (when possible) or clone that node with its hierarchy
     * @param newParent defines the new parent to use for the instance (or clone)
     * @param options defines options to configure how copy is done
     * @param options.doNotInstantiate defines if the model must be instantiated or just cloned
     * @param onNewNodeCreated defines an option callback to call when a clone or an instance is created
     * @returns an instance (or a clone) of the current node with its hierarchy
     */
    instantiateHierarchy(newParent = null, options, onNewNodeCreated) {
        const clone = this.clone("Clone of " + (this.name || this.id), newParent || this.parent, true);
        if (clone) {
            if (onNewNodeCreated) {
                onNewNodeCreated(this, clone);
            }
        }
        for (const child of this.getChildTransformNodes(true)) {
            child.instantiateHierarchy(clone, options, onNewNodeCreated);
        }
        return clone;
    }
    /**
     * Prevents the World matrix to be computed any longer
     * @param newWorldMatrix defines an optional matrix to use as world matrix
     * @param decompose defines whether to decompose the given newWorldMatrix or directly assign
     * @returns the TransformNode.
     */
    freezeWorldMatrix(newWorldMatrix = null, decompose = false) {
        if (newWorldMatrix) {
            if (decompose) {
                this._rotation.setAll(0);
                this._rotationQuaternion = this._rotationQuaternion || _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.Identity();
                newWorldMatrix.decompose(this._scaling, this._rotationQuaternion, this._position);
                this.computeWorldMatrix(true);
            }
            else {
                this._worldMatrix = newWorldMatrix;
                this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]);
                this._afterComputeWorldMatrix();
            }
        }
        else {
            this._isWorldMatrixFrozen = false; // no guarantee world is not already frozen, switch off temporarily
            this.computeWorldMatrix(true);
        }
        this._isDirty = false;
        this._isWorldMatrixFrozen = true;
        return this;
    }
    /**
     * Allows back the World matrix computation.
     * @returns the TransformNode.
     */
    unfreezeWorldMatrix() {
        this._isWorldMatrixFrozen = false;
        this.computeWorldMatrix(true);
        return this;
    }
    /**
     * True if the World matrix has been frozen.
     */
    get isWorldMatrixFrozen() {
        return this._isWorldMatrixFrozen;
    }
    /**
     * Returns the mesh absolute position in the World.
     * @returns a Vector3.
     */
    getAbsolutePosition() {
        this.computeWorldMatrix();
        return this._absolutePosition;
    }
    /**
     * Sets the mesh absolute position in the World from a Vector3 or an Array(3).
     * @param absolutePosition the absolute position to set
     * @returns the TransformNode.
     */
    setAbsolutePosition(absolutePosition) {
        if (!absolutePosition) {
            return this;
        }
        let absolutePositionX;
        let absolutePositionY;
        let absolutePositionZ;
        if (absolutePosition.x === undefined) {
            if (arguments.length < 3) {
                return this;
            }
            absolutePositionX = arguments[0];
            absolutePositionY = arguments[1];
            absolutePositionZ = arguments[2];
        }
        else {
            absolutePositionX = absolutePosition.x;
            absolutePositionY = absolutePosition.y;
            absolutePositionZ = absolutePosition.z;
        }
        if (this.parent) {
            const invertParentWorldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0];
            this.parent.getWorldMatrix().invertToRef(invertParentWorldMatrix);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(absolutePositionX, absolutePositionY, absolutePositionZ, invertParentWorldMatrix, this.position);
        }
        else {
            this.position.x = absolutePositionX;
            this.position.y = absolutePositionY;
            this.position.z = absolutePositionZ;
        }
        this._absolutePosition.copyFrom(absolutePosition);
        return this;
    }
    /**
     * Sets the mesh position in its local space.
     * @param vector3 the position to set in localspace
     * @returns the TransformNode.
     */
    setPositionWithLocalVector(vector3) {
        this.computeWorldMatrix();
        this.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformNormal(vector3, this._localMatrix);
        return this;
    }
    /**
     * Returns the mesh position in the local space from the current World matrix values.
     * @returns a new Vector3.
     */
    getPositionExpressedInLocalSpace() {
        this.computeWorldMatrix();
        const invLocalWorldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0];
        this._localMatrix.invertToRef(invLocalWorldMatrix);
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformNormal(this.position, invLocalWorldMatrix);
    }
    /**
     * Translates the mesh along the passed Vector3 in its local space.
     * @param vector3 the distance to translate in localspace
     * @returns the TransformNode.
     */
    locallyTranslate(vector3) {
        this.computeWorldMatrix(true);
        this.position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformCoordinates(vector3, this._localMatrix);
        return this;
    }
    /**
     * Orients a mesh towards a target point. Mesh must be drawn facing user.
     * @param targetPoint the position (must be in same space as current mesh) to look at
     * @param yawCor optional yaw (y-axis) correction in radians
     * @param pitchCor optional pitch (x-axis) correction in radians
     * @param rollCor optional roll (z-axis) correction in radians
     * @param space the chosen space of the target
     * @returns the TransformNode.
     */
    lookAt(targetPoint, yawCor = 0, pitchCor = 0, rollCor = 0, space = 0 /* Space.LOCAL */) {
        const dv = TransformNode._LookAtVectorCache;
        const pos = space === 0 /* Space.LOCAL */ ? this.position : this.getAbsolutePosition();
        targetPoint.subtractToRef(pos, dv);
        this.setDirection(dv, yawCor, pitchCor, rollCor);
        // Correct for parent's rotation offset
        if (space === 1 /* Space.WORLD */ && this.parent) {
            if (this.rotationQuaternion) {
                // Get local rotation matrix of the looking object
                const rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0];
                this.rotationQuaternion.toRotationMatrix(rotationMatrix);
                // Offset rotation by parent's inverted rotation matrix to correct in world space
                const parentRotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1];
                this.parent.getWorldMatrix().getRotationMatrixToRef(parentRotationMatrix);
                parentRotationMatrix.invert();
                rotationMatrix.multiplyToRef(parentRotationMatrix, rotationMatrix);
                this.rotationQuaternion.fromRotationMatrix(rotationMatrix);
            }
            else {
                // Get local rotation matrix of the looking object
                const quaternionRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0];
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.FromEulerVectorToRef(this.rotation, quaternionRotation);
                const rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0];
                quaternionRotation.toRotationMatrix(rotationMatrix);
                // Offset rotation by parent's inverted rotation matrix to correct in world space
                const parentRotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1];
                this.parent.getWorldMatrix().getRotationMatrixToRef(parentRotationMatrix);
                parentRotationMatrix.invert();
                rotationMatrix.multiplyToRef(parentRotationMatrix, rotationMatrix);
                quaternionRotation.fromRotationMatrix(rotationMatrix);
                quaternionRotation.toEulerAnglesToRef(this.rotation);
            }
        }
        return this;
    }
    /**
     * Returns a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh.
     * This Vector3 is expressed in the World space.
     * @param localAxis axis to rotate
     * @returns a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh.
     */
    getDirection(localAxis) {
        const result = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        this.getDirectionToRef(localAxis, result);
        return result;
    }
    /**
     * Sets the Vector3 "result" as the rotated Vector3 "localAxis" in the same rotation than the mesh.
     * localAxis is expressed in the mesh local space.
     * result is computed in the World space from the mesh World matrix.
     * @param localAxis axis to rotate
     * @param result the resulting transformnode
     * @returns this TransformNode.
     */
    getDirectionToRef(localAxis, result) {
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformNormalToRef(localAxis, this.getWorldMatrix(), result);
        return this;
    }
    /**
     * Sets this transform node rotation to the given local axis.
     * @param localAxis the axis in local space
     * @param yawCor optional yaw (y-axis) correction in radians
     * @param pitchCor optional pitch (x-axis) correction in radians
     * @param rollCor optional roll (z-axis) correction in radians
     * @returns this TransformNode
     */
    setDirection(localAxis, yawCor = 0, pitchCor = 0, rollCor = 0) {
        const yaw = -Math.atan2(localAxis.z, localAxis.x) + Math.PI / 2;
        const len = Math.sqrt(localAxis.x * localAxis.x + localAxis.z * localAxis.z);
        const pitch = -Math.atan2(localAxis.y, len);
        if (this.rotationQuaternion) {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationYawPitchRollToRef(yaw + yawCor, pitch + pitchCor, rollCor, this.rotationQuaternion);
        }
        else {
            this.rotation.x = pitch + pitchCor;
            this.rotation.y = yaw + yawCor;
            this.rotation.z = rollCor;
        }
        return this;
    }
    /**
     * Sets a new pivot point to the current node
     * @param point defines the new pivot point to use
     * @param space defines if the point is in world or local space (local by default)
     * @returns the current TransformNode
     */
    setPivotPoint(point, space = 0 /* Space.LOCAL */) {
        if (this.getScene().getRenderId() == 0) {
            this.computeWorldMatrix(true);
        }
        const wm = this.getWorldMatrix();
        if (space == 1 /* Space.WORLD */) {
            const tmat = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0];
            wm.invertToRef(tmat);
            point = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformCoordinates(point, tmat);
        }
        return this.setPivotMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Translation(-point.x, -point.y, -point.z), true);
    }
    /**
     * Returns a new Vector3 set with the mesh pivot point coordinates in the local space.
     * @returns the pivot point
     */
    getPivotPoint() {
        const point = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        this.getPivotPointToRef(point);
        return point;
    }
    /**
     * Sets the passed Vector3 "result" with the coordinates of the mesh pivot point in the local space.
     * @param result the vector3 to store the result
     * @returns this TransformNode.
     */
    getPivotPointToRef(result) {
        result.x = -this._pivotMatrix.m[12];
        result.y = -this._pivotMatrix.m[13];
        result.z = -this._pivotMatrix.m[14];
        return this;
    }
    /**
     * Returns a new Vector3 set with the mesh pivot point World coordinates.
     * @returns a new Vector3 set with the mesh pivot point World coordinates.
     */
    getAbsolutePivotPoint() {
        const point = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
        this.getAbsolutePivotPointToRef(point);
        return point;
    }
    /**
     * Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates.
     * @param result vector3 to store the result
     * @returns this TransformNode.
     */
    getAbsolutePivotPointToRef(result) {
        this.getPivotPointToRef(result);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformCoordinatesToRef(result, this.getWorldMatrix(), result);
        return this;
    }
    /**
     * Flag the transform node as dirty (Forcing it to update everything)
     * @param property if set to "rotation" the objects rotationQuaternion will be set to null
     * @returns this  node
     */
    markAsDirty(property) {
        if (this._isDirty) {
            return this;
        }
        // We need to explicitly update the children
        // as the scene.evaluateActiveMeshes will not poll the transform nodes
        if (this._children) {
            for (const child of this._children) {
                child.markAsDirty(property);
            }
        }
        return super.markAsDirty(property);
    }
    /**
     * Defines the passed node as the parent of the current node.
     * The node will remain exactly where it is and its position / rotation will be updated accordingly.
     * Note that if the mesh has a pivot matrix / point defined it will be applied after the parent was updated.
     * In that case the node will not remain in the same space as it is, as the pivot will be applied.
     * To avoid this, you can set updatePivot to true and the pivot will be updated to identity
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/parent
     * @param node the node ot set as the parent
     * @param preserveScalingSign if true, keep scaling sign of child. Otherwise, scaling sign might change.
     * @param updatePivot if true, update the pivot matrix to keep the node in the same space as before
     * @returns this TransformNode.
     */
    setParent(node, preserveScalingSign = false, updatePivot = false) {
        if (!node && !this.parent) {
            return this;
        }
        const quatRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0];
        const position = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0];
        const scale = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[1];
        const invParentMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.IdentityToRef(invParentMatrix);
        const composedMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0];
        this.computeWorldMatrix(true);
        let currentRotation = this.rotationQuaternion;
        if (!currentRotation) {
            currentRotation = TransformNode._TmpRotation;
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationYawPitchRollToRef(this._rotation.y, this._rotation.x, this._rotation.z, currentRotation);
        }
        // current global transformation without pivot
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.ComposeToRef(this.scaling, currentRotation, this.position, composedMatrix);
        if (this.parent) {
            composedMatrix.multiplyToRef(this.parent.computeWorldMatrix(true), composedMatrix);
        }
        // is a node was set, calculate the difference between this and the node
        if (node) {
            node.computeWorldMatrix(true).invertToRef(invParentMatrix);
            composedMatrix.multiplyToRef(invParentMatrix, composedMatrix);
        }
        composedMatrix.decompose(scale, quatRotation, position, preserveScalingSign ? this : undefined);
        if (this.rotationQuaternion) {
            this.rotationQuaternion.copyFrom(quatRotation);
        }
        else {
            quatRotation.toEulerAnglesToRef(this.rotation);
        }
        this.scaling.copyFrom(scale);
        this.position.copyFrom(position);
        this.parent = node;
        if (updatePivot) {
            this.setPivotMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Identity());
        }
        return this;
    }
    /**
     * Adds the passed mesh as a child to the current mesh
     * @param mesh defines the child mesh
     * @param preserveScalingSign if true, keep scaling sign of child. Otherwise, scaling sign might change.
     * @returns the current mesh
     */
    addChild(mesh, preserveScalingSign = false) {
        mesh.setParent(this, preserveScalingSign);
        return this;
    }
    /**
     * Removes the passed mesh from the current mesh children list
     * @param mesh defines the child mesh
     * @param preserveScalingSign if true, keep scaling sign of child. Otherwise, scaling sign might change.
     * @returns the current mesh
     */
    removeChild(mesh, preserveScalingSign = false) {
        mesh.setParent(null, preserveScalingSign);
        return this;
    }
    /**
     * True if the scaling property of this object is non uniform eg. (1,2,1)
     */
    get nonUniformScaling() {
        return this._nonUniformScaling;
    }
    /**
     * @internal
     */
    _updateNonUniformScalingState(value) {
        if (this._nonUniformScaling === value) {
            return false;
        }
        this._nonUniformScaling = value;
        return true;
    }
    /**
     * Attach the current TransformNode to another TransformNode associated with a bone
     * @param bone Bone affecting the TransformNode
     * @param affectedTransformNode TransformNode associated with the bone
     * @returns this object
     */
    attachToBone(bone, affectedTransformNode) {
        this._currentParentWhenAttachingToBone = this.parent;
        this._transformToBoneReferal = affectedTransformNode;
        this.parent = bone;
        bone.getSkeleton().prepare(true); // make sure bone.getFinalMatrix() is up to date
        if (bone.getFinalMatrix().determinant() < 0) {
            this.scalingDeterminant *= -1;
        }
        return this;
    }
    /**
     * Detach the transform node if its associated with a bone
     * @param resetToPreviousParent Indicates if the parent that was in effect when attachToBone was called should be set back or if we should set parent to null instead (defaults to the latter)
     * @returns this object
     */
    detachFromBone(resetToPreviousParent = false) {
        if (!this.parent) {
            if (resetToPreviousParent) {
                this.parent = this._currentParentWhenAttachingToBone;
            }
            return this;
        }
        if (this.parent.getWorldMatrix().determinant() < 0) {
            this.scalingDeterminant *= -1;
        }
        this._transformToBoneReferal = null;
        if (resetToPreviousParent) {
            this.parent = this._currentParentWhenAttachingToBone;
        }
        else {
            this.parent = null;
        }
        return this;
    }
    /**
     * Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in the given space.
     * space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.
     * Note that the property `rotationQuaternion` is then automatically updated and the property `rotation` is set to (0,0,0) and no longer used.
     * The passed axis is also normalized.
     * @param axis the axis to rotate around
     * @param amount the amount to rotate in radians
     * @param space Space to rotate in (Default: local)
     * @returns the TransformNode.
     */
    rotate(axis, amount, space) {
        axis.normalize();
        if (!this.rotationQuaternion) {
            this.rotationQuaternion = this.rotation.toQuaternion();
            this.rotation.setAll(0);
        }
        let rotationQuaternion;
        if (!space || space === 0 /* Space.LOCAL */) {
            rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationAxisToRef(axis, amount, TransformNode._RotationAxisCache);
            this.rotationQuaternion.multiplyToRef(rotationQuaternion, this.rotationQuaternion);
        }
        else {
            if (this.parent) {
                const parentWorldMatrix = this.parent.getWorldMatrix();
                const invertParentWorldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0];
                parentWorldMatrix.invertToRef(invertParentWorldMatrix);
                axis = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformNormal(axis, invertParentWorldMatrix);
                if (parentWorldMatrix.determinant() < 0) {
                    amount *= -1;
                }
            }
            rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationAxisToRef(axis, amount, TransformNode._RotationAxisCache);
            rotationQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);
        }
        return this;
    }
    /**
     * Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in world space.
     * Note that the property `rotationQuaternion` is then automatically updated and the property `rotation` is set to (0,0,0) and no longer used.
     * The passed axis is also normalized. .
     * Method is based on http://www.euclideanspace.com/maths/geometry/affine/aroundPoint/index.htm
     * @param point the point to rotate around
     * @param axis the axis to rotate around
     * @param amount the amount to rotate in radians
     * @returns the TransformNode
     */
    rotateAround(point, axis, amount) {
        axis.normalize();
        if (!this.rotationQuaternion) {
            this.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);
            this.rotation.setAll(0);
        }
        const tmpVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0];
        const finalScale = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[1];
        const finalTranslation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[2];
        const finalRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0];
        const translationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0]; // T
        const translationMatrixInv = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1]; // T'
        const rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[2]; // R
        const finalMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[3]; // T' x R x T
        point.subtractToRef(this.position, tmpVector);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.TranslationToRef(tmpVector.x, tmpVector.y, tmpVector.z, translationMatrix); // T
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.TranslationToRef(-tmpVector.x, -tmpVector.y, -tmpVector.z, translationMatrixInv); // T'
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.RotationAxisToRef(axis, amount, rotationMatrix); // R
        translationMatrixInv.multiplyToRef(rotationMatrix, finalMatrix); // T' x R
        finalMatrix.multiplyToRef(translationMatrix, finalMatrix); // T' x R x T
        finalMatrix.decompose(finalScale, finalRotation, finalTranslation);
        this.position.addInPlace(finalTranslation);
        finalRotation.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);
        return this;
    }
    /**
     * Translates the mesh along the axis vector for the passed distance in the given space.
     * space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.
     * @param axis the axis to translate in
     * @param distance the distance to translate
     * @param space Space to rotate in (Default: local)
     * @returns the TransformNode.
     */
    translate(axis, distance, space) {
        const displacementVector = axis.scale(distance);
        if (!space || space === 0 /* Space.LOCAL */) {
            const tempV3 = this.getPositionExpressedInLocalSpace().add(displacementVector);
            this.setPositionWithLocalVector(tempV3);
        }
        else {
            this.setAbsolutePosition(this.getAbsolutePosition().add(displacementVector));
        }
        return this;
    }
    /**
     * Adds a rotation step to the mesh current rotation.
     * x, y, z are Euler angles expressed in radians.
     * This methods updates the current mesh rotation, either mesh.rotation, either mesh.rotationQuaternion if it's set.
     * This means this rotation is made in the mesh local space only.
     * It's useful to set a custom rotation order different from the BJS standard one YXZ.
     * Example : this rotates the mesh first around its local X axis, then around its local Z axis, finally around its local Y axis.
     * ```javascript
     * mesh.addRotation(x1, 0, 0).addRotation(0, 0, z2).addRotation(0, 0, y3);
     * ```
     * Note that `addRotation()` accumulates the passed rotation values to the current ones and computes the .rotation or .rotationQuaternion updated values.
     * Under the hood, only quaternions are used. So it's a little faster is you use .rotationQuaternion because it doesn't need to translate them back to Euler angles.
     * @param x Rotation to add
     * @param y Rotation to add
     * @param z Rotation to add
     * @returns the TransformNode.
     */
    addRotation(x, y, z) {
        let rotationQuaternion;
        if (this.rotationQuaternion) {
            rotationQuaternion = this.rotationQuaternion;
        }
        else {
            rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[1];
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, rotationQuaternion);
        }
        const accumulation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0];
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationYawPitchRollToRef(y, x, z, accumulation);
        rotationQuaternion.multiplyInPlace(accumulation);
        if (!this.rotationQuaternion) {
            rotationQuaternion.toEulerAnglesToRef(this.rotation);
        }
        return this;
    }
    /**
     * @internal
     */
    _getEffectiveParent() {
        return this.parent;
    }
    /**
     * Returns whether the transform node world matrix computation needs the camera information to be computed.
     * This is the case when the node is a billboard or has an infinite distance for instance.
     * @returns true if the world matrix computation needs the camera information to be computed
     */
    isWorldMatrixCameraDependent() {
        return (this._infiniteDistance && !this.parent) || (this._billboardMode !== TransformNode.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard);
    }
    /**
     * Computes the world matrix of the node
     * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch
     * @param camera defines the camera used if different from the scene active camera (This is used with modes like Billboard or infinite distance)
     * @returns the world matrix
     */
    computeWorldMatrix(force = false, camera = null) {
        if (this._isWorldMatrixFrozen && !this._isDirty) {
            return this._worldMatrix;
        }
        const currentRenderId = this.getScene().getRenderId();
        if (!this._isDirty && !force && (this._currentRenderId === currentRenderId || this.isSynchronized())) {
            this._currentRenderId = currentRenderId;
            return this._worldMatrix;
        }
        camera = camera || this.getScene().activeCamera;
        this._updateCache();
        const cache = this._cache;
        cache.pivotMatrixUpdated = false;
        cache.billboardMode = this.billboardMode;
        cache.infiniteDistance = this.infiniteDistance;
        cache.parent = this._parentNode;
        this._currentRenderId = currentRenderId;
        this._childUpdateId += 1;
        this._isDirty = false;
        this._position._isDirty = false;
        this._rotation._isDirty = false;
        this._scaling._isDirty = false;
        const parent = this._getEffectiveParent();
        // Scaling
        const scaling = TransformNode._TmpScaling;
        let translation = this._position;
        // Translation
        if (this._infiniteDistance) {
            if (!this.parent && camera) {
                const cameraWorldMatrix = camera.getWorldMatrix();
                const cameraGlobalPosition = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq(cameraWorldMatrix.m[12], cameraWorldMatrix.m[13], cameraWorldMatrix.m[14]);
                translation = TransformNode._TmpTranslation;
                translation.copyFromFloats(this._position.x + cameraGlobalPosition.x, this._position.y + cameraGlobalPosition.y, this._position.z + cameraGlobalPosition.z);
            }
        }
        // Scaling
        scaling.copyFromFloats(this._scaling.x * this.scalingDeterminant, this._scaling.y * this.scalingDeterminant, this._scaling.z * this.scalingDeterminant);
        // Rotation
        let rotation;
        if (this._rotationQuaternion) {
            this._rotationQuaternion._isDirty = false;
            rotation = this._rotationQuaternion;
            if (this.reIntegrateRotationIntoRotationQuaternion) {
                const len = this.rotation.lengthSquared();
                if (len) {
                    this._rotationQuaternion.multiplyInPlace(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationYawPitchRoll(this._rotation.y, this._rotation.x, this._rotation.z));
                    this._rotation.copyFromFloats(0, 0, 0);
                }
            }
        }
        else {
            rotation = TransformNode._TmpRotation;
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationYawPitchRollToRef(this._rotation.y, this._rotation.x, this._rotation.z, rotation);
        }
        // Compose
        if (this._usePivotMatrix) {
            const scaleMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1];
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.ScalingToRef(scaling.x, scaling.y, scaling.z, scaleMatrix);
            // Rotation
            const rotationMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0];
            rotation.toRotationMatrix(rotationMatrix);
            // Composing transformations
            this._pivotMatrix.multiplyToRef(scaleMatrix, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[4]);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[4].multiplyToRef(rotationMatrix, this._localMatrix);
            // Post multiply inverse of pivotMatrix
            if (this._postMultiplyPivotMatrix) {
                this._localMatrix.multiplyToRef(this._pivotMatrixInverse, this._localMatrix);
            }
            this._localMatrix.addTranslationFromFloats(translation.x, translation.y, translation.z);
        }
        else {
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.ComposeToRef(scaling, rotation, translation, this._localMatrix);
        }
        // Parent
        if (parent && parent.getWorldMatrix) {
            if (force) {
                parent.computeWorldMatrix(force);
            }
            if (cache.useBillboardPath) {
                if (this._transformToBoneReferal) {
                    const bone = this.parent;
                    bone.getSkeleton().prepare();
                    bone.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[7]);
                }
                else {
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[7].copyFrom(parent.getWorldMatrix());
                }
                // Extract scaling and translation from parent
                const translation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[5];
                const scale = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[6];
                const orientation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0];
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[7].decompose(scale, orientation, translation);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.ScalingToRef(scale.x, scale.y, scale.z, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[7]);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[7].setTranslation(translation);
                if (TransformNode.BillboardUseParentOrientation) {
                    // set localMatrix translation to be transformed against parent's orientation.
                    this._position.applyRotationQuaternionToRef(orientation, translation);
                    this._localMatrix.setTranslation(translation);
                }
                this._localMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[7], this._worldMatrix);
            }
            else {
                if (this._transformToBoneReferal) {
                    const bone = this.parent;
                    bone.getSkeleton().prepare();
                    this._localMatrix.multiplyToRef(bone.getFinalMatrix(), _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[6]);
                    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), this._worldMatrix);
                }
                else {
                    this._localMatrix.multiplyToRef(parent.getWorldMatrix(), this._worldMatrix);
                }
            }
            this._markSyncedWithParent();
        }
        else {
            this._worldMatrix.copyFrom(this._localMatrix);
        }
        // Billboarding based on camera orientation (testing PG:http://www.babylonjs-playground.com/#UJEIL#13)
        if (cache.useBillboardPath && camera && this.billboardMode && !cache.useBillboardPosition) {
            const storedTranslation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0];
            this._worldMatrix.getTranslationToRef(storedTranslation); // Save translation
            // Cancel camera rotation
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1].copyFrom(camera.getViewMatrix());
            if (this._scene.useRightHandedSystem) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1].multiplyToRef(convertRHSToLHS, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1]);
            }
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1].setTranslationFromFloats(0, 0, 0);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1].invertToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0]);
            if ((this.billboardMode & TransformNode.BILLBOARDMODE_ALL) !== TransformNode.BILLBOARDMODE_ALL) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0].decompose(undefined, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0], undefined);
                const eulerAngles = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[1];
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0].toEulerAnglesToRef(eulerAngles);
                if ((this.billboardMode & TransformNode.BILLBOARDMODE_X) !== TransformNode.BILLBOARDMODE_X) {
                    eulerAngles.x = 0;
                }
                if ((this.billboardMode & TransformNode.BILLBOARDMODE_Y) !== TransformNode.BILLBOARDMODE_Y) {
                    eulerAngles.y = 0;
                }
                if ((this.billboardMode & TransformNode.BILLBOARDMODE_Z) !== TransformNode.BILLBOARDMODE_Z) {
                    eulerAngles.z = 0;
                }
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0]);
            }
            this._worldMatrix.setTranslationFromFloats(0, 0, 0);
            this._worldMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0], this._worldMatrix);
            // Restore translation
            this._worldMatrix.setTranslation(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0]);
        }
        // Billboarding based on camera position
        else if (cache.useBillboardPath && camera && cache.useBillboardPosition) {
            const storedTranslation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0];
            // Save translation
            this._worldMatrix.getTranslationToRef(storedTranslation);
            // Compute camera position in local space
            const cameraPosition = camera.globalPosition;
            this._worldMatrix.invertToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1]);
            const camInObjSpace = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[1];
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformCoordinatesToRef(cameraPosition, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[1], camInObjSpace);
            camInObjSpace.normalize();
            // Find the lookAt info in local space
            const yaw = -Math.atan2(camInObjSpace.z, camInObjSpace.x) + Math.PI / 2;
            const len = Math.sqrt(camInObjSpace.x * camInObjSpace.x + camInObjSpace.z * camInObjSpace.z);
            const pitch = -Math.atan2(camInObjSpace.y, len);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.RotationYawPitchRollToRef(yaw, pitch, 0, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0]);
            if ((this.billboardMode & TransformNode.BILLBOARDMODE_ALL) !== TransformNode.BILLBOARDMODE_ALL) {
                const eulerAngles = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[1];
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0].toEulerAnglesToRef(eulerAngles);
                if ((this.billboardMode & TransformNode.BILLBOARDMODE_X) !== TransformNode.BILLBOARDMODE_X) {
                    eulerAngles.x = 0;
                }
                if ((this.billboardMode & TransformNode.BILLBOARDMODE_Y) !== TransformNode.BILLBOARDMODE_Y) {
                    eulerAngles.y = 0;
                }
                if ((this.billboardMode & TransformNode.BILLBOARDMODE_Z) !== TransformNode.BILLBOARDMODE_Z) {
                    eulerAngles.z = 0;
                }
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0]);
            }
            else {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.FromQuaternionToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0], _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0]);
            }
            // Cancel translation
            this._worldMatrix.setTranslationFromFloats(0, 0, 0);
            // Rotate according to lookat (diff from local to lookat)
            this._worldMatrix.multiplyToRef(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0], this._worldMatrix);
            // Restore translation
            this._worldMatrix.setTranslation(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Vector3[0]);
        }
        // Normal matrix
        if (!this.ignoreNonUniformScaling) {
            if (this._scaling.isNonUniformWithinEpsilon(0.000001)) {
                this._updateNonUniformScalingState(true);
            }
            else if (parent && parent._nonUniformScaling) {
                this._updateNonUniformScalingState(parent._nonUniformScaling);
            }
            else {
                this._updateNonUniformScalingState(false);
            }
        }
        else {
            this._updateNonUniformScalingState(false);
        }
        this._afterComputeWorldMatrix();
        // Absolute position
        this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]);
        this._isAbsoluteSynced = false;
        // Callbacks
        this.onAfterWorldMatrixUpdateObservable.notifyObservers(this);
        if (!this._poseMatrix) {
            this._poseMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Invert(this._worldMatrix);
        }
        // Cache the determinant
        this._worldMatrixDeterminantIsDirty = true;
        return this._worldMatrix;
    }
    /**
     * Resets this nodeTransform's local matrix to Matrix.Identity().
     * @param independentOfChildren indicates if all child nodeTransform's world-space transform should be preserved.
     */
    resetLocalMatrix(independentOfChildren = true) {
        this.computeWorldMatrix();
        if (independentOfChildren) {
            const children = this.getChildren();
            for (let i = 0; i < children.length; ++i) {
                const child = children[i];
                if (child) {
                    child.computeWorldMatrix();
                    const bakedMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Matrix[0];
                    child._localMatrix.multiplyToRef(this._localMatrix, bakedMatrix);
                    const tmpRotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .TmpVectors */ .AA.Quaternion[0];
                    bakedMatrix.decompose(child.scaling, tmpRotationQuaternion, child.position);
                    if (child.rotationQuaternion) {
                        child.rotationQuaternion.copyFrom(tmpRotationQuaternion);
                    }
                    else {
                        tmpRotationQuaternion.toEulerAnglesToRef(child.rotation);
                    }
                }
            }
        }
        this.scaling.copyFromFloats(1, 1, 1);
        this.position.copyFromFloats(0, 0, 0);
        this.rotation.copyFromFloats(0, 0, 0);
        //only if quaternion is already set
        if (this.rotationQuaternion) {
            this.rotationQuaternion = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.Identity();
        }
        this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.Identity();
    }
    _afterComputeWorldMatrix() { }
    /**
     * If you'd like to be called back after the mesh position, rotation or scaling has been updated.
     * @param func callback function to add
     *
     * @returns the TransformNode.
     */
    registerAfterWorldMatrixUpdate(func) {
        this.onAfterWorldMatrixUpdateObservable.add(func);
        return this;
    }
    /**
     * Removes a registered callback function.
     * @param func callback function to remove
     * @returns the TransformNode.
     */
    unregisterAfterWorldMatrixUpdate(func) {
        this.onAfterWorldMatrixUpdateObservable.removeCallback(func);
        return this;
    }
    /**
     * Gets the position of the current mesh in camera space
     * @param camera defines the camera to use
     * @returns a position
     */
    getPositionInCameraSpace(camera = null) {
        if (!camera) {
            camera = this.getScene().activeCamera;
        }
        return _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.TransformCoordinates(this.getAbsolutePosition(), camera.getViewMatrix());
    }
    /**
     * Returns the distance from the mesh to the active camera
     * @param camera defines the camera to use
     * @returns the distance
     */
    getDistanceToCamera(camera = null) {
        if (!camera) {
            camera = this.getScene().activeCamera;
        }
        return this.getAbsolutePosition().subtract(camera.globalPosition).length();
    }
    /**
     * Clone the current transform node
     * @param name Name of the new clone
     * @param newParent New parent for the clone
     * @param doNotCloneChildren Do not clone children hierarchy
     * @returns the new transform node
     */
    clone(name, newParent, doNotCloneChildren) {
        const result = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_2__/* .SerializationHelper */ .p.Clone(() => new TransformNode(name, this.getScene()), this);
        result.name = name;
        result.id = name;
        if (newParent) {
            result.parent = newParent;
        }
        if (!doNotCloneChildren) {
            // Children
            const directDescendants = this.getDescendants(true);
            for (let index = 0; index < directDescendants.length; index++) {
                const child = directDescendants[index];
                if (child.clone) {
                    child.clone(name + "." + child.name, result);
                }
            }
        }
        return result;
    }
    /**
     * Serializes the objects information.
     * @param currentSerializationObject defines the object to serialize in
     * @returns the serialized object
     */
    serialize(currentSerializationObject) {
        const serializationObject = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_2__/* .SerializationHelper */ .p.Serialize(this, currentSerializationObject);
        serializationObject.type = this.getClassName();
        serializationObject.uniqueId = this.uniqueId;
        // Parent
        if (this.parent) {
            this.parent._serializeAsParent(serializationObject);
        }
        serializationObject.localMatrix = this.getPivotMatrix().asArray();
        serializationObject.isEnabled = this.isEnabled();
        // Animations
        _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_2__/* .SerializationHelper */ .p.AppendSerializedAnimations(this, serializationObject);
        serializationObject.ranges = this.serializeAnimationRanges();
        return serializationObject;
    }
    // Statics
    /**
     * Returns a new TransformNode object parsed from the source provided.
     * @param parsedTransformNode is the source.
     * @param scene the scene the object belongs to
     * @param rootUrl is a string, it's the root URL to prefix the `delayLoadingFile` property with
     * @returns a new TransformNode object parsed from the source provided.
     */
    static Parse(parsedTransformNode, scene, rootUrl) {
        const transformNode = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_2__/* .SerializationHelper */ .p.Parse(() => new TransformNode(parsedTransformNode.name, scene), parsedTransformNode, scene, rootUrl);
        if (parsedTransformNode.localMatrix) {
            transformNode.setPreTransformMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.FromArray(parsedTransformNode.localMatrix));
        }
        else if (parsedTransformNode.pivotMatrix) {
            transformNode.setPivotMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Matrix */ .uq.FromArray(parsedTransformNode.pivotMatrix));
        }
        transformNode.setEnabled(parsedTransformNode.isEnabled);
        transformNode._waitingParsedUniqueId = parsedTransformNode.uniqueId;
        // Parent
        if (parsedTransformNode.parentId !== undefined) {
            transformNode._waitingParentId = parsedTransformNode.parentId;
        }
        if (parsedTransformNode.parentInstanceIndex !== undefined) {
            transformNode._waitingParentInstanceIndex = parsedTransformNode.parentInstanceIndex;
        }
        // Animations
        if (parsedTransformNode.animations) {
            for (let animationIndex = 0; animationIndex < parsedTransformNode.animations.length; animationIndex++) {
                const parsedAnimation = parsedTransformNode.animations[animationIndex];
                const internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .GetClass */ .n9)("BABYLON.Animation");
                if (internalClass) {
                    transformNode.animations.push(internalClass.Parse(parsedAnimation));
                }
            }
            _node_js__WEBPACK_IMPORTED_MODULE_5__/* .Node */ .b.ParseAnimationRanges(transformNode, parsedTransformNode, scene);
        }
        if (parsedTransformNode.autoAnimate) {
            scene.beginAnimation(transformNode, parsedTransformNode.autoAnimateFrom, parsedTransformNode.autoAnimateTo, parsedTransformNode.autoAnimateLoop, parsedTransformNode.autoAnimateSpeed || 1.0);
        }
        return transformNode;
    }
    /**
     * Get all child-transformNodes of this node
     * @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
     * @returns an array of TransformNode
     */
    getChildTransformNodes(directDescendantsOnly, predicate) {
        const results = [];
        this._getDescendants(results, directDescendantsOnly, (node) => {
            return (!predicate || predicate(node)) && node instanceof TransformNode;
        });
        return results;
    }
    /**
     * Releases resources associated with this transform node.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        // Animations
        this.getScene().stopAnimation(this);
        // Remove from scene
        this.getScene().removeTransformNode(this);
        if (this._parentContainer) {
            const index = this._parentContainer.transformNodes.indexOf(this);
            if (index > -1) {
                this._parentContainer.transformNodes.splice(index, 1);
            }
            this._parentContainer = null;
        }
        this.onAfterWorldMatrixUpdateObservable.clear();
        if (doNotRecurse) {
            const transformNodes = this.getChildTransformNodes(true);
            for (const transformNode of transformNodes) {
                transformNode.parent = null;
                transformNode.computeWorldMatrix(true);
            }
        }
        super.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
    /**
     * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
     * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
     * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
     * @param predicate predicate that is passed in to getHierarchyBoundingVectors when selecting which object should be included when scaling
     * @returns the current mesh
     */
    normalizeToUnitCube(includeDescendants = true, ignoreRotation = false, predicate) {
        let storedRotation = null;
        let storedRotationQuaternion = null;
        if (ignoreRotation) {
            if (this.rotationQuaternion) {
                storedRotationQuaternion = this.rotationQuaternion.clone();
                this.rotationQuaternion.copyFromFloats(0, 0, 0, 1);
            }
            else if (this.rotation) {
                storedRotation = this.rotation.clone();
                this.rotation.copyFromFloats(0, 0, 0);
            }
        }
        const boundingVectors = this.getHierarchyBoundingVectors(includeDescendants, predicate);
        const sizeVec = boundingVectors.max.subtract(boundingVectors.min);
        const maxDimension = Math.max(sizeVec.x, sizeVec.y, sizeVec.z);
        if (maxDimension === 0) {
            return this;
        }
        const scale = 1 / maxDimension;
        this.scaling.scaleInPlace(scale);
        if (ignoreRotation) {
            if (this.rotationQuaternion && storedRotationQuaternion) {
                this.rotationQuaternion.copyFrom(storedRotationQuaternion);
            }
            else if (this.rotation && storedRotation) {
                this.rotation.copyFrom(storedRotation);
            }
        }
        return this;
    }
    _syncAbsoluteScalingAndRotation() {
        if (!this._isAbsoluteSynced) {
            this._worldMatrix.decompose(this._absoluteScaling, this._absoluteRotationQuaternion);
            this._isAbsoluteSynced = true;
        }
    }
}
// Statics
/**
 * Object will not rotate to face the camera
 */
TransformNode.BILLBOARDMODE_NONE = 0;
/**
 * Object will rotate to face the camera but only on the x axis
 */
TransformNode.BILLBOARDMODE_X = 1;
/**
 * Object will rotate to face the camera but only on the y axis
 */
TransformNode.BILLBOARDMODE_Y = 2;
/**
 * Object will rotate to face the camera but only on the z axis
 */
TransformNode.BILLBOARDMODE_Z = 4;
/**
 * Object will rotate to face the camera
 */
TransformNode.BILLBOARDMODE_ALL = 7;
/**
 * Object will rotate to face the camera's position instead of orientation
 */
TransformNode.BILLBOARDMODE_USE_POSITION = 128;
/**
 * Child transform with Billboard flags should or should not apply parent rotation (default if off)
 */
TransformNode.BillboardUseParentOrientation = false;
TransformNode._TmpRotation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT.Zero();
TransformNode._TmpScaling = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
TransformNode._TmpTranslation = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq.Zero();
TransformNode._LookAtVectorCache = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Vector3 */ .Pq(0, 0, 0);
TransformNode._RotationAxisCache = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_4__/* .Quaternion */ .PT();
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)("position")
], TransformNode.prototype, "_position", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)("rotation")
], TransformNode.prototype, "_rotation", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsQuaternion */ .bR)("rotationQuaternion")
], TransformNode.prototype, "_rotationQuaternion", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serializeAsVector3 */ .P_)("scaling")
], TransformNode.prototype, "_scaling", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("billboardMode")
], TransformNode.prototype, "_billboardMode", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], TransformNode.prototype, "scalingDeterminant", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)("infiniteDistance")
], TransformNode.prototype, "_infiniteDistance", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], TransformNode.prototype, "ignoreNonUniformScaling", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_1__/* .serialize */ .lK)()
], TransformNode.prototype, "reIntegrateRotationIntoRotationQuaternion", void 0);
//# sourceMappingURL=transformNode.js.map

/***/ }),

/***/ 36755:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   d: () => (/* binding */ CubeMapToSphericalPolynomialTools)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84867);
/* harmony import */ var _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(77517);
/* harmony import */ var _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65559);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26041);






class FileFaceOrientation {
    constructor(name, worldAxisForNormal, worldAxisForFileX, worldAxisForFileY) {
        this.name = name;
        this.worldAxisForNormal = worldAxisForNormal;
        this.worldAxisForFileX = worldAxisForFileX;
        this.worldAxisForFileY = worldAxisForFileY;
    }
}
/**
 * Helper class dealing with the extraction of spherical polynomial dataArray
 * from a cube map.
 */
class CubeMapToSphericalPolynomialTools {
    /**
     * Converts a texture to the according Spherical Polynomial data.
     * This extracts the first 3 orders only as they are the only one used in the lighting.
     *
     * @param texture The texture to extract the information from.
     * @returns The Spherical Polynomial data.
     */
    static ConvertCubeMapTextureToSphericalPolynomial(texture) {
        if (!texture.isCube) {
            // Only supports cube Textures currently.
            return null;
        }
        texture.getScene()?.getEngine().flushFramebuffer();
        const size = texture.getSize().width;
        const rightPromise = texture.readPixels(0, undefined, undefined, false);
        const leftPromise = texture.readPixels(1, undefined, undefined, false);
        let upPromise;
        let downPromise;
        if (texture.isRenderTarget) {
            upPromise = texture.readPixels(3, undefined, undefined, false);
            downPromise = texture.readPixels(2, undefined, undefined, false);
        }
        else {
            upPromise = texture.readPixels(2, undefined, undefined, false);
            downPromise = texture.readPixels(3, undefined, undefined, false);
        }
        const frontPromise = texture.readPixels(4, undefined, undefined, false);
        const backPromise = texture.readPixels(5, undefined, undefined, false);
        const gammaSpace = texture.gammaSpace;
        // Always read as RGBA.
        const format = 5;
        let type = 0;
        if (texture.textureType == 1 || texture.textureType == 2) {
            type = 1;
        }
        return new Promise((resolve) => {
            Promise.all([leftPromise, rightPromise, upPromise, downPromise, frontPromise, backPromise]).then(([left, right, up, down, front, back]) => {
                const cubeInfo = {
                    size,
                    right,
                    left,
                    up,
                    down,
                    front,
                    back,
                    format,
                    type,
                    gammaSpace,
                };
                resolve(this.ConvertCubeMapToSphericalPolynomial(cubeInfo));
            });
        });
    }
    /**
     * Compute the area on the unit sphere of the rectangle defined by (x,y) and the origin
     * See https://www.rorydriscoll.com/2012/01/15/cubemap-texel-solid-angle/
     * @param x
     * @param y
     * @returns the area
     */
    static _AreaElement(x, y) {
        return Math.atan2(x * y, Math.sqrt(x * x + y * y + 1));
    }
    /**
     * Converts a cubemap to the according Spherical Polynomial data.
     * This extracts the first 3 orders only as they are the only one used in the lighting.
     *
     * @param cubeInfo The Cube map to extract the information from.
     * @returns The Spherical Polynomial data.
     */
    static ConvertCubeMapToSphericalPolynomial(cubeInfo) {
        const sphericalHarmonics = new _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_2__/* .SphericalHarmonics */ .O();
        let totalSolidAngle = 0.0;
        // The (u,v) range is [-1,+1], so the distance between each texel is 2/Size.
        const du = 2.0 / cubeInfo.size;
        const dv = du;
        const halfTexel = 0.5 * du;
        // The (u,v) of the first texel is half a texel from the corner (-1,-1).
        const minUV = halfTexel - 1.0;
        for (let faceIndex = 0; faceIndex < 6; faceIndex++) {
            const fileFace = this._FileFaces[faceIndex];
            const dataArray = cubeInfo[fileFace.name];
            let v = minUV;
            // TODO: we could perform the summation directly into a SphericalPolynomial (SP), which is more efficient than SphericalHarmonic (SH).
            // This is possible because during the summation we do not need the SH-specific properties, e.g. orthogonality.
            // Because SP is still linear, so summation is fine in that basis.
            const stride = cubeInfo.format === 5 ? 4 : 3;
            for (let y = 0; y < cubeInfo.size; y++) {
                let u = minUV;
                for (let x = 0; x < cubeInfo.size; x++) {
                    // World direction (not normalised)
                    const worldDirection = fileFace.worldAxisForFileX.scale(u).add(fileFace.worldAxisForFileY.scale(v)).add(fileFace.worldAxisForNormal);
                    worldDirection.normalize();
                    const deltaSolidAngle = this._AreaElement(u - halfTexel, v - halfTexel) -
                        this._AreaElement(u - halfTexel, v + halfTexel) -
                        this._AreaElement(u + halfTexel, v - halfTexel) +
                        this._AreaElement(u + halfTexel, v + halfTexel);
                    let r = dataArray[y * cubeInfo.size * stride + x * stride + 0];
                    let g = dataArray[y * cubeInfo.size * stride + x * stride + 1];
                    let b = dataArray[y * cubeInfo.size * stride + x * stride + 2];
                    // Prevent NaN harmonics with extreme HDRI data.
                    if (isNaN(r)) {
                        r = 0;
                    }
                    if (isNaN(g)) {
                        g = 0;
                    }
                    if (isNaN(b)) {
                        b = 0;
                    }
                    // Handle Integer types.
                    if (cubeInfo.type === 0) {
                        r /= 255;
                        g /= 255;
                        b /= 255;
                    }
                    // Handle Gamma space textures.
                    if (cubeInfo.gammaSpace) {
                        r = Math.pow((0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__.Clamp)(r), _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_3__/* .ToLinearSpace */ .tk);
                        g = Math.pow((0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__.Clamp)(g), _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_3__/* .ToLinearSpace */ .tk);
                        b = Math.pow((0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__.Clamp)(b), _Maths_math_constants_js__WEBPACK_IMPORTED_MODULE_3__/* .ToLinearSpace */ .tk);
                    }
                    // Prevent to explode in case of really high dynamic ranges.
                    // sh 3 would not be enough to accurately represent it.
                    const max = this.MAX_HDRI_VALUE;
                    if (this.PRESERVE_CLAMPED_COLORS) {
                        const currentMax = Math.max(r, g, b);
                        if (currentMax > max) {
                            const factor = max / currentMax;
                            r *= factor;
                            g *= factor;
                            b *= factor;
                        }
                    }
                    else {
                        r = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__.Clamp)(r, 0, max);
                        g = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__.Clamp)(g, 0, max);
                        b = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_1__.Clamp)(b, 0, max);
                    }
                    const color = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_4__/* .Color3 */ .v9(r, g, b);
                    sphericalHarmonics.addLight(worldDirection, color, deltaSolidAngle);
                    totalSolidAngle += deltaSolidAngle;
                    u += du;
                }
                v += dv;
            }
        }
        // Solid angle for entire sphere is 4*pi
        const sphereSolidAngle = 4.0 * Math.PI;
        // Adjust the solid angle to allow for how many faces we processed.
        const facesProcessed = 6.0;
        const expectedSolidAngle = (sphereSolidAngle * facesProcessed) / 6.0;
        // Adjust the harmonics so that the accumulated solid angle matches the expected solid angle.
        // This is needed because the numerical integration over the cube uses a
        // small angle approximation of solid angle for each texel (see deltaSolidAngle),
        // and also to compensate for accumulative error due to float precision in the summation.
        const correctionFactor = expectedSolidAngle / totalSolidAngle;
        sphericalHarmonics.scaleInPlace(correctionFactor);
        sphericalHarmonics.convertIncidentRadianceToIrradiance();
        sphericalHarmonics.convertIrradianceToLambertianRadiance();
        return _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_2__/* .SphericalPolynomial */ .Q.FromHarmonics(sphericalHarmonics);
    }
}
CubeMapToSphericalPolynomialTools._FileFaces = [
    new FileFaceOrientation("right", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, -1), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, -1, 0)), // +X east
    new FileFaceOrientation("left", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, 1), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, -1, 0)), // -X west
    new FileFaceOrientation("up", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 1, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, 1)), // +Y north
    new FileFaceOrientation("down", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, -1, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, -1)), // -Y south
    new FileFaceOrientation("front", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, 1), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, -1, 0)), // +Z top
    new FileFaceOrientation("back", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, 0, -1), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1, 0, 0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(0, -1, 0)), // -Z bottom
];
/** @internal */
CubeMapToSphericalPolynomialTools.MAX_HDRI_VALUE = 4096;
/** @internal */
CubeMapToSphericalPolynomialTools.PRESERVE_CLAMPED_COLORS = false;
//# sourceMappingURL=cubemapToSphericalPolynomial.js.map

/***/ }),

/***/ 82814:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   I9: () => (/* binding */ HDRTools),
/* harmony export */   LT: () => (/* binding */ RGBE_ReadPixels),
/* harmony export */   NK: () => (/* binding */ RGBE_ReadHeader),
/* harmony export */   VH: () => (/* binding */ GetCubeMapTextureData)
/* harmony export */ });
/* harmony import */ var _panoramaToCubemap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73647);

/* This groups tools to convert HDR texture to native colors array. */
function ldexp(mantissa, exponent) {
    if (exponent > 1023) {
        return mantissa * Math.pow(2, 1023) * Math.pow(2, exponent - 1023);
    }
    if (exponent < -1074) {
        return mantissa * Math.pow(2, -1074) * Math.pow(2, exponent + 1074);
    }
    return mantissa * Math.pow(2, exponent);
}
function rgbe2float(float32array, red, green, blue, exponent, index) {
    if (exponent > 0) {
        /*nonzero pixel*/
        exponent = ldexp(1.0, exponent - (128 + 8));
        float32array[index + 0] = red * exponent;
        float32array[index + 1] = green * exponent;
        float32array[index + 2] = blue * exponent;
    }
    else {
        float32array[index + 0] = 0;
        float32array[index + 1] = 0;
        float32array[index + 2] = 0;
    }
}
function readStringLine(uint8array, startIndex) {
    let line = "";
    let character = "";
    for (let i = startIndex; i < uint8array.length - startIndex; i++) {
        character = String.fromCharCode(uint8array[i]);
        if (character == "\n") {
            break;
        }
        line += character;
    }
    return line;
}
/**
 * Reads header information from an RGBE texture stored in a native array.
 * More information on this format are available here:
 * https://en.wikipedia.org/wiki/RGBE_image_format
 *
 * @param uint8array The binary file stored in  native array.
 * @returns The header information.
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function RGBE_ReadHeader(uint8array) {
    let height = 0;
    let width = 0;
    let line = readStringLine(uint8array, 0);
    if (line[0] != "#" || line[1] != "?") {
        // eslint-disable-next-line no-throw-literal
        throw "Bad HDR Format.";
    }
    let endOfHeader = false;
    let findFormat = false;
    let lineIndex = 0;
    do {
        lineIndex += line.length + 1;
        line = readStringLine(uint8array, lineIndex);
        if (line == "FORMAT=32-bit_rle_rgbe") {
            findFormat = true;
        }
        else if (line.length == 0) {
            endOfHeader = true;
        }
    } while (!endOfHeader);
    if (!findFormat) {
        // eslint-disable-next-line no-throw-literal
        throw "HDR Bad header format, unsupported FORMAT";
    }
    lineIndex += line.length + 1;
    line = readStringLine(uint8array, lineIndex);
    const sizeRegexp = /^-Y (.*) \+X (.*)$/g;
    const match = sizeRegexp.exec(line);
    // TODO. Support +Y and -X if needed.
    if (!match || match.length < 3) {
        // eslint-disable-next-line no-throw-literal
        throw "HDR Bad header format, no size";
    }
    width = parseInt(match[2]);
    height = parseInt(match[1]);
    if (width < 8 || width > 0x7fff) {
        // eslint-disable-next-line no-throw-literal
        throw "HDR Bad header format, unsupported size";
    }
    lineIndex += line.length + 1;
    return {
        height: height,
        width: width,
        dataPosition: lineIndex,
    };
}
/**
 * Returns the cubemap information (each faces texture data) extracted from an RGBE texture.
 * This RGBE texture needs to store the information as a panorama.
 *
 * More information on this format are available here:
 * https://en.wikipedia.org/wiki/RGBE_image_format
 *
 * @param buffer The binary file stored in an array buffer.
 * @param size The expected size of the extracted cubemap.
 * @param supersample enable supersampling the cubemap (default: false)
 * @returns The Cube Map information.
 */
function GetCubeMapTextureData(buffer, size, supersample = false) {
    const uint8array = new Uint8Array(buffer);
    const hdrInfo = RGBE_ReadHeader(uint8array);
    const data = RGBE_ReadPixels(uint8array, hdrInfo);
    const cubeMapData = _panoramaToCubemap_js__WEBPACK_IMPORTED_MODULE_0__/* .PanoramaToCubeMapTools */ .D.ConvertPanoramaToCubemap(data, hdrInfo.width, hdrInfo.height, size, supersample);
    return cubeMapData;
}
/**
 * Returns the pixels data extracted from an RGBE texture.
 * This pixels will be stored left to right up to down in the R G B order in one array.
 *
 * More information on this format are available here:
 * https://en.wikipedia.org/wiki/RGBE_image_format
 *
 * @param uint8array The binary file stored in an array buffer.
 * @param hdrInfo The header information of the file.
 * @returns The pixels data in RGB right to left up to down order.
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function RGBE_ReadPixels(uint8array, hdrInfo) {
    return readRGBEPixelsRLE(uint8array, hdrInfo);
}
function readRGBEPixelsRLE(uint8array, hdrInfo) {
    let num_scanlines = hdrInfo.height;
    const scanline_width = hdrInfo.width;
    let a, b, c, d, count;
    let dataIndex = hdrInfo.dataPosition;
    let index = 0, endIndex = 0, i = 0;
    const scanLineArrayBuffer = new ArrayBuffer(scanline_width * 4); // four channel R G B E
    const scanLineArray = new Uint8Array(scanLineArrayBuffer);
    // 3 channels of 4 bytes per pixel in float.
    const resultBuffer = new ArrayBuffer(hdrInfo.width * hdrInfo.height * 4 * 3);
    const resultArray = new Float32Array(resultBuffer);
    // read in each successive scanline
    while (num_scanlines > 0) {
        a = uint8array[dataIndex++];
        b = uint8array[dataIndex++];
        c = uint8array[dataIndex++];
        d = uint8array[dataIndex++];
        if (a != 2 || b != 2 || c & 0x80 || hdrInfo.width < 8 || hdrInfo.width > 32767) {
            return readRGBEPixelsNotRLE(uint8array, hdrInfo);
        }
        if (((c << 8) | d) != scanline_width) {
            // eslint-disable-next-line no-throw-literal
            throw "HDR Bad header format, wrong scan line width";
        }
        index = 0;
        // read each of the four channels for the scanline into the buffer
        for (i = 0; i < 4; i++) {
            endIndex = (i + 1) * scanline_width;
            while (index < endIndex) {
                a = uint8array[dataIndex++];
                b = uint8array[dataIndex++];
                if (a > 128) {
                    // a run of the same value
                    count = a - 128;
                    if (count == 0 || count > endIndex - index) {
                        // eslint-disable-next-line no-throw-literal
                        throw "HDR Bad Format, bad scanline data (run)";
                    }
                    while (count-- > 0) {
                        scanLineArray[index++] = b;
                    }
                }
                else {
                    // a non-run
                    count = a;
                    if (count == 0 || count > endIndex - index) {
                        // eslint-disable-next-line no-throw-literal
                        throw "HDR Bad Format, bad scanline data (non-run)";
                    }
                    scanLineArray[index++] = b;
                    if (--count > 0) {
                        for (let j = 0; j < count; j++) {
                            scanLineArray[index++] = uint8array[dataIndex++];
                        }
                    }
                }
            }
        }
        // now convert data from buffer into floats
        for (i = 0; i < scanline_width; i++) {
            a = scanLineArray[i];
            b = scanLineArray[i + scanline_width];
            c = scanLineArray[i + 2 * scanline_width];
            d = scanLineArray[i + 3 * scanline_width];
            rgbe2float(resultArray, a, b, c, d, (hdrInfo.height - num_scanlines) * scanline_width * 3 + i * 3);
        }
        num_scanlines--;
    }
    return resultArray;
}
function readRGBEPixelsNotRLE(uint8array, hdrInfo) {
    // this file is not run length encoded
    // read values sequentially
    let num_scanlines = hdrInfo.height;
    const scanline_width = hdrInfo.width;
    let a, b, c, d, i;
    let dataIndex = hdrInfo.dataPosition;
    // 3 channels of 4 bytes per pixel in float.
    const resultBuffer = new ArrayBuffer(hdrInfo.width * hdrInfo.height * 4 * 3);
    const resultArray = new Float32Array(resultBuffer);
    // read in each successive scanline
    while (num_scanlines > 0) {
        for (i = 0; i < hdrInfo.width; i++) {
            a = uint8array[dataIndex++];
            b = uint8array[dataIndex++];
            c = uint8array[dataIndex++];
            d = uint8array[dataIndex++];
            rgbe2float(resultArray, a, b, c, d, (hdrInfo.height - num_scanlines) * scanline_width * 3 + i * 3);
        }
        num_scanlines--;
    }
    return resultArray;
}
/**
 * @deprecated Use functions separately
 */
const HDRTools = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    RGBE_ReadHeader,
    // eslint-disable-next-line @typescript-eslint/naming-convention
    GetCubeMapTextureData,
    // eslint-disable-next-line @typescript-eslint/naming-convention
    RGBE_ReadPixels,
};
//# sourceMappingURL=hdr.js.map

/***/ }),

/***/ 73647:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   D: () => (/* binding */ PanoramaToCubeMapTools)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);


/**
 * Helper class useful to convert panorama picture to their cubemap representation in 6 faces.
 */
class PanoramaToCubeMapTools {
    /**
     * Converts a panorama stored in RGB right to left up to down format into a cubemap (6 faces).
     *
     * @param float32Array The source data.
     * @param inputWidth The width of the input panorama.
     * @param inputHeight The height of the input panorama.
     * @param size The willing size of the generated cubemap (each faces will be size * size pixels)
     * @param supersample enable supersampling the cubemap
     * @returns The cubemap data
     */
    static ConvertPanoramaToCubemap(float32Array, inputWidth, inputHeight, size, supersample = false) {
        if (!float32Array) {
            // eslint-disable-next-line no-throw-literal
            throw "ConvertPanoramaToCubemap: input cannot be null";
        }
        if (float32Array.length != inputWidth * inputHeight * 3) {
            // eslint-disable-next-line no-throw-literal
            throw "ConvertPanoramaToCubemap: input size is wrong";
        }
        const textureFront = this.CreateCubemapTexture(size, this.FACE_FRONT, float32Array, inputWidth, inputHeight, supersample);
        const textureBack = this.CreateCubemapTexture(size, this.FACE_BACK, float32Array, inputWidth, inputHeight, supersample);
        const textureLeft = this.CreateCubemapTexture(size, this.FACE_LEFT, float32Array, inputWidth, inputHeight, supersample);
        const textureRight = this.CreateCubemapTexture(size, this.FACE_RIGHT, float32Array, inputWidth, inputHeight, supersample);
        const textureUp = this.CreateCubemapTexture(size, this.FACE_UP, float32Array, inputWidth, inputHeight, supersample);
        const textureDown = this.CreateCubemapTexture(size, this.FACE_DOWN, float32Array, inputWidth, inputHeight, supersample);
        return {
            front: textureFront,
            back: textureBack,
            left: textureLeft,
            right: textureRight,
            up: textureUp,
            down: textureDown,
            size: size,
            type: 1,
            format: 4,
            gammaSpace: false,
        };
    }
    static CreateCubemapTexture(texSize, faceData, float32Array, inputWidth, inputHeight, supersample = false) {
        const buffer = new ArrayBuffer(texSize * texSize * 4 * 3);
        const textureArray = new Float32Array(buffer);
        // If supersampling, determine number of samples needed when source texture width is divided for 4 cube faces
        const samples = supersample ? Math.max(1, Math.round(inputWidth / 4 / texSize)) : 1;
        const sampleFactor = 1 / samples;
        const sampleFactorSqr = sampleFactor * sampleFactor;
        const rotDX1 = faceData[1].subtract(faceData[0]).scale(sampleFactor / texSize);
        const rotDX2 = faceData[3].subtract(faceData[2]).scale(sampleFactor / texSize);
        const dy = 1 / texSize;
        let fy = 0;
        for (let y = 0; y < texSize; y++) {
            for (let sy = 0; sy < samples; sy++) {
                let xv1 = faceData[0];
                let xv2 = faceData[2];
                for (let x = 0; x < texSize; x++) {
                    for (let sx = 0; sx < samples; sx++) {
                        const v = xv2.subtract(xv1).scale(fy).add(xv1);
                        v.normalize();
                        const color = this.CalcProjectionSpherical(v, float32Array, inputWidth, inputHeight);
                        // 3 channels per pixels
                        textureArray[y * texSize * 3 + x * 3 + 0] += color.r * sampleFactorSqr;
                        textureArray[y * texSize * 3 + x * 3 + 1] += color.g * sampleFactorSqr;
                        textureArray[y * texSize * 3 + x * 3 + 2] += color.b * sampleFactorSqr;
                        xv1 = xv1.add(rotDX1);
                        xv2 = xv2.add(rotDX2);
                    }
                }
                fy += dy * sampleFactor;
            }
        }
        return textureArray;
    }
    static CalcProjectionSpherical(vDir, float32Array, inputWidth, inputHeight) {
        let theta = Math.atan2(vDir.z, vDir.x);
        const phi = Math.acos(vDir.y);
        while (theta < -Math.PI) {
            theta += 2 * Math.PI;
        }
        while (theta > Math.PI) {
            theta -= 2 * Math.PI;
        }
        let dx = theta / Math.PI;
        const dy = phi / Math.PI;
        // recenter.
        dx = dx * 0.5 + 0.5;
        let px = Math.round(dx * inputWidth);
        if (px < 0) {
            px = 0;
        }
        else if (px >= inputWidth) {
            px = inputWidth - 1;
        }
        let py = Math.round(dy * inputHeight);
        if (py < 0) {
            py = 0;
        }
        else if (py >= inputHeight) {
            py = inputHeight - 1;
        }
        const inputY = inputHeight - py - 1;
        const r = float32Array[inputY * inputWidth * 3 + px * 3 + 0];
        const g = float32Array[inputY * inputWidth * 3 + px * 3 + 1];
        const b = float32Array[inputY * inputWidth * 3 + px * 3 + 2];
        return {
            r: r,
            g: g,
            b: b,
        };
    }
}
PanoramaToCubeMapTools.FACE_LEFT = [new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, -1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, -1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, 1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, 1.0, -1.0)];
PanoramaToCubeMapTools.FACE_RIGHT = [new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, -1.0, 1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, -1.0, 1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, 1.0, 1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, 1.0, 1.0)];
PanoramaToCubeMapTools.FACE_FRONT = [new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, -1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, -1.0, 1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, 1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, 1.0, 1.0)];
PanoramaToCubeMapTools.FACE_BACK = [new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, -1.0, 1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, -1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, 1.0, 1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, 1.0, -1.0)];
PanoramaToCubeMapTools.FACE_DOWN = [new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, 1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, 1.0, 1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, 1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, 1.0, 1.0)];
PanoramaToCubeMapTools.FACE_UP = [new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, -1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(-1.0, -1.0, 1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, -1.0, -1.0), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq(1.0, -1.0, 1.0)];
//# sourceMappingURL=panoramaToCubemap.js.map

/***/ }),

/***/ 33619:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (/* binding */ AndOrNotEvaluator)
/* harmony export */ });
/**
 * Class used to evaluate queries containing `and` and `or` operators
 */
class AndOrNotEvaluator {
    /**
     * Evaluate a query
     * @param query defines the query to evaluate
     * @param evaluateCallback defines the callback used to filter result
     * @returns true if the query matches
     */
    static Eval(query, evaluateCallback) {
        if (!query.match(/\([^()]*\)/g)) {
            query = AndOrNotEvaluator._HandleParenthesisContent(query, evaluateCallback);
        }
        else {
            query = query.replace(/\([^()]*\)/g, (r) => {
                // remove parenthesis
                r = r.slice(1, r.length - 1);
                return AndOrNotEvaluator._HandleParenthesisContent(r, evaluateCallback);
            });
        }
        if (query === "true") {
            return true;
        }
        if (query === "false") {
            return false;
        }
        return AndOrNotEvaluator.Eval(query, evaluateCallback);
    }
    static _HandleParenthesisContent(parenthesisContent, evaluateCallback) {
        evaluateCallback =
            evaluateCallback ||
                ((r) => {
                    return r === "true" ? true : false;
                });
        let result;
        const or = parenthesisContent.split("||");
        for (const i in or) {
            if (Object.prototype.hasOwnProperty.call(or, i)) {
                let ori = AndOrNotEvaluator._SimplifyNegation(or[i].trim());
                const and = ori.split("&&");
                if (and.length > 1) {
                    for (let j = 0; j < and.length; ++j) {
                        const andj = AndOrNotEvaluator._SimplifyNegation(and[j].trim());
                        if (andj !== "true" && andj !== "false") {
                            if (andj[0] === "!") {
                                result = !evaluateCallback(andj.substring(1));
                            }
                            else {
                                result = evaluateCallback(andj);
                            }
                        }
                        else {
                            result = andj === "true" ? true : false;
                        }
                        if (!result) {
                            // no need to continue since 'false && ... && ...' will always return false
                            ori = "false";
                            break;
                        }
                    }
                }
                if (result || ori === "true") {
                    // no need to continue since 'true || ... || ...' will always return true
                    result = true;
                    break;
                }
                // result equals false (or undefined)
                if (ori !== "true" && ori !== "false") {
                    if (ori[0] === "!") {
                        result = !evaluateCallback(ori.substring(1));
                    }
                    else {
                        result = evaluateCallback(ori);
                    }
                }
                else {
                    result = ori === "true" ? true : false;
                }
            }
        }
        // the whole parenthesis scope is replaced by 'true' or 'false'
        return result ? "true" : "false";
    }
    static _SimplifyNegation(booleanString) {
        booleanString = booleanString.replace(/^[\s!]+/, (r) => {
            // remove whitespaces
            r = r.replace(/[\s]/g, () => "");
            return r.length % 2 ? "!" : "";
        });
        booleanString = booleanString.trim();
        if (booleanString === "!true") {
            booleanString = "false";
        }
        else if (booleanString === "!false") {
            booleanString = "true";
        }
        return booleanString;
    }
}
//# sourceMappingURL=andOrNotEvaluator.js.map

/***/ }),

/***/ 27309:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lL: () => (/* binding */ _ObserveArray),
/* harmony export */   ln: () => (/* binding */ BuildTuple),
/* harmony export */   mI: () => (/* binding */ BuildArray)
/* harmony export */ });
/* eslint-disable @typescript-eslint/naming-convention */
/**
 * Returns an array of the given size filled with elements built from the given constructor and the parameters.
 * @param size the number of element to construct and put in the array.
 * @param itemBuilder a callback responsible for creating new instance of item. Called once per array entry.
 * @returns a new array filled with new objects.
 */
function BuildArray(size, itemBuilder) {
    const a = [];
    for (let i = 0; i < size; ++i) {
        a.push(itemBuilder());
    }
    return a;
}
/**
 * Returns a tuple of the given size filled with elements built from the given constructor and the parameters.
 * @param size he number of element to construct and put in the tuple.
 * @param itemBuilder a callback responsible for creating new instance of item. Called once per tuple entry.
 * @returns a new tuple filled with new objects.
 */
function BuildTuple(size, itemBuilder) {
    return BuildArray(size, itemBuilder);
}
/**
 * Observes a function and calls the given callback when it is called.
 * @param object Defines the object the function to observe belongs to.
 * @param functionName Defines the name of the function to observe.
 * @param callback Defines the callback to call when the function is called.
 * @returns A function to call to stop observing
 */
function _observeArrayfunction(object, functionName, callback) {
    // Finds the function to observe
    const oldFunction = object[functionName];
    if (typeof oldFunction !== "function") {
        return null;
    }
    // Creates a new function that calls the callback and the old function
    const newFunction = function () {
        const previousLength = object.length;
        const returnValue = newFunction.previous.apply(object, arguments);
        callback(functionName, previousLength);
        return returnValue;
    };
    // Doublishly links the new function and the old function
    oldFunction.next = newFunction;
    newFunction.previous = oldFunction;
    // Replaces the old function with the new function
    object[functionName] = newFunction;
    // Returns a function to disable the hook
    return () => {
        // Only unhook if the function is still hooked
        const previous = newFunction.previous;
        if (!previous) {
            return;
        }
        // Finds the ref to the next function in the chain
        const next = newFunction.next;
        // If in the middle of the chain, link the previous and next functions
        if (next) {
            previous.next = next;
            next.previous = previous;
        }
        // If at the end of the chain, remove the reference to the previous function
        // and restore the previous function
        else {
            previous.next = undefined;
            object[functionName] = previous;
        }
        // Lose reference to the previous and next functions
        newFunction.next = undefined;
        newFunction.previous = undefined;
    };
}
/**
 * Defines the list of functions to proxy when observing an array.
 * The scope is currently reduced to the common functions used in the render target render list and the scene cameras.
 */
const observedArrayFunctions = ["push", "splice", "pop", "shift", "unshift"];
/**
 * Observes an array and notifies the given observer when the array is modified.
 * @param array Defines the array to observe
 * @param callback Defines the function to call when the array is modified (in the limit of the observed array functions)
 * @returns A function to call to stop observing the array
 * @internal
 */
function _ObserveArray(array, callback) {
    // Observes all the required array functions and stores the unhook functions
    const unObserveFunctions = observedArrayFunctions.map((name) => {
        return _observeArrayfunction(array, name, callback);
    });
    // Returns a function that unhook all the observed functions
    return () => {
        unObserveFunctions.forEach((unObserveFunction) => {
            unObserveFunction?.();
        });
    };
}
//# sourceMappingURL=arrayTools.js.map

/***/ }),

/***/ 59057:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  $e: () => (/* binding */ BasisFileInfo),
  ED: () => (/* binding */ BasisTools),
  Sl: () => (/* binding */ BasisToolsOptions),
  SV: () => (/* binding */ BasisTranscodeConfiguration),
  yT: () => (/* binding */ GetInternalFormatFromBasisFormat),
  aB: () => (/* binding */ LoadTextureFromTranscodeResult),
  af: () => (/* binding */ SetBasisTranscoderWorker),
  yk: () => (/* binding */ TranscodeAsync)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__(998);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/texture.js
var Textures_texture = __webpack_require__(7481);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js
var internalTexture = __webpack_require__(81194);
;// ./node_modules/@babylonjs/core/Misc/basisWorker.js

/**
 * The worker function that gets converted to a blob url to pass into a worker.
 * To be used if a developer wants to create their own worker instance and inject it instead of using the default worker.
 */
function workerFunction() {
    const _BASIS_FORMAT = {
        cTFETC1: 0,
        cTFETC2: 1,
        cTFBC1: 2,
        cTFBC3: 3,
        cTFBC4: 4,
        cTFBC5: 5,
        cTFBC7: 6,
        cTFPVRTC1_4_RGB: 8,
        cTFPVRTC1_4_RGBA: 9,
        cTFASTC_4x4: 10,
        cTFATC_RGB: 11,
        cTFATC_RGBA_INTERPOLATED_ALPHA: 12,
        cTFRGBA32: 13,
        cTFRGB565: 14,
        cTFBGR565: 15,
        cTFRGBA4444: 16,
        cTFFXT1_RGB: 17,
        cTFPVRTC2_4_RGB: 18,
        cTFPVRTC2_4_RGBA: 19,
        cTFETC2_EAC_R11: 20,
        cTFETC2_EAC_RG11: 21,
    };
    let transcoderModulePromise = null;
    onmessage = (event) => {
        if (event.data.action === "init") {
            // Load the transcoder if it hasn't been yet
            if (event.data.url) {
                // make sure we loaded the script correctly
                try {
                    importScripts(event.data.url);
                }
                catch (e) {
                    postMessage({ action: "error", error: e });
                }
            }
            if (!transcoderModulePromise) {
                transcoderModulePromise = BASIS({
                    // Override wasm binary
                    wasmBinary: event.data.wasmBinary,
                });
            }
            if (transcoderModulePromise !== null) {
                transcoderModulePromise.then((m) => {
                    BASIS = m;
                    m.initializeBasis();
                    postMessage({ action: "init" });
                });
            }
        }
        else if (event.data.action === "transcode") {
            // Transcode the basis image and return the resulting pixels
            const config = event.data.config;
            const imgData = event.data.imageData;
            const loadedFile = new BASIS.BasisFile(imgData);
            const fileInfo = GetFileInfo(loadedFile);
            let format = event.data.ignoreSupportedFormats ? null : GetSupportedTranscodeFormat(event.data.config, fileInfo);
            let needsConversion = false;
            if (format === null) {
                needsConversion = true;
                format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFBC3 : _BASIS_FORMAT.cTFBC1;
            }
            // Begin transcode
            let success = true;
            if (!loadedFile.startTranscoding()) {
                success = false;
            }
            const buffers = [];
            for (let imageIndex = 0; imageIndex < fileInfo.images.length; imageIndex++) {
                if (!success) {
                    break;
                }
                const image = fileInfo.images[imageIndex];
                if (config.loadSingleImage === undefined || config.loadSingleImage === imageIndex) {
                    let mipCount = image.levels.length;
                    if (config.loadMipmapLevels === false) {
                        mipCount = 1;
                    }
                    for (let levelIndex = 0; levelIndex < mipCount; levelIndex++) {
                        const levelInfo = image.levels[levelIndex];
                        const pixels = TranscodeLevel(loadedFile, imageIndex, levelIndex, format, needsConversion);
                        if (!pixels) {
                            success = false;
                            break;
                        }
                        levelInfo.transcodedPixels = pixels;
                        buffers.push(levelInfo.transcodedPixels.buffer);
                    }
                }
            }
            // Close file
            loadedFile.close();
            loadedFile.delete();
            if (needsConversion) {
                format = -1;
            }
            if (!success) {
                postMessage({ action: "transcode", success: success, id: event.data.id });
            }
            else {
                postMessage({ action: "transcode", success: success, id: event.data.id, fileInfo: fileInfo, format: format }, buffers);
            }
        }
    };
    /**
     * Detects the supported transcode format for the file
     * @param config transcode config
     * @param fileInfo info about the file
     * @returns the chosed format or null if none are supported
     */
    function GetSupportedTranscodeFormat(config, fileInfo) {
        let format = null;
        if (config.supportedCompressionFormats) {
            if (config.supportedCompressionFormats.astc) {
                format = _BASIS_FORMAT.cTFASTC_4x4;
            }
            else if (config.supportedCompressionFormats.bc7) {
                format = _BASIS_FORMAT.cTFBC7;
            }
            else if (config.supportedCompressionFormats.s3tc) {
                format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFBC3 : _BASIS_FORMAT.cTFBC1;
            }
            else if (config.supportedCompressionFormats.pvrtc) {
                format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFPVRTC1_4_RGBA : _BASIS_FORMAT.cTFPVRTC1_4_RGB;
            }
            else if (config.supportedCompressionFormats.etc2) {
                format = _BASIS_FORMAT.cTFETC2;
            }
            else if (config.supportedCompressionFormats.etc1) {
                format = _BASIS_FORMAT.cTFETC1;
            }
            else {
                format = _BASIS_FORMAT.cTFRGB565;
            }
        }
        return format;
    }
    /**
     * Retrieves information about the basis file eg. dimensions
     * @param basisFile the basis file to get the info from
     * @returns information about the basis file
     */
    function GetFileInfo(basisFile) {
        const hasAlpha = basisFile.getHasAlpha();
        const imageCount = basisFile.getNumImages();
        const images = [];
        for (let i = 0; i < imageCount; i++) {
            const imageInfo = {
                levels: [],
            };
            const levelCount = basisFile.getNumLevels(i);
            for (let level = 0; level < levelCount; level++) {
                const levelInfo = {
                    width: basisFile.getImageWidth(i, level),
                    height: basisFile.getImageHeight(i, level),
                };
                imageInfo.levels.push(levelInfo);
            }
            images.push(imageInfo);
        }
        const info = { hasAlpha, images };
        return info;
    }
    function TranscodeLevel(loadedFile, imageIndex, levelIndex, format, convertToRgb565) {
        const dstSize = loadedFile.getImageTranscodedSizeInBytes(imageIndex, levelIndex, format);
        let dst = new Uint8Array(dstSize);
        if (!loadedFile.transcodeImage(dst, imageIndex, levelIndex, format, 1, 0)) {
            return null;
        }
        // If no supported format is found, load as dxt and convert to rgb565
        if (convertToRgb565) {
            const alignedWidth = (loadedFile.getImageWidth(imageIndex, levelIndex) + 3) & ~3;
            const alignedHeight = (loadedFile.getImageHeight(imageIndex, levelIndex) + 3) & ~3;
            dst = ConvertDxtToRgb565(dst, 0, alignedWidth, alignedHeight);
        }
        return dst;
    }
    /**
     * From https://github.com/BinomialLLC/basis_universal/blob/master/webgl/texture/dxt-to-rgb565.js
     * An unoptimized version of dxtToRgb565.  Also, the floating
     * point math used to compute the colors actually results in
     * slightly different colors compared to hardware DXT decoders.
     * @param src dxt src pixels
     * @param srcByteOffset offset for the start of src
     * @param  width aligned width of the image
     * @param  height aligned height of the image
     * @returns the converted pixels
     */
    function ConvertDxtToRgb565(src, srcByteOffset, width, height) {
        const c = new Uint16Array(4);
        const dst = new Uint16Array(width * height);
        const blockWidth = width / 4;
        const blockHeight = height / 4;
        for (let blockY = 0; blockY < blockHeight; blockY++) {
            for (let blockX = 0; blockX < blockWidth; blockX++) {
                const i = srcByteOffset + 8 * (blockY * blockWidth + blockX);
                c[0] = src[i] | (src[i + 1] << 8);
                c[1] = src[i + 2] | (src[i + 3] << 8);
                c[2] =
                    ((2 * (c[0] & 0x1f) + 1 * (c[1] & 0x1f)) / 3) |
                        (((2 * (c[0] & 0x7e0) + 1 * (c[1] & 0x7e0)) / 3) & 0x7e0) |
                        (((2 * (c[0] & 0xf800) + 1 * (c[1] & 0xf800)) / 3) & 0xf800);
                c[3] =
                    ((2 * (c[1] & 0x1f) + 1 * (c[0] & 0x1f)) / 3) |
                        (((2 * (c[1] & 0x7e0) + 1 * (c[0] & 0x7e0)) / 3) & 0x7e0) |
                        (((2 * (c[1] & 0xf800) + 1 * (c[0] & 0xf800)) / 3) & 0xf800);
                for (let row = 0; row < 4; row++) {
                    const m = src[i + 4 + row];
                    let dstI = (blockY * 4 + row) * width + blockX * 4;
                    dst[dstI++] = c[m & 0x3];
                    dst[dstI++] = c[(m >> 2) & 0x3];
                    dst[dstI++] = c[(m >> 4) & 0x3];
                    dst[dstI++] = c[(m >> 6) & 0x3];
                }
            }
        }
        return dst;
    }
}
/**
 * Initialize a web worker with the basis transcoder
 * @param worker the worker to initialize
 * @param wasmBinary the wasm binary to load into the worker
 * @param moduleUrl the url to the basis transcoder module
 * @returns a promise that resolves when the worker is initialized
 */
function initializeWebWorker(worker, wasmBinary, moduleUrl) {
    return new Promise((res, reject) => {
        const initHandler = (msg) => {
            if (msg.data.action === "init") {
                worker.removeEventListener("message", initHandler);
                res(worker);
            }
            else if (msg.data.action === "error") {
                reject(msg.data.error || "error initializing worker");
            }
        };
        worker.addEventListener("message", initHandler);
        // we can use transferable objects here because the worker will own the ArrayBuffer
        worker.postMessage({ action: "init", url: moduleUrl ? tools/* Tools */.S0.GetBabylonScriptURL(moduleUrl) : undefined, wasmBinary }, [wasmBinary]);
    });
}
//# sourceMappingURL=basisWorker.js.map
;// ./node_modules/@babylonjs/core/Misc/basis.js





/**
 * Info about the .basis files
 */
class BasisFileInfo {
}
/**
 * Result of transcoding a basis file
 */
class TranscodeResult {
}
/**
 * Configuration options for the Basis transcoder
 */
class BasisTranscodeConfiguration {
}
/**
 * @internal
 * Enum of basis transcoder formats
 */
var BASIS_FORMATS;
(function (BASIS_FORMATS) {
    BASIS_FORMATS[BASIS_FORMATS["cTFETC1"] = 0] = "cTFETC1";
    BASIS_FORMATS[BASIS_FORMATS["cTFETC2"] = 1] = "cTFETC2";
    BASIS_FORMATS[BASIS_FORMATS["cTFBC1"] = 2] = "cTFBC1";
    BASIS_FORMATS[BASIS_FORMATS["cTFBC3"] = 3] = "cTFBC3";
    BASIS_FORMATS[BASIS_FORMATS["cTFBC4"] = 4] = "cTFBC4";
    BASIS_FORMATS[BASIS_FORMATS["cTFBC5"] = 5] = "cTFBC5";
    BASIS_FORMATS[BASIS_FORMATS["cTFBC7"] = 6] = "cTFBC7";
    BASIS_FORMATS[BASIS_FORMATS["cTFPVRTC1_4_RGB"] = 8] = "cTFPVRTC1_4_RGB";
    BASIS_FORMATS[BASIS_FORMATS["cTFPVRTC1_4_RGBA"] = 9] = "cTFPVRTC1_4_RGBA";
    BASIS_FORMATS[BASIS_FORMATS["cTFASTC_4x4"] = 10] = "cTFASTC_4x4";
    BASIS_FORMATS[BASIS_FORMATS["cTFATC_RGB"] = 11] = "cTFATC_RGB";
    BASIS_FORMATS[BASIS_FORMATS["cTFATC_RGBA_INTERPOLATED_ALPHA"] = 12] = "cTFATC_RGBA_INTERPOLATED_ALPHA";
    BASIS_FORMATS[BASIS_FORMATS["cTFRGBA32"] = 13] = "cTFRGBA32";
    BASIS_FORMATS[BASIS_FORMATS["cTFRGB565"] = 14] = "cTFRGB565";
    BASIS_FORMATS[BASIS_FORMATS["cTFBGR565"] = 15] = "cTFBGR565";
    BASIS_FORMATS[BASIS_FORMATS["cTFRGBA4444"] = 16] = "cTFRGBA4444";
    BASIS_FORMATS[BASIS_FORMATS["cTFFXT1_RGB"] = 17] = "cTFFXT1_RGB";
    BASIS_FORMATS[BASIS_FORMATS["cTFPVRTC2_4_RGB"] = 18] = "cTFPVRTC2_4_RGB";
    BASIS_FORMATS[BASIS_FORMATS["cTFPVRTC2_4_RGBA"] = 19] = "cTFPVRTC2_4_RGBA";
    BASIS_FORMATS[BASIS_FORMATS["cTFETC2_EAC_R11"] = 20] = "cTFETC2_EAC_R11";
    BASIS_FORMATS[BASIS_FORMATS["cTFETC2_EAC_RG11"] = 21] = "cTFETC2_EAC_RG11";
})(BASIS_FORMATS || (BASIS_FORMATS = {}));
/**
 * Used to load .Basis files
 * See https://github.com/BinomialLLC/basis_universal/tree/master/webgl
 */
const BasisToolsOptions = {
    /**
     * URL to use when loading the basis transcoder
     */
    JSModuleURL: `${tools/* Tools */.S0._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.js`,
    /**
     * URL to use when loading the wasm module for the transcoder
     */
    WasmModuleURL: `${tools/* Tools */.S0._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.wasm`,
};
/**
 * Get the internal format to be passed to texImage2D corresponding to the .basis format value
 * @param basisFormat format chosen from GetSupportedTranscodeFormat
 * @param engine
 * @returns internal format corresponding to the Basis format
 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const GetInternalFormatFromBasisFormat = (basisFormat, engine) => {
    let format;
    switch (basisFormat) {
        case BASIS_FORMATS.cTFETC1:
            format = 36196;
            break;
        case BASIS_FORMATS.cTFBC1:
            format = 33776;
            break;
        case BASIS_FORMATS.cTFBC4:
            format = 33779;
            break;
        case BASIS_FORMATS.cTFASTC_4x4:
            format = 37808;
            break;
        case BASIS_FORMATS.cTFETC2:
            format = 37496;
            break;
        case BASIS_FORMATS.cTFBC7:
            format = 36492;
            break;
    }
    if (format === undefined) {
        // eslint-disable-next-line no-throw-literal
        throw "The chosen Basis transcoder format is not currently supported";
    }
    return format;
};
let _WorkerPromise = null;
let _Worker = null;
let _actionId = 0;
const _IgnoreSupportedFormats = false;
const _CreateWorkerAsync = () => {
    if (!_WorkerPromise) {
        _WorkerPromise = new Promise((res, reject) => {
            if (_Worker) {
                res(_Worker);
            }
            else {
                tools/* Tools */.S0.LoadFileAsync(tools/* Tools */.S0.GetBabylonScriptURL(BasisToolsOptions.WasmModuleURL))
                    .then((wasmBinary) => {
                    if (typeof URL !== "function") {
                        return reject("Basis transcoder requires an environment with a URL constructor");
                    }
                    const workerBlobUrl = URL.createObjectURL(new Blob([`(${workerFunction})()`], { type: "application/javascript" }));
                    _Worker = new Worker(workerBlobUrl);
                    initializeWebWorker(_Worker, wasmBinary, BasisToolsOptions.JSModuleURL).then(res, reject);
                })
                    .catch(reject);
            }
        });
    }
    return _WorkerPromise;
};
/**
 * Set the worker to use for transcoding
 * @param worker The worker that will be used for transcoding
 */
const SetBasisTranscoderWorker = (worker) => {
    _Worker = worker;
};
/**
 * Transcodes a loaded image file to compressed pixel data
 * @param data image data to transcode
 * @param config configuration options for the transcoding
 * @returns a promise resulting in the transcoded image
 */
const TranscodeAsync = (data, config) => {
    const dataView = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
    return new Promise((res, rej) => {
        _CreateWorkerAsync().then(() => {
            const actionId = _actionId++;
            const messageHandler = (msg) => {
                if (msg.data.action === "transcode" && msg.data.id === actionId) {
                    _Worker.removeEventListener("message", messageHandler);
                    if (!msg.data.success) {
                        rej("Transcode is not supported on this device");
                    }
                    else {
                        res(msg.data);
                    }
                }
            };
            _Worker.addEventListener("message", messageHandler);
            const dataViewCopy = new Uint8Array(dataView.byteLength);
            dataViewCopy.set(new Uint8Array(dataView.buffer, dataView.byteOffset, dataView.byteLength));
            _Worker.postMessage({ action: "transcode", id: actionId, imageData: dataViewCopy, config: config, ignoreSupportedFormats: _IgnoreSupportedFormats }, [
                dataViewCopy.buffer,
            ]);
        }, (error) => {
            rej(error);
        });
    });
};
/**
 * Binds a texture according to its underlying target.
 * @param texture texture to bind
 * @param engine the engine to bind the texture in
 */
const BindTexture = (texture, engine) => {
    let target = engine._gl?.TEXTURE_2D;
    if (texture.isCube) {
        target = engine._gl?.TEXTURE_CUBE_MAP;
    }
    engine._bindTextureDirectly(target, texture, true);
};
/**
 * Loads a texture from the transcode result
 * @param texture texture load to
 * @param transcodeResult the result of transcoding the basis file to load from
 */
const LoadTextureFromTranscodeResult = (texture, transcodeResult) => {
    const engine = texture.getEngine();
    for (let i = 0; i < transcodeResult.fileInfo.images.length; i++) {
        const rootImage = transcodeResult.fileInfo.images[i].levels[0];
        texture._invertVScale = texture.invertY;
        if (transcodeResult.format === -1 || transcodeResult.format === BASIS_FORMATS.cTFRGB565) {
            // No compatable compressed format found, fallback to RGB
            texture.type = 10;
            texture.format = 4;
            if (engine._features.basisNeedsPOT && (Math.log2(rootImage.width) % 1 !== 0 || Math.log2(rootImage.height) % 1 !== 0)) {
                // Create non power of two texture
                const source = new internalTexture/* InternalTexture */.hV(engine, 2 /* InternalTextureSource.Temp */);
                texture._invertVScale = texture.invertY;
                source.type = 10;
                source.format = 4;
                // Fallback requires aligned width/height
                source.width = (rootImage.width + 3) & ~3;
                source.height = (rootImage.height + 3) & ~3;
                BindTexture(source, engine);
                engine._uploadDataToTextureDirectly(source, new Uint16Array(rootImage.transcodedPixels.buffer), i, 0, 4, true);
                // Resize to power of two
                engine._rescaleTexture(source, texture, engine.scenes[0], engine._getInternalFormat(4), () => {
                    engine._releaseTexture(source);
                    BindTexture(texture, engine);
                });
            }
            else {
                // Fallback is already inverted
                texture._invertVScale = !texture.invertY;
                // Upload directly
                texture.width = (rootImage.width + 3) & ~3;
                texture.height = (rootImage.height + 3) & ~3;
                texture.samplingMode = 2;
                BindTexture(texture, engine);
                engine._uploadDataToTextureDirectly(texture, new Uint16Array(rootImage.transcodedPixels.buffer), i, 0, 4, true);
            }
        }
        else {
            texture.width = rootImage.width;
            texture.height = rootImage.height;
            texture.generateMipMaps = transcodeResult.fileInfo.images[i].levels.length > 1;
            const format = BasisTools.GetInternalFormatFromBasisFormat(transcodeResult.format, engine);
            texture.format = format;
            BindTexture(texture, engine);
            // Upload all mip levels in the file
            transcodeResult.fileInfo.images[i].levels.forEach((level, index) => {
                engine._uploadCompressedDataToTextureDirectly(texture, format, level.width, level.height, level.transcodedPixels, i, index);
            });
            if (engine._features.basisNeedsPOT && (Math.log2(texture.width) % 1 !== 0 || Math.log2(texture.height) % 1 !== 0)) {
                tools/* Tools */.S0.Warn("Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1.");
                texture._cachedWrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                texture._cachedWrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
            }
        }
    }
};
/**
 * Used to load .Basis files
 * See https://github.com/BinomialLLC/basis_universal/tree/master/webgl
 */
const BasisTools = {
    /**
     * URL to use when loading the basis transcoder
     */
    JSModuleURL: BasisToolsOptions.JSModuleURL,
    /**
     * URL to use when loading the wasm module for the transcoder
     */
    WasmModuleURL: BasisToolsOptions.WasmModuleURL,
    /**
     * Get the internal format to be passed to texImage2D corresponding to the .basis format value
     * @param basisFormat format chosen from GetSupportedTranscodeFormat
     * @returns internal format corresponding to the Basis format
     */
    GetInternalFormatFromBasisFormat,
    /**
     * Transcodes a loaded image file to compressed pixel data
     * @param data image data to transcode
     * @param config configuration options for the transcoding
     * @returns a promise resulting in the transcoded image
     */
    TranscodeAsync,
    /**
     * Loads a texture from the transcode result
     * @param texture texture load to
     * @param transcodeResult the result of transcoding the basis file to load from
     */
    LoadTextureFromTranscodeResult,
};
Object.defineProperty(BasisTools, "JSModuleURL", {
    get: function () {
        return BasisToolsOptions.JSModuleURL;
    },
    set: function (value) {
        BasisToolsOptions.JSModuleURL = value;
    },
});
Object.defineProperty(BasisTools, "WasmModuleURL", {
    get: function () {
        return BasisToolsOptions.WasmModuleURL;
    },
    set: function (value) {
        BasisToolsOptions.WasmModuleURL = value;
    },
});
//# sourceMappingURL=basis.js.map

/***/ }),

/***/ 4109:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   J: () => (/* binding */ BRDFTextureTools),
/* harmony export */   X: () => (/* binding */ GetEnvironmentBRDFTexture)
/* harmony export */ });
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7481);
/* harmony import */ var _rgbdTextureTools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97126);


// eslint-disable-next-line @typescript-eslint/naming-convention
const _environmentBRDFBase64Texture = "data:image/png;base64, ";
let _instanceNumber = 0;
/**
 * Gets a default environment BRDF for MS-BRDF Height Correlated BRDF
 * @param scene defines the hosting scene
 * @returns the environment BRDF texture
 */
const GetEnvironmentBRDFTexture = (scene) => {
    if (!scene.environmentBRDFTexture) {
        // Forces Delayed Texture Loading to prevent undefined error whilst setting RGBD values.
        const useDelayedTextureLoading = scene.useDelayedTextureLoading;
        scene.useDelayedTextureLoading = false;
        const previousState = scene._blockEntityCollection;
        scene._blockEntityCollection = false;
        const texture = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.CreateFromBase64String(_environmentBRDFBase64Texture, "EnvironmentBRDFTexture" + _instanceNumber++, scene, true, false, _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.BILINEAR_SAMPLINGMODE);
        scene._blockEntityCollection = previousState;
        // BRDF Texture should not be cached here due to pre processing and redundant scene caches.
        const texturesCache = scene.getEngine().getLoadedTexturesCache();
        const index = texturesCache.indexOf(texture.getInternalTexture());
        if (index !== -1) {
            texturesCache.splice(index, 1);
        }
        texture.isRGBD = true;
        texture.wrapU = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.CLAMP_ADDRESSMODE;
        texture.wrapV = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.CLAMP_ADDRESSMODE;
        scene.environmentBRDFTexture = texture;
        scene.useDelayedTextureLoading = useDelayedTextureLoading;
        _rgbdTextureTools_js__WEBPACK_IMPORTED_MODULE_1__/* .RGBDTextureTools */ .G.ExpandRGBDTexture(texture);
        const observer = scene.getEngine().onContextRestoredObservable.add(() => {
            texture.isRGBD = true;
            /**
             * Using scene.onBeforeRenderObservable instead of Tools.SetImmediate to check the texture's state of readiness allows us to check before any rendering occurs.
             * When a context restore occurs, it gives ExpandRGBDTexture the ability to reset the state to false, preventing the texture from being used in any rendering.
             * In WebGPU, not doing so would generate an error because ExpandRGBDTexture performs a _swapAndDie on the texture, which causes WebGPU caches to fail if the texture has already been used for rendering.
             * Only when ExpandRGBDTexture has finished its work, the texture is ready to be used again.
             */
            const oo = scene.onBeforeRenderObservable.add(() => {
                if (texture.isReady()) {
                    scene.onBeforeRenderObservable.remove(oo);
                    _rgbdTextureTools_js__WEBPACK_IMPORTED_MODULE_1__/* .RGBDTextureTools */ .G.ExpandRGBDTexture(texture);
                }
            });
        });
        scene.onDisposeObservable.add(() => {
            scene.getEngine().onContextRestoredObservable.remove(observer);
        });
    }
    return scene.environmentBRDFTexture;
};
/**
 * Class used to host texture specific utilities
 */
const BRDFTextureTools = {
    /**
     * Gets a default environment BRDF for MS-BRDF Height Correlated BRDF
     * @param scene defines the hosting scene
     * @returns the environment BRDF texture
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    GetEnvironmentBRDFTexture,
};
//# sourceMappingURL=brdfTextureTools.js.map

/***/ }),

/***/ 65394:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   RJ: () => (/* binding */ RemoveComments),
/* harmony export */   V3: () => (/* binding */ EscapeRegExp),
/* harmony export */   VW: () => (/* binding */ ExtractBetweenMarkers),
/* harmony export */   _Z: () => (/* binding */ IsIdentifierChar),
/* harmony export */   bI: () => (/* binding */ InjectStartingAndEndingCode),
/* harmony export */   rU: () => (/* binding */ FindBackward),
/* harmony export */   sz: () => (/* binding */ SkipWhitespaces)
/* harmony export */ });
/**
 * Extracts the characters between two markers (for eg, between "(" and ")"). The function handles nested markers as well as markers inside strings (delimited by ", ' or `) and comments
 * @param markerOpen opening marker
 * @param markerClose closing marker
 * @param block code block to parse
 * @param startIndex starting index in block where the extraction must start. The character at block[startIndex] should be the markerOpen character!
 * @returns index of the last character for the extraction (or -1 if the string is invalid - no matching closing marker found). The string to extract (without the markers) is the string between startIndex + 1 and the returned value (exclusive)
 */
function ExtractBetweenMarkers(markerOpen, markerClose, block, startIndex) {
    let currPos = startIndex, openMarkers = 0, waitForChar = "";
    while (currPos < block.length) {
        const currChar = block.charAt(currPos);
        if (!waitForChar) {
            switch (currChar) {
                case markerOpen:
                    openMarkers++;
                    break;
                case markerClose:
                    openMarkers--;
                    break;
                case '"':
                case "'":
                case "`":
                    waitForChar = currChar;
                    break;
                case "/":
                    if (currPos + 1 < block.length) {
                        const nextChar = block.charAt(currPos + 1);
                        if (nextChar === "/") {
                            waitForChar = "\n";
                        }
                        else if (nextChar === "*") {
                            waitForChar = "*/";
                        }
                    }
                    break;
            }
        }
        else {
            if (currChar === waitForChar) {
                if (waitForChar === '"' || waitForChar === "'") {
                    block.charAt(currPos - 1) !== "\\" && (waitForChar = "");
                }
                else {
                    waitForChar = "";
                }
            }
            else if (waitForChar === "*/" && currChar === "*" && currPos + 1 < block.length) {
                block.charAt(currPos + 1) === "/" && (waitForChar = "");
                if (waitForChar === "") {
                    currPos++;
                }
            }
        }
        currPos++;
        if (openMarkers === 0) {
            break;
        }
    }
    return openMarkers === 0 ? currPos - 1 : -1;
}
/**
 * Parses a string and skip whitespaces
 * @param s string to parse
 * @param index index where to start parsing
 * @returns the index after all whitespaces have been skipped
 */
function SkipWhitespaces(s, index) {
    while (index < s.length) {
        const c = s[index];
        if (c !== " " && c !== "\n" && c !== "\r" && c !== "\t" && c !== "\u000a" && c !== "\u00a0") {
            break;
        }
        index++;
    }
    return index;
}
/**
 * Checks if a character is an identifier character (meaning, if it is 0-9, A-Z, a-z or _)
 * @param c character to check
 * @returns true if the character is an identifier character
 */
function IsIdentifierChar(c) {
    const v = c.charCodeAt(0);
    return ((v >= 48 && v <= 57) || // 0-9
        (v >= 65 && v <= 90) || // A-Z
        (v >= 97 && v <= 122) || // a-z
        v == 95); // _
}
/**
 * Removes the comments of a code block
 * @param block code block to parse
 * @returns block with the comments removed
 */
function RemoveComments(block) {
    let currPos = 0, waitForChar = "", inComments = false;
    const s = [];
    while (currPos < block.length) {
        const currChar = block.charAt(currPos);
        if (!waitForChar) {
            switch (currChar) {
                case '"':
                case "'":
                case "`":
                    waitForChar = currChar;
                    break;
                case "/":
                    if (currPos + 1 < block.length) {
                        const nextChar = block.charAt(currPos + 1);
                        if (nextChar === "/") {
                            waitForChar = "\n";
                            inComments = true;
                        }
                        else if (nextChar === "*") {
                            waitForChar = "*/";
                            inComments = true;
                        }
                    }
                    break;
            }
            if (!inComments) {
                s.push(currChar);
            }
        }
        else {
            if (currChar === waitForChar) {
                if (waitForChar === '"' || waitForChar === "'") {
                    block.charAt(currPos - 1) !== "\\" && (waitForChar = "");
                    s.push(currChar);
                }
                else {
                    waitForChar = "";
                    inComments = false;
                }
            }
            else if (waitForChar === "*/" && currChar === "*" && currPos + 1 < block.length) {
                block.charAt(currPos + 1) === "/" && (waitForChar = "");
                if (waitForChar === "") {
                    inComments = false;
                    currPos++;
                }
            }
            else {
                if (!inComments) {
                    s.push(currChar);
                }
            }
        }
        currPos++;
    }
    return s.join("");
}
/**
 * Finds the first occurrence of a character in a string going backward
 * @param s the string to parse
 * @param index starting index in the string
 * @param c the character to find
 * @param c2 an optional second character to find
 * @returns the index of the character if found, else -1
 */
function FindBackward(s, index, c, c2) {
    while (index >= 0 && s.charAt(index) !== c && (!c2 || s.charAt(index) !== c2)) {
        index--;
    }
    return index;
}
/**
 * Escapes a string so that it is usable as a regular expression
 * @param s string to escape
 * @returns escaped string
 */
function EscapeRegExp(s) {
    return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
/**
 * Injects code at the beginning and/or end of a function.
 * The function is identified by "mainFuncDecl". The starting code is injected just after the first "\{" found after the mainFuncDecl.
 * The ending code is injected just before the last "\}" of the whole block of code (so, it is assumed that the function is the last of the block of code).
 * @param code code to inject into
 * @param mainFuncDecl Function declaration to find in the code (for eg: "void main")
 * @param startingCode The code to inject at the beginning of the function
 * @param endingCode The code to inject at the end of the function
 * @returns The code with the injected code
 */
function InjectStartingAndEndingCode(code, mainFuncDecl, startingCode, endingCode) {
    let idx = code.indexOf(mainFuncDecl);
    if (idx < 0) {
        return code;
    }
    if (startingCode) {
        // eslint-disable-next-line no-empty
        while (idx++ < code.length && code.charAt(idx) != "{") { }
        if (idx < code.length) {
            const part1 = code.substring(0, idx + 1);
            const part2 = code.substring(idx + 1);
            code = part1 + startingCode + part2;
        }
    }
    if (endingCode) {
        const lastClosingCurly = code.lastIndexOf("}");
        code = code.substring(0, lastClosingCurly);
        code += endingCode + "\n}";
    }
    return code;
}
//# sourceMappingURL=codeStringParsingTools.js.map

/***/ }),

/***/ 95625:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   D8: () => (/* binding */ CopyTools),
/* harmony export */   c9: () => (/* binding */ GenerateBase64StringFromPixelData),
/* harmony export */   lP: () => (/* binding */ GenerateBase64StringFromTexture),
/* harmony export */   nh: () => (/* binding */ GenerateBase64StringFromTextureAsync)
/* harmony export */ });
/**
 * Transform some pixel data to a base64 string
 * @param pixels defines the pixel data to transform to base64
 * @param size defines the width and height of the (texture) data
 * @param invertY true if the data must be inverted for the Y coordinate during the conversion
 * @returns The base64 encoded string or null
 */
function GenerateBase64StringFromPixelData(pixels, size, invertY = false) {
    const width = size.width;
    const height = size.height;
    if (pixels instanceof Float32Array) {
        let len = pixels.byteLength / pixels.BYTES_PER_ELEMENT;
        const npixels = new Uint8Array(len);
        while (--len >= 0) {
            let val = pixels[len];
            if (val < 0) {
                val = 0;
            }
            else if (val > 1) {
                val = 1;
            }
            npixels[len] = val * 255;
        }
        pixels = npixels;
    }
    const canvas = document.createElement("canvas");
    canvas.width = width;
    canvas.height = height;
    const ctx = canvas.getContext("2d");
    if (!ctx) {
        return null;
    }
    const imageData = ctx.createImageData(width, height);
    const castData = imageData.data;
    castData.set(pixels);
    ctx.putImageData(imageData, 0, 0);
    if (invertY) {
        const canvas2 = document.createElement("canvas");
        canvas2.width = width;
        canvas2.height = height;
        const ctx2 = canvas2.getContext("2d");
        if (!ctx2) {
            return null;
        }
        ctx2.translate(0, height);
        ctx2.scale(1, -1);
        ctx2.drawImage(canvas, 0, 0);
        return canvas2.toDataURL("image/png");
    }
    return canvas.toDataURL("image/png");
}
/**
 * Reads the pixels stored in the webgl texture and returns them as a base64 string
 * @param texture defines the texture to read pixels from
 * @param faceIndex defines the face of the texture to read (in case of cube texture)
 * @param level defines the LOD level of the texture to read (in case of Mip Maps)
 * @returns The base64 encoded string or null
 */
function GenerateBase64StringFromTexture(texture, faceIndex = 0, level = 0) {
    const internalTexture = texture.getInternalTexture();
    if (!internalTexture) {
        return null;
    }
    const pixels = texture._readPixelsSync(faceIndex, level);
    if (!pixels) {
        return null;
    }
    return GenerateBase64StringFromPixelData(pixels, texture.getSize(), internalTexture.invertY);
}
/**
 * Reads the pixels stored in the webgl texture and returns them as a base64 string
 * @param texture defines the texture to read pixels from
 * @param faceIndex defines the face of the texture to read (in case of cube texture)
 * @param level defines the LOD level of the texture to read (in case of Mip Maps)
 * @returns The base64 encoded string or null wrapped in a promise
 */
async function GenerateBase64StringFromTextureAsync(texture, faceIndex = 0, level = 0) {
    const internalTexture = texture.getInternalTexture();
    if (!internalTexture) {
        return null;
    }
    const pixels = await texture.readPixels(faceIndex, level);
    if (!pixels) {
        return null;
    }
    return GenerateBase64StringFromPixelData(pixels, texture.getSize(), internalTexture.invertY);
}
/**
 * Class used to host copy specific utilities
 * (Back-compat)
 */
const CopyTools = {
    /**
     * Transform some pixel data to a base64 string
     * @param pixels defines the pixel data to transform to base64
     * @param size defines the width and height of the (texture) data
     * @param invertY true if the data must be inverted for the Y coordinate during the conversion
     * @returns The base64 encoded string or null
     */
    GenerateBase64StringFromPixelData,
    /**
     * Reads the pixels stored in the webgl texture and returns them as a base64 string
     * @param texture defines the texture to read pixels from
     * @param faceIndex defines the face of the texture to read (in case of cube texture)
     * @param level defines the LOD level of the texture to read (in case of Mip Maps)
     * @returns The base64 encoded string or null
     */
    GenerateBase64StringFromTexture,
    /**
     * Reads the pixels stored in the webgl texture and returns them as a base64 string
     * @param texture defines the texture to read pixels from
     * @param faceIndex defines the face of the texture to read (in case of cube texture)
     * @param level defines the LOD level of the texture to read (in case of Mip Maps)
     * @returns The base64 encoded string or null wrapped in a promise
     */
    GenerateBase64StringFromTextureAsync,
};
//# sourceMappingURL=copyTools.js.map

/***/ }),

/***/ 80163:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Aj: () => (/* binding */ makeSyncFunction),
/* harmony export */   FE: () => (/* binding */ inlineScheduler),
/* harmony export */   V1: () => (/* binding */ runCoroutineSync),
/* harmony export */   VP: () => (/* binding */ createYieldingScheduler),
/* harmony export */   aw: () => (/* binding */ runCoroutine),
/* harmony export */   kj: () => (/* binding */ runCoroutineAsync),
/* harmony export */   xu: () => (/* binding */ makeAsyncFunction)
/* harmony export */ });
/* eslint-disable @typescript-eslint/naming-convention */
// "Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed."
// https://en.wikipedia.org/wiki/Coroutine
// The inline scheduler simply steps the coroutine synchronously. This is useful for running a coroutine synchronously, and also as a helper function for other schedulers.
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function inlineScheduler(coroutine, onStep, onError) {
    try {
        const step = coroutine.next();
        if (step.done) {
            onStep(step);
        }
        else if (!step.value) {
            // NOTE: The properties of step have been narrowed, but the type of step itself is not narrowed, so the cast below is the most type safe way to deal with this without instantiating a new object to hold the values.
            onStep(step);
        }
        else {
            step.value.then(() => {
                step.value = undefined;
                onStep(step);
            }, onError);
        }
    }
    catch (error) {
        onError(error);
    }
}
// The yielding scheduler steps the coroutine synchronously until the specified time interval has elapsed, then yields control so other operations can be performed.
// A single instance of a yielding scheduler could be shared across multiple coroutines to yield when their collective work exceeds the threshold.
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function createYieldingScheduler(yieldAfterMS = 25) {
    let startTime;
    return (coroutine, onStep, onError) => {
        const currentTime = performance.now();
        if (startTime === undefined || currentTime - startTime > yieldAfterMS) {
            // If this is the first coroutine step, or if the time interval has elapsed, record a new start time, and schedule the coroutine step to happen later, effectively yielding control of the execution context.
            startTime = currentTime;
            setTimeout(() => {
                inlineScheduler(coroutine, onStep, onError);
            }, 0);
        }
        else {
            // Otherwise it is not time to yield yet, so step the coroutine synchronously.
            inlineScheduler(coroutine, onStep, onError);
        }
    };
}
// Runs the specified coroutine with the specified scheduler. The success or error callback will be invoked when the coroutine finishes.
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function runCoroutine(coroutine, scheduler, onSuccess, onError, abortSignal) {
    const resume = () => {
        let reschedule;
        const onStep = (stepResult) => {
            if (stepResult.done) {
                // If the coroutine is done, report success.
                onSuccess(stepResult.value);
            }
            else {
                // If the coroutine is not done, resume the coroutine (via the scheduler).
                if (reschedule === undefined) {
                    // If reschedule is undefined at this point, then the coroutine must have stepped synchronously, so just flag another loop iteration.
                    reschedule = true;
                }
                else {
                    // If reschedule is defined at this point, then the coroutine must have stepped asynchronously, so call resume to restart the step loop.
                    resume();
                }
            }
        };
        do {
            reschedule = undefined;
            if (!abortSignal || !abortSignal.aborted) {
                scheduler(coroutine, onStep, onError);
            }
            else {
                onError(new Error("Aborted"));
            }
            if (reschedule === undefined) {
                // If reschedule is undefined at this point, then the coroutine must have stepped asynchronously, so stop looping and let the coroutine be resumed later.
                reschedule = false;
            }
        } while (reschedule);
    };
    resume();
}
// Runs the specified coroutine synchronously.
/**
 * @internal
 */
function runCoroutineSync(coroutine, abortSignal) {
    // Run the coroutine with the inline scheduler, storing the returned value, or re-throwing the error (since the error callback will be called synchronously by the inline scheduler).
    let result;
    runCoroutine(coroutine, inlineScheduler, (r) => (result = r), (e) => {
        throw e;
    }, abortSignal);
    // Synchronously return the result of the coroutine.
    return result;
}
// Runs the specified coroutine asynchronously with the specified scheduler.
/**
 * @internal
 */
function runCoroutineAsync(coroutine, scheduler, abortSignal) {
    // Run the coroutine with a yielding scheduler, resolving or rejecting the result promise when the coroutine finishes.
    return new Promise((resolve, reject) => {
        runCoroutine(coroutine, scheduler, resolve, reject, abortSignal);
    });
}
/**
 * Given a function that returns a Coroutine<T>, produce a function with the same parameters that returns a T.
 * The returned function runs the coroutine synchronously.
 * @param coroutineFactory A function that returns a Coroutine<T>.
 * @param abortSignal
 * @returns A function that runs the coroutine synchronously.
 * @internal
 */
function makeSyncFunction(coroutineFactory, abortSignal) {
    return (...params) => {
        // Run the coroutine synchronously.
        return runCoroutineSync(coroutineFactory(...params), abortSignal);
    };
}
/**
 * Given a function that returns a Coroutine<T>, product a function with the same parameters that returns a Promise<T>.
 * The returned function runs the coroutine asynchronously, yield control of the execution context occasionally to enable a more responsive experience.
 * @param coroutineFactory A function that returns a Coroutine<T>.
 * @param scheduler
 * @param abortSignal
 * @returns A function that runs the coroutine asynchronously.
 * @internal
 */
function makeAsyncFunction(coroutineFactory, scheduler, abortSignal) {
    return (...params) => {
        // Run the coroutine asynchronously.
        return runCoroutineAsync(coroutineFactory(...params), scheduler, abortSignal);
    };
}
//# sourceMappingURL=coroutine.js.map

/***/ }),

/***/ 97974:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   s: () => (/* binding */ DataReader)
/* harmony export */ });
/* harmony import */ var _stringTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36181);

/**
 * Utility class for reading from a data buffer
 */
class DataReader {
    /**
     * Constructor
     * @param buffer The buffer to read
     */
    constructor(buffer) {
        /**
         * The current byte offset from the beginning of the data buffer.
         */
        this.byteOffset = 0;
        this.buffer = buffer;
    }
    /**
     * Loads the given byte length.
     * @param byteLength The byte length to load
     * @returns A promise that resolves when the load is complete
     */
    loadAsync(byteLength) {
        return this.buffer.readAsync(this.byteOffset, byteLength).then((data) => {
            this._dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
            this._dataByteOffset = 0;
        });
    }
    /**
     * Read a unsigned 32-bit integer from the currently loaded data range.
     * @returns The 32-bit integer read
     */
    readUint32() {
        const value = this._dataView.getUint32(this._dataByteOffset, true);
        this._dataByteOffset += 4;
        this.byteOffset += 4;
        return value;
    }
    /**
     * Read a byte array from the currently loaded data range.
     * @param byteLength The byte length to read
     * @returns The byte array read
     */
    readUint8Array(byteLength) {
        const value = new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + this._dataByteOffset, byteLength);
        this._dataByteOffset += byteLength;
        this.byteOffset += byteLength;
        return value;
    }
    /**
     * Read a string from the currently loaded data range.
     * @param byteLength The byte length to read
     * @returns The string read
     */
    readString(byteLength) {
        return (0,_stringTools_js__WEBPACK_IMPORTED_MODULE_0__/* .Decode */ .Tq)(this.readUint8Array(byteLength));
    }
    /**
     * Skips the given byte length the currently loaded data range.
     * @param byteLength The byte length to skip
     */
    skipBytes(byteLength) {
        this._dataByteOffset += byteLength;
        this.byteOffset += byteLength;
    }
}
//# sourceMappingURL=dataReader.js.map

/***/ }),

/***/ 36464:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DDSTools: () => (/* binding */ DDSTools)
/* harmony export */ });
/* harmony import */ var _Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84867);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);
/* harmony import */ var _Misc_HighDynamicRange_cubemapToSphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36755);
/* harmony import */ var _textureTools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42683);
/* harmony import */ var _Engines_AbstractEngine_abstractEngine_cubeTexture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69195);
/* eslint-disable @typescript-eslint/naming-convention */






// Based on demo done by Brandon Jones - http://media.tojicode.com/webgl-samples/dds.html
// All values and structures referenced from:
// http://msdn.microsoft.com/en-us/library/bb943991.aspx/
const DDS_MAGIC = 0x20534444;
const //DDSD_CAPS = 0x1,
//DDSD_HEIGHT = 0x2,
//DDSD_WIDTH = 0x4,
//DDSD_PITCH = 0x8,
//DDSD_PIXELFORMAT = 0x1000,
DDSD_MIPMAPCOUNT = 0x20000;
//DDSD_LINEARSIZE = 0x80000,
//DDSD_DEPTH = 0x800000;
// var DDSCAPS_COMPLEX = 0x8,
//     DDSCAPS_MIPMAP = 0x400000,
//     DDSCAPS_TEXTURE = 0x1000;
const DDSCAPS2_CUBEMAP = 0x200;
// DDSCAPS2_CUBEMAP_POSITIVEX = 0x400,
// DDSCAPS2_CUBEMAP_NEGATIVEX = 0x800,
// DDSCAPS2_CUBEMAP_POSITIVEY = 0x1000,
// DDSCAPS2_CUBEMAP_NEGATIVEY = 0x2000,
// DDSCAPS2_CUBEMAP_POSITIVEZ = 0x4000,
// DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x8000,
// DDSCAPS2_VOLUME = 0x200000;
const //DDPF_ALPHAPIXELS = 0x1,
//DDPF_ALPHA = 0x2,
DDPF_FOURCC = 0x4, DDPF_RGB = 0x40, 
//DDPF_YUV = 0x200,
DDPF_LUMINANCE = 0x20000;
function FourCCToInt32(value) {
    return value.charCodeAt(0) + (value.charCodeAt(1) << 8) + (value.charCodeAt(2) << 16) + (value.charCodeAt(3) << 24);
}
function Int32ToFourCC(value) {
    return String.fromCharCode(value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, (value >> 24) & 0xff);
}
const FOURCC_DXT1 = FourCCToInt32("DXT1");
const FOURCC_DXT3 = FourCCToInt32("DXT3");
const FOURCC_DXT5 = FourCCToInt32("DXT5");
const FOURCC_DX10 = FourCCToInt32("DX10");
const FOURCC_D3DFMT_R16G16B16A16F = 113;
const FOURCC_D3DFMT_R32G32B32A32F = 116;
const DXGI_FORMAT_R32G32B32A32_FLOAT = 2;
const DXGI_FORMAT_R16G16B16A16_FLOAT = 10;
const DXGI_FORMAT_B8G8R8X8_UNORM = 88;
const headerLengthInt = 31; // The header length in 32 bit ints
// Offsets into the header array
const off_magic = 0;
const off_size = 1;
const off_flags = 2;
const off_height = 3;
const off_width = 4;
const off_mipmapCount = 7;
const off_pfFlags = 20;
const off_pfFourCC = 21;
const off_RGBbpp = 22;
const off_RMask = 23;
const off_GMask = 24;
const off_BMask = 25;
const off_AMask = 26;
// var off_caps1 = 27;
const off_caps2 = 28;
// var off_caps3 = 29;
// var off_caps4 = 30;
const off_dxgiFormat = 32;
/**
 * Class used to provide DDS decompression tools
 */
class DDSTools {
    /**
     * Gets DDS information from an array buffer
     * @param data defines the array buffer view to read data from
     * @returns the DDS information
     */
    static GetDDSInfo(data) {
        const header = new Int32Array(data.buffer, data.byteOffset, headerLengthInt);
        const extendedHeader = new Int32Array(data.buffer, data.byteOffset, headerLengthInt + 4);
        let mipmapCount = 1;
        if (header[off_flags] & DDSD_MIPMAPCOUNT) {
            mipmapCount = Math.max(1, header[off_mipmapCount]);
        }
        const fourCC = header[off_pfFourCC];
        const dxgiFormat = fourCC === FOURCC_DX10 ? extendedHeader[off_dxgiFormat] : 0;
        let textureType = 0;
        switch (fourCC) {
            case FOURCC_D3DFMT_R16G16B16A16F:
                textureType = 2;
                break;
            case FOURCC_D3DFMT_R32G32B32A32F:
                textureType = 1;
                break;
            case FOURCC_DX10:
                if (dxgiFormat === DXGI_FORMAT_R16G16B16A16_FLOAT) {
                    textureType = 2;
                    break;
                }
                if (dxgiFormat === DXGI_FORMAT_R32G32B32A32_FLOAT) {
                    textureType = 1;
                    break;
                }
        }
        return {
            width: header[off_width],
            height: header[off_height],
            mipmapCount: mipmapCount,
            isFourCC: (header[off_pfFlags] & DDPF_FOURCC) === DDPF_FOURCC,
            isRGB: (header[off_pfFlags] & DDPF_RGB) === DDPF_RGB,
            isLuminance: (header[off_pfFlags] & DDPF_LUMINANCE) === DDPF_LUMINANCE,
            isCube: (header[off_caps2] & DDSCAPS2_CUBEMAP) === DDSCAPS2_CUBEMAP,
            isCompressed: fourCC === FOURCC_DXT1 || fourCC === FOURCC_DXT3 || fourCC === FOURCC_DXT5,
            dxgiFormat: dxgiFormat,
            textureType: textureType,
        };
    }
    static _GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {
        const destArray = new Float32Array(dataLength);
        const srcData = new Uint16Array(arrayBuffer, dataOffset);
        let index = 0;
        for (let y = 0; y < height; y++) {
            for (let x = 0; x < width; x++) {
                const srcPos = (x + y * width) * 4;
                destArray[index] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .FromHalfFloat */ .SX)(srcData[srcPos]);
                destArray[index + 1] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .FromHalfFloat */ .SX)(srcData[srcPos + 1]);
                destArray[index + 2] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .FromHalfFloat */ .SX)(srcData[srcPos + 2]);
                if (DDSTools.StoreLODInAlphaChannel) {
                    destArray[index + 3] = lod;
                }
                else {
                    destArray[index + 3] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .FromHalfFloat */ .SX)(srcData[srcPos + 3]);
                }
                index += 4;
            }
        }
        return destArray;
    }
    static _GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {
        if (DDSTools.StoreLODInAlphaChannel) {
            const destArray = new Uint16Array(dataLength);
            const srcData = new Uint16Array(arrayBuffer, dataOffset);
            let index = 0;
            for (let y = 0; y < height; y++) {
                for (let x = 0; x < width; x++) {
                    const srcPos = (x + y * width) * 4;
                    destArray[index] = srcData[srcPos];
                    destArray[index + 1] = srcData[srcPos + 1];
                    destArray[index + 2] = srcData[srcPos + 2];
                    destArray[index + 3] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .ToHalfFloat */ .LZ)(lod);
                    index += 4;
                }
            }
            return destArray;
        }
        return new Uint16Array(arrayBuffer, dataOffset, dataLength);
    }
    static _GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {
        if (DDSTools.StoreLODInAlphaChannel) {
            const destArray = new Float32Array(dataLength);
            const srcData = new Float32Array(arrayBuffer, dataOffset);
            let index = 0;
            for (let y = 0; y < height; y++) {
                for (let x = 0; x < width; x++) {
                    const srcPos = (x + y * width) * 4;
                    destArray[index] = srcData[srcPos];
                    destArray[index + 1] = srcData[srcPos + 1];
                    destArray[index + 2] = srcData[srcPos + 2];
                    destArray[index + 3] = lod;
                    index += 4;
                }
            }
            return destArray;
        }
        return new Float32Array(arrayBuffer, dataOffset, dataLength);
    }
    static _GetFloatAsHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {
        const destArray = new Uint16Array(dataLength);
        const srcData = new Float32Array(arrayBuffer, dataOffset);
        let index = 0;
        for (let y = 0; y < height; y++) {
            for (let x = 0; x < width; x++) {
                destArray[index] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .ToHalfFloat */ .LZ)(srcData[index]);
                destArray[index + 1] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .ToHalfFloat */ .LZ)(srcData[index + 1]);
                destArray[index + 2] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .ToHalfFloat */ .LZ)(srcData[index + 2]);
                if (DDSTools.StoreLODInAlphaChannel) {
                    destArray[index + 3] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .ToHalfFloat */ .LZ)(lod);
                }
                else {
                    destArray[index + 3] = (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .ToHalfFloat */ .LZ)(srcData[index + 3]);
                }
                index += 4;
            }
        }
        return destArray;
    }
    static _GetFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {
        const destArray = new Uint8Array(dataLength);
        const srcData = new Float32Array(arrayBuffer, dataOffset);
        let index = 0;
        for (let y = 0; y < height; y++) {
            for (let x = 0; x < width; x++) {
                const srcPos = (x + y * width) * 4;
                destArray[index] = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)(srcData[srcPos]) * 255;
                destArray[index + 1] = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)(srcData[srcPos + 1]) * 255;
                destArray[index + 2] = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)(srcData[srcPos + 2]) * 255;
                if (DDSTools.StoreLODInAlphaChannel) {
                    destArray[index + 3] = lod;
                }
                else {
                    destArray[index + 3] = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)(srcData[srcPos + 3]) * 255;
                }
                index += 4;
            }
        }
        return destArray;
    }
    static _GetHalfFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, lod) {
        const destArray = new Uint8Array(dataLength);
        const srcData = new Uint16Array(arrayBuffer, dataOffset);
        let index = 0;
        for (let y = 0; y < height; y++) {
            for (let x = 0; x < width; x++) {
                const srcPos = (x + y * width) * 4;
                destArray[index] = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)((0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .FromHalfFloat */ .SX)(srcData[srcPos])) * 255;
                destArray[index + 1] = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)((0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .FromHalfFloat */ .SX)(srcData[srcPos + 1])) * 255;
                destArray[index + 2] = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)((0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .FromHalfFloat */ .SX)(srcData[srcPos + 2])) * 255;
                if (DDSTools.StoreLODInAlphaChannel) {
                    destArray[index + 3] = lod;
                }
                else {
                    destArray[index + 3] = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_0__.Clamp)((0,_textureTools_js__WEBPACK_IMPORTED_MODULE_3__/* .FromHalfFloat */ .SX)(srcData[srcPos + 3])) * 255;
                }
                index += 4;
            }
        }
        return destArray;
    }
    static _GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset, aOffset) {
        const byteArray = new Uint8Array(dataLength);
        const srcData = new Uint8Array(arrayBuffer, dataOffset);
        let index = 0;
        for (let y = 0; y < height; y++) {
            for (let x = 0; x < width; x++) {
                const srcPos = (x + y * width) * 4;
                byteArray[index] = srcData[srcPos + rOffset];
                byteArray[index + 1] = srcData[srcPos + gOffset];
                byteArray[index + 2] = srcData[srcPos + bOffset];
                byteArray[index + 3] = srcData[srcPos + aOffset];
                index += 4;
            }
        }
        return byteArray;
    }
    static _ExtractLongWordOrder(value) {
        if (value === 0 || value === 255 || value === -16777216) {
            return 0;
        }
        return 1 + DDSTools._ExtractLongWordOrder(value >> 8);
    }
    static _GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset) {
        const byteArray = new Uint8Array(dataLength);
        const srcData = new Uint8Array(arrayBuffer, dataOffset);
        let index = 0;
        for (let y = 0; y < height; y++) {
            for (let x = 0; x < width; x++) {
                const srcPos = (x + y * width) * 3;
                byteArray[index] = srcData[srcPos + rOffset];
                byteArray[index + 1] = srcData[srcPos + gOffset];
                byteArray[index + 2] = srcData[srcPos + bOffset];
                index += 3;
            }
        }
        return byteArray;
    }
    static _GetLuminanceArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer) {
        const byteArray = new Uint8Array(dataLength);
        const srcData = new Uint8Array(arrayBuffer, dataOffset);
        let index = 0;
        for (let y = 0; y < height; y++) {
            for (let x = 0; x < width; x++) {
                const srcPos = x + y * width;
                byteArray[index] = srcData[srcPos];
                index++;
            }
        }
        return byteArray;
    }
    /**
     * Uploads DDS Levels to a Babylon Texture
     * @internal
     */
    static UploadDDSLevels(engine, texture, data, info, loadMipmaps, faces, lodIndex = -1, currentFace, destTypeMustBeFilterable = true) {
        let sphericalPolynomialFaces = null;
        if (info.sphericalPolynomial) {
            sphericalPolynomialFaces = [];
        }
        const ext = !!engine.getCaps().s3tc;
        // TODO WEBGPU Once generateMipMaps is split into generateMipMaps + hasMipMaps in InternalTexture this line can be removed
        texture.generateMipMaps = loadMipmaps;
        const header = new Int32Array(data.buffer, data.byteOffset, headerLengthInt);
        let fourCC, width, height, dataLength = 0, dataOffset;
        let byteArray, mipmapCount, mip;
        let internalCompressedFormat = 0;
        let blockBytes = 1;
        if (header[off_magic] !== DDS_MAGIC) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Invalid magic number in DDS header");
            return;
        }
        if (!info.isFourCC && !info.isRGB && !info.isLuminance) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");
            return;
        }
        if (info.isCompressed && !ext) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Compressed textures are not supported on this platform.");
            return;
        }
        let bpp = header[off_RGBbpp];
        dataOffset = header[off_size] + 4;
        let computeFormats = false;
        if (info.isFourCC) {
            fourCC = header[off_pfFourCC];
            switch (fourCC) {
                case FOURCC_DXT1:
                    blockBytes = 8;
                    internalCompressedFormat = 33777;
                    break;
                case FOURCC_DXT3:
                    blockBytes = 16;
                    internalCompressedFormat = 33778;
                    break;
                case FOURCC_DXT5:
                    blockBytes = 16;
                    internalCompressedFormat = 33779;
                    break;
                case FOURCC_D3DFMT_R16G16B16A16F:
                    computeFormats = true;
                    bpp = 64;
                    break;
                case FOURCC_D3DFMT_R32G32B32A32F:
                    computeFormats = true;
                    bpp = 128;
                    break;
                case FOURCC_DX10: {
                    // There is an additionnal header so dataOffset need to be changed
                    dataOffset += 5 * 4; // 5 uints
                    let supported = false;
                    switch (info.dxgiFormat) {
                        case DXGI_FORMAT_R16G16B16A16_FLOAT:
                            computeFormats = true;
                            bpp = 64;
                            supported = true;
                            break;
                        case DXGI_FORMAT_R32G32B32A32_FLOAT:
                            computeFormats = true;
                            bpp = 128;
                            supported = true;
                            break;
                        case DXGI_FORMAT_B8G8R8X8_UNORM:
                            info.isRGB = true;
                            info.isFourCC = false;
                            bpp = 32;
                            supported = true;
                            break;
                    }
                    if (supported) {
                        break;
                    }
                }
                // eslint-disable-next-line no-fallthrough
                default:
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error(["Unsupported FourCC code:", Int32ToFourCC(fourCC)]);
                    return;
            }
        }
        const rOffset = DDSTools._ExtractLongWordOrder(header[off_RMask]);
        const gOffset = DDSTools._ExtractLongWordOrder(header[off_GMask]);
        const bOffset = DDSTools._ExtractLongWordOrder(header[off_BMask]);
        const aOffset = DDSTools._ExtractLongWordOrder(header[off_AMask]);
        if (computeFormats) {
            internalCompressedFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
        }
        mipmapCount = 1;
        if (header[off_flags] & DDSD_MIPMAPCOUNT && loadMipmaps !== false) {
            mipmapCount = Math.max(1, header[off_mipmapCount]);
        }
        const startFace = currentFace || 0;
        const caps = engine.getCaps();
        for (let face = startFace; face < faces; face++) {
            width = header[off_width];
            height = header[off_height];
            for (mip = 0; mip < mipmapCount; ++mip) {
                if (lodIndex === -1 || lodIndex === mip) {
                    // In case of fixed LOD, if the lod has just been uploaded, early exit.
                    const i = lodIndex === -1 ? mip : 0;
                    if (!info.isCompressed && info.isFourCC) {
                        texture.format = 5;
                        dataLength = width * height * 4;
                        let floatArray = null;
                        if (engine._badOS || engine._badDesktopOS || (!caps.textureHalfFloat && !caps.textureFloat)) {
                            // Required because iOS has many issues with float and half float generation
                            if (bpp === 128) {
                                floatArray = DDSTools._GetFloatAsUIntRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i);
                                if (sphericalPolynomialFaces && i == 0) {
                                    sphericalPolynomialFaces.push(DDSTools._GetFloatRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i));
                                }
                            }
                            else if (bpp === 64) {
                                floatArray = DDSTools._GetHalfFloatAsUIntRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i);
                                if (sphericalPolynomialFaces && i == 0) {
                                    sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i));
                                }
                            }
                            texture.type = 0;
                        }
                        else {
                            const floatAvailable = caps.textureFloat && ((destTypeMustBeFilterable && caps.textureFloatLinearFiltering) || !destTypeMustBeFilterable);
                            const halfFloatAvailable = caps.textureHalfFloat && ((destTypeMustBeFilterable && caps.textureHalfFloatLinearFiltering) || !destTypeMustBeFilterable);
                            const destType = (bpp === 128 || (bpp === 64 && !halfFloatAvailable)) && floatAvailable
                                ? 1
                                : (bpp === 64 || (bpp === 128 && !floatAvailable)) && halfFloatAvailable
                                    ? 2
                                    : 0;
                            let dataGetter;
                            let dataGetterPolynomial = null;
                            switch (bpp) {
                                case 128: {
                                    switch (destType) {
                                        case 1:
                                            dataGetter = DDSTools._GetFloatRGBAArrayBuffer;
                                            dataGetterPolynomial = null;
                                            break;
                                        case 2:
                                            dataGetter = DDSTools._GetFloatAsHalfFloatRGBAArrayBuffer;
                                            dataGetterPolynomial = DDSTools._GetFloatRGBAArrayBuffer;
                                            break;
                                        case 0:
                                            dataGetter = DDSTools._GetFloatAsUIntRGBAArrayBuffer;
                                            dataGetterPolynomial = DDSTools._GetFloatRGBAArrayBuffer;
                                            break;
                                    }
                                    break;
                                }
                                default: {
                                    // 64 bpp
                                    switch (destType) {
                                        case 1:
                                            dataGetter = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer;
                                            dataGetterPolynomial = null;
                                            break;
                                        case 2:
                                            dataGetter = DDSTools._GetHalfFloatRGBAArrayBuffer;
                                            dataGetterPolynomial = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer;
                                            break;
                                        case 0:
                                            dataGetter = DDSTools._GetHalfFloatAsUIntRGBAArrayBuffer;
                                            dataGetterPolynomial = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer;
                                            break;
                                    }
                                    break;
                                }
                            }
                            texture.type = destType;
                            floatArray = dataGetter(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i);
                            if (sphericalPolynomialFaces && i == 0) {
                                sphericalPolynomialFaces.push(dataGetterPolynomial ? dataGetterPolynomial(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, i) : floatArray);
                            }
                        }
                        if (floatArray) {
                            engine._uploadDataToTextureDirectly(texture, floatArray, face, i);
                        }
                    }
                    else if (info.isRGB) {
                        texture.type = 0;
                        if (bpp === 24) {
                            texture.format = 4;
                            dataLength = width * height * 3;
                            byteArray = DDSTools._GetRGBArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, rOffset, gOffset, bOffset);
                            engine._uploadDataToTextureDirectly(texture, byteArray, face, i);
                        }
                        else {
                            // 32
                            texture.format = 5;
                            dataLength = width * height * 4;
                            byteArray = DDSTools._GetRGBAArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer, rOffset, gOffset, bOffset, aOffset);
                            engine._uploadDataToTextureDirectly(texture, byteArray, face, i);
                        }
                    }
                    else if (info.isLuminance) {
                        const unpackAlignment = engine._getUnpackAlignement();
                        const unpaddedRowSize = width;
                        const paddedRowSize = Math.floor((width + unpackAlignment - 1) / unpackAlignment) * unpackAlignment;
                        dataLength = paddedRowSize * (height - 1) + unpaddedRowSize;
                        byteArray = DDSTools._GetLuminanceArrayBuffer(width, height, data.byteOffset + dataOffset, dataLength, data.buffer);
                        texture.format = 1;
                        texture.type = 0;
                        engine._uploadDataToTextureDirectly(texture, byteArray, face, i);
                    }
                    else {
                        dataLength = (((Math.max(4, width) / 4) * Math.max(4, height)) / 4) * blockBytes;
                        byteArray = new Uint8Array(data.buffer, data.byteOffset + dataOffset, dataLength);
                        texture.type = 0;
                        engine._uploadCompressedDataToTextureDirectly(texture, internalCompressedFormat, width, height, byteArray, face, i);
                    }
                }
                dataOffset += bpp ? width * height * (bpp / 8) : dataLength;
                width *= 0.5;
                height *= 0.5;
                width = Math.max(1.0, width);
                height = Math.max(1.0, height);
            }
            if (currentFace !== undefined) {
                // Loading a single face
                break;
            }
        }
        if (sphericalPolynomialFaces && sphericalPolynomialFaces.length > 0) {
            info.sphericalPolynomial = _Misc_HighDynamicRange_cubemapToSphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_2__/* .CubeMapToSphericalPolynomialTools */ .d.ConvertCubeMapToSphericalPolynomial({
                size: header[off_width],
                right: sphericalPolynomialFaces[0],
                left: sphericalPolynomialFaces[1],
                up: sphericalPolynomialFaces[2],
                down: sphericalPolynomialFaces[3],
                front: sphericalPolynomialFaces[4],
                back: sphericalPolynomialFaces[5],
                format: 5,
                type: 1,
                gammaSpace: false,
            });
        }
        else {
            info.sphericalPolynomial = undefined;
        }
    }
}
/**
 * Gets or sets a boolean indicating that LOD info is stored in alpha channel (false by default)
 */
DDSTools.StoreLODInAlphaChannel = false;
//# sourceMappingURL=dds.js.map

/***/ }),

/***/ 86080:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ GetDirectStore),
/* harmony export */   K: () => (/* binding */ GetMergedStore)
/* harmony export */ });
// eslint-disable-next-line @typescript-eslint/naming-convention
const __mergedStore = {};
// eslint-disable-next-line @typescript-eslint/naming-convention
const __decoratorInitialStore = {};
/** @internal */
function GetDirectStore(target) {
    const classKey = target.getClassName();
    if (!__decoratorInitialStore[classKey]) {
        __decoratorInitialStore[classKey] = {};
    }
    return __decoratorInitialStore[classKey];
}
/**
 * @returns the list of properties flagged as serializable
 * @param target host object
 */
function GetMergedStore(target) {
    const classKey = target.getClassName();
    if (__mergedStore[classKey]) {
        return __mergedStore[classKey];
    }
    __mergedStore[classKey] = {};
    const store = __mergedStore[classKey];
    let currentTarget = target;
    let currentKey = classKey;
    while (currentKey) {
        const initialStore = __decoratorInitialStore[currentKey];
        for (const property in initialStore) {
            store[property] = initialStore[property];
        }
        let parent;
        let done = false;
        do {
            parent = Object.getPrototypeOf(currentTarget);
            if (!parent.getClassName) {
                done = true;
                break;
            }
            if (parent.getClassName() !== currentKey) {
                break;
            }
            currentTarget = parent;
        } while (parent);
        if (done) {
            break;
        }
        currentKey = parent.getClassName();
        currentTarget = parent;
    }
    return store;
}
//# sourceMappingURL=decorators.functions.js.map

/***/ }),

/***/ 79259:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $z: () => (/* binding */ expandToProperty),
/* harmony export */   Cx: () => (/* binding */ nativeOverride),
/* harmony export */   GG: () => (/* binding */ serializeAsMatrix),
/* harmony export */   P_: () => (/* binding */ serializeAsVector3),
/* harmony export */   WM: () => (/* binding */ serializeAsVector2),
/* harmony export */   Y9: () => (/* binding */ serializeAsFresnelParameters),
/* harmony export */   bR: () => (/* binding */ serializeAsQuaternion),
/* harmony export */   fW: () => (/* binding */ serializeAsCameraReference),
/* harmony export */   jT: () => (/* binding */ serializeAsColor3),
/* harmony export */   lK: () => (/* binding */ serialize),
/* harmony export */   n1: () => (/* binding */ serializeAsImageProcessingConfiguration),
/* harmony export */   qK: () => (/* binding */ serializeAsColor4),
/* harmony export */   uM: () => (/* binding */ serializeAsTexture),
/* harmony export */   wL: () => (/* binding */ serializeAsColorCurves),
/* harmony export */   xG: () => (/* binding */ serializeAsMeshReference)
/* harmony export */ });
/* harmony import */ var _decorators_functions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86080);

function generateSerializableMember(type, sourceName) {
    return (target, propertyKey) => {
        const classStore = (0,_decorators_functions_js__WEBPACK_IMPORTED_MODULE_0__/* .GetDirectStore */ .B)(target);
        if (!classStore[propertyKey]) {
            classStore[propertyKey] = { type: type, sourceName: sourceName };
        }
    };
}
function generateExpandMember(setCallback, targetKey = null) {
    return (target, propertyKey) => {
        const key = targetKey || "_" + propertyKey;
        Object.defineProperty(target, propertyKey, {
            get: function () {
                return this[key];
            },
            set: function (value) {
                // does this object (i.e. vector3) has an equals function? use it!
                // Note - not using "with epsilon" here, it is expected te behave like the internal cache does.
                if (typeof this.equals === "function") {
                    if (this.equals(value)) {
                        return;
                    }
                }
                if (this[key] === value) {
                    return;
                }
                this[key] = value;
                target[setCallback].apply(this);
            },
            enumerable: true,
            configurable: true,
        });
    };
}
function expandToProperty(callback, targetKey = null) {
    return generateExpandMember(callback, targetKey);
}
function serialize(sourceName) {
    return generateSerializableMember(0, sourceName); // value member
}
function serializeAsTexture(sourceName) {
    return generateSerializableMember(1, sourceName); // texture member
}
function serializeAsColor3(sourceName) {
    return generateSerializableMember(2, sourceName); // color3 member
}
function serializeAsFresnelParameters(sourceName) {
    return generateSerializableMember(3, sourceName); // fresnel parameters member
}
function serializeAsVector2(sourceName) {
    return generateSerializableMember(4, sourceName); // vector2 member
}
function serializeAsVector3(sourceName) {
    return generateSerializableMember(5, sourceName); // vector3 member
}
function serializeAsMeshReference(sourceName) {
    return generateSerializableMember(6, sourceName); // mesh reference member
}
function serializeAsColorCurves(sourceName) {
    return generateSerializableMember(7, sourceName); // color curves
}
function serializeAsColor4(sourceName) {
    return generateSerializableMember(8, sourceName); // color 4
}
function serializeAsImageProcessingConfiguration(sourceName) {
    return generateSerializableMember(9, sourceName); // image processing
}
function serializeAsQuaternion(sourceName) {
    return generateSerializableMember(10, sourceName); // quaternion member
}
function serializeAsMatrix(sourceName) {
    return generateSerializableMember(12, sourceName); // matrix member
}
/**
 * Decorator used to define property that can be serialized as reference to a camera
 * @param sourceName defines the name of the property to decorate
 * @returns Property Decorator
 */
function serializeAsCameraReference(sourceName) {
    return generateSerializableMember(11, sourceName); // camera reference member
}
/**
 * Decorator used to redirect a function to a native implementation if available.
 * @internal
 */
function nativeOverride(target, propertyKey, descriptor, predicate) {
    // Cache the original JS function for later.
    const jsFunc = descriptor.value;
    // Override the JS function to check for a native override on first invocation. Setting descriptor.value overrides the function at the early stage of code being loaded/imported.
    descriptor.value = (...params) => {
        // Assume the resolved function will be the original JS function, then we will check for the Babylon Native context.
        let func = jsFunc;
        // Check if we are executing in a Babylon Native context (e.g. check the presence of the _native global property) and if so also check if a function override is available.
        if (typeof _native !== "undefined" && _native[propertyKey]) {
            const nativeFunc = _native[propertyKey];
            // If a predicate was provided, then we'll need to invoke the predicate on each invocation of the underlying function to determine whether to call the native function or the JS function.
            if (predicate) {
                // The resolved function will execute the predicate and then either execute the native function or the JS function.
                func = (...params) => (predicate(...params) ? nativeFunc(...params) : jsFunc(...params));
            }
            else {
                // The resolved function will directly execute the native function.
                func = nativeFunc;
            }
        }
        // Override the JS function again with the final resolved target function.
        target[propertyKey] = func;
        // The JS function has now been overridden based on whether we're executing in the context of Babylon Native, but we still need to invoke that function.
        // Future invocations of the function will just directly invoke the final overridden function, not any of the decorator setup logic above.
        return func(...params);
    };
}
/**
 * Decorator factory that applies the nativeOverride decorator, but determines whether to redirect to the native implementation based on a filter function that evaluates the function arguments.
 * @param predicate
 * @example @nativeOverride.filter((...[arg1]: Parameters<typeof someClass.someMethod>) => arg1.length > 20)
 *          public someMethod(arg1: string, arg2: number): string {
 * @internal
 */
nativeOverride.filter = function (predicate) {
    return (target, propertyKey, descriptor) => nativeOverride(target, propertyKey, descriptor, predicate);
};
//# sourceMappingURL=decorators.js.map

/***/ }),

/***/ 26877:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   p: () => (/* binding */ SerializationHelper)
/* harmony export */ });
/* harmony import */ var _devTools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45503);
/* harmony import */ var _tags_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27152);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26041);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _decorators_functions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(86080);





const _copySource = function (creationFunction, source, instanciate, options = {}) {
    const destination = creationFunction();
    // Tags
    if (_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y && _tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y.HasTags(source)) {
        _tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y.AddTagsTo(destination, _tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y.GetTags(source, true));
    }
    const classStore = (0,_decorators_functions_js__WEBPACK_IMPORTED_MODULE_4__/* .GetMergedStore */ .K)(destination);
    // Map from source texture uniqueId to destination texture
    const textureMap = {};
    // Properties
    for (const property in classStore) {
        const propertyDescriptor = classStore[property];
        const sourceProperty = source[property];
        const propertyType = propertyDescriptor.type;
        if (sourceProperty !== undefined && sourceProperty !== null && (property !== "uniqueId" || SerializationHelper.AllowLoadingUniqueId)) {
            switch (propertyType) {
                case 0: // Value
                case 6: // Mesh reference
                case 11: // Camera reference
                    destination[property] = sourceProperty;
                    break;
                case 1: // Texture
                    if (options.cloneTexturesOnlyOnce && textureMap[sourceProperty.uniqueId]) {
                        destination[property] = textureMap[sourceProperty.uniqueId];
                    }
                    else {
                        destination[property] = instanciate || sourceProperty.isRenderTarget ? sourceProperty : sourceProperty.clone();
                        textureMap[sourceProperty.uniqueId] = destination[property];
                    }
                    break;
                case 2: // Color3
                case 3: // FresnelParameters
                case 4: // Vector2
                case 5: // Vector3
                case 7: // Color Curves
                case 10: // Quaternion
                case 12: // Matrix
                    destination[property] = instanciate ? sourceProperty : sourceProperty.clone();
                    break;
            }
        }
    }
    return destination;
};
/**
 * Class used to help serialization objects
 */
class SerializationHelper {
    /**
     * Appends the serialized animations from the source animations
     * @param source Source containing the animations
     * @param destination Target to store the animations
     */
    static AppendSerializedAnimations(source, destination) {
        if (source.animations) {
            destination.animations = [];
            for (let animationIndex = 0; animationIndex < source.animations.length; animationIndex++) {
                const animation = source.animations[animationIndex];
                destination.animations.push(animation.serialize());
            }
        }
    }
    /**
     * Static function used to serialized a specific entity
     * @param entity defines the entity to serialize
     * @param serializationObject defines the optional target object where serialization data will be stored
     * @returns a JSON compatible object representing the serialization of the entity
     */
    static Serialize(entity, serializationObject) {
        if (!serializationObject) {
            serializationObject = {};
        }
        // Tags
        if (_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y) {
            serializationObject.tags = _tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y.GetTags(entity);
        }
        const serializedProperties = (0,_decorators_functions_js__WEBPACK_IMPORTED_MODULE_4__/* .GetMergedStore */ .K)(entity);
        // Properties
        for (const property in serializedProperties) {
            const propertyDescriptor = serializedProperties[property];
            const targetPropertyName = propertyDescriptor.sourceName || property;
            const propertyType = propertyDescriptor.type;
            const sourceProperty = entity[property];
            if (sourceProperty !== undefined && sourceProperty !== null && (property !== "uniqueId" || SerializationHelper.AllowLoadingUniqueId)) {
                switch (propertyType) {
                    case 0: // Value
                        serializationObject[targetPropertyName] = sourceProperty;
                        break;
                    case 1: // Texture
                        serializationObject[targetPropertyName] = sourceProperty.serialize();
                        break;
                    case 2: // Color3
                        serializationObject[targetPropertyName] = sourceProperty.asArray();
                        break;
                    case 3: // FresnelParameters
                        serializationObject[targetPropertyName] = sourceProperty.serialize();
                        break;
                    case 4: // Vector2
                        serializationObject[targetPropertyName] = sourceProperty.asArray();
                        break;
                    case 5: // Vector3
                        serializationObject[targetPropertyName] = sourceProperty.asArray();
                        break;
                    case 6: // Mesh reference
                        serializationObject[targetPropertyName] = sourceProperty.id;
                        break;
                    case 7: // Color Curves
                        serializationObject[targetPropertyName] = sourceProperty.serialize();
                        break;
                    case 8: // Color 4
                        serializationObject[targetPropertyName] = sourceProperty.asArray();
                        break;
                    case 9: // Image Processing
                        serializationObject[targetPropertyName] = sourceProperty.serialize();
                        break;
                    case 10: // Quaternion
                        serializationObject[targetPropertyName] = sourceProperty.asArray();
                        break;
                    case 11: // Camera reference
                        serializationObject[targetPropertyName] = sourceProperty.id;
                        break;
                    case 12: // Matrix
                        serializationObject[targetPropertyName] = sourceProperty.asArray();
                        break;
                }
            }
        }
        return serializationObject;
    }
    /**
     * Given a source json and a destination object in a scene, this function will parse the source and will try to apply its content to the destination object
     * @param source the source json data
     * @param destination the destination object
     * @param scene the scene where the object is
     * @param rootUrl root url to use to load assets
     */
    static ParseProperties(source, destination, scene, rootUrl) {
        if (!rootUrl) {
            rootUrl = "";
        }
        const classStore = (0,_decorators_functions_js__WEBPACK_IMPORTED_MODULE_4__/* .GetMergedStore */ .K)(destination);
        // Properties
        for (const property in classStore) {
            const propertyDescriptor = classStore[property];
            const sourceProperty = source[propertyDescriptor.sourceName || property];
            const propertyType = propertyDescriptor.type;
            if (sourceProperty !== undefined && sourceProperty !== null && (property !== "uniqueId" || SerializationHelper.AllowLoadingUniqueId)) {
                const dest = destination;
                switch (propertyType) {
                    case 0: // Value
                        dest[property] = sourceProperty;
                        break;
                    case 1: // Texture
                        if (scene) {
                            dest[property] = SerializationHelper._TextureParser(sourceProperty, scene, rootUrl);
                        }
                        break;
                    case 2: // Color3
                        dest[property] = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color3 */ .v9.FromArray(sourceProperty);
                        break;
                    case 3: // FresnelParameters
                        dest[property] = SerializationHelper._FresnelParametersParser(sourceProperty);
                        break;
                    case 4: // Vector2
                        dest[property] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2 */ .I9.FromArray(sourceProperty);
                        break;
                    case 5: // Vector3
                        dest[property] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector3 */ .Pq.FromArray(sourceProperty);
                        break;
                    case 6: // Mesh reference
                        if (scene) {
                            dest[property] = scene.getLastMeshById(sourceProperty);
                        }
                        break;
                    case 7: // Color Curves
                        dest[property] = SerializationHelper._ColorCurvesParser(sourceProperty);
                        break;
                    case 8: // Color 4
                        dest[property] = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_2__/* .Color4 */ .ov.FromArray(sourceProperty);
                        break;
                    case 9: // Image Processing
                        dest[property] = SerializationHelper._ImageProcessingConfigurationParser(sourceProperty);
                        break;
                    case 10: // Quaternion
                        dest[property] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Quaternion */ .PT.FromArray(sourceProperty);
                        break;
                    case 11: // Camera reference
                        if (scene) {
                            dest[property] = scene.getCameraById(sourceProperty);
                        }
                        break;
                    case 12: // Matrix
                        dest[property] = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.FromArray(sourceProperty);
                        break;
                }
            }
        }
    }
    /**
     * Creates a new entity from a serialization data object
     * @param creationFunction defines a function used to instanciated the new entity
     * @param source defines the source serialization data
     * @param scene defines the hosting scene
     * @param rootUrl defines the root url for resources
     * @returns a new entity
     */
    static Parse(creationFunction, source, scene, rootUrl = null) {
        const destination = creationFunction();
        // Tags
        if (_tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y) {
            _tags_js__WEBPACK_IMPORTED_MODULE_1__/* .Tags */ .Y.AddTagsTo(destination, source.tags);
        }
        SerializationHelper.ParseProperties(source, destination, scene, rootUrl);
        return destination;
    }
    /**
     * Clones an object
     * @param creationFunction defines the function used to instanciate the new object
     * @param source defines the source object
     * @param options defines the options to use
     * @returns the cloned object
     */
    static Clone(creationFunction, source, options = {}) {
        return _copySource(creationFunction, source, false, options);
    }
    /**
     * Instanciates a new object based on a source one (some data will be shared between both object)
     * @param creationFunction defines the function used to instanciate the new object
     * @param source defines the source object
     * @returns the new object
     */
    static Instanciate(creationFunction, source) {
        return _copySource(creationFunction, source, true);
    }
}
/**
 * Gets or sets a boolean to indicate if the UniqueId property should be serialized
 */
SerializationHelper.AllowLoadingUniqueId = false;
/**
 * @internal
 */
SerializationHelper._ImageProcessingConfigurationParser = (sourceProperty) => {
    throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_0__/* ._WarnImport */ .n)("ImageProcessingConfiguration");
};
/**
 * @internal
 */
SerializationHelper._FresnelParametersParser = (sourceProperty) => {
    throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_0__/* ._WarnImport */ .n)("FresnelParameters");
};
/**
 * @internal
 */
SerializationHelper._ColorCurvesParser = (sourceProperty) => {
    throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_0__/* ._WarnImport */ .n)("ColorCurves");
};
/**
 * @internal
 */
SerializationHelper._TextureParser = (sourceProperty, scene, rootUrl) => {
    throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_0__/* ._WarnImport */ .n)("Texture");
};
//# sourceMappingURL=decorators.serialization.js.map

/***/ }),

/***/ 74609:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   r: () => (/* binding */ DeepCopier)
/* harmony export */ });
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);

const CloneValue = (source, destinationObject, shallowCopyValues) => {
    if (!source) {
        return null;
    }
    if (source.getClassName && source.getClassName() === "Mesh") {
        return null;
    }
    if (source.getClassName && (source.getClassName() === "SubMesh" || source.getClassName() === "PhysicsBody")) {
        return source.clone(destinationObject);
    }
    else if (source.clone) {
        return source.clone();
    }
    else if (Array.isArray(source)) {
        return source.slice();
    }
    else if (shallowCopyValues && typeof source === "object") {
        return { ...source };
    }
    return null;
};
function GetAllPropertyNames(obj) {
    const props = [];
    do {
        Object.getOwnPropertyNames(obj).forEach(function (prop) {
            if (props.indexOf(prop) === -1) {
                props.push(prop);
            }
        });
    } while ((obj = Object.getPrototypeOf(obj)));
    return props;
}
/**
 * Class containing a set of static utilities functions for deep copy.
 */
class DeepCopier {
    /**
     * Tries to copy an object by duplicating every property
     * @param source defines the source object
     * @param destination defines the target object
     * @param doNotCopyList defines a list of properties to avoid
     * @param mustCopyList defines a list of properties to copy (even if they start with _)
     * @param shallowCopyValues defines wether properties referencing objects (none cloneable) must be shallow copied (false by default)
     * @remarks shallowCopyValues will not instantite the copied values which makes it only usable for "JSON objects"
     */
    static DeepCopy(source, destination, doNotCopyList, mustCopyList, shallowCopyValues = false) {
        const properties = GetAllPropertyNames(source);
        for (const prop of properties) {
            if (prop[0] === "_" && (!mustCopyList || mustCopyList.indexOf(prop) === -1)) {
                continue;
            }
            if (prop.endsWith("Observable")) {
                continue;
            }
            if (doNotCopyList && doNotCopyList.indexOf(prop) !== -1) {
                continue;
            }
            const sourceValue = source[prop];
            const typeOfSourceValue = typeof sourceValue;
            if (typeOfSourceValue === "function") {
                continue;
            }
            try {
                if (typeOfSourceValue === "object") {
                    if (sourceValue instanceof Uint8Array) {
                        destination[prop] = Uint8Array.from(sourceValue);
                    }
                    else if (sourceValue instanceof Array) {
                        destination[prop] = [];
                        if (sourceValue.length > 0) {
                            if (typeof sourceValue[0] == "object") {
                                for (let index = 0; index < sourceValue.length; index++) {
                                    const clonedValue = CloneValue(sourceValue[index], destination, shallowCopyValues);
                                    if (destination[prop].indexOf(clonedValue) === -1) {
                                        // Test if auto inject was not done
                                        destination[prop].push(clonedValue);
                                    }
                                }
                            }
                            else {
                                destination[prop] = sourceValue.slice(0);
                            }
                        }
                    }
                    else {
                        destination[prop] = CloneValue(sourceValue, destination, shallowCopyValues);
                    }
                }
                else {
                    destination[prop] = sourceValue;
                }
            }
            catch (e) {
                // Log a warning (it could be because of a read-only property)
                _logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(e.message);
            }
        }
    }
}
//# sourceMappingURL=deepCopier.js.map

/***/ }),

/***/ 39018:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   c: () => (/* binding */ Deferred)
/* harmony export */ });
/**
 * Wrapper class for promise with external resolve and reject.
 */
class Deferred {
    /**
     * The resolve method of the promise associated with this deferred object.
     */
    get resolve() {
        return this._resolve;
    }
    /**
     * The reject method of the promise associated with this deferred object.
     */
    get reject() {
        return this._reject;
    }
    /**
     * Constructor for this deferred object.
     */
    constructor() {
        this.promise = new Promise((resolve, reject) => {
            this._resolve = resolve;
            this._reject = reject;
        });
    }
}
//# sourceMappingURL=deferred.js.map

/***/ }),

/***/ 45503:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   n: () => (/* binding */ _WarnImport)
/* harmony export */ });
const warnedMap = {};
/**
 * @internal
 */
function _WarnImport(name, warnOnce = false) {
    if (warnOnce && warnedMap[name]) {
        return;
    }
    warnedMap[name] = true;
    return `${name} needs to be imported before as it contains a side-effect required by your code.`;
}
//# sourceMappingURL=devTools.js.map

/***/ }),

/***/ 18790:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Az: () => (/* binding */ DomManagement),
/* harmony export */   BA: () => (/* binding */ IsWindowObjectExist),
/* harmony export */   Nf: () => (/* binding */ IsDocumentAvailable),
/* harmony export */   XD: () => (/* binding */ IsNavigatorAvailable),
/* harmony export */   Zl: () => (/* binding */ GetDOMTextContent)
/* harmony export */ });
/* eslint-disable @typescript-eslint/naming-convention */
/**
 * Checks if the window object exists
 * @returns true if the window object exists
 */
function IsWindowObjectExist() {
    return typeof window !== "undefined";
}
/**
 * Checks if the navigator object exists
 * @returns true if the navigator object exists
 */
function IsNavigatorAvailable() {
    return typeof navigator !== "undefined";
}
/**
 * Check if the document object exists
 * @returns true if the document object exists
 */
function IsDocumentAvailable() {
    return typeof document !== "undefined";
}
/**
 * Extracts text content from a DOM element hierarchy
 * @param element defines the root element
 * @returns a string
 */
function GetDOMTextContent(element) {
    let result = "";
    let child = element.firstChild;
    while (child) {
        if (child.nodeType === 3) {
            result += child.textContent;
        }
        child = child.nextSibling;
    }
    return result;
}
/**
 * Sets of helpers dealing with the DOM and some of the recurrent functions needed in
 * Babylon.js
 */
const DomManagement = {
    /**
     * Checks if the window object exists
     * @returns true if the window object exists
     */
    IsWindowObjectExist,
    /**
     * Checks if the navigator object exists
     * @returns true if the navigator object exists
     */
    IsNavigatorAvailable,
    /**
     * Check if the document object exists
     * @returns true if the document object exists
     */
    IsDocumentAvailable,
    /**
     * Extracts text content from a DOM element hierarchy
     * @param element defines the root element
     * @returns a string
     */
    GetDOMTextContent,
};
//# sourceMappingURL=domManagement.js.map

/***/ }),

/***/ 89928:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Dispose: () => (/* binding */ Dispose),
/* harmony export */   DumpData: () => (/* binding */ DumpData),
/* harmony export */   DumpDataAsync: () => (/* binding */ DumpDataAsync),
/* harmony export */   DumpFramebuffer: () => (/* binding */ DumpFramebuffer),
/* harmony export */   DumpTools: () => (/* binding */ DumpTools)
/* harmony export */ });
/* harmony import */ var _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(84255);
/* harmony import */ var _tools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(998);
/* harmony import */ var _Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84867);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6315);





let _dumpToolsEngine;
let _enginePromise = null;
async function _CreateDumpRenderer() {
    if (!_enginePromise) {
        _enginePromise = new Promise((resolve, reject) => {
            let canvas;
            let engine = null;
            const options = {
                preserveDrawingBuffer: true,
                depth: false,
                stencil: false,
                alpha: true,
                premultipliedAlpha: false,
                antialias: false,
                failIfMajorPerformanceCaveat: false,
            };
            Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 86514))
                .then(({ ThinEngine: thinEngineClass }) => {
                try {
                    canvas = new OffscreenCanvas(100, 100); // will be resized later
                    engine = new thinEngineClass(canvas, false, options);
                }
                catch (e) {
                    // The browser either does not support OffscreenCanvas or WebGL context in OffscreenCanvas, fallback on a regular canvas
                    canvas = document.createElement("canvas");
                    engine = new thinEngineClass(canvas, false, options);
                }
                // remove this engine from the list of instances to avoid using it for other purposes
                _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore */ .q.Instances.pop();
                // However, make sure to dispose it when no other engines are left
                _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore */ .q.OnEnginesDisposedObservable.add((e) => {
                    // guaranteed to run when no other instances are left
                    // only dispose if it's not the current engine
                    if (engine && e !== engine && !engine.isDisposed && _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_3__/* .EngineStore */ .q.Instances.length === 0) {
                        // Dump the engine and the associated resources
                        Dispose();
                    }
                });
                engine.getCaps().parallelShaderCompile = undefined;
                const renderer = new _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_0__/* .EffectRenderer */ .J(engine);
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79820)).then(({ passPixelShader }) => {
                    if (!engine) {
                        reject("Engine is not defined");
                        return;
                    }
                    const wrapper = new _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_0__/* .EffectWrapper */ .$({
                        engine,
                        name: passPixelShader.name,
                        fragmentShader: passPixelShader.shader,
                        samplerNames: ["textureSampler"],
                    });
                    _dumpToolsEngine = {
                        canvas,
                        engine,
                        renderer,
                        wrapper,
                    };
                    resolve(_dumpToolsEngine);
                });
            })
                .catch(reject);
        });
    }
    return await _enginePromise;
}
/**
 * Dumps the current bound framebuffer
 * @param width defines the rendering width
 * @param height defines the rendering height
 * @param engine defines the hosting engine
 * @param successCallback defines the callback triggered once the data are available
 * @param mimeType defines the mime type of the result
 * @param fileName defines the filename to download. If present, the result will automatically be downloaded
 * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
 * @returns a void promise
 */
async function DumpFramebuffer(width, height, engine, successCallback, mimeType = "image/png", fileName, quality) {
    // Read the contents of the framebuffer
    const bufferView = await engine.readPixels(0, 0, width, height);
    const data = new Uint8Array(bufferView.buffer);
    DumpData(width, height, data, successCallback, mimeType, fileName, true, undefined, quality);
}
/**
 * Dumps an array buffer
 * @param width defines the rendering width
 * @param height defines the rendering height
 * @param data the data array
 * @param mimeType defines the mime type of the result
 * @param fileName defines the filename to download. If present, the result will automatically be downloaded
 * @param invertY true to invert the picture in the Y dimension
 * @param toArrayBuffer true to convert the data to an ArrayBuffer (encoded as `mimeType`) instead of a base64 string
 * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
 * @returns a promise that resolve to the final data
 */
function DumpDataAsync(width, height, data, mimeType = "image/png", fileName, invertY = false, toArrayBuffer = false, quality) {
    return new Promise((resolve) => {
        DumpData(width, height, data, (result) => resolve(result), mimeType, fileName, invertY, toArrayBuffer, quality);
    });
}
/**
 * Dumps an array buffer
 * @param width defines the rendering width
 * @param height defines the rendering height
 * @param data the data array
 * @param successCallback defines the callback triggered once the data are available
 * @param mimeType defines the mime type of the result
 * @param fileName defines the filename to download. If present, the result will automatically be downloaded
 * @param invertY true to invert the picture in the Y dimension
 * @param toArrayBuffer true to convert the data to an ArrayBuffer (encoded as `mimeType`) instead of a base64 string
 * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
 */
function DumpData(width, height, data, successCallback, mimeType = "image/png", fileName, invertY = false, toArrayBuffer = false, quality) {
    _CreateDumpRenderer().then((renderer) => {
        renderer.engine.setSize(width, height, true);
        // Convert if data are float32
        if (data instanceof Float32Array) {
            const data2 = new Uint8Array(data.length);
            let n = data.length;
            while (n--) {
                const v = data[n];
                data2[n] = Math.round((0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_2__.Clamp)(v) * 255);
            }
            data = data2;
        }
        // Create the image
        const texture = renderer.engine.createRawTexture(data, width, height, 5, false, !invertY, 1);
        renderer.renderer.setViewport();
        renderer.renderer.applyEffectWrapper(renderer.wrapper);
        renderer.wrapper.effect._bindTexture("textureSampler", texture);
        renderer.renderer.draw();
        if (toArrayBuffer) {
            _tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.ToBlob(renderer.canvas, (blob) => {
                const fileReader = new FileReader();
                fileReader.onload = (event) => {
                    const arrayBuffer = event.target.result;
                    if (successCallback) {
                        successCallback(arrayBuffer);
                    }
                };
                fileReader.readAsArrayBuffer(blob);
            }, mimeType, quality);
        }
        else {
            _tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.EncodeScreenshotCanvasData(renderer.canvas, successCallback, mimeType, fileName, quality);
        }
        texture.dispose();
    });
}
/**
 * Dispose the dump tools associated resources
 */
function Dispose() {
    if (_dumpToolsEngine) {
        _dumpToolsEngine.wrapper.dispose();
        _dumpToolsEngine.renderer.dispose();
        _dumpToolsEngine.engine.dispose();
    }
    else {
        // in cases where the engine is not yet created, we need to wait for it to dispose it
        _enginePromise?.then((dumpToolsEngine) => {
            dumpToolsEngine.wrapper.dispose();
            dumpToolsEngine.renderer.dispose();
            dumpToolsEngine.engine.dispose();
        });
    }
    _enginePromise = null;
    _dumpToolsEngine = null;
}
/**
 * Object containing a set of static utilities functions to dump data from a canvas
 * @deprecated use functions
 */
const DumpTools = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    DumpData,
    // eslint-disable-next-line @typescript-eslint/naming-convention
    DumpDataAsync,
    // eslint-disable-next-line @typescript-eslint/naming-convention
    DumpFramebuffer,
    // eslint-disable-next-line @typescript-eslint/naming-convention
    Dispose,
};
/**
 * This will be executed automatically for UMD and es5.
 * If esm dev wants the side effects to execute they will have to run it manually
 * Once we build native modules those need to be exported.
 * @internal
 */
const initSideEffects = () => {
    // References the dependencies.
    _tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.DumpData = DumpData;
    _tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.DumpDataAsync = DumpDataAsync;
    _tools_js__WEBPACK_IMPORTED_MODULE_1__/* .Tools */ .S0.DumpFramebuffer = DumpFramebuffer;
};
initSideEffects();
//# sourceMappingURL=dumpTools.js.map

/***/ }),

/***/ 32853:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $h: () => (/* binding */ CreateImageDataArrayBufferViews),
/* harmony export */   Hx: () => (/* binding */ CreateEnvTextureAsync),
/* harmony export */   RZ: () => (/* binding */ normalizeEnvInfo),
/* harmony export */   bv: () => (/* binding */ UploadLevelsAsync),
/* harmony export */   cU: () => (/* binding */ GetEnvInfo),
/* harmony export */   gW: () => (/* binding */ _UpdateRGBDAsync),
/* harmony export */   o5: () => (/* binding */ UploadEnvLevelsAsync),
/* harmony export */   ow: () => (/* binding */ UploadEnvSpherical),
/* harmony export */   qY: () => (/* binding */ EnvironmentTextureTools)
/* harmony export */ });
/* harmony import */ var _tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(998);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84867);
/* harmony import */ var _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77517);
/* harmony import */ var _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81194);
/* harmony import */ var _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(56526);
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(87491);
/* harmony import */ var _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(77891);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(51137);
/* harmony import */ var _rgbdTextureTools_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(97126);
/* harmony import */ var _Materials_Textures_baseTexture_polynomial_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(69764);
/* harmony import */ var _Misc_dumpTools_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(89928);













const DefaultEnvironmentTextureImageType = "image/png";
const CurrentVersion = 2;
/**
 * Magic number identifying the env file.
 */
const MagicBytes = [0x86, 0x16, 0x87, 0x96, 0xf6, 0xd6, 0x96, 0x36];
/**
 * Gets the environment info from an env file.
 * @param data The array buffer containing the .env bytes.
 * @returns the environment file info (the json header) if successfully parsed, normalized to the latest supported version.
 */
function GetEnvInfo(data) {
    const dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
    let pos = 0;
    for (let i = 0; i < MagicBytes.length; i++) {
        if (dataView.getUint8(pos++) !== MagicBytes[i]) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_8__/* .Logger */ .V.Error("Not a babylon environment map");
            return null;
        }
    }
    // Read json manifest - collect characters up to null terminator
    let manifestString = "";
    let charCode = 0x00;
    while ((charCode = dataView.getUint8(pos++))) {
        manifestString += String.fromCharCode(charCode);
    }
    let manifest = JSON.parse(manifestString);
    manifest = normalizeEnvInfo(manifest);
    if (manifest.specular) {
        // Extend the header with the position of the payload.
        manifest.specular.specularDataPosition = pos;
        // Fallback to 0.8 exactly if lodGenerationScale is not defined for backward compatibility.
        manifest.specular.lodGenerationScale = manifest.specular.lodGenerationScale || 0.8;
    }
    return manifest;
}
/**
 * Normalizes any supported version of the environment file info to the latest version
 * @param info environment file info on any supported version
 * @returns environment file info in the latest supported version
 * @private
 */
function normalizeEnvInfo(info) {
    if (info.version > CurrentVersion) {
        throw new Error(`Unsupported babylon environment map version "${info.version}". Latest supported version is "${CurrentVersion}".`);
    }
    if (info.version === 2) {
        return info;
    }
    // Migrate a v1 info to v2
    info = { ...info, version: 2, imageType: DefaultEnvironmentTextureImageType };
    return info;
}
/**
 * Creates an environment texture from a loaded cube texture.
 * @param texture defines the cube texture to convert in env file
 * @param options options for the conversion process
 * @param options.imageType the mime type for the encoded images, with support for "image/png" (default) and "image/webp"
 * @param options.imageQuality the image quality of encoded WebP images.
 * @returns a promise containing the environment data if successful.
 */
async function CreateEnvTextureAsync(texture, options = {}) {
    const internalTexture = texture.getInternalTexture();
    if (!internalTexture) {
        return Promise.reject("The cube texture is invalid.");
    }
    const imageType = options.imageType ?? DefaultEnvironmentTextureImageType;
    const engine = internalTexture.getEngine();
    if (texture.textureType !== 2 &&
        texture.textureType !== 1 &&
        texture.textureType !== 0 &&
        texture.textureType !== 0 &&
        texture.textureType !== 7 &&
        texture.textureType !== -1) {
        return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");
    }
    let textureType = 1;
    if (!engine.getCaps().textureFloatRender) {
        textureType = 2;
        if (!engine.getCaps().textureHalfFloatRender) {
            return Promise.reject("Env texture can only be created when the browser supports half float or full float rendering.");
        }
    }
    // sphericalPolynomial is lazy loaded so simply accessing it should trigger the computation.
    texture.sphericalPolynomial;
    // Lets keep track of the polynomial promise so we can wait for it to be ready before generating the pixels.
    const sphericalPolynomialPromise = texture.getInternalTexture()?._sphericalPolynomialPromise;
    const cubeWidth = internalTexture.width;
    const hostingScene = new _scene_js__WEBPACK_IMPORTED_MODULE_6__/* .Scene */ .Z(engine);
    const specularTextures = {};
    // As we are going to readPixels the faces of the cube, make sure the drawing/update commands for the cube texture are fully sent to the GPU in case it is drawn for the first time in this very frame!
    engine.flushFramebuffer();
    // Read and collect all mipmaps data from the cube.
    const mipmapsCount = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_2__.ILog2)(internalTexture.width);
    for (let i = 0; i <= mipmapsCount; i++) {
        const faceWidth = Math.pow(2, mipmapsCount - i);
        // All faces of the cube.
        for (let face = 0; face < 6; face++) {
            let faceData = await texture.readPixels(face, i, undefined, false);
            if (faceData && faceData.byteLength === faceData.length) {
                const faceDataFloat = new Float32Array(faceData.byteLength * 4);
                for (let i = 0; i < faceData.byteLength; i++) {
                    faceDataFloat[i] = faceData[i] / 255;
                    // Gamma to linear
                    faceDataFloat[i] = Math.pow(faceDataFloat[i], 2.2);
                }
                faceData = faceDataFloat;
            }
            else if (faceData && texture.gammaSpace) {
                const floatData = faceData;
                for (let i = 0; i < floatData.length; i++) {
                    // Gamma to linear
                    floatData[i] = Math.pow(floatData[i], 2.2);
                }
            }
            const tempTexture = engine.createRawTexture(faceData, faceWidth, faceWidth, 5, false, true, 1, null, textureType);
            await _rgbdTextureTools_js__WEBPACK_IMPORTED_MODULE_9__/* .RGBDTextureTools */ .G.EncodeTextureToRGBD(tempTexture, hostingScene, textureType);
            const rgbdEncodedData = await engine._readTexturePixels(tempTexture, faceWidth, faceWidth);
            const imageEncodedData = await (0,_Misc_dumpTools_js__WEBPACK_IMPORTED_MODULE_11__.DumpDataAsync)(faceWidth, faceWidth, rgbdEncodedData, imageType, undefined, false, true, options.imageQuality);
            specularTextures[i * 6 + face] = imageEncodedData;
            tempTexture.dispose();
        }
    }
    // We can delete the hosting scene keeping track of all the creation objects
    hostingScene.dispose();
    // Ensure completion of the polynomial creation promise.
    if (sphericalPolynomialPromise) {
        await sphericalPolynomialPromise;
    }
    // Creates the json header for the env texture
    const info = {
        version: CurrentVersion,
        width: cubeWidth,
        imageType,
        irradiance: _CreateEnvTextureIrradiance(texture),
        specular: {
            mipmaps: [],
            lodGenerationScale: texture.lodGenerationScale,
        },
    };
    // Sets the specular image data information
    let position = 0;
    for (let i = 0; i <= mipmapsCount; i++) {
        for (let face = 0; face < 6; face++) {
            const byteLength = specularTextures[i * 6 + face].byteLength;
            info.specular.mipmaps.push({
                length: byteLength,
                position: position,
            });
            position += byteLength;
        }
    }
    // Encode the JSON as an array buffer
    const infoString = JSON.stringify(info);
    const infoBuffer = new ArrayBuffer(infoString.length + 1);
    const infoView = new Uint8Array(infoBuffer); // Limited to ascii subset matching unicode.
    for (let i = 0, strLen = infoString.length; i < strLen; i++) {
        infoView[i] = infoString.charCodeAt(i);
    }
    // Ends up with a null terminator for easier parsing
    infoView[infoString.length] = 0x00;
    // Computes the final required size and creates the storage
    const totalSize = MagicBytes.length + position + infoBuffer.byteLength;
    const finalBuffer = new ArrayBuffer(totalSize);
    const finalBufferView = new Uint8Array(finalBuffer);
    const dataView = new DataView(finalBuffer);
    // Copy the magic bytes identifying the file in
    let pos = 0;
    for (let i = 0; i < MagicBytes.length; i++) {
        dataView.setUint8(pos++, MagicBytes[i]);
    }
    // Add the json info
    finalBufferView.set(new Uint8Array(infoBuffer), pos);
    pos += infoBuffer.byteLength;
    // Finally inserts the texture data
    for (let i = 0; i <= mipmapsCount; i++) {
        for (let face = 0; face < 6; face++) {
            const dataBuffer = specularTextures[i * 6 + face];
            finalBufferView.set(new Uint8Array(dataBuffer), pos);
            pos += dataBuffer.byteLength;
        }
    }
    // Voila
    return finalBuffer;
}
/**
 * Creates a JSON representation of the spherical data.
 * @param texture defines the texture containing the polynomials
 * @returns the JSON representation of the spherical info
 */
function _CreateEnvTextureIrradiance(texture) {
    const polynmials = texture.sphericalPolynomial;
    if (polynmials == null) {
        return null;
    }
    return {
        x: [polynmials.x.x, polynmials.x.y, polynmials.x.z],
        y: [polynmials.y.x, polynmials.y.y, polynmials.y.z],
        z: [polynmials.z.x, polynmials.z.y, polynmials.z.z],
        xx: [polynmials.xx.x, polynmials.xx.y, polynmials.xx.z],
        yy: [polynmials.yy.x, polynmials.yy.y, polynmials.yy.z],
        zz: [polynmials.zz.x, polynmials.zz.y, polynmials.zz.z],
        yz: [polynmials.yz.x, polynmials.yz.y, polynmials.yz.z],
        zx: [polynmials.zx.x, polynmials.zx.y, polynmials.zx.z],
        xy: [polynmials.xy.x, polynmials.xy.y, polynmials.xy.z],
    };
}
/**
 * Creates the ArrayBufferViews used for initializing environment texture image data.
 * @param data the image data
 * @param info parameters that determine what views will be created for accessing the underlying buffer
 * @returns the views described by info providing access to the underlying buffer
 */
function CreateImageDataArrayBufferViews(data, info) {
    info = normalizeEnvInfo(info);
    const specularInfo = info.specular;
    // Double checks the enclosed info
    let mipmapsCount = Math.log2(info.width);
    mipmapsCount = Math.round(mipmapsCount) + 1;
    if (specularInfo.mipmaps.length !== 6 * mipmapsCount) {
        throw new Error(`Unsupported specular mipmaps number "${specularInfo.mipmaps.length}"`);
    }
    const imageData = new Array(mipmapsCount);
    for (let i = 0; i < mipmapsCount; i++) {
        imageData[i] = new Array(6);
        for (let face = 0; face < 6; face++) {
            const imageInfo = specularInfo.mipmaps[i * 6 + face];
            imageData[i][face] = new Uint8Array(data.buffer, data.byteOffset + specularInfo.specularDataPosition + imageInfo.position, imageInfo.length);
        }
    }
    return imageData;
}
/**
 * Uploads the texture info contained in the env file to the GPU.
 * @param texture defines the internal texture to upload to
 * @param data defines the data to load
 * @param info defines the texture info retrieved through the GetEnvInfo method
 * @returns a promise
 */
function UploadEnvLevelsAsync(texture, data, info) {
    info = normalizeEnvInfo(info);
    const specularInfo = info.specular;
    if (!specularInfo) {
        // Nothing else parsed so far
        return Promise.resolve();
    }
    texture._lodGenerationScale = specularInfo.lodGenerationScale;
    const imageData = CreateImageDataArrayBufferViews(data, info);
    return UploadLevelsAsync(texture, imageData, info.imageType);
}
function _OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture) {
    return new Promise((resolve, reject) => {
        if (expandTexture) {
            const tempTexture = engine.createTexture(null, true, true, null, 1, null, (message) => {
                reject(message);
            }, image);
            rgbdPostProcess?.onEffectCreatedObservable.addOnce((effect) => {
                effect.executeWhenCompiled(() => {
                    // Uncompress the data to a RTT
                    rgbdPostProcess.externalTextureSamplerBinding = true;
                    rgbdPostProcess.onApply = (effect) => {
                        effect._bindTexture("textureSampler", tempTexture);
                        effect.setFloat2("scale", 1, engine._features.needsInvertingBitmap && image instanceof ImageBitmap ? -1 : 1);
                    };
                    if (!engine.scenes.length) {
                        return;
                    }
                    engine.scenes[0].postProcessManager.directRender([rgbdPostProcess], cubeRtt, true, face, i);
                    // Cleanup
                    engine.restoreDefaultFramebuffer();
                    tempTexture.dispose();
                    URL.revokeObjectURL(url);
                    resolve();
                });
            });
        }
        else {
            engine._uploadImageToTexture(texture, image, face, i);
            // Upload the face to the non lod texture support
            if (generateNonLODTextures) {
                const lodTexture = lodTextures[i];
                if (lodTexture) {
                    engine._uploadImageToTexture(lodTexture._texture, image, face, 0);
                }
            }
            resolve();
        }
    });
}
/**
 * Uploads the levels of image data to the GPU.
 * @param texture defines the internal texture to upload to
 * @param imageData defines the array buffer views of image data [mipmap][face]
 * @param imageType the mime type of the image data
 * @returns a promise
 */
async function UploadLevelsAsync(texture, imageData, imageType = DefaultEnvironmentTextureImageType) {
    if (!_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0.IsExponentOfTwo(texture.width)) {
        throw new Error("Texture size must be a power of two");
    }
    const mipmapsCount = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_2__.ILog2)(texture.width) + 1;
    // Gets everything ready.
    const engine = texture.getEngine();
    let expandTexture = false;
    let generateNonLODTextures = false;
    let rgbdPostProcess = null;
    let cubeRtt = null;
    let lodTextures = null;
    const caps = engine.getCaps();
    texture.format = 5;
    texture.type = 0;
    texture.generateMipMaps = true;
    texture._cachedAnisotropicFilteringLevel = null;
    engine.updateTextureSamplingMode(3, texture);
    // Add extra process if texture lod is not supported
    if (!caps.textureLOD) {
        expandTexture = false;
        generateNonLODTextures = true;
        lodTextures = {};
    }
    // in webgl 1 there are no ways to either render or copy lod level information for float textures.
    else if (!engine._features.supportRenderAndCopyToLodForFloatTextures) {
        expandTexture = false;
    }
    // If half float available we can uncompress the texture
    else if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {
        expandTexture = true;
        texture.type = 2;
    }
    // If full float available we can uncompress the texture
    else if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {
        expandTexture = true;
        texture.type = 1;
    }
    // Expand the texture if possible
    let shaderLanguage = 0 /* ShaderLanguage.GLSL */;
    if (expandTexture) {
        if (engine.isWebGPU) {
            shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 30371));
        }
        else {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 9682));
        }
        // Simply run through the decode PP
        rgbdPostProcess = new _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_7__/* .PostProcess */ .w("rgbdDecode", "rgbdDecode", null, null, 1, null, 3, engine, false, undefined, texture.type, undefined, null, false, undefined, shaderLanguage);
        texture._isRGBD = false;
        texture.invertY = false;
        cubeRtt = engine.createRenderTargetCubeTexture(texture.width, {
            generateDepthBuffer: false,
            generateMipMaps: true,
            generateStencilBuffer: false,
            samplingMode: 3,
            type: texture.type,
            format: 5,
        });
    }
    else {
        texture._isRGBD = true;
        texture.invertY = true;
        // In case of missing support, applies the same patch than DDS files.
        if (generateNonLODTextures) {
            const mipSlices = 3;
            const scale = texture._lodGenerationScale;
            const offset = texture._lodGenerationOffset;
            for (let i = 0; i < mipSlices; i++) {
                //compute LOD from even spacing in smoothness (matching shader calculation)
                const smoothness = i / (mipSlices - 1);
                const roughness = 1 - smoothness;
                const minLODIndex = offset; // roughness = 0
                const maxLODIndex = (mipmapsCount - 1) * scale + offset; // roughness = 1 (mipmaps start from 0)
                const lodIndex = minLODIndex + (maxLODIndex - minLODIndex) * roughness;
                const mipmapIndex = Math.round(Math.min(Math.max(lodIndex, 0), maxLODIndex));
                const glTextureFromLod = new _Materials_Textures_internalTexture_js__WEBPACK_IMPORTED_MODULE_4__/* .InternalTexture */ .hV(engine, 2 /* InternalTextureSource.Temp */);
                glTextureFromLod.isCube = true;
                glTextureFromLod.invertY = true;
                glTextureFromLod.generateMipMaps = false;
                engine.updateTextureSamplingMode(2, glTextureFromLod);
                // Wrap in a base texture for easy binding.
                const lodTexture = new _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_5__/* .BaseTexture */ .t(null);
                lodTexture._isCube = true;
                lodTexture._texture = glTextureFromLod;
                lodTextures[mipmapIndex] = lodTexture;
                switch (i) {
                    case 0:
                        texture._lodTextureLow = lodTexture;
                        break;
                    case 1:
                        texture._lodTextureMid = lodTexture;
                        break;
                    case 2:
                        texture._lodTextureHigh = lodTexture;
                        break;
                }
            }
        }
    }
    const promises = [];
    // All mipmaps up to provided number of images
    for (let i = 0; i < imageData.length; i++) {
        // All faces
        for (let face = 0; face < 6; face++) {
            // Constructs an image element from image data
            const bytes = imageData[i][face];
            const blob = new Blob([bytes], { type: imageType });
            const url = URL.createObjectURL(blob);
            let promise;
            if (engine._features.forceBitmapOverHTMLImageElement) {
                promise = engine.createImageBitmap(blob, { premultiplyAlpha: "none" }).then((img) => {
                    return _OnImageReadyAsync(img, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture);
                });
            }
            else {
                const image = new Image();
                image.src = url;
                // Enqueue promise to upload to the texture.
                promise = new Promise((resolve, reject) => {
                    image.onload = () => {
                        _OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture)
                            .then(() => resolve())
                            .catch((reason) => {
                            reject(reason);
                        });
                    };
                    image.onerror = (error) => {
                        reject(error);
                    };
                });
            }
            promises.push(promise);
        }
    }
    // Fill remaining mipmaps with black textures.
    if (imageData.length < mipmapsCount) {
        let data;
        const size = Math.pow(2, mipmapsCount - 1 - imageData.length);
        const dataLength = size * size * 4;
        switch (texture.type) {
            case 0: {
                data = new Uint8Array(dataLength);
                break;
            }
            case 2: {
                data = new Uint16Array(dataLength);
                break;
            }
            case 1: {
                data = new Float32Array(dataLength);
                break;
            }
        }
        for (let i = imageData.length; i < mipmapsCount; i++) {
            for (let face = 0; face < 6; face++) {
                engine._uploadArrayBufferViewToTexture(texture, data, face, i);
            }
        }
    }
    // Once all done, finishes the cleanup and return
    return Promise.all(promises).then(() => {
        // Release temp RTT.
        if (cubeRtt) {
            engine._releaseTexture(texture);
            cubeRtt._swapAndDie(texture);
        }
        // Release temp Post Process.
        if (rgbdPostProcess) {
            rgbdPostProcess.dispose();
        }
        // Flag internal texture as ready in case they are in use.
        if (generateNonLODTextures) {
            if (texture._lodTextureHigh && texture._lodTextureHigh._texture) {
                texture._lodTextureHigh._texture.isReady = true;
            }
            if (texture._lodTextureMid && texture._lodTextureMid._texture) {
                texture._lodTextureMid._texture.isReady = true;
            }
            if (texture._lodTextureLow && texture._lodTextureLow._texture) {
                texture._lodTextureLow._texture.isReady = true;
            }
        }
    });
}
/**
 * Uploads spherical polynomials information to the texture.
 * @param texture defines the texture we are trying to upload the information to
 * @param info defines the environment texture info retrieved through the GetEnvInfo method
 */
function UploadEnvSpherical(texture, info) {
    info = normalizeEnvInfo(info);
    const irradianceInfo = info.irradiance;
    if (!irradianceInfo) {
        return;
    }
    const sp = new _Maths_sphericalPolynomial_js__WEBPACK_IMPORTED_MODULE_3__/* .SphericalPolynomial */ .Q();
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(irradianceInfo.x, 0, sp.x);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(irradianceInfo.y, 0, sp.y);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(irradianceInfo.z, 0, sp.z);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(irradianceInfo.xx, 0, sp.xx);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(irradianceInfo.yy, 0, sp.yy);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(irradianceInfo.zz, 0, sp.zz);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(irradianceInfo.yz, 0, sp.yz);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(irradianceInfo.zx, 0, sp.zx);
    _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.FromArrayToRef(irradianceInfo.xy, 0, sp.xy);
    texture._sphericalPolynomial = sp;
}
/**
 * @internal
 */
function _UpdateRGBDAsync(internalTexture, data, sphericalPolynomial, lodScale, lodOffset) {
    const proxy = internalTexture
        .getEngine()
        .createRawCubeTexture(null, internalTexture.width, internalTexture.format, internalTexture.type, internalTexture.generateMipMaps, internalTexture.invertY, internalTexture.samplingMode, internalTexture._compression);
    const proxyPromise = UploadLevelsAsync(proxy, data).then(() => internalTexture);
    internalTexture.onRebuildCallback = (_internalTexture) => {
        return {
            proxy: proxyPromise,
            isReady: true,
            isAsync: true,
        };
    };
    internalTexture._source = 13 /* InternalTextureSource.CubeRawRGBD */;
    internalTexture._bufferViewArrayArray = data;
    internalTexture._lodGenerationScale = lodScale;
    internalTexture._lodGenerationOffset = lodOffset;
    internalTexture._sphericalPolynomial = sphericalPolynomial;
    return UploadLevelsAsync(internalTexture, data).then(() => {
        internalTexture.isReady = true;
        return internalTexture;
    });
}
/**
 * Sets of helpers addressing the serialization and deserialization of environment texture
 * stored in a BabylonJS env file.
 * Those files are usually stored as .env files.
 */
const EnvironmentTextureTools = {
    /**
     * Gets the environment info from an env file.
     * @param data The array buffer containing the .env bytes.
     * @returns the environment file info (the json header) if successfully parsed, normalized to the latest supported version.
     */
    GetEnvInfo,
    /**
     * Creates an environment texture from a loaded cube texture.
     * @param texture defines the cube texture to convert in env file
     * @param options options for the conversion process
     * @param options.imageType the mime type for the encoded images, with support for "image/png" (default) and "image/webp"
     * @param options.imageQuality the image quality of encoded WebP images.
     * @returns a promise containing the environment data if successful.
     */
    CreateEnvTextureAsync,
    /**
     * Creates the ArrayBufferViews used for initializing environment texture image data.
     * @param data the image data
     * @param info parameters that determine what views will be created for accessing the underlying buffer
     * @returns the views described by info providing access to the underlying buffer
     */
    CreateImageDataArrayBufferViews,
    /**
     * Uploads the texture info contained in the env file to the GPU.
     * @param texture defines the internal texture to upload to
     * @param data defines the data to load
     * @param info defines the texture info retrieved through the GetEnvInfo method
     * @returns a promise
     */
    UploadEnvLevelsAsync,
    /**
     * Uploads the levels of image data to the GPU.
     * @param texture defines the internal texture to upload to
     * @param imageData defines the array buffer views of image data [mipmap][face]
     * @param imageType the mime type of the image data
     * @returns a promise
     */
    UploadLevelsAsync,
    /**
     * Uploads spherical polynomials information to the texture.
     * @param texture defines the texture we are trying to upload the information to
     * @param info defines the environment texture info retrieved through the GetEnvInfo method
     */
    UploadEnvSpherical,
};
//# sourceMappingURL=environmentTextureTools.js.map

/***/ }),

/***/ 88563:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Cf: () => (/* binding */ BaseError),
/* harmony export */   bu: () => (/* binding */ RuntimeError),
/* harmony export */   tG: () => (/* binding */ ErrorCodes)
/* harmony export */ });
/* eslint-disable @typescript-eslint/naming-convention */
/**
 * Base error. Due to limitations of typedoc-check and missing documentation
 * in lib.es5.d.ts, cannot extend Error directly for RuntimeError.
 * @ignore
 */
class BaseError extends Error {
}
// See https://stackoverflow.com/questions/12915412/how-do-i-extend-a-host-object-e-g-error-in-typescript
// and https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
// Polyfill for Object.setPrototypeOf if necessary.
BaseError._setPrototypeOf = Object.setPrototypeOf ||
    ((o, proto) => {
        o.__proto__ = proto;
        return o;
    });
/* IMP! DO NOT CHANGE THE NUMBERING OF EXISTING ERROR CODES */
/**
 * Error codes for BaseError
 */
const ErrorCodes = {
    // Mesh errors 0-999
    /** Invalid or empty mesh vertex positions. */
    MeshInvalidPositionsError: 0,
    // Texture errors 1000-1999
    /** Unsupported texture found. */
    UnsupportedTextureError: 1000,
    // GLTFLoader errors 2000-2999
    /** Unexpected magic number found in GLTF file header. */
    GLTFLoaderUnexpectedMagicError: 2000,
    // SceneLoader errors 3000-3999
    /** SceneLoader generic error code. Ideally wraps the inner exception. */
    SceneLoaderError: 3000,
    // File related errors 4000-4999
    /** Load file error */
    LoadFileError: 4000,
    /** Request file error */
    RequestFileError: 4001,
    /** Read file error */
    ReadFileError: 4002,
};
/**
 * Application runtime error
 */
class RuntimeError extends BaseError {
    /**
     * Creates a new RuntimeError
     * @param message defines the message of the error
     * @param errorCode the error code
     * @param innerError the error that caused the outer error
     */
    constructor(message, errorCode, innerError) {
        super(message);
        this.errorCode = errorCode;
        this.innerError = innerError;
        this.name = "RuntimeError";
        BaseError._setPrototypeOf(this, RuntimeError.prototype);
    }
}
//# sourceMappingURL=error.js.map

/***/ }),

/***/ 8532:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   M1: () => (/* binding */ SetCorsBehavior),
/* harmony export */   Mi: () => (/* binding */ RequestFileError),
/* harmony export */   NJ: () => (/* binding */ ReadFile),
/* harmony export */   VB: () => (/* binding */ ReadFileError),
/* harmony export */   W$: () => (/* binding */ LoadImage),
/* harmony export */   ZP: () => (/* binding */ TestBase64DataUrl),
/* harmony export */   dy: () => (/* binding */ DecodeBase64UrlToString),
/* harmony export */   eC: () => (/* binding */ FileToolsOptions),
/* harmony export */   f2: () => (/* binding */ IsBase64DataUrl),
/* harmony export */   hX: () => (/* binding */ LoadFileError),
/* harmony export */   my: () => (/* binding */ IsFileURL),
/* harmony export */   qc: () => (/* binding */ LoadImageConfiguration),
/* harmony export */   rh: () => (/* binding */ _injectLTSFileTools),
/* harmony export */   rz: () => (/* binding */ DecodeBase64UrlToBinary),
/* harmony export */   sh: () => (/* binding */ RequestFile),
/* harmony export */   wS: () => (/* binding */ FileTools),
/* harmony export */   zU: () => (/* binding */ LoadFile)
/* harmony export */ });
/* harmony import */ var _webRequest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62366);
/* harmony import */ var _domManagement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18790);
/* harmony import */ var _observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99848);
/* harmony import */ var _filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60715);
/* harmony import */ var _retryStrategy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(61326);
/* harmony import */ var _error_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88563);
/* harmony import */ var _stringTools_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(36181);
/* harmony import */ var _Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(19125);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6315);
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(51137);
/* harmony import */ var _timingTools_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2940);
/* harmony import */ var _Engines_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(16741);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(32206);
/* eslint-disable @typescript-eslint/naming-convention */













const Base64DataUrlRegEx = new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i);
/** @ignore */
class LoadFileError extends _error_js__WEBPACK_IMPORTED_MODULE_5__/* .RuntimeError */ .bu {
    /**
     * Creates a new LoadFileError
     * @param message defines the message of the error
     * @param object defines the optional web request
     */
    constructor(message, object) {
        super(message, _error_js__WEBPACK_IMPORTED_MODULE_5__/* .ErrorCodes */ .tG.LoadFileError);
        this.name = "LoadFileError";
        _error_js__WEBPACK_IMPORTED_MODULE_5__/* .BaseError */ .Cf._setPrototypeOf(this, LoadFileError.prototype);
        if (object instanceof _webRequest_js__WEBPACK_IMPORTED_MODULE_0__/* .WebRequest */ .u) {
            this.request = object;
        }
        else {
            this.file = object;
        }
    }
}
/** @ignore */
class RequestFileError extends _error_js__WEBPACK_IMPORTED_MODULE_5__/* .RuntimeError */ .bu {
    /**
     * Creates a new LoadFileError
     * @param message defines the message of the error
     * @param request defines the optional web request
     */
    constructor(message, request) {
        super(message, _error_js__WEBPACK_IMPORTED_MODULE_5__/* .ErrorCodes */ .tG.RequestFileError);
        this.request = request;
        this.name = "RequestFileError";
        _error_js__WEBPACK_IMPORTED_MODULE_5__/* .BaseError */ .Cf._setPrototypeOf(this, RequestFileError.prototype);
    }
}
/** @ignore */
class ReadFileError extends _error_js__WEBPACK_IMPORTED_MODULE_5__/* .RuntimeError */ .bu {
    /**
     * Creates a new ReadFileError
     * @param message defines the message of the error
     * @param file defines the optional file
     */
    constructor(message, file) {
        super(message, _error_js__WEBPACK_IMPORTED_MODULE_5__/* .ErrorCodes */ .tG.ReadFileError);
        this.file = file;
        this.name = "ReadFileError";
        _error_js__WEBPACK_IMPORTED_MODULE_5__/* .BaseError */ .Cf._setPrototypeOf(this, ReadFileError.prototype);
    }
}
/**
 * Removes unwanted characters from an url
 * @param url defines the url to clean
 * @returns the cleaned url
 */
const CleanUrl = (url) => {
    url = url.replace(/#/gm, "%23");
    return url;
};
/**
 * @internal
 */
const FileToolsOptions = {
    /**
     * Gets or sets the retry strategy to apply when an error happens while loading an asset.
     * When defining this function, return the wait time before trying again or return -1 to
     * stop retrying and error out.
     */
    DefaultRetryStrategy: _retryStrategy_js__WEBPACK_IMPORTED_MODULE_4__/* .RetryStrategy */ .a.ExponentialBackoff(),
    /**
     * Gets or sets the base URL to use to load assets
     */
    BaseUrl: "",
    /**
     * Default behaviour for cors in the application.
     * It can be a string if the expected behavior is identical in the entire app.
     * Or a callback to be able to set it per url or on a group of them (in case of Video source for instance)
     */
    CorsBehavior: "anonymous",
    /**
     * Gets or sets a function used to pre-process url before using them to load assets
     * @param url
     * @returns the processed url
     */
    PreprocessUrl: (url) => url,
    /**
     * Gets or sets the base URL to use to load scripts
     * Used for both JS and WASM
     */
    ScriptBaseUrl: "",
    /**
     * Gets or sets a function used to pre-process script url before using them to load.
     * Used for both JS and WASM
     * @param url defines the url to process
     * @returns the processed url
     */
    ScriptPreprocessUrl: (url) => url,
    /**
     * Gets or sets a function used to clean the url before using it to load assets
     * @param url defines the url to clean
     * @returns the cleaned url
     */
    CleanUrl,
};
/**
 * Sets the cors behavior on a dom element. This will add the required Tools.CorsBehavior to the element.
 * @param url define the url we are trying
 * @param element define the dom element where to configure the cors policy
 * @internal
 */
const SetCorsBehavior = (url, element) => {
    if (url && url.indexOf("data:") === 0) {
        return;
    }
    if (FileToolsOptions.CorsBehavior) {
        if (typeof FileToolsOptions.CorsBehavior === "string" || FileToolsOptions.CorsBehavior instanceof String) {
            element.crossOrigin = FileToolsOptions.CorsBehavior;
        }
        else {
            const result = FileToolsOptions.CorsBehavior(url);
            if (result) {
                element.crossOrigin = result;
            }
        }
    }
};
/**
 * Configuration used to load images
 * @see #DKMEZK#2
 */
const LoadImageConfiguration = {
    getRequiredSize: null,
};
/**
 * Loads an image as an HTMLImageElement.
 * @param input url string, ArrayBuffer, or Blob to load
 * @param onLoad callback called when the image successfully loads
 * @param onError callback called when the image fails to load
 * @param offlineProvider offline provider for caching
 * @param mimeType optional mime type
 * @param imageBitmapOptions
 * @returns the HTMLImageElement of the loaded image
 * @internal
 */
const LoadImage = (input, onLoad, onError, offlineProvider, mimeType = "", imageBitmapOptions) => {
    const engine = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_8__/* .EngineStore */ .q.LastCreatedEngine;
    if (typeof HTMLImageElement === "undefined" && !engine?._features.forceBitmapOverHTMLImageElement) {
        onError("LoadImage is only supported in web or BabylonNative environments.");
        return null;
    }
    let url;
    let usingObjectURL = false;
    if (input instanceof ArrayBuffer || ArrayBuffer.isView(input)) {
        if (typeof Blob !== "undefined" && typeof URL !== "undefined") {
            url = URL.createObjectURL(new Blob([input], { type: mimeType }));
            usingObjectURL = true;
        }
        else {
            url = `data:${mimeType};base64,` + (0,_stringTools_js__WEBPACK_IMPORTED_MODULE_6__/* .EncodeArrayBufferToBase64 */ .EL)(input);
        }
    }
    else if (input instanceof Blob) {
        url = URL.createObjectURL(input);
        usingObjectURL = true;
    }
    else {
        url = FileToolsOptions.CleanUrl(input);
        url = FileToolsOptions.PreprocessUrl(url);
    }
    const onErrorHandler = (exception) => {
        if (onError) {
            const inputText = url || input.toString();
            onError(`Error while trying to load image: ${inputText.indexOf("http") === 0 || inputText.length <= 128 ? inputText : inputText.slice(0, 128) + "..."}`, exception);
        }
    };
    if (engine?._features.forceBitmapOverHTMLImageElement) {
        LoadFile(url, (data) => {
            engine
                .createImageBitmap(new Blob([data], { type: mimeType }), { premultiplyAlpha: "none", ...imageBitmapOptions })
                .then((imgBmp) => {
                onLoad(imgBmp);
                if (usingObjectURL) {
                    URL.revokeObjectURL(url);
                }
            })
                .catch((reason) => {
                if (onError) {
                    onError("Error while trying to load image: " + input, reason);
                }
            });
        }, undefined, offlineProvider || undefined, true, (request, exception) => {
            onErrorHandler(exception);
        });
        return null;
    }
    const img = new Image();
    if (LoadImageConfiguration.getRequiredSize) {
        const size = LoadImageConfiguration.getRequiredSize(input);
        if (size.width) {
            img.width = size.width;
        }
        if (size.height) {
            img.height = size.height;
        }
    }
    SetCorsBehavior(url, img);
    const handlersList = [];
    const loadHandlersList = () => {
        handlersList.forEach((handler) => {
            handler.target.addEventListener(handler.name, handler.handler);
        });
    };
    const unloadHandlersList = () => {
        handlersList.forEach((handler) => {
            handler.target.removeEventListener(handler.name, handler.handler);
        });
        handlersList.length = 0;
    };
    const loadHandler = () => {
        unloadHandlersList();
        onLoad(img);
        // Must revoke the URL after calling onLoad to avoid security exceptions in
        // certain scenarios (e.g. when hosted in vscode).
        if (usingObjectURL && img.src) {
            URL.revokeObjectURL(img.src);
        }
    };
    const errorHandler = (err) => {
        unloadHandlersList();
        onErrorHandler(err);
        if (usingObjectURL && img.src) {
            URL.revokeObjectURL(img.src);
        }
    };
    const cspHandler = (err) => {
        if (err.blockedURI !== img.src || err.disposition === "report") {
            return;
        }
        unloadHandlersList();
        const cspException = new Error(`CSP violation of policy ${err.effectiveDirective} ${err.blockedURI}. Current policy is ${err.originalPolicy}`);
        _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_8__/* .EngineStore */ .q.UseFallbackTexture = false;
        onErrorHandler(cspException);
        if (usingObjectURL && img.src) {
            URL.revokeObjectURL(img.src);
        }
        img.src = "";
    };
    handlersList.push({ target: img, name: "load", handler: loadHandler });
    handlersList.push({ target: img, name: "error", handler: errorHandler });
    handlersList.push({ target: document, name: "securitypolicyviolation", handler: cspHandler });
    loadHandlersList();
    const fromBlob = url.substring(0, 5) === "blob:";
    const fromData = url.substring(0, 5) === "data:";
    const noOfflineSupport = () => {
        if (fromBlob || fromData || !_webRequest_js__WEBPACK_IMPORTED_MODULE_0__/* .WebRequest */ .u.IsCustomRequestAvailable) {
            img.src = url;
        }
        else {
            LoadFile(url, (data, _, contentType) => {
                const type = !mimeType && contentType ? contentType : mimeType;
                const blob = new Blob([data], { type });
                const url = URL.createObjectURL(blob);
                usingObjectURL = true;
                img.src = url;
            }, undefined, offlineProvider || undefined, true, (_request, exception) => {
                onErrorHandler(exception);
            });
        }
    };
    const loadFromOfflineSupport = () => {
        if (offlineProvider) {
            offlineProvider.loadImage(url, img);
        }
    };
    if (!fromBlob && !fromData && offlineProvider && offlineProvider.enableTexturesOffline) {
        offlineProvider.open(loadFromOfflineSupport, noOfflineSupport);
    }
    else {
        if (url.indexOf("file:") !== -1) {
            const textureName = decodeURIComponent(url.substring(5).toLowerCase());
            if (_filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__/* .FilesInputStore */ .T.FilesToLoad[textureName] && typeof URL !== "undefined") {
                try {
                    let blobURL;
                    try {
                        blobURL = URL.createObjectURL(_filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__/* .FilesInputStore */ .T.FilesToLoad[textureName]);
                    }
                    catch (ex) {
                        // Chrome doesn't support oneTimeOnly parameter
                        blobURL = URL.createObjectURL(_filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__/* .FilesInputStore */ .T.FilesToLoad[textureName]);
                    }
                    img.src = blobURL;
                    usingObjectURL = true;
                }
                catch (e) {
                    img.src = "";
                }
                return img;
            }
        }
        noOfflineSupport();
    }
    return img;
};
/**
 * Reads a file from a File object
 * @param file defines the file to load
 * @param onSuccess defines the callback to call when data is loaded
 * @param onProgress defines the callback to call during loading process
 * @param useArrayBuffer defines a boolean indicating that data must be returned as an ArrayBuffer
 * @param onError defines the callback to call when an error occurs
 * @returns a file request object
 * @internal
 */
const ReadFile = (file, onSuccess, onProgress, useArrayBuffer, onError) => {
    const reader = new FileReader();
    const fileRequest = {
        onCompleteObservable: new _observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP(),
        abort: () => reader.abort(),
    };
    reader.onloadend = () => fileRequest.onCompleteObservable.notifyObservers(fileRequest);
    if (onError) {
        reader.onerror = () => {
            onError(new ReadFileError(`Unable to read ${file.name}`, file));
        };
    }
    reader.onload = (e) => {
        //target doesn't have result from ts 1.3
        onSuccess(e.target["result"]);
    };
    if (onProgress) {
        reader.onprogress = onProgress;
    }
    if (!useArrayBuffer) {
        // Asynchronous read
        reader.readAsText(file);
    }
    else {
        reader.readAsArrayBuffer(file);
    }
    return fileRequest;
};
/**
 * Loads a file from a url, a data url, or a file url
 * @param fileOrUrl file, url, data url, or file url to load
 * @param onSuccess callback called when the file successfully loads
 * @param onProgress callback called while file is loading (if the server supports this mode)
 * @param offlineProvider defines the offline provider for caching
 * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
 * @param onError callback called when the file fails to load
 * @param onOpened
 * @returns a file request object
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
const LoadFile = (fileOrUrl, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, onOpened) => {
    if (fileOrUrl.name) {
        return ReadFile(fileOrUrl, onSuccess, onProgress, useArrayBuffer, onError
            ? (error) => {
                onError(undefined, error);
            }
            : undefined);
    }
    const url = fileOrUrl;
    // If file and file input are set
    if (url.indexOf("file:") !== -1) {
        let fileName = decodeURIComponent(url.substring(5).toLowerCase());
        if (fileName.indexOf("./") === 0) {
            fileName = fileName.substring(2);
        }
        const file = _filesInputStore_js__WEBPACK_IMPORTED_MODULE_3__/* .FilesInputStore */ .T.FilesToLoad[fileName];
        if (file) {
            return ReadFile(file, onSuccess, onProgress, useArrayBuffer, onError ? (error) => onError(undefined, new LoadFileError(error.message, error.file)) : undefined);
        }
    }
    // For a Base64 Data URL
    const { match, type } = TestBase64DataUrl(url);
    if (match) {
        const fileRequest = {
            onCompleteObservable: new _observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP(),
            abort: () => () => { },
        };
        try {
            const data = useArrayBuffer ? DecodeBase64UrlToBinary(url) : DecodeBase64UrlToString(url);
            onSuccess(data, undefined, type);
        }
        catch (error) {
            if (onError) {
                onError(undefined, error);
            }
            else {
                _logger_js__WEBPACK_IMPORTED_MODULE_9__/* .Logger */ .V.Error(error.message || "Failed to parse the Data URL");
            }
        }
        _timingTools_js__WEBPACK_IMPORTED_MODULE_10__/* .TimingTools */ ._.SetImmediate(() => {
            fileRequest.onCompleteObservable.notifyObservers(fileRequest);
        });
        return fileRequest;
    }
    return RequestFile(url, (data, request) => {
        onSuccess(data, request?.responseURL, request?.getResponseHeader("content-type"));
    }, onProgress, offlineProvider, useArrayBuffer, onError
        ? (error) => {
            onError(error.request, new LoadFileError(error.message, error.request));
        }
        : undefined, onOpened);
};
/**
 * Loads a file from a url
 * @param url url to load
 * @param onSuccess callback called when the file successfully loads
 * @param onProgress callback called while file is loading (if the server supports this mode)
 * @param offlineProvider defines the offline provider for caching
 * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
 * @param onError callback called when the file fails to load
 * @param onOpened callback called when the web request is opened
 * @returns a file request object
 * @internal
 */
const RequestFile = (url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, onOpened) => {
    url = FileToolsOptions.CleanUrl(url);
    url = FileToolsOptions.PreprocessUrl(url);
    const loadUrl = FileToolsOptions.BaseUrl + url;
    let aborted = false;
    const fileRequest = {
        onCompleteObservable: new _observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP(),
        abort: () => (aborted = true),
    };
    const requestFile = () => {
        let request = new _webRequest_js__WEBPACK_IMPORTED_MODULE_0__/* .WebRequest */ .u();
        let retryHandle = null;
        let onReadyStateChange;
        const unbindEvents = () => {
            if (!request) {
                return;
            }
            if (onProgress) {
                request.removeEventListener("progress", onProgress);
            }
            if (onReadyStateChange) {
                request.removeEventListener("readystatechange", onReadyStateChange);
            }
            request.removeEventListener("loadend", onLoadEnd);
        };
        let onLoadEnd = () => {
            unbindEvents();
            fileRequest.onCompleteObservable.notifyObservers(fileRequest);
            fileRequest.onCompleteObservable.clear();
            onProgress = undefined;
            onReadyStateChange = null;
            onLoadEnd = null;
            onError = undefined;
            onOpened = undefined;
            onSuccess = undefined;
        };
        fileRequest.abort = () => {
            aborted = true;
            if (onLoadEnd) {
                onLoadEnd();
            }
            if (request && request.readyState !== (XMLHttpRequest.DONE || 4)) {
                request.abort();
            }
            if (retryHandle !== null) {
                clearTimeout(retryHandle);
                retryHandle = null;
            }
            request = null;
        };
        const handleError = (error) => {
            const message = error.message || "Unknown error";
            if (onError && request) {
                onError(new RequestFileError(message, request));
            }
            else {
                _logger_js__WEBPACK_IMPORTED_MODULE_9__/* .Logger */ .V.Error(message);
            }
        };
        const retryLoop = (retryIndex) => {
            if (!request) {
                return;
            }
            request.open("GET", loadUrl);
            if (onOpened) {
                try {
                    onOpened(request);
                }
                catch (e) {
                    handleError(e);
                    return;
                }
            }
            if (useArrayBuffer) {
                request.responseType = "arraybuffer";
            }
            if (onProgress) {
                request.addEventListener("progress", onProgress);
            }
            if (onLoadEnd) {
                request.addEventListener("loadend", onLoadEnd);
            }
            onReadyStateChange = () => {
                if (aborted || !request) {
                    return;
                }
                // In case of undefined state in some browsers.
                if (request.readyState === (XMLHttpRequest.DONE || 4)) {
                    // Some browsers have issues where onreadystatechange can be called multiple times with the same value.
                    if (onReadyStateChange) {
                        request.removeEventListener("readystatechange", onReadyStateChange);
                    }
                    if ((request.status >= 200 && request.status < 300) || (request.status === 0 && (!(0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .BA)() || IsFileURL()))) {
                        try {
                            if (onSuccess) {
                                onSuccess(useArrayBuffer ? request.response : request.responseText, request);
                            }
                        }
                        catch (e) {
                            handleError(e);
                        }
                        return;
                    }
                    const retryStrategy = FileToolsOptions.DefaultRetryStrategy;
                    if (retryStrategy) {
                        const waitTime = retryStrategy(loadUrl, request, retryIndex);
                        if (waitTime !== -1) {
                            // Prevent the request from completing for retry.
                            unbindEvents();
                            request = new _webRequest_js__WEBPACK_IMPORTED_MODULE_0__/* .WebRequest */ .u();
                            retryHandle = setTimeout(() => retryLoop(retryIndex + 1), waitTime);
                            return;
                        }
                    }
                    const error = new RequestFileError("Error status: " + request.status + " " + request.statusText + " - Unable to load " + loadUrl, request);
                    if (onError) {
                        onError(error);
                    }
                }
            };
            request.addEventListener("readystatechange", onReadyStateChange);
            request.send();
        };
        retryLoop(0);
    };
    // Caching all files
    if (offlineProvider && offlineProvider.enableSceneOffline) {
        const noOfflineSupport = (request) => {
            if (request && request.status > 400) {
                if (onError) {
                    onError(request);
                }
            }
            else {
                requestFile();
            }
        };
        const loadFromOfflineSupport = () => {
            // TODO: database needs to support aborting and should return a IFileRequest
            if (offlineProvider) {
                offlineProvider.loadFile(FileToolsOptions.BaseUrl + url, (data) => {
                    if (!aborted && onSuccess) {
                        onSuccess(data);
                    }
                    fileRequest.onCompleteObservable.notifyObservers(fileRequest);
                }, onProgress
                    ? (event) => {
                        if (!aborted && onProgress) {
                            onProgress(event);
                        }
                    }
                    : undefined, noOfflineSupport, useArrayBuffer);
            }
        };
        offlineProvider.open(loadFromOfflineSupport, noOfflineSupport);
    }
    else {
        requestFile();
    }
    return fileRequest;
};
/**
 * Checks if the loaded document was accessed via `file:`-Protocol.
 * @returns boolean
 * @internal
 */
const IsFileURL = () => {
    return typeof location !== "undefined" && location.protocol === "file:";
};
/**
 * Test if the given uri is a valid base64 data url
 * @param uri The uri to test
 * @returns True if the uri is a base64 data url or false otherwise
 * @internal
 */
const IsBase64DataUrl = (uri) => {
    return Base64DataUrlRegEx.test(uri);
};
const TestBase64DataUrl = (uri) => {
    const results = Base64DataUrlRegEx.exec(uri);
    if (results === null || results.length === 0) {
        return { match: false, type: "" };
    }
    else {
        const type = results[0].replace("data:", "").replace("base64,", "");
        return { match: true, type };
    }
};
/**
 * Decode the given base64 uri.
 * @param uri The uri to decode
 * @returns The decoded base64 data.
 * @internal
 */
function DecodeBase64UrlToBinary(uri) {
    return (0,_stringTools_js__WEBPACK_IMPORTED_MODULE_6__/* .DecodeBase64ToBinary */ .yS)(uri.split(",")[1]);
}
/**
 * Decode the given base64 uri into a UTF-8 encoded string.
 * @param uri The uri to decode
 * @returns The decoded base64 data.
 * @internal
 */
const DecodeBase64UrlToString = (uri) => {
    return (0,_stringTools_js__WEBPACK_IMPORTED_MODULE_6__/* .DecodeBase64ToString */ .AV)(uri.split(",")[1]);
};
/**
 * This will be executed automatically for UMD and es5.
 * If esm dev wants the side effects to execute they will have to run it manually
 * Once we build native modules those need to be exported.
 * @internal
 */
const initSideEffects = () => {
    _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_12__/* .AbstractEngine */ .$._FileToolsLoadImage = LoadImage;
    _Engines_abstractEngine_functions_js__WEBPACK_IMPORTED_MODULE_11__/* .EngineFunctionContext */ .sg.loadFile = LoadFile;
    _Engines_Processors_shaderProcessor_js__WEBPACK_IMPORTED_MODULE_7__/* ._functionContainer */ .J.loadFile = LoadFile;
};
initSideEffects();
// deprecated
/**
 * FileTools defined as any.
 * This should not be imported or used in future releases or in any module in the framework
 * @internal
 * @deprecated import the needed function from fileTools.ts
 */
let FileTools;
/**
 * @internal
 */
const _injectLTSFileTools = (DecodeBase64UrlToBinary, DecodeBase64UrlToString, FileToolsOptions, IsBase64DataUrl, IsFileURL, LoadFile, LoadImage, ReadFile, RequestFile, SetCorsBehavior) => {
    /**
     * Backwards compatibility.
     * @internal
     * @deprecated
     */
    FileTools = {
        DecodeBase64UrlToBinary,
        DecodeBase64UrlToString,
        DefaultRetryStrategy: FileToolsOptions.DefaultRetryStrategy,
        BaseUrl: FileToolsOptions.BaseUrl,
        CorsBehavior: FileToolsOptions.CorsBehavior,
        PreprocessUrl: FileToolsOptions.PreprocessUrl,
        IsBase64DataUrl,
        IsFileURL,
        LoadFile,
        LoadImage,
        ReadFile,
        RequestFile,
        SetCorsBehavior,
    };
    Object.defineProperty(FileTools, "DefaultRetryStrategy", {
        get: function () {
            return FileToolsOptions.DefaultRetryStrategy;
        },
        set: function (value) {
            FileToolsOptions.DefaultRetryStrategy = value;
        },
    });
    Object.defineProperty(FileTools, "BaseUrl", {
        get: function () {
            return FileToolsOptions.BaseUrl;
        },
        set: function (value) {
            FileToolsOptions.BaseUrl = value;
        },
    });
    Object.defineProperty(FileTools, "PreprocessUrl", {
        get: function () {
            return FileToolsOptions.PreprocessUrl;
        },
        set: function (value) {
            FileToolsOptions.PreprocessUrl = value;
        },
    });
    Object.defineProperty(FileTools, "CorsBehavior", {
        get: function () {
            return FileToolsOptions.CorsBehavior;
        },
        set: function (value) {
            FileToolsOptions.CorsBehavior = value;
        },
    });
};
_injectLTSFileTools(DecodeBase64UrlToBinary, DecodeBase64UrlToString, FileToolsOptions, IsBase64DataUrl, IsFileURL, LoadFile, LoadImage, ReadFile, RequestFile, SetCorsBehavior);
//# sourceMappingURL=fileTools.js.map

/***/ }),

/***/ 60715:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   T: () => (/* binding */ FilesInputStore)
/* harmony export */ });
/**
 * Class used to help managing file picking and drag'n'drop
 * File Storage
 */
class FilesInputStore {
}
/**
 * List of files ready to be loaded
 */
FilesInputStore.FilesToLoad = {};
//# sourceMappingURL=filesInputStore.js.map

/***/ }),

/***/ 38688:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   S: () => (/* binding */ GUID),
/* harmony export */   z: () => (/* binding */ RandomGUID)
/* harmony export */ });
/**
 * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523
 * Be aware Math.random() could cause collisions, but:
 * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide"
 * @returns a pseudo random id
 */
function RandomGUID() {
    return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
        const r = (Math.random() * 16) | 0, v = c === "x" ? r : (r & 0x3) | 0x8;
        return v.toString(16);
    });
}
/**
 * Class used to manipulate GUIDs
 */
const GUID = {
    /**
     * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523
     * Be aware Math.random() could cause collisions, but:
     * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide"
     * @returns a pseudo random id
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    RandomId: RandomGUID,
};
//# sourceMappingURL=guid.js.map

/***/ }),

/***/ 79337:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   n: () => (/* binding */ InstantiationTools)
/* harmony export */ });
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);
/* harmony import */ var _typeStore_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56552);


/**
 * Class used to enable instantiation of objects by class name
 */
class InstantiationTools {
    /**
     * Tries to instantiate a new object from a given class name
     * @param className defines the class name to instantiate
     * @returns the new object or null if the system was not able to do the instantiation
     */
    static Instantiate(className) {
        if (this.RegisteredExternalClasses && this.RegisteredExternalClasses[className]) {
            return this.RegisteredExternalClasses[className];
        }
        const internalClass = (0,_typeStore_js__WEBPACK_IMPORTED_MODULE_1__/* .GetClass */ .n9)(className);
        if (internalClass) {
            return internalClass;
        }
        _logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Warn(className + " not found, you may have missed an import.");
        const arr = className.split(".");
        let fn = window || this;
        for (let i = 0, len = arr.length; i < len; i++) {
            fn = fn[arr[i]];
        }
        if (typeof fn !== "function") {
            return null;
        }
        return fn;
    }
}
/**
 * Use this object to register external classes like custom textures or material
 * to allow the loaders to instantiate them
 */
InstantiationTools.RegisteredExternalClasses = {};
//# sourceMappingURL=instantiationTools.js.map

/***/ }),

/***/ 6443:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   H: () => (/* binding */ KhronosTextureContainer)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);
/* eslint-disable @typescript-eslint/naming-convention */

/**
 * for description see https://www.khronos.org/opengles/sdk/tools/KTX/
 * for file layout see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
 */
class KhronosTextureContainer {
    /**
     * Creates a new KhronosTextureContainer
     * @param data contents of the KTX container file
     * @param facesExpected should be either 1 or 6, based whether a cube texture or or
     */
    constructor(
    /** contents of the KTX container file */
    data, facesExpected) {
        this.data = data;
        /**
         * If the container has been made invalid (eg. constructor failed to correctly load array buffer)
         */
        this.isInvalid = false;
        if (!KhronosTextureContainer.IsValid(data)) {
            this.isInvalid = true;
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("texture missing KTX identifier");
            return;
        }
        // load the reset of the header in native 32 bit uint
        const dataSize = Uint32Array.BYTES_PER_ELEMENT;
        const headerDataView = new DataView(this.data.buffer, this.data.byteOffset + 12, 13 * dataSize);
        const endianness = headerDataView.getUint32(0, true);
        const littleEndian = endianness === 0x04030201;
        this.glType = headerDataView.getUint32(1 * dataSize, littleEndian); // must be 0 for compressed textures
        this.glTypeSize = headerDataView.getUint32(2 * dataSize, littleEndian); // must be 1 for compressed textures
        this.glFormat = headerDataView.getUint32(3 * dataSize, littleEndian); // must be 0 for compressed textures
        this.glInternalFormat = headerDataView.getUint32(4 * dataSize, littleEndian); // the value of arg passed to gl.compressedTexImage2D(,,x,,,,)
        this.glBaseInternalFormat = headerDataView.getUint32(5 * dataSize, littleEndian); // specify GL_RGB, GL_RGBA, GL_ALPHA, etc (un-compressed only)
        this.pixelWidth = headerDataView.getUint32(6 * dataSize, littleEndian); // level 0 value of arg passed to gl.compressedTexImage2D(,,,x,,,)
        this.pixelHeight = headerDataView.getUint32(7 * dataSize, littleEndian); // level 0 value of arg passed to gl.compressedTexImage2D(,,,,x,,)
        this.pixelDepth = headerDataView.getUint32(8 * dataSize, littleEndian); // level 0 value of arg passed to gl.compressedTexImage3D(,,,,,x,,)
        this.numberOfArrayElements = headerDataView.getUint32(9 * dataSize, littleEndian); // used for texture arrays
        this.numberOfFaces = headerDataView.getUint32(10 * dataSize, littleEndian); // used for cubemap textures, should either be 1 or 6
        this.numberOfMipmapLevels = headerDataView.getUint32(11 * dataSize, littleEndian); // number of levels; disregard possibility of 0 for compressed textures
        this.bytesOfKeyValueData = headerDataView.getUint32(12 * dataSize, littleEndian); // the amount of space after the header for meta-data
        // Make sure we have a compressed type.  Not only reduces work, but probably better to let dev know they are not compressing.
        if (this.glType !== 0) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("only compressed formats currently supported");
            this.isInvalid = true;
            return;
        }
        else {
            // value of zero is an indication to generate mipmaps @ runtime.  Not usually allowed for compressed, so disregard.
            this.numberOfMipmapLevels = Math.max(1, this.numberOfMipmapLevels);
        }
        if (this.pixelHeight === 0 || this.pixelDepth !== 0) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("only 2D textures currently supported");
            this.isInvalid = true;
            return;
        }
        if (this.numberOfArrayElements !== 0) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("texture arrays not currently supported");
            this.isInvalid = true;
            return;
        }
        if (this.numberOfFaces !== facesExpected) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("number of faces expected" + facesExpected + ", but found " + this.numberOfFaces);
            this.isInvalid = true;
            return;
        }
        // we now have a completely validated file, so could use existence of loadType as success
        // would need to make this more elaborate & adjust checks above to support more than one load type
        this.loadType = KhronosTextureContainer.COMPRESSED_2D;
    }
    /**
     * Uploads KTX content to a Babylon Texture.
     * It is assumed that the texture has already been created & is currently bound
     * @internal
     */
    uploadLevels(texture, loadMipmaps) {
        switch (this.loadType) {
            case KhronosTextureContainer.COMPRESSED_2D:
                this._upload2DCompressedLevels(texture, loadMipmaps);
                break;
            case KhronosTextureContainer.TEX_2D:
            case KhronosTextureContainer.COMPRESSED_3D:
            case KhronosTextureContainer.TEX_3D:
        }
    }
    _upload2DCompressedLevels(texture, loadMipmaps) {
        // initialize width & height for level 1
        let dataOffset = KhronosTextureContainer.HEADER_LEN + this.bytesOfKeyValueData;
        let width = this.pixelWidth;
        let height = this.pixelHeight;
        const mipmapCount = loadMipmaps ? this.numberOfMipmapLevels : 1;
        for (let level = 0; level < mipmapCount; level++) {
            const imageSize = new Int32Array(this.data.buffer, this.data.byteOffset + dataOffset, 1)[0]; // size per face, since not supporting array cubemaps
            dataOffset += 4; //image data starts from next multiple of 4 offset. Each face refers to same imagesize field above.
            for (let face = 0; face < this.numberOfFaces; face++) {
                const byteArray = new Uint8Array(this.data.buffer, this.data.byteOffset + dataOffset, imageSize);
                const engine = texture.getEngine();
                engine._uploadCompressedDataToTextureDirectly(texture, texture.format, width, height, byteArray, face, level);
                dataOffset += imageSize; // add size of the image for the next face/mipmap
                dataOffset += 3 - ((imageSize + 3) % 4); // add padding for odd sized image
            }
            width = Math.max(1.0, width * 0.5);
            height = Math.max(1.0, height * 0.5);
        }
    }
    /**
     * Checks if the given data starts with a KTX file identifier.
     * @param data the data to check
     * @returns true if the data is a KTX file or false otherwise
     */
    static IsValid(data) {
        if (data.byteLength >= 12) {
            // '«', 'K', 'T', 'X', ' ', '1', '1', '»', '\r', '\n', '\x1A', '\n'
            const identifier = new Uint8Array(data.buffer, data.byteOffset, 12);
            if (identifier[0] === 0xab &&
                identifier[1] === 0x4b &&
                identifier[2] === 0x54 &&
                identifier[3] === 0x58 &&
                identifier[4] === 0x20 &&
                identifier[5] === 0x31 &&
                identifier[6] === 0x31 &&
                identifier[7] === 0xbb &&
                identifier[8] === 0x0d &&
                identifier[9] === 0x0a &&
                identifier[10] === 0x1a &&
                identifier[11] === 0x0a) {
                return true;
            }
        }
        return false;
    }
}
KhronosTextureContainer.HEADER_LEN = 12 + 13 * 4; // identifier + header elements (not including key value meta-data pairs)
// load types
KhronosTextureContainer.COMPRESSED_2D = 0; // uses a gl.compressedTexImage2D()
KhronosTextureContainer.COMPRESSED_3D = 1; // uses a gl.compressedTexImage3D()
KhronosTextureContainer.TEX_2D = 2; // uses a gl.texImage2D()
KhronosTextureContainer.TEX_3D = 3; // uses a gl.texImage3D()
//# sourceMappingURL=khronosTextureContainer.js.map

/***/ }),

/***/ 77502:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  $: () => (/* binding */ DefaultKTX2DecoderOptions),
  Z: () => (/* binding */ KhronosTextureContainer2)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/workerPool.js
var workerPool = __webpack_require__(97573);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__(998);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/ktx2decoderTypes.js
var ktx2decoderTypes = __webpack_require__(60572);
;// ./node_modules/@babylonjs/core/Misc/khronosTextureContainer2Worker.js
function applyConfig(urls, binariesAndModulesContainer) {
    const KTX2DecoderModule = binariesAndModulesContainer?.jsDecoderModule || KTX2DECODER;
    if (urls) {
        if (urls.wasmUASTCToASTC) {
            KTX2DecoderModule.LiteTranscoder_UASTC_ASTC.WasmModuleURL = urls.wasmUASTCToASTC;
        }
        if (urls.wasmUASTCToBC7) {
            KTX2DecoderModule.LiteTranscoder_UASTC_BC7.WasmModuleURL = urls.wasmUASTCToBC7;
        }
        if (urls.wasmUASTCToRGBA_UNORM) {
            KTX2DecoderModule.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL = urls.wasmUASTCToRGBA_UNORM;
        }
        if (urls.wasmUASTCToRGBA_SRGB) {
            KTX2DecoderModule.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL = urls.wasmUASTCToRGBA_SRGB;
        }
        if (urls.wasmUASTCToR8_UNORM) {
            KTX2DecoderModule.LiteTranscoder_UASTC_R8_UNORM.WasmModuleURL = urls.wasmUASTCToR8_UNORM;
        }
        if (urls.wasmUASTCToRG8_UNORM) {
            KTX2DecoderModule.LiteTranscoder_UASTC_RG8_UNORM.WasmModuleURL = urls.wasmUASTCToRG8_UNORM;
        }
        if (urls.jsMSCTranscoder) {
            KTX2DecoderModule.MSCTranscoder.JSModuleURL = urls.jsMSCTranscoder;
        }
        if (urls.wasmMSCTranscoder) {
            KTX2DecoderModule.MSCTranscoder.WasmModuleURL = urls.wasmMSCTranscoder;
        }
        if (urls.wasmZSTDDecoder) {
            KTX2DecoderModule.ZSTDDecoder.WasmModuleURL = urls.wasmZSTDDecoder;
        }
    }
    if (binariesAndModulesContainer) {
        if (binariesAndModulesContainer.wasmUASTCToASTC) {
            KTX2DecoderModule.LiteTranscoder_UASTC_ASTC.WasmBinary = binariesAndModulesContainer.wasmUASTCToASTC;
        }
        if (binariesAndModulesContainer.wasmUASTCToBC7) {
            KTX2DecoderModule.LiteTranscoder_UASTC_BC7.WasmBinary = binariesAndModulesContainer.wasmUASTCToBC7;
        }
        if (binariesAndModulesContainer.wasmUASTCToRGBA_UNORM) {
            KTX2DecoderModule.LiteTranscoder_UASTC_RGBA_UNORM.WasmBinary = binariesAndModulesContainer.wasmUASTCToRGBA_UNORM;
        }
        if (binariesAndModulesContainer.wasmUASTCToRGBA_SRGB) {
            KTX2DecoderModule.LiteTranscoder_UASTC_RGBA_SRGB.WasmBinary = binariesAndModulesContainer.wasmUASTCToRGBA_SRGB;
        }
        if (binariesAndModulesContainer.wasmUASTCToR8_UNORM) {
            KTX2DecoderModule.LiteTranscoder_UASTC_R8_UNORM.WasmBinary = binariesAndModulesContainer.wasmUASTCToR8_UNORM;
        }
        if (binariesAndModulesContainer.wasmUASTCToRG8_UNORM) {
            KTX2DecoderModule.LiteTranscoder_UASTC_RG8_UNORM.WasmBinary = binariesAndModulesContainer.wasmUASTCToRG8_UNORM;
        }
        if (binariesAndModulesContainer.jsMSCTranscoder) {
            KTX2DecoderModule.MSCTranscoder.JSModule = binariesAndModulesContainer.jsMSCTranscoder;
        }
        if (binariesAndModulesContainer.wasmMSCTranscoder) {
            KTX2DecoderModule.MSCTranscoder.WasmBinary = binariesAndModulesContainer.wasmMSCTranscoder;
        }
        if (binariesAndModulesContainer.wasmZSTDDecoder) {
            KTX2DecoderModule.ZSTDDecoder.WasmBinary = binariesAndModulesContainer.wasmZSTDDecoder;
        }
    }
}
function workerFunction(KTX2DecoderModule) {
    if (typeof KTX2DecoderModule === "undefined" && typeof KTX2DECODER !== "undefined") {
        KTX2DecoderModule = KTX2DECODER;
    }
    let ktx2Decoder;
    onmessage = (event) => {
        if (!event.data) {
            return;
        }
        switch (event.data.action) {
            case "init": {
                const urls = event.data.urls;
                if (urls) {
                    if (urls.jsDecoderModule && typeof KTX2DecoderModule === "undefined") {
                        importScripts(urls.jsDecoderModule);
                        // assuming global namespace populated by the script (UMD pattern)
                        KTX2DecoderModule = KTX2DECODER;
                    }
                    applyConfig(urls);
                }
                if (event.data.wasmBinaries) {
                    applyConfig(undefined, { ...event.data.wasmBinaries, jsDecoderModule: KTX2DecoderModule });
                }
                ktx2Decoder = new KTX2DecoderModule.KTX2Decoder();
                postMessage({ action: "init" });
                break;
            }
            case "setDefaultDecoderOptions": {
                KTX2DecoderModule.KTX2Decoder.DefaultDecoderOptions = event.data.options;
                break;
            }
            case "decode":
                ktx2Decoder
                    .decode(event.data.data, event.data.caps, event.data.options)
                    .then((data) => {
                    const buffers = [];
                    for (let mip = 0; mip < data.mipmaps.length; ++mip) {
                        const mipmap = data.mipmaps[mip];
                        if (mipmap && mipmap.data) {
                            buffers.push(mipmap.data.buffer);
                        }
                    }
                    postMessage({ action: "decoded", success: true, decodedData: data }, buffers);
                })
                    .catch((reason) => {
                    postMessage({ action: "decoded", success: false, msg: reason });
                });
                break;
        }
    };
}
function initializeWebWorker(worker, wasmBinaries, urls) {
    return new Promise((resolve, reject) => {
        const onError = (error) => {
            worker.removeEventListener("error", onError);
            worker.removeEventListener("message", onMessage);
            reject(error);
        };
        const onMessage = (message) => {
            if (message.data.action === "init") {
                worker.removeEventListener("error", onError);
                worker.removeEventListener("message", onMessage);
                resolve(worker);
            }
        };
        worker.addEventListener("error", onError);
        worker.addEventListener("message", onMessage);
        worker.postMessage({
            action: "init",
            urls,
            wasmBinaries,
        });
    });
}
//# sourceMappingURL=khronosTextureContainer2Worker.js.map
;// ./node_modules/@babylonjs/core/Misc/khronosTextureContainer2.js





/**
 * Class that defines the default KTX2 decoder options.
 *
 * This class is useful for providing options to the KTX2 decoder to control how the source data is transcoded.
 */
class DefaultKTX2DecoderOptions {
    constructor() {
        this._isDirty = true;
        this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC = true;
        this._ktx2DecoderOptions = {};
    }
    /**
     * Gets the dirty flag
     */
    get isDirty() {
        return this._isDirty;
    }
    /**
     * force a (uncompressed) RGBA transcoded format if transcoding a UASTC source format and ASTC + BC7 are not available as a compressed transcoded format
     */
    get useRGBAIfASTCBC7NotAvailableWhenUASTC() {
        return this._useRGBAIfASTCBC7NotAvailableWhenUASTC;
    }
    set useRGBAIfASTCBC7NotAvailableWhenUASTC(value) {
        if (this._useRGBAIfASTCBC7NotAvailableWhenUASTC === value) {
            return;
        }
        this._useRGBAIfASTCBC7NotAvailableWhenUASTC = value;
        this._isDirty = true;
    }
    /**
     * force a (uncompressed) RGBA transcoded format if transcoding a UASTC source format and only BC1 or BC3 are available as a compressed transcoded format.
     * This property is true by default to favor speed over memory, because currently transcoding from UASTC to BC1/3 is slow because the transcoder transcodes
     * to uncompressed and then recompresses the texture
     */
    get useRGBAIfOnlyBC1BC3AvailableWhenUASTC() {
        return this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC;
    }
    set useRGBAIfOnlyBC1BC3AvailableWhenUASTC(value) {
        if (this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC === value) {
            return;
        }
        this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC = value;
        this._isDirty = true;
    }
    /**
     * force to always use (uncompressed) RGBA for transcoded format
     */
    get forceRGBA() {
        return this._forceRGBA;
    }
    set forceRGBA(value) {
        if (this._forceRGBA === value) {
            return;
        }
        this._forceRGBA = value;
        this._isDirty = true;
    }
    /**
     * force to always use (uncompressed) R8 for transcoded format
     */
    get forceR8() {
        return this._forceR8;
    }
    set forceR8(value) {
        if (this._forceR8 === value) {
            return;
        }
        this._forceR8 = value;
        this._isDirty = true;
    }
    /**
     * force to always use (uncompressed) RG8 for transcoded format
     */
    get forceRG8() {
        return this._forceRG8;
    }
    set forceRG8(value) {
        if (this._forceRG8 === value) {
            return;
        }
        this._forceRG8 = value;
        this._isDirty = true;
    }
    /**
     * list of transcoders to bypass when looking for a suitable transcoder. The available transcoders are:
     *      UniversalTranscoder_UASTC_ASTC
     *      UniversalTranscoder_UASTC_BC7
     *      UniversalTranscoder_UASTC_RGBA_UNORM
     *      UniversalTranscoder_UASTC_RGBA_SRGB
     *      UniversalTranscoder_UASTC_R8_UNORM
     *      UniversalTranscoder_UASTC_RG8_UNORM
     *      MSCTranscoder
     */
    get bypassTranscoders() {
        return this._bypassTranscoders;
    }
    set bypassTranscoders(value) {
        if (this._bypassTranscoders === value) {
            return;
        }
        this._bypassTranscoders = value;
        this._isDirty = true;
    }
    /** @internal */
    _getKTX2DecoderOptions() {
        if (!this._isDirty) {
            return this._ktx2DecoderOptions;
        }
        this._isDirty = false;
        const options = {
            useRGBAIfASTCBC7NotAvailableWhenUASTC: this._useRGBAIfASTCBC7NotAvailableWhenUASTC,
            forceRGBA: this._forceRGBA,
            forceR8: this._forceR8,
            forceRG8: this._forceRG8,
            bypassTranscoders: this._bypassTranscoders,
        };
        if (this.useRGBAIfOnlyBC1BC3AvailableWhenUASTC) {
            options.transcodeFormatDecisionTree = {
                UASTC: {
                    transcodeFormat: [ktx2decoderTypes/* TranscodeTarget */.Xl.BC1_RGB, ktx2decoderTypes/* TranscodeTarget */.Xl.BC3_RGBA],
                    yes: {
                        transcodeFormat: ktx2decoderTypes/* TranscodeTarget */.Xl.RGBA32,
                        engineFormat: 32856 /* EngineFormat.RGBA8Format */,
                        roundToMultiple4: false,
                    },
                },
            };
        }
        this._ktx2DecoderOptions = options;
        return options;
    }
}
/**
 * Class for loading KTX2 files
 */
class KhronosTextureContainer2 {
    static GetDefaultNumWorkers() {
        if (typeof navigator !== "object" || !navigator.hardwareConcurrency) {
            return 1;
        }
        // Use 50% of the available logical processors but capped at 4.
        return Math.min(Math.floor(navigator.hardwareConcurrency * 0.5), 4);
    }
    static _Initialize(numWorkers) {
        if (KhronosTextureContainer2._WorkerPoolPromise || KhronosTextureContainer2._DecoderModulePromise) {
            return;
        }
        const urls = {
            jsDecoderModule: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.jsDecoderModule, true),
            wasmUASTCToASTC: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToASTC, true),
            wasmUASTCToBC7: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToBC7, true),
            wasmUASTCToRGBA_UNORM: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_UNORM, true),
            wasmUASTCToRGBA_SRGB: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_SRGB, true),
            wasmUASTCToR8_UNORM: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToR8_UNORM, true),
            wasmUASTCToRG8_UNORM: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRG8_UNORM, true),
            jsMSCTranscoder: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.jsMSCTranscoder, true),
            wasmMSCTranscoder: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.wasmMSCTranscoder, true),
            wasmZSTDDecoder: tools/* Tools */.S0.GetBabylonScriptURL(this.URLConfig.wasmZSTDDecoder, true),
        };
        if (numWorkers && typeof Worker === "function" && typeof URL !== "undefined") {
            KhronosTextureContainer2._WorkerPoolPromise = new Promise((resolve) => {
                const workerContent = `${applyConfig}(${workerFunction})()`;
                const workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: "application/javascript" }));
                resolve(new workerPool/* AutoReleaseWorkerPool */.h(numWorkers, () => initializeWebWorker(new Worker(workerBlobUrl), undefined, urls)));
            });
        }
        else {
            if (typeof KhronosTextureContainer2._KTX2DecoderModule === "undefined") {
                KhronosTextureContainer2._DecoderModulePromise = tools/* Tools */.S0.LoadBabylonScriptAsync(urls.jsDecoderModule).then(() => {
                    KhronosTextureContainer2._KTX2DecoderModule = KTX2DECODER;
                    KhronosTextureContainer2._KTX2DecoderModule.MSCTranscoder.UseFromWorkerThread = false;
                    KhronosTextureContainer2._KTX2DecoderModule.WASMMemoryManager.LoadBinariesFromCurrentThread = true;
                    applyConfig(urls, KhronosTextureContainer2._KTX2DecoderModule);
                    return new KhronosTextureContainer2._KTX2DecoderModule.KTX2Decoder();
                });
            }
            else {
                KhronosTextureContainer2._KTX2DecoderModule.MSCTranscoder.UseFromWorkerThread = false;
                KhronosTextureContainer2._KTX2DecoderModule.WASMMemoryManager.LoadBinariesFromCurrentThread = true;
                KhronosTextureContainer2._DecoderModulePromise = Promise.resolve(new KhronosTextureContainer2._KTX2DecoderModule.KTX2Decoder());
            }
        }
    }
    /**
     * Constructor
     * @param engine The engine to use
     * @param numWorkersOrOptions The number of workers for async operations. Specify `0` to disable web workers and run synchronously in the current context.
     */
    constructor(engine, numWorkersOrOptions = KhronosTextureContainer2.DefaultNumWorkers) {
        this._engine = engine;
        const workerPoolOption = (typeof numWorkersOrOptions === "object" && numWorkersOrOptions.workerPool) || KhronosTextureContainer2.WorkerPool;
        if (workerPoolOption) {
            KhronosTextureContainer2._WorkerPoolPromise = Promise.resolve(workerPoolOption);
        }
        else {
            // set the KTX2 decoder module
            if (typeof numWorkersOrOptions === "object") {
                KhronosTextureContainer2._KTX2DecoderModule = numWorkersOrOptions?.binariesAndModulesContainer?.jsDecoderModule;
            }
            else if (typeof KTX2DECODER !== "undefined") {
                KhronosTextureContainer2._KTX2DecoderModule = KTX2DECODER;
            }
            const numberOfWorkers = typeof numWorkersOrOptions === "number" ? numWorkersOrOptions : (numWorkersOrOptions.numWorkers ?? KhronosTextureContainer2.DefaultNumWorkers);
            KhronosTextureContainer2._Initialize(numberOfWorkers);
        }
    }
    /**
     * @internal
     */
    _uploadAsync(data, internalTexture, options) {
        const caps = this._engine.getCaps();
        const compressedTexturesCaps = {
            astc: !!caps.astc,
            bptc: !!caps.bptc,
            s3tc: !!caps.s3tc,
            pvrtc: !!caps.pvrtc,
            etc2: !!caps.etc2,
            etc1: !!caps.etc1,
        };
        if (KhronosTextureContainer2._WorkerPoolPromise) {
            return KhronosTextureContainer2._WorkerPoolPromise.then((workerPool) => {
                return new Promise((resolve, reject) => {
                    workerPool.push((worker, onComplete) => {
                        const onError = (error) => {
                            worker.removeEventListener("error", onError);
                            worker.removeEventListener("message", onMessage);
                            reject(error);
                            onComplete();
                        };
                        const onMessage = (message) => {
                            if (message.data.action === "decoded") {
                                worker.removeEventListener("error", onError);
                                worker.removeEventListener("message", onMessage);
                                if (!message.data.success) {
                                    reject({ message: message.data.msg });
                                }
                                else {
                                    try {
                                        this._createTexture(message.data.decodedData, internalTexture, options);
                                        resolve();
                                    }
                                    catch (err) {
                                        reject({ message: err });
                                    }
                                }
                                onComplete();
                            }
                        };
                        worker.addEventListener("error", onError);
                        worker.addEventListener("message", onMessage);
                        worker.postMessage({ action: "setDefaultDecoderOptions", options: KhronosTextureContainer2.DefaultDecoderOptions._getKTX2DecoderOptions() });
                        const dataCopy = new Uint8Array(data.byteLength);
                        dataCopy.set(new Uint8Array(data.buffer, data.byteOffset, data.byteLength));
                        worker.postMessage({ action: "decode", data: dataCopy, caps: compressedTexturesCaps, options }, [dataCopy.buffer]);
                    });
                });
            });
        }
        else if (KhronosTextureContainer2._DecoderModulePromise) {
            return KhronosTextureContainer2._DecoderModulePromise.then((decoder) => {
                if (KhronosTextureContainer2.DefaultDecoderOptions.isDirty) {
                    KhronosTextureContainer2._KTX2DecoderModule.KTX2Decoder.DefaultDecoderOptions = KhronosTextureContainer2.DefaultDecoderOptions._getKTX2DecoderOptions();
                }
                return new Promise((resolve, reject) => {
                    decoder
                        .decode(data, caps)
                        .then((data) => {
                        this._createTexture(data, internalTexture);
                        resolve();
                    })
                        .catch((reason) => {
                        reject({ message: reason });
                    });
                });
            });
        }
        throw new Error("KTX2 decoder module is not available");
    }
    _createTexture(data, internalTexture, options) {
        const oglTexture2D = 3553; // gl.TEXTURE_2D
        this._engine._bindTextureDirectly(oglTexture2D, internalTexture);
        if (options) {
            // return back some information about the decoded data
            options.transcodedFormat = data.transcodedFormat;
            options.isInGammaSpace = data.isInGammaSpace;
            options.hasAlpha = data.hasAlpha;
            options.transcoderName = data.transcoderName;
        }
        let isUncompressedFormat = true;
        switch (data.transcodedFormat) {
            case 0x8058 /* RGBA8 */:
                internalTexture.type = 0;
                internalTexture.format = 5;
                break;
            case 0x8229 /* R8 */:
                internalTexture.type = 0;
                internalTexture.format = 6;
                break;
            case 0x822b /* RG8 */:
                internalTexture.type = 0;
                internalTexture.format = 7;
                break;
            default:
                internalTexture.format = data.transcodedFormat;
                isUncompressedFormat = false;
                break;
        }
        internalTexture._gammaSpace = data.isInGammaSpace;
        internalTexture.generateMipMaps = data.mipmaps.length > 1;
        if (data.errors) {
            throw new Error("KTX2 container - could not transcode the data. " + data.errors);
        }
        for (let t = 0; t < data.mipmaps.length; ++t) {
            const mipmap = data.mipmaps[t];
            if (!mipmap || !mipmap.data) {
                throw new Error("KTX2 container - could not transcode one of the image");
            }
            if (isUncompressedFormat) {
                // uncompressed RGBA / R8 / RG8
                internalTexture.width = mipmap.width; // need to set width/height so that the call to _uploadDataToTextureDirectly uses the right dimensions
                internalTexture.height = mipmap.height;
                this._engine._uploadDataToTextureDirectly(internalTexture, mipmap.data, 0, t, undefined, true);
            }
            else {
                this._engine._uploadCompressedDataToTextureDirectly(internalTexture, data.transcodedFormat, mipmap.width, mipmap.height, mipmap.data, 0, t);
            }
        }
        internalTexture._extension = ".ktx2";
        internalTexture.width = data.mipmaps[0].width;
        internalTexture.height = data.mipmaps[0].height;
        internalTexture.isReady = true;
        this._engine._bindTextureDirectly(oglTexture2D, null);
    }
    /**
     * Checks if the given data starts with a KTX2 file identifier.
     * @param data the data to check
     * @returns true if the data is a KTX2 file or false otherwise
     */
    static IsValid(data) {
        if (data.byteLength >= 12) {
            // '«', 'K', 'T', 'X', ' ', '2', '0', '»', '\r', '\n', '\x1A', '\n'
            const identifier = new Uint8Array(data.buffer, data.byteOffset, 12);
            if (identifier[0] === 0xab &&
                identifier[1] === 0x4b &&
                identifier[2] === 0x54 &&
                identifier[3] === 0x58 &&
                identifier[4] === 0x20 &&
                identifier[5] === 0x32 &&
                identifier[6] === 0x30 &&
                identifier[7] === 0xbb &&
                identifier[8] === 0x0d &&
                identifier[9] === 0x0a &&
                identifier[10] === 0x1a &&
                identifier[11] === 0x0a) {
                return true;
            }
        }
        return false;
    }
}
/**
 * URLs to use when loading the KTX2 decoder module as well as its dependencies
 * If a url is null, the default url is used (pointing to https://preview.babylonjs.com)
 * Note that jsDecoderModule can't be null and that the other dependencies will only be loaded if necessary
 * Urls you can change:
 *     URLConfig.jsDecoderModule
 *     URLConfig.wasmUASTCToASTC
 *     URLConfig.wasmUASTCToBC7
 *     URLConfig.wasmUASTCToRGBA_UNORM
 *     URLConfig.wasmUASTCToRGBA_SRGB
 *     URLConfig.wasmUASTCToR8_UNORM
 *     URLConfig.wasmUASTCToRG8_UNORM
 *     URLConfig.jsMSCTranscoder
 *     URLConfig.wasmMSCTranscoder
 *     URLConfig.wasmZSTDDecoder
 * You can see their default values in this PG: https://playground.babylonjs.com/#EIJH8L#29
 */
KhronosTextureContainer2.URLConfig = {
    jsDecoderModule: "https://cdn.babylonjs.com/babylon.ktx2Decoder.js",
    wasmUASTCToASTC: null,
    wasmUASTCToBC7: null,
    wasmUASTCToRGBA_UNORM: null,
    wasmUASTCToRGBA_SRGB: null,
    wasmUASTCToR8_UNORM: null,
    wasmUASTCToRG8_UNORM: null,
    jsMSCTranscoder: null,
    wasmMSCTranscoder: null,
    wasmZSTDDecoder: null,
};
/**
 * Default number of workers used to handle data decoding
 */
KhronosTextureContainer2.DefaultNumWorkers = KhronosTextureContainer2.GetDefaultNumWorkers();
/**
 * Default configuration for the KTX2 decoder.
 * The options defined in this way have priority over those passed when creating a KTX2 texture with new Texture(...).
 */
KhronosTextureContainer2.DefaultDecoderOptions = new DefaultKTX2DecoderOptions();
//# sourceMappingURL=khronosTextureContainer2.js.map

/***/ }),

/***/ 51137:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   V: () => (/* binding */ Logger)
/* harmony export */ });
/* eslint-disable no-console */
/**
 * Logger used throughout the application to allow configuration of
 * the log level required for the messages.
 */
class Logger {
    static _CheckLimit(message, limit) {
        let entry = Logger._LogLimitOutputs[message];
        if (!entry) {
            entry = { limit, current: 1 };
            Logger._LogLimitOutputs[message] = entry;
        }
        else {
            entry.current++;
        }
        return entry.current <= entry.limit;
    }
    static _GenerateLimitMessage(message, level = 1) {
        const entry = Logger._LogLimitOutputs[message];
        if (!entry || !Logger.MessageLimitReached) {
            return;
        }
        const type = this._Levels[level];
        if (entry.current === entry.limit) {
            Logger[type.name](Logger.MessageLimitReached.replace(/%LIMIT%/g, "" + entry.limit).replace(/%TYPE%/g, type.name ?? ""));
        }
    }
    static _AddLogEntry(entry) {
        Logger._LogCache = entry + Logger._LogCache;
        if (Logger.OnNewCacheEntry) {
            Logger.OnNewCacheEntry(entry);
        }
    }
    static _FormatMessage(message) {
        const padStr = (i) => (i < 10 ? "0" + i : "" + i);
        const date = new Date();
        return "[" + padStr(date.getHours()) + ":" + padStr(date.getMinutes()) + ":" + padStr(date.getSeconds()) + "]: " + message;
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static _LogDisabled(message, limit) {
        // nothing to do
    }
    static _LogEnabled(level = 1, message, limit) {
        // take first message if array
        const msg = Array.isArray(message) ? message[0] : message;
        if (limit !== undefined && !Logger._CheckLimit(msg, limit)) {
            return;
        }
        const formattedMessage = Logger._FormatMessage(msg);
        const type = this._Levels[level];
        const optionals = Array.isArray(message) ? message.slice(1) : [];
        type.logFunc && type.logFunc("BJS - " + formattedMessage, ...optionals);
        const entry = `<div style='color:${type.color}'>${formattedMessage}</div><br>`;
        Logger._AddLogEntry(entry);
        Logger._GenerateLimitMessage(msg, level);
    }
    /**
     * Gets current log cache (list of logs)
     */
    static get LogCache() {
        return Logger._LogCache;
    }
    /**
     * Clears the log cache
     */
    static ClearLogCache() {
        Logger._LogCache = "";
        Logger._LogLimitOutputs = {};
        Logger.errorsCount = 0;
    }
    /**
     * Sets the current log level (MessageLogLevel / WarningLogLevel / ErrorLogLevel)
     */
    static set LogLevels(level) {
        Logger.Log = Logger._LogDisabled;
        Logger.Warn = Logger._LogDisabled;
        Logger.Error = Logger._LogDisabled;
        [Logger.MessageLogLevel, Logger.WarningLogLevel, Logger.ErrorLogLevel].forEach((l) => {
            if ((level & l) === l) {
                const type = this._Levels[l];
                Logger[type.name] = Logger._LogEnabled.bind(Logger, l);
            }
        });
    }
}
/**
 * No log
 */
Logger.NoneLogLevel = 0;
/**
 * Only message logs
 */
Logger.MessageLogLevel = 1;
/**
 * Only warning logs
 */
Logger.WarningLogLevel = 2;
/**
 * Only error logs
 */
Logger.ErrorLogLevel = 4;
/**
 * All logs
 */
Logger.AllLogLevel = 7;
/**
 * Message to display when a message has been logged too many times
 */
Logger.MessageLimitReached = "Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.";
Logger._LogCache = "";
Logger._LogLimitOutputs = {};
// levels according to the (binary) numbering.
Logger._Levels = [
    {},
    { color: "white", logFunc: console.log, name: "Log" },
    { color: "orange", logFunc: console.warn, name: "Warn" },
    {},
    { color: "red", logFunc: console.error, name: "Error" },
];
/**
 * Gets a value indicating the number of loading errors
 * @ignorenaming
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
Logger.errorsCount = 0;
/**
 * Log a message to the console
 */
Logger.Log = Logger._LogEnabled.bind(Logger, Logger.MessageLogLevel);
/**
 * Write a warning message to the console
 */
Logger.Warn = Logger._LogEnabled.bind(Logger, Logger.WarningLogLevel);
/**
 * Write an error message to the console
 */
Logger.Error = Logger._LogEnabled.bind(Logger, Logger.ErrorLogLevel);
//# sourceMappingURL=logger.js.map

/***/ }),

/***/ 99848:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   cP: () => (/* binding */ Observable),
/* harmony export */   nu: () => (/* binding */ Observer),
/* harmony export */   qO: () => (/* binding */ EventState)
/* harmony export */ });
const isWeakRefSupported = typeof WeakRef !== "undefined";
/**
 * A class serves as a medium between the observable and its observers
 */
class EventState {
    /**
     * Create a new EventState
     * @param mask defines the mask associated with this state
     * @param skipNextObservers defines a flag which will instruct the observable to skip following observers when set to true
     * @param target defines the original target of the state
     * @param currentTarget defines the current target of the state
     */
    constructor(mask, skipNextObservers = false, target, currentTarget) {
        this.initialize(mask, skipNextObservers, target, currentTarget);
    }
    /**
     * Initialize the current event state
     * @param mask defines the mask associated with this state
     * @param skipNextObservers defines a flag which will instruct the observable to skip following observers when set to true
     * @param target defines the original target of the state
     * @param currentTarget defines the current target of the state
     * @returns the current event state
     */
    initialize(mask, skipNextObservers = false, target, currentTarget) {
        this.mask = mask;
        this.skipNextObservers = skipNextObservers;
        this.target = target;
        this.currentTarget = currentTarget;
        return this;
    }
}
/**
 * Represent an Observer registered to a given Observable object.
 */
class Observer {
    /**
     * Creates a new observer
     * @param callback defines the callback to call when the observer is notified
     * @param mask defines the mask of the observer (used to filter notifications)
     * @param scope defines the current scope used to restore the JS context
     */
    constructor(
    /**
     * Defines the callback to call when the observer is notified
     */
    callback, 
    /**
     * Defines the mask of the observer (used to filter notifications)
     */
    mask, 
    /**
     * [null] Defines the current scope used to restore the JS context
     */
    scope = null) {
        this.callback = callback;
        this.mask = mask;
        this.scope = scope;
        /** @internal */
        this._willBeUnregistered = false;
        /**
         * Gets or sets a property defining that the observer as to be unregistered after the next notification
         */
        this.unregisterOnNextCall = false;
        /**
         * this function can be used to remove the observer from the observable.
         * It will be set by the observable that the observer belongs to.
         * @internal
         */
        this._remove = null;
    }
    /**
     * Remove the observer from its observable
     * This can be used instead of using the observable's remove function.
     */
    remove() {
        if (this._remove) {
            this._remove();
        }
    }
}
/**
 * The Observable class is a simple implementation of the Observable pattern.
 *
 * There's one slight particularity though: a given Observable can notify its observer using a particular mask value, only the Observers registered with this mask value will be notified.
 * This enable a more fine grained execution without having to rely on multiple different Observable objects.
 * For instance you may have a given Observable that have four different types of notifications: Move (mask = 0x01), Stop (mask = 0x02), Turn Right (mask = 0X04), Turn Left (mask = 0X08).
 * A given observer can register itself with only Move and Stop (mask = 0x03), then it will only be notified when one of these two occurs and will never be for Turn Left/Right.
 */
class Observable {
    /**
     * Create an observable from a Promise.
     * @param promise a promise to observe for fulfillment.
     * @param onErrorObservable an observable to notify if a promise was rejected.
     * @returns the new Observable
     */
    static FromPromise(promise, onErrorObservable) {
        const observable = new Observable();
        promise
            .then((ret) => {
            observable.notifyObservers(ret);
        })
            .catch((err) => {
            if (onErrorObservable) {
                onErrorObservable.notifyObservers(err);
            }
            else {
                throw err;
            }
        });
        return observable;
    }
    /**
     * Gets the list of observers
     * Note that observers that were recently deleted may still be present in the list because they are only really deleted on the next javascript tick!
     */
    get observers() {
        return this._observers;
    }
    /**
     * Creates a new observable
     * @param onObserverAdded defines a callback to call when a new observer is added
     * @param notifyIfTriggered If set to true the observable will notify when an observer was added if the observable was already triggered.
     */
    constructor(onObserverAdded, 
    /**
     * [false] If set to true the observable will notify when an observer was added if the observable was already triggered.
     * This is helpful to single-state observables like the scene onReady or the dispose observable.
     */
    notifyIfTriggered = false) {
        this.notifyIfTriggered = notifyIfTriggered;
        this._observers = new Array();
        this._numObserversMarkedAsDeleted = 0;
        this._hasNotified = false;
        this._eventState = new EventState(0);
        if (onObserverAdded) {
            this._onObserverAdded = onObserverAdded;
        }
    }
    add(callback, mask = -1, insertFirst = false, scope = null, unregisterOnFirstCall = false) {
        if (!callback) {
            return null;
        }
        const observer = new Observer(callback, mask, scope);
        observer.unregisterOnNextCall = unregisterOnFirstCall;
        if (insertFirst) {
            this._observers.unshift(observer);
        }
        else {
            this._observers.push(observer);
        }
        if (this._onObserverAdded) {
            this._onObserverAdded(observer);
        }
        // If the observable was already triggered and the observable is set to notify if triggered, notify the new observer
        if (this._hasNotified && this.notifyIfTriggered) {
            if (this._lastNotifiedValue !== undefined) {
                this.notifyObserver(observer, this._lastNotifiedValue);
            }
        }
        // attach the remove function to the observer
        const observableWeakRef = isWeakRefSupported ? new WeakRef(this) : { deref: () => this };
        observer._remove = () => {
            const observable = observableWeakRef.deref();
            if (observable) {
                observable._remove(observer);
            }
        };
        return observer;
    }
    addOnce(callback) {
        return this.add(callback, undefined, undefined, undefined, true);
    }
    /**
     * Remove an Observer from the Observable object
     * @param observer the instance of the Observer to remove
     * @returns false if it doesn't belong to this Observable
     */
    remove(observer) {
        if (!observer) {
            return false;
        }
        observer._remove = null;
        const index = this._observers.indexOf(observer);
        if (index !== -1) {
            this._deferUnregister(observer);
            return true;
        }
        return false;
    }
    /**
     * Remove a callback from the Observable object
     * @param callback the callback to remove
     * @param scope optional scope. If used only the callbacks with this scope will be removed
     * @returns false if it doesn't belong to this Observable
     */
    removeCallback(callback, scope) {
        for (let index = 0; index < this._observers.length; index++) {
            const observer = this._observers[index];
            if (observer._willBeUnregistered) {
                continue;
            }
            if (observer.callback === callback && (!scope || scope === observer.scope)) {
                this._deferUnregister(observer);
                return true;
            }
        }
        return false;
    }
    /**
     * @internal
     */
    _deferUnregister(observer) {
        if (observer._willBeUnregistered) {
            return;
        }
        this._numObserversMarkedAsDeleted++;
        observer.unregisterOnNextCall = false;
        observer._willBeUnregistered = true;
        setTimeout(() => {
            this._remove(observer);
        }, 0);
    }
    // This should only be called when not iterating over _observers to avoid callback skipping.
    // Removes an observer from the _observer Array.
    _remove(observer, updateCounter = true) {
        if (!observer) {
            return false;
        }
        const index = this._observers.indexOf(observer);
        if (index !== -1) {
            if (updateCounter) {
                this._numObserversMarkedAsDeleted--;
            }
            this._observers.splice(index, 1);
            return true;
        }
        return false;
    }
    /**
     * Moves the observable to the top of the observer list making it get called first when notified
     * @param observer the observer to move
     */
    makeObserverTopPriority(observer) {
        this._remove(observer, false);
        this._observers.unshift(observer);
    }
    /**
     * Moves the observable to the bottom of the observer list making it get called last when notified
     * @param observer the observer to move
     */
    makeObserverBottomPriority(observer) {
        this._remove(observer, false);
        this._observers.push(observer);
    }
    /**
     * Notify all Observers by calling their respective callback with the given data
     * Will return true if all observers were executed, false if an observer set skipNextObservers to true, then prevent the subsequent ones to execute
     * @param eventData defines the data to send to all observers
     * @param mask defines the mask of the current notification (observers with incompatible mask (ie mask & observer.mask === 0) will not be notified)
     * @param target defines the original target of the state
     * @param currentTarget defines the current target of the state
     * @param userInfo defines any user info to send to observers
     * @returns false if the complete observer chain was not processed (because one observer set the skipNextObservers to true)
     */
    notifyObservers(eventData, mask = -1, target, currentTarget, userInfo) {
        // this prevents potential memory leaks - if an object is disposed but the observable doesn't get cleared.
        if (this.notifyIfTriggered) {
            this._hasNotified = true;
            this._lastNotifiedValue = eventData;
        }
        if (!this._observers.length) {
            return true;
        }
        const state = this._eventState;
        state.mask = mask;
        state.target = target;
        state.currentTarget = currentTarget;
        state.skipNextObservers = false;
        state.lastReturnValue = eventData;
        state.userInfo = userInfo;
        for (const obs of this._observers) {
            if (obs._willBeUnregistered) {
                continue;
            }
            if (obs.mask & mask) {
                if (obs.unregisterOnNextCall) {
                    this._deferUnregister(obs);
                }
                if (obs.scope) {
                    state.lastReturnValue = obs.callback.apply(obs.scope, [eventData, state]);
                }
                else {
                    state.lastReturnValue = obs.callback(eventData, state);
                }
            }
            if (state.skipNextObservers) {
                return false;
            }
        }
        return true;
    }
    /**
     * Notify a specific observer
     * @param observer defines the observer to notify
     * @param eventData defines the data to be sent to each callback
     * @param mask is used to filter observers defaults to -1
     */
    notifyObserver(observer, eventData, mask = -1) {
        // this prevents potential memory leaks - if an object is disposed but the observable doesn't get cleared.
        if (this.notifyIfTriggered) {
            this._hasNotified = true;
            this._lastNotifiedValue = eventData;
        }
        if (observer._willBeUnregistered) {
            return;
        }
        const state = this._eventState;
        state.mask = mask;
        state.skipNextObservers = false;
        if (observer.unregisterOnNextCall) {
            this._deferUnregister(observer);
        }
        observer.callback(eventData, state);
    }
    /**
     * Gets a boolean indicating if the observable has at least one observer
     * @returns true is the Observable has at least one Observer registered
     */
    hasObservers() {
        return this._observers.length - this._numObserversMarkedAsDeleted > 0;
    }
    /**
     * Clear the list of observers
     */
    clear() {
        while (this._observers.length) {
            const o = this._observers.pop();
            if (o) {
                o._remove = null;
            }
        }
        this._onObserverAdded = null;
        this._numObserversMarkedAsDeleted = 0;
        this.cleanLastNotifiedState();
    }
    /**
     * Clean the last notified state - both the internal last value and the has-notified flag
     */
    cleanLastNotifiedState() {
        this._hasNotified = false;
        this._lastNotifiedValue = undefined;
    }
    /**
     * Clone the current observable
     * @returns a new observable
     */
    clone() {
        const result = new Observable();
        result._observers = this._observers.slice(0);
        return result;
    }
    /**
     * Does this observable handles observer registered with a given mask
     * @param mask defines the mask to be tested
     * @returns whether or not one observer registered with the given mask is handled
     **/
    hasSpecificMask(mask = -1) {
        for (const obs of this._observers) {
            if (obs.mask & mask || obs.mask === mask) {
                return true;
            }
        }
        return false;
    }
}
//# sourceMappingURL=observable.js.map

/***/ }),

/***/ 24296:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (/* binding */ PerfCounter)
/* harmony export */ });
/* harmony import */ var _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76237);

/**
 * This class is used to track a performance counter which is number based.
 * The user has access to many properties which give statistics of different nature.
 *
 * The implementer can track two kinds of Performance Counter: time and count.
 * For time you can optionally call fetchNewFrame() to notify the start of a new frame to monitor, then call beginMonitoring() to start and endMonitoring() to record the lapsed time. endMonitoring takes a newFrame parameter for you to specify if the monitored time should be set for a new frame or accumulated to the current frame being monitored.
 * For count you first have to call fetchNewFrame() to notify the start of a new frame to monitor, then call addCount() how many time required to increment the count value you monitor.
 */
class PerfCounter {
    /**
     * Returns the smallest value ever
     */
    get min() {
        return this._min;
    }
    /**
     * Returns the biggest value ever
     */
    get max() {
        return this._max;
    }
    /**
     * Returns the average value since the performance counter is running
     */
    get average() {
        return this._average;
    }
    /**
     * Returns the average value of the last second the counter was monitored
     */
    get lastSecAverage() {
        return this._lastSecAverage;
    }
    /**
     * Returns the current value
     */
    get current() {
        return this._current;
    }
    /**
     * Gets the accumulated total
     */
    get total() {
        return this._totalAccumulated;
    }
    /**
     * Gets the total value count
     */
    get count() {
        return this._totalValueCount;
    }
    /**
     * Creates a new counter
     */
    constructor() {
        this._startMonitoringTime = 0;
        this._min = 0;
        this._max = 0;
        this._average = 0;
        this._lastSecAverage = 0;
        this._current = 0;
        this._totalValueCount = 0;
        this._totalAccumulated = 0;
        this._lastSecAccumulated = 0;
        this._lastSecTime = 0;
        this._lastSecValueCount = 0;
    }
    /**
     * Call this method to start monitoring a new frame.
     * This scenario is typically used when you accumulate monitoring time many times for a single frame, you call this method at the start of the frame, then beginMonitoring to start recording and endMonitoring(false) to accumulated the recorded time to the PerfCounter or addCount() to accumulate a monitored count.
     */
    fetchNewFrame() {
        this._totalValueCount++;
        this._current = 0;
        this._lastSecValueCount++;
    }
    /**
     * Call this method to monitor a count of something (e.g. mesh drawn in viewport count)
     * @param newCount the count value to add to the monitored count
     * @param fetchResult true when it's the last time in the frame you add to the counter and you wish to update the statistics properties (min/max/average), false if you only want to update statistics.
     */
    addCount(newCount, fetchResult) {
        if (!PerfCounter.Enabled) {
            return;
        }
        this._current += newCount;
        if (fetchResult) {
            this._fetchResult();
        }
    }
    /**
     * Start monitoring this performance counter
     */
    beginMonitoring() {
        if (!PerfCounter.Enabled) {
            return;
        }
        this._startMonitoringTime = _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__/* .PrecisionDate */ .j.Now;
    }
    /**
     * Compute the time lapsed since the previous beginMonitoring() call.
     * @param newFrame true by default to fetch the result and monitor a new frame, if false the time monitored will be added to the current frame counter
     */
    endMonitoring(newFrame = true) {
        if (!PerfCounter.Enabled) {
            return;
        }
        if (newFrame) {
            this.fetchNewFrame();
        }
        const currentTime = _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__/* .PrecisionDate */ .j.Now;
        this._current = currentTime - this._startMonitoringTime;
        if (newFrame) {
            this._fetchResult();
        }
    }
    /**
     * Call this method to end the monitoring of a frame.
     * This scenario is typically used when you accumulate monitoring time many times for a single frame, you call this method at the end of the frame, after beginMonitoring to start recording and endMonitoring(false) to accumulated the recorded time to the PerfCounter or addCount() to accumulate a monitored count.
     */
    endFrame() {
        this._fetchResult();
    }
    /** @internal */
    _fetchResult() {
        this._totalAccumulated += this._current;
        this._lastSecAccumulated += this._current;
        // Min/Max update
        this._min = Math.min(this._min, this._current);
        this._max = Math.max(this._max, this._current);
        this._average = this._totalAccumulated / this._totalValueCount;
        // Reset last sec?
        const now = _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__/* .PrecisionDate */ .j.Now;
        if (now - this._lastSecTime > 1000) {
            this._lastSecAverage = this._lastSecAccumulated / this._lastSecValueCount;
            this._lastSecTime = now;
            this._lastSecAccumulated = 0;
            this._lastSecValueCount = 0;
        }
    }
}
/**
 * Gets or sets a global boolean to turn on and off all the counters
 */
PerfCounter.Enabled = true;
//# sourceMappingURL=perfCounter.js.map

/***/ }),

/***/ 84085:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   K: () => (/* binding */ RollingAverage),
/* harmony export */   r: () => (/* binding */ PerformanceMonitor)
/* harmony export */ });
/* harmony import */ var _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76237);

/**
 * Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window
 */
class PerformanceMonitor {
    /**
     * constructor
     * @param frameSampleSize The number of samples required to saturate the sliding window
     */
    constructor(frameSampleSize = 30) {
        this._enabled = true;
        this._rollingFrameTime = new RollingAverage(frameSampleSize);
    }
    /**
     * Samples current frame
     * @param timeMs A timestamp in milliseconds of the current frame to compare with other frames
     */
    sampleFrame(timeMs = _precisionDate_js__WEBPACK_IMPORTED_MODULE_0__/* .PrecisionDate */ .j.Now) {
        if (!this._enabled) {
            return;
        }
        if (this._lastFrameTimeMs != null) {
            const dt = timeMs - this._lastFrameTimeMs;
            this._rollingFrameTime.add(dt);
        }
        this._lastFrameTimeMs = timeMs;
    }
    /**
     * Returns the average frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
     */
    get averageFrameTime() {
        return this._rollingFrameTime.average;
    }
    /**
     * Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
     */
    get averageFrameTimeVariance() {
        return this._rollingFrameTime.variance;
    }
    /**
     * Returns the frame time of the most recent frame
     */
    get instantaneousFrameTime() {
        return this._rollingFrameTime.history(0);
    }
    /**
     * Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)
     */
    get averageFPS() {
        return 1000.0 / this._rollingFrameTime.average;
    }
    /**
     * Returns the average framerate in frames per second using the most recent frame time
     */
    get instantaneousFPS() {
        const history = this._rollingFrameTime.history(0);
        if (history === 0) {
            return 0;
        }
        return 1000.0 / history;
    }
    /**
     * Returns true if enough samples have been taken to completely fill the sliding window
     */
    get isSaturated() {
        return this._rollingFrameTime.isSaturated();
    }
    /**
     * Enables contributions to the sliding window sample set
     */
    enable() {
        this._enabled = true;
    }
    /**
     * Disables contributions to the sliding window sample set
     * Samples will not be interpolated over the disabled period
     */
    disable() {
        this._enabled = false;
        //clear last sample to avoid interpolating over the disabled period when next enabled
        this._lastFrameTimeMs = null;
    }
    /**
     * Returns true if sampling is enabled
     */
    get isEnabled() {
        return this._enabled;
    }
    /**
     * Resets performance monitor
     */
    reset() {
        //clear last sample to avoid interpolating over the disabled period when next enabled
        this._lastFrameTimeMs = null;
        //wipe record
        this._rollingFrameTime.reset();
    }
}
/**
 * RollingAverage
 *
 * Utility to efficiently compute the rolling average and variance over a sliding window of samples
 */
class RollingAverage {
    /**
     * constructor
     * @param length The number of samples required to saturate the sliding window
     */
    constructor(length) {
        this._samples = new Array(length);
        this.reset();
    }
    /**
     * Adds a sample to the sample set
     * @param v The sample value
     */
    add(v) {
        //http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
        let delta;
        //we need to check if we've already wrapped round
        if (this.isSaturated()) {
            //remove bottom of stack from mean
            const bottomValue = this._samples[this._pos];
            delta = bottomValue - this.average;
            this.average -= delta / (this._sampleCount - 1);
            this._m2 -= delta * (bottomValue - this.average);
        }
        else {
            this._sampleCount++;
        }
        //add new value to mean
        delta = v - this.average;
        this.average += delta / this._sampleCount;
        this._m2 += delta * (v - this.average);
        //set the new variance
        this.variance = this._m2 / (this._sampleCount - 1);
        this._samples[this._pos] = v;
        this._pos++;
        this._pos %= this._samples.length; //positive wrap around
    }
    /**
     * Returns previously added values or null if outside of history or outside the sliding window domain
     * @param i Index in history. For example, pass 0 for the most recent value and 1 for the value before that
     * @returns Value previously recorded with add() or null if outside of range
     */
    history(i) {
        if (i >= this._sampleCount || i >= this._samples.length) {
            return 0;
        }
        const i0 = this._wrapPosition(this._pos - 1.0);
        return this._samples[this._wrapPosition(i0 - i)];
    }
    /**
     * Returns true if enough samples have been taken to completely fill the sliding window
     * @returns true if sample-set saturated
     */
    isSaturated() {
        return this._sampleCount >= this._samples.length;
    }
    /**
     * Resets the rolling average (equivalent to 0 samples taken so far)
     */
    reset() {
        this.average = 0;
        this.variance = 0;
        this._sampleCount = 0;
        this._pos = 0;
        this._m2 = 0;
    }
    /**
     * Wraps a value around the sample range boundaries
     * @param i Position in sample range, for example if the sample length is 5, and i is -3, then 2 will be returned.
     * @returns Wrapped position in sample range
     */
    _wrapPosition(i) {
        const max = this._samples.length;
        return ((i % max) + max) % max;
    }
}
//# sourceMappingURL=performanceMonitor.js.map

/***/ }),

/***/ 23822:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   G: () => (/* binding */ PivotTools)
/* harmony export */ });
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79923);

/**
 * Class containing a set of static utilities functions for managing Pivots
 * @internal
 */
class PivotTools {
    /**
     * @internal
     */
    static _RemoveAndStorePivotPoint(mesh) {
        if (mesh && PivotTools._PivotCached === 0) {
            // Save old pivot and set pivot to 0,0,0
            mesh.getPivotPointToRef(PivotTools._OldPivotPoint);
            PivotTools._PivotPostMultiplyPivotMatrix = mesh._postMultiplyPivotMatrix;
            if (!PivotTools._OldPivotPoint.equalsToFloats(0, 0, 0)) {
                mesh.setPivotMatrix(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Matrix */ .uq.IdentityReadOnly);
                PivotTools._OldPivotPoint.subtractToRef(mesh.getPivotPoint(), PivotTools._PivotTranslation);
                PivotTools._PivotTmpVector.copyFromFloats(1, 1, 1);
                PivotTools._PivotTmpVector.subtractInPlace(mesh.scaling);
                PivotTools._PivotTmpVector.multiplyInPlace(PivotTools._PivotTranslation);
                mesh.position.addInPlace(PivotTools._PivotTmpVector);
            }
        }
        PivotTools._PivotCached++;
    }
    /**
     * @internal
     */
    static _RestorePivotPoint(mesh) {
        if (mesh && !PivotTools._OldPivotPoint.equalsToFloats(0, 0, 0) && PivotTools._PivotCached === 1) {
            mesh.setPivotPoint(PivotTools._OldPivotPoint);
            mesh._postMultiplyPivotMatrix = PivotTools._PivotPostMultiplyPivotMatrix;
            PivotTools._PivotTmpVector.copyFromFloats(1, 1, 1);
            PivotTools._PivotTmpVector.subtractInPlace(mesh.scaling);
            PivotTools._PivotTmpVector.multiplyInPlace(PivotTools._PivotTranslation);
            mesh.position.subtractInPlace(PivotTools._PivotTmpVector);
        }
        this._PivotCached--;
    }
}
// Stores the state of the pivot cache (_oldPivotPoint, _pivotTranslation)
// store/remove pivot point should only be applied during their outermost calls
PivotTools._PivotCached = 0;
PivotTools._OldPivotPoint = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq();
PivotTools._PivotTranslation = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq();
PivotTools._PivotTmpVector = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq();
PivotTools._PivotPostMultiplyPivotMatrix = false;
//# sourceMappingURL=pivotTools.js.map

/***/ }),

/***/ 76237:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   j: () => (/* binding */ PrecisionDate)
/* harmony export */ });
/* harmony import */ var _domManagement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18790);

/**
 * Class containing a set of static utilities functions for precision date
 */
class PrecisionDate {
    /**
     * Gets either window.performance.now() if supported or Date.now() else
     */
    static get Now() {
        if ((0,_domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .IsWindowObjectExist */ .BA)() && window.performance && window.performance.now) {
            return window.performance.now();
        }
        return Date.now();
    }
}
//# sourceMappingURL=precisionDate.js.map

/***/ }),

/***/ 61326:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   a: () => (/* binding */ RetryStrategy)
/* harmony export */ });
/**
 * Class used to define a retry strategy when error happens while loading assets
 */
class RetryStrategy {
    /**
     * Function used to defines an exponential back off strategy
     * @param maxRetries defines the maximum number of retries (3 by default)
     * @param baseInterval defines the interval between retries
     * @returns the strategy function to use
     */
    static ExponentialBackoff(maxRetries = 3, baseInterval = 500) {
        return (url, request, retryIndex) => {
            if (request.status !== 0 || retryIndex >= maxRetries || url.indexOf("file:") !== -1) {
                return -1;
            }
            return Math.pow(2, retryIndex) * baseInterval;
        };
    }
}
//# sourceMappingURL=retryStrategy.js.map

/***/ }),

/***/ 97126:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   G: () => (/* binding */ RGBDTextureTools)
/* harmony export */ });
/* harmony import */ var _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77891);
/* harmony import */ var _textureTools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42683);



/**
 * Class used to host RGBD texture specific utilities
 */
class RGBDTextureTools {
    /**
     * Expand the RGBD Texture from RGBD to Half Float if possible.
     * @param texture the texture to expand.
     */
    static ExpandRGBDTexture(texture) {
        const internalTexture = texture._texture;
        if (!internalTexture || !texture.isRGBD) {
            return;
        }
        // Gets everything ready.
        const engine = internalTexture.getEngine();
        const caps = engine.getCaps();
        const isReady = internalTexture.isReady;
        let expandTexture = false;
        // If half float available we can uncompress the texture
        if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {
            expandTexture = true;
            internalTexture.type = 2;
        }
        // If full float available we can uncompress the texture
        else if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {
            expandTexture = true;
            internalTexture.type = 1;
        }
        if (expandTexture) {
            // Do not use during decode.
            internalTexture.isReady = false;
            internalTexture._isRGBD = false;
            internalTexture.invertY = false;
        }
        const expandRGBDTexture = async () => {
            const isWebGPU = engine.isWebGPU;
            const shaderLanguage = isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */;
            internalTexture.isReady = false;
            if (isWebGPU) {
                await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 30371)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85035))]);
            }
            else {
                await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 9682)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 32646))]);
            }
            // Expand the texture if possible
            // Simply run through the decode PP.
            const rgbdPostProcess = new _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_0__/* .PostProcess */ .w("rgbdDecode", "rgbdDecode", null, null, 1, null, 3, engine, false, undefined, internalTexture.type, undefined, null, false, undefined, shaderLanguage);
            rgbdPostProcess.externalTextureSamplerBinding = true;
            // Hold the output of the decoding.
            const expandedTexture = engine.createRenderTargetTexture(internalTexture.width, {
                generateDepthBuffer: false,
                generateMipMaps: false,
                generateStencilBuffer: false,
                samplingMode: internalTexture.samplingMode,
                type: internalTexture.type,
                format: 5,
            });
            rgbdPostProcess.onEffectCreatedObservable.addOnce((e) => {
                e.executeWhenCompiled(() => {
                    // PP Render Pass
                    rgbdPostProcess.onApply = (effect) => {
                        effect._bindTexture("textureSampler", internalTexture);
                        effect.setFloat2("scale", 1, 1);
                    };
                    texture.getScene().postProcessManager.directRender([rgbdPostProcess], expandedTexture, true);
                    // Cleanup
                    engine.restoreDefaultFramebuffer();
                    engine._releaseTexture(internalTexture);
                    if (rgbdPostProcess) {
                        rgbdPostProcess.dispose();
                    }
                    // Internal Swap
                    expandedTexture._swapAndDie(internalTexture);
                    // Ready to get rolling again.
                    internalTexture.isReady = true;
                });
            });
        };
        if (expandTexture) {
            if (isReady) {
                expandRGBDTexture();
            }
            else {
                texture.onLoadObservable.addOnce(expandRGBDTexture);
            }
        }
    }
    /**
     * Encode the texture to RGBD if possible.
     * @param internalTexture the texture to encode
     * @param scene the scene hosting the texture
     * @param outputTextureType type of the texture in which the encoding is performed
     * @returns a promise with the internalTexture having its texture replaced by the result of the processing
     */
    static EncodeTextureToRGBD(internalTexture, scene, outputTextureType = 0) {
        return (0,_textureTools_js__WEBPACK_IMPORTED_MODULE_1__/* .ApplyPostProcess */ .Qs)("rgbdEncode", internalTexture, scene, outputTextureType, 1, 5);
    }
}
//# sourceMappingURL=rgbdTextureTools.js.map

/***/ }),

/***/ 17931:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   L: () => (/* binding */ SmartArray),
/* harmony export */   b: () => (/* binding */ SmartArrayNoDuplicate)
/* harmony export */ });
/**
 * Defines an GC Friendly array where the backfield array do not shrink to prevent over allocations.
 */
class SmartArray {
    /**
     * Instantiates a Smart Array.
     * @param capacity defines the default capacity of the array.
     */
    constructor(capacity) {
        /**
         * The active length of the array.
         */
        this.length = 0;
        this.data = new Array(capacity);
        this._id = SmartArray._GlobalId++;
    }
    /**
     * Pushes a value at the end of the active data.
     * @param value defines the object to push in the array.
     */
    push(value) {
        this.data[this.length++] = value;
        if (this.length > this.data.length) {
            this.data.length *= 2;
        }
    }
    /**
     * Iterates over the active data and apply the lambda to them.
     * @param func defines the action to apply on each value.
     */
    forEach(func) {
        for (let index = 0; index < this.length; index++) {
            func(this.data[index]);
        }
    }
    /**
     * Sorts the full sets of data.
     * @param compareFn defines the comparison function to apply.
     */
    sort(compareFn) {
        this.data.sort(compareFn);
    }
    /**
     * Resets the active data to an empty array.
     */
    reset() {
        this.length = 0;
    }
    /**
     * Releases all the data from the array as well as the array.
     */
    dispose() {
        this.reset();
        if (this.data) {
            this.data.length = 0;
        }
    }
    /**
     * Concats the active data with a given array.
     * @param array defines the data to concatenate with.
     */
    concat(array) {
        if (array.length === 0) {
            return;
        }
        if (this.length + array.length > this.data.length) {
            this.data.length = (this.length + array.length) * 2;
        }
        for (let index = 0; index < array.length; index++) {
            this.data[this.length++] = (array.data || array)[index];
        }
    }
    /**
     * Returns the position of a value in the active data.
     * @param value defines the value to find the index for
     * @returns the index if found in the active data otherwise -1
     */
    indexOf(value) {
        const position = this.data.indexOf(value);
        if (position >= this.length) {
            return -1;
        }
        return position;
    }
    /**
     * Returns whether an element is part of the active data.
     * @param value defines the value to look for
     * @returns true if found in the active data otherwise false
     */
    contains(value) {
        return this.indexOf(value) !== -1;
    }
}
// Statics
SmartArray._GlobalId = 0;
/**
 * Defines an GC Friendly array where the backfield array do not shrink to prevent over allocations.
 * The data in this array can only be present once
 */
class SmartArrayNoDuplicate extends SmartArray {
    constructor() {
        super(...arguments);
        this._duplicateId = 0;
    }
    /**
     * Pushes a value at the end of the active data.
     * THIS DOES NOT PREVENT DUPPLICATE DATA
     * @param value defines the object to push in the array.
     */
    push(value) {
        super.push(value);
        if (!value.__smartArrayFlags) {
            value.__smartArrayFlags = {};
        }
        value.__smartArrayFlags[this._id] = this._duplicateId;
    }
    /**
     * Pushes a value at the end of the active data.
     * If the data is already present, it won t be added again
     * @param value defines the object to push in the array.
     * @returns true if added false if it was already present
     */
    pushNoDuplicate(value) {
        if (value.__smartArrayFlags && value.__smartArrayFlags[this._id] === this._duplicateId) {
            return false;
        }
        this.push(value);
        return true;
    }
    /**
     * Resets the active data to an empty array.
     */
    reset() {
        super.reset();
        this._duplicateId++;
    }
    /**
     * Concats the active data with a given array.
     * This ensures no duplicate will be present in the result.
     * @param array defines the data to concatenate with.
     */
    concatWithNoDuplicate(array) {
        if (array.length === 0) {
            return;
        }
        if (this.length + array.length > this.data.length) {
            this.data.length = (this.length + array.length) * 2;
        }
        for (let index = 0; index < array.length; index++) {
            const item = (array.data || array)[index];
            this.pushNoDuplicate(item);
        }
    }
}
//# sourceMappingURL=smartArray.js.map

/***/ }),

/***/ 87216:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   w: () => (/* binding */ StringDictionary)
/* harmony export */ });
/**
 * This class implement a typical dictionary using a string as key and the generic type T as value.
 * The underlying implementation relies on an associative array to ensure the best performances.
 * The value can be anything including 'null' but except 'undefined'
 */
class StringDictionary {
    constructor() {
        this._count = 0;
        this._data = {};
    }
    /**
     * This will clear this dictionary and copy the content from the 'source' one.
     * If the T value is a custom object, it won't be copied/cloned, the same object will be used
     * @param source the dictionary to take the content from and copy to this dictionary
     */
    copyFrom(source) {
        this.clear();
        source.forEach((t, v) => this.add(t, v));
    }
    /**
     * Get a value based from its key
     * @param key the given key to get the matching value from
     * @returns the value if found, otherwise undefined is returned
     */
    get(key) {
        const val = this._data[key];
        if (val !== undefined) {
            return val;
        }
        return undefined;
    }
    /**
     * Get a value from its key or add it if it doesn't exist.
     * This method will ensure you that a given key/data will be present in the dictionary.
     * @param key the given key to get the matching value from
     * @param factory the factory that will create the value if the key is not present in the dictionary.
     * The factory will only be invoked if there's no data for the given key.
     * @returns the value corresponding to the key.
     */
    getOrAddWithFactory(key, factory) {
        let val = this.get(key);
        if (val !== undefined) {
            return val;
        }
        val = factory(key);
        if (val) {
            this.add(key, val);
        }
        return val;
    }
    /**
     * Get a value from its key if present in the dictionary otherwise add it
     * @param key the key to get the value from
     * @param val if there's no such key/value pair in the dictionary add it with this value
     * @returns the value corresponding to the key
     */
    getOrAdd(key, val) {
        const curVal = this.get(key);
        if (curVal !== undefined) {
            return curVal;
        }
        this.add(key, val);
        return val;
    }
    /**
     * Check if there's a given key in the dictionary
     * @param key the key to check for
     * @returns true if the key is present, false otherwise
     */
    contains(key) {
        return this._data[key] !== undefined;
    }
    /**
     * Add a new key and its corresponding value
     * @param key the key to add
     * @param value the value corresponding to the key
     * @returns true if the operation completed successfully, false if we couldn't insert the key/value because there was already this key in the dictionary
     */
    add(key, value) {
        if (this._data[key] !== undefined) {
            return false;
        }
        this._data[key] = value;
        ++this._count;
        return true;
    }
    /**
     * Update a specific value associated to a key
     * @param key defines the key to use
     * @param value defines the value to store
     * @returns true if the value was updated (or false if the key was not found)
     */
    set(key, value) {
        if (this._data[key] === undefined) {
            return false;
        }
        this._data[key] = value;
        return true;
    }
    /**
     * Get the element of the given key and remove it from the dictionary
     * @param key defines the key to search
     * @returns the value associated with the key or null if not found
     */
    getAndRemove(key) {
        const val = this.get(key);
        if (val !== undefined) {
            delete this._data[key];
            --this._count;
            return val;
        }
        return null;
    }
    /**
     * Remove a key/value from the dictionary.
     * @param key the key to remove
     * @returns true if the item was successfully deleted, false if no item with such key exist in the dictionary
     */
    remove(key) {
        if (this.contains(key)) {
            delete this._data[key];
            --this._count;
            return true;
        }
        return false;
    }
    /**
     * Clear the whole content of the dictionary
     */
    clear() {
        this._data = {};
        this._count = 0;
    }
    /**
     * Gets the current count
     */
    get count() {
        return this._count;
    }
    /**
     * Execute a callback on each key/val of the dictionary.
     * Note that you can remove any element in this dictionary in the callback implementation
     * @param callback the callback to execute on a given key/value pair
     */
    forEach(callback) {
        for (const cur in this._data) {
            const val = this._data[cur];
            callback(cur, val);
        }
    }
    /**
     * Execute a callback on every occurrence of the dictionary until it returns a valid TRes object.
     * If the callback returns null or undefined the method will iterate to the next key/value pair
     * Note that you can remove any element in this dictionary in the callback implementation
     * @param callback the callback to execute, if it return a valid T instanced object the enumeration will stop and the object will be returned
     * @returns the first item
     */
    first(callback) {
        for (const cur in this._data) {
            const val = this._data[cur];
            const res = callback(cur, val);
            if (res) {
                return res;
            }
        }
        return null;
    }
}
//# sourceMappingURL=stringDictionary.js.map

/***/ }),

/***/ 36181:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AV: () => (/* binding */ DecodeBase64ToString),
/* harmony export */   EL: () => (/* binding */ EncodeArrayBufferToBase64),
/* harmony export */   LW: () => (/* binding */ PadNumber),
/* harmony export */   Tq: () => (/* binding */ Decode),
/* harmony export */   UH: () => (/* binding */ StartsWith),
/* harmony export */   jq: () => (/* binding */ EndsWith),
/* harmony export */   nQ: () => (/* binding */ StringTools),
/* harmony export */   yS: () => (/* binding */ DecodeBase64ToBinary)
/* harmony export */ });
/* eslint-disable @typescript-eslint/naming-convention */
/**
 * Checks for a matching suffix at the end of a string (for ES5 and lower)
 * @param str Source string
 * @param suffix Suffix to search for in the source string
 * @returns Boolean indicating whether the suffix was found (true) or not (false)
 * @deprecated Please use native string function instead
 */
const EndsWith = (str, suffix) => {
    return str.endsWith(suffix);
};
/**
 * Checks for a matching suffix at the beginning of a string (for ES5 and lower)
 * @param str Source string
 * @param suffix Suffix to search for in the source string
 * @returns Boolean indicating whether the suffix was found (true) or not (false)
 * @deprecated Please use native string function instead
 */
const StartsWith = (str, suffix) => {
    if (!str) {
        return false;
    }
    return str.startsWith(suffix);
};
/**
 * Decodes a buffer into a string
 * @param buffer The buffer to decode
 * @returns The decoded string
 */
const Decode = (buffer) => {
    if (typeof TextDecoder !== "undefined") {
        return new TextDecoder().decode(buffer);
    }
    let result = "";
    for (let i = 0; i < buffer.byteLength; i++) {
        result += String.fromCharCode(buffer[i]);
    }
    return result;
};
/**
 * Encode a buffer to a base64 string
 * @param buffer defines the buffer to encode
 * @returns the encoded string
 */
const EncodeArrayBufferToBase64 = (buffer) => {
    const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    let output = "";
    let chr1, chr2, chr3, enc1, enc2, enc3, enc4;
    let i = 0;
    const bytes = ArrayBuffer.isView(buffer) ? new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength) : new Uint8Array(buffer);
    while (i < bytes.length) {
        chr1 = bytes[i++];
        chr2 = i < bytes.length ? bytes[i++] : Number.NaN;
        chr3 = i < bytes.length ? bytes[i++] : Number.NaN;
        enc1 = chr1 >> 2;
        enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
        enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
        enc4 = chr3 & 63;
        if (isNaN(chr2)) {
            enc3 = enc4 = 64;
        }
        else if (isNaN(chr3)) {
            enc4 = 64;
        }
        output += keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);
    }
    return output;
};
/**
 * Converts a given base64 string as an ASCII encoded stream of data
 * @param base64Data The base64 encoded string to decode
 * @returns Decoded ASCII string
 */
const DecodeBase64ToString = (base64Data) => {
    return atob(base64Data);
};
/**
 * Converts a given base64 string into an ArrayBuffer of raw byte data
 * @param base64Data The base64 encoded string to decode
 * @returns ArrayBuffer of byte data
 */
const DecodeBase64ToBinary = (base64Data) => {
    const decodedString = DecodeBase64ToString(base64Data);
    const bufferLength = decodedString.length;
    const bufferView = new Uint8Array(new ArrayBuffer(bufferLength));
    for (let i = 0; i < bufferLength; i++) {
        bufferView[i] = decodedString.charCodeAt(i);
    }
    return bufferView.buffer;
};
/**
 * Converts a number to string and pads with preceding zeroes until it is of specified length.
 * @param num the number to convert and pad
 * @param length the expected length of the string
 * @returns the padded string
 */
const PadNumber = (num, length) => {
    let str = String(num);
    while (str.length < length) {
        str = "0" + str;
    }
    return str;
};
/**
 * Helper to manipulate strings
 */
const StringTools = {
    EndsWith,
    StartsWith,
    Decode,
    EncodeArrayBufferToBase64,
    DecodeBase64ToString,
    DecodeBase64ToBinary,
    PadNumber,
};
//# sourceMappingURL=stringTools.js.map

/***/ }),

/***/ 27152:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Y: () => (/* binding */ Tags)
/* harmony export */ });
/* harmony import */ var _andOrNotEvaluator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33619);

/**
 * Class used to store custom tags
 */
class Tags {
    /**
     * Adds support for tags on the given object
     * @param obj defines the object to use
     */
    static EnableFor(obj) {
        obj._tags = obj._tags || {};
        obj.hasTags = () => {
            return Tags.HasTags(obj);
        };
        obj.addTags = (tagsString) => {
            return Tags.AddTagsTo(obj, tagsString);
        };
        obj.removeTags = (tagsString) => {
            return Tags.RemoveTagsFrom(obj, tagsString);
        };
        obj.matchesTagsQuery = (tagsQuery) => {
            return Tags.MatchesQuery(obj, tagsQuery);
        };
    }
    /**
     * Removes tags support
     * @param obj defines the object to use
     */
    static DisableFor(obj) {
        delete obj._tags;
        delete obj.hasTags;
        delete obj.addTags;
        delete obj.removeTags;
        delete obj.matchesTagsQuery;
    }
    /**
     * Gets a boolean indicating if the given object has tags
     * @param obj defines the object to use
     * @returns a boolean
     */
    static HasTags(obj) {
        if (!obj._tags) {
            return false;
        }
        const tags = obj._tags;
        for (const i in tags) {
            if (Object.prototype.hasOwnProperty.call(tags, i)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Gets the tags available on a given object
     * @param obj defines the object to use
     * @param asString defines if the tags must be returned as a string instead of an array of strings
     * @returns the tags
     */
    static GetTags(obj, asString = true) {
        if (!obj._tags) {
            return null;
        }
        if (asString) {
            const tagsArray = [];
            for (const tag in obj._tags) {
                if (Object.prototype.hasOwnProperty.call(obj._tags, tag) && obj._tags[tag] === true) {
                    tagsArray.push(tag);
                }
            }
            return tagsArray.join(" ");
        }
        else {
            return obj._tags;
        }
    }
    /**
     * Adds tags to an object
     * @param obj defines the object to use
     * @param tagsString defines the tag string. The tags 'true' and 'false' are reserved and cannot be used as tags.
     * A tag cannot start with '||', '&&', and '!'. It cannot contain whitespaces
     */
    static AddTagsTo(obj, tagsString) {
        if (!tagsString) {
            return;
        }
        if (typeof tagsString !== "string") {
            return;
        }
        const tags = tagsString.split(" ");
        tags.forEach(function (tag) {
            Tags._AddTagTo(obj, tag);
        });
    }
    /**
     * @internal
     */
    static _AddTagTo(obj, tag) {
        tag = tag.trim();
        if (tag === "" || tag === "true" || tag === "false") {
            return;
        }
        if (tag.match(/[\s]/) || tag.match(/^([!]|([|]|[&]){2})/)) {
            return;
        }
        Tags.EnableFor(obj);
        obj._tags[tag] = true;
    }
    /**
     * Removes specific tags from a specific object
     * @param obj defines the object to use
     * @param tagsString defines the tags to remove
     */
    static RemoveTagsFrom(obj, tagsString) {
        if (!Tags.HasTags(obj)) {
            return;
        }
        const tags = tagsString.split(" ");
        for (const t in tags) {
            Tags._RemoveTagFrom(obj, tags[t]);
        }
    }
    /**
     * @internal
     */
    static _RemoveTagFrom(obj, tag) {
        delete obj._tags[tag];
    }
    /**
     * Defines if tags hosted on an object match a given query
     * @param obj defines the object to use
     * @param tagsQuery defines the tag query
     * @returns a boolean
     */
    static MatchesQuery(obj, tagsQuery) {
        if (tagsQuery === undefined) {
            return true;
        }
        if (tagsQuery === "") {
            return Tags.HasTags(obj);
        }
        return _andOrNotEvaluator_js__WEBPACK_IMPORTED_MODULE_0__/* .AndOrNotEvaluator */ .Z.Eval(tagsQuery, (r) => Tags.HasTags(obj) && obj._tags[r]);
    }
}
//# sourceMappingURL=tags.js.map

/***/ }),

/***/ 42683:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   EE: () => (/* binding */ CreateResizedCopy),
/* harmony export */   LO: () => (/* binding */ TextureTools),
/* harmony export */   LZ: () => (/* binding */ ToHalfFloat),
/* harmony export */   Oz: () => (/* binding */ GetTextureDataAsync),
/* harmony export */   Qs: () => (/* binding */ ApplyPostProcess),
/* harmony export */   SX: () => (/* binding */ FromHalfFloat)
/* harmony export */ });
/* harmony import */ var _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7481);
/* harmony import */ var _Materials_Textures_renderTargetTexture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(75474);
/* harmony import */ var _PostProcesses_passPostProcess_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30580);
/* harmony import */ var _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77891);





/**
 * Uses the GPU to create a copy texture rescaled at a given size
 * @param texture Texture to copy from
 * @param width defines the desired width
 * @param height defines the desired height
 * @param useBilinearMode defines if bilinear mode has to be used
 * @returns the generated texture
 */
function CreateResizedCopy(texture, width, height, useBilinearMode = true) {
    const scene = texture.getScene();
    const engine = scene.getEngine();
    const rtt = new _Materials_Textures_renderTargetTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .RenderTargetTexture */ .$("resized" + texture.name, { width: width, height: height }, scene, !texture.noMipmap, true, texture._texture.type, false, texture.samplingMode, false);
    rtt.wrapU = texture.wrapU;
    rtt.wrapV = texture.wrapV;
    rtt.uOffset = texture.uOffset;
    rtt.vOffset = texture.vOffset;
    rtt.uScale = texture.uScale;
    rtt.vScale = texture.vScale;
    rtt.uAng = texture.uAng;
    rtt.vAng = texture.vAng;
    rtt.wAng = texture.wAng;
    rtt.coordinatesIndex = texture.coordinatesIndex;
    rtt.level = texture.level;
    rtt.anisotropicFilteringLevel = texture.anisotropicFilteringLevel;
    rtt._texture.isReady = false;
    texture.wrapU = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.CLAMP_ADDRESSMODE;
    texture.wrapV = _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.CLAMP_ADDRESSMODE;
    const passPostProcess = new _PostProcesses_passPostProcess_js__WEBPACK_IMPORTED_MODULE_2__/* .PassPostProcess */ .v("pass", 1, null, useBilinearMode ? _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.BILINEAR_SAMPLINGMODE : _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.NEAREST_SAMPLINGMODE, engine, false, 0);
    passPostProcess.externalTextureSamplerBinding = true;
    passPostProcess.onEffectCreatedObservable.addOnce((e) => {
        e.executeWhenCompiled(() => {
            passPostProcess.onApply = function (effect) {
                effect.setTexture("textureSampler", texture);
            };
            const internalTexture = rtt.renderTarget;
            if (internalTexture) {
                scene.postProcessManager.directRender([passPostProcess], internalTexture);
                engine.unBindFramebuffer(internalTexture);
                rtt.disposeFramebufferObjects();
                passPostProcess.dispose();
                rtt.getInternalTexture().isReady = true;
            }
        });
    });
    return rtt;
}
/**
 * Apply a post process to a texture
 * @param postProcessName name of the fragment post process
 * @param internalTexture the texture to encode
 * @param scene the scene hosting the texture
 * @param type type of the output texture. If not provided, use the one from internalTexture
 * @param samplingMode sampling mode to use to sample the source texture. If not provided, use the one from internalTexture
 * @param format format of the output texture. If not provided, use the one from internalTexture
 * @param width width of the output texture. If not provided, use the one from internalTexture
 * @param height height of the output texture. If not provided, use the one from internalTexture
 * @returns a promise with the internalTexture having its texture replaced by the result of the processing
 */
function ApplyPostProcess(postProcessName, internalTexture, scene, type, samplingMode, format, width, height) {
    // Gets everything ready.
    const engine = internalTexture.getEngine();
    internalTexture.isReady = false;
    samplingMode = samplingMode ?? internalTexture.samplingMode;
    type = type ?? internalTexture.type;
    format = format ?? internalTexture.format;
    width = width ?? internalTexture.width;
    height = height ?? internalTexture.height;
    if (type === -1) {
        type = 0;
    }
    return new Promise((resolve) => {
        // Create the post process
        const postProcess = new _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_3__/* .PostProcess */ .w("postprocess", postProcessName, null, null, 1, null, samplingMode, engine, false, undefined, type, undefined, null, false, format);
        postProcess.externalTextureSamplerBinding = true;
        // Hold the output of the decoding.
        const encodedTexture = engine.createRenderTargetTexture({ width: width, height: height }, {
            generateDepthBuffer: false,
            generateMipMaps: false,
            generateStencilBuffer: false,
            samplingMode,
            type,
            format,
        });
        postProcess.onEffectCreatedObservable.addOnce((e) => {
            e.executeWhenCompiled(() => {
                // PP Render Pass
                postProcess.onApply = (effect) => {
                    effect._bindTexture("textureSampler", internalTexture);
                    effect.setFloat2("scale", 1, 1);
                };
                scene.postProcessManager.directRender([postProcess], encodedTexture, true);
                // Cleanup
                engine.restoreDefaultFramebuffer();
                engine._releaseTexture(internalTexture);
                if (postProcess) {
                    postProcess.dispose();
                }
                // Internal Swap
                encodedTexture._swapAndDie(internalTexture);
                // Ready to get rolling again.
                internalTexture.type = type;
                internalTexture.format = 5;
                internalTexture.isReady = true;
                resolve(internalTexture);
            });
        });
    });
}
// ref: http://stackoverflow.com/questions/32633585/how-do-you-convert-to-half-floats-in-javascript
let floatView;
let int32View;
/**
 * Converts a number to half float
 * @param value number to convert
 * @returns converted number
 */
function ToHalfFloat(value) {
    if (!floatView) {
        floatView = new Float32Array(1);
        int32View = new Int32Array(floatView.buffer);
    }
    floatView[0] = value;
    const x = int32View[0];
    let bits = (x >> 16) & 0x8000; /* Get the sign */
    let m = (x >> 12) & 0x07ff; /* Keep one extra bit for rounding */
    const e = (x >> 23) & 0xff; /* Using int is faster here */
    /* If zero, or denormal, or exponent underflows too much for a denormal
     * half, return signed zero. */
    if (e < 103) {
        return bits;
    }
    /* If NaN, return NaN. If Inf or exponent overflow, return Inf. */
    if (e > 142) {
        bits |= 0x7c00;
        /* If exponent was 0xff and one mantissa bit was set, it means NaN,
         * not Inf, so make sure we set one mantissa bit too. */
        bits |= (e == 255 ? 0 : 1) && x & 0x007fffff;
        return bits;
    }
    /* If exponent underflows but not too much, return a denormal */
    if (e < 113) {
        m |= 0x0800;
        /* Extra rounding may overflow and set mantissa to 0 and exponent
         * to 1, which is OK. */
        bits |= (m >> (114 - e)) + ((m >> (113 - e)) & 1);
        return bits;
    }
    bits |= ((e - 112) << 10) | (m >> 1);
    bits += m & 1;
    return bits;
}
/**
 * Converts a half float to a number
 * @param value half float to convert
 * @returns converted half float
 */
function FromHalfFloat(value) {
    const s = (value & 0x8000) >> 15;
    const e = (value & 0x7c00) >> 10;
    const f = value & 0x03ff;
    if (e === 0) {
        return (s ? -1 : 1) * Math.pow(2, -14) * (f / Math.pow(2, 10));
    }
    else if (e == 0x1f) {
        return f ? NaN : (s ? -1 : 1) * Infinity;
    }
    return (s ? -1 : 1) * Math.pow(2, e - 15) * (1 + f / Math.pow(2, 10));
}
const ProcessAsync = async (texture, width, height, face, lod) => {
    const scene = texture.getScene();
    const engine = scene.getEngine();
    if (!engine.isWebGPU) {
        if (texture.isCube) {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 92905));
        }
        else {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 19278));
        }
    }
    else {
        if (texture.isCube) {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 91650));
        }
        else {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3613));
        }
    }
    let lodPostProcess;
    if (!texture.isCube) {
        lodPostProcess = new _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_3__/* .PostProcess */ .w("lod", "lod", {
            uniforms: ["lod", "gamma"],
            samplingMode: _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.NEAREST_NEAREST_MIPNEAREST,
            engine,
            shaderLanguage: engine.isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
        });
    }
    else {
        const faceDefines = ["#define POSITIVEX", "#define NEGATIVEX", "#define POSITIVEY", "#define NEGATIVEY", "#define POSITIVEZ", "#define NEGATIVEZ"];
        lodPostProcess = new _PostProcesses_postProcess_js__WEBPACK_IMPORTED_MODULE_3__/* .PostProcess */ .w("lodCube", "lodCube", {
            uniforms: ["lod", "gamma"],
            samplingMode: _Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.NEAREST_NEAREST_MIPNEAREST,
            engine,
            defines: faceDefines[face],
            shaderLanguage: engine.isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
        });
    }
    await new Promise((resolve) => {
        lodPostProcess.onEffectCreatedObservable.addOnce((e) => {
            e.executeWhenCompiled(() => {
                resolve(0);
            });
        });
    });
    const rtt = new _Materials_Textures_renderTargetTexture_js__WEBPACK_IMPORTED_MODULE_1__/* .RenderTargetTexture */ .$("temp", { width: width, height: height }, scene, false);
    lodPostProcess.onApply = function (effect) {
        effect.setTexture("textureSampler", texture);
        effect.setFloat("lod", lod);
        effect.setInt("gamma", texture.gammaSpace ? 1 : 0);
    };
    const internalTexture = texture.getInternalTexture();
    try {
        if (rtt.renderTarget && internalTexture) {
            const samplingMode = internalTexture.samplingMode;
            if (lod !== 0) {
                texture.updateSamplingMode(_Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.NEAREST_NEAREST_MIPNEAREST);
            }
            else {
                texture.updateSamplingMode(_Materials_Textures_texture_js__WEBPACK_IMPORTED_MODULE_0__/* .Texture */ .g.NEAREST_NEAREST);
            }
            scene.postProcessManager.directRender([lodPostProcess], rtt.renderTarget, true);
            texture.updateSamplingMode(samplingMode);
            //Reading datas from WebGL
            const bufferView = await engine.readPixels(0, 0, width, height);
            const data = new Uint8Array(bufferView.buffer, 0, bufferView.byteLength);
            // Unbind
            engine.unBindFramebuffer(rtt.renderTarget);
            return data;
        }
        else {
            throw Error("Render to texture failed.");
        }
    }
    finally {
        rtt.dispose();
        lodPostProcess.dispose();
    }
};
/**
 * Gets the data of the specified texture by rendering it to an intermediate RGBA texture and retrieving the bytes from it.
 * This is convienent to get 8-bit RGBA values for a texture in a GPU compressed format.
 * @param texture the source texture
 * @param width the width of the result, which does not have to match the source texture width
 * @param height the height of the result, which does not have to match the source texture height
 * @param face if the texture has multiple faces, the face index to use for the source
 * @param lod if the texture has multiple LODs, the lod index to use for the source
 * @returns the 8-bit texture data
 */
async function GetTextureDataAsync(texture, width, height, face = 0, lod = 0) {
    if (!texture.isReady() && texture._texture) {
        await new Promise((resolve, reject) => {
            if (texture._texture === null) {
                reject(0);
                return;
            }
            texture._texture.onLoadedObservable.addOnce(() => {
                resolve(0);
            });
        });
    }
    return await ProcessAsync(texture, width, height, face, lod);
}
/**
 * Class used to host texture specific utilities
 */
const TextureTools = {
    /**
     * Uses the GPU to create a copy texture rescaled at a given size
     * @param texture Texture to copy from
     * @param width defines the desired width
     * @param height defines the desired height
     * @param useBilinearMode defines if bilinear mode has to be used
     * @returns the generated texture
     */
    CreateResizedCopy,
    /**
     * Apply a post process to a texture
     * @param postProcessName name of the fragment post process
     * @param internalTexture the texture to encode
     * @param scene the scene hosting the texture
     * @param type type of the output texture. If not provided, use the one from internalTexture
     * @param samplingMode sampling mode to use to sample the source texture. If not provided, use the one from internalTexture
     * @param format format of the output texture. If not provided, use the one from internalTexture
     * @returns a promise with the internalTexture having its texture replaced by the result of the processing
     */
    ApplyPostProcess,
    /**
     * Converts a number to half float
     * @param value number to convert
     * @returns converted number
     */
    ToHalfFloat,
    /**
     * Converts a half float to a number
     * @param value half float to convert
     * @returns converted half float
     */
    FromHalfFloat,
    /**
     * Gets the data of the specified texture by rendering it to an intermediate RGBA texture and retrieving the bytes from it.
     * This is convienent to get 8-bit RGBA values for a texture in a GPU compressed format.
     * @param texture the source texture
     * @param width the width of the result, which does not have to match the source texture width
     * @param height the height of the result, which does not have to match the source texture height
     * @param face if the texture has multiple faces, the face index to use for the source
     * @param channels a filter for which of the RGBA channels to return in the result
     * @param lod if the texture has multiple LODs, the lod index to use for the source
     * @returns the 8-bit texture data
     */
    GetTextureDataAsync,
};
//# sourceMappingURL=textureTools.js.map

/***/ }),

/***/ 52053:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   FA: () => (/* binding */ UploadContent),
/* harmony export */   O_: () => (/* binding */ GetTGAHeader),
/* harmony export */   uT: () => (/* binding */ TGATools)
/* harmony export */ });
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51137);

//private static _TYPE_NO_DATA = 0;
const _TYPE_INDEXED = 1;
const _TYPE_RGB = 2;
const _TYPE_GREY = 3;
const _TYPE_RLE_INDEXED = 9;
const _TYPE_RLE_RGB = 10;
const _TYPE_RLE_GREY = 11;
const _ORIGIN_MASK = 0x30;
const _ORIGIN_SHIFT = 0x04;
const _ORIGIN_BL = 0x00;
const _ORIGIN_BR = 0x01;
const _ORIGIN_UL = 0x02;
const _ORIGIN_UR = 0x03;
/**
 * Gets the header of a TGA file
 * @param data defines the TGA data
 * @returns the header
 */
function GetTGAHeader(data) {
    let offset = 0;
    const header = {
        id_length: data[offset++],
        colormap_type: data[offset++],
        image_type: data[offset++],
        colormap_index: data[offset++] | (data[offset++] << 8),
        colormap_length: data[offset++] | (data[offset++] << 8),
        colormap_size: data[offset++],
        origin: [data[offset++] | (data[offset++] << 8), data[offset++] | (data[offset++] << 8)],
        width: data[offset++] | (data[offset++] << 8),
        height: data[offset++] | (data[offset++] << 8),
        pixel_size: data[offset++],
        flags: data[offset++],
    };
    return header;
}
/**
 * Uploads TGA content to a Babylon Texture
 * @internal
 */
function UploadContent(texture, data) {
    // Not enough data to contain header ?
    if (data.length < 19) {
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("Unable to load TGA file - Not enough data to contain header");
        return;
    }
    // Read Header
    let offset = 18;
    const header = GetTGAHeader(data);
    // Assume it's a valid Targa file.
    if (header.id_length + offset > data.length) {
        _Misc_logger_js__WEBPACK_IMPORTED_MODULE_0__/* .Logger */ .V.Error("Unable to load TGA file - Not enough data");
        return;
    }
    // Skip not needed data
    offset += header.id_length;
    let use_rle = false;
    let use_pal = false;
    let use_grey = false;
    // Get some informations.
    switch (header.image_type) {
        case _TYPE_RLE_INDEXED:
            use_rle = true;
        // eslint-disable-next-line no-fallthrough
        case _TYPE_INDEXED:
            use_pal = true;
            break;
        case _TYPE_RLE_RGB:
            use_rle = true;
        // eslint-disable-next-line no-fallthrough
        case _TYPE_RGB:
            // use_rgb = true;
            break;
        case _TYPE_RLE_GREY:
            use_rle = true;
        // eslint-disable-next-line no-fallthrough
        case _TYPE_GREY:
            use_grey = true;
            break;
    }
    let pixel_data;
    // var numAlphaBits = header.flags & 0xf;
    const pixel_size = header.pixel_size >> 3;
    const pixel_total = header.width * header.height * pixel_size;
    // Read palettes
    let palettes;
    if (use_pal) {
        palettes = data.subarray(offset, (offset += header.colormap_length * (header.colormap_size >> 3)));
    }
    // Read LRE
    if (use_rle) {
        pixel_data = new Uint8Array(pixel_total);
        let c, count, i;
        let localOffset = 0;
        const pixels = new Uint8Array(pixel_size);
        while (offset < pixel_total && localOffset < pixel_total) {
            c = data[offset++];
            count = (c & 0x7f) + 1;
            // RLE pixels
            if (c & 0x80) {
                // Bind pixel tmp array
                for (i = 0; i < pixel_size; ++i) {
                    pixels[i] = data[offset++];
                }
                // Copy pixel array
                for (i = 0; i < count; ++i) {
                    pixel_data.set(pixels, localOffset + i * pixel_size);
                }
                localOffset += pixel_size * count;
            }
            // Raw pixels
            else {
                count *= pixel_size;
                for (i = 0; i < count; ++i) {
                    pixel_data[localOffset + i] = data[offset++];
                }
                localOffset += count;
            }
        }
    }
    // RAW Pixels
    else {
        pixel_data = data.subarray(offset, (offset += use_pal ? header.width * header.height : pixel_total));
    }
    // Load to texture
    let x_start, y_start, x_step, y_step, y_end, x_end;
    switch ((header.flags & _ORIGIN_MASK) >> _ORIGIN_SHIFT) {
        default:
        case _ORIGIN_UL:
            x_start = 0;
            x_step = 1;
            x_end = header.width;
            y_start = 0;
            y_step = 1;
            y_end = header.height;
            break;
        case _ORIGIN_BL:
            x_start = 0;
            x_step = 1;
            x_end = header.width;
            y_start = header.height - 1;
            y_step = -1;
            y_end = -1;
            break;
        case _ORIGIN_UR:
            x_start = header.width - 1;
            x_step = -1;
            x_end = -1;
            y_start = 0;
            y_step = 1;
            y_end = header.height;
            break;
        case _ORIGIN_BR:
            x_start = header.width - 1;
            x_step = -1;
            x_end = -1;
            y_start = header.height - 1;
            y_step = -1;
            y_end = -1;
            break;
    }
    // Load the specify method
    const func = "_getImageData" + (use_grey ? "Grey" : "") + header.pixel_size + "bits";
    const imageData = TGATools[func](header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end);
    const engine = texture.getEngine();
    engine._uploadDataToTextureDirectly(texture, imageData);
}
/**
 * @internal
 */
function _getImageData8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
    const image = pixel_data, colormap = palettes;
    const width = header.width, height = header.height;
    let color, i = 0, x, y;
    const imageData = new Uint8Array(width * height * 4);
    for (y = y_start; y !== y_end; y += y_step) {
        for (x = x_start; x !== x_end; x += x_step, i++) {
            color = image[i];
            imageData[(x + width * y) * 4 + 3] = 255;
            imageData[(x + width * y) * 4 + 2] = colormap[color * 3 + 0];
            imageData[(x + width * y) * 4 + 1] = colormap[color * 3 + 1];
            imageData[(x + width * y) * 4 + 0] = colormap[color * 3 + 2];
        }
    }
    return imageData;
}
/**
 * @internal
 */
function _getImageData16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
    const image = pixel_data;
    const width = header.width, height = header.height;
    let color, i = 0, x, y;
    const imageData = new Uint8Array(width * height * 4);
    for (y = y_start; y !== y_end; y += y_step) {
        for (x = x_start; x !== x_end; x += x_step, i += 2) {
            color = image[i + 0] + (image[i + 1] << 8); // Inversed ?
            const r = ((((color & 0x7c00) >> 10) * 255) / 0x1f) | 0;
            const g = ((((color & 0x03e0) >> 5) * 255) / 0x1f) | 0;
            const b = (((color & 0x001f) * 255) / 0x1f) | 0;
            imageData[(x + width * y) * 4 + 0] = r;
            imageData[(x + width * y) * 4 + 1] = g;
            imageData[(x + width * y) * 4 + 2] = b;
            imageData[(x + width * y) * 4 + 3] = color & 0x8000 ? 0 : 255;
        }
    }
    return imageData;
}
/**
 * @internal
 */
function _getImageData24bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
    const image = pixel_data;
    const width = header.width, height = header.height;
    let i = 0, x, y;
    const imageData = new Uint8Array(width * height * 4);
    for (y = y_start; y !== y_end; y += y_step) {
        for (x = x_start; x !== x_end; x += x_step, i += 3) {
            imageData[(x + width * y) * 4 + 3] = 255;
            imageData[(x + width * y) * 4 + 2] = image[i + 0];
            imageData[(x + width * y) * 4 + 1] = image[i + 1];
            imageData[(x + width * y) * 4 + 0] = image[i + 2];
        }
    }
    return imageData;
}
/**
 * @internal
 */
function _getImageData32bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
    const image = pixel_data;
    const width = header.width, height = header.height;
    let i = 0, x, y;
    const imageData = new Uint8Array(width * height * 4);
    for (y = y_start; y !== y_end; y += y_step) {
        for (x = x_start; x !== x_end; x += x_step, i += 4) {
            imageData[(x + width * y) * 4 + 2] = image[i + 0];
            imageData[(x + width * y) * 4 + 1] = image[i + 1];
            imageData[(x + width * y) * 4 + 0] = image[i + 2];
            imageData[(x + width * y) * 4 + 3] = image[i + 3];
        }
    }
    return imageData;
}
/**
 * @internal
 */
function _getImageDataGrey8bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
    const image = pixel_data;
    const width = header.width, height = header.height;
    let color, i = 0, x, y;
    const imageData = new Uint8Array(width * height * 4);
    for (y = y_start; y !== y_end; y += y_step) {
        for (x = x_start; x !== x_end; x += x_step, i++) {
            color = image[i];
            imageData[(x + width * y) * 4 + 0] = color;
            imageData[(x + width * y) * 4 + 1] = color;
            imageData[(x + width * y) * 4 + 2] = color;
            imageData[(x + width * y) * 4 + 3] = 255;
        }
    }
    return imageData;
}
/**
 * @internal
 */
function _getImageDataGrey16bits(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) {
    const image = pixel_data;
    const width = header.width, height = header.height;
    let i = 0, x, y;
    const imageData = new Uint8Array(width * height * 4);
    for (y = y_start; y !== y_end; y += y_step) {
        for (x = x_start; x !== x_end; x += x_step, i += 2) {
            imageData[(x + width * y) * 4 + 0] = image[i + 0];
            imageData[(x + width * y) * 4 + 1] = image[i + 0];
            imageData[(x + width * y) * 4 + 2] = image[i + 0];
            imageData[(x + width * y) * 4 + 3] = image[i + 1];
        }
    }
    return imageData;
}
/**
 * Based on jsTGALoader - Javascript loader for TGA file
 * By Vincent Thibault
 * @see http://blog.robrowser.com/javascript-tga-loader.html
 */
const TGATools = {
    /**
     * Gets the header of a TGA file
     * @param data defines the TGA data
     * @returns the header
     */
    GetTGAHeader,
    /**
     * Uploads TGA content to a Babylon Texture
     * @internal
     */
    UploadContent,
    /** @internal */
    _getImageData8bits,
    /** @internal */
    _getImageData16bits,
    /** @internal */
    _getImageData24bits,
    /** @internal */
    _getImageData32bits,
    /** @internal */
    _getImageDataGrey8bits,
    /** @internal */
    _getImageDataGrey16bits,
};
//# sourceMappingURL=tga.js.map

/***/ }),

/***/ 20472:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Qz: () => (/* binding */ AdvancedTimer),
/* harmony export */   R$: () => (/* binding */ TimerState),
/* harmony export */   fj: () => (/* binding */ setAndStartTimer)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);

/**
 * The current state of the timer
 */
var TimerState;
(function (TimerState) {
    /**
     * Timer initialized, not yet started
     */
    TimerState[TimerState["INIT"] = 0] = "INIT";
    /**
     * Timer started and counting
     */
    TimerState[TimerState["STARTED"] = 1] = "STARTED";
    /**
     * Timer ended (whether aborted or time reached)
     */
    TimerState[TimerState["ENDED"] = 2] = "ENDED";
})(TimerState || (TimerState = {}));
/**
 * A simple version of the timer. Will take options and start the timer immediately after calling it
 *
 * @param options options with which to initialize this timer
 * @returns an observer that can be used to stop the timer
 */
function setAndStartTimer(options) {
    let timer = 0;
    const startTime = Date.now();
    options.observableParameters = options.observableParameters ?? {};
    const observer = options.contextObservable.add((payload) => {
        const now = Date.now();
        timer = now - startTime;
        const data = {
            startTime,
            currentTime: now,
            deltaTime: timer,
            completeRate: timer / options.timeout,
            payload,
        };
        options.onTick && options.onTick(data);
        if (options.breakCondition && options.breakCondition()) {
            options.contextObservable.remove(observer);
            options.onAborted && options.onAborted(data);
        }
        if (timer >= options.timeout) {
            options.contextObservable.remove(observer);
            options.onEnded && options.onEnded(data);
        }
    }, options.observableParameters.mask, options.observableParameters.insertFirst, options.observableParameters.scope);
    return observer;
}
/**
 * An advanced implementation of a timer class
 */
class AdvancedTimer {
    /**
     * Will construct a new advanced timer based on the options provided. Timer will not start until start() is called.
     * @param options construction options for this advanced timer
     */
    constructor(options) {
        /**
         * Will notify each time the timer calculates the remaining time
         */
        this.onEachCountObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * Will trigger when the timer was aborted due to the break condition
         */
        this.onTimerAbortedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * Will trigger when the timer ended successfully
         */
        this.onTimerEndedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * Will trigger when the timer state has changed
         */
        this.onStateChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        this._observer = null;
        this._breakOnNextTick = false;
        this._tick = (payload) => {
            const now = Date.now();
            this._timer = now - this._startTime;
            const data = {
                startTime: this._startTime,
                currentTime: now,
                deltaTime: this._timer,
                completeRate: this._timer / this._timeToEnd,
                payload,
            };
            const shouldBreak = this._breakOnNextTick || this._breakCondition(data);
            if (shouldBreak || this._timer >= this._timeToEnd) {
                this._stop(data, shouldBreak);
            }
            else {
                this.onEachCountObservable.notifyObservers(data);
            }
        };
        this._setState(0 /* TimerState.INIT */);
        this._contextObservable = options.contextObservable;
        this._observableParameters = options.observableParameters ?? {};
        this._breakCondition = options.breakCondition ?? (() => false);
        this._timeToEnd = options.timeout;
        if (options.onEnded) {
            this.onTimerEndedObservable.add(options.onEnded);
        }
        if (options.onTick) {
            this.onEachCountObservable.add(options.onTick);
        }
        if (options.onAborted) {
            this.onTimerAbortedObservable.add(options.onAborted);
        }
    }
    /**
     * set a breaking condition for this timer. Default is to never break during count
     * @param predicate the new break condition. Returns true to break, false otherwise
     */
    set breakCondition(predicate) {
        this._breakCondition = predicate;
    }
    /**
     * Reset ALL associated observables in this advanced timer
     */
    clearObservables() {
        this.onEachCountObservable.clear();
        this.onTimerAbortedObservable.clear();
        this.onTimerEndedObservable.clear();
        this.onStateChangedObservable.clear();
    }
    /**
     * Will start a new iteration of this timer. Only one instance of this timer can run at a time.
     *
     * @param timeToEnd how much time to measure until timer ended
     */
    start(timeToEnd = this._timeToEnd) {
        if (this._state === 1 /* TimerState.STARTED */) {
            throw new Error("Timer already started. Please stop it before starting again");
        }
        this._timeToEnd = timeToEnd;
        this._startTime = Date.now();
        this._timer = 0;
        this._observer = this._contextObservable.add(this._tick, this._observableParameters.mask, this._observableParameters.insertFirst, this._observableParameters.scope);
        this._setState(1 /* TimerState.STARTED */);
    }
    /**
     * Will force a stop on the next tick.
     */
    stop() {
        if (this._state !== 1 /* TimerState.STARTED */) {
            return;
        }
        this._breakOnNextTick = true;
    }
    /**
     * Dispose this timer, clearing all resources
     */
    dispose() {
        if (this._observer) {
            this._contextObservable.remove(this._observer);
        }
        this.clearObservables();
    }
    _setState(newState) {
        this._state = newState;
        this.onStateChangedObservable.notifyObservers(this._state);
    }
    _stop(data, aborted = false) {
        this._contextObservable.remove(this._observer);
        this._setState(2 /* TimerState.ENDED */);
        if (aborted) {
            this.onTimerAbortedObservable.notifyObservers(data);
        }
        else {
            this.onTimerEndedObservable.notifyObservers(data);
        }
    }
}
//# sourceMappingURL=timer.js.map

/***/ }),

/***/ 2940:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _: () => (/* binding */ TimingTools)
/* harmony export */ });
/* harmony import */ var _domManagement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18790);

/**
 * Class used to provide helper for timing
 */
class TimingTools {
    /**
     * Polyfill for setImmediate
     * @param action defines the action to execute after the current execution block
     */
    static SetImmediate(action) {
        if ((0,_domManagement_js__WEBPACK_IMPORTED_MODULE_0__/* .IsWindowObjectExist */ .BA)() && window.setImmediate) {
            // Note - deprecated and should not be used directly. Not supported in any browser.
            window.setImmediate(action);
        }
        else {
            setTimeout(action, 1);
        }
    }
}
//# sourceMappingURL=timingTools.js.map

/***/ }),

/***/ 91597:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   C4: () => (/* binding */ FloorPOT),
/* harmony export */   L8: () => (/* binding */ IsExponentOfTwo),
/* harmony export */   OG: () => (/* binding */ NearestPOT),
/* harmony export */   R: () => (/* binding */ GetExponentOfTwo),
/* harmony export */   zF: () => (/* binding */ Mix)
/* harmony export */ });
/* unused harmony export CeilingPOT */

/**
 * Function indicating if a number is an exponent of 2
 * @param value defines the value to test
 * @returns true if the value is an exponent of 2
 */
function IsExponentOfTwo(value) {
    let count = 1;
    do {
        count *= 2;
    } while (count < value);
    return count === value;
}
/**
 * Interpolates between a and b via alpha
 * @param a The lower value (returned when alpha = 0)
 * @param b The upper value (returned when alpha = 1)
 * @param alpha The interpolation-factor
 * @returns The mixed value
 */
function Mix(a, b, alpha) {
    return a * (1 - alpha) + b * alpha;
}
/**
 * Find the nearest power of two.
 * @param x Number to start search from.
 * @returns Next nearest power of two.
 */
function NearestPOT(x) {
    const c = CeilingPOT(x);
    const f = FloorPOT(x);
    return c - x > x - f ? f : c;
}
/**
 * Find the next highest power of two.
 * @param x Number to start search from.
 * @returns Next highest power of two.
 */
function CeilingPOT(x) {
    x--;
    x |= x >> 1;
    x |= x >> 2;
    x |= x >> 4;
    x |= x >> 8;
    x |= x >> 16;
    x++;
    return x;
}
/**
 * Find the next lowest power of two.
 * @param x Number to start search from.
 * @returns Next lowest power of two.
 */
function FloorPOT(x) {
    x = x | (x >> 1);
    x = x | (x >> 2);
    x = x | (x >> 4);
    x = x | (x >> 8);
    x = x | (x >> 16);
    return x - (x >> 1);
}
/**
 * Get the closest exponent of two
 * @param value defines the value to approximate
 * @param max defines the maximum value to return
 * @param mode defines how to define the closest value
 * @returns closest exponent of two of the given value
 */
function GetExponentOfTwo(value, max, mode = 2) {
    let pot;
    switch (mode) {
        case 1:
            pot = FloorPOT(value);
            break;
        case 2:
            pot = NearestPOT(value);
            break;
        case 3:
        default:
            pot = CeilingPOT(value);
            break;
    }
    return Math.min(pot, max);
}
//# sourceMappingURL=tools.functions.js.map

/***/ }),

/***/ 998:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   LV: () => (/* binding */ AsyncLoop),
/* harmony export */   S0: () => (/* binding */ Tools),
/* harmony export */   s7: () => (/* binding */ className)
/* harmony export */ });
/* harmony import */ var _observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _domManagement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18790);
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51137);
/* harmony import */ var _deepCopier_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74609);
/* harmony import */ var _precisionDate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(76237);
/* harmony import */ var _devTools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45503);
/* harmony import */ var _webRequest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62366);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6315);
/* harmony import */ var _fileTools_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8532);
/* harmony import */ var _timingTools_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2940);
/* harmony import */ var _instantiationTools_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(79337);
/* harmony import */ var _guid_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(38688);
/* harmony import */ var _tools_functions_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91597);













/**
 * Class containing a set of static utilities functions
 */
class Tools {
    /**
     * Gets or sets the base URL to use to load assets
     */
    static get BaseUrl() {
        return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.BaseUrl;
    }
    static set BaseUrl(value) {
        _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.BaseUrl = value;
    }
    /**
     * Gets or sets the clean URL function to use to load assets
     */
    static get CleanUrl() {
        return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.CleanUrl;
    }
    static set CleanUrl(value) {
        _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.CleanUrl = value;
    }
    /**
     * This function checks whether a URL is absolute or not.
     * It will also detect data and blob URLs
     * @param url the url to check
     * @returns is the url absolute or relative
     */
    static IsAbsoluteUrl(url) {
        // See https://stackoverflow.com/a/38979205.
        // URL is protocol-relative (= absolute)
        if (url.indexOf("//") === 0) {
            return true;
        }
        // URL has no protocol (= relative)
        if (url.indexOf("://") === -1) {
            return false;
        }
        // URL does not contain a dot, i.e. no TLD (= relative, possibly REST)
        if (url.indexOf(".") === -1) {
            return false;
        }
        // URL does not contain a single slash (= relative)
        if (url.indexOf("/") === -1) {
            return false;
        }
        // The first colon comes after the first slash (= relative)
        if (url.indexOf(":") > url.indexOf("/")) {
            return false;
        }
        // Protocol is defined before first dot (= absolute)
        if (url.indexOf("://") < url.indexOf(".")) {
            return true;
        }
        if (url.indexOf("data:") === 0 || url.indexOf("blob:") === 0) {
            return true;
        }
        // Anything else must be relative
        return false;
    }
    /**
     * Sets the base URL to use to load scripts
     */
    static set ScriptBaseUrl(value) {
        _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.ScriptBaseUrl = value;
    }
    static get ScriptBaseUrl() {
        return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.ScriptBaseUrl;
    }
    /**
     * Sets a preprocessing function to run on a source URL before importing it
     * Note that this function will execute AFTER the base URL is appended to the URL
     */
    static set ScriptPreprocessUrl(func) {
        _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.ScriptPreprocessUrl = func;
    }
    static get ScriptPreprocessUrl() {
        return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.ScriptPreprocessUrl;
    }
    /**
     * Gets or sets the retry strategy to apply when an error happens while loading an asset
     */
    static get DefaultRetryStrategy() {
        return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.DefaultRetryStrategy;
    }
    static set DefaultRetryStrategy(strategy) {
        _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.DefaultRetryStrategy = strategy;
    }
    /**
     * Default behavior for cors in the application.
     * It can be a string if the expected behavior is identical in the entire app.
     * Or a callback to be able to set it per url or on a group of them (in case of Video source for instance)
     */
    static get CorsBehavior() {
        return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.CorsBehavior;
    }
    static set CorsBehavior(value) {
        _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.CorsBehavior = value;
    }
    /**
     * Gets or sets a global variable indicating if fallback texture must be used when a texture cannot be loaded
     * @ignorenaming
     */
    static get UseFallbackTexture() {
        return _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore */ .q.UseFallbackTexture;
    }
    static set UseFallbackTexture(value) {
        _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore */ .q.UseFallbackTexture = value;
    }
    /**
     * Use this object to register external classes like custom textures or material
     * to allow the loaders to instantiate them
     */
    static get RegisteredExternalClasses() {
        return _instantiationTools_js__WEBPACK_IMPORTED_MODULE_10__/* .InstantiationTools */ .n.RegisteredExternalClasses;
    }
    static set RegisteredExternalClasses(classes) {
        _instantiationTools_js__WEBPACK_IMPORTED_MODULE_10__/* .InstantiationTools */ .n.RegisteredExternalClasses = classes;
    }
    /**
     * Texture content used if a texture cannot loaded
     * @ignorenaming
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static get fallbackTexture() {
        return _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore */ .q.FallbackTexture;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static set fallbackTexture(value) {
        _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore */ .q.FallbackTexture = value;
    }
    /**
     * Read the content of a byte array at a specified coordinates (taking in account wrapping)
     * @param u defines the coordinate on X axis
     * @param v defines the coordinate on Y axis
     * @param width defines the width of the source data
     * @param height defines the height of the source data
     * @param pixels defines the source byte array
     * @param color defines the output color
     */
    static FetchToRef(u, v, width, height, pixels, color) {
        const wrappedU = (Math.abs(u) * width) % width | 0;
        const wrappedV = (Math.abs(v) * height) % height | 0;
        const position = (wrappedU + wrappedV * width) * 4;
        color.r = pixels[position] / 255;
        color.g = pixels[position + 1] / 255;
        color.b = pixels[position + 2] / 255;
        color.a = pixels[position + 3] / 255;
    }
    /**
     * Interpolates between a and b via alpha
     * @param a The lower value (returned when alpha = 0)
     * @param b The upper value (returned when alpha = 1)
     * @param alpha The interpolation-factor
     * @returns The mixed value
     */
    static Mix(a, b, alpha) {
        return 0;
    }
    /**
     * Tries to instantiate a new object from a given class name
     * @param className defines the class name to instantiate
     * @returns the new object or null if the system was not able to do the instantiation
     */
    static Instantiate(className) {
        return _instantiationTools_js__WEBPACK_IMPORTED_MODULE_10__/* .InstantiationTools */ .n.Instantiate(className);
    }
    /**
     * Polyfill for setImmediate
     * @param action defines the action to execute after the current execution block
     */
    static SetImmediate(action) {
        _timingTools_js__WEBPACK_IMPORTED_MODULE_9__/* .TimingTools */ ._.SetImmediate(action);
    }
    /**
     * Function indicating if a number is an exponent of 2
     * @param value defines the value to test
     * @returns true if the value is an exponent of 2
     */
    static IsExponentOfTwo(value) {
        return true;
    }
    /**
     * Returns the nearest 32-bit single precision float representation of a Number
     * @param value A Number.  If the parameter is of a different type, it will get converted
     * to a number or to NaN if it cannot be converted
     * @returns number
     */
    static FloatRound(value) {
        return Math.fround(value);
    }
    /**
     * Extracts the filename from a path
     * @param path defines the path to use
     * @returns the filename
     */
    static GetFilename(path) {
        const index = path.lastIndexOf("/");
        if (index < 0) {
            return path;
        }
        return path.substring(index + 1);
    }
    /**
     * Extracts the "folder" part of a path (everything before the filename).
     * @param uri The URI to extract the info from
     * @param returnUnchangedIfNoSlash Do not touch the URI if no slashes are present
     * @returns The "folder" part of the path
     */
    static GetFolderPath(uri, returnUnchangedIfNoSlash = false) {
        const index = uri.lastIndexOf("/");
        if (index < 0) {
            if (returnUnchangedIfNoSlash) {
                return uri;
            }
            return "";
        }
        return uri.substring(0, index + 1);
    }
    /**
     * Convert an angle in radians to degrees
     * @param angle defines the angle to convert
     * @returns the angle in degrees
     */
    static ToDegrees(angle) {
        return (angle * 180) / Math.PI;
    }
    /**
     * Convert an angle in degrees to radians
     * @param angle defines the angle to convert
     * @returns the angle in radians
     */
    static ToRadians(angle) {
        return (angle * Math.PI) / 180;
    }
    /**
     * Smooth angle changes (kind of low-pass filter), in particular for device orientation "shaking"
     * Use trigonometric functions to avoid discontinuity (0/360, -180/180)
     * @param previousAngle defines last angle value, in degrees
     * @param newAngle defines new angle value, in degrees
     * @param smoothFactor defines smoothing sensitivity; min 0: no smoothing, max 1: new data ignored
     * @returns the angle in degrees
     */
    static SmoothAngleChange(previousAngle, newAngle, smoothFactor = 0.9) {
        const previousAngleRad = this.ToRadians(previousAngle);
        const newAngleRad = this.ToRadians(newAngle);
        return this.ToDegrees(Math.atan2((1 - smoothFactor) * Math.sin(newAngleRad) + smoothFactor * Math.sin(previousAngleRad), (1 - smoothFactor) * Math.cos(newAngleRad) + smoothFactor * Math.cos(previousAngleRad)));
    }
    /**
     * Returns an array if obj is not an array
     * @param obj defines the object to evaluate as an array
     * @param allowsNullUndefined defines a boolean indicating if obj is allowed to be null or undefined
     * @returns either obj directly if obj is an array or a new array containing obj
     */
    static MakeArray(obj, allowsNullUndefined) {
        if (allowsNullUndefined !== true && (obj === undefined || obj == null)) {
            return null;
        }
        return Array.isArray(obj) ? obj : [obj];
    }
    /**
     * Gets the pointer prefix to use
     * @param engine defines the engine we are finding the prefix for
     * @returns "pointer" if touch is enabled. Else returns "mouse"
     */
    static GetPointerPrefix(engine) {
        return (0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .BA)() && !window.PointerEvent ? "mouse" : "pointer";
    }
    /**
     * Sets the cors behavior on a dom element. This will add the required Tools.CorsBehavior to the element.
     * @param url define the url we are trying
     * @param element define the dom element where to configure the cors policy
     * @param element.crossOrigin
     */
    static SetCorsBehavior(url, element) {
        (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .SetCorsBehavior */ .M1)(url, element);
    }
    /**
     * Sets the referrerPolicy behavior on a dom element.
     * @param referrerPolicy define the referrer policy to use
     * @param element define the dom element where to configure the referrer policy
     * @param element.referrerPolicy
     */
    static SetReferrerPolicyBehavior(referrerPolicy, element) {
        element.referrerPolicy = referrerPolicy;
    }
    // External files
    /**
     * Gets or sets a function used to pre-process url before using them to load assets
     */
    static get PreprocessUrl() {
        return _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.PreprocessUrl;
    }
    static set PreprocessUrl(processor) {
        _fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .FileToolsOptions */ .eC.PreprocessUrl = processor;
    }
    /**
     * Loads an image as an HTMLImageElement.
     * @param input url string, ArrayBuffer, or Blob to load
     * @param onLoad callback called when the image successfully loads
     * @param onError callback called when the image fails to load
     * @param offlineProvider offline provider for caching
     * @param mimeType optional mime type
     * @param imageBitmapOptions optional the options to use when creating an ImageBitmap
     * @returns the HTMLImageElement of the loaded image
     */
    static LoadImage(input, onLoad, onError, offlineProvider, mimeType, imageBitmapOptions) {
        return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .LoadImage */ .W$)(input, onLoad, onError, offlineProvider, mimeType, imageBitmapOptions);
    }
    /**
     * Loads a file from a url
     * @param url url string, ArrayBuffer, or Blob to load
     * @param onSuccess callback called when the file successfully loads
     * @param onProgress callback called while file is loading (if the server supports this mode)
     * @param offlineProvider defines the offline provider for caching
     * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
     * @param onError callback called when the file fails to load
     * @returns a file request object
     */
    static LoadFile(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError) {
        return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .LoadFile */ .zU)(url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError);
    }
    /**
     * Loads a file from a url
     * @param url the file url to load
     * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
     * @returns a promise containing an ArrayBuffer corresponding to the loaded file
     */
    static LoadFileAsync(url, useArrayBuffer = true) {
        return new Promise((resolve, reject) => {
            (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .LoadFile */ .zU)(url, (data) => {
                resolve(data);
            }, undefined, undefined, useArrayBuffer, (request, exception) => {
                reject(exception);
            });
        });
    }
    /**
     * Get a script URL including preprocessing
     * @param scriptUrl the script Url to process
     * @param forceAbsoluteUrl force the script to be an absolute url (adding the current base url if necessary)
     * @returns a modified URL to use
     */
    static GetBabylonScriptURL(scriptUrl, forceAbsoluteUrl) {
        if (!scriptUrl) {
            return "";
        }
        // if the base URL was set, and the script Url is an absolute path change the default path
        if (Tools.ScriptBaseUrl && scriptUrl.startsWith(Tools._DefaultCdnUrl)) {
            // change the default host, which is https://cdn.babylonjs.com with the one defined
            // make sure no trailing slash is present
            const baseUrl = Tools.ScriptBaseUrl[Tools.ScriptBaseUrl.length - 1] === "/" ? Tools.ScriptBaseUrl.substring(0, Tools.ScriptBaseUrl.length - 1) : Tools.ScriptBaseUrl;
            scriptUrl = scriptUrl.replace(Tools._DefaultCdnUrl, baseUrl);
        }
        // run the preprocessor
        scriptUrl = Tools.ScriptPreprocessUrl(scriptUrl);
        if (forceAbsoluteUrl) {
            scriptUrl = Tools.GetAbsoluteUrl(scriptUrl);
        }
        return scriptUrl;
    }
    /**
     * This function is used internally by babylon components to load a script (identified by an url). When the url returns, the
     * content of this file is added into a new script element, attached to the DOM (body element)
     * @param scriptUrl defines the url of the script to load
     * @param onSuccess defines the callback called when the script is loaded
     * @param onError defines the callback to call if an error occurs
     * @param scriptId defines the id of the script element
     */
    static LoadBabylonScript(scriptUrl, onSuccess, onError, scriptId) {
        scriptUrl = Tools.GetBabylonScriptURL(scriptUrl);
        Tools.LoadScript(scriptUrl, onSuccess, onError);
    }
    /**
     * Load an asynchronous script (identified by an url). When the url returns, the
     * content of this file is added into a new script element, attached to the DOM (body element)
     * @param scriptUrl defines the url of the script to laod
     * @returns a promise request object
     */
    static LoadBabylonScriptAsync(scriptUrl) {
        scriptUrl = Tools.GetBabylonScriptURL(scriptUrl);
        return Tools.LoadScriptAsync(scriptUrl);
    }
    /**
     * This function is used internally by babylon components to load a script (identified by an url). When the url returns, the
     * content of this file is added into a new script element, attached to the DOM (body element)
     * @param scriptUrl defines the url of the script to load
     * @param onSuccess defines the callback called when the script is loaded
     * @param onError defines the callback to call if an error occurs
     * @param scriptId defines the id of the script element
     * @param useModule defines if we should use the module strategy to load the script
     */
    static LoadScript(scriptUrl, onSuccess, onError, scriptId, useModule = false) {
        if (typeof importScripts === "function") {
            try {
                importScripts(scriptUrl);
                if (onSuccess) {
                    onSuccess();
                }
            }
            catch (e) {
                onError?.(`Unable to load script '${scriptUrl}' in worker`, e);
            }
            return;
        }
        else if (!(0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .BA)()) {
            onError?.(`Cannot load script '${scriptUrl}' outside of a window or a worker`);
            return;
        }
        const head = document.getElementsByTagName("head")[0];
        const script = document.createElement("script");
        if (useModule) {
            script.setAttribute("type", "module");
            script.innerText = scriptUrl;
        }
        else {
            script.setAttribute("type", "text/javascript");
            script.setAttribute("src", scriptUrl);
        }
        if (scriptId) {
            script.id = scriptId;
        }
        script.onload = () => {
            if (onSuccess) {
                onSuccess();
            }
        };
        script.onerror = (e) => {
            if (onError) {
                onError(`Unable to load script '${scriptUrl}'`, e);
            }
        };
        head.appendChild(script);
    }
    /**
     * Load an asynchronous script (identified by an url). When the url returns, the
     * content of this file is added into a new script element, attached to the DOM (body element)
     * @param scriptUrl defines the url of the script to load
     * @param scriptId defines the id of the script element
     * @returns a promise request object
     */
    static LoadScriptAsync(scriptUrl, scriptId) {
        return new Promise((resolve, reject) => {
            this.LoadScript(scriptUrl, () => {
                resolve();
            }, (message, exception) => {
                reject(exception || new Error(message));
            }, scriptId);
        });
    }
    /**
     * Loads a file from a blob
     * @param fileToLoad defines the blob to use
     * @param callback defines the callback to call when data is loaded
     * @param progressCallback defines the callback to call during loading process
     * @returns a file request object
     */
    static ReadFileAsDataURL(fileToLoad, callback, progressCallback) {
        const reader = new FileReader();
        const request = {
            onCompleteObservable: new _observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP(),
            abort: () => reader.abort(),
        };
        reader.onloadend = () => {
            request.onCompleteObservable.notifyObservers(request);
        };
        reader.onload = (e) => {
            //target doesn't have result from ts 1.3
            callback(e.target["result"]);
        };
        reader.onprogress = progressCallback;
        reader.readAsDataURL(fileToLoad);
        return request;
    }
    /**
     * Reads a file from a File object
     * @param file defines the file to load
     * @param onSuccess defines the callback to call when data is loaded
     * @param onProgress defines the callback to call during loading process
     * @param useArrayBuffer defines a boolean indicating that data must be returned as an ArrayBuffer
     * @param onError defines the callback to call when an error occurs
     * @returns a file request object
     */
    static ReadFile(file, onSuccess, onProgress, useArrayBuffer, onError) {
        return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .ReadFile */ .NJ)(file, onSuccess, onProgress, useArrayBuffer, onError);
    }
    /**
     * Creates a data url from a given string content
     * @param content defines the content to convert
     * @returns the new data url link
     */
    static FileAsURL(content) {
        const fileBlob = new Blob([content]);
        const url = window.URL;
        const link = url.createObjectURL(fileBlob);
        return link;
    }
    /**
     * Format the given number to a specific decimal format
     * @param value defines the number to format
     * @param decimals defines the number of decimals to use
     * @returns the formatted string
     */
    static Format(value, decimals = 2) {
        return value.toFixed(decimals);
    }
    /**
     * Tries to copy an object by duplicating every property
     * @param source defines the source object
     * @param destination defines the target object
     * @param doNotCopyList defines a list of properties to avoid
     * @param mustCopyList defines a list of properties to copy (even if they start with _)
     */
    static DeepCopy(source, destination, doNotCopyList, mustCopyList) {
        _deepCopier_js__WEBPACK_IMPORTED_MODULE_3__/* .DeepCopier */ .r.DeepCopy(source, destination, doNotCopyList, mustCopyList);
    }
    /**
     * Gets a boolean indicating if the given object has no own property
     * @param obj defines the object to test
     * @returns true if object has no own property
     */
    static IsEmpty(obj) {
        for (const i in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, i)) {
                return false;
            }
        }
        return true;
    }
    /**
     * Function used to register events at window level
     * @param windowElement defines the Window object to use
     * @param events defines the events to register
     */
    static RegisterTopRootEvents(windowElement, events) {
        for (let index = 0; index < events.length; index++) {
            const event = events[index];
            windowElement.addEventListener(event.name, event.handler, false);
            try {
                if (window.parent) {
                    window.parent.addEventListener(event.name, event.handler, false);
                }
            }
            catch (e) {
                // Silently fails...
            }
        }
    }
    /**
     * Function used to unregister events from window level
     * @param windowElement defines the Window object to use
     * @param events defines the events to unregister
     */
    static UnregisterTopRootEvents(windowElement, events) {
        for (let index = 0; index < events.length; index++) {
            const event = events[index];
            windowElement.removeEventListener(event.name, event.handler);
            try {
                if (windowElement.parent) {
                    windowElement.parent.removeEventListener(event.name, event.handler);
                }
            }
            catch (e) {
                // Silently fails...
            }
        }
    }
    /**
     * Dumps the current bound framebuffer
     * @param width defines the rendering width
     * @param height defines the rendering height
     * @param engine defines the hosting engine
     * @param successCallback defines the callback triggered once the data are available
     * @param mimeType defines the mime type of the result
     * @param fileName defines the filename to download. If present, the result will automatically be downloaded
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     * @returns a void promise
     */
    static async DumpFramebuffer(width, height, engine, successCallback, mimeType = "image/png", fileName, quality) {
        throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .n)("DumpTools");
    }
    /**
     * Dumps an array buffer
     * @param width defines the rendering width
     * @param height defines the rendering height
     * @param data the data array
     * @param successCallback defines the callback triggered once the data are available
     * @param mimeType defines the mime type of the result
     * @param fileName defines the filename to download. If present, the result will automatically be downloaded
     * @param invertY true to invert the picture in the Y dimension
     * @param toArrayBuffer true to convert the data to an ArrayBuffer (encoded as `mimeType`) instead of a base64 string
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     */
    static DumpData(width, height, data, successCallback, mimeType = "image/png", fileName, invertY = false, toArrayBuffer = false, quality) {
        throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .n)("DumpTools");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Dumps an array buffer
     * @param width defines the rendering width
     * @param height defines the rendering height
     * @param data the data array
     * @param mimeType defines the mime type of the result
     * @param fileName defines the filename to download. If present, the result will automatically be downloaded
     * @param invertY true to invert the picture in the Y dimension
     * @param toArrayBuffer true to convert the data to an ArrayBuffer (encoded as `mimeType`) instead of a base64 string
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     * @returns a promise that resolve to the final data
     */
    static DumpDataAsync(width, height, data, mimeType = "image/png", fileName, invertY = false, toArrayBuffer = false, quality) {
        throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .n)("DumpTools");
    }
    static _IsOffScreenCanvas(canvas) {
        return canvas.convertToBlob !== undefined;
    }
    /**
     * Converts the canvas data to blob.
     * This acts as a polyfill for browsers not supporting the to blob function.
     * @param canvas Defines the canvas to extract the data from (can be an offscreen canvas)
     * @param successCallback Defines the callback triggered once the data are available
     * @param mimeType Defines the mime type of the result
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     */
    static ToBlob(canvas, successCallback, mimeType = "image/png", quality) {
        // We need HTMLCanvasElement.toBlob for HD screenshots
        if (!Tools._IsOffScreenCanvas(canvas) && !canvas.toBlob) {
            //  low performance polyfill based on toDataURL (https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob)
            canvas.toBlob = function (callback, type, quality) {
                setTimeout(() => {
                    const binStr = atob(this.toDataURL(type, quality).split(",")[1]), len = binStr.length, arr = new Uint8Array(len);
                    for (let i = 0; i < len; i++) {
                        arr[i] = binStr.charCodeAt(i);
                    }
                    callback(new Blob([arr]));
                });
            };
        }
        if (Tools._IsOffScreenCanvas(canvas)) {
            canvas
                .convertToBlob({
                type: mimeType,
                quality,
            })
                .then((blob) => successCallback(blob));
        }
        else {
            canvas.toBlob(function (blob) {
                successCallback(blob);
            }, mimeType, quality);
        }
    }
    /**
     * Download a Blob object
     * @param blob the Blob object
     * @param fileName the file name to download
     */
    static DownloadBlob(blob, fileName) {
        //Creating a link if the browser have the download attribute on the a tag, to automatically start download generated image.
        if ("download" in document.createElement("a")) {
            if (!fileName) {
                const date = new Date();
                const stringDate = (date.getFullYear() + "-" + (date.getMonth() + 1)).slice(2) + "-" + date.getDate() + "_" + date.getHours() + "-" + ("0" + date.getMinutes()).slice(-2);
                fileName = "screenshot_" + stringDate + ".png";
            }
            Tools.Download(blob, fileName);
        }
        else {
            if (blob && typeof URL !== "undefined") {
                const url = URL.createObjectURL(blob);
                const newWindow = window.open("");
                if (!newWindow) {
                    return;
                }
                const img = newWindow.document.createElement("img");
                img.onload = function () {
                    // no longer need to read the blob so it's revoked
                    URL.revokeObjectURL(url);
                };
                img.src = url;
                newWindow.document.body.appendChild(img);
            }
        }
    }
    /**
     * Encodes the canvas data to base 64, or automatically downloads the result if `fileName` is defined.
     * @param canvas The canvas to get the data from, which can be an offscreen canvas.
     * @param successCallback The callback which is triggered once the data is available. If `fileName` is defined, the callback will be invoked after the download occurs, and the `data` argument will be an empty string.
     * @param mimeType The mime type of the result.
     * @param fileName The name of the file to download. If defined, the result will automatically be downloaded. If not defined, and `successCallback` is also not defined, the result will automatically be downloaded with an auto-generated file name.
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     */
    static EncodeScreenshotCanvasData(canvas, successCallback, mimeType = "image/png", fileName, quality) {
        if (typeof fileName === "string" || !successCallback) {
            this.ToBlob(canvas, function (blob) {
                if (blob) {
                    Tools.DownloadBlob(blob, fileName);
                }
                if (successCallback) {
                    successCallback("");
                }
            }, mimeType, quality);
        }
        else if (successCallback) {
            if (Tools._IsOffScreenCanvas(canvas)) {
                canvas
                    .convertToBlob({
                    type: mimeType,
                    quality,
                })
                    .then((blob) => {
                    const reader = new FileReader();
                    reader.readAsDataURL(blob);
                    reader.onloadend = () => {
                        const base64data = reader.result;
                        successCallback(base64data);
                    };
                });
                return;
            }
            const base64Image = canvas.toDataURL(mimeType, quality);
            successCallback(base64Image);
        }
    }
    /**
     * Downloads a blob in the browser
     * @param blob defines the blob to download
     * @param fileName defines the name of the downloaded file
     */
    static Download(blob, fileName) {
        if (typeof URL === "undefined") {
            return;
        }
        const url = window.URL.createObjectURL(blob);
        const a = document.createElement("a");
        document.body.appendChild(a);
        a.style.display = "none";
        a.href = url;
        a.download = fileName;
        a.addEventListener("click", () => {
            if (a.parentElement) {
                a.parentElement.removeChild(a);
            }
        });
        a.click();
        window.URL.revokeObjectURL(url);
    }
    /**
     * Will return the right value of the noPreventDefault variable
     * Needed to keep backwards compatibility to the old API.
     *
     * @param args arguments passed to the attachControl function
     * @returns the correct value for noPreventDefault
     */
    static BackCompatCameraNoPreventDefault(args) {
        // is it used correctly?
        if (typeof args[0] === "boolean") {
            return args[0];
        }
        else if (typeof args[1] === "boolean") {
            return args[1];
        }
        return false;
    }
    /**
     * Captures a screenshot of the current rendering
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
     * @param engine defines the rendering engine
     * @param camera defines the source camera
     * @param size This parameter can be set to a single number or to an object with the
     * following (optional) properties: precision, width, height. If a single number is passed,
     * it will be used for both width and height. If an object is passed, the screenshot size
     * will be derived from the parameters. The precision property is a multiplier allowing
     * rendering at a higher or lower resolution
     * @param successCallback defines the callback receives a single parameter which contains the
     * screenshot as a string of base64-encoded characters. This string can be assigned to the
     * src parameter of an <img> to display it
     * @param mimeType defines the MIME type of the screenshot image (default: image/png).
     * Check your browser for supported MIME types
     * @param forceDownload force the system to download the image even if a successCallback is provided
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static CreateScreenshot(engine, camera, size, successCallback, mimeType = "image/png", forceDownload = false, quality) {
        throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .n)("ScreenshotTools");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Captures a screenshot of the current rendering
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
     * @param engine defines the rendering engine
     * @param camera defines the source camera
     * @param size This parameter can be set to a single number or to an object with the
     * following (optional) properties: precision, width, height. If a single number is passed,
     * it will be used for both width and height. If an object is passed, the screenshot size
     * will be derived from the parameters. The precision property is a multiplier allowing
     * rendering at a higher or lower resolution
     * @param mimeType defines the MIME type of the screenshot image (default: image/png).
     * Check your browser for supported MIME types
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     * @returns screenshot as a string of base64-encoded characters. This string can be assigned
     * to the src parameter of an <img> to display it
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static CreateScreenshotAsync(engine, camera, size, mimeType = "image/png", quality) {
        throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .n)("ScreenshotTools");
    }
    /**
     * Generates an image screenshot from the specified camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
     * @param engine The engine to use for rendering
     * @param camera The camera to use for rendering
     * @param size This parameter can be set to a single number or to an object with the
     * following (optional) properties: precision, width, height. If a single number is passed,
     * it will be used for both width and height. If an object is passed, the screenshot size
     * will be derived from the parameters. The precision property is a multiplier allowing
     * rendering at a higher or lower resolution
     * @param successCallback The callback receives a single parameter which contains the
     * screenshot as a string of base64-encoded characters. This string can be assigned to the
     * src parameter of an <img> to display it
     * @param mimeType The MIME type of the screenshot image (default: image/png).
     * Check your browser for supported MIME types
     * @param samples Texture samples (default: 1)
     * @param antialiasing Whether antialiasing should be turned on or not (default: false)
     * @param fileName A name for for the downloaded file.
     * @param renderSprites Whether the sprites should be rendered or not (default: false)
     * @param enableStencilBuffer Whether the stencil buffer should be enabled or not (default: false)
     * @param useLayerMask if the camera's layer mask should be used to filter what should be rendered (default: true)
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     * @param customizeTexture An optional callback that can be used to modify the render target texture before taking the screenshot. This can be used, for instance, to enable camera post-processes before taking the screenshot.
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static CreateScreenshotUsingRenderTarget(engine, camera, size, successCallback, mimeType = "image/png", samples = 1, antialiasing = false, fileName, renderSprites = false, enableStencilBuffer = false, useLayerMask = true, quality, customizeTexture) {
        throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .n)("ScreenshotTools");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Generates an image screenshot from the specified camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
     * @param engine The engine to use for rendering
     * @param camera The camera to use for rendering
     * @param size This parameter can be set to a single number or to an object with the
     * following (optional) properties: precision, width, height. If a single number is passed,
     * it will be used for both width and height. If an object is passed, the screenshot size
     * will be derived from the parameters. The precision property is a multiplier allowing
     * rendering at a higher or lower resolution
     * @param mimeType The MIME type of the screenshot image (default: image/png).
     * Check your browser for supported MIME types
     * @param samples Texture samples (default: 1)
     * @param antialiasing Whether antialiasing should be turned on or not (default: false)
     * @param fileName A name for for the downloaded file.
     * @param renderSprites Whether the sprites should be rendered or not (default: false)
     * @param enableStencilBuffer Whether the stencil buffer should be enabled or not (default: false)
     * @param useLayerMask if the camera's layer mask should be used to filter what should be rendered (default: true)
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     * @param customizeTexture An optional callback that can be used to modify the render target texture before taking the screenshot. This can be used, for instance, to enable camera post-processes before taking the screenshot.
     * @returns screenshot as a string of base64-encoded characters. This string can be assigned
     * to the src parameter of an <img> to display it
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static CreateScreenshotUsingRenderTargetAsync(engine, camera, size, mimeType = "image/png", samples = 1, antialiasing = false, fileName, renderSprites = false, enableStencilBuffer = false, useLayerMask = true, quality, customizeTexture) {
        throw (0,_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .n)("ScreenshotTools");
    }
    /**
     * Implementation from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#answer-2117523
     * Be aware Math.random() could cause collisions, but:
     * "All but 6 of the 128 bits of the ID are randomly generated, which means that for any two ids, there's a 1 in 2^^122 (or 5.3x10^^36) chance they'll collide"
     * @returns a pseudo random id
     */
    static RandomId() {
        return (0,_guid_js__WEBPACK_IMPORTED_MODULE_11__/* .RandomGUID */ .z)();
    }
    /**
     * Test if the given uri is a base64 string
     * @deprecated Please use FileTools.IsBase64DataUrl instead.
     * @param uri The uri to test
     * @returns True if the uri is a base64 string or false otherwise
     */
    static IsBase64(uri) {
        return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .IsBase64DataUrl */ .f2)(uri);
    }
    /**
     * Decode the given base64 uri.
     * @deprecated Please use FileTools.DecodeBase64UrlToBinary instead.
     * @param uri The uri to decode
     * @returns The decoded base64 data.
     */
    static DecodeBase64(uri) {
        return (0,_fileTools_js__WEBPACK_IMPORTED_MODULE_8__/* .DecodeBase64UrlToBinary */ .rz)(uri);
    }
    /**
     * Gets a value indicating the number of loading errors
     * @ignorenaming
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static get errorsCount() {
        return _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.errorsCount;
    }
    /**
     * Log a message to the console
     * @param message defines the message to log
     */
    static Log(message) {
        _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Log(message);
    }
    /**
     * Write a warning message to the console
     * @param message defines the message to log
     */
    static Warn(message) {
        _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Warn(message);
    }
    /**
     * Write an error message to the console
     * @param message defines the message to log
     */
    static Error(message) {
        _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Error(message);
    }
    /**
     * Gets current log cache (list of logs)
     */
    static get LogCache() {
        return _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.LogCache;
    }
    /**
     * Clears the log cache
     */
    static ClearLogCache() {
        _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.ClearLogCache();
    }
    /**
     * Sets the current log level (MessageLogLevel / WarningLogLevel / ErrorLogLevel)
     */
    static set LogLevels(level) {
        _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.LogLevels = level;
    }
    /**
     * Sets the current performance log level
     */
    static set PerformanceLogLevel(level) {
        if ((level & Tools.PerformanceUserMarkLogLevel) === Tools.PerformanceUserMarkLogLevel) {
            Tools.StartPerformanceCounter = Tools._StartUserMark;
            Tools.EndPerformanceCounter = Tools._EndUserMark;
            return;
        }
        if ((level & Tools.PerformanceConsoleLogLevel) === Tools.PerformanceConsoleLogLevel) {
            Tools.StartPerformanceCounter = Tools._StartPerformanceConsole;
            Tools.EndPerformanceCounter = Tools._EndPerformanceConsole;
            return;
        }
        Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled;
        Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled;
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static _StartPerformanceCounterDisabled(counterName, condition) { }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static _EndPerformanceCounterDisabled(counterName, condition) { }
    static _StartUserMark(counterName, condition = true) {
        if (!Tools._Performance) {
            if (!(0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .BA)()) {
                return;
            }
            Tools._Performance = window.performance;
        }
        if (!condition || !Tools._Performance.mark) {
            return;
        }
        Tools._Performance.mark(counterName + "-Begin");
    }
    static _EndUserMark(counterName, condition = true) {
        if (!condition || !Tools._Performance.mark) {
            return;
        }
        Tools._Performance.mark(counterName + "-End");
        Tools._Performance.measure(counterName, counterName + "-Begin", counterName + "-End");
    }
    static _StartPerformanceConsole(counterName, condition = true) {
        if (!condition) {
            return;
        }
        Tools._StartUserMark(counterName, condition);
        if (console.time) {
            console.time(counterName);
        }
    }
    static _EndPerformanceConsole(counterName, condition = true) {
        if (!condition) {
            return;
        }
        Tools._EndUserMark(counterName, condition);
        console.timeEnd(counterName);
    }
    /**
     * Gets either window.performance.now() if supported or Date.now() else
     */
    static get Now() {
        return _precisionDate_js__WEBPACK_IMPORTED_MODULE_4__/* .PrecisionDate */ .j.Now;
    }
    /**
     * This method will return the name of the class used to create the instance of the given object.
     * It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator.
     * @param object the object to get the class name from
     * @param isType defines if the object is actually a type
     * @returns the name of the class, will be "object" for a custom data type not using the @className decorator
     */
    static GetClassName(object, isType = false) {
        let name = null;
        if (!isType && object.getClassName) {
            name = object.getClassName();
        }
        else {
            if (object instanceof Object) {
                const classObj = isType ? object : Object.getPrototypeOf(object);
                name = classObj.constructor["__bjsclassName__"];
            }
            if (!name) {
                name = typeof object;
            }
        }
        return name;
    }
    /**
     * Gets the first element of an array satisfying a given predicate
     * @param array defines the array to browse
     * @param predicate defines the predicate to use
     * @returns null if not found or the element
     */
    static First(array, predicate) {
        for (const el of array) {
            if (predicate(el)) {
                return el;
            }
        }
        return null;
    }
    /**
     * This method will return the name of the full name of the class, including its owning module (if any).
     * It will works only on Javascript basic data types (number, string, ...) and instance of class declared with the @className decorator or implementing a method getClassName():string (in which case the module won't be specified).
     * @param object the object to get the class name from
     * @param isType defines if the object is actually a type
     * @returns a string that can have two forms: "moduleName.className" if module was specified when the class' Name was registered or "className" if there was not module specified.
     * @ignorenaming
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static getFullClassName(object, isType = false) {
        let className = null;
        let moduleName = null;
        if (!isType && object.getClassName) {
            className = object.getClassName();
        }
        else {
            if (object instanceof Object) {
                const classObj = isType ? object : Object.getPrototypeOf(object);
                className = classObj.constructor["__bjsclassName__"];
                moduleName = classObj.constructor["__bjsmoduleName__"];
            }
            if (!className) {
                className = typeof object;
            }
        }
        if (!className) {
            return null;
        }
        return (moduleName != null ? moduleName + "." : "") + className;
    }
    /**
     * Returns a promise that resolves after the given amount of time.
     * @param delay Number of milliseconds to delay
     * @returns Promise that resolves after the given amount of time
     */
    static DelayAsync(delay) {
        return new Promise((resolve) => {
            setTimeout(() => {
                resolve();
            }, delay);
        });
    }
    /**
     * Utility function to detect if the current user agent is Safari
     * @returns whether or not the current user agent is safari
     */
    static IsSafari() {
        if (!(0,_domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsNavigatorAvailable */ .XD)()) {
            return false;
        }
        return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
    }
}
/**
 * Enable/Disable Custom HTTP Request Headers globally.
 * default = false
 * @see CustomRequestHeaders
 */
Tools.UseCustomRequestHeaders = false;
/**
 * Custom HTTP Request Headers to be sent with XMLHttpRequests
 * i.e. when loading files, where the server/service expects an Authorization header
 */
Tools.CustomRequestHeaders = _webRequest_js__WEBPACK_IMPORTED_MODULE_6__/* .WebRequest */ .u.CustomRequestHeaders;
/**
 * Extracts text content from a DOM element hierarchy
 * Back Compat only, please use GetDOMTextContent instead.
 */
Tools.GetDOMTextContent = _domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .GetDOMTextContent */ .Zl;
/**
 * @internal
 */
Tools._DefaultCdnUrl = "https://cdn.babylonjs.com";
// eslint-disable-next-line jsdoc/require-returns-check, jsdoc/require-param
/**
 * @returns the absolute URL of a given (relative) url
 */
Tools.GetAbsoluteUrl = typeof document === "object"
    ? (url) => {
        const a = document.createElement("a");
        a.href = url;
        return a.href;
    }
    : typeof URL === "function" && typeof location === "object"
        ? (url) => new URL(url, location.origin).href
        : () => {
            throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.");
        };
// Logs
/**
 * No log
 */
Tools.NoneLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.NoneLogLevel;
/**
 * Only message logs
 */
Tools.MessageLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.MessageLogLevel;
/**
 * Only warning logs
 */
Tools.WarningLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.WarningLogLevel;
/**
 * Only error logs
 */
Tools.ErrorLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.ErrorLogLevel;
/**
 * All logs
 */
Tools.AllLogLevel = _logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.AllLogLevel;
/**
 * Checks if the window object exists
 * Back Compat only, please use IsWindowObjectExist instead.
 */
Tools.IsWindowObjectExist = _domManagement_js__WEBPACK_IMPORTED_MODULE_1__/* .IsWindowObjectExist */ .BA;
// Performances
/**
 * No performance log
 */
Tools.PerformanceNoneLogLevel = 0;
/**
 * Use user marks to log performance
 */
Tools.PerformanceUserMarkLogLevel = 1;
/**
 * Log performance to the console
 */
Tools.PerformanceConsoleLogLevel = 2;
/**
 * Starts a performance counter
 */
Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled;
/**
 * Ends a specific performance counter
 */
Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled;
/**
 * Use this className as a decorator on a given class definition to add it a name and optionally its module.
 * You can then use the Tools.getClassName(obj) on an instance to retrieve its class name.
 * This method is the only way to get it done in all cases, even if the .js file declaring the class is minified
 * @param name The name of the class, case should be preserved
 * @param module The name of the Module hosting the class, optional, but strongly recommended to specify if possible. Case should be preserved.
 * @returns a decorator function to apply on the class definition.
 */
function className(name, module) {
    return (target) => {
        target["__bjsclassName__"] = name;
        target["__bjsmoduleName__"] = module != null ? module : null;
    };
}
/**
 * An implementation of a loop for asynchronous functions.
 */
class AsyncLoop {
    /**
     * Constructor.
     * @param iterations the number of iterations.
     * @param func the function to run each iteration
     * @param successCallback the callback that will be called upon successful execution
     * @param offset starting offset.
     */
    constructor(
    /**
     * Defines the number of iterations for the loop
     */
    iterations, func, successCallback, offset = 0) {
        this.iterations = iterations;
        this.index = offset - 1;
        this._done = false;
        this._fn = func;
        this._successCallback = successCallback;
    }
    /**
     * Execute the next iteration. Must be called after the last iteration was finished.
     */
    executeNext() {
        if (!this._done) {
            if (this.index + 1 < this.iterations) {
                ++this.index;
                this._fn(this);
            }
            else {
                this.breakLoop();
            }
        }
    }
    /**
     * Break the loop and run the success callback.
     */
    breakLoop() {
        this._done = true;
        this._successCallback();
    }
    /**
     * Create and run an async loop.
     * @param iterations the number of iterations.
     * @param fn the function to run each iteration
     * @param successCallback the callback that will be called upon successful execution
     * @param offset starting offset.
     * @returns the created async loop object
     */
    static Run(iterations, fn, successCallback, offset = 0) {
        const loop = new AsyncLoop(iterations, fn, successCallback, offset);
        loop.executeNext();
        return loop;
    }
    /**
     * A for-loop that will run a given number of iterations synchronous and the rest async.
     * @param iterations total number of iterations
     * @param syncedIterations number of synchronous iterations in each async iteration.
     * @param fn the function to call each iteration.
     * @param callback a success call back that will be called when iterating stops.
     * @param breakFunction a break condition (optional)
     * @param timeout timeout settings for the setTimeout function. default - 0.
     * @returns the created async loop object
     */
    static SyncAsyncForLoop(iterations, syncedIterations, fn, callback, breakFunction, timeout = 0) {
        return AsyncLoop.Run(Math.ceil(iterations / syncedIterations), (loop) => {
            if (breakFunction && breakFunction()) {
                loop.breakLoop();
            }
            else {
                setTimeout(() => {
                    for (let i = 0; i < syncedIterations; ++i) {
                        const iteration = loop.index * syncedIterations + i;
                        if (iteration >= iterations) {
                            break;
                        }
                        fn(iteration);
                        if (breakFunction && breakFunction()) {
                            loop.breakLoop();
                            break;
                        }
                    }
                    loop.executeNext();
                }, timeout);
            }
        }, callback);
    }
}
Tools.Mix = _tools_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .Mix */ .zF;
Tools.IsExponentOfTwo = _tools_functions_js__WEBPACK_IMPORTED_MODULE_12__/* .IsExponentOfTwo */ .L8;
// Will only be define if Tools is imported freeing up some space when only engine is required
_Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_7__/* .EngineStore */ .q.FallbackTexture =
    "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z";
//# sourceMappingURL=tools.js.map

/***/ }),

/***/ 56552:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Uu: () => (/* binding */ GetClassName),
/* harmony export */   Y5: () => (/* binding */ RegisterClass),
/* harmony export */   n9: () => (/* binding */ GetClass)
/* harmony export */ });
/** @internal */
// eslint-disable-next-line @typescript-eslint/naming-convention
const _RegisteredTypes = {};
/**
 * @internal
 */
function RegisterClass(className, type) {
    _RegisteredTypes[className] = type;
}
/**
 * @internal
 */
function GetClass(fqdn) {
    return _RegisteredTypes[fqdn];
}
/**
 * @internal
 */
function GetClassName(obj) {
    for (const key in _RegisteredTypes) {
        if (obj instanceof _RegisteredTypes[key] && !key.includes("Abstract")) {
            return key;
        }
    }
    return "Unknown";
}
//# sourceMappingURL=typeStore.js.map

/***/ }),

/***/ 82678:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   K: () => (/* binding */ UniqueIdGenerator)
/* harmony export */ });
/**
 * Helper class used to generate session unique ID
 */
class UniqueIdGenerator {
    /**
     * Gets an unique (relatively to the current scene) Id
     */
    static get UniqueId() {
        const result = this._UniqueIdCounter;
        this._UniqueIdCounter++;
        return result;
    }
}
// Statics
UniqueIdGenerator._UniqueIdCounter = 1;
//# sourceMappingURL=uniqueIdGenerator.js.map

/***/ }),

/***/ 62366:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   u: () => (/* binding */ WebRequest)
/* harmony export */ });
/** @internal */
// eslint-disable-next-line @typescript-eslint/naming-convention
function createXMLHttpRequest() {
    // If running in Babylon Native, then defer to the native XMLHttpRequest, which has the same public contract
    if (typeof _native !== "undefined" && _native.XMLHttpRequest) {
        return new _native.XMLHttpRequest();
    }
    else {
        return new XMLHttpRequest();
    }
}
/**
 * Extended version of XMLHttpRequest with support for customizations (headers, ...)
 */
class WebRequest {
    constructor() {
        this._xhr = createXMLHttpRequest();
        this._requestURL = "";
    }
    /**
     * This function can be called to check if there are request modifiers for network requests
     * @returns true if there are any custom requests available
     */
    static get IsCustomRequestAvailable() {
        return Object.keys(WebRequest.CustomRequestHeaders).length > 0 || WebRequest.CustomRequestModifiers.length > 0;
    }
    /**
     * Returns the requested URL once open has been called
     */
    get requestURL() {
        return this._requestURL;
    }
    _injectCustomRequestHeaders() {
        if (this._shouldSkipRequestModifications(this._requestURL)) {
            return;
        }
        for (const key in WebRequest.CustomRequestHeaders) {
            const val = WebRequest.CustomRequestHeaders[key];
            if (val) {
                this._xhr.setRequestHeader(key, val);
            }
        }
    }
    _shouldSkipRequestModifications(url) {
        return WebRequest.SkipRequestModificationForBabylonCDN && (url.includes("preview.babylonjs.com") || url.includes("cdn.babylonjs.com"));
    }
    /**
     * Gets or sets a function to be called when loading progress changes
     */
    get onprogress() {
        return this._xhr.onprogress;
    }
    set onprogress(value) {
        this._xhr.onprogress = value;
    }
    /**
     * Returns client's state
     */
    get readyState() {
        return this._xhr.readyState;
    }
    /**
     * Returns client's status
     */
    get status() {
        return this._xhr.status;
    }
    /**
     * Returns client's status as a text
     */
    get statusText() {
        return this._xhr.statusText;
    }
    /**
     * Returns client's response
     */
    get response() {
        return this._xhr.response;
    }
    /**
     * Returns client's response url
     */
    get responseURL() {
        return this._xhr.responseURL;
    }
    /**
     * Returns client's response as text
     */
    get responseText() {
        return this._xhr.responseText;
    }
    /**
     * Gets or sets the expected response type
     */
    get responseType() {
        return this._xhr.responseType;
    }
    set responseType(value) {
        this._xhr.responseType = value;
    }
    /**
     * Gets or sets the timeout value in milliseconds
     */
    get timeout() {
        return this._xhr.timeout;
    }
    set timeout(value) {
        this._xhr.timeout = value;
    }
    addEventListener(type, listener, options) {
        this._xhr.addEventListener(type, listener, options);
    }
    removeEventListener(type, listener, options) {
        this._xhr.removeEventListener(type, listener, options);
    }
    /**
     * Cancels any network activity
     */
    abort() {
        this._xhr.abort();
    }
    /**
     * Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD
     * @param body defines an optional request body
     */
    send(body) {
        if (WebRequest.CustomRequestHeaders) {
            this._injectCustomRequestHeaders();
        }
        this._xhr.send(body);
    }
    /**
     * Sets the request method, request URL
     * @param method defines the method to use (GET, POST, etc..)
     * @param url defines the url to connect with
     */
    open(method, url) {
        for (const update of WebRequest.CustomRequestModifiers) {
            if (this._shouldSkipRequestModifications(url)) {
                return;
            }
            update(this._xhr, url);
        }
        // Clean url
        url = url.replace("file:http:", "http:");
        url = url.replace("file:https:", "https:");
        this._requestURL = url;
        this._xhr.open(method, url, true);
    }
    /**
     * Sets the value of a request header.
     * @param name The name of the header whose value is to be set
     * @param value The value to set as the body of the header
     */
    setRequestHeader(name, value) {
        this._xhr.setRequestHeader(name, value);
    }
    /**
     * Get the string containing the text of a particular header's value.
     * @param name The name of the header
     * @returns The string containing the text of the given header name
     */
    getResponseHeader(name) {
        return this._xhr.getResponseHeader(name);
    }
}
/**
 * Custom HTTP Request Headers to be sent with XMLHttpRequests
 * i.e. when loading files, where the server/service expects an Authorization header
 */
WebRequest.CustomRequestHeaders = {};
/**
 * Add callback functions in this array to update all the requests before they get sent to the network
 */
WebRequest.CustomRequestModifiers = new Array();
/**
 * If set to true, requests to Babylon.js CDN requests will not be modified
 */
WebRequest.SkipRequestModificationForBabylonCDN = true;
//# sourceMappingURL=webRequest.js.map

/***/ }),

/***/ 97573:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   T: () => (/* binding */ WorkerPool),
/* harmony export */   h: () => (/* binding */ AutoReleaseWorkerPool)
/* harmony export */ });
/**
 * Helper class to push actions to a pool of workers.
 */
class WorkerPool {
    /**
     * Constructor
     * @param workers Array of workers to use for actions
     */
    constructor(workers) {
        this._pendingActions = new Array();
        this._workerInfos = workers.map((worker) => ({
            workerPromise: Promise.resolve(worker),
            idle: true,
        }));
    }
    /**
     * Terminates all workers and clears any pending actions.
     */
    dispose() {
        for (const workerInfo of this._workerInfos) {
            workerInfo.workerPromise.then((worker) => {
                worker.terminate();
            });
        }
        this._workerInfos.length = 0;
        this._pendingActions.length = 0;
    }
    /**
     * Pushes an action to the worker pool. If all the workers are active, the action will be
     * pended until a worker has completed its action.
     * @param action The action to perform. Call onComplete when the action is complete.
     */
    push(action) {
        if (!this._executeOnIdleWorker(action)) {
            this._pendingActions.push(action);
        }
    }
    _executeOnIdleWorker(action) {
        for (const workerInfo of this._workerInfos) {
            if (workerInfo.idle) {
                this._execute(workerInfo, action);
                return true;
            }
        }
        return false;
    }
    _execute(workerInfo, action) {
        workerInfo.idle = false;
        workerInfo.workerPromise.then((worker) => {
            action(worker, () => {
                const nextAction = this._pendingActions.shift();
                if (nextAction) {
                    this._execute(workerInfo, nextAction);
                }
                else {
                    workerInfo.idle = true;
                }
            });
        });
    }
}
/**
 * Similar to the WorkerPool class except it creates and destroys workers automatically with a maximum of `maxWorkers` workers.
 * Workers are terminated when it is idle for at least `idleTimeElapsedBeforeRelease` milliseconds.
 */
class AutoReleaseWorkerPool extends WorkerPool {
    constructor(maxWorkers, createWorkerAsync, options = AutoReleaseWorkerPool.DefaultOptions) {
        super([]);
        this._maxWorkers = maxWorkers;
        this._createWorkerAsync = createWorkerAsync;
        this._options = options;
    }
    push(action) {
        if (!this._executeOnIdleWorker(action)) {
            if (this._workerInfos.length < this._maxWorkers) {
                const workerInfo = {
                    workerPromise: this._createWorkerAsync(),
                    idle: false,
                };
                this._workerInfos.push(workerInfo);
                this._execute(workerInfo, action);
            }
            else {
                this._pendingActions.push(action);
            }
        }
    }
    _execute(workerInfo, action) {
        // Reset the idle timeout.
        if (workerInfo.timeoutId) {
            clearTimeout(workerInfo.timeoutId);
            delete workerInfo.timeoutId;
        }
        super._execute(workerInfo, (worker, onComplete) => {
            action(worker, () => {
                onComplete();
                if (workerInfo.idle) {
                    // Schedule the worker to be terminated after the elapsed time.
                    workerInfo.timeoutId = setTimeout(() => {
                        workerInfo.workerPromise.then((worker) => {
                            worker.terminate();
                        });
                        const indexOf = this._workerInfos.indexOf(workerInfo);
                        if (indexOf !== -1) {
                            this._workerInfos.splice(indexOf, 1);
                        }
                    }, this._options.idleTimeElapsedBeforeRelease);
                }
            });
        });
    }
}
/**
 * Default options for the constructor.
 * Override to change the defaults.
 */
AutoReleaseWorkerPool.DefaultOptions = {
    idleTimeElapsedBeforeRelease: 1000,
};
//# sourceMappingURL=workerPool.js.map

/***/ }),

/***/ 80706:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   M: () => (/* binding */ MorphTarget)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6315);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95616);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79259);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26877);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56552);







/**
 * Defines a target to use with MorphTargetManager
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/morphTargets
 */
class MorphTarget {
    /**
     * Gets or sets the influence of this target (ie. its weight in the overall morphing)
     */
    get influence() {
        return this._influence;
    }
    set influence(influence) {
        if (this._influence === influence) {
            return;
        }
        const previous = this._influence;
        this._influence = influence;
        if (this.onInfluenceChanged.hasObservers()) {
            this.onInfluenceChanged.notifyObservers(previous === 0 || influence === 0);
        }
    }
    /**
     * Gets or sets the animation properties override
     */
    get animationPropertiesOverride() {
        if (!this._animationPropertiesOverride && this._scene) {
            return this._scene.animationPropertiesOverride;
        }
        return this._animationPropertiesOverride;
    }
    set animationPropertiesOverride(value) {
        this._animationPropertiesOverride = value;
    }
    /**
     * Creates a new MorphTarget
     * @param name defines the name of the target
     * @param influence defines the influence to use
     * @param scene defines the scene the morphtarget belongs to
     */
    constructor(
    /** defines the name of the target */
    name, influence = 0, scene = null) {
        this.name = name;
        /**
         * Gets or sets the list of animations
         */
        this.animations = [];
        this._positions = null;
        this._normals = null;
        this._tangents = null;
        this._uvs = null;
        this._uniqueId = 0;
        /**
         * Observable raised when the influence changes
         */
        this.onInfluenceChanged = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        /** @internal */
        this._onDataLayoutChanged = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        this._animationPropertiesOverride = null;
        this.id = name;
        this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__/* .EngineStore */ .q.LastCreatedScene;
        this.influence = influence;
        if (this._scene) {
            this._uniqueId = this._scene.getUniqueId();
        }
    }
    /**
     * Gets the unique ID of this manager
     */
    get uniqueId() {
        return this._uniqueId;
    }
    /**
     * Gets a boolean defining if the target contains position data
     */
    get hasPositions() {
        return !!this._positions;
    }
    /**
     * Gets a boolean defining if the target contains normal data
     */
    get hasNormals() {
        return !!this._normals;
    }
    /**
     * Gets a boolean defining if the target contains tangent data
     */
    get hasTangents() {
        return !!this._tangents;
    }
    /**
     * Gets a boolean defining if the target contains texture coordinates data
     */
    get hasUVs() {
        return !!this._uvs;
    }
    /**
     * Affects position data to this target
     * @param data defines the position data to use
     */
    setPositions(data) {
        const hadPositions = this.hasPositions;
        this._positions = data;
        if (hadPositions !== this.hasPositions) {
            this._onDataLayoutChanged.notifyObservers(undefined);
        }
    }
    /**
     * Gets the position data stored in this target
     * @returns a FloatArray containing the position data (or null if not present)
     */
    getPositions() {
        return this._positions;
    }
    /**
     * Affects normal data to this target
     * @param data defines the normal data to use
     */
    setNormals(data) {
        const hadNormals = this.hasNormals;
        this._normals = data;
        if (hadNormals !== this.hasNormals) {
            this._onDataLayoutChanged.notifyObservers(undefined);
        }
    }
    /**
     * Gets the normal data stored in this target
     * @returns a FloatArray containing the normal data (or null if not present)
     */
    getNormals() {
        return this._normals;
    }
    /**
     * Affects tangent data to this target
     * @param data defines the tangent data to use
     */
    setTangents(data) {
        const hadTangents = this.hasTangents;
        this._tangents = data;
        if (hadTangents !== this.hasTangents) {
            this._onDataLayoutChanged.notifyObservers(undefined);
        }
    }
    /**
     * Gets the tangent data stored in this target
     * @returns a FloatArray containing the tangent data (or null if not present)
     */
    getTangents() {
        return this._tangents;
    }
    /**
     * Affects texture coordinates data to this target
     * @param data defines the texture coordinates data to use
     */
    setUVs(data) {
        const hadUVs = this.hasUVs;
        this._uvs = data;
        if (hadUVs !== this.hasUVs) {
            this._onDataLayoutChanged.notifyObservers(undefined);
        }
    }
    /**
     * Gets the texture coordinates data stored in this target
     * @returns a FloatArray containing the texture coordinates data (or null if not present)
     */
    getUVs() {
        return this._uvs;
    }
    /**
     * Clone the current target
     * @returns a new MorphTarget
     */
    clone() {
        const newOne = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_5__/* .SerializationHelper */ .p.Clone(() => new MorphTarget(this.name, this.influence, this._scene), this);
        newOne._positions = this._positions;
        newOne._normals = this._normals;
        newOne._tangents = this._tangents;
        newOne._uvs = this._uvs;
        return newOne;
    }
    /**
     * Serializes the current target into a Serialization object
     * @returns the serialized object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.influence = this.influence;
        serializationObject.positions = Array.prototype.slice.call(this.getPositions());
        if (this.id != null) {
            serializationObject.id = this.id;
        }
        if (this.hasNormals) {
            serializationObject.normals = Array.prototype.slice.call(this.getNormals());
        }
        if (this.hasTangents) {
            serializationObject.tangents = Array.prototype.slice.call(this.getTangents());
        }
        if (this.hasUVs) {
            serializationObject.uvs = Array.prototype.slice.call(this.getUVs());
        }
        // Animations
        _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_5__/* .SerializationHelper */ .p.AppendSerializedAnimations(this, serializationObject);
        return serializationObject;
    }
    /**
     * Returns the string "MorphTarget"
     * @returns "MorphTarget"
     */
    getClassName() {
        return "MorphTarget";
    }
    // Statics
    /**
     * Creates a new target from serialized data
     * @param serializationObject defines the serialized data to use
     * @param scene defines the hosting scene
     * @returns a new MorphTarget
     */
    static Parse(serializationObject, scene) {
        const result = new MorphTarget(serializationObject.name, serializationObject.influence);
        result.setPositions(serializationObject.positions);
        if (serializationObject.id != null) {
            result.id = serializationObject.id;
        }
        if (serializationObject.normals) {
            result.setNormals(serializationObject.normals);
        }
        if (serializationObject.tangents) {
            result.setTangents(serializationObject.tangents);
        }
        if (serializationObject.uvs) {
            result.setUVs(serializationObject.uvs);
        }
        // Animations
        if (serializationObject.animations) {
            for (let animationIndex = 0; animationIndex < serializationObject.animations.length; animationIndex++) {
                const parsedAnimation = serializationObject.animations[animationIndex];
                const internalClass = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_6__/* .GetClass */ .n9)("BABYLON.Animation");
                if (internalClass) {
                    result.animations.push(internalClass.Parse(parsedAnimation));
                }
            }
            if (serializationObject.autoAnimate && scene) {
                scene.beginAnimation(result, serializationObject.autoAnimateFrom, serializationObject.autoAnimateTo, serializationObject.autoAnimateLoop, serializationObject.autoAnimateSpeed || 1.0);
            }
        }
        return result;
    }
    /**
     * Creates a MorphTarget from mesh data
     * @param mesh defines the source mesh
     * @param name defines the name to use for the new target
     * @param influence defines the influence to attach to the target
     * @returns a new MorphTarget
     */
    static FromMesh(mesh, name, influence) {
        if (!name) {
            name = mesh.name;
        }
        const result = new MorphTarget(name, influence, mesh.getScene());
        result.setPositions(mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind));
        if (mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind)) {
            result.setNormals(mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.NormalKind));
        }
        if (mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.TangentKind)) {
            result.setTangents(mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.TangentKind));
        }
        if (mesh.isVerticesDataPresent(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind)) {
            result.setUVs(mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind));
        }
        return result;
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_4__/* .serialize */ .lK)()
], MorphTarget.prototype, "id", void 0);
//# sourceMappingURL=morphTarget.js.map

/***/ }),

/***/ 98639:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   j: () => (/* binding */ MorphTargetManager)
/* harmony export */ });
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17931);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51137);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6315);
/* harmony import */ var _morphTarget_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80706);
/* harmony import */ var _Materials_Textures_rawTexture2DArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12462);






/**
 * This class is used to deform meshes using morphing between different targets
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/morphTargets
 */
class MorphTargetManager {
    /**
     * Sets a boolean indicating that adding new target or updating an existing target will not update the underlying data buffers
     */
    set areUpdatesFrozen(block) {
        if (block) {
            this._blockCounter++;
        }
        else {
            this._blockCounter--;
            if (this._blockCounter <= 0) {
                this._blockCounter = 0;
                this._syncActiveTargets(true);
            }
        }
    }
    get areUpdatesFrozen() {
        return this._blockCounter > 0;
    }
    /**
     * Creates a new MorphTargetManager
     * @param scene defines the current scene
     */
    constructor(scene = null) {
        this._targets = new Array();
        this._targetInfluenceChangedObservers = new Array();
        this._targetDataLayoutChangedObservers = new Array();
        this._activeTargets = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .L(16);
        this._supportsNormals = false;
        this._supportsTangents = false;
        this._supportsUVs = false;
        this._vertexCount = 0;
        this._uniqueId = 0;
        this._tempInfluences = new Array();
        this._canUseTextureForTargets = false;
        this._blockCounter = 0;
        /** @internal */
        this._textureVertexStride = 0;
        /** @internal */
        this._textureWidth = 0;
        /** @internal */
        this._textureHeight = 1;
        /** @internal */
        this._parentContainer = null;
        /**
         * Gets or sets a boolean indicating if influencers must be optimized (eg. recompiling the shader if less influencers are used)
         */
        this.optimizeInfluencers = true;
        /**
         * Gets or sets a boolean indicating if normals must be morphed
         */
        this.enableNormalMorphing = true;
        /**
         * Gets or sets a boolean indicating if tangents must be morphed
         */
        this.enableTangentMorphing = true;
        /**
         * Gets or sets a boolean indicating if UV must be morphed
         */
        this.enableUVMorphing = true;
        this._numMaxInfluencers = 0;
        this._useTextureToStoreTargets = true;
        if (!scene) {
            scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_2__/* .EngineStore */ .q.LastCreatedScene;
        }
        this._scene = scene;
        if (this._scene) {
            this._scene.addMorphTargetManager(this);
            this._uniqueId = this._scene.getUniqueId();
            const engineCaps = this._scene.getEngine().getCaps();
            this._canUseTextureForTargets =
                engineCaps.canUseGLVertexID && engineCaps.textureFloat && engineCaps.maxVertexTextureImageUnits > 0 && engineCaps.texture2DArrayMaxLayerCount > 1;
        }
    }
    /**
     * Gets or sets the maximum number of influencers (targets) (default value: 0).
     * Setting a value for this property can lead to a smoother experience, as only one shader will be compiled, which will use this value as the maximum number of influencers.
     * If you leave the value at 0 (default), a new shader will be compiled every time the number of active influencers changes. This can cause problems, as compiling a shader takes time.
     * If you assign a non-zero value to this property, you need to ensure that this value is greater than the maximum number of (active) influencers you'll need for this morph manager.
     * Otherwise, the number of active influencers will be truncated at the value you set for this property, which can lead to unexpected results.
     * Note that this property has no effect if "useTextureToStoreTargets" is false.
     */
    get numMaxInfluencers() {
        return this._numMaxInfluencers;
    }
    set numMaxInfluencers(value) {
        if (this._numMaxInfluencers === value) {
            return;
        }
        this._numMaxInfluencers = value;
        this._syncActiveTargets(true);
    }
    /**
     * Gets the unique ID of this manager
     */
    get uniqueId() {
        return this._uniqueId;
    }
    /**
     * Gets the number of vertices handled by this manager
     */
    get vertexCount() {
        return this._vertexCount;
    }
    /**
     * Gets a boolean indicating if this manager supports morphing of normals
     */
    get supportsNormals() {
        return this._supportsNormals && this.enableNormalMorphing;
    }
    /**
     * Gets a boolean indicating if this manager supports morphing of tangents
     */
    get supportsTangents() {
        return this._supportsTangents && this.enableTangentMorphing;
    }
    /**
     * Gets a boolean indicating if this manager supports morphing of texture coordinates
     */
    get supportsUVs() {
        return this._supportsUVs && this.enableUVMorphing;
    }
    /**
     * Gets the number of targets stored in this manager
     */
    get numTargets() {
        return this._targets.length;
    }
    /**
     * Gets the number of influencers (ie. the number of targets with influences > 0)
     */
    get numInfluencers() {
        return this._activeTargets.length;
    }
    /**
     * Gets the list of influences (one per target)
     */
    get influences() {
        return this._influences;
    }
    /**
     * Gets or sets a boolean indicating that targets should be stored as a texture instead of using vertex attributes (default is true).
     * Please note that this option is not available if the hardware does not support it
     */
    get useTextureToStoreTargets() {
        return this._useTextureToStoreTargets;
    }
    set useTextureToStoreTargets(value) {
        this._useTextureToStoreTargets = value;
    }
    /**
     * Gets a boolean indicating that the targets are stored into a texture (instead of as attributes)
     */
    get isUsingTextureForTargets() {
        return (MorphTargetManager.EnableTextureStorage &&
            this.useTextureToStoreTargets &&
            this._canUseTextureForTargets &&
            !this._scene?.getEngine().getCaps().disableMorphTargetTexture);
    }
    /**
     * Gets the active target at specified index. An active target is a target with an influence > 0
     * @param index defines the index to check
     * @returns the requested target
     */
    getActiveTarget(index) {
        return this._activeTargets.data[index];
    }
    /**
     * Gets the target at specified index
     * @param index defines the index to check
     * @returns the requested target
     */
    getTarget(index) {
        return this._targets[index];
    }
    /**
     * Gets the first target with the specified name
     * @param name defines the name to check
     * @returns the requested target
     */
    getTargetByName(name) {
        for (const target of this._targets) {
            if (target.name === name) {
                return target;
            }
        }
        return null;
    }
    /**
     * Add a new target to this manager
     * @param target defines the target to add
     */
    addTarget(target) {
        this._targets.push(target);
        this._targetInfluenceChangedObservers.push(target.onInfluenceChanged.add((needUpdate) => {
            this._syncActiveTargets(needUpdate);
        }));
        this._targetDataLayoutChangedObservers.push(target._onDataLayoutChanged.add(() => {
            this._syncActiveTargets(true);
        }));
        this._syncActiveTargets(true);
    }
    /**
     * Removes a target from the manager
     * @param target defines the target to remove
     */
    removeTarget(target) {
        const index = this._targets.indexOf(target);
        if (index >= 0) {
            this._targets.splice(index, 1);
            target.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(index, 1)[0]);
            target._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(index, 1)[0]);
            this._syncActiveTargets(true);
        }
        if (this._scene) {
            this._scene.stopAnimation(target);
        }
    }
    /**
     * @internal
     */
    _bind(effect) {
        effect.setFloat3("morphTargetTextureInfo", this._textureVertexStride, this._textureWidth, this._textureHeight);
        effect.setFloatArray("morphTargetTextureIndices", this._morphTargetTextureIndices);
        effect.setTexture("morphTargets", this._targetStoreTexture);
        effect.setInt("morphTargetCount", this.numInfluencers);
    }
    /**
     * Clone the current manager
     * @returns a new MorphTargetManager
     */
    clone() {
        const copy = new MorphTargetManager(this._scene);
        for (const target of this._targets) {
            copy.addTarget(target.clone());
        }
        copy.enableNormalMorphing = this.enableNormalMorphing;
        copy.enableTangentMorphing = this.enableTangentMorphing;
        copy.enableUVMorphing = this.enableUVMorphing;
        return copy;
    }
    /**
     * Serializes the current manager into a Serialization object
     * @returns the serialized object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.id = this.uniqueId;
        serializationObject.targets = [];
        for (const target of this._targets) {
            serializationObject.targets.push(target.serialize());
        }
        return serializationObject;
    }
    _syncActiveTargets(needUpdate) {
        if (this.areUpdatesFrozen) {
            return;
        }
        let influenceCount = 0;
        this._activeTargets.reset();
        this._supportsNormals = true;
        this._supportsTangents = true;
        this._supportsUVs = true;
        this._vertexCount = 0;
        if (this._scene && this._targets.length > this._scene.getEngine().getCaps().texture2DArrayMaxLayerCount) {
            this.useTextureToStoreTargets = false;
        }
        if (!this._morphTargetTextureIndices || this._morphTargetTextureIndices.length !== this._targets.length) {
            this._morphTargetTextureIndices = new Float32Array(this._targets.length);
        }
        let targetIndex = -1;
        for (const target of this._targets) {
            targetIndex++;
            if (target.influence === 0 && this.optimizeInfluencers) {
                continue;
            }
            if (this._activeTargets.length >= MorphTargetManager.MaxActiveMorphTargetsInVertexAttributeMode && !this.isUsingTextureForTargets) {
                break;
            }
            this._activeTargets.push(target);
            this._morphTargetTextureIndices[influenceCount] = targetIndex;
            this._tempInfluences[influenceCount++] = target.influence;
            this._supportsNormals = this._supportsNormals && target.hasNormals;
            this._supportsTangents = this._supportsTangents && target.hasTangents;
            this._supportsUVs = this._supportsUVs && target.hasUVs;
            const positions = target.getPositions();
            if (positions) {
                const vertexCount = positions.length / 3;
                if (this._vertexCount === 0) {
                    this._vertexCount = vertexCount;
                }
                else if (this._vertexCount !== vertexCount) {
                    _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Incompatible target. Targets must all have the same vertices count.");
                    return;
                }
            }
        }
        if (this._morphTargetTextureIndices.length !== influenceCount) {
            this._morphTargetTextureIndices = this._morphTargetTextureIndices.slice(0, influenceCount);
        }
        if (!this._influences || this._influences.length !== influenceCount) {
            this._influences = new Float32Array(influenceCount);
        }
        for (let index = 0; index < influenceCount; index++) {
            this._influences[index] = this._tempInfluences[index];
        }
        if (needUpdate) {
            this.synchronize();
        }
    }
    /**
     * Synchronize the targets with all the meshes using this morph target manager
     */
    synchronize() {
        if (!this._scene || this.areUpdatesFrozen) {
            return;
        }
        if (this.isUsingTextureForTargets && (this._vertexCount || this.numMaxInfluencers > 0)) {
            this._textureVertexStride = 1;
            if (this._supportsNormals) {
                this._textureVertexStride++;
            }
            if (this._supportsTangents) {
                this._textureVertexStride++;
            }
            if (this._supportsUVs) {
                this._textureVertexStride++;
            }
            this._textureWidth = this._vertexCount * this._textureVertexStride || 1;
            this._textureHeight = 1;
            const maxTextureSize = this._scene.getEngine().getCaps().maxTextureSize;
            if (this._textureWidth > maxTextureSize) {
                this._textureHeight = Math.ceil(this._textureWidth / maxTextureSize);
                this._textureWidth = maxTextureSize;
            }
            let mustUpdateTexture = true;
            if (this._targetStoreTexture) {
                const textureSize = this._targetStoreTexture.getSize();
                if (textureSize.width === this._textureWidth && textureSize.height === this._textureHeight && this._targetStoreTexture.depth === this._targets.length) {
                    mustUpdateTexture = false;
                }
            }
            if (mustUpdateTexture) {
                if (this._targetStoreTexture) {
                    this._targetStoreTexture.dispose();
                }
                const targetCount = this._targets.length;
                const data = new Float32Array(targetCount * this._textureWidth * this._textureHeight * 4);
                let offset = 0;
                for (let index = 0; index < targetCount; index++) {
                    const target = this._targets[index];
                    const positions = target.getPositions();
                    const normals = target.getNormals();
                    const uvs = target.getUVs();
                    const tangents = target.getTangents();
                    if (!positions) {
                        if (index === 0) {
                            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_1__/* .Logger */ .V.Error("Invalid morph target. Target must have positions.");
                        }
                        return;
                    }
                    offset = index * this._textureWidth * this._textureHeight * 4;
                    for (let vertex = 0; vertex < this._vertexCount; vertex++) {
                        data[offset] = positions[vertex * 3];
                        data[offset + 1] = positions[vertex * 3 + 1];
                        data[offset + 2] = positions[vertex * 3 + 2];
                        offset += 4;
                        if (this._supportsNormals && normals) {
                            data[offset] = normals[vertex * 3];
                            data[offset + 1] = normals[vertex * 3 + 1];
                            data[offset + 2] = normals[vertex * 3 + 2];
                            offset += 4;
                        }
                        if (this._supportsUVs && uvs) {
                            data[offset] = uvs[vertex * 2];
                            data[offset + 1] = uvs[vertex * 2 + 1];
                            offset += 4;
                        }
                        if (this._supportsTangents && tangents) {
                            data[offset] = tangents[vertex * 3];
                            data[offset + 1] = tangents[vertex * 3 + 1];
                            data[offset + 2] = tangents[vertex * 3 + 2];
                            offset += 4;
                        }
                    }
                }
                this._targetStoreTexture = _Materials_Textures_rawTexture2DArray_js__WEBPACK_IMPORTED_MODULE_4__/* .RawTexture2DArray */ .L.CreateRGBATexture(data, this._textureWidth, this._textureHeight, targetCount, this._scene, false, false, 1, 1);
            }
        }
        // Flag meshes as dirty to resync with the active targets
        for (const mesh of this._scene.meshes) {
            if (mesh.morphTargetManager === this) {
                mesh._syncGeometryWithMorphTargetManager();
            }
        }
    }
    /**
     * Release all resources
     */
    dispose() {
        if (this._targetStoreTexture) {
            this._targetStoreTexture.dispose();
        }
        this._targetStoreTexture = null;
        // Remove from scene
        if (this._scene) {
            this._scene.removeMorphTargetManager(this);
            if (this._parentContainer) {
                const index = this._parentContainer.morphTargetManagers.indexOf(this);
                if (index > -1) {
                    this._parentContainer.morphTargetManagers.splice(index, 1);
                }
                this._parentContainer = null;
            }
            for (const morph of this._targets) {
                this._scene.stopAnimation(morph);
            }
        }
    }
    // Statics
    /**
     * Creates a new MorphTargetManager from serialized data
     * @param serializationObject defines the serialized data
     * @param scene defines the hosting scene
     * @returns the new MorphTargetManager
     */
    static Parse(serializationObject, scene) {
        const result = new MorphTargetManager(scene);
        for (const targetData of serializationObject.targets) {
            result.addTarget(_morphTarget_js__WEBPACK_IMPORTED_MODULE_3__/* .MorphTarget */ .M.Parse(targetData, scene));
        }
        return result;
    }
}
/** Enable storing morph target data into textures when set to true (true by default) */
MorphTargetManager.EnableTextureStorage = true;
/** Maximum number of active morph targets supported in the "vertex attribute" mode (i.e., not the "texture" mode) */
MorphTargetManager.MaxActiveMorphTargetsInVertexAttributeMode = 8;
//# sourceMappingURL=morphTargetManager.js.map

/***/ }),

/***/ 99083:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   M: () => (/* binding */ CloudPoint),
/* harmony export */   x: () => (/* binding */ PointsGroup)
/* harmony export */ });
/* harmony import */ var _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62956);

/**
 * Represents one particle of a points cloud system.
 */
class CloudPoint {
    /**
     * Creates a Point Cloud object.
     * Don't create particles manually, use instead the PCS internal tools like _addParticle()
     * @param particleIndex (integer) is the particle index in the PCS pool. It's also the particle identifier.
     * @param group (PointsGroup) is the group the particle belongs to
     * @param groupId (integer) is the group identifier in the PCS.
     * @param idxInGroup (integer) is the index of the particle in the current point group (ex: the 10th point of addPoints(30))
     * @param pcs defines the PCS it is associated to
     */
    constructor(particleIndex, group, groupId, idxInGroup, pcs) {
        /**
         * particle global index
         */
        this.idx = 0;
        /**
         * The color of the particle
         */
        this.color = new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov(1.0, 1.0, 1.0, 1.0);
        /**
         * The world space position of the particle.
         */
        this.position = _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The world space rotation of the particle. (Not use if rotationQuaternion is set)
         */
        this.rotation = _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The uv of the particle.
         */
        this.uv = new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector2 */ .I9(0.0, 0.0);
        /**
         * The current speed of the particle.
         */
        this.velocity = _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * The pivot point in the particle local space.
         */
        this.pivot = _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        /**
         * Must the particle be translated from its pivot point in its local space ?
         * In this case, the pivot point is set at the origin of the particle local space and the particle is translated.
         * Default : false
         */
        this.translateFromPivot = false;
        /**
         * Index of this particle in the global "positions" array (Internal use)
         * @internal
         */
        this._pos = 0;
        /**
         * @internal Index of this particle in the global "indices" array (Internal use)
         */
        this._ind = 0;
        /**
         * Group id of this particle
         */
        this.groupId = 0;
        /**
         * Index of the particle in its group id (Internal use)
         */
        this.idxInGroup = 0;
        /**
         * @internal Still set as invisible in order to skip useless computations (Internal use)
         */
        this._stillInvisible = false;
        /**
         * @internal Last computed particle rotation matrix
         */
        this._rotationMatrix = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0];
        /**
         * Parent particle Id, if any.
         * Default null.
         */
        this.parentId = null;
        /**
         * @internal Internal global position in the PCS.
         */
        this._globalPosition = _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Vector3 */ .Pq.Zero();
        this.idx = particleIndex;
        this._group = group;
        this.groupId = groupId;
        this.idxInGroup = idxInGroup;
        this._pcs = pcs;
    }
    /**
     * get point size
     */
    get size() {
        return this.size;
    }
    /**
     * Set point size
     */
    set size(scale) {
        this.size = scale;
    }
    /**
     * Legacy support, changed quaternion to rotationQuaternion
     */
    get quaternion() {
        return this.rotationQuaternion;
    }
    /**
     * Legacy support, changed quaternion to rotationQuaternion
     */
    set quaternion(q) {
        this.rotationQuaternion = q;
    }
    /**
     * Returns a boolean. True if the particle intersects a mesh, else false
     * The intersection is computed on the particle position and Axis Aligned Bounding Box (AABB) or Sphere
     * @param target is the object (point or mesh) what the intersection is computed against
     * @param isSphere is boolean flag when false (default) bounding box of mesh is used, when true the bounding sphere is used
     * @returns true if it intersects
     */
    intersectsMesh(target, isSphere) {
        if (!target.hasBoundingInfo) {
            return false;
        }
        if (!this._pcs.mesh) {
            throw new Error("Point Cloud System doesnt contain the Mesh");
        }
        if (isSphere) {
            return target.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));
        }
        const bbox = target.getBoundingInfo().boundingBox;
        const maxX = bbox.maximumWorld.x;
        const minX = bbox.minimumWorld.x;
        const maxY = bbox.maximumWorld.y;
        const minY = bbox.minimumWorld.y;
        const maxZ = bbox.maximumWorld.z;
        const minZ = bbox.minimumWorld.z;
        const x = this.position.x + this._pcs.mesh.position.x;
        const y = this.position.y + this._pcs.mesh.position.y;
        const z = this.position.z + this._pcs.mesh.position.z;
        return minX <= x && x <= maxX && minY <= y && y <= maxY && minZ <= z && z <= maxZ;
    }
    /**
     * get the rotation matrix of the particle
     * @internal
     */
    getRotationMatrix(m) {
        let quaternion;
        if (this.rotationQuaternion) {
            quaternion = this.rotationQuaternion;
        }
        else {
            quaternion = _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .TmpVectors */ .AA.Quaternion[0];
            const rotation = this.rotation;
            _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Quaternion */ .PT.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);
        }
        quaternion.toRotationMatrix(m);
    }
}
/**
 * Represents a group of points in a points cloud system
 *  * PCS internal tool, don't use it manually.
 */
class PointsGroup {
    /**
     * Get or set the groupId
     * @deprecated Please use groupId instead
     */
    get groupID() {
        return this.groupId;
    }
    set groupID(groupID) {
        this.groupId = groupID;
    }
    /**
     * Creates a points group object. This is an internal reference to produce particles for the PCS.
     * PCS internal tool, don't use it manually.
     * @internal
     */
    constructor(id, posFunction) {
        this.groupId = id;
        this._positionFunction = posFunction;
    }
}
//# sourceMappingURL=cloudPoint.js.map

/***/ }),

/***/ 13833:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   q: () => (/* binding */ PointColor),
/* harmony export */   y: () => (/* binding */ PointsCloudSystem)
/* harmony export */ });
/* harmony import */ var _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62956);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51137);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95616);
/* harmony import */ var _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(36803);
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(76595);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6315);
/* harmony import */ var _cloudPoint_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(99083);
/* harmony import */ var _Culling_ray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(86919);
/* harmony import */ var _Materials_standardMaterial_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2093);
/* harmony import */ var _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(56526);
/* harmony import */ var _Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(84867);












/** Defines the 4 color options */
var PointColor;
(function (PointColor) {
    /** color value */
    PointColor[PointColor["Color"] = 2] = "Color";
    /** uv value */
    PointColor[PointColor["UV"] = 1] = "UV";
    /** random value */
    PointColor[PointColor["Random"] = 0] = "Random";
    /** stated value */
    PointColor[PointColor["Stated"] = 3] = "Stated";
})(PointColor || (PointColor = {}));
/**
 * The PointCloudSystem (PCS) is a single updatable mesh. The points corresponding to the vertices of this big mesh.
 * As it is just a mesh, the PointCloudSystem has all the same properties as any other BJS mesh : not more, not less. It can be scaled, rotated, translated, enlighted, textured, moved, etc.

 * The PointCloudSystem is also a particle system, with each point being a particle. It provides some methods to manage the particles.
 * However it is behavior agnostic. This means it has no emitter, no particle physics, no particle recycler. You have to implement your own behavior.
 *
 * Full documentation here : TO BE ENTERED
 */
class PointsCloudSystem {
    /**
     * Gets the particle positions computed by the Point Cloud System
     */
    get positions() {
        return this._positions32;
    }
    /**
     * Gets the particle colors computed by the Point Cloud System
     */
    get colors() {
        return this._colors32;
    }
    /**
     * Gets the particle uvs computed by the Point Cloud System
     */
    get uvs() {
        return this._uvs32;
    }
    /**
     * Creates a PCS (Points Cloud System) object
     * @param name (String) is the PCS name, this will be the underlying mesh name
     * @param pointSize (number) is the size for each point. Has no effect on a WebGPU engine.
     * @param scene (Scene) is the scene in which the PCS is added
     * @param options defines the options of the PCS e.g.
     * * updatable (optional boolean, default true) : if the PCS must be updatable or immutable
     */
    constructor(name, pointSize, scene, options) {
        /**
         *  The PCS array of cloud point objects. Just access each particle as with any classic array.
         *  Example : var p = SPS.particles[i];
         */
        this.particles = new Array();
        /**
         * The PCS total number of particles. Read only. Use PCS.counter instead if you need to set your own value.
         */
        this.nbParticles = 0;
        /**
         * This a counter for your own usage. It's not set by any SPS functions.
         */
        this.counter = 0;
        /**
         * This empty object is intended to store some PCS specific or temporary values in order to lower the Garbage Collector activity.
         * Please read :
         */
        this.vars = {};
        this._promises = [];
        this._positions = new Array();
        this._indices = new Array();
        this._normals = new Array();
        this._colors = new Array();
        this._uvs = new Array();
        this._updatable = true;
        this._isVisibilityBoxLocked = false;
        this._alwaysVisible = false;
        this._groups = new Array(); //start indices for each group of particles
        this._groupCounter = 0;
        this._computeParticleColor = true;
        this._computeParticleTexture = true;
        this._computeParticleRotation = true;
        this._computeBoundingBox = false;
        this._isReady = false;
        this.name = name;
        this._size = pointSize;
        this._scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_6__/* .EngineStore */ .q.LastCreatedScene;
        if (options && options.updatable !== undefined) {
            this._updatable = options.updatable;
        }
        else {
            this._updatable = true;
        }
    }
    /**
     * Builds the PCS underlying mesh. Returns a standard Mesh.
     * If no points were added to the PCS, the returned mesh is just a single point.
     * @param material The material to use to render the mesh. If not provided, will create a default one
     * @returns a promise for the created mesh
     */
    buildMeshAsync(material) {
        return Promise.all(this._promises).then(() => {
            this._isReady = true;
            return this._buildMesh(material);
        });
    }
    /**
     * @internal
     */
    _buildMesh(material) {
        if (this.nbParticles === 0) {
            this.addPoints(1);
        }
        this._positions32 = new Float32Array(this._positions);
        this._uvs32 = new Float32Array(this._uvs);
        this._colors32 = new Float32Array(this._colors);
        const vertexData = new _Meshes_mesh_vertexData_js__WEBPACK_IMPORTED_MODULE_4__/* .VertexData */ .P();
        vertexData.set(this._positions32, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind);
        if (this._uvs32.length > 0) {
            vertexData.set(this._uvs32, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind);
        }
        let ec = 0; //emissive color value 0 for UVs, 1 for color
        if (this._colors32.length > 0) {
            ec = 1;
            vertexData.set(this._colors32, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind);
        }
        const mesh = new _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_5__/* .Mesh */ .e(this.name, this._scene);
        vertexData.applyToMesh(mesh, this._updatable);
        this.mesh = mesh;
        // free memory
        this._positions = null;
        this._uvs = null;
        this._colors = null;
        if (!this._updatable) {
            this.particles.length = 0;
        }
        let mat = material;
        if (!mat) {
            mat = new _Materials_standardMaterial_js__WEBPACK_IMPORTED_MODULE_9__/* .StandardMaterial */ .F("point cloud material", this._scene);
            mat.emissiveColor = new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color3 */ .v9(ec, ec, ec);
            mat.disableLighting = true;
            mat.pointsCloud = true;
            mat.pointSize = this._size;
        }
        mesh.material = mat;
        return new Promise((resolve) => resolve(mesh));
    }
    // adds a new particle object in the particles array
    _addParticle(idx, group, groupId, idxInGroup) {
        const cp = new _cloudPoint_js__WEBPACK_IMPORTED_MODULE_7__/* .CloudPoint */ .M(idx, group, groupId, idxInGroup, this);
        this.particles.push(cp);
        return cp;
    }
    _randomUnitVector(particle) {
        particle.position = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(Math.random(), Math.random(), Math.random());
        particle.color = new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov(1, 1, 1, 1);
    }
    _getColorIndicesForCoord(pointsGroup, x, y, width) {
        const imageData = pointsGroup._groupImageData;
        const color = y * (width * 4) + x * 4;
        const colorIndices = [color, color + 1, color + 2, color + 3];
        const redIndex = colorIndices[0];
        const greenIndex = colorIndices[1];
        const blueIndex = colorIndices[2];
        const alphaIndex = colorIndices[3];
        const redForCoord = imageData[redIndex];
        const greenForCoord = imageData[greenIndex];
        const blueForCoord = imageData[blueIndex];
        const alphaForCoord = imageData[alphaIndex];
        return new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov(redForCoord / 255, greenForCoord / 255, blueForCoord / 255, alphaForCoord);
    }
    _setPointsColorOrUV(mesh, pointsGroup, isVolume, colorFromTexture, hasTexture, color, range, uvSetIndex) {
        uvSetIndex = uvSetIndex ?? 0;
        if (isVolume) {
            mesh.updateFacetData();
        }
        const boundInfo = mesh.getBoundingInfo();
        const diameter = 2 * boundInfo.boundingSphere.radius;
        let meshPos = mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind);
        const meshInd = mesh.getIndices();
        const meshUV = mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind + (uvSetIndex ? uvSetIndex + 1 : ""));
        const meshCol = mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind);
        const place = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        mesh.computeWorldMatrix();
        const meshMatrix = mesh.getWorldMatrix();
        if (!meshMatrix.isIdentity()) {
            meshPos = meshPos.slice(0);
            for (let p = 0; p < meshPos.length / 3; p++) {
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.TransformCoordinatesFromFloatsToRef(meshPos[3 * p], meshPos[3 * p + 1], meshPos[3 * p + 2], meshMatrix, place);
                meshPos[3 * p] = place.x;
                meshPos[3 * p + 1] = place.y;
                meshPos[3 * p + 2] = place.z;
            }
        }
        let idxPoints = 0;
        let id0 = 0;
        let id1 = 0;
        let id2 = 0;
        let v0X = 0;
        let v0Y = 0;
        let v0Z = 0;
        let v1X = 0;
        let v1Y = 0;
        let v1Z = 0;
        let v2X = 0;
        let v2Y = 0;
        let v2Z = 0;
        const vertex0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        const vertex1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        const vertex2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        const vec0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        const vec1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        let uv0X = 0;
        let uv0Y = 0;
        let uv1X = 0;
        let uv1Y = 0;
        let uv2X = 0;
        let uv2Y = 0;
        const uv0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9.Zero();
        const uv1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9.Zero();
        const uv2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9.Zero();
        const uvec0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9.Zero();
        const uvec1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector2 */ .I9.Zero();
        let col0X = 0;
        let col0Y = 0;
        let col0Z = 0;
        let col0A = 0;
        let col1X = 0;
        let col1Y = 0;
        let col1Z = 0;
        let col1A = 0;
        let col2X = 0;
        let col2Y = 0;
        let col2Z = 0;
        let col2A = 0;
        const col0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU.Zero();
        const col1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU.Zero();
        const col2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU.Zero();
        const colvec0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU.Zero();
        const colvec1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU.Zero();
        let lamda = 0;
        let mu = 0;
        range = range ? range : 0;
        let facetPoint;
        let uvPoint;
        let colPoint = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector4 */ .IU(0, 0, 0, 0);
        let norm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        let tang = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        let biNorm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        let angle = 0;
        let facetPlaneVec = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        let gap = 0;
        let distance = 0;
        const ray = new _Culling_ray_js__WEBPACK_IMPORTED_MODULE_8__/* .Ray */ .Rl(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero(), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(1, 0, 0));
        let pickInfo;
        let direction = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        for (let index = 0; index < meshInd.length / 3; index++) {
            id0 = meshInd[3 * index];
            id1 = meshInd[3 * index + 1];
            id2 = meshInd[3 * index + 2];
            v0X = meshPos[3 * id0];
            v0Y = meshPos[3 * id0 + 1];
            v0Z = meshPos[3 * id0 + 2];
            v1X = meshPos[3 * id1];
            v1Y = meshPos[3 * id1 + 1];
            v1Z = meshPos[3 * id1 + 2];
            v2X = meshPos[3 * id2];
            v2Y = meshPos[3 * id2 + 1];
            v2Z = meshPos[3 * id2 + 2];
            vertex0.set(v0X, v0Y, v0Z);
            vertex1.set(v1X, v1Y, v1Z);
            vertex2.set(v2X, v2Y, v2Z);
            vertex1.subtractToRef(vertex0, vec0);
            vertex2.subtractToRef(vertex1, vec1);
            if (meshUV) {
                uv0X = meshUV[2 * id0];
                uv0Y = meshUV[2 * id0 + 1];
                uv1X = meshUV[2 * id1];
                uv1Y = meshUV[2 * id1 + 1];
                uv2X = meshUV[2 * id2];
                uv2Y = meshUV[2 * id2 + 1];
                uv0.set(uv0X, uv0Y);
                uv1.set(uv1X, uv1Y);
                uv2.set(uv2X, uv2Y);
                uv1.subtractToRef(uv0, uvec0);
                uv2.subtractToRef(uv1, uvec1);
            }
            if (meshCol && colorFromTexture) {
                col0X = meshCol[4 * id0];
                col0Y = meshCol[4 * id0 + 1];
                col0Z = meshCol[4 * id0 + 2];
                col0A = meshCol[4 * id0 + 3];
                col1X = meshCol[4 * id1];
                col1Y = meshCol[4 * id1 + 1];
                col1Z = meshCol[4 * id1 + 2];
                col1A = meshCol[4 * id1 + 3];
                col2X = meshCol[4 * id2];
                col2Y = meshCol[4 * id2 + 1];
                col2Z = meshCol[4 * id2 + 2];
                col2A = meshCol[4 * id2 + 3];
                col0.set(col0X, col0Y, col0Z, col0A);
                col1.set(col1X, col1Y, col1Z, col1A);
                col2.set(col2X, col2Y, col2Z, col2A);
                col1.subtractToRef(col0, colvec0);
                col2.subtractToRef(col1, colvec1);
            }
            let width;
            let height;
            let deltaS;
            let deltaV;
            let h;
            let s;
            let v;
            let hsvCol;
            const statedColor = new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color3 */ .v9(0, 0, 0);
            const colPoint3 = new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color3 */ .v9(0, 0, 0);
            let pointColors;
            let particle;
            for (let i = 0; i < pointsGroup._groupDensity[index]; i++) {
                idxPoints = this.particles.length;
                this._addParticle(idxPoints, pointsGroup, this._groupCounter, index + i);
                particle = this.particles[idxPoints];
                //form a point inside the facet v0, v1, v2;
                lamda = Math.sqrt((0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_11__.RandomRange)(0, 1));
                mu = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_11__.RandomRange)(0, 1);
                facetPoint = vertex0.add(vec0.scale(lamda)).add(vec1.scale(lamda * mu));
                if (isVolume) {
                    norm = mesh.getFacetNormal(index).normalize().scale(-1);
                    tang = vec0.clone().normalize();
                    biNorm = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Cross(norm, tang);
                    angle = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_11__.RandomRange)(0, 2 * Math.PI);
                    facetPlaneVec = tang.scale(Math.cos(angle)).add(biNorm.scale(Math.sin(angle)));
                    angle = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_11__.RandomRange)(0.1, Math.PI / 2);
                    direction = facetPlaneVec.scale(Math.cos(angle)).add(norm.scale(Math.sin(angle)));
                    ray.origin = facetPoint.add(direction.scale(0.00001));
                    ray.direction = direction;
                    ray.length = diameter;
                    pickInfo = ray.intersectsMesh(mesh);
                    if (pickInfo.hit) {
                        distance = pickInfo.pickedPoint.subtract(facetPoint).length();
                        gap = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_11__.RandomRange)(0, 1) * distance;
                        facetPoint.addInPlace(direction.scale(gap));
                    }
                }
                particle.position = facetPoint.clone();
                this._positions.push(particle.position.x, particle.position.y, particle.position.z);
                if (colorFromTexture !== undefined) {
                    if (meshUV) {
                        uvPoint = uv0.add(uvec0.scale(lamda)).add(uvec1.scale(lamda * mu));
                        if (colorFromTexture) {
                            //Set particle color to texture color
                            if (hasTexture && pointsGroup._groupImageData !== null) {
                                width = pointsGroup._groupImgWidth;
                                height = pointsGroup._groupImgHeight;
                                pointColors = this._getColorIndicesForCoord(pointsGroup, Math.round(uvPoint.x * width), Math.round(uvPoint.y * height), width);
                                particle.color = pointColors;
                                this._colors.push(pointColors.r, pointColors.g, pointColors.b, pointColors.a);
                            }
                            else {
                                if (meshCol) {
                                    //failure in texture and colors available
                                    colPoint = col0.add(colvec0.scale(lamda)).add(colvec1.scale(lamda * mu));
                                    particle.color = new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov(colPoint.x, colPoint.y, colPoint.z, colPoint.w);
                                    this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w);
                                }
                                else {
                                    colPoint = col0.set(Math.random(), Math.random(), Math.random(), 1);
                                    particle.color = new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov(colPoint.x, colPoint.y, colPoint.z, colPoint.w);
                                    this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w);
                                }
                            }
                        }
                        else {
                            //Set particle uv based on a mesh uv
                            particle.uv = uvPoint.clone();
                            this._uvs.push(particle.uv.x, particle.uv.y);
                        }
                    }
                }
                else {
                    if (color) {
                        statedColor.set(color.r, color.g, color.b);
                        deltaS = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_11__.RandomRange)(-range, range);
                        deltaV = (0,_Maths_math_scalar_functions_js__WEBPACK_IMPORTED_MODULE_11__.RandomRange)(-range, range);
                        hsvCol = statedColor.toHSV();
                        h = hsvCol.r;
                        s = hsvCol.g + deltaS;
                        v = hsvCol.b + deltaV;
                        if (s < 0) {
                            s = 0;
                        }
                        if (s > 1) {
                            s = 1;
                        }
                        if (v < 0) {
                            v = 0;
                        }
                        if (v > 1) {
                            v = 1;
                        }
                        _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color3 */ .v9.HSVtoRGBToRef(h, s, v, colPoint3);
                        colPoint.set(colPoint3.r, colPoint3.g, colPoint3.b, 1);
                    }
                    else {
                        colPoint = col0.set(Math.random(), Math.random(), Math.random(), 1);
                    }
                    particle.color = new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov(colPoint.x, colPoint.y, colPoint.z, colPoint.w);
                    this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w);
                }
            }
        }
    }
    // stores mesh texture in dynamic texture for color pixel retrieval
    // when pointColor type is color for surface points
    _colorFromTexture(mesh, pointsGroup, isVolume) {
        if (mesh.material === null) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Warn(mesh.name + "has no material.");
            pointsGroup._groupImageData = null;
            this._setPointsColorOrUV(mesh, pointsGroup, isVolume, true, false);
            return;
        }
        const mat = mesh.material;
        const textureList = mat.getActiveTextures();
        if (textureList.length === 0) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_2__/* .Logger */ .V.Warn(mesh.name + "has no usable texture.");
            pointsGroup._groupImageData = null;
            this._setPointsColorOrUV(mesh, pointsGroup, isVolume, true, false);
            return;
        }
        const clone = mesh.clone();
        clone.setEnabled(false);
        this._promises.push(new Promise((resolve) => {
            _Materials_Textures_baseTexture_js__WEBPACK_IMPORTED_MODULE_10__/* .BaseTexture */ .t.WhenAllReady(textureList, () => {
                let n = pointsGroup._textureNb;
                if (n < 0) {
                    n = 0;
                }
                if (n > textureList.length - 1) {
                    n = textureList.length - 1;
                }
                const finalize = () => {
                    pointsGroup._groupImgWidth = textureList[n].getSize().width;
                    pointsGroup._groupImgHeight = textureList[n].getSize().height;
                    this._setPointsColorOrUV(clone, pointsGroup, isVolume, true, true, undefined, undefined, textureList[n].coordinatesIndex);
                    clone.dispose();
                    resolve();
                };
                pointsGroup._groupImageData = null;
                const dataPromise = textureList[n].readPixels();
                if (!dataPromise) {
                    finalize();
                }
                else {
                    dataPromise.then((data) => {
                        pointsGroup._groupImageData = data;
                        finalize();
                    });
                }
            });
        }));
    }
    // calculates the point density per facet of a mesh for surface points
    _calculateDensity(nbPoints, positions, indices) {
        let id0;
        let id1;
        let id2;
        let v0X;
        let v0Y;
        let v0Z;
        let v1X;
        let v1Y;
        let v1Z;
        let v2X;
        let v2Y;
        let v2Z;
        const vertex0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        const vertex1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        const vertex2 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        const vec0 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        const vec1 = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        const normal = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
        let area;
        const cumulativeAreas = [];
        let surfaceArea = 0;
        const nbFacets = indices.length / 3;
        //surface area
        for (let index = 0; index < nbFacets; index++) {
            id0 = indices[3 * index];
            id1 = indices[3 * index + 1];
            id2 = indices[3 * index + 2];
            v0X = positions[3 * id0];
            v0Y = positions[3 * id0 + 1];
            v0Z = positions[3 * id0 + 2];
            v1X = positions[3 * id1];
            v1Y = positions[3 * id1 + 1];
            v1Z = positions[3 * id1 + 2];
            v2X = positions[3 * id2];
            v2Y = positions[3 * id2 + 1];
            v2Z = positions[3 * id2 + 2];
            vertex0.set(v0X, v0Y, v0Z);
            vertex1.set(v1X, v1Y, v1Z);
            vertex2.set(v2X, v2Y, v2Z);
            vertex1.subtractToRef(vertex0, vec0);
            vertex2.subtractToRef(vertex1, vec1);
            _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CrossToRef(vec0, vec1, normal);
            area = 0.5 * normal.length();
            surfaceArea += area;
            cumulativeAreas[index] = surfaceArea;
        }
        const density = new Array(nbFacets);
        let remainingPoints = nbPoints;
        for (let index = nbFacets - 1; index > 0; index--) {
            const cumulativeArea = cumulativeAreas[index];
            if (cumulativeArea === 0) {
                // avoiding division by 0 upon degenerate triangles
                density[index] = 0;
            }
            else {
                const area = cumulativeArea - cumulativeAreas[index - 1];
                const facetPointsWithFraction = (area / cumulativeArea) * remainingPoints;
                const floored = Math.floor(facetPointsWithFraction);
                const fraction = facetPointsWithFraction - floored;
                const extraPoint = Number(Math.random() < fraction);
                const facetPoints = floored + extraPoint;
                density[index] = facetPoints;
                remainingPoints -= facetPoints;
            }
        }
        density[0] = remainingPoints;
        return density;
    }
    /**
     * Adds points to the PCS in random positions within a unit sphere
     * @param nb (positive integer) the number of particles to be created from this model
     * @param pointFunction is an optional javascript function to be called for each particle on PCS creation
     * @returns the number of groups in the system
     */
    addPoints(nb, pointFunction = this._randomUnitVector) {
        const pointsGroup = new _cloudPoint_js__WEBPACK_IMPORTED_MODULE_7__/* .PointsGroup */ .x(this._groupCounter, pointFunction);
        let cp;
        // particles
        let idx = this.nbParticles;
        for (let i = 0; i < nb; i++) {
            cp = this._addParticle(idx, pointsGroup, this._groupCounter, i);
            if (pointsGroup && pointsGroup._positionFunction) {
                pointsGroup._positionFunction(cp, idx, i);
            }
            this._positions.push(cp.position.x, cp.position.y, cp.position.z);
            if (cp.color) {
                this._colors.push(cp.color.r, cp.color.g, cp.color.b, cp.color.a);
            }
            if (cp.uv) {
                this._uvs.push(cp.uv.x, cp.uv.y);
            }
            idx++;
        }
        this.nbParticles += nb;
        this._groupCounter++;
        return this._groupCounter;
    }
    /**
     * Adds points to the PCS from the surface of the model shape
     * @param mesh is any Mesh object that will be used as a surface model for the points
     * @param nb (positive integer) the number of particles to be created from this model
     * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible)
     * @param color (color4) to be used when colorWith is stated or color (number) when used to specify texture position
     * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color
     * @returns the number of groups in the system
     */
    addSurfacePoints(mesh, nb, colorWith, color, range) {
        let colored = colorWith ? colorWith : 0 /* PointColor.Random */;
        if (isNaN(colored) || colored < 0 || colored > 3) {
            colored = 0 /* PointColor.Random */;
        }
        const meshPos = mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind);
        const meshInd = mesh.getIndices();
        this._groups.push(this._groupCounter);
        const pointsGroup = new _cloudPoint_js__WEBPACK_IMPORTED_MODULE_7__/* .PointsGroup */ .x(this._groupCounter, null);
        pointsGroup._groupDensity = this._calculateDensity(nb, meshPos, meshInd);
        if (colored === 2 /* PointColor.Color */) {
            pointsGroup._textureNb = color ? color : 0;
        }
        else {
            color = color ? color : new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov(1, 1, 1, 1);
        }
        switch (colored) {
            case 2 /* PointColor.Color */:
                this._colorFromTexture(mesh, pointsGroup, false);
                break;
            case 1 /* PointColor.UV */:
                this._setPointsColorOrUV(mesh, pointsGroup, false, false, false);
                break;
            case 0 /* PointColor.Random */:
                this._setPointsColorOrUV(mesh, pointsGroup, false);
                break;
            case 3 /* PointColor.Stated */:
                this._setPointsColorOrUV(mesh, pointsGroup, false, undefined, undefined, color, range);
                break;
        }
        this.nbParticles += nb;
        this._groupCounter++;
        return this._groupCounter - 1;
    }
    /**
     * Adds points to the PCS inside the model shape
     * @param mesh is any Mesh object that will be used as a surface model for the points
     * @param nb (positive integer) the number of particles to be created from this model
     * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible)
     * @param color (color4) to be used when colorWith is stated or color (number) when used to specify texture position
     * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color
     * @returns the number of groups in the system
     */
    addVolumePoints(mesh, nb, colorWith, color, range) {
        let colored = colorWith ? colorWith : 0 /* PointColor.Random */;
        if (isNaN(colored) || colored < 0 || colored > 3) {
            colored = 0 /* PointColor.Random */;
        }
        const meshPos = mesh.getVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind);
        const meshInd = mesh.getIndices();
        this._groups.push(this._groupCounter);
        const pointsGroup = new _cloudPoint_js__WEBPACK_IMPORTED_MODULE_7__/* .PointsGroup */ .x(this._groupCounter, null);
        pointsGroup._groupDensity = this._calculateDensity(nb, meshPos, meshInd);
        if (colored === 2 /* PointColor.Color */) {
            pointsGroup._textureNb = color ? color : 0;
        }
        else {
            color = color ? color : new _Maths_math_js__WEBPACK_IMPORTED_MODULE_0__/* .Color4 */ .ov(1, 1, 1, 1);
        }
        switch (colored) {
            case 2 /* PointColor.Color */:
                this._colorFromTexture(mesh, pointsGroup, true);
                break;
            case 1 /* PointColor.UV */:
                this._setPointsColorOrUV(mesh, pointsGroup, true, false, false);
                break;
            case 0 /* PointColor.Random */:
                this._setPointsColorOrUV(mesh, pointsGroup, true);
                break;
            case 3 /* PointColor.Stated */:
                this._setPointsColorOrUV(mesh, pointsGroup, true, undefined, undefined, color, range);
                break;
        }
        this.nbParticles += nb;
        this._groupCounter++;
        return this._groupCounter - 1;
    }
    /**
     *  Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc.
     *  This method calls `updateParticle()` for each particle of the SPS.
     *  For an animated SPS, it is usually called within the render loop.
     * @param start The particle index in the particle array where to start to compute the particle property values _(default 0)_
     * @param end The particle index in the particle array where to stop to compute the particle property values _(default nbParticle - 1)_
     * @param update If the mesh must be finally updated on this call after all the particle computations _(default true)_
     * @returns the PCS.
     */
    setParticles(start = 0, end = this.nbParticles - 1, update = true) {
        if (!this._updatable || !this._isReady) {
            return this;
        }
        // custom beforeUpdate
        this.beforeUpdateParticles(start, end, update);
        const rotMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Matrix[0];
        const mesh = this.mesh;
        const colors32 = this._colors32;
        const positions32 = this._positions32;
        const uvs32 = this._uvs32;
        const tempVectors = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .TmpVectors */ .AA.Vector3;
        const camAxisX = tempVectors[5].copyFromFloats(1.0, 0.0, 0.0);
        const camAxisY = tempVectors[6].copyFromFloats(0.0, 1.0, 0.0);
        const camAxisZ = tempVectors[7].copyFromFloats(0.0, 0.0, 1.0);
        const minimum = tempVectors[8].setAll(Number.MAX_VALUE);
        const maximum = tempVectors[9].setAll(-Number.MAX_VALUE);
        _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.IdentityToRef(rotMatrix);
        let idx = 0; // current index of the particle
        if (this.mesh?.isFacetDataEnabled) {
            this._computeBoundingBox = true;
        }
        end = end >= this.nbParticles ? this.nbParticles - 1 : end;
        if (this._computeBoundingBox) {
            if (start != 0 || end != this.nbParticles - 1) {
                // only some particles are updated, then use the current existing BBox basis. Note : it can only increase.
                const boundingInfo = this.mesh?.getBoundingInfo();
                if (boundingInfo) {
                    minimum.copyFrom(boundingInfo.minimum);
                    maximum.copyFrom(boundingInfo.maximum);
                }
            }
        }
        idx = 0; // particle index
        let pindex = 0; //index in positions array
        let cindex = 0; //index in color array
        let uindex = 0; //index in uv array
        // particle loop
        for (let p = start; p <= end; p++) {
            const particle = this.particles[p];
            idx = particle.idx;
            pindex = 3 * idx;
            cindex = 4 * idx;
            uindex = 2 * idx;
            // call to custom user function to update the particle properties
            this.updateParticle(particle);
            const particleRotationMatrix = particle._rotationMatrix;
            const particlePosition = particle.position;
            const particleGlobalPosition = particle._globalPosition;
            if (this._computeParticleRotation) {
                particle.getRotationMatrix(rotMatrix);
            }
            const particleHasParent = particle.parentId !== null;
            if (particleHasParent) {
                const parent = this.particles[particle.parentId];
                const parentRotationMatrix = parent._rotationMatrix;
                const parentGlobalPosition = parent._globalPosition;
                const rotatedY = particlePosition.x * parentRotationMatrix[1] + particlePosition.y * parentRotationMatrix[4] + particlePosition.z * parentRotationMatrix[7];
                const rotatedX = particlePosition.x * parentRotationMatrix[0] + particlePosition.y * parentRotationMatrix[3] + particlePosition.z * parentRotationMatrix[6];
                const rotatedZ = particlePosition.x * parentRotationMatrix[2] + particlePosition.y * parentRotationMatrix[5] + particlePosition.z * parentRotationMatrix[8];
                particleGlobalPosition.x = parentGlobalPosition.x + rotatedX;
                particleGlobalPosition.y = parentGlobalPosition.y + rotatedY;
                particleGlobalPosition.z = parentGlobalPosition.z + rotatedZ;
                if (this._computeParticleRotation) {
                    const rotMatrixValues = rotMatrix.m;
                    particleRotationMatrix[0] =
                        rotMatrixValues[0] * parentRotationMatrix[0] + rotMatrixValues[1] * parentRotationMatrix[3] + rotMatrixValues[2] * parentRotationMatrix[6];
                    particleRotationMatrix[1] =
                        rotMatrixValues[0] * parentRotationMatrix[1] + rotMatrixValues[1] * parentRotationMatrix[4] + rotMatrixValues[2] * parentRotationMatrix[7];
                    particleRotationMatrix[2] =
                        rotMatrixValues[0] * parentRotationMatrix[2] + rotMatrixValues[1] * parentRotationMatrix[5] + rotMatrixValues[2] * parentRotationMatrix[8];
                    particleRotationMatrix[3] =
                        rotMatrixValues[4] * parentRotationMatrix[0] + rotMatrixValues[5] * parentRotationMatrix[3] + rotMatrixValues[6] * parentRotationMatrix[6];
                    particleRotationMatrix[4] =
                        rotMatrixValues[4] * parentRotationMatrix[1] + rotMatrixValues[5] * parentRotationMatrix[4] + rotMatrixValues[6] * parentRotationMatrix[7];
                    particleRotationMatrix[5] =
                        rotMatrixValues[4] * parentRotationMatrix[2] + rotMatrixValues[5] * parentRotationMatrix[5] + rotMatrixValues[6] * parentRotationMatrix[8];
                    particleRotationMatrix[6] =
                        rotMatrixValues[8] * parentRotationMatrix[0] + rotMatrixValues[9] * parentRotationMatrix[3] + rotMatrixValues[10] * parentRotationMatrix[6];
                    particleRotationMatrix[7] =
                        rotMatrixValues[8] * parentRotationMatrix[1] + rotMatrixValues[9] * parentRotationMatrix[4] + rotMatrixValues[10] * parentRotationMatrix[7];
                    particleRotationMatrix[8] =
                        rotMatrixValues[8] * parentRotationMatrix[2] + rotMatrixValues[9] * parentRotationMatrix[5] + rotMatrixValues[10] * parentRotationMatrix[8];
                }
            }
            else {
                particleGlobalPosition.x = 0;
                particleGlobalPosition.y = 0;
                particleGlobalPosition.z = 0;
                if (this._computeParticleRotation) {
                    const rotMatrixValues = rotMatrix.m;
                    particleRotationMatrix[0] = rotMatrixValues[0];
                    particleRotationMatrix[1] = rotMatrixValues[1];
                    particleRotationMatrix[2] = rotMatrixValues[2];
                    particleRotationMatrix[3] = rotMatrixValues[4];
                    particleRotationMatrix[4] = rotMatrixValues[5];
                    particleRotationMatrix[5] = rotMatrixValues[6];
                    particleRotationMatrix[6] = rotMatrixValues[8];
                    particleRotationMatrix[7] = rotMatrixValues[9];
                    particleRotationMatrix[8] = rotMatrixValues[10];
                }
            }
            const pivotBackTranslation = tempVectors[11];
            if (particle.translateFromPivot) {
                pivotBackTranslation.setAll(0.0);
            }
            else {
                pivotBackTranslation.copyFrom(particle.pivot);
            }
            // positions
            const tmpVertex = tempVectors[0];
            tmpVertex.copyFrom(particle.position);
            const vertexX = tmpVertex.x - particle.pivot.x;
            const vertexY = tmpVertex.y - particle.pivot.y;
            const vertexZ = tmpVertex.z - particle.pivot.z;
            let rotatedX = vertexX * particleRotationMatrix[0] + vertexY * particleRotationMatrix[3] + vertexZ * particleRotationMatrix[6];
            let rotatedY = vertexX * particleRotationMatrix[1] + vertexY * particleRotationMatrix[4] + vertexZ * particleRotationMatrix[7];
            let rotatedZ = vertexX * particleRotationMatrix[2] + vertexY * particleRotationMatrix[5] + vertexZ * particleRotationMatrix[8];
            rotatedX += pivotBackTranslation.x;
            rotatedY += pivotBackTranslation.y;
            rotatedZ += pivotBackTranslation.z;
            const px = (positions32[pindex] = particleGlobalPosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ);
            const py = (positions32[pindex + 1] = particleGlobalPosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ);
            const pz = (positions32[pindex + 2] = particleGlobalPosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ);
            if (this._computeBoundingBox) {
                minimum.minimizeInPlaceFromFloats(px, py, pz);
                maximum.maximizeInPlaceFromFloats(px, py, pz);
            }
            if (this._computeParticleColor && particle.color) {
                const color = particle.color;
                const colors32 = this._colors32;
                colors32[cindex] = color.r;
                colors32[cindex + 1] = color.g;
                colors32[cindex + 2] = color.b;
                colors32[cindex + 3] = color.a;
            }
            if (this._computeParticleTexture && particle.uv) {
                const uv = particle.uv;
                const uvs32 = this._uvs32;
                uvs32[uindex] = uv.x;
                uvs32[uindex + 1] = uv.y;
            }
        }
        // if the VBO must be updated
        if (mesh) {
            if (update) {
                if (this._computeParticleColor) {
                    mesh.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.ColorKind, colors32, false, false);
                }
                if (this._computeParticleTexture) {
                    mesh.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.UVKind, uvs32, false, false);
                }
                mesh.updateVerticesData(_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_3__/* .VertexBuffer */ .R.PositionKind, positions32, false, false);
            }
            if (this._computeBoundingBox) {
                if (mesh.hasBoundingInfo) {
                    mesh.getBoundingInfo().reConstruct(minimum, maximum, mesh._worldMatrix);
                }
                else {
                    mesh.buildBoundingInfo(minimum, maximum, mesh._worldMatrix);
                }
            }
        }
        this.afterUpdateParticles(start, end, update);
        return this;
    }
    /**
     * Disposes the PCS.
     */
    dispose() {
        this.mesh?.dispose();
        this.vars = null;
        // drop references to internal big arrays for the GC
        this._positions = null;
        this._indices = null;
        this._normals = null;
        this._uvs = null;
        this._colors = null;
        this._indices32 = null;
        this._positions32 = null;
        this._uvs32 = null;
        this._colors32 = null;
    }
    /**
     * Visibility helper : Recomputes the visible size according to the mesh bounding box
     * doc :
     * @returns the PCS.
     */
    refreshVisibleSize() {
        if (!this._isVisibilityBoxLocked) {
            this.mesh?.refreshBoundingInfo();
        }
        return this;
    }
    /**
     * Visibility helper : Sets the size of a visibility box, this sets the underlying mesh bounding box.
     * @param size the size (float) of the visibility box
     * note : this doesn't lock the PCS mesh bounding box.
     * doc :
     */
    setVisibilityBox(size) {
        if (!this.mesh) {
            return;
        }
        const vis = size / 2;
        this.mesh.buildBoundingInfo(new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(-vis, -vis, -vis), new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(vis, vis, vis));
    }
    /**
     * Gets whether the PCS is always visible or not
     * doc :
     */
    get isAlwaysVisible() {
        return this._alwaysVisible;
    }
    /**
     * Sets the PCS as always visible or not
     * doc :
     */
    set isAlwaysVisible(val) {
        if (!this.mesh) {
            return;
        }
        this._alwaysVisible = val;
        this.mesh.alwaysSelectAsActiveMesh = val;
    }
    /**
     * Tells to `setParticles()` to compute the particle rotations or not
     * Default value : false. The PCS is faster when it's set to false
     * Note : particle rotations are only applied to parent particles
     * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate
     */
    set computeParticleRotation(val) {
        this._computeParticleRotation = val;
    }
    /**
     * Tells to `setParticles()` to compute the particle colors or not.
     * Default value : true. The PCS is faster when it's set to false.
     * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
     */
    set computeParticleColor(val) {
        this._computeParticleColor = val;
    }
    set computeParticleTexture(val) {
        this._computeParticleTexture = val;
    }
    /**
     * Gets if `setParticles()` computes the particle colors or not.
     * Default value : false. The PCS is faster when it's set to false.
     * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
     */
    get computeParticleColor() {
        return this._computeParticleColor;
    }
    /**
     * Gets if `setParticles()` computes the particle textures or not.
     * Default value : false. The PCS is faster when it's set to false.
     * Note : the particle textures are stored values, so setting `computeParticleTexture` to false will keep yet the last colors set.
     */
    get computeParticleTexture() {
        return this._computeParticleTexture;
    }
    /**
     * Tells to `setParticles()` to compute or not the mesh bounding box when computing the particle positions.
     */
    set computeBoundingBox(val) {
        this._computeBoundingBox = val;
    }
    /**
     * Gets if `setParticles()` computes or not the mesh bounding box when computing the particle positions.
     */
    get computeBoundingBox() {
        return this._computeBoundingBox;
    }
    // =======================================================================
    // Particle behavior logic
    // these following methods may be overwritten by users to fit their needs
    /**
     * This function does nothing. It may be overwritten to set all the particle first values.
     * The PCS doesn't call this function, you may have to call it by your own.
     * doc :
     */
    initParticles() { }
    /**
     * This function does nothing. It may be overwritten to recycle a particle
     * The PCS doesn't call this function, you can to call it
     * doc :
     * @param particle The particle to recycle
     * @returns the recycled particle
     */
    recycleParticle(particle) {
        return particle;
    }
    /**
     * Updates a particle : this function should  be overwritten by the user.
     * It is called on each particle by `setParticles()`. This is the place to code each particle behavior.
     * doc :
     * @example : just set a particle position or velocity and recycle conditions
     * @param particle The particle to update
     * @returns the updated particle
     */
    updateParticle(particle) {
        return particle;
    }
    /**
     * This will be called before any other treatment by `setParticles()` and will be passed three parameters.
     * This does nothing and may be overwritten by the user.
     * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()
     * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
     * @param update the boolean update value actually passed to setParticles()
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    beforeUpdateParticles(start, stop, update) { }
    /**
     * This will be called  by `setParticles()` after all the other treatments and just before the actual mesh update.
     * This will be passed three parameters.
     * This does nothing and may be overwritten by the user.
     * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()
     * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
     * @param update the boolean update value actually passed to setParticles()
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    afterUpdateParticles(start, stop, update) { }
}
//# sourceMappingURL=pointsCloudSystem.js.map

/***/ }),

/***/ 30580:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   s: () => (/* binding */ PassCubePostProcess),
/* harmony export */   v: () => (/* binding */ PassPostProcess)
/* harmony export */ });
/* harmony import */ var _postProcess_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77891);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32206);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56552);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26877);





/**
 * PassPostProcess which produces an output the same as it's input
 */
class PassPostProcess extends _postProcess_js__WEBPACK_IMPORTED_MODULE_0__/* .PostProcess */ .w {
    /**
     * Gets a string identifying the name of the class
     * @returns "PassPostProcess" string
     */
    getClassName() {
        return "PassPostProcess";
    }
    /**
     * Creates the PassPostProcess
     * @param name The name of the effect.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType The type of texture to be used when performing the post processing.
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        super(name, "pass", null, null, options, camera, samplingMode, engine, reusable, undefined, textureType, undefined, null, blockCompilation);
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99965))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79820))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper */ .p.Parse(() => {
            return new PassPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_2__/* .RegisterClass */ .Y5)("BABYLON.PassPostProcess", PassPostProcess);
/**
 * PassCubePostProcess which produces an output the same as it's input (which must be a cube texture)
 */
class PassCubePostProcess extends _postProcess_js__WEBPACK_IMPORTED_MODULE_0__/* .PostProcess */ .w {
    /**
     * Gets or sets the cube face to display.
     *  * 0 is +X
     *  * 1 is -X
     *  * 2 is +Y
     *  * 3 is -Y
     *  * 4 is +Z
     *  * 5 is -Z
     */
    get face() {
        return this._face;
    }
    set face(value) {
        if (value < 0 || value > 5) {
            return;
        }
        this._face = value;
        switch (this._face) {
            case 0:
                this.updateEffect("#define POSITIVEX");
                break;
            case 1:
                this.updateEffect("#define NEGATIVEX");
                break;
            case 2:
                this.updateEffect("#define POSITIVEY");
                break;
            case 3:
                this.updateEffect("#define NEGATIVEY");
                break;
            case 4:
                this.updateEffect("#define POSITIVEZ");
                break;
            case 5:
                this.updateEffect("#define NEGATIVEZ");
                break;
        }
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "PassCubePostProcess" string
     */
    getClassName() {
        return "PassCubePostProcess";
    }
    /**
     * Creates the PassCubePostProcess
     * @param name The name of the effect.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType The type of texture to be used when performing the post processing.
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        super(name, "passCube", null, null, options, camera, samplingMode, engine, reusable, "#define POSITIVEX", textureType, undefined, null, blockCompilation);
        this._face = 0;
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 67682))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 4511))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_3__/* .SerializationHelper */ .p.Parse(() => {
            return new PassCubePostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_1__/* .AbstractEngine */ .$._RescalePostProcessFactory = (engine) => {
    return new PassPostProcess("rescale", 1, null, 2, engine, false, 0);
};
//# sourceMappingURL=passPostProcess.js.map

/***/ }),

/***/ 77891:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   w: () => (/* binding */ PostProcess)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17931);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99848);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _Materials_effect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74420);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79259);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26877);
/* harmony import */ var _Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(56552);
/* harmony import */ var _Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(32206);
/* harmony import */ var _Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91597);
/* harmony import */ var _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(84255);












_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.prototype.setTextureFromPostProcess = function (channel, postProcess, name) {
    let postProcessInput = null;
    if (postProcess) {
        if (postProcess._forcedOutputTexture) {
            postProcessInput = postProcess._forcedOutputTexture;
        }
        else if (postProcess._textures.data[postProcess._currentRenderTextureInd]) {
            postProcessInput = postProcess._textures.data[postProcess._currentRenderTextureInd];
        }
    }
    this._bindTexture(channel, postProcessInput?.texture ?? null, name);
};
_Engines_abstractEngine_js__WEBPACK_IMPORTED_MODULE_8__/* .AbstractEngine */ .$.prototype.setTextureFromPostProcessOutput = function (channel, postProcess, name) {
    this._bindTexture(channel, postProcess?._outputTexture?.texture ?? null, name);
};
/**
 * Sets a texture to be the input of the specified post process. (To use the output, pass in the next post process in the pipeline)
 * @param channel Name of the sampler variable.
 * @param postProcess Post process to get the input texture from.
 */
_Materials_effect_js__WEBPACK_IMPORTED_MODULE_4__/* .Effect */ .M.prototype.setTextureFromPostProcess = function (channel, postProcess) {
    this._engine.setTextureFromPostProcess(this._samplers[channel], postProcess, channel);
};
/**
 * (Warning! setTextureFromPostProcessOutput may be desired instead)
 * Sets the input texture of the passed in post process to be input of this effect. (To use the output of the passed in post process use setTextureFromPostProcessOutput)
 * @param channel Name of the sampler variable.
 * @param postProcess Post process to get the output texture from.
 */
_Materials_effect_js__WEBPACK_IMPORTED_MODULE_4__/* .Effect */ .M.prototype.setTextureFromPostProcessOutput = function (channel, postProcess) {
    this._engine.setTextureFromPostProcessOutput(this._samplers[channel], postProcess, channel);
};
/**
 * PostProcess can be used to apply a shader to a texture after it has been rendered
 * See https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses
 */
class PostProcess {
    /**
     * Force all the postprocesses to compile to glsl even on WebGPU engines.
     * False by default. This is mostly meant for backward compatibility.
     */
    static get ForceGLSL() {
        return _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_10__/* .EffectWrapper */ .$.ForceGLSL;
    }
    static set ForceGLSL(force) {
        _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_10__/* .EffectWrapper */ .$.ForceGLSL = force;
    }
    /**
     * Registers a shader code processing with a post process name.
     * @param postProcessName name of the post process. Use null for the fallback shader code processing. This is the shader code processing that will be used in case no specific shader code processing has been associated to a post process name
     * @param customShaderCodeProcessing shader code processing to associate to the post process name
     */
    static RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing) {
        _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_10__/* .EffectWrapper */ .$.RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing);
    }
    /** Name of the PostProcess. */
    get name() {
        return this._effectWrapper.name;
    }
    set name(value) {
        this._effectWrapper.name = value;
    }
    /**
     * Type of alpha mode to use when performing the post process (default: Engine.ALPHA_DISABLE)
     */
    get alphaMode() {
        return this._effectWrapper.alphaMode;
    }
    set alphaMode(value) {
        this._effectWrapper.alphaMode = value;
    }
    /**
     * Number of sample textures (default: 1)
     */
    get samples() {
        return this._samples;
    }
    set samples(n) {
        this._samples = Math.min(n, this._engine.getCaps().maxMSAASamples);
        this._textures.forEach((texture) => {
            texture.setSamples(this._samples);
        });
    }
    /**
     * Gets the shader language type used to generate vertex and fragment source code.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Returns the fragment url or shader name used in the post process.
     * @returns the fragment url or name in the shader store.
     */
    getEffectName() {
        return this._fragmentUrl;
    }
    /**
     * A function that is added to the onActivateObservable
     */
    set onActivate(callback) {
        if (this._onActivateObserver) {
            this.onActivateObservable.remove(this._onActivateObserver);
        }
        if (callback) {
            this._onActivateObserver = this.onActivateObservable.add(callback);
        }
    }
    /**
     * A function that is added to the onSizeChangedObservable
     */
    set onSizeChanged(callback) {
        if (this._onSizeChangedObserver) {
            this.onSizeChangedObservable.remove(this._onSizeChangedObserver);
        }
        this._onSizeChangedObserver = this.onSizeChangedObservable.add(callback);
    }
    /**
     * A function that is added to the onApplyObservable
     */
    set onApply(callback) {
        if (this._onApplyObserver) {
            this.onApplyObservable.remove(this._onApplyObserver);
        }
        this._onApplyObserver = this.onApplyObservable.add(callback);
    }
    /**
     * A function that is added to the onBeforeRenderObservable
     */
    set onBeforeRender(callback) {
        if (this._onBeforeRenderObserver) {
            this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
        }
        this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);
    }
    /**
     * A function that is added to the onAfterRenderObservable
     */
    set onAfterRender(callback) {
        if (this._onAfterRenderObserver) {
            this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
        }
        this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);
    }
    /**
     * The input texture for this post process and the output texture of the previous post process. When added to a pipeline the previous post process will
     * render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.
     */
    get inputTexture() {
        return this._textures.data[this._currentRenderTextureInd];
    }
    set inputTexture(value) {
        this._forcedOutputTexture = value;
    }
    /**
     * Since inputTexture should always be defined, if we previously manually set `inputTexture`,
     * the only way to unset it is to use this function to restore its internal state
     */
    restoreDefaultInputTexture() {
        if (this._forcedOutputTexture) {
            this._forcedOutputTexture = null;
            this.markTextureDirty();
        }
    }
    /**
     * Gets the camera which post process is applied to.
     * @returns The camera the post process is applied to.
     */
    getCamera() {
        return this._camera;
    }
    /**
     * Gets the texel size of the postprocess.
     * See https://en.wikipedia.org/wiki/Texel_(graphics)
     */
    get texelSize() {
        if (this._shareOutputWithPostProcess) {
            return this._shareOutputWithPostProcess.texelSize;
        }
        if (this._forcedOutputTexture) {
            this._texelSize.copyFromFloats(1.0 / this._forcedOutputTexture.width, 1.0 / this._forcedOutputTexture.height);
        }
        return this._texelSize;
    }
    /** @internal */
    constructor(name, fragmentUrl, parameters, samplers, _size, camera, samplingMode = 1, engine, reusable, defines = null, textureType = 0, vertexUrl = "postprocess", indexParameters, blockCompilation = false, textureFormat = 5, shaderLanguage, extraInitializations) {
        /** @internal */
        this._parentContainer = null;
        /**
         * Width of the texture to apply the post process on
         */
        this.width = -1;
        /**
         * Height of the texture to apply the post process on
         */
        this.height = -1;
        /**
         * Gets the node material used to create this postprocess (null if the postprocess was manually created)
         */
        this.nodeMaterialSource = null;
        /**
         * Internal, reference to the location where this postprocess was output to. (Typically the texture on the next postprocess in the chain)
         * @internal
         */
        this._outputTexture = null;
        /**
         * If the buffer needs to be cleared before applying the post process. (default: true)
         * Should be set to false if shader will overwrite all previous pixels.
         */
        this.autoClear = true;
        /**
         * If clearing the buffer should be forced in autoClear mode, even when alpha mode is enabled (default: false).
         * By default, the buffer will only be cleared if alpha mode is disabled (and autoClear is true).
         */
        this.forceAutoClearInAlphaMode = false;
        /**
         * Animations to be used for the post processing
         */
        this.animations = [];
        /**
         * Enable Pixel Perfect mode where texture is not scaled to be power of 2.
         * Can only be used on a single postprocess or on the last one of a chain. (default: false)
         */
        this.enablePixelPerfectMode = false;
        /**
         * Force the postprocess to be applied without taking in account viewport
         */
        this.forceFullscreenViewport = true;
        /**
         * Scale mode for the post process (default: Engine.SCALEMODE_FLOOR)
         *
         * | Value | Type                                | Description |
         * | ----- | ----------------------------------- | ----------- |
         * | 1     | SCALEMODE_FLOOR                     | [engine.scalemode_floor](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_floor) |
         * | 2     | SCALEMODE_NEAREST                   | [engine.scalemode_nearest](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_nearest) |
         * | 3     | SCALEMODE_CEILING                   | [engine.scalemode_ceiling](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_ceiling) |
         *
         */
        this.scaleMode = 1;
        /**
         * Force textures to be a power of two (default: false)
         */
        this.alwaysForcePOT = false;
        this._samples = 1;
        /**
         * Modify the scale of the post process to be the same as the viewport (default: false)
         */
        this.adaptScaleToCurrentViewport = false;
        this._webGPUReady = false;
        this._reusable = false;
        this._renderId = 0;
        /**
         * if externalTextureSamplerBinding is true, the "apply" method won't bind the textureSampler texture, it is expected to be done by the "outside" (by the onApplyObservable observer most probably).
         * counter-productive in some cases because if the texture bound by "apply" is different from the currently texture bound, (the one set by the onApplyObservable observer, for eg) some
         * internal structures (materialContext) will be dirtified, which may impact performances
         */
        this.externalTextureSamplerBinding = false;
        /**
         * Smart array of input and output textures for the post process.
         * @internal
         */
        this._textures = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_1__/* .SmartArray */ .L(2);
        /**
         * Smart array of input and output textures for the post process.
         * @internal
         */
        this._textureCache = [];
        /**
         * The index in _textures that corresponds to the output texture.
         * @internal
         */
        this._currentRenderTextureInd = 0;
        this._scaleRatio = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2 */ .I9(1, 1);
        this._texelSize = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Vector2 */ .I9.Zero();
        // Events
        /**
         * An event triggered when the postprocess is activated.
         */
        this.onActivateObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        /**
         * An event triggered when the postprocess changes its size.
         */
        this.onSizeChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        /**
         * An event triggered when the postprocess applies its effect.
         */
        this.onApplyObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        /**
         * An event triggered before rendering the postprocess
         */
        this.onBeforeRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        /**
         * An event triggered after rendering the postprocess
         */
        this.onAfterRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_2__/* .Observable */ .cP();
        let size = 1;
        let uniformBuffers = null;
        let effectWrapper;
        if (parameters && !Array.isArray(parameters)) {
            const options = parameters;
            parameters = options.uniforms ?? null;
            samplers = options.samplers ?? null;
            size = options.size ?? 1;
            camera = options.camera ?? null;
            samplingMode = options.samplingMode ?? 1;
            engine = options.engine;
            reusable = options.reusable;
            defines = Array.isArray(options.defines) ? options.defines.join("\n") : (options.defines ?? null);
            textureType = options.textureType ?? 0;
            vertexUrl = options.vertexUrl ?? "postprocess";
            indexParameters = options.indexParameters;
            blockCompilation = options.blockCompilation ?? false;
            textureFormat = options.textureFormat ?? 5;
            shaderLanguage = options.shaderLanguage ?? 0 /* ShaderLanguage.GLSL */;
            uniformBuffers = options.uniformBuffers ?? null;
            extraInitializations = options.extraInitializations;
            effectWrapper = options.effectWrapper;
        }
        else if (_size) {
            if (typeof _size === "number") {
                size = _size;
            }
            else {
                size = { width: _size.width, height: _size.height };
            }
        }
        const useExistingThinPostProcess = !!effectWrapper;
        this._effectWrapper =
            effectWrapper ??
                new _Materials_effectRenderer_js__WEBPACK_IMPORTED_MODULE_10__/* .EffectWrapper */ .$({
                    name,
                    useShaderStore: true,
                    useAsPostProcess: true,
                    fragmentShader: fragmentUrl,
                    engine: engine || camera?.getScene().getEngine(),
                    uniforms: parameters,
                    samplers,
                    uniformBuffers,
                    defines,
                    vertexUrl,
                    indexParameters,
                    blockCompilation: true,
                    shaderLanguage,
                    extraInitializations: undefined,
                });
        this.name = name;
        this.onEffectCreatedObservable = this._effectWrapper.onEffectCreatedObservable;
        if (camera != null) {
            this._camera = camera;
            this._scene = camera.getScene();
            camera.attachPostProcess(this);
            this._engine = this._scene.getEngine();
            this._scene.postProcesses.push(this);
            this.uniqueId = this._scene.getUniqueId();
        }
        else if (engine) {
            this._engine = engine;
            this._engine.postProcesses.push(this);
        }
        this._options = size;
        this.renderTargetSamplingMode = samplingMode ? samplingMode : 1;
        this._reusable = reusable || false;
        this._textureType = textureType;
        this._textureFormat = textureFormat;
        this._shaderLanguage = shaderLanguage || 0 /* ShaderLanguage.GLSL */;
        this._samplers = samplers || [];
        if (this._samplers.indexOf("textureSampler") === -1) {
            this._samplers.push("textureSampler");
        }
        this._fragmentUrl = fragmentUrl;
        this._vertexUrl = vertexUrl;
        this._parameters = parameters || [];
        if (this._parameters.indexOf("scale") === -1) {
            this._parameters.push("scale");
        }
        this._uniformBuffers = uniformBuffers || [];
        this._indexParameters = indexParameters;
        if (!useExistingThinPostProcess) {
            this._webGPUReady = this._shaderLanguage === 1 /* ShaderLanguage.WGSL */;
            const importPromises = [];
            this._gatherImports(this._engine.isWebGPU && !PostProcess.ForceGLSL, importPromises);
            this._effectWrapper._webGPUReady = this._webGPUReady;
            this._effectWrapper._postConstructor(blockCompilation, defines, extraInitializations, importPromises);
        }
    }
    _gatherImports(useWebGPU = false, list) {
        // this._webGPUReady is used to detect when a postprocess is intended to be used with WebGPU
        if (useWebGPU && this._webGPUReady) {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 32083))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 16612))]));
        }
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "PostProcess" string
     */
    getClassName() {
        return "PostProcess";
    }
    /**
     * Gets the engine which this post process belongs to.
     * @returns The engine the post process was enabled with.
     */
    getEngine() {
        return this._engine;
    }
    /**
     * The effect that is created when initializing the post process.
     * @returns The created effect corresponding to the postprocess.
     */
    getEffect() {
        return this._effectWrapper.drawWrapper.effect;
    }
    /**
     * To avoid multiple redundant textures for multiple post process, the output the output texture for this post process can be shared with another.
     * @param postProcess The post process to share the output with.
     * @returns This post process.
     */
    shareOutputWith(postProcess) {
        this._disposeTextures();
        this._shareOutputWithPostProcess = postProcess;
        return this;
    }
    /**
     * Reverses the effect of calling shareOutputWith and returns the post process back to its original state.
     * This should be called if the post process that shares output with this post process is disabled/disposed.
     */
    useOwnOutput() {
        if (this._textures.length == 0) {
            this._textures = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_1__/* .SmartArray */ .L(2);
        }
        this._shareOutputWithPostProcess = null;
    }
    /**
     * Updates the effect with the current post process compile time values and recompiles the shader.
     * @param defines Define statements that should be added at the beginning of the shader. (default: null)
     * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)
     * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)
     * @param indexParameters The index parameters to be used for babylons include syntax "#include<kernelBlurVaryingDeclaration>[0..varyingCount]". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx
     * @param onCompiled Called when the shader has been compiled.
     * @param onError Called if there is an error when compiling a shader.
     * @param vertexUrl The url of the vertex shader to be used (default: the one given at construction time)
     * @param fragmentUrl The url of the fragment shader to be used (default: the one given at construction time)
     */
    updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl) {
        this._effectWrapper.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl);
        this._postProcessDefines = Array.isArray(this._effectWrapper.options.defines) ? this._effectWrapper.options.defines.join("\n") : this._effectWrapper.options.defines;
    }
    /**
     * The post process is reusable if it can be used multiple times within one frame.
     * @returns If the post process is reusable
     */
    isReusable() {
        return this._reusable;
    }
    /** invalidate frameBuffer to hint the postprocess to create a depth buffer */
    markTextureDirty() {
        this.width = -1;
    }
    _createRenderTargetTexture(textureSize, textureOptions, channel = 0) {
        for (let i = 0; i < this._textureCache.length; i++) {
            if (this._textureCache[i].texture.width === textureSize.width &&
                this._textureCache[i].texture.height === textureSize.height &&
                this._textureCache[i].postProcessChannel === channel &&
                this._textureCache[i].texture._generateDepthBuffer === textureOptions.generateDepthBuffer &&
                this._textureCache[i].texture.samples === textureOptions.samples) {
                return this._textureCache[i].texture;
            }
        }
        const tex = this._engine.createRenderTargetTexture(textureSize, textureOptions);
        this._textureCache.push({ texture: tex, postProcessChannel: channel, lastUsedRenderId: -1 });
        return tex;
    }
    _flushTextureCache() {
        const currentRenderId = this._renderId;
        for (let i = this._textureCache.length - 1; i >= 0; i--) {
            if (currentRenderId - this._textureCache[i].lastUsedRenderId > 100) {
                let currentlyUsed = false;
                for (let j = 0; j < this._textures.length; j++) {
                    if (this._textures.data[j] === this._textureCache[i].texture) {
                        currentlyUsed = true;
                        break;
                    }
                }
                if (!currentlyUsed) {
                    this._textureCache[i].texture.dispose();
                    this._textureCache.splice(i, 1);
                }
            }
        }
    }
    /**
     * Resizes the post-process texture
     * @param width Width of the texture
     * @param height Height of the texture
     * @param camera The camera this post-process is applied to. Pass null if the post-process is used outside the context of a camera post-process chain (default: null)
     * @param needMipMaps True if mip maps need to be generated after render (default: false)
     * @param forceDepthStencil True to force post-process texture creation with stencil depth and buffer (default: false)
     */
    resize(width, height, camera = null, needMipMaps = false, forceDepthStencil = false) {
        if (this._textures.length > 0) {
            this._textures.reset();
        }
        this.width = width;
        this.height = height;
        let firstPP = null;
        if (camera) {
            for (let i = 0; i < camera._postProcesses.length; i++) {
                if (camera._postProcesses[i] !== null) {
                    firstPP = camera._postProcesses[i];
                    break;
                }
            }
        }
        const textureSize = { width: this.width, height: this.height };
        const textureOptions = {
            generateMipMaps: needMipMaps,
            generateDepthBuffer: forceDepthStencil || firstPP === this,
            generateStencilBuffer: (forceDepthStencil || firstPP === this) && this._engine.isStencilEnable,
            samplingMode: this.renderTargetSamplingMode,
            type: this._textureType,
            format: this._textureFormat,
            samples: this._samples,
            label: "PostProcessRTT-" + this.name,
        };
        this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 0));
        if (this._reusable) {
            this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 1));
        }
        this._texelSize.copyFromFloats(1.0 / this.width, 1.0 / this.height);
        this.onSizeChangedObservable.notifyObservers(this);
    }
    _getTarget() {
        let target;
        if (this._shareOutputWithPostProcess) {
            target = this._shareOutputWithPostProcess.inputTexture;
        }
        else if (this._forcedOutputTexture) {
            target = this._forcedOutputTexture;
            this.width = this._forcedOutputTexture.width;
            this.height = this._forcedOutputTexture.height;
        }
        else {
            target = this.inputTexture;
            let cache;
            for (let i = 0; i < this._textureCache.length; i++) {
                if (this._textureCache[i].texture === target) {
                    cache = this._textureCache[i];
                    break;
                }
            }
            if (cache) {
                cache.lastUsedRenderId = this._renderId;
            }
        }
        return target;
    }
    /**
     * Activates the post process by intializing the textures to be used when executed. Notifies onActivateObservable.
     * When this post process is used in a pipeline, this is call will bind the input texture of this post process to the output of the previous.
     * @param camera The camera that will be used in the post process. This camera will be used when calling onActivateObservable.
     * @param sourceTexture The source texture to be inspected to get the width and height if not specified in the post process constructor. (default: null)
     * @param forceDepthStencil If true, a depth and stencil buffer will be generated. (default: false)
     * @returns The render target wrapper that was bound to be written to.
     */
    activate(camera, sourceTexture = null, forceDepthStencil) {
        camera = camera || this._camera;
        const scene = camera.getScene();
        const engine = scene.getEngine();
        const maxSize = engine.getCaps().maxTextureSize;
        const requiredWidth = ((sourceTexture ? sourceTexture.width : this._engine.getRenderWidth(true)) * this._options) | 0;
        const requiredHeight = ((sourceTexture ? sourceTexture.height : this._engine.getRenderHeight(true)) * this._options) | 0;
        let desiredWidth = this._options.width || requiredWidth;
        let desiredHeight = this._options.height || requiredHeight;
        const needMipMaps = this.renderTargetSamplingMode !== 7 &&
            this.renderTargetSamplingMode !== 1 &&
            this.renderTargetSamplingMode !== 2;
        let target = null;
        if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {
            if (this.adaptScaleToCurrentViewport) {
                const currentViewport = engine.currentViewport;
                if (currentViewport) {
                    desiredWidth *= currentViewport.width;
                    desiredHeight *= currentViewport.height;
                }
            }
            if (needMipMaps || this.alwaysForcePOT) {
                if (!this._options.width) {
                    desiredWidth = engine.needPOTTextures ? (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_9__/* .GetExponentOfTwo */ .R)(desiredWidth, maxSize, this.scaleMode) : desiredWidth;
                }
                if (!this._options.height) {
                    desiredHeight = engine.needPOTTextures ? (0,_Misc_tools_functions_js__WEBPACK_IMPORTED_MODULE_9__/* .GetExponentOfTwo */ .R)(desiredHeight, maxSize, this.scaleMode) : desiredHeight;
                }
            }
            if (this.width !== desiredWidth || this.height !== desiredHeight || !(target = this._getTarget())) {
                this.resize(desiredWidth, desiredHeight, camera, needMipMaps, forceDepthStencil);
            }
            this._textures.forEach((texture) => {
                if (texture.samples !== this.samples) {
                    this._engine.updateRenderTargetTextureSampleCount(texture, this.samples);
                }
            });
            this._flushTextureCache();
            this._renderId++;
        }
        if (!target) {
            target = this._getTarget();
        }
        // Bind the input of this post process to be used as the output of the previous post process.
        if (this.enablePixelPerfectMode) {
            this._scaleRatio.copyFromFloats(requiredWidth / desiredWidth, requiredHeight / desiredHeight);
            this._engine.bindFramebuffer(target, 0, requiredWidth, requiredHeight, this.forceFullscreenViewport);
        }
        else {
            this._scaleRatio.copyFromFloats(1, 1);
            this._engine.bindFramebuffer(target, 0, undefined, undefined, this.forceFullscreenViewport);
        }
        this._engine._debugInsertMarker?.(`post process ${this.name} input`);
        this.onActivateObservable.notifyObservers(camera);
        // Clear
        if (this.autoClear && (this.alphaMode === 0 || this.forceAutoClearInAlphaMode)) {
            this._engine.clear(this.clearColor ? this.clearColor : scene.clearColor, scene._allowPostProcessClearColor, true, true);
        }
        if (this._reusable) {
            this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2;
        }
        return target;
    }
    /**
     * If the post process is supported.
     */
    get isSupported() {
        return this._effectWrapper.drawWrapper.effect.isSupported;
    }
    /**
     * The aspect ratio of the output texture.
     */
    get aspectRatio() {
        if (this._shareOutputWithPostProcess) {
            return this._shareOutputWithPostProcess.aspectRatio;
        }
        if (this._forcedOutputTexture) {
            return this._forcedOutputTexture.width / this._forcedOutputTexture.height;
        }
        return this.width / this.height;
    }
    /**
     * Get a value indicating if the post-process is ready to be used
     * @returns true if the post-process is ready (shader is compiled)
     */
    isReady() {
        return this._effectWrapper.isReady();
    }
    /**
     * Binds all textures and uniforms to the shader, this will be run on every pass.
     * @returns the effect corresponding to this post process. Null if not compiled or not ready.
     */
    apply() {
        // Check
        if (!this._effectWrapper.isReady()) {
            return null;
        }
        // States
        this._engine.enableEffect(this._effectWrapper.drawWrapper);
        this._engine.setState(false);
        this._engine.setDepthBuffer(false);
        this._engine.setDepthWrite(false);
        // Alpha
        if (this.alphaConstants) {
            this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);
        }
        // Bind the output texture of the preivous post process as the input to this post process.
        let source;
        if (this._shareOutputWithPostProcess) {
            source = this._shareOutputWithPostProcess.inputTexture;
        }
        else if (this._forcedOutputTexture) {
            source = this._forcedOutputTexture;
        }
        else {
            source = this.inputTexture;
        }
        if (!this.externalTextureSamplerBinding) {
            this._effectWrapper.drawWrapper.effect._bindTexture("textureSampler", source?.texture);
        }
        // Parameters
        this._effectWrapper.drawWrapper.effect.setVector2("scale", this._scaleRatio);
        this.onApplyObservable.notifyObservers(this._effectWrapper.drawWrapper.effect);
        this._effectWrapper.bind();
        return this._effectWrapper.drawWrapper.effect;
    }
    _disposeTextures() {
        if (this._shareOutputWithPostProcess || this._forcedOutputTexture) {
            this._disposeTextureCache();
            return;
        }
        this._disposeTextureCache();
        this._textures.dispose();
    }
    _disposeTextureCache() {
        for (let i = this._textureCache.length - 1; i >= 0; i--) {
            this._textureCache[i].texture.dispose();
        }
        this._textureCache.length = 0;
    }
    /**
     * Sets the required values to the prepass renderer.
     * @param prePassRenderer defines the prepass renderer to setup.
     * @returns true if the pre pass is needed.
     */
    setPrePassRenderer(prePassRenderer) {
        if (this._prePassEffectConfiguration) {
            this._prePassEffectConfiguration = prePassRenderer.addEffectConfiguration(this._prePassEffectConfiguration);
            this._prePassEffectConfiguration.enabled = true;
            return true;
        }
        return false;
    }
    /**
     * Disposes the post process.
     * @param camera The camera to dispose the post process on.
     */
    dispose(camera) {
        camera = camera || this._camera;
        this._disposeTextures();
        let index;
        if (this._scene) {
            index = this._scene.postProcesses.indexOf(this);
            if (index !== -1) {
                this._scene.postProcesses.splice(index, 1);
            }
        }
        if (this._parentContainer) {
            const index = this._parentContainer.postProcesses.indexOf(this);
            if (index > -1) {
                this._parentContainer.postProcesses.splice(index, 1);
            }
            this._parentContainer = null;
        }
        index = this._engine.postProcesses.indexOf(this);
        if (index !== -1) {
            this._engine.postProcesses.splice(index, 1);
        }
        if (!camera) {
            return;
        }
        camera.detachPostProcess(this);
        index = camera._postProcesses.indexOf(this);
        if (index === 0 && camera._postProcesses.length > 0) {
            const firstPostProcess = this._camera._getFirstPostProcess();
            if (firstPostProcess) {
                firstPostProcess.markTextureDirty();
            }
        }
        this.onActivateObservable.clear();
        this.onAfterRenderObservable.clear();
        this.onApplyObservable.clear();
        this.onBeforeRenderObservable.clear();
        this.onSizeChangedObservable.clear();
        this.onEffectCreatedObservable.clear();
    }
    /**
     * Serializes the post process to a JSON object
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__/* .SerializationHelper */ .p.Serialize(this);
        const camera = this.getCamera() || (this._scene && this._scene.activeCamera);
        serializationObject.customType = "BABYLON." + this.getClassName();
        serializationObject.cameraId = camera ? camera.id : null;
        serializationObject.reusable = this._reusable;
        serializationObject.textureType = this._textureType;
        serializationObject.fragmentUrl = this._fragmentUrl;
        serializationObject.parameters = this._parameters;
        serializationObject.samplers = this._samplers;
        serializationObject.uniformBuffers = this._uniformBuffers;
        serializationObject.options = this._options;
        serializationObject.defines = this._postProcessDefines;
        serializationObject.textureFormat = this._textureFormat;
        serializationObject.vertexUrl = this._vertexUrl;
        serializationObject.indexParameters = this._indexParameters;
        return serializationObject;
    }
    /**
     * Clones this post process
     * @returns a new post process similar to this one
     */
    clone() {
        const serializationObject = this.serialize();
        serializationObject._engine = this._engine;
        serializationObject.cameraId = null;
        const result = PostProcess.Parse(serializationObject, this._scene, "");
        if (!result) {
            return null;
        }
        result.onActivateObservable = this.onActivateObservable.clone();
        result.onSizeChangedObservable = this.onSizeChangedObservable.clone();
        result.onApplyObservable = this.onApplyObservable.clone();
        result.onBeforeRenderObservable = this.onBeforeRenderObservable.clone();
        result.onAfterRenderObservable = this.onAfterRenderObservable.clone();
        result._prePassEffectConfiguration = this._prePassEffectConfiguration;
        return result;
    }
    /**
     * Creates a material from parsed material data
     * @param parsedPostProcess defines parsed post process data
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures
     * @returns a new post process
     */
    static Parse(parsedPostProcess, scene, rootUrl) {
        const postProcessType = (0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_7__/* .GetClass */ .n9)(parsedPostProcess.customType);
        if (!postProcessType || !postProcessType._Parse) {
            return null;
        }
        const camera = scene ? scene.getCameraById(parsedPostProcess.cameraId) : null;
        return postProcessType._Parse(parsedPostProcess, camera, scene, rootUrl);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__/* .SerializationHelper */ .p.Parse(() => {
            return new PostProcess(parsedPostProcess.name, parsedPostProcess.fragmentUrl, parsedPostProcess.parameters, parsedPostProcess.samplers, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable, parsedPostProcess.defines, parsedPostProcess.textureType, parsedPostProcess.vertexUrl, parsedPostProcess.indexParameters, false, parsedPostProcess.textureFormat);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "uniqueId", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "name", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "width", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "height", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "renderTargetSamplingMode", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serializeAsColor4 */ .qK)()
], PostProcess.prototype, "clearColor", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "autoClear", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "forceAutoClearInAlphaMode", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "alphaMode", null);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "alphaConstants", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "enablePixelPerfectMode", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "forceFullscreenViewport", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "scaleMode", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "alwaysForcePOT", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)("samples")
], PostProcess.prototype, "_samples", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_5__/* .serialize */ .lK)()
], PostProcess.prototype, "adaptScaleToCurrentViewport", void 0);
(0,_Misc_typeStore_js__WEBPACK_IMPORTED_MODULE_7__/* .RegisterClass */ .Y5)("BABYLON.PostProcess", PostProcess);
//# sourceMappingURL=postProcess.js.map

/***/ }),

/***/ 36096:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   X: () => (/* binding */ PostProcessManager)
/* harmony export */ });
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95616);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);



/**
 * PostProcessManager is used to manage one or more post processes or post process pipelines
 * See https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses
 */
class PostProcessManager {
    /**
     * Creates a new instance PostProcess
     * @param scene The scene that the post process is associated with.
     */
    constructor(scene) {
        this._vertexBuffers = {};
        this.onBeforeRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        this._scene = scene;
    }
    _prepareBuffers() {
        if (this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind]) {
            return;
        }
        // VBO
        const vertices = [];
        vertices.push(1, 1);
        vertices.push(-1, 1);
        vertices.push(-1, -1);
        vertices.push(1, -1);
        this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R(this._scene.getEngine(), vertices, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind, false, false, 2);
        this._buildIndexBuffer();
    }
    _buildIndexBuffer() {
        // Indices
        const indices = [];
        indices.push(0);
        indices.push(1);
        indices.push(2);
        indices.push(0);
        indices.push(2);
        indices.push(3);
        this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);
    }
    /**
     * Rebuilds the vertex buffers of the manager.
     * @internal
     */
    _rebuild() {
        const vb = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind];
        if (!vb) {
            return;
        }
        vb._rebuild();
        this._buildIndexBuffer();
    }
    // Methods
    /**
     * Prepares a frame to be run through a post process.
     * @param sourceTexture The input texture to the post processes. (default: null)
     * @param postProcesses An array of post processes to be run. (default: null)
     * @returns True if the post processes were able to be run.
     * @internal
     */
    _prepareFrame(sourceTexture = null, postProcesses = null) {
        const camera = this._scene.activeCamera;
        if (!camera) {
            return false;
        }
        postProcesses = postProcesses || camera._postProcesses.filter((pp) => {
            return pp != null;
        });
        if (!postProcesses || postProcesses.length === 0 || !this._scene.postProcessesEnabled) {
            return false;
        }
        postProcesses[0].activate(camera, sourceTexture, postProcesses !== null && postProcesses !== undefined);
        return true;
    }
    /**
     * Manually render a set of post processes to a texture.
     * Please note, the frame buffer won't be unbound after the call in case you have more render to do.
     * @param postProcesses An array of post processes to be run.
     * @param targetTexture The render target wrapper to render to.
     * @param forceFullscreenViewport force gl.viewport to be full screen eg. 0,0,textureWidth,textureHeight
     * @param faceIndex defines the face to render to if a cubemap is defined as the target
     * @param lodLevel defines which lod of the texture to render to
     * @param doNotBindFrambuffer If set to true, assumes that the framebuffer has been bound previously
     */
    directRender(postProcesses, targetTexture = null, forceFullscreenViewport = false, faceIndex = 0, lodLevel = 0, doNotBindFrambuffer = false) {
        const engine = this._scene.getEngine();
        for (let index = 0; index < postProcesses.length; index++) {
            if (index < postProcesses.length - 1) {
                postProcesses[index + 1].activate(this._scene.activeCamera, targetTexture?.texture);
            }
            else {
                if (targetTexture) {
                    engine.bindFramebuffer(targetTexture, faceIndex, undefined, undefined, forceFullscreenViewport, lodLevel);
                }
                else if (!doNotBindFrambuffer) {
                    engine.restoreDefaultFramebuffer();
                }
                engine._debugInsertMarker?.(`post process ${postProcesses[index].name} output`);
            }
            const pp = postProcesses[index];
            const effect = pp.apply();
            if (effect) {
                pp.onBeforeRenderObservable.notifyObservers(effect);
                // VBOs
                this._prepareBuffers();
                engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect);
                // Draw order
                engine.drawElementsType(0, 0, 6);
                pp.onAfterRenderObservable.notifyObservers(effect);
            }
        }
        // Restore depth buffer
        engine.setDepthBuffer(true);
        engine.setDepthWrite(true);
    }
    /**
     * Finalize the result of the output of the postprocesses.
     * @param doNotPresent If true the result will not be displayed to the screen.
     * @param targetTexture The render target wrapper to render to.
     * @param faceIndex The index of the face to bind the target texture to.
     * @param postProcesses The array of post processes to render.
     * @param forceFullscreenViewport force gl.viewport to be full screen eg. 0,0,textureWidth,textureHeight (default: false)
     * @internal
     */
    _finalizeFrame(doNotPresent, targetTexture, faceIndex, postProcesses, forceFullscreenViewport = false) {
        const camera = this._scene.activeCamera;
        if (!camera) {
            return;
        }
        this.onBeforeRenderObservable.notifyObservers(this);
        postProcesses = postProcesses || camera._postProcesses.filter((pp) => {
            return pp != null;
        });
        if (postProcesses.length === 0 || !this._scene.postProcessesEnabled) {
            return;
        }
        const engine = this._scene.getEngine();
        for (let index = 0, len = postProcesses.length; index < len; index++) {
            const pp = postProcesses[index];
            if (index < len - 1) {
                pp._outputTexture = postProcesses[index + 1].activate(camera, targetTexture?.texture);
            }
            else {
                if (targetTexture) {
                    engine.bindFramebuffer(targetTexture, faceIndex, undefined, undefined, forceFullscreenViewport);
                    pp._outputTexture = targetTexture;
                }
                else {
                    engine.restoreDefaultFramebuffer();
                    pp._outputTexture = null;
                }
                engine._debugInsertMarker?.(`post process ${postProcesses[index].name} output`);
            }
            if (doNotPresent) {
                break;
            }
            const effect = pp.apply();
            if (effect) {
                pp.onBeforeRenderObservable.notifyObservers(effect);
                // VBOs
                this._prepareBuffers();
                engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect);
                // Draw order
                engine.drawElementsType(0, 0, 6);
                pp.onAfterRenderObservable.notifyObservers(effect);
            }
        }
        // Restore states
        engine.setDepthBuffer(true);
        engine.setDepthWrite(true);
        engine.setAlphaMode(0);
    }
    /**
     * Disposes of the post process manager.
     */
    dispose() {
        const buffer = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind];
        if (buffer) {
            buffer.dispose();
            this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VertexBuffer */ .R.PositionKind] = null;
        }
        if (this._indexBuffer) {
            this._scene.getEngine()._releaseBuffer(this._indexBuffer);
            this._indexBuffer = null;
        }
    }
}
//# sourceMappingURL=postProcessManager.js.map

/***/ }),

/***/ 90505:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   b: () => (/* binding */ BoundingBoxRenderer)
/* harmony export */ });
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87491);
/* harmony import */ var _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95616);
/* harmony import */ var _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35985);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79923);
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17931);
/* harmony import */ var _sceneComponent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16945);
/* harmony import */ var _Materials_material_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28986);
/* harmony import */ var _Materials_shaderMaterial_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(10917);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(26041);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(99848);
/* harmony import */ var _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(35476);
/* harmony import */ var _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(80935);
/* harmony import */ var _Meshes_Builders_boxBuilder_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(96793);













Object.defineProperty(_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype, "forceShowBoundingBoxes", {
    get: function () {
        return this._forceShowBoundingBoxes || false;
    },
    set: function (value) {
        this._forceShowBoundingBoxes = value;
        // Lazyly creates a BB renderer if needed.
        if (value) {
            this.getBoundingBoxRenderer();
        }
    },
    enumerable: true,
    configurable: true,
});
_scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z.prototype.getBoundingBoxRenderer = function () {
    if (!this._boundingBoxRenderer) {
        this._boundingBoxRenderer = new BoundingBoxRenderer(this);
    }
    return this._boundingBoxRenderer;
};
Object.defineProperty(_Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_2__/* .AbstractMesh */ .u.prototype, "showBoundingBox", {
    get: function () {
        return this._showBoundingBox || false;
    },
    set: function (value) {
        this._showBoundingBox = value;
        // Lazyly creates a BB renderer if needed.
        if (value) {
            this.getScene().getBoundingBoxRenderer();
        }
    },
    enumerable: true,
    configurable: true,
});
/**
 * Component responsible of rendering the bounding box of the meshes in a scene.
 * This is usually used through the mesh.showBoundingBox or the scene.forceShowBoundingBoxes properties
 */
class BoundingBoxRenderer {
    /**
     * Gets the shader language used in this renderer.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Instantiates a new bounding box renderer in a scene.
     * @param scene the scene the  renderer renders in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = _sceneComponent_js__WEBPACK_IMPORTED_MODULE_5__/* .SceneComponentConstants */ .v.NAME_BOUNDINGBOXRENDERER;
        /**
         * Color of the bounding box lines placed in front of an object
         */
        this.frontColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_8__/* .Color3 */ .v9(1, 1, 1);
        /**
         * Color of the bounding box lines placed behind an object
         */
        this.backColor = new _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_8__/* .Color3 */ .v9(0.1, 0.1, 0.1);
        /**
         * Defines if the renderer should show the back lines or not
         */
        this.showBackLines = true;
        /**
         * Observable raised before rendering a bounding box
         */
        this.onBeforeBoxRenderingObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_9__/* .Observable */ .cP();
        /**
         * Observable raised after rendering a bounding box
         */
        this.onAfterBoxRenderingObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_9__/* .Observable */ .cP();
        /**
         * Observable raised after resources are created
         */
        this.onResourcesReadyObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_9__/* .Observable */ .cP();
        /**
         * When false, no bounding boxes will be rendered
         */
        this.enabled = true;
        /** Shader language used by the renderer */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        /**
         * @internal
         */
        this.renderList = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_4__/* .SmartArray */ .L(32);
        this._vertexBuffers = {};
        this._fillIndexBuffer = null;
        this._fillIndexData = null;
        this.scene = scene;
        const engine = this.scene.getEngine();
        if (engine.isWebGPU) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
        scene._addComponent(this);
        this._uniformBufferFront = new _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_11__/* .UniformBuffer */ .D(this.scene.getEngine(), undefined, undefined, "BoundingBoxRendererFront", true);
        this._buildUniformLayout(this._uniformBufferFront);
        this._uniformBufferBack = new _Materials_uniformBuffer_js__WEBPACK_IMPORTED_MODULE_11__/* .UniformBuffer */ .D(this.scene.getEngine(), undefined, undefined, "BoundingBoxRendererBack", true);
        this._buildUniformLayout(this._uniformBufferBack);
    }
    _buildUniformLayout(ubo) {
        ubo.addUniform("color", 4);
        ubo.addUniform("world", 16);
        ubo.addUniform("viewProjection", 16);
        ubo.addUniform("viewProjectionR", 16);
        ubo.create();
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._beforeEvaluateActiveMeshStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_5__/* .SceneComponentConstants */ .v.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER, this, this.reset);
        this.scene._preActiveMeshStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_5__/* .SceneComponentConstants */ .v.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER, this, this._preActiveMesh);
        this.scene._evaluateSubMeshStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_5__/* .SceneComponentConstants */ .v.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER, this, this._evaluateSubMesh);
        this.scene._afterRenderingGroupDrawStage.registerStep(_sceneComponent_js__WEBPACK_IMPORTED_MODULE_5__/* .SceneComponentConstants */ .v.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER, this, this.render);
    }
    _evaluateSubMesh(mesh, subMesh) {
        if (mesh.showSubMeshesBoundingBox) {
            const boundingInfo = subMesh.getBoundingInfo();
            if (boundingInfo !== null && boundingInfo !== undefined) {
                boundingInfo.boundingBox._tag = mesh.renderingGroupId;
                this.renderList.push(boundingInfo.boundingBox);
            }
        }
    }
    _preActiveMesh(mesh) {
        if (mesh.showBoundingBox || this.scene.forceShowBoundingBoxes) {
            const boundingInfo = mesh.getBoundingInfo();
            boundingInfo.boundingBox._tag = mesh.renderingGroupId;
            this.renderList.push(boundingInfo.boundingBox);
        }
    }
    _prepareResources() {
        if (this._colorShader) {
            return;
        }
        this._colorShader = new _Materials_shaderMaterial_js__WEBPACK_IMPORTED_MODULE_7__/* .ShaderMaterial */ .B("colorShader", this.scene, "boundingBoxRenderer", {
            attributes: [_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind],
            uniforms: ["world", "viewProjection", "viewProjectionR", "color"],
            uniformBuffers: ["BoundingBoxRenderer"],
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: async () => {
                if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 89252)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 12814))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 82187)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 33495))]);
                }
            },
        }, false);
        this._colorShader.doNotSerialize = true;
        this._colorShader.reservedDataStore = {
            hidden: true,
        };
        this._colorShaderForOcclusionQuery = new _Materials_shaderMaterial_js__WEBPACK_IMPORTED_MODULE_7__/* .ShaderMaterial */ .B("colorShaderOccQuery", this.scene, "boundingBoxRenderer", {
            attributes: [_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind],
            uniforms: ["world", "viewProjection", "viewProjectionR", "color"],
            uniformBuffers: ["BoundingBoxRenderer"],
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: async () => {
                if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 89252)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 12814))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 82187)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 33495))]);
                }
            },
        }, true);
        this._colorShaderForOcclusionQuery.doNotSerialize = true;
        this._colorShaderForOcclusionQuery.reservedDataStore = {
            hidden: true,
        };
        const engine = this.scene.getEngine();
        const boxdata = (0,_Meshes_Builders_boxBuilder_js__WEBPACK_IMPORTED_MODULE_12__/* .CreateBoxVertexData */ .KA)({ size: 1.0 });
        this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind] = new _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R(engine, boxdata.positions, _Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind, false);
        this._createIndexBuffer();
        this._fillIndexData = boxdata.indices;
        this.onResourcesReadyObservable.notifyObservers(this);
    }
    _createIndexBuffer() {
        const engine = this.scene.getEngine();
        this._indexBuffer = engine.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4]);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        const vb = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind];
        if (vb) {
            vb._rebuild();
        }
        this._createIndexBuffer();
    }
    /**
     * @internal
     */
    reset() {
        this.renderList.reset();
    }
    /**
     * Render the bounding boxes of a specific rendering group
     * @param renderingGroupId defines the rendering group to render
     */
    render(renderingGroupId) {
        if (this.renderList.length === 0 || !this.enabled) {
            return;
        }
        this._prepareResources();
        if (!this._colorShader.isReady()) {
            return;
        }
        const engine = this.scene.getEngine();
        engine.setDepthWrite(false);
        const transformMatrix = this.scene.getTransformMatrix();
        for (let boundingBoxIndex = 0; boundingBoxIndex < this.renderList.length; boundingBoxIndex++) {
            const boundingBox = this.renderList.data[boundingBoxIndex];
            if (boundingBox._tag !== renderingGroupId) {
                continue;
            }
            this._createWrappersForBoundingBox(boundingBox);
            this.onBeforeBoxRenderingObservable.notifyObservers(boundingBox);
            const min = boundingBox.minimum;
            const max = boundingBox.maximum;
            const diff = max.subtract(min);
            const median = min.add(diff.scale(0.5));
            const worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Scaling(diff.x, diff.y, diff.z)
                .multiply(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Translation(median.x, median.y, median.z))
                .multiply(boundingBox.getWorldMatrix());
            const useReverseDepthBuffer = engine.useReverseDepthBuffer;
            if (this.showBackLines) {
                const drawWrapperBack = boundingBox._drawWrapperBack ?? this._colorShader._getDrawWrapper();
                this._colorShader._preBind(drawWrapperBack);
                engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect());
                // Back
                if (useReverseDepthBuffer) {
                    engine.setDepthFunctionToLessOrEqual();
                }
                else {
                    engine.setDepthFunctionToGreaterOrEqual();
                }
                this._uniformBufferBack.bindToEffect(drawWrapperBack.effect, "BoundingBoxRenderer");
                this._uniformBufferBack.updateColor4("color", this.backColor, 1);
                this._uniformBufferBack.updateMatrix("world", worldMatrix);
                this._uniformBufferBack.updateMatrix("viewProjection", transformMatrix);
                this._uniformBufferBack.update();
                // Draw order
                engine.drawElementsType(_Materials_material_js__WEBPACK_IMPORTED_MODULE_6__/* .Material */ .i.LineListDrawMode, 0, 24);
            }
            const drawWrapperFront = boundingBox._drawWrapperFront ?? this._colorShader._getDrawWrapper();
            this._colorShader._preBind(drawWrapperFront);
            engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect());
            // Front
            if (useReverseDepthBuffer) {
                engine.setDepthFunctionToGreater();
            }
            else {
                engine.setDepthFunctionToLess();
            }
            this._uniformBufferFront.bindToEffect(drawWrapperFront.effect, "BoundingBoxRenderer");
            this._uniformBufferFront.updateColor4("color", this.frontColor, 1);
            this._uniformBufferFront.updateMatrix("world", worldMatrix);
            this._uniformBufferFront.updateMatrix("viewProjection", transformMatrix);
            this._uniformBufferFront.update();
            // Draw order
            engine.drawElementsType(_Materials_material_js__WEBPACK_IMPORTED_MODULE_6__/* .Material */ .i.LineListDrawMode, 0, 24);
            this.onAfterBoxRenderingObservable.notifyObservers(boundingBox);
        }
        this._colorShader.unbind();
        engine.setDepthFunctionToLessOrEqual();
        engine.setDepthWrite(true);
    }
    _createWrappersForBoundingBox(boundingBox) {
        if (!boundingBox._drawWrapperFront) {
            const engine = this.scene.getEngine();
            boundingBox._drawWrapperFront = new _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_10__/* .DrawWrapper */ .E(engine);
            boundingBox._drawWrapperBack = new _Materials_drawWrapper_js__WEBPACK_IMPORTED_MODULE_10__/* .DrawWrapper */ .E(engine);
            boundingBox._drawWrapperFront.setEffect(this._colorShader.getEffect());
            boundingBox._drawWrapperBack.setEffect(this._colorShader.getEffect());
        }
    }
    /**
     * In case of occlusion queries, we can render the occlusion bounding box through this method
     * @param mesh Define the mesh to render the occlusion bounding box for
     */
    renderOcclusionBoundingBox(mesh) {
        const engine = this.scene.getEngine();
        if (this._renderPassIdForOcclusionQuery === undefined) {
            this._renderPassIdForOcclusionQuery = engine.createRenderPassId(`Render pass for occlusion query`);
        }
        const currentRenderPassId = engine.currentRenderPassId;
        engine.currentRenderPassId = this._renderPassIdForOcclusionQuery;
        this._prepareResources();
        const subMesh = mesh.subMeshes[0];
        if (!this._colorShaderForOcclusionQuery.isReady(mesh, undefined, subMesh) || !mesh.hasBoundingInfo) {
            engine.currentRenderPassId = currentRenderPassId;
            return;
        }
        if (!this._fillIndexBuffer) {
            this._fillIndexBuffer = engine.createIndexBuffer(this._fillIndexData);
        }
        const useReverseDepthBuffer = engine.useReverseDepthBuffer;
        engine.setDepthWrite(false);
        engine.setColorWrite(false);
        const boundingBox = mesh.getBoundingInfo().boundingBox;
        const min = boundingBox.minimum;
        const max = boundingBox.maximum;
        const diff = max.subtract(min);
        const median = min.add(diff.scale(0.5));
        const worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Scaling(diff.x, diff.y, diff.z)
            .multiply(_Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_3__/* .Matrix */ .uq.Translation(median.x, median.y, median.z))
            .multiply(boundingBox.getWorldMatrix());
        const drawWrapper = subMesh._drawWrapper;
        this._colorShaderForOcclusionQuery._preBind(drawWrapper);
        engine.bindBuffers(this._vertexBuffers, this._fillIndexBuffer, drawWrapper.effect);
        if (useReverseDepthBuffer) {
            engine.setDepthFunctionToGreater();
        }
        else {
            engine.setDepthFunctionToLess();
        }
        this.scene.resetCachedMaterial();
        this._uniformBufferFront.bindToEffect(drawWrapper.effect, "BoundingBoxRenderer");
        this._uniformBufferFront.updateMatrix("world", worldMatrix);
        this._uniformBufferFront.updateMatrix("viewProjection", this.scene.getTransformMatrix());
        this._uniformBufferFront.update();
        engine.drawElementsType(_Materials_material_js__WEBPACK_IMPORTED_MODULE_6__/* .Material */ .i.TriangleFillMode, 0, 36);
        this._colorShaderForOcclusionQuery.unbind();
        engine.setDepthFunctionToLessOrEqual();
        engine.setDepthWrite(true);
        engine.setColorWrite(true);
        engine.currentRenderPassId = currentRenderPassId;
    }
    /**
     * Dispose and release the resources attached to this renderer.
     */
    dispose() {
        if (this._renderPassIdForOcclusionQuery !== undefined) {
            this.scene.getEngine().releaseRenderPassId(this._renderPassIdForOcclusionQuery);
            this._renderPassIdForOcclusionQuery = undefined;
        }
        if (!this._colorShader) {
            return;
        }
        this.onBeforeBoxRenderingObservable.clear();
        this.onAfterBoxRenderingObservable.clear();
        this.onResourcesReadyObservable.clear();
        this.renderList.dispose();
        this._colorShader.dispose();
        this._colorShaderForOcclusionQuery.dispose();
        this._uniformBufferFront.dispose();
        this._uniformBufferBack.dispose();
        const buffer = this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind];
        if (buffer) {
            buffer.dispose();
            this._vertexBuffers[_Buffers_buffer_js__WEBPACK_IMPORTED_MODULE_1__/* .VertexBuffer */ .R.PositionKind] = null;
        }
        this.scene.getEngine()._releaseBuffer(this._indexBuffer);
        if (this._fillIndexBuffer) {
            this.scene.getEngine()._releaseBuffer(this._fillIndexBuffer);
            this._fillIndexBuffer = null;
        }
    }
}
//# sourceMappingURL=boundingBoxRenderer.js.map

/***/ }),

/***/ 81283:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   P: () => (/* binding */ ObjectRenderer)
/* harmony export */ });
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99848);
/* harmony import */ var _Rendering_renderingManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15808);
/* harmony import */ var _Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27309);




/**
 * A class that renders objects to the currently bound render target.
 * This class only renders objects, and is not concerned with the output texture or post-processing.
 */
class ObjectRenderer {
    /**
     * Use this list to define the list of mesh you want to render.
     */
    get renderList() {
        return this._renderList;
    }
    set renderList(value) {
        if (this._renderList === value) {
            return;
        }
        if (this._unObserveRenderList) {
            this._unObserveRenderList();
            this._unObserveRenderList = null;
        }
        if (value) {
            this._unObserveRenderList = (0,_Misc_arrayTools_js__WEBPACK_IMPORTED_MODULE_2__/* ._ObserveArray */ .lL)(value, this._renderListHasChanged);
        }
        this._renderList = value;
    }
    /**
     * Gets the render pass ids used by the object renderer.
     */
    get renderPassIds() {
        return this._renderPassIds;
    }
    /**
     * Gets the current value of the refreshId counter
     */
    get currentRefreshId() {
        return this._currentRefreshId;
    }
    /**
     * Sets a specific material to be used to render a mesh/a list of meshes with this object renderer
     * @param mesh mesh or array of meshes
     * @param material material or array of materials to use for this render pass. If undefined is passed, no specific material will be used but the regular material instead (mesh.material). It's possible to provide an array of materials to use a different material for each rendering pass.
     */
    setMaterialForRendering(mesh, material) {
        let meshes;
        if (!Array.isArray(mesh)) {
            meshes = [mesh];
        }
        else {
            meshes = mesh;
        }
        for (let j = 0; j < meshes.length; ++j) {
            for (let i = 0; i < this.options.numPasses; ++i) {
                meshes[j].setMaterialForRenderPass(this._renderPassIds[i], material !== undefined ? (Array.isArray(material) ? material[i] : material) : undefined);
            }
        }
    }
    /**
     * Instantiates an object renderer.
     * @param name The friendly name of the object renderer
     * @param scene The scene the renderer belongs to
     * @param options The options used to create the renderer (optional)
     */
    constructor(name, scene, options) {
        this._unObserveRenderList = null;
        this._renderListHasChanged = (_functionName, previousLength) => {
            const newLength = this._renderList ? this._renderList.length : 0;
            if ((previousLength === 0 && newLength > 0) || newLength === 0) {
                this._scene.meshes.forEach((mesh) => {
                    mesh._markSubMeshesAsLightDirty();
                });
            }
        };
        /**
         * Define the list of particle systems to render. If not provided, will render all the particle systems of the scene.
         * Note that the particle systems are rendered only if renderParticles is set to true.
         */
        this.particleSystemList = null;
        /**
         * Use this function to overload the renderList array at rendering time.
         * Return null to render with the current renderList, else return the list of meshes to use for rendering.
         * For 2DArray, layerOrFace is the index of the layer that is going to be rendered, else it is the faceIndex of
         * the cube (if the RTT is a cube, else layerOrFace=0).
         * The renderList passed to the function is the current render list (the one that will be used if the function returns null).
         * The length of this list is passed through renderListLength: don't use renderList.length directly because the array can
         * hold dummy elements!
         */
        this.getCustomRenderList = null;
        /**
         * Define if particles should be rendered.
         */
        this.renderParticles = true;
        /**
         * Define if sprites should be rendered.
         */
        this.renderSprites = false;
        /**
         * Force checking the layerMask property even if a custom list of meshes is provided (ie. if renderList is not undefined)
         */
        this.forceLayerMaskCheck = false;
        /**
         * An event triggered before rendering the objects
         */
        this.onBeforeRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * An event triggered after rendering the objects
         */
        this.onAfterRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * An event triggered before the rendering group is processed
         */
        this.onBeforeRenderingManagerRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * An event triggered after the rendering group is processed
         */
        this.onAfterRenderingManagerRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        /**
         * An event triggered when fast path rendering is used
         */
        this.onFastPathRenderObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_0__/* .Observable */ .cP();
        this._currentRefreshId = -1;
        this._refreshRate = 1;
        this._currentSceneCamera = null;
        this.name = name;
        this._scene = scene;
        this.renderList = [];
        this._renderPassIds = [];
        this.options = {
            numPasses: 1,
            doNotChangeAspectRatio: true,
            ...options,
        };
        this._createRenderPassId();
        this.renderPassId = this._renderPassIds[0];
        // Rendering groups
        this._renderingManager = new _Rendering_renderingManager_js__WEBPACK_IMPORTED_MODULE_1__/* .RenderingManager */ .m(scene);
        this._renderingManager._useSceneAutoClearSetup = true;
    }
    _releaseRenderPassId() {
        const engine = this._scene.getEngine();
        for (let i = 0; i < this.options.numPasses; ++i) {
            engine.releaseRenderPassId(this._renderPassIds[i]);
        }
        this._renderPassIds.length = 0;
    }
    _createRenderPassId() {
        this._releaseRenderPassId();
        const engine = this._scene.getEngine();
        for (let i = 0; i < this.options.numPasses; ++i) {
            this._renderPassIds[i] = engine.createRenderPassId(`ObjectRenderer - ${this.name}#${i}`);
        }
    }
    /**
     * Resets the refresh counter of the renderer and start back from scratch.
     * Could be useful to re-render if it is setup to render only once.
     */
    resetRefreshCounter() {
        this._currentRefreshId = -1;
    }
    /**
     * Defines the refresh rate of the rendering or the rendering frequency.
     * Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...
     */
    get refreshRate() {
        return this._refreshRate;
    }
    set refreshRate(value) {
        this._refreshRate = value;
        this.resetRefreshCounter();
    }
    /**
     * Indicates if the renderer should render the current frame.
     * The output is based on the specified refresh rate.
     * @returns true if the renderer should render the current frame
     */
    shouldRender() {
        if (this._currentRefreshId === -1) {
            // At least render once
            this._currentRefreshId = 1;
            return true;
        }
        if (this.refreshRate === this._currentRefreshId) {
            this._currentRefreshId = 1;
            return true;
        }
        this._currentRefreshId++;
        return false;
    }
    /**
     * This function will check if the renderer is ready to render (textures are loaded, shaders are compiled)
     * @param viewportWidth defines the width of the viewport
     * @param viewportHeight defines the height of the viewport
     * @returns true if all required resources are ready
     */
    isReadyForRendering(viewportWidth, viewportHeight) {
        this.prepareRenderList();
        this.initRender(viewportWidth, viewportHeight);
        const isReady = this._checkReadiness();
        this.finishRender();
        return isReady;
    }
    /**
     * Makes sure the list of meshes is ready to be rendered
     * You should call this function before "initRender", but if you know the render list is ok, you may call "initRender" directly
     */
    prepareRenderList() {
        const scene = this._scene;
        if (this._waitingRenderList) {
            if (!this.renderListPredicate) {
                this.renderList = [];
                for (let index = 0; index < this._waitingRenderList.length; index++) {
                    const id = this._waitingRenderList[index];
                    const mesh = scene.getMeshById(id);
                    if (mesh) {
                        this.renderList.push(mesh);
                    }
                }
            }
            this._waitingRenderList = undefined;
        }
        // Is predicate defined?
        if (this.renderListPredicate) {
            if (this.renderList) {
                this.renderList.length = 0; // Clear previous renderList
            }
            else {
                this.renderList = [];
            }
            const sceneMeshes = this._scene.meshes;
            for (let index = 0; index < sceneMeshes.length; index++) {
                const mesh = sceneMeshes[index];
                if (this.renderListPredicate(mesh)) {
                    this.renderList.push(mesh);
                }
            }
        }
    }
    /**
     * This method makes sure everything is setup before "render" can be called
     * @param viewportWidth Width of the viewport to render to
     * @param viewportHeight Height of the viewport to render to
     */
    initRender(viewportWidth, viewportHeight) {
        const engine = this._scene.getEngine();
        const camera = this.activeCamera ?? this._scene.activeCamera;
        this._currentSceneCamera = this._scene.activeCamera;
        if (camera) {
            if (camera !== this._scene.activeCamera) {
                this._scene.setTransformMatrix(camera.getViewMatrix(), camera.getProjectionMatrix(true));
                this._scene.activeCamera = camera;
            }
            engine.setViewport(camera.rigParent ? camera.rigParent.viewport : camera.viewport, viewportWidth, viewportHeight);
        }
        this._defaultRenderListPrepared = false;
    }
    /**
     * This method must be called after the "render" call(s), to complete the rendering process.
     */
    finishRender() {
        const scene = this._scene;
        scene.activeCamera = this._currentSceneCamera;
        if (this._currentSceneCamera) {
            if (this.activeCamera && this.activeCamera !== scene.activeCamera) {
                scene.setTransformMatrix(this._currentSceneCamera.getViewMatrix(), this._currentSceneCamera.getProjectionMatrix(true));
            }
            scene.getEngine().setViewport(this._currentSceneCamera.viewport);
        }
        scene.resetCachedMaterial();
    }
    /**
     * Renders all the objects (meshes, particles systems, sprites) to the currently bound render target texture.
     * @param passIndex defines the pass index to use (default: 0)
     * @param skipOnAfterRenderObservable defines a flag to skip raising the onAfterRenderObservable
     */
    render(passIndex = 0, skipOnAfterRenderObservable = false) {
        const scene = this._scene;
        const engine = scene.getEngine();
        const currentRenderPassId = engine.currentRenderPassId;
        engine.currentRenderPassId = this._renderPassIds[passIndex];
        this.onBeforeRenderObservable.notifyObservers(passIndex);
        const fastPath = engine.snapshotRendering && engine.snapshotRenderingMode === 1;
        if (!fastPath) {
            // Get the list of meshes to render
            let currentRenderList = null;
            const defaultRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data;
            const defaultRenderListLength = this.renderList ? this.renderList.length : scene.getActiveMeshes().length;
            if (this.getCustomRenderList) {
                currentRenderList = this.getCustomRenderList(passIndex, defaultRenderList, defaultRenderListLength);
            }
            if (!currentRenderList) {
                // No custom render list provided, we prepare the rendering for the default list, but check
                // first if we did not already performed the preparation before so as to avoid re-doing it several times
                if (!this._defaultRenderListPrepared) {
                    this._prepareRenderingManager(defaultRenderList, defaultRenderListLength, !this.renderList || this.forceLayerMaskCheck);
                    this._defaultRenderListPrepared = true;
                }
                currentRenderList = defaultRenderList;
            }
            else {
                // Prepare the rendering for the custom render list provided
                this._prepareRenderingManager(currentRenderList, currentRenderList.length, this.forceLayerMaskCheck);
            }
            this.onBeforeRenderingManagerRenderObservable.notifyObservers(passIndex);
            this._renderingManager.render(this.customRenderFunction, currentRenderList, this.renderParticles, this.renderSprites);
            this.onAfterRenderingManagerRenderObservable.notifyObservers(passIndex);
        }
        else {
            this.onFastPathRenderObservable.notifyObservers(passIndex);
        }
        if (!skipOnAfterRenderObservable) {
            this.onAfterRenderObservable.notifyObservers(passIndex);
        }
        engine.currentRenderPassId = currentRenderPassId;
    }
    /** @internal */
    _checkReadiness() {
        const scene = this._scene;
        const engine = scene.getEngine();
        const currentRenderPassId = engine.currentRenderPassId;
        let returnValue = true;
        if (!scene.getViewMatrix()) {
            // We probably didn't execute scene.render() yet, so make sure we have a view/projection matrix setup for the scene
            scene.updateTransformMatrix();
        }
        const numPasses = this.options.numPasses;
        for (let passIndex = 0; passIndex < numPasses && returnValue; passIndex++) {
            let currentRenderList = null;
            const defaultRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data;
            const defaultRenderListLength = this.renderList ? this.renderList.length : scene.getActiveMeshes().length;
            engine.currentRenderPassId = this._renderPassIds[passIndex];
            this.onBeforeRenderObservable.notifyObservers(passIndex);
            if (this.getCustomRenderList) {
                currentRenderList = this.getCustomRenderList(passIndex, defaultRenderList, defaultRenderListLength);
            }
            if (!currentRenderList) {
                currentRenderList = defaultRenderList;
            }
            if (!this._doNotChangeAspectRatio) {
                scene.updateTransformMatrix(true);
            }
            for (let i = 0; i < currentRenderList.length && returnValue; ++i) {
                const mesh = currentRenderList[i];
                if (!mesh.isEnabled() || mesh.isBlocked || !mesh.isVisible || !mesh.subMeshes) {
                    continue;
                }
                if (this.customIsReadyFunction) {
                    if (!this.customIsReadyFunction(mesh, this.refreshRate, true)) {
                        returnValue = false;
                        continue;
                    }
                }
                else if (!mesh.isReady(true)) {
                    returnValue = false;
                    continue;
                }
            }
            this.onAfterRenderObservable.notifyObservers(passIndex);
            if (numPasses > 1) {
                scene.incrementRenderId();
                scene.resetCachedMaterial();
            }
        }
        const particleSystems = this.particleSystemList || scene.particleSystems;
        for (const particleSystem of particleSystems) {
            if (!particleSystem.isReady()) {
                returnValue = false;
            }
        }
        engine.currentRenderPassId = currentRenderPassId;
        return returnValue;
    }
    _prepareRenderingManager(currentRenderList, currentRenderListLength, checkLayerMask) {
        const scene = this._scene;
        const camera = scene.activeCamera;
        this._renderingManager.reset();
        const sceneRenderId = scene.getRenderId();
        for (let meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) {
            const mesh = currentRenderList[meshIndex];
            if (mesh && !mesh.isBlocked) {
                if (this.customIsReadyFunction) {
                    if (!this.customIsReadyFunction(mesh, this.refreshRate, false)) {
                        this.resetRefreshCounter();
                        continue;
                    }
                }
                else if (!mesh.isReady(this.refreshRate === 0)) {
                    this.resetRefreshCounter();
                    continue;
                }
                if (!mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate && camera) {
                    mesh._internalAbstractMeshDataInfo._currentLOD = scene.customLODSelector ? scene.customLODSelector(mesh, camera) : mesh.getLOD(camera);
                    mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate = true;
                }
                if (!mesh._internalAbstractMeshDataInfo._currentLOD) {
                    continue;
                }
                let meshToRender = mesh._internalAbstractMeshDataInfo._currentLOD;
                if (meshToRender !== mesh && meshToRender.billboardMode !== 0) {
                    meshToRender.computeWorldMatrix(); // Compute world matrix if LOD is billboard
                }
                meshToRender._preActivateForIntermediateRendering(sceneRenderId);
                let isMasked;
                if (checkLayerMask && camera) {
                    isMasked = (mesh.layerMask & camera.layerMask) === 0;
                }
                else {
                    isMasked = false;
                }
                if (mesh.isEnabled() && mesh.isVisible && mesh.subMeshes && !isMasked) {
                    if (meshToRender !== mesh) {
                        meshToRender._activate(sceneRenderId, true);
                    }
                    if (mesh._activate(sceneRenderId, true) && mesh.subMeshes.length) {
                        if (!mesh.isAnInstance) {
                            meshToRender._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = false;
                        }
                        else {
                            if (mesh._internalAbstractMeshDataInfo._actAsRegularMesh) {
                                meshToRender = mesh;
                            }
                        }
                        meshToRender._internalAbstractMeshDataInfo._isActiveIntermediate = true;
                        scene._prepareSkeleton(meshToRender);
                        for (let subIndex = 0; subIndex < meshToRender.subMeshes.length; subIndex++) {
                            const subMesh = meshToRender.subMeshes[subIndex];
                            this._renderingManager.dispatch(subMesh, meshToRender);
                        }
                    }
                    mesh._postActivate();
                }
            }
        }
        const particleSystems = this.particleSystemList || scene.particleSystems;
        for (let particleIndex = 0; particleIndex < particleSystems.length; particleIndex++) {
            const particleSystem = particleSystems[particleIndex];
            const emitter = particleSystem.emitter;
            if (!particleSystem.isStarted() || !emitter || (emitter.position && !emitter.isEnabled())) {
                continue;
            }
            this._renderingManager.dispatchParticles(particleSystem);
        }
    }
    /**
     * Overrides the default sort function applied in the rendering group to prepare the meshes.
     * This allowed control for front to back rendering or reversely depending of the special needs.
     *
     * @param renderingGroupId The rendering group id corresponding to its index
     * @param opaqueSortCompareFn The opaque queue comparison function use to sort.
     * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
     * @param transparentSortCompareFn The transparent queue comparison function use to sort.
     */
    setRenderingOrder(renderingGroupId, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {
        this._renderingManager.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn);
    }
    /**
     * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
     *
     * @param renderingGroupId The rendering group id corresponding to its index
     * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
     */
    setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil) {
        this._renderingManager.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil);
        this._renderingManager._useSceneAutoClearSetup = false;
    }
    /**
     * Clones the renderer.
     * @returns the cloned renderer
     */
    clone() {
        const newRenderer = new ObjectRenderer(this.name, this._scene, this.options);
        if (this.renderList) {
            newRenderer.renderList = this.renderList.slice(0);
        }
        return newRenderer;
    }
    /**
     * Dispose the renderer and release its associated resources.
     */
    dispose() {
        this.onBeforeRenderObservable.clear();
        this.onAfterRenderObservable.clear();
        this.onBeforeRenderingManagerRenderObservable.clear();
        this.onAfterRenderingManagerRenderObservable.clear();
        this.onFastPathRenderObservable.clear();
        this._releaseRenderPassId();
        this.renderList = null;
    }
    /** @internal */
    _rebuild() {
        if (this.refreshRate === ObjectRenderer.REFRESHRATE_RENDER_ONCE) {
            this.refreshRate = ObjectRenderer.REFRESHRATE_RENDER_ONCE;
        }
    }
    /**
     * Clear the info related to rendering groups preventing retention point in material dispose.
     */
    freeRenderingGroups() {
        if (this._renderingManager) {
            this._renderingManager.freeRenderingGroups();
        }
    }
}
/**
 * Objects will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
 */
ObjectRenderer.REFRESHRATE_RENDER_ONCE = 0;
/**
 * Objects will be rendered every frame and is recommended for dynamic contents.
 */
ObjectRenderer.REFRESHRATE_RENDER_ONEVERYFRAME = 1;
/**
 * Objects will be rendered every 2 frames which could be enough if your dynamic objects are not
 * the central point of your effect and can save a lot of performances.
 */
ObjectRenderer.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = 2;
//# sourceMappingURL=objectRenderer.js.map

/***/ }),

/***/ 11628:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   U: () => (/* binding */ RenderingGroup)
/* harmony export */ });
/* harmony import */ var _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17931);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);



/**
 * This represents the object necessary to create a rendering group.
 * This is exclusively used and created by the rendering manager.
 * To modify the behavior, you use the available helpers in your scene or meshes.
 * @internal
 */
class RenderingGroup {
    /**
     * Set the opaque sort comparison function.
     * If null the sub meshes will be render in the order they were created
     */
    set opaqueSortCompareFn(value) {
        if (value) {
            this._opaqueSortCompareFn = value;
        }
        else {
            this._opaqueSortCompareFn = RenderingGroup.PainterSortCompare;
        }
        this._renderOpaque = this._renderOpaqueSorted;
    }
    /**
     * Set the alpha test sort comparison function.
     * If null the sub meshes will be render in the order they were created
     */
    set alphaTestSortCompareFn(value) {
        if (value) {
            this._alphaTestSortCompareFn = value;
        }
        else {
            this._alphaTestSortCompareFn = RenderingGroup.PainterSortCompare;
        }
        this._renderAlphaTest = this._renderAlphaTestSorted;
    }
    /**
     * Set the transparent sort comparison function.
     * If null the sub meshes will be render in the order they were created
     */
    set transparentSortCompareFn(value) {
        if (value) {
            this._transparentSortCompareFn = value;
        }
        else {
            this._transparentSortCompareFn = RenderingGroup.defaultTransparentSortCompare;
        }
        this._renderTransparent = this._renderTransparentSorted;
    }
    /**
     * Creates a new rendering group.
     * @param index The rendering group index
     * @param scene
     * @param opaqueSortCompareFn The opaque sort comparison function. If null no order is applied
     * @param alphaTestSortCompareFn The alpha test sort comparison function. If null no order is applied
     * @param transparentSortCompareFn The transparent sort comparison function. If null back to front + alpha index sort is applied
     */
    constructor(index, scene, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {
        this.index = index;
        this._opaqueSubMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .L(256);
        this._transparentSubMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .L(256);
        this._alphaTestSubMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .L(256);
        this._depthOnlySubMeshes = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .L(256);
        this._particleSystems = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .L(256);
        this._spriteManagers = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArray */ .L(256);
        /** @internal */
        this._empty = true;
        /** @internal */
        this._edgesRenderers = new _Misc_smartArray_js__WEBPACK_IMPORTED_MODULE_0__/* .SmartArrayNoDuplicate */ .b(16);
        this._scene = scene;
        this.opaqueSortCompareFn = opaqueSortCompareFn;
        this.alphaTestSortCompareFn = alphaTestSortCompareFn;
        this.transparentSortCompareFn = transparentSortCompareFn;
    }
    /**
     * Render all the sub meshes contained in the group.
     * @param customRenderFunction Used to override the default render behaviour of the group.
     * @param renderSprites
     * @param renderParticles
     * @param activeMeshes
     */
    render(customRenderFunction, renderSprites, renderParticles, activeMeshes) {
        if (customRenderFunction) {
            customRenderFunction(this._opaqueSubMeshes, this._alphaTestSubMeshes, this._transparentSubMeshes, this._depthOnlySubMeshes);
            return;
        }
        const engine = this._scene.getEngine();
        // Depth only
        if (this._depthOnlySubMeshes.length !== 0) {
            engine.setColorWrite(false);
            this._renderAlphaTest(this._depthOnlySubMeshes);
            engine.setColorWrite(true);
        }
        // Opaque
        if (this._opaqueSubMeshes.length !== 0) {
            this._renderOpaque(this._opaqueSubMeshes);
        }
        // Alpha test
        if (this._alphaTestSubMeshes.length !== 0) {
            this._renderAlphaTest(this._alphaTestSubMeshes);
        }
        const stencilState = engine.getStencilBuffer();
        engine.setStencilBuffer(false);
        // Sprites
        if (renderSprites) {
            this._renderSprites();
        }
        // Particles
        if (renderParticles) {
            this._renderParticles(activeMeshes);
        }
        if (this.onBeforeTransparentRendering) {
            this.onBeforeTransparentRendering();
        }
        // Transparent
        if (this._transparentSubMeshes.length !== 0 || this._scene.useOrderIndependentTransparency) {
            engine.setStencilBuffer(stencilState);
            if (this._scene.useOrderIndependentTransparency) {
                const excludedMeshes = this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);
                if (excludedMeshes.length) {
                    // Render leftover meshes that could not be processed by depth peeling
                    this._renderTransparent(excludedMeshes);
                }
            }
            else {
                this._renderTransparent(this._transparentSubMeshes);
            }
            engine.setAlphaMode(0);
        }
        // Set back stencil to false in case it changes before the edge renderer.
        engine.setStencilBuffer(false);
        // Edges
        if (this._edgesRenderers.length) {
            for (let edgesRendererIndex = 0; edgesRendererIndex < this._edgesRenderers.length; edgesRendererIndex++) {
                this._edgesRenderers.data[edgesRendererIndex].render();
            }
            engine.setAlphaMode(0);
        }
        // Restore Stencil state.
        engine.setStencilBuffer(stencilState);
    }
    /**
     * Renders the opaque submeshes in the order from the opaqueSortCompareFn.
     * @param subMeshes The submeshes to render
     */
    _renderOpaqueSorted(subMeshes) {
        RenderingGroup._RenderSorted(subMeshes, this._opaqueSortCompareFn, this._scene.activeCamera, false);
    }
    /**
     * Renders the opaque submeshes in the order from the alphatestSortCompareFn.
     * @param subMeshes The submeshes to render
     */
    _renderAlphaTestSorted(subMeshes) {
        RenderingGroup._RenderSorted(subMeshes, this._alphaTestSortCompareFn, this._scene.activeCamera, false);
    }
    /**
     * Renders the opaque submeshes in the order from the transparentSortCompareFn.
     * @param subMeshes The submeshes to render
     */
    _renderTransparentSorted(subMeshes) {
        RenderingGroup._RenderSorted(subMeshes, this._transparentSortCompareFn, this._scene.activeCamera, true);
    }
    /**
     * Renders the submeshes in a specified order.
     * @param subMeshes The submeshes to sort before render
     * @param sortCompareFn The comparison function use to sort
     * @param camera The camera position use to preprocess the submeshes to help sorting
     * @param transparent Specifies to activate blending if true
     */
    static _RenderSorted(subMeshes, sortCompareFn, camera, transparent) {
        let subIndex = 0;
        let subMesh;
        const cameraPosition = camera ? camera.globalPosition : RenderingGroup._ZeroVector;
        if (transparent) {
            for (; subIndex < subMeshes.length; subIndex++) {
                subMesh = subMeshes.data[subIndex];
                subMesh._alphaIndex = subMesh.getMesh().alphaIndex;
                subMesh._distanceToCamera = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Distance(subMesh.getBoundingInfo().boundingSphere.centerWorld, cameraPosition);
            }
        }
        const sortedArray = subMeshes.length === subMeshes.data.length ? subMeshes.data : subMeshes.data.slice(0, subMeshes.length);
        if (sortCompareFn) {
            sortedArray.sort(sortCompareFn);
        }
        const scene = sortedArray[0].getMesh().getScene();
        for (subIndex = 0; subIndex < sortedArray.length; subIndex++) {
            subMesh = sortedArray[subIndex];
            if (scene._activeMeshesFrozenButKeepClipping && !subMesh.isInFrustum(scene._frustumPlanes)) {
                continue;
            }
            if (transparent) {
                const material = subMesh.getMaterial();
                if (material && material.needDepthPrePass) {
                    const engine = material.getScene().getEngine();
                    engine.setColorWrite(false);
                    engine.setAlphaMode(0);
                    subMesh.render(false);
                    engine.setColorWrite(true);
                }
            }
            subMesh.render(transparent);
        }
    }
    /**
     * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
     * are rendered back to front if in the same alpha index.
     *
     * @param a The first submesh
     * @param b The second submesh
     * @returns The result of the comparison
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static defaultTransparentSortCompare(a, b) {
        // Alpha index first
        if (a._alphaIndex > b._alphaIndex) {
            return 1;
        }
        if (a._alphaIndex < b._alphaIndex) {
            return -1;
        }
        // Then distance to camera
        return RenderingGroup.backToFrontSortCompare(a, b);
    }
    /**
     * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
     * are rendered back to front.
     *
     * @param a The first submesh
     * @param b The second submesh
     * @returns The result of the comparison
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static backToFrontSortCompare(a, b) {
        // Then distance to camera
        if (a._distanceToCamera < b._distanceToCamera) {
            return 1;
        }
        if (a._distanceToCamera > b._distanceToCamera) {
            return -1;
        }
        return 0;
    }
    /**
     * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
     * are rendered front to back (prevent overdraw).
     *
     * @param a The first submesh
     * @param b The second submesh
     * @returns The result of the comparison
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static frontToBackSortCompare(a, b) {
        // Then distance to camera
        if (a._distanceToCamera < b._distanceToCamera) {
            return -1;
        }
        if (a._distanceToCamera > b._distanceToCamera) {
            return 1;
        }
        return 0;
    }
    /**
     * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
     * are grouped by material then geometry.
     *
     * @param a The first submesh
     * @param b The second submesh
     * @returns The result of the comparison
     */
    static PainterSortCompare(a, b) {
        const meshA = a.getMesh();
        const meshB = b.getMesh();
        if (meshA.material && meshB.material) {
            return meshA.material.uniqueId - meshB.material.uniqueId;
        }
        return meshA.uniqueId - meshB.uniqueId;
    }
    /**
     * Resets the different lists of submeshes to prepare a new frame.
     */
    prepare() {
        this._opaqueSubMeshes.reset();
        this._transparentSubMeshes.reset();
        this._alphaTestSubMeshes.reset();
        this._depthOnlySubMeshes.reset();
        this._particleSystems.reset();
        this.prepareSprites();
        this._edgesRenderers.reset();
        this._empty = true;
    }
    /**
     * Resets the different lists of sprites to prepare a new frame.
     */
    prepareSprites() {
        this._spriteManagers.reset();
    }
    dispose() {
        this._opaqueSubMeshes.dispose();
        this._transparentSubMeshes.dispose();
        this._alphaTestSubMeshes.dispose();
        this._depthOnlySubMeshes.dispose();
        this._particleSystems.dispose();
        this._spriteManagers.dispose();
        this._edgesRenderers.dispose();
    }
    /**
     * Inserts the submesh in its correct queue depending on its material.
     * @param subMesh The submesh to dispatch
     * @param [mesh] Optional reference to the submeshes's mesh. Provide if you have an exiting reference to improve performance.
     * @param [material] Optional reference to the submeshes's material. Provide if you have an exiting reference to improve performance.
     */
    dispatch(subMesh, mesh, material) {
        // Get mesh and materials if not provided
        if (mesh === undefined) {
            mesh = subMesh.getMesh();
        }
        if (material === undefined) {
            material = subMesh.getMaterial();
        }
        if (material === null || material === undefined) {
            return;
        }
        if (material.needAlphaBlendingForMesh(mesh)) {
            // Transparent
            this._transparentSubMeshes.push(subMesh);
        }
        else if (material.needAlphaTesting()) {
            // Alpha test
            if (material.needDepthPrePass) {
                this._depthOnlySubMeshes.push(subMesh);
            }
            this._alphaTestSubMeshes.push(subMesh);
        }
        else {
            if (material.needDepthPrePass) {
                this._depthOnlySubMeshes.push(subMesh);
            }
            this._opaqueSubMeshes.push(subMesh); // Opaque
        }
        mesh._renderingGroup = this;
        if (mesh._edgesRenderer && mesh.isEnabled() && mesh.isVisible && mesh._edgesRenderer.isEnabled) {
            this._edgesRenderers.pushNoDuplicate(mesh._edgesRenderer);
        }
        this._empty = false;
    }
    dispatchSprites(spriteManager) {
        this._spriteManagers.push(spriteManager);
        this._empty = false;
    }
    dispatchParticles(particleSystem) {
        this._particleSystems.push(particleSystem);
        this._empty = false;
    }
    _renderParticles(activeMeshes) {
        if (this._particleSystems.length === 0) {
            return;
        }
        // Particles
        const activeCamera = this._scene.activeCamera;
        this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);
        for (let particleIndex = 0; particleIndex < this._particleSystems.length; particleIndex++) {
            const particleSystem = this._particleSystems.data[particleIndex];
            if ((activeCamera && activeCamera.layerMask & particleSystem.layerMask) === 0) {
                continue;
            }
            const emitter = particleSystem.emitter;
            if (!emitter.position || !activeMeshes || activeMeshes.indexOf(emitter) !== -1) {
                this._scene._activeParticles.addCount(particleSystem.render(), false);
            }
        }
        this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene);
    }
    _renderSprites() {
        if (!this._scene.spritesEnabled || this._spriteManagers.length === 0) {
            return;
        }
        // Sprites
        const activeCamera = this._scene.activeCamera;
        this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);
        for (let id = 0; id < this._spriteManagers.length; id++) {
            const spriteManager = this._spriteManagers.data[id];
            if ((activeCamera && activeCamera.layerMask & spriteManager.layerMask) !== 0) {
                spriteManager.render();
            }
        }
        this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene);
    }
}
RenderingGroup._ZeroVector = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.Zero();
//# sourceMappingURL=renderingGroup.js.map

/***/ }),

/***/ 15808:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   m: () => (/* binding */ RenderingManager),
/* harmony export */   o: () => (/* binding */ RenderingGroupInfo)
/* harmony export */ });
/* harmony import */ var _renderingGroup_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11628);

/**
 * This class is used by the onRenderingGroupObservable
 */
class RenderingGroupInfo {
}
/**
 * This is the manager responsible of all the rendering for meshes sprites and particles.
 * It is enable to manage the different groups as well as the different necessary sort functions.
 * This should not be used directly aside of the few static configurations
 */
class RenderingManager {
    /**
     * Gets or sets a boolean indicating that the manager will not reset between frames.
     * This means that if a mesh becomes invisible or transparent it will not be visible until this boolean is set to false again.
     * By default, the rendering manager will dispatch all active meshes per frame (moving them to the transparent, opaque or alpha testing lists).
     * By turning this property on, you will accelerate the rendering by keeping all these lists unchanged between frames.
     */
    get maintainStateBetweenFrames() {
        return this._maintainStateBetweenFrames;
    }
    set maintainStateBetweenFrames(value) {
        if (value === this._maintainStateBetweenFrames) {
            return;
        }
        this._maintainStateBetweenFrames = value;
        if (!this._maintainStateBetweenFrames) {
            this.restoreDispachedFlags();
        }
    }
    /**
     * Restore wasDispatched flags on the lists of elements to render.
     */
    restoreDispachedFlags() {
        for (const mesh of this._scene.meshes) {
            if (mesh.subMeshes) {
                for (const subMesh of mesh.subMeshes) {
                    subMesh._wasDispatched = false;
                }
            }
        }
        if (this._scene.spriteManagers) {
            for (const spriteManager of this._scene.spriteManagers) {
                spriteManager._wasDispatched = false;
            }
        }
        for (const particleSystem of this._scene.particleSystems) {
            particleSystem._wasDispatched = false;
        }
    }
    /**
     * Instantiates a new rendering group for a particular scene
     * @param scene Defines the scene the groups belongs to
     */
    constructor(scene) {
        /**
         * @internal
         */
        this._useSceneAutoClearSetup = false;
        this._renderingGroups = new Array();
        this._autoClearDepthStencil = {};
        this._customOpaqueSortCompareFn = {};
        this._customAlphaTestSortCompareFn = {};
        this._customTransparentSortCompareFn = {};
        this._renderingGroupInfo = new RenderingGroupInfo();
        this._maintainStateBetweenFrames = false;
        this._scene = scene;
        for (let i = RenderingManager.MIN_RENDERINGGROUPS; i < RenderingManager.MAX_RENDERINGGROUPS; i++) {
            this._autoClearDepthStencil[i] = { autoClear: true, depth: true, stencil: true };
        }
    }
    /**
     * @returns the rendering group with the specified id.
     * @param id the id of the rendering group (0 by default)
     */
    getRenderingGroup(id) {
        const renderingGroupId = id || 0;
        this._prepareRenderingGroup(renderingGroupId);
        return this._renderingGroups[renderingGroupId];
    }
    _clearDepthStencilBuffer(depth = true, stencil = true) {
        if (this._depthStencilBufferAlreadyCleaned) {
            return;
        }
        this._scene.getEngine().clear(null, false, depth, stencil);
        this._depthStencilBufferAlreadyCleaned = true;
    }
    /**
     * Renders the entire managed groups. This is used by the scene or the different render targets.
     * @internal
     */
    render(customRenderFunction, activeMeshes, renderParticles, renderSprites) {
        // Update the observable context (not null as it only goes away on dispose)
        const info = this._renderingGroupInfo;
        info.scene = this._scene;
        info.camera = this._scene.activeCamera;
        // Dispatch sprites
        if (this._scene.spriteManagers && renderSprites) {
            for (let index = 0; index < this._scene.spriteManagers.length; index++) {
                const manager = this._scene.spriteManagers[index];
                this.dispatchSprites(manager);
            }
        }
        // Render
        for (let index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {
            this._depthStencilBufferAlreadyCleaned = index === RenderingManager.MIN_RENDERINGGROUPS;
            const renderingGroup = this._renderingGroups[index];
            if (!renderingGroup || renderingGroup._empty) {
                continue;
            }
            const renderingGroupMask = 1 << index;
            info.renderingGroupId = index;
            // Before Observable
            this._scene.onBeforeRenderingGroupObservable.notifyObservers(info, renderingGroupMask);
            // Clear depth/stencil if needed
            if (RenderingManager.AUTOCLEAR) {
                const autoClear = this._useSceneAutoClearSetup ? this._scene.getAutoClearDepthStencilSetup(index) : this._autoClearDepthStencil[index];
                if (autoClear && autoClear.autoClear) {
                    this._clearDepthStencilBuffer(autoClear.depth, autoClear.stencil);
                }
            }
            // Render
            for (const step of this._scene._beforeRenderingGroupDrawStage) {
                step.action(index);
            }
            renderingGroup.render(customRenderFunction, renderSprites, renderParticles, activeMeshes);
            for (const step of this._scene._afterRenderingGroupDrawStage) {
                step.action(index);
            }
            // After Observable
            this._scene.onAfterRenderingGroupObservable.notifyObservers(info, renderingGroupMask);
        }
    }
    /**
     * Resets the different information of the group to prepare a new frame
     * @internal
     */
    reset() {
        if (this.maintainStateBetweenFrames) {
            return;
        }
        for (let index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {
            const renderingGroup = this._renderingGroups[index];
            if (renderingGroup) {
                renderingGroup.prepare();
            }
        }
    }
    /**
     * Resets the sprites information of the group to prepare a new frame
     * @internal
     */
    resetSprites() {
        if (this.maintainStateBetweenFrames) {
            return;
        }
        for (let index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {
            const renderingGroup = this._renderingGroups[index];
            if (renderingGroup) {
                renderingGroup.prepareSprites();
            }
        }
    }
    /**
     * Dispose and release the group and its associated resources.
     * @internal
     */
    dispose() {
        this.freeRenderingGroups();
        this._renderingGroups.length = 0;
        this._renderingGroupInfo = null;
    }
    /**
     * Clear the info related to rendering groups preventing retention points during dispose.
     */
    freeRenderingGroups() {
        for (let index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {
            const renderingGroup = this._renderingGroups[index];
            if (renderingGroup) {
                renderingGroup.dispose();
            }
        }
    }
    _prepareRenderingGroup(renderingGroupId) {
        if (this._renderingGroups[renderingGroupId] === undefined) {
            this._renderingGroups[renderingGroupId] = new _renderingGroup_js__WEBPACK_IMPORTED_MODULE_0__/* .RenderingGroup */ .U(renderingGroupId, this._scene, this._customOpaqueSortCompareFn[renderingGroupId], this._customAlphaTestSortCompareFn[renderingGroupId], this._customTransparentSortCompareFn[renderingGroupId]);
        }
    }
    /**
     * Add a sprite manager to the rendering manager in order to render it this frame.
     * @param spriteManager Define the sprite manager to render
     */
    dispatchSprites(spriteManager) {
        if (this.maintainStateBetweenFrames && spriteManager._wasDispatched) {
            return;
        }
        spriteManager._wasDispatched = true;
        this.getRenderingGroup(spriteManager.renderingGroupId).dispatchSprites(spriteManager);
    }
    /**
     * Add a particle system to the rendering manager in order to render it this frame.
     * @param particleSystem Define the particle system to render
     */
    dispatchParticles(particleSystem) {
        if (this.maintainStateBetweenFrames && particleSystem._wasDispatched) {
            return;
        }
        particleSystem._wasDispatched = true;
        this.getRenderingGroup(particleSystem.renderingGroupId).dispatchParticles(particleSystem);
    }
    /**
     * Add a submesh to the manager in order to render it this frame
     * @param subMesh The submesh to dispatch
     * @param mesh Optional reference to the submeshes's mesh. Provide if you have an exiting reference to improve performance.
     * @param material Optional reference to the submeshes's material. Provide if you have an exiting reference to improve performance.
     */
    dispatch(subMesh, mesh, material) {
        if (mesh === undefined) {
            mesh = subMesh.getMesh();
        }
        if (this.maintainStateBetweenFrames && subMesh._wasDispatched) {
            return;
        }
        subMesh._wasDispatched = true;
        this.getRenderingGroup(mesh.renderingGroupId).dispatch(subMesh, mesh, material);
    }
    /**
     * Overrides the default sort function applied in the rendering group to prepare the meshes.
     * This allowed control for front to back rendering or reversely depending of the special needs.
     *
     * @param renderingGroupId The rendering group id corresponding to its index
     * @param opaqueSortCompareFn The opaque queue comparison function use to sort.
     * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
     * @param transparentSortCompareFn The transparent queue comparison function use to sort.
     */
    setRenderingOrder(renderingGroupId, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {
        this._customOpaqueSortCompareFn[renderingGroupId] = opaqueSortCompareFn;
        this._customAlphaTestSortCompareFn[renderingGroupId] = alphaTestSortCompareFn;
        this._customTransparentSortCompareFn[renderingGroupId] = transparentSortCompareFn;
        if (this._renderingGroups[renderingGroupId]) {
            const group = this._renderingGroups[renderingGroupId];
            group.opaqueSortCompareFn = this._customOpaqueSortCompareFn[renderingGroupId];
            group.alphaTestSortCompareFn = this._customAlphaTestSortCompareFn[renderingGroupId];
            group.transparentSortCompareFn = this._customTransparentSortCompareFn[renderingGroupId];
        }
    }
    /**
     * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
     *
     * @param renderingGroupId The rendering group id corresponding to its index
     * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
     * @param depth Automatically clears depth between groups if true and autoClear is true.
     * @param stencil Automatically clears stencil between groups if true and autoClear is true.
     */
    setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil, depth = true, stencil = true) {
        this._autoClearDepthStencil[renderingGroupId] = {
            autoClear: autoClearDepthStencil,
            depth: depth,
            stencil: stencil,
        };
    }
    /**
     * Gets the current auto clear configuration for one rendering group of the rendering
     * manager.
     * @param index the rendering group index to get the information for
     * @returns The auto clear setup for the requested rendering group
     */
    getAutoClearDepthStencilSetup(index) {
        return this._autoClearDepthStencil[index];
    }
}
/**
 * The max id used for rendering groups (not included)
 */
RenderingManager.MAX_RENDERINGGROUPS = 4;
/**
 * The min id used for rendering groups (included)
 */
RenderingManager.MIN_RENDERINGGROUPS = 0;
/**
 * Used to globally prevent autoclearing scenes.
 */
RenderingManager.AUTOCLEAR = true;
//# sourceMappingURL=renderingManager.js.map

/***/ }),

/***/ 14797:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   j: () => (/* binding */ UtilityLayerRenderer)
/* harmony export */ });
/* harmony import */ var _scene_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87491);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99848);
/* harmony import */ var _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66240);
/* harmony import */ var _Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30311);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6315);
/* harmony import */ var _Lights_hemisphericLight_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71513);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(79923);
/* harmony import */ var _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(26041);








/**
 * Renders a layer on top of an existing scene
 */
class UtilityLayerRenderer {
    /**
     * Gets the camera that is used to render the utility layer (when not set, this will be the last active camera)
     * @param getRigParentIfPossible if the current active camera is a rig camera, should its parent camera be returned
     * @returns the camera that is used when rendering the utility layer
     */
    getRenderCamera(getRigParentIfPossible) {
        if (this._renderCamera) {
            return this._renderCamera;
        }
        else {
            let activeCam;
            if (this.originalScene.activeCameras && this.originalScene.activeCameras.length > 1) {
                activeCam = this.originalScene.activeCameras[this.originalScene.activeCameras.length - 1];
            }
            else {
                activeCam = this.originalScene.activeCamera;
            }
            if (getRigParentIfPossible && activeCam && activeCam.isRigCamera) {
                return activeCam.rigParent;
            }
            return activeCam;
        }
    }
    /**
     * Sets the camera that should be used when rendering the utility layer (If set to null the last active camera will be used)
     * @param cam the camera that should be used when rendering the utility layer
     */
    setRenderCamera(cam) {
        this._renderCamera = cam;
    }
    /**
     * @internal
     * Light which used by gizmos to get light shading
     */
    _getSharedGizmoLight() {
        if (!this._sharedGizmoLight) {
            this._sharedGizmoLight = new _Lights_hemisphericLight_js__WEBPACK_IMPORTED_MODULE_5__/* .HemisphericLight */ .g("shared gizmo light", new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_6__/* .Vector3 */ .Pq(0, 1, 0), this.utilityLayerScene);
            this._sharedGizmoLight.intensity = 2;
            this._sharedGizmoLight.groundColor = _Maths_math_color_js__WEBPACK_IMPORTED_MODULE_7__/* .Color3 */ .v9.Gray();
        }
        return this._sharedGizmoLight;
    }
    /**
     * A shared utility layer that can be used to overlay objects into a scene (Depth map of the previous scene is cleared before drawing on top of it)
     */
    static get DefaultUtilityLayer() {
        if (UtilityLayerRenderer._DefaultUtilityLayer == null) {
            return UtilityLayerRenderer._CreateDefaultUtilityLayerFromScene(_Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore */ .q.LastCreatedScene);
        }
        return UtilityLayerRenderer._DefaultUtilityLayer;
    }
    /**
     * Creates an utility layer, and set it as a default utility layer
     * @param scene associated scene
     * @internal
     */
    static _CreateDefaultUtilityLayerFromScene(scene) {
        UtilityLayerRenderer._DefaultUtilityLayer = new UtilityLayerRenderer(scene);
        UtilityLayerRenderer._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(() => {
            UtilityLayerRenderer._DefaultUtilityLayer = null;
        });
        return UtilityLayerRenderer._DefaultUtilityLayer;
    }
    /**
     * A shared utility layer that can be used to embed objects into a scene (Depth map of the previous scene is not cleared before drawing on top of it)
     */
    static get DefaultKeepDepthUtilityLayer() {
        if (UtilityLayerRenderer._DefaultKeepDepthUtilityLayer == null) {
            UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = new UtilityLayerRenderer(_Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore */ .q.LastCreatedScene);
            UtilityLayerRenderer._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = false;
            UtilityLayerRenderer._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(() => {
                UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = null;
            });
        }
        return UtilityLayerRenderer._DefaultKeepDepthUtilityLayer;
    }
    /**
     * Instantiates a UtilityLayerRenderer
     * @param originalScene the original scene that will be rendered on top of
     * @param handleEvents boolean indicating if the utility layer should handle events
     */
    constructor(
    /** the original scene that will be rendered on top of */
    originalScene, handleEvents = true) {
        this.originalScene = originalScene;
        this._pointerCaptures = {};
        this._lastPointerEvents = {};
        this._sharedGizmoLight = null;
        this._renderCamera = null;
        /**
         * If the picking should be done on the utility layer prior to the actual scene (Default: true)
         */
        this.pickUtilitySceneFirst = true;
        /**
         *  If the utility layer should automatically be rendered on top of existing scene
         */
        this.shouldRender = true;
        /**
         * If set to true, only pointer down onPointerObservable events will be blocked when picking is occluded by original scene
         */
        this.onlyCheckPointerDownEvents = true;
        /**
         * If set to false, only pointerUp, pointerDown and pointerMove will be sent to the utilityLayerScene (false by default)
         */
        this.processAllEvents = false;
        /**
         * Set to false to disable picking
         */
        this.pickingEnabled = true;
        /**
         * Observable raised when the pointer moves from the utility layer scene to the main scene
         */
        this.onPointerOutObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_1__/* .Observable */ .cP();
        // Create scene which will be rendered in the foreground and remove it from being referenced by engine to avoid interfering with existing app
        this.utilityLayerScene = new _scene_js__WEBPACK_IMPORTED_MODULE_0__/* .Scene */ .Z(originalScene.getEngine(), { virtual: true });
        this.utilityLayerScene.useRightHandedSystem = originalScene.useRightHandedSystem;
        this.utilityLayerScene._allowPostProcessClearColor = false;
        // Deactivate post processes
        this.utilityLayerScene.postProcessesEnabled = false;
        // Detach controls on utility scene, events will be fired by logic below to handle picking priority
        this.utilityLayerScene.detachControl();
        if (handleEvents) {
            this._originalPointerObserver = originalScene.onPrePointerObservable.add((prePointerInfo) => {
                if (!this.utilityLayerScene.activeCamera) {
                    return;
                }
                if (!this.pickingEnabled) {
                    return;
                }
                if (!this.processAllEvents) {
                    if (prePointerInfo.type !== _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERMOVE &&
                        prePointerInfo.type !== _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERUP &&
                        prePointerInfo.type !== _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERDOWN &&
                        prePointerInfo.type !== _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERDOUBLETAP) {
                        return;
                    }
                }
                this.utilityLayerScene.pointerX = originalScene.pointerX;
                this.utilityLayerScene.pointerY = originalScene.pointerY;
                const pointerEvent = prePointerInfo.event;
                if (originalScene.isPointerCaptured(pointerEvent.pointerId)) {
                    this._pointerCaptures[pointerEvent.pointerId] = false;
                    return;
                }
                const getNearPickDataForScene = (scene) => {
                    let scenePick = null;
                    if (prePointerInfo.nearInteractionPickingInfo) {
                        if (prePointerInfo.nearInteractionPickingInfo.pickedMesh.getScene() == scene) {
                            scenePick = prePointerInfo.nearInteractionPickingInfo;
                        }
                        else {
                            scenePick = new _Collisions_pickingInfo_js__WEBPACK_IMPORTED_MODULE_3__/* .PickingInfo */ .G();
                        }
                    }
                    else if (scene !== this.utilityLayerScene && prePointerInfo.originalPickingInfo) {
                        scenePick = prePointerInfo.originalPickingInfo;
                    }
                    else {
                        let previousActiveCamera = null;
                        // If a camera is set for rendering with this layer
                        // it will also be used for the ray computation
                        // To preserve back compat and because scene.pick always use activeCamera
                        // it's substituted temporarily and a new scenePick is forced.
                        // otherwise, the ray with previously active camera is always used.
                        // It's set back to previous activeCamera after operation.
                        if (this._renderCamera) {
                            previousActiveCamera = scene._activeCamera;
                            scene._activeCamera = this._renderCamera;
                            prePointerInfo.ray = null;
                        }
                        scenePick = prePointerInfo.ray ? scene.pickWithRay(prePointerInfo.ray) : scene.pick(originalScene.pointerX, originalScene.pointerY);
                        if (previousActiveCamera) {
                            scene._activeCamera = previousActiveCamera;
                        }
                    }
                    return scenePick;
                };
                const utilityScenePick = getNearPickDataForScene(this.utilityLayerScene);
                if (!prePointerInfo.ray && utilityScenePick) {
                    prePointerInfo.ray = utilityScenePick.ray;
                }
                // always fire the prepointer observable
                this.utilityLayerScene.onPrePointerObservable.notifyObservers(prePointerInfo);
                // allow every non pointer down event to flow to the utility layer
                if (this.onlyCheckPointerDownEvents && prePointerInfo.type != _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERDOWN) {
                    if (!prePointerInfo.skipOnPointerObservable) {
                        this.utilityLayerScene.onPointerObservable.notifyObservers(new _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerInfo */ .mx(prePointerInfo.type, prePointerInfo.event, utilityScenePick), prePointerInfo.type);
                    }
                    if (prePointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERUP && this._pointerCaptures[pointerEvent.pointerId]) {
                        this._pointerCaptures[pointerEvent.pointerId] = false;
                    }
                    return;
                }
                if (this.utilityLayerScene.autoClearDepthAndStencil || this.pickUtilitySceneFirst) {
                    // If this layer is an overlay, check if this layer was hit and if so, skip pointer events for the main scene
                    if (utilityScenePick && utilityScenePick.hit) {
                        if (!prePointerInfo.skipOnPointerObservable) {
                            this.utilityLayerScene.onPointerObservable.notifyObservers(new _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerInfo */ .mx(prePointerInfo.type, prePointerInfo.event, utilityScenePick), prePointerInfo.type);
                        }
                        prePointerInfo.skipOnPointerObservable = true;
                    }
                }
                else {
                    const originalScenePick = getNearPickDataForScene(originalScene);
                    const pointerEvent = prePointerInfo.event;
                    // If the layer can be occluded by the original scene, only fire pointer events to the first layer that hit they ray
                    if (originalScenePick && utilityScenePick) {
                        // No pick in utility scene
                        if (utilityScenePick.distance === 0 && originalScenePick.pickedMesh) {
                            if (this.mainSceneTrackerPredicate && this.mainSceneTrackerPredicate(originalScenePick.pickedMesh)) {
                                // We touched an utility mesh present in the main scene
                                this._notifyObservers(prePointerInfo, originalScenePick, pointerEvent);
                                prePointerInfo.skipOnPointerObservable = true;
                            }
                            else if (prePointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERDOWN) {
                                this._pointerCaptures[pointerEvent.pointerId] = true;
                            }
                            else if (prePointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERMOVE || prePointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERUP) {
                                if (this._lastPointerEvents[pointerEvent.pointerId]) {
                                    // We need to send a last pointerup to the utilityLayerScene to make sure animations can complete
                                    this.onPointerOutObservable.notifyObservers(pointerEvent.pointerId);
                                    delete this._lastPointerEvents[pointerEvent.pointerId];
                                }
                                this._notifyObservers(prePointerInfo, originalScenePick, pointerEvent);
                            }
                        }
                        else if (!this._pointerCaptures[pointerEvent.pointerId] && (utilityScenePick.distance < originalScenePick.distance || originalScenePick.distance === 0)) {
                            // We pick something in utility scene or the pick in utility is closer than the one in main scene
                            this._notifyObservers(prePointerInfo, utilityScenePick, pointerEvent);
                            // If a previous utility layer set this, do not unset this
                            if (!prePointerInfo.skipOnPointerObservable) {
                                prePointerInfo.skipOnPointerObservable = utilityScenePick.distance > 0;
                            }
                        }
                        else if (!this._pointerCaptures[pointerEvent.pointerId] && utilityScenePick.distance >= originalScenePick.distance) {
                            // We have a pick in both scenes but main is closer than utility
                            // We touched an utility mesh present in the main scene
                            if (this.mainSceneTrackerPredicate && this.mainSceneTrackerPredicate(originalScenePick.pickedMesh)) {
                                this._notifyObservers(prePointerInfo, originalScenePick, pointerEvent);
                                prePointerInfo.skipOnPointerObservable = true;
                            }
                            else {
                                if (prePointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERMOVE || prePointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERUP) {
                                    if (this._lastPointerEvents[pointerEvent.pointerId]) {
                                        // We need to send a last pointerup to the utilityLayerScene to make sure animations can complete
                                        this.onPointerOutObservable.notifyObservers(pointerEvent.pointerId);
                                        delete this._lastPointerEvents[pointerEvent.pointerId];
                                    }
                                }
                                this._notifyObservers(prePointerInfo, utilityScenePick, pointerEvent);
                            }
                        }
                        if (prePointerInfo.type === _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerEventTypes */ .Zp.POINTERUP && this._pointerCaptures[pointerEvent.pointerId]) {
                            this._pointerCaptures[pointerEvent.pointerId] = false;
                        }
                    }
                }
            });
            // As a newly added utility layer will be rendered over the screen last, it's pointer events should be processed first
            if (this._originalPointerObserver) {
                originalScene.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver);
            }
        }
        // Render directly on top of existing scene without clearing
        this.utilityLayerScene.autoClear = false;
        this._afterRenderObserver = this.originalScene.onAfterRenderCameraObservable.add((camera) => {
            // Only render when the render camera finishes rendering
            if (this.shouldRender && camera == this.getRenderCamera()) {
                this.render();
            }
        });
        this._sceneDisposeObserver = this.originalScene.onDisposeObservable.add(() => {
            this.dispose();
        });
        this._updateCamera();
    }
    _notifyObservers(prePointerInfo, pickInfo, pointerEvent) {
        if (!prePointerInfo.skipOnPointerObservable) {
            this.utilityLayerScene.onPointerObservable.notifyObservers(new _Events_pointerEvents_js__WEBPACK_IMPORTED_MODULE_2__/* .PointerInfo */ .mx(prePointerInfo.type, prePointerInfo.event, pickInfo), prePointerInfo.type);
            this._lastPointerEvents[pointerEvent.pointerId] = true;
        }
    }
    /**
     * Renders the utility layers scene on top of the original scene
     */
    render() {
        this._updateCamera();
        if (this.utilityLayerScene.activeCamera) {
            // Set the camera's scene to utility layers scene
            const oldScene = this.utilityLayerScene.activeCamera.getScene();
            const camera = this.utilityLayerScene.activeCamera;
            camera._scene = this.utilityLayerScene;
            if (camera.leftCamera) {
                camera.leftCamera._scene = this.utilityLayerScene;
            }
            if (camera.rightCamera) {
                camera.rightCamera._scene = this.utilityLayerScene;
            }
            this.utilityLayerScene.render(false);
            // Reset camera's scene back to original
            camera._scene = oldScene;
            if (camera.leftCamera) {
                camera.leftCamera._scene = oldScene;
            }
            if (camera.rightCamera) {
                camera.rightCamera._scene = oldScene;
            }
        }
    }
    /**
     * Disposes of the renderer
     */
    dispose() {
        this.onPointerOutObservable.clear();
        if (this._afterRenderObserver) {
            this.originalScene.onAfterCameraRenderObservable.remove(this._afterRenderObserver);
        }
        if (this._sceneDisposeObserver) {
            this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver);
        }
        if (this._originalPointerObserver) {
            this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver);
        }
        this.utilityLayerScene.dispose();
    }
    _updateCamera() {
        this.utilityLayerScene.cameraToUseForPointers = this.getRenderCamera();
        this.utilityLayerScene.activeCamera = this.getRenderCamera();
    }
}
/** @internal */
UtilityLayerRenderer._DefaultUtilityLayer = null;
/** @internal */
UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = null;
//# sourceMappingURL=utilityLayerRenderer.js.map

/***/ }),

/***/ 33723:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export backgroundUboDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _sceneUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98327);
// Do not edit.


const name = "backgroundUboDeclaration";
const shader = `uniform vPrimaryColor: vec4f;uniform vPrimaryColorShadow: vec4f;uniform vDiffuseInfos: vec2f;uniform vReflectionInfos: vec2f;uniform diffuseMatrix: mat4x4f;uniform reflectionMatrix: mat4x4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform fFovMultiplier: f32;uniform pointSize: f32;uniform shadowLevel: f32;uniform alpha: f32;uniform vBackgroundCenter: vec3f;uniform vReflectionControl: vec4f;uniform projectedGroundInfos: vec2f;
#include<sceneUboDeclaration>
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const backgroundUboDeclarationWGSL = { name, shader };
//# sourceMappingURL=backgroundUboDeclaration.js.map

/***/ }),

/***/ 40242:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export bakedVertexAnimationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bakedVertexAnimation";
const shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
{
#ifdef INSTANCES
let VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;
#else
let VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;
#endif
let totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4<f32>;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];
#endif
finalWorld=finalWorld*VATInfluence;}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const bakedVertexAnimationWGSL = { name, shader };
//# sourceMappingURL=bakedVertexAnimation.js.map

/***/ }),

/***/ 98900:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export bakedVertexAnimationDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bakedVertexAnimationDeclaration";
const shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
uniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2<f32>;uniform bakedVertexAnimationSettings: vec4<f32>;var bakedVertexAnimationTexture : texture_2d<f32>;
#ifdef INSTANCES
attribute bakedVertexAnimationSettingsInstanced : vec4<f32>;
#endif
fn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->mat4x4<f32>
{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2<i32>(offset+0,frameUV),0);let m1=textureLoad(smp,vec2<i32>(offset+1,frameUV),0);let m2=textureLoad(smp,vec2<i32>(offset+2,frameUV),0);let m3=textureLoad(smp,vec2<i32>(offset+3,frameUV),0);return mat4x4<f32>(m0,m1,m2,m3);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const bakedVertexAnimationDeclarationWGSL = { name, shader };
//# sourceMappingURL=bakedVertexAnimationDeclaration.js.map

/***/ }),

/***/ 32806:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bonesDeclarationWGSL: () => (/* binding */ bonesDeclarationWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bonesDeclaration";
const shader = `#if NUM_BONE_INFLUENCERS>0
attribute matricesIndices : vec4<f32>;attribute matricesWeights : vec4<f32>;
#if NUM_BONE_INFLUENCERS>4
attribute matricesIndicesExtra : vec4<f32>;attribute matricesWeightsExtra : vec4<f32>;
#endif
#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#ifdef BONETEXTURE
var boneSampler : texture_2d<f32>;uniform boneTextureWidth : f32;
#else
uniform mBones : array<mat4x4,BonesPerMesh>;
#ifdef BONES_VELOCITY_ENABLED
uniform mPreviousBones : array<mat4x4,BonesPerMesh>;
#endif
#endif
#ifdef BONETEXTURE
fn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4<f32>
{let offset=i32(index) *4; 
let m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);return mat4x4<f32>(m0,m1,m2,m3);}
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const bonesDeclarationWGSL = { name, shader };
//# sourceMappingURL=bonesDeclaration.js.map

/***/ }),

/***/ 65470:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bonesVertexWGSL: () => (/* binding */ bonesVertexWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bonesVertex";
const shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#if NUM_BONE_INFLUENCERS>0
var influence : mat4x4<f32>;
#ifdef BONETEXTURE
influence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];
#endif 
#if NUM_BONE_INFLUENCERS>4
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];
#endif 
#else 
influence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];
#endif 
#if NUM_BONE_INFLUENCERS>4
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];
#endif 
#endif
finalWorld=finalWorld*influence;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const bonesVertexWGSL = { name, shader };
//# sourceMappingURL=bonesVertex.js.map

/***/ }),

/***/ 20727:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bumpFragmentWGSL: () => (/* binding */ bumpFragmentWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bumpFragment";
const shader = `var uvOffset: vec2f= vec2f(0.0,0.0);
#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)
#ifdef NORMALXYSCALE
var normalScale: f32=1.0;
#elif defined(BUMP)
var normalScale: f32=uniforms.vBumpInfos.y;
#else
var normalScale: f32=1.0;
#endif
#if defined(TANGENT) && defined(NORMAL)
var TBN: mat3x3f=mat3x3<f32>(input.vTBN0,input.vTBN1,input.vTBN2); 
#elif defined(BUMP)
var TBNUV: vec2f=select(-fragmentInputs.vBumpUV,fragmentInputs.vBumpUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV,uniforms.vTangentSpaceParams);
#else
var TBNUV: vec2f=select(-fragmentInputs.vDetailUV,fragmentInputs.vDetailUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV, vec2f(1.,1.));
#endif
#elif defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL)
var TBN: mat3x3f=mat3x3<f32>(input.vTBN0,input.vTBN1,input.vTBN2); 
#else
var TBNUV: vec2f=select( -fragmentInputs.vMainUV1,fragmentInputs.vMainUV1,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW,input.vPositionW,TBNUV, vec2f(1.,1.));
#endif
#endif
#ifdef PARALLAX
var invTBN: mat3x3f=transposeMat3(TBN);
#ifdef PARALLAXOCCLUSION
uvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,fragmentInputs.vBumpUV,uniforms.vBumpInfos.z);
#else
uvOffset=parallaxOffset(invTBN*viewDirectionW,uniforms.vBumpInfos.z);
#endif
#endif
#ifdef DETAIL
var detailColor: vec4f=textureSample(detailSampler,detailSamplerSampler,fragmentInputs.vDetailUV+uvOffset);var detailNormalRG: vec2f=detailColor.wy*2.0-1.0;var detailNormalB: f32=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));var detailNormal: vec3f= vec3f(detailNormalRG,detailNormalB);
#endif
#ifdef BUMP
#ifdef OBJECTSPACE_NORMALMAP
#define CUSTOM_FRAGMENT_BUMP_FRAGMENT
normalW=normalize(textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3x3f(uniforms.normalMatrix[0].xyz,uniforms.normalMatrix[1].xyz,uniforms.normalMatrix[2].xyz)*normalW);
#elif !defined(DETAIL)
normalW=perturbNormal(TBN,textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV+uvOffset).xyz,uniforms.vBumpInfos.y);
#else
var bumpNormal: vec3f=textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV+uvOffset).xyz*2.0-1.0;
#if DETAIL_NORMALBLENDMETHOD==0 
detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);var blendedNormal: vec3f=normalize( vec3f(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));
#elif DETAIL_NORMALBLENDMETHOD==1 
detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);bumpNormal+= vec3f(0.0,0.0,1.0);detailNormal*= vec3f(-1.0,-1.0,1.0);var blendedNormal: vec3f=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;
#endif
normalW=perturbNormalBase(TBN,blendedNormal,uniforms.vBumpInfos.y);
#endif
#elif defined(DETAIL)
detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);normalW=perturbNormalBase(TBN,detailNormal,uniforms.vDetailInfos.z);
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const bumpFragmentWGSL = { name, shader };
//# sourceMappingURL=bumpFragment.js.map

/***/ }),

/***/ 91258:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bumpFragmentFunctionsWGSL: () => (/* binding */ bumpFragmentFunctionsWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _samplerFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80983);
// Do not edit.


const name = "bumpFragmentFunctions";
const shader = `#if defined(BUMP)
#include<samplerFragmentDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)
#endif
#if defined(DETAIL)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail)
#endif
#if defined(BUMP) && defined(PARALLAX)
const minSamples: f32=4.;const maxSamples: f32=15.;const iMaxSamples: i32=15;fn parallaxOcclusion(vViewDirCoT: vec3f,vNormalCoT: vec3f,texCoord: vec2f,parallaxScale: f32)->vec2f {var parallaxLimit: f32=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;var vOffsetDir: vec2f=normalize(vViewDirCoT.xy);var vMaxOffset: vec2f=vOffsetDir*parallaxLimit;var numSamples: f32=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));var stepSize: f32=1.0/numSamples;var currRayHeight: f32=1.0;var vCurrOffset: vec2f= vec2f(0,0);var vLastOffset: vec2f= vec2f(0,0);var lastSampledHeight: f32=1.0;var currSampledHeight: f32=1.0;var keepWorking: bool=true;for (var i: i32=0; i<iMaxSamples; i++)
{currSampledHeight=textureSample(bumpSampler,bumpSamplerSampler,texCoord+vCurrOffset).w;if (!keepWorking)
{}
else if (currSampledHeight>currRayHeight)
{var delta1: f32=currSampledHeight-currRayHeight;var delta2: f32=(currRayHeight+stepSize)-lastSampledHeight;var ratio: f32=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;}
else
{currRayHeight-=stepSize;vLastOffset=vCurrOffset;
#ifdef PARALLAX_RHS
vCurrOffset-=stepSize*vMaxOffset;
#else
vCurrOffset+=stepSize*vMaxOffset;
#endif
lastSampledHeight=currSampledHeight;}}
return vCurrOffset;}
fn parallaxOffset(viewDir: vec3f,heightScale: f32)->vec2f
{var height: f32=textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).w;var texCoordOffset: vec2f=heightScale*viewDir.xy*height;
#ifdef PARALLAX_RHS
return texCoordOffset;
#else
return -texCoordOffset;
#endif
}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const bumpFragmentFunctionsWGSL = { name, shader };
//# sourceMappingURL=bumpFragmentFunctions.js.map

/***/ }),

/***/ 15697:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bumpFragmentMainFunctionsWGSL: () => (/* binding */ bumpFragmentMainFunctionsWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bumpFragmentMainFunctions";
const shader = `#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)
#if defined(TANGENT) && defined(NORMAL) 
varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f;
#endif
#ifdef OBJECTSPACE_NORMALMAP
uniform normalMatrix: mat4x4f;fn toNormalMatrix(m: mat4x4f)->mat4x4f
{var a00=m[0][0];var a01=m[0][1];var a02=m[0][2];var a03=m[0][3];var a10=m[1][0];var a11=m[1][1];var a12=m[1][2];var a13=m[1][3];var a20=m[2][0]; 
var a21=m[2][1];var a22=m[2][2];var a23=m[2][3];var a30=m[3][0]; 
var a31=m[3][1];var a32=m[3][2];var a33=m[3][3];var b00=a00*a11-a01*a10;var b01=a00*a12-a02*a10;var b02=a00*a13-a03*a10;var b03=a01*a12-a02*a11;var b04=a01*a13-a03*a11;var b05=a02*a13-a03*a12;var b06=a20*a31-a21*a30;var b07=a20*a32-a22*a30;var b08=a20*a33-a23*a30;var b09=a21*a32-a22*a31;var b10=a21*a33-a23*a31;var b11=a22*a33-a23*a32;var det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;var mi=mat4x4<f32>(
(a11*b11-a12*b10+a13*b09)/det,
(a02*b10-a01*b11-a03*b09)/det,
(a31*b05-a32*b04+a33*b03)/det,
(a22*b04-a21*b05-a23*b03)/det,
(a12*b08-a10*b11-a13*b07)/det,
(a00*b11-a02*b08+a03*b07)/det,
(a32*b02-a30*b05-a33*b01)/det,
(a20*b05-a22*b02+a23*b01)/det,
(a10*b10-a11*b08+a13*b06)/det,
(a01*b08-a00*b10-a03*b06)/det,
(a30*b04-a31*b02+a33*b00)/det,
(a21*b02-a20*b04-a23*b00)/det,
(a11*b07-a10*b09-a12*b06)/det,
(a00*b09-a01*b07+a02*b06)/det,
(a31*b01-a30*b03-a32*b00)/det,
(a20*b03-a21*b01+a22*b00)/det);return mat4x4<f32>(mi[0][0],mi[1][0],mi[2][0],mi[3][0],
mi[0][1],mi[1][1],mi[2][1],mi[3][1],
mi[0][2],mi[1][2],mi[2][2],mi[3][2],
mi[0][3],mi[1][3],mi[2][3],mi[3][3]);}
#endif
fn perturbNormalBase(cotangentFrame: mat3x3f,normal: vec3f,scale: f32)->vec3f
{var output=normal;
#ifdef NORMALXYSCALE
output=normalize(output* vec3f(scale,scale,1.0));
#endif
return normalize(cotangentFrame*output);}
fn perturbNormal(cotangentFrame: mat3x3f,textureSample: vec3f,scale: f32)->vec3f
{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);}
fn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f,tangentSpaceParams: vec2f)->mat3x3f
{var dp1: vec3f=dpdx(p);var dp2: vec3f=dpdy(p);var duv1: vec2f=dpdx(uv);var duv2: vec2f=dpdy(uv);var dp2perp: vec3f=cross(dp2,normal);var dp1perp: vec3f=cross(normal,dp1);var tangent: vec3f=dp2perp*duv1.x+dp1perp*duv2.x;var bitangent: vec3f=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;var det: f32=max(dot(tangent,tangent),dot(bitangent,bitangent));var invmax: f32=select(inverseSqrt(det),0.0,det==0.0);return mat3x3f(tangent*invmax,bitangent*invmax,normal);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const bumpFragmentMainFunctionsWGSL = { name, shader };
//# sourceMappingURL=bumpFragmentMainFunctions.js.map

/***/ }),

/***/ 87921:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export bumpVertexWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bumpVertex";
const shader = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL)
var tbnNormal: vec3f=normalize(normalUpdated);var tbnTangent: vec3f=normalize(tangentUpdated.xyz);var tbnBitangent: vec3f=cross(tbnNormal,tbnTangent)*tangentUpdated.w;var matTemp= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz)* mat3x3f(tbnTangent,tbnBitangent,tbnNormal);vertexOutputs.vTBN0=matTemp[0];vertexOutputs.vTBN1=matTemp[1];vertexOutputs.vTBN2=matTemp[2];
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const bumpVertexWGSL = { name, shader };
//# sourceMappingURL=bumpVertex.js.map

/***/ }),

/***/ 97777:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export bumpVertexDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bumpVertexDeclaration";
const shader = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL) 
varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const bumpVertexDeclarationWGSL = { name, shader };
//# sourceMappingURL=bumpVertexDeclaration.js.map

/***/ }),

/***/ 97715:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clipPlaneFragmentWGSL: () => (/* binding */ clipPlaneFragmentWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "clipPlaneFragment";
const shader = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
if (false) {}
#endif
#ifdef CLIPPLANE
else if (fragmentInputs.fClipDistance>0.0)
{discard;}
#endif
#ifdef CLIPPLANE2
else if (fragmentInputs.fClipDistance2>0.0)
{discard;}
#endif
#ifdef CLIPPLANE3
else if (fragmentInputs.fClipDistance3>0.0)
{discard;}
#endif
#ifdef CLIPPLANE4
else if (fragmentInputs.fClipDistance4>0.0)
{discard;}
#endif
#ifdef CLIPPLANE5
else if (fragmentInputs.fClipDistance5>0.0)
{discard;}
#endif
#ifdef CLIPPLANE6
else if (fragmentInputs.fClipDistance6>0.0)
{discard;}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const clipPlaneFragmentWGSL = { name, shader };
//# sourceMappingURL=clipPlaneFragment.js.map

/***/ }),

/***/ 39759:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clipPlaneFragmentDeclarationWGSL: () => (/* binding */ clipPlaneFragmentDeclarationWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "clipPlaneFragmentDeclaration";
const shader = `#ifdef CLIPPLANE
varying fClipDistance: f32;
#endif
#ifdef CLIPPLANE2
varying fClipDistance2: f32;
#endif
#ifdef CLIPPLANE3
varying fClipDistance3: f32;
#endif
#ifdef CLIPPLANE4
varying fClipDistance4: f32;
#endif
#ifdef CLIPPLANE5
varying fClipDistance5: f32;
#endif
#ifdef CLIPPLANE6
varying fClipDistance6: f32;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const clipPlaneFragmentDeclarationWGSL = { name, shader };
//# sourceMappingURL=clipPlaneFragmentDeclaration.js.map

/***/ }),

/***/ 85197:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clipPlaneVertexWGSL: () => (/* binding */ clipPlaneVertexWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "clipPlaneVertex";
const shader = `#ifdef CLIPPLANE
vertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane);
#endif
#ifdef CLIPPLANE2
vertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2);
#endif
#ifdef CLIPPLANE3
vertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3);
#endif
#ifdef CLIPPLANE4
vertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4);
#endif
#ifdef CLIPPLANE5
vertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5);
#endif
#ifdef CLIPPLANE6
vertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6);
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const clipPlaneVertexWGSL = { name, shader };
//# sourceMappingURL=clipPlaneVertex.js.map

/***/ }),

/***/ 77029:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clipPlaneVertexDeclarationWGSL: () => (/* binding */ clipPlaneVertexDeclarationWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "clipPlaneVertexDeclaration";
const shader = `#ifdef CLIPPLANE
uniform vClipPlane: vec4<f32>;varying fClipDistance: f32;
#endif
#ifdef CLIPPLANE2
uniform vClipPlane2: vec4<f32>;varying fClipDistance2: f32;
#endif
#ifdef CLIPPLANE3
uniform vClipPlane3: vec4<f32>;varying fClipDistance3: f32;
#endif
#ifdef CLIPPLANE4
uniform vClipPlane4: vec4<f32>;varying fClipDistance4: f32;
#endif
#ifdef CLIPPLANE5
uniform vClipPlane5: vec4<f32>;varying fClipDistance5: f32;
#endif
#ifdef CLIPPLANE6
uniform vClipPlane6: vec4<f32>;varying fClipDistance6: f32;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const clipPlaneVertexDeclarationWGSL = { name, shader };
//# sourceMappingURL=clipPlaneVertexDeclaration.js.map

/***/ }),

/***/ 49306:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export decalFragmentWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "decalFragment";
const shader = `#ifdef DECAL
var decalTempColor=decalColor.rgb;var decalTempAlpha=decalColor.a;
#ifdef GAMMADECAL
decalTempColor=toLinearSpaceVec3(decalColor.rgb);
#endif
#ifdef DECAL_SMOOTHALPHA
decalTempAlpha=decalColor.a*decalColor.a;
#endif
surfaceAlbedo=mix(surfaceAlbedo.rgb,decalTempColor,decalTempAlpha);
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const decalFragmentWGSL = { name, shader };
//# sourceMappingURL=decalFragment.js.map

/***/ }),

/***/ 71698:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export defaultUboDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _sceneUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98327);
/* harmony import */ var _meshUboDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6874);
// Do not edit.



const name = "defaultUboDeclaration";
const shader = `uniform diffuseLeftColor: vec4f;uniform diffuseRightColor: vec4f;uniform opacityParts: vec4f;uniform reflectionLeftColor: vec4f;uniform reflectionRightColor: vec4f;uniform refractionLeftColor: vec4f;uniform refractionRightColor: vec4f;uniform emissiveLeftColor: vec4f;uniform emissiveRightColor: vec4f;uniform vDiffuseInfos: vec2f;uniform vAmbientInfos: vec2f;uniform vOpacityInfos: vec2f;uniform vReflectionInfos: vec2f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;uniform vEmissiveInfos: vec2f;uniform vLightmapInfos: vec2f;uniform vSpecularInfos: vec2f;uniform vBumpInfos: vec3f;uniform diffuseMatrix: mat4x4f;uniform ambientMatrix: mat4x4f;uniform opacityMatrix: mat4x4f;uniform reflectionMatrix: mat4x4f;uniform emissiveMatrix: mat4x4f;uniform lightmapMatrix: mat4x4f;uniform specularMatrix: mat4x4f;uniform bumpMatrix: mat4x4f;uniform vTangentSpaceParams: vec2f;uniform pointSize: f32;uniform alphaCutOff: f32;uniform refractionMatrix: mat4x4f;uniform vRefractionInfos: vec4f;uniform vRefractionPosition: vec3f;uniform vRefractionSize: vec3f;uniform vSpecularColor: vec4f;uniform vEmissiveColor: vec3f;uniform vDiffuseColor: vec4f;uniform vAmbientColor: vec3f;
#define ADDITIONAL_UBO_DECLARATION
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const defaultUboDeclarationWGSL = { name, shader };
//# sourceMappingURL=defaultUboDeclaration.js.map

/***/ }),

/***/ 59104:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export depthPrePassWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "depthPrePass";
const shader = `#ifdef DEPTHPREPASS
fragmentOutputs.color= vec4f(0.,0.,0.,1.0);return fragmentOutputs;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const depthPrePassWGSL = { name, shader };
//# sourceMappingURL=depthPrePass.js.map

/***/ }),

/***/ 93243:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export fogFragmentWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fogFragment";
const shader = `#ifdef FOG
var fog: f32=CalcFogFactor();
#ifdef PBR
fog=toLinearSpace(fog);
#endif
color= vec4f(mix(uniforms.vFogColor,color.rgb,fog),color.a);
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const fogFragmentWGSL = { name, shader };
//# sourceMappingURL=fogFragment.js.map

/***/ }),

/***/ 66407:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fogFragmentDeclarationWGSL: () => (/* binding */ fogFragmentDeclarationWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fogFragmentDeclaration";
const shader = `#ifdef FOG
#define FOGMODE_NONE 0.
#define FOGMODE_EXP 1.
#define FOGMODE_EXP2 2.
#define FOGMODE_LINEAR 3.
const E=2.71828;uniform vFogInfos: vec4f;uniform vFogColor: vec3f;varying vFogDistance: vec3f;fn CalcFogFactor()->f32
{var fogCoeff: f32=1.0;var fogStart: f32=uniforms.vFogInfos.y;var fogEnd: f32=uniforms.vFogInfos.z;var fogDensity: f32=uniforms.vFogInfos.w;var fogDistance: f32=length(fragmentInputs.vFogDistance);if (FOGMODE_LINEAR==uniforms.vFogInfos.x)
{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}
else if (FOGMODE_EXP==uniforms.vFogInfos.x)
{fogCoeff=1.0/pow(E,fogDistance*fogDensity);}
else if (FOGMODE_EXP2==uniforms.vFogInfos.x)
{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}
return clamp(fogCoeff,0.0,1.0);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const fogFragmentDeclarationWGSL = { name, shader };
//# sourceMappingURL=fogFragmentDeclaration.js.map

/***/ }),

/***/ 59013:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export fogVertexWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fogVertex";
const shader = `#ifdef FOG
vertexOutputs.vFogDistance=(scene.view*worldPos).xyz;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const fogVertexWGSL = { name, shader };
//# sourceMappingURL=fogVertex.js.map

/***/ }),

/***/ 75757:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export fogVertexDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fogVertexDeclaration";
const shader = `#ifdef FOG
varying vFogDistance: vec3f;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const fogVertexDeclarationWGSL = { name, shader };
//# sourceMappingURL=fogVertexDeclaration.js.map

/***/ }),

/***/ 30976:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export fresnelFunctionWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fresnelFunction";
const shader = `#ifdef FRESNEL
fn computeFresnelTerm(viewDirection: vec3f,worldNormal: vec3f,bias: f32,power: f32)->f32
{let fresnelTerm: f32=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const fresnelFunctionWGSL = { name, shader };
//# sourceMappingURL=fresnelFunction.js.map

/***/ }),

/***/ 45978:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export harmonicsFunctionsWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "harmonicsFunctions";
const shader = `#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {return uniforms.vSphericalL00
+ uniforms.vSphericalL1_1*(normal.y)
+ uniforms.vSphericalL10*(normal.z)
+ uniforms.vSphericalL11*(normal.x)
+ uniforms.vSphericalL2_2*(normal.y*normal.x)
+ uniforms.vSphericalL2_1*(normal.y*normal.z)
+ uniforms.vSphericalL20*((3.0*normal.z*normal.z)-1.0)
+ uniforms.vSphericalL21*(normal.z*normal.x)
+ uniforms.vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}
#else
fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {var Nx: f32=normal.x;var Ny: f32=normal.y;var Nz: f32=normal.z;var C1: vec3f=uniforms.vSphericalZZ.rgb;var Cx: vec3f=uniforms.vSphericalX.rgb;var Cy: vec3f=uniforms.vSphericalY.rgb;var Cz: vec3f=uniforms.vSphericalZ.rgb;var Cxx_zz: vec3f=uniforms.vSphericalXX_ZZ.rgb;var Cyy_zz: vec3f=uniforms.vSphericalYY_ZZ.rgb;var Cxy: vec3f=uniforms.vSphericalXY.rgb;var Cyz: vec3f=uniforms.vSphericalYZ.rgb;var Czx: vec3f=uniforms.vSphericalZX.rgb;var a1: vec3f=Cyy_zz*Ny+Cy;var a2: vec3f=Cyz*Nz+a1;var b1: vec3f=Czx*Nz+Cx;var b2: vec3f=Cxy*Ny+b1;var b3: vec3f=Cxx_zz*Nx+b2;var t1: vec3f=Cz *Nz+C1;var t2: vec3f=a2 *Ny+t1;var t3: vec3f=b3 *Nx+t2;return t3;}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const harmonicsFunctionsWGSL = { name, shader };
//# sourceMappingURL=harmonicsFunctions.js.map

/***/ }),

/***/ 58866:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export hdrFilteringFunctionsWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "hdrFilteringFunctions";
const shader = `#ifdef NUM_SAMPLES
#if NUM_SAMPLES>0
fn radicalInverse_VdC(value: u32)->f32 
{var bits=(value<<16u) | (value>>16u);bits=((bits & 0x55555555u)<<1u) | ((bits & 0xAAAAAAAAu)>>1u);bits=((bits & 0x33333333u)<<2u) | ((bits & 0xCCCCCCCCu)>>2u);bits=((bits & 0x0F0F0F0Fu)<<4u) | ((bits & 0xF0F0F0F0u)>>4u);bits=((bits & 0x00FF00FFu)<<8u) | ((bits & 0xFF00FF00u)>>8u);return f32(bits)*2.3283064365386963e-10; }
fn hammersley(i: u32,N: u32)->vec2f
{return vec2f( f32(i)/ f32(N),radicalInverse_VdC(i));}
fn log4(x: f32)->f32 {return log2(x)/2.;}
const NUM_SAMPLES_FLOAT: f32= f32(NUM_SAMPLES);const NUM_SAMPLES_FLOAT_INVERSED: f32=1./NUM_SAMPLES_FLOAT;const K: f32=4.;fn irradiance(inputTexture: texture_cube<f32>,inputSampler: sampler,inputN: vec3f,filteringInfo: vec2f)->vec3f
{var n: vec3f=normalize(inputN);var result: vec3f= vec3f(0.0);var tangent: vec3f=select(vec3f(1.,0.,0.),vec3f(0.,0.,1.),abs(n.z)<0.999);tangent=normalize(cross(tangent,n));var bitangent: vec3f=cross(n,tangent);var tbn: mat3x3f= mat3x3f(tangent,bitangent,n);var maxLevel: f32=filteringInfo.y;var dim0: f32=filteringInfo.x;var omegaP: f32=(4.*PI)/(6.*dim0*dim0);for(var i: u32=0u; i<NUM_SAMPLES; i++)
{var Xi: vec2f=hammersley(i,NUM_SAMPLES);var Ls: vec3f=hemisphereCosSample(Xi);Ls=normalize(Ls);var Ns: vec3f= vec3f(0.,0.,1.);var NoL: f32=dot(Ns,Ls);if (NoL>0.) {var pdf_inversed: f32=PI/NoL;var omegaS: f32=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;var l: f32=log4(omegaS)-log4(omegaP)+log4(K);var mipLevel: f32=clamp(l,0.0,maxLevel);var c: vec3f=textureSampleLevel(inputTexture,inputSampler,tbn*Ls,mipLevel).rgb;
#ifdef GAMMA_INPUT
c=toLinearSpaceVec3(c);
#endif
result+=c;}}
result=result*NUM_SAMPLES_FLOAT_INVERSED;return result;}
fn radiance(alphaG: f32,inputTexture: texture_cube<f32>,inputSampler: sampler,inputN: vec3f,filteringInfo: vec2f)->vec3f
{var n: vec3f=normalize(inputN);var c: vec3f=textureSample(inputTexture,inputSampler,n).rgb; 
if (alphaG==0.) {
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
return c;} else {var result: vec3f= vec3f(0.);var tangent: vec3f=select(vec3f(1.,0.,0.),vec3f(0.,0.,1.),abs(n.z)<0.999);tangent=normalize(cross(tangent,n));var bitangent: vec3f=cross(n,tangent);var tbn: mat3x3f= mat3x3f(tangent,bitangent,n);var maxLevel: f32=filteringInfo.y;var dim0: f32=filteringInfo.x;var omegaP: f32=(4.*PI)/(6.*dim0*dim0);var weight: f32=0.;for(var i: u32=0u; i<NUM_SAMPLES; i++)
{var Xi: vec2f=hammersley(i,NUM_SAMPLES);var H: vec3f=hemisphereImportanceSampleDggx(Xi,alphaG);var NoV: f32=1.;var NoH: f32=H.z;var NoH2: f32=H.z*H.z;var NoL: f32=2.*NoH2-1.;var L: vec3f= vec3f(2.*NoH*H.x,2.*NoH*H.y,NoL);L=normalize(L);if (NoL>0.) {var pdf_inversed: f32=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);var omegaS: f32=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;var l: f32=log4(omegaS)-log4(omegaP)+log4(K);var mipLevel: f32=clamp( f32(l),0.0,maxLevel);weight+=NoL;var c: vec3f=textureSampleLevel(inputTexture,inputSampler,tbn*L,mipLevel).rgb;
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
result+=c*NoL;}}
result=result/weight;return result;}}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const hdrFilteringFunctionsWGSL = { name, shader };
//# sourceMappingURL=hdrFilteringFunctions.js.map

/***/ }),

/***/ 79702:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   helperFunctionsWGSL: () => (/* binding */ helperFunctionsWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "helperFunctions";
const shader = `const PI: f32=3.1415926535897932384626433832795;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const HALF_MIN: f32=5.96046448e-08; 
const LinearEncodePowerApprox: f32=2.2;const GammaEncodePowerApprox: f32=1.0/LinearEncodePowerApprox;const LuminanceEncodeApprox: vec3<f32>=vec3<f32> (0.2126,0.7152,0.0722);const Epsilon:f32=0.0000001;fn square(x: f32)->f32 {return x*x;}
fn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}
fn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(0.0),vec3f(1.0));}
fn saturateEps(x: f32)->f32 {return clamp(x,Epsilon,1.0);} 
fn maxEps(x: f32)->f32 {return max(x,Epsilon);}
fn maxEpsVec3(x: vec3f)->vec3f {return max(x,vec3f(Epsilon));}
fn absEps(x: f32)->f32 {return abs(x)+Epsilon;}
fn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3<f32>=inMatrix[0];let i1: vec3<f32>=inMatrix[1];let i2: vec3<f32>=inMatrix[2];let outMatrix:mat3x3f=mat3x3f(
vec3(i0.x,i1.x,i2.x),
vec3(i0.y,i1.y,i2.y),
vec3(i0.z,i1.z,i2.z)
);return outMatrix;}
fn inverseMat3(inMatrix: mat3x3f)->mat3x3f {let a00: f32=inMatrix[0][0];let a01: f32=inMatrix[0][1];let a02: f32=inMatrix[0][2];let a10: f32=inMatrix[1][0];let a11: f32=inMatrix[1][1];let a12: f32=inMatrix[1][2];let a20: f32=inMatrix[2][0];let a21: f32=inMatrix[2][1];let a22: f32=inMatrix[2][2];let b01: f32=a22*a11-a12*a21;let b11: f32=-a22*a10+a12*a20;let b21: f32=a21*a10-a11*a20;let det: f32=a00*b01+a01*b11+a02*b21;return mat3x3f(b01/det,(-a22*a01+a02*a21)/det,(a12*a01-a02*a11)/det,
b11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det,
b21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);}
#if USE_EXACT_SRGB_CONVERSIONS
fn toLinearSpaceExact(color: vec3<f32>)->vec3<f32>
{let nearZeroSection: vec3<f32>=0.0773993808*color;let remainingSection: vec3<f32>=pow(0.947867299*(color+vec3<f32>(0.055)),vec3<f32>(2.4));return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3<f32>(0.04045)));}
fn toGammaSpaceExact(color: vec3<f32>)->vec3<f32>
{let nearZeroSection: vec3<f32>=12.92*color;let remainingSection: vec3<f32>=1.055*pow(color,vec3<f32>(0.41666))-vec3<f32>(0.055);return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3<f32>(0.0031308)));}
#endif
fn toLinearSpace(color: f32)->f32
{
#if USE_EXACT_SRGB_CONVERSIONS
var nearZeroSection=0.0773993808*color;var remainingSection=pow(0.947867299*(color+0.055),2.4);return select(remainingSection,nearZeroSection,color<=0.04045);
#else
return pow(color,LinearEncodePowerApprox);
#endif
}
fn toLinearSpaceVec3(color: vec3<f32>)->vec3<f32>
{
#if USE_EXACT_SRGB_CONVERSIONS
return toLinearSpaceExact(color);
#else
return pow(color,vec3<f32>(LinearEncodePowerApprox));
#endif
}
fn toLinearSpaceVec4(color: vec4<f32>)->vec4<f32>
{
#if USE_EXACT_SRGB_CONVERSIONS
return vec4f(toLinearSpaceExact(color.rgb),color.a);
#else
return vec4f(pow(color.rgb,vec3f(LinearEncodePowerApprox)),color.a);
#endif
}
fn toGammaSpace(color: vec4<f32>)->vec4<f32>
{
#if USE_EXACT_SRGB_CONVERSIONS
return vec4<f32>(toGammaSpaceExact(color.rgb),color.a);
#else
return vec4<f32>(pow(color.rgb,vec3<f32>(GammaEncodePowerApprox)),color.a);
#endif
}
fn toGammaSpaceVec3(color: vec3<f32>)->vec3<f32>
{
#if USE_EXACT_SRGB_CONVERSIONS
return toGammaSpaceExact(color);
#else
return pow(color,vec3<f32>(GammaEncodePowerApprox));
#endif
}
fn squareVec3(value: vec3<f32>)->vec3<f32>
{return value*value;}
fn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;}
fn getLuminance(color: vec3<f32>)->f32
{return clamp(dot(color,LuminanceEncodeApprox),0.,1.);}
fn getRand(seed: vec2<f32>)->f32 {return fract(sin(dot(seed.xy ,vec2<f32>(12.9898,78.233)))*43758.5453);}
fn dither(seed: vec2<f32>,varianceAmount: f32)->f32 {let rand: f32=getRand(seed);let normVariance: f32=varianceAmount/255.0;let dither: f32=mix(-normVariance,normVariance,rand);return dither;}
const rgbdMaxRange: f32=255.0;fn toRGBD(color: vec3<f32>)->vec4<f32> {let maxRGB: f32=max(max(color.r,max(color.g,color.b)),Epsilon);var D: f32 =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);var rgb: vec3<f32> =color.rgb*D;rgb=toGammaSpaceVec3(rgb);return vec4<f32>(clamp(rgb,vec3<f32>(0.,0.,0.),vec3<f32>(1.,1.,1.)),D); }
fn fromRGBD(rgbd: vec4<f32>)->vec3<f32> {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;}
fn parallaxCorrectNormal(vertexPos: vec3<f32>,origVec: vec3<f32>,cubeSize: vec3<f32>,cubePos: vec3<f32>)->vec3<f32> {let invOrigVec: vec3<f32>=vec3<f32>(1.0,1.0,1.0)/origVec;let halfSize: vec3<f32>=cubeSize*0.5;let intersecAtMaxPlane: vec3<f32>=(cubePos+halfSize-vertexPos)*invOrigVec;let intersecAtMinPlane: vec3<f32>=(cubePos-halfSize-vertexPos)*invOrigVec;let largestIntersec: vec3<f32>=max(intersecAtMaxPlane,intersecAtMinPlane);let distance: f32=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);let intersectPositionWS: vec3<f32>=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const helperFunctionsWGSL = { name, shader };
//# sourceMappingURL=helperFunctions.js.map

/***/ }),

/***/ 16205:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   imageProcessingDeclarationWGSL: () => (/* binding */ imageProcessingDeclarationWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "imageProcessingDeclaration";
const shader = `#ifdef EXPOSURE
uniform exposureLinear: f32;
#endif
#ifdef CONTRAST
uniform contrast: f32;
#endif
#if defined(VIGNETTE) || defined(DITHER)
uniform vInverseScreenSize: vec2f;
#endif
#ifdef VIGNETTE
uniform vignetteSettings1: vec4f;uniform vignetteSettings2: vec4f;
#endif
#ifdef COLORCURVES
uniform vCameraColorCurveNegative: vec4f;uniform vCameraColorCurveNeutral: vec4f;uniform vCameraColorCurvePositive: vec4f;
#endif
#ifdef COLORGRADING
#ifdef COLORGRADING3D
var txColorTransformSampler: sampler;var txColorTransform: texture_3d<f32>;
#else
var txColorTransformSampler: sampler;var txColorTransform: texture_2d<f32>;
#endif
uniform colorTransformSettings: vec4f;
#endif
#ifdef DITHER
uniform ditherIntensity: f32;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const imageProcessingDeclarationWGSL = { name, shader };
//# sourceMappingURL=imageProcessingDeclaration.js.map

/***/ }),

/***/ 88996:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   imageProcessingFunctionsWGSL: () => (/* binding */ imageProcessingFunctionsWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "imageProcessingFunctions";
const shader = `#if TONEMAPPING==3
const PBRNeutralStartCompression: f32=0.8-0.04;const PBRNeutralDesaturation: f32=0.15;fn PBRNeutralToneMapping( color: vec3f )->vec3f {var x: f32=min(color.r,min(color.g,color.b));var offset: f32=select(0.04,x-6.25*x*x,x<0.08);var result=color;result-=offset;var peak: f32=max(result.r,max(result.g,result.b));if (peak<PBRNeutralStartCompression) {return result;}
var d: f32=1.-PBRNeutralStartCompression;var newPeak: f32=1.-d*d/(peak+d-PBRNeutralStartCompression);result*=newPeak/peak;var g: f32=1.-1./(PBRNeutralDesaturation*(peak-newPeak)+1.);return mix(result,newPeak* vec3f(1,1,1),g);}
#endif
#if TONEMAPPING==2
const ACESInputMat: mat3x3f= mat3x3f(
vec3f(0.59719,0.07600,0.02840),
vec3f(0.35458,0.90834,0.13383),
vec3f(0.04823,0.01566,0.83777)
);const ACESOutputMat: mat3x3f= mat3x3f(
vec3f( 1.60475,-0.10208,-0.00327),
vec3f(-0.53108, 1.10813,-0.07276),
vec3f(-0.07367,-0.00605, 1.07602)
);fn RRTAndODTFit(v: vec3f)->vec3f
{var a: vec3f=v*(v+0.0245786)-0.000090537;var b: vec3f=v*(0.983729*v+0.4329510)+0.238081;return a/b;}
fn ACESFitted(color: vec3f)->vec3f
{var output=ACESInputMat*color;output=RRTAndODTFit(output);output=ACESOutputMat*output;output=saturateVec3(output);return output;}
#endif
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS
fn applyImageProcessing(result: vec4f)->vec4f {
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART
var rgb=result.rgb;;
#ifdef EXPOSURE
rgb*=uniforms.exposureLinear;
#endif
#ifdef VIGNETTE
var viewportXY: vec2f=fragmentInputs.position.xy*uniforms.vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;var vignetteXY1: vec3f= vec3f(viewportXY*uniforms.vignetteSettings1.xy+uniforms.vignetteSettings1.zw,1.0);var vignetteTerm: f32=dot(vignetteXY1,vignetteXY1);var vignette: f32=pow(vignetteTerm,uniforms.vignetteSettings2.w);var vignetteColor: vec3f=uniforms.vignetteSettings2.rgb;
#ifdef VIGNETTEBLENDMODEMULTIPLY
var vignetteColorMultiplier: vec3f=mix(vignetteColor, vec3f(1,1,1),vignette);rgb*=vignetteColorMultiplier;
#endif
#ifdef VIGNETTEBLENDMODEOPAQUE
rgb=mix(vignetteColor,rgb,vignette);
#endif
#endif
#if TONEMAPPING==3
rgb=PBRNeutralToneMapping(rgb);
#elif TONEMAPPING==2
rgb=ACESFitted(rgb);
#elif TONEMAPPING==1
const tonemappingCalibration: f32=1.590579;rgb=1.0-exp2(-tonemappingCalibration*rgb);
#endif
rgb=toGammaSpaceVec3(rgb);rgb=saturateVec3(rgb);
#ifdef CONTRAST
var resultHighContrast: vec3f=rgb*rgb*(3.0-2.0*rgb);if (uniforms.contrast<1.0) {rgb=mix( vec3f(0.5,0.5,0.5),rgb,uniforms.contrast);} else {rgb=mix(rgb,resultHighContrast,uniforms.contrast-1.0);}
#endif
#ifdef COLORGRADING
var colorTransformInput: vec3f=rgb*uniforms.colorTransformSettings.xxx+uniforms.colorTransformSettings.yyy;
#ifdef COLORGRADING3D
var colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput).rgb;
#else
var colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput,uniforms.colorTransformSettings.yz).rgb;
#endif
rgb=mix(rgb,colorTransformOutput,uniforms.colorTransformSettings.www);
#endif
#ifdef COLORCURVES
var luma: f32=getLuminance(rgb);var curveMix: vec2f=clamp( vec2f(luma*3.0-1.5,luma*-3.0+1.5), vec2f(0.0), vec2f(1.0));var colorCurve: vec4f=uniforms.vCameraColorCurveNeutral+curveMix.x*uniforms.vCameraColorCurvePositive-curveMix.y*uniforms.vCameraColorCurveNegative;rgb*=colorCurve.rgb;rgb=mix( vec3f(luma),rgb,colorCurve.a);
#endif
#ifdef DITHER
var rand: f32=getRand(fragmentInputs.position.xy*uniforms.vInverseScreenSize);var dither: f32=mix(-uniforms.ditherIntensity,uniforms.ditherIntensity,rand);rgb=saturateVec3(rgb+ vec3f(dither));
#endif
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND
return vec4f(rgb,result.a);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const imageProcessingFunctionsWGSL = { name, shader };
//# sourceMappingURL=imageProcessingFunctions.js.map

/***/ }),

/***/ 75136:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export importanceSamplingWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "importanceSampling";
const shader = `fn hemisphereCosSample(u: vec2f)->vec3f {var phi: f32=2.*PI*u.x;var cosTheta2: f32=1.-u.y;var cosTheta: f32=sqrt(cosTheta2);var sinTheta: f32=sqrt(1.-cosTheta2);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
fn hemisphereImportanceSampleDggx(u: vec2f,a: f32)->vec3f {var phi: f32=2.*PI*u.x;var cosTheta2: f32=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));var cosTheta: f32=sqrt(cosTheta2);var sinTheta: f32=sqrt(1.-cosTheta2);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
fn hemisphereImportanceSampleDCharlie(u: vec2f,a: f32)->vec3f { 
var phi: f32=2.*PI*u.x;var sinTheta: f32=pow(u.y,a/(2.*a+1.));var cosTheta: f32=sqrt(1.-sinTheta*sinTheta);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const importanceSamplingWGSL = { name, shader };
//# sourceMappingURL=importanceSampling.js.map

/***/ }),

/***/ 44559:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export instancesDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "instancesDeclaration";
const shader = `#ifdef INSTANCES
attribute world0 : vec4<f32>;attribute world1 : vec4<f32>;attribute world2 : vec4<f32>;attribute world3 : vec4<f32>;
#ifdef INSTANCESCOLOR
attribute instanceColor : vec4<f32>;
#endif
#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)
uniform world : mat4x4<f32>;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
attribute previousWorld0 : vec4<f32>;attribute previousWorld1 : vec4<f32>;attribute previousWorld2 : vec4<f32>;attribute previousWorld3 : vec4<f32>;
#ifdef THIN_INSTANCES
uniform previousWorld : mat4x4<f32>;
#endif
#endif
#else
#if !defined(WORLD_UBO)
uniform world : mat4x4<f32>;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
uniform previousWorld : mat4x4<f32>;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const instancesDeclarationWGSL = { name, shader };
//# sourceMappingURL=instancesDeclaration.js.map

/***/ }),

/***/ 91277:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export instancesVertexWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "instancesVertex";
const shader = `#ifdef INSTANCES
var finalWorld=mat4x4<f32>(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
var finalPreviousWorld=mat4x4<f32>(
vertexInputs.previousWorld0,vertexInputs.previousWorld1,
vertexInputs.previousWorld2,vertexInputs.previousWorld3);
#endif
#ifdef THIN_INSTANCES
#if !defined(WORLD_UBO)
finalWorld=uniforms.world*finalWorld;
#else
finalWorld=mesh.world*finalWorld;
#endif
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
finalPreviousWorld=uniforms.previousWorld*finalPreviousWorld;
#endif
#endif
#else
#if !defined(WORLD_UBO)
var finalWorld=uniforms.world;
#else
var finalWorld=mesh.world;
#endif
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
var finalPreviousWorld=uniforms.previousWorld;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const instancesVertexWGSL = { name, shader };
//# sourceMappingURL=instancesVertex.js.map

/***/ }),

/***/ 52383:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export kernelBlurVaryingDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "kernelBlurVaryingDeclaration";
const shader = `varying sampleCoord{X}: vec2f;`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const kernelBlurVaryingDeclarationWGSL = { name, shader };
//# sourceMappingURL=kernelBlurVaryingDeclaration.js.map

/***/ }),

/***/ 25271:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightFragmentWGSL: () => (/* binding */ lightFragmentWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightFragment";
const shader = `#ifdef LIGHT{X}
#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})
#else
var diffuse{X}: vec4f=light{X}.vLightDiffuse;
#define CUSTOM_LIGHT{X}_COLOR 
#ifdef PBR
#ifdef SPOTLIGHT{X}
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,fragmentInputs.vPositionW);
#elif defined(POINTLIGHT{X})
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,fragmentInputs.vPositionW);
#elif defined(HEMILIGHT{X})
preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#elif defined(DIRLIGHT{X})
preInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#endif
preInfo.NdotV=NdotV;
#ifdef SPOTLIGHT{X}
#ifdef LIGHT_FALLOFF_GLTF{X}
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);
#elif defined(LIGHT_FALLOFF_STANDARD{X})
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);
#else
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
#endif
#elif defined(POINTLIGHT{X})
#ifdef LIGHT_FALLOFF_GLTF{X}
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);
#elif defined(LIGHT_FALLOFF_STANDARD{X})
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);
#else
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);
#endif
#else
preInfo.attenuation=1.0;
#endif
#ifdef HEMILIGHT{X}
preInfo.roughness=roughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
#ifdef IRIDESCENCE
preInfo.iridescenceIntensity=iridescenceIntensity;
#endif
#ifdef HEMILIGHT{X}
info.diffuse=computeHemisphericDiffuseLighting(preInfo,diffuse{X}.rgb,light{X}.vLightGround);
#elif defined(SS_TRANSLUCENCY)
info.diffuse=computeDiffuseAndTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance);
#else
info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb);
#endif
#ifdef SPECULARTERM
#ifdef ANISOTROPIC
info.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
#else
info.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
#endif
#endif
#ifdef SHEEN
#ifdef SHEEN_LINKWITHALBEDO
preInfo.roughness=sheenOut.sheenIntensity;
#else
#ifdef HEMILIGHT{X}
preInfo.roughness=sheenOut.sheenRoughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
#endif
info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
#endif
#ifdef CLEARCOAT
#ifdef HEMILIGHT{X}
preInfo.roughness=clearcoatOut.clearCoatRoughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,diffuse{X}.rgb);
#ifdef CLEARCOAT_TINT
absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
#ifdef SPECULARTERM
info.specular*=absorption;
#endif
#endif
info.diffuse*=info.clearCoat.w;
#ifdef SPECULARTERM
info.specular*=info.clearCoat.w;
#endif
#ifdef SHEEN
info.sheen*=info.clearCoat.w;
#endif
#endif
#else
#ifdef SPOTLIGHT{X}
info=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);
#elif defined(HEMILIGHT{X})
info=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);
#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})
info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);
#endif
#endif
#ifdef PROJECTEDLIGHTTEXTURE{X}
info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},projectionLightTexture{X}Sampler,uniforms.textureProjectionMatrix{X},fragmentInputs.vPositionW);
#endif
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSMDEBUG{X}
var shadowDebug{X}: vec3f;
#endif
#ifdef SHADOWCSM{X}
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
var index{X}: i32=-1;
#else
var index{X}: i32=SHADOWCSMNUM_CASCADES{X}-1;
#endif
var diff{X}: f32=0.;vPositionFromLight{X}[0]=fragmentInputs.vPositionFromLight{X}_0;vPositionFromLight{X}[1]=fragmentInputs.vPositionFromLight{X}_1;vPositionFromLight{X}[2]=fragmentInputs.vPositionFromLight{X}_2;vPositionFromLight{X}[3]=fragmentInputs.vPositionFromLight{X}_3;vDepthMetric{X}[0]=fragmentInputs.vDepthMetric{X}_0;vDepthMetric{X}[1]=fragmentInputs.vDepthMetric{X}_1;vDepthMetric{X}[2]=fragmentInputs.vDepthMetric{X}_2;vDepthMetric{X}[3]=fragmentInputs.vDepthMetric{X}_3;for (var i:i32=0; i<SHADOWCSMNUM_CASCADES{X}; i++) 
{
#ifdef SHADOWCSM_RIGHTHANDED{X}
diff{X}=uniforms.viewFrustumZ{X}[i]+fragmentInputs.vPositionFromCamera{X}.z;
#else
diff{X}=uniforms.viewFrustumZ{X}[i]-fragmentInputs.vPositionFromCamera{X}.z;
#endif
if (diff{X}>=0.) {index{X}=i;break;}}
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
if (index{X}>=0)
#endif
{
#if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithCSMPCF1(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithCSMPCF3(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithCSMPCF5(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithCSMPCSS16(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithCSMPCSS32(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});
#else
shadow=computeShadowWithCSMPCSS64(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});
#endif
#else
shadow=computeShadowCSM(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X}=vec3f(shadow)*vCascadeColorsMultiplier{X}[index{X}];
#endif
#ifndef SHADOWCSMNOBLEND{X}
var frustumLength:f32=uniforms.frustumLengths{X}[index{X}];var diffRatio:f32=clamp(diff{X}/frustumLength,0.,1.)*uniforms.cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)
{index{X}+=1;var nextShadow: f32=0.;
#if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
nextShadow=computeShadowWithCSMPCF1(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],,shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
nextShadow=computeShadowWithCSMPCF3(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
nextShadow=computeShadowWithCSMPCF5(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
nextShadow=computeShadowWithCSMPCSS16(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});
#elif defined(SHADOWMEDIUMQUALITY{X})
nextShadow=computeShadowWithCSMPCSS32(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});
#else
nextShadow=computeShadowWithCSMPCSS64(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,uniforms.lightSizeUVCorrection{X}[index{X}],uniforms.depthCorrection{X}[index{X}],uniforms.penumbraDarkness{X});
#endif
#else
nextShadow=computeShadowCSM(index{X},vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
shadow=mix(nextShadow,shadow,diffRatio);
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);
#endif
}
#endif
}
#elif defined(SHADOWCLOSEESM{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithCloseESMCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
#else
shadow=computeShadowWithCloseESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWESM{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithESMCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
#else
shadow=computeShadowWithESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPOISSON{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithPoissonSamplingCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);
#else
shadow=computeShadowWithPoissonSampling(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithPCF1(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithPCF3(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithPCF5(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithPCSS16(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithPCSS32(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithPCSS64(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},depthTexture{X},depthTexture{X}Sampler,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#else
#if defined(SHADOWCUBE{X})
shadow=computeShadowCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.depthValues);
#else
shadow=computeShadow(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#endif
#ifdef SHADOWONLY
#ifndef SHADOWINUSE
#define SHADOWINUSE
#endif
globalShadow+=shadow;shadowLightCount+=1.0;
#endif
#else
shadow=1.;
#endif
aggShadow+=shadow;numLights+=1.0;
#ifndef SHADOWONLY
#ifdef CUSTOMUSERLIGHTING
diffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);
#ifdef SPECULARTERM
specularBase+=computeCustomSpecularLighting(info,specularBase,shadow);
#endif
#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})
diffuseBase+=lightmapColor.rgb*shadow;
#ifdef SPECULARTERM
#ifndef LIGHTMAPNOSPECULAR{X}
specularBase+=info.specular*shadow*lightmapColor.rgb;
#endif
#endif
#ifdef CLEARCOAT
#ifndef LIGHTMAPNOSPECULAR{X}
clearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;
#endif
#endif
#ifdef SHEEN
#ifndef LIGHTMAPNOSPECULAR{X}
sheenBase+=info.sheen.rgb*shadow;
#endif
#endif
#else
#ifdef SHADOWCSMDEBUG{X}
diffuseBase+=info.diffuse*shadowDebug{X};
#else 
diffuseBase+=info.diffuse*shadow;
#endif
#ifdef SPECULARTERM
specularBase+=info.specular*shadow;
#endif
#ifdef CLEARCOAT
clearCoatBase+=info.clearCoat.rgb*shadow;
#endif
#ifdef SHEEN
sheenBase+=info.sheen.rgb*shadow;
#endif
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const lightFragmentWGSL = { name, shader };
//# sourceMappingURL=lightFragment.js.map

/***/ }),

/***/ 30379:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightUboDeclarationWGSL: () => (/* binding */ lightUboDeclarationWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightUboDeclaration";
const shader = `#ifdef LIGHT{X}
struct Light{X}
{vLightData: vec4f,
vLightDiffuse: vec4f,
vLightSpecular: vec4f,
#ifdef SPOTLIGHT{X}
vLightDirection: vec4f,
vLightFalloff: vec4f,
#elif defined(POINTLIGHT{X})
vLightFalloff: vec4f,
#elif defined(HEMILIGHT{X})
vLightGround: vec3f,
#endif
shadowsInfo: vec4f,
depthValues: vec2f} ;var<uniform> light{X} : Light{X};
#ifdef PROJECTEDLIGHTTEXTURE{X}
uniform textureProjectionMatrix{X}: mat4x4f;var projectionLightTexture{X}Sampler: sampler;var projectionLightTexture{X}: texture_2d<f32>;
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform lightMatrix{X}: array<mat4x4f,SHADOWCSMNUM_CASCADES{X}>;uniform viewFrustumZ{X}: array<f32,SHADOWCSMNUM_CASCADES{X}>;uniform frustumLengths{X}: array<f32,SHADOWCSMNUM_CASCADES{X}>;uniform cascadeBlendFactor{X}: f32;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;var<private> vPositionFromLight{X}: array<vec4f,4>;var<private> vDepthMetric{X} : array<f32,4>;
#if defined(SHADOWPCSS{X})
var shadowTexture{X}Sampler: sampler_comparison; 
var shadowTexture{X}: texture_depth_2d_array;var depthTexture{X}Sampler: sampler;var depthTexture{X}: texture_2d_array<f32>;uniform lightSizeUVCorrection{X}: array<vec2f,SHADOWCSMNUM_CASCADES{X}>;uniform depthCorrection{X}: array<f32,SHADOWCSMNUM_CASCADES{X}>;uniform penumbraDarkness{X}: f32;
#elif defined(SHADOWPCF{X})
var shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d_array;
#else 
var shadowTexture{X}Sampler: sampler; 
var shadowTexture{X}: texture_2d_array<f32>;
#endif
#ifdef SHADOWCSMDEBUG{X}
const vCascadeColorsMultiplier{X}: array<vec3f,8>=array<vec3f,8>
(
vec3f ( 1.5,0.0,0.0 ),
vec3f ( 0.0,1.5,0.0 ),
vec3f ( 0.0,0.0,5.5 ),
vec3f ( 1.5,0.0,5.5 ),
vec3f ( 1.5,1.5,0.0 ),
vec3f ( 1.0,1.0,1.0 ),
vec3f ( 0.0,1.0,5.5 ),
vec3f ( 0.5,3.5,0.75 )
);
#endif
#elif defined(SHADOWCUBE{X})
var shadowTexture{X}Sampler: sampler;var shadowTexture{X}: texture_cube<f32>;
#else
varying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;
#if defined(SHADOWPCSS{X})
var shadowTexture{X}Sampler: sampler_comparison; 
var shadowTexture{X}: texture_depth_2d;var depthTexture{X}Sampler: sampler; 
var depthTexture{X}: texture_2d<f32>;
#elif defined(SHADOWPCF{X})
var shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d;
#else
var shadowTexture{X}Sampler: sampler; 
var shadowTexture{X}: texture_2d<f32>;
#endif
uniform lightMatrix{X}: mat4x4f;
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const lightUboDeclarationWGSL = { name, shader };
//# sourceMappingURL=lightUboDeclaration.js.map

/***/ }),

/***/ 3925:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightVxUboDeclarationWGSL: () => (/* binding */ lightVxUboDeclarationWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightVxUboDeclaration";
const shader = `#ifdef LIGHT{X}
struct Light{X}
{vLightData: vec4f,
vLightDiffuse: vec4f,
vLightSpecular: vec4f,
#ifdef SPOTLIGHT{X}
vLightDirection: vec4f,
vLightFalloff: vec4f,
#elif defined(POINTLIGHT{X})
vLightFalloff: vec4f,
#elif defined(HEMILIGHT{X})
vLightGround: vec3f,
#endif
shadowsInfo: vec4f,
depthValues: vec2f} ;var<uniform> light{X} : Light{X};
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform lightMatrix{X}: array<mat4x4f,SHADOWCSMNUM_CASCADES{X}>;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;
#elif defined(SHADOWCUBE{X})
#else
varying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const lightVxUboDeclarationWGSL = { name, shader };
//# sourceMappingURL=lightVxUboDeclaration.js.map

/***/ }),

/***/ 76493:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightsFragmentFunctionsWGSL: () => (/* binding */ lightsFragmentFunctionsWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightsFragmentFunctions";
const shader = `struct lightingInfo
{diffuse: vec3f,
#ifdef SPECULARTERM
specular: vec3f,
#endif
#ifdef NDOTL
ndl: f32,
#endif
};fn computeLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var result: lightingInfo;var lightVectorW: vec3f;var attenuation: f32=1.0;if (lightData.w==0.)
{var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var attenuation: f32=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}
else
{lightVectorW=normalize(-lightData.xyz);}
var ndl: f32=max(0.,dot(vNormal,lightVectorW));
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=ndl*diffuseColor*attenuation;
#ifdef SPECULARTERM
var angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;
#endif
return result;}
fn computeSpotLighting(viewDirectionW: vec3f,vNormal: vec3f ,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var result: lightingInfo;var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var cosAngle: f32=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)
{cosAngle=max(0.,pow(cosAngle,lightData.w));attenuation*=cosAngle;var ndl: f32=max(0.,dot(vNormal,lightVectorW));
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=ndl*diffuseColor*attenuation;
#ifdef SPECULARTERM
var angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;
#endif
return result;}
result.diffuse=vec3f(0.);
#ifdef SPECULARTERM
result.specular=vec3f(0.);
#endif
#ifdef NDOTL
result.ndl=0.;
#endif
return result;}
fn computeHemisphericLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,groundColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=dot(vNormal,lightData.xyz)*0.5+0.5;
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=mix(groundColor,diffuseColor,ndl);
#ifdef SPECULARTERM
var angleW: vec3f=normalize(viewDirectionW+lightData.xyz);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;
#endif
return result;}
fn computeProjectionTextureDiffuseLighting(projectionLightTexture: texture_2d<f32>,projectionLightSampler: sampler,textureProjectionMatrix: mat4x4f,posW: vec3f)->vec3f {var strq: vec4f=textureProjectionMatrix*vec4f(posW,1.0);strq/=strq.w;var textureColor: vec3f=textureSample(projectionLightTexture,projectionLightSampler,strq.xy).rgb;return textureColor;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const lightsFragmentFunctionsWGSL = { name, shader };
//# sourceMappingURL=lightsFragmentFunctions.js.map

/***/ }),

/***/ 93226:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export logDepthDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "logDepthDeclaration";
const shader = `#ifdef LOGARITHMICDEPTH
uniform logarithmicDepthConstant: f32;varying vFragmentDepth: f32;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const logDepthDeclarationWGSL = { name, shader };
//# sourceMappingURL=logDepthDeclaration.js.map

/***/ }),

/***/ 38780:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export logDepthFragmentWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "logDepthFragment";
const shader = `#ifdef LOGARITHMICDEPTH
fragmentOutputs.fragDepth=log2(fragmentInputs.vFragmentDepth)*uniforms.logarithmicDepthConstant*0.5;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const logDepthFragmentWGSL = { name, shader };
//# sourceMappingURL=logDepthFragment.js.map

/***/ }),

/***/ 81482:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export logDepthVertexWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "logDepthVertex";
const shader = `#ifdef LOGARITHMICDEPTH
vertexOutputs.vFragmentDepth=1.0+vertexOutputs.position.w;vertexOutputs.position.z=log2(max(0.000001,vertexOutputs.vFragmentDepth))*uniforms.logarithmicDepthConstant;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const logDepthVertexWGSL = { name, shader };
//# sourceMappingURL=logDepthVertex.js.map

/***/ }),

/***/ 41861:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export mainUVVaryingDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "mainUVVaryingDeclaration";
const shader = `#ifdef MAINUV{X}
varying vMainUV{X}: vec2f;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const mainUVVaryingDeclarationWGSL = { name, shader };
//# sourceMappingURL=mainUVVaryingDeclaration.js.map

/***/ }),

/***/ 6874:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export meshUboDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUboDeclaration";
const shader = `struct Mesh {world : mat4x4<f32>,
visibility : f32,};var<uniform> mesh : Mesh;
#define WORLD_UBO
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const meshUboDeclarationWGSL = { name, shader };
//# sourceMappingURL=meshUboDeclaration.js.map

/***/ }),

/***/ 9129:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   morphTargetsVertexWGSL: () => (/* binding */ morphTargetsVertexWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "morphTargetsVertex";
const shader = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE
#if {X}==0
for (var i=0; i<NUM_MORPH_INFLUENCERS; i=i+1) {if (i>=uniforms.morphTargetCount) {break;}
vertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x;positionUpdated=positionUpdated+(readVector3FromRawSampler(i,vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[i];vertexID=vertexID+1.0;
#ifdef MORPHTARGETS_NORMAL
normalUpdated=normalUpdated+(readVector3FromRawSampler(i,vertexID) -vertexInputs.normal)*uniforms.morphTargetInfluences[i];vertexID=vertexID+1.0;
#endif
#ifdef MORPHTARGETS_UV
uvUpdated=uvUpdated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv)*uniforms.morphTargetInfluences[i];vertexID=vertexID+1.0;
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated=vec4f(tangentUpdated.xyz+(readVector3FromRawSampler(i,vertexID) -vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[i],tangentUpdated.a);
#endif
}
#endif
#else
positionUpdated=positionUpdated+(vertexInputs.position{X}-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];
#ifdef MORPHTARGETS_NORMAL
normalUpdated+=(vertexInputs.normal{X}-vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated=vec4f(tangentUpdated.xyz+(vertexInputs.tangent{X}-vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}],tangentUpdated.a);
#endif
#ifdef MORPHTARGETS_UV
uvUpdated=uvUpdated+(vertexInputs.uv_{X}-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const morphTargetsVertexWGSL = { name, shader };
//# sourceMappingURL=morphTargetsVertex.js.map

/***/ }),

/***/ 8217:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   morphTargetsVertexDeclarationWGSL: () => (/* binding */ morphTargetsVertexDeclarationWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "morphTargetsVertexDeclaration";
const shader = `#ifdef MORPHTARGETS
#ifndef MORPHTARGETS_TEXTURE
attribute position{X} : vec3<f32>;
#ifdef MORPHTARGETS_NORMAL
attribute normal{X} : vec3<f32>;
#endif
#ifdef MORPHTARGETS_TANGENT
attribute tangent{X} : vec3<f32>;
#endif
#ifdef MORPHTARGETS_UV
attribute uv_{X} : vec2<f32>;
#endif
#elif {X}==0
uniform morphTargetCount: i32;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const morphTargetsVertexDeclarationWGSL = { name, shader };
//# sourceMappingURL=morphTargetsVertexDeclaration.js.map

/***/ }),

/***/ 18258:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   morphTargetsVertexGlobalWGSL: () => (/* binding */ morphTargetsVertexGlobalWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "morphTargetsVertexGlobal";
const shader = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE
var vertexID : f32;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const morphTargetsVertexGlobalWGSL = { name, shader };
//# sourceMappingURL=morphTargetsVertexGlobal.js.map

/***/ }),

/***/ 76340:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   morphTargetsVertexGlobalDeclarationWGSL: () => (/* binding */ morphTargetsVertexGlobalDeclarationWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "morphTargetsVertexGlobalDeclaration";
const shader = `#ifdef MORPHTARGETS
uniform morphTargetInfluences : array<f32,NUM_MORPH_INFLUENCERS>;
#ifdef MORPHTARGETS_TEXTURE 
uniform morphTargetTextureIndices : array<f32,NUM_MORPH_INFLUENCERS>;uniform morphTargetTextureInfo : vec3<f32>;var morphTargets : texture_2d_array<f32>;var morphTargetsSampler : sampler;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3<f32>
{ 
let y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);let x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;let textureUV=vec2<f32>((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);return textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0).xyz;}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const morphTargetsVertexGlobalDeclarationWGSL = { name, shader };
//# sourceMappingURL=morphTargetsVertexGlobalDeclaration.js.map

/***/ }),

/***/ 18639:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export oitDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "oitDeclaration";
const shader = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY
#define MAX_DEPTH 99999.0
var oitDepthSamplerSampler: sampler;var oitDepthSampler: texture_2d<f32>;var oitFrontColorSamplerSampler: sampler;var oitFrontColorSampler: texture_2d<f32>;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const oitDeclarationWGSL = { name, shader };
//# sourceMappingURL=oitDeclaration.js.map

/***/ }),

/***/ 91347:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export oitFragmentWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "oitFragment";
const shader = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY
var fragDepth: f32=fragmentInputs.position.z; 
#ifdef ORDER_INDEPENDENT_TRANSPARENCY_16BITS
var halfFloat: i32=packHalf2x16( vec2f(fragDepth));var full: vec2f=unpackHalf2x16(halfFloat);fragDepth=full.x;
#endif
var fragCoord: vec2i=vec2i(fragmentInputs.position.xy);var lastDepth: vec2f=textureLoad(oitDepthSampler,fragCoord,0).rg;var lastFrontColor: vec4f=textureLoad(oitFrontColorSampler,fragCoord,0);fragmentOutputs.depth=vec2f(-MAX_DEPTH);fragmentOutputs.frontColor=lastFrontColor;fragmentOutputs.backColor= vec4f(0.0);
#ifdef USE_REVERSE_DEPTHBUFFER
var furthestDepth: f32=-lastDepth.x;var nearestDepth: f32=lastDepth.y;
#else
var nearestDepth: f32=-lastDepth.x;var furthestDepth: f32=lastDepth.y;
#endif
var alphaMultiplier: f32=1.0-lastFrontColor.a;
#ifdef USE_REVERSE_DEPTHBUFFER
if (fragDepth>nearestDepth || fragDepth<furthestDepth) {
#else
if (fragDepth<nearestDepth || fragDepth>furthestDepth) {
#endif
return fragmentOutputs;}
#ifdef USE_REVERSE_DEPTHBUFFER
if (fragDepth<nearestDepth && fragDepth>furthestDepth) {
#else
if (fragDepth>nearestDepth && fragDepth<furthestDepth) {
#endif
fragmentOutputs.depth=vec2f(-fragDepth,fragDepth);return fragmentOutputs;}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const oitFragmentWGSL = { name, shader };
//# sourceMappingURL=oitFragment.js.map

/***/ }),

/***/ 5543:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   packingFunctionsWGSL: () => (/* binding */ packingFunctionsWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "packingFunctions";
const shader = `fn pack(depth: f32)->vec4f
{const bit_shift: vec4f= vec4f(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const bit_mask: vec4f= vec4f(0.0,1.0/255.0,1.0/255.0,1.0/255.0);var res: vec4f=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}
fn unpack(color: vec4f)->f32
{const bit_shift: vec4f= vec4f(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const packingFunctionsWGSL = { name, shader };
//# sourceMappingURL=packingFunctions.js.map

/***/ }),

/***/ 75052:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export pbrBRDFFunctionsWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "pbrBRDFFunctions";
const shader = `#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
#ifdef MS_BRDF_ENERGY_CONSERVATION
fn getEnergyConservationFactor(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}
#endif
#ifdef ENVIRONMENTBRDF
fn getBRDFLookup(NdotV: f32,perceptualRoughness: f32)->vec3f {var UV: vec2f= vec2f(NdotV,perceptualRoughness);var brdfLookup: vec4f= textureSample(environmentBrdfSampler,environmentBrdfSamplerSampler,UV);
#ifdef ENVIRONMENTBRDF_RGBD
brdfLookup=vec4f(fromRGBD(brdfLookup.rgba),brdfLookup.a);
#endif
return brdfLookup.rgb;}
fn getReflectanceFromBRDFWithEnvLookup(specularEnvironmentR0: vec3f,specularEnvironmentR90: vec3f,environmentBrdf: vec3f)->vec3f {
#ifdef BRDF_V_HEIGHT_CORRELATED
var reflectance: vec3f=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;
#else
var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;
#endif
return reflectance;}
fn getReflectanceFromBRDFLookup(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {
#ifdef BRDF_V_HEIGHT_CORRELATED
var reflectance: vec3f=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);
#else
var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;
#endif
return reflectance;}
#endif
/* NOT USED
#if defined(SHEEN) && defined(SHEEN_SOFTER)
fn getBRDFLookupCharlieSheen(NdotV: f32,perceptualRoughness: f32)->f32
{var c: f32=1.0-NdotV;var c3: f32=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));}
#endif
*/
#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)
fn getReflectanceFromAnalyticalBRDFLookup_Jones(VdotN: f32,reflectance0: vec3f,reflectance90: vec3f,smoothness: f32)->vec3f
{var weight: f32=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF)
/**
* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.
* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table
*/
fn getSheenReflectanceFromBRDFLookup(reflectance0: vec3f,environmentBrdf: vec3f)->vec3f {var sheenEnvironmentReflectance: vec3f=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}
#endif
fn fresnelSchlickGGXVec3(VdotH: f32,reflectance0: vec3f,reflectance90: vec3f)->vec3f
{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
fn fresnelSchlickGGX(VdotH: f32,reflectance0: f32,reflectance90: f32)->f32
{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
#ifdef CLEARCOAT
fn getR0RemappedForClearCoat(f0: vec3f)->vec3f {
#ifdef CLEARCOAT_DEFAULTIOR
#ifdef MOBILE
return saturateVec3(f0*(f0*0.526868+0.529324)-0.0482256);
#else
return saturateVec3(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);
#endif
#else
var s: vec3f=sqrt(f0);var t: vec3f=(uniforms.vClearCoatRefractionParams.z+uniforms.vClearCoatRefractionParams.w*s)/(uniforms.vClearCoatRefractionParams.w+uniforms.vClearCoatRefractionParams.z*s);return squareVec3(t);
#endif
}
#endif
#ifdef IRIDESCENCE
const XYZ_TO_REC709: mat3x3f= mat3x3f(
3.2404542,-0.9692660, 0.0556434,
-1.5371385, 1.8760108,-0.2040259,
-0.4985314, 0.0415560, 1.0572252
);fn getIORTfromAirToSurfaceR0(f0: vec3f)->vec3f {var sqrtF0: vec3f=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}
fn getR0fromIORsVec3(iorT: vec3f,iorI: f32)->vec3f {return squareVec3((iorT- vec3f(iorI))/(iorT+ vec3f(iorI)));}
fn getR0fromIORs(iorT: f32,iorI: f32)->f32 {return square((iorT-iorI)/(iorT+iorI));}
fn evalSensitivity(opd: f32,shift: vec3f)->vec3f {var phase: f32=2.0*PI*opd*1.0e-9;const val: vec3f= vec3f(5.4856e-13,4.4201e-13,5.2481e-13);const pos: vec3f= vec3f(1.6810e+06,1.7953e+06,2.2084e+06);const vr: vec3f= vec3f(4.3278e+09,9.3046e+09,6.6121e+09);var xyz: vec3f=val*sqrt(2.0*PI*vr)*cos(pos*phase+shift)*exp(-square(phase)*vr);xyz.x+=9.7470e-14*sqrt(2.0*PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*square(phase));xyz/=1.0685e-7;var srgb: vec3f=XYZ_TO_REC709*xyz;return srgb;}
fn evalIridescence(outsideIOR: f32,eta2: f32,cosTheta1: f32,thinFilmThickness: f32,baseF0: vec3f)->vec3f {var I: vec3f= vec3f(1.0);var iridescenceIOR: f32=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));var sinTheta2Sq: f32=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));var cosTheta2Sq: f32=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;}
var cosTheta2: f32=sqrt(cosTheta2Sq);var R0: f32=getR0fromIORs(iridescenceIOR,outsideIOR);var R12: f32=fresnelSchlickGGX(cosTheta1,R0,1.);var R21: f32=R12;var T121: f32=1.0-R12;var phi12: f32=0.0;if (iridescenceIOR<outsideIOR) {phi12=PI;}
var phi21: f32=PI-phi12;var baseIOR: vec3f=getIORTfromAirToSurfaceR0(clamp(baseF0,vec3f(0.0),vec3f(0.9999))); 
var R1: vec3f=getR0fromIORsVec3(baseIOR,iridescenceIOR);var R23: vec3f=fresnelSchlickGGXVec3(cosTheta2,R1, vec3f(1.));var phi23: vec3f= vec3f(0.0);if (baseIOR[0]<iridescenceIOR) {phi23[0]=PI;}
if (baseIOR[1]<iridescenceIOR) {phi23[1]=PI;}
if (baseIOR[2]<iridescenceIOR) {phi23[2]=PI;}
var opd: f32=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;var phi: vec3f= vec3f(phi21)+phi23;var R123: vec3f=clamp(R12*R23,vec3f(1e-5),vec3f(0.9999));var r123: vec3f=sqrt(R123);var Rs: vec3f=(T121*T121)*R23/( vec3f(1.0)-R123);var C0: vec3f=R12+Rs;I=C0;var Cm: vec3f=Rs-T121;for (var m: i32=1; m<=2; m++)
{Cm*=r123;var Sm: vec3f=2.0*evalSensitivity( f32(m)*opd, f32(m)*phi);I+=Cm*Sm;}
return max(I, vec3f(0.0));}
#endif
fn normalDistributionFunction_TrowbridgeReitzGGX(NdotH: f32,alphaG: f32)->f32
{var a2: f32=alphaG*alphaG;var d: f32=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}
#ifdef SHEEN
fn normalDistributionFunction_CharlieSheen(NdotH: f32,alphaG: f32)->f32
{var invR: f32=1./alphaG;var cos2h: f32=NdotH*NdotH;var sin2h: f32=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}
#endif
#ifdef ANISOTROPIC
fn normalDistributionFunction_BurleyGGX_Anisotropic(NdotH: f32,TdotH: f32,BdotH: f32,alphaTB: vec2f)->f32 {var a2: f32=alphaTB.x*alphaTB.y;var v: vec3f= vec3f(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);var v2: f32=dot(v,v);var w2: f32=a2/v2;return a2*w2*w2*RECIPROCAL_PI;}
#endif
#ifdef BRDF_V_HEIGHT_CORRELATED
fn smithVisibility_GGXCorrelated(NdotL: f32,NdotV: f32,alphaG: f32)->f32 {
#ifdef MOBILE
var GGXV: f32=NdotL*(NdotV*(1.0-alphaG)+alphaG);var GGXL: f32=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);
#else
var a2: f32=alphaG*alphaG;var GGXV: f32=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);var GGXL: f32=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL);
#endif
}
#else
fn smithVisibilityG1_TrowbridgeReitzGGXFast(dot: f32,alphaG: f32)->f32
{
#ifdef MOBILE
return 1.0/(dot+alphaG+(1.0-alphaG)*dot ));
#else
var alphaSquared: f32=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));
#endif
}
fn smithVisibility_TrowbridgeReitzGGXFast(NdotL: f32,NdotV: f32,alphaG: f32)->f32
{var visibility: f32=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}
#endif
#ifdef ANISOTROPIC
fn smithVisibility_GGXCorrelated_Anisotropic(NdotL: f32,NdotV: f32,TdotV: f32,BdotV: f32,TdotL: f32,BdotL: f32,alphaTB: vec2f)->f32 {var lambdaV: f32=NdotL*length( vec3f(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));var lambdaL: f32=NdotV*length( vec3f(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));var v: f32=0.5/(lambdaV+lambdaL);return v;}
#endif
#ifdef CLEARCOAT
fn visibility_Kelemen(VdotH: f32)->f32 {return 0.25/(VdotH*VdotH); }
#endif
#ifdef SHEEN
fn visibility_Ashikhmin(NdotL: f32,NdotV: f32)->f32
{return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}
/* NOT USED
#ifdef SHEEN_SOFTER
fn l(x: f32,alphaG: f32)->f32
{var oneMinusAlphaSq: f32=(1.0-alphaG)*(1.0-alphaG);var a: f32=mix(21.5473,25.3245,oneMinusAlphaSq);var b: f32=mix(3.82987,3.32435,oneMinusAlphaSq);var c: f32=mix(0.19823,0.16801,oneMinusAlphaSq);var d: f32=mix(-1.97760,-1.27393,oneMinusAlphaSq);var e: f32=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}
fn lambdaSheen(cosTheta: f32,alphaG: f32)->f32
{return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}
fn visibility_CharlieSheen(NdotL: f32,NdotV: f32,alphaG: f32)->f32
{var G: f32=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}
#endif
*/
#endif
fn diffuseBRDF_Burley(NdotL: f32,NdotV: f32,VdotH: f32,roughness: f32)->f32 {var diffuseFresnelNV: f32=pow5(saturateEps(1.0-NdotL));var diffuseFresnelNL: f32=pow5(saturateEps(1.0-NdotV));var diffuseFresnel90: f32=0.5+2.0*VdotH*VdotH*roughness;var fresnel: f32 =
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}
#ifdef SS_TRANSLUCENCY
fn transmittanceBRDF_Burley(tintColor: vec3f,diffusionDistance: vec3f,thickness: f32)->vec3f {var S: vec3f=1./maxEpsVec3(diffusionDistance);var temp: vec3f=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);}
fn computeWrappedDiffuseNdotL(NdotL: f32,w: f32)->f32 {var t: f32=1.0+w;var invt2: f32=1.0/(t*t);return saturate((NdotL+w)*invt2);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const pbrBRDFFunctionsWGSL = { name, shader };
//# sourceMappingURL=pbrBRDFFunctions.js.map

/***/ }),

/***/ 34035:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export pbrUboDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _sceneUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98327);
/* harmony import */ var _meshUboDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6874);
// Do not edit.



const name = "pbrUboDeclaration";
const shader = `uniform vAlbedoInfos: vec2f;uniform vAmbientInfos: vec4f;uniform vOpacityInfos: vec2f;uniform vEmissiveInfos: vec2f;uniform vLightmapInfos: vec2f;uniform vReflectivityInfos: vec3f;uniform vMicroSurfaceSamplerInfos: vec2f;uniform vReflectionInfos: vec2f;uniform vReflectionFilteringInfo: vec2f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;uniform vBumpInfos: vec3f;uniform albedoMatrix: mat4x4f;uniform ambientMatrix: mat4x4f;uniform opacityMatrix: mat4x4f;uniform emissiveMatrix: mat4x4f;uniform lightmapMatrix: mat4x4f;uniform reflectivityMatrix: mat4x4f;uniform microSurfaceSamplerMatrix: mat4x4f;uniform bumpMatrix: mat4x4f;uniform vTangentSpaceParams: vec2f;uniform reflectionMatrix: mat4x4f;uniform vReflectionColor: vec3f;uniform vAlbedoColor: vec4f;uniform vLightingIntensity: vec4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform pointSize: f32;uniform vReflectivityColor: vec4f;uniform vEmissiveColor: vec3f;uniform vAmbientColor: vec3f;uniform vDebugMode: vec2f;uniform vMetallicReflectanceFactors: vec4f;uniform vMetallicReflectanceInfos: vec2f;uniform metallicReflectanceMatrix: mat4x4f;uniform vReflectanceInfos: vec2f;uniform reflectanceMatrix: mat4x4f;uniform vSphericalL00: vec3f;uniform vSphericalL1_1: vec3f;uniform vSphericalL10: vec3f;uniform vSphericalL11: vec3f;uniform vSphericalL2_2: vec3f;uniform vSphericalL2_1: vec3f;uniform vSphericalL20: vec3f;uniform vSphericalL21: vec3f;uniform vSphericalL22: vec3f;uniform vSphericalX: vec3f;uniform vSphericalY: vec3f;uniform vSphericalZ: vec3f;uniform vSphericalXX_ZZ: vec3f;uniform vSphericalYY_ZZ: vec3f;uniform vSphericalZZ: vec3f;uniform vSphericalXY: vec3f;uniform vSphericalYZ: vec3f;uniform vSphericalZX: vec3f;
#define ADDITIONAL_UBO_DECLARATION
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const pbrUboDeclarationWGSL = { name, shader };
//# sourceMappingURL=pbrUboDeclaration.js.map

/***/ }),

/***/ 54211:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export prePassDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "prePassDeclaration";
const shader = `#ifdef PREPASS
#ifdef PREPASS_LOCAL_POSITION
varying vPosition : vec3f;
#endif
#ifdef PREPASS_DEPTH
varying vViewPos: vec3f;
#endif
#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const prePassDeclarationWGSL = { name, shader };
//# sourceMappingURL=prePassDeclaration.js.map

/***/ }),

/***/ 47033:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export prePassVertexWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "prePassVertex";
const shader = `#ifdef PREPASS_DEPTH
vertexOutputs.vViewPos=(scene.view*worldPos).rgb;
#endif
#ifdef PREPASS_LOCAL_POSITION
vertexOutputs.vPosition=positionUpdated.xyz;
#endif
#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)
vertexOutputs.vCurrentPosition=scene.viewProjection*worldPos;
#if NUM_BONE_INFLUENCERS>0
var previousInfluence: mat4x4f;previousInfluence=mPreviousBones[ i32(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
previousInfluence+=mPreviousBones[ i32(matricesIndices[1])]*matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
previousInfluence+=mPreviousBones[ i32(matricesIndices[2])]*matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
previousInfluence+=mPreviousBones[ i32(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);
#else
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const prePassVertexWGSL = { name, shader };
//# sourceMappingURL=prePassVertex.js.map

/***/ }),

/***/ 37769:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export prePassVertexDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "prePassVertexDeclaration";
const shader = `#ifdef PREPASS
#ifdef PREPASS_LOCAL_POSITION
varying vPosition : vec3f;
#endif
#ifdef PREPASS_DEPTH
varying vViewPos: vec3f;
#endif
#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const prePassVertexDeclarationWGSL = { name, shader };
//# sourceMappingURL=prePassVertexDeclaration.js.map

/***/ }),

/***/ 72230:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   reflectionFunctionWGSL: () => (/* binding */ reflectionFunctionWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "reflectionFunction";
const shader = `fn computeFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
{var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0); }
fn computeMirroredFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
{var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(1.0-s,t,0); }
fn computeEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
{var cameraToVertex: vec3f=normalize(worldPos.xyz-eyePosition);var r: vec3f=normalize(reflect(cameraToVertex,worldNormal));r= (reflectionMatrix* vec4f(r,0)).xyz;var lon: f32=atan2(r.z,r.x);var lat: f32=acos(r.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0);}
fn computeSphericalCoords(worldPos: vec4f,worldNormal: vec3f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f
{var viewDir: vec3f=normalize((view*worldPos).xyz);var viewNormal: vec3f=normalize((view* vec4f(worldNormal,0.0)).xyz);var r: vec3f=reflect(viewDir,viewNormal);r= (reflectionMatrix* vec4f(r,0)).xyz;r.z=r.z-1.0;var m: f32=2.0*length(r);return vec3f(r.x/m+0.5,1.0-r.y/m-0.5,0);}
fn computePlanarCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
{var viewDir: vec3f=worldPos.xyz-eyePosition;var coords: vec3f=normalize(reflect(viewDir,worldNormal));return (reflectionMatrix* vec4f(coords,1)).xyz;}
fn computeCubicCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
{var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords= (reflectionMatrix* vec4f(coords,0)).xyz;
#ifdef INVERTCUBICMAP
coords.y*=-1.0;
#endif
return coords;}
fn computeCubicLocalCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f,reflectionSize: vec3f,reflectionPosition: vec3f)->vec3f
{var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=(reflectionMatrix* vec4f(coords,0)).xyz;
#ifdef INVERTCUBICMAP
coords.y*=-1.0;
#endif
return coords;}
fn computeProjectionCoords(worldPos: vec4f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f
{return (reflectionMatrix*(view*worldPos)).xyz;}
fn computeSkyBoxCoords(positionW: vec3f,reflectionMatrix: mat4x4f)->vec3f
{return (reflectionMatrix* vec4f(positionW,1.)).xyz;}
#ifdef REFLECTION
fn computeReflectionCoords(worldPos: vec4f,worldNormal: vec3f)->vec3f
{
#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED
var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);
#endif
#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED
var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);
#endif
#ifdef REFLECTIONMAP_EQUIRECTANGULAR
return computeEquirectangularCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_SPHERICAL
return computeSphericalCoords(worldPos,worldNormal,scene.view,uniforms.reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_PLANAR
return computePlanarCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_CUBIC
#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC
return computeCubicLocalCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix,uniforms.vReflectionSize,uniforms.vReflectionPosition);
#else
return computeCubicCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
#endif
#endif
#ifdef REFLECTIONMAP_PROJECTION
return computeProjectionCoords(worldPos,scene.view,uniforms.reflectionMatrix);
#endif
#ifndef REFLECTIONMAP_CUBIC
#ifdef REFLECTIONMAP_SKYBOX
return computeSkyBoxCoords(fragmentInputs.vPositionUVW,uniforms.reflectionMatrix);
#endif
#endif
#ifdef REFLECTIONMAP_EXPLICIT
return vec3f(0,0,0);
#endif
}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const reflectionFunctionWGSL = { name, shader };
//# sourceMappingURL=reflectionFunction.js.map

/***/ }),

/***/ 80983:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export samplerFragmentDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "samplerFragmentDeclaration";
const shader = `#ifdef _DEFINENAME_
#if _DEFINENAME_DIRECTUV==1
#define v_VARYINGNAME_UV vMainUV1
#elif _DEFINENAME_DIRECTUV==2
#define v_VARYINGNAME_UV vMainUV2
#elif _DEFINENAME_DIRECTUV==3
#define v_VARYINGNAME_UV vMainUV3
#elif _DEFINENAME_DIRECTUV==4
#define v_VARYINGNAME_UV vMainUV4
#elif _DEFINENAME_DIRECTUV==5
#define v_VARYINGNAME_UV vMainUV5
#elif _DEFINENAME_DIRECTUV==6
#define v_VARYINGNAME_UV vMainUV6
#else
varying v_VARYINGNAME_UV: vec2f;
#endif
var _SAMPLERNAME_SamplerSampler: sampler;var _SAMPLERNAME_Sampler: texture_2d<f32>;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const samplerFragmentDeclarationWGSL = { name, shader };
//# sourceMappingURL=samplerFragmentDeclaration.js.map

/***/ }),

/***/ 89277:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export samplerVertexDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "samplerVertexDeclaration";
const shader = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
varying v_VARYINGNAME_UV: vec2f;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const samplerVertexDeclarationWGSL = { name, shader };
//# sourceMappingURL=samplerVertexDeclaration.js.map

/***/ }),

/***/ 52231:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export samplerVertexImplementationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "samplerVertexImplementation";
const shader = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
if (uniforms.v_INFONAME_==0.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uvUpdated,1.0,0.0)).xy;}
#ifdef UV2
else if (uniforms.v_INFONAME_==1.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv2,1.0,0.0)).xy;}
#endif
#ifdef UV3
else if (uniforms.v_INFONAME_==2.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv3,1.0,0.0)).xy;}
#endif
#ifdef UV4
else if (uniforms.v_INFONAME_==3.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv4,1.0,0.0)).xy;}
#endif
#ifdef UV5
else if (uniforms.v_INFONAME_==4.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv5,1.0,0.0)).xy;}
#endif
#ifdef UV6
else if (uniforms.v_INFONAME_==5.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv6,1.0,0.0)).xy;}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const samplerVertexImplementationWGSL = { name, shader };
//# sourceMappingURL=samplerVertexImplementation.js.map

/***/ }),

/***/ 98327:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export sceneUboDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "sceneUboDeclaration";
const shader = `struct Scene {viewProjection : mat4x4<f32>,
#ifdef MULTIVIEW
viewProjectionR : mat4x4<f32>,
#endif 
view : mat4x4<f32>,
projection : mat4x4<f32>,
vEyePosition : vec4<f32>,};var<uniform> scene : Scene;
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const sceneUboDeclarationWGSL = { name, shader };
//# sourceMappingURL=sceneUboDeclaration.js.map

/***/ }),

/***/ 95228:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export screenSpaceRayTraceWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "screenSpaceRayTrace";
const shader = `fn distanceSquared(a: vec2f,b: vec2f)->f32 { 
var temp=a-b; 
return dot(temp,temp); }
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
fn linearizeDepth(depth: f32,near: f32,far: f32)->f32 {
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
return -(near*far)/(far-depth*(far-near));
#else
return (near*far)/(far-depth*(far-near));
#endif
}
#endif
/**
\param csOrigin Camera-space ray origin,which must be 
within the view volume and must have z>0.01 and project within the valid screen rectangle
\param csDirection Unit length camera-space ray direction
\param projectToPixelMatrix A projection matrix that maps to **pixel** coordinates 
(**not** [-1,+1] normalized device coordinates).
\param csZBuffer The camera-space Z buffer
\param csZBufferSize Dimensions of csZBuffer
\param csZThickness Camera space csZThickness to ascribe to each pixel in the depth buffer
\param nearPlaneZ Positive number. Doesn't have to be THE actual near plane,just a reasonable value
for clipping rays headed towards the camera. Should be the actual near plane if screen-space depth is enabled.
\param farPlaneZ The far plane for the camera. Used when screen-space depth is enabled.
\param stride Step in horizontal or vertical pixels between samples. This is a var because: f32 integer math is slow on GPUs,but should be set to an integer>=1
\param jitterFraction Number between 0 and 1 for how far to bump the ray in stride units
to conceal banding artifacts,plus the stride ray offset.
\param maxSteps Maximum number of iterations. Higher gives better images but may be slow
\param maxRayTraceDistance Maximum camera-space distance to trace before returning a miss
\param selfCollisionNumSkip Number of steps to skip at start when raytracing to avar self: voidnull collisions.
1 is a reasonable value,depending on the scene you may need to set this value to 2
\param hitPixel Pixel coordinates of the first intersection with the scene
\param numIterations number of iterations performed
\param csHitPovar Camera: i32 space location of the ray hit
*/
fn traceScreenSpaceRay1(
csOrigin: vec3f,
csDirection: vec3f,
projectToPixelMatrix: mat4x4f,
csZBuffer: texture_2d<f32>,
csZBufferSize: vec2f,
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
csZBackBuffer: texture_2d<f32>,
csZBackSizeFactor: f32,
#endif
csZThickness: f32,
nearPlaneZ: f32,
farPlaneZ: f32,
stride: f32,
jitterFraction: f32,
maxSteps: f32,
maxRayTraceDistance: f32,
selfCollisionNumSkip: f32,
startPixel: ptr<function,vec2f>,
hitPixel: ptr<function,vec2f>,
csHitPoint: ptr<function,vec3f>,
numIterations: ptr<function,f32>
#ifdef SSRAYTRACE_DEBUG
,debugColor: ptr<function,vec3f>
#endif
)->bool
{
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
var rayLength: f32=select(maxRayTraceDistance,(-nearPlaneZ-csOrigin.z)/csDirection.z,(csOrigin.z+csDirection.z*maxRayTraceDistance)>-nearPlaneZ);
#else
var rayLength: f32=select(maxRayTraceDistance,(nearPlaneZ-csOrigin.z)/csDirection.z,(csOrigin.z+csDirection.z*maxRayTraceDistance)<nearPlaneZ);
#endif
var csEndPoint: vec3f=csOrigin+csDirection*rayLength;*hitPixel= vec2f(-1.0,-1.0);var H0: vec4f=projectToPixelMatrix* vec4f(csOrigin,1.0);var H1: vec4f=projectToPixelMatrix* vec4f(csEndPoint,1.0);var k0: f32=1.0/H0.w;var k1: f32=1.0/H1.w;var Q0: vec3f=csOrigin*k0;var Q1: vec3f=csEndPoint*k1;var P0: vec2f=H0.xy*k0;var P1: vec2f=H1.xy*k1;
#ifdef SSRAYTRACE_CLIP_TO_FRUSTUM
var xMax: f32=csZBufferSize.x-0.5;var xMin=0.5;var yMax=csZBufferSize.y-0.5;var yMin=0.5;var alpha: f32=0.0;if ((P1.y>yMax) || (P1.y<yMin)) {alpha=(P1.y-select(yMin,yMax,(P1.y>yMax)))/(P1.y-P0.y);}
if ((P1.x>xMax) || (P1.x<xMin)) {alpha=max(alpha,(P1.x-select(xMin,xMax,(P1.x>xMax)))/(P1.x-P0.x));}
P1=mix(P1,P0,alpha); k1=mix(k1,k0,alpha); Q1=mix(Q1,Q0,alpha);
#endif
P1+= vec2f(select(0.0,0.01,distanceSquared(P0,P1)<0.0001));var delta: vec2f=P1-P0;var permute: bool=false;if (abs(delta.x)<abs(delta.y)) { 
permute=true;delta=delta.yx;P0=P0.yx;P1=P1.yx; }
var stepDirection: f32=sign(delta.x);var invdx: f32=stepDirection/delta.x;var dP: vec2f= vec2f(stepDirection,delta.y*invdx);var dQ: vec3f=(Q1-Q0)*invdx;var dk: f32=(k1-k0)*invdx;var zMin: f32=min(csEndPoint.z,csOrigin.z);var zMax: f32=max(csEndPoint.z,csOrigin.z);dP*=stride; dQ*=stride; dk*=stride;P0+=dP*jitterFraction; Q0+=dQ*jitterFraction; k0+=dk*jitterFraction;var pqk: vec4f= vec4f(P0,Q0.z,k0);var dPQK: vec4f= vec4f(dP,dQ.z,dk);*startPixel=select(P0.xy,P0.yx,permute);var prevZMaxEstimate: f32=csOrigin.z;var rayZMin: f32=prevZMaxEstimate;var rayZMax=prevZMaxEstimate;var sceneZMax: f32=rayZMax+1e4;var end: f32=P1.x*stepDirection;var hit: bool=false;var stepCount: f32;for (stepCount=0.0;(stepCount<=selfCollisionNumSkip) ||
((pqk.x*stepDirection)<=end &&
stepCount<maxSteps &&
!hit &&
sceneZMax != 0.0);pqk+=dPQK 
)
{*hitPixel=select(pqk.xy,pqk.yx,permute);rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;if (rayZMin>rayZMax) { 
var t: f32=rayZMin; rayZMin=rayZMax; rayZMax=t;}
sceneZMax=textureLoad(csZBuffer,vec2<i32>(*hitPixel),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
sceneZMax=linearizeDepth(sceneZMax,nearPlaneZ,farPlaneZ);
#endif
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
var sceneBackZ: f32=textureLoad(csZBackBuffer,vec2<i32>(*hitPixel/csZBackSizeFactor),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
sceneBackZ=linearizeDepth(sceneBackZ,nearPlaneZ,farPlaneZ);
#endif
hit=(rayZMax>=sceneBackZ-csZThickness) && (rayZMin<=sceneZMax);
#else
hit=(rayZMax>=sceneZMax-csZThickness) && (rayZMin<=sceneZMax);
#endif
#else
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
var sceneBackZ: f32=textureLoad(csZBackBuffer,vec2<i32>(*hitPixel/csZBackSizeFactor),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
sceneBackZ=linearizeDepth(sceneBackZ,nearPlaneZ,farPlaneZ);
#endif
hit=(rayZMin<=sceneBackZ+csZThickness) && (rayZMax>=sceneZMax) && (sceneZMax != 0.0);
#else
hit=(rayZMin<=sceneZMax+csZThickness) && (rayZMax>=sceneZMax);
#endif
#endif
stepCount+=1.0;}
pqk-=dPQK;stepCount-=1.0;if (((pqk.x+dPQK.x)*stepDirection)>end || (stepCount+1.0)>=maxSteps || sceneZMax==0.0) {hit=false;}
#ifdef SSRAYTRACE_ENABLE_REFINEMENT
if (stride>1.0 && hit) {pqk-=dPQK;stepCount-=1.0;var invStride: f32=1.0/stride;dPQK*=invStride;var refinementStepCount: f32=0.0;prevZMaxEstimate=pqk.z/pqk.w;rayZMax=prevZMaxEstimate;sceneZMax=rayZMax+1e7;for (;refinementStepCount<=1.0 ||
((refinementStepCount<=stride*1.4) &&
(rayZMax<sceneZMax) && (sceneZMax != 0.0));pqk+=dPQK)
{rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;rayZMax=max(rayZMax,rayZMin);*hitPixel=select(pqk.xy,pqk.yx,permute);sceneZMax=textureLoad(csZBuffer,vec2<i32>(*hitPixel),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
sceneZMax=linearizeDepth(sceneZMax,nearPlaneZ,farPlaneZ);
#endif
refinementStepCount+=1.0;}
pqk-=dPQK;refinementStepCount-=1.0;stepCount+=refinementStepCount/stride;}
#endif
Q0=vec3f(Q0.xy+dQ.xy*stepCount,pqk.z);*csHitPoint=Q0/pqk.w;*numIterations=stepCount+1.0;
#ifdef SSRAYTRACE_DEBUG
if (((pqk.x+dPQK.x)*stepDirection)>end) {*debugColor= vec3f(0,0,1);} else if ((stepCount+1.0)>=maxSteps) {*debugColor= vec3f(1,0,0);} else if (sceneZMax==0.0) {*debugColor= vec3f(1,1,0);} else {*debugColor= vec3f(0,stepCount/maxSteps,0);}
#endif
return hit;}
/**
texCoord: in the [0,1] range
depth: depth in view space (range [znear,zfar]])
*/
fn computeViewPosFromUVDepth(texCoord: vec2f,depth: f32,projection: mat4x4f,invProjectionMatrix: mat4x4f)->vec3f {var xy=texCoord*2.0-1.0;var z: f32;
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
#ifdef ORTHOGRAPHIC_CAMERA
z=-projection[2].z*depth+projection[3].z;
#else
z=-projection[2].z-projection[3].z/depth;
#endif
#else
#ifdef ORTHOGRAPHIC_CAMERA
z=projection[2].z*depth+projection[3].z;
#else
z=projection[2].z+projection[3].z/depth;
#endif
#endif
var w=1.0;var ndc=vec4f(xy,z,w);var eyePos: vec4f=invProjectionMatrix*ndc;var result=eyePos.xyz/eyePos.w;return result;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const screenSpaceRayTraceWGSL = { name, shader };
//# sourceMappingURL=screenSpaceRayTrace.js.map

/***/ }),

/***/ 89273:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowMapFragmentWGSL: () => (/* binding */ shadowMapFragmentWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowMapFragment";
const shader = `var depthSM: f32=fragmentInputs.vDepthMetricSM;
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
#if SM_USEDISTANCE==1
depthSM=(length(fragmentInputs.vPositionWSM-uniforms.lightDataSM)+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;
#else
#ifdef USE_REVERSE_DEPTHBUFFER
depthSM=(-fragmentInputs.zSM+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;
#else
depthSM=(fragmentInputs.zSM+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;
#endif
#endif
#ifdef USE_REVERSE_DEPTHBUFFER
fragmentOutputs.fragDepth=clamp(1.0-depthSM,0.0,1.0);
#else
fragmentOutputs.fragDepth=clamp(depthSM,0.0,1.0); 
#endif
#elif SM_USEDISTANCE==1
depthSM=(length(fragmentInputs.vPositionWSM-uniforms.lightDataSM)+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;
#endif
#if SM_ESM==1
depthSM=clamp(exp(-min(87.,uniforms.biasAndScaleSM.z*depthSM)),0.,1.);
#endif
#if SM_FLOAT==1
fragmentOutputs.color= vec4f(depthSM,1.0,1.0,1.0);
#else
fragmentOutputs.color=pack(depthSM);
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const shadowMapFragmentWGSL = { name, shader };
//# sourceMappingURL=shadowMapFragment.js.map

/***/ }),

/***/ 95799:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowMapFragmentSoftTransparentShadowWGSL: () => (/* binding */ shadowMapFragmentSoftTransparentShadowWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowMapFragmentSoftTransparentShadow";
const shader = `#if SM_SOFTTRANSPARENTSHADOW==1
if ((bayerDither8(floor(((fragmentInputs.position.xy)%(8.0)))))/64.0>=uniforms.softTransparentShadowSM.x*alpha) {discard;}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const shadowMapFragmentSoftTransparentShadowWGSL = { name, shader };
//# sourceMappingURL=shadowMapFragmentSoftTransparentShadow.js.map

/***/ }),

/***/ 71311:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowMapVertexMetricWGSL: () => (/* binding */ shadowMapVertexMetricWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowMapVertexMetric";
const shader = `#if SM_USEDISTANCE==1
vertexOutputs.vPositionWSM=worldPos.xyz;
#endif
#if SM_DEPTHTEXTURE==1
#ifdef IS_NDC_HALF_ZRANGE
#define BIASFACTOR 0.5
#else
#define BIASFACTOR 1.0
#endif
#ifdef USE_REVERSE_DEPTHBUFFER
vertexOutputs.position.z-=uniforms.biasAndScaleSM.x*vertexOutputs.position.w*BIASFACTOR;
#else
vertexOutputs.position.z+=uniforms.biasAndScaleSM.x*vertexOutputs.position.w*BIASFACTOR;
#endif
#endif
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
vertexOutputs.zSM=vertexOutputs.position.z;vertexOutputs.position.z=0.0;
#elif SM_USEDISTANCE==0
#ifdef USE_REVERSE_DEPTHBUFFER
vertexOutputs.vDepthMetricSM=(-vertexOutputs.position.z+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;
#else
vertexOutputs.vDepthMetricSM=(vertexOutputs.position.z+uniforms.depthValuesSM.x)/uniforms.depthValuesSM.y+uniforms.biasAndScaleSM.x;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const shadowMapVertexMetricWGSL = { name, shader };
//# sourceMappingURL=shadowMapVertexMetric.js.map

/***/ }),

/***/ 78589:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowsFragmentFunctionsWGSL: () => (/* binding */ shadowsFragmentFunctionsWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowsFragmentFunctions";
const shader = `#ifdef SHADOWS
#ifndef SHADOWFLOAT
fn unpack(color: vec4f)->f32
{const bit_shift: vec4f= vec4f(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}
#endif
fn computeFallOff(value: f32,clipSpace: vec2f,frustumEdgeFalloff: f32)->f32
{var mask: f32=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);}
fn computeShadowCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,darkness: f32,depthValues: vec2f)->f32
{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
var shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));
#else
var shadow: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;
#endif
return select(darkness,1.0,depth>shadow);}
fn computeShadowWithPoissonSamplingCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,mapSize: f32,darkness: f32,depthValues: vec2f)->f32
{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;var visibility: f32=1.;var poissonDisk: array<vec3f,4>;poissonDisk[0]= vec3f(-1.0,1.0,-1.0);poissonDisk[1]= vec3f(1.0,-1.0,-1.0);poissonDisk[2]= vec3f(-1.0,-1.0,-1.0);poissonDisk[3]= vec3f(1.0,-1.0,1.0);
#ifndef SHADOWFLOAT
if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) {visibility-=0.25;};if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) {visibility-=0.25;};if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) {visibility-=0.25;};if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) {visibility-=0.25;};
#else
if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) {visibility-=0.25;};if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) {visibility-=0.25;};if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) {visibility-=0.25;};if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) {visibility-=0.25;};
#endif
return min(1.0,visibility+darkness);}
fn computeShadowWithESMCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32
{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
var shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));
#else
var shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;
#endif
var esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return esm;}
fn computeShadowWithCloseESMCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32
{var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
var shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));
#else
var shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;
#endif
var esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return esm;}
fn computeShadowCSM(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d_array<f32>,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
var shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,uv,layer));
#else
var shadow: f32=textureSample(shadowTexture,shadowSampler,uv,layer).x;
#endif
return select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );}
fn computeShadow(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
var shadow: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));
#else
var shadow: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;
#endif
return select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );}}
fn computeShadowWithPoissonSampling(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,mapSize: f32,darkness: f32,frustumEdgeFalloff: f32)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);var visibility: f32=1.;var poissonDisk: array<vec2f,4>;poissonDisk[0]= vec2f(-0.94201624,-0.39906216);poissonDisk[1]= vec2f(0.94558609,-0.76890725);poissonDisk[2]= vec2f(-0.094184101,-0.92938870);poissonDisk[3]= vec2f(0.34495938,0.29387760);
#ifndef SHADOWFLOAT
if (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[0]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}
if (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[1]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}
if (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[2]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}
if (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[3]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}
#else
if (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[0]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}
if (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[1]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}
if (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[2]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}
if (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[3]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}
#endif
return computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);}}
fn computeShadowWithESM(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
var shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));
#else
var shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;
#endif
var esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}
fn computeShadowWithCloseESM(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0); 
#ifndef SHADOWFLOAT
var shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));
#else
var shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;
#endif
var esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}
fn getZInClip(clipSpace: vec3f,uvDepth: vec3f)->f32
{
#ifdef IS_NDC_HALF_ZRANGE
return clipSpace.z;
#else
return uvDepth.z;
#endif
}
const GREATEST_LESS_THAN_ONE: f32=0.99999994;
#define DISABLE_UNIFORMITY_ANALYSIS
fn computeShadowWithCSMPCF1(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var shadow: f32=textureSampleCompare(shadowTexture,shadowSampler,uvDepth.xy,layer,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
fn computeShadowWithCSMPCF3(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
var st: vec2f=fract(uv); 
var base_uv: vec2f=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
var uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
fn computeShadowWithCSMPCF5(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
var st: vec2f=fract(uv); 
var base_uv: vec2f=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
var uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),layer,uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),layer,uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),layer,uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),layer,uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
fn computeShadowWithPCF1(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var shadow: f32=textureSampleCompareLevel(shadowTexture,shadowSampler,uvDepth.xy,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
fn computeShadowWithPCF3(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
var st: vec2f=fract(uv); 
var base_uv: vec2f=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
var uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
fn computeShadowWithPCF5(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
var st: vec2f=fract(uv); 
var base_uv: vec2f=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
var uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
const PoissonSamplers32: array<vec3f,64>=array<vec3f,64> (
vec3f(0.06407013,0.05409927,0.),
vec3f(0.7366577,0.5789394,0.),
vec3f(-0.6270542,-0.5320278,0.),
vec3f(-0.4096107,0.8411095,0.),
vec3f(0.6849564,-0.4990818,0.),
vec3f(-0.874181,-0.04579735,0.),
vec3f(0.9989998,0.0009880066,0.),
vec3f(-0.004920578,-0.9151649,0.),
vec3f(0.1805763,0.9747483,0.),
vec3f(-0.2138451,0.2635818,0.),
vec3f(0.109845,0.3884785,0.),
vec3f(0.06876755,-0.3581074,0.),
vec3f(0.374073,-0.7661266,0.),
vec3f(0.3079132,-0.1216763,0.),
vec3f(-0.3794335,-0.8271583,0.),
vec3f(-0.203878,-0.07715034,0.),
vec3f(0.5912697,0.1469799,0.),
vec3f(-0.88069,0.3031784,0.),
vec3f(0.5040108,0.8283722,0.),
vec3f(-0.5844124,0.5494877,0.),
vec3f(0.6017799,-0.1726654,0.),
vec3f(-0.5554981,0.1559997,0.),
vec3f(-0.3016369,-0.3900928,0.),
vec3f(-0.5550632,-0.1723762,0.),
vec3f(0.925029,0.2995041,0.),
vec3f(-0.2473137,0.5538505,0.),
vec3f(0.9183037,-0.2862392,0.),
vec3f(0.2469421,0.6718712,0.),
vec3f(0.3916397,-0.4328209,0.),
vec3f(-0.03576927,-0.6220032,0.),
vec3f(-0.04661255,0.7995201,0.),
vec3f(0.4402924,0.3640312,0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.),
vec3f(0.)
);const PoissonSamplers64: array<vec3f,64>=array<vec3f,64> (
vec3f(-0.613392,0.617481,0.),
vec3f(0.170019,-0.040254,0.),
vec3f(-0.299417,0.791925,0.),
vec3f(0.645680,0.493210,0.),
vec3f(-0.651784,0.717887,0.),
vec3f(0.421003,0.027070,0.),
vec3f(-0.817194,-0.271096,0.),
vec3f(-0.705374,-0.668203,0.),
vec3f(0.977050,-0.108615,0.),
vec3f(0.063326,0.142369,0.),
vec3f(0.203528,0.214331,0.),
vec3f(-0.667531,0.326090,0.),
vec3f(-0.098422,-0.295755,0.),
vec3f(-0.885922,0.215369,0.),
vec3f(0.566637,0.605213,0.),
vec3f(0.039766,-0.396100,0.),
vec3f(0.751946,0.453352,0.),
vec3f(0.078707,-0.715323,0.),
vec3f(-0.075838,-0.529344,0.),
vec3f(0.724479,-0.580798,0.),
vec3f(0.222999,-0.215125,0.),
vec3f(-0.467574,-0.405438,0.),
vec3f(-0.248268,-0.814753,0.),
vec3f(0.354411,-0.887570,0.),
vec3f(0.175817,0.382366,0.),
vec3f(0.487472,-0.063082,0.),
vec3f(-0.084078,0.898312,0.),
vec3f(0.488876,-0.783441,0.),
vec3f(0.470016,0.217933,0.),
vec3f(-0.696890,-0.549791,0.),
vec3f(-0.149693,0.605762,0.),
vec3f(0.034211,0.979980,0.),
vec3f(0.503098,-0.308878,0.),
vec3f(-0.016205,-0.872921,0.),
vec3f(0.385784,-0.393902,0.),
vec3f(-0.146886,-0.859249,0.),
vec3f(0.643361,0.164098,0.),
vec3f(0.634388,-0.049471,0.),
vec3f(-0.688894,0.007843,0.),
vec3f(0.464034,-0.188818,0.),
vec3f(-0.440840,0.137486,0.),
vec3f(0.364483,0.511704,0.),
vec3f(0.034028,0.325968,0.),
vec3f(0.099094,-0.308023,0.),
vec3f(0.693960,-0.366253,0.),
vec3f(0.678884,-0.204688,0.),
vec3f(0.001801,0.780328,0.),
vec3f(0.145177,-0.898984,0.),
vec3f(0.062655,-0.611866,0.),
vec3f(0.315226,-0.604297,0.),
vec3f(-0.780145,0.486251,0.),
vec3f(-0.371868,0.882138,0.),
vec3f(0.200476,0.494430,0.),
vec3f(-0.494552,-0.711051,0.),
vec3f(0.612476,0.705252,0.),
vec3f(-0.578845,-0.768792,0.),
vec3f(-0.772454,-0.090976,0.),
vec3f(0.504440,0.372295,0.),
vec3f(0.155736,0.065157,0.),
vec3f(0.391522,0.849605,0.),
vec3f(-0.620106,-0.328104,0.),
vec3f(0.789239,-0.419965,0.),
vec3f(-0.545396,0.538133,0.),
vec3f(-0.178564,-0.596057,0.)
);fn computeShadowWithCSMPCSS(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array<vec3f,64>,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uvDepthLayer: vec4f= vec4f(uvDepth.x,uvDepth.y,f32(layer),uvDepth.z);var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;for (var i: i32=0; i<searchTapCount; i ++) {blockerDepth=textureSample(depthTexture,depthSampler, uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer).r;numBlocker+=select(0.,1.,blockerDepth<depthMetric);sumBlockerDepth+=select(0.,blockerDepth,blockerDepth<depthMetric);}
var avgBlockerDepth: f32=sumBlockerDepth/numBlocker;var AAOffset: f32=shadowMapSizeInverse*10.;var penumbraRatio: f32=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);var filterRadius: vec4f= vec4f(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);var random: f32=getRand(vPositionFromLight.xy);var rotationAngle: f32=random*3.1415926;var rotationVector: vec2f= vec2f(cos(rotationAngle),sin(rotationAngle));var shadow: f32=0.;for (var i: i32=0; i<pcfTapCount; i++) {var offset: vec4f= vec4f(poissonSamplers[i],0.);offset= vec4f(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);let coords=uvDepthLayer+offset*filterRadius;shadow+=textureSampleCompare(shadowTexture,shadowSampler,coords.xy,i32(coords.z),coords.w);}
shadow/= f32(pcfTapCount);shadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));shadow=mix(darkness,1.,shadow);return select(computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff),1.0,numBlocker<1.0);}
fn computeShadowWithPCSS(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array<vec3f,64>)->f32
{var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;var exitCondition: bool=depthMetric>1.0 || depthMetric<0.0;for (var i: i32=0; i<searchTapCount; i ++) {if (exitCondition) {break;}
blockerDepth=textureSampleLevel(depthTexture,depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy),0).r;numBlocker+=select(0.,1.,blockerDepth<depthMetric);sumBlockerDepth+=select(0.,blockerDepth,blockerDepth<depthMetric);}
exitCondition=exitCondition || numBlocker<1.0;var avgBlockerDepth: f32=sumBlockerDepth/numBlocker;var AAOffset: f32=shadowMapSizeInverse*10.;var penumbraRatio: f32=((depthMetric-avgBlockerDepth)+AAOffset);var filterRadius: f32=penumbraRatio*lightSizeUV*shadowMapSizeInverse;var random: f32=getRand(vPositionFromLight.xy);var rotationAngle: f32=random*3.1415926;var rotationVector: vec2f= vec2f(cos(rotationAngle),sin(rotationAngle));var shadow: f32=0.;for (var i: i32=0; i<pcfTapCount; i++) {if (exitCondition) {break;}
var offset: vec3f=poissonSamplers[i];offset= vec3f(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);let coords=uvDepth+offset*filterRadius;shadow+=textureSampleCompareLevel(shadowTexture,shadowSampler,coords.xy,coords.z);}
shadow/= f32(pcfTapCount);shadow=mix(shadow,1.,depthMetric-avgBlockerDepth);shadow=mix(darkness,1.,shadow);return select(computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff),1.0,exitCondition);}
fn computeShadowWithPCSS16(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32
{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);}
fn computeShadowWithPCSS32(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32
{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);}
fn computeShadowWithPCSS64(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32
{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);}
fn computeShadowWithCSMPCSS16(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32
{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
fn computeShadowWithCSMPCSS32(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32
{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
fn computeShadowWithCSMPCSS64(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32
{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const shadowsFragmentFunctionsWGSL = { name, shader };
//# sourceMappingURL=shadowsFragmentFunctions.js.map

/***/ }),

/***/ 79456:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowsVertexWGSL: () => (/* binding */ shadowsVertexWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowsVertex";
const shader = `#ifdef SHADOWS
#if defined(SHADOWCSM{X})
vertexOutputs.vPositionFromCamera{X}=scene.view*worldPos;
#if SHADOWCSMNUM_CASCADES{X}>0
vertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
#endif
#if SHADOWCSMNUM_CASCADES{X}>1
vertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
#endif 
#if SHADOWCSMNUM_CASCADES{X}>2
vertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
#endif 
#if SHADOWCSMNUM_CASCADES{X}>3
vertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
#endif 
#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
vertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const shadowsVertexWGSL = { name, shader };
//# sourceMappingURL=shadowsVertex.js.map

/***/ }),

/***/ 1008:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export uvAttributeDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "uvAttributeDeclaration";
const shader = `#ifdef UV{X}
attribute uv{X}: vec2f;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const uvAttributeDeclarationWGSL = { name, shader };
//# sourceMappingURL=uvAttributeDeclaration.js.map

/***/ }),

/***/ 20774:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export uvVariableDeclarationWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "uvVariableDeclaration";
const shader = `#ifdef MAINUV{X}
#if !defined(UV{X})
var uv{X}: vec2f=vec2f(0.,0.);
#else
var uv{X}: vec2f=vertexInputs.uv{X};
#endif
vertexOutputs.vMainUV{X}=uv{X};
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const uvVariableDeclarationWGSL = { name, shader };
//# sourceMappingURL=uvVariableDeclaration.js.map

/***/ }),

/***/ 820:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export vertexColorMixingWGSL */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "vertexColorMixing";
const shader = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
vertexOutputs.vColor=vec4f(1.0);
#ifdef VERTEXCOLOR
#ifdef VERTEXALPHA
vertexOutputs.vColor*=vertexInputs.color;
#else
vertexOutputs.vColor=vec4f(vertexOutputs.vColor.rgb*vertexInputs.color.rgb,vertexOutputs.vColor.a);
#endif
#endif
#ifdef INSTANCESCOLOR
vertexOutputs.vColor*=vertexInputs.instanceColor;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStoreWGSL[name] = shader;
/** @internal */
const vertexColorMixingWGSL = { name, shader };
//# sourceMappingURL=vertexColorMixing.js.map

/***/ }),

/***/ 91506:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   anaglyphPixelShaderWGSL: () => (/* binding */ anaglyphPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "anaglyphPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var leftSamplerSampler: sampler;var leftSampler: texture_2d<f32>;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var leftFrag: vec4f=textureSample(leftSampler,leftSamplerSampler,input.vUV);leftFrag= vec4f(1.0,leftFrag.g,leftFrag.b,1.0);var rightFrag: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);rightFrag= vec4f(rightFrag.r,1.0,1.0,1.0);fragmentOutputs.color= vec4f(rightFrag.rgb*leftFrag.rgb,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const anaglyphPixelShaderWGSL = { name, shader };
//# sourceMappingURL=anaglyph.fragment.js.map

/***/ }),

/***/ 81018:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   backgroundPixelShaderWGSL: () => (/* binding */ backgroundPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_backgroundUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33723);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_reflectionFunction_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72230);
/* harmony import */ var _ShadersInclude_imageProcessingDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16205);
/* harmony import */ var _ShadersInclude_lightUboDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(30379);
/* harmony import */ var _ShadersInclude_lightsFragmentFunctions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(76493);
/* harmony import */ var _ShadersInclude_shadowsFragmentFunctions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(78589);
/* harmony import */ var _ShadersInclude_imageProcessingFunctions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(88996);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(39759);
/* harmony import */ var _ShadersInclude_fogFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(66407);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(97715);
/* harmony import */ var _ShadersInclude_lightFragment_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(25271);
/* harmony import */ var _ShadersInclude_logDepthFragment_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(38780);
/* harmony import */ var _ShadersInclude_fogFragment_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(93243);
// Do not edit.
















const name = "backgroundPixelShader";
const shader = `#include<backgroundUboDeclaration>
#include<helperFunctions>
varying vPositionW: vec3f;
#ifdef MAINUV1
varying vMainUV1: vec2f;
#endif 
#ifdef MAINUV2 
varying vMainUV2: vec2f; 
#endif 
#ifdef NORMAL
varying vNormalW: vec3f;
#endif
#ifdef DIFFUSE
#if DIFFUSEDIRECTUV==1
#define vDiffuseUV vMainUV1
#elif DIFFUSEDIRECTUV==2
#define vDiffuseUV vMainUV2
#else
varying vDiffuseUV: vec2f;
#endif
var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
#endif
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;
#ifdef TEXTURELODSUPPORT
#else
var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube<f32>;
#endif
#else
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;
#ifdef TEXTURELODSUPPORT
#else
var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d<f32>;
#endif
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vPositionUVW: vec3f;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vDirectionW: vec3f;
#endif
#endif
#include<reflectionFunction>
#endif
#ifndef FROMLINEARSPACE
#define FROMLINEARSPACE;
#endif
#ifndef SHADOWONLY
#define SHADOWONLY;
#endif
#include<imageProcessingDeclaration>
#include<lightUboDeclaration>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<imageProcessingFunctions>
#include<logDepthDeclaration>
#include<clipPlaneFragmentDeclaration>
#include<fogFragmentDeclaration>
#ifdef REFLECTIONFRESNEL
#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
fn fresnelSchlickEnvironmentGGX(VdotN: f32,reflectance0: vec3f,reflectance90: vec3f,smoothness: f32)->vec3f
{var weight: f32=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
#endif
#ifdef PROJECTED_GROUND
fn diskIntersectWithBackFaceCulling(ro: vec3f,rd: vec3f,c: vec3f,r: f32)->f32 {var d: f32=rd.y;if(d>0.0) { return 1e6; }
var o: vec3f=ro-c;var t: f32=-o.y/d;var q: vec3f=o+rd*t;return select(1e6,t,(dot(q,q)<r*r));}
fn sphereIntersect(ro: vec3f,rd: vec3f,ra: f32)->f32 {var b: f32=dot(ro,rd);var c: f32=dot(ro,ro)-ra*ra;var h: f32=b*b-c;if(h<0.0) { return -1.0; }
h=sqrt(h);return-b+h;}
fn project(viewDirectionW: vec3f,eyePosition: vec3f)->vec3f {var radius: f32=uniforms.projectedGroundInfos.x;var height: f32=uniforms.projectedGroundInfos.y;var camDir: vec3f=-viewDirectionW;var skySphereDistance: f32=sphereIntersect(eyePosition,camDir,radius);var skySpherePositionW: vec3f=eyePosition+camDir*skySphereDistance;var p: vec3f=normalize(skySpherePositionW);var upEyePosition=vec3f(eyePosition.x,eyePosition.y-height,eyePosition.z);var sIntersection: f32=sphereIntersect(upEyePosition,p,radius);var h: vec3f= vec3f(0.0,-height,0.0);var dIntersection: f32=diskIntersectWithBackFaceCulling(upEyePosition,p,h,radius);p=(upEyePosition+min(sIntersection,dIntersection)*p);return p;}
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);
#ifdef NORMAL
var normalW: vec3f=normalize(fragmentInputs.vNormalW);
#else
var normalW: vec3f= vec3f(0.0,1.0,0.0);
#endif
var shadow: f32=1.;var globalShadow: f32=0.;var shadowLightCount: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;
#include<lightFragment>[0..maxSimultaneousLights]
#ifdef SHADOWINUSE
globalShadow/=shadowLightCount;
#else
globalShadow=1.0;
#endif
#ifndef BACKMAT_SHADOWONLY
var reflectionColor: vec4f= vec4f(1.,1.,1.,1.);
#ifdef REFLECTION
#ifdef PROJECTED_GROUND
var reflectionVector: vec3f=project(viewDirectionW,scene.vEyePosition.xyz);reflectionVector= (uniforms.reflectionMatrix*vec4f(reflectionVector,1.)).xyz;
#else
var reflectionVector: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW);
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
var reflectionCoords: vec3f=reflectionVector;
#else
var reflectionCoords: vec2f=reflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
reflectionCoords/=reflectionVector.z;
#endif
reflectionCoords.y=1.0-reflectionCoords.y;
#endif
#ifdef REFLECTIONBLUR
var reflectionLOD: f32=uniforms.vReflectionInfos.y;
#ifdef TEXTURELODSUPPORT
reflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;reflectionColor=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD);
#else
var lodReflectionNormalized: f32=saturate(reflectionLOD);var lodReflectionNormalizedDoubled: f32=lodReflectionNormalized*2.0;var reflectionSpecularMid: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);if(lodReflectionNormalizedDoubled<1.0){reflectionColor=mix(
textureSample(reflectionrHighSampler,reflectionrHighSamplerSampler,reflectionCoords),
reflectionSpecularMid,
lodReflectionNormalizedDoubled
);} else {reflectionColor=mix(
reflectionSpecularMid,
textureSample(reflectionLowSampler,reflectionLowSamplerSampler,reflectionCoords),
lodReflectionNormalizedDoubled-1.0
);}
#endif
#else
var reflectionSample: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);reflectionColor=reflectionSample;
#endif
#ifdef RGBDREFLECTION
reflectionColor=vec4f(fromRGBD(reflectionColor).rgb,reflectionColor.a);
#endif
#ifdef GAMMAREFLECTION
reflectionColor=vec4f(toLinearSpaceVec3(reflectionColor.rgb),reflectionColor.a);
#endif
#ifdef REFLECTIONBGR
reflectionColor=vec4f(reflectionColor.bgr,reflectionColor.a);
#endif
reflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a);
#endif
var diffuseColor: vec3f= vec3f(1.,1.,1.);var finalAlpha: f32=uniforms.alpha;
#ifdef DIFFUSE
var diffuseMap: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,input.vDiffuseUV);
#ifdef GAMMADIFFUSE
diffuseMap=vec4f(toLinearSpaceVec3(diffuseMap.rgb),diffuseMap.a);
#endif
diffuseMap=vec4f(diffuseMap.rgb *uniforms.vDiffuseInfos.y,diffuseMap.a);
#ifdef DIFFUSEHASALPHA
finalAlpha*=diffuseMap.a;
#endif
diffuseColor=diffuseMap.rgb;
#endif
#ifdef REFLECTIONFRESNEL
var colorBase: vec3f=diffuseColor;
#else
var colorBase: vec3f=reflectionColor.rgb*diffuseColor;
#endif
colorBase=max(colorBase,vec3f(0.0));
#ifdef USERGBCOLOR
var finalColor: vec3f=colorBase;
#else
#ifdef USEHIGHLIGHTANDSHADOWCOLORS
var mainColor: vec3f=mix(uniforms.vPrimaryColorShadow.rgb,uniforms.vPrimaryColor.rgb,colorBase);
#else
var mainColor: vec3f=uniforms.vPrimaryColor.rgb;
#endif
var finalColor: vec3f=colorBase*mainColor;
#endif
#ifdef REFLECTIONFRESNEL
var reflectionAmount: vec3f=uniforms.vReflectionControl.xxx;var reflectionReflectance0: vec3f=uniforms.vReflectionControl.yyy;var reflectionReflectance90: vec3f=uniforms.vReflectionControl.zzz;var VdotN: f32=dot(normalize(scene.vEyePosition.xyz),normalW);var planarReflectionFresnel: vec3f=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);reflectionAmount*=planarReflectionFresnel;
#ifdef REFLECTIONFALLOFF
var reflectionDistanceFalloff: f32=1.0-saturate(length(vPositionW.xyz-uniforms.vBackgroundCenter)*uniforms.vReflectionControl.w);reflectionDistanceFalloff*=reflectionDistanceFalloff;reflectionAmount*=reflectionDistanceFalloff;
#endif
finalColor=mix(finalColor,reflectionColor.rgb,saturateVec3(reflectionAmount));
#endif
#ifdef OPACITYFRESNEL
var viewAngleToFloor: f32=dot(normalW,normalize(scene.vEyePosition.xyz-uniforms.vBackgroundCenter));const startAngle: f32=0.1;var fadeFactor: f32=saturate(viewAngleToFloor/startAngle);finalAlpha*=fadeFactor*fadeFactor;
#endif
#ifdef SHADOWINUSE
finalColor=mix(finalColor*uniforms.shadowLevel,finalColor,globalShadow);
#endif
var color: vec4f= vec4f(finalColor,finalAlpha);
#else
var color: vec4f= vec4f(uniforms.vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*uniforms.alpha);
#endif
#include<logDepthFragment>
#include<fogFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
#if !defined(SKIPFINALCOLORCLAMP)
color=vec4f(clamp(color.rgb,vec3f(0.),vec3f(30.0)),color.a);
#endif
#else
color=applyImageProcessing(color);
#endif
#ifdef PREMULTIPLYALPHA
color=vec4f(color.rgb *color.a,color.a);
#endif
#ifdef NOISE
color=vec4f(color.rgb+dither(fragmentInputs.vPositionW.xy,0.5),color.a);color=max(color,vec4f(0.0));
#endif
fragmentOutputs.color=color;
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const backgroundPixelShaderWGSL = { name, shader };
//# sourceMappingURL=background.fragment.js.map

/***/ }),

/***/ 35616:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   backgroundVertexShaderWGSL: () => (/* binding */ backgroundVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_backgroundUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33723);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32806);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98900);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(77029);
/* harmony import */ var _ShadersInclude_fogVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(75757);
/* harmony import */ var _ShadersInclude_lightVxUboDeclaration_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3925);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(65470);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(40242);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(85197);
/* harmony import */ var _ShadersInclude_fogVertex_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(59013);
/* harmony import */ var _ShadersInclude_shadowsVertex_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79456);
/* harmony import */ var _ShadersInclude_logDepthVertex_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(81482);
// Do not edit.

















const name = "backgroundVertexShader";
const shader = `#include<backgroundUboDeclaration>
#include<helperFunctions>
attribute position: vec3f;
#ifdef NORMAL
attribute normal: vec3f;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
varying vPositionW: vec3f;
#ifdef NORMAL
varying vNormalW: vec3f;
#endif
#ifdef UV1
attribute uv: vec2f;
#endif
#ifdef UV2
attribute uv2: vec2f;
#endif
#ifdef MAINUV1
varying vMainUV1: vec2f;
#endif
#ifdef MAINUV2
varying vMainUV2: vec2f;
#endif
#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0
varying vDiffuseUV: vec2f;
#endif
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<lightVxUboDeclaration>[0..maxSimultaneousLights]
#ifdef REFLECTIONMAP_SKYBOX
varying vPositionUVW: vec3f;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vDirectionW: vec3f;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
#ifdef REFLECTIONMAP_SKYBOX
vertexOutputs.vPositionUVW=input.position;
#endif
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*finalWorld* vec4f(input.position,1.0);} else {vertexOutputs.position=scene.viewProjectionR*finalWorld* vec4f(input.position,1.0);}
#else
vertexOutputs.position=scene.viewProjection*finalWorld* vec4f(input.position,1.0);
#endif
var worldPos: vec4f=finalWorld* vec4f(input.position,1.0);vertexOutputs.vPositionW= worldPos.xyz;
#ifdef NORMAL
var normalWorld: mat3x3f=mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vertexOutputs.vNormalW=normalize(normalWorld*input.normal);
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vertexOutputs.vDirectionW=normalize((finalWorld*vec4f(input.position,0.0)).xyz);
#ifdef EQUIRECTANGULAR_RELFECTION_FOV
var screenToWorld: mat3x3f=inverseMat3( mat3x3f(finalWorld*scene.viewProjection));var segment: vec3f=mix(vertexOutputs.vDirectionW,screenToWorld* vec3f(0.0,0.0,1.0),abs(fFovMultiplier-1.0));if (fFovMultiplier<=1.0) {vertexOutputs.vDirectionW=normalize(segment);} else {vertexOutputs.vDirectionW=normalize(vertexOutputs.vDirectionW+(vertexOutputs.vDirectionW-segment));}
#endif
#endif
#ifndef UV1
var uv: vec2f=vec2f(0.,0.);
#else
var uv=input.uv;
#endif
#ifndef UV2
var uv2: vec2f=vec2f(0.,0.);
#else
var uv2=input.uv2;
#endif
#ifdef MAINUV1
vertexOutputs.vMainUV1=uv;
#endif
#ifdef MAINUV2
vertexOutputs.vMainUV2=uv2;
#endif
#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0
if (uniforms.vDiffuseInfos.x==0.)
{vertexOutputs.vDiffuseUV= (uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}
else
{vertexOutputs.vDiffuseUV= (uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#ifdef VERTEXCOLOR
vertexOutputs.vColor=vertexInputs.color;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const backgroundVertexShaderWGSL = { name, shader };
//# sourceMappingURL=background.vertex.js.map

/***/ }),

/***/ 91807:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bilateralBlurPixelShaderWGSL: () => (/* binding */ bilateralBlurPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bilateralBlurPixelShader";
const shader = `var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;uniform filterSize: i32;uniform blurDir: vec2f;uniform depthThreshold: f32;uniform normalThreshold: f32;varying vUV: vec2f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.).rgb;var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.).x;if (depth>=1e6 || depth<=0.) {fragmentOutputs.color= vec4f(color,1.);return fragmentOutputs;}
var normal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV,0.).rgb;
#ifdef DECODE_NORMAL
normal=normal*2.0-1.0;
#endif
var sigma: f32= f32(uniforms.filterSize);var two_sigma2: f32=2.0*sigma*sigma;var sigmaDepth: f32=uniforms.depthThreshold;var two_sigmaDepth2: f32=2.0*sigmaDepth*sigmaDepth;var sigmaNormal: f32=uniforms.normalThreshold;var two_sigmaNormal2: f32=2.0*sigmaNormal*sigmaNormal;var sum: vec3f= vec3f(0.);var wsum: f32=0.;for (var x: i32=-uniforms.filterSize; x<=uniforms.filterSize; x++) {var coords=vec2f(f32(x));var sampleColor: vec3f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV+coords*uniforms.blurDir,0.).rgb;var sampleDepth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV+coords*uniforms.blurDir,0.).r;var sampleNormal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV+coords*uniforms.blurDir,0.).rgb;
#ifdef DECODE_NORMAL
sampleNormal=sampleNormal*2.0-1.0;
#endif
var r: f32=dot(coords,coords);var w: f32=exp(-r/two_sigma2);var depthDelta: f32=abs(sampleDepth-depth);var wd: f32=step(depthDelta,uniforms.depthThreshold);var normalDelta: vec3f=abs(sampleNormal-normal);var wn: f32=step(normalDelta.x+normalDelta.y+normalDelta.z,uniforms.normalThreshold);sum+=sampleColor*w*wd*wn;wsum+=w*wd*wn;}
fragmentOutputs.color= vec4f(sum/wsum,1.);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const bilateralBlurPixelShaderWGSL = { name, shader };
//# sourceMappingURL=bilateralBlur.fragment.js.map

/***/ }),

/***/ 11084:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bilateralBlurQualityPixelShaderWGSL: () => (/* binding */ bilateralBlurQualityPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bilateralBlurQualityPixelShader";
const shader = `var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;uniform filterSize: i32;uniform blurDir: vec2f;uniform depthThreshold: f32;uniform normalThreshold: f32;varying vUV: vec2f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.).rgb;var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.).x;if (depth>=1e6 || depth<=0.) {fragmentOutputs.color= vec4f(color,1.);return fragmentOutputs;}
var normal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV,0.).rgb;
#ifdef DECODE_NORMAL
normal=normal*2.0-1.0;
#endif
var sigma: f32= f32(uniforms.filterSize);var two_sigma2: f32=2.0*sigma*sigma;var sigmaDepth: f32=uniforms.depthThreshold;var two_sigmaDepth2: f32=2.0*sigmaDepth*sigmaDepth;var sigmaNormal: f32=uniforms.normalThreshold;var two_sigmaNormal2: f32=2.0*sigmaNormal*sigmaNormal;var sum: vec3f= vec3f(0.);var wsum: f32=0.;for (var x: i32=-uniforms.filterSize; x<=uniforms.filterSize; x++) {for (var y: i32=-uniforms.filterSize; y<=uniforms.filterSize; y++) {var coords: vec2f= vec2f(f32(x),f32(y))*uniforms.blurDir;var sampleColor: vec3f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV+coords,0.).rgb;var sampleDepth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV+coords,0.).r;var sampleNormal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV+coords,0.).rgb;
#ifdef DECODE_NORMAL
sampleNormal=sampleNormal*2.0-1.0;
#endif
var r: f32=dot(coords,coords);var w: f32=exp(-r/two_sigma2);var rDepth: f32=sampleDepth-depth;var wd: f32=exp(-rDepth*rDepth/two_sigmaDepth2);var rNormal: f32=abs(sampleNormal.x-normal.x)+abs(sampleNormal.y-normal.y)+abs(sampleNormal.z-normal.z);var wn: f32=exp(-rNormal*rNormal/two_sigmaNormal2);sum+=sampleColor*w*wd*wn;wsum+=w*wd*wn;}}
fragmentOutputs.color= vec4f(sum/wsum,1.);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const bilateralBlurQualityPixelShaderWGSL = { name, shader };
//# sourceMappingURL=bilateralBlurQuality.fragment.js.map

/***/ }),

/***/ 65783:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   blackAndWhitePixelShaderWGSL: () => (/* binding */ blackAndWhitePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "blackAndWhitePixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform degree: f32;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var luminance: f32=dot(color, vec3f(0.3,0.59,0.11)); 
var blackAndWhite: vec3f= vec3f(luminance,luminance,luminance);fragmentOutputs.color= vec4f(color-((color-blackAndWhite)*uniforms.degree),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const blackAndWhitePixelShaderWGSL = { name, shader };
//# sourceMappingURL=blackAndWhite.fragment.js.map

/***/ }),

/***/ 96645:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bloomMergePixelShaderWGSL: () => (/* binding */ bloomMergePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bloomMergePixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var bloomBlurSampler: sampler;var bloomBlur: texture_2d<f32>;uniform bloomWeight: f32;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);var blurred: vec3f=textureSample(bloomBlur,bloomBlurSampler,input.vUV).rgb;fragmentOutputs.color=vec4f(fragmentOutputs.color.rgb+(blurred.rgb*uniforms.bloomWeight),fragmentOutputs.color.a);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const bloomMergePixelShaderWGSL = { name, shader };
//# sourceMappingURL=bloomMerge.fragment.js.map

/***/ }),

/***/ 12814:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   boundingBoxRendererPixelShaderWGSL: () => (/* binding */ boundingBoxRendererPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "boundingBoxRendererPixelShader";
const shader = `uniform color: vec4f;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
fragmentOutputs.color=uniforms.color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const boundingBoxRendererPixelShaderWGSL = { name, shader };
//# sourceMappingURL=boundingBoxRenderer.fragment.js.map

/***/ }),

/***/ 89252:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   boundingBoxRendererVertexShaderWGSL: () => (/* binding */ boundingBoxRendererVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "boundingBoxRendererVertexShader";
const shader = `attribute position: vec3f;uniform world: mat4x4f;uniform viewProjection: mat4x4f;
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
var worldPos: vec4f=uniforms.world* vec4f(input.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;
#define CUSTOM_VERTEX_MAIN_END
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const boundingBoxRendererVertexShaderWGSL = { name, shader };
//# sourceMappingURL=boundingBoxRenderer.vertex.js.map

/***/ }),

/***/ 89619:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   chromaticAberrationPixelShaderWGSL: () => (/* binding */ chromaticAberrationPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "chromaticAberrationPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform chromatic_aberration: f32;uniform radialIntensity: f32;uniform direction: vec2f;uniform centerPosition: vec2f;uniform screen_width: f32;uniform screen_height: f32;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var centered_screen_pos: vec2f= vec2f(input.vUV.x-uniforms.centerPosition.x,input.vUV.y-uniforms.centerPosition.y);var directionOfEffect: vec2f=uniforms.direction;if(directionOfEffect.x==0. && directionOfEffect.y==0.){directionOfEffect=normalize(centered_screen_pos);}
var radius2: f32=centered_screen_pos.x*centered_screen_pos.x
+ centered_screen_pos.y*centered_screen_pos.y;var radius: f32=sqrt(radius2);var ref_indices: vec3f= vec3f(-0.3,0.0,0.3);var ref_shiftX: f32=uniforms.chromatic_aberration*pow(radius,uniforms.radialIntensity)*directionOfEffect.x/uniforms.screen_width;var ref_shiftY: f32=uniforms.chromatic_aberration*pow(radius,uniforms.radialIntensity)*directionOfEffect.y/uniforms.screen_height;var ref_coords_r: vec2f=vec2f(input.vUV.x+ref_indices.r*ref_shiftX,input.vUV.y+ref_indices.r*ref_shiftY*0.5);var ref_coords_g: vec2f=vec2f(input.vUV.x+ref_indices.g*ref_shiftX,input.vUV.y+ref_indices.g*ref_shiftY*0.5);var ref_coords_b: vec2f=vec2f(input.vUV.x+ref_indices.b*ref_shiftX,input.vUV.y+ref_indices.b*ref_shiftY*0.5);var r=textureSample(textureSampler,textureSamplerSampler,ref_coords_r);var g=textureSample(textureSampler,textureSamplerSampler,ref_coords_g);var b=textureSample(textureSampler,textureSamplerSampler,ref_coords_b);var a=clamp(r.a+g.a+b.a,0.,1.);fragmentOutputs.color=vec4f(r.r,g.g,b.b,a);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const chromaticAberrationPixelShaderWGSL = { name, shader };
//# sourceMappingURL=chromaticAberration.fragment.js.map

/***/ }),

/***/ 22217:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   circleOfConfusionPixelShaderWGSL: () => (/* binding */ circleOfConfusionPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "circleOfConfusionPixelShader";
const shader = `varying vUV: vec2f;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;
#ifndef COC_DEPTH_NOT_NORMALIZED
uniform cameraMinMaxZ: vec2f;
#endif
uniform focusDistance: f32;uniform cocPrecalculation: f32;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var depth: f32=textureSample(depthSampler,depthSamplerSampler,input.vUV).r;
#define CUSTOM_COC_DEPTH
#ifdef COC_DEPTH_NOT_NORMALIZED
let pixelDistance=depth*1000.0;
#else
let pixelDistance: f32=(uniforms.cameraMinMaxZ.x+uniforms.cameraMinMaxZ.y*depth)*1000.0; 
#endif
#define CUSTOM_COC_PIXELDISTANCE
var coc: f32=abs(uniforms.cocPrecalculation*((uniforms.focusDistance-pixelDistance)/pixelDistance));coc=clamp(coc,0.0,1.0);fragmentOutputs.color= vec4f(coc,coc,coc,1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const circleOfConfusionPixelShaderWGSL = { name, shader };
//# sourceMappingURL=circleOfConfusion.fragment.js.map

/***/ }),

/***/ 50861:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   colorPixelShaderWGSL: () => (/* binding */ colorPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39759);
/* harmony import */ var _ShadersInclude_fogFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66407);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97715);
/* harmony import */ var _ShadersInclude_fogFragment_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93243);
// Do not edit.





const name = "colorPixelShader";
const shader = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
#define VERTEXCOLOR
varying vColor: vec4f;
#else
uniform color: vec4f;
#endif
#include<clipPlaneFragmentDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
fragmentOutputs.color=input.vColor;
#else
fragmentOutputs.color=uniforms.color;
#endif
#include<fogFragment>(color,fragmentOutputs.color)
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const colorPixelShaderWGSL = { name, shader };
//# sourceMappingURL=color.fragment.js.map

/***/ }),

/***/ 84935:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   colorVertexShaderWGSL: () => (/* binding */ colorVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32806);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98900);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77029);
/* harmony import */ var _ShadersInclude_fogVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75757);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65470);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(40242);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85197);
/* harmony import */ var _ShadersInclude_fogVertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(59013);
/* harmony import */ var _ShadersInclude_vertexColorMixing_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(820);
// Do not edit.












const name = "colorVertexShader";
const shader = `attribute position: vec3f;
#ifdef VERTEXCOLOR
attribute color: vec4f;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#ifdef FOG
uniform view: mat4x4f;
#endif
#include<instancesDeclaration>
uniform viewProjection: mat4x4f;
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vColor: vec4f;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f=finalWorld* vec4f(input.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;
#include<clipPlaneVertex>
#include<fogVertex>
#include<vertexColorMixing>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const colorVertexShaderWGSL = { name, shader };
//# sourceMappingURL=color.vertex.js.map

/***/ }),

/***/ 53813:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   colorCorrectionPixelShaderWGSL: () => (/* binding */ colorCorrectionPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "colorCorrectionPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;varying vUV: vec2f;var colorTableSampler: sampler;var colorTable: texture_2d<f32>;const SLICE_COUNT: f32=16.0; 
fn sampleAs3DTexture(uv: vec3f,width: f32)->vec4f {var sliceSize: f32=1.0/width; 
var slicePixelSize: f32=sliceSize/width; 
var sliceInnerSize: f32=slicePixelSize*(width-1.0); 
var zSlice0: f32=min(floor(uv.z*width),width-1.0);var zSlice1: f32=min(zSlice0+1.0,width-1.0);var xOffset: f32=slicePixelSize*0.5+uv.x*sliceInnerSize;var s0: f32=xOffset+(zSlice0*sliceSize);var s1: f32=xOffset+(zSlice1*sliceSize);var slice0Color: vec4f=textureSample(colorTable,colorTableSampler,vec2f(s0,uv.y));var slice1Color: vec4f=textureSample(colorTable,colorTableSampler,vec2f(s1,uv.y));var zOffset: f32=((uv.z*width)%(1.0));return mix(slice0Color,slice1Color,zOffset);}
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var screen_color: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);fragmentOutputs.color=sampleAs3DTexture(screen_color.rgb,SLICE_COUNT);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const colorCorrectionPixelShaderWGSL = { name, shader };
//# sourceMappingURL=colorCorrection.fragment.js.map

/***/ }),

/***/ 52906:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   convolutionPixelShaderWGSL: () => (/* binding */ convolutionPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "convolutionPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;uniform kernel: array<f32,9>;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var onePixel: vec2f= vec2f(1.0,1.0)/uniforms.screenSize;var colorSum: vec4f =
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(-1,-1))*uniforms.kernel[0] +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(0,-1))*uniforms.kernel[1] +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(1,-1))*uniforms.kernel[2] +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(-1,0))*uniforms.kernel[3] +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(0,0))*uniforms.kernel[4] +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(1,0))*uniforms.kernel[5] +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(-1,1))*uniforms.kernel[6] +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(0,1))*uniforms.kernel[7] +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel* vec2f(1,1))*uniforms.kernel[8];var kernelWeight: f32 =
uniforms.kernel[0] +
uniforms.kernel[1] +
uniforms.kernel[2] +
uniforms.kernel[3] +
uniforms.kernel[4] +
uniforms.kernel[5] +
uniforms.kernel[6] +
uniforms.kernel[7] +
uniforms.kernel[8];if (kernelWeight<=0.0) {kernelWeight=1.0;}
fragmentOutputs.color= vec4f((colorSum/kernelWeight).rgb,1);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const convolutionPixelShaderWGSL = { name, shader };
//# sourceMappingURL=convolution.fragment.js.map

/***/ }),

/***/ 95176:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   copyTexture3DLayerToTexturePixelShaderWGSL: () => (/* binding */ copyTexture3DLayerToTexturePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "copyTexture3DLayerToTexturePixelShader";
const shader = `var textureSampler: texture_3d<f32>;uniform layerNum: i32;varying vUV: vec2f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {let coord=vec3f(vec2f(input.vUV.x,input.vUV.y)*vec2f(textureDimensions(textureSampler,0).xy),f32(uniforms.layerNum));let color=textureLoad(textureSampler,vec3i(coord),0).rgb;fragmentOutputs.color= vec4f(color,1);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const copyTexture3DLayerToTexturePixelShaderWGSL = { name, shader };
//# sourceMappingURL=copyTexture3DLayerToTexture.fragment.js.map

/***/ }),

/***/ 17770:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   copyTextureToTexturePixelShaderWGSL: () => (/* binding */ copyTextureToTexturePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
// Do not edit.


const name = "copyTextureToTexturePixelShader";
const shader = `uniform conversion: f32;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;varying vUV: vec2f;
#include<helperFunctions>
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var color: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);
#ifdef DEPTH_TEXTURE
fragmentOutputs.fragDepth=color.r;
#else
if (uniforms.conversion==1.) {color=toLinearSpaceVec4(color);} else if (uniforms.conversion==2.) {color=toGammaSpace(color);}
fragmentOutputs.color=color;
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const copyTextureToTexturePixelShaderWGSL = { name, shader };
//# sourceMappingURL=copyTextureToTexture.fragment.js.map

/***/ }),

/***/ 45791:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   defaultPixelShaderWGSL: () => (/* binding */ defaultPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_defaultUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71698);
/* harmony import */ var _ShadersInclude_prePassDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(54211);
/* harmony import */ var _ShadersInclude_oitDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18639);
/* harmony import */ var _ShadersInclude_mainUVVaryingDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41861);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_lightUboDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30379);
/* harmony import */ var _ShadersInclude_lightsFragmentFunctions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(76493);
/* harmony import */ var _ShadersInclude_shadowsFragmentFunctions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(78589);
/* harmony import */ var _ShadersInclude_samplerFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80983);
/* harmony import */ var _ShadersInclude_fresnelFunction_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(30976);
/* harmony import */ var _ShadersInclude_reflectionFunction_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(72230);
/* harmony import */ var _ShadersInclude_imageProcessingDeclaration_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(16205);
/* harmony import */ var _ShadersInclude_imageProcessingFunctions_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(88996);
/* harmony import */ var _ShadersInclude_bumpFragmentMainFunctions_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(15697);
/* harmony import */ var _ShadersInclude_bumpFragmentFunctions_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(91258);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(39759);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_fogFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(66407);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(97715);
/* harmony import */ var _ShadersInclude_bumpFragment_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(20727);
/* harmony import */ var _ShadersInclude_decalFragment_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(49306);
/* harmony import */ var _ShadersInclude_depthPrePass_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(59104);
/* harmony import */ var _ShadersInclude_lightFragment_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(25271);
/* harmony import */ var _ShadersInclude_logDepthFragment_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(38780);
/* harmony import */ var _ShadersInclude_fogFragment_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(93243);
/* harmony import */ var _ShadersInclude_oitFragment_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(91347);
// Do not edit.



























const name = "defaultPixelShader";
const shader = `#include<defaultUboDeclaration>
#include<prePassDeclaration>[SCENE_MRT_COUNT]
#include<oitDeclaration>
#define CUSTOM_FRAGMENT_BEGIN
varying vPositionW: vec3f;
#ifdef NORMAL
varying vNormalW: vec3f;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vColor: vec4f;
#endif
#include<mainUVVaryingDeclaration>[1..7]
#include<helperFunctions>
#include<lightUboDeclaration>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)
#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)
#ifdef REFRACTION
#ifdef REFRACTIONMAP_3D
var refractionCubeSamplerSampler: sampler;var refractionCubeSampler: texture_cube<f32>;
#else
var refraction2DSamplerSampler: sampler;var refraction2DSampler: texture_2d<f32>;
#endif
#endif
#if defined(SPECULARTERM)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)
#endif
#include<fresnelFunction>
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
var reflectionCubeSamplerSampler: sampler;var reflectionCubeSampler: texture_cube<f32>;
#else
var reflection2DSamplerSampler: sampler;var reflection2DSampler: texture_2d<f32>;
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vPositionUVW: vec3f;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vDirectionW: vec3f;
#endif
#endif
#include<reflectionFunction>
#endif
#include<imageProcessingDeclaration>
#include<imageProcessingFunctions>
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;
#ifdef NORMAL
var normalW: vec3f=normalize(fragmentInputs.vNormalW);
#else
var normalW: vec3f=normalize(-cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)));
#endif
#include<bumpFragment>
#ifdef TWOSIDEDLIGHTING
normalW=select(-normalW,normalW,fragmentInputs.frontFacing);
#endif
#ifdef DIFFUSE
baseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV+uvOffset);
#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)
if (baseColor.a<uniforms.alphaCutOff) {discard;}
#endif
#ifdef ALPHAFROMDIFFUSE
alpha*=baseColor.a;
#endif
#define CUSTOM_FRAGMENT_UPDATE_ALPHA
baseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);
#endif
#if defined(DECAL) && !defined(DECAL_AFTER_DETAIL)
var decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);
#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)
#endif
#include<depthPrePass>
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
baseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);
#endif
#ifdef DETAIL
baseColor=vec4f(baseColor.rgb*2.0*mix(0.5,detailColor.r,uniforms.vDetailInfos.y),baseColor.a);
#endif
#if defined(DECAL) && defined(DECAL_AFTER_DETAIL)
var decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);
#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)
#endif
#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE
var baseAmbientColor: vec3f= vec3f(1.,1.,1.);
#ifdef AMBIENT
baseAmbientColor=textureSample(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb*uniforms.vAmbientInfos.y;
#endif
#define CUSTOM_FRAGMENT_BEFORE_LIGHTS
var glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;
#ifdef SPECULARTERM
#ifdef SPECULAR
var specularMapColor: vec4f=textureSample(specularSampler,specularSamplerSampler,fragmentInputs.vSpecularUV+uvOffset);specularColor=specularMapColor.rgb;
#ifdef GLOSSINESS
glossiness=glossiness*specularMapColor.a;
#endif
#endif
#endif
var diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;
#ifdef SPECULARTERM
var specularBase: vec3f= vec3f(0.,0.,0.);
#endif
var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;
#ifdef LIGHTMAP
var lightmapColor: vec4f=textureSample(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset);
#ifdef RGBDLIGHTMAP
lightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a);
#endif
lightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a);
#endif
#include<lightFragment>[0..maxSimultaneousLights]
aggShadow=aggShadow/numLights;var refractionColor: vec4f= vec4f(0.,0.,0.,1.);
#ifdef REFRACTION
var refractionVector: vec3f=normalize(refract(-viewDirectionW,normalW,uniforms.vRefractionInfos.y));
#ifdef REFRACTIONMAP_3D
#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC
refractionVector=parallaxCorrectNormal(fragmentInputs.vPositionW,refractionVector,uniforms.vRefractionSize,uniforms.vRefractionPosition);
#endif
refractionVector.y=refractionVector.y*uniforms.vRefractionInfos.w;var refractionLookup: vec4f=textureSample(refractionCubeSampler,refractionCubeSamplerSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;}
#else
var vRefractionUVW: vec3f= (uniforms.refractionMatrix*(scene.view* vec4f(fragmentInputs.vPositionW+refractionVector*uniforms.vRefractionInfos.z,1.0))).xyz;var refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=textureSample(refraction2DSampler,refraction2DSamplerSampler,refractionCoords);
#endif
#ifdef RGBDREFRACTION
refractionColor=vec4f(fromRGBD(refractionColor),refractionColor.a);
#endif
#ifdef IS_REFRACTION_LINEAR
refractionColor=vec4f(toGammaSpaceVec3(refractionColor.rgb),refractionColor.a);
#endif
refractionColor=vec4f(refractionColor.rgb*uniforms.vRefractionInfos.x,refractionColor.a);
#endif
var reflectionColor: vec4f= vec4f(0.,0.,0.,1.);
#ifdef REFLECTION
var vReflectionUVW: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW);
#ifdef REFLECTIONMAP_OPPOSITEZ
vReflectionUVW=vec3f(vReflectionUVW.x,vReflectionUVW.y,vReflectionUVW.z*-1.0);
#endif
#ifdef REFLECTIONMAP_3D
#ifdef ROUGHNESS
var bias: f32=uniforms.vReflectionInfos.y;
#ifdef SPECULARTERM
#ifdef SPECULAR
#ifdef GLOSSINESS
bias*=(1.0-specularMapColor.a);
#endif
#endif
#endif
reflectionColor=textureSampleLevel(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW,bias);
#else
reflectionColor=textureSample(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW);
#endif
#else
var coords: vec2f=vReflectionUVW.xy;
#ifdef REFLECTIONMAP_PROJECTION
coords/=vReflectionUVW.z;
#endif
coords.y=1.0-coords.y;reflectionColor=textureSample(reflection2DSampler,reflection2DSamplerSampler,coords);
#endif
#ifdef RGBDREFLECTION
reflectionColor=vec4f(fromRGBD(reflectionColor),reflectionColor.a);
#endif
#ifdef IS_REFLECTION_LINEAR
reflectionColor=vec4f(toGammaSpaceVec3(reflectionColor.rgb),reflectionColor.a);
#endif
reflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a);
#ifdef REFLECTIONFRESNEL
var reflectionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.reflectionRightColor.a,uniforms.reflectionLeftColor.a);
#ifdef REFLECTIONFRESNELFROMSPECULAR
#ifdef SPECULARTERM
reflectionColor=vec4f(reflectionColor.rgb*specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);
#else
reflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);
#endif
#else
reflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);
#endif
#endif
#endif
#ifdef REFRACTIONFRESNEL
var refractionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.refractionRightColor.a,uniforms.refractionLeftColor.a);refractionColor=vec4f(refractionColor.rgb*uniforms.refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*uniforms.refractionRightColor.rgb,refractionColor.a);
#endif
#ifdef OPACITY
var opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV+uvOffset);
#ifdef OPACITYRGB
opacityMap=vec4f(opacityMap.rgb* vec3f(0.3,0.59,0.11),opacityMap.a);alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* uniforms.vOpacityInfos.y;
#else
alpha*=opacityMap.a*uniforms.vOpacityInfos.y;
#endif
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=fragmentInputs.vColor.a;
#endif
#ifdef OPACITYFRESNEL
var opacityFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.opacityParts.z,uniforms.opacityParts.w);alpha+=uniforms.opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*uniforms.opacityParts.y;
#endif
#ifdef ALPHATEST
#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS
if (alpha<uniforms.alphaCutOff) {discard;}
#endif
#ifndef ALPHABLEND
alpha=1.0;
#endif
#endif
var emissiveColor: vec3f=uniforms.vEmissiveColor;
#ifdef EMISSIVE
emissiveColor+=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vEmissiveUV+uvOffset).rgb*uniforms.vEmissiveInfos.y;
#endif
#ifdef EMISSIVEFRESNEL
var emissiveFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.emissiveRightColor.a,uniforms.emissiveLeftColor.a);emissiveColor*=uniforms.emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*uniforms.emissiveRightColor.rgb;
#endif
#ifdef DIFFUSEFRESNEL
var diffuseFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.diffuseRightColor.a,uniforms.diffuseLeftColor.a);diffuseBase*=uniforms.diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*uniforms.diffuseRightColor.rgb;
#endif
#ifdef EMISSIVEASILLUMINATION
var finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;
#else
#ifdef LINKEMISSIVEWITHDIFFUSE
var finalDiffuse: vec3f=clamp((diffuseBase+emissiveColor)*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;
#else
var finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+emissiveColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;
#endif
#endif
#ifdef SPECULARTERM
var finalSpecular: vec3f=specularBase*specularColor;
#ifdef SPECULAROVERALPHA
alpha=clamp(alpha+dot(finalSpecular, vec3f(0.3,0.59,0.11)),0.0,1.0);
#endif
#else
var finalSpecular: vec3f= vec3f(0.0);
#endif
#ifdef REFLECTIONOVERALPHA
alpha=clamp(alpha+dot(reflectionColor.rgb, vec3f(0.3,0.59,0.11)),0.0,1.0);
#endif
#ifdef EMISSIVEASILLUMINATION
var color: vec4f= vec4f(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);
#else
var color: vec4f= vec4f(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);
#endif
#ifdef LIGHTMAP
#ifndef LIGHTMAPEXCLUDED
#ifdef USELIGHTMAPASSHADOWMAP
color=vec4f(color.rgb*lightmapColor.rgb,color.a);
#else
color=vec4f(color.rgb+lightmapColor.rgb,color.a);
#endif
#endif
#endif
#define CUSTOM_FRAGMENT_BEFORE_FOG
color=vec4f(max(color.rgb,vec3f(0.)),color.a);
#include<logDepthFragment>
#include<fogFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
color=vec4f(toLinearSpaceVec3(color.rgb),color.a);
#else
#ifdef IMAGEPROCESSING
color=vec4f(toLinearSpaceVec3(color.rgb),color.a);color=applyImageProcessing(color);
#endif
#endif
color=vec4f(color.rgb,color.a*mesh.visibility);
#ifdef PREMULTIPLYALPHA
color=vec4f(color.rgb*color.a, color.a);
#endif
#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
#ifdef PREPASS
var writeGeometryInfo: f32=select(0.0,1.0,color.a>0.4);var fragData: array<vec4<f32>,SCENE_MRT_COUNT>;
#ifdef PREPASS_COLOR
fragData[PREPASS_COLOR_INDEX]=color; 
#endif
#ifdef PREPASS_POSITION
fragData[PREPASS_POSITION_INDEX]=vec4f(fragmentInputs.vPositionW,writeGeometryInfo);
#endif
#ifdef PREPASS_LOCAL_POSITION
fragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo);
#endif
#ifdef PREPASS_VELOCITY
var a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo);
#elif defined(PREPASS_VELOCITY_LINEAR)
var velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) -
(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_IRRADIANCE
fragData[PREPASS_IRRADIANCE_INDEX]=vec4f(0.0,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_DEPTH
fragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_SCREENSPACE_DEPTH
fragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_NORMAL
#ifdef PREPASS_NORMAL_WORLDSPACE
fragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo);
#else
fragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo);
#endif
#endif
#ifdef PREPASS_WORLD_NORMAL
fragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO
fragData[PREPASS_ALBEDO_INDEX]=vec4f(baseColor.rgb,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO_SQRT
fragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqrt(baseColor.rgb),writeGeometryInfo);
#endif
#ifdef PREPASS_REFLECTIVITY
#if defined(SPECULAR)
fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec4(specularMapColor))*writeGeometryInfo; 
#else
fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec3(specularColor),1.0)*writeGeometryInfo;
#endif
#endif
#if SCENE_MRT_COUNT>0
fragmentOutputs.fragData0=fragData[0];
#endif
#if SCENE_MRT_COUNT>1
fragmentOutputs.fragData1=fragData[1];
#endif
#if SCENE_MRT_COUNT>2
fragmentOutputs.fragData2=fragData[2];
#endif
#if SCENE_MRT_COUNT>3
fragmentOutputs.fragData3=fragData[3];
#endif
#if SCENE_MRT_COUNT>4
fragmentOutputs.fragData4=fragData[4];
#endif
#if SCENE_MRT_COUNT>5
fragmentOutputs.fragData5=fragData[5];
#endif
#if SCENE_MRT_COUNT>6
fragmentOutputs.fragData6=fragData[6];
#endif
#if SCENE_MRT_COUNT>7
fragmentOutputs.fragData7=fragData[7];
#endif
#endif
#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)
fragmentOutputs.color=color;
#endif
#include<oitFragment>
#if ORDER_INDEPENDENT_TRANSPARENCY
if (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+color.rgb*color.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-color.a));} else {fragmentOutputs.backColor+=color;}
#endif
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const defaultPixelShaderWGSL = { name, shader };
//# sourceMappingURL=default.fragment.js.map

/***/ }),

/***/ 59235:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  defaultVertexShaderWGSL: () => (/* binding */ defaultVertexShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js
var defaultUboDeclaration = __webpack_require__(71698);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/uvAttributeDeclaration.js
var uvAttributeDeclaration = __webpack_require__(1008);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(79702);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(32806);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(98900);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__(44559);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js
var prePassVertexDeclaration = __webpack_require__(37769);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/mainUVVaryingDeclaration.js
var mainUVVaryingDeclaration = __webpack_require__(41861);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/samplerVertexDeclaration.js
var samplerVertexDeclaration = __webpack_require__(89277);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js
var bumpVertexDeclaration = __webpack_require__(97777);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(77029);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__(75757);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js
// Do not edit.

const lightVxFragmentDeclaration_name = "lightVxFragmentDeclaration";
const shader = `#ifdef LIGHT{X}
uniform vLightData{X}: vec4f;uniform vLightDiffuse{X}: vec4f;
#ifdef SPECULARTERM
uniform vLightSpecular{X}: vec4f;
#else
var vLightSpecular{X}: vec4f= vec4f(0.);
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform lightMatrix{X}: mat4x4f[SHADOWCSMNUM_CASCADES{X}];varying var vPositionFromLight{X}: vec4f[SHADOWCSMNUM_CASCADES{X}];varying var vDepthMetric{X}: f32[SHADOWCSMNUM_CASCADES{X}];varying var vPositionFromCamera{X}: vec4f;
#elif defined(SHADOWCUBE{X})
#else
varying var vPositionFromLight{X}: vec4f;varying var vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;
#endif
uniform shadowsInfo{X}: vec4f;uniform depthValues{X}: vec2f;
#endif
#ifdef SPOTLIGHT{X}
uniform vLightDirection{X}: vec4f;uniform vLightFalloff{X}: vec4f;
#elif defined(POINTLIGHT{X})
uniform vLightFalloff{X}: vec4f;
#elif defined(HEMILIGHT{X})
uniform vLightGround{X}: vec3f;
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[lightVxFragmentDeclaration_name] = shader;
/** @internal */
const lightVxFragmentDeclarationWGSL = { name: lightVxFragmentDeclaration_name, shader };
//# sourceMappingURL=lightVxFragmentDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js
var lightVxUboDeclaration = __webpack_require__(3925);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__(76340);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__(8217);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(93226);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__(18258);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__(9129);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(91277);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(65470);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(40242);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/prePassVertex.js
var prePassVertex = __webpack_require__(47033);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/uvVariableDeclaration.js
var uvVariableDeclaration = __webpack_require__(20774);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/samplerVertexImplementation.js
var samplerVertexImplementation = __webpack_require__(52231);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bumpVertex.js
var bumpVertex = __webpack_require__(87921);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(85197);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__(59013);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsVertex.js
var shadowsVertex = __webpack_require__(79456);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/vertexColorMixing.js
var vertexColorMixing = __webpack_require__(820);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__(81482);
;// ./node_modules/@babylonjs/core/ShadersWGSL/default.vertex.js
// Do not edit.
































const default_vertex_name = "defaultVertexShader";
const default_vertex_shader = `#include<defaultUboDeclaration>
#define CUSTOM_VERTEX_BEGIN
attribute position: vec3f;
#ifdef NORMAL
attribute normal: vec3f;
#endif
#ifdef TANGENT
attribute tangent: vec4f;
#endif
#ifdef UV1
attribute uv: vec2f;
#endif
#include<uvAttributeDeclaration>[2..7]
#ifdef VERTEXCOLOR
attribute color: vec4f;
#endif
#include<helperFunctions>
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
#include<prePassVertexDeclaration>
#include<mainUVVaryingDeclaration>[1..7]
#include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)
#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
#if defined(SPECULARTERM)
#include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)
#endif
#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)
varying vPositionW: vec3f;
#ifdef NORMAL
varying vNormalW: vec3f;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vColor: vec4f;
#endif
#include<bumpVertexDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
varying vPositionUVW: vec3f;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vDirectionW: vec3f;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
var positionUpdated: vec3f=vertexInputs.position;
#ifdef NORMAL
var normalUpdated: vec3f=vertexInputs.normal;
#endif
#ifdef TANGENT
var tangentUpdated: vec4f=vertexInputs.tangent;
#endif
#ifdef UV1
var uvUpdated: vec2f=vertexInputs.uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
vertexOutputs.vPositionUVW=positionUpdated;
#endif
#define CUSTOM_VERTEX_UPDATE_POSITION
#define CUSTOM_VERTEX_UPDATE_NORMAL
#include<instancesVertex>
#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0);
#ifdef NORMAL
var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW);
#else
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);
#endif
#endif
#define CUSTOM_VERTEX_UPDATE_WORLDPOS
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;}
#else
vertexOutputs.position=scene.viewProjection*worldPos;
#endif
vertexOutputs.vPositionW= worldPos.xyz;
#ifdef PREPASS
#include<prePassVertex>
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vertexOutputs.vDirectionW=normalize((finalWorld* vec4f(positionUpdated,0.0)).xyz);
#endif
#ifndef UV1
var uvUpdated: vec2f=vec2f(0.,0.);
#endif
#ifdef MAINUV1
vertexOutputs.vMainUV1=uvUpdated;
#endif
#include<uvVariableDeclaration>[2..7]
#include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
#if defined(SPECULARTERM)
#include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)
#endif
#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)
#include<bumpVertex>
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[default_vertex_name] = default_vertex_shader;
/** @internal */
const defaultVertexShaderWGSL = { name: default_vertex_name, shader: default_vertex_shader };
//# sourceMappingURL=default.vertex.js.map

/***/ }),

/***/ 38939:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   depthPixelShaderWGSL: () => (/* binding */ depthPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39759);
/* harmony import */ var _ShadersInclude_packingFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5543);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97715);
// Do not edit.




const name = "depthPixelShader";
const shader = `#ifdef ALPHATEST
varying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
#endif
#include<clipPlaneFragmentDeclaration>
varying vDepthMetric: f32;
#ifdef PACKED
#include<packingFunctions>
#endif
#ifdef STORE_CAMERASPACE_Z
varying vViewPos: vec4f;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV).a<0.4) {discard;}
#endif
#ifdef STORE_CAMERASPACE_Z
#ifdef PACKED
fragmentOutputs.color=pack(input.vViewPos.z);
#else
fragmentOutputs.color= vec4f(input.vViewPos.z,0.0,0.0,1.0);
#endif
#else
#ifdef NONLINEARDEPTH
#ifdef PACKED
fragmentOutputs.color=pack(input.position.z);
#else
fragmentOutputs.color= vec4f(input.position.z,0.0,0.0,0.0);
#endif
#else
#ifdef PACKED
fragmentOutputs.color=pack(input.vDepthMetric);
#else
fragmentOutputs.color= vec4f(input.vDepthMetric,0.0,0.0,1.0);
#endif
#endif
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const depthPixelShaderWGSL = { name, shader };
//# sourceMappingURL=depth.fragment.js.map

/***/ }),

/***/ 48453:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   depthVertexShaderWGSL: () => (/* binding */ depthVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32806);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98900);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76340);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8217);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77029);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18258);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9129);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65470);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(40242);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(85197);
// Do not edit.













const name = "depthVertexShader";
const shader = `attribute position: vec3f;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform viewProjection: mat4x4f;uniform depthValues: vec2f;
#if defined(ALPHATEST) || defined(NEED_UV)
varying vUV: vec2f;uniform diffuseMatrix: mat4x4f;
#ifdef UV1
attribute uv: vec2f;
#endif
#ifdef UV2
attribute uv2: vec2f;
#endif
#endif
#ifdef STORE_CAMERASPACE_Z
uniform view: mat4x4f;varying vViewPos: vec4f;
#endif
varying vDepthMetric: f32;
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;
#ifdef UV1
var uvUpdated: vec2f=input.uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);
#include<clipPlaneVertex>
vertexOutputs.position=uniforms.viewProjection*worldPos;
#ifdef STORE_CAMERASPACE_Z
vertexOutputs.vViewPos=uniforms.view*worldPos;
#else
#ifdef USE_REVERSE_DEPTHBUFFER
vertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));
#else
vertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));
#endif
#endif
#if defined(ALPHATEST) || defined(BASIC_RENDER)
#ifdef UV1
vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
#endif
#ifdef UV2
vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(input.uv2,1.0,0.0)).xy;
#endif
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const depthVertexShaderWGSL = { name, shader };
//# sourceMappingURL=depth.vertex.js.map

/***/ }),

/***/ 10355:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   depthBoxBlurPixelShaderWGSL: () => (/* binding */ depthBoxBlurPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "depthBoxBlurPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var colorDepth: vec4f=vec4f(0.0);for (var x: i32=-OFFSET; x<=OFFSET; x++) {for (var y: i32=-OFFSET; y<=OFFSET; y++) {colorDepth+=textureSample(textureSampler,textureSamplerSampler,input.vUV+ vec2f(f32(x),f32(y))/uniforms.screenSize);}}
fragmentOutputs.color=(colorDepth/ f32((OFFSET*2+1)*(OFFSET*2+1)));}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const depthBoxBlurPixelShaderWGSL = { name, shader };
//# sourceMappingURL=depthBoxBlur.fragment.js.map

/***/ }),

/***/ 89480:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   depthOfFieldMergePixelShaderWGSL: () => (/* binding */ depthOfFieldMergePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "depthOfFieldMergePixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var circleOfConfusionSamplerSampler: sampler;var circleOfConfusionSampler: texture_2d<f32>;var blurStep0Sampler: sampler;var blurStep0: texture_2d<f32>;
#if BLUR_LEVEL>0
var blurStep1Sampler: sampler;var blurStep1: texture_2d<f32>;
#endif
#if BLUR_LEVEL>1
var blurStep2Sampler: sampler;var blurStep2: texture_2d<f32>;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var coc: f32=textureSampleLevel(circleOfConfusionSampler,circleOfConfusionSamplerSampler,input.vUV,0.0).r;
#if BLUR_LEVEL==0
var original: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var blurred0: vec4f=textureSampleLevel(blurStep0,blurStep0Sampler,input.vUV,0.0);fragmentOutputs.color=mix(original,blurred0,coc);
#endif
#if BLUR_LEVEL==1
if(coc<0.5){var original: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var blurred1: vec4f=textureSampleLevel(blurStep1,blurStep1Sampler,input.vUV,0.0);fragmentOutputs.color=mix(original,blurred1,coc/0.5);}else{var blurred0: vec4f=textureSampleLevel(blurStep0,blurStep0Sampler,input.vUV,0.0);var blurred1: vec4f=textureSampleLevel(blurStep1,blurStep1Sampler,input.vUV,0.0);fragmentOutputs.color=mix(blurred1,blurred0,(coc-0.5)/0.5);}
#endif
#if BLUR_LEVEL==2
if(coc<0.33){var original: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var blurred2: vec4f=textureSampleLevel(blurStep2,blurStep2Sampler,input.vUV,0.0);fragmentOutputs.color=mix(original,blurred2,coc/0.33);}else if(coc<0.66){var blurred1: vec4f=textureSampleLevel(blurStep1,blurStep1Sampler,input.vUV,0.0);var blurred2: vec4f=textureSampleLevel(blurStep2,blurStep2Sampler,input.vUV,0.0);fragmentOutputs.color=mix(blurred2,blurred1,(coc-0.33)/0.33);}else{var blurred0: vec4f=textureSampleLevel(blurStep0,blurStep0Sampler,input.vUV,0.0);var blurred1: vec4f=textureSampleLevel(blurStep1,blurStep1Sampler,input.vUV,0.0);fragmentOutputs.color=mix(blurred1,blurred0,(coc-0.66)/0.34);}
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const depthOfFieldMergePixelShaderWGSL = { name, shader };
//# sourceMappingURL=depthOfFieldMerge.fragment.js.map

/***/ }),

/***/ 54069:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   displayPassPixelShaderWGSL: () => (/* binding */ displayPassPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "displayPassPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var passSamplerSampler: sampler;var passSampler: texture_2d<f32>;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(passSampler,passSamplerSampler,input.vUV);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const displayPassPixelShaderWGSL = { name, shader };
//# sourceMappingURL=displayPass.fragment.js.map

/***/ }),

/***/ 95516:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   extractHighlightsPixelShaderWGSL: () => (/* binding */ extractHighlightsPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
// Do not edit.


const name = "extractHighlightsPixelShader";
const shader = `#include<helperFunctions>
varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform threshold: f32;uniform exposure: f32;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);var luma: f32=dot(LuminanceEncodeApprox,fragmentOutputs.color.rgb*uniforms.exposure);fragmentOutputs.color=vec4f(step(uniforms.threshold,luma)*fragmentOutputs.color.rgb,fragmentOutputs.color.a);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const extractHighlightsPixelShaderWGSL = { name, shader };
//# sourceMappingURL=extractHighlights.fragment.js.map

/***/ }),

/***/ 57912:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   filterPixelShaderWGSL: () => (/* binding */ filterPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "filterPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform kernelMatrix: mat4x4f;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var baseColor: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var updatedColor: vec3f=(uniforms.kernelMatrix* vec4f(baseColor,1.0)).rgb;fragmentOutputs.color= vec4f(updatedColor,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const filterPixelShaderWGSL = { name, shader };
//# sourceMappingURL=filter.fragment.js.map

/***/ }),

/***/ 97163:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingBilateralBlurPixelShaderWGSL: () => (/* binding */ fluidRenderingBilateralBlurPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingBilateralBlurPixelShader";
const shader = `var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform maxFilterSize: i32;uniform blurDir: vec2f;uniform projectedParticleConstant: f32;uniform depthThreshold: f32;varying vUV: vec2f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var depth: f32=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.).x;if (depth>=1e6 || depth<=0.) {fragmentOutputs.color=vec4f(vec3f(depth),1.);return fragmentOutputs;}
var filterSize: i32=min(uniforms.maxFilterSize,i32(ceil(uniforms.projectedParticleConstant/depth)));var sigma: f32=f32(filterSize)/3.0;var two_sigma2: f32=2.0*sigma*sigma;var sigmaDepth: f32=uniforms.depthThreshold/3.0;var two_sigmaDepth2: f32=2.0*sigmaDepth*sigmaDepth;var sum: f32=0.;var wsum: f32=0.;var sumVel: f32=0.;for (var x: i32=-filterSize; x<=filterSize; x++) {var coords: vec2f=vec2f(f32(x));var sampleDepthVel: vec2f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV+coords*uniforms.blurDir,0.).rg;var r: f32=dot(coords,coords);var w: f32=exp(-r/two_sigma2);var rDepth: f32=sampleDepthVel.r-depth;var wd: f32=exp(-rDepth*rDepth/two_sigmaDepth2);sum+=sampleDepthVel.r*w*wd;sumVel+=sampleDepthVel.g*w*wd;wsum+=w*wd;}
fragmentOutputs.color=vec4f(sum/wsum,sumVel/wsum,0.,1.);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fluidRenderingBilateralBlurPixelShaderWGSL = { name, shader };
//# sourceMappingURL=fluidRenderingBilateralBlur.fragment.js.map

/***/ }),

/***/ 67297:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleDepthPixelShaderWGSL: () => (/* binding */ fluidRenderingParticleDepthPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleDepthPixelShader";
const shader = `uniform projection: mat4x4f;varying uv: vec2f;varying viewPos: vec3f;varying sphereRadius: f32;
#ifdef FLUIDRENDERING_VELOCITY
varying velocityNorm: f32;
#endif
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var normalxy: vec2f=input.uv*2.0-1.0;var r2: f32=dot(normalxy,normalxy);if (r2>1.0) {discard;}
var normal: vec3f=vec3f(normalxy,sqrt(1.0-r2));
#ifndef FLUIDRENDERING_RHS
normal.z=-normal.z;
#endif
var realViewPos: vec4f=vec4f(input.viewPos+normal*input.sphereRadius,1.0);var clipSpacePos: vec4f=uniforms.projection*realViewPos;fragmentOutputs.fragDepth=clipSpacePos.z/clipSpacePos.w;
#ifdef FLUIDRENDERING_RHS
realViewPos.z=-realViewPos.z;
#endif
#ifdef FLUIDRENDERING_VELOCITY
fragmentOutputs.color=vec4f(realViewPos.z,input.velocityNorm,0.,1.);
#else
fragmentOutputs.color=vec4f(realViewPos.z,0.,0.,1.);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fluidRenderingParticleDepthPixelShaderWGSL = { name, shader };
//# sourceMappingURL=fluidRenderingParticleDepth.fragment.js.map

/***/ }),

/***/ 27499:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleDepthVertexShaderWGSL: () => (/* binding */ fluidRenderingParticleDepthVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleDepthVertexShader";
const shader = `attribute position: vec3f;attribute offset: vec2f;uniform view: mat4x4f;uniform projection: mat4x4f;uniform size: vec2f;varying uv: vec2f;varying viewPos: vec3f;varying sphereRadius: f32;
#ifdef FLUIDRENDERING_VELOCITY
attribute velocity: vec3f;varying velocityNorm: f32;
#endif
@vertex
fn main(input: VertexInputs)->FragmentInputs {var cornerPos: vec3f=vec3f(
vec2f(input.offset.x-0.5,input.offset.y-0.5)*uniforms.size,
0.0
);vertexOutputs.viewPos=(uniforms.view*vec4f(input.position,1.0)).xyz;vertexOutputs.position=uniforms.projection*vec4f(vertexOutputs.viewPos+cornerPos,1.0);vertexOutputs.uv=input.offset;vertexOutputs.sphereRadius=uniforms.size.x/2.0;
#ifdef FLUIDRENDERING_VELOCITY
vertexOutputs.velocityNorm=length(velocity);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fluidRenderingParticleDepthVertexShaderWGSL = { name, shader };
//# sourceMappingURL=fluidRenderingParticleDepth.vertex.js.map

/***/ }),

/***/ 75636:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleDiffusePixelShaderWGSL: () => (/* binding */ fluidRenderingParticleDiffusePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleDiffusePixelShader";
const shader = `uniform particleAlpha: f32;varying uv: vec2f;varying diffuseColor: vec3f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var normalxy: vec2f=input.uv*2.0-1.0;var r2: f32=dot(normalxy,normalxy);if (r2>1.0) {discard;}
fragmentOutputs.color=vec4f(input.diffuseColor,1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fluidRenderingParticleDiffusePixelShaderWGSL = { name, shader };
//# sourceMappingURL=fluidRenderingParticleDiffuse.fragment.js.map

/***/ }),

/***/ 84556:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleThicknessPixelShaderWGSL: () => (/* binding */ fluidRenderingParticleThicknessPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleThicknessPixelShader";
const shader = `uniform particleAlpha: f32;varying uv: vec2f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var normalxy: vec2f=input.uv*2.0-1.0;var r2: f32=dot(normalxy,normalxy);if (r2>1.0) {discard;}
var thickness: f32=sqrt(1.0-r2);fragmentOutputs.color=vec4f(vec3f(uniforms.particleAlpha*thickness),1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fluidRenderingParticleThicknessPixelShaderWGSL = { name, shader };
//# sourceMappingURL=fluidRenderingParticleThickness.fragment.js.map

/***/ }),

/***/ 63866:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleThicknessVertexShaderWGSL: () => (/* binding */ fluidRenderingParticleThicknessVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleThicknessVertexShader";
const shader = `attribute position: vec3f;attribute offset: vec2f;uniform view: mat4x4f;uniform projection: mat4x4f;uniform size: vec2f;varying uv: vec2f;@vertex
fn main(input: VertexInputs)->FragmentInputs {var cornerPos: vec3f=vec3f(
vec2f(input.offset.x-0.5,input.offset.y-0.5)*uniforms.size,
0.0
);var viewPos: vec3f=(uniforms.view*vec4f(input.position,1.0)).xyz+cornerPos;vertexOutputs.position=uniforms.projection*vec4f(viewPos,1.0);vertexOutputs.uv=input.offset;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fluidRenderingParticleThicknessVertexShaderWGSL = { name, shader };
//# sourceMappingURL=fluidRenderingParticleThickness.vertex.js.map

/***/ }),

/***/ 52150:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingRenderPixelShaderWGSL: () => (/* binding */ fluidRenderingRenderPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingRenderPixelShader";
const shader = `#define DISABLE_UNIFORMITY_ANALYSIS
#define IOR 1.333
#define ETA 1.0/IOR
#define F0 0.02
var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;
#ifdef FLUIDRENDERING_DIFFUSETEXTURE
var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
#else
uniform diffuseColor: vec3f;
#endif
#ifdef FLUIDRENDERING_FIXED_THICKNESS
uniform thickness: f32;var bgDepthSamplerSampler: sampler;var bgDepthSampler: texture_2d<f32>;
#else
uniform minimumThickness: f32;var thicknessSamplerSampler: sampler;var thicknessSampler: texture_2d<f32>;
#endif
#ifdef FLUIDRENDERING_ENVIRONMENT
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;
#endif
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)
var debugSamplerSampler: sampler;var debugSampler: texture_2d<f32>;
#endif
uniform viewMatrix: mat4x4f;uniform projectionMatrix: mat4x4f;uniform invProjectionMatrix: mat4x4f;uniform texelSize: vec2f;uniform dirLight: vec3f;uniform cameraFar: f32;uniform density: f32;uniform refractionStrength: f32;uniform fresnelClamp: f32;uniform specularPower: f32;varying vUV: vec2f;fn computeViewPosFromUVDepth(texCoord: vec2f,depth: f32)->vec3f {var ndc: vec4f=vec4f(texCoord*2.0-1.0,0.0,1.0);
#ifdef FLUIDRENDERING_RHS
ndc.z=-uniforms.projectionMatrix[2].z+uniforms.projectionMatrix[3].z/depth;
#else
ndc.z=uniforms.projectionMatrix[2].z+uniforms.projectionMatrix[3].z/depth;
#endif
ndc.w=1.0;var eyePos: vec4f=uniforms.invProjectionMatrix*ndc;return eyePos.xyz/eyePos.w;}
fn getViewPosFromTexCoord(texCoord: vec2f)->vec3f {var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,texCoord,0.).x;return computeViewPosFromUVDepth(texCoord,depth);}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var texCoord: vec2f=input.vUV;
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)
var color: vec4f=textureSample(debugSampler,debugSamplerSampler,texCoord);
#ifdef FLUIDRENDERING_DEBUG_DEPTH
fragmentOutputs.color=vec4f(color.rgb/vec3f(2.0),1.);if (color.r>0.999 && color.g>0.999) {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,texCoord);}
#else
fragmentOutputs.color=vec4f(color.rgb,1.);if (color.r<0.001 && color.g<0.001 && color.b<0.001) {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,texCoord);}
#endif
return fragmentOutputs;
#endif
var depthVel: vec2f=textureSampleLevel(depthSampler,depthSamplerSampler,texCoord,0.).rg;var depth: f32=depthVel.r;
#ifndef FLUIDRENDERING_FIXED_THICKNESS
var thickness: f32=textureSample(thicknessSampler,thicknessSamplerSampler,texCoord).x;
#else
var thickness: f32=uniforms.thickness;var bgDepth: f32=textureSample(bgDepthSampler,bgDepthSamplerSampler,texCoord).x;var depthNonLinear: f32=uniforms.projectionMatrix[2].z+uniforms.projectionMatrix[3].z/depth;depthNonLinear=depthNonLinear*0.5+0.5;
#endif
var backColor: vec4f=textureSample(textureSampler,textureSamplerSampler,texCoord);
#ifndef FLUIDRENDERING_FIXED_THICKNESS
if (depth>=uniforms.cameraFar || depth<=0. || thickness<=uniforms.minimumThickness) {
#else
if (depth>=uniforms.cameraFar || depth<=0. || bgDepth<=depthNonLinear) {
#endif
#ifdef FLUIDRENDERING_COMPOSITE_MODE
fragmentOutputs.color=vec4f(backColor.rgb*backColor.a,backColor.a);
#else
fragmentOutputs.color=backColor;
#endif
return fragmentOutputs;}
var viewPos: vec3f=computeViewPosFromUVDepth(texCoord,depth);var ddx: vec3f=getViewPosFromTexCoord(texCoord+vec2f(uniforms.texelSize.x,0.))-viewPos;var ddy: vec3f=getViewPosFromTexCoord(texCoord+vec2f(0.,uniforms.texelSize.y))-viewPos;var ddx2: vec3f=viewPos-getViewPosFromTexCoord(texCoord+vec2f(-uniforms.texelSize.x,0.));if (abs(ddx.z)>abs(ddx2.z)) {ddx=ddx2;}
var ddy2: vec3f=viewPos-getViewPosFromTexCoord(texCoord+vec2f(0.,-uniforms.texelSize.y));if (abs(ddy.z)>abs(ddy2.z)) {ddy=ddy2;}
var normal: vec3f=normalize(cross(ddy,ddx));
#ifdef FLUIDRENDERING_RHS
normal=-normal;
#endif
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_SHOWNORMAL)
fragmentOutputs.color=vec4f(normal*0.5+0.5,1.0);return fragmentOutputs;
#endif
var rayDir: vec3f=normalize(viewPos); 
#ifdef FLUIDRENDERING_DIFFUSETEXTURE
var diffuseColor: vec3f=textureSampleLevel(diffuseSampler,diffuseSamplerSampler,texCoord,0.0).rgb;
#else
var diffuseColor: vec3f=uniforms.diffuseColor;
#endif
var lightDir: vec3f=normalize((uniforms.viewMatrix*vec4f(-uniforms.dirLight,0.)).xyz);var H: vec3f =normalize(lightDir-rayDir);var specular: f32 =pow(max(0.0,dot(H,normal)),uniforms.specularPower);
#ifdef FLUIDRENDERING_DEBUG_DIFFUSERENDERING
var diffuse: f32 =max(0.0,dot(lightDir,normal))*1.0;fragmentOutputs.color=vec4f(vec3f(0.1) /*ambient*/+vec3f(0.42,0.50,1.00)*diffuse+vec3f(0,0,0.2)+specular,1.);return fragmentOutputs;
#endif
var refractionDir: vec3f=refract(rayDir,normal,ETA);var transmitted: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,vec2f(texCoord+refractionDir.xy*thickness*uniforms.refractionStrength),0.0);
#ifdef FLUIDRENDERING_COMPOSITE_MODE
if (transmitted.a==0.) {transmitted.a=thickness;}
#endif
var transmittance: vec3f=exp(-uniforms.density*thickness*(1.0-diffuseColor)); 
var refractionColor: vec3f=transmitted.rgb*transmittance;
#ifdef FLUIDRENDERING_ENVIRONMENT
var reflectionDir: vec3f=reflect(rayDir,normal);var reflectionColor: vec3f=(textureSample(reflectionSampler,reflectionSamplerSampler,reflectionDir).rgb);var fresnel: f32=clamp(F0+(1.0-F0)*pow(1.0-dot(normal,-rayDir),5.0),0.,uniforms.fresnelClamp);var finalColor: vec3f=mix(refractionColor,reflectionColor,fresnel)+specular;
#else
var finalColor: vec3f=refractionColor+specular;
#endif
#ifdef FLUIDRENDERING_VELOCITY
var velocity: f32=depthVel.g;finalColor=mix(finalColor,vec3f(1.0),smoothstep(0.3,1.0,velocity/6.0));
#endif
fragmentOutputs.color=vec4f(finalColor,transmitted.a);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fluidRenderingRenderPixelShaderWGSL = { name, shader };
//# sourceMappingURL=fluidRenderingRender.fragment.js.map

/***/ }),

/***/ 21570:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingStandardBlurPixelShaderWGSL: () => (/* binding */ fluidRenderingStandardBlurPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingStandardBlurPixelShader";
const shader = `var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform filterSize: i32;uniform blurDir: vec2f;varying vUV: vec2f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var s: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.);if (s.r==0.) {fragmentOutputs.color=vec4f(0.,0.,0.,1.);return fragmentOutputs;}
var sigma: f32=f32(uniforms.filterSize)/3.0;var twoSigma2: f32=2.0*sigma*sigma;var sum: vec4f=vec4f(0.);var wsum: f32=0.;for (var x: i32=-uniforms.filterSize; x<=uniforms.filterSize; x++) {var coords: vec2f=vec2f(f32(x));var sampl: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV+coords*uniforms.blurDir,0.);var w: f32=exp(-coords.x*coords.x/twoSigma2);sum+=sampl*w;wsum+=w;}
sum/=wsum;fragmentOutputs.color=vec4f(sum.rgb,1.);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fluidRenderingStandardBlurPixelShaderWGSL = { name, shader };
//# sourceMappingURL=fluidRenderingStandardBlur.fragment.js.map

/***/ }),

/***/ 72578:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fxaaPixelShaderWGSL: () => (/* binding */ fxaaPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fxaaPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform texelSize: vec2f;varying sampleCoordS: vec2f;varying sampleCoordE: vec2f;varying sampleCoordN: vec2f;varying sampleCoordW: vec2f;varying sampleCoordNW: vec2f;varying sampleCoordSE: vec2f;varying sampleCoordNE: vec2f;varying sampleCoordSW: vec2f;const fxaaQualitySubpix: f32=1.0;const fxaaQualityEdgeThreshold: f32=0.166;const fxaaQualityEdgeThresholdMin: f32=0.0833;const kLumaCoefficients: vec3f= vec3f(0.2126,0.7152,0.0722);fn FxaaLuma(rgba: vec4f)->f32 {return dot(rgba.rgb,kLumaCoefficients);} 
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var posM: vec2f;posM.x=input.vUV.x;posM.y=input.vUV.y;var rgbyM: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var lumaM: f32=FxaaLuma(rgbyM);var lumaS: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordS,0.0));var lumaE: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordE,0.0));var lumaN: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordN,0.0));var lumaW: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordW,0.0));var maxSM: f32=max(lumaS,lumaM);var minSM: f32=min(lumaS,lumaM);var maxESM: f32=max(lumaE,maxSM);var minESM: f32=min(lumaE,minSM);var maxWN: f32=max(lumaN,lumaW);var minWN: f32=min(lumaN,lumaW);var rangeMax: f32=max(maxWN,maxESM);var rangeMin: f32=min(minWN,minESM);var rangeMaxScaled: f32=rangeMax*fxaaQualityEdgeThreshold;var range: f32=rangeMax-rangeMin;var rangeMaxClamped: f32=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);
#ifndef MALI
if(range<rangeMaxClamped) 
{fragmentOutputs.color=rgbyM;return fragmentOutputs;}
#endif
var lumaNW: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordNW,0.0));var lumaSE: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordSE,0.0));var lumaNE: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordNE,0.0));var lumaSW: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordSW,0.0));var lumaNS: f32=lumaN+lumaS;var lumaWE: f32=lumaW+lumaE;var subpixRcpRange: f32=1.0/range;var subpixNSWE: f32=lumaNS+lumaWE;var edgeHorz1: f32=(-2.0*lumaM)+lumaNS;var edgeVert1: f32=(-2.0*lumaM)+lumaWE;var lumaNESE: f32=lumaNE+lumaSE;var lumaNWNE: f32=lumaNW+lumaNE;var edgeHorz2: f32=(-2.0*lumaE)+lumaNESE;var edgeVert2: f32=(-2.0*lumaN)+lumaNWNE;var lumaNWSW: f32=lumaNW+lumaSW;var lumaSWSE: f32=lumaSW+lumaSE;var edgeHorz4: f32=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);var edgeVert4: f32=(abs(edgeVert1)*2.0)+abs(edgeVert2);var edgeHorz3: f32=(-2.0*lumaW)+lumaNWSW;var edgeVert3: f32=(-2.0*lumaS)+lumaSWSE;var edgeHorz: f32=abs(edgeHorz3)+edgeHorz4;var edgeVert: f32=abs(edgeVert3)+edgeVert4;var subpixNWSWNESE: f32=lumaNWSW+lumaNESE;var lengthSign: f32=uniforms.texelSize.x;var horzSpan: bool=edgeHorz>=edgeVert;var subpixA: f32=subpixNSWE*2.0+subpixNWSWNESE;if (!horzSpan)
{lumaN=lumaW;}
if (!horzSpan) 
{lumaS=lumaE;}
if (horzSpan) 
{lengthSign=uniforms.texelSize.y;}
var subpixB: f32=(subpixA*(1.0/12.0))-lumaM;var gradientN: f32=lumaN-lumaM;var gradientS: f32=lumaS-lumaM;var lumaNN: f32=lumaN+lumaM;var lumaSS: f32=lumaS+lumaM;var pairN: bool=abs(gradientN)>=abs(gradientS);var gradient: f32=max(abs(gradientN),abs(gradientS));if (pairN)
{lengthSign=-lengthSign;}
var subpixC: f32=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);var posB: vec2f;posB.x=posM.x;posB.y=posM.y;var offNP: vec2f;offNP.x=select(uniforms.texelSize.x,0.0,(!horzSpan));offNP.y=select(uniforms.texelSize.y,0.0,(horzSpan));if (!horzSpan) 
{posB.x+=lengthSign*0.5;}
if (horzSpan)
{posB.y+=lengthSign*0.5;}
var posN: vec2f;posN.x=posB.x-offNP.x*1.5;posN.y=posB.y-offNP.y*1.5;var posP: vec2f;posP.x=posB.x+offNP.x*1.5;posP.y=posB.y+offNP.y*1.5;var subpixD: f32=((-2.0)*subpixC)+3.0;var lumaEndN: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posN,0.0));var subpixE: f32=subpixC*subpixC;var lumaEndP: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posP,0.0));if (!pairN) 
{lumaNN=lumaSS;}
var gradientScaled: f32=gradient*1.0/4.0;var lumaMM: f32=lumaM-lumaNN*0.5;var subpixF: f32=subpixD*subpixE;var lumaMLTZero: bool=lumaMM<0.0;lumaEndN-=lumaNN*0.5;lumaEndP-=lumaNN*0.5;var doneN: bool=abs(lumaEndN)>=gradientScaled;var doneP: bool=abs(lumaEndP)>=gradientScaled;if (!doneN) 
{posN.x-=offNP.x*3.0;}
if (!doneN) 
{posN.y-=offNP.y*3.0;}
var doneNP: bool=(!doneN) || (!doneP);if (!doneP) 
{posP.x+=offNP.x*3.0;}
if (!doneP)
{posP.y+=offNP.y*3.0;}
if (doneNP)
{if (!doneN) {lumaEndN=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posN.xy,0.0));}
if (!doneP) {lumaEndP=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posP.xy,0.0));}
if (!doneN) {lumaEndN=lumaEndN-lumaNN*0.5;}
if (!doneP) {lumaEndP=lumaEndP-lumaNN*0.5;}
doneN=abs(lumaEndN)>=gradientScaled;doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) {posN.x-=offNP.x*12.0;}
if (!doneN) {posN.y-=offNP.y*12.0;}
doneNP=(!doneN) || (!doneP);if (!doneP) {posP.x+=offNP.x*12.0;}
if (!doneP) {posP.y+=offNP.y*12.0;}}
var dstN: f32=posM.x-posN.x;var dstP: f32=posP.x-posM.x;if (!horzSpan)
{dstN=posM.y-posN.y;}
if (!horzSpan) 
{dstP=posP.y-posM.y;}
var goodSpanN: bool=(lumaEndN<0.0) != lumaMLTZero;var spanLength: f32=(dstP+dstN);var goodSpanP: bool=(lumaEndP<0.0) != lumaMLTZero;var spanLengthRcp: f32=1.0/spanLength;var directionN: bool=dstN<dstP;var dst: f32=min(dstN,dstP);var goodSpan: bool=select(goodSpanP,goodSpanN,directionN);var subpixG: f32=subpixF*subpixF;var pixelOffset: f32=(dst*(-spanLengthRcp))+0.5;var subpixH: f32=subpixG*fxaaQualitySubpix;var pixelOffsetGood: f32=select(0.0,pixelOffset,goodSpan);var pixelOffsetSubpix: f32=max(pixelOffsetGood,subpixH);if (!horzSpan)
{posM.x+=pixelOffsetSubpix*lengthSign;}
if (horzSpan)
{posM.y+=pixelOffsetSubpix*lengthSign;}
#ifdef MALI
if(range<rangeMaxClamped) 
{fragmentOutputs.color=rgbyM;}
else
{fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,posM,0.0);}
#else
fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,posM,0.0);
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fxaaPixelShaderWGSL = { name, shader };
//# sourceMappingURL=fxaa.fragment.js.map

/***/ }),

/***/ 53208:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fxaaVertexShaderWGSL: () => (/* binding */ fxaaVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fxaaVertexShader";
const shader = `attribute position: vec2f;uniform texelSize: vec2f;varying vUV: vec2f;varying sampleCoordS: vec2f;varying sampleCoordE: vec2f;varying sampleCoordN: vec2f;varying sampleCoordW: vec2f;varying sampleCoordNW: vec2f;varying sampleCoordSE: vec2f;varying sampleCoordNE: vec2f;varying sampleCoordSW: vec2f;const madd: vec2f= vec2f(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
vertexOutputs.vUV=(input.position*madd+madd);vertexOutputs.sampleCoordS=vertexOutputs.vUV+ vec2f( 0.0,1.0)*uniforms.texelSize;vertexOutputs.sampleCoordE=vertexOutputs.vUV+ vec2f( 1.0,0.0)*uniforms.texelSize;vertexOutputs.sampleCoordN=vertexOutputs.vUV+ vec2f( 0.0,-1.0)*uniforms.texelSize;vertexOutputs.sampleCoordW=vertexOutputs.vUV+ vec2f(-1.0,0.0)*uniforms.texelSize;vertexOutputs.sampleCoordNW=vertexOutputs.vUV+ vec2f(-1.0,-1.0)*uniforms.texelSize;vertexOutputs.sampleCoordSE=vertexOutputs.vUV+ vec2f( 1.0,1.0)*uniforms.texelSize;vertexOutputs.sampleCoordNE=vertexOutputs.vUV+ vec2f( 1.0,-1.0)*uniforms.texelSize;vertexOutputs.sampleCoordSW=vertexOutputs.vUV+ vec2f(-1.0,1.0)*uniforms.texelSize;vertexOutputs.position=vec4f(input.position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const fxaaVertexShaderWGSL = { name, shader };
//# sourceMappingURL=fxaa.vertex.js.map

/***/ }),

/***/ 23758:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  gaussianSplattingPixelShaderWGSL: () => (/* binding */ gaussianSplattingPixelShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(39759);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(93226);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__(66407);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__(38780);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__(93243);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js
// Do not edit.



const gaussianSplattingFragmentDeclaration_name = "gaussianSplattingFragmentDeclaration";
const shader = `fn gaussianColor(inColor: vec4f,inPosition: vec2f)->vec4f
{var A : f32=-dot(inPosition,inPosition);if (A>-4.0)
{var B: f32=exp(A)*inColor.a;
#include<logDepthFragment>
var color: vec3f=inColor.rgb;
#ifdef FOG
#include<fogFragment>
#endif
return vec4f(color,B);} else {return vec4f(0.0);}}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[gaussianSplattingFragmentDeclaration_name] = shader;
/** @internal */
const gaussianSplattingFragmentDeclarationWGSL = { name: gaussianSplattingFragmentDeclaration_name, shader };
//# sourceMappingURL=gaussianSplattingFragmentDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(97715);
;// ./node_modules/@babylonjs/core/ShadersWGSL/gaussianSplatting.fragment.js
// Do not edit.






const gaussianSplatting_fragment_name = "gaussianSplattingPixelShader";
const gaussianSplatting_fragment_shader = `#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
varying vColor: vec4f;varying vPosition: vec2f;
#include<gaussianSplattingFragmentDeclaration>
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#include<clipPlaneFragment>
fragmentOutputs.color=gaussianColor(input.vColor,input.vPosition);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[gaussianSplatting_fragment_name] = gaussianSplatting_fragment_shader;
/** @internal */
const gaussianSplattingPixelShaderWGSL = { name: gaussianSplatting_fragment_name, shader: gaussianSplatting_fragment_shader };
//# sourceMappingURL=gaussianSplatting.fragment.js.map

/***/ }),

/***/ 55597:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  gaussianSplattingVertexShaderWGSL: () => (/* binding */ gaussianSplattingVertexShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js
var sceneUboDeclaration = __webpack_require__(98327);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/meshUboDeclaration.js
var meshUboDeclaration = __webpack_require__(6874);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(77029);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__(75757);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(93226);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/gaussianSplatting.js
// Do not edit.

const gaussianSplatting_name = "gaussianSplatting";
const shader = `fn getDataUV(index: f32,dataTextureSize: vec2f)->vec2<f32> {let y: f32=floor(index/dataTextureSize.x);let x: f32=index-y*dataTextureSize.x;return vec2f((x+0.5),(y+0.5));}
struct Splat {center: vec4f,
color: vec4f,
covA: vec4f,
covB: vec4f,};fn readSplat(splatIndex: f32,dataTextureSize: vec2f)->Splat {var splat: Splat;let splatUV=getDataUV(splatIndex,dataTextureSize);let splatUVi32=vec2<i32>(i32(splatUV.x),i32(splatUV.y));splat.center=textureLoad(centersTexture,splatUVi32,0);splat.color=textureLoad(colorsTexture,splatUVi32,0);splat.covA=textureLoad(covariancesATexture,splatUVi32,0)*splat.center.w;splat.covB=textureLoad(covariancesBTexture,splatUVi32,0)*splat.center.w;return splat;}
fn gaussianSplatting(
meshPos: vec2<f32>,
worldPos: vec3<f32>,
scale: vec2<f32>,
covA: vec3<f32>,
covB: vec3<f32>,
worldMatrix: mat4x4<f32>,
viewMatrix: mat4x4<f32>,
projectionMatrix: mat4x4<f32>,
focal: vec2f,
invViewport: vec2f
)->vec4f {let modelView=viewMatrix*worldMatrix;let camspace=viewMatrix*vec4f(worldPos,1.0);let pos2d=projectionMatrix*camspace;let bounds=1.2*pos2d.w;if (pos2d.z<0. || pos2d.x<-bounds || pos2d.x>bounds || pos2d.y<-bounds || pos2d.y>bounds) {return vec4f(0.0,0.0,2.0,1.0);}
let Vrk=mat3x3<f32>(
covA.x,covA.y,covA.z,
covA.y,covB.x,covB.y,
covA.z,covB.y,covB.z
);let J=mat3x3<f32>(
focal.x/camspace.z,0.0,-(focal.x*camspace.x)/(camspace.z*camspace.z),
0.0,focal.y/camspace.z,-(focal.y*camspace.y)/(camspace.z*camspace.z),
0.0,0.0,0.0
);let invy=mat3x3<f32>(
1.0,0.0,0.0,
0.0,-1.0,0.0,
0.0,0.0,1.0
);let T=invy*transpose(mat3x3<f32>(
modelView[0].xyz,
modelView[1].xyz,
modelView[2].xyz))*J;let cov2d=transpose(T)*Vrk*T;let mid=(cov2d[0][0]+cov2d[1][1])/2.0;let radius=length(vec2<f32>((cov2d[0][0]-cov2d[1][1])/2.0,cov2d[0][1]));let lambda1=mid+radius;let lambda2=mid-radius;if (lambda2<0.0) {return vec4f(0.0,0.0,2.0,1.0);}
let diagonalVector=normalize(vec2<f32>(cov2d[0][1],lambda1-cov2d[0][0]));let majorAxis=min(sqrt(2.0*lambda1),1024.0)*diagonalVector;let minorAxis=min(sqrt(2.0*lambda2),1024.0)*vec2<f32>(diagonalVector.y,-diagonalVector.x);let vCenter=vec2<f32>(pos2d.x,pos2d.y);return vec4f(
vCenter+((meshPos.x*majorAxis+meshPos.y*minorAxis)*invViewport*pos2d.w)*scale,
pos2d.z,
pos2d.w
);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[gaussianSplatting_name] = shader;
/** @internal */
const gaussianSplattingWGSL = { name: gaussianSplatting_name, shader };
//# sourceMappingURL=gaussianSplatting.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(85197);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__(59013);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__(81482);
;// ./node_modules/@babylonjs/core/ShadersWGSL/gaussianSplatting.vertex.js
// Do not edit.










const gaussianSplatting_vertex_name = "gaussianSplattingVertexShader";
const gaussianSplatting_vertex_shader = `#include<sceneUboDeclaration>
#include<meshUboDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<logDepthDeclaration>
attribute splatIndex: f32;attribute position: vec2f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;varying vColor: vec4f;varying vPosition: vec2f;
#include<gaussianSplatting>
@vertex
fn main(input : VertexInputs)->FragmentInputs {var splat: Splat=readSplat(input.splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);let worldPos: vec4f=mesh.world*vec4f(splat.center.xyz,1.0);vertexOutputs.vColor=splat.color;vertexOutputs.vPosition=input.position;vertexOutputs.position=gaussianSplatting(input.position,worldPos.xyz,vec2f(1.0,1.0),covA,covB,mesh.world,scene.view,scene.projection,uniforms.focal,uniforms.invViewport);
#include<clipPlaneVertex>
#include<fogVertex>
#include<logDepthVertex>
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[gaussianSplatting_vertex_name] = gaussianSplatting_vertex_shader;
/** @internal */
const gaussianSplattingVertexShaderWGSL = { name: gaussianSplatting_vertex_name, shader: gaussianSplatting_vertex_shader };
//# sourceMappingURL=gaussianSplatting.vertex.js.map

/***/ }),

/***/ 38574:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   geometryPixelShaderWGSL: () => (/* binding */ geometryPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39759);
/* harmony import */ var _ShadersInclude_bumpFragmentMainFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15697);
/* harmony import */ var _ShadersInclude_bumpFragmentFunctions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91258);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97715);
/* harmony import */ var _ShadersInclude_bumpFragment_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(20727);
// Do not edit.







const name = "geometryPixelShader";
const shader = `#ifdef BUMP
varying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f;varying vNormalW: vec3f;
#else
varying vNormalV: vec3f;
#endif
varying vViewPos: vec4f;
#if defined(POSITION) || defined(BUMP)
varying vPositionW: vec3f;
#endif
#if defined(VELOCITY) || defined(VELOCITY_LINEAR)
varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
#endif
#ifdef NEED_UV
varying vUV: vec2f;
#endif
#ifdef BUMP
uniform vBumpInfos: vec3f;uniform vTangentSpaceParams: vec2f;
#endif
#if defined(REFLECTIVITY)
#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
var reflectivitySamplerSampler: sampler;var reflectivitySampler: texture_2d<f32>;varying vReflectivityUV: vec2f;
#endif
#ifdef ALBEDOTEXTURE
varying vAlbedoUV: vec2f;var albedoSamplerSampler: sampler;var albedoSampler: texture_2d<f32>;
#endif
#ifdef REFLECTIVITYCOLOR
uniform reflectivityColor: vec3f;
#endif
#ifdef ALBEDOCOLOR
uniform albedoColor: vec3f;
#endif
#ifdef METALLIC
uniform metallic: f32;
#endif
#if defined(ROUGHNESS) || defined(GLOSSINESS)
uniform glossiness: f32;
#endif
#endif
#if defined(ALPHATEST) && defined(NEED_UV)
var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
#endif
#include<clipPlaneFragmentDeclaration>
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#include<helperFunctions>
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV).a<0.4) {discard;}
#endif
var normalOutput: vec3f;
#ifdef BUMP
var normalW: vec3f=normalize(input.vNormalW);
#include<bumpFragment>
#ifdef NORMAL_WORLDSPACE
normalOutput=normalW;
#else
normalOutput=normalize( vec3f(mat4x4f(input.vWorldView0,input.vWorldView0,input.vWorldView2,input.vWorldView3)* vec4f(normalW,0.0)));
#endif
#else
normalOutput=normalize(input.vNormalV);
#endif
#ifdef ENCODE_NORMAL
normalOutput=normalOutput*0.5+0.5;
#endif
var fragData: array<vec4<f32>,SCENE_MRT_COUNT>;
#ifdef DEPTH
fragData[DEPTH_INDEX]=vec4f(input.vViewPos.z/input.vViewPos.w,0.0,0.0,1.0);
#endif
#ifdef NORMAL
fragData[NORMAL_INDEX]=vec4f(normalOutput,1.0);
#endif
#ifdef SCREENSPACE_DEPTH
fragData[SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,1.0);
#endif
#ifdef POSITION
fragData[POSITION_INDEX]= vec4f(input.vPositionW,1.0);
#endif
#ifdef VELOCITY
var a: vec2f=(input.vCurrentPosition.xy/input.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(input.vPreviousPosition.xy/input.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[VELOCITY_INDEX]= vec4f(velocity,0.0,1.0);
#endif
#ifdef VELOCITY_LINEAR
var velocity : vec2f=vec2f(0.5)*((input.vPreviousPosition.xy /
input.vPreviousPosition.w) -
(input.vCurrentPosition.xy /
input.vCurrentPosition.w));fragData[VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,1.0);
#endif
#ifdef REFLECTIVITY
var reflectivity: vec4f= vec4f(0.0,0.0,0.0,1.0);
#ifdef METALLICWORKFLOW
var metal: f32=1.0;var roughness: f32=1.0;
#ifdef ORMTEXTURE
metal*=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV).b;roughness*=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV).g;
#endif
#ifdef METALLIC
metal*=uniforms.metallic;
#endif
#ifdef ROUGHNESS
roughness*=(1.0-uniforms.glossiness); 
#endif
reflectivity=vec4f(reflectivity.rgb,reflectivity.a-roughness);var color: vec3f= vec3f(1.0);
#ifdef ALBEDOTEXTURE
color=textureSample(albedoSampler,albedoSamplerSampler,input.vAlbedoUV).rgb;
#ifdef GAMMAALBEDO
color=toLinearSpaceVec4(color);
#endif
#endif
#ifdef ALBEDOCOLOR
color*=uniforms.albedoColor.xyz;
#endif
reflectivity=vec4f(mix( vec3f(0.04),color,metal),reflectivity.a);
#else
#if defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
reflectivity=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vReflectivityUV);
#ifdef GAMMAREFLECTIVITYTEXTURE
reflectivity=vec4f(toLinearSpaceVec3(reflectivity.rgb),reflectivity.a);
#endif
#else 
#ifdef REFLECTIVITYCOLOR
reflectivity=vec4f(toLinearSpaceVec3(uniforms.reflectivityColor.xyz),1.0);
#endif
#endif
#ifdef GLOSSINESSS
reflectivity=vec4f(reflectivity.rgb,reflectivity.a*glossiness); 
#endif
#endif
fragData[REFLECTIVITY_INDEX]=reflectivity;
#endif
#if SCENE_MRT_COUNT>0
fragmentOutputs.fragData0=fragData[0];
#endif
#if SCENE_MRT_COUNT>1
fragmentOutputs.fragData1=fragData[1];
#endif
#if SCENE_MRT_COUNT>2
fragmentOutputs.fragData2=fragData[2];
#endif
#if SCENE_MRT_COUNT>3
fragmentOutputs.fragData3=fragData[3];
#endif
#if SCENE_MRT_COUNT>4
fragmentOutputs.fragData4=fragData[4];
#endif
#if SCENE_MRT_COUNT>5
fragmentOutputs.fragData5=fragData[5];
#endif
#if SCENE_MRT_COUNT>6
fragmentOutputs.fragData6=fragData[6];
#endif
#if SCENE_MRT_COUNT>7
fragmentOutputs.fragData7=fragData[7];
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const geometryPixelShaderWGSL = { name, shader };
//# sourceMappingURL=geometry.fragment.js.map

/***/ }),

/***/ 2564:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   geometryVertexShaderWGSL: () => (/* binding */ geometryVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32806);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98900);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76340);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8217);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_sceneUboDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98327);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(77029);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18258);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9129);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(65470);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(40242);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(85197);
/* harmony import */ var _ShadersInclude_bumpVertex_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(87921);
// Do not edit.















const name = "geometryVertexShader";
const shader = `#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
#include<sceneUboDeclaration>
#include<clipPlaneVertexDeclaration>
attribute position: vec3f;attribute normal: vec3f;
#ifdef NEED_UV
varying vUV: vec2f;
#ifdef ALPHATEST
uniform diffuseMatrix: mat4x4f;
#endif
#ifdef BUMP
uniform bumpMatrix: mat4x4f;varying vBumpUV: vec2f;
#endif
#ifdef REFLECTIVITY
uniform reflectivityMatrix: mat4x4f;uniform albedoMatrix: mat4x4f;varying vReflectivityUV: vec2f;varying vAlbedoUV: vec2f;
#endif
#ifdef UV1
attribute uv: vec2f;
#endif
#ifdef UV2
attribute uv2: vec2f;
#endif
#endif
#ifdef BUMP
varying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f;
#endif
#ifdef BUMP
varying vNormalW: vec3f;
#else
varying vNormalV: vec3f;
#endif
varying vViewPos: vec4f;
#if defined(POSITION) || defined(BUMP)
varying vPositionW: vec3f;
#endif
#if defined(VELOCITY) || defined(VELOCITY_LINEAR)
uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;var normalUpdated: vec3f=input.normal;
#ifdef UV1
var uvUpdated: vec2f=input.uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f= vec4f(finalWorld* vec4f(positionUpdated,1.0));
#ifdef BUMP
let vWorldView=scene.view*finalWorld;vertexOutputs.vWorldView0=vWorldView[0];vertexOutputs.vWorldView1=vWorldView[1];vertexOutputs.vWorldView2=vWorldView[2];vertexOutputs.vWorldView3=vWorldView[3];let normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);
#else
#ifdef NORMAL_WORLDSPACE
vertexOutputs.vNormalV=normalize((finalWorld* vec4f(normalUpdated,0.0)).xyz);
#else
vertexOutputs.vNormalV=normalize(((scene.view*finalWorld)* vec4f(normalUpdated,0.0)).xyz);
#endif
#endif
vertexOutputs.vViewPos=scene.view*worldPos;
#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)
vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);
#if NUM_BONE_INFLUENCERS>0
var previousInfluence: mat4x4f;previousInfluence=mPreviousBones[ i32(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
previousInfluence+=mPreviousBones[ i32(matricesIndices[1])]*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
previousInfluence+=mPreviousBones[ i32(matricesIndices[2])]*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
previousInfluence+=mPreviousBones[ i32(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);
#else
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
#endif
#endif
#if defined(POSITION) || defined(BUMP)
vertexOutputs.vPositionW=worldPos.xyz/worldPos.w;
#endif
vertexOutputs.position=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);
#include<clipPlaneVertex>
#ifdef NEED_UV
#ifdef UV1
#if defined(ALPHATEST) && defined(ALPHATEST_UV1)
vertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
#else
vertexOutputs.vUV=input.uv;
#endif
#ifdef BUMP_UV1
vertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
#endif
#ifdef REFLECTIVITY_UV1
vertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
#endif
#ifdef ALBEDO_UV1
vertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
#endif
#endif
#ifdef UV2
#if defined(ALPHATEST) && defined(ALPHATEST_UV2)
vertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(input.uv2,1.0,0.0)).xy;
#else
vertexOutputs.vUV=input.uv2;
#endif
#ifdef BUMP_UV2
vertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(input.uv2,1.0,0.0)).xy;
#endif
#ifdef REFLECTIVITY_UV2
vertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(input.uv2,1.0,0.0)).xy;
#endif
#ifdef ALBEDO_UV2
vertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(input.uv2,1.0,0.0)).xy;
#endif
#endif
#endif
#include<bumpVertex>
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const geometryVertexShaderWGSL = { name, shader };
//# sourceMappingURL=geometry.vertex.js.map

/***/ }),

/***/ 82937:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowBlurPostProcessPixelShaderWGSL: () => (/* binding */ glowBlurPostProcessPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "glowBlurPostProcessPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;uniform direction: vec2f;uniform blurWidth: f32;fn getLuminance(color: vec3f)->f32
{return dot(color, vec3f(0.2126,0.7152,0.0722));}
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var weights: array<f32 ,7>;weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;var texelSize: vec2f= vec2f(1.0/uniforms.screenSize.x,1.0/uniforms.screenSize.y);var texelStep: vec2f=texelSize*uniforms.direction*uniforms.blurWidth;var start: vec2f=input.vUV-3.0*texelStep;var baseColor: vec4f= vec4f(0.,0.,0.,0.);var texelOffset: vec2f= vec2f(0.,0.);for (var i: i32=0; i<7; i++)
{var texel: vec4f=textureSample(textureSampler,textureSamplerSampler,start+texelOffset);baseColor=vec4f(baseColor.rgb,baseColor.a+texel.a*weights[i]);var luminance: f32=getLuminance(baseColor.rgb);var luminanceTexel: f32=getLuminance(texel.rgb);var choice: f32=step(luminanceTexel,luminance);baseColor=vec4f(choice*baseColor.rgb+(1.0-choice)*texel.rgb,baseColor.a);texelOffset+=texelStep;}
fragmentOutputs.color=baseColor;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const glowBlurPostProcessPixelShaderWGSL = { name, shader };
//# sourceMappingURL=glowBlurPostProcess.fragment.js.map

/***/ }),

/***/ 19073:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowMapGenerationPixelShaderWGSL: () => (/* binding */ glowMapGenerationPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39759);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97715);
// Do not edit.




const name = "glowMapGenerationPixelShader";
const shader = `#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)
#include<helperFunctions>
#endif
#ifdef DIFFUSE
varying vUVDiffuse: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
#endif
#ifdef OPACITY
varying vUVOpacity: vec2f;var opacitySamplerSampler: sampler;var opacitySampler: texture_2d<f32>;uniform opacityIntensity: f32;
#endif
#ifdef EMISSIVE
varying vUVEmissive: vec2f;var emissiveSamplerSampler: sampler;var emissiveSampler: texture_2d<f32>;
#endif
#ifdef VERTEXALPHA
varying vColor: vec4f;
#endif
uniform glowColor: vec4f;uniform glowIntensity: f32;
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#include<clipPlaneFragment>
var finalColor: vec4f=uniforms.glowColor;
#ifdef DIFFUSE
var albedoTexture: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUVDiffuse);
#ifdef DIFFUSE_ISLINEAR
albedoTexture=toGammaSpace(albedoTexture);
#endif
#ifdef GLOW
finalColor=vec4f(finalColor.rgb,finalColor.a*albedoTexture.a);
#endif
#ifdef HIGHLIGHT
finalColor=vec4f(finalColor.rgb,albedoTexture.a);
#endif
#endif
#ifdef OPACITY
var opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vUVOpacity);
#ifdef OPACITYRGB
finalColor=vec4f(finalColor.rgb,finalColor.a*getLuminance(opacityMap.rgb));
#else
finalColor=vec4f(finalColor.rgb,finalColor.a*opacityMap.a);
#endif
finalColor=vec4f(finalColor.rgb,finalColor.a*uniforms.opacityIntensity);
#endif
#ifdef VERTEXALPHA
finalColor=vec4f(finalColor.rgb,finalColor.a*fragmentInputs.vColor.a);
#endif
#ifdef ALPHATEST
if (finalColor.a<ALPHATESTVALUE)
discard;
#endif
#ifdef EMISSIVE
var emissive: vec4f=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vUVEmissive);
#ifdef EMISSIVE_ISLINEAR
emissive=toGammaSpace(emissive);
#endif
fragmentOutputs.color=emissive*finalColor*uniforms.glowIntensity;
#else
fragmentOutputs.color=finalColor*uniforms.glowIntensity;
#endif
#ifdef HIGHLIGHT
fragmentOutputs.color=vec4f(fragmentOutputs.color.rgb,uniforms.glowColor.a);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const glowMapGenerationPixelShaderWGSL = { name, shader };
//# sourceMappingURL=glowMapGeneration.fragment.js.map

/***/ }),

/***/ 48267:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowMapGenerationVertexShaderWGSL: () => (/* binding */ glowMapGenerationVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32806);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98900);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76340);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8217);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77029);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18258);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9129);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65470);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(40242);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(85197);
// Do not edit.













const name = "glowMapGenerationVertexShader";
const shader = `attribute position: vec3f;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform viewProjection: mat4x4f;varying vPosition: vec4f;
#ifdef UV1
attribute uv: vec2f;
#endif
#ifdef UV2
attribute uv2: vec2f;
#endif
#ifdef DIFFUSE
varying vUVDiffuse: vec2f;uniform diffuseMatrix: mat4x4f;
#endif
#ifdef OPACITY
varying vUVOpacity: vec2f;uniform opacityMatrix: mat4x4f;
#endif
#ifdef EMISSIVE
varying vUVEmissive: vec2f;uniform emissiveMatrix: mat4x4f;
#endif
#ifdef VERTEXALPHA
attribute color: vec4f;varying vColor: vec4f;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;
#ifdef UV1
var uvUpdated: vec2f=input.uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);
#ifdef CUBEMAP
vertexOutputs.vPosition=worldPos;vertexOutputs.position=uniforms.viewProjection*finalWorld* vec4f(input.position,1.0);
#else
vertexOutputs.vPosition=uniforms.viewProjection*worldPos;vertexOutputs.position=vertexOutputs.vPosition;
#endif
#ifdef DIFFUSE
#ifdef DIFFUSEUV1
vertexOutputs.vUVDiffuse= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
#endif
#ifdef DIFFUSEUV2
vertexOutputs.vUVDiffuse= (uniforms.diffuseMatrix* vec4f(input.uv2,1.0,0.0)).xy;
#endif
#endif
#ifdef OPACITY
#ifdef OPACITYUV1
vertexOutputs.vUVOpacity= (uniforms.opacityMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
#endif
#ifdef OPACITYUV2
vertexOutputs.vUVOpacity= (uniforms.opacityMatrix* vec4f(input.uv2,1.0,0.0)).xy;
#endif
#endif
#ifdef EMISSIVE
#ifdef EMISSIVEUV1
vertexOutputs.vUVEmissive= (uniforms.emissiveMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
#endif
#ifdef EMISSIVEUV2
vertexOutputs.vUVEmissive= (uniforms.emissiveMatrix* vec4f(input.uv2,1.0,0.0)).xy;
#endif
#endif
#ifdef VERTEXALPHA
vertexOutputs.vColor=vertexInputs.color;
#endif
#include<clipPlaneVertex>
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const glowMapGenerationVertexShaderWGSL = { name, shader };
//# sourceMappingURL=glowMapGeneration.vertex.js.map

/***/ }),

/***/ 22147:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowMapMergePixelShaderWGSL: () => (/* binding */ glowMapMergePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "glowMapMergePixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;
#ifdef EMISSIVE
var textureSampler2Sampler: sampler;var textureSampler2: texture_2d<f32>;
#endif
uniform offset: f32;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
var baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);
#ifdef EMISSIVE
baseColor+=textureSample(textureSampler2,textureSampler2Sampler,input.vUV);baseColor*=uniforms.offset;
#else
baseColor=vec4f(baseColor.rgb,abs(uniforms.offset-baseColor.a));
#ifdef STROKE
var alpha: f32=smoothstep(.0,.1,baseColor.a);baseColor=vec4f(baseColor.rgb*alpha,alpha);
#endif
#endif
#if LDR
baseColor=clamp(baseColor,0.,1.0);
#endif
fragmentOutputs.color=baseColor;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const glowMapMergePixelShaderWGSL = { name, shader };
//# sourceMappingURL=glowMapMerge.fragment.js.map

/***/ }),

/***/ 7101:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowMapMergeVertexShaderWGSL: () => (/* binding */ glowMapMergeVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "glowMapMergeVertexShader";
const shader = `attribute position: vec2f;varying vUV: vec2f;
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {const madd: vec2f= vec2f(0.5,0.5);
#define CUSTOM_VERTEX_MAIN_BEGIN
vertexOutputs.vUV=input.position*madd+madd;vertexOutputs.position= vec4f(input.position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const glowMapMergeVertexShaderWGSL = { name, shader };
//# sourceMappingURL=glowMapMerge.vertex.js.map

/***/ }),

/***/ 68625:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   grainPixelShaderWGSL: () => (/* binding */ grainPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
// Do not edit.


const name = "grainPixelShader";
const shader = `#include<helperFunctions>
varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform intensity: f32;uniform animatedSeed: f32;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);var seed: vec2f=input.vUV*uniforms.animatedSeed;var grain: f32=dither(seed,uniforms.intensity);var lum: f32=getLuminance(fragmentOutputs.color.rgb);var grainAmount: f32=(cos(-PI+(lum*PI*2.))+1.)/2.;fragmentOutputs.color=vec4f(fragmentOutputs.color.rgb+grain*grainAmount,fragmentOutputs.color.a);fragmentOutputs.color=vec4f(max(fragmentOutputs.color.rgb,vec3f(0.0)),fragmentOutputs.color.a);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const grainPixelShaderWGSL = { name, shader };
//# sourceMappingURL=grain.fragment.js.map

/***/ }),

/***/ 50274:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   hdrFilteringPixelShaderWGSL: () => (/* binding */ hdrFilteringPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_importanceSampling_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75136);
/* harmony import */ var _ShadersInclude_pbrBRDFFunctions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75052);
/* harmony import */ var _ShadersInclude_hdrFilteringFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58866);
// Do not edit.





const name = "hdrFilteringPixelShader";
const shader = `#include<helperFunctions>
#include<importanceSampling>
#include<pbrBRDFFunctions>
#include<hdrFilteringFunctions>
uniform alphaG: f32;var inputTextureSampler: sampler;var inputTexture: texture_cube<f32>;uniform vFilteringInfo: vec2f;uniform hdrScale: f32;varying direction: vec3f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=radiance(uniforms.alphaG,inputTexture,inputTextureSampler,input.direction,uniforms.vFilteringInfo);fragmentOutputs.color= vec4f(color*uniforms.hdrScale,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const hdrFilteringPixelShaderWGSL = { name, shader };
//# sourceMappingURL=hdrFiltering.fragment.js.map

/***/ }),

/***/ 92248:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   hdrFilteringVertexShaderWGSL: () => (/* binding */ hdrFilteringVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "hdrFilteringVertexShader";
const shader = `attribute position: vec2f;varying direction: vec3f;uniform up: vec3f;uniform right: vec3f;uniform front: vec3f;
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
var view: mat3x3f= mat3x3f(uniforms.up,uniforms.right,uniforms.front);vertexOutputs.direction=view*vec3f(input.position,1.0);vertexOutputs.position= vec4f(input.position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const hdrFilteringVertexShaderWGSL = { name, shader };
//# sourceMappingURL=hdrFiltering.vertex.js.map

/***/ }),

/***/ 80265:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   highlightsPixelShaderWGSL: () => (/* binding */ highlightsPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "highlightsPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;const RGBLuminanceCoefficients: vec3f= vec3f(0.2126,0.7152,0.0722);
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var tex: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);var c: vec3f=tex.rgb;var luma: f32=dot(c.rgb,RGBLuminanceCoefficients);fragmentOutputs.color= vec4f(pow(c, vec3f(25.0-luma*15.0)),tex.a); }`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const highlightsPixelShaderWGSL = { name, shader };
//# sourceMappingURL=highlights.fragment.js.map

/***/ }),

/***/ 92199:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblCombineVoxelGridsPixelShaderWGSL: () => (/* binding */ iblCombineVoxelGridsPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblCombineVoxelGridsPixelShader";
const shader = `varying vUV: vec2f;var voxelXaxisSamplerSampler: sampler;var voxelXaxisSampler: texture_3d<f32>;var voxelYaxisSamplerSampler: sampler;var voxelYaxisSampler: texture_3d<f32>;var voxelZaxisSamplerSampler: sampler;var voxelZaxisSampler: texture_3d<f32>;uniform layer: f32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var coordZ: vec3f= vec3f(fragmentInputs.vUV.x,fragmentInputs.vUV.y,uniforms.layer);var voxelZ: f32=textureSample(voxelZaxisSampler,voxelZaxisSamplerSampler,coordZ).r;var coordX: vec3f= vec3f(1.0-uniforms.layer,fragmentInputs.vUV.y,fragmentInputs.vUV.x);var voxelX: f32=textureSample(voxelXaxisSampler,voxelXaxisSamplerSampler,coordX).r;var coordY: vec3f= vec3f(uniforms.layer,fragmentInputs.vUV.x,fragmentInputs.vUV.y);var voxelY: f32=textureSample(voxelYaxisSampler,voxelYaxisSamplerSampler,coordY).r;var voxel=select(0.0,1.0,(voxelX>0.0 || voxelY>0.0 || voxelZ>0.0));fragmentOutputs.color= vec4f( vec3f(voxel),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblCombineVoxelGridsPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblCombineVoxelGrids.fragment.js.map

/***/ }),

/***/ 23584:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblGenerateVoxelMipPixelShaderWGSL: () => (/* binding */ iblGenerateVoxelMipPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblGenerateVoxelMipPixelShader";
const shader = `varying vUV: vec2f;var srcMip: texture_3d<f32>;uniform layerNum: i32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var Coords=vec3i(2)*vec3i(vec2i(fragmentInputs.position.xy),uniforms.layerNum);var tex =
(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,0,0),0).x>0.0f))
<< 0u) |
(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,0,0),0).x>0.0f))
<< 1u) |
(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,1,0),0).x>0.0f))
<< 2u) |
(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,1,0),0).x>0.0f))
<< 3u) |
(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,0,1),0).x>0.0f))
<< 4u) |
(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,0,1),0).x>0.0f))
<< 5u) |
(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(0,1,1),0).x>0.0f))
<< 6u) |
(u32(select(0u,1u,textureLoad(srcMip,Coords+vec3i(1,1,1),0).x>0.0f))
<< 7u);fragmentOutputs.color=vec4f( f32(tex)/255.0f,0.0f,0.0f,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblGenerateVoxelMipPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblGenerateVoxelMip.fragment.js.map

/***/ }),

/***/ 27122:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowAccumulationPixelShaderWGSL: () => (/* binding */ iblShadowAccumulationPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowAccumulationPixelShader";
const shader = `varying vUV: vec2f;uniform accumulationParameters: vec4f;
#define remanence uniforms.accumulationParameters.x
#define resetb uniforms.accumulationParameters.y
#define sceneSize uniforms.accumulationParameters.z
var motionSampler: texture_2d<f32>;var positionSampler: texture_2d<f32>;var spatialBlurSampler : texture_2d<f32>;var oldAccumulationSamplerSampler: sampler;var oldAccumulationSampler: texture_2d<f32>;var prevPositionSamplerSampler: sampler;var prevPositionSampler: texture_2d<f32>;fn max2(v: vec2f,w: vec2f)->vec2f { 
return vec2f(max(v.x,w.x),max(v.y,w.y)); }
fn lessThan(x: vec2f,y: vec2f)->vec2<bool> {return x<y;}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var reset: bool= bool(resetb);var gbufferRes : vec2f=vec2f(textureDimensions(positionSampler,0));var gbufferPixelCoord: vec2i= vec2i(input.vUV*gbufferRes);var shadowRes : vec2f=vec2f(textureDimensions(spatialBlurSampler,0));var shadowPixelCoord: vec2i= vec2i(input.vUV*shadowRes);var LP: vec4f=textureLoad(positionSampler,gbufferPixelCoord,0);if (0.0==LP.w) {fragmentOutputs.color=vec4f(1.0,0.0,0.0,1.0);return fragmentOutputs;}
var velocityColor: vec2f=textureLoad(motionSampler,gbufferPixelCoord,0).xy;var prevCoord: vec2f=input.vUV+velocityColor;var PrevLP: vec3f=textureSampleLevel(prevPositionSampler,prevPositionSamplerSampler,prevCoord,0.0).xyz;var PrevShadows: vec3f=textureSampleLevel(oldAccumulationSampler,oldAccumulationSamplerSampler,prevCoord,0.0).xyz;var newShadows : vec2f=textureLoad(spatialBlurSampler,shadowPixelCoord,0).xy;PrevShadows.z=select(1.0,max(PrevShadows.z/(1.0+PrevShadows.z),1.0-remanence),!reset && all(lessThan(abs(prevCoord- vec2f(0.5)), vec2f(0.5))) &&
distance(LP.xyz,PrevLP)<5e-2*sceneSize);PrevShadows=max( vec3f(0.0),PrevShadows);fragmentOutputs.color= vec4f(mix(PrevShadows.x,newShadows.x,PrevShadows.z),
mix(PrevShadows.y,newShadows.y,PrevShadows.z),PrevShadows.z,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowAccumulationPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowAccumulation.fragment.js.map

/***/ }),

/***/ 2730:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowDebugPixelShaderWGSL: () => (/* binding */ iblShadowDebugPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowDebugPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var debugSamplerSampler: sampler;var debugSampler: texture_2d<f32>;uniform sizeParams: vec4f;
#define offsetX uniforms.sizeParams.x
#define offsetY uniforms.sizeParams.y
#define widthScale uniforms.sizeParams.z
#define heightScale uniforms.sizeParams.w
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f =
vec2f((offsetX+fragmentInputs.vUV.x)*widthScale,(offsetY+fragmentInputs.vUV.y)*heightScale);var background: vec4f=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.vUV);var debugColour: vec4f=textureSample(debugSampler,debugSamplerSampler,fragmentInputs.vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {fragmentOutputs.color=background;} else {fragmentOutputs.color=vec4f(mix(debugColour.rgb,background.rgb,0.0),1.0);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowDebugPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowDebug.fragment.js.map

/***/ }),

/***/ 29533:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowGBufferDebugPixelShaderWGSL: () => (/* binding */ iblShadowGBufferDebugPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowGBufferDebugPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var depthSampler: sampler;var depthTexture: texture_2d<f32>;var normalSampler: sampler;var normalTexture: texture_2d<f32>;var positionSampler: sampler;var positionTexture: texture_2d<f32>;var velocitySampler: sampler;var velocityTexture: texture_2d<f32>;uniform sizeParams: vec4f;uniform maxDepth: f32;
#define offsetX uniforms.sizeParams.x
#define offsetY uniforms.sizeParams.y
#define widthScale uniforms.sizeParams.z
#define heightScale uniforms.sizeParams.w
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f =
vec2f((offsetX+input.vUV.x)*widthScale,(offsetY+input.vUV.y)*heightScale);var backgroundColour: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgba;var depth: vec4f=textureSample(depthTexture,depthSampler,input.vUV);var worldNormal: vec4f=textureSample(normalTexture,normalSampler,input.vUV);var worldPosition: vec4f=textureSample(positionTexture,positionSampler,input.vUV);var velocityLinear: vec4f=textureSample(velocityTexture,velocitySampler,input.vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {fragmentOutputs.color=backgroundColour;} else {if (uv.x<=0.25) {fragmentOutputs.color=vec4f(depth.rgb,1.0);} else if (uv.x<=0.5) {velocityLinear=vec4f(velocityLinear.r*0.5+0.5,velocityLinear.g*0.5+0.5,velocityLinear.b,velocityLinear.a);fragmentOutputs.color=vec4f(velocityLinear.rgb,1.0);} else if (uv.x<=0.75) {fragmentOutputs.color=vec4f(worldPosition.rgb,1.0);} else {fragmentOutputs.color=vec4f(worldNormal.rgb,1.0);}}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowGBufferDebugPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowGBufferDebug.fragment.js.map

/***/ }),

/***/ 68772:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowSpatialBlurPixelShaderWGSL: () => (/* binding */ iblShadowSpatialBlurPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowSpatialBlurPixelShader";
const shader = `#define PI 3.1415927
varying vUV: vec2f;var depthSampler: texture_2d<f32>;var worldNormalSampler: texture_2d<f32>;var voxelTracingSampler : texture_2d<f32>;uniform blurParameters: vec4f;
#define stridef uniforms.blurParameters.x
#define worldScale uniforms.blurParameters.y
const weights=array<f32,5>(0.0625,0.25,0.375,0.25,0.0625);const nbWeights: i32=5;fn max2(v: vec2f,w: vec2f)->vec2f {return vec2f(max(v.x,w.x),max(v.y,w.y));}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var gbufferRes=vec2f(textureDimensions(depthSampler,0));var gbufferPixelCoord= vec2i(fragmentInputs.vUV*gbufferRes);var shadowRes=vec2f(textureDimensions(voxelTracingSampler,0));var shadowPixelCoord= vec2i(fragmentInputs.vUV*shadowRes);var N: vec3f=textureLoad(worldNormalSampler,gbufferPixelCoord,0).xyz;if (length(N)<0.01) {fragmentOutputs.color=vec4f(1.0,1.0,0.0,1.0);return fragmentOutputs;}
var depth: f32=-textureLoad(depthSampler,gbufferPixelCoord,0).x;var X: vec3f= vec3f(0.0);for(var y: i32=0; y<nbWeights; y++) {for(var x: i32=0; x<nbWeights; x++) {var gBufferCoords: vec2i=gbufferPixelCoord+i32(stridef)*vec2i(x-(nbWeights>>1),y-(nbWeights>>1));var shadowCoords: vec2i=shadowPixelCoord+i32(stridef)*vec2i(x-(nbWeights>>1),y-(nbWeights>>1));var T : vec2f=textureLoad(voxelTracingSampler,shadowCoords,0).xy;var ddepth: f32=-textureLoad(depthSampler,gBufferCoords,0).x-depth;var dN: vec3f=textureLoad(worldNormalSampler,gBufferCoords,0).xyz-N;var w: f32=weights[x]*weights[y] *
exp2(max(-1000.0/(worldScale*worldScale),-0.5) *
(ddepth*ddepth) -
1e1*dot(dN,dN));X+= vec3f(w*T.x,w*T.y,w);}}
fragmentOutputs.color= vec4f(X.x/X.z,X.y/X.z,0.0,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowSpatialBlurPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowSpatialBlur.fragment.js.map

/***/ }),

/***/ 9461:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowVoxelTracingPixelShaderWGSL: () => (/* binding */ iblShadowVoxelTracingPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowVoxelTracingPixelShader";
const shader = `#define PI 3.1415927
varying vUV: vec2f;
#define DISABLE_UNIFORMITY_ANALYSIS
var depthSampler: texture_2d<f32>;var worldNormalSampler : texture_2d<f32>;var blueNoiseSampler: texture_2d<f32>;var icdfxSamplerSampler: sampler;var icdfxSampler: texture_2d<f32>;var icdfySamplerSampler: sampler;var icdfySampler: texture_2d<f32>;var voxelGridSamplerSampler: sampler;var voxelGridSampler: texture_3d<f32>;uniform shadowParameters: vec4f;
#define SHADOWdirs uniforms.shadowParameters.x
#define SHADOWframe uniforms.shadowParameters.y
#define SHADOWenvRot uniforms.shadowParameters.w
uniform voxelBiasParameters : vec4f;
#define highestMipLevel uniforms.voxelBiasParameters.z
uniform sssParameters: vec4f;
#define SSSsamples uniforms.sssParameters.x
#define SSSstride uniforms.sssParameters.y
#define SSSmaxDistance uniforms.sssParameters.z
#define SSSthickness uniforms.sssParameters.w
uniform shadowOpacity: vec4f;uniform projMtx: mat4x4f;uniform viewMtx: mat4x4f;uniform invProjMtx: mat4x4f;uniform invViewMtx: mat4x4f;uniform wsNormalizationMtx: mat4x4f;uniform invVPMtx: mat4x4f;
#define PI 3.1415927
#define GOLD 0.618034
struct AABB3f {m_min: vec3f,
m_max: vec3f,};struct Ray {orig: vec3f,
dir: vec3f,
dir_rcp: vec3f,
t_min: f32,
t_max: f32,};fn make_ray(origin: vec3f,direction: vec3f,tmin: f32,
tmax: f32)->Ray {var ray: Ray;ray.orig=origin;ray.dir=direction;ray.dir_rcp=1.0f/direction;ray.t_min=tmin;ray.t_max=tmax;return ray;}
fn ray_box_intersection(aabb: AABB3f,ray: Ray ,
distance_near: ptr<function,f32>,distance_far: ptr<function,f32>)->bool{var tbot: vec3f=ray.dir_rcp*(aabb.m_min-ray.orig);var ttop: vec3f=ray.dir_rcp*(aabb.m_max-ray.orig);var tmin: vec3f=min(ttop,tbot);var tmax: vec3f=max(ttop,tbot);*distance_near=max(ray.t_min,max(tmin.x,max(tmin.y,tmin.z)));*distance_far=min(ray.t_max,min(tmax.x,min(tmax.y,tmax.z)));return *distance_near<=*distance_far;}
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
struct VoxelMarchDiagnosticInfo {heat: f32,
voxel_intersect_coords: vec3i,};
#endif
fn hash(i: u32)->u32 {var temp=i ^ (i>>16u);temp*=0x7FEB352Du;temp ^= temp>>15u;temp*=0x846CA68Bu;temp ^= temp>>16u;return temp;}
fn uintBitsToFloat(x: u32)->f32 {return bitcast<f32>(x);}
fn uint2float(i: u32)->f32 {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}
fn uv_to_normal(uv: vec2f)->vec3f {var N: vec3f;var uvRange: vec2f=uv;var theta: f32=uvRange.x*2.0*PI;var phi: f32=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;}
fn plasticSequence(rstate: u32)->vec2f {return vec2f(uint2float(rstate*3242174889u),
uint2float(rstate*2447445414u));}
fn goldenSequence(rstate: u32)->f32 {return uint2float(rstate*2654435769u);}
fn distanceSquared(a: vec2f,b: vec2f)->f32 {var diff: vec2f=a-b;return dot(diff,diff);}
fn genTB(N: vec3f,T: ptr<function,vec3f>,B: ptr<function,vec3f>) {var s: f32=select(1.0,-1.0,N.z<0.0);var a: f32=-1.0/(s+N.z);var b: f32=N.x*N.y*a;*T= vec3f(1.0+s*N.x*N.x*a,s*b,-s*N.x);*B= vec3f(b,s+N.y*N.y*a,-N.y);}
fn lessThan(x: vec3f,y: vec3f)->vec3<bool> {return x<y;}
#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
fn anyHitVoxels(ray_vs: Ray,
voxel_march_diagnostic_info: ptr<function,VoxelMarchDiagnosticInfo>)->bool {
#else
fn anyHitVoxels(ray_vs: Ray)->bool {
#endif
var stack=array<i32,24>(); 
var invD: vec3f=ray_vs.dir_rcp;var D: vec3f=ray_vs.dir;var O: vec3f=ray_vs.orig;var negD=vec3i(lessThan(D, vec3f(0,0,0)));var voxel0: i32=negD.x | (negD.y<<1) | (negD.z<<2);var t0: vec3f=-O*invD;var t1=(vec3f(1.0)-O)*invD;var maxLod: i32= i32(highestMipLevel);var stackLevel: i32=0;
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
var steps: u32=0u;
#endif
stack[stackLevel]=maxLod<<24;stackLevel++;while (stackLevel>0) {stackLevel=stackLevel-1;var elem: i32=stack[stackLevel];var Coords: vec4i =
vec4i(elem & 0xFF,(elem>>8) & 0xFF,(elem>>16) & 0xFF,elem>>24);if (Coords.w==0) {
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
*voxel_march_diagnostic_info.heat= f32(steps)/24.0;
#endif
return true;}
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
++steps;
#endif
var invRes: f32=exp2(f32(Coords.w-maxLod));var bbmin: vec3f=invRes*vec3f(Coords.xyz+negD);var bbmax: vec3f=invRes*vec3f(Coords.xyz-negD+vec3i(1));var mint: vec3f=mix(t0,t1,bbmin);var maxt: vec3f=mix(t0,t1,bbmax);var midt: vec3f=0.5*(mint+maxt);mint.x=max(0.0,mint.x);midt.x=max(0.0,midt.x);var nodeMask: u32= u32(
round(textureLoad(voxelGridSampler,Coords.xyz,Coords.w).x*255.0));Coords.w--;var voxelBit: u32=u32(voxel0);Coords=vec4i((Coords.xyz<<vec3u(1))+negD,Coords.w);var packedCoords: i32 =
Coords.x | (Coords.y<<8) | (Coords.z<<16) | (Coords.w<<24);if (max(mint.x,max(mint.y,mint.z))<min(midt.x,min(midt.y,midt.z)) &&
((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}
voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(mint.y,mint.z))<min(maxt.x,min(midt.y,midt.z)) &&
((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}
voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(midt.y,mint.z))<min(maxt.x,min(maxt.y,midt.z)) &&
((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}
voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(midt.y,mint.z))<min(midt.x,min(maxt.y,midt.z)) &&
((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}
voxelBit ^= 0x4;packedCoords ^= 0x10000;if (max(mint.x,max(midt.y,midt.z))<min(midt.x,min(maxt.y,maxt.z)) &&
((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}
voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(midt.y,midt.z))<min(maxt.x,min(maxt.y,maxt.z)) &&
((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}
voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(mint.y,midt.z))<min(maxt.x,min(midt.y,maxt.z)) &&
((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}
voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(mint.y,midt.z))<min(midt.x,min(midt.y,maxt.z)) &&
((1u<<voxelBit) & nodeMask) != 0) {stack[stackLevel]=packedCoords;stackLevel++;}}
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
*voxel_march_diagnostic_info.heat= f32(steps)/24.0;
#endif
return false;}
fn linearizeDepth(depth: f32,near: f32,far: f32)->f32 {return (near*far)/(far-depth*(far-near));}
fn screenSpaceShadow(csOrigin: vec3f,csDirection: vec3f,csZBufferSize: vec2f,
nearPlaneZ: f32,farPlaneZ: f32,noise: f32)->f32 {
#ifdef RIGHT_HANDED
var csZDir : f32=-1.0;
#else 
var csZDir : f32=1.0;
#endif
var ssSamples: f32=SSSsamples;var ssMaxDist: f32=SSSmaxDistance;var ssStride: f32=SSSstride;var ssThickness: f32=SSSthickness;var rayLength: f32 =
select(ssMaxDist,(nearPlaneZ-csOrigin.z)/csDirection.z,
csZDir*(csOrigin.z+ssMaxDist*csDirection.z)<csZDir*nearPlaneZ);var csEndPoint: vec3f=csOrigin+rayLength*csDirection;var H0: vec4f=uniforms.projMtx*vec4f(csOrigin,1.0);var H1: vec4f=uniforms.projMtx*vec4f(csEndPoint,1.0);var Z0=vec2f(csOrigin.z ,1.0)/H0.w;var Z1=vec2f(csEndPoint.z,1.0)/H1.w;var P0=csZBufferSize*(0.5*H0.xy*Z0.y+0.5);var P1=csZBufferSize*(0.5*H1.xy*Z1.y+0.5);P1+= vec2f(select(0.0,0.01,distanceSquared(P0,P1)<0.0001));var delta: vec2f=P1-P0;var permute: bool=false;if (abs(delta.x)<abs(delta.y)) {permute=true;P0=P0.yx;P1=P1.yx;delta=delta.yx;}
var stepDirection: f32=sign(delta.x);var invdx: f32=stepDirection/delta.x;var dP: vec2f=ssStride* vec2f(stepDirection,invdx*delta.y);var dZ: vec2f=ssStride*invdx*(Z1-Z0);var opacity: f32=0.0;var P: vec2f=P0+noise*dP;var Z: vec2f=Z0+noise*dZ;var end: f32=P1.x*stepDirection;var rayZMax=csZDir*Z.x/Z.y;var sceneDepth=rayZMax;Z+=dZ;for (var stepCount: f32=0.0; 
opacity<1.0 && P.x*stepDirection<end && sceneDepth>0.0 && stepCount<ssSamples;stepCount+=1) { 
var coords=vec2i(select(P,P.yx,permute));sceneDepth=textureLoad(depthSampler,coords,0).x;sceneDepth=linearizeDepth(sceneDepth,nearPlaneZ,farPlaneZ);sceneDepth=csZDir*sceneDepth;if (sceneDepth<=0.0) {break;}
var rayZMin: f32=rayZMax;rayZMax=csZDir*Z.x/Z.y;opacity+=max(opacity,step(rayZMax,sceneDepth+ssThickness)*step(sceneDepth,rayZMin));P+=dP;Z+=dZ;}
return opacity;}
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
fn voxelShadow(wsOrigin: vec3f,wsDirection: vec3f,wsNormal: vec3f,
DitherNoise: vec2f,
voxel_march_diagnostic_info: ptr<function,VoxelMarchDiagnosticInfo>)->f32 {
#else
fn voxelShadow(wsOrigin: vec3f,wsDirection: vec3f,wsNormal: vec3f,
DitherNoise: vec2f)->f32 {
#endif
var vxResolution: f32=f32(textureDimensions(voxelGridSampler,0).x);var T: vec3f;var B: vec3f;genTB(wsDirection,&T,&B);var DitherXY: vec2f=sqrt(DitherNoise.x)* vec2f(cos(2.0*PI*DitherNoise.y),
sin(2.0*PI*DitherNoise.y));var Dithering : vec3f=(uniforms.voxelBiasParameters.x*wsNormal +
uniforms.voxelBiasParameters.y*wsDirection +
DitherXY.x*T+DitherXY.y*B) /
vxResolution;var O: vec3f=0.5*wsOrigin+0.5+Dithering;var ray_vs=make_ray(O,wsDirection,0.0,10.0);var voxel_aabb: AABB3f;voxel_aabb.m_min=vec3f(0);voxel_aabb.m_max=vec3f(1);var near: f32=0;var far: f32=0;if (!ray_box_intersection(voxel_aabb,ray_vs,&near,&far)) {return 0.0;}
ray_vs.t_min=max(ray_vs.t_min,near);ray_vs.t_max=min(ray_vs.t_max,far);
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
return select(0.0f,1.0f,anyHitVoxels(ray_vs,voxel_march_diagnostic_info));
#else
return select(0.0f,1.0f,anyHitVoxels(ray_vs));
#endif
}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var nbDirs=u32(SHADOWdirs);var frameId=u32(SHADOWframe);var envRot: f32=SHADOWenvRot;var Resolution: vec2f= vec2f(textureDimensions(depthSampler,0));var currentPixel=vec2i(fragmentInputs.vUV*Resolution);var GlobalIndex =
(frameId*u32(Resolution.y)+u32(currentPixel.y))*u32(Resolution.x) +
u32(currentPixel.x);var N : vec3f=textureLoad(worldNormalSampler,currentPixel,0).xyz;if (length(N)<0.01) {fragmentOutputs.color=vec4f(1.0,1.0,0.0,1.0);return fragmentOutputs;}
var normalizedRotation: f32=envRot/(2.0*PI);var depth : f32=textureLoad(depthSampler,currentPixel,0).x;
#ifndef IS_NDC_HALF_ZRANGE
depth=depth*2.0-1.0;
#endif
var temp : vec2f=(vec2f(currentPixel)+vec2f(0.5))*2.0/Resolution -
vec2f(1.0);var VP : vec4f=uniforms.invProjMtx*vec4f(temp.x,-temp.y,depth,1.0);VP/=VP.w;N=normalize(N);var noise
: vec3f =
textureLoad(blueNoiseSampler,currentPixel & vec2i(0xFF),0).xyz;noise.z=fract(noise.z+goldenSequence(frameId*nbDirs));
#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
var heat: f32=0.0f;
#endif
var shadowAccum: f32=0.0;var specShadowAccum: f32=0.0;var sampleWeight : f32=0;for (var i: u32=0; i<nbDirs; i++) {var dirId: u32=nbDirs*GlobalIndex+i;var L: vec4f;{var r: vec2f=plasticSequence(frameId*nbDirs+i);r=fract(r+ vec2f(2.0)*abs(noise.xy- vec2f(0.5)));var T: vec2f;T.x=textureSampleLevel(icdfxSampler,icdfxSamplerSampler,vec2f(r.x,0.0),0.0).x;T.y=textureSampleLevel(icdfySampler,icdfySamplerSampler,vec2f(T.x,r.y),0.0).x;T.x-=normalizedRotation;L= vec4f(uv_to_normal(T),0);
#ifndef RIGHT_HANDED
L.z*=-1.0;
#endif
}
var edge_tint_const=-0.001;var cosNL: f32=dot(N,L.xyz);var opacity: f32=select(0.0,1.0,cosNL<edge_tint_const);if (cosNL>edge_tint_const) {var VP2: vec4f=VP;VP2.y*=-1.0;var unormWP : vec4f=uniforms.invViewMtx*VP2;var WP: vec3f=(uniforms.wsNormalizationMtx*unormWP).xyz;var vxNoise: vec2f =
vec2f(uint2float(hash(dirId*2)),uint2float(hash(dirId*2+1)));
#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
VoxelMarchDiagnosticInfo voxel_march_diagnostic_info;opacity=max(opacity,
uniforms.shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise,
voxel_march_diagnostic_info));heat+=voxel_march_diagnostic_info.heat;
#else
opacity =
max(opacity,uniforms.shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise));
#endif
var VL : vec3f=(uniforms.viewMtx*L).xyz;
#ifdef RIGHT_HANDED
var nearPlaneZ: f32=-2.0*uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]-1.0); 
var farPlaneZ: f32=-uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]+1.0);
#else
var nearPlaneZ: f32=-2.0*uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]+1.0); 
var farPlaneZ: f32=-uniforms.projMtx[3][2]/(uniforms.projMtx[2][2]-1.0);
#endif
var ssShadow: f32=uniforms.shadowOpacity.y *
screenSpaceShadow(VP2.xyz,VL,Resolution,nearPlaneZ,farPlaneZ,
abs(2.0*noise.z-1.0));opacity=max(opacity,ssShadow);shadowAccum+=min(1.0-opacity,cosNL);sampleWeight+=cosNL;var VR : vec3f=-(uniforms.viewMtx*vec4f(reflect(-L.xyz,N),0.0)).xyz;specShadowAccum+=max(1.0-(opacity*pow(VR.z,8.0)),0.0);}
noise.z=fract(noise.z+GOLD);}
#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
fragmentOutputs.color =
vec4f(shadowAccum/sampleWeight,specShadowAccum/sampleWeight,heat/sampleWeight,1.0);
#else
fragmentOutputs.color=vec4f(shadowAccum/sampleWeight,specShadowAccum/sampleWeight,0.0,1.0);
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowVoxelTracingPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowVoxelTracing.fragment.js.map

/***/ }),

/***/ 53411:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsCdfxPixelShaderWGSL: () => (/* binding */ iblShadowsCdfxPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsCdfxPixelShader";
const shader = `#define PI 3.1415927
varying vUV: vec2f;var cdfy: texture_2d<f32>;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var cdfyRes=textureDimensions(cdfy,0);var currentPixel=vec2u(fragmentInputs.position.xy);var cdfx: f32=0.0;for (var x: u32=1; x<=currentPixel.x; x++) {cdfx+=textureLoad(cdfy, vec2u(x-1,cdfyRes.y-1),0).x;}
fragmentOutputs.color= vec4f( vec3f(cdfx),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowsCdfxPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowsCdfx.fragment.js.map

/***/ }),

/***/ 73034:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsCdfyPixelShaderWGSL: () => (/* binding */ iblShadowsCdfyPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsCdfyPixelShader";
const shader = `#define PI 3.1415927
varying vUV: vec2f;
#ifdef IBL_USE_CUBE_MAP
var iblSourceSampler: sampler;var iblSource: texture_cube<f32>;
#else
var iblSourceSampler: sampler;var iblSource: texture_2d<f32>;
#endif
uniform iblHeight: i32;
#ifdef IBL_USE_CUBE_MAP
fn equirectangularToCubemapDirection(uv: vec2f)->vec3f {var longitude: f32=uv.x*2.0*PI-PI;var latitude: f32=PI*0.5-uv.y*PI;var direction: vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
fn fetchCube(uv: vec2f)->f32 {var direction: vec3f=equirectangularToCubemapDirection(uv);return sin(PI*uv.y)*dot(textureSampleLevel(iblSource,iblSourceSampler,direction,0.0).rgb,
vec3f(0.3,0.6,0.1));}
#else
fn fetchPanoramic(Coords: vec2i,envmapHeight: f32)->f32 {return sin(PI*( f32(Coords.y)+0.5)/envmapHeight) *
dot(textureLoad(iblSource,Coords,0).rgb, vec3f(0.3,0.6,0.1));}
#endif
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var coords: vec2i= vec2i(fragmentInputs.position.xy);var cdfy: f32=0.0;for (var y: i32=1; y<=coords.y; y++) {
#ifdef IBL_USE_CUBE_MAP
var uv: vec2f= vec2f(input.vUV.x,( f32(y-1)+0.5)/ f32(uniforms.iblHeight));cdfy+=fetchCube(uv);
#else
cdfy+=fetchPanoramic( vec2i(coords.x,y-1), f32(uniforms.iblHeight));
#endif
}
fragmentOutputs.color= vec4f(cdfy,0.0,0.0,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowsCdfyPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowsCdfy.fragment.js.map

/***/ }),

/***/ 48232:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsIcdfxPixelShaderWGSL: () => (/* binding */ iblShadowsIcdfxPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsIcdfxPixelShader";
const shader = `#define PI 3.1415927
varying vUV: vec2f;var cdfx: texture_2d<f32>;fn fetchCDF(x: u32)->f32 {return textureLoad(cdfx, vec2u(x,0),0).x;}
fn bisect(size: u32,targetValue: f32)->f32
{var a: u32=0;var b=size-1;while (b-a>1) {var c: u32=(a+b)>>1;if (fetchCDF(c)<targetValue) {a=c;}
else {b=c;}}
return mix( f32(a), f32(b),(targetValue-fetchCDF(a))/(fetchCDF(b)-fetchCDF(a)))/ f32(size-1);}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var cdfSize: vec2u=textureDimensions(cdfx,0);var cdfWidth: u32=cdfSize.x;var icdfWidth: u32=cdfWidth-1;var currentPixel: vec2u= vec2u(fragmentInputs.position.xy);if (currentPixel.x==0)
{fragmentOutputs.color= vec4f(0.0);}
else if (currentPixel.x==icdfWidth-1) {fragmentOutputs.color= vec4f(1.0);} else {var targetValue: f32=fetchCDF(cdfWidth-1)*input.vUV.x;fragmentOutputs.color= vec4f( vec3f(bisect(cdfWidth,targetValue)),1.0);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowsIcdfxPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowsIcdfx.fragment.js.map

/***/ }),

/***/ 70065:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsIcdfyPixelShaderWGSL: () => (/* binding */ iblShadowsIcdfyPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsIcdfyPixelShader";
const shader = `#define PI 3.1415927
varying vUV: vec2f;var cdfy: texture_2d<f32>;fn fetchCDF(y: u32,invocationId: u32)->f32 {return textureLoad(cdfy, vec2u(invocationId,y),0).x;}
fn bisect(size: u32,targetValue: f32,invocationId: u32)->f32
{var a: u32=0;var b=size-1;while (b-a>1) {var c=(a+b)>>1;if (fetchCDF(c,invocationId)<targetValue) {a=c;}
else {b=c;}}
return mix( f32(a), f32(b),(targetValue-fetchCDF(a,invocationId))/(fetchCDF(b,invocationId)-fetchCDF(a,invocationId)))/ f32(size-1);}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var cdfSize: vec2u=textureDimensions(cdfy,0);var cdfHeight: u32=cdfSize.y;var currentPixel: vec2u= vec2u(fragmentInputs.position.xy);if (currentPixel.y==0) {fragmentOutputs.color= vec4f(0.0);}
else if (currentPixel.y==cdfHeight-2) {fragmentOutputs.color= vec4f(1.0);} else {var targetValue: f32=fetchCDF(cdfHeight-1,currentPixel.x)*input.vUV.y;fragmentOutputs.color= vec4f( vec3f(bisect(cdfHeight,targetValue,currentPixel.x)),1.0);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowsIcdfyPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowsIcdfy.fragment.js.map

/***/ }),

/***/ 79040:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsImportanceSamplingDebugPixelShaderWGSL: () => (/* binding */ iblShadowsImportanceSamplingDebugPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsImportanceSamplingDebugPixelShader";
const shader = `#define PI 3.1415927
varying vUV: vec2f;var cdfySampler: sampler;var cdfy: texture_2d<f32>;var icdfySampler: sampler;var icdfy: texture_2d<f32>;var cdfxSampler: sampler;var cdfx: texture_2d<f32>;var icdfxSampler: sampler;var icdfx: texture_2d<f32>;
#ifdef IBL_USE_CUBE_MAP
var iblSourceSampler: sampler;var iblSource: texture_cube<f32>;
#else
var iblSourceSampler: sampler;var iblSource: texture_2d<f32>;
#endif
var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;
#define cdfyVSize 0.4
#define cdfxVSize 0.1
#define cdfyHSize 0.5
uniform sizeParams: vec4f;
#ifdef IBL_USE_CUBE_MAP
fn equirectangularToCubemapDirection(uv: vec2f)->vec3f {var longitude: f32=uv.x*2.0*PI-PI;var latitude: f32=PI*0.5-uv.y*PI;var direction: vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
#endif
@fragment
fn main(input: FragmentInputs)->FragmentOutputs { 
var colour: vec3f= vec3f(0.0);var uv: vec2f =
vec2f((uniforms.sizeParams.x+input.vUV.x)*uniforms.sizeParams.z,(uniforms.sizeParams.y+input.vUV.y)*uniforms.sizeParams.w);var backgroundColour: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;const iblStart: f32=1.0-cdfyVSize;const cdfyStart: f32=1.0-2.0*cdfyVSize;const cdfxStart: f32=1.0-2.0*cdfyVSize-cdfxVSize;const icdfxStart: f32=1.0-2.0*cdfyVSize-2.0*cdfxVSize;
#ifdef IBL_USE_CUBE_MAP
var direction: vec3f=equirectangularToCubemapDirection(
(uv- vec2f(0.0,iblStart))* vec2f(1.0,1.0/cdfyVSize));var iblColour: vec3f=textureSampleLevel(iblSource,iblSourceSampler,direction,0.0).rgb;
#else
var iblColour: vec3f=textureSample(iblSource,iblSourceSampler,(uv- vec2f(0.0,iblStart)) *
vec2f(1.0,1.0/cdfyVSize))
.rgb;
#endif
var cdfyColour: f32 =
textureSample(cdfy,cdfySampler,(uv- vec2f(0.0,cdfyStart))* vec2f(2.0,1.0/cdfyVSize)).r;var icdfyColour: f32 =
textureSample(icdfy,icdfySampler,(uv- vec2f(0.5,cdfyStart))* vec2f(2.0,1.0/cdfyVSize)).r;var cdfxColour: f32 =
textureSample(cdfx,cdfxSampler,(uv- vec2f(0.0,cdfxStart))* vec2f(1.0,1.0/cdfxVSize)).r;var icdfxColour: f32=textureSample(icdfx,icdfxSampler,(uv- vec2f(0.0,icdfxStart)) *
vec2f(1.0,1.0/cdfxVSize)).r;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {colour=backgroundColour;} else if (uv.y>iblStart) {colour+=iblColour;} else if (uv.y>cdfyStart && uv.x<0.5) {colour.r+=0.003*cdfyColour;} else if (uv.y>cdfyStart && uv.x>0.5) {colour.r+=icdfyColour;} else if (uv.y>cdfxStart) {colour.r+=0.00003*cdfxColour;} else if (uv.y>icdfxStart) {colour.r+=icdfxColour;}
fragmentOutputs.color =vec4(mix(colour,backgroundColour,0.5),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblShadowsImportanceSamplingDebugPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblShadowsImportanceSamplingDebug.fragment.js.map

/***/ }),

/***/ 39107:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelGridPixelShaderWGSL: () => (/* binding */ iblVoxelGridPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelGridPixelShader";
const shader = `varying vNormalizedPosition: vec3f;uniform nearPlane: f32;uniform farPlane: f32;uniform stepSize: f32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var normPos: vec3f=input.vNormalizedPosition.xyz;if (normPos.z<uniforms.nearPlane || normPos.z>uniforms.farPlane) {discard;}
fragmentOutputs.fragData0=select(vec4f(0.0),vec4f(1.0),normPos.z<uniforms.nearPlane+uniforms.stepSize);fragmentOutputs.fragData1=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+uniforms.stepSize && normPos.z<uniforms.nearPlane+2.0*uniforms.stepSize);fragmentOutputs.fragData2=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+2.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+3.0*uniforms.stepSize);fragmentOutputs.fragData3=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+3.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+4.0*uniforms.stepSize);
#if MAX_DRAW_BUFFERS>4
fragmentOutputs.fragData4=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+4.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+5.0*uniforms.stepSize);fragmentOutputs.fragData5=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+5.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+6.0*uniforms.stepSize);fragmentOutputs.fragData6=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+6.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+7.0*uniforms.stepSize);fragmentOutputs.fragData7=select(vec4f(0.0),vec4f(1.0),normPos.z>=uniforms.nearPlane+7.0*uniforms.stepSize && normPos.z<uniforms.nearPlane+8.0*uniforms.stepSize);
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblVoxelGridPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblVoxelGrid.fragment.js.map

/***/ }),

/***/ 43965:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelGridVertexShaderWGSL: () => (/* binding */ iblVoxelGridVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelGridVertexShader";
const shader = `attribute position: vec3f;attribute normal: vec3f;varying vNormalizedPosition: vec3f;uniform world: mat4x4f;uniform invWorldScale: mat4x4f;uniform viewMatrix: mat4x4f;@vertex
fn main(input : VertexInputs)->FragmentInputs {vertexOutputs.position=uniforms.viewMatrix*uniforms.invWorldScale*uniforms.world* vec4f(input.position,1.);vertexOutputs.vNormalizedPosition=vertexOutputs.position.xyz*0.5+0.5;
#ifdef IS_NDC_HALF_ZRANGE
vertexOutputs.position=vec4f(vertexOutputs.position.x,vertexOutputs.position.y,vertexOutputs.position.z*0.5+0.5,vertexOutputs.position.w);
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblVoxelGridVertexShaderWGSL = { name, shader };
//# sourceMappingURL=iblVoxelGrid.vertex.js.map

/***/ }),

/***/ 17537:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelGrid2dArrayDebugPixelShaderWGSL: () => (/* binding */ iblVoxelGrid2dArrayDebugPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelGrid2dArrayDebugPixelShader";
const shader = `varying vUV: vec2f;var voxelTextureSampler: sampler;var voxelTexture: texture_3d<f32>;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform slice: i32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var size: vec3u=textureDimensions(voxelTexture,0);var dimension: f32=sqrt( f32(size.z));var samplePos: vec2f=fract(input.vUV.xy* vec2f(dimension));var sampleIndex: u32= u32(floor(input.vUV.x* f32(dimension))+floor(input.vUV.y* f32(dimension))*dimension);var color=textureSample(voxelTexture,voxelTextureSampler, vec3f(samplePos.xy,sampleIndex)).rrr;color+=textureSample(textureSampler,textureSamplerSampler,input.vUV.xy).rgb;fragmentOutputs.color=vec4f(color,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblVoxelGrid2dArrayDebugPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblVoxelGrid2dArrayDebug.fragment.js.map

/***/ }),

/***/ 84237:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelGrid3dDebugPixelShaderWGSL: () => (/* binding */ iblVoxelGrid3dDebugPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelGrid3dDebugPixelShader";
const shader = `varying vUV: vec2f;var voxelTextureSampler: sampler;var voxelTexture: texture_3d<f32>;var voxelSlabTextureSampler: sampler;var voxelSlabTexture: texture_2d<f32>;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform sizeParams: vec4f;
#define offsetX uniforms.sizeParams.x
#define offsetY uniforms.sizeParams.y
#define widthScale uniforms.sizeParams.z
#define heightScale uniforms.sizeParams.w
uniform mipNumber: f32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f =
vec2f((offsetX+input.vUV.x)*widthScale,(offsetY+input.vUV.y)*heightScale);var background: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);var voxelSlab: vec4f=textureSample(voxelSlabTexture,voxelSlabTextureSampler,input.vUV);var size: vec3u=textureDimensions(voxelTexture, i32(uniforms.mipNumber));var dimension: f32=ceil(sqrt( f32(size.z)));var samplePos: vec2f=fract(uv.xy* vec2f(dimension));var sampleIndex: u32= u32(floor(uv.x* f32(dimension)) +
floor(uv.y* f32(dimension))*dimension);var mip_separator: f32=0.0;if (samplePos.x<0.01 || samplePos.y<0.01) {mip_separator=1.0;}
var outBounds: bool=select(false,true,sampleIndex>size.z-1);sampleIndex=clamp(sampleIndex,0,size.z-1);var samplePosInt: vec2i= vec2i(samplePos.xy* vec2f(size.xy));var voxel: vec3f=textureLoad(voxelTexture,
vec3i(i32(samplePosInt.x),i32(samplePosInt.y),i32(sampleIndex)),
i32(uniforms.mipNumber)).rgb;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {fragmentOutputs.color=background;} else {if (outBounds) {voxel= vec3f(0.15,0.0,0.0);} else {if (voxel.r>0.001) {voxel.g=1.0;}
voxel.r+=mip_separator;}
fragmentOutputs.color=vec4f(mix(background.rgb,voxelSlab.rgb,voxelSlab.a)+voxel,1.0);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblVoxelGrid3dDebugPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblVoxelGrid3dDebug.fragment.js.map

/***/ }),

/***/ 1138:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelSlabDebugPixelShaderWGSL: () => (/* binding */ iblVoxelSlabDebugPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelSlabDebugPixelShader";
const shader = `varying vNormalizedPosition: vec3f;uniform nearPlane: f32;uniform farPlane: f32;uniform stepSize: f32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var normPos: vec3f=input.vNormalizedPosition.xyz;var chunkSize: f32=uniforms.stepSize* f32(MAX_DRAW_BUFFERS);var numChunks: f32=1.0/chunkSize;var positionInChunk: f32=fract(normPos.z/chunkSize);var slab: f32=floor(positionInChunk* f32(MAX_DRAW_BUFFERS)) /
f32(MAX_DRAW_BUFFERS);if (normPos.x<0.0 || normPos.y<0.0 || normPos.z<0.0 ||
normPos.x>1.0 || normPos.y>1.0 || normPos.z>1.0) {fragmentOutputs.color= vec4f(0.0,0.0,0.0,0.0);} else {fragmentOutputs.color= vec4f(slab,0.0,0.0,0.75);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblVoxelSlabDebugPixelShaderWGSL = { name, shader };
//# sourceMappingURL=iblVoxelSlabDebug.fragment.js.map

/***/ }),

/***/ 26472:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelSlabDebugVertexShaderWGSL: () => (/* binding */ iblVoxelSlabDebugVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelSlabDebugVertexShader";
const shader = `attribute position: vec3f;varying vNormalizedPosition: vec3f;uniform world: mat4x4f;uniform invWorldScale: mat4x4f;uniform cameraViewMatrix: mat4x4f;uniform projection: mat4x4f;uniform viewMatrix: mat4x4f;@vertex
fn main(input : VertexInputs)->FragmentInputs {var worldPosition: vec4f=(uniforms.world* vec4f(input.position,1.));vertexOutputs.position=uniforms.projection*uniforms.cameraViewMatrix*worldPosition;vertexOutputs.vNormalizedPosition=(uniforms.viewMatrix*uniforms.invWorldScale*worldPosition).rgb;vertexOutputs.vNormalizedPosition=vertexOutputs.vNormalizedPosition* vec3f(0.5)+ vec3f(0.5);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const iblVoxelSlabDebugVertexShaderWGSL = { name, shader };
//# sourceMappingURL=iblVoxelSlabDebug.vertex.js.map

/***/ }),

/***/ 37614:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   imageProcessingPixelShaderWGSL: () => (/* binding */ imageProcessingPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_imageProcessingDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16205);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_imageProcessingFunctions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(88996);
// Do not edit.




const name = "imageProcessingPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;
#include<imageProcessingDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var result: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);
#ifdef IMAGEPROCESSING
#ifndef FROMLINEARSPACE
result=vec4f(toLinearSpaceVec3(result.rgb),result.a);
#endif
result=applyImageProcessing(result);
#else
#ifdef FROMLINEARSPACE
result=applyImageProcessing(result);
#endif
#endif
fragmentOutputs.color=result;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const imageProcessingPixelShaderWGSL = { name, shader };
//# sourceMappingURL=imageProcessing.fragment.js.map

/***/ }),

/***/ 12850:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  kernelBlurPixelShaderWGSL: () => (/* binding */ kernelBlurPixelShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/kernelBlurVaryingDeclaration.js
var kernelBlurVaryingDeclaration = __webpack_require__(52383);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/packingFunctions.js
var packingFunctions = __webpack_require__(5543);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/kernelBlurFragment.js
// Do not edit.

const kernelBlurFragment_name = "kernelBlurFragment";
const shader = `#ifdef DOF
factor=sampleCoC(fragmentInputs.sampleCoord{X}); 
computedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
#else
computedWeight=KERNEL_WEIGHT{X};
#endif
#ifdef PACKEDFLOAT
blend+=unpack(textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCoord{X}))*computedWeight;
#else
blend+=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCoord{X})*computedWeight;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[kernelBlurFragment_name] = shader;
/** @internal */
const kernelBlurFragmentWGSL = { name: kernelBlurFragment_name, shader };
//# sourceMappingURL=kernelBlurFragment.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/kernelBlurFragment2.js
// Do not edit.

const kernelBlurFragment2_name = "kernelBlurFragment2";
const kernelBlurFragment2_shader = `#ifdef DOF
factor=sampleCoC(fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
#else
computedWeight=KERNEL_DEP_WEIGHT{X};
#endif
#ifdef PACKEDFLOAT
blend+=unpack(textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X}))*computedWeight;
#else
blend+=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X})*computedWeight;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[kernelBlurFragment2_name] = kernelBlurFragment2_shader;
/** @internal */
const kernelBlurFragment2WGSL = { name: kernelBlurFragment2_name, shader: kernelBlurFragment2_shader };
//# sourceMappingURL=kernelBlurFragment2.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/kernelBlur.fragment.js
// Do not edit.





const kernelBlur_fragment_name = "kernelBlurPixelShader";
const kernelBlur_fragment_shader = `var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform delta: vec2f;varying sampleCenter: vec2f;
#ifdef DOF
var circleOfConfusionSamplerSampler: sampler;var circleOfConfusionSampler: texture_2d<f32>;fn sampleCoC(offset: vec2f)->f32 {var coc: f32=textureSample(circleOfConfusionSampler,circleOfConfusionSamplerSampler,offset).r;return coc; }
#endif
#include<kernelBlurVaryingDeclaration>[0..varyingCount]
#ifdef PACKEDFLOAT
#include<packingFunctions>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var computedWeight: f32=0.0;
#ifdef PACKEDFLOAT
var blend: f32=0.;
#else
var blend: vec4f= vec4f(0.);
#endif
#ifdef DOF
var sumOfWeights: f32=CENTER_WEIGHT; 
var factor: f32=0.0;
#ifdef PACKEDFLOAT
blend+=unpack(textureSample(textureSampler,textureSamplerSampler,input.sampleCenter))*CENTER_WEIGHT;
#else
blend+=textureSample(textureSampler,textureSamplerSampler,input.sampleCenter)*CENTER_WEIGHT;
#endif
#endif
#include<kernelBlurFragment>[0..varyingCount]
#include<kernelBlurFragment2>[0..depCount]
#ifdef PACKEDFLOAT
fragmentOutputs.color=pack(blend);
#else
fragmentOutputs.color=blend;
#endif
#ifdef DOF
fragmentOutputs.color/=sumOfWeights;
#endif
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[kernelBlur_fragment_name] = kernelBlur_fragment_shader;
/** @internal */
const kernelBlurPixelShaderWGSL = { name: kernelBlur_fragment_name, shader: kernelBlur_fragment_shader };
//# sourceMappingURL=kernelBlur.fragment.js.map

/***/ }),

/***/ 85417:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  kernelBlurVertexShaderWGSL: () => (/* binding */ kernelBlurVertexShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/kernelBlurVaryingDeclaration.js
var kernelBlurVaryingDeclaration = __webpack_require__(52383);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/kernelBlurVertex.js
// Do not edit.

const kernelBlurVertex_name = "kernelBlurVertex";
const shader = `vertexOutputs.sampleCoord{X}=vertexOutputs.sampleCenter+uniforms.delta*KERNEL_OFFSET{X};`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[kernelBlurVertex_name] = shader;
/** @internal */
const kernelBlurVertexWGSL = { name: kernelBlurVertex_name, shader };
//# sourceMappingURL=kernelBlurVertex.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/kernelBlur.vertex.js
// Do not edit.



const kernelBlur_vertex_name = "kernelBlurVertexShader";
const kernelBlur_vertex_shader = `attribute position: vec2f;uniform delta: vec2f;varying sampleCenter: vec2f;
#include<kernelBlurVaryingDeclaration>[0..varyingCount]
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {const madd: vec2f= vec2f(0.5,0.5);
#define CUSTOM_VERTEX_MAIN_BEGIN
vertexOutputs.sampleCenter=(input.position*madd+madd);
#include<kernelBlurVertex>[0..varyingCount]
vertexOutputs.position= vec4f(input.position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[kernelBlur_vertex_name] = kernelBlur_vertex_shader;
/** @internal */
const kernelBlurVertexShaderWGSL = { name: kernelBlur_vertex_name, shader: kernelBlur_vertex_shader };
//# sourceMappingURL=kernelBlur.vertex.js.map

/***/ }),

/***/ 70711:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   layerPixelShaderWGSL: () => (/* binding */ layerPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
// Do not edit.


const name = "layerPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform color: vec4f;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
var baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);
#if defined(CONVERT_TO_GAMMA)
baseColor=toGammaSpace(baseColor);
#elif defined(CONVERT_TO_LINEAR)
baseColor=toLinearSpaceVec4(baseColor);
#endif
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
fragmentOutputs.color=baseColor*uniforms.color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const layerPixelShaderWGSL = { name, shader };
//# sourceMappingURL=layer.fragment.js.map

/***/ }),

/***/ 16913:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   layerVertexShaderWGSL: () => (/* binding */ layerVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "layerVertexShader";
const shader = `attribute position: vec2f;uniform scale: vec2f;uniform offset: vec2f;uniform textureMatrix: mat4x4f;varying vUV: vec2f;const madd: vec2f= vec2f(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
var shiftedPosition: vec2f=input.position*uniforms.scale+uniforms.offset;vertexOutputs.vUV=(uniforms.textureMatrix* vec4f(shiftedPosition*madd+madd,1.0,0.0)).xy;vertexOutputs.position= vec4f(shiftedPosition,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const layerVertexShaderWGSL = { name, shader };
//# sourceMappingURL=layer.vertex.js.map

/***/ }),

/***/ 53880:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lensFlarePixelShaderWGSL: () => (/* binding */ lensFlarePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lensFlarePixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform color: vec4f;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
var baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);fragmentOutputs.color=baseColor*uniforms.color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const lensFlarePixelShaderWGSL = { name, shader };
//# sourceMappingURL=lensFlare.fragment.js.map

/***/ }),

/***/ 59382:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lensFlareVertexShaderWGSL: () => (/* binding */ lensFlareVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lensFlareVertexShader";
const shader = `attribute position: vec2f;uniform viewportMatrix: mat4x4f;varying vUV: vec2f;const madd: vec2f= vec2f(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
vertexOutputs.vUV=input.position*madd+madd;vertexOutputs.position=uniforms.viewportMatrix* vec4f(input.position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const lensFlareVertexShaderWGSL = { name, shader };
//# sourceMappingURL=lensFlare.vertex.js.map

/***/ }),

/***/ 85264:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   linePixelShaderWGSL: () => (/* binding */ linePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39759);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_logDepthFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38780);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97715);
// Do not edit.





const name = "linePixelShader";
const shader = `#include<clipPlaneFragmentDeclaration>
uniform color: vec4f;
#include<logDepthDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<logDepthFragment>
#include<clipPlaneFragment>
fragmentOutputs.color=uniforms.color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const linePixelShaderWGSL = { name, shader };
//# sourceMappingURL=line.fragment.js.map

/***/ }),

/***/ 80574:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lineVertexShaderWGSL: () => (/* binding */ lineVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(77029);
/* harmony import */ var _ShadersInclude_sceneUboDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(98327);
/* harmony import */ var _ShadersInclude_meshUboDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6874);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85197);
/* harmony import */ var _ShadersInclude_logDepthVertex_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81482);
// Do not edit.









const name = "lineVertexShader";
const shader = `#define ADDITIONAL_VERTEX_DECLARATION
#include<instancesDeclaration>
#include<clipPlaneVertexDeclaration>
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
attribute position: vec3f;attribute normal: vec4f;uniform width: f32;uniform aspectRatio: f32;
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
var worldViewProjection: mat4x4f=scene.viewProjection*finalWorld;var viewPosition: vec4f=worldViewProjection* vec4f(input.position,1.0);var viewPositionNext: vec4f=worldViewProjection* vec4f(input.normal.xyz,1.0);var currentScreen: vec2f=viewPosition.xy/viewPosition.w;var nextScreen: vec2f=viewPositionNext.xy/viewPositionNext.w;currentScreen=vec2f(currentScreen.x*uniforms.aspectRatio,currentScreen.y);nextScreen=vec2f(nextScreen.x*uniforms.aspectRatio,nextScreen.y);var dir: vec2f=normalize(nextScreen-currentScreen);var normalDir: vec2f= vec2f(-dir.y,dir.x);normalDir*=uniforms.width/2.0;normalDir=vec2f(normalDir.x/uniforms.aspectRatio,normalDir.y);var offset: vec4f= vec4f(normalDir*input.normal.w,0.0,0.0);vertexOutputs.position=viewPosition+offset;
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
var worldPos: vec4f=finalWorld*vec4f(input.position,1.0);
#include<clipPlaneVertex>
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const lineVertexShaderWGSL = { name, shader };
//# sourceMappingURL=line.vertex.js.map

/***/ }),

/***/ 3613:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lodPixelShaderWGSL: () => (/* binding */ lodPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lodPixelShader";
const shader = `const GammaEncodePowerApprox=1.0/2.2;varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform lod: f32;uniform gamma: i32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,fragmentInputs.vUV,uniforms.lod);if (uniforms.gamma==0) {fragmentOutputs.color=vec4f(pow(fragmentOutputs.color.rgb,vec3f(GammaEncodePowerApprox)),fragmentOutputs.color.a);}}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const lodPixelShaderWGSL = { name, shader };
//# sourceMappingURL=lod.fragment.js.map

/***/ }),

/***/ 91650:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lodCubePixelShaderWGSL: () => (/* binding */ lodCubePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lodCubePixelShader";
const shader = `const GammaEncodePowerApprox=1.0/2.2;varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_cube<f32>;uniform lod: f32;uniform gamma: i32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {let uv=fragmentInputs.vUV*2.0-1.0;
#ifdef POSITIVEX
fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(1.001,uv.y,uv.x),uniforms.lod);
#endif
#ifdef NEGATIVEX
fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(-1.001,uv.y,uv.x),uniforms.lod);
#endif
#ifdef POSITIVEY
fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(uv.y,1.001,uv.x),uniforms.lod);
#endif
#ifdef NEGATIVEY
fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(uv.y,-1.001,uv.x),uniforms.lod);
#endif
#ifdef POSITIVEZ
fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(uv,1.001),uniforms.lod);
#endif
#ifdef NEGATIVEZ
fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,vec3f(uv,-1.001),uniforms.lod);
#endif
if (uniforms.gamma==0) {fragmentOutputs.color=vec4f(pow(fragmentOutputs.color.rgb,vec3f(GammaEncodePowerApprox)),fragmentOutputs.color.a);}}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const lodCubePixelShaderWGSL = { name, shader };
//# sourceMappingURL=lodCube.fragment.js.map

/***/ }),

/***/ 72657:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererPixelShaderWGSL: () => (/* binding */ meshUVSpaceRendererPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererPixelShader";
const shader = `varying vDecalTC: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {if (input.vDecalTC.x<0. || input.vDecalTC.x>1. || input.vDecalTC.y<0. || input.vDecalTC.y>1.) {discard;}
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vDecalTC);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const meshUVSpaceRendererPixelShaderWGSL = { name, shader };
//# sourceMappingURL=meshUVSpaceRenderer.fragment.js.map

/***/ }),

/***/ 23451:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererVertexShaderWGSL: () => (/* binding */ meshUVSpaceRendererVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32806);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98900);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76340);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8217);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18258);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9129);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65470);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(40242);
// Do not edit.











const name = "meshUVSpaceRendererVertexShader";
const shader = `attribute position: vec3f;attribute normal: vec3f;attribute uv: vec2f;uniform projMatrix: mat4x4f;varying vDecalTC: vec2f;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
@vertex
fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;var normalUpdated: vec3f=input.normal;
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);var normWorldSM: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);var vNormalW: vec3f;
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vNormalW=normalUpdated/ vec3f(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normWorldSM=transposeMat3(inverseMat3(normWorldSM));
#endif
vNormalW=normalize(normWorldSM*normalUpdated);
#endif
var normalView: vec3f=normalize((uniforms.projMatrix* vec4f(vNormalW,0.0)).xyz);var decalTC: vec3f=(uniforms.projMatrix*worldPos).xyz;vertexOutputs.vDecalTC=decalTC.xy;vertexOutputs.position=vec4f(input.uv*2.0-1.0,select(decalTC.z,2.,normalView.z>0.0),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const meshUVSpaceRendererVertexShaderWGSL = { name, shader };
//# sourceMappingURL=meshUVSpaceRenderer.vertex.js.map

/***/ }),

/***/ 29700:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererFinaliserPixelShaderWGSL: () => (/* binding */ meshUVSpaceRendererFinaliserPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererFinaliserPixelShader";
const shader = `#define DISABLE_UNIFORMITY_ANALYSIS
varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var maskTextureSamplerSampler: sampler;var maskTextureSampler: texture_2d<f32>;uniform textureSize: vec2f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var mask: vec4f=textureSample(maskTextureSampler,maskTextureSamplerSampler,input.vUV).rgba;if (mask.r>0.5) {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);} else {var texelSize: vec2f=4.0/uniforms.textureSize;var uv_p01: vec2f=input.vUV+ vec2f(-1.0,0.0)*texelSize;var uv_p21: vec2f=input.vUV+ vec2f(1.0,0.0)*texelSize;var uv_p10: vec2f=input.vUV+ vec2f(0.0,-1.0)*texelSize;var uv_p12: vec2f=input.vUV+ vec2f(0.0,1.0)*texelSize;var mask_p01: f32=textureSample(maskTextureSampler,maskTextureSamplerSampler,uv_p01).r;var mask_p21: f32=textureSample(maskTextureSampler,maskTextureSamplerSampler,uv_p21).r;var mask_p10: f32=textureSample(maskTextureSampler,maskTextureSamplerSampler,uv_p10).r;var mask_p12: f32=textureSample(maskTextureSampler,maskTextureSamplerSampler,uv_p12).r;var col: vec4f= vec4f(0.0,0.0,0.0,0.0);var total_weight: f32=0.0;if (mask_p01>0.5) {col+=textureSample(textureSampler,textureSamplerSampler,uv_p01);total_weight+=1.0;}
if (mask_p21>0.5) {col+=textureSample(textureSampler,textureSamplerSampler,uv_p21);total_weight+=1.0;}
if (mask_p10>0.5) {col+=textureSample(textureSampler,textureSamplerSampler,uv_p10);total_weight+=1.0;}
if (mask_p12>0.5) {col+=textureSample(textureSampler,textureSamplerSampler,uv_p12);total_weight+=1.0;}
if (total_weight>0.0) {fragmentOutputs.color=col/total_weight;} else {fragmentOutputs.color=col;}}}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const meshUVSpaceRendererFinaliserPixelShaderWGSL = { name, shader };
//# sourceMappingURL=meshUVSpaceRendererFinaliser.fragment.js.map

/***/ }),

/***/ 33570:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererFinaliserVertexShaderWGSL: () => (/* binding */ meshUVSpaceRendererFinaliserVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererFinaliserVertexShader";
const shader = `attribute position: vec3f;attribute uv: vec2f;uniform worldViewProjection: mat4x4f;varying vUV: vec2f;@vertex
fn main(input : VertexInputs)->FragmentInputs {vertexOutputs.position=uniforms.worldViewProjection* vec4f(input.position,1.0);vertexOutputs.positionvUV=input.uv;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const meshUVSpaceRendererFinaliserVertexShaderWGSL = { name, shader };
//# sourceMappingURL=meshUVSpaceRendererFinaliser.vertex.js.map

/***/ }),

/***/ 4044:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererMaskerPixelShaderWGSL: () => (/* binding */ meshUVSpaceRendererMaskerPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererMaskerPixelShader";
const shader = `varying vUV: vec2f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color= vec4f(1.0,1.0,1.0,1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const meshUVSpaceRendererMaskerPixelShaderWGSL = { name, shader };
//# sourceMappingURL=meshUVSpaceRendererMasker.fragment.js.map

/***/ }),

/***/ 19226:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererMaskerVertexShaderWGSL: () => (/* binding */ meshUVSpaceRendererMaskerVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererMaskerVertexShader";
const shader = `attribute uv: vec2f;varying vUV: vec2f;@vertex
fn main(input : VertexInputs)->FragmentInputs {vertexOutputs.position= vec4f( vec2f(input.uv.x,input.uv.y)*2.0-1.0,0.,1.0);vertexOutputs.vUV=input.uv;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const meshUVSpaceRendererMaskerVertexShaderWGSL = { name, shader };
//# sourceMappingURL=meshUVSpaceRendererMasker.vertex.js.map

/***/ }),

/***/ 8075:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   motionBlurPixelShaderWGSL: () => (/* binding */ motionBlurPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "motionBlurPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform motionStrength: f32;uniform motionScale: f32;uniform screenSize: vec2f;
#ifdef OBJECT_BASED
var velocitySamplerSampler: sampler;var velocitySampler: texture_2d<f32>;
#else
var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;uniform inverseViewProjection: mat4x4f;uniform prevViewProjection: mat4x4f;uniform projection: mat4x4f;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#ifdef GEOMETRY_SUPPORTED
#ifdef OBJECT_BASED
var texelSize: vec2f=1.0/uniforms.screenSize;var velocityColor: vec4f=textureSample(velocitySampler,velocitySamplerSampler,input.vUV);velocityColor=vec4f(velocityColor.rg*2.0- vec2f(1.0),velocityColor.b,velocityColor.a);var velocity: vec2f= vec2f(pow(velocityColor.r,3.0),pow(velocityColor.g,3.0))*velocityColor.a;velocity*=uniforms.motionScale*uniforms.motionStrength;var speed: f32=length(velocity/texelSize);var samplesCount: i32= i32(clamp(speed,1.0,SAMPLES));velocity=normalize(velocity)*texelSize;var hlim: f32= f32(-samplesCount)*0.5+0.5;var result: vec4f=textureSample(textureSampler,textureSamplerSampler, input.vUV);for (var i: i32=1; i< i32(SAMPLES); i++)
{if (i>=samplesCount) {break;}
var offset: vec2f=input.vUV+velocity*(hlim+ f32(i));
#if defined(WEBGPU)
result+=textureSampleLevel(textureSampler,textureSamplerSampler, offset,0.0);
#else
result+=textureSample(textureSampler,textureSamplerSampler, offset);
#endif
}
fragmentOutputs.color=vec4f(result.rgb/ f32(samplesCount),1.0);
#else
var texelSize: vec2f=1.0/uniforms.screenSize;var depth: f32=textureSample(depthSampler,depthSamplerSampler,input.vUV).r;depth=uniforms.projection[2].z+uniforms.projection[3].z/depth; 
var cpos: vec4f= vec4f(input.vUV*2.0-1.0,depth,1.0);cpos=uniforms.inverseViewProjection*cpos;cpos/=cpos.w;var ppos: vec4f=uniforms.prevViewProjection*cpos;ppos/=ppos.w;ppos.xy=ppos.xy*0.5+0.5;var velocity: vec2f=(ppos.xy-input.vUV)*uniforms.motionScale*uniforms.motionStrength;var speed: f32=length(velocity/texelSize);var nSamples: i32= i32(clamp(speed,1.0,SAMPLES));var result: vec4f=textureSample(textureSampler,textureSamplerSampler, input.vUV);for (var i: i32=1; i< i32(SAMPLES); i++) {if (i>=nSamples) {break;}
var offset1: vec2f=input.vUV+velocity*( f32(i)/ f32(nSamples-1)-0.5);
#if defined(WEBGPU)
result+=textureSampleLevel(textureSampler,textureSamplerSampler, offset1,0.0);
#else
result+=textureSample(textureSampler,textureSamplerSampler, offset1);
#endif
}
fragmentOutputs.color=result/ f32(nSamples);
#endif
#else
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler, input.vUV);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const motionBlurPixelShaderWGSL = { name, shader };
//# sourceMappingURL=motionBlur.fragment.js.map

/***/ }),

/***/ 47312:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   oitBackBlendPixelShaderWGSL: () => (/* binding */ oitBackBlendPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "oitBackBlendPixelShader";
const shader = `var uBackColor: texture_2d<f32>;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureLoad(uBackColor,vec2i(fragmentInputs.position.xy),0);if (fragmentOutputs.color.a==0.0) {discard;}}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const oitBackBlendPixelShaderWGSL = { name, shader };
//# sourceMappingURL=oitBackBlend.fragment.js.map

/***/ }),

/***/ 14958:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   oitFinalPixelShaderWGSL: () => (/* binding */ oitFinalPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "oitFinalPixelShader";
const shader = `var uFrontColor: texture_2d<f32>;var uBackColor: texture_2d<f32>;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var fragCoord: vec2i=vec2i(fragmentInputs.position.xy);var frontColor: vec4f=textureLoad(uFrontColor,fragCoord,0);var backColor: vec4f=textureLoad(uBackColor,fragCoord,0);var alphaMultiplier: f32=1.0-frontColor.a;fragmentOutputs.color=vec4f(
frontColor.rgb+alphaMultiplier*backColor.rgb,
frontColor.a+backColor.a
);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const oitFinalPixelShaderWGSL = { name, shader };
//# sourceMappingURL=oitFinal.fragment.js.map

/***/ }),

/***/ 13802:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   outlinePixelShaderWGSL: () => (/* binding */ outlinePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39759);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97715);
/* harmony import */ var _ShadersInclude_logDepthFragment_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38780);
// Do not edit.





const name = "outlinePixelShader";
const shader = `uniform color: vec4f;
#ifdef ALPHATEST
varying vUV: vec2;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
#endif
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUV).a<0.4) {discard;}
#endif
#include<logDepthFragment>
fragmentOutputs.color=uniforms.color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const outlinePixelShaderWGSL = { name, shader };
//# sourceMappingURL=outline.fragment.js.map

/***/ }),

/***/ 85520:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   outlineVertexShaderWGSL: () => (/* binding */ outlineVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32806);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98900);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76340);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8217);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77029);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18258);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9129);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(65470);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(40242);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(85197);
/* harmony import */ var _ShadersInclude_logDepthVertex_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(81482);
// Do not edit.















const name = "outlineVertexShader";
const shader = `attribute position: vec3f;attribute normal: vec3f;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
uniform offset: f32;
#include<instancesDeclaration>
uniform viewProjection: mat4x4f;
#ifdef ALPHATEST
varying vUV: vec2f;uniform diffuseMatrix: mat4x4f; 
#ifdef UV1
attribute uv: vec2f;
#endif
#ifdef UV2
attribute uv2: vec2f;
#endif
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input: VertexInputs)->FragmentInputs {var positionUpdated: vec3f=vertexInputs.position;var normalUpdated: vec3f=vertexInputs.normal;
#ifdef UV1
var uvUpdated: vec2f=vertexInputs.uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
var offsetPosition: vec3f=positionUpdated+(normalUpdated*uniforms.offset);
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f=finalWorld*vec4f(offsetPosition,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;
#ifdef ALPHATEST
#ifdef UV1
vertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uvUpdated,1.0,0.0)).xy;
#endif
#ifdef UV2
vertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(vertexInputs.uv2,1.0,0.0)).xy;
#endif
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const outlineVertexShaderWGSL = { name, shader };
//# sourceMappingURL=outline.vertex.js.map

/***/ }),

/***/ 96913:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   particlesPixelShaderWGSL: () => (/* binding */ particlesPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39759);
/* harmony import */ var _ShadersInclude_imageProcessingDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16205);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_imageProcessingFunctions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88996);
/* harmony import */ var _ShadersInclude_fogFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(66407);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97715);
/* harmony import */ var _ShadersInclude_logDepthFragment_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(38780);
/* harmony import */ var _ShadersInclude_fogFragment_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(93243);
// Do not edit.










const name = "particlesPixelShader";
const shader = `varying vUV: vec2f;varying vColor: vec4f;uniform textureMask: vec4f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
#include<clipPlaneFragmentDeclaration>
#include<imageProcessingDeclaration>
#include<logDepthDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
#ifdef RAMPGRADIENT
varying remapRanges: vec4f;var rampSamplerSampler: sampler;var rampSampler: texture_2d<f32>;
#endif
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
var textureColor: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV);var baseColor: vec4f=(textureColor*uniforms.textureMask+( vec4f(1.,1.,1.,1.)-uniforms.textureMask))*input.vColor;
#ifdef RAMPGRADIENT
var alpha: f32=baseColor.a;var remappedColorIndex: f32=clamp((alpha-input.remapRanges.x)/input.remapRanges.y,0.0,1.0);var rampColor: vec4f=textureSample(rampSampler,rampSamplerSampler,vec2f(1.0-remappedColorIndex,0.));baseColor=vec4f(baseColor.rgb*rampColor.rgb,baseColor.a);var finalAlpha: f32=baseColor.a;baseColor.a=clamp((alpha*rampColor.a-input.remapRanges.z)/input.remapRanges.w,0.0,1.0);
#endif
#ifdef BLENDMULTIPLYMODE
var sourceAlpha: f32=input.vColor.a*textureColor.a;baseColor=vec4f(baseColor.rgb*sourceAlpha+ vec3f(1.0)*(1.0-sourceAlpha),baseColor.a);
#endif
#include<logDepthFragment>
#include<fogFragment>(color,baseColor)
#ifdef IMAGEPROCESSINGPOSTPROCESS
baseColor=vec4f(toLinearSpaceVec3(baseColor.rgb),baseColor.a);
#else
#ifdef IMAGEPROCESSING
baseColor=vec4f(toLinearSpaceVec3(baseColor.rgb),baseColor.a);baseColor=applyImageProcessing(baseColor);
#endif
#endif
fragmentOutputs.color=baseColor;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const particlesPixelShaderWGSL = { name, shader };
//# sourceMappingURL=particles.fragment.js.map

/***/ }),

/***/ 27323:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   particlesVertexShaderWGSL: () => (/* binding */ particlesVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77029);
/* harmony import */ var _ShadersInclude_fogVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75757);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85197);
/* harmony import */ var _ShadersInclude_fogVertex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(59013);
/* harmony import */ var _ShadersInclude_logDepthVertex_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81482);
// Do not edit.







const name = "particlesVertexShader";
const shader = `attribute position: vec3f;attribute color: vec4f;attribute angle: f32;attribute size: vec2f;
#ifdef ANIMATESHEET
attribute cellIndex: f32;
#endif
#ifndef BILLBOARD
attribute direction: vec3f;
#endif
#ifdef BILLBOARDSTRETCHED
attribute direction: vec3f;
#endif
#ifdef RAMPGRADIENT
attribute remapData: vec4f;
#endif
attribute offset: vec2f;uniform view: mat4x4f;uniform projection: mat4x4f;uniform translationPivot: vec2f;
#ifdef ANIMATESHEET
uniform particlesInfos: vec3f; 
#endif
varying vUV: vec2f;varying vColor: vec4f;varying vPositionW: vec3f;
#ifdef RAMPGRADIENT
varying remapRanges: vec4f;
#endif
#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)
uniform invView: mat4x4f;
#endif
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<logDepthDeclaration>
#ifdef BILLBOARD
uniform eyePosition: vec3f;
#endif
fn rotate(yaxis: vec3f,rotatedCorner: vec3f)->vec3f {var xaxis: vec3f=normalize(cross( vec3f(0.,1.0,0.),yaxis));var zaxis: vec3f=normalize(cross(yaxis,xaxis));var row0: vec3f= vec3f(xaxis.x,xaxis.y,xaxis.z);var row1: vec3f= vec3f(yaxis.x,yaxis.y,yaxis.z);var row2: vec3f= vec3f(zaxis.x,zaxis.y,zaxis.z);var rotMatrix: mat3x3f= mat3x3f(row0,row1,row2);var alignedCorner: vec3f=rotMatrix*rotatedCorner;return vertexInputs.position+alignedCorner;}
#ifdef BILLBOARDSTRETCHED
fn rotateAlign(toCamera: vec3f,rotatedCorner: vec3f)->vec3f {var normalizedToCamera: vec3f=normalize(toCamera);var normalizedCrossDirToCamera: vec3f=normalize(cross(normalize(vertexInputs.direction),normalizedToCamera));var row0: vec3f= vec3f(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);var row2: vec3f= vec3f(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);
#ifdef BILLBOARDSTRETCHED_LOCAL
var row1: vec3f=vertexInputs.direction;
#else
var crossProduct: vec3f=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));var row1: vec3f= vec3f(crossProduct.x,crossProduct.y,crossProduct.z);
#endif
var rotMatrix: mat3x3f= mat3x3f(row0,row1,row2);var alignedCorner: vec3f=rotMatrix*rotatedCorner;return input.position+alignedCorner;}
#endif
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
var cornerPos: vec2f;cornerPos=( vec2f(input.offset.x-0.5,input.offset.y -0.5)-uniforms.translationPivot)*input.size;
#ifdef BILLBOARD
var rotatedCorner: vec3f;
#ifdef BILLBOARDY
rotatedCorner.x=cornerPos.x*cos(input.angle)-cornerPos.y*sin(input.angle)+uniforms.translationPivot.x;rotatedCorner.z=cornerPos.x*sin(input.angle)+cornerPos.y*cos(input.angle)+uniforms.translationPivot.y;rotatedCorner.y=0.;var yaxis: vec3f=input.position-uniforms.eyePosition;yaxis.y=0.;vertexOutputs.vPositionW=rotate(normalize(yaxis),rotatedCorner);var viewPos: vec3f=(uniforms.view* vec4f(vertexOutputs.vPositionW,1.0)).xyz;
#elif defined(BILLBOARDSTRETCHED)
rotatedCorner.x=cornerPos.x*cos(input.angle)-cornerPos.y*sin(input.angle)+uniforms.translationPivot.x;rotatedCorner.y=cornerPos.x*sin(input.angle)+cornerPos.y*cos(input.angle)+uniforms.translationPivot.y;rotatedCorner.z=0.;var toCamera: vec3f=input.position-uniforms.eyePosition;vertexOutputs.vPositionW=rotateAlign(toCamera,rotatedCorner);var viewPos: vec3f=(uniforms.view* vec4f(vertexOutputs.vPositionW,1.0)).xyz;
#else
rotatedCorner.x=cornerPos.x*cos(input.angle)-cornerPos.y*sin(input.angle)+uniforms.translationPivot.x;rotatedCorner.y=cornerPos.x*sin(input.angle)+cornerPos.y*cos(input.angle)+uniforms.translationPivot.y;rotatedCorner.z=0.;var viewPos: vec3f=(uniforms.view* vec4f(input.position,1.0)).xyz+rotatedCorner;vertexOutputs.vPositionW=(uniforms.invView* vec4f(viewPos,1)).xyz;
#endif
#ifdef RAMPGRADIENT
vertexOutputs.remapRanges=input.remapData;
#endif
vertexOutputs.position=uniforms.projection* vec4f(viewPos,1.0);
#else
var rotatedCorner: vec3f;rotatedCorner.x=cornerPos.x*cos(input.angle)-cornerPos.y*sin(input.angle)+uniforms.translationPivot.x;rotatedCorner.z=cornerPos.x*sin(input.angle)+cornerPos.y*cos(input.angle)+uniforms.translationPivot.y;rotatedCorner.y=0.;var yaxis: vec3f=normalize(vertexInputs.direction);vertexOutputs.vPositionW=rotate(yaxis,rotatedCorner);vertexOutputs.position=uniforms.projection*uniforms.view* vec4f(vertexOutputs.vPositionW,1.0);
#endif
vertexOutputs.vColor=input.color;
#ifdef ANIMATESHEET
var rowOffset: f32=floor(input.cellIndex*uniforms.particlesInfos.z);var columnOffset: f32=input.cellIndex-rowOffset/uniforms.particlesInfos.z;var uvScale: vec2f=uniforms.particlesInfos.xy;var uvOffset: vec2f= vec2f(input.offset.x ,1.0-input.offset.y);vertexOutputs.vUV=(uvOffset+ vec2f(columnOffset,rowOffset))*uvScale;
#else
vertexOutputs.vUV=input.offset;
#endif
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) || defined(FOG)
var worldPos: vec4f= vec4f(vertexOutputs.vPositionW,1.0);
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const particlesVertexShaderWGSL = { name, shader };
//# sourceMappingURL=particles.vertex.js.map

/***/ }),

/***/ 99965:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   passPixelShaderWGSL: () => (/* binding */ passPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "passPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const passPixelShaderWGSL = { name, shader };
//# sourceMappingURL=pass.fragment.js.map

/***/ }),

/***/ 67682:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   passCubePixelShaderWGSL: () => (/* binding */ passCubePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "passCubePixelShader";
const shader = `varying var vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_cube<f32>;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f=input.vUV*2.0-1.0;
#ifdef POSITIVEX
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(1.001,uv.y,uv.x));
#endif
#ifdef NEGATIVEX
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(-1.001,uv.y,uv.x));
#endif
#ifdef POSITIVEY
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv.y,1.001,uv.x));
#endif
#ifdef NEGATIVEY
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv.y,-1.001,uv.x));
#endif
#ifdef POSITIVEZ
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv,1.001));
#endif
#ifdef NEGATIVEZ
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv,-1.001));
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const passCubePixelShaderWGSL = { name, shader };
//# sourceMappingURL=passCube.fragment.js.map

/***/ }),

/***/ 22625:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  pbrPixelShaderWGSL: () => (/* binding */ pbrPixelShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/prePassDeclaration.js
var prePassDeclaration = __webpack_require__(54211);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/oitDeclaration.js
var oitDeclaration = __webpack_require__(18639);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js
var pbrUboDeclaration = __webpack_require__(34035);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/mainUVVaryingDeclaration.js
var mainUVVaryingDeclaration = __webpack_require__(41861);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrFragmentExtraDeclaration.js
// Do not edit.


const pbrFragmentExtraDeclaration_name = "pbrFragmentExtraDeclaration";
const shader = `varying vPositionW: vec3f;
#if DEBUGMODE>0
varying vClipSpacePosition: vec4f;
#endif
#include<mainUVVaryingDeclaration>[1..7]
#ifdef NORMAL
varying vNormalW: vec3f;
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
varying vEnvironmentIrradiance: vec3f;
#endif
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vColor: vec4f;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrFragmentExtraDeclaration_name] = shader;
/** @internal */
const pbrFragmentExtraDeclarationWGSL = { name: pbrFragmentExtraDeclaration_name, shader };
//# sourceMappingURL=pbrFragmentExtraDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/lightUboDeclaration.js
var lightUboDeclaration = __webpack_require__(30379);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/samplerFragmentDeclaration.js
var samplerFragmentDeclaration = __webpack_require__(80983);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/samplerFragmentAlternateDeclaration.js
// Do not edit.

const samplerFragmentAlternateDeclaration_name = "samplerFragmentAlternateDeclaration";
const samplerFragmentAlternateDeclaration_shader = `#ifdef _DEFINENAME_
#if _DEFINENAME_DIRECTUV==1
#define v_VARYINGNAME_UV vMainUV1
#elif _DEFINENAME_DIRECTUV==2
#define v_VARYINGNAME_UV vMainUV2
#elif _DEFINENAME_DIRECTUV==3
#define v_VARYINGNAME_UV vMainUV3
#elif _DEFINENAME_DIRECTUV==4
#define v_VARYINGNAME_UV vMainUV4
#elif _DEFINENAME_DIRECTUV==5
#define v_VARYINGNAME_UV vMainUV5
#elif _DEFINENAME_DIRECTUV==6
#define v_VARYINGNAME_UV vMainUV6
#else
varying v_VARYINGNAME_UV: vec2f;
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[samplerFragmentAlternateDeclaration_name] = samplerFragmentAlternateDeclaration_shader;
/** @internal */
const samplerFragmentAlternateDeclarationWGSL = { name: samplerFragmentAlternateDeclaration_name, shader: samplerFragmentAlternateDeclaration_shader };
//# sourceMappingURL=samplerFragmentAlternateDeclaration.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js
// Do not edit.



const pbrFragmentSamplersDeclaration_name = "pbrFragmentSamplersDeclaration";
const pbrFragmentSamplersDeclaration_shader = `#include<samplerFragmentDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo)
#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface)
#include<samplerFragmentDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance)
#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)
#ifdef CLEARCOAT
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat)
#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS)
var clearCoatRoughnessSamplerSampler: sampler;var clearCoatRoughnessSampler: texture_2d<f32>;
#endif
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump)
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint)
#endif
#ifdef IRIDESCENCE
#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence)
#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness)
#endif
#ifdef SHEEN
#include<samplerFragmentDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen)
#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS)
var sheenRoughnessSamplerSampler: sampler;var sheenRoughnessSampler: texture_2d<f32>;
#endif
#endif
#ifdef ANISOTROPIC
#include<samplerFragmentDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy)
#endif
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;
#ifdef LODBASEDMICROSFURACE
#else
var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube<f32>;
#endif
#ifdef USEIRRADIANCEMAP
var irradianceSamplerSampler: sampler;var irradianceSampler: texture_cube<f32>;
#endif
#else
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;
#ifdef LODBASEDMICROSFURACE
#else
var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d<f32>;
#endif
#ifdef USEIRRADIANCEMAP
var irradianceSamplerSampler: sampler;var irradianceSampler: texture_2d<f32>;
#endif
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vPositionUVW: vec3f;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vDirectionW: vec3f;
#endif
#endif
#endif
#ifdef ENVIRONMENTBRDF
var environmentBrdfSamplerSampler: sampler;var environmentBrdfSampler: texture_2d<f32>;
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
#ifdef SS_REFRACTIONMAP_3D
var refractionSamplerSampler: sampler;var refractionSampler: texture_cube<f32>;
#ifdef LODBASEDMICROSFURACE
#else
var refractionLowSamplerSampler: sampler;var refractionLowSampler: texture_cube<f32>;var refractionHighSamplerSampler: sampler;var refractionHighSampler: texture_cube<f32>;
#endif
#else
var refractionSamplerSampler: sampler;var refractionSampler: texture_2d<f32>;
#ifdef LODBASEDMICROSFURACE
#else
var refractionLowSamplerSampler: sampler;var refractionLowSampler: texture_2d<f32>;var refractionHighSamplerSampler: sampler;var refractionHighSampler: texture_2d<f32>;
#endif
#endif
#endif
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_SAMPLERNAME_,translucencyColor)
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrFragmentSamplersDeclaration_name] = pbrFragmentSamplersDeclaration_shader;
/** @internal */
const pbrFragmentSamplersDeclarationWGSL = { name: pbrFragmentSamplersDeclaration_name, shader: pbrFragmentSamplersDeclaration_shader };
//# sourceMappingURL=pbrFragmentSamplersDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js
var imageProcessingDeclaration = __webpack_require__(16205);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(39759);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(93226);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__(66407);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(79702);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/subSurfaceScatteringFunctions.js
// Do not edit.

const subSurfaceScatteringFunctions_name = "subSurfaceScatteringFunctions";
const subSurfaceScatteringFunctions_shader = `fn testLightingForSSS(diffusionProfile: f32)->bool
{return diffusionProfile<1.;}`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[subSurfaceScatteringFunctions_name] = subSurfaceScatteringFunctions_shader;
/** @internal */
const subSurfaceScatteringFunctionsWGSL = { name: subSurfaceScatteringFunctions_name, shader: subSurfaceScatteringFunctions_shader };
//# sourceMappingURL=subSurfaceScatteringFunctions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/importanceSampling.js
var importanceSampling = __webpack_require__(75136);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js
// Do not edit.

const pbrHelperFunctions_name = "pbrHelperFunctions";
const pbrHelperFunctions_shader = `#define MINIMUMVARIANCE 0.0005
fn convertRoughnessToAverageSlope(roughness: f32)->f32
{return roughness*roughness+MINIMUMVARIANCE;}
fn fresnelGrazingReflectance(reflectance0: f32)->f32 {var reflectance90: f32=saturate(reflectance0*25.0);return reflectance90;}
fn getAARoughnessFactors(normalVector: vec3f)->vec2f {
#ifdef SPECULARAA
var nDfdx: vec3f=dpdx(normalVector.xyz);var nDfdy: vec3f=dpdy(normalVector.xyz);var slopeSquare: f32=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));var geometricRoughnessFactor: f32=pow(saturate(slopeSquare),0.333);var geometricAlphaGFactor: f32=sqrt(slopeSquare);geometricAlphaGFactor*=0.75;return vec2f(geometricRoughnessFactor,geometricAlphaGFactor);
#else
return vec2f(0.);
#endif
}
#ifdef ANISOTROPIC
#ifdef ANISOTROPIC_LEGACY
fn getAnisotropicRoughness(alphaG: f32,anisotropy: f32)->vec2f {var alphaT: f32=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);var alphaB: f32=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);return vec2f(alphaT,alphaB);}
fn getAnisotropicBentNormals(T: vec3f,B: vec3f,N: vec3f,V: vec3f,anisotropy: f32,roughness: f32)->vec3f {var anisotropicFrameDirection: vec3f=select(T,B,anisotropy>=0.0);var anisotropicFrameTangent: vec3f=cross(normalize(anisotropicFrameDirection),V);var anisotropicFrameNormal: vec3f=cross(anisotropicFrameTangent,anisotropicFrameDirection);var anisotropicNormal: vec3f=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));return anisotropicNormal;}
#else
fn getAnisotropicRoughness(alphaG: f32,anisotropy: f32)->vec2f {var alphaT: f32=max(mix(alphaG,1.0,anisotropy*anisotropy),MINIMUMVARIANCE);var alphaB: f32=max(alphaG,MINIMUMVARIANCE);return vec2f(alphaT,alphaB);}
fn getAnisotropicBentNormals(T: vec3f,B: vec3f,N: vec3f,V: vec3f,anisotropy: f32,roughness: f32)->vec3f {var bentNormal: vec3f=cross(B,V);bentNormal=normalize(cross(bentNormal,B));var sq=1.0-anisotropy*(1.0-roughness);var a: f32=sq*sq*sq*sq;bentNormal=normalize(mix(bentNormal,N,a));return bentNormal;}
#endif
#endif
#if defined(CLEARCOAT) || defined(SS_REFRACTION)
fn cocaLambertVec3(alpha: vec3f,distance: f32)->vec3f {return exp(-alpha*distance);}
fn cocaLambert(NdotVRefract: f32,NdotLRefract: f32,alpha: vec3f,thickness: f32)->vec3f {return cocaLambertVec3(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));}
fn computeColorAtDistanceInMedia(color: vec3f,distance: f32)->vec3f {return -log(color)/distance;}
fn computeClearCoatAbsorption(NdotVRefract: f32,NdotLRefract: f32,clearCoatColor: vec3f,clearCoatThickness: f32,clearCoatIntensity: f32)->vec3f {var clearCoatAbsorption: vec3f=mix( vec3f(1.0),
cocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),
clearCoatIntensity);return clearCoatAbsorption;}
#endif
#ifdef MICROSURFACEAUTOMATIC
fn computeDefaultMicroSurface(microSurface: f32,reflectivityColor: vec3f)->f32
{const kReflectivityNoAlphaWorkflow_SmoothnessMax: f32=0.95;var reflectivityLuminance: f32=getLuminance(reflectivityColor);var reflectivityLuma: f32=sqrt(reflectivityLuminance);var resultMicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return resultMicroSurface;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrHelperFunctions_name] = pbrHelperFunctions_shader;
/** @internal */
const pbrHelperFunctionsWGSL = { name: pbrHelperFunctions_name, shader: pbrHelperFunctions_shader };
//# sourceMappingURL=pbrHelperFunctions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js
var imageProcessingFunctions = __webpack_require__(88996);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js
var shadowsFragmentFunctions = __webpack_require__(78589);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/harmonicsFunctions.js
var harmonicsFunctions = __webpack_require__(45978);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js
// Do not edit.

const pbrDirectLightingSetupFunctions_name = "pbrDirectLightingSetupFunctions";
const pbrDirectLightingSetupFunctions_shader = `struct preLightingInfo
{lightOffset: vec3f,
lightDistanceSquared: f32,
lightDistance: f32,
attenuation: f32,
L: vec3f,
H: vec3f,
NdotV: f32,
NdotLUnclamped: f32,
NdotL: f32,
VdotH: f32,
roughness: f32,
#ifdef IRIDESCENCE
iridescenceIntensity: f32
#endif
};fn computePointAndSpotPreLightingInfo(lightData: vec4f,V: vec3f,N: vec3f,posW: vec3f)->preLightingInfo {var result: preLightingInfo;result.lightOffset=lightData.xyz-posW;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);result.L=normalize(result.lightOffset);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);return result;}
fn computeDirectionalPreLightingInfo(lightData: vec4f,V: vec3f,N: vec3f)->preLightingInfo {var result: preLightingInfo;result.lightDistance=length(-lightData.xyz);result.L=normalize(-lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);return result;}
fn computeHemisphericPreLightingInfo(lightData: vec4f,V: vec3f,N: vec3f)->preLightingInfo {var result: preLightingInfo;result.NdotL=dot(N,lightData.xyz)*0.5+0.5;result.NdotL=saturateEps(result.NdotL);result.NdotLUnclamped=result.NdotL;
#ifdef SPECULARTERM
result.L=normalize(lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));
#endif
return result;}`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrDirectLightingSetupFunctions_name] = pbrDirectLightingSetupFunctions_shader;
/** @internal */
const pbrDirectLightingSetupFunctionsWGSL = { name: pbrDirectLightingSetupFunctions_name, shader: pbrDirectLightingSetupFunctions_shader };
//# sourceMappingURL=pbrDirectLightingSetupFunctions.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrDirectLightingFalloffFunctions.js
// Do not edit.

const pbrDirectLightingFalloffFunctions_name = "pbrDirectLightingFalloffFunctions";
const pbrDirectLightingFalloffFunctions_shader = `fn computeDistanceLightFalloff_Standard(lightOffset: vec3f,range: f32)->f32
{return max(0.,1.0-length(lightOffset)/range);}
fn computeDistanceLightFalloff_Physical(lightDistanceSquared: f32)->f32
{return 1.0/maxEps(lightDistanceSquared);}
fn computeDistanceLightFalloff_GLTF(lightDistanceSquared: f32,inverseSquaredRange: f32)->f32
{var lightDistanceFalloff: f32=1.0/maxEps(lightDistanceSquared);var factor: f32=lightDistanceSquared*inverseSquaredRange;var attenuation: f32=saturate(1.0-factor*factor);attenuation*=attenuation;lightDistanceFalloff*=attenuation;return lightDistanceFalloff;}
fn computeDistanceLightFalloff(lightOffset: vec3f,lightDistanceSquared: f32,range: f32,inverseSquaredRange: f32)->f32
{
#ifdef USEPHYSICALLIGHTFALLOFF
return computeDistanceLightFalloff_Physical(lightDistanceSquared);
#elif defined(USEGLTFLIGHTFALLOFF)
return computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);
#else
return computeDistanceLightFalloff_Standard(lightOffset,range);
#endif
}
fn computeDirectionalLightFalloff_Standard(lightDirection: vec3f,directionToLightCenterW: vec3f,cosHalfAngle: f32,exponent: f32)->f32
{var falloff: f32=0.0;var cosAngle: f32=maxEps(dot(-lightDirection,directionToLightCenterW));if (cosAngle>=cosHalfAngle)
{falloff=max(0.,pow(cosAngle,exponent));}
return falloff;}
fn computeDirectionalLightFalloff_Physical(lightDirection: vec3f,directionToLightCenterW: vec3f,cosHalfAngle: f32)->f32
{const kMinusLog2ConeAngleIntensityRatio: f32=6.64385618977; 
var concentrationKappa: f32=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);var lightDirectionSpreadSG: vec4f= vec4f(-lightDirection*concentrationKappa,-concentrationKappa);var falloff: f32=exp2(dot( vec4f(directionToLightCenterW,1.0),lightDirectionSpreadSG));return falloff;}
fn computeDirectionalLightFalloff_GLTF(lightDirection: vec3f,directionToLightCenterW: vec3f,lightAngleScale: f32,lightAngleOffset: f32)->f32
{var cd: f32=dot(-lightDirection,directionToLightCenterW);var falloff: f32=saturate(cd*lightAngleScale+lightAngleOffset);falloff*=falloff;return falloff;}
fn computeDirectionalLightFalloff(lightDirection: vec3f,directionToLightCenterW: vec3f,cosHalfAngle: f32,exponent: f32,lightAngleScale: f32,lightAngleOffset: f32)->f32
{
#ifdef USEPHYSICALLIGHTFALLOFF
return computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);
#elif defined(USEGLTFLIGHTFALLOFF)
return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);
#else
return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);
#endif
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrDirectLightingFalloffFunctions_name] = pbrDirectLightingFalloffFunctions_shader;
/** @internal */
const pbrDirectLightingFalloffFunctionsWGSL = { name: pbrDirectLightingFalloffFunctions_name, shader: pbrDirectLightingFalloffFunctions_shader };
//# sourceMappingURL=pbrDirectLightingFalloffFunctions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js
var pbrBRDFFunctions = __webpack_require__(75052);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js
var hdrFilteringFunctions = __webpack_require__(58866);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js
// Do not edit.

const pbrDirectLightingFunctions_name = "pbrDirectLightingFunctions";
const pbrDirectLightingFunctions_shader = `#define CLEARCOATREFLECTANCE90 1.0
struct lightingInfo
{diffuse: vec3f,
#ifdef SPECULARTERM
specular: vec3f,
#endif
#ifdef CLEARCOAT
clearCoat: vec4f,
#endif
#ifdef SHEEN
sheen: vec3f
#endif
};fn adjustRoughnessFromLightProperties(roughness: f32,lightRadius: f32,lightDistance: f32)->f32 {
#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)
var lightRoughness: f32=lightRadius/lightDistance;var totalRoughness: f32=saturate(lightRoughness+roughness);return totalRoughness;
#else
return roughness;
#endif
}
fn computeHemisphericDiffuseLighting(info: preLightingInfo,lightColor: vec3f,groundColor: vec3f)->vec3f {return mix(groundColor,lightColor,info.NdotL);}
fn computeDiffuseLighting(info: preLightingInfo,lightColor: vec3f)->vec3f {var diffuseTerm: f32=diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness);return diffuseTerm*info.attenuation*info.NdotL*lightColor;}
fn computeProjectionTextureDiffuseLighting(projectionLightTexture: texture_2d<f32>,projectionLightSampler: sampler,textureProjectionMatrix: mat4x4f,posW: vec3f)->vec3f{var strq: vec4f=textureProjectionMatrix* vec4f(posW,1.0);strq/=strq.w;var textureColor: vec3f=textureSample(projectionLightTexture,projectionLightSampler,strq.xy).rgb;return toLinearSpaceVec3(textureColor);}
#ifdef SS_TRANSLUCENCY
fn computeDiffuseAndTransmittedLighting(info: preLightingInfo,lightColor: vec3f,transmittance: vec3f)->vec3f {var NdotL: f32=absEps(info.NdotLUnclamped);var wrapNdotL: f32=computeWrappedDiffuseNdotL(NdotL,0.02);var trAdapt: f32=step(0.,info.NdotLUnclamped);var transmittanceNdotL: vec3f=mix(transmittance*wrapNdotL, vec3f(wrapNdotL),trAdapt);var diffuseTerm: f32=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);return diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;}
#endif
#ifdef SPECULARTERM
fn computeSpecularLighting(info: preLightingInfo,N: vec3f,reflectance0: vec3f,reflectance90: vec3f,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var roughness: f32=max(info.roughness,geometricRoughnessFactor);var alphaG: f32=convertRoughnessToAverageSlope(roughness);var fresnel: vec3f=fresnelSchlickGGXVec3(info.VdotH,reflectance0,reflectance90);
#ifdef IRIDESCENCE
fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
#endif
var distribution: f32=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);
#ifdef BRDF_V_HEIGHT_CORRELATED
var smithVisibility: f32=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);
#else
var smithVisibility: f32=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);
#endif
var specTerm: vec3f=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}
#endif
#ifdef ANISOTROPIC
fn computeAnisotropicSpecularLighting(info: preLightingInfo,V: vec3f,N: vec3f,T: vec3f,B: vec3f,anisotropy: f32,reflectance0: vec3f,reflectance90: vec3f,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var TdotH: f32=dot(T,info.H);var BdotH: f32=dot(B,info.H);var TdotV: f32=dot(T,V);var BdotV: f32=dot(B,V);var TdotL: f32=dot(T,info.L);var BdotL: f32=dot(B,info.L);var alphaG: f32=convertRoughnessToAverageSlope(info.roughness);var alphaTB: vec2f=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,vec2f(geometricRoughnessFactor*geometricRoughnessFactor));var fresnel: vec3f=fresnelSchlickGGXVec3(info.VdotH,reflectance0,reflectance90);
#ifdef IRIDESCENCE
fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
#endif
var distribution: f32=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);var smithVisibility: f32=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);var specTerm: vec3f=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}
#endif
#ifdef CLEARCOAT
fn computeClearCoatLighting(info: preLightingInfo,Ncc: vec3f,geometricRoughnessFactor: f32,clearCoatIntensity: f32,lightColor: vec3f)->vec4f {var NccdotL: f32=saturateEps(dot(Ncc,info.L));var NccdotH: f32=saturateEps(dot(Ncc,info.H));var clearCoatRoughness: f32=max(info.roughness,geometricRoughnessFactor);var alphaG: f32=convertRoughnessToAverageSlope(clearCoatRoughness);var fresnel: f32=fresnelSchlickGGX(info.VdotH,uniforms.vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnel*=clearCoatIntensity;var distribution: f32=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);var kelemenVisibility: f32=visibility_Kelemen(info.VdotH);var clearCoatTerm: f32=fresnel*distribution*kelemenVisibility;return vec4f(
clearCoatTerm*info.attenuation*NccdotL*lightColor,
1.0-fresnel
);}
fn computeClearCoatLightingAbsorption(NdotVRefract: f32,L: vec3f,Ncc: vec3f,clearCoatColor: vec3f,clearCoatThickness: f32,clearCoatIntensity: f32)->vec3f {var LRefract: vec3f=-refract(L,Ncc,uniforms.vClearCoatRefractionParams.y);var NdotLRefract: f32=saturateEps(dot(Ncc,LRefract));var absorption: vec3f=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);return absorption;}
#endif
#ifdef SHEEN
fn computeSheenLighting(info: preLightingInfo,N: vec3f,reflectance0: vec3f,reflectance90: vec3f,geometricRoughnessFactor: f32,lightColor: vec3f)->vec3f {var NdotH: f32=saturateEps(dot(N,info.H));var roughness: f32=max(info.roughness,geometricRoughnessFactor);var alphaG: f32=convertRoughnessToAverageSlope(roughness);var fresnel: f32=1.;var distribution: f32=normalDistributionFunction_CharlieSheen(NdotH,alphaG);/*#ifdef SHEEN_SOFTER
var visibility: f32=visibility_CharlieSheen(info.NdotL,info.NdotV,alphaG);
#else */
var visibility: f32=visibility_Ashikhmin(info.NdotL,info.NdotV);/* #endif */
var sheenTerm: f32=fresnel*distribution*visibility;return sheenTerm*info.attenuation*info.NdotL*lightColor;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrDirectLightingFunctions_name] = pbrDirectLightingFunctions_shader;
/** @internal */
const pbrDirectLightingFunctionsWGSL = { name: pbrDirectLightingFunctions_name, shader: pbrDirectLightingFunctions_shader };
//# sourceMappingURL=pbrDirectLightingFunctions.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js
// Do not edit.

const pbrIBLFunctions_name = "pbrIBLFunctions";
const pbrIBLFunctions_shader = `#if defined(REFLECTION) || defined(SS_REFRACTION)
fn getLodFromAlphaG(cubeMapDimensionPixels: f32,microsurfaceAverageSlope: f32)->f32 {var microsurfaceAverageSlopeTexels: f32=cubeMapDimensionPixels*microsurfaceAverageSlope;var lod: f32=log2(microsurfaceAverageSlopeTexels);return lod;}
fn getLinearLodFromRoughness(cubeMapDimensionPixels: f32,roughness: f32)->f32 {var lod: f32=log2(cubeMapDimensionPixels)*roughness;return lod;}
#endif
#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)
fn environmentRadianceOcclusion(ambientOcclusion: f32,NdotVUnclamped: f32)->f32 {var temp: f32=NdotVUnclamped+ambientOcclusion;return saturate(temp*temp-1.0+ambientOcclusion);}
#endif
#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)
fn environmentHorizonOcclusion(view: vec3f,normal: vec3f,geometricNormal: vec3f)->f32 {var reflection: vec3f=reflect(view,normal);var temp: f32=saturate(1.0+1.1*dot(reflection,geometricNormal));return temp*temp;}
#endif
#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)
fn UNPACK_LOD(x: f32)->f32 {return (1.0-x)*255.0;}
fn getLodFromAlphaGNdotV(cubeMapDimensionPixels: f32,alphaG: f32,NdotV: f32)->f32 {var microsurfaceAverageSlope: f32=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrIBLFunctions_name] = pbrIBLFunctions_shader;
/** @internal */
const pbrIBLFunctionsWGSL = { name: pbrIBLFunctions_name, shader: pbrIBLFunctions_shader };
//# sourceMappingURL=pbrIBLFunctions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js
var bumpFragmentMainFunctions = __webpack_require__(15697);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bumpFragmentFunctions.js
var bumpFragmentFunctions = __webpack_require__(91258);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/reflectionFunction.js
var reflectionFunction = __webpack_require__(72230);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/decalFragment.js
var decalFragment = __webpack_require__(49306);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockAlbedoOpacity.js
// Do not edit.


const pbrBlockAlbedoOpacity_name = "pbrBlockAlbedoOpacity";
const pbrBlockAlbedoOpacity_shader = `struct albedoOpacityOutParams
{surfaceAlbedo: vec3f,
alpha: f32};
#define pbr_inline
fn albedoOpacityBlock(
vAlbedoColor: vec4f
#ifdef ALBEDO
,albedoTexture: vec4f
,albedoInfos: vec2f
#endif
#ifdef OPACITY
,opacityMap: vec4f
,vOpacityInfos: vec2f
#endif
#ifdef DETAIL
,detailColor: vec4f
,vDetailInfos: vec4f
#endif
#ifdef DECAL
,decalColor: vec4f
,vDecalInfos: vec4f
#endif
)->albedoOpacityOutParams
{var outParams: albedoOpacityOutParams;var surfaceAlbedo: vec3f=vAlbedoColor.rgb;var alpha: f32=vAlbedoColor.a;
#ifdef ALBEDO
#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)
alpha*=albedoTexture.a;
#endif
#ifdef GAMMAALBEDO
surfaceAlbedo*=toLinearSpaceVec3(albedoTexture.rgb);
#else
surfaceAlbedo*=albedoTexture.rgb;
#endif
surfaceAlbedo*=albedoInfos.y;
#endif
#ifndef DECAL_AFTER_DETAIL
#include<decalFragment>
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
surfaceAlbedo*=fragmentInputs.vColor.rgb;
#endif
#ifdef DETAIL
var detailAlbedo: f32=2.0*mix(0.5,detailColor.r,vDetailInfos.y);surfaceAlbedo=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo; 
#endif
#ifdef DECAL_AFTER_DETAIL
#include<decalFragment>
#endif
#define CUSTOM_FRAGMENT_UPDATE_ALBEDO
#ifdef OPACITY
#ifdef OPACITYRGB
alpha=getLuminance(opacityMap.rgb);
#else
alpha*=opacityMap.a;
#endif
alpha*=vOpacityInfos.y;
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=fragmentInputs.vColor.a;
#endif
#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)
#ifdef ALPHATEST 
#if DEBUGMODE != 88
if (alpha<ALPHATESTVALUE) {discard;}
#endif
#ifndef ALPHABLEND
alpha=1.0;
#endif
#endif
#endif
outParams.surfaceAlbedo=surfaceAlbedo;outParams.alpha=alpha;return outParams;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockAlbedoOpacity_name] = pbrBlockAlbedoOpacity_shader;
/** @internal */
const pbrBlockAlbedoOpacityWGSL = { name: pbrBlockAlbedoOpacity_name, shader: pbrBlockAlbedoOpacity_shader };
//# sourceMappingURL=pbrBlockAlbedoOpacity.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js
// Do not edit.

const pbrBlockReflectivity_name = "pbrBlockReflectivity";
const pbrBlockReflectivity_shader = `struct reflectivityOutParams
{microSurface: f32,
roughness: f32,
surfaceReflectivityColor: vec3f,
#ifdef METALLICWORKFLOW
surfaceAlbedo: vec3f,
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
ambientOcclusionColor: vec3f,
#endif
#if DEBUGMODE>0
#ifdef METALLICWORKFLOW
metallicRoughness: vec2f,
#ifdef REFLECTIVITY
surfaceMetallicColorMap: vec4f,
#endif
#ifndef FROSTBITE_REFLECTANCE
metallicF0: vec3f,
#endif
#else
#ifdef REFLECTIVITY
surfaceReflectivityColorMap: vec4f,
#endif
#endif
#endif
};
#define pbr_inline
fn reflectivityBlock(
vReflectivityColor: vec4f
#ifdef METALLICWORKFLOW
,surfaceAlbedo: vec3f
,metallicReflectanceFactors: vec4f
#endif
#ifdef REFLECTIVITY
,reflectivityInfos: vec3f
,surfaceMetallicOrReflectivityColorMap: vec4f
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
,ambientOcclusionColorIn: vec3f
#endif
#ifdef MICROSURFACEMAP
,microSurfaceTexel: vec4f
#endif
#ifdef DETAIL
,detailColor: vec4f
,vDetailInfos: vec4f
#endif
)->reflectivityOutParams
{var outParams: reflectivityOutParams;var microSurface: f32=vReflectivityColor.a;var surfaceReflectivityColor: vec3f=vReflectivityColor.rgb;
#ifdef METALLICWORKFLOW
var metallicRoughness: vec2f=surfaceReflectivityColor.rg;
#ifdef REFLECTIVITY
#if DEBUGMODE>0
outParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;
#endif
#ifdef AOSTOREINMETALMAPRED
var aoStoreInMetalMap: vec3f= vec3f(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);outParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);
#endif
#ifdef METALLNESSSTOREINMETALMAPBLUE
metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;
#else
metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;
#endif
#ifdef ROUGHNESSSTOREINMETALMAPALPHA
metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;
#else
#ifdef ROUGHNESSSTOREINMETALMAPGREEN
metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;
#endif
#endif
#endif
#ifdef DETAIL
var detailRoughness: f32=mix(0.5,detailColor.b,vDetailInfos.w);var loLerp: f32=mix(0.,metallicRoughness.g,detailRoughness*2.);var hiLerp: f32=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);metallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));
#endif
#ifdef MICROSURFACEMAP
metallicRoughness.g*=microSurfaceTexel.r;
#endif
#if DEBUGMODE>0
outParams.metallicRoughness=metallicRoughness;
#endif
#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS
microSurface=1.0-metallicRoughness.g;var baseColor: vec3f=surfaceAlbedo;
#ifdef FROSTBITE_REFLECTANCE
outParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);surfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);
#else
var metallicF0: vec3f=metallicReflectanceFactors.rgb;
#if DEBUGMODE>0
outParams.metallicF0=metallicF0;
#endif
outParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0), vec3f(0.,0.,0.),metallicRoughness.r);surfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);
#endif
#else
#ifdef REFLECTIVITY
surfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;
#if DEBUGMODE>0
outParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;
#endif
#ifdef MICROSURFACEFROMREFLECTIVITYMAP
microSurface*=surfaceMetallicOrReflectivityColorMap.a;microSurface*=reflectivityInfos.z;
#else
#ifdef MICROSURFACEAUTOMATIC
microSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);
#endif
#ifdef MICROSURFACEMAP
microSurface*=microSurfaceTexel.r;
#endif
#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE
#endif
#endif
#endif
microSurface=saturate(microSurface);var roughness: f32=1.-microSurface;outParams.microSurface=microSurface;outParams.roughness=roughness;outParams.surfaceReflectivityColor=surfaceReflectivityColor;return outParams;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockReflectivity_name] = pbrBlockReflectivity_shader;
/** @internal */
const pbrBlockReflectivityWGSL = { name: pbrBlockReflectivity_name, shader: pbrBlockReflectivity_shader };
//# sourceMappingURL=pbrBlockReflectivity.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockAmbientOcclusion.js
// Do not edit.

const pbrBlockAmbientOcclusion_name = "pbrBlockAmbientOcclusion";
const pbrBlockAmbientOcclusion_shader = `struct ambientOcclusionOutParams
{ambientOcclusionColor: vec3f,
#if DEBUGMODE>0 && defined(AMBIENT)
ambientOcclusionColorMap: vec3f
#endif
};
#define pbr_inline
fn ambientOcclusionBlock(
#ifdef AMBIENT
ambientOcclusionColorMap_: vec3f,
vAmbientInfos: vec4f
#endif
)->ambientOcclusionOutParams
{ 
var outParams: ambientOcclusionOutParams;var ambientOcclusionColor: vec3f= vec3f(1.,1.,1.);
#ifdef AMBIENT
var ambientOcclusionColorMap: vec3f=ambientOcclusionColorMap_*vAmbientInfos.y;
#ifdef AMBIENTINGRAYSCALE
ambientOcclusionColorMap= vec3f(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);
#endif
ambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);
#if DEBUGMODE>0
outParams.ambientOcclusionColorMap=ambientOcclusionColorMap;
#endif
#endif
outParams.ambientOcclusionColor=ambientOcclusionColor;return outParams;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockAmbientOcclusion_name] = pbrBlockAmbientOcclusion_shader;
/** @internal */
const pbrBlockAmbientOcclusionWGSL = { name: pbrBlockAmbientOcclusion_name, shader: pbrBlockAmbientOcclusion_shader };
//# sourceMappingURL=pbrBlockAmbientOcclusion.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockAlphaFresnel.js
// Do not edit.

const pbrBlockAlphaFresnel_name = "pbrBlockAlphaFresnel";
const pbrBlockAlphaFresnel_shader = `#ifdef ALPHAFRESNEL
#if defined(ALPHATEST) || defined(ALPHABLEND)
struct alphaFresnelOutParams
{alpha: f32};fn faceforward(N: vec3<f32>,I: vec3<f32>,Nref: vec3<f32>)->vec3<f32> {return select(N,-N,dot(Nref,I)>0.0);}
#define pbr_inline
fn alphaFresnelBlock(
normalW: vec3f,
viewDirectionW: vec3f,
alpha: f32,
microSurface: f32
)->alphaFresnelOutParams
{var outParams: alphaFresnelOutParams;var opacityPerceptual: f32=alpha;
#ifdef LINEARALPHAFRESNEL
var opacity0: f32=opacityPerceptual;
#else
var opacity0: f32=opacityPerceptual*opacityPerceptual;
#endif
var opacity90: f32=fresnelGrazingReflectance(opacity0);var normalForward: vec3f=faceforward(normalW,-viewDirectionW,normalW);outParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)), vec3f(opacity0), vec3f(opacity90),sqrt(microSurface)).x;
#ifdef ALPHATEST
if (outParams.alpha<ALPHATESTVALUE) {discard;}
#ifndef ALPHABLEND
outParams.alpha=1.0;
#endif
#endif
return outParams;}
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockAlphaFresnel_name] = pbrBlockAlphaFresnel_shader;
/** @internal */
const pbrBlockAlphaFresnelWGSL = { name: pbrBlockAlphaFresnel_name, shader: pbrBlockAlphaFresnel_shader };
//# sourceMappingURL=pbrBlockAlphaFresnel.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockAnisotropic.js
// Do not edit.

const pbrBlockAnisotropic_name = "pbrBlockAnisotropic";
const pbrBlockAnisotropic_shader = `#ifdef ANISOTROPIC
struct anisotropicOutParams
{anisotropy: f32,
anisotropicTangent: vec3f,
anisotropicBitangent: vec3f,
anisotropicNormal: vec3f,
#if DEBUGMODE>0 && defined(ANISOTROPIC_TEXTURE)
anisotropyMapData: vec3f
#endif
};
#define pbr_inline
fn anisotropicBlock(
vAnisotropy: vec3f,
roughness: f32,
#ifdef ANISOTROPIC_TEXTURE
anisotropyMapData: vec3f,
#endif
TBN: mat3x3f,
normalW: vec3f,
viewDirectionW: vec3f
)->anisotropicOutParams
{ 
var outParams: anisotropicOutParams;var anisotropy: f32=vAnisotropy.b;var anisotropyDirection: vec3f= vec3f(vAnisotropy.xy,0.);
#ifdef ANISOTROPIC_TEXTURE
var amd=anisotropyMapData.rg;anisotropy*=anisotropyMapData.b;
#if DEBUGMODE>0
outParams.anisotropyMapData=anisotropyMapData;
#endif
amd=amd*2.0-1.0;
#ifdef ANISOTROPIC_LEGACY
anisotropyDirection=vec3f(anisotropyDirection.xy*amd,anisotropyDirection.z);
#else
anisotropyDirection=vec3f(mat2x2f(anisotropyDirection.x,anisotropyDirection.y,-anisotropyDirection.y,anisotropyDirection.x)*normalize(amd),anisotropyDirection.z);
#endif
#endif
var anisoTBN: mat3x3f= mat3x3f(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));var anisotropicTangent: vec3f=normalize(anisoTBN*anisotropyDirection);var anisotropicBitangent: vec3f=normalize(cross(anisoTBN[2],anisotropicTangent));outParams.anisotropy=anisotropy;outParams.anisotropicTangent=anisotropicTangent;outParams.anisotropicBitangent=anisotropicBitangent;outParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy,roughness);return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockAnisotropic_name] = pbrBlockAnisotropic_shader;
/** @internal */
const pbrBlockAnisotropicWGSL = { name: pbrBlockAnisotropic_name, shader: pbrBlockAnisotropic_shader };
//# sourceMappingURL=pbrBlockAnisotropic.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockReflection.js
// Do not edit.

const pbrBlockReflection_name = "pbrBlockReflection";
const pbrBlockReflection_shader = `#ifdef REFLECTION
struct reflectionOutParams
{environmentRadiance: vec4f
,environmentIrradiance: vec3f
#ifdef REFLECTIONMAP_3D
,reflectionCoords: vec3f
#else
,reflectionCoords: vec2f
#endif
#ifdef SS_TRANSLUCENCY
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
,irradianceVector: vec3f
#endif
#endif
#endif
};
#define pbr_inline
#ifdef REFLECTIONMAP_3D
fn createReflectionCoords(
vPositionW: vec3f,
normalW: vec3f,
#ifdef ANISOTROPIC
anisotropicOut: anisotropicOutParams,
#endif
)->vec3f
{var reflectionCoords: vec3f;
#else
fn createReflectionCoords(
vPositionW: vec3f,
normalW: vec3f,
#ifdef ANISOTROPIC
anisotropicOut: anisotropicOutParams,
#endif
)->vec2f
{ 
var reflectionCoords: vec2f;
#endif
#ifdef ANISOTROPIC
var reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),anisotropicOut.anisotropicNormal);
#else
var reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),normalW);
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
reflectionCoords=reflectionVector;
#else
reflectionCoords=reflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
reflectionCoords/=reflectionVector.z;
#endif
reflectionCoords.y=1.0-reflectionCoords.y;
#endif
return reflectionCoords;}
#define pbr_inline
fn sampleReflectionTexture(
alphaG: f32
,vReflectionMicrosurfaceInfos: vec3f
,vReflectionInfos: vec2f
,vReflectionColor: vec3f
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
,NdotVUnclamped: f32
#endif
#ifdef LINEARSPECULARREFLECTION
,roughness: f32
#endif
#ifdef REFLECTIONMAP_3D
,reflectionSampler: texture_cube<f32>
,reflectionSamplerSampler: sampler
,reflectionCoords: vec3f
#else
,reflectionSampler: texture_2d<f32>
,reflectionSamplerSampler: sampler
,reflectionCoords: vec2f
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
,reflectionLowSampler: texture_cube<f32>
,reflectionLowSamplerSampler: sampler
,reflectionHighSampler: texture_cube<f32>
,reflectionHighSamplerSampler: sampler
#else
,reflectionLowSampler: texture_2d<f32>
,reflectionLowSamplerSampler: sampler
,reflectionHighSampler: texture_2d<f32>
,reflectionHighSamplerSampler: sampler
#endif
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo: vec2f
#endif 
)->vec4f
{var environmentRadiance: vec4f;
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
var reflectionLOD: f32=getLodFromAlphaGNdotV(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);
#elif defined(LINEARSPECULARREFLECTION)
var reflectionLOD: f32=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);
#else
var reflectionLOD: f32=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);
#endif
#ifdef LODBASEDMICROSFURACE
reflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;
#ifdef LODINREFLECTIONALPHA
var automaticReflectionLOD: f32=UNPACK_LOD(textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords).a);var requestedReflectionLOD: f32=max(automaticReflectionLOD,reflectionLOD);
#else
var requestedReflectionLOD: f32=reflectionLOD;
#endif
#ifdef REALTIME_FILTERING
environmentRadiance= vec4f(radiance(alphaG,reflectionSampler,reflectionSamplerSampler,reflectionCoords,vReflectionFilteringInfo),1.0);
#else
environmentRadiance=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD);
#endif
#else
var lodReflectionNormalized: f32=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));var lodReflectionNormalizedDoubled: f32=lodReflectionNormalized*2.0;var environmentMid: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix(
textureSample(reflectionHighSampler,reflectionHighSamplerSampler,reflectionCoords),
environmentMid,
lodReflectionNormalizedDoubled
);} else {environmentRadiance=mix(
environmentMid,
textureSample(reflectionLowSampler,reflectionLowSamplerSampler,reflectionCoords),
lodReflectionNormalizedDoubled-1.0
);}
#endif
var envRadiance=environmentRadiance.rgb;
#ifdef RGBDREFLECTION
envRadiance=fromRGBD(environmentRadiance);
#endif
#ifdef GAMMAREFLECTION
envRadiance=toLinearSpaceVec3(environmentRadiance.rgb);
#endif
envRadiance*=vReflectionInfos.x;envRadiance*=vReflectionColor.rgb;return vec4f(envRadiance,environmentRadiance.a);}
#define pbr_inline
fn reflectionBlock(
vPositionW: vec3f
,normalW: vec3f
,alphaG: f32
,vReflectionMicrosurfaceInfos: vec3f
,vReflectionInfos: vec2f
,vReflectionColor: vec3f
#ifdef ANISOTROPIC
,anisotropicOut: anisotropicOutParams
#endif
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
,NdotVUnclamped: f32
#endif
#ifdef LINEARSPECULARREFLECTION
,roughness: f32
#endif
#ifdef REFLECTIONMAP_3D
,reflectionSampler: texture_cube<f32>
,reflectionSamplerSampler: sampler
#else
,reflectionSampler: texture_2d<f32>
,reflectionSamplerSampler: sampler
#endif
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
,vEnvironmentIrradiance: vec3f
#endif
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
,reflectionMatrix: mat4x4f
#endif
#endif
#ifdef USEIRRADIANCEMAP
#ifdef REFLECTIONMAP_3D
,irradianceSampler: texture_cube<f32>
,irradianceSamplerSampler: sampler 
#else
,irradianceSampler: texture_2d<f32>
,irradianceSamplerSampler: sampler 
#endif
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
,reflectionLowSampler: texture_cube<f32>
,reflectionLowSamplerSampler: sampler 
,reflectionHighSampler: texture_cube<f32>
,reflectionHighSamplerSampler: sampler 
#else
,reflectionLowSampler: texture_2d<f32>
,reflectionLowSamplerSampler: sampler 
,reflectionHighSampler: texture_2d<f32>
,reflectionHighSamplerSampler: sampler 
#endif
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo: vec2f
#endif
)->reflectionOutParams
{var outParams: reflectionOutParams;var environmentRadiance: vec4f= vec4f(0.,0.,0.,0.);
#ifdef REFLECTIONMAP_3D
var reflectionCoords: vec3f= vec3f(0.);
#else
var reflectionCoords: vec2f= vec2f(0.);
#endif
reflectionCoords=createReflectionCoords(
vPositionW,
normalW,
#ifdef ANISOTROPIC
anisotropicOut,
#endif 
);environmentRadiance=sampleReflectionTexture(
alphaG
,vReflectionMicrosurfaceInfos
,vReflectionInfos
,vReflectionColor
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
,NdotVUnclamped
#endif
#ifdef LINEARSPECULARREFLECTION
,roughness
#endif
#ifdef REFLECTIONMAP_3D
,reflectionSampler
,reflectionSamplerSampler
,reflectionCoords
#else
,reflectionSampler
,reflectionSamplerSampler
,reflectionCoords
#endif
#ifndef LODBASEDMICROSFURACE
,reflectionLowSampler
,reflectionLowSamplerSampler
,reflectionHighSampler
,reflectionHighSamplerSampler
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo
#endif 
);var environmentIrradiance: vec3f= vec3f(0.,0.,0.);
#ifdef USESPHERICALFROMREFLECTIONMAP
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
environmentIrradiance=vEnvironmentIrradiance;
#else
#ifdef ANISOTROPIC
var irradianceVector: vec3f= (reflectionMatrix* vec4f(anisotropicOut.anisotropicNormal,0)).xyz;
#else
var irradianceVector: vec3f= (reflectionMatrix* vec4f(normalW,0)).xyz;
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
irradianceVector.z*=-1.0;
#endif
#ifdef INVERTCUBICMAP
irradianceVector.y*=-1.0;
#endif
#if defined(REALTIME_FILTERING)
environmentIrradiance=irradiance(reflectionSampler,reflectionSamplerSampler,irradianceVector,vReflectionFilteringInfo);
#else
environmentIrradiance=computeEnvironmentIrradiance(irradianceVector);
#endif
#ifdef SS_TRANSLUCENCY
outParams.irradianceVector=irradianceVector;
#endif
#endif
#elif defined(USEIRRADIANCEMAP)
var environmentIrradiance4: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,reflectionCoords);environmentIrradiance=environmentIrradiance4.rgb;
#ifdef RGBDREFLECTION
environmentIrradiance=fromRGBD(environmentIrradiance4);
#endif
#ifdef GAMMAREFLECTION
environmentIrradiance=toLinearSpaceVec3(environmentIrradiance.rgb);
#endif
#endif
environmentIrradiance*=vReflectionColor.rgb;outParams.environmentRadiance=environmentRadiance;outParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockReflection_name] = pbrBlockReflection_shader;
/** @internal */
const pbrBlockReflectionWGSL = { name: pbrBlockReflection_name, shader: pbrBlockReflection_shader };
//# sourceMappingURL=pbrBlockReflection.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockSheen.js
// Do not edit.

const pbrBlockSheen_name = "pbrBlockSheen";
const pbrBlockSheen_shader = `#ifdef SHEEN
struct sheenOutParams
{sheenIntensity: f32
,sheenColor: vec3f
,sheenRoughness: f32
#ifdef SHEEN_LINKWITHALBEDO
,surfaceAlbedo: vec3f
#endif
#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
,sheenAlbedoScaling: f32
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
,finalSheenRadianceScaled: vec3f
#endif
#if DEBUGMODE>0
#ifdef SHEEN_TEXTURE
,sheenMapData: vec4f
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
,sheenEnvironmentReflectance: vec3f
#endif
#endif
};
#define pbr_inline
fn sheenBlock(
vSheenColor: vec4f
#ifdef SHEEN_ROUGHNESS
,vSheenRoughness: f32
#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
,sheenMapRoughnessData: vec4f
#endif
#endif
,roughness: f32
#ifdef SHEEN_TEXTURE
,sheenMapData: vec4f
,sheenMapLevel: f32
#endif
,reflectance: f32
#ifdef SHEEN_LINKWITHALBEDO
,baseColor: vec3f
,surfaceAlbedo: vec3f
#endif
#ifdef ENVIRONMENTBRDF
,NdotV: f32
,environmentBrdf: vec3f
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
,AARoughnessFactors: vec2f
,vReflectionMicrosurfaceInfos: vec3f
,vReflectionInfos: vec2f
,vReflectionColor: vec3f
,vLightingIntensity: vec4f
#ifdef REFLECTIONMAP_3D
,reflectionSampler: texture_cube<f32>
,reflectionSamplerSampler: sampler
,reflectionCoords: vec3f
#else
,reflectionSampler: texture_2d<f32>
,reflectionSamplerSampler: sampler
,reflectionCoords: vec2f
#endif
,NdotVUnclamped: f32
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
,reflectionLowSampler: texture_cube<f32>
,reflectionLowSamplerSampler: sampler 
,reflectionHighSampler: texture_cube<f32>
,reflectionHighSamplerSampler: sampler 
#else
,reflectionLowSampler: texture_2d<f32>
,reflectionLowSamplerSampler: sampler 
,reflectionHighSampler: texture_2d<f32>
,reflectionHighSamplerSampler: sampler 
#endif
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo: vec2f
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
,seo: f32
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
,eho: f32
#endif
#endif
)->sheenOutParams
{var outParams: sheenOutParams;var sheenIntensity: f32=vSheenColor.a;
#ifdef SHEEN_TEXTURE
#if DEBUGMODE>0
outParams.sheenMapData=sheenMapData;
#endif
#endif
#ifdef SHEEN_LINKWITHALBEDO
var sheenFactor: f32=pow5(1.0-sheenIntensity);var sheenColor: vec3f=baseColor.rgb*(1.0-sheenFactor);var sheenRoughness: f32=sheenIntensity;outParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;
#ifdef SHEEN_TEXTURE
sheenIntensity*=sheenMapData.a;
#endif
#else
var sheenColor: vec3f=vSheenColor.rgb;
#ifdef SHEEN_TEXTURE
#ifdef SHEEN_GAMMATEXTURE
sheenColor*=toLinearSpaceVec3(sheenMapData.rgb);
#else
sheenColor*=sheenMapData.rgb;
#endif
sheenColor*=sheenMapLevel;
#endif
#ifdef SHEEN_ROUGHNESS
var sheenRoughness: f32=vSheenRoughness;
#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE
#if defined(SHEEN_TEXTURE)
sheenRoughness*=sheenMapData.a;
#endif
#elif defined(SHEEN_TEXTURE_ROUGHNESS)
sheenRoughness*=sheenMapRoughnessData.a;
#endif
#else
var sheenRoughness: f32=roughness;
#ifdef SHEEN_TEXTURE
sheenIntensity*=sheenMapData.a;
#endif
#endif
#if !defined(SHEEN_ALBEDOSCALING)
sheenIntensity*=(1.-reflectance);
#endif
sheenColor*=sheenIntensity;
#endif
#ifdef ENVIRONMENTBRDF
/*#ifdef SHEEN_SOFTER
var environmentSheenBrdf: vec3f= vec3f(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness));
#else*/
#ifdef SHEEN_ROUGHNESS
var environmentSheenBrdf: vec3f=getBRDFLookup(NdotV,sheenRoughness);
#else
var environmentSheenBrdf: vec3f=environmentBrdf;
#endif
/*#endif*/
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
var sheenAlphaG: f32=convertRoughnessToAverageSlope(sheenRoughness);
#ifdef SPECULARAA
sheenAlphaG+=AARoughnessFactors.y;
#endif
var environmentSheenRadiance: vec4f= vec4f(0.,0.,0.,0.);environmentSheenRadiance=sampleReflectionTexture(
sheenAlphaG
,vReflectionMicrosurfaceInfos
,vReflectionInfos
,vReflectionColor
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
,NdotVUnclamped
#endif
#ifdef LINEARSPECULARREFLECTION
,sheenRoughness
#endif
,reflectionSampler
,reflectionSamplerSampler
,reflectionCoords
#ifndef LODBASEDMICROSFURACE
,reflectionLowSampler
,reflectionLowSamplerSampler
,reflectionHighSampler
,reflectionHighSamplerSampler
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo
#endif
);var sheenEnvironmentReflectance: vec3f=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
sheenEnvironmentReflectance*=seo;
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
sheenEnvironmentReflectance*=eho;
#endif
#if DEBUGMODE>0
outParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;
#endif
outParams.finalSheenRadianceScaled=
environmentSheenRadiance.rgb *
sheenEnvironmentReflectance *
vLightingIntensity.z;
#endif
#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
outParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;
#endif
outParams.sheenIntensity=sheenIntensity;outParams.sheenColor=sheenColor;outParams.sheenRoughness=sheenRoughness;return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockSheen_name] = pbrBlockSheen_shader;
/** @internal */
const pbrBlockSheenWGSL = { name: pbrBlockSheen_name, shader: pbrBlockSheen_shader };
//# sourceMappingURL=pbrBlockSheen.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockClearcoat.js
// Do not edit.

const pbrBlockClearcoat_name = "pbrBlockClearcoat";
const pbrBlockClearcoat_shader = `struct clearcoatOutParams
{specularEnvironmentR0: vec3f,
conservationFactor: f32,
clearCoatNormalW: vec3f,
clearCoatAARoughnessFactors: vec2f,
clearCoatIntensity: f32,
clearCoatRoughness: f32,
#ifdef REFLECTION
finalClearCoatRadianceScaled: vec3f,
#endif
#ifdef CLEARCOAT_TINT
absorption: vec3f,
clearCoatNdotVRefract: f32,
clearCoatColor: vec3f,
clearCoatThickness: f32,
#endif
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
energyConservationFactorClearCoat: vec3f,
#endif
#if DEBUGMODE>0
#ifdef CLEARCOAT_BUMP
TBNClearCoat: mat3x3f,
#endif
#ifdef CLEARCOAT_TEXTURE
clearCoatMapData: vec2f,
#endif
#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
clearCoatTintMapData: vec4f,
#endif
#ifdef REFLECTION
environmentClearCoatRadiance: vec4f,
clearCoatEnvironmentReflectance: vec3f,
#endif
clearCoatNdotV: f32
#endif
};
#ifdef CLEARCOAT
#define pbr_inline
fn clearcoatBlock(
vPositionW: vec3f
,geometricNormalW: vec3f
,viewDirectionW: vec3f
,vClearCoatParams: vec2f
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
,clearCoatMapRoughnessData: vec4f
#endif
,specularEnvironmentR0: vec3f
#ifdef CLEARCOAT_TEXTURE
,clearCoatMapData: vec2f
#endif
#ifdef CLEARCOAT_TINT
,vClearCoatTintParams: vec4f
,clearCoatColorAtDistance: f32
,vClearCoatRefractionParams: vec4f
#ifdef CLEARCOAT_TINT_TEXTURE
,clearCoatTintMapData: vec4f
#endif
#endif
#ifdef CLEARCOAT_BUMP
,vClearCoatBumpInfos: vec2f
,clearCoatBumpMapData: vec4f
,vClearCoatBumpUV: vec2f
#if defined(TANGENT) && defined(NORMAL)
,vTBN: mat3x3f
#else
,vClearCoatTangentSpaceParams: vec2f
#endif
#ifdef OBJECTSPACE_NORMALMAP
,normalMatrix: mat4x4f
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
,faceNormal: vec3f
#endif
#ifdef REFLECTION
,vReflectionMicrosurfaceInfos: vec3f
,vReflectionInfos: vec2f
,vReflectionColor: vec3f
,vLightingIntensity: vec4f
#ifdef REFLECTIONMAP_3D
,reflectionSampler: texture_cube<f32>
,reflectionSamplerSampler: sampler
#else
,reflectionSampler: texture_2d<f32>
,reflectionSamplerSampler: sampler
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
,reflectionLowSampler: texture_cube<f32>
,reflectionLowSamplerSampler: sampler 
,reflectionHighSampler: texture_cube<f32>
,reflectionHighSamplerSampler: sampler 
#else
,reflectionLowSampler: texture_2d<f32>
,reflectionLowSamplerSampler: sampler 
,reflectionHighSampler: texture_2d<f32>
,reflectionHighSamplerSampler: sampler 
#endif
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo: vec2f
#endif
#endif
#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
,frontFacingMultiplier: f32
#endif 
)->clearcoatOutParams
{var outParams: clearcoatOutParams;var clearCoatIntensity: f32=vClearCoatParams.x;var clearCoatRoughness: f32=vClearCoatParams.y;
#ifdef CLEARCOAT_TEXTURE
clearCoatIntensity*=clearCoatMapData.x;
#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE
clearCoatRoughness*=clearCoatMapData.y;
#endif
#if DEBUGMODE>0
outParams.clearCoatMapData=clearCoatMapData;
#endif
#endif
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
clearCoatRoughness*=clearCoatMapRoughnessData.y;
#endif
outParams.clearCoatIntensity=clearCoatIntensity;outParams.clearCoatRoughness=clearCoatRoughness;
#ifdef CLEARCOAT_TINT
var clearCoatColor: vec3f=vClearCoatTintParams.rgb;var clearCoatThickness: f32=vClearCoatTintParams.a;
#ifdef CLEARCOAT_TINT_TEXTURE
#ifdef CLEARCOAT_TINT_GAMMATEXTURE
clearCoatColor*=toLinearSpaceVec3(clearCoatTintMapData.rgb);
#else
clearCoatColor*=clearCoatTintMapData.rgb;
#endif
clearCoatThickness*=clearCoatTintMapData.a;
#if DEBUGMODE>0
outParams.clearCoatTintMapData=clearCoatTintMapData;
#endif
#endif
outParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);outParams.clearCoatThickness=clearCoatThickness;
#endif
#ifdef CLEARCOAT_REMAP_F0
var specularEnvironmentR0Updated: vec3f=getR0RemappedForClearCoat(specularEnvironmentR0);
#else
var specularEnvironmentR0Updated: vec3f=specularEnvironmentR0;
#endif
outParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);var clearCoatNormalW: vec3f=geometricNormalW;
#ifdef CLEARCOAT_BUMP
#ifdef NORMALXYSCALE
var clearCoatNormalScale: f32=1.0;
#else
var clearCoatNormalScale: f32=vClearCoatBumpInfos.y;
#endif
#if defined(TANGENT) && defined(NORMAL)
var TBNClearCoat: mat3x3f=vTBN;
#else
var TBNClearCoatUV: vec2f=vClearCoatBumpUV*frontFacingMultiplier;var TBNClearCoat: mat3x3f=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams);
#endif
#if DEBUGMODE>0
outParams.TBNClearCoat=TBNClearCoat;
#endif
#ifdef OBJECTSPACE_NORMALMAP
clearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);clearCoatNormalW=normalize( mat3x3f(normalMatrix[0].xyz,normalMatrix[1].xyz,normalMatrix[2].xyz)*clearCoatNormalW);
#else
clearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
clearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));
#endif
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
clearCoatNormalW=clearCoatNormalW*frontFacingMultiplier;
#endif
outParams.clearCoatNormalW=clearCoatNormalW;outParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);var clearCoatNdotVUnclamped: f32=dot(clearCoatNormalW,viewDirectionW);var clearCoatNdotV: f32=absEps(clearCoatNdotVUnclamped);
#if DEBUGMODE>0
outParams.clearCoatNdotV=clearCoatNdotV;
#endif
#ifdef CLEARCOAT_TINT
var clearCoatVRefract: vec3f=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);outParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));
#endif
#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION))
var environmentClearCoatBrdf: vec3f=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);
#endif
#if defined(REFLECTION)
var clearCoatAlphaG: f32=convertRoughnessToAverageSlope(clearCoatRoughness);
#ifdef SPECULARAA
clearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;
#endif
var environmentClearCoatRadiance: vec4f= vec4f(0.,0.,0.,0.);var clearCoatReflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),clearCoatNormalW);
#ifdef REFLECTIONMAP_OPPOSITEZ
clearCoatReflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
var clearCoatReflectionCoords: vec3f=clearCoatReflectionVector;
#else
var clearCoatReflectionCoords: vec2f=clearCoatReflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
clearCoatReflectionCoords/=clearCoatReflectionVector.z;
#endif
clearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;
#endif
environmentClearCoatRadiance=sampleReflectionTexture(
clearCoatAlphaG
,vReflectionMicrosurfaceInfos
,vReflectionInfos
,vReflectionColor
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
,clearCoatNdotVUnclamped
#endif
#ifdef LINEARSPECULARREFLECTION
,clearCoatRoughness
#endif
,reflectionSampler
,reflectionSamplerSampler
,clearCoatReflectionCoords
#ifndef LODBASEDMICROSFURACE
,reflectionLowSampler
,reflectionLowSamplerSampler
,reflectionHighSampler
,reflectionHighSamplerSampler
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo
#endif 
);
#if DEBUGMODE>0
outParams.environmentClearCoatRadiance=environmentClearCoatRadiance;
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
var clearCoatEnvironmentReflectance: vec3f=getReflectanceFromBRDFLookup(vec3f(uniforms.vClearCoatRefractionParams.x),environmentClearCoatBrdf);
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
var clearCoatEho: f32=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);clearCoatEnvironmentReflectance*=clearCoatEho;
#endif
#endif
#endif
#else
var clearCoatEnvironmentReflectance: vec3f=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV, vec3f(1.), vec3f(1.),sqrt(1.-clearCoatRoughness));
#endif
clearCoatEnvironmentReflectance*=clearCoatIntensity;
#if DEBUGMODE>0
outParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;
#endif
outParams.finalClearCoatRadianceScaled=
environmentClearCoatRadiance.rgb *
clearCoatEnvironmentReflectance *
vLightingIntensity.z;
#endif
#if defined(CLEARCOAT_TINT)
outParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);
#endif
var fresnelIBLClearCoat: f32=fresnelSchlickGGX(clearCoatNdotV,uniforms.vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnelIBLClearCoat*=clearCoatIntensity;outParams.conservationFactor=(1.-fresnelIBLClearCoat);
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
outParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);
#endif
return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockClearcoat_name] = pbrBlockClearcoat_shader;
/** @internal */
const pbrBlockClearcoatWGSL = { name: pbrBlockClearcoat_name, shader: pbrBlockClearcoat_shader };
//# sourceMappingURL=pbrBlockClearcoat.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockIridescence.js
// Do not edit.

const pbrBlockIridescence_name = "pbrBlockIridescence";
const pbrBlockIridescence_shader = `struct iridescenceOutParams
{iridescenceIntensity: f32,
iridescenceIOR: f32,
iridescenceThickness: f32,
specularEnvironmentR0: vec3f};
#ifdef IRIDESCENCE
fn iridescenceBlock(
vIridescenceParams: vec4f
,viewAngle: f32
,specularEnvironmentR0: vec3f
#ifdef IRIDESCENCE_TEXTURE
,iridescenceMapData: vec2f
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
,iridescenceThicknessMapData: vec2f
#endif
#ifdef CLEARCOAT
,NdotVUnclamped: f32
#ifdef CLEARCOAT_TEXTURE
,clearCoatMapData: vec2f
#endif
#endif
)->iridescenceOutParams
{var outParams: iridescenceOutParams;var iridescenceIntensity: f32=vIridescenceParams.x;var iridescenceIOR: f32=vIridescenceParams.y;var iridescenceThicknessMin: f32=vIridescenceParams.z;var iridescenceThicknessMax: f32=vIridescenceParams.w;var iridescenceThicknessWeight: f32=1.;
#ifdef IRIDESCENCE_TEXTURE
iridescenceIntensity*=iridescenceMapData.x;
#endif
#if defined(IRIDESCENCE_THICKNESS_TEXTURE)
iridescenceThicknessWeight=iridescenceThicknessMapData.g;
#endif
var iridescenceThickness: f32=mix(iridescenceThicknessMin,iridescenceThicknessMax,iridescenceThicknessWeight);var topIor: f32=1.; 
#ifdef CLEARCOAT
var clearCoatIntensity: f32=vClearCoatParams.x;
#ifdef CLEARCOAT_TEXTURE
clearCoatIntensity*=clearCoatMapData.x;
#endif
topIor=mix(1.0,uniforms.vClearCoatRefractionParams.w-1.,clearCoatIntensity);viewAngle=sqrt(1.0+((1.0/topIor)*(1.0/topIor))*((NdotVUnclamped*NdotVUnclamped)-1.0));
#endif
var iridescenceFresnel: vec3f=evalIridescence(topIor,iridescenceIOR,viewAngle,iridescenceThickness,specularEnvironmentR0);outParams.specularEnvironmentR0=mix(specularEnvironmentR0,iridescenceFresnel,iridescenceIntensity);outParams.iridescenceIntensity=iridescenceIntensity;outParams.iridescenceThickness=iridescenceThickness;outParams.iridescenceIOR=iridescenceIOR;return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockIridescence_name] = pbrBlockIridescence_shader;
/** @internal */
const pbrBlockIridescenceWGSL = { name: pbrBlockIridescence_name, shader: pbrBlockIridescence_shader };
//# sourceMappingURL=pbrBlockIridescence.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js
// Do not edit.

const pbrBlockSubSurface_name = "pbrBlockSubSurface";
const pbrBlockSubSurface_shader = `struct subSurfaceOutParams
{specularEnvironmentReflectance: vec3f,
#ifdef SS_REFRACTION
finalRefraction: vec3f,
surfaceAlbedo: vec3f,
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
alpha: f32,
#endif
#ifdef REFLECTION
refractionFactorForIrradiance: f32,
#endif
#endif
#ifdef SS_TRANSLUCENCY
transmittance: vec3f,
translucencyIntensity: f32,
#ifdef REFLECTION
refractionIrradiance: vec3f,
#endif
#endif
#if DEBUGMODE>0
#ifdef SS_THICKNESSANDMASK_TEXTURE
thicknessMap: vec4f,
#endif
#ifdef SS_REFRACTION
environmentRefraction: vec4f,
refractionTransmittance: vec3f
#endif
#endif
};
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
#define pbr_inline
fn sampleEnvironmentRefraction(
ior: f32
,thickness: f32
,refractionLOD: f32
,normalW: vec3f
,vPositionW: vec3f
,viewDirectionW: vec3f
,view: mat4x4f
,vRefractionInfos: vec4f
,refractionMatrix: mat4x4f
,vRefractionMicrosurfaceInfos: vec4f
,alphaG: f32
#ifdef SS_REFRACTIONMAP_3D
,refractionSampler: texture_cube<f32>
,refractionSamplerSampler: sampler
#ifndef LODBASEDMICROSFURACE
,refractionLowSampler: texture_cube<f32>
,refractionLowSamplerSampler: sampler
,refractionHighSampler: texture_cube<f32>
,refractionHighSamplerSampler: sampler 
#endif
#else
,refractionSampler: texture_2d<f32>
,refractionSamplerSampler: sampler
#ifndef LODBASEDMICROSFURACE
,refractionLowSampler: texture_2d<f32>
,refractionLowSamplerSampler: sampler
,refractionHighSampler: texture_2d<f32>
,refractionHighSamplerSampler: sampler 
#endif
#endif
#ifdef ANISOTROPIC
,anisotropicOut: anisotropicOutParams
#endif
#ifdef REALTIME_FILTERING
,vRefractionFilteringInfo: vec2f
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,refractionPosition: vec3f
,refractionSize: vec3f
#endif
)->vec4f {var environmentRefraction: vec4f= vec4f(0.,0.,0.,0.);
#ifdef ANISOTROPIC
var refractionVector: vec3f=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,ior);
#else
var refractionVector: vec3f=refract(-viewDirectionW,normalW,ior);
#endif
#ifdef SS_REFRACTIONMAP_OPPOSITEZ
refractionVector.z*=-1.0;
#endif
#ifdef SS_REFRACTIONMAP_3D
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition);
#endif
refractionVector.y=refractionVector.y*vRefractionInfos.w;var refractionCoords: vec3f=refractionVector;refractionCoords= (refractionMatrix* vec4f(refractionCoords,0)).xyz;
#else
#ifdef SS_USE_THICKNESS_AS_DEPTH
var vRefractionUVW: vec3f= (refractionMatrix*(view* vec4f(vPositionW+refractionVector*thickness,1.0))).xyz;
#else
var vRefractionUVW: vec3f= (refractionMatrix*(view* vec4f(vPositionW+refractionVector*vRefractionInfos.z,1.0))).xyz;
#endif
var refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;
#endif
#ifdef LODBASEDMICROSFURACE
var lod=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;
#ifdef SS_LODINREFRACTIONALPHA
var automaticRefractionLOD: f32=UNPACK_LOD(textureSample(refractionSampler,refractionSamplerSampler,refractionCoords).a);var requestedRefractionLOD: f32=max(automaticRefractionLOD,lod);
#else
var requestedRefractionLOD: f32=lod;
#endif
#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D)
environmentRefraction= vec4f(radiance(alphaG,refractionSampler,refractionSamplerSampler,refractionCoords,vRefractionFilteringInfo),1.0);
#else
environmentRefraction=textureSampleLevel(refractionSampler,refractionSamplerSampler,refractionCoords,requestedRefractionLOD);
#endif
#else
var lodRefractionNormalized: f32=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));var lodRefractionNormalizedDoubled: f32=lodRefractionNormalized*2.0;var environmentRefractionMid: vec4f=textureSample(refractionSampler,refractionSamplerSampler,refractionCoords);if (lodRefractionNormalizedDoubled<1.0){environmentRefraction=mix(
textureSample(refractionHighSampler,refractionHighSamplerSampler,refractionCoords),
environmentRefractionMid,
lodRefractionNormalizedDoubled
);} else {environmentRefraction=mix(
environmentRefractionMid,
textureSample(refractionLowSampler,refractionLowSamplerSampler,refractionCoords),
lodRefractionNormalizedDoubled-1.0
);}
#endif
var refraction=environmentRefraction.rgb;
#ifdef SS_RGBDREFRACTION
refraction=fromRGBD(environmentRefraction);
#endif
#ifdef SS_GAMMAREFRACTION
refraction=toLinearSpaceVec3(environmentRefraction.rgb);
#endif
return vec4f(refraction,environmentRefraction.a);}
#endif
#define pbr_inline
fn subSurfaceBlock(
vSubSurfaceIntensity: vec3f
,vThicknessParam: vec2f
,vTintColor: vec4f
,normalW: vec3f
,specularEnvironmentReflectance: vec3f
#ifdef SS_THICKNESSANDMASK_TEXTURE
,thicknessMap: vec4f
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
,refractionIntensityMap: vec4f
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
,translucencyIntensityMap: vec4f
#endif
#ifdef REFLECTION
#ifdef SS_TRANSLUCENCY
,reflectionMatrix: mat4x4f
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
,irradianceVector_: vec3f
#endif
#if defined(REALTIME_FILTERING)
,reflectionSampler: texture_cube<f32>
,reflectionSamplerSampler: sampler
,vReflectionFilteringInfo: vec2f
#endif
#endif
#ifdef USEIRRADIANCEMAP
#ifdef REFLECTIONMAP_3D
,irradianceSampler: texture_cube<f32>
,irradianceSamplerSampler: sampler
#else
,irradianceSampler: texture_2d<f32>
,irradianceSamplerSampler: sampler
#endif
#endif
#endif
#endif
#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
,surfaceAlbedo: vec3f
#endif
#ifdef SS_REFRACTION
,vPositionW: vec3f
,viewDirectionW: vec3f
,view: mat4x4f
,vRefractionInfos: vec4f
,refractionMatrix: mat4x4f
,vRefractionMicrosurfaceInfos: vec4f
,vLightingIntensity: vec4f
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
,alpha: f32
#endif
#ifdef SS_LODINREFRACTIONALPHA
,NdotVUnclamped: f32
#endif
#ifdef SS_LINEARSPECULARREFRACTION
,roughness: f32
#endif
,alphaG: f32
#ifdef SS_REFRACTIONMAP_3D
,refractionSampler: texture_cube<f32>
,refractionSamplerSampler: sampler
#ifndef LODBASEDMICROSFURACE
,refractionLowSampler: texture_cube<f32>
,refractionLowSamplerSampler: sampler
,refractionHighSampler: texture_cube<f32>
,refractionHighSamplerSampler: sampler 
#endif
#else
,refractionSampler: texture_2d<f32>
,refractionSamplerSampler: sampler
#ifndef LODBASEDMICROSFURACE
,refractionLowSampler: texture_2d<f32>
,refractionLowSamplerSampler: sampler
,refractionHighSampler: texture_2d<f32>
,refractionHighSamplerSampler: sampler 
#endif
#endif
#ifdef ANISOTROPIC
,anisotropicOut: anisotropicOutParams
#endif
#ifdef REALTIME_FILTERING
,vRefractionFilteringInfo: vec2f
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,refractionPosition: vec3f
,refractionSize: vec3f
#endif
#ifdef SS_DISPERSION
,dispersion: f32
#endif
#endif
#ifdef SS_TRANSLUCENCY
,vDiffusionDistance: vec3f
,vTranslucencyColor: vec4f
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
,translucencyColorMap: vec4f
#endif
#endif
)->subSurfaceOutParams
{var outParams: subSurfaceOutParams;outParams.specularEnvironmentReflectance=specularEnvironmentReflectance;
#ifdef SS_REFRACTION
var refractionIntensity: f32=vSubSurfaceIntensity.x;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
refractionIntensity*=(1.0-alpha);outParams.alpha=1.0;
#endif
#endif
#ifdef SS_TRANSLUCENCY
var translucencyIntensity: f32=vSubSurfaceIntensity.y;
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
#ifdef SS_USE_GLTF_TEXTURES
var thickness: f32=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;
#else
var thickness: f32=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;
#endif
#if DEBUGMODE>0
outParams.thicknessMap=thicknessMap;
#endif
#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS)
#ifdef SS_USE_GLTF_TEXTURES
refractionIntensity*=thicknessMap.r;
#else
refractionIntensity*=thicknessMap.g;
#endif
#endif
#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS)
#ifdef SS_USE_GLTF_TEXTURES
translucencyIntensity*=thicknessMap.a;
#else
translucencyIntensity*=thicknessMap.b;
#endif
#endif
#else
var thickness: f32=vThicknessParam.y;
#endif
#if defined(SS_REFRACTION) && defined(SS_REFRACTIONINTENSITY_TEXTURE)
#ifdef SS_USE_GLTF_TEXTURES
refractionIntensity*=refractionIntensityMap.r;
#else
refractionIntensity*=refractionIntensityMap.g;
#endif
#endif
#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCYINTENSITY_TEXTURE)
#ifdef SS_USE_GLTF_TEXTURES
translucencyIntensity*=translucencyIntensityMap.a;
#else
translucencyIntensity*=translucencyIntensityMap.b;
#endif
#endif
#ifdef SS_TRANSLUCENCY
thickness=maxEps(thickness);var translucencyColor: vec4f=vTranslucencyColor;
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
translucencyColor*=translucencyColorMap;
#endif
var transmittance: vec3f=transmittanceBRDF_Burley(translucencyColor.rgb,vDiffusionDistance,thickness);transmittance*=translucencyIntensity;outParams.transmittance=transmittance;outParams.translucencyIntensity=translucencyIntensity;
#endif
#ifdef SS_REFRACTION
var environmentRefraction: vec4f= vec4f(0.,0.,0.,0.);
#ifdef SS_HAS_THICKNESS
var ior: f32=vRefractionInfos.y;
#else
var ior: f32=vRefractionMicrosurfaceInfos.w;
#endif
#ifdef SS_LODINREFRACTIONALPHA
var refractionAlphaG: f32=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));var refractionLOD: f32=getLodFromAlphaGNdotV(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped);
#elif defined(SS_LINEARSPECULARREFRACTION)
var refractionRoughness: f32=alphaG;refractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));var refractionLOD: f32=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness);
#else
var refractionAlphaG: f32=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));var refractionLOD: f32=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG);
#endif
var refraction_ior: f32=vRefractionInfos.y;
#ifdef SS_DISPERSION
var realIOR: f32=1.0/refraction_ior;var iorDispersionSpread: f32=0.04*dispersion*(realIOR-1.0);var iors: vec3f= vec3f(1.0/(realIOR-iorDispersionSpread),refraction_ior,1.0/(realIOR+iorDispersionSpread));for (var i: i32=0; i<3; i++) {refraction_ior=iors[i];
#endif
var envSample: vec4f=sampleEnvironmentRefraction(refraction_ior,thickness,refractionLOD,normalW,vPositionW,viewDirectionW,view,vRefractionInfos,refractionMatrix,vRefractionMicrosurfaceInfos,alphaG
#ifdef SS_REFRACTIONMAP_3D
,refractionSampler
,refractionSamplerSampler
#ifndef LODBASEDMICROSFURACE
,refractionLowSampler
,refractionLowSamplerSampler
,refractionHighSampler
,refractionHighSamplerSampler
#endif
#else
,refractionSampler
,refractionSamplerSampler
#ifndef LODBASEDMICROSFURACE
,refractionLowSampler
,refractionLowSamplerSampler
,refractionHighSampler
,refractionHighSamplerSampler
#endif
#endif
#ifdef ANISOTROPIC
,anisotropicOut
#endif
#ifdef REALTIME_FILTERING
,vRefractionFilteringInfo
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,refractionPosition
,refractionSize
#endif
);
#ifdef SS_DISPERSION
environmentRefraction[i]=envSample[i];}
#else
environmentRefraction=envSample;
#endif
environmentRefraction=vec4f(environmentRefraction.rgb*vRefractionInfos.x,environmentRefraction.a);
#endif
#ifdef SS_REFRACTION
var refractionTransmittance: vec3f= vec3f(refractionIntensity);
#ifdef SS_THICKNESSANDMASK_TEXTURE
var volumeAlbedo: vec3f=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambertVec3(volumeAlbedo,thickness);
#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)
var maxChannel: f32=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);var volumeAlbedo: vec3f=saturateVec3(maxChannel*surfaceAlbedo);environmentRefraction=vec4f(environmentRefraction.rgb*volumeAlbedo,environmentRefraction.a);
#else
var volumeAlbedo: vec3f=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambertVec3(volumeAlbedo,vThicknessParam.y);
#endif
#ifdef SS_ALBEDOFORREFRACTIONTINT
environmentRefraction=vec4f(environmentRefraction.rgb*surfaceAlbedo.rgb,environmentRefraction.a);
#endif
outParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);
#ifdef REFLECTION
outParams.refractionFactorForIrradiance=(1.-refractionIntensity);
#endif
#ifdef UNUSED_MULTIPLEBOUNCES
var bounceSpecularEnvironmentReflectance: vec3f=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);outParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);
#endif
refractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;
#if DEBUGMODE>0
outParams.refractionTransmittance=refractionTransmittance;
#endif
outParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;
#if DEBUGMODE>0
outParams.environmentRefraction=environmentRefraction;
#endif
#endif
#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)
#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)
var irradianceVector: vec3f= (reflectionMatrix* vec4f(normalW,0)).xyz;
#ifdef REFLECTIONMAP_OPPOSITEZ
irradianceVector.z*=-1.0;
#endif
#ifdef INVERTCUBICMAP
irradianceVector.y*=-1.0;
#endif
#else
var irradianceVector: vec3f=irradianceVector_;
#endif
#if defined(USESPHERICALFROMREFLECTIONMAP)
#if defined(REALTIME_FILTERING)
var refractionIrradiance: vec3f=irradiance(reflectionSampler,reflectionSamplerSampler,-irradianceVector,vReflectionFilteringInfo);
#else
var refractionIrradiance: vec3f=computeEnvironmentIrradiance(-irradianceVector);
#endif
#elif defined(USEIRRADIANCEMAP)
#ifdef REFLECTIONMAP_3D
var irradianceCoords: vec3f=irradianceVector;
#else
var irradianceCoords: vec2f=irradianceVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
irradianceCoords/=irradianceVector.z;
#endif
irradianceCoords.y=1.0-irradianceCoords.y;
#endif
var temp: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,-irradianceCoords);var refractionIrradiance=temp.rgb;
#ifdef RGBDREFLECTION
refractionIrradiance=fromRGBD(temp).rgb;
#endif
#ifdef GAMMAREFLECTION
refractionIrradiance=toLinearSpaceVec3(refractionIrradiance);
#endif
#else
var refractionIrradiance: vec3f= vec3f(0.);
#endif
refractionIrradiance*=transmittance;
#ifdef SS_ALBEDOFORTRANSLUCENCYTINT
refractionIrradiance*=surfaceAlbedo.rgb;
#endif
outParams.refractionIrradiance=refractionIrradiance;
#endif
return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockSubSurface_name] = pbrBlockSubSurface_shader;
/** @internal */
const pbrBlockSubSurfaceWGSL = { name: pbrBlockSubSurface_name, shader: pbrBlockSubSurface_shader };
//# sourceMappingURL=pbrBlockSubSurface.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(97715);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockNormalGeometric.js
// Do not edit.

const pbrBlockNormalGeometric_name = "pbrBlockNormalGeometric";
const pbrBlockNormalGeometric_shader = `var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);
#ifdef NORMAL
var normalW: vec3f=normalize(input.vNormalW);
#else
var normalW: vec3f=normalize(cross(dpdx(input.vPositionW),dpdy(input.vPositionW)))*scene.vEyePosition.w;
#endif
var geometricNormalW: vec3f=normalW;
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
geometricNormalW=select(-geometricNormalW,geometricNormalW,fragmentInputs.frontFacing);
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockNormalGeometric_name] = pbrBlockNormalGeometric_shader;
/** @internal */
const pbrBlockNormalGeometricWGSL = { name: pbrBlockNormalGeometric_name, shader: pbrBlockNormalGeometric_shader };
//# sourceMappingURL=pbrBlockNormalGeometric.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bumpFragment.js
var bumpFragment = __webpack_require__(20727);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js
// Do not edit.

const pbrBlockNormalFinal_name = "pbrBlockNormalFinal";
const pbrBlockNormalFinal_shader = `#if defined(FORCENORMALFORWARD) && defined(NORMAL)
var faceNormal: vec3f=normalize(cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)))*scene.vEyePosition.w;
#if defined(TWOSIDEDLIGHTING)
faceNormal=select(-faceNormal,faceNormal,fragmentInputs.frontFacing);
#endif
normalW*=sign(dot(normalW,faceNormal));
#endif
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
normalW=select(-normalW,normalW,fragmentInputs.frontFacing);
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockNormalFinal_name] = pbrBlockNormalFinal_shader;
/** @internal */
const pbrBlockNormalFinalWGSL = { name: pbrBlockNormalFinal_name, shader: pbrBlockNormalFinal_shader };
//# sourceMappingURL=pbrBlockNormalFinal.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/depthPrePass.js
var depthPrePass = __webpack_require__(59104);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockLightmapInit.js
// Do not edit.

const pbrBlockLightmapInit_name = "pbrBlockLightmapInit";
const pbrBlockLightmapInit_shader = `#ifdef LIGHTMAP
var lightmapColor: vec4f=textureSample(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset);
#ifdef RGBDLIGHTMAP
lightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a);
#endif
#ifdef GAMMALIGHTMAP
lightmapColor=vec4f(toLinearSpaceVec3(lightmapColor.rgb),lightmapColor.a);
#endif
lightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a);
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockLightmapInit_name] = pbrBlockLightmapInit_shader;
/** @internal */
const pbrBlockLightmapInitWGSL = { name: pbrBlockLightmapInit_name, shader: pbrBlockLightmapInit_shader };
//# sourceMappingURL=pbrBlockLightmapInit.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockGeometryInfo.js
// Do not edit.

const pbrBlockGeometryInfo_name = "pbrBlockGeometryInfo";
const pbrBlockGeometryInfo_shader = `var NdotVUnclamped: f32=dot(normalW,viewDirectionW);var NdotV: f32=absEps(NdotVUnclamped);var alphaG: f32=convertRoughnessToAverageSlope(roughness);var AARoughnessFactors: vec2f=getAARoughnessFactors(normalW.xyz);
#ifdef SPECULARAA
alphaG+=AARoughnessFactors.y;
#endif
#if defined(ENVIRONMENTBRDF)
var environmentBrdf: vec3f=getBRDFLookup(NdotV,roughness);
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
#ifdef RADIANCEOCCLUSION
#ifdef AMBIENTINGRAYSCALE
var ambientMonochrome: f32=aoOut.ambientOcclusionColor.r;
#else
var ambientMonochrome: f32=getLuminance(aoOut.ambientOcclusionColor);
#endif
var seo: f32=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);
#endif
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
var eho: f32=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);
#endif
#endif
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockGeometryInfo_name] = pbrBlockGeometryInfo_shader;
/** @internal */
const pbrBlockGeometryInfoWGSL = { name: pbrBlockGeometryInfo_name, shader: pbrBlockGeometryInfo_shader };
//# sourceMappingURL=pbrBlockGeometryInfo.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockReflectance0.js
// Do not edit.

const pbrBlockReflectance0_name = "pbrBlockReflectance0";
const pbrBlockReflectance0_shader = `var reflectance: f32=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);var specularEnvironmentR0: vec3f=reflectivityOut.surfaceReflectivityColor.rgb;
#ifdef METALLICWORKFLOW
var specularEnvironmentR90: vec3f= vec3f(metallicReflectanceFactors.a);
#else 
var specularEnvironmentR90: vec3f= vec3f(1.0,1.0,1.0);
#endif
#ifdef ALPHAFRESNEL
var reflectance90: f32=fresnelGrazingReflectance(reflectance);specularEnvironmentR90=specularEnvironmentR90*reflectance90;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockReflectance0_name] = pbrBlockReflectance0_shader;
/** @internal */
const pbrBlockReflectance0WGSL = { name: pbrBlockReflectance0_name, shader: pbrBlockReflectance0_shader };
//# sourceMappingURL=pbrBlockReflectance0.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js
// Do not edit.

const pbrBlockReflectance_name = "pbrBlockReflectance";
const pbrBlockReflectance_shader = `#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
var specularEnvironmentReflectance: vec3f=getReflectanceFromBRDFWithEnvLookup(clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,environmentBrdf);
#ifdef RADIANCEOCCLUSION
specularEnvironmentReflectance*=seo;
#endif
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
specularEnvironmentReflectance*=eho;
#endif
#endif
#endif
#else
var specularEnvironmentReflectance: vec3f=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));
#endif
#ifdef CLEARCOAT
specularEnvironmentReflectance*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
specularEnvironmentReflectance*=clearcoatOut.absorption;
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockReflectance_name] = pbrBlockReflectance_shader;
/** @internal */
const pbrBlockReflectanceWGSL = { name: pbrBlockReflectance_name, shader: pbrBlockReflectance_shader };
//# sourceMappingURL=pbrBlockReflectance.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js
// Do not edit.

const pbrBlockDirectLighting_name = "pbrBlockDirectLighting";
const pbrBlockDirectLighting_shader = `var diffuseBase: vec3f=vec3f(0.,0.,0.);
#ifdef SPECULARTERM
var specularBase: vec3f=vec3f(0.,0.,0.);
#endif
#ifdef CLEARCOAT
var clearCoatBase: vec3f=vec3f(0.,0.,0.);
#endif
#ifdef SHEEN
var sheenBase: vec3f=vec3f(0.,0.,0.);
#endif
var preInfo: preLightingInfo;var info: lightingInfo;var shadow: f32=1.; 
var aggShadow: f32=0.;var numLights: f32=0.;
#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
var absorption: vec3f=vec3f(0.);
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockDirectLighting_name] = pbrBlockDirectLighting_shader;
/** @internal */
const pbrBlockDirectLightingWGSL = { name: pbrBlockDirectLighting_name, shader: pbrBlockDirectLighting_shader };
//# sourceMappingURL=pbrBlockDirectLighting.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/lightFragment.js
var lightFragment = __webpack_require__(25271);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js
// Do not edit.

const pbrBlockFinalLitComponents_name = "pbrBlockFinalLitComponents";
const pbrBlockFinalLitComponents_shader = `aggShadow=aggShadow/numLights;
#if defined(ENVIRONMENTBRDF)
#ifdef MS_BRDF_ENERGY_CONSERVATION
var energyConservationFactor: vec3f=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);
#endif
#endif
#ifndef METALLICWORKFLOW
#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION
surfaceAlbedo=(1.-reflectance)*surfaceAlbedo.rgb;
#endif
#endif
#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)
surfaceAlbedo=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;
#endif
#ifdef REFLECTION
var finalIrradiance: vec3f=reflectionOut.environmentIrradiance;
#if defined(CLEARCOAT)
finalIrradiance*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
finalIrradiance*=clearcoatOut.absorption;
#endif
#endif
#if defined(SS_REFRACTION)
finalIrradiance*=subSurfaceOut.refractionFactorForIrradiance;
#endif
#if defined(SS_TRANSLUCENCY)
finalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);finalIrradiance+=subSurfaceOut.refractionIrradiance;
#endif
finalIrradiance*=surfaceAlbedo.rgb;finalIrradiance*=uniforms.vLightingIntensity.z;finalIrradiance*=aoOut.ambientOcclusionColor;
#endif
#ifdef SPECULARTERM
var finalSpecular: vec3f=specularBase;finalSpecular=max(finalSpecular,vec3f(0.0));var finalSpecularScaled: vec3f=finalSpecular*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalSpecularScaled*=energyConservationFactor;
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
finalSpecularScaled*=sheenOut.sheenAlbedoScaling;
#endif
#endif
#ifdef REFLECTION
var finalRadiance: vec3f=reflectionOut.environmentRadiance.rgb;finalRadiance*=subSurfaceOut.specularEnvironmentReflectance;var finalRadianceScaled: vec3f=finalRadiance*uniforms.vLightingIntensity.z;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalRadianceScaled*=energyConservationFactor;
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
finalRadianceScaled*=sheenOut.sheenAlbedoScaling;
#endif
#endif
#ifdef SHEEN
var finalSheen: vec3f=sheenBase*sheenOut.sheenColor;finalSheen=max(finalSheen,vec3f(0.0));var finalSheenScaled: vec3f=finalSheen*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w;
#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)
sheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
sheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;
#endif
#endif
#endif
#ifdef CLEARCOAT
var finalClearCoat: vec3f=clearCoatBase;finalClearCoat=max(finalClearCoat,vec3f(0.0));var finalClearCoatScaled: vec3f=finalClearCoat*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;
#endif
#ifdef SS_REFRACTION
subSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;
#ifdef CLEARCOAT_TINT
subSurfaceOut.finalRefraction*=clearcoatOut.absorption;
#endif
#endif
#endif
#ifdef ALPHABLEND
var luminanceOverAlpha: f32=0.0;
#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)
luminanceOverAlpha+=getLuminance(finalRadianceScaled);
#if defined(CLEARCOAT)
luminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);
#endif
#endif
#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)
luminanceOverAlpha+=getLuminance(finalSpecularScaled);
#endif
#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)
luminanceOverAlpha+=getLuminance(finalClearCoatScaled);
#endif
#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA)
alpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockFinalLitComponents_name] = pbrBlockFinalLitComponents_shader;
/** @internal */
const pbrBlockFinalLitComponentsWGSL = { name: pbrBlockFinalLitComponents_name, shader: pbrBlockFinalLitComponents_shader };
//# sourceMappingURL=pbrBlockFinalLitComponents.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js
// Do not edit.

const pbrBlockFinalUnlitComponents_name = "pbrBlockFinalUnlitComponents";
const pbrBlockFinalUnlitComponents_shader = `var finalDiffuse: vec3f=diffuseBase;finalDiffuse*=surfaceAlbedo.rgb;finalDiffuse=max(finalDiffuse,vec3f(0.0));finalDiffuse*=uniforms.vLightingIntensity.x;var finalAmbient: vec3f=uniforms.vAmbientColor;finalAmbient*=surfaceAlbedo.rgb;var finalEmissive: vec3f=uniforms.vEmissiveColor;
#ifdef EMISSIVE
var emissiveColorTex: vec3f=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vEmissiveUV+uvOffset).rgb;
#ifdef GAMMAEMISSIVE
finalEmissive*=toLinearSpaceVec3(emissiveColorTex.rgb);
#else
finalEmissive*=emissiveColorTex.rgb;
#endif
finalEmissive*= uniforms.vEmissiveInfos.y;
#endif
finalEmissive*=uniforms.vLightingIntensity.y;
#ifdef AMBIENT
var ambientOcclusionForDirectDiffuse: vec3f=mix( vec3f(1.),aoOut.ambientOcclusionColor,uniforms.vAmbientInfos.w);
#else
var ambientOcclusionForDirectDiffuse: vec3f=aoOut.ambientOcclusionColor;
#endif
finalAmbient*=aoOut.ambientOcclusionColor;finalDiffuse*=ambientOcclusionForDirectDiffuse;
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockFinalUnlitComponents_name] = pbrBlockFinalUnlitComponents_shader;
/** @internal */
const pbrBlockFinalUnlitComponentsWGSL = { name: pbrBlockFinalUnlitComponents_name, shader: pbrBlockFinalUnlitComponents_shader };
//# sourceMappingURL=pbrBlockFinalUnlitComponents.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockFinalColorComposition.js
// Do not edit.

const pbrBlockFinalColorComposition_name = "pbrBlockFinalColorComposition";
const pbrBlockFinalColorComposition_shader = `var finalColor: vec4f= vec4f(
#ifndef UNLIT
#ifdef REFLECTION
finalIrradiance +
#endif
#ifdef SPECULARTERM
finalSpecularScaled +
#endif
#ifdef SHEEN
finalSheenScaled +
#endif
#ifdef CLEARCOAT
finalClearCoatScaled +
#endif
#ifdef REFLECTION
finalRadianceScaled +
#if defined(SHEEN) && defined(ENVIRONMENTBRDF)
sheenOut.finalSheenRadianceScaled +
#endif
#ifdef CLEARCOAT
clearcoatOut.finalClearCoatRadianceScaled +
#endif
#endif
#ifdef SS_REFRACTION
subSurfaceOut.finalRefraction +
#endif
#endif
finalAmbient +
finalDiffuse,
alpha);
#ifdef LIGHTMAP
#ifndef LIGHTMAPEXCLUDED
#ifdef USELIGHTMAPASSHADOWMAP
finalColor=vec4f(finalColor.rgb*lightmapColor.rgb,finalColor.a);
#else
finalColor=vec4f(finalColor.rgb+lightmapColor.rgb,finalColor.a);
#endif
#endif
#endif
finalColor=vec4f(finalColor.rgb+finalEmissive,finalColor.a);
#define CUSTOM_FRAGMENT_BEFORE_FOG
finalColor=max(finalColor,vec4f(0.0));
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockFinalColorComposition_name] = pbrBlockFinalColorComposition_shader;
/** @internal */
const pbrBlockFinalColorCompositionWGSL = { name: pbrBlockFinalColorComposition_name, shader: pbrBlockFinalColorComposition_shader };
//# sourceMappingURL=pbrBlockFinalColorComposition.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__(38780);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__(93243);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockImageProcessing.js
// Do not edit.

const pbrBlockImageProcessing_name = "pbrBlockImageProcessing";
const pbrBlockImageProcessing_shader = `#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)
#if !defined(SKIPFINALCOLORCLAMP)
finalColor=vec4f(clamp(finalColor.rgb,vec3f(0.),vec3f(30.0)),finalColor.a);
#endif
#else
finalColor=applyImageProcessing(finalColor);
#endif
finalColor=vec4f(finalColor.rgb,finalColor.a*mesh.visibility);
#ifdef PREMULTIPLYALPHA
finalColor=vec4f(finalColor.rgb*finalColor.a,finalColor.a);;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockImageProcessing_name] = pbrBlockImageProcessing_shader;
/** @internal */
const pbrBlockImageProcessingWGSL = { name: pbrBlockImageProcessing_name, shader: pbrBlockImageProcessing_shader };
//# sourceMappingURL=pbrBlockImageProcessing.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js
// Do not edit.

const pbrBlockPrePass_name = "pbrBlockPrePass";
const pbrBlockPrePass_shader = `var writeGeometryInfo: f32=select(0.0,1.0,finalColor.a>ALPHATESTVALUE);var fragData: array<vec4<f32>,SCENE_MRT_COUNT>;
#ifdef PREPASS_POSITION
fragData[PREPASS_POSITION_INDEX]= vec4f(fragmentInputs.vPositionW,writeGeometryInfo);
#endif
#ifdef PREPASS_LOCAL_POSITION
fragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo);
#endif
#ifdef PREPASS_VELOCITY
var a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo);
#elif defined(PREPASS_VELOCITY_LINEAR)
var velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) -
(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO
fragData[PREPASS_ALBEDO_INDEX]=vec4f(surfaceAlbedo,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO_SQRT
var sqAlbedo : vec3f=sqrt(surfaceAlbedo); 
#endif
#ifdef PREPASS_IRRADIANCE
var irradiance : vec3f=finalDiffuse;
#ifndef UNLIT
#ifdef REFLECTION
irradiance+=finalIrradiance;
#endif
#endif
#ifdef SS_SCATTERING
#ifdef PREPASS_COLOR
fragData[PREPASS_COLOR_INDEX]=vec4f(finalColor.rgb-irradiance,finalColor.a); 
#endif
irradiance/=sqAlbedo;fragData[PREPASS_IRRADIANCE_INDEX]=vec4f(clamp(irradiance,vec3f(0.),vec3f(1.)),writeGeometryInfo*uniforms.scatteringDiffusionProfile/255.); 
#else
#ifdef PREPASS_COLOR
fragData[PREPASS_COLOR_INDEX]=finalColor; 
#endif
fragData[PREPASS_IRRADIANCE_INDEX]=vec4f(clamp(irradiance,vec3f(0.),vec3f(1.)),writeGeometryInfo); 
#endif
#elif defined(PREPASS_COLOR)
fragData[PREPASS_COLOR_INDEX]=vec4f(finalColor.rgb,finalColor.a);
#endif
#ifdef PREPASS_DEPTH
fragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_SCREENSPACE_DEPTH
fragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_NORMAL
#ifdef PREPASS_NORMAL_WORLDSPACE
fragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo);
#else
fragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo);
#endif
#endif
#ifdef PREPASS_WORLD_NORMAL
fragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO_SQRT
fragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqAlbedo,writeGeometryInfo);
#endif
#ifdef PREPASS_REFLECTIVITY
#ifndef UNLIT
fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(specularEnvironmentR0,microSurface)*writeGeometryInfo;
#else
fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(0.0,0.0,0.0,1.0)*writeGeometryInfo;
#endif
#endif
#if SCENE_MRT_COUNT>0
fragmentOutputs.fragData0=fragData[0];
#endif
#if SCENE_MRT_COUNT>1
fragmentOutputs.fragData1=fragData[1];
#endif
#if SCENE_MRT_COUNT>2
fragmentOutputs.fragData2=fragData[2];
#endif
#if SCENE_MRT_COUNT>3
fragmentOutputs.fragData3=fragData[3];
#endif
#if SCENE_MRT_COUNT>4
fragmentOutputs.fragData4=fragData[4];
#endif
#if SCENE_MRT_COUNT>5
fragmentOutputs.fragData5=fragData[5];
#endif
#if SCENE_MRT_COUNT>6
fragmentOutputs.fragData6=fragData[6];
#endif
#if SCENE_MRT_COUNT>7
fragmentOutputs.fragData7=fragData[7];
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrBlockPrePass_name] = pbrBlockPrePass_shader;
/** @internal */
const pbrBlockPrePassWGSL = { name: pbrBlockPrePass_name, shader: pbrBlockPrePass_shader };
//# sourceMappingURL=pbrBlockPrePass.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/oitFragment.js
var oitFragment = __webpack_require__(91347);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/pbrDebug.js
// Do not edit.

const pbrDebug_name = "pbrDebug";
const pbrDebug_shader = `#if DEBUGMODE>0
if (input.vClipSpacePosition.x/input.vClipSpacePosition.w>=uniforms.vDebugMode.x) {var color: vec3f;
#if DEBUGMODE==1
color=fragmentInputs.vPositionW.rgb;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==2 && defined(NORMAL)
color=fragmentInputs.vNormalW.rgb;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==3 && defined(BUMP) || DEBUGMODE==3 && defined(PARALLAX) || DEBUGMODE==3 && defined(ANISOTROPIC)
color=TBN[0];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==4 && defined(BUMP) || DEBUGMODE==4 && defined(PARALLAX) || DEBUGMODE==4 && defined(ANISOTROPIC)
color=TBN[1];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==5
color=normalW;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==6 && defined(MAINUV1)
color= vec3f(input.vMainUV1,0.0);
#elif DEBUGMODE==7 && defined(MAINUV2)
color= vec3f(input.vMainUV2,0.0);
#elif DEBUGMODE==8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
color=clearcoatOut.TBNClearCoat[0];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
color=clearcoatOut.TBNClearCoat[1];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==10 && defined(CLEARCOAT)
color=clearcoatOut.clearCoatNormalW;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==11 && defined(ANISOTROPIC)
color=anisotropicOut.anisotropicNormal;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==12 && defined(ANISOTROPIC)
color=anisotropicOut.anisotropicTangent;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==13 && defined(ANISOTROPIC)
color=anisotropicOut.anisotropicBitangent;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==20 && defined(ALBEDO)
color=albedoTexture.rgb;
#ifndef GAMMAALBEDO
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==21 && defined(AMBIENT)
color=aoOut.ambientOcclusionColorMap.rgb;
#elif DEBUGMODE==22 && defined(OPACITY)
color=opacityMap.rgb;
#elif DEBUGMODE==23 && defined(EMISSIVE)
color=emissiveColorTex.rgb;
#ifndef GAMMAEMISSIVE
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==24 && defined(LIGHTMAP)
color=lightmapColor;
#ifndef GAMMALIGHTMAP
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)
color=reflectivityOut.surfaceMetallicColorMap.rgb;
#elif DEBUGMODE==26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)
color=reflectivityOut.surfaceReflectivityColorMap.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)
color= vec3f(clearcoatOut.clearCoatMapData.rg,0.0);
#elif DEBUGMODE==28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
color=clearcoatOut.clearCoatTintMapData.rgb;
#elif DEBUGMODE==29 && defined(SHEEN) && defined(SHEEN_TEXTURE)
color=sheenOut.sheenMapData.rgb;
#elif DEBUGMODE==30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)
color=anisotropicOut.anisotropyMapData.rgb;
#elif DEBUGMODE==31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)
color=subSurfaceOut.thicknessMap.rgb;
#elif DEBUGMODE==32 && defined(BUMP)
color=textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).rgb;
#elif DEBUGMODE==40 && defined(SS_REFRACTION)
color=subSurfaceOut.environmentRefraction.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==41 && defined(REFLECTION)
color=reflectionOut.environmentRadiance.rgb;
#ifndef GAMMAREFLECTION
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==42 && defined(CLEARCOAT) && defined(REFLECTION)
color=clearcoatOut.environmentClearCoatRadiance.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==50
color=diffuseBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==51 && defined(SPECULARTERM)
color=specularBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==52 && defined(CLEARCOAT)
color=clearCoatBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==53 && defined(SHEEN)
color=sheenBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==54 && defined(REFLECTION)
color=reflectionOut.environmentIrradiance.rgb;
#ifndef GAMMAREFLECTION
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==60
color=surfaceAlbedo.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==61
color=clearcoatOut.specularEnvironmentR0;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==62 && defined(METALLICWORKFLOW)
color= vec3f(reflectivityOut.metallicRoughness.r);
#elif DEBUGMODE==71 && defined(METALLICWORKFLOW)
color=reflectivityOut.metallicF0;
#elif DEBUGMODE==63
color= vec3f(roughness);
#elif DEBUGMODE==64
color= vec3f(alphaG);
#elif DEBUGMODE==65
color= vec3f(NdotV);
#elif DEBUGMODE==66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
color=clearcoatOut.clearCoatColor;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==67 && defined(CLEARCOAT)
color= vec3f(clearcoatOut.clearCoatRoughness);
#elif DEBUGMODE==68 && defined(CLEARCOAT)
color= vec3f(clearcoatOut.clearCoatNdotV);
#elif DEBUGMODE==69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)
color=subSurfaceOut.transmittance;
#elif DEBUGMODE==70 && defined(SUBSURFACE) && defined(SS_REFRACTION)
color=subSurfaceOut.refractionTransmittance;
#elif DEBUGMODE==72
color= vec3f(microSurface);
#elif DEBUGMODE==73
color=uniforms.vAlbedoColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==74 && !defined(METALLICWORKFLOW)
color=uniforms.vReflectivityColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==75
color=uniforms.vEmissiveColor;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==80 && defined(RADIANCEOCCLUSION)
color= vec3f(seo);
#elif DEBUGMODE==81 && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
color= vec3f(eho);
#elif DEBUGMODE==82 && defined(MS_BRDF_ENERGY_CONSERVATION)
color= vec3f(energyConservationFactor);
#elif DEBUGMODE==83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
color=specularEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
color=clearcoatOut.clearCoatEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==85 && defined(SHEEN) && defined(REFLECTION)
color=sheenOut.sheenEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==86 && defined(ALPHABLEND)
color= vec3f(luminanceOverAlpha);
#elif DEBUGMODE==87
color= vec3f(alpha);
#elif DEBUGMODE==88 && defined(ALBEDO)
color= vec3f(albedoTexture.a);
#elif DEBUGMODE==89
color=aoOut.ambientOcclusionColor;
#else
var stripeWidth: f32=30.;var stripePos: f32=abs(floor(input.position.x/stripeWidth));var whichColor: f32=((stripePos)%(2.));var color1: vec3f= vec3f(.6,.2,.2);var color2: vec3f= vec3f(.3,.1,.1);color=mix(color1,color2,whichColor);
#endif
color*=uniforms.vDebugMode.y;
#ifdef DEBUGMODE_NORMALIZE
color=normalize(color)*0.5+0.5;
#endif
#ifdef DEBUGMODE_GAMMA
color=toGammaSpaceVec3(color);
#endif
fragmentOutputs.color=vec4f(color,1.0);
#ifdef PREPASS
fragmentOutputs.fragData0=toLinearSpaceVec3(color); 
fragmentOutputs.fragData1=vec4f(0.,0.,0.,0.); 
#endif
#ifdef DEBUGMODE_FORCERETURN
return fragmentOutputs;
#endif
}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[pbrDebug_name] = pbrDebug_shader;
/** @internal */
const pbrDebugWGSL = { name: pbrDebug_name, shader: pbrDebug_shader };
//# sourceMappingURL=pbrDebug.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/pbr.fragment.js
// Do not edit.

























































const pbr_fragment_name = "pbrPixelShader";
const pbr_fragment_shader = `#define CUSTOM_FRAGMENT_BEGIN
#include<prePassDeclaration>[SCENE_MRT_COUNT]
#include<oitDeclaration>
#ifndef FROMLINEARSPACE
#define FROMLINEARSPACE
#endif
#include<pbrUboDeclaration>
#include<pbrFragmentExtraDeclaration>
#include<lightUboDeclaration>[0..maxSimultaneousLights]
#include<pbrFragmentSamplersDeclaration>
#include<imageProcessingDeclaration>
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#include<helperFunctions>
#include<subSurfaceScatteringFunctions>
#include<importanceSampling>
#include<pbrHelperFunctions>
#include<imageProcessingFunctions>
#include<shadowsFragmentFunctions>
#include<harmonicsFunctions>
#include<pbrDirectLightingSetupFunctions>
#include<pbrDirectLightingFalloffFunctions>
#include<pbrBRDFFunctions>
#include<hdrFilteringFunctions>
#include<pbrDirectLightingFunctions>
#include<pbrIBLFunctions>
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#ifdef REFLECTION
#include<reflectionFunction>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
#include<pbrBlockAlbedoOpacity>
#include<pbrBlockReflectivity>
#include<pbrBlockAmbientOcclusion>
#include<pbrBlockAlphaFresnel>
#include<pbrBlockAnisotropic>
#include<pbrBlockReflection>
#include<pbrBlockSheen>
#include<pbrBlockClearcoat>
#include<pbrBlockIridescence>
#include<pbrBlockSubSurface>
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#include<pbrBlockNormalGeometric>
#include<bumpFragment>
#include<pbrBlockNormalFinal>
var albedoOpacityOut: albedoOpacityOutParams;
#ifdef ALBEDO
var albedoTexture: vec4f=textureSample(albedoSampler,albedoSamplerSampler,fragmentInputs.vAlbedoUV+uvOffset);
#endif
#ifdef OPACITY
var opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV+uvOffset);
#endif
#ifdef DECAL
var decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);
#endif
albedoOpacityOut=albedoOpacityBlock(
uniforms.vAlbedoColor
#ifdef ALBEDO
,albedoTexture
,uniforms.vAlbedoInfos
#endif
#ifdef OPACITY
,opacityMap
,uniforms.vOpacityInfos
#endif
#ifdef DETAIL
,detailColor
,uniforms.vDetailInfos
#endif
#ifdef DECAL
,decalColor
,uniforms.vDecalInfos
#endif
);var surfaceAlbedo: vec3f=albedoOpacityOut.surfaceAlbedo;var alpha: f32=albedoOpacityOut.alpha;
#define CUSTOM_FRAGMENT_UPDATE_ALPHA
#include<depthPrePass>
#define CUSTOM_FRAGMENT_BEFORE_LIGHTS
var aoOut: ambientOcclusionOutParams;
#ifdef AMBIENT
var ambientOcclusionColorMap: vec3f=textureSample(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb;
#endif
aoOut=ambientOcclusionBlock(
#ifdef AMBIENT
ambientOcclusionColorMap,
uniforms.vAmbientInfos
#endif 
);
#include<pbrBlockLightmapInit>
#ifdef UNLIT
var diffuseBase: vec3f= vec3f(1.,1.,1.);
#else
var baseColor: vec3f=surfaceAlbedo;var reflectivityOut: reflectivityOutParams;
#if defined(REFLECTIVITY)
var surfaceMetallicOrReflectivityColorMap: vec4f=textureSample(reflectivitySampler,reflectivitySamplerSampler,fragmentInputs.vReflectivityUV+uvOffset);var baseReflectivity: vec4f=surfaceMetallicOrReflectivityColorMap;
#ifndef METALLICWORKFLOW
#ifdef REFLECTIVITY_GAMMA
surfaceMetallicOrReflectivityColorMap=toLinearSpaceVec4(surfaceMetallicOrReflectivityColorMap);
#endif
surfaceMetallicOrReflectivityColorMap=vec4f(surfaceMetallicOrReflectivityColorMap.rgb*uniforms.vReflectivityInfos.y,surfaceMetallicOrReflectivityColorMap.a);
#endif
#endif
#if defined(MICROSURFACEMAP)
var microSurfaceTexel: vec4f=textureSample(microSurfaceSampler,microSurfaceSamplerSampler,fragmentInputs.vMicroSurfaceSamplerUV+uvOffset)*uniforms.vMicroSurfaceSamplerInfos.y;
#endif
#ifdef METALLICWORKFLOW
var metallicReflectanceFactors: vec4f=uniforms.vMetallicReflectanceFactors;
#ifdef REFLECTANCE
var reflectanceFactorsMap: vec4f=textureSample(reflectanceSampler,reflectanceSamplerSampler,fragmentInputs.vReflectanceUV+uvOffset);
#ifdef REFLECTANCE_GAMMA
reflectanceFactorsMap=toLinearSpaceVec4(reflectanceFactorsMap);
#endif
metallicReflectanceFactors=vec4f(metallicReflectanceFactors.rgb*reflectanceFactorsMap.rgb,metallicReflectanceFactors.a);
#endif
#ifdef METALLIC_REFLECTANCE
var metallicReflectanceFactorsMap: vec4f=textureSample(metallicReflectanceSampler,metallicReflectanceSamplerSampler,fragmentInputs.vMetallicReflectanceUV+uvOffset);
#ifdef METALLIC_REFLECTANCE_GAMMA
metallicReflectanceFactorsMap=toLinearSpaceVec4(metallicReflectanceFactorsMap);
#endif
#ifndef METALLIC_REFLECTANCE_USE_ALPHA_ONLY
metallicReflectanceFactors=vec4f(metallicReflectanceFactors.rgb*metallicReflectanceFactorsMap.rgb,metallicReflectanceFactors.a);
#endif
metallicReflectanceFactors*=metallicReflectanceFactorsMap.a;
#endif
#endif
reflectivityOut=reflectivityBlock(
uniforms.vReflectivityColor
#ifdef METALLICWORKFLOW
,surfaceAlbedo
,metallicReflectanceFactors
#endif
#ifdef REFLECTIVITY
,uniforms.vReflectivityInfos
,surfaceMetallicOrReflectivityColorMap
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
,aoOut.ambientOcclusionColor
#endif
#ifdef MICROSURFACEMAP
,microSurfaceTexel
#endif
#ifdef DETAIL
,detailColor
,uniforms.vDetailInfos
#endif
);var microSurface: f32=reflectivityOut.microSurface;var roughness: f32=reflectivityOut.roughness;
#ifdef METALLICWORKFLOW
surfaceAlbedo=reflectivityOut.surfaceAlbedo;
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
aoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;
#endif
#ifdef ALPHAFRESNEL
#if defined(ALPHATEST) || defined(ALPHABLEND)
var alphaFresnelOut: alphaFresnelOutParams;alphaFresnelOut=alphaFresnelBlock(
normalW,
viewDirectionW,
alpha,
microSurface
);alpha=alphaFresnelOut.alpha;
#endif
#endif
#include<pbrBlockGeometryInfo>
#ifdef ANISOTROPIC
var anisotropicOut: anisotropicOutParams;
#ifdef ANISOTROPIC_TEXTURE
var anisotropyMapData: vec3f=textureSample(anisotropySampler,anisotropySamplerSampler,fragmentInputs.vAnisotropyUV+uvOffset).rgb*uniforms.vAnisotropyInfos.y;
#endif
anisotropicOut=anisotropicBlock(
uniforms.vAnisotropy,
roughness,
#ifdef ANISOTROPIC_TEXTURE
anisotropyMapData,
#endif
TBN,
normalW,
viewDirectionW 
);
#endif
#ifdef REFLECTION
var reflectionOut: reflectionOutParams;
#ifndef USE_CUSTOM_REFLECTION
reflectionOut=reflectionBlock(
fragmentInputs.vPositionW
,normalW
,alphaG
,uniforms.vReflectionMicrosurfaceInfos
,uniforms.vReflectionInfos
,uniforms.vReflectionColor
#ifdef ANISOTROPIC
,anisotropicOut
#endif
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
,NdotVUnclamped
#endif
#ifdef LINEARSPECULARREFLECTION
,roughness
#endif
,reflectionSampler
,reflectionSamplerSampler
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
,fragmentInputs.vEnvironmentIrradiance
#endif
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
,uniforms.reflectionMatrix
#endif
#endif
#ifdef USEIRRADIANCEMAP
,irradianceSampler
,irradianceSamplerSampler
#endif
#ifndef LODBASEDMICROSFURACE
,reflectionLowSampler
,reflectionLowSamplerSampler
,reflectionHighSampler
,reflectionHighSamplerSampler
#endif
#ifdef REALTIME_FILTERING
,uniforms.vReflectionFilteringInfo
#endif
);
#else
#define CUSTOM_REFLECTION
#endif
#endif
#include<pbrBlockReflectance0>
#ifdef SHEEN
var sheenOut: sheenOutParams;
#ifdef SHEEN_TEXTURE
var sheenMapData: vec4f=textureSample(sheenSampler,sheenSamplerSampler,fragmentInputs.vSheenUV+uvOffset);
#endif
#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
var sheenMapRoughnessData: vec4f=textureSample(sheenRoughnessSampler,sheenRoughnessSamplerSampler,fragmentInputs.vSheenRoughnessUV+uvOffset)*uniforms.vSheenInfos.w;
#endif
sheenOut=sheenBlock(
uniforms.vSheenColor
#ifdef SHEEN_ROUGHNESS
,uniforms.vSheenRoughness
#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
,sheenMapRoughnessData
#endif
#endif
,roughness
#ifdef SHEEN_TEXTURE
,sheenMapData
,uniforms.vSheenInfos.y
#endif
,reflectance
#ifdef SHEEN_LINKWITHALBEDO
,baseColor
,surfaceAlbedo
#endif
#ifdef ENVIRONMENTBRDF
,NdotV
,environmentBrdf
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
,AARoughnessFactors
,uniforms.vReflectionMicrosurfaceInfos
,uniforms.vReflectionInfos
,uniforms.vReflectionColor
,uniforms.vLightingIntensity
,reflectionSampler
,reflectionSamplerSampler
,reflectionOut.reflectionCoords
,NdotVUnclamped
#ifndef LODBASEDMICROSFURACE
,reflectionLowSampler
,reflectionLowSamplerSampler
,reflectionHighSampler
,reflectionHighSamplerSampler
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
,seo
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
,eho
#endif
#endif
);
#ifdef SHEEN_LINKWITHALBEDO
surfaceAlbedo=sheenOut.surfaceAlbedo;
#endif
#endif
#ifdef CLEARCOAT
#ifdef CLEARCOAT_TEXTURE
var clearCoatMapData: vec2f=textureSample(clearCoatSampler,clearCoatSamplerSampler,fragmentInputs.vClearCoatUV+uvOffset).rg*uniforms.vClearCoatInfos.y;
#endif
#endif
#ifdef IRIDESCENCE
var iridescenceOut: iridescenceOutParams;
#ifdef IRIDESCENCE_TEXTURE
var iridescenceMapData: vec2f=textureSample(iridescenceSampler,iridescenceSamplerSampler,fragmentInputs.vIridescenceUV+uvOffset).rg*uniforms.vIridescenceInfos.y;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
var iridescenceThicknessMapData: vec2f=textureSample(iridescenceThicknessSampler,iridescenceThicknessSamplerSampler,fragmentInputs.vIridescenceThicknessUV+uvOffset).rg*uniforms.vIridescenceInfos.w;
#endif
iridescenceOut=iridescenceBlock(
uniforms.vIridescenceParams
,NdotV
,specularEnvironmentR0
#ifdef IRIDESCENCE_TEXTURE
,iridescenceMapData
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
,iridescenceThicknessMapData
#endif
#ifdef CLEARCOAT
,NdotVUnclamped
#ifdef CLEARCOAT_TEXTURE
,clearCoatMapData
#endif
#endif
);var iridescenceIntensity: f32=iridescenceOut.iridescenceIntensity;specularEnvironmentR0=iridescenceOut.specularEnvironmentR0;
#endif
var clearcoatOut: clearcoatOutParams;
#ifdef CLEARCOAT
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
var clearCoatMapRoughnessData: vec4f=textureSample(clearCoatRoughnessSampler,clearCoatRoughnessSamplerSampler,fragmentInputs.vClearCoatRoughnessUV+uvOffset)*uniforms.vClearCoatInfos.w;
#endif
#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
var clearCoatTintMapData: vec4f=textureSample(clearCoatTintSampler,clearCoatTintSamplerSampler,fragmentInputs.vClearCoatTintUV+uvOffset);
#endif
#ifdef CLEARCOAT_BUMP
var clearCoatBumpMapData: vec4f=textureSample(clearCoatBumpSampler,clearCoatBumpSamplerSampler,fragmentInputs.vClearCoatBumpUV+uvOffset);
#endif
clearcoatOut=clearcoatBlock(
fragmentInputs.vPositionW
,geometricNormalW
,viewDirectionW
,uniforms.vClearCoatParams
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
,clearCoatMapRoughnessData
#endif
,specularEnvironmentR0
#ifdef CLEARCOAT_TEXTURE
,clearCoatMapData
#endif
#ifdef CLEARCOAT_TINT
,uniforms.vClearCoatTintParams
,uniforms.clearCoatColorAtDistance
,uniforms.vClearCoatRefractionParams
#ifdef CLEARCOAT_TINT_TEXTURE
,clearCoatTintMapData
#endif
#endif
#ifdef CLEARCOAT_BUMP
,uniforms.vClearCoatBumpInfos
,clearCoatBumpMapData
,fragmentInputs.vClearCoatBumpUV
#if defined(TANGENT) && defined(NORMAL)
,vTBN
#else
,uniforms.vClearCoatTangentSpaceParams
#endif
#ifdef OBJECTSPACE_NORMALMAP
,uniforms.normalMatrix
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
,faceNormal
#endif
#ifdef REFLECTION
,uniforms.vReflectionMicrosurfaceInfos
,uniforms.vReflectionInfos
,uniforms.vReflectionColor
,uniforms.vLightingIntensity
,reflectionSampler
,reflectionSamplerSampler
#ifndef LODBASEDMICROSFURACE
,reflectionLowSampler
,reflectionLowSamplerSampler
,reflectionHighSampler
,reflectionHighSamplerSampler
#endif
#ifdef REALTIME_FILTERING
,uniforms.vReflectionFilteringInfo
#endif
#endif
#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
,select(-1.,1.,fragmentInputs.frontFacing)
#endif
);
#else
clearcoatOut.specularEnvironmentR0=specularEnvironmentR0;
#endif
#include<pbrBlockReflectance>
var subSurfaceOut: subSurfaceOutParams;
#ifdef SUBSURFACE
#ifdef SS_THICKNESSANDMASK_TEXTURE
var thicknessMap: vec4f=textureSample(thicknessSampler,thicknessSamplerSampler,fragmentInputs.vThicknessUV+uvOffset);
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
var refractionIntensityMap: vec4f=textureSample(refractionIntensitySampler,refractionIntensitySamplerSampler,fragmentInputs.vRefractionIntensityUV+uvOffset);
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
var translucencyIntensityMap: vec4f=textureSample(translucencyIntensitySampler,translucencyIntensitySamplerSampler,fragmentInputs.vTranslucencyIntensityUV+uvOffset);
#endif
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
var translucencyColorMap: vec4f=textureSample(translucencyColorSampler,translucencyColorSamplerSampler,fragmentInputs.vTranslucencyColorUV+uvOffset);
#endif
subSurfaceOut=subSurfaceBlock(
uniforms.vSubSurfaceIntensity
,uniforms.vThicknessParam
,uniforms.vTintColor
,normalW
,specularEnvironmentReflectance
#ifdef SS_THICKNESSANDMASK_TEXTURE
,thicknessMap
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
,refractionIntensityMap
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
,translucencyIntensityMap
#endif
#ifdef REFLECTION
#ifdef SS_TRANSLUCENCY
,uniforms.reflectionMatrix
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
,reflectionOut.irradianceVector
#endif
#if defined(REALTIME_FILTERING)
,reflectionSampler
,reflectionSamplerSampler
,vReflectionFilteringInfo
#endif
#endif
#ifdef USEIRRADIANCEMAP
,irradianceSampler
,irradianceSamplerSampler
#endif
#endif
#endif
#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
,surfaceAlbedo
#endif
#ifdef SS_REFRACTION
,fragmentInputs.vPositionW
,viewDirectionW
,scene.view
,uniforms.vRefractionInfos
,uniforms.refractionMatrix
,uniforms.vRefractionMicrosurfaceInfos
,uniforms.vLightingIntensity
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
,alpha
#endif
#ifdef SS_LODINREFRACTIONALPHA
,NdotVUnclamped
#endif
#ifdef SS_LINEARSPECULARREFRACTION
,roughness
#endif
,alphaG
,refractionSampler
,refractionSamplerSampler
#ifndef LODBASEDMICROSFURACE
,refractionLowSampler
,refractionLowSamplerSampler
,refractionHighSampler
,refractionHighSamplerSampler
#endif
#ifdef ANISOTROPIC
,anisotropicOut
#endif
#ifdef REALTIME_FILTERING
,uniforms.vRefractionFilteringInfo
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,uniforms.vRefractionPosition
,uniforms.vRefractionSize
#endif
#ifdef SS_DISPERSION
,dispersion
#endif
#endif
#ifdef SS_TRANSLUCENCY
,uniforms.vDiffusionDistance
,uniforms.vTranslucencyColor
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
,translucencyColorMap
#endif
#endif
);
#ifdef SS_REFRACTION
surfaceAlbedo=subSurfaceOut.surfaceAlbedo;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
alpha=subSurfaceOut.alpha;
#endif
#endif
#else
subSurfaceOut.specularEnvironmentReflectance=specularEnvironmentReflectance;
#endif
#include<pbrBlockDirectLighting>
#include<lightFragment>[0..maxSimultaneousLights]
#include<pbrBlockFinalLitComponents>
#endif 
#include<pbrBlockFinalUnlitComponents>
#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION
#include<pbrBlockFinalColorComposition>
#include<logDepthFragment>
#include<fogFragment>(color,finalColor)
#include<pbrBlockImageProcessing>
#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
#ifdef PREPASS
#include<pbrBlockPrePass>
#endif
#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)
fragmentOutputs.color=finalColor;
#endif
#include<oitFragment>
#if ORDER_INDEPENDENT_TRANSPARENCY
if (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+finalColor.rgb*finalColor.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-finalColor.a));} else {fragmentOutputs.backColor+=finalColor;}
#endif
#include<pbrDebug>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[pbr_fragment_name] = pbr_fragment_shader;
/** @internal */
const pbrPixelShaderWGSL = { name: pbr_fragment_name, shader: pbr_fragment_shader };
//# sourceMappingURL=pbr.fragment.js.map

/***/ }),

/***/ 39174:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   pbrVertexShaderWGSL: () => (/* binding */ pbrVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_pbrUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34035);
/* harmony import */ var _ShadersInclude_uvAttributeDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1008);
/* harmony import */ var _ShadersInclude_mainUVVaryingDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41861);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32806);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98900);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_prePassVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(37769);
/* harmony import */ var _ShadersInclude_samplerVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(89277);
/* harmony import */ var _ShadersInclude_harmonicsFunctions_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(45978);
/* harmony import */ var _ShadersInclude_bumpVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(97777);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(77029);
/* harmony import */ var _ShadersInclude_fogVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(75757);
/* harmony import */ var _ShadersInclude_lightVxUboDeclaration_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(3925);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(76340);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(8217);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(18258);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(9129);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(65470);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(40242);
/* harmony import */ var _ShadersInclude_prePassVertex_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(47033);
/* harmony import */ var _ShadersInclude_uvVariableDeclaration_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(20774);
/* harmony import */ var _ShadersInclude_samplerVertexImplementation_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(52231);
/* harmony import */ var _ShadersInclude_bumpVertex_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(87921);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(85197);
/* harmony import */ var _ShadersInclude_fogVertex_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(59013);
/* harmony import */ var _ShadersInclude_shadowsVertex_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(79456);
/* harmony import */ var _ShadersInclude_vertexColorMixing_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(820);
/* harmony import */ var _ShadersInclude_logDepthVertex_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(81482);
// Do not edit.
































const name = "pbrVertexShader";
const shader = `#include<pbrUboDeclaration>
#define CUSTOM_VERTEX_BEGIN
attribute position: vec3f;
#ifdef NORMAL
attribute normal: vec3f;
#endif
#ifdef TANGENT
attribute tangent: vec4f;
#endif
#ifdef UV1
attribute uv: vec2f;
#endif
#include<uvAttributeDeclaration>[2..7]
#include<mainUVVaryingDeclaration>[1..7]
#ifdef VERTEXCOLOR
attribute color: vec4f;
#endif
#include<helperFunctions>
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
#include<prePassVertexDeclaration>
#include<samplerVertexDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo)
#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity)
#include<samplerVertexDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler)
#include<samplerVertexDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance)
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance)
#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)
#ifdef CLEARCOAT
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint)
#endif
#ifdef IRIDESCENCE
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence)
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness)
#endif
#ifdef SHEEN
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen)
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
#endif
#ifdef ANISOTROPIC
#include<samplerVertexDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy)
#endif
#ifdef SUBSURFACE
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor)
#endif
varying vPositionW: vec3f;
#if DEBUGMODE>0
varying vClipSpacePosition: vec4f;
#endif
#ifdef NORMAL
varying vNormalW: vec3f;
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
varying vEnvironmentIrradiance: vec3f;
#include<harmonicsFunctions>
#endif
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vColor: vec4f;
#endif
#include<bumpVertexDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<lightVxUboDeclaration>[0..maxSimultaneousLights]
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
varying vPositionUVW: vec3f;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vDirectionW: vec3f;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
var positionUpdated: vec3f=vertexInputs.position;
#ifdef NORMAL
var normalUpdated: vec3f=vertexInputs.normal;
#endif
#ifdef TANGENT
var tangentUpdated: vec4f=vertexInputs.tangent;
#endif
#ifdef UV1
var uvUpdated: vec2f=vertexInputs.uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
vertexOutputs.vPositionUVW=positionUpdated;
#endif
#define CUSTOM_VERTEX_UPDATE_POSITION
#define CUSTOM_VERTEX_UPDATE_NORMAL
#include<instancesVertex>
#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);vertexOutputs.vPositionW= worldPos.xyz;
#ifdef PREPASS
#include<prePassVertex>
#endif
#ifdef NORMAL
var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW);
#else
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);
#endif
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
var reflectionVector: vec3f= (uniforms.reflectionMatrix* vec4f(vertexOutputs.vNormalW,0)).xyz;
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
vertexOutputs.vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);
#endif
#endif
#define CUSTOM_VERTEX_UPDATE_WORLDPOS
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;}
#else
vertexOutputs.position=scene.viewProjection*worldPos;
#endif
#if DEBUGMODE>0
vertexOutputs.vClipSpacePosition=vertexOutputs.position;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vertexOutputs.vDirectionW=normalize((finalWorld*vec4f(positionUpdated,0.0)).xyz);
#endif
#ifndef UV1
var uvUpdated: vec2f= vec2f(0.,0.);
#endif
#ifdef MAINUV1
vertexOutputs.vMainUV1=uvUpdated;
#endif
#include<uvVariableDeclaration>[2..7]
#include<samplerVertexImplementation>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_MATRIXNAME_,albedo,_INFONAME_,AlbedoInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_MATRIXNAME_,reflectivity,_INFONAME_,ReflectivityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_MATRIXNAME_,microSurfaceSampler,_INFONAME_,MicroSurfaceSamplerInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_MATRIXNAME_,metallicReflectance,_INFONAME_,MetallicReflectanceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_MATRIXNAME_,reflectance,_INFONAME_,ReflectanceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)
#ifdef CLEARCOAT
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_MATRIXNAME_,clearCoat,_INFONAME_,ClearCoatInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness,_MATRIXNAME_,clearCoatRoughness,_INFONAME_,ClearCoatInfos.z)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_MATRIXNAME_,clearCoatBump,_INFONAME_,ClearCoatBumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_MATRIXNAME_,clearCoatTint,_INFONAME_,ClearCoatTintInfos.x)
#endif
#ifdef IRIDESCENCE
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_MATRIXNAME_,iridescence,_INFONAME_,IridescenceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_MATRIXNAME_,iridescenceThickness,_INFONAME_,IridescenceInfos.z)
#endif
#ifdef SHEEN
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness,_MATRIXNAME_,sheenRoughness,_INFONAME_,SheenInfos.z)
#endif
#ifdef ANISOTROPIC
#include<samplerVertexImplementation>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_MATRIXNAME_,anisotropy,_INFONAME_,AnisotropyInfos.x)
#endif
#ifdef SUBSURFACE
#include<samplerVertexImplementation>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_MATRIXNAME_,thickness,_INFONAME_,ThicknessInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_MATRIXNAME_,refractionIntensity,_INFONAME_,RefractionIntensityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_MATRIXNAME_,translucencyIntensity,_INFONAME_,TranslucencyIntensityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_MATRIXNAME_,translucencyColor,_INFONAME_,TranslucencyColorInfos.x)
#endif
#include<bumpVertex>
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const pbrVertexShaderWGSL = { name, shader };
//# sourceMappingURL=pbr.vertex.js.map

/***/ }),

/***/ 99949:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   pickingPixelShaderWGSL: () => (/* binding */ pickingPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "pickingPixelShader";
const shader = `#if defined(INSTANCES)
varying vMeshID: vec4f;
#else
uniform meshID: vec4f;
#endif
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#if defined(INSTANCES)
fragmentOutputs.color=input.vMeshID;
#else
fragmentOutputs.color=uniforms.meshID;
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const pickingPixelShaderWGSL = { name, shader };
//# sourceMappingURL=picking.fragment.js.map

/***/ }),

/***/ 45095:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   pickingVertexShaderWGSL: () => (/* binding */ pickingVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32806);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98900);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76340);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8217);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44559);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18258);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9129);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91277);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65470);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(40242);
// Do not edit.











const name = "pickingVertexShader";
const shader = `attribute position: vec3f;
#if defined(INSTANCES)
attribute instanceMeshID: vec4f;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
uniform viewProjection: mat4x4f;
#if defined(INSTANCES)
varying vMeshID: vec4f;
#endif
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f=finalWorld*vec4f(input.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;
#if defined(INSTANCES)
vertexOutputs.vMeshID=input.instanceMeshID;
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const pickingVertexShaderWGSL = { name, shader };
//# sourceMappingURL=picking.vertex.js.map

/***/ }),

/***/ 32083:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   postprocessVertexShaderWGSL: () => (/* binding */ postprocessVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "postprocessVertexShader";
const shader = `attribute position: vec2<f32>;uniform scale: vec2<f32>;varying vUV: vec2<f32>;const madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
vertexOutputs.vUV=(vertexInputs.position*madd+madd)*uniforms.scale;vertexOutputs.position=vec4(vertexInputs.position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const postprocessVertexShaderWGSL = { name, shader };
//# sourceMappingURL=postprocess.vertex.js.map

/***/ }),

/***/ 14005:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   proceduralVertexShaderWGSL: () => (/* binding */ proceduralVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "proceduralVertexShader";
const shader = `attribute position: vec2f;varying vPosition: vec2f;varying vUV: vec2f;const madd: vec2f= vec2f(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
vertexOutputs.vPosition=input.position;vertexOutputs.vUV=input.position*madd+madd;vertexOutputs.position= vec4f(input.position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const proceduralVertexShaderWGSL = { name, shader };
//# sourceMappingURL=procedural.vertex.js.map

/***/ }),

/***/ 30371:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   rgbdDecodePixelShaderWGSL: () => (/* binding */ rgbdDecodePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
// Do not edit.


const name = "rgbdDecodePixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=vec4f(fromRGBD(textureSample(textureSampler,textureSamplerSampler,input.vUV)),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const rgbdDecodePixelShaderWGSL = { name, shader };
//# sourceMappingURL=rgbdDecode.fragment.js.map

/***/ }),

/***/ 85035:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   rgbdEncodePixelShaderWGSL: () => (/* binding */ rgbdEncodePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
// Do not edit.


const name = "rgbdEncodePixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=toRGBD(textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const rgbdEncodePixelShaderWGSL = { name, shader };
//# sourceMappingURL=rgbdEncode.fragment.js.map

/***/ }),

/***/ 82365:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   rsmFullGlobalIlluminationPixelShaderWGSL: () => (/* binding */ rsmFullGlobalIlluminationPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "rsmFullGlobalIlluminationPixelShader";
const shader = `/**
* The implementation is a direct application of the formula found in http:
*/
varying vUV: vec2f;uniform rsmLightMatrix: mat4x4f;uniform rsmInfo: vec4f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;var rsmPositionW: texture_2d<f32>;var rsmNormalW: texture_2d<f32>;var rsmFlux: texture_2d<f32>;
#ifdef TRANSFORM_NORMAL
uniform invView: mat4x4f;
#endif
fn computeIndirect(p: vec3f,n: vec3f)->vec3f {var indirectDiffuse: vec3f= vec3f(0.);var intensity: f32=uniforms.rsmInfo.z;var edgeArtifactCorrection: f32=uniforms.rsmInfo.w;var texRSM: vec4f=uniforms.rsmLightMatrix* vec4f(p,1.);texRSM=vec4f(texRSM.xy/texRSM.w,texRSM.z,texRSM.w);texRSM=vec4f(texRSM.xy*0.5+0.5,texRSM.z,texRSM.w);var width: i32= i32(uniforms.rsmInfo.x);var height: i32= i32(uniforms.rsmInfo.y);for (var j: i32=0; j<height; j++) {for (var i: i32=0; i<width; i++) {var uv=vec2<i32>(i,j);var vplPositionW: vec3f=textureLoad(rsmPositionW,uv,0).xyz;var vplNormalW: vec3f=textureLoad(rsmNormalW,uv,0).xyz*2.0-1.0;var vplFlux: vec3f=textureLoad(rsmFlux,uv,0).rgb;vplPositionW-=vplNormalW*edgeArtifactCorrection; 
var dist2: f32=dot(vplPositionW-p,vplPositionW-p);indirectDiffuse+=vplFlux*max(0.,dot(n,vplPositionW-p))*max(0.,dot(vplNormalW,p-vplPositionW))/(dist2*dist2);}}
return clamp(indirectDiffuse*intensity,vec3f(0.0),vec3f(1.0));}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var positionW: vec3f=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.vUV).xyz;var normalW: vec3f=textureSample(normalSampler,normalSamplerSampler,fragmentInputs.vUV).xyz;
#ifdef DECODE_NORMAL
normalW=normalW*2.0-1.0;
#endif
#ifdef TRANSFORM_NORMAL
normalW=(uniforms.invView* vec4f(normalW,0.)).xyz;
#endif
fragmentOutputs.color=vec4f(computeIndirect(positionW,normalW),1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const rsmFullGlobalIlluminationPixelShaderWGSL = { name, shader };
//# sourceMappingURL=rsmFullGlobalIllumination.fragment.js.map

/***/ }),

/***/ 13118:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   rsmGlobalIlluminationPixelShaderWGSL: () => (/* binding */ rsmGlobalIlluminationPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "rsmGlobalIlluminationPixelShader";
const shader = `/**
* The implementation is an application of the formula found in http:
* For better results,it also adds a random (noise) rotation to the RSM samples (the noise artifacts are easier to remove than the banding artifacts).
*/
varying vUV: vec2f;uniform rsmLightMatrix: mat4x4f;uniform rsmInfo: vec4f;uniform rsmInfo2: vec4f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;var rsmPositionWSampler: sampler;var rsmPositionW: texture_2d<f32>;var rsmNormalWSampler: sampler;var rsmNormalW: texture_2d<f32>;var rsmFluxSampler: sampler;var rsmFlux: texture_2d<f32>;var rsmSamples: texture_2d<f32>;
#ifdef TRANSFORM_NORMAL
uniform invView: mat4x4f;
#endif
fn mod289(x: f32)->f32{return x-floor(x*(1.0/289.0))*289.0;}
fn mod289Vec4(x: vec4f)->vec4f {return x-floor(x*(1.0/289.0))* 289.0;}
fn perm(x: vec4f)->vec4f {return mod289Vec4(((x*34.0)+1.0)*x) ;}
fn noise(p: vec3f)->f32{var a: vec3f=floor(p);var d: vec3f=p-a;d=d*d*(3.0-2.0*d);var b: vec4f=a.xxyy+ vec4f(0.0,1.0,0.0,1.0);var k1: vec4f=perm(b.xyxy);var k2: vec4f=perm(k1.xyxy+b.zzww);var c: vec4f=k2+a.zzzz;var k3: vec4f=perm(c);var k4: vec4f=perm(c+1.0);var o1: vec4f=fract(k3*(1.0/41.0));var o2: vec4f=fract(k4*(1.0/41.0));var o3: vec4f=o2*d.z+o1*(1.0-d.z);var o4: vec2f=o3.yw*d.x+o3.xz*(1.0-d.x);return o4.y*d.y+o4.x*(1.0-d.y);}
fn computeIndirect(p: vec3f,n: vec3f)->vec3f {var indirectDiffuse: vec3f= vec3f(0.);var numSamples: i32= i32(uniforms.rsmInfo.x);var radius: f32=uniforms.rsmInfo.y;var intensity: f32=uniforms.rsmInfo.z;var edgeArtifactCorrection: f32=uniforms.rsmInfo.w;var texRSM: vec4f=uniforms.rsmLightMatrix* vec4f(p,1.);texRSM=vec4f(texRSM.xy/texRSM.w,texRSM.z,texRSM.w);texRSM=vec4f(texRSM.xy*0.5+0.5,texRSM.z,texRSM.w);var angle: f32=noise(p*uniforms.rsmInfo2.x);var c: f32=cos(angle);var s: f32=sin(angle);for (var i: i32=0; i<numSamples; i++) {var rsmSample: vec3f=textureLoad(rsmSamples,vec2<i32>(i,0),0).xyz;var weightSquare: f32=rsmSample.z;if (uniforms.rsmInfo2.y==1.0){rsmSample=vec3f(rsmSample.x*c+rsmSample.y*s,-rsmSample.x*s+rsmSample.y*c,rsmSample.z);}
var uv: vec2f=texRSM.xy+rsmSample.xy*radius;if (uv.x<0. || uv.x>1. || uv.y<0. || uv.y>1.) {continue;}
var vplPositionW: vec3f=textureSampleLevel(rsmPositionW,rsmPositionWSampler,uv,0.).xyz;var vplNormalW: vec3f=textureSampleLevel(rsmNormalW,rsmNormalWSampler,uv,0.).xyz*2.0-1.0;var vplFlux: vec3f=textureSampleLevel(rsmFlux,rsmFluxSampler,uv,0.).rgb;vplPositionW-=vplNormalW*edgeArtifactCorrection; 
var dist2: f32=dot(vplPositionW-p,vplPositionW-p);indirectDiffuse+=vplFlux*weightSquare*max(0.,dot(n,vplPositionW-p))*max(0.,dot(vplNormalW,p-vplPositionW))/(dist2*dist2);}
return clamp(indirectDiffuse*intensity,vec3f(0.0),vec3f(1.0));}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var positionW: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).xyz;var normalW: vec3f=textureSample(normalSampler,normalSamplerSampler,input.vUV).xyz;
#ifdef DECODE_NORMAL
normalW=normalW*2.0-1.0;
#endif
#ifdef TRANSFORM_NORMAL
normalW=(uniforms.invView* vec4f(normalW,0.)).xyz;
#endif
fragmentOutputs.color=vec4f(computeIndirect(positionW,normalW),1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const rsmGlobalIlluminationPixelShaderWGSL = { name, shader };
//# sourceMappingURL=rsmGlobalIllumination.fragment.js.map

/***/ }),

/***/ 85423:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   screenSpaceReflection2PixelShaderWGSL: () => (/* binding */ screenSpaceReflection2PixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_pbrBRDFFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75052);
/* harmony import */ var _ShadersInclude_screenSpaceRayTrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95228);
// Do not edit.




const name = "screenSpaceReflection2PixelShader";
const shader = `var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;varying vUV: vec2f;
#ifdef SSR_SUPPORTED
var reflectivitySamplerSampler: sampler;var reflectivitySampler: texture_2d<f32>;var normalSampler: texture_2d<f32>;var depthSampler: texture_2d<f32>;
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
var backDepthSampler: texture_2d<f32>;uniform backSizeFactor: f32;
#endif
#ifdef SSR_USE_ENVIRONMENT_CUBE
var envCubeSamplerSampler: sampler;var envCubeSampler: texture_cube<f32>;
#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC
uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;
#endif
#endif
uniform view: mat4x4f;uniform invView: mat4x4f;uniform projection: mat4x4f;uniform invProjectionMatrix: mat4x4f;uniform projectionPixel: mat4x4f;uniform nearPlaneZ: f32;uniform farPlaneZ: f32;uniform stepSize: f32;uniform maxSteps: f32;uniform strength: f32;uniform thickness: f32;uniform roughnessFactor: f32;uniform reflectionSpecularFalloffExponent: f32;uniform maxDistance: f32;uniform selfCollisionNumSkip: f32;uniform reflectivityThreshold: f32;
#include<helperFunctions>
#include<pbrBRDFFunctions>
#include<screenSpaceRayTrace>
fn hash(a: vec3f)->vec3f
{var result=fract(a*0.8);result+=dot(result,result.yxz+19.19);return fract((result.xxy+result.yxx)*result.zyx);}
fn computeAttenuationForIntersection(ihitPixel: vec2f,hitUV: vec2f,vsRayOrigin: vec3f,vsHitPoint: vec3f,reflectionVector: vec3f,maxRayDistance: f32,numIterations: f32)->f32 {var attenuation: f32=1.0;
#ifdef SSR_ATTENUATE_SCREEN_BORDERS
var dCoords: vec2f=smoothstep(vec2f(0.2),vec2f(0.6),abs( vec2f(0.5,0.5)-hitUV.xy));attenuation*=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);
#endif
#ifdef SSR_ATTENUATE_INTERSECTION_DISTANCE
#endif
#ifdef SSR_ATTENUATE_INTERSECTION_NUMITERATIONS
attenuation*=1.0-(numIterations/uniforms.maxSteps);
#endif
#ifdef SSR_ATTENUATE_BACKFACE_REFLECTION
var reflectionNormal: vec3f=texelFetch(normalSampler,hitPixel,0).xyz;var directionBasedAttenuation: f32=smoothstep(-0.17,0.0,dot(reflectionNormal,-reflectionVector));attenuation*=directionBasedAttenuation;
#endif
return attenuation;}
#endif
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#ifdef SSR_SUPPORTED
var colorFull: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var color: vec3f=colorFull.rgb;var reflectivity: vec4f=textureSampleLevel(reflectivitySampler,reflectivitySamplerSampler,input.vUV,0.0);
#ifndef SSR_DISABLE_REFLECTIVITY_TEST
if (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=uniforms.reflectivityThreshold) {
#ifdef SSR_USE_BLUR
fragmentOutputs.color= vec4f(0.);
#else
fragmentOutputs.color=colorFull;
#endif
return fragmentOutputs;}
#endif
#ifdef SSR_INPUT_IS_GAMMA_SPACE
color=toLinearSpaceVec3(color);
#endif
var texSize: vec2f= vec2f(textureDimensions(depthSampler,0));var csNormal: vec3f=textureLoad(normalSampler,vec2<i32>(input.vUV*texSize),0).xyz; 
#ifdef SSR_DECODE_NORMAL
csNormal=csNormal*2.0-1.0;
#endif
#ifdef SSR_NORMAL_IS_IN_WORLDSPACE
csNormal=(uniforms.view* vec4f(csNormal,0.0)).xyz;
#endif
var depth: f32=textureLoad(depthSampler,vec2<i32>(input.vUV*texSize),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
depth=linearizeDepth(depth,uniforms.nearPlaneZ,uniforms.farPlaneZ);
#endif
var csPosition: vec3f=computeViewPosFromUVDepth(input.vUV,depth,uniforms.projection,uniforms.invProjectionMatrix);
#ifdef ORTHOGRAPHIC_CAMERA
var csViewDirection: vec3f= vec3f(0.,0.,1.);
#else
var csViewDirection: vec3f=normalize(csPosition);
#endif
var csReflectedVector: vec3f=reflect(csViewDirection,csNormal);
#ifdef SSR_USE_ENVIRONMENT_CUBE
var wReflectedVector: vec3f=(uniforms.invView* vec4f(csReflectedVector,0.0)).xyz;
#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC
var worldPos: vec4f=uniforms.invView* vec4f(csPosition,1.0);wReflectedVector=parallaxCorrectNormal(worldPos.xyz,normalize(wReflectedVector),uniforms.vReflectionSize,uniforms.vReflectionPosition);
#endif
#ifdef SSR_INVERTCUBICMAP
wReflectedVector.y*=-1.0;
#endif
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
wReflectedVector.z*=-1.0;
#endif
var envColor: vec3f=textureSampleLevel(envCubeSampler,envCubeSamplerSampler,wReflectedVector,0.0).xyz;
#ifdef SSR_ENVIRONMENT_CUBE_IS_GAMMASPACE
envColor=toLinearSpaceVec3(envColor);
#endif
#else
var envColor: vec3f=color;
#endif
var reflectionAttenuation: f32=1.0;var rayHasHit: bool=false;var startPixel: vec2f;var hitPixel: vec2f;var hitPoint: vec3f;var numIterations: f32;
#ifdef SSRAYTRACE_DEBUG
var debugColor: vec3f;
#endif
#ifdef SSR_ATTENUATE_FACING_CAMERA
reflectionAttenuation*=1.0-smoothstep(0.25,0.5,dot(-csViewDirection,csReflectedVector));
#endif
if (reflectionAttenuation>0.0) {
#ifdef SSR_USE_BLUR
var jitt: vec3f= vec3f(0.);
#else
var roughness: f32=1.0-reflectivity.a;var jitt: vec3f=mix( vec3f(0.0),hash(csPosition)- vec3f(0.5),roughness)*uniforms.roughnessFactor; 
#endif
var uv2: vec2f=input.vUV*texSize;var c: f32=(uv2.x+uv2.y)*0.25;var jitter: f32=((c)%(1.0)); 
rayHasHit=traceScreenSpaceRay1(
csPosition,
normalize(csReflectedVector+jitt),
uniforms.projectionPixel,
depthSampler,
texSize,
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
backDepthSampler,
uniforms.backSizeFactor,
#endif
uniforms.thickness,
uniforms.nearPlaneZ,
uniforms.farPlaneZ,
uniforms.stepSize,
jitter,
uniforms.maxSteps,
uniforms.maxDistance,
uniforms.selfCollisionNumSkip,
&startPixel,
&hitPixel,
&hitPoint,
&numIterations
#ifdef SSRAYTRACE_DEBUG
,&debugColor
#endif
);}
#ifdef SSRAYTRACE_DEBUG
fragmentOutputs.color= vec4f(debugColor,1.);return fragmentOutputs;
#endif
var F0: vec3f=reflectivity.rgb;var fresnel: vec3f=fresnelSchlickGGXVec3(max(dot(csNormal,-csViewDirection),0.0),F0, vec3f(1.));var SSR: vec3f=envColor;if (rayHasHit) {var reflectedColor: vec3f=textureLoad(textureSampler,vec2<i32>(hitPixel),0).rgb;
#ifdef SSR_INPUT_IS_GAMMA_SPACE
reflectedColor=toLinearSpaceVec3(reflectedColor);
#endif
reflectionAttenuation*=computeAttenuationForIntersection(hitPixel,hitPixel/texSize,csPosition,hitPoint,csReflectedVector,uniforms.maxDistance,numIterations);SSR=reflectedColor*reflectionAttenuation+(1.0-reflectionAttenuation)*envColor;}
#ifndef SSR_BLEND_WITH_FRESNEL
SSR*=fresnel;
#endif
#ifdef SSR_USE_BLUR
var blur_radius: f32=0.0;var roughness: f32=1.0-reflectivity.a*(1.0-uniforms.roughnessFactor);if (roughness>0.001) {var cone_angle: f32=min(roughness,0.999)*3.14159265*0.5;var cone_len: f32=distance(startPixel,hitPixel);var op_len: f32=2.0*tan(cone_angle)*cone_len; 
var a: f32=op_len;var h: f32=cone_len;var a2: f32=a*a;var fh2: f32=4.0f*h*h;blur_radius=(a*(sqrt(a2+fh2)-a))/(4.0f*h);}
fragmentOutputs.color= vec4f(SSR,blur_radius/255.0); 
#else
#ifdef SSR_BLEND_WITH_FRESNEL
var reflectionMultiplier: vec3f=clamp(pow(fresnel*uniforms.strength, vec3f(uniforms.reflectionSpecularFalloffExponent)),vec3f(0.0),vec3f(1.0));
#else
var reflectionMultiplier: vec3f=clamp(pow(reflectivity.rgb*uniforms.strength, vec3f(uniforms.reflectionSpecularFalloffExponent)),vec3f(0.0),vec3f(1.0));
#endif
var colorMultiplier: vec3f=1.0-reflectionMultiplier;var finalColor: vec3f=(color*colorMultiplier)+(SSR*reflectionMultiplier);
#ifdef SSR_OUTPUT_IS_GAMMA_SPACE
finalColor=toGammaSpaceVec3(finalColor);
#endif
fragmentOutputs.color= vec4f(finalColor,colorFull.a);
#endif
#else
fragmentOutputs.color=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const screenSpaceReflection2PixelShaderWGSL = { name, shader };
//# sourceMappingURL=screenSpaceReflection2.fragment.js.map

/***/ }),

/***/ 66584:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   screenSpaceReflection2BlurPixelShaderWGSL: () => (/* binding */ screenSpaceReflection2BlurPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "screenSpaceReflection2BlurPixelShader";
const shader = `var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;varying vUV: vec2f;uniform texelOffsetScale: vec2f;const weights: array<f32,8>=array<f32,8>(0.071303,0.131514,0.189879,0.321392,0.452906, 0.584419,0.715932,0.847445);fn processSample(uv: vec2f,i: f32,stepSize: vec2f,accumulator: ptr<function,vec4f>,denominator: ptr<function,f32>)
{var offsetUV: vec2f=stepSize*i+uv;var coefficient: f32=weights[ i32(2.0-abs(i))];*accumulator+=textureSampleLevel(textureSampler,textureSamplerSampler,offsetUV,0.0)*coefficient;*denominator+=coefficient;}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var colorFull: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);if (dot(colorFull, vec4f(1.0))==0.0) {fragmentOutputs.color=colorFull;return fragmentOutputs;}
var blurRadius: f32=colorFull.a*255.0; 
var stepSize: vec2f=uniforms.texelOffsetScale.xy*blurRadius;var accumulator: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0)*0.214607;var denominator: f32=0.214607;processSample(input.vUV,1.0,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*0.2,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*0.4,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*0.6,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*0.8,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*1.2,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*1.4,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*1.6,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*1.8,stepSize,&accumulator,&denominator);processSample(input.vUV,1.0*2.0,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*0.2,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*0.4,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*0.6,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*0.8,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*1.2,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*1.4,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*1.6,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*1.8,stepSize,&accumulator,&denominator);processSample(input.vUV,-1.0*2.0,stepSize,&accumulator,&denominator);fragmentOutputs.color= vec4f(accumulator.rgb/denominator,colorFull.a);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const screenSpaceReflection2BlurPixelShaderWGSL = { name, shader };
//# sourceMappingURL=screenSpaceReflection2Blur.fragment.js.map

/***/ }),

/***/ 44143:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   screenSpaceReflection2BlurCombinerPixelShaderWGSL: () => (/* binding */ screenSpaceReflection2BlurCombinerPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79702);
/* harmony import */ var _ShadersInclude_pbrBRDFFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75052);
/* harmony import */ var _ShadersInclude_screenSpaceRayTrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95228);
// Do not edit.




const name = "screenSpaceReflection2BlurCombinerPixelShader";
const shader = `var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>; 
var mainSamplerSampler: sampler;var mainSampler: texture_2d<f32>;var reflectivitySamplerSampler: sampler;var reflectivitySampler: texture_2d<f32>;uniform strength: f32;uniform reflectionSpecularFalloffExponent: f32;uniform reflectivityThreshold: f32;varying vUV: vec2f;
#include<helperFunctions>
#ifdef SSR_BLEND_WITH_FRESNEL
#include<pbrBRDFFunctions>
#include<screenSpaceRayTrace>
uniform projection: mat4x4f;uniform invProjectionMatrix: mat4x4f;var normalSampler: texture_2d<f32>;var depthSampler: texture_2d<f32>;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
uniform nearPlaneZ: f32;uniform farPlaneZ: f32;
#endif
#endif
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#ifdef SSRAYTRACE_DEBUG
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);
#else
var SSR: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var color: vec4f=textureSample(mainSampler,textureSamplerSampler,input.vUV);var reflectivity: vec4f=textureSample(reflectivitySampler,reflectivitySamplerSampler,input.vUV);
#ifndef SSR_DISABLE_REFLECTIVITY_TEST
if (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=uniforms.reflectivityThreshold) {fragmentOutputs.color=color;return fragmentOutputs;}
#endif
#ifdef SSR_INPUT_IS_GAMMA_SPACE
color=toLinearSpaceVec4(color);
#endif
#ifdef SSR_BLEND_WITH_FRESNEL
var texSize: vec2f= vec2f(textureDimensions(depthSampler,0));var csNormal: vec3f=textureLoad(normalSampler,vec2<i32>(input.vUV*texSize),0).xyz;var depth: f32=textureLoad(depthSampler,vec2<i32>(input.vUV*texSize),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
depth=linearizeDepth(depth,uniforms.nearPlaneZ,uniforms.farPlaneZ);
#endif
var csPosition: vec3f=computeViewPosFromUVDepth(input.vUV,depth,uniforms.projection,uniforms.invProjectionMatrix);var csViewDirection: vec3f=normalize(csPosition);var F0: vec3f=reflectivity.rgb;var fresnel: vec3f=fresnelSchlickGGXVec3(max(dot(csNormal,-csViewDirection),0.0),F0, vec3f(1.));var reflectionMultiplier: vec3f=clamp(pow(fresnel*uniforms.strength, vec3f(uniforms.reflectionSpecularFalloffExponent)),vec3f(0.0),vec3f(1.0));
#else
var reflectionMultiplier: vec3f=clamp(pow(reflectivity.rgb*uniforms.strength, vec3f(uniforms.reflectionSpecularFalloffExponent)),vec3f(0.0),vec3f(1.0));
#endif
var colorMultiplier: vec3f=1.0-reflectionMultiplier;var finalColor: vec3f=(color.rgb*colorMultiplier)+(SSR*reflectionMultiplier);
#ifdef SSR_OUTPUT_IS_GAMMA_SPACE
finalColor=toGammaSpaceVec3(finalColor);
#endif
fragmentOutputs.color= vec4f(finalColor,color.a);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const screenSpaceReflection2BlurCombinerPixelShaderWGSL = { name, shader };
//# sourceMappingURL=screenSpaceReflection2BlurCombiner.fragment.js.map

/***/ }),

/***/ 87428:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  shadowMapPixelShaderWGSL: () => (/* binding */ shadowMapPixelShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/packingFunctions.js
var packingFunctions = __webpack_require__(5543);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bayerDitherFunctions.js
// Do not edit.

const bayerDitherFunctions_name = "bayerDitherFunctions";
const shader = `fn bayerDither2(_P: vec2f)->f32 {return ((2.0*_P.y+_P.x+1.0)%(4.0));}
fn bayerDither4(_P: vec2f)->f32 {var P1: vec2f=((_P)%(2.0)); 
var P2: vec2f=floor(0.5*((_P)%(4.0))); 
return 4.0*bayerDither2(P1)+bayerDither2(P2);}
fn bayerDither8(_P: vec2f)->f32 {var P1: vec2f=((_P)%(2.0)); 
var P2: vec2f=floor(0.5 *((_P)%(4.0))); 
var P4: vec2f=floor(0.25*((_P)%(8.0))); 
return 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[bayerDitherFunctions_name] = shader;
/** @internal */
const bayerDitherFunctionsWGSL = { name: bayerDitherFunctions_name, shader };
//# sourceMappingURL=bayerDitherFunctions.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowMapFragmentExtraDeclaration.js
// Do not edit.



const shadowMapFragmentExtraDeclaration_name = "shadowMapFragmentExtraDeclaration";
const shadowMapFragmentExtraDeclaration_shader = `#if SM_FLOAT==0
#include<packingFunctions>
#endif
#if SM_SOFTTRANSPARENTSHADOW==1
#include<bayerDitherFunctions>
uniform softTransparentShadowSM: vec2f;
#endif
varying vDepthMetricSM: f32;
#if SM_USEDISTANCE==1
uniform lightDataSM: vec3f;varying vPositionWSM: vec3f;
#endif
uniform biasAndScaleSM: vec3f;uniform depthValuesSM: vec2f;
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
varying zSM: f32;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[shadowMapFragmentExtraDeclaration_name] = shadowMapFragmentExtraDeclaration_shader;
/** @internal */
const shadowMapFragmentExtraDeclarationWGSL = { name: shadowMapFragmentExtraDeclaration_name, shader: shadowMapFragmentExtraDeclaration_shader };
//# sourceMappingURL=shadowMapFragmentExtraDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(39759);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(97715);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowMapFragment.js
var shadowMapFragment = __webpack_require__(89273);
;// ./node_modules/@babylonjs/core/ShadersWGSL/shadowMap.fragment.js
// Do not edit.





const shadowMap_fragment_name = "shadowMapPixelShader";
const shadowMap_fragment_shader = `#include<shadowMapFragmentExtraDeclaration>
#ifdef ALPHATEXTURE
varying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
#endif
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#include<clipPlaneFragment>
#ifdef ALPHATEXTURE
var opacityMap: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUV);var alphaFromAlphaTexture: f32=opacityMap.a;
#if SM_SOFTTRANSPARENTSHADOW==1
if (uniforms.softTransparentShadowSM.y==1.0) {opacityMap=vec4f(opacityMap.rgb* vec3f(0.3,0.59,0.11),opacityMap.a);alphaFromAlphaTexture=opacityMap.x+opacityMap.y+opacityMap.z;}
#endif
#ifdef ALPHATESTVALUE
if (alphaFromAlphaTexture<ALPHATESTVALUE) {discard;}
#endif
#endif
#if SM_SOFTTRANSPARENTSHADOW==1
#ifdef ALPHATEXTURE
if ((bayerDither8(floor(((fragmentInputs.position.xy)%(8.0)))))/64.0>=uniforms.softTransparentShadowSM.x*alphaFromAlphaTexture) {discard;}
#else
if ((bayerDither8(floor(((fragmentInputs.position.xy)%(8.0)))))/64.0>=uniforms.softTransparentShadowSM.x) {discard;} 
#endif
#endif
#include<shadowMapFragment>
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[shadowMap_fragment_name] = shadowMap_fragment_shader;
/** @internal */
const shadowMapPixelShaderWGSL = { name: shadowMap_fragment_name, shader: shadowMap_fragment_shader };
//# sourceMappingURL=shadowMap.fragment.js.map

/***/ }),

/***/ 32303:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  shadowMapVertexShaderWGSL: () => (/* binding */ shadowMapVertexShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(32806);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(98900);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__(76340);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__(8217);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(79702);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js
var sceneUboDeclaration = __webpack_require__(98327);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/meshUboDeclaration.js
var meshUboDeclaration = __webpack_require__(6874);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowMapVertexExtraDeclaration.js
// Do not edit.

const shadowMapVertexExtraDeclaration_name = "shadowMapVertexExtraDeclaration";
const shader = `#if SM_NORMALBIAS==1
uniform lightDataSM: vec3f;
#endif
uniform biasAndScaleSM: vec3f;uniform depthValuesSM: vec2f;varying vDepthMetricSM: f32;
#if SM_USEDISTANCE==1
varying vPositionWSM: vec3f;
#endif
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
varying zSM: f32;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[shadowMapVertexExtraDeclaration_name] = shader;
/** @internal */
const shadowMapVertexExtraDeclarationWGSL = { name: shadowMapVertexExtraDeclaration_name, shader };
//# sourceMappingURL=shadowMapVertexExtraDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(77029);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__(18258);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__(9129);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(91277);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(65470);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(40242);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowMapVertexNormalBias.js
// Do not edit.

const shadowMapVertexNormalBias_name = "shadowMapVertexNormalBias";
const shadowMapVertexNormalBias_shader = `#if SM_NORMALBIAS==1
#if SM_DIRECTIONINLIGHTDATA==1
var worldLightDirSM: vec3f=normalize(-uniforms.lightDataSM.xyz);
#else
var directionToLightSM: vec3f=uniforms.lightDataSM.xyz-worldPos.xyz;var worldLightDirSM: vec3f=normalize(directionToLightSM);
#endif
var ndlSM: f32=dot(vNormalW,worldLightDirSM);var sinNLSM: f32=sqrt(1.0-ndlSM*ndlSM);var normalBiasSM: f32=uniforms.biasAndScaleSM.y*sinNLSM;worldPos=vec4f(worldPos.xyz-vNormalW*normalBiasSM,worldPos.w);
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[shadowMapVertexNormalBias_name] = shadowMapVertexNormalBias_shader;
/** @internal */
const shadowMapVertexNormalBiasWGSL = { name: shadowMapVertexNormalBias_name, shader: shadowMapVertexNormalBias_shader };
//# sourceMappingURL=shadowMapVertexNormalBias.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowMapVertexMetric.js
var shadowMapVertexMetric = __webpack_require__(71311);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(85197);
;// ./node_modules/@babylonjs/core/ShadersWGSL/shadowMap.vertex.js
// Do not edit.


















const shadowMap_vertex_name = "shadowMapVertexShader";
const shadowMap_vertex_shader = `attribute position: vec3f;
#ifdef NORMAL
attribute normal: vec3f;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef INSTANCES
attribute world0: vec4f;attribute world1: vec4f;attribute world2: vec4f;attribute world3: vec4f;
#endif
#include<helperFunctions>
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
#ifdef ALPHATEXTURE
varying vUV: vec2f;uniform diffuseMatrix: mat4x4f;
#ifdef UV1
attribute uv: vec2f;
#endif
#ifdef UV2
attribute uv2: vec2f;
#endif
#endif
#include<shadowMapVertexExtraDeclaration>
#include<clipPlaneVertexDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;
#ifdef UV1
var uvUpdated: vec2f=input.uv;
#endif
#ifdef NORMAL
var normalUpdated: vec3f=input.normal;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);
#ifdef NORMAL
var normWorldSM: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
var vNormalW: vec3f=normalUpdated/ vec3f(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normWorldSM=transposeMat3(inverseMat3(normWorldSM));
#endif
var vNormalW: vec3f=normalize(normWorldSM*normalUpdated);
#endif
#endif
#include<shadowMapVertexNormalBias>
vertexOutputs.position=scene.viewProjection*worldPos;
#include<shadowMapVertexMetric>
#ifdef ALPHATEXTURE
#ifdef UV1
vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
#endif
#ifdef UV2
vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(input.uv2,1.0,0.0)).xy;
#endif
#endif
#include<clipPlaneVertex>
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[shadowMap_vertex_name] = shadowMap_vertex_shader;
/** @internal */
const shadowMapVertexShaderWGSL = { name: shadowMap_vertex_name, shader: shadowMap_vertex_shader };
//# sourceMappingURL=shadowMap.vertex.js.map

/***/ }),

/***/ 35381:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   sharpenPixelShaderWGSL: () => (/* binding */ sharpenPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "sharpenPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;uniform sharpnessAmounts: vec2f;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var onePixel: vec2f= vec2f(1.0,1.0)/uniforms.screenSize;var color: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);var edgeDetection: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel*vec2f(0,-1)) +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel*vec2f(-1,0)) +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel*vec2f(1,0)) +
textureSample(textureSampler,textureSamplerSampler,input.vUV+onePixel*vec2f(0,1)) -
color*4.0;fragmentOutputs.color=max(vec4f(color.rgb*uniforms.sharpnessAmounts.y,color.a)-(uniforms.sharpnessAmounts.x* vec4f(edgeDetection.rgb,0)),vec4f(0.));}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const sharpenPixelShaderWGSL = { name, shader };
//# sourceMappingURL=sharpen.fragment.js.map

/***/ }),

/***/ 62843:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  spritesPixelShaderWGSL: () => (/* binding */ spritesPixelShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__(66407);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(93226);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__(38780);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__(93243);
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingCompatibility.js
// Do not edit.

const imageProcessingCompatibility_name = "imageProcessingCompatibility";
const shader = `#ifdef IMAGEPROCESSINGPOSTPROCESS
fragmentOutputs.color=vec4f(pow(fragmentOutputs.color.rgb, vec3f(2.2)),fragmentOutputs.color.a);
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[imageProcessingCompatibility_name] = shader;
/** @internal */
const imageProcessingCompatibilityWGSL = { name: imageProcessingCompatibility_name, shader };
//# sourceMappingURL=imageProcessingCompatibility.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/sprites.fragment.js
// Do not edit.






const sprites_fragment_name = "spritesPixelShader";
const sprites_fragment_shader = `uniform alphaTest: i32;varying vColor: vec4f;varying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
#include<fogFragmentDeclaration>
#include<logDepthDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
#ifdef PIXEL_PERFECT
fn uvPixelPerfect(uv: vec2f)->vec2f {var res: vec2f= vec2f(textureDimensions(diffuseSampler,0));var uvTemp=uv*res;var seam: vec2f=floor(uvTemp+0.5);uvTemp=seam+clamp((uvTemp-seam)/fwidth(uvTemp),vec2f(-0.5),vec2f(0.5));return uvTemp/res;}
#endif
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#ifdef PIXEL_PERFECT
var uv: vec2f=uvPixelPerfect(input.vUV);
#else
var uv: vec2f=input.vUV;
#endif
var color: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,uv);var fAlphaTest: f32= f32(uniforms.alphaTest);if (fAlphaTest != 0.)
{if (color.a<0.95) {discard;}}
color*=input.vColor;
#include<logDepthFragment>
#include<fogFragment>
fragmentOutputs.color=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[sprites_fragment_name] = sprites_fragment_shader;
/** @internal */
const spritesPixelShaderWGSL = { name: sprites_fragment_name, shader: sprites_fragment_shader };
//# sourceMappingURL=sprites.fragment.js.map

/***/ }),

/***/ 24448:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   spritesVertexShaderWGSL: () => (/* binding */ spritesVertexShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_fogVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(75757);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93226);
/* harmony import */ var _ShadersInclude_logDepthVertex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81482);
// Do not edit.




const name = "spritesVertexShader";
const shader = `attribute position: vec4f;attribute options: vec2f;attribute offsets: vec2f;attribute inverts: vec2f;attribute cellInfo: vec4f;attribute color: vec4f;uniform view: mat4x4f;uniform projection: mat4x4f;varying vUV: vec2f;varying vColor: vec4f;
#include<fogVertexDeclaration>
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
var viewPos: vec3f=(uniforms.view* vec4f(input.position.xyz,1.0)).xyz; 
var cornerPos: vec2f;var angle: f32=input.position.w;var size: vec2f= vec2f(input.options.x,input.options.y);var offset: vec2f=input.offsets.xy;cornerPos= vec2f(offset.x-0.5,offset.y -0.5)*size;var rotatedCorner: vec3f;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;viewPos+=rotatedCorner;vertexOutputs.position=uniforms.projection*vec4f(viewPos,1.0); 
vertexOutputs.vColor=input.color;var uvOffset: vec2f= vec2f(abs(offset.x-input.inverts.x),abs(1.0-offset.y-input.inverts.y));var uvPlace: vec2f=input.cellInfo.xy;var uvSize: vec2f=input.cellInfo.zw;vertexOutputs.vUV.x=uvPlace.x+uvSize.x*uvOffset.x;vertexOutputs.vUV.y=uvPlace.y+uvSize.y*uvOffset.y;
#ifdef FOG
vertexOutputs.vFogDistance=viewPos;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const spritesVertexShaderWGSL = { name, shader };
//# sourceMappingURL=sprites.vertex.js.map

/***/ }),

/***/ 45076:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ssao2PixelShaderWGSL: () => (/* binding */ ssao2PixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "ssao2PixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;
#ifdef SSAO
const scales: array<f32,16>=array<f32,16>(
0.1,
0.11406250000000001,
0.131640625,
0.15625,
0.187890625,
0.2265625,
0.272265625,
0.325,
0.384765625,
0.4515625,
0.525390625,
0.60625,
0.694140625,
0.7890625,
0.891015625,
1.0
);uniform near: f32;uniform radius: f32;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;var randomSamplerSampler: sampler;var randomSampler: texture_2d<f32>;var normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;uniform randTextureTiles: f32;uniform samplesFactor: f32;uniform sampleSphere: array<vec3f,SAMPLES>;uniform totalStrength: f32;uniform base: f32;uniform xViewport: f32;uniform yViewport: f32;uniform depthProjection: mat3x3f;uniform maxZ: f32;uniform minZAspect: f32;uniform texelSize: vec2f;uniform projection: mat4x4f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var random: vec3f=textureSampleLevel(randomSampler,randomSamplerSampler,input.vUV*uniforms.randTextureTiles,0.0).rgb;var depth: f32=textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.0).r;var depthSign: f32=sign(depth);depth=depth*depthSign;var normal: vec3f=textureSampleLevel(normalSampler,normalSamplerSampler,input.vUV,0.0).rgb;var occlusion: f32=0.0;var correctedRadius: f32=min(uniforms.radius,uniforms.minZAspect*depth/uniforms.near);var vViewRay: vec3f= vec3f((input.vUV.x*2.0-1.0)*uniforms.xViewport,(input.vUV.y*2.0-1.0)*uniforms.yViewport,depthSign);var vDepthFactor: vec3f=uniforms.depthProjection* vec3f(1.0,1.0,depth);var origin: vec3f=vViewRay*vDepthFactor;var rvec: vec3f=random*2.0-1.0;rvec.z=0.0;var dotProduct: f32=dot(rvec,normal);rvec=select( vec3f(-rvec.y,0.0,rvec.x),rvec,1.0-abs(dotProduct)>1e-2);var tangent: vec3f=normalize(rvec-normal*dot(rvec,normal));var bitangent: vec3f=cross(normal,tangent);var tbn: mat3x3f= mat3x3f(tangent,bitangent,normal);var difference: f32;for (var i: i32=0; i<SAMPLES; i++) {var samplePosition: vec3f=scales[(i+ i32(random.x*16.0)) % 16]*tbn*uniforms.sampleSphere[(i+ i32(random.y*16.0)) % 16];samplePosition=samplePosition*correctedRadius+origin;var offset: vec4f= vec4f(samplePosition,1.0);offset=uniforms.projection*offset;offset=vec4f(offset.xyz/offset.w,offset.w);offset=vec4f(offset.xy*0.5+0.5,offset.z,offset.w);if (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {continue;}
var sampleDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,offset.xy,0.0).r);difference=depthSign*samplePosition.z-sampleDepth;var rangeCheck: f32=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);occlusion+=step(EPSILON,difference)*rangeCheck;}
occlusion=occlusion*(1.0-smoothstep(uniforms.maxZ*0.75,uniforms.maxZ,depth));var ao: f32=1.0-uniforms.totalStrength*occlusion*uniforms.samplesFactor;var result: f32=clamp(ao+uniforms.base,0.0,1.0);fragmentOutputs.color= vec4f( vec3f(result),1.0);}
#else
#ifdef BLUR
uniform outSize: f32;uniform soften: f32;uniform tolerance: f32;uniform samples: i32;
#ifndef BLUR_BYPASS
var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;
#ifdef BLUR_LEGACY
fn blur13Bilateral(image: texture_2d<f32>,imageSampler: sampler,uv: vec2f,step: vec2f)->f32 {var result: f32=0.0;var off1: vec2f= vec2f(1.411764705882353)*step;var off2: vec2f= vec2f(3.2941176470588234)*step;var off3: vec2f= vec2f(5.176470588235294)*step;var compareDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv,0.0).r);var sampleDepth: f32;var weight: f32;var weightSum: f32=30.0;result+=textureSampleLevel(image,imageSampler,uv,0.0).r*30.0;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv+off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureSampleLevel(image,imageSampler,uv+off1,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv-off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureSampleLevel(image,imageSampler,uv-off1,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv+off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv+off2,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv-off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv-off2,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv+off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv+off3,0.0).r*weight;sampleDepth=abs(textureSampleLevel(depthSampler,depthSamplerSampler,uv-off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureSampleLevel(image,imageSampler,uv-off3,0.0).r*weight;return result/weightSum;}
#endif
#endif
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var result: f32=0.0;
#ifdef BLUR_BYPASS
result=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0).r;
#else
#ifdef BLUR_H
var step: vec2f= vec2f(1.0/uniforms.outSize,0.0);
#else
var step: vec2f= vec2f(0.0,1.0/uniforms.outSize);
#endif
#ifdef BLUR_LEGACY
result=blur13Bilateral(textureSampler,textureSamplerSampler,input.vUV,step);
#else
var compareDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,input.vUV,0.0).r);var weightSum: f32=0.0;for (var i: i32=-uniforms.samples; i<uniforms.samples; i+=2)
{var samplePos: vec2f=input.vUV+step*( f32(i)+0.5);var sampleDepth: f32=abs(textureSampleLevel(depthSampler,depthSamplerSampler,samplePos,0.0).r);var falloff: f32=smoothstep(0.0,
f32(uniforms.samples),
f32(uniforms.samples)-abs( f32(i))*uniforms.soften);var minDivider: f32=uniforms.tolerance*0.5+0.003;var weight: f32=falloff/( minDivider+abs(compareDepth-sampleDepth));result+=textureSampleLevel(textureSampler,textureSamplerSampler,samplePos,0.0).r*weight;weightSum+=weight;}
result/=weightSum;
#endif
#endif
fragmentOutputs.color=vec4f(result,result,result,1.0);}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const ssao2PixelShaderWGSL = { name, shader };
//# sourceMappingURL=ssao2.fragment.js.map

/***/ }),

/***/ 68217:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ssaoCombinePixelShaderWGSL: () => (/* binding */ ssaoCombinePixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "ssaoCombinePixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var originalColorSampler: sampler;var originalColor: texture_2d<f32>;uniform viewport: vec4f;
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
var ssaoColor: vec4f=textureSample(textureSampler,textureSamplerSampler,uniforms.viewport.xy+input.vUV*uniforms.viewport.zw);var sceneColor: vec4f=textureSample(originalColor,originalColorSampler,input.vUV);fragmentOutputs.color=sceneColor*ssaoColor;
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const ssaoCombinePixelShaderWGSL = { name, shader };
//# sourceMappingURL=ssaoCombine.fragment.js.map

/***/ }),

/***/ 37706:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   taaPixelShaderWGSL: () => (/* binding */ taaPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "taaPixelShader";
const shader = `var textureSampler: texture_2d<f32>;var historySampler: texture_2d<f32>;uniform factor: f32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {let c=textureLoad(textureSampler,vec2<i32>(fragmentInputs.position.xy),0);let h=textureLoad(historySampler,vec2<i32>(fragmentInputs.position.xy),0);fragmentOutputs.color= mix(h,c,uniforms.factor);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const taaPixelShaderWGSL = { name, shader };
//# sourceMappingURL=taa.fragment.js.map

/***/ }),

/***/ 18:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   tonemapPixelShaderWGSL: () => (/* binding */ tonemapPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "tonemapPixelShader";
const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform _ExposureAdjustment: f32;
#if defined(HABLE_TONEMAPPING)
const A: f32=0.15;const B: f32=0.50;const C: f32=0.10;const D: f32=0.20;const E: f32=0.02;const F: f32=0.30;const W: f32=11.2;
#endif
fn Luminance(c: vec3f)->f32
{return dot(c, vec3f(0.22,0.707,0.071));}
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var colour: vec3f=textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;
#if defined(REINHARD_TONEMAPPING)
var lum: f32=Luminance(colour.rgb); 
var lumTm: f32=lum*uniforms._ExposureAdjustment;var scale: f32=lumTm/(1.0+lumTm); 
colour*=scale/lum;
#elif defined(HABLE_TONEMAPPING)
colour*=uniforms._ExposureAdjustment;const ExposureBias: f32=2.0;var x: vec3f=ExposureBias*colour;var curr: vec3f=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;x= vec3f(W,W,W);var whiteScale: vec3f=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);colour=curr*whiteScale;
#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)
colour*=uniforms._ExposureAdjustment;var X: vec3f=max( vec3f(0.0,0.0,0.0),colour-0.004);var retColor: vec3f=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);colour=retColor*retColor;
#elif defined(PHOTOGRAPHIC_TONEMAPPING)
colour= vec3f(1.0,1.0,1.0)-exp2(-uniforms._ExposureAdjustment*colour);
#endif
fragmentOutputs.color= vec4f(colour.rgb,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const tonemapPixelShaderWGSL = { name, shader };
//# sourceMappingURL=tonemap.fragment.js.map

/***/ }),

/***/ 57811:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   vrDistortionCorrectionPixelShaderWGSL: () => (/* binding */ vrDistortionCorrectionPixelShaderWGSL)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "vrDistortionCorrectionPixelShader";
const shader = `#define DISABLE_UNIFORMITY_ANALYSIS
varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform LensCenter: vec2f;uniform Scale: vec2f;uniform ScaleIn: vec2f;uniform HmdWarpParam: vec4f;fn HmdWarp(in01: vec2f)->vec2f {var theta: vec2f=(in01-uniforms.LensCenter)*uniforms.ScaleIn; 
var rSq: f32=theta.x*theta.x+theta.y*theta.y;var rvector: vec2f=theta*(uniforms.HmdWarpParam.x+uniforms.HmdWarpParam.y*rSq+uniforms.HmdWarpParam.z*rSq*rSq+uniforms.HmdWarpParam.w*rSq*rSq*rSq);return uniforms.LensCenter+uniforms.Scale*rvector;}
#define CUSTOM_FRAGMENT_DEFINITIONS
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var tc: vec2f=HmdWarp(input.vUV);if (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0) {fragmentOutputs.color=vec4f(0.0,0.0,0.0,0.0);}
else{fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,tc);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStoreWGSL[name] = shader;
/** @internal */
const vrDistortionCorrectionPixelShaderWGSL = { name, shader };
//# sourceMappingURL=vrDistortionCorrection.fragment.js.map

/***/ }),

/***/ 86722:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export backgroundUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _sceneUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28764);
// Do not edit.


const name = "backgroundUboDeclaration";
const shader = `layout(std140,column_major) uniform;uniform Material
{uniform vec4 vPrimaryColor;uniform vec4 vPrimaryColorShadow;uniform vec2 vDiffuseInfos;uniform vec2 vReflectionInfos;uniform mat4 diffuseMatrix;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;uniform float pointSize;uniform float shadowLevel;uniform float alpha;uniform vec3 vBackgroundCenter;uniform vec4 vReflectionControl;uniform vec2 projectedGroundInfos;};
#include<sceneUboDeclaration>
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const backgroundUboDeclaration = { name, shader };
//# sourceMappingURL=backgroundUboDeclaration.js.map

/***/ }),

/***/ 65523:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export bakedVertexAnimation */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bakedVertexAnimation";
const shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
{
#ifdef INSTANCES
#define BVASNAME bakedVertexAnimationSettingsInstanced
#else
#define BVASNAME bakedVertexAnimationSettings
#endif
float VATStartFrame=BVASNAME.x;float VATEndFrame=BVASNAME.y;float VATOffsetFrame=BVASNAME.z;float VATSpeed=BVASNAME.w;float totalFrames=VATEndFrame-VATStartFrame+1.0;float time=bakedVertexAnimationTime*VATSpeed/totalFrames;float frameCorrection=time<1.0 ? 0.0 : 1.0;float numOfFrames=totalFrames-frameCorrection;float VATFrameNum=fract(time)*numOfFrames;VATFrameNum=mod(VATFrameNum+VATOffsetFrame,numOfFrames);VATFrameNum=floor(VATFrameNum);VATFrameNum+=VATStartFrame+frameCorrection;mat4 VATInfluence;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];
#endif
finalWorld=finalWorld*VATInfluence;}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const bakedVertexAnimation = { name, shader };
//# sourceMappingURL=bakedVertexAnimation.js.map

/***/ }),

/***/ 18959:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export bakedVertexAnimationDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bakedVertexAnimationDeclaration";
const shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
uniform float bakedVertexAnimationTime;uniform vec2 bakedVertexAnimationTextureSizeInverted;uniform vec4 bakedVertexAnimationSettings;uniform sampler2D bakedVertexAnimationTexture;
#ifdef INSTANCES
attribute vec4 bakedVertexAnimationSettingsInstanced;
#endif
#define inline
mat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame)
{float offset=index*4.0;float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;float dx=bakedVertexAnimationTextureSizeInverted.x;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));return mat4(m0,m1,m2,m3);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const bakedVertexAnimationDeclaration = { name, shader };
//# sourceMappingURL=bakedVertexAnimationDeclaration.js.map

/***/ }),

/***/ 69707:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bonesDeclaration: () => (/* binding */ bonesDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bonesDeclaration";
const shader = `#if NUM_BONE_INFLUENCERS>0
attribute vec4 matricesIndices;attribute vec4 matricesWeights;
#if NUM_BONE_INFLUENCERS>4
attribute vec4 matricesIndicesExtra;attribute vec4 matricesWeightsExtra;
#endif
#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#ifdef BONETEXTURE
uniform highp sampler2D boneSampler;uniform float boneTextureWidth;
#else
uniform mat4 mBones[BonesPerMesh];
#endif
#ifdef BONES_VELOCITY_ENABLED
uniform mat4 mPreviousBones[BonesPerMesh];
#endif
#ifdef BONETEXTURE
#define inline
mat4 readMatrixFromRawSampler(sampler2D smp,float index)
{float offset=index *4.0;float dx=1.0/boneTextureWidth;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));return mat4(m0,m1,m2,m3);}
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const bonesDeclaration = { name, shader };
//# sourceMappingURL=bonesDeclaration.js.map

/***/ }),

/***/ 3361:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bonesVertex: () => (/* binding */ bonesVertex)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bonesVertex";
const shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
#if NUM_BONE_INFLUENCERS>0
mat4 influence;
#ifdef BONETEXTURE
influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];
#endif
#else
influence=mBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
influence+=mBones[int(matricesIndices[1])]*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
influence+=mBones[int(matricesIndices[2])]*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
influence+=mBones[int(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
influence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
influence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
influence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
influence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
#endif
finalWorld=finalWorld*influence;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const bonesVertex = { name, shader };
//# sourceMappingURL=bonesVertex.js.map

/***/ }),

/***/ 66566:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export boundingBoxRendererUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "boundingBoxRendererUboDeclaration";
const shader = `#ifdef WEBGL2
uniform vec4 color;uniform mat4 world;uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
#else
layout(std140,column_major) uniform;uniform BoundingBoxRenderer {vec4 color;mat4 world;mat4 viewProjection;mat4 viewProjectionR;};
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const boundingBoxRendererUboDeclaration = { name, shader };
//# sourceMappingURL=boundingBoxRendererUboDeclaration.js.map

/***/ }),

/***/ 27018:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bumpFragment: () => (/* binding */ bumpFragment)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bumpFragment";
const shader = `vec2 uvOffset=vec2(0.0,0.0);
#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)
#ifdef NORMALXYSCALE
float normalScale=1.0;
#elif defined(BUMP)
float normalScale=vBumpInfos.y;
#else
float normalScale=1.0;
#endif
#if defined(TANGENT) && defined(NORMAL)
mat3 TBN=vTBN;
#elif defined(BUMP)
vec2 TBNUV=gl_FrontFacing ? vBumpUV : -vBumpUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams);
#else
vec2 TBNUV=gl_FrontFacing ? vDetailUV : -vDetailUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vec2(1.,1.));
#endif
#elif defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL)
mat3 TBN=vTBN;
#else
vec2 TBNUV=gl_FrontFacing ? vMainUV1 : -vMainUV1;mat3 TBN=cotangent_frame(normalW,vPositionW,TBNUV,vec2(1.,1.));
#endif
#endif
#ifdef PARALLAX
mat3 invTBN=transposeMat3(TBN);
#ifdef PARALLAXOCCLUSION
uvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);
#else
uvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);
#endif
#endif
#ifdef DETAIL
vec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);vec2 detailNormalRG=detailColor.wy*2.0-1.0;float detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));vec3 detailNormal=vec3(detailNormalRG,detailNormalB);
#endif
#ifdef BUMP
#ifdef OBJECTSPACE_NORMALMAP
#define CUSTOM_FRAGMENT_BUMP_FRAGMENT
normalW=normalize(texture2D(bumpSampler,vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3(normalMatrix)*normalW);
#elif !defined(DETAIL)
normalW=perturbNormal(TBN,texture2D(bumpSampler,vBumpUV+uvOffset).xyz,vBumpInfos.y);
#else
vec3 bumpNormal=texture2D(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;
#if DETAIL_NORMALBLENDMETHOD==0 
detailNormal.xy*=vDetailInfos.z;vec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));
#elif DETAIL_NORMALBLENDMETHOD==1 
detailNormal.xy*=vDetailInfos.z;bumpNormal+=vec3(0.0,0.0,1.0);detailNormal*=vec3(-1.0,-1.0,1.0);vec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;
#endif
normalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);
#endif
#elif defined(DETAIL)
detailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const bumpFragment = { name, shader };
//# sourceMappingURL=bumpFragment.js.map

/***/ }),

/***/ 8269:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bumpFragmentFunctions: () => (/* binding */ bumpFragmentFunctions)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _samplerFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(63022);
// Do not edit.


const name = "bumpFragmentFunctions";
const shader = `#if defined(BUMP)
#include<samplerFragmentDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)
#endif
#if defined(DETAIL)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail)
#endif
#if defined(BUMP) && defined(PARALLAX)
const float minSamples=4.;const float maxSamples=15.;const int iMaxSamples=15;vec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {float parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;vec2 vOffsetDir=normalize(vViewDirCoT.xy);vec2 vMaxOffset=vOffsetDir*parallaxLimit;float numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));float stepSize=1.0/numSamples;float currRayHeight=1.0;vec2 vCurrOffset=vec2(0,0);vec2 vLastOffset=vec2(0,0);float lastSampledHeight=1.0;float currSampledHeight=1.0;bool keepWorking=true;for (int i=0; i<iMaxSamples; i++)
{currSampledHeight=texture2D(bumpSampler,texCoord+vCurrOffset).w;if (!keepWorking)
{}
else if (currSampledHeight>currRayHeight)
{float delta1=currSampledHeight-currRayHeight;float delta2=(currRayHeight+stepSize)-lastSampledHeight;float ratio=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;}
else
{currRayHeight-=stepSize;vLastOffset=vCurrOffset;
#ifdef PARALLAX_RHS
vCurrOffset-=stepSize*vMaxOffset;
#else
vCurrOffset+=stepSize*vMaxOffset;
#endif
lastSampledHeight=currSampledHeight;}}
return vCurrOffset;}
vec2 parallaxOffset(vec3 viewDir,float heightScale)
{float height=texture2D(bumpSampler,vBumpUV).w;vec2 texCoordOffset=heightScale*viewDir.xy*height;
#ifdef PARALLAX_RHS
return texCoordOffset;
#else
return -texCoordOffset;
#endif
}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const bumpFragmentFunctions = { name, shader };
//# sourceMappingURL=bumpFragmentFunctions.js.map

/***/ }),

/***/ 17494:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bumpFragmentMainFunctions: () => (/* binding */ bumpFragmentMainFunctions)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bumpFragmentMainFunctions";
const shader = `#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)
#if defined(TANGENT) && defined(NORMAL) 
varying mat3 vTBN;
#endif
#ifdef OBJECTSPACE_NORMALMAP
uniform mat4 normalMatrix;
#if defined(WEBGL2) || defined(WEBGPU)
mat4 toNormalMatrix(mat4 wMatrix)
{mat4 ret=inverse(wMatrix);ret=transpose(ret);ret[0][3]=0.;ret[1][3]=0.;ret[2][3]=0.;ret[3]=vec4(0.,0.,0.,1.);return ret;}
#else
mat4 toNormalMatrix(mat4 m)
{float
a00=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3],
a10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3],
a20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3],
a30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3],
b00=a00*a11-a01*a10,
b01=a00*a12-a02*a10,
b02=a00*a13-a03*a10,
b03=a01*a12-a02*a11,
b04=a01*a13-a03*a11,
b05=a02*a13-a03*a12,
b06=a20*a31-a21*a30,
b07=a20*a32-a22*a30,
b08=a20*a33-a23*a30,
b09=a21*a32-a22*a31,
b10=a21*a33-a23*a31,
b11=a22*a33-a23*a32,
det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;mat4 mi=mat4(
a11*b11-a12*b10+a13*b09,
a02*b10-a01*b11-a03*b09,
a31*b05-a32*b04+a33*b03,
a22*b04-a21*b05-a23*b03,
a12*b08-a10*b11-a13*b07,
a00*b11-a02*b08+a03*b07,
a32*b02-a30*b05-a33*b01,
a20*b05-a22*b02+a23*b01,
a10*b10-a11*b08+a13*b06,
a01*b08-a00*b10-a03*b06,
a30*b04-a31*b02+a33*b00,
a21*b02-a20*b04-a23*b00,
a11*b07-a10*b09-a12*b06,
a00*b09-a01*b07+a02*b06,
a31*b01-a30*b03-a32*b00,
a20*b03-a21*b01+a22*b00)/det;return mat4(mi[0][0],mi[1][0],mi[2][0],mi[3][0],
mi[0][1],mi[1][1],mi[2][1],mi[3][1],
mi[0][2],mi[1][2],mi[2][2],mi[3][2],
mi[0][3],mi[1][3],mi[2][3],mi[3][3]);}
#endif
#endif
vec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale)
{
#ifdef NORMALXYSCALE
normal=normalize(normal*vec3(scale,scale,1.0));
#endif
return normalize(cotangentFrame*normal);}
vec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale)
{return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);}
mat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams)
{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;float det=max(dot(tangent,tangent),dot(bitangent,bitangent));float invmax=det==0.0 ? 0.0 : inversesqrt(det);return mat3(tangent*invmax,bitangent*invmax,normal);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const bumpFragmentMainFunctions = { name, shader };
//# sourceMappingURL=bumpFragmentMainFunctions.js.map

/***/ }),

/***/ 19440:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export bumpVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bumpVertex";
const shader = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL)
vec3 tbnNormal=normalize(normalUpdated);vec3 tbnTangent=normalize(tangentUpdated.xyz);vec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;vTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const bumpVertex = { name, shader };
//# sourceMappingURL=bumpVertex.js.map

/***/ }),

/***/ 56390:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export bumpVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bumpVertexDeclaration";
const shader = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#if defined(TANGENT) && defined(NORMAL) 
varying mat3 vTBN;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const bumpVertexDeclaration = { name, shader };
//# sourceMappingURL=bumpVertexDeclaration.js.map

/***/ }),

/***/ 7412:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clipPlaneFragment: () => (/* binding */ clipPlaneFragment)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "clipPlaneFragment";
const shader = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
if (false) {}
#endif
#ifdef CLIPPLANE
else if (fClipDistance>0.0)
{discard;}
#endif
#ifdef CLIPPLANE2
else if (fClipDistance2>0.0)
{discard;}
#endif
#ifdef CLIPPLANE3
else if (fClipDistance3>0.0)
{discard;}
#endif
#ifdef CLIPPLANE4
else if (fClipDistance4>0.0)
{discard;}
#endif
#ifdef CLIPPLANE5
else if (fClipDistance5>0.0)
{discard;}
#endif
#ifdef CLIPPLANE6
else if (fClipDistance6>0.0)
{discard;}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const clipPlaneFragment = { name, shader };
//# sourceMappingURL=clipPlaneFragment.js.map

/***/ }),

/***/ 6194:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clipPlaneFragmentDeclaration: () => (/* binding */ clipPlaneFragmentDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "clipPlaneFragmentDeclaration";
const shader = `#ifdef CLIPPLANE
varying float fClipDistance;
#endif
#ifdef CLIPPLANE2
varying float fClipDistance2;
#endif
#ifdef CLIPPLANE3
varying float fClipDistance3;
#endif
#ifdef CLIPPLANE4
varying float fClipDistance4;
#endif
#ifdef CLIPPLANE5
varying float fClipDistance5;
#endif
#ifdef CLIPPLANE6
varying float fClipDistance6;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const clipPlaneFragmentDeclaration = { name, shader };
//# sourceMappingURL=clipPlaneFragmentDeclaration.js.map

/***/ }),

/***/ 47314:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clipPlaneVertex: () => (/* binding */ clipPlaneVertex)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "clipPlaneVertex";
const shader = `#ifdef CLIPPLANE
fClipDistance=dot(worldPos,vClipPlane);
#endif
#ifdef CLIPPLANE2
fClipDistance2=dot(worldPos,vClipPlane2);
#endif
#ifdef CLIPPLANE3
fClipDistance3=dot(worldPos,vClipPlane3);
#endif
#ifdef CLIPPLANE4
fClipDistance4=dot(worldPos,vClipPlane4);
#endif
#ifdef CLIPPLANE5
fClipDistance5=dot(worldPos,vClipPlane5);
#endif
#ifdef CLIPPLANE6
fClipDistance6=dot(worldPos,vClipPlane6);
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const clipPlaneVertex = { name, shader };
//# sourceMappingURL=clipPlaneVertex.js.map

/***/ }),

/***/ 71636:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clipPlaneVertexDeclaration: () => (/* binding */ clipPlaneVertexDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "clipPlaneVertexDeclaration";
const shader = `#ifdef CLIPPLANE
uniform vec4 vClipPlane;varying float fClipDistance;
#endif
#ifdef CLIPPLANE2
uniform vec4 vClipPlane2;varying float fClipDistance2;
#endif
#ifdef CLIPPLANE3
uniform vec4 vClipPlane3;varying float fClipDistance3;
#endif
#ifdef CLIPPLANE4
uniform vec4 vClipPlane4;varying float fClipDistance4;
#endif
#ifdef CLIPPLANE5
uniform vec4 vClipPlane5;varying float fClipDistance5;
#endif
#ifdef CLIPPLANE6
uniform vec4 vClipPlane6;varying float fClipDistance6;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const clipPlaneVertexDeclaration = { name, shader };
//# sourceMappingURL=clipPlaneVertexDeclaration.js.map

/***/ }),

/***/ 11205:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export decalFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "decalFragment";
const shader = `#ifdef DECAL
#ifdef GAMMADECAL
decalColor.rgb=toLinearSpace(decalColor.rgb);
#endif
#ifdef DECAL_SMOOTHALPHA
decalColor.a*=decalColor.a;
#endif
surfaceAlbedo.rgb=mix(surfaceAlbedo.rgb,decalColor.rgb,decalColor.a);
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const decalFragment = { name, shader };
//# sourceMappingURL=decalFragment.js.map

/***/ }),

/***/ 48109:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export decalFragmentDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "decalFragmentDeclaration";
const shader = `#ifdef DECAL
uniform vec4 vDecalInfos;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const decalFragmentDeclaration = { name, shader };
//# sourceMappingURL=decalFragmentDeclaration.js.map

/***/ }),

/***/ 96019:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export decalVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "decalVertexDeclaration";
const shader = `#ifdef DECAL
uniform vec4 vDecalInfos;uniform mat4 decalMatrix;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const decalVertexDeclaration = { name, shader };
//# sourceMappingURL=decalVertexDeclaration.js.map

/***/ }),

/***/ 81438:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export defaultUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _sceneUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28764);
/* harmony import */ var _meshUboDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96467);
// Do not edit.



const name = "defaultUboDeclaration";
const shader = `layout(std140,column_major) uniform;uniform Material
{vec4 diffuseLeftColor;vec4 diffuseRightColor;vec4 opacityParts;vec4 reflectionLeftColor;vec4 reflectionRightColor;vec4 refractionLeftColor;vec4 refractionRightColor;vec4 emissiveLeftColor;vec4 emissiveRightColor;vec2 vDiffuseInfos;vec2 vAmbientInfos;vec2 vOpacityInfos;vec2 vReflectionInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec2 vSpecularInfos;vec3 vBumpInfos;mat4 diffuseMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 reflectionMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 specularMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;float pointSize;float alphaCutOff;mat4 refractionMatrix;vec4 vRefractionInfos;vec3 vRefractionPosition;vec3 vRefractionSize;vec4 vSpecularColor;vec3 vEmissiveColor;vec4 vDiffuseColor;vec3 vAmbientColor;
#define ADDITIONAL_UBO_DECLARATION
};
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const defaultUboDeclaration = { name, shader };
//# sourceMappingURL=defaultUboDeclaration.js.map

/***/ }),

/***/ 1037:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export depthPrePass */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "depthPrePass";
const shader = `#ifdef DEPTHPREPASS
gl_FragColor=vec4(0.,0.,0.,1.0);return;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const depthPrePass = { name, shader };
//# sourceMappingURL=depthPrePass.js.map

/***/ }),

/***/ 2360:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export fogFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fogFragment";
const shader = `#ifdef FOG
float fog=CalcFogFactor();
#ifdef PBR
fog=toLinearSpace(fog);
#endif
color.rgb=mix(vFogColor,color.rgb,fog);
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const fogFragment = { name, shader };
//# sourceMappingURL=fogFragment.js.map

/***/ }),

/***/ 7806:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fogFragmentDeclaration: () => (/* binding */ fogFragmentDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fogFragmentDeclaration";
const shader = `#ifdef FOG
#define FOGMODE_NONE 0.
#define FOGMODE_EXP 1.
#define FOGMODE_EXP2 2.
#define FOGMODE_LINEAR 3.
#define E 2.71828
uniform vec4 vFogInfos;uniform vec3 vFogColor;varying vec3 vFogDistance;float CalcFogFactor()
{float fogCoeff=1.0;float fogStart=vFogInfos.y;float fogEnd=vFogInfos.z;float fogDensity=vFogInfos.w;float fogDistance=length(vFogDistance);if (FOGMODE_LINEAR==vFogInfos.x)
{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}
else if (FOGMODE_EXP==vFogInfos.x)
{fogCoeff=1.0/pow(E,fogDistance*fogDensity);}
else if (FOGMODE_EXP2==vFogInfos.x)
{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}
return clamp(fogCoeff,0.0,1.0);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const fogFragmentDeclaration = { name, shader };
//# sourceMappingURL=fogFragmentDeclaration.js.map

/***/ }),

/***/ 16470:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export fogVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fogVertex";
const shader = `#ifdef FOG
vFogDistance=(view*worldPos).xyz;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const fogVertex = { name, shader };
//# sourceMappingURL=fogVertex.js.map

/***/ }),

/***/ 86560:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export fogVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fogVertexDeclaration";
const shader = `#ifdef FOG
varying vec3 vFogDistance;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const fogVertexDeclaration = { name, shader };
//# sourceMappingURL=fogVertexDeclaration.js.map

/***/ }),

/***/ 51339:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export fresnelFunction */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fresnelFunction";
const shader = `#ifdef FRESNEL
float computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)
{float fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const fresnelFunction = { name, shader };
//# sourceMappingURL=fresnelFunction.js.map

/***/ }),

/***/ 39775:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Q: () => (/* binding */ gaussianSplattingVertexDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "gaussianSplattingVertexDeclaration";
const shader = `attribute vec2 position;uniform mat4 view;uniform mat4 projection;uniform mat4 world;`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const gaussianSplattingVertexDeclaration = { name, shader };
//# sourceMappingURL=gaussianSplattingVertexDeclaration.js.map

/***/ }),

/***/ 19495:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export harmonicsFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "harmonicsFunctions";
const shader = `#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
vec3 computeEnvironmentIrradiance(vec3 normal) {return vSphericalL00
+ vSphericalL1_1*(normal.y)
+ vSphericalL10*(normal.z)
+ vSphericalL11*(normal.x)
+ vSphericalL2_2*(normal.y*normal.x)
+ vSphericalL2_1*(normal.y*normal.z)
+ vSphericalL20*((3.0*normal.z*normal.z)-1.0)
+ vSphericalL21*(normal.z*normal.x)
+ vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}
#else
vec3 computeEnvironmentIrradiance(vec3 normal) {float Nx=normal.x;float Ny=normal.y;float Nz=normal.z;vec3 C1=vSphericalZZ.rgb;vec3 Cx=vSphericalX.rgb;vec3 Cy=vSphericalY.rgb;vec3 Cz=vSphericalZ.rgb;vec3 Cxx_zz=vSphericalXX_ZZ.rgb;vec3 Cyy_zz=vSphericalYY_ZZ.rgb;vec3 Cxy=vSphericalXY.rgb;vec3 Cyz=vSphericalYZ.rgb;vec3 Czx=vSphericalZX.rgb;vec3 a1=Cyy_zz*Ny+Cy;vec3 a2=Cyz*Nz+a1;vec3 b1=Czx*Nz+Cx;vec3 b2=Cxy*Ny+b1;vec3 b3=Cxx_zz*Nx+b2;vec3 t1=Cz *Nz+C1;vec3 t2=a2 *Ny+t1;vec3 t3=b3 *Nx+t2;return t3;}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const harmonicsFunctions = { name, shader };
//# sourceMappingURL=harmonicsFunctions.js.map

/***/ }),

/***/ 78741:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export hdrFilteringFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "hdrFilteringFunctions";
const shader = `#ifdef NUM_SAMPLES
#if NUM_SAMPLES>0
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
float radicalInverse_VdC(uint bits) 
{bits=(bits<<16u) | (bits>>16u);bits=((bits & 0x55555555u)<<1u) | ((bits & 0xAAAAAAAAu)>>1u);bits=((bits & 0x33333333u)<<2u) | ((bits & 0xCCCCCCCCu)>>2u);bits=((bits & 0x0F0F0F0Fu)<<4u) | ((bits & 0xF0F0F0F0u)>>4u);bits=((bits & 0x00FF00FFu)<<8u) | ((bits & 0xFF00FF00u)>>8u);return float(bits)*2.3283064365386963e-10; }
vec2 hammersley(uint i,uint N)
{return vec2(float(i)/float(N),radicalInverse_VdC(i));}
#else
float vanDerCorpus(int n,int base)
{float invBase=1.0/float(base);float denom =1.0;float result =0.0;for(int i=0; i<32; ++i)
{if(n>0)
{denom =mod(float(n),2.0);result+=denom*invBase;invBase=invBase/2.0;n =int(float(n)/2.0);}}
return result;}
vec2 hammersley(int i,int N)
{return vec2(float(i)/float(N),vanDerCorpus(i,2));}
#endif
float log4(float x) {return log2(x)/2.;}
const float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);const float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;const float K=4.;
#define inline
vec3 irradiance(samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)
{vec3 n=normalize(inputN);vec3 result=vec3(0.0);vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
for(uint i=0u; i<NUM_SAMPLES; ++i)
#else
for(int i=0; i<NUM_SAMPLES; ++i)
#endif
{vec2 Xi=hammersley(i,NUM_SAMPLES);vec3 Ls=hemisphereCosSample(Xi);Ls=normalize(Ls);vec3 Ns=vec3(0.,0.,1.);float NoL=dot(Ns,Ls);if (NoL>0.) {float pdf_inversed=PI/NoL;float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(l,0.0,maxLevel);vec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb;
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
result+=c;}}
result=result*NUM_SAMPLES_FLOAT_INVERSED;return result;}
#define inline
vec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)
{vec3 n=normalize(inputN);vec3 c=textureCube(inputTexture,n).rgb; 
if (alphaG==0.) {
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
return c;} else {vec3 result=vec3(0.);vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);float weight=0.;
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
for(uint i=0u; i<NUM_SAMPLES; ++i)
#else
for(int i=0; i<NUM_SAMPLES; ++i)
#endif
{vec2 Xi=hammersley(i,NUM_SAMPLES);vec3 H=hemisphereImportanceSampleDggx(Xi,alphaG);float NoV=1.;float NoH=H.z;float NoH2=H.z*H.z;float NoL=2.*NoH2-1.;vec3 L=vec3(2.*NoH*H.x,2.*NoH*H.y,NoL);L=normalize(L);if (NoL>0.) {float pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(float(l),0.0,maxLevel);weight+=NoL;vec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb;
#ifdef GAMMA_INPUT
c=toLinearSpace(c);
#endif
result+=c*NoL;}}
result=result/weight;return result;}}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const hdrFilteringFunctions = { name, shader };
//# sourceMappingURL=hdrFilteringFunctions.js.map

/***/ }),

/***/ 73325:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   helperFunctions: () => (/* binding */ helperFunctions)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "helperFunctions";
const shader = `const float PI=3.1415926535897932384626433832795;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float HALF_MIN=5.96046448e-08; 
const float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;
#define saturate(x) clamp(x,0.0,1.0)
#define absEps(x) abs(x)+Epsilon
#define maxEps(x) max(x,Epsilon)
#define saturateEps(x) clamp(x,Epsilon,1.0)
mat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(
vec3(i0.x,i1.x,i2.x),
vec3(i0.y,i1.y,i2.y),
vec3(i0.z,i1.z,i2.z)
);return outMatrix;}
mat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),
b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),
b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}
#if USE_EXACT_SRGB_CONVERSIONS
vec3 toLinearSpaceExact(vec3 color)
{vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));
#else
return
vec3(
color.r<=0.04045 ? nearZeroSection.r : remainingSection.r,
color.g<=0.04045 ? nearZeroSection.g : remainingSection.g,
color.b<=0.04045 ? nearZeroSection.b : remainingSection.b);
#endif
}
vec3 toGammaSpaceExact(vec3 color)
{vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));
#else
return
vec3(
color.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,
color.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,
color.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);
#endif
}
#endif
float toLinearSpace(float color)
{
#if USE_EXACT_SRGB_CONVERSIONS
float nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;
#else
return pow(color,LinearEncodePowerApprox);
#endif
}
vec3 toLinearSpace(vec3 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return toLinearSpaceExact(color);
#else
return pow(color,vec3(LinearEncodePowerApprox));
#endif
}
vec4 toLinearSpace(vec4 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return vec4(toLinearSpaceExact(color.rgb),color.a);
#else
return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);
#endif
}
float toGammaSpace(float color)
{
#if USE_EXACT_SRGB_CONVERSIONS
float nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;
#else
return pow(color,GammaEncodePowerApprox);
#endif
}
vec3 toGammaSpace(vec3 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return toGammaSpaceExact(color);
#else
return pow(color,vec3(GammaEncodePowerApprox));
#endif
}
vec4 toGammaSpace(vec4 color)
{
#if USE_EXACT_SRGB_CONVERSIONS
return vec4(toGammaSpaceExact(color.rgb),color.a);
#else
return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);
#endif
}
float square(float value)
{return value*value;}
vec3 square(vec3 value)
{return value*value;}
float pow5(float value) {float sq=value*value;return sq*sq*value;}
float getLuminance(vec3 color)
{return clamp(dot(color,LuminanceEncodeApprox),0.,1.);}
float getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}
float dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}
const float rgbdMaxRange=255.0;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(clamp(rgb,0.,1.),D); }
vec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}
vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const helperFunctions = { name, shader };
//# sourceMappingURL=helperFunctions.js.map

/***/ }),

/***/ 31328:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export imageProcessingCompatibility */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "imageProcessingCompatibility";
const shader = `#ifdef IMAGEPROCESSINGPOSTPROCESS
gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(2.2));
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const imageProcessingCompatibility = { name, shader };
//# sourceMappingURL=imageProcessingCompatibility.js.map

/***/ }),

/***/ 89392:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   imageProcessingDeclaration: () => (/* binding */ imageProcessingDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "imageProcessingDeclaration";
const shader = `#ifdef EXPOSURE
uniform float exposureLinear;
#endif
#ifdef CONTRAST
uniform float contrast;
#endif
#if defined(VIGNETTE) || defined(DITHER)
uniform vec2 vInverseScreenSize;
#endif
#ifdef VIGNETTE
uniform vec4 vignetteSettings1;uniform vec4 vignetteSettings2;
#endif
#ifdef COLORCURVES
uniform vec4 vCameraColorCurveNegative;uniform vec4 vCameraColorCurveNeutral;uniform vec4 vCameraColorCurvePositive;
#endif
#ifdef COLORGRADING
#ifdef COLORGRADING3D
uniform highp sampler3D txColorTransform;
#else
uniform sampler2D txColorTransform;
#endif
uniform vec4 colorTransformSettings;
#endif
#ifdef DITHER
uniform float ditherIntensity;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const imageProcessingDeclaration = { name, shader };
//# sourceMappingURL=imageProcessingDeclaration.js.map

/***/ }),

/***/ 64017:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   imageProcessingFunctions: () => (/* binding */ imageProcessingFunctions)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "imageProcessingFunctions";
const shader = `#if defined(COLORGRADING) && !defined(COLORGRADING3D)
/** 
* Polyfill for SAMPLE_TEXTURE_3D,which is unsupported in WebGL.
* sampler3dSetting.x=textureOffset (0.5/textureSize).
* sampler3dSetting.y=textureSize.
*/
#define inline
vec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)
{float sliceSize=2.0*sampler3dSetting.x; 
#ifdef SAMPLER3DGREENDEPTH
float sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;
#else
float sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;
#endif
float sliceInteger=floor(sliceContinuous);float sliceFraction=sliceContinuous-sliceInteger;
#ifdef SAMPLER3DGREENDEPTH
vec2 sliceUV=color.rb;
#else
vec2 sliceUV=color.rg;
#endif
sliceUV.x*=sliceSize;sliceUV.x+=sliceInteger*sliceSize;sliceUV=saturate(sliceUV);vec4 slice0Color=texture2D(colorTransform,sliceUV);sliceUV.x+=sliceSize;sliceUV=saturate(sliceUV);vec4 slice1Color=texture2D(colorTransform,sliceUV);vec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);
#ifdef SAMPLER3DBGRMAP
color.rgb=result.rgb;
#else
color.rgb=result.bgr;
#endif
return color;}
#endif
#if TONEMAPPING==3
const float PBRNeutralStartCompression=0.8-0.04;const float PBRNeutralDesaturation=0.15;vec3 PBRNeutralToneMapping( vec3 color ) {float x=min(color.r,min(color.g,color.b));float offset=x<0.08 ? x-6.25*x*x : 0.04;color-=offset;float peak=max(color.r,max(color.g,color.b));if (peak<PBRNeutralStartCompression) return color;float d=1.-PBRNeutralStartCompression;float newPeak=1.-d*d/(peak+d-PBRNeutralStartCompression);color*=newPeak/peak;float g=1.-1./(PBRNeutralDesaturation*(peak-newPeak)+1.);return mix(color,newPeak*vec3(1,1,1),g);}
#endif
#if TONEMAPPING==2
const mat3 ACESInputMat=mat3(
vec3(0.59719,0.07600,0.02840),
vec3(0.35458,0.90834,0.13383),
vec3(0.04823,0.01566,0.83777)
);const mat3 ACESOutputMat=mat3(
vec3( 1.60475,-0.10208,-0.00327),
vec3(-0.53108, 1.10813,-0.07276),
vec3(-0.07367,-0.00605, 1.07602)
);vec3 RRTAndODTFit(vec3 v)
{vec3 a=v*(v+0.0245786)-0.000090537;vec3 b=v*(0.983729*v+0.4329510)+0.238081;return a/b;}
vec3 ACESFitted(vec3 color)
{color=ACESInputMat*color;color=RRTAndODTFit(color);color=ACESOutputMat*color;color=saturate(color);return color;}
#endif
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS
vec4 applyImageProcessing(vec4 result) {
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART
#ifdef EXPOSURE
result.rgb*=exposureLinear;
#endif
#ifdef VIGNETTE
vec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;vec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);float vignetteTerm=dot(vignetteXY1,vignetteXY1);float vignette=pow(vignetteTerm,vignetteSettings2.w);vec3 vignetteColor=vignetteSettings2.rgb;
#ifdef VIGNETTEBLENDMODEMULTIPLY
vec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);result.rgb*=vignetteColorMultiplier;
#endif
#ifdef VIGNETTEBLENDMODEOPAQUE
result.rgb=mix(vignetteColor,result.rgb,vignette);
#endif
#endif
#if TONEMAPPING==3
result.rgb=PBRNeutralToneMapping(result.rgb);
#elif TONEMAPPING==2
result.rgb=ACESFitted(result.rgb);
#elif TONEMAPPING==1
const float tonemappingCalibration=1.590579;result.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);
#endif
result.rgb=toGammaSpace(result.rgb);result.rgb=saturate(result.rgb);
#ifdef CONTRAST
vec3 resultHighContrast=result.rgb*result.rgb*(3.0-2.0*result.rgb);if (contrast<1.0) {result.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);} else {result.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);}
#endif
#ifdef COLORGRADING
vec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;
#ifdef COLORGRADING3D
vec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;
#else
vec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;
#endif
result.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);
#endif
#ifdef COLORCURVES
float luma=getLuminance(result.rgb);vec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));vec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;result.rgb*=colorCurve.rgb;result.rgb=mix(vec3(luma),result.rgb,colorCurve.a);
#endif
#ifdef DITHER
float rand=getRand(gl_FragCoord.xy*vInverseScreenSize);float dither=mix(-ditherIntensity,ditherIntensity,rand);result.rgb=saturate(result.rgb+vec3(dither));
#endif
#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND
return result;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const imageProcessingFunctions = { name, shader };
//# sourceMappingURL=imageProcessingFunctions.js.map

/***/ }),

/***/ 21469:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export importanceSampling */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "importanceSampling";
const shader = `vec3 hemisphereCosSample(vec2 u) {float phi=2.*PI*u.x;float cosTheta2=1.-u.y;float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
vec3 hemisphereImportanceSampleDggx(vec2 u,float a) {float phi=2.*PI*u.x;float cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
vec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) { 
float phi=2.*PI*u.x;float sinTheta=pow(u.y,a/(2.*a+1.));float cosTheta=sqrt(1.-sinTheta*sinTheta);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const importanceSampling = { name, shader };
//# sourceMappingURL=importanceSampling.js.map

/***/ }),

/***/ 1218:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export instancesDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "instancesDeclaration";
const shader = `#ifdef INSTANCES
attribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3;
#ifdef INSTANCESCOLOR
attribute vec4 instanceColor;
#endif
#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)
uniform mat4 world;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
attribute vec4 previousWorld0;attribute vec4 previousWorld1;attribute vec4 previousWorld2;attribute vec4 previousWorld3;
#ifdef THIN_INSTANCES
uniform mat4 previousWorld;
#endif
#endif
#else
#if !defined(WORLD_UBO)
uniform mat4 world;
#endif
#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
uniform mat4 previousWorld;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const instancesDeclaration = { name, shader };
//# sourceMappingURL=instancesDeclaration.js.map

/***/ }),

/***/ 3298:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export instancesVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "instancesVertex";
const shader = `#ifdef INSTANCES
mat4 finalWorld=mat4(world0,world1,world2,world3);
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
mat4 finalPreviousWorld=mat4(previousWorld0,previousWorld1,
previousWorld2,previousWorld3);
#endif
#ifdef THIN_INSTANCES
finalWorld=world*finalWorld;
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
finalPreviousWorld=previousWorld*finalPreviousWorld;
#endif
#endif
#else
mat4 finalWorld=world;
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
mat4 finalPreviousWorld=previousWorld;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const instancesVertex = { name, shader };
//# sourceMappingURL=instancesVertex.js.map

/***/ }),

/***/ 17382:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export kernelBlurVaryingDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "kernelBlurVaryingDeclaration";
const shader = `varying vec2 sampleCoord{X};`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const kernelBlurVaryingDeclaration = { name, shader };
//# sourceMappingURL=kernelBlurVaryingDeclaration.js.map

/***/ }),

/***/ 37256:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightFragment: () => (/* binding */ lightFragment)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightFragment";
const shader = `#ifdef LIGHT{X}
#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})
#else
vec4 diffuse{X}=light{X}.vLightDiffuse;
#define CUSTOM_LIGHT{X}_COLOR 
#ifdef PBR
#ifdef SPOTLIGHT{X}
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);
#elif defined(POINTLIGHT{X})
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);
#elif defined(HEMILIGHT{X})
preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#elif defined(DIRLIGHT{X})
preInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
#endif
preInfo.NdotV=NdotV;
#ifdef SPOTLIGHT{X}
#ifdef LIGHT_FALLOFF_GLTF{X}
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);
#elif defined(LIGHT_FALLOFF_STANDARD{X})
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);
#else
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
#endif
#elif defined(POINTLIGHT{X})
#ifdef LIGHT_FALLOFF_GLTF{X}
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);
#elif defined(LIGHT_FALLOFF_STANDARD{X})
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);
#else
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);
#endif
#else
preInfo.attenuation=1.0;
#endif
#ifdef HEMILIGHT{X}
preInfo.roughness=roughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
#ifdef IRIDESCENCE
preInfo.iridescenceIntensity=iridescenceIntensity;
#endif
#ifdef HEMILIGHT{X}
info.diffuse=computeHemisphericDiffuseLighting(preInfo,diffuse{X}.rgb,light{X}.vLightGround);
#elif defined(SS_TRANSLUCENCY)
info.diffuse=computeDiffuseAndTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance);
#else
info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb);
#endif
#ifdef SPECULARTERM
#ifdef ANISOTROPIC
info.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
#else
info.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
#endif
#endif
#ifdef SHEEN
#ifdef SHEEN_LINKWITHALBEDO
preInfo.roughness=sheenOut.sheenIntensity;
#else
#ifdef HEMILIGHT{X}
preInfo.roughness=sheenOut.sheenRoughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
#endif
info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
#endif
#ifdef CLEARCOAT
#ifdef HEMILIGHT{X}
preInfo.roughness=clearcoatOut.clearCoatRoughness;
#else
preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
#endif
info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,diffuse{X}.rgb);
#ifdef CLEARCOAT_TINT
absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
#ifdef SPECULARTERM
info.specular*=absorption;
#endif
#endif
info.diffuse*=info.clearCoat.w;
#ifdef SPECULARTERM
info.specular*=info.clearCoat.w;
#endif
#ifdef SHEEN
info.sheen*=info.clearCoat.w;
#endif
#endif
#else
#ifdef SPOTLIGHT{X}
info=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);
#elif defined(HEMILIGHT{X})
info=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);
#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})
info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);
#endif
#endif
#ifdef PROJECTEDLIGHTTEXTURE{X}
info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},textureProjectionMatrix{X},vPositionW);
#endif
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) 
{
#ifdef SHADOWCSM_RIGHTHANDED{X}
diff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;
#else
diff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;
#endif
if (diff{X}>=0.) {index{X}=i;break;}}
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
if (index{X}>=0)
#endif
{
#if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#else
shadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#endif
#else
shadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];
#endif
#ifndef SHADOWCSMNOBLEND{X}
float frustumLength=frustumLengths{X}[index{X}];float diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)
{index{X}+=1;float nextShadow=0.;
#if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
nextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
nextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
nextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
nextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#elif defined(SHADOWMEDIUMQUALITY{X})
nextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#else
nextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
#endif
#else
nextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
shadow=mix(nextShadow,shadow,diffRatio);
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);
#endif
}
#endif
}
#elif defined(SHADOWCLOSEESM{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithCloseESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
#else
shadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWESM{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
#else
shadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPOISSON{X})
#if defined(SHADOWCUBE{X})
shadow=computeShadowWithPoissonSamplingCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);
#else
shadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#else
shadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#else
#if defined(SHADOWCUBE{X})
shadow=computeShadowCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.depthValues);
#else
shadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
#endif
#endif
#ifdef SHADOWONLY
#ifndef SHADOWINUSE
#define SHADOWINUSE
#endif
globalShadow+=shadow;shadowLightCount+=1.0;
#endif
#else
shadow=1.;
#endif
aggShadow+=shadow;numLights+=1.0;
#ifndef SHADOWONLY
#ifdef CUSTOMUSERLIGHTING
diffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);
#ifdef SPECULARTERM
specularBase+=computeCustomSpecularLighting(info,specularBase,shadow);
#endif
#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})
diffuseBase+=lightmapColor.rgb*shadow;
#ifdef SPECULARTERM
#ifndef LIGHTMAPNOSPECULAR{X}
specularBase+=info.specular*shadow*lightmapColor.rgb;
#endif
#endif
#ifdef CLEARCOAT
#ifndef LIGHTMAPNOSPECULAR{X}
clearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;
#endif
#endif
#ifdef SHEEN
#ifndef LIGHTMAPNOSPECULAR{X}
sheenBase+=info.sheen.rgb*shadow;
#endif
#endif
#else
#ifdef SHADOWCSMDEBUG{X}
diffuseBase+=info.diffuse*shadowDebug{X};
#else 
diffuseBase+=info.diffuse*shadow;
#endif
#ifdef SPECULARTERM
specularBase+=info.specular*shadow;
#endif
#ifdef CLEARCOAT
clearCoatBase+=info.clearCoat.rgb*shadow;
#endif
#ifdef SHEEN
sheenBase+=info.sheen.rgb*shadow;
#endif
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const lightFragment = { name, shader };
//# sourceMappingURL=lightFragment.js.map

/***/ }),

/***/ 92270:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightFragmentDeclaration: () => (/* binding */ lightFragmentDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightFragmentDeclaration";
const shader = `#ifdef LIGHT{X}
uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};
#ifdef SPECULARTERM
uniform vec4 vLightSpecular{X};
#else
vec4 vLightSpecular{X}=vec4(0.);
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DArrayShadow shadowTexture{X};uniform highp sampler2DArray depthTexture{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DArrayShadow shadowTexture{X};
#else
uniform highp sampler2DArray shadowTexture{X};
#endif
#ifdef SHADOWCSMDEBUG{X}
const vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]
(
vec3 ( 1.5,0.0,0.0 ),
vec3 ( 0.0,1.5,0.0 ),
vec3 ( 0.0,0.0,5.5 ),
vec3 ( 1.5,0.0,5.5 ),
vec3 ( 1.5,1.5,0.0 ),
vec3 ( 1.0,1.0,1.0 ),
vec3 ( 0.0,1.0,5.5 ),
vec3 ( 0.5,3.5,0.75 )
);vec3 shadowDebug{X};
#endif
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
int index{X}=-1;
#else
int index{X}=SHADOWCSMNUM_CASCADES{X}-1;
#endif
float diff{X}=0.;
#elif defined(SHADOWCUBE{X})
uniform samplerCube shadowTexture{X};
#else
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DShadow shadowTexture{X};uniform highp sampler2D depthTexture{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DShadow shadowTexture{X};
#else
uniform sampler2D shadowTexture{X};
#endif
uniform mat4 lightMatrix{X};
#endif
uniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};
#endif
#ifdef SPOTLIGHT{X}
uniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};
#elif defined(POINTLIGHT{X})
uniform vec4 vLightFalloff{X};
#elif defined(HEMILIGHT{X})
uniform vec3 vLightGround{X};
#endif
#ifdef PROJECTEDLIGHTTEXTURE{X}
uniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightTexture{X};
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const lightFragmentDeclaration = { name, shader };
//# sourceMappingURL=lightFragmentDeclaration.js.map

/***/ }),

/***/ 22448:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightUboDeclaration: () => (/* binding */ lightUboDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightUboDeclaration";
const shader = `#ifdef LIGHT{X}
uniform Light{X}
{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;
#ifdef SPOTLIGHT{X}
vec4 vLightDirection;vec4 vLightFalloff;
#elif defined(POINTLIGHT{X})
vec4 vLightFalloff;
#elif defined(HEMILIGHT{X})
vec3 vLightGround;
#endif
vec4 shadowsInfo;vec2 depthValues;} light{X};
#ifdef PROJECTEDLIGHTTEXTURE{X}
uniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightTexture{X};
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DArrayShadow shadowTexture{X};uniform highp sampler2DArray depthTexture{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DArrayShadow shadowTexture{X};
#else
uniform highp sampler2DArray shadowTexture{X};
#endif
#ifdef SHADOWCSMDEBUG{X}
const vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]
(
vec3 ( 1.5,0.0,0.0 ),
vec3 ( 0.0,1.5,0.0 ),
vec3 ( 0.0,0.0,5.5 ),
vec3 ( 1.5,0.0,5.5 ),
vec3 ( 1.5,1.5,0.0 ),
vec3 ( 1.0,1.0,1.0 ),
vec3 ( 0.0,1.0,5.5 ),
vec3 ( 0.5,3.5,0.75 )
);vec3 shadowDebug{X};
#endif
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
int index{X}=-1;
#else
int index{X}=SHADOWCSMNUM_CASCADES{X}-1;
#endif
float diff{X}=0.;
#elif defined(SHADOWCUBE{X})
uniform samplerCube shadowTexture{X}; 
#else
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};
#if defined(SHADOWPCSS{X})
uniform highp sampler2DShadow shadowTexture{X};uniform highp sampler2D depthTexture{X};
#elif defined(SHADOWPCF{X})
uniform highp sampler2DShadow shadowTexture{X};
#else
uniform sampler2D shadowTexture{X};
#endif
uniform mat4 lightMatrix{X};
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const lightUboDeclaration = { name, shader };
//# sourceMappingURL=lightUboDeclaration.js.map

/***/ }),

/***/ 47059:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightVxFragmentDeclaration: () => (/* binding */ lightVxFragmentDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightVxFragmentDeclaration";
const shader = `#ifdef LIGHT{X}
uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};
#ifdef SPECULARTERM
uniform vec4 vLightSpecular{X};
#else
vec4 vLightSpecular{X}=vec4(0.);
#endif
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
#elif defined(SHADOWCUBE{X})
#else
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};
#endif
uniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};
#endif
#ifdef SPOTLIGHT{X}
uniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};
#elif defined(POINTLIGHT{X})
uniform vec4 vLightFalloff{X};
#elif defined(HEMILIGHT{X})
uniform vec3 vLightGround{X};
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const lightVxFragmentDeclaration = { name, shader };
//# sourceMappingURL=lightVxFragmentDeclaration.js.map

/***/ }),

/***/ 4662:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightVxUboDeclaration: () => (/* binding */ lightVxUboDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightVxUboDeclaration";
const shader = `#ifdef LIGHT{X}
uniform Light{X}
{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;
#ifdef SPOTLIGHT{X}
vec4 vLightDirection;vec4 vLightFalloff;
#elif defined(POINTLIGHT{X})
vec4 vLightFalloff;
#elif defined(HEMILIGHT{X})
vec3 vLightGround;
#endif
vec4 shadowsInfo;vec2 depthValues;} light{X};
#ifdef SHADOW{X}
#ifdef SHADOWCSM{X}
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
#elif defined(SHADOWCUBE{X})
#else
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const lightVxUboDeclaration = { name, shader };
//# sourceMappingURL=lightVxUboDeclaration.js.map

/***/ }),

/***/ 21962:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lightsFragmentFunctions: () => (/* binding */ lightsFragmentFunctions)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lightsFragmentFunctions";
const shader = `struct lightingInfo
{vec3 diffuse;
#ifdef SPECULARTERM
vec3 specular;
#endif
#ifdef NDOTL
float ndl;
#endif
};lightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 lightVectorW;float attenuation=1.0;if (lightData.w==0.)
{vec3 direction=lightData.xyz-vPositionW;attenuation=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}
else
{lightVectorW=normalize(-lightData.xyz);}
float ndl=max(0.,dot(vNormal,lightVectorW));
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=ndl*diffuseColor*attenuation;
#ifdef SPECULARTERM
vec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;
#endif
return result;}
lightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 direction=lightData.xyz-vPositionW;vec3 lightVectorW=normalize(direction);float attenuation=max(0.,1.0-length(direction)/range);float cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)
{cosAngle=max(0.,pow(cosAngle,lightData.w));attenuation*=cosAngle;float ndl=max(0.,dot(vNormal,lightVectorW));
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=ndl*diffuseColor*attenuation;
#ifdef SPECULARTERM
vec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;
#endif
return result;}
result.diffuse=vec3(0.);
#ifdef SPECULARTERM
result.specular=vec3(0.);
#endif
#ifdef NDOTL
result.ndl=0.;
#endif
return result;}
lightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {lightingInfo result;float ndl=dot(vNormal,lightData.xyz)*0.5+0.5;
#ifdef NDOTL
result.ndl=ndl;
#endif
result.diffuse=mix(groundColor,diffuseColor,ndl);
#ifdef SPECULARTERM
vec3 angleW=normalize(viewDirectionW+lightData.xyz);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;
#endif
return result;}
#define inline
vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return textureColor;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const lightsFragmentFunctions = { name, shader };
//# sourceMappingURL=lightsFragmentFunctions.js.map

/***/ }),

/***/ 34581:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export logDepthDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "logDepthDeclaration";
const shader = `#ifdef LOGARITHMICDEPTH
uniform float logarithmicDepthConstant;varying float vFragmentDepth;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const logDepthDeclaration = { name, shader };
//# sourceMappingURL=logDepthDeclaration.js.map

/***/ }),

/***/ 29741:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export logDepthFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "logDepthFragment";
const shader = `#ifdef LOGARITHMICDEPTH
gl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const logDepthFragment = { name, shader };
//# sourceMappingURL=logDepthFragment.js.map

/***/ }),

/***/ 2215:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export logDepthVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "logDepthVertex";
const shader = `#ifdef LOGARITHMICDEPTH
vFragmentDepth=1.0+gl_Position.w;gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const logDepthVertex = { name, shader };
//# sourceMappingURL=logDepthVertex.js.map

/***/ }),

/***/ 4980:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export mainUVVaryingDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "mainUVVaryingDeclaration";
const shader = `#ifdef MAINUV{X}
varying vec2 vMainUV{X};
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const mainUVVaryingDeclaration = { name, shader };
//# sourceMappingURL=mainUVVaryingDeclaration.js.map

/***/ }),

/***/ 96467:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export meshUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUboDeclaration";
const shader = `#ifdef WEBGL2
uniform mat4 world;uniform float visibility;
#else
layout(std140,column_major) uniform;uniform Mesh
{mat4 world;float visibility;};
#endif
#define WORLD_UBO
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const meshUboDeclaration = { name, shader };
//# sourceMappingURL=meshUboDeclaration.js.map

/***/ }),

/***/ 15060:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   morphTargetsVertex: () => (/* binding */ morphTargetsVertex)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "morphTargetsVertex";
const shader = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE
#if {X}==0
for (int i=0; i<NUM_MORPH_INFLUENCERS; i++) {if (i>=morphTargetCount) break;vertexID=float(gl_VertexID)*morphTargetTextureInfo.x;positionUpdated+=(readVector3FromRawSampler(i,vertexID)-position)*morphTargetInfluences[i];vertexID+=1.0;
#ifdef MORPHTARGETS_NORMAL
normalUpdated+=(readVector3FromRawSampler(i,vertexID) -normal)*morphTargetInfluences[i];vertexID+=1.0;
#endif
#ifdef MORPHTARGETS_UV
uvUpdated+=(readVector3FromRawSampler(i,vertexID).xy-uv)*morphTargetInfluences[i];vertexID+=1.0;
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz+=(readVector3FromRawSampler(i,vertexID) -tangent.xyz)*morphTargetInfluences[i];
#endif
}
#endif
#else
positionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];
#ifdef MORPHTARGETS_NORMAL
normalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_TANGENT
tangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];
#endif
#ifdef MORPHTARGETS_UV
uvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const morphTargetsVertex = { name, shader };
//# sourceMappingURL=morphTargetsVertex.js.map

/***/ }),

/***/ 90738:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   morphTargetsVertexDeclaration: () => (/* binding */ morphTargetsVertexDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "morphTargetsVertexDeclaration";
const shader = `#ifdef MORPHTARGETS
#ifndef MORPHTARGETS_TEXTURE
attribute vec3 position{X};
#ifdef MORPHTARGETS_NORMAL
attribute vec3 normal{X};
#endif
#ifdef MORPHTARGETS_TANGENT
attribute vec3 tangent{X};
#endif
#ifdef MORPHTARGETS_UV
attribute vec2 uv_{X};
#endif
#elif {X}==0
uniform int morphTargetCount;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const morphTargetsVertexDeclaration = { name, shader };
//# sourceMappingURL=morphTargetsVertexDeclaration.js.map

/***/ }),

/***/ 48451:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   morphTargetsVertexGlobal: () => (/* binding */ morphTargetsVertexGlobal)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "morphTargetsVertexGlobal";
const shader = `#ifdef MORPHTARGETS
#ifdef MORPHTARGETS_TEXTURE
float vertexID;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const morphTargetsVertexGlobal = { name, shader };
//# sourceMappingURL=morphTargetsVertexGlobal.js.map

/***/ }),

/***/ 27999:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   morphTargetsVertexGlobalDeclaration: () => (/* binding */ morphTargetsVertexGlobalDeclaration)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "morphTargetsVertexGlobalDeclaration";
const shader = `#ifdef MORPHTARGETS
uniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];
#ifdef MORPHTARGETS_TEXTURE 
uniform float morphTargetTextureIndices[NUM_MORPH_INFLUENCERS];uniform vec3 morphTargetTextureInfo;uniform highp sampler2DArray morphTargets;vec3 readVector3FromRawSampler(int targetIndex,float vertexIndex)
{ 
float y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV).xyz;}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const morphTargetsVertexGlobalDeclaration = { name, shader };
//# sourceMappingURL=morphTargetsVertexGlobalDeclaration.js.map

/***/ }),

/***/ 89986:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export oitDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "oitDeclaration";
const shader = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY
#extension GL_EXT_draw_buffers : require
layout(location=0) out vec2 depth; 
layout(location=1) out vec4 frontColor;layout(location=2) out vec4 backColor;
#define MAX_DEPTH 99999.0
highp vec4 gl_FragColor;uniform sampler2D oitDepthSampler;uniform sampler2D oitFrontColorSampler;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const oitDeclaration = { name, shader };
//# sourceMappingURL=oitDeclaration.js.map

/***/ }),

/***/ 94436:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export oitFragment */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "oitFragment";
const shader = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY
float fragDepth=gl_FragCoord.z; 
#ifdef ORDER_INDEPENDENT_TRANSPARENCY_16BITS
uint halfFloat=packHalf2x16(vec2(fragDepth));vec2 full=unpackHalf2x16(halfFloat);fragDepth=full.x;
#endif
ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec2 lastDepth=texelFetch(oitDepthSampler,fragCoord,0).rg;vec4 lastFrontColor=texelFetch(oitFrontColorSampler,fragCoord,0);depth.rg=vec2(-MAX_DEPTH);frontColor=lastFrontColor;backColor=vec4(0.0);
#ifdef USE_REVERSE_DEPTHBUFFER
float furthestDepth=-lastDepth.x;float nearestDepth=lastDepth.y;
#else
float nearestDepth=-lastDepth.x;float furthestDepth=lastDepth.y;
#endif
float alphaMultiplier=1.0-lastFrontColor.a;
#ifdef USE_REVERSE_DEPTHBUFFER
if (fragDepth>nearestDepth || fragDepth<furthestDepth) {
#else
if (fragDepth<nearestDepth || fragDepth>furthestDepth) {
#endif
return;}
#ifdef USE_REVERSE_DEPTHBUFFER
if (fragDepth<nearestDepth && fragDepth>furthestDepth) {
#else
if (fragDepth>nearestDepth && fragDepth<furthestDepth) {
#endif
depth.rg=vec2(-fragDepth,fragDepth);return;}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const oitFragment = { name, shader };
//# sourceMappingURL=oitFragment.js.map

/***/ }),

/***/ 8334:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   packingFunctions: () => (/* binding */ packingFunctions)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "packingFunctions";
const shader = `vec4 pack(float depth)
{const vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}
float unpack(vec4 color)
{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const packingFunctions = { name, shader };
//# sourceMappingURL=packingFunctions.js.map

/***/ }),

/***/ 8709:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export pbrBRDFFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "pbrBRDFFunctions";
const shader = `#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
#ifdef MS_BRDF_ENERGY_CONSERVATION
vec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}
#endif
#ifdef ENVIRONMENTBRDF
vec3 getBRDFLookup(float NdotV,float perceptualRoughness) {vec2 UV=vec2(NdotV,perceptualRoughness);vec4 brdfLookup=texture2D(environmentBrdfSampler,UV);
#ifdef ENVIRONMENTBRDF_RGBD
brdfLookup.rgb=fromRGBD(brdfLookup.rgba);
#endif
return brdfLookup.rgb;}
vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {
#ifdef BRDF_V_HEIGHT_CORRELATED
vec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;
#else
vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;
#endif
return reflectance;}
vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {
#ifdef BRDF_V_HEIGHT_CORRELATED
vec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);
#else
vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;
#endif
return reflectance;}
#endif
/* NOT USED
#if defined(SHEEN) && defined(SHEEN_SOFTER)
float getBRDFLookupCharlieSheen(float NdotV,float perceptualRoughness)
{float c=1.0-NdotV;float c3=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));}
#endif
*/
#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)
vec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)
{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF)
/**
* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.
* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table
*/
vec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {vec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}
#endif
vec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)
{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
float fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)
{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
#ifdef CLEARCOAT
vec3 getR0RemappedForClearCoat(vec3 f0) {
#ifdef CLEARCOAT_DEFAULTIOR
#ifdef MOBILE
return saturate(f0*(f0*0.526868+0.529324)-0.0482256);
#else
return saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);
#endif
#else
vec3 s=sqrt(f0);vec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);return square(t);
#endif
}
#endif
#ifdef IRIDESCENCE
const mat3 XYZ_TO_REC709=mat3(
3.2404542,-0.9692660, 0.0556434,
-1.5371385, 1.8760108,-0.2040259,
-0.4985314, 0.0415560, 1.0572252
);vec3 getIORTfromAirToSurfaceR0(vec3 f0) {vec3 sqrtF0=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}
vec3 getR0fromIORs(vec3 iorT,float iorI) {return square((iorT-vec3(iorI))/(iorT+vec3(iorI)));}
float getR0fromIORs(float iorT,float iorI) {return square((iorT-iorI)/(iorT+iorI));}
vec3 evalSensitivity(float opd,vec3 shift) {float phase=2.0*PI*opd*1.0e-9;const vec3 val=vec3(5.4856e-13,4.4201e-13,5.2481e-13);const vec3 pos=vec3(1.6810e+06,1.7953e+06,2.2084e+06);const vec3 var=vec3(4.3278e+09,9.3046e+09,6.6121e+09);vec3 xyz=val*sqrt(2.0*PI*var)*cos(pos*phase+shift)*exp(-square(phase)*var);xyz.x+=9.7470e-14*sqrt(2.0*PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*square(phase));xyz/=1.0685e-7;vec3 srgb=XYZ_TO_REC709*xyz;return srgb;}
vec3 evalIridescence(float outsideIOR,float eta2,float cosTheta1,float thinFilmThickness,vec3 baseF0) {vec3 I=vec3(1.0);float iridescenceIOR=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));float sinTheta2Sq=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));float cosTheta2Sq=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;}
float cosTheta2=sqrt(cosTheta2Sq);float R0=getR0fromIORs(iridescenceIOR,outsideIOR);float R12=fresnelSchlickGGX(cosTheta1,R0,1.);float R21=R12;float T121=1.0-R12;float phi12=0.0;if (iridescenceIOR<outsideIOR) phi12=PI;float phi21=PI-phi12;vec3 baseIOR=getIORTfromAirToSurfaceR0(clamp(baseF0,0.0,0.9999)); 
vec3 R1=getR0fromIORs(baseIOR,iridescenceIOR);vec3 R23=fresnelSchlickGGX(cosTheta2,R1,vec3(1.));vec3 phi23=vec3(0.0);if (baseIOR[0]<iridescenceIOR) phi23[0]=PI;if (baseIOR[1]<iridescenceIOR) phi23[1]=PI;if (baseIOR[2]<iridescenceIOR) phi23[2]=PI;float opd=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;vec3 phi=vec3(phi21)+phi23;vec3 R123=clamp(R12*R23,1e-5,0.9999);vec3 r123=sqrt(R123);vec3 Rs=square(T121)*R23/(vec3(1.0)-R123);vec3 C0=R12+Rs;I=C0;vec3 Cm=Rs-T121;for (int m=1; m<=2; ++m)
{Cm*=r123;vec3 Sm=2.0*evalSensitivity(float(m)*opd,float(m)*phi);I+=Cm*Sm;}
return max(I,vec3(0.0));}
#endif
float normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)
{float a2=square(alphaG);float d=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}
#ifdef SHEEN
float normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)
{float invR=1./alphaG;float cos2h=NdotH*NdotH;float sin2h=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}
#endif
#ifdef ANISOTROPIC
float normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {float a2=alphaTB.x*alphaTB.y;vec3 v=vec3(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);float v2=dot(v,v);float w2=a2/v2;return a2*w2*w2*RECIPROCAL_PI;}
#endif
#ifdef BRDF_V_HEIGHT_CORRELATED
float smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {
#ifdef MOBILE
float GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);float GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);
#else
float a2=alphaG*alphaG;float GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);float GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL);
#endif
}
#else
float smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)
{
#ifdef MOBILE
return 1.0/(dot+alphaG+(1.0-alphaG)*dot ));
#else
float alphaSquared=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));
#endif
}
float smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)
{float visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}
#endif
#ifdef ANISOTROPIC
float smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {float lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));float lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));float v=0.5/(lambdaV+lambdaL);return v;}
#endif
#ifdef CLEARCOAT
float visibility_Kelemen(float VdotH) {return 0.25/(VdotH*VdotH); }
#endif
#ifdef SHEEN
float visibility_Ashikhmin(float NdotL,float NdotV)
{return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}
/* NOT USED
#ifdef SHEEN_SOFTER
float l(float x,float alphaG)
{float oneMinusAlphaSq=(1.0-alphaG)*(1.0-alphaG);float a=mix(21.5473,25.3245,oneMinusAlphaSq);float b=mix(3.82987,3.32435,oneMinusAlphaSq);float c=mix(0.19823,0.16801,oneMinusAlphaSq);float d=mix(-1.97760,-1.27393,oneMinusAlphaSq);float e=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}
float lambdaSheen(float cosTheta,float alphaG)
{return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}
float visibility_CharlieSheen(float NdotL,float NdotV,float alphaG)
{float G=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}
#endif
*/
#endif
float diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {float diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));float diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));float diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;float fresnel =
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}
#ifdef SS_TRANSLUCENCY
vec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {vec3 S=1./maxEps(diffusionDistance);vec3 temp=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);}
float computeWrappedDiffuseNdotL(float NdotL,float w) {float t=1.0+w;float invt2=1.0/square(t);return saturate((NdotL+w)*invt2);}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const pbrBRDFFunctions = { name, shader };
//# sourceMappingURL=pbrBRDFFunctions.js.map

/***/ }),

/***/ 4096:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export pbrUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _sceneUboDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28764);
/* harmony import */ var _meshUboDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96467);
// Do not edit.



const name = "pbrUboDeclaration";
const shader = `layout(std140,column_major) uniform;uniform Material {vec2 vAlbedoInfos;vec4 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec3 vReflectivityInfos;vec2 vMicroSurfaceSamplerInfos;vec2 vReflectionInfos;vec2 vReflectionFilteringInfo;vec3 vReflectionPosition;vec3 vReflectionSize;vec3 vBumpInfos;mat4 albedoMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 reflectivityMatrix;mat4 microSurfaceSamplerMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;mat4 reflectionMatrix;vec3 vReflectionColor;vec4 vAlbedoColor;vec4 vLightingIntensity;vec3 vReflectionMicrosurfaceInfos;float pointSize;vec4 vReflectivityColor;vec3 vEmissiveColor;vec3 vAmbientColor;vec2 vDebugMode;vec4 vMetallicReflectanceFactors;vec2 vMetallicReflectanceInfos;mat4 metallicReflectanceMatrix;vec2 vReflectanceInfos;mat4 reflectanceMatrix;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;
#define ADDITIONAL_UBO_DECLARATION
};
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const pbrUboDeclaration = { name, shader };
//# sourceMappingURL=pbrUboDeclaration.js.map

/***/ }),

/***/ 91211:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export pointCloudVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "pointCloudVertex";
const shader = `#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const pointCloudVertex = { name, shader };
//# sourceMappingURL=pointCloudVertex.js.map

/***/ }),

/***/ 42694:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export prePassDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "prePassDeclaration";
const shader = `#ifdef PREPASS
#extension GL_EXT_draw_buffers : require
layout(location=0) out highp vec4 glFragData[{X}];highp vec4 gl_FragColor;
#ifdef PREPASS_LOCAL_POSITION
varying highp vec3 vPosition;
#endif
#ifdef PREPASS_DEPTH
varying highp vec3 vViewPos;
#endif
#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
varying highp vec4 vCurrentPosition;varying highp vec4 vPreviousPosition;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const prePassDeclaration = { name, shader };
//# sourceMappingURL=prePassDeclaration.js.map

/***/ }),

/***/ 65438:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export prePassVertex */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "prePassVertex";
const shader = `#ifdef PREPASS_DEPTH
vViewPos=(view*worldPos).rgb;
#endif
#ifdef PREPASS_LOCAL_POSITION
vPosition=positionUpdated.xyz;
#endif
#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*worldPos;
#if NUM_BONE_INFLUENCERS>0
mat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];
#endif 
#if NUM_BONE_INFLUENCERS>2
previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];
#endif 
#if NUM_BONE_INFLUENCERS>3
previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif 
#if NUM_BONE_INFLUENCERS>5
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif 
#if NUM_BONE_INFLUENCERS>6
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif 
#if NUM_BONE_INFLUENCERS>7
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);
#else
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const prePassVertex = { name, shader };
//# sourceMappingURL=prePassVertex.js.map

/***/ }),

/***/ 78328:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export prePassVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "prePassVertexDeclaration";
const shader = `#ifdef PREPASS
#ifdef PREPASS_LOCAL_POSITION
varying vec3 vPosition;
#endif
#ifdef PREPASS_DEPTH
varying vec3 vViewPos;
#endif
#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
uniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const prePassVertexDeclaration = { name, shader };
//# sourceMappingURL=prePassVertexDeclaration.js.map

/***/ }),

/***/ 18223:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   reflectionFunction: () => (/* binding */ reflectionFunction)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "reflectionFunction";
const shader = `vec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)
{float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0); }
vec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)
{float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(1.0-s,t,0); }
vec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
{vec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);vec3 r=normalize(reflect(cameraToVertex,worldNormal));r=vec3(reflectionMatrix*vec4(r,0));float lon=atan(r.z,r.x);float lat=acos(r.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0);}
vec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix)
{vec3 viewDir=normalize(vec3(view*worldPos));vec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));vec3 r=reflect(viewDir,viewNormal);r=vec3(reflectionMatrix*vec4(r,0));r.z=r.z-1.0;float m=2.0*length(r);return vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);}
vec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
{vec3 viewDir=worldPos.xyz-eyePosition;vec3 coords=normalize(reflect(viewDir,worldNormal));return vec3(reflectionMatrix*vec4(coords,1));}
vec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
{vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=vec3(reflectionMatrix*vec4(coords,0));
#ifdef INVERTCUBICMAP
coords.y*=-1.0;
#endif
return coords;}
vec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition)
{vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=vec3(reflectionMatrix*vec4(coords,0));
#ifdef INVERTCUBICMAP
coords.y*=-1.0;
#endif
return coords;}
vec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix)
{return vec3(reflectionMatrix*(view*worldPos));}
vec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix)
{return vec3(reflectionMatrix*vec4(positionW,1.));}
#ifdef REFLECTION
vec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)
{
#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED
vec3 direction=normalize(vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);
#endif
#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED
vec3 direction=normalize(vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);
#endif
#ifdef REFLECTIONMAP_EQUIRECTANGULAR
return computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_SPHERICAL
return computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_PLANAR
return computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_CUBIC
#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC
return computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);
#else
return computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
#endif
#endif
#ifdef REFLECTIONMAP_PROJECTION
return computeProjectionCoords(worldPos,view,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_SKYBOX
return computeSkyBoxCoords(vPositionUVW,reflectionMatrix);
#endif
#ifdef REFLECTIONMAP_EXPLICIT
return vec3(0,0,0);
#endif
}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const reflectionFunction = { name, shader };
//# sourceMappingURL=reflectionFunction.js.map

/***/ }),

/***/ 63022:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export samplerFragmentDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "samplerFragmentDeclaration";
const shader = `#ifdef _DEFINENAME_
#if _DEFINENAME_DIRECTUV==1
#define v_VARYINGNAME_UV vMainUV1
#elif _DEFINENAME_DIRECTUV==2
#define v_VARYINGNAME_UV vMainUV2
#elif _DEFINENAME_DIRECTUV==3
#define v_VARYINGNAME_UV vMainUV3
#elif _DEFINENAME_DIRECTUV==4
#define v_VARYINGNAME_UV vMainUV4
#elif _DEFINENAME_DIRECTUV==5
#define v_VARYINGNAME_UV vMainUV5
#elif _DEFINENAME_DIRECTUV==6
#define v_VARYINGNAME_UV vMainUV6
#else
varying vec2 v_VARYINGNAME_UV;
#endif
uniform sampler2D _SAMPLERNAME_Sampler;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const samplerFragmentDeclaration = { name, shader };
//# sourceMappingURL=samplerFragmentDeclaration.js.map

/***/ }),

/***/ 85136:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export samplerVertexDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "samplerVertexDeclaration";
const shader = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
varying vec2 v_VARYINGNAME_UV;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const samplerVertexDeclaration = { name, shader };
//# sourceMappingURL=samplerVertexDeclaration.js.map

/***/ }),

/***/ 41316:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export samplerVertexImplementation */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "samplerVertexImplementation";
const shader = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
if (v_INFONAME_==0.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uvUpdated,1.0,0.0));}
#ifdef UV2
else if (v_INFONAME_==1.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv2,1.0,0.0));}
#endif
#ifdef UV3
else if (v_INFONAME_==2.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv3,1.0,0.0));}
#endif
#ifdef UV4
else if (v_INFONAME_==3.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv4,1.0,0.0));}
#endif
#ifdef UV5
else if (v_INFONAME_==4.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv5,1.0,0.0));}
#endif
#ifdef UV6
else if (v_INFONAME_==5.)
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv6,1.0,0.0));}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const samplerVertexImplementation = { name, shader };
//# sourceMappingURL=samplerVertexImplementation.js.map

/***/ }),

/***/ 28764:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export sceneUboDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "sceneUboDeclaration";
const shader = `layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection;
#ifdef MULTIVIEW
mat4 viewProjectionR;
#endif 
mat4 view;mat4 projection;vec4 vEyePosition;};
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const sceneUboDeclaration = { name, shader };
//# sourceMappingURL=sceneUboDeclaration.js.map

/***/ }),

/***/ 69363:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export screenSpaceRayTrace */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "screenSpaceRayTrace";
const shader = `float distanceSquared(vec2 a,vec2 b) { a-=b; return dot(a,a); }
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
float linearizeDepth(float depth,float near,float far) {
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
return -(near*far)/(far-depth*(far-near));
#else
return (near*far)/(far-depth*(far-near));
#endif
}
#endif
/**
\param csOrigin Camera-space ray origin,which must be 
within the view volume and must have z>0.01 and project within the valid screen rectangle
\param csDirection Unit length camera-space ray direction
\param projectToPixelMatrix A projection matrix that maps to **pixel** coordinates 
(**not** [-1,+1] normalized device coordinates).
\param csZBuffer The camera-space Z buffer
\param csZBufferSize Dimensions of csZBuffer
\param csZThickness Camera space csZThickness to ascribe to each pixel in the depth buffer
\param nearPlaneZ Positive number. Doesn't have to be THE actual near plane,just a reasonable value
for clipping rays headed towards the camera
\param stride Step in horizontal or vertical pixels between samples. This is a float
because integer math is slow on GPUs,but should be set to an integer>=1
\param jitterFraction Number between 0 and 1 for how far to bump the ray in stride units
to conceal banding artifacts,plus the stride ray offset.
\param maxSteps Maximum number of iterations. Higher gives better images but may be slow
\param maxRayTraceDistance Maximum camera-space distance to trace before returning a miss
\param selfCollisionNumSkip Number of steps to skip at start when raytracing to avoid self collisions.
1 is a reasonable value,depending on the scene you may need to set this value to 2
\param hitPixel Pixel coordinates of the first intersection with the scene
\param numIterations number of iterations performed
\param csHitPoint Camera space location of the ray hit
*/
#define inline
bool traceScreenSpaceRay1(
vec3 csOrigin,
vec3 csDirection,
mat4 projectToPixelMatrix,
sampler2D csZBuffer,
vec2 csZBufferSize,
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
sampler2D csZBackBuffer,
float csZBackSizeFactor,
#endif
float csZThickness,
float nearPlaneZ,
float farPlaneZ,
float stride,
float jitterFraction,
float maxSteps,
float maxRayTraceDistance,
float selfCollisionNumSkip,
out vec2 startPixel,
out vec2 hitPixel,
out vec3 csHitPoint,
out float numIterations
#ifdef SSRAYTRACE_DEBUG
,out vec3 debugColor
#endif
)
{
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
float rayLength=(csOrigin.z+csDirection.z*maxRayTraceDistance)>-nearPlaneZ ? (-nearPlaneZ-csOrigin.z)/csDirection.z : maxRayTraceDistance;
#else
float rayLength=(csOrigin.z+csDirection.z*maxRayTraceDistance)<nearPlaneZ ? (nearPlaneZ-csOrigin.z)/csDirection.z : maxRayTraceDistance;
#endif
vec3 csEndPoint=csOrigin+csDirection*rayLength;hitPixel=vec2(-1.0,-1.0);vec4 H0=projectToPixelMatrix*vec4(csOrigin,1.0);vec4 H1=projectToPixelMatrix*vec4(csEndPoint,1.0);float k0=1.0/H0.w;float k1=1.0/H1.w;vec3 Q0=csOrigin*k0;vec3 Q1=csEndPoint*k1;vec2 P0=H0.xy*k0;vec2 P1=H1.xy*k1;
#ifdef SSRAYTRACE_CLIP_TO_FRUSTUM
float xMax=csZBufferSize.x-0.5,xMin=0.5,yMax=csZBufferSize.y-0.5,yMin=0.5;float alpha=0.0;if ((P1.y>yMax) || (P1.y<yMin)) {alpha=(P1.y-((P1.y>yMax) ? yMax : yMin))/(P1.y-P0.y);}
if ((P1.x>xMax) || (P1.x<xMin)) {alpha=max(alpha,(P1.x-((P1.x>xMax) ? xMax : xMin))/(P1.x-P0.x));}
P1=mix(P1,P0,alpha); k1=mix(k1,k0,alpha); Q1=mix(Q1,Q0,alpha);
#endif
P1+=vec2((distanceSquared(P0,P1)<0.0001) ? 0.01 : 0.0);vec2 delta=P1-P0;bool permute=false;if (abs(delta.x)<abs(delta.y)) { 
permute=true;delta=delta.yx;P0=P0.yx;P1=P1.yx; }
float stepDirection=sign(delta.x);float invdx=stepDirection/delta.x;vec2 dP=vec2(stepDirection,delta.y*invdx);vec3 dQ=(Q1-Q0)*invdx;float dk=(k1-k0)*invdx;float zMin=min(csEndPoint.z,csOrigin.z);float zMax=max(csEndPoint.z,csOrigin.z);dP*=stride; dQ*=stride; dk*=stride;P0+=dP*jitterFraction; Q0+=dQ*jitterFraction; k0+=dk*jitterFraction;vec4 pqk=vec4(P0,Q0.z,k0);vec4 dPQK=vec4(dP,dQ.z,dk);startPixel=permute ? P0.yx : P0.xy;float prevZMaxEstimate=csOrigin.z;float rayZMin=prevZMaxEstimate,rayZMax=prevZMaxEstimate;float sceneZMax=rayZMax+1e4;float end=P1.x*stepDirection;bool hit=false;float stepCount;for (stepCount=0.0;stepCount<=selfCollisionNumSkip ||
(pqk.x*stepDirection)<=end &&
stepCount<maxSteps &&
!hit &&
sceneZMax != 0.0; 
pqk+=dPQK,++stepCount)
{hitPixel=permute ? pqk.yx : pqk.xy;rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;if (rayZMin>rayZMax) { 
float t=rayZMin; rayZMin=rayZMax; rayZMax=t;}
sceneZMax=texelFetch(csZBuffer,ivec2(hitPixel),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
sceneZMax=linearizeDepth(sceneZMax,nearPlaneZ,farPlaneZ);
#endif
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
float sceneBackZ=texelFetch(csZBackBuffer,ivec2(hitPixel/csZBackSizeFactor),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
sceneBackZ=linearizeDepth(sceneBackZ,nearPlaneZ,farPlaneZ);
#endif
hit=(rayZMax>=sceneBackZ-csZThickness) && (rayZMin<=sceneZMax);
#else
hit=(rayZMax>=sceneZMax-csZThickness) && (rayZMin<=sceneZMax);
#endif
#else
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
float sceneBackZ=texelFetch(csZBackBuffer,ivec2(hitPixel/csZBackSizeFactor),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
sceneBackZ=linearizeDepth(sceneBackZ,nearPlaneZ,farPlaneZ);
#endif
hit=(rayZMin<=sceneBackZ+csZThickness) && (rayZMax>=sceneZMax) && (sceneZMax != 0.0);
#else
hit=(rayZMin<=sceneZMax+csZThickness) && (rayZMax>=sceneZMax);
#endif
#endif
}
pqk-=dPQK;stepCount-=1.0;if (((pqk.x+dPQK.x)*stepDirection)>end || (stepCount+1.0)>=maxSteps || sceneZMax==0.0) {hit=false;}
#ifdef SSRAYTRACE_ENABLE_REFINEMENT
if (stride>1.0 && hit) {pqk-=dPQK;stepCount-=1.0;float invStride=1.0/stride;dPQK*=invStride;float refinementStepCount=0.0;prevZMaxEstimate=pqk.z/pqk.w;rayZMax=prevZMaxEstimate;sceneZMax=rayZMax+1e7;for (;refinementStepCount<=1.0 ||
(refinementStepCount<=stride*1.4) &&
(rayZMax<sceneZMax) && (sceneZMax != 0.0);pqk+=dPQK,refinementStepCount+=1.0)
{rayZMin=prevZMaxEstimate;rayZMax=(dPQK.z*0.5+pqk.z)/(dPQK.w*0.5+pqk.w);rayZMax=clamp(rayZMax,zMin,zMax);prevZMaxEstimate=rayZMax;rayZMax=max(rayZMax,rayZMin);hitPixel=permute ? pqk.yx : pqk.xy;sceneZMax=texelFetch(csZBuffer,ivec2(hitPixel),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
sceneZMax=linearizeDepth(sceneZMax,nearPlaneZ,farPlaneZ);
#endif
}
pqk-=dPQK;refinementStepCount-=1.0;stepCount+=refinementStepCount/stride;}
#endif
Q0.xy+=dQ.xy*stepCount;Q0.z=pqk.z;csHitPoint=Q0/pqk.w;numIterations=stepCount+1.0;
#ifdef SSRAYTRACE_DEBUG
if (((pqk.x+dPQK.x)*stepDirection)>end) {debugColor=vec3(0,0,1);} else if ((stepCount+1.0)>=maxSteps) {debugColor=vec3(1,0,0);} else if (sceneZMax==0.0) {debugColor=vec3(1,1,0);} else {debugColor=vec3(0,stepCount/maxSteps,0);}
#endif
return hit;}
/**
texCoord: in the [0,1] range
depth: depth in view space (range [znear,zfar]])
*/
vec3 computeViewPosFromUVDepth(vec2 texCoord,float depth,mat4 projection,mat4 invProjectionMatrix) {vec4 ndc;ndc.xy=texCoord*2.0-1.0;
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
#ifdef ORTHOGRAPHIC_CAMERA
ndc.z=-projection[2].z*depth+projection[3].z;
#else
ndc.z=-projection[2].z-projection[3].z/depth;
#endif
#else
#ifdef ORTHOGRAPHIC_CAMERA
ndc.z=projection[2].z*depth+projection[3].z;
#else
ndc.z=projection[2].z+projection[3].z/depth;
#endif
#endif
ndc.w=1.0;vec4 eyePos=invProjectionMatrix*ndc;eyePos.xyz/=eyePos.w;return eyePos.xyz;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const screenSpaceRayTrace = { name, shader };
//# sourceMappingURL=screenSpaceRayTrace.js.map

/***/ }),

/***/ 98322:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowMapFragment: () => (/* binding */ shadowMapFragment)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowMapFragment";
const shader = `float depthSM=vDepthMetricSM;
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
#if SM_USEDISTANCE==1
depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#else
#ifdef USE_REVERSE_DEPTHBUFFER
depthSM=(-zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#else
depthSM=(zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#endif
#endif
#ifdef USE_REVERSE_DEPTHBUFFER
gl_FragDepth=clamp(1.0-depthSM,0.0,1.0);
#else
gl_FragDepth=clamp(depthSM,0.0,1.0); 
#endif
#elif SM_USEDISTANCE==1
depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#endif
#if SM_ESM==1
depthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.);
#endif
#if SM_FLOAT==1
gl_FragColor=vec4(depthSM,1.0,1.0,1.0);
#else
gl_FragColor=pack(depthSM);
#endif
return;`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const shadowMapFragment = { name, shader };
//# sourceMappingURL=shadowMapFragment.js.map

/***/ }),

/***/ 85426:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowMapFragmentSoftTransparentShadow: () => (/* binding */ shadowMapFragmentSoftTransparentShadow)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowMapFragmentSoftTransparentShadow";
const shader = `#if SM_SOFTTRANSPARENTSHADOW==1
if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM.x*alpha) discard;
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const shadowMapFragmentSoftTransparentShadow = { name, shader };
//# sourceMappingURL=shadowMapFragmentSoftTransparentShadow.js.map

/***/ }),

/***/ 29796:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowMapVertexMetric: () => (/* binding */ shadowMapVertexMetric)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowMapVertexMetric";
const shader = `#if SM_USEDISTANCE==1
vPositionWSM=worldPos.xyz;
#endif
#if SM_DEPTHTEXTURE==1
#ifdef IS_NDC_HALF_ZRANGE
#define BIASFACTOR 0.5
#else
#define BIASFACTOR 1.0
#endif
#ifdef USE_REVERSE_DEPTHBUFFER
gl_Position.z-=biasAndScaleSM.x*gl_Position.w*BIASFACTOR;
#else
gl_Position.z+=biasAndScaleSM.x*gl_Position.w*BIASFACTOR;
#endif
#endif
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
zSM=gl_Position.z;gl_Position.z=0.0;
#elif SM_USEDISTANCE==0
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetricSM=(-gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#else
vDepthMetricSM=(gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const shadowMapVertexMetric = { name, shader };
//# sourceMappingURL=shadowMapVertexMetric.js.map

/***/ }),

/***/ 66812:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowsFragmentFunctions: () => (/* binding */ shadowsFragmentFunctions)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowsFragmentFunctions";
const shader = `#ifdef SHADOWS
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)
#else
#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)
#endif
#ifndef SHADOWFLOAT
float unpack(vec4 color)
{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}
#endif
float computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)
{float mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);}
#define inline
float computeShadowCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)
{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
float shadow=unpack(textureCube(shadowSampler,directionToLight));
#else
float shadow=textureCube(shadowSampler,directionToLight).x;
#endif
return depth>shadow ? darkness : 1.0;}
#define inline
float computeShadowWithPoissonSamplingCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)
{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;float visibility=1.;vec3 poissonDisk[4];poissonDisk[0]=vec3(-1.0,1.0,-1.0);poissonDisk[1]=vec3(1.0,-1.0,-1.0);poissonDisk[2]=vec3(-1.0,-1.0,-1.0);poissonDisk[3]=vec3(1.0,-1.0,1.0);
#ifndef SHADOWFLOAT
if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;if (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;
#else
if (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;if (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;if (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;if (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;
#endif
return min(1.0,visibility+darkness);}
#define inline
float computeShadowWithESMCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)
{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);float shadowPixelDepth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));
#else
float shadowMapSample=textureCube(shadowSampler,directionToLight).x;
#endif
float esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return esm;}
#define inline
float computeShadowWithCloseESMCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)
{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);float shadowPixelDepth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));
#else
float shadowMapSample=textureCube(shadowSampler,directionToLight).x;
#endif
float esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return esm;}
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define inline
float computeShadowCSM(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray shadowSampler,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);vec3 uvLayer=vec3(uv.x,uv.y,layer);float shadowPixelDepth=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
float shadow=unpack(texture2D(shadowSampler,uvLayer));
#else
float shadow=texture2D(shadowSampler,uvLayer).x;
#endif
return shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;}
#endif
#define inline
float computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{float shadowPixelDepth=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
float shadow=unpack(TEXTUREFUNC(shadowSampler,uv,0.));
#else
float shadow=TEXTUREFUNC(shadowSampler,uv,0.).x;
#endif
return shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;}}
#define inline
float computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{float shadowPixelDepth=clamp(depthMetric,0.,1.0);float visibility=1.;vec2 poissonDisk[4];poissonDisk[0]=vec2(-0.94201624,-0.39906216);poissonDisk[1]=vec2(0.94558609,-0.76890725);poissonDisk[2]=vec2(-0.094184101,-0.92938870);poissonDisk[3]=vec2(0.34495938,0.29387760);
#ifndef SHADOWFLOAT
if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[1]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[2]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;if (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[3]*mapSize,0.))<shadowPixelDepth) visibility-=0.25;
#else
if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[1]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[2]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;if (TEXTUREFUNC(shadowSampler,uv+poissonDisk[3]*mapSize,0.).x<shadowPixelDepth) visibility-=0.25;
#endif
return computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{float shadowPixelDepth=clamp(depthMetric,0.,1.0);
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));
#else
float shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;
#endif
float esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
{return 1.0;}
else
{float shadowPixelDepth=clamp(depthMetric,0.,1.0); 
#ifndef SHADOWFLOAT
float shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));
#else
float shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;
#endif
float esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}
#ifdef IS_NDC_HALF_ZRANGE
#define ZINCLIP clipSpace.z
#else
#define ZINCLIP uvDepth.z
#endif
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define GREATEST_LESS_THAN_ONE 0.99999994
#define DISABLE_UNIFORMITY_ANALYSIS
#define inline
float computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float shadow=texture2D(shadowSampler,uvDepthLayer);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
#define inline
float computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
#define inline
float computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));shadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));shadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));shadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
#define inline
float computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;float shadow=TEXTUREFUNC(shadowSampler,uvDepth,0.);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; 
uv+=0.5; 
vec2 st=fract(uv); 
vec2 base_uv=floor(uv)-0.5; 
base_uv*=shadowMapSizeAndInverse.y; 
vec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw2.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow+=uvw2.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z),0.);shadow+=uvw0.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z),0.);shadow+=uvw1.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z),0.);shadow+=uvw2.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z),0.);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
const vec3 PoissonSamplers32[64]=vec3[64](
vec3(0.06407013,0.05409927,0.),
vec3(0.7366577,0.5789394,0.),
vec3(-0.6270542,-0.5320278,0.),
vec3(-0.4096107,0.8411095,0.),
vec3(0.6849564,-0.4990818,0.),
vec3(-0.874181,-0.04579735,0.),
vec3(0.9989998,0.0009880066,0.),
vec3(-0.004920578,-0.9151649,0.),
vec3(0.1805763,0.9747483,0.),
vec3(-0.2138451,0.2635818,0.),
vec3(0.109845,0.3884785,0.),
vec3(0.06876755,-0.3581074,0.),
vec3(0.374073,-0.7661266,0.),
vec3(0.3079132,-0.1216763,0.),
vec3(-0.3794335,-0.8271583,0.),
vec3(-0.203878,-0.07715034,0.),
vec3(0.5912697,0.1469799,0.),
vec3(-0.88069,0.3031784,0.),
vec3(0.5040108,0.8283722,0.),
vec3(-0.5844124,0.5494877,0.),
vec3(0.6017799,-0.1726654,0.),
vec3(-0.5554981,0.1559997,0.),
vec3(-0.3016369,-0.3900928,0.),
vec3(-0.5550632,-0.1723762,0.),
vec3(0.925029,0.2995041,0.),
vec3(-0.2473137,0.5538505,0.),
vec3(0.9183037,-0.2862392,0.),
vec3(0.2469421,0.6718712,0.),
vec3(0.3916397,-0.4328209,0.),
vec3(-0.03576927,-0.6220032,0.),
vec3(-0.04661255,0.7995201,0.),
vec3(0.4402924,0.3640312,0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.),
vec3(0.)
);const vec3 PoissonSamplers64[64]=vec3[64](
vec3(-0.613392,0.617481,0.),
vec3(0.170019,-0.040254,0.),
vec3(-0.299417,0.791925,0.),
vec3(0.645680,0.493210,0.),
vec3(-0.651784,0.717887,0.),
vec3(0.421003,0.027070,0.),
vec3(-0.817194,-0.271096,0.),
vec3(-0.705374,-0.668203,0.),
vec3(0.977050,-0.108615,0.),
vec3(0.063326,0.142369,0.),
vec3(0.203528,0.214331,0.),
vec3(-0.667531,0.326090,0.),
vec3(-0.098422,-0.295755,0.),
vec3(-0.885922,0.215369,0.),
vec3(0.566637,0.605213,0.),
vec3(0.039766,-0.396100,0.),
vec3(0.751946,0.453352,0.),
vec3(0.078707,-0.715323,0.),
vec3(-0.075838,-0.529344,0.),
vec3(0.724479,-0.580798,0.),
vec3(0.222999,-0.215125,0.),
vec3(-0.467574,-0.405438,0.),
vec3(-0.248268,-0.814753,0.),
vec3(0.354411,-0.887570,0.),
vec3(0.175817,0.382366,0.),
vec3(0.487472,-0.063082,0.),
vec3(-0.084078,0.898312,0.),
vec3(0.488876,-0.783441,0.),
vec3(0.470016,0.217933,0.),
vec3(-0.696890,-0.549791,0.),
vec3(-0.149693,0.605762,0.),
vec3(0.034211,0.979980,0.),
vec3(0.503098,-0.308878,0.),
vec3(-0.016205,-0.872921,0.),
vec3(0.385784,-0.393902,0.),
vec3(-0.146886,-0.859249,0.),
vec3(0.643361,0.164098,0.),
vec3(0.634388,-0.049471,0.),
vec3(-0.688894,0.007843,0.),
vec3(0.464034,-0.188818,0.),
vec3(-0.440840,0.137486,0.),
vec3(0.364483,0.511704,0.),
vec3(0.034028,0.325968,0.),
vec3(0.099094,-0.308023,0.),
vec3(0.693960,-0.366253,0.),
vec3(0.678884,-0.204688,0.),
vec3(0.001801,0.780328,0.),
vec3(0.145177,-0.898984,0.),
vec3(0.062655,-0.611866,0.),
vec3(0.315226,-0.604297,0.),
vec3(-0.780145,0.486251,0.),
vec3(-0.371868,0.882138,0.),
vec3(0.200476,0.494430,0.),
vec3(-0.494552,-0.711051,0.),
vec3(0.612476,0.705252,0.),
vec3(-0.578845,-0.768792,0.),
vec3(-0.772454,-0.090976,0.),
vec3(0.504440,0.372295,0.),
vec3(0.155736,0.065157,0.),
vec3(0.391522,0.849605,0.),
vec3(-0.620106,-0.328104,0.),
vec3(0.789239,-0.419965,0.),
vec3(-0.545396,0.538133,0.),
vec3(-0.178564,-0.596057,0.)
);
#define inline
float computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i<searchTapCount; i ++) {blockerDepth=texture2D(depthSampler,vec3(uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer)).r;if (blockerDepth<depthMetric) {sumBlockerDepth+=blockerDepth;numBlocker++;}}
float avgBlockerDepth=sumBlockerDepth/numBlocker;float AAOffset=shadowMapSizeInverse*10.;float penumbraRatio=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);vec4 filterRadius=vec4(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);float random=getRand(vPositionFromLight.xy);float rotationAngle=random*3.1415926;vec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));float shadow=0.;for (int i=0; i<pcfTapCount; i++) {vec4 offset=vec4(poissonSamplers[i],0.);offset=vec4(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);shadow+=texture2D(shadowSampler,uvDepthLayer+offset*filterRadius);}
shadow/=float(pcfTapCount);shadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));shadow=mix(darkness,1.,shadow);if (numBlocker<1.0) {return 1.0;}
else
{return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
#define inline
float computeShadowWithPCSS(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers)
{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}
else
{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i<searchTapCount; i ++) {blockerDepth=TEXTUREFUNC(depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy),0.).r;if (blockerDepth<depthMetric) {sumBlockerDepth+=blockerDepth;numBlocker++;}}
if (numBlocker<1.0) {return 1.0;}
else
{float avgBlockerDepth=sumBlockerDepth/numBlocker;float AAOffset=shadowMapSizeInverse*10.;float penumbraRatio=((depthMetric-avgBlockerDepth)+AAOffset);float filterRadius=penumbraRatio*lightSizeUV*shadowMapSizeInverse;float random=getRand(vPositionFromLight.xy);float rotationAngle=random*3.1415926;vec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));float shadow=0.;for (int i=0; i<pcfTapCount; i++) {vec3 offset=poissonSamplers[i];offset=vec3(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);shadow+=TEXTUREFUNC(shadowSampler,uvDepth+offset*filterRadius,0.);}
shadow/=float(pcfTapCount);shadow=mix(shadow,1.,depthMetric-avgBlockerDepth);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}}
#define inline
float computeShadowWithPCSS16(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)
{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);}
#define inline
float computeShadowWithPCSS32(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)
{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);}
#define inline
float computeShadowWithPCSS64(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)
{return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);}
#define inline
float computeShadowWithCSMPCSS16(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
#define inline
float computeShadowWithCSMPCSS32(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
#define inline
float computeShadowWithCSMPCSS64(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)
{return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const shadowsFragmentFunctions = { name, shader };
//# sourceMappingURL=shadowsFragmentFunctions.js.map

/***/ }),

/***/ 35687:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shadowsVertex: () => (/* binding */ shadowsVertex)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "shadowsVertex";
const shader = `#ifdef SHADOWS
#if defined(SHADOWCSM{X})
vPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
}
#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
vPositionFromLight{X}=lightMatrix{X}*worldPos;
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#else
vDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
#endif
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const shadowsVertex = { name, shader };
//# sourceMappingURL=shadowsVertex.js.map

/***/ }),

/***/ 96044:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export subSurfaceScatteringFunctions */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "subSurfaceScatteringFunctions";
const shader = `bool testLightingForSSS(float diffusionProfile)
{return diffusionProfile<1.;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const subSurfaceScatteringFunctions = { name, shader };
//# sourceMappingURL=subSurfaceScatteringFunctions.js.map

/***/ }),

/***/ 94381:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export uvAttributeDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "uvAttributeDeclaration";
const shader = `#ifdef UV{X}
attribute vec2 uv{X};
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const uvAttributeDeclaration = { name, shader };
//# sourceMappingURL=uvAttributeDeclaration.js.map

/***/ }),

/***/ 4981:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export uvVariableDeclaration */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "uvVariableDeclaration";
const shader = `#if !defined(UV{X}) && defined(MAINUV{X})
vec2 uv{X}=vec2(0.,0.);
#endif
#ifdef MAINUV{X}
vMainUV{X}=uv{X};
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const uvVariableDeclaration = { name, shader };
//# sourceMappingURL=uvVariableDeclaration.js.map

/***/ }),

/***/ 94483:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* unused harmony export vertexColorMixing */
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "vertexColorMixing";
const shader = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
vColor=vec4(1.0);
#ifdef VERTEXCOLOR
#ifdef VERTEXALPHA
vColor*=color;
#else
vColor.rgb*=color.rgb;
#endif
#endif
#ifdef INSTANCESCOLOR
vColor*=instanceColor;
#endif
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.IncludesShadersStore[name] = shader;
/** @internal */
const vertexColorMixing = { name, shader };
//# sourceMappingURL=vertexColorMixing.js.map

/***/ }),

/***/ 69723:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   anaglyphPixelShader: () => (/* binding */ anaglyphPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "anaglyphPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D leftSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 leftFrag=texture2D(leftSampler,vUV);leftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);vec4 rightFrag=texture2D(textureSampler,vUV);rightFrag=vec4(rightFrag.r,1.0,1.0,1.0);gl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const anaglyphPixelShader = { name, shader };
//# sourceMappingURL=anaglyph.fragment.js.map

/***/ }),

/***/ 94476:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  backgroundPixelShader: () => (/* binding */ backgroundPixelShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundFragmentDeclaration.js
// Do not edit.

const backgroundFragmentDeclaration_name = "backgroundFragmentDeclaration";
const shader = `uniform vec4 vEyePosition;uniform vec4 vPrimaryColor;
#ifdef USEHIGHLIGHTANDSHADOWCOLORS
uniform vec4 vPrimaryColorShadow;
#endif
uniform float shadowLevel;uniform float alpha;
#ifdef DIFFUSE
uniform vec2 vDiffuseInfos;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;
#endif
#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)
uniform vec3 vBackgroundCenter;
#endif
#ifdef REFLECTIONFRESNEL
uniform vec4 vReflectionControl;
#endif
#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)
uniform mat4 view;
#endif
#ifdef PROJECTED_GROUND
uniform vec2 projectedGroundInfos;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[backgroundFragmentDeclaration_name] = shader;
/** @internal */
const backgroundFragmentDeclaration = { name: backgroundFragmentDeclaration_name, shader };
//# sourceMappingURL=backgroundFragmentDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundUboDeclaration.js
var backgroundUboDeclaration = __webpack_require__(86722);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(73325);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js
var reflectionFunction = __webpack_require__(18223);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js
var imageProcessingDeclaration = __webpack_require__(89392);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js
var lightFragmentDeclaration = __webpack_require__(92270);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js
var lightUboDeclaration = __webpack_require__(22448);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js
var lightsFragmentFunctions = __webpack_require__(21962);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js
var shadowsFragmentFunctions = __webpack_require__(66812);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js
var imageProcessingFunctions = __webpack_require__(64017);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(6194);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__(7806);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(7412);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js
var lightFragment = __webpack_require__(37256);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__(29741);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__(2360);
;// ./node_modules/@babylonjs/core/Shaders/background.fragment.js
// Do not edit.


















const background_fragment_name = "backgroundPixelShader";
const background_fragment_shader = `#ifdef TEXTURELODSUPPORT
#extension GL_EXT_shader_texture_lod : enable
#endif
precision highp float;
#include<__decl__backgroundFragment>
#include<helperFunctions>
varying vec3 vPositionW;
#ifdef MAINUV1
varying vec2 vMainUV1;
#endif 
#ifdef MAINUV2 
varying vec2 vMainUV2; 
#endif 
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef DIFFUSE
#if DIFFUSEDIRECTUV==1
#define vDiffuseUV vMainUV1
#elif DIFFUSEDIRECTUV==2
#define vDiffuseUV vMainUV2
#else
varying vec2 vDiffuseUV;
#endif
uniform sampler2D diffuseSampler;
#endif
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
#define sampleReflection(s,c) textureCube(s,c)
uniform samplerCube reflectionSampler;
#ifdef TEXTURELODSUPPORT
#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
#else
uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
#endif
#else
#define sampleReflection(s,c) texture2D(s,c)
uniform sampler2D reflectionSampler;
#ifdef TEXTURELODSUPPORT
#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
#else
uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
#endif
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#endif
#include<reflectionFunction>
#endif
#ifndef FROMLINEARSPACE
#define FROMLINEARSPACE;
#endif
#ifndef SHADOWONLY
#define SHADOWONLY;
#endif
#include<imageProcessingDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<imageProcessingFunctions>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#include<clipPlaneFragmentDeclaration>
#include<fogFragmentDeclaration>
#ifdef REFLECTIONFRESNEL
#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
vec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)
{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
#endif
#ifdef PROJECTED_GROUND
float diskIntersectWithBackFaceCulling(vec3 ro,vec3 rd,vec3 c,float r) {float d=rd.y;if(d>0.0) { return 1e6; }
vec3 o=ro-c;float t=-o.y/d;vec3 q=o+rd*t;return (dot(q,q)<r*r) ? t : 1e6;}
float sphereIntersect(vec3 ro,vec3 rd,float ra) {float b=dot(ro,rd);float c=dot(ro,ro)-ra*ra;float h=b*b-c;if(h<0.0) { return -1.0; }
h=sqrt(h);return-b+h;}
vec3 project(vec3 viewDirectionW,vec3 eyePosition) {float radius=projectedGroundInfos.x;float height=projectedGroundInfos.y;vec3 camDir=-viewDirectionW;float skySphereDistance=sphereIntersect(eyePosition,camDir,radius);vec3 skySpherePositionW=eyePosition+camDir*skySphereDistance;vec3 p=normalize(skySpherePositionW);eyePosition.y-=height;float sIntersection=sphereIntersect(eyePosition,p,radius);vec3 h=vec3(0.0,-height,0.0);float dIntersection=diskIntersectWithBackFaceCulling(eyePosition,p,h,radius);p=(eyePosition+min(sIntersection,dIntersection)*p);return p;}
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=vec3(0.0,1.0,0.0);
#endif
float shadow=1.;float globalShadow=0.;float shadowLightCount=0.;float aggShadow=0.;float numLights=0.;
#include<lightFragment>[0..maxSimultaneousLights]
#ifdef SHADOWINUSE
globalShadow/=shadowLightCount;
#else
globalShadow=1.0;
#endif
#ifndef BACKMAT_SHADOWONLY
vec4 reflectionColor=vec4(1.,1.,1.,1.);
#ifdef REFLECTION
#ifdef PROJECTED_GROUND
vec3 reflectionVector=project(viewDirectionW,vEyePosition.xyz);reflectionVector=vec3(reflectionMatrix*vec4(reflectionVector,1.));
#else
vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
vec3 reflectionCoords=reflectionVector;
#else
vec2 reflectionCoords=reflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
reflectionCoords/=reflectionVector.z;
#endif
reflectionCoords.y=1.0-reflectionCoords.y;
#endif
#ifdef REFLECTIONBLUR
float reflectionLOD=vReflectionInfos.y;
#ifdef TEXTURELODSUPPORT
reflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;reflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);
#else
float lodReflectionNormalized=saturate(reflectionLOD);float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);if(lodReflectionNormalizedDoubled<1.0){reflectionColor=mix(
sampleReflection(reflectionSamplerHigh,reflectionCoords),
reflectionSpecularMid,
lodReflectionNormalizedDoubled
);} else {reflectionColor=mix(
reflectionSpecularMid,
sampleReflection(reflectionSamplerLow,reflectionCoords),
lodReflectionNormalizedDoubled-1.0
);}
#endif
#else
vec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);reflectionColor=reflectionSample;
#endif
#ifdef RGBDREFLECTION
reflectionColor.rgb=fromRGBD(reflectionColor);
#endif
#ifdef GAMMAREFLECTION
reflectionColor.rgb=toLinearSpace(reflectionColor.rgb);
#endif
#ifdef REFLECTIONBGR
reflectionColor.rgb=reflectionColor.bgr;
#endif
reflectionColor.rgb*=vReflectionInfos.x;
#endif
vec3 diffuseColor=vec3(1.,1.,1.);float finalAlpha=alpha;
#ifdef DIFFUSE
vec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);
#ifdef GAMMADIFFUSE
diffuseMap.rgb=toLinearSpace(diffuseMap.rgb);
#endif
diffuseMap.rgb*=vDiffuseInfos.y;
#ifdef DIFFUSEHASALPHA
finalAlpha*=diffuseMap.a;
#endif
diffuseColor=diffuseMap.rgb;
#endif
#ifdef REFLECTIONFRESNEL
vec3 colorBase=diffuseColor;
#else
vec3 colorBase=reflectionColor.rgb*diffuseColor;
#endif
colorBase=max(colorBase,0.0);
#ifdef USERGBCOLOR
vec3 finalColor=colorBase;
#else
#ifdef USEHIGHLIGHTANDSHADOWCOLORS
vec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);
#else
vec3 mainColor=vPrimaryColor.rgb;
#endif
vec3 finalColor=colorBase*mainColor;
#endif
#ifdef REFLECTIONFRESNEL
vec3 reflectionAmount=vReflectionControl.xxx;vec3 reflectionReflectance0=vReflectionControl.yyy;vec3 reflectionReflectance90=vReflectionControl.zzz;float VdotN=dot(normalize(vEyePosition.xyz),normalW);vec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);reflectionAmount*=planarReflectionFresnel;
#ifdef REFLECTIONFALLOFF
float reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);reflectionDistanceFalloff*=reflectionDistanceFalloff;reflectionAmount*=reflectionDistanceFalloff;
#endif
finalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));
#endif
#ifdef OPACITYFRESNEL
float viewAngleToFloor=dot(normalW,normalize(vEyePosition.xyz-vBackgroundCenter));const float startAngle=0.1;float fadeFactor=saturate(viewAngleToFloor/startAngle);finalAlpha*=fadeFactor*fadeFactor;
#endif
#ifdef SHADOWINUSE
finalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);
#endif
vec4 color=vec4(finalColor,finalAlpha);
#else
vec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);
#endif
#include<logDepthFragment>
#include<fogFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
#if !defined(SKIPFINALCOLORCLAMP)
color.rgb=clamp(color.rgb,0.,30.0);
#endif
#else
color=applyImageProcessing(color);
#endif
#ifdef PREMULTIPLYALPHA
color.rgb*=color.a;
#endif
#ifdef NOISE
color.rgb+=dither(vPositionW.xy,0.5);color=max(color,0.0);
#endif
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[background_fragment_name] = background_fragment_shader;
/** @internal */
const backgroundPixelShader = { name: background_fragment_name, shader: background_fragment_shader };
//# sourceMappingURL=background.fragment.js.map

/***/ }),

/***/ 11114:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  backgroundVertexShader: () => (/* binding */ backgroundVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundVertexDeclaration.js
// Do not edit.

const backgroundVertexDeclaration_name = "backgroundVertexDeclaration";
const shader = `uniform mat4 view;uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
uniform float shadowLevel;
#ifdef DIFFUSE
uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[backgroundVertexDeclaration_name] = shader;
/** @internal */
const backgroundVertexDeclaration = { name: backgroundVertexDeclaration_name, shader };
//# sourceMappingURL=backgroundVertexDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundUboDeclaration.js
var backgroundUboDeclaration = __webpack_require__(86722);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(73325);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(69707);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(18959);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__(1218);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(71636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__(86560);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js
var lightVxFragmentDeclaration = __webpack_require__(47059);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js
var lightVxUboDeclaration = __webpack_require__(4662);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(3298);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(3361);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(65523);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(47314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__(16470);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js
var shadowsVertex = __webpack_require__(35687);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__(2215);
;// ./node_modules/@babylonjs/core/Shaders/background.vertex.js
// Do not edit.



















const background_vertex_name = "backgroundVertexShader";
const background_vertex_shader = `precision highp float;
#include<__decl__backgroundVertex>
#include<helperFunctions>
attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef MAINUV1
varying vec2 vMainUV1;
#endif
#ifdef MAINUV2
varying vec2 vMainUV2;
#endif
#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0
varying vec2 vDiffuseUV;
#endif
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#ifdef REFLECTIONMAP_SKYBOX
vPositionUVW=position;
#endif
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*finalWorld*vec4(position,1.0);} else {gl_Position=viewProjectionR*finalWorld*vec4(position,1.0);}
#else
gl_Position=viewProjection*finalWorld*vec4(position,1.0);
#endif
vec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos);
#ifdef NORMAL
mat3 normalWorld=mat3(finalWorld);
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vNormalW=normalize(normalWorld*normal);
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));
#ifdef EQUIRECTANGULAR_RELFECTION_FOV
mat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));vec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));if (fFovMultiplier<=1.0) {vDirectionW=normalize(segment);} else {vDirectionW=normalize(vDirectionW+(vDirectionW-segment));}
#endif
#endif
#ifndef UV1
vec2 uv=vec2(0.,0.);
#endif
#ifndef UV2
vec2 uv2=vec2(0.,0.);
#endif
#ifdef MAINUV1
vMainUV1=uv;
#endif
#ifdef MAINUV2
vMainUV2=uv2;
#endif
#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0
if (vDiffuseInfos.x==0.)
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}
else
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#ifdef VERTEXCOLOR
vColor=color;
#endif
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[background_vertex_name] = background_vertex_shader;
/** @internal */
const backgroundVertexShader = { name: background_vertex_name, shader: background_vertex_shader };
//# sourceMappingURL=background.vertex.js.map

/***/ }),

/***/ 18516:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bilateralBlurPixelShader: () => (/* binding */ bilateralBlurPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bilateralBlurPixelShader";
const shader = `uniform sampler2D textureSampler;uniform sampler2D depthSampler;uniform sampler2D normalSampler;uniform int filterSize;uniform vec2 blurDir;uniform float depthThreshold;uniform float normalThreshold;varying vec2 vUV;void main(void) {vec3 color=textureLod(textureSampler,vUV,0.).rgb;float depth=textureLod(depthSampler,vUV,0.).x;if (depth>=1e6 || depth<=0.) {glFragColor=vec4(color,1.);return;}
vec3 normal=textureLod(normalSampler,vUV,0.).rgb;
#ifdef DECODE_NORMAL
normal=normal*2.0-1.0;
#endif
float sigma=float(filterSize);float two_sigma2=2.0*sigma*sigma;float sigmaDepth=depthThreshold;float two_sigmaDepth2=2.0*sigmaDepth*sigmaDepth;float sigmaNormal=normalThreshold;float two_sigmaNormal2=2.0*sigmaNormal*sigmaNormal;vec3 sum=vec3(0.);float wsum=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec3 sampleColor=textureLod(textureSampler,vUV+coords*blurDir,0.).rgb;float sampleDepth=textureLod(depthSampler,vUV+coords*blurDir,0.).r;vec3 sampleNormal=textureLod(normalSampler,vUV+coords*blurDir,0.).rgb;
#ifdef DECODE_NORMAL
sampleNormal=sampleNormal*2.0-1.0;
#endif
float r=dot(coords,coords);float w=exp(-r/two_sigma2);float depthDelta=abs(sampleDepth-depth);float wd=step(depthDelta,depthThreshold);vec3 normalDelta=abs(sampleNormal-normal);float wn=step(normalDelta.x+normalDelta.y+normalDelta.z,normalThreshold);sum+=sampleColor*w*wd*wn;wsum+=w*wd*wn;}
glFragColor=vec4(sum/wsum,1.);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const bilateralBlurPixelShader = { name, shader };
//# sourceMappingURL=bilateralBlur.fragment.js.map

/***/ }),

/***/ 97621:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bilateralBlurQualityPixelShader: () => (/* binding */ bilateralBlurQualityPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bilateralBlurQualityPixelShader";
const shader = `uniform sampler2D textureSampler;uniform sampler2D depthSampler;uniform sampler2D normalSampler;uniform int filterSize;uniform vec2 blurDir;uniform float depthThreshold;uniform float normalThreshold;varying vec2 vUV;void main(void) {vec3 color=textureLod(textureSampler,vUV,0.).rgb;float depth=textureLod(depthSampler,vUV,0.).x;if (depth>=1e6 || depth<=0.) {glFragColor=vec4(color,1.);return;}
vec3 normal=textureLod(normalSampler,vUV,0.).rgb;
#ifdef DECODE_NORMAL
normal=normal*2.0-1.0;
#endif
float sigma=float(filterSize);float two_sigma2=2.0*sigma*sigma;float sigmaDepth=depthThreshold;float two_sigmaDepth2=2.0*sigmaDepth*sigmaDepth;float sigmaNormal=normalThreshold;float two_sigmaNormal2=2.0*sigmaNormal*sigmaNormal;vec3 sum=vec3(0.);float wsum=0.;for (int x=-filterSize; x<=filterSize; ++x) {for (int y=-filterSize; y<=filterSize; ++y) {vec2 coords=vec2(x,y)*blurDir;vec3 sampleColor=textureLod(textureSampler,vUV+coords,0.).rgb;float sampleDepth=textureLod(depthSampler,vUV+coords,0.).r;vec3 sampleNormal=textureLod(normalSampler,vUV+coords,0.).rgb;
#ifdef DECODE_NORMAL
sampleNormal=sampleNormal*2.0-1.0;
#endif
float r=dot(coords,coords);float w=exp(-r/two_sigma2);float rDepth=sampleDepth-depth;float wd=exp(-rDepth*rDepth/two_sigmaDepth2);float rNormal=abs(sampleNormal.x-normal.x)+abs(sampleNormal.y-normal.y)+abs(sampleNormal.z-normal.z);float wn=exp(-rNormal*rNormal/two_sigmaNormal2);sum+=sampleColor*w*wd*wn;wsum+=w*wd*wn;}}
glFragColor=vec4(sum/wsum,1.);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const bilateralBlurQualityPixelShader = { name, shader };
//# sourceMappingURL=bilateralBlurQuality.fragment.js.map

/***/ }),

/***/ 3996:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   blackAndWhitePixelShader: () => (/* binding */ blackAndWhitePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "blackAndWhitePixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float degree;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec3 color=texture2D(textureSampler,vUV).rgb;float luminance=dot(color,vec3(0.3,0.59,0.11)); 
vec3 blackAndWhite=vec3(luminance,luminance,luminance);gl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const blackAndWhitePixelShader = { name, shader };
//# sourceMappingURL=blackAndWhite.fragment.js.map

/***/ }),

/***/ 39336:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bloomMergePixelShader: () => (/* binding */ bloomMergePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "bloomMergePixelShader";
const shader = `uniform sampler2D textureSampler;uniform sampler2D bloomBlur;varying vec2 vUV;uniform float bloomWeight;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{gl_FragColor=texture2D(textureSampler,vUV);vec3 blurred=texture2D(bloomBlur,vUV).rgb;gl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight); }
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const bloomMergePixelShader = { name, shader };
//# sourceMappingURL=bloomMerge.fragment.js.map

/***/ }),

/***/ 33495:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  boundingBoxRendererPixelShader: () => (/* binding */ boundingBoxRendererPixelShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererFragmentDeclaration.js
// Do not edit.

const boundingBoxRendererFragmentDeclaration_name = "boundingBoxRendererFragmentDeclaration";
const shader = `uniform vec4 color;
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[boundingBoxRendererFragmentDeclaration_name] = shader;
/** @internal */
const boundingBoxRendererFragmentDeclaration = { name: boundingBoxRendererFragmentDeclaration_name, shader };
//# sourceMappingURL=boundingBoxRendererFragmentDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererUboDeclaration.js
var boundingBoxRendererUboDeclaration = __webpack_require__(66566);
;// ./node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.fragment.js
// Do not edit.



const boundingBoxRenderer_fragment_name = "boundingBoxRendererPixelShader";
const boundingBoxRenderer_fragment_shader = `#include<__decl__boundingBoxRendererFragment>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[boundingBoxRenderer_fragment_name] = boundingBoxRenderer_fragment_shader;
/** @internal */
const boundingBoxRendererPixelShader = { name: boundingBoxRenderer_fragment_name, shader: boundingBoxRenderer_fragment_shader };
//# sourceMappingURL=boundingBoxRenderer.fragment.js.map

/***/ }),

/***/ 82187:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  boundingBoxRendererVertexShader: () => (/* binding */ boundingBoxRendererVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererVertexDeclaration.js
// Do not edit.

const boundingBoxRendererVertexDeclaration_name = "boundingBoxRendererVertexDeclaration";
const shader = `uniform mat4 world;uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[boundingBoxRendererVertexDeclaration_name] = shader;
/** @internal */
const boundingBoxRendererVertexDeclaration = { name: boundingBoxRendererVertexDeclaration_name, shader };
//# sourceMappingURL=boundingBoxRendererVertexDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererUboDeclaration.js
var boundingBoxRendererUboDeclaration = __webpack_require__(66566);
;// ./node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.vertex.js
// Do not edit.



const boundingBoxRenderer_vertex_name = "boundingBoxRendererVertexShader";
const boundingBoxRenderer_vertex_shader = `attribute vec3 position;
#include<__decl__boundingBoxRendererVertex>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec4 worldPos=world*vec4(position,1.0);
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}
#else
gl_Position=viewProjection*worldPos;
#endif
#define CUSTOM_VERTEX_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[boundingBoxRenderer_vertex_name] = boundingBoxRenderer_vertex_shader;
/** @internal */
const boundingBoxRendererVertexShader = { name: boundingBoxRenderer_vertex_name, shader: boundingBoxRenderer_vertex_shader };
//# sourceMappingURL=boundingBoxRenderer.vertex.js.map

/***/ }),

/***/ 32048:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   chromaticAberrationPixelShader: () => (/* binding */ chromaticAberrationPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "chromaticAberrationPixelShader";
const shader = `uniform sampler2D textureSampler; 
uniform float chromatic_aberration;uniform float radialIntensity;uniform vec2 direction;uniform vec2 centerPosition;uniform float screen_width;uniform float screen_height;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);vec2 directionOfEffect=direction;if(directionOfEffect.x==0. && directionOfEffect.y==0.){directionOfEffect=normalize(centered_screen_pos);}
float radius2=centered_screen_pos.x*centered_screen_pos.x
+ centered_screen_pos.y*centered_screen_pos.y;float radius=sqrt(radius2);vec3 ref_indices=vec3(-0.3,0.0,0.3);float ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;float ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;vec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);vec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);vec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);vec4 r=texture2D(textureSampler,ref_coords_r);vec4 g=texture2D(textureSampler,ref_coords_g);vec4 b=texture2D(textureSampler,ref_coords_b);float a=clamp(r.a+g.a+b.a,0.,1.);gl_FragColor=vec4(r.r,g.g,b.b,a);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const chromaticAberrationPixelShader = { name, shader };
//# sourceMappingURL=chromaticAberration.fragment.js.map

/***/ }),

/***/ 97694:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   circleOfConfusionPixelShader: () => (/* binding */ circleOfConfusionPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "circleOfConfusionPixelShader";
const shader = `uniform sampler2D depthSampler;varying vec2 vUV;
#ifndef COC_DEPTH_NOT_NORMALIZED
uniform vec2 cameraMinMaxZ;
#endif
uniform float focusDistance;uniform float cocPrecalculation;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float depth=texture2D(depthSampler,vUV).r;
#define CUSTOM_COC_DEPTH
#ifdef COC_DEPTH_NOT_NORMALIZED
float pixelDistance=depth*1000.0;
#else
float pixelDistance=(cameraMinMaxZ.x+cameraMinMaxZ.y*depth)*1000.0; 
#endif
#define CUSTOM_COC_PIXELDISTANCE
float coc=abs(cocPrecalculation*((focusDistance-pixelDistance)/pixelDistance));coc=clamp(coc,0.0,1.0);gl_FragColor=vec4(coc,coc,coc,1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const circleOfConfusionPixelShader = { name, shader };
//# sourceMappingURL=circleOfConfusion.fragment.js.map

/***/ }),

/***/ 15450:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   colorPixelShader: () => (/* binding */ colorPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6194);
/* harmony import */ var _ShadersInclude_fogFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7806);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7412);
/* harmony import */ var _ShadersInclude_fogFragment_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2360);
// Do not edit.





const name = "colorPixelShader";
const shader = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
#define VERTEXCOLOR
varying vec4 vColor;
#else
uniform vec4 color;
#endif
#include<clipPlaneFragmentDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
gl_FragColor=vColor;
#else
gl_FragColor=color;
#endif
#include<fogFragment>(color,gl_FragColor)
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const colorPixelShader = { name, shader };
//# sourceMappingURL=color.fragment.js.map

/***/ }),

/***/ 5216:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   colorVertexShader: () => (/* binding */ colorVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69707);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18959);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71636);
/* harmony import */ var _ShadersInclude_fogVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(86560);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1218);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3298);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3361);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(65523);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(47314);
/* harmony import */ var _ShadersInclude_fogVertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(16470);
/* harmony import */ var _ShadersInclude_vertexColorMixing_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(94483);
// Do not edit.












const name = "colorVertexShader";
const shader = `attribute vec3 position;
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#ifdef FOG
uniform mat4 view;
#endif
#include<instancesDeclaration>
uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}
#else
gl_Position=viewProjection*worldPos;
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<vertexColorMixing>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const colorVertexShader = { name, shader };
//# sourceMappingURL=color.vertex.js.map

/***/ }),

/***/ 37670:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   colorCorrectionPixelShader: () => (/* binding */ colorCorrectionPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "colorCorrectionPixelShader";
const shader = `uniform sampler2D textureSampler; 
uniform sampler2D colorTable; 
varying vec2 vUV;const float SLICE_COUNT=16.0; 
#define inline
vec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {float sliceSize=1.0/width; 
float slicePixelSize=sliceSize/width; 
float sliceInnerSize=slicePixelSize*(width-1.0); 
float zSlice0=min(floor(uv.z*width),width-1.0);float zSlice1=min(zSlice0+1.0,width-1.0);float xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;float s0=xOffset+(zSlice0*sliceSize);float s1=xOffset+(zSlice1*sliceSize);vec4 slice0Color=texture2D(textureSampler,vec2(s0,uv.y));vec4 slice1Color=texture2D(textureSampler,vec2(s1,uv.y));float zOffset=mod(uv.z*width,1.0);vec4 result=mix(slice0Color,slice1Color,zOffset);return result;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 screen_color=texture2D(textureSampler,vUV);gl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const colorCorrectionPixelShader = { name, shader };
//# sourceMappingURL=colorCorrection.fragment.js.map

/***/ }),

/***/ 51537:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   convolutionPixelShader: () => (/* binding */ convolutionPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "convolutionPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform float kernel[9];
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec2 onePixel=vec2(1.0,1.0)/screenSize;vec4 colorSum =
texture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +
texture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +
texture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +
texture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +
texture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +
texture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +
texture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +
texture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +
texture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];float kernelWeight =
kernel[0] +
kernel[1] +
kernel[2] +
kernel[3] +
kernel[4] +
kernel[5] +
kernel[6] +
kernel[7] +
kernel[8];if (kernelWeight<=0.0) {kernelWeight=1.0;}
gl_FragColor=vec4((colorSum/kernelWeight).rgb,1);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const convolutionPixelShader = { name, shader };
//# sourceMappingURL=convolution.fragment.js.map

/***/ }),

/***/ 47383:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   copyTexture3DLayerToTexturePixelShader: () => (/* binding */ copyTexture3DLayerToTexturePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "copyTexture3DLayerToTexturePixelShader";
const shader = `precision highp sampler3D;uniform sampler3D textureSampler;uniform int layerNum;varying vec2 vUV;void main(void) {vec3 coord=vec3(0.0,0.0,float(layerNum));coord.xy=vec2(vUV.x,vUV.y)*vec2(textureSize(textureSampler,0).xy);vec3 color=texelFetch(textureSampler,ivec3(coord),0).rgb;gl_FragColor=vec4(color,1);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const copyTexture3DLayerToTexturePixelShader = { name, shader };
//# sourceMappingURL=copyTexture3DLayerToTexture.fragment.js.map

/***/ }),

/***/ 45963:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   copyTextureToTexturePixelShader: () => (/* binding */ copyTextureToTexturePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
// Do not edit.


const name = "copyTextureToTexturePixelShader";
const shader = `uniform float conversion;uniform sampler2D textureSampler;varying vec2 vUV;
#include<helperFunctions>
void main(void) 
{vec4 color=texture2D(textureSampler,vUV);
#ifdef DEPTH_TEXTURE
gl_FragDepth=color.r;
#else
if (conversion==1.) {color=toLinearSpace(color);} else if (conversion==2.) {color=toGammaSpace(color);}
gl_FragColor=color;
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const copyTextureToTexturePixelShader = { name, shader };
//# sourceMappingURL=copyTextureToTexture.fragment.js.map

/***/ }),

/***/ 42319:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  defaultPixelShader: () => (/* binding */ defaultPixelShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/decalFragmentDeclaration.js
var decalFragmentDeclaration = __webpack_require__(48109);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultFragmentDeclaration.js
// Do not edit.


const defaultFragmentDeclaration_name = "defaultFragmentDeclaration";
const shader = `uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;uniform vec4 vSpecularColor;uniform vec3 vEmissiveColor;uniform vec3 vAmbientColor;uniform float visibility;
#ifdef DIFFUSE
uniform vec2 vDiffuseInfos;
#endif
#ifdef AMBIENT
uniform vec2 vAmbientInfos;
#endif
#ifdef OPACITY 
uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;
#endif
#ifdef ALPHATEST
uniform float alphaCutOff;
#endif
#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION) || defined(PREPASS)
uniform mat4 view;
#endif
#ifdef REFRACTION
uniform vec4 vRefractionInfos;
#ifndef REFRACTIONMAP_3D
uniform mat4 refractionMatrix;
#endif
#ifdef REFRACTIONFRESNEL
uniform vec4 refractionLeftColor;uniform vec4 refractionRightColor;
#endif
#if defined(USE_LOCAL_REFRACTIONMAP_CUBIC) && defined(REFRACTIONMAP_3D)
uniform vec3 vRefractionPosition;uniform vec3 vRefractionSize; 
#endif
#endif
#if defined(SPECULAR) && defined(SPECULARTERM)
uniform vec2 vSpecularInfos;
#endif
#ifdef DIFFUSEFRESNEL
uniform vec4 diffuseLeftColor;uniform vec4 diffuseRightColor;
#endif
#ifdef OPACITYFRESNEL
uniform vec4 opacityParts;
#endif
#ifdef EMISSIVEFRESNEL
uniform vec4 emissiveLeftColor;uniform vec4 emissiveRightColor;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;
#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)
uniform mat4 reflectionMatrix;
#endif
#ifndef REFLECTIONMAP_SKYBOX
#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)
uniform vec3 vReflectionPosition;uniform vec3 vReflectionSize; 
#endif
#endif
#ifdef REFLECTIONFRESNEL
uniform vec4 reflectionLeftColor;uniform vec4 reflectionRightColor;
#endif
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;
#endif
#include<decalFragmentDeclaration>
#define ADDITIONAL_FRAGMENT_DECLARATION
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[defaultFragmentDeclaration_name] = shader;
/** @internal */
const defaultFragmentDeclaration = { name: defaultFragmentDeclaration_name, shader };
//# sourceMappingURL=defaultFragmentDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultUboDeclaration.js
var defaultUboDeclaration = __webpack_require__(81438);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassDeclaration.js
var prePassDeclaration = __webpack_require__(42694);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitDeclaration.js
var oitDeclaration = __webpack_require__(89986);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js
var mainUVVaryingDeclaration = __webpack_require__(4980);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(73325);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js
var lightFragmentDeclaration = __webpack_require__(92270);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js
var lightUboDeclaration = __webpack_require__(22448);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js
var lightsFragmentFunctions = __webpack_require__(21962);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js
var shadowsFragmentFunctions = __webpack_require__(66812);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.js
var samplerFragmentDeclaration = __webpack_require__(63022);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fresnelFunction.js
var fresnelFunction = __webpack_require__(51339);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js
var reflectionFunction = __webpack_require__(18223);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js
var imageProcessingDeclaration = __webpack_require__(89392);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js
var imageProcessingFunctions = __webpack_require__(64017);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js
var bumpFragmentMainFunctions = __webpack_require__(17494);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js
var bumpFragmentFunctions = __webpack_require__(8269);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(6194);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__(7806);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(7412);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js
var bumpFragment = __webpack_require__(27018);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/decalFragment.js
var decalFragment = __webpack_require__(11205);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js
var depthPrePass = __webpack_require__(1037);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js
var lightFragment = __webpack_require__(37256);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__(29741);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__(2360);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitFragment.js
var oitFragment = __webpack_require__(94436);
;// ./node_modules/@babylonjs/core/Shaders/default.fragment.js
// Do not edit.





























const default_fragment_name = "defaultPixelShader";
const default_fragment_shader = `#include<__decl__defaultFragment>
#if defined(BUMP) || !defined(NORMAL)
#extension GL_OES_standard_derivatives : enable
#endif
#include<prePassDeclaration>[SCENE_MRT_COUNT]
#include<oitDeclaration>
#define CUSTOM_FRAGMENT_BEGIN
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<mainUVVaryingDeclaration>[1..7]
#include<helperFunctions>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<lightsFragmentFunctions>
#include<shadowsFragmentFunctions>
#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)
#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)
#ifdef REFRACTION
#ifdef REFRACTIONMAP_3D
uniform samplerCube refractionCubeSampler;
#else
uniform sampler2D refraction2DSampler;
#endif
#endif
#if defined(SPECULARTERM)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)
#endif
#include<fresnelFunction>
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
uniform samplerCube reflectionCubeSampler;
#else
uniform sampler2D reflection2DSampler;
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#endif
#include<reflectionFunction>
#endif
#include<imageProcessingDeclaration>
#include<imageProcessingFunctions>
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));
#endif
#include<bumpFragment>
#ifdef TWOSIDEDLIGHTING
normalW=gl_FrontFacing ? normalW : -normalW;
#endif
#ifdef DIFFUSE
baseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);
#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)
if (baseColor.a<alphaCutOff)
discard;
#endif
#ifdef ALPHAFROMDIFFUSE
alpha*=baseColor.a;
#endif
#define CUSTOM_FRAGMENT_UPDATE_ALPHA
baseColor.rgb*=vDiffuseInfos.y;
#endif
#if defined(DECAL) && !defined(DECAL_AFTER_DETAIL)
vec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);
#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)
#endif
#include<depthPrePass>
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
baseColor.rgb*=vColor.rgb;
#endif
#ifdef DETAIL
baseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);
#endif
#if defined(DECAL) && defined(DECAL_AFTER_DETAIL)
vec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);
#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)
#endif
#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE
vec3 baseAmbientColor=vec3(1.,1.,1.);
#ifdef AMBIENT
baseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;
#endif
#define CUSTOM_FRAGMENT_BEFORE_LIGHTS
float glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;
#ifdef SPECULARTERM
#ifdef SPECULAR
vec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);specularColor=specularMapColor.rgb;
#ifdef GLOSSINESS
glossiness=glossiness*specularMapColor.a;
#endif
#endif
#endif
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
float shadow=1.;float aggShadow=0.;float numLights=0.;
#ifdef LIGHTMAP
vec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);
#ifdef RGBDLIGHTMAP
lightmapColor.rgb=fromRGBD(lightmapColor);
#endif
lightmapColor.rgb*=vLightmapInfos.y;
#endif
#include<lightFragment>[0..maxSimultaneousLights]
aggShadow=aggShadow/numLights;vec4 refractionColor=vec4(0.,0.,0.,1.);
#ifdef REFRACTION
vec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));
#ifdef REFRACTIONMAP_3D
#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC
refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,vRefractionSize,vRefractionPosition);
#endif
refractionVector.y=refractionVector.y*vRefractionInfos.w;vec4 refractionLookup=textureCube(refractionCubeSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;}
#else
vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));vec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=texture2D(refraction2DSampler,refractionCoords);
#endif
#ifdef RGBDREFRACTION
refractionColor.rgb=fromRGBD(refractionColor);
#endif
#ifdef IS_REFRACTION_LINEAR
refractionColor.rgb=toGammaSpace(refractionColor.rgb);
#endif
refractionColor.rgb*=vRefractionInfos.x;
#endif
vec4 reflectionColor=vec4(0.,0.,0.,1.);
#ifdef REFLECTION
vec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);
#ifdef REFLECTIONMAP_OPPOSITEZ
vReflectionUVW.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
#ifdef ROUGHNESS
float bias=vReflectionInfos.y;
#ifdef SPECULARTERM
#ifdef SPECULAR
#ifdef GLOSSINESS
bias*=(1.0-specularMapColor.a);
#endif
#endif
#endif
reflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);
#else
reflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);
#endif
#else
vec2 coords=vReflectionUVW.xy;
#ifdef REFLECTIONMAP_PROJECTION
coords/=vReflectionUVW.z;
#endif
coords.y=1.0-coords.y;reflectionColor=texture2D(reflection2DSampler,coords);
#endif
#ifdef RGBDREFLECTION
reflectionColor.rgb=fromRGBD(reflectionColor);
#endif
#ifdef IS_REFLECTION_LINEAR
reflectionColor.rgb=toGammaSpace(reflectionColor.rgb);
#endif
reflectionColor.rgb*=vReflectionInfos.x;
#ifdef REFLECTIONFRESNEL
float reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);
#ifdef REFLECTIONFRESNELFROMSPECULAR
#ifdef SPECULARTERM
reflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;
#else
reflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;
#endif
#else
reflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;
#endif
#endif
#endif
#ifdef REFRACTIONFRESNEL
float refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);refractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;
#endif
#ifdef OPACITY
vec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);
#ifdef OPACITYRGB
opacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;
#else
alpha*=opacityMap.a*vOpacityInfos.y;
#endif
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#ifdef OPACITYFRESNEL
float opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);alpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;
#endif
#ifdef ALPHATEST
#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS
if (alpha<alphaCutOff)
discard;
#endif
#ifndef ALPHABLEND
alpha=1.0;
#endif
#endif
vec3 emissiveColor=vEmissiveColor;
#ifdef EMISSIVE
emissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;
#endif
#ifdef EMISSIVEFRESNEL
float emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);emissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;
#endif
#ifdef DIFFUSEFRESNEL
float diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);diffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;
#endif
#ifdef EMISSIVEASILLUMINATION
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
#else
#ifdef LINKEMISSIVEWITHDIFFUSE
vec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
#else
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;
#endif
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase*specularColor;
#ifdef SPECULAROVERALPHA
alpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);
#endif
#else
vec3 finalSpecular=vec3(0.0);
#endif
#ifdef REFLECTIONOVERALPHA
alpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);
#endif
#ifdef EMISSIVEASILLUMINATION
vec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);
#else
vec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);
#endif
#ifdef LIGHTMAP
#ifndef LIGHTMAPEXCLUDED
#ifdef USELIGHTMAPASSHADOWMAP
color.rgb*=lightmapColor.rgb;
#else
color.rgb+=lightmapColor.rgb;
#endif
#endif
#endif
#define CUSTOM_FRAGMENT_BEFORE_FOG
color.rgb=max(color.rgb,0.);
#include<logDepthFragment>
#include<fogFragment>
#ifdef IMAGEPROCESSINGPOSTPROCESS
color.rgb=toLinearSpace(color.rgb);
#else
#ifdef IMAGEPROCESSING
color.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color);
#endif
#endif
color.a*=visibility;
#ifdef PREMULTIPLYALPHA
color.rgb*=color.a;
#endif
#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
#ifdef PREPASS
float writeGeometryInfo=color.a>0.4 ? 1.0 : 0.0;
#ifdef PREPASS_COLOR
gl_FragData[PREPASS_COLOR_INDEX]=color; 
#endif
#ifdef PREPASS_POSITION
gl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);
#endif
#ifdef PREPASS_LOCAL_POSITION
gl_FragData[PREPASS_LOCAL_POSITION_INDEX]=vec4(vPosition,writeGeometryInfo);
#endif
#if defined(PREPASS_VELOCITY)
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);
#elif defined(PREPASS_VELOCITY_LINEAR)
vec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w)-(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_IRRADIANCE
gl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_DEPTH
gl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_SCREENSPACE_DEPTH
gl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_NORMAL
#ifdef PREPASS_NORMAL_WORLDSPACE
gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalW,writeGeometryInfo);
#else
gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo);
#endif
#endif
#ifdef PREPASS_WORLD_NORMAL
gl_FragData[PREPASS_WORLD_NORMAL_INDEX]=vec4(normalW*0.5+0.5,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO
gl_FragData[PREPASS_ALBEDO_INDEX]=vec4(baseColor.rgb,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO_SQRT
gl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(sqrt(baseColor.rgb),writeGeometryInfo);
#endif
#ifdef PREPASS_REFLECTIVITY
#if defined(SPECULAR)
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularMapColor))*writeGeometryInfo; 
#else
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularColor),1.0)*writeGeometryInfo;
#endif
#endif
#endif
#if !defined(PREPASS) || defined(WEBGL2)
gl_FragColor=color;
#endif
#include<oitFragment>
#if ORDER_INDEPENDENT_TRANSPARENCY
if (fragDepth==nearestDepth) {frontColor.rgb+=color.rgb*color.a*alphaMultiplier;frontColor.a=1.0-alphaMultiplier*(1.0-color.a);} else {backColor+=color;}
#endif
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[default_fragment_name] = default_fragment_shader;
/** @internal */
const defaultPixelShader = { name: default_fragment_name, shader: default_fragment_shader };
//# sourceMappingURL=default.fragment.js.map

/***/ }),

/***/ 14268:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  defaultVertexShader: () => (/* binding */ defaultVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/decalVertexDeclaration.js
var decalVertexDeclaration = __webpack_require__(96019);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultVertexDeclaration.js
// Do not edit.


const defaultVertexDeclaration_name = "defaultVertexDeclaration";
const shader = `uniform mat4 viewProjection;
#ifdef MULTIVIEW
mat4 viewProjectionR;
#endif 
uniform mat4 view;
#ifdef DIFFUSE
uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;
#endif
#ifdef AMBIENT
uniform mat4 ambientMatrix;uniform vec2 vAmbientInfos;
#endif
#ifdef OPACITY
uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;uniform mat4 emissiveMatrix;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix;
#endif
#if defined(SPECULAR) && defined(SPECULARTERM)
uniform vec2 vSpecularInfos;uniform mat4 specularMatrix;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform mat4 bumpMatrix;
#endif
#ifdef REFLECTION
uniform mat4 reflectionMatrix;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;uniform mat4 detailMatrix;
#endif
#include<decalVertexDeclaration>
#define ADDITIONAL_VERTEX_DECLARATION
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[defaultVertexDeclaration_name] = shader;
/** @internal */
const defaultVertexDeclaration = { name: defaultVertexDeclaration_name, shader };
//# sourceMappingURL=defaultVertexDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultUboDeclaration.js
var defaultUboDeclaration = __webpack_require__(81438);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.js
var uvAttributeDeclaration = __webpack_require__(94381);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(73325);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(69707);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(18959);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__(1218);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.js
var prePassVertexDeclaration = __webpack_require__(78328);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js
var mainUVVaryingDeclaration = __webpack_require__(4980);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.js
var samplerVertexDeclaration = __webpack_require__(85136);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.js
var bumpVertexDeclaration = __webpack_require__(56390);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(71636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__(86560);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js
var lightVxFragmentDeclaration = __webpack_require__(47059);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js
var lightVxUboDeclaration = __webpack_require__(4662);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__(27999);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__(90738);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__(48451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__(15060);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(3298);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(3361);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(65523);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.js
var prePassVertex = __webpack_require__(65438);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.js
var uvVariableDeclaration = __webpack_require__(4981);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.js
var samplerVertexImplementation = __webpack_require__(41316);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js
var bumpVertex = __webpack_require__(19440);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(47314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__(16470);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js
var shadowsVertex = __webpack_require__(35687);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js
var vertexColorMixing = __webpack_require__(94483);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pointCloudVertex.js
var pointCloudVertex = __webpack_require__(91211);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__(2215);
;// ./node_modules/@babylonjs/core/Shaders/default.vertex.js
// Do not edit.


































const default_vertex_name = "defaultVertexShader";
const default_vertex_shader = `#include<__decl__defaultVertex>
#define CUSTOM_VERTEX_BEGIN
attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef TANGENT
attribute vec4 tangent;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#include<uvAttributeDeclaration>[2..7]
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<helperFunctions>
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
#include<prePassVertexDeclaration>
#include<mainUVVaryingDeclaration>[1..7]
#include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)
#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
#if defined(SPECULARTERM)
#include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)
#endif
#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)
varying vec3 vPositionW;
#ifdef NORMAL
varying vec3 vNormalW;
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<bumpVertexDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 positionUpdated=position;
#ifdef NORMAL
vec3 normalUpdated=normal;
#endif
#ifdef TANGENT
vec4 tangentUpdated=tangent;
#endif
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
vPositionUVW=positionUpdated;
#endif
#define CUSTOM_VERTEX_UPDATE_POSITION
#define CUSTOM_VERTEX_UPDATE_NORMAL
#include<instancesVertex>
#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#ifdef NORMAL
mat3 normalWorld=mat3(finalWorld);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vNormalW=normalize(normalWorld*normalUpdated);
#endif
#endif
#define CUSTOM_VERTEX_UPDATE_WORLDPOS
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}
#else
gl_Position=viewProjection*worldPos;
#endif
vPositionW=vec3(worldPos);
#ifdef PREPASS
#include<prePassVertex>
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));
#endif
#ifndef UV1
vec2 uvUpdated=vec2(0.,0.);
#endif
#ifdef MAINUV1
vMainUV1=uvUpdated;
#endif
#include<uvVariableDeclaration>[2..7]
#include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
#if defined(SPECULARTERM)
#include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)
#endif
#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)
#include<bumpVertex>
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#include<pointCloudVertex>
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[default_vertex_name] = default_vertex_shader;
/** @internal */
const defaultVertexShader = { name: default_vertex_name, shader: default_vertex_shader };
//# sourceMappingURL=default.vertex.js.map

/***/ }),

/***/ 88852:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   depthPixelShader: () => (/* binding */ depthPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6194);
/* harmony import */ var _ShadersInclude_packingFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8334);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7412);
// Do not edit.




const name = "depthPixelShader";
const shader = `#ifdef ALPHATEST
varying vec2 vUV;uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
varying float vDepthMetric;
#ifdef PACKED
#include<packingFunctions>
#endif
#ifdef STORE_CAMERASPACE_Z
varying vec4 vViewPos;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
#endif
#ifdef STORE_CAMERASPACE_Z
#ifdef PACKED
gl_FragColor=pack(vViewPos.z);
#else
gl_FragColor=vec4(vViewPos.z,0.0,0.0,1.0);
#endif
#else
#ifdef NONLINEARDEPTH
#ifdef PACKED
gl_FragColor=pack(gl_FragCoord.z);
#else
gl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0);
#endif
#else
#ifdef PACKED
gl_FragColor=pack(vDepthMetric);
#else
gl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0);
#endif
#endif
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const depthPixelShader = { name, shader };
//# sourceMappingURL=depth.fragment.js.map

/***/ }),

/***/ 9977:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  depthVertexShader: () => (/* binding */ depthVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(69707);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(18959);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__(27999);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__(90738);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(71636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__(1218);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pointCloudVertexDeclaration.js
// Do not edit.

const pointCloudVertexDeclaration_name = "pointCloudVertexDeclaration";
const shader = `#ifdef POINTSIZE
uniform float pointSize;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pointCloudVertexDeclaration_name] = shader;
/** @internal */
const pointCloudVertexDeclaration = { name: pointCloudVertexDeclaration_name, shader };
//# sourceMappingURL=pointCloudVertexDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__(48451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__(15060);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(3298);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(3361);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(65523);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(47314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pointCloudVertex.js
var pointCloudVertex = __webpack_require__(91211);
;// ./node_modules/@babylonjs/core/Shaders/depth.vertex.js
// Do not edit.















const depth_vertex_name = "depthVertexShader";
const depth_vertex_shader = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform mat4 viewProjection;uniform vec2 depthValues;
#if defined(ALPHATEST) || defined(NEED_UV)
varying vec2 vUV;uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#ifdef STORE_CAMERASPACE_Z
uniform mat4 view;varying vec4 vViewPos;
#endif
#include<pointCloudVertexDeclaration>
varying float vDepthMetric;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#include<clipPlaneVertex>
gl_Position=viewProjection*worldPos;
#ifdef STORE_CAMERASPACE_Z
vViewPos=view*worldPos;
#else
#ifdef USE_REVERSE_DEPTHBUFFER
vDepthMetric=((-gl_Position.z+depthValues.x)/(depthValues.y));
#else
vDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));
#endif
#endif
#if defined(ALPHATEST) || defined(BASIC_RENDER)
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#include<pointCloudVertex>
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[depth_vertex_name] = depth_vertex_shader;
/** @internal */
const depthVertexShader = { name: depth_vertex_name, shader: depth_vertex_shader };
//# sourceMappingURL=depth.vertex.js.map

/***/ }),

/***/ 69386:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   depthBoxBlurPixelShader: () => (/* binding */ depthBoxBlurPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "depthBoxBlurPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 colorDepth=vec4(0.0);for (int x=-OFFSET; x<=OFFSET; x++)
for (int y=-OFFSET; y<=OFFSET; y++)
colorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);gl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const depthBoxBlurPixelShader = { name, shader };
//# sourceMappingURL=depthBoxBlur.fragment.js.map

/***/ }),

/***/ 19411:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   depthOfFieldMergePixelShader: () => (/* binding */ depthOfFieldMergePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "depthOfFieldMergePixelShader";
const shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)
#else
#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)
#endif
uniform sampler2D textureSampler;varying vec2 vUV;uniform sampler2D circleOfConfusionSampler;uniform sampler2D blurStep0;
#if BLUR_LEVEL>0
uniform sampler2D blurStep1;
#endif
#if BLUR_LEVEL>1
uniform sampler2D blurStep2;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float coc=TEXTUREFUNC(circleOfConfusionSampler,vUV,0.0).r;
#if BLUR_LEVEL==0
vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);gl_FragColor=mix(original,blurred0,coc);
#endif
#if BLUR_LEVEL==1
if(coc<0.5){vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);gl_FragColor=mix(original,blurred1,coc/0.5);}else{vec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);gl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);}
#endif
#if BLUR_LEVEL==2
if(coc<0.33){vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred2=TEXTUREFUNC(blurStep2,vUV,0.0);gl_FragColor=mix(original,blurred2,coc/0.33);}else if(coc<0.66){vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);vec4 blurred2=TEXTUREFUNC(blurStep2,vUV,0.0);gl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);}else{vec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);vec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);gl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);}
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const depthOfFieldMergePixelShader = { name, shader };
//# sourceMappingURL=depthOfFieldMerge.fragment.js.map

/***/ }),

/***/ 73718:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   displayPassPixelShader: () => (/* binding */ displayPassPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "displayPassPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D passSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{gl_FragColor=texture2D(passSampler,vUV);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const displayPassPixelShader = { name, shader };
//# sourceMappingURL=displayPass.fragment.js.map

/***/ }),

/***/ 55491:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   extractHighlightsPixelShader: () => (/* binding */ extractHighlightsPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
// Do not edit.


const name = "extractHighlightsPixelShader";
const shader = `#include<helperFunctions>
varying vec2 vUV;uniform sampler2D textureSampler;uniform float threshold;uniform float exposure;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{gl_FragColor=texture2D(textureSampler,vUV);float luma=dot(LuminanceEncodeApprox,gl_FragColor.rgb*exposure);gl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const extractHighlightsPixelShader = { name, shader };
//# sourceMappingURL=extractHighlights.fragment.js.map

/***/ }),

/***/ 97961:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   filterPixelShader: () => (/* binding */ filterPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "filterPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform mat4 kernelMatrix;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec3 baseColor=texture2D(textureSampler,vUV).rgb;vec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;gl_FragColor=vec4(updatedColor,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const filterPixelShader = { name, shader };
//# sourceMappingURL=filter.fragment.js.map

/***/ }),

/***/ 91932:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingBilateralBlurPixelShader: () => (/* binding */ fluidRenderingBilateralBlurPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingBilateralBlurPixelShader";
const shader = `uniform sampler2D textureSampler;uniform int maxFilterSize;uniform vec2 blurDir;uniform float projectedParticleConstant;uniform float depthThreshold;varying vec2 vUV;void main(void) {float depth=textureLod(textureSampler,vUV,0.).x;if (depth>=1e6 || depth<=0.) {glFragColor=vec4(vec3(depth),1.);return;}
int filterSize=min(maxFilterSize,int(ceil(projectedParticleConstant/depth)));float sigma=float(filterSize)/3.0;float two_sigma2=2.0*sigma*sigma;float sigmaDepth=depthThreshold/3.0;float two_sigmaDepth2=2.0*sigmaDepth*sigmaDepth;float sum=0.;float wsum=0.;float sumVel=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec2 sampleDepthVel=textureLod(textureSampler,vUV+coords*blurDir,0.).rg;float r=dot(coords,coords);float w=exp(-r/two_sigma2);float rDepth=sampleDepthVel.r-depth;float wd=exp(-rDepth*rDepth/two_sigmaDepth2);sum+=sampleDepthVel.r*w*wd;sumVel+=sampleDepthVel.g*w*wd;wsum+=w*wd;}
glFragColor=vec4(sum/wsum,sumVel/wsum,0.,1.);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fluidRenderingBilateralBlurPixelShader = { name, shader };
//# sourceMappingURL=fluidRenderingBilateralBlur.fragment.js.map

/***/ }),

/***/ 3934:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleDepthPixelShader: () => (/* binding */ fluidRenderingParticleDepthPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleDepthPixelShader";
const shader = `uniform mat4 projection;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius;
#ifdef FLUIDRENDERING_VELOCITY
varying float velocityNorm;
#endif
void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;normal.z=sqrt(1.0-r2);
#ifndef FLUIDRENDERING_RHS
normal.z=-normal.z;
#endif
vec4 realViewPos=vec4(viewPos+normal*sphereRadius,1.0);vec4 clipSpacePos=projection*realViewPos;
#ifdef WEBGPU
gl_FragDepth=clipSpacePos.z/clipSpacePos.w;
#else
gl_FragDepth=(clipSpacePos.z/clipSpacePos.w)*0.5+0.5;
#endif
#ifdef FLUIDRENDERING_RHS
realViewPos.z=-realViewPos.z;
#endif
#ifdef FLUIDRENDERING_VELOCITY
glFragColor=vec4(realViewPos.z,velocityNorm,0.,1.);
#else
glFragColor=vec4(realViewPos.z,0.,0.,1.);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fluidRenderingParticleDepthPixelShader = { name, shader };
//# sourceMappingURL=fluidRenderingParticleDepth.fragment.js.map

/***/ }),

/***/ 13172:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleDepthVertexShader: () => (/* binding */ fluidRenderingParticleDepthVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleDepthVertexShader";
const shader = `attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius;
#ifdef FLUIDRENDERING_VELOCITY
attribute vec3 velocity;varying float velocityNorm;
#endif
void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;viewPos=(view*vec4(position,1.0)).xyz;gl_Position=projection*vec4(viewPos+cornerPos,1.0);uv=offset;sphereRadius=size.x/2.0;
#ifdef FLUIDRENDERING_VELOCITY
velocityNorm=length(velocity);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fluidRenderingParticleDepthVertexShader = { name, shader };
//# sourceMappingURL=fluidRenderingParticleDepth.vertex.js.map

/***/ }),

/***/ 23483:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleDiffusePixelShader: () => (/* binding */ fluidRenderingParticleDiffusePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleDiffusePixelShader";
const shader = `uniform float particleAlpha;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;glFragColor=vec4(diffuseColor,1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fluidRenderingParticleDiffusePixelShader = { name, shader };
//# sourceMappingURL=fluidRenderingParticleDiffuse.fragment.js.map

/***/ }),

/***/ 49079:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleThicknessPixelShader: () => (/* binding */ fluidRenderingParticleThicknessPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleThicknessPixelShader";
const shader = `uniform float particleAlpha;varying vec2 uv;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;float thickness=sqrt(1.0-r2);glFragColor=vec4(vec3(particleAlpha*thickness),1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fluidRenderingParticleThicknessPixelShader = { name, shader };
//# sourceMappingURL=fluidRenderingParticleThickness.fragment.js.map

/***/ }),

/***/ 54577:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingParticleThicknessVertexShader: () => (/* binding */ fluidRenderingParticleThicknessVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingParticleThicknessVertexShader";
const shader = `attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fluidRenderingParticleThicknessVertexShader = { name, shader };
//# sourceMappingURL=fluidRenderingParticleThickness.vertex.js.map

/***/ }),

/***/ 3399:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingRenderPixelShader: () => (/* binding */ fluidRenderingRenderPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingRenderPixelShader";
const shader = `#define DISABLE_UNIFORMITY_ANALYSIS
#define IOR 1.333
#define ETA 1.0/IOR
#define F0 0.02
uniform sampler2D textureSampler;uniform sampler2D depthSampler;
#ifdef FLUIDRENDERING_DIFFUSETEXTURE
uniform sampler2D diffuseSampler;
#else
uniform vec3 diffuseColor;
#endif
#ifdef FLUIDRENDERING_FIXED_THICKNESS
uniform float thickness;uniform sampler2D bgDepthSampler;
#else
uniform float minimumThickness;uniform sampler2D thicknessSampler;
#endif
#ifdef FLUIDRENDERING_ENVIRONMENT
uniform samplerCube reflectionSampler;
#endif
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)
uniform sampler2D debugSampler;
#endif
uniform mat4 viewMatrix;uniform mat4 projectionMatrix;uniform mat4 invProjectionMatrix;uniform vec2 texelSize;uniform vec3 dirLight;uniform float cameraFar;uniform float density;uniform float refractionStrength;uniform float fresnelClamp;uniform float specularPower;varying vec2 vUV;vec3 computeViewPosFromUVDepth(vec2 texCoord,float depth) {vec4 ndc;ndc.xy=texCoord*2.0-1.0;
#ifdef FLUIDRENDERING_RHS
ndc.z=-projectionMatrix[2].z+projectionMatrix[3].z/depth;
#else
ndc.z=projectionMatrix[2].z+projectionMatrix[3].z/depth;
#endif
ndc.w=1.0;vec4 eyePos=invProjectionMatrix*ndc;eyePos.xyz/=eyePos.w;return eyePos.xyz;}
vec3 getViewPosFromTexCoord(vec2 texCoord) {float depth=textureLod(depthSampler,texCoord,0.).x;return computeViewPosFromUVDepth(texCoord,depth);}
void main(void) {vec2 texCoord=vUV;
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)
vec4 color=texture2D(debugSampler,texCoord);
#ifdef FLUIDRENDERING_DEBUG_DEPTH
glFragColor=vec4(color.rgb/vec3(2.0),1.);if (color.r>0.999 && color.g>0.999) {glFragColor=texture2D(textureSampler,texCoord);}
#else
glFragColor=vec4(color.rgb,1.);if (color.r<0.001 && color.g<0.001 && color.b<0.001) {glFragColor=texture2D(textureSampler,texCoord);}
#endif
return;
#endif
vec2 depthVel=textureLod(depthSampler,texCoord,0.).rg;float depth=depthVel.r;
#ifndef FLUIDRENDERING_FIXED_THICKNESS
float thickness=texture2D(thicknessSampler,texCoord).x;
#else
float bgDepth=texture2D(bgDepthSampler,texCoord).x;float depthNonLinear=projectionMatrix[2].z+projectionMatrix[3].z/depth;depthNonLinear=depthNonLinear*0.5+0.5;
#endif
vec4 backColor=texture2D(textureSampler,texCoord);
#ifndef FLUIDRENDERING_FIXED_THICKNESS
if (depth>=cameraFar || depth<=0. || thickness<=minimumThickness) {
#else
if (depth>=cameraFar || depth<=0. || bgDepth<=depthNonLinear) {
#endif
#ifdef FLUIDRENDERING_COMPOSITE_MODE
glFragColor.rgb=backColor.rgb*backColor.a;glFragColor.a=backColor.a;
#else
glFragColor=backColor;
#endif
return;}
vec3 viewPos=computeViewPosFromUVDepth(texCoord,depth);vec3 ddx=getViewPosFromTexCoord(texCoord+vec2(texelSize.x,0.))-viewPos;vec3 ddy=getViewPosFromTexCoord(texCoord+vec2(0.,texelSize.y))-viewPos;vec3 ddx2=viewPos-getViewPosFromTexCoord(texCoord+vec2(-texelSize.x,0.));if (abs(ddx.z)>abs(ddx2.z)) {ddx=ddx2;}
vec3 ddy2=viewPos-getViewPosFromTexCoord(texCoord+vec2(0.,-texelSize.y));if (abs(ddy.z)>abs(ddy2.z)) {ddy=ddy2;}
vec3 normal=normalize(cross(ddy,ddx));
#ifdef FLUIDRENDERING_RHS
normal=-normal;
#endif
#ifndef WEBGPU
if(isnan(normal.x) || isnan(normal.y) || isnan(normal.z) || isinf(normal.x) || isinf(normal.y) || isinf(normal.z)) {normal=vec3(0.,0.,-1.);}
#endif
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_SHOWNORMAL)
glFragColor=vec4(normal*0.5+0.5,1.0);return;
#endif
vec3 rayDir=normalize(viewPos); 
#ifdef FLUIDRENDERING_DIFFUSETEXTURE
vec3 diffuseColor=textureLod(diffuseSampler,texCoord,0.0).rgb;
#endif
vec3 lightDir=normalize(vec3(viewMatrix*vec4(-dirLight,0.)));vec3 H =normalize(lightDir-rayDir);float specular=pow(max(0.0,dot(H,normal)),specularPower);
#ifdef FLUIDRENDERING_DEBUG_DIFFUSERENDERING
float diffuse =max(0.0,dot(lightDir,normal))*1.0;glFragColor=vec4(vec3(0.1) /*ambient*/+vec3(0.42,0.50,1.00)*diffuse+vec3(0,0,0.2)+specular,1.);return;
#endif
vec3 refractionDir=refract(rayDir,normal,ETA);vec4 transmitted=textureLod(textureSampler,vec2(texCoord+refractionDir.xy*thickness*refractionStrength),0.0);
#ifdef FLUIDRENDERING_COMPOSITE_MODE
if (transmitted.a==0.) transmitted.a=thickness;
#endif
vec3 transmittance=exp(-density*thickness*(1.0-diffuseColor)); 
vec3 refractionColor=transmitted.rgb*transmittance;
#ifdef FLUIDRENDERING_ENVIRONMENT
vec3 reflectionDir=reflect(rayDir,normal);vec3 reflectionColor=(textureCube(reflectionSampler,reflectionDir).rgb);float fresnel=clamp(F0+(1.0-F0)*pow(1.0-dot(normal,-rayDir),5.0),0.,fresnelClamp);vec3 finalColor=mix(refractionColor,reflectionColor,fresnel)+specular;
#else
vec3 finalColor=refractionColor+specular;
#endif
#ifdef FLUIDRENDERING_VELOCITY
float velocity=depthVel.g;finalColor=mix(finalColor,vec3(1.0),smoothstep(0.3,1.0,velocity/6.0));
#endif
glFragColor=vec4(finalColor,transmitted.a);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fluidRenderingRenderPixelShader = { name, shader };
//# sourceMappingURL=fluidRenderingRender.fragment.js.map

/***/ }),

/***/ 75679:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fluidRenderingStandardBlurPixelShader: () => (/* binding */ fluidRenderingStandardBlurPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fluidRenderingStandardBlurPixelShader";
const shader = `uniform sampler2D textureSampler;uniform int filterSize;uniform vec2 blurDir;varying vec2 vUV;void main(void) {vec4 s=textureLod(textureSampler,vUV,0.);if (s.r==0.) {glFragColor=vec4(0.,0.,0.,1.);return;}
float sigma=float(filterSize)/3.0;float twoSigma2=2.0*sigma*sigma;vec4 sum=vec4(0.);float wsum=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec4 sampl=textureLod(textureSampler,vUV+coords*blurDir,0.);float w=exp(-coords.x*coords.x/twoSigma2);sum+=sampl*w;wsum+=w;}
sum/=wsum;glFragColor=vec4(sum.rgb,1.);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fluidRenderingStandardBlurPixelShader = { name, shader };
//# sourceMappingURL=fluidRenderingStandardBlur.fragment.js.map

/***/ }),

/***/ 5499:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fxaaPixelShader: () => (/* binding */ fxaaPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fxaaPixelShader";
const shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)
#else
#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)
#endif
uniform sampler2D textureSampler;uniform vec2 texelSize;varying vec2 vUV;varying vec2 sampleCoordS;varying vec2 sampleCoordE;varying vec2 sampleCoordN;varying vec2 sampleCoordW;varying vec2 sampleCoordNW;varying vec2 sampleCoordSE;varying vec2 sampleCoordNE;varying vec2 sampleCoordSW;const float fxaaQualitySubpix=1.0;const float fxaaQualityEdgeThreshold=0.166;const float fxaaQualityEdgeThresholdMin=0.0833;const vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);
#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)
void main(){vec2 posM;posM.x=vUV.x;posM.y=vUV.y;vec4 rgbyM=TEXTUREFUNC(textureSampler,vUV,0.0);float lumaM=FxaaLuma(rgbyM);float lumaS=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordS,0.0));float lumaE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordE,0.0));float lumaN=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordN,0.0));float lumaW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordW,0.0));float maxSM=max(lumaS,lumaM);float minSM=min(lumaS,lumaM);float maxESM=max(lumaE,maxSM);float minESM=min(lumaE,minSM);float maxWN=max(lumaN,lumaW);float minWN=min(lumaN,lumaW);float rangeMax=max(maxWN,maxESM);float rangeMin=min(minWN,minESM);float rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;float range=rangeMax-rangeMin;float rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);
#ifndef MALI
if(range<rangeMaxClamped) 
{gl_FragColor=rgbyM;return;}
#endif
float lumaNW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordNW,0.0));float lumaSE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordSE,0.0));float lumaNE=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordNE,0.0));float lumaSW=FxaaLuma(TEXTUREFUNC(textureSampler,sampleCoordSW,0.0));float lumaNS=lumaN+lumaS;float lumaWE=lumaW+lumaE;float subpixRcpRange=1.0/range;float subpixNSWE=lumaNS+lumaWE;float edgeHorz1=(-2.0*lumaM)+lumaNS;float edgeVert1=(-2.0*lumaM)+lumaWE;float lumaNESE=lumaNE+lumaSE;float lumaNWNE=lumaNW+lumaNE;float edgeHorz2=(-2.0*lumaE)+lumaNESE;float edgeVert2=(-2.0*lumaN)+lumaNWNE;float lumaNWSW=lumaNW+lumaSW;float lumaSWSE=lumaSW+lumaSE;float edgeHorz4=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);float edgeVert4=(abs(edgeVert1)*2.0)+abs(edgeVert2);float edgeHorz3=(-2.0*lumaW)+lumaNWSW;float edgeVert3=(-2.0*lumaS)+lumaSWSE;float edgeHorz=abs(edgeHorz3)+edgeHorz4;float edgeVert=abs(edgeVert3)+edgeVert4;float subpixNWSWNESE=lumaNWSW+lumaNESE;float lengthSign=texelSize.x;bool horzSpan=edgeHorz>=edgeVert;float subpixA=subpixNSWE*2.0+subpixNWSWNESE;if (!horzSpan)
{lumaN=lumaW;}
if (!horzSpan) 
{lumaS=lumaE;}
if (horzSpan) 
{lengthSign=texelSize.y;}
float subpixB=(subpixA*(1.0/12.0))-lumaM;float gradientN=lumaN-lumaM;float gradientS=lumaS-lumaM;float lumaNN=lumaN+lumaM;float lumaSS=lumaS+lumaM;bool pairN=abs(gradientN)>=abs(gradientS);float gradient=max(abs(gradientN),abs(gradientS));if (pairN)
{lengthSign=-lengthSign;}
float subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);vec2 posB;posB.x=posM.x;posB.y=posM.y;vec2 offNP;offNP.x=(!horzSpan) ? 0.0 : texelSize.x;offNP.y=(horzSpan) ? 0.0 : texelSize.y;if (!horzSpan) 
{posB.x+=lengthSign*0.5;}
if (horzSpan)
{posB.y+=lengthSign*0.5;}
vec2 posN;posN.x=posB.x-offNP.x*1.5;posN.y=posB.y-offNP.y*1.5;vec2 posP;posP.x=posB.x+offNP.x*1.5;posP.y=posB.y+offNP.y*1.5;float subpixD=((-2.0)*subpixC)+3.0;float lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN,0.0));float subpixE=subpixC*subpixC;float lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP,0.0));if (!pairN) 
{lumaNN=lumaSS;}
float gradientScaled=gradient*1.0/4.0;float lumaMM=lumaM-lumaNN*0.5;float subpixF=subpixD*subpixE;bool lumaMLTZero=lumaMM<0.0;lumaEndN-=lumaNN*0.5;lumaEndP-=lumaNN*0.5;bool doneN=abs(lumaEndN)>=gradientScaled;bool doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) 
{posN.x-=offNP.x*3.0;}
if (!doneN) 
{posN.y-=offNP.y*3.0;}
bool doneNP=(!doneN) || (!doneP);if (!doneP) 
{posP.x+=offNP.x*3.0;}
if (!doneP)
{posP.y+=offNP.y*3.0;}
if (doneNP)
{if (!doneN) lumaEndN=FxaaLuma(TEXTUREFUNC(textureSampler,posN.xy,0.0));if (!doneP) lumaEndP=FxaaLuma(TEXTUREFUNC(textureSampler,posP.xy,0.0));if (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;if (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;doneN=abs(lumaEndN)>=gradientScaled;doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) posN.x-=offNP.x*12.0;if (!doneN) posN.y-=offNP.y*12.0;doneNP=(!doneN) || (!doneP);if (!doneP) posP.x+=offNP.x*12.0;if (!doneP) posP.y+=offNP.y*12.0;}
float dstN=posM.x-posN.x;float dstP=posP.x-posM.x;if (!horzSpan)
{dstN=posM.y-posN.y;}
if (!horzSpan) 
{dstP=posP.y-posM.y;}
bool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;float spanLength=(dstP+dstN);bool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;float spanLengthRcp=1.0/spanLength;bool directionN=dstN<dstP;float dst=min(dstN,dstP);bool goodSpan=directionN ? goodSpanN : goodSpanP;float subpixG=subpixF*subpixF;float pixelOffset=(dst*(-spanLengthRcp))+0.5;float subpixH=subpixG*fxaaQualitySubpix;float pixelOffsetGood=goodSpan ? pixelOffset : 0.0;float pixelOffsetSubpix=max(pixelOffsetGood,subpixH);if (!horzSpan)
{posM.x+=pixelOffsetSubpix*lengthSign;}
if (horzSpan)
{posM.y+=pixelOffsetSubpix*lengthSign;}
#ifdef MALI
if(range<rangeMaxClamped) 
{gl_FragColor=rgbyM;}
else
{gl_FragColor=TEXTUREFUNC(textureSampler,posM,0.0);}
#else
gl_FragColor=TEXTUREFUNC(textureSampler,posM,0.0);
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fxaaPixelShader = { name, shader };
//# sourceMappingURL=fxaa.fragment.js.map

/***/ }),

/***/ 9669:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fxaaVertexShader: () => (/* binding */ fxaaVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "fxaaVertexShader";
const shader = `attribute vec2 position;uniform vec2 texelSize;varying vec2 vUV;varying vec2 sampleCoordS;varying vec2 sampleCoordE;varying vec2 sampleCoordN;varying vec2 sampleCoordW;varying vec2 sampleCoordNW;varying vec2 sampleCoordSE;varying vec2 sampleCoordNE;varying vec2 sampleCoordSW;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=(position*madd+madd);sampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;sampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;sampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;sampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;sampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;sampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;sampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;sampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const fxaaVertexShader = { name, shader };
//# sourceMappingURL=fxaa.vertex.js.map

/***/ }),

/***/ 18335:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  gaussianSplattingPixelShader: () => (/* binding */ gaussianSplattingPixelShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(6194);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__(7806);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__(29741);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__(2360);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/gaussianSplattingFragmentDeclaration.js
// Do not edit.



const gaussianSplattingFragmentDeclaration_name = "gaussianSplattingFragmentDeclaration";
const shader = `vec4 gaussianColor(vec4 inColor)
{float A=-dot(vPosition,vPosition);if (A<-4.0) discard;float B=exp(A)*inColor.a;
#include<logDepthFragment>
vec3 color=inColor.rgb;
#ifdef FOG
#include<fogFragment>
#endif
return vec4(color,B);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[gaussianSplattingFragmentDeclaration_name] = shader;
/** @internal */
const gaussianSplattingFragmentDeclaration = { name: gaussianSplattingFragmentDeclaration_name, shader };
//# sourceMappingURL=gaussianSplattingFragmentDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(7412);
;// ./node_modules/@babylonjs/core/Shaders/gaussianSplatting.fragment.js
// Do not edit.






const gaussianSplatting_fragment_name = "gaussianSplattingPixelShader";
const gaussianSplatting_fragment_shader = `#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
varying vec4 vColor;varying vec2 vPosition;
#include<gaussianSplattingFragmentDeclaration>
void main () { 
#include<clipPlaneFragment>
gl_FragColor=gaussianColor(vColor);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[gaussianSplatting_fragment_name] = gaussianSplatting_fragment_shader;
/** @internal */
const gaussianSplattingPixelShader = { name: gaussianSplatting_fragment_name, shader: gaussianSplatting_fragment_shader };
//# sourceMappingURL=gaussianSplatting.fragment.js.map

/***/ }),

/***/ 97215:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  gaussianSplattingVertexShader: () => (/* binding */ gaussianSplattingVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js
var gaussianSplattingVertexDeclaration = __webpack_require__(39775);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js
var sceneUboDeclaration = __webpack_require__(28764);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js
var meshUboDeclaration = __webpack_require__(96467);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js
// Do not edit.



const gaussianSplattingUboDeclaration_name = "gaussianSplattingUboDeclaration";
const shader = `#include<sceneUboDeclaration>
#include<meshUboDeclaration>
attribute vec2 position;`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[gaussianSplattingUboDeclaration_name] = shader;
/** @internal */
const gaussianSplattingUboDeclaration = { name: gaussianSplattingUboDeclaration_name, shader };
//# sourceMappingURL=gaussianSplattingUboDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(71636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__(86560);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/gaussianSplatting.js
// Do not edit.

const gaussianSplatting_name = "gaussianSplatting";
const gaussianSplatting_shader = `#if !defined(WEBGL2) && !defined(WEBGPU) && !defined(NATIVE)
mat3 transpose(mat3 matrix) {return mat3(matrix[0][0],matrix[1][0],matrix[2][0],
matrix[0][1],matrix[1][1],matrix[2][1],
matrix[0][2],matrix[1][2],matrix[2][2]);}
#endif
vec2 getDataUV(float index,vec2 textureSize) {float y=floor(index/textureSize.x);float x=index-y*textureSize.x;return vec2((x+0.5)/textureSize.x,(y+0.5)/textureSize.y);}
struct Splat {vec4 center;vec4 color;vec4 covA;vec4 covB;};Splat readSplat(float splatIndex)
{Splat splat;vec2 splatUV=getDataUV(splatIndex,dataTextureSize);splat.center=texture2D(centersTexture,splatUV);splat.color=texture2D(colorsTexture,splatUV);splat.covA=texture2D(covariancesATexture,splatUV)*splat.center.w;splat.covB=texture2D(covariancesBTexture,splatUV)*splat.center.w;return splat;}
vec4 gaussianSplatting(vec2 meshPos,vec3 worldPos,vec2 scale,vec3 covA,vec3 covB,mat4 worldMatrix,mat4 viewMatrix,mat4 projectionMatrix)
{mat4 modelView=viewMatrix*worldMatrix;vec4 camspace=viewMatrix*vec4(worldPos,1.);vec4 pos2d=projectionMatrix*camspace;float bounds=1.2*pos2d.w;if (pos2d.z<-pos2d.w || pos2d.x<-bounds || pos2d.x>bounds
|| pos2d.y<-bounds || pos2d.y>bounds) {return vec4(0.0,0.0,2.0,1.0);}
mat3 Vrk=mat3(
covA.x,covA.y,covA.z,
covA.y,covB.x,covB.y,
covA.z,covB.y,covB.z
);mat3 J=mat3(
focal.x/camspace.z,0.,-(focal.x*camspace.x)/(camspace.z*camspace.z),
0.,focal.y/camspace.z,-(focal.y*camspace.y)/(camspace.z*camspace.z),
0.,0.,0.
);mat3 invy=mat3(1,0,0,0,-1,0,0,0,1);mat3 T=invy*transpose(mat3(modelView))*J;mat3 cov2d=transpose(T)*Vrk*T;float mid=(cov2d[0][0]+cov2d[1][1])/2.0;float radius=length(vec2((cov2d[0][0]-cov2d[1][1])/2.0,cov2d[0][1]));float lambda1=mid+radius,lambda2=mid-radius;if (lambda2<0.0)
{return vec4(0.0,0.0,2.0,1.0);}
vec2 diagonalVector=normalize(vec2(cov2d[0][1],lambda1-cov2d[0][0]));vec2 majorAxis=min(sqrt(2.0*lambda1),1024.0)*diagonalVector;vec2 minorAxis=min(sqrt(2.0*lambda2),1024.0)*vec2(diagonalVector.y,-diagonalVector.x);vec2 vCenter=vec2(pos2d);return vec4(
vCenter 
+ ((meshPos.x*majorAxis
+ meshPos.y*minorAxis)*invViewport*pos2d.w)*scale,pos2d.zw);}`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[gaussianSplatting_name] = gaussianSplatting_shader;
/** @internal */
const gaussianSplatting = { name: gaussianSplatting_name, shader: gaussianSplatting_shader };
//# sourceMappingURL=gaussianSplatting.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(47314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__(16470);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__(2215);
;// ./node_modules/@babylonjs/core/Shaders/gaussianSplatting.vertex.js
// Do not edit.










const gaussianSplatting_vertex_name = "gaussianSplattingVertexShader";
const gaussianSplatting_vertex_shader = `#include<__decl__gaussianSplattingVertex>
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<logDepthDeclaration>
attribute float splatIndex;uniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;varying vec4 vColor;varying vec2 vPosition;
#include<gaussianSplatting>
void main () {Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);vec4 worldPos=world*vec4(splat.center.xyz,1.0);vColor=splat.color;vPosition=position;gl_Position=gaussianSplatting(position,worldPos.xyz,vec2(1.,1.),covA,covB,world,view,projection);
#include<clipPlaneVertex>
#include<fogVertex>
#include<logDepthVertex>
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[gaussianSplatting_vertex_name] = gaussianSplatting_vertex_shader;
/** @internal */
const gaussianSplattingVertexShader = { name: gaussianSplatting_vertex_name, shader: gaussianSplatting_vertex_shader };
//# sourceMappingURL=gaussianSplatting.vertex.js.map

/***/ }),

/***/ 75007:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  geometryPixelShader: () => (/* binding */ geometryPixelShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(6194);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/mrtFragmentDeclaration.js
// Do not edit.

const mrtFragmentDeclaration_name = "mrtFragmentDeclaration";
const shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
layout(location=0) out vec4 glFragData[{X}];
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[mrtFragmentDeclaration_name] = shader;
/** @internal */
const mrtFragmentDeclaration = { name: mrtFragmentDeclaration_name, shader };
//# sourceMappingURL=mrtFragmentDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js
var bumpFragmentMainFunctions = __webpack_require__(17494);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js
var bumpFragmentFunctions = __webpack_require__(8269);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(73325);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(7412);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js
var bumpFragment = __webpack_require__(27018);
;// ./node_modules/@babylonjs/core/Shaders/geometry.fragment.js
// Do not edit.








const geometry_fragment_name = "geometryPixelShader";
const geometry_fragment_shader = `#extension GL_EXT_draw_buffers : require
#if defined(BUMP) || !defined(NORMAL)
#extension GL_OES_standard_derivatives : enable
#endif
precision highp float;
#ifdef BUMP
varying mat4 vWorldView;varying vec3 vNormalW;
#else
varying vec3 vNormalV;
#endif
varying vec4 vViewPos;
#if defined(POSITION) || defined(BUMP)
varying vec3 vPositionW;
#endif
#if defined(VELOCITY) || defined(VELOCITY_LINEAR)
varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;
#endif
#ifdef NEED_UV
varying vec2 vUV;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;
#endif
#if defined(REFLECTIVITY)
#if defined(ORMTEXTURE) || defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
uniform sampler2D reflectivitySampler;varying vec2 vReflectivityUV;
#endif
#ifdef ALBEDOTEXTURE
varying vec2 vAlbedoUV;uniform sampler2D albedoSampler;
#endif
#ifdef REFLECTIVITYCOLOR
uniform vec3 reflectivityColor;
#endif
#ifdef ALBEDOCOLOR
uniform vec3 albedoColor;
#endif
#ifdef METALLIC
uniform float metallic;
#endif
#if defined(ROUGHNESS) || defined(GLOSSINESS)
uniform float glossiness;
#endif
#endif
#if defined(ALPHATEST) && defined(NEED_UV)
uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
#include<mrtFragmentDeclaration>[SCENE_MRT_COUNT]
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#include<helperFunctions>
void main() {
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
#endif
vec3 normalOutput;
#ifdef BUMP
vec3 normalW=normalize(vNormalW);
#include<bumpFragment>
#ifdef NORMAL_WORLDSPACE
normalOutput=normalW;
#else
normalOutput=normalize(vec3(vWorldView*vec4(normalW,0.0)));
#endif
#else
normalOutput=normalize(vNormalV);
#endif
#ifdef ENCODE_NORMAL
normalOutput=normalOutput*0.5+0.5;
#endif
#ifdef DEPTH
gl_FragData[DEPTH_INDEX]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);
#endif
#ifdef NORMAL
gl_FragData[NORMAL_INDEX]=vec4(normalOutput,1.0);
#endif
#ifdef SCREENSPACE_DEPTH
gl_FragData[SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,1.0);
#endif
#ifdef POSITION
gl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0);
#endif
#ifdef VELOCITY
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);
#endif
#ifdef VELOCITY_LINEAR
vec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w) -
(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,1.0);
#endif
#ifdef REFLECTIVITY
vec4 reflectivity=vec4(0.0,0.0,0.0,1.0);
#ifdef METALLICWORKFLOW
float metal=1.0;float roughness=1.0;
#ifdef ORMTEXTURE
metal*=texture2D(reflectivitySampler,vReflectivityUV).b;roughness*=texture2D(reflectivitySampler,vReflectivityUV).g;
#endif
#ifdef METALLIC
metal*=metallic;
#endif
#ifdef ROUGHNESS
roughness*=(1.0-glossiness); 
#endif
reflectivity.a-=roughness;vec3 color=vec3(1.0);
#ifdef ALBEDOTEXTURE
color=texture2D(albedoSampler,vAlbedoUV).rgb;
#ifdef GAMMAALBEDO
color=toLinearSpace(color);
#endif
#endif
#ifdef ALBEDOCOLOR
color*=albedoColor.xyz;
#endif
reflectivity.rgb=mix(vec3(0.04),color,metal);
#else
#if defined(SPECULARGLOSSINESSTEXTURE) || defined(REFLECTIVITYTEXTURE)
reflectivity=texture2D(reflectivitySampler,vReflectivityUV);
#ifdef GAMMAREFLECTIVITYTEXTURE
reflectivity.rgb=toLinearSpace(reflectivity.rgb);
#endif
#else 
#ifdef REFLECTIVITYCOLOR
reflectivity.rgb=toLinearSpace(reflectivityColor.xyz);reflectivity.a=1.0;
#endif
#endif
#ifdef GLOSSINESSS
reflectivity.a*=glossiness; 
#endif
#endif
gl_FragData[REFLECTIVITY_INDEX]=reflectivity;
#endif
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[geometry_fragment_name] = geometry_fragment_shader;
/** @internal */
const geometryPixelShader = { name: geometry_fragment_name, shader: geometry_fragment_shader };
//# sourceMappingURL=geometry.fragment.js.map

/***/ }),

/***/ 6739:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  geometryVertexShader: () => (/* binding */ geometryVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(69707);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(18959);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__(27999);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__(90738);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__(1218);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/geometryVertexDeclaration.js
// Do not edit.

const geometryVertexDeclaration_name = "geometryVertexDeclaration";
const shader = `uniform mat4 viewProjection;uniform mat4 view;`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[geometryVertexDeclaration_name] = shader;
/** @internal */
const geometryVertexDeclaration = { name: geometryVertexDeclaration_name, shader };
//# sourceMappingURL=geometryVertexDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js
var sceneUboDeclaration = __webpack_require__(28764);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/geometryUboDeclaration.js
// Do not edit.


const geometryUboDeclaration_name = "geometryUboDeclaration";
const geometryUboDeclaration_shader = `#include<sceneUboDeclaration>
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[geometryUboDeclaration_name] = geometryUboDeclaration_shader;
/** @internal */
const geometryUboDeclaration = { name: geometryUboDeclaration_name, shader: geometryUboDeclaration_shader };
//# sourceMappingURL=geometryUboDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(71636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__(48451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__(15060);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(3298);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(3361);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(65523);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(47314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js
var bumpVertex = __webpack_require__(19440);
;// ./node_modules/@babylonjs/core/Shaders/geometry.vertex.js
// Do not edit.
















const geometry_vertex_name = "geometryVertexShader";
const geometry_vertex_shader = `precision highp float;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
#include<__decl__geometryVertex>
#include<clipPlaneVertexDeclaration>
attribute vec3 position;attribute vec3 normal;
#ifdef NEED_UV
varying vec2 vUV;
#ifdef ALPHATEST
uniform mat4 diffuseMatrix;
#endif
#ifdef BUMP
uniform mat4 bumpMatrix;varying vec2 vBumpUV;
#endif
#ifdef REFLECTIVITY
uniform mat4 reflectivityMatrix;uniform mat4 albedoMatrix;varying vec2 vReflectivityUV;varying vec2 vAlbedoUV;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#ifdef BUMP
varying mat4 vWorldView;
#endif
#ifdef BUMP
varying vec3 vNormalW;
#else
varying vec3 vNormalV;
#endif
varying vec4 vViewPos;
#if defined(POSITION) || defined(BUMP)
varying vec3 vPositionW;
#endif
#if defined(VELOCITY) || defined(VELOCITY_LINEAR)
uniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;vec3 normalUpdated=normal;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=vec4(finalWorld*vec4(positionUpdated,1.0));
#ifdef BUMP
vWorldView=view*finalWorld;mat3 normalWorld=mat3(finalWorld);vNormalW=normalize(normalWorld*normalUpdated);
#else
#ifdef NORMAL_WORLDSPACE
vNormalV=normalize(vec3(finalWorld*vec4(normalUpdated,0.0)));
#else
vNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));
#endif
#endif
vViewPos=view*worldPos;
#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);
#if NUM_BONE_INFLUENCERS>0
mat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];
#if NUM_BONE_INFLUENCERS>1
previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];
#endif
#if NUM_BONE_INFLUENCERS>2
previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];
#endif
#if NUM_BONE_INFLUENCERS>3
previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];
#endif
#if NUM_BONE_INFLUENCERS>4
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
#endif
#if NUM_BONE_INFLUENCERS>5
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
#endif
#if NUM_BONE_INFLUENCERS>6
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
#endif
#if NUM_BONE_INFLUENCERS>7
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
#endif
vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);
#else
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#endif
#if defined(POSITION) || defined(BUMP)
vPositionW=worldPos.xyz/worldPos.w;
#endif
gl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);
#include<clipPlaneVertex>
#ifdef NEED_UV
#ifdef UV1
#if defined(ALPHATEST) && defined(ALPHATEST_UV1)
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#else
vUV=uv;
#endif
#ifdef BUMP_UV1
vBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef REFLECTIVITY_UV1
vReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef ALBEDO_UV1
vAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#endif
#ifdef UV2
#if defined(ALPHATEST) && defined(ALPHATEST_UV2)
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#else
vUV=uv2;
#endif
#ifdef BUMP_UV2
vBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));
#endif
#ifdef REFLECTIVITY_UV2
vReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));
#endif
#ifdef ALBEDO_UV2
vAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#endif
#include<bumpVertex>
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[geometry_vertex_name] = geometry_vertex_shader;
/** @internal */
const geometryVertexShader = { name: geometry_vertex_name, shader: geometry_vertex_shader };
//# sourceMappingURL=geometry.vertex.js.map

/***/ }),

/***/ 57094:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowBlurPostProcessPixelShader: () => (/* binding */ glowBlurPostProcessPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "glowBlurPostProcessPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 direction;uniform float blurWidth;float getLuminance(vec3 color)
{return dot(color,vec3(0.2126,0.7152,0.0722));}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float weights[7];weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;vec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);vec2 texelStep=texelSize*direction*blurWidth;vec2 start=vUV-3.0*texelStep;vec4 baseColor=vec4(0.,0.,0.,0.);vec2 texelOffset=vec2(0.,0.);for (int i=0; i<7; i++)
{vec4 texel=texture2D(textureSampler,start+texelOffset);baseColor.a+=texel.a*weights[i];float luminance=getLuminance(baseColor.rgb);float luminanceTexel=getLuminance(texel.rgb);float choice=step(luminanceTexel,luminance);baseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;texelOffset+=texelStep;}
gl_FragColor=baseColor;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const glowBlurPostProcessPixelShader = { name, shader };
//# sourceMappingURL=glowBlurPostProcess.fragment.js.map

/***/ }),

/***/ 83234:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowMapGenerationPixelShader: () => (/* binding */ glowMapGenerationPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6194);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7412);
// Do not edit.




const name = "glowMapGenerationPixelShader";
const shader = `#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)
#include<helperFunctions>
#endif
#ifdef DIFFUSE
varying vec2 vUVDiffuse;uniform sampler2D diffuseSampler;
#endif
#ifdef OPACITY
varying vec2 vUVOpacity;uniform sampler2D opacitySampler;uniform float opacityIntensity;
#endif
#ifdef EMISSIVE
varying vec2 vUVEmissive;uniform sampler2D emissiveSampler;
#endif
#ifdef VERTEXALPHA
varying vec4 vColor;
#endif
uniform vec4 glowColor;uniform float glowIntensity;
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#include<clipPlaneFragment>
vec4 finalColor=glowColor;
#ifdef DIFFUSE
vec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);
#ifdef DIFFUSE_ISLINEAR
albedoTexture=toGammaSpace(albedoTexture);
#endif
#ifdef GLOW
finalColor.a*=albedoTexture.a;
#endif
#ifdef HIGHLIGHT
finalColor.a=albedoTexture.a;
#endif
#endif
#ifdef OPACITY
vec4 opacityMap=texture2D(opacitySampler,vUVOpacity);
#ifdef OPACITYRGB
finalColor.a*=getLuminance(opacityMap.rgb);
#else
finalColor.a*=opacityMap.a;
#endif
finalColor.a*=opacityIntensity;
#endif
#ifdef VERTEXALPHA
finalColor.a*=vColor.a;
#endif
#ifdef ALPHATEST
if (finalColor.a<ALPHATESTVALUE)
discard;
#endif
#ifdef EMISSIVE
vec4 emissive=texture2D(emissiveSampler,vUVEmissive);
#ifdef EMISSIVE_ISLINEAR
emissive=toGammaSpace(emissive);
#endif
gl_FragColor=emissive*finalColor*glowIntensity;
#else
gl_FragColor=finalColor*glowIntensity;
#endif
#ifdef HIGHLIGHT
gl_FragColor.a=glowColor.a;
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const glowMapGenerationPixelShader = { name, shader };
//# sourceMappingURL=glowMapGeneration.fragment.js.map

/***/ }),

/***/ 50136:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowMapGenerationVertexShader: () => (/* binding */ glowMapGenerationVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69707);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18959);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27999);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90738);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71636);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1218);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48451);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(15060);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3298);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(3361);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(65523);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(47314);
// Do not edit.













const name = "glowMapGenerationVertexShader";
const shader = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
#include<instancesDeclaration>
uniform mat4 viewProjection;varying vec4 vPosition;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#ifdef DIFFUSE
varying vec2 vUVDiffuse;uniform mat4 diffuseMatrix;
#endif
#ifdef OPACITY
varying vec2 vUVOpacity;uniform mat4 opacityMatrix;
#endif
#ifdef EMISSIVE
varying vec2 vUVEmissive;uniform mat4 emissiveMatrix;
#endif
#ifdef VERTEXALPHA
attribute vec4 color;varying vec4 vColor;
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#ifdef CUBEMAP
vPosition=worldPos;gl_Position=viewProjection*finalWorld*vec4(position,1.0);
#else
vPosition=viewProjection*worldPos;gl_Position=vPosition;
#endif
#ifdef DIFFUSE
#ifdef DIFFUSEUV1
vUVDiffuse=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef DIFFUSEUV2
vUVDiffuse=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#ifdef OPACITY
#ifdef OPACITYUV1
vUVOpacity=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef OPACITYUV2
vUVOpacity=vec2(opacityMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#ifdef EMISSIVE
#ifdef EMISSIVEUV1
vUVEmissive=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef EMISSIVEUV2
vUVEmissive=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#ifdef VERTEXALPHA
vColor=color;
#endif
#include<clipPlaneVertex>
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const glowMapGenerationVertexShader = { name, shader };
//# sourceMappingURL=glowMapGeneration.vertex.js.map

/***/ }),

/***/ 99858:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowMapMergePixelShader: () => (/* binding */ glowMapMergePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "glowMapMergePixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;
#ifdef EMISSIVE
uniform sampler2D textureSampler2;
#endif
uniform float offset;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 baseColor=texture2D(textureSampler,vUV);
#ifdef EMISSIVE
baseColor+=texture2D(textureSampler2,vUV);baseColor*=offset;
#else
baseColor.a=abs(offset-baseColor.a);
#ifdef STROKE
float alpha=smoothstep(.0,.1,baseColor.a);baseColor.a=alpha;baseColor.rgb=baseColor.rgb*alpha;
#endif
#endif
#if LDR
baseColor=clamp(baseColor,0.,1.0);
#endif
gl_FragColor=baseColor;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const glowMapMergePixelShader = { name, shader };
//# sourceMappingURL=glowMapMerge.fragment.js.map

/***/ }),

/***/ 41288:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   glowMapMergeVertexShader: () => (/* binding */ glowMapMergeVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "glowMapMergeVertexShader";
const shader = `attribute vec2 position;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const glowMapMergeVertexShader = { name, shader };
//# sourceMappingURL=glowMapMerge.vertex.js.map

/***/ }),

/***/ 50890:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   grainPixelShader: () => (/* binding */ grainPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
// Do not edit.


const name = "grainPixelShader";
const shader = `#include<helperFunctions>
uniform sampler2D textureSampler; 
uniform float intensity;uniform float animatedSeed;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{gl_FragColor=texture2D(textureSampler,vUV);vec2 seed=vUV*(animatedSeed);float grain=dither(seed,intensity);float lum=getLuminance(gl_FragColor.rgb);float grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;gl_FragColor.rgb+=grain*grainAmount;gl_FragColor.rgb=max(gl_FragColor.rgb,0.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const grainPixelShader = { name, shader };
//# sourceMappingURL=grain.fragment.js.map

/***/ }),

/***/ 55779:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   hdrFilteringPixelShader: () => (/* binding */ hdrFilteringPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
/* harmony import */ var _ShadersInclude_importanceSampling_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21469);
/* harmony import */ var _ShadersInclude_pbrBRDFFunctions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8709);
/* harmony import */ var _ShadersInclude_hdrFilteringFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78741);
// Do not edit.





const name = "hdrFilteringPixelShader";
const shader = `#include<helperFunctions>
#include<importanceSampling>
#include<pbrBRDFFunctions>
#include<hdrFilteringFunctions>
uniform float alphaG;uniform samplerCube inputTexture;uniform vec2 vFilteringInfo;uniform float hdrScale;varying vec3 direction;void main() {vec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);gl_FragColor=vec4(color*hdrScale,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const hdrFilteringPixelShader = { name, shader };
//# sourceMappingURL=hdrFiltering.fragment.js.map

/***/ }),

/***/ 86109:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   hdrFilteringVertexShader: () => (/* binding */ hdrFilteringVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "hdrFilteringVertexShader";
const shader = `attribute vec2 position;varying vec3 direction;uniform vec3 up;uniform vec3 right;uniform vec3 front;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
mat3 view=mat3(up,right,front);direction=view*vec3(position,1.0);gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const hdrFilteringVertexShader = { name, shader };
//# sourceMappingURL=hdrFiltering.vertex.js.map

/***/ }),

/***/ 96920:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   highlightsPixelShader: () => (/* binding */ highlightsPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "highlightsPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;const vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec4 tex=texture2D(textureSampler,vUV);vec3 c=tex.rgb;float luma=dot(c.rgb,RGBLuminanceCoefficients);gl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a); }`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const highlightsPixelShader = { name, shader };
//# sourceMappingURL=highlights.fragment.js.map

/***/ }),

/***/ 18162:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblCombineVoxelGridsPixelShader: () => (/* binding */ iblCombineVoxelGridsPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblCombineVoxelGridsPixelShader";
const shader = `precision highp float;precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelXaxisSampler;uniform sampler3D voxelYaxisSampler;uniform sampler3D voxelZaxisSampler;uniform float layer;void main(void) {vec3 coordZ=vec3(vUV.x,vUV.y,layer);float voxelZ=texture(voxelZaxisSampler,coordZ).r;vec3 coordX=vec3(1.0-layer,vUV.y,vUV.x);float voxelX=texture(voxelXaxisSampler,coordX).r;vec3 coordY=vec3(layer,vUV.x,vUV.y);float voxelY=texture(voxelYaxisSampler,coordY).r;float voxel=(voxelX>0.0 || voxelY>0.0 || voxelZ>0.0) ? 1.0 : 0.0;glFragColor=vec4(vec3(voxel),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblCombineVoxelGridsPixelShader = { name, shader };
//# sourceMappingURL=iblCombineVoxelGrids.fragment.js.map

/***/ }),

/***/ 46043:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblGenerateVoxelMipPixelShader: () => (/* binding */ iblGenerateVoxelMipPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblGenerateVoxelMipPixelShader";
const shader = `precision highp float;precision highp sampler3D;varying vec2 vUV;uniform sampler3D srcMip;uniform int layerNum;void main(void) {ivec3 Coords=ivec3(2)*ivec3(gl_FragCoord.x,gl_FragCoord.y,layerNum);uint tex =
uint(texelFetch(srcMip,Coords+ivec3(0,0,0),0).x>0.0f ? 1u : 0u)
<< 0u |
uint(texelFetch(srcMip,Coords+ivec3(1,0,0),0).x>0.0f ? 1u : 0u)
<< 1u |
uint(texelFetch(srcMip,Coords+ivec3(0,1,0),0).x>0.0f ? 1u : 0u)
<< 2u |
uint(texelFetch(srcMip,Coords+ivec3(1,1,0),0).x>0.0f ? 1u : 0u)
<< 3u |
uint(texelFetch(srcMip,Coords+ivec3(0,0,1),0).x>0.0f ? 1u : 0u)
<< 4u |
uint(texelFetch(srcMip,Coords+ivec3(1,0,1),0).x>0.0f ? 1u : 0u)
<< 5u |
uint(texelFetch(srcMip,Coords+ivec3(0,1,1),0).x>0.0f ? 1u : 0u)
<< 6u |
uint(texelFetch(srcMip,Coords+ivec3(1,1,1),0).x>0.0f ? 1u : 0u)
<< 7u;glFragColor.rgb=vec3(float(tex)/255.0f,0.0f,0.0f);glFragColor.a=1.0;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblGenerateVoxelMipPixelShader = { name, shader };
//# sourceMappingURL=iblGenerateVoxelMip.fragment.js.map

/***/ }),

/***/ 61089:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowAccumulationPixelShader: () => (/* binding */ iblShadowAccumulationPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowAccumulationPixelShader";
const shader = `#ifdef GL_ES
precision mediump float;
#endif
varying vec2 vUV;uniform vec4 accumulationParameters;
#define remanence accumulationParameters.x
#define resetb accumulationParameters.y
#define sceneSize accumulationParameters.z
uniform sampler2D motionSampler;uniform sampler2D positionSampler;uniform sampler2D spatialBlurSampler;uniform sampler2D oldAccumulationSampler;uniform sampler2D prevPositionSampler;vec2 max2(vec2 v,vec2 w) { return vec2(max(v.x,w.x),max(v.y,w.y)); }
void main(void) {bool reset=bool(resetb);vec2 gbufferRes=vec2(textureSize(motionSampler,0));ivec2 gbufferPixelCoord=ivec2(vUV*gbufferRes);vec2 shadowRes=vec2(textureSize(spatialBlurSampler,0));ivec2 shadowPixelCoord=ivec2(vUV*shadowRes);vec4 LP=texelFetch(positionSampler,gbufferPixelCoord,0);if (0.0==LP.w) {gl_FragColor=vec4(1.0,0.0,0.0,1.0);return;}
vec2 velocityColor=texelFetch(motionSampler,gbufferPixelCoord,0).xy;vec2 prevCoord=vUV+velocityColor;vec3 PrevLP=texture(prevPositionSampler,prevCoord).xyz;vec3 PrevShadows=texture(oldAccumulationSampler,prevCoord).xyz;vec2 newShadows=texelFetch(spatialBlurSampler,shadowPixelCoord,0).xy;PrevShadows.z =
!reset && all(lessThan(abs(prevCoord-vec2(0.5)),vec2(0.5))) &&
distance(LP.xyz,PrevLP)<5e-2*sceneSize
? max(PrevShadows.z/(1.0+PrevShadows.z),1.0-remanence)
: 1.0;PrevShadows=max(vec3(0.0),PrevShadows);gl_FragColor =
vec4(mix(PrevShadows.x,newShadows.x,PrevShadows.z),
mix(PrevShadows.y,newShadows.y,PrevShadows.z),PrevShadows.z,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowAccumulationPixelShader = { name, shader };
//# sourceMappingURL=iblShadowAccumulation.fragment.js.map

/***/ }),

/***/ 22495:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowDebugPixelShader: () => (/* binding */ iblShadowDebugPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowDebugPixelShader";
const shader = `#ifdef GL_ES
precision mediump float;
#endif
varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D debugSampler;uniform vec4 sizeParams;
#define offsetX sizeParams.x
#define offsetY sizeParams.y
#define widthScale sizeParams.z
#define heightScale sizeParams.w
void main(void) {vec2 uv =
vec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 background=texture2D(textureSampler,vUV);vec4 debugColour=texture2D(debugSampler,vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=background;} else {gl_FragColor.rgb=mix(debugColour.rgb,background.rgb,0.0);gl_FragColor.a=1.0;}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowDebugPixelShader = { name, shader };
//# sourceMappingURL=iblShadowDebug.fragment.js.map

/***/ }),

/***/ 95634:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowGBufferDebugPixelShader: () => (/* binding */ iblShadowGBufferDebugPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowGBufferDebugPixelShader";
const shader = `#ifdef GL_ES
precision mediump float;
#endif
varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D depthSampler;uniform sampler2D normalSampler;uniform sampler2D positionSampler;uniform sampler2D velocitySampler;uniform vec4 sizeParams;uniform float maxDepth;
#define offsetX sizeParams.x
#define offsetY sizeParams.y
#define widthScale sizeParams.z
#define heightScale sizeParams.w
void main(void) {vec2 uv =
vec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 backgroundColour=texture2D(textureSampler,vUV).rgba;vec4 depth=texture2D(depthSampler,vUV);vec4 worldNormal=texture2D(normalSampler,vUV);vec4 worldPosition=texture2D(positionSampler,vUV);vec4 velocityLinear=texture2D(velocitySampler,vUV);if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=backgroundColour;} else {gl_FragColor.a=1.0;if (uv.x<=0.25) {gl_FragColor.rgb=depth.rgb;gl_FragColor.a=1.0;} else if (uv.x<=0.5) {velocityLinear.rg=velocityLinear.rg*0.5+0.5;gl_FragColor.rgb=velocityLinear.rgb;} else if (uv.x<=0.75) {gl_FragColor.rgb=worldPosition.rgb;} else {gl_FragColor.rgb=worldNormal.rgb;}}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowGBufferDebugPixelShader = { name, shader };
//# sourceMappingURL=iblShadowGBufferDebug.fragment.js.map

/***/ }),

/***/ 8605:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowSpatialBlurPixelShader: () => (/* binding */ iblShadowSpatialBlurPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowSpatialBlurPixelShader";
const shader = `precision highp sampler2D;
#define PI 3.1415927
varying vec2 vUV;uniform sampler2D depthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D voxelTracingSampler;uniform vec4 blurParameters;
#define stridef blurParameters.x
#define worldScale blurParameters.y
const float weights[5]=float[5](0.0625,0.25,0.375,0.25,0.0625);const int nbWeights=5;vec2 max2(vec2 v,vec2 w) {return vec2(max(v.x,w.x),max(v.y,w.y));}
void main(void)
{vec2 gbufferRes=vec2(textureSize(depthSampler,0));ivec2 gbufferPixelCoord=ivec2(vUV*gbufferRes);vec2 shadowRes=vec2(textureSize(voxelTracingSampler,0));ivec2 shadowPixelCoord=ivec2(vUV*shadowRes);vec3 N=texelFetch(worldNormalSampler,gbufferPixelCoord,0).xyz;if (length(N)<0.01) {glFragColor=vec4(1.0,1.0,0.0,1.0);return;}
float depth=-texelFetch(depthSampler,gbufferPixelCoord,0).x;vec3 X=vec3(0.0);for(int y=0; y<nbWeights; ++y) {for(int x=0; x<nbWeights; ++x) {ivec2 gBufferCoords=gbufferPixelCoord+int(stridef)*ivec2(x-(nbWeights>>1),y-(nbWeights>>1));ivec2 shadowCoords=shadowPixelCoord+int(stridef)*ivec2(x-(nbWeights>>1),y-(nbWeights>>1));vec2 T=texelFetch(voxelTracingSampler,shadowCoords,0).xy;float ddepth=-texelFetch(depthSampler,gBufferCoords,0).x-depth;vec3 dN=texelFetch(worldNormalSampler,gBufferCoords,0).xyz-N;float w=weights[x]*weights[y] *
exp2(max(-1000.0/(worldScale*worldScale),-0.5) *
(ddepth*ddepth) -
1e1*dot(dN,dN));X+=vec3(w*T.x,w*T.y,w);}}
gl_FragColor=vec4(X.x/X.z,X.y/X.z,1.0,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowSpatialBlurPixelShader = { name, shader };
//# sourceMappingURL=iblShadowSpatialBlur.fragment.js.map

/***/ }),

/***/ 16990:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowVoxelTracingPixelShader: () => (/* binding */ iblShadowVoxelTracingPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowVoxelTracingPixelShader";
const shader = `precision highp sampler2D;precision highp sampler3D;
#define PI 3.1415927
varying vec2 vUV;
#define DISABLE_UNIFORMITY_ANALYSIS
uniform sampler2D depthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D blueNoiseSampler;uniform sampler2D icdfxSampler;uniform sampler2D icdfySampler;uniform sampler3D voxelGridSampler;uniform vec4 shadowParameters;
#define SHADOWdirs shadowParameters.x
#define SHADOWframe shadowParameters.y
#define SHADOWenvRot shadowParameters.w
uniform vec4 voxelBiasParameters;
#define highestMipLevel voxelBiasParameters.z
uniform vec4 sssParameters;
#define SSSsamples sssParameters.x
#define SSSstride sssParameters.y
#define SSSmaxDistance sssParameters.z
#define SSSthickness sssParameters.w
uniform vec4 shadowOpacity;uniform mat4 projMtx;uniform mat4 viewMtx;uniform mat4 invProjMtx;uniform mat4 invViewMtx;uniform mat4 wsNormalizationMtx;uniform mat4 invVPMtx;
#define PI 3.1415927
#define GOLD 0.618034
struct AABB3f {vec3 m_min;vec3 m_max;};struct Ray {vec3 orig;vec3 dir;vec3 dir_rcp;float t_min;float t_max;};Ray make_ray(const vec3 origin,const vec3 direction,const float tmin,
const float tmax) {Ray ray;ray.orig=origin;ray.dir=direction;ray.dir_rcp=1.0f/direction;ray.t_min=tmin;ray.t_max=tmax;return ray;}
bool ray_box_intersection(const in AABB3f aabb,const in Ray ray,
out float distance_near,out float distance_far) {vec3 tbot=ray.dir_rcp*(aabb.m_min-ray.orig);vec3 ttop=ray.dir_rcp*(aabb.m_max-ray.orig);vec3 tmin=min(ttop,tbot);vec3 tmax=max(ttop,tbot);distance_near=max(ray.t_min,max(tmin.x,max(tmin.y,tmin.z)));distance_far=min(ray.t_max,min(tmax.x,min(tmax.y,tmax.z)));return distance_near<=distance_far;}
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
struct VoxelMarchDiagnosticInfo {float heat;ivec3 voxel_intersect_coords;};
#endif
uint hash(uint i) {i ^= i>>16u;i*=0x7FEB352Du;i ^= i>>15u;i*=0x846CA68Bu;i ^= i>>16u;return i;}
float uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}
vec3 uv_to_normal(vec2 uv) {vec3 N;vec2 uvRange=uv;float theta=uvRange.x*2.0*PI;float phi=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;}
vec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u),
uint2float(rstate*2447445414u));}
float goldenSequence(const uint rstate) {return uint2float(rstate*2654435769u);}
float distanceSquared(vec2 a,vec2 b) {vec2 diff=a-b;return dot(diff,diff);}
void genTB(const vec3 N,out vec3 T,out vec3 B) {float s=N.z<0.0 ? -1.0 : 1.0;float a=-1.0/(s+N.z);float b=N.x*N.y*a;T=vec3(1.0+s*N.x*N.x*a,s*b,-s*N.x);B=vec3(b,s+N.y*N.y*a,-N.y);}
int stack[24]; 
#define PUSH(i) stack[stackLevel++]=i; 
#define POP() stack[--stackLevel] 
#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
bool anyHitVoxels(const Ray ray_vs,
out VoxelMarchDiagnosticInfo voxel_march_diagnostic_info) {
#else
bool anyHitVoxels(const Ray ray_vs) {
#endif
vec3 invD=ray_vs.dir_rcp;vec3 D=ray_vs.dir;vec3 O=ray_vs.orig;ivec3 negD=ivec3(lessThan(D,vec3(0,0,0)));int voxel0=negD.x | negD.y<<1 | negD.z<<2;vec3 t0=-O*invD,t1=(vec3(1.0)-O)*invD;int maxLod=int(highestMipLevel);int stackLevel=0;
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
uint steps=0u;
#endif
PUSH(maxLod<<24);while (stackLevel>0) {int elem=POP();ivec4 Coords =
ivec4(elem & 0xFF,elem>>8 & 0xFF,elem>>16 & 0xFF,elem>>24);if (Coords.w==0) {
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
voxel_march_diagnostic_info.heat=float(steps)/24.0;
#endif
return true;}
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
++steps;
#endif
float invRes=exp2(float(Coords.w-maxLod));vec3 bbmin=invRes*vec3(Coords.xyz+negD);vec3 bbmax=invRes*vec3(Coords.xyz-negD+ivec3(1));vec3 mint=mix(t0,t1,bbmin);vec3 maxt=mix(t0,t1,bbmax);vec3 midt=0.5*(mint+maxt);mint.x=max(0.0,mint.x);midt.x=max(0.0,midt.x);int nodeMask=int(
round(texelFetch(voxelGridSampler,Coords.xyz,Coords.w).x*255.0));Coords.w--;int voxelBit=voxel0;Coords.xyz=(Coords.xyz<<1)+negD;int packedCoords =
Coords.x | Coords.y<<8 | Coords.z<<16 | Coords.w<<24;if (max(mint.x,max(mint.y,mint.z))<min(midt.x,min(midt.y,midt.z)) &&
(1<<voxelBit & nodeMask) != 0)
PUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(mint.y,mint.z))<min(maxt.x,min(midt.y,midt.z)) &&
(1<<voxelBit & nodeMask) != 0)
PUSH(packedCoords);voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(midt.y,mint.z))<min(maxt.x,min(maxt.y,midt.z)) &&
(1<<voxelBit & nodeMask) != 0)
PUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(midt.y,mint.z))<min(midt.x,min(maxt.y,midt.z)) &&
(1<<voxelBit & nodeMask) != 0)
PUSH(packedCoords);voxelBit ^= 0x4;packedCoords ^= 0x10000;if (max(mint.x,max(midt.y,midt.z))<min(midt.x,min(maxt.y,maxt.z)) &&
(1<<voxelBit & nodeMask) != 0)
PUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(midt.y,midt.z))<min(maxt.x,min(maxt.y,maxt.z)) &&
(1<<voxelBit & nodeMask) != 0)
PUSH(packedCoords);voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(mint.y,midt.z))<min(maxt.x,min(midt.y,maxt.z)) &&
(1<<voxelBit & nodeMask) != 0)
PUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(mint.y,midt.z))<min(midt.x,min(midt.y,maxt.z)) &&
(1<<voxelBit & nodeMask) != 0)
PUSH(packedCoords);}
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
voxel_march_diagnostic_info.heat=float(steps)/24.0;
#endif
return false;}
float linearizeDepth(float depth,float near,float far) {return (near*far)/(far-depth*(far-near));}
float screenSpaceShadow(vec3 csOrigin,vec3 csDirection,vec2 csZBufferSize,
float nearPlaneZ,float farPlaneZ,float noise) {
#ifdef RIGHT_HANDED
float csZDir=-1.0;
#else 
float csZDir=1.0;
#endif
float ssSamples=SSSsamples;float ssMaxDist=SSSmaxDistance;float ssStride=SSSstride;float ssThickness=SSSthickness;float rayLength =
csZDir*(csOrigin.z+ssMaxDist*csDirection.z)<csZDir*nearPlaneZ
? 
(nearPlaneZ-csOrigin.z)/csDirection.z
: ssMaxDist;vec3 csEndPoint=csOrigin+rayLength*csDirection;vec4 H0=projMtx*vec4(csOrigin,1.0);vec4 H1=projMtx*vec4(csEndPoint,1.0);vec2 Z0=vec2(csOrigin.z ,1.0)/H0.w;vec2 Z1=vec2(csEndPoint.z,1.0)/H1.w;vec2 P0=csZBufferSize*(0.5*H0.xy*Z0.y+0.5);vec2 P1=csZBufferSize*(0.5*H1.xy*Z1.y+0.5);P1+=vec2(distanceSquared(P0,P1)<0.0001 ? 0.01 : 0.0);vec2 delta=P1-P0;bool permute=false;if (abs(delta.x)<abs(delta.y)) {permute=true;P0=P0.yx;P1=P1.yx;delta=delta.yx;}
float stepDirection=sign(delta.x);float invdx=stepDirection/delta.x;vec2 dP=ssStride*vec2(stepDirection,invdx*delta.y);vec2 dZ=ssStride*invdx*(Z1-Z0);float opacity=0.0;vec2 P=P0+noise*dP;vec2 Z=Z0+noise*dZ;float end=P1.x*stepDirection;float rayZMax=csZDir*Z.x/Z.y;float sceneDepth=rayZMax;Z+=dZ;for (float stepCount=0.0;opacity<1.0 && P.x*stepDirection<end && sceneDepth>0.0 && stepCount<ssSamples;stepCount++,P+=dP,
Z+=dZ) { 
ivec2 coords=ivec2(permute ? P.yx : P);sceneDepth=texelFetch(depthSampler,coords,0).x;sceneDepth=linearizeDepth(sceneDepth,nearPlaneZ,farPlaneZ);sceneDepth=csZDir*sceneDepth;if (sceneDepth<=0.0) {break;}
float rayZMin=rayZMax;rayZMax=csZDir*Z.x/Z.y;opacity+=max(opacity,step(rayZMax,sceneDepth+ssThickness)*step(sceneDepth,rayZMin));}
return opacity;}
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
float voxelShadow(vec3 wsOrigin,vec3 wsDirection,vec3 wsNormal,
vec2 DitherNoise,
out VoxelMarchDiagnosticInfo voxel_march_diagnostic_info) {
#else
float voxelShadow(vec3 wsOrigin,vec3 wsDirection,vec3 wsNormal,
vec2 DitherNoise) {
#endif
float vxResolution=float(textureSize(voxelGridSampler,0).x);vec3 T,B;genTB(wsDirection,T,B);vec2 DitherXY=sqrt(DitherNoise.x)*vec2(cos(2.0*PI*DitherNoise.y),
sin(2.0*PI*DitherNoise.y));float sceneScale=wsNormalizationMtx[0][0];vec3 Dithering =
(voxelBiasParameters.x*wsNormal+voxelBiasParameters.y*wsDirection +
DitherXY.x*T+DitherXY.y*B) /
vxResolution;vec3 O=0.5*wsOrigin+0.5+Dithering;Ray ray_vs=make_ray(O,wsDirection,0.0,10.0);AABB3f voxel_aabb;voxel_aabb.m_min=vec3(0);voxel_aabb.m_max=vec3(1);float near,far;if (!ray_box_intersection(voxel_aabb,ray_vs,near,far))
return 0.0;ray_vs.t_min=max(ray_vs.t_min,near);ray_vs.t_max=min(ray_vs.t_max,far);
#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
return anyHitVoxels(ray_vs,voxel_march_diagnostic_info) ? 1.0f : 0.0f;
#else
return anyHitVoxels(ray_vs) ? 1.0f : 0.0f;
#endif
}
void main(void) {uint nbDirs=uint(SHADOWdirs);uint frameId=uint(SHADOWframe);float envRot=SHADOWenvRot;vec2 Resolution=vec2(textureSize(depthSampler,0));ivec2 currentPixel=ivec2(vUV*Resolution);uint GlobalIndex=(frameId*uint(Resolution.y)+uint(currentPixel.y)) *
uint(Resolution.x) +
uint(currentPixel.x);vec3 N=texelFetch(worldNormalSampler,currentPixel,0).xyz;if (length(N)<0.01) {glFragColor=vec4(1.0,1.0,0.0,1.0);return;}
float normalizedRotation=envRot/(2.0*PI);float depth=texelFetch(depthSampler,currentPixel,0).x;
#ifndef IS_NDC_HALF_ZRANGE
depth=depth*2.0-1.0;
#endif
vec2 temp=(vec2(currentPixel)+vec2(0.5))*2.0/Resolution-vec2(1.0);vec4 VP=invProjMtx*vec4(temp.x,-temp.y,depth,1.0);VP/=VP.w;N=normalize(N);vec3 noise=texelFetch(blueNoiseSampler,currentPixel & 0xFF,0).xyz;noise.z=fract(noise.z+goldenSequence(frameId*nbDirs));
#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
float heat=0.0f;
#endif
float shadowAccum=0.0;float specShadowAccum=0.0;float sampleWeight=0.0;for (uint i=0u; i<nbDirs; i++) {uint dirId=nbDirs*GlobalIndex+i;vec4 L;{vec2 r=plasticSequence(frameId*nbDirs+i);r=fract(r+vec2(2.0)*abs(noise.xy-vec2(0.5)));vec2 T;T.x=textureLod(icdfxSampler,vec2(r.x,0.0),0.0).x;T.y=textureLod(icdfySampler,vec2(T.x,r.y),0.0).x;T.x-=normalizedRotation;L=vec4(uv_to_normal(T),0);
#ifndef RIGHT_HANDED
L.z*=-1.0;
#endif
}
float edge_tint_const=-0.001;float cosNL=dot(N,L.xyz);float opacity=cosNL<edge_tint_const ? 1.0 : 0.0;if (cosNL>edge_tint_const) {vec4 VP2=VP;VP2.y*=-1.0;vec4 unormWP=invViewMtx*VP2;vec3 WP=(wsNormalizationMtx*unormWP).xyz;vec2 vxNoise =
vec2(uint2float(hash(dirId*2u)),uint2float(hash(dirId*2u+1u)));
#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
VoxelMarchDiagnosticInfo voxel_march_diagnostic_info;opacity=max(opacity,
shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise,
voxel_march_diagnostic_info));heat+=voxel_march_diagnostic_info.heat;
#else
opacity =
max(opacity,shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise));
#endif
vec3 VL=(viewMtx*L).xyz;
#ifdef RIGHT_HANDED
float nearPlaneZ=-projMtx[3][2]/(projMtx[2][2]-1.0); 
float farPlaneZ=-projMtx[3][2]/(projMtx[2][2]+1.0);
#else
float nearPlaneZ=-projMtx[3][2]/(projMtx[2][2]+1.0); 
float farPlaneZ=-projMtx[3][2]/(projMtx[2][2]-1.0);
#endif
float ssShadow=shadowOpacity.y *
screenSpaceShadow(VP2.xyz,VL,Resolution,nearPlaneZ,farPlaneZ,
abs(2.0*noise.z-1.0));opacity=max(opacity,ssShadow);shadowAccum+=min(1.0-opacity,cosNL);sampleWeight+=cosNL;vec3 VR=-(viewMtx*vec4(reflect(-L.xyz,N),0.0)).xyz;specShadowAccum+=max(1.0-(opacity*pow(VR.z,8.0)),0.0);}
noise.z=fract(noise.z+GOLD);}
#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
gl_FragColor=vec4(shadowAccum/float(sampleWeight),
specShadowAccum/float(sampleWeight),heat/float(sampleWeight),1.0);
#else
gl_FragColor=vec4(shadowAccum/float(sampleWeight),specShadowAccum/float(sampleWeight),0.0,1.0);
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowVoxelTracingPixelShader = { name, shader };
//# sourceMappingURL=iblShadowVoxelTracing.fragment.js.map

/***/ }),

/***/ 62386:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsCdfxPixelShader: () => (/* binding */ iblShadowsCdfxPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsCdfxPixelShader";
const shader = `precision highp sampler2D;
#define PI 3.1415927
varying vec2 vUV;uniform sampler2D cdfy;void main(void) {ivec2 cdfyRes=textureSize(cdfy,0);ivec2 currentPixel=ivec2(gl_FragCoord.xy);float cdfx=0.0;for (int x=1; x<=currentPixel.x; x++) {cdfx+=texelFetch(cdfy,ivec2(x-1,cdfyRes.y-1),0).x;}
gl_FragColor=vec4(vec3(cdfx),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowsCdfxPixelShader = { name, shader };
//# sourceMappingURL=iblShadowsCdfx.fragment.js.map

/***/ }),

/***/ 28043:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsCdfyPixelShader: () => (/* binding */ iblShadowsCdfyPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsCdfyPixelShader";
const shader = `precision highp sampler2D;precision highp samplerCube;
#define PI 3.1415927
varying vec2 vUV;
#ifdef IBL_USE_CUBE_MAP
uniform samplerCube iblSource;
#else
uniform sampler2D iblSource;
#endif
uniform int iblHeight;
#ifdef IBL_USE_CUBE_MAP
vec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*2.0*PI-PI;float latitude=PI*0.5-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
float fetchCube(vec2 uv) {vec3 direction=equirectangularToCubemapDirection(uv);return sin(PI*uv.y)*dot(textureCubeLodEXT(iblSource,direction,0.0).rgb,
vec3(0.3,0.6,0.1));}
#else
float fetchPanoramic(ivec2 Coords,float envmapHeight) {return sin(PI*(float(Coords.y)+0.5)/envmapHeight) *
dot(texelFetch(iblSource,Coords,0).rgb,vec3(0.3,0.6,0.1));}
#endif
void main(void) {ivec2 coords=ivec2(gl_FragCoord.x,gl_FragCoord.y);float cdfy=0.0;for (int y=1; y<=coords.y; y++) {
#ifdef IBL_USE_CUBE_MAP
vec2 uv=vec2(vUV.x,(float(y-1)+0.5)/float(iblHeight));cdfy+=fetchCube(uv);
#else
cdfy+=fetchPanoramic(ivec2(coords.x,y-1),float(iblHeight));
#endif
}
gl_FragColor=vec4(cdfy,0.0,0.0,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowsCdfyPixelShader = { name, shader };
//# sourceMappingURL=iblShadowsCdfy.fragment.js.map

/***/ }),

/***/ 61391:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsIcdfxPixelShader: () => (/* binding */ iblShadowsIcdfxPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsIcdfxPixelShader";
const shader = `precision highp sampler2D;
#define PI 3.1415927
varying vec2 vUV;uniform sampler2D cdfx;float fetchCDF(int x) {return texelFetch(cdfx,ivec2(x,0),0).x;}
float bisect(int size,float targetValue)
{int a=0,b=size-1;while (b-a>1) {int c=a+b>>1;if (fetchCDF(c)<targetValue)
a=c;else
b=c;}
return mix(float(a),float(b),(targetValue-fetchCDF(a))/(fetchCDF(b)-fetchCDF(a)))/float(size-1);}
void main(void) {ivec2 cdfSize=textureSize(cdfx,0);int cdfWidth=cdfSize.x;int icdfWidth=cdfWidth-1;ivec2 currentPixel=ivec2(gl_FragCoord.xy);if (currentPixel.x==0)
{gl_FragColor=vec4(0.0);}
else if (currentPixel.x==icdfWidth-1) {gl_FragColor=vec4(1.0);} else {float targetValue=fetchCDF(cdfWidth-1)*vUV.x;gl_FragColor=vec4(vec3(bisect(cdfWidth,targetValue)),1.0);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowsIcdfxPixelShader = { name, shader };
//# sourceMappingURL=iblShadowsIcdfx.fragment.js.map

/***/ }),

/***/ 77142:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsIcdfyPixelShader: () => (/* binding */ iblShadowsIcdfyPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsIcdfyPixelShader";
const shader = `precision highp sampler2D;
#define PI 3.1415927
varying vec2 vUV;uniform sampler2D cdfy;float fetchCDF(int y,int invocationId) {return texelFetch(cdfy,ivec2(invocationId,y),0).x;}
float bisect(int size,float targetValue,int invocationId)
{int a=0,b=size-1;while (b-a>1) {int c=a+b>>1;if (fetchCDF(c,invocationId)<targetValue)
a=c;else
b=c;}
return mix(float(a),float(b),(targetValue-fetchCDF(a,invocationId))/(fetchCDF(b,invocationId)-fetchCDF(a,invocationId)))/float(size-1);}
void main(void) {ivec2 cdfSize=textureSize(cdfy,0);int cdfHeight=cdfSize.y;ivec2 currentPixel=ivec2(gl_FragCoord.xy);if (currentPixel.y==0)
{gl_FragColor=vec4(0.0);}
else if (currentPixel.y==cdfHeight-2) {gl_FragColor=vec4(1.0);} else {float targetValue=fetchCDF(cdfHeight-1,currentPixel.x)*vUV.y;gl_FragColor=vec4(vec3(bisect(cdfHeight,targetValue,currentPixel.x)),1.0);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowsIcdfyPixelShader = { name, shader };
//# sourceMappingURL=iblShadowsIcdfy.fragment.js.map

/***/ }),

/***/ 16339:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblShadowsImportanceSamplingDebugPixelShader: () => (/* binding */ iblShadowsImportanceSamplingDebugPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblShadowsImportanceSamplingDebugPixelShader";
const shader = `precision highp samplerCube;
#define PI 3.1415927
varying vec2 vUV;uniform sampler2D cdfy;uniform sampler2D icdfy;uniform sampler2D cdfx;uniform sampler2D icdfx;
#ifdef IBL_USE_CUBE_MAP
uniform samplerCube iblSource;
#else
uniform sampler2D iblSource;
#endif
uniform sampler2D textureSampler;
#define cdfyVSize 0.4
#define cdfxVSize 0.1
#define cdfyHSize 0.5
uniform vec4 sizeParams;
#define offsetX sizeParams.x
#define offsetY sizeParams.y
#define widthScale sizeParams.z
#define heightScale sizeParams.w
#ifdef IBL_USE_CUBE_MAP
vec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*2.0*PI-PI;float latitude=PI*0.5-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
#endif
void main(void) {vec3 colour=vec3(0.0);vec2 uv =
vec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec3 backgroundColour=texture2D(textureSampler,vUV).rgb;const float iblStart=1.0-cdfyVSize;const float cdfyStart=1.0-2.0*cdfyVSize;const float cdfxStart=1.0-2.0*cdfyVSize-cdfxVSize;const float icdfxStart=1.0-2.0*cdfyVSize-2.0*cdfxVSize;
#ifdef IBL_USE_CUBE_MAP
vec3 direction=equirectangularToCubemapDirection(
(uv-vec2(0.0,iblStart))*vec2(1.0,1.0/cdfyVSize));vec3 iblColour=textureCubeLodEXT(iblSource,direction,0.0).rgb;
#else
vec3 iblColour=texture2D(iblSource,(uv-vec2(0.0,iblStart)) *
vec2(1.0,1.0/cdfyVSize))
.rgb;
#endif
float cdfyColour =
texture2D(cdfy,(uv-vec2(0.0,cdfyStart))*vec2(2.0,1.0/cdfyVSize))
.r;float icdfyColour =
texture2D(icdfy,(uv-vec2(0.5,cdfyStart))*vec2(2.0,1.0/cdfyVSize))
.r;float cdfxColour =
texture2D(cdfx,(uv-vec2(0.0,cdfxStart))*vec2(1.0,1.0/cdfxVSize))
.r;float icdfxColour=texture2D(icdfx,(uv-vec2(0.0,icdfxStart)) *
vec2(1.0,1.0/cdfxVSize))
.r;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {colour=backgroundColour;} else if (uv.y>iblStart) {colour+=iblColour;} else if (uv.y>cdfyStart && uv.x<0.5) {colour.r+=0.003*cdfyColour;} else if (uv.y>cdfyStart && uv.x>0.5) {colour.r+=icdfyColour;} else if (uv.y>cdfxStart) {colour.r+=0.00003*cdfxColour;} else if (uv.y>icdfxStart) {colour.r+=icdfxColour;}
gl_FragColor=vec4(colour,1.0);glFragColor.rgb=mix(gl_FragColor.rgb,backgroundColour,0.5);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblShadowsImportanceSamplingDebugPixelShader = { name, shader };
//# sourceMappingURL=iblShadowsImportanceSamplingDebug.fragment.js.map

/***/ }),

/***/ 3414:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelGridPixelShader: () => (/* binding */ iblVoxelGridPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelGridPixelShader";
const shader = `precision highp float;layout(location=0) out highp float glFragData[MAX_DRAW_BUFFERS];varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;if (normPos.z<nearPlane || normPos.z>farPlane) {discard;}
glFragData[0]=normPos.z<nearPlane+stepSize ? 1.0 : 0.0;glFragData[1]=normPos.z>=nearPlane+stepSize && normPos.z<nearPlane+2.0*stepSize ? 1.0 : 0.0;glFragData[2]=normPos.z>=nearPlane+2.0*stepSize && normPos.z<nearPlane+3.0*stepSize ? 1.0 : 0.0;glFragData[3]=normPos.z>=nearPlane+3.0*stepSize && normPos.z<nearPlane+4.0*stepSize ? 1.0 : 0.0;
#if MAX_DRAW_BUFFERS>4
glFragData[4]=normPos.z>=nearPlane+4.0*stepSize && normPos.z<nearPlane+5.0*stepSize ? 1.0 : 0.0;glFragData[5]=normPos.z>=nearPlane+5.0*stepSize && normPos.z<nearPlane+6.0*stepSize ? 1.0 : 0.0;glFragData[6]=normPos.z>=nearPlane+6.0*stepSize && normPos.z<nearPlane+7.0*stepSize ? 1.0 : 0.0;glFragData[7]=normPos.z>=nearPlane+7.0*stepSize && normPos.z<nearPlane+8.0*stepSize ? 1.0 : 0.0;
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblVoxelGridPixelShader = { name, shader };
//# sourceMappingURL=iblVoxelGrid.fragment.js.map

/***/ }),

/***/ 8444:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelGridVertexShader: () => (/* binding */ iblVoxelGridVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelGridVertexShader";
const shader = `attribute vec3 position;attribute vec3 normal;varying vec3 vNormalizedPosition;uniform mat4 world;uniform mat4 invWorldScale;uniform mat4 viewMatrix;void main(void) {gl_Position=viewMatrix*invWorldScale*world*vec4(position,1.);vNormalizedPosition.xyz=gl_Position.xyz*0.5+0.5;
#ifdef IS_NDC_HALF_ZRANGE
gl_Position.z=gl_Position.z*0.5+0.5;
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblVoxelGridVertexShader = { name, shader };
//# sourceMappingURL=iblVoxelGrid.vertex.js.map

/***/ }),

/***/ 88188:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelGrid2dArrayDebugPixelShader: () => (/* binding */ iblVoxelGrid2dArrayDebugPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelGrid2dArrayDebugPixelShader";
const shader = `precision highp sampler2DArray;varying vec2 vUV;uniform sampler2DArray voxelTexture;uniform sampler2D textureSampler;uniform int slice;void main(void) {ivec3 size=textureSize(voxelTexture,0);float dimension=sqrt(float(size.z));vec2 samplePos=fract(vUV.xy*vec2(dimension));int sampleIndex=int(floor(vUV.x*float(dimension))+floor(vUV.y*float(dimension))*dimension);glFragColor.rgb=texture(voxelTexture,vec3(samplePos.xy,sampleIndex)).rrr;glFragColor.a=1.0;glFragColor.rgb+=texture(textureSampler,vUV.xy).rgb;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblVoxelGrid2dArrayDebugPixelShader = { name, shader };
//# sourceMappingURL=iblVoxelGrid2dArrayDebug.fragment.js.map

/***/ }),

/***/ 96214:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelGrid3dDebugPixelShader: () => (/* binding */ iblVoxelGrid3dDebugPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelGrid3dDebugPixelShader";
const shader = `precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelTexture;uniform sampler2D voxelSlabTexture;uniform sampler2D textureSampler;uniform vec4 sizeParams;
#define offsetX sizeParams.x
#define offsetY sizeParams.y
#define widthScale sizeParams.z
#define heightScale sizeParams.w
uniform float mipNumber;void main(void) {vec2 uv =
vec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 background=texture2D(textureSampler,vUV);vec4 voxelSlab=texture2D(voxelSlabTexture,vUV);ivec3 size=textureSize(voxelTexture,int(mipNumber));float dimension=ceil(sqrt(float(size.z)));vec2 samplePos=fract(uv.xy*vec2(dimension));int sampleIndex=int(floor(uv.x*float(dimension)) +
floor(uv.y*float(dimension))*dimension);float mip_separator=0.0;if (samplePos.x<0.01 || samplePos.y<0.01) {mip_separator=1.0;}
bool outBounds=sampleIndex>size.z-1 ? true : false;sampleIndex=clamp(sampleIndex,0,size.z-1);ivec2 samplePosInt=ivec2(samplePos.xy*vec2(size.xy));vec3 voxel=texelFetch(voxelTexture,
ivec3(samplePosInt.x,samplePosInt.y,sampleIndex),
int(mipNumber))
.rgb;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=background;} else {if (outBounds) {voxel=vec3(0.15,0.0,0.0);} else {if (voxel.r>0.001) {voxel.g=1.0;}
voxel.r+=mip_separator;}
glFragColor.rgb=mix(background.rgb,voxelSlab.rgb,voxelSlab.a)+voxel;glFragColor.a=1.0;}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblVoxelGrid3dDebugPixelShader = { name, shader };
//# sourceMappingURL=iblVoxelGrid3dDebug.fragment.js.map

/***/ }),

/***/ 85257:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelSlabDebugPixelShader: () => (/* binding */ iblVoxelSlabDebugPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelSlabDebugPixelShader";
const shader = `precision highp float;varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;float chunkSize=stepSize*float(MAX_DRAW_BUFFERS);float numChunks=1.0/chunkSize;float positionInChunk=fract(normPos.z/chunkSize);float slab=floor(positionInChunk*float(MAX_DRAW_BUFFERS)) /
float(MAX_DRAW_BUFFERS);if (normPos.x<0.0 || normPos.y<0.0 || normPos.z<0.0 ||
normPos.x>1.0 || normPos.y>1.0 || normPos.z>1.0) {gl_FragColor=vec4(0.0,0.0,0.0,0.0);} else {gl_FragColor=vec4(slab,0.0,0.0,0.75);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblVoxelSlabDebugPixelShader = { name, shader };
//# sourceMappingURL=iblVoxelSlabDebug.fragment.js.map

/***/ }),

/***/ 71587:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   iblVoxelSlabDebugVertexShader: () => (/* binding */ iblVoxelSlabDebugVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "iblVoxelSlabDebugVertexShader";
const shader = `attribute vec3 position;varying vec3 vNormalizedPosition;uniform mat4 world;uniform mat4 invWorldScale;uniform mat4 cameraViewMatrix;uniform mat4 projection;uniform mat4 viewMatrix;void main(void) {vec4 worldPosition=(world*vec4(position,1.));gl_Position=projection*cameraViewMatrix*worldPosition;vNormalizedPosition=(viewMatrix*invWorldScale*worldPosition).rgb;vNormalizedPosition.xyz=vNormalizedPosition.xyz*vec3(0.5)+vec3(0.5);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const iblVoxelSlabDebugVertexShader = { name, shader };
//# sourceMappingURL=iblVoxelSlabDebug.vertex.js.map

/***/ }),

/***/ 83153:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   imageProcessingPixelShader: () => (/* binding */ imageProcessingPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_imageProcessingDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(89392);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73325);
/* harmony import */ var _ShadersInclude_imageProcessingFunctions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(64017);
// Do not edit.




const name = "imageProcessingPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;
#include<imageProcessingDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 result=texture2D(textureSampler,vUV);
#ifdef IMAGEPROCESSING
#ifndef FROMLINEARSPACE
result.rgb=toLinearSpace(result.rgb);
#endif
result=applyImageProcessing(result);
#else
#ifdef FROMLINEARSPACE
result=applyImageProcessing(result);
#endif
#endif
gl_FragColor=result;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const imageProcessingPixelShader = { name, shader };
//# sourceMappingURL=imageProcessing.fragment.js.map

/***/ }),

/***/ 54509:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  kernelBlurPixelShader: () => (/* binding */ kernelBlurPixelShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurVaryingDeclaration.js
var kernelBlurVaryingDeclaration = __webpack_require__(17382);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/packingFunctions.js
var packingFunctions = __webpack_require__(8334);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurFragment.js
// Do not edit.

const kernelBlurFragment_name = "kernelBlurFragment";
const shader = `#ifdef DOF
factor=sampleCoC(sampleCoord{X}); 
computedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
#else
computedWeight=KERNEL_WEIGHT{X};
#endif
#ifdef PACKEDFLOAT
blend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;
#else
blend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[kernelBlurFragment_name] = shader;
/** @internal */
const kernelBlurFragment = { name: kernelBlurFragment_name, shader };
//# sourceMappingURL=kernelBlurFragment.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurFragment2.js
// Do not edit.

const kernelBlurFragment2_name = "kernelBlurFragment2";
const kernelBlurFragment2_shader = `#ifdef DOF
factor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight;
#else
computedWeight=KERNEL_DEP_WEIGHT{X};
#endif
#ifdef PACKEDFLOAT
blend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;
#else
blend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[kernelBlurFragment2_name] = kernelBlurFragment2_shader;
/** @internal */
const kernelBlurFragment2 = { name: kernelBlurFragment2_name, shader: kernelBlurFragment2_shader };
//# sourceMappingURL=kernelBlurFragment2.js.map
;// ./node_modules/@babylonjs/core/Shaders/kernelBlur.fragment.js
// Do not edit.





const kernelBlur_fragment_name = "kernelBlurPixelShader";
const kernelBlur_fragment_shader = `uniform sampler2D textureSampler;uniform vec2 delta;varying vec2 sampleCenter;
#ifdef DOF
uniform sampler2D circleOfConfusionSampler;float sampleCoC(in vec2 offset) {float coc=texture2D(circleOfConfusionSampler,offset).r;return coc; }
#endif
#include<kernelBlurVaryingDeclaration>[0..varyingCount]
#ifdef PACKEDFLOAT
#include<packingFunctions>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float computedWeight=0.0;
#ifdef PACKEDFLOAT
float blend=0.;
#else
vec4 blend=vec4(0.);
#endif
#ifdef DOF
float sumOfWeights=CENTER_WEIGHT; 
float factor=0.0;
#ifdef PACKEDFLOAT
blend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;
#else
blend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;
#endif
#endif
#include<kernelBlurFragment>[0..varyingCount]
#include<kernelBlurFragment2>[0..depCount]
#ifdef PACKEDFLOAT
gl_FragColor=pack(blend);
#else
gl_FragColor=blend;
#endif
#ifdef DOF
gl_FragColor/=sumOfWeights;
#endif
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[kernelBlur_fragment_name] = kernelBlur_fragment_shader;
/** @internal */
const kernelBlurPixelShader = { name: kernelBlur_fragment_name, shader: kernelBlur_fragment_shader };
//# sourceMappingURL=kernelBlur.fragment.js.map

/***/ }),

/***/ 83802:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  kernelBlurVertexShader: () => (/* binding */ kernelBlurVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurVaryingDeclaration.js
var kernelBlurVaryingDeclaration = __webpack_require__(17382);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurVertex.js
// Do not edit.

const kernelBlurVertex_name = "kernelBlurVertex";
const shader = `sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[kernelBlurVertex_name] = shader;
/** @internal */
const kernelBlurVertex = { name: kernelBlurVertex_name, shader };
//# sourceMappingURL=kernelBlurVertex.js.map
;// ./node_modules/@babylonjs/core/Shaders/kernelBlur.vertex.js
// Do not edit.



const kernelBlur_vertex_name = "kernelBlurVertexShader";
const kernelBlur_vertex_shader = `attribute vec2 position;uniform vec2 delta;varying vec2 sampleCenter;
#include<kernelBlurVaryingDeclaration>[0..varyingCount]
const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
sampleCenter=(position*madd+madd);
#include<kernelBlurVertex>[0..varyingCount]
gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[kernelBlur_vertex_name] = kernelBlur_vertex_shader;
/** @internal */
const kernelBlurVertexShader = { name: kernelBlur_vertex_name, shader: kernelBlur_vertex_shader };
//# sourceMappingURL=kernelBlur.vertex.js.map

/***/ }),

/***/ 35256:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   layerPixelShader: () => (/* binding */ layerPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
// Do not edit.


const name = "layerPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 baseColor=texture2D(textureSampler,vUV);
#if defined(CONVERT_TO_GAMMA)
baseColor.rgb=toGammaSpace(baseColor.rgb);
#elif defined(CONVERT_TO_LINEAR)
baseColor.rgb=toLinearSpace(baseColor.rgb);
#endif
#ifdef ALPHATEST
if (baseColor.a<0.4)
discard;
#endif
gl_FragColor=baseColor*color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const layerPixelShader = { name, shader };
//# sourceMappingURL=layer.fragment.js.map

/***/ }),

/***/ 22614:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   layerVertexShader: () => (/* binding */ layerVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "layerVertexShader";
const shader = `attribute vec2 position;uniform vec2 scale;uniform vec2 offset;uniform mat4 textureMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec2 shiftedPosition=position*scale+offset;vUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));gl_Position=vec4(shiftedPosition,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const layerVertexShader = { name, shader };
//# sourceMappingURL=layer.vertex.js.map

/***/ }),

/***/ 5823:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lensFlarePixelShader: () => (/* binding */ lensFlarePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lensFlarePixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 baseColor=texture2D(textureSampler,vUV);gl_FragColor=baseColor*color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const lensFlarePixelShader = { name, shader };
//# sourceMappingURL=lensFlare.fragment.js.map

/***/ }),

/***/ 70633:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lensFlareVertexShader: () => (/* binding */ lensFlareVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lensFlareVertexShader";
const shader = `attribute vec2 position;uniform mat4 viewportMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=position*madd+madd;gl_Position=viewportMatrix*vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const lensFlareVertexShader = { name, shader };
//# sourceMappingURL=lensFlare.vertex.js.map

/***/ }),

/***/ 861:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   linePixelShader: () => (/* binding */ linePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6194);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34581);
/* harmony import */ var _ShadersInclude_logDepthFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29741);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7412);
// Do not edit.





const name = "linePixelShader";
const shader = `#include<clipPlaneFragmentDeclaration>
uniform vec4 color;
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<logDepthDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<logDepthFragment>
#include<clipPlaneFragment>
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const linePixelShader = { name, shader };
//# sourceMappingURL=line.fragment.js.map

/***/ }),

/***/ 26149:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  lineVertexShader: () => (/* binding */ lineVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lineVertexDeclaration.js
// Do not edit.

const lineVertexDeclaration_name = "lineVertexDeclaration";
const shader = `uniform mat4 viewProjection;
#define ADDITIONAL_VERTEX_DECLARATION
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[lineVertexDeclaration_name] = shader;
/** @internal */
const lineVertexDeclaration = { name: lineVertexDeclaration_name, shader };
//# sourceMappingURL=lineVertexDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js
var sceneUboDeclaration = __webpack_require__(28764);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js
var meshUboDeclaration = __webpack_require__(96467);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lineUboDeclaration.js
// Do not edit.



const lineUboDeclaration_name = "lineUboDeclaration";
const lineUboDeclaration_shader = `layout(std140,column_major) uniform;
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[lineUboDeclaration_name] = lineUboDeclaration_shader;
/** @internal */
const lineUboDeclaration = { name: lineUboDeclaration_name, shader: lineUboDeclaration_shader };
//# sourceMappingURL=lineUboDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__(1218);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(71636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(3298);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(47314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__(2215);
;// ./node_modules/@babylonjs/core/Shaders/line.vertex.js
// Do not edit.









const line_vertex_name = "lineVertexShader";
const line_vertex_shader = `#include<__decl__lineVertex>
#include<instancesDeclaration>
#include<clipPlaneVertexDeclaration>
attribute vec3 position;attribute vec4 normal;uniform float width;uniform float aspectRatio;
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
#include<instancesVertex>
mat4 worldViewProjection=viewProjection*finalWorld;vec4 viewPosition=worldViewProjection*vec4(position,1.0);vec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);vec2 currentScreen=viewPosition.xy/viewPosition.w;vec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;currentScreen.x*=aspectRatio;nextScreen.x*=aspectRatio;vec2 dir=normalize(nextScreen-currentScreen);vec2 normalDir=vec2(-dir.y,dir.x);normalDir*=width/2.0;normalDir.x/=aspectRatio;vec4 offset=vec4(normalDir*normal.w,0.0,0.0);gl_Position=viewPosition+offset;
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
vec4 worldPos=finalWorld*vec4(position,1.0);
#include<clipPlaneVertex>
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[line_vertex_name] = line_vertex_shader;
/** @internal */
const lineVertexShader = { name: line_vertex_name, shader: line_vertex_shader };
//# sourceMappingURL=line.vertex.js.map

/***/ }),

/***/ 19278:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lodPixelShader: () => (/* binding */ lodPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lodPixelShader";
const shader = `#extension GL_EXT_shader_texture_lod : enable
precision highp float;const float GammaEncodePowerApprox=1.0/2.2;varying vec2 vUV;uniform sampler2D textureSampler;uniform float lod;uniform vec2 texSize;uniform int gamma;void main(void)
{gl_FragColor=texture2DLodEXT(textureSampler,vUV,lod);if (gamma==0) {gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(GammaEncodePowerApprox));}}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const lodPixelShader = { name, shader };
//# sourceMappingURL=lod.fragment.js.map

/***/ }),

/***/ 92905:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   lodCubePixelShader: () => (/* binding */ lodCubePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "lodCubePixelShader";
const shader = `precision highp float;const float GammaEncodePowerApprox=1.0/2.2;varying vec2 vUV;uniform samplerCube textureSampler;uniform float lod;uniform int gamma;void main(void)
{vec2 uv=vUV*2.0-1.0;
#ifdef POSITIVEX
gl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x),lod);
#endif
#ifdef NEGATIVEX
gl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x),lod);
#endif
#ifdef POSITIVEY
gl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x),lod);
#endif
#ifdef NEGATIVEY
gl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x),lod);
#endif
#ifdef POSITIVEZ
gl_FragColor=textureCube(textureSampler,vec3(uv,1.001),lod);
#endif
#ifdef NEGATIVEZ
gl_FragColor=textureCube(textureSampler,vec3(uv,-1.001),lod);
#endif
if (gamma==0) {gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(GammaEncodePowerApprox));}}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const lodCubePixelShader = { name, shader };
//# sourceMappingURL=lodCube.fragment.js.map

/***/ }),

/***/ 30:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererPixelShader: () => (/* binding */ meshUVSpaceRendererPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererPixelShader";
const shader = `precision highp float;varying vec2 vDecalTC;uniform sampler2D textureSampler;void main(void) {if (vDecalTC.x<0. || vDecalTC.x>1. || vDecalTC.y<0. || vDecalTC.y>1.) {discard;}
gl_FragColor=texture2D(textureSampler,vDecalTC);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const meshUVSpaceRendererPixelShader = { name, shader };
//# sourceMappingURL=meshUVSpaceRenderer.fragment.js.map

/***/ }),

/***/ 99764:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererVertexShader: () => (/* binding */ meshUVSpaceRendererVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69707);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18959);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27999);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90738);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1218);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48451);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(15060);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3298);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3361);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65523);
// Do not edit.











const name = "meshUVSpaceRendererVertexShader";
const shader = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 projMatrix;varying vec2 vDecalTC;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
void main(void) {vec3 positionUpdated=position;vec3 normalUpdated=normal;
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);mat3 normWorldSM=mat3(finalWorld);vec3 vNormalW;
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normWorldSM=transposeMat3(inverseMat3(normWorldSM));
#endif
vNormalW=normalize(normWorldSM*normalUpdated);
#endif
vec3 normalView=normalize((projMatrix*vec4(vNormalW,0.0)).xyz);vec3 decalTC=(projMatrix*worldPos).xyz;vDecalTC=decalTC.xy;gl_Position=vec4(uv*2.0-1.0,normalView.z>0.0 ? 2. : decalTC.z,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const meshUVSpaceRendererVertexShader = { name, shader };
//# sourceMappingURL=meshUVSpaceRenderer.vertex.js.map

/***/ }),

/***/ 15105:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererFinaliserPixelShader: () => (/* binding */ meshUVSpaceRendererFinaliserPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererFinaliserPixelShader";
const shader = `precision highp float;varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D maskTextureSampler;uniform vec2 textureSize;void main() {vec4 mask=texture2D(maskTextureSampler,vUV).rgba;if (mask.r>0.5) {gl_FragColor=texture2D(textureSampler,vUV);} else {vec2 texelSize=4.0/textureSize;vec2 uv_p01=vUV+vec2(-1.0,0.0)*texelSize;vec2 uv_p21=vUV+vec2(1.0,0.0)*texelSize;vec2 uv_p10=vUV+vec2(0.0,-1.0)*texelSize;vec2 uv_p12=vUV+vec2(0.0,1.0)*texelSize;float mask_p01=texture2D(maskTextureSampler,uv_p01).r;float mask_p21=texture2D(maskTextureSampler,uv_p21).r;float mask_p10=texture2D(maskTextureSampler,uv_p10).r;float mask_p12=texture2D(maskTextureSampler,uv_p12).r;vec4 col=vec4(0.0,0.0,0.0,0.0);float total_weight=0.0;if (mask_p01>0.5) {col+=texture2D(textureSampler,uv_p01);total_weight+=1.0;}
if (mask_p21>0.5) {col+=texture2D(textureSampler,uv_p21);total_weight+=1.0;}
if (mask_p10>0.5) {col+=texture2D(textureSampler,uv_p10);total_weight+=1.0;}
if (mask_p12>0.5) {col+=texture2D(textureSampler,uv_p12);total_weight+=1.0;}
if (total_weight>0.0) {gl_FragColor=col/total_weight;} else {gl_FragColor=col;}}}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const meshUVSpaceRendererFinaliserPixelShader = { name, shader };
//# sourceMappingURL=meshUVSpaceRendererFinaliser.fragment.js.map

/***/ }),

/***/ 18507:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererFinaliserVertexShader: () => (/* binding */ meshUVSpaceRendererFinaliserVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererFinaliserVertexShader";
const shader = `precision highp float;attribute vec3 position;attribute vec2 uv;uniform mat4 worldViewProjection;varying vec2 vUV;void main() {gl_Position=worldViewProjection*vec4(position,1.0);vUV=uv;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const meshUVSpaceRendererFinaliserVertexShader = { name, shader };
//# sourceMappingURL=meshUVSpaceRendererFinaliser.vertex.js.map

/***/ }),

/***/ 78439:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererMaskerPixelShader: () => (/* binding */ meshUVSpaceRendererMaskerPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererMaskerPixelShader";
const shader = `varying vec2 vUV;void main(void) {gl_FragColor=vec4(1.0,1.0,1.0,1.0);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const meshUVSpaceRendererMaskerPixelShader = { name, shader };
//# sourceMappingURL=meshUVSpaceRendererMasker.fragment.js.map

/***/ }),

/***/ 54561:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   meshUVSpaceRendererMaskerVertexShader: () => (/* binding */ meshUVSpaceRendererMaskerVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "meshUVSpaceRendererMaskerVertexShader";
const shader = `attribute vec2 uv;varying vec2 vUV;void main(void) {gl_Position=vec4(vec2(uv.x,uv.y)*2.0-1.0,0.,1.0);vUV=uv;}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const meshUVSpaceRendererMaskerVertexShader = { name, shader };
//# sourceMappingURL=meshUVSpaceRendererMasker.vertex.js.map

/***/ }),

/***/ 25830:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   motionBlurPixelShader: () => (/* binding */ motionBlurPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "motionBlurPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float motionStrength;uniform float motionScale;uniform vec2 screenSize;
#ifdef OBJECT_BASED
uniform sampler2D velocitySampler;
#else
uniform sampler2D depthSampler;uniform mat4 inverseViewProjection;uniform mat4 prevViewProjection;uniform mat4 projection;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#ifdef GEOMETRY_SUPPORTED
#ifdef OBJECT_BASED
vec2 texelSize=1.0/screenSize;vec4 velocityColor=texture2D(velocitySampler,vUV);velocityColor.rg=velocityColor.rg*2.0-vec2(1.0);vec2 velocity=vec2(pow(velocityColor.r,3.0),pow(velocityColor.g,3.0))*velocityColor.a;velocity*=motionScale*motionStrength;float speed=length(velocity/texelSize);int samplesCount=int(clamp(speed,1.0,SAMPLES));velocity=normalize(velocity)*texelSize;float hlim=float(-samplesCount)*0.5+0.5;vec4 result=texture2D(textureSampler,vUV);for (int i=1; i<int(SAMPLES); ++i)
{if (i>=samplesCount)
break;vec2 offset=vUV+velocity*(hlim+float(i));
#if defined(WEBGPU)
result+=texture2DLodEXT(textureSampler,offset,0.0);
#else
result+=texture2D(textureSampler,offset);
#endif
}
gl_FragColor=result/float(samplesCount);gl_FragColor.a=1.0;
#else
vec2 texelSize=1.0/screenSize;float depth=texture2D(depthSampler,vUV).r;depth=projection[2].z+projection[3].z/depth; 
vec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);cpos=inverseViewProjection*cpos;cpos/=cpos.w;vec4 ppos=prevViewProjection*cpos;ppos/=ppos.w;ppos.xy=ppos.xy*0.5+0.5;vec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;float speed=length(velocity/texelSize);int nSamples=int(clamp(speed,1.0,SAMPLES));vec4 result=texture2D(textureSampler,vUV);for (int i=1; i<int(SAMPLES); ++i) {if (i>=nSamples)
break;vec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);
#if defined(WEBGPU)
result+=texture2DLodEXT(textureSampler,offset1,0.0);
#else
result+=texture2D(textureSampler,offset1);
#endif
}
gl_FragColor=result/float(nSamples);
#endif
#else
gl_FragColor=texture2D(textureSampler,vUV);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const motionBlurPixelShader = { name, shader };
//# sourceMappingURL=motionBlur.fragment.js.map

/***/ }),

/***/ 20449:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   oitBackBlendPixelShader: () => (/* binding */ oitBackBlendPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "oitBackBlendPixelShader";
const shader = `precision highp float;uniform sampler2D uBackColor;void main() {glFragColor=texelFetch(uBackColor,ivec2(gl_FragCoord.xy),0);if (glFragColor.a==0.0) { 
discard;}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const oitBackBlendPixelShader = { name, shader };
//# sourceMappingURL=oitBackBlend.fragment.js.map

/***/ }),

/***/ 19015:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   oitFinalPixelShader: () => (/* binding */ oitFinalPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "oitFinalPixelShader";
const shader = `precision highp float;uniform sampler2D uFrontColor;uniform sampler2D uBackColor;void main() {ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec4 frontColor=texelFetch(uFrontColor,fragCoord,0);vec4 backColor=texelFetch(uBackColor,fragCoord,0);float alphaMultiplier=1.0-frontColor.a;glFragColor=vec4(
frontColor.rgb+alphaMultiplier*backColor.rgb,
frontColor.a+backColor.a
);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const oitFinalPixelShader = { name, shader };
//# sourceMappingURL=oitFinal.fragment.js.map

/***/ }),

/***/ 2641:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   outlinePixelShader: () => (/* binding */ outlinePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6194);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34581);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7412);
/* harmony import */ var _ShadersInclude_logDepthFragment_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29741);
// Do not edit.





const name = "outlinePixelShader";
const shader = `#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
uniform vec4 color;
#ifdef ALPHATEST
varying vec2 vUV;uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#ifdef ALPHATEST
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
#endif
#include<logDepthFragment>
gl_FragColor=color;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const outlinePixelShader = { name, shader };
//# sourceMappingURL=outline.fragment.js.map

/***/ }),

/***/ 99899:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   outlineVertexShader: () => (/* binding */ outlineVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69707);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18959);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27999);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90738);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71636);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1218);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(34581);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(48451);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(15060);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(3298);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(3361);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(65523);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(47314);
/* harmony import */ var _ShadersInclude_logDepthVertex_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2215);
// Do not edit.















const name = "outlineVertexShader";
const shader = `attribute vec3 position;attribute vec3 normal;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<clipPlaneVertexDeclaration>
uniform float offset;
#include<instancesDeclaration>
uniform mat4 viewProjection;
#ifdef ALPHATEST
varying vec2 vUV;uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;vec3 normalUpdated=normal;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
vec3 offsetPosition=positionUpdated+(normalUpdated*offset);
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(offsetPosition,1.0);gl_Position=viewProjection*worldPos;
#ifdef ALPHATEST
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#include<clipPlaneVertex>
#include<logDepthVertex>
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const outlineVertexShader = { name, shader };
//# sourceMappingURL=outline.vertex.js.map

/***/ }),

/***/ 16066:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   particlesPixelShader: () => (/* binding */ particlesPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6194);
/* harmony import */ var _ShadersInclude_imageProcessingDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(89392);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34581);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(73325);
/* harmony import */ var _ShadersInclude_imageProcessingFunctions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64017);
/* harmony import */ var _ShadersInclude_fogFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7806);
/* harmony import */ var _ShadersInclude_clipPlaneFragment_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7412);
/* harmony import */ var _ShadersInclude_logDepthFragment_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(29741);
/* harmony import */ var _ShadersInclude_fogFragment_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2360);
// Do not edit.










const name = "particlesPixelShader";
const shader = `#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
varying vec2 vUV;varying vec4 vColor;uniform vec4 textureMask;uniform sampler2D diffuseSampler;
#include<clipPlaneFragmentDeclaration>
#include<imageProcessingDeclaration>
#include<logDepthDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
#ifdef RAMPGRADIENT
varying vec4 remapRanges;uniform sampler2D rampSampler;
#endif
#include<fogFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
vec4 textureColor=texture2D(diffuseSampler,vUV);vec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;
#ifdef RAMPGRADIENT
float alpha=baseColor.a;float remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);vec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));baseColor.rgb*=rampColor.rgb;float finalAlpha=baseColor.a;baseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);
#endif
#ifdef BLENDMULTIPLYMODE
float sourceAlpha=vColor.a*textureColor.a;baseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);
#endif
#include<logDepthFragment>
#include<fogFragment>(color,baseColor)
#ifdef IMAGEPROCESSINGPOSTPROCESS
baseColor.rgb=toLinearSpace(baseColor.rgb);
#else
#ifdef IMAGEPROCESSING
baseColor.rgb=toLinearSpace(baseColor.rgb);baseColor=applyImageProcessing(baseColor);
#endif
#endif
gl_FragColor=baseColor;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const particlesPixelShader = { name, shader };
//# sourceMappingURL=particles.fragment.js.map

/***/ }),

/***/ 59384:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   particlesVertexShader: () => (/* binding */ particlesVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_clipPlaneVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71636);
/* harmony import */ var _ShadersInclude_fogVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86560);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34581);
/* harmony import */ var _ShadersInclude_clipPlaneVertex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(47314);
/* harmony import */ var _ShadersInclude_fogVertex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16470);
/* harmony import */ var _ShadersInclude_logDepthVertex_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2215);
// Do not edit.







const name = "particlesVertexShader";
const shader = `attribute vec3 position;attribute vec4 color;attribute float angle;attribute vec2 size;
#ifdef ANIMATESHEET
attribute float cellIndex;
#endif
#ifndef BILLBOARD
attribute vec3 direction;
#endif
#ifdef BILLBOARDSTRETCHED
attribute vec3 direction;
#endif
#ifdef RAMPGRADIENT
attribute vec4 remapData;
#endif
attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 translationPivot;
#ifdef ANIMATESHEET
uniform vec3 particlesInfos; 
#endif
varying vec2 vUV;varying vec4 vColor;varying vec3 vPositionW;
#ifdef RAMPGRADIENT
varying vec4 remapRanges;
#endif
#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)
uniform mat4 invView;
#endif
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<logDepthDeclaration>
#ifdef BILLBOARD
uniform vec3 eyePosition;
#endif
vec3 rotate(vec3 yaxis,vec3 rotatedCorner) {vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));vec3 zaxis=normalize(cross(yaxis,xaxis));vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;return position+alignedCorner;}
#ifdef BILLBOARDSTRETCHED
vec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {vec3 normalizedToCamera=normalize(toCamera);vec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));vec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);vec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);
#ifdef BILLBOARDSTRETCHED_LOCAL
vec3 row1=direction;
#else
vec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));vec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);
#endif
mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;return position+alignedCorner;}
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec2 cornerPos;cornerPos=(vec2(offset.x-0.5,offset.y -0.5)-translationPivot)*size;
#ifdef BILLBOARD
vec3 rotatedCorner;
#ifdef BILLBOARDY
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.y=0.;rotatedCorner.xz+=translationPivot;vec3 yaxis=position-eyePosition;yaxis.y=0.;vPositionW=rotate(normalize(yaxis),rotatedCorner);vec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;
#elif defined(BILLBOARDSTRETCHED)
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;vec3 toCamera=position-eyePosition;vPositionW=rotateAlign(toCamera,rotatedCorner);vec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;
#else
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;vec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;vPositionW=(invView*vec4(viewPos,1)).xyz;
#endif
#ifdef RAMPGRADIENT
remapRanges=remapData;
#endif
gl_Position=projection*vec4(viewPos,1.0);
#else
vec3 rotatedCorner;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.y=0.;rotatedCorner.xz+=translationPivot;vec3 yaxis=normalize(direction);vPositionW=rotate(yaxis,rotatedCorner);gl_Position=projection*view*vec4(vPositionW,1.0);
#endif
vColor=color;
#ifdef ANIMATESHEET
float rowOffset=floor(cellIndex*particlesInfos.z);float columnOffset=cellIndex-rowOffset/particlesInfos.z;vec2 uvScale=particlesInfos.xy;vec2 uvOffset=vec2(offset.x ,1.0-offset.y);vUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;
#else
vUV=offset;
#endif
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) || defined(FOG)
vec4 worldPos=vec4(vPositionW,1.0);
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const particlesVertexShader = { name, shader };
//# sourceMappingURL=particles.vertex.js.map

/***/ }),

/***/ 79820:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   passPixelShader: () => (/* binding */ passPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "passPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{gl_FragColor=texture2D(textureSampler,vUV);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const passPixelShader = { name, shader };
//# sourceMappingURL=pass.fragment.js.map

/***/ }),

/***/ 4511:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   passCubePixelShader: () => (/* binding */ passCubePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "passCubePixelShader";
const shader = `varying vec2 vUV;uniform samplerCube textureSampler;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec2 uv=vUV*2.0-1.0;
#ifdef POSITIVEX
gl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));
#endif
#ifdef NEGATIVEX
gl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));
#endif
#ifdef POSITIVEY
gl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));
#endif
#ifdef NEGATIVEY
gl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));
#endif
#ifdef POSITIVEZ
gl_FragColor=textureCube(textureSampler,vec3(uv,1.001));
#endif
#ifdef NEGATIVEZ
gl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const passCubePixelShader = { name, shader };
//# sourceMappingURL=passCube.fragment.js.map

/***/ }),

/***/ 84037:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  pbrPixelShader: () => (/* binding */ pbrPixelShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassDeclaration.js
var prePassDeclaration = __webpack_require__(42694);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitDeclaration.js
var oitDeclaration = __webpack_require__(89986);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/decalFragmentDeclaration.js
var decalFragmentDeclaration = __webpack_require__(48109);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentDeclaration.js
// Do not edit.


const pbrFragmentDeclaration_name = "pbrFragmentDeclaration";
const shader = `uniform vec4 vEyePosition;uniform vec3 vReflectionColor;uniform vec4 vAlbedoColor;uniform vec4 vLightingIntensity;uniform vec4 vReflectivityColor;uniform vec4 vMetallicReflectanceFactors;uniform vec3 vEmissiveColor;uniform float visibility;uniform vec3 vAmbientColor;
#ifdef ALBEDO
uniform vec2 vAlbedoInfos;
#endif
#ifdef AMBIENT
uniform vec4 vAmbientInfos;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;
#endif
#ifdef OPACITY
uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;
#endif
#ifdef REFLECTIVITY
uniform vec3 vReflectivityInfos;
#endif
#ifdef MICROSURFACEMAP
uniform vec2 vMicroSurfaceSamplerInfos;
#endif
#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION) || defined(PREPASS)
uniform mat4 view;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;
#ifdef REALTIME_FILTERING
uniform vec2 vReflectionFilteringInfo;
#endif
uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;
#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)
uniform vec3 vReflectionPosition;uniform vec3 vReflectionSize; 
#endif
#endif
#if defined(SS_REFRACTION) && defined(SS_USE_LOCAL_REFRACTIONMAP_CUBIC)
uniform vec3 vRefractionPosition;uniform vec3 vRefractionSize; 
#endif
#ifdef CLEARCOAT
uniform vec2 vClearCoatParams;uniform vec4 vClearCoatRefractionParams;
#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)
uniform vec4 vClearCoatInfos;
#endif
#ifdef CLEARCOAT_TEXTURE
uniform mat4 clearCoatMatrix;
#endif
#ifdef CLEARCOAT_TEXTURE_ROUGHNESS
uniform mat4 clearCoatRoughnessMatrix;
#endif
#ifdef CLEARCOAT_BUMP
uniform vec2 vClearCoatBumpInfos;uniform vec2 vClearCoatTangentSpaceParams;uniform mat4 clearCoatBumpMatrix;
#endif
#ifdef CLEARCOAT_TINT
uniform vec4 vClearCoatTintParams;uniform float clearCoatColorAtDistance;
#ifdef CLEARCOAT_TINT_TEXTURE
uniform vec2 vClearCoatTintInfos;uniform mat4 clearCoatTintMatrix;
#endif
#endif
#endif
#ifdef IRIDESCENCE
uniform vec4 vIridescenceParams;
#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE)
uniform vec4 vIridescenceInfos;
#endif
#ifdef IRIDESCENCE_TEXTURE
uniform mat4 iridescenceMatrix;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
uniform mat4 iridescenceThicknessMatrix;
#endif
#endif
#ifdef ANISOTROPIC
uniform vec3 vAnisotropy;
#ifdef ANISOTROPIC_TEXTURE
uniform vec2 vAnisotropyInfos;uniform mat4 anisotropyMatrix;
#endif
#endif
#ifdef SHEEN
uniform vec4 vSheenColor;
#ifdef SHEEN_ROUGHNESS
uniform float vSheenRoughness;
#endif
#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)
uniform vec4 vSheenInfos;
#endif
#ifdef SHEEN_TEXTURE
uniform mat4 sheenMatrix;
#endif
#ifdef SHEEN_TEXTURE_ROUGHNESS
uniform mat4 sheenRoughnessMatrix;
#endif
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
uniform vec4 vRefractionMicrosurfaceInfos;uniform vec4 vRefractionInfos;uniform mat4 refractionMatrix;
#ifdef REALTIME_FILTERING
uniform vec2 vRefractionFilteringInfo;
#endif
#ifdef SS_DISPERSION
uniform float dispersion;
#endif
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
uniform vec2 vThicknessInfos;uniform mat4 thicknessMatrix;
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
uniform vec2 vRefractionIntensityInfos;uniform mat4 refractionIntensityMatrix;
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
uniform vec2 vTranslucencyIntensityInfos;uniform mat4 translucencyIntensityMatrix;
#endif
uniform vec2 vThicknessParam;uniform vec3 vDiffusionDistance;uniform vec4 vTintColor;uniform vec3 vSubSurfaceIntensity;uniform vec4 vTranslucencyColor;
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
uniform vec2 vTranslucencyColorInfos;uniform mat4 translucencyColorMatrix;
#endif
#endif
#ifdef PREPASS
#ifdef SS_SCATTERING
uniform float scatteringDiffusionProfile;
#endif
#endif
#if DEBUGMODE>0
uniform vec2 vDebugMode;
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;
#endif
#include<decalFragmentDeclaration>
#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
uniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22;
#else
uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX;
#endif
#endif
#define ADDITIONAL_FRAGMENT_DECLARATION
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrFragmentDeclaration_name] = shader;
/** @internal */
const pbrFragmentDeclaration = { name: pbrFragmentDeclaration_name, shader };
//# sourceMappingURL=pbrFragmentDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrUboDeclaration.js
var pbrUboDeclaration = __webpack_require__(4096);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js
var mainUVVaryingDeclaration = __webpack_require__(4980);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.js
// Do not edit.


const pbrFragmentExtraDeclaration_name = "pbrFragmentExtraDeclaration";
const pbrFragmentExtraDeclaration_shader = `varying vec3 vPositionW;
#if DEBUGMODE>0
varying vec4 vClipSpacePosition;
#endif
#include<mainUVVaryingDeclaration>[1..7]
#ifdef NORMAL
varying vec3 vNormalW;
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
varying vec3 vEnvironmentIrradiance;
#endif
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrFragmentExtraDeclaration_name] = pbrFragmentExtraDeclaration_shader;
/** @internal */
const pbrFragmentExtraDeclaration = { name: pbrFragmentExtraDeclaration_name, shader: pbrFragmentExtraDeclaration_shader };
//# sourceMappingURL=pbrFragmentExtraDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js
var lightFragmentDeclaration = __webpack_require__(92270);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js
var lightUboDeclaration = __webpack_require__(22448);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.js
var samplerFragmentDeclaration = __webpack_require__(63022);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentAlternateDeclaration.js
// Do not edit.

const samplerFragmentAlternateDeclaration_name = "samplerFragmentAlternateDeclaration";
const samplerFragmentAlternateDeclaration_shader = `#ifdef _DEFINENAME_
#if _DEFINENAME_DIRECTUV==1
#define v_VARYINGNAME_UV vMainUV1
#elif _DEFINENAME_DIRECTUV==2
#define v_VARYINGNAME_UV vMainUV2
#elif _DEFINENAME_DIRECTUV==3
#define v_VARYINGNAME_UV vMainUV3
#elif _DEFINENAME_DIRECTUV==4
#define v_VARYINGNAME_UV vMainUV4
#elif _DEFINENAME_DIRECTUV==5
#define v_VARYINGNAME_UV vMainUV5
#elif _DEFINENAME_DIRECTUV==6
#define v_VARYINGNAME_UV vMainUV6
#else
varying vec2 v_VARYINGNAME_UV;
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[samplerFragmentAlternateDeclaration_name] = samplerFragmentAlternateDeclaration_shader;
/** @internal */
const samplerFragmentAlternateDeclaration = { name: samplerFragmentAlternateDeclaration_name, shader: samplerFragmentAlternateDeclaration_shader };
//# sourceMappingURL=samplerFragmentAlternateDeclaration.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js
// Do not edit.



const pbrFragmentSamplersDeclaration_name = "pbrFragmentSamplersDeclaration";
const pbrFragmentSamplersDeclaration_shader = `#include<samplerFragmentDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo)
#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface)
#include<samplerFragmentDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance)
#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance)
#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)
#ifdef CLEARCOAT
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat)
#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS)
uniform sampler2D clearCoatRoughnessSampler;
#endif
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump)
#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint)
#endif
#ifdef IRIDESCENCE
#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence)
#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness)
#endif
#ifdef SHEEN
#include<samplerFragmentDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen)
#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS)
uniform sampler2D sheenRoughnessSampler;
#endif
#endif
#ifdef ANISOTROPIC
#include<samplerFragmentDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy)
#endif
#ifdef REFLECTION
#ifdef REFLECTIONMAP_3D
#define sampleReflection(s,c) textureCube(s,c)
uniform samplerCube reflectionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
#else
uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
#endif
#ifdef USEIRRADIANCEMAP
uniform samplerCube irradianceSampler;
#endif
#else
#define sampleReflection(s,c) texture2D(s,c)
uniform sampler2D reflectionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
#else
uniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh;
#endif
#ifdef USEIRRADIANCEMAP
uniform sampler2D irradianceSampler;
#endif
#endif
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#else
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#endif
#endif
#ifdef ENVIRONMENTBRDF
uniform sampler2D environmentBrdfSampler;
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
#ifdef SS_REFRACTIONMAP_3D
#define sampleRefraction(s,c) textureCube(s,c)
uniform samplerCube refractionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)
#else
uniform samplerCube refractionSamplerLow;uniform samplerCube refractionSamplerHigh;
#endif
#else
#define sampleRefraction(s,c) texture2D(s,c)
uniform sampler2D refractionSampler;
#ifdef LODBASEDMICROSFURACE
#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)
#else
uniform sampler2D refractionSamplerLow;uniform sampler2D refractionSamplerHigh;
#endif
#endif
#endif
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity)
#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_SAMPLERNAME_,translucencyColor)
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrFragmentSamplersDeclaration_name] = pbrFragmentSamplersDeclaration_shader;
/** @internal */
const pbrFragmentSamplersDeclaration = { name: pbrFragmentSamplersDeclaration_name, shader: pbrFragmentSamplersDeclaration_shader };
//# sourceMappingURL=pbrFragmentSamplersDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js
var imageProcessingDeclaration = __webpack_require__(89392);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(6194);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__(7806);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(73325);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/subSurfaceScatteringFunctions.js
var subSurfaceScatteringFunctions = __webpack_require__(96044);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/importanceSampling.js
var importanceSampling = __webpack_require__(21469);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrHelperFunctions.js
// Do not edit.

const pbrHelperFunctions_name = "pbrHelperFunctions";
const pbrHelperFunctions_shader = `#define MINIMUMVARIANCE 0.0005
float convertRoughnessToAverageSlope(float roughness)
{return square(roughness)+MINIMUMVARIANCE;}
float fresnelGrazingReflectance(float reflectance0) {float reflectance90=saturate(reflectance0*25.0);return reflectance90;}
vec2 getAARoughnessFactors(vec3 normalVector) {
#ifdef SPECULARAA
vec3 nDfdx=dFdx(normalVector.xyz);vec3 nDfdy=dFdy(normalVector.xyz);float slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));float geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);float geometricAlphaGFactor=sqrt(slopeSquare);geometricAlphaGFactor*=0.75;return vec2(geometricRoughnessFactor,geometricAlphaGFactor);
#else
return vec2(0.);
#endif
}
#ifdef ANISOTROPIC
#ifdef ANISOTROPIC_LEGACY
vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);return vec2(alphaT,alphaB);}
vec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 anisotropicFrameDirection;if (anisotropy>=0.0) {anisotropicFrameDirection=B;} else {anisotropicFrameDirection=T;}
vec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);vec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);vec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));return anisotropicNormal;}
#else
vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(mix(alphaG,1.0,anisotropy*anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG,MINIMUMVARIANCE);return vec2(alphaT,alphaB);}
vec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 bentNormal=cross(B,V);bentNormal=normalize(cross(bentNormal,B));float a=square(square(1.0-anisotropy*(1.0-roughness)));bentNormal=normalize(mix(bentNormal,N,a));return bentNormal;}
#endif
#endif
#if defined(CLEARCOAT) || defined(SS_REFRACTION)
vec3 cocaLambert(vec3 alpha,float distance) {return exp(-alpha*distance);}
vec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {return cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));}
vec3 computeColorAtDistanceInMedia(vec3 color,float distance) {return -log(color)/distance;}
vec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 clearCoatAbsorption=mix(vec3(1.0),
cocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),
clearCoatIntensity);return clearCoatAbsorption;}
#endif
#ifdef MICROSURFACEAUTOMATIC
float computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)
{const float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;float reflectivityLuminance=getLuminance(reflectivityColor);float reflectivityLuma=sqrt(reflectivityLuminance);microSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return microSurface;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrHelperFunctions_name] = pbrHelperFunctions_shader;
/** @internal */
const pbrHelperFunctions = { name: pbrHelperFunctions_name, shader: pbrHelperFunctions_shader };
//# sourceMappingURL=pbrHelperFunctions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js
var imageProcessingFunctions = __webpack_require__(64017);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js
var shadowsFragmentFunctions = __webpack_require__(66812);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/harmonicsFunctions.js
var harmonicsFunctions = __webpack_require__(19495);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.js
// Do not edit.

const pbrDirectLightingSetupFunctions_name = "pbrDirectLightingSetupFunctions";
const pbrDirectLightingSetupFunctions_shader = `struct preLightingInfo
{vec3 lightOffset;float lightDistanceSquared;float lightDistance;float attenuation;vec3 L;vec3 H;float NdotV;float NdotLUnclamped;float NdotL;float VdotH;float roughness;
#ifdef IRIDESCENCE
float iridescenceIntensity;
#endif
};preLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N,vec3 posW) {preLightingInfo result;result.lightOffset=lightData.xyz-posW;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);result.L=normalize(result.lightOffset);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);return result;}
preLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.lightDistance=length(-lightData.xyz);result.L=normalize(-lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);return result;}
preLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.NdotL=dot(N,lightData.xyz)*0.5+0.5;result.NdotL=saturateEps(result.NdotL);result.NdotLUnclamped=result.NdotL;
#ifdef SPECULARTERM
result.L=normalize(lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));
#endif
return result;}`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrDirectLightingSetupFunctions_name] = pbrDirectLightingSetupFunctions_shader;
/** @internal */
const pbrDirectLightingSetupFunctions = { name: pbrDirectLightingSetupFunctions_name, shader: pbrDirectLightingSetupFunctions_shader };
//# sourceMappingURL=pbrDirectLightingSetupFunctions.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions.js
// Do not edit.

const pbrDirectLightingFalloffFunctions_name = "pbrDirectLightingFalloffFunctions";
const pbrDirectLightingFalloffFunctions_shader = `float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)
{return max(0.,1.0-length(lightOffset)/range);}
float computeDistanceLightFalloff_Physical(float lightDistanceSquared)
{return 1.0/maxEps(lightDistanceSquared);}
float computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)
{float lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);float factor=lightDistanceSquared*inverseSquaredRange;float attenuation=saturate(1.0-factor*factor);attenuation*=attenuation;lightDistanceFalloff*=attenuation;return lightDistanceFalloff;}
float computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)
{
#ifdef USEPHYSICALLIGHTFALLOFF
return computeDistanceLightFalloff_Physical(lightDistanceSquared);
#elif defined(USEGLTFLIGHTFALLOFF)
return computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);
#else
return computeDistanceLightFalloff_Standard(lightOffset,range);
#endif
}
float computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)
{float falloff=0.0;float cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));if (cosAngle>=cosHalfAngle)
{falloff=max(0.,pow(cosAngle,exponent));}
return falloff;}
float computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)
{const float kMinusLog2ConeAngleIntensityRatio=6.64385618977; 
float concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);vec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);float falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));return falloff;}
float computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)
{float cd=dot(-lightDirection,directionToLightCenterW);float falloff=saturate(cd*lightAngleScale+lightAngleOffset);falloff*=falloff;return falloff;}
float computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)
{
#ifdef USEPHYSICALLIGHTFALLOFF
return computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);
#elif defined(USEGLTFLIGHTFALLOFF)
return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);
#else
return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);
#endif
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrDirectLightingFalloffFunctions_name] = pbrDirectLightingFalloffFunctions_shader;
/** @internal */
const pbrDirectLightingFalloffFunctions = { name: pbrDirectLightingFalloffFunctions_name, shader: pbrDirectLightingFalloffFunctions_shader };
//# sourceMappingURL=pbrDirectLightingFalloffFunctions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBRDFFunctions.js
var pbrBRDFFunctions = __webpack_require__(8709);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/hdrFilteringFunctions.js
var hdrFilteringFunctions = __webpack_require__(78741);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingFunctions.js
// Do not edit.

const pbrDirectLightingFunctions_name = "pbrDirectLightingFunctions";
const pbrDirectLightingFunctions_shader = `#define CLEARCOATREFLECTANCE90 1.0
struct lightingInfo
{vec3 diffuse;
#ifdef SPECULARTERM
vec3 specular;
#endif
#ifdef CLEARCOAT
vec4 clearCoat;
#endif
#ifdef SHEEN
vec3 sheen;
#endif
};float adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) {
#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)
float lightRoughness=lightRadius/lightDistance;float totalRoughness=saturate(lightRoughness+roughness);return totalRoughness;
#else
return roughness;
#endif
}
vec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {return mix(groundColor,lightColor,info.NdotL);}
vec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {float diffuseTerm=diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness);return diffuseTerm*info.attenuation*info.NdotL*lightColor;}
#define inline
vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return toLinearSpace(textureColor);}
#ifdef SS_TRANSLUCENCY
vec3 computeDiffuseAndTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {float NdotL=absEps(info.NdotLUnclamped);float wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);float trAdapt=step(0.,info.NdotLUnclamped);vec3 transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt);float diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);return diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;}
#endif
#ifdef SPECULARTERM
vec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness);vec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);
#ifdef IRIDESCENCE
fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
#endif
float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);
#ifdef BRDF_V_HEIGHT_CORRELATED
float smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);
#else
float smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);
#endif
vec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}
#endif
#ifdef ANISOTROPIC
vec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float TdotH=dot(T,info.H);float BdotH=dot(B,info.H);float TdotV=dot(T,V);float BdotV=dot(B,V);float TdotL=dot(T,info.L);float BdotL=dot(B,info.L);float alphaG=convertRoughnessToAverageSlope(info.roughness);vec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,square(geometricRoughnessFactor));vec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);
#ifdef IRIDESCENCE
fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
#endif
float distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);float smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);vec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}
#endif
#ifdef CLEARCOAT
vec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {float NccdotL=saturateEps(dot(Ncc,info.L));float NccdotH=saturateEps(dot(Ncc,info.H));float clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);float fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnel*=clearCoatIntensity;float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);float kelemenVisibility=visibility_Kelemen(info.VdotH);float clearCoatTerm=fresnel*distribution*kelemenVisibility;return vec4(
clearCoatTerm*info.attenuation*NccdotL*lightColor,
1.0-fresnel
);}
vec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);float NdotLRefract=saturateEps(dot(Ncc,LRefract));vec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);return absorption;}
#endif
#ifdef SHEEN
vec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness);float fresnel=1.;float distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);/*#ifdef SHEEN_SOFTER
float visibility=visibility_CharlieSheen(info.NdotL,info.NdotV,alphaG);
#else */
float visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);/* #endif */
float sheenTerm=fresnel*distribution*visibility;return sheenTerm*info.attenuation*info.NdotL*lightColor;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrDirectLightingFunctions_name] = pbrDirectLightingFunctions_shader;
/** @internal */
const pbrDirectLightingFunctions = { name: pbrDirectLightingFunctions_name, shader: pbrDirectLightingFunctions_shader };
//# sourceMappingURL=pbrDirectLightingFunctions.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrIBLFunctions.js
// Do not edit.

const pbrIBLFunctions_name = "pbrIBLFunctions";
const pbrIBLFunctions_shader = `#if defined(REFLECTION) || defined(SS_REFRACTION)
float getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {float microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;float lod=log2(microsurfaceAverageSlopeTexels);return lod;}
float getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {float lod=log2(cubeMapDimensionPixels)*roughness;return lod;}
#endif
#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)
float environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {float temp=NdotVUnclamped+ambientOcclusion;return saturate(square(temp)-1.0+ambientOcclusion);}
#endif
#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)
float environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {vec3 reflection=reflect(view,normal);float temp=saturate(1.0+1.1*dot(reflection,geometricNormal));return square(temp);}
#endif
#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)
#define UNPACK_LOD(x) (1.0-x)*255.0
float getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {float microsurfaceAverageSlope=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrIBLFunctions_name] = pbrIBLFunctions_shader;
/** @internal */
const pbrIBLFunctions = { name: pbrIBLFunctions_name, shader: pbrIBLFunctions_shader };
//# sourceMappingURL=pbrIBLFunctions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js
var bumpFragmentMainFunctions = __webpack_require__(17494);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js
var bumpFragmentFunctions = __webpack_require__(8269);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js
var reflectionFunction = __webpack_require__(18223);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/decalFragment.js
var decalFragment = __webpack_require__(11205);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js
// Do not edit.


const pbrBlockAlbedoOpacity_name = "pbrBlockAlbedoOpacity";
const pbrBlockAlbedoOpacity_shader = `struct albedoOpacityOutParams
{vec3 surfaceAlbedo;float alpha;};
#define pbr_inline
albedoOpacityOutParams albedoOpacityBlock(
in vec4 vAlbedoColor
#ifdef ALBEDO
,in vec4 albedoTexture
,in vec2 albedoInfos
#endif
#ifdef OPACITY
,in vec4 opacityMap
,in vec2 vOpacityInfos
#endif
#ifdef DETAIL
,in vec4 detailColor
,in vec4 vDetailInfos
#endif
#ifdef DECAL
,in vec4 decalColor
,in vec4 vDecalInfos
#endif 
)
{albedoOpacityOutParams outParams;vec3 surfaceAlbedo=vAlbedoColor.rgb;float alpha=vAlbedoColor.a;
#ifdef ALBEDO
#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)
alpha*=albedoTexture.a;
#endif
#ifdef GAMMAALBEDO
surfaceAlbedo*=toLinearSpace(albedoTexture.rgb);
#else
surfaceAlbedo*=albedoTexture.rgb;
#endif
surfaceAlbedo*=albedoInfos.y;
#endif
#ifndef DECAL_AFTER_DETAIL
#include<decalFragment>
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
surfaceAlbedo*=vColor.rgb;
#endif
#ifdef DETAIL
float detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);surfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo; 
#endif
#ifdef DECAL_AFTER_DETAIL
#include<decalFragment>
#endif
#define CUSTOM_FRAGMENT_UPDATE_ALBEDO
#ifdef OPACITY
#ifdef OPACITYRGB
alpha=getLuminance(opacityMap.rgb);
#else
alpha*=opacityMap.a;
#endif
alpha*=vOpacityInfos.y;
#endif
#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
alpha*=vColor.a;
#endif
#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)
#ifdef ALPHATEST 
#if DEBUGMODE != 88
if (alpha<ALPHATESTVALUE)
discard;
#endif
#ifndef ALPHABLEND
alpha=1.0;
#endif
#endif
#endif
outParams.surfaceAlbedo=surfaceAlbedo;outParams.alpha=alpha;return outParams;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockAlbedoOpacity_name] = pbrBlockAlbedoOpacity_shader;
/** @internal */
const pbrBlockAlbedoOpacity = { name: pbrBlockAlbedoOpacity_name, shader: pbrBlockAlbedoOpacity_shader };
//# sourceMappingURL=pbrBlockAlbedoOpacity.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectivity.js
// Do not edit.

const pbrBlockReflectivity_name = "pbrBlockReflectivity";
const pbrBlockReflectivity_shader = `struct reflectivityOutParams
{float microSurface;float roughness;vec3 surfaceReflectivityColor;
#ifdef METALLICWORKFLOW
vec3 surfaceAlbedo;
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
vec3 ambientOcclusionColor;
#endif
#if DEBUGMODE>0
#ifdef METALLICWORKFLOW
vec2 metallicRoughness;
#ifdef REFLECTIVITY
vec4 surfaceMetallicColorMap;
#endif
#ifndef FROSTBITE_REFLECTANCE
vec3 metallicF0;
#endif
#else
#ifdef REFLECTIVITY
vec4 surfaceReflectivityColorMap;
#endif
#endif
#endif
};
#define pbr_inline
reflectivityOutParams reflectivityBlock(
in vec4 vReflectivityColor
#ifdef METALLICWORKFLOW
,in vec3 surfaceAlbedo
,in vec4 metallicReflectanceFactors
#endif
#ifdef REFLECTIVITY
,in vec3 reflectivityInfos
,in vec4 surfaceMetallicOrReflectivityColorMap
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
,in vec3 ambientOcclusionColorIn
#endif
#ifdef MICROSURFACEMAP
,in vec4 microSurfaceTexel
#endif
#ifdef DETAIL
,in vec4 detailColor
,in vec4 vDetailInfos
#endif
)
{reflectivityOutParams outParams;float microSurface=vReflectivityColor.a;vec3 surfaceReflectivityColor=vReflectivityColor.rgb;
#ifdef METALLICWORKFLOW
vec2 metallicRoughness=surfaceReflectivityColor.rg;
#ifdef REFLECTIVITY
#if DEBUGMODE>0
outParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;
#endif
#ifdef AOSTOREINMETALMAPRED
vec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);outParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);
#endif
#ifdef METALLNESSSTOREINMETALMAPBLUE
metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;
#else
metallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;
#endif
#ifdef ROUGHNESSSTOREINMETALMAPALPHA
metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;
#else
#ifdef ROUGHNESSSTOREINMETALMAPGREEN
metallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;
#endif
#endif
#endif
#ifdef DETAIL
float detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);float loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);float hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);metallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));
#endif
#ifdef MICROSURFACEMAP
metallicRoughness.g*=microSurfaceTexel.r;
#endif
#if DEBUGMODE>0
outParams.metallicRoughness=metallicRoughness;
#endif
#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS
microSurface=1.0-metallicRoughness.g;vec3 baseColor=surfaceAlbedo;
#ifdef FROSTBITE_REFLECTANCE
outParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);surfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);
#else
vec3 metallicF0=metallicReflectanceFactors.rgb;
#if DEBUGMODE>0
outParams.metallicF0=metallicF0;
#endif
outParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0),vec3(0.,0.,0.),metallicRoughness.r);surfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);
#endif
#else
#ifdef REFLECTIVITY
surfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;
#if DEBUGMODE>0
outParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;
#endif
#ifdef MICROSURFACEFROMREFLECTIVITYMAP
microSurface*=surfaceMetallicOrReflectivityColorMap.a;microSurface*=reflectivityInfos.z;
#else
#ifdef MICROSURFACEAUTOMATIC
microSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);
#endif
#ifdef MICROSURFACEMAP
microSurface*=microSurfaceTexel.r;
#endif
#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE
#endif
#endif
#endif
microSurface=saturate(microSurface);float roughness=1.-microSurface;outParams.microSurface=microSurface;outParams.roughness=roughness;outParams.surfaceReflectivityColor=surfaceReflectivityColor;return outParams;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockReflectivity_name] = pbrBlockReflectivity_shader;
/** @internal */
const pbrBlockReflectivity = { name: pbrBlockReflectivity_name, shader: pbrBlockReflectivity_shader };
//# sourceMappingURL=pbrBlockReflectivity.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAmbientOcclusion.js
// Do not edit.

const pbrBlockAmbientOcclusion_name = "pbrBlockAmbientOcclusion";
const pbrBlockAmbientOcclusion_shader = `struct ambientOcclusionOutParams
{vec3 ambientOcclusionColor;
#if DEBUGMODE>0 && defined(AMBIENT)
vec3 ambientOcclusionColorMap;
#endif
};ambientOcclusionOutParams ambientOcclusionBlock(
#ifdef AMBIENT
in vec3 ambientOcclusionColorMap_,
in vec4 vAmbientInfos
#endif
)
{ambientOcclusionOutParams outParams;vec3 ambientOcclusionColor=vec3(1.,1.,1.);
#ifdef AMBIENT
vec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*vAmbientInfos.y;
#ifdef AMBIENTINGRAYSCALE
ambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);
#endif
ambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);
#if DEBUGMODE>0
outParams.ambientOcclusionColorMap=ambientOcclusionColorMap;
#endif
#endif
outParams.ambientOcclusionColor=ambientOcclusionColor;return outParams;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockAmbientOcclusion_name] = pbrBlockAmbientOcclusion_shader;
/** @internal */
const pbrBlockAmbientOcclusion = { name: pbrBlockAmbientOcclusion_name, shader: pbrBlockAmbientOcclusion_shader };
//# sourceMappingURL=pbrBlockAmbientOcclusion.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAlphaFresnel.js
// Do not edit.

const pbrBlockAlphaFresnel_name = "pbrBlockAlphaFresnel";
const pbrBlockAlphaFresnel_shader = `#ifdef ALPHAFRESNEL
#if defined(ALPHATEST) || defined(ALPHABLEND)
struct alphaFresnelOutParams
{float alpha;};
#define pbr_inline
alphaFresnelOutParams alphaFresnelBlock(
in vec3 normalW,
in vec3 viewDirectionW,
in float alpha,
in float microSurface
)
{alphaFresnelOutParams outParams;float opacityPerceptual=alpha;
#ifdef LINEARALPHAFRESNEL
float opacity0=opacityPerceptual;
#else
float opacity0=opacityPerceptual*opacityPerceptual;
#endif
float opacity90=fresnelGrazingReflectance(opacity0);vec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);outParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;
#ifdef ALPHATEST
if (outParams.alpha<ALPHATESTVALUE)
discard;
#ifndef ALPHABLEND
outParams.alpha=1.0;
#endif
#endif
return outParams;}
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockAlphaFresnel_name] = pbrBlockAlphaFresnel_shader;
/** @internal */
const pbrBlockAlphaFresnel = { name: pbrBlockAlphaFresnel_name, shader: pbrBlockAlphaFresnel_shader };
//# sourceMappingURL=pbrBlockAlphaFresnel.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAnisotropic.js
// Do not edit.

const pbrBlockAnisotropic_name = "pbrBlockAnisotropic";
const pbrBlockAnisotropic_shader = `#ifdef ANISOTROPIC
struct anisotropicOutParams
{float anisotropy;vec3 anisotropicTangent;vec3 anisotropicBitangent;vec3 anisotropicNormal;
#if DEBUGMODE>0 && defined(ANISOTROPIC_TEXTURE)
vec3 anisotropyMapData;
#endif
};
#define pbr_inline
anisotropicOutParams anisotropicBlock(
in vec3 vAnisotropy,
in float roughness,
#ifdef ANISOTROPIC_TEXTURE
in vec3 anisotropyMapData,
#endif
in mat3 TBN,
in vec3 normalW,
in vec3 viewDirectionW
)
{anisotropicOutParams outParams;float anisotropy=vAnisotropy.b;vec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);
#ifdef ANISOTROPIC_TEXTURE
anisotropy*=anisotropyMapData.b;
#if DEBUGMODE>0
outParams.anisotropyMapData=anisotropyMapData;
#endif
anisotropyMapData.rg=anisotropyMapData.rg*2.0-1.0;
#ifdef ANISOTROPIC_LEGACY
anisotropyDirection.rg*=anisotropyMapData.rg;
#else
anisotropyDirection.xy=mat2(anisotropyDirection.x,anisotropyDirection.y,-anisotropyDirection.y,anisotropyDirection.x)*normalize(anisotropyMapData.rg);
#endif
#endif
mat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));vec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);vec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));outParams.anisotropy=anisotropy;outParams.anisotropicTangent=anisotropicTangent;outParams.anisotropicBitangent=anisotropicBitangent;outParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy,roughness);return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockAnisotropic_name] = pbrBlockAnisotropic_shader;
/** @internal */
const pbrBlockAnisotropic = { name: pbrBlockAnisotropic_name, shader: pbrBlockAnisotropic_shader };
//# sourceMappingURL=pbrBlockAnisotropic.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflection.js
// Do not edit.

const pbrBlockReflection_name = "pbrBlockReflection";
const pbrBlockReflection_shader = `#ifdef REFLECTION
struct reflectionOutParams
{vec4 environmentRadiance;vec3 environmentIrradiance;
#ifdef REFLECTIONMAP_3D
vec3 reflectionCoords;
#else
vec2 reflectionCoords;
#endif
#ifdef SS_TRANSLUCENCY
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
vec3 irradianceVector;
#endif
#endif
#endif
};
#define pbr_inline
void createReflectionCoords(
in vec3 vPositionW,
in vec3 normalW,
#ifdef ANISOTROPIC
in anisotropicOutParams anisotropicOut,
#endif
#ifdef REFLECTIONMAP_3D
out vec3 reflectionCoords
#else
out vec2 reflectionCoords
#endif
)
{
#ifdef ANISOTROPIC
vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal);
#else
vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
reflectionCoords=reflectionVector;
#else
reflectionCoords=reflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
reflectionCoords/=reflectionVector.z;
#endif
reflectionCoords.y=1.0-reflectionCoords.y;
#endif
}
#define pbr_inline
#define inline
void sampleReflectionTexture(
in float alphaG,
in vec3 vReflectionMicrosurfaceInfos,
in vec2 vReflectionInfos,
in vec3 vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
in float NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
in float roughness,
#endif
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSampler,
const vec3 reflectionCoords,
#else
in sampler2D reflectionSampler,
const vec2 reflectionCoords,
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
in samplerCube reflectionSamplerLow,
in samplerCube reflectionSamplerHigh,
#else
in sampler2D reflectionSamplerLow,
in sampler2D reflectionSamplerHigh,
#endif
#endif
#ifdef REALTIME_FILTERING
in vec2 vReflectionFilteringInfo,
#endif
out vec4 environmentRadiance
)
{
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);
#elif defined(LINEARSPECULARREFLECTION)
float reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);
#else
float reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);
#endif
#ifdef LODBASEDMICROSFURACE
reflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;
#ifdef LODINREFLECTIONALPHA
float automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);float requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);
#else
float requestedReflectionLOD=reflectionLOD;
#endif
#ifdef REALTIME_FILTERING
environmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);
#else
environmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);
#endif
#else
float lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix(
sampleReflection(reflectionSamplerHigh,reflectionCoords),
environmentMid,
lodReflectionNormalizedDoubled
);} else {environmentRadiance=mix(
environmentMid,
sampleReflection(reflectionSamplerLow,reflectionCoords),
lodReflectionNormalizedDoubled-1.0
);}
#endif
#ifdef RGBDREFLECTION
environmentRadiance.rgb=fromRGBD(environmentRadiance);
#endif
#ifdef GAMMAREFLECTION
environmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);
#endif
environmentRadiance.rgb*=vReflectionInfos.x;environmentRadiance.rgb*=vReflectionColor.rgb;}
#define pbr_inline
#define inline
reflectionOutParams reflectionBlock(
in vec3 vPositionW
,in vec3 normalW
,in float alphaG
,in vec3 vReflectionMicrosurfaceInfos
,in vec2 vReflectionInfos
,in vec3 vReflectionColor
#ifdef ANISOTROPIC
,in anisotropicOutParams anisotropicOut
#endif
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
,in float NdotVUnclamped
#endif
#ifdef LINEARSPECULARREFLECTION
,in float roughness
#endif
#ifdef REFLECTIONMAP_3D
,in samplerCube reflectionSampler
#else
,in sampler2D reflectionSampler
#endif
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
,in vec3 vEnvironmentIrradiance
#endif
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
,in mat4 reflectionMatrix
#endif
#endif
#ifdef USEIRRADIANCEMAP
#ifdef REFLECTIONMAP_3D
,in samplerCube irradianceSampler
#else
,in sampler2D irradianceSampler
#endif
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
,in samplerCube reflectionSamplerLow
,in samplerCube reflectionSamplerHigh
#else
,in sampler2D reflectionSamplerLow
,in sampler2D reflectionSamplerHigh
#endif
#endif
#ifdef REALTIME_FILTERING
,in vec2 vReflectionFilteringInfo
#endif
)
{reflectionOutParams outParams;vec4 environmentRadiance=vec4(0.,0.,0.,0.);
#ifdef REFLECTIONMAP_3D
vec3 reflectionCoords=vec3(0.);
#else
vec2 reflectionCoords=vec2(0.);
#endif
createReflectionCoords(
vPositionW,
normalW,
#ifdef ANISOTROPIC
anisotropicOut,
#endif
reflectionCoords
);sampleReflectionTexture(
alphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
roughness,
#endif
#ifdef REFLECTIONMAP_3D
reflectionSampler,
reflectionCoords,
#else
reflectionSampler,
reflectionCoords,
#endif
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
environmentRadiance
);vec3 environmentIrradiance=vec3(0.,0.,0.);
#ifdef USESPHERICALFROMREFLECTIONMAP
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
environmentIrradiance=vEnvironmentIrradiance;
#else
#ifdef ANISOTROPIC
vec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz;
#else
vec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;
#endif
#ifdef REFLECTIONMAP_OPPOSITEZ
irradianceVector.z*=-1.0;
#endif
#ifdef INVERTCUBICMAP
irradianceVector.y*=-1.0;
#endif
#if defined(REALTIME_FILTERING)
environmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo);
#else
environmentIrradiance=computeEnvironmentIrradiance(irradianceVector);
#endif
#ifdef SS_TRANSLUCENCY
outParams.irradianceVector=irradianceVector;
#endif
#endif
#elif defined(USEIRRADIANCEMAP)
vec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords);environmentIrradiance=environmentIrradiance4.rgb;
#ifdef RGBDREFLECTION
environmentIrradiance.rgb=fromRGBD(environmentIrradiance4);
#endif
#ifdef GAMMAREFLECTION
environmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);
#endif
#endif
environmentIrradiance*=vReflectionColor.rgb;outParams.environmentRadiance=environmentRadiance;outParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockReflection_name] = pbrBlockReflection_shader;
/** @internal */
const pbrBlockReflection = { name: pbrBlockReflection_name, shader: pbrBlockReflection_shader };
//# sourceMappingURL=pbrBlockReflection.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockSheen.js
// Do not edit.

const pbrBlockSheen_name = "pbrBlockSheen";
const pbrBlockSheen_shader = `#ifdef SHEEN
struct sheenOutParams
{float sheenIntensity;vec3 sheenColor;float sheenRoughness;
#ifdef SHEEN_LINKWITHALBEDO
vec3 surfaceAlbedo;
#endif
#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
float sheenAlbedoScaling;
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
vec3 finalSheenRadianceScaled;
#endif
#if DEBUGMODE>0
#ifdef SHEEN_TEXTURE
vec4 sheenMapData;
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
vec3 sheenEnvironmentReflectance;
#endif
#endif
};
#define pbr_inline
#define inline
sheenOutParams sheenBlock(
in vec4 vSheenColor
#ifdef SHEEN_ROUGHNESS
,in float vSheenRoughness
#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
,in vec4 sheenMapRoughnessData
#endif
#endif
,in float roughness
#ifdef SHEEN_TEXTURE
,in vec4 sheenMapData
,in float sheenMapLevel
#endif
,in float reflectance
#ifdef SHEEN_LINKWITHALBEDO
,in vec3 baseColor
,in vec3 surfaceAlbedo
#endif
#ifdef ENVIRONMENTBRDF
,in float NdotV
,in vec3 environmentBrdf
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
,in vec2 AARoughnessFactors
,in vec3 vReflectionMicrosurfaceInfos
,in vec2 vReflectionInfos
,in vec3 vReflectionColor
,in vec4 vLightingIntensity
#ifdef REFLECTIONMAP_3D
,in samplerCube reflectionSampler
,in vec3 reflectionCoords
#else
,in sampler2D reflectionSampler
,in vec2 reflectionCoords
#endif
,in float NdotVUnclamped
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
,in samplerCube reflectionSamplerLow
,in samplerCube reflectionSamplerHigh
#else
,in sampler2D reflectionSamplerLow
,in sampler2D reflectionSamplerHigh
#endif
#endif
#ifdef REALTIME_FILTERING
,in vec2 vReflectionFilteringInfo
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
,in float seo
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
,in float eho
#endif
#endif
)
{sheenOutParams outParams;float sheenIntensity=vSheenColor.a;
#ifdef SHEEN_TEXTURE
#if DEBUGMODE>0
outParams.sheenMapData=sheenMapData;
#endif
#endif
#ifdef SHEEN_LINKWITHALBEDO
float sheenFactor=pow5(1.0-sheenIntensity);vec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);float sheenRoughness=sheenIntensity;outParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;
#ifdef SHEEN_TEXTURE
sheenIntensity*=sheenMapData.a;
#endif
#else
vec3 sheenColor=vSheenColor.rgb;
#ifdef SHEEN_TEXTURE
#ifdef SHEEN_GAMMATEXTURE
sheenColor.rgb*=toLinearSpace(sheenMapData.rgb);
#else
sheenColor.rgb*=sheenMapData.rgb;
#endif
sheenColor.rgb*=sheenMapLevel;
#endif
#ifdef SHEEN_ROUGHNESS
float sheenRoughness=vSheenRoughness;
#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE
#if defined(SHEEN_TEXTURE)
sheenRoughness*=sheenMapData.a;
#endif
#elif defined(SHEEN_TEXTURE_ROUGHNESS)
sheenRoughness*=sheenMapRoughnessData.a;
#endif
#else
float sheenRoughness=roughness;
#ifdef SHEEN_TEXTURE
sheenIntensity*=sheenMapData.a;
#endif
#endif
#if !defined(SHEEN_ALBEDOSCALING)
sheenIntensity*=(1.-reflectance);
#endif
sheenColor*=sheenIntensity;
#endif
#ifdef ENVIRONMENTBRDF
/*#ifdef SHEEN_SOFTER
vec3 environmentSheenBrdf=vec3(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness));
#else*/
#ifdef SHEEN_ROUGHNESS
vec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);
#else
vec3 environmentSheenBrdf=environmentBrdf;
#endif
/*#endif*/
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
float sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);
#ifdef SPECULARAA
sheenAlphaG+=AARoughnessFactors.y;
#endif
vec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);sampleReflectionTexture(
sheenAlphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
NdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
sheenRoughness,
#endif
reflectionSampler,
reflectionCoords,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
environmentSheenRadiance
);vec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
sheenEnvironmentReflectance*=seo;
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
sheenEnvironmentReflectance*=eho;
#endif
#if DEBUGMODE>0
outParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;
#endif
outParams.finalSheenRadianceScaled=
environmentSheenRadiance.rgb *
sheenEnvironmentReflectance *
vLightingIntensity.z;
#endif
#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
outParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;
#endif
outParams.sheenIntensity=sheenIntensity;outParams.sheenColor=sheenColor;outParams.sheenRoughness=sheenRoughness;return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockSheen_name] = pbrBlockSheen_shader;
/** @internal */
const pbrBlockSheen = { name: pbrBlockSheen_name, shader: pbrBlockSheen_shader };
//# sourceMappingURL=pbrBlockSheen.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockClearcoat.js
// Do not edit.

const pbrBlockClearcoat_name = "pbrBlockClearcoat";
const pbrBlockClearcoat_shader = `struct clearcoatOutParams
{vec3 specularEnvironmentR0;float conservationFactor;vec3 clearCoatNormalW;vec2 clearCoatAARoughnessFactors;float clearCoatIntensity;float clearCoatRoughness;
#ifdef REFLECTION
vec3 finalClearCoatRadianceScaled;
#endif
#ifdef CLEARCOAT_TINT
vec3 absorption;float clearCoatNdotVRefract;vec3 clearCoatColor;float clearCoatThickness;
#endif
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
vec3 energyConservationFactorClearCoat;
#endif
#if DEBUGMODE>0
#ifdef CLEARCOAT_BUMP
mat3 TBNClearCoat;
#endif
#ifdef CLEARCOAT_TEXTURE
vec2 clearCoatMapData;
#endif
#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
vec4 clearCoatTintMapData;
#endif
#ifdef REFLECTION
vec4 environmentClearCoatRadiance;vec3 clearCoatEnvironmentReflectance;
#endif
float clearCoatNdotV;
#endif
};
#ifdef CLEARCOAT
#define pbr_inline
#define inline
clearcoatOutParams clearcoatBlock(
in vec3 vPositionW
,in vec3 geometricNormalW
,in vec3 viewDirectionW
,in vec2 vClearCoatParams
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
,in vec4 clearCoatMapRoughnessData
#endif
,in vec3 specularEnvironmentR0
#ifdef CLEARCOAT_TEXTURE
,in vec2 clearCoatMapData
#endif
#ifdef CLEARCOAT_TINT
,in vec4 vClearCoatTintParams
,in float clearCoatColorAtDistance
,in vec4 vClearCoatRefractionParams
#ifdef CLEARCOAT_TINT_TEXTURE
,in vec4 clearCoatTintMapData
#endif
#endif
#ifdef CLEARCOAT_BUMP
,in vec2 vClearCoatBumpInfos
,in vec4 clearCoatBumpMapData
,in vec2 vClearCoatBumpUV
#if defined(TANGENT) && defined(NORMAL)
,in mat3 vTBN
#else
,in vec2 vClearCoatTangentSpaceParams
#endif
#ifdef OBJECTSPACE_NORMALMAP
,in mat4 normalMatrix
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
,in vec3 faceNormal
#endif
#ifdef REFLECTION
,in vec3 vReflectionMicrosurfaceInfos
,in vec2 vReflectionInfos
,in vec3 vReflectionColor
,in vec4 vLightingIntensity
#ifdef REFLECTIONMAP_3D
,in samplerCube reflectionSampler
#else
,in sampler2D reflectionSampler
#endif
#ifndef LODBASEDMICROSFURACE
#ifdef REFLECTIONMAP_3D
,in samplerCube reflectionSamplerLow
,in samplerCube reflectionSamplerHigh
#else
,in sampler2D reflectionSamplerLow
,in sampler2D reflectionSamplerHigh
#endif
#endif
#ifdef REALTIME_FILTERING
,in vec2 vReflectionFilteringInfo
#endif
#endif
#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
,in float frontFacingMultiplier
#endif
)
{clearcoatOutParams outParams;float clearCoatIntensity=vClearCoatParams.x;float clearCoatRoughness=vClearCoatParams.y;
#ifdef CLEARCOAT_TEXTURE
clearCoatIntensity*=clearCoatMapData.x;
#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE
clearCoatRoughness*=clearCoatMapData.y;
#endif
#if DEBUGMODE>0
outParams.clearCoatMapData=clearCoatMapData;
#endif
#endif
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
clearCoatRoughness*=clearCoatMapRoughnessData.y;
#endif
outParams.clearCoatIntensity=clearCoatIntensity;outParams.clearCoatRoughness=clearCoatRoughness;
#ifdef CLEARCOAT_TINT
vec3 clearCoatColor=vClearCoatTintParams.rgb;float clearCoatThickness=vClearCoatTintParams.a;
#ifdef CLEARCOAT_TINT_TEXTURE
#ifdef CLEARCOAT_TINT_GAMMATEXTURE
clearCoatColor*=toLinearSpace(clearCoatTintMapData.rgb);
#else
clearCoatColor*=clearCoatTintMapData.rgb;
#endif
clearCoatThickness*=clearCoatTintMapData.a;
#if DEBUGMODE>0
outParams.clearCoatTintMapData=clearCoatTintMapData;
#endif
#endif
outParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);outParams.clearCoatThickness=clearCoatThickness;
#endif
#ifdef CLEARCOAT_REMAP_F0
vec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);
#else
vec3 specularEnvironmentR0Updated=specularEnvironmentR0;
#endif
outParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);vec3 clearCoatNormalW=geometricNormalW;
#ifdef CLEARCOAT_BUMP
#ifdef NORMALXYSCALE
float clearCoatNormalScale=1.0;
#else
float clearCoatNormalScale=vClearCoatBumpInfos.y;
#endif
#if defined(TANGENT) && defined(NORMAL)
mat3 TBNClearCoat=vTBN;
#else
vec2 TBNClearCoatUV=vClearCoatBumpUV*frontFacingMultiplier;mat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams);
#endif
#if DEBUGMODE>0
outParams.TBNClearCoat=TBNClearCoat;
#endif
#ifdef OBJECTSPACE_NORMALMAP
clearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);clearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);
#else
clearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
clearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));
#endif
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
clearCoatNormalW=clearCoatNormalW*frontFacingMultiplier;
#endif
outParams.clearCoatNormalW=clearCoatNormalW;outParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);float clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);float clearCoatNdotV=absEps(clearCoatNdotVUnclamped);
#if DEBUGMODE>0
outParams.clearCoatNdotV=clearCoatNdotV;
#endif
#ifdef CLEARCOAT_TINT
vec3 clearCoatVRefract=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);outParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));
#endif
#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION))
vec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);
#endif
#if defined(REFLECTION)
float clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);
#ifdef SPECULARAA
clearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;
#endif
vec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);vec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);
#ifdef REFLECTIONMAP_OPPOSITEZ
clearCoatReflectionVector.z*=-1.0;
#endif
#ifdef REFLECTIONMAP_3D
vec3 clearCoatReflectionCoords=clearCoatReflectionVector;
#else
vec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
clearCoatReflectionCoords/=clearCoatReflectionVector.z;
#endif
clearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;
#endif
sampleReflectionTexture(
clearCoatAlphaG,
vReflectionMicrosurfaceInfos,
vReflectionInfos,
vReflectionColor,
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
clearCoatNdotVUnclamped,
#endif
#ifdef LINEARSPECULARREFLECTION
clearCoatRoughness,
#endif
reflectionSampler,
clearCoatReflectionCoords,
#ifndef LODBASEDMICROSFURACE
reflectionSamplerLow,
reflectionSamplerHigh,
#endif
#ifdef REALTIME_FILTERING
vReflectionFilteringInfo,
#endif
environmentClearCoatRadiance
);
#if DEBUGMODE>0
outParams.environmentClearCoatRadiance=environmentClearCoatRadiance;
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
vec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
float clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);clearCoatEnvironmentReflectance*=clearCoatEho;
#endif
#endif
#endif
#else
vec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));
#endif
clearCoatEnvironmentReflectance*=clearCoatIntensity;
#if DEBUGMODE>0
outParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;
#endif
outParams.finalClearCoatRadianceScaled=
environmentClearCoatRadiance.rgb *
clearCoatEnvironmentReflectance *
vLightingIntensity.z;
#endif
#if defined(CLEARCOAT_TINT)
outParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);
#endif
float fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnelIBLClearCoat*=clearCoatIntensity;outParams.conservationFactor=(1.-fresnelIBLClearCoat);
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
outParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);
#endif
return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockClearcoat_name] = pbrBlockClearcoat_shader;
/** @internal */
const pbrBlockClearcoat = { name: pbrBlockClearcoat_name, shader: pbrBlockClearcoat_shader };
//# sourceMappingURL=pbrBlockClearcoat.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockIridescence.js
// Do not edit.

const pbrBlockIridescence_name = "pbrBlockIridescence";
const pbrBlockIridescence_shader = `struct iridescenceOutParams
{float iridescenceIntensity;float iridescenceIOR;float iridescenceThickness;vec3 specularEnvironmentR0;};
#ifdef IRIDESCENCE
#define pbr_inline
#define inline
iridescenceOutParams iridescenceBlock(
in vec4 vIridescenceParams
,in float viewAngle
,in vec3 specularEnvironmentR0
#ifdef IRIDESCENCE_TEXTURE
,in vec2 iridescenceMapData
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
,in vec2 iridescenceThicknessMapData
#endif
#ifdef CLEARCOAT
,in float NdotVUnclamped
#ifdef CLEARCOAT_TEXTURE
,in vec2 clearCoatMapData
#endif
#endif
)
{iridescenceOutParams outParams;float iridescenceIntensity=vIridescenceParams.x;float iridescenceIOR=vIridescenceParams.y;float iridescenceThicknessMin=vIridescenceParams.z;float iridescenceThicknessMax=vIridescenceParams.w;float iridescenceThicknessWeight=1.;
#ifdef IRIDESCENCE_TEXTURE
iridescenceIntensity*=iridescenceMapData.x;
#endif
#if defined(IRIDESCENCE_THICKNESS_TEXTURE)
iridescenceThicknessWeight=iridescenceThicknessMapData.g;
#endif
float iridescenceThickness=mix(iridescenceThicknessMin,iridescenceThicknessMax,iridescenceThicknessWeight);float topIor=1.; 
#ifdef CLEARCOAT
float clearCoatIntensity=vClearCoatParams.x;
#ifdef CLEARCOAT_TEXTURE
clearCoatIntensity*=clearCoatMapData.x;
#endif
topIor=mix(1.0,vClearCoatRefractionParams.w-1.,clearCoatIntensity);viewAngle=sqrt(1.0+square(1.0/topIor)*(square(NdotVUnclamped)-1.0));
#endif
vec3 iridescenceFresnel=evalIridescence(topIor,iridescenceIOR,viewAngle,iridescenceThickness,specularEnvironmentR0);outParams.specularEnvironmentR0=mix(specularEnvironmentR0,iridescenceFresnel,iridescenceIntensity);outParams.iridescenceIntensity=iridescenceIntensity;outParams.iridescenceThickness=iridescenceThickness;outParams.iridescenceIOR=iridescenceIOR;return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockIridescence_name] = pbrBlockIridescence_shader;
/** @internal */
const pbrBlockIridescence = { name: pbrBlockIridescence_name, shader: pbrBlockIridescence_shader };
//# sourceMappingURL=pbrBlockIridescence.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockSubSurface.js
// Do not edit.

const pbrBlockSubSurface_name = "pbrBlockSubSurface";
const pbrBlockSubSurface_shader = `struct subSurfaceOutParams
{vec3 specularEnvironmentReflectance;
#ifdef SS_REFRACTION
vec3 finalRefraction;vec3 surfaceAlbedo;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
float alpha;
#endif
#ifdef REFLECTION
float refractionFactorForIrradiance;
#endif
#endif
#ifdef SS_TRANSLUCENCY
vec3 transmittance;float translucencyIntensity;
#ifdef REFLECTION
vec3 refractionIrradiance;
#endif
#endif
#if DEBUGMODE>0
#ifdef SS_THICKNESSANDMASK_TEXTURE
vec4 thicknessMap;
#endif
#ifdef SS_REFRACTION
vec4 environmentRefraction;vec3 refractionTransmittance;
#endif
#endif
};
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
#define pbr_inline
#define inline
vec4 sampleEnvironmentRefraction(
in float ior
,in float thickness
,in float refractionLOD
,in vec3 normalW
,in vec3 vPositionW
,in vec3 viewDirectionW
,in mat4 view
,in vec4 vRefractionInfos
,in mat4 refractionMatrix
,in vec4 vRefractionMicrosurfaceInfos
,in float alphaG
#ifdef SS_REFRACTIONMAP_3D
,in samplerCube refractionSampler
#ifndef LODBASEDMICROSFURACE
,in samplerCube refractionSamplerLow
,in samplerCube refractionSamplerHigh
#endif
#else
,in sampler2D refractionSampler
#ifndef LODBASEDMICROSFURACE
,in sampler2D refractionSamplerLow
,in sampler2D refractionSamplerHigh
#endif
#endif
#ifdef ANISOTROPIC
,in anisotropicOutParams anisotropicOut
#endif
#ifdef REALTIME_FILTERING
,in vec2 vRefractionFilteringInfo
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,in vec3 refractionPosition
,in vec3 refractionSize
#endif
) {vec4 environmentRefraction=vec4(0.,0.,0.,0.);
#ifdef ANISOTROPIC
vec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,ior);
#else
vec3 refractionVector=refract(-viewDirectionW,normalW,ior);
#endif
#ifdef SS_REFRACTIONMAP_OPPOSITEZ
refractionVector.z*=-1.0;
#endif
#ifdef SS_REFRACTIONMAP_3D
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
refractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition);
#endif
refractionVector.y=refractionVector.y*vRefractionInfos.w;vec3 refractionCoords=refractionVector;refractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));
#else
#ifdef SS_USE_THICKNESS_AS_DEPTH
vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*thickness,1.0)));
#else
vec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));
#endif
vec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;
#endif
#ifdef LODBASEDMICROSFURACE
refractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;
#ifdef SS_LODINREFRACTIONALPHA
float automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);float requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);
#else
float requestedRefractionLOD=refractionLOD;
#endif
#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D)
environmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);
#else
environmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);
#endif
#else
float lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));float lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;vec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);if (lodRefractionNormalizedDoubled<1.0){environmentRefraction=mix(
sampleRefraction(refractionSamplerHigh,refractionCoords),
environmentRefractionMid,
lodRefractionNormalizedDoubled
);} else {environmentRefraction=mix(
environmentRefractionMid,
sampleRefraction(refractionSamplerLow,refractionCoords),
lodRefractionNormalizedDoubled-1.0
);}
#endif
#ifdef SS_RGBDREFRACTION
environmentRefraction.rgb=fromRGBD(environmentRefraction);
#endif
#ifdef SS_GAMMAREFRACTION
environmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);
#endif
return environmentRefraction;}
#endif
#define pbr_inline
#define inline
subSurfaceOutParams subSurfaceBlock(
in vec3 vSubSurfaceIntensity
,in vec2 vThicknessParam
,in vec4 vTintColor
,in vec3 normalW
,in vec3 specularEnvironmentReflectance
#ifdef SS_THICKNESSANDMASK_TEXTURE
,in vec4 thicknessMap
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
,in vec4 refractionIntensityMap
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
,in vec4 translucencyIntensityMap
#endif
#ifdef REFLECTION
#ifdef SS_TRANSLUCENCY
,in mat4 reflectionMatrix
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
,in vec3 irradianceVector_
#endif
#if defined(REALTIME_FILTERING)
,in samplerCube reflectionSampler
,in vec2 vReflectionFilteringInfo
#endif
#endif
#ifdef USEIRRADIANCEMAP
#ifdef REFLECTIONMAP_3D
,in samplerCube irradianceSampler
#else
,in sampler2D irradianceSampler
#endif
#endif
#endif
#endif
#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
,in vec3 surfaceAlbedo
#endif
#ifdef SS_REFRACTION
,in vec3 vPositionW
,in vec3 viewDirectionW
,in mat4 view
,in vec4 vRefractionInfos
,in mat4 refractionMatrix
,in vec4 vRefractionMicrosurfaceInfos
,in vec4 vLightingIntensity
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
,in float alpha
#endif
#ifdef SS_LODINREFRACTIONALPHA
,in float NdotVUnclamped
#endif
#ifdef SS_LINEARSPECULARREFRACTION
,in float roughness
#endif
,in float alphaG
#ifdef SS_REFRACTIONMAP_3D
,in samplerCube refractionSampler
#ifndef LODBASEDMICROSFURACE
,in samplerCube refractionSamplerLow
,in samplerCube refractionSamplerHigh
#endif
#else
,in sampler2D refractionSampler
#ifndef LODBASEDMICROSFURACE
,in sampler2D refractionSamplerLow
,in sampler2D refractionSamplerHigh
#endif
#endif
#ifdef ANISOTROPIC
,in anisotropicOutParams anisotropicOut
#endif
#ifdef REALTIME_FILTERING
,in vec2 vRefractionFilteringInfo
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,in vec3 refractionPosition
,in vec3 refractionSize
#endif
#ifdef SS_DISPERSION
,in float dispersion
#endif
#endif
#ifdef SS_TRANSLUCENCY
,in vec3 vDiffusionDistance
,in vec4 vTranslucencyColor
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
,in vec4 translucencyColorMap
#endif
#endif
)
{subSurfaceOutParams outParams;outParams.specularEnvironmentReflectance=specularEnvironmentReflectance;
#ifdef SS_REFRACTION
float refractionIntensity=vSubSurfaceIntensity.x;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
refractionIntensity*=(1.0-alpha);outParams.alpha=1.0;
#endif
#endif
#ifdef SS_TRANSLUCENCY
float translucencyIntensity=vSubSurfaceIntensity.y;
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
#ifdef SS_USE_GLTF_TEXTURES
float thickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;
#else
float thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;
#endif
#if DEBUGMODE>0
outParams.thicknessMap=thicknessMap;
#endif
#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS)
#ifdef SS_USE_GLTF_TEXTURES
refractionIntensity*=thicknessMap.r;
#else
refractionIntensity*=thicknessMap.g;
#endif
#endif
#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS)
#ifdef SS_USE_GLTF_TEXTURES
translucencyIntensity*=thicknessMap.a;
#else
translucencyIntensity*=thicknessMap.b;
#endif
#endif
#else
float thickness=vThicknessParam.y;
#endif
#if defined(SS_REFRACTION) && defined(SS_REFRACTIONINTENSITY_TEXTURE)
#ifdef SS_USE_GLTF_TEXTURES
refractionIntensity*=refractionIntensityMap.r;
#else
refractionIntensity*=refractionIntensityMap.g;
#endif
#endif
#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCYINTENSITY_TEXTURE)
#ifdef SS_USE_GLTF_TEXTURES
translucencyIntensity*=translucencyIntensityMap.a;
#else
translucencyIntensity*=translucencyIntensityMap.b;
#endif
#endif
#ifdef SS_TRANSLUCENCY
thickness=maxEps(thickness);vec4 translucencyColor=vTranslucencyColor;
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
translucencyColor*=translucencyColorMap;
#endif
vec3 transmittance=transmittanceBRDF_Burley(translucencyColor.rgb,vDiffusionDistance,thickness);transmittance*=translucencyIntensity;outParams.transmittance=transmittance;outParams.translucencyIntensity=translucencyIntensity;
#endif
#ifdef SS_REFRACTION
vec4 environmentRefraction=vec4(0.,0.,0.,0.);
#ifdef SS_HAS_THICKNESS
float ior=vRefractionInfos.y;
#else
float ior=vRefractionMicrosurfaceInfos.w;
#endif
#ifdef SS_LODINREFRACTIONALPHA
float refractionAlphaG=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped);
#elif defined(SS_LINEARSPECULARREFRACTION)
float refractionRoughness=alphaG;refractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness);
#else
float refractionAlphaG=alphaG;refractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));float refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG);
#endif
float refraction_ior=vRefractionInfos.y;
#ifdef SS_DISPERSION
float realIOR=1.0/refraction_ior;float iorDispersionSpread=0.04*dispersion*(realIOR-1.0);vec3 iors=vec3(1.0/(realIOR-iorDispersionSpread),refraction_ior,1.0/(realIOR+iorDispersionSpread));for (int i=0; i<3; i++) {refraction_ior=iors[i];
#endif
vec4 envSample=sampleEnvironmentRefraction(refraction_ior,thickness,refractionLOD,normalW,vPositionW,viewDirectionW,view,vRefractionInfos,refractionMatrix,vRefractionMicrosurfaceInfos,alphaG
#ifdef SS_REFRACTIONMAP_3D
,refractionSampler
#ifndef LODBASEDMICROSFURACE
,refractionSamplerLow
,refractionSamplerHigh
#endif
#else
,refractionSampler
#ifndef LODBASEDMICROSFURACE
,refractionSamplerLow
,refractionSamplerHigh
#endif
#endif
#ifdef ANISOTROPIC
,anisotropicOut
#endif
#ifdef REALTIME_FILTERING
,vRefractionFilteringInfo
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,refractionPosition
,refractionSize
#endif
);
#ifdef SS_DISPERSION
environmentRefraction[i]=envSample[i];}
#else
environmentRefraction=envSample;
#endif
environmentRefraction.rgb*=vRefractionInfos.x;
#endif
#ifdef SS_REFRACTION
vec3 refractionTransmittance=vec3(refractionIntensity);
#ifdef SS_THICKNESSANDMASK_TEXTURE
vec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambert(volumeAlbedo,thickness);
#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)
float maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);vec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);environmentRefraction.rgb*=volumeAlbedo;
#else
vec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);refractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);
#endif
#ifdef SS_ALBEDOFORREFRACTIONTINT
environmentRefraction.rgb*=surfaceAlbedo.rgb;
#endif
outParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);
#ifdef REFLECTION
outParams.refractionFactorForIrradiance=(1.-refractionIntensity);
#endif
#ifdef UNUSED_MULTIPLEBOUNCES
vec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);outParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);
#endif
refractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;
#if DEBUGMODE>0
outParams.refractionTransmittance=refractionTransmittance;
#endif
outParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;
#if DEBUGMODE>0
outParams.environmentRefraction=environmentRefraction;
#endif
#endif
#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)
#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)
vec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;
#ifdef REFLECTIONMAP_OPPOSITEZ
irradianceVector.z*=-1.0;
#endif
#ifdef INVERTCUBICMAP
irradianceVector.y*=-1.0;
#endif
#else
vec3 irradianceVector=irradianceVector_;
#endif
#if defined(USESPHERICALFROMREFLECTIONMAP)
#if defined(REALTIME_FILTERING)
vec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo);
#else
vec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);
#endif
#elif defined(USEIRRADIANCEMAP)
#ifdef REFLECTIONMAP_3D
vec3 irradianceCoords=irradianceVector;
#else
vec2 irradianceCoords=irradianceVector.xy;
#ifdef REFLECTIONMAP_PROJECTION
irradianceCoords/=irradianceVector.z;
#endif
irradianceCoords.y=1.0-irradianceCoords.y;
#endif
vec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);
#ifdef RGBDREFLECTION
refractionIrradiance.rgb=fromRGBD(refractionIrradiance);
#endif
#ifdef GAMMAREFLECTION
refractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);
#endif
#else
vec4 refractionIrradiance=vec4(0.);
#endif
refractionIrradiance.rgb*=transmittance;
#ifdef SS_ALBEDOFORTRANSLUCENCYTINT
refractionIrradiance.rgb*=surfaceAlbedo.rgb;
#endif
outParams.refractionIrradiance=refractionIrradiance.rgb;
#endif
return outParams;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockSubSurface_name] = pbrBlockSubSurface_shader;
/** @internal */
const pbrBlockSubSurface = { name: pbrBlockSubSurface_name, shader: pbrBlockSubSurface_shader };
//# sourceMappingURL=pbrBlockSubSurface.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(7412);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockNormalGeometric.js
// Do not edit.

const pbrBlockNormalGeometric_name = "pbrBlockNormalGeometric";
const pbrBlockNormalGeometric_shader = `vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
#ifdef NORMAL
vec3 normalW=normalize(vNormalW);
#else
vec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;
#endif
vec3 geometricNormalW=normalW;
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
geometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockNormalGeometric_name] = pbrBlockNormalGeometric_shader;
/** @internal */
const pbrBlockNormalGeometric = { name: pbrBlockNormalGeometric_name, shader: pbrBlockNormalGeometric_shader };
//# sourceMappingURL=pbrBlockNormalGeometric.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js
var bumpFragment = __webpack_require__(27018);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockNormalFinal.js
// Do not edit.

const pbrBlockNormalFinal_name = "pbrBlockNormalFinal";
const pbrBlockNormalFinal_shader = `#if defined(FORCENORMALFORWARD) && defined(NORMAL)
vec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;
#if defined(TWOSIDEDLIGHTING)
faceNormal=gl_FrontFacing ? faceNormal : -faceNormal;
#endif
normalW*=sign(dot(normalW,faceNormal));
#endif
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
normalW=gl_FrontFacing ? normalW : -normalW;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockNormalFinal_name] = pbrBlockNormalFinal_shader;
/** @internal */
const pbrBlockNormalFinal = { name: pbrBlockNormalFinal_name, shader: pbrBlockNormalFinal_shader };
//# sourceMappingURL=pbrBlockNormalFinal.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js
var depthPrePass = __webpack_require__(1037);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockLightmapInit.js
// Do not edit.

const pbrBlockLightmapInit_name = "pbrBlockLightmapInit";
const pbrBlockLightmapInit_shader = `#ifdef LIGHTMAP
vec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);
#ifdef RGBDLIGHTMAP
lightmapColor.rgb=fromRGBD(lightmapColor);
#endif
#ifdef GAMMALIGHTMAP
lightmapColor.rgb=toLinearSpace(lightmapColor.rgb);
#endif
lightmapColor.rgb*=vLightmapInfos.y;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockLightmapInit_name] = pbrBlockLightmapInit_shader;
/** @internal */
const pbrBlockLightmapInit = { name: pbrBlockLightmapInit_name, shader: pbrBlockLightmapInit_shader };
//# sourceMappingURL=pbrBlockLightmapInit.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockGeometryInfo.js
// Do not edit.

const pbrBlockGeometryInfo_name = "pbrBlockGeometryInfo";
const pbrBlockGeometryInfo_shader = `float NdotVUnclamped=dot(normalW,viewDirectionW);float NdotV=absEps(NdotVUnclamped);float alphaG=convertRoughnessToAverageSlope(roughness);vec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz);
#ifdef SPECULARAA
alphaG+=AARoughnessFactors.y;
#endif
#if defined(ENVIRONMENTBRDF)
vec3 environmentBrdf=getBRDFLookup(NdotV,roughness);
#endif
#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
#ifdef RADIANCEOCCLUSION
#ifdef AMBIENTINGRAYSCALE
float ambientMonochrome=aoOut.ambientOcclusionColor.r;
#else
float ambientMonochrome=getLuminance(aoOut.ambientOcclusionColor);
#endif
float seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);
#endif
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
float eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);
#endif
#endif
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockGeometryInfo_name] = pbrBlockGeometryInfo_shader;
/** @internal */
const pbrBlockGeometryInfo = { name: pbrBlockGeometryInfo_name, shader: pbrBlockGeometryInfo_shader };
//# sourceMappingURL=pbrBlockGeometryInfo.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectance0.js
// Do not edit.

const pbrBlockReflectance0_name = "pbrBlockReflectance0";
const pbrBlockReflectance0_shader = `float reflectance=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);vec3 specularEnvironmentR0=reflectivityOut.surfaceReflectivityColor.rgb;
#ifdef METALLICWORKFLOW
vec3 specularEnvironmentR90=vec3(metallicReflectanceFactors.a);
#else 
vec3 specularEnvironmentR90=vec3(1.0,1.0,1.0);
#endif
#ifdef ALPHAFRESNEL
float reflectance90=fresnelGrazingReflectance(reflectance);specularEnvironmentR90=specularEnvironmentR90*reflectance90;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockReflectance0_name] = pbrBlockReflectance0_shader;
/** @internal */
const pbrBlockReflectance0 = { name: pbrBlockReflectance0_name, shader: pbrBlockReflectance0_shader };
//# sourceMappingURL=pbrBlockReflectance0.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectance.js
// Do not edit.

const pbrBlockReflectance_name = "pbrBlockReflectance";
const pbrBlockReflectance_shader = `#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
vec3 specularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,environmentBrdf);
#ifdef RADIANCEOCCLUSION
specularEnvironmentReflectance*=seo;
#endif
#ifdef HORIZONOCCLUSION
#ifdef BUMP
#ifdef REFLECTIONMAP_3D
specularEnvironmentReflectance*=eho;
#endif
#endif
#endif
#else
vec3 specularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));
#endif
#ifdef CLEARCOAT
specularEnvironmentReflectance*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
specularEnvironmentReflectance*=clearcoatOut.absorption;
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockReflectance_name] = pbrBlockReflectance_shader;
/** @internal */
const pbrBlockReflectance = { name: pbrBlockReflectance_name, shader: pbrBlockReflectance_shader };
//# sourceMappingURL=pbrBlockReflectance.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockDirectLighting.js
// Do not edit.

const pbrBlockDirectLighting_name = "pbrBlockDirectLighting";
const pbrBlockDirectLighting_shader = `vec3 diffuseBase=vec3(0.,0.,0.);
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
#ifdef CLEARCOAT
vec3 clearCoatBase=vec3(0.,0.,0.);
#endif
#ifdef SHEEN
vec3 sheenBase=vec3(0.,0.,0.);
#endif
preLightingInfo preInfo;lightingInfo info;float shadow=1.; 
float aggShadow=0.;float numLights=0.;
#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
vec3 absorption=vec3(0.);
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockDirectLighting_name] = pbrBlockDirectLighting_shader;
/** @internal */
const pbrBlockDirectLighting = { name: pbrBlockDirectLighting_name, shader: pbrBlockDirectLighting_shader };
//# sourceMappingURL=pbrBlockDirectLighting.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js
var lightFragment = __webpack_require__(37256);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js
// Do not edit.

const pbrBlockFinalLitComponents_name = "pbrBlockFinalLitComponents";
const pbrBlockFinalLitComponents_shader = `aggShadow=aggShadow/numLights;
#if defined(ENVIRONMENTBRDF)
#ifdef MS_BRDF_ENERGY_CONSERVATION
vec3 energyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);
#endif
#endif
#ifndef METALLICWORKFLOW
#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION
surfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;
#endif
#endif
#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)
surfaceAlbedo.rgb=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;
#endif
#ifdef REFLECTION
vec3 finalIrradiance=reflectionOut.environmentIrradiance;
#if defined(CLEARCOAT)
finalIrradiance*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
finalIrradiance*=clearcoatOut.absorption;
#endif
#endif
#if defined(SS_REFRACTION)
finalIrradiance*=subSurfaceOut.refractionFactorForIrradiance;
#endif
#if defined(SS_TRANSLUCENCY)
finalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);finalIrradiance+=subSurfaceOut.refractionIrradiance;
#endif
finalIrradiance*=surfaceAlbedo.rgb;finalIrradiance*=vLightingIntensity.z;finalIrradiance*=aoOut.ambientOcclusionColor;
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase;finalSpecular=max(finalSpecular,0.0);vec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalSpecularScaled*=energyConservationFactor;
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
finalSpecularScaled*=sheenOut.sheenAlbedoScaling;
#endif
#endif
#ifdef REFLECTION
vec3 finalRadiance=reflectionOut.environmentRadiance.rgb;finalRadiance*=subSurfaceOut.specularEnvironmentReflectance;vec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalRadianceScaled*=energyConservationFactor;
#endif
#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)
finalRadianceScaled*=sheenOut.sheenAlbedoScaling;
#endif
#endif
#ifdef SHEEN
vec3 finalSheen=sheenBase*sheenOut.sheenColor;finalSheen=max(finalSheen,0.0);vec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w;
#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)
sheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;
#if defined(CLEARCOAT_TINT)
sheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;
#endif
#endif
#endif
#ifdef CLEARCOAT
vec3 finalClearCoat=clearCoatBase;finalClearCoat=max(finalClearCoat,0.0);vec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w;
#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)
finalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;
#endif
#ifdef SS_REFRACTION
subSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;
#ifdef CLEARCOAT_TINT
subSurfaceOut.finalRefraction*=clearcoatOut.absorption;
#endif
#endif
#endif
#ifdef ALPHABLEND
float luminanceOverAlpha=0.0;
#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)
luminanceOverAlpha+=getLuminance(finalRadianceScaled);
#if defined(CLEARCOAT)
luminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);
#endif
#endif
#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)
luminanceOverAlpha+=getLuminance(finalSpecularScaled);
#endif
#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)
luminanceOverAlpha+=getLuminance(finalClearCoatScaled);
#endif
#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA)
alpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockFinalLitComponents_name] = pbrBlockFinalLitComponents_shader;
/** @internal */
const pbrBlockFinalLitComponents = { name: pbrBlockFinalLitComponents_name, shader: pbrBlockFinalLitComponents_shader };
//# sourceMappingURL=pbrBlockFinalLitComponents.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js
// Do not edit.

const pbrBlockFinalUnlitComponents_name = "pbrBlockFinalUnlitComponents";
const pbrBlockFinalUnlitComponents_shader = `vec3 finalDiffuse=diffuseBase;finalDiffuse*=surfaceAlbedo.rgb;finalDiffuse=max(finalDiffuse,0.0);finalDiffuse*=vLightingIntensity.x;vec3 finalAmbient=vAmbientColor;finalAmbient*=surfaceAlbedo.rgb;vec3 finalEmissive=vEmissiveColor;
#ifdef EMISSIVE
vec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;
#ifdef GAMMAEMISSIVE
finalEmissive*=toLinearSpace(emissiveColorTex.rgb);
#else
finalEmissive*=emissiveColorTex.rgb;
#endif
finalEmissive*= vEmissiveInfos.y;
#endif
finalEmissive*=vLightingIntensity.y;
#ifdef AMBIENT
vec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),aoOut.ambientOcclusionColor,vAmbientInfos.w);
#else
vec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor;
#endif
finalAmbient*=aoOut.ambientOcclusionColor;finalDiffuse*=ambientOcclusionForDirectDiffuse;
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockFinalUnlitComponents_name] = pbrBlockFinalUnlitComponents_shader;
/** @internal */
const pbrBlockFinalUnlitComponents = { name: pbrBlockFinalUnlitComponents_name, shader: pbrBlockFinalUnlitComponents_shader };
//# sourceMappingURL=pbrBlockFinalUnlitComponents.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalColorComposition.js
// Do not edit.

const pbrBlockFinalColorComposition_name = "pbrBlockFinalColorComposition";
const pbrBlockFinalColorComposition_shader = `vec4 finalColor=vec4(
#ifndef UNLIT
#ifdef REFLECTION
finalIrradiance +
#endif
#ifdef SPECULARTERM
finalSpecularScaled +
#endif
#ifdef SHEEN
finalSheenScaled +
#endif
#ifdef CLEARCOAT
finalClearCoatScaled +
#endif
#ifdef REFLECTION
finalRadianceScaled +
#if defined(SHEEN) && defined(ENVIRONMENTBRDF)
sheenOut.finalSheenRadianceScaled +
#endif
#ifdef CLEARCOAT
clearcoatOut.finalClearCoatRadianceScaled +
#endif
#endif
#ifdef SS_REFRACTION
subSurfaceOut.finalRefraction +
#endif
#endif
finalAmbient +
finalDiffuse,
alpha);
#ifdef LIGHTMAP
#ifndef LIGHTMAPEXCLUDED
#ifdef USELIGHTMAPASSHADOWMAP
finalColor.rgb*=lightmapColor.rgb;
#else
finalColor.rgb+=lightmapColor.rgb;
#endif
#endif
#endif
finalColor.rgb+=finalEmissive;
#define CUSTOM_FRAGMENT_BEFORE_FOG
finalColor=max(finalColor,0.0);
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockFinalColorComposition_name] = pbrBlockFinalColorComposition_shader;
/** @internal */
const pbrBlockFinalColorComposition = { name: pbrBlockFinalColorComposition_name, shader: pbrBlockFinalColorComposition_shader };
//# sourceMappingURL=pbrBlockFinalColorComposition.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__(29741);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__(2360);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockImageProcessing.js
// Do not edit.

const pbrBlockImageProcessing_name = "pbrBlockImageProcessing";
const pbrBlockImageProcessing_shader = `#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)
#if !defined(SKIPFINALCOLORCLAMP)
finalColor.rgb=clamp(finalColor.rgb,0.,30.0);
#endif
#else
finalColor=applyImageProcessing(finalColor);
#endif
finalColor.a*=visibility;
#ifdef PREMULTIPLYALPHA
finalColor.rgb*=finalColor.a;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockImageProcessing_name] = pbrBlockImageProcessing_shader;
/** @internal */
const pbrBlockImageProcessing = { name: pbrBlockImageProcessing_name, shader: pbrBlockImageProcessing_shader };
//# sourceMappingURL=pbrBlockImageProcessing.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockPrePass.js
// Do not edit.

const pbrBlockPrePass_name = "pbrBlockPrePass";
const pbrBlockPrePass_shader = `float writeGeometryInfo=finalColor.a>ALPHATESTVALUE ? 1.0 : 0.0;
#ifdef PREPASS_POSITION
gl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);
#endif
#ifdef PREPASS_LOCAL_POSITION
gl_FragData[PREPASS_LOCAL_POSITION_INDEX]=vec4(vPosition,writeGeometryInfo);
#endif
#if defined(PREPASS_VELOCITY)
vec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);
#elif defined(PREPASS_VELOCITY_LINEAR)
vec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w)-(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO
gl_FragData[PREPASS_ALBEDO_INDEX]=vec4(surfaceAlbedo,writeGeometryInfo);
#endif
#ifdef PREPASS_ALBEDO_SQRT
vec3 sqAlbedo=sqrt(surfaceAlbedo); 
#endif
#ifdef PREPASS_IRRADIANCE
vec3 irradiance=finalDiffuse;
#ifndef UNLIT
#ifdef REFLECTION
irradiance+=finalIrradiance;
#endif
#endif
#ifdef SS_SCATTERING
#ifdef PREPASS_COLOR
gl_FragData[PREPASS_COLOR_INDEX]=vec4(finalColor.rgb-irradiance,finalColor.a); 
#endif
irradiance/=sqAlbedo;
#else
#ifdef PREPASS_COLOR
gl_FragData[PREPASS_COLOR_INDEX]=finalColor; 
#endif
float scatteringDiffusionProfile=255.;
#endif
gl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(clamp(irradiance,vec3(0.),vec3(1.)),writeGeometryInfo*scatteringDiffusionProfile/255.); 
#elif defined(PREPASS_COLOR)
gl_FragData[PREPASS_COLOR_INDEX]=vec4(finalColor.rgb,finalColor.a);
#endif
#ifdef PREPASS_DEPTH
gl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); 
#endif
#ifdef PREPASS_SCREENSPACE_DEPTH
gl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,writeGeometryInfo);
#endif
#ifdef PREPASS_NORMAL
#ifdef PREPASS_NORMAL_WORLDSPACE
gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalW,writeGeometryInfo);
#else
gl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo);
#endif
#endif
#ifdef PREPASS_WORLD_NORMAL
gl_FragData[PREPASS_WORLD_NORMAL_INDEX]=vec4(normalW*0.5+0.5,writeGeometryInfo); 
#endif
#ifdef PREPASS_ALBEDO_SQRT
gl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(sqAlbedo,writeGeometryInfo); 
#endif
#ifdef PREPASS_REFLECTIVITY
#ifndef UNLIT
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(specularEnvironmentR0,microSurface)*writeGeometryInfo;
#else
gl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4( 0.0,0.0,0.0,1.0 )*writeGeometryInfo;
#endif
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrBlockPrePass_name] = pbrBlockPrePass_shader;
/** @internal */
const pbrBlockPrePass = { name: pbrBlockPrePass_name, shader: pbrBlockPrePass_shader };
//# sourceMappingURL=pbrBlockPrePass.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/oitFragment.js
var oitFragment = __webpack_require__(94436);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDebug.js
// Do not edit.

const pbrDebug_name = "pbrDebug";
const pbrDebug_shader = `#if DEBUGMODE>0
if (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) {
#if DEBUGMODE==1
gl_FragColor.rgb=vPositionW.rgb;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==2 && defined(NORMAL)
gl_FragColor.rgb=vNormalW.rgb;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==3 && defined(BUMP) || DEBUGMODE==3 && defined(PARALLAX) || DEBUGMODE==3 && defined(ANISOTROPIC)
gl_FragColor.rgb=TBN[0];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==4 && defined(BUMP) || DEBUGMODE==4 && defined(PARALLAX) || DEBUGMODE==4 && defined(ANISOTROPIC)
gl_FragColor.rgb=TBN[1];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==5
gl_FragColor.rgb=normalW;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==6 && defined(MAINUV1)
gl_FragColor.rgb=vec3(vMainUV1,0.0);
#elif DEBUGMODE==7 && defined(MAINUV2)
gl_FragColor.rgb=vec3(vMainUV2,0.0);
#elif DEBUGMODE==8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
gl_FragColor.rgb=clearcoatOut.TBNClearCoat[0];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
gl_FragColor.rgb=clearcoatOut.TBNClearCoat[1];
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==10 && defined(CLEARCOAT)
gl_FragColor.rgb=clearcoatOut.clearCoatNormalW;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==11 && defined(ANISOTROPIC)
gl_FragColor.rgb=anisotropicOut.anisotropicNormal;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==12 && defined(ANISOTROPIC)
gl_FragColor.rgb=anisotropicOut.anisotropicTangent;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==13 && defined(ANISOTROPIC)
gl_FragColor.rgb=anisotropicOut.anisotropicBitangent;
#define DEBUGMODE_NORMALIZE
#elif DEBUGMODE==20 && defined(ALBEDO)
gl_FragColor.rgb=albedoTexture.rgb;
#ifndef GAMMAALBEDO
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==21 && defined(AMBIENT)
gl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb;
#elif DEBUGMODE==22 && defined(OPACITY)
gl_FragColor.rgb=opacityMap.rgb;
#elif DEBUGMODE==23 && defined(EMISSIVE)
gl_FragColor.rgb=emissiveColorTex.rgb;
#ifndef GAMMAEMISSIVE
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==24 && defined(LIGHTMAP)
gl_FragColor.rgb=lightmapColor.rgb;
#ifndef GAMMALIGHTMAP
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)
gl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb;
#elif DEBUGMODE==26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)
gl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)
gl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0);
#elif DEBUGMODE==28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
gl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb;
#elif DEBUGMODE==29 && defined(SHEEN) && defined(SHEEN_TEXTURE)
gl_FragColor.rgb=sheenOut.sheenMapData.rgb;
#elif DEBUGMODE==30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)
gl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb;
#elif DEBUGMODE==31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)
gl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb;
#elif DEBUGMODE==32 && defined(BUMP)
gl_FragColor.rgb=texture2D(bumpSampler,vBumpUV).rgb;
#elif DEBUGMODE==40 && defined(SS_REFRACTION)
gl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==41 && defined(REFLECTION)
gl_FragColor.rgb=reflectionOut.environmentRadiance.rgb;
#ifndef GAMMAREFLECTION
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==42 && defined(CLEARCOAT) && defined(REFLECTION)
gl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==50
gl_FragColor.rgb=diffuseBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==51 && defined(SPECULARTERM)
gl_FragColor.rgb=specularBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==52 && defined(CLEARCOAT)
gl_FragColor.rgb=clearCoatBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==53 && defined(SHEEN)
gl_FragColor.rgb=sheenBase.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==54 && defined(REFLECTION)
gl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb;
#ifndef GAMMAREFLECTION
#define DEBUGMODE_GAMMA
#endif
#elif DEBUGMODE==60
gl_FragColor.rgb=surfaceAlbedo.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==61
gl_FragColor.rgb=clearcoatOut.specularEnvironmentR0;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==62 && defined(METALLICWORKFLOW)
gl_FragColor.rgb=vec3(reflectivityOut.metallicRoughness.r);
#elif DEBUGMODE==71 && defined(METALLICWORKFLOW)
gl_FragColor.rgb=reflectivityOut.metallicF0;
#elif DEBUGMODE==63
gl_FragColor.rgb=vec3(roughness);
#elif DEBUGMODE==64
gl_FragColor.rgb=vec3(alphaG);
#elif DEBUGMODE==65
gl_FragColor.rgb=vec3(NdotV);
#elif DEBUGMODE==66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
gl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==67 && defined(CLEARCOAT)
gl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness);
#elif DEBUGMODE==68 && defined(CLEARCOAT)
gl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV);
#elif DEBUGMODE==69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)
gl_FragColor.rgb=subSurfaceOut.transmittance;
#elif DEBUGMODE==70 && defined(SUBSURFACE) && defined(SS_REFRACTION)
gl_FragColor.rgb=subSurfaceOut.refractionTransmittance;
#elif DEBUGMODE==72
gl_FragColor.rgb=vec3(microSurface);
#elif DEBUGMODE==73
gl_FragColor.rgb=vAlbedoColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==74 && !defined(METALLICWORKFLOW)
gl_FragColor.rgb=vReflectivityColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==75
gl_FragColor.rgb=vEmissiveColor.rgb;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==80 && defined(RADIANCEOCCLUSION)
gl_FragColor.rgb=vec3(seo);
#elif DEBUGMODE==81 && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
gl_FragColor.rgb=vec3(eho);
#elif DEBUGMODE==82 && defined(MS_BRDF_ENERGY_CONSERVATION)
gl_FragColor.rgb=vec3(energyConservationFactor);
#elif DEBUGMODE==83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
gl_FragColor.rgb=specularEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
gl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==85 && defined(SHEEN) && defined(REFLECTION)
gl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance;
#define DEBUGMODE_GAMMA
#elif DEBUGMODE==86 && defined(ALPHABLEND)
gl_FragColor.rgb=vec3(luminanceOverAlpha);
#elif DEBUGMODE==87
gl_FragColor.rgb=vec3(alpha);
#elif DEBUGMODE==88 && defined(ALBEDO)
gl_FragColor.rgb=vec3(albedoTexture.a);
#elif DEBUGMODE==89
gl_FragColor.rgb=aoOut.ambientOcclusionColor.rgb;
#else
float stripeWidth=30.;float stripePos=floor(gl_FragCoord.x/stripeWidth);float whichColor=mod(stripePos,2.);vec3 color1=vec3(.6,.2,.2);vec3 color2=vec3(.3,.1,.1);gl_FragColor.rgb=mix(color1,color2,whichColor);
#endif
gl_FragColor.rgb*=vDebugMode.y;
#ifdef DEBUGMODE_NORMALIZE
gl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5;
#endif
#ifdef DEBUGMODE_GAMMA
gl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb);
#endif
gl_FragColor.a=1.0;
#ifdef PREPASS
gl_FragData[0]=toLinearSpace(gl_FragColor); 
gl_FragData[1]=vec4(0.,0.,0.,0.); 
#endif
#ifdef DEBUGMODE_FORCERETURN
return;
#endif
}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrDebug_name] = pbrDebug_shader;
/** @internal */
const pbrDebug = { name: pbrDebug_name, shader: pbrDebug_shader };
//# sourceMappingURL=pbrDebug.js.map
;// ./node_modules/@babylonjs/core/Shaders/pbr.fragment.js
// Do not edit.



























































const pbr_fragment_name = "pbrPixelShader";
const pbr_fragment_shader = `#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
#extension GL_OES_standard_derivatives : enable
#endif
#ifdef LODBASEDMICROSFURACE
#extension GL_EXT_shader_texture_lod : enable
#endif
#define CUSTOM_FRAGMENT_BEGIN
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#include<prePassDeclaration>[SCENE_MRT_COUNT]
precision highp float;
#include<oitDeclaration>
#ifndef FROMLINEARSPACE
#define FROMLINEARSPACE
#endif
#include<__decl__pbrFragment>
#include<pbrFragmentExtraDeclaration>
#include<__decl__lightFragment>[0..maxSimultaneousLights]
#include<pbrFragmentSamplersDeclaration>
#include<imageProcessingDeclaration>
#include<clipPlaneFragmentDeclaration>
#include<logDepthDeclaration>
#include<fogFragmentDeclaration>
#include<helperFunctions>
#include<subSurfaceScatteringFunctions>
#include<importanceSampling>
#include<pbrHelperFunctions>
#include<imageProcessingFunctions>
#include<shadowsFragmentFunctions>
#include<harmonicsFunctions>
#include<pbrDirectLightingSetupFunctions>
#include<pbrDirectLightingFalloffFunctions>
#include<pbrBRDFFunctions>
#include<hdrFilteringFunctions>
#include<pbrDirectLightingFunctions>
#include<pbrIBLFunctions>
#include<bumpFragmentMainFunctions>
#include<bumpFragmentFunctions>
#ifdef REFLECTION
#include<reflectionFunction>
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
#include<pbrBlockAlbedoOpacity>
#include<pbrBlockReflectivity>
#include<pbrBlockAmbientOcclusion>
#include<pbrBlockAlphaFresnel>
#include<pbrBlockAnisotropic>
#include<pbrBlockReflection>
#include<pbrBlockSheen>
#include<pbrBlockClearcoat>
#include<pbrBlockIridescence>
#include<pbrBlockSubSurface>
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#include<clipPlaneFragment>
#include<pbrBlockNormalGeometric>
#include<bumpFragment>
#include<pbrBlockNormalFinal>
albedoOpacityOutParams albedoOpacityOut;
#ifdef ALBEDO
vec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);
#endif
#ifdef OPACITY
vec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);
#endif
#ifdef DECAL
vec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);
#endif
albedoOpacityOut=albedoOpacityBlock(
vAlbedoColor
#ifdef ALBEDO
,albedoTexture
,vAlbedoInfos
#endif
#ifdef OPACITY
,opacityMap
,vOpacityInfos
#endif
#ifdef DETAIL
,detailColor
,vDetailInfos
#endif
#ifdef DECAL
,decalColor
,vDecalInfos
#endif
);vec3 surfaceAlbedo=albedoOpacityOut.surfaceAlbedo;float alpha=albedoOpacityOut.alpha;
#define CUSTOM_FRAGMENT_UPDATE_ALPHA
#include<depthPrePass>
#define CUSTOM_FRAGMENT_BEFORE_LIGHTS
ambientOcclusionOutParams aoOut;
#ifdef AMBIENT
vec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb;
#endif
aoOut=ambientOcclusionBlock(
#ifdef AMBIENT
ambientOcclusionColorMap,
vAmbientInfos
#endif 
);
#include<pbrBlockLightmapInit>
#ifdef UNLIT
vec3 diffuseBase=vec3(1.,1.,1.);
#else
vec3 baseColor=surfaceAlbedo;reflectivityOutParams reflectivityOut;
#if defined(REFLECTIVITY)
vec4 surfaceMetallicOrReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);vec4 baseReflectivity=surfaceMetallicOrReflectivityColorMap;
#ifndef METALLICWORKFLOW
#ifdef REFLECTIVITY_GAMMA
surfaceMetallicOrReflectivityColorMap=toLinearSpace(surfaceMetallicOrReflectivityColorMap);
#endif
surfaceMetallicOrReflectivityColorMap.rgb*=vReflectivityInfos.y;
#endif
#endif
#if defined(MICROSURFACEMAP)
vec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;
#endif
#ifdef METALLICWORKFLOW
vec4 metallicReflectanceFactors=vMetallicReflectanceFactors;
#ifdef REFLECTANCE
vec4 reflectanceFactorsMap=texture2D(reflectanceSampler,vReflectanceUV+uvOffset);
#ifdef REFLECTANCE_GAMMA
reflectanceFactorsMap=toLinearSpace(reflectanceFactorsMap);
#endif
metallicReflectanceFactors.rgb*=reflectanceFactorsMap.rgb;
#endif
#ifdef METALLIC_REFLECTANCE
vec4 metallicReflectanceFactorsMap=texture2D(metallicReflectanceSampler,vMetallicReflectanceUV+uvOffset);
#ifdef METALLIC_REFLECTANCE_GAMMA
metallicReflectanceFactorsMap=toLinearSpace(metallicReflectanceFactorsMap);
#endif
#ifndef METALLIC_REFLECTANCE_USE_ALPHA_ONLY
metallicReflectanceFactors.rgb*=metallicReflectanceFactorsMap.rgb;
#endif
metallicReflectanceFactors*=metallicReflectanceFactorsMap.a;
#endif
#endif
reflectivityOut=reflectivityBlock(
vReflectivityColor
#ifdef METALLICWORKFLOW
,surfaceAlbedo
,metallicReflectanceFactors
#endif
#ifdef REFLECTIVITY
,vReflectivityInfos
,surfaceMetallicOrReflectivityColorMap
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
,aoOut.ambientOcclusionColor
#endif
#ifdef MICROSURFACEMAP
,microSurfaceTexel
#endif
#ifdef DETAIL
,detailColor
,vDetailInfos
#endif
);float microSurface=reflectivityOut.microSurface;float roughness=reflectivityOut.roughness;
#ifdef METALLICWORKFLOW
surfaceAlbedo=reflectivityOut.surfaceAlbedo;
#endif
#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
aoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;
#endif
#ifdef ALPHAFRESNEL
#if defined(ALPHATEST) || defined(ALPHABLEND)
alphaFresnelOutParams alphaFresnelOut;alphaFresnelOut=alphaFresnelBlock(
normalW,
viewDirectionW,
alpha,
microSurface
);alpha=alphaFresnelOut.alpha;
#endif
#endif
#include<pbrBlockGeometryInfo>
#ifdef ANISOTROPIC
anisotropicOutParams anisotropicOut;
#ifdef ANISOTROPIC_TEXTURE
vec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y;
#endif
anisotropicOut=anisotropicBlock(
vAnisotropy,
roughness,
#ifdef ANISOTROPIC_TEXTURE
anisotropyMapData,
#endif
TBN,
normalW,
viewDirectionW 
);
#endif
#ifdef REFLECTION
reflectionOutParams reflectionOut;
#ifndef USE_CUSTOM_REFLECTION
reflectionOut=reflectionBlock(
vPositionW
,normalW
,alphaG
,vReflectionMicrosurfaceInfos
,vReflectionInfos
,vReflectionColor
#ifdef ANISOTROPIC
,anisotropicOut
#endif
#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)
,NdotVUnclamped
#endif
#ifdef LINEARSPECULARREFLECTION
,roughness
#endif
,reflectionSampler
#if defined(NORMAL) && defined(USESPHERICALINVERTEX)
,vEnvironmentIrradiance
#endif
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
,reflectionMatrix
#endif
#endif
#ifdef USEIRRADIANCEMAP
,irradianceSampler
#endif
#ifndef LODBASEDMICROSFURACE
,reflectionSamplerLow
,reflectionSamplerHigh
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo
#endif
);
#else
#define CUSTOM_REFLECTION
#endif
#endif
#include<pbrBlockReflectance0>
#ifdef SHEEN
sheenOutParams sheenOut;
#ifdef SHEEN_TEXTURE
vec4 sheenMapData=texture2D(sheenSampler,vSheenUV+uvOffset);
#endif
#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
vec4 sheenMapRoughnessData=texture2D(sheenRoughnessSampler,vSheenRoughnessUV+uvOffset)*vSheenInfos.w;
#endif
sheenOut=sheenBlock(
vSheenColor
#ifdef SHEEN_ROUGHNESS
,vSheenRoughness
#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)
,sheenMapRoughnessData
#endif
#endif
,roughness
#ifdef SHEEN_TEXTURE
,sheenMapData
,vSheenInfos.y
#endif
,reflectance
#ifdef SHEEN_LINKWITHALBEDO
,baseColor
,surfaceAlbedo
#endif
#ifdef ENVIRONMENTBRDF
,NdotV
,environmentBrdf
#endif
#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
,AARoughnessFactors
,vReflectionMicrosurfaceInfos
,vReflectionInfos
,vReflectionColor
,vLightingIntensity
,reflectionSampler
,reflectionOut.reflectionCoords
,NdotVUnclamped
#ifndef LODBASEDMICROSFURACE
,reflectionSamplerLow
,reflectionSamplerHigh
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)
,seo
#endif
#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
,eho
#endif
#endif
);
#ifdef SHEEN_LINKWITHALBEDO
surfaceAlbedo=sheenOut.surfaceAlbedo;
#endif
#endif
#ifdef CLEARCOAT
#ifdef CLEARCOAT_TEXTURE
vec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y;
#endif
#endif
#ifdef IRIDESCENCE
iridescenceOutParams iridescenceOut;
#ifdef IRIDESCENCE_TEXTURE
vec2 iridescenceMapData=texture2D(iridescenceSampler,vIridescenceUV+uvOffset).rg*vIridescenceInfos.y;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
vec2 iridescenceThicknessMapData=texture2D(iridescenceThicknessSampler,vIridescenceThicknessUV+uvOffset).rg*vIridescenceInfos.w;
#endif
iridescenceOut=iridescenceBlock(
vIridescenceParams
,NdotV
,specularEnvironmentR0
#ifdef IRIDESCENCE_TEXTURE
,iridescenceMapData
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
,iridescenceThicknessMapData
#endif
#ifdef CLEARCOAT
,NdotVUnclamped
#ifdef CLEARCOAT_TEXTURE
,clearCoatMapData
#endif
#endif
);float iridescenceIntensity=iridescenceOut.iridescenceIntensity;specularEnvironmentR0=iridescenceOut.specularEnvironmentR0;
#endif
clearcoatOutParams clearcoatOut;
#ifdef CLEARCOAT
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
vec4 clearCoatMapRoughnessData=texture2D(clearCoatRoughnessSampler,vClearCoatRoughnessUV+uvOffset)*vClearCoatInfos.w;
#endif
#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
vec4 clearCoatTintMapData=texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset);
#endif
#ifdef CLEARCOAT_BUMP
vec4 clearCoatBumpMapData=texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset);
#endif
clearcoatOut=clearcoatBlock(
vPositionW
,geometricNormalW
,viewDirectionW
,vClearCoatParams
#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)
,clearCoatMapRoughnessData
#endif
,specularEnvironmentR0
#ifdef CLEARCOAT_TEXTURE
,clearCoatMapData
#endif
#ifdef CLEARCOAT_TINT
,vClearCoatTintParams
,clearCoatColorAtDistance
,vClearCoatRefractionParams
#ifdef CLEARCOAT_TINT_TEXTURE
,clearCoatTintMapData
#endif
#endif
#ifdef CLEARCOAT_BUMP
,vClearCoatBumpInfos
,clearCoatBumpMapData
,vClearCoatBumpUV
#if defined(TANGENT) && defined(NORMAL)
,vTBN
#else
,vClearCoatTangentSpaceParams
#endif
#ifdef OBJECTSPACE_NORMALMAP
,normalMatrix
#endif
#endif
#if defined(FORCENORMALFORWARD) && defined(NORMAL)
,faceNormal
#endif
#ifdef REFLECTION
,vReflectionMicrosurfaceInfos
,vReflectionInfos
,vReflectionColor
,vLightingIntensity
,reflectionSampler
#ifndef LODBASEDMICROSFURACE
,reflectionSamplerLow
,reflectionSamplerHigh
#endif
#ifdef REALTIME_FILTERING
,vReflectionFilteringInfo
#endif
#endif
#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
,(gl_FrontFacing ? 1. : -1.)
#endif
);
#else
clearcoatOut.specularEnvironmentR0=specularEnvironmentR0;
#endif
#include<pbrBlockReflectance>
subSurfaceOutParams subSurfaceOut;
#ifdef SUBSURFACE
#ifdef SS_THICKNESSANDMASK_TEXTURE
vec4 thicknessMap=texture2D(thicknessSampler,vThicknessUV+uvOffset);
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
vec4 refractionIntensityMap=texture2D(refractionIntensitySampler,vRefractionIntensityUV+uvOffset);
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
vec4 translucencyIntensityMap=texture2D(translucencyIntensitySampler,vTranslucencyIntensityUV+uvOffset);
#endif
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
vec4 translucencyColorMap=texture2D(translucencyColorSampler,vTranslucencyColorUV+uvOffset);
#endif
subSurfaceOut=subSurfaceBlock(
vSubSurfaceIntensity
,vThicknessParam
,vTintColor
,normalW
,specularEnvironmentReflectance
#ifdef SS_THICKNESSANDMASK_TEXTURE
,thicknessMap
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
,refractionIntensityMap
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
,translucencyIntensityMap
#endif
#ifdef REFLECTION
#ifdef SS_TRANSLUCENCY
,reflectionMatrix
#ifdef USESPHERICALFROMREFLECTIONMAP
#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
,reflectionOut.irradianceVector
#endif
#if defined(REALTIME_FILTERING)
,reflectionSampler
,vReflectionFilteringInfo
#endif
#endif
#ifdef USEIRRADIANCEMAP
,irradianceSampler
#endif
#endif
#endif
#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
,surfaceAlbedo
#endif
#ifdef SS_REFRACTION
,vPositionW
,viewDirectionW
,view
,vRefractionInfos
,refractionMatrix
,vRefractionMicrosurfaceInfos
,vLightingIntensity
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
,alpha
#endif
#ifdef SS_LODINREFRACTIONALPHA
,NdotVUnclamped
#endif
#ifdef SS_LINEARSPECULARREFRACTION
,roughness
#endif
,alphaG
,refractionSampler
#ifndef LODBASEDMICROSFURACE
,refractionSamplerLow
,refractionSamplerHigh
#endif
#ifdef ANISOTROPIC
,anisotropicOut
#endif
#ifdef REALTIME_FILTERING
,vRefractionFilteringInfo
#endif
#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
,vRefractionPosition
,vRefractionSize
#endif
#ifdef SS_DISPERSION
,dispersion
#endif
#endif
#ifdef SS_TRANSLUCENCY
,vDiffusionDistance
,vTranslucencyColor
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
,translucencyColorMap
#endif
#endif
);
#ifdef SS_REFRACTION
surfaceAlbedo=subSurfaceOut.surfaceAlbedo;
#ifdef SS_LINKREFRACTIONTOTRANSPARENCY
alpha=subSurfaceOut.alpha;
#endif
#endif
#else
subSurfaceOut.specularEnvironmentReflectance=specularEnvironmentReflectance;
#endif
#include<pbrBlockDirectLighting>
#include<lightFragment>[0..maxSimultaneousLights]
#include<pbrBlockFinalLitComponents>
#endif 
#include<pbrBlockFinalUnlitComponents>
#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION
#include<pbrBlockFinalColorComposition>
#include<logDepthFragment>
#include<fogFragment>(color,finalColor)
#include<pbrBlockImageProcessing>
#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
#ifdef PREPASS
#include<pbrBlockPrePass>
#endif
#if !defined(PREPASS) || defined(WEBGL2)
gl_FragColor=finalColor;
#endif
#include<oitFragment>
#if ORDER_INDEPENDENT_TRANSPARENCY
if (fragDepth==nearestDepth) {frontColor.rgb+=finalColor.rgb*finalColor.a*alphaMultiplier;frontColor.a=1.0-alphaMultiplier*(1.0-finalColor.a);} else {backColor+=finalColor;}
#endif
#include<pbrDebug>
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[pbr_fragment_name] = pbr_fragment_shader;
/** @internal */
const pbrPixelShader = { name: pbr_fragment_name, shader: pbr_fragment_shader };
//# sourceMappingURL=pbr.fragment.js.map

/***/ }),

/***/ 81448:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  pbrVertexShader: () => (/* binding */ pbrVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/decalVertexDeclaration.js
var decalVertexDeclaration = __webpack_require__(96019);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrVertexDeclaration.js
// Do not edit.


const pbrVertexDeclaration_name = "pbrVertexDeclaration";
const shader = `uniform mat4 view;uniform mat4 viewProjection;
#ifdef MULTIVIEW
mat4 viewProjectionR;
#endif 
#ifdef ALBEDO
uniform mat4 albedoMatrix;uniform vec2 vAlbedoInfos;
#endif
#ifdef AMBIENT
uniform mat4 ambientMatrix;uniform vec4 vAmbientInfos;
#endif
#ifdef OPACITY
uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;
#endif
#ifdef EMISSIVE
uniform vec2 vEmissiveInfos;uniform mat4 emissiveMatrix;
#endif
#ifdef LIGHTMAP
uniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix;
#endif
#ifdef REFLECTIVITY 
uniform vec3 vReflectivityInfos;uniform mat4 reflectivityMatrix;
#endif
#ifdef METALLIC_REFLECTANCE
uniform vec2 vMetallicReflectanceInfos;uniform mat4 metallicReflectanceMatrix;
#endif
#ifdef REFLECTANCE
uniform vec2 vReflectanceInfos;uniform mat4 reflectanceMatrix;
#endif
#ifdef MICROSURFACEMAP
uniform vec2 vMicroSurfaceSamplerInfos;uniform mat4 microSurfaceSamplerMatrix;
#endif
#ifdef BUMP
uniform vec3 vBumpInfos;uniform mat4 bumpMatrix;
#endif
#ifdef POINTSIZE
uniform float pointSize;
#endif
#ifdef REFLECTION
uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;
#endif
#ifdef CLEARCOAT
#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)
uniform vec4 vClearCoatInfos;
#endif
#ifdef CLEARCOAT_TEXTURE
uniform mat4 clearCoatMatrix;
#endif
#ifdef CLEARCOAT_TEXTURE_ROUGHNESS
uniform mat4 clearCoatRoughnessMatrix;
#endif
#ifdef CLEARCOAT_BUMP
uniform vec2 vClearCoatBumpInfos;uniform mat4 clearCoatBumpMatrix;
#endif
#ifdef CLEARCOAT_TINT_TEXTURE
uniform vec2 vClearCoatTintInfos;uniform mat4 clearCoatTintMatrix;
#endif
#endif
#ifdef IRIDESCENCE
#if defined(IRIDESCENCE_TEXTURE) || defined(IRIDESCENCE_THICKNESS_TEXTURE)
uniform vec4 vIridescenceInfos;
#endif
#ifdef IRIDESCENCE_TEXTURE
uniform mat4 iridescenceMatrix;
#endif
#ifdef IRIDESCENCE_THICKNESS_TEXTURE
uniform mat4 iridescenceThicknessMatrix;
#endif
#endif
#ifdef ANISOTROPIC
#ifdef ANISOTROPIC_TEXTURE
uniform vec2 vAnisotropyInfos;uniform mat4 anisotropyMatrix;
#endif
#endif
#ifdef SHEEN
#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)
uniform vec4 vSheenInfos;
#endif
#ifdef SHEEN_TEXTURE
uniform mat4 sheenMatrix;
#endif
#ifdef SHEEN_TEXTURE_ROUGHNESS
uniform mat4 sheenRoughnessMatrix;
#endif
#endif
#ifdef SUBSURFACE
#ifdef SS_REFRACTION
uniform vec4 vRefractionInfos;uniform mat4 refractionMatrix;
#endif
#ifdef SS_THICKNESSANDMASK_TEXTURE
uniform vec2 vThicknessInfos;uniform mat4 thicknessMatrix;
#endif
#ifdef SS_REFRACTIONINTENSITY_TEXTURE
uniform vec2 vRefractionIntensityInfos;uniform mat4 refractionIntensityMatrix;
#endif
#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE
uniform vec2 vTranslucencyIntensityInfos;uniform mat4 translucencyIntensityMatrix;
#endif
#ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
uniform vec2 vTranslucencyColorInfos;uniform mat4 translucencyColorMatrix;
#endif
#endif
#ifdef NORMAL
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
#ifdef USESPHERICALFROMREFLECTIONMAP
#ifdef SPHERICAL_HARMONICS
uniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22;
#else
uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX;
#endif
#endif
#endif
#endif
#ifdef DETAIL
uniform vec4 vDetailInfos;uniform mat4 detailMatrix;
#endif
#include<decalVertexDeclaration>
#define ADDITIONAL_VERTEX_DECLARATION
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[pbrVertexDeclaration_name] = shader;
/** @internal */
const pbrVertexDeclaration = { name: pbrVertexDeclaration_name, shader };
//# sourceMappingURL=pbrVertexDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrUboDeclaration.js
var pbrUboDeclaration = __webpack_require__(4096);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.js
var uvAttributeDeclaration = __webpack_require__(94381);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js
var mainUVVaryingDeclaration = __webpack_require__(4980);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(73325);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(69707);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(18959);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__(1218);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.js
var prePassVertexDeclaration = __webpack_require__(78328);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.js
var samplerVertexDeclaration = __webpack_require__(85136);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/harmonicsFunctions.js
var harmonicsFunctions = __webpack_require__(19495);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.js
var bumpVertexDeclaration = __webpack_require__(56390);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(71636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__(86560);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js
var lightVxFragmentDeclaration = __webpack_require__(47059);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js
var lightVxUboDeclaration = __webpack_require__(4662);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__(27999);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__(90738);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__(48451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__(15060);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(3298);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(3361);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(65523);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.js
var prePassVertex = __webpack_require__(65438);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.js
var uvVariableDeclaration = __webpack_require__(4981);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.js
var samplerVertexImplementation = __webpack_require__(41316);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js
var bumpVertex = __webpack_require__(19440);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(47314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__(16470);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js
var shadowsVertex = __webpack_require__(35687);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js
var vertexColorMixing = __webpack_require__(94483);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__(2215);
;// ./node_modules/@babylonjs/core/Shaders/pbr.vertex.js
// Do not edit.


































const pbr_vertex_name = "pbrVertexShader";
const pbr_vertex_shader = `precision highp float;
#include<__decl__pbrVertex>
#define CUSTOM_VERTEX_BEGIN
attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#ifdef TANGENT
attribute vec4 tangent;
#endif
#ifdef UV1
attribute vec2 uv;
#endif
#include<uvAttributeDeclaration>[2..7]
#include<mainUVVaryingDeclaration>[1..7]
#ifdef VERTEXCOLOR
attribute vec4 color;
#endif
#include<helperFunctions>
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<instancesDeclaration>
#include<prePassVertexDeclaration>
#include<samplerVertexDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo)
#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity)
#include<samplerVertexDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler)
#include<samplerVertexDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance)
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance)
#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)
#ifdef CLEARCOAT
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump)
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint)
#endif
#ifdef IRIDESCENCE
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence)
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness)
#endif
#ifdef SHEEN
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen)
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
#endif
#ifdef ANISOTROPIC
#include<samplerVertexDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy)
#endif
#ifdef SUBSURFACE
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity)
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor)
#endif
varying vec3 vPositionW;
#if DEBUGMODE>0
varying vec4 vClipSpacePosition;
#endif
#ifdef NORMAL
varying vec3 vNormalW;
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
varying vec3 vEnvironmentIrradiance;
#include<harmonicsFunctions>
#endif
#endif
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
varying vec4 vColor;
#endif
#include<bumpVertexDeclaration>
#include<clipPlaneVertexDeclaration>
#include<fogVertexDeclaration>
#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
varying vec3 vPositionUVW;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
varying vec3 vDirectionW;
#endif
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 positionUpdated=position;
#ifdef NORMAL
vec3 normalUpdated=normal;
#endif
#ifdef TANGENT
vec4 tangentUpdated=tangent;
#endif
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#ifdef REFLECTIONMAP_SKYBOX
vPositionUVW=positionUpdated;
#endif
#define CUSTOM_VERTEX_UPDATE_POSITION
#define CUSTOM_VERTEX_UPDATE_NORMAL
#include<instancesVertex>
#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
#endif
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);vPositionW=vec3(worldPos);
#ifdef PREPASS
#include<prePassVertex>
#endif
#ifdef NORMAL
mat3 normalWorld=mat3(finalWorld);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normalWorld=transposeMat3(inverseMat3(normalWorld));
#endif
vNormalW=normalize(normalWorld*normalUpdated);
#endif
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
vec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz;
#ifdef REFLECTIONMAP_OPPOSITEZ
reflectionVector.z*=-1.0;
#endif
vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);
#endif
#endif
#define CUSTOM_VERTEX_UPDATE_WORLDPOS
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}
#else
gl_Position=viewProjection*worldPos;
#endif
#if DEBUGMODE>0
vClipSpacePosition=gl_Position;
#endif
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));
#endif
#ifndef UV1
vec2 uvUpdated=vec2(0.,0.);
#endif
#ifdef MAINUV1
vMainUV1=uvUpdated;
#endif
#include<uvVariableDeclaration>[2..7]
#include<samplerVertexImplementation>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_MATRIXNAME_,albedo,_INFONAME_,AlbedoInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_MATRIXNAME_,reflectivity,_INFONAME_,ReflectivityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_MATRIXNAME_,microSurfaceSampler,_INFONAME_,MicroSurfaceSamplerInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_MATRIXNAME_,metallicReflectance,_INFONAME_,MetallicReflectanceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_MATRIXNAME_,reflectance,_INFONAME_,ReflectanceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)
#ifdef CLEARCOAT
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_MATRIXNAME_,clearCoat,_INFONAME_,ClearCoatInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness,_MATRIXNAME_,clearCoatRoughness,_INFONAME_,ClearCoatInfos.z)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_MATRIXNAME_,clearCoatBump,_INFONAME_,ClearCoatBumpInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_MATRIXNAME_,clearCoatTint,_INFONAME_,ClearCoatTintInfos.x)
#endif
#ifdef IRIDESCENCE
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_MATRIXNAME_,iridescence,_INFONAME_,IridescenceInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_MATRIXNAME_,iridescenceThickness,_INFONAME_,IridescenceInfos.z)
#endif
#ifdef SHEEN
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness,_MATRIXNAME_,sheenRoughness,_INFONAME_,SheenInfos.z)
#endif
#ifdef ANISOTROPIC
#include<samplerVertexImplementation>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_MATRIXNAME_,anisotropy,_INFONAME_,AnisotropyInfos.x)
#endif
#ifdef SUBSURFACE
#include<samplerVertexImplementation>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_MATRIXNAME_,thickness,_INFONAME_,ThicknessInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_MATRIXNAME_,refractionIntensity,_INFONAME_,RefractionIntensityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_MATRIXNAME_,translucencyIntensity,_INFONAME_,TranslucencyIntensityInfos.x)
#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_MATRIXNAME_,translucencyColor,_INFONAME_,TranslucencyColorInfos.x)
#endif
#include<bumpVertex>
#include<clipPlaneVertex>
#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]
#include<vertexColorMixing>
#if defined(POINTSIZE) && !defined(WEBGPU)
gl_PointSize=pointSize;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[pbr_vertex_name] = pbr_vertex_shader;
/** @internal */
const pbrVertexShader = { name: pbr_vertex_name, shader: pbr_vertex_shader };
//# sourceMappingURL=pbr.vertex.js.map

/***/ }),

/***/ 29698:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   pickingPixelShader: () => (/* binding */ pickingPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "pickingPixelShader";
const shader = `#if defined(INSTANCES)
varying vec4 vMeshID;
#else
uniform vec4 meshID;
#endif
void main(void) {
#if defined(INSTANCES)
gl_FragColor=vMeshID;
#else
gl_FragColor=meshID;
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const pickingPixelShader = { name, shader };
//# sourceMappingURL=picking.fragment.js.map

/***/ }),

/***/ 99992:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   pickingVertexShader: () => (/* binding */ pickingVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_bonesDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69707);
/* harmony import */ var _ShadersInclude_bakedVertexAnimationDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18959);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobalDeclaration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27999);
/* harmony import */ var _ShadersInclude_morphTargetsVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90738);
/* harmony import */ var _ShadersInclude_instancesDeclaration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1218);
/* harmony import */ var _ShadersInclude_morphTargetsVertexGlobal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48451);
/* harmony import */ var _ShadersInclude_morphTargetsVertex_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(15060);
/* harmony import */ var _ShadersInclude_instancesVertex_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3298);
/* harmony import */ var _ShadersInclude_bonesVertex_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3361);
/* harmony import */ var _ShadersInclude_bakedVertexAnimation_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65523);
// Do not edit.











const name = "pickingVertexShader";
const shader = `attribute vec3 position;
#if defined(INSTANCES)
attribute vec4 instanceMeshID;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
uniform mat4 viewProjection;
#if defined(INSTANCES)
varying vec4 vMeshID;
#endif
void main(void) {
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;
#if defined(INSTANCES)
vMeshID=instanceMeshID;
#endif
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const pickingVertexShader = { name, shader };
//# sourceMappingURL=picking.vertex.js.map

/***/ }),

/***/ 16612:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   postprocessVertexShader: () => (/* binding */ postprocessVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "postprocessVertexShader";
const shader = `attribute vec2 position;uniform vec2 scale;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vUV=(position*madd+madd)*scale;gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const postprocessVertexShader = { name, shader };
//# sourceMappingURL=postprocess.vertex.js.map

/***/ }),

/***/ 17156:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   proceduralVertexShader: () => (/* binding */ proceduralVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "proceduralVertexShader";
const shader = `attribute vec2 position;varying vec2 vPosition;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vPosition=position;vUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0);
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const proceduralVertexShader = { name, shader };
//# sourceMappingURL=procedural.vertex.js.map

/***/ }),

/***/ 9682:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   rgbdDecodePixelShader: () => (/* binding */ rgbdDecodePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
// Do not edit.


const name = "rgbdDecodePixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{gl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const rgbdDecodePixelShader = { name, shader };
//# sourceMappingURL=rgbdDecode.fragment.js.map

/***/ }),

/***/ 32646:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   rgbdEncodePixelShader: () => (/* binding */ rgbdEncodePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
// Do not edit.


const name = "rgbdEncodePixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;
#include<helperFunctions>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{gl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const rgbdEncodePixelShader = { name, shader };
//# sourceMappingURL=rgbdEncode.fragment.js.map

/***/ }),

/***/ 88826:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   rsmFullGlobalIlluminationPixelShader: () => (/* binding */ rsmFullGlobalIlluminationPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "rsmFullGlobalIlluminationPixelShader";
const shader = `/**
* The implementation is a direct application of the formula found in http:
*/
precision highp float;varying vec2 vUV;uniform mat4 rsmLightMatrix;uniform vec4 rsmInfo;uniform sampler2D textureSampler;uniform sampler2D normalSampler;uniform sampler2D rsmPositionW;uniform sampler2D rsmNormalW;uniform sampler2D rsmFlux;
#ifdef TRANSFORM_NORMAL
uniform mat4 invView;
#endif
vec3 computeIndirect(vec3 p,vec3 n) {vec3 indirectDiffuse=vec3(0.);float intensity=rsmInfo.z;float edgeArtifactCorrection=rsmInfo.w;vec4 texRSM=rsmLightMatrix*vec4(p,1.);texRSM.xy/=texRSM.w;texRSM.xy=texRSM.xy*0.5+0.5;int width=int(rsmInfo.x);int height=int(rsmInfo.y);for (int j=0; j<height; j++) {for (int i=0; i<width; i++) {ivec2 uv=ivec2(i,j);vec3 vplPositionW=texelFetch(rsmPositionW,uv,0).xyz;vec3 vplNormalW=texelFetch(rsmNormalW,uv,0).xyz*2.0-1.0;vec3 vplFlux=texelFetch(rsmFlux,uv,0).rgb;vplPositionW-=vplNormalW*edgeArtifactCorrection; 
float dist2=dot(vplPositionW-p,vplPositionW-p);indirectDiffuse+=vplFlux*max(0.,dot(n,vplPositionW-p))*max(0.,dot(vplNormalW,p-vplPositionW))/(dist2*dist2);}}
return clamp(indirectDiffuse*intensity,0.0,1.0);}
void main(void) 
{vec3 positionW=texture2D(textureSampler,vUV).xyz;vec3 normalW=texture2D(normalSampler,vUV).xyz;
#ifdef DECODE_NORMAL
normalW=normalW*2.0-1.0;
#endif
#ifdef TRANSFORM_NORMAL
normalW=(invView*vec4(normalW,0.)).xyz;
#endif
gl_FragColor.rgb=computeIndirect(positionW,normalW);gl_FragColor.a=1.0;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const rsmFullGlobalIlluminationPixelShader = { name, shader };
//# sourceMappingURL=rsmFullGlobalIllumination.fragment.js.map

/***/ }),

/***/ 3157:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   rsmGlobalIlluminationPixelShader: () => (/* binding */ rsmGlobalIlluminationPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "rsmGlobalIlluminationPixelShader";
const shader = `/**
* The implementation is an application of the formula found in http:
* For better results,it also adds a random (noise) rotation to the RSM samples (the noise artifacts are easier to remove than the banding artifacts).
*/
precision highp float;varying vec2 vUV;uniform mat4 rsmLightMatrix;uniform vec4 rsmInfo;uniform vec4 rsmInfo2;uniform sampler2D textureSampler;uniform sampler2D normalSampler;uniform sampler2D rsmPositionW;uniform sampler2D rsmNormalW;uniform sampler2D rsmFlux;uniform sampler2D rsmSamples;
#ifdef TRANSFORM_NORMAL
uniform mat4 invView;
#endif
float mod289(float x){return x-floor(x*(1.0/289.0))*289.0;}
vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}
vec4 perm(vec4 x){return mod289(((x*34.0)+1.0)*x);}
float noise(vec3 p){vec3 a=floor(p);vec3 d=p-a;d=d*d*(3.0-2.0*d);vec4 b=a.xxyy+vec4(0.0,1.0,0.0,1.0);vec4 k1=perm(b.xyxy);vec4 k2=perm(k1.xyxy+b.zzww);vec4 c=k2+a.zzzz;vec4 k3=perm(c);vec4 k4=perm(c+1.0);vec4 o1=fract(k3*(1.0/41.0));vec4 o2=fract(k4*(1.0/41.0));vec4 o3=o2*d.z+o1*(1.0-d.z);vec2 o4=o3.yw*d.x+o3.xz*(1.0-d.x);return o4.y*d.y+o4.x*(1.0-d.y);}
vec3 computeIndirect(vec3 p,vec3 n) {vec3 indirectDiffuse=vec3(0.);int numSamples=int(rsmInfo.x);float radius=rsmInfo.y;float intensity=rsmInfo.z;float edgeArtifactCorrection=rsmInfo.w;vec4 texRSM=rsmLightMatrix*vec4(p,1.);texRSM.xy/=texRSM.w;texRSM.xy=texRSM.xy*0.5+0.5;float angle=noise(p*rsmInfo2.x);float c=cos(angle);float s=sin(angle);for (int i=0; i<numSamples; i++) {vec3 rsmSample=texelFetch(rsmSamples,ivec2(i,0),0).xyz;float weightSquare=rsmSample.z;if (rsmInfo2.y==1.0) rsmSample.xy=vec2(rsmSample.x*c+rsmSample.y*s,-rsmSample.x*s+rsmSample.y*c);vec2 uv=texRSM.xy+rsmSample.xy*radius;if (uv.x<0. || uv.x>1. || uv.y<0. || uv.y>1.) continue;vec3 vplPositionW=textureLod(rsmPositionW,uv,0.).xyz;vec3 vplNormalW=textureLod(rsmNormalW,uv,0.).xyz*2.0-1.0;vec3 vplFlux=textureLod(rsmFlux,uv,0.).rgb;vplPositionW-=vplNormalW*edgeArtifactCorrection; 
float dist2=dot(vplPositionW-p,vplPositionW-p);indirectDiffuse+=vplFlux*weightSquare*max(0.,dot(n,vplPositionW-p))*max(0.,dot(vplNormalW,p-vplPositionW))/(dist2*dist2);}
return clamp(indirectDiffuse*intensity,0.0,1.0);}
void main(void) 
{vec3 positionW=texture2D(textureSampler,vUV).xyz;vec3 normalW=texture2D(normalSampler,vUV).xyz;
#ifdef DECODE_NORMAL
normalW=normalW*2.0-1.0;
#endif
#ifdef TRANSFORM_NORMAL
normalW=(invView*vec4(normalW,0.)).xyz;
#endif
gl_FragColor.rgb=computeIndirect(positionW,normalW);gl_FragColor.a=1.0;}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const rsmGlobalIlluminationPixelShader = { name, shader };
//# sourceMappingURL=rsmGlobalIllumination.fragment.js.map

/***/ }),

/***/ 94354:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   screenSpaceReflection2PixelShader: () => (/* binding */ screenSpaceReflection2PixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
/* harmony import */ var _ShadersInclude_pbrBRDFFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8709);
/* harmony import */ var _ShadersInclude_screenSpaceRayTrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69363);
// Do not edit.




const name = "screenSpaceReflection2PixelShader";
const shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)
#define TEXTURECUBEFUNC(s,c,lod) textureLod(s,c,lod)
#else
#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)
#define TEXTURECUBEFUNC(s,c,bias) textureCube(s,c,bias)
#endif
uniform sampler2D textureSampler;varying vec2 vUV;
#ifdef SSR_SUPPORTED
uniform sampler2D reflectivitySampler;uniform sampler2D normalSampler;uniform sampler2D depthSampler;
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
uniform sampler2D backDepthSampler;uniform float backSizeFactor;
#endif
#ifdef SSR_USE_ENVIRONMENT_CUBE
uniform samplerCube envCubeSampler;
#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC
uniform vec3 vReflectionPosition;uniform vec3 vReflectionSize;
#endif
#endif
uniform mat4 view;uniform mat4 invView;uniform mat4 projection;uniform mat4 invProjectionMatrix;uniform mat4 projectionPixel;uniform float nearPlaneZ;uniform float farPlaneZ;uniform float stepSize;uniform float maxSteps;uniform float strength;uniform float thickness;uniform float roughnessFactor;uniform float reflectionSpecularFalloffExponent;uniform float maxDistance;uniform float selfCollisionNumSkip;uniform float reflectivityThreshold;
#include<helperFunctions>
#include<pbrBRDFFunctions>
#include<screenSpaceRayTrace>
vec3 hash(vec3 a)
{a=fract(a*0.8);a+=dot(a,a.yxz+19.19);return fract((a.xxy+a.yxx)*a.zyx);}
float computeAttenuationForIntersection(ivec2 hitPixel,vec2 hitUV,vec3 vsRayOrigin,vec3 vsHitPoint,vec3 reflectionVector,float maxRayDistance,float numIterations) {float attenuation=1.0;
#ifdef SSR_ATTENUATE_SCREEN_BORDERS
vec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-hitUV.xy));attenuation*=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);
#endif
#ifdef SSR_ATTENUATE_INTERSECTION_DISTANCE
attenuation*=1.0-clamp(distance(vsRayOrigin,vsHitPoint)/maxRayDistance,0.0,1.0);
#endif
#ifdef SSR_ATTENUATE_INTERSECTION_NUMITERATIONS
attenuation*=1.0-(numIterations/maxSteps);
#endif
#ifdef SSR_ATTENUATE_BACKFACE_REFLECTION
vec3 reflectionNormal=texelFetch(normalSampler,hitPixel,0).xyz;float directionBasedAttenuation=smoothstep(-0.17,0.0,dot(reflectionNormal,-reflectionVector));attenuation*=directionBasedAttenuation;
#endif
return attenuation;}
#endif
void main()
{
#ifdef SSR_SUPPORTED
vec4 colorFull=TEXTUREFUNC(textureSampler,vUV,0.0);vec3 color=colorFull.rgb;vec4 reflectivity=TEXTUREFUNC(reflectivitySampler,vUV,0.0);
#ifndef SSR_DISABLE_REFLECTIVITY_TEST
if (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=reflectivityThreshold) {
#ifdef SSR_USE_BLUR
gl_FragColor=vec4(0.);
#else
gl_FragColor=colorFull;
#endif
return;}
#endif
#ifdef SSR_INPUT_IS_GAMMA_SPACE
color=toLinearSpace(color);
#endif
vec2 texSize=vec2(textureSize(depthSampler,0));vec3 csNormal=texelFetch(normalSampler,ivec2(vUV*texSize),0).xyz; 
#ifdef SSR_DECODE_NORMAL
csNormal=csNormal*2.0-1.0;
#endif
#ifdef SSR_NORMAL_IS_IN_WORLDSPACE
csNormal=(view*vec4(csNormal,0.0)).xyz;
#endif
float depth=texelFetch(depthSampler,ivec2(vUV*texSize),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
depth=linearizeDepth(depth,nearPlaneZ,farPlaneZ);
#endif
vec3 csPosition=computeViewPosFromUVDepth(vUV,depth,projection,invProjectionMatrix);
#ifdef ORTHOGRAPHIC_CAMERA
vec3 csViewDirection=vec3(0.,0.,1.);
#else
vec3 csViewDirection=normalize(csPosition);
#endif
vec3 csReflectedVector=reflect(csViewDirection,csNormal);
#ifdef SSR_USE_ENVIRONMENT_CUBE
vec3 wReflectedVector=vec3(invView*vec4(csReflectedVector,0.0));
#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC
vec4 worldPos=invView*vec4(csPosition,1.0);wReflectedVector=parallaxCorrectNormal(worldPos.xyz,normalize(wReflectedVector),vReflectionSize,vReflectionPosition);
#endif
#ifdef SSR_INVERTCUBICMAP
wReflectedVector.y*=-1.0;
#endif
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
wReflectedVector.z*=-1.0;
#endif
vec3 envColor=TEXTURECUBEFUNC(envCubeSampler,wReflectedVector,0.0).xyz;
#ifdef SSR_ENVIRONMENT_CUBE_IS_GAMMASPACE
envColor=toLinearSpace(envColor);
#endif
#else
vec3 envColor=color;
#endif
float reflectionAttenuation=1.0;bool rayHasHit=false;vec2 startPixel;vec2 hitPixel;vec3 hitPoint;float numIterations;
#ifdef SSRAYTRACE_DEBUG
vec3 debugColor;
#endif
#ifdef SSR_ATTENUATE_FACING_CAMERA
reflectionAttenuation*=1.0-smoothstep(0.25,0.5,dot(-csViewDirection,csReflectedVector));
#endif
if (reflectionAttenuation>0.0) {
#ifdef SSR_USE_BLUR
vec3 jitt=vec3(0.);
#else
float roughness=1.0-reflectivity.a;vec3 jitt=mix(vec3(0.0),hash(csPosition)-vec3(0.5),roughness)*roughnessFactor; 
#endif
vec2 uv2=vUV*texSize;float c=(uv2.x+uv2.y)*0.25;float jitter=mod(c,1.0); 
rayHasHit=traceScreenSpaceRay1(
csPosition,
normalize(csReflectedVector+jitt),
projectionPixel,
depthSampler,
texSize,
#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER
backDepthSampler,
backSizeFactor,
#endif
thickness,
nearPlaneZ,
farPlaneZ,
stepSize,
jitter,
maxSteps,
maxDistance,
selfCollisionNumSkip,
startPixel,
hitPixel,
hitPoint,
numIterations
#ifdef SSRAYTRACE_DEBUG
,debugColor
#endif
);}
#ifdef SSRAYTRACE_DEBUG
gl_FragColor=vec4(debugColor,1.);return;
#endif
vec3 F0=reflectivity.rgb;vec3 fresnel=fresnelSchlickGGX(max(dot(csNormal,-csViewDirection),0.0),F0,vec3(1.));vec3 SSR=envColor;if (rayHasHit) {vec3 reflectedColor=texelFetch(textureSampler,ivec2(hitPixel),0).rgb;
#ifdef SSR_INPUT_IS_GAMMA_SPACE
reflectedColor=toLinearSpace(reflectedColor);
#endif
reflectionAttenuation*=computeAttenuationForIntersection(ivec2(hitPixel),hitPixel/texSize,csPosition,hitPoint,csReflectedVector,maxDistance,numIterations);SSR=reflectedColor*reflectionAttenuation+(1.0-reflectionAttenuation)*envColor;}
#ifndef SSR_BLEND_WITH_FRESNEL
SSR*=fresnel;
#endif
#ifdef SSR_USE_BLUR
float blur_radius=0.0;float roughness=1.0-reflectivity.a*(1.0-roughnessFactor);if (roughness>0.001) {float cone_angle=min(roughness,0.999)*3.14159265*0.5;float cone_len=distance(startPixel,hitPixel);float op_len=2.0*tan(cone_angle)*cone_len; 
float a=op_len;float h=cone_len;float a2=a*a;float fh2=4.0f*h*h;blur_radius=(a*(sqrt(a2+fh2)-a))/(4.0f*h);}
gl_FragColor=vec4(SSR,blur_radius/255.0); 
#else
#ifdef SSR_BLEND_WITH_FRESNEL
vec3 reflectionMultiplier=clamp(pow(fresnel*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);
#else
vec3 reflectionMultiplier=clamp(pow(reflectivity.rgb*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);
#endif
vec3 colorMultiplier=1.0-reflectionMultiplier;vec3 finalColor=(color*colorMultiplier)+(SSR*reflectionMultiplier);
#ifdef SSR_OUTPUT_IS_GAMMA_SPACE
finalColor=toGammaSpace(finalColor);
#endif
gl_FragColor=vec4(finalColor,colorFull.a);
#endif
#else
gl_FragColor=TEXTUREFUNC(textureSampler,vUV,0.0);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const screenSpaceReflection2PixelShader = { name, shader };
//# sourceMappingURL=screenSpaceReflection2.fragment.js.map

/***/ }),

/***/ 68133:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   screenSpaceReflection2BlurPixelShader: () => (/* binding */ screenSpaceReflection2BlurPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "screenSpaceReflection2BlurPixelShader";
const shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)
#else
#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)
#endif
uniform sampler2D textureSampler;varying vec2 vUV;uniform vec2 texelOffsetScale;const float weights[8]=float[8] (0.071303,0.131514,0.189879,0.321392,0.452906, 0.584419,0.715932,0.847445);void processSample(vec2 uv,float i,vec2 stepSize,inout vec4 accumulator,inout float denominator)
{vec2 offsetUV=stepSize*i+uv;float coefficient=weights[int(2.0-abs(i))];accumulator+=TEXTUREFUNC(textureSampler,offsetUV,0.0)*coefficient;denominator+=coefficient;}
void main()
{vec4 colorFull=TEXTUREFUNC(textureSampler,vUV,0.0);if (dot(colorFull,vec4(1.0))==0.0) {gl_FragColor=colorFull;return;}
float blurRadius=colorFull.a*255.0; 
vec2 stepSize=texelOffsetScale.xy*blurRadius;vec4 accumulator=TEXTUREFUNC(textureSampler,vUV,0.0)*0.214607;float denominator=0.214607;processSample(vUV,1.0,stepSize,accumulator,denominator);processSample(vUV,1.0*0.2,stepSize,accumulator,denominator);processSample(vUV,1.0*0.4,stepSize,accumulator,denominator);processSample(vUV,1.0*0.6,stepSize,accumulator,denominator);processSample(vUV,1.0*0.8,stepSize,accumulator,denominator);processSample(vUV,1.0*1.2,stepSize,accumulator,denominator);processSample(vUV,1.0*1.4,stepSize,accumulator,denominator);processSample(vUV,1.0*1.6,stepSize,accumulator,denominator);processSample(vUV,1.0*1.8,stepSize,accumulator,denominator);processSample(vUV,1.0*2.0,stepSize,accumulator,denominator);processSample(vUV,-1.0,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.2,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.4,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.6,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.8,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.2,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.4,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.6,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.8,stepSize,accumulator,denominator);processSample(vUV,-1.0*2.0,stepSize,accumulator,denominator);gl_FragColor=vec4(accumulator.rgb/denominator,colorFull.a);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const screenSpaceReflection2BlurPixelShader = { name, shader };
//# sourceMappingURL=screenSpaceReflection2Blur.fragment.js.map

/***/ }),

/***/ 17406:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   screenSpaceReflection2BlurCombinerPixelShader: () => (/* binding */ screenSpaceReflection2BlurCombinerPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_helperFunctions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73325);
/* harmony import */ var _ShadersInclude_pbrBRDFFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8709);
/* harmony import */ var _ShadersInclude_screenSpaceRayTrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69363);
// Do not edit.




const name = "screenSpaceReflection2BlurCombinerPixelShader";
const shader = `uniform sampler2D textureSampler; 
uniform sampler2D mainSampler;uniform sampler2D reflectivitySampler;uniform float strength;uniform float reflectionSpecularFalloffExponent;uniform float reflectivityThreshold;varying vec2 vUV;
#include<helperFunctions>
#ifdef SSR_BLEND_WITH_FRESNEL
#include<pbrBRDFFunctions>
#include<screenSpaceRayTrace>
uniform mat4 projection;uniform mat4 invProjectionMatrix;uniform sampler2D normalSampler;uniform sampler2D depthSampler;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
uniform float nearPlaneZ;uniform float farPlaneZ;
#endif
#endif
void main()
{
#ifdef SSRAYTRACE_DEBUG
gl_FragColor=texture2D(textureSampler,vUV);
#else
vec3 SSR=texture2D(textureSampler,vUV).rgb;vec4 color=texture2D(mainSampler,vUV);vec4 reflectivity=texture2D(reflectivitySampler,vUV);
#ifndef SSR_DISABLE_REFLECTIVITY_TEST
if (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=reflectivityThreshold) {gl_FragColor=color;return;}
#endif
#ifdef SSR_INPUT_IS_GAMMA_SPACE
color=toLinearSpace(color);
#endif
#ifdef SSR_BLEND_WITH_FRESNEL
vec2 texSize=vec2(textureSize(depthSampler,0));vec3 csNormal=texelFetch(normalSampler,ivec2(vUV*texSize),0).xyz;float depth=texelFetch(depthSampler,ivec2(vUV*texSize),0).r;
#ifdef SSRAYTRACE_SCREENSPACE_DEPTH
depth=linearizeDepth(depth,nearPlaneZ,farPlaneZ);
#endif
vec3 csPosition=computeViewPosFromUVDepth(vUV,depth,projection,invProjectionMatrix);vec3 csViewDirection=normalize(csPosition);vec3 F0=reflectivity.rgb;vec3 fresnel=fresnelSchlickGGX(max(dot(csNormal,-csViewDirection),0.0),F0,vec3(1.));vec3 reflectionMultiplier=clamp(pow(fresnel*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);
#else
vec3 reflectionMultiplier=clamp(pow(reflectivity.rgb*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);
#endif
vec3 colorMultiplier=1.0-reflectionMultiplier;vec3 finalColor=(color.rgb*colorMultiplier)+(SSR*reflectionMultiplier);
#ifdef SSR_OUTPUT_IS_GAMMA_SPACE
finalColor=toGammaSpace(finalColor);
#endif
gl_FragColor=vec4(finalColor,color.a);
#endif
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const screenSpaceReflection2BlurCombinerPixelShader = { name, shader };
//# sourceMappingURL=screenSpaceReflection2BlurCombiner.fragment.js.map

/***/ }),

/***/ 70169:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  shadowMapPixelShader: () => (/* binding */ shadowMapPixelShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/packingFunctions.js
var packingFunctions = __webpack_require__(8334);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bayerDitherFunctions.js
// Do not edit.

const bayerDitherFunctions_name = "bayerDitherFunctions";
const shader = `float bayerDither2(vec2 _P) {return mod(2.0*_P.y+_P.x+1.0,4.0);}
float bayerDither4(vec2 _P) {vec2 P1=mod(_P,2.0); 
vec2 P2=floor(0.5*mod(_P,4.0)); 
return 4.0*bayerDither2(P1)+bayerDither2(P2);}
float bayerDither8(vec2 _P) {vec2 P1=mod(_P,2.0); 
vec2 P2=floor(0.5 *mod(_P,4.0)); 
vec2 P4=floor(0.25*mod(_P,8.0)); 
return 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[bayerDitherFunctions_name] = shader;
/** @internal */
const bayerDitherFunctions = { name: bayerDitherFunctions_name, shader };
//# sourceMappingURL=bayerDitherFunctions.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragmentExtraDeclaration.js
// Do not edit.



const shadowMapFragmentExtraDeclaration_name = "shadowMapFragmentExtraDeclaration";
const shadowMapFragmentExtraDeclaration_shader = `#if SM_FLOAT==0
#include<packingFunctions>
#endif
#if SM_SOFTTRANSPARENTSHADOW==1
#include<bayerDitherFunctions>
uniform vec2 softTransparentShadowSM;
#endif
varying float vDepthMetricSM;
#if SM_USEDISTANCE==1
uniform vec3 lightDataSM;varying vec3 vPositionWSM;
#endif
uniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM;
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
varying float zSM;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[shadowMapFragmentExtraDeclaration_name] = shadowMapFragmentExtraDeclaration_shader;
/** @internal */
const shadowMapFragmentExtraDeclaration = { name: shadowMapFragmentExtraDeclaration_name, shader: shadowMapFragmentExtraDeclaration_shader };
//# sourceMappingURL=shadowMapFragmentExtraDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(6194);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(7412);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragment.js
var shadowMapFragment = __webpack_require__(98322);
;// ./node_modules/@babylonjs/core/Shaders/shadowMap.fragment.js
// Do not edit.





const shadowMap_fragment_name = "shadowMapPixelShader";
const shadowMap_fragment_shader = `#include<shadowMapFragmentExtraDeclaration>
#ifdef ALPHATEXTURE
varying vec2 vUV;uniform sampler2D diffuseSampler;
#endif
#include<clipPlaneFragmentDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#include<clipPlaneFragment>
#ifdef ALPHATEXTURE
vec4 opacityMap=texture2D(diffuseSampler,vUV);float alphaFromAlphaTexture=opacityMap.a;
#if SM_SOFTTRANSPARENTSHADOW==1
if (softTransparentShadowSM.y==1.0) {opacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);alphaFromAlphaTexture=opacityMap.x+opacityMap.y+opacityMap.z;}
#endif
#ifdef ALPHATESTVALUE
if (alphaFromAlphaTexture<ALPHATESTVALUE)
discard;
#endif
#endif
#if SM_SOFTTRANSPARENTSHADOW==1
#ifdef ALPHATEXTURE
if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM.x*alphaFromAlphaTexture) discard;
#else
if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM.x) discard;
#endif
#endif
#include<shadowMapFragment>
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[shadowMap_fragment_name] = shadowMap_fragment_shader;
/** @internal */
const shadowMapPixelShader = { name: shadowMap_fragment_name, shader: shadowMap_fragment_shader };
//# sourceMappingURL=shadowMap.fragment.js.map

/***/ }),

/***/ 29468:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  shadowMapVertexShader: () => (/* binding */ shadowMapVertexShader)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(69707);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(18959);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__(27999);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__(90738);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(73325);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneVertexDeclaration.js
// Do not edit.

const sceneVertexDeclaration_name = "sceneVertexDeclaration";
const shader = `uniform mat4 viewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;
#endif
uniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition;
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[sceneVertexDeclaration_name] = shader;
/** @internal */
const sceneVertexDeclaration = { name: sceneVertexDeclaration_name, shader };
//# sourceMappingURL=sceneVertexDeclaration.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshVertexDeclaration.js
// Do not edit.

const meshVertexDeclaration_name = "meshVertexDeclaration";
const meshVertexDeclaration_shader = `uniform mat4 world;uniform float visibility;
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[meshVertexDeclaration_name] = meshVertexDeclaration_shader;
/** @internal */
const meshVertexDeclaration = { name: meshVertexDeclaration_name, shader: meshVertexDeclaration_shader };
//# sourceMappingURL=meshVertexDeclaration.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexDeclaration.js
// Do not edit.



const shadowMapVertexDeclaration_name = "shadowMapVertexDeclaration";
const shadowMapVertexDeclaration_shader = `#include<sceneVertexDeclaration>
#include<meshVertexDeclaration>
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[shadowMapVertexDeclaration_name] = shadowMapVertexDeclaration_shader;
/** @internal */
const shadowMapVertexDeclaration = { name: shadowMapVertexDeclaration_name, shader: shadowMapVertexDeclaration_shader };
//# sourceMappingURL=shadowMapVertexDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js
var sceneUboDeclaration = __webpack_require__(28764);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js
var meshUboDeclaration = __webpack_require__(96467);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapUboDeclaration.js
// Do not edit.



const shadowMapUboDeclaration_name = "shadowMapUboDeclaration";
const shadowMapUboDeclaration_shader = `layout(std140,column_major) uniform;
#include<sceneUboDeclaration>
#include<meshUboDeclaration>
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[shadowMapUboDeclaration_name] = shadowMapUboDeclaration_shader;
/** @internal */
const shadowMapUboDeclaration = { name: shadowMapUboDeclaration_name, shader: shadowMapUboDeclaration_shader };
//# sourceMappingURL=shadowMapUboDeclaration.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexExtraDeclaration.js
// Do not edit.

const shadowMapVertexExtraDeclaration_name = "shadowMapVertexExtraDeclaration";
const shadowMapVertexExtraDeclaration_shader = `#if SM_NORMALBIAS==1
uniform vec3 lightDataSM;
#endif
uniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM;varying float vDepthMetricSM;
#if SM_USEDISTANCE==1
varying vec3 vPositionWSM;
#endif
#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1
varying float zSM;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[shadowMapVertexExtraDeclaration_name] = shadowMapVertexExtraDeclaration_shader;
/** @internal */
const shadowMapVertexExtraDeclaration = { name: shadowMapVertexExtraDeclaration_name, shader: shadowMapVertexExtraDeclaration_shader };
//# sourceMappingURL=shadowMapVertexExtraDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(71636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__(48451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__(15060);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(3298);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(3361);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(65523);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexNormalBias.js
// Do not edit.

const shadowMapVertexNormalBias_name = "shadowMapVertexNormalBias";
const shadowMapVertexNormalBias_shader = `#if SM_NORMALBIAS==1
#if SM_DIRECTIONINLIGHTDATA==1
vec3 worldLightDirSM=normalize(-lightDataSM.xyz);
#else
vec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;vec3 worldLightDirSM=normalize(directionToLightSM);
#endif
float ndlSM=dot(vNormalW,worldLightDirSM);float sinNLSM=sqrt(1.0-ndlSM*ndlSM);float normalBiasSM=biasAndScaleSM.y*sinNLSM;worldPos.xyz-=vNormalW*normalBiasSM;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[shadowMapVertexNormalBias_name] = shadowMapVertexNormalBias_shader;
/** @internal */
const shadowMapVertexNormalBias = { name: shadowMapVertexNormalBias_name, shader: shadowMapVertexNormalBias_shader };
//# sourceMappingURL=shadowMapVertexNormalBias.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexMetric.js
var shadowMapVertexMetric = __webpack_require__(29796);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(47314);
;// ./node_modules/@babylonjs/core/Shaders/shadowMap.vertex.js
// Do not edit.


















const shadowMap_vertex_name = "shadowMapVertexShader";
const shadowMap_vertex_shader = `attribute vec3 position;
#ifdef NORMAL
attribute vec3 normal;
#endif
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#ifdef INSTANCES
attribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3;
#endif
#include<helperFunctions>
#include<__decl__shadowMapVertex>
#ifdef ALPHATEXTURE
varying vec2 vUV;uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#include<shadowMapVertexExtraDeclaration>
#include<clipPlaneVertexDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;
#ifdef UV1
vec2 uvUpdated=uv;
#endif
#ifdef NORMAL
vec3 normalUpdated=normal;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
#ifdef NORMAL
mat3 normWorldSM=mat3(finalWorld);
#if defined(INSTANCES) && defined(THIN_INSTANCES)
vec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);
#else
#ifdef NONUNIFORMSCALING
normWorldSM=transposeMat3(inverseMat3(normWorldSM));
#endif
vec3 vNormalW=normalize(normWorldSM*normalUpdated);
#endif
#endif
#include<shadowMapVertexNormalBias>
gl_Position=viewProjection*worldPos;
#include<shadowMapVertexMetric>
#ifdef ALPHATEXTURE
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
#include<clipPlaneVertex>
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[shadowMap_vertex_name] = shadowMap_vertex_shader;
/** @internal */
const shadowMapVertexShader = { name: shadowMap_vertex_name, shader: shadowMap_vertex_shader };
//# sourceMappingURL=shadowMap.vertex.js.map

/***/ }),

/***/ 78438:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   sharpenPixelShader: () => (/* binding */ sharpenPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "sharpenPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 sharpnessAmounts;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec2 onePixel=vec2(1.0,1.0)/screenSize;vec4 color=texture2D(textureSampler,vUV);vec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) +
texture2D(textureSampler,vUV+onePixel*vec2(-1,0)) +
texture2D(textureSampler,vUV+onePixel*vec2(1,0)) +
texture2D(textureSampler,vUV+onePixel*vec2(0,1)) -
color*4.0;gl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const sharpenPixelShader = { name, shader };
//# sourceMappingURL=sharpen.fragment.js.map

/***/ }),

/***/ 12093:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   spritesPixelShader: () => (/* binding */ spritesPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_fogFragmentDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7806);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34581);
/* harmony import */ var _ShadersInclude_logDepthFragment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29741);
/* harmony import */ var _ShadersInclude_fogFragment_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2360);
/* harmony import */ var _ShadersInclude_imageProcessingCompatibility_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31328);
// Do not edit.






const name = "spritesPixelShader";
const shader = `#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
uniform bool alphaTest;varying vec4 vColor;varying vec2 vUV;uniform sampler2D diffuseSampler;
#include<fogFragmentDeclaration>
#include<logDepthDeclaration>
#define CUSTOM_FRAGMENT_DEFINITIONS
#ifdef PIXEL_PERFECT
vec2 uvPixelPerfect(vec2 uv) {vec2 res=vec2(textureSize(diffuseSampler,0));uv=uv*res;vec2 seam=floor(uv+0.5);uv=seam+clamp((uv-seam)/fwidth(uv),-0.5,0.5);return uv/res;}
#endif
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
#ifdef PIXEL_PERFECT
vec2 uv=uvPixelPerfect(vUV);
#else
vec2 uv=vUV;
#endif
vec4 color=texture2D(diffuseSampler,uv);float fAlphaTest=float(alphaTest);if (fAlphaTest != 0.)
{if (color.a<0.95)
discard;}
color*=vColor;
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;
#include<imageProcessingCompatibility>
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const spritesPixelShader = { name, shader };
//# sourceMappingURL=sprites.fragment.js.map

/***/ }),

/***/ 79831:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   spritesVertexShader: () => (/* binding */ spritesVertexShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
/* harmony import */ var _ShadersInclude_fogVertexDeclaration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86560);
/* harmony import */ var _ShadersInclude_logDepthDeclaration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34581);
/* harmony import */ var _ShadersInclude_logDepthVertex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2215);
// Do not edit.




const name = "spritesVertexShader";
const shader = `attribute vec4 position;attribute vec2 options;attribute vec2 offsets;attribute vec2 inverts;attribute vec4 cellInfo;attribute vec4 color;uniform mat4 view;uniform mat4 projection;varying vec2 vUV;varying vec4 vColor;
#include<fogVertexDeclaration>
#include<logDepthDeclaration>
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 viewPos=(view*vec4(position.xyz,1.0)).xyz; 
vec2 cornerPos;float angle=position.w;vec2 size=vec2(options.x,options.y);vec2 offset=offsets.xy;cornerPos=vec2(offset.x-0.5,offset.y -0.5)*size;vec3 rotatedCorner;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;viewPos+=rotatedCorner;gl_Position=projection*vec4(viewPos,1.0); 
vColor=color;vec2 uvOffset=vec2(abs(offset.x-inverts.x),abs(1.0-offset.y-inverts.y));vec2 uvPlace=cellInfo.xy;vec2 uvSize=cellInfo.zw;vUV.x=uvPlace.x+uvSize.x*uvOffset.x;vUV.y=uvPlace.y+uvSize.y*uvOffset.y;
#ifdef FOG
vFogDistance=viewPos;
#endif
#include<logDepthVertex>
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const spritesVertexShader = { name, shader };
//# sourceMappingURL=sprites.vertex.js.map

/***/ }),

/***/ 85363:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ssao2PixelShader: () => (/* binding */ ssao2PixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "ssao2PixelShader";
const shader = `precision highp float;uniform sampler2D textureSampler;varying vec2 vUV;
#ifdef SSAO
float scales[16]=float[16](
0.1,
0.11406250000000001,
0.131640625,
0.15625,
0.187890625,
0.2265625,
0.272265625,
0.325,
0.384765625,
0.4515625,
0.525390625,
0.60625,
0.694140625,
0.7890625,
0.891015625,
1.0
);uniform float near;uniform float radius;uniform sampler2D depthSampler;uniform sampler2D randomSampler;uniform sampler2D normalSampler;uniform float randTextureTiles;uniform float samplesFactor;uniform vec3 sampleSphere[SAMPLES];uniform float totalStrength;uniform float base;uniform float xViewport;uniform float yViewport;uniform mat3 depthProjection;uniform float maxZ;uniform float minZAspect;uniform vec2 texelSize;uniform mat4 projection;void main()
{vec3 random=textureLod(randomSampler,vUV*randTextureTiles,0.0).rgb;float depth=textureLod(depthSampler,vUV,0.0).r;float depthSign=sign(depth);depth=depth*depthSign;vec3 normal=textureLod(normalSampler,vUV,0.0).rgb;float occlusion=0.0;float correctedRadius=min(radius,minZAspect*depth/near);vec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);vec3 vDepthFactor=depthProjection*vec3(1.0,1.0,depth);vec3 origin=vViewRay*vDepthFactor;vec3 rvec=random*2.0-1.0;rvec.z=0.0;float dotProduct=dot(rvec,normal);rvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);vec3 tangent=normalize(rvec-normal*dot(rvec,normal));vec3 bitangent=cross(normal,tangent);mat3 tbn=mat3(tangent,bitangent,normal);float difference;for (int i=0; i<SAMPLES; ++i) {vec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];samplePosition=samplePosition*correctedRadius+origin;vec4 offset=vec4(samplePosition,1.0);offset=projection*offset;offset.xyz/=offset.w;offset.xy=offset.xy*0.5+0.5;if (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {continue;}
float sampleDepth=abs(textureLod(depthSampler,offset.xy,0.0).r);difference=depthSign*samplePosition.z-sampleDepth;float rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);occlusion+=step(EPSILON,difference)*rangeCheck;}
occlusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));float ao=1.0-totalStrength*occlusion*samplesFactor;float result=clamp(ao+base,0.0,1.0);gl_FragColor=vec4(vec3(result),1.0);}
#endif
#ifdef BLUR
uniform float outSize;uniform float soften;uniform float tolerance;uniform int samples;
#ifndef BLUR_BYPASS
uniform sampler2D depthSampler;
#ifdef BLUR_LEGACY
#define inline
float blur13Bilateral(sampler2D image,vec2 uv,vec2 step) {float result=0.0;vec2 off1=vec2(1.411764705882353)*step;vec2 off2=vec2(3.2941176470588234)*step;vec2 off3=vec2(5.176470588235294)*step;float compareDepth=abs(textureLod(depthSampler,uv,0.0).r);float sampleDepth;float weight;float weightSum=30.0;result+=textureLod(image,uv,0.0).r*30.0;sampleDepth=abs(textureLod(depthSampler,uv+off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureLod(image,uv+off1,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off1,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+= weight;result+=textureLod(image,uv-off1,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv+off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv+off2,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off2,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv-off2,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv+off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv+off3,0.0).r*weight;sampleDepth=abs(textureLod(depthSampler,uv-off3,0.0).r);weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);weightSum+=weight;result+=textureLod(image,uv-off3,0.0).r*weight;return result/weightSum;}
#endif
#endif
void main()
{float result=0.0;
#ifdef BLUR_BYPASS
result=textureLod(textureSampler,vUV,0.0).r;
#else
#ifdef BLUR_H
vec2 step=vec2(1.0/outSize,0.0);
#else
vec2 step=vec2(0.0,1.0/outSize);
#endif
#ifdef BLUR_LEGACY
result=blur13Bilateral(textureSampler,vUV,step);
#else
float compareDepth=abs(textureLod(depthSampler,vUV,0.0).r);float weightSum=0.0;for (int i=-samples; i<samples; i+=2)
{vec2 samplePos=vUV+step*(float(i)+0.5);float sampleDepth=abs(textureLod(depthSampler,samplePos,0.0).r);float falloff=smoothstep(0.0,
float(samples),
float(samples)-abs(float(i))*soften);float minDivider=tolerance*0.5+0.003;float weight=falloff/( minDivider+abs(compareDepth-sampleDepth));result+=textureLod(textureSampler,samplePos,0.0).r*weight;weightSum+=weight;}
result/=weightSum;
#endif
#endif
gl_FragColor.rgb=vec3(result);gl_FragColor.a=1.0;}
#endif
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const ssao2PixelShader = { name, shader };
//# sourceMappingURL=ssao2.fragment.js.map

/***/ }),

/***/ 74154:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ssaoCombinePixelShader: () => (/* binding */ ssaoCombinePixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "ssaoCombinePixelShader";
const shader = `uniform sampler2D textureSampler;uniform sampler2D originalColor;uniform vec4 viewport;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec4 ssaoColor=texture2D(textureSampler,viewport.xy+vUV*viewport.zw);vec4 sceneColor=texture2D(originalColor,vUV);gl_FragColor=sceneColor*ssaoColor;
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const ssaoCombinePixelShader = { name, shader };
//# sourceMappingURL=ssaoCombine.fragment.js.map

/***/ }),

/***/ 71405:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   taaPixelShader: () => (/* binding */ taaPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "taaPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D historySampler;uniform float factor;void main() {vec4 c=texelFetch(textureSampler,ivec2(gl_FragCoord.xy),0);vec4 h=texelFetch(historySampler,ivec2(gl_FragCoord.xy),0);gl_FragColor=mix(h,c,factor);}
`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const taaPixelShader = { name, shader };
//# sourceMappingURL=taa.fragment.js.map

/***/ }),

/***/ 17985:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   tonemapPixelShader: () => (/* binding */ tonemapPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "tonemapPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float _ExposureAdjustment;
#if defined(HABLE_TONEMAPPING)
const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;const float W=11.2;
#endif
float Luminance(vec3 c)
{return dot(c,vec3(0.22,0.707,0.071));}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec3 colour=texture2D(textureSampler,vUV).rgb;
#if defined(REINHARD_TONEMAPPING)
float lum=Luminance(colour.rgb); 
float lumTm=lum*_ExposureAdjustment;float scale=lumTm/(1.0+lumTm); 
colour*=scale/lum;
#elif defined(HABLE_TONEMAPPING)
colour*=_ExposureAdjustment;const float ExposureBias=2.0;vec3 x=ExposureBias*colour;vec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;x=vec3(W,W,W);vec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);colour=curr*whiteScale;
#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)
colour*=_ExposureAdjustment;vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);vec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);colour=retColor*retColor;
#elif defined(PHOTOGRAPHIC_TONEMAPPING)
colour= vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);
#endif
gl_FragColor=vec4(colour.rgb,1.0);}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const tonemapPixelShader = { name, shader };
//# sourceMappingURL=tonemap.fragment.js.map

/***/ }),

/***/ 21830:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   vrDistortionCorrectionPixelShader: () => (/* binding */ vrDistortionCorrectionPixelShader)
/* harmony export */ });
/* harmony import */ var _Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69610);
// Do not edit.

const name = "vrDistortionCorrectionPixelShader";
const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 LensCenter;uniform vec2 Scale;uniform vec2 ScaleIn;uniform vec4 HmdWarpParam;vec2 HmdWarp(vec2 in01) {vec2 theta=(in01-LensCenter)*ScaleIn; 
float rSq=theta.x*theta.x+theta.y*theta.y;vec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);return LensCenter+Scale*rvector;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec2 tc=HmdWarp(vUV);if (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)
gl_FragColor=vec4(0.0,0.0,0.0,0.0);else{gl_FragColor=texture2D(textureSampler,tc);}}`;
// Sideeffect
_Engines_shaderStore_js__WEBPACK_IMPORTED_MODULE_0__/* .ShaderStore */ .l.ShadersStore[name] = shader;
/** @internal */
const vrDistortionCorrectionPixelShader = { name, shader };
//# sourceMappingURL=vrDistortionCorrection.fragment.js.map

/***/ }),

/***/ 26614:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   i: () => (/* binding */ AlphaState)
/* harmony export */ });
/**
 * @internal
 **/
class AlphaState {
    /**
     * Initializes the state.
     */
    constructor() {
        this._blendFunctionParameters = new Array(4);
        this._blendEquationParameters = new Array(2);
        this._blendConstants = new Array(4);
        this._isBlendConstantsDirty = false;
        this._alphaBlend = false;
        this._isAlphaBlendDirty = false;
        this._isBlendFunctionParametersDirty = false;
        this._isBlendEquationParametersDirty = false;
        this.reset();
    }
    get isDirty() {
        return this._isAlphaBlendDirty || this._isBlendFunctionParametersDirty || this._isBlendEquationParametersDirty;
    }
    get alphaBlend() {
        return this._alphaBlend;
    }
    set alphaBlend(value) {
        if (this._alphaBlend === value) {
            return;
        }
        this._alphaBlend = value;
        this._isAlphaBlendDirty = true;
    }
    setAlphaBlendConstants(r, g, b, a) {
        if (this._blendConstants[0] === r && this._blendConstants[1] === g && this._blendConstants[2] === b && this._blendConstants[3] === a) {
            return;
        }
        this._blendConstants[0] = r;
        this._blendConstants[1] = g;
        this._blendConstants[2] = b;
        this._blendConstants[3] = a;
        this._isBlendConstantsDirty = true;
    }
    setAlphaBlendFunctionParameters(value0, value1, value2, value3) {
        if (this._blendFunctionParameters[0] === value0 &&
            this._blendFunctionParameters[1] === value1 &&
            this._blendFunctionParameters[2] === value2 &&
            this._blendFunctionParameters[3] === value3) {
            return;
        }
        this._blendFunctionParameters[0] = value0;
        this._blendFunctionParameters[1] = value1;
        this._blendFunctionParameters[2] = value2;
        this._blendFunctionParameters[3] = value3;
        this._isBlendFunctionParametersDirty = true;
    }
    setAlphaEquationParameters(rgb, alpha) {
        if (this._blendEquationParameters[0] === rgb && this._blendEquationParameters[1] === alpha) {
            return;
        }
        this._blendEquationParameters[0] = rgb;
        this._blendEquationParameters[1] = alpha;
        this._isBlendEquationParametersDirty = true;
    }
    reset() {
        this._alphaBlend = false;
        this._blendFunctionParameters[0] = null;
        this._blendFunctionParameters[1] = null;
        this._blendFunctionParameters[2] = null;
        this._blendFunctionParameters[3] = null;
        this._blendEquationParameters[0] = null;
        this._blendEquationParameters[1] = null;
        this._blendConstants[0] = null;
        this._blendConstants[1] = null;
        this._blendConstants[2] = null;
        this._blendConstants[3] = null;
        this._isAlphaBlendDirty = true;
        this._isBlendFunctionParametersDirty = false;
        this._isBlendEquationParametersDirty = false;
        this._isBlendConstantsDirty = false;
    }
    apply(gl) {
        if (!this.isDirty) {
            return;
        }
        // Alpha blend
        if (this._isAlphaBlendDirty) {
            if (this._alphaBlend) {
                gl.enable(gl.BLEND);
            }
            else {
                gl.disable(gl.BLEND);
            }
            this._isAlphaBlendDirty = false;
        }
        // Alpha function
        if (this._isBlendFunctionParametersDirty) {
            gl.blendFuncSeparate(this._blendFunctionParameters[0], this._blendFunctionParameters[1], this._blendFunctionParameters[2], this._blendFunctionParameters[3]);
            this._isBlendFunctionParametersDirty = false;
        }
        // Alpha equation
        if (this._isBlendEquationParametersDirty) {
            gl.blendEquationSeparate(this._blendEquationParameters[0], this._blendEquationParameters[1]);
            this._isBlendEquationParametersDirty = false;
        }
        // Constants
        if (this._isBlendConstantsDirty) {
            gl.blendColor(this._blendConstants[0], this._blendConstants[1], this._blendConstants[2], this._blendConstants[3]);
            this._isBlendConstantsDirty = false;
        }
    }
}
//# sourceMappingURL=alphaCullingState.js.map

/***/ }),

/***/ 86867:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   N: () => (/* binding */ DepthCullingState)
/* harmony export */ });
/**
 * @internal
 **/
class DepthCullingState {
    /**
     * Initializes the state.
     * @param reset
     */
    constructor(reset = true) {
        this._isDepthTestDirty = false;
        this._isDepthMaskDirty = false;
        this._isDepthFuncDirty = false;
        this._isCullFaceDirty = false;
        this._isCullDirty = false;
        this._isZOffsetDirty = false;
        this._isFrontFaceDirty = false;
        if (reset) {
            this.reset();
        }
    }
    get isDirty() {
        return (this._isDepthFuncDirty ||
            this._isDepthTestDirty ||
            this._isDepthMaskDirty ||
            this._isCullFaceDirty ||
            this._isCullDirty ||
            this._isZOffsetDirty ||
            this._isFrontFaceDirty);
    }
    get zOffset() {
        return this._zOffset;
    }
    set zOffset(value) {
        if (this._zOffset === value) {
            return;
        }
        this._zOffset = value;
        this._isZOffsetDirty = true;
    }
    get zOffsetUnits() {
        return this._zOffsetUnits;
    }
    set zOffsetUnits(value) {
        if (this._zOffsetUnits === value) {
            return;
        }
        this._zOffsetUnits = value;
        this._isZOffsetDirty = true;
    }
    get cullFace() {
        return this._cullFace;
    }
    set cullFace(value) {
        if (this._cullFace === value) {
            return;
        }
        this._cullFace = value;
        this._isCullFaceDirty = true;
    }
    get cull() {
        return this._cull;
    }
    set cull(value) {
        if (this._cull === value) {
            return;
        }
        this._cull = value;
        this._isCullDirty = true;
    }
    get depthFunc() {
        return this._depthFunc;
    }
    set depthFunc(value) {
        if (this._depthFunc === value) {
            return;
        }
        this._depthFunc = value;
        this._isDepthFuncDirty = true;
    }
    get depthMask() {
        return this._depthMask;
    }
    set depthMask(value) {
        if (this._depthMask === value) {
            return;
        }
        this._depthMask = value;
        this._isDepthMaskDirty = true;
    }
    get depthTest() {
        return this._depthTest;
    }
    set depthTest(value) {
        if (this._depthTest === value) {
            return;
        }
        this._depthTest = value;
        this._isDepthTestDirty = true;
    }
    get frontFace() {
        return this._frontFace;
    }
    set frontFace(value) {
        if (this._frontFace === value) {
            return;
        }
        this._frontFace = value;
        this._isFrontFaceDirty = true;
    }
    reset() {
        this._depthMask = true;
        this._depthTest = true;
        this._depthFunc = null;
        this._cullFace = null;
        this._cull = null;
        this._zOffset = 0;
        this._zOffsetUnits = 0;
        this._frontFace = null;
        this._isDepthTestDirty = true;
        this._isDepthMaskDirty = true;
        this._isDepthFuncDirty = false;
        this._isCullFaceDirty = false;
        this._isCullDirty = false;
        this._isZOffsetDirty = true;
        this._isFrontFaceDirty = false;
    }
    apply(gl) {
        if (!this.isDirty) {
            return;
        }
        // Cull
        if (this._isCullDirty) {
            if (this.cull) {
                gl.enable(gl.CULL_FACE);
            }
            else {
                gl.disable(gl.CULL_FACE);
            }
            this._isCullDirty = false;
        }
        // Cull face
        if (this._isCullFaceDirty) {
            gl.cullFace(this.cullFace);
            this._isCullFaceDirty = false;
        }
        // Depth mask
        if (this._isDepthMaskDirty) {
            gl.depthMask(this.depthMask);
            this._isDepthMaskDirty = false;
        }
        // Depth test
        if (this._isDepthTestDirty) {
            if (this.depthTest) {
                gl.enable(gl.DEPTH_TEST);
            }
            else {
                gl.disable(gl.DEPTH_TEST);
            }
            this._isDepthTestDirty = false;
        }
        // Depth func
        if (this._isDepthFuncDirty) {
            gl.depthFunc(this.depthFunc);
            this._isDepthFuncDirty = false;
        }
        // zOffset
        if (this._isZOffsetDirty) {
            if (this.zOffset || this.zOffsetUnits) {
                gl.enable(gl.POLYGON_OFFSET_FILL);
                gl.polygonOffset(this.zOffset, this.zOffsetUnits);
            }
            else {
                gl.disable(gl.POLYGON_OFFSET_FILL);
            }
            this._isZOffsetDirty = false;
        }
        // Front face
        if (this._isFrontFaceDirty) {
            gl.frontFace(this.frontFace);
            this._isFrontFaceDirty = false;
        }
    }
}
//# sourceMappingURL=depthCullingState.js.map

/***/ }),

/***/ 56194:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   K: () => (/* binding */ StencilState)
/* harmony export */ });

/**
 * @internal
 **/
class StencilState {
    constructor() {
        this.reset();
    }
    reset() {
        this.enabled = false;
        this.mask = 0xff;
        this.func = StencilState.ALWAYS;
        this.funcRef = 1;
        this.funcMask = 0xff;
        this.opStencilFail = StencilState.KEEP;
        this.opDepthFail = StencilState.KEEP;
        this.opStencilDepthPass = StencilState.REPLACE;
    }
    get stencilFunc() {
        return this.func;
    }
    set stencilFunc(value) {
        this.func = value;
    }
    get stencilFuncRef() {
        return this.funcRef;
    }
    set stencilFuncRef(value) {
        this.funcRef = value;
    }
    get stencilFuncMask() {
        return this.funcMask;
    }
    set stencilFuncMask(value) {
        this.funcMask = value;
    }
    get stencilOpStencilFail() {
        return this.opStencilFail;
    }
    set stencilOpStencilFail(value) {
        this.opStencilFail = value;
    }
    get stencilOpDepthFail() {
        return this.opDepthFail;
    }
    set stencilOpDepthFail(value) {
        this.opDepthFail = value;
    }
    get stencilOpStencilDepthPass() {
        return this.opStencilDepthPass;
    }
    set stencilOpStencilDepthPass(value) {
        this.opStencilDepthPass = value;
    }
    get stencilMask() {
        return this.mask;
    }
    set stencilMask(value) {
        this.mask = value;
    }
    get stencilTest() {
        return this.enabled;
    }
    set stencilTest(value) {
        this.enabled = value;
    }
}
/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
StencilState.ALWAYS = 519;
/** Passed to stencilOperation to specify that stencil value must be kept */
StencilState.KEEP = 7680;
/** Passed to stencilOperation to specify that stencil value must be replaced */
StencilState.REPLACE = 7681;
//# sourceMappingURL=stencilState.js.map

/***/ }),

/***/ 82724:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   u: () => (/* binding */ StencilStateComposer)
/* harmony export */ });
/**
 * @internal
 **/
class StencilStateComposer {
    get isDirty() {
        return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty;
    }
    get func() {
        return this._func;
    }
    set func(value) {
        if (this._func === value) {
            return;
        }
        this._func = value;
        this._isStencilFuncDirty = true;
    }
    get funcRef() {
        return this._funcRef;
    }
    set funcRef(value) {
        if (this._funcRef === value) {
            return;
        }
        this._funcRef = value;
        this._isStencilFuncDirty = true;
    }
    get funcMask() {
        return this._funcMask;
    }
    set funcMask(value) {
        if (this._funcMask === value) {
            return;
        }
        this._funcMask = value;
        this._isStencilFuncDirty = true;
    }
    get opStencilFail() {
        return this._opStencilFail;
    }
    set opStencilFail(value) {
        if (this._opStencilFail === value) {
            return;
        }
        this._opStencilFail = value;
        this._isStencilOpDirty = true;
    }
    get opDepthFail() {
        return this._opDepthFail;
    }
    set opDepthFail(value) {
        if (this._opDepthFail === value) {
            return;
        }
        this._opDepthFail = value;
        this._isStencilOpDirty = true;
    }
    get opStencilDepthPass() {
        return this._opStencilDepthPass;
    }
    set opStencilDepthPass(value) {
        if (this._opStencilDepthPass === value) {
            return;
        }
        this._opStencilDepthPass = value;
        this._isStencilOpDirty = true;
    }
    get mask() {
        return this._mask;
    }
    set mask(value) {
        if (this._mask === value) {
            return;
        }
        this._mask = value;
        this._isStencilMaskDirty = true;
    }
    get enabled() {
        return this._enabled;
    }
    set enabled(value) {
        if (this._enabled === value) {
            return;
        }
        this._enabled = value;
        this._isStencilTestDirty = true;
    }
    constructor(reset = true) {
        this._isStencilTestDirty = false;
        this._isStencilMaskDirty = false;
        this._isStencilFuncDirty = false;
        this._isStencilOpDirty = false;
        this.useStencilGlobalOnly = false;
        if (reset) {
            this.reset();
        }
    }
    reset() {
        this.stencilMaterial = undefined;
        this.stencilGlobal?.reset();
        this._isStencilTestDirty = true;
        this._isStencilMaskDirty = true;
        this._isStencilFuncDirty = true;
        this._isStencilOpDirty = true;
    }
    apply(gl) {
        if (!gl) {
            return;
        }
        const stencilMaterialEnabled = !this.useStencilGlobalOnly && !!this.stencilMaterial?.enabled;
        this.enabled = stencilMaterialEnabled ? this.stencilMaterial.enabled : this.stencilGlobal.enabled;
        this.func = stencilMaterialEnabled ? this.stencilMaterial.func : this.stencilGlobal.func;
        this.funcRef = stencilMaterialEnabled ? this.stencilMaterial.funcRef : this.stencilGlobal.funcRef;
        this.funcMask = stencilMaterialEnabled ? this.stencilMaterial.funcMask : this.stencilGlobal.funcMask;
        this.opStencilFail = stencilMaterialEnabled ? this.stencilMaterial.opStencilFail : this.stencilGlobal.opStencilFail;
        this.opDepthFail = stencilMaterialEnabled ? this.stencilMaterial.opDepthFail : this.stencilGlobal.opDepthFail;
        this.opStencilDepthPass = stencilMaterialEnabled ? this.stencilMaterial.opStencilDepthPass : this.stencilGlobal.opStencilDepthPass;
        this.mask = stencilMaterialEnabled ? this.stencilMaterial.mask : this.stencilGlobal.mask;
        if (!this.isDirty) {
            return;
        }
        // Stencil test
        if (this._isStencilTestDirty) {
            if (this.enabled) {
                gl.enable(gl.STENCIL_TEST);
            }
            else {
                gl.disable(gl.STENCIL_TEST);
            }
            this._isStencilTestDirty = false;
        }
        // Stencil mask
        if (this._isStencilMaskDirty) {
            gl.stencilMask(this.mask);
            this._isStencilMaskDirty = false;
        }
        // Stencil func
        if (this._isStencilFuncDirty) {
            gl.stencilFunc(this.func, this.funcRef, this.funcMask);
            this._isStencilFuncDirty = false;
        }
        // Stencil op
        if (this._isStencilOpDirty) {
            gl.stencilOp(this.opStencilFail, this.opDepthFail, this.opStencilDepthPass);
            this._isStencilOpDirty = false;
        }
    }
}
//# sourceMappingURL=stencilStateComposer.js.map

/***/ }),

/***/ 75441:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _: () => (/* binding */ WebXRFeatureName),
/* harmony export */   n: () => (/* binding */ WebXRFeaturesManager)
/* harmony export */ });
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(998);

/**
 * A list of the currently available features without referencing them
 */
class WebXRFeatureName {
}
/**
 * The name of the anchor system feature
 */
WebXRFeatureName.ANCHOR_SYSTEM = "xr-anchor-system";
/**
 * The name of the background remover feature
 */
WebXRFeatureName.BACKGROUND_REMOVER = "xr-background-remover";
/**
 * The name of the hit test feature
 */
WebXRFeatureName.HIT_TEST = "xr-hit-test";
/**
 * The name of the mesh detection feature
 */
WebXRFeatureName.MESH_DETECTION = "xr-mesh-detection";
/**
 * physics impostors for xr controllers feature
 */
WebXRFeatureName.PHYSICS_CONTROLLERS = "xr-physics-controller";
/**
 * The name of the plane detection feature
 */
WebXRFeatureName.PLANE_DETECTION = "xr-plane-detection";
/**
 * The name of the pointer selection feature
 */
WebXRFeatureName.POINTER_SELECTION = "xr-controller-pointer-selection";
/**
 * The name of the teleportation feature
 */
WebXRFeatureName.TELEPORTATION = "xr-controller-teleportation";
/**
 * The name of the feature points feature.
 */
WebXRFeatureName.FEATURE_POINTS = "xr-feature-points";
/**
 * The name of the hand tracking feature.
 */
WebXRFeatureName.HAND_TRACKING = "xr-hand-tracking";
/**
 * The name of the image tracking feature
 */
WebXRFeatureName.IMAGE_TRACKING = "xr-image-tracking";
/**
 * The name of the near interaction feature
 */
WebXRFeatureName.NEAR_INTERACTION = "xr-near-interaction";
/**
 * The name of the DOM overlay feature
 */
WebXRFeatureName.DOM_OVERLAY = "xr-dom-overlay";
/**
 * The name of the movement feature
 */
WebXRFeatureName.MOVEMENT = "xr-controller-movement";
/**
 * The name of the light estimation feature
 */
WebXRFeatureName.LIGHT_ESTIMATION = "xr-light-estimation";
/**
 * The name of the eye tracking feature
 */
WebXRFeatureName.EYE_TRACKING = "xr-eye-tracking";
/**
 * The name of the walking locomotion feature
 */
WebXRFeatureName.WALKING_LOCOMOTION = "xr-walking-locomotion";
/**
 * The name of the composition layers feature
 */
WebXRFeatureName.LAYERS = "xr-layers";
/**
 * The name of the depth sensing feature
 */
WebXRFeatureName.DEPTH_SENSING = "xr-depth-sensing";
/**
 * The name of the WebXR Space Warp feature
 */
WebXRFeatureName.SPACE_WARP = "xr-space-warp";
/**
 * The name of the WebXR Raw Camera Access feature
 */
WebXRFeatureName.RAW_CAMERA_ACCESS = "xr-raw-camera-access";
/**
 * The WebXR features manager is responsible of enabling or disabling features required for the current XR session.
 * It is mainly used in AR sessions.
 *
 * A feature can have a version that is defined by Babylon (and does not correspond with the webxr version).
 */
class WebXRFeaturesManager {
    /**
     * constructs a new features manages.
     *
     * @param _xrSessionManager an instance of WebXRSessionManager
     */
    constructor(_xrSessionManager) {
        this._xrSessionManager = _xrSessionManager;
        this._features = {};
        // when session starts / initialized - attach
        this._xrSessionManager.onXRSessionInit.add(() => {
            this.getEnabledFeatures().forEach((featureName) => {
                const feature = this._features[featureName];
                if (feature.enabled && !feature.featureImplementation.attached && !feature.featureImplementation.disableAutoAttach) {
                    this.attachFeature(featureName);
                }
            });
        });
        // when session ends - detach
        this._xrSessionManager.onXRSessionEnded.add(() => {
            this.getEnabledFeatures().forEach((featureName) => {
                const feature = this._features[featureName];
                if (feature.enabled && feature.featureImplementation.attached) {
                    // detach, but don't disable!
                    this.detachFeature(featureName);
                }
            });
        });
    }
    /**
     * Used to register a module. After calling this function a developer can use this feature in the scene.
     * Mainly used internally.
     *
     * @param featureName the name of the feature to register
     * @param constructorFunction the function used to construct the module
     * @param version the (babylon) version of the module
     * @param stable is that a stable version of this module
     */
    static AddWebXRFeature(featureName, constructorFunction, version = 1, stable = false) {
        this._AvailableFeatures[featureName] = this._AvailableFeatures[featureName] || { latest: version };
        if (version > this._AvailableFeatures[featureName].latest) {
            this._AvailableFeatures[featureName].latest = version;
        }
        if (stable) {
            this._AvailableFeatures[featureName].stable = version;
        }
        this._AvailableFeatures[featureName][version] = constructorFunction;
    }
    /**
     * Returns a constructor of a specific feature.
     *
     * @param featureName the name of the feature to construct
     * @param version the version of the feature to load
     * @param xrSessionManager the xrSessionManager. Used to construct the module
     * @param options optional options provided to the module.
     * @returns a function that, when called, will return a new instance of this feature
     */
    static ConstructFeature(featureName, version = 1, xrSessionManager, options) {
        const constructorFunction = this._AvailableFeatures[featureName][version];
        if (!constructorFunction) {
            // throw an error? return nothing?
            throw new Error("feature not found");
        }
        return constructorFunction(xrSessionManager, options);
    }
    /**
     * Can be used to return the list of features currently registered
     *
     * @returns an Array of available features
     */
    static GetAvailableFeatures() {
        return Object.keys(this._AvailableFeatures);
    }
    /**
     * Gets the versions available for a specific feature
     * @param featureName the name of the feature
     * @returns an array with the available versions
     */
    static GetAvailableVersions(featureName) {
        return Object.keys(this._AvailableFeatures[featureName]);
    }
    /**
     * Return the latest unstable version of this feature
     * @param featureName the name of the feature to search
     * @returns the version number. if not found will return -1
     */
    static GetLatestVersionOfFeature(featureName) {
        return (this._AvailableFeatures[featureName] && this._AvailableFeatures[featureName].latest) || -1;
    }
    /**
     * Return the latest stable version of this feature
     * @param featureName the name of the feature to search
     * @returns the version number. if not found will return -1
     */
    static GetStableVersionOfFeature(featureName) {
        return (this._AvailableFeatures[featureName] && this._AvailableFeatures[featureName].stable) || -1;
    }
    /**
     * Attach a feature to the current session. Mainly used when session started to start the feature effect.
     * Can be used during a session to start a feature
     * @param featureName the name of feature to attach
     */
    attachFeature(featureName) {
        const feature = this._features[featureName];
        if (feature && feature.enabled && !feature.featureImplementation.attached) {
            const attached = feature.featureImplementation.attach();
            if (!attached) {
                _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0.Warn(`Feature ${featureName} failed to attach`);
            }
        }
    }
    /**
     * Can be used inside a session or when the session ends to detach a specific feature
     * @param featureName the name of the feature to detach
     */
    detachFeature(featureName) {
        const feature = this._features[featureName];
        if (feature && feature.featureImplementation.attached) {
            const detached = feature.featureImplementation.detach();
            if (!detached) {
                _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0.Warn(`Feature ${featureName} failed to detach`);
            }
        }
    }
    /**
     * Used to disable an already-enabled feature
     * The feature will be disposed and will be recreated once enabled.
     * @param featureName the feature to disable
     * @returns true if disable was successful
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    disableFeature(featureName) {
        const name = typeof featureName === "string" ? featureName : featureName.Name;
        const feature = this._features[name];
        if (feature && feature.enabled) {
            feature.enabled = false;
            this.detachFeature(name);
            feature.featureImplementation.dispose();
            delete this._features[name];
            return true;
        }
        return false;
    }
    /**
     * dispose this features manager
     */
    dispose() {
        this.getEnabledFeatures().forEach((feature) => {
            this.disableFeature(feature);
        });
    }
    /**
     * Enable a feature using its name and a version. This will enable it in the scene, and will be responsible to attach it when the session starts.
     * If used twice, the old version will be disposed and a new one will be constructed. This way you can re-enable with different configuration.
     *
     * @param featureName the name of the feature to load or the class of the feature
     * @param version optional version to load. if not provided the latest version will be enabled
     * @param moduleOptions options provided to the module. Ses the module documentation / constructor
     * @param attachIfPossible if set to true (default) the feature will be automatically attached, if it is currently possible
     * @param required is this feature required to the app. If set to true the session init will fail if the feature is not available.
     * @returns a new constructed feature or throws an error if feature not found or conflicts with another enabled feature.
     */
    enableFeature(
    // eslint-disable-next-line @typescript-eslint/naming-convention
    featureName, version = "latest", moduleOptions = {}, attachIfPossible = true, required = true) {
        const name = typeof featureName === "string" ? featureName : featureName.Name;
        let versionToLoad = 0;
        if (typeof version === "string") {
            if (!version) {
                throw new Error(`Error in provided version - ${name} (${version})`);
            }
            if (version === "stable") {
                versionToLoad = WebXRFeaturesManager.GetStableVersionOfFeature(name);
            }
            else if (version === "latest") {
                versionToLoad = WebXRFeaturesManager.GetLatestVersionOfFeature(name);
            }
            else {
                // try loading the number the string represents
                versionToLoad = +version;
            }
            if (versionToLoad === -1 || isNaN(versionToLoad)) {
                throw new Error(`feature not found - ${name} (${version})`);
            }
        }
        else {
            versionToLoad = version;
        }
        // check if there is a feature conflict
        const conflictingFeature = WebXRFeaturesManager._ConflictingFeatures[name];
        if (conflictingFeature !== undefined && this.getEnabledFeatures().indexOf(conflictingFeature) !== -1) {
            throw new Error(`Feature ${name} cannot be enabled while ${conflictingFeature} is enabled.`);
        }
        // check if already initialized
        const feature = this._features[name];
        const constructFunction = WebXRFeaturesManager.ConstructFeature(name, versionToLoad, this._xrSessionManager, moduleOptions);
        if (!constructFunction) {
            // report error?
            throw new Error(`feature not found - ${name}`);
        }
        /* If the feature is already enabled, detach and dispose it, and create a new one */
        if (feature) {
            this.disableFeature(name);
        }
        const constructed = constructFunction();
        if (constructed.dependsOn) {
            const dependentsFound = constructed.dependsOn.every((featureName) => !!this._features[featureName]);
            if (!dependentsFound) {
                throw new Error(`Dependant features missing. Make sure the following features are enabled - ${constructed.dependsOn.join(", ")}`);
            }
        }
        if (constructed.isCompatible()) {
            this._features[name] = {
                featureImplementation: constructed,
                enabled: true,
                version: versionToLoad,
                required,
            };
            if (attachIfPossible) {
                // if session started already, request and enable
                if (this._xrSessionManager.session && !this._features[name].featureImplementation.attached) {
                    // enable feature
                    this.attachFeature(name);
                }
            }
            else {
                // disable auto-attach when session starts
                this._features[name].featureImplementation.disableAutoAttach = true;
            }
            return this._features[name].featureImplementation;
        }
        else {
            if (required) {
                throw new Error("required feature not compatible");
            }
            else {
                _Misc_tools_js__WEBPACK_IMPORTED_MODULE_0__/* .Tools */ .S0.Warn(`Feature ${name} not compatible with the current environment/browser and was not enabled.`);
                return constructed;
            }
        }
    }
    /**
     * get the implementation of an enabled feature.
     * @param featureName the name of the feature to load
     * @returns the feature class, if found
     */
    getEnabledFeature(featureName) {
        return this._features[featureName] && this._features[featureName].featureImplementation;
    }
    /**
     * Get the list of enabled features
     * @returns an array of enabled features
     */
    getEnabledFeatures() {
        return Object.keys(this._features);
    }
    /**
     * This function will extend the session creation configuration object with enabled features.
     * If, for example, the anchors feature is enabled, it will be automatically added to the optional or required features list,
     * according to the defined "required" variable, provided during enableFeature call
     * @param xrSessionInit the xr Session init object to extend
     *
     * @returns an extended XRSessionInit object
     */
    async _extendXRSessionInitObject(xrSessionInit) {
        const enabledFeatures = this.getEnabledFeatures();
        for (const featureName of enabledFeatures) {
            const feature = this._features[featureName];
            const nativeName = feature.featureImplementation.xrNativeFeatureName;
            if (nativeName) {
                if (feature.required) {
                    xrSessionInit.requiredFeatures = xrSessionInit.requiredFeatures || [];
                    if (xrSessionInit.requiredFeatures.indexOf(nativeName) === -1) {
                        xrSessionInit.requiredFeatures.push(nativeName);
                    }
                }
                else {
                    xrSessionInit.optionalFeatures = xrSessionInit.optionalFeatures || [];
                    if (xrSessionInit.optionalFeatures.indexOf(nativeName) === -1) {
                        xrSessionInit.optionalFeatures.push(nativeName);
                    }
                }
            }
            if (feature.featureImplementation.getXRSessionInitExtension) {
                const extended = await feature.featureImplementation.getXRSessionInitExtension();
                xrSessionInit = {
                    ...xrSessionInit,
                    ...extended,
                };
            }
        }
        return xrSessionInit;
    }
}
WebXRFeaturesManager._AvailableFeatures = {};
/**
 * The key is the feature to check and the value is the feature that conflicts.
 */
WebXRFeaturesManager._ConflictingFeatures = {
    [WebXRFeatureName.TELEPORTATION]: WebXRFeatureName.MOVEMENT,
    [WebXRFeatureName.MOVEMENT]: WebXRFeatureName.TELEPORTATION,
};
//# sourceMappingURL=webXRFeaturesManager.js.map

/***/ }),

/***/ 97889:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CA: () => (/* binding */ AbstractAssetContainer),
/* harmony export */   Nx: () => (/* binding */ InstantiatedEntries),
/* harmony export */   WZ: () => (/* binding */ AssetContainer),
/* harmony export */   hA: () => (/* binding */ KeepAssets)
/* harmony export */ });
/* harmony import */ var _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76595);
/* harmony import */ var _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97328);
/* harmony import */ var _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35985);
/* harmony import */ var _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51137);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6315);
/* harmony import */ var _Meshes_instancedMesh_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(61440);
/* harmony import */ var _Lights_light_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(64704);
/* harmony import */ var _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(30388);
/* harmony import */ var _Misc_tools_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(998);









/**
 * Root class for AssetContainer and KeepAssets
 */
class AbstractAssetContainer {
    constructor() {
        /**
         * Gets the list of root nodes (ie. nodes with no parent)
         */
        this.rootNodes = [];
        /** All of the cameras added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
         */
        this.cameras = [];
        /**
         * All of the lights added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
         */
        this.lights = [];
        /**
         * All of the (abstract) meshes added to this scene
         */
        this.meshes = [];
        /**
         * The list of skeletons added to the scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
         */
        this.skeletons = [];
        /**
         * All of the particle systems added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
         */
        this.particleSystems = [];
        /**
         * Gets a list of Animations associated with the scene
         */
        this.animations = [];
        /**
         * All of the animation groups added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations
         */
        this.animationGroups = [];
        /**
         * All of the multi-materials added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials
         */
        this.multiMaterials = [];
        /**
         * All of the materials added to this scene
         * In the context of a Scene, it is not supposed to be modified manually.
         * Any addition or removal should be done using the addMaterial and removeMaterial Scene methods.
         * Note also that the order of the Material within the array is not significant and might change.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
         */
        this.materials = [];
        /**
         * The list of morph target managers added to the scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph
         */
        this.morphTargetManagers = [];
        /**
         * The list of geometries used in the scene.
         */
        this.geometries = [];
        /**
         * All of the transform nodes added to this scene
         * In the context of a Scene, it is not supposed to be modified manually.
         * Any addition or removal should be done using the addTransformNode and removeTransformNode Scene methods.
         * Note also that the order of the TransformNode within the array is not significant and might change.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/transform_node
         */
        this.transformNodes = [];
        /**
         * ActionManagers available on the scene.
         * @deprecated
         */
        this.actionManagers = [];
        /**
         * Textures to keep.
         */
        this.textures = [];
        /** @internal */
        this._environmentTexture = null;
        /**
         * The list of postprocesses added to the scene
         */
        this.postProcesses = [];
        /**
         * The list of sounds
         */
        this.sounds = null;
        /**
         * The list of effect layers added to the scene
         */
        this.effectLayers = [];
        /**
         * The list of layers added to the scene
         */
        this.layers = [];
        /**
         * The list of reflection probes added to the scene
         */
        this.reflectionProbes = [];
    }
    /**
     * Texture used in all pbr material as the reflection texture.
     * As in the majority of the scene they are the same (exception for multi room and so on),
     * this is easier to reference from here than from all the materials.
     */
    get environmentTexture() {
        return this._environmentTexture;
    }
    set environmentTexture(value) {
        this._environmentTexture = value;
    }
    /**
     * @returns all meshes, lights, cameras, transformNodes and bones
     */
    getNodes() {
        let nodes = [];
        nodes = nodes.concat(this.meshes);
        nodes = nodes.concat(this.lights);
        nodes = nodes.concat(this.cameras);
        nodes = nodes.concat(this.transformNodes); // dummies
        this.skeletons.forEach((skeleton) => (nodes = nodes.concat(skeleton.bones)));
        return nodes;
    }
}
/**
 * Set of assets to keep when moving a scene into an asset container.
 */
class KeepAssets extends AbstractAssetContainer {
}
/**
 * Class used to store the output of the AssetContainer.instantiateAllMeshesToScene function
 */
class InstantiatedEntries {
    constructor() {
        /**
         * List of new root nodes (eg. nodes with no parent)
         */
        this.rootNodes = [];
        /**
         * List of new skeletons
         */
        this.skeletons = [];
        /**
         * List of new animation groups
         */
        this.animationGroups = [];
    }
    /**
     * Disposes the instantiated entries from the scene
     */
    dispose() {
        this.rootNodes.slice(0).forEach((o) => {
            o.dispose();
        });
        this.rootNodes.length = 0;
        this.skeletons.slice(0).forEach((o) => {
            o.dispose();
        });
        this.skeletons.length = 0;
        this.animationGroups.slice(0).forEach((o) => {
            o.dispose();
        });
        this.animationGroups.length = 0;
    }
}
/**
 * Container with a set of assets that can be added or removed from a scene.
 */
class AssetContainer extends AbstractAssetContainer {
    /**
     * Instantiates an AssetContainer.
     * @param scene The scene the AssetContainer belongs to.
     */
    constructor(scene) {
        super();
        this._wasAddedToScene = false;
        scene = scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore */ .q.LastCreatedScene;
        if (!scene) {
            return;
        }
        this.scene = scene;
        this["proceduralTextures"] = [];
        scene.onDisposeObservable.add(() => {
            if (!this._wasAddedToScene) {
                this.dispose();
            }
        });
        this._onContextRestoredObserver = scene.getEngine().onContextRestoredObservable.add(() => {
            for (const geometry of this.geometries) {
                geometry._rebuild();
            }
            for (const mesh of this.meshes) {
                mesh._rebuild();
            }
            for (const system of this.particleSystems) {
                system.rebuild();
            }
            for (const texture of this.textures) {
                texture._rebuild();
            }
        });
    }
    /**
     * Given a list of nodes, return a topological sorting of them.
     * @param nodes
     * @returns a sorted array of nodes
     */
    _topologicalSort(nodes) {
        const nodesUidMap = new Map();
        for (const node of nodes) {
            nodesUidMap.set(node.uniqueId, node);
        }
        const dependencyGraph = {
            dependsOn: new Map(), // given a node id, what are the ids of the nodes it depends on
            dependedBy: new Map(), // given a node id, what are the ids of the nodes that depend on it
        };
        // Build the dependency graph given the list of nodes
        // First pass: Initialize the empty dependency graph
        for (const node of nodes) {
            const nodeId = node.uniqueId;
            dependencyGraph.dependsOn.set(nodeId, new Set());
            dependencyGraph.dependedBy.set(nodeId, new Set());
        }
        // Second pass: Populate the dependency graph. We assume that we
        // don't need to check for cycles here, as the scene graph cannot
        // contain cycles. Our graph also already contains all transitive
        // dependencies because getDescendants returns the transitive
        // dependencies by default.
        for (const node of nodes) {
            const nodeId = node.uniqueId;
            const dependsOn = dependencyGraph.dependsOn.get(nodeId);
            if (node instanceof _Meshes_instancedMesh_js__WEBPACK_IMPORTED_MODULE_5__/* .InstancedMesh */ .Z) {
                const masterMesh = node.sourceMesh;
                if (nodesUidMap.has(masterMesh.uniqueId)) {
                    dependsOn.add(masterMesh.uniqueId);
                    dependencyGraph.dependedBy.get(masterMesh.uniqueId).add(nodeId);
                }
            }
            const dependedBy = dependencyGraph.dependedBy.get(nodeId);
            for (const child of node.getDescendants()) {
                const childId = child.uniqueId;
                if (nodesUidMap.has(childId)) {
                    dependedBy.add(childId);
                    const childDependsOn = dependencyGraph.dependsOn.get(childId);
                    childDependsOn.add(nodeId);
                }
            }
        }
        // Third pass: Topological sort
        const sortedNodes = [];
        // First: Find all nodes that have no dependencies
        const leaves = [];
        for (const node of nodes) {
            const nodeId = node.uniqueId;
            if (dependencyGraph.dependsOn.get(nodeId).size === 0) {
                leaves.push(node);
                nodesUidMap.delete(nodeId);
            }
        }
        const visitList = leaves;
        while (visitList.length > 0) {
            const nodeToVisit = visitList.shift();
            sortedNodes.push(nodeToVisit);
            // Remove the node from the dependency graph
            // When a node is visited, we know that dependsOn is empty.
            // So we only need to remove the node from dependedBy.
            const dependedByVisitedNode = dependencyGraph.dependedBy.get(nodeToVisit.uniqueId);
            // Array.from(x.values()) is to make the TS compiler happy
            for (const dependedByVisitedNodeId of Array.from(dependedByVisitedNode.values())) {
                const dependsOnDependedByVisitedNode = dependencyGraph.dependsOn.get(dependedByVisitedNodeId);
                dependsOnDependedByVisitedNode.delete(nodeToVisit.uniqueId);
                if (dependsOnDependedByVisitedNode.size === 0 && nodesUidMap.get(dependedByVisitedNodeId)) {
                    visitList.push(nodesUidMap.get(dependedByVisitedNodeId));
                    nodesUidMap.delete(dependedByVisitedNodeId);
                }
            }
        }
        if (nodesUidMap.size > 0) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("SceneSerializer._topologicalSort: There were unvisited nodes:");
            nodesUidMap.forEach((node) => _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error(node.name));
        }
        return sortedNodes;
    }
    _addNodeAndDescendantsToList(list, addedIds, rootNode, predicate) {
        if (!rootNode || (predicate && !predicate(rootNode)) || addedIds.has(rootNode.uniqueId)) {
            return;
        }
        list.push(rootNode);
        addedIds.add(rootNode.uniqueId);
        for (const child of rootNode.getDescendants(true)) {
            this._addNodeAndDescendantsToList(list, addedIds, child, predicate);
        }
    }
    /**
     * Check if a specific node is contained in this asset container.
     * @param node the node to check
     * @returns true if the node is contained in this container, otherwise false.
     */
    _isNodeInContainer(node) {
        if (node instanceof _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_2__/* .AbstractMesh */ .u && this.meshes.indexOf(node) !== -1) {
            return true;
        }
        if (node instanceof _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_1__/* .TransformNode */ .V && this.transformNodes.indexOf(node) !== -1) {
            return true;
        }
        if (node instanceof _Lights_light_js__WEBPACK_IMPORTED_MODULE_6__/* .Light */ .v && this.lights.indexOf(node) !== -1) {
            return true;
        }
        if (node instanceof _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_7__/* .Camera */ .i && this.cameras.indexOf(node) !== -1) {
            return true;
        }
        return false;
    }
    /**
     * For every node in the scene, check if its parent node is also in the scene.
     * @returns true if every node's parent is also in the scene, otherwise false.
     */
    _isValidHierarchy() {
        for (const node of this.meshes) {
            if (node.parent && !this._isNodeInContainer(node.parent)) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Warn(`Node ${node.name} has a parent that is not in the container.`);
                return false;
            }
        }
        for (const node of this.transformNodes) {
            if (node.parent && !this._isNodeInContainer(node.parent)) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Warn(`Node ${node.name} has a parent that is not in the container.`);
                return false;
            }
        }
        for (const node of this.lights) {
            if (node.parent && !this._isNodeInContainer(node.parent)) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Warn(`Node ${node.name} has a parent that is not in the container.`);
                return false;
            }
        }
        for (const node of this.cameras) {
            if (node.parent && !this._isNodeInContainer(node.parent)) {
                _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Warn(`Node ${node.name} has a parent that is not in the container.`);
                return false;
            }
        }
        return true;
    }
    /**
     * Instantiate or clone all meshes and add the new ones to the scene.
     * Skeletons and animation groups will all be cloned
     * @param nameFunction defines an optional function used to get new names for clones
     * @param cloneMaterials defines an optional boolean that defines if materials must be cloned as well (false by default)
     * @param options defines an optional list of options to control how to instantiate / clone models
     * @param options.doNotInstantiate defines if the model must be instantiated or just cloned
     * @param options.predicate defines a predicate used to filter whih mesh to instantiate/clone
     * @returns a list of rootNodes, skeletons and animation groups that were duplicated
     */
    instantiateModelsToScene(nameFunction, cloneMaterials = false, options) {
        if (!this._isValidHierarchy()) {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_8__/* .Tools */ .S0.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");
        }
        const conversionMap = {};
        const storeMap = {};
        const result = new InstantiatedEntries();
        const alreadySwappedSkeletons = [];
        const alreadySwappedMaterials = [];
        const localOptions = {
            doNotInstantiate: true,
            ...options,
        };
        const onClone = (source, clone) => {
            conversionMap[source.uniqueId] = clone.uniqueId;
            storeMap[clone.uniqueId] = clone;
            if (nameFunction) {
                clone.name = nameFunction(source.name);
            }
            if (clone instanceof _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e) {
                const clonedMesh = clone;
                if (clonedMesh.morphTargetManager) {
                    const oldMorphTargetManager = source.morphTargetManager;
                    clonedMesh.morphTargetManager = oldMorphTargetManager.clone();
                    for (let index = 0; index < oldMorphTargetManager.numTargets; index++) {
                        const oldTarget = oldMorphTargetManager.getTarget(index);
                        const newTarget = clonedMesh.morphTargetManager.getTarget(index);
                        conversionMap[oldTarget.uniqueId] = newTarget.uniqueId;
                        storeMap[newTarget.uniqueId] = newTarget;
                    }
                }
            }
        };
        const nodesToSort = [];
        const idsOnSortList = new Set();
        for (const transformNode of this.transformNodes) {
            if (transformNode.parent === null) {
                this._addNodeAndDescendantsToList(nodesToSort, idsOnSortList, transformNode, localOptions.predicate);
            }
        }
        for (const mesh of this.meshes) {
            if (mesh.parent === null) {
                this._addNodeAndDescendantsToList(nodesToSort, idsOnSortList, mesh, localOptions.predicate);
            }
        }
        // Topologically sort nodes by parenting/instancing relationships so that all resources are in place
        // when a given node is instantiated.
        const sortedNodes = this._topologicalSort(nodesToSort);
        const onNewCreated = (source, clone) => {
            onClone(source, clone);
            if (source.parent) {
                const replicatedParentId = conversionMap[source.parent.uniqueId];
                const replicatedParent = storeMap[replicatedParentId];
                if (replicatedParent) {
                    clone.parent = replicatedParent;
                }
                else {
                    clone.parent = source.parent;
                }
            }
            if (clone.position && source.position) {
                clone.position.copyFrom(source.position);
            }
            if (clone.rotationQuaternion && source.rotationQuaternion) {
                clone.rotationQuaternion.copyFrom(source.rotationQuaternion);
            }
            if (clone.rotation && source.rotation) {
                clone.rotation.copyFrom(source.rotation);
            }
            if (clone.scaling && source.scaling) {
                clone.scaling.copyFrom(source.scaling);
            }
            if (clone.material) {
                const mesh = clone;
                if (mesh.material) {
                    if (cloneMaterials) {
                        const sourceMaterial = source.material;
                        if (alreadySwappedMaterials.indexOf(sourceMaterial) === -1) {
                            let swap = sourceMaterial.clone(nameFunction ? nameFunction(sourceMaterial.name) : "Clone of " + sourceMaterial.name);
                            alreadySwappedMaterials.push(sourceMaterial);
                            conversionMap[sourceMaterial.uniqueId] = swap.uniqueId;
                            storeMap[swap.uniqueId] = swap;
                            if (sourceMaterial.getClassName() === "MultiMaterial") {
                                const multi = sourceMaterial;
                                for (const material of multi.subMaterials) {
                                    if (!material) {
                                        continue;
                                    }
                                    swap = material.clone(nameFunction ? nameFunction(material.name) : "Clone of " + material.name);
                                    alreadySwappedMaterials.push(material);
                                    conversionMap[material.uniqueId] = swap.uniqueId;
                                    storeMap[swap.uniqueId] = swap;
                                }
                                multi.subMaterials = multi.subMaterials.map((m) => m && storeMap[conversionMap[m.uniqueId]]);
                            }
                        }
                        if (mesh.getClassName() !== "InstancedMesh") {
                            mesh.material = storeMap[conversionMap[sourceMaterial.uniqueId]];
                        }
                    }
                    else {
                        if (mesh.material.getClassName() === "MultiMaterial") {
                            if (this.scene.multiMaterials.indexOf(mesh.material) === -1) {
                                this.scene.addMultiMaterial(mesh.material);
                            }
                        }
                        else {
                            if (this.scene.materials.indexOf(mesh.material) === -1) {
                                this.scene.addMaterial(mesh.material);
                            }
                        }
                    }
                }
            }
            if (clone.parent === null) {
                result.rootNodes.push(clone);
            }
        };
        sortedNodes.forEach((node) => {
            if (node.getClassName() === "InstancedMesh") {
                const instancedNode = node;
                const sourceMesh = instancedNode.sourceMesh;
                const replicatedSourceId = conversionMap[sourceMesh.uniqueId];
                const replicatedSource = typeof replicatedSourceId === "number" ? storeMap[replicatedSourceId] : sourceMesh;
                const replicatedInstancedNode = replicatedSource.createInstance(instancedNode.name);
                onNewCreated(instancedNode, replicatedInstancedNode);
            }
            else {
                // Mesh or TransformNode
                let canInstance = true;
                if (node.getClassName() === "TransformNode" ||
                    node.getClassName() === "Node" ||
                    node.skeleton ||
                    !node.getTotalVertices ||
                    node.getTotalVertices() === 0) {
                    // Transform nodes, skinned meshes, and meshes with no vertices can never be instanced!
                    canInstance = false;
                }
                else if (localOptions.doNotInstantiate) {
                    if (typeof localOptions.doNotInstantiate === "function") {
                        canInstance = !localOptions.doNotInstantiate(node);
                    }
                    else {
                        canInstance = !localOptions.doNotInstantiate;
                    }
                }
                const replicatedNode = canInstance ? node.createInstance(`instance of ${node.name}`) : node.clone(`Clone of ${node.name}`, null, true);
                if (!replicatedNode) {
                    throw new Error(`Could not clone or instantiate node on Asset Container ${node.name}`);
                }
                onNewCreated(node, replicatedNode);
            }
        });
        this.skeletons.forEach((s) => {
            if (localOptions.predicate && !localOptions.predicate(s)) {
                return;
            }
            const clone = s.clone(nameFunction ? nameFunction(s.name) : "Clone of " + s.name);
            for (const m of this.meshes) {
                if (m.skeleton === s && !m.isAnInstance) {
                    const copy = storeMap[conversionMap[m.uniqueId]];
                    if (!copy || copy.isAnInstance) {
                        continue;
                    }
                    copy.skeleton = clone;
                    if (alreadySwappedSkeletons.indexOf(clone) !== -1) {
                        continue;
                    }
                    alreadySwappedSkeletons.push(clone);
                    // Check if bones are mesh linked
                    for (const bone of clone.bones) {
                        if (bone._linkedTransformNode) {
                            bone._linkedTransformNode = storeMap[conversionMap[bone._linkedTransformNode.uniqueId]];
                        }
                    }
                }
            }
            result.skeletons.push(clone);
        });
        this.animationGroups.forEach((o) => {
            if (localOptions.predicate && !localOptions.predicate(o)) {
                return;
            }
            const clone = o.clone(nameFunction ? nameFunction(o.name) : "Clone of " + o.name, (oldTarget) => {
                const newTarget = storeMap[conversionMap[oldTarget.uniqueId]];
                return newTarget || oldTarget;
            });
            result.animationGroups.push(clone);
        });
        return result;
    }
    /**
     * Adds all the assets from the container to the scene.
     */
    addAllToScene() {
        if (this._wasAddedToScene) {
            return;
        }
        if (!this._isValidHierarchy()) {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_8__/* .Tools */ .S0.Warn("SceneSerializer.addAllToScene: The Asset Container hierarchy is not valid.");
        }
        this._wasAddedToScene = true;
        this.addToScene(null);
        if (this.environmentTexture) {
            this.scene.environmentTexture = this.environmentTexture;
        }
        for (const component of this.scene._serializableComponents) {
            component.addFromContainer(this);
        }
        this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver);
        this._onContextRestoredObserver = null;
    }
    /**
     * Adds assets from the container to the scene.
     * @param predicate defines a predicate used to select which entity will be added (can be null)
     */
    addToScene(predicate = null) {
        const addedNodes = [];
        this.cameras.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addCamera(o);
            addedNodes.push(o);
        });
        this.lights.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addLight(o);
            addedNodes.push(o);
        });
        this.meshes.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addMesh(o);
            addedNodes.push(o);
        });
        this.skeletons.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addSkeleton(o);
        });
        this.animations.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addAnimation(o);
        });
        this.animationGroups.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addAnimationGroup(o);
        });
        this.multiMaterials.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addMultiMaterial(o);
        });
        this.materials.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addMaterial(o);
        });
        this.morphTargetManagers.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addMorphTargetManager(o);
        });
        this.geometries.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addGeometry(o);
        });
        this.transformNodes.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addTransformNode(o);
            addedNodes.push(o);
        });
        this.actionManagers.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addActionManager(o);
        });
        this.textures.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addTexture(o);
        });
        this.reflectionProbes.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.addReflectionProbe(o);
        });
        for (const addedNode of addedNodes) {
            // If node was added to the scene, but parent is not in the scene, break the relationship
            if (addedNode.parent && this.scene.getNodes().indexOf(addedNode.parent) === -1) {
                // Use setParent to keep transform if possible
                if (addedNode.setParent) {
                    addedNode.setParent(null);
                }
                else {
                    addedNode.parent = null;
                }
            }
        }
    }
    /**
     * Removes all the assets in the container from the scene
     */
    removeAllFromScene() {
        if (!this._isValidHierarchy()) {
            _Misc_tools_js__WEBPACK_IMPORTED_MODULE_8__/* .Tools */ .S0.Warn("SceneSerializer.removeAllFromScene: The Asset Container hierarchy is not valid.");
        }
        this._wasAddedToScene = false;
        this.removeFromScene(null);
        if (this.environmentTexture === this.scene.environmentTexture) {
            this.scene.environmentTexture = null;
        }
        for (const component of this.scene._serializableComponents) {
            component.removeFromContainer(this);
        }
    }
    /**
     * Removes assets in the container from the scene
     * @param predicate defines a predicate used to select which entity will be added (can be null)
     */
    removeFromScene(predicate = null) {
        this.cameras.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeCamera(o);
        });
        this.lights.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeLight(o);
        });
        this.meshes.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeMesh(o, true);
        });
        this.skeletons.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeSkeleton(o);
        });
        this.animations.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeAnimation(o);
        });
        this.animationGroups.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeAnimationGroup(o);
        });
        this.multiMaterials.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeMultiMaterial(o);
        });
        this.materials.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeMaterial(o);
        });
        this.morphTargetManagers.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeMorphTargetManager(o);
        });
        this.geometries.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeGeometry(o);
        });
        this.transformNodes.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeTransformNode(o);
        });
        this.actionManagers.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeActionManager(o);
        });
        this.textures.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeTexture(o);
        });
        this.reflectionProbes.forEach((o) => {
            if (predicate && !predicate(o)) {
                return;
            }
            this.scene.removeReflectionProbe(o);
        });
    }
    /**
     * Disposes all the assets in the container
     */
    dispose() {
        this.cameras.slice(0).forEach((o) => {
            o.dispose();
        });
        this.cameras.length = 0;
        this.lights.slice(0).forEach((o) => {
            o.dispose();
        });
        this.lights.length = 0;
        this.meshes.slice(0).forEach((o) => {
            o.dispose();
        });
        this.meshes.length = 0;
        this.skeletons.slice(0).forEach((o) => {
            o.dispose();
        });
        this.skeletons.length = 0;
        this.animationGroups.slice(0).forEach((o) => {
            o.dispose();
        });
        this.animationGroups.length = 0;
        this.multiMaterials.slice(0).forEach((o) => {
            o.dispose();
        });
        this.multiMaterials.length = 0;
        this.materials.slice(0).forEach((o) => {
            o.dispose();
        });
        this.materials.length = 0;
        this.geometries.slice(0).forEach((o) => {
            o.dispose();
        });
        this.geometries.length = 0;
        this.transformNodes.slice(0).forEach((o) => {
            o.dispose();
        });
        this.transformNodes.length = 0;
        this.actionManagers.slice(0).forEach((o) => {
            o.dispose();
        });
        this.actionManagers.length = 0;
        this.textures.slice(0).forEach((o) => {
            o.dispose();
        });
        this.textures.length = 0;
        this.reflectionProbes.slice(0).forEach((o) => {
            o.dispose();
        });
        this.reflectionProbes.length = 0;
        this.morphTargetManagers.slice(0).forEach((o) => {
            o.dispose();
        });
        this.morphTargetManagers.length = 0;
        if (this.environmentTexture) {
            this.environmentTexture.dispose();
            this.environmentTexture = null;
        }
        for (const component of this.scene._serializableComponents) {
            component.removeFromContainer(this, true);
        }
        if (this._onContextRestoredObserver) {
            this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver);
            this._onContextRestoredObserver = null;
        }
    }
    _moveAssets(sourceAssets, targetAssets, keepAssets) {
        if (!sourceAssets || !targetAssets) {
            return;
        }
        for (const asset of sourceAssets) {
            let move = true;
            if (keepAssets) {
                for (const keepAsset of keepAssets) {
                    if (asset === keepAsset) {
                        move = false;
                        break;
                    }
                }
            }
            if (move) {
                targetAssets.push(asset);
                asset._parentContainer = this;
            }
        }
    }
    /**
     * Removes all the assets contained in the scene and adds them to the container.
     * @param keepAssets Set of assets to keep in the scene. (default: empty)
     */
    moveAllFromScene(keepAssets) {
        this._wasAddedToScene = false;
        if (keepAssets === undefined) {
            keepAssets = new KeepAssets();
        }
        for (const key in this) {
            if (Object.prototype.hasOwnProperty.call(this, key)) {
                this[key] = this[key] || (key === "_environmentTexture" ? null : []);
                this._moveAssets(this.scene[key], this[key], keepAssets[key]);
            }
        }
        this.environmentTexture = this.scene.environmentTexture;
        this.removeAllFromScene();
    }
    /**
     * Adds all meshes in the asset container to a root mesh that can be used to position all the contained meshes. The root mesh is then added to the front of the meshes in the assetContainer.
     * @returns the root mesh
     */
    createRootMesh() {
        const rootMesh = new _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e("assetContainerRootMesh", this.scene);
        this.meshes.forEach((m) => {
            if (!m.parent) {
                rootMesh.addChild(m);
            }
        });
        this.meshes.unshift(rootMesh);
        return rootMesh;
    }
    /**
     * Merge animations (direct and animation groups) from this asset container into a scene
     * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
     * @param animatables set of animatables to retarget to a node from the scene
     * @param targetConverter defines a function used to convert animation targets from the asset container to the scene (default: search node by name)
     * @returns an array of the new AnimationGroup added to the scene (empty array if none)
     */
    mergeAnimationsTo(scene = _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore */ .q.LastCreatedScene, animatables, targetConverter = null) {
        if (!scene) {
            _Misc_logger_js__WEBPACK_IMPORTED_MODULE_3__/* .Logger */ .V.Error("No scene available to merge animations to");
            return [];
        }
        const _targetConverter = targetConverter
            ? targetConverter
            : (target) => {
                let node = null;
                const targetProperty = target.animations.length ? target.animations[0].targetProperty : "";
                /*
            BabylonJS adds special naming to targets that are children of nodes.
            This name attempts to remove that special naming to get the parent nodes name in case the target
            can't be found in the node tree

            Ex: Torso_primitive0 likely points to a Mesh primitive. We take away primitive0 and are left with "Torso" which is the name
            of the primitive's parent.
        */
                const name = target.name.split(".").join("").split("_primitive")[0];
                switch (targetProperty) {
                    case "position":
                    case "rotationQuaternion":
                        node = scene.getTransformNodeByName(target.name) || scene.getTransformNodeByName(name);
                        break;
                    case "influence":
                        node = scene.getMorphTargetByName(target.name) || scene.getMorphTargetByName(name);
                        break;
                    default:
                        node = scene.getNodeByName(target.name) || scene.getNodeByName(name);
                }
                return node;
            };
        // Copy new node animations
        const nodesInAC = this.getNodes();
        nodesInAC.forEach((nodeInAC) => {
            const nodeInScene = _targetConverter(nodeInAC);
            if (nodeInScene !== null) {
                // Remove old animations with same target property as a new one
                for (const animationInAC of nodeInAC.animations) {
                    // Doing treatment on an array for safety measure
                    const animationsWithSameProperty = nodeInScene.animations.filter((animationInScene) => {
                        return animationInScene.targetProperty === animationInAC.targetProperty;
                    });
                    for (const animationWithSameProperty of animationsWithSameProperty) {
                        const index = nodeInScene.animations.indexOf(animationWithSameProperty, 0);
                        if (index > -1) {
                            nodeInScene.animations.splice(index, 1);
                        }
                    }
                }
                // Append new animations
                nodeInScene.animations = nodeInScene.animations.concat(nodeInAC.animations);
            }
        });
        const newAnimationGroups = [];
        // Copy new animation groups
        this.animationGroups.slice().forEach((animationGroupInAC) => {
            // Clone the animation group and all its animatables
            newAnimationGroups.push(animationGroupInAC.clone(animationGroupInAC.name, _targetConverter));
            // Remove animatables related to the asset container
            animationGroupInAC.animatables.forEach((animatable) => {
                animatable.stop();
            });
        });
        // Retarget animatables
        animatables.forEach((animatable) => {
            const target = _targetConverter(animatable.target);
            if (target) {
                // Clone the animatable and retarget it
                scene.beginAnimation(target, animatable.fromFrame, animatable.toFrame, animatable.loopAnimation, animatable.speedRatio, animatable.onAnimationEnd ? animatable.onAnimationEnd : undefined, undefined, true, undefined, animatable.onAnimationLoop ? animatable.onAnimationLoop : undefined);
                // Stop animation for the target in the asset container
                scene.stopAnimation(animatable.target);
            }
        });
        return newAnimationGroups;
    }
    /**
     * @since 6.15.0
     * This method checks for any node that has no parent
     * and is not in the rootNodes array, and adds the node
     * there, if so.
     */
    populateRootNodes() {
        this.rootNodes.length = 0;
        this.meshes.forEach((m) => {
            if (!m.parent && this.rootNodes.indexOf(m) === -1) {
                this.rootNodes.push(m);
            }
        });
        this.transformNodes.forEach((t) => {
            if (!t.parent && this.rootNodes.indexOf(t) === -1) {
                this.rootNodes.push(t);
            }
        });
        this.lights.forEach((l) => {
            if (!l.parent && this.rootNodes.indexOf(l) === -1) {
                this.rootNodes.push(l);
            }
        });
        this.cameras.forEach((c) => {
            if (!c.parent && this.rootNodes.indexOf(c) === -1) {
                this.rootNodes.push(c);
            }
        });
    }
    /**
     * @since 6.26.0
     * Given a root asset, this method will traverse its hierarchy and add it, its children and any materials/skeletons/animation groups to the container.
     * @param root root node
     */
    addAllAssetsToContainer(root) {
        if (!root) {
            return;
        }
        const nodesToVisit = [];
        const visitedNodes = new Set();
        nodesToVisit.push(root);
        while (nodesToVisit.length > 0) {
            const nodeToVisit = nodesToVisit.pop();
            if (nodeToVisit instanceof _Meshes_mesh_js__WEBPACK_IMPORTED_MODULE_0__/* .Mesh */ .e) {
                if (nodeToVisit.geometry && this.geometries.indexOf(nodeToVisit.geometry) === -1) {
                    this.geometries.push(nodeToVisit.geometry);
                }
                this.meshes.push(nodeToVisit);
            }
            else if (nodeToVisit instanceof _Meshes_transformNode_js__WEBPACK_IMPORTED_MODULE_1__/* .TransformNode */ .V) {
                this.transformNodes.push(nodeToVisit);
            }
            else if (nodeToVisit instanceof _Lights_light_js__WEBPACK_IMPORTED_MODULE_6__/* .Light */ .v) {
                this.lights.push(nodeToVisit);
            }
            else if (nodeToVisit instanceof _Cameras_camera_js__WEBPACK_IMPORTED_MODULE_7__/* .Camera */ .i) {
                this.cameras.push(nodeToVisit);
            }
            if (nodeToVisit instanceof _Meshes_abstractMesh_js__WEBPACK_IMPORTED_MODULE_2__/* .AbstractMesh */ .u) {
                if (nodeToVisit.material && this.materials.indexOf(nodeToVisit.material) === -1) {
                    this.materials.push(nodeToVisit.material);
                    for (const texture of nodeToVisit.material.getActiveTextures()) {
                        if (this.textures.indexOf(texture) === -1) {
                            this.textures.push(texture);
                        }
                    }
                }
                if (nodeToVisit.skeleton && this.skeletons.indexOf(nodeToVisit.skeleton) === -1) {
                    this.skeletons.push(nodeToVisit.skeleton);
                }
                if (nodeToVisit.morphTargetManager && this.morphTargetManagers.indexOf(nodeToVisit.morphTargetManager) === -1) {
                    this.morphTargetManagers.push(nodeToVisit.morphTargetManager);
                }
            }
            for (const child of nodeToVisit.getChildren()) {
                if (!visitedNodes.has(child)) {
                    nodesToVisit.push(child);
                }
            }
            visitedNodes.add(nodeToVisit);
        }
        this.populateRootNodes();
    }
}
//# sourceMappingURL=assetContainer.js.map

/***/ }),

/***/ 65877:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   h: () => (/* binding */ _ImportHelper)
/* harmony export */ });
/** @internal */
class _ImportHelper {
}
/** @internal */
_ImportHelper._IsPickingAvailable = false;
//# sourceMappingURL=import.helper.js.map

/***/ }),

/***/ 73776:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  AbstractActionManager: () => (/* reexport */ abstractActionManager/* AbstractActionManager */.G),
  AbstractAssetContainer: () => (/* reexport */ assetContainer/* AbstractAssetContainer */.CA),
  AbstractAssetTask: () => (/* reexport */ AbstractAssetTask),
  AbstractEngine: () => (/* reexport */ abstractEngine/* AbstractEngine */.$),
  AbstractMesh: () => (/* reexport */ abstractMesh/* AbstractMesh */.u),
  AcquireNativeObjectAsync: () => (/* reexport */ AcquireNativeObjectAsync),
  Action: () => (/* reexport */ Action),
  ActionEvent: () => (/* reexport */ actionEvent/* ActionEvent */.X),
  ActionManager: () => (/* reexport */ ActionManager),
  AddAnimationExtensions: () => (/* reexport */ animatable/* AddAnimationExtensions */.SM),
  AddBlock: () => (/* reexport */ AddBlock),
  AddIndividualParser: () => (/* reexport */ babylonFileParser_function/* AddIndividualParser */.cf),
  AddParser: () => (/* reexport */ babylonFileParser_function/* AddParser */.ji),
  AddRayExtensions: () => (/* reexport */ Culling_ray/* AddRayExtensions */.Oj),
  AddressMode: () => (/* reexport */ AddressMode),
  AdvancedTimer: () => (/* reexport */ timer/* AdvancedTimer */.Qz),
  Aggregations: () => (/* reexport */ Aggregations),
  AggregatorBlock: () => (/* reexport */ AggregatorBlock),
  AlignBlock: () => (/* reexport */ AlignBlock),
  AlphaState: () => (/* reexport */ alphaCullingState/* AlphaState */.i),
  AmmoJSPlugin: () => (/* reexport */ AmmoJSPlugin),
  AnaglyphArcRotateCamera: () => (/* reexport */ AnaglyphArcRotateCamera),
  AnaglyphFreeCamera: () => (/* reexport */ AnaglyphFreeCamera),
  AnaglyphGamepadCamera: () => (/* reexport */ AnaglyphGamepadCamera),
  AnaglyphPostProcess: () => (/* reexport */ AnaglyphPostProcess),
  AnaglyphUniversalCamera: () => (/* reexport */ AnaglyphUniversalCamera),
  Analyser: () => (/* reexport */ Analyser),
  AndOrNotEvaluator: () => (/* reexport */ andOrNotEvaluator/* AndOrNotEvaluator */.Z),
  Angle: () => (/* reexport */ math/* Angle */.uM),
  Animatable: () => (/* reexport */ animatable/* Animatable */.rT),
  AnimatedInputBlockTypes: () => (/* reexport */ AnimatedInputBlockTypes),
  Animation: () => (/* reexport */ Animations_animation/* Animation */.X5),
  AnimationAssetTask: () => (/* reexport */ AnimationAssetTask),
  AnimationEvent: () => (/* reexport */ animationEvent/* AnimationEvent */.p),
  AnimationGroup: () => (/* reexport */ Animations_animationGroup.AnimationGroup),
  AnimationGroupMask: () => (/* reexport */ AnimationGroupMask),
  AnimationGroupMaskMode: () => (/* reexport */ AnimationGroupMaskMode),
  AnimationKeyInterpolation: () => (/* reexport */ AnimationKeyInterpolation),
  AnimationPropertiesOverride: () => (/* reexport */ AnimationPropertiesOverride),
  AnimationRange: () => (/* reexport */ animationRange/* AnimationRange */.K),
  AnisotropyBlock: () => (/* reexport */ AnisotropyBlock),
  ApplyLut: () => (/* reexport */ exrLoader_compression_huf/* ApplyLut */.Kq),
  ApplyPostProcess: () => (/* reexport */ textureTools/* ApplyPostProcess */.Qs),
  Arc2: () => (/* reexport */ math/* Arc2 */.Xy),
  ArcFollowCamera: () => (/* reexport */ ArcFollowCamera),
  ArcRotateCamera: () => (/* reexport */ ArcRotateCamera),
  ArcRotateCameraGamepadInput: () => (/* reexport */ ArcRotateCameraGamepadInput),
  ArcRotateCameraInputsManager: () => (/* reexport */ ArcRotateCameraInputsManager),
  ArcRotateCameraKeyboardMoveInput: () => (/* reexport */ ArcRotateCameraKeyboardMoveInput),
  ArcRotateCameraMouseWheelInput: () => (/* reexport */ ArcRotateCameraMouseWheelInput),
  ArcRotateCameraPointersInput: () => (/* reexport */ ArcRotateCameraPointersInput),
  ArcRotateCameraVRDeviceOrientationInput: () => (/* reexport */ ArcRotateCameraVRDeviceOrientationInput),
  ArcTan2Block: () => (/* reexport */ ArcTan2Block),
  AssetContainer: () => (/* reexport */ assetContainer/* AssetContainer */.WZ),
  AssetTaskState: () => (/* reexport */ AssetTaskState),
  AssetsManager: () => (/* reexport */ AssetsManager),
  AssetsProgressEvent: () => (/* reexport */ AssetsProgressEvent),
  AsyncLock: () => (/* reexport */ AsyncLock),
  AsyncLoop: () => (/* reexport */ tools/* AsyncLoop */.LV),
  AttachToBoxBehavior: () => (/* reexport */ AttachToBoxBehavior),
  AudioEngine: () => (/* reexport */ audioEngine/* AudioEngine */.L),
  AudioSceneComponent: () => (/* reexport */ audioSceneComponent/* AudioSceneComponent */.Y),
  AutoLayoutMode: () => (/* reexport */ AutoLayoutMode),
  AutoReleaseWorkerPool: () => (/* reexport */ workerPool/* AutoReleaseWorkerPool */.h),
  AutoRotationBehavior: () => (/* reexport */ AutoRotationBehavior),
  AxesViewer: () => (/* reexport */ AxesViewer),
  Axis: () => (/* reexport */ math/* Axis */._0),
  AxisDragGizmo: () => (/* reexport */ AxisDragGizmo),
  AxisScaleGizmo: () => (/* reexport */ AxisScaleGizmo),
  BRDFTextureTools: () => (/* reexport */ brdfTextureTools/* BRDFTextureTools */.J),
  BabylonFileLoaderConfiguration: () => (/* reexport */ BabylonFileLoaderConfiguration),
  BackEase: () => (/* reexport */ BackEase),
  BackgroundMaterial: () => (/* reexport */ BackgroundMaterial),
  BakedVertexAnimationManager: () => (/* reexport */ BakedVertexAnimationManager),
  BallAndSocketConstraint: () => (/* reexport */ BallAndSocketConstraint),
  BaseCameraMouseWheelInput: () => (/* reexport */ BaseCameraMouseWheelInput/* BaseCameraMouseWheelInput */.l),
  BaseCameraPointersInput: () => (/* reexport */ BaseCameraPointersInput),
  BaseError: () => (/* reexport */ error/* BaseError */.Cf),
  BaseParticleSystem: () => (/* reexport */ BaseParticleSystem),
  BaseSixDofDragBehavior: () => (/* reexport */ baseSixDofDragBehavior/* BaseSixDofDragBehavior */.D),
  BaseTexture: () => (/* reexport */ baseTexture/* BaseTexture */.t),
  BasisFileInfo: () => (/* reexport */ basis/* BasisFileInfo */.$e),
  BasisTools: () => (/* reexport */ basis/* BasisTools */.ED),
  BasisToolsOptions: () => (/* reexport */ basis/* BasisToolsOptions */.Sl),
  BasisTranscodeConfiguration: () => (/* reexport */ basis/* BasisTranscodeConfiguration */.SV),
  BezierCurve: () => (/* reexport */ math/* BezierCurve */.vr),
  BezierCurveEase: () => (/* reexport */ BezierCurveEase),
  BiPlanarBlock: () => (/* reexport */ BiPlanarBlock),
  BinaryFileAssetTask: () => (/* reexport */ BinaryFileAssetTask),
  BindBonesParameters: () => (/* reexport */ materialHelper_functions/* BindBonesParameters */.f$),
  BindFogParameters: () => (/* reexport */ materialHelper_functions/* BindFogParameters */.Yy),
  BindLight: () => (/* reexport */ materialHelper_functions/* BindLight */.Kd),
  BindLightProperties: () => (/* reexport */ materialHelper_functions/* BindLightProperties */.L0),
  BindLights: () => (/* reexport */ materialHelper_functions/* BindLights */.RL),
  BindLogDepth: () => (/* reexport */ materialHelper_functions/* BindLogDepth */.DL),
  BindMorphTargetParameters: () => (/* reexport */ materialHelper_functions/* BindMorphTargetParameters */.nR),
  BindSceneUniformBuffer: () => (/* reexport */ materialHelper_functions/* BindSceneUniformBuffer */._8),
  BindTextureMatrix: () => (/* reexport */ materialHelper_functions/* BindTextureMatrix */.mA),
  BlackAndWhitePostProcess: () => (/* reexport */ BlackAndWhitePostProcess),
  BlendFactor: () => (/* reexport */ BlendFactor),
  BlendOperation: () => (/* reexport */ BlendOperation),
  BloomEffect: () => (/* reexport */ BloomEffect),
  BloomMergePostProcess: () => (/* reexport */ BloomMergePostProcess),
  BlurPostProcess: () => (/* reexport */ BlurPostProcess),
  Bone: () => (/* reexport */ bone/* Bone */.$),
  BoneAxesViewer: () => (/* reexport */ BoneAxesViewer),
  BoneIKController: () => (/* reexport */ BoneIKController),
  BoneLookController: () => (/* reexport */ BoneLookController),
  BonesBlock: () => (/* reexport */ BonesBlock),
  BooleanGeometryBlock: () => (/* reexport */ BooleanGeometryBlock),
  BooleanGeometryOperations: () => (/* reexport */ BooleanGeometryOperations),
  BounceEase: () => (/* reexport */ BounceEase),
  BouncingBehavior: () => (/* reexport */ BouncingBehavior),
  BoundingBlock: () => (/* reexport */ BoundingBlock),
  BoundingBox: () => (/* reexport */ boundingBox/* BoundingBox */.I),
  BoundingBoxGizmo: () => (/* reexport */ BoundingBoxGizmo),
  BoundingBoxRenderer: () => (/* reexport */ boundingBoxRenderer/* BoundingBoxRenderer */.b),
  BoundingInfo: () => (/* reexport */ boundingInfo/* BoundingInfo */.j),
  BoundingInfoHelper: () => (/* reexport */ BoundingInfoHelper),
  BoundingSphere: () => (/* reexport */ boundingSphere/* BoundingSphere */.i),
  BoxBlock: () => (/* reexport */ BoxBlock),
  BoxBuilder: () => (/* reexport */ boxBuilder/* BoxBuilder */.Jo),
  BoxParticleEmitter: () => (/* reexport */ BoxParticleEmitter),
  Buffer: () => (/* reexport */ Buffers_buffer/* Buffer */.h),
  BufferBindingType: () => (/* reexport */ BufferBindingType),
  BufferMapState: () => (/* reexport */ BufferMapState),
  BufferUsage: () => (/* reexport */ BufferUsage),
  CSG: () => (/* reexport */ CSG),
  CSG2: () => (/* reexport */ CSG2),
  Camera: () => (/* reexport */ Cameras_camera/* Camera */.i),
  CameraGizmo: () => (/* reexport */ CameraGizmo),
  CameraInputTypes: () => (/* reexport */ cameraInputsManager/* CameraInputTypes */.H),
  CameraInputsManager: () => (/* reexport */ cameraInputsManager/* CameraInputsManager */._),
  CannonJSPlugin: () => (/* reexport */ CannonJSPlugin),
  CanvasAlphaMode: () => (/* reexport */ CanvasAlphaMode),
  CanvasToneMappingMode: () => (/* reexport */ CanvasToneMappingMode),
  CapsuleBlock: () => (/* reexport */ CapsuleBlock),
  CapsuleBuilder: () => (/* reexport */ CapsuleBuilder),
  CascadedShadowGenerator: () => (/* reexport */ CascadedShadowGenerator),
  ChromaticAberrationPostProcess: () => (/* reexport */ ChromaticAberrationPostProcess),
  CircleEase: () => (/* reexport */ CircleEase),
  CircleOfConfusionPostProcess: () => (/* reexport */ CircleOfConfusionPostProcess),
  ClampBlock: () => (/* reexport */ ClampBlock),
  CleanGeometryBlock: () => (/* reexport */ CleanGeometryBlock),
  ClearCoatBlock: () => (/* reexport */ ClearCoatBlock),
  ClipPlanesBlock: () => (/* reexport */ ClipPlanesBlock),
  ClipboardEventTypes: () => (/* reexport */ clipboardEvents/* ClipboardEventTypes */.G),
  ClipboardInfo: () => (/* reexport */ clipboardEvents/* ClipboardInfo */.f),
  CloudBlock: () => (/* reexport */ CloudBlock),
  CloudPoint: () => (/* reexport */ cloudPoint/* CloudPoint */.M),
  Collider: () => (/* reexport */ Collider),
  Color3: () => (/* reexport */ math/* Color3 */.v9),
  Color3Gradient: () => (/* reexport */ Color3Gradient),
  Color4: () => (/* reexport */ math/* Color4 */.ov),
  ColorConverterBlock: () => (/* reexport */ ColorConverterBlock),
  ColorCorrectionPostProcess: () => (/* reexport */ ColorCorrectionPostProcess),
  ColorCurves: () => (/* reexport */ colorCurves/* ColorCurves */.Q),
  ColorGradient: () => (/* reexport */ ColorGradient),
  ColorGradingTexture: () => (/* reexport */ ColorGradingTexture),
  ColorMergerBlock: () => (/* reexport */ ColorMergerBlock),
  ColorSplitterBlock: () => (/* reexport */ ColorSplitterBlock),
  ColorWrite: () => (/* reexport */ ColorWrite),
  CombineAction: () => (/* reexport */ CombineAction),
  CompareFunction: () => (/* reexport */ CompareFunction),
  CompatibilityOptions: () => (/* reexport */ compatibilityOptions/* CompatibilityOptions */.p9),
  CompilationMessageType: () => (/* reexport */ CompilationMessageType),
  CompleteGreasedLineColorTable: () => (/* reexport */ CompleteGreasedLineColorTable),
  CompleteGreasedLineWidthTable: () => (/* reexport */ CompleteGreasedLineWidthTable),
  CompressionCodes: () => (/* reexport */ exrLoader_core/* CompressionCodes */.he),
  ComputeBindingType: () => (/* reexport */ ComputeBindingType),
  ComputeEffect: () => (/* reexport */ ComputeEffect),
  ComputeNormalsBlock: () => (/* reexport */ ComputeNormalsBlock),
  ComputePassTimestampLocation: () => (/* reexport */ ComputePassTimestampLocation),
  ComputeShader: () => (/* reexport */ computeShader/* ComputeShader */.H),
  ComputeShaderBoundingHelper: () => (/* reexport */ computeShaderBoundingHelper.ComputeShaderBoundingHelper),
  ComputeShaderParticleSystem: () => (/* reexport */ ComputeShaderParticleSystem),
  Condition: () => (/* reexport */ Condition),
  ConditionBlock: () => (/* reexport */ ConditionBlock),
  ConditionBlockTests: () => (/* reexport */ ConditionBlockTests),
  ConditionalBlock: () => (/* reexport */ ConditionalBlock),
  ConditionalBlockConditions: () => (/* reexport */ ConditionalBlockConditions),
  ConeDirectedParticleEmitter: () => (/* reexport */ ConeDirectedParticleEmitter),
  ConeParticleEmitter: () => (/* reexport */ ConeParticleEmitter),
  Constants: () => (/* reexport */ constants/* Constants */.Y),
  ContainerAssetTask: () => (/* reexport */ ContainerAssetTask),
  ConversionMode: () => (/* reexport */ ConversionMode),
  ConvolutionPostProcess: () => (/* reexport */ ConvolutionPostProcess),
  Coordinate: () => (/* reexport */ math/* Coordinate */.xp),
  CopyFloatData: () => (/* reexport */ bufferUtils/* CopyFloatData */.g),
  CopyTextureToTexture: () => (/* reexport */ CopyTextureToTexture),
  CopyTools: () => (/* reexport */ copyTools/* CopyTools */.D8),
  CreateBox: () => (/* reexport */ boxBuilder/* CreateBox */.an),
  CreateBoxVertexData: () => (/* reexport */ boxBuilder/* CreateBoxVertexData */.KA),
  CreateCapsule: () => (/* reexport */ CreateCapsule),
  CreateCapsuleVertexData: () => (/* reexport */ CreateCapsuleVertexData),
  CreateCylinder: () => (/* reexport */ CreateCylinder),
  CreateCylinderVertexData: () => (/* reexport */ CreateCylinderVertexData),
  CreateDashedLines: () => (/* reexport */ CreateDashedLines),
  CreateDashedLinesVertexData: () => (/* reexport */ CreateDashedLinesVertexData),
  CreateDecal: () => (/* reexport */ CreateDecal),
  CreateDecoderAsync: () => (/* reexport */ exrLoader_decoder/* CreateDecoderAsync */.d),
  CreateDisc: () => (/* reexport */ CreateDisc),
  CreateDiscVertexData: () => (/* reexport */ CreateDiscVertexData),
  CreateEnvTextureAsync: () => (/* reexport */ environmentTextureTools/* CreateEnvTextureAsync */.Hx),
  CreateGeodesic: () => (/* reexport */ CreateGeodesic),
  CreateGoldberg: () => (/* reexport */ CreateGoldberg),
  CreateGoldbergVertexData: () => (/* reexport */ CreateGoldbergVertexData),
  CreateGreasedLine: () => (/* reexport */ CreateGreasedLine),
  CreateGreasedLineMaterial: () => (/* reexport */ CreateGreasedLineMaterial),
  CreateGround: () => (/* reexport */ groundBuilder/* CreateGround */.km),
  CreateGroundFromHeightMap: () => (/* reexport */ groundBuilder/* CreateGroundFromHeightMap */.RI),
  CreateGroundFromHeightMapVertexData: () => (/* reexport */ groundBuilder/* CreateGroundFromHeightMapVertexData */.r_),
  CreateGroundVertexData: () => (/* reexport */ groundBuilder/* CreateGroundVertexData */.EH),
  CreateHemisphere: () => (/* reexport */ CreateHemisphere),
  CreateIcoSphere: () => (/* reexport */ CreateIcoSphere),
  CreateIcoSphereVertexData: () => (/* reexport */ CreateIcoSphereVertexData),
  CreateImageBitmapFromSource: () => (/* reexport */ engine_common/* CreateImageBitmapFromSource */.kF),
  CreateImageDataArrayBufferViews: () => (/* reexport */ environmentTextureTools/* CreateImageDataArrayBufferViews */.$h),
  CreateLathe: () => (/* reexport */ CreateLathe),
  CreateLineSystem: () => (/* reexport */ CreateLineSystem),
  CreateLineSystemVertexData: () => (/* reexport */ CreateLineSystemVertexData),
  CreateLines: () => (/* reexport */ CreateLines),
  CreatePickingRay: () => (/* reexport */ Culling_ray/* CreatePickingRay */.ui),
  CreatePickingRayInCameraSpace: () => (/* reexport */ Culling_ray/* CreatePickingRayInCameraSpace */.AU),
  CreatePickingRayInCameraSpaceToRef: () => (/* reexport */ Culling_ray/* CreatePickingRayInCameraSpaceToRef */.oZ),
  CreatePickingRayToRef: () => (/* reexport */ Culling_ray/* CreatePickingRayToRef */.Gz),
  CreatePlane: () => (/* reexport */ planeBuilder/* CreatePlane */.x),
  CreatePlaneVertexData: () => (/* reexport */ planeBuilder/* CreatePlaneVertexData */.LG),
  CreatePolygon: () => (/* reexport */ CreatePolygon),
  CreatePolygonVertexData: () => (/* reexport */ CreatePolygonVertexData),
  CreatePolyhedron: () => (/* reexport */ CreatePolyhedron),
  CreatePolyhedronVertexData: () => (/* reexport */ CreatePolyhedronVertexData),
  CreateResizedCopy: () => (/* reexport */ textureTools/* CreateResizedCopy */.EE),
  CreateRibbon: () => (/* reexport */ CreateRibbon),
  CreateRibbonVertexData: () => (/* reexport */ CreateRibbonVertexData),
  CreateScreenshot: () => (/* reexport */ CreateScreenshot),
  CreateScreenshotAsync: () => (/* reexport */ CreateScreenshotAsync),
  CreateScreenshotUsingRenderTarget: () => (/* reexport */ CreateScreenshotUsingRenderTarget),
  CreateScreenshotUsingRenderTargetAsync: () => (/* reexport */ CreateScreenshotUsingRenderTargetAsync),
  CreateScreenshotWithResizeAsync: () => (/* reexport */ CreateScreenshotWithResizeAsync),
  CreateSegmentedBoxVertexData: () => (/* reexport */ boxBuilder/* CreateSegmentedBoxVertexData */.G$),
  CreateSphere: () => (/* reexport */ CreateSphere),
  CreateSphereVertexData: () => (/* reexport */ CreateSphereVertexData),
  CreateText: () => (/* reexport */ CreateText),
  CreateTextShapePaths: () => (/* reexport */ CreateTextShapePaths),
  CreateTiledBox: () => (/* reexport */ CreateTiledBox),
  CreateTiledBoxVertexData: () => (/* reexport */ CreateTiledBoxVertexData),
  CreateTiledGround: () => (/* reexport */ groundBuilder/* CreateTiledGround */.ol),
  CreateTiledGroundVertexData: () => (/* reexport */ groundBuilder/* CreateTiledGroundVertexData */.k),
  CreateTiledPlane: () => (/* reexport */ CreateTiledPlane),
  CreateTiledPlaneVertexData: () => (/* reexport */ CreateTiledPlaneVertexData),
  CreateTorus: () => (/* reexport */ CreateTorus),
  CreateTorusKnot: () => (/* reexport */ CreateTorusKnot),
  CreateTorusKnotVertexData: () => (/* reexport */ CreateTorusKnotVertexData),
  CreateTorusVertexData: () => (/* reexport */ CreateTorusVertexData),
  CreateTube: () => (/* reexport */ CreateTube),
  CrossBlock: () => (/* reexport */ CrossBlock),
  CubeMapToSphericalPolynomialTools: () => (/* reexport */ cubemapToSphericalPolynomial/* CubeMapToSphericalPolynomialTools */.d),
  CubeTexture: () => (/* reexport */ Textures_cubeTexture/* CubeTexture */.b),
  CubeTextureAssetTask: () => (/* reexport */ CubeTextureAssetTask),
  CubicEase: () => (/* reexport */ CubicEase),
  CullMode: () => (/* reexport */ CullMode),
  CurrentScreenBlock: () => (/* reexport */ CurrentScreenBlock),
  Curve3: () => (/* reexport */ math/* Curve3 */.jj),
  CurveBlock: () => (/* reexport */ CurveBlock),
  CurveBlockTypes: () => (/* reexport */ CurveBlockTypes),
  CustomBlock: () => (/* reexport */ CustomBlock),
  CustomOptimization: () => (/* reexport */ CustomOptimization),
  CustomParticleEmitter: () => (/* reexport */ CustomParticleEmitter),
  CustomProceduralTexture: () => (/* reexport */ CustomProceduralTexture),
  CylinderBlock: () => (/* reexport */ CylinderBlock),
  CylinderBuilder: () => (/* reexport */ CylinderBuilder),
  CylinderDirectedParticleEmitter: () => (/* reexport */ CylinderDirectedParticleEmitter),
  CylinderParticleEmitter: () => (/* reexport */ CylinderParticleEmitter),
  DDSTools: () => (/* reexport */ dds.DDSTools),
  DataBuffer: () => (/* reexport */ dataBuffer/* DataBuffer */.n),
  DataReader: () => (/* reexport */ dataReader/* DataReader */.s),
  DataStorage: () => (/* reexport */ DataStorage),
  Database: () => (/* reexport */ Database),
  DebugBlock: () => (/* reexport */ DebugBlock),
  DebugLayer: () => (/* reexport */ debugLayer/* DebugLayer */.d),
  DebugLayerTab: () => (/* reexport */ debugLayer/* DebugLayerTab */.K),
  DecalBuilder: () => (/* reexport */ DecalBuilder),
  DecalMapConfiguration: () => (/* reexport */ DecalMapConfiguration),
  DecalMapDefines: () => (/* reexport */ DecalMapDefines),
  Decode: () => (/* reexport */ stringTools/* Decode */.Tq),
  DecodeBase64ToBinary: () => (/* reexport */ stringTools/* DecodeBase64ToBinary */.yS),
  DecodeBase64ToString: () => (/* reexport */ stringTools/* DecodeBase64ToString */.AV),
  DecodeBase64UrlToBinary: () => (/* reexport */ fileTools/* DecodeBase64UrlToBinary */.rz),
  DecodeBase64UrlToString: () => (/* reexport */ fileTools/* DecodeBase64UrlToString */.dy),
  DecodeFloat32: () => (/* reexport */ exrLoader_core/* DecodeFloat32 */.Sn),
  DecodeRunLength: () => (/* reexport */ exrLoader_compression_rle/* DecodeRunLength */._),
  DeepCopier: () => (/* reexport */ deepCopier/* DeepCopier */.r),
  DefaultCollisionCoordinator: () => (/* reexport */ DefaultCollisionCoordinator),
  DefaultKTX2DecoderOptions: () => (/* reexport */ khronosTextureContainer2/* DefaultKTX2DecoderOptions */.$),
  DefaultLoadingScreen: () => (/* reexport */ DefaultLoadingScreen),
  DefaultRenderingPipeline: () => (/* reexport */ DefaultRenderingPipeline),
  Deferred: () => (/* reexport */ Misc_deferred/* Deferred */.c),
  DepthCullingState: () => (/* reexport */ depthCullingState/* DepthCullingState */.N),
  DepthOfFieldBlurPostProcess: () => (/* reexport */ DepthOfFieldBlurPostProcess),
  DepthOfFieldEffect: () => (/* reexport */ DepthOfFieldEffect),
  DepthOfFieldEffectBlurLevel: () => (/* reexport */ DepthOfFieldEffectBlurLevel),
  DepthOfFieldMergePostProcess: () => (/* reexport */ DepthOfFieldMergePostProcess),
  DepthPeelingRenderer: () => (/* reexport */ DepthPeelingRenderer),
  DepthPeelingSceneComponent: () => (/* reexport */ DepthPeelingSceneComponent),
  DepthReducer: () => (/* reexport */ DepthReducer),
  DepthRenderer: () => (/* reexport */ DepthRenderer),
  DepthRendererSceneComponent: () => (/* reexport */ DepthRendererSceneComponent),
  DepthSortedParticle: () => (/* reexport */ DepthSortedParticle),
  DerivativeBlock: () => (/* reexport */ DerivativeBlock),
  DesaturateBlock: () => (/* reexport */ DesaturateBlock),
  DetailMapConfiguration: () => (/* reexport */ material_detailMapConfiguration/* DetailMapConfiguration */.c),
  DeviceInputEventType: () => (/* reexport */ deviceInputEvents/* DeviceInputEventType */.b),
  DeviceLostReason: () => (/* reexport */ DeviceLostReason),
  DeviceOrientationCamera: () => (/* reexport */ DeviceOrientationCamera),
  DeviceSource: () => (/* reexport */ deviceSource/* DeviceSource */.c),
  DeviceSourceManager: () => (/* reexport */ deviceSourceManager/* DeviceSourceManager */.Z),
  DeviceType: () => (/* reexport */ deviceEnums/* DeviceType */.bq),
  DirectionalLight: () => (/* reexport */ directionalLight/* DirectionalLight */.Z),
  DirectionalLightFrustumViewer: () => (/* reexport */ DirectionalLightFrustumViewer),
  DiscBlock: () => (/* reexport */ DiscBlock),
  DiscBuilder: () => (/* reexport */ DiscBuilder),
  DiscardBlock: () => (/* reexport */ DiscardBlock),
  DisplayPassPostProcess: () => (/* reexport */ DisplayPassPostProcess),
  DistanceBlock: () => (/* reexport */ DistanceBlock),
  DistanceConstraint: () => (/* reexport */ DistanceConstraint),
  DistanceJoint: () => (/* reexport */ DistanceJoint),
  DivideBlock: () => (/* reexport */ DivideBlock),
  DoNothingAction: () => (/* reexport */ DoNothingAction),
  DomManagement: () => (/* reexport */ domManagement/* DomManagement */.Az),
  DotBlock: () => (/* reexport */ DotBlock),
  DracoCompression: () => (/* reexport */ dracoCompression/* DracoCompression */.g),
  DragOperation: () => (/* reexport */ DragOperation),
  DrawWrapper: () => (/* reexport */ Materials_drawWrapper/* DrawWrapper */.E),
  DualSenseInput: () => (/* reexport */ deviceEnums/* DualSenseInput */.pI),
  DualShockButton: () => (/* reexport */ DualShockButton),
  DualShockDpad: () => (/* reexport */ DualShockDpad),
  DualShockInput: () => (/* reexport */ deviceEnums/* DualShockInput */.h8),
  DualShockPad: () => (/* reexport */ DualShockPad),
  DumpTools: () => (/* reexport */ dumpTools.DumpTools),
  DynamicFloat32Array: () => (/* reexport */ DynamicFloat32Array),
  DynamicTexture: () => (/* reexport */ Textures_dynamicTexture/* DynamicTexture */.R),
  EXROutputType: () => (/* reexport */ exrLoader_configuration/* EXROutputType */.V),
  EasingFunction: () => (/* reexport */ EasingFunction),
  EdgesRenderer: () => (/* reexport */ EdgesRenderer),
  Effect: () => (/* reexport */ Materials_effect/* Effect */.M),
  EffectFallbacks: () => (/* reexport */ effectFallbacks/* EffectFallbacks */.J),
  EffectLayer: () => (/* reexport */ EffectLayer),
  EffectLayerSceneComponent: () => (/* reexport */ EffectLayerSceneComponent),
  EffectRenderer: () => (/* reexport */ effectRenderer/* EffectRenderer */.J),
  EffectWrapper: () => (/* reexport */ effectRenderer/* EffectWrapper */.$),
  ElasticEase: () => (/* reexport */ ElasticEase),
  ElbowBlock: () => (/* reexport */ ElbowBlock),
  EncodeArrayBufferToBase64: () => (/* reexport */ stringTools/* EncodeArrayBufferToBase64 */.EL),
  EndsWith: () => (/* reexport */ stringTools/* EndsWith */.jq),
  Engine: () => (/* reexport */ Engines_engine/* Engine */.N),
  EngineFactory: () => (/* reexport */ EngineFactory),
  EngineFormat: () => (/* reexport */ ktx2decoderTypes/* EngineFormat */.GQ),
  EngineInstrumentation: () => (/* reexport */ EngineInstrumentation),
  EngineStore: () => (/* reexport */ engineStore/* EngineStore */.q),
  EngineView: () => (/* reexport */ EngineView),
  EnvironmentHelper: () => (/* reexport */ EnvironmentHelper),
  EnvironmentTextureTools: () => (/* reexport */ environmentTextureTools/* EnvironmentTextureTools */.qY),
  Epsilon: () => (/* reexport */ math/* Epsilon */.bH),
  EquiRectangularCubeTexture: () => (/* reexport */ EquiRectangularCubeTexture),
  EquiRectangularCubeTextureAssetTask: () => (/* reexport */ EquiRectangularCubeTextureAssetTask),
  ErrorCodes: () => (/* reexport */ error/* ErrorCodes */.tG),
  ErrorFilter: () => (/* reexport */ ErrorFilter),
  EventConstants: () => (/* reexport */ deviceInputEvents/* EventConstants */.s),
  EventState: () => (/* reexport */ Misc_observable/* EventState */.qO),
  ExecuteCodeAction: () => (/* reexport */ ExecuteCodeAction),
  ExitFullscreen: () => (/* reexport */ engine_common/* ExitFullscreen */.g7),
  ExitPointerlock: () => (/* reexport */ engine_common/* ExitPointerlock */.rT),
  ExponentialEase: () => (/* reexport */ ExponentialEase),
  ExrLoaderGlobalConfiguration: () => (/* reexport */ exrLoader_configuration/* ExrLoaderGlobalConfiguration */.u),
  ExternalTexture: () => (/* reexport */ ExternalTexture),
  ExtractHighlightsPostProcess: () => (/* reexport */ ExtractHighlightsPostProcess),
  ExtrudePolygon: () => (/* reexport */ ExtrudePolygon),
  ExtrudeShape: () => (/* reexport */ ExtrudeShape),
  ExtrudeShapeCustom: () => (/* reexport */ ExtrudeShapeCustom),
  FactorGradient: () => (/* reexport */ FactorGradient),
  FadeInOutBehavior: () => (/* reexport */ fadeInOutBehavior/* FadeInOutBehavior */._),
  FeatureName: () => (/* reexport */ FeatureName),
  FileTools: () => (/* reexport */ fileTools/* FileTools */.wS),
  FileToolsOptions: () => (/* reexport */ fileTools/* FileToolsOptions */.eC),
  FilesInput: () => (/* reexport */ FilesInput),
  FilesInputStore: () => (/* reexport */ filesInputStore/* FilesInputStore */.T),
  FilterMode: () => (/* reexport */ FilterMode),
  FilterPostProcess: () => (/* reexport */ FilterPostProcess),
  FixFlippedFaces: () => (/* reexport */ math_functions/* FixFlippedFaces */.Y4),
  FlowGraph: () => (/* reexport */ flowGraph/* FlowGraph */.$),
  FlowGraphAbsBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphAbsBlock */.IC),
  FlowGraphAcosBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphAcosBlock */.eR),
  FlowGraphAcoshBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphAcoshBlock */.c5),
  FlowGraphAddBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphAddBlock */.nm),
  FlowGraphAsinBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphAsinBlock */.P3),
  FlowGraphAsinhBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphAsinhBlock */.dm),
  FlowGraphAtan2Block: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphAtan2Block */.CN),
  FlowGraphAtanBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphAtanBlock */.Q6),
  FlowGraphAtanhBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphAtanhBlock */.yq),
  FlowGraphBitwiseAndBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphBitwiseAndBlock */.EX),
  FlowGraphBitwiseLeftShiftBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphBitwiseLeftShiftBlock */.Mq),
  FlowGraphBitwiseNotBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphBitwiseNotBlock */.uk),
  FlowGraphBitwiseOrBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphBitwiseOrBlock */.YT),
  FlowGraphBitwiseRightShiftBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphBitwiseRightShiftBlock */.xi),
  FlowGraphBitwiseXorBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphBitwiseXorBlock */.w1),
  FlowGraphBlock: () => (/* reexport */ flowGraphBlock/* FlowGraphBlock */.e),
  FlowGraphBranchBlock: () => (/* reexport */ FlowGraphBranchBlock),
  FlowGraphCeilBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphCeilBlock */.Bz),
  FlowGraphClampBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphClampBlock */.FZ),
  FlowGraphConditionalDataBlock: () => (/* reexport */ FlowGraphConditionalDataBlock),
  FlowGraphConnection: () => (/* reexport */ flowGraphConnection/* FlowGraphConnection */.X),
  FlowGraphConnectionType: () => (/* reexport */ flowGraphConnection/* FlowGraphConnectionType */.H),
  FlowGraphConsoleLogBlock: () => (/* reexport */ flowGraphConsoleLogBlock/* FlowGraphConsoleLogBlock */.B),
  FlowGraphConstantBlock: () => (/* reexport */ FlowGraphConstantBlock),
  FlowGraphContext: () => (/* reexport */ flowGraphContext/* FlowGraphContext */.Y),
  FlowGraphContextLogger: () => (/* reexport */ FlowGraphContextLogger),
  FlowGraphCoordinateTransformBlock: () => (/* reexport */ FlowGraphCoordinateTransformBlock),
  FlowGraphCoordinator: () => (/* reexport */ flowGraphCoordinator/* FlowGraphCoordinator */.x),
  FlowGraphCosBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphCosBlock */.fk),
  FlowGraphCoshBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphCoshBlock */.ro),
  FlowGraphCountLeadingZerosBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphCountLeadingZerosBlock */._I),
  FlowGraphCountOneBitsBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphCountOneBitsBlock */.j),
  FlowGraphCountTrailingZerosBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphCountTrailingZerosBlock */.KJ),
  FlowGraphCounterBlock: () => (/* reexport */ FlowGraphCounterBlock),
  FlowGraphCrossBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphCrossBlock */.M),
  FlowGraphCubeRootBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphCubeRootBlock */.T2),
  FlowGraphDataConnection: () => (/* reexport */ flowGraphDataConnection/* FlowGraphDataConnection */.l),
  FlowGraphDebounceBlock: () => (/* reexport */ FlowGraphDebounceBlock),
  FlowGraphDegToRadBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphDegToRadBlock */.i2),
  FlowGraphDeterminantBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphDeterminantBlock */.Rl),
  FlowGraphDivideBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphDivideBlock */.VZ),
  FlowGraphDoNBlock: () => (/* reexport */ flowGraphDoNBlock/* FlowGraphDoNBlock */.V),
  FlowGraphDotBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphDotBlock */.xv),
  FlowGraphEBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphEBlock */.nc),
  FlowGraphEqBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphEqBlock */.ud),
  FlowGraphEventBlock: () => (/* reexport */ flowGraphEventBlock/* FlowGraphEventBlock */.i),
  FlowGraphExecutionBlock: () => (/* reexport */ flowGraphExecutionBlock/* FlowGraphExecutionBlock */.u),
  FlowGraphExpBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphExpBlock */.B5),
  FlowGraphFlipFlopBlock: () => (/* reexport */ FlowGraphFlipFlopBlock),
  FlowGraphFloorBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphFloorBlock */.my),
  FlowGraphForLoopBlock: () => (/* reexport */ FlowGraphForLoopBlock),
  FlowGraphFractBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphFractBlock */._L),
  FlowGraphGetPropertyBlock: () => (/* reexport */ flowGraphGetPropertyBlock/* FlowGraphGetPropertyBlock */.v),
  FlowGraphGetVariableBlock: () => (/* reexport */ flowGraphGetVariableBlock/* FlowGraphGetVariableBlock */.g),
  FlowGraphGreaterThanBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphGreaterThanBlock */.Vu),
  FlowGraphGreaterThanOrEqualBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphGreaterThanOrEqualBlock */.ct),
  FlowGraphInfBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphInfBlock */.vs),
  FlowGraphInterpolateBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphInterpolateBlock */.rY),
  FlowGraphInvertMatrixBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphInvertMatrixBlock */.P_),
  FlowGraphIsInfBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphIsInfBlock */.hH),
  FlowGraphIsNanBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphIsNanBlock */.JA),
  FlowGraphLengthBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphLengthBlock */.EF),
  FlowGraphLessThanBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphLessThanBlock */.ws),
  FlowGraphLessThanOrEqualBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphLessThanOrEqualBlock */.dq),
  FlowGraphLog10Block: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphLog10Block */.l9),
  FlowGraphLog2Block: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphLog2Block */.w$),
  FlowGraphLogBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphLogBlock */.uE),
  FlowGraphLogicAndBlock: () => (/* reexport */ FlowGraphLogicAndBlock),
  FlowGraphLogicNotBlock: () => (/* reexport */ FlowGraphLogicNotBlock),
  FlowGraphLogicOrBlock: () => (/* reexport */ FlowGraphLogicOrBlock),
  FlowGraphMatMulBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphMatMulBlock */.Ix),
  FlowGraphMaxBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphMaxBlock */.OK),
  FlowGraphMeshPickEventBlock: () => (/* reexport */ flowGraphMeshPickEventBlock/* FlowGraphMeshPickEventBlock */.i),
  FlowGraphMinBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphMinBlock */.WR),
  FlowGraphMultiGateBlock: () => (/* reexport */ FlowGraphMultiGateBlock),
  FlowGraphMultiplyBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphMultiplyBlock */.yW),
  FlowGraphNaNBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphNaNBlock */.pg),
  FlowGraphNegBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphNegBlock */.Oi),
  FlowGraphNormalizeBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphNormalizeBlock */.TK),
  FlowGraphPauseAnimationBlock: () => (/* reexport */ FlowGraphPauseAnimationBlock),
  FlowGraphPiBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphPiBlock */.L7),
  FlowGraphPlayAnimationBlock: () => (/* reexport */ FlowGraphPlayAnimationBlock),
  FlowGraphPowBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphPowBlock */.sV),
  FlowGraphRadToDegBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphRadToDegBlock */.Qe),
  FlowGraphRandomBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphRandomBlock */.Je),
  FlowGraphReceiveCustomEventBlock: () => (/* reexport */ flowGraphReceiveCustomEventBlock/* FlowGraphReceiveCustomEventBlock */.W),
  FlowGraphRemainderBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphRemainderBlock */.fG),
  FlowGraphRotate2DBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphRotate2DBlock */.z6),
  FlowGraphRotate3DBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphRotate3DBlock */.g1),
  FlowGraphSaturateBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphSaturateBlock */.ns),
  FlowGraphSceneReadyEventBlock: () => (/* reexport */ flowGraphSceneReadyEventBlock/* FlowGraphSceneReadyEventBlock */.b),
  FlowGraphSceneTickEventBlock: () => (/* reexport */ flowGraphSceneTickEventBlock/* FlowGraphSceneTickEventBlock */.B),
  FlowGraphSendCustomEventBlock: () => (/* reexport */ flowGraphSendCustomEventBlock/* FlowGraphSendCustomEventBlock */.z),
  FlowGraphSequenceBlock: () => (/* reexport */ flowGraphSequenceBlock/* FlowGraphSequenceBlock */.v),
  FlowGraphSetPropertyBlock: () => (/* reexport */ flowGraphSetPropertyBlock/* FlowGraphSetPropertyBlock */.L),
  FlowGraphSetVariableBlock: () => (/* reexport */ flowGraphSetVariableBlock/* FlowGraphSetVariableBlock */.U),
  FlowGraphSignBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphSignBlock */.Fz),
  FlowGraphSignalConnection: () => (/* reexport */ flowGraphSignalConnection/* FlowGraphSignalConnection */.R),
  FlowGraphSinBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphSinBlock */.sR),
  FlowGraphSinhBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphSinhBlock */.Mk),
  FlowGraphSqrtBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphSqrtBlock */.qJ),
  FlowGraphState: () => (/* reexport */ flowGraph/* FlowGraphState */.I),
  FlowGraphStopAnimationBlock: () => (/* reexport */ FlowGraphStopAnimationBlock),
  FlowGraphSubtractBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphSubtractBlock */.Cu),
  FlowGraphSwitchBlock: () => (/* reexport */ FlowGraphSwitchBlock),
  FlowGraphTanBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphTanBlock */.Vb),
  FlowGraphTanhBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphTanhBlock */.Vl),
  FlowGraphThrottleBlock: () => (/* reexport */ FlowGraphThrottleBlock),
  FlowGraphTimerBlock: () => (/* reexport */ flowGraphTimerBlock/* FlowGraphTimerBlock */.B),
  FlowGraphTransposeBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphTransposeBlock */.F9),
  FlowGraphTruncBlock: () => (/* reexport */ flowGraphMathBlocks/* FlowGraphTruncBlock */.CM),
  FlowGraphWaitAllBlock: () => (/* reexport */ FlowGraphWaitAllBlock),
  FlowGraphWhileLoopBlock: () => (/* reexport */ flowGraphWhileLoopBlock/* FlowGraphWhileLoopBlock */.J),
  FluidRenderer: () => (/* reexport */ FluidRenderer),
  FluidRendererSceneComponent: () => (/* reexport */ FluidRendererSceneComponent),
  FluidRenderingDebug: () => (/* reexport */ FluidRenderingDebug),
  FluidRenderingObject: () => (/* reexport */ FluidRenderingObject),
  FluidRenderingObjectCustomParticles: () => (/* reexport */ FluidRenderingObjectCustomParticles),
  FluidRenderingObjectParticleSystem: () => (/* reexport */ FluidRenderingObjectParticleSystem),
  FluidRenderingTargetRenderer: () => (/* reexport */ FluidRenderingTargetRenderer),
  FlyCamera: () => (/* reexport */ FlyCamera),
  FlyCameraInputsManager: () => (/* reexport */ FlyCameraInputsManager),
  FlyCameraKeyboardInput: () => (/* reexport */ FlyCameraKeyboardInput),
  FlyCameraMouseInput: () => (/* reexport */ FlyCameraMouseInput),
  FogBlock: () => (/* reexport */ FogBlock),
  FollowBehavior: () => (/* reexport */ followBehavior/* FollowBehavior */.S),
  FollowCamera: () => (/* reexport */ FollowCamera),
  FollowCameraInputsManager: () => (/* reexport */ FollowCameraInputsManager),
  FollowCameraKeyboardMoveInput: () => (/* reexport */ FollowCameraKeyboardMoveInput),
  FollowCameraMouseWheelInput: () => (/* reexport */ FollowCameraMouseWheelInput),
  FollowCameraPointersInput: () => (/* reexport */ FollowCameraPointersInput),
  FragCoordBlock: () => (/* reexport */ FragCoordBlock),
  FragDepthBlock: () => (/* reexport */ FragDepthBlock),
  FragmentOutputBlock: () => (/* reexport */ FragmentOutputBlock),
  FragmentOutputBlockColorSpace: () => (/* reexport */ FragmentOutputBlockColorSpace),
  FrameGraph: () => (/* reexport */ FrameGraph),
  FrameGraphBlackAndWhiteTask: () => (/* reexport */ FrameGraphBlackAndWhiteTask),
  FrameGraphBloomTask: () => (/* reexport */ FrameGraphBloomTask),
  FrameGraphBlurTask: () => (/* reexport */ FrameGraphBlurTask),
  FrameGraphCircleOfConfusionTask: () => (/* reexport */ FrameGraphCircleOfConfusionTask),
  FrameGraphClearTextureTask: () => (/* reexport */ FrameGraphClearTextureTask),
  FrameGraphContext: () => (/* reexport */ FrameGraphContext),
  FrameGraphCopyToBackbufferColorTask: () => (/* reexport */ FrameGraphCopyToBackbufferColorTask),
  FrameGraphCopyToTextureTask: () => (/* reexport */ FrameGraphCopyToTextureTask),
  FrameGraphCullObjectsTask: () => (/* reexport */ FrameGraphCullObjectsTask),
  FrameGraphDepthOfFieldTask: () => (/* reexport */ FrameGraphDepthOfFieldTask),
  FrameGraphExtractHighlightsTask: () => (/* reexport */ FrameGraphExtractHighlightsTask),
  FrameGraphGeometryRendererTask: () => (/* reexport */ FrameGraphGeometryRendererTask),
  FrameGraphObjectList: () => (/* reexport */ FrameGraphObjectList),
  FrameGraphObjectRendererTask: () => (/* reexport */ FrameGraphObjectRendererTask),
  FrameGraphPass: () => (/* reexport */ Passes_pass/* FrameGraphPass */.X),
  FrameGraphPostProcessTask: () => (/* reexport */ FrameGraphPostProcessTask),
  FrameGraphRenderContext: () => (/* reexport */ FrameGraphRenderContext),
  FrameGraphRenderPass: () => (/* reexport */ renderPass/* FrameGraphRenderPass */.p),
  FrameGraphRenderTarget: () => (/* reexport */ FrameGraphRenderTarget),
  FrameGraphTAAObjectRendererTask: () => (/* reexport */ FrameGraphTAAObjectRendererTask),
  FrameGraphTask: () => (/* reexport */ frameGraphTask/* FrameGraphTask */.L),
  FrameGraphTextureManager: () => (/* reexport */ FrameGraphTextureManager),
  FramingBehavior: () => (/* reexport */ FramingBehavior),
  FreeCamera: () => (/* reexport */ Cameras_freeCamera/* FreeCamera */.S),
  FreeCameraDeviceOrientationInput: () => (/* reexport */ FreeCameraDeviceOrientationInput),
  FreeCameraGamepadInput: () => (/* reexport */ FreeCameraGamepadInput),
  FreeCameraInputsManager: () => (/* reexport */ freeCameraInputsManager/* FreeCameraInputsManager */.s),
  FreeCameraKeyboardMoveInput: () => (/* reexport */ freeCameraKeyboardMoveInput/* FreeCameraKeyboardMoveInput */.i),
  FreeCameraMouseInput: () => (/* reexport */ freeCameraMouseInput/* FreeCameraMouseInput */.h),
  FreeCameraMouseWheelInput: () => (/* reexport */ freeCameraMouseWheelInput/* FreeCameraMouseWheelInput */.m),
  FreeCameraTouchInput: () => (/* reexport */ freeCameraTouchInput/* FreeCameraTouchInput */.Z),
  FreeCameraVirtualJoystickInput: () => (/* reexport */ FreeCameraVirtualJoystickInput),
  FresnelBlock: () => (/* reexport */ FresnelBlock),
  FresnelParameters: () => (/* reexport */ FresnelParameters),
  FromHalfFloat: () => (/* reexport */ textureTools/* FromHalfFloat */.SX),
  FrontFace: () => (/* reexport */ FrontFace),
  FrontFacingBlock: () => (/* reexport */ FrontFacingBlock),
  Frustum: () => (/* reexport */ math/* Frustum */.PP),
  FxaaPostProcess: () => (/* reexport */ FxaaPostProcess),
  GIRSM: () => (/* reexport */ GIRSM),
  GIRSMManager: () => (/* reexport */ GIRSMManager),
  GIRSMRenderPluginMaterial: () => (/* reexport */ GIRSMRenderPluginMaterial),
  GPUParticleSystem: () => (/* reexport */ GPUParticleSystem),
  GPUPicker: () => (/* reexport */ GPUPicker),
  GUID: () => (/* reexport */ guid/* GUID */.S),
  Gamepad: () => (/* reexport */ Gamepad),
  GamepadCamera: () => (/* reexport */ GamepadCamera),
  GamepadManager: () => (/* reexport */ GamepadManager),
  GamepadSystemSceneComponent: () => (/* reexport */ GamepadSystemSceneComponent),
  GaussianBlock: () => (/* reexport */ GaussianBlock),
  GaussianSplattingBlock: () => (/* reexport */ GaussianSplattingBlock),
  GaussianSplattingMaterial: () => (/* reexport */ gaussianSplattingMaterial/* GaussianSplattingMaterial */.b),
  GaussianSplattingMesh: () => (/* reexport */ gaussianSplattingMesh/* GaussianSplattingMesh */.t),
  GenerateBase64StringFromPixelData: () => (/* reexport */ copyTools/* GenerateBase64StringFromPixelData */.c9),
  GenerateBase64StringFromTexture: () => (/* reexport */ copyTools/* GenerateBase64StringFromTexture */.lP),
  GenerateBase64StringFromTextureAsync: () => (/* reexport */ copyTools/* GenerateBase64StringFromTextureAsync */.nh),
  GenericPad: () => (/* reexport */ GenericPad),
  GeodesicData: () => (/* reexport */ GeodesicData),
  Geometry: () => (/* reexport */ geometry/* Geometry */.V),
  GeometryArcTan2Block: () => (/* reexport */ GeometryArcTan2Block),
  GeometryBufferRenderer: () => (/* reexport */ GeometryBufferRenderer),
  GeometryBufferRendererSceneComponent: () => (/* reexport */ GeometryBufferRendererSceneComponent),
  GeometryClampBlock: () => (/* reexport */ GeometryClampBlock),
  GeometryCollectionBlock: () => (/* reexport */ GeometryCollectionBlock),
  GeometryCrossBlock: () => (/* reexport */ GeometryCrossBlock),
  GeometryCurveBlock: () => (/* reexport */ GeometryCurveBlock),
  GeometryCurveBlockTypes: () => (/* reexport */ GeometryCurveBlockTypes),
  GeometryDesaturateBlock: () => (/* reexport */ GeometryDesaturateBlock),
  GeometryDistanceBlock: () => (/* reexport */ GeometryDistanceBlock),
  GeometryDotBlock: () => (/* reexport */ GeometryDotBlock),
  GeometryElbowBlock: () => (/* reexport */ GeometryElbowBlock),
  GeometryInfoBlock: () => (/* reexport */ GeometryInfoBlock),
  GeometryInputBlock: () => (/* reexport */ GeometryInputBlock),
  GeometryInterceptorBlock: () => (/* reexport */ GeometryInterceptorBlock),
  GeometryLengthBlock: () => (/* reexport */ GeometryLengthBlock),
  GeometryLerpBlock: () => (/* reexport */ GeometryLerpBlock),
  GeometryModBlock: () => (/* reexport */ GeometryModBlock),
  GeometryNLerpBlock: () => (/* reexport */ GeometryNLerpBlock),
  GeometryOptimizeBlock: () => (/* reexport */ GeometryOptimizeBlock),
  GeometryOutputBlock: () => (/* reexport */ GeometryOutputBlock),
  GeometryPosterizeBlock: () => (/* reexport */ GeometryPosterizeBlock),
  GeometryPowBlock: () => (/* reexport */ GeometryPowBlock),
  GeometryRenderingTextureClearType: () => (/* reexport */ materialHelper_geometryrendering/* GeometryRenderingTextureClearType */.Z),
  GeometryReplaceColorBlock: () => (/* reexport */ GeometryReplaceColorBlock),
  GeometryRotate2dBlock: () => (/* reexport */ GeometryRotate2dBlock),
  GeometrySmoothStepBlock: () => (/* reexport */ GeometrySmoothStepBlock),
  GeometryStepBlock: () => (/* reexport */ GeometryStepBlock),
  GeometryTextureBlock: () => (/* reexport */ GeometryTextureBlock),
  GeometryTextureFetchBlock: () => (/* reexport */ GeometryTextureFetchBlock),
  GeometryTransformBlock: () => (/* reexport */ GeometryTransformBlock),
  GeometryTrigonometryBlock: () => (/* reexport */ GeometryTrigonometryBlock),
  GeometryTrigonometryBlockOperations: () => (/* reexport */ GeometryTrigonometryBlockOperations),
  GetClass: () => (/* reexport */ typeStore/* GetClass */.n9),
  GetClassName: () => (/* reexport */ typeStore/* GetClassName */.Uu),
  GetDOMTextContent: () => (/* reexport */ domManagement/* GetDOMTextContent */.Zl),
  GetEnvInfo: () => (/* reexport */ environmentTextureTools/* GetEnvInfo */.cU),
  GetEnvironmentBRDFTexture: () => (/* reexport */ brdfTextureTools/* GetEnvironmentBRDFTexture */.X),
  GetExrHeader: () => (/* reexport */ exrLoader_header/* GetExrHeader */.V),
  GetFogState: () => (/* reexport */ materialHelper_functions/* GetFogState */.qL),
  GetFontOffset: () => (/* reexport */ engine_common/* GetFontOffset */.PR),
  GetForwardRay: () => (/* reexport */ Culling_ray/* GetForwardRay */.KI),
  GetForwardRayToRef: () => (/* reexport */ Culling_ray/* GetForwardRayToRef */.m9),
  GetHotSpotToRef: () => (/* reexport */ GetHotSpotToRef),
  GetIndividualParser: () => (/* reexport */ babylonFileParser_function/* GetIndividualParser */.LO),
  GetInternalFormatFromBasisFormat: () => (/* reexport */ basis/* GetInternalFormatFromBasisFormat */.yT),
  GetParser: () => (/* reexport */ babylonFileParser_function/* GetParser */.Iz),
  GetPointsCount: () => (/* reexport */ GetPointsCount),
  GetTGAHeader: () => (/* reexport */ tga/* GetTGAHeader */.O_),
  GetTextureDataAsync: () => (/* reexport */ textureTools/* GetTextureDataAsync */.Oz),
  GetTransformedPosition: () => (/* reexport */ GetTransformedPosition),
  GetTypeForDepthTexture: () => (/* reexport */ Textures_internalTexture/* GetTypeForDepthTexture */.GX),
  Gizmo: () => (/* reexport */ gizmo/* Gizmo */.Fq),
  GizmoAnchorPoint: () => (/* reexport */ gizmo/* GizmoAnchorPoint */.oO),
  GizmoCoordinatesMode: () => (/* reexport */ gizmo/* GizmoCoordinatesMode */.ry),
  GizmoManager: () => (/* reexport */ GizmoManager),
  GlowLayer: () => (/* reexport */ GlowLayer),
  GoldbergMesh: () => (/* reexport */ GoldbergMesh),
  GradientBlock: () => (/* reexport */ GradientBlock),
  GradientBlockColorStep: () => (/* reexport */ GradientBlockColorStep),
  GradientHelper: () => (/* reexport */ GradientHelper),
  GrainPostProcess: () => (/* reexport */ GrainPostProcess),
  GreasedLineBaseMesh: () => (/* reexport */ GreasedLineBaseMesh),
  GreasedLineMaterialDefaults: () => (/* reexport */ GreasedLineMaterialDefaults),
  GreasedLineMesh: () => (/* reexport */ GreasedLineMesh),
  GreasedLineMeshColorDistribution: () => (/* reexport */ GreasedLineMeshColorDistribution),
  GreasedLineMeshColorDistributionType: () => (/* reexport */ GreasedLineMeshColorDistributionType),
  GreasedLineMeshColorMode: () => (/* reexport */ GreasedLineMeshColorMode),
  GreasedLineMeshMaterialType: () => (/* reexport */ GreasedLineMeshMaterialType),
  GreasedLineMeshWidthDistribution: () => (/* reexport */ GreasedLineMeshWidthDistribution),
  GreasedLinePluginMaterial: () => (/* reexport */ GreasedLinePluginMaterial),
  GreasedLineRibbonAutoDirectionMode: () => (/* reexport */ GreasedLineRibbonAutoDirectionMode),
  GreasedLineRibbonFacesMode: () => (/* reexport */ GreasedLineRibbonFacesMode),
  GreasedLineRibbonMesh: () => (/* reexport */ GreasedLineRibbonMesh),
  GreasedLineRibbonPointsMode: () => (/* reexport */ GreasedLineRibbonPointsMode),
  GreasedLineSimpleMaterial: () => (/* reexport */ GreasedLineSimpleMaterial),
  GreasedLineTools: () => (/* reexport */ GreasedLineTools),
  GridBlock: () => (/* reexport */ GridBlock),
  GroundBuilder: () => (/* reexport */ groundBuilder/* GroundBuilder */.LL),
  GroundMesh: () => (/* reexport */ groundMesh/* GroundMesh */.f),
  HDRCubeTexture: () => (/* reexport */ HDRCubeTexture),
  HDRCubeTextureAssetTask: () => (/* reexport */ HDRCubeTextureAssetTask),
  HDRFiltering: () => (/* reexport */ HDRFiltering),
  HDRTools: () => (/* reexport */ hdr/* HDRTools */.I9),
  Halton2DSequence: () => (/* reexport */ Halton2DSequence),
  HandConstraintBehavior: () => (/* reexport */ handConstraintBehavior/* HandConstraintBehavior */.Re),
  HandConstraintOrientation: () => (/* reexport */ handConstraintBehavior/* HandConstraintOrientation */.d9),
  HandConstraintVisibility: () => (/* reexport */ handConstraintBehavior/* HandConstraintVisibility */.VF),
  HandConstraintZone: () => (/* reexport */ handConstraintBehavior/* HandConstraintZone */.rf),
  HandPart: () => (/* reexport */ HandPart),
  HandleFallbacksForShadows: () => (/* reexport */ materialHelper_functions/* HandleFallbacksForShadows */.c4),
  HardwareScalingOptimization: () => (/* reexport */ HardwareScalingOptimization),
  HasStencilAspect: () => (/* reexport */ Textures_internalTexture/* HasStencilAspect */.$l),
  HavokPlugin: () => (/* reexport */ HavokPlugin),
  HeightToNormalBlock: () => (/* reexport */ HeightToNormalBlock),
  HemisphereBuilder: () => (/* reexport */ HemisphereBuilder),
  HemisphericLight: () => (/* reexport */ hemisphericLight/* HemisphericLight */.g),
  HemisphericParticleEmitter: () => (/* reexport */ HemisphericParticleEmitter),
  HighlightLayer: () => (/* reexport */ HighlightLayer),
  HighlightsPostProcess: () => (/* reexport */ HighlightsPostProcess),
  Hinge2Joint: () => (/* reexport */ Hinge2Joint),
  HingeConstraint: () => (/* reexport */ HingeConstraint),
  HingeJoint: () => (/* reexport */ HingeJoint),
  HtmlElementTexture: () => (/* reexport */ HtmlElementTexture),
  HufUncompress: () => (/* reexport */ exrLoader_compression_huf/* HufUncompress */.ZR),
  IWebXRControllerPhysicsOptions: () => (/* reexport */ IWebXRControllerPhysicsOptions),
  IblShadowsRenderPipeline: () => (/* reexport */ IblShadowsRenderPipeline),
  IcoSphereBlock: () => (/* reexport */ IcoSphereBlock),
  IcoSphereBuilder: () => (/* reexport */ IcoSphereBuilder),
  ImageAssetTask: () => (/* reexport */ ImageAssetTask),
  ImageProcessingBlock: () => (/* reexport */ ImageProcessingBlock),
  ImageProcessingConfiguration: () => (/* reexport */ Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p),
  ImageProcessingPostProcess: () => (/* reexport */ ImageProcessingPostProcess),
  ImageSourceBlock: () => (/* reexport */ ImageSourceBlock),
  IncrementValueAction: () => (/* reexport */ IncrementValueAction),
  IndexFormat: () => (/* reexport */ IndexFormat),
  InitializeCSG2Async: () => (/* reexport */ InitializeCSG2Async),
  InputBlock: () => (/* reexport */ InputBlock),
  InspectableType: () => (/* reexport */ InspectableType),
  InstancedLinesMesh: () => (/* reexport */ linesMesh/* InstancedLinesMesh */.Q),
  InstancedMesh: () => (/* reexport */ instancedMesh/* InstancedMesh */.Z),
  InstancesBlock: () => (/* reexport */ InstancesBlock),
  InstantiateBlock: () => (/* reexport */ InstantiateBlock),
  InstantiateLinearBlock: () => (/* reexport */ InstantiateLinearBlock),
  InstantiateOnFacesBlock: () => (/* reexport */ InstantiateOnFacesBlock),
  InstantiateOnVerticesBlock: () => (/* reexport */ InstantiateOnVerticesBlock),
  InstantiateOnVolumeBlock: () => (/* reexport */ InstantiateOnVolumeBlock),
  InstantiateRadialBlock: () => (/* reexport */ InstantiateRadialBlock),
  InstantiatedEntries: () => (/* reexport */ assetContainer/* InstantiatedEntries */.Nx),
  IntFloatConverterBlock: () => (/* reexport */ IntFloatConverterBlock),
  InterleaveScalar: () => (/* reexport */ exrLoader_core/* InterleaveScalar */.KA),
  InternalTexture: () => (/* reexport */ Textures_internalTexture/* InternalTexture */.hV),
  InternalTextureSource: () => (/* reexport */ Textures_internalTexture/* InternalTextureSource */.GV),
  InterpolateValueAction: () => (/* reexport */ InterpolateValueAction),
  IntersectionInfo: () => (/* reexport */ intersectionInfo/* IntersectionInfo */.w),
  IsBase64DataUrl: () => (/* reexport */ fileTools/* IsBase64DataUrl */.f2),
  IsCSG2Ready: () => (/* reexport */ IsCSG2Ready),
  IsDepthTexture: () => (/* reexport */ Textures_internalTexture/* IsDepthTexture */.vl),
  IsDocumentAvailable: () => (/* reexport */ domManagement/* IsDocumentAvailable */.Nf),
  IsFileURL: () => (/* reexport */ fileTools/* IsFileURL */.my),
  IsNavigatorAvailable: () => (/* reexport */ domManagement/* IsNavigatorAvailable */.XD),
  IsWindowObjectExist: () => (/* reexport */ domManagement/* IsWindowObjectExist */.BA),
  IsWrapper: () => (/* reexport */ drawWrapper_functions/* IsWrapper */.E),
  JoystickAxis: () => (/* reexport */ JoystickAxis),
  KeepAssets: () => (/* reexport */ assetContainer/* KeepAssets */.hA),
  KeyboardEventTypes: () => (/* reexport */ keyboardEvents/* KeyboardEventTypes */.TB),
  KeyboardInfo: () => (/* reexport */ keyboardEvents/* KeyboardInfo */.W0),
  KeyboardInfoPre: () => (/* reexport */ keyboardEvents/* KeyboardInfoPre */.Bu),
  KhronosTextureContainer: () => (/* reexport */ khronosTextureContainer/* KhronosTextureContainer */.H),
  KhronosTextureContainer2: () => (/* reexport */ khronosTextureContainer2/* KhronosTextureContainer2 */.Z),
  LatheBuilder: () => (/* reexport */ LatheBuilder),
  Lattice: () => (/* reexport */ Lattice),
  LatticeBlock: () => (/* reexport */ LatticeBlock),
  LatticePluginMaterial: () => (/* reexport */ LatticePluginMaterial),
  Layer: () => (/* reexport */ Layers_layer/* Layer */.W),
  LayerSceneComponent: () => (/* reexport */ layerSceneComponent/* LayerSceneComponent */.b),
  LengthBlock: () => (/* reexport */ LengthBlock),
  LensFlare: () => (/* reexport */ LensFlare),
  LensFlareSystem: () => (/* reexport */ LensFlareSystem),
  LensFlareSystemSceneComponent: () => (/* reexport */ LensFlareSystemSceneComponent),
  LensFlaresOptimization: () => (/* reexport */ LensFlaresOptimization),
  LensRenderingPipeline: () => (/* reexport */ LensRenderingPipeline),
  LerpBlock: () => (/* reexport */ LerpBlock),
  Light: () => (/* reexport */ Lights_light/* Light */.v),
  LightBlock: () => (/* reexport */ LightBlock),
  LightGizmo: () => (/* reexport */ LightGizmo),
  LightInformationBlock: () => (/* reexport */ LightInformationBlock),
  LineEdgesRenderer: () => (/* reexport */ LineEdgesRenderer),
  LinesBuilder: () => (/* reexport */ LinesBuilder),
  LinesMesh: () => (/* reexport */ linesMesh/* LinesMesh */.l),
  LoadFile: () => (/* reexport */ fileTools/* LoadFile */.zU),
  LoadFileError: () => (/* reexport */ fileTools/* LoadFileError */.hX),
  LoadImage: () => (/* reexport */ fileTools/* LoadImage */.W$),
  LoadImageConfiguration: () => (/* reexport */ fileTools/* LoadImageConfiguration */.qc),
  LoadOp: () => (/* reexport */ LoadOp),
  LoadTextureFromTranscodeResult: () => (/* reexport */ basis/* LoadTextureFromTranscodeResult */.aB),
  LockConstraint: () => (/* reexport */ LockConstraint),
  Logger: () => (/* reexport */ logger/* Logger */.V),
  LoopBlock: () => (/* reexport */ LoopBlock),
  MapMode: () => (/* reexport */ MapMode),
  MapRangeBlock: () => (/* reexport */ MapRangeBlock),
  MappingBlock: () => (/* reexport */ MappingBlock),
  MappingTypes: () => (/* reexport */ MappingTypes),
  Material: () => (/* reexport */ Materials_material/* Material */.i),
  MaterialAnisotropicDefines: () => (/* reexport */ pbrAnisotropicConfiguration/* MaterialAnisotropicDefines */.v),
  MaterialClearCoatDefines: () => (/* reexport */ pbrClearCoatConfiguration/* MaterialClearCoatDefines */.a),
  MaterialDefines: () => (/* reexport */ materialDefines/* MaterialDefines */.M),
  MaterialDetailMapDefines: () => (/* reexport */ material_detailMapConfiguration/* MaterialDetailMapDefines */.H),
  MaterialFlags: () => (/* reexport */ materialFlags/* MaterialFlags */.h),
  MaterialGreasedLineDefines: () => (/* reexport */ MaterialGreasedLineDefines),
  MaterialHelper: () => (/* reexport */ MaterialHelper),
  MaterialHelperGeometryRendering: () => (/* reexport */ materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m),
  MaterialIridescenceDefines: () => (/* reexport */ pbrIridescenceConfiguration/* MaterialIridescenceDefines */.m),
  MaterialPluginBase: () => (/* reexport */ materialPluginBase/* MaterialPluginBase */.y),
  MaterialPluginEvent: () => (/* reexport */ MaterialPluginEvent),
  MaterialPluginManager: () => (/* reexport */ materialPluginManager/* MaterialPluginManager */.uZ),
  MaterialSheenDefines: () => (/* reexport */ pbrSheenConfiguration/* MaterialSheenDefines */.Z),
  MaterialSubSurfaceDefines: () => (/* reexport */ pbrSubSurfaceConfiguration/* MaterialSubSurfaceDefines */.p),
  MathBlock: () => (/* reexport */ MathBlock),
  MathBlockOperations: () => (/* reexport */ MathBlockOperations),
  Matrix: () => (/* reexport */ math/* Matrix */.uq),
  MatrixBuilderBlock: () => (/* reexport */ MatrixBuilderBlock),
  MatrixComposeBlock: () => (/* reexport */ MatrixComposeBlock),
  MatrixDeterminantBlock: () => (/* reexport */ MatrixDeterminantBlock),
  MatrixTransposeBlock: () => (/* reexport */ MatrixTransposeBlock),
  MaxBlock: () => (/* reexport */ MaxBlock),
  MergeGeometryBlock: () => (/* reexport */ MergeGeometryBlock),
  MergeMeshesOptimization: () => (/* reexport */ MergeMeshesOptimization),
  Mesh: () => (/* reexport */ Meshes_mesh/* Mesh */.e),
  MeshAssetTask: () => (/* reexport */ MeshAssetTask),
  MeshAttributeExistsBlock: () => (/* reexport */ MeshAttributeExistsBlock),
  MeshAttributeExistsBlockTypes: () => (/* reexport */ MeshAttributeExistsBlockTypes),
  MeshBlock: () => (/* reexport */ MeshBlock),
  MeshBuilder: () => (/* reexport */ MeshBuilder),
  MeshDebugMode: () => (/* reexport */ MeshDebugMode),
  MeshDebugPluginMaterial: () => (/* reexport */ MeshDebugPluginMaterial),
  MeshExploder: () => (/* reexport */ MeshExploder),
  MeshLODLevel: () => (/* reexport */ meshLODLevel/* MeshLODLevel */.L),
  MeshParticleEmitter: () => (/* reexport */ MeshParticleEmitter),
  MeshUVSpaceRenderer: () => (/* reexport */ MeshUVSpaceRenderer),
  MeshoptCompression: () => (/* reexport */ meshoptCompression/* MeshoptCompression */.v),
  MinBlock: () => (/* reexport */ MinBlock),
  MinMaxReducer: () => (/* reexport */ MinMaxReducer),
  MipmapFilterMode: () => (/* reexport */ MipmapFilterMode),
  MirrorTexture: () => (/* reexport */ MirrorTexture),
  ModBlock: () => (/* reexport */ ModBlock),
  ModelShape: () => (/* reexport */ ModelShape),
  MorphTarget: () => (/* reexport */ morphTarget/* MorphTarget */.M),
  MorphTargetManager: () => (/* reexport */ Morph_morphTargetManager/* MorphTargetManager */.j),
  MorphTargetsBlock: () => (/* reexport */ MorphTargetsBlock),
  MotionBlurPostProcess: () => (/* reexport */ MotionBlurPostProcess),
  MotorEnabledJoint: () => (/* reexport */ MotorEnabledJoint),
  MultiMaterial: () => (/* reexport */ Materials_multiMaterial/* MultiMaterial */.F),
  MultiObserver: () => (/* reexport */ MultiObserver),
  MultiPick: () => (/* reexport */ Culling_ray/* MultiPick */.DY),
  MultiPickWithRay: () => (/* reexport */ Culling_ray/* MultiPickWithRay */.TR),
  MultiPointerScaleBehavior: () => (/* reexport */ MultiPointerScaleBehavior),
  MultiRenderTarget: () => (/* reexport */ MultiRenderTarget),
  MultiplyBlock: () => (/* reexport */ MultiplyBlock),
  NLerpBlock: () => (/* reexport */ NLerpBlock),
  NativeDataStream: () => (/* reexport */ NativeDataStream),
  NativeEngine: () => (/* reexport */ NativeEngine),
  NativePointerInput: () => (/* reexport */ deviceEnums/* NativePointerInput */.Ze),
  NativeXRFrame: () => (/* reexport */ NativeXRFrame),
  NativeXRLayerRenderTargetTextureProvider: () => (/* reexport */ NativeXRLayerRenderTargetTextureProvider),
  NativeXRLayerWrapper: () => (/* reexport */ NativeXRLayerWrapper),
  NativeXRRenderTarget: () => (/* reexport */ NativeXRRenderTarget),
  NegateBlock: () => (/* reexport */ NegateBlock),
  Node: () => (/* reexport */ node/* Node */.b),
  NodeGeometry: () => (/* reexport */ NodeGeometry),
  NodeGeometryBlock: () => (/* reexport */ NodeGeometryBlock),
  NodeGeometryBlockConnectionPointTypes: () => (/* reexport */ NodeGeometryBlockConnectionPointTypes),
  NodeGeometryBuildState: () => (/* reexport */ NodeGeometryBuildState),
  NodeGeometryConnectionPoint: () => (/* reexport */ NodeGeometryConnectionPoint),
  NodeGeometryConnectionPointCompatibilityStates: () => (/* reexport */ NodeGeometryConnectionPointCompatibilityStates),
  NodeGeometryConnectionPointDirection: () => (/* reexport */ NodeGeometryConnectionPointDirection),
  NodeGeometryContextualSources: () => (/* reexport */ NodeGeometryContextualSources),
  NodeMaterial: () => (/* reexport */ NodeMaterial),
  NodeMaterialBlock: () => (/* reexport */ NodeMaterialBlock),
  NodeMaterialBlockConnectionPointMode: () => (/* reexport */ NodeMaterialBlockConnectionPointMode),
  NodeMaterialBlockConnectionPointTypes: () => (/* reexport */ NodeMaterialBlockConnectionPointTypes),
  NodeMaterialBlockTargets: () => (/* reexport */ NodeMaterialBlockTargets),
  NodeMaterialConnectionPoint: () => (/* reexport */ NodeMaterialConnectionPoint),
  NodeMaterialConnectionPointCompatibilityStates: () => (/* reexport */ NodeMaterialConnectionPointCompatibilityStates),
  NodeMaterialConnectionPointCustomObject: () => (/* reexport */ NodeMaterialConnectionPointCustomObject),
  NodeMaterialConnectionPointDirection: () => (/* reexport */ NodeMaterialConnectionPointDirection),
  NodeMaterialDefines: () => (/* reexport */ NodeMaterialDefines),
  NodeMaterialModes: () => (/* reexport */ NodeMaterialModes),
  NodeMaterialOptimizer: () => (/* reexport */ NodeMaterialOptimizer),
  NodeMaterialSystemValues: () => (/* reexport */ NodeMaterialSystemValues),
  NodeMaterialTeleportInBlock: () => (/* reexport */ NodeMaterialTeleportInBlock),
  NodeMaterialTeleportOutBlock: () => (/* reexport */ NodeMaterialTeleportOutBlock),
  NodeRenderGraph: () => (/* reexport */ NodeRenderGraph),
  NodeRenderGraphBlackAndWhitePostProcessBlock: () => (/* reexport */ NodeRenderGraphBlackAndWhitePostProcessBlock),
  NodeRenderGraphBlock: () => (/* reexport */ nodeRenderGraphBlock/* NodeRenderGraphBlock */.E),
  NodeRenderGraphBlockConnectionPointTypes: () => (/* reexport */ nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp),
  NodeRenderGraphBloomPostProcessBlock: () => (/* reexport */ NodeRenderGraphBloomPostProcessBlock),
  NodeRenderGraphBlurPostProcessBlock: () => (/* reexport */ NodeRenderGraphBlurPostProcessBlock),
  NodeRenderGraphBuildState: () => (/* reexport */ NodeRenderGraphBuildState),
  NodeRenderGraphCircleOfConfusionPostProcessBlock: () => (/* reexport */ NodeRenderGraphCircleOfConfusionPostProcessBlock),
  NodeRenderGraphClearBlock: () => (/* reexport */ NodeRenderGraphClearBlock),
  NodeRenderGraphConnectionPoint: () => (/* reexport */ nodeRenderGraphBlockConnectionPoint/* NodeRenderGraphConnectionPoint */.t),
  NodeRenderGraphConnectionPointCompatibilityStates: () => (/* reexport */ nodeRenderGraphTypes/* NodeRenderGraphConnectionPointCompatibilityStates */.X_),
  NodeRenderGraphConnectionPointDirection: () => (/* reexport */ nodeRenderGraphTypes/* NodeRenderGraphConnectionPointDirection */.Kc),
  NodeRenderGraphCopyTextureBlock: () => (/* reexport */ NodeRenderGraphCopyTextureBlock),
  NodeRenderGraphCullObjectsBlock: () => (/* reexport */ NodeRenderGraphCullObjectsBlock),
  NodeRenderGraphDepthOfFieldPostProcessBlock: () => (/* reexport */ NodeRenderGraphDepthOfFieldPostProcessBlock),
  NodeRenderGraphElbowBlock: () => (/* reexport */ NodeRenderGraphElbowBlock),
  NodeRenderGraphExtractHighlightsPostProcessBlock: () => (/* reexport */ NodeRenderGraphExtractHighlightsPostProcessBlock),
  NodeRenderGraphGenerateMipmapsBlock: () => (/* reexport */ NodeRenderGraphGenerateMipmapsBlock),
  NodeRenderGraphGeometryRendererBlock: () => (/* reexport */ NodeRenderGraphGeometryRendererBlock),
  NodeRenderGraphInputBlock: () => (/* reexport */ NodeRenderGraphInputBlock),
  NodeRenderGraphObjectRendererBlock: () => (/* reexport */ NodeRenderGraphObjectRendererBlock),
  NodeRenderGraphOutputBlock: () => (/* reexport */ NodeRenderGraphOutputBlock),
  NodeRenderGraphTAAObjectRendererBlock: () => (/* reexport */ NodeRenderGraphTAAObjectRendererBlock),
  NodeRenderGraphTeleportInBlock: () => (/* reexport */ NodeRenderGraphTeleportInBlock),
  NodeRenderGraphTeleportOutBlock: () => (/* reexport */ NodeRenderGraphTeleportOutBlock),
  NoiseBlock: () => (/* reexport */ NoiseBlock),
  NoiseProceduralTexture: () => (/* reexport */ NoiseProceduralTexture),
  NormalBlendBlock: () => (/* reexport */ NormalBlendBlock),
  NormalizeBlock: () => (/* reexport */ NormalizeBlock),
  NormalizeVectorBlock: () => (/* reexport */ NormalizeVectorBlock),
  NullBlock: () => (/* reexport */ NullBlock),
  NullEngine: () => (/* reexport */ NullEngine),
  NullEngineOptions: () => (/* reexport */ NullEngineOptions),
  ObjectRenderer: () => (/* reexport */ objectRenderer/* ObjectRenderer */.P),
  Observable: () => (/* reexport */ Misc_observable/* Observable */.cP),
  Observer: () => (/* reexport */ Misc_observable/* Observer */.nu),
  OcclusionMaterial: () => (/* reexport */ OcclusionMaterial),
  Octree: () => (/* reexport */ Octree),
  OctreeBlock: () => (/* reexport */ OctreeBlock),
  OctreeSceneComponent: () => (/* reexport */ OctreeSceneComponent),
  OimoJSPlugin: () => (/* reexport */ OimoJSPlugin),
  OnAfterEnteringVRObservableEvent: () => (/* reexport */ OnAfterEnteringVRObservableEvent),
  OneMinusBlock: () => (/* reexport */ OneMinusBlock),
  Orientation: () => (/* reexport */ math/* Orientation */.t4),
  OutlineRenderer: () => (/* reexport */ OutlineRenderer),
  PBRAnisotropicConfiguration: () => (/* reexport */ pbrAnisotropicConfiguration/* PBRAnisotropicConfiguration */.i),
  PBRBaseMaterial: () => (/* reexport */ pbrBaseMaterial/* PBRBaseMaterial */.d),
  PBRBaseSimpleMaterial: () => (/* reexport */ PBRBaseSimpleMaterial),
  PBRClearCoatConfiguration: () => (/* reexport */ pbrClearCoatConfiguration/* PBRClearCoatConfiguration */.t),
  PBRIridescenceConfiguration: () => (/* reexport */ pbrIridescenceConfiguration/* PBRIridescenceConfiguration */.z),
  PBRMaterial: () => (/* reexport */ pbrMaterial/* PBRMaterial */.Y),
  PBRMaterialDefines: () => (/* reexport */ pbrBaseMaterial/* PBRMaterialDefines */.g),
  PBRMetallicRoughnessBlock: () => (/* reexport */ PBRMetallicRoughnessBlock),
  PBRMetallicRoughnessMaterial: () => (/* reexport */ PBRMetallicRoughnessMaterial),
  PBRSheenConfiguration: () => (/* reexport */ pbrSheenConfiguration/* PBRSheenConfiguration */.C),
  PBRSpecularGlossinessMaterial: () => (/* reexport */ PBRSpecularGlossinessMaterial),
  PBRSubSurfaceConfiguration: () => (/* reexport */ pbrSubSurfaceConfiguration/* PBRSubSurfaceConfiguration */.I),
  PHI: () => (/* reexport */ math/* PHI */.a6),
  PadNumber: () => (/* reexport */ stringTools/* PadNumber */.LW),
  PanoramaToCubeMapTools: () => (/* reexport */ panoramaToCubemap/* PanoramaToCubeMapTools */.D),
  Parse: () => (/* reexport */ babylonFileParser_function/* Parse */.oj),
  ParseFloat16: () => (/* reexport */ exrLoader_core/* ParseFloat16 */.LD),
  ParseFloat32: () => (/* reexport */ exrLoader_core/* ParseFloat32 */.Ff),
  ParseInt32: () => (/* reexport */ exrLoader_core/* ParseInt32 */.cL),
  ParseInt64: () => (/* reexport */ exrLoader_core/* ParseInt64 */.tB),
  ParseNullTerminatedString: () => (/* reexport */ exrLoader_core/* ParseNullTerminatedString */.T$),
  ParseUint16: () => (/* reexport */ exrLoader_core/* ParseUint16 */.Jn),
  ParseUint32: () => (/* reexport */ exrLoader_core/* ParseUint32 */.PX),
  ParseUint8: () => (/* reexport */ exrLoader_core/* ParseUint8 */._S),
  ParseUint8Array: () => (/* reexport */ exrLoader_core/* ParseUint8Array */.fz),
  ParseValue: () => (/* reexport */ exrLoader_core/* ParseValue */.zX),
  Particle: () => (/* reexport */ Particle),
  ParticleBlendMultiplyBlock: () => (/* reexport */ ParticleBlendMultiplyBlock),
  ParticleHelper: () => (/* reexport */ ParticleHelper),
  ParticleRampGradientBlock: () => (/* reexport */ ParticleRampGradientBlock),
  ParticleSystem: () => (/* reexport */ ParticleSystem),
  ParticleSystemSet: () => (/* reexport */ ParticleSystemSet),
  ParticleTextureBlock: () => (/* reexport */ ParticleTextureBlock),
  ParticlesOptimization: () => (/* reexport */ ParticlesOptimization),
  PassCubePostProcess: () => (/* reexport */ passPostProcess/* PassCubePostProcess */.s),
  PassPostProcess: () => (/* reexport */ passPostProcess/* PassPostProcess */.v),
  Path2: () => (/* reexport */ math/* Path2 */.Cu),
  Path3D: () => (/* reexport */ math/* Path3D */.tO),
  PathCursor: () => (/* reexport */ PathCursor),
  PerfCollectionStrategy: () => (/* reexport */ PerfCollectionStrategy),
  PerfCounter: () => (/* reexport */ perfCounter/* PerfCounter */.A),
  PerformanceConfigurator: () => (/* reexport */ performanceConfigurator/* PerformanceConfigurator */.I),
  PerformanceMonitor: () => (/* reexport */ performanceMonitor/* PerformanceMonitor */.r),
  PerformanceViewerCollector: () => (/* reexport */ PerformanceViewerCollector),
  PerturbNormalBlock: () => (/* reexport */ PerturbNormalBlock),
  PhotoDome: () => (/* reexport */ PhotoDome),
  Physics6DoFConstraint: () => (/* reexport */ Physics6DoFConstraint),
  Physics6DoFLimit: () => (/* reexport */ Physics6DoFLimit),
  PhysicsActivationControl: () => (/* reexport */ PhysicsActivationControl),
  PhysicsAggregate: () => (/* reexport */ PhysicsAggregate),
  PhysicsBody: () => (/* reexport */ PhysicsBody),
  PhysicsConstraint: () => (/* reexport */ PhysicsConstraint),
  PhysicsConstraintAxis: () => (/* reexport */ PhysicsConstraintAxis),
  PhysicsConstraintAxisLimitMode: () => (/* reexport */ PhysicsConstraintAxisLimitMode),
  PhysicsConstraintMotorType: () => (/* reexport */ PhysicsConstraintMotorType),
  PhysicsConstraintType: () => (/* reexport */ PhysicsConstraintType),
  PhysicsEngine: () => (/* reexport */ PhysicsEngine),
  PhysicsEngineV2: () => (/* reexport */ physicsEngine_PhysicsEngine),
  PhysicsEventType: () => (/* reexport */ PhysicsEventType),
  PhysicsHelper: () => (/* reexport */ PhysicsHelper),
  PhysicsImpostor: () => (/* reexport */ PhysicsImpostor),
  PhysicsJoint: () => (/* reexport */ PhysicsJoint),
  PhysicsMaterialCombineMode: () => (/* reexport */ PhysicsMaterialCombineMode),
  PhysicsMotionType: () => (/* reexport */ PhysicsMotionType),
  PhysicsPrestepType: () => (/* reexport */ PhysicsPrestepType),
  PhysicsRadialExplosionEventOptions: () => (/* reexport */ PhysicsRadialExplosionEventOptions),
  PhysicsRadialImpulseFalloff: () => (/* reexport */ PhysicsRadialImpulseFalloff),
  PhysicsRaycastResult: () => (/* reexport */ PhysicsRaycastResult),
  PhysicsShape: () => (/* reexport */ PhysicsShape),
  PhysicsShapeBox: () => (/* reexport */ PhysicsShapeBox),
  PhysicsShapeCapsule: () => (/* reexport */ PhysicsShapeCapsule),
  PhysicsShapeContainer: () => (/* reexport */ PhysicsShapeContainer),
  PhysicsShapeConvexHull: () => (/* reexport */ PhysicsShapeConvexHull),
  PhysicsShapeCylinder: () => (/* reexport */ PhysicsShapeCylinder),
  PhysicsShapeGroundMesh: () => (/* reexport */ PhysicsShapeGroundMesh),
  PhysicsShapeHeightField: () => (/* reexport */ PhysicsShapeHeightField),
  PhysicsShapeMesh: () => (/* reexport */ PhysicsShapeMesh),
  PhysicsShapeSphere: () => (/* reexport */ PhysicsShapeSphere),
  PhysicsShapeType: () => (/* reexport */ PhysicsShapeType),
  PhysicsUpdraftEventOptions: () => (/* reexport */ PhysicsUpdraftEventOptions),
  PhysicsUpdraftMode: () => (/* reexport */ PhysicsUpdraftMode),
  PhysicsViewer: () => (/* reexport */ PhysicsViewer),
  PhysicsVortexEventOptions: () => (/* reexport */ PhysicsVortexEventOptions),
  Pick: () => (/* reexport */ Culling_ray/* Pick */.mc),
  PickWithBoundingInfo: () => (/* reexport */ Culling_ray/* PickWithBoundingInfo */.uW),
  PickWithRay: () => (/* reexport */ Culling_ray/* PickWithRay */.S),
  PickingCustomization: () => (/* reexport */ Culling_ray/* PickingCustomization */.R0),
  PickingInfo: () => (/* reexport */ Collisions_pickingInfo/* PickingInfo */.G),
  PipelineErrorReason: () => (/* reexport */ PipelineErrorReason),
  PivotTools: () => (/* reexport */ pivotTools/* PivotTools */.G),
  Plane: () => (/* reexport */ math/* Plane */.Zc),
  PlaneBlock: () => (/* reexport */ PlaneBlock),
  PlaneBuilder: () => (/* reexport */ planeBuilder/* PlaneBuilder */.QX),
  PlaneDragGizmo: () => (/* reexport */ PlaneDragGizmo),
  PlaneRotationGizmo: () => (/* reexport */ PlaneRotationGizmo),
  PlayAnimationAction: () => (/* reexport */ PlayAnimationAction),
  PlaySoundAction: () => (/* reexport */ PlaySoundAction),
  PointColor: () => (/* reexport */ pointsCloudSystem/* PointColor */.q),
  PointLight: () => (/* reexport */ pointLight/* PointLight */.H),
  PointParticleEmitter: () => (/* reexport */ PointParticleEmitter),
  PointerDragBehavior: () => (/* reexport */ pointerDragBehavior/* PointerDragBehavior */.C),
  PointerEventTypes: () => (/* reexport */ pointerEvents/* PointerEventTypes */.Zp),
  PointerInfo: () => (/* reexport */ pointerEvents/* PointerInfo */.mx),
  PointerInfoBase: () => (/* reexport */ pointerEvents/* PointerInfoBase */.Vn),
  PointerInfoPre: () => (/* reexport */ pointerEvents/* PointerInfoPre */.tT),
  PointerInput: () => (/* reexport */ deviceEnums/* PointerInput */.ST),
  PointsCloudSystem: () => (/* reexport */ pointsCloudSystem/* PointsCloudSystem */.y),
  PointsGroup: () => (/* reexport */ cloudPoint/* PointsGroup */.x),
  Polar: () => (/* reexport */ Polar),
  Polygon: () => (/* reexport */ Polygon),
  PolygonBuilder: () => (/* reexport */ PolygonBuilder),
  PolygonMeshBuilder: () => (/* reexport */ PolygonMeshBuilder),
  PolyhedronBuilder: () => (/* reexport */ PolyhedronBuilder),
  PolyhedronData: () => (/* reexport */ PolyhedronData),
  PositionGizmo: () => (/* reexport */ PositionGizmo),
  PositionNormalTextureVertex: () => (/* reexport */ math/* PositionNormalTextureVertex */.k0),
  PositionNormalVertex: () => (/* reexport */ math/* PositionNormalVertex */.B5),
  PostProcess: () => (/* reexport */ PostProcesses_postProcess/* PostProcess */.w),
  PostProcessManager: () => (/* reexport */ postProcessManager/* PostProcessManager */.X),
  PostProcessRenderEffect: () => (/* reexport */ PostProcessRenderEffect),
  PostProcessRenderPipeline: () => (/* reexport */ PostProcessRenderPipeline),
  PostProcessRenderPipelineManager: () => (/* reexport */ PostProcessRenderPipelineManager),
  PostProcessRenderPipelineManagerSceneComponent: () => (/* reexport */ PostProcessRenderPipelineManagerSceneComponent),
  PostProcessesOptimization: () => (/* reexport */ PostProcessesOptimization),
  PosterizeBlock: () => (/* reexport */ PosterizeBlock),
  PowBlock: () => (/* reexport */ PowBlock),
  PowerEase: () => (/* reexport */ PowerEase),
  PowerPreference: () => (/* reexport */ PowerPreference),
  PrePassOutputBlock: () => (/* reexport */ PrePassOutputBlock),
  PrePassRenderer: () => (/* reexport */ PrePassRenderer),
  PrePassRendererSceneComponent: () => (/* reexport */ PrePassRendererSceneComponent),
  PrePassTextureBlock: () => (/* reexport */ PrePassTextureBlock),
  PrecisionDate: () => (/* reexport */ precisionDate/* PrecisionDate */.j),
  PredicateCondition: () => (/* reexport */ PredicateCondition),
  Predictor: () => (/* reexport */ exrLoader_core/* Predictor */.XE),
  PrepareAttributesForBakedVertexAnimation: () => (/* reexport */ materialHelper_functions/* PrepareAttributesForBakedVertexAnimation */.J2),
  PrepareAttributesForBones: () => (/* reexport */ materialHelper_functions/* PrepareAttributesForBones */.ni),
  PrepareAttributesForInstances: () => (/* reexport */ materialHelper_functions/* PrepareAttributesForInstances */.ER),
  PrepareAttributesForMorphTargets: () => (/* reexport */ materialHelper_functions/* PrepareAttributesForMorphTargets */.IF),
  PrepareAttributesForMorphTargetsInfluencers: () => (/* reexport */ materialHelper_functions/* PrepareAttributesForMorphTargetsInfluencers */.MF),
  PrepareDefinesForAttributes: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForAttributes */.qB),
  PrepareDefinesForBakedVertexAnimation: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForBakedVertexAnimation */.wu),
  PrepareDefinesForBones: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForBones */.IC),
  PrepareDefinesForCamera: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForCamera */.Y7),
  PrepareDefinesForFrameBoundValues: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForFrameBoundValues */.OR),
  PrepareDefinesForLight: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForLight */.lo),
  PrepareDefinesForLights: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForLights */.az),
  PrepareDefinesForMergedUV: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForMergedUV */.YT),
  PrepareDefinesForMisc: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForMisc */.fm),
  PrepareDefinesForMorphTargets: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForMorphTargets */.Jz),
  PrepareDefinesForMultiview: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForMultiview */.VO),
  PrepareDefinesForOIT: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForOIT */.Nc),
  PrepareDefinesForPrePass: () => (/* reexport */ materialHelper_functions/* PrepareDefinesForPrePass */.N4),
  PrepareUniformsAndSamplersForLight: () => (/* reexport */ materialHelper_functions/* PrepareUniformsAndSamplersForLight */.GD),
  PrepareUniformsAndSamplersList: () => (/* reexport */ materialHelper_functions/* PrepareUniformsAndSamplersList */.Bb),
  PressureObserverWrapper: () => (/* reexport */ PressureObserverWrapper),
  PrimitiveTopology: () => (/* reexport */ PrimitiveTopology),
  PrismaticConstraint: () => (/* reexport */ PrismaticConstraint),
  ProceduralTexture: () => (/* reexport */ ProceduralTexture),
  ProceduralTextureSceneComponent: () => (/* reexport */ ProceduralTextureSceneComponent),
  PropertyTypeForEdition: () => (/* reexport */ PropertyTypeForEdition),
  ProximityCastResult: () => (/* reexport */ ProximityCastResult),
  PushAttributesForInstances: () => (/* reexport */ materialHelper_functions/* PushAttributesForInstances */.te),
  PushMaterial: () => (/* reexport */ pushMaterial/* PushMaterial */.E),
  QuadraticEase: () => (/* reexport */ QuadraticEase),
  QuadraticErrorSimplification: () => (/* reexport */ QuadraticErrorSimplification),
  QuarticEase: () => (/* reexport */ QuarticEase),
  Quaternion: () => (/* reexport */ math/* Quaternion */.PT),
  QueryType: () => (/* reexport */ QueryType),
  QueueNewFrame: () => (/* reexport */ abstractEngine/* QueueNewFrame */.r),
  QuinticEase: () => (/* reexport */ QuinticEase),
  RGBDTextureTools: () => (/* reexport */ rgbdTextureTools/* RGBDTextureTools */.G),
  RSMCreatePluginMaterial: () => (/* reexport */ RSMCreatePluginMaterial),
  Ragdoll: () => (/* reexport */ Ragdoll),
  RagdollBoneProperties: () => (/* reexport */ RagdollBoneProperties),
  RandomBlock: () => (/* reexport */ RandomBlock),
  RandomBlockLocks: () => (/* reexport */ RandomBlockLocks),
  RandomGUID: () => (/* reexport */ guid/* RandomGUID */.z),
  RandomNumberBlock: () => (/* reexport */ RandomNumberBlock),
  RawCubeTexture: () => (/* reexport */ rawCubeTexture/* RawCubeTexture */.p),
  RawTexture: () => (/* reexport */ rawTexture/* RawTexture */.I),
  RawTexture2DArray: () => (/* reexport */ rawTexture2DArray/* RawTexture2DArray */.L),
  RawTexture3D: () => (/* reexport */ RawTexture3D),
  Ray: () => (/* reexport */ Culling_ray/* Ray */.Rl),
  RayHelper: () => (/* reexport */ RayHelper),
  ReadFile: () => (/* reexport */ fileTools/* ReadFile */.NJ),
  ReadFileError: () => (/* reexport */ fileTools/* ReadFileError */.VB),
  RecastJSCrowd: () => (/* reexport */ RecastJSCrowd),
  RecastJSPlugin: () => (/* reexport */ RecastJSPlugin),
  ReciprocalBlock: () => (/* reexport */ ReciprocalBlock),
  ReflectBlock: () => (/* reexport */ ReflectBlock),
  ReflectionBlock: () => (/* reexport */ ReflectionBlock),
  ReflectionProbe: () => (/* reexport */ ReflectionProbe),
  ReflectionTextureBaseBlock: () => (/* reexport */ ReflectionTextureBaseBlock),
  ReflectionTextureBlock: () => (/* reexport */ ReflectionTextureBlock),
  ReflectiveShadowMap: () => (/* reexport */ ReflectiveShadowMap),
  Reflector: () => (/* reexport */ Reflector),
  RefractBlock: () => (/* reexport */ RefractBlock),
  RefractionBlock: () => (/* reexport */ RefractionBlock),
  RefractionPostProcess: () => (/* reexport */ RefractionPostProcess),
  RefractionTexture: () => (/* reexport */ RefractionTexture),
  RegisterClass: () => (/* reexport */ typeStore/* RegisterClass */.Y5),
  RegisterMaterialPlugin: () => (/* reexport */ materialPluginManager/* RegisterMaterialPlugin */.YC),
  RegisterNativeTypeAsync: () => (/* reexport */ RegisterNativeTypeAsync),
  RegisterTargetForLateAnimationBinding: () => (/* reexport */ animatable/* RegisterTargetForLateAnimationBinding */.BT),
  RemapBlock: () => (/* reexport */ RemapBlock),
  RenderPassTimestampLocation: () => (/* reexport */ RenderPassTimestampLocation),
  RenderTargetTexture: () => (/* reexport */ Textures_renderTargetTexture/* RenderTargetTexture */.$),
  RenderTargetWrapper: () => (/* reexport */ renderTargetWrapper/* RenderTargetWrapper */.v),
  RenderTargetsOptimization: () => (/* reexport */ RenderTargetsOptimization),
  RenderingGroup: () => (/* reexport */ renderingGroup/* RenderingGroup */.U),
  RenderingGroupInfo: () => (/* reexport */ renderingManager/* RenderingGroupInfo */.o),
  RenderingManager: () => (/* reexport */ renderingManager/* RenderingManager */.m),
  ReplaceColorBlock: () => (/* reexport */ ReplaceColorBlock),
  RequestFile: () => (/* reexport */ fileTools/* RequestFile */.sh),
  RequestFileError: () => (/* reexport */ fileTools/* RequestFileError */.Mi),
  RequestFullscreen: () => (/* reexport */ engine_common/* RequestFullscreen */.tl),
  RequestPointerlock: () => (/* reexport */ engine_common/* RequestPointerlock */.eG),
  ResizeImageBitmap: () => (/* reexport */ engine_common/* ResizeImageBitmap */.jf),
  RetryStrategy: () => (/* reexport */ retryStrategy/* RetryStrategy */.a),
  ReverseLutFromBitmap: () => (/* reexport */ exrLoader_compression_huf/* ReverseLutFromBitmap */.FG),
  RibbonBuilder: () => (/* reexport */ RibbonBuilder),
  RichType: () => (/* reexport */ flowGraphRichTypes/* RichType */.D),
  RichTypeAny: () => (/* reexport */ flowGraphRichTypes/* RichTypeAny */.Vv),
  RichTypeBoolean: () => (/* reexport */ flowGraphRichTypes/* RichTypeBoolean */.RI),
  RichTypeColor3: () => (/* reexport */ flowGraphRichTypes/* RichTypeColor3 */.Nf),
  RichTypeColor4: () => (/* reexport */ flowGraphRichTypes/* RichTypeColor4 */.Gx),
  RichTypeFlowGraphInteger: () => (/* reexport */ flowGraphRichTypes/* RichTypeFlowGraphInteger */.x2),
  RichTypeMatrix: () => (/* reexport */ flowGraphRichTypes/* RichTypeMatrix */.Sp),
  RichTypeNumber: () => (/* reexport */ flowGraphRichTypes/* RichTypeNumber */.Es),
  RichTypeQuaternion: () => (/* reexport */ flowGraphRichTypes/* RichTypeQuaternion */.P_),
  RichTypeString: () => (/* reexport */ flowGraphRichTypes/* RichTypeString */.KV),
  RichTypeVector2: () => (/* reexport */ flowGraphRichTypes/* RichTypeVector2 */.K$),
  RichTypeVector3: () => (/* reexport */ flowGraphRichTypes/* RichTypeVector3 */.Dx),
  RichTypeVector4: () => (/* reexport */ flowGraphRichTypes/* RichTypeVector4 */.Ko),
  RollingAverage: () => (/* reexport */ performanceMonitor/* RollingAverage */.K),
  Rotate2dBlock: () => (/* reexport */ Rotate2dBlock),
  RotationGizmo: () => (/* reexport */ RotationGizmo),
  RotationXBlock: () => (/* reexport */ RotationXBlock),
  RotationYBlock: () => (/* reexport */ RotationYBlock),
  RotationZBlock: () => (/* reexport */ RotationZBlock),
  RuntimeAnimation: () => (/* reexport */ runtimeAnimation/* RuntimeAnimation */.x),
  RuntimeError: () => (/* reexport */ error/* RuntimeError */.bu),
  SSAO2RenderingPipeline: () => (/* reexport */ SSAO2RenderingPipeline),
  SSAORenderingPipeline: () => (/* reexport */ SSAORenderingPipeline),
  SSRRenderingPipeline: () => (/* reexport */ SSRRenderingPipeline),
  SamplerBindingType: () => (/* reexport */ SamplerBindingType),
  Scalar: () => (/* reexport */ math_scalar/* Scalar */.X),
  ScaleBlock: () => (/* reexport */ ScaleBlock),
  ScaleGizmo: () => (/* reexport */ ScaleGizmo),
  ScalingBlock: () => (/* reexport */ ScalingBlock),
  ScanData: () => (/* reexport */ exrLoader_decoder/* ScanData */.u),
  Scene: () => (/* reexport */ core_scene/* Scene */.Z),
  SceneComponentConstants: () => (/* reexport */ sceneComponent/* SceneComponentConstants */.v),
  SceneDepthBlock: () => (/* reexport */ SceneDepthBlock),
  SceneInstrumentation: () => (/* reexport */ SceneInstrumentation),
  SceneLoader: () => (/* reexport */ sceneLoader/* SceneLoader */.cn),
  SceneLoaderAnimationGroupLoadingMode: () => (/* reexport */ sceneLoader/* SceneLoaderAnimationGroupLoadingMode */.gD),
  SceneLoaderFlags: () => (/* reexport */ sceneLoaderFlags/* SceneLoaderFlags */.B),
  SceneOptimization: () => (/* reexport */ SceneOptimization),
  SceneOptimizer: () => (/* reexport */ SceneOptimizer),
  SceneOptimizerOptions: () => (/* reexport */ SceneOptimizerOptions),
  ScenePerformancePriority: () => (/* reexport */ core_scene/* ScenePerformancePriority */.F),
  SceneRecorder: () => (/* reexport */ SceneRecorder),
  SceneSerializer: () => (/* reexport */ SceneSerializer),
  ScreenSizeBlock: () => (/* reexport */ ScreenSizeBlock),
  ScreenSpaceBlock: () => (/* reexport */ ScreenSpaceBlock),
  ScreenSpaceCurvaturePostProcess: () => (/* reexport */ ScreenSpaceCurvaturePostProcess),
  ScreenSpaceReflectionPostProcess: () => (/* reexport */ ScreenSpaceReflectionPostProcess),
  ScreenshotTools: () => (/* reexport */ ScreenshotTools),
  SerializationHelper: () => (/* reexport */ decorators_serialization/* SerializationHelper */.p),
  SetBasisTranscoderWorker: () => (/* reexport */ basis/* SetBasisTranscoderWorker */.af),
  SetColorsBlock: () => (/* reexport */ SetColorsBlock),
  SetCorsBehavior: () => (/* reexport */ fileTools/* SetCorsBehavior */.M1),
  SetMaterialIDBlock: () => (/* reexport */ SetMaterialIDBlock),
  SetNormalsBlock: () => (/* reexport */ SetNormalsBlock),
  SetParentAction: () => (/* reexport */ SetParentAction),
  SetPositionsBlock: () => (/* reexport */ SetPositionsBlock),
  SetStateAction: () => (/* reexport */ SetStateAction),
  SetTangentsBlock: () => (/* reexport */ SetTangentsBlock),
  SetToDefaultGaussianSplatting: () => (/* reexport */ SetToDefaultGaussianSplatting),
  SetUVsBlock: () => (/* reexport */ SetUVsBlock),
  SetValueAction: () => (/* reexport */ SetValueAction),
  ShaderCodeInliner: () => (/* reexport */ shaderCodeInliner/* ShaderCodeInliner */.Y),
  ShaderLanguage: () => (/* reexport */ ShaderLanguage),
  ShaderMaterial: () => (/* reexport */ shaderMaterial/* ShaderMaterial */.B),
  ShaderStage: () => (/* reexport */ ShaderStage),
  ShaderStore: () => (/* reexport */ shaderStore/* ShaderStore */.l),
  ShadowDepthWrapper: () => (/* reexport */ ShadowDepthWrapper),
  ShadowGenerator: () => (/* reexport */ ShadowGenerator),
  ShadowGeneratorSceneComponent: () => (/* reexport */ ShadowGeneratorSceneComponent),
  ShadowLight: () => (/* reexport */ shadowLight/* ShadowLight */.p),
  ShadowMapBlock: () => (/* reexport */ ShadowMapBlock),
  ShadowsOptimization: () => (/* reexport */ ShadowsOptimization),
  ShapeBuilder: () => (/* reexport */ ShapeBuilder),
  ShapeCastResult: () => (/* reexport */ ShapeCastResult),
  SharpenPostProcess: () => (/* reexport */ SharpenPostProcess),
  SheenBlock: () => (/* reexport */ SheenBlock),
  SimplexPerlin3DBlock: () => (/* reexport */ SimplexPerlin3DBlock),
  SimplicationQueueSceneComponent: () => (/* reexport */ SimplicationQueueSceneComponent),
  SimplificationQueue: () => (/* reexport */ SimplificationQueue),
  SimplificationSettings: () => (/* reexport */ SimplificationSettings),
  SimplificationType: () => (/* reexport */ SimplificationType),
  SineEase: () => (/* reexport */ SineEase),
  SixDofDragBehavior: () => (/* reexport */ sixDofDragBehavior/* SixDofDragBehavior */.Y),
  Size: () => (/* reexport */ math/* Size */.or),
  Skeleton: () => (/* reexport */ Bones_skeleton/* Skeleton */.E),
  SkeletonViewer: () => (/* reexport */ SkeletonViewer),
  SliderConstraint: () => (/* reexport */ SliderConstraint),
  SmartArray: () => (/* reexport */ smartArray/* SmartArray */.L),
  SmartArrayNoDuplicate: () => (/* reexport */ smartArray/* SmartArrayNoDuplicate */.b),
  SmoothStepBlock: () => (/* reexport */ SmoothStepBlock),
  SnapshotRenderingHelper: () => (/* reexport */ SnapshotRenderingHelper),
  SolidParticle: () => (/* reexport */ SolidParticle),
  SolidParticleSystem: () => (/* reexport */ SolidParticleSystem),
  SolidParticleVertex: () => (/* reexport */ SolidParticleVertex),
  Sound: () => (/* reexport */ sound/* Sound */.A),
  SoundTrack: () => (/* reexport */ soundTrack/* SoundTrack */.j),
  SourceTextureFormat: () => (/* reexport */ ktx2decoderTypes/* SourceTextureFormat */.Ok),
  Space: () => (/* reexport */ math/* Space */.$x),
  SphereBlock: () => (/* reexport */ SphereBlock),
  SphereBuilder: () => (/* reexport */ SphereBuilder),
  SphereDirectedParticleEmitter: () => (/* reexport */ SphereDirectedParticleEmitter),
  SphereParticleEmitter: () => (/* reexport */ SphereParticleEmitter),
  Spherical: () => (/* reexport */ Spherical),
  SphericalHarmonics: () => (/* reexport */ sphericalPolynomial/* SphericalHarmonics */.O),
  SphericalPolynomial: () => (/* reexport */ sphericalPolynomial/* SphericalPolynomial */.Q),
  SplatReaderBlock: () => (/* reexport */ SplatReaderBlock),
  SpotLight: () => (/* reexport */ spotLight/* SpotLight */.n),
  SpringConstraint: () => (/* reexport */ SpringConstraint),
  Sprite: () => (/* reexport */ Sprite),
  SpriteManager: () => (/* reexport */ SpriteManager),
  SpriteMap: () => (/* reexport */ SpriteMap),
  SpriteMapFrameRotationDirection: () => (/* reexport */ SpriteMapFrameRotationDirection),
  SpritePackedManager: () => (/* reexport */ SpritePackedManager),
  SpriteSceneComponent: () => (/* reexport */ SpriteSceneComponent),
  Stage: () => (/* reexport */ sceneComponent/* Stage */.B),
  StandardMaterial: () => (/* reexport */ standardMaterial/* StandardMaterial */.F),
  StandardMaterialDefines: () => (/* reexport */ standardMaterial/* StandardMaterialDefines */.f),
  StandardRenderingPipeline: () => (/* reexport */ StandardRenderingPipeline),
  StartsWith: () => (/* reexport */ stringTools/* StartsWith */.UH),
  StateCondition: () => (/* reexport */ StateCondition),
  StencilOperation: () => (/* reexport */ StencilOperation),
  StencilState: () => (/* reexport */ stencilState/* StencilState */.K),
  StencilStateComposer: () => (/* reexport */ stencilStateComposer/* StencilStateComposer */.u),
  StepBlock: () => (/* reexport */ StepBlock),
  StereoscopicArcRotateCamera: () => (/* reexport */ StereoscopicArcRotateCamera),
  StereoscopicFreeCamera: () => (/* reexport */ StereoscopicFreeCamera),
  StereoscopicGamepadCamera: () => (/* reexport */ StereoscopicGamepadCamera),
  StereoscopicInterlacePostProcess: () => (/* reexport */ StereoscopicInterlacePostProcess),
  StereoscopicInterlacePostProcessI: () => (/* reexport */ StereoscopicInterlacePostProcessI),
  StereoscopicScreenUniversalCamera: () => (/* reexport */ StereoscopicScreenUniversalCamera),
  StereoscopicUniversalCamera: () => (/* reexport */ StereoscopicUniversalCamera),
  StickValues: () => (/* reexport */ StickValues),
  StopAnimationAction: () => (/* reexport */ StopAnimationAction),
  StopSoundAction: () => (/* reexport */ StopSoundAction),
  StorageBuffer: () => (/* reexport */ storageBuffer/* StorageBuffer */.K),
  StorageReadBlock: () => (/* reexport */ StorageReadBlock),
  StorageTextureAccess: () => (/* reexport */ StorageTextureAccess),
  StorageWriteBlock: () => (/* reexport */ StorageWriteBlock),
  StoreOp: () => (/* reexport */ StoreOp),
  StringDictionary: () => (/* reexport */ stringDictionary/* StringDictionary */.w),
  StringTools: () => (/* reexport */ stringTools/* StringTools */.nQ),
  SubEmitter: () => (/* reexport */ SubEmitter),
  SubEmitterType: () => (/* reexport */ SubEmitterType),
  SubMesh: () => (/* reexport */ subMesh/* SubMesh */.K),
  SubSurfaceBlock: () => (/* reexport */ SubSurfaceBlock),
  SubSurfaceSceneComponent: () => (/* reexport */ SubSurfaceSceneComponent),
  SubtractBlock: () => (/* reexport */ SubtractBlock),
  SurfaceMagnetismBehavior: () => (/* reexport */ surfaceMagnetismBehavior/* SurfaceMagnetismBehavior */.B),
  SwitchBooleanAction: () => (/* reexport */ SwitchBooleanAction),
  SwitchInput: () => (/* reexport */ deviceEnums/* SwitchInput */.dR),
  TAARenderingPipeline: () => (/* reexport */ TAARenderingPipeline),
  TBNBlock: () => (/* reexport */ TBNBlock),
  TGATools: () => (/* reexport */ tga/* TGATools */.uT),
  Tags: () => (/* reexport */ tags/* Tags */.Y),
  TargetCamera: () => (/* reexport */ targetCamera/* TargetCamera */.F),
  TargetedAnimation: () => (/* reexport */ Animations_animationGroup.TargetedAnimation),
  TeleportInBlock: () => (/* reexport */ TeleportInBlock),
  TeleportOutBlock: () => (/* reexport */ TeleportOutBlock),
  TestBase64DataUrl: () => (/* reexport */ fileTools/* TestBase64DataUrl */.ZP),
  TextFileAssetTask: () => (/* reexport */ TextFileAssetTask),
  Texture: () => (/* reexport */ Textures_texture/* Texture */.g),
  TextureAspect: () => (/* reexport */ TextureAspect),
  TextureAssetTask: () => (/* reexport */ TextureAssetTask),
  TextureBlock: () => (/* reexport */ TextureBlock),
  TextureDimension: () => (/* reexport */ TextureDimension),
  TextureFormat: () => (/* reexport */ TextureFormat),
  TextureOptimization: () => (/* reexport */ TextureOptimization),
  TexturePacker: () => (/* reexport */ TexturePacker),
  TexturePackerFrame: () => (/* reexport */ TexturePackerFrame),
  TextureSampleType: () => (/* reexport */ TextureSampleType),
  TextureSampler: () => (/* reexport */ textureSampler/* TextureSampler */.u),
  TextureTools: () => (/* reexport */ textureTools/* TextureTools */.LO),
  TextureUsage: () => (/* reexport */ TextureUsage),
  TextureViewDimension: () => (/* reexport */ TextureViewDimension),
  ThinBlackAndWhitePostProcess: () => (/* reexport */ ThinBlackAndWhitePostProcess),
  ThinBloomEffect: () => (/* reexport */ ThinBloomEffect),
  ThinBlurPostProcess: () => (/* reexport */ ThinBlurPostProcess),
  ThinCircleOfConfusionPostProcess: () => (/* reexport */ ThinCircleOfConfusionPostProcess),
  ThinDepthOfFieldEffect: () => (/* reexport */ ThinDepthOfFieldEffect),
  ThinDepthOfFieldEffectBlurLevel: () => (/* reexport */ ThinDepthOfFieldEffectBlurLevel),
  ThinEngine: () => (/* reexport */ thinEngine.ThinEngine),
  ThinExtractHighlightsPostProcess: () => (/* reexport */ ThinExtractHighlightsPostProcess),
  ThinRenderTargetTexture: () => (/* reexport */ ThinRenderTargetTexture),
  ThinTexture: () => (/* reexport */ thinTexture/* ThinTexture */.D),
  TiledBoxBuilder: () => (/* reexport */ TiledBoxBuilder),
  TiledPlaneBuilder: () => (/* reexport */ TiledPlaneBuilder),
  TimerState: () => (/* reexport */ timer/* TimerState */.R$),
  TmpColors: () => (/* reexport */ math/* TmpColors */.IG),
  TmpVectors: () => (/* reexport */ math/* TmpVectors */.AA),
  ToGammaSpace: () => (/* reexport */ math/* ToGammaSpace */.rv),
  ToHalfFloat: () => (/* reexport */ textureTools/* ToHalfFloat */.LZ),
  ToLinearSpace: () => (/* reexport */ math/* ToLinearSpace */.tk),
  TonemapPostProcess: () => (/* reexport */ TonemapPostProcess),
  TonemappingOperator: () => (/* reexport */ TonemappingOperator),
  Tools: () => (/* reexport */ tools/* Tools */.S0),
  TorusBlock: () => (/* reexport */ TorusBlock),
  TorusBuilder: () => (/* reexport */ TorusBuilder),
  TorusKnotBuilder: () => (/* reexport */ TorusKnotBuilder),
  TouchCamera: () => (/* reexport */ TouchCamera),
  TrailMesh: () => (/* reexport */ TrailMesh),
  Trajectory: () => (/* reexport */ Trajectory),
  TrajectoryClassifier: () => (/* reexport */ TrajectoryClassifier),
  TranscodeAsync: () => (/* reexport */ basis/* TranscodeAsync */.yk),
  TranscodeTarget: () => (/* reexport */ ktx2decoderTypes/* TranscodeTarget */.Xl),
  TransformBlock: () => (/* reexport */ TransformBlock),
  TransformFeedbackBoundingHelper: () => (/* reexport */ transformFeedbackBoundingHelper.TransformFeedbackBoundingHelper),
  TransformNode: () => (/* reexport */ Meshes_transformNode/* TransformNode */.V),
  TranslationBlock: () => (/* reexport */ TranslationBlock),
  TriPlanarBlock: () => (/* reexport */ TriPlanarBlock),
  TrigonometryBlock: () => (/* reexport */ TrigonometryBlock),
  TrigonometryBlockOperations: () => (/* reexport */ TrigonometryBlockOperations),
  TubeBuilder: () => (/* reexport */ TubeBuilder),
  TwirlBlock: () => (/* reexport */ TwirlBlock),
  UncompressPIZ: () => (/* reexport */ exrLoader_compression/* UncompressPIZ */.tg),
  UncompressPXR: () => (/* reexport */ exrLoader_compression/* UncompressPXR */._k),
  UncompressRAW: () => (/* reexport */ exrLoader_compression/* UncompressRAW */.S4),
  UncompressRLE: () => (/* reexport */ exrLoader_compression/* UncompressRLE */.r),
  UncompressZIP: () => (/* reexport */ exrLoader_compression/* UncompressZIP */.VE),
  UniformBuffer: () => (/* reexport */ uniformBuffer/* UniformBuffer */.D),
  UniversalCamera: () => (/* reexport */ UniversalCamera),
  UnregisterAllMaterialPlugins: () => (/* reexport */ materialPluginManager/* UnregisterAllMaterialPlugins */.tC),
  UnregisterMaterialPlugin: () => (/* reexport */ materialPluginManager/* UnregisterMaterialPlugin */.lM),
  UploadContent: () => (/* reexport */ tga/* UploadContent */.FA),
  UploadEnvLevelsAsync: () => (/* reexport */ environmentTextureTools/* UploadEnvLevelsAsync */.o5),
  UploadEnvSpherical: () => (/* reexport */ environmentTextureTools/* UploadEnvSpherical */.ow),
  UploadLevelsAsync: () => (/* reexport */ environmentTextureTools/* UploadLevelsAsync */.bv),
  UtilityLayerRenderer: () => (/* reexport */ utilityLayerRenderer/* UtilityLayerRenderer */.j),
  VRCameraMetrics: () => (/* reexport */ VRCameraMetrics),
  VRDeviceOrientationArcRotateCamera: () => (/* reexport */ VRDeviceOrientationArcRotateCamera),
  VRDeviceOrientationFreeCamera: () => (/* reexport */ VRDeviceOrientationFreeCamera),
  VRDeviceOrientationGamepadCamera: () => (/* reexport */ VRDeviceOrientationGamepadCamera),
  VRDistortionCorrectionPostProcess: () => (/* reexport */ VRDistortionCorrectionPostProcess),
  VRExperienceHelper: () => (/* reexport */ VRExperienceHelper),
  VRMultiviewToSingleviewPostProcess: () => (/* reexport */ VRMultiviewToSingleviewPostProcess),
  ValidatedNativeDataStream: () => (/* reexport */ ValidatedNativeDataStream),
  ValueCondition: () => (/* reexport */ ValueCondition),
  Vector2: () => (/* reexport */ math/* Vector2 */.I9),
  Vector2ToFixed: () => (/* reexport */ Vector2ToFixed),
  Vector3: () => (/* reexport */ math/* Vector3 */.Pq),
  Vector3ToFixed: () => (/* reexport */ Vector3ToFixed),
  Vector4: () => (/* reexport */ math/* Vector4 */.IU),
  Vector4ToFixed: () => (/* reexport */ Vector4ToFixed),
  VectorConverterBlock: () => (/* reexport */ VectorConverterBlock),
  VectorMergerBlock: () => (/* reexport */ VectorMergerBlock),
  VectorSplitterBlock: () => (/* reexport */ VectorSplitterBlock),
  VertexAnimationBaker: () => (/* reexport */ VertexAnimationBaker),
  VertexBuffer: () => (/* reexport */ Buffers_buffer/* VertexBuffer */.R),
  VertexData: () => (/* reexport */ mesh_vertexData/* VertexData */.P),
  VertexDataMaterialInfo: () => (/* reexport */ mesh_vertexData/* VertexDataMaterialInfo */.o),
  VertexFormat: () => (/* reexport */ VertexFormat),
  VertexOutputBlock: () => (/* reexport */ VertexOutputBlock),
  VertexStepMode: () => (/* reexport */ VertexStepMode),
  VideoDome: () => (/* reexport */ VideoDome),
  VideoRecorder: () => (/* reexport */ VideoRecorder),
  VideoTexture: () => (/* reexport */ VideoTexture),
  ViewDirectionBlock: () => (/* reexport */ ViewDirectionBlock),
  Viewport: () => (/* reexport */ math/* Viewport */.LM),
  VirtualJoystick: () => (/* reexport */ VirtualJoystick),
  VirtualJoysticksCamera: () => (/* reexport */ VirtualJoysticksCamera),
  VolumetricLightScatteringPostProcess: () => (/* reexport */ VolumetricLightScatteringPostProcess),
  VoronoiNoiseBlock: () => (/* reexport */ VoronoiNoiseBlock),
  Wav2Decode: () => (/* reexport */ exrLoader_compression_huf/* Wav2Decode */.tb),
  WaveBlock: () => (/* reexport */ WaveBlock),
  WaveBlockKind: () => (/* reexport */ WaveBlockKind),
  WebGL2ParticleSystem: () => (/* reexport */ WebGL2ParticleSystem),
  WebGL2ShaderProcessor: () => (/* reexport */ webGL2ShaderProcessors/* WebGL2ShaderProcessor */.B),
  WebGLDataBuffer: () => (/* reexport */ webGLDataBuffer/* WebGLDataBuffer */.A),
  WebGLHardwareTexture: () => (/* reexport */ webGLHardwareTexture/* WebGLHardwareTexture */.d),
  WebGLPipelineContext: () => (/* reexport */ webGLPipelineContext/* WebGLPipelineContext */.x),
  WebGPUCacheBindGroups: () => (/* reexport */ WebGPUCacheBindGroups),
  WebGPUCacheRenderPipeline: () => (/* reexport */ WebGPUCacheRenderPipeline),
  WebGPUCacheRenderPipelineTree: () => (/* reexport */ WebGPUCacheRenderPipelineTree),
  WebGPUCacheSampler: () => (/* reexport */ WebGPUCacheSampler),
  WebGPUDataBuffer: () => (/* reexport */ WebGPUDataBuffer),
  WebGPUDrawContext: () => (/* reexport */ WebGPUDrawContext),
  WebGPUEngine: () => (/* reexport */ WebGPUEngine),
  WebGPUPipelineContext: () => (/* reexport */ WebGPUPipelineContext),
  WebGPURenderTargetWrapper: () => (/* reexport */ WebGPURenderTargetWrapper),
  WebGPUShaderProcessor: () => (/* reexport */ WebGPUShaderProcessor),
  WebGPUTintWASM: () => (/* reexport */ WebGPUTintWASM),
  WebRequest: () => (/* reexport */ webRequest/* WebRequest */.u),
  WebXRAbstractFeature: () => (/* reexport */ WebXRAbstractFeature),
  WebXRAbstractMotionController: () => (/* reexport */ WebXRAbstractMotionController),
  WebXRAnchorSystem: () => (/* reexport */ WebXRAnchorSystem),
  WebXRBackgroundRemover: () => (/* reexport */ WebXRBackgroundRemover),
  WebXRCamera: () => (/* reexport */ WebXRCamera),
  WebXRControllerComponent: () => (/* reexport */ WebXRControllerComponent),
  WebXRControllerMovement: () => (/* reexport */ WebXRControllerMovement),
  WebXRControllerPhysics: () => (/* reexport */ WebXRControllerPhysics),
  WebXRControllerPointerSelection: () => (/* reexport */ WebXRControllerPointerSelection),
  WebXRDefaultExperience: () => (/* reexport */ WebXRDefaultExperience),
  WebXRDefaultExperienceOptions: () => (/* reexport */ WebXRDefaultExperienceOptions),
  WebXRDepthSensing: () => (/* reexport */ WebXRDepthSensing),
  WebXRDomOverlay: () => (/* reexport */ WebXRDomOverlay),
  WebXREnterExitUI: () => (/* reexport */ WebXREnterExitUI),
  WebXREnterExitUIButton: () => (/* reexport */ WebXREnterExitUIButton),
  WebXREnterExitUIOptions: () => (/* reexport */ WebXREnterExitUIOptions),
  WebXRExperienceHelper: () => (/* reexport */ WebXRExperienceHelper),
  WebXREyeTracking: () => (/* reexport */ WebXREyeTracking),
  WebXRFeatureName: () => (/* reexport */ webXRFeaturesManager/* WebXRFeatureName */._),
  WebXRFeaturePointSystem: () => (/* reexport */ WebXRFeaturePointSystem),
  WebXRFeaturesManager: () => (/* reexport */ webXRFeaturesManager/* WebXRFeaturesManager */.n),
  WebXRGenericHandController: () => (/* reexport */ WebXRGenericHandController),
  WebXRGenericTriggerMotionController: () => (/* reexport */ WebXRGenericTriggerMotionController),
  WebXRHTCViveMotionController: () => (/* reexport */ WebXRHTCViveMotionController),
  WebXRHand: () => (/* reexport */ WebXRHand),
  WebXRHandJoint: () => (/* reexport */ WebXRHandJoint),
  WebXRHandTracking: () => (/* reexport */ WebXRHandTracking),
  WebXRHitTest: () => (/* reexport */ WebXRHitTest),
  WebXRHitTestLegacy: () => (/* reexport */ WebXRHitTestLegacy),
  WebXRImageTracking: () => (/* reexport */ WebXRImageTracking),
  WebXRInput: () => (/* reexport */ WebXRInput),
  WebXRInputSource: () => (/* reexport */ WebXRInputSource),
  WebXRLayerRenderTargetTextureProvider: () => (/* reexport */ WebXRLayerRenderTargetTextureProvider),
  WebXRLayers: () => (/* reexport */ WebXRLayers),
  WebXRLightEstimation: () => (/* reexport */ WebXRLightEstimation),
  WebXRManagedOutputCanvas: () => (/* reexport */ WebXRManagedOutputCanvas),
  WebXRManagedOutputCanvasOptions: () => (/* reexport */ WebXRManagedOutputCanvasOptions),
  WebXRMeshDetector: () => (/* reexport */ WebXRMeshDetector),
  WebXRMicrosoftMixedRealityController: () => (/* reexport */ WebXRMicrosoftMixedRealityController),
  WebXRMotionControllerManager: () => (/* reexport */ WebXRMotionControllerManager),
  WebXRMotionControllerTeleportation: () => (/* reexport */ WebXRMotionControllerTeleportation),
  WebXRNearControllerMode: () => (/* reexport */ WebXRNearControllerMode),
  WebXRNearInteraction: () => (/* reexport */ WebXRNearInteraction),
  WebXROculusTouchMotionController: () => (/* reexport */ WebXROculusTouchMotionController),
  WebXRPlaneDetector: () => (/* reexport */ WebXRPlaneDetector),
  WebXRProfiledMotionController: () => (/* reexport */ WebXRProfiledMotionController),
  WebXRRawCameraAccess: () => (/* reexport */ WebXRRawCameraAccess),
  WebXRSessionManager: () => (/* reexport */ WebXRSessionManager),
  WebXRSpaceWarp: () => (/* reexport */ WebXRSpaceWarp),
  WebXRSpaceWarpRenderTargetTextureProvider: () => (/* reexport */ WebXRSpaceWarpRenderTargetTextureProvider),
  WebXRState: () => (/* reexport */ WebXRState),
  WebXRTrackingState: () => (/* reexport */ WebXRTrackingState),
  WebXRWalkingLocomotion: () => (/* reexport */ WebXRWalkingLocomotion),
  WeightedSound: () => (/* reexport */ weightedsound/* WeightedSound */.r),
  WorkerPool: () => (/* reexport */ workerPool/* WorkerPool */.T),
  WorleyNoise3DBlock: () => (/* reexport */ WorleyNoise3DBlock),
  XRSpaceWarpRenderTarget: () => (/* reexport */ XRSpaceWarpRenderTarget),
  Xbox360Button: () => (/* reexport */ Xbox360Button),
  Xbox360Dpad: () => (/* reexport */ Xbox360Dpad),
  Xbox360Pad: () => (/* reexport */ Xbox360Pad),
  XboxInput: () => (/* reexport */ deviceEnums/* XboxInput */.sZ),
  _BabylonLoaderRegistered: () => (/* reexport */ _BabylonLoaderRegistered),
  _BasisTextureLoader: () => (/* reexport */ basisTextureLoader._BasisTextureLoader),
  _CommonDispose: () => (/* reexport */ engine_common/* _CommonDispose */.kX),
  _CommonInit: () => (/* reexport */ engine_common/* _CommonInit */.BG),
  _CreationDataStorage: () => (/* reexport */ Meshes_mesh/* _CreationDataStorage */.Ez),
  _DDSTextureLoader: () => (/* reexport */ ddsTextureLoader._DDSTextureLoader),
  _ENVTextureLoader: () => (/* reexport */ envTextureLoader._ENVTextureLoader),
  _ExrTextureLoader: () => (/* reexport */ exrTextureLoader._ExrTextureLoader),
  _GetCompatibleTextureLoader: () => (/* reexport */ textureLoaderManager/* _GetCompatibleTextureLoader */.gT),
  _HDRTextureLoader: () => (/* reexport */ hdrTextureLoader._HDRTextureLoader),
  _InstancesBatch: () => (/* reexport */ Meshes_mesh/* _InstancesBatch */._h),
  _KTXTextureLoader: () => (/* reexport */ ktxTextureLoader._KTXTextureLoader),
  _MeshCollisionData: () => (/* reexport */ meshCollisionData/* _MeshCollisionData */.j),
  _OcclusionDataStorage: () => (/* reexport */ _OcclusionDataStorage),
  _PrimaryIsoTriangle: () => (/* reexport */ _PrimaryIsoTriangle),
  _TGATextureLoader: () => (/* reexport */ tgaTextureLoader._TGATextureLoader),
  _TimeToken: () => (/* reexport */ _TimeToken),
  _UpdateRGBDAsync: () => (/* reexport */ environmentTextureTools/* _UpdateRGBDAsync */.gW),
  _forceSceneHelpersToBundle: () => (/* reexport */ _forceSceneHelpersToBundle),
  _forceTransformFeedbackToBundle: () => (/* reexport */ _forceTransformFeedbackToBundle),
  _injectLTSFileTools: () => (/* reexport */ fileTools/* _injectLTSFileTools */.rh),
  _staticOffsetValueColor3: () => (/* reexport */ Animations_animation/* _staticOffsetValueColor3 */.eA),
  _staticOffsetValueColor4: () => (/* reexport */ Animations_animation/* _staticOffsetValueColor4 */.nl),
  _staticOffsetValueQuaternion: () => (/* reexport */ Animations_animation/* _staticOffsetValueQuaternion */.s$),
  _staticOffsetValueSize: () => (/* reexport */ Animations_animation/* _staticOffsetValueSize */.vF),
  _staticOffsetValueVector2: () => (/* reexport */ Animations_animation/* _staticOffsetValueVector2 */.rq),
  _staticOffsetValueVector3: () => (/* reexport */ Animations_animation/* _staticOffsetValueVector3 */.y4),
  addClipPlaneUniforms: () => (/* reexport */ clipPlaneMaterialHelper/* addClipPlaneUniforms */.TV),
  allocateAndCopyTypedBuffer: () => (/* reexport */ engine_readTexture/* allocateAndCopyTypedBuffer */.k),
  anaglyphPixelShader: () => (/* reexport */ anaglyph_fragment.anaglyphPixelShader),
  anaglyphPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_anaglyph_fragment.anaglyphPixelShaderWGSL),
  appendSceneAsync: () => (/* reexport */ sceneLoader/* appendSceneAsync */.VU),
  backbufferColorTextureHandle: () => (/* reexport */ backbufferColorTextureHandle),
  backbufferDepthStencilTextureHandle: () => (/* reexport */ backbufferDepthStencilTextureHandle),
  backgroundPixelShader: () => (/* reexport */ Shaders_background_fragment.backgroundPixelShader),
  backgroundPixelShaderWGSL: () => (/* reexport */ background_fragment.backgroundPixelShaderWGSL),
  backgroundVertexShader: () => (/* reexport */ Shaders_background_vertex.backgroundVertexShader),
  backgroundVertexShaderWGSL: () => (/* reexport */ background_vertex.backgroundVertexShaderWGSL),
  bilateralBlurPixelShader: () => (/* reexport */ bilateralBlur_fragment.bilateralBlurPixelShader),
  bilateralBlurPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_bilateralBlur_fragment.bilateralBlurPixelShaderWGSL),
  bilateralBlurQualityPixelShader: () => (/* reexport */ bilateralBlurQuality_fragment.bilateralBlurQualityPixelShader),
  bilateralBlurQualityPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_bilateralBlurQuality_fragment.bilateralBlurQualityPixelShaderWGSL),
  bindClipPlane: () => (/* reexport */ clipPlaneMaterialHelper/* bindClipPlane */.gS),
  blackAndWhitePixelShader: () => (/* reexport */ blackAndWhite_fragment.blackAndWhitePixelShader),
  blackAndWhitePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_blackAndWhite_fragment.blackAndWhitePixelShaderWGSL),
  bloomMergePixelShader: () => (/* reexport */ bloomMerge_fragment.bloomMergePixelShader),
  bloomMergePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_bloomMerge_fragment.bloomMergePixelShaderWGSL),
  bonesDeclaration: () => (/* reexport */ ShadersInclude_bonesDeclaration.bonesDeclaration),
  bonesDeclarationWGSL: () => (/* reexport */ bonesDeclaration.bonesDeclarationWGSL),
  bonesVertex: () => (/* reexport */ ShadersInclude_bonesVertex.bonesVertex),
  bonesVertexWGSL: () => (/* reexport */ bonesVertex.bonesVertexWGSL),
  boundingBoxRendererPixelShader: () => (/* reexport */ boundingBoxRenderer_fragment.boundingBoxRendererPixelShader),
  boundingBoxRendererPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_boundingBoxRenderer_fragment.boundingBoxRendererPixelShaderWGSL),
  boundingBoxRendererVertexShader: () => (/* reexport */ boundingBoxRenderer_vertex.boundingBoxRendererVertexShader),
  boundingBoxRendererVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_boundingBoxRenderer_vertex.boundingBoxRendererVertexShaderWGSL),
  bumpFragment: () => (/* reexport */ ShadersInclude_bumpFragment.bumpFragment),
  bumpFragmentFunctions: () => (/* reexport */ ShadersInclude_bumpFragmentFunctions.bumpFragmentFunctions),
  bumpFragmentFunctionsWGSL: () => (/* reexport */ bumpFragmentFunctions.bumpFragmentFunctionsWGSL),
  bumpFragmentMainFunctions: () => (/* reexport */ ShadersInclude_bumpFragmentMainFunctions.bumpFragmentMainFunctions),
  bumpFragmentMainFunctionsWGSL: () => (/* reexport */ bumpFragmentMainFunctions.bumpFragmentMainFunctionsWGSL),
  bumpFragmentWGSL: () => (/* reexport */ bumpFragment.bumpFragmentWGSL),
  captureEquirectangularFromScene: () => (/* reexport */ captureEquirectangularFromScene),
  chromaticAberrationPixelShader: () => (/* reexport */ chromaticAberration_fragment.chromaticAberrationPixelShader),
  chromaticAberrationPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_chromaticAberration_fragment.chromaticAberrationPixelShaderWGSL),
  circleOfConfusionPixelShader: () => (/* reexport */ circleOfConfusion_fragment.circleOfConfusionPixelShader),
  circleOfConfusionPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_circleOfConfusion_fragment.circleOfConfusionPixelShaderWGSL),
  className: () => (/* reexport */ tools/* className */.s7),
  clipPlaneFragment: () => (/* reexport */ ShadersInclude_clipPlaneFragment.clipPlaneFragment),
  clipPlaneFragmentDeclaration: () => (/* reexport */ ShadersInclude_clipPlaneFragmentDeclaration.clipPlaneFragmentDeclaration),
  clipPlaneFragmentDeclarationWGSL: () => (/* reexport */ clipPlaneFragmentDeclaration.clipPlaneFragmentDeclarationWGSL),
  clipPlaneFragmentWGSL: () => (/* reexport */ clipPlaneFragment.clipPlaneFragmentWGSL),
  clipPlaneVertex: () => (/* reexport */ ShadersInclude_clipPlaneVertex.clipPlaneVertex),
  clipPlaneVertexDeclaration: () => (/* reexport */ ShadersInclude_clipPlaneVertexDeclaration.clipPlaneVertexDeclaration),
  clipPlaneVertexDeclarationWGSL: () => (/* reexport */ clipPlaneVertexDeclaration.clipPlaneVertexDeclarationWGSL),
  clipPlaneVertexWGSL: () => (/* reexport */ clipPlaneVertex.clipPlaneVertexWGSL),
  colorCorrectionPixelShader: () => (/* reexport */ colorCorrection_fragment.colorCorrectionPixelShader),
  colorCorrectionPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_colorCorrection_fragment.colorCorrectionPixelShaderWGSL),
  colorPixelShader: () => (/* reexport */ color_fragment.colorPixelShader),
  colorPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_color_fragment.colorPixelShaderWGSL),
  colorVertexShader: () => (/* reexport */ color_vertex.colorVertexShader),
  colorVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_color_vertex.colorVertexShaderWGSL),
  computeMaxExtents: () => (/* reexport */ computeMaxExtents),
  convolutionPixelShader: () => (/* reexport */ convolution_fragment.convolutionPixelShader),
  convolutionPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_convolution_fragment.convolutionPixelShaderWGSL),
  copyTexture3DLayerToTexturePixelShader: () => (/* reexport */ copyTexture3DLayerToTexture_fragment.copyTexture3DLayerToTexturePixelShader),
  copyTexture3DLayerToTexturePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_copyTexture3DLayerToTexture_fragment.copyTexture3DLayerToTexturePixelShaderWGSL),
  copyTextureToTexturePixelShader: () => (/* reexport */ copyTextureToTexture_fragment.copyTextureToTexturePixelShader),
  copyTextureToTexturePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_copyTextureToTexture_fragment.copyTextureToTexturePixelShaderWGSL),
  createDetailMapPlugin: () => (/* reexport */ createDetailMapPlugin),
  createPBRAnisotropicPlugin: () => (/* reexport */ createPBRAnisotropicPlugin),
  createPBRBRDFPlugin: () => (/* reexport */ createPBRBRDFPlugin),
  createPBRClearCoatPlugin: () => (/* reexport */ createPBRClearCoatPlugin),
  createPBRIridescencePlugin: () => (/* reexport */ createPBRIridescencePlugin),
  createPBRSheenPlugin: () => (/* reexport */ createPBRSheenPlugin),
  createPBRSubSurfacePlugin: () => (/* reexport */ createPBRSubSurfacePlugin),
  createYieldingScheduler: () => (/* reexport */ Misc_coroutine/* createYieldingScheduler */.VP),
  defaultPixelShader: () => (/* reexport */ default_fragment.defaultPixelShader),
  defaultPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_default_fragment.defaultPixelShaderWGSL),
  defaultVertexShader: () => (/* reexport */ default_vertex.defaultVertexShader),
  defaultVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_default_vertex.defaultVertexShaderWGSL),
  depthBoxBlurPixelShader: () => (/* reexport */ Shaders_depthBoxBlur_fragment.depthBoxBlurPixelShader),
  depthBoxBlurPixelShaderWGSL: () => (/* reexport */ depthBoxBlur_fragment.depthBoxBlurPixelShaderWGSL),
  depthOfFieldMergePixelShader: () => (/* reexport */ depthOfFieldMerge_fragment.depthOfFieldMergePixelShader),
  depthOfFieldMergePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_depthOfFieldMerge_fragment.depthOfFieldMergePixelShaderWGSL),
  depthPixelShader: () => (/* reexport */ depth_fragment.depthPixelShader),
  depthPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_depth_fragment.depthPixelShaderWGSL),
  depthVertexShader: () => (/* reexport */ depth_vertex.depthVertexShader),
  depthVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_depth_vertex.depthVertexShaderWGSL),
  displayPassPixelShader: () => (/* reexport */ displayPass_fragment.displayPassPixelShader),
  displayPassPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_displayPass_fragment.displayPassPixelShaderWGSL),
  editableInPropertyPage: () => (/* reexport */ editableInPropertyPage),
  expandToProperty: () => (/* reexport */ decorators/* expandToProperty */.$z),
  extractHighlightsPixelShader: () => (/* reexport */ extractHighlights_fragment.extractHighlightsPixelShader),
  extractHighlightsPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_extractHighlights_fragment.extractHighlightsPixelShaderWGSL),
  extractMinAndMax: () => (/* reexport */ math_functions/* extractMinAndMax */.b8),
  extractMinAndMaxIndexed: () => (/* reexport */ math_functions/* extractMinAndMaxIndexed */.cD),
  filterPixelShader: () => (/* reexport */ filter_fragment.filterPixelShader),
  filterPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_filter_fragment.filterPixelShaderWGSL),
  fluidRenderingBilateralBlurPixelShader: () => (/* reexport */ fluidRenderingBilateralBlur_fragment.fluidRenderingBilateralBlurPixelShader),
  fluidRenderingBilateralBlurPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_fluidRenderingBilateralBlur_fragment.fluidRenderingBilateralBlurPixelShaderWGSL),
  fluidRenderingParticleDepthPixelShader: () => (/* reexport */ fluidRenderingParticleDepth_fragment.fluidRenderingParticleDepthPixelShader),
  fluidRenderingParticleDepthPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_fluidRenderingParticleDepth_fragment.fluidRenderingParticleDepthPixelShaderWGSL),
  fluidRenderingParticleDepthVertexShader: () => (/* reexport */ fluidRenderingParticleDepth_vertex.fluidRenderingParticleDepthVertexShader),
  fluidRenderingParticleDepthVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_fluidRenderingParticleDepth_vertex.fluidRenderingParticleDepthVertexShaderWGSL),
  fluidRenderingParticleDiffusePixelShader: () => (/* reexport */ fluidRenderingParticleDiffuse_fragment.fluidRenderingParticleDiffusePixelShader),
  fluidRenderingParticleDiffusePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_fluidRenderingParticleDiffuse_fragment.fluidRenderingParticleDiffusePixelShaderWGSL),
  fluidRenderingParticleDiffuseVertexShader: () => (/* reexport */ fluidRenderingParticleDiffuseVertexShader),
  fluidRenderingParticleDiffuseVertexShaderWGSL: () => (/* reexport */ fluidRenderingParticleDiffuseVertexShaderWGSL),
  fluidRenderingParticleThicknessPixelShader: () => (/* reexport */ fluidRenderingParticleThickness_fragment.fluidRenderingParticleThicknessPixelShader),
  fluidRenderingParticleThicknessPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_fluidRenderingParticleThickness_fragment.fluidRenderingParticleThicknessPixelShaderWGSL),
  fluidRenderingParticleThicknessVertexShader: () => (/* reexport */ fluidRenderingParticleThickness_vertex.fluidRenderingParticleThicknessVertexShader),
  fluidRenderingParticleThicknessVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_fluidRenderingParticleThickness_vertex.fluidRenderingParticleThicknessVertexShaderWGSL),
  fluidRenderingRenderPixelShader: () => (/* reexport */ fluidRenderingRender_fragment.fluidRenderingRenderPixelShader),
  fluidRenderingRenderPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_fluidRenderingRender_fragment.fluidRenderingRenderPixelShaderWGSL),
  fluidRenderingStandardBlurPixelShader: () => (/* reexport */ fluidRenderingStandardBlur_fragment.fluidRenderingStandardBlurPixelShader),
  fluidRenderingStandardBlurPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_fluidRenderingStandardBlur_fragment.fluidRenderingStandardBlurPixelShaderWGSL),
  fogFragmentDeclaration: () => (/* reexport */ ShadersInclude_fogFragmentDeclaration.fogFragmentDeclaration),
  fogFragmentDeclarationWGSL: () => (/* reexport */ fogFragmentDeclaration.fogFragmentDeclarationWGSL),
  fxaaPixelShader: () => (/* reexport */ fxaa_fragment.fxaaPixelShader),
  fxaaPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_fxaa_fragment.fxaaPixelShaderWGSL),
  fxaaVertexShader: () => (/* reexport */ fxaa_vertex.fxaaVertexShader),
  fxaaVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_fxaa_vertex.fxaaVertexShaderWGSL),
  gaussianSplattingVertexDeclaration: () => (/* reexport */ gaussianSplattingVertexDeclaration/* gaussianSplattingVertexDeclaration */.Q),
  gaussianSplattingVertexDeclarationWGSL: () => (/* reexport */ gaussianSplattingVertexDeclarationWGSL),
  geometryPixelShader: () => (/* reexport */ geometry_fragment.geometryPixelShader),
  geometryPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_geometry_fragment.geometryPixelShaderWGSL),
  geometryVertexShader: () => (/* reexport */ geometry_vertex.geometryVertexShader),
  geometryVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_geometry_vertex.geometryVertexShaderWGSL),
  getDimensionsFromTextureSize: () => (/* reexport */ getDimensionsFromTextureSize),
  getRichTypeFromValue: () => (/* reexport */ flowGraphRichTypes/* getRichTypeFromValue */.k4),
  glowBlurPostProcessPixelShader: () => (/* reexport */ glowBlurPostProcess_fragment.glowBlurPostProcessPixelShader),
  glowBlurPostProcessPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_glowBlurPostProcess_fragment.glowBlurPostProcessPixelShaderWGSL),
  glowMapGenerationPixelShader: () => (/* reexport */ glowMapGeneration_fragment.glowMapGenerationPixelShader),
  glowMapGenerationPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_glowMapGeneration_fragment.glowMapGenerationPixelShaderWGSL),
  glowMapGenerationVertexShader: () => (/* reexport */ glowMapGeneration_vertex.glowMapGenerationVertexShader),
  glowMapGenerationVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_glowMapGeneration_vertex.glowMapGenerationVertexShaderWGSL),
  glowMapMergePixelShader: () => (/* reexport */ glowMapMerge_fragment.glowMapMergePixelShader),
  glowMapMergePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_glowMapMerge_fragment.glowMapMergePixelShaderWGSL),
  glowMapMergeVertexShader: () => (/* reexport */ glowMapMerge_vertex.glowMapMergeVertexShader),
  glowMapMergeVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_glowMapMerge_vertex.glowMapMergeVertexShaderWGSL),
  grainPixelShader: () => (/* reexport */ grain_fragment.grainPixelShader),
  grainPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_grain_fragment.grainPixelShaderWGSL),
  hdrFilteringPixelShader: () => (/* reexport */ hdrFiltering_fragment.hdrFilteringPixelShader),
  hdrFilteringPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_hdrFiltering_fragment.hdrFilteringPixelShaderWGSL),
  hdrFilteringVertexShader: () => (/* reexport */ hdrFiltering_vertex.hdrFilteringVertexShader),
  hdrFilteringVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_hdrFiltering_vertex.hdrFilteringVertexShaderWGSL),
  helperFunctions: () => (/* reexport */ ShadersInclude_helperFunctions.helperFunctions),
  helperFunctionsWGSL: () => (/* reexport */ helperFunctions.helperFunctionsWGSL),
  highlightsPixelShader: () => (/* reexport */ highlights_fragment.highlightsPixelShader),
  highlightsPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_highlights_fragment.highlightsPixelShaderWGSL),
  iblCombineVoxelGridsPixelShader: () => (/* reexport */ Shaders_iblCombineVoxelGrids_fragment.iblCombineVoxelGridsPixelShader),
  iblCombineVoxelGridsPixelShaderWGSL: () => (/* reexport */ iblCombineVoxelGrids_fragment.iblCombineVoxelGridsPixelShaderWGSL),
  iblGenerateVoxelMipPixelShader: () => (/* reexport */ iblGenerateVoxelMip_fragment.iblGenerateVoxelMipPixelShader),
  iblGenerateVoxelMipPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_iblGenerateVoxelMip_fragment.iblGenerateVoxelMipPixelShaderWGSL),
  iblShadowAccumulationPixelShader: () => (/* reexport */ Shaders_iblShadowAccumulation_fragment.iblShadowAccumulationPixelShader),
  iblShadowAccumulationPixelShaderWGSL: () => (/* reexport */ iblShadowAccumulation_fragment.iblShadowAccumulationPixelShaderWGSL),
  iblShadowDebugPixelShader: () => (/* reexport */ iblShadowDebug_fragment.iblShadowDebugPixelShader),
  iblShadowDebugPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_iblShadowDebug_fragment.iblShadowDebugPixelShaderWGSL),
  iblShadowGBufferDebugPixelShader: () => (/* reexport */ iblShadowGBufferDebug_fragment.iblShadowGBufferDebugPixelShader),
  iblShadowGBufferDebugPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_iblShadowGBufferDebug_fragment.iblShadowGBufferDebugPixelShaderWGSL),
  iblShadowSpatialBlurPixelShader: () => (/* reexport */ Shaders_iblShadowSpatialBlur_fragment.iblShadowSpatialBlurPixelShader),
  iblShadowSpatialBlurPixelShaderWGSL: () => (/* reexport */ iblShadowSpatialBlur_fragment.iblShadowSpatialBlurPixelShaderWGSL),
  iblShadowVoxelTracingPixelShader: () => (/* reexport */ iblShadowVoxelTracing_fragment.iblShadowVoxelTracingPixelShader),
  iblShadowVoxelTracingPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_iblShadowVoxelTracing_fragment.iblShadowVoxelTracingPixelShaderWGSL),
  iblShadowsCdfxPixelShader: () => (/* reexport */ Shaders_iblShadowsCdfx_fragment.iblShadowsCdfxPixelShader),
  iblShadowsCdfxPixelShaderWGSL: () => (/* reexport */ iblShadowsCdfx_fragment.iblShadowsCdfxPixelShaderWGSL),
  iblShadowsCdfyPixelShader: () => (/* reexport */ Shaders_iblShadowsCdfy_fragment.iblShadowsCdfyPixelShader),
  iblShadowsCdfyPixelShaderWGSL: () => (/* reexport */ iblShadowsCdfy_fragment.iblShadowsCdfyPixelShaderWGSL),
  iblShadowsCombinePixelShader: () => (/* reexport */ iblShadowsCombinePixelShader),
  iblShadowsCombinePixelShaderWGSL: () => (/* reexport */ iblShadowsCombinePixelShaderWGSL),
  iblShadowsIcdfxPixelShader: () => (/* reexport */ Shaders_iblShadowsIcdfx_fragment.iblShadowsIcdfxPixelShader),
  iblShadowsIcdfxPixelShaderWGSL: () => (/* reexport */ iblShadowsIcdfx_fragment.iblShadowsIcdfxPixelShaderWGSL),
  iblShadowsIcdfyPixelShader: () => (/* reexport */ Shaders_iblShadowsIcdfy_fragment.iblShadowsIcdfyPixelShader),
  iblShadowsIcdfyPixelShaderWGSL: () => (/* reexport */ iblShadowsIcdfy_fragment.iblShadowsIcdfyPixelShaderWGSL),
  iblShadowsImportanceSamplingDebugPixelShader: () => (/* reexport */ Shaders_iblShadowsImportanceSamplingDebug_fragment.iblShadowsImportanceSamplingDebugPixelShader),
  iblShadowsImportanceSamplingDebugPixelShaderWGSL: () => (/* reexport */ iblShadowsImportanceSamplingDebug_fragment.iblShadowsImportanceSamplingDebugPixelShaderWGSL),
  iblVoxelGrid2dArrayDebugPixelShader: () => (/* reexport */ iblVoxelGrid2dArrayDebug_fragment.iblVoxelGrid2dArrayDebugPixelShader),
  iblVoxelGrid2dArrayDebugPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_iblVoxelGrid2dArrayDebug_fragment.iblVoxelGrid2dArrayDebugPixelShaderWGSL),
  iblVoxelGrid3dDebugPixelShader: () => (/* reexport */ iblVoxelGrid3dDebug_fragment.iblVoxelGrid3dDebugPixelShader),
  iblVoxelGrid3dDebugPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_iblVoxelGrid3dDebug_fragment.iblVoxelGrid3dDebugPixelShaderWGSL),
  iblVoxelGridPixelShader: () => (/* reexport */ iblVoxelGrid_fragment.iblVoxelGridPixelShader),
  iblVoxelGridPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_iblVoxelGrid_fragment.iblVoxelGridPixelShaderWGSL),
  iblVoxelGridVertexShader: () => (/* reexport */ iblVoxelGrid_vertex.iblVoxelGridVertexShader),
  iblVoxelGridVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_iblVoxelGrid_vertex.iblVoxelGridVertexShaderWGSL),
  iblVoxelSlabDebugPixelShader: () => (/* reexport */ iblVoxelSlabDebug_fragment.iblVoxelSlabDebugPixelShader),
  iblVoxelSlabDebugPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_iblVoxelSlabDebug_fragment.iblVoxelSlabDebugPixelShaderWGSL),
  iblVoxelSlabDebugVertexShader: () => (/* reexport */ iblVoxelSlabDebug_vertex.iblVoxelSlabDebugVertexShader),
  iblVoxelSlabDebugVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_iblVoxelSlabDebug_vertex.iblVoxelSlabDebugVertexShaderWGSL),
  imageProcessingDeclaration: () => (/* reexport */ ShadersInclude_imageProcessingDeclaration.imageProcessingDeclaration),
  imageProcessingDeclarationWGSL: () => (/* reexport */ imageProcessingDeclaration.imageProcessingDeclarationWGSL),
  imageProcessingFunctions: () => (/* reexport */ ShadersInclude_imageProcessingFunctions.imageProcessingFunctions),
  imageProcessingFunctionsWGSL: () => (/* reexport */ imageProcessingFunctions.imageProcessingFunctionsWGSL),
  imageProcessingPixelShader: () => (/* reexport */ Shaders_imageProcessing_fragment.imageProcessingPixelShader),
  imageProcessingPixelShaderWGSL: () => (/* reexport */ imageProcessing_fragment.imageProcessingPixelShaderWGSL),
  importAnimationsAsync: () => (/* reexport */ sceneLoader/* importAnimationsAsync */.fV),
  inlineScheduler: () => (/* reexport */ Misc_coroutine/* inlineScheduler */.FE),
  kernelBlurPixelShader: () => (/* reexport */ kernelBlur_fragment.kernelBlurPixelShader),
  kernelBlurPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_kernelBlur_fragment.kernelBlurPixelShaderWGSL),
  kernelBlurVertexShader: () => (/* reexport */ kernelBlur_vertex.kernelBlurVertexShader),
  kernelBlurVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_kernelBlur_vertex.kernelBlurVertexShaderWGSL),
  layerPixelShader: () => (/* reexport */ layer_fragment.layerPixelShader),
  layerPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_layer_fragment.layerPixelShaderWGSL),
  layerVertexShader: () => (/* reexport */ layer_vertex.layerVertexShader),
  layerVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_layer_vertex.layerVertexShaderWGSL),
  lensFlarePixelShader: () => (/* reexport */ lensFlare_fragment.lensFlarePixelShader),
  lensFlarePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_lensFlare_fragment.lensFlarePixelShaderWGSL),
  lensFlareVertexShader: () => (/* reexport */ lensFlare_vertex.lensFlareVertexShader),
  lensFlareVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_lensFlare_vertex.lensFlareVertexShaderWGSL),
  lightFragment: () => (/* reexport */ ShadersInclude_lightFragment.lightFragment),
  lightFragmentDeclaration: () => (/* reexport */ lightFragmentDeclaration.lightFragmentDeclaration),
  lightFragmentWGSL: () => (/* reexport */ lightFragment.lightFragmentWGSL),
  lightUboDeclaration: () => (/* reexport */ ShadersInclude_lightUboDeclaration.lightUboDeclaration),
  lightUboDeclarationWGSL: () => (/* reexport */ lightUboDeclaration.lightUboDeclarationWGSL),
  lightVxFragmentDeclaration: () => (/* reexport */ lightVxFragmentDeclaration.lightVxFragmentDeclaration),
  lightVxUboDeclaration: () => (/* reexport */ ShadersInclude_lightVxUboDeclaration.lightVxUboDeclaration),
  lightVxUboDeclarationWGSL: () => (/* reexport */ lightVxUboDeclaration.lightVxUboDeclarationWGSL),
  lightsFragmentFunctions: () => (/* reexport */ ShadersInclude_lightsFragmentFunctions.lightsFragmentFunctions),
  lightsFragmentFunctionsWGSL: () => (/* reexport */ lightsFragmentFunctions.lightsFragmentFunctionsWGSL),
  linePixelShader: () => (/* reexport */ line_fragment.linePixelShader),
  linePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_line_fragment.linePixelShaderWGSL),
  lineVertexShader: () => (/* reexport */ line_vertex.lineVertexShader),
  lineVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_line_vertex.lineVertexShaderWGSL),
  loadAssetContainerAsync: () => (/* reexport */ sceneLoader/* loadAssetContainerAsync */.kS),
  loadSceneAsync: () => (/* reexport */ sceneLoader/* loadSceneAsync */.VA),
  lodCubePixelShader: () => (/* reexport */ lodCube_fragment.lodCubePixelShader),
  lodCubePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_lodCube_fragment.lodCubePixelShaderWGSL),
  lodPixelShader: () => (/* reexport */ lod_fragment.lodPixelShader),
  lodPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_lod_fragment.lodPixelShaderWGSL),
  makeAsyncFunction: () => (/* reexport */ Misc_coroutine/* makeAsyncFunction */.xu),
  makeSyncFunction: () => (/* reexport */ Misc_coroutine/* makeSyncFunction */.Aj),
  meshUVSpaceRendererFinaliserPixelShader: () => (/* reexport */ meshUVSpaceRendererFinaliser_fragment.meshUVSpaceRendererFinaliserPixelShader),
  meshUVSpaceRendererFinaliserPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_meshUVSpaceRendererFinaliser_fragment.meshUVSpaceRendererFinaliserPixelShaderWGSL),
  meshUVSpaceRendererFinaliserVertexShader: () => (/* reexport */ meshUVSpaceRendererFinaliser_vertex.meshUVSpaceRendererFinaliserVertexShader),
  meshUVSpaceRendererFinaliserVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_meshUVSpaceRendererFinaliser_vertex.meshUVSpaceRendererFinaliserVertexShaderWGSL),
  meshUVSpaceRendererMaskerPixelShader: () => (/* reexport */ meshUVSpaceRendererMasker_fragment.meshUVSpaceRendererMaskerPixelShader),
  meshUVSpaceRendererMaskerPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_meshUVSpaceRendererMasker_fragment.meshUVSpaceRendererMaskerPixelShaderWGSL),
  meshUVSpaceRendererMaskerVertexShader: () => (/* reexport */ meshUVSpaceRendererMasker_vertex.meshUVSpaceRendererMaskerVertexShader),
  meshUVSpaceRendererMaskerVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_meshUVSpaceRendererMasker_vertex.meshUVSpaceRendererMaskerVertexShaderWGSL),
  meshUVSpaceRendererPixelShader: () => (/* reexport */ meshUVSpaceRenderer_fragment.meshUVSpaceRendererPixelShader),
  meshUVSpaceRendererPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_meshUVSpaceRenderer_fragment.meshUVSpaceRendererPixelShaderWGSL),
  meshUVSpaceRendererVertexShader: () => (/* reexport */ meshUVSpaceRenderer_vertex.meshUVSpaceRendererVertexShader),
  meshUVSpaceRendererVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_meshUVSpaceRenderer_vertex.meshUVSpaceRendererVertexShaderWGSL),
  morphTargetsVertex: () => (/* reexport */ ShadersInclude_morphTargetsVertex.morphTargetsVertex),
  morphTargetsVertexDeclaration: () => (/* reexport */ ShadersInclude_morphTargetsVertexDeclaration.morphTargetsVertexDeclaration),
  morphTargetsVertexDeclarationWGSL: () => (/* reexport */ morphTargetsVertexDeclaration.morphTargetsVertexDeclarationWGSL),
  morphTargetsVertexGlobal: () => (/* reexport */ ShadersInclude_morphTargetsVertexGlobal.morphTargetsVertexGlobal),
  morphTargetsVertexGlobalDeclaration: () => (/* reexport */ ShadersInclude_morphTargetsVertexGlobalDeclaration.morphTargetsVertexGlobalDeclaration),
  morphTargetsVertexGlobalDeclarationWGSL: () => (/* reexport */ morphTargetsVertexGlobalDeclaration.morphTargetsVertexGlobalDeclarationWGSL),
  morphTargetsVertexGlobalWGSL: () => (/* reexport */ morphTargetsVertexGlobal.morphTargetsVertexGlobalWGSL),
  morphTargetsVertexWGSL: () => (/* reexport */ morphTargetsVertex.morphTargetsVertexWGSL),
  motionBlurPixelShader: () => (/* reexport */ motionBlur_fragment.motionBlurPixelShader),
  motionBlurPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_motionBlur_fragment.motionBlurPixelShaderWGSL),
  nativeOverride: () => (/* reexport */ decorators/* nativeOverride */.Cx),
  normalizeEnvInfo: () => (/* reexport */ environmentTextureTools/* normalizeEnvInfo */.RZ),
  oitBackBlendPixelShader: () => (/* reexport */ oitBackBlend_fragment.oitBackBlendPixelShader),
  oitBackBlendPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_oitBackBlend_fragment.oitBackBlendPixelShaderWGSL),
  oitFinalPixelShader: () => (/* reexport */ oitFinal_fragment.oitFinalPixelShader),
  oitFinalPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_oitFinal_fragment.oitFinalPixelShaderWGSL),
  outlinePixelShader: () => (/* reexport */ outline_fragment.outlinePixelShader),
  outlinePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_outline_fragment.outlinePixelShaderWGSL),
  outlineVertexShader: () => (/* reexport */ outline_vertex.outlineVertexShader),
  outlineVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_outline_vertex.outlineVertexShaderWGSL),
  packingFunctions: () => (/* reexport */ ShadersInclude_packingFunctions.packingFunctions),
  packingFunctionsWGSL: () => (/* reexport */ packingFunctions.packingFunctionsWGSL),
  particlesPixelShader: () => (/* reexport */ particles_fragment.particlesPixelShader),
  particlesPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_particles_fragment.particlesPixelShaderWGSL),
  particlesVertexShader: () => (/* reexport */ particles_vertex.particlesVertexShader),
  particlesVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_particles_vertex.particlesVertexShaderWGSL),
  passCubePixelShader: () => (/* reexport */ passCube_fragment.passCubePixelShader),
  passCubePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_passCube_fragment.passCubePixelShaderWGSL),
  passPixelShader: () => (/* reexport */ pass_fragment.passPixelShader),
  passPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_pass_fragment.passPixelShaderWGSL),
  pbrPixelShader: () => (/* reexport */ Shaders_pbr_fragment.pbrPixelShader),
  pbrPixelShaderWGSL: () => (/* reexport */ pbr_fragment.pbrPixelShaderWGSL),
  pbrVertexShader: () => (/* reexport */ Shaders_pbr_vertex.pbrVertexShader),
  pbrVertexShaderWGSL: () => (/* reexport */ pbr_vertex.pbrVertexShaderWGSL),
  pickingPixelShader: () => (/* reexport */ picking_fragment.pickingPixelShader),
  pickingPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_picking_fragment.pickingPixelShaderWGSL),
  pickingVertexShader: () => (/* reexport */ picking_vertex.pickingVertexShader),
  pickingVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_picking_vertex.pickingVertexShaderWGSL),
  postprocessVertexShader: () => (/* reexport */ postprocess_vertex.postprocessVertexShader),
  postprocessVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_postprocess_vertex.postprocessVertexShaderWGSL),
  prepareDefinesForClipPlanes: () => (/* reexport */ clipPlaneMaterialHelper/* prepareDefinesForClipPlanes */.Eq),
  prepareStringDefinesForClipPlanes: () => (/* reexport */ clipPlaneMaterialHelper/* prepareStringDefinesForClipPlanes */.tv),
  proceduralVertexShader: () => (/* reexport */ Shaders_procedural_vertex.proceduralVertexShader),
  proceduralVertexShaderWGSL: () => (/* reexport */ procedural_vertex.proceduralVertexShaderWGSL),
  reflectionFunction: () => (/* reexport */ ShadersInclude_reflectionFunction.reflectionFunction),
  reflectionFunctionWGSL: () => (/* reexport */ reflectionFunction.reflectionFunctionWGSL),
  registerSceneLoaderPlugin: () => (/* reexport */ sceneLoader/* registerSceneLoaderPlugin */.cH),
  registerTextureLoader: () => (/* reexport */ textureLoaderManager/* registerTextureLoader */.kf),
  rgbdDecodePixelShader: () => (/* reexport */ rgbdDecode_fragment.rgbdDecodePixelShader),
  rgbdDecodePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_rgbdDecode_fragment.rgbdDecodePixelShaderWGSL),
  rgbdEncodePixelShader: () => (/* reexport */ rgbdEncode_fragment.rgbdEncodePixelShader),
  rgbdEncodePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_rgbdEncode_fragment.rgbdEncodePixelShaderWGSL),
  rsmFullGlobalIlluminationPixelShader: () => (/* reexport */ rsmFullGlobalIllumination_fragment.rsmFullGlobalIlluminationPixelShader),
  rsmFullGlobalIlluminationPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_rsmFullGlobalIllumination_fragment.rsmFullGlobalIlluminationPixelShaderWGSL),
  rsmGlobalIlluminationPixelShader: () => (/* reexport */ rsmGlobalIllumination_fragment.rsmGlobalIlluminationPixelShader),
  rsmGlobalIlluminationPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_rsmGlobalIllumination_fragment.rsmGlobalIlluminationPixelShaderWGSL),
  runCoroutine: () => (/* reexport */ Misc_coroutine/* runCoroutine */.aw),
  runCoroutineAsync: () => (/* reexport */ Misc_coroutine/* runCoroutineAsync */.kj),
  runCoroutineSync: () => (/* reexport */ Misc_coroutine/* runCoroutineSync */.V1),
  screenSpaceReflection2BlurCombinerPixelShader: () => (/* reexport */ screenSpaceReflection2BlurCombiner_fragment.screenSpaceReflection2BlurCombinerPixelShader),
  screenSpaceReflection2BlurCombinerPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_screenSpaceReflection2BlurCombiner_fragment.screenSpaceReflection2BlurCombinerPixelShaderWGSL),
  screenSpaceReflection2BlurPixelShader: () => (/* reexport */ screenSpaceReflection2Blur_fragment.screenSpaceReflection2BlurPixelShader),
  screenSpaceReflection2BlurPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_screenSpaceReflection2Blur_fragment.screenSpaceReflection2BlurPixelShaderWGSL),
  screenSpaceReflection2PixelShader: () => (/* reexport */ screenSpaceReflection2_fragment.screenSpaceReflection2PixelShader),
  screenSpaceReflection2PixelShaderWGSL: () => (/* reexport */ ShadersWGSL_screenSpaceReflection2_fragment.screenSpaceReflection2PixelShaderWGSL),
  serialize: () => (/* reexport */ decorators/* serialize */.lK),
  serializeAsCameraReference: () => (/* reexport */ decorators/* serializeAsCameraReference */.fW),
  serializeAsColor3: () => (/* reexport */ decorators/* serializeAsColor3 */.jT),
  serializeAsColor4: () => (/* reexport */ decorators/* serializeAsColor4 */.qK),
  serializeAsColorCurves: () => (/* reexport */ decorators/* serializeAsColorCurves */.wL),
  serializeAsFresnelParameters: () => (/* reexport */ decorators/* serializeAsFresnelParameters */.Y9),
  serializeAsImageProcessingConfiguration: () => (/* reexport */ decorators/* serializeAsImageProcessingConfiguration */.n1),
  serializeAsMatrix: () => (/* reexport */ decorators/* serializeAsMatrix */.GG),
  serializeAsMeshReference: () => (/* reexport */ decorators/* serializeAsMeshReference */.xG),
  serializeAsQuaternion: () => (/* reexport */ decorators/* serializeAsQuaternion */.bR),
  serializeAsTexture: () => (/* reexport */ decorators/* serializeAsTexture */.uM),
  serializeAsVector2: () => (/* reexport */ decorators/* serializeAsVector2 */.WM),
  serializeAsVector3: () => (/* reexport */ decorators/* serializeAsVector3 */.P_),
  setAndStartTimer: () => (/* reexport */ timer/* setAndStartTimer */.fj),
  setOpenGLOrientationForUV: () => (/* reexport */ compatibilityOptions/* setOpenGLOrientationForUV */.ge),
  setStereoscopicAnaglyphRigMode: () => (/* reexport */ setStereoscopicAnaglyphRigMode),
  setStereoscopicRigMode: () => (/* reexport */ setStereoscopicRigMode),
  setVRRigMode: () => (/* reexport */ setVRRigMode),
  shadowMapFragment: () => (/* reexport */ ShadersInclude_shadowMapFragment.shadowMapFragment),
  shadowMapFragmentSoftTransparentShadow: () => (/* reexport */ ShadersInclude_shadowMapFragmentSoftTransparentShadow.shadowMapFragmentSoftTransparentShadow),
  shadowMapFragmentSoftTransparentShadowWGSL: () => (/* reexport */ shadowMapFragmentSoftTransparentShadow.shadowMapFragmentSoftTransparentShadowWGSL),
  shadowMapFragmentWGSL: () => (/* reexport */ shadowMapFragment.shadowMapFragmentWGSL),
  shadowMapPixelShader: () => (/* reexport */ Shaders_shadowMap_fragment.shadowMapPixelShader),
  shadowMapPixelShaderWGSL: () => (/* reexport */ shadowMap_fragment.shadowMapPixelShaderWGSL),
  shadowMapVertexMetric: () => (/* reexport */ ShadersInclude_shadowMapVertexMetric.shadowMapVertexMetric),
  shadowMapVertexMetricWGSL: () => (/* reexport */ shadowMapVertexMetric.shadowMapVertexMetricWGSL),
  shadowMapVertexShader: () => (/* reexport */ Shaders_shadowMap_vertex.shadowMapVertexShader),
  shadowMapVertexShaderWGSL: () => (/* reexport */ shadowMap_vertex.shadowMapVertexShaderWGSL),
  shadowsFragmentFunctions: () => (/* reexport */ ShadersInclude_shadowsFragmentFunctions.shadowsFragmentFunctions),
  shadowsFragmentFunctionsWGSL: () => (/* reexport */ shadowsFragmentFunctions.shadowsFragmentFunctionsWGSL),
  shadowsVertex: () => (/* reexport */ ShadersInclude_shadowsVertex.shadowsVertex),
  shadowsVertexWGSL: () => (/* reexport */ shadowsVertex.shadowsVertexWGSL),
  sharpenPixelShader: () => (/* reexport */ sharpen_fragment.sharpenPixelShader),
  sharpenPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_sharpen_fragment.sharpenPixelShaderWGSL),
  spritesPixelShader: () => (/* reexport */ sprites_fragment.spritesPixelShader),
  spritesPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_sprites_fragment.spritesPixelShaderWGSL),
  spritesVertexShader: () => (/* reexport */ sprites_vertex.spritesVertexShader),
  spritesVertexShaderWGSL: () => (/* reexport */ ShadersWGSL_sprites_vertex.spritesVertexShaderWGSL),
  ssao2PixelShader: () => (/* reexport */ ssao2_fragment.ssao2PixelShader),
  ssao2PixelShaderWGSL: () => (/* reexport */ ShadersWGSL_ssao2_fragment.ssao2PixelShaderWGSL),
  ssaoCombinePixelShader: () => (/* reexport */ ssaoCombine_fragment.ssaoCombinePixelShader),
  ssaoCombinePixelShaderWGSL: () => (/* reexport */ ShadersWGSL_ssaoCombine_fragment.ssaoCombinePixelShaderWGSL),
  textureSizeIsObject: () => (/* reexport */ textureSizeIsObject),
  tonemapPixelShader: () => (/* reexport */ tonemap_fragment.tonemapPixelShader),
  tonemapPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_tonemap_fragment.tonemapPixelShaderWGSL),
  unregisterTextureLoader: () => (/* reexport */ textureLoaderManager/* unregisterTextureLoader */.hy),
  useOpenGLOrientationForUV: () => (/* reexport */ compatibilityOptions/* useOpenGLOrientationForUV */.rX),
  vrDistortionCorrectionPixelShader: () => (/* reexport */ vrDistortionCorrection_fragment.vrDistortionCorrectionPixelShader),
  vrDistortionCorrectionPixelShaderWGSL: () => (/* reexport */ ShadersWGSL_vrDistortionCorrection_fragment.vrDistortionCorrectionPixelShaderWGSL)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Actions/abstractActionManager.js
var abstractActionManager = __webpack_require__(99451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var Misc_observable = __webpack_require__(99848);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__(79923);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.color.js
var math_color = __webpack_require__(26041);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/typeStore.js
var typeStore = __webpack_require__(56552);
;// ./node_modules/@babylonjs/core/Actions/action.js




/**
 * The action to be carried out following a trigger
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#available-actions
 */
class Action {
    /**
     * Creates a new Action
     * @param triggerOptions the trigger, with or without parameters, for the action
     * @param condition an optional determinant of action
     */
    constructor(
    /** the trigger, with or without parameters, for the action */
    triggerOptions, condition) {
        this.triggerOptions = triggerOptions;
        /**
         * An event triggered prior to action being executed.
         */
        this.onBeforeExecuteObservable = new Misc_observable/* Observable */.cP();
        if (triggerOptions.parameter) {
            this.trigger = triggerOptions.trigger;
            this._triggerParameter = triggerOptions.parameter;
        }
        else if (triggerOptions.trigger) {
            this.trigger = triggerOptions.trigger;
        }
        else {
            this.trigger = triggerOptions;
        }
        this._nextActiveAction = this;
        this._condition = condition;
    }
    /**
     * Internal only
     * @internal
     */
    _prepare() { }
    /**
     * Gets the trigger parameter
     * @returns the trigger parameter
     */
    getTriggerParameter() {
        return this._triggerParameter;
    }
    /**
     * Sets the trigger parameter
     * @param value defines the new trigger parameter
     */
    setTriggerParameter(value) {
        this._triggerParameter = value;
    }
    /**
     * Internal only - Returns if the current condition allows to run the action
     * @internal
     */
    _evaluateConditionForCurrentFrame() {
        const condition = this._condition;
        if (!condition) {
            return true;
        }
        const currentRenderId = this._actionManager.getScene().getRenderId();
        // We cache the current evaluation for the current frame
        if (condition._evaluationId !== currentRenderId) {
            condition._evaluationId = currentRenderId;
            condition._currentResult = condition.isValid();
        }
        return condition._currentResult;
    }
    /**
     * Internal only - executes current action event
     * @internal
     */
    _executeCurrent(evt) {
        const isConditionValid = this._evaluateConditionForCurrentFrame();
        if (!isConditionValid) {
            return;
        }
        this.onBeforeExecuteObservable.notifyObservers(this);
        this._nextActiveAction.execute(evt);
        this.skipToNextActiveAction();
    }
    /**
     * Execute placeholder for child classes
     * @param evt optional action event
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    execute(evt) { }
    /**
     * Skips to next active action
     */
    skipToNextActiveAction() {
        if (this._nextActiveAction._child) {
            if (!this._nextActiveAction._child._actionManager) {
                this._nextActiveAction._child._actionManager = this._actionManager;
            }
            this._nextActiveAction = this._nextActiveAction._child;
        }
        else {
            this._nextActiveAction = this;
        }
    }
    /**
     * Adds action to chain of actions, may be a DoNothingAction
     * @param action defines the next action to execute
     * @returns The action passed in
     * @see https://www.babylonjs-playground.com/#1T30HR#0
     */
    then(action) {
        this._child = action;
        action._actionManager = this._actionManager;
        action._prepare();
        return action;
    }
    /**
     * Internal only
     * @internal
     */
    _getProperty(propertyPath) {
        return this._actionManager._getProperty(propertyPath);
    }
    /**
     * @internal
     */
    _getEffectiveTarget(target, propertyPath) {
        return this._actionManager._getEffectiveTarget(target, propertyPath);
    }
    /**
     * Serialize placeholder for child classes
     * @param parent of child
     * @returns the serialized object
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    serialize(parent) {
        return null;
    }
    /**
     * Internal only called by serialize
     * @internal
     */
    _serialize(serializedAction, parent) {
        const serializationObject = {
            type: 1,
            children: [],
            name: serializedAction.name,
            properties: serializedAction.properties || [],
        };
        // Serialize child
        if (this._child) {
            this._child.serialize(serializationObject);
        }
        // Check if "this" has a condition
        if (this._condition) {
            const serializedCondition = this._condition.serialize();
            serializedCondition.children.push(serializationObject);
            if (parent) {
                parent.children.push(serializedCondition);
            }
            return serializedCondition;
        }
        if (parent) {
            parent.children.push(serializationObject);
        }
        return serializationObject;
    }
}
/**
 * Internal only
 * @internal
 */
Action._SerializeValueAsString = (value) => {
    if (typeof value === "number") {
        return value.toString();
    }
    if (typeof value === "boolean") {
        return value ? "true" : "false";
    }
    if (value instanceof math_vector/* Vector2 */.I9) {
        return value.x + ", " + value.y;
    }
    if (value instanceof math_vector/* Vector3 */.Pq) {
        return value.x + ", " + value.y + ", " + value.z;
    }
    if (value instanceof math_color/* Color3 */.v9) {
        return value.r + ", " + value.g + ", " + value.b;
    }
    if (value instanceof math_color/* Color4 */.ov) {
        return value.r + ", " + value.g + ", " + value.b + ", " + value.a;
    }
    return value; // string
};
/**
 * Internal only
 * @internal
 */
Action._GetTargetProperty = (target) => {
    return {
        name: "target",
        targetType: target._isMesh
            ? "MeshProperties"
            : target._isLight
                ? "LightProperties"
                : target._isCamera
                    ? "CameraProperties"
                    : target._isMaterial
                        ? "MaterialProperties"
                        : "SceneProperties",
        value: target._isScene ? "Scene" : target.name,
    };
};
(0,typeStore/* RegisterClass */.Y5)("BABYLON.Action", Action);
//# sourceMappingURL=action.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Actions/actionEvent.js
var actionEvent = __webpack_require__(61466);
;// ./node_modules/@babylonjs/core/Actions/condition.js


/**
 * A Condition applied to an Action
 */
class Condition {
    /**
     * Creates a new Condition
     * @param actionManager the manager of the action the condition is applied to
     */
    constructor(actionManager) {
        this._actionManager = actionManager;
    }
    /**
     * Check if the current condition is valid
     * @returns a boolean
     */
    isValid() {
        return true;
    }
    /**
     * @internal
     */
    _getProperty(propertyPath) {
        return this._actionManager._getProperty(propertyPath);
    }
    /**
     * @internal
     */
    _getEffectiveTarget(target, propertyPath) {
        return this._actionManager._getEffectiveTarget(target, propertyPath);
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Serialize placeholder for child classes
     * @returns the serialized object
     */
    serialize() { }
    /**
     * @internal
     */
    _serialize(serializedCondition) {
        return {
            type: 2, // Condition
            children: [],
            name: serializedCondition.name,
            properties: serializedCondition.properties,
        };
    }
}
/**
 * Defines specific conditional operators as extensions of Condition
 */
class ValueCondition extends Condition {
    /**
     * returns the number for IsEqual
     */
    static get IsEqual() {
        return ValueCondition._IsEqual;
    }
    /**
     * Returns the number for IsDifferent
     */
    static get IsDifferent() {
        return ValueCondition._IsDifferent;
    }
    /**
     * Returns the number for IsGreater
     */
    static get IsGreater() {
        return ValueCondition._IsGreater;
    }
    /**
     * Returns the number for IsLesser
     */
    static get IsLesser() {
        return ValueCondition._IsLesser;
    }
    /**
     * Creates a new ValueCondition
     * @param actionManager manager for the action the condition applies to
     * @param target for the action
     * @param propertyPath path to specify the property of the target the conditional operator uses
     * @param value the value compared by the conditional operator against the current value of the property
     * @param operator the conditional operator, default ValueCondition.IsEqual
     */
    constructor(actionManager, target, 
    /** path to specify the property of the target the conditional operator uses  */
    propertyPath, 
    /** the value compared by the conditional operator against the current value of the property */
    value, 
    /** [number] the conditional operator, default ValueCondition.IsEqual */
    operator = ValueCondition.IsEqual) {
        super(actionManager);
        this.propertyPath = propertyPath;
        this.value = value;
        this.operator = operator;
        this._target = target;
        this._effectiveTarget = this._getEffectiveTarget(target, this.propertyPath);
        this._property = this._getProperty(this.propertyPath);
    }
    /**
     * Compares the given value with the property value for the specified conditional operator
     * @returns the result of the comparison
     */
    isValid() {
        switch (this.operator) {
            case ValueCondition.IsGreater:
                return this._effectiveTarget[this._property] > this.value;
            case ValueCondition.IsLesser:
                return this._effectiveTarget[this._property] < this.value;
            case ValueCondition.IsEqual:
            case ValueCondition.IsDifferent: {
                let check;
                if (this.value.equals) {
                    check = this.value.equals(this._effectiveTarget[this._property]);
                }
                else {
                    check = this.value === this._effectiveTarget[this._property];
                }
                return this.operator === ValueCondition.IsEqual ? check : !check;
            }
        }
        return false;
    }
    /**
     * Serialize the ValueCondition into a JSON compatible object
     * @returns serialization object
     */
    serialize() {
        return this._serialize({
            name: "ValueCondition",
            properties: [
                Action._GetTargetProperty(this._target),
                { name: "propertyPath", value: this.propertyPath },
                { name: "value", value: Action._SerializeValueAsString(this.value) },
                { name: "operator", value: ValueCondition.GetOperatorName(this.operator) },
            ],
        });
    }
    /**
     * Gets the name of the conditional operator for the ValueCondition
     * @param operator the conditional operator
     * @returns the name
     */
    static GetOperatorName(operator) {
        switch (operator) {
            case ValueCondition._IsEqual:
                return "IsEqual";
            case ValueCondition._IsDifferent:
                return "IsDifferent";
            case ValueCondition._IsGreater:
                return "IsGreater";
            case ValueCondition._IsLesser:
                return "IsLesser";
            default:
                return "";
        }
    }
}
ValueCondition._IsEqual = 0;
ValueCondition._IsDifferent = 1;
ValueCondition._IsGreater = 2;
ValueCondition._IsLesser = 3;
/**
 * Defines a predicate condition as an extension of Condition
 */
class PredicateCondition extends Condition {
    /**
     * Creates a new PredicateCondition
     * @param actionManager manager for the action the condition applies to
     * @param predicate defines the predicate function used to validate the condition
     */
    constructor(actionManager, 
    /** defines the predicate function used to validate the condition */
    predicate) {
        super(actionManager);
        this.predicate = predicate;
    }
    /**
     * @returns the validity of the predicate condition
     */
    isValid() {
        return this.predicate();
    }
}
/**
 * Defines a state condition as an extension of Condition
 */
class StateCondition extends Condition {
    /**
     * Creates a new StateCondition
     * @param actionManager manager for the action the condition applies to
     * @param target of the condition
     * @param value to compare with target state
     */
    constructor(actionManager, target, 
    /** Value to compare with target state  */
    value) {
        super(actionManager);
        this.value = value;
        this._target = target;
    }
    /**
     * Gets a boolean indicating if the current condition is met
     * @returns the validity of the state
     */
    isValid() {
        return this._target.state === this.value;
    }
    /**
     * Serialize the StateCondition into a JSON compatible object
     * @returns serialization object
     */
    serialize() {
        return this._serialize({
            name: "StateCondition",
            properties: [Action._GetTargetProperty(this._target), { name: "value", value: this.value }],
        });
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ValueCondition", ValueCondition);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PredicateCondition", PredicateCondition);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.StateCondition", StateCondition);
//# sourceMappingURL=condition.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__(51137);
;// ./node_modules/@babylonjs/core/Actions/directActions.js





/**
 * This defines an action responsible to toggle a boolean once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class SwitchBooleanAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param target defines the object containing the boolean
     * @param propertyPath defines the path to the boolean property in the target object
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, target, propertyPath, condition) {
        super(triggerOptions, condition);
        this.propertyPath = propertyPath;
        this._target = this._effectiveTarget = target;
    }
    /** @internal */
    _prepare() {
        this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);
        this._property = this._getProperty(this.propertyPath);
    }
    /**
     * Execute the action toggle the boolean value.
     */
    execute() {
        this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "SwitchBooleanAction",
            properties: [Action._GetTargetProperty(this._target), { name: "propertyPath", value: this.propertyPath }],
        }, parent);
    }
}
/**
 * This defines an action responsible to set a the state field of the target
 *  to a desired value once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class SetStateAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param target defines the object containing the state property
     * @param value defines the value to store in the state field
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, target, value, condition) {
        super(triggerOptions, condition);
        this.value = value;
        this._target = target;
    }
    /**
     * Execute the action and store the value on the target state property.
     */
    execute() {
        this._target.state = this.value;
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "SetStateAction",
            properties: [Action._GetTargetProperty(this._target), { name: "value", value: this.value }],
        }, parent);
    }
}
/**
 * This defines an action responsible to set a property of the target
 *  to a desired value once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class SetValueAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param target defines the object containing the property
     * @param propertyPath defines the path of the property to set in the target
     * @param value defines the value to set in the property
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, target, propertyPath, value, condition) {
        super(triggerOptions, condition);
        this.propertyPath = propertyPath;
        this.value = value;
        this._target = this._effectiveTarget = target;
    }
    /** @internal */
    _prepare() {
        this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);
        this._property = this._getProperty(this.propertyPath);
    }
    /**
     * Execute the action and set the targeted property to the desired value.
     */
    execute() {
        this._effectiveTarget[this._property] = this.value;
        if (this._target.markAsDirty) {
            this._target.markAsDirty(this._property);
        }
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "SetValueAction",
            properties: [
                Action._GetTargetProperty(this._target),
                { name: "propertyPath", value: this.propertyPath },
                { name: "value", value: Action._SerializeValueAsString(this.value) },
            ],
        }, parent);
    }
}
/**
 * This defines an action responsible to increment the target value
 *  to a desired value once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class IncrementValueAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param target defines the object containing the property
     * @param propertyPath defines the path of the property to increment in the target
     * @param value defines the value value we should increment the property by
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, target, propertyPath, value, condition) {
        super(triggerOptions, condition);
        this.propertyPath = propertyPath;
        this.value = value;
        this._target = this._effectiveTarget = target;
    }
    /** @internal */
    _prepare() {
        this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);
        this._property = this._getProperty(this.propertyPath);
        if (typeof this._effectiveTarget[this._property] !== "number") {
            logger/* Logger */.V.Warn("Warning: IncrementValueAction can only be used with number values");
        }
    }
    /**
     * Execute the action and increment the target of the value amount.
     */
    execute() {
        this._effectiveTarget[this._property] += this.value;
        if (this._target.markAsDirty) {
            this._target.markAsDirty(this._property);
        }
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "IncrementValueAction",
            properties: [
                Action._GetTargetProperty(this._target),
                { name: "propertyPath", value: this.propertyPath },
                { name: "value", value: Action._SerializeValueAsString(this.value) },
            ],
        }, parent);
    }
}
/**
 * This defines an action responsible to start an animation once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class PlayAnimationAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param target defines the target animation or animation name
     * @param from defines from where the animation should start (animation frame)
     * @param to defines where the animation should stop (animation frame)
     * @param loop defines if the animation should loop or stop after the first play
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, target, from, to, loop, condition) {
        super(triggerOptions, condition);
        this.from = from;
        this.to = to;
        this.loop = loop;
        this._target = target;
    }
    /** @internal */
    _prepare() { }
    /**
     * Execute the action and play the animation.
     */
    execute() {
        const scene = this._actionManager.getScene();
        scene.beginAnimation(this._target, this.from, this.to, this.loop);
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "PlayAnimationAction",
            properties: [
                Action._GetTargetProperty(this._target),
                { name: "from", value: String(this.from) },
                { name: "to", value: String(this.to) },
                { name: "loop", value: Action._SerializeValueAsString(this.loop) || false },
            ],
        }, parent);
    }
}
/**
 * This defines an action responsible to stop an animation once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class StopAnimationAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param target defines the target animation or animation name
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, target, condition) {
        super(triggerOptions, condition);
        this._target = target;
    }
    /** @internal */
    _prepare() { }
    /**
     * Execute the action and stop the animation.
     */
    execute() {
        const scene = this._actionManager.getScene();
        scene.stopAnimation(this._target);
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "StopAnimationAction",
            properties: [Action._GetTargetProperty(this._target)],
        }, parent);
    }
}
/**
 * This defines an action responsible that does nothing once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class DoNothingAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions = 0, condition) {
        super(triggerOptions, condition);
    }
    /**
     * Execute the action and do nothing.
     */
    execute() { }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "DoNothingAction",
            properties: [],
        }, parent);
    }
}
/**
 * This defines an action responsible to trigger several actions once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class CombineAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param children defines the list of aggregated animations to run
     * @param condition defines the trigger related conditions
     * @param enableChildrenConditions defines if the children actions conditions should be check before execution
     */
    constructor(triggerOptions, children, condition, enableChildrenConditions = true) {
        super(triggerOptions, condition);
        this.children = children;
        this.enableChildrenConditions = enableChildrenConditions;
    }
    /** @internal */
    _prepare() {
        for (let index = 0; index < this.children.length; index++) {
            this.children[index]._actionManager = this._actionManager;
            this.children[index]._prepare();
        }
    }
    /**
     * Execute the action and executes all the aggregated actions.
     * @param evt event to execute
     */
    execute(evt) {
        for (const action of this.children) {
            if (!this.enableChildrenConditions || action._evaluateConditionForCurrentFrame()) {
                action.execute(evt);
            }
        }
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        const serializationObject = super._serialize({
            name: "CombineAction",
            properties: [],
            combine: [],
        }, parent);
        for (let i = 0; i < this.children.length; i++) {
            serializationObject.combine.push(this.children[i].serialize(null));
        }
        return serializationObject;
    }
}
/**
 * This defines an action responsible to run code (external event) once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class ExecuteCodeAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param func defines the callback function to run
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, func, condition) {
        super(triggerOptions, condition);
        this.func = func;
    }
    /**
     * Execute the action and run the attached code.
     * @param evt event to execute
     */
    execute(evt) {
        this.func(evt);
    }
}
/**
 * This defines an action responsible to set the parent property of the target once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class SetParentAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param target defines the target containing the parent property
     * @param parent defines from where the animation should start (animation frame)
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, target, parent, condition) {
        super(triggerOptions, condition);
        this._target = target;
        this._parent = parent;
    }
    /** @internal */
    _prepare() { }
    /**
     * Execute the action and set the parent property.
     */
    execute() {
        if (this._target.parent === this._parent) {
            return;
        }
        const invertParentWorldMatrix = this._parent.getWorldMatrix().clone();
        invertParentWorldMatrix.invert();
        this._target.position = math_vector/* Vector3 */.Pq.TransformCoordinates(this._target.position, invertParentWorldMatrix);
        this._target.parent = this._parent;
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "SetParentAction",
            properties: [Action._GetTargetProperty(this._target), Action._GetTargetProperty(this._parent)],
        }, parent);
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetParentAction", SetParentAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ExecuteCodeAction", ExecuteCodeAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DoNothingAction", DoNothingAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.StopAnimationAction", StopAnimationAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PlayAnimationAction", PlayAnimationAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.IncrementValueAction", IncrementValueAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetValueAction", SetValueAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetStateAction", SetStateAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetParentAction", SetParentAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SwitchBooleanAction", SwitchBooleanAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CombineAction", CombineAction);
//# sourceMappingURL=directActions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engineStore.js
var engineStore = __webpack_require__(6315);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/deepCopier.js
var deepCopier = __webpack_require__(74609);
;// ./node_modules/@babylonjs/core/Actions/actionManager.js











/**
 * Action Manager manages all events to be triggered on a given mesh or the global scene.
 * A single scene can have many Action Managers to handle predefined actions on specific meshes.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class ActionManager extends abstractActionManager/* AbstractActionManager */.G {
    /**
     * Creates a new action manager
     * @param scene defines the hosting scene
     */
    constructor(scene) {
        super();
        scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        if (!scene) {
            return;
        }
        this._scene = scene;
        scene.actionManagers.push(this);
    }
    // Methods
    /**
     * Releases all associated resources
     */
    dispose() {
        const sceneIndex = this._scene.actionManagers.indexOf(this);
        for (let i = 0; i < this.actions.length; i++) {
            const action = this.actions[i];
            ActionManager.Triggers[action.trigger]--;
            if (ActionManager.Triggers[action.trigger] === 0) {
                delete ActionManager.Triggers[action.trigger];
            }
        }
        this.actions.length = 0;
        if (sceneIndex > -1) {
            this._scene.actionManagers.splice(sceneIndex, 1);
        }
        const ownerMeshes = this._scene.meshes.filter((m) => m.actionManager === this);
        for (const ownerMesh of ownerMeshes) {
            ownerMesh.actionManager = null;
        }
    }
    /**
     * Gets hosting scene
     * @returns the hosting scene
     */
    getScene() {
        return this._scene;
    }
    /**
     * Does this action manager handles actions of any of the given triggers
     * @param triggers defines the triggers to be tested
     * @returns a boolean indicating whether one (or more) of the triggers is handled
     */
    hasSpecificTriggers(triggers) {
        for (let index = 0; index < this.actions.length; index++) {
            const action = this.actions[index];
            if (triggers.indexOf(action.trigger) > -1) {
                return true;
            }
        }
        return false;
    }
    /**
     * Does this action manager handles actions of any of the given triggers. This function takes two arguments for
     * speed.
     * @param triggerA defines the trigger to be tested
     * @param triggerB defines the trigger to be tested
     * @returns a boolean indicating whether one (or more) of the triggers is handled
     */
    hasSpecificTriggers2(triggerA, triggerB) {
        for (let index = 0; index < this.actions.length; index++) {
            const action = this.actions[index];
            if (triggerA == action.trigger || triggerB == action.trigger) {
                return true;
            }
        }
        return false;
    }
    /**
     * Does this action manager handles actions of a given trigger
     * @param trigger defines the trigger to be tested
     * @param parameterPredicate defines an optional predicate to filter triggers by parameter
     * @returns whether the trigger is handled
     */
    hasSpecificTrigger(trigger, parameterPredicate) {
        for (let index = 0; index < this.actions.length; index++) {
            const action = this.actions[index];
            if (action.trigger === trigger) {
                if (parameterPredicate) {
                    if (parameterPredicate(action.getTriggerParameter())) {
                        return true;
                    }
                }
                else {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Does this action manager has pointer triggers
     */
    get hasPointerTriggers() {
        for (let index = 0; index < this.actions.length; index++) {
            const action = this.actions[index];
            if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPointerOutTrigger) {
                return true;
            }
        }
        return false;
    }
    /**
     * Does this action manager has pick triggers
     */
    get hasPickTriggers() {
        for (let index = 0; index < this.actions.length; index++) {
            const action = this.actions[index];
            if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPickUpTrigger) {
                return true;
            }
        }
        return false;
    }
    /**
     * Registers an action to this action manager
     * @param action defines the action to be registered
     * @returns the action amended (prepared) after registration
     */
    registerAction(action) {
        if (action.trigger === ActionManager.OnEveryFrameTrigger) {
            if (this.getScene().actionManager !== this) {
                logger/* Logger */.V.Warn("OnEveryFrameTrigger can only be used with scene.actionManager");
                return null;
            }
        }
        this.actions.push(action);
        this.getScene()._registeredActions++;
        if (ActionManager.Triggers[action.trigger]) {
            ActionManager.Triggers[action.trigger]++;
        }
        else {
            ActionManager.Triggers[action.trigger] = 1;
        }
        action._actionManager = this;
        action._prepare();
        return action;
    }
    /**
     * Unregisters an action to this action manager
     * @param action defines the action to be unregistered
     * @returns a boolean indicating whether the action has been unregistered
     */
    unregisterAction(action) {
        const index = this.actions.indexOf(action);
        if (index !== -1) {
            this.actions.splice(index, 1);
            ActionManager.Triggers[action.trigger] -= 1;
            if (ActionManager.Triggers[action.trigger] === 0) {
                delete ActionManager.Triggers[action.trigger];
            }
            action._actionManager = null;
            this.getScene()._registeredActions--;
            return true;
        }
        return false;
    }
    /**
     * Process a specific trigger
     * @param trigger defines the trigger to process
     * @param evt defines the event details to be processed
     */
    processTrigger(trigger, evt) {
        for (let index = 0; index < this.actions.length; index++) {
            const action = this.actions[index];
            if (action.trigger === trigger) {
                if (evt) {
                    if (trigger === ActionManager.OnKeyUpTrigger || trigger === ActionManager.OnKeyDownTrigger) {
                        const parameter = action.getTriggerParameter();
                        if (typeof parameter === "function") {
                            if (!parameter(evt)) {
                                continue;
                            }
                        }
                        else if (parameter && parameter !== evt.sourceEvent.keyCode) {
                            if (!parameter.toLowerCase) {
                                continue;
                            }
                            const lowerCase = parameter.toLowerCase();
                            if (lowerCase !== evt.sourceEvent.key) {
                                const unicode = evt.sourceEvent.charCode ? evt.sourceEvent.charCode : evt.sourceEvent.keyCode;
                                const actualkey = String.fromCharCode(unicode).toLowerCase();
                                if (actualkey !== lowerCase) {
                                    continue;
                                }
                            }
                        }
                    }
                }
                action._executeCurrent(evt);
            }
        }
    }
    /**
     * @internal
     */
    _getEffectiveTarget(target, propertyPath) {
        const properties = propertyPath.split(".");
        for (let index = 0; index < properties.length - 1; index++) {
            target = target[properties[index]];
        }
        return target;
    }
    /**
     * @internal
     */
    _getProperty(propertyPath) {
        const properties = propertyPath.split(".");
        return properties[properties.length - 1];
    }
    /**
     * Serialize this manager to a JSON object
     * @param name defines the property name to store this manager
     * @returns a JSON representation of this manager
     */
    serialize(name) {
        const root = {
            children: new Array(),
            name: name,
            type: 3, // Root node
            properties: new Array(), // Empty for root but required
        };
        for (let i = 0; i < this.actions.length; i++) {
            const triggerObject = {
                type: 0, // Trigger
                children: new Array(),
                name: ActionManager.GetTriggerName(this.actions[i].trigger),
                properties: new Array(),
            };
            const triggerOptions = this.actions[i].triggerOptions;
            if (triggerOptions && typeof triggerOptions !== "number") {
                if (triggerOptions.parameter instanceof Node) {
                    triggerObject.properties.push(Action._GetTargetProperty(triggerOptions.parameter));
                }
                else if (typeof triggerOptions.parameter === "object") {
                    const parameter = {};
                    deepCopier/* DeepCopier */.r.DeepCopy(triggerOptions.parameter, parameter, ["mesh"]);
                    if (triggerOptions.parameter && triggerOptions.parameter.mesh) {
                        parameter._meshId = triggerOptions.parameter.mesh.id;
                    }
                    triggerObject.properties.push({ name: "parameter", targetType: null, value: parameter });
                }
                else {
                    triggerObject.properties.push({ name: "parameter", targetType: null, value: triggerOptions.parameter });
                }
            }
            // Serialize child action, recursively
            this.actions[i].serialize(triggerObject);
            // Add serialized trigger
            root.children.push(triggerObject);
        }
        return root;
    }
    /**
     * Creates a new ActionManager from a JSON data
     * @param parsedActions defines the JSON data to read from
     * @param object defines the hosting mesh
     * @param scene defines the hosting scene
     */
    static Parse(parsedActions, object, scene) {
        const actionManager = new ActionManager(scene);
        if (object === null) {
            scene.actionManager = actionManager;
        }
        else {
            object.actionManager = actionManager;
        }
        // instantiate a new object
        const instantiate = (name, params) => {
            const internalClassType = (0,typeStore/* GetClass */.n9)("BABYLON." + name);
            return internalClassType && new internalClassType(...params);
        };
        const parseParameter = (name, value, target, propertyPath) => {
            if (propertyPath === null) {
                // String, boolean or float
                const floatValue = parseFloat(value);
                if (value === "true" || value === "false") {
                    return value === "true";
                }
                else {
                    return isNaN(floatValue) ? value : floatValue;
                }
            }
            const effectiveTarget = propertyPath.split(".");
            const values = value.split(",");
            // Get effective Target
            for (let i = 0; i < effectiveTarget.length; i++) {
                target = target[effectiveTarget[i]];
            }
            // Return appropriate value with its type
            if (typeof target === "boolean") {
                return values[0] === "true";
            }
            if (typeof target === "string") {
                return values[0];
            }
            // Parameters with multiple values such as Vector3 etc.
            const split = [];
            for (let i = 0; i < values.length; i++) {
                split.push(parseFloat(values[i]));
            }
            if (target instanceof math_vector/* Vector3 */.Pq) {
                return math_vector/* Vector3 */.Pq.FromArray(split);
            }
            if (target instanceof math_vector/* Vector4 */.IU) {
                return math_vector/* Vector4 */.IU.FromArray(split);
            }
            if (target instanceof math_color/* Color3 */.v9) {
                return math_color/* Color3 */.v9.FromArray(split);
            }
            if (target instanceof math_color/* Color4 */.ov) {
                return math_color/* Color4 */.ov.FromArray(split);
            }
            return parseFloat(values[0]);
        };
        // traverse graph per trigger
        const traverse = (parsedAction, trigger, condition, action, combineArray = null) => {
            if (parsedAction.detached) {
                return;
            }
            const parameters = [];
            let target = null;
            let propertyPath = null;
            const combine = parsedAction.combine && parsedAction.combine.length > 0;
            // Parameters
            if (parsedAction.type === 2) {
                parameters.push(actionManager);
            }
            else {
                parameters.push(trigger);
            }
            if (combine) {
                const actions = [];
                for (let j = 0; j < parsedAction.combine.length; j++) {
                    traverse(parsedAction.combine[j], ActionManager.NothingTrigger, condition, action, actions);
                }
                parameters.push(actions);
            }
            else {
                for (let i = 0; i < parsedAction.properties.length; i++) {
                    let value = parsedAction.properties[i].value;
                    const name = parsedAction.properties[i].name;
                    const targetType = parsedAction.properties[i].targetType;
                    if (name === "target") {
                        if (targetType === "SceneProperties") {
                            value = target = scene;
                        }
                        else if (targetType === "MaterialProperties") {
                            value = target = scene.getMaterialByName(value);
                        }
                        else {
                            value = target = scene.getNodeByName(value);
                        }
                    }
                    else if (name === "parent") {
                        value = scene.getNodeByName(value);
                    }
                    else if (name === "sound") {
                        // Can not externalize to component, so only checks for the presence off the API.
                        if (scene.getSoundByName) {
                            value = scene.getSoundByName(value);
                        }
                    }
                    else if (name !== "propertyPath") {
                        if (parsedAction.type === 2 && name === "operator") {
                            value = ValueCondition[value];
                        }
                        else {
                            value = parseParameter(name, value, target, name === "value" ? propertyPath : null);
                        }
                    }
                    else {
                        propertyPath = value;
                    }
                    parameters.push(value);
                }
            }
            if (combineArray === null) {
                parameters.push(condition);
            }
            else {
                parameters.push(null);
            }
            // If interpolate value action
            if (parsedAction.name === "InterpolateValueAction") {
                const param = parameters[parameters.length - 2];
                parameters[parameters.length - 1] = param;
                parameters[parameters.length - 2] = condition;
            }
            // Action or condition(s) and not CombineAction
            let newAction = instantiate(parsedAction.name, parameters);
            if (newAction instanceof Condition && condition !== null) {
                const nothing = new DoNothingAction(trigger, condition);
                if (action) {
                    action.then(nothing);
                }
                else {
                    actionManager.registerAction(nothing);
                }
                action = nothing;
            }
            if (combineArray === null) {
                if (newAction instanceof Condition) {
                    condition = newAction;
                    newAction = action;
                }
                else {
                    condition = null;
                    if (action) {
                        action.then(newAction);
                    }
                    else {
                        actionManager.registerAction(newAction);
                    }
                }
            }
            else {
                combineArray.push(newAction);
            }
            for (let i = 0; i < parsedAction.children.length; i++) {
                traverse(parsedAction.children[i], trigger, condition, newAction, null);
            }
        };
        // triggers
        for (let i = 0; i < parsedActions.children.length; i++) {
            let triggerParams;
            const trigger = parsedActions.children[i];
            if (trigger.properties.length > 0) {
                const param = trigger.properties[0].value;
                const value = trigger.properties[0].targetType === null ? param : scene.getMeshByName(param);
                if (value._meshId) {
                    value.mesh = scene.getMeshById(value._meshId);
                }
                triggerParams = { trigger: ActionManager[trigger.name], parameter: value };
            }
            else {
                triggerParams = ActionManager[trigger.name];
            }
            for (let j = 0; j < trigger.children.length; j++) {
                if (!trigger.detached) {
                    traverse(trigger.children[j], triggerParams, null, null);
                }
            }
        }
    }
    /**
     * Get a trigger name by index
     * @param trigger defines the trigger index
     * @returns a trigger name
     */
    static GetTriggerName(trigger) {
        switch (trigger) {
            case 0:
                return "NothingTrigger";
            case 1:
                return "OnPickTrigger";
            case 2:
                return "OnLeftPickTrigger";
            case 3:
                return "OnRightPickTrigger";
            case 4:
                return "OnCenterPickTrigger";
            case 5:
                return "OnPickDownTrigger";
            case 6:
                return "OnDoublePickTrigger"; // start;
            case 7:
                return "OnPickUpTrigger";
            case 8:
                return "OnLongPressTrigger";
            case 9:
                return "OnPointerOverTrigger";
            case 10:
                return "OnPointerOutTrigger";
            case 11:
                return "OnEveryFrameTrigger";
            case 12:
                return "OnIntersectionEnterTrigger";
            case 13:
                return "OnIntersectionExitTrigger";
            case 14:
                return "OnKeyDownTrigger";
            case 15:
                return "OnKeyUpTrigger";
            case 16:
                return "OnPickOutTrigger";
            default:
                return "";
        }
    }
}
/**
 * Nothing
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.NothingTrigger = 0;
/**
 * On pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnPickTrigger = 1;
/**
 * On left pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnLeftPickTrigger = 2;
/**
 * On right pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnRightPickTrigger = 3;
/**
 * On center pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnCenterPickTrigger = 4;
/**
 * On pick down
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnPickDownTrigger = 5;
/**
 * On double pick
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnDoublePickTrigger = 6;
/**
 * On pick up
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnPickUpTrigger = 7;
/**
 * On pick out.
 * This trigger will only be raised if you also declared a OnPickDown
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnPickOutTrigger = 16;
/**
 * On long press
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnLongPressTrigger = 8;
/**
 * On pointer over
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnPointerOverTrigger = 9;
/**
 * On pointer out
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnPointerOutTrigger = 10;
/**
 * On every frame
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnEveryFrameTrigger = 11;
/**
 * On intersection enter
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnIntersectionEnterTrigger = 12;
/**
 * On intersection exit
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnIntersectionExitTrigger = 13;
/**
 * On key down
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnKeyDownTrigger = 14;
/**
 * On key up
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#triggers
 */
ActionManager.OnKeyUpTrigger = 15;
//# sourceMappingURL=actionManager.js.map
;// ./node_modules/@babylonjs/core/Actions/directAudioActions.js


/**
 * This defines an action helpful to play a defined sound on a triggered action.
 */
class PlaySoundAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param sound defines the sound to play
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, sound, condition) {
        super(triggerOptions, condition);
        this._sound = sound;
    }
    /** @internal */
    _prepare() { }
    /**
     * Execute the action and play the sound.
     */
    execute() {
        if (this._sound !== undefined) {
            this._sound.play();
        }
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "PlaySoundAction",
            properties: [{ name: "sound", value: this._sound.name }],
        }, parent);
    }
}
/**
 * This defines an action helpful to stop a defined sound on a triggered action.
 */
class StopSoundAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param sound defines the sound to stop
     * @param condition defines the trigger related conditions
     */
    constructor(triggerOptions, sound, condition) {
        super(triggerOptions, condition);
        this._sound = sound;
    }
    /** @internal */
    _prepare() { }
    /**
     * Execute the action and stop the sound.
     */
    execute() {
        if (this._sound !== undefined) {
            this._sound.stop();
        }
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "StopSoundAction",
            properties: [{ name: "sound", value: this._sound.name }],
        }, parent);
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PlaySoundAction", PlaySoundAction);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.StopSoundAction", StopSoundAction);
//# sourceMappingURL=directAudioActions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animation.js
var Animations_animation = __webpack_require__(7540);
;// ./node_modules/@babylonjs/core/Actions/interpolateValueAction.js







/**
 * This defines an action responsible to change the value of a property
 * by interpolating between its current value and the newly set one once triggered.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
 */
class InterpolateValueAction extends Action {
    /**
     * Instantiate the action
     * @param triggerOptions defines the trigger options
     * @param target defines the object containing the value to interpolate
     * @param propertyPath defines the path to the property in the target object
     * @param value defines the target value at the end of the interpolation
     * @param duration defines the time it will take for the property to interpolate to the value.
     * @param condition defines the trigger related conditions
     * @param stopOtherAnimations defines if the other scene animations should be stopped when the action has been triggered
     * @param onInterpolationDone defines a callback raised once the interpolation animation has been done
     */
    constructor(triggerOptions, target, propertyPath, value, duration = 1000, condition, stopOtherAnimations, onInterpolationDone) {
        super(triggerOptions, condition);
        /**
         * Defines the time it will take for the property to interpolate to the value.
         */
        this.duration = 1000;
        /**
         * Observable triggered once the interpolation animation has been done.
         */
        this.onInterpolationDoneObservable = new Misc_observable/* Observable */.cP();
        this.propertyPath = propertyPath;
        this.value = value;
        this.duration = duration;
        this.stopOtherAnimations = stopOtherAnimations;
        this.onInterpolationDone = onInterpolationDone;
        this._target = this._effectiveTarget = target;
    }
    /** @internal */
    _prepare() {
        this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);
        this._property = this._getProperty(this.propertyPath);
    }
    /**
     * Execute the action starts the value interpolation.
     */
    execute() {
        const scene = this._actionManager.getScene();
        const keys = [
            {
                frame: 0,
                value: this._effectiveTarget[this._property],
            },
            {
                frame: 100,
                value: this.value,
            },
        ];
        let dataType;
        if (typeof this.value === "number") {
            dataType = Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT;
        }
        else if (this.value instanceof math_color/* Color3 */.v9) {
            dataType = Animations_animation/* Animation */.X5.ANIMATIONTYPE_COLOR3;
        }
        else if (this.value instanceof math_vector/* Vector3 */.Pq) {
            dataType = Animations_animation/* Animation */.X5.ANIMATIONTYPE_VECTOR3;
        }
        else if (this.value instanceof math_vector/* Matrix */.uq) {
            dataType = Animations_animation/* Animation */.X5.ANIMATIONTYPE_MATRIX;
        }
        else if (this.value instanceof math_vector/* Quaternion */.PT) {
            dataType = Animations_animation/* Animation */.X5.ANIMATIONTYPE_QUATERNION;
        }
        else {
            logger/* Logger */.V.Warn("InterpolateValueAction: Unsupported type (" + typeof this.value + ")");
            return;
        }
        const animation = new Animations_animation/* Animation */.X5("InterpolateValueAction", this._property, 100 * (1000.0 / this.duration), dataType, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        animation.setKeys(keys);
        if (this.stopOtherAnimations) {
            scene.stopAnimation(this._effectiveTarget);
        }
        const wrapper = () => {
            this.onInterpolationDoneObservable.notifyObservers(this);
            if (this.onInterpolationDone) {
                this.onInterpolationDone();
            }
        };
        scene.beginDirectAnimation(this._effectiveTarget, [animation], 0, 100, false, 1, wrapper);
    }
    /**
     * Serializes the actions and its related information.
     * @param parent defines the object to serialize in
     * @returns the serialized object
     */
    serialize(parent) {
        return super._serialize({
            name: "InterpolateValueAction",
            properties: [
                Action._GetTargetProperty(this._target),
                { name: "propertyPath", value: this.propertyPath },
                { name: "value", value: Action._SerializeValueAsString(this.value) },
                { name: "duration", value: Action._SerializeValueAsString(this.duration) },
                { name: "stopOtherAnimations", value: Action._SerializeValueAsString(this.stopOtherAnimations) || false },
            ],
        }, parent);
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.InterpolateValueAction", InterpolateValueAction);
//# sourceMappingURL=interpolateValueAction.js.map
;// ./node_modules/@babylonjs/core/Actions/index.js








//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animatable.js + 1 modules
var animatable = __webpack_require__(6903);
;// ./node_modules/@babylonjs/core/Animations/animationPropertiesOverride.js

/**
 * Class used to override all child animations of a given target
 */
class AnimationPropertiesOverride {
    constructor() {
        /**
         * Gets or sets a value indicating if animation blending must be used
         */
        this.enableBlending = false;
        /**
         * Gets or sets the blending speed to use when enableBlending is true
         */
        this.blendingSpeed = 0.01;
        /**
         * Gets or sets the default loop mode to use
         */
        this.loopMode = Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CYCLE;
    }
}
//# sourceMappingURL=animationPropertiesOverride.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.path.js
var math_path = __webpack_require__(21903);
;// ./node_modules/@babylonjs/core/Animations/easing.js

/**
 * Base class used for every default easing function.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class EasingFunction {
    constructor() {
        this._easingMode = EasingFunction.EASINGMODE_EASEIN;
    }
    /**
     * Sets the easing mode of the current function.
     * @param easingMode Defines the willing mode (EASINGMODE_EASEIN, EASINGMODE_EASEOUT or EASINGMODE_EASEINOUT)
     */
    setEasingMode(easingMode) {
        const n = Math.min(Math.max(easingMode, 0), 2);
        this._easingMode = n;
    }
    /**
     * Gets the current easing mode.
     * @returns the easing mode
     */
    getEasingMode() {
        return this._easingMode;
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    easeInCore(gradient) {
        throw new Error("You must implement this method");
    }
    /**
     * Given an input gradient between 0 and 1, this returns the corresponding value
     * of the easing function.
     * @param gradient Defines the value between 0 and 1 we want the easing value for
     * @returns the corresponding value on the curve defined by the easing function
     */
    ease(gradient) {
        switch (this._easingMode) {
            case EasingFunction.EASINGMODE_EASEIN:
                return this.easeInCore(gradient);
            case EasingFunction.EASINGMODE_EASEOUT:
                return 1 - this.easeInCore(1 - gradient);
        }
        if (gradient >= 0.5) {
            return (1 - this.easeInCore((1 - gradient) * 2)) * 0.5 + 0.5;
        }
        return this.easeInCore(gradient * 2) * 0.5;
    }
}
/**
 * Interpolation follows the mathematical formula associated with the easing function.
 */
EasingFunction.EASINGMODE_EASEIN = 0;
/**
 * Interpolation follows 100% interpolation minus the output of the formula associated with the easing function.
 */
EasingFunction.EASINGMODE_EASEOUT = 1;
/**
 * Interpolation uses EaseIn for the first half of the animation and EaseOut for the second half.
 */
EasingFunction.EASINGMODE_EASEINOUT = 2;
/**
 * Easing function with a circle shape (see link below).
 * @see https://easings.net/#easeInCirc
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class CircleEase extends EasingFunction {
    /**
     * @internal
     */
    easeInCore(gradient) {
        gradient = Math.max(0, Math.min(1, gradient));
        return 1.0 - Math.sqrt(1.0 - gradient * gradient);
    }
}
/**
 * Easing function with a ease back shape (see link below).
 * @see https://easings.net/#easeInBack
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class BackEase extends EasingFunction {
    /**
     * Instantiates a back ease easing
     * @see https://easings.net/#easeInBack
     * @param amplitude Defines the amplitude of the function
     */
    constructor(
    /** [1] Defines the amplitude of the function */
    amplitude = 1) {
        super();
        this.amplitude = amplitude;
    }
    /**
     * @internal
     */
    easeInCore(gradient) {
        const num = Math.max(0, this.amplitude);
        return Math.pow(gradient, 3.0) - gradient * num * Math.sin(3.1415926535897931 * gradient);
    }
}
/**
 * Easing function with a bouncing shape (see link below).
 * @see https://easings.net/#easeInBounce
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class BounceEase extends EasingFunction {
    /**
     * Instantiates a bounce easing
     * @see https://easings.net/#easeInBounce
     * @param bounces Defines the number of bounces
     * @param bounciness Defines the amplitude of the bounce
     */
    constructor(
    /** [3] Defines the number of bounces */
    bounces = 3, 
    /** [2] Defines the amplitude of the bounce */
    bounciness = 2) {
        super();
        this.bounces = bounces;
        this.bounciness = bounciness;
    }
    /**
     * @internal
     */
    easeInCore(gradient) {
        const y = Math.max(0.0, this.bounces);
        let bounciness = this.bounciness;
        if (bounciness <= 1.0) {
            bounciness = 1.001;
        }
        const num9 = Math.pow(bounciness, y);
        const num5 = 1.0 - bounciness;
        const num4 = (1.0 - num9) / num5 + num9 * 0.5;
        const num15 = gradient * num4;
        const num65 = Math.log(-num15 * (1.0 - bounciness) + 1.0) / Math.log(bounciness);
        const num3 = Math.floor(num65);
        const num13 = num3 + 1.0;
        const num8 = (1.0 - Math.pow(bounciness, num3)) / (num5 * num4);
        const num12 = (1.0 - Math.pow(bounciness, num13)) / (num5 * num4);
        const num7 = (num8 + num12) * 0.5;
        const num6 = gradient - num7;
        const num2 = num7 - num8;
        return (-Math.pow(1.0 / bounciness, y - num3) / (num2 * num2)) * (num6 - num2) * (num6 + num2);
    }
}
/**
 * Easing function with a power of 3 shape (see link below).
 * @see https://easings.net/#easeInCubic
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class CubicEase extends EasingFunction {
    /**
     * @internal
     */
    easeInCore(gradient) {
        return gradient * gradient * gradient;
    }
}
/**
 * Easing function with an elastic shape (see link below).
 * @see https://easings.net/#easeInElastic
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class ElasticEase extends EasingFunction {
    /**
     * Instantiates an elastic easing function
     * @see https://easings.net/#easeInElastic
     * @param oscillations Defines the number of oscillations
     * @param springiness Defines the amplitude of the oscillations
     */
    constructor(
    /** [3] Defines the number of oscillations*/
    oscillations = 3, 
    /** [3] Defines the amplitude of the oscillations*/
    springiness = 3) {
        super();
        this.oscillations = oscillations;
        this.springiness = springiness;
    }
    /**
     * @internal
     */
    easeInCore(gradient) {
        let num2;
        const num3 = Math.max(0.0, this.oscillations);
        const num = Math.max(0.0, this.springiness);
        if (num == 0) {
            num2 = gradient;
        }
        else {
            num2 = (Math.exp(num * gradient) - 1.0) / (Math.exp(num) - 1.0);
        }
        return num2 * Math.sin((6.2831853071795862 * num3 + 1.5707963267948966) * gradient);
    }
}
/**
 * Easing function with an exponential shape (see link below).
 * @see https://easings.net/#easeInExpo
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class ExponentialEase extends EasingFunction {
    /**
     * Instantiates an exponential easing function
     * @see https://easings.net/#easeInExpo
     * @param exponent Defines the exponent of the function
     */
    constructor(
    /** [3] Defines the exponent of the function */
    exponent = 2) {
        super();
        this.exponent = exponent;
    }
    /**
     * @internal
     */
    easeInCore(gradient) {
        if (this.exponent <= 0) {
            return gradient;
        }
        return (Math.exp(this.exponent * gradient) - 1.0) / (Math.exp(this.exponent) - 1.0);
    }
}
/**
 * Easing function with a power shape (see link below).
 * @see https://easings.net/#easeInQuad
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class PowerEase extends EasingFunction {
    /**
     * Instantiates an power base easing function
     * @see https://easings.net/#easeInQuad
     * @param power Defines the power of the function
     */
    constructor(
    /** [2] Defines the power of the function */
    power = 2) {
        super();
        this.power = power;
    }
    /**
     * @internal
     */
    easeInCore(gradient) {
        const y = Math.max(0.0, this.power);
        return Math.pow(gradient, y);
    }
}
/**
 * Easing function with a power of 2 shape (see link below).
 * @see https://easings.net/#easeInQuad
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class QuadraticEase extends EasingFunction {
    /**
     * @internal
     */
    easeInCore(gradient) {
        return gradient * gradient;
    }
}
/**
 * Easing function with a power of 4 shape (see link below).
 * @see https://easings.net/#easeInQuart
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class QuarticEase extends EasingFunction {
    /**
     * @internal
     */
    easeInCore(gradient) {
        return gradient * gradient * gradient * gradient;
    }
}
/**
 * Easing function with a power of 5 shape (see link below).
 * @see https://easings.net/#easeInQuint
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class QuinticEase extends EasingFunction {
    /**
     * @internal
     */
    easeInCore(gradient) {
        return gradient * gradient * gradient * gradient * gradient;
    }
}
/**
 * Easing function with a sin shape (see link below).
 * @see https://easings.net/#easeInSine
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class SineEase extends EasingFunction {
    /**
     * @internal
     */
    easeInCore(gradient) {
        return 1.0 - Math.sin(1.5707963267948966 * (1.0 - gradient));
    }
}
/**
 * Easing function with a bezier shape (see link below).
 * @see http://cubic-bezier.com/#.17,.67,.83,.67
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#easing-functions
 */
class BezierCurveEase extends EasingFunction {
    /**
     * Instantiates a bezier function
     * @see http://cubic-bezier.com/#.17,.67,.83,.67
     * @param x1 Defines the x component of the start tangent in the bezier curve
     * @param y1 Defines the y component of the start tangent in the bezier curve
     * @param x2 Defines the x component of the end tangent in the bezier curve
     * @param y2 Defines the y component of the end tangent in the bezier curve
     */
    constructor(
    /** [0] Defines the x component of the start tangent in the bezier curve */
    x1 = 0, 
    /** [0] Defines the y component of the start tangent in the bezier curve */
    y1 = 0, 
    /** [1] Defines the x component of the end tangent in the bezier curve */
    x2 = 1, 
    /** [1] Defines the y component of the end tangent in the bezier curve */
    y2 = 1) {
        super();
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
    }
    /**
     * @internal
     */
    easeInCore(gradient) {
        return math_path/* BezierCurve */.vr.Interpolate(gradient, this.x1, this.y1, this.x2, this.y2);
    }
}
//# sourceMappingURL=easing.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/runtimeAnimation.js
var runtimeAnimation = __webpack_require__(27266);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationEvent.js
var animationEvent = __webpack_require__(35238);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationGroup.js
var Animations_animationGroup = __webpack_require__(97689);
;// ./node_modules/@babylonjs/core/Animations/animationKey.js
/**
 * Enum for the animation key frame interpolation type
 */
var AnimationKeyInterpolation;
(function (AnimationKeyInterpolation) {
    /**
     * Use tangents to interpolate between start and end values.
     */
    AnimationKeyInterpolation[AnimationKeyInterpolation["NONE"] = 0] = "NONE";
    /**
     * Do not interpolate between keys and use the start key value only. Tangents are ignored
     */
    AnimationKeyInterpolation[AnimationKeyInterpolation["STEP"] = 1] = "STEP";
})(AnimationKeyInterpolation || (AnimationKeyInterpolation = {}));
//# sourceMappingURL=animationKey.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Animations/animationRange.js
var animationRange = __webpack_require__(56227);
;// ./node_modules/@babylonjs/core/Animations/animatable.interface.js

//# sourceMappingURL=animatable.interface.js.map
;// ./node_modules/@babylonjs/core/Animations/pathCursor.js

/**
 * A cursor which tracks a point on a path
 */
class PathCursor {
    /**
     * Initializes the path cursor
     * @param _path The path to track
     */
    constructor(_path) {
        this._path = _path;
        /**
         * Stores path cursor callbacks for when an onchange event is triggered
         */
        this._onchange = new Array();
        /**
         * The value of the path cursor
         */
        this.value = 0;
        /**
         * The animation array of the path cursor
         */
        this.animations = [];
    }
    /**
     * Gets the cursor point on the path
     * @returns A point on the path cursor at the cursor location
     */
    getPoint() {
        const point = this._path.getPointAtLengthPosition(this.value);
        return new math_vector/* Vector3 */.Pq(point.x, 0, point.y);
    }
    /**
     * Moves the cursor ahead by the step amount
     * @param step The amount to move the cursor forward
     * @returns This path cursor
     */
    moveAhead(step = 0.002) {
        this.move(step);
        return this;
    }
    /**
     * Moves the cursor behind by the step amount
     * @param step The amount to move the cursor back
     * @returns This path cursor
     */
    moveBack(step = 0.002) {
        this.move(-step);
        return this;
    }
    /**
     * Moves the cursor by the step amount
     * If the step amount is greater than one, an exception is thrown
     * @param step The amount to move the cursor
     * @returns This path cursor
     */
    move(step) {
        if (Math.abs(step) > 1) {
            // eslint-disable-next-line no-throw-literal
            throw "step size should be less than 1.";
        }
        this.value += step;
        this._ensureLimits();
        this._raiseOnChange();
        return this;
    }
    /**
     * Ensures that the value is limited between zero and one
     * @returns This path cursor
     */
    _ensureLimits() {
        while (this.value > 1) {
            this.value -= 1;
        }
        while (this.value < 0) {
            this.value += 1;
        }
        return this;
    }
    /**
     * Runs onchange callbacks on change (used by the animation engine)
     * @returns This path cursor
     */
    _raiseOnChange() {
        this._onchange.forEach((f) => f(this));
        return this;
    }
    /**
     * Executes a function on change
     * @param f A path cursor onchange callback
     * @returns This path cursor
     */
    onchange(f) {
        this._onchange.push(f);
        return this;
    }
}
//# sourceMappingURL=pathCursor.js.map
;// ./node_modules/@babylonjs/core/Animations/animationGroupMask.js
/**
 * Enum used to define the mode for an animation group mask
 */
var AnimationGroupMaskMode;
(function (AnimationGroupMaskMode) {
    /**
     * The mask defines the animatable target names that should be included
     */
    AnimationGroupMaskMode[AnimationGroupMaskMode["Include"] = 0] = "Include";
    /**
     * The mask defines the animatable target names in a "exclude" mode: all animatable targets will be animated except the ones defined in the mask
     */
    AnimationGroupMaskMode[AnimationGroupMaskMode["Exclude"] = 1] = "Exclude";
})(AnimationGroupMaskMode || (AnimationGroupMaskMode = {}));
/**
 * Defines a mask used to filter animation targets.
 * If you apply a mask to an animation group (see the AnimationGroup.mask property), only the animations whose target names match the mask will play.
 * Note that a target is defined by its name (string). This means that the same mask can be used for several animation groups, provided that their targets are named in the same way.
 */
class AnimationGroupMask {
    /**
     * Creates a new mask
     * @param names The list of target names to add to the mask (optional)
     * @param mode Defines the mode for the mask (default: AnimationGroupMaskMode.Include)
     */
    constructor(names, 
    /**
     * [0] Defines the mode for the mask
     */
    mode = 0 /* AnimationGroupMaskMode.Include */) {
        this.mode = mode;
        /**
         * Gets or sets a boolean indicating if the mask is disabled (default is false)
         */
        this.disabled = false;
        this._targetNames = new Set();
        if (names) {
            this.addTargetName(names);
        }
    }
    /**
     * Adds one or several target names to the mask
     * @param name The name(s) to add to the mask
     */
    addTargetName(name) {
        if (Array.isArray(name)) {
            for (const n of name) {
                this._targetNames.add(n);
            }
            return;
        }
        this._targetNames.add(name);
    }
    /**
     * Removes one or several target names from the mask
     * @param name The name(s) to remove from the mask
     */
    removeTargetName(name) {
        if (Array.isArray(name)) {
            for (const n of name) {
                this._targetNames.delete(n);
            }
            return;
        }
        this._targetNames.delete(name);
    }
    /**
     * Checks if the mask includes a target name.
     * This method is intended to know if a given target name is included in the mask, not if the name is actually retained by the mask (see retainsTarget() instead).
     * @param name The name to check with the mask
     * @returns True if the mask includes the name, false otherwise
     */
    hasTarget(name) {
        return this._targetNames.has(name);
    }
    /**
     * Checks if the mask retains a target name.
     * Note that in the "Exclude" mode, this will return false if the mask includes the name, and true otherwise!
     * This method is intended to know if a given target name is retained by the mask, not if the name is in the list of target names.
     * @param name The name to check with the mask
     * @returns True if the mask retains the name, false otherwise
     */
    retainsTarget(name) {
        return this._targetNames.has(name) === (this.mode === 0 /* AnimationGroupMaskMode.Include */);
    }
}
//# sourceMappingURL=animationGroupMask.js.map
;// ./node_modules/@babylonjs/core/Animations/index.js












//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/assetContainer.js
var assetContainer = __webpack_require__(97889);
;// ./node_modules/@babylonjs/core/Audio/Interfaces/IAudioEngine.js

//# sourceMappingURL=IAudioEngine.js.map
;// ./node_modules/@babylonjs/core/Audio/Interfaces/ISoundOptions.js

//# sourceMappingURL=ISoundOptions.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__(998);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/abstractEngine.js
var abstractEngine = __webpack_require__(32206);
;// ./node_modules/@babylonjs/core/Audio/analyser.js



/**
 * Class used to work with sound analyzer using fast fourier transform (FFT)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic
 */
class Analyser {
    /**
     * Creates a new analyser
     * @param scene defines hosting scene
     */
    constructor(scene) {
        /**
         * Gets or sets the smoothing
         * @ignorenaming
         */
        this.SMOOTHING = 0.75;
        /**
         * Gets or sets the FFT table size
         * @ignorenaming
         */
        this.FFT_SIZE = 512;
        /**
         * Gets or sets the bar graph amplitude
         * @ignorenaming
         */
        this.BARGRAPHAMPLITUDE = 256;
        /**
         * Gets or sets the position of the debug canvas
         * @ignorenaming
         */
        this.DEBUGCANVASPOS = { x: 20, y: 20 };
        /**
         * Gets or sets the debug canvas size
         * @ignorenaming
         */
        this.DEBUGCANVASSIZE = { width: 320, height: 200 };
        scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        if (!scene) {
            return;
        }
        this._scene = scene;
        if (!abstractEngine/* AbstractEngine */.$.audioEngine) {
            tools/* Tools */.S0.Warn("No audio engine initialized, failed to create an audio analyser");
            return;
        }
        this._audioEngine = abstractEngine/* AbstractEngine */.$.audioEngine;
        if (this._audioEngine.canUseWebAudio && this._audioEngine.audioContext) {
            this._webAudioAnalyser = this._audioEngine.audioContext.createAnalyser();
            this._webAudioAnalyser.minDecibels = -140;
            this._webAudioAnalyser.maxDecibels = 0;
            this._byteFreqs = new Uint8Array(this._webAudioAnalyser.frequencyBinCount);
            this._byteTime = new Uint8Array(this._webAudioAnalyser.frequencyBinCount);
            this._floatFreqs = new Float32Array(this._webAudioAnalyser.frequencyBinCount);
        }
    }
    /**
     * Get the number of data values you will have to play with for the visualization
     * @see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/frequencyBinCount
     * @returns a number
     */
    getFrequencyBinCount() {
        if (this._audioEngine.canUseWebAudio) {
            return this._webAudioAnalyser.frequencyBinCount;
        }
        else {
            return 0;
        }
    }
    /**
     * Gets the current frequency data as a byte array
     * @see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData
     * @returns a Uint8Array
     */
    getByteFrequencyData() {
        if (this._audioEngine.canUseWebAudio) {
            this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
            this._webAudioAnalyser.fftSize = this.FFT_SIZE;
            this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
        }
        return this._byteFreqs;
    }
    /**
     * Gets the current waveform as a byte array
     * @see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteTimeDomainData
     * @returns a Uint8Array
     */
    getByteTimeDomainData() {
        if (this._audioEngine.canUseWebAudio) {
            this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
            this._webAudioAnalyser.fftSize = this.FFT_SIZE;
            this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
        }
        return this._byteTime;
    }
    /**
     * Gets the current frequency data as a float array
     * @see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData
     * @returns a Float32Array
     */
    getFloatFrequencyData() {
        if (this._audioEngine.canUseWebAudio) {
            this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
            this._webAudioAnalyser.fftSize = this.FFT_SIZE;
            this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
        }
        return this._floatFreqs;
    }
    /**
     * Renders the debug canvas
     */
    drawDebugCanvas() {
        if (this._audioEngine.canUseWebAudio) {
            if (!this._debugCanvas) {
                this._debugCanvas = document.createElement("canvas");
                this._debugCanvas.width = this.DEBUGCANVASSIZE.width;
                this._debugCanvas.height = this.DEBUGCANVASSIZE.height;
                this._debugCanvas.style.position = "absolute";
                this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px";
                this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px";
                this._debugCanvasContext = this._debugCanvas.getContext("2d");
                document.body.appendChild(this._debugCanvas);
                this._registerFunc = () => {
                    this.drawDebugCanvas();
                };
                this._scene.registerBeforeRender(this._registerFunc);
            }
            if (this._registerFunc && this._debugCanvasContext) {
                const workingArray = this.getByteFrequencyData();
                this._debugCanvasContext.fillStyle = "rgb(0, 0, 0)";
                this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);
                // Draw the frequency domain chart.
                for (let i = 0; i < this.getFrequencyBinCount(); i++) {
                    const value = workingArray[i];
                    const percent = value / this.BARGRAPHAMPLITUDE;
                    const height = this.DEBUGCANVASSIZE.height * percent;
                    const offset = this.DEBUGCANVASSIZE.height - height - 1;
                    const barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount();
                    const hue = (i / this.getFrequencyBinCount()) * 360;
                    this._debugCanvasContext.fillStyle = "hsl(" + hue + ", 100%, 50%)";
                    this._debugCanvasContext.fillRect(i * barWidth, offset, barWidth, height);
                }
            }
        }
    }
    /**
     * Stops rendering the debug canvas and removes it
     */
    stopDebugCanvas() {
        if (this._debugCanvas) {
            if (this._registerFunc) {
                this._scene.unregisterBeforeRender(this._registerFunc);
                this._registerFunc = null;
            }
            document.body.removeChild(this._debugCanvas);
            this._debugCanvas = null;
            this._debugCanvasContext = null;
        }
    }
    /**
     * Connects two audio nodes
     * @param inputAudioNode defines first node to connect
     * @param outputAudioNode defines second node to connect
     */
    connectAudioNodes(inputAudioNode, outputAudioNode) {
        if (this._audioEngine.canUseWebAudio) {
            inputAudioNode.connect(this._webAudioAnalyser);
            this._webAudioAnalyser.connect(outputAudioNode);
        }
    }
    /**
     * Releases all associated resources
     */
    dispose() {
        if (this._audioEngine.canUseWebAudio) {
            this._webAudioAnalyser.disconnect();
        }
    }
}
//# sourceMappingURL=analyser.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Audio/audioEngine.js
var audioEngine = __webpack_require__(47841);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Audio/audioSceneComponent.js
var audioSceneComponent = __webpack_require__(69440);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Audio/sound.js
var sound = __webpack_require__(23938);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Audio/soundTrack.js
var soundTrack = __webpack_require__(68415);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Audio/weightedsound.js
var weightedsound = __webpack_require__(69645);
;// ./node_modules/@babylonjs/core/Audio/index.js








//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/tslib.es6.js
var tslib_es6 = __webpack_require__(75524);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/decorators.js
var decorators = __webpack_require__(79259);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/decorators.serialization.js
var decorators_serialization = __webpack_require__(26877);
;// ./node_modules/@babylonjs/core/BakedVertexAnimation/bakedVertexAnimationManager.js





/**
 * This class is used to animate meshes using a baked vertex animation texture
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/baked_texture_animations
 * @since 5.0
 */
class BakedVertexAnimationManager {
    /**
     * Creates a new BakedVertexAnimationManager
     * @param scene defines the current scene
     */
    constructor(scene) {
        this._texture = null;
        this._isEnabled = true;
        /**
         * Enable or disable the vertex animation manager
         */
        this.isEnabled = true;
        /**
         * The time counter, to pick the correct animation frame.
         */
        this.time = 0;
        scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        if (!scene) {
            return;
        }
        this._scene = scene;
        this.animationParameters = new math_vector/* Vector4 */.IU(0, 0, 0, 30);
    }
    /** @internal */
    _markSubMeshesAsAttributesDirty() {
        for (const mesh of this._scene.meshes) {
            if (mesh.bakedVertexAnimationManager === this) {
                mesh._markSubMeshesAsAttributesDirty();
            }
        }
    }
    /**
     * Binds to the effect.
     * @param effect The effect to bind to.
     * @param useInstances True when it's an instance.
     */
    bind(effect, useInstances = false) {
        if (!this._texture || !this._isEnabled) {
            return;
        }
        const size = this._texture.getSize();
        effect.setFloat2("bakedVertexAnimationTextureSizeInverted", 1.0 / size.width, 1.0 / size.height);
        effect.setFloat("bakedVertexAnimationTime", this.time);
        if (!useInstances) {
            effect.setVector4("bakedVertexAnimationSettings", this.animationParameters);
        }
        effect.setTexture("bakedVertexAnimationTexture", this._texture);
    }
    /**
     * Clone the current manager
     * @returns a new BakedVertexAnimationManager
     */
    clone() {
        const copy = new BakedVertexAnimationManager(this._scene);
        this.copyTo(copy);
        return copy;
    }
    /**
     * Sets animation parameters.
     * @param startFrame The first frame of the animation.
     * @param endFrame The last frame of the animation.
     * @param offset The offset when starting the animation.
     * @param speedFramesPerSecond The frame rate.
     */
    setAnimationParameters(startFrame, endFrame, offset = 0, speedFramesPerSecond = 30) {
        this.animationParameters = new math_vector/* Vector4 */.IU(startFrame, endFrame, offset, speedFramesPerSecond);
    }
    /**
     * Disposes the resources of the manager.
     * @param forceDisposeTextures - Forces the disposal of all textures.
     */
    dispose(forceDisposeTextures) {
        if (forceDisposeTextures) {
            this._texture?.dispose();
        }
    }
    /**
     * Get the current class name useful for serialization or dynamic coding.
     * @returns "BakedVertexAnimationManager"
     */
    getClassName() {
        return "BakedVertexAnimationManager";
    }
    /**
     * Makes a duplicate of the current instance into another one.
     * @param vatMap define the instance where to copy the info
     */
    copyTo(vatMap) {
        decorators_serialization/* SerializationHelper */.p.Clone(() => vatMap, this);
    }
    /**
     * Serializes this vertex animation instance
     * @returns - An object with the serialized instance.
     */
    serialize() {
        return decorators_serialization/* SerializationHelper */.p.Serialize(this);
    }
    /**
     * Parses a vertex animation setting from a serialized object.
     * @param source - Serialized object.
     * @param scene Defines the scene we are parsing for
     * @param rootUrl Defines the rootUrl to load from
     */
    parse(source, scene, rootUrl) {
        decorators_serialization/* SerializationHelper */.p.Parse(() => this, source, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markSubMeshesAsAttributesDirty")
], BakedVertexAnimationManager.prototype, "texture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markSubMeshesAsAttributesDirty")
], BakedVertexAnimationManager.prototype, "isEnabled", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BakedVertexAnimationManager.prototype, "animationParameters", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BakedVertexAnimationManager.prototype, "time", void 0);
//# sourceMappingURL=bakedVertexAnimationManager.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/rawTexture.js
var rawTexture = __webpack_require__(96041);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/texture.js
var Textures_texture = __webpack_require__(7481);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/stringTools.js
var stringTools = __webpack_require__(36181);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Bones/skeleton.js
var Bones_skeleton = __webpack_require__(15397);
;// ./node_modules/@babylonjs/core/BakedVertexAnimation/vertexAnimationBaker.js





/**
 * Class to bake vertex animation textures.
 * @since 5.0
 */
class VertexAnimationBaker {
    /**
     * Create a new VertexAnimationBaker object which can help baking animations into a texture.
     * @param scene Defines the scene the VAT belongs to
     * @param meshOrSkeleton Defines the skeleton or the mesh from which to retrieve the skeleton from.
     */
    constructor(scene, meshOrSkeleton) {
        this._scene = scene;
        if (meshOrSkeleton instanceof Bones_skeleton/* Skeleton */.E) {
            this._skeleton = meshOrSkeleton;
            this._mesh = null;
        }
        else {
            this._mesh = meshOrSkeleton;
            this._skeleton = meshOrSkeleton.skeleton;
        }
    }
    /**
     * Bakes the animation into the texture. This should be called once, when the
     * scene starts, so the VAT is generated and associated to the mesh.
     * @param ranges Defines the ranges in the animation that will be baked.
     * @returns The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array.
     */
    async bakeVertexData(ranges) {
        if (!this._skeleton) {
            throw new Error("No skeleton provided.");
        }
        const boneCount = this._skeleton.bones.length;
        /** total number of frames in our animations */
        const frameCount = ranges.reduce((previous, current) => previous + current.to - current.from + 1, 0);
        if (isNaN(frameCount)) {
            throw new Error("Invalid animation ranges.");
        }
        // reset our loop data
        let textureIndex = 0;
        const textureSize = (boneCount + 1) * 4 * 4 * frameCount;
        const vertexData = new Float32Array(textureSize);
        this._scene.stopAnimation(this._skeleton);
        this._skeleton.returnToRest();
        // render all frames from our slices
        for (const range of ranges) {
            for (let frameIndex = range.from; frameIndex <= range.to; frameIndex++) {
                await this._executeAnimationFrame(vertexData, frameIndex, textureIndex++);
            }
        }
        return vertexData;
    }
    /**
     * Runs an animation frame and stores its vertex data
     *
     * @param vertexData The array to save data to.
     * @param frameIndex Current frame in the skeleton animation to render.
     * @param textureIndex Current index of the texture data.
     */
    async _executeAnimationFrame(vertexData, frameIndex, textureIndex) {
        return new Promise((resolve, _reject) => {
            this._scene.beginAnimation(this._skeleton, frameIndex, frameIndex, false, 1.0, () => {
                // generate matrices
                const skeletonMatrices = this._skeleton.getTransformMatrices(this._mesh);
                vertexData.set(skeletonMatrices, textureIndex * skeletonMatrices.length);
                resolve();
            });
        });
    }
    /**
     * Builds a vertex animation texture given the vertexData in an array.
     * @param vertexData The vertex animation data. You can generate it with bakeVertexData().
     * @returns The vertex animation texture to be used with BakedVertexAnimationManager.
     */
    textureFromBakedVertexData(vertexData) {
        if (!this._skeleton) {
            throw new Error("No skeleton provided.");
        }
        const boneCount = this._skeleton.bones.length;
        const texture = rawTexture/* RawTexture */.I.CreateRGBATexture(vertexData, (boneCount + 1) * 4, vertexData.length / ((boneCount + 1) * 4 * 4), this._scene, false, false, Textures_texture/* Texture */.g.NEAREST_NEAREST, 1);
        texture.name = "VAT" + this._skeleton.name;
        return texture;
    }
    /**
     * Serializes our vertexData to an object, with a nice string for the vertexData.
     * @param vertexData The vertex array data.
     * @returns This object serialized to a JS dict.
     */
    serializeBakedVertexDataToObject(vertexData) {
        if (!this._skeleton) {
            throw new Error("No skeleton provided.");
        }
        // this converts the float array to a serialized base64 string, ~1.3x larger
        // than the original.
        const boneCount = this._skeleton.bones.length;
        const width = (boneCount + 1) * 4;
        const height = vertexData.length / ((boneCount + 1) * 4 * 4);
        const data = {
            vertexData: (0,stringTools/* EncodeArrayBufferToBase64 */.EL)(vertexData),
            width,
            height,
        };
        return data;
    }
    /**
     * Loads previously baked data.
     * @param data The object as serialized by serializeBakedVertexDataToObject()
     * @returns The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array.
     */
    loadBakedVertexDataFromObject(data) {
        return new Float32Array((0,stringTools/* DecodeBase64ToBinary */.yS)(data.vertexData));
    }
    /**
     * Serializes our vertexData to a JSON string, with a nice string for the vertexData.
     * Should be called right after bakeVertexData().
     * @param vertexData The vertex array data.
     * @returns This object serialized to a safe string.
     */
    serializeBakedVertexDataToJSON(vertexData) {
        return JSON.stringify(this.serializeBakedVertexDataToObject(vertexData));
    }
    /**
     * Loads previously baked data in string format.
     * @param json The json string as serialized by serializeBakedVertexDataToJSON().
     * @returns The array of matrix transforms for each vertex (columns) and frame (rows), as a Float32Array.
     */
    loadBakedVertexDataFromJSON(json) {
        return this.loadBakedVertexDataFromObject(JSON.parse(json));
    }
}
//# sourceMappingURL=vertexAnimationBaker.js.map
;// ./node_modules/@babylonjs/core/BakedVertexAnimation/index.js


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Behaviors/behavior.js

//# sourceMappingURL=behavior.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/pointerEvents.js
var pointerEvents = __webpack_require__(66240);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/precisionDate.js
var precisionDate = __webpack_require__(76237);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.constants.js
var math_constants = __webpack_require__(65559);
;// ./node_modules/@babylonjs/core/Behaviors/Cameras/autoRotationBehavior.js



/**
 * The autoRotation behavior (AutoRotationBehavior) is designed to create a smooth rotation of an ArcRotateCamera when there is no user interaction.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#autorotation-behavior
 */
class AutoRotationBehavior {
    constructor() {
        this._zoomStopsAnimation = false;
        this._idleRotationSpeed = 0.05;
        this._idleRotationWaitTime = 2000;
        this._idleRotationSpinupTime = 2000;
        /**
         * Target alpha
         */
        this.targetAlpha = null;
        this._isPointerDown = false;
        this._lastFrameTime = null;
        this._lastInteractionTime = -Infinity;
        this._cameraRotationSpeed = 0;
        this._lastFrameRadius = 0;
    }
    /**
     * Gets the name of the behavior.
     */
    get name() {
        return "AutoRotation";
    }
    /**
     * Sets the flag that indicates if user zooming should stop animation.
     */
    set zoomStopsAnimation(flag) {
        this._zoomStopsAnimation = flag;
    }
    /**
     * Gets the flag that indicates if user zooming should stop animation.
     */
    get zoomStopsAnimation() {
        return this._zoomStopsAnimation;
    }
    /**
     * Sets the default speed at which the camera rotates around the model.
     */
    set idleRotationSpeed(speed) {
        this._idleRotationSpeed = speed;
    }
    /**
     * Gets the default speed at which the camera rotates around the model.
     */
    get idleRotationSpeed() {
        return this._idleRotationSpeed;
    }
    /**
     * Sets the time (in milliseconds) to wait after user interaction before the camera starts rotating.
     */
    set idleRotationWaitTime(time) {
        this._idleRotationWaitTime = time;
    }
    /**
     * Gets the time (milliseconds) to wait after user interaction before the camera starts rotating.
     */
    get idleRotationWaitTime() {
        return this._idleRotationWaitTime;
    }
    /**
     * Sets the time (milliseconds) to take to spin up to the full idle rotation speed.
     */
    set idleRotationSpinupTime(time) {
        this._idleRotationSpinupTime = time;
    }
    /**
     * Gets the time (milliseconds) to take to spin up to the full idle rotation speed.
     */
    get idleRotationSpinupTime() {
        return this._idleRotationSpinupTime;
    }
    /**
     * Gets a value indicating if the camera is currently rotating because of this behavior
     */
    get rotationInProgress() {
        return Math.abs(this._cameraRotationSpeed) > 0;
    }
    /**
     * Initializes the behavior.
     */
    init() {
        // Do nothing
    }
    /**
     * Attaches the behavior to its arc rotate camera.
     * @param camera Defines the camera to attach the behavior to
     */
    attach(camera) {
        this._attachedCamera = camera;
        const scene = this._attachedCamera.getScene();
        this._onPrePointerObservableObserver = scene.onPrePointerObservable.add((pointerInfoPre) => {
            if (pointerInfoPre.type === pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN) {
                this._isPointerDown = true;
                return;
            }
            if (pointerInfoPre.type === pointerEvents/* PointerEventTypes */.Zp.POINTERUP) {
                this._isPointerDown = false;
            }
        });
        this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(() => {
            if (this._reachTargetAlpha()) {
                return;
            }
            const now = precisionDate/* PrecisionDate */.j.Now;
            let dt = 0;
            if (this._lastFrameTime != null) {
                dt = now - this._lastFrameTime;
            }
            this._lastFrameTime = now;
            // Stop the animation if there is user interaction and the animation should stop for this interaction
            this._applyUserInteraction();
            const timeToRotation = now - this._lastInteractionTime - this._idleRotationWaitTime;
            const scale = Math.max(Math.min(timeToRotation / this._idleRotationSpinupTime, 1), 0);
            this._cameraRotationSpeed = this._idleRotationSpeed * scale;
            // Step camera rotation by rotation speed
            if (this._attachedCamera) {
                this._attachedCamera.alpha -= this._cameraRotationSpeed * (dt / 1000);
            }
        });
    }
    /**
     * Detaches the behavior from its current arc rotate camera.
     */
    detach() {
        if (!this._attachedCamera) {
            return;
        }
        const scene = this._attachedCamera.getScene();
        if (this._onPrePointerObservableObserver) {
            scene.onPrePointerObservable.remove(this._onPrePointerObservableObserver);
        }
        this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver);
        this._attachedCamera = null;
        this._lastFrameTime = null;
    }
    /**
     * Force-reset the last interaction time
     * @param customTime an optional time that will be used instead of the current last interaction time. For example `Date.now()`
     */
    resetLastInteractionTime(customTime) {
        this._lastInteractionTime = customTime ?? precisionDate/* PrecisionDate */.j.Now;
    }
    /**
     * Returns true if camera alpha reaches the target alpha
     * @returns true if camera alpha reaches the target alpha
     */
    _reachTargetAlpha() {
        if (this._attachedCamera && this.targetAlpha) {
            return Math.abs(this._attachedCamera.alpha - this.targetAlpha) < math_constants/* Epsilon */.bH;
        }
        return false;
    }
    /**
     * Returns true if user is scrolling.
     * @returns true if user is scrolling.
     */
    _userIsZooming() {
        if (!this._attachedCamera) {
            return false;
        }
        return this._attachedCamera.inertialRadiusOffset !== 0;
    }
    _shouldAnimationStopForInteraction() {
        if (!this._attachedCamera) {
            return false;
        }
        let zoomHasHitLimit = false;
        if (this._lastFrameRadius === this._attachedCamera.radius && this._attachedCamera.inertialRadiusOffset !== 0) {
            zoomHasHitLimit = true;
        }
        // Update the record of previous radius - works as an approx. indicator of hitting radius limits
        this._lastFrameRadius = this._attachedCamera.radius;
        return this._zoomStopsAnimation ? zoomHasHitLimit : this._userIsZooming();
    }
    /**
     *  Applies any current user interaction to the camera. Takes into account maximum alpha rotation.
     */
    _applyUserInteraction() {
        if (this._userIsMoving() && !this._shouldAnimationStopForInteraction()) {
            this._lastInteractionTime = precisionDate/* PrecisionDate */.j.Now;
        }
    }
    // Tools
    _userIsMoving() {
        if (!this._attachedCamera) {
            return false;
        }
        return (this._attachedCamera.inertialAlphaOffset !== 0 ||
            this._attachedCamera.inertialBetaOffset !== 0 ||
            this._attachedCamera.inertialRadiusOffset !== 0 ||
            this._attachedCamera.inertialPanningX !== 0 ||
            this._attachedCamera.inertialPanningY !== 0 ||
            this._isPointerDown);
    }
}
//# sourceMappingURL=autoRotationBehavior.js.map
;// ./node_modules/@babylonjs/core/Behaviors/Cameras/bouncingBehavior.js


/**
 * Add a bouncing effect to an ArcRotateCamera when reaching a specified minimum and maximum radius
 * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#bouncing-behavior
 */
class BouncingBehavior {
    constructor() {
        /**
         * The duration of the animation, in milliseconds
         */
        this.transitionDuration = 450;
        /**
         * Length of the distance animated by the transition when lower radius is reached
         */
        this.lowerRadiusTransitionRange = 2;
        /**
         * Length of the distance animated by the transition when upper radius is reached
         */
        this.upperRadiusTransitionRange = -2;
        this._autoTransitionRange = false;
        // Animations
        this._radiusIsAnimating = false;
        this._radiusBounceTransition = null;
        this._animatables = new Array();
    }
    /**
     * Gets the name of the behavior.
     */
    get name() {
        return "Bouncing";
    }
    /**
     * Gets a value indicating if the lowerRadiusTransitionRange and upperRadiusTransitionRange are defined automatically
     */
    get autoTransitionRange() {
        return this._autoTransitionRange;
    }
    /**
     * Sets a value indicating if the lowerRadiusTransitionRange and upperRadiusTransitionRange are defined automatically
     * Transition ranges will be set to 5% of the bounding box diagonal in world space
     */
    set autoTransitionRange(value) {
        if (this._autoTransitionRange === value) {
            return;
        }
        this._autoTransitionRange = value;
        const camera = this._attachedCamera;
        if (!camera) {
            return;
        }
        if (value) {
            this._onMeshTargetChangedObserver = camera.onMeshTargetChangedObservable.add((transformNode) => {
                if (!transformNode) {
                    return;
                }
                transformNode.computeWorldMatrix(true);
                if (transformNode.getBoundingInfo) {
                    const diagonal = transformNode.getBoundingInfo().diagonalLength;
                    this.lowerRadiusTransitionRange = diagonal * 0.05;
                    this.upperRadiusTransitionRange = diagonal * 0.05;
                }
            });
        }
        else if (this._onMeshTargetChangedObserver) {
            camera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver);
        }
    }
    /**
     * Initializes the behavior.
     */
    init() {
        // Do nothing
    }
    /**
     * Attaches the behavior to its arc rotate camera.
     * @param camera Defines the camera to attach the behavior to
     */
    attach(camera) {
        this._attachedCamera = camera;
        this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(() => {
            if (!this._attachedCamera) {
                return;
            }
            // Add the bounce animation to the lower radius limit
            if (this._isRadiusAtLimit(this._attachedCamera.lowerRadiusLimit)) {
                this._applyBoundRadiusAnimation(this.lowerRadiusTransitionRange);
            }
            // Add the bounce animation to the upper radius limit
            if (this._isRadiusAtLimit(this._attachedCamera.upperRadiusLimit)) {
                this._applyBoundRadiusAnimation(this.upperRadiusTransitionRange);
            }
        });
    }
    /**
     * Detaches the behavior from its current arc rotate camera.
     */
    detach() {
        if (!this._attachedCamera) {
            return;
        }
        if (this._onAfterCheckInputsObserver) {
            this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver);
        }
        if (this._onMeshTargetChangedObserver) {
            this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver);
        }
        this._attachedCamera = null;
    }
    /**
     * Checks if the camera radius is at the specified limit. Takes into account animation locks.
     * @param radiusLimit The limit to check against.
     * @returns Bool to indicate if at limit.
     */
    _isRadiusAtLimit(radiusLimit) {
        if (!this._attachedCamera) {
            return false;
        }
        if (this._attachedCamera.radius === radiusLimit && !this._radiusIsAnimating) {
            return true;
        }
        return false;
    }
    /**
     * Applies an animation to the radius of the camera, extending by the radiusDelta.
     * @param radiusDelta The delta by which to animate to. Can be negative.
     */
    _applyBoundRadiusAnimation(radiusDelta) {
        if (!this._attachedCamera) {
            return;
        }
        if (!this._radiusBounceTransition) {
            BouncingBehavior.EasingFunction.setEasingMode(BouncingBehavior.EasingMode);
            this._radiusBounceTransition = Animations_animation/* Animation */.X5.CreateAnimation("radius", Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT, 60, BouncingBehavior.EasingFunction);
        }
        // Prevent zoom until bounce has completed
        this._cachedWheelPrecision = this._attachedCamera.wheelPrecision;
        this._attachedCamera.wheelPrecision = Infinity;
        this._attachedCamera.inertialRadiusOffset = 0;
        // Animate to the radius limit
        this.stopAllAnimations();
        this._radiusIsAnimating = true;
        const animatable = Animations_animation/* Animation */.X5.TransitionTo("radius", this._attachedCamera.radius + radiusDelta, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusBounceTransition, this.transitionDuration, () => this._clearAnimationLocks());
        if (animatable) {
            this._animatables.push(animatable);
        }
    }
    /**
     * Removes all animation locks. Allows new animations to be added to any of the camera properties.
     */
    _clearAnimationLocks() {
        this._radiusIsAnimating = false;
        if (this._attachedCamera) {
            this._attachedCamera.wheelPrecision = this._cachedWheelPrecision;
        }
    }
    /**
     * Stops and removes all animations that have been applied to the camera
     */
    stopAllAnimations() {
        if (this._attachedCamera) {
            this._attachedCamera.animations = [];
        }
        while (this._animatables.length) {
            this._animatables[0].onAnimationEnd = null;
            this._animatables[0].stop();
            this._animatables.shift();
        }
    }
}
/**
 * The easing function used by animations
 */
BouncingBehavior.EasingFunction = new BackEase(0.3);
/**
 * The easing mode used by animations
 */
BouncingBehavior.EasingMode = EasingFunction.EASINGMODE_EASEOUT;
//# sourceMappingURL=bouncingBehavior.js.map
;// ./node_modules/@babylonjs/core/Behaviors/Cameras/framingBehavior.js






/**
 * The framing behavior (FramingBehavior) is designed to automatically position an ArcRotateCamera when its target is set to a mesh. It is also useful if you want to prevent the camera to go under a virtual horizontal plane.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior
 */
class FramingBehavior {
    constructor() {
        /**
         * An event triggered when the animation to zoom on target mesh has ended
         */
        this.onTargetFramingAnimationEndObservable = new Misc_observable/* Observable */.cP();
        this._mode = FramingBehavior.FitFrustumSidesMode;
        this._radiusScale = 1.0;
        this._positionScale = 0.5;
        this._defaultElevation = 0.3;
        this._elevationReturnTime = 1500;
        this._elevationReturnWaitTime = 1000;
        this._zoomStopsAnimation = false;
        this._framingTime = 1500;
        /**
         * Define if the behavior should automatically change the configured
         * camera limits and sensibilities.
         */
        this.autoCorrectCameraLimitsAndSensibility = true;
        this._isPointerDown = false;
        this._lastInteractionTime = -Infinity;
        // Framing control
        this._animatables = new Array();
        this._betaIsAnimating = false;
    }
    /**
     * Gets the name of the behavior.
     */
    get name() {
        return "Framing";
    }
    /**
     * Sets the current mode used by the behavior
     */
    set mode(mode) {
        this._mode = mode;
    }
    /**
     * Gets current mode used by the behavior.
     */
    get mode() {
        return this._mode;
    }
    /**
     * Sets the scale applied to the radius (1 by default)
     */
    set radiusScale(radius) {
        this._radiusScale = radius;
    }
    /**
     * Gets the scale applied to the radius
     */
    get radiusScale() {
        return this._radiusScale;
    }
    /**
     * Sets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.
     */
    set positionScale(scale) {
        this._positionScale = scale;
    }
    /**
     * Gets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.
     */
    get positionScale() {
        return this._positionScale;
    }
    /**
     * Sets the angle above/below the horizontal plane to return to when the return to default elevation idle
     * behaviour is triggered, in radians.
     */
    set defaultElevation(elevation) {
        this._defaultElevation = elevation;
    }
    /**
     * Gets the angle above/below the horizontal plane to return to when the return to default elevation idle
     * behaviour is triggered, in radians.
     */
    get defaultElevation() {
        return this._defaultElevation;
    }
    /**
     * Sets the time (in milliseconds) taken to return to the default beta position.
     * Negative value indicates camera should not return to default.
     */
    set elevationReturnTime(speed) {
        this._elevationReturnTime = speed;
    }
    /**
     * Gets the time (in milliseconds) taken to return to the default beta position.
     * Negative value indicates camera should not return to default.
     */
    get elevationReturnTime() {
        return this._elevationReturnTime;
    }
    /**
     * Sets the delay (in milliseconds) taken before the camera returns to the default beta position.
     */
    set elevationReturnWaitTime(time) {
        this._elevationReturnWaitTime = time;
    }
    /**
     * Gets the delay (in milliseconds) taken before the camera returns to the default beta position.
     */
    get elevationReturnWaitTime() {
        return this._elevationReturnWaitTime;
    }
    /**
     * Sets the flag that indicates if user zooming should stop animation.
     */
    set zoomStopsAnimation(flag) {
        this._zoomStopsAnimation = flag;
    }
    /**
     * Gets the flag that indicates if user zooming should stop animation.
     */
    get zoomStopsAnimation() {
        return this._zoomStopsAnimation;
    }
    /**
     * Sets the transition time when framing the mesh, in milliseconds
     */
    set framingTime(time) {
        this._framingTime = time;
    }
    /**
     * Gets the transition time when framing the mesh, in milliseconds
     */
    get framingTime() {
        return this._framingTime;
    }
    /**
     * Initializes the behavior.
     */
    init() {
        // Do nothing
    }
    /**
     * Attaches the behavior to its arc rotate camera.
     * @param camera Defines the camera to attach the behavior to
     */
    attach(camera) {
        this._attachedCamera = camera;
        const scene = this._attachedCamera.getScene();
        FramingBehavior.EasingFunction.setEasingMode(FramingBehavior.EasingMode);
        this._onPrePointerObservableObserver = scene.onPrePointerObservable.add((pointerInfoPre) => {
            if (pointerInfoPre.type === pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN) {
                this._isPointerDown = true;
                return;
            }
            if (pointerInfoPre.type === pointerEvents/* PointerEventTypes */.Zp.POINTERUP) {
                this._isPointerDown = false;
            }
        });
        this._onMeshTargetChangedObserver = camera.onMeshTargetChangedObservable.add((transformNode) => {
            if (transformNode && transformNode.getBoundingInfo) {
                this.zoomOnMesh(transformNode, undefined, () => {
                    this.onTargetFramingAnimationEndObservable.notifyObservers();
                });
            }
        });
        this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(() => {
            // Stop the animation if there is user interaction and the animation should stop for this interaction
            this._applyUserInteraction();
            // Maintain the camera above the ground. If the user pulls the camera beneath the ground plane, lift it
            // back to the default position after a given timeout
            this._maintainCameraAboveGround();
        });
    }
    /**
     * Detaches the behavior from its current arc rotate camera.
     */
    detach() {
        if (!this._attachedCamera) {
            return;
        }
        const scene = this._attachedCamera.getScene();
        if (this._onPrePointerObservableObserver) {
            scene.onPrePointerObservable.remove(this._onPrePointerObservableObserver);
        }
        if (this._onAfterCheckInputsObserver) {
            this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver);
        }
        if (this._onMeshTargetChangedObserver) {
            this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver);
        }
        this._attachedCamera = null;
    }
    /**
     * Targets the given mesh and updates zoom level accordingly.
     * @param mesh  The mesh to target.
     * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
     * @param onAnimationEnd Callback triggered at the end of the framing animation
     */
    zoomOnMesh(mesh, focusOnOriginXZ = false, onAnimationEnd = null) {
        mesh.computeWorldMatrix(true);
        const boundingBox = mesh.getBoundingInfo().boundingBox;
        this.zoomOnBoundingInfo(boundingBox.minimumWorld, boundingBox.maximumWorld, focusOnOriginXZ, onAnimationEnd);
    }
    /**
     * Targets the given mesh with its children and updates zoom level accordingly.
     * @param mesh The mesh to target.
     * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
     * @param onAnimationEnd Callback triggered at the end of the framing animation
     */
    zoomOnMeshHierarchy(mesh, focusOnOriginXZ = false, onAnimationEnd = null) {
        mesh.computeWorldMatrix(true);
        const boundingBox = mesh.getHierarchyBoundingVectors(true);
        this.zoomOnBoundingInfo(boundingBox.min, boundingBox.max, focusOnOriginXZ, onAnimationEnd);
    }
    /**
     * Targets the given meshes with their children and updates zoom level accordingly.
     * @param meshes  The mesh to target.
     * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
     * @param onAnimationEnd Callback triggered at the end of the framing animation
     */
    zoomOnMeshesHierarchy(meshes, focusOnOriginXZ = false, onAnimationEnd = null) {
        const min = new math_vector/* Vector3 */.Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        const max = new math_vector/* Vector3 */.Pq(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
        for (let i = 0; i < meshes.length; i++) {
            const boundingInfo = meshes[i].getHierarchyBoundingVectors(true);
            math_vector/* Vector3 */.Pq.CheckExtends(boundingInfo.min, min, max);
            math_vector/* Vector3 */.Pq.CheckExtends(boundingInfo.max, min, max);
        }
        this.zoomOnBoundingInfo(min, max, focusOnOriginXZ, onAnimationEnd);
    }
    /**
     * Targets the bounding box info defined by its extends and updates zoom level accordingly.
     * @param minimumWorld Determines the smaller position of the bounding box extend
     * @param maximumWorld Determines the bigger position of the bounding box extend
     * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
     * @param onAnimationEnd Callback triggered at the end of the framing animation
     * @returns true if the zoom was done
     */
    zoomOnBoundingInfo(minimumWorld, maximumWorld, focusOnOriginXZ = false, onAnimationEnd = null) {
        let zoomTarget;
        if (!this._attachedCamera) {
            return false;
        }
        // Find target by interpolating from bottom of bounding box in world-space to top via framingPositionY
        const bottom = minimumWorld.y;
        const top = maximumWorld.y;
        const zoomTargetY = bottom + (top - bottom) * this._positionScale;
        const radiusWorld = maximumWorld.subtract(minimumWorld).scale(0.5);
        if (focusOnOriginXZ) {
            zoomTarget = new math_vector/* Vector3 */.Pq(0, zoomTargetY, 0);
        }
        else {
            const centerWorld = minimumWorld.add(radiusWorld);
            zoomTarget = new math_vector/* Vector3 */.Pq(centerWorld.x, zoomTargetY, centerWorld.z);
        }
        if (!this._vectorTransition) {
            this._vectorTransition = Animations_animation/* Animation */.X5.CreateAnimation("target", Animations_animation/* Animation */.X5.ANIMATIONTYPE_VECTOR3, 60, FramingBehavior.EasingFunction);
        }
        this._betaIsAnimating = true;
        let animatable = Animations_animation/* Animation */.X5.TransitionTo("target", zoomTarget, this._attachedCamera, this._attachedCamera.getScene(), 60, this._vectorTransition, this._framingTime);
        if (animatable) {
            this._animatables.push(animatable);
        }
        // sets the radius and lower radius bounds
        // Small delta ensures camera is not always at lower zoom limit.
        let radius = 0;
        if (this._mode === FramingBehavior.FitFrustumSidesMode) {
            const position = this._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld);
            if (this.autoCorrectCameraLimitsAndSensibility) {
                this._attachedCamera.lowerRadiusLimit = radiusWorld.length() + this._attachedCamera.minZ;
            }
            radius = position;
        }
        else if (this._mode === FramingBehavior.IgnoreBoundsSizeMode) {
            radius = this._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld);
            if (this.autoCorrectCameraLimitsAndSensibility && this._attachedCamera.lowerRadiusLimit === null) {
                this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ;
            }
        }
        // Set sensibilities
        if (this.autoCorrectCameraLimitsAndSensibility) {
            const extend = maximumWorld.subtract(minimumWorld).length();
            this._attachedCamera.panningSensibility = 5000 / extend;
            this._attachedCamera.wheelPrecision = 100 / radius;
        }
        // transition to new radius
        if (!this._radiusTransition) {
            this._radiusTransition = Animations_animation/* Animation */.X5.CreateAnimation("radius", Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);
        }
        animatable = Animations_animation/* Animation */.X5.TransitionTo("radius", radius, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusTransition, this._framingTime, () => {
            this.stopAllAnimations();
            if (onAnimationEnd) {
                onAnimationEnd();
            }
            if (this._attachedCamera && this._attachedCamera.useInputToRestoreState) {
                this._attachedCamera.storeState();
            }
        });
        if (animatable) {
            this._animatables.push(animatable);
        }
        return true;
    }
    /**
     * Calculates the lowest radius for the camera based on the bounding box of the mesh.
     * @param minimumWorld
     * @param maximumWorld
     * @returns The minimum distance from the primary mesh's center point at which the camera must be kept in order
     *		 to fully enclose the mesh in the viewing frustum.
     */
    _calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld) {
        const camera = this._attachedCamera;
        if (!camera) {
            return 0;
        }
        let distance = camera._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld, this._radiusScale);
        if (camera.lowerRadiusLimit && this._mode === FramingBehavior.IgnoreBoundsSizeMode) {
            // Don't exceed the requested limit
            distance = distance < camera.lowerRadiusLimit ? camera.lowerRadiusLimit : distance;
        }
        // Don't exceed the upper radius limit
        if (camera.upperRadiusLimit) {
            distance = distance > camera.upperRadiusLimit ? camera.upperRadiusLimit : distance;
        }
        return distance;
    }
    /**
     * Keeps the camera above the ground plane. If the user pulls the camera below the ground plane, the camera
     * is automatically returned to its default position (expected to be above ground plane).
     */
    _maintainCameraAboveGround() {
        if (this._elevationReturnTime < 0) {
            return;
        }
        const timeSinceInteraction = precisionDate/* PrecisionDate */.j.Now - this._lastInteractionTime;
        const defaultBeta = Math.PI * 0.5 - this._defaultElevation;
        const limitBeta = Math.PI * 0.5;
        // Bring the camera back up if below the ground plane
        if (this._attachedCamera && !this._betaIsAnimating && this._attachedCamera.beta > limitBeta && timeSinceInteraction >= this._elevationReturnWaitTime) {
            this._betaIsAnimating = true;
            //Transition to new position
            this.stopAllAnimations();
            if (!this._betaTransition) {
                this._betaTransition = Animations_animation/* Animation */.X5.CreateAnimation("beta", Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);
            }
            const animatabe = Animations_animation/* Animation */.X5.TransitionTo("beta", defaultBeta, this._attachedCamera, this._attachedCamera.getScene(), 60, this._betaTransition, this._elevationReturnTime, () => {
                this._clearAnimationLocks();
                this.stopAllAnimations();
            });
            if (animatabe) {
                this._animatables.push(animatabe);
            }
        }
    }
    /**
     * Removes all animation locks. Allows new animations to be added to any of the arcCamera properties.
     */
    _clearAnimationLocks() {
        this._betaIsAnimating = false;
    }
    /**
     *  Applies any current user interaction to the camera. Takes into account maximum alpha rotation.
     */
    _applyUserInteraction() {
        if (this.isUserIsMoving) {
            this._lastInteractionTime = precisionDate/* PrecisionDate */.j.Now;
            this.stopAllAnimations();
            this._clearAnimationLocks();
        }
    }
    /**
     * Stops and removes all animations that have been applied to the camera
     */
    stopAllAnimations() {
        if (this._attachedCamera) {
            this._attachedCamera.animations = [];
        }
        while (this._animatables.length) {
            if (this._animatables[0]) {
                this._animatables[0].onAnimationEnd = null;
                this._animatables[0].stop();
            }
            this._animatables.shift();
        }
    }
    /**
     * Gets a value indicating if the user is moving the camera
     */
    get isUserIsMoving() {
        if (!this._attachedCamera) {
            return false;
        }
        return (this._attachedCamera.inertialAlphaOffset !== 0 ||
            this._attachedCamera.inertialBetaOffset !== 0 ||
            this._attachedCamera.inertialRadiusOffset !== 0 ||
            this._attachedCamera.inertialPanningX !== 0 ||
            this._attachedCamera.inertialPanningY !== 0 ||
            this._isPointerDown);
    }
}
/**
 * The easing function used by animations
 */
FramingBehavior.EasingFunction = new ExponentialEase();
/**
 * The easing mode used by animations
 */
FramingBehavior.EasingMode = EasingFunction.EASINGMODE_EASEINOUT;
// Statics
/**
 * The camera can move all the way towards the mesh.
 */
FramingBehavior.IgnoreBoundsSizeMode = 0;
/**
 * The camera is not allowed to zoom closer to the mesh than the point at which the adjusted bounding sphere touches the frustum sides
 */
FramingBehavior.FitFrustumSidesMode = 1;
//# sourceMappingURL=framingBehavior.js.map
;// ./node_modules/@babylonjs/core/Behaviors/Cameras/index.js



//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Behaviors/Meshes/attachToBoxBehavior.js

/**
 * @internal
 */
class FaceDirectionInfo {
    constructor(direction, rotatedDirection = new math_vector/* Vector3 */.Pq(), diff = 0, ignore = false) {
        this.direction = direction;
        this.rotatedDirection = rotatedDirection;
        this.diff = diff;
        this.ignore = ignore;
    }
}
/**
 * A behavior that when attached to a mesh will will place a specified node on the meshes face pointing towards the camera
 */
class AttachToBoxBehavior {
    /**
     * Creates the AttachToBoxBehavior, used to attach UI to the closest face of the box to a camera
     * @param _ui The transform node that should be attached to the mesh
     */
    constructor(_ui) {
        this._ui = _ui;
        /**
         *  ["AttachToBoxBehavior"] The name of the behavior
         */
        this.name = "AttachToBoxBehavior";
        /**
         * [0.15] The distance away from the face of the mesh that the UI should be attached to (default: 0.15)
         */
        this.distanceAwayFromFace = 0.15;
        /**
         * [0.15] The distance from the bottom of the face that the UI should be attached to (default: 0.15)
         */
        this.distanceAwayFromBottomOfFace = 0.15;
        this._faceVectors = [
            new FaceDirectionInfo(math_vector/* Vector3 */.Pq.Up()),
            new FaceDirectionInfo(math_vector/* Vector3 */.Pq.Down()),
            new FaceDirectionInfo(math_vector/* Vector3 */.Pq.Left()),
            new FaceDirectionInfo(math_vector/* Vector3 */.Pq.Right()),
            new FaceDirectionInfo(math_vector/* Vector3 */.Pq.Forward()),
            new FaceDirectionInfo(math_vector/* Vector3 */.Pq.Forward().scaleInPlace(-1)),
        ];
        this._tmpMatrix = new math_vector/* Matrix */.uq();
        this._tmpVector = new math_vector/* Vector3 */.Pq();
        this._zeroVector = math_vector/* Vector3 */.Pq.Zero();
        this._lookAtTmpMatrix = new math_vector/* Matrix */.uq();
        /* Does nothing */
    }
    /**
     *  Initializes the behavior
     */
    init() {
        /* Does nothing */
    }
    _closestFace(targetDirection) {
        // Go over each face and calculate the angle between the face's normal and targetDirection
        this._faceVectors.forEach((v) => {
            if (!this._target.rotationQuaternion) {
                this._target.rotationQuaternion = math_vector/* Quaternion */.PT.RotationYawPitchRoll(this._target.rotation.y, this._target.rotation.x, this._target.rotation.z);
            }
            this._target.rotationQuaternion.toRotationMatrix(this._tmpMatrix);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(v.direction, this._tmpMatrix, v.rotatedDirection);
            v.diff = math_vector/* Vector3 */.Pq.GetAngleBetweenVectors(v.rotatedDirection, targetDirection, math_vector/* Vector3 */.Pq.Cross(v.rotatedDirection, targetDirection));
        });
        // Return the face information of the one with the normal closest to target direction
        return this._faceVectors.reduce((min, p) => {
            if (min.ignore) {
                return p;
            }
            else if (p.ignore) {
                return min;
            }
            else {
                return min.diff < p.diff ? min : p;
            }
        }, this._faceVectors[0]);
    }
    _lookAtToRef(pos, up = new math_vector/* Vector3 */.Pq(0, 1, 0), ref) {
        math_vector/* Matrix */.uq.LookAtLHToRef(this._zeroVector, pos, up, this._lookAtTmpMatrix);
        this._lookAtTmpMatrix.invert();
        math_vector/* Quaternion */.PT.FromRotationMatrixToRef(this._lookAtTmpMatrix, ref);
    }
    /**
     * Attaches the AttachToBoxBehavior to the passed in mesh
     * @param target The mesh that the specified node will be attached to
     */
    attach(target) {
        this._target = target;
        this._scene = this._target.getScene();
        // Every frame, update the app bars position
        this._onRenderObserver = this._scene.onBeforeRenderObservable.add(() => {
            if (!this._scene.activeCamera) {
                return;
            }
            // Find the face closest to the cameras position
            let cameraPos = this._scene.activeCamera.position;
            if (this._scene.activeCamera.devicePosition) {
                cameraPos = this._scene.activeCamera.devicePosition;
            }
            const facing = this._closestFace(cameraPos.subtract(target.position));
            if (this._scene.activeCamera.leftCamera) {
                this._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix);
            }
            else {
                this._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix);
            }
            // Get camera up direction
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* Vector3 */.Pq.Up(), this._tmpMatrix, this._tmpVector);
            // Ignore faces to not select a parallel face for the up vector of the UI
            this._faceVectors.forEach((v) => {
                if (facing.direction.x && v.direction.x) {
                    v.ignore = true;
                }
                if (facing.direction.y && v.direction.y) {
                    v.ignore = true;
                }
                if (facing.direction.z && v.direction.z) {
                    v.ignore = true;
                }
            });
            const facingUp = this._closestFace(this._tmpVector);
            // Unignore faces
            this._faceVectors.forEach((v) => {
                v.ignore = false;
            });
            // Position the app bar on that face
            this._ui.position.copyFrom(target.position);
            if (facing.direction.x) {
                facing.rotatedDirection.scaleToRef(target.scaling.x / 2 + this.distanceAwayFromFace, this._tmpVector);
                this._ui.position.addInPlace(this._tmpVector);
            }
            if (facing.direction.y) {
                facing.rotatedDirection.scaleToRef(target.scaling.y / 2 + this.distanceAwayFromFace, this._tmpVector);
                this._ui.position.addInPlace(this._tmpVector);
            }
            if (facing.direction.z) {
                facing.rotatedDirection.scaleToRef(target.scaling.z / 2 + this.distanceAwayFromFace, this._tmpVector);
                this._ui.position.addInPlace(this._tmpVector);
            }
            // Rotate to be oriented properly to the camera
            if (!this._ui.rotationQuaternion) {
                this._ui.rotationQuaternion = math_vector/* Quaternion */.PT.RotationYawPitchRoll(this._ui.rotation.y, this._ui.rotation.x, this._ui.rotation.z);
            }
            facing.rotatedDirection.scaleToRef(-1, this._tmpVector);
            this._lookAtToRef(this._tmpVector, facingUp.rotatedDirection, this._ui.rotationQuaternion);
            // Place ui the correct distance from the bottom of the mesh
            if (facingUp.direction.x) {
                this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - target.scaling.x / 2, this._tmpVector);
            }
            if (facingUp.direction.y) {
                this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - target.scaling.y / 2, this._tmpVector);
            }
            if (facingUp.direction.z) {
                this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - target.scaling.z / 2, this._tmpVector);
            }
            this._ui.position.addInPlace(this._tmpVector);
        });
    }
    /**
     *  Detaches the behavior from the mesh
     */
    detach() {
        this._scene.onBeforeRenderObservable.remove(this._onRenderObserver);
    }
}
//# sourceMappingURL=attachToBoxBehavior.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/fadeInOutBehavior.js
var fadeInOutBehavior = __webpack_require__(74741);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/pointerDragBehavior.js
var pointerDragBehavior = __webpack_require__(21877);
;// ./node_modules/@babylonjs/core/Behaviors/Meshes/multiPointerScaleBehavior.js


/**
 * A behavior that when attached to a mesh will allow the mesh to be scaled
 */
class MultiPointerScaleBehavior {
    /**
     * Instantiate a new behavior that when attached to a mesh will allow the mesh to be scaled
     */
    constructor() {
        this._startDistance = 0;
        this._initialScale = new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._targetScale = new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._sceneRenderObserver = null;
        this._dragBehaviorA = new pointerDragBehavior/* PointerDragBehavior */.C({});
        this._dragBehaviorA.moveAttached = false;
        this._dragBehaviorB = new pointerDragBehavior/* PointerDragBehavior */.C({});
        this._dragBehaviorB.moveAttached = false;
    }
    /**
     *  The name of the behavior
     */
    get name() {
        return "MultiPointerScale";
    }
    /**
     *  Initializes the behavior
     */
    init() { }
    _getCurrentDistance() {
        return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length();
    }
    /**
     * Attaches the scale behavior the passed in mesh
     * @param ownerNode The mesh that will be scaled around once attached
     */
    attach(ownerNode) {
        this._ownerNode = ownerNode;
        // Create 2 drag behaviors such that each will only be triggered by a separate pointer
        this._dragBehaviorA.onDragStartObservable.add(() => {
            if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) {
                if (this._dragBehaviorA.currentDraggingPointerId == this._dragBehaviorB.currentDraggingPointerId) {
                    this._dragBehaviorA.releaseDrag();
                }
                else {
                    this._initialScale.copyFrom(ownerNode.scaling);
                    this._startDistance = this._getCurrentDistance();
                }
            }
        });
        this._dragBehaviorB.onDragStartObservable.add(() => {
            if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) {
                if (this._dragBehaviorA.currentDraggingPointerId == this._dragBehaviorB.currentDraggingPointerId) {
                    this._dragBehaviorB.releaseDrag();
                }
                else {
                    this._initialScale.copyFrom(ownerNode.scaling);
                    this._startDistance = this._getCurrentDistance();
                }
            }
        });
        // Once both drag behaviors are active scale based on the distance between the two pointers
        [this._dragBehaviorA, this._dragBehaviorB].forEach((behavior) => {
            behavior.onDragObservable.add(() => {
                if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) {
                    const ratio = this._getCurrentDistance() / this._startDistance;
                    this._initialScale.scaleToRef(ratio, this._targetScale);
                }
            });
        });
        ownerNode.addBehavior(this._dragBehaviorA);
        ownerNode.addBehavior(this._dragBehaviorB);
        // On every frame move towards target scaling to avoid jitter caused by vr controllers
        this._sceneRenderObserver = ownerNode.getScene().onBeforeRenderObservable.add(() => {
            if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) {
                const change = this._targetScale.subtract(ownerNode.scaling).scaleInPlace(0.1);
                if (change.length() > 0.01) {
                    ownerNode.scaling.addInPlace(change);
                }
            }
        });
    }
    /**
     *  Detaches the behavior from the mesh
     */
    detach() {
        this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver);
        [this._dragBehaviorA, this._dragBehaviorB].forEach((behavior) => {
            behavior.onDragStartObservable.clear();
            behavior.onDragObservable.clear();
            this._ownerNode.removeBehavior(behavior);
        });
    }
}
//# sourceMappingURL=multiPointerScaleBehavior.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/sixDofDragBehavior.js
var sixDofDragBehavior = __webpack_require__(22575);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/surfaceMagnetismBehavior.js
var surfaceMagnetismBehavior = __webpack_require__(38968);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/baseSixDofDragBehavior.js
var baseSixDofDragBehavior = __webpack_require__(55234);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/followBehavior.js
var followBehavior = __webpack_require__(84289);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Behaviors/Meshes/handConstraintBehavior.js
var handConstraintBehavior = __webpack_require__(85054);
;// ./node_modules/@babylonjs/core/Behaviors/Meshes/index.js









//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Behaviors/index.js
/* eslint-disable import/no-internal-modules */



//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Bones/bone.js
var bone = __webpack_require__(36504);
;// ./node_modules/@babylonjs/core/Bones/boneIKController.js


/**
 * Class used to apply inverse kinematics to bones
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons#boneikcontroller
 */
class BoneIKController {
    /**
     * Gets or sets maximum allowed angle
     */
    get maxAngle() {
        return this._maxAngle;
    }
    set maxAngle(value) {
        this._setMaxAngle(value);
    }
    /**
     * Creates a new BoneIKController
     * @param mesh defines the TransformNode to control
     * @param bone defines the bone to control. The bone needs to have a parent bone. It also needs to have a length greater than 0 or a children we can use to infer its length.
     * @param options defines options to set up the controller
     * @param options.targetMesh
     * @param options.poleTargetMesh
     * @param options.poleTargetBone
     * @param options.poleTargetLocalOffset
     * @param options.poleAngle
     * @param options.bendAxis
     * @param options.maxAngle
     * @param options.slerpAmount
     */
    constructor(mesh, bone, options) {
        /**
         * Gets or sets the target position
         */
        this.targetPosition = math_vector/* Vector3 */.Pq.Zero();
        /**
         * Gets or sets the pole target position
         */
        this.poleTargetPosition = math_vector/* Vector3 */.Pq.Zero();
        /**
         * Gets or sets the pole target local offset
         */
        this.poleTargetLocalOffset = math_vector/* Vector3 */.Pq.Zero();
        /**
         * Gets or sets the pole angle
         */
        this.poleAngle = 0;
        /**
         * The amount to slerp (spherical linear interpolation) to the target.  Set this to a value between 0 and 1 (a value of 1 disables slerp)
         */
        this.slerpAmount = 1;
        this._bone1Quat = math_vector/* Quaternion */.PT.Identity();
        this._bone1Mat = math_vector/* Matrix */.uq.Identity();
        this._bone2Ang = Math.PI;
        this._maxAngle = Math.PI;
        this._rightHandedSystem = false;
        this._bendAxis = math_vector/* Vector3 */.Pq.Right();
        this._slerping = false;
        this._adjustRoll = 0;
        this._notEnoughInformation = false;
        this._bone2 = bone;
        const bone1 = bone.getParent();
        if (!bone1) {
            this._notEnoughInformation = true;
            logger/* Logger */.V.Error("BoneIKController: bone must have a parent for IK to work.");
            return;
        }
        this._bone1 = bone1;
        if (this._bone2.children.length === 0 && !this._bone2.length) {
            this._notEnoughInformation = true;
            logger/* Logger */.V.Error("BoneIKController: bone must not be a leaf or it should have a length for IK to work.");
            return;
        }
        this.mesh = mesh;
        bone.getSkeleton().computeAbsoluteMatrices();
        const bonePos = bone.getPosition();
        if (bone.getAbsoluteMatrix().determinant() > 0) {
            this._rightHandedSystem = true;
            this._bendAxis.x = 0;
            this._bendAxis.y = 0;
            this._bendAxis.z = -1;
            if (bonePos.x > bonePos.y && bonePos.x > bonePos.z) {
                this._adjustRoll = Math.PI * 0.5;
                this._bendAxis.z = 1;
            }
        }
        if (this._bone1.length && this._bone2.length) {
            const boneScale1 = this._bone1.getScale();
            const boneScale2 = this._bone2.getScale();
            this._bone1Length = this._bone1.length * boneScale1.y * this.mesh.scaling.y;
            this._bone2Length = this._bone2.length * boneScale2.y * this.mesh.scaling.y;
        }
        else if (this._bone2.children[0]) {
            mesh.computeWorldMatrix(true);
            const pos1 = this._bone2.children[0].getAbsolutePosition(mesh);
            const pos2 = this._bone2.getAbsolutePosition(mesh);
            const pos3 = this._bone1.getAbsolutePosition(mesh);
            this._bone2Length = math_vector/* Vector3 */.Pq.Distance(pos1, pos2);
            this._bone1Length = math_vector/* Vector3 */.Pq.Distance(pos2, pos3);
        }
        else {
            mesh.computeWorldMatrix(true);
            const boneScale2 = this._bone2.getScale();
            this._bone2Length = this._bone2.length * boneScale2.y * this.mesh.scaling.y;
            const pos2 = this._bone2.getAbsolutePosition(mesh);
            const pos3 = this._bone1.getAbsolutePosition(mesh);
            this._bone1Length = math_vector/* Vector3 */.Pq.Distance(pos2, pos3);
        }
        this._bone1.getRotationMatrixToRef(1 /* Space.WORLD */, mesh, this._bone1Mat);
        this.maxAngle = Math.PI;
        if (options) {
            if (options.targetMesh) {
                this.targetMesh = options.targetMesh;
                this.targetMesh.computeWorldMatrix(true);
            }
            if (options.poleTargetMesh) {
                this.poleTargetMesh = options.poleTargetMesh;
                this.poleTargetMesh.computeWorldMatrix(true);
            }
            else if (options.poleTargetBone) {
                this.poleTargetBone = options.poleTargetBone;
            }
            else if (this._bone1.getParent()) {
                this.poleTargetBone = this._bone1.getParent();
            }
            if (options.poleTargetLocalOffset) {
                this.poleTargetLocalOffset.copyFrom(options.poleTargetLocalOffset);
            }
            if (options.poleAngle) {
                this.poleAngle = options.poleAngle;
            }
            if (options.bendAxis) {
                this._bendAxis.copyFrom(options.bendAxis);
            }
            if (options.maxAngle) {
                this.maxAngle = options.maxAngle;
            }
            if (options.slerpAmount) {
                this.slerpAmount = options.slerpAmount;
            }
        }
    }
    _setMaxAngle(ang) {
        if (ang < 0) {
            ang = 0;
        }
        if (ang > Math.PI || ang == undefined) {
            ang = Math.PI;
        }
        this._maxAngle = ang;
        const a = this._bone1Length;
        const b = this._bone2Length;
        this._maxReach = Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(ang));
    }
    /**
     * Force the controller to update the bones
     */
    update() {
        if (this._notEnoughInformation) {
            return;
        }
        const target = this.targetPosition;
        const poleTarget = this.poleTargetPosition;
        const mat1 = BoneIKController._TmpMats[0];
        const mat2 = BoneIKController._TmpMats[1];
        if (this.targetMesh) {
            target.copyFrom(this.targetMesh.getAbsolutePosition());
        }
        if (this.poleTargetBone) {
            this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset, this.mesh, poleTarget);
        }
        else if (this.poleTargetMesh) {
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this.poleTargetLocalOffset, this.poleTargetMesh.getWorldMatrix(), poleTarget);
        }
        const bonePos = BoneIKController._TmpVecs[0];
        const zaxis = BoneIKController._TmpVecs[1];
        const xaxis = BoneIKController._TmpVecs[2];
        const yaxis = BoneIKController._TmpVecs[3];
        const upAxis = BoneIKController._TmpVecs[4];
        const tmpQuat = BoneIKController._TmpQuat;
        this._bone1.getAbsolutePositionToRef(this.mesh, bonePos);
        poleTarget.subtractToRef(bonePos, upAxis);
        if (upAxis.x == 0 && upAxis.y == 0 && upAxis.z == 0) {
            upAxis.y = 1;
        }
        else {
            upAxis.normalize();
        }
        target.subtractToRef(bonePos, yaxis);
        yaxis.normalize();
        math_vector/* Vector3 */.Pq.CrossToRef(yaxis, upAxis, zaxis);
        zaxis.normalize();
        math_vector/* Vector3 */.Pq.CrossToRef(yaxis, zaxis, xaxis);
        xaxis.normalize();
        math_vector/* Matrix */.uq.FromXYZAxesToRef(xaxis, yaxis, zaxis, mat1);
        const a = this._bone1Length;
        const b = this._bone2Length;
        let c = math_vector/* Vector3 */.Pq.Distance(bonePos, target);
        if (this._maxReach > 0) {
            c = Math.min(this._maxReach, c);
        }
        let acosa = (b * b + c * c - a * a) / (2 * b * c);
        let acosb = (c * c + a * a - b * b) / (2 * c * a);
        if (acosa > 1) {
            acosa = 1;
        }
        if (acosb > 1) {
            acosb = 1;
        }
        if (acosa < -1) {
            acosa = -1;
        }
        if (acosb < -1) {
            acosb = -1;
        }
        const angA = Math.acos(acosa);
        const angB = Math.acos(acosb);
        let angC = -angA - angB;
        if (this._rightHandedSystem) {
            math_vector/* Matrix */.uq.RotationYawPitchRollToRef(0, 0, this._adjustRoll, mat2);
            mat2.multiplyToRef(mat1, mat1);
            math_vector/* Matrix */.uq.RotationAxisToRef(this._bendAxis, angB, mat2);
            mat2.multiplyToRef(mat1, mat1);
        }
        else {
            const _tmpVec = BoneIKController._TmpVecs[5];
            _tmpVec.copyFrom(this._bendAxis);
            _tmpVec.x *= -1;
            math_vector/* Matrix */.uq.RotationAxisToRef(_tmpVec, -angB, mat2);
            mat2.multiplyToRef(mat1, mat1);
        }
        if (this.poleAngle) {
            math_vector/* Matrix */.uq.RotationAxisToRef(yaxis, this.poleAngle, mat2);
            mat1.multiplyToRef(mat2, mat1);
        }
        if (this._bone1) {
            if (this.slerpAmount < 1) {
                if (!this._slerping) {
                    math_vector/* Quaternion */.PT.FromRotationMatrixToRef(this._bone1Mat, this._bone1Quat);
                }
                math_vector/* Quaternion */.PT.FromRotationMatrixToRef(mat1, tmpQuat);
                math_vector/* Quaternion */.PT.SlerpToRef(this._bone1Quat, tmpQuat, this.slerpAmount, this._bone1Quat);
                angC = this._bone2Ang * (1.0 - this.slerpAmount) + angC * this.slerpAmount;
                this._bone1.setRotationQuaternion(this._bone1Quat, 1 /* Space.WORLD */, this.mesh);
                this._slerping = true;
            }
            else {
                this._bone1.setRotationMatrix(mat1, 1 /* Space.WORLD */, this.mesh);
                this._bone1Mat.copyFrom(mat1);
                this._slerping = false;
            }
            this._updateLinkedTransformRotation(this._bone1);
        }
        this._bone2.setAxisAngle(this._bendAxis, angC, 0 /* Space.LOCAL */);
        this._updateLinkedTransformRotation(this._bone2);
        this._bone2Ang = angC;
    }
    _updateLinkedTransformRotation(bone) {
        if (bone._linkedTransformNode) {
            if (!bone._linkedTransformNode.rotationQuaternion) {
                bone._linkedTransformNode.rotationQuaternion = new math_vector/* Quaternion */.PT();
            }
            bone.getRotationQuaternionToRef(0 /* Space.LOCAL */, null, bone._linkedTransformNode.rotationQuaternion);
        }
    }
}
BoneIKController._TmpVecs = [math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Zero()];
BoneIKController._TmpQuat = math_vector/* Quaternion */.PT.Identity();
BoneIKController._TmpMats = [math_vector/* Matrix */.uq.Identity(), math_vector/* Matrix */.uq.Identity()];
//# sourceMappingURL=boneIKController.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/arrayTools.js
var arrayTools = __webpack_require__(27309);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.axis.js
var math_axis = __webpack_require__(18733);
;// ./node_modules/@babylonjs/core/Bones/boneLookController.js



/**
 * Class used to make a bone look toward a point in space
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons#bonelookcontroller
 */
class BoneLookController {
    /**
     * Gets or sets the minimum yaw angle that the bone can look to
     */
    get minYaw() {
        return this._minYaw;
    }
    set minYaw(value) {
        this._minYaw = value;
        this._minYawSin = Math.sin(value);
        this._minYawCos = Math.cos(value);
        if (this._maxYaw != null) {
            this._midYawConstraint = this._getAngleDiff(this._minYaw, this._maxYaw) * 0.5 + this._minYaw;
            this._yawRange = this._maxYaw - this._minYaw;
        }
    }
    /**
     * Gets or sets the maximum yaw angle that the bone can look to
     */
    get maxYaw() {
        return this._maxYaw;
    }
    set maxYaw(value) {
        this._maxYaw = value;
        this._maxYawSin = Math.sin(value);
        this._maxYawCos = Math.cos(value);
        if (this._minYaw != null) {
            this._midYawConstraint = this._getAngleDiff(this._minYaw, this._maxYaw) * 0.5 + this._minYaw;
            this._yawRange = this._maxYaw - this._minYaw;
        }
    }
    /**
     * Gets or sets the minimum pitch angle that the bone can look to
     */
    get minPitch() {
        return this._minPitch;
    }
    set minPitch(value) {
        this._minPitch = value;
        this._minPitchTan = Math.tan(value);
    }
    /**
     * Gets or sets the maximum pitch angle that the bone can look to
     */
    get maxPitch() {
        return this._maxPitch;
    }
    set maxPitch(value) {
        this._maxPitch = value;
        this._maxPitchTan = Math.tan(value);
    }
    /**
     * Create a BoneLookController
     * @param mesh the TransformNode that the bone belongs to
     * @param bone the bone that will be looking to the target
     * @param target the target Vector3 to look at
     * @param options optional settings:
     * * maxYaw: the maximum angle the bone will yaw to
     * * minYaw: the minimum angle the bone will yaw to
     * * maxPitch: the maximum angle the bone will pitch to
     * * minPitch: the minimum angle the bone will yaw to
     * * slerpAmount: set the between 0 and 1 to make the bone slerp to the target.
     * * upAxis: the up axis of the coordinate system
     * * upAxisSpace: the space that the up axis is in - Space.BONE, Space.LOCAL (default), or Space.WORLD.
     * * yawAxis: set yawAxis if the bone does not yaw on the y axis
     * * pitchAxis: set pitchAxis if the bone does not pitch on the x axis
     * * adjustYaw: used to make an adjustment to the yaw of the bone
     * * adjustPitch: used to make an adjustment to the pitch of the bone
     * * adjustRoll: used to make an adjustment to the roll of the bone
     * @param options.maxYaw
     * @param options.minYaw
     * @param options.maxPitch
     * @param options.minPitch
     * @param options.slerpAmount
     * @param options.upAxis
     * @param options.upAxisSpace
     * @param options.yawAxis
     * @param options.pitchAxis
     * @param options.adjustYaw
     * @param options.adjustPitch
     * @param options.adjustRoll
     **/
    constructor(mesh, bone, target, options) {
        /**
         * The up axis of the coordinate system that is used when the bone is rotated
         */
        this.upAxis = math_vector/* Vector3 */.Pq.Up();
        /**
         * The space that the up axis is in - Space.BONE, Space.LOCAL (default), or Space.WORLD
         */
        this.upAxisSpace = 0 /* Space.LOCAL */;
        /**
         * Used to make an adjustment to the yaw of the bone
         */
        this.adjustYaw = 0;
        /**
         * Used to make an adjustment to the pitch of the bone
         */
        this.adjustPitch = 0;
        /**
         * Used to make an adjustment to the roll of the bone
         */
        this.adjustRoll = 0;
        /**
         * The amount to slerp (spherical linear interpolation) to the target.  Set this to a value between 0 and 1 (a value of 1 disables slerp)
         */
        this.slerpAmount = 1;
        this._boneQuat = math_vector/* Quaternion */.PT.Identity();
        this._slerping = false;
        this._firstFrameSkipped = false;
        this._fowardAxis = math_vector/* Vector3 */.Pq.Forward();
        /**
         * Use the absolute value for yaw when checking the min/max constraints
         */
        this.useAbsoluteValueForYaw = false;
        this.mesh = mesh;
        this.bone = bone;
        this.target = target;
        if (options) {
            if (options.adjustYaw) {
                this.adjustYaw = options.adjustYaw;
            }
            if (options.adjustPitch) {
                this.adjustPitch = options.adjustPitch;
            }
            if (options.adjustRoll) {
                this.adjustRoll = options.adjustRoll;
            }
            if (options.maxYaw != null) {
                this.maxYaw = options.maxYaw;
            }
            else {
                this.maxYaw = Math.PI;
            }
            if (options.minYaw != null) {
                this.minYaw = options.minYaw;
            }
            else {
                this.minYaw = -Math.PI;
            }
            if (options.maxPitch != null) {
                this.maxPitch = options.maxPitch;
            }
            else {
                this.maxPitch = Math.PI;
            }
            if (options.minPitch != null) {
                this.minPitch = options.minPitch;
            }
            else {
                this.minPitch = -Math.PI;
            }
            if (options.slerpAmount != null) {
                this.slerpAmount = options.slerpAmount;
            }
            if (options.upAxis != null) {
                this.upAxis = options.upAxis;
            }
            if (options.upAxisSpace != null) {
                this.upAxisSpace = options.upAxisSpace;
            }
            if (options.yawAxis != null || options.pitchAxis != null) {
                let newYawAxis = math_axis/* Axis */._0.Y;
                let newPitchAxis = math_axis/* Axis */._0.X;
                if (options.yawAxis != null) {
                    newYawAxis = options.yawAxis.clone();
                    newYawAxis.normalize();
                }
                if (options.pitchAxis != null) {
                    newPitchAxis = options.pitchAxis.clone();
                    newPitchAxis.normalize();
                }
                const newRollAxis = math_vector/* Vector3 */.Pq.Cross(newPitchAxis, newYawAxis);
                this._transformYawPitch = math_vector/* Matrix */.uq.Identity();
                math_vector/* Matrix */.uq.FromXYZAxesToRef(newPitchAxis, newYawAxis, newRollAxis, this._transformYawPitch);
                this._transformYawPitchInv = this._transformYawPitch.clone();
                this._transformYawPitch.invert();
            }
            if (options.useAbsoluteValueForYaw !== undefined) {
                this.useAbsoluteValueForYaw = options.useAbsoluteValueForYaw;
            }
        }
        if (!bone.getParent() && this.upAxisSpace == 2 /* Space.BONE */) {
            this.upAxisSpace = 0 /* Space.LOCAL */;
        }
    }
    /**
     * Update the bone to look at the target.  This should be called before the scene is rendered (use scene.registerBeforeRender())
     */
    update() {
        //skip the first frame when slerping so that the TransformNode rotation is correct
        if (this.slerpAmount < 1 && !this._firstFrameSkipped) {
            this._firstFrameSkipped = true;
            return;
        }
        const bone = this.bone;
        const bonePos = BoneLookController._TmpVecs[0];
        bone.getAbsolutePositionToRef(this.mesh, bonePos);
        let target = this.target;
        const _tmpMat1 = BoneLookController._TmpMats[0];
        const _tmpMat2 = BoneLookController._TmpMats[1];
        const mesh = this.mesh;
        const parentBone = bone.getParent();
        const upAxis = BoneLookController._TmpVecs[1];
        upAxis.copyFrom(this.upAxis);
        if (this.upAxisSpace == 2 /* Space.BONE */ && parentBone) {
            if (this._transformYawPitch) {
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(upAxis, this._transformYawPitchInv, upAxis);
            }
            parentBone.getDirectionToRef(upAxis, this.mesh, upAxis);
        }
        else if (this.upAxisSpace == 0 /* Space.LOCAL */) {
            mesh.getDirectionToRef(upAxis, upAxis);
            if (mesh.scaling.x != 1 || mesh.scaling.y != 1 || mesh.scaling.z != 1) {
                upAxis.normalize();
            }
        }
        let checkYaw = false;
        let checkPitch = false;
        if (this._maxYaw != Math.PI || this._minYaw != -Math.PI) {
            checkYaw = true;
        }
        if (this._maxPitch != Math.PI || this._minPitch != -Math.PI) {
            checkPitch = true;
        }
        if (checkYaw || checkPitch) {
            const spaceMat = BoneLookController._TmpMats[2];
            const spaceMatInv = BoneLookController._TmpMats[3];
            if (this.upAxisSpace == 2 /* Space.BONE */ && upAxis.y == 1 && parentBone) {
                parentBone.getRotationMatrixToRef(1 /* Space.WORLD */, this.mesh, spaceMat);
            }
            else if (this.upAxisSpace == 0 /* Space.LOCAL */ && upAxis.y == 1 && !parentBone) {
                spaceMat.copyFrom(mesh.getWorldMatrix());
            }
            else {
                let forwardAxis = BoneLookController._TmpVecs[2];
                forwardAxis.copyFrom(this._fowardAxis);
                if (this._transformYawPitch) {
                    math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(forwardAxis, this._transformYawPitchInv, forwardAxis);
                }
                if (parentBone) {
                    parentBone.getDirectionToRef(forwardAxis, this.mesh, forwardAxis);
                }
                else {
                    mesh.getDirectionToRef(forwardAxis, forwardAxis);
                }
                const rightAxis = math_vector/* Vector3 */.Pq.Cross(upAxis, forwardAxis);
                rightAxis.normalize();
                forwardAxis = math_vector/* Vector3 */.Pq.Cross(rightAxis, upAxis);
                math_vector/* Matrix */.uq.FromXYZAxesToRef(rightAxis, upAxis, forwardAxis, spaceMat);
            }
            spaceMat.invertToRef(spaceMatInv);
            let xzlen = null;
            if (checkPitch) {
                const localTarget = BoneLookController._TmpVecs[3];
                target.subtractToRef(bonePos, localTarget);
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(localTarget, spaceMatInv, localTarget);
                xzlen = Math.sqrt(localTarget.x * localTarget.x + localTarget.z * localTarget.z);
                const pitch = Math.atan2(localTarget.y, xzlen);
                let newPitch = pitch;
                if (pitch > this._maxPitch) {
                    localTarget.y = this._maxPitchTan * xzlen;
                    newPitch = this._maxPitch;
                }
                else if (pitch < this._minPitch) {
                    localTarget.y = this._minPitchTan * xzlen;
                    newPitch = this._minPitch;
                }
                if (pitch != newPitch) {
                    math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(localTarget, spaceMat, localTarget);
                    localTarget.addInPlace(bonePos);
                    target = localTarget;
                }
            }
            if (checkYaw) {
                const localTarget = BoneLookController._TmpVecs[4];
                target.subtractToRef(bonePos, localTarget);
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(localTarget, spaceMatInv, localTarget);
                const yaw = Math.atan2(localTarget.x, localTarget.z);
                const yawCheck = this.useAbsoluteValueForYaw ? Math.abs(yaw) : yaw;
                let newYaw = yaw;
                if (yawCheck > this._maxYaw || yawCheck < this._minYaw) {
                    if (xzlen == null) {
                        xzlen = Math.sqrt(localTarget.x * localTarget.x + localTarget.z * localTarget.z);
                    }
                    if (this._yawRange > Math.PI) {
                        if (this._isAngleBetween(yaw, this._maxYaw, this._midYawConstraint)) {
                            localTarget.z = this._maxYawCos * xzlen;
                            localTarget.x = this._maxYawSin * xzlen;
                            newYaw = this._maxYaw;
                        }
                        else if (this._isAngleBetween(yaw, this._midYawConstraint, this._minYaw)) {
                            localTarget.z = this._minYawCos * xzlen;
                            localTarget.x = this._minYawSin * xzlen;
                            newYaw = this._minYaw;
                        }
                    }
                    else {
                        if (yawCheck > this._maxYaw) {
                            localTarget.z = this._maxYawCos * xzlen;
                            localTarget.x = this._maxYawSin * xzlen;
                            if (yaw < 0 && this.useAbsoluteValueForYaw) {
                                localTarget.x *= -1;
                            }
                            newYaw = this._maxYaw;
                        }
                        else if (yawCheck < this._minYaw) {
                            localTarget.z = this._minYawCos * xzlen;
                            localTarget.x = this._minYawSin * xzlen;
                            if (yaw < 0 && this.useAbsoluteValueForYaw) {
                                localTarget.x *= -1;
                            }
                            newYaw = this._minYaw;
                        }
                    }
                }
                if (this._slerping && this._yawRange > Math.PI) {
                    //are we going to be crossing into the min/max region?
                    const boneFwd = BoneLookController._TmpVecs[8];
                    boneFwd.copyFrom(math_axis/* Axis */._0.Z);
                    if (this._transformYawPitch) {
                        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(boneFwd, this._transformYawPitchInv, boneFwd);
                    }
                    const boneRotMat = BoneLookController._TmpMats[4];
                    this._boneQuat.toRotationMatrix(boneRotMat);
                    this.mesh.getWorldMatrix().multiplyToRef(boneRotMat, boneRotMat);
                    math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(boneFwd, boneRotMat, boneFwd);
                    math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(boneFwd, spaceMatInv, boneFwd);
                    const boneYaw = Math.atan2(boneFwd.x, boneFwd.z);
                    const angBtwTar = this._getAngleBetween(boneYaw, yaw);
                    const angBtwMidYaw = this._getAngleBetween(boneYaw, this._midYawConstraint);
                    if (angBtwTar > angBtwMidYaw) {
                        if (xzlen == null) {
                            xzlen = Math.sqrt(localTarget.x * localTarget.x + localTarget.z * localTarget.z);
                        }
                        const angBtwMax = this._getAngleBetween(boneYaw, this._maxYaw);
                        const angBtwMin = this._getAngleBetween(boneYaw, this._minYaw);
                        if (angBtwMin < angBtwMax) {
                            newYaw = boneYaw + Math.PI * 0.75;
                            localTarget.z = Math.cos(newYaw) * xzlen;
                            localTarget.x = Math.sin(newYaw) * xzlen;
                        }
                        else {
                            newYaw = boneYaw - Math.PI * 0.75;
                            localTarget.z = Math.cos(newYaw) * xzlen;
                            localTarget.x = Math.sin(newYaw) * xzlen;
                        }
                    }
                }
                if (yaw != newYaw) {
                    math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(localTarget, spaceMat, localTarget);
                    localTarget.addInPlace(bonePos);
                    target = localTarget;
                }
            }
        }
        const zaxis = BoneLookController._TmpVecs[5];
        const xaxis = BoneLookController._TmpVecs[6];
        const yaxis = BoneLookController._TmpVecs[7];
        const tmpQuat = BoneLookController._TmpQuat;
        const boneScaling = BoneLookController._TmpVecs[9];
        target.subtractToRef(bonePos, zaxis);
        zaxis.normalize();
        math_vector/* Vector3 */.Pq.CrossToRef(upAxis, zaxis, xaxis);
        xaxis.normalize();
        math_vector/* Vector3 */.Pq.CrossToRef(zaxis, xaxis, yaxis);
        yaxis.normalize();
        math_vector/* Matrix */.uq.FromXYZAxesToRef(xaxis, yaxis, zaxis, _tmpMat1);
        if (xaxis.x === 0 && xaxis.y === 0 && xaxis.z === 0) {
            return;
        }
        if (yaxis.x === 0 && yaxis.y === 0 && yaxis.z === 0) {
            return;
        }
        if (zaxis.x === 0 && zaxis.y === 0 && zaxis.z === 0) {
            return;
        }
        if (this.adjustYaw || this.adjustPitch || this.adjustRoll) {
            math_vector/* Matrix */.uq.RotationYawPitchRollToRef(this.adjustYaw, this.adjustPitch, this.adjustRoll, _tmpMat2);
            _tmpMat2.multiplyToRef(_tmpMat1, _tmpMat1);
        }
        boneScaling.copyFrom(this.bone.getScale());
        if (this.slerpAmount < 1) {
            if (!this._slerping) {
                this.bone.getRotationQuaternionToRef(1 /* Space.WORLD */, this.mesh, this._boneQuat);
            }
            if (this._transformYawPitch) {
                this._transformYawPitch.multiplyToRef(_tmpMat1, _tmpMat1);
            }
            math_vector/* Quaternion */.PT.FromRotationMatrixToRef(_tmpMat1, tmpQuat);
            math_vector/* Quaternion */.PT.SlerpToRef(this._boneQuat, tmpQuat, this.slerpAmount, this._boneQuat);
            this.bone.setRotationQuaternion(this._boneQuat, 1 /* Space.WORLD */, this.mesh);
            this._slerping = true;
        }
        else {
            if (this._transformYawPitch) {
                this._transformYawPitch.multiplyToRef(_tmpMat1, _tmpMat1);
            }
            this.bone.setRotationMatrix(_tmpMat1, 1 /* Space.WORLD */, this.mesh);
            this._slerping = false;
        }
        this.bone.setScale(boneScaling);
        this._updateLinkedTransformRotation();
    }
    _getAngleDiff(ang1, ang2) {
        let angDiff = ang2 - ang1;
        angDiff %= Math.PI * 2;
        if (angDiff > Math.PI) {
            angDiff -= Math.PI * 2;
        }
        else if (angDiff < -Math.PI) {
            angDiff += Math.PI * 2;
        }
        return angDiff;
    }
    _getAngleBetween(ang1, ang2) {
        ang1 %= 2 * Math.PI;
        ang1 = ang1 < 0 ? ang1 + 2 * Math.PI : ang1;
        ang2 %= 2 * Math.PI;
        ang2 = ang2 < 0 ? ang2 + 2 * Math.PI : ang2;
        let ab = 0;
        if (ang1 < ang2) {
            ab = ang2 - ang1;
        }
        else {
            ab = ang1 - ang2;
        }
        if (ab > Math.PI) {
            ab = Math.PI * 2 - ab;
        }
        return ab;
    }
    _isAngleBetween(ang, ang1, ang2) {
        ang %= 2 * Math.PI;
        ang = ang < 0 ? ang + 2 * Math.PI : ang;
        ang1 %= 2 * Math.PI;
        ang1 = ang1 < 0 ? ang1 + 2 * Math.PI : ang1;
        ang2 %= 2 * Math.PI;
        ang2 = ang2 < 0 ? ang2 + 2 * Math.PI : ang2;
        if (ang1 < ang2) {
            if (ang > ang1 && ang < ang2) {
                return true;
            }
        }
        else {
            if (ang > ang2 && ang < ang1) {
                return true;
            }
        }
        return false;
    }
    _updateLinkedTransformRotation() {
        const bone = this.bone;
        if (bone._linkedTransformNode) {
            if (!bone._linkedTransformNode.rotationQuaternion) {
                bone._linkedTransformNode.rotationQuaternion = new math_vector/* Quaternion */.PT();
            }
            bone.getRotationQuaternionToRef(0 /* Space.LOCAL */, null, bone._linkedTransformNode.rotationQuaternion);
        }
    }
}
BoneLookController._TmpVecs = (0,arrayTools/* BuildArray */.mI)(10, math_vector/* Vector3 */.Pq.Zero);
BoneLookController._TmpQuat = math_vector/* Quaternion */.PT.Identity();
BoneLookController._TmpMats = (0,arrayTools/* BuildArray */.mI)(5, math_vector/* Matrix */.uq.Identity);
//# sourceMappingURL=boneLookController.js.map
;// ./node_modules/@babylonjs/core/Bones/index.js




//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/buffer.js
var Buffers_buffer = __webpack_require__(95616);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/bufferUtils.js
var bufferUtils = __webpack_require__(11675);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/dataBuffer.js
var dataBuffer = __webpack_require__(71504);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Buffers/storageBuffer.js
var storageBuffer = __webpack_require__(31367);
;// ./node_modules/@babylonjs/core/Buffers/buffer.align.js

const isLittleEndian = (() => {
    const array = new Uint8Array(4);
    const view = new Uint32Array(array.buffer);
    return !!((view[0] = 1) & array[0]);
})();
Object.defineProperty(Buffers_buffer/* VertexBuffer */.R.prototype, "effectiveByteStride", {
    get: function () {
        return (this._alignedBuffer && this._alignedBuffer.byteStride) || this.byteStride;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(Buffers_buffer/* VertexBuffer */.R.prototype, "effectiveByteOffset", {
    get: function () {
        return this._alignedBuffer ? 0 : this.byteOffset;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(Buffers_buffer/* VertexBuffer */.R.prototype, "effectiveBuffer", {
    get: function () {
        return (this._alignedBuffer && this._alignedBuffer.getBuffer()) || this._buffer.getBuffer();
    },
    enumerable: true,
    configurable: true,
});
Buffers_buffer/* VertexBuffer */.R.prototype._rebuild = function () {
    this._buffer?._rebuild();
    this._alignedBuffer?._rebuild();
};
Buffers_buffer/* VertexBuffer */.R.prototype.dispose = function () {
    if (this._ownsBuffer) {
        this._buffer.dispose();
    }
    this._alignedBuffer?.dispose();
    this._alignedBuffer = undefined;
    this._isDisposed = true;
};
Buffers_buffer/* VertexBuffer */.R.prototype.getWrapperBuffer = function () {
    return this._alignedBuffer || this._buffer;
};
Buffers_buffer/* VertexBuffer */.R.prototype._alignBuffer = function () {
    const data = this._buffer.getData();
    if (!this.engine._features.forceVertexBufferStrideAndOffsetMultiple4Bytes || (this.byteStride % 4 === 0 && this.byteOffset % 4 === 0) || !data) {
        return;
    }
    const typeByteLength = Buffers_buffer/* VertexBuffer */.R.GetTypeByteLength(this.type);
    const alignedByteStride = (this.byteStride + 3) & ~3;
    const alignedSize = alignedByteStride / typeByteLength;
    const totalVertices = this._maxVerticesCount;
    const totalByteLength = totalVertices * alignedByteStride;
    const totalLength = totalByteLength / typeByteLength;
    let sourceData;
    if (Array.isArray(data)) {
        const sourceDataAsFloat = new Float32Array(data);
        sourceData = new DataView(sourceDataAsFloat.buffer, sourceDataAsFloat.byteOffset, sourceDataAsFloat.byteLength);
    }
    else if (data instanceof ArrayBuffer) {
        sourceData = new DataView(data, 0, data.byteLength);
    }
    else {
        sourceData = new DataView(data.buffer, data.byteOffset, data.byteLength);
    }
    let alignedData;
    if (this.type === Buffers_buffer/* VertexBuffer */.R.BYTE) {
        alignedData = new Int8Array(totalLength);
    }
    else if (this.type === Buffers_buffer/* VertexBuffer */.R.UNSIGNED_BYTE) {
        alignedData = new Uint8Array(totalLength);
    }
    else if (this.type === Buffers_buffer/* VertexBuffer */.R.SHORT) {
        alignedData = new Int16Array(totalLength);
    }
    else if (this.type === Buffers_buffer/* VertexBuffer */.R.UNSIGNED_SHORT) {
        alignedData = new Uint16Array(totalLength);
    }
    else if (this.type === Buffers_buffer/* VertexBuffer */.R.INT) {
        alignedData = new Int32Array(totalLength);
    }
    else if (this.type === Buffers_buffer/* VertexBuffer */.R.UNSIGNED_INT) {
        alignedData = new Uint32Array(totalLength);
    }
    else {
        alignedData = new Float32Array(totalLength);
    }
    const numComponents = this.getSize();
    let sourceOffset = this.byteOffset;
    for (let i = 0; i < totalVertices; ++i) {
        for (let j = 0; j < numComponents; ++j) {
            switch (this.type) {
                case Buffers_buffer/* VertexBuffer */.R.BYTE:
                    alignedData[i * alignedSize + j] = sourceData.getInt8(sourceOffset + j);
                    break;
                case Buffers_buffer/* VertexBuffer */.R.UNSIGNED_BYTE:
                    alignedData[i * alignedSize + j] = sourceData.getUint8(sourceOffset + j);
                    break;
                case Buffers_buffer/* VertexBuffer */.R.SHORT:
                    alignedData[i * alignedSize + j] = sourceData.getInt16(sourceOffset + j * 2, isLittleEndian);
                    break;
                case Buffers_buffer/* VertexBuffer */.R.UNSIGNED_SHORT:
                    alignedData[i * alignedSize + j] = sourceData.getUint16(sourceOffset + j * 2, isLittleEndian);
                    break;
                case Buffers_buffer/* VertexBuffer */.R.INT:
                    alignedData[i * alignedSize + j] = sourceData.getInt32(sourceOffset + j * 4, isLittleEndian);
                    break;
                case Buffers_buffer/* VertexBuffer */.R.UNSIGNED_INT:
                    alignedData[i * alignedSize + j] = sourceData.getUint32(sourceOffset + j * 4, isLittleEndian);
                    break;
                case Buffers_buffer/* VertexBuffer */.R.FLOAT:
                    alignedData[i * alignedSize + j] = sourceData.getFloat32(sourceOffset + j * 4, isLittleEndian);
                    break;
            }
        }
        sourceOffset += this.byteStride;
    }
    this._alignedBuffer?.dispose();
    this._alignedBuffer = new Buffers_buffer/* Buffer */.h(this.engine, alignedData, false, alignedByteStride, false, this.getIsInstanced(), true, this.instanceDivisor, (this._label ?? "VertexBuffer") + "_aligned");
};
//# sourceMappingURL=buffer.align.js.map
;// ./node_modules/@babylonjs/core/Buffers/index.js





//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraMouseWheelInput.js
var BaseCameraMouseWheelInput = __webpack_require__(54973);
;// ./node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraPointersInput.js




/**
 * Base class for Camera Pointer Inputs.
 * See FollowCameraPointersInput in src/Cameras/Inputs/followCameraPointersInput.ts
 * for example usage.
 */
class BaseCameraPointersInput {
    constructor() {
        this._currentActiveButton = -1;
        /**
         * Defines the buttons associated with the input to handle camera move.
         */
        this.buttons = [0, 1, 2];
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        const engine = this.camera.getEngine();
        const element = engine.getInputElement();
        let previousPinchSquaredDistance = 0;
        let previousMultiTouchPanPosition = null;
        this._pointA = null;
        this._pointB = null;
        this._altKey = false;
        this._ctrlKey = false;
        this._metaKey = false;
        this._shiftKey = false;
        this._buttonsPressed = 0;
        this._pointerInput = (p) => {
            const evt = p.event;
            const isTouch = evt.pointerType === "touch";
            if (p.type !== pointerEvents/* PointerEventTypes */.Zp.POINTERMOVE && this.buttons.indexOf(evt.button) === -1) {
                return;
            }
            const srcElement = evt.target;
            this._altKey = evt.altKey;
            this._ctrlKey = evt.ctrlKey;
            this._metaKey = evt.metaKey;
            this._shiftKey = evt.shiftKey;
            this._buttonsPressed = evt.buttons;
            if (engine.isPointerLock) {
                const offsetX = evt.movementX;
                const offsetY = evt.movementY;
                this.onTouch(null, offsetX, offsetY);
                this._pointA = null;
                this._pointB = null;
            }
            else if (p.type !== pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN &&
                p.type !== pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP &&
                isTouch &&
                this._pointA?.pointerId !== evt.pointerId &&
                this._pointB?.pointerId !== evt.pointerId) {
                return; // If we get a non-down event for a touch that we're not tracking, ignore it
            }
            else if (p.type === pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN && (this._currentActiveButton === -1 || isTouch)) {
                try {
                    srcElement?.setPointerCapture(evt.pointerId);
                }
                catch (e) {
                    //Nothing to do with the error. Execution will continue.
                }
                if (this._pointA === null) {
                    this._pointA = {
                        x: evt.clientX,
                        y: evt.clientY,
                        pointerId: evt.pointerId,
                        type: evt.pointerType,
                    };
                }
                else if (this._pointB === null) {
                    this._pointB = {
                        x: evt.clientX,
                        y: evt.clientY,
                        pointerId: evt.pointerId,
                        type: evt.pointerType,
                    };
                }
                else {
                    return; // We are already tracking two pointers so ignore this one
                }
                if (this._currentActiveButton === -1 && !isTouch) {
                    this._currentActiveButton = evt.button;
                }
                this.onButtonDown(evt);
                if (!noPreventDefault) {
                    evt.preventDefault();
                    element && element.focus();
                }
            }
            else if (p.type === pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP) {
                this.onDoubleTap(evt.pointerType);
            }
            else if (p.type === pointerEvents/* PointerEventTypes */.Zp.POINTERUP && (this._currentActiveButton === evt.button || isTouch)) {
                try {
                    srcElement?.releasePointerCapture(evt.pointerId);
                }
                catch (e) {
                    //Nothing to do with the error.
                }
                if (!isTouch) {
                    this._pointB = null; // Mouse and pen are mono pointer
                }
                //would be better to use pointers.remove(evt.pointerId) for multitouch gestures,
                //but emptying completely pointers collection is required to fix a bug on iPhone :
                //when changing orientation while pinching camera,
                //one pointer stay pressed forever if we don't release all pointers
                //will be ok to put back pointers.remove(evt.pointerId); when iPhone bug corrected
                if (engine._badOS) {
                    this._pointA = this._pointB = null;
                }
                else {
                    //only remove the impacted pointer in case of multitouch allowing on most
                    //platforms switching from rotate to zoom and pan seamlessly.
                    if (this._pointB && this._pointA && this._pointA.pointerId == evt.pointerId) {
                        this._pointA = this._pointB;
                        this._pointB = null;
                    }
                    else if (this._pointA && this._pointB && this._pointB.pointerId == evt.pointerId) {
                        this._pointB = null;
                    }
                    else {
                        this._pointA = this._pointB = null;
                    }
                }
                if (previousPinchSquaredDistance !== 0 || previousMultiTouchPanPosition) {
                    // Previous pinch data is populated but a button has been lifted
                    // so pinch has ended.
                    this.onMultiTouch(this._pointA, this._pointB, previousPinchSquaredDistance, 0, // pinchSquaredDistance
                    previousMultiTouchPanPosition, null // multiTouchPanPosition
                    );
                    previousPinchSquaredDistance = 0;
                    previousMultiTouchPanPosition = null;
                }
                this._currentActiveButton = -1;
                this.onButtonUp(evt);
                if (!noPreventDefault) {
                    evt.preventDefault();
                }
            }
            else if (p.type === pointerEvents/* PointerEventTypes */.Zp.POINTERMOVE) {
                if (!noPreventDefault) {
                    evt.preventDefault();
                }
                // One button down
                if (this._pointA && this._pointB === null) {
                    const offsetX = evt.clientX - this._pointA.x;
                    const offsetY = evt.clientY - this._pointA.y;
                    this._pointA.x = evt.clientX;
                    this._pointA.y = evt.clientY;
                    this.onTouch(this._pointA, offsetX, offsetY);
                }
                // Two buttons down: pinch
                else if (this._pointA && this._pointB) {
                    const ed = this._pointA.pointerId === evt.pointerId ? this._pointA : this._pointB;
                    ed.x = evt.clientX;
                    ed.y = evt.clientY;
                    const distX = this._pointA.x - this._pointB.x;
                    const distY = this._pointA.y - this._pointB.y;
                    const pinchSquaredDistance = distX * distX + distY * distY;
                    const multiTouchPanPosition = {
                        x: (this._pointA.x + this._pointB.x) / 2,
                        y: (this._pointA.y + this._pointB.y) / 2,
                        pointerId: evt.pointerId,
                        type: p.type,
                    };
                    this.onMultiTouch(this._pointA, this._pointB, previousPinchSquaredDistance, pinchSquaredDistance, previousMultiTouchPanPosition, multiTouchPanPosition);
                    previousMultiTouchPanPosition = multiTouchPanPosition;
                    previousPinchSquaredDistance = pinchSquaredDistance;
                }
            }
        };
        this._observer = this.camera
            .getScene()
            ._inputManager._addCameraPointerObserver(this._pointerInput, pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN | pointerEvents/* PointerEventTypes */.Zp.POINTERUP | pointerEvents/* PointerEventTypes */.Zp.POINTERMOVE | pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP);
        this._onLostFocus = () => {
            this._pointA = this._pointB = null;
            previousPinchSquaredDistance = 0;
            previousMultiTouchPanPosition = null;
            this.onLostFocus();
        };
        this._contextMenuBind = (evt) => this.onContextMenu(evt);
        element && element.addEventListener("contextmenu", this._contextMenuBind, false);
        const hostWindow = this.camera.getScene().getEngine().getHostWindow();
        if (hostWindow) {
            tools/* Tools */.S0.RegisterTopRootEvents(hostWindow, [{ name: "blur", handler: this._onLostFocus }]);
        }
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._onLostFocus) {
            const hostWindow = this.camera.getScene().getEngine().getHostWindow();
            if (hostWindow) {
                tools/* Tools */.S0.UnregisterTopRootEvents(hostWindow, [{ name: "blur", handler: this._onLostFocus }]);
            }
        }
        if (this._observer) {
            this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer);
            this._observer = null;
            if (this._contextMenuBind) {
                const inputElement = this.camera.getScene().getEngine().getInputElement();
                inputElement && inputElement.removeEventListener("contextmenu", this._contextMenuBind);
            }
            this._onLostFocus = null;
        }
        this._altKey = false;
        this._ctrlKey = false;
        this._metaKey = false;
        this._shiftKey = false;
        this._buttonsPressed = 0;
        this._currentActiveButton = -1;
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "BaseCameraPointersInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "pointers";
    }
    /**
     * Called on pointer POINTERDOUBLETAP event.
     * Override this method to provide functionality on POINTERDOUBLETAP event.
     * @param type type of event
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onDoubleTap(type) { }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    /**
     * Called on pointer POINTERMOVE event if only a single touch is active.
     * Override this method to provide functionality.
     * @param point The current position of the pointer
     * @param offsetX The offsetX of the pointer when the event occurred
     * @param offsetY The offsetY of the pointer when the event occurred
     */
    onTouch(point, offsetX, offsetY) { }
    /**
     * Called on pointer POINTERMOVE event if multiple touches are active.
     * Override this method to provide functionality.
     * @param _pointA First point in the pair
     * @param _pointB Second point in the pair
     * @param previousPinchSquaredDistance Sqr Distance between the points the last time this event was fired (by this input)
     * @param pinchSquaredDistance Sqr Distance between the points this time
     * @param previousMultiTouchPanPosition Previous center point between the points
     * @param multiTouchPanPosition Current center point between the points
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onMultiTouch(_pointA, _pointB, previousPinchSquaredDistance, pinchSquaredDistance, previousMultiTouchPanPosition, multiTouchPanPosition) { }
    /**
     * Called on JS contextmenu event.
     * Override this method to provide functionality.
     * @param evt the event to be handled
     */
    onContextMenu(evt) {
        evt.preventDefault();
    }
    /**
     * Called each time a new POINTERDOWN event occurs. Ie, for each button
     * press.
     * Override this method to provide functionality.
     * @param _evt Defines the event to track
     */
    onButtonDown(_evt) { }
    /**
     * Called each time a new POINTERUP event occurs. Ie, for each button
     * release.
     * Override this method to provide functionality.
     * @param _evt Defines the event to track
     */
    onButtonUp(_evt) { }
    /**
     * Called when window becomes inactive.
     * Override this method to provide functionality.
     */
    onLostFocus() { }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BaseCameraPointersInput.prototype, "buttons", void 0);
//# sourceMappingURL=BaseCameraPointersInput.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/cameraInputsManager.js
var cameraInputsManager = __webpack_require__(22002);
;// ./node_modules/@babylonjs/core/Gamepads/gamepad.js

/**
 * Represents a gamepad control stick position
 */
class StickValues {
    /**
     * Initializes the gamepad x and y control stick values
     * @param x The x component of the gamepad control stick value
     * @param y The y component of the gamepad control stick value
     */
    constructor(
    /**
     * The x component of the control stick
     */
    x, 
    /**
     * The y component of the control stick
     */
    y) {
        this.x = x;
        this.y = y;
    }
}
/**
 * Represents a gamepad
 */
class Gamepad {
    /**
     * Specifies if the gamepad has been connected
     */
    get isConnected() {
        return this._isConnected;
    }
    /**
     * Initializes the gamepad
     * @param id The id of the gamepad
     * @param index The index of the gamepad
     * @param browserGamepad The browser gamepad
     * @param leftStickX The x component of the left joystick
     * @param leftStickY The y component of the left joystick
     * @param rightStickX The x component of the right joystick
     * @param rightStickY The y component of the right joystick
     */
    constructor(
    /**
     * The id of the gamepad
     */
    id, 
    /**
     * The index of the gamepad
     */
    index, 
    /**
     * The browser gamepad
     */
    browserGamepad, leftStickX = 0, leftStickY = 1, rightStickX = 2, rightStickY = 3) {
        this.id = id;
        this.index = index;
        this.browserGamepad = browserGamepad;
        this._leftStick = { x: 0, y: 0 };
        this._rightStick = { x: 0, y: 0 };
        /** @internal */
        this._isConnected = true;
        /**
         * Specifies whether the left control stick should be Y-inverted
         */
        this._invertLeftStickY = false;
        this.type = Gamepad.GAMEPAD;
        this._leftStickAxisX = leftStickX;
        this._leftStickAxisY = leftStickY;
        this._rightStickAxisX = rightStickX;
        this._rightStickAxisY = rightStickY;
        if (this.browserGamepad.axes.length >= 2) {
            this._leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] };
        }
        if (this.browserGamepad.axes.length >= 4) {
            this._rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] };
        }
    }
    /**
     * Callback triggered when the left joystick has changed
     * @param callback callback to trigger
     */
    onleftstickchanged(callback) {
        this._onleftstickchanged = callback;
    }
    /**
     * Callback triggered when the right joystick has changed
     * @param callback callback to trigger
     */
    onrightstickchanged(callback) {
        this._onrightstickchanged = callback;
    }
    /**
     * Gets the left joystick
     */
    get leftStick() {
        return this._leftStick;
    }
    /**
     * Sets the left joystick values
     */
    set leftStick(newValues) {
        if (this._onleftstickchanged && (this._leftStick.x !== newValues.x || this._leftStick.y !== newValues.y)) {
            this._onleftstickchanged(newValues);
        }
        this._leftStick = newValues;
    }
    /**
     * Gets the right joystick
     */
    get rightStick() {
        return this._rightStick;
    }
    /**
     * Sets the right joystick value
     */
    set rightStick(newValues) {
        if (this._onrightstickchanged && (this._rightStick.x !== newValues.x || this._rightStick.y !== newValues.y)) {
            this._onrightstickchanged(newValues);
        }
        this._rightStick = newValues;
    }
    /**
     * Updates the gamepad joystick positions
     */
    update() {
        if (this._leftStick) {
            this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] };
            if (this._invertLeftStickY) {
                this.leftStick.y *= -1;
            }
        }
        if (this._rightStick) {
            this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] };
        }
    }
    /**
     * Disposes the gamepad
     */
    dispose() { }
}
/**
 * Represents a gamepad controller
 */
Gamepad.GAMEPAD = 0;
/**
 * Represents a generic controller
 */
Gamepad.GENERIC = 1;
/**
 * Represents an XBox controller
 */
Gamepad.XBOX = 2;
/**
 * Represents a pose-enabled controller
 */
Gamepad.POSE_ENABLED = 3;
/**
 * Represents an Dual Shock controller
 */
Gamepad.DUALSHOCK = 4;
/**
 * Represents a generic gamepad
 */
class GenericPad extends Gamepad {
    /**
     * Callback triggered when a button has been pressed
     * @param callback Called when a button has been pressed
     */
    onbuttondown(callback) {
        this._onbuttondown = callback;
    }
    /**
     * Callback triggered when a button has been released
     * @param callback Called when a button has been released
     */
    onbuttonup(callback) {
        this._onbuttonup = callback;
    }
    /**
     * Initializes the generic gamepad
     * @param id The id of the generic gamepad
     * @param index The index of the generic gamepad
     * @param browserGamepad The browser gamepad
     */
    constructor(id, index, browserGamepad) {
        super(id, index, browserGamepad);
        /**
         * Observable triggered when a button has been pressed
         */
        this.onButtonDownObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable triggered when a button has been released
         */
        this.onButtonUpObservable = new Misc_observable/* Observable */.cP();
        this.type = Gamepad.GENERIC;
        this._buttons = new Array(browserGamepad.buttons.length);
    }
    _setButtonValue(newValue, currentValue, buttonIndex) {
        if (newValue !== currentValue) {
            if (newValue === 1) {
                if (this._onbuttondown) {
                    this._onbuttondown(buttonIndex);
                }
                this.onButtonDownObservable.notifyObservers(buttonIndex);
            }
            if (newValue === 0) {
                if (this._onbuttonup) {
                    this._onbuttonup(buttonIndex);
                }
                this.onButtonUpObservable.notifyObservers(buttonIndex);
            }
        }
        return newValue;
    }
    /**
     * Updates the generic gamepad
     */
    update() {
        super.update();
        for (let index = 0; index < this._buttons.length; index++) {
            this._buttons[index] = this._setButtonValue(this.browserGamepad.buttons[index].value, this._buttons[index], index);
        }
    }
    /**
     * Disposes the generic gamepad
     */
    dispose() {
        super.dispose();
        this.onButtonDownObservable.clear();
        this.onButtonUpObservable.clear();
    }
}
//# sourceMappingURL=gamepad.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraGamepadInput.js




/**
 * Manage the gamepad inputs to control an arc rotate camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class ArcRotateCameraGamepadInput {
    constructor() {
        /**
         * Defines the gamepad rotation sensibility.
         * This is the threshold from when rotation starts to be accounted for to prevent jittering.
         */
        this.gamepadRotationSensibility = 80;
        /**
         * Defines the gamepad move sensibility.
         * This is the threshold from when moving starts to be accounted for for to prevent jittering.
         */
        this.gamepadMoveSensibility = 40;
        this._yAxisScale = 1.0;
    }
    /**
     * Gets or sets a boolean indicating that Yaxis (for right stick) should be inverted
     */
    get invertYAxis() {
        return this._yAxisScale !== 1.0;
    }
    set invertYAxis(value) {
        this._yAxisScale = value ? -1.0 : 1.0;
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     */
    attachControl() {
        const manager = this.camera.getScene().gamepadManager;
        this._onGamepadConnectedObserver = manager.onGamepadConnectedObservable.add((gamepad) => {
            if (gamepad.type !== Gamepad.POSE_ENABLED) {
                // prioritize XBOX gamepads.
                if (!this.gamepad || gamepad.type === Gamepad.XBOX) {
                    this.gamepad = gamepad;
                }
            }
        });
        this._onGamepadDisconnectedObserver = manager.onGamepadDisconnectedObservable.add((gamepad) => {
            if (this.gamepad === gamepad) {
                this.gamepad = null;
            }
        });
        this.gamepad = manager.getGamepadByType(Gamepad.XBOX);
        // if no xbox controller was found, but there are gamepad controllers, take the first one
        if (!this.gamepad && manager.gamepads.length) {
            this.gamepad = manager.gamepads[0];
        }
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver);
        this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver);
        this.gamepad = null;
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (this.gamepad) {
            const camera = this.camera;
            const rsValues = this.gamepad.rightStick;
            if (rsValues) {
                if (rsValues.x != 0) {
                    const normalizedRX = rsValues.x / this.gamepadRotationSensibility;
                    if (normalizedRX != 0 && Math.abs(normalizedRX) > 0.005) {
                        camera.inertialAlphaOffset += normalizedRX;
                    }
                }
                if (rsValues.y != 0) {
                    const normalizedRY = (rsValues.y / this.gamepadRotationSensibility) * this._yAxisScale;
                    if (normalizedRY != 0 && Math.abs(normalizedRY) > 0.005) {
                        camera.inertialBetaOffset += normalizedRY;
                    }
                }
            }
            const lsValues = this.gamepad.leftStick;
            if (lsValues && lsValues.y != 0) {
                const normalizedLY = lsValues.y / this.gamepadMoveSensibility;
                if (normalizedLY != 0 && Math.abs(normalizedLY) > 0.005) {
                    this.camera.inertialRadiusOffset -= normalizedLY;
                }
            }
        }
    }
    /**
     * Gets the class name of the current intput.
     * @returns the class name
     */
    getClassName() {
        return "ArcRotateCameraGamepadInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "gamepad";
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraGamepadInput.prototype, "gamepadRotationSensibility", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraGamepadInput.prototype, "gamepadMoveSensibility", void 0);
cameraInputsManager/* CameraInputTypes */.H["ArcRotateCameraGamepadInput"] = ArcRotateCameraGamepadInput;
//# sourceMappingURL=arcRotateCameraGamepadInput.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/keyboardEvents.js
var keyboardEvents = __webpack_require__(24146);
;// ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js





/**
 * Manage the keyboard inputs to control the movement of an arc rotate camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class ArcRotateCameraKeyboardMoveInput {
    constructor() {
        /**
         * Defines the list of key codes associated with the up action (increase alpha)
         */
        this.keysUp = [38];
        /**
         * Defines the list of key codes associated with the down action (decrease alpha)
         */
        this.keysDown = [40];
        /**
         * Defines the list of key codes associated with the left action (increase beta)
         */
        this.keysLeft = [37];
        /**
         * Defines the list of key codes associated with the right action (decrease beta)
         */
        this.keysRight = [39];
        /**
         * Defines the list of key codes associated with the reset action.
         * Those keys reset the camera to its last stored state (with the method camera.storeState())
         */
        this.keysReset = [220];
        /**
         * Defines the panning sensibility of the inputs.
         * (How fast is the camera panning)
         */
        this.panningSensibility = 50.0;
        /**
         * Defines the zooming sensibility of the inputs.
         * (How fast is the camera zooming)
         */
        this.zoomingSensibility = 25.0;
        /**
         * Defines whether maintaining the alt key down switch the movement mode from
         * orientation to zoom.
         */
        this.useAltToZoom = true;
        /**
         * Rotation speed of the camera
         */
        this.angularSpeed = 0.01;
        this._keys = new Array();
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        // was there a second variable defined?
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        if (this._onCanvasBlurObserver) {
            return;
        }
        this._scene = this.camera.getScene();
        this._engine = this._scene.getEngine();
        this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {
            this._keys.length = 0;
        });
        this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {
            const evt = info.event;
            if (!evt.metaKey) {
                if (info.type === keyboardEvents/* KeyboardEventTypes */.TB.KEYDOWN) {
                    this._ctrlPressed = evt.ctrlKey;
                    this._altPressed = evt.altKey;
                    if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
                        this.keysDown.indexOf(evt.keyCode) !== -1 ||
                        this.keysLeft.indexOf(evt.keyCode) !== -1 ||
                        this.keysRight.indexOf(evt.keyCode) !== -1 ||
                        this.keysReset.indexOf(evt.keyCode) !== -1) {
                        const index = this._keys.indexOf(evt.keyCode);
                        if (index === -1) {
                            this._keys.push(evt.keyCode);
                        }
                        if (evt.preventDefault) {
                            if (!noPreventDefault) {
                                evt.preventDefault();
                            }
                        }
                    }
                }
                else {
                    if (this.keysUp.indexOf(evt.keyCode) !== -1 ||
                        this.keysDown.indexOf(evt.keyCode) !== -1 ||
                        this.keysLeft.indexOf(evt.keyCode) !== -1 ||
                        this.keysRight.indexOf(evt.keyCode) !== -1 ||
                        this.keysReset.indexOf(evt.keyCode) !== -1) {
                        const index = this._keys.indexOf(evt.keyCode);
                        if (index >= 0) {
                            this._keys.splice(index, 1);
                        }
                        if (evt.preventDefault) {
                            if (!noPreventDefault) {
                                evt.preventDefault();
                            }
                        }
                    }
                }
            }
        });
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._scene) {
            if (this._onKeyboardObserver) {
                this._scene.onKeyboardObservable.remove(this._onKeyboardObserver);
            }
            if (this._onCanvasBlurObserver) {
                this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver);
            }
            this._onKeyboardObserver = null;
            this._onCanvasBlurObserver = null;
        }
        this._keys.length = 0;
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (this._onKeyboardObserver) {
            const camera = this.camera;
            for (let index = 0; index < this._keys.length; index++) {
                const keyCode = this._keys[index];
                if (this.keysLeft.indexOf(keyCode) !== -1) {
                    if (this._ctrlPressed && this.camera._useCtrlForPanning) {
                        camera.inertialPanningX -= 1 / this.panningSensibility;
                    }
                    else {
                        camera.inertialAlphaOffset -= this.angularSpeed;
                    }
                }
                else if (this.keysUp.indexOf(keyCode) !== -1) {
                    if (this._ctrlPressed && this.camera._useCtrlForPanning) {
                        camera.inertialPanningY += 1 / this.panningSensibility;
                    }
                    else if (this._altPressed && this.useAltToZoom) {
                        camera.inertialRadiusOffset += 1 / this.zoomingSensibility;
                    }
                    else {
                        camera.inertialBetaOffset -= this.angularSpeed;
                    }
                }
                else if (this.keysRight.indexOf(keyCode) !== -1) {
                    if (this._ctrlPressed && this.camera._useCtrlForPanning) {
                        camera.inertialPanningX += 1 / this.panningSensibility;
                    }
                    else {
                        camera.inertialAlphaOffset += this.angularSpeed;
                    }
                }
                else if (this.keysDown.indexOf(keyCode) !== -1) {
                    if (this._ctrlPressed && this.camera._useCtrlForPanning) {
                        camera.inertialPanningY -= 1 / this.panningSensibility;
                    }
                    else if (this._altPressed && this.useAltToZoom) {
                        camera.inertialRadiusOffset -= 1 / this.zoomingSensibility;
                    }
                    else {
                        camera.inertialBetaOffset += this.angularSpeed;
                    }
                }
                else if (this.keysReset.indexOf(keyCode) !== -1) {
                    if (camera.useInputToRestoreState) {
                        camera.restoreState();
                    }
                }
            }
        }
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "ArcRotateCameraKeyboardMoveInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "keyboard";
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraKeyboardMoveInput.prototype, "keysUp", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraKeyboardMoveInput.prototype, "keysDown", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraKeyboardMoveInput.prototype, "keysLeft", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraKeyboardMoveInput.prototype, "keysRight", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraKeyboardMoveInput.prototype, "keysReset", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraKeyboardMoveInput.prototype, "panningSensibility", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraKeyboardMoveInput.prototype, "zoomingSensibility", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraKeyboardMoveInput.prototype, "useAltToZoom", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraKeyboardMoveInput.prototype, "angularSpeed", void 0);
cameraInputsManager/* CameraInputTypes */.H["ArcRotateCameraKeyboardMoveInput"] = ArcRotateCameraKeyboardMoveInput;
//# sourceMappingURL=arcRotateCameraKeyboardMoveInput.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.plane.js
var math_plane = __webpack_require__(94100);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/deviceInputEvents.js
var deviceInputEvents = __webpack_require__(38123);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.scalar.functions.js
var math_scalar_functions = __webpack_require__(84867);
;// ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraMouseWheelInput.js










/**
 * Firefox uses a different scheme to report scroll distances to other
 * browsers. Rather than use complicated methods to calculate the exact
 * multiple we need to apply, let's just cheat and use a constant.
 * https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaMode
 * https://stackoverflow.com/questions/20110224/what-is-the-height-of-a-line-in-a-wheel-event-deltamode-dom-delta-line
 */
const ffMultiplier = 40;
/**
 * Manage the mouse wheel inputs to control an arc rotate camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class ArcRotateCameraMouseWheelInput {
    constructor() {
        /**
         * Gets or Set the mouse wheel precision or how fast is the camera zooming.
         */
        this.wheelPrecision = 3.0;
        /**
         * Gets or Set the boolean value that controls whether or not the mouse wheel
         * zooms to the location of the mouse pointer or not.  The default is false.
         */
        this.zoomToMouseLocation = false;
        /**
         * wheelDeltaPercentage will be used instead of wheelPrecision if different from 0.
         * It defines the percentage of current camera.radius to use as delta when wheel is used.
         */
        this.wheelDeltaPercentage = 0;
        /**
         * If set, this function will be used to set the radius delta that will be added to the current camera radius
         */
        this.customComputeDeltaFromMouseWheel = null;
        this._viewOffset = new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._globalOffset = new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._inertialPanning = math_vector/* Vector3 */.Pq.Zero();
    }
    _computeDeltaFromMouseWheelLegacyEvent(mouseWheelDelta, radius) {
        let delta = 0;
        const wheelDelta = mouseWheelDelta * 0.01 * this.wheelDeltaPercentage * radius;
        if (mouseWheelDelta > 0) {
            delta = wheelDelta / (1.0 + this.wheelDeltaPercentage);
        }
        else {
            delta = wheelDelta * (1.0 + this.wheelDeltaPercentage);
        }
        return delta;
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        this._wheel = (p) => {
            //sanity check - this should be a PointerWheel event.
            if (p.type !== pointerEvents/* PointerEventTypes */.Zp.POINTERWHEEL) {
                return;
            }
            const event = p.event;
            let delta = 0;
            const platformScale = event.deltaMode === deviceInputEvents/* EventConstants */.s.DOM_DELTA_LINE ? ffMultiplier : 1; // If this happens to be set to DOM_DELTA_LINE, adjust accordingly
            const wheelDelta = -(event.deltaY * platformScale);
            if (this.customComputeDeltaFromMouseWheel) {
                delta = this.customComputeDeltaFromMouseWheel(wheelDelta, this, event);
            }
            else {
                if (this.wheelDeltaPercentage) {
                    delta = this._computeDeltaFromMouseWheelLegacyEvent(wheelDelta, this.camera.radius);
                    // If zooming in, estimate the target radius and use that to compute the delta for inertia
                    // this will stop multiple scroll events zooming in from adding too much inertia
                    if (delta > 0) {
                        let estimatedTargetRadius = this.camera.radius;
                        let targetInertia = this.camera.inertialRadiusOffset + delta;
                        for (let i = 0; i < 20 && Math.abs(targetInertia) > 0.001; i++) {
                            estimatedTargetRadius -= targetInertia;
                            targetInertia *= this.camera.inertia;
                        }
                        estimatedTargetRadius = (0,math_scalar_functions.Clamp)(estimatedTargetRadius, 0, Number.MAX_VALUE);
                        delta = this._computeDeltaFromMouseWheelLegacyEvent(wheelDelta, estimatedTargetRadius);
                    }
                }
                else {
                    delta = wheelDelta / (this.wheelPrecision * 40);
                }
            }
            if (delta) {
                if (this.zoomToMouseLocation) {
                    // If we are zooming to the mouse location, then we need to get the hit plane at the start of the zoom gesture if it doesn't exist
                    // The hit plane is normally calculated after the first motion and each time there's motion so if we don't do this first,
                    // the first zoom will be to the center of the screen
                    if (!this._hitPlane) {
                        this._updateHitPlane();
                    }
                    this._zoomToMouse(delta);
                }
                else {
                    this.camera.inertialRadiusOffset += delta;
                }
            }
            if (event.preventDefault) {
                if (!noPreventDefault) {
                    event.preventDefault();
                }
            }
        };
        this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel, pointerEvents/* PointerEventTypes */.Zp.POINTERWHEEL);
        if (this.zoomToMouseLocation) {
            this._inertialPanning.setAll(0);
        }
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._observer) {
            this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer);
            this._observer = null;
            this._wheel = null;
        }
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (!this.zoomToMouseLocation) {
            return;
        }
        const camera = this.camera;
        const motion = 0.0 + camera.inertialAlphaOffset + camera.inertialBetaOffset + camera.inertialRadiusOffset;
        if (motion) {
            // if zooming is still happening as a result of inertia, then we also need to update
            // the hit plane.
            this._updateHitPlane();
            // Note we cannot  use arcRotateCamera.inertialPlanning here because arcRotateCamera panning
            // uses a different panningInertia which could cause this panning to get out of sync with
            // the zooming, and for this to work they must be exactly in sync.
            camera.target.addInPlace(this._inertialPanning);
            this._inertialPanning.scaleInPlace(camera.inertia);
            this._zeroIfClose(this._inertialPanning);
        }
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "ArcRotateCameraMouseWheelInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "mousewheel";
    }
    _updateHitPlane() {
        const camera = this.camera;
        const direction = camera.target.subtract(camera.position);
        this._hitPlane = math_plane/* Plane */.Z.FromPositionAndNormal(camera.target, direction);
    }
    // Get position on the hit plane
    _getPosition() {
        const camera = this.camera;
        const scene = camera.getScene();
        // since the _hitPlane is always updated to be orthogonal to the camera position vector
        // we don't have to worry about this ray shooting off to infinity. This ray creates
        // a vector defining where we want to zoom to.
        const ray = scene.createPickingRay(scene.pointerX, scene.pointerY, math_vector/* Matrix */.uq.Identity(), camera, false);
        // Since the camera is the origin of the picking ray, we need to offset it by the camera's offset manually
        // Because the offset is in view space, we need to convert it to world space first
        if (camera.targetScreenOffset.x !== 0 || camera.targetScreenOffset.y !== 0) {
            this._viewOffset.set(camera.targetScreenOffset.x, camera.targetScreenOffset.y, 0);
            camera.getViewMatrix().invertToRef(camera._cameraTransformMatrix);
            this._globalOffset = math_vector/* Vector3 */.Pq.TransformNormal(this._viewOffset, camera._cameraTransformMatrix);
            ray.origin.addInPlace(this._globalOffset);
        }
        let distance = 0;
        if (this._hitPlane) {
            distance = ray.intersectsPlane(this._hitPlane) ?? 0;
        }
        // not using this ray again, so modifying its vectors here is fine
        return ray.origin.addInPlace(ray.direction.scaleInPlace(distance));
    }
    _zoomToMouse(delta) {
        const camera = this.camera;
        const inertiaComp = 1 - camera.inertia;
        if (camera.lowerRadiusLimit) {
            const lowerLimit = camera.lowerRadiusLimit ?? 0;
            if (camera.radius - (camera.inertialRadiusOffset + delta) / inertiaComp < lowerLimit) {
                delta = (camera.radius - lowerLimit) * inertiaComp - camera.inertialRadiusOffset;
            }
        }
        if (camera.upperRadiusLimit) {
            const upperLimit = camera.upperRadiusLimit ?? 0;
            if (camera.radius - (camera.inertialRadiusOffset + delta) / inertiaComp > upperLimit) {
                delta = (camera.radius - upperLimit) * inertiaComp - camera.inertialRadiusOffset;
            }
        }
        const zoomDistance = delta / inertiaComp;
        const ratio = zoomDistance / camera.radius;
        const vec = this._getPosition();
        // Now this vector tells us how much we also need to pan the camera
        // so the targeted mouse location becomes the center of zooming.
        const directionToZoomLocation = math_vector/* TmpVectors */.AA.Vector3[6];
        vec.subtractToRef(camera.target, directionToZoomLocation);
        directionToZoomLocation.scaleInPlace(ratio);
        directionToZoomLocation.scaleInPlace(inertiaComp);
        this._inertialPanning.addInPlace(directionToZoomLocation);
        camera.inertialRadiusOffset += delta;
    }
    // Sets x y or z of passed in vector to zero if less than Epsilon.
    _zeroIfClose(vec) {
        if (Math.abs(vec.x) < math_constants/* Epsilon */.bH) {
            vec.x = 0;
        }
        if (Math.abs(vec.y) < math_constants/* Epsilon */.bH) {
            vec.y = 0;
        }
        if (Math.abs(vec.z) < math_constants/* Epsilon */.bH) {
            vec.z = 0;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraMouseWheelInput.prototype, "wheelPrecision", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraMouseWheelInput.prototype, "zoomToMouseLocation", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraMouseWheelInput.prototype, "wheelDeltaPercentage", void 0);
cameraInputsManager/* CameraInputTypes */.H["ArcRotateCameraMouseWheelInput"] = ArcRotateCameraMouseWheelInput;
//# sourceMappingURL=arcRotateCameraMouseWheelInput.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraPointersInput.js




/**
 * Manage the pointers inputs to control an arc rotate camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class ArcRotateCameraPointersInput extends BaseCameraPointersInput {
    constructor() {
        super(...arguments);
        /**
         * Defines the buttons associated with the input to handle camera move.
         */
        this.buttons = [0, 1, 2];
        /**
         * Defines the pointer angular sensibility  along the X axis or how fast is
         * the camera rotating.
         */
        this.angularSensibilityX = 1000.0;
        /**
         * Defines the pointer angular sensibility along the Y axis or how fast is
         * the camera rotating.
         */
        this.angularSensibilityY = 1000.0;
        /**
         * Defines the pointer pinch precision or how fast is the camera zooming.
         */
        this.pinchPrecision = 12.0;
        /**
         * pinchDeltaPercentage will be used instead of pinchPrecision if different
         * from 0.
         * It defines the percentage of current camera.radius to use as delta when
         * pinch zoom is used.
         */
        this.pinchDeltaPercentage = 0;
        /**
         * When useNaturalPinchZoom is true, multi touch zoom will zoom in such
         * that any object in the plane at the camera's target point will scale
         * perfectly with finger motion.
         * Overrides pinchDeltaPercentage and pinchPrecision.
         */
        this.useNaturalPinchZoom = false;
        /**
         * Defines whether zoom (2 fingers pinch) is enabled through multitouch
         */
        this.pinchZoom = true;
        /**
         * Defines the pointer panning sensibility or how fast is the camera moving.
         */
        this.panningSensibility = 1000.0;
        /**
         * Defines whether panning (2 fingers swipe) is enabled through multitouch.
         */
        this.multiTouchPanning = true;
        /**
         * Defines whether panning is enabled for both pan (2 fingers swipe) and
         * zoom (pinch) through multitouch.
         */
        this.multiTouchPanAndZoom = true;
        /**
         * Revers pinch action direction.
         */
        this.pinchInwards = true;
        this._isPanClick = false;
        this._twoFingerActivityCount = 0;
        this._isPinching = false;
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "ArcRotateCameraPointersInput";
    }
    /**
     * Move camera from multi touch panning positions.
     * @param previousMultiTouchPanPosition
     * @param multiTouchPanPosition
     */
    _computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition) {
        if (this.panningSensibility !== 0 && previousMultiTouchPanPosition && multiTouchPanPosition) {
            const moveDeltaX = multiTouchPanPosition.x - previousMultiTouchPanPosition.x;
            const moveDeltaY = multiTouchPanPosition.y - previousMultiTouchPanPosition.y;
            this.camera.inertialPanningX += -moveDeltaX / this.panningSensibility;
            this.camera.inertialPanningY += moveDeltaY / this.panningSensibility;
        }
    }
    /**
     * Move camera from pinch zoom distances.
     * @param previousPinchSquaredDistance
     * @param pinchSquaredDistance
     */
    _computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance) {
        const radius = this.camera.radius || ArcRotateCameraPointersInput.MinimumRadiusForPinch;
        if (this.useNaturalPinchZoom) {
            this.camera.radius = (radius * Math.sqrt(previousPinchSquaredDistance)) / Math.sqrt(pinchSquaredDistance);
        }
        else if (this.pinchDeltaPercentage) {
            this.camera.inertialRadiusOffset += (pinchSquaredDistance - previousPinchSquaredDistance) * 0.001 * radius * this.pinchDeltaPercentage;
        }
        else {
            this.camera.inertialRadiusOffset +=
                (pinchSquaredDistance - previousPinchSquaredDistance) /
                    ((this.pinchPrecision * (this.pinchInwards ? 1 : -1) * (this.angularSensibilityX + this.angularSensibilityY)) / 2);
        }
    }
    /**
     * Called on pointer POINTERMOVE event if only a single touch is active.
     * @param point current touch point
     * @param offsetX offset on X
     * @param offsetY offset on Y
     */
    onTouch(point, offsetX, offsetY) {
        if (this.panningSensibility !== 0 && ((this._ctrlKey && this.camera._useCtrlForPanning) || this._isPanClick)) {
            this.camera.inertialPanningX += -offsetX / this.panningSensibility;
            this.camera.inertialPanningY += offsetY / this.panningSensibility;
        }
        else {
            this.camera.inertialAlphaOffset -= offsetX / this.angularSensibilityX;
            this.camera.inertialBetaOffset -= offsetY / this.angularSensibilityY;
        }
    }
    /**
     * Called on pointer POINTERDOUBLETAP event.
     */
    onDoubleTap() {
        if (this.camera.useInputToRestoreState) {
            this.camera.restoreState();
        }
    }
    /**
     * Called on pointer POINTERMOVE event if multiple touches are active.
     * @param pointA point A
     * @param pointB point B
     * @param previousPinchSquaredDistance distance between points in previous pinch
     * @param pinchSquaredDistance distance between points in current pinch
     * @param previousMultiTouchPanPosition multi-touch position in previous step
     * @param multiTouchPanPosition multi-touch position in current step
     */
    onMultiTouch(pointA, pointB, previousPinchSquaredDistance, pinchSquaredDistance, previousMultiTouchPanPosition, multiTouchPanPosition) {
        if (previousPinchSquaredDistance === 0 && previousMultiTouchPanPosition === null) {
            // First time this method is called for new pinch.
            // Next time this is called there will be a
            // previousPinchSquaredDistance and pinchSquaredDistance to compare.
            return;
        }
        if (pinchSquaredDistance === 0 && multiTouchPanPosition === null) {
            // Last time this method is called at the end of a pinch.
            return;
        }
        // Zoom and panning enabled together
        if (this.multiTouchPanAndZoom) {
            this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance);
            this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition);
            // Zoom and panning enabled but only one at a time
        }
        else if (this.multiTouchPanning && this.pinchZoom) {
            this._twoFingerActivityCount++;
            if (this._isPinching ||
                (this._twoFingerActivityCount < 20 && Math.abs(Math.sqrt(pinchSquaredDistance) - Math.sqrt(previousPinchSquaredDistance)) > this.camera.pinchToPanMaxDistance)) {
                // Since pinch has not been active long, assume we intend to zoom.
                this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance);
                // Since we are pinching, remain pinching on next iteration.
                this._isPinching = true;
            }
            else {
                // Pause between pinch starting and moving implies not a zoom event. Pan instead.
                this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition);
            }
            // Panning enabled, zoom disabled
        }
        else if (this.multiTouchPanning) {
            this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition);
            // Zoom enabled, panning disabled
        }
        else if (this.pinchZoom) {
            this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance);
        }
    }
    /**
     * Called each time a new POINTERDOWN event occurs. Ie, for each button
     * press.
     * @param evt Defines the event to track
     */
    onButtonDown(evt) {
        this._isPanClick = evt.button === this.camera._panningMouseButton;
    }
    /**
     * Called each time a new POINTERUP event occurs. Ie, for each button
     * release.
     * @param _evt Defines the event to track
     */
    onButtonUp(_evt) {
        this._twoFingerActivityCount = 0;
        this._isPinching = false;
    }
    /**
     * Called when window becomes inactive.
     */
    onLostFocus() {
        this._isPanClick = false;
        this._twoFingerActivityCount = 0;
        this._isPinching = false;
    }
}
/**
 * The minimum radius used for pinch, to avoid radius lock at 0
 */
ArcRotateCameraPointersInput.MinimumRadiusForPinch = 0.001;
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "buttons", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "angularSensibilityX", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "angularSensibilityY", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "pinchPrecision", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "pinchDeltaPercentage", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "useNaturalPinchZoom", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "pinchZoom", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "panningSensibility", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "multiTouchPanning", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCameraPointersInput.prototype, "multiTouchPanAndZoom", void 0);
cameraInputsManager/* CameraInputTypes */.H["ArcRotateCameraPointersInput"] = ArcRotateCameraPointersInput;
//# sourceMappingURL=arcRotateCameraPointersInput.js.map
;// ./node_modules/@babylonjs/core/Cameras/arcRotateCameraInputsManager.js




/**
 * Default Inputs manager for the ArcRotateCamera.
 * It groups all the default supported inputs for ease of use.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class ArcRotateCameraInputsManager extends cameraInputsManager/* CameraInputsManager */._ {
    /**
     * Instantiates a new ArcRotateCameraInputsManager.
     * @param camera Defines the camera the inputs belong to
     */
    constructor(camera) {
        super(camera);
    }
    /**
     * Add mouse wheel input support to the input manager.
     * @returns the current input manager
     */
    addMouseWheel() {
        this.add(new ArcRotateCameraMouseWheelInput());
        return this;
    }
    /**
     * Add pointers input support to the input manager.
     * @returns the current input manager
     */
    addPointers() {
        this.add(new ArcRotateCameraPointersInput());
        return this;
    }
    /**
     * Add keyboard input support to the input manager.
     * @returns the current input manager
     */
    addKeyboard() {
        this.add(new ArcRotateCameraKeyboardMoveInput());
        return this;
    }
}
//# sourceMappingURL=arcRotateCameraInputsManager.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js



/**
 * Add orientation input support to the input manager.
 * @returns the current input manager
 */
ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation = function () {
    this.add(new ArcRotateCameraVRDeviceOrientationInput());
    return this;
};
/**
 * Manage the device orientation inputs (gyroscope) to control an arc rotate camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class ArcRotateCameraVRDeviceOrientationInput {
    /**
     * Instantiate a new ArcRotateCameraVRDeviceOrientationInput.
     */
    constructor() {
        /**
         * Defines a correction factor applied on the alpha value retrieved from the orientation events.
         */
        this.alphaCorrection = 1;
        /**
         * Defines a correction factor applied on the gamma value retrieved from the orientation events.
         */
        this.gammaCorrection = 1;
        this._alpha = 0;
        this._gamma = 0;
        this._dirty = false;
        this._deviceOrientationHandler = (evt) => this._onOrientationEvent(evt);
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        this.camera.attachControl(noPreventDefault);
        const hostWindow = this.camera.getScene().getEngine().getHostWindow();
        if (hostWindow) {
            // check iOS 13+ support
            if (typeof DeviceOrientationEvent !== "undefined" && typeof DeviceOrientationEvent.requestPermission === "function") {
                DeviceOrientationEvent
                    .requestPermission()
                    .then((response) => {
                    if (response === "granted") {
                        hostWindow.addEventListener("deviceorientation", this._deviceOrientationHandler);
                    }
                    else {
                        tools/* Tools */.S0.Warn("Permission not granted.");
                    }
                })
                    .catch((error) => {
                    tools/* Tools */.S0.Error(error);
                });
            }
            else {
                hostWindow.addEventListener("deviceorientation", this._deviceOrientationHandler);
            }
        }
    }
    /**
     * @internal
     */
    _onOrientationEvent(evt) {
        if (evt.alpha !== null) {
            this._alpha = (+evt.alpha | 0) * this.alphaCorrection;
        }
        if (evt.gamma !== null) {
            this._gamma = (+evt.gamma | 0) * this.gammaCorrection;
        }
        this._dirty = true;
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (this._dirty) {
            this._dirty = false;
            if (this._gamma < 0) {
                this._gamma = 180 + this._gamma;
            }
            this.camera.alpha = (((-this._alpha / 180.0) * Math.PI) % Math.PI) * 2;
            this.camera.beta = (this._gamma / 180.0) * Math.PI;
        }
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        window.removeEventListener("deviceorientation", this._deviceOrientationHandler);
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "ArcRotateCameraVRDeviceOrientationInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "VRDeviceOrientation";
    }
}
cameraInputsManager/* CameraInputTypes */.H["ArcRotateCameraVRDeviceOrientationInput"] = ArcRotateCameraVRDeviceOrientationInput;
//# sourceMappingURL=arcRotateCameraVRDeviceOrientationInput.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/flyCameraKeyboardInput.js






/**
 * Listen to keyboard events to control the camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FlyCameraKeyboardInput {
    constructor() {
        /**
         * The list of keyboard keys used to control the forward move of the camera.
         */
        this.keysForward = [87];
        /**
         * The list of keyboard keys used to control the backward move of the camera.
         */
        this.keysBackward = [83];
        /**
         * The list of keyboard keys used to control the forward move of the camera.
         */
        this.keysUp = [69];
        /**
         * The list of keyboard keys used to control the backward move of the camera.
         */
        this.keysDown = [81];
        /**
         * The list of keyboard keys used to control the right strafe move of the camera.
         */
        this.keysRight = [68];
        /**
         * The list of keyboard keys used to control the left strafe move of the camera.
         */
        this.keysLeft = [65];
        this._keys = new Array();
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        if (this._onCanvasBlurObserver) {
            return;
        }
        this._scene = this.camera.getScene();
        this._engine = this._scene.getEngine();
        this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {
            this._keys.length = 0;
        });
        this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {
            const evt = info.event;
            if (info.type === keyboardEvents/* KeyboardEventTypes */.TB.KEYDOWN) {
                if (this.keysForward.indexOf(evt.keyCode) !== -1 ||
                    this.keysBackward.indexOf(evt.keyCode) !== -1 ||
                    this.keysUp.indexOf(evt.keyCode) !== -1 ||
                    this.keysDown.indexOf(evt.keyCode) !== -1 ||
                    this.keysLeft.indexOf(evt.keyCode) !== -1 ||
                    this.keysRight.indexOf(evt.keyCode) !== -1) {
                    const index = this._keys.indexOf(evt.keyCode);
                    if (index === -1) {
                        this._keys.push(evt.keyCode);
                    }
                    if (!noPreventDefault) {
                        evt.preventDefault();
                    }
                }
            }
            else {
                if (this.keysForward.indexOf(evt.keyCode) !== -1 ||
                    this.keysBackward.indexOf(evt.keyCode) !== -1 ||
                    this.keysUp.indexOf(evt.keyCode) !== -1 ||
                    this.keysDown.indexOf(evt.keyCode) !== -1 ||
                    this.keysLeft.indexOf(evt.keyCode) !== -1 ||
                    this.keysRight.indexOf(evt.keyCode) !== -1) {
                    const index = this._keys.indexOf(evt.keyCode);
                    if (index >= 0) {
                        this._keys.splice(index, 1);
                    }
                    if (!noPreventDefault) {
                        evt.preventDefault();
                    }
                }
            }
        });
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._scene) {
            if (this._onKeyboardObserver) {
                this._scene.onKeyboardObservable.remove(this._onKeyboardObserver);
            }
            if (this._onCanvasBlurObserver) {
                this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver);
            }
            this._onKeyboardObserver = null;
            this._onCanvasBlurObserver = null;
        }
        this._keys.length = 0;
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FlyCameraKeyboardInput";
    }
    /**
     * @internal
     */
    _onLostFocus() {
        this._keys.length = 0;
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "keyboard";
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (this._onKeyboardObserver) {
            const camera = this.camera;
            // Keyboard
            for (let index = 0; index < this._keys.length; index++) {
                const keyCode = this._keys[index];
                const speed = camera._computeLocalCameraSpeed();
                if (this.keysForward.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, 0, speed);
                }
                else if (this.keysBackward.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, 0, -speed);
                }
                else if (this.keysUp.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, speed, 0);
                }
                else if (this.keysDown.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(0, -speed, 0);
                }
                else if (this.keysRight.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(speed, 0, 0);
                }
                else if (this.keysLeft.indexOf(keyCode) !== -1) {
                    camera._localDirection.copyFromFloats(-speed, 0, 0);
                }
                if (camera.getScene().useRightHandedSystem) {
                    camera._localDirection.z *= -1;
                }
                camera.getViewMatrix().invertToRef(camera._cameraTransformMatrix);
                math_vector/* Vector3 */.Pq.TransformNormalToRef(camera._localDirection, camera._cameraTransformMatrix, camera._transformedDirection);
                camera.cameraDirection.addInPlace(camera._transformedDirection);
            }
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCameraKeyboardInput.prototype, "keysForward", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCameraKeyboardInput.prototype, "keysBackward", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCameraKeyboardInput.prototype, "keysUp", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCameraKeyboardInput.prototype, "keysDown", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCameraKeyboardInput.prototype, "keysRight", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCameraKeyboardInput.prototype, "keysLeft", void 0);
cameraInputsManager/* CameraInputTypes */.H["FlyCameraKeyboardInput"] = FlyCameraKeyboardInput;
//# sourceMappingURL=flyCameraKeyboardInput.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/flyCameraMouseInput.js







/**
 * Listen to mouse events to control the camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FlyCameraMouseInput {
    /**
     * Listen to mouse events to control the camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
     */
    constructor() {
        /**
         * Defines the buttons associated with the input to handle camera rotation.
         */
        this.buttons = [0, 1, 2];
        /**
         * Assign buttons for Yaw control.
         */
        this.buttonsYaw = [-1, 0, 1];
        /**
         * Assign buttons for Pitch control.
         */
        this.buttonsPitch = [-1, 0, 1];
        /**
         * Assign buttons for Roll control.
         */
        this.buttonsRoll = [2];
        /**
         * Detect if any button is being pressed while mouse is moved.
         * -1 = Mouse locked.
         * 0 = Left button.
         * 1 = Middle Button.
         * 2 = Right Button.
         */
        this.activeButton = -1;
        /**
         * Defines the pointer's angular sensibility, to control the camera rotation speed.
         * Higher values reduce its sensitivity.
         */
        this.angularSensibility = 1000.0;
        this._previousPosition = null;
    }
    /**
     * Attach the mouse control to the HTML DOM element.
     * @param noPreventDefault Defines whether events caught by the controls should call preventdefault().
     */
    attachControl(noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        this._noPreventDefault = noPreventDefault;
        this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver((p) => {
            this._pointerInput(p);
        }, pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN | pointerEvents/* PointerEventTypes */.Zp.POINTERUP | pointerEvents/* PointerEventTypes */.Zp.POINTERMOVE);
        // Correct Roll by rate, if enabled.
        this._rollObserver = this.camera.getScene().onBeforeRenderObservable.add(() => {
            if (this.camera.rollCorrect) {
                this.camera.restoreRoll(this.camera.rollCorrect);
            }
        });
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._observer) {
            this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer);
            this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver);
            this._observer = null;
            this._rollObserver = null;
            this._previousPosition = null;
            this._noPreventDefault = undefined;
        }
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name.
     */
    getClassName() {
        return "FlyCameraMouseInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input's friendly name.
     */
    getSimpleName() {
        return "mouse";
    }
    // Track mouse movement, when the pointer is not locked.
    _pointerInput(p) {
        const e = p.event;
        const camera = this.camera;
        const engine = camera.getEngine();
        if (!this.touchEnabled && e.pointerType === "touch") {
            return;
        }
        // Mouse is moved but an unknown mouse button is pressed.
        if (p.type !== pointerEvents/* PointerEventTypes */.Zp.POINTERMOVE && this.buttons.indexOf(e.button) === -1) {
            return;
        }
        const srcElement = e.target;
        // Mouse down.
        if (p.type === pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN) {
            try {
                srcElement?.setPointerCapture(e.pointerId);
            }
            catch (e) {
                // Nothing to do with the error. Execution continues.
            }
            this._previousPosition = {
                x: e.clientX,
                y: e.clientY,
            };
            this.activeButton = e.button;
            if (!this._noPreventDefault) {
                e.preventDefault();
            }
            // This is required to move while pointer button is down
            if (engine.isPointerLock) {
                this._onMouseMove(p.event);
            }
        }
        // Mouse up.
        else if (p.type === pointerEvents/* PointerEventTypes */.Zp.POINTERUP) {
            try {
                srcElement?.releasePointerCapture(e.pointerId);
            }
            catch (e) {
                // Nothing to do with the error. Execution continues.
            }
            this.activeButton = -1;
            this._previousPosition = null;
            if (!this._noPreventDefault) {
                e.preventDefault();
            }
        }
        // Mouse move.
        else if (p.type === pointerEvents/* PointerEventTypes */.Zp.POINTERMOVE) {
            if (!this._previousPosition) {
                if (engine.isPointerLock) {
                    this._onMouseMove(p.event);
                }
                return;
            }
            const offsetX = e.clientX - this._previousPosition.x;
            const offsetY = e.clientY - this._previousPosition.y;
            this._rotateCamera(offsetX, offsetY);
            this._previousPosition = {
                x: e.clientX,
                y: e.clientY,
            };
            if (!this._noPreventDefault) {
                e.preventDefault();
            }
        }
    }
    // Track mouse movement, when pointer is locked.
    _onMouseMove(e) {
        const camera = this.camera;
        const engine = camera.getEngine();
        if (!engine.isPointerLock) {
            return;
        }
        const offsetX = e.movementX;
        const offsetY = e.movementY;
        this._rotateCamera(offsetX, offsetY);
        this._previousPosition = null;
        if (!this._noPreventDefault) {
            e.preventDefault();
        }
    }
    /**
     * Rotate camera by mouse offset.
     * @param offsetX
     * @param offsetY
     */
    _rotateCamera(offsetX, offsetY) {
        const camera = this.camera;
        const handednessMultiplier = camera._calculateHandednessMultiplier();
        offsetX *= handednessMultiplier;
        const x = offsetX / this.angularSensibility;
        const y = offsetY / this.angularSensibility;
        // Initialize to current rotation.
        const currentRotation = math_vector/* Quaternion */.PT.RotationYawPitchRoll(camera.rotation.y, camera.rotation.x, camera.rotation.z);
        let rotationChange;
        // Pitch.
        if (this.buttonsPitch.some((v) => {
            return v === this.activeButton;
        })) {
            // Apply change in Radians to vector Angle.
            rotationChange = math_vector/* Quaternion */.PT.RotationAxis(math_axis/* Axis */._0.X, y);
            // Apply Pitch to quaternion.
            currentRotation.multiplyInPlace(rotationChange);
        }
        // Yaw.
        if (this.buttonsYaw.some((v) => {
            return v === this.activeButton;
        })) {
            // Apply change in Radians to vector Angle.
            rotationChange = math_vector/* Quaternion */.PT.RotationAxis(math_axis/* Axis */._0.Y, x);
            // Apply Yaw to quaternion.
            currentRotation.multiplyInPlace(rotationChange);
            // Add Roll, if banked turning is enabled, within Roll limit.
            const limit = camera.bankedTurnLimit + camera._trackRoll; // Defaults to 90° plus manual roll.
            if (camera.bankedTurn && -limit < camera.rotation.z && camera.rotation.z < limit) {
                const bankingDelta = camera.bankedTurnMultiplier * -x;
                // Apply change in Radians to vector Angle.
                rotationChange = math_vector/* Quaternion */.PT.RotationAxis(math_axis/* Axis */._0.Z, bankingDelta);
                // Apply Yaw to quaternion.
                currentRotation.multiplyInPlace(rotationChange);
            }
        }
        // Roll.
        if (this.buttonsRoll.some((v) => {
            return v === this.activeButton;
        })) {
            // Apply change in Radians to vector Angle.
            rotationChange = math_vector/* Quaternion */.PT.RotationAxis(math_axis/* Axis */._0.Z, -x);
            // Track Rolling.
            camera._trackRoll -= x;
            // Apply Pitch to quaternion.
            currentRotation.multiplyInPlace(rotationChange);
        }
        // Apply rotationQuaternion to Euler camera.rotation.
        currentRotation.toEulerAnglesToRef(camera.rotation);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCameraMouseInput.prototype, "buttons", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCameraMouseInput.prototype, "angularSensibility", void 0);
cameraInputsManager/* CameraInputTypes */.H["FlyCameraMouseInput"] = FlyCameraMouseInput;
//# sourceMappingURL=flyCameraMouseInput.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/followCameraKeyboardMoveInput.js





/**
 * Manage the keyboard inputs to control the movement of a follow camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FollowCameraKeyboardMoveInput {
    constructor() {
        /**
         * Defines the list of key codes associated with the up action (increase heightOffset)
         */
        this.keysHeightOffsetIncr = [38];
        /**
         * Defines the list of key codes associated with the down action (decrease heightOffset)
         */
        this.keysHeightOffsetDecr = [40];
        /**
         * Defines whether the Alt modifier key is required to move up/down (alter heightOffset)
         */
        this.keysHeightOffsetModifierAlt = false;
        /**
         * Defines whether the Ctrl modifier key is required to move up/down (alter heightOffset)
         */
        this.keysHeightOffsetModifierCtrl = false;
        /**
         * Defines whether the Shift modifier key is required to move up/down (alter heightOffset)
         */
        this.keysHeightOffsetModifierShift = false;
        /**
         * Defines the list of key codes associated with the left action (increase rotationOffset)
         */
        this.keysRotationOffsetIncr = [37];
        /**
         * Defines the list of key codes associated with the right action (decrease rotationOffset)
         */
        this.keysRotationOffsetDecr = [39];
        /**
         * Defines whether the Alt modifier key is required to move left/right (alter rotationOffset)
         */
        this.keysRotationOffsetModifierAlt = false;
        /**
         * Defines whether the Ctrl modifier key is required to move left/right (alter rotationOffset)
         */
        this.keysRotationOffsetModifierCtrl = false;
        /**
         * Defines whether the Shift modifier key is required to move left/right (alter rotationOffset)
         */
        this.keysRotationOffsetModifierShift = false;
        /**
         * Defines the list of key codes associated with the zoom-in action (decrease radius)
         */
        this.keysRadiusIncr = [40];
        /**
         * Defines the list of key codes associated with the zoom-out action (increase radius)
         */
        this.keysRadiusDecr = [38];
        /**
         * Defines whether the Alt modifier key is required to zoom in/out (alter radius value)
         */
        this.keysRadiusModifierAlt = true;
        /**
         * Defines whether the Ctrl modifier key is required to zoom in/out (alter radius value)
         */
        this.keysRadiusModifierCtrl = false;
        /**
         * Defines whether the Shift modifier key is required to zoom in/out (alter radius value)
         */
        this.keysRadiusModifierShift = false;
        /**
         * Defines the rate of change of heightOffset.
         */
        this.heightSensibility = 1;
        /**
         * Defines the rate of change of rotationOffset.
         */
        this.rotationSensibility = 1;
        /**
         * Defines the rate of change of radius.
         */
        this.radiusSensibility = 1;
        this._keys = new Array();
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        if (this._onCanvasBlurObserver) {
            return;
        }
        this._scene = this.camera.getScene();
        this._engine = this._scene.getEngine();
        this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(() => {
            this._keys.length = 0;
        });
        this._onKeyboardObserver = this._scene.onKeyboardObservable.add((info) => {
            const evt = info.event;
            if (!evt.metaKey) {
                if (info.type === keyboardEvents/* KeyboardEventTypes */.TB.KEYDOWN) {
                    this._ctrlPressed = evt.ctrlKey;
                    this._altPressed = evt.altKey;
                    this._shiftPressed = evt.shiftKey;
                    if (this.keysHeightOffsetIncr.indexOf(evt.keyCode) !== -1 ||
                        this.keysHeightOffsetDecr.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotationOffsetIncr.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotationOffsetDecr.indexOf(evt.keyCode) !== -1 ||
                        this.keysRadiusIncr.indexOf(evt.keyCode) !== -1 ||
                        this.keysRadiusDecr.indexOf(evt.keyCode) !== -1) {
                        const index = this._keys.indexOf(evt.keyCode);
                        if (index === -1) {
                            this._keys.push(evt.keyCode);
                        }
                        if (evt.preventDefault) {
                            if (!noPreventDefault) {
                                evt.preventDefault();
                            }
                        }
                    }
                }
                else {
                    if (this.keysHeightOffsetIncr.indexOf(evt.keyCode) !== -1 ||
                        this.keysHeightOffsetDecr.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotationOffsetIncr.indexOf(evt.keyCode) !== -1 ||
                        this.keysRotationOffsetDecr.indexOf(evt.keyCode) !== -1 ||
                        this.keysRadiusIncr.indexOf(evt.keyCode) !== -1 ||
                        this.keysRadiusDecr.indexOf(evt.keyCode) !== -1) {
                        const index = this._keys.indexOf(evt.keyCode);
                        if (index >= 0) {
                            this._keys.splice(index, 1);
                        }
                        if (evt.preventDefault) {
                            if (!noPreventDefault) {
                                evt.preventDefault();
                            }
                        }
                    }
                }
            }
        });
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._scene) {
            if (this._onKeyboardObserver) {
                this._scene.onKeyboardObservable.remove(this._onKeyboardObserver);
            }
            if (this._onCanvasBlurObserver) {
                this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver);
            }
            this._onKeyboardObserver = null;
            this._onCanvasBlurObserver = null;
        }
        this._keys.length = 0;
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (this._onKeyboardObserver) {
            this._keys.forEach((keyCode) => {
                if (this.keysHeightOffsetIncr.indexOf(keyCode) !== -1 && this._modifierHeightOffset()) {
                    this.camera.heightOffset += this.heightSensibility;
                }
                else if (this.keysHeightOffsetDecr.indexOf(keyCode) !== -1 && this._modifierHeightOffset()) {
                    this.camera.heightOffset -= this.heightSensibility;
                }
                else if (this.keysRotationOffsetIncr.indexOf(keyCode) !== -1 && this._modifierRotationOffset()) {
                    this.camera.rotationOffset += this.rotationSensibility;
                    this.camera.rotationOffset %= 360;
                }
                else if (this.keysRotationOffsetDecr.indexOf(keyCode) !== -1 && this._modifierRotationOffset()) {
                    this.camera.rotationOffset -= this.rotationSensibility;
                    this.camera.rotationOffset %= 360;
                }
                else if (this.keysRadiusIncr.indexOf(keyCode) !== -1 && this._modifierRadius()) {
                    this.camera.radius += this.radiusSensibility;
                }
                else if (this.keysRadiusDecr.indexOf(keyCode) !== -1 && this._modifierRadius()) {
                    this.camera.radius -= this.radiusSensibility;
                }
            });
        }
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FollowCameraKeyboardMoveInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "keyboard";
    }
    /**
     * Check if the pressed modifier keys (Alt/Ctrl/Shift) match those configured to
     * allow modification of the heightOffset value.
     * @returns true if modifier keys match
     */
    _modifierHeightOffset() {
        return (this.keysHeightOffsetModifierAlt === this._altPressed &&
            this.keysHeightOffsetModifierCtrl === this._ctrlPressed &&
            this.keysHeightOffsetModifierShift === this._shiftPressed);
    }
    /**
     * Check if the pressed modifier keys (Alt/Ctrl/Shift) match those configured to
     * allow modification of the rotationOffset value.
     * @returns true if modifier keys match
     */
    _modifierRotationOffset() {
        return (this.keysRotationOffsetModifierAlt === this._altPressed &&
            this.keysRotationOffsetModifierCtrl === this._ctrlPressed &&
            this.keysRotationOffsetModifierShift === this._shiftPressed);
    }
    /**
     * Check if the pressed modifier keys (Alt/Ctrl/Shift) match those configured to
     * allow modification of the radius value.
     * @returns true if modifier keys match
     */
    _modifierRadius() {
        return this.keysRadiusModifierAlt === this._altPressed && this.keysRadiusModifierCtrl === this._ctrlPressed && this.keysRadiusModifierShift === this._shiftPressed;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetIncr", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetDecr", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierAlt", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierCtrl", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierShift", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetIncr", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetDecr", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierAlt", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierCtrl", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierShift", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRadiusIncr", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRadiusDecr", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierAlt", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierCtrl", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierShift", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "heightSensibility", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "rotationSensibility", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraKeyboardMoveInput.prototype, "radiusSensibility", void 0);
cameraInputsManager/* CameraInputTypes */.H["FollowCameraKeyboardMoveInput"] = FollowCameraKeyboardMoveInput;
//# sourceMappingURL=followCameraKeyboardMoveInput.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/followCameraMouseWheelInput.js






/**
 * Manage the mouse wheel inputs to control a follow camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FollowCameraMouseWheelInput {
    constructor() {
        /**
         * Moue wheel controls zoom. (Mouse wheel modifies camera.radius value.)
         */
        this.axisControlRadius = true;
        /**
         * Moue wheel controls height. (Mouse wheel modifies camera.heightOffset value.)
         */
        this.axisControlHeight = false;
        /**
         * Moue wheel controls angle. (Mouse wheel modifies camera.rotationOffset value.)
         */
        this.axisControlRotation = false;
        /**
         * Gets or Set the mouse wheel precision or how fast is the camera moves in
         * relation to mouseWheel events.
         */
        this.wheelPrecision = 3.0;
        /**
         * wheelDeltaPercentage will be used instead of wheelPrecision if different from 0.
         * It defines the percentage of current camera.radius to use as delta when wheel is used.
         */
        this.wheelDeltaPercentage = 0;
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(noPreventDefault) {
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        this._wheel = (p) => {
            // sanity check - this should be a PointerWheel event.
            if (p.type !== pointerEvents/* PointerEventTypes */.Zp.POINTERWHEEL) {
                return;
            }
            const event = p.event;
            let delta = 0;
            const wheelDelta = Math.max(-1, Math.min(1, event.deltaY));
            if (this.wheelDeltaPercentage) {
                if (+this.axisControlRadius + +this.axisControlHeight + +this.axisControlRotation) {
                    logger/* Logger */.V.Warn("wheelDeltaPercentage only usable when mouse wheel " +
                        "controls ONE axis. " +
                        "Currently enabled: " +
                        "axisControlRadius: " +
                        this.axisControlRadius +
                        ", axisControlHeightOffset: " +
                        this.axisControlHeight +
                        ", axisControlRotationOffset: " +
                        this.axisControlRotation);
                }
                if (this.axisControlRadius) {
                    delta = wheelDelta * 0.01 * this.wheelDeltaPercentage * this.camera.radius;
                }
                else if (this.axisControlHeight) {
                    delta = wheelDelta * 0.01 * this.wheelDeltaPercentage * this.camera.heightOffset;
                }
                else if (this.axisControlRotation) {
                    delta = wheelDelta * 0.01 * this.wheelDeltaPercentage * this.camera.rotationOffset;
                }
            }
            else {
                delta = wheelDelta * this.wheelPrecision;
            }
            if (delta) {
                if (this.axisControlRadius) {
                    this.camera.radius += delta;
                }
                else if (this.axisControlHeight) {
                    this.camera.heightOffset -= delta;
                }
                else if (this.axisControlRotation) {
                    this.camera.rotationOffset -= delta;
                }
            }
            if (event.preventDefault) {
                if (!noPreventDefault) {
                    event.preventDefault();
                }
            }
        };
        this._observer = this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel, pointerEvents/* PointerEventTypes */.Zp.POINTERWHEEL);
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        if (this._observer) {
            this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer);
            this._observer = null;
            this._wheel = null;
        }
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "ArcRotateCameraMouseWheelInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "mousewheel";
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraMouseWheelInput.prototype, "axisControlRadius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraMouseWheelInput.prototype, "axisControlHeight", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraMouseWheelInput.prototype, "axisControlRotation", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraMouseWheelInput.prototype, "wheelPrecision", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraMouseWheelInput.prototype, "wheelDeltaPercentage", void 0);
cameraInputsManager/* CameraInputTypes */.H["FollowCameraMouseWheelInput"] = FollowCameraMouseWheelInput;
//# sourceMappingURL=followCameraMouseWheelInput.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/followCameraPointersInput.js





/**
 * Manage the pointers inputs to control an follow camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FollowCameraPointersInput extends BaseCameraPointersInput {
    constructor() {
        super(...arguments);
        /**
         * Defines the pointer angular sensibility along the X axis or how fast is
         * the camera rotating.
         * A negative number will reverse the axis direction.
         */
        this.angularSensibilityX = 1;
        /**
         * Defines the pointer angular sensibility along the Y axis or how fast is
         * the camera rotating.
         * A negative number will reverse the axis direction.
         */
        this.angularSensibilityY = 1;
        /**
         * Defines the pointer pinch precision or how fast is the camera zooming.
         * A negative number will reverse the axis direction.
         */
        this.pinchPrecision = 10000.0;
        /**
         * pinchDeltaPercentage will be used instead of pinchPrecision if different
         * from 0.
         * It defines the percentage of current camera.radius to use as delta when
         * pinch zoom is used.
         */
        this.pinchDeltaPercentage = 0;
        /**
         * Pointer X axis controls zoom. (X axis modifies camera.radius value.)
         */
        this.axisXControlRadius = false;
        /**
         * Pointer X axis controls height. (X axis modifies camera.heightOffset value.)
         */
        this.axisXControlHeight = false;
        /**
         * Pointer X axis controls angle. (X axis modifies camera.rotationOffset value.)
         */
        this.axisXControlRotation = true;
        /**
         * Pointer Y axis controls zoom. (Y axis modifies camera.radius value.)
         */
        this.axisYControlRadius = false;
        /**
         * Pointer Y axis controls height. (Y axis modifies camera.heightOffset value.)
         */
        this.axisYControlHeight = true;
        /**
         * Pointer Y axis controls angle. (Y axis modifies camera.rotationOffset value.)
         */
        this.axisYControlRotation = false;
        /**
         * Pinch controls zoom. (Pinch modifies camera.radius value.)
         */
        this.axisPinchControlRadius = true;
        /**
         * Pinch controls height. (Pinch modifies camera.heightOffset value.)
         */
        this.axisPinchControlHeight = false;
        /**
         * Pinch controls angle. (Pinch modifies camera.rotationOffset value.)
         */
        this.axisPinchControlRotation = false;
        /**
         * Log error messages if basic misconfiguration has occurred.
         */
        this.warningEnable = true;
        /* Check for obvious misconfiguration. */
        this._warningCounter = 0;
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FollowCameraPointersInput";
    }
    onTouch(pointA, offsetX, offsetY) {
        this._warning();
        if (this.axisXControlRotation) {
            this.camera.rotationOffset += offsetX / this.angularSensibilityX;
        }
        else if (this.axisYControlRotation) {
            this.camera.rotationOffset += offsetY / this.angularSensibilityX;
        }
        if (this.axisXControlHeight) {
            this.camera.heightOffset += offsetX / this.angularSensibilityY;
        }
        else if (this.axisYControlHeight) {
            this.camera.heightOffset += offsetY / this.angularSensibilityY;
        }
        if (this.axisXControlRadius) {
            this.camera.radius -= offsetX / this.angularSensibilityY;
        }
        else if (this.axisYControlRadius) {
            this.camera.radius -= offsetY / this.angularSensibilityY;
        }
    }
    onMultiTouch(pointA, pointB, previousPinchSquaredDistance, pinchSquaredDistance, previousMultiTouchPanPosition, multiTouchPanPosition) {
        if (previousPinchSquaredDistance === 0 && previousMultiTouchPanPosition === null) {
            // First time this method is called for new pinch.
            // Next time this is called there will be a
            // previousPinchSquaredDistance and pinchSquaredDistance to compare.
            return;
        }
        if (pinchSquaredDistance === 0 && multiTouchPanPosition === null) {
            // Last time this method is called at the end of a pinch.
            return;
        }
        let pinchDelta = (pinchSquaredDistance - previousPinchSquaredDistance) / ((this.pinchPrecision * (this.angularSensibilityX + this.angularSensibilityY)) / 2);
        if (this.pinchDeltaPercentage) {
            pinchDelta *= 0.01 * this.pinchDeltaPercentage;
            if (this.axisPinchControlRotation) {
                this.camera.rotationOffset += pinchDelta * this.camera.rotationOffset;
            }
            if (this.axisPinchControlHeight) {
                this.camera.heightOffset += pinchDelta * this.camera.heightOffset;
            }
            if (this.axisPinchControlRadius) {
                this.camera.radius -= pinchDelta * this.camera.radius;
            }
        }
        else {
            if (this.axisPinchControlRotation) {
                this.camera.rotationOffset += pinchDelta;
            }
            if (this.axisPinchControlHeight) {
                this.camera.heightOffset += pinchDelta;
            }
            if (this.axisPinchControlRadius) {
                this.camera.radius -= pinchDelta;
            }
        }
    }
    _warning() {
        if (!this.warningEnable || this._warningCounter++ % 100 !== 0) {
            return;
        }
        const warn = "It probably only makes sense to control ONE camera " + "property with each pointer axis. Set 'warningEnable = false' " + "if you are sure. Currently enabled: ";
        if (+this.axisXControlRotation + +this.axisXControlHeight + +this.axisXControlRadius <= 1) {
            logger/* Logger */.V.Warn(warn +
                "axisXControlRotation: " +
                this.axisXControlRotation +
                ", axisXControlHeight: " +
                this.axisXControlHeight +
                ", axisXControlRadius: " +
                this.axisXControlRadius);
        }
        if (+this.axisYControlRotation + +this.axisYControlHeight + +this.axisYControlRadius <= 1) {
            logger/* Logger */.V.Warn(warn +
                "axisYControlRotation: " +
                this.axisYControlRotation +
                ", axisYControlHeight: " +
                this.axisYControlHeight +
                ", axisYControlRadius: " +
                this.axisYControlRadius);
        }
        if (+this.axisPinchControlRotation + +this.axisPinchControlHeight + +this.axisPinchControlRadius <= 1) {
            logger/* Logger */.V.Warn(warn +
                "axisPinchControlRotation: " +
                this.axisPinchControlRotation +
                ", axisPinchControlHeight: " +
                this.axisPinchControlHeight +
                ", axisPinchControlRadius: " +
                this.axisPinchControlRadius);
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "angularSensibilityX", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "angularSensibilityY", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "pinchPrecision", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "pinchDeltaPercentage", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "axisXControlRadius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "axisXControlHeight", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "axisXControlRotation", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "axisYControlRadius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "axisYControlHeight", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "axisYControlRotation", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "axisPinchControlRadius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "axisPinchControlHeight", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCameraPointersInput.prototype, "axisPinchControlRotation", void 0);
cameraInputsManager/* CameraInputTypes */.H["FollowCameraPointersInput"] = FollowCameraPointersInput;
//# sourceMappingURL=followCameraPointersInput.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/freeCameraInputsManager.js
var freeCameraInputsManager = __webpack_require__(67100);
;// ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraDeviceOrientationInput.js





/**
 * Add orientation input support to the input manager.
 * @param smoothFactor deviceOrientation smoothing. 0: no smoothing, 1: new data ignored, 0.9 recommended for smoothing
 * @returns the current input manager
 */
freeCameraInputsManager/* FreeCameraInputsManager */.s.prototype.addDeviceOrientation = function (smoothFactor) {
    if (!this._deviceOrientationInput) {
        this._deviceOrientationInput = new FreeCameraDeviceOrientationInput();
        if (smoothFactor) {
            this._deviceOrientationInput.smoothFactor = smoothFactor;
        }
        this.add(this._deviceOrientationInput);
    }
    return this;
};
/**
 * Takes information about the orientation of the device as reported by the deviceorientation event to orient the camera.
 * Screen rotation is taken into account.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FreeCameraDeviceOrientationInput {
    /**
     * Can be used to detect if a device orientation sensor is available on a device
     * @param timeout amount of time in milliseconds to wait for a response from the sensor (default: infinite)
     * @returns a promise that will resolve on orientation change
     */
    static WaitForOrientationChangeAsync(timeout) {
        return new Promise((res, rej) => {
            let gotValue = false;
            const eventHandler = () => {
                window.removeEventListener("deviceorientation", eventHandler);
                gotValue = true;
                res();
            };
            // If timeout is populated reject the promise
            if (timeout) {
                setTimeout(() => {
                    if (!gotValue) {
                        window.removeEventListener("deviceorientation", eventHandler);
                        rej("WaitForOrientationChangeAsync timed out");
                    }
                }, timeout);
            }
            if (typeof DeviceOrientationEvent !== "undefined" && typeof DeviceOrientationEvent.requestPermission === "function") {
                DeviceOrientationEvent
                    .requestPermission()
                    .then((response) => {
                    if (response == "granted") {
                        window.addEventListener("deviceorientation", eventHandler);
                    }
                    else {
                        tools/* Tools */.S0.Warn("Permission not granted.");
                    }
                })
                    .catch((error) => {
                    tools/* Tools */.S0.Error(error);
                });
            }
            else {
                window.addEventListener("deviceorientation", eventHandler);
            }
        });
    }
    /**
     * Instantiates a new input
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
     */
    constructor() {
        this._screenOrientationAngle = 0;
        this._screenQuaternion = new math_vector/* Quaternion */.PT();
        this._alpha = 0;
        this._beta = 0;
        this._gamma = 0;
        /** alpha+beta+gamma smoothing. 0: no smoothing, 1: new data ignored, 0.9 recommended for smoothing */
        this.smoothFactor = 0;
        /**
         * @internal
         */
        this._onDeviceOrientationChangedObservable = new Misc_observable/* Observable */.cP();
        this._orientationChanged = () => {
            this._screenOrientationAngle =
                window.orientation !== undefined
                    ? +window.orientation
                    : window.screen.orientation && window.screen.orientation["angle"]
                        ? window.screen.orientation.angle
                        : 0;
            this._screenOrientationAngle = -tools/* Tools */.S0.ToRadians(this._screenOrientationAngle / 2);
            this._screenQuaternion.copyFromFloats(0, Math.sin(this._screenOrientationAngle), 0, Math.cos(this._screenOrientationAngle));
        };
        this._deviceOrientation = (evt) => {
            if (this.smoothFactor) {
                this._alpha = evt.alpha !== null ? tools/* Tools */.S0.SmoothAngleChange(this._alpha, evt.alpha, this.smoothFactor) : 0;
                this._beta = evt.beta !== null ? tools/* Tools */.S0.SmoothAngleChange(this._beta, evt.beta, this.smoothFactor) : 0;
                this._gamma = evt.gamma !== null ? tools/* Tools */.S0.SmoothAngleChange(this._gamma, evt.gamma, this.smoothFactor) : 0;
            }
            else {
                this._alpha = evt.alpha !== null ? evt.alpha : 0;
                this._beta = evt.beta !== null ? evt.beta : 0;
                this._gamma = evt.gamma !== null ? evt.gamma : 0;
            }
            if (evt.alpha !== null) {
                this._onDeviceOrientationChangedObservable.notifyObservers();
            }
        };
        this._constantTransform = new math_vector/* Quaternion */.PT(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5));
        this._orientationChanged();
    }
    /**
     * Define the camera controlled by the input.
     */
    get camera() {
        return this._camera;
    }
    set camera(camera) {
        this._camera = camera;
        if (this._camera != null && !this._camera.rotationQuaternion) {
            this._camera.rotationQuaternion = new math_vector/* Quaternion */.PT();
        }
        if (this._camera) {
            this._camera.onDisposeObservable.add(() => {
                this._onDeviceOrientationChangedObservable.clear();
            });
        }
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     */
    attachControl() {
        const hostWindow = this.camera.getScene().getEngine().getHostWindow();
        if (hostWindow) {
            const eventHandler = () => {
                hostWindow.addEventListener("orientationchange", this._orientationChanged);
                hostWindow.addEventListener("deviceorientation", this._deviceOrientation);
                //In certain cases, the attach control is called AFTER orientation was changed,
                //So this is needed.
                this._orientationChanged();
            };
            if (typeof DeviceOrientationEvent !== "undefined" && typeof DeviceOrientationEvent.requestPermission === "function") {
                DeviceOrientationEvent
                    .requestPermission()
                    .then((response) => {
                    if (response === "granted") {
                        eventHandler();
                    }
                    else {
                        tools/* Tools */.S0.Warn("Permission not granted.");
                    }
                })
                    .catch((error) => {
                    tools/* Tools */.S0.Error(error);
                });
            }
            else {
                eventHandler();
            }
        }
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        window.removeEventListener("orientationchange", this._orientationChanged);
        window.removeEventListener("deviceorientation", this._deviceOrientation);
        this._alpha = 0;
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        // if no device orientation provided, don't update the rotation.
        // Only testing against alpha under the assumption that orientation will never be so exact when set.
        if (!this._alpha) {
            return;
        }
        math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(tools/* Tools */.S0.ToRadians(this._alpha), tools/* Tools */.S0.ToRadians(this._beta), -tools/* Tools */.S0.ToRadians(this._gamma), this.camera.rotationQuaternion);
        this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion);
        this._camera.rotationQuaternion.multiplyInPlace(this._constantTransform);
        if (this._camera.getScene().useRightHandedSystem) {
            this._camera.rotationQuaternion.y *= -1;
        }
        else {
            this._camera.rotationQuaternion.z *= -1;
        }
        this._camera.rotationQuaternion.w *= -1;
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FreeCameraDeviceOrientationInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "deviceOrientation";
    }
}
cameraInputsManager/* CameraInputTypes */.H["FreeCameraDeviceOrientationInput"] = FreeCameraDeviceOrientationInput;
//# sourceMappingURL=freeCameraDeviceOrientationInput.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraGamepadInput.js





/**
 * Manage the gamepad inputs to control a free camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FreeCameraGamepadInput {
    constructor() {
        /**
         * Defines the gamepad rotation sensibility.
         * This is the threshold from when rotation starts to be accounted for to prevent jittering.
         */
        this.gamepadAngularSensibility = 200;
        /**
         * Defines the gamepad move sensibility.
         * This is the threshold from when moving starts to be accounted for for to prevent jittering.
         */
        this.gamepadMoveSensibility = 40;
        /**
         * Defines the minimum value at which any analog stick input is ignored.
         * Note: This value should only be a value between 0 and 1.
         */
        this.deadzoneDelta = 0.1;
        this._yAxisScale = 1.0;
        this._cameraTransform = math_vector/* Matrix */.uq.Identity();
        this._deltaTransform = math_vector/* Vector3 */.Pq.Zero();
        this._vector3 = math_vector/* Vector3 */.Pq.Zero();
        this._vector2 = math_vector/* Vector2 */.I9.Zero();
    }
    /**
     * Gets or sets a boolean indicating that Yaxis (for right stick) should be inverted
     */
    get invertYAxis() {
        return this._yAxisScale !== 1.0;
    }
    set invertYAxis(value) {
        this._yAxisScale = value ? -1.0 : 1.0;
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     */
    attachControl() {
        const manager = this.camera.getScene().gamepadManager;
        this._onGamepadConnectedObserver = manager.onGamepadConnectedObservable.add((gamepad) => {
            if (gamepad.type !== Gamepad.POSE_ENABLED) {
                // prioritize XBOX gamepads.
                if (!this.gamepad || gamepad.type === Gamepad.XBOX) {
                    this.gamepad = gamepad;
                }
            }
        });
        this._onGamepadDisconnectedObserver = manager.onGamepadDisconnectedObservable.add((gamepad) => {
            if (this.gamepad === gamepad) {
                this.gamepad = null;
            }
        });
        // check if there are already other controllers connected
        this.gamepad = manager.getGamepadByType(Gamepad.XBOX);
        // if no xbox controller was found, but there are gamepad controllers, take the first one
        if (!this.gamepad && manager.gamepads.length) {
            this.gamepad = manager.gamepads[0];
        }
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver);
        this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver);
        this.gamepad = null;
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (this.gamepad && this.gamepad.leftStick) {
            const camera = this.camera;
            const lsValues = this.gamepad.leftStick;
            if (this.gamepadMoveSensibility !== 0) {
                lsValues.x = Math.abs(lsValues.x) > this.deadzoneDelta ? lsValues.x / this.gamepadMoveSensibility : 0;
                lsValues.y = Math.abs(lsValues.y) > this.deadzoneDelta ? lsValues.y / this.gamepadMoveSensibility : 0;
            }
            let rsValues = this.gamepad.rightStick;
            if (rsValues && this.gamepadAngularSensibility !== 0) {
                rsValues.x = Math.abs(rsValues.x) > this.deadzoneDelta ? rsValues.x / this.gamepadAngularSensibility : 0;
                rsValues.y = (Math.abs(rsValues.y) > this.deadzoneDelta ? rsValues.y / this.gamepadAngularSensibility : 0) * this._yAxisScale;
            }
            else {
                rsValues = { x: 0, y: 0 };
            }
            if (!camera.rotationQuaternion) {
                math_vector/* Matrix */.uq.RotationYawPitchRollToRef(camera.rotation.y, camera.rotation.x, 0, this._cameraTransform);
            }
            else {
                camera.rotationQuaternion.toRotationMatrix(this._cameraTransform);
            }
            const speed = camera._computeLocalCameraSpeed() * 50.0;
            this._vector3.copyFromFloats(lsValues.x * speed, 0, -lsValues.y * speed);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._vector3, this._cameraTransform, this._deltaTransform);
            camera.cameraDirection.addInPlace(this._deltaTransform);
            this._vector2.copyFromFloats(rsValues.y, rsValues.x);
            camera.cameraRotation.addInPlace(this._vector2);
        }
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FreeCameraGamepadInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "gamepad";
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FreeCameraGamepadInput.prototype, "gamepadAngularSensibility", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FreeCameraGamepadInput.prototype, "gamepadMoveSensibility", void 0);
cameraInputsManager/* CameraInputTypes */.H["FreeCameraGamepadInput"] = FreeCameraGamepadInput;
//# sourceMappingURL=freeCameraGamepadInput.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraKeyboardMoveInput.js
var freeCameraKeyboardMoveInput = __webpack_require__(23102);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseInput.js
var freeCameraMouseInput = __webpack_require__(12901);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseWheelInput.js
var freeCameraMouseWheelInput = __webpack_require__(11984);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraTouchInput.js
var freeCameraTouchInput = __webpack_require__(5305);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/stringDictionary.js
var stringDictionary = __webpack_require__(87216);
;// ./node_modules/@babylonjs/core/Misc/virtualJoystick.js


// Mainly based on these 2 articles :
// Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx
// & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/
/**
 * Defines the potential axis of a Joystick
 */
var JoystickAxis;
(function (JoystickAxis) {
    /** X axis */
    JoystickAxis[JoystickAxis["X"] = 0] = "X";
    /** Y axis */
    JoystickAxis[JoystickAxis["Y"] = 1] = "Y";
    /** Z axis */
    JoystickAxis[JoystickAxis["Z"] = 2] = "Z";
})(JoystickAxis || (JoystickAxis = {}));
/**
 * Class used to define virtual joystick (used in touch mode)
 */
class VirtualJoystick {
    static _GetDefaultOptions() {
        return {
            puckSize: 40,
            containerSize: 60,
            color: "cyan",
            puckImage: undefined,
            containerImage: undefined,
            position: undefined,
            alwaysVisible: false,
            limitToContainer: false,
        };
    }
    /**
     * Creates a new virtual joystick
     * @param leftJoystick defines that the joystick is for left hand (false by default)
     * @param customizations Defines the options we want to customize the VirtualJoystick
     */
    constructor(leftJoystick, customizations) {
        this._released = false;
        const options = {
            ...VirtualJoystick._GetDefaultOptions(),
            ...customizations,
        };
        if (leftJoystick) {
            this._leftJoystick = true;
        }
        else {
            this._leftJoystick = false;
        }
        VirtualJoystick._GlobalJoystickIndex++;
        // By default left & right arrow keys are moving the X
        // and up & down keys are moving the Y
        this._axisTargetedByLeftAndRight = 0 /* JoystickAxis.X */;
        this._axisTargetedByUpAndDown = 1 /* JoystickAxis.Y */;
        this.reverseLeftRight = false;
        this.reverseUpDown = false;
        // collections of pointers
        this._touches = new stringDictionary/* StringDictionary */.w();
        this.deltaPosition = math_vector/* Vector3 */.Pq.Zero();
        this._joystickSensibility = 25;
        this._inversedSensibility = 1 / (this._joystickSensibility / 1000);
        this._onResize = () => {
            VirtualJoystick._VJCanvasWidth = window.innerWidth;
            VirtualJoystick._VJCanvasHeight = window.innerHeight;
            if (VirtualJoystick.Canvas) {
                VirtualJoystick.Canvas.width = VirtualJoystick._VJCanvasWidth;
                VirtualJoystick.Canvas.height = VirtualJoystick._VJCanvasHeight;
            }
            VirtualJoystick._HalfWidth = VirtualJoystick._VJCanvasWidth / 2;
        };
        // injecting a canvas element on top of the canvas 3D game
        if (!VirtualJoystick.Canvas) {
            window.addEventListener("resize", this._onResize, false);
            VirtualJoystick.Canvas = document.createElement("canvas");
            VirtualJoystick._VJCanvasWidth = window.innerWidth;
            VirtualJoystick._VJCanvasHeight = window.innerHeight;
            VirtualJoystick.Canvas.width = window.innerWidth;
            VirtualJoystick.Canvas.height = window.innerHeight;
            VirtualJoystick.Canvas.style.width = "100%";
            VirtualJoystick.Canvas.style.height = "100%";
            VirtualJoystick.Canvas.style.position = "absolute";
            VirtualJoystick.Canvas.style.backgroundColor = "transparent";
            VirtualJoystick.Canvas.style.top = "0px";
            VirtualJoystick.Canvas.style.left = "0px";
            VirtualJoystick.Canvas.style.zIndex = "5";
            VirtualJoystick.Canvas.style.touchAction = "none"; // fix https://forum.babylonjs.com/t/virtualjoystick-needs-to-set-style-touch-action-none-explicitly/9562
            // Support for jQuery PEP polyfill
            VirtualJoystick.Canvas.setAttribute("touch-action", "none");
            const context = VirtualJoystick.Canvas.getContext("2d");
            if (!context) {
                throw new Error("Unable to create canvas for virtual joystick");
            }
            VirtualJoystick._VJCanvasContext = context;
            VirtualJoystick._VJCanvasContext.strokeStyle = "#ffffff";
            VirtualJoystick._VJCanvasContext.lineWidth = 2;
            document.body.appendChild(VirtualJoystick.Canvas);
        }
        VirtualJoystick._HalfWidth = VirtualJoystick.Canvas.width / 2;
        this.pressed = false;
        this.limitToContainer = options.limitToContainer;
        // default joystick color
        this._joystickColor = options.color;
        // default joystick size
        this.containerSize = options.containerSize;
        this.puckSize = options.puckSize;
        if (options.position) {
            this.setPosition(options.position.x, options.position.y);
        }
        if (options.puckImage) {
            this.setPuckImage(options.puckImage);
        }
        if (options.containerImage) {
            this.setContainerImage(options.containerImage);
        }
        if (options.alwaysVisible) {
            VirtualJoystick._AlwaysVisibleSticks++;
        }
        // must come after position potentially set
        this.alwaysVisible = options.alwaysVisible;
        this._joystickPointerId = -1;
        // current joystick position
        this._joystickPointerPos = new math_vector/* Vector2 */.I9(0, 0);
        this._joystickPreviousPointerPos = new math_vector/* Vector2 */.I9(0, 0);
        // origin joystick position
        this._joystickPointerStartPos = new math_vector/* Vector2 */.I9(0, 0);
        this._deltaJoystickVector = new math_vector/* Vector2 */.I9(0, 0);
        this._onPointerDownHandlerRef = (evt) => {
            this._onPointerDown(evt);
        };
        this._onPointerMoveHandlerRef = (evt) => {
            this._onPointerMove(evt);
        };
        this._onPointerUpHandlerRef = (evt) => {
            this._onPointerUp(evt);
        };
        VirtualJoystick.Canvas.addEventListener("pointerdown", this._onPointerDownHandlerRef, false);
        VirtualJoystick.Canvas.addEventListener("pointermove", this._onPointerMoveHandlerRef, false);
        VirtualJoystick.Canvas.addEventListener("pointerup", this._onPointerUpHandlerRef, false);
        VirtualJoystick.Canvas.addEventListener("pointerout", this._onPointerUpHandlerRef, false);
        VirtualJoystick.Canvas.addEventListener("contextmenu", (evt) => {
            evt.preventDefault(); // Disables system menu
        }, false);
        requestAnimationFrame(() => {
            this._drawVirtualJoystick();
        });
    }
    /**
     * Defines joystick sensibility (ie. the ratio between a physical move and virtual joystick position change)
     * @param newJoystickSensibility defines the new sensibility
     */
    setJoystickSensibility(newJoystickSensibility) {
        this._joystickSensibility = newJoystickSensibility;
        this._inversedSensibility = 1 / (this._joystickSensibility / 1000);
    }
    _onPointerDown(e) {
        let positionOnScreenCondition;
        e.preventDefault();
        if (this._leftJoystick === true) {
            positionOnScreenCondition = e.clientX < VirtualJoystick._HalfWidth;
        }
        else {
            positionOnScreenCondition = e.clientX > VirtualJoystick._HalfWidth;
        }
        if (positionOnScreenCondition && this._joystickPointerId < 0) {
            // First contact will be dedicated to the virtual joystick
            this._joystickPointerId = e.pointerId;
            if (this._joystickPosition) {
                this._joystickPointerStartPos = this._joystickPosition.clone();
                this._joystickPointerPos = this._joystickPosition.clone();
                this._joystickPreviousPointerPos = this._joystickPosition.clone();
                // in case the user only clicks down && doesn't move:
                // this ensures the delta is properly set
                this._onPointerMove(e);
            }
            else {
                this._joystickPointerStartPos.x = e.clientX;
                this._joystickPointerStartPos.y = e.clientY;
                this._joystickPointerPos = this._joystickPointerStartPos.clone();
                this._joystickPreviousPointerPos = this._joystickPointerStartPos.clone();
            }
            this._deltaJoystickVector.x = 0;
            this._deltaJoystickVector.y = 0;
            this.pressed = true;
            this._touches.add(e.pointerId.toString(), e);
        }
        else {
            // You can only trigger the action buttons with a joystick declared
            if (VirtualJoystick._GlobalJoystickIndex < 2 && this._action) {
                this._action();
                this._touches.add(e.pointerId.toString(), { x: e.clientX, y: e.clientY, prevX: e.clientX, prevY: e.clientY });
            }
        }
    }
    _onPointerMove(e) {
        // If the current pointer is the one associated to the joystick (first touch contact)
        if (this._joystickPointerId == e.pointerId) {
            // limit to container if need be
            if (this.limitToContainer) {
                const vector = new math_vector/* Vector2 */.I9(e.clientX - this._joystickPointerStartPos.x, e.clientY - this._joystickPointerStartPos.y);
                const distance = vector.length();
                if (distance > this.containerSize) {
                    vector.scaleInPlace(this.containerSize / distance);
                }
                this._joystickPointerPos.x = this._joystickPointerStartPos.x + vector.x;
                this._joystickPointerPos.y = this._joystickPointerStartPos.y + vector.y;
            }
            else {
                this._joystickPointerPos.x = e.clientX;
                this._joystickPointerPos.y = e.clientY;
            }
            // create delta vector
            this._deltaJoystickVector = this._joystickPointerPos.clone();
            this._deltaJoystickVector = this._deltaJoystickVector.subtract(this._joystickPointerStartPos);
            // if a joystick is always visible, there will be clipping issues if
            // you drag the puck from one over the container of the other
            if (0 < VirtualJoystick._AlwaysVisibleSticks) {
                if (this._leftJoystick) {
                    this._joystickPointerPos.x = Math.min(VirtualJoystick._HalfWidth, this._joystickPointerPos.x);
                }
                else {
                    this._joystickPointerPos.x = Math.max(VirtualJoystick._HalfWidth, this._joystickPointerPos.x);
                }
            }
            const directionLeftRight = this.reverseLeftRight ? -1 : 1;
            const deltaJoystickX = (directionLeftRight * this._deltaJoystickVector.x) / this._inversedSensibility;
            switch (this._axisTargetedByLeftAndRight) {
                case 0 /* JoystickAxis.X */:
                    this.deltaPosition.x = Math.min(1, Math.max(-1, deltaJoystickX));
                    break;
                case 1 /* JoystickAxis.Y */:
                    this.deltaPosition.y = Math.min(1, Math.max(-1, deltaJoystickX));
                    break;
                case 2 /* JoystickAxis.Z */:
                    this.deltaPosition.z = Math.min(1, Math.max(-1, deltaJoystickX));
                    break;
            }
            const directionUpDown = this.reverseUpDown ? 1 : -1;
            const deltaJoystickY = (directionUpDown * this._deltaJoystickVector.y) / this._inversedSensibility;
            switch (this._axisTargetedByUpAndDown) {
                case 0 /* JoystickAxis.X */:
                    this.deltaPosition.x = Math.min(1, Math.max(-1, deltaJoystickY));
                    break;
                case 1 /* JoystickAxis.Y */:
                    this.deltaPosition.y = Math.min(1, Math.max(-1, deltaJoystickY));
                    break;
                case 2 /* JoystickAxis.Z */:
                    this.deltaPosition.z = Math.min(1, Math.max(-1, deltaJoystickY));
                    break;
            }
        }
        else {
            const data = this._touches.get(e.pointerId.toString());
            if (data) {
                data.x = e.clientX;
                data.y = e.clientY;
            }
        }
    }
    _onPointerUp(e) {
        if (this._joystickPointerId == e.pointerId) {
            this._clearPreviousDraw();
            this._joystickPointerId = -1;
            this.pressed = false;
        }
        else {
            const touch = this._touches.get(e.pointerId.toString());
            if (touch) {
                VirtualJoystick._VJCanvasContext.clearRect(touch.prevX - 44, touch.prevY - 44, 88, 88);
            }
        }
        this._deltaJoystickVector.x = 0;
        this._deltaJoystickVector.y = 0;
        this._touches.remove(e.pointerId.toString());
    }
    /**
     * Change the color of the virtual joystick
     * @param newColor a string that must be a CSS color value (like "red") or the hexa value (like "#FF0000")
     */
    setJoystickColor(newColor) {
        this._joystickColor = newColor;
    }
    /**
     * Size of the joystick's container
     */
    set containerSize(newSize) {
        this._joystickContainerSize = newSize;
        this._clearContainerSize = ~~(this._joystickContainerSize * 2.1);
        this._clearContainerSizeOffset = ~~(this._clearContainerSize / 2);
    }
    get containerSize() {
        return this._joystickContainerSize;
    }
    /**
     * Size of the joystick's puck
     */
    set puckSize(newSize) {
        this._joystickPuckSize = newSize;
        this._clearPuckSize = ~~(this._joystickPuckSize * 2.1);
        this._clearPuckSizeOffset = ~~(this._clearPuckSize / 2);
    }
    get puckSize() {
        return this._joystickPuckSize;
    }
    /**
     * Clears the set position of the joystick
     */
    clearPosition() {
        this.alwaysVisible = false;
        this._joystickPosition = null;
    }
    /**
     * Defines whether or not the joystick container is always visible
     */
    set alwaysVisible(value) {
        if (this._alwaysVisible === value) {
            return;
        }
        if (value && this._joystickPosition) {
            VirtualJoystick._AlwaysVisibleSticks++;
            this._alwaysVisible = true;
        }
        else {
            VirtualJoystick._AlwaysVisibleSticks--;
            this._alwaysVisible = false;
        }
    }
    get alwaysVisible() {
        return this._alwaysVisible;
    }
    /**
     * Sets the constant position of the Joystick container
     * @param x X axis coordinate
     * @param y Y axis coordinate
     */
    setPosition(x, y) {
        // just in case position is moved while the container is visible
        if (this._joystickPointerStartPos) {
            this._clearPreviousDraw();
        }
        this._joystickPosition = new math_vector/* Vector2 */.I9(x, y);
    }
    /**
     * Defines a callback to call when the joystick is touched
     * @param action defines the callback
     */
    setActionOnTouch(action) {
        this._action = action;
    }
    /**
     * Defines which axis you'd like to control for left & right
     * @param axis defines the axis to use
     */
    setAxisForLeftRight(axis) {
        switch (axis) {
            case 0 /* JoystickAxis.X */:
            case 1 /* JoystickAxis.Y */:
            case 2 /* JoystickAxis.Z */:
                this._axisTargetedByLeftAndRight = axis;
                break;
            default:
                this._axisTargetedByLeftAndRight = 0 /* JoystickAxis.X */;
                break;
        }
    }
    /**
     * Defines which axis you'd like to control for up & down
     * @param axis defines the axis to use
     */
    setAxisForUpDown(axis) {
        switch (axis) {
            case 0 /* JoystickAxis.X */:
            case 1 /* JoystickAxis.Y */:
            case 2 /* JoystickAxis.Z */:
                this._axisTargetedByUpAndDown = axis;
                break;
            default:
                this._axisTargetedByUpAndDown = 1 /* JoystickAxis.Y */;
                break;
        }
    }
    /**
     * Clears the canvas from the previous puck / container draw
     */
    _clearPreviousDraw() {
        const jp = this._joystickPosition || this._joystickPointerStartPos;
        // clear container pixels
        VirtualJoystick._VJCanvasContext.clearRect(jp.x - this._clearContainerSizeOffset, jp.y - this._clearContainerSizeOffset, this._clearContainerSize, this._clearContainerSize);
        // clear puck pixels + 1 pixel for the change made before it moved
        VirtualJoystick._VJCanvasContext.clearRect(this._joystickPreviousPointerPos.x - this._clearPuckSizeOffset - 1, this._joystickPreviousPointerPos.y - this._clearPuckSizeOffset - 1, this._clearPuckSize + 2, this._clearPuckSize + 2);
    }
    /**
     * Loads `urlPath` to be used for the container's image
     * @param urlPath defines the urlPath of an image to use
     */
    setContainerImage(urlPath) {
        const image = new Image();
        image.src = urlPath;
        image.onload = () => (this._containerImage = image);
    }
    /**
     * Loads `urlPath` to be used for the puck's image
     * @param urlPath defines the urlPath of an image to use
     */
    setPuckImage(urlPath) {
        const image = new Image();
        image.src = urlPath;
        image.onload = () => (this._puckImage = image);
    }
    /**
     * Draws the Virtual Joystick's container
     */
    _drawContainer() {
        const jp = this._joystickPosition || this._joystickPointerStartPos;
        this._clearPreviousDraw();
        if (this._containerImage) {
            VirtualJoystick._VJCanvasContext.drawImage(this._containerImage, jp.x - this.containerSize, jp.y - this.containerSize, this.containerSize * 2, this.containerSize * 2);
        }
        else {
            // outer container
            VirtualJoystick._VJCanvasContext.beginPath();
            VirtualJoystick._VJCanvasContext.strokeStyle = this._joystickColor;
            VirtualJoystick._VJCanvasContext.lineWidth = 2;
            VirtualJoystick._VJCanvasContext.arc(jp.x, jp.y, this.containerSize, 0, Math.PI * 2, true);
            VirtualJoystick._VJCanvasContext.stroke();
            VirtualJoystick._VJCanvasContext.closePath();
            // inner container
            VirtualJoystick._VJCanvasContext.beginPath();
            VirtualJoystick._VJCanvasContext.lineWidth = 6;
            VirtualJoystick._VJCanvasContext.strokeStyle = this._joystickColor;
            VirtualJoystick._VJCanvasContext.arc(jp.x, jp.y, this.puckSize, 0, Math.PI * 2, true);
            VirtualJoystick._VJCanvasContext.stroke();
            VirtualJoystick._VJCanvasContext.closePath();
        }
    }
    /**
     * Draws the Virtual Joystick's puck
     */
    _drawPuck() {
        if (this._puckImage) {
            VirtualJoystick._VJCanvasContext.drawImage(this._puckImage, this._joystickPointerPos.x - this.puckSize, this._joystickPointerPos.y - this.puckSize, this.puckSize * 2, this.puckSize * 2);
        }
        else {
            VirtualJoystick._VJCanvasContext.beginPath();
            VirtualJoystick._VJCanvasContext.strokeStyle = this._joystickColor;
            VirtualJoystick._VJCanvasContext.lineWidth = 2;
            VirtualJoystick._VJCanvasContext.arc(this._joystickPointerPos.x, this._joystickPointerPos.y, this.puckSize, 0, Math.PI * 2, true);
            VirtualJoystick._VJCanvasContext.stroke();
            VirtualJoystick._VJCanvasContext.closePath();
        }
    }
    _drawVirtualJoystick() {
        // canvas released? don't continue iterating
        if (this._released) {
            return;
        }
        if (this.alwaysVisible) {
            this._drawContainer();
        }
        if (this.pressed) {
            this._touches.forEach((key, touch) => {
                if (touch.pointerId === this._joystickPointerId) {
                    if (!this.alwaysVisible) {
                        this._drawContainer();
                    }
                    this._drawPuck();
                    // store current pointer for next clear
                    this._joystickPreviousPointerPos = this._joystickPointerPos.clone();
                }
                else {
                    VirtualJoystick._VJCanvasContext.clearRect(touch.prevX - 44, touch.prevY - 44, 88, 88);
                    VirtualJoystick._VJCanvasContext.beginPath();
                    VirtualJoystick._VJCanvasContext.fillStyle = "white";
                    VirtualJoystick._VJCanvasContext.beginPath();
                    VirtualJoystick._VJCanvasContext.strokeStyle = "red";
                    VirtualJoystick._VJCanvasContext.lineWidth = 6;
                    VirtualJoystick._VJCanvasContext.arc(touch.x, touch.y, 40, 0, Math.PI * 2, true);
                    VirtualJoystick._VJCanvasContext.stroke();
                    VirtualJoystick._VJCanvasContext.closePath();
                    touch.prevX = touch.x;
                    touch.prevY = touch.y;
                }
            });
        }
        requestAnimationFrame(() => {
            this._drawVirtualJoystick();
        });
    }
    /**
     * Release internal HTML canvas
     */
    releaseCanvas() {
        if (VirtualJoystick.Canvas) {
            VirtualJoystick.Canvas.removeEventListener("pointerdown", this._onPointerDownHandlerRef);
            VirtualJoystick.Canvas.removeEventListener("pointermove", this._onPointerMoveHandlerRef);
            VirtualJoystick.Canvas.removeEventListener("pointerup", this._onPointerUpHandlerRef);
            VirtualJoystick.Canvas.removeEventListener("pointerout", this._onPointerUpHandlerRef);
            window.removeEventListener("resize", this._onResize);
            document.body.removeChild(VirtualJoystick.Canvas);
            VirtualJoystick.Canvas = null;
        }
        this._released = true;
    }
}
// Used to draw the virtual joystick inside a 2D canvas on top of the WebGL rendering canvas
VirtualJoystick._GlobalJoystickIndex = 0;
VirtualJoystick._AlwaysVisibleSticks = 0;
//# sourceMappingURL=virtualJoystick.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/freeCameraVirtualJoystickInput.js




/**
 * Add virtual joystick input support to the input manager.
 * @returns the current input manager
 */
freeCameraInputsManager/* FreeCameraInputsManager */.s.prototype.addVirtualJoystick = function () {
    this.add(new FreeCameraVirtualJoystickInput());
    return this;
};
/**
 * Manage the Virtual Joystick inputs to control the movement of a free camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FreeCameraVirtualJoystickInput {
    /**
     * Gets the left stick of the virtual joystick.
     * @returns The virtual Joystick
     */
    getLeftJoystick() {
        return this._leftjoystick;
    }
    /**
     * Gets the right stick of the virtual joystick.
     * @returns The virtual Joystick
     */
    getRightJoystick() {
        return this._rightjoystick;
    }
    /**
     * Update the current camera state depending on the inputs that have been used this frame.
     * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
     */
    checkInputs() {
        if (this._leftjoystick) {
            const camera = this.camera;
            const speed = camera._computeLocalCameraSpeed() * 50;
            const cameraTransform = math_vector/* Matrix */.uq.RotationYawPitchRoll(camera.rotation.y, camera.rotation.x, 0);
            const deltaTransform = math_vector/* Vector3 */.Pq.TransformCoordinates(new math_vector/* Vector3 */.Pq(this._leftjoystick.deltaPosition.x * speed, this._leftjoystick.deltaPosition.y * speed, this._leftjoystick.deltaPosition.z * speed), cameraTransform);
            camera.cameraDirection = camera.cameraDirection.add(deltaTransform);
            camera.cameraRotation = camera.cameraRotation.addVector3(this._rightjoystick.deltaPosition);
            if (!this._leftjoystick.pressed) {
                this._leftjoystick.deltaPosition = this._leftjoystick.deltaPosition.scale(0.9);
            }
            if (!this._rightjoystick.pressed) {
                this._rightjoystick.deltaPosition = this._rightjoystick.deltaPosition.scale(0.9);
            }
        }
    }
    /**
     * Attach the input controls to a specific dom element to get the input from.
     */
    attachControl() {
        this._leftjoystick = new VirtualJoystick(true);
        this._leftjoystick.setAxisForUpDown(2 /* JoystickAxis.Z */);
        this._leftjoystick.setAxisForLeftRight(0 /* JoystickAxis.X */);
        this._leftjoystick.setJoystickSensibility(0.15);
        this._rightjoystick = new VirtualJoystick(false);
        this._rightjoystick.setAxisForUpDown(0 /* JoystickAxis.X */);
        this._rightjoystick.setAxisForLeftRight(1 /* JoystickAxis.Y */);
        this._rightjoystick.reverseUpDown = true;
        this._rightjoystick.setJoystickSensibility(0.05);
        this._rightjoystick.setJoystickColor("yellow");
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        this._leftjoystick.releaseCanvas();
        this._rightjoystick.releaseCanvas();
    }
    /**
     * Gets the class name of the current input.
     * @returns the class name
     */
    getClassName() {
        return "FreeCameraVirtualJoystickInput";
    }
    /**
     * Get the friendly name associated with the input class.
     * @returns the input friendly name
     */
    getSimpleName() {
        return "virtualJoystick";
    }
}
cameraInputsManager/* CameraInputTypes */.H["FreeCameraVirtualJoystickInput"] = FreeCameraVirtualJoystickInput;
//# sourceMappingURL=freeCameraVirtualJoystickInput.js.map
;// ./node_modules/@babylonjs/core/Cameras/Inputs/index.js



















//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/camera.js
var Cameras_camera = __webpack_require__(30388);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/targetCamera.js
var targetCamera = __webpack_require__(12333);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Cameras/freeCamera.js
var Cameras_freeCamera = __webpack_require__(11710);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/node.js
var node = __webpack_require__(4870);
;// ./node_modules/@babylonjs/core/Cameras/touchCamera.js



node/* Node */.b.AddNodeConstructor("TouchCamera", (name, scene) => {
    return () => new TouchCamera(name, math_vector/* Vector3 */.Pq.Zero(), scene);
});
/**
 * This represents a FPS type of camera controlled by touch.
 * This is like a universal camera minus the Gamepad controls.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
 */
class TouchCamera extends Cameras_freeCamera/* FreeCamera */.S {
    /**
     * Defines the touch sensibility for rotation.
     * The higher the faster.
     */
    get touchAngularSensibility() {
        const touch = this.inputs.attached["touch"];
        if (touch) {
            return touch.touchAngularSensibility;
        }
        return 0;
    }
    set touchAngularSensibility(value) {
        const touch = this.inputs.attached["touch"];
        if (touch) {
            touch.touchAngularSensibility = value;
        }
    }
    /**
     * Defines the touch sensibility for move.
     * The higher the faster.
     */
    get touchMoveSensibility() {
        const touch = this.inputs.attached["touch"];
        if (touch) {
            return touch.touchMoveSensibility;
        }
        return 0;
    }
    set touchMoveSensibility(value) {
        const touch = this.inputs.attached["touch"];
        if (touch) {
            touch.touchMoveSensibility = value;
        }
    }
    /**
     * Instantiates a new touch camera.
     * This represents a FPS type of camera controlled by touch.
     * This is like a universal camera minus the Gamepad controls.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
     * @param name Define the name of the camera in the scene
     * @param position Define the start position of the camera in the scene
     * @param scene Define the scene the camera belongs to
     */
    constructor(name, position, scene) {
        super(name, position, scene);
        this.inputs.addTouch();
        this._setupInputs();
    }
    /**
     * Gets the current object class name.
     * @returns the class name
     */
    getClassName() {
        return "TouchCamera";
    }
    /** @internal */
    _setupInputs() {
        const touch = this.inputs.attached["touch"];
        const mouse = this.inputs.attached["mouse"];
        if (mouse) {
            // enable touch in mouse input if touch module is not enabled
            mouse.touchEnabled = !touch;
        }
        else {
            // allow mouse in touch input if mouse module is not available
            touch.allowMouse = !mouse;
        }
    }
}
//# sourceMappingURL=touchCamera.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/mesh.js
var Meshes_mesh = __webpack_require__(76595);
;// ./node_modules/@babylonjs/core/Cameras/arcRotateCamera.js
















node/* Node */.b.AddNodeConstructor("ArcRotateCamera", (name, scene) => {
    return () => new ArcRotateCamera(name, 0, 0, 1.0, math_vector/* Vector3 */.Pq.Zero(), scene);
});
/**
 * This represents an orbital type of camera.
 *
 * This camera always points towards a given target position and can be rotated around that target with the target as the centre of rotation. It can be controlled with cursors and mouse, or with touch events.
 * Think of this camera as one orbiting its target position, or more imaginatively as a spy satellite orbiting the earth. Its position relative to the target (earth) can be set by three parameters, alpha (radians) the longitudinal rotation, beta (radians) the latitudinal rotation and radius the distance from the target position.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#arc-rotate-camera
 */
class ArcRotateCamera extends targetCamera/* TargetCamera */.F {
    /**
     * Defines the target point of the camera.
     * The camera looks towards it from the radius distance.
     */
    get target() {
        return this._target;
    }
    set target(value) {
        this.setTarget(value);
    }
    /**
     * Defines the target transform node of the camera.
     * The camera looks towards it from the radius distance.
     * Please note that setting a target host will disable panning.
     */
    get targetHost() {
        return this._targetHost;
    }
    set targetHost(value) {
        if (value) {
            this.setTarget(value);
        }
    }
    /**
     * Return the current target position of the camera. This value is expressed in local space.
     * @returns the target position
     */
    getTarget() {
        return this.target;
    }
    /**
     * Define the current local position of the camera in the scene
     */
    get position() {
        return this._position;
    }
    set position(newPosition) {
        this.setPosition(newPosition);
    }
    /**
     * The vector the camera should consider as up. (default is Vector3(0, 1, 0) as returned by Vector3.Up())
     * Setting this will copy the given vector to the camera's upVector, and set rotation matrices to and from Y up.
     * DO NOT set the up vector using copyFrom or copyFromFloats, as this bypasses setting the above matrices.
     */
    set upVector(vec) {
        if (!this._upToYMatrix) {
            this._yToUpMatrix = new math_vector/* Matrix */.uq();
            this._upToYMatrix = new math_vector/* Matrix */.uq();
            this._upVector = math_vector/* Vector3 */.Pq.Zero();
        }
        vec.normalize();
        this._upVector.copyFrom(vec);
        this.setMatUp();
    }
    get upVector() {
        return this._upVector;
    }
    /**
     * Sets the Y-up to camera up-vector rotation matrix, and the up-vector to Y-up rotation matrix.
     */
    setMatUp() {
        // from y-up to custom-up (used in _getViewMatrix)
        math_vector/* Matrix */.uq.RotationAlignToRef(math_vector/* Vector3 */.Pq.UpReadOnly, this._upVector, this._yToUpMatrix);
        // from custom-up to y-up (used in rebuildAnglesAndRadius)
        math_vector/* Matrix */.uq.RotationAlignToRef(this._upVector, math_vector/* Vector3 */.Pq.UpReadOnly, this._upToYMatrix);
    }
    //-- begin properties for backward compatibility for inputs
    /**
     * Gets or Set the pointer angular sensibility  along the X axis or how fast is the camera rotating.
     */
    get angularSensibilityX() {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            return pointers.angularSensibilityX;
        }
        return 0;
    }
    set angularSensibilityX(value) {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            pointers.angularSensibilityX = value;
        }
    }
    /**
     * Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.
     */
    get angularSensibilityY() {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            return pointers.angularSensibilityY;
        }
        return 0;
    }
    set angularSensibilityY(value) {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            pointers.angularSensibilityY = value;
        }
    }
    /**
     * Gets or Set the pointer pinch precision or how fast is the camera zooming.
     */
    get pinchPrecision() {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            return pointers.pinchPrecision;
        }
        return 0;
    }
    set pinchPrecision(value) {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            pointers.pinchPrecision = value;
        }
    }
    /**
     * Gets or Set the pointer pinch delta percentage or how fast is the camera zooming.
     * It will be used instead of pinchPrecision if different from 0.
     * It defines the percentage of current camera.radius to use as delta when pinch zoom is used.
     */
    get pinchDeltaPercentage() {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            return pointers.pinchDeltaPercentage;
        }
        return 0;
    }
    set pinchDeltaPercentage(value) {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            pointers.pinchDeltaPercentage = value;
        }
    }
    /**
     * Gets or Set the pointer use natural pinch zoom to override the pinch precision
     * and pinch delta percentage.
     * When useNaturalPinchZoom is true, multi touch zoom will zoom in such
     * that any object in the plane at the camera's target point will scale
     * perfectly with finger motion.
     */
    get useNaturalPinchZoom() {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            return pointers.useNaturalPinchZoom;
        }
        return false;
    }
    set useNaturalPinchZoom(value) {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            pointers.useNaturalPinchZoom = value;
        }
    }
    /**
     * Gets or Set the pointer panning sensibility or how fast is the camera moving.
     */
    get panningSensibility() {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            return pointers.panningSensibility;
        }
        return 0;
    }
    set panningSensibility(value) {
        const pointers = this.inputs.attached["pointers"];
        if (pointers) {
            pointers.panningSensibility = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control beta angle in a positive direction.
     */
    get keysUp() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysUp;
        }
        return [];
    }
    set keysUp(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysUp = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control beta angle in a negative direction.
     */
    get keysDown() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysDown;
        }
        return [];
    }
    set keysDown(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysDown = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.
     */
    get keysLeft() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysLeft;
        }
        return [];
    }
    set keysLeft(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysLeft = value;
        }
    }
    /**
     * Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.
     */
    get keysRight() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysRight;
        }
        return [];
    }
    set keysRight(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysRight = value;
        }
    }
    /**
     * Gets or Set the mouse wheel precision or how fast is the camera zooming.
     */
    get wheelPrecision() {
        const mousewheel = this.inputs.attached["mousewheel"];
        if (mousewheel) {
            return mousewheel.wheelPrecision;
        }
        return 0;
    }
    set wheelPrecision(value) {
        const mousewheel = this.inputs.attached["mousewheel"];
        if (mousewheel) {
            mousewheel.wheelPrecision = value;
        }
    }
    /**
     * Gets or Set the boolean value that controls whether or not the mouse wheel
     * zooms to the location of the mouse pointer or not.  The default is false.
     */
    get zoomToMouseLocation() {
        const mousewheel = this.inputs.attached["mousewheel"];
        if (mousewheel) {
            return mousewheel.zoomToMouseLocation;
        }
        return false;
    }
    set zoomToMouseLocation(value) {
        const mousewheel = this.inputs.attached["mousewheel"];
        if (mousewheel) {
            mousewheel.zoomToMouseLocation = value;
        }
    }
    /**
     * Gets or Set the mouse wheel delta percentage or how fast is the camera zooming.
     * It will be used instead of wheelPrecision if different from 0.
     * It defines the percentage of current camera.radius to use as delta when wheel zoom is used.
     */
    get wheelDeltaPercentage() {
        const mousewheel = this.inputs.attached["mousewheel"];
        if (mousewheel) {
            return mousewheel.wheelDeltaPercentage;
        }
        return 0;
    }
    set wheelDeltaPercentage(value) {
        const mousewheel = this.inputs.attached["mousewheel"];
        if (mousewheel) {
            mousewheel.wheelDeltaPercentage = value;
        }
    }
    /**
     * Gets the bouncing behavior of the camera if it has been enabled.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#bouncing-behavior
     */
    get bouncingBehavior() {
        return this._bouncingBehavior;
    }
    /**
     * Defines if the bouncing behavior of the camera is enabled on the camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#bouncing-behavior
     */
    get useBouncingBehavior() {
        return this._bouncingBehavior != null;
    }
    set useBouncingBehavior(value) {
        if (value === this.useBouncingBehavior) {
            return;
        }
        if (value) {
            this._bouncingBehavior = new BouncingBehavior();
            this.addBehavior(this._bouncingBehavior);
        }
        else if (this._bouncingBehavior) {
            this.removeBehavior(this._bouncingBehavior);
            this._bouncingBehavior = null;
        }
    }
    /**
     * Gets the framing behavior of the camera if it has been enabled.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior
     */
    get framingBehavior() {
        return this._framingBehavior;
    }
    /**
     * Defines if the framing behavior of the camera is enabled on the camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior
     */
    get useFramingBehavior() {
        return this._framingBehavior != null;
    }
    set useFramingBehavior(value) {
        if (value === this.useFramingBehavior) {
            return;
        }
        if (value) {
            this._framingBehavior = new FramingBehavior();
            this.addBehavior(this._framingBehavior);
        }
        else if (this._framingBehavior) {
            this.removeBehavior(this._framingBehavior);
            this._framingBehavior = null;
        }
    }
    /**
     * Gets the auto rotation behavior of the camera if it has been enabled.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#autorotation-behavior
     */
    get autoRotationBehavior() {
        return this._autoRotationBehavior;
    }
    /**
     * Defines if the auto rotation behavior of the camera is enabled on the camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#autorotation-behavior
     */
    get useAutoRotationBehavior() {
        return this._autoRotationBehavior != null;
    }
    set useAutoRotationBehavior(value) {
        if (value === this.useAutoRotationBehavior) {
            return;
        }
        if (value) {
            this._autoRotationBehavior = new AutoRotationBehavior();
            this.addBehavior(this._autoRotationBehavior);
        }
        else if (this._autoRotationBehavior) {
            this.removeBehavior(this._autoRotationBehavior);
            this._autoRotationBehavior = null;
        }
    }
    /**
     * Instantiates a new ArcRotateCamera in a given scene
     * @param name Defines the name of the camera
     * @param alpha Defines the camera rotation along the longitudinal axis
     * @param beta Defines the camera rotation along the latitudinal axis
     * @param radius Defines the camera distance from its target
     * @param target Defines the camera target
     * @param scene Defines the scene the camera belongs to
     * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
     */
    constructor(name, alpha, beta, radius, target, scene, setActiveOnSceneIfNoneActive = true) {
        super(name, math_vector/* Vector3 */.Pq.Zero(), scene, setActiveOnSceneIfNoneActive);
        /**
         * Current inertia value on the longitudinal axis.
         * The bigger this number the longer it will take for the camera to stop.
         */
        this.inertialAlphaOffset = 0;
        /**
         * Current inertia value on the latitudinal axis.
         * The bigger this number the longer it will take for the camera to stop.
         */
        this.inertialBetaOffset = 0;
        /**
         * Current inertia value on the radius axis.
         * The bigger this number the longer it will take for the camera to stop.
         */
        this.inertialRadiusOffset = 0;
        /**
         * Minimum allowed angle on the longitudinal axis.
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.lowerAlphaLimit = null;
        /**
         * Maximum allowed angle on the longitudinal axis.
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.upperAlphaLimit = null;
        /**
         * Minimum allowed angle on the latitudinal axis.
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.lowerBetaLimit = 0.01;
        /**
         * Maximum allowed angle on the latitudinal axis.
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.upperBetaLimit = Math.PI - 0.01;
        /**
         * Minimum allowed distance of the camera to the target (The camera can not get closer).
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.lowerRadiusLimit = null;
        /**
         * Maximum allowed distance of the camera to the target (The camera can not get further).
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.upperRadiusLimit = null;
        /**
         * Defines the current inertia value used during panning of the camera along the X axis.
         */
        this.inertialPanningX = 0;
        /**
         * Defines the current inertia value used during panning of the camera along the Y axis.
         */
        this.inertialPanningY = 0;
        /**
         * Defines the distance used to consider the camera in pan mode vs pinch/zoom.
         * Basically if your fingers moves away from more than this distance you will be considered
         * in pinch mode.
         */
        this.pinchToPanMaxDistance = 20;
        /**
         * Defines the maximum distance the camera can pan.
         * This could help keeping the camera always in your scene.
         */
        this.panningDistanceLimit = null;
        /**
         * Defines the target of the camera before panning.
         */
        this.panningOriginTarget = math_vector/* Vector3 */.Pq.Zero();
        /**
         * Defines the value of the inertia used during panning.
         * 0 would mean stop inertia and one would mean no deceleration at all.
         */
        this.panningInertia = 0.9;
        //-- end properties for backward compatibility for inputs
        /**
         * Defines how much the radius should be scaled while zooming on a particular mesh (through the zoomOn function)
         */
        this.zoomOnFactor = 1;
        /**
         * Defines a screen offset for the camera position.
         */
        this.targetScreenOffset = math_vector/* Vector2 */.I9.Zero();
        /**
         * Allows the camera to be completely reversed.
         * If false the camera can not arrive upside down.
         */
        this.allowUpsideDown = true;
        /**
         * Define if double tap/click is used to restore the previously saved state of the camera.
         */
        this.useInputToRestoreState = true;
        /**
         * Factor for restoring information interpolation. default is 0 = off. Any value \< 0 or \> 1 will disable interpolation.
         */
        this.restoreStateInterpolationFactor = 0;
        /** @internal */
        this._viewMatrix = new math_vector/* Matrix */.uq();
        /**
         * Defines the allowed panning axis.
         */
        this.panningAxis = new math_vector/* Vector3 */.Pq(1, 1, 0);
        this._transformedDirection = new math_vector/* Vector3 */.Pq();
        /**
         * Defines if camera will eliminate transform on y axis.
         */
        this.mapPanning = false;
        // restoring state progressively
        this._progressiveRestore = false;
        /**
         * Observable triggered when the transform node target has been changed on the camera.
         */
        this.onMeshTargetChangedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Defines whether the camera should check collision with the objects oh the scene.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#how-can-i-do-this-
         */
        this.checkCollisions = false;
        /**
         * Defines the collision radius of the camera.
         * This simulates a sphere around the camera.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#arcrotatecamera
         */
        this.collisionRadius = new math_vector/* Vector3 */.Pq(0.5, 0.5, 0.5);
        this._previousPosition = math_vector/* Vector3 */.Pq.Zero();
        this._collisionVelocity = math_vector/* Vector3 */.Pq.Zero();
        this._newPosition = math_vector/* Vector3 */.Pq.Zero();
        this._computationVector = math_vector/* Vector3 */.Pq.Zero();
        this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {
            if (!collidedMesh) {
                this._previousPosition.copyFrom(this._position);
            }
            else {
                this.setPosition(newPosition);
                if (this.onCollide) {
                    this.onCollide(collidedMesh);
                }
            }
            // Recompute because of constraints
            const cosa = Math.cos(this.alpha);
            const sina = Math.sin(this.alpha);
            const cosb = Math.cos(this.beta);
            let sinb = Math.sin(this.beta);
            if (sinb === 0) {
                sinb = 0.0001;
            }
            const target = this._getTargetPosition();
            this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb);
            target.addToRef(this._computationVector, this._newPosition);
            this._position.copyFrom(this._newPosition);
            let up = this.upVector;
            if (this.allowUpsideDown && this.beta < 0) {
                up = up.clone();
                up = up.negate();
            }
            this._computeViewMatrix(this._position, target, up);
            this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x);
            this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);
            this._collisionTriggered = false;
        };
        this._target = math_vector/* Vector3 */.Pq.Zero();
        if (target) {
            this.setTarget(target);
        }
        this.alpha = alpha;
        this.beta = beta;
        this.radius = radius;
        this.getViewMatrix();
        this.inputs = new ArcRotateCameraInputsManager(this);
        this.inputs.addKeyboard().addMouseWheel().addPointers();
    }
    // Cache
    /** @internal */
    _initCache() {
        super._initCache();
        this._cache._target = new math_vector/* Vector3 */.Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        this._cache.alpha = undefined;
        this._cache.beta = undefined;
        this._cache.radius = undefined;
        this._cache.targetScreenOffset = math_vector/* Vector2 */.I9.Zero();
    }
    /**
     * @internal
     */
    _updateCache(ignoreParentClass) {
        if (!ignoreParentClass) {
            super._updateCache();
        }
        this._cache._target.copyFrom(this._getTargetPosition());
        this._cache.alpha = this.alpha;
        this._cache.beta = this.beta;
        this._cache.radius = this.radius;
        this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset);
    }
    _getTargetPosition() {
        if (this._targetHost && this._targetHost.getAbsolutePosition) {
            const pos = this._targetHost.getAbsolutePosition();
            if (this._targetBoundingCenter) {
                pos.addToRef(this._targetBoundingCenter, this._target);
            }
            else {
                this._target.copyFrom(pos);
            }
        }
        const lockedTargetPosition = this._getLockedTargetPosition();
        if (lockedTargetPosition) {
            return lockedTargetPosition;
        }
        return this._target;
    }
    /**
     * Stores the current state of the camera (alpha, beta, radius and target)
     * @returns the camera itself
     */
    storeState() {
        this._storedAlpha = this._goalAlpha = this.alpha;
        this._storedBeta = this._goalBeta = this.beta;
        this._storedRadius = this._goalRadius = this.radius;
        this._storedTarget = this._goalTarget = this._getTargetPosition().clone();
        this._storedTargetScreenOffset = this._goalTargetScreenOffset = this.targetScreenOffset.clone();
        return super.storeState();
    }
    /**
     * @internal
     * Restored camera state. You must call storeState() first
     */
    _restoreStateValues() {
        if (this.hasStateStored() && this.restoreStateInterpolationFactor > math_constants/* Epsilon */.bH && this.restoreStateInterpolationFactor < 1) {
            this.interpolateTo(this._storedAlpha, this._storedBeta, this._storedRadius, this._storedTarget, this._storedTargetScreenOffset);
            return true;
        }
        if (!super._restoreStateValues()) {
            return false;
        }
        this.setTarget(this._storedTarget.clone());
        this.alpha = this._storedAlpha;
        this.beta = this._storedBeta;
        this.radius = this._storedRadius;
        this.targetScreenOffset = this._storedTargetScreenOffset.clone();
        this.inertialAlphaOffset = 0;
        this.inertialBetaOffset = 0;
        this.inertialRadiusOffset = 0;
        this.inertialPanningX = 0;
        this.inertialPanningY = 0;
        return true;
    }
    /**
     * Interpolates the camera to a goal state.
     * @param alpha Defines the goal alpha.
     * @param beta Defines the goal beta.
     * @param radius Defines the goal radius.
     * @param target Defines the goal target.
     * @param targetScreenOffset Defines the goal target screen offset.
     */
    interpolateTo(alpha = this.alpha, beta = this.beta, radius = this.radius, target = this.target, targetScreenOffset = this.targetScreenOffset) {
        this._progressiveRestore = true;
        this.inertialAlphaOffset = 0;
        this.inertialBetaOffset = 0;
        this.inertialRadiusOffset = 0;
        this.inertialPanningX = 0;
        this.inertialPanningY = 0;
        alpha = (0,math_scalar_functions.Clamp)(alpha, this.lowerAlphaLimit ?? -Infinity, this.upperAlphaLimit ?? Infinity);
        beta = (0,math_scalar_functions.Clamp)(beta, this.lowerBetaLimit ?? -Infinity, this.upperBetaLimit ?? Infinity);
        radius = (0,math_scalar_functions.Clamp)(radius, this.lowerRadiusLimit ?? -Infinity, this.upperRadiusLimit ?? Infinity);
        this._goalAlpha = alpha;
        this._goalBeta = beta;
        this._goalRadius = radius;
        this._goalTarget = target;
        this._goalTargetScreenOffset = targetScreenOffset;
    }
    // Synchronized
    /** @internal */
    _isSynchronizedViewMatrix() {
        if (!super._isSynchronizedViewMatrix()) {
            return false;
        }
        return (this._cache._target.equals(this._getTargetPosition()) &&
            this._cache.alpha === this.alpha &&
            this._cache.beta === this.beta &&
            this._cache.radius === this.radius &&
            this._cache.targetScreenOffset.equals(this.targetScreenOffset));
    }
    /**
     * Attached controls to the current camera.
     * @param ignored defines an ignored parameter kept for backward compatibility.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     * @param useCtrlForPanning  Defines whether ctrl is used for panning within the controls
     * @param panningMouseButton Defines whether panning is allowed through mouse click button
     */
    attachControl(ignored, noPreventDefault, useCtrlForPanning = true, panningMouseButton = 2) {
        // eslint-disable-next-line prefer-rest-params
        const args = arguments;
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(args);
        this._useCtrlForPanning = useCtrlForPanning;
        this._panningMouseButton = panningMouseButton;
        // backwards compatibility
        if (typeof args[0] === "boolean") {
            if (args.length > 1) {
                this._useCtrlForPanning = args[1];
            }
            if (args.length > 2) {
                this._panningMouseButton = args[2];
            }
        }
        this.inputs.attachElement(noPreventDefault);
        this._reset = () => {
            this.inertialAlphaOffset = 0;
            this.inertialBetaOffset = 0;
            this.inertialRadiusOffset = 0;
            this.inertialPanningX = 0;
            this.inertialPanningY = 0;
        };
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        this.inputs.detachElement();
        if (this._reset) {
            this._reset();
        }
    }
    /** @internal */
    _checkInputs() {
        //if (async) collision inspection was triggered, don't update the camera's position - until the collision callback was called.
        if (this._collisionTriggered) {
            return;
        }
        this.inputs.checkInputs();
        // progressive restore
        if (this._progressiveRestore) {
            const dt = this._scene.getEngine().getDeltaTime() / 1000;
            const t = 1 - Math.pow(2, -dt / this.restoreStateInterpolationFactor);
            // can't use tmp vector here because of assignment
            this.setTarget(math_vector/* Vector3 */.Pq.Lerp(this.getTarget(), this._goalTarget, t));
            // Using quaternion for smoother interpolation (and no Euler angles modulo)
            math_vector/* Quaternion */.PT.RotationAlphaBetaGammaToRef(this._goalAlpha, this._goalBeta, 0, math_vector/* TmpVectors */.AA.Quaternion[0]);
            math_vector/* Quaternion */.PT.RotationAlphaBetaGammaToRef(this.alpha, this.beta, 0, math_vector/* TmpVectors */.AA.Quaternion[1]);
            math_vector/* Quaternion */.PT.SlerpToRef(math_vector/* TmpVectors */.AA.Quaternion[1], math_vector/* TmpVectors */.AA.Quaternion[0], t, math_vector/* TmpVectors */.AA.Quaternion[2]);
            math_vector/* TmpVectors */.AA.Quaternion[2].normalize();
            math_vector/* TmpVectors */.AA.Quaternion[2].toAlphaBetaGammaToRef(math_vector/* TmpVectors */.AA.Vector3[0]);
            this.alpha = math_vector/* TmpVectors */.AA.Vector3[0].x;
            this.beta = math_vector/* TmpVectors */.AA.Vector3[0].y;
            this.radius += (this._goalRadius - this.radius) * t;
            math_vector/* Vector2 */.I9.LerpToRef(this.targetScreenOffset, this._goalTargetScreenOffset, t, this.targetScreenOffset);
            // stop restoring when within close range or when user starts interacting
            if ((math_vector/* Vector3 */.Pq.DistanceSquared(this.getTarget(), this._goalTarget) < math_constants/* Epsilon */.bH &&
                math_vector/* TmpVectors */.AA.Quaternion[2].equalsWithEpsilon(math_vector/* TmpVectors */.AA.Quaternion[0]) &&
                Math.pow(this._goalRadius - this.radius, 2) < math_constants/* Epsilon */.bH &&
                math_vector/* Vector2 */.I9.Distance(this.targetScreenOffset, this._goalTargetScreenOffset) < math_constants/* Epsilon */.bH) ||
                this.inertialAlphaOffset !== 0 ||
                this.inertialBetaOffset !== 0 ||
                this.inertialRadiusOffset !== 0 ||
                this.inertialPanningX !== 0 ||
                this.inertialPanningY !== 0) {
                this._progressiveRestore = false;
            }
        }
        // Inertia
        if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) {
            const directionModifier = this.invertRotation ? -1 : 1;
            const handednessMultiplier = this._calculateHandednessMultiplier();
            let inertialAlphaOffset = this.inertialAlphaOffset * handednessMultiplier;
            if (this.beta < 0) {
                inertialAlphaOffset *= -1;
            }
            this.alpha += inertialAlphaOffset * directionModifier;
            this.beta += this.inertialBetaOffset * directionModifier;
            this.radius -= this.inertialRadiusOffset;
            this.inertialAlphaOffset *= this.inertia;
            this.inertialBetaOffset *= this.inertia;
            this.inertialRadiusOffset *= this.inertia;
            if (Math.abs(this.inertialAlphaOffset) < math_constants/* Epsilon */.bH) {
                this.inertialAlphaOffset = 0;
            }
            if (Math.abs(this.inertialBetaOffset) < math_constants/* Epsilon */.bH) {
                this.inertialBetaOffset = 0;
            }
            if (Math.abs(this.inertialRadiusOffset) < this.speed * math_constants/* Epsilon */.bH) {
                this.inertialRadiusOffset = 0;
            }
        }
        // Panning inertia
        if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) {
            const localDirection = new math_vector/* Vector3 */.Pq(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY);
            this._viewMatrix.invertToRef(this._cameraTransformMatrix);
            localDirection.multiplyInPlace(this.panningAxis);
            math_vector/* Vector3 */.Pq.TransformNormalToRef(localDirection, this._cameraTransformMatrix, this._transformedDirection);
            // If mapPanning is enabled, we need to take the upVector into account and
            // make sure we're not panning in the y direction
            if (this.mapPanning) {
                const up = this.upVector;
                const right = math_vector/* Vector3 */.Pq.CrossToRef(this._transformedDirection, up, this._transformedDirection);
                math_vector/* Vector3 */.Pq.CrossToRef(up, right, this._transformedDirection);
            }
            else if (!this.panningAxis.y) {
                this._transformedDirection.y = 0;
            }
            if (!this._targetHost) {
                if (this.panningDistanceLimit) {
                    this._transformedDirection.addInPlace(this._target);
                    const distanceSquared = math_vector/* Vector3 */.Pq.DistanceSquared(this._transformedDirection, this.panningOriginTarget);
                    if (distanceSquared <= this.panningDistanceLimit * this.panningDistanceLimit) {
                        this._target.copyFrom(this._transformedDirection);
                    }
                }
                else {
                    if (this.parent) {
                        const m = math_vector/* TmpVectors */.AA.Matrix[0];
                        this.parent.getWorldMatrix().getRotationMatrixToRef(m);
                        m.transposeToRef(m);
                        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._transformedDirection, m, this._transformedDirection);
                    }
                    this._target.addInPlace(this._transformedDirection);
                }
            }
            this.inertialPanningX *= this.panningInertia;
            this.inertialPanningY *= this.panningInertia;
            if (Math.abs(this.inertialPanningX) < this.speed * math_constants/* Epsilon */.bH) {
                this.inertialPanningX = 0;
            }
            if (Math.abs(this.inertialPanningY) < this.speed * math_constants/* Epsilon */.bH) {
                this.inertialPanningY = 0;
            }
        }
        // Limits
        this._checkLimits();
        super._checkInputs();
    }
    _checkLimits() {
        if (this.lowerBetaLimit === null || this.lowerBetaLimit === undefined) {
            if (this.allowUpsideDown && this.beta > Math.PI) {
                this.beta = this.beta - 2 * Math.PI;
            }
        }
        else {
            if (this.beta < this.lowerBetaLimit) {
                this.beta = this.lowerBetaLimit;
            }
        }
        if (this.upperBetaLimit === null || this.upperBetaLimit === undefined) {
            if (this.allowUpsideDown && this.beta < -Math.PI) {
                this.beta = this.beta + 2 * Math.PI;
            }
        }
        else {
            if (this.beta > this.upperBetaLimit) {
                this.beta = this.upperBetaLimit;
            }
        }
        if (this.lowerAlphaLimit !== null && this.alpha < this.lowerAlphaLimit) {
            this.alpha = this.lowerAlphaLimit;
        }
        if (this.upperAlphaLimit !== null && this.alpha > this.upperAlphaLimit) {
            this.alpha = this.upperAlphaLimit;
        }
        if (this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit) {
            this.radius = this.lowerRadiusLimit;
            this.inertialRadiusOffset = 0;
        }
        if (this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit) {
            this.radius = this.upperRadiusLimit;
            this.inertialRadiusOffset = 0;
        }
    }
    /**
     * Rebuilds angles (alpha, beta) and radius from the give position and target
     */
    rebuildAnglesAndRadius() {
        this._position.subtractToRef(this._getTargetPosition(), this._computationVector);
        // need to rotate to Y up equivalent if up vector not Axis.Y
        if (this._upVector.x !== 0 || this._upVector.y !== 1.0 || this._upVector.z !== 0) {
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._computationVector, this._upToYMatrix, this._computationVector);
        }
        this.radius = this._computationVector.length();
        if (this.radius === 0) {
            this.radius = 0.0001; // Just to avoid division by zero
        }
        // Alpha
        const previousAlpha = this.alpha;
        if (this._computationVector.x === 0 && this._computationVector.z === 0) {
            this.alpha = Math.PI / 2; // avoid division by zero when looking along up axis, and set to acos(0)
        }
        else {
            this.alpha = Math.acos(this._computationVector.x / Math.sqrt(Math.pow(this._computationVector.x, 2) + Math.pow(this._computationVector.z, 2)));
        }
        if (this._computationVector.z < 0) {
            this.alpha = 2 * Math.PI - this.alpha;
        }
        // Calculate the number of revolutions between the new and old alpha values.
        const alphaCorrectionTurns = Math.round((previousAlpha - this.alpha) / (2.0 * Math.PI));
        // Adjust alpha so that its numerical representation is the closest one to the old value.
        this.alpha += alphaCorrectionTurns * 2.0 * Math.PI;
        // Beta
        this.beta = Math.acos(this._computationVector.y / this.radius);
        this._checkLimits();
    }
    /**
     * Use a position to define the current camera related information like alpha, beta and radius
     * @param position Defines the position to set the camera at
     */
    setPosition(position) {
        if (this._position.equals(position)) {
            return;
        }
        this._position.copyFrom(position);
        this.rebuildAnglesAndRadius();
    }
    /**
     * Defines the target the camera should look at.
     * This will automatically adapt alpha beta and radius to fit within the new target.
     * Please note that setting a target as a mesh will disable panning.
     * @param target Defines the new target as a Vector or a transform node
     * @param toBoundingCenter In case of a mesh target, defines whether to target the mesh position or its bounding information center
     * @param allowSamePosition If false, prevents reapplying the new computed position if it is identical to the current one (optim)
     * @param cloneAlphaBetaRadius If true, replicate the current setup (alpha, beta, radius) on the new target
     */
    setTarget(target, toBoundingCenter = false, allowSamePosition = false, cloneAlphaBetaRadius = false) {
        cloneAlphaBetaRadius = this.overrideCloneAlphaBetaRadius ?? cloneAlphaBetaRadius;
        if (target.computeWorldMatrix) {
            if (toBoundingCenter && target.getBoundingInfo) {
                this._targetBoundingCenter = target.getBoundingInfo().boundingBox.centerWorld.clone();
            }
            else {
                this._targetBoundingCenter = null;
            }
            target.computeWorldMatrix();
            this._targetHost = target;
            this._target = this._getTargetPosition();
            this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);
        }
        else {
            const newTarget = target;
            const currentTarget = this._getTargetPosition();
            if (currentTarget && !allowSamePosition && currentTarget.equals(newTarget)) {
                return;
            }
            this._targetHost = null;
            this._target = newTarget;
            this._targetBoundingCenter = null;
            this.onMeshTargetChangedObservable.notifyObservers(null);
        }
        if (!cloneAlphaBetaRadius) {
            this.rebuildAnglesAndRadius();
        }
    }
    /** @internal */
    _getViewMatrix() {
        // Compute
        const cosa = Math.cos(this.alpha);
        const sina = Math.sin(this.alpha);
        const cosb = Math.cos(this.beta);
        let sinb = Math.sin(this.beta);
        if (sinb === 0) {
            sinb = 0.0001;
        }
        if (this.radius === 0) {
            this.radius = 0.0001; // Just to avoid division by zero
        }
        const target = this._getTargetPosition();
        this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb);
        // Rotate according to up vector
        if (this._upVector.x !== 0 || this._upVector.y !== 1.0 || this._upVector.z !== 0) {
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._computationVector, this._yToUpMatrix, this._computationVector);
        }
        target.addToRef(this._computationVector, this._newPosition);
        if (this.getScene().collisionsEnabled && this.checkCollisions) {
            const coordinator = this.getScene().collisionCoordinator;
            if (!this._collider) {
                this._collider = coordinator.createCollider();
            }
            this._collider._radius = this.collisionRadius;
            this._newPosition.subtractToRef(this._position, this._collisionVelocity);
            this._collisionTriggered = true;
            coordinator.getNewPosition(this._position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
        }
        else {
            this._position.copyFrom(this._newPosition);
            let up = this.upVector;
            if (this.allowUpsideDown && sinb < 0) {
                up = up.negate();
            }
            this._computeViewMatrix(this._position, target, up);
            this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x);
            this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);
        }
        this._currentTarget = target;
        return this._viewMatrix;
    }
    /**
     * Zooms on a mesh to be at the min distance where we could see it fully in the current viewport.
     * @param meshes Defines the mesh to zoom on
     * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
     */
    zoomOn(meshes, doNotUpdateMaxZ = false) {
        meshes = meshes || this.getScene().meshes;
        const minMaxVector = Meshes_mesh/* Mesh */.e.MinMax(meshes);
        let distance = this._calculateLowerRadiusFromModelBoundingSphere(minMaxVector.min, minMaxVector.max);
        // If there are defined limits, we need to take them into account
        distance = Math.max(Math.min(distance, this.upperRadiusLimit || Number.MAX_VALUE), this.lowerRadiusLimit || 0);
        this.radius = distance * this.zoomOnFactor;
        this.focusOn({ min: minMaxVector.min, max: minMaxVector.max, distance: distance }, doNotUpdateMaxZ);
    }
    /**
     * Focus on a mesh or a bounding box. This adapts the target and maxRadius if necessary but does not update the current radius.
     * The target will be changed but the radius
     * @param meshesOrMinMaxVectorAndDistance Defines the mesh or bounding info to focus on
     * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
     */
    focusOn(meshesOrMinMaxVectorAndDistance, doNotUpdateMaxZ = false) {
        let meshesOrMinMaxVector;
        let distance;
        if (meshesOrMinMaxVectorAndDistance.min === undefined) {
            // meshes
            const meshes = meshesOrMinMaxVectorAndDistance || this.getScene().meshes;
            meshesOrMinMaxVector = Meshes_mesh/* Mesh */.e.MinMax(meshes);
            distance = math_vector/* Vector3 */.Pq.Distance(meshesOrMinMaxVector.min, meshesOrMinMaxVector.max);
        }
        else {
            //minMaxVector and distance
            const minMaxVectorAndDistance = meshesOrMinMaxVectorAndDistance;
            meshesOrMinMaxVector = minMaxVectorAndDistance;
            distance = minMaxVectorAndDistance.distance;
        }
        this._target = Meshes_mesh/* Mesh */.e.Center(meshesOrMinMaxVector);
        if (!doNotUpdateMaxZ) {
            this.maxZ = distance * 2;
        }
    }
    /**
     * @override
     * Override Camera.createRigCamera
     * @param name the name of the camera
     * @param cameraIndex the index of the camera in the rig cameras array
     */
    createRigCamera(name, cameraIndex) {
        let alphaShift = 0;
        switch (this.cameraRigMode) {
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_OVERUNDER:
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_INTERLACED:
            case Cameras_camera/* Camera */.i.RIG_MODE_VR:
                alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? 1 : -1);
                break;
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
                alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? -1 : 1);
                break;
        }
        const rigCam = new ArcRotateCamera(name, this.alpha + alphaShift, this.beta, this.radius, this._target, this.getScene());
        rigCam._cameraRigParams = {};
        rigCam.isRigCamera = true;
        rigCam.rigParent = this;
        rigCam.upVector = this.upVector;
        rigCam.mode = this.mode;
        rigCam.orthoLeft = this.orthoLeft;
        rigCam.orthoRight = this.orthoRight;
        rigCam.orthoBottom = this.orthoBottom;
        rigCam.orthoTop = this.orthoTop;
        return rigCam;
    }
    /**
     * @internal
     * @override
     * Override Camera._updateRigCameras
     */
    _updateRigCameras() {
        const camLeft = this._rigCameras[0];
        const camRight = this._rigCameras[1];
        camLeft.beta = camRight.beta = this.beta;
        switch (this.cameraRigMode) {
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_OVERUNDER:
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_INTERLACED:
            case Cameras_camera/* Camera */.i.RIG_MODE_VR:
                camLeft.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;
                camRight.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;
                break;
            case Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
                camLeft.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;
                camRight.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;
                break;
        }
        super._updateRigCameras();
    }
    /**
     * @internal
     */
    _calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld, radiusScale = 1) {
        const boxVectorGlobalDiagonal = math_vector/* Vector3 */.Pq.Distance(minimumWorld, maximumWorld);
        // Get aspect ratio in order to calculate frustum slope
        const engine = this.getScene().getEngine();
        const aspectRatio = engine.getAspectRatio(this);
        const frustumSlopeY = Math.tan(this.fov / 2);
        const frustumSlopeX = frustumSlopeY * aspectRatio;
        // Formula for setting distance
        // (Good explanation: http://stackoverflow.com/questions/2866350/move-camera-to-fit-3d-scene)
        const radiusWithoutFraming = boxVectorGlobalDiagonal * 0.5;
        // Horizon distance
        const radius = radiusWithoutFraming * radiusScale;
        const distanceForHorizontalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlopeX * frustumSlopeX));
        const distanceForVerticalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlopeY * frustumSlopeY));
        return Math.max(distanceForHorizontalFrustum, distanceForVerticalFrustum);
    }
    /**
     * Destroy the camera and release the current resources hold by it.
     */
    dispose() {
        this.inputs.clear();
        super.dispose();
    }
    /**
     * Gets the current object class name.
     * @returns the class name
     */
    getClassName() {
        return "ArcRotateCamera";
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "alpha", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "beta", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "radius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "overrideCloneAlphaBetaRadius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsVector3 */.P_)("target")
], ArcRotateCamera.prototype, "_target", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsMeshReference */.xG)("targetHost")
], ArcRotateCamera.prototype, "_targetHost", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "inertialAlphaOffset", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "inertialBetaOffset", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "inertialRadiusOffset", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "lowerAlphaLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "upperAlphaLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "lowerBetaLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "upperBetaLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "lowerRadiusLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "upperRadiusLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "inertialPanningX", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "inertialPanningY", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "pinchToPanMaxDistance", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "panningDistanceLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsVector3 */.P_)()
], ArcRotateCamera.prototype, "panningOriginTarget", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "panningInertia", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "zoomToMouseLocation", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "zoomOnFactor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsVector2 */.WM)()
], ArcRotateCamera.prototype, "targetScreenOffset", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "allowUpsideDown", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "useInputToRestoreState", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ArcRotateCamera.prototype, "restoreStateInterpolationFactor", void 0);
// Register Class Name
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ArcRotateCamera", ArcRotateCamera);
//# sourceMappingURL=arcRotateCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/deviceOrientationCamera.js





node/* Node */.b.AddNodeConstructor("DeviceOrientationCamera", (name, scene) => {
    return () => new DeviceOrientationCamera(name, math_vector/* Vector3 */.Pq.Zero(), scene);
});
// We're mainly based on the logic defined into the FreeCamera code
/**
 * This is a camera specifically designed to react to device orientation events such as a modern mobile device
 * being tilted forward or back and left or right.
 */
class DeviceOrientationCamera extends Cameras_freeCamera/* FreeCamera */.S {
    /**
     * Creates a new device orientation camera
     * @param name The name of the camera
     * @param position The start position camera
     * @param scene The scene the camera belongs to
     */
    constructor(name, position, scene) {
        super(name, position, scene);
        this._tmpDragQuaternion = new math_vector/* Quaternion */.PT();
        this._disablePointerInputWhenUsingDeviceOrientation = true;
        this._dragFactor = 0;
        this._quaternionCache = new math_vector/* Quaternion */.PT();
        this.inputs.addDeviceOrientation();
        // When the orientation sensor fires it's first event, disable mouse input
        if (this.inputs._deviceOrientationInput) {
            this.inputs._deviceOrientationInput._onDeviceOrientationChangedObservable.addOnce(() => {
                if (this._disablePointerInputWhenUsingDeviceOrientation) {
                    if (this.inputs._mouseInput) {
                        this.inputs._mouseInput._allowCameraRotation = false;
                        this.inputs._mouseInput.onPointerMovedObservable.add((e) => {
                            if (this._dragFactor != 0) {
                                if (!this._initialQuaternion) {
                                    this._initialQuaternion = new math_vector/* Quaternion */.PT();
                                }
                                // Rotate the initial space around the y axis to allow users to "turn around" via touch/mouse
                                math_vector/* Quaternion */.PT.FromEulerAnglesToRef(0, e.offsetX * this._dragFactor, 0, this._tmpDragQuaternion);
                                this._initialQuaternion.multiplyToRef(this._tmpDragQuaternion, this._initialQuaternion);
                            }
                        });
                    }
                }
            });
        }
    }
    /**
     * Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
     */
    get disablePointerInputWhenUsingDeviceOrientation() {
        return this._disablePointerInputWhenUsingDeviceOrientation;
    }
    set disablePointerInputWhenUsingDeviceOrientation(value) {
        this._disablePointerInputWhenUsingDeviceOrientation = value;
    }
    /**
     * Enabled turning on the y axis when the orientation sensor is active
     * @param dragFactor the factor that controls the turn speed (default: 1/300)
     */
    enableHorizontalDragging(dragFactor = 1 / 300) {
        this._dragFactor = dragFactor;
    }
    /**
     * Gets the current instance class name ("DeviceOrientationCamera").
     * This helps avoiding instanceof at run time.
     * @returns the class name
     */
    getClassName() {
        return "DeviceOrientationCamera";
    }
    /**
     * @internal
     * Checks and applies the current values of the inputs to the camera. (Internal use only)
     */
    _checkInputs() {
        super._checkInputs();
        this._quaternionCache.copyFrom(this.rotationQuaternion);
        if (this._initialQuaternion) {
            this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);
        }
    }
    /**
     * Reset the camera to its default orientation on the specified axis only.
     * @param axis The axis to reset
     */
    resetToCurrentRotation(axis = math_axis/* Axis */._0.Y) {
        //can only work if this camera has a rotation quaternion already.
        if (!this.rotationQuaternion) {
            return;
        }
        if (!this._initialQuaternion) {
            this._initialQuaternion = new math_vector/* Quaternion */.PT();
        }
        this._initialQuaternion.copyFrom(this._quaternionCache || this.rotationQuaternion);
        ["x", "y", "z"].forEach((axisName) => {
            if (!axis[axisName]) {
                this._initialQuaternion[axisName] = 0;
            }
            else {
                this._initialQuaternion[axisName] *= -1;
            }
        });
        this._initialQuaternion.normalize();
        //force rotation update
        this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);
    }
}
//# sourceMappingURL=deviceOrientationCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/flyCameraInputsManager.js



/**
 * Default Inputs manager for the FlyCamera.
 * It groups all the default supported inputs for ease of use.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FlyCameraInputsManager extends cameraInputsManager/* CameraInputsManager */._ {
    /**
     * Instantiates a new FlyCameraInputsManager.
     * @param camera Defines the camera the inputs belong to.
     */
    constructor(camera) {
        super(camera);
    }
    /**
     * Add keyboard input support to the input manager.
     * @returns the new FlyCameraKeyboardMoveInput().
     */
    addKeyboard() {
        this.add(new FlyCameraKeyboardInput());
        return this;
    }
    /**
     * Add mouse input support to the input manager.
     * @returns the new FlyCameraMouseInput().
     */
    addMouse() {
        this.add(new FlyCameraMouseInput());
        return this;
    }
}
//# sourceMappingURL=flyCameraInputsManager.js.map
;// ./node_modules/@babylonjs/core/Cameras/flyCamera.js








/**
 * This is a flying camera, designed for 3D movement and rotation in all directions,
 * such as in a 3D Space Shooter or a Flight Simulator.
 */
class FlyCamera extends targetCamera/* TargetCamera */.F {
    /**
     * Gets the input sensibility for mouse input.
     * Higher values reduce sensitivity.
     */
    get angularSensibility() {
        const mouse = this.inputs.attached["mouse"];
        if (mouse) {
            return mouse.angularSensibility;
        }
        return 0;
    }
    /**
     * Sets the input sensibility for a mouse input.
     * Higher values reduce sensitivity.
     */
    set angularSensibility(value) {
        const mouse = this.inputs.attached["mouse"];
        if (mouse) {
            mouse.angularSensibility = value;
        }
    }
    /**
     * Get the keys for camera movement forward.
     */
    get keysForward() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysForward;
        }
        return [];
    }
    /**
     * Set the keys for camera movement forward.
     */
    set keysForward(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysForward = value;
        }
    }
    /**
     * Get the keys for camera movement backward.
     */
    get keysBackward() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysBackward;
        }
        return [];
    }
    set keysBackward(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysBackward = value;
        }
    }
    /**
     * Get the keys for camera movement up.
     */
    get keysUp() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysUp;
        }
        return [];
    }
    /**
     * Set the keys for camera movement up.
     */
    set keysUp(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysUp = value;
        }
    }
    /**
     * Get the keys for camera movement down.
     */
    get keysDown() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysDown;
        }
        return [];
    }
    /**
     * Set the keys for camera movement down.
     */
    set keysDown(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysDown = value;
        }
    }
    /**
     * Get the keys for camera movement left.
     */
    get keysLeft() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysLeft;
        }
        return [];
    }
    /**
     * Set the keys for camera movement left.
     */
    set keysLeft(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysLeft = value;
        }
    }
    /**
     * Set the keys for camera movement right.
     */
    get keysRight() {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            return keyboard.keysRight;
        }
        return [];
    }
    /**
     * Set the keys for camera movement right.
     */
    set keysRight(value) {
        const keyboard = this.inputs.attached["keyboard"];
        if (keyboard) {
            keyboard.keysRight = value;
        }
    }
    /**
     * Instantiates a FlyCamera.
     * This is a flying camera, designed for 3D movement and rotation in all directions,
     * such as in a 3D Space Shooter or a Flight Simulator.
     * @param name Define the name of the camera in the scene.
     * @param position Define the starting position of the camera in the scene.
     * @param scene Define the scene the camera belongs to.
     * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active, if no other camera has been defined as active.
     */
    constructor(name, position, scene, setActiveOnSceneIfNoneActive = true) {
        super(name, position, scene, setActiveOnSceneIfNoneActive);
        /**
         * Define the collision ellipsoid of the camera.
         * This is helpful for simulating a camera body, like a player's body.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#arcrotatecamera
         */
        this.ellipsoid = new math_vector/* Vector3 */.Pq(1, 1, 1);
        /**
         * Define an offset for the position of the ellipsoid around the camera.
         * This can be helpful if the camera is attached away from the player's body center,
         * such as at its head.
         */
        this.ellipsoidOffset = new math_vector/* Vector3 */.Pq(0, 0, 0);
        /**
         * Enable or disable collisions of the camera with the rest of the scene objects.
         */
        this.checkCollisions = false;
        /**
         * Enable or disable gravity on the camera.
         */
        this.applyGravity = false;
        /**
         * Define the current direction the camera is moving to.
         */
        this.cameraDirection = math_vector/* Vector3 */.Pq.Zero();
        /**
         * Track Roll to maintain the wanted Rolling when looking around.
         */
        this._trackRoll = 0;
        /**
         * Slowly correct the Roll to its original value after a Pitch+Yaw rotation.
         */
        this.rollCorrect = 100;
        /**
         * Mimic a banked turn, Rolling the camera when Yawing.
         * It's recommended to use rollCorrect = 10 for faster banking correction.
         */
        this.bankedTurn = false;
        /**
         * Limit in radians for how much Roll banking will add. (Default: 90°)
         */
        this.bankedTurnLimit = Math.PI / 2;
        /**
         * Value of 0 disables the banked Roll.
         * Value of 1 is equal to the Yaw angle in radians.
         */
        this.bankedTurnMultiplier = 1;
        this._needMoveForGravity = false;
        this._oldPosition = math_vector/* Vector3 */.Pq.Zero();
        this._diffPosition = math_vector/* Vector3 */.Pq.Zero();
        this._newPosition = math_vector/* Vector3 */.Pq.Zero();
        // Collisions.
        this._collisionMask = -1;
        /**
         * @internal
         */
        this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {
            const updatePosition = (newPos) => {
                this._newPosition.copyFrom(newPos);
                this._newPosition.subtractToRef(this._oldPosition, this._diffPosition);
                if (this._diffPosition.length() > abstractEngine/* AbstractEngine */.$.CollisionsEpsilon) {
                    this.position.addInPlace(this._diffPosition);
                    if (this.onCollide && collidedMesh) {
                        this.onCollide(collidedMesh);
                    }
                }
            };
            updatePosition(newPosition);
        };
        this.inputs = new FlyCameraInputsManager(this);
        this.inputs.addKeyboard().addMouse();
    }
    /**
     * Attached controls to the current camera.
     * @param ignored defines an ignored parameter kept for backward compatibility.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(ignored, noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        this.inputs.attachElement(noPreventDefault);
    }
    /**
     * Detach a control from the HTML DOM element.
     * The camera will stop reacting to that input.
     */
    detachControl() {
        this.inputs.detachElement();
        this.cameraDirection = new math_vector/* Vector3 */.Pq(0, 0, 0);
    }
    /**
     * Get the mask that the camera ignores in collision events.
     */
    get collisionMask() {
        return this._collisionMask;
    }
    /**
     * Set the mask that the camera ignores in collision events.
     */
    set collisionMask(mask) {
        this._collisionMask = !isNaN(mask) ? mask : -1;
    }
    /**
     * @internal
     */
    _collideWithWorld(displacement) {
        let globalPosition;
        if (this.parent) {
            globalPosition = math_vector/* Vector3 */.Pq.TransformCoordinates(this.position, this.parent.getWorldMatrix());
        }
        else {
            globalPosition = this.position;
        }
        globalPosition.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition);
        this._oldPosition.addInPlace(this.ellipsoidOffset);
        const coordinator = this.getScene().collisionCoordinator;
        if (!this._collider) {
            this._collider = coordinator.createCollider();
        }
        this._collider._radius = this.ellipsoid;
        this._collider.collisionMask = this._collisionMask;
        // No need for clone, as long as gravity is not on.
        let actualDisplacement = displacement;
        // Add gravity to direction to prevent dual-collision checking.
        if (this.applyGravity) {
            // This prevents mending with cameraDirection, a global variable of the fly camera class.
            actualDisplacement = displacement.add(this.getScene().gravity);
        }
        coordinator.getNewPosition(this._oldPosition, actualDisplacement, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
    }
    /** @internal */
    _checkInputs() {
        if (!this._localDirection) {
            this._localDirection = math_vector/* Vector3 */.Pq.Zero();
            this._transformedDirection = math_vector/* Vector3 */.Pq.Zero();
        }
        this.inputs.checkInputs();
        super._checkInputs();
    }
    /**
     * Enable movement without a user input. This allows gravity to always be applied.
     */
    set needMoveForGravity(value) {
        this._needMoveForGravity = value;
    }
    /**
     * When true, gravity is applied whether there is user input or not.
     */
    get needMoveForGravity() {
        return this._needMoveForGravity;
    }
    /** @internal */
    _decideIfNeedsToMove() {
        return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;
    }
    /** @internal */
    _updatePosition() {
        if (this.checkCollisions && this.getScene().collisionsEnabled) {
            this._collideWithWorld(this.cameraDirection);
        }
        else {
            super._updatePosition();
        }
    }
    /**
     * Restore the Roll to its target value at the rate specified.
     * @param rate - Higher means slower restoring.
     * @internal
     */
    restoreRoll(rate) {
        const limit = this._trackRoll; // Target Roll.
        const z = this.rotation.z; // Current Roll.
        const delta = limit - z; // Difference in Roll.
        const minRad = 0.001; // Tenth of a radian is a barely noticable difference.
        // If the difference is noticable, restore the Roll.
        if (Math.abs(delta) >= minRad) {
            // Change Z rotation towards the target Roll.
            this.rotation.z += delta / rate;
            // Match when near enough.
            if (Math.abs(limit - this.rotation.z) <= minRad) {
                this.rotation.z = limit;
            }
        }
    }
    /**
     * Destroy the camera and release the current resources held by it.
     */
    dispose() {
        this.inputs.clear();
        super.dispose();
    }
    /**
     * Get the current object class name.
     * @returns the class name.
     */
    getClassName() {
        return "FlyCamera";
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsVector3 */.P_)()
], FlyCamera.prototype, "ellipsoid", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsVector3 */.P_)()
], FlyCamera.prototype, "ellipsoidOffset", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCamera.prototype, "checkCollisions", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FlyCamera.prototype, "applyGravity", void 0);
// Register Class Name
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FlyCamera", FlyCamera);
//# sourceMappingURL=flyCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/followCameraInputsManager.js





/**
 * Default Inputs manager for the FollowCamera.
 * It groups all the default supported inputs for ease of use.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs
 */
class FollowCameraInputsManager extends cameraInputsManager/* CameraInputsManager */._ {
    /**
     * Instantiates a new FollowCameraInputsManager.
     * @param camera Defines the camera the inputs belong to
     */
    constructor(camera) {
        super(camera);
    }
    /**
     * Add keyboard input support to the input manager.
     * @returns the current input manager
     */
    addKeyboard() {
        this.add(new FollowCameraKeyboardMoveInput());
        return this;
    }
    /**
     * Add mouse wheel input support to the input manager.
     * @returns the current input manager
     */
    addMouseWheel() {
        this.add(new FollowCameraMouseWheelInput());
        return this;
    }
    /**
     * Add pointers input support to the input manager.
     * @returns the current input manager
     */
    addPointers() {
        this.add(new FollowCameraPointersInput());
        return this;
    }
    /**
     * Add orientation input support to the input manager.
     * @returns the current input manager
     */
    addVRDeviceOrientation() {
        logger/* Logger */.V.Warn("DeviceOrientation support not yet implemented for FollowCamera.");
        return this;
    }
}
//# sourceMappingURL=followCameraInputsManager.js.map
;// ./node_modules/@babylonjs/core/Cameras/followCamera.js








node/* Node */.b.AddNodeConstructor("FollowCamera", (name, scene) => {
    return () => new FollowCamera(name, math_vector/* Vector3 */.Pq.Zero(), scene);
});
node/* Node */.b.AddNodeConstructor("ArcFollowCamera", (name, scene) => {
    return () => new ArcFollowCamera(name, 0, 0, 1.0, null, scene);
});
/**
 * A follow camera takes a mesh as a target and follows it as it moves. Both a free camera version followCamera and
 * an arc rotate version arcFollowCamera are available.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#followcamera
 */
class FollowCamera extends targetCamera/* TargetCamera */.F {
    /**
     * Instantiates the follow camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#followcamera
     * @param name Define the name of the camera in the scene
     * @param position Define the position of the camera
     * @param scene Define the scene the camera belong to
     * @param lockedTarget Define the target of the camera
     */
    constructor(name, position, scene, lockedTarget = null) {
        super(name, position, scene);
        /**
         * Distance the follow camera should follow an object at
         */
        this.radius = 12;
        /**
         * Minimum allowed distance of the camera to the axis of rotation
         * (The camera can not get closer).
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.lowerRadiusLimit = null;
        /**
         * Maximum allowed distance of the camera to the axis of rotation
         * (The camera can not get further).
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.upperRadiusLimit = null;
        /**
         * Define a rotation offset between the camera and the object it follows
         */
        this.rotationOffset = 0;
        /**
         * Minimum allowed angle to camera position relative to target object.
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.lowerRotationOffsetLimit = null;
        /**
         * Maximum allowed angle to camera position relative to target object.
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.upperRotationOffsetLimit = null;
        /**
         * Define a height offset between the camera and the object it follows.
         * It can help following an object from the top (like a car chasing a plane)
         */
        this.heightOffset = 4;
        /**
         * Minimum allowed height of camera position relative to target object.
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.lowerHeightOffsetLimit = null;
        /**
         * Maximum allowed height of camera position relative to target object.
         * This can help limiting how the Camera is able to move in the scene.
         */
        this.upperHeightOffsetLimit = null;
        /**
         * Define how fast the camera can accelerate to follow it s target.
         */
        this.cameraAcceleration = 0.05;
        /**
         * Define the speed limit of the camera following an object.
         */
        this.maxCameraSpeed = 20;
        this.lockedTarget = lockedTarget;
        this.inputs = new FollowCameraInputsManager(this);
        this.inputs.addKeyboard().addMouseWheel().addPointers();
        // Uncomment the following line when the relevant handlers have been implemented.
        // this.inputs.addKeyboard().addMouseWheel().addPointers().addVRDeviceOrientation();
    }
    _follow(cameraTarget) {
        if (!cameraTarget) {
            return;
        }
        const rotMatrix = math_vector/* TmpVectors */.AA.Matrix[0];
        cameraTarget.absoluteRotationQuaternion.toRotationMatrix(rotMatrix);
        const yRotation = Math.atan2(rotMatrix.m[8], rotMatrix.m[10]);
        const radians = tools/* Tools */.S0.ToRadians(this.rotationOffset) + yRotation;
        const targetPosition = cameraTarget.getAbsolutePosition();
        const targetX = targetPosition.x + Math.sin(radians) * this.radius;
        const targetZ = targetPosition.z + Math.cos(radians) * this.radius;
        const dx = targetX - this.position.x;
        const dy = targetPosition.y + this.heightOffset - this.position.y;
        const dz = targetZ - this.position.z;
        let vx = dx * this.cameraAcceleration * 2; //this is set to .05
        let vy = dy * this.cameraAcceleration;
        let vz = dz * this.cameraAcceleration * 2;
        if (vx > this.maxCameraSpeed || vx < -this.maxCameraSpeed) {
            vx = vx < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed;
        }
        if (vy > this.maxCameraSpeed || vy < -this.maxCameraSpeed) {
            vy = vy < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed;
        }
        if (vz > this.maxCameraSpeed || vz < -this.maxCameraSpeed) {
            vz = vz < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed;
        }
        this.position = new math_vector/* Vector3 */.Pq(this.position.x + vx, this.position.y + vy, this.position.z + vz);
        this.setTarget(targetPosition);
    }
    /**
     * Attached controls to the current camera.
     * @param ignored defines an ignored parameter kept for backward compatibility.
     * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
     */
    attachControl(ignored, noPreventDefault) {
        // eslint-disable-next-line prefer-rest-params
        noPreventDefault = tools/* Tools */.S0.BackCompatCameraNoPreventDefault(arguments);
        this.inputs.attachElement(noPreventDefault);
        this._reset = () => { };
    }
    /**
     * Detach the current controls from the specified dom element.
     */
    detachControl() {
        this.inputs.detachElement();
        if (this._reset) {
            this._reset();
        }
    }
    /** @internal */
    _checkInputs() {
        this.inputs.checkInputs();
        this._checkLimits();
        super._checkInputs();
        if (this.lockedTarget) {
            this._follow(this.lockedTarget);
        }
    }
    _checkLimits() {
        if (this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit) {
            this.radius = this.lowerRadiusLimit;
        }
        if (this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit) {
            this.radius = this.upperRadiusLimit;
        }
        if (this.lowerHeightOffsetLimit !== null && this.heightOffset < this.lowerHeightOffsetLimit) {
            this.heightOffset = this.lowerHeightOffsetLimit;
        }
        if (this.upperHeightOffsetLimit !== null && this.heightOffset > this.upperHeightOffsetLimit) {
            this.heightOffset = this.upperHeightOffsetLimit;
        }
        if (this.lowerRotationOffsetLimit !== null && this.rotationOffset < this.lowerRotationOffsetLimit) {
            this.rotationOffset = this.lowerRotationOffsetLimit;
        }
        if (this.upperRotationOffsetLimit !== null && this.rotationOffset > this.upperRotationOffsetLimit) {
            this.rotationOffset = this.upperRotationOffsetLimit;
        }
    }
    /**
     * Gets the camera class name.
     * @returns the class name
     */
    getClassName() {
        return "FollowCamera";
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "radius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "lowerRadiusLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "upperRadiusLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "rotationOffset", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "lowerRotationOffsetLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "upperRotationOffsetLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "heightOffset", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "lowerHeightOffsetLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "upperHeightOffsetLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "cameraAcceleration", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], FollowCamera.prototype, "maxCameraSpeed", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsMeshReference */.xG)("lockedTargetId")
], FollowCamera.prototype, "lockedTarget", void 0);
/**
 * Arc Rotate version of the follow camera.
 * It still follows a Defined mesh but in an Arc Rotate Camera fashion.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#followcamera
 */
class ArcFollowCamera extends targetCamera/* TargetCamera */.F {
    /**
     * Instantiates a new ArcFollowCamera
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#followcamera
     * @param name Define the name of the camera
     * @param alpha Define the rotation angle of the camera around the longitudinal axis
     * @param beta Define the rotation angle of the camera around the elevation axis
     * @param radius Define the radius of the camera from its target point
     * @param target Define the target of the camera
     * @param scene Define the scene the camera belongs to
     */
    constructor(name, 
    /** The longitudinal angle of the camera */
    alpha, 
    /** The latitudinal angle of the camera */
    beta, 
    /** The radius of the camera from its target */
    radius, 
    /** Define the camera target (the mesh it should follow) */
    target, scene) {
        super(name, math_vector/* Vector3 */.Pq.Zero(), scene);
        this.alpha = alpha;
        this.beta = beta;
        this.radius = radius;
        this._cartesianCoordinates = math_vector/* Vector3 */.Pq.Zero();
        this.setMeshTarget(target);
    }
    /**
     * Sets the mesh to follow with this camera.
     * @param target the target to follow
     */
    setMeshTarget(target) {
        this._meshTarget = target;
        this._follow();
    }
    _follow() {
        if (!this._meshTarget) {
            return;
        }
        this._cartesianCoordinates.x = this.radius * Math.cos(this.alpha) * Math.cos(this.beta);
        this._cartesianCoordinates.y = this.radius * Math.sin(this.beta);
        this._cartesianCoordinates.z = this.radius * Math.sin(this.alpha) * Math.cos(this.beta);
        const targetPosition = this._meshTarget.getAbsolutePosition();
        this.position = targetPosition.add(this._cartesianCoordinates);
        this.setTarget(targetPosition);
    }
    /** @internal */
    _checkInputs() {
        super._checkInputs();
        this._follow();
    }
    /**
     * Returns the class name of the object.
     * It is mostly used internally for serialization purposes.
     * @returns the class name
     */
    getClassName() {
        return "ArcFollowCamera";
    }
}
// Register Class Name
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FollowCamera", FollowCamera);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ArcFollowCamera", ArcFollowCamera);
//# sourceMappingURL=followCamera.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/scene.js + 2 modules
var core_scene = __webpack_require__(87491);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/sceneComponent.js
var sceneComponent = __webpack_require__(16945);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/domManagement.js
var domManagement = __webpack_require__(18790);
;// ./node_modules/@babylonjs/core/Gamepads/xboxGamepad.js


/**
 * Defines supported buttons for XBox360 compatible gamepads
 */
var Xbox360Button;
(function (Xbox360Button) {
    /** A */
    Xbox360Button[Xbox360Button["A"] = 0] = "A";
    /** B */
    Xbox360Button[Xbox360Button["B"] = 1] = "B";
    /** X */
    Xbox360Button[Xbox360Button["X"] = 2] = "X";
    /** Y */
    Xbox360Button[Xbox360Button["Y"] = 3] = "Y";
    /** Left button */
    Xbox360Button[Xbox360Button["LB"] = 4] = "LB";
    /** Right button */
    Xbox360Button[Xbox360Button["RB"] = 5] = "RB";
    /** Back */
    Xbox360Button[Xbox360Button["Back"] = 8] = "Back";
    /** Start */
    Xbox360Button[Xbox360Button["Start"] = 9] = "Start";
    /** Left stick */
    Xbox360Button[Xbox360Button["LeftStick"] = 10] = "LeftStick";
    /** Right stick */
    Xbox360Button[Xbox360Button["RightStick"] = 11] = "RightStick";
})(Xbox360Button || (Xbox360Button = {}));
/** Defines values for XBox360 DPad  */
var Xbox360Dpad;
(function (Xbox360Dpad) {
    /** Up */
    Xbox360Dpad[Xbox360Dpad["Up"] = 12] = "Up";
    /** Down */
    Xbox360Dpad[Xbox360Dpad["Down"] = 13] = "Down";
    /** Left */
    Xbox360Dpad[Xbox360Dpad["Left"] = 14] = "Left";
    /** Right */
    Xbox360Dpad[Xbox360Dpad["Right"] = 15] = "Right";
})(Xbox360Dpad || (Xbox360Dpad = {}));
/**
 * Defines a XBox360 gamepad
 */
class Xbox360Pad extends Gamepad {
    /**
     * Creates a new XBox360 gamepad object
     * @param id defines the id of this gamepad
     * @param index defines its index
     * @param gamepad defines the internal HTML gamepad object
     * @param xboxOne defines if it is a XBox One gamepad
     */
    constructor(id, index, gamepad, xboxOne = false) {
        super(id, index, gamepad, 0, 1, 2, 3);
        this._leftTrigger = 0;
        this._rightTrigger = 0;
        /** Observable raised when a button is pressed */
        this.onButtonDownObservable = new Misc_observable/* Observable */.cP();
        /** Observable raised when a button is released */
        this.onButtonUpObservable = new Misc_observable/* Observable */.cP();
        /** Observable raised when a pad is pressed */
        this.onPadDownObservable = new Misc_observable/* Observable */.cP();
        /** Observable raised when a pad is released */
        this.onPadUpObservable = new Misc_observable/* Observable */.cP();
        this._buttonA = 0;
        this._buttonB = 0;
        this._buttonX = 0;
        this._buttonY = 0;
        this._buttonBack = 0;
        this._buttonStart = 0;
        this._buttonLB = 0;
        this._buttonRB = 0;
        this._buttonLeftStick = 0;
        this._buttonRightStick = 0;
        this._dPadUp = 0;
        this._dPadDown = 0;
        this._dPadLeft = 0;
        this._dPadRight = 0;
        this._isXboxOnePad = false;
        this.type = Gamepad.XBOX;
        this._isXboxOnePad = xboxOne;
    }
    /**
     * Defines the callback to call when left trigger is pressed
     * @param callback defines the callback to use
     */
    onlefttriggerchanged(callback) {
        this._onlefttriggerchanged = callback;
    }
    /**
     * Defines the callback to call when right trigger is pressed
     * @param callback defines the callback to use
     */
    onrighttriggerchanged(callback) {
        this._onrighttriggerchanged = callback;
    }
    /**
     * Gets the left trigger value
     */
    get leftTrigger() {
        return this._leftTrigger;
    }
    /**
     * Sets the left trigger value
     */
    set leftTrigger(newValue) {
        if (this._onlefttriggerchanged && this._leftTrigger !== newValue) {
            this._onlefttriggerchanged(newValue);
        }
        this._leftTrigger = newValue;
    }
    /**
     * Gets the right trigger value
     */
    get rightTrigger() {
        return this._rightTrigger;
    }
    /**
     * Sets the right trigger value
     */
    set rightTrigger(newValue) {
        if (this._onrighttriggerchanged && this._rightTrigger !== newValue) {
            this._onrighttriggerchanged(newValue);
        }
        this._rightTrigger = newValue;
    }
    /**
     * Defines the callback to call when a button is pressed
     * @param callback defines the callback to use
     */
    onbuttondown(callback) {
        this._onbuttondown = callback;
    }
    /**
     * Defines the callback to call when a button is released
     * @param callback defines the callback to use
     */
    onbuttonup(callback) {
        this._onbuttonup = callback;
    }
    /**
     * Defines the callback to call when a pad is pressed
     * @param callback defines the callback to use
     */
    ondpaddown(callback) {
        this._ondpaddown = callback;
    }
    /**
     * Defines the callback to call when a pad is released
     * @param callback defines the callback to use
     */
    ondpadup(callback) {
        this._ondpadup = callback;
    }
    _setButtonValue(newValue, currentValue, buttonType) {
        if (newValue !== currentValue) {
            if (newValue === 1) {
                if (this._onbuttondown) {
                    this._onbuttondown(buttonType);
                }
                this.onButtonDownObservable.notifyObservers(buttonType);
            }
            if (newValue === 0) {
                if (this._onbuttonup) {
                    this._onbuttonup(buttonType);
                }
                this.onButtonUpObservable.notifyObservers(buttonType);
            }
        }
        return newValue;
    }
    _setDPadValue(newValue, currentValue, buttonType) {
        if (newValue !== currentValue) {
            if (newValue === 1) {
                if (this._ondpaddown) {
                    this._ondpaddown(buttonType);
                }
                this.onPadDownObservable.notifyObservers(buttonType);
            }
            if (newValue === 0) {
                if (this._ondpadup) {
                    this._ondpadup(buttonType);
                }
                this.onPadUpObservable.notifyObservers(buttonType);
            }
        }
        return newValue;
    }
    /**
     * Gets the value of the `A` button
     */
    get buttonA() {
        return this._buttonA;
    }
    /**
     * Sets the value of the `A` button
     */
    set buttonA(value) {
        this._buttonA = this._setButtonValue(value, this._buttonA, 0 /* Xbox360Button.A */);
    }
    /**
     * Gets the value of the `B` button
     */
    get buttonB() {
        return this._buttonB;
    }
    /**
     * Sets the value of the `B` button
     */
    set buttonB(value) {
        this._buttonB = this._setButtonValue(value, this._buttonB, 1 /* Xbox360Button.B */);
    }
    /**
     * Gets the value of the `X` button
     */
    get buttonX() {
        return this._buttonX;
    }
    /**
     * Sets the value of the `X` button
     */
    set buttonX(value) {
        this._buttonX = this._setButtonValue(value, this._buttonX, 2 /* Xbox360Button.X */);
    }
    /**
     * Gets the value of the `Y` button
     */
    get buttonY() {
        return this._buttonY;
    }
    /**
     * Sets the value of the `Y` button
     */
    set buttonY(value) {
        this._buttonY = this._setButtonValue(value, this._buttonY, 3 /* Xbox360Button.Y */);
    }
    /**
     * Gets the value of the `Start` button
     */
    get buttonStart() {
        return this._buttonStart;
    }
    /**
     * Sets the value of the `Start` button
     */
    set buttonStart(value) {
        this._buttonStart = this._setButtonValue(value, this._buttonStart, 9 /* Xbox360Button.Start */);
    }
    /**
     * Gets the value of the `Back` button
     */
    get buttonBack() {
        return this._buttonBack;
    }
    /**
     * Sets the value of the `Back` button
     */
    set buttonBack(value) {
        this._buttonBack = this._setButtonValue(value, this._buttonBack, 8 /* Xbox360Button.Back */);
    }
    /**
     * Gets the value of the `Left` button
     */
    get buttonLB() {
        return this._buttonLB;
    }
    /**
     * Sets the value of the `Left` button
     */
    set buttonLB(value) {
        this._buttonLB = this._setButtonValue(value, this._buttonLB, 4 /* Xbox360Button.LB */);
    }
    /**
     * Gets the value of the `Right` button
     */
    get buttonRB() {
        return this._buttonRB;
    }
    /**
     * Sets the value of the `Right` button
     */
    set buttonRB(value) {
        this._buttonRB = this._setButtonValue(value, this._buttonRB, 5 /* Xbox360Button.RB */);
    }
    /**
     * Gets the value of the Left joystick
     */
    get buttonLeftStick() {
        return this._buttonLeftStick;
    }
    /**
     * Sets the value of the Left joystick
     */
    set buttonLeftStick(value) {
        this._buttonLeftStick = this._setButtonValue(value, this._buttonLeftStick, 10 /* Xbox360Button.LeftStick */);
    }
    /**
     * Gets the value of the Right joystick
     */
    get buttonRightStick() {
        return this._buttonRightStick;
    }
    /**
     * Sets the value of the Right joystick
     */
    set buttonRightStick(value) {
        this._buttonRightStick = this._setButtonValue(value, this._buttonRightStick, 11 /* Xbox360Button.RightStick */);
    }
    /**
     * Gets the value of D-pad up
     */
    get dPadUp() {
        return this._dPadUp;
    }
    /**
     * Sets the value of D-pad up
     */
    set dPadUp(value) {
        this._dPadUp = this._setDPadValue(value, this._dPadUp, 12 /* Xbox360Dpad.Up */);
    }
    /**
     * Gets the value of D-pad down
     */
    get dPadDown() {
        return this._dPadDown;
    }
    /**
     * Sets the value of D-pad down
     */
    set dPadDown(value) {
        this._dPadDown = this._setDPadValue(value, this._dPadDown, 13 /* Xbox360Dpad.Down */);
    }
    /**
     * Gets the value of D-pad left
     */
    get dPadLeft() {
        return this._dPadLeft;
    }
    /**
     * Sets the value of D-pad left
     */
    set dPadLeft(value) {
        this._dPadLeft = this._setDPadValue(value, this._dPadLeft, 14 /* Xbox360Dpad.Left */);
    }
    /**
     * Gets the value of D-pad right
     */
    get dPadRight() {
        return this._dPadRight;
    }
    /**
     * Sets the value of D-pad right
     */
    set dPadRight(value) {
        this._dPadRight = this._setDPadValue(value, this._dPadRight, 15 /* Xbox360Dpad.Right */);
    }
    /**
     * Force the gamepad to synchronize with device values
     */
    update() {
        super.update();
        if (this._isXboxOnePad) {
            this.buttonA = this.browserGamepad.buttons[0].value;
            this.buttonB = this.browserGamepad.buttons[1].value;
            this.buttonX = this.browserGamepad.buttons[2].value;
            this.buttonY = this.browserGamepad.buttons[3].value;
            this.buttonLB = this.browserGamepad.buttons[4].value;
            this.buttonRB = this.browserGamepad.buttons[5].value;
            this.leftTrigger = this.browserGamepad.buttons[6].value;
            this.rightTrigger = this.browserGamepad.buttons[7].value;
            this.buttonBack = this.browserGamepad.buttons[8].value;
            this.buttonStart = this.browserGamepad.buttons[9].value;
            this.buttonLeftStick = this.browserGamepad.buttons[10].value;
            this.buttonRightStick = this.browserGamepad.buttons[11].value;
            this.dPadUp = this.browserGamepad.buttons[12].value;
            this.dPadDown = this.browserGamepad.buttons[13].value;
            this.dPadLeft = this.browserGamepad.buttons[14].value;
            this.dPadRight = this.browserGamepad.buttons[15].value;
        }
        else {
            this.buttonA = this.browserGamepad.buttons[0].value;
            this.buttonB = this.browserGamepad.buttons[1].value;
            this.buttonX = this.browserGamepad.buttons[2].value;
            this.buttonY = this.browserGamepad.buttons[3].value;
            this.buttonLB = this.browserGamepad.buttons[4].value;
            this.buttonRB = this.browserGamepad.buttons[5].value;
            this.leftTrigger = this.browserGamepad.buttons[6].value;
            this.rightTrigger = this.browserGamepad.buttons[7].value;
            this.buttonBack = this.browserGamepad.buttons[8].value;
            this.buttonStart = this.browserGamepad.buttons[9].value;
            this.buttonLeftStick = this.browserGamepad.buttons[10].value;
            this.buttonRightStick = this.browserGamepad.buttons[11].value;
            this.dPadUp = this.browserGamepad.buttons[12].value;
            this.dPadDown = this.browserGamepad.buttons[13].value;
            this.dPadLeft = this.browserGamepad.buttons[14].value;
            this.dPadRight = this.browserGamepad.buttons[15].value;
        }
    }
    /**
     * Disposes the gamepad
     */
    dispose() {
        super.dispose();
        this.onButtonDownObservable.clear();
        this.onButtonUpObservable.clear();
        this.onPadDownObservable.clear();
        this.onPadUpObservable.clear();
    }
}
//# sourceMappingURL=xboxGamepad.js.map
;// ./node_modules/@babylonjs/core/Gamepads/dualShockGamepad.js


/**
 * Defines supported buttons for DualShock compatible gamepads
 */
var DualShockButton;
(function (DualShockButton) {
    /** Cross */
    DualShockButton[DualShockButton["Cross"] = 0] = "Cross";
    /** Circle */
    DualShockButton[DualShockButton["Circle"] = 1] = "Circle";
    /** Square */
    DualShockButton[DualShockButton["Square"] = 2] = "Square";
    /** Triangle */
    DualShockButton[DualShockButton["Triangle"] = 3] = "Triangle";
    /** L1 */
    DualShockButton[DualShockButton["L1"] = 4] = "L1";
    /** R1 */
    DualShockButton[DualShockButton["R1"] = 5] = "R1";
    /** Share */
    DualShockButton[DualShockButton["Share"] = 8] = "Share";
    /** Options */
    DualShockButton[DualShockButton["Options"] = 9] = "Options";
    /** Left stick */
    DualShockButton[DualShockButton["LeftStick"] = 10] = "LeftStick";
    /** Right stick */
    DualShockButton[DualShockButton["RightStick"] = 11] = "RightStick";
})(DualShockButton || (DualShockButton = {}));
/** Defines values for DualShock DPad  */
var DualShockDpad;
(function (DualShockDpad) {
    /** Up */
    DualShockDpad[DualShockDpad["Up"] = 12] = "Up";
    /** Down */
    DualShockDpad[DualShockDpad["Down"] = 13] = "Down";
    /** Left */
    DualShockDpad[DualShockDpad["Left"] = 14] = "Left";
    /** Right */
    DualShockDpad[DualShockDpad["Right"] = 15] = "Right";
})(DualShockDpad || (DualShockDpad = {}));
/**
 * Defines a DualShock gamepad
 */
class DualShockPad extends Gamepad {
    /**
     * Creates a new DualShock gamepad object
     * @param id defines the id of this gamepad
     * @param index defines its index
     * @param gamepad defines the internal HTML gamepad object
     */
    constructor(id, index, gamepad) {
        super(id.replace("STANDARD GAMEPAD", "SONY PLAYSTATION DUALSHOCK"), index, gamepad, 0, 1, 2, 3);
        this._leftTrigger = 0;
        this._rightTrigger = 0;
        /** Observable raised when a button is pressed */
        this.onButtonDownObservable = new Misc_observable/* Observable */.cP();
        /** Observable raised when a button is released */
        this.onButtonUpObservable = new Misc_observable/* Observable */.cP();
        /** Observable raised when a pad is pressed */
        this.onPadDownObservable = new Misc_observable/* Observable */.cP();
        /** Observable raised when a pad is released */
        this.onPadUpObservable = new Misc_observable/* Observable */.cP();
        this._buttonCross = 0;
        this._buttonCircle = 0;
        this._buttonSquare = 0;
        this._buttonTriangle = 0;
        this._buttonShare = 0;
        this._buttonOptions = 0;
        this._buttonL1 = 0;
        this._buttonR1 = 0;
        this._buttonLeftStick = 0;
        this._buttonRightStick = 0;
        this._dPadUp = 0;
        this._dPadDown = 0;
        this._dPadLeft = 0;
        this._dPadRight = 0;
        this.type = Gamepad.DUALSHOCK;
    }
    /**
     * Defines the callback to call when left trigger is pressed
     * @param callback defines the callback to use
     */
    onlefttriggerchanged(callback) {
        this._onlefttriggerchanged = callback;
    }
    /**
     * Defines the callback to call when right trigger is pressed
     * @param callback defines the callback to use
     */
    onrighttriggerchanged(callback) {
        this._onrighttriggerchanged = callback;
    }
    /**
     * Gets the left trigger value
     */
    get leftTrigger() {
        return this._leftTrigger;
    }
    /**
     * Sets the left trigger value
     */
    set leftTrigger(newValue) {
        if (this._onlefttriggerchanged && this._leftTrigger !== newValue) {
            this._onlefttriggerchanged(newValue);
        }
        this._leftTrigger = newValue;
    }
    /**
     * Gets the right trigger value
     */
    get rightTrigger() {
        return this._rightTrigger;
    }
    /**
     * Sets the right trigger value
     */
    set rightTrigger(newValue) {
        if (this._onrighttriggerchanged && this._rightTrigger !== newValue) {
            this._onrighttriggerchanged(newValue);
        }
        this._rightTrigger = newValue;
    }
    /**
     * Defines the callback to call when a button is pressed
     * @param callback defines the callback to use
     */
    onbuttondown(callback) {
        this._onbuttondown = callback;
    }
    /**
     * Defines the callback to call when a button is released
     * @param callback defines the callback to use
     */
    onbuttonup(callback) {
        this._onbuttonup = callback;
    }
    /**
     * Defines the callback to call when a pad is pressed
     * @param callback defines the callback to use
     */
    ondpaddown(callback) {
        this._ondpaddown = callback;
    }
    /**
     * Defines the callback to call when a pad is released
     * @param callback defines the callback to use
     */
    ondpadup(callback) {
        this._ondpadup = callback;
    }
    _setButtonValue(newValue, currentValue, buttonType) {
        if (newValue !== currentValue) {
            if (newValue === 1) {
                if (this._onbuttondown) {
                    this._onbuttondown(buttonType);
                }
                this.onButtonDownObservable.notifyObservers(buttonType);
            }
            if (newValue === 0) {
                if (this._onbuttonup) {
                    this._onbuttonup(buttonType);
                }
                this.onButtonUpObservable.notifyObservers(buttonType);
            }
        }
        return newValue;
    }
    _setDPadValue(newValue, currentValue, buttonType) {
        if (newValue !== currentValue) {
            if (newValue === 1) {
                if (this._ondpaddown) {
                    this._ondpaddown(buttonType);
                }
                this.onPadDownObservable.notifyObservers(buttonType);
            }
            if (newValue === 0) {
                if (this._ondpadup) {
                    this._ondpadup(buttonType);
                }
                this.onPadUpObservable.notifyObservers(buttonType);
            }
        }
        return newValue;
    }
    /**
     * Gets the value of the `Cross` button
     */
    get buttonCross() {
        return this._buttonCross;
    }
    /**
     * Sets the value of the `Cross` button
     */
    set buttonCross(value) {
        this._buttonCross = this._setButtonValue(value, this._buttonCross, 0 /* DualShockButton.Cross */);
    }
    /**
     * Gets the value of the `Circle` button
     */
    get buttonCircle() {
        return this._buttonCircle;
    }
    /**
     * Sets the value of the `Circle` button
     */
    set buttonCircle(value) {
        this._buttonCircle = this._setButtonValue(value, this._buttonCircle, 1 /* DualShockButton.Circle */);
    }
    /**
     * Gets the value of the `Square` button
     */
    get buttonSquare() {
        return this._buttonSquare;
    }
    /**
     * Sets the value of the `Square` button
     */
    set buttonSquare(value) {
        this._buttonSquare = this._setButtonValue(value, this._buttonSquare, 2 /* DualShockButton.Square */);
    }
    /**
     * Gets the value of the `Triangle` button
     */
    get buttonTriangle() {
        return this._buttonTriangle;
    }
    /**
     * Sets the value of the `Triangle` button
     */
    set buttonTriangle(value) {
        this._buttonTriangle = this._setButtonValue(value, this._buttonTriangle, 3 /* DualShockButton.Triangle */);
    }
    /**
     * Gets the value of the `Options` button
     */
    get buttonOptions() {
        return this._buttonOptions;
    }
    /**
     * Sets the value of the `Options` button
     */
    set buttonOptions(value) {
        this._buttonOptions = this._setButtonValue(value, this._buttonOptions, 9 /* DualShockButton.Options */);
    }
    /**
     * Gets the value of the `Share` button
     */
    get buttonShare() {
        return this._buttonShare;
    }
    /**
     * Sets the value of the `Share` button
     */
    set buttonShare(value) {
        this._buttonShare = this._setButtonValue(value, this._buttonShare, 8 /* DualShockButton.Share */);
    }
    /**
     * Gets the value of the `L1` button
     */
    get buttonL1() {
        return this._buttonL1;
    }
    /**
     * Sets the value of the `L1` button
     */
    set buttonL1(value) {
        this._buttonL1 = this._setButtonValue(value, this._buttonL1, 4 /* DualShockButton.L1 */);
    }
    /**
     * Gets the value of the `R1` button
     */
    get buttonR1() {
        return this._buttonR1;
    }
    /**
     * Sets the value of the `R1` button
     */
    set buttonR1(value) {
        this._buttonR1 = this._setButtonValue(value, this._buttonR1, 5 /* DualShockButton.R1 */);
    }
    /**
     * Gets the value of the Left joystick
     */
    get buttonLeftStick() {
        return this._buttonLeftStick;
    }
    /**
     * Sets the value of the Left joystick
     */
    set buttonLeftStick(value) {
        this._buttonLeftStick = this._setButtonValue(value, this._buttonLeftStick, 10 /* DualShockButton.LeftStick */);
    }
    /**
     * Gets the value of the Right joystick
     */
    get buttonRightStick() {
        return this._buttonRightStick;
    }
    /**
     * Sets the value of the Right joystick
     */
    set buttonRightStick(value) {
        this._buttonRightStick = this._setButtonValue(value, this._buttonRightStick, 11 /* DualShockButton.RightStick */);
    }
    /**
     * Gets the value of D-pad up
     */
    get dPadUp() {
        return this._dPadUp;
    }
    /**
     * Sets the value of D-pad up
     */
    set dPadUp(value) {
        this._dPadUp = this._setDPadValue(value, this._dPadUp, 12 /* DualShockDpad.Up */);
    }
    /**
     * Gets the value of D-pad down
     */
    get dPadDown() {
        return this._dPadDown;
    }
    /**
     * Sets the value of D-pad down
     */
    set dPadDown(value) {
        this._dPadDown = this._setDPadValue(value, this._dPadDown, 13 /* DualShockDpad.Down */);
    }
    /**
     * Gets the value of D-pad left
     */
    get dPadLeft() {
        return this._dPadLeft;
    }
    /**
     * Sets the value of D-pad left
     */
    set dPadLeft(value) {
        this._dPadLeft = this._setDPadValue(value, this._dPadLeft, 14 /* DualShockDpad.Left */);
    }
    /**
     * Gets the value of D-pad right
     */
    get dPadRight() {
        return this._dPadRight;
    }
    /**
     * Sets the value of D-pad right
     */
    set dPadRight(value) {
        this._dPadRight = this._setDPadValue(value, this._dPadRight, 15 /* DualShockDpad.Right */);
    }
    /**
     * Force the gamepad to synchronize with device values
     */
    update() {
        super.update();
        this.buttonCross = this.browserGamepad.buttons[0].value;
        this.buttonCircle = this.browserGamepad.buttons[1].value;
        this.buttonSquare = this.browserGamepad.buttons[2].value;
        this.buttonTriangle = this.browserGamepad.buttons[3].value;
        this.buttonL1 = this.browserGamepad.buttons[4].value;
        this.buttonR1 = this.browserGamepad.buttons[5].value;
        this.leftTrigger = this.browserGamepad.buttons[6].value;
        this.rightTrigger = this.browserGamepad.buttons[7].value;
        this.buttonShare = this.browserGamepad.buttons[8].value;
        this.buttonOptions = this.browserGamepad.buttons[9].value;
        this.buttonLeftStick = this.browserGamepad.buttons[10].value;
        this.buttonRightStick = this.browserGamepad.buttons[11].value;
        this.dPadUp = this.browserGamepad.buttons[12].value;
        this.dPadDown = this.browserGamepad.buttons[13].value;
        this.dPadLeft = this.browserGamepad.buttons[14].value;
        this.dPadRight = this.browserGamepad.buttons[15].value;
    }
    /**
     * Disposes the gamepad
     */
    dispose() {
        super.dispose();
        this.onButtonDownObservable.clear();
        this.onButtonUpObservable.clear();
        this.onPadDownObservable.clear();
        this.onPadUpObservable.clear();
    }
}
//# sourceMappingURL=dualShockGamepad.js.map
;// ./node_modules/@babylonjs/core/Gamepads/gamepadManager.js







/**
 * Manager for handling gamepads
 */
class GamepadManager {
    /**
     * Initializes the gamepad manager
     * @param _scene BabylonJS scene
     */
    constructor(_scene) {
        this._scene = _scene;
        this._babylonGamepads = [];
        this._oneGamepadConnected = false;
        /** @internal */
        this._isMonitoring = false;
        /**
         * observable to be triggered when the gamepad controller has been disconnected
         */
        this.onGamepadDisconnectedObservable = new Misc_observable/* Observable */.cP();
        if (!(0,domManagement/* IsWindowObjectExist */.BA)()) {
            this._gamepadEventSupported = false;
        }
        else {
            this._gamepadEventSupported = "GamepadEvent" in window;
            this._gamepadSupport = navigator && navigator.getGamepads;
        }
        this.onGamepadConnectedObservable = new Misc_observable/* Observable */.cP((observer) => {
            // This will be used to raise the onGamepadConnected for all gamepads ALREADY connected
            for (const i in this._babylonGamepads) {
                const gamepad = this._babylonGamepads[i];
                if (gamepad && gamepad._isConnected) {
                    this.onGamepadConnectedObservable.notifyObserver(observer, gamepad);
                }
            }
        });
        this._onGamepadConnectedEvent = (evt) => {
            const gamepad = evt.gamepad;
            if (gamepad.index in this._babylonGamepads) {
                if (this._babylonGamepads[gamepad.index].isConnected) {
                    return;
                }
            }
            let newGamepad;
            if (this._babylonGamepads[gamepad.index]) {
                newGamepad = this._babylonGamepads[gamepad.index];
                newGamepad.browserGamepad = gamepad;
                newGamepad._isConnected = true;
            }
            else {
                newGamepad = this._addNewGamepad(gamepad);
            }
            this.onGamepadConnectedObservable.notifyObservers(newGamepad);
            this._startMonitoringGamepads();
        };
        this._onGamepadDisconnectedEvent = (evt) => {
            const gamepad = evt.gamepad;
            // Remove the gamepad from the list of gamepads to monitor.
            for (const i in this._babylonGamepads) {
                if (this._babylonGamepads[i].index === gamepad.index) {
                    const disconnectedGamepad = this._babylonGamepads[i];
                    disconnectedGamepad._isConnected = false;
                    this.onGamepadDisconnectedObservable.notifyObservers(disconnectedGamepad);
                    disconnectedGamepad.dispose && disconnectedGamepad.dispose();
                    break;
                }
            }
        };
        if (this._gamepadSupport) {
            //first add already-connected gamepads
            this._updateGamepadObjects();
            if (this._babylonGamepads.length) {
                this._startMonitoringGamepads();
            }
            // Checking if the gamepad connected event is supported (like in Firefox)
            if (this._gamepadEventSupported) {
                const hostWindow = this._scene ? this._scene.getEngine().getHostWindow() : window;
                if (hostWindow) {
                    hostWindow.addEventListener("gamepadconnected", this._onGamepadConnectedEvent, false);
                    hostWindow.addEventListener("gamepaddisconnected", this._onGamepadDisconnectedEvent, false);
                }
            }
            else {
                this._startMonitoringGamepads();
            }
        }
    }
    /**
     * The gamepads in the game pad manager
     */
    get gamepads() {
        return this._babylonGamepads;
    }
    /**
     * Get the gamepad controllers based on type
     * @param type The type of gamepad controller
     * @returns Nullable gamepad
     */
    getGamepadByType(type = Gamepad.XBOX) {
        for (const gamepad of this._babylonGamepads) {
            if (gamepad && gamepad.type === type) {
                return gamepad;
            }
        }
        return null;
    }
    /**
     * Disposes the gamepad manager
     */
    dispose() {
        if (this._gamepadEventSupported) {
            if (this._onGamepadConnectedEvent) {
                window.removeEventListener("gamepadconnected", this._onGamepadConnectedEvent);
            }
            if (this._onGamepadDisconnectedEvent) {
                window.removeEventListener("gamepaddisconnected", this._onGamepadDisconnectedEvent);
            }
            this._onGamepadConnectedEvent = null;
            this._onGamepadDisconnectedEvent = null;
        }
        this._babylonGamepads.forEach((gamepad) => {
            gamepad.dispose();
        });
        this.onGamepadConnectedObservable.clear();
        this.onGamepadDisconnectedObservable.clear();
        this._oneGamepadConnected = false;
        this._stopMonitoringGamepads();
        this._babylonGamepads = [];
    }
    _addNewGamepad(gamepad) {
        if (!this._oneGamepadConnected) {
            this._oneGamepadConnected = true;
        }
        let newGamepad;
        const dualShock = gamepad.id.search("054c") !== -1 && gamepad.id.search("0ce6") === -1;
        const xboxOne = gamepad.id.search("Xbox One") !== -1;
        if (xboxOne ||
            gamepad.id.search("Xbox 360") !== -1 ||
            gamepad.id.search("xinput") !== -1 ||
            (gamepad.id.search("045e") !== -1 && gamepad.id.search("Surface Dock") === -1)) {
            // make sure the Surface Dock Extender is not detected as an xbox controller
            newGamepad = new Xbox360Pad(gamepad.id, gamepad.index, gamepad, xboxOne);
        }
        else if (dualShock) {
            newGamepad = new DualShockPad(gamepad.id, gamepad.index, gamepad);
        }
        else {
            newGamepad = new GenericPad(gamepad.id, gamepad.index, gamepad);
        }
        this._babylonGamepads[newGamepad.index] = newGamepad;
        return newGamepad;
    }
    _startMonitoringGamepads() {
        if (!this._isMonitoring) {
            this._isMonitoring = true;
            //back-comp
            this._checkGamepadsStatus();
        }
    }
    _stopMonitoringGamepads() {
        this._isMonitoring = false;
    }
    /** @internal */
    _checkGamepadsStatus() {
        // Hack to be compatible Chrome
        this._updateGamepadObjects();
        for (const i in this._babylonGamepads) {
            const gamepad = this._babylonGamepads[i];
            if (!gamepad || !gamepad.isConnected) {
                continue;
            }
            try {
                gamepad.update();
            }
            catch {
                if (this._loggedErrors.indexOf(gamepad.index) === -1) {
                    tools/* Tools */.S0.Warn(`Error updating gamepad ${gamepad.id}`);
                    this._loggedErrors.push(gamepad.index);
                }
            }
        }
        if (this._isMonitoring) {
            abstractEngine/* AbstractEngine */.$.QueueNewFrame(() => {
                this._checkGamepadsStatus();
            });
        }
    }
    // This function is called only on Chrome, which does not properly support
    // connection/disconnection events and forces you to recopy again the gamepad object
    _updateGamepadObjects() {
        const gamepads = navigator.getGamepads ? navigator.getGamepads() : [];
        for (let i = 0; i < gamepads.length; i++) {
            const gamepad = gamepads[i];
            if (gamepad) {
                if (!this._babylonGamepads[gamepad.index]) {
                    const newGamepad = this._addNewGamepad(gamepad);
                    this.onGamepadConnectedObservable.notifyObservers(newGamepad);
                }
                else {
                    // Forced to copy again this object for Chrome for unknown reason
                    this._babylonGamepads[i].browserGamepad = gamepad;
                    if (!this._babylonGamepads[i].isConnected) {
                        this._babylonGamepads[i]._isConnected = true;
                        this.onGamepadConnectedObservable.notifyObservers(this._babylonGamepads[i]);
                    }
                }
            }
        }
    }
}
//# sourceMappingURL=gamepadManager.js.map
;// ./node_modules/@babylonjs/core/Gamepads/gamepadSceneComponent.js







Object.defineProperty(core_scene/* Scene */.Z.prototype, "gamepadManager", {
    get: function () {
        if (!this._gamepadManager) {
            this._gamepadManager = new GamepadManager(this);
            let component = this._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_GAMEPAD);
            if (!component) {
                component = new GamepadSystemSceneComponent(this);
                this._addComponent(component);
            }
        }
        return this._gamepadManager;
    },
    enumerable: true,
    configurable: true,
});
/**
 * Adds a gamepad to the free camera inputs manager
 * @returns the FreeCameraInputsManager
 */
freeCameraInputsManager/* FreeCameraInputsManager */.s.prototype.addGamepad = function () {
    this.add(new FreeCameraGamepadInput());
    return this;
};
/**
 * Adds a gamepad to the arc rotate camera inputs manager
 * @returns the camera inputs manager
 */
ArcRotateCameraInputsManager.prototype.addGamepad = function () {
    this.add(new ArcRotateCameraGamepadInput());
    return this;
};
/**
 * Defines the gamepad scene component responsible to manage gamepads in a given scene
 */
class GamepadSystemSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpfull to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_GAMEPAD;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        // Nothing to do for gamepads
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do for gamepads
    }
    /**
     * Disposes the component and the associated resources
     */
    dispose() {
        const gamepadManager = this.scene._gamepadManager;
        if (gamepadManager) {
            gamepadManager.dispose();
            this.scene._gamepadManager = null;
        }
    }
}
//# sourceMappingURL=gamepadSceneComponent.js.map
;// ./node_modules/@babylonjs/core/Cameras/universalCamera.js





node/* Node */.b.AddNodeConstructor("FreeCamera", (name, scene) => {
    // Forcing to use the Universal camera
    return () => new UniversalCamera(name, math_vector/* Vector3 */.Pq.Zero(), scene);
});
/**
 * The Universal Camera is the one to choose for first person shooter type games, and works with all the keyboard, mouse, touch and gamepads. This replaces the earlier Free Camera,
 * which still works and will still be found in many Playgrounds.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
 */
class UniversalCamera extends TouchCamera {
    /**
     * Defines the gamepad rotation sensibility.
     * This is the threshold from when rotation starts to be accounted for to prevent jittering.
     */
    get gamepadAngularSensibility() {
        const gamepad = this.inputs.attached["gamepad"];
        if (gamepad) {
            return gamepad.gamepadAngularSensibility;
        }
        return 0;
    }
    set gamepadAngularSensibility(value) {
        const gamepad = this.inputs.attached["gamepad"];
        if (gamepad) {
            gamepad.gamepadAngularSensibility = value;
        }
    }
    /**
     * Defines the gamepad move sensibility.
     * This is the threshold from when moving starts to be accounted for to prevent jittering.
     */
    get gamepadMoveSensibility() {
        const gamepad = this.inputs.attached["gamepad"];
        if (gamepad) {
            return gamepad.gamepadMoveSensibility;
        }
        return 0;
    }
    set gamepadMoveSensibility(value) {
        const gamepad = this.inputs.attached["gamepad"];
        if (gamepad) {
            gamepad.gamepadMoveSensibility = value;
        }
    }
    /**
     * The Universal Camera is the one to choose for first person shooter type games, and works with all the keyboard, mouse, touch and gamepads. This replaces the earlier Free Camera,
     * which still works and will still be found in many Playgrounds.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
     * @param name Define the name of the camera in the scene
     * @param position Define the start position of the camera in the scene
     * @param scene Define the scene the camera belongs to
     */
    constructor(name, position, scene) {
        super(name, position, scene);
        this.inputs.addGamepad();
    }
    /**
     * Gets the current object class name.
     * @returns the class name
     */
    getClassName() {
        return "UniversalCamera";
    }
}
Cameras_camera/* Camera */.i._CreateDefaultParsedCamera = (name, scene) => {
    return new UniversalCamera(name, math_vector/* Vector3 */.Pq.Zero(), scene);
};
//# sourceMappingURL=universalCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/gamepadCamera.js



node/* Node */.b.AddNodeConstructor("GamepadCamera", (name, scene) => {
    return () => new GamepadCamera(name, math_vector/* Vector3 */.Pq.Zero(), scene);
});
/**
 * This represents a FPS type of camera. This is only here for back compat purpose.
 * Please use the UniversalCamera instead as both are identical.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
 */
class GamepadCamera extends UniversalCamera {
    /**
     * Instantiates a new Gamepad Camera
     * This represents a FPS type of camera. This is only here for back compat purpose.
     * Please use the UniversalCamera instead as both are identical.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera
     * @param name Define the name of the camera in the scene
     * @param position Define the start position of the camera in the scene
     * @param scene Define the scene the camera belongs to
     */
    constructor(name, position, scene) {
        super(name, position, scene);
    }
    /**
     * Gets the current object class name.
     * @returns the class name
     */
    getClassName() {
        return "GamepadCamera";
    }
}
//# sourceMappingURL=gamepadCamera.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/passPostProcess.js
var passPostProcess = __webpack_require__(30580);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/postProcess.js
var PostProcesses_postProcess = __webpack_require__(77891);
;// ./node_modules/@babylonjs/core/PostProcesses/anaglyphPostProcess.js


/**
 * Postprocess used to generate anaglyphic rendering
 */
class AnaglyphPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "AnaglyphPostProcess" string
     */
    getClassName() {
        return "AnaglyphPostProcess";
    }
    /**
     * Creates a new AnaglyphPostProcess
     * @param name defines postprocess name
     * @param options defines creation options or target ratio scale
     * @param rigCameras defines cameras using this postprocess
     * @param samplingMode defines required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default)
     * @param engine defines hosting engine
     * @param reusable defines if the postprocess will be reused multiple times per frame
     */
    constructor(name, options, rigCameras, samplingMode, engine, reusable) {
        super(name, "anaglyph", null, ["leftSampler"], options, rigCameras[1], samplingMode, engine, reusable);
        this._passedProcess = rigCameras[0]._rigPostProcess;
        this.onApplyObservable.add((effect) => {
            effect.setTextureFromPostProcess("leftSampler", this._passedProcess);
        });
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 91506)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 69723)));
        }
        super._gatherImports(useWebGPU, list);
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.AnaglyphPostProcess", AnaglyphPostProcess);
//# sourceMappingURL=anaglyphPostProcess.js.map
;// ./node_modules/@babylonjs/core/Cameras/RigModes/stereoscopicAnaglyphRigMode.js


/**
 * @internal
 */
function setStereoscopicAnaglyphRigMode(camera) {
    camera._rigCameras[0]._rigPostProcess = new passPostProcess/* PassPostProcess */.v(camera.name + "_passthru", 1.0, camera._rigCameras[0]);
    camera._rigCameras[1]._rigPostProcess = new AnaglyphPostProcess(camera.name + "_anaglyph", 1.0, camera._rigCameras);
}
//# sourceMappingURL=stereoscopicAnaglyphRigMode.js.map
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphArcRotateCamera.js





node/* Node */.b.AddNodeConstructor("AnaglyphArcRotateCamera", (name, scene, options) => {
    return () => new AnaglyphArcRotateCamera(name, 0, 0, 1.0, math_vector/* Vector3 */.Pq.Zero(), options.interaxial_distance, scene);
});
/**
 * Camera used to simulate anaglyphic rendering (based on ArcRotateCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#anaglyph-cameras
 */
class AnaglyphArcRotateCamera extends ArcRotateCamera {
    /**
     * Creates a new AnaglyphArcRotateCamera
     * @param name defines camera name
     * @param alpha defines alpha angle (in radians)
     * @param beta defines beta angle (in radians)
     * @param radius defines radius
     * @param target defines camera target
     * @param interaxialDistance defines distance between each color axis
     * @param scene defines the hosting scene
     */
    constructor(name, alpha, beta, radius, target, interaxialDistance, scene) {
        super(name, alpha, beta, radius, target, scene);
        this._setRigMode = () => setStereoscopicAnaglyphRigMode(this);
        this.interaxialDistance = interaxialDistance;
        this.setCameraRigMode(Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance });
    }
    /**
     * Gets camera class name
     * @returns AnaglyphArcRotateCamera
     */
    getClassName() {
        return "AnaglyphArcRotateCamera";
    }
}
//# sourceMappingURL=anaglyphArcRotateCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphFreeCamera.js





node/* Node */.b.AddNodeConstructor("AnaglyphFreeCamera", (name, scene, options) => {
    return () => new AnaglyphFreeCamera(name, math_vector/* Vector3 */.Pq.Zero(), options.interaxial_distance, scene);
});
/**
 * Camera used to simulate anaglyphic rendering (based on FreeCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#anaglyph-cameras
 */
class AnaglyphFreeCamera extends Cameras_freeCamera/* FreeCamera */.S {
    /**
     * Creates a new AnaglyphFreeCamera
     * @param name defines camera name
     * @param position defines initial position
     * @param interaxialDistance defines distance between each color axis
     * @param scene defines the hosting scene
     */
    constructor(name, position, interaxialDistance, scene) {
        super(name, position, scene);
        this._setRigMode = () => setStereoscopicAnaglyphRigMode(this);
        this.interaxialDistance = interaxialDistance;
        this.setCameraRigMode(Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance });
    }
    /**
     * Gets camera class name
     * @returns AnaglyphFreeCamera
     */
    getClassName() {
        return "AnaglyphFreeCamera";
    }
}
//# sourceMappingURL=anaglyphFreeCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphGamepadCamera.js





node/* Node */.b.AddNodeConstructor("AnaglyphGamepadCamera", (name, scene, options) => {
    return () => new AnaglyphGamepadCamera(name, math_vector/* Vector3 */.Pq.Zero(), options.interaxial_distance, scene);
});
/**
 * Camera used to simulate anaglyphic rendering (based on GamepadCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#anaglyph-cameras
 */
class AnaglyphGamepadCamera extends GamepadCamera {
    /**
     * Creates a new AnaglyphGamepadCamera
     * @param name defines camera name
     * @param position defines initial position
     * @param interaxialDistance defines distance between each color axis
     * @param scene defines the hosting scene
     */
    constructor(name, position, interaxialDistance, scene) {
        super(name, position, scene);
        this._setRigMode = () => setStereoscopicAnaglyphRigMode(this);
        this.interaxialDistance = interaxialDistance;
        this.setCameraRigMode(Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance });
    }
    /**
     * Gets camera class name
     * @returns AnaglyphGamepadCamera
     */
    getClassName() {
        return "AnaglyphGamepadCamera";
    }
}
//# sourceMappingURL=anaglyphGamepadCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphUniversalCamera.js





node/* Node */.b.AddNodeConstructor("AnaglyphUniversalCamera", (name, scene, options) => {
    return () => new AnaglyphUniversalCamera(name, math_vector/* Vector3 */.Pq.Zero(), options.interaxial_distance, scene);
});
/**
 * Camera used to simulate anaglyphic rendering (based on UniversalCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#anaglyph-cameras
 */
class AnaglyphUniversalCamera extends UniversalCamera {
    /**
     * Creates a new AnaglyphUniversalCamera
     * @param name defines camera name
     * @param position defines initial position
     * @param interaxialDistance defines distance between each color axis
     * @param scene defines the hosting scene
     */
    constructor(name, position, interaxialDistance, scene) {
        super(name, position, scene);
        this._setRigMode = () => setStereoscopicAnaglyphRigMode(this);
        this.interaxialDistance = interaxialDistance;
        this.setCameraRigMode(Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: interaxialDistance });
    }
    /**
     * Gets camera class name
     * @returns AnaglyphUniversalCamera
     */
    getClassName() {
        return "AnaglyphUniversalCamera";
    }
}
//# sourceMappingURL=anaglyphUniversalCamera.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.viewport.js
var math_viewport = __webpack_require__(54494);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/shaderStore.js
var shaderStore = __webpack_require__(69610);
;// ./node_modules/@babylonjs/core/Shaders/stereoscopicInterlace.fragment.js
// Do not edit.

const stereoscopicInterlace_fragment_name = "stereoscopicInterlacePixelShader";
const shader = `const vec3 TWO=vec3(2.0,2.0,2.0);varying vec2 vUV;uniform sampler2D camASampler;uniform sampler2D textureSampler;uniform vec2 stepSize;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{bool useCamA;bool useCamB;vec2 texCoord1;vec2 texCoord2;vec3 frag1;vec3 frag2;
#ifdef IS_STEREOSCOPIC_HORIZ
useCamB=vUV.x>0.5;useCamA=!useCamB;texCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);texCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);
#else
#ifdef IS_STEREOSCOPIC_INTERLACED
float rowNum=floor(vUV.y/stepSize.y);useCamA=mod(rowNum,2.0)==1.0;useCamB=mod(rowNum,2.0)==0.0;texCoord1=vec2(vUV.x,vUV.y);texCoord2=vec2(vUV.x,vUV.y);
#else
useCamB=vUV.y>0.5;useCamA=!useCamB;texCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);texCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);
#endif
#endif
if (useCamB){frag1=texture2D(textureSampler,texCoord1).rgb;frag2=texture2D(textureSampler,texCoord2).rgb;}else if (useCamA){frag1=texture2D(camASampler ,texCoord1).rgb;frag2=texture2D(camASampler ,texCoord2).rgb;}else {discard;}
gl_FragColor=vec4((frag1+frag2)/TWO,1.0);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[stereoscopicInterlace_fragment_name] = shader;
/** @internal */
const stereoscopicInterlacePixelShader = { name: stereoscopicInterlace_fragment_name, shader };
//# sourceMappingURL=stereoscopicInterlace.fragment.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/stereoscopicInterlacePostProcess.js



/**
 * StereoscopicInterlacePostProcessI used to render stereo views from a rigged camera with support for alternate line interlacing
 */
class StereoscopicInterlacePostProcessI extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "StereoscopicInterlacePostProcessI" string
     */
    getClassName() {
        return "StereoscopicInterlacePostProcessI";
    }
    /**
     * Initializes a StereoscopicInterlacePostProcessI
     * @param name The name of the effect.
     * @param rigCameras The rig cameras to be applied to the post process
     * @param isStereoscopicHoriz If the rendered results are horizontal or vertical
     * @param isStereoscopicInterlaced If the rendered results are alternate line interlaced
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     */
    constructor(name, rigCameras, isStereoscopicHoriz, isStereoscopicInterlaced, samplingMode, engine, reusable) {
        super(name, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, rigCameras[1], samplingMode, engine, reusable, isStereoscopicInterlaced ? "#define IS_STEREOSCOPIC_INTERLACED 1" : isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : undefined);
        this._passedProcess = rigCameras[0]._rigPostProcess;
        this._stepSize = new math_vector/* Vector2 */.I9(1 / this.width, 1 / this.height);
        this.onSizeChangedObservable.add(() => {
            this._stepSize = new math_vector/* Vector2 */.I9(1 / this.width, 1 / this.height);
        });
        this.onApplyObservable.add((effect) => {
            effect.setTextureFromPostProcess("camASampler", this._passedProcess);
            effect.setFloat2("stepSize", this._stepSize.x, this._stepSize.y);
        });
    }
}
/**
 * StereoscopicInterlacePostProcess used to render stereo views from a rigged camera
 */
class StereoscopicInterlacePostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "StereoscopicInterlacePostProcess" string
     */
    getClassName() {
        return "StereoscopicInterlacePostProcess";
    }
    /**
     * Initializes a StereoscopicInterlacePostProcess
     * @param name The name of the effect.
     * @param rigCameras The rig cameras to be applied to the post process
     * @param isStereoscopicHoriz If the rendered results are horizontal or vertical
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     */
    constructor(name, rigCameras, isStereoscopicHoriz, samplingMode, engine, reusable) {
        super(name, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, rigCameras[1], samplingMode, engine, reusable, isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : undefined);
        this._passedProcess = rigCameras[0]._rigPostProcess;
        this._stepSize = new math_vector/* Vector2 */.I9(1 / this.width, 1 / this.height);
        this.onSizeChangedObservable.add(() => {
            this._stepSize = new math_vector/* Vector2 */.I9(1 / this.width, 1 / this.height);
        });
        this.onApplyObservable.add((effect) => {
            effect.setTextureFromPostProcess("camASampler", this._passedProcess);
            effect.setFloat2("stepSize", this._stepSize.x, this._stepSize.y);
        });
    }
}
//# sourceMappingURL=stereoscopicInterlacePostProcess.js.map
;// ./node_modules/@babylonjs/core/Cameras/RigModes/stereoscopicRigMode.js




/**
 * @internal
 */
function setStereoscopicRigMode(camera) {
    const isStereoscopicHoriz = camera.cameraRigMode === Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || camera.cameraRigMode === Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;
    const isCrossEye = camera.cameraRigMode === Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;
    const isInterlaced = camera.cameraRigMode === Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_INTERLACED;
    // Use post-processors for interlacing
    if (isInterlaced) {
        camera._rigCameras[0]._rigPostProcess = new passPostProcess/* PassPostProcess */.v(camera.name + "_passthru", 1.0, camera._rigCameras[0]);
        camera._rigCameras[1]._rigPostProcess = new StereoscopicInterlacePostProcessI(camera.name + "_stereoInterlace", camera._rigCameras, false, true);
    }
    // Otherwise, create appropriate viewports
    else {
        camera._rigCameras[isCrossEye ? 1 : 0].viewport = new math_viewport/* Viewport */.L(0, 0, isStereoscopicHoriz ? 0.5 : 1.0, isStereoscopicHoriz ? 1.0 : 0.5);
        camera._rigCameras[isCrossEye ? 0 : 1].viewport = new math_viewport/* Viewport */.L(isStereoscopicHoriz ? 0.5 : 0, isStereoscopicHoriz ? 0 : 0.5, isStereoscopicHoriz ? 0.5 : 1.0, isStereoscopicHoriz ? 1.0 : 0.5);
    }
}
//# sourceMappingURL=stereoscopicRigMode.js.map
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js





node/* Node */.b.AddNodeConstructor("StereoscopicArcRotateCamera", (name, scene, options) => {
    return () => new StereoscopicArcRotateCamera(name, 0, 0, 1.0, math_vector/* Vector3 */.Pq.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
});
/**
 * Camera used to simulate stereoscopic rendering (based on ArcRotateCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
 */
class StereoscopicArcRotateCamera extends ArcRotateCamera {
    /**
     * Creates a new StereoscopicArcRotateCamera
     * @param name defines camera name
     * @param alpha defines alpha angle (in radians)
     * @param beta defines beta angle (in radians)
     * @param radius defines radius
     * @param target defines camera target
     * @param interaxialDistance defines distance between each color axis
     * @param isStereoscopicSideBySide defines is stereoscopic is done side by side or over under
     * @param scene defines the hosting scene
     */
    constructor(name, alpha, beta, radius, target, interaxialDistance, isStereoscopicSideBySide, scene) {
        super(name, alpha, beta, radius, target, scene);
        this._setRigMode = () => setStereoscopicRigMode(this);
        this.interaxialDistance = interaxialDistance;
        this.isStereoscopicSideBySide = isStereoscopicSideBySide;
        this.setCameraRigMode(isStereoscopicSideBySide ? Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
            interaxialDistance: interaxialDistance,
        });
    }
    /**
     * Gets camera class name
     * @returns StereoscopicArcRotateCamera
     */
    getClassName() {
        return "StereoscopicArcRotateCamera";
    }
}
//# sourceMappingURL=stereoscopicArcRotateCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicFreeCamera.js





node/* Node */.b.AddNodeConstructor("StereoscopicFreeCamera", (name, scene, options) => {
    return () => new StereoscopicFreeCamera(name, math_vector/* Vector3 */.Pq.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
});
/**
 * Camera used to simulate stereoscopic rendering (based on FreeCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
 */
class StereoscopicFreeCamera extends Cameras_freeCamera/* FreeCamera */.S {
    /**
     * Creates a new StereoscopicFreeCamera
     * @param name defines camera name
     * @param position defines initial position
     * @param interaxialDistance defines distance between each color axis
     * @param isStereoscopicSideBySide defines is stereoscopic is done side by side or over under
     * @param scene defines the hosting scene
     */
    constructor(name, position, interaxialDistance, isStereoscopicSideBySide, scene) {
        super(name, position, scene);
        this._setRigMode = () => setStereoscopicRigMode(this);
        this.interaxialDistance = interaxialDistance;
        this.isStereoscopicSideBySide = isStereoscopicSideBySide;
        this.setCameraRigMode(isStereoscopicSideBySide ? Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
            interaxialDistance: interaxialDistance,
        });
    }
    /**
     * Gets camera class name
     * @returns StereoscopicFreeCamera
     */
    getClassName() {
        return "StereoscopicFreeCamera";
    }
}
//# sourceMappingURL=stereoscopicFreeCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicGamepadCamera.js





node/* Node */.b.AddNodeConstructor("StereoscopicGamepadCamera", (name, scene, options) => {
    return () => new StereoscopicGamepadCamera(name, math_vector/* Vector3 */.Pq.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
});
/**
 * Camera used to simulate stereoscopic rendering (based on GamepadCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
 */
class StereoscopicGamepadCamera extends GamepadCamera {
    /**
     * Creates a new StereoscopicGamepadCamera
     * @param name defines camera name
     * @param position defines initial position
     * @param interaxialDistance defines distance between each color axis
     * @param isStereoscopicSideBySide defines is stereoscopic is done side by side or over under
     * @param scene defines the hosting scene
     */
    constructor(name, position, interaxialDistance, isStereoscopicSideBySide, scene) {
        super(name, position, scene);
        this._setRigMode = () => setStereoscopicRigMode(this);
        this.interaxialDistance = interaxialDistance;
        this.isStereoscopicSideBySide = isStereoscopicSideBySide;
        this.setCameraRigMode(isStereoscopicSideBySide ? Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
            interaxialDistance: interaxialDistance,
        });
    }
    /**
     * Gets camera class name
     * @returns StereoscopicGamepadCamera
     */
    getClassName() {
        return "StereoscopicGamepadCamera";
    }
}
//# sourceMappingURL=stereoscopicGamepadCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicUniversalCamera.js





node/* Node */.b.AddNodeConstructor("StereoscopicFreeCamera", (name, scene, options) => {
    return () => new StereoscopicUniversalCamera(name, math_vector/* Vector3 */.Pq.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
});
/**
 * Camera used to simulate stereoscopic rendering (based on UniversalCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
 */
class StereoscopicUniversalCamera extends UniversalCamera {
    /**
     * Creates a new StereoscopicUniversalCamera
     * @param name defines camera name
     * @param position defines initial position
     * @param interaxialDistance defines distance between each color axis
     * @param isStereoscopicSideBySide defines is stereoscopic is done side by side or over under
     * @param scene defines the hosting scene
     */
    constructor(name, position, interaxialDistance, isStereoscopicSideBySide, scene) {
        super(name, position, scene);
        this._setRigMode = () => setStereoscopicRigMode(this);
        this.interaxialDistance = interaxialDistance;
        this.isStereoscopicSideBySide = isStereoscopicSideBySide;
        this.setCameraRigMode(isStereoscopicSideBySide ? Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
            interaxialDistance: interaxialDistance,
        });
    }
    /**
     * Gets camera class name
     * @returns StereoscopicUniversalCamera
     */
    getClassName() {
        return "StereoscopicUniversalCamera";
    }
}
//# sourceMappingURL=stereoscopicUniversalCamera.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/transformNode.js
var Meshes_transformNode = __webpack_require__(97328);
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js






/**
 * Camera used to simulate stereoscopic rendering on real screens (based on UniversalCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
 */
class StereoscopicScreenUniversalCamera extends UniversalCamera {
    set distanceBetweenEyes(newValue) {
        this._distanceBetweenEyes = newValue;
    }
    /**
     * distance between the eyes
     */
    get distanceBetweenEyes() {
        return this._distanceBetweenEyes;
    }
    set distanceToProjectionPlane(newValue) {
        this._distanceToProjectionPlane = newValue;
    }
    /**
     * Distance to projection plane (should be the same units the like distance between the eyes)
     */
    get distanceToProjectionPlane() {
        return this._distanceToProjectionPlane;
    }
    /**
     * Creates a new StereoscopicScreenUniversalCamera
     * @param name defines camera name
     * @param position defines initial position
     * @param scene defines the hosting scene
     * @param distanceToProjectionPlane defines distance between each color axis. The rig cameras will receive this as their negative z position!
     * @param distanceBetweenEyes defines is stereoscopic is done side by side or over under
     */
    constructor(name, position, scene, distanceToProjectionPlane = 1, distanceBetweenEyes = 0.065) {
        super(name, position, scene);
        this._distanceBetweenEyes = distanceBetweenEyes;
        this._distanceToProjectionPlane = distanceToProjectionPlane;
        this.setCameraRigMode(Cameras_camera/* Camera */.i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL, {
            stereoHalfAngle: 0,
        });
        this._cameraRigParams.stereoHalfAngle = 0;
        this._cameraRigParams.interaxialDistance = distanceBetweenEyes;
    }
    /**
     * Gets camera class name
     * @returns StereoscopicScreenUniversalCamera
     */
    getClassName() {
        return "StereoscopicUniversalCamera";
    }
    /**
     * @internal
     */
    createRigCamera(name) {
        const camera = new targetCamera/* TargetCamera */.F(name, math_vector/* Vector3 */.Pq.Zero(), this.getScene());
        const transform = new Meshes_transformNode/* TransformNode */.V("tm_" + name, this.getScene());
        camera.parent = transform;
        transform.setPivotMatrix(math_vector/* Matrix */.uq.Identity(), false);
        camera.isRigCamera = true;
        camera.rigParent = this;
        return camera;
    }
    /**
     * @internal
     */
    _updateRigCameras() {
        for (let cameraIndex = 0; cameraIndex < this._rigCameras.length; cameraIndex++) {
            const cam = this._rigCameras[cameraIndex];
            cam.minZ = this.minZ;
            cam.maxZ = this.maxZ;
            cam.fov = this.fov;
            cam.upVector.copyFrom(this.upVector);
            if (cam.rotationQuaternion) {
                cam.rotationQuaternion.copyFrom(this.rotationQuaternion);
            }
            else {
                cam.rotation.copyFrom(this.rotation);
            }
            this._updateCamera(this._rigCameras[cameraIndex], cameraIndex);
        }
    }
    _updateCamera(camera, cameraIndex) {
        const b = this.distanceBetweenEyes / 2;
        const z = b / this.distanceToProjectionPlane;
        camera.position.copyFrom(this.position);
        camera.position.addInPlaceFromFloats(cameraIndex === 0 ? -b : b, 0, -this._distanceToProjectionPlane);
        const transform = camera.parent;
        const m = transform.getPivotMatrix();
        m.setTranslationFromFloats(cameraIndex === 0 ? b : -b, 0, 0);
        m.setRowFromFloats(2, cameraIndex === 0 ? z : -z, 0, 1, 0);
        transform.setPivotMatrix(m, false);
    }
    _setRigMode() {
        this._rigCameras[0].viewport = new math_viewport/* Viewport */.L(0, 0, 0.5, 1);
        this._rigCameras[1].viewport = new math_viewport/* Viewport */.L(0.5, 0, 0.5, 1.0);
        for (let cameraIndex = 0; cameraIndex < this._rigCameras.length; cameraIndex++) {
            this._updateCamera(this._rigCameras[cameraIndex], cameraIndex);
        }
    }
}
//# sourceMappingURL=stereoscopicScreenUniversalCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/Stereoscopic/index.js









//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Cameras/virtualJoysticksCamera.js




node/* Node */.b.AddNodeConstructor("VirtualJoysticksCamera", (name, scene) => {
    return () => new VirtualJoysticksCamera(name, math_vector/* Vector3 */.Pq.Zero(), scene);
});
/**
 * This represents a free type of camera. It can be useful in First Person Shooter game for instance.
 * It is identical to the Free Camera and simply adds by default a virtual joystick.
 * Virtual Joysticks are on-screen 2D graphics that are used to control the camera or other scene items.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#virtual-joysticks-camera
 */
class VirtualJoysticksCamera extends Cameras_freeCamera/* FreeCamera */.S {
    /**
     * Instantiates a VirtualJoysticksCamera. It can be useful in First Person Shooter game for instance.
     * It is identical to the Free Camera and simply adds by default a virtual joystick.
     * Virtual Joysticks are on-screen 2D graphics that are used to control the camera or other scene items.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#virtual-joysticks-camera
     * @param name Define the name of the camera in the scene
     * @param position Define the start position of the camera in the scene
     * @param scene Define the scene the camera belongs to
     */
    constructor(name, position, scene) {
        super(name, position, scene);
        this.inputs.addVirtualJoystick();
    }
    /**
     * Gets the current object class name.
     * @returns the class name
     */
    getClassName() {
        return "VirtualJoysticksCamera";
    }
}
//# sourceMappingURL=virtualJoysticksCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/VR/vrCameraMetrics.js

/**
 * This represents all the required metrics to create a VR camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#device-orientation-camera
 */
class VRCameraMetrics {
    constructor() {
        /**
         * Define if the current vr camera should compensate the distortion of the lens or not.
         */
        this.compensateDistortion = true;
        /**
         * Defines if multiview should be enabled when rendering (Default: false)
         */
        this.multiviewEnabled = false;
    }
    /**
     * Gets the rendering aspect ratio based on the provided resolutions.
     */
    get aspectRatio() {
        return this.hResolution / (2 * this.vResolution);
    }
    /**
     * Gets the aspect ratio based on the FOV, scale factors, and real screen sizes.
     */
    get aspectRatioFov() {
        return 2 * Math.atan((this.postProcessScaleFactor * this.vScreenSize) / (2 * this.eyeToScreenDistance));
    }
    /**
     * @internal
     */
    get leftHMatrix() {
        const meters = this.hScreenSize / 4 - this.lensSeparationDistance / 2;
        const h = (4 * meters) / this.hScreenSize;
        return math_vector/* Matrix */.uq.Translation(h, 0, 0);
    }
    /**
     * @internal
     */
    get rightHMatrix() {
        const meters = this.hScreenSize / 4 - this.lensSeparationDistance / 2;
        const h = (4 * meters) / this.hScreenSize;
        return math_vector/* Matrix */.uq.Translation(-h, 0, 0);
    }
    /**
     * @internal
     */
    get leftPreViewMatrix() {
        return math_vector/* Matrix */.uq.Translation(0.5 * this.interpupillaryDistance, 0, 0);
    }
    /**
     * @internal
     */
    get rightPreViewMatrix() {
        return math_vector/* Matrix */.uq.Translation(-0.5 * this.interpupillaryDistance, 0, 0);
    }
    /**
     * Get the default VRMetrics based on the most generic setup.
     * @returns the default vr metrics
     */
    static GetDefault() {
        const result = new VRCameraMetrics();
        result.hResolution = 1280;
        result.vResolution = 800;
        result.hScreenSize = 0.149759993;
        result.vScreenSize = 0.0935999975;
        result.vScreenCenter = 0.0467999987;
        result.eyeToScreenDistance = 0.0410000011;
        result.lensSeparationDistance = 0.063500002;
        result.interpupillaryDistance = 0.064000003;
        result.distortionK = [1.0, 0.219999999, 0.239999995, 0.0];
        result.chromaAbCorrection = [0.995999992, -0.00400000019, 1.01400006, 0.0];
        result.postProcessScaleFactor = 1.714605507808412;
        result.lensCenterOffset = 0.151976421;
        return result;
    }
}
//# sourceMappingURL=vrCameraMetrics.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/vrDistortionCorrectionPostProcess.js



/**
 * VRDistortionCorrectionPostProcess used for mobile VR
 */
class VRDistortionCorrectionPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "VRDistortionCorrectionPostProcess" string
     */
    getClassName() {
        return "VRDistortionCorrectionPostProcess";
    }
    /**
     * Initializes the VRDistortionCorrectionPostProcess
     * @param name The name of the effect.
     * @param camera The camera to apply the render pass to.
     * @param isRightEye If this is for the right eye distortion
     * @param vrMetrics All the required metrics for the VR camera
     */
    constructor(name, camera, isRightEye, vrMetrics) {
        super(name, "vrDistortionCorrection", ["LensCenter", "Scale", "ScaleIn", "HmdWarpParam"], null, vrMetrics.postProcessScaleFactor, camera, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE);
        this._isRightEye = isRightEye;
        this._distortionFactors = vrMetrics.distortionK;
        this._postProcessScaleFactor = vrMetrics.postProcessScaleFactor;
        this._lensCenterOffset = vrMetrics.lensCenterOffset;
        this.adaptScaleToCurrentViewport = true;
        this.onSizeChangedObservable.add(() => {
            this._scaleIn = new math_vector/* Vector2 */.I9(2, 2 / this.aspectRatio);
            this._scaleFactor = new math_vector/* Vector2 */.I9(0.5 * (1 / this._postProcessScaleFactor), 0.5 * (1 / this._postProcessScaleFactor) * this.aspectRatio);
            this._lensCenter = new math_vector/* Vector2 */.I9(this._isRightEye ? 0.5 - this._lensCenterOffset * 0.5 : 0.5 + this._lensCenterOffset * 0.5, 0.5);
        });
        this.onApplyObservable.add((effect) => {
            effect.setFloat2("LensCenter", this._lensCenter.x, this._lensCenter.y);
            effect.setFloat2("Scale", this._scaleFactor.x, this._scaleFactor.y);
            effect.setFloat2("ScaleIn", this._scaleIn.x, this._scaleIn.y);
            effect.setFloat4("HmdWarpParam", this._distortionFactors[0], this._distortionFactors[1], this._distortionFactors[2], this._distortionFactors[3]);
        });
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 57811)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 21830)));
        }
        super._gatherImports(useWebGPU, list);
    }
}
//# sourceMappingURL=vrDistortionCorrectionPostProcess.js.map
;// ./node_modules/@babylonjs/core/Shaders/vrMultiviewToSingleview.fragment.js
// Do not edit.

const vrMultiviewToSingleview_fragment_name = "vrMultiviewToSingleviewPixelShader";
const vrMultiviewToSingleview_fragment_shader = `precision mediump sampler2DArray;varying vec2 vUV;uniform sampler2DArray multiviewSampler;uniform int imageIndex;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{gl_FragColor=texture2D(multiviewSampler,vec3(vUV,imageIndex));}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[vrMultiviewToSingleview_fragment_name] = vrMultiviewToSingleview_fragment_shader;
/** @internal */
const vrMultiviewToSingleviewPixelShader = { name: vrMultiviewToSingleview_fragment_name, shader: vrMultiviewToSingleview_fragment_shader };
//# sourceMappingURL=vrMultiviewToSingleview.fragment.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engine.js
var Engines_engine = __webpack_require__(93856);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/internalTexture.js
var Textures_internalTexture = __webpack_require__(81194);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/uniformBuffer.js
var uniformBuffer = __webpack_require__(80935);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.js
var Textures_renderTargetTexture = __webpack_require__(75474);
;// ./node_modules/@babylonjs/core/Materials/Textures/MultiviewRenderTarget.js


/**
 * Renders to multiple views with a single draw call
 * Only for WebGL backends
 * @see https://www.khronos.org/registry/webgl/extensions/OVR_multiview2/
 */
class MultiviewRenderTarget extends Textures_renderTargetTexture/* RenderTargetTexture */.$ {
    set samples(value) {
        // We override this setter because multisampling is handled by framebufferTextureMultisampleMultiviewOVR
        this._samples = value;
    }
    get samples() {
        return this._samples;
    }
    /**
     * Creates a multiview render target
     * @param scene scene used with the render target
     * @param size the size of the render target (used for each view)
     */
    constructor(scene, size = 512) {
        super("multiview rtt", size, scene, false, true, 0, false, undefined, false, false, true, undefined, true);
        this._renderTarget = this.getScene().getEngine().createMultiviewRenderTargetTexture(this.getRenderWidth(), this.getRenderHeight());
        this._texture = this._renderTarget.texture;
        this._texture.isMultiview = true;
        this._texture.format = 5;
        this.samples = this._getEngine().getCaps().maxSamples || this.samples;
        this._texture.samples = this._samples;
    }
    /**
     * @internal
     */
    _bindFrameBuffer() {
        if (!this._renderTarget) {
            return;
        }
        this.getScene().getEngine().bindMultiviewFramebuffer(this._renderTarget);
    }
    /**
     * Gets the number of views the corresponding to the texture (eg. a MultiviewRenderTarget will have > 1)
     * @returns the view count
     */
    getViewCount() {
        return 2;
    }
}
//# sourceMappingURL=MultiviewRenderTarget.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.frustum.js
var math_frustum = __webpack_require__(22572);
;// ./node_modules/@babylonjs/core/Engines/Extensions/engine.multiview.js








Engines_engine/* Engine */.N.prototype.createMultiviewRenderTargetTexture = function (width, height, colorTexture, depthStencilTexture) {
    const gl = this._gl;
    if (!this.getCaps().multiview) {
        // eslint-disable-next-line no-throw-literal
        throw "Multiview is not supported";
    }
    const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, { width, height });
    rtWrapper._framebuffer = gl.createFramebuffer();
    const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(this, 0 /* InternalTextureSource.Unknown */, true);
    internalTexture.width = width;
    internalTexture.height = height;
    internalTexture.isMultiview = true;
    if (!colorTexture) {
        colorTexture = gl.createTexture();
        gl.bindTexture(gl.TEXTURE_2D_ARRAY, colorTexture);
        gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.RGBA8, width, height, 2);
    }
    rtWrapper._colorTextureArray = colorTexture;
    if (!depthStencilTexture) {
        depthStencilTexture = gl.createTexture();
        gl.bindTexture(gl.TEXTURE_2D_ARRAY, depthStencilTexture);
        gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.DEPTH24_STENCIL8, width, height, 2);
    }
    rtWrapper._depthStencilTextureArray = depthStencilTexture;
    internalTexture.isReady = true;
    rtWrapper.setTextures(internalTexture);
    rtWrapper._depthStencilTexture = internalTexture;
    return rtWrapper;
};
Engines_engine/* Engine */.N.prototype.bindMultiviewFramebuffer = function (_multiviewTexture) {
    const multiviewTexture = _multiviewTexture;
    const gl = this._gl;
    const ext = this.getCaps().oculusMultiview || this.getCaps().multiview;
    this.bindFramebuffer(multiviewTexture, undefined, undefined, undefined, true);
    gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, multiviewTexture._framebuffer);
    if (multiviewTexture._colorTextureArray && multiviewTexture._depthStencilTextureArray) {
        if (this.getCaps().oculusMultiview) {
            ext.framebufferTextureMultisampleMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, multiviewTexture._colorTextureArray, 0, multiviewTexture.samples, 0, 2);
            ext.framebufferTextureMultisampleMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, multiviewTexture._depthStencilTextureArray, 0, multiviewTexture.samples, 0, 2);
        }
        else {
            ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, multiviewTexture._colorTextureArray, 0, 0, 2);
            ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, multiviewTexture._depthStencilTextureArray, 0, 0, 2);
        }
    }
    else {
        // eslint-disable-next-line no-throw-literal
        throw "Invalid multiview frame buffer";
    }
};
Engines_engine/* Engine */.N.prototype.bindSpaceWarpFramebuffer = function (_spaceWarpTexture) {
    const spaceWarpTexture = _spaceWarpTexture;
    const gl = this._gl;
    const ext = this.getCaps().oculusMultiview || this.getCaps().multiview;
    this.bindFramebuffer(spaceWarpTexture, undefined, undefined, undefined, true);
    gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, spaceWarpTexture._framebuffer);
    if (spaceWarpTexture._colorTextureArray && spaceWarpTexture._depthStencilTextureArray) {
        ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, spaceWarpTexture._colorTextureArray, 0, 0, 2);
        ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_ATTACHMENT, spaceWarpTexture._depthStencilTextureArray, 0, 0, 2);
    }
    else {
        throw new Error("Invalid Space Warp framebuffer");
    }
};
Cameras_camera/* Camera */.i.prototype._useMultiviewToSingleView = false;
Cameras_camera/* Camera */.i.prototype._multiviewTexture = null;
Cameras_camera/* Camera */.i.prototype._resizeOrCreateMultiviewTexture = function (width, height) {
    if (!this._multiviewTexture) {
        this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height });
    }
    else if (this._multiviewTexture.getRenderWidth() != width || this._multiviewTexture.getRenderHeight() != height) {
        this._multiviewTexture.dispose();
        this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height });
    }
};
function createMultiviewUbo(engine, name) {
    const ubo = new uniformBuffer/* UniformBuffer */.D(engine, undefined, true, name);
    ubo.addUniform("viewProjection", 16);
    ubo.addUniform("viewProjectionR", 16);
    ubo.addUniform("view", 16);
    ubo.addUniform("projection", 16);
    ubo.addUniform("vEyePosition", 4);
    return ubo;
}
const currentCreateSceneUniformBuffer = core_scene/* Scene */.Z.prototype.createSceneUniformBuffer;
core_scene/* Scene */.Z.prototype._transformMatrixR = math_vector/* Matrix */.uq.Zero();
core_scene/* Scene */.Z.prototype._multiviewSceneUbo = null;
core_scene/* Scene */.Z.prototype._createMultiviewUbo = function () {
    this._multiviewSceneUbo = createMultiviewUbo(this.getEngine(), "scene_multiview");
};
core_scene/* Scene */.Z.prototype.createSceneUniformBuffer = function (name) {
    if (this._multiviewSceneUbo) {
        return createMultiviewUbo(this.getEngine(), name);
    }
    return currentCreateSceneUniformBuffer.bind(this)(name);
};
core_scene/* Scene */.Z.prototype._updateMultiviewUbo = function (viewR, projectionR) {
    if (viewR && projectionR) {
        viewR.multiplyToRef(projectionR, this._transformMatrixR);
    }
    if (viewR && projectionR) {
        viewR.multiplyToRef(projectionR, math_vector/* TmpVectors */.AA.Matrix[0]);
        math_frustum/* Frustum */.P.GetRightPlaneToRef(math_vector/* TmpVectors */.AA.Matrix[0], this._frustumPlanes[3]); // Replace right plane by second camera right plane
    }
    if (this._multiviewSceneUbo) {
        this._multiviewSceneUbo.updateMatrix("viewProjection", this.getTransformMatrix());
        this._multiviewSceneUbo.updateMatrix("viewProjectionR", this._transformMatrixR);
        this._multiviewSceneUbo.updateMatrix("view", this._viewMatrix);
        this._multiviewSceneUbo.updateMatrix("projection", this._projectionMatrix);
    }
};
core_scene/* Scene */.Z.prototype._renderMultiviewToSingleView = function (camera) {
    // Multiview is only able to be displayed directly for API's such as webXR
    // This displays a multiview image by rendering to the multiview image and then
    // copying the result into the sub cameras instead of rendering them and proceeding as normal from there
    // Render to a multiview texture
    camera._resizeOrCreateMultiviewTexture(camera._rigPostProcess && camera._rigPostProcess && camera._rigPostProcess.width > 0 ? camera._rigPostProcess.width : this.getEngine().getRenderWidth(true), camera._rigPostProcess && camera._rigPostProcess && camera._rigPostProcess.height > 0 ? camera._rigPostProcess.height : this.getEngine().getRenderHeight(true));
    if (!this._multiviewSceneUbo) {
        this._createMultiviewUbo();
    }
    camera.outputRenderTarget = camera._multiviewTexture;
    this._renderForCamera(camera);
    camera.outputRenderTarget = null;
    // Consume the multiview texture through a shader for each eye
    for (let index = 0; index < camera._rigCameras.length; index++) {
        const engine = this.getEngine();
        this._activeCamera = camera._rigCameras[index];
        engine.setViewport(this._activeCamera.viewport);
        if (this.postProcessManager) {
            this.postProcessManager._prepareFrame();
            this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate);
        }
    }
};
//# sourceMappingURL=engine.multiview.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/vrMultiviewToSingleviewPostProcess.js




/**
 * VRMultiviewToSingleview used to convert multiview texture arrays to standard textures for scenarios such as webVR
 * This will not be used for webXR as it supports displaying texture arrays directly
 */
class VRMultiviewToSingleviewPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "VRMultiviewToSingleviewPostProcess" string
     */
    getClassName() {
        return "VRMultiviewToSingleviewPostProcess";
    }
    /**
     * Initializes a VRMultiviewToSingleview
     * @param name name of the post process
     * @param camera camera to be applied to
     * @param scaleFactor scaling factor to the size of the output texture
     */
    constructor(name, camera, scaleFactor) {
        super(name, "vrMultiviewToSingleview", ["imageIndex"], ["multiviewSampler"], scaleFactor, camera, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE);
        const cam = camera ?? this.getCamera();
        this.onSizeChangedObservable.add(() => { });
        this.onApplyObservable.add((effect) => {
            if (cam._scene.activeCamera && cam._scene.activeCamera.isLeftCamera) {
                effect.setInt("imageIndex", 0);
            }
            else {
                effect.setInt("imageIndex", 1);
            }
            effect.setTexture("multiviewSampler", cam._multiviewTexture);
        });
    }
}
//# sourceMappingURL=vrMultiviewToSingleviewPostProcess.js.map
;// ./node_modules/@babylonjs/core/Cameras/RigModes/vrRigMode.js






/**
 * @internal
 */
function setVRRigMode(camera, rigParams) {
    const metrics = rigParams.vrCameraMetrics || VRCameraMetrics.GetDefault();
    camera._rigCameras[0]._cameraRigParams.vrMetrics = metrics;
    camera._rigCameras[0].viewport = new math_viewport/* Viewport */.L(0, 0, 0.5, 1.0);
    camera._rigCameras[0]._cameraRigParams.vrWorkMatrix = new math_vector/* Matrix */.uq();
    camera._rigCameras[0]._cameraRigParams.vrHMatrix = metrics.leftHMatrix;
    camera._rigCameras[0]._cameraRigParams.vrPreViewMatrix = metrics.leftPreViewMatrix;
    camera._rigCameras[0].getProjectionMatrix = camera._rigCameras[0]._getVRProjectionMatrix;
    camera._rigCameras[1]._cameraRigParams.vrMetrics = metrics;
    camera._rigCameras[1].viewport = new math_viewport/* Viewport */.L(0.5, 0, 0.5, 1.0);
    camera._rigCameras[1]._cameraRigParams.vrWorkMatrix = new math_vector/* Matrix */.uq();
    camera._rigCameras[1]._cameraRigParams.vrHMatrix = metrics.rightHMatrix;
    camera._rigCameras[1]._cameraRigParams.vrPreViewMatrix = metrics.rightPreViewMatrix;
    camera._rigCameras[1].getProjectionMatrix = camera._rigCameras[1]._getVRProjectionMatrix;
    // For multiview camera
    // First multiview will be rendered to camera._multiviewTexture
    // Then this postprocess will run on each eye to copy the right texture to each eye
    if (metrics.multiviewEnabled) {
        if (!camera.getScene().getEngine().getCaps().multiview) {
            logger/* Logger */.V.Warn("Multiview is not supported, falling back to standard rendering");
            metrics.multiviewEnabled = false;
        }
        else {
            camera._useMultiviewToSingleView = true;
            camera._rigPostProcess = new VRMultiviewToSingleviewPostProcess("VRMultiviewToSingleview", camera, metrics.postProcessScaleFactor);
        }
    }
    if (metrics.compensateDistortion) {
        camera._rigCameras[0]._rigPostProcess = new VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left", camera._rigCameras[0], false, metrics);
        camera._rigCameras[1]._rigPostProcess = new VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right", camera._rigCameras[1], true, metrics);
    }
}
//# sourceMappingURL=vrRigMode.js.map
;// ./node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationArcRotateCamera.js







node/* Node */.b.AddNodeConstructor("VRDeviceOrientationArcRotateCamera", (name, scene) => {
    return () => new VRDeviceOrientationArcRotateCamera(name, 0, 0, 1.0, math_vector/* Vector3 */.Pq.Zero(), scene);
});
/**
 * Camera used to simulate VR rendering (based on ArcRotateCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#vr-device-orientation-cameras
 */
class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {
    /**
     * Creates a new VRDeviceOrientationArcRotateCamera
     * @param name defines camera name
     * @param alpha defines the camera rotation along the longitudinal axis
     * @param beta defines the camera rotation along the latitudinal axis
     * @param radius defines the camera distance from its target
     * @param target defines the camera target
     * @param scene defines the scene the camera belongs to
     * @param compensateDistortion defines if the camera needs to compensate the lens distortion
     * @param vrCameraMetrics defines the vr metrics associated to the camera
     */
    constructor(name, alpha, beta, radius, target, scene, compensateDistortion = true, vrCameraMetrics = VRCameraMetrics.GetDefault()) {
        super(name, alpha, beta, radius, target, scene);
        this._setRigMode = (rigParams) => setVRRigMode(this, rigParams);
        vrCameraMetrics.compensateDistortion = compensateDistortion;
        this.setCameraRigMode(Cameras_camera/* Camera */.i.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics });
        this.inputs.addVRDeviceOrientation();
    }
    /**
     * Gets camera class name
     * @returns VRDeviceOrientationArcRotateCamera
     */
    getClassName() {
        return "VRDeviceOrientationArcRotateCamera";
    }
}
//# sourceMappingURL=vrDeviceOrientationArcRotateCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationFreeCamera.js






node/* Node */.b.AddNodeConstructor("VRDeviceOrientationFreeCamera", (name, scene) => {
    return () => new VRDeviceOrientationFreeCamera(name, math_vector/* Vector3 */.Pq.Zero(), scene);
});
/**
 * Camera used to simulate VR rendering (based on FreeCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#vr-device-orientation-cameras
 */
class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera {
    /**
     * Creates a new VRDeviceOrientationFreeCamera
     * @param name defines camera name
     * @param position defines the start position of the camera
     * @param scene defines the scene the camera belongs to
     * @param compensateDistortion defines if the camera needs to compensate the lens distortion
     * @param vrCameraMetrics defines the vr metrics associated to the camera
     */
    constructor(name, position, scene, compensateDistortion = true, vrCameraMetrics = VRCameraMetrics.GetDefault()) {
        super(name, position, scene);
        this._setRigMode = (rigParams) => setVRRigMode(this, rigParams);
        vrCameraMetrics.compensateDistortion = compensateDistortion;
        this.setCameraRigMode(Cameras_camera/* Camera */.i.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics });
    }
    /**
     * Gets camera class name
     * @returns VRDeviceOrientationFreeCamera
     */
    getClassName() {
        return "VRDeviceOrientationFreeCamera";
    }
}
//# sourceMappingURL=vrDeviceOrientationFreeCamera.js.map
;// ./node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationGamepadCamera.js






node/* Node */.b.AddNodeConstructor("VRDeviceOrientationGamepadCamera", (name, scene) => {
    return () => new VRDeviceOrientationGamepadCamera(name, math_vector/* Vector3 */.Pq.Zero(), scene);
});
/**
 * Camera used to simulate VR rendering (based on VRDeviceOrientationFreeCamera)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#vr-device-orientation-cameras
 */
class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCamera {
    /**
     * Creates a new VRDeviceOrientationGamepadCamera
     * @param name defines camera name
     * @param position defines the start position of the camera
     * @param scene defines the scene the camera belongs to
     * @param compensateDistortion defines if the camera needs to compensate the lens distortion
     * @param vrCameraMetrics defines the vr metrics associated to the camera
     */
    constructor(name, position, scene, compensateDistortion = true, vrCameraMetrics = VRCameraMetrics.GetDefault()) {
        super(name, position, scene, compensateDistortion, vrCameraMetrics);
        this._setRigMode = (rigParams) => setVRRigMode(this, rigParams);
        this.inputs.addGamepad();
    }
    /**
     * Gets camera class name
     * @returns VRDeviceOrientationGamepadCamera
     */
    getClassName() {
        return "VRDeviceOrientationGamepadCamera";
    }
}
//# sourceMappingURL=vrDeviceOrientationGamepadCamera.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/ray.js
var Culling_ray = __webpack_require__(86919);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js
var Materials_imageProcessingConfiguration = __webpack_require__(32033);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/standardMaterial.js
var standardMaterial = __webpack_require__(2093);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/dynamicTexture.js
var Textures_dynamicTexture = __webpack_require__(47532);
;// ./node_modules/@babylonjs/core/XR/webXRLayerWrapper.js
/**
 * Wrapper over subclasses of XRLayer.
 * @internal
 */
class WebXRLayerWrapper {
    /**
     * Check if fixed foveation is supported on this device
     */
    get isFixedFoveationSupported() {
        return this.layerType == "XRWebGLLayer" && typeof this.layer.fixedFoveation == "number";
    }
    /**
     * Get the fixed foveation currently set, as specified by the webxr specs
     * If this returns null, then fixed foveation is not supported
     */
    get fixedFoveation() {
        if (this.isFixedFoveationSupported) {
            return this.layer.fixedFoveation;
        }
        return null;
    }
    /**
     * Set the fixed foveation to the specified value, as specified by the webxr specs
     * This value will be normalized to be between 0 and 1, 1 being max foveation, 0 being no foveation
     */
    set fixedFoveation(value) {
        if (this.isFixedFoveationSupported) {
            const val = Math.max(0, Math.min(1, value || 0));
            this.layer.fixedFoveation = val;
        }
    }
    /**
     * Create a render target provider for the wrapped layer.
     * @param xrSessionManager The XR Session Manager
     * @returns A new render target texture provider for the wrapped layer.
     */
    createRenderTargetTextureProvider(xrSessionManager) {
        this._rttWrapper = this._createRenderTargetTextureProvider(xrSessionManager);
        return this._rttWrapper;
    }
    dispose() {
        if (this._rttWrapper) {
            this._rttWrapper.dispose();
            this._rttWrapper = null;
        }
    }
    constructor(
    /** The width of the layer's framebuffer. */
    getWidth, 
    /** The height of the layer's framebuffer. */
    getHeight, 
    /** The XR layer that this WebXRLayerWrapper wraps. */
    layer, 
    /** The type of XR layer that is being wrapped. */
    layerType, 
    /** Create a render target provider for the wrapped layer. */
    _createRenderTargetTextureProvider) {
        this.getWidth = getWidth;
        this.getHeight = getHeight;
        this.layer = layer;
        this.layerType = layerType;
        this._createRenderTargetTextureProvider = _createRenderTargetTextureProvider;
        this._rttWrapper = null;
    }
}
//# sourceMappingURL=webXRLayerWrapper.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.js
var webGLHardwareTexture = __webpack_require__(67716);
;// ./node_modules/@babylonjs/core/XR/webXRRenderTargetTextureProvider.js




/**
 * Provides render target textures and other important rendering information for a given XRLayer.
 * @internal
 */
class WebXRLayerRenderTargetTextureProvider {
    constructor(_scene, layerWrapper) {
        this._scene = _scene;
        this.layerWrapper = layerWrapper;
        this._renderTargetTextures = new Array();
        this._engine = _scene.getEngine();
    }
    _createInternalTexture(textureSize, texture) {
        const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(this._engine, 0 /* InternalTextureSource.Unknown */, true);
        internalTexture.width = textureSize.width;
        internalTexture.height = textureSize.height;
        internalTexture._hardwareTexture = new webGLHardwareTexture/* WebGLHardwareTexture */.d(texture, this._engine._gl);
        internalTexture.isReady = true;
        return internalTexture;
    }
    _createRenderTargetTexture(width, height, framebuffer, colorTexture, depthStencilTexture, multiview) {
        if (!this._engine) {
            throw new Error("Engine is disposed");
        }
        const textureSize = { width, height };
        // Create render target texture from the internal texture
        const renderTargetTexture = multiview ? new MultiviewRenderTarget(this._scene, textureSize) : new Textures_renderTargetTexture/* RenderTargetTexture */.$("XR renderTargetTexture", textureSize, this._scene);
        const renderTargetWrapper = renderTargetTexture.renderTarget;
        renderTargetWrapper._samples = renderTargetTexture.samples;
        // Set the framebuffer, make sure it works in all scenarios - emulator, no layers and layers
        if (framebuffer || !colorTexture) {
            renderTargetWrapper._framebuffer = framebuffer;
        }
        // Create internal texture
        if (colorTexture) {
            if (multiview) {
                renderTargetWrapper._colorTextureArray = colorTexture;
            }
            else {
                const internalTexture = this._createInternalTexture(textureSize, colorTexture);
                renderTargetWrapper.setTexture(internalTexture, 0);
                renderTargetTexture._texture = internalTexture;
            }
        }
        if (depthStencilTexture) {
            if (multiview) {
                renderTargetWrapper._depthStencilTextureArray = depthStencilTexture;
            }
            else {
                renderTargetWrapper._depthStencilTexture = this._createInternalTexture(textureSize, depthStencilTexture);
            }
        }
        renderTargetTexture.disableRescaling();
        this._renderTargetTextures.push(renderTargetTexture);
        return renderTargetTexture;
    }
    _destroyRenderTargetTexture(renderTargetTexture) {
        this._renderTargetTextures.splice(this._renderTargetTextures.indexOf(renderTargetTexture), 1);
        renderTargetTexture.dispose();
    }
    getFramebufferDimensions() {
        return this._framebufferDimensions;
    }
    dispose() {
        this._renderTargetTextures.forEach((rtt) => rtt.dispose());
        this._renderTargetTextures.length = 0;
    }
}
//# sourceMappingURL=webXRRenderTargetTextureProvider.js.map
;// ./node_modules/@babylonjs/core/XR/webXRWebGLLayer.js


/**
 * Wraps xr webgl layers.
 * @internal
 */
class WebXRWebGLLayerWrapper extends WebXRLayerWrapper {
    /**
     * @param layer is the layer to be wrapped.
     * @returns a new WebXRLayerWrapper wrapping the provided XRWebGLLayer.
     */
    constructor(layer) {
        super(() => layer.framebufferWidth, () => layer.framebufferHeight, layer, "XRWebGLLayer", (sessionManager) => new WebXRWebGLLayerRenderTargetTextureProvider(sessionManager.scene, this));
        this.layer = layer;
    }
}
/**
 * Provides render target textures and other important rendering information for a given XRWebGLLayer.
 * @internal
 */
class WebXRWebGLLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetTextureProvider {
    constructor(scene, layerWrapper) {
        super(scene, layerWrapper);
        this.layerWrapper = layerWrapper;
        this._layer = layerWrapper.layer;
        this._framebufferDimensions = {
            framebufferWidth: this._layer.framebufferWidth,
            framebufferHeight: this._layer.framebufferHeight,
        };
    }
    trySetViewportForView(viewport, view) {
        const xrViewport = this._layer.getViewport(view);
        if (!xrViewport) {
            return false;
        }
        const framebufferWidth = this._framebufferDimensions.framebufferWidth;
        const framebufferHeight = this._framebufferDimensions.framebufferHeight;
        viewport.x = xrViewport.x / framebufferWidth;
        viewport.y = xrViewport.y / framebufferHeight;
        viewport.width = xrViewport.width / framebufferWidth;
        viewport.height = xrViewport.height / framebufferHeight;
        return true;
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    getRenderTargetTextureForEye(eye) {
        const layerWidth = this._layer.framebufferWidth;
        const layerHeight = this._layer.framebufferHeight;
        const framebuffer = this._layer.framebuffer;
        if (!this._rtt ||
            layerWidth !== this._framebufferDimensions.framebufferWidth ||
            layerHeight !== this._framebufferDimensions.framebufferHeight ||
            framebuffer !== this._framebuffer) {
            this._rtt = this._createRenderTargetTexture(layerWidth, layerHeight, framebuffer);
            this._framebufferDimensions.framebufferWidth = layerWidth;
            this._framebufferDimensions.framebufferHeight = layerHeight;
            this._framebuffer = framebuffer;
        }
        return this._rtt;
    }
    getRenderTargetTextureForView(view) {
        return this.getRenderTargetTextureForEye(view.eye);
    }
}
//# sourceMappingURL=webXRWebGLLayer.js.map
;// ./node_modules/@babylonjs/core/XR/webXRManagedOutputCanvas.js



/**
 * Configuration object for WebXR output canvas
 */
class WebXRManagedOutputCanvasOptions {
    /**
     * Get the default values of the configuration object
     * @param engine defines the engine to use (can be null)
     * @returns default values of this configuration object
     */
    static GetDefaults(engine) {
        const defaults = new WebXRManagedOutputCanvasOptions();
        defaults.canvasOptions = {
            antialias: true,
            depth: true,
            stencil: engine ? engine.isStencilEnable : true,
            alpha: true,
            framebufferScaleFactor: 1,
        };
        defaults.newCanvasCssStyle = "position:absolute; bottom:0px;right:0px;z-index:10;width:90%;height:100%;background-color: #000000;";
        return defaults;
    }
}
/**
 * Creates a canvas that is added/removed from the webpage when entering/exiting XR
 */
class WebXRManagedOutputCanvas {
    /**
     * Initializes the canvas to be added/removed upon entering/exiting xr
     * @param _xrSessionManager The XR Session manager
     * @param _options optional configuration for this canvas output. defaults will be used if not provided
     */
    constructor(_xrSessionManager, _options = WebXRManagedOutputCanvasOptions.GetDefaults()) {
        this._options = _options;
        this._canvas = null;
        this._engine = null;
        /**
         * xr layer for the canvas
         */
        this.xrLayer = null;
        this._xrLayerWrapper = null;
        /**
         * Observers registered here will be triggered when the xr layer was initialized
         */
        this.onXRLayerInitObservable = new Misc_observable/* Observable */.cP();
        this._engine = _xrSessionManager.scene.getEngine();
        this._engine.onDisposeObservable.addOnce(() => {
            this._engine = null;
        });
        if (!_options.canvasElement) {
            const canvas = document.createElement("canvas");
            canvas.style.cssText = this._options.newCanvasCssStyle || "position:absolute; bottom:0px;right:0px;";
            this._setManagedOutputCanvas(canvas);
        }
        else {
            this._setManagedOutputCanvas(_options.canvasElement);
        }
        _xrSessionManager.onXRSessionInit.add(() => {
            this._addCanvas();
        });
        _xrSessionManager.onXRSessionEnded.add(() => {
            this._removeCanvas();
        });
        this._makeCanvasCompatibleAsync();
    }
    /**
     * Disposes of the object
     */
    dispose() {
        this._removeCanvas();
        this._setManagedOutputCanvas(null);
        this.onXRLayerInitObservable.clear();
    }
    _makeCanvasCompatibleAsync() {
        this._canvasCompatiblePromise = new Promise((resolve, reject) => {
            // stay safe - make sure the context has the function
            try {
                if (this.canvasContext && this.canvasContext.makeXRCompatible) {
                    this.canvasContext.makeXRCompatible().then(() => {
                        resolve();
                    }, () => {
                        // fail silently
                        tools/* Tools */.S0.Warn("Error executing makeXRCompatible. This does not mean that the session will work incorrectly.");
                        resolve();
                    });
                }
                else {
                    resolve();
                }
            }
            catch (e) {
                // if this fails - the exception will be caught and the promise will be rejected
                reject(e);
            }
        });
    }
    /**
     * Initializes a XRWebGLLayer to be used as the session's baseLayer.
     * @param xrSession xr session
     * @returns a promise that will resolve once the XR Layer has been created
     */
    async initializeXRLayerAsync(xrSession) {
        const createLayer = () => {
            this.xrLayer = new XRWebGLLayer(xrSession, this.canvasContext, this._options.canvasOptions);
            this._xrLayerWrapper = new WebXRWebGLLayerWrapper(this.xrLayer);
            this.onXRLayerInitObservable.notifyObservers(this.xrLayer);
            return this.xrLayer;
        };
        return this._canvasCompatiblePromise
            .then(
        // catch any error and continue. When using the emulator is throws this error for no apparent reason.
        () => { }, () => { })
            .then(() => {
            return createLayer();
        });
    }
    _addCanvas() {
        if (this._canvas && this._engine && this._canvas !== this._engine.getRenderingCanvas()) {
            document.body.appendChild(this._canvas);
        }
        if (this.xrLayer) {
            this._setCanvasSize(true);
        }
        else {
            this.onXRLayerInitObservable.addOnce(() => {
                this._setCanvasSize(true);
            });
        }
    }
    _removeCanvas() {
        if (this._canvas && this._engine && document.body.contains(this._canvas) && this._canvas !== this._engine.getRenderingCanvas()) {
            document.body.removeChild(this._canvas);
        }
        this._setCanvasSize(false);
    }
    _setCanvasSize(init = true, xrLayer = this._xrLayerWrapper) {
        if (!this._canvas || !this._engine) {
            return;
        }
        if (init) {
            if (xrLayer) {
                if (this._canvas !== this._engine.getRenderingCanvas()) {
                    this._canvas.style.width = xrLayer.getWidth() + "px";
                    this._canvas.style.height = xrLayer.getHeight() + "px";
                }
                else {
                    this._engine.setSize(xrLayer.getWidth(), xrLayer.getHeight());
                }
            }
        }
        else {
            if (this._originalCanvasSize) {
                if (this._canvas !== this._engine.getRenderingCanvas()) {
                    this._canvas.style.width = this._originalCanvasSize.width + "px";
                    this._canvas.style.height = this._originalCanvasSize.height + "px";
                }
                else {
                    this._engine.setSize(this._originalCanvasSize.width, this._originalCanvasSize.height);
                }
            }
        }
    }
    _setManagedOutputCanvas(canvas) {
        this._removeCanvas();
        if (!canvas) {
            this._canvas = null;
            this.canvasContext = null;
        }
        else {
            this._originalCanvasSize = {
                width: canvas.offsetWidth,
                height: canvas.offsetHeight,
            };
            this._canvas = canvas;
            this.canvasContext = this._canvas.getContext("webgl2");
            if (!this.canvasContext) {
                this.canvasContext = this._canvas.getContext("webgl");
            }
        }
    }
}
//# sourceMappingURL=webXRManagedOutputCanvas.js.map
;// ./node_modules/@babylonjs/core/XR/native/nativeXRRenderTarget.js


/**
 * Wraps XRWebGLLayer's created by Babylon Native.
 * @internal
 */
class NativeXRLayerWrapper extends WebXRLayerWrapper {
    constructor(layer) {
        super(() => layer.framebufferWidth, () => layer.framebufferHeight, layer, "XRWebGLLayer", (sessionManager) => new NativeXRLayerRenderTargetTextureProvider(sessionManager, this));
        this.layer = layer;
    }
}
/**
 * Provides render target textures for layers created by Babylon Native.
 * @internal
 */
class NativeXRLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetTextureProvider {
    constructor(sessionManager, layerWrapper) {
        super(sessionManager.scene, layerWrapper);
        this.layerWrapper = layerWrapper;
        this._nativeRTTProvider = navigator.xr.getNativeRenderTargetProvider(sessionManager.session, this._createRenderTargetTexture.bind(this), this._destroyRenderTargetTexture.bind(this));
        this._nativeLayer = layerWrapper.layer;
    }
    trySetViewportForView(viewport) {
        viewport.x = 0;
        viewport.y = 0;
        viewport.width = 1;
        viewport.height = 1;
        return true;
    }
    getRenderTargetTextureForEye(eye) {
        // TODO (rgerd): Update the contract on the BabylonNative side to call this "getRenderTargetTextureForEye"
        return this._nativeRTTProvider.getRenderTargetForEye(eye);
    }
    getRenderTargetTextureForView(view) {
        return this._nativeRTTProvider.getRenderTargetForEye(view.eye);
    }
    getFramebufferDimensions() {
        return {
            framebufferWidth: this._nativeLayer.framebufferWidth,
            framebufferHeight: this._nativeLayer.framebufferHeight,
        };
    }
}
/**
 * Creates the xr layer that will be used as the xr session's base layer.
 * @internal
 */
class NativeXRRenderTarget {
    constructor(_xrSessionManager) {
        this._nativeRenderTarget = navigator.xr.getWebXRRenderTarget(_xrSessionManager.scene.getEngine());
    }
    async initializeXRLayerAsync(xrSession) {
        await this._nativeRenderTarget.initializeXRLayerAsync(xrSession);
        this.xrLayer = this._nativeRenderTarget.xrLayer;
        return this.xrLayer;
    }
    dispose() {
        /* empty */
    }
}
//# sourceMappingURL=nativeXRRenderTarget.js.map
;// ./node_modules/@babylonjs/core/XR/webXRSessionManager.js





/**
 * Manages an XRSession to work with Babylon's engine
 * @see https://doc.babylonjs.com/features/featuresDeepDive/webXR/webXRSessionManagers
 */
class WebXRSessionManager {
    /**
     * Scale factor to apply to all XR-related elements (camera, controllers)
     */
    get worldScalingFactor() {
        return this._worldScalingFactor;
    }
    set worldScalingFactor(value) {
        const oldValue = this._worldScalingFactor;
        this._worldScalingFactor = value;
        this.onWorldScaleFactorChangedObservable.notifyObservers({
            previousScaleFactor: oldValue,
            newScaleFactor: value,
        });
    }
    /**
     * Constructs a WebXRSessionManager, this must be initialized within a user action before usage
     * @param scene The scene which the session should be created for
     */
    constructor(
    /** The scene which the session should be created for */
    scene) {
        this.scene = scene;
        /** WebXR timestamp updated every frame */
        this.currentTimestamp = -1;
        /**
         * Used just in case of a failure to initialize an immersive session.
         * The viewer reference space is compensated using this height, creating a kind of "viewer-floor" reference space
         */
        this.defaultHeightCompensation = 1.7;
        /**
         * Fires every time a new xrFrame arrives which can be used to update the camera
         */
        this.onXRFrameObservable = new Misc_observable/* Observable */.cP();
        /**
         * Fires when the reference space changed
         */
        this.onXRReferenceSpaceChanged = new Misc_observable/* Observable */.cP();
        /**
         * Fires when the xr session is ended either by the device or manually done
         */
        this.onXRSessionEnded = new Misc_observable/* Observable */.cP();
        /**
         * Fires when the xr session is initialized: right after requestSession was called and returned with a successful result
         */
        this.onXRSessionInit = new Misc_observable/* Observable */.cP();
        /**
         * Fires when the xr reference space has been initialized
         */
        this.onXRReferenceSpaceInitialized = new Misc_observable/* Observable */.cP();
        /**
         * Fires when the session manager is rendering the first frame
         */
        this.onXRReady = new Misc_observable/* Observable */.cP();
        /**
         * Are we currently in the XR loop?
         */
        this.inXRFrameLoop = false;
        /**
         * Are we in an XR session?
         */
        this.inXRSession = false;
        this._worldScalingFactor = 1;
        /**
         * Observable raised when the world scale has changed
         */
        this.onWorldScaleFactorChangedObservable = new Misc_observable/* Observable */.cP(undefined, true);
        this._engine = scene.getEngine();
        this._onEngineDisposedObserver = this._engine.onDisposeObservable.addOnce(() => {
            this._engine = null;
        });
        scene.onDisposeObservable.addOnce(() => {
            this.dispose();
        });
    }
    /**
     * The current reference space used in this session. This reference space can constantly change!
     * It is mainly used to offset the camera's position.
     */
    get referenceSpace() {
        return this._referenceSpace;
    }
    /**
     * Set a new reference space and triggers the observable
     */
    set referenceSpace(newReferenceSpace) {
        this._referenceSpace = newReferenceSpace;
        this.onXRReferenceSpaceChanged.notifyObservers(this._referenceSpace);
    }
    /**
     * The mode for the managed XR session
     */
    get sessionMode() {
        return this._sessionMode;
    }
    /**
     * Disposes of the session manager
     * This should be called explicitly by the dev, if required.
     */
    dispose() {
        // disposing without leaving XR? Exit XR first
        if (this.inXRSession) {
            this.exitXRAsync();
        }
        this.onXRReady.clear();
        this.onXRFrameObservable.clear();
        this.onXRSessionEnded.clear();
        this.onXRReferenceSpaceChanged.clear();
        this.onXRSessionInit.clear();
        this.onWorldScaleFactorChangedObservable.clear();
        this._engine?.onDisposeObservable.remove(this._onEngineDisposedObserver);
        this._engine = null;
    }
    /**
     * Stops the xrSession and restores the render loop
     * @returns Promise which resolves after it exits XR
     */
    async exitXRAsync() {
        if (this.session && this.inXRSession) {
            this.inXRSession = false;
            try {
                return await this.session.end();
            }
            catch {
                logger/* Logger */.V.Warn("Could not end XR session.");
            }
        }
        return Promise.resolve();
    }
    /**
     * Attempts to set the framebuffer-size-normalized viewport to be rendered this frame for this view.
     * In the event of a failure, the supplied viewport is not updated.
     * @param viewport the viewport to which the view will be rendered
     * @param view the view for which to set the viewport
     * @returns whether the operation was successful
     */
    trySetViewportForView(viewport, view) {
        return this._baseLayerRTTProvider?.trySetViewportForView(viewport, view) || false;
    }
    /**
     * Gets the correct render target texture to be rendered this frame for this eye
     * @param eye the eye for which to get the render target
     * @returns the render target for the specified eye or null if not available
     */
    getRenderTargetTextureForEye(eye) {
        return this._baseLayerRTTProvider?.getRenderTargetTextureForEye(eye) || null;
    }
    /**
     * Gets the correct render target texture to be rendered this frame for this view
     * @param view the view for which to get the render target
     * @returns the render target for the specified view or null if not available
     */
    getRenderTargetTextureForView(view) {
        return this._baseLayerRTTProvider?.getRenderTargetTextureForView(view) || null;
    }
    /**
     * Creates a WebXRRenderTarget object for the XR session
     * @param options optional options to provide when creating a new render target
     * @returns a WebXR render target to which the session can render
     */
    getWebXRRenderTarget(options) {
        const engine = this.scene.getEngine();
        if (this._xrNavigator.xr.native) {
            return new NativeXRRenderTarget(this);
        }
        else {
            options = options || WebXRManagedOutputCanvasOptions.GetDefaults(engine);
            options.canvasElement = options.canvasElement || engine.getRenderingCanvas() || undefined;
            return new WebXRManagedOutputCanvas(this, options);
        }
    }
    /**
     * Initializes the manager
     * After initialization enterXR can be called to start an XR session
     * @returns Promise which resolves after it is initialized
     */
    initializeAsync() {
        // Check if the browser supports webXR
        this._xrNavigator = navigator;
        if (!this._xrNavigator.xr) {
            return Promise.reject("WebXR not available");
        }
        return Promise.resolve();
    }
    /**
     * Initializes an xr session
     * @param xrSessionMode mode to initialize
     * @param xrSessionInit defines optional and required values to pass to the session builder
     * @returns a promise which will resolve once the session has been initialized
     */
    initializeSessionAsync(xrSessionMode = "immersive-vr", xrSessionInit = {}) {
        return this._xrNavigator.xr.requestSession(xrSessionMode, xrSessionInit).then((session) => {
            this.session = session;
            this._sessionMode = xrSessionMode;
            this.inXRSession = true;
            this.onXRSessionInit.notifyObservers(session);
            // handle when the session is ended (By calling session.end or device ends its own session eg. pressing home button on phone)
            this.session.addEventListener("end", () => {
                this.inXRSession = false;
                // Notify frame observers
                this.onXRSessionEnded.notifyObservers(null);
                if (this._engine) {
                    // make sure dimensions object is restored
                    this._engine.framebufferDimensionsObject = null;
                    // Restore frame buffer to avoid clear on xr framebuffer after session end
                    this._engine.restoreDefaultFramebuffer();
                    // Need to restart render loop as after the session is ended the last request for new frame will never call callback
                    this._engine.customAnimationFrameRequester = null;
                    this._engine._renderLoop();
                }
                // Dispose render target textures.
                // Only dispose on native because we can't destroy opaque textures on browser.
                if (this.isNative) {
                    this._baseLayerRTTProvider?.dispose();
                }
                this._baseLayerRTTProvider = null;
                this._baseLayerWrapper = null;
            }, { once: true });
            return this.session;
        });
    }
    /**
     * Checks if a session would be supported for the creation options specified
     * @param sessionMode session mode to check if supported eg. immersive-vr
     * @returns A Promise that resolves to true if supported and false if not
     */
    isSessionSupportedAsync(sessionMode) {
        return WebXRSessionManager.IsSessionSupportedAsync(sessionMode);
    }
    /**
     * Resets the reference space to the one started the session
     */
    resetReferenceSpace() {
        this.referenceSpace = this.baseReferenceSpace;
    }
    /**
     * Starts rendering to the xr layer
     */
    runXRRenderLoop() {
        if (!this.inXRSession || !this._engine) {
            return;
        }
        // Tell the engine's render loop to be driven by the xr session's refresh rate and provide xr pose information
        this._engine.customAnimationFrameRequester = {
            requestAnimationFrame: (callback) => this.session.requestAnimationFrame(callback),
            renderFunction: (timestamp, xrFrame) => {
                if (!this.inXRSession || !this._engine) {
                    return;
                }
                // Store the XR frame and timestamp in the session manager
                this.currentFrame = xrFrame;
                this.currentTimestamp = timestamp;
                if (xrFrame) {
                    this.inXRFrameLoop = true;
                    const framebufferDimensionsObject = this._baseLayerRTTProvider?.getFramebufferDimensions() || null;
                    // equality can be tested as it should be the same object
                    if (this._engine.framebufferDimensionsObject !== framebufferDimensionsObject) {
                        this._engine.framebufferDimensionsObject = framebufferDimensionsObject;
                    }
                    this.onXRFrameObservable.notifyObservers(xrFrame);
                    this._engine._renderLoop();
                    this._engine.framebufferDimensionsObject = null;
                    this.inXRFrameLoop = false;
                }
            },
        };
        this._engine.framebufferDimensionsObject = this._baseLayerRTTProvider?.getFramebufferDimensions() || null;
        this.onXRFrameObservable.addOnce(() => {
            this.onXRReady.notifyObservers(this);
        });
        // Stop window's animation frame and trigger sessions animation frame
        if (typeof window !== "undefined" && window.cancelAnimationFrame) {
            window.cancelAnimationFrame(this._engine._frameHandler);
        }
        this._engine._renderLoop();
    }
    /**
     * Sets the reference space on the xr session
     * @param referenceSpaceType space to set
     * @returns a promise that will resolve once the reference space has been set
     */
    setReferenceSpaceTypeAsync(referenceSpaceType = "local-floor") {
        return this.session
            .requestReferenceSpace(referenceSpaceType)
            .then((referenceSpace) => {
            return referenceSpace;
        }, (rejectionReason) => {
            logger/* Logger */.V.Error("XR.requestReferenceSpace failed for the following reason: ");
            logger/* Logger */.V.Error(rejectionReason);
            logger/* Logger */.V.Log('Defaulting to universally-supported "viewer" reference space type.');
            return this.session.requestReferenceSpace("viewer").then((referenceSpace) => {
                const heightCompensation = new XRRigidTransform({ x: 0, y: -this.defaultHeightCompensation, z: 0 });
                return referenceSpace.getOffsetReferenceSpace(heightCompensation);
            }, (rejectionReason) => {
                logger/* Logger */.V.Error(rejectionReason);
                // eslint-disable-next-line no-throw-literal
                throw 'XR initialization failed: required "viewer" reference space type not supported.';
            });
        })
            .then((referenceSpace) => {
            // create viewer reference space before setting the first reference space
            return this.session.requestReferenceSpace("viewer").then((viewerReferenceSpace) => {
                this.viewerReferenceSpace = viewerReferenceSpace;
                return referenceSpace;
            });
        })
            .then((referenceSpace) => {
            // initialize the base and offset (currently the same)
            this.referenceSpace = this.baseReferenceSpace = referenceSpace;
            this.onXRReferenceSpaceInitialized.notifyObservers(referenceSpace);
            return this.referenceSpace;
        });
    }
    /**
     * Updates the render state of the session.
     * Note that this is deprecated in favor of WebXRSessionManager.updateRenderState().
     * @param state state to set
     * @returns a promise that resolves once the render state has been updated
     * @deprecated Use updateRenderState() instead.
     */
    updateRenderStateAsync(state) {
        return Promise.resolve(this.session.updateRenderState(state));
    }
    /**
     * @internal
     */
    _setBaseLayerWrapper(baseLayerWrapper) {
        if (this.isNative) {
            this._baseLayerRTTProvider?.dispose();
        }
        this._baseLayerWrapper = baseLayerWrapper;
        this._baseLayerRTTProvider = this._baseLayerWrapper?.createRenderTargetTextureProvider(this) || null;
    }
    /**
     * @internal
     */
    _getBaseLayerWrapper() {
        return this._baseLayerWrapper;
    }
    /**
     * Updates the render state of the session
     * @param state state to set
     */
    updateRenderState(state) {
        if (state.baseLayer) {
            this._setBaseLayerWrapper(this.isNative ? new NativeXRLayerWrapper(state.baseLayer) : new WebXRWebGLLayerWrapper(state.baseLayer));
        }
        this.session.updateRenderState(state);
    }
    /**
     * Returns a promise that resolves with a boolean indicating if the provided session mode is supported by this browser
     * @param sessionMode defines the session to test
     * @returns a promise with boolean as final value
     */
    static IsSessionSupportedAsync(sessionMode) {
        if (!navigator.xr) {
            return Promise.resolve(false);
        }
        // When the specs are final, remove supportsSession!
        const functionToUse = navigator.xr.isSessionSupported || navigator.xr.supportsSession;
        if (!functionToUse) {
            return Promise.resolve(false);
        }
        else {
            return functionToUse
                .call(navigator.xr, sessionMode)
                .then((result) => {
                const returnValue = typeof result === "undefined" ? true : result;
                return Promise.resolve(returnValue);
            })
                .catch((e) => {
                logger/* Logger */.V.Warn(e);
                return Promise.resolve(false);
            });
        }
    }
    /**
     * Returns true if Babylon.js is using the BabylonNative backend, otherwise false
     */
    get isNative() {
        return this._xrNavigator.xr.native ?? false;
    }
    /**
     * The current frame rate as reported by the device
     */
    get currentFrameRate() {
        return this.session?.frameRate;
    }
    /**
     * A list of supported frame rates (only available in-session!
     */
    get supportedFrameRates() {
        return this.session?.supportedFrameRates;
    }
    /**
     * Set the framerate of the session.
     * @param rate the new framerate. This value needs to be in the supportedFrameRates array
     * @returns a promise that resolves once the framerate has been set
     */
    updateTargetFrameRate(rate) {
        return this.session.updateTargetFrameRate(rate);
    }
    /**
     * Run a callback in the xr render loop
     * @param callback the callback to call when in XR Frame
     * @param ignoreIfNotInSession if no session is currently running, run it first thing on the next session
     */
    runInXRFrame(callback, ignoreIfNotInSession = true) {
        if (this.inXRFrameLoop) {
            callback();
        }
        else if (this.inXRSession || !ignoreIfNotInSession) {
            this.onXRFrameObservable.addOnce(callback);
        }
    }
    /**
     * Check if fixed foveation is supported on this device
     */
    get isFixedFoveationSupported() {
        return this._baseLayerWrapper?.isFixedFoveationSupported || false;
    }
    /**
     * Get the fixed foveation currently set, as specified by the webxr specs
     * If this returns null, then fixed foveation is not supported
     */
    get fixedFoveation() {
        return this._baseLayerWrapper?.fixedFoveation || null;
    }
    /**
     * Set the fixed foveation to the specified value, as specified by the webxr specs
     * This value will be normalized to be between 0 and 1, 1 being max foveation, 0 being no foveation
     */
    set fixedFoveation(value) {
        const val = Math.max(0, Math.min(1, value || 0));
        if (this._baseLayerWrapper) {
            this._baseLayerWrapper.fixedFoveation = val;
        }
    }
    /**
     * Get the features enabled on the current session
     * This is only available in-session!
     * @see https://www.w3.org/TR/webxr/#dom-xrsession-enabledfeatures
     */
    get enabledFeatures() {
        return this.session?.enabledFeatures ?? null;
    }
}
//# sourceMappingURL=webXRSessionManager.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/groundBuilder.js
var groundBuilder = __webpack_require__(66423);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/mesh.vertexData.js
var mesh_vertexData = __webpack_require__(36803);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Compat/compatibilityOptions.js
var compatibilityOptions = __webpack_require__(91313);
;// ./node_modules/@babylonjs/core/Meshes/Builders/torusBuilder.js




/**
 * Creates the VertexData for a torus
 * @param options an object used to set the following optional parameters for the box, required but can be empty
 * * diameter the diameter of the torus, optional default 1
 * * thickness the diameter of the tube forming the torus, optional default 0.5
 * * tessellation the number of prism sides, 3 for a triangular prism, optional, default 24
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @param options.diameter
 * @param options.thickness
 * @param options.tessellation
 * @param options.sideOrientation
 * @param options.frontUVs
 * @param options.backUVs
 * @returns the VertexData of the torus
 */
function CreateTorusVertexData(options) {
    const indices = [];
    const positions = [];
    const normals = [];
    const uvs = [];
    const diameter = options.diameter || 1;
    const thickness = options.thickness || 0.5;
    const tessellation = (options.tessellation || 16) | 0;
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    const stride = tessellation + 1;
    for (let i = 0; i <= tessellation; i++) {
        const u = i / tessellation;
        const outerAngle = (i * Math.PI * 2.0) / tessellation - Math.PI / 2.0;
        const transform = math_vector/* Matrix */.uq.Translation(diameter / 2.0, 0, 0).multiply(math_vector/* Matrix */.uq.RotationY(outerAngle));
        for (let j = 0; j <= tessellation; j++) {
            const v = 1 - j / tessellation;
            const innerAngle = (j * Math.PI * 2.0) / tessellation + Math.PI;
            const dx = Math.cos(innerAngle);
            const dy = Math.sin(innerAngle);
            // Create a vertex.
            let normal = new math_vector/* Vector3 */.Pq(dx, dy, 0);
            let position = normal.scale(thickness / 2);
            const textureCoordinate = new math_vector/* Vector2 */.I9(u, v);
            position = math_vector/* Vector3 */.Pq.TransformCoordinates(position, transform);
            normal = math_vector/* Vector3 */.Pq.TransformNormal(normal, transform);
            positions.push(position.x, position.y, position.z);
            normals.push(normal.x, normal.y, normal.z);
            uvs.push(textureCoordinate.x, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - textureCoordinate.y : textureCoordinate.y);
            // And create indices for two triangles.
            const nextI = (i + 1) % stride;
            const nextJ = (j + 1) % stride;
            indices.push(i * stride + j);
            indices.push(i * stride + nextJ);
            indices.push(nextI * stride + j);
            indices.push(i * stride + nextJ);
            indices.push(nextI * stride + nextJ);
            indices.push(nextI * stride + j);
        }
    }
    // Sides
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    // Result
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates a torus mesh
 * * The parameter `diameter` sets the diameter size (float) of the torus (default 1)
 * * The parameter `thickness` sets the diameter size of the tube of the torus (float, default 0.5)
 * * The parameter `tessellation` sets the number of torus sides (positive integer, default 16)
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param options.diameter
 * @param options.thickness
 * @param options.tessellation
 * @param options.updatable
 * @param options.sideOrientation
 * @param options.frontUVs
 * @param options.backUVs
 * @param scene defines the hosting scene
 * @returns the torus mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#torus
 */
function CreateTorus(name, options = {}, scene) {
    const torus = new Meshes_mesh/* Mesh */.e(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    torus._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateTorusVertexData(options);
    vertexData.applyToMesh(torus, options.updatable);
    return torus;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use CreateTorus instead
 */
const TorusBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateTorus,
};
mesh_vertexData/* VertexData */.P.CreateTorus = CreateTorusVertexData;
Meshes_mesh/* Mesh */.e.CreateTorus = (name, diameter, thickness, tessellation, scene, updatable, sideOrientation) => {
    const options = {
        diameter,
        thickness,
        tessellation,
        sideOrientation,
        updatable,
    };
    return CreateTorus(name, options, scene);
};
//# sourceMappingURL=torusBuilder.js.map
;// ./node_modules/@babylonjs/core/Cameras/VR/vrExperienceHelper.js





















class VRExperienceHelperGazer {
    constructor(scene, gazeTrackerToClone = null) {
        this.scene = scene;
        /** @internal */
        this._pointerDownOnMeshAsked = false;
        /** @internal */
        this._isActionableMesh = false;
        /** @internal */
        this._teleportationRequestInitiated = false;
        /** @internal */
        this._teleportationBackRequestInitiated = false;
        /** @internal */
        this._rotationRightAsked = false;
        /** @internal */
        this._rotationLeftAsked = false;
        /** @internal */
        this._dpadPressed = true;
        /** @internal */
        this._activePointer = false;
        this._id = VRExperienceHelperGazer._IdCounter++;
        // Gaze tracker
        if (!gazeTrackerToClone) {
            this._gazeTracker = CreateTorus("gazeTracker", {
                diameter: 0.0035,
                thickness: 0.0025,
                tessellation: 20,
                updatable: false,
            }, scene);
            this._gazeTracker.bakeCurrentTransformIntoVertices();
            this._gazeTracker.isPickable = false;
            this._gazeTracker.isVisible = false;
            const targetMat = new standardMaterial/* StandardMaterial */.F("targetMat", scene);
            targetMat.specularColor = math_color/* Color3 */.v9.Black();
            targetMat.emissiveColor = new math_color/* Color3 */.v9(0.7, 0.7, 0.7);
            targetMat.backFaceCulling = false;
            this._gazeTracker.material = targetMat;
        }
        else {
            this._gazeTracker = gazeTrackerToClone.clone("gazeTracker");
        }
    }
    /**
     * @internal
     */
    _getForwardRay(length) {
        return new Culling_ray/* Ray */.Rl(math_vector/* Vector3 */.Pq.Zero(), new math_vector/* Vector3 */.Pq(0, 0, length));
    }
    /** @internal */
    _selectionPointerDown() {
        this._pointerDownOnMeshAsked = true;
        if (this._currentHit) {
            this.scene.simulatePointerDown(this._currentHit, { pointerId: this._id });
        }
    }
    /** @internal */
    _selectionPointerUp() {
        if (this._currentHit) {
            this.scene.simulatePointerUp(this._currentHit, { pointerId: this._id });
        }
        this._pointerDownOnMeshAsked = false;
    }
    /** @internal */
    _activatePointer() {
        this._activePointer = true;
    }
    /** @internal */
    _deactivatePointer() {
        this._activePointer = false;
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _updatePointerDistance(distance = 100) { }
    dispose() {
        this._interactionsEnabled = false;
        this._teleportationEnabled = false;
        if (this._gazeTracker) {
            this._gazeTracker.dispose();
        }
    }
}
VRExperienceHelperGazer._IdCounter = 0;
class VRExperienceHelperCameraGazer extends VRExperienceHelperGazer {
    constructor(_getCamera, scene) {
        super(scene);
        this._getCamera = _getCamera;
    }
    _getForwardRay(length) {
        const camera = this._getCamera();
        if (camera) {
            return camera.getForwardRay(length);
        }
        else {
            return new Culling_ray/* Ray */.Rl(math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Forward());
        }
    }
}
/**
 * Event containing information after VR has been entered
 */
class OnAfterEnteringVRObservableEvent {
}
/**
 * Helps to quickly add VR support to an existing scene.
 * See https://doc.babylonjs.com/features/featuresDeepDive/cameras/webVRHelper
 * @deprecated Use WebXR instead!
 */
class VRExperienceHelper {
    /** Return this.onEnteringVRObservable
     * Note: This one is for backward compatibility. Please use onEnteringVRObservable directly
     */
    get onEnteringVR() {
        return this.onEnteringVRObservable;
    }
    /** Return this.onExitingVRObservable
     * Note: This one is for backward compatibility. Please use onExitingVRObservable directly
     */
    get onExitingVR() {
        return this.onExitingVRObservable;
    }
    /**
     * The mesh used to display where the user is going to teleport.
     */
    get teleportationTarget() {
        return this._teleportationTarget;
    }
    /**
     * Sets the mesh to be used to display where the user is going to teleport.
     */
    set teleportationTarget(value) {
        if (value) {
            value.name = "teleportationTarget";
            this._isDefaultTeleportationTarget = false;
            this._teleportationTarget = value;
        }
    }
    /**
     * The mesh used to display where the user is selecting, this mesh will be cloned and set as the gazeTracker for the left and right controller
     * when set bakeCurrentTransformIntoVertices will be called on the mesh.
     * See https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
     */
    get gazeTrackerMesh() {
        return this._cameraGazer._gazeTracker;
    }
    set gazeTrackerMesh(value) {
        if (value) {
            // Dispose of existing meshes
            if (this._cameraGazer._gazeTracker) {
                this._cameraGazer._gazeTracker.dispose();
            }
            // Set and create gaze trackers on head and controllers
            this._cameraGazer._gazeTracker = value;
            this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices();
            this._cameraGazer._gazeTracker.isPickable = false;
            this._cameraGazer._gazeTracker.isVisible = false;
            this._cameraGazer._gazeTracker.name = "gazeTracker";
        }
    }
    /**
     * If the ray of the gaze should be displayed.
     */
    get displayGaze() {
        return this._displayGaze;
    }
    /**
     * Sets if the ray of the gaze should be displayed.
     */
    set displayGaze(value) {
        this._displayGaze = value;
        if (!value) {
            this._cameraGazer._gazeTracker.isVisible = false;
        }
    }
    /**
     * If the ray of the LaserPointer should be displayed.
     */
    get displayLaserPointer() {
        return this._displayLaserPointer;
    }
    /**
     * Sets if the ray of the LaserPointer should be displayed.
     */
    set displayLaserPointer(value) {
        this._displayLaserPointer = value;
    }
    /**
     * The deviceOrientationCamera used as the camera when not in VR.
     */
    get deviceOrientationCamera() {
        return this._deviceOrientationCamera;
    }
    /**
     * Based on the current WebVR support, returns the current VR camera used.
     */
    get currentVRCamera() {
        return this._scene.activeCamera;
    }
    /**
     * The deviceOrientationCamera that is used as a fallback when vr device is not connected.
     */
    get vrDeviceOrientationCamera() {
        return this._vrDeviceOrientationCamera;
    }
    /**
     * The html button that is used to trigger entering into VR.
     */
    get vrButton() {
        return this._btnVR;
    }
    get _teleportationRequestInitiated() {
        return this._cameraGazer._teleportationRequestInitiated;
    }
    /**
     * Instantiates a VRExperienceHelper.
     * Helps to quickly add VR support to an existing scene.
     * @param scene The scene the VRExperienceHelper belongs to.
     * @param webVROptions Options to modify the vr experience helper's behavior.
     */
    constructor(scene, 
    /** [Empty object] Options to modify the vr experience helper's behavior. */
    webVROptions = {}) {
        this.webVROptions = webVROptions;
        // Are we presenting in the fullscreen fallback?
        this._fullscreenVRpresenting = false;
        /**
         * Gets or sets a boolean indicating that gaze can be enabled even if pointer lock is not engage (useful on iOS where fullscreen mode and pointer lock are not supported)
         */
        this.enableGazeEvenWhenNoPointerLock = false;
        /**
         * Gets or sets a boolean indicating that the VREXperienceHelper will exit VR if double tap is detected
         */
        this.exitVROnDoubleTap = true;
        /**
         * Observable raised right before entering VR.
         */
        this.onEnteringVRObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable raised when entering VR has completed.
         */
        this.onAfterEnteringVRObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable raised when exiting VR.
         */
        this.onExitingVRObservable = new Misc_observable/* Observable */.cP();
        this._useCustomVRButton = false;
        this._teleportActive = false;
        this._floorMeshesCollection = [];
        this._teleportationMode = VRExperienceHelper.TELEPORTATIONMODE_CONSTANTTIME;
        this._teleportationTime = 122;
        this._teleportationSpeed = 20;
        this._rotationAllowed = true;
        this._teleportBackwardsVector = new math_vector/* Vector3 */.Pq(0, -1, -1);
        this._isDefaultTeleportationTarget = true;
        this._teleportationFillColor = "#444444";
        this._teleportationBorderColor = "#FFFFFF";
        this._rotationAngle = 0;
        this._haloCenter = new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._padSensibilityUp = 0.65;
        this._padSensibilityDown = 0.35;
        this._pickedLaserColor = new math_color/* Color3 */.v9(0.2, 0.2, 1);
        this._pickedGazeColor = new math_color/* Color3 */.v9(0, 0, 1);
        /**
         * Observable raised when a new mesh is selected based on meshSelectionPredicate
         */
        this.onNewMeshSelected = new Misc_observable/* Observable */.cP();
        /**
         * Observable raised when a new mesh is picked based on meshSelectionPredicate
         */
        this.onNewMeshPicked = new Misc_observable/* Observable */.cP();
        /**
         * Observable raised before camera teleportation
         */
        this.onBeforeCameraTeleport = new Misc_observable/* Observable */.cP();
        /**
         *  Observable raised after camera teleportation
         */
        this.onAfterCameraTeleport = new Misc_observable/* Observable */.cP();
        /**
         * Observable raised when current selected mesh gets unselected
         */
        this.onSelectedMeshUnselected = new Misc_observable/* Observable */.cP();
        /**
         * Set teleportation enabled. If set to false camera teleportation will be disabled but camera rotation will be kept.
         */
        this.teleportationEnabled = true;
        this._teleportationInitialized = false;
        this._interactionsEnabled = false;
        this._displayGaze = true;
        this._displayLaserPointer = true;
        /**
         * If the gaze trackers scale should be updated to be constant size when pointing at near/far meshes
         */
        this.updateGazeTrackerScale = true;
        /**
         * If the gaze trackers color should be updated when selecting meshes
         */
        this.updateGazeTrackerColor = true;
        /**
         * If the controller laser color should be updated when selecting meshes
         */
        this.updateControllerLaserColor = true;
        /**
         * Defines whether or not Pointer lock should be requested when switching to
         * full screen.
         */
        this.requestPointerLockOnFullScreen = true;
        /**
         * Was the XR test done already. If this is true AND this.xr exists, xr is initialized.
         * If this is true and no this.xr, xr exists but is not supported, using WebVR.
         */
        this.xrTestDone = false;
        this._onResize = () => {
            this._moveButtonToBottomRight();
        };
        this._onFullscreenChange = () => {
            this._fullscreenVRpresenting = !!document.fullscreenElement;
            if (!this._fullscreenVRpresenting && this._inputElement) {
                this.exitVR();
                if (!this._useCustomVRButton && this._btnVR) {
                    this._btnVR.style.top = this._inputElement.offsetTop + this._inputElement.offsetHeight - 70 + "px";
                    this._btnVR.style.left = this._inputElement.offsetLeft + this._inputElement.offsetWidth - 100 + "px";
                    // make sure the button is visible after setting its position
                    this._updateButtonVisibility();
                }
            }
        };
        this._cachedAngularSensibility = { angularSensibilityX: null, angularSensibilityY: null, angularSensibility: null };
        this._beforeRender = () => {
            if (this._scene.getEngine().isPointerLock || this.enableGazeEvenWhenNoPointerLock) {
                // no-op
            }
            else {
                this._cameraGazer._gazeTracker.isVisible = false;
            }
        };
        this._onNewGamepadConnected = (gamepad) => {
            if (gamepad.type !== Gamepad.POSE_ENABLED) {
                if (gamepad.leftStick) {
                    gamepad.onleftstickchanged((stickValues) => {
                        if (this._teleportationInitialized && this.teleportationEnabled) {
                            // Listening to classic/xbox gamepad only if no VR controller is active
                            this._checkTeleportWithRay(stickValues, this._cameraGazer);
                            this._checkTeleportBackwards(stickValues, this._cameraGazer);
                        }
                    });
                }
                if (gamepad.rightStick) {
                    gamepad.onrightstickchanged((stickValues) => {
                        if (this._teleportationInitialized) {
                            this._checkRotate(stickValues, this._cameraGazer);
                        }
                    });
                }
                if (gamepad.type === Gamepad.XBOX) {
                    gamepad.onbuttondown((buttonPressed) => {
                        if (this._interactionsEnabled && buttonPressed === 0 /* Xbox360Button.A */) {
                            this._cameraGazer._selectionPointerDown();
                        }
                    });
                    gamepad.onbuttonup((buttonPressed) => {
                        if (this._interactionsEnabled && buttonPressed === 0 /* Xbox360Button.A */) {
                            this._cameraGazer._selectionPointerUp();
                        }
                    });
                }
            }
        };
        this._workingVector = math_vector/* Vector3 */.Pq.Zero();
        this._workingQuaternion = math_vector/* Quaternion */.PT.Identity();
        this._workingMatrix = math_vector/* Matrix */.uq.Identity();
        logger/* Logger */.V.Warn("WebVR is deprecated. Please avoid using this experience helper and use the WebXR experience helper instead");
        this._scene = scene;
        this._inputElement = scene.getEngine().getInputElement();
        // check for VR support:
        const vrSupported = "getVRDisplays" in navigator;
        // no VR support? force XR but only when it is not set because web vr can work without the getVRDisplays
        if (!vrSupported && webVROptions.useXR === undefined) {
            webVROptions.useXR = true;
        }
        // Parse options
        if (webVROptions.createFallbackVRDeviceOrientationFreeCamera === undefined) {
            webVROptions.createFallbackVRDeviceOrientationFreeCamera = true;
        }
        if (webVROptions.createDeviceOrientationCamera === undefined) {
            webVROptions.createDeviceOrientationCamera = true;
        }
        if (webVROptions.laserToggle === undefined) {
            webVROptions.laserToggle = true;
        }
        this._hasEnteredVR = false;
        // Set position
        if (this._scene.activeCamera) {
            this._position = this._scene.activeCamera.position.clone();
        }
        else {
            this._position = new math_vector/* Vector3 */.Pq(0, this._defaultHeight, 0);
        }
        // Set non-vr camera
        if (webVROptions.createDeviceOrientationCamera || !this._scene.activeCamera) {
            this._deviceOrientationCamera = new DeviceOrientationCamera("deviceOrientationVRHelper", this._position.clone(), scene);
            // Copy data from existing camera
            if (this._scene.activeCamera) {
                this._deviceOrientationCamera.minZ = this._scene.activeCamera.minZ;
                this._deviceOrientationCamera.maxZ = this._scene.activeCamera.maxZ;
                // Set rotation from previous camera
                if (this._scene.activeCamera instanceof targetCamera/* TargetCamera */.F && this._scene.activeCamera.rotation) {
                    const targetCamera = this._scene.activeCamera;
                    if (targetCamera.rotationQuaternion) {
                        this._deviceOrientationCamera.rotationQuaternion.copyFrom(targetCamera.rotationQuaternion);
                    }
                    else {
                        this._deviceOrientationCamera.rotationQuaternion.copyFrom(math_vector/* Quaternion */.PT.RotationYawPitchRoll(targetCamera.rotation.y, targetCamera.rotation.x, targetCamera.rotation.z));
                    }
                    this._deviceOrientationCamera.rotation = targetCamera.rotation.clone();
                }
            }
            this._scene.activeCamera = this._deviceOrientationCamera;
            if (this._inputElement) {
                this._scene.activeCamera.attachControl();
            }
        }
        else {
            this._existingCamera = this._scene.activeCamera;
        }
        if (this.webVROptions.useXR && navigator.xr) {
            // force-check XR session support
            WebXRSessionManager.IsSessionSupportedAsync("immersive-vr").then((supported) => {
                if (supported) {
                    logger/* Logger */.V.Log("Using WebXR. It is recommended to use the WebXRDefaultExperience directly");
                    // it is possible to use XR, let's do it!
                    scene
                        .createDefaultXRExperienceAsync({
                        floorMeshes: webVROptions.floorMeshes || [],
                    })
                        .then((xr) => {
                        this.xr = xr;
                        // connect observables
                        this.xrTestDone = true;
                        this._cameraGazer = new VRExperienceHelperCameraGazer(() => {
                            return this.xr.baseExperience.camera;
                        }, scene);
                        this.xr.baseExperience.onStateChangedObservable.add((state) => {
                            // support for entering / exiting
                            switch (state) {
                                case 0 /* WebXRState.ENTERING_XR */:
                                    this.onEnteringVRObservable.notifyObservers(this);
                                    if (!this._interactionsEnabled) {
                                        this.xr.pointerSelection.detach();
                                    }
                                    this.xr.pointerSelection.displayLaserPointer = this._displayLaserPointer;
                                    break;
                                case 1 /* WebXRState.EXITING_XR */:
                                    this.onExitingVRObservable.notifyObservers(this);
                                    // resize to update width and height when exiting vr exits fullscreen
                                    this._scene.getEngine().resize();
                                    break;
                                case 2 /* WebXRState.IN_XR */:
                                    this._hasEnteredVR = true;
                                    break;
                                case 3 /* WebXRState.NOT_IN_XR */:
                                    this._hasEnteredVR = false;
                                    break;
                            }
                        });
                    });
                }
                else {
                    // XR not supported (thou exists), continue WebVR init
                    this._completeVRInit(scene, webVROptions);
                }
            });
        }
        else {
            // no XR, continue init synchronous
            this._completeVRInit(scene, webVROptions);
        }
    }
    _completeVRInit(scene, webVROptions) {
        this.xrTestDone = true;
        // Create VR cameras
        if (webVROptions.createFallbackVRDeviceOrientationFreeCamera) {
            this._vrDeviceOrientationCamera = new VRDeviceOrientationFreeCamera("VRDeviceOrientationVRHelper", this._position, this._scene, true, webVROptions.vrDeviceOrientationCameraMetrics);
            this._vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE;
        }
        this._cameraGazer = new VRExperienceHelperCameraGazer(() => {
            return this.currentVRCamera;
        }, scene);
        // Create default button
        if (!this._useCustomVRButton) {
            this._btnVR = document.createElement("BUTTON");
            this._btnVR.className = "babylonVRicon";
            this._btnVR.id = "babylonVRiconbtn";
            this._btnVR.title = "Click to switch to VR";
            const url = !window.SVGSVGElement
                ? "https://cdn.babylonjs.com/Assets/vrButton.png"
                : "data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A";
            let css = ".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(" +
                url +
                "); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";
            css += ".babylonVRicon.vrdisplaypresenting { display: none; }";
            // TODO: Add user feedback so that they know what state the VRDisplay is in (disconnected, connected, entering-VR)
            // css += ".babylonVRicon.vrdisplaysupported { }";
            // css += ".babylonVRicon.vrdisplayready { }";
            // css += ".babylonVRicon.vrdisplayrequesting { }";
            const style = document.createElement("style");
            style.appendChild(document.createTextNode(css));
            document.getElementsByTagName("head")[0].appendChild(style);
            this._moveButtonToBottomRight();
        }
        // VR button click event
        if (this._btnVR) {
            this._btnVR.addEventListener("click", () => {
                if (!this.isInVRMode) {
                    this.enterVR();
                }
            });
        }
        // Window events
        const hostWindow = this._scene.getEngine().getHostWindow();
        if (!hostWindow) {
            return;
        }
        hostWindow.addEventListener("resize", this._onResize);
        document.addEventListener("fullscreenchange", this._onFullscreenChange, false);
        // Display vr button when headset is connected
        if (webVROptions.createFallbackVRDeviceOrientationFreeCamera) {
            this._displayVRButton();
        }
        // Exiting VR mode using 'ESC' key on desktop
        this._onKeyDown = (event) => {
            if (event.keyCode === 27 && this.isInVRMode) {
                this.exitVR();
            }
        };
        document.addEventListener("keydown", this._onKeyDown);
        // Exiting VR mode double tapping the touch screen
        this._scene.onPrePointerObservable.add(() => {
            if (this._hasEnteredVR && this.exitVROnDoubleTap) {
                this.exitVR();
                if (this._fullscreenVRpresenting) {
                    this._scene.getEngine().exitFullscreen();
                }
            }
        }, pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP, false);
        scene.onDisposeObservable.add(() => {
            this.dispose();
        });
        this._updateButtonVisibility();
        //create easing functions
        this._circleEase = new CircleEase();
        this._circleEase.setEasingMode(EasingFunction.EASINGMODE_EASEINOUT);
        this._teleportationEasing = this._circleEase;
        // Allow clicking in the vrDeviceOrientationCamera
        scene.onPointerObservable.add((e) => {
            if (this._interactionsEnabled) {
                if (scene.activeCamera === this.vrDeviceOrientationCamera && e.event.pointerType === "mouse") {
                    if (e.type === pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN) {
                        this._cameraGazer._selectionPointerDown();
                    }
                    else if (e.type === pointerEvents/* PointerEventTypes */.Zp.POINTERUP) {
                        this._cameraGazer._selectionPointerUp();
                    }
                }
            }
        });
        if (this.webVROptions.floorMeshes) {
            this.enableTeleportation({ floorMeshes: this.webVROptions.floorMeshes });
        }
    }
    /**
     * Gets a value indicating if we are currently in VR mode.
     */
    get isInVRMode() {
        return (this.xr && this.webVROptions.useXR && this.xr.baseExperience.state === 2 /* WebXRState.IN_XR */) || this._fullscreenVRpresenting;
    }
    _moveButtonToBottomRight() {
        if (this._inputElement && !this._useCustomVRButton && this._btnVR) {
            const rect = this._inputElement.getBoundingClientRect();
            this._btnVR.style.top = rect.top + rect.height - 70 + "px";
            this._btnVR.style.left = rect.left + rect.width - 100 + "px";
        }
    }
    _displayVRButton() {
        if (!this._useCustomVRButton && !this._btnVRDisplayed && this._btnVR) {
            document.body.appendChild(this._btnVR);
            this._btnVRDisplayed = true;
        }
    }
    _updateButtonVisibility() {
        if (!this._btnVR || this._useCustomVRButton) {
            return;
        }
        this._btnVR.className = "babylonVRicon";
        if (this.isInVRMode) {
            this._btnVR.className += " vrdisplaypresenting";
        }
    }
    /**
     * Attempt to enter VR. If a headset is connected and ready, will request present on that.
     * Otherwise, will use the fullscreen API.
     */
    enterVR() {
        if (this.xr) {
            this.xr.baseExperience.enterXRAsync("immersive-vr", "local-floor", this.xr.renderTarget);
            return;
        }
        if (this.onEnteringVRObservable) {
            try {
                this.onEnteringVRObservable.notifyObservers(this);
            }
            catch (err) {
                logger/* Logger */.V.Warn("Error in your custom logic onEnteringVR: " + err);
            }
        }
        if (this._scene.activeCamera) {
            this._position = this._scene.activeCamera.position.clone();
            if (this.vrDeviceOrientationCamera) {
                this.vrDeviceOrientationCamera.rotation = math_vector/* Quaternion */.PT.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles();
                this.vrDeviceOrientationCamera.angularSensibility = 2000;
            }
            // make sure that we return to the last active camera
            this._existingCamera = this._scene.activeCamera;
            // Remove and cache angular sensability to avoid camera rotation when in VR
            if (this._existingCamera.angularSensibilityX) {
                this._cachedAngularSensibility.angularSensibilityX = this._existingCamera.angularSensibilityX;
                this._existingCamera.angularSensibilityX = Number.MAX_VALUE;
            }
            if (this._existingCamera.angularSensibilityY) {
                this._cachedAngularSensibility.angularSensibilityY = this._existingCamera.angularSensibilityY;
                this._existingCamera.angularSensibilityY = Number.MAX_VALUE;
            }
            if (this._existingCamera.angularSensibility) {
                this._cachedAngularSensibility.angularSensibility = this._existingCamera.angularSensibility;
                this._existingCamera.angularSensibility = Number.MAX_VALUE;
            }
        }
        // If WebVR is supported and a headset is connected
        if (this._vrDeviceOrientationCamera) {
            this._vrDeviceOrientationCamera.position = this._position;
            if (this._scene.activeCamera) {
                this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ;
            }
            this._scene.activeCamera = this._vrDeviceOrientationCamera;
            this._scene.getEngine().enterFullscreen(this.requestPointerLockOnFullScreen);
            this._updateButtonVisibility();
            this._vrDeviceOrientationCamera.onViewMatrixChangedObservable.addOnce(() => {
                this.onAfterEnteringVRObservable.notifyObservers({ success: true });
            });
        }
        if (this._scene.activeCamera && this._inputElement) {
            this._scene.activeCamera.attachControl();
        }
        if (this._interactionsEnabled) {
            this._scene.registerBeforeRender(this._beforeRender);
        }
        this._hasEnteredVR = true;
    }
    /**
     * Attempt to exit VR, or fullscreen.
     */
    exitVR() {
        if (this.xr) {
            this.xr.baseExperience.exitXRAsync();
            return;
        }
        if (this._hasEnteredVR) {
            if (this.onExitingVRObservable) {
                try {
                    this.onExitingVRObservable.notifyObservers(this);
                }
                catch (err) {
                    logger/* Logger */.V.Warn("Error in your custom logic onExitingVR: " + err);
                }
            }
            if (this._scene.activeCamera) {
                this._position = this._scene.activeCamera.position.clone();
            }
            if (this.vrDeviceOrientationCamera) {
                this.vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE;
            }
            if (this._deviceOrientationCamera) {
                this._deviceOrientationCamera.position = this._position;
                this._scene.activeCamera = this._deviceOrientationCamera;
                // Restore angular sensibility
                if (this._cachedAngularSensibility.angularSensibilityX) {
                    this._deviceOrientationCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX;
                    this._cachedAngularSensibility.angularSensibilityX = null;
                }
                if (this._cachedAngularSensibility.angularSensibilityY) {
                    this._deviceOrientationCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY;
                    this._cachedAngularSensibility.angularSensibilityY = null;
                }
                if (this._cachedAngularSensibility.angularSensibility) {
                    this._deviceOrientationCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility;
                    this._cachedAngularSensibility.angularSensibility = null;
                }
            }
            else if (this._existingCamera) {
                this._existingCamera.position = this._position;
                this._scene.activeCamera = this._existingCamera;
                if (this._inputElement) {
                    this._scene.activeCamera.attachControl();
                }
                // Restore angular sensibility
                if (this._cachedAngularSensibility.angularSensibilityX) {
                    this._existingCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX;
                    this._cachedAngularSensibility.angularSensibilityX = null;
                }
                if (this._cachedAngularSensibility.angularSensibilityY) {
                    this._existingCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY;
                    this._cachedAngularSensibility.angularSensibilityY = null;
                }
                if (this._cachedAngularSensibility.angularSensibility) {
                    this._existingCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility;
                    this._cachedAngularSensibility.angularSensibility = null;
                }
            }
            this._updateButtonVisibility();
            if (this._interactionsEnabled) {
                this._scene.unregisterBeforeRender(this._beforeRender);
                this._cameraGazer._gazeTracker.isVisible = false;
            }
            // resize to update width and height when exiting vr exits fullscreen
            this._scene.getEngine().resize();
            this._hasEnteredVR = false;
        }
    }
    /**
     * The position of the vr experience helper.
     */
    get position() {
        return this._position;
    }
    /**
     * Sets the position of the vr experience helper.
     */
    set position(value) {
        this._position = value;
        if (this._scene.activeCamera) {
            this._scene.activeCamera.position = value;
        }
    }
    /**
     * Enables controllers and user interactions such as selecting and object or clicking on an object.
     */
    enableInteractions() {
        if (!this._interactionsEnabled) {
            // in XR it is enabled by default, but just to make sure, re-attach
            if (this.xr) {
                if (this.xr.baseExperience.state === 2 /* WebXRState.IN_XR */) {
                    this.xr.pointerSelection.attach();
                }
                return;
            }
            this.raySelectionPredicate = (mesh) => {
                return mesh.isVisible && (mesh.isPickable || mesh.name === this._floorMeshName);
            };
            this.meshSelectionPredicate = () => {
                return true;
            };
            this._raySelectionPredicate = (mesh) => {
                if (this._isTeleportationFloor(mesh) ||
                    (mesh.name.indexOf("gazeTracker") === -1 && mesh.name.indexOf("teleportationTarget") === -1 && mesh.name.indexOf("torusTeleportation") === -1)) {
                    return this.raySelectionPredicate(mesh);
                }
                return false;
            };
            this._interactionsEnabled = true;
        }
    }
    _isTeleportationFloor(mesh) {
        for (let i = 0; i < this._floorMeshesCollection.length; i++) {
            if (this._floorMeshesCollection[i].id === mesh.id) {
                return true;
            }
        }
        if (this._floorMeshName && mesh.name === this._floorMeshName) {
            return true;
        }
        return false;
    }
    /**
     * Adds a floor mesh to be used for teleportation.
     * @param floorMesh the mesh to be used for teleportation.
     */
    addFloorMesh(floorMesh) {
        if (!this._floorMeshesCollection) {
            return;
        }
        if (this._floorMeshesCollection.indexOf(floorMesh) > -1) {
            return;
        }
        this._floorMeshesCollection.push(floorMesh);
    }
    /**
     * Removes a floor mesh from being used for teleportation.
     * @param floorMesh the mesh to be removed.
     */
    removeFloorMesh(floorMesh) {
        if (!this._floorMeshesCollection) {
            return;
        }
        const meshIndex = this._floorMeshesCollection.indexOf(floorMesh);
        if (meshIndex !== -1) {
            this._floorMeshesCollection.splice(meshIndex, 1);
        }
    }
    /**
     * Enables interactions and teleportation using the VR controllers and gaze.
     * @param vrTeleportationOptions options to modify teleportation behavior.
     */
    enableTeleportation(vrTeleportationOptions = {}) {
        if (!this._teleportationInitialized) {
            this.enableInteractions();
            if (this.webVROptions.useXR && (vrTeleportationOptions.floorMeshes || vrTeleportationOptions.floorMeshName)) {
                const floorMeshes = vrTeleportationOptions.floorMeshes || [];
                if (!floorMeshes.length) {
                    const floorMesh = this._scene.getMeshByName(vrTeleportationOptions.floorMeshName);
                    if (floorMesh) {
                        floorMeshes.push(floorMesh);
                    }
                }
                if (this.xr) {
                    floorMeshes.forEach((mesh) => {
                        this.xr.teleportation.addFloorMesh(mesh);
                    });
                    if (!this.xr.teleportation.attached) {
                        this.xr.teleportation.attach();
                    }
                    return;
                }
                else if (!this.xrTestDone) {
                    const waitForXr = () => {
                        if (this.xrTestDone) {
                            this._scene.unregisterBeforeRender(waitForXr);
                            if (this.xr) {
                                if (!this.xr.teleportation.attached) {
                                    this.xr.teleportation.attach();
                                }
                            }
                            else {
                                this.enableTeleportation(vrTeleportationOptions);
                            }
                        }
                    };
                    this._scene.registerBeforeRender(waitForXr);
                    return;
                }
            }
            if (vrTeleportationOptions.floorMeshName) {
                this._floorMeshName = vrTeleportationOptions.floorMeshName;
            }
            if (vrTeleportationOptions.floorMeshes) {
                this._floorMeshesCollection = vrTeleportationOptions.floorMeshes;
            }
            if (vrTeleportationOptions.teleportationMode) {
                this._teleportationMode = vrTeleportationOptions.teleportationMode;
            }
            if (vrTeleportationOptions.teleportationTime && vrTeleportationOptions.teleportationTime > 0) {
                this._teleportationTime = vrTeleportationOptions.teleportationTime;
            }
            if (vrTeleportationOptions.teleportationSpeed && vrTeleportationOptions.teleportationSpeed > 0) {
                this._teleportationSpeed = vrTeleportationOptions.teleportationSpeed;
            }
            if (vrTeleportationOptions.easingFunction !== undefined) {
                this._teleportationEasing = vrTeleportationOptions.easingFunction;
            }
            // Creates an image processing post process for the vignette not relying
            // on the main scene configuration for image processing to reduce setup and spaces
            // (gamma/linear) conflicts.
            const imageProcessingConfiguration = new Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p();
            imageProcessingConfiguration.vignetteColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
            imageProcessingConfiguration.vignetteEnabled = true;
            this._teleportationInitialized = true;
            if (this._isDefaultTeleportationTarget) {
                this._createTeleportationCircles();
            }
        }
    }
    _checkTeleportWithRay(stateObject, gazer) {
        // Dont teleport if another gaze already requested teleportation
        if (this._teleportationRequestInitiated && !gazer._teleportationRequestInitiated) {
            return;
        }
        if (!gazer._teleportationRequestInitiated) {
            if (stateObject.y < -this._padSensibilityUp && gazer._dpadPressed) {
                gazer._activatePointer();
                gazer._teleportationRequestInitiated = true;
            }
        }
        else {
            // Listening to the proper controller values changes to confirm teleportation
            if (Math.sqrt(stateObject.y * stateObject.y + stateObject.x * stateObject.x) < this._padSensibilityDown) {
                if (this._teleportActive) {
                    this.teleportCamera(this._haloCenter);
                }
                gazer._teleportationRequestInitiated = false;
            }
        }
    }
    _checkRotate(stateObject, gazer) {
        // Only rotate when user is not currently selecting a teleportation location
        if (gazer._teleportationRequestInitiated) {
            return;
        }
        if (!gazer._rotationLeftAsked) {
            if (stateObject.x < -this._padSensibilityUp && gazer._dpadPressed) {
                gazer._rotationLeftAsked = true;
                if (this._rotationAllowed) {
                    this._rotateCamera(false);
                }
            }
        }
        else {
            if (stateObject.x > -this._padSensibilityDown) {
                gazer._rotationLeftAsked = false;
            }
        }
        if (!gazer._rotationRightAsked) {
            if (stateObject.x > this._padSensibilityUp && gazer._dpadPressed) {
                gazer._rotationRightAsked = true;
                if (this._rotationAllowed) {
                    this._rotateCamera(true);
                }
            }
        }
        else {
            if (stateObject.x < this._padSensibilityDown) {
                gazer._rotationRightAsked = false;
            }
        }
    }
    _checkTeleportBackwards(stateObject, gazer) {
        // Only teleport backwards when user is not currently selecting a teleportation location
        if (gazer._teleportationRequestInitiated) {
            return;
        }
        // Teleport backwards
        if (stateObject.y > this._padSensibilityUp && gazer._dpadPressed) {
            if (!gazer._teleportationBackRequestInitiated) {
                if (!this.currentVRCamera) {
                    return;
                }
                // Get rotation and position of the current camera
                const rotation = math_vector/* Quaternion */.PT.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix());
                const position = this.currentVRCamera.position;
                // Get matrix with only the y rotation of the device rotation
                rotation.toEulerAnglesToRef(this._workingVector);
                this._workingVector.z = 0;
                this._workingVector.x = 0;
                math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(this._workingVector.y, this._workingVector.x, this._workingVector.z, this._workingQuaternion);
                this._workingQuaternion.toRotationMatrix(this._workingMatrix);
                // Rotate backwards ray by device rotation to cast at the ground behind the user
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._teleportBackwardsVector, this._workingMatrix, this._workingVector);
                // Teleport if ray hit the ground and is not to far away eg. backwards off a cliff
                const ray = new Culling_ray/* Ray */.Rl(position, this._workingVector);
                const hit = this._scene.pickWithRay(ray, this._raySelectionPredicate);
                if (hit && hit.pickedPoint && hit.pickedMesh && this._isTeleportationFloor(hit.pickedMesh) && hit.distance < 5) {
                    this.teleportCamera(hit.pickedPoint);
                }
                gazer._teleportationBackRequestInitiated = true;
            }
        }
        else {
            gazer._teleportationBackRequestInitiated = false;
        }
    }
    _createTeleportationCircles() {
        this._teleportationTarget = (0,groundBuilder/* CreateGround */.km)("teleportationTarget", { width: 2, height: 2, subdivisions: 2 }, this._scene);
        this._teleportationTarget.isPickable = false;
        const length = 512;
        const dynamicTexture = new Textures_dynamicTexture/* DynamicTexture */.R("DynamicTexture", length, this._scene, true);
        dynamicTexture.hasAlpha = true;
        const context = dynamicTexture.getContext();
        const centerX = length / 2;
        const centerY = length / 2;
        const radius = 200;
        context.beginPath();
        context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
        context.fillStyle = this._teleportationFillColor;
        context.fill();
        context.lineWidth = 10;
        context.strokeStyle = this._teleportationBorderColor;
        context.stroke();
        context.closePath();
        dynamicTexture.update();
        const teleportationCircleMaterial = new standardMaterial/* StandardMaterial */.F("TextPlaneMaterial", this._scene);
        teleportationCircleMaterial.diffuseTexture = dynamicTexture;
        this._teleportationTarget.material = teleportationCircleMaterial;
        const torus = CreateTorus("torusTeleportation", {
            diameter: 0.75,
            thickness: 0.1,
            tessellation: 25,
            updatable: false,
        }, this._scene);
        torus.isPickable = false;
        torus.parent = this._teleportationTarget;
        const animationInnerCircle = new Animations_animation/* Animation */.X5("animationInnerCircle", "position.y", 30, Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CYCLE);
        const keys = [];
        keys.push({
            frame: 0,
            value: 0,
        });
        keys.push({
            frame: 30,
            value: 0.4,
        });
        keys.push({
            frame: 60,
            value: 0,
        });
        animationInnerCircle.setKeys(keys);
        const easingFunction = new SineEase();
        easingFunction.setEasingMode(EasingFunction.EASINGMODE_EASEINOUT);
        animationInnerCircle.setEasingFunction(easingFunction);
        torus.animations = [];
        torus.animations.push(animationInnerCircle);
        this._scene.beginAnimation(torus, 0, 60, true);
        this._hideTeleportationTarget();
    }
    _hideTeleportationTarget() {
        this._teleportActive = false;
        if (this._teleportationInitialized) {
            this._teleportationTarget.isVisible = false;
            if (this._isDefaultTeleportationTarget) {
                this._teleportationTarget.getChildren()[0].isVisible = false;
            }
        }
    }
    _rotateCamera(right) {
        if (!(this.currentVRCamera instanceof Cameras_freeCamera/* FreeCamera */.S)) {
            return;
        }
        if (right) {
            this._rotationAngle++;
        }
        else {
            this._rotationAngle--;
        }
        this.currentVRCamera.animations = [];
        const target = math_vector/* Quaternion */.PT.FromRotationMatrix(math_vector/* Matrix */.uq.RotationY((Math.PI / 4) * this._rotationAngle));
        const animationRotation = new Animations_animation/* Animation */.X5("animationRotation", "rotationQuaternion", 90, Animations_animation/* Animation */.X5.ANIMATIONTYPE_QUATERNION, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        const animationRotationKeys = [];
        animationRotationKeys.push({
            frame: 0,
            value: this.currentVRCamera.rotationQuaternion,
        });
        animationRotationKeys.push({
            frame: 6,
            value: target,
        });
        animationRotation.setKeys(animationRotationKeys);
        animationRotation.setEasingFunction(this._circleEase);
        this.currentVRCamera.animations.push(animationRotation);
        this._postProcessMove.animations = [];
        const animationPP = new Animations_animation/* Animation */.X5("animationPP", "vignetteWeight", 90, Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        const vignetteWeightKeys = [];
        vignetteWeightKeys.push({
            frame: 0,
            value: 0,
        });
        vignetteWeightKeys.push({
            frame: 3,
            value: 4,
        });
        vignetteWeightKeys.push({
            frame: 6,
            value: 0,
        });
        animationPP.setKeys(vignetteWeightKeys);
        animationPP.setEasingFunction(this._circleEase);
        this._postProcessMove.animations.push(animationPP);
        const animationPP2 = new Animations_animation/* Animation */.X5("animationPP2", "vignetteStretch", 90, Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        const vignetteStretchKeys = [];
        vignetteStretchKeys.push({
            frame: 0,
            value: 0,
        });
        vignetteStretchKeys.push({
            frame: 3,
            value: 10,
        });
        vignetteStretchKeys.push({
            frame: 6,
            value: 0,
        });
        animationPP2.setKeys(vignetteStretchKeys);
        animationPP2.setEasingFunction(this._circleEase);
        this._postProcessMove.animations.push(animationPP2);
        this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0;
        this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0;
        this._postProcessMove.samples = 4;
        this._scene.beginAnimation(this.currentVRCamera, 0, 6, false, 1);
    }
    /**
     * Teleports the users feet to the desired location
     * @param location The location where the user's feet should be placed
     */
    teleportCamera(location) {
        if (!(this.currentVRCamera instanceof Cameras_freeCamera/* FreeCamera */.S)) {
            return;
        }
        // Teleport the hmd to where the user is looking by moving the anchor to where they are looking minus the
        // offset of the headset from the anchor.
        this._workingVector.copyFrom(location);
        // Add height to account for user's height offset
        if (this.isInVRMode) {
            // no-op
        }
        else {
            this._workingVector.y += this._defaultHeight;
        }
        this.onBeforeCameraTeleport.notifyObservers(this._workingVector);
        // Animations FPS
        const FPS = 90;
        let speedRatio, lastFrame;
        if (this._teleportationMode == VRExperienceHelper.TELEPORTATIONMODE_CONSTANTSPEED) {
            lastFrame = FPS;
            const dist = math_vector/* Vector3 */.Pq.Distance(this.currentVRCamera.position, this._workingVector);
            speedRatio = this._teleportationSpeed / dist;
        }
        else {
            // teleportationMode is TELEPORTATIONMODE_CONSTANTTIME
            lastFrame = Math.round((this._teleportationTime * FPS) / 1000);
            speedRatio = 1;
        }
        // Create animation from the camera's position to the new location
        this.currentVRCamera.animations = [];
        const animationCameraTeleportation = new Animations_animation/* Animation */.X5("animationCameraTeleportation", "position", FPS, Animations_animation/* Animation */.X5.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        const animationCameraTeleportationKeys = [
            {
                frame: 0,
                value: this.currentVRCamera.position,
            },
            {
                frame: lastFrame,
                value: this._workingVector,
            },
        ];
        animationCameraTeleportation.setKeys(animationCameraTeleportationKeys);
        animationCameraTeleportation.setEasingFunction(this._teleportationEasing);
        this.currentVRCamera.animations.push(animationCameraTeleportation);
        this._postProcessMove.animations = [];
        // Calculate the mid frame for vignette animations
        const midFrame = Math.round(lastFrame / 2);
        const animationPP = new Animations_animation/* Animation */.X5("animationPP", "vignetteWeight", FPS, Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        const vignetteWeightKeys = [];
        vignetteWeightKeys.push({
            frame: 0,
            value: 0,
        });
        vignetteWeightKeys.push({
            frame: midFrame,
            value: 8,
        });
        vignetteWeightKeys.push({
            frame: lastFrame,
            value: 0,
        });
        animationPP.setKeys(vignetteWeightKeys);
        this._postProcessMove.animations.push(animationPP);
        const animationPP2 = new Animations_animation/* Animation */.X5("animationPP2", "vignetteStretch", FPS, Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        const vignetteStretchKeys = [];
        vignetteStretchKeys.push({
            frame: 0,
            value: 0,
        });
        vignetteStretchKeys.push({
            frame: midFrame,
            value: 10,
        });
        vignetteStretchKeys.push({
            frame: lastFrame,
            value: 0,
        });
        animationPP2.setKeys(vignetteStretchKeys);
        this._postProcessMove.animations.push(animationPP2);
        this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0;
        this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0;
        this._scene.beginAnimation(this.currentVRCamera, 0, lastFrame, false, speedRatio, () => {
            this.onAfterCameraTeleport.notifyObservers(this._workingVector);
        });
        this._hideTeleportationTarget();
    }
    /**
     * Permanently set new colors for the laser pointer
     * @param color the new laser color
     * @param pickedColor the new laser color when picked mesh detected
     */
    setLaserColor(color, pickedColor = this._pickedLaserColor) {
        this._pickedLaserColor = pickedColor;
    }
    /**
     * Set lighting enabled / disabled on the laser pointer of both controllers
     * @param _enabled should the lighting be enabled on the laser pointer
     */
    setLaserLightingState(_enabled = true) {
        // no-op
    }
    /**
     * Permanently set new colors for the gaze pointer
     * @param color the new gaze color
     * @param pickedColor the new gaze color when picked mesh detected
     */
    setGazeColor(color, pickedColor = this._pickedGazeColor) {
        this._pickedGazeColor = pickedColor;
    }
    /**
     * Sets the color of the laser ray from the vr controllers.
     * @param _color new color for the ray.
     */
    changeLaserColor(_color) {
        if (!this.updateControllerLaserColor) {
            return;
        }
    }
    /**
     * Sets the color of the ray from the vr headsets gaze.
     * @param color new color for the ray.
     */
    changeGazeColor(color) {
        if (!this.updateGazeTrackerColor) {
            return;
        }
        if (!this._cameraGazer._gazeTracker.material) {
            return;
        }
        this._cameraGazer._gazeTracker.material.emissiveColor = color;
    }
    /**
     * Exits VR and disposes of the vr experience helper
     */
    dispose() {
        if (this.isInVRMode) {
            this.exitVR();
        }
        if (this._postProcessMove) {
            this._postProcessMove.dispose();
        }
        if (this._vrDeviceOrientationCamera) {
            this._vrDeviceOrientationCamera.dispose();
        }
        if (!this._useCustomVRButton && this._btnVR && this._btnVR.parentNode) {
            document.body.removeChild(this._btnVR);
        }
        if (this._deviceOrientationCamera && this._scene.activeCamera != this._deviceOrientationCamera) {
            this._deviceOrientationCamera.dispose();
        }
        if (this._cameraGazer) {
            this._cameraGazer.dispose();
        }
        if (this._teleportationTarget) {
            this._teleportationTarget.dispose();
        }
        if (this.xr) {
            this.xr.dispose();
        }
        this._floorMeshesCollection.length = 0;
        document.removeEventListener("keydown", this._onKeyDown);
        window.removeEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChangeBind);
        window.removeEventListener("resize", this._onResize);
        document.removeEventListener("fullscreenchange", this._onFullscreenChange);
        this._scene.gamepadManager.onGamepadConnectedObservable.removeCallback(this._onNewGamepadConnected);
        this._scene.unregisterBeforeRender(this._beforeRender);
    }
    /**
     * Gets the name of the VRExperienceHelper class
     * @returns "VRExperienceHelper"
     */
    getClassName() {
        return "VRExperienceHelper";
    }
}
/**
 * Time Constant Teleportation Mode
 */
VRExperienceHelper.TELEPORTATIONMODE_CONSTANTTIME = 0;
/**
 * Speed Constant Teleportation Mode
 */
VRExperienceHelper.TELEPORTATIONMODE_CONSTANTSPEED = 1;
//# sourceMappingURL=vrExperienceHelper.js.map
;// ./node_modules/@babylonjs/core/Cameras/VR/index.js





//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Cameras/RigModes/index.js



//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Cameras/index.js
/* eslint-disable import/no-internal-modules */




















//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Collisions/collider.js


const intersectBoxAASphere = (boxMin, boxMax, sphereCenter, sphereRadius) => {
    if (boxMin.x > sphereCenter.x + sphereRadius) {
        return false;
    }
    if (sphereCenter.x - sphereRadius > boxMax.x) {
        return false;
    }
    if (boxMin.y > sphereCenter.y + sphereRadius) {
        return false;
    }
    if (sphereCenter.y - sphereRadius > boxMax.y) {
        return false;
    }
    if (boxMin.z > sphereCenter.z + sphereRadius) {
        return false;
    }
    if (sphereCenter.z - sphereRadius > boxMax.z) {
        return false;
    }
    return true;
};
const getLowestRoot = (function () {
    const result = { root: 0, found: false };
    return function (a, b, c, maxR) {
        result.root = 0;
        result.found = false;
        const determinant = b * b - 4.0 * a * c;
        if (determinant < 0) {
            return result;
        }
        const sqrtD = Math.sqrt(determinant);
        let r1 = (-b - sqrtD) / (2.0 * a);
        let r2 = (-b + sqrtD) / (2.0 * a);
        if (r1 > r2) {
            const temp = r2;
            r2 = r1;
            r1 = temp;
        }
        if (r1 > 0 && r1 < maxR) {
            result.root = r1;
            result.found = true;
            return result;
        }
        if (r2 > 0 && r2 < maxR) {
            result.root = r2;
            result.found = true;
            return result;
        }
        return result;
    };
})();
/** @internal */
class Collider {
    constructor() {
        // Implementation of the "Improved Collision detection and Response" algorithm proposed by Kasper Fauerby
        // https://www.peroxide.dk/papers/collision/collision.pdf
        this._collisionPoint = math_vector/* Vector3 */.Pq.Zero();
        this._planeIntersectionPoint = math_vector/* Vector3 */.Pq.Zero();
        this._tempVector = math_vector/* Vector3 */.Pq.Zero();
        this._tempVector2 = math_vector/* Vector3 */.Pq.Zero();
        this._tempVector3 = math_vector/* Vector3 */.Pq.Zero();
        this._tempVector4 = math_vector/* Vector3 */.Pq.Zero();
        this._edge = math_vector/* Vector3 */.Pq.Zero();
        this._baseToVertex = math_vector/* Vector3 */.Pq.Zero();
        this._destinationPoint = math_vector/* Vector3 */.Pq.Zero();
        this._slidePlaneNormal = math_vector/* Vector3 */.Pq.Zero();
        this._displacementVector = math_vector/* Vector3 */.Pq.Zero();
        /** @internal */
        this._radius = math_vector/* Vector3 */.Pq.One();
        /** @internal */
        this._retry = 0;
        /** @internal */
        this._basePointWorld = math_vector/* Vector3 */.Pq.Zero();
        this._velocityWorld = math_vector/* Vector3 */.Pq.Zero();
        this._normalizedVelocity = math_vector/* Vector3 */.Pq.Zero();
        this._collisionMask = -1;
    }
    get collisionMask() {
        return this._collisionMask;
    }
    set collisionMask(mask) {
        this._collisionMask = !isNaN(mask) ? mask : -1;
    }
    /**
     * Gets the plane normal used to compute the sliding response (in local space)
     */
    get slidePlaneNormal() {
        return this._slidePlaneNormal;
    }
    // Methods
    /**
     * @internal
     */
    _initialize(source, dir, e) {
        this._velocity = dir;
        this._velocitySquaredLength = this._velocity.lengthSquared();
        const len = Math.sqrt(this._velocitySquaredLength);
        if (len === 0 || len === 1.0) {
            this._normalizedVelocity.copyFromFloats(dir._x, dir._y, dir._z);
        }
        else {
            dir.scaleToRef(1.0 / len, this._normalizedVelocity);
        }
        this._basePoint = source;
        source.multiplyToRef(this._radius, this._basePointWorld);
        dir.multiplyToRef(this._radius, this._velocityWorld);
        this._velocityWorldLength = this._velocityWorld.length();
        this._epsilon = e;
        this.collisionFound = false;
    }
    /**
     * @internal
     */
    _checkPointInTriangle(point, pa, pb, pc, n) {
        pa.subtractToRef(point, this._tempVector);
        pb.subtractToRef(point, this._tempVector2);
        math_vector/* Vector3 */.Pq.CrossToRef(this._tempVector, this._tempVector2, this._tempVector4);
        let d = math_vector/* Vector3 */.Pq.Dot(this._tempVector4, n);
        if (d < 0) {
            return false;
        }
        pc.subtractToRef(point, this._tempVector3);
        math_vector/* Vector3 */.Pq.CrossToRef(this._tempVector2, this._tempVector3, this._tempVector4);
        d = math_vector/* Vector3 */.Pq.Dot(this._tempVector4, n);
        if (d < 0) {
            return false;
        }
        math_vector/* Vector3 */.Pq.CrossToRef(this._tempVector3, this._tempVector, this._tempVector4);
        d = math_vector/* Vector3 */.Pq.Dot(this._tempVector4, n);
        return d >= 0;
    }
    /**
     * @internal
     */
    _canDoCollision(sphereCenter, sphereRadius, vecMin, vecMax) {
        const distance = math_vector/* Vector3 */.Pq.Distance(this._basePointWorld, sphereCenter);
        const max = Math.max(this._radius.x, this._radius.y, this._radius.z);
        if (distance > this._velocityWorldLength + max + sphereRadius) {
            return false;
        }
        if (!intersectBoxAASphere(vecMin, vecMax, this._basePointWorld, this._velocityWorldLength + max)) {
            return false;
        }
        return true;
    }
    /**
     * @internal
     */
    _testTriangle(faceIndex, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh) {
        let t0;
        let embeddedInPlane = false;
        //defensive programming, actually not needed.
        if (!trianglePlaneArray) {
            trianglePlaneArray = [];
        }
        if (!trianglePlaneArray[faceIndex]) {
            trianglePlaneArray[faceIndex] = new math_plane/* Plane */.Z(0, 0, 0, 0);
            trianglePlaneArray[faceIndex].copyFromPoints(p1, p2, p3);
        }
        const trianglePlane = trianglePlaneArray[faceIndex];
        if (!hasMaterial && !trianglePlane.isFrontFacingTo(this._normalizedVelocity, 0)) {
            return;
        }
        const signedDistToTrianglePlane = trianglePlane.signedDistanceTo(this._basePoint);
        const normalDotVelocity = math_vector/* Vector3 */.Pq.Dot(trianglePlane.normal, this._velocity);
        // if DoubleSidedCheck is false(default), a double sided face will be consided 2 times.
        // if true, it discard the faces having normal not facing velocity
        if (Collider.DoubleSidedCheck && normalDotVelocity > 0.0001) {
            return;
        }
        if (normalDotVelocity == 0) {
            if (Math.abs(signedDistToTrianglePlane) >= 1.0) {
                return;
            }
            embeddedInPlane = true;
            t0 = 0;
        }
        else {
            t0 = (-1.0 - signedDistToTrianglePlane) / normalDotVelocity;
            let t1 = (1.0 - signedDistToTrianglePlane) / normalDotVelocity;
            if (t0 > t1) {
                const temp = t1;
                t1 = t0;
                t0 = temp;
            }
            if (t0 > 1.0 || t1 < 0.0) {
                return;
            }
            if (t0 < 0) {
                t0 = 0;
            }
            if (t0 > 1.0) {
                t0 = 1.0;
            }
        }
        this._collisionPoint.copyFromFloats(0, 0, 0);
        let found = false;
        let t = 1.0;
        if (!embeddedInPlane) {
            this._basePoint.subtractToRef(trianglePlane.normal, this._planeIntersectionPoint);
            this._velocity.scaleToRef(t0, this._tempVector);
            this._planeIntersectionPoint.addInPlace(this._tempVector);
            if (this._checkPointInTriangle(this._planeIntersectionPoint, p1, p2, p3, trianglePlane.normal)) {
                found = true;
                t = t0;
                this._collisionPoint.copyFrom(this._planeIntersectionPoint);
            }
        }
        if (!found) {
            let a = this._velocitySquaredLength;
            this._basePoint.subtractToRef(p1, this._tempVector);
            let b = 2.0 * math_vector/* Vector3 */.Pq.Dot(this._velocity, this._tempVector);
            let c = this._tempVector.lengthSquared() - 1.0;
            let lowestRoot = getLowestRoot(a, b, c, t);
            if (lowestRoot.found) {
                t = lowestRoot.root;
                found = true;
                this._collisionPoint.copyFrom(p1);
            }
            this._basePoint.subtractToRef(p2, this._tempVector);
            b = 2.0 * math_vector/* Vector3 */.Pq.Dot(this._velocity, this._tempVector);
            c = this._tempVector.lengthSquared() - 1.0;
            lowestRoot = getLowestRoot(a, b, c, t);
            if (lowestRoot.found) {
                t = lowestRoot.root;
                found = true;
                this._collisionPoint.copyFrom(p2);
            }
            this._basePoint.subtractToRef(p3, this._tempVector);
            b = 2.0 * math_vector/* Vector3 */.Pq.Dot(this._velocity, this._tempVector);
            c = this._tempVector.lengthSquared() - 1.0;
            lowestRoot = getLowestRoot(a, b, c, t);
            if (lowestRoot.found) {
                t = lowestRoot.root;
                found = true;
                this._collisionPoint.copyFrom(p3);
            }
            p2.subtractToRef(p1, this._edge);
            p1.subtractToRef(this._basePoint, this._baseToVertex);
            let edgeSquaredLength = this._edge.lengthSquared();
            let edgeDotVelocity = math_vector/* Vector3 */.Pq.Dot(this._edge, this._velocity);
            let edgeDotBaseToVertex = math_vector/* Vector3 */.Pq.Dot(this._edge, this._baseToVertex);
            a = edgeSquaredLength * -this._velocitySquaredLength + edgeDotVelocity * edgeDotVelocity;
            b = 2 * (edgeSquaredLength * math_vector/* Vector3 */.Pq.Dot(this._velocity, this._baseToVertex) - edgeDotVelocity * edgeDotBaseToVertex);
            c = edgeSquaredLength * (1.0 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex;
            lowestRoot = getLowestRoot(a, b, c, t);
            if (lowestRoot.found) {
                const f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength;
                if (f >= 0.0 && f <= 1.0) {
                    t = lowestRoot.root;
                    found = true;
                    this._edge.scaleInPlace(f);
                    p1.addToRef(this._edge, this._collisionPoint);
                }
            }
            p3.subtractToRef(p2, this._edge);
            p2.subtractToRef(this._basePoint, this._baseToVertex);
            edgeSquaredLength = this._edge.lengthSquared();
            edgeDotVelocity = math_vector/* Vector3 */.Pq.Dot(this._edge, this._velocity);
            edgeDotBaseToVertex = math_vector/* Vector3 */.Pq.Dot(this._edge, this._baseToVertex);
            a = edgeSquaredLength * -this._velocitySquaredLength + edgeDotVelocity * edgeDotVelocity;
            b = 2 * (edgeSquaredLength * math_vector/* Vector3 */.Pq.Dot(this._velocity, this._baseToVertex) - edgeDotVelocity * edgeDotBaseToVertex);
            c = edgeSquaredLength * (1.0 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex;
            lowestRoot = getLowestRoot(a, b, c, t);
            if (lowestRoot.found) {
                const f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength;
                if (f >= 0.0 && f <= 1.0) {
                    t = lowestRoot.root;
                    found = true;
                    this._edge.scaleInPlace(f);
                    p2.addToRef(this._edge, this._collisionPoint);
                }
            }
            p1.subtractToRef(p3, this._edge);
            p3.subtractToRef(this._basePoint, this._baseToVertex);
            edgeSquaredLength = this._edge.lengthSquared();
            edgeDotVelocity = math_vector/* Vector3 */.Pq.Dot(this._edge, this._velocity);
            edgeDotBaseToVertex = math_vector/* Vector3 */.Pq.Dot(this._edge, this._baseToVertex);
            a = edgeSquaredLength * -this._velocitySquaredLength + edgeDotVelocity * edgeDotVelocity;
            b = 2 * (edgeSquaredLength * math_vector/* Vector3 */.Pq.Dot(this._velocity, this._baseToVertex) - edgeDotVelocity * edgeDotBaseToVertex);
            c = edgeSquaredLength * (1.0 - this._baseToVertex.lengthSquared()) + edgeDotBaseToVertex * edgeDotBaseToVertex;
            lowestRoot = getLowestRoot(a, b, c, t);
            if (lowestRoot.found) {
                const f = (edgeDotVelocity * lowestRoot.root - edgeDotBaseToVertex) / edgeSquaredLength;
                if (f >= 0.0 && f <= 1.0) {
                    t = lowestRoot.root;
                    found = true;
                    this._edge.scaleInPlace(f);
                    p3.addToRef(this._edge, this._collisionPoint);
                }
            }
        }
        if (found) {
            const distToCollisionSquared = t * t * this._velocitySquaredLength;
            if (!this.collisionFound || distToCollisionSquared < this._nearestDistanceSquared) {
                // if collisionResponse is false, collision is not found but the collidedMesh is set anyway.
                // onCollide observable are triggered if collideMesh is set
                // this allow trigger volumes to be created.
                if (hostMesh.collisionResponse) {
                    if (!this.intersectionPoint) {
                        this.intersectionPoint = this._collisionPoint.clone();
                    }
                    else {
                        this.intersectionPoint.copyFrom(this._collisionPoint);
                    }
                    this._nearestDistanceSquared = distToCollisionSquared;
                    this._nearestDistance = Math.sqrt(distToCollisionSquared);
                    this.collisionFound = true;
                }
                this.collidedMesh = hostMesh;
            }
        }
    }
    /**
     * @internal
     */
    _collide(trianglePlaneArray, pts, indices, indexStart, indexEnd, decal, hasMaterial, hostMesh, invertTriangles, triangleStrip = false) {
        if (triangleStrip) {
            if (!indices || indices.length === 0) {
                for (let i = 0; i < pts.length - 2; i += 1) {
                    const p1 = pts[i];
                    const p2 = pts[i + 1];
                    const p3 = pts[i + 2];
                    // stay defensive and don't check against undefined positions.
                    if (!p1 || !p2 || !p3) {
                        continue;
                    }
                    // Handles strip faces one on two is reversed
                    if ((invertTriangles ? 1 : 0) ^ i % 2) {
                        this._testTriangle(i, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh);
                    }
                    else {
                        this._testTriangle(i, trianglePlaneArray, p2, p1, p3, hasMaterial, hostMesh);
                    }
                }
            }
            else {
                for (let i = indexStart; i < indexEnd - 2; i += 1) {
                    const indexA = indices[i];
                    const indexB = indices[i + 1];
                    const indexC = indices[i + 2];
                    if (indexC === 0xffffffff) {
                        i += 2;
                        continue;
                    }
                    const p1 = pts[indexA];
                    const p2 = pts[indexB];
                    const p3 = pts[indexC];
                    // stay defensive and don't check against undefined positions.
                    if (!p1 || !p2 || !p3) {
                        continue;
                    }
                    // Handles strip faces one on two is reversed
                    if ((invertTriangles ? 1 : 0) ^ i % 2) {
                        this._testTriangle(i, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh);
                    }
                    else {
                        this._testTriangle(i, trianglePlaneArray, p2, p1, p3, hasMaterial, hostMesh);
                    }
                }
            }
        }
        else if (!indices || indices.length === 0) {
            for (let i = 0; i < pts.length; i += 3) {
                const p1 = pts[i];
                const p2 = pts[i + 1];
                const p3 = pts[i + 2];
                if (invertTriangles) {
                    this._testTriangle(i, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh);
                }
                else {
                    this._testTriangle(i, trianglePlaneArray, p3, p2, p1, hasMaterial, hostMesh);
                }
            }
        }
        else {
            for (let i = indexStart; i < indexEnd; i += 3) {
                const p1 = pts[indices[i] - decal];
                const p2 = pts[indices[i + 1] - decal];
                const p3 = pts[indices[i + 2] - decal];
                if (invertTriangles) {
                    this._testTriangle(i, trianglePlaneArray, p1, p2, p3, hasMaterial, hostMesh);
                }
                else {
                    this._testTriangle(i, trianglePlaneArray, p3, p2, p1, hasMaterial, hostMesh);
                }
            }
        }
    }
    /**
     * @internal
     */
    _getResponse(pos, vel) {
        pos.addToRef(vel, this._destinationPoint);
        vel.scaleInPlace(this._nearestDistance / vel.length());
        this._basePoint.addToRef(vel, pos);
        pos.subtractToRef(this.intersectionPoint, this._slidePlaneNormal);
        this._slidePlaneNormal.normalize();
        this._slidePlaneNormal.scaleToRef(this._epsilon, this._displacementVector);
        pos.addInPlace(this._displacementVector);
        this.intersectionPoint.addInPlace(this._displacementVector);
        this._slidePlaneNormal.scaleInPlace(math_plane/* Plane */.Z.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint, this._slidePlaneNormal, this._destinationPoint));
        this._destinationPoint.subtractInPlace(this._slidePlaneNormal);
        this._destinationPoint.subtractToRef(this.intersectionPoint, vel);
    }
}
/**
 * If true, it check for double sided faces and only returns 1 collision instead of 2
 */
Collider.DoubleSidedCheck = false;
//# sourceMappingURL=collider.js.map
;// ./node_modules/@babylonjs/core/Collisions/collisionCoordinator.js




/** @internal */
class DefaultCollisionCoordinator {
    constructor() {
        this._scaledPosition = math_vector/* Vector3 */.Pq.Zero();
        this._scaledVelocity = math_vector/* Vector3 */.Pq.Zero();
        this._finalPosition = math_vector/* Vector3 */.Pq.Zero();
    }
    getNewPosition(position, displacement, collider, maximumRetry, excludedMesh, onNewPosition, collisionIndex) {
        position.divideToRef(collider._radius, this._scaledPosition);
        displacement.divideToRef(collider._radius, this._scaledVelocity);
        collider.collidedMesh = null;
        collider._retry = 0;
        collider._initialVelocity = this._scaledVelocity;
        collider._initialPosition = this._scaledPosition;
        this._collideWithWorld(this._scaledPosition, this._scaledVelocity, collider, maximumRetry, this._finalPosition, excludedMesh);
        this._finalPosition.multiplyInPlace(collider._radius);
        //run the callback
        onNewPosition(collisionIndex, this._finalPosition, collider.collidedMesh);
    }
    createCollider() {
        return new Collider();
    }
    init(scene) {
        this._scene = scene;
    }
    _collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh = null) {
        const closeDistance = abstractEngine/* AbstractEngine */.$.CollisionsEpsilon * 10.0;
        if (collider._retry >= maximumRetry) {
            finalPosition.copyFrom(position);
            return;
        }
        // Check if this is a mesh else camera or -1
        const collisionMask = excludedMesh ? excludedMesh.collisionMask : collider.collisionMask;
        collider._initialize(position, velocity, closeDistance);
        // Check if collision detection should happen against specified list of meshes or,
        // if not specified, against all meshes in the scene
        const meshes = (excludedMesh && excludedMesh.surroundingMeshes) || this._scene.meshes;
        for (let index = 0; index < meshes.length; index++) {
            const mesh = meshes[index];
            if (mesh.isEnabled() && mesh.checkCollisions && mesh.subMeshes && mesh !== excludedMesh && (collisionMask & mesh.collisionGroup) !== 0) {
                mesh._checkCollision(collider);
            }
        }
        if (!collider.collisionFound) {
            position.addToRef(velocity, finalPosition);
            return;
        }
        if (velocity.x !== 0 || velocity.y !== 0 || velocity.z !== 0) {
            collider._getResponse(position, velocity);
        }
        if (velocity.length() <= closeDistance) {
            finalPosition.copyFrom(position);
            return;
        }
        collider._retry++;
        this._collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh);
    }
}
core_scene/* Scene */.Z.CollisionCoordinatorFactory = () => {
    return new DefaultCollisionCoordinator();
};
//# sourceMappingURL=collisionCoordinator.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Collisions/pickingInfo.js
var Collisions_pickingInfo = __webpack_require__(30311);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Collisions/intersectionInfo.js
var intersectionInfo = __webpack_require__(77103);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Collisions/meshCollisionData.js
var meshCollisionData = __webpack_require__(76439);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/shaderMaterial.js
var shaderMaterial = __webpack_require__(10917);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/buffer.js
var Meshes_buffer = __webpack_require__(56608);
;// ./node_modules/@babylonjs/core/Collisions/gpuPicker.js





/**
 * Class used to perform a picking operation using GPU
 * GPUPIcker can pick meshes, instances and thin instances
 */
class GPUPicker {
    constructor() {
        this._pickingTexture = null;
        this._idMap = [];
        this._thinIdMap = [];
        this._idColors = [];
        this._meshMaterialMap = new Map();
        this._meshRenderingCount = 0;
        this._attributeName = "instanceMeshID";
        /** Shader language used by the generator */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._pickingInProgress = false;
    }
    /**
     * Gets the shader language used in this generator.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Gets a boolean indicating if the picking is in progress
     */
    get pickingInProgress() {
        return this._pickingInProgress;
    }
    static _IdToRgb(id) {
        GPUPicker._TempColor.r = (id & 0xff0000) >> 16;
        GPUPicker._TempColor.g = (id & 0x00ff00) >> 8;
        GPUPicker._TempColor.b = (id & 0x0000ff) >> 0;
    }
    _getColorIdFromReadBuffer(offset) {
        const r = this._readbuffer[offset];
        const g = this._readbuffer[offset + 1];
        const b = this._readbuffer[offset + 2];
        return (r << 16) + (g << 8) + b;
    }
    static _SetColorData(buffer, i, r, g, b) {
        buffer[i] = r / 255.0;
        buffer[i + 1] = g / 255.0;
        buffer[i + 2] = b / 255.0;
        buffer[i + 3] = 1.0;
    }
    _createRenderTarget(scene, width, height) {
        if (this._pickingTexture) {
            this._pickingTexture.dispose();
        }
        this._pickingTexture = new Textures_renderTargetTexture/* RenderTargetTexture */.$("pickingTexure", { width: width, height: height }, scene, false, undefined, 0, false, 1);
    }
    async _createColorMaterialAsync(scene) {
        if (this._defaultRenderMaterial) {
            this._defaultRenderMaterial.dispose();
        }
        this._defaultRenderMaterial = null;
        const engine = scene.getEngine();
        if (engine.isWebGPU) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
        const defines = [];
        const options = {
            attributes: [Meshes_buffer/* VertexBuffer */.R.PositionKind, this._attributeName, "bakedVertexAnimationSettingsInstanced"],
            uniforms: ["world", "viewProjection", "meshID"],
            needAlphaBlending: false,
            defines: defines,
            useClipPlane: null,
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: async () => {
                if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99949)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 45095))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 29698)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99992))]);
                }
            },
        };
        this._defaultRenderMaterial = new shaderMaterial/* ShaderMaterial */.B("pickingShader", scene, "picking", options, false);
        this._defaultRenderMaterial.onBindObservable.add(this._materialBindCallback, undefined, undefined, this);
    }
    _materialBindCallback(mesh) {
        if (!mesh) {
            return;
        }
        const material = this._meshMaterialMap.get(mesh);
        const effect = material.getEffect();
        if (!mesh.hasInstances && !mesh.isAnInstance && !mesh.hasThinInstances) {
            effect.setColor4("meshID", this._idColors[mesh.uniqueId], 1);
        }
        this._meshRenderingCount++;
    }
    _generateColorData(instanceCount, id, index, r, g, b, onInstance) {
        const colorData = new Float32Array(4 * (instanceCount + 1));
        GPUPicker._SetColorData(colorData, 0, r, g, b);
        for (let i = 0; i < instanceCount; i++) {
            GPUPicker._IdToRgb(id);
            onInstance(i, id);
            GPUPicker._SetColorData(colorData, (i + 1) * 4, GPUPicker._TempColor.r, GPUPicker._TempColor.g, GPUPicker._TempColor.b);
            id++;
        }
        return colorData;
    }
    _generateThinInstanceColorData(instanceCount, id, onInstance) {
        const colorData = new Float32Array(4 * instanceCount);
        for (let i = 0; i < instanceCount; i++) {
            GPUPicker._IdToRgb(id);
            onInstance(i, id);
            GPUPicker._SetColorData(colorData, i * 4, GPUPicker._TempColor.r, GPUPicker._TempColor.g, GPUPicker._TempColor.b);
            id++;
        }
        return colorData;
    }
    /**
     * Set the list of meshes to pick from
     * Set that value to null to clear the list (and avoid leaks)
     * The module will read and delete from the array provided by reference. Disposing the module or setting the value to null will clear the array.
     * @param list defines the list of meshes to pick from
     */
    setPickingList(list) {
        if (this._pickableMeshes) {
            // Cleanup
            for (let index = 0; index < this._pickableMeshes.length; index++) {
                const mesh = this._pickableMeshes[index];
                if (mesh.hasInstances) {
                    mesh.removeVerticesData(this._attributeName);
                }
                if (mesh.hasThinInstances) {
                    mesh.thinInstanceSetBuffer(this._attributeName, null);
                }
                if (this._pickingTexture) {
                    this._pickingTexture.setMaterialForRendering(mesh, undefined);
                }
                const material = this._meshMaterialMap.get(mesh);
                if (material !== this._defaultRenderMaterial) {
                    material.onBindObservable.removeCallback(this._materialBindCallback);
                }
            }
            this._pickableMeshes.length = 0;
            this._meshMaterialMap.clear();
            this._idMap.length = 0;
            this._thinIdMap.length = 0;
            this._idColors.length = 0;
            if (this._pickingTexture) {
                this._pickingTexture.renderList = [];
            }
        }
        if (!list || list.length === 0) {
            return;
        }
        this._pickableMeshes = list;
        // Prepare target
        const scene = ("mesh" in list[0] ? list[0].mesh : list[0]).getScene();
        const engine = scene.getEngine();
        const rttSizeW = engine.getRenderWidth();
        const rttSizeH = engine.getRenderHeight();
        if (!this._pickingTexture) {
            this._createRenderTarget(scene, rttSizeW, rttSizeH);
        }
        else {
            const size = this._pickingTexture.getSize();
            if (size.width !== rttSizeW || size.height !== rttSizeH || this._cachedScene !== scene) {
                this._createRenderTarget(scene, rttSizeW, rttSizeH);
            }
        }
        if (!this._cachedScene || this._cachedScene !== scene) {
            this._createColorMaterialAsync(scene);
        }
        this._cachedScene = scene;
        this._engine = scene.getEngine();
        for (let i = 0; i < list.length; i++) {
            const item = list[i];
            if ("mesh" in item) {
                this._meshMaterialMap.set(item.mesh, item.material);
                list[i] = item.mesh;
            }
            else {
                this._meshMaterialMap.set(item, this._defaultRenderMaterial);
            }
        }
        this._pickingTexture.renderList = [];
        // We will affect colors and create vertex color buffers
        let id = 1;
        for (let index = 0; index < this._pickableMeshes.length; index++) {
            const mesh = this._pickableMeshes[index];
            const material = this._meshMaterialMap.get(mesh);
            if (material !== this._defaultRenderMaterial) {
                material.onBindObservable.add(this._materialBindCallback, undefined, undefined, this);
            }
            this._pickingTexture.setMaterialForRendering(mesh, material);
            this._pickingTexture.renderList.push(mesh);
            if (mesh.isAnInstance) {
                continue; // This will be handled by the source mesh
            }
            GPUPicker._IdToRgb(id);
            if (mesh.hasThinInstances) {
                const colorData = this._generateThinInstanceColorData(mesh.thinInstanceCount, id, (i, id) => {
                    this._thinIdMap[id] = { meshId: index, thinId: i };
                });
                id += mesh.thinInstanceCount;
                mesh.thinInstanceSetBuffer(this._attributeName, colorData, 4);
            }
            else {
                this._idMap[id] = index;
                id++;
                if (mesh.hasInstances) {
                    const instances = mesh.instances;
                    const colorData = this._generateColorData(instances.length, id, index, GPUPicker._TempColor.r, GPUPicker._TempColor.g, GPUPicker._TempColor.b, (i, id) => {
                        const instance = instances[i];
                        this._idMap[id] = this._pickableMeshes.indexOf(instance);
                    });
                    id += instances.length;
                    const engine = mesh.getEngine();
                    const buffer = new Meshes_buffer/* VertexBuffer */.R(engine, colorData, this._attributeName, false, false, 4, true);
                    mesh.setVerticesBuffer(buffer, true);
                }
                else {
                    this._idColors[mesh.uniqueId] = math_color/* Color3 */.v9.FromInts(GPUPicker._TempColor.r, GPUPicker._TempColor.g, GPUPicker._TempColor.b);
                }
            }
        }
    }
    /**
     * Execute a picking operation
     * @param x defines the X coordinates where to run the pick
     * @param y defines the Y coordinates where to run the pick
     * @param disposeWhenDone defines a boolean indicating we do not want to keep resources alive (false by default)
     * @returns A promise with the picking results
     */
    async pickAsync(x, y, disposeWhenDone = false) {
        if (this._pickingInProgress) {
            return null;
        }
        if (!this._pickableMeshes || this._pickableMeshes.length === 0) {
            return null;
        }
        const { x: adjustedX, y: adjustedY, rttSizeW, rttSizeH } = this._prepareForPicking(x, y);
        if (adjustedX < 0 || adjustedY < 0 || adjustedX >= rttSizeW || adjustedY >= rttSizeH) {
            return null;
        }
        this._pickingInProgress = true;
        // Invert Y
        const invertedY = rttSizeH - adjustedY - 1;
        this._preparePickingBuffer(this._engine, rttSizeW, rttSizeH, adjustedX, invertedY);
        return this._executePicking(adjustedX, invertedY, disposeWhenDone);
    }
    /**
     * Execute a picking operation on multiple coordinates
     * @param xy defines the X,Y coordinates where to run the pick
     * @param disposeWhenDone defines a boolean indicating we do not want to keep resources alive (false by default)
     * @returns A promise with the picking results. Always returns an array with the same length as the number of coordinates. The mesh or null at the index where no mesh was picked.
     */
    async multiPickAsync(xy, disposeWhenDone = false) {
        if (this._pickingInProgress) {
            return null;
        }
        if (!this._pickableMeshes || this._pickableMeshes.length === 0 || xy.length === 0) {
            return null;
        }
        if (xy.length === 1) {
            const pi = await this.pickAsync(xy[0].x, xy[0].y, disposeWhenDone);
            return {
                meshes: [pi?.mesh ?? null],
                thinInstanceIndexes: pi?.thinInstanceIndex ? [pi.thinInstanceIndex] : undefined,
            };
        }
        this._pickingInProgress = true;
        let minX = xy[0].x, maxX = xy[0].x, minY = xy[0].y, maxY = xy[0].y;
        for (let i = 1; i < xy.length; i++) {
            const { x, y } = xy[i];
            minX = Math.min(minX, x);
            maxX = Math.max(maxX, x);
            minY = Math.min(minY, y);
            maxY = Math.max(maxY, y);
        }
        const { rttSizeW, rttSizeH } = this._prepareForPicking(minX, minY);
        const w = Math.max(maxX - minX, 1);
        const h = Math.max(maxY - minY, 1);
        const partialCutH = rttSizeH - maxY - 1;
        this._preparePickingBuffer(this._engine, rttSizeW, rttSizeH, minX, partialCutH, w, h);
        return this._executeMultiPicking(xy, minX, maxY, rttSizeH, w, h, disposeWhenDone);
    }
    _prepareForPicking(x, y) {
        const scene = this._cachedScene;
        const engine = scene.getEngine();
        const rttSizeW = engine.getRenderWidth();
        const rttSizeH = engine.getRenderHeight();
        const devicePixelRatio = 1 / engine._hardwareScalingLevel;
        const intX = (devicePixelRatio * x) >> 0;
        const intY = (devicePixelRatio * y) >> 0;
        return { x: intX, y: intY, rttSizeW, rttSizeH };
    }
    _preparePickingBuffer(engine, rttSizeW, rttSizeH, x, y, w = 1, h = 1) {
        this._meshRenderingCount = 0;
        const requiredBufferSize = engine.isWebGPU ? (4 * w * h + 255) & ~255 : 4 * w * h;
        if (!this._readbuffer || this._readbuffer.length < requiredBufferSize) {
            this._readbuffer = new Uint8Array(requiredBufferSize);
        }
        // Do we need to rebuild the RTT?
        const size = this._pickingTexture.getSize();
        if (size.width !== rttSizeW || size.height !== rttSizeH) {
            this._createRenderTarget(this._cachedScene, rttSizeW, rttSizeH);
            this._updateRenderList();
        }
        this._pickingTexture.clearColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
        this._pickingTexture.onBeforeRender = () => {
            this._enableScissor(x, y, w, h);
        };
        this._cachedScene.customRenderTargets.push(this._pickingTexture);
    }
    // pick one pixel
    _executePicking(x, y, disposeWhenDone) {
        return new Promise((resolve, reject) => {
            if (!this._pickingTexture) {
                this._pickingInProgress = false;
                reject();
                return;
            }
            this._pickingTexture.onAfterRender = async () => {
                this._disableScissor();
                if (this._checkRenderStatus()) {
                    this._pickingTexture.onAfterRender = null;
                    let pickedMesh = null;
                    let thinInstanceIndex = undefined;
                    // Remove from the active RTTs
                    const index = this._cachedScene.customRenderTargets.indexOf(this._pickingTexture);
                    if (index > -1) {
                        this._cachedScene.customRenderTargets.splice(index, 1);
                    }
                    // Do the actual picking
                    if (await this._readTexturePixelsAsync(x, y)) {
                        const colorId = this._getColorIdFromReadBuffer(0);
                        // Thin?
                        if (this._thinIdMap[colorId]) {
                            pickedMesh = this._pickableMeshes[this._thinIdMap[colorId].meshId];
                            thinInstanceIndex = this._thinIdMap[colorId].thinId;
                        }
                        else {
                            pickedMesh = this._pickableMeshes[this._idMap[colorId]];
                        }
                    }
                    if (disposeWhenDone) {
                        this.dispose();
                    }
                    this._pickingInProgress = false;
                    if (pickedMesh) {
                        resolve({ mesh: pickedMesh, thinInstanceIndex: thinInstanceIndex });
                    }
                    else {
                        resolve(null);
                    }
                }
            };
        });
    }
    // pick multiple pixels
    _executeMultiPicking(xy, minX, maxY, rttSizeH, w, h, disposeWhenDone) {
        return new Promise((resolve, reject) => {
            if (!this._pickingTexture) {
                this._pickingInProgress = false;
                reject();
                return;
            }
            this._pickingTexture.onAfterRender = async () => {
                this._disableScissor();
                if (this._checkRenderStatus()) {
                    this._pickingTexture.onAfterRender = null;
                    const pickedMeshes = [];
                    const thinInstanceIndexes = [];
                    if (await this._readTexturePixelsAsync(minX, rttSizeH - maxY - 1, w, h)) {
                        for (let i = 0; i < xy.length; i++) {
                            const { pickedMesh, thinInstanceIndex } = this._getMeshFromMultiplePoints(xy[i].x, xy[i].y, minX, maxY, w);
                            pickedMeshes.push(pickedMesh);
                            thinInstanceIndexes.push(thinInstanceIndex ?? 0);
                        }
                    }
                    if (disposeWhenDone) {
                        this.dispose();
                    }
                    this._pickingInProgress = false;
                    resolve({ meshes: pickedMeshes, thinInstanceIndexes: thinInstanceIndexes });
                }
            };
        });
    }
    _enableScissor(x, y, w = 1, h = 1) {
        if (this._engine.enableScissor) {
            this._engine.enableScissor(x, y, w, h);
        }
    }
    _disableScissor() {
        if (this._engine.disableScissor) {
            this._engine.disableScissor();
        }
    }
    /**
     * @returns true if rendering if the picking texture has finished, otherwise false
     */
    _checkRenderStatus() {
        const wasSuccessfull = this._meshRenderingCount > 0;
        if (wasSuccessfull) {
            // Remove from the active RTTs
            const index = this._cachedScene.customRenderTargets.indexOf(this._pickingTexture);
            if (index > -1) {
                this._cachedScene.customRenderTargets.splice(index, 1);
            }
            return true;
        }
        this._meshRenderingCount = 0;
        return false; // Wait for shaders to be ready
    }
    _getMeshFromMultiplePoints(x, y, minX, maxY, w) {
        let offsetX = (x - minX - 1) * 4;
        let offsetY = (maxY - y - 1) * w * 4;
        offsetX = Math.max(offsetX, 0);
        offsetY = Math.max(offsetY, 0);
        const colorId = this._getColorIdFromReadBuffer(offsetX + offsetY);
        let pickedMesh = null;
        let thinInstanceIndex;
        if (colorId > 0) {
            if (this._thinIdMap[colorId]) {
                pickedMesh = this._pickableMeshes[this._thinIdMap[colorId].meshId];
                thinInstanceIndex = this._thinIdMap[colorId].thinId;
            }
            else {
                pickedMesh = this._pickableMeshes[this._idMap[colorId]];
            }
        }
        return { pickedMesh, thinInstanceIndex };
    }
    /**
     * Updates the render list with the current pickable meshes.
     */
    _updateRenderList() {
        this._pickingTexture.renderList = [];
        for (const mesh of this._pickableMeshes) {
            this._pickingTexture.setMaterialForRendering(mesh, this._meshMaterialMap.get(mesh));
            this._pickingTexture.renderList.push(mesh);
        }
    }
    async _readTexturePixelsAsync(x, y, w = 1, h = 1) {
        if (!this._cachedScene || !this._pickingTexture?._texture) {
            return false;
        }
        const engine = this._cachedScene.getEngine();
        await engine._readTexturePixels(this._pickingTexture._texture, w, h, -1, 0, this._readbuffer, true, true, x, y);
        return true;
    }
    /** Release the resources */
    dispose() {
        this.setPickingList(null);
        this._cachedScene = null;
        // Cleaning up
        this._pickingTexture?.dispose();
        this._pickingTexture = null;
        this._defaultRenderMaterial?.dispose();
        this._defaultRenderMaterial = null;
    }
}
GPUPicker._TempColor = {
    r: 0,
    g: 0,
    b: 0,
};
//# sourceMappingURL=gpuPicker.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/picking.fragment.js
var picking_fragment = __webpack_require__(29698);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/picking.vertex.js
var picking_vertex = __webpack_require__(99992);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/picking.fragment.js
var ShadersWGSL_picking_fragment = __webpack_require__(99949);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/picking.vertex.js
var ShadersWGSL_picking_vertex = __webpack_require__(45095);
;// ./node_modules/@babylonjs/core/Collisions/index.js










//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Compat/index.js

//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js + 9 modules
var shaderProcessor = __webpack_require__(19125);
;// ./node_modules/@babylonjs/core/Compute/computeEffect.js





/**
 * Effect wrapping a compute shader and let execute (dispatch) the shader
 */
class ComputeEffect {
    /**
     * Creates a compute effect that can be used to execute a compute shader
     * @param baseName Name of the effect
     * @param options Set of all options to create the effect
     * @param engine The engine the effect is created for
     * @param key Effect Key identifying uniquely compiled shader variants
     */
    constructor(baseName, options, engine, key = "") {
        /**
         * String container all the define statements that should be set on the shader.
         */
        this.defines = "";
        /**
         * Callback that will be called when the shader is compiled.
         */
        this.onCompiled = null;
        /**
         * Callback that will be called if an error occurs during shader compilation.
         */
        this.onError = null;
        /**
         * Unique ID of the effect.
         */
        this.uniqueId = 0;
        /**
         * Observable that will be called when the shader is compiled.
         * It is recommended to use executeWhenCompile() or to make sure that scene.isReady() is called to get this observable raised.
         */
        this.onCompileObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable that will be called if an error occurs during shader compilation.
         */
        this.onErrorObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable that will be called when effect is bound.
         */
        this.onBindObservable = new Misc_observable/* Observable */.cP();
        /**
         * @internal
         * Specifies if the effect was previously ready
         */
        this._wasPreviouslyReady = false;
        this._isReady = false;
        this._compilationError = "";
        /** @internal */
        this._key = "";
        this._computeSourceCodeOverride = "";
        /** @internal */
        this._pipelineContext = null;
        /** @internal */
        this._computeSourceCode = "";
        this._rawComputeSourceCode = "";
        this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        this.name = baseName;
        this._key = key;
        this._engine = engine;
        this.uniqueId = ComputeEffect._UniqueIdSeed++;
        this.defines = options.defines ?? "";
        this.onError = options.onError;
        this.onCompiled = options.onCompiled;
        this._entryPoint = options.entryPoint ?? "main";
        this._shaderStore = shaderStore/* ShaderStore */.l.GetShadersStore(this._shaderLanguage);
        this._shaderRepository = shaderStore/* ShaderStore */.l.GetShadersRepository(this._shaderLanguage);
        this._includeShaderStore = shaderStore/* ShaderStore */.l.GetIncludesShadersStore(this._shaderLanguage);
        let computeSource;
        const hostDocument = (0,domManagement/* IsWindowObjectExist */.BA)() ? this._engine.getHostDocument() : null;
        if (typeof baseName === "string") {
            computeSource = baseName;
        }
        else if (baseName.computeSource) {
            computeSource = "source:" + baseName.computeSource;
        }
        else if (baseName.computeElement) {
            computeSource = hostDocument?.getElementById(baseName.computeElement) || baseName.computeElement;
        }
        else {
            computeSource = baseName.compute || baseName;
        }
        const processorOptions = {
            defines: this.defines.split("\n"),
            indexParameters: undefined,
            isFragment: false,
            shouldUseHighPrecisionShader: false,
            processor: null,
            supportsUniformBuffers: this._engine.supportsUniformBuffers,
            shadersRepository: this._shaderRepository,
            includesShadersStore: this._includeShaderStore,
            version: (this._engine.version * 100).toString(),
            platformName: this._engine.shaderPlatformName,
            processingContext: null,
            isNDCHalfZRange: this._engine.isNDCHalfZRange,
            useReverseDepthBuffer: this._engine.useReverseDepthBuffer,
            processCodeAfterIncludes: (shaderType, code, defines) => {
                if (!defines) {
                    return code;
                }
                // We need to convert #define key value to a const
                for (const define of defines) {
                    const keyValue = define.replace("#define", "").replace(";", "").trim();
                    const split = keyValue.split(" ");
                    if (split.length === 2) {
                        const key = split[0];
                        const value = split[1];
                        if (!isNaN(parseInt(value)) || !isNaN(parseFloat(value))) {
                            code = `const ${key} = ${value};\n` + code;
                        }
                    }
                }
                return code;
            },
        };
        this._loadShader(computeSource, "Compute", "", (computeCode) => {
            (0,shaderProcessor/* Initialize */.pB)(processorOptions);
            (0,shaderProcessor/* PreProcess */.jC)(computeCode, processorOptions, (migratedComputeCode) => {
                this._rawComputeSourceCode = computeCode;
                if (options.processFinalCode) {
                    migratedComputeCode = options.processFinalCode(migratedComputeCode);
                }
                const finalShaders = (0,shaderProcessor/* Finalize */.nO)(migratedComputeCode, "", processorOptions);
                this._useFinalCode(finalShaders.vertexCode, baseName);
            }, this._engine);
        });
    }
    _useFinalCode(migratedCommputeCode, baseName) {
        if (baseName) {
            const compute = baseName.computeElement || baseName.compute || baseName.spectorName || baseName;
            this._computeSourceCode = "//#define SHADER_NAME compute:" + compute + "\n" + migratedCommputeCode;
        }
        else {
            this._computeSourceCode = migratedCommputeCode;
        }
        this._prepareEffect();
    }
    /**
     * Unique key for this effect
     */
    get key() {
        return this._key;
    }
    /**
     * If the effect has been compiled and prepared.
     * @returns if the effect is compiled and prepared.
     */
    isReady() {
        try {
            return this._isReadyInternal();
        }
        catch {
            return false;
        }
    }
    _isReadyInternal() {
        if (this._isReady) {
            return true;
        }
        if (this._pipelineContext) {
            return this._pipelineContext.isReady;
        }
        return false;
    }
    /**
     * The engine the effect was initialized with.
     * @returns the engine.
     */
    getEngine() {
        return this._engine;
    }
    /**
     * The pipeline context for this effect
     * @returns the associated pipeline context
     */
    getPipelineContext() {
        return this._pipelineContext;
    }
    /**
     * The error from the last compilation.
     * @returns the error string.
     */
    getCompilationError() {
        return this._compilationError;
    }
    /**
     * Adds a callback to the onCompiled observable and call the callback immediately if already ready.
     * @param func The callback to be used.
     */
    executeWhenCompiled(func) {
        if (this.isReady()) {
            func(this);
            return;
        }
        this.onCompileObservable.add((effect) => {
            func(effect);
        });
        if (!this._pipelineContext || this._pipelineContext.isAsync) {
            setTimeout(() => {
                this._checkIsReady(null);
            }, 16);
        }
    }
    _checkIsReady(previousPipelineContext) {
        try {
            if (this._isReadyInternal()) {
                return;
            }
        }
        catch (e) {
            this._processCompilationErrors(e, previousPipelineContext);
            return;
        }
        setTimeout(() => {
            this._checkIsReady(previousPipelineContext);
        }, 16);
    }
    _loadShader(shader, key, optionalKey, callback) {
        if (typeof HTMLElement !== "undefined") {
            // DOM element ?
            if (shader instanceof HTMLElement) {
                const shaderCode = (0,domManagement/* GetDOMTextContent */.Zl)(shader);
                callback(shaderCode);
                return;
            }
        }
        // Direct source ?
        if (shader.substring(0, 7) === "source:") {
            callback(shader.substring(7));
            return;
        }
        // Base64 encoded ?
        if (shader.substring(0, 7) === "base64:") {
            const shaderBinary = window.atob(shader.substring(7));
            callback(shaderBinary);
            return;
        }
        // Is in local store ?
        if (this._shaderStore[shader + key + "Shader"]) {
            callback(this._shaderStore[shader + key + "Shader"]);
            return;
        }
        if (optionalKey && this._shaderStore[shader + optionalKey + "Shader"]) {
            callback(this._shaderStore[shader + optionalKey + "Shader"]);
            return;
        }
        let shaderUrl;
        if (shader[0] === "." || shader[0] === "/" || shader.indexOf("http") > -1) {
            shaderUrl = shader;
        }
        else {
            shaderUrl = this._shaderRepository + shader;
        }
        this._engine._loadFile(shaderUrl + "." + key.toLowerCase() + ".fx", callback);
    }
    /**
     * Gets the compute shader source code of this effect
     */
    get computeSourceCode() {
        return this._computeSourceCodeOverride ? this._computeSourceCodeOverride : (this._pipelineContext?._getComputeShaderCode() ?? this._computeSourceCode);
    }
    /**
     * Gets the compute shader source code before it has been processed by the preprocessor
     */
    get rawComputeSourceCode() {
        return this._rawComputeSourceCode;
    }
    /**
     * Prepares the effect
     * @internal
     */
    _prepareEffect() {
        const defines = this.defines;
        const previousPipelineContext = this._pipelineContext;
        this._isReady = false;
        try {
            const engine = this._engine;
            this._pipelineContext = engine.createComputePipelineContext();
            this._pipelineContext._name = this._key;
            engine._prepareComputePipelineContext(this._pipelineContext, this._computeSourceCodeOverride ? this._computeSourceCodeOverride : this._computeSourceCode, this._rawComputeSourceCode, this._computeSourceCodeOverride ? null : defines, this._entryPoint);
            engine._executeWhenComputeStateIsCompiled(this._pipelineContext, (messages) => {
                if (messages && messages.numErrors > 0) {
                    this._processCompilationErrors(messages, previousPipelineContext);
                    return;
                }
                this._compilationError = "";
                this._isReady = true;
                if (this.onCompiled) {
                    this.onCompiled(this);
                }
                this.onCompileObservable.notifyObservers(this);
                this.onCompileObservable.clear();
                if (previousPipelineContext) {
                    this.getEngine()._deleteComputePipelineContext(previousPipelineContext);
                }
            });
            if (this._pipelineContext.isAsync) {
                this._checkIsReady(previousPipelineContext);
            }
        }
        catch (e) {
            this._processCompilationErrors(e, previousPipelineContext);
        }
    }
    _processCompilationErrors(e, previousPipelineContext = null) {
        this._compilationError = "";
        logger/* Logger */.V.Error("Unable to compile compute effect:");
        if (this.defines) {
            logger/* Logger */.V.Error("Defines:\n" + this.defines);
        }
        if (ComputeEffect.LogShaderCodeOnCompilationError) {
            const code = this._pipelineContext?._getComputeShaderCode();
            if (code) {
                logger/* Logger */.V.Error("Compute code:");
                logger/* Logger */.V.Error(code);
            }
        }
        if (typeof e === "string") {
            this._compilationError = e;
            logger/* Logger */.V.Error("Error: " + this._compilationError);
        }
        else {
            for (const message of e.messages) {
                let msg = "";
                if (message.line !== undefined) {
                    msg += "Line " + message.line + ", ";
                }
                if (message.offset !== undefined) {
                    msg += "Offset " + message.offset + ", ";
                }
                if (message.length !== undefined) {
                    msg += "Length " + message.length + ", ";
                }
                msg += message.type + ": " + message.text;
                if (this._compilationError) {
                    this._compilationError += "\n";
                }
                this._compilationError += msg;
                logger/* Logger */.V.Error(msg);
            }
        }
        if (previousPipelineContext) {
            this._pipelineContext = previousPipelineContext;
            this._isReady = true;
        }
        if (this.onError) {
            this.onError(this, this._compilationError);
        }
        this.onErrorObservable.notifyObservers(this);
    }
    /**
     * Release all associated resources.
     **/
    dispose() {
        if (this._pipelineContext) {
            this._pipelineContext.dispose();
        }
        this._engine._releaseComputeEffect(this);
    }
    /**
     * This function will add a new compute shader to the shader store
     * @param name the name of the shader
     * @param computeShader compute shader content
     */
    static RegisterShader(name, computeShader) {
        shaderStore/* ShaderStore */.l.GetShadersStore(1 /* ShaderLanguage.WGSL */)[`${name}ComputeShader`] = computeShader;
    }
}
ComputeEffect._UniqueIdSeed = 0;
/**
 * Enable logging of the shader code when a compilation error occurs
 */
ComputeEffect.LogShaderCodeOnCompilationError = true;
//# sourceMappingURL=computeEffect.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Compute/computeShader.js
var computeShader = __webpack_require__(72266);
;// ./node_modules/@babylonjs/core/Compute/index.js


//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/boundingBox.js
var boundingBox = __webpack_require__(84766);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/boundingInfo.js
var boundingInfo = __webpack_require__(20863);
;// ./node_modules/@babylonjs/core/Culling/Helper/boundingInfoHelper.js
/**
 * Utility class to help with bounding info management
 * Warning: using the BoundingInfoHelper class may be slower than executing calculations on the CPU!
 * This will happen if there are a lot of meshes / few vertices (like with the BrainStem model)
 * The BoundingInfoHelper will perform better if there are few meshes / a lot of vertices
 * #BCNJD4#56 =\> does not use the BoundingInfoHelper class, performs calculations on the CPU
 * #BCNJD4#55 =\> same as #56 but use the BoundingInfoHelper class
 * #BCNJD4#40 =\> example with bones and morphs (webGL2)
 * #BCNJD4#42 =\> example with bones and morphs (webGPU)
 * #HPV2TZ#475 =\> only morph (webGL2)
 * #HPV2TZ#476 =\> only morph (webGPU)
 * #B8B8Z2#51 =\> Large scale test (CPU) =\> for each mesh, this test calculates a bounding box which is the union of the bounding boxes of all the frames in a given animation
 * #B8B8Z2#49 =\> Large scale test (webGL2)
 * #B8B8Z2#50 =\> Large scale test (webGPU)
 */
class BoundingInfoHelper {
    /**
     * Creates a new BoundingInfoHelper
     * @param engine defines the engine to use
     */
    constructor(engine) {
        this._engine = engine;
    }
    async _initializePlatform() {
        if (!this._platform) {
            if (this._engine.getCaps().supportComputeShaders) {
                const module = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 28011));
                this._platform = new module.ComputeShaderBoundingHelper(this._engine);
            }
            else if (this._engine.getCaps().supportTransformFeedbacks) {
                const module = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 17301));
                this._platform = new module.TransformFeedbackBoundingHelper(this._engine);
            }
            else {
                throw new Error("Your engine does not support Compute Shaders or Transform Feedbacks");
            }
        }
    }
    /**
     * Compute the bounding info of a mesh / array of meshes using shaders
     * @param target defines the mesh(es) to update
     * @returns a promise that resolves when the bounding info is/are computed
     */
    async computeAsync(target) {
        await this._initializePlatform();
        return this._platform.processAsync(target);
    }
    /**
     * Register a mesh / array of meshes to be processed per batch
     * This method must be called before calling batchProcess (which can be called several times) and batchFetchResultsAsync
     * @param target defines the mesh(es) to be processed per batch
     * @returns a promise that resolves when the initialization is done
     */
    async batchInitializeAsync(target) {
        await this._initializePlatform();
        return this._platform.registerMeshListAsync(target);
    }
    /**
     * Processes meshes registered with batchRegisterAsync
     * If called multiple times, the second, third, etc calls will perform a union of the bounding boxes calculated in the previous calls
     */
    batchProcess() {
        this._platform.processMeshList();
    }
    /**
     * Update the bounding info of the meshes registered with batchRegisterAsync, after batchProcess has been called once or several times
     * @returns a promise that resolves when the bounding info is/are computed
     */
    async batchFetchResultsAsync() {
        return this._platform.fetchResultsForMeshListAsync();
    }
    /**
     * Dispose and release associated resources
     */
    dispose() {
        this._platform.dispose();
    }
}
//# sourceMappingURL=boundingInfoHelper.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/Helper/transformFeedbackBoundingHelper.js + 2 modules
var transformFeedbackBoundingHelper = __webpack_require__(17301);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/Helper/computeShaderBoundingHelper.js + 1 modules
var computeShaderBoundingHelper = __webpack_require__(28011);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/boundingSphere.js
var boundingSphere = __webpack_require__(27906);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/smartArray.js
var smartArray = __webpack_require__(17931);
;// ./node_modules/@babylonjs/core/Culling/Octrees/octreeBlock.js


/**
 * Class used to store a cell in an octree
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeOctrees
 */
class OctreeBlock {
    /**
     * Creates a new block
     * @param minPoint defines the minimum vector (in world space) of the block's bounding box
     * @param maxPoint defines the maximum vector (in world space) of the block's bounding box
     * @param capacity defines the maximum capacity of this block (if capacity is reached the block will be split into sub blocks)
     * @param depth defines the current depth of this block in the octree
     * @param maxDepth defines the maximal depth allowed (beyond this value, the capacity is ignored)
     * @param creationFunc defines a callback to call when an element is added to the block
     */
    constructor(minPoint, maxPoint, capacity, depth, maxDepth, creationFunc) {
        /**
         * Gets the content of the current block
         */
        this.entries = [];
        this._boundingVectors = new Array();
        this._capacity = capacity;
        this._depth = depth;
        this._maxDepth = maxDepth;
        this._creationFunc = creationFunc;
        this._minPoint = minPoint;
        this._maxPoint = maxPoint;
        this._boundingVectors.push(minPoint.clone());
        this._boundingVectors.push(maxPoint.clone());
        this._boundingVectors.push(minPoint.clone());
        this._boundingVectors[2].x = maxPoint.x;
        this._boundingVectors.push(minPoint.clone());
        this._boundingVectors[3].y = maxPoint.y;
        this._boundingVectors.push(minPoint.clone());
        this._boundingVectors[4].z = maxPoint.z;
        this._boundingVectors.push(maxPoint.clone());
        this._boundingVectors[5].z = minPoint.z;
        this._boundingVectors.push(maxPoint.clone());
        this._boundingVectors[6].x = minPoint.x;
        this._boundingVectors.push(maxPoint.clone());
        this._boundingVectors[7].y = minPoint.y;
    }
    // Property
    /**
     * Gets the maximum capacity of this block (if capacity is reached the block will be split into sub blocks)
     */
    get capacity() {
        return this._capacity;
    }
    /**
     * Gets the minimum vector (in world space) of the block's bounding box
     */
    get minPoint() {
        return this._minPoint;
    }
    /**
     * Gets the maximum vector (in world space) of the block's bounding box
     */
    get maxPoint() {
        return this._maxPoint;
    }
    // Methods
    /**
     * Add a new element to this block
     * @param entry defines the element to add
     */
    addEntry(entry) {
        if (this.blocks) {
            for (let index = 0; index < this.blocks.length; index++) {
                const block = this.blocks[index];
                block.addEntry(entry);
            }
            return;
        }
        this._creationFunc(entry, this);
        if (this.entries.length > this.capacity && this._depth < this._maxDepth) {
            this.createInnerBlocks();
        }
    }
    /**
     * Remove an element from this block
     * @param entry defines the element to remove
     */
    removeEntry(entry) {
        if (this.blocks) {
            for (let index = 0; index < this.blocks.length; index++) {
                const block = this.blocks[index];
                block.removeEntry(entry);
            }
            return;
        }
        const entryIndex = this.entries.indexOf(entry);
        if (entryIndex > -1) {
            this.entries.splice(entryIndex, 1);
        }
    }
    /**
     * Add an array of elements to this block
     * @param entries defines the array of elements to add
     */
    addEntries(entries) {
        for (let index = 0; index < entries.length; index++) {
            const mesh = entries[index];
            this.addEntry(mesh);
        }
    }
    /**
     * Test if the current block intersects the frustum planes and if yes, then add its content to the selection array
     * @param frustumPlanes defines the frustum planes to test
     * @param selection defines the array to store current content if selection is positive
     * @param allowDuplicate defines if the selection array can contains duplicated entries
     */
    select(frustumPlanes, selection, allowDuplicate) {
        if (boundingBox/* BoundingBox */.I.IsInFrustum(this._boundingVectors, frustumPlanes)) {
            if (this.blocks) {
                for (let index = 0; index < this.blocks.length; index++) {
                    const block = this.blocks[index];
                    block.select(frustumPlanes, selection, allowDuplicate);
                }
                return;
            }
            if (allowDuplicate) {
                selection.concat(this.entries);
            }
            else {
                selection.concatWithNoDuplicate(this.entries);
            }
        }
    }
    /**
     * Test if the current block intersect with the given bounding sphere and if yes, then add its content to the selection array
     * @param sphereCenter defines the bounding sphere center
     * @param sphereRadius defines the bounding sphere radius
     * @param selection defines the array to store current content if selection is positive
     * @param allowDuplicate defines if the selection array can contains duplicated entries
     */
    intersects(sphereCenter, sphereRadius, selection, allowDuplicate) {
        if (boundingBox/* BoundingBox */.I.IntersectsSphere(this._minPoint, this._maxPoint, sphereCenter, sphereRadius)) {
            if (this.blocks) {
                for (let index = 0; index < this.blocks.length; index++) {
                    const block = this.blocks[index];
                    block.intersects(sphereCenter, sphereRadius, selection, allowDuplicate);
                }
                return;
            }
            if (allowDuplicate) {
                selection.concat(this.entries);
            }
            else {
                selection.concatWithNoDuplicate(this.entries);
            }
        }
    }
    /**
     * Test if the current block intersect with the given ray and if yes, then add its content to the selection array
     * @param ray defines the ray to test with
     * @param selection defines the array to store current content if selection is positive
     */
    intersectsRay(ray, selection) {
        if (ray.intersectsBoxMinMax(this._minPoint, this._maxPoint)) {
            if (this.blocks) {
                for (let index = 0; index < this.blocks.length; index++) {
                    const block = this.blocks[index];
                    block.intersectsRay(ray, selection);
                }
                return;
            }
            selection.concatWithNoDuplicate(this.entries);
        }
    }
    /**
     * Subdivide the content into child blocks (this block will then be empty)
     */
    createInnerBlocks() {
        OctreeBlock._CreateBlocks(this._minPoint, this._maxPoint, this.entries, this._capacity, this._depth, this._maxDepth, this, this._creationFunc);
        this.entries.splice(0);
    }
    /**
     * @internal
     */
    static _CreateBlocks(worldMin, worldMax, entries, maxBlockCapacity, currentDepth, maxDepth, target, creationFunc) {
        target.blocks = new Array();
        const blockSize = new math_vector/* Vector3 */.Pq((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2);
        // Segmenting space
        for (let x = 0; x < 2; x++) {
            for (let y = 0; y < 2; y++) {
                for (let z = 0; z < 2; z++) {
                    const localMin = worldMin.add(blockSize.multiplyByFloats(x, y, z));
                    const localMax = worldMin.add(blockSize.multiplyByFloats(x + 1, y + 1, z + 1));
                    const block = new OctreeBlock(localMin, localMax, maxBlockCapacity, currentDepth + 1, maxDepth, creationFunc);
                    block.addEntries(entries);
                    target.blocks.push(block);
                }
            }
        }
    }
}
//# sourceMappingURL=octreeBlock.js.map
;// ./node_modules/@babylonjs/core/Culling/Octrees/octree.js


/**
 * Octrees are a really powerful data structure that can quickly select entities based on space coordinates.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeOctrees
 */
class Octree {
    /**
     * Creates a octree
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeOctrees
     * @param creationFunc function to be used to instantiate the octree
     * @param maxBlockCapacity defines the maximum number of meshes you want on your octree's leaves (default: 64)
     * @param maxDepth defines the maximum depth (sub-levels) for your octree. Default value is 2, which means 8 8 8 = 512 blocks :) (This parameter takes precedence over capacity.)
     */
    constructor(creationFunc, maxBlockCapacity, 
    /** [2] Defines the maximum depth (sub-levels) for your octree. Default value is 2, which means 8 8 8 = 512 blocks :) (This parameter takes precedence over capacity.) */
    maxDepth = 2) {
        this.maxDepth = maxDepth;
        /**
         * Content stored in the octree
         */
        this.dynamicContent = [];
        this._maxBlockCapacity = maxBlockCapacity || 64;
        this._selectionContent = new smartArray/* SmartArrayNoDuplicate */.b(1024);
        this._creationFunc = creationFunc;
    }
    // Methods
    /**
     * Updates the octree by adding blocks for the passed in meshes within the min and max world parameters
     * @param worldMin worldMin for the octree blocks var blockSize = new Vector3((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2);
     * @param worldMax worldMax for the octree blocks var blockSize = new Vector3((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2);
     * @param entries meshes to be added to the octree blocks
     */
    update(worldMin, worldMax, entries) {
        OctreeBlock._CreateBlocks(worldMin, worldMax, entries, this._maxBlockCapacity, 0, this.maxDepth, this, this._creationFunc);
    }
    /**
     * Adds a mesh to the octree
     * @param entry Mesh to add to the octree
     */
    addMesh(entry) {
        for (let index = 0; index < this.blocks.length; index++) {
            const block = this.blocks[index];
            block.addEntry(entry);
        }
    }
    /**
     * Remove an element from the octree
     * @param entry defines the element to remove
     */
    removeMesh(entry) {
        for (let index = 0; index < this.blocks.length; index++) {
            const block = this.blocks[index];
            block.removeEntry(entry);
        }
    }
    /**
     * Selects an array of meshes within the frustum
     * @param frustumPlanes The frustum planes to use which will select all meshes within it
     * @param allowDuplicate If duplicate objects are allowed in the resulting object array
     * @returns array of meshes within the frustum
     */
    select(frustumPlanes, allowDuplicate) {
        this._selectionContent.reset();
        for (let index = 0; index < this.blocks.length; index++) {
            const block = this.blocks[index];
            block.select(frustumPlanes, this._selectionContent, allowDuplicate);
        }
        if (allowDuplicate) {
            this._selectionContent.concat(this.dynamicContent);
        }
        else {
            this._selectionContent.concatWithNoDuplicate(this.dynamicContent);
        }
        return this._selectionContent;
    }
    /**
     * Test if the octree intersect with the given bounding sphere and if yes, then add its content to the selection array
     * @param sphereCenter defines the bounding sphere center
     * @param sphereRadius defines the bounding sphere radius
     * @param allowDuplicate defines if the selection array can contains duplicated entries
     * @returns an array of objects that intersect the sphere
     */
    intersects(sphereCenter, sphereRadius, allowDuplicate) {
        this._selectionContent.reset();
        for (let index = 0; index < this.blocks.length; index++) {
            const block = this.blocks[index];
            block.intersects(sphereCenter, sphereRadius, this._selectionContent, allowDuplicate);
        }
        if (allowDuplicate) {
            this._selectionContent.concat(this.dynamicContent);
        }
        else {
            this._selectionContent.concatWithNoDuplicate(this.dynamicContent);
        }
        return this._selectionContent;
    }
    /**
     * Test if the octree intersect with the given ray and if yes, then add its content to resulting array
     * @param ray defines the ray to test with
     * @returns array of intersected objects
     */
    intersectsRay(ray) {
        this._selectionContent.reset();
        for (let index = 0; index < this.blocks.length; index++) {
            const block = this.blocks[index];
            block.intersectsRay(ray, this._selectionContent);
        }
        this._selectionContent.concatWithNoDuplicate(this.dynamicContent);
        return this._selectionContent;
    }
}
/**
 * Adds a mesh into the octree block if it intersects the block
 * @param entry defines the mesh to try to add to the block
 * @param block defines the block where the mesh should be added
 */
Octree.CreationFuncForMeshes = (entry, block) => {
    const boundingInfo = entry.getBoundingInfo();
    if (!entry.isBlocked && boundingInfo.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) {
        block.entries.push(entry);
    }
};
/**
 * Adds a submesh into the octree block if it intersects the block
 * @param entry defines the submesh to try to add to the block
 * @param block defines the block where the submesh should be added
 */
Octree.CreationFuncForSubMeshes = (entry, block) => {
    const boundingInfo = entry.getBoundingInfo();
    if (boundingInfo.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) {
        block.entries.push(entry);
    }
};
//# sourceMappingURL=octree.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/abstractMesh.js
var abstractMesh = __webpack_require__(35985);
;// ./node_modules/@babylonjs/core/Culling/Octrees/octreeSceneComponent.js







core_scene/* Scene */.Z.prototype.createOrUpdateSelectionOctree = function (maxCapacity = 64, maxDepth = 2) {
    let component = this._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_OCTREE);
    if (!component) {
        component = new OctreeSceneComponent(this);
        this._addComponent(component);
    }
    if (!this._selectionOctree) {
        this._selectionOctree = new Octree(Octree.CreationFuncForMeshes, maxCapacity, maxDepth);
    }
    const worldExtends = this.getWorldExtends();
    // Update octree
    this._selectionOctree.update(worldExtends.min, worldExtends.max, this.meshes);
    return this._selectionOctree;
};
Object.defineProperty(core_scene/* Scene */.Z.prototype, "selectionOctree", {
    get: function () {
        return this._selectionOctree;
    },
    enumerable: true,
    configurable: true,
});
/**
 * This function will create an octree to help to select the right submeshes for rendering, picking and collision computations.
 * Please note that you must have a decent number of submeshes to get performance improvements when using an octree
 * @param maxCapacity defines the maximum size of each block (64 by default)
 * @param maxDepth defines the maximum depth to use (no more than 2 levels by default)
 * @returns the new octree
 * @see https://www.babylonjs-playground.com/#NA4OQ#12
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeOctrees
 */
abstractMesh/* AbstractMesh */.u.prototype.createOrUpdateSubmeshesOctree = function (maxCapacity = 64, maxDepth = 2) {
    const scene = this.getScene();
    let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_OCTREE);
    if (!component) {
        component = new OctreeSceneComponent(scene);
        scene._addComponent(component);
    }
    if (!this._submeshesOctree) {
        this._submeshesOctree = new Octree(Octree.CreationFuncForSubMeshes, maxCapacity, maxDepth);
    }
    this.computeWorldMatrix(true);
    const boundingInfo = this.getBoundingInfo();
    // Update octree
    const bbox = boundingInfo.boundingBox;
    this._submeshesOctree.update(bbox.minimumWorld, bbox.maximumWorld, this.subMeshes);
    return this._submeshesOctree;
};
/**
 * Defines the octree scene component responsible to manage any octrees
 * in a given scene.
 */
class OctreeSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name help to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_OCTREE;
        /**
         * Indicates if the meshes have been checked to make sure they are isEnabled()
         */
        this.checksIsEnabled = true;
        this._tempRay = new Culling_ray/* Ray */.Rl(math_vector/* Vector3 */.Pq.Zero(), new math_vector/* Vector3 */.Pq(1, 1, 1));
        scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        if (!scene) {
            return;
        }
        this.scene = scene;
        this.scene.getActiveMeshCandidates = () => this.getActiveMeshCandidates();
        this.scene.getActiveSubMeshCandidates = (mesh) => this.getActiveSubMeshCandidates(mesh);
        this.scene.getCollidingSubMeshCandidates = (mesh, collider) => this.getCollidingSubMeshCandidates(mesh, collider);
        this.scene.getIntersectingSubMeshCandidates = (mesh, localRay) => this.getIntersectingSubMeshCandidates(mesh, localRay);
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene.onMeshRemovedObservable.add((mesh) => {
            const sceneOctree = this.scene.selectionOctree;
            if (sceneOctree !== undefined && sceneOctree !== null) {
                const index = sceneOctree.dynamicContent.indexOf(mesh);
                if (index !== -1) {
                    sceneOctree.dynamicContent.splice(index, 1);
                }
            }
        });
        this.scene.onMeshImportedObservable.add((mesh) => {
            const sceneOctree = this.scene.selectionOctree;
            if (sceneOctree !== undefined && sceneOctree !== null) {
                sceneOctree.addMesh(mesh);
            }
        });
    }
    /**
     * Return the list of active meshes
     * @returns the list of active meshes
     */
    getActiveMeshCandidates() {
        return this.scene._selectionOctree?.select(this.scene.frustumPlanes) || this.scene._getDefaultMeshCandidates();
    }
    /**
     * Return the list of active sub meshes
     * @param mesh The mesh to get the candidates sub meshes from
     * @returns the list of active sub meshes
     */
    getActiveSubMeshCandidates(mesh) {
        if (mesh._submeshesOctree && mesh.useOctreeForRenderingSelection) {
            const intersections = mesh._submeshesOctree.select(this.scene.frustumPlanes);
            return intersections;
        }
        return this.scene._getDefaultSubMeshCandidates(mesh);
    }
    /**
     * Return the list of sub meshes intersecting with a given local ray
     * @param mesh defines the mesh to find the submesh for
     * @param localRay defines the ray in local space
     * @returns the list of intersecting sub meshes
     */
    getIntersectingSubMeshCandidates(mesh, localRay) {
        if (mesh._submeshesOctree && mesh.useOctreeForPicking) {
            Culling_ray/* Ray */.Rl.TransformToRef(localRay, mesh.getWorldMatrix(), this._tempRay);
            const intersections = mesh._submeshesOctree.intersectsRay(this._tempRay);
            return intersections;
        }
        return this.scene._getDefaultSubMeshCandidates(mesh);
    }
    /**
     * Return the list of sub meshes colliding with a collider
     * @param mesh defines the mesh to find the submesh for
     * @param collider defines the collider to evaluate the collision against
     * @returns the list of colliding sub meshes
     */
    getCollidingSubMeshCandidates(mesh, collider) {
        if (mesh._submeshesOctree && mesh.useOctreeForCollisions) {
            const radius = collider._velocityWorldLength + Math.max(collider._radius.x, collider._radius.y, collider._radius.z);
            const intersections = mesh._submeshesOctree.intersects(collider._basePointWorld, radius);
            return intersections;
        }
        return this.scene._getDefaultSubMeshCandidates(mesh);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do here.
    }
    /**
     * Disposes the component and the associated resources.
     */
    dispose() {
        // Nothing to do here.
    }
}
//# sourceMappingURL=octreeSceneComponent.js.map
;// ./node_modules/@babylonjs/core/Culling/Octrees/index.js



//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Culling/index.js
/* eslint-disable import/no-internal-modules */








//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/cylinderBuilder.js







/**
 * Creates the VertexData for a cylinder, cone or prism
 * @param options an object used to set the following optional parameters for the box, required but can be empty
 * * height sets the height (y direction) of the cylinder, optional, default 2
 * * diameterTop sets the diameter of the top of the cone, overwrites diameter,  optional, default diameter
 * * diameterBottom sets the diameter of the bottom of the cone, overwrites diameter,  optional, default diameter
 * * diameter sets the diameter of the top and bottom of the cone, optional default 1
 * * tessellation the number of prism sides, 3 for a triangular prism, optional, default 24
 * * subdivisions` the number of rings along the cylinder height, optional, default 1
 * * arc a number from 0 to 1, to create an unclosed cylinder based on the fraction of the circumference given by the arc value, optional, default 1
 * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
 * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
 * * hasRings when true makes each subdivision independently treated as a face for faceUV and faceColors, optional, default false
 * * enclose when true closes an open cylinder by adding extra flat faces between the height axis and vertical edges, think cut cake
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @returns the VertexData of the cylinder, cone or prism
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function CreateCylinderVertexData(options) {
    const height = options.height || 2;
    let diameterTop = options.diameterTop === 0 ? 0 : options.diameterTop || options.diameter || 1;
    let diameterBottom = options.diameterBottom === 0 ? 0 : options.diameterBottom || options.diameter || 1;
    diameterTop = diameterTop || 0.00001; // Prevent broken normals
    diameterBottom = diameterBottom || 0.00001; // Prevent broken normals
    const tessellation = (options.tessellation || 24) | 0;
    const subdivisions = (options.subdivisions || 1) | 0;
    const hasRings = options.hasRings ? true : false;
    const enclose = options.enclose ? true : false;
    const cap = options.cap === 0 ? 0 : options.cap || Meshes_mesh/* Mesh */.e.CAP_ALL;
    const arc = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0;
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    const faceUV = options.faceUV || new Array(3);
    const faceColors = options.faceColors;
    // default face colors and UV if undefined
    const quadNb = arc !== 1 && enclose ? 2 : 0;
    const ringNb = hasRings ? subdivisions : 1;
    const surfaceNb = 2 + (1 + quadNb) * ringNb;
    let f;
    for (f = 0; f < surfaceNb; f++) {
        if (faceColors && faceColors[f] === undefined) {
            faceColors[f] = new math_color/* Color4 */.ov(1, 1, 1, 1);
        }
    }
    for (f = 0; f < surfaceNb; f++) {
        if (faceUV && faceUV[f] === undefined) {
            faceUV[f] = new math_vector/* Vector4 */.IU(0, 0, 1, 1);
        }
    }
    const indices = [];
    const positions = [];
    const normals = [];
    const uvs = [];
    const colors = [];
    const angleStep = (Math.PI * 2 * arc) / tessellation;
    let angle;
    let h;
    let radius;
    const tan = (diameterBottom - diameterTop) / 2 / height;
    const ringVertex = math_vector/* Vector3 */.Pq.Zero();
    const ringNormal = math_vector/* Vector3 */.Pq.Zero();
    const ringFirstVertex = math_vector/* Vector3 */.Pq.Zero();
    const ringFirstNormal = math_vector/* Vector3 */.Pq.Zero();
    const quadNormal = math_vector/* Vector3 */.Pq.Zero();
    const Y = math_axis/* Axis */._0.Y;
    // positions, normals, uvs
    let i;
    let j;
    let r;
    let ringIdx = 1;
    let s = 1; // surface index
    let cs = 0;
    let v = 0;
    for (i = 0; i <= subdivisions; i++) {
        h = i / subdivisions;
        radius = (h * (diameterTop - diameterBottom) + diameterBottom) / 2;
        ringIdx = hasRings && i !== 0 && i !== subdivisions ? 2 : 1;
        for (r = 0; r < ringIdx; r++) {
            if (hasRings) {
                s += r;
            }
            if (enclose) {
                s += 2 * r;
            }
            for (j = 0; j <= tessellation; j++) {
                angle = j * angleStep;
                // position
                ringVertex.x = Math.cos(-angle) * radius;
                ringVertex.y = -height / 2 + h * height;
                ringVertex.z = Math.sin(-angle) * radius;
                // normal
                if (diameterTop === 0 && i === subdivisions) {
                    // if no top cap, reuse former normals
                    ringNormal.x = normals[normals.length - (tessellation + 1) * 3];
                    ringNormal.y = normals[normals.length - (tessellation + 1) * 3 + 1];
                    ringNormal.z = normals[normals.length - (tessellation + 1) * 3 + 2];
                }
                else {
                    ringNormal.x = ringVertex.x;
                    ringNormal.z = ringVertex.z;
                    ringNormal.y = Math.sqrt(ringNormal.x * ringNormal.x + ringNormal.z * ringNormal.z) * tan;
                    ringNormal.normalize();
                }
                // keep first ring vertex values for enclose
                if (j === 0) {
                    ringFirstVertex.copyFrom(ringVertex);
                    ringFirstNormal.copyFrom(ringNormal);
                }
                positions.push(ringVertex.x, ringVertex.y, ringVertex.z);
                normals.push(ringNormal.x, ringNormal.y, ringNormal.z);
                if (hasRings) {
                    v = cs !== s ? faceUV[s].y : faceUV[s].w;
                }
                else {
                    v = faceUV[s].y + (faceUV[s].w - faceUV[s].y) * h;
                }
                uvs.push(faceUV[s].x + ((faceUV[s].z - faceUV[s].x) * j) / tessellation, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
                if (faceColors) {
                    colors.push(faceColors[s].r, faceColors[s].g, faceColors[s].b, faceColors[s].a);
                }
            }
            // if enclose, add four vertices and their dedicated normals
            if (arc !== 1 && enclose) {
                positions.push(ringVertex.x, ringVertex.y, ringVertex.z);
                positions.push(0, ringVertex.y, 0);
                positions.push(0, ringVertex.y, 0);
                positions.push(ringFirstVertex.x, ringFirstVertex.y, ringFirstVertex.z);
                math_vector/* Vector3 */.Pq.CrossToRef(Y, ringNormal, quadNormal);
                quadNormal.normalize();
                normals.push(quadNormal.x, quadNormal.y, quadNormal.z, quadNormal.x, quadNormal.y, quadNormal.z);
                math_vector/* Vector3 */.Pq.CrossToRef(ringFirstNormal, Y, quadNormal);
                quadNormal.normalize();
                normals.push(quadNormal.x, quadNormal.y, quadNormal.z, quadNormal.x, quadNormal.y, quadNormal.z);
                if (hasRings) {
                    v = cs !== s ? faceUV[s + 1].y : faceUV[s + 1].w;
                }
                else {
                    v = faceUV[s + 1].y + (faceUV[s + 1].w - faceUV[s + 1].y) * h;
                }
                uvs.push(faceUV[s + 1].x, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
                uvs.push(faceUV[s + 1].z, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
                if (hasRings) {
                    v = cs !== s ? faceUV[s + 2].y : faceUV[s + 2].w;
                }
                else {
                    v = faceUV[s + 2].y + (faceUV[s + 2].w - faceUV[s + 2].y) * h;
                }
                uvs.push(faceUV[s + 2].x, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
                uvs.push(faceUV[s + 2].z, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
                if (faceColors) {
                    colors.push(faceColors[s + 1].r, faceColors[s + 1].g, faceColors[s + 1].b, faceColors[s + 1].a);
                    colors.push(faceColors[s + 1].r, faceColors[s + 1].g, faceColors[s + 1].b, faceColors[s + 1].a);
                    colors.push(faceColors[s + 2].r, faceColors[s + 2].g, faceColors[s + 2].b, faceColors[s + 2].a);
                    colors.push(faceColors[s + 2].r, faceColors[s + 2].g, faceColors[s + 2].b, faceColors[s + 2].a);
                }
            }
            if (cs !== s) {
                cs = s;
            }
        }
    }
    // indices
    const e = arc !== 1 && enclose ? tessellation + 4 : tessellation; // correction of number of iteration if enclose
    i = 0;
    for (s = 0; s < subdivisions; s++) {
        let i0 = 0;
        let i1 = 0;
        let i2 = 0;
        let i3 = 0;
        for (j = 0; j < tessellation; j++) {
            i0 = i * (e + 1) + j;
            i1 = (i + 1) * (e + 1) + j;
            i2 = i * (e + 1) + (j + 1);
            i3 = (i + 1) * (e + 1) + (j + 1);
            indices.push(i0, i1, i2);
            indices.push(i3, i2, i1);
        }
        if (arc !== 1 && enclose) {
            // if enclose, add two quads
            indices.push(i0 + 2, i1 + 2, i2 + 2);
            indices.push(i3 + 2, i2 + 2, i1 + 2);
            indices.push(i0 + 4, i1 + 4, i2 + 4);
            indices.push(i3 + 4, i2 + 4, i1 + 4);
        }
        i = hasRings ? i + 2 : i + 1;
    }
    // Caps
    const createCylinderCap = (isTop) => {
        const radius = isTop ? diameterTop / 2 : diameterBottom / 2;
        if (radius === 0) {
            return;
        }
        // Cap positions, normals & uvs
        let angle;
        let circleVector;
        let i;
        const u = isTop ? faceUV[surfaceNb - 1] : faceUV[0];
        let c = null;
        if (faceColors) {
            c = isTop ? faceColors[surfaceNb - 1] : faceColors[0];
        }
        // cap center
        const vbase = positions.length / 3;
        const offset = isTop ? height / 2 : -height / 2;
        const center = new math_vector/* Vector3 */.Pq(0, offset, 0);
        positions.push(center.x, center.y, center.z);
        normals.push(0, isTop ? 1 : -1, 0);
        const v = u.y + (u.w - u.y) * 0.5;
        uvs.push(u.x + (u.z - u.x) * 0.5, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
        if (c) {
            colors.push(c.r, c.g, c.b, c.a);
        }
        const textureScale = new math_vector/* Vector2 */.I9(0.5, 0.5);
        for (i = 0; i <= tessellation; i++) {
            angle = (Math.PI * 2 * i * arc) / tessellation;
            const cos = Math.cos(-angle);
            const sin = Math.sin(-angle);
            circleVector = new math_vector/* Vector3 */.Pq(cos * radius, offset, sin * radius);
            const textureCoordinate = new math_vector/* Vector2 */.I9(cos * textureScale.x + 0.5, sin * textureScale.y + 0.5);
            positions.push(circleVector.x, circleVector.y, circleVector.z);
            normals.push(0, isTop ? 1 : -1, 0);
            const v = u.y + (u.w - u.y) * textureCoordinate.y;
            uvs.push(u.x + (u.z - u.x) * textureCoordinate.x, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
            if (c) {
                colors.push(c.r, c.g, c.b, c.a);
            }
        }
        // Cap indices
        for (i = 0; i < tessellation; i++) {
            if (!isTop) {
                indices.push(vbase);
                indices.push(vbase + (i + 1));
                indices.push(vbase + (i + 2));
            }
            else {
                indices.push(vbase);
                indices.push(vbase + (i + 2));
                indices.push(vbase + (i + 1));
            }
        }
    };
    // add caps to geometry based on cap parameter
    if (cap === Meshes_mesh/* Mesh */.e.CAP_START || cap === Meshes_mesh/* Mesh */.e.CAP_ALL) {
        createCylinderCap(false);
    }
    if (cap === Meshes_mesh/* Mesh */.e.CAP_END || cap === Meshes_mesh/* Mesh */.e.CAP_ALL) {
        createCylinderCap(true);
    }
    // Sides
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    if (faceColors) {
        vertexData.colors = colors;
    }
    return vertexData;
}
/**
 * Creates a cylinder or a cone mesh
 * * The parameter `height` sets the height size (float) of the cylinder/cone (float, default 2).
 * * The parameter `diameter` sets the diameter of the top and bottom cap at once (float, default 1).
 * * The parameters `diameterTop` and `diameterBottom` overwrite the parameter `diameter` and set respectively the top cap and bottom cap diameter (floats, default 1). The parameter "diameterBottom" can't be zero.
 * * The parameter `tessellation` sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance.
 * * The parameter `subdivisions` sets the number of rings along the cylinder height (positive integer, default 1).
 * * The parameter `hasRings` (boolean, default false) makes the subdivisions independent from each other, so they become different faces.
 * * The parameter `enclose`  (boolean, default false) adds two extra faces per subdivision to a sliced cylinder to close it around its height axis.
 * * The parameter `cap` sets the way the cylinder is capped. Possible values : BABYLON.Mesh.NO_CAP, BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL (default).
 * * The parameter `arc` (float, default 1) is the ratio (max 1) to apply to the circumference to slice the cylinder.
 * * You can set different colors and different images to each box side by using the parameters `faceColors` (an array of n Color3 elements) and `faceUV` (an array of n Vector4 elements).
 * * The value of n is the number of cylinder faces. If the cylinder has only 1 subdivisions, n equals : top face + cylinder surface + bottom face = 3
 * * Now, if the cylinder has 5 independent subdivisions (hasRings = true), n equals : top face + 5 stripe surfaces + bottom face = 2 + 5 = 7
 * * Finally, if the cylinder has 5 independent subdivisions and is enclose, n equals : top face + 5 x (stripe surface + 2 closing faces) + bottom face = 2 + 5 * 3 = 17
 * * Each array (color or UVs) is always ordered the same way : the first element is the bottom cap, the last element is the top cap. The other elements are each a ring surface.
 * * If `enclose` is false, a ring surface is one element.
 * * If `enclose` is true, a ring surface is 3 successive elements in the array : the tubular surface, then the two closing faces.
 * * Example how to set colors and textures on a sliced cylinder : https://www.html5gamedevs.com/topic/17945-creating-a-closed-slice-of-a-cylinder/#comment-106379
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the cylinder mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#cylinder-or-cone
 */
function CreateCylinder(name, options = {}, scene) {
    const cylinder = new Meshes_mesh/* Mesh */.e(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    cylinder._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateCylinderVertexData(options);
    vertexData.applyToMesh(cylinder, options.updatable);
    return cylinder;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated Please use CreateCylinder directly
 */
const CylinderBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateCylinder,
};
mesh_vertexData/* VertexData */.P.CreateCylinder = CreateCylinderVertexData;
Meshes_mesh/* Mesh */.e.CreateCylinder = (name, height, diameterTop, diameterBottom, tessellation, subdivisions, scene, updatable, sideOrientation) => {
    if (scene === undefined || !(scene instanceof core_scene/* Scene */.Z)) {
        if (scene !== undefined) {
            sideOrientation = updatable || Meshes_mesh/* Mesh */.e.DEFAULTSIDE;
            updatable = scene;
        }
        scene = subdivisions;
        subdivisions = 1;
    }
    const options = {
        height,
        diameterTop,
        diameterBottom,
        tessellation,
        subdivisions,
        sideOrientation,
        updatable,
    };
    return CreateCylinder(name, options, scene);
};
//# sourceMappingURL=cylinderBuilder.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Gizmos/gizmo.js
var gizmo = __webpack_require__(56956);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Rendering/utilityLayerRenderer.js
var utilityLayerRenderer = __webpack_require__(14797);
;// ./node_modules/@babylonjs/core/Gizmos/axisDragGizmo.js










/**
 * Single axis drag gizmo
 */
class AxisDragGizmo extends gizmo/* Gizmo */.Fq {
    /** Default material used to render when gizmo is not disabled or hovered */
    get coloredMaterial() {
        return this._coloredMaterial;
    }
    /** Material used to render when gizmo is hovered with mouse*/
    get hoverMaterial() {
        return this._hoverMaterial;
    }
    /** Material used to render when gizmo is disabled. typically grey.*/
    get disableMaterial() {
        return this._disableMaterial;
    }
    /**
     * @internal
     */
    static _CreateArrow(scene, material, thickness = 1, isCollider = false) {
        const arrow = new Meshes_transformNode/* TransformNode */.V("arrow", scene);
        const cylinder = CreateCylinder("cylinder", {
            diameterTop: 0,
            height: 0.075,
            diameterBottom: 0.0375 * (1 + (thickness - 1) / 4),
            tessellation: 96,
        }, scene);
        const line = CreateCylinder("cylinder", {
            diameterTop: 0.005 * thickness,
            height: 0.275,
            diameterBottom: 0.005 * thickness,
            tessellation: 96,
        }, scene);
        // Position arrow pointing in its drag axis
        cylinder.parent = arrow;
        cylinder.material = material;
        cylinder.rotation.x = Math.PI / 2;
        cylinder.position.z += 0.3;
        line.parent = arrow;
        line.material = material;
        line.position.z += 0.275 / 2;
        line.rotation.x = Math.PI / 2;
        if (isCollider) {
            line.visibility = 0;
            cylinder.visibility = 0;
        }
        return arrow;
    }
    /**
     * @internal
     */
    static _CreateArrowInstance(scene, arrow) {
        const instance = new Meshes_transformNode/* TransformNode */.V("arrow", scene);
        for (const mesh of arrow.getChildMeshes()) {
            const childInstance = mesh.createInstance(mesh.name);
            childInstance.parent = instance;
        }
        return instance;
    }
    /**
     * Creates an AxisDragGizmo
     * @param dragAxis The axis which the gizmo will be able to drag on
     * @param color The color of the gizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     * @param parent
     * @param thickness display gizmo axis thickness
     * @param hoverColor The color of the gizmo when hovering over and dragging
     * @param disableColor The Color of the gizmo when its disabled
     */
    constructor(dragAxis, color = math_color/* Color3 */.v9.Gray(), gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer, parent = null, thickness = 1, hoverColor = math_color/* Color3 */.v9.Yellow(), disableColor = math_color/* Color3 */.v9.Gray()) {
        super(gizmoLayer);
        this._pointerObserver = null;
        /**
         * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
         */
        this.snapDistance = 0;
        /**
         * Event that fires each time the gizmo snaps to a new location.
         * * snapDistance is the change in distance
         */
        this.onSnapObservable = new Misc_observable/* Observable */.cP();
        this._isEnabled = true;
        this._parent = null;
        this._dragging = false;
        this._parent = parent;
        // Create Material
        this._coloredMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._coloredMaterial.diffuseColor = color;
        this._coloredMaterial.specularColor = color.subtract(new math_color/* Color3 */.v9(0.1, 0.1, 0.1));
        this._hoverMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._hoverMaterial.diffuseColor = hoverColor;
        this._disableMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._disableMaterial.diffuseColor = disableColor;
        this._disableMaterial.alpha = 0.4;
        // Build Mesh + Collider
        const arrow = AxisDragGizmo._CreateArrow(gizmoLayer.utilityLayerScene, this._coloredMaterial, thickness);
        const collider = AxisDragGizmo._CreateArrow(gizmoLayer.utilityLayerScene, this._coloredMaterial, thickness + 4, true);
        // Add to Root Node
        this._gizmoMesh = new Meshes_mesh/* Mesh */.e("", gizmoLayer.utilityLayerScene);
        this._gizmoMesh.addChild(arrow);
        this._gizmoMesh.addChild(collider);
        this._gizmoMesh.lookAt(this._rootMesh.position.add(dragAxis));
        this._gizmoMesh.scaling.scaleInPlace(1 / 3);
        this._gizmoMesh.parent = this._rootMesh;
        let currentSnapDragDistance = 0;
        const tmpSnapEvent = { snapDistance: 0 };
        // Add drag behavior to handle events when the gizmo is dragged
        this.dragBehavior = new pointerDragBehavior/* PointerDragBehavior */.C({ dragAxis: dragAxis });
        this.dragBehavior.moveAttached = false;
        this.dragBehavior.updateDragPlane = false;
        this._rootMesh.addBehavior(this.dragBehavior);
        this.dragBehavior.onDragObservable.add((event) => {
            if (this.attachedNode) {
                // Keep world translation and use it to update world transform
                // if the node has parent, the local transform properties (position, rotation, scale)
                // will be recomputed in _matrixChanged function
                let matrixChanged = false;
                // Snapping logic
                if (this.snapDistance == 0) {
                    this.attachedNode.getWorldMatrix().getTranslationToRef(math_vector/* TmpVectors */.AA.Vector3[2]);
                    math_vector/* TmpVectors */.AA.Vector3[2].addInPlace(event.delta);
                    if (this.dragBehavior.validateDrag(math_vector/* TmpVectors */.AA.Vector3[2])) {
                        if (this.attachedNode.position) {
                            // Required for nodes like lights
                            this.attachedNode.position.addInPlaceFromFloats(event.delta.x, event.delta.y, event.delta.z);
                        }
                        // use _worldMatrix to not force a matrix update when calling GetWorldMatrix especially with Cameras
                        this.attachedNode.getWorldMatrix().addTranslationFromFloats(event.delta.x, event.delta.y, event.delta.z);
                        this.attachedNode.updateCache();
                        matrixChanged = true;
                    }
                }
                else {
                    currentSnapDragDistance += event.dragDistance;
                    if (Math.abs(currentSnapDragDistance) > this.snapDistance) {
                        const dragSteps = Math.floor(Math.abs(currentSnapDragDistance) / this.snapDistance);
                        currentSnapDragDistance = currentSnapDragDistance % this.snapDistance;
                        event.delta.normalizeToRef(math_vector/* TmpVectors */.AA.Vector3[1]);
                        math_vector/* TmpVectors */.AA.Vector3[1].scaleInPlace(this.snapDistance * dragSteps);
                        this.attachedNode.getWorldMatrix().getTranslationToRef(math_vector/* TmpVectors */.AA.Vector3[2]);
                        math_vector/* TmpVectors */.AA.Vector3[2].addInPlace(math_vector/* TmpVectors */.AA.Vector3[1]);
                        if (this.dragBehavior.validateDrag(math_vector/* TmpVectors */.AA.Vector3[2])) {
                            this.attachedNode.getWorldMatrix().addTranslationFromFloats(math_vector/* TmpVectors */.AA.Vector3[1].x, math_vector/* TmpVectors */.AA.Vector3[1].y, math_vector/* TmpVectors */.AA.Vector3[1].z);
                            this.attachedNode.updateCache();
                            tmpSnapEvent.snapDistance = this.snapDistance * dragSteps * Math.sign(currentSnapDragDistance);
                            this.onSnapObservable.notifyObservers(tmpSnapEvent);
                            matrixChanged = true;
                        }
                    }
                }
                if (matrixChanged) {
                    this._matrixChanged();
                }
            }
        });
        this.dragBehavior.onDragStartObservable.add(() => {
            this._dragging = true;
        });
        this.dragBehavior.onDragEndObservable.add(() => {
            this._dragging = false;
        });
        const light = gizmoLayer._getSharedGizmoLight();
        light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(false));
        const cache = {
            gizmoMeshes: arrow.getChildMeshes(),
            colliderMeshes: collider.getChildMeshes(),
            material: this._coloredMaterial,
            hoverMaterial: this._hoverMaterial,
            disableMaterial: this._disableMaterial,
            active: false,
            dragBehavior: this.dragBehavior,
        };
        this._parent?.addToAxisCache(collider, cache);
        this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
            if (this._customMeshSet) {
                return;
            }
            this._isHovered = !!(cache.colliderMeshes.indexOf(pointerInfo?.pickInfo?.pickedMesh) != -1);
            if (!this._parent) {
                const material = this.dragBehavior.enabled ? (this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial) : this._disableMaterial;
                this._setGizmoMeshMaterial(cache.gizmoMeshes, material);
            }
        });
        this.dragBehavior.onEnabledObservable.add((newState) => {
            this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? cache.material : cache.disableMaterial);
        });
    }
    _attachedNodeChanged(value) {
        if (this.dragBehavior) {
            this.dragBehavior.enabled = value ? true : false;
        }
    }
    /**
     * If the gizmo is enabled
     */
    set isEnabled(value) {
        this._isEnabled = value;
        if (!value) {
            this.attachedMesh = null;
            this.attachedNode = null;
        }
        else {
            if (this._parent) {
                this.attachedMesh = this._parent.attachedMesh;
                this.attachedNode = this._parent.attachedNode;
            }
        }
    }
    get isEnabled() {
        return this._isEnabled;
    }
    /**
     * Disposes of the gizmo
     */
    dispose() {
        this.onSnapObservable.clear();
        this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
        this.dragBehavior.detach();
        if (this._gizmoMesh) {
            this._gizmoMesh.dispose();
        }
        [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {
            if (matl) {
                matl.dispose();
            }
        });
        super.dispose();
    }
}
//# sourceMappingURL=axisDragGizmo.js.map
;// ./node_modules/@babylonjs/core/Debug/axesViewer.js





/**
 * The Axes viewer will show 3 axes in a specific point in space
 * @see https://doc.babylonjs.com/toolsAndResources/utilities/World_Axes
 */
class AxesViewer {
    /**
     * Gets or sets a number used to scale line length
     */
    get scaleLines() {
        return this._scaleLines;
    }
    set scaleLines(value) {
        this._scaleLines = value;
        this._xAxis.scaling.setAll(this._scaleLines * this._scaleLinesFactor);
        this._yAxis.scaling.setAll(this._scaleLines * this._scaleLinesFactor);
        this._zAxis.scaling.setAll(this._scaleLines * this._scaleLinesFactor);
    }
    /** Gets the node hierarchy used to render x-axis */
    get xAxis() {
        return this._xAxis;
    }
    /** Gets the node hierarchy used to render y-axis */
    get yAxis() {
        return this._yAxis;
    }
    /** Gets the node hierarchy used to render z-axis */
    get zAxis() {
        return this._zAxis;
    }
    /**
     * Creates a new AxesViewer
     * @param scene defines the hosting scene
     * @param scaleLines defines a number used to scale line length (1 by default)
     * @param renderingGroupId defines a number used to set the renderingGroupId of the meshes (2 by default)
     * @param xAxis defines the node hierarchy used to render the x-axis
     * @param yAxis defines the node hierarchy used to render the y-axis
     * @param zAxis defines the node hierarchy used to render the z-axis
     * @param lineThickness The line thickness to use when creating the arrow. defaults to 1.
     */
    constructor(scene, scaleLines = 1, renderingGroupId = 2, xAxis, yAxis, zAxis, lineThickness = 1) {
        this._scaleLinesFactor = 4;
        this._instanced = false;
        /**
         * Gets the hosting scene
         */
        this.scene = null;
        this._scaleLines = 1;
        scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        if (!scene) {
            return;
        }
        if (!xAxis) {
            const redColoredMaterial = new standardMaterial/* StandardMaterial */.F("xAxisMaterial", scene);
            redColoredMaterial.disableLighting = true;
            redColoredMaterial.emissiveColor = math_color/* Color3 */.v9.Red().scale(0.5);
            xAxis = AxisDragGizmo._CreateArrow(scene, redColoredMaterial, lineThickness);
        }
        if (!yAxis) {
            const greenColoredMaterial = new standardMaterial/* StandardMaterial */.F("yAxisMaterial", scene);
            greenColoredMaterial.disableLighting = true;
            greenColoredMaterial.emissiveColor = math_color/* Color3 */.v9.Green().scale(0.5);
            yAxis = AxisDragGizmo._CreateArrow(scene, greenColoredMaterial, lineThickness);
        }
        if (!zAxis) {
            const blueColoredMaterial = new standardMaterial/* StandardMaterial */.F("zAxisMaterial", scene);
            blueColoredMaterial.disableLighting = true;
            blueColoredMaterial.emissiveColor = math_color/* Color3 */.v9.Blue().scale(0.5);
            zAxis = AxisDragGizmo._CreateArrow(scene, blueColoredMaterial, lineThickness);
        }
        this._xAxis = xAxis;
        this._yAxis = yAxis;
        this._zAxis = zAxis;
        this.scaleLines = scaleLines;
        if (renderingGroupId != null) {
            AxesViewer._SetRenderingGroupId(this._xAxis, renderingGroupId);
            AxesViewer._SetRenderingGroupId(this._yAxis, renderingGroupId);
            AxesViewer._SetRenderingGroupId(this._zAxis, renderingGroupId);
        }
        this.scene = scene;
        this.update(new math_vector/* Vector3 */.Pq(), math_vector/* Vector3 */.Pq.Right(), math_vector/* Vector3 */.Pq.Up(), math_vector/* Vector3 */.Pq.Forward());
    }
    /**
     * Force the viewer to update
     * @param position defines the position of the viewer
     * @param xaxis defines the x axis of the viewer
     * @param yaxis defines the y axis of the viewer
     * @param zaxis defines the z axis of the viewer
     */
    update(position, xaxis, yaxis, zaxis) {
        this._xAxis.position.copyFrom(position);
        this._xAxis.setDirection(xaxis);
        this._yAxis.position.copyFrom(position);
        this._yAxis.setDirection(yaxis);
        this._zAxis.position.copyFrom(position);
        this._zAxis.setDirection(zaxis);
    }
    /**
     * Creates an instance of this axes viewer.
     * @returns a new axes viewer with instanced meshes
     */
    createInstance() {
        const xAxis = AxisDragGizmo._CreateArrowInstance(this.scene, this._xAxis);
        const yAxis = AxisDragGizmo._CreateArrowInstance(this.scene, this._yAxis);
        const zAxis = AxisDragGizmo._CreateArrowInstance(this.scene, this._zAxis);
        const axesViewer = new AxesViewer(this.scene, this.scaleLines, null, xAxis, yAxis, zAxis);
        axesViewer._instanced = true;
        return axesViewer;
    }
    /** Releases resources */
    dispose() {
        if (this._xAxis) {
            this._xAxis.dispose(false, !this._instanced);
        }
        if (this._yAxis) {
            this._yAxis.dispose(false, !this._instanced);
        }
        if (this._zAxis) {
            this._zAxis.dispose(false, !this._instanced);
        }
        this.scene = null;
    }
    static _SetRenderingGroupId(node, id) {
        node.getChildMeshes().forEach((mesh) => {
            mesh.renderingGroupId = id;
        });
    }
}
//# sourceMappingURL=axesViewer.js.map
;// ./node_modules/@babylonjs/core/Debug/boneAxesViewer.js



/**
 * The BoneAxesViewer will attach 3 axes to a specific bone of a specific mesh
 * @see demo here: https://www.babylonjs-playground.com/#0DE8F4#8
 */
class BoneAxesViewer extends AxesViewer {
    /**
     * Creates a new BoneAxesViewer
     * @param scene defines the hosting scene
     * @param bone defines the target bone
     * @param mesh defines the target mesh
     * @param scaleLines defines a scaling factor for line length (1 by default)
     */
    constructor(scene, bone, mesh, scaleLines = 1) {
        super(scene, scaleLines);
        /** Gets current position */
        this.pos = math_vector/* Vector3 */.Pq.Zero();
        /** Gets direction of X axis */
        this.xaxis = math_vector/* Vector3 */.Pq.Zero();
        /** Gets direction of Y axis */
        this.yaxis = math_vector/* Vector3 */.Pq.Zero();
        /** Gets direction of Z axis */
        this.zaxis = math_vector/* Vector3 */.Pq.Zero();
        this.mesh = mesh;
        this.bone = bone;
    }
    /**
     * Force the viewer to update
     */
    update() {
        if (!this.mesh || !this.bone) {
            return;
        }
        const bone = this.bone;
        bone.getAbsolutePositionToRef(this.mesh, this.pos);
        bone.getDirectionToRef(math_axis/* Axis */._0.X, this.mesh, this.xaxis);
        bone.getDirectionToRef(math_axis/* Axis */._0.Y, this.mesh, this.yaxis);
        bone.getDirectionToRef(math_axis/* Axis */._0.Z, this.mesh, this.zaxis);
        super.update(this.pos, this.xaxis, this.yaxis, this.zaxis);
    }
    /** Releases resources */
    dispose() {
        if (this.mesh) {
            this.mesh = null;
            this.bone = null;
            super.dispose();
        }
    }
}
//# sourceMappingURL=boneAxesViewer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Debug/debugLayer.js
var debugLayer = __webpack_require__(15022);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/boxBuilder.js
var boxBuilder = __webpack_require__(96793);
;// ./node_modules/@babylonjs/core/Meshes/Builders/sphereBuilder.js




/**
 * Creates the VertexData for an ellipsoid, defaults to a sphere
 * @param options an object used to set the following optional parameters for the box, required but can be empty
 * * segments sets the number of horizontal strips optional, default 32
 * * diameter sets the axes dimensions, diameterX, diameterY and diameterZ to the value of diameter, optional default 1
 * * diameterX sets the diameterX (x direction) of the ellipsoid, overwrites the diameterX set by diameter, optional, default diameter
 * * diameterY sets the diameterY (y direction) of the ellipsoid, overwrites the diameterY set by diameter, optional, default diameter
 * * diameterZ sets the diameterZ (z direction) of the ellipsoid, overwrites the diameterZ set by diameter, optional, default diameter
 * * arc a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the circumference (latitude) given by the arc value, optional, default 1
 * * slice a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the height (latitude) given by the arc value, optional, default 1
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @returns the VertexData of the ellipsoid
 */
function CreateSphereVertexData(options) {
    const segments = (options.segments || 32) | 0;
    const diameterX = options.diameterX || options.diameter || 1;
    const diameterY = options.diameterY || options.diameter || 1;
    const diameterZ = options.diameterZ || options.diameter || 1;
    const arc = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0;
    const slice = options.slice && options.slice <= 0 ? 1.0 : options.slice || 1.0;
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    const dedupTopBottomIndices = !!options.dedupTopBottomIndices;
    const radius = new math_vector/* Vector3 */.Pq(diameterX / 2, diameterY / 2, diameterZ / 2);
    const totalZRotationSteps = 2 + segments;
    const totalYRotationSteps = 2 * totalZRotationSteps;
    const indices = [];
    const positions = [];
    const normals = [];
    const uvs = [];
    for (let zRotationStep = 0; zRotationStep <= totalZRotationSteps; zRotationStep++) {
        const normalizedZ = zRotationStep / totalZRotationSteps;
        const angleZ = normalizedZ * Math.PI * slice;
        for (let yRotationStep = 0; yRotationStep <= totalYRotationSteps; yRotationStep++) {
            const normalizedY = yRotationStep / totalYRotationSteps;
            const angleY = normalizedY * Math.PI * 2 * arc;
            const rotationZ = math_vector/* Matrix */.uq.RotationZ(-angleZ);
            const rotationY = math_vector/* Matrix */.uq.RotationY(angleY);
            const afterRotZ = math_vector/* Vector3 */.Pq.TransformCoordinates(math_vector/* Vector3 */.Pq.Up(), rotationZ);
            const complete = math_vector/* Vector3 */.Pq.TransformCoordinates(afterRotZ, rotationY);
            const vertex = complete.multiply(radius);
            const normal = complete.divide(radius).normalize();
            positions.push(vertex.x, vertex.y, vertex.z);
            normals.push(normal.x, normal.y, normal.z);
            uvs.push(normalizedY, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - normalizedZ : normalizedZ);
        }
        if (zRotationStep > 0) {
            const verticesCount = positions.length / 3;
            for (let firstIndex = verticesCount - 2 * (totalYRotationSteps + 1); firstIndex + totalYRotationSteps + 2 < verticesCount; firstIndex++) {
                if (dedupTopBottomIndices) {
                    if (zRotationStep > 1) {
                        indices.push(firstIndex);
                        indices.push(firstIndex + 1);
                        indices.push(firstIndex + totalYRotationSteps + 1);
                    }
                    if (zRotationStep < totalZRotationSteps || slice < 1.0) {
                        indices.push(firstIndex + totalYRotationSteps + 1);
                        indices.push(firstIndex + 1);
                        indices.push(firstIndex + totalYRotationSteps + 2);
                    }
                }
                else {
                    indices.push(firstIndex);
                    indices.push(firstIndex + 1);
                    indices.push(firstIndex + totalYRotationSteps + 1);
                    indices.push(firstIndex + totalYRotationSteps + 1);
                    indices.push(firstIndex + 1);
                    indices.push(firstIndex + totalYRotationSteps + 2);
                }
            }
        }
    }
    // Sides
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    // Result
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates a sphere mesh
 * * The parameter `diameter` sets the diameter size (float) of the sphere (default 1)
 * * You can set some different sphere dimensions, for instance to build an ellipsoid, by using the parameters `diameterX`, `diameterY` and `diameterZ` (all by default have the same value of `diameter`)
 * * The parameter `segments` sets the sphere number of horizontal stripes (positive integer, default 32)
 * * You can create an unclosed sphere with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference (latitude) : 2 x PI x ratio
 * * You can create an unclosed sphere on its height with the parameter `slice` (positive float, default1), valued between 0 and 1, what is the height ratio (longitude)
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the sphere mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#sphere
 */
function CreateSphere(name, options = {}, scene = null) {
    const sphere = new Meshes_mesh/* Mesh */.e(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    sphere._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateSphereVertexData(options);
    vertexData.applyToMesh(sphere, options.updatable);
    return sphere;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use CreateSphere directly
 */
const SphereBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateSphere,
};
mesh_vertexData/* VertexData */.P.CreateSphere = CreateSphereVertexData;
Meshes_mesh/* Mesh */.e.CreateSphere = (name, segments, diameter, scene, updatable, sideOrientation) => {
    const options = {
        segments: segments,
        diameterX: diameter,
        diameterY: diameter,
        diameterZ: diameter,
        sideOrientation: sideOrientation,
        updatable: updatable,
    };
    return CreateSphere(name, options, scene);
};
//# sourceMappingURL=sphereBuilder.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/physicsJoint.js
/**
 * This is a holder class for the physics joint created by the physics plugin
 * It holds a set of functions to control the underlying joint
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class PhysicsJoint {
    /**
     * Initializes the physics joint
     * @param type The type of the physics joint
     * @param jointData The data for the physics joint
     */
    constructor(
    /**
     * The type of the physics joint
     */
    type, 
    /**
     * The data for the physics joint
     */
    jointData) {
        this.type = type;
        this.jointData = jointData;
        jointData.nativeParams = jointData.nativeParams || {};
    }
    /**
     * Gets the physics joint
     */
    get physicsJoint() {
        return this._physicsJoint;
    }
    /**
     * Sets the physics joint
     */
    set physicsJoint(newJoint) {
        this._physicsJoint = newJoint;
    }
    /**
     * Sets the physics plugin
     */
    set physicsPlugin(physicsPlugin) {
        this._physicsPlugin = physicsPlugin;
    }
    /**
     * Execute a function that is physics-plugin specific.
     * @param {Function} func the function that will be executed.
     *                        It accepts two parameters: the physics world and the physics joint
     */
    executeNativeFunction(func) {
        func(this._physicsPlugin.world, this._physicsJoint);
    }
}
//TODO check if the native joints are the same
//Joint Types
/**
 * Distance-Joint type
 */
PhysicsJoint.DistanceJoint = 0;
/**
 * Hinge-Joint type
 */
PhysicsJoint.HingeJoint = 1;
/**
 * Ball-and-Socket joint type
 */
PhysicsJoint.BallAndSocketJoint = 2;
/**
 * Wheel-Joint type
 */
PhysicsJoint.WheelJoint = 3;
/**
 * Slider-Joint type
 */
PhysicsJoint.SliderJoint = 4;
//OIMO
/**
 * Prismatic-Joint type
 */
PhysicsJoint.PrismaticJoint = 5;
//
/**
 * Universal-Joint type
 * ENERGY FTW! (compare with this - @see http://ode-wiki.org/wiki/index.php?title=Manual:_Joint_Types_and_Functions)
 */
PhysicsJoint.UniversalJoint = 6;
/**
 * Hinge-Joint 2 type
 */
PhysicsJoint.Hinge2Joint = PhysicsJoint.WheelJoint;
//Cannon
/**
 * Point to Point Joint type.  Similar to a Ball-Joint.  Different in parameters
 */
PhysicsJoint.PointToPointJoint = 8;
//Cannon only at the moment
/**
 * Spring-Joint type
 */
PhysicsJoint.SpringJoint = 9;
/**
 * Lock-Joint type
 */
PhysicsJoint.LockJoint = 10;
/**
 * A class representing a physics distance joint
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class DistanceJoint extends PhysicsJoint {
    /**
     *
     * @param jointData The data for the Distance-Joint
     */
    constructor(jointData) {
        super(PhysicsJoint.DistanceJoint, jointData);
    }
    /**
     * Update the predefined distance.
     * @param maxDistance The maximum preferred distance
     * @param minDistance The minimum preferred distance
     */
    updateDistance(maxDistance, minDistance) {
        this._physicsPlugin.updateDistanceJoint(this, maxDistance, minDistance);
    }
}
/**
 * Represents a Motor-Enabled Joint
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class MotorEnabledJoint extends PhysicsJoint {
    /**
     * Initializes the Motor-Enabled Joint
     * @param type The type of the joint
     * @param jointData The physical joint data for the joint
     */
    constructor(type, jointData) {
        super(type, jointData);
    }
    /**
     * Set the motor values.
     * Attention, this function is plugin specific. Engines won't react 100% the same.
     * @param force the force to apply
     * @param maxForce max force for this motor.
     */
    setMotor(force, maxForce) {
        this._physicsPlugin.setMotor(this, force || 0, maxForce);
    }
    /**
     * Set the motor's limits.
     * Attention, this function is plugin specific. Engines won't react 100% the same.
     * @param upperLimit The upper limit of the motor
     * @param lowerLimit The lower limit of the motor
     */
    setLimit(upperLimit, lowerLimit) {
        this._physicsPlugin.setLimit(this, upperLimit, lowerLimit);
    }
}
/**
 * This class represents a single physics Hinge-Joint
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class HingeJoint extends MotorEnabledJoint {
    /**
     * Initializes the Hinge-Joint
     * @param jointData The joint data for the Hinge-Joint
     */
    constructor(jointData) {
        super(PhysicsJoint.HingeJoint, jointData);
    }
    /**
     * Set the motor values.
     * Attention, this function is plugin specific. Engines won't react 100% the same.
     * @param {number} force the force to apply
     * @param {number} maxForce max force for this motor.
     */
    setMotor(force, maxForce) {
        this._physicsPlugin.setMotor(this, force || 0, maxForce);
    }
    /**
     * Set the motor's limits.
     * Attention, this function is plugin specific. Engines won't react 100% the same.
     * @param upperLimit The upper limit of the motor
     * @param lowerLimit The lower limit of the motor
     */
    setLimit(upperLimit, lowerLimit) {
        this._physicsPlugin.setLimit(this, upperLimit, lowerLimit);
    }
}
/**
 * This class represents a dual hinge physics joint (same as wheel joint)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class Hinge2Joint extends MotorEnabledJoint {
    /**
     * Initializes the Hinge2-Joint
     * @param jointData The joint data for the Hinge2-Joint
     */
    constructor(jointData) {
        super(PhysicsJoint.Hinge2Joint, jointData);
    }
    /**
     * Set the motor values.
     * Attention, this function is plugin specific. Engines won't react 100% the same.
     * @param targetSpeed the speed the motor is to reach
     * @param maxForce max force for this motor.
     * @param motorIndex motor's index, 0 or 1.
     */
    setMotor(targetSpeed, maxForce, motorIndex = 0) {
        this._physicsPlugin.setMotor(this, targetSpeed || 0, maxForce, motorIndex);
    }
    /**
     * Set the motor limits.
     * Attention, this function is plugin specific. Engines won't react 100% the same.
     * @param upperLimit the upper limit
     * @param lowerLimit lower limit
     * @param motorIndex the motor's index, 0 or 1.
     */
    setLimit(upperLimit, lowerLimit, motorIndex = 0) {
        this._physicsPlugin.setLimit(this, upperLimit, lowerLimit, motorIndex);
    }
}
//# sourceMappingURL=physicsJoint.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/physicsImpostor.js






Meshes_mesh/* Mesh */.e._PhysicsImpostorParser = function (scene, physicObject, jsonObject) {
    return new PhysicsImpostor(physicObject, jsonObject.physicsImpostor, {
        mass: jsonObject.physicsMass,
        friction: jsonObject.physicsFriction,
        restitution: jsonObject.physicsRestitution,
    }, scene);
};
/**
 * Represents a physics imposter
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class PhysicsImpostor {
    /**
     * Specifies if the physics imposter is disposed
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Gets the mass of the physics imposter
     */
    get mass() {
        return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0;
    }
    set mass(value) {
        this.setMass(value);
    }
    /**
     * Gets the coefficient of friction
     */
    get friction() {
        return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0;
    }
    /**
     * Sets the coefficient of friction
     */
    set friction(value) {
        if (!this._physicsEngine) {
            return;
        }
        this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, value);
    }
    /**
     * Gets the coefficient of restitution
     */
    get restitution() {
        return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0;
    }
    /**
     * Sets the coefficient of restitution
     */
    set restitution(value) {
        if (!this._physicsEngine) {
            return;
        }
        this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, value);
    }
    /**
     * Gets the pressure of a soft body; only supported by the AmmoJSPlugin
     */
    get pressure() {
        if (!this._physicsEngine) {
            return 0;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.setBodyPressure) {
            return 0;
        }
        return plugin.getBodyPressure(this);
    }
    /**
     * Sets the pressure of a soft body; only supported by the AmmoJSPlugin
     */
    set pressure(value) {
        if (!this._physicsEngine) {
            return;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.setBodyPressure) {
            return;
        }
        plugin.setBodyPressure(this, value);
    }
    /**
     * Gets the stiffness of a soft body; only supported by the AmmoJSPlugin
     */
    get stiffness() {
        if (!this._physicsEngine) {
            return 0;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.getBodyStiffness) {
            return 0;
        }
        return plugin.getBodyStiffness(this);
    }
    /**
     * Sets the stiffness of a soft body; only supported by the AmmoJSPlugin
     */
    set stiffness(value) {
        if (!this._physicsEngine) {
            return;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.setBodyStiffness) {
            return;
        }
        plugin.setBodyStiffness(this, value);
    }
    /**
     * Gets the velocityIterations of a soft body; only supported by the AmmoJSPlugin
     */
    get velocityIterations() {
        if (!this._physicsEngine) {
            return 0;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.getBodyVelocityIterations) {
            return 0;
        }
        return plugin.getBodyVelocityIterations(this);
    }
    /**
     * Sets the velocityIterations of a soft body; only supported by the AmmoJSPlugin
     */
    set velocityIterations(value) {
        if (!this._physicsEngine) {
            return;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.setBodyVelocityIterations) {
            return;
        }
        plugin.setBodyVelocityIterations(this, value);
    }
    /**
     * Gets the positionIterations of a soft body; only supported by the AmmoJSPlugin
     */
    get positionIterations() {
        if (!this._physicsEngine) {
            return 0;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.getBodyPositionIterations) {
            return 0;
        }
        return plugin.getBodyPositionIterations(this);
    }
    /**
     * Sets the positionIterations of a soft body; only supported by the AmmoJSPlugin
     */
    set positionIterations(value) {
        if (!this._physicsEngine) {
            return;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.setBodyPositionIterations) {
            return;
        }
        plugin.setBodyPositionIterations(this, value);
    }
    /**
     * Initializes the physics imposter
     * @param object The physics-enabled object used as the physics imposter
     * @param type The type of the physics imposter. Types are available as static members of this class.
     * @param _options The options for the physics imposter
     * @param _scene The Babylon scene
     */
    constructor(
    /**
     * The physics-enabled object used as the physics imposter
     */
    object, 
    /**
     * The type of the physics imposter
     */
    type, _options = { mass: 0 }, _scene) {
        this.object = object;
        this.type = type;
        this._options = _options;
        this._scene = _scene;
        /** @internal */
        this._pluginData = {};
        this._bodyUpdateRequired = false;
        this._onBeforePhysicsStepCallbacks = new Array();
        this._onAfterPhysicsStepCallbacks = new Array();
        /** @internal */
        this._onPhysicsCollideCallbacks = [];
        this._deltaPosition = math_vector/* Vector3 */.Pq.Zero();
        this._isDisposed = false;
        /**
         * @internal
         */
        this.soft = false;
        /**
         * @internal
         */
        this.segments = 0;
        //temp variables for parent rotation calculations
        //private _mats: Array<Matrix> = [new Matrix(), new Matrix()];
        this._tmpQuat = new math_vector/* Quaternion */.PT();
        this._tmpQuat2 = new math_vector/* Quaternion */.PT();
        /**
         * this function is executed by the physics engine.
         */
        this.beforeStep = () => {
            if (!this._physicsEngine) {
                return;
            }
            this.object.translate(this._deltaPosition, -1);
            this._deltaRotationConjugated &&
                this.object.rotationQuaternion &&
                this.object.rotationQuaternion.multiplyToRef(this._deltaRotationConjugated, this.object.rotationQuaternion);
            this.object.computeWorldMatrix(false);
            if (this.object.parent && this.object.rotationQuaternion) {
                this.getParentsRotation();
                this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this._tmpQuat);
            }
            else {
                this._tmpQuat.copyFrom(this.object.rotationQuaternion || new math_vector/* Quaternion */.PT());
            }
            if (!this._options.disableBidirectionalTransformation) {
                this.object.rotationQuaternion &&
                    this._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(this, /*bInfo.boundingBox.centerWorld*/ this.object.getAbsolutePosition(), this._tmpQuat);
            }
            this._onBeforePhysicsStepCallbacks.forEach((func) => {
                func(this);
            });
        };
        /**
         * this function is executed by the physics engine
         */
        this.afterStep = () => {
            if (!this._physicsEngine) {
                return;
            }
            this._onAfterPhysicsStepCallbacks.forEach((func) => {
                func(this);
            });
            this._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(this);
            // object has now its world rotation. needs to be converted to local.
            if (this.object.parent && this.object.rotationQuaternion) {
                this.getParentsRotation();
                this._tmpQuat.conjugateInPlace();
                this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this.object.rotationQuaternion);
            }
            // take the position set and make it the absolute position of this object.
            this.object.setAbsolutePosition(this.object.position);
            if (this._deltaRotation) {
                this.object.rotationQuaternion && this.object.rotationQuaternion.multiplyToRef(this._deltaRotation, this.object.rotationQuaternion);
                this._deltaPosition.applyRotationQuaternionToRef(this._deltaRotation, PhysicsImpostor._TmpVecs[0]);
                this.object.translate(PhysicsImpostor._TmpVecs[0], 1);
            }
            else {
                this.object.translate(this._deltaPosition, 1);
            }
            this.object.computeWorldMatrix(true);
        };
        /**
         * Legacy collision detection event support
         */
        this.onCollideEvent = null;
        /**
         *  define an onCollide function to call when this impostor collides against a different body
         * @param e collide event data
         */
        this.onCollide = (e) => {
            if (!this._onPhysicsCollideCallbacks.length && !this.onCollideEvent) {
                return;
            }
            if (!this._physicsEngine) {
                return;
            }
            const otherImpostor = this._physicsEngine.getImpostorWithPhysicsBody(e.body);
            if (otherImpostor) {
                // Legacy collision detection event support
                if (this.onCollideEvent) {
                    this.onCollideEvent(this, otherImpostor);
                }
                this._onPhysicsCollideCallbacks
                    .filter((obj) => {
                    return obj.otherImpostors.indexOf(otherImpostor) !== -1;
                })
                    .forEach((obj) => {
                    obj.callback(this, otherImpostor, e.point, e.distance, e.impulse, e.normal);
                });
            }
        };
        //sanity check!
        if (!this.object) {
            logger/* Logger */.V.Error("No object was provided. A physics object is obligatory");
            return;
        }
        if (this.object.parent && _options.mass !== 0) {
            logger/* Logger */.V.Warn("A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur.");
        }
        // Legacy support for old syntax.
        if (!this._scene && object.getScene) {
            this._scene = object.getScene();
        }
        if (!this._scene) {
            return;
        }
        if (this.type > 100) {
            this.soft = true;
        }
        this._physicsEngine = this._scene.getPhysicsEngine();
        if (!this._physicsEngine) {
            logger/* Logger */.V.Error("Physics not enabled. Please use scene.enablePhysics(...) before creating impostors.");
        }
        else {
            //set the object's quaternion, if not set
            if (!this.object.rotationQuaternion) {
                if (this.object.rotation) {
                    this.object.rotationQuaternion = math_vector/* Quaternion */.PT.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z);
                }
                else {
                    this.object.rotationQuaternion = new math_vector/* Quaternion */.PT();
                }
            }
            //default options params
            this._options.mass = _options.mass === void 0 ? 0 : _options.mass;
            this._options.friction = _options.friction === void 0 ? 0.2 : _options.friction;
            this._options.restitution = _options.restitution === void 0 ? 0.2 : _options.restitution;
            if (this.soft) {
                //softbody mass must be above 0;
                this._options.mass = this._options.mass > 0 ? this._options.mass : 1;
                this._options.pressure = _options.pressure === void 0 ? 200 : _options.pressure;
                this._options.stiffness = _options.stiffness === void 0 ? 1 : _options.stiffness;
                this._options.velocityIterations = _options.velocityIterations === void 0 ? 20 : _options.velocityIterations;
                this._options.positionIterations = _options.positionIterations === void 0 ? 20 : _options.positionIterations;
                this._options.fixedPoints = _options.fixedPoints === void 0 ? 0 : _options.fixedPoints;
                this._options.margin = _options.margin === void 0 ? 0 : _options.margin;
                this._options.damping = _options.damping === void 0 ? 0 : _options.damping;
                this._options.path = _options.path === void 0 ? null : _options.path;
                this._options.shape = _options.shape === void 0 ? null : _options.shape;
            }
            this._joints = [];
            //If the mesh has a parent, don't initialize the physicsBody. Instead wait for the parent to do that.
            if (!this.object.parent || this._options.ignoreParent) {
                this._init();
            }
            else if (this.object.parent.physicsImpostor) {
                logger/* Logger */.V.Warn("You must affect impostors to children before affecting impostor to parent.");
            }
        }
    }
    /**
     * This function will completely initialize this impostor.
     * It will create a new body - but only if this mesh has no parent.
     * If it has, this impostor will not be used other than to define the impostor
     * of the child mesh.
     * @internal
     */
    _init() {
        if (!this._physicsEngine) {
            return;
        }
        this._physicsEngine.removeImpostor(this);
        this.physicsBody = null;
        this._parent = this._parent || this._getPhysicsParent();
        if (!this._isDisposed && (!this.parent || this._options.ignoreParent)) {
            this._physicsEngine.addImpostor(this);
        }
    }
    _getPhysicsParent() {
        if (this.object.parent instanceof abstractMesh/* AbstractMesh */.u) {
            const parentMesh = this.object.parent;
            return parentMesh.physicsImpostor;
        }
        return null;
    }
    /**
     * Should a new body be generated.
     * @returns boolean specifying if body initialization is required
     */
    isBodyInitRequired() {
        return this._bodyUpdateRequired || (!this._physicsBody && (!this._parent || !!this._options.ignoreParent));
    }
    /**
     * Sets the updated scaling
     */
    setScalingUpdated() {
        this.forceUpdate();
    }
    /**
     * Force a regeneration of this or the parent's impostor's body.
     * Use with caution - This will remove all previously-instantiated joints.
     */
    forceUpdate() {
        this._init();
        if (this.parent && !this._options.ignoreParent) {
            this.parent.forceUpdate();
        }
    }
    /*public get mesh(): AbstractMesh {
        return this._mesh;
    }*/
    /**
     * Gets the body that holds this impostor. Either its own, or its parent.
     */
    get physicsBody() {
        return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody;
    }
    /**
     * Get the parent of the physics imposter
     * @returns Physics imposter or null
     */
    get parent() {
        return !this._options.ignoreParent && this._parent ? this._parent : null;
    }
    /**
     * Sets the parent of the physics imposter
     */
    set parent(value) {
        this._parent = value;
    }
    /**
     * Set the physics body. Used mainly by the physics engine/plugin
     */
    set physicsBody(physicsBody) {
        if (this._physicsBody && this._physicsEngine) {
            this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this);
        }
        this._physicsBody = physicsBody;
        this.resetUpdateFlags();
    }
    /**
     * Resets the update flags
     */
    resetUpdateFlags() {
        this._bodyUpdateRequired = false;
    }
    /**
     * Gets the object extents
     * @returns the object extents
     */
    getObjectExtents() {
        if (this.object.getBoundingInfo) {
            const q = this.object.rotationQuaternion;
            const scaling = this.object.scaling.clone();
            //reset rotation
            this.object.rotationQuaternion = PhysicsImpostor.IDENTITY_QUATERNION;
            //calculate the world matrix with no rotation
            const worldMatrix = this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);
            if (worldMatrix) {
                worldMatrix.decompose(scaling, undefined, undefined);
            }
            const boundingInfo = this.object.getBoundingInfo();
            // get the global scaling of the object
            const size = boundingInfo.boundingBox.extendSize.scale(2).multiplyInPlace(scaling);
            size.x = Math.abs(size.x);
            size.y = Math.abs(size.y);
            size.z = Math.abs(size.z);
            //bring back the rotation
            this.object.rotationQuaternion = q;
            //calculate the world matrix with the new rotation
            this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);
            return size;
        }
        else {
            return PhysicsImpostor.DEFAULT_OBJECT_SIZE;
        }
    }
    /**
     * Gets the object center
     * @returns The object center
     */
    getObjectCenter() {
        if (this.object.getBoundingInfo) {
            const boundingInfo = this.object.getBoundingInfo();
            return boundingInfo.boundingBox.centerWorld;
        }
        else {
            return this.object.position;
        }
    }
    /**
     * Get a specific parameter from the options parameters
     * @param paramName The object parameter name
     * @returns The object parameter
     */
    getParam(paramName) {
        return this._options[paramName];
    }
    /**
     * Sets a specific parameter in the options given to the physics plugin
     * @param paramName The parameter name
     * @param value The value of the parameter
     */
    setParam(paramName, value) {
        this._options[paramName] = value;
        this._bodyUpdateRequired = true;
    }
    /**
     * Specifically change the body's mass. Won't recreate the physics body object
     * @param mass The mass of the physics imposter
     */
    setMass(mass) {
        if (this.getParam("mass") !== mass) {
            this.setParam("mass", mass);
        }
        if (this._physicsEngine) {
            this._physicsEngine.getPhysicsPlugin().setBodyMass(this, mass);
        }
    }
    /**
     * Gets the linear velocity
     * @returns  linear velocity or null
     */
    getLinearVelocity() {
        return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : math_vector/* Vector3 */.Pq.Zero();
    }
    /**
     * Sets the linear velocity
     * @param velocity  linear velocity or null
     */
    setLinearVelocity(velocity) {
        if (this._physicsEngine) {
            this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, velocity);
        }
    }
    /**
     * Gets the angular velocity
     * @returns angular velocity or null
     */
    getAngularVelocity() {
        return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : math_vector/* Vector3 */.Pq.Zero();
    }
    /**
     * Sets the angular velocity
     * @param velocity The velocity or null
     */
    setAngularVelocity(velocity) {
        if (this._physicsEngine) {
            this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, velocity);
        }
    }
    /**
     * Execute a function with the physics plugin native code
     * Provide a function the will have two variables - the world object and the physics body object
     * @param func The function to execute with the physics plugin native code
     */
    executeNativeFunction(func) {
        if (this._physicsEngine) {
            func(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody);
        }
    }
    /**
     * Register a function that will be executed before the physics world is stepping forward
     * @param func The function to execute before the physics world is stepped forward
     */
    registerBeforePhysicsStep(func) {
        this._onBeforePhysicsStepCallbacks.push(func);
    }
    /**
     * Unregister a function that will be executed before the physics world is stepping forward
     * @param func The function to execute before the physics world is stepped forward
     */
    unregisterBeforePhysicsStep(func) {
        const index = this._onBeforePhysicsStepCallbacks.indexOf(func);
        if (index > -1) {
            this._onBeforePhysicsStepCallbacks.splice(index, 1);
        }
        else {
            logger/* Logger */.V.Warn("Function to remove was not found");
        }
    }
    /**
     * Register a function that will be executed after the physics step
     * @param func The function to execute after physics step
     */
    registerAfterPhysicsStep(func) {
        this._onAfterPhysicsStepCallbacks.push(func);
    }
    /**
     * Unregisters a function that will be executed after the physics step
     * @param func The function to execute after physics step
     */
    unregisterAfterPhysicsStep(func) {
        const index = this._onAfterPhysicsStepCallbacks.indexOf(func);
        if (index > -1) {
            this._onAfterPhysicsStepCallbacks.splice(index, 1);
        }
        else {
            logger/* Logger */.V.Warn("Function to remove was not found");
        }
    }
    /**
     * register a function that will be executed when this impostor collides against a different body
     * @param collideAgainst Physics imposter, or array of physics imposters to collide against
     * @param func Callback that is executed on collision
     */
    registerOnPhysicsCollide(collideAgainst, func) {
        const collidedAgainstList = collideAgainst instanceof Array ? collideAgainst : [collideAgainst];
        this._onPhysicsCollideCallbacks.push({ callback: func, otherImpostors: collidedAgainstList });
    }
    /**
     * Unregisters the physics imposter's collision callback
     * @param collideAgainst The physics object to collide against
     * @param func Callback to execute on collision
     */
    unregisterOnPhysicsCollide(collideAgainst, func) {
        const collidedAgainstList = collideAgainst instanceof Array ? collideAgainst : [collideAgainst];
        let index = -1;
        const found = this._onPhysicsCollideCallbacks.some((cbDef, idx) => {
            if (cbDef.callback === func && cbDef.otherImpostors.length === collidedAgainstList.length) {
                // chcek the arrays match
                const sameList = cbDef.otherImpostors.every((impostor) => {
                    return collidedAgainstList.indexOf(impostor) > -1;
                });
                if (sameList) {
                    index = idx;
                }
                return sameList;
            }
            return false;
        });
        if (found) {
            this._onPhysicsCollideCallbacks.splice(index, 1);
        }
        else {
            logger/* Logger */.V.Warn("Function to remove was not found");
        }
    }
    /**
     * Get the parent rotation
     * @returns The parent rotation
     */
    getParentsRotation() {
        let parent = this.object.parent;
        this._tmpQuat.copyFromFloats(0, 0, 0, 1);
        while (parent) {
            if (parent.rotationQuaternion) {
                this._tmpQuat2.copyFrom(parent.rotationQuaternion);
            }
            else {
                math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(parent.rotation.y, parent.rotation.x, parent.rotation.z, this._tmpQuat2);
            }
            this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat);
            parent = parent.parent;
        }
        return this._tmpQuat;
    }
    /**
     * Apply a force
     * @param force The force to apply
     * @param contactPoint The contact point for the force
     * @returns The physics imposter
     */
    applyForce(force, contactPoint) {
        if (this._physicsEngine) {
            this._physicsEngine.getPhysicsPlugin().applyForce(this, force, contactPoint);
        }
        return this;
    }
    /**
     * Apply an impulse
     * @param force The impulse force
     * @param contactPoint The contact point for the impulse force
     * @returns The physics imposter
     */
    applyImpulse(force, contactPoint) {
        if (this._physicsEngine) {
            this._physicsEngine.getPhysicsPlugin().applyImpulse(this, force, contactPoint);
        }
        return this;
    }
    /**
     * A help function to create a joint
     * @param otherImpostor A physics imposter used to create a joint
     * @param jointType The type of joint
     * @param jointData The data for the joint
     * @returns The physics imposter
     */
    createJoint(otherImpostor, jointType, jointData) {
        const joint = new PhysicsJoint(jointType, jointData);
        this.addJoint(otherImpostor, joint);
        return this;
    }
    /**
     * Add a joint to this impostor with a different impostor
     * @param otherImpostor A physics imposter used to add a joint
     * @param joint The joint to add
     * @returns The physics imposter
     */
    addJoint(otherImpostor, joint) {
        this._joints.push({
            otherImpostor: otherImpostor,
            joint: joint,
        });
        if (this._physicsEngine) {
            this._physicsEngine.addJoint(this, otherImpostor, joint);
        }
        return this;
    }
    /**
     * Add an anchor to a cloth impostor
     * @param otherImpostor rigid impostor to anchor to
     * @param width ratio across width from 0 to 1
     * @param height ratio up height from 0 to 1
     * @param influence the elasticity between cloth impostor and anchor from 0, very stretchy to 1, little stretch
     * @param noCollisionBetweenLinkedBodies when true collisions between cloth impostor and anchor are ignored; default false
     * @returns impostor the soft imposter
     */
    addAnchor(otherImpostor, width, height, influence, noCollisionBetweenLinkedBodies) {
        if (!this._physicsEngine) {
            return this;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.appendAnchor) {
            return this;
        }
        if (this._physicsEngine) {
            plugin.appendAnchor(this, otherImpostor, width, height, influence, noCollisionBetweenLinkedBodies);
        }
        return this;
    }
    /**
     * Add a hook to a rope impostor
     * @param otherImpostor rigid impostor to anchor to
     * @param length ratio across rope from 0 to 1
     * @param influence the elasticity between rope impostor and anchor from 0, very stretchy to 1, little stretch
     * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
     * @returns impostor the rope imposter
     */
    addHook(otherImpostor, length, influence, noCollisionBetweenLinkedBodies) {
        if (!this._physicsEngine) {
            return this;
        }
        const plugin = this._physicsEngine.getPhysicsPlugin();
        if (!plugin.appendAnchor) {
            return this;
        }
        if (this._physicsEngine) {
            plugin.appendHook(this, otherImpostor, length, influence, noCollisionBetweenLinkedBodies);
        }
        return this;
    }
    /**
     * Will keep this body still, in a sleep mode.
     * @returns the physics imposter
     */
    sleep() {
        if (this._physicsEngine) {
            this._physicsEngine.getPhysicsPlugin().sleepBody(this);
        }
        return this;
    }
    /**
     * Wake the body up.
     * @returns The physics imposter
     */
    wakeUp() {
        if (this._physicsEngine) {
            this._physicsEngine.getPhysicsPlugin().wakeUpBody(this);
        }
        return this;
    }
    /**
     * Clones the physics imposter
     * @param newObject The physics imposter clones to this physics-enabled object
     * @returns A nullable physics imposter
     */
    clone(newObject) {
        if (!newObject) {
            return null;
        }
        return new PhysicsImpostor(newObject, this.type, this._options, this._scene);
    }
    /**
     * Disposes the physics imposter
     */
    dispose( /*disposeChildren: boolean = true*/) {
        //no dispose if no physics engine is available.
        if (!this._physicsEngine) {
            return;
        }
        this._joints.forEach((j) => {
            if (this._physicsEngine) {
                this._physicsEngine.removeJoint(this, j.otherImpostor, j.joint);
            }
        });
        //dispose the physics body
        this._physicsEngine.removeImpostor(this);
        if (this.parent) {
            this.parent.forceUpdate();
        }
        else {
            /*this._object.getChildMeshes().forEach(function(mesh) {
                if (mesh.physicsImpostor) {
                    if (disposeChildren) {
                        mesh.physicsImpostor.dispose();
                        mesh.physicsImpostor = null;
                    }
                }
            })*/
        }
        this._isDisposed = true;
    }
    /**
     * Sets the delta position
     * @param position The delta position amount
     */
    setDeltaPosition(position) {
        this._deltaPosition.copyFrom(position);
    }
    /**
     * Sets the delta rotation
     * @param rotation The delta rotation amount
     */
    setDeltaRotation(rotation) {
        if (!this._deltaRotation) {
            this._deltaRotation = new math_vector/* Quaternion */.PT();
        }
        this._deltaRotation.copyFrom(rotation);
        this._deltaRotationConjugated = this._deltaRotation.conjugate();
    }
    /**
     * Gets the box size of the physics imposter and stores the result in the input parameter
     * @param result Stores the box size
     * @returns The physics imposter
     */
    getBoxSizeToRef(result) {
        if (this._physicsEngine) {
            this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, result);
        }
        return this;
    }
    /**
     * Gets the radius of the physics imposter
     * @returns Radius of the physics imposter
     */
    getRadius() {
        return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0;
    }
    /**
     * Sync a bone with this impostor
     * @param bone The bone to sync to the impostor.
     * @param boneMesh The mesh that the bone is influencing.
     * @param jointPivot The pivot of the joint / bone in local space.
     * @param distToJoint Optional distance from the impostor to the joint.
     * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.
     */
    syncBoneWithImpostor(bone, boneMesh, jointPivot, distToJoint, adjustRotation) {
        const tempVec = PhysicsImpostor._TmpVecs[0];
        const mesh = this.object;
        if (mesh.rotationQuaternion) {
            if (adjustRotation) {
                const tempQuat = PhysicsImpostor._TmpQuat;
                mesh.rotationQuaternion.multiplyToRef(adjustRotation, tempQuat);
                bone.setRotationQuaternion(tempQuat, 1 /* Space.WORLD */, boneMesh);
            }
            else {
                bone.setRotationQuaternion(mesh.rotationQuaternion, 1 /* Space.WORLD */, boneMesh);
            }
        }
        tempVec.x = 0;
        tempVec.y = 0;
        tempVec.z = 0;
        if (jointPivot) {
            tempVec.x = jointPivot.x;
            tempVec.y = jointPivot.y;
            tempVec.z = jointPivot.z;
            bone.getDirectionToRef(tempVec, boneMesh, tempVec);
            if (distToJoint === undefined || distToJoint === null) {
                distToJoint = jointPivot.length();
            }
            tempVec.x *= distToJoint;
            tempVec.y *= distToJoint;
            tempVec.z *= distToJoint;
        }
        if (bone.getParent()) {
            tempVec.addInPlace(mesh.getAbsolutePosition());
            bone.setAbsolutePosition(tempVec, boneMesh);
        }
        else {
            boneMesh.setAbsolutePosition(mesh.getAbsolutePosition());
            boneMesh.position.x -= tempVec.x;
            boneMesh.position.y -= tempVec.y;
            boneMesh.position.z -= tempVec.z;
        }
    }
    /**
     * Sync impostor to a bone
     * @param bone The bone that the impostor will be synced to.
     * @param boneMesh The mesh that the bone is influencing.
     * @param jointPivot The pivot of the joint / bone in local space.
     * @param distToJoint Optional distance from the impostor to the joint.
     * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.
     * @param boneAxis Optional vector3 axis the bone is aligned with
     */
    syncImpostorWithBone(bone, boneMesh, jointPivot, distToJoint, adjustRotation, boneAxis) {
        const mesh = this.object;
        if (mesh.rotationQuaternion) {
            if (adjustRotation) {
                const tempQuat = PhysicsImpostor._TmpQuat;
                bone.getRotationQuaternionToRef(1 /* Space.WORLD */, boneMesh, tempQuat);
                tempQuat.multiplyToRef(adjustRotation, mesh.rotationQuaternion);
            }
            else {
                bone.getRotationQuaternionToRef(1 /* Space.WORLD */, boneMesh, mesh.rotationQuaternion);
            }
        }
        const pos = PhysicsImpostor._TmpVecs[0];
        const boneDir = PhysicsImpostor._TmpVecs[1];
        if (!boneAxis) {
            boneAxis = PhysicsImpostor._TmpVecs[2];
            boneAxis.x = 0;
            boneAxis.y = 1;
            boneAxis.z = 0;
        }
        bone.getDirectionToRef(boneAxis, boneMesh, boneDir);
        bone.getAbsolutePositionToRef(boneMesh, pos);
        if ((distToJoint === undefined || distToJoint === null) && jointPivot) {
            distToJoint = jointPivot.length();
        }
        if (distToJoint !== undefined && distToJoint !== null) {
            pos.x += boneDir.x * distToJoint;
            pos.y += boneDir.y * distToJoint;
            pos.z += boneDir.z * distToJoint;
        }
        mesh.setAbsolutePosition(pos);
    }
}
/**
 * The default object size of the imposter
 */
PhysicsImpostor.DEFAULT_OBJECT_SIZE = new math_vector/* Vector3 */.Pq(1, 1, 1);
/**
 * The identity quaternion of the imposter
 */
PhysicsImpostor.IDENTITY_QUATERNION = math_vector/* Quaternion */.PT.Identity();
PhysicsImpostor._TmpVecs = (0,arrayTools/* BuildArray */.mI)(3, math_vector/* Vector3 */.Pq.Zero);
PhysicsImpostor._TmpQuat = math_vector/* Quaternion */.PT.Identity();
//Impostor types
/**
 * No-Imposter type
 */
PhysicsImpostor.NoImpostor = 0;
/**
 * Sphere-Imposter type
 */
PhysicsImpostor.SphereImpostor = 1;
/**
 * Box-Imposter type
 */
PhysicsImpostor.BoxImpostor = 2;
/**
 * Plane-Imposter type
 */
PhysicsImpostor.PlaneImpostor = 3;
/**
 * Mesh-imposter type (Only available to objects with vertices data)
 */
PhysicsImpostor.MeshImpostor = 4;
/**
 * Capsule-Impostor type (Ammo.js plugin only)
 */
PhysicsImpostor.CapsuleImpostor = 6;
/**
 * Cylinder-Imposter type
 */
PhysicsImpostor.CylinderImpostor = 7;
/**
 * Particle-Imposter type
 */
PhysicsImpostor.ParticleImpostor = 8;
/**
 * Heightmap-Imposter type
 */
PhysicsImpostor.HeightmapImpostor = 9;
/**
 * ConvexHull-Impostor type (Ammo.js plugin only)
 */
PhysicsImpostor.ConvexHullImpostor = 10;
/**
 * Custom-Imposter type (Ammo.js plugin only)
 */
PhysicsImpostor.CustomImpostor = 100;
/**
 * Rope-Imposter type
 */
PhysicsImpostor.RopeImpostor = 101;
/**
 * Cloth-Imposter type
 */
PhysicsImpostor.ClothImpostor = 102;
/**
 * Softbody-Imposter type
 */
PhysicsImpostor.SoftbodyImpostor = 103;
//# sourceMappingURL=physicsImpostor.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/capsuleBuilder.js




/**
 * Scripts based off of https://github.com/maximeq/three-js-capsule-geometry/blob/master/src/CapsuleBufferGeometry.js
 * @param options the constructors options used to shape the mesh.
 * @returns the capsule VertexData
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/capsule
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function CreateCapsuleVertexData(options = {
    subdivisions: 2,
    tessellation: 16,
    height: 1,
    radius: 0.25,
    capSubdivisions: 6,
}) {
    const subdivisions = Math.max(options.subdivisions ? options.subdivisions : 2, 1) | 0;
    const tessellation = Math.max(options.tessellation ? options.tessellation : 16, 3) | 0;
    const height = Math.max(options.height ? options.height : 1, 0);
    const radius = Math.max(options.radius ? options.radius : 0.25, 0);
    const capDetail = Math.max(options.capSubdivisions ? options.capSubdivisions : 6, 1) | 0;
    const radialSegments = tessellation;
    const heightSegments = subdivisions;
    const radiusTop = Math.max(options.radiusTop ? options.radiusTop : radius, 0);
    const radiusBottom = Math.max(options.radiusBottom ? options.radiusBottom : radius, 0);
    const heightMinusCaps = height - (radiusTop + radiusBottom);
    const thetaStart = 0.0;
    const thetaLength = 2.0 * Math.PI;
    const capsTopSegments = Math.max(options.topCapSubdivisions ? options.topCapSubdivisions : capDetail, 1);
    const capsBottomSegments = Math.max(options.bottomCapSubdivisions ? options.bottomCapSubdivisions : capDetail, 1);
    const alpha = Math.acos((radiusBottom - radiusTop) / height);
    let indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    let index = 0;
    const indexArray = [], halfHeight = heightMinusCaps * 0.5;
    const pi2 = Math.PI * 0.5;
    let x, y;
    const normal = math_vector/* Vector3 */.Pq.Zero();
    const vertex = math_vector/* Vector3 */.Pq.Zero();
    const cosAlpha = Math.cos(alpha);
    const sinAlpha = Math.sin(alpha);
    const coneLength = new math_vector/* Vector2 */.I9(radiusTop * sinAlpha, halfHeight + radiusTop * cosAlpha)
        .subtract(new math_vector/* Vector2 */.I9(radiusBottom * sinAlpha, -halfHeight + radiusBottom * cosAlpha))
        .length();
    // Total length for v texture coord
    const vl = radiusTop * alpha + coneLength + radiusBottom * (pi2 - alpha);
    let v = 0;
    for (y = 0; y <= capsTopSegments; y++) {
        const indexRow = [];
        const a = pi2 - alpha * (y / capsTopSegments);
        v += (radiusTop * alpha) / capsTopSegments;
        const cosA = Math.cos(a);
        const sinA = Math.sin(a);
        // calculate the radius of the current row
        const _radius = cosA * radiusTop;
        for (x = 0; x <= radialSegments; x++) {
            const u = x / radialSegments;
            const theta = u * thetaLength + thetaStart;
            const sinTheta = Math.sin(theta);
            const cosTheta = Math.cos(theta);
            // vertex
            vertex.x = _radius * sinTheta;
            vertex.y = halfHeight + sinA * radiusTop;
            vertex.z = _radius * cosTheta;
            vertices.push(vertex.x, vertex.y, vertex.z);
            // normal
            normal.set(cosA * sinTheta, sinA, cosA * cosTheta);
            normals.push(normal.x, normal.y, normal.z);
            // uv
            uvs.push(u, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? v / vl : 1 - v / vl);
            // save index of vertex in respective row
            indexRow.push(index);
            // increase index
            index++;
        }
        // now save vertices of the row in our index array
        indexArray.push(indexRow);
    }
    const coneHeight = height - radiusTop - radiusBottom + cosAlpha * radiusTop - cosAlpha * radiusBottom;
    const slope = (sinAlpha * (radiusBottom - radiusTop)) / coneHeight;
    for (y = 1; y <= heightSegments; y++) {
        const indexRow = [];
        v += coneLength / heightSegments;
        // calculate the radius of the current row
        const _radius = sinAlpha * ((y * (radiusBottom - radiusTop)) / heightSegments + radiusTop);
        for (x = 0; x <= radialSegments; x++) {
            const u = x / radialSegments;
            const theta = u * thetaLength + thetaStart;
            const sinTheta = Math.sin(theta);
            const cosTheta = Math.cos(theta);
            // vertex
            vertex.x = _radius * sinTheta;
            vertex.y = halfHeight + cosAlpha * radiusTop - (y * coneHeight) / heightSegments;
            vertex.z = _radius * cosTheta;
            vertices.push(vertex.x, vertex.y, vertex.z);
            // normal
            normal.set(sinTheta, slope, cosTheta).normalize();
            normals.push(normal.x, normal.y, normal.z);
            // uv
            uvs.push(u, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? v / vl : 1 - v / vl);
            // save index of vertex in respective row
            indexRow.push(index);
            // increase index
            index++;
        }
        // now save vertices of the row in our index array
        indexArray.push(indexRow);
    }
    for (y = 1; y <= capsBottomSegments; y++) {
        const indexRow = [];
        const a = pi2 - alpha - (Math.PI - alpha) * (y / capsBottomSegments);
        v += (radiusBottom * alpha) / capsBottomSegments;
        const cosA = Math.cos(a);
        const sinA = Math.sin(a);
        // calculate the radius of the current row
        const _radius = cosA * radiusBottom;
        for (x = 0; x <= radialSegments; x++) {
            const u = x / radialSegments;
            const theta = u * thetaLength + thetaStart;
            const sinTheta = Math.sin(theta);
            const cosTheta = Math.cos(theta);
            // vertex
            vertex.x = _radius * sinTheta;
            vertex.y = -halfHeight + sinA * radiusBottom;
            vertex.z = _radius * cosTheta;
            vertices.push(vertex.x, vertex.y, vertex.z);
            // normal
            normal.set(cosA * sinTheta, sinA, cosA * cosTheta);
            normals.push(normal.x, normal.y, normal.z);
            // uv
            uvs.push(u, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? v / vl : 1 - v / vl);
            // save index of vertex in respective row
            indexRow.push(index);
            // increase index
            index++;
        }
        // now save vertices of the row in our index array
        indexArray.push(indexRow);
    }
    // generate indices
    for (x = 0; x < radialSegments; x++) {
        for (y = 0; y < capsTopSegments + heightSegments + capsBottomSegments; y++) {
            // we use the index array to access the correct indices
            const i1 = indexArray[y][x];
            const i2 = indexArray[y + 1][x];
            const i3 = indexArray[y + 1][x + 1];
            const i4 = indexArray[y][x + 1];
            // face one
            indices.push(i1);
            indices.push(i2);
            indices.push(i4);
            // face two
            indices.push(i2);
            indices.push(i3);
            indices.push(i4);
        }
    }
    indices = indices.reverse();
    if (options.orientation && !options.orientation.equals(math_vector/* Vector3 */.Pq.Up())) {
        const m = new math_vector/* Matrix */.uq();
        options.orientation
            .clone()
            .scale(Math.PI * 0.5)
            .cross(math_vector/* Vector3 */.Pq.Up())
            .toQuaternion()
            .toRotationMatrix(m);
        const v = math_vector/* Vector3 */.Pq.Zero();
        for (let i = 0; i < vertices.length; i += 3) {
            v.set(vertices[i], vertices[i + 1], vertices[i + 2]);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(v.clone(), m, v);
            vertices[i] = v.x;
            vertices[i + 1] = v.y;
            vertices[i + 2] = v.z;
        }
    }
    const vDat = new mesh_vertexData/* VertexData */.P();
    vDat.positions = vertices;
    vDat.normals = normals;
    vDat.uvs = uvs;
    vDat.indices = indices;
    return vDat;
}
/**
 * Creates a capsule or a pill mesh
 * @param name defines the name of the mesh
 * @param options The constructors options.
 * @param scene The scene the mesh is scoped to.
 * @returns Capsule Mesh
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function CreateCapsule(name, options = {
    orientation: math_vector/* Vector3 */.Pq.Up(),
    subdivisions: 2,
    tessellation: 16,
    height: 1,
    radius: 0.25,
    capSubdivisions: 6,
    updatable: false,
}, scene = null) {
    const capsule = new Meshes_mesh/* Mesh */.e(name, scene);
    const vertexData = CreateCapsuleVertexData(options);
    vertexData.applyToMesh(capsule, options.updatable);
    return capsule;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated please use CreateCapsule directly
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
const CapsuleBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateCapsule,
};
/**
 * Creates a capsule or a pill mesh
 * @param name defines the name of the mesh.
 * @param options the constructors options used to shape the mesh.
 * @param scene defines the scene the mesh is scoped to.
 * @returns the capsule mesh
 * @see https://doc.babylonjs.com/how_to/capsule_shape
 */
Meshes_mesh/* Mesh */.e.CreateCapsule = (name, options, scene) => {
    return CreateCapsule(name, options, scene);
};
mesh_vertexData/* VertexData */.P.CreateCapsule = CreateCapsuleVertexData;
//# sourceMappingURL=capsuleBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/ribbonBuilder.js





/**
 * Creates the VertexData for a Ribbon
 * @param options an object used to set the following optional parameters for the ribbon, required but can be empty
 * * pathArray array of paths, each of which an array of successive Vector3
 * * closeArray creates a seam between the first and the last paths of the pathArray, optional, default false
 * * closePath creates a seam between the first and the last points of each path of the path array, optional, default false
 * * offset a positive integer, only used when pathArray contains a single path (offset = 10 means the point 1 is joined to the point 11), default rounded half size of the pathArray length
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * * invertUV swaps in the U and V coordinates when applying a texture, optional, default false
 * * uvs a linear array, of length 2 * number of vertices, of custom UV values, optional
 * * colors a linear array, of length 4 * number of vertices, of custom color values, optional
 * @returns the VertexData of the ribbon
 */
function CreateRibbonVertexData(options) {
    let pathArray = options.pathArray;
    const closeArray = options.closeArray || false;
    const closePath = options.closePath || false;
    const invertUV = options.invertUV || false;
    const defaultOffset = Math.floor(pathArray[0].length / 2);
    let offset = options.offset || defaultOffset;
    offset = offset > defaultOffset ? defaultOffset : Math.floor(offset); // offset max allowed : defaultOffset
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    const customUV = options.uvs;
    const customColors = options.colors;
    const positions = [];
    const indices = [];
    const normals = [];
    const uvs = [];
    const us = []; // us[path_id] = [uDist1, uDist2, uDist3 ... ] distances between points on path path_id
    const vs = []; // vs[i] = [vDist1, vDist2, vDist3, ... ] distances between points i of consecutive paths from pathArray
    const uTotalDistance = []; // uTotalDistance[p] : total distance of path p
    const vTotalDistance = []; //  vTotalDistance[i] : total distance between points i of first and last path from pathArray
    let minlg; // minimal length among all paths from pathArray
    const lg = []; // array of path lengths : nb of vertex per path
    const idx = []; // array of path indexes : index of each path (first vertex) in the total vertex number
    let p; // path iterator
    let i; // point iterator
    let j; // point iterator
    // if single path in pathArray
    if (pathArray.length < 2) {
        const ar1 = [];
        const ar2 = [];
        for (i = 0; i < pathArray[0].length - offset; i++) {
            ar1.push(pathArray[0][i]);
            ar2.push(pathArray[0][i + offset]);
        }
        pathArray = [ar1, ar2];
    }
    // positions and horizontal distances (u)
    let idc = 0;
    const closePathCorr = closePath ? 1 : 0; // the final index will be +1 if closePath
    const closeArrayCorr = closeArray ? 1 : 0;
    let path;
    let l;
    minlg = pathArray[0].length;
    let vectlg;
    let dist;
    for (p = 0; p < pathArray.length + closeArrayCorr; p++) {
        uTotalDistance[p] = 0;
        us[p] = [0];
        path = p === pathArray.length ? pathArray[0] : pathArray[p];
        l = path.length;
        minlg = minlg < l ? minlg : l;
        j = 0;
        while (j < l) {
            positions.push(path[j].x, path[j].y, path[j].z);
            if (j > 0) {
                vectlg = path[j].subtract(path[j - 1]).length();
                dist = vectlg + uTotalDistance[p];
                us[p].push(dist);
                uTotalDistance[p] = dist;
            }
            j++;
        }
        if (closePath) {
            // an extra hidden vertex is added in the "positions" array
            j--;
            positions.push(path[0].x, path[0].y, path[0].z);
            vectlg = path[j].subtract(path[0]).length();
            dist = vectlg + uTotalDistance[p];
            us[p].push(dist);
            uTotalDistance[p] = dist;
        }
        lg[p] = l + closePathCorr;
        idx[p] = idc;
        idc += l + closePathCorr;
    }
    // vertical distances (v)
    let path1;
    let path2;
    let vertex1 = null;
    let vertex2 = null;
    for (i = 0; i < minlg + closePathCorr; i++) {
        vTotalDistance[i] = 0;
        vs[i] = [0];
        for (p = 0; p < pathArray.length - 1 + closeArrayCorr; p++) {
            path1 = pathArray[p];
            path2 = p === pathArray.length - 1 ? pathArray[0] : pathArray[p + 1];
            if (i === minlg) {
                // closePath
                vertex1 = path1[0];
                vertex2 = path2[0];
            }
            else {
                vertex1 = path1[i];
                vertex2 = path2[i];
            }
            vectlg = vertex2.subtract(vertex1).length();
            dist = vectlg + vTotalDistance[i];
            vs[i].push(dist);
            vTotalDistance[i] = dist;
        }
    }
    // uvs
    let u;
    let v;
    if (customUV) {
        for (p = 0; p < customUV.length; p++) {
            uvs.push(customUV[p].x, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - customUV[p].y : customUV[p].y);
        }
    }
    else {
        for (p = 0; p < pathArray.length + closeArrayCorr; p++) {
            for (i = 0; i < minlg + closePathCorr; i++) {
                u = uTotalDistance[p] != 0.0 ? us[p][i] / uTotalDistance[p] : 0.0;
                v = vTotalDistance[i] != 0.0 ? vs[i][p] / vTotalDistance[i] : 0.0;
                if (invertUV) {
                    uvs.push(v, u);
                }
                else {
                    uvs.push(u, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - v : v);
                }
            }
        }
    }
    // indices
    p = 0; // path index
    let pi = 0; // positions array index
    let l1 = lg[p] - 1; // path1 length
    let l2 = lg[p + 1] - 1; // path2 length
    let min = l1 < l2 ? l1 : l2; // current path stop index
    let shft = idx[1] - idx[0]; // shift
    const path1nb = lg.length - 1; // number of path1 to iterate on
    while (pi <= min && p < path1nb) {
        //  stay under min and don't go over next to last path
        // draw two triangles between path1 (p1) and path2 (p2) : (p1.pi, p2.pi, p1.pi+1) and (p2.pi+1, p1.pi+1, p2.pi) clockwise
        indices.push(pi, pi + shft, pi + 1);
        indices.push(pi + shft + 1, pi + 1, pi + shft);
        pi += 1;
        if (pi === min) {
            // if end of one of two consecutive paths reached, go to next existing path
            p++;
            shft = idx[p + 1] - idx[p];
            l1 = lg[p] - 1;
            l2 = lg[p + 1] - 1;
            pi = idx[p];
            min = l1 < l2 ? l1 + pi : l2 + pi;
        }
    }
    // normals
    mesh_vertexData/* VertexData */.P.ComputeNormals(positions, indices, normals);
    if (closePath) {
        // update both the first and last vertex normals to their average value
        let indexFirst = 0;
        let indexLast = 0;
        for (p = 0; p < pathArray.length; p++) {
            indexFirst = idx[p] * 3;
            if (p + 1 < pathArray.length) {
                indexLast = (idx[p + 1] - 1) * 3;
            }
            else {
                indexLast = normals.length - 3;
            }
            normals[indexFirst] = (normals[indexFirst] + normals[indexLast]) * 0.5;
            normals[indexFirst + 1] = (normals[indexFirst + 1] + normals[indexLast + 1]) * 0.5;
            normals[indexFirst + 2] = (normals[indexFirst + 2] + normals[indexLast + 2]) * 0.5;
            const l = Math.sqrt(normals[indexFirst] * normals[indexFirst] + normals[indexFirst + 1] * normals[indexFirst + 1] + normals[indexFirst + 2] * normals[indexFirst + 2]);
            normals[indexFirst] /= l;
            normals[indexFirst + 1] /= l;
            normals[indexFirst + 2] /= l;
            normals[indexLast] = normals[indexFirst];
            normals[indexLast + 1] = normals[indexFirst + 1];
            normals[indexLast + 2] = normals[indexFirst + 2];
        }
    }
    if (closeArray) {
        let indexFirst = idx[0] * 3;
        let indexLast = idx[pathArray.length] * 3;
        for (i = 0; i < minlg + closePathCorr; i++) {
            normals[indexFirst] = (normals[indexFirst] + normals[indexLast]) * 0.5;
            normals[indexFirst + 1] = (normals[indexFirst + 1] + normals[indexLast + 1]) * 0.5;
            normals[indexFirst + 2] = (normals[indexFirst + 2] + normals[indexLast + 2]) * 0.5;
            const l = Math.sqrt(normals[indexFirst] * normals[indexFirst] + normals[indexFirst + 1] * normals[indexFirst + 1] + normals[indexFirst + 2] * normals[indexFirst + 2]);
            normals[indexFirst] /= l;
            normals[indexFirst + 1] /= l;
            normals[indexFirst + 2] /= l;
            normals[indexLast] = normals[indexFirst];
            normals[indexLast + 1] = normals[indexFirst + 1];
            normals[indexLast + 2] = normals[indexFirst + 2];
            indexFirst += 3;
            indexLast += 3;
        }
    }
    // sides
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    // Colors
    let colors = null;
    if (customColors) {
        colors = new Float32Array(customColors.length * 4);
        for (let c = 0; c < customColors.length; c++) {
            colors[c * 4] = customColors[c].r;
            colors[c * 4 + 1] = customColors[c].g;
            colors[c * 4 + 2] = customColors[c].b;
            colors[c * 4 + 3] = customColors[c].a;
        }
    }
    // Result
    const vertexData = new mesh_vertexData/* VertexData */.P();
    const positions32 = new Float32Array(positions);
    const normals32 = new Float32Array(normals);
    const uvs32 = new Float32Array(uvs);
    vertexData.indices = indices;
    vertexData.positions = positions32;
    vertexData.normals = normals32;
    vertexData.uvs = uvs32;
    if (colors) {
        vertexData.set(colors, Buffers_buffer/* VertexBuffer */.R.ColorKind);
    }
    if (closePath) {
        vertexData._idx = idx;
    }
    return vertexData;
}
/**
 * Creates a ribbon mesh. The ribbon is a parametric shape.  It has no predefined shape. Its final shape will depend on the input parameters
 * * The parameter `pathArray` is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry
 * * The parameter `closeArray` (boolean, default false) creates a seam between the first and the last paths of the path array
 * * The parameter `closePath` (boolean, default false) creates a seam between the first and the last points of each path of the path array
 * * The parameter `offset` (positive integer, default : rounded half size of the pathArray length), is taken in account only if the `pathArray` is containing a single path
 * * It's the offset to join the points from the same path. Ex : offset = 10 means the point 1 is joined to the point 11
 * * The optional parameter `instance` is an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#ribbon
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
 * * The parameter `uvs` is an optional flat array of `Vector2` to update/set each ribbon vertex with its own custom UV values instead of the computed ones
 * * The parameters `colors` is an optional flat array of `Color4` to set/update each ribbon vertex with its own custom color values
 * * Note that if you use the parameters `uvs` or `colors`, the passed arrays must be populated with the right number of elements, it is to say the number of ribbon vertices. Remember that if you set `closePath` to `true`, there's one extra vertex per path in the geometry
 * * Moreover, you can use the parameter `color` with `instance` (to update the ribbon), only if you previously used it at creation time
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the ribbon mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/ribbon_extra
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
 */
function CreateRibbon(name, options, scene = null) {
    const pathArray = options.pathArray;
    const closeArray = options.closeArray;
    const closePath = options.closePath;
    const sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    const instance = options.instance;
    const updatable = options.updatable;
    if (instance) {
        // existing ribbon instance update
        // positionFunction : ribbon case
        // only pathArray and sideOrientation parameters are taken into account for positions update
        const minimum = math_vector/* TmpVectors */.AA.Vector3[0].setAll(Number.MAX_VALUE);
        const maximum = math_vector/* TmpVectors */.AA.Vector3[1].setAll(-Number.MAX_VALUE);
        const positionFunction = (positions) => {
            let minlg = pathArray[0].length;
            const mesh = instance;
            let i = 0;
            const ns = mesh._originalBuilderSideOrientation === Meshes_mesh/* Mesh */.e.DOUBLESIDE ? 2 : 1;
            for (let si = 1; si <= ns; ++si) {
                for (let p = 0; p < pathArray.length; ++p) {
                    const path = pathArray[p];
                    const l = path.length;
                    minlg = minlg < l ? minlg : l;
                    for (let j = 0; j < minlg; ++j) {
                        const pathPoint = path[j];
                        positions[i] = pathPoint.x;
                        positions[i + 1] = pathPoint.y;
                        positions[i + 2] = pathPoint.z;
                        minimum.minimizeInPlaceFromFloats(pathPoint.x, pathPoint.y, pathPoint.z);
                        maximum.maximizeInPlaceFromFloats(pathPoint.x, pathPoint.y, pathPoint.z);
                        i += 3;
                    }
                    if (mesh._creationDataStorage && mesh._creationDataStorage.closePath) {
                        const pathPoint = path[0];
                        positions[i] = pathPoint.x;
                        positions[i + 1] = pathPoint.y;
                        positions[i + 2] = pathPoint.z;
                        i += 3;
                    }
                }
            }
        };
        const positions = instance.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        positionFunction(positions);
        if (instance.hasBoundingInfo) {
            instance.getBoundingInfo().reConstruct(minimum, maximum, instance._worldMatrix);
        }
        else {
            instance.buildBoundingInfo(minimum, maximum, instance._worldMatrix);
        }
        instance.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, positions, false, false);
        if (options.colors) {
            const colors = instance.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind);
            for (let c = 0, colorIndex = 0; c < options.colors.length; c++, colorIndex += 4) {
                const color = options.colors[c];
                colors[colorIndex] = color.r;
                colors[colorIndex + 1] = color.g;
                colors[colorIndex + 2] = color.b;
                colors[colorIndex + 3] = color.a;
            }
            instance.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind, colors, false, false);
        }
        if (options.uvs) {
            const uvs = instance.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind);
            for (let i = 0; i < options.uvs.length; i++) {
                uvs[i * 2] = options.uvs[i].x;
                uvs[i * 2 + 1] = compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - options.uvs[i].y : options.uvs[i].y;
            }
            instance.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind, uvs, false, false);
        }
        if (!instance.areNormalsFrozen || instance.isFacetDataEnabled) {
            const indices = instance.getIndices();
            const normals = instance.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
            const params = instance.isFacetDataEnabled ? instance.getFacetDataParameters() : null;
            mesh_vertexData/* VertexData */.P.ComputeNormals(positions, indices, normals, params);
            if (instance._creationDataStorage && instance._creationDataStorage.closePath) {
                let indexFirst = 0;
                let indexLast = 0;
                for (let p = 0; p < pathArray.length; p++) {
                    indexFirst = instance._creationDataStorage.idx[p] * 3;
                    if (p + 1 < pathArray.length) {
                        indexLast = (instance._creationDataStorage.idx[p + 1] - 1) * 3;
                    }
                    else {
                        indexLast = normals.length - 3;
                    }
                    normals[indexFirst] = (normals[indexFirst] + normals[indexLast]) * 0.5;
                    normals[indexFirst + 1] = (normals[indexFirst + 1] + normals[indexLast + 1]) * 0.5;
                    normals[indexFirst + 2] = (normals[indexFirst + 2] + normals[indexLast + 2]) * 0.5;
                    normals[indexLast] = normals[indexFirst];
                    normals[indexLast + 1] = normals[indexFirst + 1];
                    normals[indexLast + 2] = normals[indexFirst + 2];
                }
            }
            if (!instance.areNormalsFrozen) {
                instance.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind, normals, false, false);
            }
        }
        return instance;
    }
    else {
        // new ribbon creation
        const ribbon = new Meshes_mesh/* Mesh */.e(name, scene);
        ribbon._originalBuilderSideOrientation = sideOrientation;
        ribbon._creationDataStorage = new Meshes_mesh/* _CreationDataStorage */.Ez();
        const vertexData = CreateRibbonVertexData(options);
        if (closePath) {
            ribbon._creationDataStorage.idx = vertexData._idx;
        }
        ribbon._creationDataStorage.closePath = closePath;
        ribbon._creationDataStorage.closeArray = closeArray;
        vertexData.applyToMesh(ribbon, updatable);
        return ribbon;
    }
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use CreateRibbon directly
 */
const RibbonBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateRibbon,
};
mesh_vertexData/* VertexData */.P.CreateRibbon = CreateRibbonVertexData;
Meshes_mesh/* Mesh */.e.CreateRibbon = (name, pathArray, closeArray = false, closePath, offset, scene, updatable = false, sideOrientation, instance) => {
    return CreateRibbon(name, {
        pathArray: pathArray,
        closeArray: closeArray,
        closePath: closePath,
        offset: offset,
        updatable: updatable,
        sideOrientation: sideOrientation,
        instance: instance,
    }, scene);
};
//# sourceMappingURL=ribbonBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/discBuilder.js



/**
 * Creates the VertexData of the Disc or regular Polygon
 * @param options an object used to set the following optional parameters for the disc, required but can be empty
 * * radius the radius of the disc, optional default 0.5
 * * tessellation the number of polygon sides, optional, default 64
 * * arc a number from 0 to 1, to create an unclosed polygon based on the fraction of the circumference given by the arc value, optional, default 1
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @returns the VertexData of the box
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function CreateDiscVertexData(options) {
    const positions = [];
    const indices = [];
    const normals = [];
    const uvs = [];
    const radius = options.radius || 0.5;
    const tessellation = options.tessellation || 64;
    const arc = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0;
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    // positions and uvs
    positions.push(0, 0, 0); // disc center first
    uvs.push(0.5, 0.5);
    const theta = Math.PI * 2 * arc;
    const step = arc === 1 ? theta / tessellation : theta / (tessellation - 1);
    let a = 0;
    for (let t = 0; t < tessellation; t++) {
        const x = Math.cos(a);
        const y = Math.sin(a);
        const u = (x + 1) / 2;
        const v = (1 - y) / 2;
        positions.push(radius * x, radius * y, 0);
        uvs.push(u, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
        a += step;
    }
    if (arc === 1) {
        positions.push(positions[3], positions[4], positions[5]); // close the circle
        uvs.push(uvs[2], compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - uvs[3] : uvs[3]);
    }
    //indices
    const vertexNb = positions.length / 3;
    for (let i = 1; i < vertexNb - 1; i++) {
        indices.push(i + 1, 0, i);
    }
    // result
    mesh_vertexData/* VertexData */.P.ComputeNormals(positions, indices, normals);
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates a plane polygonal mesh.  By default, this is a disc
 * * The parameter `radius` sets the radius size (float) of the polygon (default 0.5)
 * * The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc
 * * You can create an unclosed polygon with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference : 2 x PI x ratio
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the plane polygonal mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#disc-or-regular-polygon
 */
function CreateDisc(name, options = {}, scene = null) {
    const disc = new Meshes_mesh/* Mesh */.e(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    disc._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateDiscVertexData(options);
    vertexData.applyToMesh(disc, options.updatable);
    return disc;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated please use CreateDisc directly
 */
const DiscBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateDisc,
};
mesh_vertexData/* VertexData */.P.CreateDisc = CreateDiscVertexData;
Meshes_mesh/* Mesh */.e.CreateDisc = (name, radius, tessellation, scene = null, updatable, sideOrientation) => {
    const options = {
        radius,
        tessellation,
        sideOrientation,
        updatable,
    };
    return CreateDisc(name, options, scene);
};
//# sourceMappingURL=discBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/tiledPlaneBuilder.js


/**
 * Creates the VertexData for a tiled plane
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_plane
 * @param options an object used to set the following optional parameters for the tiled plane, required but can be empty
 * * pattern a limited pattern arrangement depending on the number
 * * size of the box
 * * width of the box, overwrites size
 * * height of the box, overwrites size
 * * tileSize sets the width, height and depth of the tile to the value of size, optional default 1
 * * tileWidth sets the width (x direction) of the tile, overwrites the width set by size, optional, default size
 * * tileHeight sets the height (y direction) of the tile, overwrites the height set by size, optional, default size
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * alignHorizontal places whole tiles aligned to the center, left or right of a row
 * * alignVertical places whole tiles aligned to the center, left or right of a column
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * @param options.pattern
 * @param options.tileSize
 * @param options.tileWidth
 * @param options.tileHeight
 * @param options.size
 * @param options.width
 * @param options.height
 * @param options.alignHorizontal
 * @param options.alignVertical
 * @param options.sideOrientation
 * @param options.frontUVs
 * @param options.backUVs
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @returns the VertexData of the tiled plane
 */
function CreateTiledPlaneVertexData(options) {
    const flipTile = options.pattern || Meshes_mesh/* Mesh */.e.NO_FLIP;
    const tileWidth = options.tileWidth || options.tileSize || 1;
    const tileHeight = options.tileHeight || options.tileSize || 1;
    const alignH = options.alignHorizontal || 0;
    const alignV = options.alignVertical || 0;
    const width = options.width || options.size || 1;
    const tilesX = Math.floor(width / tileWidth);
    let offsetX = width - tilesX * tileWidth;
    const height = options.height || options.size || 1;
    const tilesY = Math.floor(height / tileHeight);
    let offsetY = height - tilesY * tileHeight;
    const halfWidth = (tileWidth * tilesX) / 2;
    const halfHeight = (tileHeight * tilesY) / 2;
    let adjustX = 0;
    let adjustY = 0;
    let startX = 0;
    let startY = 0;
    let endX = 0;
    let endY = 0;
    //Part Tiles
    if (offsetX > 0 || offsetY > 0) {
        startX = -halfWidth;
        startY = -halfHeight;
        endX = halfWidth;
        endY = halfHeight;
        switch (alignH) {
            case Meshes_mesh/* Mesh */.e.CENTER:
                offsetX /= 2;
                startX -= offsetX;
                endX += offsetX;
                break;
            case Meshes_mesh/* Mesh */.e.LEFT:
                endX += offsetX;
                adjustX = -offsetX / 2;
                break;
            case Meshes_mesh/* Mesh */.e.RIGHT:
                startX -= offsetX;
                adjustX = offsetX / 2;
                break;
        }
        switch (alignV) {
            case Meshes_mesh/* Mesh */.e.CENTER:
                offsetY /= 2;
                startY -= offsetY;
                endY += offsetY;
                break;
            case Meshes_mesh/* Mesh */.e.BOTTOM:
                endY += offsetY;
                adjustY = -offsetY / 2;
                break;
            case Meshes_mesh/* Mesh */.e.TOP:
                startY -= offsetY;
                adjustY = offsetY / 2;
                break;
        }
    }
    const positions = [];
    const normals = [];
    const uvBase = [];
    uvBase[0] = [0, 0, 1, 0, 1, 1, 0, 1];
    uvBase[1] = [0, 0, 1, 0, 1, 1, 0, 1];
    if (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW) {
        uvBase[1] = [1, 1, 0, 1, 0, 0, 1, 0];
    }
    if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW) {
        uvBase[1] = [1, 0, 0, 0, 0, 1, 1, 1];
    }
    if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
        uvBase[1] = [0, 1, 1, 1, 1, 0, 0, 0];
    }
    let uvs = [];
    const colors = [];
    const indices = [];
    let index = 0;
    for (let y = 0; y < tilesY; y++) {
        for (let x = 0; x < tilesX; x++) {
            positions.push(-halfWidth + x * tileWidth + adjustX, -halfHeight + y * tileHeight + adjustY, 0);
            positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, -halfHeight + y * tileHeight + adjustY, 0);
            positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0);
            positions.push(-halfWidth + x * tileWidth + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0);
            indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3);
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE) {
                uvs = uvs.concat(uvBase[((x % 2) + (y % 2)) % 2]);
            }
            else if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                uvs = uvs.concat(uvBase[y % 2]);
            }
            else {
                uvs = uvs.concat(uvBase[0]);
            }
            colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
            normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
            index += 4;
        }
    }
    //Part Tiles
    if (offsetX > 0 || offsetY > 0) {
        const partialBottomRow = offsetY > 0 && (alignV === Meshes_mesh/* Mesh */.e.CENTER || alignV === Meshes_mesh/* Mesh */.e.TOP);
        const partialTopRow = offsetY > 0 && (alignV === Meshes_mesh/* Mesh */.e.CENTER || alignV === Meshes_mesh/* Mesh */.e.BOTTOM);
        const partialLeftCol = offsetX > 0 && (alignH === Meshes_mesh/* Mesh */.e.CENTER || alignH === Meshes_mesh/* Mesh */.e.RIGHT);
        const partialRightCol = offsetX > 0 && (alignH === Meshes_mesh/* Mesh */.e.CENTER || alignH === Meshes_mesh/* Mesh */.e.LEFT);
        let uvPart = [];
        let a, b, c, d;
        //corners
        if (partialBottomRow && partialLeftCol) {
            //bottom left corner
            positions.push(startX + adjustX, startY + adjustY, 0);
            positions.push(-halfWidth + adjustX, startY + adjustY, 0);
            positions.push(-halfWidth + adjustX, startY + offsetY + adjustY, 0);
            positions.push(startX + adjustX, startY + offsetY + adjustY, 0);
            indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3);
            index += 4;
            a = 1 - offsetX / tileWidth;
            b = 1 - offsetY / tileHeight;
            c = 1;
            d = 1;
            uvPart = [a, b, c, b, c, d, a, d];
            if (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW) {
                uvPart = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW) {
                uvPart = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                uvPart = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d];
            }
            uvs = uvs.concat(uvPart);
            colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
            normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
        }
        if (partialBottomRow && partialRightCol) {
            //bottom right corner
            positions.push(halfWidth + adjustX, startY + adjustY, 0);
            positions.push(endX + adjustX, startY + adjustY, 0);
            positions.push(endX + adjustX, startY + offsetY + adjustY, 0);
            positions.push(halfWidth + adjustX, startY + offsetY + adjustY, 0);
            indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3);
            index += 4;
            a = 0;
            b = 1 - offsetY / tileHeight;
            c = offsetX / tileWidth;
            d = 1;
            uvPart = [a, b, c, b, c, d, a, d];
            if (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW || (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE && tilesX % 2 === 0)) {
                uvPart = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW || (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE && tilesX % 2 === 0)) {
                uvPart = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW || (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE && tilesX % 2 === 0)) {
                uvPart = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d];
            }
            uvs = uvs.concat(uvPart);
            colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
            normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
        }
        if (partialTopRow && partialLeftCol) {
            //top left corner
            positions.push(startX + adjustX, halfHeight + adjustY, 0);
            positions.push(-halfWidth + adjustX, halfHeight + adjustY, 0);
            positions.push(-halfWidth + adjustX, endY + adjustY, 0);
            positions.push(startX + adjustX, endY + adjustY, 0);
            indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3);
            index += 4;
            a = 1 - offsetX / tileWidth;
            b = 0;
            c = 1;
            d = offsetY / tileHeight;
            uvPart = [a, b, c, b, c, d, a, d];
            if ((flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW && tilesY % 2 === 1) || (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE && tilesY % 1 === 0)) {
                uvPart = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d];
            }
            if ((flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW && tilesY % 2 === 1) || (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE && tilesY % 2 === 0)) {
                uvPart = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d];
            }
            if ((flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW && tilesY % 2 === 1) || (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE && tilesY % 2 === 0)) {
                uvPart = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d];
            }
            uvs = uvs.concat(uvPart);
            colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
            normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
        }
        if (partialTopRow && partialRightCol) {
            //top right corner
            positions.push(halfWidth + adjustX, halfHeight + adjustY, 0);
            positions.push(endX + adjustX, halfHeight + adjustY, 0);
            positions.push(endX + adjustX, endY + adjustY, 0);
            positions.push(halfWidth + adjustX, endY + adjustY, 0);
            indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3);
            index += 4;
            a = 0;
            b = 0;
            c = offsetX / tileWidth;
            d = offsetY / tileHeight;
            uvPart = [a, b, c, b, c, d, a, d];
            if ((flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW && tilesY % 2 === 1) || (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE && (tilesY + tilesX) % 2 === 1)) {
                uvPart = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d];
            }
            if ((flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW && tilesY % 2 === 1) || (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE && (tilesY + tilesX) % 2 === 1)) {
                uvPart = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d];
            }
            if ((flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW && tilesY % 2 === 1) || (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE && (tilesY + tilesX) % 2 === 1)) {
                uvPart = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d];
            }
            uvs = uvs.concat(uvPart);
            colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
            normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
        }
        //part rows
        if (partialBottomRow) {
            const uvBaseBR = [];
            a = 0;
            b = 1 - offsetY / tileHeight;
            c = 1;
            d = 1;
            uvBaseBR[0] = [a, b, c, b, c, d, a, d];
            uvBaseBR[1] = [a, b, c, b, c, d, a, d];
            if (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW) {
                uvBaseBR[1] = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW) {
                uvBaseBR[1] = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                uvBaseBR[1] = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d];
            }
            for (let x = 0; x < tilesX; x++) {
                positions.push(-halfWidth + x * tileWidth + adjustX, startY + adjustY, 0);
                positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, startY + adjustY, 0);
                positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, startY + offsetY + adjustY, 0);
                positions.push(-halfWidth + x * tileWidth + adjustX, startY + offsetY + adjustY, 0);
                indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3);
                index += 4;
                if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE) {
                    uvs = uvs.concat(uvBaseBR[(x + 1) % 2]);
                }
                else if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                    uvs = uvs.concat(uvBaseBR[1]);
                }
                else {
                    uvs = uvs.concat(uvBaseBR[0]);
                }
                colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
                normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
            }
        }
        if (partialTopRow) {
            const uvBaseTR = [];
            a = 0;
            b = 0;
            c = 1;
            d = offsetY / tileHeight;
            uvBaseTR[0] = [a, b, c, b, c, d, a, d];
            uvBaseTR[1] = [a, b, c, b, c, d, a, d];
            if (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW) {
                uvBaseTR[1] = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW) {
                uvBaseTR[1] = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                uvBaseTR[1] = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d];
            }
            for (let x = 0; x < tilesX; x++) {
                positions.push(-halfWidth + x * tileWidth + adjustX, endY - offsetY + adjustY, 0);
                positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, endY - offsetY + adjustY, 0);
                positions.push(-halfWidth + (x + 1) * tileWidth + adjustX, endY + adjustY, 0);
                positions.push(-halfWidth + x * tileWidth + adjustX, endY + adjustY, 0);
                indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3);
                index += 4;
                if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE) {
                    uvs = uvs.concat(uvBaseTR[(x + tilesY) % 2]);
                }
                else if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                    uvs = uvs.concat(uvBaseTR[tilesY % 2]);
                }
                else {
                    uvs = uvs.concat(uvBaseTR[0]);
                }
                colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
                normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
            }
        }
        if (partialLeftCol) {
            const uvBaseLC = [];
            a = 1 - offsetX / tileWidth;
            b = 0;
            c = 1;
            d = 1;
            uvBaseLC[0] = [a, b, c, b, c, d, a, d];
            uvBaseLC[1] = [a, b, c, b, c, d, a, d];
            if (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW) {
                uvBaseLC[1] = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW) {
                uvBaseLC[1] = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                uvBaseLC[1] = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d];
            }
            for (let y = 0; y < tilesY; y++) {
                positions.push(startX + adjustX, -halfHeight + y * tileHeight + adjustY, 0);
                positions.push(startX + offsetX + adjustX, -halfHeight + y * tileHeight + adjustY, 0);
                positions.push(startX + offsetX + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0);
                positions.push(startX + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0);
                indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3);
                index += 4;
                if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE) {
                    uvs = uvs.concat(uvBaseLC[(y + 1) % 2]);
                }
                else if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                    uvs = uvs.concat(uvBaseLC[y % 2]);
                }
                else {
                    uvs = uvs.concat(uvBaseLC[0]);
                }
                colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
                normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
            }
        }
        if (partialRightCol) {
            const uvBaseRC = [];
            a = 0;
            b = 0;
            c = offsetX / tileHeight;
            d = 1;
            uvBaseRC[0] = [a, b, c, b, c, d, a, d];
            uvBaseRC[1] = [a, b, c, b, c, d, a, d];
            if (flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW) {
                uvBaseRC[1] = [1 - a, 1 - b, 1 - c, 1 - b, 1 - c, 1 - d, 1 - a, 1 - d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW) {
                uvBaseRC[1] = [1 - a, b, 1 - c, b, 1 - c, d, 1 - a, d];
            }
            if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                uvBaseRC[1] = [a, 1 - b, c, 1 - b, c, 1 - d, a, 1 - d];
            }
            for (let y = 0; y < tilesY; y++) {
                positions.push(endX - offsetX + adjustX, -halfHeight + y * tileHeight + adjustY, 0);
                positions.push(endX + adjustX, -halfHeight + y * tileHeight + adjustY, 0);
                positions.push(endX + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0);
                positions.push(endX - offsetX + adjustX, -halfHeight + (y + 1) * tileHeight + adjustY, 0);
                indices.push(index, index + 1, index + 3, index + 1, index + 2, index + 3);
                index += 4;
                if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_TILE || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_TILE || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_TILE) {
                    uvs = uvs.concat(uvBaseRC[(y + tilesX) % 2]);
                }
                else if (flipTile === Meshes_mesh/* Mesh */.e.FLIP_ROW || flipTile === Meshes_mesh/* Mesh */.e.ROTATE_ROW || flipTile === Meshes_mesh/* Mesh */.e.FLIP_N_ROTATE_ROW) {
                    uvs = uvs.concat(uvBaseRC[y % 2]);
                }
                else {
                    uvs = uvs.concat(uvBaseRC[0]);
                }
                colors.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
                normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);
            }
        }
    }
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    // sides
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    // Result
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    const totalColors = sideOrientation === mesh_vertexData/* VertexData */.P.DOUBLESIDE ? colors.concat(colors) : colors;
    vertexData.colors = totalColors;
    return vertexData;
}
/**
 * Creates a tiled plane mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_plane
 * @param name defines the name of the mesh
 * @param options an object used to set the following optional parameters for the tiled plane, required but can be empty
 * * pattern a limited pattern arrangement depending on the number
 * * size of the box
 * * width of the box, overwrites size
 * * height of the box, overwrites size
 * * tileSize sets the width, height and depth of the tile to the value of size, optional default 1
 * * tileWidth sets the width (x direction) of the tile, overwrites the width set by size, optional, default size
 * * tileHeight sets the height (y direction) of the tile, overwrites the height set by size, optional, default size
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * alignHorizontal places whole tiles aligned to the center, left or right of a row
 * * alignVertical places whole tiles aligned to the center, left or right of a column
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @param options.pattern
 * @param options.tileSize
 * @param options.tileWidth
 * @param options.tileHeight
 * @param options.size
 * @param options.width
 * @param options.height
 * @param options.alignHorizontal
 * @param options.alignVertical
 * @param options.sideOrientation
 * @param options.frontUVs
 * @param options.backUVs
 * @param options.updatable
 * @param scene defines the hosting scene
 * @returns the box mesh
 */
function CreateTiledPlane(name, options, scene = null) {
    const plane = new Meshes_mesh/* Mesh */.e(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    plane._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateTiledPlaneVertexData(options);
    vertexData.applyToMesh(plane, options.updatable);
    return plane;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use CreateTiledPlane instead
 */
const TiledPlaneBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateTiledPlane,
};
mesh_vertexData/* VertexData */.P.CreateTiledPlane = CreateTiledPlaneVertexData;
//# sourceMappingURL=tiledPlaneBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/tiledBoxBuilder.js






/**
 * Creates the VertexData for a tiled box
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box
 * @param options an object used to set the following optional parameters for the tiled box, required but can be empty
 * * pattern sets the rotation or reflection pattern for the tiles,
 * * size of the box
 * * width of the box, overwrites size
 * * height of the box, overwrites size
 * * depth of the box, overwrites size
 * * tileSize sets the size of a tile
 * * tileWidth sets the tile width and overwrites tileSize
 * * tileHeight sets the tile width and overwrites tileSize
 * * faceUV an array of 6 Vector4 elements used to set different images to each box side
 * * faceColors an array of 6 Color3 elements used to set different colors to each box side
 * * alignHorizontal places whole tiles aligned to the center, left or right of a row
 * * alignVertical places whole tiles aligned to the center, left or right of a column
 * @param options.pattern
 * @param options.size
 * @param options.width
 * @param options.height
 * @param options.depth
 * @param options.tileSize
 * @param options.tileWidth
 * @param options.tileHeight
 * @param options.faceUV
 * @param options.faceColors
 * @param options.alignHorizontal
 * @param options.alignVertical
 * @param options.sideOrientation
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * @returns the VertexData of the TiledBox
 */
function CreateTiledBoxVertexData(options) {
    const nbFaces = 6;
    const faceUV = options.faceUV || new Array(6);
    const faceColors = options.faceColors;
    const flipTile = options.pattern || Meshes_mesh/* Mesh */.e.NO_FLIP;
    const width = options.width || options.size || 1;
    const height = options.height || options.size || 1;
    const depth = options.depth || options.size || 1;
    const tileWidth = options.tileWidth || options.tileSize || 1;
    const tileHeight = options.tileHeight || options.tileSize || 1;
    const alignH = options.alignHorizontal || 0;
    const alignV = options.alignVertical || 0;
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    // default face colors and UV if undefined
    for (let f = 0; f < nbFaces; f++) {
        if (faceUV[f] === undefined) {
            faceUV[f] = new math_vector/* Vector4 */.IU(0, 0, 1, 1);
        }
        if (faceColors && faceColors[f] === undefined) {
            faceColors[f] = new math_color/* Color4 */.ov(1, 1, 1, 1);
        }
    }
    const halfWidth = width / 2;
    const halfHeight = height / 2;
    const halfDepth = depth / 2;
    const faceVertexData = [];
    for (let f = 0; f < 2; f++) {
        //front and back
        faceVertexData[f] = CreateTiledPlaneVertexData({
            pattern: flipTile,
            tileWidth: tileWidth,
            tileHeight: tileHeight,
            width: width,
            height: height,
            alignVertical: alignV,
            alignHorizontal: alignH,
            sideOrientation: sideOrientation,
        });
    }
    for (let f = 2; f < 4; f++) {
        //sides
        faceVertexData[f] = CreateTiledPlaneVertexData({
            pattern: flipTile,
            tileWidth: tileWidth,
            tileHeight: tileHeight,
            width: depth,
            height: height,
            alignVertical: alignV,
            alignHorizontal: alignH,
            sideOrientation: sideOrientation,
        });
    }
    let baseAlignV = alignV;
    if (alignV === Meshes_mesh/* Mesh */.e.BOTTOM) {
        baseAlignV = Meshes_mesh/* Mesh */.e.TOP;
    }
    else if (alignV === Meshes_mesh/* Mesh */.e.TOP) {
        baseAlignV = Meshes_mesh/* Mesh */.e.BOTTOM;
    }
    for (let f = 4; f < 6; f++) {
        //top and bottom
        faceVertexData[f] = CreateTiledPlaneVertexData({
            pattern: flipTile,
            tileWidth: tileWidth,
            tileHeight: tileHeight,
            width: width,
            height: depth,
            alignVertical: baseAlignV,
            alignHorizontal: alignH,
            sideOrientation: sideOrientation,
        });
    }
    let positions = [];
    let normals = [];
    let uvs = [];
    let indices = [];
    const colors = [];
    const facePositions = [];
    const faceNormals = [];
    const newFaceUV = [];
    let lu = 0;
    let li = 0;
    for (let f = 0; f < nbFaces; f++) {
        const len = faceVertexData[f].positions.length;
        facePositions[f] = [];
        faceNormals[f] = [];
        for (let p = 0; p < len / 3; p++) {
            facePositions[f].push(new math_vector/* Vector3 */.Pq(faceVertexData[f].positions[3 * p], faceVertexData[f].positions[3 * p + 1], faceVertexData[f].positions[3 * p + 2]));
            faceNormals[f].push(new math_vector/* Vector3 */.Pq(faceVertexData[f].normals[3 * p], faceVertexData[f].normals[3 * p + 1], faceVertexData[f].normals[3 * p + 2]));
        }
        // uvs
        lu = faceVertexData[f].uvs.length;
        newFaceUV[f] = [];
        for (let i = 0; i < lu; i += 2) {
            newFaceUV[f][i] = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * faceVertexData[f].uvs[i];
            newFaceUV[f][i + 1] = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * faceVertexData[f].uvs[i + 1];
            if (compatibilityOptions/* useOpenGLOrientationForUV */.rX) {
                newFaceUV[f][i + 1] = 1.0 - newFaceUV[f][i + 1];
            }
        }
        uvs = uvs.concat(newFaceUV[f]);
        indices = indices.concat(faceVertexData[f].indices.map((x) => x + li));
        li += facePositions[f].length;
        if (faceColors) {
            for (let c = 0; c < 4; c++) {
                colors.push(faceColors[f].r, faceColors[f].g, faceColors[f].b, faceColors[f].a);
            }
        }
    }
    const vec0 = new math_vector/* Vector3 */.Pq(0, 0, halfDepth);
    const mtrx0 = math_vector/* Matrix */.uq.RotationY(Math.PI);
    positions = facePositions[0]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx0).add(vec0))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
    normals = faceNormals[0]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx0))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
    positions = positions.concat(facePositions[1]
        .map((entry) => entry.subtract(vec0))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    normals = normals.concat(faceNormals[1].map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    const vec2 = new math_vector/* Vector3 */.Pq(halfWidth, 0, 0);
    const mtrx2 = math_vector/* Matrix */.uq.RotationY(-Math.PI / 2);
    positions = positions.concat(facePositions[2]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx2).add(vec2))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    normals = normals.concat(faceNormals[2]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx2))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    const mtrx3 = math_vector/* Matrix */.uq.RotationY(Math.PI / 2);
    positions = positions.concat(facePositions[3]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx3).subtract(vec2))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    normals = normals.concat(faceNormals[3]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx3))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    const vec4 = new math_vector/* Vector3 */.Pq(0, halfHeight, 0);
    const mtrx4 = math_vector/* Matrix */.uq.RotationX(Math.PI / 2);
    positions = positions.concat(facePositions[4]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx4).add(vec4))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    normals = normals.concat(faceNormals[4]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx4))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    const mtrx5 = math_vector/* Matrix */.uq.RotationX(-Math.PI / 2);
    positions = positions.concat(facePositions[5]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx5).subtract(vec4))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    normals = normals.concat(faceNormals[5]
        .map((entry) => math_vector/* Vector3 */.Pq.TransformNormal(entry, mtrx5))
        .map((entry) => [entry.x, entry.y, entry.z])
        .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []));
    // sides
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs);
    // Result
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    if (faceColors) {
        const totalColors = sideOrientation === mesh_vertexData/* VertexData */.P.DOUBLESIDE ? colors.concat(colors) : colors;
        vertexData.colors = totalColors;
    }
    return vertexData;
}
/**
 * Creates a tiled box mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box
 * @param name defines the name of the mesh
 * @param options an object used to set the following optional parameters for the tiled box, required but can be empty
 * * pattern sets the rotation or reflection pattern for the tiles,
 * * size of the box
 * * width of the box, overwrites size
 * * height of the box, overwrites size
 * * depth of the box, overwrites size
 * * tileSize sets the size of a tile
 * * tileWidth sets the tile width and overwrites tileSize
 * * tileHeight sets the tile width and overwrites tileSize
 * * faceUV an array of 6 Vector4 elements used to set different images to each box side
 * * faceColors an array of 6 Color3 elements used to set different colors to each box side
 * * alignHorizontal places whole tiles aligned to the center, left or right of a row
 * * alignVertical places whole tiles aligned to the center, left or right of a column
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * @param options.pattern
 * @param options.width
 * @param options.height
 * @param options.depth
 * @param options.tileSize
 * @param options.tileWidth
 * @param options.tileHeight
 * @param options.alignHorizontal
 * @param options.alignVertical
 * @param options.faceUV
 * @param options.faceColors
 * @param options.sideOrientation
 * @param options.updatable
 * @param scene defines the hosting scene
 * @returns the box mesh
 */
function CreateTiledBox(name, options, scene = null) {
    const box = new Meshes_mesh/* Mesh */.e(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    box._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateTiledBoxVertexData(options);
    vertexData.applyToMesh(box, options.updatable);
    return box;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use CreateTiledBox instead
 */
const TiledBoxBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateTiledBox,
};
mesh_vertexData/* VertexData */.P.CreateTiledBox = CreateTiledBoxVertexData;
//# sourceMappingURL=tiledBoxBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/torusKnotBuilder.js




// based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3D/src/away3d/primitives/TorusKnot.as?spec=svn2473&r=2473
/**
 * Creates the VertexData for a TorusKnot
 * @param options an object used to set the following optional parameters for the TorusKnot, required but can be empty
 * * radius the radius of the torus knot, optional, default 2
 * * tube the thickness of the tube, optional, default 0.5
 * * radialSegments the number of sides on each tube segments, optional, default 32
 * * tubularSegments the number of tubes to decompose the knot into, optional, default 32
 * * p the number of windings around the z axis, optional,  default 2
 * * q the number of windings around the x axis, optional,  default 3
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @param options.radius
 * @param options.tube
 * @param options.radialSegments
 * @param options.tubularSegments
 * @param options.p
 * @param options.q
 * @param options.sideOrientation
 * @param options.frontUVs
 * @param options.backUVs
 * @returns the VertexData of the Torus Knot
 */
function CreateTorusKnotVertexData(options) {
    const indices = [];
    const positions = [];
    const normals = [];
    const uvs = [];
    const radius = options.radius || 2;
    const tube = options.tube || 0.5;
    const radialSegments = options.radialSegments || 32;
    const tubularSegments = options.tubularSegments || 32;
    const p = options.p || 2;
    const q = options.q || 3;
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    // Helper
    const getPos = (angle) => {
        const cu = Math.cos(angle);
        const su = Math.sin(angle);
        const quOverP = (q / p) * angle;
        const cs = Math.cos(quOverP);
        const tx = radius * (2 + cs) * 0.5 * cu;
        const ty = radius * (2 + cs) * su * 0.5;
        const tz = radius * Math.sin(quOverP) * 0.5;
        return new math_vector/* Vector3 */.Pq(tx, ty, tz);
    };
    // Vertices
    let i;
    let j;
    for (i = 0; i <= radialSegments; i++) {
        const modI = i % radialSegments;
        const u = (modI / radialSegments) * 2 * p * Math.PI;
        const p1 = getPos(u);
        const p2 = getPos(u + 0.01);
        const tang = p2.subtract(p1);
        let n = p2.add(p1);
        const bitan = math_vector/* Vector3 */.Pq.Cross(tang, n);
        n = math_vector/* Vector3 */.Pq.Cross(bitan, tang);
        bitan.normalize();
        n.normalize();
        for (j = 0; j < tubularSegments; j++) {
            const modJ = j % tubularSegments;
            const v = (modJ / tubularSegments) * 2 * Math.PI;
            const cx = -tube * Math.cos(v);
            const cy = tube * Math.sin(v);
            positions.push(p1.x + cx * n.x + cy * bitan.x);
            positions.push(p1.y + cx * n.y + cy * bitan.y);
            positions.push(p1.z + cx * n.z + cy * bitan.z);
            uvs.push(i / radialSegments);
            uvs.push(compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - j / tubularSegments : j / tubularSegments);
        }
    }
    for (i = 0; i < radialSegments; i++) {
        for (j = 0; j < tubularSegments; j++) {
            const jNext = (j + 1) % tubularSegments;
            const a = i * tubularSegments + j;
            const b = (i + 1) * tubularSegments + j;
            const c = (i + 1) * tubularSegments + jNext;
            const d = i * tubularSegments + jNext;
            indices.push(d);
            indices.push(b);
            indices.push(a);
            indices.push(d);
            indices.push(c);
            indices.push(b);
        }
    }
    // Normals
    mesh_vertexData/* VertexData */.P.ComputeNormals(positions, indices, normals);
    // Sides
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    // Result
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates a torus knot mesh
 * * The parameter `radius` sets the global radius size (float) of the torus knot (default 2)
 * * The parameter `radialSegments` sets the number of sides on each tube segments (positive integer, default 32)
 * * The parameter `tubularSegments` sets the number of tubes to decompose the knot into (positive integer, default 32)
 * * The parameters `p` and `q` are the number of windings on each axis (positive integers, default 2 and 3)
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param options.radius
 * @param options.tube
 * @param options.radialSegments
 * @param options.tubularSegments
 * @param options.p
 * @param options.q
 * @param options.updatable
 * @param options.sideOrientation
 * @param options.frontUVs
 * @param options.backUVs
 * @param scene defines the hosting scene
 * @returns the torus knot mesh
 * @see  https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#torus-knot
 */
function CreateTorusKnot(name, options = {}, scene) {
    const torusKnot = new Meshes_mesh/* Mesh */.e(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    torusKnot._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateTorusKnotVertexData(options);
    vertexData.applyToMesh(torusKnot, options.updatable);
    return torusKnot;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use CreateTorusKnot instead
 */
const TorusKnotBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateTorusKnot,
};
mesh_vertexData/* VertexData */.P.CreateTorusKnot = CreateTorusKnotVertexData;
Meshes_mesh/* Mesh */.e.CreateTorusKnot = (name, radius, tube, radialSegments, tubularSegments, p, q, scene, updatable, sideOrientation) => {
    const options = {
        radius,
        tube,
        radialSegments,
        tubularSegments,
        p,
        q,
        sideOrientation,
        updatable,
    };
    return CreateTorusKnot(name, options, scene);
};
//# sourceMappingURL=torusKnotBuilder.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/linesMesh.js
var linesMesh = __webpack_require__(92986);
;// ./node_modules/@babylonjs/core/Meshes/Builders/linesBuilder.js
/* eslint-disable @typescript-eslint/naming-convention */






/**
 * Creates the VertexData of the LineSystem
 * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty
 *  - lines an array of lines, each line being an array of successive Vector3
 *  - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point
 * @returns the VertexData of the LineSystem
 */
function CreateLineSystemVertexData(options) {
    const indices = [];
    const positions = [];
    const lines = options.lines;
    const colors = options.colors;
    const vertexColors = [];
    let idx = 0;
    for (let l = 0; l < lines.length; l++) {
        const points = lines[l];
        for (let index = 0; index < points.length; index++) {
            const { x, y, z } = points[index];
            positions.push(x, y, z);
            if (colors) {
                const color = colors[l];
                const { r, g, b, a } = color[index];
                vertexColors.push(r, g, b, a);
            }
            if (index > 0) {
                indices.push(idx - 1);
                indices.push(idx);
            }
            idx++;
        }
    }
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    if (colors) {
        vertexData.colors = vertexColors;
    }
    return vertexData;
}
/**
 * Create the VertexData for a DashedLines
 * @param options an object used to set the following optional parameters for the DashedLines, required but can be empty
 *  - points an array successive Vector3
 *  - dashSize the size of the dashes relative to the dash number, optional, default 3
 *  - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1
 *  - dashNb the intended total number of dashes, optional, default 200
 * @returns the VertexData for the DashedLines
 */
function CreateDashedLinesVertexData(options) {
    const dashSize = options.dashSize || 3;
    const gapSize = options.gapSize || 1;
    const dashNb = options.dashNb || 200;
    const points = options.points;
    const positions = [];
    const indices = [];
    const curvect = math_vector/* Vector3 */.Pq.Zero();
    let lg = 0;
    let nb = 0;
    let shft = 0;
    let dashshft = 0;
    let curshft = 0;
    let idx = 0;
    let i = 0;
    for (i = 0; i < points.length - 1; i++) {
        points[i + 1].subtractToRef(points[i], curvect);
        lg += curvect.length();
    }
    shft = lg / dashNb;
    dashshft = (dashSize * shft) / (dashSize + gapSize);
    for (i = 0; i < points.length - 1; i++) {
        points[i + 1].subtractToRef(points[i], curvect);
        nb = Math.floor(curvect.length() / shft);
        curvect.normalize();
        for (let j = 0; j < nb; j++) {
            curshft = shft * j;
            positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z);
            positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z);
            indices.push(idx, idx + 1);
            idx += 2;
        }
    }
    // Result
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.positions = positions;
    vertexData.indices = indices;
    return vertexData;
}
/**
 * Creates a line system mesh. A line system is a pool of many lines gathered in a single mesh
 * * A line system mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of lines as an input parameter
 * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineSystem to this static function
 * * The parameter `lines` is an array of lines, each line being an array of successive Vector3
 * * The optional parameter `instance` is an instance of an existing LineSystem object to be updated with the passed `lines` parameter
 * * The optional parameter `colors` is an array of line colors, each line colors being an array of successive Color4, one per line point
 * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)
 * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created
 * * Updating a simple Line mesh, you just need to update every line in the `lines` array : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines
 * * When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#line-system
 * @param name defines the name of the new line system
 * @param options defines the options used to create the line system
 * @param scene defines the hosting scene
 * @returns a new line system mesh
 */
function CreateLineSystem(name, options, scene = null) {
    const instance = options.instance;
    const lines = options.lines;
    const colors = options.colors;
    if (instance) {
        // lines update
        const positions = instance.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        let vertexColor;
        let lineColors;
        if (colors) {
            vertexColor = instance.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind);
        }
        let i = 0;
        let c = 0;
        for (let l = 0; l < lines.length; l++) {
            const points = lines[l];
            for (let p = 0; p < points.length; p++) {
                positions[i] = points[p].x;
                positions[i + 1] = points[p].y;
                positions[i + 2] = points[p].z;
                if (colors && vertexColor) {
                    lineColors = colors[l];
                    vertexColor[c] = lineColors[p].r;
                    vertexColor[c + 1] = lineColors[p].g;
                    vertexColor[c + 2] = lineColors[p].b;
                    vertexColor[c + 3] = lineColors[p].a;
                    c += 4;
                }
                i += 3;
            }
        }
        instance.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, positions, false, false);
        if (colors && vertexColor) {
            instance.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind, vertexColor, false, false);
        }
        instance.refreshBoundingInfo();
        return instance;
    }
    // line system creation
    const useVertexColor = colors ? true : false;
    const lineSystem = new linesMesh/* LinesMesh */.l(name, scene, null, undefined, undefined, useVertexColor, options.useVertexAlpha, options.material);
    const vertexData = CreateLineSystemVertexData(options);
    vertexData.applyToMesh(lineSystem, options.updatable);
    return lineSystem;
}
/**
 * Creates a line mesh
 * A line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter
 * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function
 * * The parameter `points` is an array successive Vector3
 * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines
 * * The optional parameter `colors` is an array of successive Color4, one per line point
 * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need alpha blending (faster)
 * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created
 * * When updating an instance, remember that only point positions can change, not the number of points
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lines
 * @param name defines the name of the new line system
 * @param options defines the options used to create the line system
 * @param scene defines the hosting scene
 * @returns a new line mesh
 */
function CreateLines(name, options, scene = null) {
    const colors = options.colors ? [options.colors] : null;
    const lines = CreateLineSystem(name, { lines: [options.points], updatable: options.updatable, instance: options.instance, colors: colors, useVertexAlpha: options.useVertexAlpha, material: options.material }, scene);
    return lines;
}
/**
 * Creates a dashed line mesh
 * * A dashed line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter
 * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function
 * * The parameter `points` is an array successive Vector3
 * * The parameter `dashNb` is the intended total number of dashes (positive integer, default 200)
 * * The parameter `dashSize` is the size of the dashes relatively the dash number (positive float, default 3)
 * * The parameter `gapSize` is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)
 * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines
 * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)
 * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created
 * * When updating an instance, remember that only point positions can change, not the number of points
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the dashed line mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#dashed-lines
 */
function CreateDashedLines(name, options, scene = null) {
    const points = options.points;
    const instance = options.instance;
    const gapSize = options.gapSize || 1;
    const dashSize = options.dashSize || 3;
    if (instance) {
        //  dashed lines update
        const positionFunction = (positions) => {
            const curvect = math_vector/* Vector3 */.Pq.Zero();
            const nbSeg = positions.length / 6;
            let lg = 0;
            let nb = 0;
            let shft = 0;
            let dashshft = 0;
            let curshft = 0;
            let p = 0;
            let i = 0;
            let j = 0;
            for (i = 0; i < points.length - 1; i++) {
                points[i + 1].subtractToRef(points[i], curvect);
                lg += curvect.length();
            }
            shft = lg / nbSeg;
            const dashSize = instance._creationDataStorage.dashSize;
            const gapSize = instance._creationDataStorage.gapSize;
            dashshft = (dashSize * shft) / (dashSize + gapSize);
            for (i = 0; i < points.length - 1; i++) {
                points[i + 1].subtractToRef(points[i], curvect);
                nb = Math.floor(curvect.length() / shft);
                curvect.normalize();
                j = 0;
                while (j < nb && p < positions.length) {
                    curshft = shft * j;
                    positions[p] = points[i].x + curshft * curvect.x;
                    positions[p + 1] = points[i].y + curshft * curvect.y;
                    positions[p + 2] = points[i].z + curshft * curvect.z;
                    positions[p + 3] = points[i].x + (curshft + dashshft) * curvect.x;
                    positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y;
                    positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z;
                    p += 6;
                    j++;
                }
            }
            while (p < positions.length) {
                positions[p] = points[i].x;
                positions[p + 1] = points[i].y;
                positions[p + 2] = points[i].z;
                p += 3;
            }
        };
        if (options.dashNb || options.dashSize || options.gapSize || options.useVertexAlpha || options.material) {
            logger/* Logger */.V.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored.");
        }
        instance.updateMeshPositions(positionFunction, false);
        return instance;
    }
    // dashed lines creation
    const dashedLines = new linesMesh/* LinesMesh */.l(name, scene, null, undefined, undefined, undefined, options.useVertexAlpha, options.material);
    const vertexData = CreateDashedLinesVertexData(options);
    vertexData.applyToMesh(dashedLines, options.updatable);
    dashedLines._creationDataStorage = new Meshes_mesh/* _CreationDataStorage */.Ez();
    dashedLines._creationDataStorage.dashSize = dashSize;
    dashedLines._creationDataStorage.gapSize = gapSize;
    return dashedLines;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use the functions directly from the module
 */
const LinesBuilder = {
    CreateDashedLines,
    CreateLineSystem,
    CreateLines,
};
mesh_vertexData/* VertexData */.P.CreateLineSystem = CreateLineSystemVertexData;
mesh_vertexData/* VertexData */.P.CreateDashedLines = CreateDashedLinesVertexData;
Meshes_mesh/* Mesh */.e.CreateLines = (name, points, scene = null, updatable = false, instance = null) => {
    const options = {
        points,
        updatable,
        instance,
    };
    return CreateLines(name, options, scene);
};
Meshes_mesh/* Mesh */.e.CreateDashedLines = (name, points, dashSize, gapSize, dashNb, scene = null, updatable, instance) => {
    const options = {
        points,
        dashSize,
        gapSize,
        dashNb,
        updatable,
        instance,
    };
    return CreateDashedLines(name, options, scene);
};
//# sourceMappingURL=linesBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/polygonMesh.js








/**
 * Vector2 wth index property
 */
class IndexedVector2 extends math_vector/* Vector2 */.I9 {
    constructor(original, 
    /** Index of the vector2 */
    index) {
        super(original.x, original.y);
        this.index = index;
    }
}
/**
 * Defines points to create a polygon
 */
class PolygonPoints {
    constructor() {
        this.elements = [];
    }
    add(originalPoints) {
        const result = [];
        originalPoints.forEach((point) => {
            const newPoint = new IndexedVector2(point, this.elements.length);
            result.push(newPoint);
            this.elements.push(newPoint);
        });
        return result;
    }
    computeBounds() {
        const lmin = new math_vector/* Vector2 */.I9(this.elements[0].x, this.elements[0].y);
        const lmax = new math_vector/* Vector2 */.I9(this.elements[0].x, this.elements[0].y);
        this.elements.forEach((point) => {
            // x
            if (point.x < lmin.x) {
                lmin.x = point.x;
            }
            else if (point.x > lmax.x) {
                lmax.x = point.x;
            }
            // y
            if (point.y < lmin.y) {
                lmin.y = point.y;
            }
            else if (point.y > lmax.y) {
                lmax.y = point.y;
            }
        });
        return {
            min: lmin,
            max: lmax,
            width: lmax.x - lmin.x,
            height: lmax.y - lmin.y,
        };
    }
}
/**
 * Polygon
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#non-regular-polygon
 */
class Polygon {
    /**
     * Creates a rectangle
     * @param xmin bottom X coord
     * @param ymin bottom Y coord
     * @param xmax top X coord
     * @param ymax top Y coord
     * @returns points that make the resulting rectangle
     */
    static Rectangle(xmin, ymin, xmax, ymax) {
        return [new math_vector/* Vector2 */.I9(xmin, ymin), new math_vector/* Vector2 */.I9(xmax, ymin), new math_vector/* Vector2 */.I9(xmax, ymax), new math_vector/* Vector2 */.I9(xmin, ymax)];
    }
    /**
     * Creates a circle
     * @param radius radius of circle
     * @param cx scale in x
     * @param cy scale in y
     * @param numberOfSides number of sides that make up the circle
     * @returns points that make the resulting circle
     */
    static Circle(radius, cx = 0, cy = 0, numberOfSides = 32) {
        const result = [];
        let angle = 0;
        const increment = (Math.PI * 2) / numberOfSides;
        for (let i = 0; i < numberOfSides; i++) {
            result.push(new math_vector/* Vector2 */.I9(cx + Math.cos(angle) * radius, cy + Math.sin(angle) * radius));
            angle -= increment;
        }
        return result;
    }
    /**
     * Creates a polygon from input string
     * @param input Input polygon data
     * @returns the parsed points
     */
    static Parse(input) {
        const floats = input
            .split(/[^-+eE.\d]+/)
            .map(parseFloat)
            .filter((val) => !isNaN(val));
        let i;
        const result = [];
        for (i = 0; i < (floats.length & 0x7ffffffe); i += 2) {
            result.push(new math_vector/* Vector2 */.I9(floats[i], floats[i + 1]));
        }
        return result;
    }
    /**
     * Starts building a polygon from x and y coordinates
     * @param x x coordinate
     * @param y y coordinate
     * @returns the started path2
     */
    static StartingAt(x, y) {
        return math_path/* Path2 */.Cu.StartingAt(x, y);
    }
}
/**
 * Builds a polygon
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/polyMeshBuilder
 */
class PolygonMeshBuilder {
    _addToepoint(points) {
        for (const p of points) {
            this._epoints.push(p.x, p.y);
        }
    }
    /**
     * Creates a PolygonMeshBuilder
     * @param name name of the builder
     * @param contours Path of the polygon
     * @param scene scene to add to when creating the mesh
     * @param earcutInjection can be used to inject your own earcut reference
     */
    constructor(name, contours, scene, earcutInjection = earcut) {
        this._points = new PolygonPoints();
        this._outlinepoints = new PolygonPoints();
        this._holes = new Array();
        this._epoints = new Array();
        this._eholes = new Array();
        this.bjsEarcut = earcutInjection;
        this._name = name;
        this._scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        let points;
        if (contours instanceof math_path/* Path2 */.Cu) {
            points = contours.getPoints();
        }
        else {
            points = contours;
        }
        this._addToepoint(points);
        this._points.add(points);
        this._outlinepoints.add(points);
        if (typeof this.bjsEarcut === "undefined") {
            logger/* Logger */.V.Warn("Earcut was not found, the polygon will not be built.");
        }
    }
    /**
     * Adds a hole within the polygon
     * @param hole Array of points defining the hole
     * @returns this
     */
    addHole(hole) {
        this._points.add(hole);
        const holepoints = new PolygonPoints();
        holepoints.add(hole);
        this._holes.push(holepoints);
        this._eholes.push(this._epoints.length / 2);
        this._addToepoint(hole);
        return this;
    }
    /**
     * Creates the polygon
     * @param updatable If the mesh should be updatable
     * @param depth The depth of the mesh created
     * @param smoothingThreshold Dot product threshold for smoothed normals
     * @returns the created mesh
     */
    build(updatable = false, depth = 0, smoothingThreshold = 2) {
        const result = new Meshes_mesh/* Mesh */.e(this._name, this._scene);
        const vertexData = this.buildVertexData(depth, smoothingThreshold);
        result.setVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, vertexData.positions, updatable);
        result.setVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind, vertexData.normals, updatable);
        result.setVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind, vertexData.uvs, updatable);
        result.setIndices(vertexData.indices);
        return result;
    }
    /**
     * Creates the polygon
     * @param depth The depth of the mesh created
     * @param smoothingThreshold Dot product threshold for smoothed normals
     * @returns the created VertexData
     */
    buildVertexData(depth = 0, smoothingThreshold = 2) {
        const result = new mesh_vertexData/* VertexData */.P();
        const normals = [];
        const positions = [];
        const uvs = [];
        const bounds = this._points.computeBounds();
        this._points.elements.forEach((p) => {
            normals.push(0, 1.0, 0);
            positions.push(p.x, 0, p.y);
            uvs.push((p.x - bounds.min.x) / bounds.width, (p.y - bounds.min.y) / bounds.height);
        });
        const indices = [];
        const res = this.bjsEarcut(this._epoints, this._eholes, 2);
        for (let i = 0; i < res.length; i++) {
            indices.push(res[i]);
        }
        if (depth > 0) {
            const positionscount = positions.length / 3; //get the current pointcount
            this._points.elements.forEach((p) => {
                //add the elements at the depth
                normals.push(0, -1.0, 0);
                positions.push(p.x, -depth, p.y);
                uvs.push(1 - (p.x - bounds.min.x) / bounds.width, 1 - (p.y - bounds.min.y) / bounds.height);
            });
            const totalCount = indices.length;
            for (let i = 0; i < totalCount; i += 3) {
                const i0 = indices[i + 0];
                const i1 = indices[i + 1];
                const i2 = indices[i + 2];
                indices.push(i2 + positionscount);
                indices.push(i1 + positionscount);
                indices.push(i0 + positionscount);
            }
            //Add the sides
            this._addSide(positions, normals, uvs, indices, bounds, this._outlinepoints, depth, false, smoothingThreshold);
            this._holes.forEach((hole) => {
                this._addSide(positions, normals, uvs, indices, bounds, hole, depth, true, smoothingThreshold);
            });
        }
        result.indices = indices;
        result.positions = positions;
        result.normals = normals;
        result.uvs = uvs;
        return result;
    }
    /**
     * Adds a side to the polygon
     * @param positions points that make the polygon
     * @param normals normals of the polygon
     * @param uvs uvs of the polygon
     * @param indices indices of the polygon
     * @param bounds bounds of the polygon
     * @param points points of the polygon
     * @param depth depth of the polygon
     * @param flip flip of the polygon
     * @param smoothingThreshold
     */
    _addSide(positions, normals, uvs, indices, bounds, points, depth, flip, smoothingThreshold) {
        let startIndex = positions.length / 3;
        let ulength = 0;
        for (let i = 0; i < points.elements.length; i++) {
            const p = points.elements[i];
            const p1 = points.elements[(i + 1) % points.elements.length];
            positions.push(p.x, 0, p.y);
            positions.push(p.x, -depth, p.y);
            positions.push(p1.x, 0, p1.y);
            positions.push(p1.x, -depth, p1.y);
            const p0 = points.elements[(i + points.elements.length - 1) % points.elements.length];
            const p2 = points.elements[(i + 2) % points.elements.length];
            let vc = new math_vector/* Vector3 */.Pq(-(p1.y - p.y), 0, p1.x - p.x);
            let vp = new math_vector/* Vector3 */.Pq(-(p.y - p0.y), 0, p.x - p0.x);
            let vn = new math_vector/* Vector3 */.Pq(-(p2.y - p1.y), 0, p2.x - p1.x);
            if (!flip) {
                vc = vc.scale(-1);
                vp = vp.scale(-1);
                vn = vn.scale(-1);
            }
            const vc_norm = vc.normalizeToNew();
            let vp_norm = vp.normalizeToNew();
            let vn_norm = vn.normalizeToNew();
            const dotp = math_vector/* Vector3 */.Pq.Dot(vp_norm, vc_norm);
            if (dotp > smoothingThreshold) {
                if (dotp < math_constants/* Epsilon */.bH - 1) {
                    vp_norm = new math_vector/* Vector3 */.Pq(p.x, 0, p.y).subtract(new math_vector/* Vector3 */.Pq(p1.x, 0, p1.y)).normalize();
                }
                else {
                    // cheap average weighed by side length
                    vp_norm = vp.add(vc).normalize();
                }
            }
            else {
                vp_norm = vc_norm;
            }
            const dotn = math_vector/* Vector3 */.Pq.Dot(vn, vc);
            if (dotn > smoothingThreshold) {
                if (dotn < math_constants/* Epsilon */.bH - 1) {
                    // back to back
                    vn_norm = new math_vector/* Vector3 */.Pq(p1.x, 0, p1.y).subtract(new math_vector/* Vector3 */.Pq(p.x, 0, p.y)).normalize();
                }
                else {
                    // cheap average weighed by side length
                    vn_norm = vn.add(vc).normalize();
                }
            }
            else {
                vn_norm = vc_norm;
            }
            uvs.push(ulength / bounds.width, 0);
            uvs.push(ulength / bounds.width, 1);
            ulength += vc.length();
            uvs.push(ulength / bounds.width, 0);
            uvs.push(ulength / bounds.width, 1);
            normals.push(vp_norm.x, vp_norm.y, vp_norm.z);
            normals.push(vp_norm.x, vp_norm.y, vp_norm.z);
            normals.push(vn_norm.x, vn_norm.y, vn_norm.z);
            normals.push(vn_norm.x, vn_norm.y, vn_norm.z);
            if (!flip) {
                indices.push(startIndex);
                indices.push(startIndex + 1);
                indices.push(startIndex + 2);
                indices.push(startIndex + 1);
                indices.push(startIndex + 3);
                indices.push(startIndex + 2);
            }
            else {
                indices.push(startIndex);
                indices.push(startIndex + 2);
                indices.push(startIndex + 1);
                indices.push(startIndex + 1);
                indices.push(startIndex + 2);
                indices.push(startIndex + 3);
            }
            startIndex += 4;
        }
    }
}
//# sourceMappingURL=polygonMesh.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/polygonBuilder.js








/**
 * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()
 * All parameters are provided by CreatePolygon as needed
 * @param polygon a mesh built from polygonTriangulation.build()
 * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
 * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
 * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @param wrp a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side
 * @returns the VertexData of the Polygon
 */
function CreatePolygonVertexData(polygon, sideOrientation, fUV, fColors, frontUVs, backUVs, wrp) {
    const faceUV = fUV || new Array(3);
    const faceColors = fColors;
    const colors = [];
    const wrap = wrp || false;
    // default face colors and UV if undefined
    for (let f = 0; f < 3; f++) {
        if (faceUV[f] === undefined) {
            faceUV[f] = new math_vector/* Vector4 */.IU(0, 0, 1, 1);
        }
        if (faceColors && faceColors[f] === undefined) {
            faceColors[f] = new math_color/* Color4 */.ov(1, 1, 1, 1);
        }
    }
    const positions = polygon.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
    const normals = polygon.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
    const uvs = polygon.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind);
    const indices = polygon.getIndices();
    const startIndex = positions.length / 9;
    let disp = 0;
    let distX = 0;
    let distZ = 0;
    let dist = 0;
    let totalLen = 0;
    const cumulate = [0];
    if (wrap) {
        for (let idx = startIndex; idx < positions.length / 3; idx += 4) {
            distX = positions[3 * (idx + 2)] - positions[3 * idx];
            distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2];
            dist = Math.sqrt(distX * distX + distZ * distZ);
            totalLen += dist;
            cumulate.push(totalLen);
        }
    }
    // set face colours and textures
    let idx = 0;
    let face = 0;
    for (let index = 0; index < normals.length; index += 3) {
        //Edge Face  no. 1
        if (Math.abs(normals[index + 1]) < 0.001) {
            face = 1;
        }
        //Top Face  no. 0
        if (Math.abs(normals[index + 1] - 1) < 0.001) {
            face = 0;
        }
        //Bottom Face  no. 2
        if (Math.abs(normals[index + 1] + 1) < 0.001) {
            face = 2;
        }
        idx = index / 3;
        if (face === 1) {
            disp = idx - startIndex;
            if (disp % 4 < 1.5) {
                if (wrap) {
                    uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)]) / totalLen;
                }
                else {
                    uvs[2 * idx] = faceUV[face].x;
                }
            }
            else {
                if (wrap) {
                    uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1]) / totalLen;
                }
                else {
                    uvs[2 * idx] = faceUV[face].z;
                }
            }
            if (disp % 2 === 0) {
                uvs[2 * idx + 1] = compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - faceUV[face].w : faceUV[face].w;
            }
            else {
                uvs[2 * idx + 1] = compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - faceUV[face].y : faceUV[face].y;
            }
        }
        else {
            uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z;
            uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w;
            if (compatibilityOptions/* useOpenGLOrientationForUV */.rX) {
                uvs[2 * idx + 1] = 1.0 - uvs[2 * idx + 1];
            }
        }
        if (faceColors) {
            colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);
        }
    }
    // sides
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);
    // Result
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    if (faceColors) {
        const totalColors = sideOrientation === mesh_vertexData/* VertexData */.P.DOUBLESIDE ? colors.concat(colors) : colors;
        vertexData.colors = totalColors;
    }
    return vertexData;
}
/**
 * Creates a polygon mesh
 * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh
 * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
 * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)
 * * Remember you can only change the shape positions, not their number when updating a polygon
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @param earcutInjection can be used to inject your own earcut reference
 * @returns the polygon mesh
 */
function CreatePolygon(name, options, scene = null, earcutInjection = earcut) {
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    const shape = options.shape;
    const holes = options.holes || [];
    const depth = options.depth || 0;
    const smoothingThreshold = options.smoothingThreshold || 2;
    const contours = [];
    let hole = [];
    for (let i = 0; i < shape.length; i++) {
        contours[i] = new math_vector/* Vector2 */.I9(shape[i].x, shape[i].z);
    }
    const epsilon = 0.00000001;
    if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) {
        contours.pop();
    }
    const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || engineStore/* EngineStore */.q.LastCreatedScene, earcutInjection);
    for (let hNb = 0; hNb < holes.length; hNb++) {
        hole = [];
        for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) {
            hole.push(new math_vector/* Vector2 */.I9(holes[hNb][hPoint].x, holes[hNb][hPoint].z));
        }
        polygonTriangulation.addHole(hole);
    }
    //updatability is set during applyToMesh; setting to true in triangulation build produces errors
    const polygon = polygonTriangulation.build(false, depth, smoothingThreshold);
    polygon._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);
    vertexData.applyToMesh(polygon, options.updatable);
    return polygon;
}
/**
 * Creates an extruded polygon mesh, with depth in the Y direction.
 * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @param earcutInjection can be used to inject your own earcut reference
 * @returns the polygon mesh
 */
function ExtrudePolygon(name, options, scene = null, earcutInjection = earcut) {
    return CreatePolygon(name, options, scene, earcutInjection);
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use the functions directly from the module
 */
const PolygonBuilder = {
    ExtrudePolygon,
    CreatePolygon,
};
mesh_vertexData/* VertexData */.P.CreatePolygon = CreatePolygonVertexData;
Meshes_mesh/* Mesh */.e.CreatePolygon = (name, shape, scene, holes, updatable, sideOrientation, earcutInjection = earcut) => {
    const options = {
        shape: shape,
        holes: holes,
        updatable: updatable,
        sideOrientation: sideOrientation,
    };
    return CreatePolygon(name, options, scene, earcutInjection);
};
Meshes_mesh/* Mesh */.e.ExtrudePolygon = (name, shape, depth, scene, holes, updatable, sideOrientation, earcutInjection = earcut) => {
    const options = {
        shape: shape,
        holes: holes,
        depth: depth,
        updatable: updatable,
        sideOrientation: sideOrientation,
    };
    return ExtrudePolygon(name, options, scene, earcutInjection);
};
//# sourceMappingURL=polygonBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/shapeBuilder.js




/**
 * Creates an extruded shape mesh. The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.
 * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis.
 * * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.
 * * The parameter `rotation` (float, default 0 radians) is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve.
 * * The parameter `scale` (float, default 1) is the value to scale the shape.
 * * The parameter `closeShape` (boolean, default false) closes the shape when true, since v5.0.0.
 * * The parameter `closePath` (boolean, default false) closes the path when true and no caps, since v5.0.0.
 * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
 * * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape
 * * Remember you can only change the shape or path point positions, not their number when updating an extruded shape.
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
 * * The optional parameter `firstNormal` (Vector3) defines the direction of the first normal of the supplied path. Consider using this for any path that is straight, and particular for paths in the xy plane.
 * * The optional `adjustFrame` (boolean, default false) will cause the internally generated Path3D tangents, normals, and binormals to be adjusted so that a) they are always well-defined, and b) they do not reverse from one path point to the next. This prevents the extruded shape from being flipped and/or rotated with resulting mesh self-intersections. This is primarily useful for straight paths that can reverse direction.
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the extruded shape mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
 */
function ExtrudeShape(name, options, scene = null) {
    const path = options.path;
    const shape = options.shape;
    const scale = options.scale || 1;
    const rotation = options.rotation || 0;
    const cap = options.cap === 0 ? 0 : options.cap || Meshes_mesh/* Mesh */.e.NO_CAP;
    const updatable = options.updatable;
    const sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    const instance = options.instance || null;
    const invertUV = options.invertUV || false;
    const closeShape = options.closeShape || false;
    const closePath = options.closePath || false;
    return _ExtrudeShapeGeneric(name, shape, path, scale, rotation, null, null, closePath, closeShape, cap, false, scene, updatable ? true : false, sideOrientation, instance, invertUV, options.frontUVs || null, options.backUVs || null, options.firstNormal || null, options.adjustFrame ? true : false);
}
/**
 * Creates an custom extruded shape mesh.
 * The custom extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.
 * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis.
 * * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.
 * * The parameter `rotationFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path and the distance of this point from the beginning of the path
 * * It must returns a float value that will be the rotation in radians applied to the shape on each path point.
 * * The parameter `scaleFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path and the distance of this point from the beginning of the path
 * * It must returns a float value that will be the scale value applied to the shape on each path point
 * * The parameter `closeShape` (boolean, default false) closes the shape when true, since v5.0.0.
 * * The parameter `closePath` (boolean, default false) closes the path when true and no caps, since v5.0.0.
 * * The parameter `ribbonClosePath` (boolean, default false) forces the extrusion underlying ribbon to close all the paths in its `pathArray` - depreciated in favor of closeShape
 * * The parameter `ribbonCloseArray` (boolean, default false) forces the extrusion underlying ribbon to close its `pathArray` - depreciated in favor of closePath
 * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
 * * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape
 * * Remember you can only change the shape or path point positions, not their number when updating an extruded shape
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * * The optional parameter `firstNormal` (Vector3) defines the direction of the first normal of the supplied path. It should be supplied when the path is in the xy plane, and particularly if these sections are straight, because the underlying Path3D object will pick a normal in the xy plane that causes the extrusion to be collapsed into the plane. This should be used for any path that is straight.
 * * The optional `adjustFrame` (boolean, default false) will cause the internally generated Path3D tangents, normals, and binormals to be adjusted so that a) they are always well-defined, and b) they do not reverse from one path point to the next. This prevents the extruded shape from being flipped and/or rotated with resulting mesh self-intersections. This is primarily useful for straight paths that can reverse direction.
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the custom extruded shape mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#custom-extruded-shapes
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
 */
function ExtrudeShapeCustom(name, options, scene = null) {
    const path = options.path;
    const shape = options.shape;
    const scaleFunction = options.scaleFunction ||
        (() => {
            return 1;
        });
    const rotationFunction = options.rotationFunction ||
        (() => {
            return 0;
        });
    const ribbonCloseArray = options.closePath || options.ribbonCloseArray || false;
    const ribbonClosePath = options.closeShape || options.ribbonClosePath || false;
    const cap = options.cap === 0 ? 0 : options.cap || Meshes_mesh/* Mesh */.e.NO_CAP;
    const updatable = options.updatable;
    const firstNormal = options.firstNormal || null;
    const adjustFrame = options.adjustFrame || false;
    const sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    const instance = options.instance;
    const invertUV = options.invertUV || false;
    return _ExtrudeShapeGeneric(name, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, true, scene, updatable ? true : false, sideOrientation, instance || null, invertUV, options.frontUVs || null, options.backUVs || null, firstNormal, adjustFrame);
}
function _ExtrudeShapeGeneric(name, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene, updtbl, side, instance, invertUV, frontUVs, backUVs, firstNormal, adjustFrame) {
    // extrusion geometry
    const extrusionPathArray = (shape, curve, path3D, shapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom, adjustFrame) => {
        const tangents = path3D.getTangents();
        const normals = path3D.getNormals();
        const binormals = path3D.getBinormals();
        const distances = path3D.getDistances();
        if (adjustFrame) {
            /* fix tangents,normals, binormals */
            for (let i = 0; i < tangents.length; i++) {
                if (tangents[i].x == 0 && tangents[i].y == 0 && tangents[i].z == 0) {
                    tangents[i].copyFrom(tangents[i - 1]);
                }
                if (normals[i].x == 0 && normals[i].y == 0 && normals[i].z == 0) {
                    normals[i].copyFrom(normals[i - 1]);
                }
                if (binormals[i].x == 0 && binormals[i].y == 0 && binormals[i].z == 0) {
                    binormals[i].copyFrom(binormals[i - 1]);
                }
                if (i > 0) {
                    let v = tangents[i - 1];
                    if (math_vector/* Vector3 */.Pq.Dot(v, tangents[i]) < 0) {
                        tangents[i].scaleInPlace(-1);
                    }
                    v = normals[i - 1];
                    if (math_vector/* Vector3 */.Pq.Dot(v, normals[i]) < 0) {
                        normals[i].scaleInPlace(-1);
                    }
                    v = binormals[i - 1];
                    if (math_vector/* Vector3 */.Pq.Dot(v, binormals[i]) < 0) {
                        binormals[i].scaleInPlace(-1);
                    }
                }
            }
        }
        let angle = 0;
        const returnScale = () => {
            return scale !== null ? scale : 1;
        };
        const returnRotation = () => {
            return rotation !== null ? rotation : 0;
        };
        const rotate = custom && rotateFunction ? rotateFunction : returnRotation;
        const scl = custom && scaleFunction ? scaleFunction : returnScale;
        let index = cap === Meshes_mesh/* Mesh */.e.NO_CAP || cap === Meshes_mesh/* Mesh */.e.CAP_END ? 0 : 2;
        const rotationMatrix = math_vector/* TmpVectors */.AA.Matrix[0];
        for (let i = 0; i < curve.length; i++) {
            const shapePath = [];
            const angleStep = rotate(i, distances[i]);
            const scaleRatio = scl(i, distances[i]);
            math_vector/* Matrix */.uq.RotationAxisToRef(tangents[i], angle, rotationMatrix);
            for (let p = 0; p < shape.length; p++) {
                const planed = tangents[i].scale(shape[p].z).add(normals[i].scale(shape[p].x)).add(binormals[i].scale(shape[p].y));
                const rotated = math_vector/* Vector3 */.Pq.Zero();
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(planed, rotationMatrix, rotated);
                rotated.scaleInPlace(scaleRatio).addInPlace(curve[i]);
                shapePath[p] = rotated;
            }
            shapePaths[index] = shapePath;
            angle += angleStep;
            index++;
        }
        // cap
        const capPath = (shapePath) => {
            const pointCap = Array();
            const barycenter = math_vector/* Vector3 */.Pq.Zero();
            let i;
            for (i = 0; i < shapePath.length; i++) {
                barycenter.addInPlace(shapePath[i]);
            }
            barycenter.scaleInPlace(1.0 / shapePath.length);
            for (i = 0; i < shapePath.length; i++) {
                pointCap.push(barycenter);
            }
            return pointCap;
        };
        switch (cap) {
            case Meshes_mesh/* Mesh */.e.NO_CAP:
                break;
            case Meshes_mesh/* Mesh */.e.CAP_START:
                shapePaths[0] = capPath(shapePaths[2]);
                shapePaths[1] = shapePaths[2];
                break;
            case Meshes_mesh/* Mesh */.e.CAP_END:
                shapePaths[index] = shapePaths[index - 1];
                shapePaths[index + 1] = capPath(shapePaths[index - 1]);
                break;
            case Meshes_mesh/* Mesh */.e.CAP_ALL:
                shapePaths[0] = capPath(shapePaths[2]);
                shapePaths[1] = shapePaths[2];
                shapePaths[index] = shapePaths[index - 1];
                shapePaths[index + 1] = capPath(shapePaths[index - 1]);
                break;
            default:
                break;
        }
        return shapePaths;
    };
    let path3D;
    let pathArray;
    if (instance) {
        // instance update
        const storage = instance._creationDataStorage;
        path3D = firstNormal ? storage.path3D.update(curve, firstNormal) : storage.path3D.update(curve);
        pathArray = extrusionPathArray(shape, curve, storage.path3D, storage.pathArray, scale, rotation, scaleFunction, rotateFunction, storage.cap, custom, adjustFrame);
        instance = CreateRibbon("", { pathArray, closeArray: false, closePath: false, offset: 0, updatable: false, sideOrientation: 0, instance }, scene || undefined);
        return instance;
    }
    // extruded shape creation
    path3D = firstNormal ? new math_path/* Path3D */.tO(curve, firstNormal) : new math_path/* Path3D */.tO(curve);
    const newShapePaths = new Array();
    cap = cap < 0 || cap > 3 ? 0 : cap;
    pathArray = extrusionPathArray(shape, curve, path3D, newShapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom, adjustFrame);
    const extrudedGeneric = CreateRibbon(name, {
        pathArray: pathArray,
        closeArray: rbCA,
        closePath: rbCP,
        updatable: updtbl,
        sideOrientation: side,
        invertUV: invertUV,
        frontUVs: frontUVs || undefined,
        backUVs: backUVs || undefined,
    }, scene);
    extrudedGeneric._creationDataStorage.pathArray = pathArray;
    extrudedGeneric._creationDataStorage.path3D = path3D;
    extrudedGeneric._creationDataStorage.cap = cap;
    return extrudedGeneric;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated please use the functions directly from the module
 */
const ShapeBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    ExtrudeShape,
    // eslint-disable-next-line @typescript-eslint/naming-convention
    ExtrudeShapeCustom,
};
Meshes_mesh/* Mesh */.e.ExtrudeShape = (name, shape, path, scale, rotation, cap, scene = null, updatable, sideOrientation, instance) => {
    const options = {
        shape: shape,
        path: path,
        scale: scale,
        rotation: rotation,
        cap: cap === 0 ? 0 : cap || Meshes_mesh/* Mesh */.e.NO_CAP,
        sideOrientation: sideOrientation,
        instance: instance,
        updatable: updatable,
    };
    return ExtrudeShape(name, options, scene);
};
Meshes_mesh/* Mesh */.e.ExtrudeShapeCustom = (name, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene, updatable, sideOrientation, instance) => {
    const options = {
        shape: shape,
        path: path,
        scaleFunction: scaleFunction,
        rotationFunction: rotationFunction,
        ribbonCloseArray: ribbonCloseArray,
        ribbonClosePath: ribbonClosePath,
        cap: cap === 0 ? 0 : cap || Meshes_mesh/* Mesh */.e.NO_CAP,
        sideOrientation: sideOrientation,
        instance: instance,
        updatable: updatable,
    };
    return ExtrudeShapeCustom(name, options, scene);
};
//# sourceMappingURL=shapeBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/latheBuilder.js



/**
 * Creates lathe mesh.
 * The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe
 * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero
 * * The parameter `radius` (positive float, default 1) is the radius value of the lathe
 * * The parameter `tessellation` (positive integer, default 64) is the side number of the lathe
 * * The parameter `clip` (positive integer, default 0) is the number of sides to not create without effecting the general shape of the sides
 * * The parameter `arc` (positive float, default 1) is the ratio of the lathe. 0.5 builds for instance half a lathe, so an opened shape
 * * The parameter `closed` (boolean, default true) opens/closes the lathe circumference. This should be set to false when used with the parameter "arc"
 * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the lathe mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lathe
 */
function CreateLathe(name, options, scene = null) {
    const arc = options.arc ? (options.arc <= 0 || options.arc > 1 ? 1.0 : options.arc) : 1.0;
    const closed = options.closed === undefined ? true : options.closed;
    const shape = options.shape;
    const radius = options.radius || 1;
    const tessellation = options.tessellation || 64;
    const clip = options.clip || 0;
    const updatable = options.updatable;
    const sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    const cap = options.cap || Meshes_mesh/* Mesh */.e.NO_CAP;
    const pi2 = Math.PI * 2;
    const paths = [];
    const invertUV = options.invertUV || false;
    let i = 0;
    let p = 0;
    const step = (pi2 / tessellation) * arc;
    let rotated;
    let path;
    for (i = 0; i <= tessellation - clip; i++) {
        path = [];
        if (cap == Meshes_mesh/* Mesh */.e.CAP_START || cap == Meshes_mesh/* Mesh */.e.CAP_ALL) {
            path.push(new math_vector/* Vector3 */.Pq(0, shape[0].y, 0));
            path.push(new math_vector/* Vector3 */.Pq(Math.cos(i * step) * shape[0].x * radius, shape[0].y, Math.sin(i * step) * shape[0].x * radius));
        }
        for (p = 0; p < shape.length; p++) {
            rotated = new math_vector/* Vector3 */.Pq(Math.cos(i * step) * shape[p].x * radius, shape[p].y, Math.sin(i * step) * shape[p].x * radius);
            path.push(rotated);
        }
        if (cap == Meshes_mesh/* Mesh */.e.CAP_END || cap == Meshes_mesh/* Mesh */.e.CAP_ALL) {
            path.push(new math_vector/* Vector3 */.Pq(Math.cos(i * step) * shape[shape.length - 1].x * radius, shape[shape.length - 1].y, Math.sin(i * step) * shape[shape.length - 1].x * radius));
            path.push(new math_vector/* Vector3 */.Pq(0, shape[shape.length - 1].y, 0));
        }
        paths.push(path);
    }
    // lathe ribbon
    const lathe = CreateRibbon(name, { pathArray: paths, closeArray: closed, sideOrientation: sideOrientation, updatable: updatable, invertUV: invertUV, frontUVs: options.frontUVs, backUVs: options.backUVs }, scene);
    return lathe;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use the function direction from the module
 */
const LatheBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateLathe,
};
Meshes_mesh/* Mesh */.e.CreateLathe = (name, shape, radius, tessellation, scene, updatable, sideOrientation) => {
    const options = {
        shape: shape,
        radius: radius,
        tessellation: tessellation,
        sideOrientation: sideOrientation,
        updatable: updatable,
    };
    return CreateLathe(name, options, scene);
};
//# sourceMappingURL=latheBuilder.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/Builders/planeBuilder.js
var planeBuilder = __webpack_require__(58144);
;// ./node_modules/@babylonjs/core/Meshes/Builders/tubeBuilder.js




/**
 * Creates a tube mesh.
 * The tube is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters
 * * The parameter `path` is a required array of successive Vector3. It is the curve used as the axis of the tube
 * * The parameter `radius` (positive float, default 1) sets the tube radius size
 * * The parameter `tessellation` (positive float, default 64) is the number of sides on the tubular surface
 * * The parameter `radiusFunction` (javascript function, default null) is a vanilla javascript function. If it is not null, it overrides the parameter `radius`
 * * This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path. It must return a radius value (positive float)
 * * The parameter `arc` (positive float, maximum 1, default 1) is the ratio to apply to the tube circumference : 2 x PI x arc
 * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
 * * The optional parameter `instance` is an instance of an existing Tube object to be updated with the passed `pathArray` parameter. The `path`Array HAS to have the SAME number of points as the previous one: https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#tube
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created. The NUMBER of points CAN'T CHANGE, only their positions.
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param options.path
 * @param options.radius
 * @param options.tessellation
 * @param options.radiusFunction
 * @param options.cap
 * @param options.arc
 * @param options.updatable
 * @param options.sideOrientation
 * @param options.frontUVs
 * @param options.backUVs
 * @param options.instance
 * @param options.invertUV
 * @param scene defines the hosting scene
 * @returns the tube mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#tube
 */
function CreateTube(name, options, scene = null) {
    const path = options.path;
    let instance = options.instance;
    let radius = 1.0;
    if (options.radius !== undefined) {
        radius = options.radius;
    }
    else if (instance) {
        radius = instance._creationDataStorage.radius;
    }
    const tessellation = options.tessellation || 64 | 0;
    const radiusFunction = options.radiusFunction || null;
    let cap = options.cap || Meshes_mesh/* Mesh */.e.NO_CAP;
    const invertUV = options.invertUV || false;
    const updatable = options.updatable;
    const sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    options.arc = options.arc && (options.arc <= 0.0 || options.arc > 1.0) ? 1.0 : options.arc || 1.0;
    // tube geometry
    const tubePathArray = (path, path3D, circlePaths, radius, tessellation, radiusFunction, cap, arc) => {
        const tangents = path3D.getTangents();
        const normals = path3D.getNormals();
        const distances = path3D.getDistances();
        const pi2 = Math.PI * 2;
        const step = (pi2 / tessellation) * arc;
        const returnRadius = () => radius;
        const radiusFunctionFinal = radiusFunction || returnRadius;
        let circlePath;
        let rad;
        let normal;
        let rotated;
        const rotationMatrix = math_vector/* TmpVectors */.AA.Matrix[0];
        let index = cap === Meshes_mesh/* Mesh */.e.NO_CAP || cap === Meshes_mesh/* Mesh */.e.CAP_END ? 0 : 2;
        for (let i = 0; i < path.length; i++) {
            rad = radiusFunctionFinal(i, distances[i]); // current radius
            circlePath = Array(); // current circle array
            normal = normals[i]; // current normal
            for (let t = 0; t < tessellation; t++) {
                math_vector/* Matrix */.uq.RotationAxisToRef(tangents[i], step * t, rotationMatrix);
                rotated = circlePath[t] ? circlePath[t] : math_vector/* Vector3 */.Pq.Zero();
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(normal, rotationMatrix, rotated);
                rotated.scaleInPlace(rad).addInPlace(path[i]);
                circlePath[t] = rotated;
            }
            circlePaths[index] = circlePath;
            index++;
        }
        // cap
        const capPath = (nbPoints, pathIndex) => {
            const pointCap = Array();
            for (let i = 0; i < nbPoints; i++) {
                pointCap.push(path[pathIndex]);
            }
            return pointCap;
        };
        switch (cap) {
            case Meshes_mesh/* Mesh */.e.NO_CAP:
                break;
            case Meshes_mesh/* Mesh */.e.CAP_START:
                circlePaths[0] = capPath(tessellation, 0);
                circlePaths[1] = circlePaths[2].slice(0);
                break;
            case Meshes_mesh/* Mesh */.e.CAP_END:
                circlePaths[index] = circlePaths[index - 1].slice(0);
                circlePaths[index + 1] = capPath(tessellation, path.length - 1);
                break;
            case Meshes_mesh/* Mesh */.e.CAP_ALL:
                circlePaths[0] = capPath(tessellation, 0);
                circlePaths[1] = circlePaths[2].slice(0);
                circlePaths[index] = circlePaths[index - 1].slice(0);
                circlePaths[index + 1] = capPath(tessellation, path.length - 1);
                break;
            default:
                break;
        }
        return circlePaths;
    };
    let path3D;
    let pathArray;
    if (instance) {
        // tube update
        const storage = instance._creationDataStorage;
        const arc = options.arc || storage.arc;
        path3D = storage.path3D.update(path);
        pathArray = tubePathArray(path, path3D, storage.pathArray, radius, storage.tessellation, radiusFunction, storage.cap, arc);
        instance = CreateRibbon("", { pathArray: pathArray, instance: instance });
        // Update mode, no need to recreate the storage.
        storage.path3D = path3D;
        storage.pathArray = pathArray;
        storage.arc = arc;
        storage.radius = radius;
        return instance;
    }
    // tube creation
    path3D = new math_path/* Path3D */.tO(path);
    const newPathArray = new Array();
    cap = cap < 0 || cap > 3 ? 0 : cap;
    pathArray = tubePathArray(path, path3D, newPathArray, radius, tessellation, radiusFunction, cap, options.arc);
    const tube = CreateRibbon(name, {
        pathArray: pathArray,
        closePath: true,
        closeArray: false,
        updatable: updatable,
        sideOrientation: sideOrientation,
        invertUV: invertUV,
        frontUVs: options.frontUVs,
        backUVs: options.backUVs,
    }, scene);
    tube._creationDataStorage.pathArray = pathArray;
    tube._creationDataStorage.path3D = path3D;
    tube._creationDataStorage.tessellation = tessellation;
    tube._creationDataStorage.cap = cap;
    tube._creationDataStorage.arc = options.arc;
    tube._creationDataStorage.radius = radius;
    return tube;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use CreateTube directly
 */
const TubeBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateTube,
};
Meshes_mesh/* Mesh */.e.CreateTube = (name, path, radius, tessellation, radiusFunction, cap, scene, updatable, sideOrientation, instance) => {
    const options = {
        path: path,
        radius: radius,
        tessellation: tessellation,
        radiusFunction: radiusFunction,
        arc: 1,
        cap: cap,
        updatable: updatable,
        sideOrientation: sideOrientation,
        instance: instance,
    };
    return CreateTube(name, options, scene);
};
//# sourceMappingURL=tubeBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/polyhedronBuilder.js





// inspired from // http://stemkoski.github.io/Three.js/Polyhedra.html
/**
 * Creates the VertexData for a Polyhedron
 * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
 * * type provided types are:
 *  * 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1)
 *  * 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20)
 * * size the size of the IcoSphere, optional default 1
 * * sizeX allows stretching in the x direction, optional, default size
 * * sizeY allows stretching in the y direction, optional, default size
 * * sizeZ allows stretching in the z direction, optional, default size
 * * custom a number that overwrites the type to create from an extended set of polyhedron from https://www.babylonjs-playground.com/#21QRSK#15 with minimised editor
 * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
 * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
 * * flat when true creates a flat shaded mesh, optional, default true
 * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @returns the VertexData of the Polyhedron
 */
function CreatePolyhedronVertexData(options) {
    // provided polyhedron types :
    // 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1)
    // 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20)
    const polyhedra = [];
    polyhedra[0] = {
        vertex: [
            [0, 0, 1.732051],
            [1.632993, 0, -0.5773503],
            [-0.8164966, 1.414214, -0.5773503],
            [-0.8164966, -1.414214, -0.5773503],
        ],
        face: [
            [0, 1, 2],
            [0, 2, 3],
            [0, 3, 1],
            [1, 3, 2],
        ],
    };
    polyhedra[1] = {
        vertex: [
            [0, 0, 1.414214],
            [1.414214, 0, 0],
            [0, 1.414214, 0],
            [-1.414214, 0, 0],
            [0, -1.414214, 0],
            [0, 0, -1.414214],
        ],
        face: [
            [0, 1, 2],
            [0, 2, 3],
            [0, 3, 4],
            [0, 4, 1],
            [1, 4, 5],
            [1, 5, 2],
            [2, 5, 3],
            [3, 5, 4],
        ],
    };
    polyhedra[2] = {
        vertex: [
            [0, 0, 1.070466],
            [0.7136442, 0, 0.7978784],
            [-0.3568221, 0.618034, 0.7978784],
            [-0.3568221, -0.618034, 0.7978784],
            [0.7978784, 0.618034, 0.3568221],
            [0.7978784, -0.618034, 0.3568221],
            [-0.9341724, 0.381966, 0.3568221],
            [0.1362939, 1, 0.3568221],
            [0.1362939, -1, 0.3568221],
            [-0.9341724, -0.381966, 0.3568221],
            [0.9341724, 0.381966, -0.3568221],
            [0.9341724, -0.381966, -0.3568221],
            [-0.7978784, 0.618034, -0.3568221],
            [-0.1362939, 1, -0.3568221],
            [-0.1362939, -1, -0.3568221],
            [-0.7978784, -0.618034, -0.3568221],
            [0.3568221, 0.618034, -0.7978784],
            [0.3568221, -0.618034, -0.7978784],
            [-0.7136442, 0, -0.7978784],
            [0, 0, -1.070466],
        ],
        face: [
            [0, 1, 4, 7, 2],
            [0, 2, 6, 9, 3],
            [0, 3, 8, 5, 1],
            [1, 5, 11, 10, 4],
            [2, 7, 13, 12, 6],
            [3, 9, 15, 14, 8],
            [4, 10, 16, 13, 7],
            [5, 8, 14, 17, 11],
            [6, 12, 18, 15, 9],
            [10, 11, 17, 19, 16],
            [12, 13, 16, 19, 18],
            [14, 15, 18, 19, 17],
        ],
    };
    polyhedra[3] = {
        vertex: [
            [0, 0, 1.175571],
            [1.051462, 0, 0.5257311],
            [0.3249197, 1, 0.5257311],
            [-0.8506508, 0.618034, 0.5257311],
            [-0.8506508, -0.618034, 0.5257311],
            [0.3249197, -1, 0.5257311],
            [0.8506508, 0.618034, -0.5257311],
            [0.8506508, -0.618034, -0.5257311],
            [-0.3249197, 1, -0.5257311],
            [-1.051462, 0, -0.5257311],
            [-0.3249197, -1, -0.5257311],
            [0, 0, -1.175571],
        ],
        face: [
            [0, 1, 2],
            [0, 2, 3],
            [0, 3, 4],
            [0, 4, 5],
            [0, 5, 1],
            [1, 5, 7],
            [1, 7, 6],
            [1, 6, 2],
            [2, 6, 8],
            [2, 8, 3],
            [3, 8, 9],
            [3, 9, 4],
            [4, 9, 10],
            [4, 10, 5],
            [5, 10, 7],
            [6, 7, 11],
            [6, 11, 8],
            [7, 10, 11],
            [8, 11, 9],
            [9, 11, 10],
        ],
    };
    polyhedra[4] = {
        vertex: [
            [0, 0, 1.070722],
            [0.7148135, 0, 0.7971752],
            [-0.104682, 0.7071068, 0.7971752],
            [-0.6841528, 0.2071068, 0.7971752],
            [-0.104682, -0.7071068, 0.7971752],
            [0.6101315, 0.7071068, 0.5236279],
            [1.04156, 0.2071068, 0.1367736],
            [0.6101315, -0.7071068, 0.5236279],
            [-0.3574067, 1, 0.1367736],
            [-0.7888348, -0.5, 0.5236279],
            [-0.9368776, 0.5, 0.1367736],
            [-0.3574067, -1, 0.1367736],
            [0.3574067, 1, -0.1367736],
            [0.9368776, -0.5, -0.1367736],
            [0.7888348, 0.5, -0.5236279],
            [0.3574067, -1, -0.1367736],
            [-0.6101315, 0.7071068, -0.5236279],
            [-1.04156, -0.2071068, -0.1367736],
            [-0.6101315, -0.7071068, -0.5236279],
            [0.104682, 0.7071068, -0.7971752],
            [0.6841528, -0.2071068, -0.7971752],
            [0.104682, -0.7071068, -0.7971752],
            [-0.7148135, 0, -0.7971752],
            [0, 0, -1.070722],
        ],
        face: [
            [0, 2, 3],
            [1, 6, 5],
            [4, 9, 11],
            [7, 15, 13],
            [8, 16, 10],
            [12, 14, 19],
            [17, 22, 18],
            [20, 21, 23],
            [0, 1, 5, 2],
            [0, 3, 9, 4],
            [0, 4, 7, 1],
            [1, 7, 13, 6],
            [2, 5, 12, 8],
            [2, 8, 10, 3],
            [3, 10, 17, 9],
            [4, 11, 15, 7],
            [5, 6, 14, 12],
            [6, 13, 20, 14],
            [8, 12, 19, 16],
            [9, 17, 18, 11],
            [10, 16, 22, 17],
            [11, 18, 21, 15],
            [13, 15, 21, 20],
            [14, 20, 23, 19],
            [16, 19, 23, 22],
            [18, 22, 23, 21],
        ],
    };
    polyhedra[5] = {
        vertex: [
            [0, 0, 1.322876],
            [1.309307, 0, 0.1889822],
            [-0.9819805, 0.8660254, 0.1889822],
            [0.1636634, -1.299038, 0.1889822],
            [0.3273268, 0.8660254, -0.9449112],
            [-0.8183171, -0.4330127, -0.9449112],
        ],
        face: [
            [0, 3, 1],
            [2, 4, 5],
            [0, 1, 4, 2],
            [0, 2, 5, 3],
            [1, 3, 5, 4],
        ],
    };
    polyhedra[6] = {
        vertex: [
            [0, 0, 1.159953],
            [1.013464, 0, 0.5642542],
            [-0.3501431, 0.9510565, 0.5642542],
            [-0.7715208, -0.6571639, 0.5642542],
            [0.6633206, 0.9510565, -0.03144481],
            [0.8682979, -0.6571639, -0.3996071],
            [-1.121664, 0.2938926, -0.03144481],
            [-0.2348831, -1.063314, -0.3996071],
            [0.5181548, 0.2938926, -0.9953061],
            [-0.5850262, -0.112257, -0.9953061],
        ],
        face: [
            [0, 1, 4, 2],
            [0, 2, 6, 3],
            [1, 5, 8, 4],
            [3, 6, 9, 7],
            [5, 7, 9, 8],
            [0, 3, 7, 5, 1],
            [2, 4, 8, 9, 6],
        ],
    };
    polyhedra[7] = {
        vertex: [
            [0, 0, 1.118034],
            [0.8944272, 0, 0.6708204],
            [-0.2236068, 0.8660254, 0.6708204],
            [-0.7826238, -0.4330127, 0.6708204],
            [0.6708204, 0.8660254, 0.2236068],
            [1.006231, -0.4330127, -0.2236068],
            [-1.006231, 0.4330127, 0.2236068],
            [-0.6708204, -0.8660254, -0.2236068],
            [0.7826238, 0.4330127, -0.6708204],
            [0.2236068, -0.8660254, -0.6708204],
            [-0.8944272, 0, -0.6708204],
            [0, 0, -1.118034],
        ],
        face: [
            [0, 1, 4, 2],
            [0, 2, 6, 3],
            [1, 5, 8, 4],
            [3, 6, 10, 7],
            [5, 9, 11, 8],
            [7, 10, 11, 9],
            [0, 3, 7, 9, 5, 1],
            [2, 4, 8, 11, 10, 6],
        ],
    };
    polyhedra[8] = {
        vertex: [
            [-0.729665, 0.670121, 0.319155],
            [-0.655235, -0.29213, -0.754096],
            [-0.093922, -0.607123, 0.537818],
            [0.702196, 0.595691, 0.485187],
            [0.776626, -0.36656, -0.588064],
        ],
        face: [
            [1, 4, 2],
            [0, 1, 2],
            [3, 0, 2],
            [4, 3, 2],
            [4, 1, 0, 3],
        ],
    };
    polyhedra[9] = {
        vertex: [
            [-0.868849, -0.100041, 0.61257],
            [-0.329458, 0.976099, 0.28078],
            [-0.26629, -0.013796, -0.477654],
            [-0.13392, -1.034115, 0.229829],
            [0.738834, 0.707117, -0.307018],
            [0.859683, -0.535264, -0.338508],
        ],
        face: [
            [3, 0, 2],
            [5, 3, 2],
            [4, 5, 2],
            [1, 4, 2],
            [0, 1, 2],
            [0, 3, 5, 4, 1],
        ],
    };
    polyhedra[10] = {
        vertex: [
            [-0.610389, 0.243975, 0.531213],
            [-0.187812, -0.48795, -0.664016],
            [-0.187812, 0.9759, -0.664016],
            [0.187812, -0.9759, 0.664016],
            [0.798201, 0.243975, 0.132803],
        ],
        face: [
            [1, 3, 0],
            [3, 4, 0],
            [3, 1, 4],
            [0, 2, 1],
            [0, 4, 2],
            [2, 4, 1],
        ],
    };
    polyhedra[11] = {
        vertex: [
            [-1.028778, 0.392027, -0.048786],
            [-0.640503, -0.646161, 0.621837],
            [-0.125162, -0.395663, -0.540059],
            [0.004683, 0.888447, -0.651988],
            [0.125161, 0.395663, 0.540059],
            [0.632925, -0.791376, 0.433102],
            [1.031672, 0.157063, -0.354165],
        ],
        face: [
            [3, 2, 0],
            [2, 1, 0],
            [2, 5, 1],
            [0, 4, 3],
            [0, 1, 4],
            [4, 1, 5],
            [2, 3, 6],
            [3, 4, 6],
            [5, 2, 6],
            [4, 5, 6],
        ],
    };
    polyhedra[12] = {
        vertex: [
            [-0.669867, 0.334933, -0.529576],
            [-0.669867, 0.334933, 0.529577],
            [-0.4043, 1.212901, 0],
            [-0.334933, -0.669867, -0.529576],
            [-0.334933, -0.669867, 0.529577],
            [0.334933, 0.669867, -0.529576],
            [0.334933, 0.669867, 0.529577],
            [0.4043, -1.212901, 0],
            [0.669867, -0.334933, -0.529576],
            [0.669867, -0.334933, 0.529577],
        ],
        face: [
            [8, 9, 7],
            [6, 5, 2],
            [3, 8, 7],
            [5, 0, 2],
            [4, 3, 7],
            [0, 1, 2],
            [9, 4, 7],
            [1, 6, 2],
            [9, 8, 5, 6],
            [8, 3, 0, 5],
            [3, 4, 1, 0],
            [4, 9, 6, 1],
        ],
    };
    polyhedra[13] = {
        vertex: [
            [-0.931836, 0.219976, -0.264632],
            [-0.636706, 0.318353, 0.692816],
            [-0.613483, -0.735083, -0.264632],
            [-0.326545, 0.979634, 0],
            [-0.318353, -0.636706, 0.692816],
            [-0.159176, 0.477529, -0.856368],
            [0.159176, -0.477529, -0.856368],
            [0.318353, 0.636706, 0.692816],
            [0.326545, -0.979634, 0],
            [0.613482, 0.735082, -0.264632],
            [0.636706, -0.318353, 0.692816],
            [0.931835, -0.219977, -0.264632],
        ],
        face: [
            [11, 10, 8],
            [7, 9, 3],
            [6, 11, 8],
            [9, 5, 3],
            [2, 6, 8],
            [5, 0, 3],
            [4, 2, 8],
            [0, 1, 3],
            [10, 4, 8],
            [1, 7, 3],
            [10, 11, 9, 7],
            [11, 6, 5, 9],
            [6, 2, 0, 5],
            [2, 4, 1, 0],
            [4, 10, 7, 1],
        ],
    };
    polyhedra[14] = {
        vertex: [
            [-0.93465, 0.300459, -0.271185],
            [-0.838689, -0.260219, -0.516017],
            [-0.711319, 0.717591, 0.128359],
            [-0.710334, -0.156922, 0.080946],
            [-0.599799, 0.556003, -0.725148],
            [-0.503838, -0.004675, -0.969981],
            [-0.487004, 0.26021, 0.48049],
            [-0.460089, -0.750282, -0.512622],
            [-0.376468, 0.973135, -0.325605],
            [-0.331735, -0.646985, 0.084342],
            [-0.254001, 0.831847, 0.530001],
            [-0.125239, -0.494738, -0.966586],
            [0.029622, 0.027949, 0.730817],
            [0.056536, -0.982543, -0.262295],
            [0.08085, 1.087391, 0.076037],
            [0.125583, -0.532729, 0.485984],
            [0.262625, 0.599586, 0.780328],
            [0.391387, -0.726999, -0.716259],
            [0.513854, -0.868287, 0.139347],
            [0.597475, 0.85513, 0.326364],
            [0.641224, 0.109523, 0.783723],
            [0.737185, -0.451155, 0.538891],
            [0.848705, -0.612742, -0.314616],
            [0.976075, 0.365067, 0.32976],
            [1.072036, -0.19561, 0.084927],
        ],
        face: [
            [15, 18, 21],
            [12, 20, 16],
            [6, 10, 2],
            [3, 0, 1],
            [9, 7, 13],
            [2, 8, 4, 0],
            [0, 4, 5, 1],
            [1, 5, 11, 7],
            [7, 11, 17, 13],
            [13, 17, 22, 18],
            [18, 22, 24, 21],
            [21, 24, 23, 20],
            [20, 23, 19, 16],
            [16, 19, 14, 10],
            [10, 14, 8, 2],
            [15, 9, 13, 18],
            [12, 15, 21, 20],
            [6, 12, 16, 10],
            [3, 6, 2, 0],
            [9, 3, 1, 7],
            [9, 15, 12, 6, 3],
            [22, 17, 11, 5, 4, 8, 14, 19, 23, 24],
        ],
    };
    const type = options.type && (options.type < 0 || options.type >= polyhedra.length) ? 0 : options.type || 0;
    const size = options.size;
    const sizeX = options.sizeX || size || 1;
    const sizeY = options.sizeY || size || 1;
    const sizeZ = options.sizeZ || size || 1;
    const data = options.custom || polyhedra[type];
    const nbfaces = data.face.length;
    const faceUV = options.faceUV || new Array(nbfaces);
    const faceColors = options.faceColors;
    const flat = options.flat === undefined ? true : options.flat;
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    const positions = [];
    const indices = [];
    const normals = [];
    const uvs = [];
    const colors = [];
    let index = 0;
    let faceIdx = 0; // face cursor in the array "indexes"
    const indexes = [];
    let i = 0;
    let f = 0;
    let u, v, ang, x, y, tmp;
    // default face colors and UV if undefined
    if (flat) {
        for (f = 0; f < nbfaces; f++) {
            if (faceColors && faceColors[f] === undefined) {
                faceColors[f] = new math_color/* Color4 */.ov(1, 1, 1, 1);
            }
            if (faceUV && faceUV[f] === undefined) {
                faceUV[f] = new math_vector/* Vector4 */.IU(0, 0, 1, 1);
            }
        }
    }
    if (!flat) {
        for (i = 0; i < data.vertex.length; i++) {
            positions.push(data.vertex[i][0] * sizeX, data.vertex[i][1] * sizeY, data.vertex[i][2] * sizeZ);
            uvs.push(0, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 : 0);
        }
        for (f = 0; f < nbfaces; f++) {
            for (i = 0; i < data.face[f].length - 2; i++) {
                indices.push(data.face[f][0], data.face[f][i + 2], data.face[f][i + 1]);
            }
        }
    }
    else {
        for (f = 0; f < nbfaces; f++) {
            const fl = data.face[f].length; // number of vertices of the current face
            ang = (2 * Math.PI) / fl;
            x = 0.5 * Math.tan(ang / 2);
            y = 0.5;
            // positions, uvs, colors
            for (i = 0; i < fl; i++) {
                // positions
                positions.push(data.vertex[data.face[f][i]][0] * sizeX, data.vertex[data.face[f][i]][1] * sizeY, data.vertex[data.face[f][i]][2] * sizeZ);
                indexes.push(index);
                index++;
                // uvs
                u = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * (0.5 + x);
                v = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * (y - 0.5);
                uvs.push(u, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - v : v);
                tmp = x * Math.cos(ang) - y * Math.sin(ang);
                y = x * Math.sin(ang) + y * Math.cos(ang);
                x = tmp;
                // colors
                if (faceColors) {
                    colors.push(faceColors[f].r, faceColors[f].g, faceColors[f].b, faceColors[f].a);
                }
            }
            // indices from indexes
            for (i = 0; i < fl - 2; i++) {
                indices.push(indexes[0 + faceIdx], indexes[i + 2 + faceIdx], indexes[i + 1 + faceIdx]);
            }
            faceIdx += fl;
        }
    }
    mesh_vertexData/* VertexData */.P.ComputeNormals(positions, indices, normals);
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.positions = positions;
    vertexData.indices = indices;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    if (faceColors && flat) {
        vertexData.colors = colors;
    }
    return vertexData;
}
/**
 * Creates a polyhedron mesh
 * * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial to choose the wanted type
 * * The parameter `size` (positive float, default 1) sets the polygon size
 * * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value)
 * * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overrides the parameter `type`
 * * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
 * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
 * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
 * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the polyhedron mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra
 */
function CreatePolyhedron(name, options = {}, scene = null) {
    const polyhedron = new Meshes_mesh/* Mesh */.e(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    polyhedron._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreatePolyhedronVertexData(options);
    vertexData.applyToMesh(polyhedron, options.updatable);
    return polyhedron;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use the function directly from the module
 */
const PolyhedronBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreatePolyhedron,
};
mesh_vertexData/* VertexData */.P.CreatePolyhedron = CreatePolyhedronVertexData;
Meshes_mesh/* Mesh */.e.CreatePolyhedron = (name, options, scene) => {
    return CreatePolyhedron(name, options, scene);
};
//# sourceMappingURL=polyhedronBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/icoSphereBuilder.js




/**
 * Creates the VertexData of the IcoSphere
 * @param options an object used to set the following optional parameters for the IcoSphere, required but can be empty
 * * radius the radius of the IcoSphere, optional default 1
 * * radiusX allows stretching in the x direction, optional, default radius
 * * radiusY allows stretching in the y direction, optional, default radius
 * * radiusZ allows stretching in the z direction, optional, default radius
 * * flat when true creates a flat shaded mesh, optional, default true
 * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @returns the VertexData of the IcoSphere
 */
function CreateIcoSphereVertexData(options) {
    const sideOrientation = options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    const radius = options.radius || 1;
    const flat = options.flat === undefined ? true : options.flat;
    const subdivisions = (options.subdivisions || 4) | 0;
    const radiusX = options.radiusX || radius;
    const radiusY = options.radiusY || radius;
    const radiusZ = options.radiusZ || radius;
    const t = (1 + Math.sqrt(5)) / 2;
    // 12 vertex x,y,z
    const icoVertices = [
        -1,
        t,
        -0,
        1,
        t,
        0,
        -1,
        -t,
        0,
        1,
        -t,
        0, // v0-3
        0,
        -1,
        -t,
        0,
        1,
        -t,
        0,
        -1,
        t,
        0,
        1,
        t, // v4-7
        t,
        0,
        1,
        t,
        0,
        -1,
        -t,
        0,
        1,
        -t,
        0,
        -1, // v8-11
    ];
    // index of 3 vertex makes a face of icopshere
    const ico_indices = [
        0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, 4, 21, 5, 13, 17,
        23, 6, 13, 22, 19, 6, 18, 9, 8, 1,
    ];
    // vertex for uv have aliased position, not for UV
    const vertices_unalias_id = [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        // vertex alias
        0, // 12: 0 + 12
        2, // 13: 2 + 11
        3, // 14: 3 + 11
        3, // 15: 3 + 12
        3, // 16: 3 + 13
        4, // 17: 4 + 13
        7, // 18: 7 + 11
        8, // 19: 8 + 11
        9, // 20: 9 + 11
        9, // 21: 9 + 12
        10, // 22: A + 12
        11, // 23: B + 12
    ];
    // uv as integer step (not pixels !)
    const ico_vertexuv = [
        5,
        1,
        3,
        1,
        6,
        4,
        0,
        0, // v0-3
        5,
        3,
        4,
        2,
        2,
        2,
        4,
        0, // v4-7
        2,
        0,
        1,
        1,
        6,
        0,
        6,
        2, // v8-11
        // vertex alias (for same vertex on different faces)
        0,
        4, // 12: 0 + 12
        3,
        3, // 13: 2 + 11
        4,
        4, // 14: 3 + 11
        3,
        1, // 15: 3 + 12
        4,
        2, // 16: 3 + 13
        4,
        4, // 17: 4 + 13
        0,
        2, // 18: 7 + 11
        1,
        1, // 19: 8 + 11
        2,
        2, // 20: 9 + 11
        3,
        3, // 21: 9 + 12
        1,
        3, // 22: A + 12
        2,
        4, // 23: B + 12
    ];
    // Vertices[0, 1, ...9, A, B] : position on UV plane
    // '+' indicate duplicate position to be fixed (3,9:0,2,3,4,7,8,A,B)
    // First island of uv mapping
    // v = 4h          3+  2
    // v = 3h        9+  4
    // v = 2h      9+  5   B
    // v = 1h    9   1   0
    // v = 0h  3   8   7   A
    //     u = 0 1 2 3 4 5 6  *a
    // Second island of uv mapping
    // v = 4h  0+  B+  4+
    // v = 3h    A+  2+
    // v = 2h  7+  6   3+
    // v = 1h    8+  3+
    // v = 0h
    //     u = 0 1 2 3 4 5 6  *a
    // Face layout on texture UV mapping
    // ============
    // \ 4  /\ 16 /   ======
    //  \  /  \  /   /\ 11 /
    //   \/ 7  \/   /  \  /
    //    =======  / 10 \/
    //   /\ 17 /\  =======
    //  /  \  /  \ \ 15 /\
    // / 8  \/ 12 \ \  /  \
    // ============  \/ 6  \
    // \ 18 /\  ============
    //  \  /  \ \ 5  /\ 0  /
    //   \/ 13 \ \  /  \  /
    //   =======  \/ 1  \/
    //       =============
    //      /\ 19 /\  2 /\
    //     /  \  /  \  /  \
    //    / 14 \/ 9  \/  3 \
    //   ===================
    // uv step is u:1 or 0.5, v:cos(30)=sqrt(3)/2, ratio approx is 84/97
    const ustep = 138 / 1024;
    const vstep = 239 / 1024;
    const uoffset = 60 / 1024;
    const voffset = 26 / 1024;
    // Second island should have margin, not to touch the first island
    // avoid any borderline artefact in pixel rounding
    const island_u_offset = -40 / 1024;
    const island_v_offset = +20 / 1024;
    // face is either island 0 or 1 :
    // second island is for faces : [4, 7, 8, 12, 13, 16, 17, 18]
    const island = [
        0,
        0,
        0,
        0,
        1, //  0 - 4
        0,
        0,
        1,
        1,
        0, //  5 - 9
        0,
        0,
        1,
        1,
        0, //  10 - 14
        0,
        1,
        1,
        1,
        0, //  15 - 19
    ];
    const indices = [];
    const positions = [];
    const normals = [];
    const uvs = [];
    let current_indice = 0;
    // prepare array of 3 vector (empty) (to be worked in place, shared for each face)
    const face_vertex_pos = new Array(3);
    const face_vertex_uv = new Array(3);
    let v012;
    for (v012 = 0; v012 < 3; v012++) {
        face_vertex_pos[v012] = math_vector/* Vector3 */.Pq.Zero();
        face_vertex_uv[v012] = math_vector/* Vector2 */.I9.Zero();
    }
    // create all with normals
    for (let face = 0; face < 20; face++) {
        // 3 vertex per face
        for (v012 = 0; v012 < 3; v012++) {
            // look up vertex 0,1,2 to its index in 0 to 11 (or 23 including alias)
            const v_id = ico_indices[3 * face + v012];
            // vertex have 3D position (x,y,z)
            face_vertex_pos[v012].copyFromFloats(icoVertices[3 * vertices_unalias_id[v_id]], icoVertices[3 * vertices_unalias_id[v_id] + 1], icoVertices[3 * vertices_unalias_id[v_id] + 2]);
            // Normalize to get normal
            face_vertex_pos[v012].normalize();
            // uv Coordinates from vertex ID
            face_vertex_uv[v012].copyFromFloats(ico_vertexuv[2 * v_id] * ustep + uoffset + island[face] * island_u_offset, ico_vertexuv[2 * v_id + 1] * vstep + voffset + island[face] * island_v_offset);
        }
        // Subdivide the face (interpolate pos, norm, uv)
        // - pos is linear interpolation, then projected to sphere (converge polyhedron to sphere)
        // - norm is linear interpolation of vertex corner normal
        //   (to be checked if better to re-calc from face vertex, or if approximation is OK ??? )
        // - uv is linear interpolation
        //
        // Topology is as below for sub-divide by 2
        // vertex shown as v0,v1,v2
        // interp index is i1 to progress in range [v0,v1[
        // interp index is i2 to progress in range [v0,v2[
        // face index as  (i1,i2)  for /\  : (i1,i2),(i1+1,i2),(i1,i2+1)
        //            and (i1,i2)' for \/  : (i1+1,i2),(i1+1,i2+1),(i1,i2+1)
        //
        //
        //                    i2    v2
        //                    ^    ^
        //                   /    / \
        //                  /    /   \
        //                 /    /     \
        //                /    / (0,1) \
        //               /    #---------\
        //              /    / \ (0,0)'/ \
        //             /    /   \     /   \
        //            /    /     \   /     \
        //           /    / (0,0) \ / (1,0) \
        //          /    #---------#---------\
        //              v0                    v1
        //
        //              --------------------> i1
        //
        // interp of (i1,i2):
        //  along i2 :  x0=lerp(v0,v2, i2/S) <---> x1=lerp(v1,v2, i2/S)
        //  along i1 :  lerp(x0,x1, i1/(S-i2))
        //
        // centroid of triangle is needed to get help normal computation
        //  (c1,c2) are used for centroid location
        const interp_vertex = (i1, i2, c1, c2) => {
            // vertex is interpolated from
            //   - face_vertex_pos[0..2]
            //   - face_vertex_uv[0..2]
            const pos_x0 = math_vector/* Vector3 */.Pq.Lerp(face_vertex_pos[0], face_vertex_pos[2], i2 / subdivisions);
            const pos_x1 = math_vector/* Vector3 */.Pq.Lerp(face_vertex_pos[1], face_vertex_pos[2], i2 / subdivisions);
            const pos_interp = subdivisions === i2 ? face_vertex_pos[2] : math_vector/* Vector3 */.Pq.Lerp(pos_x0, pos_x1, i1 / (subdivisions - i2));
            pos_interp.normalize();
            let vertex_normal;
            if (flat) {
                // in flat mode, recalculate normal as face centroid normal
                const centroid_x0 = math_vector/* Vector3 */.Pq.Lerp(face_vertex_pos[0], face_vertex_pos[2], c2 / subdivisions);
                const centroid_x1 = math_vector/* Vector3 */.Pq.Lerp(face_vertex_pos[1], face_vertex_pos[2], c2 / subdivisions);
                vertex_normal = math_vector/* Vector3 */.Pq.Lerp(centroid_x0, centroid_x1, c1 / (subdivisions - c2));
            }
            else {
                // in smooth mode, recalculate normal from each single vertex position
                vertex_normal = new math_vector/* Vector3 */.Pq(pos_interp.x, pos_interp.y, pos_interp.z);
            }
            // Vertex normal need correction due to X,Y,Z radius scaling
            vertex_normal.x /= radiusX;
            vertex_normal.y /= radiusY;
            vertex_normal.z /= radiusZ;
            vertex_normal.normalize();
            const uv_x0 = math_vector/* Vector2 */.I9.Lerp(face_vertex_uv[0], face_vertex_uv[2], i2 / subdivisions);
            const uv_x1 = math_vector/* Vector2 */.I9.Lerp(face_vertex_uv[1], face_vertex_uv[2], i2 / subdivisions);
            const uv_interp = subdivisions === i2 ? face_vertex_uv[2] : math_vector/* Vector2 */.I9.Lerp(uv_x0, uv_x1, i1 / (subdivisions - i2));
            positions.push(pos_interp.x * radiusX, pos_interp.y * radiusY, pos_interp.z * radiusZ);
            normals.push(vertex_normal.x, vertex_normal.y, vertex_normal.z);
            uvs.push(uv_interp.x, compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1.0 - uv_interp.y : uv_interp.y);
            // push each vertex has member of a face
            // Same vertex can belong to multiple face, it is pushed multiple time (duplicate vertex are present)
            indices.push(current_indice);
            current_indice++;
        };
        for (let i2 = 0; i2 < subdivisions; i2++) {
            for (let i1 = 0; i1 + i2 < subdivisions; i1++) {
                // face : (i1,i2)  for /\  :
                // interp for : (i1,i2),(i1+1,i2),(i1,i2+1)
                interp_vertex(i1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);
                interp_vertex(i1 + 1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);
                interp_vertex(i1, i2 + 1, i1 + 1.0 / 3, i2 + 1.0 / 3);
                if (i1 + i2 + 1 < subdivisions) {
                    // face : (i1,i2)' for \/  :
                    // interp for (i1+1,i2),(i1+1,i2+1),(i1,i2+1)
                    interp_vertex(i1 + 1, i2, i1 + 2.0 / 3, i2 + 2.0 / 3);
                    interp_vertex(i1 + 1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);
                    interp_vertex(i1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);
                }
            }
        }
    }
    // Sides
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);
    // Result
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = indices;
    vertexData.positions = positions;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided
 * * The parameter `radius` sets the radius size (float) of the icosphere (default 1)
 * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value of `radius`)
 * * The parameter `subdivisions` sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
 * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
 * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
 * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
 * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the icosahedron mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere
 */
function CreateIcoSphere(name, options = {}, scene = null) {
    const sphere = new Meshes_mesh/* Mesh */.e(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    sphere._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateIcoSphereVertexData(options);
    vertexData.applyToMesh(sphere, options.updatable);
    return sphere;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use the function directly from the module
 */
const IcoSphereBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateIcoSphere,
};
mesh_vertexData/* VertexData */.P.CreateIcoSphere = CreateIcoSphereVertexData;
Meshes_mesh/* Mesh */.e.CreateIcoSphere = (name, options, scene) => {
    return CreateIcoSphere(name, options, scene);
};
//# sourceMappingURL=icoSphereBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/decalBuilder.js






const xpAxis = new math_vector/* Vector3 */.Pq(1, 0, 0);
const xnAxis = new math_vector/* Vector3 */.Pq(-1, 0, 0);
const ypAxis = new math_vector/* Vector3 */.Pq(0, 1, 0);
const ynAxis = new math_vector/* Vector3 */.Pq(0, -1, 0);
const zpAxis = new math_vector/* Vector3 */.Pq(0, 0, 1);
const znAxis = new math_vector/* Vector3 */.Pq(0, 0, -1);
/** @internal */
class DecalVertex {
    constructor(position = math_vector/* Vector3 */.Pq.Zero(), normal = math_vector/* Vector3 */.Pq.Up(), uv = math_vector/* Vector2 */.I9.Zero(), vertexIdx = 0, vertexIdxForBones = 0, localPositionOverride = null, localNormalOverride = null, matrixIndicesOverride = null, matrixWeightsOverride = null) {
        this.position = position;
        this.normal = normal;
        this.uv = uv;
        this.vertexIdx = vertexIdx;
        this.vertexIdxForBones = vertexIdxForBones;
        this.localPositionOverride = localPositionOverride;
        this.localNormalOverride = localNormalOverride;
        this.matrixIndicesOverride = matrixIndicesOverride;
        this.matrixWeightsOverride = matrixWeightsOverride;
    }
    clone() {
        return new DecalVertex(this.position.clone(), this.normal.clone(), this.uv.clone(), this.vertexIdx, this.vertexIdxForBones, this.localPositionOverride?.slice(), this.localNormalOverride?.slice(), this.matrixIndicesOverride?.slice(), this.matrixWeightsOverride?.slice());
    }
}
/**
 * Creates a decal mesh.
 * A decal is a mesh usually applied as a model onto the surface of another mesh. So don't forget the parameter `sourceMesh` depicting the decal
 * * The parameter `position` (Vector3, default `(0, 0, 0)`) sets the position of the decal in World coordinates
 * * The parameter `normal` (Vector3, default `Vector3.Up`) sets the normal of the mesh where the decal is applied onto in World coordinates
 * * The parameter `size` (Vector3, default `(1, 1, 1)`) sets the decal scaling
 * * The parameter `angle` (float in radian, default 0) sets the angle to rotate the decal
 * * The parameter `captureUVS` defines if we need to capture the uvs or compute them
 * * The parameter `cullBackFaces` defines if the back faces should be removed from the decal mesh
 * * The parameter `localMode` defines that the computations should be done with the local mesh coordinates instead of the world space coordinates.
 * *    Use this mode if you want the decal to be parented to the sourceMesh and move/rotate with it.
 * Note: Meshes with morph targets are not supported!
 * @param name defines the name of the mesh
 * @param sourceMesh defines the mesh where the decal must be applied
 * @param options defines the options used to create the mesh
 * @returns the decal mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/decals
 */
function CreateDecal(name, sourceMesh, options) {
    const hasSkeleton = !!sourceMesh.skeleton;
    const useLocalComputation = options.localMode || hasSkeleton;
    const indices = sourceMesh.getIndices();
    const positions = hasSkeleton ? sourceMesh.getPositionData(true, true) : sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
    const normals = hasSkeleton ? sourceMesh.getNormalsData(true, true) : sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
    const localPositions = useLocalComputation ? (hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind) : positions) : null;
    const localNormals = useLocalComputation ? (hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind) : normals) : null;
    const uvs = sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind);
    const matIndices = hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind) : null;
    const matWeights = hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind) : null;
    const matIndicesExtra = hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind) : null;
    const matWeightsExtra = hasSkeleton ? sourceMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind) : null;
    const position = options.position || math_vector/* Vector3 */.Pq.Zero();
    let normal = options.normal || math_vector/* Vector3 */.Pq.Up();
    const size = options.size || math_vector/* Vector3 */.Pq.One();
    const angle = options.angle || 0;
    // Getting correct rotation
    if (!normal) {
        const target = new math_vector/* Vector3 */.Pq(0, 0, 1);
        const camera = sourceMesh.getScene().activeCamera;
        const cameraWorldTarget = math_vector/* Vector3 */.Pq.TransformCoordinates(target, camera.getWorldMatrix());
        normal = camera.globalPosition.subtract(cameraWorldTarget);
    }
    const yaw = -Math.atan2(normal.z, normal.x) - Math.PI / 2;
    const len = Math.sqrt(normal.x * normal.x + normal.z * normal.z);
    const pitch = Math.atan2(normal.y, len);
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.indices = [];
    vertexData.positions = [];
    vertexData.normals = [];
    vertexData.uvs = [];
    vertexData.matricesIndices = hasSkeleton ? [] : null;
    vertexData.matricesWeights = hasSkeleton ? [] : null;
    vertexData.matricesIndicesExtra = matIndicesExtra ? [] : null;
    vertexData.matricesWeightsExtra = matWeightsExtra ? [] : null;
    let currentVertexDataIndex = 0;
    const extractDecalVector3 = (indexId, transformMatrix) => {
        const result = new DecalVertex();
        if (!indices || !positions || !normals) {
            return result;
        }
        const vertexId = indices[indexId];
        result.vertexIdx = vertexId * 3;
        result.vertexIdxForBones = vertexId * 4;
        // Send vector to decal local world
        result.position = new math_vector/* Vector3 */.Pq(positions[vertexId * 3], positions[vertexId * 3 + 1], positions[vertexId * 3 + 2]);
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(result.position, transformMatrix, result.position);
        // Get normal
        result.normal = new math_vector/* Vector3 */.Pq(normals[vertexId * 3], normals[vertexId * 3 + 1], normals[vertexId * 3 + 2]);
        math_vector/* Vector3 */.Pq.TransformNormalToRef(result.normal, transformMatrix, result.normal);
        if (options.captureUVS && uvs) {
            const v = uvs[vertexId * 2 + 1];
            result.uv = new math_vector/* Vector2 */.I9(uvs[vertexId * 2], compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
        }
        return result;
    };
    const emptyArray = [0, 0, 0, 0];
    // Inspired by https://github.com/mrdoob/three.js/blob/eee231960882f6f3b6113405f524956145148146/examples/js/geometries/DecalGeometry.js
    const clip = (vertices, axis) => {
        if (vertices.length === 0) {
            return vertices;
        }
        const clipSize = 0.5 * Math.abs(math_vector/* Vector3 */.Pq.Dot(size, axis));
        const indexOf = (arr, val, start, num) => {
            for (let i = 0; i < num; ++i) {
                if (arr[start + i] === val) {
                    return start + i;
                }
            }
            return -1;
        };
        const clipVertices = (v0, v1) => {
            const clipFactor = math_vector/* Vector3 */.Pq.GetClipFactor(v0.position, v1.position, axis, clipSize);
            let indices = emptyArray;
            let weights = emptyArray;
            if (matIndices && matWeights) {
                const mat0Index = v0.matrixIndicesOverride ? 0 : v0.vertexIdxForBones;
                const v0Indices = v0.matrixIndicesOverride ?? matIndices;
                const v0Weights = v0.matrixWeightsOverride ?? matWeights;
                const mat1Index = v1.matrixIndicesOverride ? 0 : v1.vertexIdxForBones;
                const v1Indices = v1.matrixIndicesOverride ?? matIndices;
                const v1Weights = v1.matrixWeightsOverride ?? matWeights;
                indices = [0, 0, 0, 0];
                weights = [0, 0, 0, 0];
                let index = 0;
                for (let i = 0; i < 4; ++i) {
                    if (v0Weights[mat0Index + i] > 0) {
                        const idx = indexOf(v1Indices, v0Indices[mat0Index + i], mat1Index, 4);
                        indices[index] = v0Indices[mat0Index + i];
                        weights[index] = (0,math_scalar_functions.Lerp)(v0Weights[mat0Index + i], idx >= 0 ? v1Weights[idx] : 0, clipFactor);
                        index++;
                    }
                }
                for (let i = 0; i < 4 && index < 4; ++i) {
                    const ind = v1Indices[mat1Index + i];
                    if (indexOf(v0Indices, ind, mat0Index, 4) !== -1)
                        continue;
                    indices[index] = ind;
                    weights[index] = (0,math_scalar_functions.Lerp)(0, v1Weights[mat1Index + i], clipFactor);
                    index++;
                }
                const sumw = weights[0] + weights[1] + weights[2] + weights[3];
                weights[0] /= sumw;
                weights[1] /= sumw;
                weights[2] /= sumw;
                weights[3] /= sumw;
            }
            const v0LocalPositionX = v0.localPositionOverride ? v0.localPositionOverride[0] : (localPositions?.[v0.vertexIdx] ?? 0);
            const v0LocalPositionY = v0.localPositionOverride ? v0.localPositionOverride[1] : (localPositions?.[v0.vertexIdx + 1] ?? 0);
            const v0LocalPositionZ = v0.localPositionOverride ? v0.localPositionOverride[2] : (localPositions?.[v0.vertexIdx + 2] ?? 0);
            const v1LocalPositionX = v1.localPositionOverride ? v1.localPositionOverride[0] : (localPositions?.[v1.vertexIdx] ?? 0);
            const v1LocalPositionY = v1.localPositionOverride ? v1.localPositionOverride[1] : (localPositions?.[v1.vertexIdx + 1] ?? 0);
            const v1LocalPositionZ = v1.localPositionOverride ? v1.localPositionOverride[2] : (localPositions?.[v1.vertexIdx + 2] ?? 0);
            const v0LocalNormalX = v0.localNormalOverride ? v0.localNormalOverride[0] : (localNormals?.[v0.vertexIdx] ?? 0);
            const v0LocalNormalY = v0.localNormalOverride ? v0.localNormalOverride[1] : (localNormals?.[v0.vertexIdx + 1] ?? 0);
            const v0LocalNormalZ = v0.localNormalOverride ? v0.localNormalOverride[2] : (localNormals?.[v0.vertexIdx + 2] ?? 0);
            const v1LocalNormalX = v1.localNormalOverride ? v1.localNormalOverride[0] : (localNormals?.[v1.vertexIdx] ?? 0);
            const v1LocalNormalY = v1.localNormalOverride ? v1.localNormalOverride[1] : (localNormals?.[v1.vertexIdx + 1] ?? 0);
            const v1LocalNormalZ = v1.localNormalOverride ? v1.localNormalOverride[2] : (localNormals?.[v1.vertexIdx + 2] ?? 0);
            const interpNormalX = v0LocalNormalX + (v1LocalNormalX - v0LocalNormalX) * clipFactor;
            const interpNormalY = v0LocalNormalY + (v1LocalNormalY - v0LocalNormalY) * clipFactor;
            const interpNormalZ = v0LocalNormalZ + (v1LocalNormalZ - v0LocalNormalZ) * clipFactor;
            const norm = Math.sqrt(interpNormalX * interpNormalX + interpNormalY * interpNormalY + interpNormalZ * interpNormalZ);
            return new DecalVertex(math_vector/* Vector3 */.Pq.Lerp(v0.position, v1.position, clipFactor), math_vector/* Vector3 */.Pq.Lerp(v0.normal, v1.normal, clipFactor).normalize(), math_vector/* Vector2 */.I9.Lerp(v0.uv, v1.uv, clipFactor), -1, -1, localPositions
                ? [
                    v0LocalPositionX + (v1LocalPositionX - v0LocalPositionX) * clipFactor,
                    v0LocalPositionY + (v1LocalPositionY - v0LocalPositionY) * clipFactor,
                    v0LocalPositionZ + (v1LocalPositionZ - v0LocalPositionZ) * clipFactor,
                ]
                : null, localNormals ? [interpNormalX / norm, interpNormalY / norm, interpNormalZ / norm] : null, indices, weights);
        };
        let clipResult = null;
        if (vertices.length > 3) {
            clipResult = [];
        }
        for (let index = 0; index < vertices.length; index += 3) {
            let total = 0;
            let nV1 = null;
            let nV2 = null;
            let nV3 = null;
            let nV4 = null;
            const d1 = math_vector/* Vector3 */.Pq.Dot(vertices[index].position, axis) - clipSize;
            const d2 = math_vector/* Vector3 */.Pq.Dot(vertices[index + 1].position, axis) - clipSize;
            const d3 = math_vector/* Vector3 */.Pq.Dot(vertices[index + 2].position, axis) - clipSize;
            const v1Out = d1 > 0;
            const v2Out = d2 > 0;
            const v3Out = d3 > 0;
            total = (v1Out ? 1 : 0) + (v2Out ? 1 : 0) + (v3Out ? 1 : 0);
            switch (total) {
                case 0:
                    if (vertices.length > 3) {
                        clipResult.push(vertices[index]);
                        clipResult.push(vertices[index + 1]);
                        clipResult.push(vertices[index + 2]);
                    }
                    else {
                        clipResult = vertices;
                    }
                    break;
                case 1:
                    clipResult = clipResult ?? new Array();
                    if (v1Out) {
                        nV1 = vertices[index + 1];
                        nV2 = vertices[index + 2];
                        nV3 = clipVertices(vertices[index], nV1);
                        nV4 = clipVertices(vertices[index], nV2);
                    }
                    if (v2Out) {
                        nV1 = vertices[index];
                        nV2 = vertices[index + 2];
                        nV3 = clipVertices(vertices[index + 1], nV1);
                        nV4 = clipVertices(vertices[index + 1], nV2);
                        clipResult.push(nV3);
                        clipResult.push(nV2.clone());
                        clipResult.push(nV1.clone());
                        clipResult.push(nV2.clone());
                        clipResult.push(nV3.clone());
                        clipResult.push(nV4);
                        break;
                    }
                    if (v3Out) {
                        nV1 = vertices[index];
                        nV2 = vertices[index + 1];
                        nV3 = clipVertices(vertices[index + 2], nV1);
                        nV4 = clipVertices(vertices[index + 2], nV2);
                    }
                    if (nV1 && nV2 && nV3 && nV4) {
                        clipResult.push(nV1.clone());
                        clipResult.push(nV2.clone());
                        clipResult.push(nV3);
                        clipResult.push(nV4);
                        clipResult.push(nV3.clone());
                        clipResult.push(nV2.clone());
                    }
                    break;
                case 2:
                    clipResult = clipResult ?? new Array();
                    if (!v1Out) {
                        nV1 = vertices[index].clone();
                        nV2 = clipVertices(nV1, vertices[index + 1]);
                        nV3 = clipVertices(nV1, vertices[index + 2]);
                        clipResult.push(nV1);
                        clipResult.push(nV2);
                        clipResult.push(nV3);
                    }
                    if (!v2Out) {
                        nV1 = vertices[index + 1].clone();
                        nV2 = clipVertices(nV1, vertices[index + 2]);
                        nV3 = clipVertices(nV1, vertices[index]);
                        clipResult.push(nV1);
                        clipResult.push(nV2);
                        clipResult.push(nV3);
                    }
                    if (!v3Out) {
                        nV1 = vertices[index + 2].clone();
                        nV2 = clipVertices(nV1, vertices[index]);
                        nV3 = clipVertices(nV1, vertices[index + 1]);
                        clipResult.push(nV1);
                        clipResult.push(nV2);
                        clipResult.push(nV3);
                    }
                    break;
                case 3:
                    break;
            }
        }
        return clipResult;
    };
    const sourceMeshAsMesh = sourceMesh instanceof Meshes_mesh/* Mesh */.e ? sourceMesh : null;
    const matrixData = sourceMeshAsMesh?._thinInstanceDataStorage.matrixData;
    const numMatrices = sourceMeshAsMesh?.thinInstanceCount || 1;
    const thinInstanceMatrix = math_vector/* TmpVectors */.AA.Matrix[0];
    thinInstanceMatrix.copyFrom(math_vector/* Matrix */.uq.IdentityReadOnly);
    for (let m = 0; m < numMatrices; ++m) {
        if (sourceMeshAsMesh?.hasThinInstances && matrixData) {
            const ofst = m * 16;
            thinInstanceMatrix.setRowFromFloats(0, matrixData[ofst + 0], matrixData[ofst + 1], matrixData[ofst + 2], matrixData[ofst + 3]);
            thinInstanceMatrix.setRowFromFloats(1, matrixData[ofst + 4], matrixData[ofst + 5], matrixData[ofst + 6], matrixData[ofst + 7]);
            thinInstanceMatrix.setRowFromFloats(2, matrixData[ofst + 8], matrixData[ofst + 9], matrixData[ofst + 10], matrixData[ofst + 11]);
            thinInstanceMatrix.setRowFromFloats(3, matrixData[ofst + 12], matrixData[ofst + 13], matrixData[ofst + 14], matrixData[ofst + 15]);
        }
        // Matrix
        const decalWorldMatrix = math_vector/* Matrix */.uq.RotationYawPitchRoll(yaw, pitch, angle).multiply(math_vector/* Matrix */.uq.Translation(position.x, position.y, position.z));
        const inverseDecalWorldMatrix = math_vector/* Matrix */.uq.Invert(decalWorldMatrix);
        const meshWorldMatrix = sourceMesh.getWorldMatrix();
        const transformMatrix = thinInstanceMatrix.multiply(meshWorldMatrix).multiply(inverseDecalWorldMatrix);
        const oneFaceVertices = new Array(3);
        for (let index = 0; index < indices.length; index += 3) {
            let faceVertices = oneFaceVertices;
            faceVertices[0] = extractDecalVector3(index, transformMatrix);
            faceVertices[1] = extractDecalVector3(index + 1, transformMatrix);
            faceVertices[2] = extractDecalVector3(index + 2, transformMatrix);
            if (options.cullBackFaces) {
                // If all the normals of the vertices of the face are pointing away from the view direction we discard the face.
                // As computations are done in the decal coordinate space, the viewDirection is (0,0,1), so when dot(vertexNormal, -viewDirection) <= 0 the vertex is culled
                if (-faceVertices[0].normal.z <= 0 && -faceVertices[1].normal.z <= 0 && -faceVertices[2].normal.z <= 0) {
                    continue;
                }
            }
            // Clip
            faceVertices = clip(faceVertices, xpAxis);
            if (!faceVertices)
                continue;
            faceVertices = clip(faceVertices, xnAxis);
            if (!faceVertices)
                continue;
            faceVertices = clip(faceVertices, ypAxis);
            if (!faceVertices)
                continue;
            faceVertices = clip(faceVertices, ynAxis);
            if (!faceVertices)
                continue;
            faceVertices = clip(faceVertices, zpAxis);
            if (!faceVertices)
                continue;
            faceVertices = clip(faceVertices, znAxis);
            if (!faceVertices)
                continue;
            // Add UVs and get back to world
            for (let vIndex = 0; vIndex < faceVertices.length; vIndex++) {
                const vertex = faceVertices[vIndex];
                //TODO check for Int32Array | Uint32Array | Uint16Array
                vertexData.indices.push(currentVertexDataIndex);
                if (useLocalComputation) {
                    if (vertex.localPositionOverride) {
                        vertexData.positions[currentVertexDataIndex * 3] = vertex.localPositionOverride[0];
                        vertexData.positions[currentVertexDataIndex * 3 + 1] = vertex.localPositionOverride[1];
                        vertexData.positions[currentVertexDataIndex * 3 + 2] = vertex.localPositionOverride[2];
                    }
                    else if (localPositions) {
                        vertexData.positions[currentVertexDataIndex * 3] = localPositions[vertex.vertexIdx];
                        vertexData.positions[currentVertexDataIndex * 3 + 1] = localPositions[vertex.vertexIdx + 1];
                        vertexData.positions[currentVertexDataIndex * 3 + 2] = localPositions[vertex.vertexIdx + 2];
                    }
                    if (vertex.localNormalOverride) {
                        vertexData.normals[currentVertexDataIndex * 3] = vertex.localNormalOverride[0];
                        vertexData.normals[currentVertexDataIndex * 3 + 1] = vertex.localNormalOverride[1];
                        vertexData.normals[currentVertexDataIndex * 3 + 2] = vertex.localNormalOverride[2];
                    }
                    else if (localNormals) {
                        vertexData.normals[currentVertexDataIndex * 3] = localNormals[vertex.vertexIdx];
                        vertexData.normals[currentVertexDataIndex * 3 + 1] = localNormals[vertex.vertexIdx + 1];
                        vertexData.normals[currentVertexDataIndex * 3 + 2] = localNormals[vertex.vertexIdx + 2];
                    }
                }
                else {
                    vertex.position.toArray(vertexData.positions, currentVertexDataIndex * 3);
                    vertex.normal.toArray(vertexData.normals, currentVertexDataIndex * 3);
                }
                if (vertexData.matricesIndices && vertexData.matricesWeights) {
                    if (vertex.matrixIndicesOverride) {
                        vertexData.matricesIndices[currentVertexDataIndex * 4] = vertex.matrixIndicesOverride[0];
                        vertexData.matricesIndices[currentVertexDataIndex * 4 + 1] = vertex.matrixIndicesOverride[1];
                        vertexData.matricesIndices[currentVertexDataIndex * 4 + 2] = vertex.matrixIndicesOverride[2];
                        vertexData.matricesIndices[currentVertexDataIndex * 4 + 3] = vertex.matrixIndicesOverride[3];
                    }
                    else {
                        if (matIndices) {
                            vertexData.matricesIndices[currentVertexDataIndex * 4] = matIndices[vertex.vertexIdxForBones];
                            vertexData.matricesIndices[currentVertexDataIndex * 4 + 1] = matIndices[vertex.vertexIdxForBones + 1];
                            vertexData.matricesIndices[currentVertexDataIndex * 4 + 2] = matIndices[vertex.vertexIdxForBones + 2];
                            vertexData.matricesIndices[currentVertexDataIndex * 4 + 3] = matIndices[vertex.vertexIdxForBones + 3];
                        }
                        if (matIndicesExtra && vertexData.matricesIndicesExtra) {
                            vertexData.matricesIndicesExtra[currentVertexDataIndex * 4] = matIndicesExtra[vertex.vertexIdxForBones];
                            vertexData.matricesIndicesExtra[currentVertexDataIndex * 4 + 1] = matIndicesExtra[vertex.vertexIdxForBones + 1];
                            vertexData.matricesIndicesExtra[currentVertexDataIndex * 4 + 2] = matIndicesExtra[vertex.vertexIdxForBones + 2];
                            vertexData.matricesIndicesExtra[currentVertexDataIndex * 4 + 3] = matIndicesExtra[vertex.vertexIdxForBones + 3];
                        }
                    }
                    if (vertex.matrixWeightsOverride) {
                        vertexData.matricesWeights[currentVertexDataIndex * 4] = vertex.matrixWeightsOverride[0];
                        vertexData.matricesWeights[currentVertexDataIndex * 4 + 1] = vertex.matrixWeightsOverride[1];
                        vertexData.matricesWeights[currentVertexDataIndex * 4 + 2] = vertex.matrixWeightsOverride[2];
                        vertexData.matricesWeights[currentVertexDataIndex * 4 + 3] = vertex.matrixWeightsOverride[3];
                    }
                    else {
                        if (matWeights) {
                            vertexData.matricesWeights[currentVertexDataIndex * 4] = matWeights[vertex.vertexIdxForBones];
                            vertexData.matricesWeights[currentVertexDataIndex * 4 + 1] = matWeights[vertex.vertexIdxForBones + 1];
                            vertexData.matricesWeights[currentVertexDataIndex * 4 + 2] = matWeights[vertex.vertexIdxForBones + 2];
                            vertexData.matricesWeights[currentVertexDataIndex * 4 + 3] = matWeights[vertex.vertexIdxForBones + 3];
                        }
                        if (matWeightsExtra && vertexData.matricesWeightsExtra) {
                            vertexData.matricesWeightsExtra[currentVertexDataIndex * 4] = matWeightsExtra[vertex.vertexIdxForBones];
                            vertexData.matricesWeightsExtra[currentVertexDataIndex * 4 + 1] = matWeightsExtra[vertex.vertexIdxForBones + 1];
                            vertexData.matricesWeightsExtra[currentVertexDataIndex * 4 + 2] = matWeightsExtra[vertex.vertexIdxForBones + 2];
                            vertexData.matricesWeightsExtra[currentVertexDataIndex * 4 + 3] = matWeightsExtra[vertex.vertexIdxForBones + 3];
                        }
                    }
                }
                if (!options.captureUVS) {
                    vertexData.uvs.push(0.5 + vertex.position.x / size.x);
                    const v = 0.5 + vertex.position.y / size.y;
                    vertexData.uvs.push(compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - v : v);
                }
                else {
                    vertex.uv.toArray(vertexData.uvs, currentVertexDataIndex * 2);
                }
                currentVertexDataIndex++;
            }
        }
    }
    // Avoid the "Setting vertex data kind 'XXX' with an empty array" warning when calling vertexData.applyToMesh
    if (vertexData.indices.length === 0)
        vertexData.indices = null;
    if (vertexData.positions.length === 0)
        vertexData.positions = null;
    if (vertexData.normals.length === 0)
        vertexData.normals = null;
    if (vertexData.uvs.length === 0)
        vertexData.uvs = null;
    if (vertexData.matricesIndices?.length === 0)
        vertexData.matricesIndices = null;
    if (vertexData.matricesWeights?.length === 0)
        vertexData.matricesWeights = null;
    if (vertexData.matricesIndicesExtra?.length === 0)
        vertexData.matricesIndicesExtra = null;
    if (vertexData.matricesWeightsExtra?.length === 0)
        vertexData.matricesWeightsExtra = null;
    // Return mesh
    const decal = new Meshes_mesh/* Mesh */.e(name, sourceMesh.getScene());
    vertexData.applyToMesh(decal);
    if (useLocalComputation) {
        decal.skeleton = sourceMesh.skeleton;
        decal.parent = sourceMesh;
    }
    else {
        decal.position = position.clone();
        decal.rotation = new math_vector/* Vector3 */.Pq(pitch, yaw, angle);
    }
    decal.computeWorldMatrix(true);
    decal.refreshBoundingInfo(true, true);
    return decal;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use the function directly from the module
 */
const DecalBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateDecal,
};
Meshes_mesh/* Mesh */.e.CreateDecal = (name, sourceMesh, position, normal, size, angle) => {
    const options = {
        position,
        normal,
        size,
        angle,
    };
    return CreateDecal(name, sourceMesh, options);
};
//# sourceMappingURL=decalBuilder.js.map
;// ./node_modules/@babylonjs/core/Maths/math.isovector.js


/**
 * Class representing an isovector a vector containing 2 INTEGER coordinates
 * x axis is horizontal
 * y axis is 60 deg counter clockwise from positive y axis
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _IsoVector {
    /**
     * Creates a new isovector from the given x and y coordinates
     * @param x defines the first coordinate, must be an integer
     * @param y defines the second coordinate, must be an integer
     */
    constructor(
    /** [0] defines the first coordinate */
    x = 0, 
    /** [0] defines the second coordinate */
    y = 0) {
        this.x = x;
        this.y = y;
        if (x !== Math.floor(x)) {
            x = Math.floor(x);
            logger/* Logger */.V.Warn("x is not an integer, floor(x) used");
        }
        if (y !== Math.floor(y)) {
            y = Math.floor(y);
            logger/* Logger */.V.Warn("y is not an integer, floor(y) used");
        }
    }
    // Operators
    /**
     * Gets a new IsoVector copied from the IsoVector
     * @returns a new IsoVector
     */
    clone() {
        return new _IsoVector(this.x, this.y);
    }
    /**
     * Rotates one IsoVector 60 degrees counter clockwise about another
     * Please note that this is an in place operation
     * @param other an IsoVector a center of rotation
     * @returns the rotated IsoVector
     */
    rotate60About(other) {
        //other IsoVector
        const x = this.x;
        this.x = other.x + other.y - this.y;
        this.y = x + this.y - other.x;
        return this;
    }
    /**
     * Rotates one IsoVector 60 degrees clockwise about another
     * Please note that this is an in place operation
     * @param other an IsoVector as center of rotation
     * @returns the rotated IsoVector
     */
    rotateNeg60About(other) {
        const x = this.x;
        this.x = x + this.y - other.y;
        this.y = other.x + other.y - x;
        return this;
    }
    /**
     * For an equilateral triangle OAB with O at isovector (0, 0) and A at isovector (m, n)
     * Rotates one IsoVector 120 degrees counter clockwise about the center of the triangle
     * Please note that this is an in place operation
     * @param m integer a measure a Primary triangle of order (m, n) m > n
     * @param n >= 0 integer a measure for a Primary triangle of order (m, n)
     * @returns the rotated IsoVector
     */
    rotate120(m, n) {
        //m, n integers
        if (m !== Math.floor(m)) {
            m = Math.floor(m);
            logger/* Logger */.V.Warn("m not an integer only floor(m) used");
        }
        if (n !== Math.floor(n)) {
            n = Math.floor(n);
            logger/* Logger */.V.Warn("n not an integer only floor(n) used");
        }
        const x = this.x;
        this.x = m - x - this.y;
        this.y = n + x;
        return this;
    }
    /**
     * For an equilateral triangle OAB with O at isovector (0, 0) and A at isovector (m, n)
     * Rotates one IsoVector 120 degrees clockwise about the center of the triangle
     * Please note that this is an in place operation
     * @param m integer a measure a Primary triangle of order (m, n) m > n
     * @param n >= 0 integer a measure for a Primary triangle of order (m, n)
     * @returns the rotated IsoVector
     */
    rotateNeg120(m, n) {
        //m, n integers
        if (m !== Math.floor(m)) {
            m = Math.floor(m);
            logger/* Logger */.V.Warn("m is not an integer, floor(m) used");
        }
        if (n !== Math.floor(n)) {
            n = Math.floor(n);
            logger/* Logger */.V.Warn("n is not an integer,   floor(n) used");
        }
        const x = this.x;
        this.x = this.y - n;
        this.y = m + n - x - this.y;
        return this;
    }
    /**
     * Transforms an IsoVector to one in Cartesian 3D space based on an isovector
     * @param origin an IsoVector
     * @param isoGridSize
     * @returns Point as a Vector3
     */
    toCartesianOrigin(origin, isoGridSize) {
        const point = math_vector/* Vector3 */.Pq.Zero();
        point.x = origin.x + 2 * this.x * isoGridSize + this.y * isoGridSize;
        point.y = origin.y + Math.sqrt(3) * this.y * isoGridSize;
        return point;
    }
    // Statics
    /**
     * Gets a new IsoVector(0, 0)
     * @returns a new IsoVector
     */
    static Zero() {
        return new _IsoVector(0, 0);
    }
}
//# sourceMappingURL=math.isovector.js.map
;// ./node_modules/@babylonjs/core/Meshes/geodesicMesh.js




/**
 * Class representing data for one face OAB of an equilateral icosahedron
 * When O is the isovector (0, 0), A is isovector (m, n)
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _PrimaryIsoTriangle {
    constructor() {
        this.cartesian = [];
        this.vertices = [];
        this.max = [];
        this.min = [];
        this.closestTo = [];
        this.innerFacets = [];
        this.isoVecsABOB = [];
        this.isoVecsOBOA = [];
        this.isoVecsBAOA = [];
        this.vertexTypes = [];
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.IDATA = new PolyhedronData("icosahedron", "Regular", [
            [0, math_constants/* PHI */.a6, -1],
            [-math_constants/* PHI */.a6, 1, 0],
            [-1, 0, -math_constants/* PHI */.a6],
            [1, 0, -math_constants/* PHI */.a6],
            [math_constants/* PHI */.a6, 1, 0],
            [0, math_constants/* PHI */.a6, 1],
            [-1, 0, math_constants/* PHI */.a6],
            [-math_constants/* PHI */.a6, -1, 0],
            [0, -math_constants/* PHI */.a6, -1],
            [math_constants/* PHI */.a6, -1, 0],
            [1, 0, math_constants/* PHI */.a6],
            [0, -math_constants/* PHI */.a6, 1],
        ], [
            [0, 2, 1],
            [0, 3, 2],
            [0, 4, 3],
            [0, 5, 4],
            [0, 1, 5],
            [7, 6, 1],
            [8, 7, 2],
            [9, 8, 3],
            [10, 9, 4],
            [6, 10, 5],
            [2, 7, 1],
            [3, 8, 2],
            [4, 9, 3],
            [5, 10, 4],
            [1, 6, 5],
            [11, 6, 7],
            [11, 7, 8],
            [11, 8, 9],
            [11, 9, 10],
            [11, 10, 6],
        ]);
    }
    /**
     * Creates the PrimaryIsoTriangle Triangle OAB
     * @param m an integer
     * @param n an integer
     */
    //operators
    setIndices() {
        let indexCount = 12; // 12 vertices already assigned
        const vecToidx = {}; //maps iso-vectors to indexCount;
        const m = this.m;
        const n = this.n;
        let g = m; // hcf of m, n when n != 0
        let m1 = 1;
        let n1 = 0;
        if (n !== 0) {
            g = (0,math_scalar_functions.HighestCommonFactor)(m, n);
        }
        m1 = m / g;
        n1 = n / g;
        let fr; //face to the right of current face
        let rot; //rotation about which vertex for fr
        let O;
        let A;
        let B;
        const oVec = _IsoVector.Zero();
        const aVec = new _IsoVector(m, n);
        const bVec = new _IsoVector(-n, m + n);
        const oaVec = _IsoVector.Zero();
        const abVec = _IsoVector.Zero();
        const obVec = _IsoVector.Zero();
        let verts = [];
        let idx;
        let idxR;
        let isoId;
        let isoIdR;
        const closestTo = [];
        const vDist = this.vertByDist;
        const matchIdx = (f, fr, isoId, isoIdR) => {
            idx = f + "|" + isoId;
            idxR = fr + "|" + isoIdR;
            if (!(idx in vecToidx || idxR in vecToidx)) {
                vecToidx[idx] = indexCount;
                vecToidx[idxR] = indexCount;
                indexCount++;
            }
            else if (idx in vecToidx && !(idxR in vecToidx)) {
                vecToidx[idxR] = vecToidx[idx];
            }
            else if (idxR in vecToidx && !(idx in vecToidx)) {
                vecToidx[idx] = vecToidx[idxR];
            }
            if (vDist[isoId][0] > 2) {
                closestTo[vecToidx[idx]] = [-vDist[isoId][0], vDist[isoId][1], vecToidx[idx]];
            }
            else {
                closestTo[vecToidx[idx]] = [verts[vDist[isoId][0]], vDist[isoId][1], vecToidx[idx]];
            }
        };
        this.IDATA.edgematch = [
            [1, "B"],
            [2, "B"],
            [3, "B"],
            [4, "B"],
            [0, "B"],
            [10, "O", 14, "A"],
            [11, "O", 10, "A"],
            [12, "O", 11, "A"],
            [13, "O", 12, "A"],
            [14, "O", 13, "A"],
            [0, "O"],
            [1, "O"],
            [2, "O"],
            [3, "O"],
            [4, "O"],
            [19, "B", 5, "A"],
            [15, "B", 6, "A"],
            [16, "B", 7, "A"],
            [17, "B", 8, "A"],
            [18, "B", 9, "A"],
        ];
        /***edges AB to OB***** rotation about B*/
        for (let f = 0; f < 20; f++) {
            //f current face
            verts = this.IDATA.face[f];
            O = verts[2];
            A = verts[1];
            B = verts[0];
            isoId = oVec.x + "|" + oVec.y;
            idx = f + "|" + isoId;
            if (!(idx in vecToidx)) {
                vecToidx[idx] = O;
                closestTo[O] = [verts[vDist[isoId][0]], vDist[isoId][1]];
            }
            isoId = aVec.x + "|" + aVec.y;
            idx = f + "|" + isoId;
            if (!(idx in vecToidx)) {
                vecToidx[idx] = A;
                closestTo[A] = [verts[vDist[isoId][0]], vDist[isoId][1]];
            }
            isoId = bVec.x + "|" + bVec.y;
            idx = f + "|" + isoId;
            if (!(idx in vecToidx)) {
                vecToidx[idx] = B;
                closestTo[B] = [verts[vDist[isoId][0]], vDist[isoId][1]];
            }
            //for edge vertices
            fr = this.IDATA.edgematch[f][0];
            rot = this.IDATA.edgematch[f][1];
            if (rot === "B") {
                for (let i = 1; i < g; i++) {
                    abVec.x = m - i * (m1 + n1);
                    abVec.y = n + i * m1;
                    obVec.x = -i * n1;
                    obVec.y = i * (m1 + n1);
                    isoId = abVec.x + "|" + abVec.y;
                    isoIdR = obVec.x + "|" + obVec.y;
                    matchIdx(f, fr, isoId, isoIdR);
                }
            }
            if (rot === "O") {
                for (let i = 1; i < g; i++) {
                    obVec.x = -i * n1;
                    obVec.y = i * (m1 + n1);
                    oaVec.x = i * m1;
                    oaVec.y = i * n1;
                    isoId = obVec.x + "|" + obVec.y;
                    isoIdR = oaVec.x + "|" + oaVec.y;
                    matchIdx(f, fr, isoId, isoIdR);
                }
            }
            fr = this.IDATA.edgematch[f][2];
            rot = this.IDATA.edgematch[f][3];
            if (rot && rot === "A") {
                for (let i = 1; i < g; i++) {
                    oaVec.x = i * m1;
                    oaVec.y = i * n1;
                    abVec.x = m - (g - i) * (m1 + n1); //reversed for BA
                    abVec.y = n + (g - i) * m1; //reversed for BA
                    isoId = oaVec.x + "|" + oaVec.y;
                    isoIdR = abVec.x + "|" + abVec.y;
                    matchIdx(f, fr, isoId, isoIdR);
                }
            }
            for (let i = 0; i < this.vertices.length; i++) {
                isoId = this.vertices[i].x + "|" + this.vertices[i].y;
                idx = f + "|" + isoId;
                if (!(idx in vecToidx)) {
                    vecToidx[idx] = indexCount++;
                    if (vDist[isoId][0] > 2) {
                        closestTo[vecToidx[idx]] = [-vDist[isoId][0], vDist[isoId][1], vecToidx[idx]];
                    }
                    else {
                        closestTo[vecToidx[idx]] = [verts[vDist[isoId][0]], vDist[isoId][1], vecToidx[idx]];
                    }
                }
            }
        }
        this.closestTo = closestTo;
        this.vecToidx = vecToidx;
    }
    calcCoeffs() {
        const m = this.m;
        const n = this.n;
        const thirdR3 = Math.sqrt(3) / 3;
        const LSQD = m * m + n * n + m * n;
        this.coau = (m + n) / LSQD;
        this.cobu = -n / LSQD;
        this.coav = (-thirdR3 * (m - n)) / LSQD;
        this.cobv = (thirdR3 * (2 * m + n)) / LSQD;
    }
    createInnerFacets() {
        const m = this.m;
        const n = this.n;
        for (let y = 0; y < n + m + 1; y++) {
            for (let x = this.min[y]; x < this.max[y] + 1; x++) {
                if (x < this.max[y] && x < this.max[y + 1] + 1) {
                    this.innerFacets.push(["|" + x + "|" + y, "|" + x + "|" + (y + 1), "|" + (x + 1) + "|" + y]);
                }
                if (y > 0 && x < this.max[y - 1] && x + 1 < this.max[y] + 1) {
                    this.innerFacets.push(["|" + x + "|" + y, "|" + (x + 1) + "|" + y, "|" + (x + 1) + "|" + (y - 1)]);
                }
            }
        }
    }
    edgeVecsABOB() {
        const m = this.m;
        const n = this.n;
        const B = new _IsoVector(-n, m + n);
        for (let y = 1; y < m + n; y++) {
            const point = new _IsoVector(this.min[y], y);
            const prev = new _IsoVector(this.min[y - 1], y - 1);
            const next = new _IsoVector(this.min[y + 1], y + 1);
            const pointR = point.clone();
            const prevR = prev.clone();
            const nextR = next.clone();
            pointR.rotate60About(B);
            prevR.rotate60About(B);
            nextR.rotate60About(B);
            const maxPoint = new _IsoVector(this.max[pointR.y], pointR.y);
            const maxPrev = new _IsoVector(this.max[pointR.y - 1], pointR.y - 1);
            const maxLeftPrev = new _IsoVector(this.max[pointR.y - 1] - 1, pointR.y - 1);
            if (pointR.x !== maxPoint.x || pointR.y !== maxPoint.y) {
                if (pointR.x !== maxPrev.x) {
                    // type2
                    //up
                    this.vertexTypes.push([1, 0, 0]);
                    this.isoVecsABOB.push([point, maxPrev, maxLeftPrev]);
                    //down
                    this.vertexTypes.push([1, 0, 0]);
                    this.isoVecsABOB.push([point, maxLeftPrev, maxPoint]);
                }
                else if (pointR.y === nextR.y) {
                    // type1
                    //up
                    this.vertexTypes.push([1, 1, 0]);
                    this.isoVecsABOB.push([point, prev, maxPrev]);
                    //down
                    this.vertexTypes.push([1, 0, 1]);
                    this.isoVecsABOB.push([point, maxPrev, next]);
                }
                else {
                    // type 0
                    //up
                    this.vertexTypes.push([1, 1, 0]);
                    this.isoVecsABOB.push([point, prev, maxPrev]);
                    //down
                    this.vertexTypes.push([1, 0, 0]);
                    this.isoVecsABOB.push([point, maxPrev, maxPoint]);
                }
            }
        }
    }
    mapABOBtoOBOA() {
        const point = new _IsoVector(0, 0);
        for (let i = 0; i < this.isoVecsABOB.length; i++) {
            const temp = [];
            for (let j = 0; j < 3; j++) {
                point.x = this.isoVecsABOB[i][j].x;
                point.y = this.isoVecsABOB[i][j].y;
                if (this.vertexTypes[i][j] === 0) {
                    point.rotateNeg120(this.m, this.n);
                }
                temp.push(point.clone());
            }
            this.isoVecsOBOA.push(temp);
        }
    }
    mapABOBtoBAOA() {
        const point = new _IsoVector(0, 0);
        for (let i = 0; i < this.isoVecsABOB.length; i++) {
            const temp = [];
            for (let j = 0; j < 3; j++) {
                point.x = this.isoVecsABOB[i][j].x;
                point.y = this.isoVecsABOB[i][j].y;
                if (this.vertexTypes[i][j] === 1) {
                    point.rotate120(this.m, this.n);
                }
                temp.push(point.clone());
            }
            this.isoVecsBAOA.push(temp);
        }
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    MapToFace(faceNb, geodesicData) {
        const F = this.IDATA.face[faceNb];
        const oidx = F[2];
        const aidx = F[1];
        const bidx = F[0];
        const O = math_vector/* Vector3 */.Pq.FromArray(this.IDATA.vertex[oidx]);
        const A = math_vector/* Vector3 */.Pq.FromArray(this.IDATA.vertex[aidx]);
        const B = math_vector/* Vector3 */.Pq.FromArray(this.IDATA.vertex[bidx]);
        const OA = A.subtract(O);
        const OB = B.subtract(O);
        const x = OA.scale(this.coau).add(OB.scale(this.cobu));
        const y = OA.scale(this.coav).add(OB.scale(this.cobv));
        const mapped = [];
        let idx;
        let tempVec = math_vector/* TmpVectors */.AA.Vector3[0];
        for (let i = 0; i < this.cartesian.length; i++) {
            tempVec = x.scale(this.cartesian[i].x).add(y.scale(this.cartesian[i].y)).add(O);
            mapped[i] = [tempVec.x, tempVec.y, tempVec.z];
            idx = faceNb + "|" + this.vertices[i].x + "|" + this.vertices[i].y;
            geodesicData.vertex[this.vecToidx[idx]] = [tempVec.x, tempVec.y, tempVec.z];
        }
    }
    //statics
    /**Creates a primary triangle
     * @internal
     */
    build(m, n) {
        const vertices = [];
        const O = _IsoVector.Zero();
        const A = new _IsoVector(m, n);
        const B = new _IsoVector(-n, m + n);
        vertices.push(O, A, B);
        //max internal isoceles triangle vertices
        for (let y = n; y < m + 1; y++) {
            for (let x = 0; x < m + 1 - y; x++) {
                vertices.push(new _IsoVector(x, y));
            }
        }
        //shared vertices along edges when needed
        if (n > 0) {
            const g = (0,math_scalar_functions.HighestCommonFactor)(m, n);
            const m1 = m / g;
            const n1 = n / g;
            for (let i = 1; i < g; i++) {
                vertices.push(new _IsoVector(i * m1, i * n1)); //OA
                vertices.push(new _IsoVector(-i * n1, i * (m1 + n1))); //OB
                vertices.push(new _IsoVector(m - i * (m1 + n1), n + i * m1)); // AB
            }
            //lower rows vertices and their rotations
            const ratio = m / n;
            for (let y = 1; y < n; y++) {
                for (let x = 0; x < y * ratio; x++) {
                    vertices.push(new _IsoVector(x, y));
                    vertices.push(new _IsoVector(x, y).rotate120(m, n));
                    vertices.push(new _IsoVector(x, y).rotateNeg120(m, n));
                }
            }
        }
        //order vertices by x and then y
        vertices.sort((a, b) => {
            return a.x - b.x;
        });
        vertices.sort((a, b) => {
            return a.y - b.y;
        });
        const min = new Array(m + n + 1);
        const max = new Array(m + n + 1);
        for (let i = 0; i < min.length; i++) {
            min[i] = Infinity;
            max[i] = -Infinity;
        }
        let y = 0;
        let x = 0;
        const len = vertices.length;
        for (let i = 0; i < len; i++) {
            x = vertices[i].x;
            y = vertices[i].y;
            min[y] = Math.min(x, min[y]);
            max[y] = Math.max(x, max[y]);
        }
        //calculates the distance of a vertex from a given primary vertex
        const distFrom = (vert, primVert) => {
            const v = vert.clone();
            if (primVert === "A") {
                v.rotateNeg120(m, n);
            }
            if (primVert === "B") {
                v.rotate120(m, n);
            }
            if (v.x < 0) {
                return v.y;
            }
            return v.x + v.y;
        };
        const cartesian = [];
        const distFromO = [];
        const distFromA = [];
        const distFromB = [];
        const vertByDist = {};
        const vertData = [];
        let closest = -1;
        let dist = -1;
        for (let i = 0; i < len; i++) {
            cartesian[i] = vertices[i].toCartesianOrigin(new _IsoVector(0, 0), 0.5);
            distFromO[i] = distFrom(vertices[i], "O");
            distFromA[i] = distFrom(vertices[i], "A");
            distFromB[i] = distFrom(vertices[i], "B");
            if (distFromO[i] === distFromA[i] && distFromA[i] === distFromB[i]) {
                closest = 3;
                dist = distFromO[i];
            }
            else if (distFromO[i] === distFromA[i]) {
                closest = 4;
                dist = distFromO[i];
            }
            else if (distFromA[i] === distFromB[i]) {
                closest = 5;
                dist = distFromA[i];
            }
            else if (distFromB[i] === distFromO[i]) {
                closest = 6;
                dist = distFromO[i];
            }
            if (distFromO[i] < distFromA[i] && distFromO[i] < distFromB[i]) {
                closest = 2;
                dist = distFromO[i];
            }
            if (distFromA[i] < distFromO[i] && distFromA[i] < distFromB[i]) {
                closest = 1;
                dist = distFromA[i];
            }
            if (distFromB[i] < distFromA[i] && distFromB[i] < distFromO[i]) {
                closest = 0;
                dist = distFromB[i];
            }
            vertData.push([closest, dist, vertices[i].x, vertices[i].y]);
        }
        vertData.sort((a, b) => {
            return a[2] - b[2];
        });
        vertData.sort((a, b) => {
            return a[3] - b[3];
        });
        vertData.sort((a, b) => {
            return a[1] - b[1];
        });
        vertData.sort((a, b) => {
            return a[0] - b[0];
        });
        for (let v = 0; v < vertData.length; v++) {
            vertByDist[vertData[v][2] + "|" + vertData[v][3]] = [vertData[v][0], vertData[v][1], v];
        }
        this.m = m;
        this.n = n;
        this.vertices = vertices;
        this.vertByDist = vertByDist;
        this.cartesian = cartesian;
        this.min = min;
        this.max = max;
        return this;
    }
}
/** Builds Polyhedron Data
 * @internal
 */
class PolyhedronData {
    constructor(
    /**
     * The name of the polyhedron
     */
    name, 
    /**
     * The category of the polyhedron
     */
    category, 
    /**
     * vertex data
     */
    vertex, 
    /**
     * face data
     */
    face) {
        this.name = name;
        this.category = category;
        this.vertex = vertex;
        this.face = face;
    }
}
/**
 * This class Extends the PolyhedronData Class to provide measures for a Geodesic Polyhedron
 */
class GeodesicData extends PolyhedronData {
    /**
     * @internal
     */
    innerToData(face, primTri) {
        for (let i = 0; i < primTri.innerFacets.length; i++) {
            this.face.push(primTri.innerFacets[i].map((el) => primTri.vecToidx[face + el]));
        }
    }
    /**
     * @internal
     */
    mapABOBtoDATA(faceNb, primTri) {
        const fr = primTri.IDATA.edgematch[faceNb][0];
        for (let i = 0; i < primTri.isoVecsABOB.length; i++) {
            const temp = [];
            for (let j = 0; j < 3; j++) {
                if (primTri.vertexTypes[i][j] === 0) {
                    temp.push(faceNb + "|" + primTri.isoVecsABOB[i][j].x + "|" + primTri.isoVecsABOB[i][j].y);
                }
                else {
                    temp.push(fr + "|" + primTri.isoVecsABOB[i][j].x + "|" + primTri.isoVecsABOB[i][j].y);
                }
            }
            this.face.push([primTri.vecToidx[temp[0]], primTri.vecToidx[temp[1]], primTri.vecToidx[temp[2]]]);
        }
    }
    /**
     * @internal
     */
    mapOBOAtoDATA(faceNb, primTri) {
        const fr = primTri.IDATA.edgematch[faceNb][0];
        for (let i = 0; i < primTri.isoVecsOBOA.length; i++) {
            const temp = [];
            for (let j = 0; j < 3; j++) {
                if (primTri.vertexTypes[i][j] === 1) {
                    temp.push(faceNb + "|" + primTri.isoVecsOBOA[i][j].x + "|" + primTri.isoVecsOBOA[i][j].y);
                }
                else {
                    temp.push(fr + "|" + primTri.isoVecsOBOA[i][j].x + "|" + primTri.isoVecsOBOA[i][j].y);
                }
            }
            this.face.push([primTri.vecToidx[temp[0]], primTri.vecToidx[temp[1]], primTri.vecToidx[temp[2]]]);
        }
    }
    /**
     * @internal
     */
    mapBAOAtoDATA(faceNb, primTri) {
        const fr = primTri.IDATA.edgematch[faceNb][2];
        for (let i = 0; i < primTri.isoVecsBAOA.length; i++) {
            const temp = [];
            for (let j = 0; j < 3; j++) {
                if (primTri.vertexTypes[i][j] === 1) {
                    temp.push(faceNb + "|" + primTri.isoVecsBAOA[i][j].x + "|" + primTri.isoVecsBAOA[i][j].y);
                }
                else {
                    temp.push(fr + "|" + primTri.isoVecsBAOA[i][j].x + "|" + primTri.isoVecsBAOA[i][j].y);
                }
            }
            this.face.push([primTri.vecToidx[temp[0]], primTri.vecToidx[temp[1]], primTri.vecToidx[temp[2]]]);
        }
    }
    /**
     * @internal
     */
    orderData(primTri) {
        const nearTo = [];
        for (let i = 0; i < 13; i++) {
            nearTo[i] = [];
        }
        const close = primTri.closestTo;
        for (let i = 0; i < close.length; i++) {
            if (close[i][0] > -1) {
                if (close[i][1] > 0) {
                    nearTo[close[i][0]].push([i, close[i][1]]);
                }
            }
            else {
                nearTo[12].push([i, close[i][0]]);
            }
        }
        const near = [];
        for (let i = 0; i < 12; i++) {
            near[i] = i;
        }
        let nearIndex = 12;
        for (let i = 0; i < 12; i++) {
            nearTo[i].sort((a, b) => {
                return a[1] - b[1];
            });
            for (let j = 0; j < nearTo[i].length; j++) {
                near[nearTo[i][j][0]] = nearIndex++;
            }
        }
        for (let j = 0; j < nearTo[12].length; j++) {
            near[nearTo[12][j][0]] = nearIndex++;
        }
        for (let i = 0; i < this.vertex.length; i++) {
            this.vertex[i].push(near[i]);
        }
        this.vertex.sort((a, b) => {
            return a[3] - b[3];
        });
        for (let i = 0; i < this.vertex.length; i++) {
            this.vertex[i].pop();
        }
        for (let i = 0; i < this.face.length; i++) {
            for (let j = 0; j < this.face[i].length; j++) {
                this.face[i][j] = near[this.face[i][j]];
            }
        }
        this.sharedNodes = nearTo[12].length;
        this.poleNodes = this.vertex.length - this.sharedNodes;
    }
    /**
     * @internal
     */
    setOrder(m, faces) {
        const adjVerts = [];
        const dualFaces = [];
        let face = faces.pop();
        dualFaces.push(face);
        let index = this.face[face].indexOf(m);
        index = (index + 2) % 3;
        let v = this.face[face][index];
        adjVerts.push(v);
        let f = 0;
        while (faces.length > 0) {
            face = faces[f];
            if (this.face[face].indexOf(v) > -1) {
                // v is a vertex of face f
                index = (this.face[face].indexOf(v) + 1) % 3;
                v = this.face[face][index];
                adjVerts.push(v);
                dualFaces.push(face);
                faces.splice(f, 1);
                f = 0;
            }
            else {
                f++;
            }
        }
        this.adjacentFaces.push(adjVerts);
        return dualFaces;
    }
    /**
     * @internal
     */
    toGoldbergPolyhedronData() {
        const goldbergPolyhedronData = new PolyhedronData("GeoDual", "Goldberg", [], []);
        goldbergPolyhedronData.name = "GD dual";
        const verticesNb = this.vertex.length;
        const map = new Array(verticesNb);
        for (let v = 0; v < verticesNb; v++) {
            map[v] = [];
        }
        for (let f = 0; f < this.face.length; f++) {
            for (let i = 0; i < 3; i++) {
                map[this.face[f][i]].push(f);
            }
        }
        let cx = 0;
        let cy = 0;
        let cz = 0;
        let face = [];
        let vertex = [];
        this.adjacentFaces = [];
        for (let m = 0; m < map.length; m++) {
            goldbergPolyhedronData.face[m] = this.setOrder(m, map[m].concat([]));
            map[m].forEach((el) => {
                cx = 0;
                cy = 0;
                cz = 0;
                face = this.face[el];
                for (let i = 0; i < 3; i++) {
                    vertex = this.vertex[face[i]];
                    cx += vertex[0];
                    cy += vertex[1];
                    cz += vertex[2];
                }
                goldbergPolyhedronData.vertex[el] = [cx / 3, cy / 3, cz / 3];
            });
        }
        return goldbergPolyhedronData;
    }
    //statics
    /**Builds the data for a Geodesic Polyhedron from a primary triangle
     * @param primTri the primary triangle
     * @internal
     */
    static BuildGeodesicData(primTri) {
        const geodesicData = new GeodesicData("Geodesic-m-n", "Geodesic", [
            [0, math_constants/* PHI */.a6, -1],
            [-math_constants/* PHI */.a6, 1, 0],
            [-1, 0, -math_constants/* PHI */.a6],
            [1, 0, -math_constants/* PHI */.a6],
            [math_constants/* PHI */.a6, 1, 0],
            [0, math_constants/* PHI */.a6, 1],
            [-1, 0, math_constants/* PHI */.a6],
            [-math_constants/* PHI */.a6, -1, 0],
            [0, -math_constants/* PHI */.a6, -1],
            [math_constants/* PHI */.a6, -1, 0],
            [1, 0, math_constants/* PHI */.a6],
            [0, -math_constants/* PHI */.a6, 1],
        ], []);
        primTri.setIndices();
        primTri.calcCoeffs();
        primTri.createInnerFacets();
        primTri.edgeVecsABOB();
        primTri.mapABOBtoOBOA();
        primTri.mapABOBtoBAOA();
        for (let f = 0; f < primTri.IDATA.face.length; f++) {
            primTri.MapToFace(f, geodesicData);
            geodesicData.innerToData(f, primTri);
            if (primTri.IDATA.edgematch[f][1] === "B") {
                geodesicData.mapABOBtoDATA(f, primTri);
            }
            if (primTri.IDATA.edgematch[f][1] === "O") {
                geodesicData.mapOBOAtoDATA(f, primTri);
            }
            if (primTri.IDATA.edgematch[f][3] === "A") {
                geodesicData.mapBAOAtoDATA(f, primTri);
            }
        }
        geodesicData.orderData(primTri);
        const radius = 1;
        geodesicData.vertex = geodesicData.vertex.map(function (el) {
            const a = el[0];
            const b = el[1];
            const c = el[2];
            const d = Math.sqrt(a * a + b * b + c * c);
            el[0] *= radius / d;
            el[1] *= radius / d;
            el[2] *= radius / d;
            return el;
        });
        return geodesicData;
    }
}
//# sourceMappingURL=geodesicMesh.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/geodesicBuilder.js



/**
 * Creates the Mesh for a Geodesic Polyhedron
 * @see https://en.wikipedia.org/wiki/Geodesic_polyhedron
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra/geodesic_poly
 * @param name defines the name of the mesh
 * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
 * * m number of horizontal steps along an isogrid
 * * n number of angled steps along an isogrid
 * * size the size of the Geodesic, optional default 1
 * * sizeX allows stretching in the x direction, optional, default size
 * * sizeY allows stretching in the y direction, optional, default size
 * * sizeZ allows stretching in the z direction, optional, default size
 * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
 * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
 * * flat when true creates a flat shaded mesh, optional, default true
 * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
 * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
 * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
 * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
 * @param scene defines the hosting scene
 * @returns Geodesic mesh
 */
function CreateGeodesic(name, options, scene = null) {
    let m = options.m || 1;
    if (m !== Math.floor(m)) {
        m = Math.floor(m);
        logger/* Logger */.V.Warn("m not an integer only floor(m) used");
    }
    let n = options.n || 0;
    if (n !== Math.floor(n)) {
        n = Math.floor(n);
        logger/* Logger */.V.Warn("n not an integer only floor(n) used");
    }
    if (n > m) {
        const temp = n;
        n = m;
        m = temp;
        logger/* Logger */.V.Warn("n > m therefore m and n swapped");
    }
    const primTri = new _PrimaryIsoTriangle();
    primTri.build(m, n);
    const geodesicData = GeodesicData.BuildGeodesicData(primTri);
    const geoOptions = {
        custom: geodesicData,
        size: options.size,
        sizeX: options.sizeX,
        sizeY: options.sizeY,
        sizeZ: options.sizeZ,
        faceUV: options.faceUV,
        faceColors: options.faceColors,
        flat: options.flat,
        updatable: options.updatable,
        sideOrientation: options.sideOrientation,
        frontUVs: options.frontUVs,
        backUVs: options.backUVs,
    };
    const geodesic = CreatePolyhedron(name, geoOptions, scene);
    return geodesic;
}
//# sourceMappingURL=geodesicBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/goldbergMesh.js





Meshes_mesh/* Mesh */.e._GoldbergMeshParser = (parsedMesh, scene) => {
    return GoldbergMesh.Parse(parsedMesh, scene);
};
/**
 * Mesh for a Goldberg Polyhedron which is made from 12 pentagonal and the rest hexagonal faces
 * @see https://en.wikipedia.org/wiki/Goldberg_polyhedron
 */
class GoldbergMesh extends Meshes_mesh/* Mesh */.e {
    constructor() {
        super(...arguments);
        /**
         * Defines the specific Goldberg data used in this mesh construction.
         */
        this.goldbergData = {
            faceColors: [],
            faceCenters: [],
            faceZaxis: [],
            faceXaxis: [],
            faceYaxis: [],
            nbSharedFaces: 0,
            nbUnsharedFaces: 0,
            nbFaces: 0,
            nbFacesAtPole: 0,
            adjacentFaces: [],
        };
    }
    /**
     * Gets the related Goldberg face from pole infos
     * @param poleOrShared Defines the pole index or the shared face index if the fromPole parameter is passed in
     * @param fromPole Defines an optional pole index to find the related info from
     * @returns the goldberg face number
     */
    relatedGoldbergFace(poleOrShared, fromPole) {
        if (fromPole === void 0) {
            if (poleOrShared > this.goldbergData.nbUnsharedFaces - 1) {
                logger/* Logger */.V.Warn("Maximum number of unshared faces used");
                poleOrShared = this.goldbergData.nbUnsharedFaces - 1;
            }
            return this.goldbergData.nbUnsharedFaces + poleOrShared;
        }
        if (poleOrShared > 11) {
            logger/* Logger */.V.Warn("Last pole used");
            poleOrShared = 11;
        }
        if (fromPole > this.goldbergData.nbFacesAtPole - 1) {
            logger/* Logger */.V.Warn("Maximum number of faces at a pole used");
            fromPole = this.goldbergData.nbFacesAtPole - 1;
        }
        return 12 + poleOrShared * this.goldbergData.nbFacesAtPole + fromPole;
    }
    _changeGoldbergFaceColors(colorRange) {
        for (let i = 0; i < colorRange.length; i++) {
            const min = colorRange[i][0];
            const max = colorRange[i][1];
            const col = colorRange[i][2];
            for (let f = min; f < max + 1; f++) {
                this.goldbergData.faceColors[f] = col;
            }
        }
        const newCols = [];
        for (let f = 0; f < 12; f++) {
            for (let i = 0; i < 5; i++) {
                newCols.push(this.goldbergData.faceColors[f].r, this.goldbergData.faceColors[f].g, this.goldbergData.faceColors[f].b, this.goldbergData.faceColors[f].a);
            }
        }
        for (let f = 12; f < this.goldbergData.faceColors.length; f++) {
            for (let i = 0; i < 6; i++) {
                newCols.push(this.goldbergData.faceColors[f].r, this.goldbergData.faceColors[f].g, this.goldbergData.faceColors[f].b, this.goldbergData.faceColors[f].a);
            }
        }
        return newCols;
    }
    /**
     * Set new goldberg face colors
     * @param colorRange the new color to apply to the mesh
     */
    setGoldbergFaceColors(colorRange) {
        const newCols = this._changeGoldbergFaceColors(colorRange);
        this.setVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind, newCols);
    }
    /**
     * Updates new goldberg face colors
     * @param colorRange the new color to apply to the mesh
     */
    updateGoldbergFaceColors(colorRange) {
        const newCols = this._changeGoldbergFaceColors(colorRange);
        this.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind, newCols);
    }
    _changeGoldbergFaceUVs(uvRange) {
        const uvs = this.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind);
        for (let i = 0; i < uvRange.length; i++) {
            const min = uvRange[i][0];
            const max = uvRange[i][1];
            const center = uvRange[i][2];
            const radius = uvRange[i][3];
            const angle = uvRange[i][4];
            const points5 = [];
            const points6 = [];
            let u;
            let v;
            for (let p = 0; p < 5; p++) {
                u = center.x + radius * Math.cos(angle + (p * Math.PI) / 2.5);
                v = center.y + radius * Math.sin(angle + (p * Math.PI) / 2.5);
                if (u < 0) {
                    u = 0;
                }
                if (u > 1) {
                    u = 1;
                }
                points5.push(u, v);
            }
            for (let p = 0; p < 6; p++) {
                u = center.x + radius * Math.cos(angle + (p * Math.PI) / 3);
                v = center.y + radius * Math.sin(angle + (p * Math.PI) / 3);
                if (u < 0) {
                    u = 0;
                }
                if (u > 1) {
                    u = 1;
                }
                points6.push(u, v);
            }
            for (let f = min; f < Math.min(12, max + 1); f++) {
                for (let p = 0; p < 5; p++) {
                    uvs[10 * f + 2 * p] = points5[2 * p];
                    uvs[10 * f + 2 * p + 1] = points5[2 * p + 1];
                }
            }
            for (let f = Math.max(12, min); f < max + 1; f++) {
                for (let p = 0; p < 6; p++) {
                    //120 + 12 * (f - 12) = 12 * f - 24
                    uvs[12 * f - 24 + 2 * p] = points6[2 * p];
                    uvs[12 * f - 23 + 2 * p] = points6[2 * p + 1];
                }
            }
        }
        return uvs;
    }
    /**
     * set new goldberg face UVs
     * @param uvRange the new UVs to apply to the mesh
     */
    setGoldbergFaceUVs(uvRange) {
        const newUVs = this._changeGoldbergFaceUVs(uvRange);
        this.setVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind, newUVs);
    }
    /**
     * Updates new goldberg face UVs
     * @param uvRange the new UVs to apply to the mesh
     */
    updateGoldbergFaceUVs(uvRange) {
        const newUVs = this._changeGoldbergFaceUVs(uvRange);
        this.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind, newUVs);
    }
    /**
     * Places a mesh on a particular face of the goldberg polygon
     * @param mesh Defines the mesh to position
     * @param face Defines the face to position onto
     * @param position Defines the position relative to the face we are positioning the mesh onto
     */
    placeOnGoldbergFaceAt(mesh, face, position) {
        const orientation = math_vector/* Vector3 */.Pq.RotationFromAxis(this.goldbergData.faceXaxis[face], this.goldbergData.faceYaxis[face], this.goldbergData.faceZaxis[face]);
        mesh.rotation = orientation;
        mesh.position = this.goldbergData.faceCenters[face]
            .add(this.goldbergData.faceXaxis[face].scale(position.x))
            .add(this.goldbergData.faceYaxis[face].scale(position.y))
            .add(this.goldbergData.faceZaxis[face].scale(position.z));
    }
    /**
     * Serialize current mesh
     * @param serializationObject defines the object which will receive the serialization data
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.type = "GoldbergMesh";
        const goldbergData = {};
        goldbergData.adjacentFaces = this.goldbergData.adjacentFaces;
        goldbergData.nbSharedFaces = this.goldbergData.nbSharedFaces;
        goldbergData.nbUnsharedFaces = this.goldbergData.nbUnsharedFaces;
        goldbergData.nbFaces = this.goldbergData.nbFaces;
        goldbergData.nbFacesAtPole = this.goldbergData.nbFacesAtPole;
        if (this.goldbergData.faceColors) {
            goldbergData.faceColors = [];
            for (const color of this.goldbergData.faceColors) {
                goldbergData.faceColors.push(color.asArray());
            }
        }
        if (this.goldbergData.faceCenters) {
            goldbergData.faceCenters = [];
            for (const vector of this.goldbergData.faceCenters) {
                goldbergData.faceCenters.push(vector.asArray());
            }
        }
        if (this.goldbergData.faceZaxis) {
            goldbergData.faceZaxis = [];
            for (const vector of this.goldbergData.faceZaxis) {
                goldbergData.faceZaxis.push(vector.asArray());
            }
        }
        if (this.goldbergData.faceYaxis) {
            goldbergData.faceYaxis = [];
            for (const vector of this.goldbergData.faceYaxis) {
                goldbergData.faceYaxis.push(vector.asArray());
            }
        }
        if (this.goldbergData.faceXaxis) {
            goldbergData.faceXaxis = [];
            for (const vector of this.goldbergData.faceXaxis) {
                goldbergData.faceXaxis.push(vector.asArray());
            }
        }
        serializationObject.goldbergData = goldbergData;
    }
    /**
     * Parses a serialized goldberg mesh
     * @param parsedMesh the serialized mesh
     * @param scene the scene to create the goldberg mesh in
     * @returns the created goldberg mesh
     */
    static Parse(parsedMesh, scene) {
        const goldbergData = parsedMesh.goldbergData;
        goldbergData.faceColors = goldbergData.faceColors.map((el) => math_color/* Color4 */.ov.FromArray(el));
        goldbergData.faceCenters = goldbergData.faceCenters.map((el) => math_vector/* Vector3 */.Pq.FromArray(el));
        goldbergData.faceZaxis = goldbergData.faceZaxis.map((el) => math_vector/* Vector3 */.Pq.FromArray(el));
        goldbergData.faceXaxis = goldbergData.faceXaxis.map((el) => math_vector/* Vector3 */.Pq.FromArray(el));
        goldbergData.faceYaxis = goldbergData.faceYaxis.map((el) => math_vector/* Vector3 */.Pq.FromArray(el));
        const goldberg = new GoldbergMesh(parsedMesh.name, scene);
        goldberg.goldbergData = goldbergData;
        return goldberg;
    }
}
//# sourceMappingURL=goldbergMesh.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/goldbergBuilder.js








/**
 * Creates the Mesh for a Goldberg Polyhedron
 * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
 * @param goldbergData polyhedronData defining the Goldberg polyhedron
 * @returns GoldbergSphere mesh
 */
function CreateGoldbergVertexData(options, goldbergData) {
    const size = options.size;
    const sizeX = options.sizeX || size || 1;
    const sizeY = options.sizeY || size || 1;
    const sizeZ = options.sizeZ || size || 1;
    const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || mesh_vertexData/* VertexData */.P.DEFAULTSIDE;
    const positions = [];
    const indices = [];
    const normals = [];
    const uvs = [];
    let minX = Infinity;
    let maxX = -Infinity;
    let minY = Infinity;
    let maxY = -Infinity;
    for (let v = 0; v < goldbergData.vertex.length; v++) {
        minX = Math.min(minX, goldbergData.vertex[v][0] * sizeX);
        maxX = Math.max(maxX, goldbergData.vertex[v][0] * sizeX);
        minY = Math.min(minY, goldbergData.vertex[v][1] * sizeY);
        maxY = Math.max(maxY, goldbergData.vertex[v][1] * sizeY);
    }
    let index = 0;
    for (let f = 0; f < goldbergData.face.length; f++) {
        const verts = goldbergData.face[f];
        const a = math_vector/* Vector3 */.Pq.FromArray(goldbergData.vertex[verts[0]]);
        const b = math_vector/* Vector3 */.Pq.FromArray(goldbergData.vertex[verts[2]]);
        const c = math_vector/* Vector3 */.Pq.FromArray(goldbergData.vertex[verts[1]]);
        const ba = b.subtract(a);
        const ca = c.subtract(a);
        const norm = math_vector/* Vector3 */.Pq.Cross(ca, ba).normalize();
        for (let v = 0; v < verts.length; v++) {
            normals.push(norm.x, norm.y, norm.z);
            const pdata = goldbergData.vertex[verts[v]];
            positions.push(pdata[0] * sizeX, pdata[1] * sizeY, pdata[2] * sizeZ);
            const vCoord = (pdata[1] * sizeY - minY) / (maxY - minY);
            uvs.push((pdata[0] * sizeX - minX) / (maxX - minX), compatibilityOptions/* useOpenGLOrientationForUV */.rX ? 1 - vCoord : vCoord);
        }
        for (let v = 0; v < verts.length - 2; v++) {
            indices.push(index, index + v + 2, index + v + 1);
        }
        index += verts.length;
    }
    mesh_vertexData/* VertexData */.P._ComputeSides(sideOrientation, positions, indices, normals, uvs);
    const vertexData = new mesh_vertexData/* VertexData */.P();
    vertexData.positions = positions;
    vertexData.indices = indices;
    vertexData.normals = normals;
    vertexData.uvs = uvs;
    return vertexData;
}
/**
 * Creates the Mesh for a Goldberg Polyhedron which is made from 12 pentagonal and the rest hexagonal faces
 * @see https://en.wikipedia.org/wiki/Goldberg_polyhedron
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra/goldberg_poly
 * @param name defines the name of the mesh
 * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
 * @param scene defines the hosting scene
 * @returns Goldberg mesh
 */
function CreateGoldberg(name, options, scene = null) {
    const size = options.size;
    const sizeX = options.sizeX || size || 1;
    const sizeY = options.sizeY || size || 1;
    const sizeZ = options.sizeZ || size || 1;
    let m = options.m || 1;
    if (m !== Math.floor(m)) {
        m = Math.floor(m);
        logger/* Logger */.V.Warn("m not an integer only floor(m) used");
    }
    let n = options.n || 0;
    if (n !== Math.floor(n)) {
        n = Math.floor(n);
        logger/* Logger */.V.Warn("n not an integer only floor(n) used");
    }
    if (n > m) {
        const temp = n;
        n = m;
        m = temp;
        logger/* Logger */.V.Warn("n > m therefore m and n swapped");
    }
    const primTri = new _PrimaryIsoTriangle();
    primTri.build(m, n);
    const geodesicData = GeodesicData.BuildGeodesicData(primTri);
    const goldbergData = geodesicData.toGoldbergPolyhedronData();
    const goldberg = new GoldbergMesh(name, scene);
    options.sideOrientation = Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation);
    goldberg._originalBuilderSideOrientation = options.sideOrientation;
    const vertexData = CreateGoldbergVertexData(options, goldbergData);
    vertexData.applyToMesh(goldberg, options.updatable);
    goldberg.goldbergData.nbSharedFaces = geodesicData.sharedNodes;
    goldberg.goldbergData.nbUnsharedFaces = geodesicData.poleNodes;
    goldberg.goldbergData.adjacentFaces = geodesicData.adjacentFaces;
    goldberg.goldbergData.nbFaces = goldberg.goldbergData.nbSharedFaces + goldberg.goldbergData.nbUnsharedFaces;
    goldberg.goldbergData.nbFacesAtPole = (goldberg.goldbergData.nbUnsharedFaces - 12) / 12;
    for (let f = 0; f < geodesicData.vertex.length; f++) {
        goldberg.goldbergData.faceCenters.push(math_vector/* Vector3 */.Pq.FromArray(geodesicData.vertex[f]));
        goldberg.goldbergData.faceCenters[f].x *= sizeX;
        goldberg.goldbergData.faceCenters[f].y *= sizeY;
        goldberg.goldbergData.faceCenters[f].z *= sizeZ;
        goldberg.goldbergData.faceColors.push(new math_color/* Color4 */.ov(1, 1, 1, 1));
    }
    for (let f = 0; f < goldbergData.face.length; f++) {
        const verts = goldbergData.face[f];
        const a = math_vector/* Vector3 */.Pq.FromArray(goldbergData.vertex[verts[0]]);
        const b = math_vector/* Vector3 */.Pq.FromArray(goldbergData.vertex[verts[2]]);
        const c = math_vector/* Vector3 */.Pq.FromArray(goldbergData.vertex[verts[1]]);
        const ba = b.subtract(a);
        const ca = c.subtract(a);
        const norm = math_vector/* Vector3 */.Pq.Cross(ca, ba).normalize();
        const z = math_vector/* Vector3 */.Pq.Cross(ca, norm).normalize();
        goldberg.goldbergData.faceXaxis.push(ca.normalize());
        goldberg.goldbergData.faceYaxis.push(norm);
        goldberg.goldbergData.faceZaxis.push(z);
    }
    return goldberg;
}
//# sourceMappingURL=goldbergBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/textBuilder.js





// Shape functions
class ShapePath {
    /** Create the ShapePath used to support glyphs
     * @param resolution defines the resolution used to determine the number of points per curve (default is 4)
     */
    constructor(resolution) {
        this._paths = [];
        this._tempPaths = [];
        this._holes = [];
        this._resolution = resolution;
    }
    /** Move the virtual cursor to a coordinate
     * @param x defines the x coordinate
     * @param y defines the y coordinate
     */
    moveTo(x, y) {
        this._currentPath = new math_path/* Path2 */.Cu(x, y);
        this._tempPaths.push(this._currentPath);
    }
    /** Draw a line from the virtual cursor to a given coordinate
     * @param x defines the x coordinate
     * @param y defines the y coordinate
     */
    lineTo(x, y) {
        this._currentPath.addLineTo(x, y);
    }
    /** Create a quadratic curve from the virtual cursor to a given coordinate
     * @param cpx defines the x coordinate of the control point
     * @param cpy defines the y coordinate of the control point
     * @param x defines the x coordinate of the end point
     * @param y defines the y coordinate of the end point
     */
    quadraticCurveTo(cpx, cpy, x, y) {
        this._currentPath.addQuadraticCurveTo(cpx, cpy, x, y, this._resolution);
    }
    /**
     * Create a bezier curve from the virtual cursor to a given coordinate
     * @param cpx1 defines the x coordinate of the first control point
     * @param cpy1 defines the y coordinate of the first control point
     * @param cpx2 defines the x coordinate of the second control point
     * @param cpy2 defines the y coordinate of the second control point
     * @param x defines the x coordinate of the end point
     * @param y defines the y coordinate of the end point
     */
    bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x, y) {
        this._currentPath.addBezierCurveTo(cpx1, cpy1, cpx2, cpy2, x, y, this._resolution);
    }
    /** Extract holes based on CW / CCW */
    extractHoles() {
        for (const path of this._tempPaths) {
            if (path.area() > 0) {
                this._holes.push(path);
            }
            else {
                this._paths.push(path);
            }
        }
        if (!this._paths.length && this._holes.length) {
            const temp = this._holes;
            this._holes = this._paths;
            this._paths = temp;
        }
        this._tempPaths.length = 0;
    }
    /** Gets the list of paths */
    get paths() {
        return this._paths;
    }
    /** Gets the list of holes */
    get holes() {
        return this._holes;
    }
}
// Utility functions
function CreateShapePath(char, scale, offsetX, offsetY, resolution, fontData) {
    const glyph = fontData.glyphs[char] || fontData.glyphs["?"];
    if (!glyph) {
        // return if there is no glyph data
        return null;
    }
    const shapePath = new ShapePath(resolution);
    if (glyph.o) {
        const outline = glyph.o.split(" ");
        for (let i = 0, l = outline.length; i < l;) {
            const action = outline[i++];
            switch (action) {
                case "m": {
                    // moveTo
                    const x = parseInt(outline[i++]) * scale + offsetX;
                    const y = parseInt(outline[i++]) * scale + offsetY;
                    shapePath.moveTo(x, y);
                    break;
                }
                case "l": {
                    // lineTo
                    const x = parseInt(outline[i++]) * scale + offsetX;
                    const y = parseInt(outline[i++]) * scale + offsetY;
                    shapePath.lineTo(x, y);
                    break;
                }
                case "q": {
                    // quadraticCurveTo
                    const cpx = parseInt(outline[i++]) * scale + offsetX;
                    const cpy = parseInt(outline[i++]) * scale + offsetY;
                    const cpx1 = parseInt(outline[i++]) * scale + offsetX;
                    const cpy1 = parseInt(outline[i++]) * scale + offsetY;
                    shapePath.quadraticCurveTo(cpx1, cpy1, cpx, cpy);
                    break;
                }
                case "b": {
                    // bezierCurveTo
                    const cpx = parseInt(outline[i++]) * scale + offsetX;
                    const cpy = parseInt(outline[i++]) * scale + offsetY;
                    const cpx1 = parseInt(outline[i++]) * scale + offsetX;
                    const cpy1 = parseInt(outline[i++]) * scale + offsetY;
                    const cpx2 = parseInt(outline[i++]) * scale + offsetX;
                    const cpy2 = parseInt(outline[i++]) * scale + offsetY;
                    shapePath.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, cpx, cpy);
                    break;
                }
            }
        }
    }
    // Extract holes (based on clockwise data)
    shapePath.extractHoles();
    return { offsetX: glyph.ha * scale, shapePath: shapePath };
}
/**
 * Creates shape paths from a text and font
 * @param text the text
 * @param size size of the font
 * @param resolution resolution of the font
 * @param fontData defines the font data (can be generated with http://gero3.github.io/facetype.js/)
 * @returns array of ShapePath objects
 */
function CreateTextShapePaths(text, size, resolution, fontData) {
    const chars = Array.from(text);
    const scale = size / fontData.resolution;
    const line_height = (fontData.boundingBox.yMax - fontData.boundingBox.yMin + fontData.underlineThickness) * scale;
    const shapePaths = [];
    let offsetX = 0, offsetY = 0;
    for (let i = 0; i < chars.length; i++) {
        const char = chars[i];
        if (char === "\n") {
            offsetX = 0;
            offsetY -= line_height;
        }
        else {
            const ret = CreateShapePath(char, scale, offsetX, offsetY, resolution, fontData);
            if (ret) {
                offsetX += ret.offsetX;
                shapePaths.push(ret.shapePath);
            }
        }
    }
    return shapePaths;
}
/**
 * Create a text mesh
 * @param name defines the name of the mesh
 * @param text defines the text to use to build the mesh
 * @param fontData defines the font data (can be generated with http://gero3.github.io/facetype.js/)
 * @param options defines options used to create the mesh
 * @param scene defines the hosting scene
 * @param earcutInjection can be used to inject your own earcut reference
 * @returns a new Mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/text
 */
function CreateText(name, text, fontData, options = {
    size: 50,
    resolution: 8,
    depth: 1.0,
}, scene = null, earcutInjection = earcut) {
    // First we need to generate the paths
    const shapePaths = CreateTextShapePaths(text, options.size || 50, options.resolution || 8, fontData);
    // And extrude them
    const meshes = [];
    let letterIndex = 0;
    for (const shapePath of shapePaths) {
        if (!shapePath.paths.length) {
            continue;
        }
        const holes = shapePath.holes.slice(); // Copy it as we will update the copy
        for (const path of shapePath.paths) {
            const holeVectors = [];
            const shapeVectors = [];
            const points = path.getPoints();
            for (const point of points) {
                shapeVectors.push(new math_vector/* Vector3 */.Pq(point.x, 0, point.y)); // ExtrudePolygon expects data on the xz plane
            }
            // Holes
            const localHolesCopy = holes.slice();
            for (const hole of localHolesCopy) {
                const points = hole.getPoints();
                let found = false;
                for (const point of points) {
                    if (path.isPointInside(point)) {
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    continue;
                }
                const holePoints = [];
                for (const point of points) {
                    holePoints.push(new math_vector/* Vector3 */.Pq(point.x, 0, point.y)); // ExtrudePolygon expects data on the xz plane
                }
                holeVectors.push(holePoints);
                // Remove the hole as it was already used
                holes.splice(holes.indexOf(hole), 1);
            }
            // There is at least a hole but it was unaffected
            if (!holeVectors.length && holes.length) {
                for (const hole of holes) {
                    const points = hole.getPoints();
                    const holePoints = [];
                    for (const point of points) {
                        holePoints.push(new math_vector/* Vector3 */.Pq(point.x, 0, point.y)); // ExtrudePolygon expects data on the xz plane
                    }
                    holeVectors.push(holePoints);
                }
            }
            // Extrusion!
            const mesh = ExtrudePolygon(name, {
                shape: shapeVectors,
                holes: holeVectors.length ? holeVectors : undefined,
                depth: options.depth || 1.0,
                faceUV: options.faceUV || options.perLetterFaceUV?.(letterIndex),
                faceColors: options.faceColors || options.perLetterFaceColors?.(letterIndex),
                sideOrientation: Meshes_mesh/* Mesh */.e._GetDefaultSideOrientation(options.sideOrientation || Meshes_mesh/* Mesh */.e.DOUBLESIDE),
            }, scene, earcutInjection);
            meshes.push(mesh);
            letterIndex++;
        }
    }
    // Then we can merge everyone into one single mesh
    const newMesh = Meshes_mesh/* Mesh */.e.MergeMeshes(meshes, true, true);
    if (newMesh) {
        // Move pivot to desired center / bottom / center position
        const bbox = newMesh.getBoundingInfo().boundingBox;
        newMesh.position.x += -(bbox.minimumWorld.x + bbox.maximumWorld.x) / 2; // Mid X
        newMesh.position.y += -(bbox.minimumWorld.y + bbox.maximumWorld.y) / 2; // Mid Z as it will rotate
        newMesh.position.z += -(bbox.minimumWorld.z + bbox.maximumWorld.z) / 2 + bbox.extendSize.z; // Bottom Y as it will rotate
        newMesh.name = name;
        // Rotate 90° Up
        const pivot = new Meshes_transformNode/* TransformNode */.V("pivot", scene);
        pivot.rotation.x = -Math.PI / 2;
        newMesh.parent = pivot;
        newMesh.bakeCurrentTransformIntoVertices();
        // Remove the pivot
        newMesh.parent = null;
        pivot.dispose();
    }
    return newMesh;
}
//# sourceMappingURL=textBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/meshBuilder.js
/* eslint-disable @typescript-eslint/naming-convention */























/**
 * Class containing static functions to help procedurally build meshes
 */
const MeshBuilder = {
    CreateBox: boxBuilder/* CreateBox */.an,
    CreateTiledBox: CreateTiledBox,
    CreateSphere: CreateSphere,
    CreateDisc: CreateDisc,
    CreateIcoSphere: CreateIcoSphere,
    CreateRibbon: CreateRibbon,
    CreateCylinder: CreateCylinder,
    CreateTorus: CreateTorus,
    CreateTorusKnot: CreateTorusKnot,
    CreateLineSystem: CreateLineSystem,
    CreateLines: CreateLines,
    CreateDashedLines: CreateDashedLines,
    ExtrudeShape: ExtrudeShape,
    ExtrudeShapeCustom: ExtrudeShapeCustom,
    CreateLathe: CreateLathe,
    CreateTiledPlane: CreateTiledPlane,
    CreatePlane: planeBuilder/* CreatePlane */.x,
    CreateGround: groundBuilder/* CreateGround */.km,
    CreateTiledGround: groundBuilder/* CreateTiledGround */.ol,
    CreateGroundFromHeightMap: groundBuilder/* CreateGroundFromHeightMap */.RI,
    CreatePolygon: CreatePolygon,
    ExtrudePolygon: ExtrudePolygon,
    CreateTube: CreateTube,
    CreatePolyhedron: CreatePolyhedron,
    CreateGeodesic: CreateGeodesic,
    CreateGoldberg: CreateGoldberg,
    CreateDecal: CreateDecal,
    CreateCapsule: CreateCapsule,
    CreateText: CreateText,
};
//# sourceMappingURL=meshBuilder.js.map
;// ./node_modules/@babylonjs/core/Debug/physicsViewer.js

















/**
 * Used to show the physics impostor around the specific mesh
 */
class PhysicsViewer {
    /**
     * Creates a new PhysicsViewer
     * @param scene defines the hosting scene
     */
    constructor(scene) {
        /** @internal */
        this._impostors = [];
        /** @internal */
        this._meshes = [];
        /** @internal */
        this._bodies = [];
        /** @internal */
        this._inertiaBodies = [];
        /** @internal */
        this._constraints = [];
        /** @internal */
        this._bodyMeshes = [];
        /** @internal */
        this._inertiaMeshes = [];
        /** @internal */
        this._constraintMeshes = [];
        /** @internal */
        this._numMeshes = 0;
        /** @internal */
        this._numBodies = 0;
        /** @internal */
        this._numInertiaBodies = 0;
        /** @internal */
        this._numConstraints = 0;
        this._debugMeshMeshes = new Array();
        this._constraintAxesSize = 0.4;
        this._scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        if (!this._scene) {
            return;
        }
        const physicEngine = this._scene.getPhysicsEngine();
        if (physicEngine) {
            this._physicsEnginePlugin = physicEngine.getPhysicsPlugin();
        }
        this._utilityLayer = new utilityLayerRenderer/* UtilityLayerRenderer */.j(this._scene, false);
        this._utilityLayer.pickUtilitySceneFirst = false;
        this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = true;
    }
    /**
     * Updates the debug meshes of the physics engine.
     *
     * This code is useful for synchronizing the debug meshes of the physics engine with the physics impostor and mesh.
     * It checks if the impostor is disposed and if the plugin version is 1, then it syncs the mesh with the impostor.
     * This ensures that the debug meshes are up to date with the physics engine.
     */
    _updateDebugMeshes() {
        const plugin = this._physicsEnginePlugin;
        if (plugin?.getPluginVersion() === 1) {
            this._updateDebugMeshesV1();
        }
        else {
            this._updateDebugMeshesV2();
        }
    }
    /**
     * Updates the debug meshes of the physics engine.
     *
     * This method is useful for synchronizing the debug meshes with the physics impostors.
     * It iterates through the impostors and meshes, and if the plugin version is 1, it syncs the mesh with the impostor.
     * This ensures that the debug meshes accurately reflect the physics impostors, which is important for debugging the physics engine.
     */
    _updateDebugMeshesV1() {
        const plugin = this._physicsEnginePlugin;
        for (let i = 0; i < this._numMeshes; i++) {
            const impostor = this._impostors[i];
            if (!impostor) {
                continue;
            }
            if (impostor.isDisposed) {
                this.hideImpostor(this._impostors[i--]);
            }
            else {
                if (impostor.type === PhysicsImpostor.MeshImpostor) {
                    continue;
                }
                const mesh = this._meshes[i];
                if (mesh && plugin) {
                    plugin.syncMeshWithImpostor(mesh, impostor);
                }
            }
        }
    }
    /**
     * Updates the debug meshes of the physics engine for V2 plugin.
     *
     * This method is useful for synchronizing the debug meshes of the physics engine with the current state of the bodies.
     * It iterates through the bodies array and updates the debug meshes with the current transform of each body.
     * This ensures that the debug meshes accurately reflect the current state of the physics engine.
     */
    _updateDebugMeshesV2() {
        const plugin = this._physicsEnginePlugin;
        for (let i = 0; i < this._numBodies;) {
            const body = this._bodies[i];
            if (body && body.isDisposed && this.hideBody(body)) {
                continue;
            }
            const transform = this._bodyMeshes[i];
            if (body && transform) {
                plugin.syncTransform(body, transform);
            }
            i++;
        }
    }
    _updateInertiaMeshes() {
        for (let i = 0; i < this._numInertiaBodies;) {
            const body = this._inertiaBodies[i];
            if (body && body.isDisposed && this.hideInertia(body)) {
                continue;
            }
            const mesh = this._inertiaMeshes[i];
            if (body && mesh) {
                this._updateDebugInertia(body, mesh);
            }
            i++;
        }
    }
    _updateDebugInertia(body, inertiaMesh) {
        const inertiaMatrixRef = math_vector/* Matrix */.uq.Identity();
        const transformMatrixRef = math_vector/* Matrix */.uq.Identity();
        const finalMatrixRef = math_vector/* Matrix */.uq.Identity();
        if (body._pluginDataInstances.length) {
            const inertiaAsMesh = inertiaMesh;
            const inertiaMeshMatrixData = inertiaAsMesh._thinInstanceDataStorage.matrixData;
            const bodyTransformMatrixData = body.transformNode._thinInstanceDataStorage.matrixData;
            for (let i = 0; i < body._pluginDataInstances.length; i++) {
                const props = body.getMassProperties(i);
                this._getMeshDebugInertiaMatrixToRef(props, inertiaMatrixRef);
                math_vector/* Matrix */.uq.FromArrayToRef(bodyTransformMatrixData, i * 16, transformMatrixRef);
                inertiaMatrixRef.multiplyToRef(transformMatrixRef, finalMatrixRef);
                finalMatrixRef.copyToArray(inertiaMeshMatrixData, i * 16);
            }
            inertiaAsMesh.thinInstanceBufferUpdated("matrix");
        }
        else {
            const props = body.getMassProperties();
            this._getMeshDebugInertiaMatrixToRef(props, inertiaMatrixRef);
            body.transformNode.rotationQuaternion?.toRotationMatrix(transformMatrixRef);
            transformMatrixRef.setTranslation(body.transformNode.position);
            if (body.transformNode.parent) {
                const parentTransform = body.transformNode.parent.computeWorldMatrix(true);
                transformMatrixRef.multiplyToRef(parentTransform, transformMatrixRef);
            }
            inertiaMatrixRef.multiplyToRef(transformMatrixRef, inertiaMatrixRef);
            inertiaMatrixRef.decomposeToTransformNode(inertiaMesh);
        }
    }
    _updateDebugConstraints() {
        for (let i = 0; i < this._numConstraints; i++) {
            const constraint = this._constraints[i];
            const mesh = this._constraintMeshes[i];
            if (constraint && mesh) {
                this._updateDebugConstraint(constraint, mesh);
            }
        }
    }
    /**
     * Given a scaling vector, make all of its components
     * 1, preserving the sign
     * @param scaling
     */
    _makeScalingUnitInPlace(scaling) {
        if (Math.abs(scaling.x - 1) > math_constants/* Epsilon */.bH) {
            scaling.x = 1 * Math.sign(scaling.x);
        }
        if (Math.abs(scaling.y - 1) > math_constants/* Epsilon */.bH) {
            scaling.y = 1 * Math.sign(scaling.y);
        }
        if (Math.abs(scaling.z - 1) > math_constants/* Epsilon */.bH) {
            scaling.z = 1 * Math.sign(scaling.z);
        }
    }
    _updateDebugConstraint(constraint, parentingMesh) {
        if (!constraint._initOptions) {
            return;
        }
        // Get constraint pivot and axes
        const { pivotA, pivotB, axisA, axisB, perpAxisA, perpAxisB } = constraint._initOptions;
        if (!pivotA || !pivotB || !axisA || !axisB || !perpAxisA || !perpAxisB) {
            return;
        }
        parentingMesh.getDescendants(true).forEach((parentConstraintMesh) => {
            // Get the parent transform
            const parentCoordSystemNode = parentConstraintMesh.getDescendants(true)[0];
            const childCoordSystemNode = parentConstraintMesh.getDescendants(true)[1];
            const { parentBody, parentBodyIndex } = parentCoordSystemNode.metadata;
            const { childBody, childBodyIndex } = childCoordSystemNode.metadata;
            const parentTransform = this._getTransformFromBodyToRef(parentBody, math_vector/* TmpVectors */.AA.Matrix[0], parentBodyIndex);
            const childTransform = this._getTransformFromBodyToRef(childBody, math_vector/* TmpVectors */.AA.Matrix[1], childBodyIndex);
            parentTransform.decomposeToTransformNode(parentCoordSystemNode);
            this._makeScalingUnitInPlace(parentCoordSystemNode.scaling);
            childTransform.decomposeToTransformNode(childCoordSystemNode);
            this._makeScalingUnitInPlace(childCoordSystemNode.scaling);
            // Create a transform node and set its matrix
            const parentTransformNode = parentCoordSystemNode.getDescendants(true)[0];
            parentTransformNode.position.copyFrom(pivotA);
            const childTransformNode = childCoordSystemNode.getDescendants(true)[0];
            childTransformNode.position.copyFrom(pivotB);
            // Get the transform to align the XYZ axes to the constraint axes
            math_vector/* Quaternion */.PT.FromRotationMatrixToRef(math_vector/* Matrix */.uq.FromXYZAxesToRef(axisA, perpAxisA, math_vector/* Vector3 */.Pq.CrossToRef(axisA, perpAxisA, math_vector/* TmpVectors */.AA.Vector3[0]), math_vector/* TmpVectors */.AA.Matrix[0]), parentTransformNode.rotationQuaternion);
            math_vector/* Quaternion */.PT.FromRotationMatrixToRef(math_vector/* Matrix */.uq.FromXYZAxesToRef(axisB, perpAxisB, math_vector/* Vector3 */.Pq.CrossToRef(axisB, perpAxisB, math_vector/* TmpVectors */.AA.Vector3[1]), math_vector/* TmpVectors */.AA.Matrix[1]), childTransformNode.rotationQuaternion);
        });
    }
    /**
     * Renders a specified physic impostor
     * @param impostor defines the impostor to render
     * @param targetMesh defines the mesh represented by the impostor
     * @returns the new debug mesh used to render the impostor
     */
    showImpostor(impostor, targetMesh) {
        if (!this._scene) {
            return null;
        }
        for (let i = 0; i < this._numMeshes; i++) {
            if (this._impostors[i] == impostor) {
                return null;
            }
        }
        const debugMesh = this._getDebugMesh(impostor, targetMesh);
        if (debugMesh) {
            this._impostors[this._numMeshes] = impostor;
            this._meshes[this._numMeshes] = debugMesh;
            if (this._numMeshes === 0) {
                this._renderFunction = () => this._updateDebugMeshes();
                this._scene.registerBeforeRender(this._renderFunction);
            }
            this._numMeshes++;
        }
        return debugMesh;
    }
    /**
     * Shows a debug mesh for a given physics body.
     * @param body The physics body to show.
     * @returns The debug mesh, or null if the body is already shown.
     *
     * This function is useful for visualizing the physics body in the scene.
     * It creates a debug mesh for the given body and adds it to the scene.
     * It also registers a before render function to update the debug mesh position and rotation.
     */
    showBody(body) {
        if (!this._scene) {
            return null;
        }
        for (let i = 0; i < this._numBodies; i++) {
            if (this._bodies[i] == body) {
                return null;
            }
        }
        const debugMesh = this._getDebugBodyMesh(body);
        if (debugMesh) {
            this._bodies[this._numBodies] = body;
            this._bodyMeshes[this._numBodies] = debugMesh;
            if (this._numBodies === 0) {
                this._renderFunction = () => this._updateDebugMeshes();
                this._scene.registerBeforeRender(this._renderFunction);
            }
            this._numBodies++;
        }
        return debugMesh;
    }
    /**
     * Shows a debug box corresponding to the inertia of a given body
     * @param body the physics body used to get the inertia
     * @returns the debug mesh used to show the inertia, or null if the body is already shown
     */
    showInertia(body) {
        if (!this._scene) {
            return null;
        }
        for (let i = 0; i < this._numInertiaBodies; i++) {
            if (this._inertiaBodies[i] == body) {
                return null;
            }
        }
        const debugMesh = this._getDebugInertiaMesh(body);
        if (debugMesh) {
            this._inertiaBodies[this._numInertiaBodies] = body;
            this._inertiaMeshes[this._numInertiaBodies] = debugMesh;
            if (this._numInertiaBodies === 0) {
                this._inertiaRenderFunction = () => this._updateInertiaMeshes();
                this._scene.registerBeforeRender(this._inertiaRenderFunction);
            }
            this._numInertiaBodies++;
        }
        return debugMesh;
    }
    /**
     * Shows a debug mesh for a given physics constraint.
     * @param constraint the physics constraint to show
     * @returns the debug mesh, or null if the constraint is already shown
     */
    showConstraint(constraint) {
        if (!this._scene) {
            return null;
        }
        for (let i = 0; i < this._numConstraints; i++) {
            if (this._constraints[i] == constraint) {
                return null;
            }
        }
        const debugMesh = this._getDebugConstraintMesh(constraint);
        if (debugMesh) {
            this._constraints[this._numConstraints] = constraint;
            this._constraintMeshes[this._numConstraints] = debugMesh;
            if (this._numConstraints === 0) {
                this._constraintRenderFunction = () => this._updateDebugConstraints();
                this._scene.registerBeforeRender(this._constraintRenderFunction);
            }
            this._numConstraints++;
        }
        return debugMesh;
    }
    /**
     * Hides an impostor from the scene.
     * @param impostor - The impostor to hide.
     *
     * This method is useful for hiding an impostor from the scene. It removes the
     * impostor from the utility layer scene, disposes the mesh, and removes the
     * impostor from the list of impostors. If the impostor is the last one in the
     * list, it also unregisters the render function.
     */
    hideImpostor(impostor) {
        if (!impostor || !this._scene || !this._utilityLayer) {
            return;
        }
        let removed = false;
        const utilityLayerScene = this._utilityLayer.utilityLayerScene;
        for (let i = 0; i < this._numMeshes; i++) {
            if (this._impostors[i] == impostor) {
                const mesh = this._meshes[i];
                if (!mesh) {
                    continue;
                }
                utilityLayerScene.removeMesh(mesh);
                mesh.dispose();
                const index = this._debugMeshMeshes.indexOf(mesh);
                if (index > -1) {
                    this._debugMeshMeshes.splice(index, 1);
                }
                this._numMeshes--;
                if (this._numMeshes > 0) {
                    this._meshes[i] = this._meshes[this._numMeshes];
                    this._impostors[i] = this._impostors[this._numMeshes];
                    this._meshes[this._numMeshes] = null;
                    this._impostors[this._numMeshes] = null;
                }
                else {
                    this._meshes[0] = null;
                    this._impostors[0] = null;
                }
                removed = true;
                break;
            }
        }
        if (removed && this._numMeshes === 0) {
            this._scene.unregisterBeforeRender(this._renderFunction);
        }
    }
    /**
     * Hides a body from the physics engine.
     * @param body - The body to hide.
     * @returns true if body actually removed
     *
     * This function is useful for hiding a body from the physics engine.
     * It removes the body from the utility layer scene and disposes the mesh associated with it.
     * It also unregisters the render function if the number of bodies is 0.
     * This is useful for hiding a body from the physics engine without deleting it.
     */
    hideBody(body) {
        if (!body || !this._scene || !this._utilityLayer) {
            return false;
        }
        let removed = false;
        const utilityLayerScene = this._utilityLayer.utilityLayerScene;
        for (let i = 0; i < this._numBodies; i++) {
            if (this._bodies[i] === body) {
                const mesh = this._bodyMeshes[i];
                if (!mesh) {
                    continue;
                }
                utilityLayerScene.removeMesh(mesh);
                mesh.dispose();
                this._numBodies--;
                if (this._numBodies > 0) {
                    this._bodyMeshes[i] = this._bodyMeshes[this._numBodies];
                    this._bodies[i] = this._bodies[this._numBodies];
                    this._bodyMeshes[this._numBodies] = null;
                    this._bodies[this._numBodies] = null;
                }
                else {
                    this._bodyMeshes[0] = null;
                    this._bodies[0] = null;
                }
                removed = true;
                break;
            }
        }
        if (removed && this._numBodies === 0) {
            this._scene.unregisterBeforeRender(this._renderFunction);
        }
        return removed;
    }
    /**
     * Hides a body's inertia from the viewer utility layer
     * @param body the body to hide
     * @returns true if inertia actually removed
     */
    hideInertia(body) {
        if (!body || !this._scene || !this._utilityLayer) {
            return false;
        }
        let removed = false;
        const utilityLayerScene = this._utilityLayer.utilityLayerScene;
        for (let i = 0; i < this._numInertiaBodies; i++) {
            if (this._inertiaBodies[i] === body) {
                const mesh = this._inertiaMeshes[i];
                if (!mesh) {
                    continue;
                }
                utilityLayerScene.removeMesh(mesh);
                mesh.dispose();
                this._inertiaBodies.splice(i, 1);
                this._inertiaMeshes.splice(i, 1);
                this._numInertiaBodies--;
                removed = true;
                break;
            }
        }
        if (removed && this._numInertiaBodies === 0) {
            this._scene.unregisterBeforeRender(this._inertiaRenderFunction);
        }
        return removed;
    }
    /**
     * Hide a physics constraint from the viewer utility layer
     * @param constraint the constraint to hide
     */
    hideConstraint(constraint) {
        if (!constraint || !this._scene || !this._utilityLayer) {
            return;
        }
        let removed = false;
        const utilityLayerScene = this._utilityLayer.utilityLayerScene;
        for (let i = 0; i < this._numConstraints; i++) {
            if (this._constraints[i] === constraint) {
                const mesh = this._constraintMeshes[i];
                if (!mesh) {
                    continue;
                }
                utilityLayerScene.removeMesh(mesh);
                mesh.dispose();
                this._constraints.splice(i, 1);
                this._constraintMeshes.splice(i, 1);
                this._numConstraints--;
                if (this._numConstraints > 0) {
                    this._constraints[i] = this._constraints[this._numConstraints];
                    this._constraintMeshes[i] = this._constraintMeshes[this._numConstraints];
                    this._constraints[this._numConstraints] = null;
                    this._constraintMeshes[this._numConstraints] = null;
                }
                else {
                    this._constraints[0] = null;
                    this._constraintMeshes[0] = null;
                }
                removed = true;
                break;
            }
        }
        if (removed && this._numConstraints === 0) {
            this._scene.unregisterBeforeRender(this._constraintRenderFunction);
        }
    }
    _getDebugMaterial(scene) {
        if (!this._debugMaterial) {
            this._debugMaterial = new standardMaterial/* StandardMaterial */.F("", scene);
            this._debugMaterial.wireframe = true;
            this._debugMaterial.emissiveColor = math_color/* Color3 */.v9.White();
            this._debugMaterial.disableLighting = true;
        }
        return this._debugMaterial;
    }
    _getDebugInertiaMaterial(scene) {
        if (!this._debugInertiaMaterial) {
            this._debugInertiaMaterial = new standardMaterial/* StandardMaterial */.F("", scene);
            this._debugInertiaMaterial.disableLighting = true;
            this._debugInertiaMaterial.alpha = 0.0;
        }
        return this._debugInertiaMaterial;
    }
    _getDebugBoxMesh(scene) {
        if (!this._debugBoxMesh) {
            this._debugBoxMesh = (0,boxBuilder/* CreateBox */.an)("physicsBodyBoxViewMesh", { size: 1 }, scene);
            this._debugBoxMesh.rotationQuaternion = math_vector/* Quaternion */.PT.Identity();
            this._debugBoxMesh.material = this._getDebugMaterial(scene);
            this._debugBoxMesh.setEnabled(false);
        }
        return this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance");
    }
    _getDebugSphereMesh(scene) {
        if (!this._debugSphereMesh) {
            this._debugSphereMesh = CreateSphere("physicsBodySphereViewMesh", { diameter: 1 }, scene);
            this._debugSphereMesh.rotationQuaternion = math_vector/* Quaternion */.PT.Identity();
            this._debugSphereMesh.material = this._getDebugMaterial(scene);
            this._debugSphereMesh.setEnabled(false);
        }
        return this._debugSphereMesh.createInstance("physicsBodySphereViewInstance");
    }
    _getDebugCapsuleMesh(scene) {
        if (!this._debugCapsuleMesh) {
            this._debugCapsuleMesh = CreateCapsule("physicsBodyCapsuleViewMesh", { height: 1 }, scene);
            this._debugCapsuleMesh.rotationQuaternion = math_vector/* Quaternion */.PT.Identity();
            this._debugCapsuleMesh.material = this._getDebugMaterial(scene);
            this._debugCapsuleMesh.setEnabled(false);
        }
        return this._debugCapsuleMesh.createInstance("physicsBodyCapsuleViewInstance");
    }
    _getDebugCylinderMesh(scene) {
        if (!this._debugCylinderMesh) {
            this._debugCylinderMesh = CreateCylinder("physicsBodyCylinderViewMesh", { diameterTop: 1, diameterBottom: 1, height: 1 }, scene);
            this._debugCylinderMesh.rotationQuaternion = math_vector/* Quaternion */.PT.Identity();
            this._debugCylinderMesh.material = this._getDebugMaterial(scene);
            this._debugCylinderMesh.setEnabled(false);
        }
        return this._debugCylinderMesh.createInstance("physicsBodyCylinderViewInstance");
    }
    _getDebugMeshMesh(mesh, scene) {
        const wireframeOver = new Meshes_mesh/* Mesh */.e(mesh.name, scene, null, mesh);
        wireframeOver.setParent(mesh);
        wireframeOver.position = math_vector/* Vector3 */.Pq.Zero();
        wireframeOver.material = this._getDebugMaterial(scene);
        this._debugMeshMeshes.push(wireframeOver);
        return wireframeOver;
    }
    _getDebugMesh(impostor, targetMesh) {
        if (!this._utilityLayer) {
            return null;
        }
        // Only create child impostor debug meshes when evaluating the parent
        if (targetMesh && targetMesh.parent && targetMesh.parent.physicsImpostor) {
            return null;
        }
        let mesh = null;
        const utilityLayerScene = this._utilityLayer.utilityLayerScene;
        if (!impostor.physicsBody) {
            logger/* Logger */.V.Warn("Unable to get physicsBody of impostor. It might be initialized later by its parent's impostor.");
            return null;
        }
        switch (impostor.type) {
            case PhysicsImpostor.BoxImpostor:
                mesh = this._getDebugBoxMesh(utilityLayerScene);
                impostor.getBoxSizeToRef(mesh.scaling);
                break;
            case PhysicsImpostor.SphereImpostor: {
                mesh = this._getDebugSphereMesh(utilityLayerScene);
                const radius = impostor.getRadius();
                mesh.scaling.x = radius * 2;
                mesh.scaling.y = radius * 2;
                mesh.scaling.z = radius * 2;
                break;
            }
            case PhysicsImpostor.CapsuleImpostor: {
                mesh = this._getDebugCapsuleMesh(utilityLayerScene);
                const bi = impostor.object.getBoundingInfo();
                mesh.scaling.x = (bi.boundingBox.maximum.x - bi.boundingBox.minimum.x) * 2 * impostor.object.scaling.x;
                mesh.scaling.y = (bi.boundingBox.maximum.y - bi.boundingBox.minimum.y) * impostor.object.scaling.y;
                mesh.scaling.z = (bi.boundingBox.maximum.z - bi.boundingBox.minimum.z) * 2 * impostor.object.scaling.z;
                break;
            }
            case PhysicsImpostor.MeshImpostor:
                if (targetMesh) {
                    mesh = this._getDebugMeshMesh(targetMesh, utilityLayerScene);
                }
                break;
            case PhysicsImpostor.NoImpostor:
                if (targetMesh) {
                    // Handle compound impostors
                    const childMeshes = targetMesh.getChildMeshes().filter((c) => {
                        return c.physicsImpostor ? 1 : 0;
                    });
                    childMeshes.forEach((m) => {
                        if (m.physicsImpostor && m.getClassName() === "Mesh") {
                            const boundingInfo = m.getBoundingInfo();
                            const min = boundingInfo.boundingBox.minimum;
                            const max = boundingInfo.boundingBox.maximum;
                            switch (m.physicsImpostor.type) {
                                case PhysicsImpostor.BoxImpostor:
                                    mesh = this._getDebugBoxMesh(utilityLayerScene);
                                    mesh.position.copyFrom(min);
                                    mesh.position.addInPlace(max);
                                    mesh.position.scaleInPlace(0.5);
                                    break;
                                case PhysicsImpostor.SphereImpostor:
                                    mesh = this._getDebugSphereMesh(utilityLayerScene);
                                    break;
                                case PhysicsImpostor.CylinderImpostor:
                                    mesh = this._getDebugCylinderMesh(utilityLayerScene);
                                    break;
                                default:
                                    mesh = null;
                                    break;
                            }
                            if (mesh) {
                                mesh.scaling.x = max.x - min.x;
                                mesh.scaling.y = max.y - min.y;
                                mesh.scaling.z = max.z - min.z;
                                mesh.parent = m;
                            }
                        }
                    });
                }
                else {
                    logger/* Logger */.V.Warn("No target mesh parameter provided for NoImpostor. Skipping.");
                }
                mesh = null;
                break;
            case PhysicsImpostor.CylinderImpostor: {
                mesh = this._getDebugCylinderMesh(utilityLayerScene);
                const bi = impostor.object.getBoundingInfo();
                mesh.scaling.x = (bi.boundingBox.maximum.x - bi.boundingBox.minimum.x) * impostor.object.scaling.x;
                mesh.scaling.y = (bi.boundingBox.maximum.y - bi.boundingBox.minimum.y) * impostor.object.scaling.y;
                mesh.scaling.z = (bi.boundingBox.maximum.z - bi.boundingBox.minimum.z) * impostor.object.scaling.z;
                break;
            }
        }
        return mesh;
    }
    /**
     * Creates a debug mesh for a given physics body
     * @param body The physics body to create the debug mesh for
     * @returns The created debug mesh or null if the utility layer is not available
     *
     * This code is useful for creating a debug mesh for a given physics body.
     * It creates a Mesh object with a VertexData object containing the positions and indices
     * of the geometry of the body. The mesh is then assigned a debug material from the utility layer scene.
     * This allows for visualizing the physics body in the scene.
     */
    _getDebugBodyMesh(body) {
        if (!this._utilityLayer) {
            return null;
        }
        const utilityLayerScene = this._utilityLayer.utilityLayerScene;
        const mesh = new Meshes_mesh/* Mesh */.e("custom", utilityLayerScene);
        const vertexData = new mesh_vertexData/* VertexData */.P();
        const geometry = body.getGeometry();
        vertexData.positions = geometry.positions;
        vertexData.indices = geometry.indices;
        vertexData.applyToMesh(mesh);
        if (body._pluginDataInstances) {
            const instanceBuffer = new Float32Array(body._pluginDataInstances.length * 16);
            mesh.thinInstanceSetBuffer("matrix", instanceBuffer, 16, false);
        }
        mesh.material = this._getDebugMaterial(utilityLayerScene);
        return mesh;
    }
    _getMeshDebugInertiaMatrixToRef(massProps, matrix) {
        const orientation = massProps.inertiaOrientation ?? math_vector/* Quaternion */.PT.Identity();
        const inertiaLocal = massProps.inertia ?? math_vector/* Vector3 */.Pq.Zero();
        const center = massProps.centerOfMass ?? math_vector/* Vector3 */.Pq.Zero();
        const betaSqrd = (inertiaLocal.x - inertiaLocal.y + inertiaLocal.z) * 6;
        const beta = Math.sqrt(Math.max(betaSqrd, 0)); // Safety check for zeroed elements!
        const gammaSqrd = inertiaLocal.x * 12 - betaSqrd;
        const gamma = Math.sqrt(Math.max(gammaSqrd, 0)); // Safety check for zeroed elements!
        const alphaSqrd = inertiaLocal.z * 12 - betaSqrd;
        const alpha = Math.sqrt(Math.max(alphaSqrd, 0)); // Safety check for zeroed elements!
        const extents = math_vector/* TmpVectors */.AA.Vector3[0];
        extents.set(alpha, beta, gamma);
        const scaling = math_vector/* Matrix */.uq.ScalingToRef(extents.x, extents.y, extents.z, math_vector/* TmpVectors */.AA.Matrix[0]);
        const rotation = orientation.toRotationMatrix(math_vector/* TmpVectors */.AA.Matrix[1]);
        const translation = math_vector/* Matrix */.uq.TranslationToRef(center.x, center.y, center.z, math_vector/* TmpVectors */.AA.Matrix[2]);
        scaling.multiplyToRef(rotation, matrix);
        matrix.multiplyToRef(translation, matrix);
        return matrix;
    }
    _getDebugInertiaMesh(body) {
        if (!this._utilityLayer) {
            return null;
        }
        const utilityLayerScene = this._utilityLayer.utilityLayerScene;
        // The base inertia mesh is going to be a 1x1 cube that's scaled and rotated according to the inertia
        const inertiaBoxMesh = MeshBuilder.CreateBox("custom", { size: 1 }, utilityLayerScene);
        const matrixRef = math_vector/* Matrix */.uq.Identity();
        if (body._pluginDataInstances.length) {
            const instanceBuffer = new Float32Array(body._pluginDataInstances.length * 16);
            for (let i = 0; i < body._pluginDataInstances.length; ++i) {
                const props = body.getMassProperties(i);
                this._getMeshDebugInertiaMatrixToRef(props, matrixRef);
                matrixRef.copyToArray(instanceBuffer, i * 16);
            }
            inertiaBoxMesh.thinInstanceSetBuffer("matrix", instanceBuffer, 16, false);
        }
        else {
            const props = body.getMassProperties();
            this._getMeshDebugInertiaMatrixToRef(props, matrixRef);
            matrixRef.decomposeToTransformNode(inertiaBoxMesh);
        }
        inertiaBoxMesh.enableEdgesRendering();
        inertiaBoxMesh.edgesWidth = 2.0;
        inertiaBoxMesh.edgesColor = new math_color/* Color4 */.ov(1, 0, 1, 1);
        inertiaBoxMesh.material = this._getDebugInertiaMaterial(utilityLayerScene);
        return inertiaBoxMesh;
    }
    _getTransformFromBodyToRef(body, matrix, instanceIndex) {
        const tnode = body.transformNode;
        if (instanceIndex && instanceIndex >= 0) {
            return math_vector/* Matrix */.uq.FromArrayToRef(tnode._thinInstanceDataStorage.matrixData, instanceIndex, matrix);
        }
        else {
            return matrix.copyFrom(tnode.getWorldMatrix());
        }
    }
    _getDebugConstraintMesh(constraint) {
        if (!this._utilityLayer) {
            return null;
        }
        const utilityLayerScene = this._utilityLayer.utilityLayerScene;
        if (!constraint._initOptions) {
            return null;
        }
        // Get constraint pivot and axes
        const { pivotA, pivotB, axisA, axisB, perpAxisA, perpAxisB } = constraint._initOptions;
        if (!pivotA || !pivotB || !axisA || !axisB || !perpAxisA || !perpAxisB) {
            return null;
        }
        // Create a mesh to parent all the constraint debug meshes to
        const parentingMesh = new Meshes_mesh/* Mesh */.e("parentingDebugConstraint", utilityLayerScene);
        // First, get a reference to all physic bodies that are using this constraint
        const bodiesUsingConstraint = constraint.getBodiesUsingConstraint();
        for (const bodyPairInfo of bodiesUsingConstraint) {
            // Create a mesh to keep the pair of constraint axes
            const parentOfPair = new Meshes_transformNode/* TransformNode */.V("parentOfPair", utilityLayerScene);
            parentOfPair.parent = parentingMesh;
            const { parentBody, parentBodyIndex, childBody, childBodyIndex } = bodyPairInfo;
            // Get the parent transform
            const parentTransform = this._getTransformFromBodyToRef(parentBody, math_vector/* TmpVectors */.AA.Matrix[0], parentBodyIndex);
            const childTransform = this._getTransformFromBodyToRef(childBody, math_vector/* TmpVectors */.AA.Matrix[1], childBodyIndex);
            const parentCoordSystemNode = new Meshes_transformNode/* TransformNode */.V("parentCoordSystem", utilityLayerScene);
            // parentCoordSystemNode.parent = parentingMesh;
            parentCoordSystemNode.parent = parentOfPair;
            // Save parent and index here to be able to get the transform on update
            parentCoordSystemNode.metadata = { parentBody, parentBodyIndex };
            parentTransform.decomposeToTransformNode(parentCoordSystemNode);
            const childCoordSystemNode = new Meshes_transformNode/* TransformNode */.V("childCoordSystem", utilityLayerScene);
            // childCoordSystemNode.parent = parentingMesh;
            childCoordSystemNode.parent = parentOfPair;
            // Save child and index here to be able to get the transform on update
            childCoordSystemNode.metadata = { childBody, childBodyIndex };
            childTransform.decomposeToTransformNode(childCoordSystemNode);
            // Get the transform to align the XYZ axes to the constraint axes
            const rotTransformParent = math_vector/* Quaternion */.PT.FromRotationMatrix(math_vector/* Matrix */.uq.FromXYZAxesToRef(axisA, perpAxisA, axisA.cross(perpAxisA), math_vector/* TmpVectors */.AA.Matrix[0]));
            const rotTransformChild = math_vector/* Quaternion */.PT.FromRotationMatrix(math_vector/* Matrix */.uq.FromXYZAxesToRef(axisB, perpAxisB, axisB.cross(perpAxisB), math_vector/* TmpVectors */.AA.Matrix[0]));
            const translateTransformParent = pivotA;
            const translateTransformChild = pivotB;
            // Create a transform node and set its matrix
            const parentTransformNode = new Meshes_transformNode/* TransformNode */.V("constraint_parent", utilityLayerScene);
            parentTransformNode.position.copyFrom(translateTransformParent);
            parentTransformNode.rotationQuaternion = rotTransformParent;
            parentTransformNode.parent = parentCoordSystemNode;
            const childTransformNode = new Meshes_transformNode/* TransformNode */.V("constraint_child", utilityLayerScene);
            childTransformNode.parent = childCoordSystemNode;
            childTransformNode.position.copyFrom(translateTransformChild);
            childTransformNode.rotationQuaternion = rotTransformChild;
            // Create axes for the constraint
            const parentAxes = new AxesViewer(utilityLayerScene, this._constraintAxesSize);
            parentAxes.xAxis.parent = parentTransformNode;
            parentAxes.yAxis.parent = parentTransformNode;
            parentAxes.zAxis.parent = parentTransformNode;
            const childAxes = new AxesViewer(utilityLayerScene, this._constraintAxesSize);
            childAxes.xAxis.parent = childTransformNode;
            childAxes.yAxis.parent = childTransformNode;
            childAxes.zAxis.parent = childTransformNode;
        }
        return parentingMesh;
    }
    /**
     * Clean up physics debug display
     */
    dispose() {
        // impostors
        for (let index = this._numMeshes - 1; index >= 0; index--) {
            this.hideImpostor(this._impostors[0]);
        }
        // bodies
        for (let index = this._numBodies - 1; index >= 0; index--) {
            this.hideBody(this._bodies[0]);
        }
        // inertia
        for (let index = this._numInertiaBodies - 1; index >= 0; index--) {
            this.hideInertia(this._inertiaBodies[0]);
        }
        if (this._debugBoxMesh) {
            this._debugBoxMesh.dispose();
        }
        if (this._debugSphereMesh) {
            this._debugSphereMesh.dispose();
        }
        if (this._debugCylinderMesh) {
            this._debugCylinderMesh.dispose();
        }
        if (this._debugMaterial) {
            this._debugMaterial.dispose();
        }
        this._impostors.length = 0;
        this._scene = null;
        this._physicsEnginePlugin = null;
        if (this._utilityLayer) {
            this._utilityLayer.dispose();
            this._utilityLayer = null;
        }
    }
}
//# sourceMappingURL=physicsViewer.js.map
;// ./node_modules/@babylonjs/core/Debug/rayHelper.js


/**
 * As raycast might be hard to debug, the RayHelper can help rendering the different rays
 * in order to better appreciate the issue one might have.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking_collisions#debugging
 */
class RayHelper {
    /**
     * Helper function to create a colored helper in a scene in one line.
     * @param ray Defines the ray we are currently trying to visualize
     * @param scene Defines the scene the ray is used in
     * @param color Defines the color we want to see the ray in
     * @returns The newly created ray helper.
     */
    static CreateAndShow(ray, scene, color) {
        const helper = new RayHelper(ray);
        helper.show(scene, color);
        return helper;
    }
    /**
     * Instantiate a new ray helper.
     * As raycast might be hard to debug, the RayHelper can help rendering the different rays
     * in order to better appreciate the issue one might have.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking_collisions#debugging
     * @param ray Defines the ray we are currently trying to visualize
     */
    constructor(ray) {
        this.ray = ray;
    }
    /**
     * Shows the ray we are willing to debug.
     * @param scene Defines the scene the ray needs to be rendered in
     * @param color Defines the color the ray needs to be rendered in
     */
    show(scene, color) {
        if (!this._renderFunction && this.ray) {
            const ray = this.ray;
            this._renderFunction = () => this._render();
            this._scene = scene;
            this._renderPoints = [ray.origin, ray.origin.add(ray.direction.scale(ray.length))];
            this._renderLine = CreateLines("ray", { points: this._renderPoints, updatable: true }, scene);
            this._renderLine.isPickable = false;
            if (this._renderFunction) {
                this._scene.registerBeforeRender(this._renderFunction);
            }
        }
        if (color && this._renderLine) {
            this._renderLine.color.copyFrom(color);
        }
    }
    /**
     * Hides the ray we are debugging.
     */
    hide() {
        if (this._renderFunction && this._scene) {
            this._scene.unregisterBeforeRender(this._renderFunction);
            this._scene = null;
            this._renderFunction = null;
            if (this._renderLine) {
                this._renderLine.dispose();
                this._renderLine = null;
            }
            this._renderPoints = [];
        }
    }
    _render() {
        const ray = this.ray;
        if (!ray) {
            return;
        }
        const point = this._renderPoints[1];
        const len = Math.min(ray.length, 1000000);
        point.copyFrom(ray.direction);
        point.scaleInPlace(len);
        point.addInPlace(ray.origin);
        this._renderPoints[0].copyFrom(ray.origin);
        CreateLines("ray", { points: this._renderPoints, updatable: true, instance: this._renderLine }, this._scene);
        this._renderLine?.refreshBoundingInfo();
    }
    /**
     * Attach a ray helper to a mesh so that we can easily see its orientation for instance or information like its normals.
     * @param mesh Defines the mesh we want the helper attached to
     * @param meshSpaceDirection Defines the direction of the Ray in mesh space (local space of the mesh node)
     * @param meshSpaceOrigin Defines the origin of the Ray in mesh space (local space of the mesh node)
     * @param length Defines the length of the ray
     */
    attachToMesh(mesh, meshSpaceDirection, meshSpaceOrigin, length) {
        this._attachedToMesh = mesh;
        const ray = this.ray;
        if (!ray) {
            return;
        }
        if (!ray.direction) {
            ray.direction = math_vector/* Vector3 */.Pq.Zero();
        }
        if (!ray.origin) {
            ray.origin = math_vector/* Vector3 */.Pq.Zero();
        }
        if (length) {
            ray.length = length;
        }
        if (!meshSpaceOrigin) {
            meshSpaceOrigin = math_vector/* Vector3 */.Pq.Zero();
        }
        if (!meshSpaceDirection) {
            // -1 so that this will work with Mesh.lookAt
            meshSpaceDirection = new math_vector/* Vector3 */.Pq(0, 0, -1);
        }
        if (!this._scene) {
            this._scene = mesh.getScene();
        }
        if (!this._meshSpaceDirection) {
            this._meshSpaceDirection = meshSpaceDirection.clone();
            this._meshSpaceOrigin = meshSpaceOrigin.clone();
        }
        else {
            this._meshSpaceDirection.copyFrom(meshSpaceDirection);
            this._meshSpaceOrigin.copyFrom(meshSpaceOrigin);
        }
        if (!this._onAfterRenderObserver) {
            this._onAfterRenderObserver = this._scene.onBeforeRenderObservable.add(() => this._updateToMesh());
            this._onAfterStepObserver = this._scene.onAfterStepObservable.add(() => this._updateToMesh());
        }
        // force world matrix computation before the first ray helper computation
        this._attachedToMesh.computeWorldMatrix(true);
        this._updateToMesh();
    }
    /**
     * Detach the ray helper from the mesh it has previously been attached to.
     */
    detachFromMesh() {
        if (this._attachedToMesh && this._scene) {
            if (this._onAfterRenderObserver) {
                this._scene.onBeforeRenderObservable.remove(this._onAfterRenderObserver);
                this._scene.onAfterStepObservable.remove(this._onAfterStepObserver);
            }
            this._attachedToMesh = null;
            this._onAfterRenderObserver = null;
            this._onAfterStepObserver = null;
            this._scene = null;
        }
    }
    _updateToMesh() {
        const ray = this.ray;
        if (!this._attachedToMesh || !ray) {
            return;
        }
        if (this._attachedToMesh.isDisposed()) {
            this.detachFromMesh();
            return;
        }
        this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection, ray.direction);
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._meshSpaceOrigin, this._attachedToMesh.getWorldMatrix(), ray.origin);
    }
    /**
     * Dispose the helper and release its associated resources.
     */
    dispose() {
        this.hide();
        this.detachFromMesh();
        this.ray = null;
    }
}
//# sourceMappingURL=rayHelper.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/material.js + 1 modules
var Materials_material = __webpack_require__(28986);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effect.js
var Materials_effect = __webpack_require__(74420);
;// ./node_modules/@babylonjs/core/Debug/skeletonViewer.js














/**
 * Class used to render a debug view of a given skeleton
 * @see http://www.babylonjs-playground.com/#1BZJVJ#8
 */
class SkeletonViewer {
    /** public static method to create a BoneWeight Shader
     * @param options The constructor options
     * @param scene The scene that the shader is scoped to
     * @returns The created ShaderMaterial
     * @see http://www.babylonjs-playground.com/#1BZJVJ#395
     */
    static CreateBoneWeightShader(options, scene) {
        const skeleton = options.skeleton;
        const colorBase = options.colorBase ?? math_color/* Color3 */.v9.Black();
        const colorZero = options.colorZero ?? math_color/* Color3 */.v9.Blue();
        const colorQuarter = options.colorQuarter ?? math_color/* Color3 */.v9.Green();
        const colorHalf = options.colorHalf ?? math_color/* Color3 */.v9.Yellow();
        const colorFull = options.colorFull ?? math_color/* Color3 */.v9.Red();
        const targetBoneIndex = options.targetBoneIndex ?? 0;
        Materials_effect/* Effect */.M.ShadersStore["boneWeights:" + skeleton.name + "VertexShader"] = `precision highp float;

        attribute vec3 position;
        attribute vec2 uv;

        uniform mat4 view;
        uniform mat4 projection;
        uniform mat4 worldViewProjection;

        #include<bonesDeclaration>
        #if NUM_BONE_INFLUENCERS == 0
            attribute vec4 matricesIndices;
            attribute vec4 matricesWeights;
        #endif
        #include<bakedVertexAnimationDeclaration>

        #include<instancesDeclaration>

        varying vec3 vColor;

        uniform vec3 colorBase;
        uniform vec3 colorZero;
        uniform vec3 colorQuarter;
        uniform vec3 colorHalf;
        uniform vec3 colorFull;

        uniform float targetBoneIndex;

        void main() {
            vec3 positionUpdated = position;

            #include<instancesVertex>
            #include<bonesVertex>
            #include<bakedVertexAnimation>

            vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);

            vec3 color = colorBase;
            float totalWeight = 0.;
            if(matricesIndices[0] == targetBoneIndex && matricesWeights[0] > 0.){
                totalWeight += matricesWeights[0];
            }
            if(matricesIndices[1] == targetBoneIndex && matricesWeights[1] > 0.){
                totalWeight += matricesWeights[1];
            }
            if(matricesIndices[2] == targetBoneIndex && matricesWeights[2] > 0.){
                totalWeight += matricesWeights[2];
            }
            if(matricesIndices[3] == targetBoneIndex && matricesWeights[3] > 0.){
                totalWeight += matricesWeights[3];
            }

            color = mix(color, colorZero, smoothstep(0., 0.25, totalWeight));
            color = mix(color, colorQuarter, smoothstep(0.25, 0.5, totalWeight));
            color = mix(color, colorHalf, smoothstep(0.5, 0.75, totalWeight));
            color = mix(color, colorFull, smoothstep(0.75, 1.0, totalWeight));
            vColor = color;

        gl_Position = projection * view * worldPos;
        }`;
        Materials_effect/* Effect */.M.ShadersStore["boneWeights:" + skeleton.name + "FragmentShader"] = `
            precision highp float;
            varying vec3 vPosition;

            varying vec3 vColor;

            void main() {
                vec4 color = vec4(vColor, 1.0);
                gl_FragColor = color;
            }
        `;
        const shader = new shaderMaterial/* ShaderMaterial */.B("boneWeight:" + skeleton.name, scene, {
            vertex: "boneWeights:" + skeleton.name,
            fragment: "boneWeights:" + skeleton.name,
        }, {
            attributes: ["position", "normal", "matricesIndices", "matricesWeights"],
            uniforms: [
                "world",
                "worldView",
                "worldViewProjection",
                "view",
                "projection",
                "viewProjection",
                "colorBase",
                "colorZero",
                "colorQuarter",
                "colorHalf",
                "colorFull",
                "targetBoneIndex",
            ],
        });
        shader.setColor3("colorBase", colorBase);
        shader.setColor3("colorZero", colorZero);
        shader.setColor3("colorQuarter", colorQuarter);
        shader.setColor3("colorHalf", colorHalf);
        shader.setColor3("colorFull", colorFull);
        shader.setFloat("targetBoneIndex", targetBoneIndex);
        shader.getClassName = () => {
            return "BoneWeightShader";
        };
        shader.transparencyMode = Materials_material/* Material */.i.MATERIAL_OPAQUE;
        return shader;
    }
    /** public static method to create a BoneWeight Shader
     * @param options The constructor options
     * @param scene The scene that the shader is scoped to
     * @returns The created ShaderMaterial
     */
    static CreateSkeletonMapShader(options, scene) {
        const skeleton = options.skeleton;
        const colorMap = options.colorMap ?? [
            {
                color: new math_color/* Color3 */.v9(1, 0.38, 0.18),
                location: 0,
            },
            {
                color: new math_color/* Color3 */.v9(0.59, 0.18, 1.0),
                location: 0.2,
            },
            {
                color: new math_color/* Color3 */.v9(0.59, 1, 0.18),
                location: 0.4,
            },
            {
                color: new math_color/* Color3 */.v9(1, 0.87, 0.17),
                location: 0.6,
            },
            {
                color: new math_color/* Color3 */.v9(1, 0.17, 0.42),
                location: 0.8,
            },
            {
                color: new math_color/* Color3 */.v9(0.17, 0.68, 1.0),
                location: 1.0,
            },
        ];
        const bufferWidth = skeleton.bones.length + 1;
        const colorMapBuffer = SkeletonViewer._CreateBoneMapColorBuffer(bufferWidth, colorMap, scene);
        const shader = new shaderMaterial/* ShaderMaterial */.B("boneWeights:" + skeleton.name, scene, {
            vertexSource: `precision highp float;

            attribute vec3 position;
            attribute vec2 uv;

            uniform mat4 view;
            uniform mat4 projection;
            uniform mat4 worldViewProjection;
            uniform float colorMap[` +
                skeleton.bones.length * 4 +
                `];

            #include<bonesDeclaration>
            #if NUM_BONE_INFLUENCERS == 0
                attribute vec4 matricesIndices;
                attribute vec4 matricesWeights;
            #endif
            #include<bakedVertexAnimationDeclaration>
            #include<instancesDeclaration>

            varying vec3 vColor;

            void main() {
                vec3 positionUpdated = position;

                #include<instancesVertex>
                #include<bonesVertex>
                #include<bakedVertexAnimation>

                vec3 color = vec3(0.);
                bool first = true;

                for (int i = 0; i < 4; i++) {
                    int boneIdx = int(matricesIndices[i]);
                    float boneWgt = matricesWeights[i];

                    vec3 c = vec3(colorMap[boneIdx * 4 + 0], colorMap[boneIdx * 4 + 1], colorMap[boneIdx * 4 + 2]);

                    if (boneWgt > 0.) {
                        if (first) {
                            first = false;
                            color = c;
                        } else {
                            color = mix(color, c, boneWgt);
                        }
                    }
                }

                vColor = color;

                vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);

                gl_Position = projection * view * worldPos;
            }`,
            fragmentSource: `
            precision highp float;
            varying vec3 vColor;

            void main() {
                vec4 color = vec4( vColor, 1.0 );
                gl_FragColor = color;
            }
            `,
        }, {
            attributes: ["position", "normal", "matricesIndices", "matricesWeights"],
            uniforms: ["world", "worldView", "worldViewProjection", "view", "projection", "viewProjection", "colorMap"],
        });
        shader.setFloats("colorMap", colorMapBuffer);
        shader.getClassName = () => {
            return "SkeletonMapShader";
        };
        shader.transparencyMode = Materials_material/* Material */.i.MATERIAL_OPAQUE;
        return shader;
    }
    /** private static method to create a BoneWeight Shader
     * @param size The size of the buffer to create (usually the bone count)
     * @param colorMap The gradient data to generate
     * @param scene The scene that the shader is scoped to
     * @returns an Array of floats from the color gradient values
     */
    static _CreateBoneMapColorBuffer(size, colorMap, scene) {
        const tempGrad = new Textures_dynamicTexture/* DynamicTexture */.R("temp", { width: size, height: 1 }, scene, false);
        const ctx = tempGrad.getContext();
        const grad = ctx.createLinearGradient(0, 0, size, 0);
        colorMap.forEach((stop) => {
            grad.addColorStop(stop.location, stop.color.toHexString());
        });
        ctx.fillStyle = grad;
        ctx.fillRect(0, 0, size, 1);
        tempGrad.update();
        const buffer = [];
        const data = ctx.getImageData(0, 0, size, 1).data;
        const rUnit = 1 / 255;
        for (let i = 0; i < data.length; i++) {
            buffer.push(data[i] * rUnit);
        }
        tempGrad.dispose();
        return buffer;
    }
    /** Gets the Scene. */
    get scene() {
        return this._scene;
    }
    /** Gets the utilityLayer. */
    get utilityLayer() {
        return this._utilityLayer;
    }
    /** Checks Ready Status. */
    get isReady() {
        return this._ready;
    }
    /** Sets Ready Status. */
    set ready(value) {
        this._ready = value;
    }
    /** Gets the debugMesh */
    get debugMesh() {
        return this._debugMesh;
    }
    /** Sets the debugMesh */
    set debugMesh(value) {
        this._debugMesh = value;
    }
    /** Gets the displayMode */
    get displayMode() {
        return this.options.displayMode || SkeletonViewer.DISPLAY_LINES;
    }
    /** Sets the displayMode */
    set displayMode(value) {
        if (value > SkeletonViewer.DISPLAY_SPHERE_AND_SPURS) {
            value = SkeletonViewer.DISPLAY_LINES;
        }
        this.options.displayMode = value;
    }
    /**
     * Creates a new SkeletonViewer
     * @param skeleton defines the skeleton to render
     * @param mesh defines the mesh attached to the skeleton
     * @param scene defines the hosting scene
     * @param autoUpdateBonesMatrices defines a boolean indicating if bones matrices must be forced to update before rendering (true by default)
     * @param renderingGroupId defines the rendering group id to use with the viewer
     * @param options All of the extra constructor options for the SkeletonViewer
     */
    constructor(
    /** defines the skeleton to render */
    skeleton, 
    /** defines the mesh attached to the skeleton */
    mesh, 
    /** The Scene scope*/
    scene, 
    /** [true] defines a boolean indicating if bones matrices must be forced to update before rendering (true by default)  */
    autoUpdateBonesMatrices = true, 
    /** [3] defines the rendering group id to use with the viewer */
    renderingGroupId = 3, 
    /** [Object] is the options for the viewer */
    options = {}) {
        this.skeleton = skeleton;
        this.mesh = mesh;
        this.autoUpdateBonesMatrices = autoUpdateBonesMatrices;
        this.renderingGroupId = renderingGroupId;
        this.options = options;
        /** Gets or sets the color used to render the skeleton */
        this.color = math_color/* Color3 */.v9.White();
        /** Array of the points of the skeleton fo the line view. */
        this._debugLines = new Array();
        /** The local axes Meshes. */
        this._localAxes = null;
        /** If SkeletonViewer is enabled. */
        this._isEnabled = true;
        /** SkeletonViewer render observable. */
        this._obs = null;
        this._scene = scene;
        this._ready = false;
        //Defaults
        options.pauseAnimations = options.pauseAnimations ?? true;
        options.returnToRest = options.returnToRest ?? false;
        options.displayMode = options.displayMode ?? SkeletonViewer.DISPLAY_LINES;
        options.displayOptions = options.displayOptions ?? {};
        options.displayOptions.midStep = options.displayOptions.midStep ?? 0.235;
        options.displayOptions.midStepFactor = options.displayOptions.midStepFactor ?? 0.155;
        options.displayOptions.sphereBaseSize = options.displayOptions.sphereBaseSize ?? 0.15;
        options.displayOptions.sphereScaleUnit = options.displayOptions.sphereScaleUnit ?? 2;
        options.displayOptions.sphereFactor = options.displayOptions.sphereFactor ?? 0.865;
        options.displayOptions.spurFollowsChild = options.displayOptions.spurFollowsChild ?? false;
        options.displayOptions.showLocalAxes = options.displayOptions.showLocalAxes ?? false;
        options.displayOptions.localAxesSize = options.displayOptions.localAxesSize ?? 0.075;
        options.computeBonesUsingShaders = options.computeBonesUsingShaders ?? true;
        options.useAllBones = options.useAllBones ?? true;
        this._boneIndices = new Set();
        if (!options.useAllBones) {
            const initialMeshBoneIndices = mesh?.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind);
            const initialMeshBoneWeights = mesh?.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind);
            if (initialMeshBoneIndices && initialMeshBoneWeights) {
                for (let i = 0; i < initialMeshBoneIndices.length; ++i) {
                    const index = initialMeshBoneIndices[i], weight = initialMeshBoneWeights[i];
                    if (weight !== 0) {
                        this._boneIndices.add(index);
                    }
                }
            }
        }
        /* Create Utility Layer */
        this._utilityLayer = new utilityLayerRenderer/* UtilityLayerRenderer */.j(this._scene, false);
        this._utilityLayer.pickUtilitySceneFirst = false;
        this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = true;
        let displayMode = this.options.displayMode || 0;
        if (displayMode > SkeletonViewer.DISPLAY_SPHERE_AND_SPURS) {
            displayMode = SkeletonViewer.DISPLAY_LINES;
        }
        this.displayMode = displayMode;
        //Prep the Systems
        this.update();
        this._bindObs();
    }
    /** The Dynamic bindings for the update functions */
    _bindObs() {
        switch (this.displayMode) {
            case SkeletonViewer.DISPLAY_LINES: {
                this._obs = this.scene.onBeforeRenderObservable.add(() => {
                    this._displayLinesUpdate();
                });
                break;
            }
        }
    }
    /** Update the viewer to sync with current skeleton state, only used to manually update. */
    update() {
        switch (this.displayMode) {
            case SkeletonViewer.DISPLAY_LINES: {
                this._displayLinesUpdate();
                break;
            }
            case SkeletonViewer.DISPLAY_SPHERES: {
                this._buildSpheresAndSpurs(true);
                break;
            }
            case SkeletonViewer.DISPLAY_SPHERE_AND_SPURS: {
                this._buildSpheresAndSpurs(false);
                break;
            }
        }
        this._buildLocalAxes();
    }
    /** Gets or sets a boolean indicating if the viewer is enabled */
    set isEnabled(value) {
        if (this.isEnabled === value) {
            return;
        }
        this._isEnabled = value;
        if (this.debugMesh) {
            this.debugMesh.setEnabled(value);
        }
        if (value && !this._obs) {
            this._bindObs();
        }
        else if (!value && this._obs) {
            this.scene.onBeforeRenderObservable.remove(this._obs);
            this._obs = null;
        }
    }
    get isEnabled() {
        return this._isEnabled;
    }
    _getBonePosition(position, bone, meshMat, x = 0, y = 0, z = 0) {
        const tmat = math_vector/* TmpVectors */.AA.Matrix[0];
        const parentBone = bone.getParent();
        tmat.copyFrom(bone.getLocalMatrix());
        if (x !== 0 || y !== 0 || z !== 0) {
            const tmat2 = math_vector/* TmpVectors */.AA.Matrix[1];
            math_vector/* Matrix */.uq.IdentityToRef(tmat2);
            tmat2.setTranslationFromFloats(x, y, z);
            tmat2.multiplyToRef(tmat, tmat);
        }
        if (parentBone) {
            tmat.multiplyToRef(parentBone.getAbsoluteMatrix(), tmat);
        }
        tmat.multiplyToRef(meshMat, tmat);
        position.x = tmat.m[12];
        position.y = tmat.m[13];
        position.z = tmat.m[14];
    }
    _getLinesForBonesWithLength(bones, mesh) {
        const len = bones.length;
        let matrix;
        let meshPos;
        if (mesh) {
            matrix = mesh.getWorldMatrix();
            meshPos = mesh.position;
        }
        else {
            matrix = new math_vector/* Matrix */.uq();
            meshPos = bones[0].position;
        }
        let idx = 0;
        for (let i = 0; i < len; i++) {
            const bone = bones[i];
            let points = this._debugLines[idx];
            if (bone._index === -1 || (!this._boneIndices.has(bone.getIndex()) && !this.options.useAllBones)) {
                continue;
            }
            if (!points) {
                points = [math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Zero()];
                this._debugLines[idx] = points;
            }
            this._getBonePosition(points[0], bone, matrix);
            this._getBonePosition(points[1], bone, matrix, 0, bone.length, 0);
            points[0].subtractInPlace(meshPos);
            points[1].subtractInPlace(meshPos);
            idx++;
        }
    }
    _getLinesForBonesNoLength(bones) {
        const len = bones.length;
        let boneNum = 0;
        const mesh = this.mesh;
        let transformNode;
        let meshPos;
        if (mesh) {
            transformNode = mesh;
            meshPos = mesh.position;
        }
        else {
            transformNode = new Meshes_transformNode/* TransformNode */.V("");
            meshPos = bones[0].position;
        }
        for (let i = len - 1; i >= 0; i--) {
            const childBone = bones[i];
            const parentBone = childBone.getParent();
            if (!parentBone || (!this._boneIndices.has(childBone.getIndex()) && !this.options.useAllBones)) {
                continue;
            }
            let points = this._debugLines[boneNum];
            if (!points) {
                points = [math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Zero()];
                this._debugLines[boneNum] = points;
            }
            childBone.getAbsolutePositionToRef(transformNode, points[0]);
            parentBone.getAbsolutePositionToRef(transformNode, points[1]);
            points[0].subtractInPlace(meshPos);
            points[1].subtractInPlace(meshPos);
            boneNum++;
        }
        if (!mesh) {
            transformNode.dispose();
        }
    }
    /**
     * function to revert the mesh and scene back to the initial state.
     * @param animationState
     */
    _revert(animationState) {
        if (this.options.pauseAnimations) {
            this.scene.animationsEnabled = animationState;
            this.utilityLayer.utilityLayerScene.animationsEnabled = animationState;
        }
    }
    /**
     * function to get the absolute bind pose of a bone by accumulating transformations up the bone hierarchy.
     * @param bone
     * @param matrix
     */
    _getAbsoluteBindPoseToRef(bone, matrix) {
        if (bone === null || bone._index === -1) {
            matrix.copyFrom(math_vector/* Matrix */.uq.Identity());
            return;
        }
        this._getAbsoluteBindPoseToRef(bone.getParent(), matrix);
        bone.getBindMatrix().multiplyToRef(matrix, matrix);
        return;
    }
    _createSpur(anchorPoint, bone, childPoint, childBone, displayOptions, utilityLayerScene) {
        const dir = childPoint.subtract(anchorPoint);
        const h = dir.length();
        const up = dir.normalize().scale(h);
        const midStep = displayOptions.midStep || 0.165;
        const midStepFactor = displayOptions.midStepFactor || 0.215;
        const up0 = up.scale(midStep);
        const spur = ExtrudeShapeCustom("skeletonViewer", {
            shape: [new math_vector/* Vector3 */.Pq(1, -1, 0), new math_vector/* Vector3 */.Pq(1, 1, 0), new math_vector/* Vector3 */.Pq(-1, 1, 0), new math_vector/* Vector3 */.Pq(-1, -1, 0), new math_vector/* Vector3 */.Pq(1, -1, 0)],
            path: [math_vector/* Vector3 */.Pq.Zero(), up0, up],
            scaleFunction: (i) => {
                switch (i) {
                    case 0:
                    case 2:
                        return 0;
                    case 1:
                        return h * midStepFactor;
                }
                return 0;
            },
            sideOrientation: Meshes_mesh/* Mesh */.e.DEFAULTSIDE,
            updatable: false,
        }, utilityLayerScene);
        const numVertices = spur.getTotalVertices();
        const mwk = [], mik = [];
        for (let i = 0; i < numVertices; i++) {
            mwk.push(1, 0, 0, 0);
            // Select verts at end of spur (ie vert 10 to 14) and bind to child
            // bone if spurFollowsChild is enabled.
            if (childBone && displayOptions.spurFollowsChild && i > 9) {
                mik.push(childBone.getIndex(), 0, 0, 0);
            }
            else {
                mik.push(bone.getIndex(), 0, 0, 0);
            }
        }
        spur.position = anchorPoint.clone();
        spur.setVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind, mwk, false);
        spur.setVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind, mik, false);
        spur.convertToFlatShadedMesh();
        return spur;
    }
    _getBoundingSphereForBone(boneIndex) {
        if (!this.mesh) {
            return null;
        }
        const positions = this.mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const indices = this.mesh.getIndices();
        const boneWeights = this.mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind);
        const boneIndices = this.mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind);
        if (!positions || !indices || !boneWeights || !boneIndices) {
            return null;
        }
        const min = new math_vector/* Vector3 */.Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        const max = new math_vector/* Vector3 */.Pq(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
        let found = 0;
        for (let i = 0; i < indices.length; ++i) {
            const vertexIndex = indices[i];
            for (let b = 0; b < 4; ++b) {
                const bIndex = boneIndices[vertexIndex * 4 + b];
                const bWeight = boneWeights[vertexIndex * 4 + b];
                if (bIndex === boneIndex && bWeight > 1e-5) {
                    math_vector/* Vector3 */.Pq.FromArrayToRef(positions, vertexIndex * 3, math_vector/* TmpVectors */.AA.Vector3[0]);
                    min.minimizeInPlace(math_vector/* TmpVectors */.AA.Vector3[0]);
                    max.maximizeInPlace(math_vector/* TmpVectors */.AA.Vector3[0]);
                    found++;
                    break;
                }
            }
        }
        return found > 1
            ? {
                center: math_vector/* Vector3 */.Pq.Center(min, max),
                radius: math_vector/* Vector3 */.Pq.Distance(min, max) / 2,
            }
            : null;
    }
    /**
     * function to build and bind sphere joint points and spur bone representations.
     * @param spheresOnly
     */
    _buildSpheresAndSpurs(spheresOnly = true) {
        if (this._debugMesh) {
            this._debugMesh.dispose();
            this._debugMesh = null;
            this.ready = false;
        }
        this._ready = false;
        const utilityLayerScene = this.utilityLayer?.utilityLayerScene;
        const bones = this.skeleton.bones;
        const spheres = [];
        const spurs = [];
        const animationState = this.scene.animationsEnabled;
        try {
            if (this.options.pauseAnimations) {
                this.scene.animationsEnabled = false;
                utilityLayerScene.animationsEnabled = false;
            }
            if (this.options.returnToRest) {
                this.skeleton.returnToRest();
            }
            if (this.autoUpdateBonesMatrices) {
                this.skeleton.computeAbsoluteMatrices();
            }
            let longestBoneLength = Number.NEGATIVE_INFINITY;
            const displayOptions = this.options.displayOptions || {};
            for (let i = 0; i < bones.length; i++) {
                const bone = bones[i];
                if (bone._index === -1 || (!this._boneIndices.has(bone.getIndex()) && !this.options.useAllBones)) {
                    continue;
                }
                const boneAbsoluteBindPoseTransform = new math_vector/* Matrix */.uq();
                this._getAbsoluteBindPoseToRef(bone, boneAbsoluteBindPoseTransform);
                const anchorPoint = new math_vector/* Vector3 */.Pq();
                boneAbsoluteBindPoseTransform.decompose(undefined, undefined, anchorPoint);
                if (bone.children.length > 0) {
                    bone.children.forEach((bc) => {
                        const childAbsoluteBindPoseTransform = new math_vector/* Matrix */.uq();
                        bc.getLocalMatrix().multiplyToRef(boneAbsoluteBindPoseTransform, childAbsoluteBindPoseTransform);
                        const childPoint = new math_vector/* Vector3 */.Pq();
                        childAbsoluteBindPoseTransform.decompose(undefined, undefined, childPoint);
                        const distanceFromParent = math_vector/* Vector3 */.Pq.Distance(anchorPoint, childPoint);
                        if (distanceFromParent > longestBoneLength) {
                            longestBoneLength = distanceFromParent;
                        }
                        if (spheresOnly) {
                            return;
                        }
                        spurs.push(this._createSpur(anchorPoint, bone, childPoint, bc, displayOptions, utilityLayerScene));
                    });
                }
                else {
                    const boundingSphere = this._getBoundingSphereForBone(bone.getIndex());
                    if (boundingSphere) {
                        if (boundingSphere.radius > longestBoneLength) {
                            longestBoneLength = boundingSphere.radius;
                        }
                        if (!spheresOnly) {
                            let childPoint;
                            const parentBone = bone.getParent();
                            if (parentBone) {
                                this._getAbsoluteBindPoseToRef(parentBone, boneAbsoluteBindPoseTransform);
                                boneAbsoluteBindPoseTransform.decompose(undefined, undefined, math_vector/* TmpVectors */.AA.Vector3[0]);
                                childPoint = anchorPoint.subtract(math_vector/* TmpVectors */.AA.Vector3[0]).normalize().scale(boundingSphere.radius).add(anchorPoint);
                            }
                            else {
                                childPoint = boundingSphere.center.subtract(anchorPoint).normalize().scale(boundingSphere.radius).add(anchorPoint);
                            }
                            spurs.push(this._createSpur(anchorPoint, bone, childPoint, null, displayOptions, utilityLayerScene));
                        }
                    }
                }
                const sphereBaseSize = displayOptions.sphereBaseSize || 0.2;
                const sphere = CreateSphere("skeletonViewer", {
                    segments: 6,
                    diameter: sphereBaseSize,
                    updatable: true,
                }, utilityLayerScene);
                const numVertices = sphere.getTotalVertices();
                const mwk = [], mik = [];
                for (let i = 0; i < numVertices; i++) {
                    mwk.push(1, 0, 0, 0);
                    mik.push(bone.getIndex(), 0, 0, 0);
                }
                sphere.setVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind, mwk, false);
                sphere.setVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind, mik, false);
                sphere.position = anchorPoint.clone();
                spheres.push([sphere, bone]);
            }
            const sphereScaleUnit = displayOptions.sphereScaleUnit || 2;
            const sphereFactor = displayOptions.sphereFactor || 0.85;
            const meshes = [];
            for (let i = 0; i < spheres.length; i++) {
                const [sphere, bone] = spheres[i];
                const scale = 1 / (sphereScaleUnit / longestBoneLength);
                let _stepsOut = 0;
                let _b = bone;
                while (_b.getParent() && _b.getParent().getIndex() !== -1) {
                    _stepsOut++;
                    _b = _b.getParent();
                }
                sphere.scaling.scaleInPlace(scale * Math.pow(sphereFactor, _stepsOut));
                meshes.push(sphere);
            }
            this.debugMesh = Meshes_mesh/* Mesh */.e.MergeMeshes(meshes.concat(spurs), true, true);
            if (this.debugMesh) {
                this.debugMesh.renderingGroupId = this.renderingGroupId;
                this.debugMesh.skeleton = this.skeleton;
                this.debugMesh.parent = this.mesh;
                this.debugMesh.computeBonesUsingShaders = this.options.computeBonesUsingShaders ?? true;
                this.debugMesh.alwaysSelectAsActiveMesh = true;
            }
            const light = this.utilityLayer._getSharedGizmoLight();
            light.intensity = 0.7;
            this._revert(animationState);
            this.ready = true;
        }
        catch (err) {
            logger/* Logger */.V.Error(err);
            this._revert(animationState);
            this.dispose();
        }
    }
    _buildLocalAxes() {
        if (this._localAxes) {
            this._localAxes.dispose();
        }
        this._localAxes = null;
        const displayOptions = this.options.displayOptions || {};
        if (!displayOptions.showLocalAxes) {
            return;
        }
        const targetScene = this._utilityLayer.utilityLayerScene;
        const size = displayOptions.localAxesSize || 0.075;
        const lines = [];
        const colors = [];
        const red = new math_color/* Color4 */.ov(1, 0, 0, 1);
        const green = new math_color/* Color4 */.ov(0, 1, 0, 1);
        const blue = new math_color/* Color4 */.ov(0, 0, 1, 1);
        const mwk = [];
        const mik = [];
        const vertsPerBone = 6;
        for (const i in this.skeleton.bones) {
            const bone = this.skeleton.bones[i];
            if (bone._index === -1 || (!this._boneIndices.has(bone.getIndex()) && !this.options.useAllBones)) {
                continue;
            }
            const boneAbsoluteBindPoseTransform = new math_vector/* Matrix */.uq();
            const boneOrigin = new math_vector/* Vector3 */.Pq();
            this._getAbsoluteBindPoseToRef(bone, boneAbsoluteBindPoseTransform);
            boneAbsoluteBindPoseTransform.decompose(undefined, math_vector/* TmpVectors */.AA.Quaternion[0], boneOrigin);
            const m = new math_vector/* Matrix */.uq();
            math_vector/* TmpVectors */.AA.Quaternion[0].toRotationMatrix(m);
            const boneAxisX = math_vector/* Vector3 */.Pq.TransformCoordinates(new math_vector/* Vector3 */.Pq(0 + size, 0, 0), m);
            const boneAxisY = math_vector/* Vector3 */.Pq.TransformCoordinates(new math_vector/* Vector3 */.Pq(0, 0 + size, 0), m);
            const boneAxisZ = math_vector/* Vector3 */.Pq.TransformCoordinates(new math_vector/* Vector3 */.Pq(0, 0, 0 + size), m);
            const axisX = [boneOrigin, boneOrigin.add(boneAxisX)];
            const axisY = [boneOrigin, boneOrigin.add(boneAxisY)];
            const axisZ = [boneOrigin, boneOrigin.add(boneAxisZ)];
            const linePoints = [axisX, axisY, axisZ];
            const lineColors = [
                [red, red],
                [green, green],
                [blue, blue],
            ];
            lines.push(...linePoints);
            colors.push(...lineColors);
            for (let j = 0; j < vertsPerBone; j++) {
                mwk.push(1, 0, 0, 0);
                mik.push(bone.getIndex(), 0, 0, 0);
            }
        }
        this._localAxes = CreateLineSystem("localAxes", { lines: lines, colors: colors, updatable: true }, targetScene);
        this._localAxes.setVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind, mwk, false);
        this._localAxes.setVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind, mik, false);
        this._localAxes.skeleton = this.skeleton;
        this._localAxes.renderingGroupId = this.renderingGroupId + 1;
        this._localAxes.parent = this.mesh;
        this._localAxes.computeBonesUsingShaders = this.options.computeBonesUsingShaders ?? true;
    }
    /** Update the viewer to sync with current skeleton state, only used for the line display. */
    _displayLinesUpdate() {
        if (!this._utilityLayer) {
            return;
        }
        if (this.autoUpdateBonesMatrices) {
            this.skeleton.computeAbsoluteMatrices();
        }
        if (this.skeleton.bones[0].length === undefined) {
            this._getLinesForBonesNoLength(this.skeleton.bones);
        }
        else {
            this._getLinesForBonesWithLength(this.skeleton.bones, this.mesh);
        }
        const targetScene = this._utilityLayer.utilityLayerScene;
        if (targetScene) {
            if (!this._debugMesh) {
                this._debugMesh = CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: null }, targetScene);
                this._debugMesh.renderingGroupId = this.renderingGroupId;
            }
            else {
                CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: this._debugMesh }, targetScene);
            }
            if (this.mesh) {
                this._debugMesh.position.copyFrom(this.mesh.position);
            }
            else {
                this._debugMesh.position.copyFrom(this.skeleton.bones[0].position);
            }
            this._debugMesh.color = this.color;
        }
    }
    /** Changes the displayMode of the skeleton viewer
     * @param mode The displayMode numerical value
     */
    changeDisplayMode(mode) {
        const wasEnabled = this.isEnabled ? true : false;
        if (this.displayMode !== mode) {
            this.isEnabled = false;
            if (this._debugMesh) {
                this._debugMesh.dispose();
                this._debugMesh = null;
                this.ready = false;
            }
            this.displayMode = mode;
            this.update();
            this._bindObs();
            this.isEnabled = wasEnabled;
        }
    }
    /** Sets a display option of the skeleton viewer
     *
     * | Option           | Type    | Default | Description |
     * | ---------------- | ------- | ------- | ----------- |
     * | midStep          | float   | 0.235   | A percentage between a bone and its child that determines the widest part of a spur. Only used when `displayMode` is set to `DISPLAY_SPHERE_AND_SPURS`. |
     * | midStepFactor    | float   | 0.15    | Mid step width expressed as a factor of the length. A value of 0.5 makes the spur width half of the spur length. Only used when `displayMode` is set to `DISPLAY_SPHERE_AND_SPURS`. |
     * | sphereBaseSize   | float   | 2       | Sphere base size. Only used when `displayMode` is set to `DISPLAY_SPHERE_AND_SPURS`. |
     * | sphereScaleUnit  | float   | 0.865   | Sphere scale factor used to scale spheres in relation to the longest bone. Only used when `displayMode` is set to `DISPLAY_SPHERE_AND_SPURS`. |
     * | spurFollowsChild | boolean | false   | Whether a spur should attach its far end to the child bone. |
     * | showLocalAxes    | boolean | false   | Displays local axes on all bones. |
     * | localAxesSize    | float   | 0.075   | Determines the length of each local axis. |
     *
     * @param option String of the option name
     * @param value The numerical option value
     */
    changeDisplayOptions(option, value) {
        const wasEnabled = this.isEnabled ? true : false;
        this.options.displayOptions[option] = value;
        this.isEnabled = false;
        if (this._debugMesh) {
            this._debugMesh.dispose();
            this._debugMesh = null;
            this.ready = false;
        }
        this.update();
        this._bindObs();
        this.isEnabled = wasEnabled;
    }
    /** Release associated resources */
    dispose() {
        this.isEnabled = false;
        if (this._debugMesh) {
            this._debugMesh.dispose();
            this._debugMesh = null;
        }
        if (this._utilityLayer) {
            this._utilityLayer.dispose();
            this._utilityLayer = null;
        }
        this.ready = false;
    }
}
/** public Display constants BABYLON.SkeletonViewer.DISPLAY_LINES */
SkeletonViewer.DISPLAY_LINES = 0;
/** public Display constants BABYLON.SkeletonViewer.DISPLAY_SPHERES */
SkeletonViewer.DISPLAY_SPHERES = 1;
/** public Display constants BABYLON.SkeletonViewer.DISPLAY_SPHERE_AND_SPURS */
SkeletonViewer.DISPLAY_SPHERE_AND_SPURS = 2;
//# sourceMappingURL=skeletonViewer.js.map
;// ./node_modules/@babylonjs/core/Debug/ISkeletonViewer.js

//# sourceMappingURL=ISkeletonViewer.js.map
;// ./node_modules/@babylonjs/core/Debug/directionalLightFrustumViewer.js







/**
 * Class used to render a debug view of the frustum for a directional light
 * @see https://playground.babylonjs.com/#7EFGSG#4
 * @since 5.0.0
 */
class DirectionalLightFrustumViewer {
    /**
     * Gets or sets the transparency of the frustum planes
     */
    get transparency() {
        return this._transparency;
    }
    set transparency(alpha) {
        this._transparency = alpha;
        for (let i = 6; i < 12; ++i) {
            this._lightHelperFrustumMeshes[i].material.alpha = alpha;
        }
    }
    /**
     * true to display the edges of the frustum
     */
    get showLines() {
        return this._showLines;
    }
    set showLines(show) {
        if (this._showLines === show) {
            return;
        }
        this._showLines = show;
        for (let i = 0; i < 6; ++i) {
            this._lightHelperFrustumMeshes[i].setEnabled(show);
        }
    }
    /**
     * true to display the planes of the frustum
     */
    get showPlanes() {
        return this._showPlanes;
    }
    set showPlanes(show) {
        if (this._showPlanes === show) {
            return;
        }
        this._showPlanes = show;
        for (let i = 6; i < 12; ++i) {
            this._lightHelperFrustumMeshes[i].setEnabled(show);
        }
    }
    /**
     * Creates a new frustum viewer
     * @param light directional light to display the frustum for
     * @param camera camera used to retrieve the minZ / maxZ values if the shadowMinZ/shadowMaxZ values of the light are not setup
     */
    constructor(light, camera) {
        this._oldPosition = new math_vector/* Vector3 */.Pq(Number.NaN, Number.NaN, Number.NaN);
        this._oldDirection = new math_vector/* Vector3 */.Pq(Number.NaN, Number.NaN, Number.NaN);
        this._transparency = 0.3;
        this._showLines = true;
        this._showPlanes = true;
        this._scene = light.getScene();
        this._light = light;
        this._camera = camera;
        this._inverseViewMatrix = math_vector/* Matrix */.uq.Identity();
        this._lightHelperFrustumMeshes = [];
        this._createGeometry();
        this.show();
        this.update();
    }
    /**
     * Shows the frustum
     */
    show() {
        this._lightHelperFrustumMeshes.forEach((mesh, index) => {
            mesh.setEnabled((index < 6 && this._showLines) || (index >= 6 && this._showPlanes));
        });
        this._oldPosition.set(Number.NaN, Number.NaN, Number.NaN);
        this._visible = true;
    }
    /**
     * Hides the frustum
     */
    hide() {
        this._lightHelperFrustumMeshes.forEach((mesh) => {
            mesh.setEnabled(false);
        });
        this._visible = false;
    }
    /**
     * Updates the frustum.
     * Call this method to update the frustum view if the light has changed position/direction
     */
    update() {
        if (!this._visible) {
            return;
        }
        if (this._oldPosition.equals(this._light.position) &&
            this._oldDirection.equals(this._light.direction) &&
            this._oldAutoCalc === this._light.autoCalcShadowZBounds &&
            this._oldMinZ === this._light.shadowMinZ &&
            this._oldMaxZ === this._light.shadowMaxZ) {
            return;
        }
        this._oldPosition.copyFrom(this._light.position);
        this._oldDirection.copyFrom(this._light.direction);
        this._oldAutoCalc = this._light.autoCalcShadowZBounds;
        this._oldMinZ = this._light.shadowMinZ;
        this._oldMaxZ = this._light.shadowMaxZ;
        math_vector/* TmpVectors */.AA.Vector3[0].set(this._light.orthoLeft, this._light.orthoBottom, this._light.shadowMinZ !== undefined ? this._light.shadowMinZ : this._camera.minZ); // min light extents
        math_vector/* TmpVectors */.AA.Vector3[1].set(this._light.orthoRight, this._light.orthoTop, this._light.shadowMaxZ !== undefined ? this._light.shadowMaxZ : this._camera.maxZ); // max light extents
        const invLightView = this._getInvertViewMatrix();
        math_vector/* TmpVectors */.AA.Vector3[2].copyFromFloats(math_vector/* TmpVectors */.AA.Vector3[1].x, math_vector/* TmpVectors */.AA.Vector3[1].y, math_vector/* TmpVectors */.AA.Vector3[0].z); // n1
        math_vector/* TmpVectors */.AA.Vector3[3].copyFromFloats(math_vector/* TmpVectors */.AA.Vector3[1].x, math_vector/* TmpVectors */.AA.Vector3[0].y, math_vector/* TmpVectors */.AA.Vector3[0].z); // n2
        math_vector/* TmpVectors */.AA.Vector3[4].copyFromFloats(math_vector/* TmpVectors */.AA.Vector3[0].x, math_vector/* TmpVectors */.AA.Vector3[0].y, math_vector/* TmpVectors */.AA.Vector3[0].z); // n3
        math_vector/* TmpVectors */.AA.Vector3[5].copyFromFloats(math_vector/* TmpVectors */.AA.Vector3[0].x, math_vector/* TmpVectors */.AA.Vector3[1].y, math_vector/* TmpVectors */.AA.Vector3[0].z); // n4
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* TmpVectors */.AA.Vector3[2], invLightView, math_vector/* TmpVectors */.AA.Vector3[2]); // near1
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* TmpVectors */.AA.Vector3[3], invLightView, math_vector/* TmpVectors */.AA.Vector3[3]); // near2
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* TmpVectors */.AA.Vector3[4], invLightView, math_vector/* TmpVectors */.AA.Vector3[4]); // near3
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* TmpVectors */.AA.Vector3[5], invLightView, math_vector/* TmpVectors */.AA.Vector3[5]); // near4
        math_vector/* TmpVectors */.AA.Vector3[6].copyFromFloats(math_vector/* TmpVectors */.AA.Vector3[1].x, math_vector/* TmpVectors */.AA.Vector3[1].y, math_vector/* TmpVectors */.AA.Vector3[1].z); // f1
        math_vector/* TmpVectors */.AA.Vector3[7].copyFromFloats(math_vector/* TmpVectors */.AA.Vector3[1].x, math_vector/* TmpVectors */.AA.Vector3[0].y, math_vector/* TmpVectors */.AA.Vector3[1].z); // f2
        math_vector/* TmpVectors */.AA.Vector3[8].copyFromFloats(math_vector/* TmpVectors */.AA.Vector3[0].x, math_vector/* TmpVectors */.AA.Vector3[0].y, math_vector/* TmpVectors */.AA.Vector3[1].z); // f3
        math_vector/* TmpVectors */.AA.Vector3[9].copyFromFloats(math_vector/* TmpVectors */.AA.Vector3[0].x, math_vector/* TmpVectors */.AA.Vector3[1].y, math_vector/* TmpVectors */.AA.Vector3[1].z); // f4
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* TmpVectors */.AA.Vector3[6], invLightView, math_vector/* TmpVectors */.AA.Vector3[6]); // far1
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* TmpVectors */.AA.Vector3[7], invLightView, math_vector/* TmpVectors */.AA.Vector3[7]); // far2
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* TmpVectors */.AA.Vector3[8], invLightView, math_vector/* TmpVectors */.AA.Vector3[8]); // far3
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* TmpVectors */.AA.Vector3[9], invLightView, math_vector/* TmpVectors */.AA.Vector3[9]); // far4
        CreateLines("nearlines", { updatable: true, points: this._nearLinesPoints, instance: this._lightHelperFrustumMeshes[0] }, this._scene);
        CreateLines("farlines", { updatable: true, points: this._farLinesPoints, instance: this._lightHelperFrustumMeshes[1] }, this._scene);
        CreateLines("trlines", { updatable: true, points: this._trLinesPoints, instance: this._lightHelperFrustumMeshes[2] }, this._scene);
        CreateLines("brlines", { updatable: true, points: this._brLinesPoints, instance: this._lightHelperFrustumMeshes[3] }, this._scene);
        CreateLines("tllines", { updatable: true, points: this._tlLinesPoints, instance: this._lightHelperFrustumMeshes[4] }, this._scene);
        CreateLines("bllines", { updatable: true, points: this._blLinesPoints, instance: this._lightHelperFrustumMeshes[5] }, this._scene);
        math_vector/* TmpVectors */.AA.Vector3[2].toArray(this._nearPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[3].toArray(this._nearPlaneVertices, 3);
        math_vector/* TmpVectors */.AA.Vector3[4].toArray(this._nearPlaneVertices, 6);
        math_vector/* TmpVectors */.AA.Vector3[5].toArray(this._nearPlaneVertices, 9);
        this._lightHelperFrustumMeshes[6].geometry?.updateVerticesDataDirectly("position", this._nearPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[6].toArray(this._farPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[7].toArray(this._farPlaneVertices, 3);
        math_vector/* TmpVectors */.AA.Vector3[8].toArray(this._farPlaneVertices, 6);
        math_vector/* TmpVectors */.AA.Vector3[9].toArray(this._farPlaneVertices, 9);
        this._lightHelperFrustumMeshes[7].geometry?.updateVerticesDataDirectly("position", this._farPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[2].toArray(this._rightPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[6].toArray(this._rightPlaneVertices, 3);
        math_vector/* TmpVectors */.AA.Vector3[7].toArray(this._rightPlaneVertices, 6);
        math_vector/* TmpVectors */.AA.Vector3[3].toArray(this._rightPlaneVertices, 9);
        this._lightHelperFrustumMeshes[8].geometry?.updateVerticesDataDirectly("position", this._rightPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[5].toArray(this._leftPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[9].toArray(this._leftPlaneVertices, 3);
        math_vector/* TmpVectors */.AA.Vector3[8].toArray(this._leftPlaneVertices, 6);
        math_vector/* TmpVectors */.AA.Vector3[4].toArray(this._leftPlaneVertices, 9);
        this._lightHelperFrustumMeshes[9].geometry?.updateVerticesDataDirectly("position", this._leftPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[2].toArray(this._topPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[6].toArray(this._topPlaneVertices, 3);
        math_vector/* TmpVectors */.AA.Vector3[9].toArray(this._topPlaneVertices, 6);
        math_vector/* TmpVectors */.AA.Vector3[5].toArray(this._topPlaneVertices, 9);
        this._lightHelperFrustumMeshes[10].geometry?.updateVerticesDataDirectly("position", this._topPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[3].toArray(this._bottomPlaneVertices, 0);
        math_vector/* TmpVectors */.AA.Vector3[7].toArray(this._bottomPlaneVertices, 3);
        math_vector/* TmpVectors */.AA.Vector3[8].toArray(this._bottomPlaneVertices, 6);
        math_vector/* TmpVectors */.AA.Vector3[4].toArray(this._bottomPlaneVertices, 9);
        this._lightHelperFrustumMeshes[11].geometry?.updateVerticesDataDirectly("position", this._bottomPlaneVertices, 0);
    }
    /**
     * Dispose of the class / remove the frustum view
     */
    dispose() {
        this._lightHelperFrustumMeshes.forEach((mesh) => {
            mesh.material?.dispose();
            mesh.dispose();
        });
        this._rootNode.dispose();
    }
    _createGeometry() {
        this._rootNode = new Meshes_transformNode/* TransformNode */.V("directionalLightHelperRoot_" + this._light.name, this._scene);
        this._rootNode.parent = this._light.parent;
        this._nearLinesPoints = [math_vector/* TmpVectors */.AA.Vector3[0], math_vector/* TmpVectors */.AA.Vector3[1], math_vector/* TmpVectors */.AA.Vector3[2], math_vector/* TmpVectors */.AA.Vector3[3], math_vector/* TmpVectors */.AA.Vector3[4]];
        const nearLines = CreateLines("nearlines", { updatable: true, points: this._nearLinesPoints }, this._scene);
        nearLines.parent = this._rootNode;
        nearLines.alwaysSelectAsActiveMesh = true;
        this._farLinesPoints = [math_vector/* TmpVectors */.AA.Vector3[5], math_vector/* TmpVectors */.AA.Vector3[6], math_vector/* TmpVectors */.AA.Vector3[7], math_vector/* TmpVectors */.AA.Vector3[8], math_vector/* TmpVectors */.AA.Vector3[9]];
        const farLines = CreateLines("farlines", { updatable: true, points: this._farLinesPoints }, this._scene);
        farLines.parent = this._rootNode;
        farLines.alwaysSelectAsActiveMesh = true;
        this._trLinesPoints = [math_vector/* TmpVectors */.AA.Vector3[10], math_vector/* TmpVectors */.AA.Vector3[11]];
        const trLines = CreateLines("trlines", { updatable: true, points: this._trLinesPoints }, this._scene);
        trLines.parent = this._rootNode;
        trLines.alwaysSelectAsActiveMesh = true;
        this._brLinesPoints = [math_vector/* TmpVectors */.AA.Vector3[12], math_vector/* TmpVectors */.AA.Vector3[0]];
        const brLines = CreateLines("brlines", { updatable: true, points: this._brLinesPoints }, this._scene);
        brLines.parent = this._rootNode;
        brLines.alwaysSelectAsActiveMesh = true;
        this._tlLinesPoints = [math_vector/* TmpVectors */.AA.Vector3[1], math_vector/* TmpVectors */.AA.Vector3[2]];
        const tlLines = CreateLines("tllines", { updatable: true, points: this._tlLinesPoints }, this._scene);
        tlLines.parent = this._rootNode;
        tlLines.alwaysSelectAsActiveMesh = true;
        this._blLinesPoints = [math_vector/* TmpVectors */.AA.Vector3[3], math_vector/* TmpVectors */.AA.Vector3[4]];
        const blLines = CreateLines("bllines", { updatable: true, points: this._blLinesPoints }, this._scene);
        blLines.parent = this._rootNode;
        blLines.alwaysSelectAsActiveMesh = true;
        this._lightHelperFrustumMeshes.push(nearLines, farLines, trLines, brLines, tlLines, blLines);
        const makePlane = (name, color, positions) => {
            const plane = new Meshes_mesh/* Mesh */.e(name + "plane", this._scene);
            const mat = new standardMaterial/* StandardMaterial */.F(name + "PlaneMat", this._scene);
            plane.material = mat;
            plane.parent = this._rootNode;
            plane.alwaysSelectAsActiveMesh = true;
            mat.emissiveColor = color;
            mat.alpha = this.transparency;
            mat.backFaceCulling = false;
            mat.disableLighting = true;
            const indices = [0, 1, 2, 0, 2, 3];
            const vertexData = new mesh_vertexData/* VertexData */.P();
            vertexData.positions = positions;
            vertexData.indices = indices;
            vertexData.applyToMesh(plane, true);
            this._lightHelperFrustumMeshes.push(plane);
        };
        this._nearPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
        this._farPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
        this._rightPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
        this._leftPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
        this._topPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
        this._bottomPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
        makePlane("near", new math_color/* Color3 */.v9(1, 0, 0), this._nearPlaneVertices);
        makePlane("far", new math_color/* Color3 */.v9(0.3, 0, 0), this._farPlaneVertices);
        makePlane("right", new math_color/* Color3 */.v9(0, 1, 0), this._rightPlaneVertices);
        makePlane("left", new math_color/* Color3 */.v9(0, 0.3, 0), this._leftPlaneVertices);
        makePlane("top", new math_color/* Color3 */.v9(0, 0, 1), this._topPlaneVertices);
        makePlane("bottom", new math_color/* Color3 */.v9(0, 0, 0.3), this._bottomPlaneVertices);
        this._nearLinesPoints[0] = math_vector/* TmpVectors */.AA.Vector3[2];
        this._nearLinesPoints[1] = math_vector/* TmpVectors */.AA.Vector3[3];
        this._nearLinesPoints[2] = math_vector/* TmpVectors */.AA.Vector3[4];
        this._nearLinesPoints[3] = math_vector/* TmpVectors */.AA.Vector3[5];
        this._nearLinesPoints[4] = math_vector/* TmpVectors */.AA.Vector3[2];
        this._farLinesPoints[0] = math_vector/* TmpVectors */.AA.Vector3[6];
        this._farLinesPoints[1] = math_vector/* TmpVectors */.AA.Vector3[7];
        this._farLinesPoints[2] = math_vector/* TmpVectors */.AA.Vector3[8];
        this._farLinesPoints[3] = math_vector/* TmpVectors */.AA.Vector3[9];
        this._farLinesPoints[4] = math_vector/* TmpVectors */.AA.Vector3[6];
        this._trLinesPoints[0] = math_vector/* TmpVectors */.AA.Vector3[2];
        this._trLinesPoints[1] = math_vector/* TmpVectors */.AA.Vector3[6];
        this._brLinesPoints[0] = math_vector/* TmpVectors */.AA.Vector3[3];
        this._brLinesPoints[1] = math_vector/* TmpVectors */.AA.Vector3[7];
        this._tlLinesPoints[0] = math_vector/* TmpVectors */.AA.Vector3[4];
        this._tlLinesPoints[1] = math_vector/* TmpVectors */.AA.Vector3[8];
        this._blLinesPoints[0] = math_vector/* TmpVectors */.AA.Vector3[5];
        this._blLinesPoints[1] = math_vector/* TmpVectors */.AA.Vector3[9];
    }
    _getInvertViewMatrix() {
        math_vector/* Matrix */.uq.LookAtLHToRef(this._light.position, this._light.position.add(this._light.direction), math_vector/* Vector3 */.Pq.UpReadOnly, this._inverseViewMatrix);
        this._inverseViewMatrix.invertToRef(this._inverseViewMatrix);
        return this._inverseViewMatrix;
    }
}
//# sourceMappingURL=directionalLightFrustumViewer.js.map
;// ./node_modules/@babylonjs/core/Debug/index.js








//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js
var deviceEnums = __webpack_require__(24153);
;// ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceTypes.js

//# sourceMappingURL=deviceTypes.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.js
var deviceSource = __webpack_require__(51314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js + 4 modules
var deviceSourceManager = __webpack_require__(64100);
;// ./node_modules/@babylonjs/core/DeviceInput/index.js




//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/constants.js
var constants = __webpack_require__(96125);
;// ./node_modules/@babylonjs/core/Engines/engineCapabilities.js

//# sourceMappingURL=engineCapabilities.js.map
;// ./node_modules/@babylonjs/core/Engines/instancingAttributeInfo.js

//# sourceMappingURL=instancingAttributeInfo.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/thinEngine.js + 1 modules
var thinEngine = __webpack_require__(86514);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/performanceConfigurator.js
var performanceConfigurator = __webpack_require__(20215);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/renderTargetWrapper.js
var renderTargetWrapper = __webpack_require__(61760);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/drawWrapper.functions.js
var drawWrapper_functions = __webpack_require__(70767);
;// ./node_modules/@babylonjs/core/Engines/nullEngine.js
/* eslint-disable @typescript-eslint/no-unused-vars */








/**
 * Options to create the null engine
 */
class NullEngineOptions {
    constructor() {
        /**
         * Render width (Default: 512)
         */
        this.renderWidth = 512;
        /**
         * Render height (Default: 256)
         */
        this.renderHeight = 256;
        /**
         * Texture size (Default: 512)
         */
        this.textureSize = 512;
        /**
         * If delta time between frames should be constant
         * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
         */
        this.deterministicLockstep = false;
        /**
         * Maximum about of steps between frames (Default: 4)
         * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
         */
        this.lockstepMaxSteps = 4;
    }
}
/**
 * The null engine class provides support for headless version of babylon.js.
 * This can be used in server side scenario or for testing purposes
 */
class NullEngine extends Engines_engine/* Engine */.N {
    /**
     * Gets a boolean indicating that the engine is running in deterministic lock step mode
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
     * @returns true if engine is in deterministic lock step mode
     */
    isDeterministicLockStep() {
        return this._options.deterministicLockstep;
    }
    /**
     * Gets the max steps when engine is running in deterministic lock step
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
     * @returns the max steps
     */
    getLockstepMaxSteps() {
        return this._options.lockstepMaxSteps;
    }
    /**
     * Gets the current hardware scaling level.
     * By default the hardware scaling level is computed from the window device ratio.
     * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.
     * @returns a number indicating the current hardware scaling level
     */
    getHardwareScalingLevel() {
        return 1.0;
    }
    constructor(options = new NullEngineOptions()) {
        super(null);
        if (options.deterministicLockstep === undefined) {
            options.deterministicLockstep = false;
        }
        if (options.timeStep !== undefined) {
            this._timeStep = options.timeStep;
        }
        if (options.lockstepMaxSteps === undefined) {
            options.lockstepMaxSteps = 4;
        }
        this._options = options;
        performanceConfigurator/* PerformanceConfigurator */.I.SetMatrixPrecision(!!options.useHighPrecisionMatrix);
        // Init caps
        // We consider we are on a webgl1 capable device
        this._caps = {
            maxTexturesImageUnits: 16,
            maxVertexTextureImageUnits: 16,
            maxCombinedTexturesImageUnits: 32,
            maxTextureSize: 512,
            maxCubemapTextureSize: 512,
            maxDrawBuffers: 0,
            maxRenderTextureSize: 512,
            maxVertexAttribs: 16,
            maxVaryingVectors: 16,
            maxFragmentUniformVectors: 16,
            maxVertexUniformVectors: 16,
            standardDerivatives: false,
            astc: null,
            pvrtc: null,
            etc1: null,
            etc2: null,
            bptc: null,
            maxAnisotropy: 0,
            uintIndices: false,
            fragmentDepthSupported: false,
            highPrecisionShaderSupported: true,
            colorBufferFloat: false,
            supportFloatTexturesResolve: false,
            rg11b10ufColorRenderable: false,
            textureFloat: false,
            textureFloatLinearFiltering: false,
            textureFloatRender: false,
            textureHalfFloat: false,
            textureHalfFloatLinearFiltering: false,
            textureHalfFloatRender: false,
            textureLOD: false,
            texelFetch: false,
            drawBuffersExtension: false,
            depthTextureExtension: false,
            vertexArrayObject: false,
            instancedArrays: false,
            supportOcclusionQuery: false,
            canUseTimestampForTimerQuery: false,
            maxMSAASamples: 1,
            blendMinMax: false,
            canUseGLInstanceID: false,
            canUseGLVertexID: false,
            supportComputeShaders: false,
            supportSRGBBuffers: false,
            supportTransformFeedbacks: false,
            textureMaxLevel: false,
            texture2DArrayMaxLayerCount: 128,
            disableMorphTargetTexture: false,
            textureNorm16: false,
        };
        this._features = {
            forceBitmapOverHTMLImageElement: false,
            supportRenderAndCopyToLodForFloatTextures: false,
            supportDepthStencilTexture: false,
            supportShadowSamplers: false,
            uniformBufferHardCheckMatrix: false,
            allowTexturePrefiltering: false,
            trackUbosInFrame: false,
            checkUbosContentBeforeUpload: false,
            supportCSM: false,
            basisNeedsPOT: false,
            support3DTextures: false,
            needTypeSuffixInShaderConstants: false,
            supportMSAA: false,
            supportSSAO2: false,
            supportIBLShadows: false,
            supportExtendedTextureFormats: false,
            supportSwitchCaseInShader: false,
            supportSyncTextureRead: false,
            needsInvertingBitmap: false,
            useUBOBindingCache: false,
            needShaderCodeInlining: false,
            needToAlwaysBindUniformBuffers: false,
            supportRenderPasses: true,
            supportSpriteInstancing: false,
            forceVertexBufferStrideAndOffsetMultiple4Bytes: false,
            _checkNonFloatVertexBuffersDontRecreatePipelineContext: false,
            _collectUbosUpdatedInFrame: false,
        };
        if (options.renderingCanvas) {
            this._renderingCanvas = options.renderingCanvas;
        }
        logger/* Logger */.V.Log(`Babylon.js v${Engines_engine/* Engine */.N.Version} - Null engine`);
        // Wrappers
        const theCurrentGlobal = typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : window;
        if (typeof URL === "undefined") {
            theCurrentGlobal.URL = {
                createObjectURL: function () { },
                revokeObjectURL: function () { },
            };
        }
        if (typeof Blob === "undefined") {
            theCurrentGlobal.Blob = function () { };
        }
    }
    /**
     * Creates a vertex buffer
     * @param vertices the data for the vertex buffer
     * @returns the new WebGL static buffer
     */
    createVertexBuffer(vertices) {
        const buffer = new dataBuffer/* DataBuffer */.n();
        buffer.references = 1;
        return buffer;
    }
    /**
     * Creates a new index buffer
     * @param indices defines the content of the index buffer
     * @returns a new webGL buffer
     */
    createIndexBuffer(indices) {
        const buffer = new dataBuffer/* DataBuffer */.n();
        buffer.references = 1;
        return buffer;
    }
    /**
     * Clear the current render buffer or the current render target (if any is set up)
     * @param color defines the color to use
     * @param backBuffer defines if the back buffer must be cleared
     * @param depth defines if the depth buffer must be cleared
     * @param stencil defines if the stencil buffer must be cleared
     */
    clear(color, backBuffer, depth, stencil = false) { }
    /**
     * Gets the current render width
     * @param useScreen defines if screen size must be used (or the current render target if any)
     * @returns a number defining the current render width
     */
    getRenderWidth(useScreen = false) {
        if (!useScreen && this._currentRenderTarget) {
            return this._currentRenderTarget.width;
        }
        return this._options.renderWidth;
    }
    /**
     * Gets the current render height
     * @param useScreen defines if screen size must be used (or the current render target if any)
     * @returns a number defining the current render height
     */
    getRenderHeight(useScreen = false) {
        if (!useScreen && this._currentRenderTarget) {
            return this._currentRenderTarget.height;
        }
        return this._options.renderHeight;
    }
    /**
     * Set the WebGL's viewport
     * @param viewport defines the viewport element to be used
     * @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used
     * @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used
     */
    setViewport(viewport, requiredWidth, requiredHeight) {
        this._cachedViewport = viewport;
    }
    createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context) {
        return {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            __SPECTOR_rebuildProgram: null,
        };
    }
    /**
     * Gets the list of webGL uniform locations associated with a specific program based on a list of uniform names
     * @param pipelineContext defines the pipeline context to use
     * @param uniformsNames defines the list of uniform names
     * @returns an array of webGL uniform locations
     */
    getUniforms(pipelineContext, uniformsNames) {
        return [];
    }
    /**
     * Gets the lsit of active attributes for a given webGL program
     * @param pipelineContext defines the pipeline context to use
     * @param attributesNames defines the list of attribute names to get
     * @returns an array of indices indicating the offset of each attribute
     */
    getAttributes(pipelineContext, attributesNames) {
        return [];
    }
    /**
     * Binds an effect to the webGL context
     * @param effect defines the effect to bind
     */
    bindSamplers(effect) {
        this._currentEffect = null;
    }
    /**
     * Activates an effect, making it the current one (ie. the one used for rendering)
     * @param effect defines the effect to activate
     */
    enableEffect(effect) {
        effect = effect !== null && (0,drawWrapper_functions/* IsWrapper */.E)(effect) ? effect.effect : effect; // get only the effect, we don't need a Wrapper in the WebGL engine
        this._currentEffect = effect;
        if (!effect) {
            return;
        }
        if (effect.onBind) {
            effect.onBind(effect);
        }
        if (effect._onBindObservable) {
            effect._onBindObservable.notifyObservers(effect);
        }
    }
    /**
     * Set various states to the webGL context
     * @param culling defines culling state: true to enable culling, false to disable it
     * @param zOffset defines the value to apply to zOffset (0 by default)
     * @param force defines if states must be applied even if cache is up to date
     * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)
     * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)
     * @param stencil stencil states to set
     * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)
     */
    setState(culling, zOffset = 0, force, reverseSide = false, cullBackFaces, stencil, zOffsetUnits = 0) { }
    /**
     * Set the value of an uniform to an array of int32
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of int32 to store
     * @returns true if value was set
     */
    setIntArray(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of int32 (stored as vec2)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of int32 to store
     * @returns true if value was set
     */
    setIntArray2(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of int32 (stored as vec3)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of int32 to store
     * @returns true if value was set
     */
    setIntArray3(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of int32 (stored as vec4)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of int32 to store
     * @returns true if value was set
     */
    setIntArray4(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of float32
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of float32 to store
     * @returns true if value was set
     */
    setFloatArray(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of float32 (stored as vec2)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of float32 to store
     * @returns true if value was set
     */
    setFloatArray2(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of float32 (stored as vec3)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of float32 to store
     * @returns true if value was set
     */
    setFloatArray3(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of float32 (stored as vec4)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of float32 to store
     * @returns true if value was set
     */
    setFloatArray4(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of number
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of number to store
     * @returns true if value was set
     */
    setArray(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of number (stored as vec2)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of number to store
     * @returns true if value was set
     */
    setArray2(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of number (stored as vec3)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of number to store
     * @returns true if value was set
     */
    setArray3(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of number (stored as vec4)
     * @param uniform defines the webGL uniform location where to store the value
     * @param array defines the array of number to store
     * @returns true if value was set
     */
    setArray4(uniform, array) {
        return true;
    }
    /**
     * Set the value of an uniform to an array of float32 (stored as matrices)
     * @param uniform defines the webGL uniform location where to store the value
     * @param matrices defines the array of float32 to store
     * @returns true if value was set
     */
    setMatrices(uniform, matrices) {
        return true;
    }
    /**
     * Set the value of an uniform to a matrix (3x3)
     * @param uniform defines the webGL uniform location where to store the value
     * @param matrix defines the Float32Array representing the 3x3 matrix to store
     * @returns true if value was set
     */
    setMatrix3x3(uniform, matrix) {
        return true;
    }
    /**
     * Set the value of an uniform to a matrix (2x2)
     * @param uniform defines the webGL uniform location where to store the value
     * @param matrix defines the Float32Array representing the 2x2 matrix to store
     * @returns true if value was set
     */
    setMatrix2x2(uniform, matrix) {
        return true;
    }
    /**
     * Set the value of an uniform to a number (float)
     * @param uniform defines the webGL uniform location where to store the value
     * @param value defines the float number to store
     * @returns true if value was set
     */
    setFloat(uniform, value) {
        return true;
    }
    /**
     * Set the value of an uniform to a vec2
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @returns true if value was set
     */
    setFloat2(uniform, x, y) {
        return true;
    }
    /**
     * Set the value of an uniform to a vec3
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @param z defines the 3rd component of the value
     * @returns true if value was set
     */
    setFloat3(uniform, x, y, z) {
        return true;
    }
    /**
     * Set the value of an uniform to a boolean
     * @param uniform defines the webGL uniform location where to store the value
     * @param bool defines the boolean to store
     * @returns true if value was set
     */
    setBool(uniform, bool) {
        return true;
    }
    /**
     * Set the value of an uniform to a vec4
     * @param uniform defines the webGL uniform location where to store the value
     * @param x defines the 1st component of the value
     * @param y defines the 2nd component of the value
     * @param z defines the 3rd component of the value
     * @param w defines the 4th component of the value
     * @returns true if value was set
     */
    setFloat4(uniform, x, y, z, w) {
        return true;
    }
    /**
     * Sets the current alpha mode
     * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
     * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
     */
    setAlphaMode(mode, noDepthWriteChange = false) {
        if (this._alphaMode === mode) {
            return;
        }
        this.alphaState.alphaBlend = mode !== 0;
        if (!noDepthWriteChange) {
            this.setDepthWrite(mode === 0);
        }
        this._alphaMode = mode;
    }
    /**
     * Bind webGl buffers directly to the webGL context
     * @param vertexBuffers defines the vertex buffer to bind
     * @param indexBuffer defines the index buffer to bind
     * @param effect defines the effect associated with the vertex buffer
     */
    bindBuffers(vertexBuffers, indexBuffer, effect) { }
    /**
     * Force the entire cache to be cleared
     * You should not have to use this function unless your engine needs to share the webGL context with another engine
     * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)
     */
    wipeCaches(bruteForce) {
        if (this.preventCacheWipeBetweenFrames) {
            return;
        }
        this.resetTextureCache();
        this._currentEffect = null;
        if (bruteForce) {
            this._currentProgram = null;
            this._stencilStateComposer.reset();
            this.depthCullingState.reset();
            this.alphaState.reset();
        }
        this._cachedVertexBuffers = null;
        this._cachedIndexBuffer = null;
        this._cachedEffectForVertexBuffers = null;
    }
    /**
     * Send a draw order
     * @param useTriangles defines if triangles must be used to draw (else wireframe will be used)
     * @param indexStart defines the starting index
     * @param indexCount defines the number of index to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    draw(useTriangles, indexStart, indexCount, instancesCount) { }
    /**
     * Draw a list of indexed primitives
     * @param fillMode defines the primitive to use
     * @param indexStart defines the starting index
     * @param indexCount defines the number of index to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawElementsType(fillMode, indexStart, indexCount, instancesCount) { }
    /**
     * Draw a list of unindexed primitives
     * @param fillMode defines the primitive to use
     * @param verticesStart defines the index of first vertex to draw
     * @param verticesCount defines the count of vertices to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawArraysType(fillMode, verticesStart, verticesCount, instancesCount) { }
    /** @internal */
    _createTexture() {
        return {};
    }
    /**
     * @internal
     */
    _releaseTexture(texture) { }
    /**
     * Usually called from Texture.ts.
     * Passed information to create a WebGLTexture
     * @param urlArg defines a value which contains one of the following:
     * * A conventional http URL, e.g. 'http://...' or 'file://...'
     * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
     * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
     * @param noMipmap defines a boolean indicating that no mipmaps shall be generated.  Ignored for compressed textures.  They must be in the file
     * @param invertY when true, image is flipped when loaded.  You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
     * @param scene needed for loading to the correct scene
     * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
     * @param onLoad optional callback to be called upon successful completion
     * @param onError optional callback to be called upon failure
     * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
     * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
     * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
     * @param forcedExtension defines the extension to use to pick the right loader
     * @param mimeType defines an optional mime type
     * @returns a InternalTexture for assignment back into BABYLON.Texture
     */
    createTexture(urlArg, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType) {
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 1 /* InternalTextureSource.Url */);
        const url = String(urlArg);
        texture.url = url;
        texture.generateMipMaps = !noMipmap;
        texture.samplingMode = samplingMode;
        texture.invertY = invertY;
        texture.baseWidth = this._options.textureSize;
        texture.baseHeight = this._options.textureSize;
        texture.width = this._options.textureSize;
        texture.height = this._options.textureSize;
        if (format) {
            texture.format = format;
        }
        texture.isReady = true;
        if (onLoad) {
            setTimeout(() => {
                onLoad(texture);
            });
        }
        this._internalTexturesCache.push(texture);
        return texture;
    }
    /**
     * @internal
     */
    _createHardwareRenderTargetWrapper(isMulti, isCube, size) {
        const rtWrapper = new renderTargetWrapper/* RenderTargetWrapper */.v(isMulti, isCube, size, this);
        this._renderTargetWrapperCache.push(rtWrapper);
        return rtWrapper;
    }
    /**
     * Creates a new render target wrapper
     * @param size defines the size of the texture
     * @param options defines the options used to create the texture
     * @returns a new render target wrapper
     */
    createRenderTargetTexture(size, options) {
        const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size);
        const fullOptions = {};
        if (options !== undefined && typeof options === "object") {
            fullOptions.generateMipMaps = options.generateMipMaps;
            fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
            fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;
            fullOptions.type = options.type === undefined ? 0 : options.type;
            fullOptions.samplingMode = options.samplingMode === undefined ? 3 : options.samplingMode;
        }
        else {
            fullOptions.generateMipMaps = options;
            fullOptions.generateDepthBuffer = true;
            fullOptions.generateStencilBuffer = false;
            fullOptions.type = 0;
            fullOptions.samplingMode = 3;
        }
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 5 /* InternalTextureSource.RenderTarget */);
        const width = size.width || size;
        const height = size.height || size;
        rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;
        rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false;
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.width = width;
        texture.height = height;
        texture.isReady = true;
        texture.samples = 1;
        texture.generateMipMaps = fullOptions.generateMipMaps ? true : false;
        texture.samplingMode = fullOptions.samplingMode;
        texture.type = fullOptions.type;
        this._internalTexturesCache.push(texture);
        return rtWrapper;
    }
    /**
     * Creates a new render target wrapper
     * @param size defines the size of the texture
     * @param options defines the options used to create the texture
     * @returns a new render target wrapper
     */
    createRenderTargetCubeTexture(size, options) {
        const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size);
        const fullOptions = {
            generateMipMaps: true,
            generateDepthBuffer: true,
            generateStencilBuffer: false,
            type: 0,
            samplingMode: 3,
            format: 5,
            ...options,
        };
        fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;
        if (fullOptions.type === 1 && !this._caps.textureFloatLinearFiltering) {
            // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
            fullOptions.samplingMode = 1;
        }
        else if (fullOptions.type === 2 && !this._caps.textureHalfFloatLinearFiltering) {
            // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
            fullOptions.samplingMode = 1;
        }
        rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;
        rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false;
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 5 /* InternalTextureSource.RenderTarget */);
        texture.baseWidth = size;
        texture.baseHeight = size;
        texture.width = size;
        texture.height = size;
        texture.isReady = true;
        texture.isCube = true;
        texture.samples = 1;
        texture.generateMipMaps = fullOptions.generateMipMaps ? true : false;
        texture.samplingMode = fullOptions.samplingMode;
        texture.type = fullOptions.type;
        this._internalTexturesCache.push(texture);
        return rtWrapper;
    }
    /**
     * Update the sampling mode of a given texture
     * @param samplingMode defines the required sampling mode
     * @param texture defines the texture to update
     */
    updateTextureSamplingMode(samplingMode, texture) {
        texture.samplingMode = samplingMode;
    }
    /**
     * Creates a raw texture
     * @param data defines the data to store in the texture
     * @param width defines the width of the texture
     * @param height defines the height of the texture
     * @param format defines the format of the data
     * @param generateMipMaps defines if the engine should generate the mip levels
     * @param invertY defines if data must be stored with Y axis inverted
     * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
     * @param compression defines the compression used (null by default)
     * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     * @returns the raw texture inside an InternalTexture
     */
    createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = false) {
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 3 /* InternalTextureSource.Raw */);
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.width = width;
        texture.height = height;
        texture.format = format;
        texture.generateMipMaps = generateMipMaps;
        texture.samplingMode = samplingMode;
        texture.invertY = invertY;
        texture._compression = compression;
        texture.type = type;
        texture._useSRGBBuffer = useSRGBBuffer;
        if (!this._doNotHandleContextLost) {
            texture._bufferView = data;
        }
        return texture;
    }
    /**
     * Update a raw texture
     * @param texture defines the texture to update
     * @param data defines the data to store in the texture
     * @param format defines the format of the data
     * @param invertY defines if data must be stored with Y axis inverted
     * @param compression defines the compression used (null by default)
     * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_BYTE by default)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     */
    updateRawTexture(texture, data, format, invertY, compression = null, type = 0, useSRGBBuffer = false) {
        if (texture) {
            texture._bufferView = data;
            texture.format = format;
            texture.invertY = invertY;
            texture._compression = compression;
            texture.type = type;
            texture._useSRGBBuffer = useSRGBBuffer;
        }
    }
    /**
     * Binds the frame buffer to the specified texture.
     * @param rtWrapper The render target wrapper to render to
     * @param faceIndex The face of the texture to render to in case of cube texture
     * @param requiredWidth The width of the target to render to
     * @param requiredHeight The height of the target to render to
     * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true
     */
    bindFramebuffer(rtWrapper, faceIndex, requiredWidth, requiredHeight, forceFullscreenViewport) {
        if (this._currentRenderTarget) {
            this.unBindFramebuffer(this._currentRenderTarget);
        }
        this._currentRenderTarget = rtWrapper;
        this._currentFramebuffer = null;
        if (this._cachedViewport && !forceFullscreenViewport) {
            this.setViewport(this._cachedViewport, requiredWidth, requiredHeight);
        }
    }
    /**
     * Unbind the current render target texture from the webGL context
     * @param rtWrapper defines the render target wrapper to unbind
     * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
     * @param onBeforeUnbind defines a function which will be called before the effective unbind
     */
    unBindFramebuffer(rtWrapper, disableGenerateMipMaps = false, onBeforeUnbind) {
        this._currentRenderTarget = null;
        if (onBeforeUnbind) {
            onBeforeUnbind();
        }
        this._currentFramebuffer = null;
    }
    /**
     * Creates a dynamic vertex buffer
     * @param vertices the data for the dynamic vertex buffer
     * @returns the new WebGL dynamic buffer
     */
    createDynamicVertexBuffer(vertices) {
        const buffer = new dataBuffer/* DataBuffer */.n();
        buffer.references = 1;
        buffer.capacity = 1;
        return buffer;
    }
    /**
     * Update the content of a dynamic texture
     * @param texture defines the texture to update
     * @param canvas defines the canvas containing the source
     * @param invertY defines if data must be stored with Y axis inverted
     * @param premulAlpha defines if alpha is stored as premultiplied
     * @param format defines the format of the data
     */
    updateDynamicTexture(texture, canvas, invertY, premulAlpha = false, format) { }
    /**
     * Gets a boolean indicating if all created effects are ready
     * @returns true if all effects are ready
     */
    areAllEffectsReady() {
        return true;
    }
    /**
     * @internal
     * Get the current error code of the webGL context
     * @returns the error code
     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError
     */
    getError() {
        return 0;
    }
    /** @internal */
    _getUnpackAlignement() {
        return 1;
    }
    /**
     * @internal
     */
    _unpackFlipY(value) { }
    /**
     * Update a dynamic index buffer
     * @param indexBuffer defines the target index buffer
     * @param indices defines the data to update
     * @param offset defines the offset in the target index buffer where update should start
     */
    updateDynamicIndexBuffer(indexBuffer, indices, offset = 0) { }
    /**
     * Updates a dynamic vertex buffer.
     * @param vertexBuffer the vertex buffer to update
     * @param vertices the data used to update the vertex buffer
     * @param byteOffset the byte offset of the data (optional)
     * @param byteLength the byte length of the data (optional)
     */
    updateDynamicVertexBuffer(vertexBuffer, vertices, byteOffset, byteLength) { }
    /**
     * @internal
     */
    _bindTextureDirectly(target, texture) {
        if (this._boundTexturesCache[this._activeChannel] !== texture) {
            this._boundTexturesCache[this._activeChannel] = texture;
            return true;
        }
        return false;
    }
    /**
     * @internal
     */
    _bindTexture(channel, texture) {
        if (channel < 0) {
            return;
        }
        this._bindTextureDirectly(0, texture);
    }
    _deleteBuffer(buffer) { }
    /**
     * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled
     */
    releaseEffects() { }
    displayLoadingUI() { }
    hideLoadingUI() { }
    set loadingUIText(_) { }
    flushFramebuffer() { }
    /**
     * @internal
     */
    _uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, data, faceIndex = 0, lod = 0) { }
    /**
     * @internal
     */
    _uploadDataToTextureDirectly(texture, imageData, faceIndex = 0, lod = 0) { }
    /**
     * @internal
     */
    _uploadArrayBufferViewToTexture(texture, imageData, faceIndex = 0, lod = 0) { }
    /**
     * @internal
     */
    _uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) { }
}
//# sourceMappingURL=nullEngine.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.cubeTexture.js
var abstractEngine_cubeTexture = __webpack_require__(69195);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.loadingScreen.js
var abstractEngine_loadingScreen = __webpack_require__(29967);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.dom.js
var abstractEngine_dom = __webpack_require__(28019);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.states.js
var abstractEngine_states = __webpack_require__(46125);
;// ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.query.js


/** @internal */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _OcclusionDataStorage {
    constructor() {
        /** @internal */
        this.occlusionInternalRetryCounter = 0;
        /** @internal */
        this.isOcclusionQueryInProgress = false;
        /** @internal */
        this.isOccluded = false;
        /** @internal */
        this.occlusionRetryCount = -1;
        /** @internal */
        this.occlusionType = abstractMesh/* AbstractMesh */.u.OCCLUSION_TYPE_NONE;
        /** @internal */
        this.occlusionQueryAlgorithmType = abstractMesh/* AbstractMesh */.u.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;
        /** @internal */
        this.forceRenderingWhenOccluded = false;
    }
}
abstractEngine/* AbstractEngine */.$.prototype.getGPUFrameTimeCounter = function () {
    return null;
};
abstractEngine/* AbstractEngine */.$.prototype.captureGPUFrameTime = function (value) {
    // Do nothing. Must be implemented by child classes
};
abstractEngine/* AbstractEngine */.$.prototype.createQuery = function () {
    return null;
};
abstractEngine/* AbstractEngine */.$.prototype.deleteQuery = function (query) {
    // Do nothing. Must be implemented by child classes
    return this;
};
abstractEngine/* AbstractEngine */.$.prototype.isQueryResultAvailable = function (query) {
    // Do nothing. Must be implemented by child classes
    return false;
};
abstractEngine/* AbstractEngine */.$.prototype.getQueryResult = function (query) {
    // Do nothing. Must be implemented by child classes
    return 0;
};
abstractEngine/* AbstractEngine */.$.prototype.beginOcclusionQuery = function (algorithmType, query) {
    // Do nothing. Must be implemented by child classes
    return false;
};
abstractEngine/* AbstractEngine */.$.prototype.endOcclusionQuery = function (algorithmType) {
    // Do nothing. Must be implemented by child classes
    return this;
};
Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "isOcclusionQueryInProgress", {
    get: function () {
        return this._occlusionDataStorage.isOcclusionQueryInProgress;
    },
    set: function (value) {
        this._occlusionDataStorage.isOcclusionQueryInProgress = value;
    },
    enumerable: false,
    configurable: true,
});
Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "_occlusionDataStorage", {
    get: function () {
        if (!this.__occlusionDataStorage) {
            this.__occlusionDataStorage = new _OcclusionDataStorage();
        }
        return this.__occlusionDataStorage;
    },
    enumerable: false,
    configurable: true,
});
Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "isOccluded", {
    get: function () {
        return this._occlusionDataStorage.isOccluded;
    },
    set: function (value) {
        this._occlusionDataStorage.isOccluded = value;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "occlusionQueryAlgorithmType", {
    get: function () {
        return this._occlusionDataStorage.occlusionQueryAlgorithmType;
    },
    set: function (value) {
        this._occlusionDataStorage.occlusionQueryAlgorithmType = value;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "occlusionType", {
    get: function () {
        return this._occlusionDataStorage.occlusionType;
    },
    set: function (value) {
        this._occlusionDataStorage.occlusionType = value;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "occlusionRetryCount", {
    get: function () {
        return this._occlusionDataStorage.occlusionRetryCount;
    },
    set: function (value) {
        this._occlusionDataStorage.occlusionRetryCount = value;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "forceRenderingWhenOccluded", {
    get: function () {
        return this._occlusionDataStorage.forceRenderingWhenOccluded;
    },
    set: function (value) {
        this._occlusionDataStorage.forceRenderingWhenOccluded = value;
    },
    enumerable: true,
    configurable: true,
});
// We also need to update AbstractMesh as there is a portion of the code there
abstractMesh/* AbstractMesh */.u.prototype._checkOcclusionQuery = function () {
    const dataStorage = this._occlusionDataStorage;
    if (dataStorage.occlusionType === abstractMesh/* AbstractMesh */.u.OCCLUSION_TYPE_NONE) {
        dataStorage.isOccluded = false;
        return false;
    }
    const engine = this.getEngine();
    if (!engine.getCaps().supportOcclusionQuery) {
        dataStorage.isOccluded = false;
        return false;
    }
    if (!engine.isQueryResultAvailable) {
        // Occlusion query where not referenced
        dataStorage.isOccluded = false;
        return false;
    }
    if (this.isOcclusionQueryInProgress && this._occlusionQuery !== null && this._occlusionQuery !== undefined) {
        const isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
        if (isOcclusionQueryAvailable) {
            const occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
            dataStorage.isOcclusionQueryInProgress = false;
            dataStorage.occlusionInternalRetryCounter = 0;
            dataStorage.isOccluded = occlusionQueryResult > 0 ? false : true;
        }
        else {
            dataStorage.occlusionInternalRetryCounter++;
            if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) {
                dataStorage.isOcclusionQueryInProgress = false;
                dataStorage.occlusionInternalRetryCounter = 0;
                // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
                // if strict continue the last state of the object.
                dataStorage.isOccluded = dataStorage.occlusionType === abstractMesh/* AbstractMesh */.u.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
            }
            else {
                return dataStorage.occlusionType === abstractMesh/* AbstractMesh */.u.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
            }
        }
    }
    const scene = this.getScene();
    if (scene.getBoundingBoxRenderer) {
        const occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
        if (this._occlusionQuery === null) {
            this._occlusionQuery = engine.createQuery();
        }
        if (this._occlusionQuery && engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery)) {
            occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
            engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType);
            this._occlusionDataStorage.isOcclusionQueryInProgress = true;
        }
    }
    return dataStorage.isOccluded;
};
//# sourceMappingURL=abstractEngine.query.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.renderPass.js
var abstractEngine_renderPass = __webpack_require__(97298);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.texture.js
var abstractEngine_texture = __webpack_require__(9696);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.alpha.js
var abstractEngine_alpha = __webpack_require__(94363);
;// ./node_modules/@babylonjs/core/Engines/AbstractEngine/abstractEngine.views.js


/**
 * Class used to define an additional view for the engine
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/multiCanvas
 */
class EngineView {
}
const _onBeforeViewRenderObservable = new Misc_observable/* Observable */.cP();
const _onAfterViewRenderObservable = new Misc_observable/* Observable */.cP();
Object.defineProperty(abstractEngine/* AbstractEngine */.$.prototype, "onBeforeViewRenderObservable", {
    get: function () {
        return _onBeforeViewRenderObservable;
    },
});
Object.defineProperty(abstractEngine/* AbstractEngine */.$.prototype, "onAfterViewRenderObservable", {
    get: function () {
        return _onAfterViewRenderObservable;
    },
});
Object.defineProperty(abstractEngine/* AbstractEngine */.$.prototype, "inputElement", {
    get: function () {
        return this._inputElement;
    },
    set: function (value) {
        if (this._inputElement !== value) {
            this._inputElement = value;
            this._onEngineViewChanged?.();
        }
    },
});
abstractEngine/* AbstractEngine */.$.prototype.getInputElement = function () {
    return this.inputElement || this.getRenderingCanvas();
};
abstractEngine/* AbstractEngine */.$.prototype.registerView = function (canvas, camera, clearBeforeCopy) {
    if (!this.views) {
        this.views = [];
    }
    for (const view of this.views) {
        if (view.target === canvas) {
            return view;
        }
    }
    const masterCanvas = this.getRenderingCanvas();
    if (masterCanvas) {
        canvas.width = masterCanvas.width;
        canvas.height = masterCanvas.height;
    }
    const newView = { target: canvas, camera, clearBeforeCopy, enabled: true, id: (Math.random() * 100000).toFixed() };
    this.views.push(newView);
    if (camera && !Array.isArray(camera)) {
        camera.onDisposeObservable.add(() => {
            this.unRegisterView(canvas);
        });
    }
    return newView;
};
abstractEngine/* AbstractEngine */.$.prototype.unRegisterView = function (canvas) {
    if (!this.views || this.views.length === 0) {
        return this;
    }
    for (const view of this.views) {
        if (view.target === canvas) {
            const index = this.views.indexOf(view);
            if (index !== -1) {
                this.views.splice(index, 1);
            }
            break;
        }
    }
    return this;
};
abstractEngine/* AbstractEngine */.$.prototype._renderViewStep = function (view) {
    const canvas = view.target;
    const context = canvas.getContext("2d");
    if (!context) {
        return true;
    }
    const parent = this.getRenderingCanvas();
    _onBeforeViewRenderObservable.notifyObservers(view);
    const camera = view.camera;
    let previewCamera = null;
    let previewCameras = null;
    let scene = null;
    if (camera) {
        scene = Array.isArray(camera) ? camera[0].getScene() : camera.getScene();
        previewCamera = scene.activeCamera;
        previewCameras = scene.activeCameras;
        if (Array.isArray(camera)) {
            scene.activeCameras = camera;
        }
        else {
            scene.activeCamera = camera;
            scene.activeCameras = null;
        }
    }
    this.activeView = view;
    if (view.customResize) {
        view.customResize(canvas);
    }
    else {
        // Set sizes
        const width = Math.floor(canvas.clientWidth / this._hardwareScalingLevel);
        const height = Math.floor(canvas.clientHeight / this._hardwareScalingLevel);
        const dimsChanged = width !== canvas.width || parent.width !== canvas.width || height !== canvas.height || parent.height !== canvas.height;
        if (canvas.clientWidth && canvas.clientHeight && dimsChanged) {
            canvas.width = width;
            canvas.height = height;
            this.setSize(width, height);
        }
    }
    if (!parent.width || !parent.height) {
        return false;
    }
    // Render the frame
    this._renderFrame();
    this.flushFramebuffer();
    // Copy to target
    if (view.clearBeforeCopy) {
        context.clearRect(0, 0, parent.width, parent.height);
    }
    context.drawImage(parent, 0, 0);
    // Restore
    if (scene) {
        scene.activeCameras = previewCameras;
        scene.activeCamera = previewCamera;
    }
    _onAfterViewRenderObservable.notifyObservers(view);
    return true;
};
abstractEngine/* AbstractEngine */.$.prototype._renderViews = function () {
    if (!this.views || this.views.length === 0) {
        return false;
    }
    const parent = this.getRenderingCanvas();
    if (!parent) {
        return false;
    }
    let inputElementView;
    for (const view of this.views) {
        if (!view.enabled) {
            continue;
        }
        const canvas = view.target;
        // Always render the view correspondent to the inputElement for last
        if (canvas === this.inputElement) {
            inputElementView = view;
            continue;
        }
        if (!this._renderViewStep(view)) {
            return false;
        }
    }
    if (inputElementView) {
        if (!this._renderViewStep(inputElementView)) {
            return false;
        }
    }
    this.activeView = null;
    return true;
};
//# sourceMappingURL=abstractEngine.views.js.map
;// ./node_modules/@babylonjs/core/Engines/AbstractEngine/index.js
/* eslint-disable import/export */









//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.alpha.js
var engine_alpha = __webpack_require__(41843);
;// ./node_modules/@babylonjs/core/Engines/Extensions/engine.debugging.js
/* eslint-disable @typescript-eslint/no-unused-vars */

abstractEngine/* AbstractEngine */.$.prototype._debugPushGroup = function (groupName, targetObject) { };
abstractEngine/* AbstractEngine */.$.prototype._debugPopGroup = function (targetObject) { };
abstractEngine/* AbstractEngine */.$.prototype._debugInsertMarker = function (text, targetObject) { };
abstractEngine/* AbstractEngine */.$.prototype._debugFlushPendingCommands = function () { };
//# sourceMappingURL=engine.debugging.js.map
;// ./node_modules/@babylonjs/core/Instrumentation/timeToken.js
/**
 * @internal
 **/
// eslint-disable-next-line @typescript-eslint/naming-convention
class _TimeToken {
    constructor() {
        this._timeElapsedQueryEnded = false;
    }
}
//# sourceMappingURL=timeToken.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/perfCounter.js
var perfCounter = __webpack_require__(24296);
;// ./node_modules/@babylonjs/core/Engines/Extensions/engine.query.js





Engines_engine/* Engine */.N.prototype.createQuery = function () {
    const query = this._gl.createQuery();
    if (!query) {
        throw new Error("Unable to create Occlusion Query");
    }
    return query;
};
Engines_engine/* Engine */.N.prototype.deleteQuery = function (query) {
    this._gl.deleteQuery(query);
    return this;
};
Engines_engine/* Engine */.N.prototype.isQueryResultAvailable = function (query) {
    return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT_AVAILABLE);
};
Engines_engine/* Engine */.N.prototype.getQueryResult = function (query) {
    return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT);
};
Engines_engine/* Engine */.N.prototype.beginOcclusionQuery = function (algorithmType, query) {
    const glAlgorithm = this._getGlAlgorithmType(algorithmType);
    this._gl.beginQuery(glAlgorithm, query);
    return true;
};
Engines_engine/* Engine */.N.prototype.endOcclusionQuery = function (algorithmType) {
    const glAlgorithm = this._getGlAlgorithmType(algorithmType);
    this._gl.endQuery(glAlgorithm);
    return this;
};
Engines_engine/* Engine */.N.prototype._createTimeQuery = function () {
    const timerQuery = this.getCaps().timerQuery;
    if (timerQuery.createQueryEXT) {
        return timerQuery.createQueryEXT();
    }
    return this.createQuery();
};
Engines_engine/* Engine */.N.prototype._deleteTimeQuery = function (query) {
    const timerQuery = this.getCaps().timerQuery;
    if (timerQuery.deleteQueryEXT) {
        timerQuery.deleteQueryEXT(query);
        return;
    }
    this.deleteQuery(query);
};
Engines_engine/* Engine */.N.prototype._getTimeQueryResult = function (query) {
    const timerQuery = this.getCaps().timerQuery;
    if (timerQuery.getQueryObjectEXT) {
        return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_EXT);
    }
    return this.getQueryResult(query);
};
Engines_engine/* Engine */.N.prototype._getTimeQueryAvailability = function (query) {
    const timerQuery = this.getCaps().timerQuery;
    if (timerQuery.getQueryObjectEXT) {
        return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_AVAILABLE_EXT);
    }
    return this.isQueryResultAvailable(query);
};
Engines_engine/* Engine */.N.prototype.startTimeQuery = function () {
    const caps = this.getCaps();
    const timerQuery = caps.timerQuery;
    if (!timerQuery) {
        return null;
    }
    const token = new _TimeToken();
    this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT);
    if (caps.canUseTimestampForTimerQuery) {
        token._startTimeQuery = this._createTimeQuery();
        if (token._startTimeQuery) {
            timerQuery.queryCounterEXT(token._startTimeQuery, timerQuery.TIMESTAMP_EXT);
        }
    }
    else {
        if (this._currentNonTimestampToken) {
            return this._currentNonTimestampToken;
        }
        token._timeElapsedQuery = this._createTimeQuery();
        if (token._timeElapsedQuery) {
            if (timerQuery.beginQueryEXT) {
                timerQuery.beginQueryEXT(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery);
            }
            else {
                this._gl.beginQuery(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery);
            }
        }
        this._currentNonTimestampToken = token;
    }
    return token;
};
Engines_engine/* Engine */.N.prototype.endTimeQuery = function (token) {
    const caps = this.getCaps();
    const timerQuery = caps.timerQuery;
    if (!timerQuery || !token) {
        return -1;
    }
    if (caps.canUseTimestampForTimerQuery) {
        if (!token._startTimeQuery) {
            return -1;
        }
        if (!token._endTimeQuery) {
            token._endTimeQuery = this._createTimeQuery();
            if (token._endTimeQuery) {
                timerQuery.queryCounterEXT(token._endTimeQuery, timerQuery.TIMESTAMP_EXT);
            }
        }
    }
    else if (!token._timeElapsedQueryEnded) {
        if (!token._timeElapsedQuery) {
            return -1;
        }
        if (timerQuery.endQueryEXT) {
            timerQuery.endQueryEXT(timerQuery.TIME_ELAPSED_EXT);
        }
        else {
            this._gl.endQuery(timerQuery.TIME_ELAPSED_EXT);
            this._currentNonTimestampToken = null;
        }
        token._timeElapsedQueryEnded = true;
    }
    const disjoint = this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT);
    let available = false;
    if (token._endTimeQuery) {
        available = this._getTimeQueryAvailability(token._endTimeQuery);
    }
    else if (token._timeElapsedQuery) {
        available = this._getTimeQueryAvailability(token._timeElapsedQuery);
    }
    if (available && !disjoint) {
        let result = 0;
        if (caps.canUseTimestampForTimerQuery) {
            if (!token._startTimeQuery || !token._endTimeQuery) {
                return -1;
            }
            const timeStart = this._getTimeQueryResult(token._startTimeQuery);
            const timeEnd = this._getTimeQueryResult(token._endTimeQuery);
            result = timeEnd - timeStart;
            this._deleteTimeQuery(token._startTimeQuery);
            this._deleteTimeQuery(token._endTimeQuery);
            token._startTimeQuery = null;
            token._endTimeQuery = null;
        }
        else {
            if (!token._timeElapsedQuery) {
                return -1;
            }
            result = this._getTimeQueryResult(token._timeElapsedQuery);
            this._deleteTimeQuery(token._timeElapsedQuery);
            token._timeElapsedQuery = null;
            token._timeElapsedQueryEnded = false;
        }
        return result;
    }
    return -1;
};
Engines_engine/* Engine */.N.prototype._captureGPUFrameTime = false;
Engines_engine/* Engine */.N.prototype._gpuFrameTime = new perfCounter/* PerfCounter */.A();
Engines_engine/* Engine */.N.prototype.getGPUFrameTimeCounter = function () {
    return this._gpuFrameTime;
};
Engines_engine/* Engine */.N.prototype.captureGPUFrameTime = function (value) {
    if (value === this._captureGPUFrameTime) {
        return;
    }
    this._captureGPUFrameTime = value;
    if (value) {
        this._onBeginFrameObserver = this.onBeginFrameObservable.add(() => {
            if (!this._gpuFrameTimeToken) {
                this._gpuFrameTimeToken = this.startTimeQuery();
            }
        });
        this._onEndFrameObserver = this.onEndFrameObservable.add(() => {
            if (!this._gpuFrameTimeToken) {
                return;
            }
            const time = this.endTimeQuery(this._gpuFrameTimeToken);
            if (time > -1) {
                this._gpuFrameTimeToken = null;
                this._gpuFrameTime.fetchNewFrame();
                this._gpuFrameTime.addCount(time, true);
            }
        });
    }
    else {
        this.onBeginFrameObservable.remove(this._onBeginFrameObserver);
        this._onBeginFrameObserver = null;
        this.onEndFrameObservable.remove(this._onEndFrameObserver);
        this._onEndFrameObserver = null;
    }
};
Engines_engine/* Engine */.N.prototype._getGlAlgorithmType = function (algorithmType) {
    return algorithmType === abstractMesh/* AbstractMesh */.u.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
};
//# sourceMappingURL=engine.query.js.map
;// ./node_modules/@babylonjs/core/Engines/Extensions/engine.transformFeedback.js

/** @internal */
// eslint-disable-next-line no-var
var _forceTransformFeedbackToBundle = true;
Engines_engine/* Engine */.N.prototype.createTransformFeedback = function () {
    const transformFeedback = this._gl.createTransformFeedback();
    if (!transformFeedback) {
        throw new Error("Unable to create Transform Feedback");
    }
    return transformFeedback;
};
Engines_engine/* Engine */.N.prototype.deleteTransformFeedback = function (value) {
    this._gl.deleteTransformFeedback(value);
};
Engines_engine/* Engine */.N.prototype.bindTransformFeedback = function (value) {
    this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK, value);
};
Engines_engine/* Engine */.N.prototype.beginTransformFeedback = function (usePoints = true) {
    this._gl.beginTransformFeedback(usePoints ? this._gl.POINTS : this._gl.TRIANGLES);
};
Engines_engine/* Engine */.N.prototype.endTransformFeedback = function () {
    this._gl.endTransformFeedback();
};
Engines_engine/* Engine */.N.prototype.setTranformFeedbackVaryings = function (program, value) {
    this._gl.transformFeedbackVaryings(program, value, this._gl.INTERLEAVED_ATTRIBS);
};
Engines_engine/* Engine */.N.prototype.bindTransformFeedbackBuffer = function (value) {
    this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, value ? value.underlyingResource : null);
};
Engines_engine/* Engine */.N.prototype.readTransformFeedbackBuffer = function (target) {
    this._gl.getBufferSubData(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, target);
};
//# sourceMappingURL=engine.transformFeedback.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.rawTexture.js
var engine_rawTexture = __webpack_require__(52426);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicTexture.js
var engine_dynamicTexture = __webpack_require__(27079);
;// ./node_modules/@babylonjs/core/Engines/Extensions/engine.videoTexture.js


thinEngine.ThinEngine.prototype.updateVideoTexture = function (texture, video, invertY) {
    if (!texture || texture._isDisabled) {
        return;
    }
    const glformat = this._getInternalFormat(texture.format);
    const internalFormat = this._getRGBABufferInternalSizedFormat(0, texture.format);
    const wasPreviouslyBound = this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);
    this._unpackFlipY(!invertY); // Video are upside down by default
    try {
        // Testing video texture support
        if (this._videoTextureSupported === undefined) {
            // clear old errors just in case.
            this._gl.getError();
            this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, video);
            if (this._gl.getError() !== 0) {
                this._videoTextureSupported = false;
            }
            else {
                this._videoTextureSupported = true;
            }
        }
        // Copy video through the current working canvas if video texture is not supported
        if (!this._videoTextureSupported) {
            if (!texture._workingCanvas) {
                texture._workingCanvas = this.createCanvas(texture.width, texture.height);
                const context = texture._workingCanvas.getContext("2d");
                if (!context) {
                    throw new Error("Unable to get 2d context");
                }
                texture._workingContext = context;
                texture._workingCanvas.width = texture.width;
                texture._workingCanvas.height = texture.height;
            }
            texture._workingContext.clearRect(0, 0, texture.width, texture.height);
            texture._workingContext.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, texture.width, texture.height);
            this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, texture._workingCanvas);
        }
        else {
            this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, video);
        }
        if (texture.generateMipMaps) {
            this._gl.generateMipmap(this._gl.TEXTURE_2D);
        }
        if (!wasPreviouslyBound) {
            this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
        }
        //    this.resetTextureCache();
        texture.isReady = true;
    }
    catch (ex) {
        // Something unexpected
        // Let's disable the texture
        texture._isDisabled = true;
    }
};
//# sourceMappingURL=engine.videoTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/Extensions/engine.multiRender.js




thinEngine.ThinEngine.prototype.restoreSingleAttachment = function () {
    const gl = this._gl;
    this.bindAttachments([gl.BACK]);
};
thinEngine.ThinEngine.prototype.restoreSingleAttachmentForRenderTarget = function () {
    const gl = this._gl;
    this.bindAttachments([gl.COLOR_ATTACHMENT0]);
};
thinEngine.ThinEngine.prototype.buildTextureLayout = function (textureStatus) {
    const gl = this._gl;
    const result = [];
    for (let i = 0; i < textureStatus.length; i++) {
        if (textureStatus[i]) {
            result.push(gl["COLOR_ATTACHMENT" + i]);
        }
        else {
            result.push(gl.NONE);
        }
    }
    return result;
};
thinEngine.ThinEngine.prototype.bindAttachments = function (attachments) {
    const gl = this._gl;
    gl.drawBuffers(attachments);
};
thinEngine.ThinEngine.prototype.unBindMultiColorAttachmentFramebuffer = function (rtWrapper, disableGenerateMipMaps = false, onBeforeUnbind) {
    this._currentRenderTarget = null;
    if (!rtWrapper.disableAutomaticMSAAResolve) {
        this.resolveMultiFramebuffer(rtWrapper);
    }
    if (!disableGenerateMipMaps) {
        this.generateMipMapsMultiFramebuffer(rtWrapper);
    }
    if (onBeforeUnbind) {
        if (rtWrapper._MSAAFramebuffer) {
            // Bind the correct framebuffer
            this._bindUnboundFramebuffer(rtWrapper._framebuffer);
        }
        onBeforeUnbind();
    }
    this._bindUnboundFramebuffer(null);
};
thinEngine.ThinEngine.prototype.createMultipleRenderTarget = function (size, options, initializeBuffers = true) {
    let generateMipMaps = false;
    let generateDepthBuffer = true;
    let generateStencilBuffer = false;
    let generateDepthTexture = false;
    let depthTextureFormat = undefined;
    let textureCount = 1;
    let samples = 1;
    const defaultType = 0;
    const defaultSamplingMode = 3;
    const defaultUseSRGBBuffer = false;
    const defaultFormat = 5;
    const defaultTarget = 3553;
    let types = [];
    let samplingModes = [];
    let useSRGBBuffers = [];
    let formats = [];
    let targets = [];
    let faceIndex = [];
    let layerIndex = [];
    let layers = [];
    let labels = [];
    let dontCreateTextures = false;
    const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size);
    if (options !== undefined) {
        generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps;
        generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
        generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer;
        generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture;
        textureCount = options.textureCount ?? 1;
        samples = options.samples ?? samples;
        types = options.types || types;
        samplingModes = options.samplingModes || samplingModes;
        useSRGBBuffers = options.useSRGBBuffers || useSRGBBuffers;
        formats = options.formats || formats;
        targets = options.targetTypes || targets;
        faceIndex = options.faceIndex || faceIndex;
        layerIndex = options.layerIndex || layerIndex;
        layers = options.layerCounts || layers;
        labels = options.labels || labels;
        dontCreateTextures = options.dontCreateTextures ?? false;
        if (this.webGLVersion > 1 &&
            (options.depthTextureFormat === 13 ||
                options.depthTextureFormat === 17 ||
                options.depthTextureFormat === 16 ||
                options.depthTextureFormat === 14 ||
                options.depthTextureFormat === 18)) {
            depthTextureFormat = options.depthTextureFormat;
        }
    }
    if (depthTextureFormat === undefined) {
        depthTextureFormat = generateStencilBuffer ? 13 : 14;
    }
    const gl = this._gl;
    // Create the framebuffer
    const framebuffer = gl.createFramebuffer();
    this._bindUnboundFramebuffer(framebuffer);
    const width = size.width ?? size;
    const height = size.height ?? size;
    const textures = [];
    const attachments = [];
    const useStencilTexture = this.webGLVersion > 1 &&
        (depthTextureFormat === 13 ||
            depthTextureFormat === 17 ||
            depthTextureFormat === 18);
    rtWrapper.label = options?.label ?? "MultiRenderTargetWrapper";
    rtWrapper._framebuffer = framebuffer;
    rtWrapper._generateDepthBuffer = generateDepthTexture || generateDepthBuffer;
    rtWrapper._generateStencilBuffer = generateDepthTexture ? useStencilTexture : generateStencilBuffer;
    rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, width, height, 1, depthTextureFormat);
    rtWrapper._attachments = attachments;
    for (let i = 0; i < textureCount; i++) {
        let samplingMode = samplingModes[i] || defaultSamplingMode;
        let type = types[i] || defaultType;
        let useSRGBBuffer = useSRGBBuffers[i] || defaultUseSRGBBuffer;
        const format = formats[i] || defaultFormat;
        const target = targets[i] || defaultTarget;
        const layerCount = layers[i] ?? 1;
        if (type === 1 && !this._caps.textureFloatLinearFiltering) {
            // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
            samplingMode = 1;
        }
        else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) {
            // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
            samplingMode = 1;
        }
        const filters = this._getSamplingParameters(samplingMode, generateMipMaps);
        if (type === 1 && !this._caps.textureFloat) {
            type = 0;
            logger/* Logger */.V.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type");
        }
        useSRGBBuffer = useSRGBBuffer && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU);
        const isWebGL2 = this.webGLVersion > 1;
        const attachment = gl[isWebGL2 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];
        attachments.push(attachment);
        if (target === -1 || dontCreateTextures) {
            continue;
        }
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 6 /* InternalTextureSource.MultiRenderTarget */);
        textures[i] = texture;
        gl.activeTexture(gl["TEXTURE" + i]);
        gl.bindTexture(target, texture._hardwareTexture.underlyingResource);
        gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filters.mag);
        gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filters.min);
        gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
        gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
        const internalSizedFormat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer);
        const internalFormat = this._getInternalFormat(format);
        const webGLTextureType = this._getWebGLTextureType(type);
        if (isWebGL2 && (target === 35866 || target === 32879)) {
            if (target === 35866) {
                texture.is2DArray = true;
            }
            else {
                texture.is3D = true;
            }
            texture.baseDepth = texture.depth = layerCount;
            gl.texImage3D(target, 0, internalSizedFormat, width, height, layerCount, 0, internalFormat, webGLTextureType, null);
        }
        else if (target === 34067) {
            // We have to generate all faces to complete the framebuffer
            for (let i = 0; i < 6; i++) {
                gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null);
            }
            texture.isCube = true;
        }
        else {
            gl.texImage2D(gl.TEXTURE_2D, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null);
        }
        if (generateMipMaps) {
            gl.generateMipmap(target);
        }
        // Unbind
        this._bindTextureDirectly(target, null);
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.width = width;
        texture.height = height;
        texture.isReady = true;
        texture.samples = 1;
        texture.generateMipMaps = generateMipMaps;
        texture.samplingMode = samplingMode;
        texture.type = type;
        texture._useSRGBBuffer = useSRGBBuffer;
        texture.format = format;
        texture.label = labels[i] ?? rtWrapper.label + "-Texture" + i;
        this._internalTexturesCache.push(texture);
    }
    if (generateDepthTexture && this._caps.depthTextureExtension && !dontCreateTextures) {
        // Depth texture
        const depthTexture = new Textures_internalTexture/* InternalTexture */.hV(this, 14 /* InternalTextureSource.Depth */);
        let depthTextureType = 5;
        let glDepthTextureInternalFormat = gl.DEPTH_COMPONENT16;
        let glDepthTextureFormat = gl.DEPTH_COMPONENT;
        let glDepthTextureType = gl.UNSIGNED_SHORT;
        let glDepthTextureAttachment = gl.DEPTH_ATTACHMENT;
        if (this.webGLVersion < 2) {
            glDepthTextureInternalFormat = gl.DEPTH_COMPONENT;
        }
        else {
            if (depthTextureFormat === 14) {
                depthTextureType = 1;
                glDepthTextureType = gl.FLOAT;
                glDepthTextureInternalFormat = gl.DEPTH_COMPONENT32F;
            }
            else if (depthTextureFormat === 18) {
                depthTextureType = 0;
                glDepthTextureType = gl.FLOAT_32_UNSIGNED_INT_24_8_REV;
                glDepthTextureInternalFormat = gl.DEPTH32F_STENCIL8;
                glDepthTextureFormat = gl.DEPTH_STENCIL;
                glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT;
            }
            else if (depthTextureFormat === 16) {
                depthTextureType = 0;
                glDepthTextureType = gl.UNSIGNED_INT;
                glDepthTextureInternalFormat = gl.DEPTH_COMPONENT24;
                glDepthTextureAttachment = gl.DEPTH_ATTACHMENT;
            }
            else if (depthTextureFormat === 13 || depthTextureFormat === 17) {
                depthTextureType = 12;
                glDepthTextureType = gl.UNSIGNED_INT_24_8;
                glDepthTextureInternalFormat = gl.DEPTH24_STENCIL8;
                glDepthTextureFormat = gl.DEPTH_STENCIL;
                glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT;
            }
        }
        this._bindTextureDirectly(gl.TEXTURE_2D, depthTexture, true);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
        gl.texImage2D(gl.TEXTURE_2D, 0, glDepthTextureInternalFormat, width, height, 0, glDepthTextureFormat, glDepthTextureType, null);
        gl.framebufferTexture2D(gl.FRAMEBUFFER, glDepthTextureAttachment, gl.TEXTURE_2D, depthTexture._hardwareTexture.underlyingResource, 0);
        this._bindTextureDirectly(gl.TEXTURE_2D, null);
        rtWrapper._depthStencilTexture = depthTexture;
        rtWrapper._depthStencilTextureWithStencil = useStencilTexture;
        depthTexture.baseWidth = width;
        depthTexture.baseHeight = height;
        depthTexture.width = width;
        depthTexture.height = height;
        depthTexture.isReady = true;
        depthTexture.samples = 1;
        depthTexture.generateMipMaps = generateMipMaps;
        depthTexture.samplingMode = 1;
        depthTexture.format = depthTextureFormat;
        depthTexture.type = depthTextureType;
        depthTexture.label = rtWrapper.label + "-DepthStencil";
        textures[textureCount] = depthTexture;
        this._internalTexturesCache.push(depthTexture);
    }
    rtWrapper.setTextures(textures);
    if (initializeBuffers) {
        gl.drawBuffers(attachments);
    }
    this._bindUnboundFramebuffer(null);
    rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex);
    this.resetTextureCache();
    if (!dontCreateTextures) {
        this.updateMultipleRenderTargetTextureSampleCount(rtWrapper, samples, initializeBuffers);
    }
    else if (samples > 1) {
        const framebuffer = gl.createFramebuffer();
        if (!framebuffer) {
            throw new Error("Unable to create multi sampled framebuffer");
        }
        rtWrapper._samples = samples;
        rtWrapper._MSAAFramebuffer = framebuffer;
        if (textureCount > 0 && initializeBuffers) {
            this._bindUnboundFramebuffer(framebuffer);
            gl.drawBuffers(attachments);
            this._bindUnboundFramebuffer(null);
        }
    }
    return rtWrapper;
};
thinEngine.ThinEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function (rtWrapper, samples, initializeBuffers = true) {
    if (this.webGLVersion < 2 || !rtWrapper) {
        return 1;
    }
    if (rtWrapper.samples === samples) {
        return samples;
    }
    const gl = this._gl;
    samples = Math.min(samples, this.getCaps().maxMSAASamples);
    // Dispose previous render buffers
    if (rtWrapper._depthStencilBuffer) {
        gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer);
        rtWrapper._depthStencilBuffer = null;
    }
    if (rtWrapper._MSAAFramebuffer) {
        gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer);
        rtWrapper._MSAAFramebuffer = null;
    }
    const count = rtWrapper._attachments.length; // We do it this way instead of rtWrapper.textures.length to avoid taking into account the depth/stencil texture, in case it has been created
    for (let i = 0; i < count; i++) {
        const texture = rtWrapper.textures[i];
        const hardwareTexture = texture._hardwareTexture;
        hardwareTexture?.releaseMSAARenderBuffers();
    }
    if (samples > 1 && typeof gl.renderbufferStorageMultisample === "function") {
        const framebuffer = gl.createFramebuffer();
        if (!framebuffer) {
            throw new Error("Unable to create multi sampled framebuffer");
        }
        rtWrapper._MSAAFramebuffer = framebuffer;
        this._bindUnboundFramebuffer(framebuffer);
        const attachments = [];
        for (let i = 0; i < count; i++) {
            const texture = rtWrapper.textures[i];
            const hardwareTexture = texture._hardwareTexture;
            const attachment = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];
            const colorRenderbuffer = this._createRenderBuffer(texture.width, texture.height, samples, -1 /* not used */, this._getRGBABufferInternalSizedFormat(texture.type, texture.format, texture._useSRGBBuffer), attachment);
            if (!colorRenderbuffer) {
                throw new Error("Unable to create multi sampled framebuffer");
            }
            hardwareTexture.addMSAARenderBuffer(colorRenderbuffer);
            texture.samples = samples;
            attachments.push(attachment);
        }
        if (initializeBuffers) {
            gl.drawBuffers(attachments);
        }
    }
    else {
        this._bindUnboundFramebuffer(rtWrapper._framebuffer);
    }
    const depthFormat = rtWrapper._depthStencilTexture ? rtWrapper._depthStencilTexture.format : undefined;
    rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.width, rtWrapper.height, samples, depthFormat);
    this._bindUnboundFramebuffer(null);
    rtWrapper._samples = samples;
    return samples;
};
thinEngine.ThinEngine.prototype.generateMipMapsMultiFramebuffer = function (texture) {
    const rtWrapper = texture;
    const gl = this._gl;
    if (!rtWrapper.isMulti) {
        return;
    }
    for (let i = 0; i < rtWrapper._attachments.length; i++) {
        const texture = rtWrapper.textures[i];
        if (texture?.generateMipMaps && !texture?.isCube && !texture?.is3D) {
            this._bindTextureDirectly(gl.TEXTURE_2D, texture, true);
            gl.generateMipmap(gl.TEXTURE_2D);
            this._bindTextureDirectly(gl.TEXTURE_2D, null);
        }
    }
};
thinEngine.ThinEngine.prototype.resolveMultiFramebuffer = function (texture) {
    const rtWrapper = texture;
    const gl = this._gl;
    if (!rtWrapper._MSAAFramebuffer || !rtWrapper.isMulti) {
        return;
    }
    let bufferBits = rtWrapper.resolveMSAAColors ? gl.COLOR_BUFFER_BIT : 0;
    bufferBits |= rtWrapper._generateDepthBuffer && rtWrapper.resolveMSAADepth ? gl.DEPTH_BUFFER_BIT : 0;
    bufferBits |= rtWrapper._generateStencilBuffer && rtWrapper.resolveMSAAStencil ? gl.STENCIL_BUFFER_BIT : 0;
    const attachments = rtWrapper._attachments;
    const count = attachments.length;
    gl.bindFramebuffer(gl.READ_FRAMEBUFFER, rtWrapper._MSAAFramebuffer);
    gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, rtWrapper._framebuffer);
    for (let i = 0; i < count; i++) {
        const texture = rtWrapper.textures[i];
        for (let j = 0; j < count; j++) {
            attachments[j] = gl.NONE;
        }
        attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];
        gl.readBuffer(attachments[i]);
        gl.drawBuffers(attachments);
        gl.blitFramebuffer(0, 0, texture.width, texture.height, 0, 0, texture.width, texture.height, bufferBits, gl.NEAREST);
    }
    for (let i = 0; i < count; i++) {
        attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];
    }
    gl.drawBuffers(attachments);
};
//# sourceMappingURL=engine.multiRender.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.cubeTexture.js
var engine_cubeTexture = __webpack_require__(83155);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.prefilteredCubeTexture.js
var engine_prefilteredCubeTexture = __webpack_require__(51881);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js + 1 modules
var engine_renderTarget = __webpack_require__(44176);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetCube.js
var engine_renderTargetCube = __webpack_require__(79779);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetTexture.js
var engine_renderTargetTexture = __webpack_require__(15183);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.uniformBuffer.js
var engine_uniformBuffer = __webpack_require__(36317);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicBuffer.js
var engine_dynamicBuffer = __webpack_require__(86556);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Extensions/engine.readTexture.js
var engine_readTexture = __webpack_require__(52212);
;// ./node_modules/@babylonjs/core/Engines/Extensions/engine.computeShader.js


/** @internal */
var ComputeBindingType;
(function (ComputeBindingType) {
    ComputeBindingType[ComputeBindingType["Texture"] = 0] = "Texture";
    ComputeBindingType[ComputeBindingType["StorageTexture"] = 1] = "StorageTexture";
    ComputeBindingType[ComputeBindingType["UniformBuffer"] = 2] = "UniformBuffer";
    ComputeBindingType[ComputeBindingType["StorageBuffer"] = 3] = "StorageBuffer";
    ComputeBindingType[ComputeBindingType["TextureWithoutSampler"] = 4] = "TextureWithoutSampler";
    ComputeBindingType[ComputeBindingType["Sampler"] = 5] = "Sampler";
    ComputeBindingType[ComputeBindingType["ExternalTexture"] = 6] = "ExternalTexture";
    ComputeBindingType[ComputeBindingType["DataBuffer"] = 7] = "DataBuffer";
})(ComputeBindingType || (ComputeBindingType = {}));
thinEngine.ThinEngine.prototype.createComputeEffect = function (baseName, options) {
    throw new Error("createComputeEffect: This engine does not support compute shaders!");
};
thinEngine.ThinEngine.prototype.createComputePipelineContext = function () {
    throw new Error("createComputePipelineContext: This engine does not support compute shaders!");
};
thinEngine.ThinEngine.prototype.createComputeContext = function () {
    return undefined;
};
thinEngine.ThinEngine.prototype.computeDispatch = function (effect, context, bindings, x, y, z, bindingsMapping) {
    throw new Error("computeDispatch: This engine does not support compute shaders!");
};
thinEngine.ThinEngine.prototype.computeDispatchIndirect = function (effect, context, bindings, buffer, offset, bindingsMapping) {
    throw new Error("computeDispatchIndirect: This engine does not support compute shaders!");
};
thinEngine.ThinEngine.prototype.areAllComputeEffectsReady = function () {
    return true;
};
thinEngine.ThinEngine.prototype.releaseComputeEffects = function () { };
thinEngine.ThinEngine.prototype._prepareComputePipelineContext = function (pipelineContext, computeSourceCode, rawComputeSourceCode, defines, entryPoint) { };
thinEngine.ThinEngine.prototype._rebuildComputeEffects = function () { };
abstractEngine/* AbstractEngine */.$.prototype._executeWhenComputeStateIsCompiled = function (pipelineContext, action) {
    action(null);
};
thinEngine.ThinEngine.prototype._releaseComputeEffect = function (effect) { };
thinEngine.ThinEngine.prototype._deleteComputePipelineContext = function (pipelineContext) { };
//# sourceMappingURL=engine.computeShader.js.map
;// ./node_modules/@babylonjs/core/Engines/Extensions/engine.textureSelector.js

function transformTextureUrl(url) {
    const excludeFn = (entry) => {
        const strRegExPattern = "\\b" + entry + "\\b";
        return url && (url === entry || url.match(new RegExp(strRegExPattern, "g")));
    };
    if (this._excludedCompressedTextures && this._excludedCompressedTextures.some(excludeFn)) {
        return url;
    }
    const lastDot = url.lastIndexOf(".");
    const lastQuestionMark = url.lastIndexOf("?");
    const querystring = lastQuestionMark > -1 ? url.substring(lastQuestionMark, url.length) : "";
    return (lastDot > -1 ? url.substring(0, lastDot) : url) + this._textureFormatInUse + querystring;
}
Object.defineProperty(Engines_engine/* Engine */.N.prototype, "texturesSupported", {
    get: function () {
        // Intelligently add supported compressed formats in order to check for.
        // Check for ASTC support first as it is most powerful and to be very cross platform.
        // Next PVRTC & DXT, which are probably superior to ETC1/2.
        // Likely no hardware which supports both PVR & DXT, so order matters little.
        // ETC2 is newer and handles ETC1 (no alpha capability), so check for first.
        const texturesSupported = [];
        if (this._caps.astc) {
            texturesSupported.push("-astc.ktx");
        }
        if (this._caps.s3tc) {
            texturesSupported.push("-dxt.ktx");
        }
        if (this._caps.pvrtc) {
            texturesSupported.push("-pvrtc.ktx");
        }
        if (this._caps.etc2) {
            texturesSupported.push("-etc2.ktx");
        }
        if (this._caps.etc1) {
            texturesSupported.push("-etc1.ktx");
        }
        return texturesSupported;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(Engines_engine/* Engine */.N.prototype, "textureFormatInUse", {
    get: function () {
        return this._textureFormatInUse || null;
    },
    enumerable: true,
    configurable: true,
});
Engines_engine/* Engine */.N.prototype.setCompressedTextureExclusions = function (skippedFiles) {
    this._excludedCompressedTextures = skippedFiles;
};
Engines_engine/* Engine */.N.prototype.setTextureFormatToUse = function (formatsAvailable) {
    const texturesSupported = this.texturesSupported;
    for (let i = 0, len1 = texturesSupported.length; i < len1; i++) {
        for (let j = 0, len2 = formatsAvailable.length; j < len2; j++) {
            if (texturesSupported[i] === formatsAvailable[j].toLowerCase()) {
                this._transformTextureUrl = transformTextureUrl.bind(this);
                return (this._textureFormatInUse = texturesSupported[i]);
            }
        }
    }
    // actively set format to nothing, to allow this to be called more than once
    // and possibly fail the 2nd time
    this._textureFormatInUse = "";
    this._transformTextureUrl = null;
    return null;
};
//# sourceMappingURL=engine.textureSelector.js.map
;// ./node_modules/@babylonjs/core/Engines/Extensions/index.js
/* eslint-disable import/export */


















// must import first since nothing references the exports

// eslint-disable-next-line no-duplicate-imports

//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Engines/Native/nativeDataStream.js
/** @internal */
class NativeDataStream {
    constructor() {
        const buffer = new ArrayBuffer(NativeDataStream.DEFAULT_BUFFER_SIZE);
        this._uint32s = new Uint32Array(buffer);
        this._int32s = new Int32Array(buffer);
        this._float32s = new Float32Array(buffer);
        this._length = NativeDataStream.DEFAULT_BUFFER_SIZE / 4;
        this._position = 0;
        this._nativeDataStream = new _native.NativeDataStream(() => {
            this._flush();
        });
    }
    /**
     * Writes a uint32 to the stream
     * @param value the value to write
     */
    writeUint32(value) {
        this._flushIfNecessary(1);
        this._uint32s[this._position++] = value;
    }
    /**
     * Writes an int32 to the stream
     * @param value the value to write
     */
    writeInt32(value) {
        this._flushIfNecessary(1);
        this._int32s[this._position++] = value;
    }
    /**
     * Writes a float32 to the stream
     * @param value the value to write
     */
    writeFloat32(value) {
        this._flushIfNecessary(1);
        this._float32s[this._position++] = value;
    }
    /**
     * Writes a uint32 array to the stream
     * @param values the values to write
     */
    writeUint32Array(values) {
        this._flushIfNecessary(1 + values.length);
        this._uint32s[this._position++] = values.length;
        this._uint32s.set(values, this._position);
        this._position += values.length;
    }
    /**
     * Writes an int32 array to the stream
     * @param values the values to write
     */
    writeInt32Array(values) {
        this._flushIfNecessary(1 + values.length);
        this._uint32s[this._position++] = values.length;
        this._int32s.set(values, this._position);
        this._position += values.length;
    }
    /**
     * Writes a float32 array to the stream
     * @param values the values to write
     */
    writeFloat32Array(values) {
        this._flushIfNecessary(1 + values.length);
        this._uint32s[this._position++] = values.length;
        this._float32s.set(values, this._position);
        this._position += values.length;
    }
    /**
     * Writes native data to the stream
     * @param handle the handle to the native data
     */
    writeNativeData(handle) {
        this._flushIfNecessary(handle.length);
        this._uint32s.set(handle, this._position);
        this._position += handle.length;
    }
    /**
     * Writes a boolean to the stream
     * @param value the value to write
     */
    writeBoolean(value) {
        this.writeUint32(value ? 1 : 0);
    }
    _flushIfNecessary(required) {
        if (this._position + required > this._length) {
            this._flush();
        }
    }
    _flush() {
        this._nativeDataStream.writeBuffer(this._uint32s.buffer, this._position);
        this._position = 0;
    }
}
// Must be multiple of 4!
// eslint-disable-next-line @typescript-eslint/naming-convention
NativeDataStream.DEFAULT_BUFFER_SIZE = 65536;
//# sourceMappingURL=nativeDataStream.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/environmentTextureTools.js
var environmentTextureTools = __webpack_require__(32853);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/Processors/shaderCodeInliner.js
var shaderCodeInliner = __webpack_require__(56617);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/codeStringParsingTools.js
var codeStringParsingTools = __webpack_require__(65394);
;// ./node_modules/@babylonjs/core/Engines/Native/nativeShaderProcessors.js

const varyingRegex = /(flat\s)?\s*varying\s*.*/;
/** @internal */
class NativeShaderProcessor {
    constructor() {
        this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;
    }
    initializeShaders(processingContext) {
        this._nativeProcessingContext = processingContext;
        if (this._nativeProcessingContext) {
            this._nativeProcessingContext.remappedAttributeNames = {};
            this._nativeProcessingContext.injectInVertexMain = "";
        }
    }
    attributeProcessor(attribute) {
        if (!this._nativeProcessingContext) {
            return attribute.replace("attribute", "in");
        }
        const attribRegex = /\s*(?:attribute|in)\s+(\S+)\s+(\S+)\s*;/gm;
        const match = attribRegex.exec(attribute);
        if (match !== null) {
            const attributeType = match[1];
            const name = match[2];
            const numComponents = this._nativeProcessingContext.vertexBufferKindToNumberOfComponents[name];
            if (numComponents !== undefined) {
                // Special case for an int/ivecX vertex buffer that is used as a float/vecX attribute in the shader.
                const newType = numComponents < 0 ? (numComponents === -1 ? "int" : "ivec" + -numComponents) : numComponents === 1 ? "uint" : "uvec" + numComponents;
                const newName = `_int_${name}_`;
                attribute = attribute.replace(match[0], `in ${newType} ${newName}; ${attributeType} ${name};`);
                this._nativeProcessingContext.injectInVertexMain += `${name} = ${attributeType}(${newName});\n`;
                this._nativeProcessingContext.remappedAttributeNames[name] = newName;
            }
            else {
                attribute = attribute.replace(match[0], `in ${attributeType} ${name};`);
            }
        }
        return attribute;
    }
    varyingCheck(varying, _isFragment) {
        return varyingRegex.test(varying);
    }
    varyingProcessor(varying, isFragment) {
        return varying.replace("varying", isFragment ? "in" : "out");
    }
    postProcessor(code, defines, isFragment) {
        const hasDrawBuffersExtension = code.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1;
        // Remove extensions
        const regex = /#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;
        code = code.replace(regex, "");
        // Replace instructions
        code = code.replace(/texture2D\s*\(/g, "texture(");
        if (isFragment) {
            const hasOutput = code.search(/layout *\(location *= *0\) *out/g) !== -1;
            code = code.replace(/texture2DLodEXT\s*\(/g, "textureLod(");
            code = code.replace(/textureCubeLodEXT\s*\(/g, "textureLod(");
            code = code.replace(/textureCube\s*\(/g, "texture(");
            code = code.replace(/gl_FragDepthEXT/g, "gl_FragDepth");
            code = code.replace(/gl_FragColor/g, "glFragColor");
            code = code.replace(/gl_FragData/g, "glFragData");
            code = code.replace(/void\s+?main\s*\(/g, (hasDrawBuffersExtension || hasOutput ? "" : "layout(location = 0) out vec4 glFragColor;\n") + "void main(");
        }
        else {
            if (this._nativeProcessingContext?.injectInVertexMain) {
                code = (0,codeStringParsingTools/* InjectStartingAndEndingCode */.bI)(code, "void main", this._nativeProcessingContext.injectInVertexMain);
            }
            const hasMultiviewExtension = defines.indexOf("#define MULTIVIEW") !== -1;
            if (hasMultiviewExtension) {
                return "#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n" + code;
            }
        }
        return code;
    }
}
//# sourceMappingURL=nativeShaderProcessors.js.map
;// ./node_modules/@babylonjs/core/Engines/Native/nativePipelineContext.js
class NativePipelineContext {
    get isReady() {
        if (this.compilationError) {
            const message = this.compilationError.message;
            throw new Error("SHADER ERROR" + (typeof message === "string" ? "\n" + message : ""));
        }
        return this.isCompiled;
    }
    _getVertexShaderCode() {
        return null;
    }
    _getFragmentShaderCode() {
        return null;
    }
    constructor(engine, isAsync, shaderProcessingContext) {
        this.isCompiled = false;
        this.vertexBufferKindToType = {};
        this._valueCache = {};
        this._engine = engine;
        this.isAsync = isAsync;
        this.shaderProcessingContext = shaderProcessingContext;
    }
    _fillEffectInformation(effect, uniformBuffersNames, uniformsNames, uniforms, samplerList, samplers, attributesNames, attributes) {
        const engine = this._engine;
        if (engine.supportsUniformBuffers) {
            for (const name in uniformBuffersNames) {
                effect.bindUniformBlock(name, uniformBuffersNames[name]);
            }
        }
        const effectAvailableUniforms = this._engine.getUniforms(this, uniformsNames);
        effectAvailableUniforms.forEach((uniform, index) => {
            uniforms[uniformsNames[index]] = uniform;
        });
        this._uniforms = uniforms;
        let index;
        for (index = 0; index < samplerList.length; index++) {
            const sampler = effect.getUniform(samplerList[index]);
            if (sampler == null) {
                samplerList.splice(index, 1);
                index--;
            }
        }
        samplerList.forEach((name, index) => {
            samplers[name] = index;
        });
        attributes.push(...engine.getAttributes(this, attributesNames));
    }
    setEngine(engine) {
        this._engine = engine;
    }
    /**
     * Release all associated resources.
     **/
    dispose() {
        this._uniforms = {};
    }
    /**
     * @internal
     */
    _cacheMatrix(uniformName, matrix) {
        const cache = this._valueCache[uniformName];
        const flag = matrix.updateFlag;
        if (cache !== undefined && cache === flag) {
            return false;
        }
        this._valueCache[uniformName] = flag;
        return true;
    }
    /**
     * @internal
     */
    _cacheFloat2(uniformName, x, y) {
        let cache = this._valueCache[uniformName];
        if (!cache) {
            cache = [x, y];
            this._valueCache[uniformName] = cache;
            return true;
        }
        let changed = false;
        if (cache[0] !== x) {
            cache[0] = x;
            changed = true;
        }
        if (cache[1] !== y) {
            cache[1] = y;
            changed = true;
        }
        return changed;
    }
    /**
     * @internal
     */
    _cacheFloat3(uniformName, x, y, z) {
        let cache = this._valueCache[uniformName];
        if (!cache) {
            cache = [x, y, z];
            this._valueCache[uniformName] = cache;
            return true;
        }
        let changed = false;
        if (cache[0] !== x) {
            cache[0] = x;
            changed = true;
        }
        if (cache[1] !== y) {
            cache[1] = y;
            changed = true;
        }
        if (cache[2] !== z) {
            cache[2] = z;
            changed = true;
        }
        return changed;
    }
    /**
     * @internal
     */
    _cacheFloat4(uniformName, x, y, z, w) {
        let cache = this._valueCache[uniformName];
        if (!cache) {
            cache = [x, y, z, w];
            this._valueCache[uniformName] = cache;
            return true;
        }
        let changed = false;
        if (cache[0] !== x) {
            cache[0] = x;
            changed = true;
        }
        if (cache[1] !== y) {
            cache[1] = y;
            changed = true;
        }
        if (cache[2] !== z) {
            cache[2] = z;
            changed = true;
        }
        if (cache[3] !== w) {
            cache[3] = w;
            changed = true;
        }
        return changed;
    }
    /**
     * Sets an integer value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value Value to be set.
     */
    setInt(uniformName, value) {
        const cache = this._valueCache[uniformName];
        if (cache !== undefined && cache === value) {
            return;
        }
        if (this._engine.setInt(this._uniforms[uniformName], value)) {
            this._valueCache[uniformName] = value;
        }
    }
    /**
     * Sets a int2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int2.
     * @param y Second int in int2.
     */
    setInt2(uniformName, x, y) {
        if (this._cacheFloat2(uniformName, x, y)) {
            if (!this._engine.setInt2(this._uniforms[uniformName], x, y)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a int3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int3.
     * @param y Second int in int3.
     * @param z Third int in int3.
     */
    setInt3(uniformName, x, y, z) {
        if (this._cacheFloat3(uniformName, x, y, z)) {
            if (!this._engine.setInt3(this._uniforms[uniformName], x, y, z)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a int4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int4.
     * @param y Second int in int4.
     * @param z Third int in int4.
     * @param w Fourth int in int4.
     */
    setInt4(uniformName, x, y, z, w) {
        if (this._cacheFloat4(uniformName, x, y, z, w)) {
            if (!this._engine.setInt4(this._uniforms[uniformName], x, y, z, w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets an int array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setIntArray(this._uniforms[uniformName], array);
    }
    /**
     * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray2(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setIntArray2(this._uniforms[uniformName], array);
    }
    /**
     * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray3(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setIntArray3(this._uniforms[uniformName], array);
    }
    /**
     * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray4(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setIntArray4(this._uniforms[uniformName], array);
    }
    /**
     * Sets an unsigned integer value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value Value to be set.
     */
    setUInt(uniformName, value) {
        const cache = this._valueCache[uniformName];
        if (cache !== undefined && cache === value) {
            return;
        }
        if (this._engine.setUInt(this._uniforms[uniformName], value)) {
            this._valueCache[uniformName] = value;
        }
    }
    /**
     * Sets a unsigned int2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint2.
     * @param y Second unsigned int in uint2.
     */
    setUInt2(uniformName, x, y) {
        if (this._cacheFloat2(uniformName, x, y)) {
            if (!this._engine.setUInt2(this._uniforms[uniformName], x, y)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a unsigned int3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint3.
     * @param y Second unsigned int in uint3.
     * @param z Third unsigned int in uint3.
     */
    setUInt3(uniformName, x, y, z) {
        if (this._cacheFloat3(uniformName, x, y, z)) {
            if (!this._engine.setUInt3(this._uniforms[uniformName], x, y, z)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a unsigned int4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint4.
     * @param y Second unsigned int in uint4.
     * @param z Third unsigned int in uint4.
     * @param w Fourth unsigned int in uint4.
     */
    setUInt4(uniformName, x, y, z, w) {
        if (this._cacheFloat4(uniformName, x, y, z, w)) {
            if (!this._engine.setUInt4(this._uniforms[uniformName], x, y, z, w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets an unsigned int array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setUIntArray(this._uniforms[uniformName], array);
    }
    /**
     * Sets an unsigned int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray2(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setUIntArray2(this._uniforms[uniformName], array);
    }
    /**
     * Sets an unsigned int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray3(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setUIntArray3(this._uniforms[uniformName], array);
    }
    /**
     * Sets an unsigned int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray4(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setUIntArray4(this._uniforms[uniformName], array);
    }
    /**
     * Sets an float array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setFloatArray(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setFloatArray(this._uniforms[uniformName], array);
    }
    /**
     * Sets an float array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setFloatArray2(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setFloatArray2(this._uniforms[uniformName], array);
    }
    /**
     * Sets an float array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setFloatArray3(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setFloatArray3(this._uniforms[uniformName], array);
    }
    /**
     * Sets an float array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setFloatArray4(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setFloatArray4(this._uniforms[uniformName], array);
    }
    /**
     * Sets an array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setArray(this._uniforms[uniformName], array);
    }
    /**
     * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray2(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setArray2(this._uniforms[uniformName], array);
    }
    /**
     * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray3(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setArray3(this._uniforms[uniformName], array);
    }
    /**
     * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray4(uniformName, array) {
        this._valueCache[uniformName] = null;
        this._engine.setArray4(this._uniforms[uniformName], array);
    }
    /**
     * Sets matrices on a uniform variable.
     * @param uniformName Name of the variable.
     * @param matrices matrices to be set.
     */
    setMatrices(uniformName, matrices) {
        if (!matrices) {
            return;
        }
        this._valueCache[uniformName] = null;
        this._engine.setMatrices(this._uniforms[uniformName], matrices);
    }
    /**
     * Sets matrix on a uniform variable.
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     */
    setMatrix(uniformName, matrix) {
        if (this._cacheMatrix(uniformName, matrix)) {
            if (!this._engine.setMatrices(this._uniforms[uniformName], matrix.asArray())) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     */
    setMatrix3x3(uniformName, matrix) {
        this._valueCache[uniformName] = null;
        this._engine.setMatrix3x3(this._uniforms[uniformName], matrix);
    }
    /**
     * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     */
    setMatrix2x2(uniformName, matrix) {
        this._valueCache[uniformName] = null;
        this._engine.setMatrix2x2(this._uniforms[uniformName], matrix);
    }
    /**
     * Sets a float on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value value to be set.
     */
    setFloat(uniformName, value) {
        const cache = this._valueCache[uniformName];
        if (cache !== undefined && cache === value) {
            return;
        }
        if (this._engine.setFloat(this._uniforms[uniformName], value)) {
            this._valueCache[uniformName] = value;
        }
    }
    /**
     * Sets a boolean on a uniform variable.
     * @param uniformName Name of the variable.
     * @param bool value to be set.
     */
    setBool(uniformName, bool) {
        const cache = this._valueCache[uniformName];
        if (cache !== undefined && cache === bool) {
            return;
        }
        if (this._engine.setInt(this._uniforms[uniformName], bool ? 1 : 0)) {
            this._valueCache[uniformName] = bool ? 1 : 0;
        }
    }
    /**
     * Sets a Vector2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector2 vector2 to be set.
     */
    setVector2(uniformName, vector2) {
        if (this._cacheFloat2(uniformName, vector2.x, vector2.y)) {
            if (!this._engine.setFloat2(this._uniforms[uniformName], vector2.x, vector2.y)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a float2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float2.
     * @param y Second float in float2.
     */
    setFloat2(uniformName, x, y) {
        if (this._cacheFloat2(uniformName, x, y)) {
            if (!this._engine.setFloat2(this._uniforms[uniformName], x, y)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Vector3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector3 Value to be set.
     */
    setVector3(uniformName, vector3) {
        if (this._cacheFloat3(uniformName, vector3.x, vector3.y, vector3.z)) {
            if (!this._engine.setFloat3(this._uniforms[uniformName], vector3.x, vector3.y, vector3.z)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a float3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float3.
     * @param y Second float in float3.
     * @param z Third float in float3.
     */
    setFloat3(uniformName, x, y, z) {
        if (this._cacheFloat3(uniformName, x, y, z)) {
            if (!this._engine.setFloat3(this._uniforms[uniformName], x, y, z)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Vector4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector4 Value to be set.
     */
    setVector4(uniformName, vector4) {
        if (this._cacheFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w)) {
            if (!this._engine.setFloat4(this._uniforms[uniformName], vector4.x, vector4.y, vector4.z, vector4.w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Quaternion on a uniform variable.
     * @param uniformName Name of the variable.
     * @param quaternion Value to be set.
     */
    setQuaternion(uniformName, quaternion) {
        if (this._cacheFloat4(uniformName, quaternion.x, quaternion.y, quaternion.z, quaternion.w)) {
            if (!this._engine.setFloat4(this._uniforms[uniformName], quaternion.x, quaternion.y, quaternion.z, quaternion.w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a float4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float4.
     * @param y Second float in float4.
     * @param z Third float in float4.
     * @param w Fourth float in float4.
     */
    setFloat4(uniformName, x, y, z, w) {
        if (this._cacheFloat4(uniformName, x, y, z, w)) {
            if (!this._engine.setFloat4(this._uniforms[uniformName], x, y, z, w)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Color3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param color3 Value to be set.
     */
    setColor3(uniformName, color3) {
        if (this._cacheFloat3(uniformName, color3.r, color3.g, color3.b)) {
            if (!this._engine.setFloat3(this._uniforms[uniformName], color3.r, color3.g, color3.b)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Color4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param color3 Value to be set.
     * @param alpha Alpha value to be set.
     */
    setColor4(uniformName, color3, alpha) {
        if (this._cacheFloat4(uniformName, color3.r, color3.g, color3.b, alpha)) {
            if (!this._engine.setFloat4(this._uniforms[uniformName], color3.r, color3.g, color3.b, alpha)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
    /**
     * Sets a Color4 on a uniform variable
     * @param uniformName defines the name of the variable
     * @param color4 defines the value to be set
     */
    setDirectColor4(uniformName, color4) {
        if (this._cacheFloat4(uniformName, color4.r, color4.g, color4.b, color4.a)) {
            if (!this._engine.setFloat4(this._uniforms[uniformName], color4.r, color4.g, color4.b, color4.a)) {
                this._valueCache[uniformName] = null;
            }
        }
    }
}
//# sourceMappingURL=nativePipelineContext.js.map
;// ./node_modules/@babylonjs/core/Engines/Native/nativeRenderTargetWrapper.js

class NativeRenderTargetWrapper extends renderTargetWrapper/* RenderTargetWrapper */.v {
    get _framebuffer() {
        return this.__framebuffer;
    }
    set _framebuffer(framebuffer) {
        if (this.__framebuffer) {
            this._engine._releaseFramebufferObjects(this.__framebuffer);
        }
        this.__framebuffer = framebuffer;
    }
    get _framebufferDepthStencil() {
        return this.__framebufferDepthStencil;
    }
    set _framebufferDepthStencil(framebufferDepthStencil) {
        if (this.__framebufferDepthStencil) {
            this._engine._releaseFramebufferObjects(this.__framebufferDepthStencil);
        }
        this.__framebufferDepthStencil = framebufferDepthStencil;
    }
    constructor(isMulti, isCube, size, engine) {
        super(isMulti, isCube, size, engine);
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.__framebuffer = null;
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.__framebufferDepthStencil = null;
        this._engine = engine;
    }
    dispose(disposeOnlyFramebuffers = false) {
        this._framebuffer = null;
        this._framebufferDepthStencil = null;
        super.dispose(disposeOnlyFramebuffers);
    }
}
//# sourceMappingURL=nativeRenderTargetWrapper.js.map
;// ./node_modules/@babylonjs/core/Engines/Native/nativeHardwareTexture.js
/** @internal */
class NativeHardwareTexture {
    get underlyingResource() {
        return this._nativeTexture;
    }
    constructor(existingTexture, engine) {
        this._engine = engine;
        this.set(existingTexture);
    }
    setUsage() { }
    set(hardwareTexture) {
        this._nativeTexture = hardwareTexture;
    }
    reset() {
        this._nativeTexture = null;
    }
    release() {
        if (this._nativeTexture) {
            this._engine.deleteTexture(this._nativeTexture);
        }
        this.reset();
    }
}
//# sourceMappingURL=nativeHardwareTexture.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/error.js
var error = __webpack_require__(88563);
;// ./node_modules/@babylonjs/core/Engines/Native/nativeHelpers.js



function getNativeTextureFormat(format, type) {
    switch (format) {
        // Depth (type is ignored)
        case 15:
            return _native.Engine.TEXTURE_FORMAT_D16;
        case 16:
            return _native.Engine.TEXTURE_FORMAT_D24;
        case 13:
            return _native.Engine.TEXTURE_FORMAT_D24S8;
        case 14:
            return _native.Engine.TEXTURE_FORMAT_D32F;
        // Compressed (type is ignored)
        case 36492:
            return _native.Engine.TEXTURE_FORMAT_BC7;
        case 36494:
            return _native.Engine.TEXTURE_FORMAT_BC6H;
        case 33779:
            return _native.Engine.TEXTURE_FORMAT_BC3;
        case 33778:
            return _native.Engine.TEXTURE_FORMAT_BC2;
        case 33777:
            return _native.Engine.TEXTURE_FORMAT_BC1;
        case 33776:
            return _native.Engine.TEXTURE_FORMAT_BC1;
        case 37808:
            return _native.Engine.TEXTURE_FORMAT_ASTC4x4;
        case 36196:
            return _native.Engine.TEXTURE_FORMAT_ETC1;
        case 37492:
            return _native.Engine.TEXTURE_FORMAT_ETC2;
        case 37496:
            return _native.Engine.TEXTURE_FORMAT_ETC2A;
        case 4: {
            switch (type) {
                case 0:
                    return _native.Engine.TEXTURE_FORMAT_RGB8;
                case 3:
                    return _native.Engine.TEXTURE_FORMAT_RGB8S;
                case 6:
                    return _native.Engine.TEXTURE_FORMAT_RGB8I;
                case 7:
                    return _native.Engine.TEXTURE_FORMAT_RGB8U;
            }
            break;
        }
        case 5: {
            switch (type) {
                case 0:
                    return _native.Engine.TEXTURE_FORMAT_RGBA8;
                case 1:
                    return _native.Engine.TEXTURE_FORMAT_RGBA32F;
                case 2:
                    return _native.Engine.TEXTURE_FORMAT_RGBA16F;
                case 3:
                    return _native.Engine.TEXTURE_FORMAT_RGBA8S;
                case 4:
                    return _native.Engine.TEXTURE_FORMAT_RGBA16I;
                case 5:
                    return _native.Engine.TEXTURE_FORMAT_RGBA16U;
                case 6:
                    return _native.Engine.TEXTURE_FORMAT_RGBA32I;
                case 7:
                    return _native.Engine.TEXTURE_FORMAT_RGBA32U;
            }
            break;
        }
        case 6: {
            switch (type) {
                case 0:
                    return _native.Engine.TEXTURE_FORMAT_R8;
                case 1:
                    return _native.Engine.TEXTURE_FORMAT_R32F;
                case 2:
                    return _native.Engine.TEXTURE_FORMAT_R16F;
                case 3:
                    return _native.Engine.TEXTURE_FORMAT_R8S;
                case 4:
                    return _native.Engine.TEXTURE_FORMAT_R16S;
                case 5:
                    return _native.Engine.TEXTURE_FORMAT_R16U;
                case 6:
                    return _native.Engine.TEXTURE_FORMAT_R32I;
                case 7:
                    return _native.Engine.TEXTURE_FORMAT_R32U;
            }
            break;
        }
        case 7: {
            switch (type) {
                case 0:
                    return _native.Engine.TEXTURE_FORMAT_RG8;
                case 1:
                    return _native.Engine.TEXTURE_FORMAT_RG32F;
                case 2:
                    return _native.Engine.TEXTURE_FORMAT_RG16F;
                case 3:
                    return _native.Engine.TEXTURE_FORMAT_RG8S;
                case 4:
                    return _native.Engine.TEXTURE_FORMAT_RG16S;
                case 5:
                    return _native.Engine.TEXTURE_FORMAT_RG16U;
                case 6:
                    return _native.Engine.TEXTURE_FORMAT_RG32I;
                case 7:
                    return _native.Engine.TEXTURE_FORMAT_RG32U;
            }
            break;
        }
        case 12: {
            switch (type) {
                case 0:
                    return _native.Engine.TEXTURE_FORMAT_BGRA8;
            }
            break;
        }
    }
    throw new error/* RuntimeError */.bu(`Unsupported texture format or type: format ${format}, type ${type}.`, error/* ErrorCodes */.tG.UnsupportedTextureError);
}
function getNativeSamplingMode(samplingMode) {
    switch (samplingMode) {
        case 1:
            return _native.Engine.TEXTURE_NEAREST_NEAREST;
        case 2:
            return _native.Engine.TEXTURE_LINEAR_LINEAR;
        case 3:
            return _native.Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR;
        case 4:
            return _native.Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST;
        case 5:
            return _native.Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST;
        case 6:
            return _native.Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR;
        case 7:
            return _native.Engine.TEXTURE_NEAREST_LINEAR;
        case 8:
            return _native.Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR;
        case 9:
            return _native.Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST;
        case 10:
            return _native.Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR;
        case 11:
            return _native.Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST;
        case 12:
            return _native.Engine.TEXTURE_LINEAR_NEAREST;
        default:
            throw new Error(`Unsupported sampling mode: ${samplingMode}.`);
    }
}
function getNativeAddressMode(wrapMode) {
    switch (wrapMode) {
        case 1:
            return _native.Engine.ADDRESS_MODE_WRAP;
        case 0:
            return _native.Engine.ADDRESS_MODE_CLAMP;
        case 2:
            return _native.Engine.ADDRESS_MODE_MIRROR;
        default:
            throw new Error("Unexpected wrap mode: " + wrapMode + ".");
    }
}
function getNativeStencilFunc(func) {
    switch (func) {
        case 513:
            return _native.Engine.STENCIL_TEST_LESS;
        case 515:
            return _native.Engine.STENCIL_TEST_LEQUAL;
        case 514:
            return _native.Engine.STENCIL_TEST_EQUAL;
        case 518:
            return _native.Engine.STENCIL_TEST_GEQUAL;
        case 516:
            return _native.Engine.STENCIL_TEST_GREATER;
        case 517:
            return _native.Engine.STENCIL_TEST_NOTEQUAL;
        case 512:
            return _native.Engine.STENCIL_TEST_NEVER;
        case 519:
            return _native.Engine.STENCIL_TEST_ALWAYS;
        default:
            throw new Error(`Unsupported stencil func mode: ${func}.`);
    }
}
function getNativeStencilOpFail(opFail) {
    switch (opFail) {
        case 7680:
            return _native.Engine.STENCIL_OP_FAIL_S_KEEP;
        case 0:
            return _native.Engine.STENCIL_OP_FAIL_S_ZERO;
        case 7681:
            return _native.Engine.STENCIL_OP_FAIL_S_REPLACE;
        case 7682:
            return _native.Engine.STENCIL_OP_FAIL_S_INCR;
        case 7683:
            return _native.Engine.STENCIL_OP_FAIL_S_DECR;
        case 5386:
            return _native.Engine.STENCIL_OP_FAIL_S_INVERT;
        case 34055:
            return _native.Engine.STENCIL_OP_FAIL_S_INCRSAT;
        case 34056:
            return _native.Engine.STENCIL_OP_FAIL_S_DECRSAT;
        default:
            throw new Error(`Unsupported stencil OpFail mode: ${opFail}.`);
    }
}
function getNativeStencilDepthFail(depthFail) {
    switch (depthFail) {
        case 7680:
            return _native.Engine.STENCIL_OP_FAIL_Z_KEEP;
        case 0:
            return _native.Engine.STENCIL_OP_FAIL_Z_ZERO;
        case 7681:
            return _native.Engine.STENCIL_OP_FAIL_Z_REPLACE;
        case 7682:
            return _native.Engine.STENCIL_OP_FAIL_Z_INCR;
        case 7683:
            return _native.Engine.STENCIL_OP_FAIL_Z_DECR;
        case 5386:
            return _native.Engine.STENCIL_OP_FAIL_Z_INVERT;
        case 34055:
            return _native.Engine.STENCIL_OP_FAIL_Z_INCRSAT;
        case 34056:
            return _native.Engine.STENCIL_OP_FAIL_Z_DECRSAT;
        default:
            throw new Error(`Unsupported stencil depthFail mode: ${depthFail}.`);
    }
}
function getNativeStencilDepthPass(opPass) {
    switch (opPass) {
        case 7680:
            return _native.Engine.STENCIL_OP_PASS_Z_KEEP;
        case 0:
            return _native.Engine.STENCIL_OP_PASS_Z_ZERO;
        case 7681:
            return _native.Engine.STENCIL_OP_PASS_Z_REPLACE;
        case 7682:
            return _native.Engine.STENCIL_OP_PASS_Z_INCR;
        case 7683:
            return _native.Engine.STENCIL_OP_PASS_Z_DECR;
        case 5386:
            return _native.Engine.STENCIL_OP_PASS_Z_INVERT;
        case 34055:
            return _native.Engine.STENCIL_OP_PASS_Z_INCRSAT;
        case 34056:
            return _native.Engine.STENCIL_OP_PASS_Z_DECRSAT;
        default:
            throw new Error(`Unsupported stencil opPass mode: ${opPass}.`);
    }
}
function getNativeAlphaMode(mode) {
    switch (mode) {
        case 0:
            return _native.Engine.ALPHA_DISABLE;
        case 1:
            return _native.Engine.ALPHA_ADD;
        case 2:
            return _native.Engine.ALPHA_COMBINE;
        case 3:
            return _native.Engine.ALPHA_SUBTRACT;
        case 4:
            return _native.Engine.ALPHA_MULTIPLY;
        case 5:
            return _native.Engine.ALPHA_MAXIMIZED;
        case 6:
            return _native.Engine.ALPHA_ONEONE;
        case 7:
            return _native.Engine.ALPHA_PREMULTIPLIED;
        case 8:
            return _native.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF;
        case 9:
            return _native.Engine.ALPHA_INTERPOLATE;
        case 10:
            return _native.Engine.ALPHA_SCREENMODE;
        default:
            throw new Error(`Unsupported alpha mode: ${mode}.`);
    }
}
function getNativeAttribType(type) {
    switch (type) {
        case Buffers_buffer/* VertexBuffer */.R.BYTE:
            return _native.Engine.ATTRIB_TYPE_INT8;
        case Buffers_buffer/* VertexBuffer */.R.UNSIGNED_BYTE:
            return _native.Engine.ATTRIB_TYPE_UINT8;
        case Buffers_buffer/* VertexBuffer */.R.SHORT:
            return _native.Engine.ATTRIB_TYPE_INT16;
        case Buffers_buffer/* VertexBuffer */.R.UNSIGNED_SHORT:
            return _native.Engine.ATTRIB_TYPE_UINT16;
        case Buffers_buffer/* VertexBuffer */.R.FLOAT:
            return _native.Engine.ATTRIB_TYPE_FLOAT;
        default:
            throw new Error(`Unsupported attribute type: ${type}.`);
    }
}
//# sourceMappingURL=nativeHelpers.js.map
;// ./node_modules/@babylonjs/core/Buffers/buffer.nonFloatVertexBuffers.js

const vertexBufferKindForNonFloatProcessing = {
    [Meshes_buffer/* VertexBuffer */.R.PositionKind]: true,
    [Meshes_buffer/* VertexBuffer */.R.NormalKind]: true,
    [Meshes_buffer/* VertexBuffer */.R.TangentKind]: true,
    [Meshes_buffer/* VertexBuffer */.R.UVKind]: true,
    [Meshes_buffer/* VertexBuffer */.R.UV2Kind]: true,
    [Meshes_buffer/* VertexBuffer */.R.UV3Kind]: true,
    [Meshes_buffer/* VertexBuffer */.R.UV4Kind]: true,
    [Meshes_buffer/* VertexBuffer */.R.UV5Kind]: true,
    [Meshes_buffer/* VertexBuffer */.R.UV6Kind]: true,
    [Meshes_buffer/* VertexBuffer */.R.ColorKind]: true,
    [Meshes_buffer/* VertexBuffer */.R.ColorInstanceKind]: true,
    [Meshes_buffer/* VertexBuffer */.R.MatricesIndicesKind]: true,
    [Meshes_buffer/* VertexBuffer */.R.MatricesWeightsKind]: true,
    [Meshes_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind]: true,
    [Meshes_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind]: true,
};
/**
 * Indicates if the type is a signed or unsigned type
 * @param type Type to check
 * @returns True if it is a signed type
 */
function isSignedType(type) {
    switch (type) {
        case Meshes_buffer/* VertexBuffer */.R.BYTE:
        case Meshes_buffer/* VertexBuffer */.R.SHORT:
        case Meshes_buffer/* VertexBuffer */.R.INT:
        case Meshes_buffer/* VertexBuffer */.R.FLOAT:
            return true;
        case Meshes_buffer/* VertexBuffer */.R.UNSIGNED_BYTE:
        case Meshes_buffer/* VertexBuffer */.R.UNSIGNED_SHORT:
        case Meshes_buffer/* VertexBuffer */.R.UNSIGNED_INT:
            return false;
        default:
            throw new Error(`Invalid type '${type}'`);
    }
}
/**
 * Checks whether some vertex buffers that should be of type float are of a different type (int, byte...).
 * If so, trigger a shader recompilation to give the shader processor the opportunity to update the code accordingly.
 * @param vertexBuffers List of vertex buffers to check
 * @param effect The effect (shaders) that should be recompiled if needed
 */
function checkNonFloatVertexBuffers(vertexBuffers, effect) {
    const engine = effect.getEngine();
    const pipelineContext = effect._pipelineContext;
    if (!pipelineContext?.vertexBufferKindToType) {
        return;
    }
    let shaderProcessingContext = null;
    for (const kind in vertexBuffers) {
        const currentVertexBuffer = vertexBuffers[kind];
        if (!currentVertexBuffer || !vertexBufferKindForNonFloatProcessing[kind]) {
            continue;
        }
        const currentVertexBufferType = currentVertexBuffer.normalized ? Meshes_buffer/* VertexBuffer */.R.FLOAT : currentVertexBuffer.type;
        const vertexBufferType = pipelineContext.vertexBufferKindToType[kind];
        if ((currentVertexBufferType !== Meshes_buffer/* VertexBuffer */.R.FLOAT && vertexBufferType === undefined) ||
            (vertexBufferType !== undefined && vertexBufferType !== currentVertexBufferType)) {
            if (!shaderProcessingContext) {
                shaderProcessingContext = engine._getShaderProcessingContext(effect.shaderLanguage, false);
            }
            pipelineContext.vertexBufferKindToType[kind] = currentVertexBufferType;
            if (currentVertexBufferType !== Meshes_buffer/* VertexBuffer */.R.FLOAT) {
                shaderProcessingContext.vertexBufferKindToNumberOfComponents[kind] = Meshes_buffer/* VertexBuffer */.R.DeduceStride(kind);
                if (isSignedType(currentVertexBufferType)) {
                    shaderProcessingContext.vertexBufferKindToNumberOfComponents[kind] *= -1;
                }
            }
        }
    }
    if (shaderProcessingContext) {
        // We temporarily disable parallel compilation of shaders because we want new shaders to be compiled after the _processShaderCode call, so that they are in effect for the rest of the frame.
        // There is no additional call to async so the _processShaderCodeAsync will execute synchronously.
        const parallelShaderCompile = engine._caps.parallelShaderCompile;
        engine._caps.parallelShaderCompile = undefined;
        effect._processShaderCodeAsync(null, engine._features._checkNonFloatVertexBuffersDontRecreatePipelineContext, shaderProcessingContext);
        engine._caps.parallelShaderCompile = parallelShaderCompile;
    }
}
//# sourceMappingURL=buffer.nonFloatVertexBuffers.js.map
;// ./node_modules/@babylonjs/core/Engines/Native/nativeShaderProcessingContext.js
/**
 * @internal
 */
class NativeShaderProcessingContext {
    constructor() {
        this.vertexBufferKindToNumberOfComponents = {};
        this.remappedAttributeNames = {};
        this.injectInVertexMain = "";
    }
}
//# sourceMappingURL=nativeShaderProcessingContext.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/textureLoaderManager.js
var textureLoaderManager = __webpack_require__(18454);
;// ./node_modules/@babylonjs/core/Engines/nativeEngine.js






















const onNativeObjectInitialized = new Misc_observable/* Observable */.cP();
if (typeof self !== "undefined" && !Object.prototype.hasOwnProperty.call(self, "_native")) {
    let __native;
    Object.defineProperty(self, "_native", {
        get: () => __native,
        set: (value) => {
            __native = value;
            if (__native) {
                onNativeObjectInitialized.notifyObservers(__native);
            }
        },
    });
}
/**
 * Returns _native only after it has been defined by BabylonNative.
 * @internal
 */
function AcquireNativeObjectAsync() {
    return new Promise((resolve) => {
        if (typeof _native === "undefined") {
            onNativeObjectInitialized.addOnce((nativeObject) => resolve(nativeObject));
        }
        else {
            resolve(_native);
        }
    });
}
/**
 * Registers a constructor on the _native object. See NativeXRFrame for an example.
 * @internal
 */
async function RegisterNativeTypeAsync(typeName, constructor) {
    (await AcquireNativeObjectAsync())[typeName] = constructor;
}
/**
 * Container for accessors for natively-stored mesh data buffers.
 */
class NativeDataBuffer extends dataBuffer/* DataBuffer */.n {
}
/** @internal */
class CommandBufferEncoder {
    constructor(_engine) {
        this._engine = _engine;
        this._pending = new Array();
        this._isCommandBufferScopeActive = false;
        this._commandStream = NativeEngine._createNativeDataStream();
        this._engine.setCommandDataStream(this._commandStream);
    }
    beginCommandScope() {
        if (this._isCommandBufferScopeActive) {
            throw new Error("Command scope already active.");
        }
        this._isCommandBufferScopeActive = true;
    }
    endCommandScope() {
        if (!this._isCommandBufferScopeActive) {
            throw new Error("Command scope is not active.");
        }
        this._isCommandBufferScopeActive = false;
        this._submit();
    }
    startEncodingCommand(command) {
        this._commandStream.writeNativeData(command);
    }
    encodeCommandArgAsUInt32(commandArg) {
        this._commandStream.writeUint32(commandArg);
    }
    encodeCommandArgAsUInt32s(commandArg) {
        this._commandStream.writeUint32Array(commandArg);
    }
    encodeCommandArgAsInt32(commandArg) {
        this._commandStream.writeInt32(commandArg);
    }
    encodeCommandArgAsInt32s(commandArg) {
        this._commandStream.writeInt32Array(commandArg);
    }
    encodeCommandArgAsFloat32(commandArg) {
        this._commandStream.writeFloat32(commandArg);
    }
    encodeCommandArgAsFloat32s(commandArg) {
        this._commandStream.writeFloat32Array(commandArg);
    }
    encodeCommandArgAsNativeData(commandArg) {
        this._commandStream.writeNativeData(commandArg);
        this._pending.push(commandArg);
    }
    finishEncodingCommand() {
        if (!this._isCommandBufferScopeActive) {
            this._submit();
        }
    }
    _submit() {
        this._engine.submitCommands();
        this._pending.length = 0;
    }
}
const remappedAttributesNames = [];
/** @internal */
class NativeEngine extends Engines_engine/* Engine */.N {
    setHardwareScalingLevel(level) {
        super.setHardwareScalingLevel(level);
        this._engine.setHardwareScalingLevel(level);
    }
    constructor(options = {}) {
        super(null, false, undefined, options.adaptToDeviceRatio);
        this._engine = new _native.Engine({
            version: Engines_engine/* Engine */.N.Version,
            nonFloatVertexBuffers: true,
        });
        this._camera = _native.Camera ? new _native.Camera() : null;
        this._commandBufferEncoder = new CommandBufferEncoder(this._engine);
        this._boundBuffersVertexArray = null;
        this._currentDepthTest = _native.Engine.DEPTH_TEST_LEQUAL;
        this._stencilTest = false;
        this._stencilMask = 255;
        this._stencilFunc = 519;
        this._stencilFuncRef = 0;
        this._stencilFuncMask = 255;
        this._stencilOpStencilFail = 7680;
        this._stencilOpDepthFail = 7680;
        this._stencilOpStencilDepthPass = 7681;
        this._zOffset = 0;
        this._zOffsetUnits = 0;
        this._depthWrite = true;
        // warning for non supported fill mode has already been displayed
        this._fillModeWarningDisplayed = false;
        if (_native.Engine.PROTOCOL_VERSION !== NativeEngine.PROTOCOL_VERSION) {
            throw new Error(`Protocol version mismatch: ${_native.Engine.PROTOCOL_VERSION} (Native) !== ${NativeEngine.PROTOCOL_VERSION} (JS)`);
        }
        if (this._engine.setDeviceLostCallback) {
            this._engine.setDeviceLostCallback(() => {
                this.onContextLostObservable.notifyObservers(this);
                this._contextWasLost = true;
                this._restoreEngineAfterContextLost();
            });
        }
        this._webGLVersion = 2;
        this.disableUniformBuffers = true;
        this._shaderPlatformName = "NATIVE";
        // TODO: Initialize this more correctly based on the hardware capabilities.
        // Init caps
        this._caps = {
            maxTexturesImageUnits: 16,
            maxVertexTextureImageUnits: 16,
            maxCombinedTexturesImageUnits: 32,
            maxTextureSize: _native.Engine.CAPS_LIMITS_MAX_TEXTURE_SIZE,
            maxCubemapTextureSize: 512,
            maxRenderTextureSize: 512,
            maxVertexAttribs: 16,
            maxVaryingVectors: 16,
            maxDrawBuffers: 8,
            maxFragmentUniformVectors: 16,
            maxVertexUniformVectors: 16,
            standardDerivatives: true,
            astc: null,
            pvrtc: null,
            etc1: null,
            etc2: null,
            bptc: null,
            maxAnisotropy: 16, // TODO: Retrieve this smartly. Currently set to D3D11 maximum allowable value.
            uintIndices: true,
            fragmentDepthSupported: false,
            highPrecisionShaderSupported: true,
            colorBufferFloat: false,
            supportFloatTexturesResolve: false,
            rg11b10ufColorRenderable: false,
            textureFloat: true,
            textureFloatLinearFiltering: true,
            textureFloatRender: true,
            textureHalfFloat: true,
            textureHalfFloatLinearFiltering: true,
            textureHalfFloatRender: true,
            textureLOD: true,
            texelFetch: false,
            drawBuffersExtension: false,
            depthTextureExtension: false,
            vertexArrayObject: true,
            instancedArrays: true,
            supportOcclusionQuery: false,
            canUseTimestampForTimerQuery: false,
            blendMinMax: false,
            maxMSAASamples: 16,
            canUseGLInstanceID: true,
            canUseGLVertexID: true,
            supportComputeShaders: false,
            supportSRGBBuffers: true,
            supportTransformFeedbacks: false,
            textureMaxLevel: false,
            texture2DArrayMaxLayerCount: _native.Engine.CAPS_LIMITS_MAX_TEXTURE_LAYERS,
            disableMorphTargetTexture: false,
            parallelShaderCompile: { COMPLETION_STATUS_KHR: 0 },
            textureNorm16: false,
        };
        this._features = {
            forceBitmapOverHTMLImageElement: true,
            supportRenderAndCopyToLodForFloatTextures: false,
            supportDepthStencilTexture: false,
            supportShadowSamplers: false,
            uniformBufferHardCheckMatrix: false,
            allowTexturePrefiltering: false,
            trackUbosInFrame: false,
            checkUbosContentBeforeUpload: false,
            supportCSM: false,
            basisNeedsPOT: false,
            support3DTextures: false,
            needTypeSuffixInShaderConstants: false,
            supportMSAA: true,
            supportSSAO2: false,
            supportIBLShadows: false,
            supportExtendedTextureFormats: false,
            supportSwitchCaseInShader: false,
            supportSyncTextureRead: false,
            needsInvertingBitmap: true,
            useUBOBindingCache: true,
            needShaderCodeInlining: true,
            needToAlwaysBindUniformBuffers: false,
            supportRenderPasses: true,
            supportSpriteInstancing: false,
            forceVertexBufferStrideAndOffsetMultiple4Bytes: true,
            _checkNonFloatVertexBuffersDontRecreatePipelineContext: false,
            _collectUbosUpdatedInFrame: false,
        };
        tools/* Tools */.S0.Log("Babylon Native (v" + Engines_engine/* Engine */.N.Version + ") launched");
        tools/* Tools */.S0.LoadScript = function (scriptUrl, onSuccess, onError, scriptId) {
            tools/* Tools */.S0.LoadFile(scriptUrl, (data) => {
                Function(data).apply(null);
                if (onSuccess) {
                    onSuccess();
                }
            }, undefined, undefined, false, (request, exception) => {
                if (onError) {
                    onError("LoadScript Error", exception);
                }
            });
        };
        // Wrappers
        if (typeof URL === "undefined") {
            window.URL = {
                createObjectURL: function () { },
                revokeObjectURL: function () { },
            };
        }
        if (typeof Blob === "undefined") {
            window.Blob = function (v) {
                return v;
            };
        }
        // polyfill for Chakra
        if (!Array.prototype.flat) {
            Object.defineProperty(Array.prototype, "flat", {
                configurable: true,
                value: function flat() {
                    const depth = isNaN(arguments[0]) ? 1 : Number(arguments[0]);
                    return depth
                        ? Array.prototype.reduce.call(this, function (acc, cur) {
                            if (Array.isArray(cur)) {
                                acc.push.apply(acc, flat.call(cur, depth - 1));
                            }
                            else {
                                acc.push(cur);
                            }
                            return acc;
                        }, [])
                        : Array.prototype.slice.call(this);
                },
                writable: true,
            });
        }
        // Currently we do not fully configure the ThinEngine on construction of NativeEngine.
        // Setup resolution scaling based on display settings.
        const devicePixelRatio = window ? window.devicePixelRatio || 1.0 : 1.0;
        this._hardwareScalingLevel = options.adaptToDeviceRatio ? 1.0 / devicePixelRatio : 1.0;
        this._engine.setHardwareScalingLevel(this._hardwareScalingLevel);
        this._lastDevicePixelRatio = devicePixelRatio;
        this.resize();
        const currentDepthFunction = this.getDepthFunction();
        if (currentDepthFunction) {
            this.setDepthFunction(currentDepthFunction);
        }
        // Shader processor
        this._shaderProcessor = new NativeShaderProcessor();
        this.onNewSceneAddedObservable.add((scene) => {
            const originalRender = scene.render;
            scene.render = (...args) => {
                this._commandBufferEncoder.beginCommandScope();
                originalRender.apply(scene, args);
                this._commandBufferEncoder.endCommandScope();
            };
        });
    }
    dispose() {
        super.dispose();
        if (this._boundBuffersVertexArray) {
            this._deleteVertexArray(this._boundBuffersVertexArray);
        }
        this._engine.dispose();
    }
    /** @internal */
    static _createNativeDataStream() {
        return new NativeDataStream();
    }
    /**
     * Can be used to override the current requestAnimationFrame requester.
     * @internal
     */
    _queueNewFrame(bindedRenderFunction, requester) {
        // Use the provided requestAnimationFrame, unless the requester is the window. In that case, we will default to the Babylon Native version of requestAnimationFrame.
        if (requester.requestAnimationFrame && requester !== window) {
            requester.requestAnimationFrame(bindedRenderFunction);
        }
        else {
            this._engine.requestAnimationFrame(bindedRenderFunction);
        }
        return 0;
    }
    _restoreEngineAfterContextLost() {
        this._clearEmptyResources();
        const depthTest = this._depthCullingState.depthTest; // backup those values because the call to initEngine / wipeCaches will reset them
        const depthFunc = this._depthCullingState.depthFunc;
        const depthMask = this._depthCullingState.depthMask;
        const stencilTest = this._stencilState.stencilTest;
        this._rebuildGraphicsResources();
        this._depthCullingState.depthTest = depthTest;
        this._depthCullingState.depthFunc = depthFunc;
        this._depthCullingState.depthMask = depthMask;
        this._stencilState.stencilTest = stencilTest;
        this._flagContextRestored();
    }
    /**
     * Override default engine behavior.
     * @param framebuffer
     */
    _bindUnboundFramebuffer(framebuffer) {
        if (this._currentFramebuffer !== framebuffer) {
            if (this._currentFramebuffer) {
                this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_UNBINDFRAMEBUFFER);
                this._commandBufferEncoder.encodeCommandArgAsNativeData(this._currentFramebuffer);
                this._commandBufferEncoder.finishEncodingCommand();
            }
            if (framebuffer) {
                this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_BINDFRAMEBUFFER);
                this._commandBufferEncoder.encodeCommandArgAsNativeData(framebuffer);
                this._commandBufferEncoder.finishEncodingCommand();
            }
            this._currentFramebuffer = framebuffer;
        }
    }
    /**
     * Gets host document
     * @returns the host document object
     */
    getHostDocument() {
        return null;
    }
    clear(color, backBuffer, depth, stencil = false) {
        if (this.useReverseDepthBuffer) {
            throw new Error("reverse depth buffer is not currently implemented");
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_CLEAR);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(backBuffer && color ? 1 : 0);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(color ? color.r : 0);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(color ? color.g : 0);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(color ? color.b : 0);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(color ? color.a : 1);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(depth ? 1 : 0);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(1);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(stencil ? 1 : 0);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(0);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    createIndexBuffer(indices, updateable, _label) {
        const data = this._normalizeIndexData(indices);
        const buffer = new NativeDataBuffer();
        buffer.references = 1;
        buffer.is32Bits = data.BYTES_PER_ELEMENT === 4;
        if (data.byteLength) {
            buffer.nativeIndexBuffer = this._engine.createIndexBuffer(data.buffer, data.byteOffset, data.byteLength, buffer.is32Bits, updateable ?? false);
        }
        return buffer;
    }
    createVertexBuffer(vertices, updateable, _label) {
        const data = ArrayBuffer.isView(vertices) ? vertices : new Float32Array(vertices);
        const buffer = new NativeDataBuffer();
        buffer.references = 1;
        if (data.byteLength) {
            buffer.nativeVertexBuffer = this._engine.createVertexBuffer(data.buffer, data.byteOffset, data.byteLength, updateable ?? false);
        }
        return buffer;
    }
    _recordVertexArrayObject(vertexArray, vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {
        if (!effect._checkedNonFloatVertexBuffers) {
            checkNonFloatVertexBuffers(vertexBuffers, effect);
            effect._checkedNonFloatVertexBuffers = true;
        }
        if (indexBuffer) {
            this._engine.recordIndexBuffer(vertexArray, indexBuffer.nativeIndexBuffer);
        }
        const attributes = effect.getAttributesNames();
        for (let index = 0; index < attributes.length; index++) {
            const location = effect.getAttributeLocation(index);
            if (location >= 0) {
                const kind = attributes[index];
                let vertexBuffer = null;
                if (overrideVertexBuffers) {
                    vertexBuffer = overrideVertexBuffers[kind];
                }
                if (!vertexBuffer) {
                    vertexBuffer = vertexBuffers[kind];
                }
                if (vertexBuffer) {
                    const buffer = vertexBuffer.effectiveBuffer;
                    if (buffer && buffer.nativeVertexBuffer) {
                        this._engine.recordVertexBuffer(vertexArray, buffer.nativeVertexBuffer, location, vertexBuffer.effectiveByteOffset, vertexBuffer.effectiveByteStride, vertexBuffer.getSize(), getNativeAttribType(vertexBuffer.type), vertexBuffer.normalized, vertexBuffer.getInstanceDivisor());
                    }
                }
            }
        }
    }
    bindBuffers(vertexBuffers, indexBuffer, effect) {
        if (this._boundBuffersVertexArray) {
            this._deleteVertexArray(this._boundBuffersVertexArray);
        }
        this._boundBuffersVertexArray = this._engine.createVertexArray();
        this._recordVertexArrayObject(this._boundBuffersVertexArray, vertexBuffers, indexBuffer, effect);
        this.bindVertexArrayObject(this._boundBuffersVertexArray);
    }
    recordVertexArrayObject(vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {
        const vertexArray = this._engine.createVertexArray();
        this._recordVertexArrayObject(vertexArray, vertexBuffers, indexBuffer, effect, overrideVertexBuffers);
        return vertexArray;
    }
    _deleteVertexArray(vertexArray) {
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEVERTEXARRAY);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(vertexArray);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    bindVertexArrayObject(vertexArray) {
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_BINDVERTEXARRAY);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(vertexArray);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    releaseVertexArrayObject(vertexArray) {
        this._deleteVertexArray(vertexArray);
    }
    getAttributes(pipelineContext, attributesNames) {
        const nativePipelineContext = pipelineContext;
        const nativeShaderProcessingContext = nativePipelineContext.shaderProcessingContext;
        remappedAttributesNames.length = 0;
        for (let index = 0; index < attributesNames.length; index++) {
            const origAttributeName = attributesNames[index];
            const attributeName = nativeShaderProcessingContext.remappedAttributeNames[origAttributeName] ?? origAttributeName;
            remappedAttributesNames[index] = attributeName;
        }
        return this._engine.getAttributes(nativePipelineContext.program, remappedAttributesNames);
    }
    /**
     * Triangle Fan and Line Loop are not supported by modern rendering API
     * @param fillMode  defines the primitive to use
     * @returns true if supported
     */
    _checkSupportedFillMode(fillMode) {
        if (fillMode == 5 || fillMode == 8) {
            if (!this._fillModeWarningDisplayed) {
                logger/* Logger */.V.Warn("Line Loop and Triangle Fan are not supported fill modes with Babylon Native. Elements with these fill mode will not be visible.");
                this._fillModeWarningDisplayed = true;
            }
            return false;
        }
        return true;
    }
    /**
     * Draw a list of indexed primitives
     * @param fillMode defines the primitive to use
     * @param indexStart defines the starting index
     * @param indexCount defines the number of index to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawElementsType(fillMode, indexStart, indexCount, instancesCount) {
        if (!this._checkSupportedFillMode(fillMode)) {
            return;
        }
        // Apply states
        this._drawCalls.addCount(1, false);
        if (instancesCount && _native.Engine.COMMAND_DRAWINDEXEDINSTANCED) {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINDEXEDINSTANCED);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(indexStart);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(indexCount);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(instancesCount);
        }
        else {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINDEXED);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(indexStart);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(indexCount);
        }
        this._commandBufferEncoder.finishEncodingCommand();
        // }
    }
    /**
     * Draw a list of unindexed primitives
     * @param fillMode defines the primitive to use
     * @param verticesStart defines the index of first vertex to draw
     * @param verticesCount defines the count of vertices to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawArraysType(fillMode, verticesStart, verticesCount, instancesCount) {
        if (!this._checkSupportedFillMode(fillMode)) {
            return;
        }
        // Apply states
        this._drawCalls.addCount(1, false);
        if (instancesCount && _native.Engine.COMMAND_DRAWINSTANCED) {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINSTANCED);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesStart);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesCount);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(instancesCount);
        }
        else {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAW);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesStart);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesCount);
        }
        this._commandBufferEncoder.finishEncodingCommand();
        // }
    }
    createPipelineContext(shaderProcessingContext) {
        const isAsync = !!(this._caps.parallelShaderCompile && this._engine.createProgramAsync);
        return new NativePipelineContext(this, isAsync, shaderProcessingContext);
    }
    createMaterialContext() {
        return undefined;
    }
    createDrawContext() {
        return undefined;
    }
    /**
     * @internal
     */
    _preparePipelineContext(pipelineContext, vertexSourceCode, fragmentSourceCode, createAsRaw, _rawVertexSourceCode, _rawFragmentSourceCode, _rebuildRebind, defines, _transformFeedbackVaryings, _key, onReady) {
        if (createAsRaw) {
            this.createRawShaderProgram();
        }
        else {
            this.createShaderProgram(pipelineContext, vertexSourceCode, fragmentSourceCode, defines);
        }
        onReady();
    }
    /**
     * @internal
     */
    _getShaderProcessingContext(_shaderLanguage) {
        return new NativeShaderProcessingContext();
    }
    /**
     * @internal
     */
    _executeWhenRenderingStateIsCompiled(pipelineContext, action) {
        const nativePipelineContext = pipelineContext;
        if (nativePipelineContext.isAsync) {
            if (nativePipelineContext.onCompiled) {
                const oldHandler = nativePipelineContext.onCompiled;
                nativePipelineContext.onCompiled = () => {
                    oldHandler();
                    action();
                };
            }
            else {
                nativePipelineContext.onCompiled = action;
            }
        }
        else {
            action();
        }
    }
    createRawShaderProgram() {
        throw new Error("Not Supported");
    }
    createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines) {
        const nativePipelineContext = pipelineContext;
        this.onBeforeShaderCompilationObservable.notifyObservers(this);
        const vertexInliner = new shaderCodeInliner/* ShaderCodeInliner */.Y(vertexCode);
        vertexInliner.processCode();
        vertexCode = vertexInliner.code;
        const fragmentInliner = new shaderCodeInliner/* ShaderCodeInliner */.Y(fragmentCode);
        fragmentInliner.processCode();
        fragmentCode = fragmentInliner.code;
        vertexCode = thinEngine.ThinEngine._ConcatenateShader(vertexCode, defines);
        fragmentCode = thinEngine.ThinEngine._ConcatenateShader(fragmentCode, defines);
        const onSuccess = () => {
            nativePipelineContext.isCompiled = true;
            nativePipelineContext.onCompiled?.();
            this.onAfterShaderCompilationObservable.notifyObservers(this);
        };
        if (pipelineContext.isAsync) {
            nativePipelineContext.program = this._engine.createProgramAsync(vertexCode, fragmentCode, onSuccess, (error) => {
                nativePipelineContext.compilationError = error;
            });
        }
        else {
            try {
                nativePipelineContext.program = this._engine.createProgram(vertexCode, fragmentCode);
                onSuccess();
            }
            catch (e) {
                const message = e?.message;
                throw new Error("SHADER ERROR" + (typeof message === "string" ? "\n" + message : ""));
            }
        }
        return nativePipelineContext.program;
    }
    /**
     * Inline functions in shader code that are marked to be inlined
     * @param code code to inline
     * @returns inlined code
     */
    inlineShaderCode(code) {
        const sci = new shaderCodeInliner/* ShaderCodeInliner */.Y(code);
        sci.debug = false;
        sci.processCode();
        return sci.code;
    }
    _setProgram(program) {
        if (this._currentProgram !== program) {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETPROGRAM);
            this._commandBufferEncoder.encodeCommandArgAsNativeData(program);
            this._commandBufferEncoder.finishEncodingCommand();
            this._currentProgram = program;
        }
    }
    _deletePipelineContext(pipelineContext) {
        const nativePipelineContext = pipelineContext;
        if (nativePipelineContext && nativePipelineContext.program) {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEPROGRAM);
            this._commandBufferEncoder.encodeCommandArgAsNativeData(nativePipelineContext.program);
            this._commandBufferEncoder.finishEncodingCommand();
        }
    }
    getUniforms(pipelineContext, uniformsNames) {
        const nativePipelineContext = pipelineContext;
        return this._engine.getUniforms(nativePipelineContext.program, uniformsNames);
    }
    bindUniformBlock(pipelineContext, blockName, index) {
        // TODO
        throw new Error("Not Implemented");
    }
    bindSamplers(effect) {
        const nativePipelineContext = effect.getPipelineContext();
        this._setProgram(nativePipelineContext.program);
        // TODO: share this with engine?
        const samplers = effect.getSamplers();
        for (let index = 0; index < samplers.length; index++) {
            const uniform = effect.getUniform(samplers[index]);
            if (uniform) {
                this._boundUniforms[index] = uniform;
            }
        }
        this._currentEffect = null;
    }
    getRenderWidth(useScreen = false) {
        if (!useScreen && this._currentRenderTarget) {
            return this._currentRenderTarget.width;
        }
        return this._engine.getRenderWidth();
    }
    getRenderHeight(useScreen = false) {
        if (!useScreen && this._currentRenderTarget) {
            return this._currentRenderTarget.height;
        }
        return this._engine.getRenderHeight();
    }
    setViewport(viewport, requiredWidth, requiredHeight) {
        this._cachedViewport = viewport;
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETVIEWPORT);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(viewport.x);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(viewport.y);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(viewport.width);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(viewport.height);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    enableScissor(x, y, width, height) {
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSCISSOR);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(x);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(y);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(width);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(height);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    disableScissor() {
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSCISSOR);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(0);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(0);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(0);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(0);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    setState(culling, zOffset = 0, force, reverseSide = false, cullBackFaces, stencil, zOffsetUnits = 0) {
        this._zOffset = zOffset;
        this._zOffsetUnits = zOffsetUnits;
        if (this._zOffset !== 0) {
            tools/* Tools */.S0.Warn("zOffset is not supported in Native engine.");
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSTATE);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(culling ? 1 : 0);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(zOffset);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(zOffsetUnits);
        this._commandBufferEncoder.encodeCommandArgAsUInt32((this.cullBackFaces ?? cullBackFaces ?? true) ? 1 : 0);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(reverseSide ? 1 : 0);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    /**
     * Gets the client rect of native canvas.  Needed for InputManager.
     * @returns a client rectangle
     */
    getInputElementClientRect() {
        const rect = {
            bottom: this.getRenderHeight(),
            height: this.getRenderHeight(),
            left: 0,
            right: this.getRenderWidth(),
            top: 0,
            width: this.getRenderWidth(),
            x: 0,
            y: 0,
            toJSON: () => { },
        };
        return rect;
    }
    /**
     * Set the z offset Factor to apply to current rendering
     * @param value defines the offset to apply
     */
    setZOffset(value) {
        if (value !== this._zOffset) {
            this._zOffset = value;
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETZOFFSET);
            this._commandBufferEncoder.encodeCommandArgAsFloat32(this.useReverseDepthBuffer ? -value : value);
            this._commandBufferEncoder.finishEncodingCommand();
        }
    }
    /**
     * Gets the current value of the zOffset Factor
     * @returns the current zOffset Factor state
     */
    getZOffset() {
        return this._zOffset;
    }
    /**
     * Set the z offset Units to apply to current rendering
     * @param value defines the offset to apply
     */
    setZOffsetUnits(value) {
        if (value !== this._zOffsetUnits) {
            this._zOffsetUnits = value;
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETZOFFSETUNITS);
            this._commandBufferEncoder.encodeCommandArgAsFloat32(this.useReverseDepthBuffer ? -value : value);
            this._commandBufferEncoder.finishEncodingCommand();
        }
    }
    /**
     * Gets the current value of the zOffset Units
     * @returns the current zOffset Units state
     */
    getZOffsetUnits() {
        return this._zOffsetUnits;
    }
    /**
     * Enable or disable depth buffering
     * @param enable defines the state to set
     */
    setDepthBuffer(enable) {
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHTEST);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(enable ? this._currentDepthTest : _native.Engine.DEPTH_TEST_ALWAYS);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    /**
     * Gets a boolean indicating if depth writing is enabled
     * @returns the current depth writing state
     */
    getDepthWrite() {
        return this._depthWrite;
    }
    getDepthFunction() {
        switch (this._currentDepthTest) {
            case _native.Engine.DEPTH_TEST_NEVER:
                return 512;
            case _native.Engine.DEPTH_TEST_ALWAYS:
                return 519;
            case _native.Engine.DEPTH_TEST_GREATER:
                return 516;
            case _native.Engine.DEPTH_TEST_GEQUAL:
                return 518;
            case _native.Engine.DEPTH_TEST_NOTEQUAL:
                return 517;
            case _native.Engine.DEPTH_TEST_EQUAL:
                return 514;
            case _native.Engine.DEPTH_TEST_LESS:
                return 513;
            case _native.Engine.DEPTH_TEST_LEQUAL:
                return 515;
        }
        return null;
    }
    setDepthFunction(depthFunc) {
        let nativeDepthFunc = 0;
        switch (depthFunc) {
            case 512:
                nativeDepthFunc = _native.Engine.DEPTH_TEST_NEVER;
                break;
            case 519:
                nativeDepthFunc = _native.Engine.DEPTH_TEST_ALWAYS;
                break;
            case 516:
                nativeDepthFunc = _native.Engine.DEPTH_TEST_GREATER;
                break;
            case 518:
                nativeDepthFunc = _native.Engine.DEPTH_TEST_GEQUAL;
                break;
            case 517:
                nativeDepthFunc = _native.Engine.DEPTH_TEST_NOTEQUAL;
                break;
            case 514:
                nativeDepthFunc = _native.Engine.DEPTH_TEST_EQUAL;
                break;
            case 513:
                nativeDepthFunc = _native.Engine.DEPTH_TEST_LESS;
                break;
            case 515:
                nativeDepthFunc = _native.Engine.DEPTH_TEST_LEQUAL;
                break;
        }
        this._currentDepthTest = nativeDepthFunc;
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHTEST);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(this._currentDepthTest);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    /**
     * Enable or disable depth writing
     * @param enable defines the state to set
     */
    setDepthWrite(enable) {
        this._depthWrite = enable;
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETDEPTHWRITE);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(Number(enable));
        this._commandBufferEncoder.finishEncodingCommand();
    }
    /**
     * Enable or disable color writing
     * @param enable defines the state to set
     */
    setColorWrite(enable) {
        this._colorWrite = enable;
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETCOLORWRITE);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(Number(enable));
        this._commandBufferEncoder.finishEncodingCommand();
    }
    /**
     * Gets a boolean indicating if color writing is enabled
     * @returns the current color writing state
     */
    getColorWrite() {
        return this._colorWrite;
    }
    applyStencil() {
        this._setStencil(this._stencilMask, getNativeStencilOpFail(this._stencilOpStencilFail), getNativeStencilDepthFail(this._stencilOpDepthFail), getNativeStencilDepthPass(this._stencilOpStencilDepthPass), getNativeStencilFunc(this._stencilFunc), this._stencilFuncRef);
    }
    _setStencil(mask, stencilOpFail, depthOpFail, depthOpPass, func, ref) {
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSTENCIL);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(mask);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(stencilOpFail);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(depthOpFail);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(depthOpPass);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(func);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(ref);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    /**
     * Enable or disable the stencil buffer
     * @param enable defines if the stencil buffer must be enabled or disabled
     */
    setStencilBuffer(enable) {
        this._stencilTest = enable;
        if (enable) {
            this.applyStencil();
        }
        else {
            this._setStencil(255, _native.Engine.STENCIL_OP_FAIL_S_KEEP, _native.Engine.STENCIL_OP_FAIL_Z_KEEP, _native.Engine.STENCIL_OP_PASS_Z_KEEP, _native.Engine.STENCIL_TEST_ALWAYS, 0);
        }
    }
    /**
     * Gets a boolean indicating if stencil buffer is enabled
     * @returns the current stencil buffer state
     */
    getStencilBuffer() {
        return this._stencilTest;
    }
    /**
     * Gets the current stencil operation when stencil passes
     * @returns a number defining stencil operation to use when stencil passes
     */
    getStencilOperationPass() {
        return this._stencilOpStencilDepthPass;
    }
    /**
     * Sets the stencil operation to use when stencil passes
     * @param operation defines the stencil operation to use when stencil passes
     */
    setStencilOperationPass(operation) {
        this._stencilOpStencilDepthPass = operation;
        this.applyStencil();
    }
    /**
     * Sets the current stencil mask
     * @param mask defines the new stencil mask to use
     */
    setStencilMask(mask) {
        this._stencilMask = mask;
        this.applyStencil();
    }
    /**
     * Sets the current stencil function
     * @param stencilFunc defines the new stencil function to use
     */
    setStencilFunction(stencilFunc) {
        this._stencilFunc = stencilFunc;
        this.applyStencil();
    }
    /**
     * Sets the current stencil reference
     * @param reference defines the new stencil reference to use
     */
    setStencilFunctionReference(reference) {
        this._stencilFuncRef = reference;
        this.applyStencil();
    }
    /**
     * Sets the current stencil mask
     * @param mask defines the new stencil mask to use
     */
    setStencilFunctionMask(mask) {
        this._stencilFuncMask = mask;
    }
    /**
     * Sets the stencil operation to use when stencil fails
     * @param operation defines the stencil operation to use when stencil fails
     */
    setStencilOperationFail(operation) {
        this._stencilOpStencilFail = operation;
        this.applyStencil();
    }
    /**
     * Sets the stencil operation to use when depth fails
     * @param operation defines the stencil operation to use when depth fails
     */
    setStencilOperationDepthFail(operation) {
        this._stencilOpDepthFail = operation;
        this.applyStencil();
    }
    /**
     * Gets the current stencil mask
     * @returns a number defining the new stencil mask to use
     */
    getStencilMask() {
        return this._stencilMask;
    }
    /**
     * Gets the current stencil function
     * @returns a number defining the stencil function to use
     */
    getStencilFunction() {
        return this._stencilFunc;
    }
    /**
     * Gets the current stencil reference value
     * @returns a number defining the stencil reference value to use
     */
    getStencilFunctionReference() {
        return this._stencilFuncRef;
    }
    /**
     * Gets the current stencil mask
     * @returns a number defining the stencil mask to use
     */
    getStencilFunctionMask() {
        return this._stencilFuncMask;
    }
    /**
     * Gets the current stencil operation when stencil fails
     * @returns a number defining stencil operation to use when stencil fails
     */
    getStencilOperationFail() {
        return this._stencilOpStencilFail;
    }
    /**
     * Gets the current stencil operation when depth fails
     * @returns a number defining stencil operation to use when depth fails
     */
    getStencilOperationDepthFail() {
        return this._stencilOpDepthFail;
    }
    /**
     * Sets alpha constants used by some alpha blending modes
     * @param r defines the red component
     * @param g defines the green component
     * @param b defines the blue component
     * @param a defines the alpha component
     */
    setAlphaConstants(r, g, b, a) {
        throw new Error("Setting alpha blend constant color not yet implemented.");
    }
    /**
     * Sets the current alpha mode
     * @param mode defines the mode to use (one of the BABYLON.undefined)
     * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
     */
    setAlphaMode(mode, noDepthWriteChange = false) {
        if (this._alphaMode === mode) {
            return;
        }
        const nativeMode = getNativeAlphaMode(mode);
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETBLENDMODE);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(nativeMode);
        this._commandBufferEncoder.finishEncodingCommand();
        if (!noDepthWriteChange) {
            this.setDepthWrite(mode === 0);
        }
        this._alphaMode = mode;
    }
    setInt(uniform, int) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINT);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsInt32(int);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setIntArray(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsInt32s(array);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setIntArray2(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY2);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsInt32s(array);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setIntArray3(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY3);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsInt32s(array);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setIntArray4(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETINTARRAY4);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsInt32s(array);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setFloatArray(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32s(array);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setFloatArray2(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY2);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32s(array);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setFloatArray3(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY3);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32s(array);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setFloatArray4(uniform, array) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOATARRAY4);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32s(array);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setArray(uniform, array) {
        if (!uniform) {
            return false;
        }
        return this.setFloatArray(uniform, new Float32Array(array));
    }
    setArray2(uniform, array) {
        if (!uniform) {
            return false;
        }
        return this.setFloatArray2(uniform, new Float32Array(array));
    }
    setArray3(uniform, array) {
        if (!uniform) {
            return false;
        }
        return this.setFloatArray3(uniform, new Float32Array(array));
    }
    setArray4(uniform, array) {
        if (!uniform) {
            return false;
        }
        return this.setFloatArray4(uniform, new Float32Array(array));
    }
    setMatrices(uniform, matrices) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRICES);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32s(matrices);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setMatrix3x3(uniform, matrix) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRIX3X3);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32s(matrix);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setMatrix2x2(uniform, matrix) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETMATRIX2X2);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32s(matrix);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setFloat(uniform, value) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(value);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setFloat2(uniform, x, y) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT2);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(x);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(y);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setFloat3(uniform, x, y, z) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT3);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(x);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(y);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(z);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setFloat4(uniform, x, y, z, w) {
        if (!uniform) {
            return false;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETFLOAT4);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(x);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(y);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(z);
        this._commandBufferEncoder.encodeCommandArgAsFloat32(w);
        this._commandBufferEncoder.finishEncodingCommand();
        return true;
    }
    setColor3(uniform, color3) {
        if (!uniform) {
            return false;
        }
        this.setFloat3(uniform, color3.r, color3.g, color3.b);
        return true;
    }
    setColor4(uniform, color3, alpha) {
        if (!uniform) {
            return false;
        }
        this.setFloat4(uniform, color3.r, color3.g, color3.b, alpha);
        return true;
    }
    wipeCaches(bruteForce) {
        if (this.preventCacheWipeBetweenFrames) {
            return;
        }
        this.resetTextureCache();
        this._currentEffect = null;
        if (bruteForce) {
            this._currentProgram = null;
            this._stencilStateComposer.reset();
            this._depthCullingState.reset();
            this._alphaState.reset();
        }
        this._cachedVertexBuffers = null;
        this._cachedIndexBuffer = null;
        this._cachedEffectForVertexBuffers = null;
    }
    _createTexture() {
        return this._engine.createTexture();
    }
    _deleteTexture(texture) {
        if (texture) {
            this._engine.deleteTexture(texture.underlyingResource);
        }
    }
    /**
     * Update the content of a dynamic texture
     * @param texture defines the texture to update
     * @param canvas defines the canvas containing the source
     * @param invertY defines if data must be stored with Y axis inverted
     * @param premulAlpha defines if alpha is stored as premultiplied
     * @param format defines the format of the data
     */
    updateDynamicTexture(texture, canvas, invertY, premulAlpha = false, format) {
        if (premulAlpha === void 0) {
            premulAlpha = false;
        }
        if (!!texture && !!texture._hardwareTexture) {
            const source = canvas.getCanvasTexture();
            const destination = texture._hardwareTexture.underlyingResource;
            this._engine.copyTexture(destination, source);
            texture.isReady = true;
        }
    }
    createDynamicTexture(width, height, generateMipMaps, samplingMode) {
        // it's not possible to create 0x0 texture sized. Many bgfx methods assume texture size is at least 1x1(best case).
        // Worst case is getting a crash/assert.
        width = Math.max(width, 1);
        height = Math.max(height, 1);
        return this.createRawTexture(new Uint8Array(width * height * 4), width, height, 5, false, false, samplingMode);
    }
    createVideoElement(constraints) {
        // create native object depending on stream. Only NativeCamera is supported for now.
        if (this._camera) {
            return this._camera.createVideo(constraints);
        }
        return null;
    }
    updateVideoTexture(texture, video, invertY) {
        if (texture && texture._hardwareTexture && this._camera) {
            const webGLTexture = texture._hardwareTexture.underlyingResource;
            this._camera.updateVideoTexture(webGLTexture, video, invertY);
        }
    }
    createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = false) {
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 3 /* InternalTextureSource.Raw */);
        texture.format = format;
        texture.generateMipMaps = generateMipMaps;
        texture.samplingMode = samplingMode;
        texture.invertY = invertY;
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.width = texture.baseWidth;
        texture.height = texture.baseHeight;
        texture._compression = compression;
        texture.type = type;
        texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps);
        this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer);
        if (texture._hardwareTexture) {
            const webGLTexture = texture._hardwareTexture.underlyingResource;
            const filter = getNativeSamplingMode(samplingMode);
            this._setTextureSampling(webGLTexture, filter);
        }
        this._internalTexturesCache.push(texture);
        return texture;
    }
    createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0) {
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 11 /* InternalTextureSource.Raw2DArray */);
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.baseDepth = depth;
        texture.width = width;
        texture.height = height;
        texture.depth = depth;
        texture.format = format;
        texture.type = textureType;
        texture.generateMipMaps = generateMipMaps;
        texture.samplingMode = samplingMode;
        texture.is2DArray = true;
        if (texture._hardwareTexture) {
            const nativeTexture = texture._hardwareTexture.underlyingResource;
            this._engine.loadRawTexture2DArray(nativeTexture, data, width, height, depth, getNativeTextureFormat(format, textureType), generateMipMaps, invertY);
            const filter = getNativeSamplingMode(samplingMode);
            this._setTextureSampling(nativeTexture, filter);
        }
        texture.isReady = true;
        this._internalTexturesCache.push(texture);
        return texture;
    }
    updateRawTexture(texture, bufferView, format, invertY, compression = null, type = 0, useSRGBBuffer = false) {
        if (!texture) {
            return;
        }
        if (bufferView && texture._hardwareTexture) {
            const underlyingResource = texture._hardwareTexture.underlyingResource;
            this._engine.loadRawTexture(underlyingResource, bufferView, texture.width, texture.height, getNativeTextureFormat(format, type), texture.generateMipMaps, texture.invertY);
        }
        texture.isReady = true;
    }
    // TODO: Refactor to share more logic with babylon.engine.ts version.
    /**
     * Usually called from Texture.ts.
     * Passed information to create a NativeTexture
     * @param url defines a value which contains one of the following:
     * * A conventional http URL, e.g. 'http://...' or 'file://...'
     * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
     * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
     * @param noMipmap defines a boolean indicating that no mipmaps shall be generated.  Ignored for compressed textures.  They must be in the file
     * @param invertY when true, image is flipped when loaded.  You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
     * @param scene needed for loading to the correct scene
     * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
     * @param onLoad optional callback to be called upon successful completion
     * @param onError optional callback to be called upon failure
     * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
     * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
     * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
     * @param forcedExtension defines the extension to use to pick the right loader
     * @param mimeType defines an optional mime type
     * @param loaderOptions options to be passed to the loader
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     * @returns a InternalTexture for assignment back into BABYLON.Texture
     */
    createTexture(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, creationFlags, useSRGBBuffer = false) {
        url = url || "";
        const fromData = url.substring(0, 5) === "data:";
        //const fromBlob = url.substring(0, 5) === "blob:";
        const isBase64 = fromData && url.indexOf(";base64,") !== -1;
        const texture = fallback ? fallback : new Textures_internalTexture/* InternalTexture */.hV(this, 1 /* InternalTextureSource.Url */);
        const originalUrl = url;
        if (this._transformTextureUrl && !isBase64 && !fallback && !buffer) {
            url = this._transformTextureUrl(url);
        }
        // establish the file extension, if possible
        const lastDot = url.lastIndexOf(".");
        const extension = forcedExtension ? forcedExtension : lastDot > -1 ? url.substring(lastDot).toLowerCase() : "";
        // some formats are already supported by bimg, no need to try to load them with JS
        // leaving TextureLoader extension check for future use
        let loaderPromise = null;
        if (extension.endsWith(".basis") || extension.endsWith(".ktx") || extension.endsWith(".ktx2") || mimeType === "image/ktx" || mimeType === "image/ktx2") {
            loaderPromise = (0,textureLoaderManager/* _GetCompatibleTextureLoader */.gT)(extension);
        }
        if (scene) {
            scene.addPendingData(texture);
        }
        texture.url = url;
        texture.generateMipMaps = !noMipmap;
        texture.samplingMode = samplingMode;
        texture.invertY = invertY;
        texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, noMipmap);
        if (!this.doNotHandleContextLost) {
            // Keep a link to the buffer only if we plan to handle context lost
            texture._buffer = buffer;
        }
        let onLoadObserver = null;
        if (onLoad && !fallback) {
            onLoadObserver = texture.onLoadedObservable.add(onLoad);
        }
        if (!fallback) {
            this._internalTexturesCache.push(texture);
        }
        const onInternalError = (message, exception) => {
            if (scene) {
                scene.removePendingData(texture);
            }
            if (url === originalUrl) {
                if (onLoadObserver) {
                    texture.onLoadedObservable.remove(onLoadObserver);
                }
                if (engineStore/* EngineStore */.q.UseFallbackTexture) {
                    this.createTexture(engineStore/* EngineStore */.q.FallbackTexture, noMipmap, texture.invertY, scene, samplingMode, null, onError, buffer, texture);
                }
                if (onError) {
                    onError((message || "Unknown error") + (engineStore/* EngineStore */.q.UseFallbackTexture ? " - Fallback texture was used" : ""), exception);
                }
            }
            else {
                // fall back to the original url if the transformed url fails to load
                logger/* Logger */.V.Warn(`Failed to load ${url}, falling back to ${originalUrl}`);
                this.createTexture(originalUrl, noMipmap, texture.invertY, scene, samplingMode, onLoad, onError, buffer, texture, format, forcedExtension, mimeType, loaderOptions);
            }
        };
        // processing for non-image formats
        if (loaderPromise) {
            throw new Error("Loading textures from IInternalTextureLoader not yet implemented.");
        }
        else {
            const onload = (data) => {
                if (!texture._hardwareTexture) {
                    if (scene) {
                        scene.removePendingData(texture);
                    }
                    return;
                }
                const underlyingResource = texture._hardwareTexture.underlyingResource;
                this._engine.loadTexture(underlyingResource, data, !noMipmap, invertY, texture._useSRGBBuffer, () => {
                    texture.baseWidth = this._engine.getTextureWidth(underlyingResource);
                    texture.baseHeight = this._engine.getTextureHeight(underlyingResource);
                    texture.width = texture.baseWidth;
                    texture.height = texture.baseHeight;
                    texture.isReady = true;
                    const filter = getNativeSamplingMode(samplingMode);
                    this._setTextureSampling(underlyingResource, filter);
                    if (scene) {
                        scene.removePendingData(texture);
                    }
                    texture.onLoadedObservable.notifyObservers(texture);
                    texture.onLoadedObservable.clear();
                }, () => {
                    throw new Error("Could not load a native texture.");
                });
            };
            if (fromData && buffer) {
                if (buffer instanceof ArrayBuffer) {
                    onload(new Uint8Array(buffer));
                }
                else if (ArrayBuffer.isView(buffer)) {
                    onload(buffer);
                }
                else if (typeof buffer === "string") {
                    onload(new Uint8Array(tools/* Tools */.S0.DecodeBase64(buffer)));
                }
                else {
                    throw new Error("Unsupported buffer type");
                }
            }
            else {
                if (isBase64) {
                    onload(new Uint8Array(tools/* Tools */.S0.DecodeBase64(url)));
                }
                else {
                    this._loadFile(url, (data) => onload(new Uint8Array(data)), undefined, undefined, true, (request, exception) => {
                        onInternalError("Unable to load " + (request ? request.responseURL : url, exception));
                    });
                }
            }
        }
        return texture;
    }
    /**
     * Wraps an external native texture in a Babylon texture.
     * @param texture defines the external texture
     * @param hasMipMaps defines whether the external texture has mip maps
     * @param samplingMode defines the sampling mode for the external texture (default: 3)
     * @returns the babylon internal texture
     */
    wrapNativeTexture(texture, hasMipMaps = false, samplingMode = 3) {
        const hardwareTexture = new NativeHardwareTexture(texture, this._engine);
        const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(this, 0 /* InternalTextureSource.Unknown */, true);
        internalTexture._hardwareTexture = hardwareTexture;
        internalTexture.baseWidth = this._engine.getTextureWidth(texture);
        internalTexture.baseHeight = this._engine.getTextureHeight(texture);
        internalTexture.width = internalTexture.baseWidth;
        internalTexture.height = internalTexture.baseHeight;
        internalTexture.isReady = true;
        internalTexture.useMipMaps = hasMipMaps;
        this.updateTextureSamplingMode(samplingMode, internalTexture);
        return internalTexture;
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Wraps an external web gl texture in a Babylon texture.
     * @returns the babylon internal texture
     */
    wrapWebGLTexture() {
        throw new Error("wrapWebGLTexture is not supported, use wrapNativeTexture instead.");
    }
    _createDepthStencilTexture(size, options, rtWrapper) {
        // TODO: handle other options?
        const generateStencil = options.generateStencil || false;
        const samples = options.samples || 1;
        const nativeRTWrapper = rtWrapper;
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 12 /* InternalTextureSource.DepthStencil */);
        const width = size.width ?? size;
        const height = size.height ?? size;
        const framebuffer = this._engine.createFrameBuffer(texture._hardwareTexture.underlyingResource, width, height, generateStencil, true, samples);
        nativeRTWrapper._framebufferDepthStencil = framebuffer;
        return texture;
    }
    /**
     * @internal
     */
    _releaseFramebufferObjects(framebuffer) {
        if (framebuffer) {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEFRAMEBUFFER);
            this._commandBufferEncoder.encodeCommandArgAsNativeData(framebuffer);
            this._commandBufferEncoder.finishEncodingCommand();
        }
    }
    /**
     * @internal Engine abstraction for loading and creating an image bitmap from a given source string.
     * @param imageSource source to load the image from.
     * @param options An object that sets options for the image's extraction.
     * @returns ImageBitmap
     */
    _createImageBitmapFromSource(imageSource, options) {
        const promise = new Promise((resolve, reject) => {
            const image = this.createCanvasImage();
            image.onload = () => {
                try {
                    const imageBitmap = this._engine.createImageBitmap(image);
                    resolve(imageBitmap);
                }
                catch (error) {
                    reject(`Error loading image ${image.src} with exception: ${error}`);
                }
            };
            image.onerror = (error) => {
                reject(`Error loading image ${image.src} with exception: ${error}`);
            };
            image.src = imageSource;
        });
        return promise;
    }
    /**
     * Engine abstraction for createImageBitmap
     * @param image source for image
     * @param options An object that sets options for the image's extraction.
     * @returns ImageBitmap
     */
    createImageBitmap(image, options) {
        return new Promise((resolve, reject) => {
            if (Array.isArray(image)) {
                const arr = image;
                if (arr.length) {
                    const image = this._engine.createImageBitmap(arr[0]);
                    if (image) {
                        resolve(image);
                        return;
                    }
                }
            }
            reject(`Unsupported data for createImageBitmap.`);
        });
    }
    /**
     * Resize an image and returns the image data as an uint8array
     * @param image image to resize
     * @param bufferWidth destination buffer width
     * @param bufferHeight destination buffer height
     * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size
     */
    resizeImageBitmap(image, bufferWidth, bufferHeight) {
        return this._engine.resizeImageBitmap(image, bufferWidth, bufferHeight);
    }
    /**
     * Creates a cube texture
     * @param rootUrl defines the url where the files to load is located
     * @param scene defines the current scene
     * @param files defines the list of files to load (1 per face)
     * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
     * @param onLoad defines an optional callback raised when the texture is loaded
     * @param onError defines an optional callback raised if there is an issue to load the texture
     * @param format defines the format of the data
     * @param forcedExtension defines the extension to use to pick the right loader
     * @param createPolynomials if a polynomial sphere should be created for the cube texture
     * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
     * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
     * @param fallback defines texture to use while falling back when (compressed) texture file not found.
     * @param loaderOptions options to be passed to the loader
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     * @param buffer defines the data buffer to load instead of loading the rootUrl
     * @returns the cube texture as an InternalTexture
     */
    createCubeTexture(rootUrl, scene, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, loaderOptions, useSRGBBuffer = false, buffer = null) {
        const texture = fallback ? fallback : new Textures_internalTexture/* InternalTexture */.hV(this, 7 /* InternalTextureSource.Cube */);
        texture.isCube = true;
        texture.url = rootUrl;
        texture.generateMipMaps = !noMipmap;
        texture._lodGenerationScale = lodScale;
        texture._lodGenerationOffset = lodOffset;
        texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !!noMipmap);
        if (!this._doNotHandleContextLost) {
            texture._extension = forcedExtension;
            texture._files = files;
            texture._buffer = buffer;
        }
        const lastDot = rootUrl.lastIndexOf(".");
        const extension = forcedExtension ? forcedExtension : lastDot > -1 ? rootUrl.substring(lastDot).toLowerCase() : "";
        // TODO: use texture loader to load env files?
        if (extension === ".env") {
            const onloaddata = (data) => {
                const info = (0,environmentTextureTools/* GetEnvInfo */.cU)(data);
                texture.width = info.width;
                texture.height = info.width;
                (0,environmentTextureTools/* UploadEnvSpherical */.ow)(texture, info);
                const specularInfo = info.specular;
                if (!specularInfo) {
                    throw new Error(`Nothing else parsed so far`);
                }
                texture._lodGenerationScale = specularInfo.lodGenerationScale;
                const imageData = (0,environmentTextureTools/* CreateImageDataArrayBufferViews */.$h)(data, info);
                texture.format = 5;
                texture.type = 0;
                texture.generateMipMaps = true;
                texture.getEngine().updateTextureSamplingMode(Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, texture);
                texture._isRGBD = true;
                texture.invertY = true;
                this._engine.loadCubeTextureWithMips(texture._hardwareTexture.underlyingResource, imageData, false, texture._useSRGBBuffer, () => {
                    texture.isReady = true;
                    if (onLoad) {
                        onLoad();
                    }
                }, () => {
                    throw new Error("Could not load a native cube texture.");
                });
            };
            if (buffer) {
                onloaddata(buffer);
            }
            else if (files && files.length === 6) {
                throw new Error(`Multi-file loading not allowed on env files.`);
            }
            else {
                const onInternalError = (request, exception) => {
                    if (onError && request) {
                        onError(request.status + " " + request.statusText, exception);
                    }
                };
                this._loadFile(rootUrl, (data) => {
                    onloaddata(new Uint8Array(data, 0, data.byteLength));
                }, undefined, undefined, true, onInternalError);
            }
        }
        else {
            if (!files || files.length !== 6) {
                throw new Error("Cannot load cubemap because 6 files were not defined");
            }
            // Reorder from [+X, +Y, +Z, -X, -Y, -Z] to [+X, -X, +Y, -Y, +Z, -Z].
            const reorderedFiles = [files[0], files[3], files[1], files[4], files[2], files[5]];
            Promise.all(reorderedFiles.map((file) => this._loadFileAsync(file, undefined, true).then((data) => new Uint8Array(data, 0, data.byteLength))))
                .then((data) => {
                return new Promise((resolve, reject) => {
                    this._engine.loadCubeTexture(texture._hardwareTexture.underlyingResource, data, !noMipmap, true, texture._useSRGBBuffer, resolve, reject);
                });
            })
                .then(() => {
                texture.isReady = true;
                if (onLoad) {
                    onLoad();
                }
            }, (error) => {
                if (onError) {
                    onError(`Failed to load cubemap: ${error.message}`, error);
                }
            });
        }
        this._internalTexturesCache.push(texture);
        return texture;
    }
    /** @internal */
    _createHardwareTexture() {
        return new NativeHardwareTexture(this._createTexture(), this._engine);
    }
    /** @internal */
    _createHardwareRenderTargetWrapper(isMulti, isCube, size) {
        const rtWrapper = new NativeRenderTargetWrapper(isMulti, isCube, size, this);
        this._renderTargetWrapperCache.push(rtWrapper);
        return rtWrapper;
    }
    /** @internal */
    _createInternalTexture(size, options, _delayGPUTextureCreation = true, source = 0 /* InternalTextureSource.Unknown */) {
        let generateMipMaps = false;
        let type = 0;
        let samplingMode = 3;
        let format = 5;
        let useSRGBBuffer = false;
        let samples = 1;
        let label;
        if (options !== undefined && typeof options === "object") {
            generateMipMaps = !!options.generateMipMaps;
            type = options.type === undefined ? 0 : options.type;
            samplingMode = options.samplingMode === undefined ? 3 : options.samplingMode;
            format = options.format === undefined ? 5 : options.format;
            useSRGBBuffer = options.useSRGBBuffer === undefined ? false : options.useSRGBBuffer;
            samples = options.samples ?? 1;
            label = options.label;
        }
        else {
            generateMipMaps = !!options;
        }
        useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps);
        if (type === 1 && !this._caps.textureFloatLinearFiltering) {
            // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
            samplingMode = 1;
        }
        else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) {
            // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
            samplingMode = 1;
        }
        if (type === 1 && !this._caps.textureFloat) {
            type = 0;
            logger/* Logger */.V.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE");
        }
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, source);
        const width = size.width ?? size;
        const height = size.height ?? size;
        const layers = size.layers || 0;
        if (layers !== 0) {
            throw new Error("Texture layers are not supported in Babylon Native");
        }
        const nativeTexture = texture._hardwareTexture.underlyingResource;
        const nativeTextureFormat = getNativeTextureFormat(format, type);
        // REVIEW: We are always setting the renderTarget flag as we don't know whether the texture will be used as a render target.
        this._engine.initializeTexture(nativeTexture, width, height, generateMipMaps, nativeTextureFormat, true, useSRGBBuffer, samples);
        this._setTextureSampling(nativeTexture, getNativeSamplingMode(samplingMode));
        texture._useSRGBBuffer = useSRGBBuffer;
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.width = width;
        texture.height = height;
        texture.depth = layers;
        texture.isReady = true;
        texture.samples = samples;
        texture.generateMipMaps = generateMipMaps;
        texture.samplingMode = samplingMode;
        texture.type = type;
        texture.format = format;
        texture.label = label;
        this._internalTexturesCache.push(texture);
        return texture;
    }
    createRenderTargetTexture(size, options) {
        const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size);
        let generateDepthBuffer = true;
        let generateStencilBuffer = false;
        let noColorAttachment = false;
        let colorAttachment = undefined;
        let samples = 1;
        if (options !== undefined && typeof options === "object") {
            generateDepthBuffer = options.generateDepthBuffer ?? true;
            generateStencilBuffer = !!options.generateStencilBuffer;
            noColorAttachment = !!options.noColorAttachment;
            colorAttachment = options.colorAttachment;
            samples = options.samples ?? 1;
        }
        const texture = colorAttachment || (noColorAttachment ? null : this._createInternalTexture(size, options, true, 5 /* InternalTextureSource.RenderTarget */));
        const width = size.width ?? size;
        const height = size.height ?? size;
        const framebuffer = this._engine.createFrameBuffer(texture ? texture._hardwareTexture.underlyingResource : null, width, height, generateStencilBuffer, generateDepthBuffer, samples);
        rtWrapper._framebuffer = framebuffer;
        rtWrapper._generateDepthBuffer = generateDepthBuffer;
        rtWrapper._generateStencilBuffer = generateStencilBuffer;
        rtWrapper._samples = samples;
        rtWrapper.setTextures(texture);
        return rtWrapper;
    }
    updateRenderTargetTextureSampleCount(rtWrapper, samples) {
        logger/* Logger */.V.Warn("Updating render target sample count is not currently supported");
        return rtWrapper.samples;
    }
    updateTextureSamplingMode(samplingMode, texture) {
        if (texture._hardwareTexture) {
            const filter = getNativeSamplingMode(samplingMode);
            this._setTextureSampling(texture._hardwareTexture.underlyingResource, filter);
        }
        texture.samplingMode = samplingMode;
    }
    bindFramebuffer(texture, faceIndex, requiredWidth, requiredHeight, forceFullscreenViewport) {
        const nativeRTWrapper = texture;
        if (this._currentRenderTarget) {
            this.unBindFramebuffer(this._currentRenderTarget);
        }
        this._currentRenderTarget = texture;
        if (faceIndex) {
            throw new Error("Cuboid frame buffers are not yet supported in NativeEngine.");
        }
        if (requiredWidth || requiredHeight) {
            throw new Error("Required width/height for frame buffers not yet supported in NativeEngine.");
        }
        if (nativeRTWrapper._framebufferDepthStencil) {
            this._bindUnboundFramebuffer(nativeRTWrapper._framebufferDepthStencil);
        }
        else {
            this._bindUnboundFramebuffer(nativeRTWrapper._framebuffer);
        }
    }
    unBindFramebuffer(texture, disableGenerateMipMaps = false, onBeforeUnbind) {
        // NOTE: Disabling mipmap generation is not yet supported in NativeEngine.
        this._currentRenderTarget = null;
        if (onBeforeUnbind) {
            onBeforeUnbind();
        }
        this._bindUnboundFramebuffer(null);
    }
    createDynamicVertexBuffer(data) {
        return this.createVertexBuffer(data, true);
    }
    updateDynamicIndexBuffer(indexBuffer, indices, offset = 0) {
        const buffer = indexBuffer;
        const data = this._normalizeIndexData(indices);
        buffer.is32Bits = data.BYTES_PER_ELEMENT === 4;
        this._engine.updateDynamicIndexBuffer(buffer.nativeIndexBuffer, data.buffer, data.byteOffset, data.byteLength, offset);
    }
    updateDynamicVertexBuffer(vertexBuffer, data, byteOffset = 0, byteLength) {
        const buffer = vertexBuffer;
        const dataView = data instanceof Array ? new Float32Array(data) : data instanceof ArrayBuffer ? new Uint8Array(data) : data;
        const byteView = new Uint8Array(dataView.buffer, dataView.byteOffset, byteLength ?? dataView.byteLength);
        this._engine.updateDynamicVertexBuffer(buffer.nativeVertexBuffer, byteView.buffer, byteView.byteOffset, byteView.byteLength, byteOffset);
    }
    // TODO: Refactor to share more logic with base Engine implementation.
    /**
     * @internal
     */
    _setTexture(channel, texture, isPartOfTextureArray = false, depthStencilTexture = false) {
        const uniform = this._boundUniforms[channel];
        if (!uniform) {
            return false;
        }
        // Not ready?
        if (!texture) {
            if (this._boundTexturesCache[channel] != null) {
                this._activeChannel = channel;
                this._boundTexturesCache[channel] = null;
                this._unsetNativeTexture(uniform);
            }
            return false;
        }
        // Video
        if (texture.video) {
            this._activeChannel = channel;
            texture.update();
        }
        else if (texture.delayLoadState === 4) {
            // Delay loading
            texture.delayLoad();
            return false;
        }
        let internalTexture;
        if (depthStencilTexture) {
            internalTexture = texture.depthStencilTexture;
        }
        else if (texture.isReady()) {
            internalTexture = texture.getInternalTexture();
        }
        else if (texture.isCube) {
            internalTexture = this.emptyCubeTexture;
        }
        else if (texture.is3D) {
            internalTexture = this.emptyTexture3D;
        }
        else if (texture.is2DArray) {
            internalTexture = this.emptyTexture2DArray;
        }
        else {
            internalTexture = this.emptyTexture;
        }
        this._activeChannel = channel;
        if (!internalTexture || !internalTexture._hardwareTexture) {
            return false;
        }
        this._setTextureWrapMode(internalTexture._hardwareTexture.underlyingResource, getNativeAddressMode(texture.wrapU), getNativeAddressMode(texture.wrapV), getNativeAddressMode(texture.wrapR));
        this._updateAnisotropicLevel(texture);
        this._setNativeTexture(uniform, internalTexture._hardwareTexture.underlyingResource);
        return true;
    }
    // filter is a NativeFilter.XXXX value.
    _setTextureSampling(texture, filter) {
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTURESAMPLING);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(texture);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(filter);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    // addressModes are NativeAddressMode.XXXX values.
    _setTextureWrapMode(texture, addressModeU, addressModeV, addressModeW) {
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTUREWRAPMODE);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(texture);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(addressModeU);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(addressModeV);
        this._commandBufferEncoder.encodeCommandArgAsUInt32(addressModeW);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    _setNativeTexture(uniform, texture) {
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTURE);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(texture);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    _unsetNativeTexture(uniform) {
        if (!_native.Engine.COMMAND_UNSETTEXTURE) {
            return;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_UNSETTEXTURE);
        this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    // TODO: Share more of this logic with the base implementation.
    // TODO: Rename to match naming in base implementation once refactoring allows different parameters.
    _updateAnisotropicLevel(texture) {
        const internalTexture = texture.getInternalTexture();
        const value = texture.anisotropicFilteringLevel;
        if (!internalTexture || !internalTexture._hardwareTexture) {
            return;
        }
        if (internalTexture._cachedAnisotropicFilteringLevel !== value) {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETTEXTUREANISOTROPICLEVEL);
            this._commandBufferEncoder.encodeCommandArgAsNativeData(internalTexture._hardwareTexture.underlyingResource);
            this._commandBufferEncoder.encodeCommandArgAsUInt32(value);
            this._commandBufferEncoder.finishEncodingCommand();
            internalTexture._cachedAnisotropicFilteringLevel = value;
        }
    }
    /**
     * @internal
     */
    _bindTexture(channel, texture) {
        const uniform = this._boundUniforms[channel];
        if (!uniform) {
            return;
        }
        if (texture && texture._hardwareTexture) {
            const underlyingResource = texture._hardwareTexture.underlyingResource;
            this._setNativeTexture(uniform, underlyingResource);
        }
        else {
            this._unsetNativeTexture(uniform);
        }
    }
    /**
     * Unbind all textures
     */
    unbindAllTextures() {
        if (!_native.Engine.COMMAND_DISCARDALLTEXTURES) {
            return;
        }
        this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DISCARDALLTEXTURES);
        this._commandBufferEncoder.finishEncodingCommand();
    }
    _deleteBuffer(buffer) {
        if (buffer.nativeIndexBuffer) {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEINDEXBUFFER);
            this._commandBufferEncoder.encodeCommandArgAsNativeData(buffer.nativeIndexBuffer);
            this._commandBufferEncoder.finishEncodingCommand();
            delete buffer.nativeIndexBuffer;
        }
        if (buffer.nativeVertexBuffer) {
            this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DELETEVERTEXBUFFER);
            this._commandBufferEncoder.encodeCommandArgAsNativeData(buffer.nativeVertexBuffer);
            this._commandBufferEncoder.finishEncodingCommand();
            delete buffer.nativeVertexBuffer;
        }
    }
    /**
     * Create a canvas
     * @param width width
     * @param height height
     * @returns ICanvas interface
     */
    createCanvas(width, height) {
        if (!_native.Canvas) {
            throw new Error("Native Canvas plugin not available.");
        }
        const canvas = new _native.Canvas();
        canvas.width = width;
        canvas.height = height;
        return canvas;
    }
    /**
     * Create an image to use with canvas
     * @returns IImage interface
     */
    createCanvasImage() {
        if (!_native.Canvas) {
            throw new Error("Native Canvas plugin not available.");
        }
        const image = new _native.Image();
        return image;
    }
    /**
     * Update a portion of an internal texture
     * @param texture defines the texture to update
     * @param imageData defines the data to store into the texture
     * @param xOffset defines the x coordinates of the update rectangle
     * @param yOffset defines the y coordinates of the update rectangle
     * @param width defines the width of the update rectangle
     * @param height defines the height of the update rectangle
     * @param faceIndex defines the face index if texture is a cube (0 by default)
     * @param lod defines the lod level to update (0 by default)
     * @param generateMipMaps defines whether to generate mipmaps or not
     */
    updateTextureData(texture, imageData, xOffset, yOffset, width, height, faceIndex = 0, lod = 0, generateMipMaps = false) {
        throw new Error("updateTextureData not implemented.");
    }
    /**
     * @internal
     */
    _uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, data, faceIndex = 0, lod = 0) {
        throw new Error("_uploadCompressedDataToTextureDirectly not implemented.");
    }
    /**
     * @internal
     */
    _uploadDataToTextureDirectly(texture, imageData, faceIndex = 0, lod = 0) {
        throw new Error("_uploadDataToTextureDirectly not implemented.");
    }
    /**
     * @internal
     */
    _uploadArrayBufferViewToTexture(texture, imageData, faceIndex = 0, lod = 0) {
        throw new Error("_uploadArrayBufferViewToTexture not implemented.");
    }
    /**
     * @internal
     */
    _uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) {
        throw new Error("_uploadArrayBufferViewToTexture not implemented.");
    }
    getFontOffset(font) {
        // TODO
        const result = { ascent: 0, height: 0, descent: 0 };
        return result;
    }
    /**
     * No equivalent for native. Do nothing.
     */
    flushFramebuffer() { }
    _readTexturePixels(texture, width, height, faceIndex, level, buffer, _flushRenderer, _noDataConversion, x, y) {
        if (faceIndex !== undefined && faceIndex !== -1) {
            throw new Error(`Reading cubemap faces is not supported, but faceIndex is ${faceIndex}.`);
        }
        return this._engine
            .readTexture(texture._hardwareTexture?.underlyingResource, level ?? 0, x ?? 0, y ?? 0, width, height, buffer?.buffer ?? null, buffer?.byteOffset ?? 0, buffer?.byteLength ?? 0)
            .then((rawBuffer) => {
            if (!buffer) {
                buffer = new Uint8Array(rawBuffer);
            }
            return buffer;
        });
    }
}
// This must match the protocol version in NativeEngine.cpp
NativeEngine.PROTOCOL_VERSION = 8;
//# sourceMappingURL=nativeEngine.js.map
;// ./node_modules/@babylonjs/core/Engines/Native/validatedNativeDataStream.js


NativeEngine._createNativeDataStream = function () {
    if (_native.NativeDataStream.VALIDATION_ENABLED) {
        return new ValidatedNativeDataStream();
    }
    else {
        return new NativeDataStream();
    }
};
/**
 * Validated Native Data Stream
 */
class ValidatedNativeDataStream extends NativeDataStream {
    constructor() {
        super();
    }
    writeUint32(value) {
        super.writeUint32(_native.NativeDataStream.VALIDATION_UINT_32);
        super.writeUint32(value);
    }
    writeInt32(value) {
        super.writeUint32(_native.NativeDataStream.VALIDATION_INT_32);
        super.writeInt32(value);
    }
    writeFloat32(value) {
        super.writeUint32(_native.NativeDataStream.VALIDATION_FLOAT_32);
        super.writeFloat32(value);
    }
    writeUint32Array(values) {
        super.writeUint32(_native.NativeDataStream.VALIDATION_UINT_32_ARRAY);
        super.writeUint32Array(values);
    }
    writeInt32Array(values) {
        super.writeUint32(_native.NativeDataStream.VALIDATION_INT_32_ARRAY);
        super.writeInt32Array(values);
    }
    writeFloat32Array(values) {
        super.writeUint32(_native.NativeDataStream.VALIDATION_FLOAT_32_ARRAY);
        super.writeFloat32Array(values);
    }
    writeNativeData(handle) {
        super.writeUint32(_native.NativeDataStream.VALIDATION_NATIVE_DATA);
        super.writeNativeData(handle);
    }
    writeBoolean(value) {
        super.writeUint32(_native.NativeDataStream.VALIDATION_BOOLEAN);
        super.writeBoolean(value);
    }
}
//# sourceMappingURL=validatedNativeDataStream.js.map
;// ./node_modules/@babylonjs/core/Engines/Native/index.js


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuTextureHelper.js


/** @internal */
class WebGPUTextureHelper {
    static ComputeNumMipmapLevels(width, height) {
        return (0,math_scalar_functions.ILog2)(Math.max(width, height)) + 1;
    }
    static GetTextureTypeFromFormat(format) {
        switch (format) {
            // One Component = 8 bits unsigned
            case "r8unorm" /* WebGPUConstants.TextureFormat.R8Unorm */:
            case "r8uint" /* WebGPUConstants.TextureFormat.R8Uint */:
            case "rg8unorm" /* WebGPUConstants.TextureFormat.RG8Unorm */:
            case "rg8uint" /* WebGPUConstants.TextureFormat.RG8Uint */:
            case "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:
            case "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:
            case "rgba8uint" /* WebGPUConstants.TextureFormat.RGBA8Uint */:
            case "bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:
            case "bgra8unorm-srgb" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:
            case "rgb10a2uint" /* WebGPUConstants.TextureFormat.RGB10A2UINT */: // composite format - let's say it's byte...
            case "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */: // composite format - let's say it's byte...
            case "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */: // composite format - let's say it's byte...
            case "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */: // composite format - let's say it's byte...
            case "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:
            case "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:
            case "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:
            case "bc5-rg-unorm" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:
            case "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:
            case "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:
            case "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:
            case "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:
            case "bc4-r-unorm" /* WebGPUConstants.TextureFormat.BC4RUnorm */:
            case "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:
            case "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:
            case "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:
            case "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:
            case "etc2-rgb8a1unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:
            case "etc2-rgb8a1unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:
            case "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:
            case "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:
            case "eac-r11unorm" /* WebGPUConstants.TextureFormat.EACR11Unorm */:
            case "eac-rg11unorm" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:
            case "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:
            case "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:
            case "astc-5x4-unorm" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:
            case "astc-5x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:
            case "astc-5x5-unorm" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:
            case "astc-5x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:
            case "astc-6x5-unorm" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:
            case "astc-6x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:
            case "astc-6x6-unorm" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:
            case "astc-6x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:
            case "astc-8x5-unorm" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:
            case "astc-8x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:
            case "astc-8x6-unorm" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:
            case "astc-8x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:
            case "astc-8x8-unorm" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:
            case "astc-8x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:
            case "astc-10x5-unorm" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:
            case "astc-10x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:
            case "astc-10x6-unorm" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:
            case "astc-10x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:
            case "astc-10x8-unorm" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:
            case "astc-10x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:
            case "astc-10x10-unorm" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:
            case "astc-10x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:
            case "astc-12x10-unorm" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:
            case "astc-12x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:
            case "astc-12x12-unorm" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:
            case "astc-12x12-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:
            case "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */:
                return 0;
            // One Component = 8 bits signed
            case "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */:
            case "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */:
            case "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */:
            case "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */:
            case "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:
            case "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */:
            case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
            case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
            case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
            case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
            case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
                return 3;
            // One component = 16 bits unsigned
            case "r16uint" /* WebGPUConstants.TextureFormat.R16Uint */:
            case "r16unorm" /* WebGPUConstants.TextureFormat.R16Unorm */:
            case "rg16unorm" /* WebGPUConstants.TextureFormat.RG16Unorm */:
            case "rgba16unorm" /* WebGPUConstants.TextureFormat.RGBA16Unorm */:
            case "rg16uint" /* WebGPUConstants.TextureFormat.RG16Uint */:
            case "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */:
            case "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */:
                return 5;
            // One component = 16 bits signed
            case "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */:
            case "r16snorm" /* WebGPUConstants.TextureFormat.R16Snorm */:
            case "rg16snorm" /* WebGPUConstants.TextureFormat.RG16Snorm */:
            case "rgba16snorm" /* WebGPUConstants.TextureFormat.RGBA16Snorm */:
            case "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */:
            case "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */:
                return 4;
            case "r16float" /* WebGPUConstants.TextureFormat.R16Float */:
            case "rg16float" /* WebGPUConstants.TextureFormat.RG16Float */:
            case "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */:
                return 2;
            // One component = 32 bits unsigned
            case "r32uint" /* WebGPUConstants.TextureFormat.R32Uint */:
            case "rg32uint" /* WebGPUConstants.TextureFormat.RG32Uint */:
            case "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */:
                return 7;
            // One component = 32 bits signed
            case "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */:
            case "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */:
            case "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */:
                return 7;
            case "r32float" /* WebGPUConstants.TextureFormat.R32Float */:
            case "rg32float" /* WebGPUConstants.TextureFormat.RG32Float */:
            case "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */:
            case "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */:
            case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
            case "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */:
            case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
                return 1;
        }
        return 0;
    }
    static GetBlockInformationFromFormat(format) {
        switch (format) {
            // 8 bits formats
            case "r8unorm" /* WebGPUConstants.TextureFormat.R8Unorm */:
            case "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */:
            case "r8uint" /* WebGPUConstants.TextureFormat.R8Uint */:
            case "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */:
                return { width: 1, height: 1, length: 1 };
            // 16 bits formats
            case "r16uint" /* WebGPUConstants.TextureFormat.R16Uint */:
            case "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */:
            case "r16unorm" /* WebGPUConstants.TextureFormat.R16Unorm */:
            case "rg16unorm" /* WebGPUConstants.TextureFormat.RG16Unorm */:
            case "rgba16unorm" /* WebGPUConstants.TextureFormat.RGBA16Unorm */:
            case "r16snorm" /* WebGPUConstants.TextureFormat.R16Snorm */:
            case "rg16snorm" /* WebGPUConstants.TextureFormat.RG16Snorm */:
            case "rgba16snorm" /* WebGPUConstants.TextureFormat.RGBA16Snorm */:
            case "r16float" /* WebGPUConstants.TextureFormat.R16Float */:
            case "rg8unorm" /* WebGPUConstants.TextureFormat.RG8Unorm */:
            case "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */:
            case "rg8uint" /* WebGPUConstants.TextureFormat.RG8Uint */:
            case "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */:
                return { width: 1, height: 1, length: 2 };
            // 32 bits formats
            case "r32uint" /* WebGPUConstants.TextureFormat.R32Uint */:
            case "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */:
            case "r32float" /* WebGPUConstants.TextureFormat.R32Float */:
            case "rg16uint" /* WebGPUConstants.TextureFormat.RG16Uint */:
            case "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */:
            case "rg16float" /* WebGPUConstants.TextureFormat.RG16Float */:
            case "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:
            case "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:
            case "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:
            case "rgba8uint" /* WebGPUConstants.TextureFormat.RGBA8Uint */:
            case "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */:
            case "bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:
            case "bgra8unorm-srgb" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:
            case "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */:
            case "rgb10a2uint" /* WebGPUConstants.TextureFormat.RGB10A2UINT */:
            case "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */:
            case "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */:
                return { width: 1, height: 1, length: 4 };
            // 64 bits formats
            case "rg32uint" /* WebGPUConstants.TextureFormat.RG32Uint */:
            case "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */:
            case "rg32float" /* WebGPUConstants.TextureFormat.RG32Float */:
            case "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */:
            case "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */:
            case "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */:
                return { width: 1, height: 1, length: 8 };
            // 128 bits formats
            case "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */:
            case "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */:
            case "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */:
                return { width: 1, height: 1, length: 16 };
            // Depth and stencil formats
            case "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */:
                // eslint-disable-next-line no-throw-literal
                throw "No fixed size for Stencil8 format!";
            case "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */:
                return { width: 1, height: 1, length: 2 };
            case "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */:
                // eslint-disable-next-line no-throw-literal
                throw "No fixed size for Depth24Plus format!";
            case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
                // eslint-disable-next-line no-throw-literal
                throw "No fixed size for Depth24PlusStencil8 format!";
            case "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */:
                return { width: 1, height: 1, length: 4 };
            case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
                return { width: 1, height: 1, length: 5 };
            // BC compressed formats usable if "texture-compression-bc" is both
            // supported by the device/user agent and enabled in requestDevice.
            case "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:
            case "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:
            case "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:
            case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
            case "bc5-rg-unorm" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:
            case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
            case "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:
            case "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:
            case "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:
            case "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:
                return { width: 4, height: 4, length: 16 };
            case "bc4-r-unorm" /* WebGPUConstants.TextureFormat.BC4RUnorm */:
            case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
            case "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:
            case "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:
                return { width: 4, height: 4, length: 8 };
            // ETC2 compressed formats usable if "texture-compression-etc2" is both
            // supported by the device/user agent and enabled in requestDevice.
            case "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:
            case "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:
            case "etc2-rgb8a1unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:
            case "etc2-rgb8a1unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:
            case "eac-r11unorm" /* WebGPUConstants.TextureFormat.EACR11Unorm */:
            case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
                return { width: 4, height: 4, length: 8 };
            case "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:
            case "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:
            case "eac-rg11unorm" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:
            case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
                return { width: 4, height: 4, length: 16 };
            // ASTC compressed formats usable if "texture-compression-astc" is both
            // supported by the device/user agent and enabled in requestDevice.
            case "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:
            case "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:
                return { width: 4, height: 4, length: 16 };
            case "astc-5x4-unorm" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:
            case "astc-5x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:
                return { width: 5, height: 4, length: 16 };
            case "astc-5x5-unorm" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:
            case "astc-5x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:
                return { width: 5, height: 5, length: 16 };
            case "astc-6x5-unorm" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:
            case "astc-6x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:
                return { width: 6, height: 5, length: 16 };
            case "astc-6x6-unorm" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:
            case "astc-6x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:
                return { width: 6, height: 6, length: 16 };
            case "astc-8x5-unorm" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:
            case "astc-8x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:
                return { width: 8, height: 5, length: 16 };
            case "astc-8x6-unorm" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:
            case "astc-8x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:
                return { width: 8, height: 6, length: 16 };
            case "astc-8x8-unorm" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:
            case "astc-8x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:
                return { width: 8, height: 8, length: 16 };
            case "astc-10x5-unorm" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:
            case "astc-10x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:
                return { width: 10, height: 5, length: 16 };
            case "astc-10x6-unorm" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:
            case "astc-10x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:
                return { width: 10, height: 6, length: 16 };
            case "astc-10x8-unorm" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:
            case "astc-10x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:
                return { width: 10, height: 8, length: 16 };
            case "astc-10x10-unorm" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:
            case "astc-10x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:
                return { width: 10, height: 10, length: 16 };
            case "astc-12x10-unorm" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:
            case "astc-12x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:
                return { width: 12, height: 10, length: 16 };
            case "astc-12x12-unorm" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:
            case "astc-12x12-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:
                return { width: 12, height: 12, length: 16 };
        }
        return { width: 1, height: 1, length: 4 };
    }
    static IsHardwareTexture(texture) {
        return !!texture.release;
    }
    static IsInternalTexture(texture) {
        return !!texture.dispose;
    }
    static IsImageBitmap(imageBitmap) {
        return imageBitmap.close !== undefined;
    }
    static IsImageBitmapArray(imageBitmap) {
        return Array.isArray(imageBitmap) && imageBitmap[0].close !== undefined;
    }
    static IsCompressedFormat(format) {
        switch (format) {
            case "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:
            case "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:
            case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
            case "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:
            case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
            case "bc5-rg-unorm" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:
            case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
            case "bc4-r-unorm" /* WebGPUConstants.TextureFormat.BC4RUnorm */:
            case "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:
            case "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:
            case "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:
            case "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:
            case "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:
            case "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:
            case "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:
            case "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:
            case "etc2-rgb8a1unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:
            case "etc2-rgb8a1unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:
            case "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:
            case "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:
            case "eac-r11unorm" /* WebGPUConstants.TextureFormat.EACR11Unorm */:
            case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
            case "eac-rg11unorm" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:
            case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
            case "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:
            case "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:
            case "astc-5x4-unorm" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:
            case "astc-5x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:
            case "astc-5x5-unorm" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:
            case "astc-5x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:
            case "astc-6x5-unorm" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:
            case "astc-6x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:
            case "astc-6x6-unorm" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:
            case "astc-6x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:
            case "astc-8x5-unorm" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:
            case "astc-8x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:
            case "astc-8x6-unorm" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:
            case "astc-8x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:
            case "astc-8x8-unorm" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:
            case "astc-8x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:
            case "astc-10x5-unorm" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:
            case "astc-10x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:
            case "astc-10x6-unorm" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:
            case "astc-10x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:
            case "astc-10x8-unorm" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:
            case "astc-10x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:
            case "astc-10x10-unorm" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:
            case "astc-10x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:
            case "astc-12x10-unorm" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:
            case "astc-12x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:
            case "astc-12x12-unorm" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:
            case "astc-12x12-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:
                return true;
        }
        return false;
    }
    static GetWebGPUTextureFormat(type, format, useSRGBBuffer = false) {
        switch (format) {
            case 15:
                return "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */;
            case 16:
                return "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */;
            case 13:
                return "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */;
            case 14:
                return "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */;
            case 18:
                return "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */;
            case 19:
                return "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */;
            case 36492:
                return useSRGBBuffer ? "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */ : "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */;
            case 36495:
                return "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */;
            case 36494:
                return "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */;
            case 33779:
                return useSRGBBuffer ? "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */ : "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */;
            case 33778:
                return useSRGBBuffer ? "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */ : "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */;
            case 33777:
            case 33776:
                return useSRGBBuffer ? "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */ : "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */;
            case 37808:
                return useSRGBBuffer ? "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */ : "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */;
            case 36196:
            case 37492:
                return useSRGBBuffer ? "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */ : "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */;
            case 37496:
                return useSRGBBuffer ? "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */ : "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */;
        }
        switch (type) {
            case 3:
                switch (format) {
                    case 6:
                        return "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */;
                    case 7:
                        return "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */;
                    case 4:
                        // eslint-disable-next-line no-throw-literal
                        throw "RGB format not supported in WebGPU";
                    case 8:
                        return "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */;
                    case 9:
                        return "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */;
                    case 10:
                        // eslint-disable-next-line no-throw-literal
                        throw "RGB_INTEGER format not supported in WebGPU";
                    case 11:
                        return "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */;
                    default:
                        return "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */;
                }
            case 0:
                switch (format) {
                    case 6:
                        return "r8unorm" /* WebGPUConstants.TextureFormat.R8Unorm */;
                    case 7:
                        return "rg8unorm" /* WebGPUConstants.TextureFormat.RG8Unorm */;
                    case 4:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_RGB format not supported in WebGPU";
                    case 5:
                        return useSRGBBuffer ? "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */ : "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;
                    case 12:
                        return useSRGBBuffer ? "bgra8unorm-srgb" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */ : "bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */;
                    case 8:
                        return "r8uint" /* WebGPUConstants.TextureFormat.R8Uint */;
                    case 9:
                        return "rg8uint" /* WebGPUConstants.TextureFormat.RG8Uint */;
                    case 10:
                        // eslint-disable-next-line no-throw-literal
                        throw "RGB_INTEGER format not supported in WebGPU";
                    case 11:
                        return "rgba8uint" /* WebGPUConstants.TextureFormat.RGBA8Uint */;
                    case 0:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_ALPHA format not supported in WebGPU";
                    case 1:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_LUMINANCE format not supported in WebGPU";
                    case 2:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU";
                    default:
                        return "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;
                }
            case 4:
                switch (format) {
                    case 8:
                        return "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */;
                    case 9:
                        return "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */;
                    case 10:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
                    case 11:
                        return "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */;
                    default:
                        return "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */;
                }
            case 5:
                switch (format) {
                    case 8:
                        return "r16uint" /* WebGPUConstants.TextureFormat.R16Uint */;
                    case 9:
                        return "rg16uint" /* WebGPUConstants.TextureFormat.RG16Uint */;
                    case 10:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
                    case 11:
                        return "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */;
                    default:
                        return "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */;
                }
            case 6:
                switch (format) {
                    case 8:
                        return "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */;
                    case 9:
                        return "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */;
                    case 10:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
                    case 11:
                        return "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */;
                    default:
                        return "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */;
                }
            case 7: // Refers to UNSIGNED_INT
                switch (format) {
                    case 8:
                        return "r32uint" /* WebGPUConstants.TextureFormat.R32Uint */;
                    case 9:
                        return "rg32uint" /* WebGPUConstants.TextureFormat.RG32Uint */;
                    case 10:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";
                    case 11:
                        return "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */;
                    default:
                        return "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */;
                }
            case 1:
                switch (format) {
                    case 6:
                        return "r32float" /* WebGPUConstants.TextureFormat.R32Float */; // By default. Other possibility is R16Float.
                    case 7:
                        return "rg32float" /* WebGPUConstants.TextureFormat.RG32Float */; // By default. Other possibility is RG16Float.
                    case 4:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_RGB format not supported in WebGPU";
                    case 5:
                        return "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */; // By default. Other possibility is RGBA16Float.
                    default:
                        return "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */;
                }
            case 2:
                switch (format) {
                    case 6:
                        return "r16float" /* WebGPUConstants.TextureFormat.R16Float */;
                    case 7:
                        return "rg16float" /* WebGPUConstants.TextureFormat.RG16Float */;
                    case 4:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_RGB format not supported in WebGPU";
                    case 5:
                        return "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */;
                    default:
                        return "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */;
                }
            case 10:
                // eslint-disable-next-line no-throw-literal
                throw "TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU";
            case 13:
                switch (format) {
                    case 5:
                        return "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */;
                    case 11:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV";
                    default:
                        return "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */;
                }
            case 14:
                switch (format) {
                    case 5:
                        return "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */;
                    case 11:
                        // eslint-disable-next-line no-throw-literal
                        throw "TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV";
                    default:
                        return "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */;
                }
            case 8:
                // eslint-disable-next-line no-throw-literal
                throw "TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU";
            case 9:
                // eslint-disable-next-line no-throw-literal
                throw "TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU";
            case 11:
                switch (format) {
                    case 5:
                        return "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */;
                    case 11:
                        return "rgb10a2uint" /* WebGPUConstants.TextureFormat.RGB10A2UINT */;
                    default:
                        return "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */;
                }
        }
        return useSRGBBuffer ? "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */ : "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;
    }
    static GetNumChannelsFromWebGPUTextureFormat(format) {
        switch (format) {
            case "r8unorm" /* WebGPUConstants.TextureFormat.R8Unorm */:
            case "r8snorm" /* WebGPUConstants.TextureFormat.R8Snorm */:
            case "r8uint" /* WebGPUConstants.TextureFormat.R8Uint */:
            case "r8sint" /* WebGPUConstants.TextureFormat.R8Sint */:
            case "bc4-r-unorm" /* WebGPUConstants.TextureFormat.BC4RUnorm */:
            case "bc4-r-snorm" /* WebGPUConstants.TextureFormat.BC4RSnorm */:
            case "r16uint" /* WebGPUConstants.TextureFormat.R16Uint */:
            case "r16sint" /* WebGPUConstants.TextureFormat.R16Sint */:
            case "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */:
            case "r16float" /* WebGPUConstants.TextureFormat.R16Float */:
            case "r16unorm" /* WebGPUConstants.TextureFormat.R16Unorm */:
            case "r16snorm" /* WebGPUConstants.TextureFormat.R16Snorm */:
            case "r32uint" /* WebGPUConstants.TextureFormat.R32Uint */:
            case "r32sint" /* WebGPUConstants.TextureFormat.R32Sint */:
            case "r32float" /* WebGPUConstants.TextureFormat.R32Float */:
            case "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */:
            case "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */:
            case "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */:
            case "eac-r11unorm" /* WebGPUConstants.TextureFormat.EACR11Unorm */:
            case "eac-r11snorm" /* WebGPUConstants.TextureFormat.EACR11Snorm */:
                return 1;
            case "rg8unorm" /* WebGPUConstants.TextureFormat.RG8Unorm */:
            case "rg8snorm" /* WebGPUConstants.TextureFormat.RG8Snorm */:
            case "rg8uint" /* WebGPUConstants.TextureFormat.RG8Uint */:
            case "rg8sint" /* WebGPUConstants.TextureFormat.RG8Sint */:
            case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
            case "bc5-rg-unorm" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:
            case "bc5-rg-snorm" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:
            case "rg16uint" /* WebGPUConstants.TextureFormat.RG16Uint */:
            case "rg16sint" /* WebGPUConstants.TextureFormat.RG16Sint */:
            case "rg16float" /* WebGPUConstants.TextureFormat.RG16Float */:
            case "rg16unorm" /* WebGPUConstants.TextureFormat.RG16Unorm */:
            case "rg16snorm" /* WebGPUConstants.TextureFormat.RG16Snorm */:
            case "rg32uint" /* WebGPUConstants.TextureFormat.RG32Uint */:
            case "rg32sint" /* WebGPUConstants.TextureFormat.RG32Sint */:
            case "rg32float" /* WebGPUConstants.TextureFormat.RG32Float */:
            case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
            case "eac-rg11unorm" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:
            case "eac-rg11snorm" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:
                return 2;
            case "rgb9e5ufloat" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */:
            case "rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */:
            case "bc6h-rgb-ufloat" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:
            case "bc6h-rgb-float" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:
            case "etc2-rgb8unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:
            case "etc2-rgb8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:
                return 3;
            case "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:
            case "rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:
            case "rgba8snorm" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:
            case "rgba8uint" /* WebGPUConstants.TextureFormat.RGBA8Uint */:
            case "rgba8sint" /* WebGPUConstants.TextureFormat.RGBA8Sint */:
            case "bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:
            case "bgra8unorm-srgb" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:
            case "rgba16unorm" /* WebGPUConstants.TextureFormat.RGBA16Unorm */:
            case "rgba16snorm" /* WebGPUConstants.TextureFormat.RGBA16Snorm */:
            case "rgb10a2uint" /* WebGPUConstants.TextureFormat.RGB10A2UINT */:
            case "rgb10a2unorm" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */:
            case "bc7-rgba-unorm" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:
            case "bc7-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:
            case "bc3-rgba-unorm" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:
            case "bc3-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:
            case "bc2-rgba-unorm" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:
            case "bc2-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:
            case "bc1-rgba-unorm" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:
            case "bc1-rgba-unorm-srgb" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:
            case "rgba16uint" /* WebGPUConstants.TextureFormat.RGBA16Uint */:
            case "rgba16sint" /* WebGPUConstants.TextureFormat.RGBA16Sint */:
            case "rgba16float" /* WebGPUConstants.TextureFormat.RGBA16Float */:
            case "rgba32uint" /* WebGPUConstants.TextureFormat.RGBA32Uint */:
            case "rgba32sint" /* WebGPUConstants.TextureFormat.RGBA32Sint */:
            case "rgba32float" /* WebGPUConstants.TextureFormat.RGBA32Float */:
            case "etc2-rgb8a1unorm" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:
            case "etc2-rgb8a1unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:
            case "etc2-rgba8unorm" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:
            case "etc2-rgba8unorm-srgb" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:
            case "astc-4x4-unorm" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:
            case "astc-4x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:
            case "astc-5x4-unorm" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:
            case "astc-5x4-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:
            case "astc-5x5-unorm" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:
            case "astc-5x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:
            case "astc-6x5-unorm" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:
            case "astc-6x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:
            case "astc-6x6-unorm" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:
            case "astc-6x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:
            case "astc-8x5-unorm" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:
            case "astc-8x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:
            case "astc-8x6-unorm" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:
            case "astc-8x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:
            case "astc-8x8-unorm" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:
            case "astc-8x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:
            case "astc-10x5-unorm" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:
            case "astc-10x5-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:
            case "astc-10x6-unorm" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:
            case "astc-10x6-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:
            case "astc-10x8-unorm" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:
            case "astc-10x8-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:
            case "astc-10x10-unorm" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:
            case "astc-10x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:
            case "astc-12x10-unorm" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:
            case "astc-12x10-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:
            case "astc-12x12-unorm" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:
            case "astc-12x12-unorm-srgb" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:
                return 4;
        }
        // eslint-disable-next-line no-throw-literal
        throw `Unknown format ${format}!`;
    }
    static HasStencilAspect(format) {
        switch (format) {
            case "stencil8" /* WebGPUConstants.TextureFormat.Stencil8 */:
            case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
            case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
                return true;
        }
        return false;
    }
    static HasDepthAndStencilAspects(format) {
        switch (format) {
            case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
            case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
                return true;
        }
        return false;
    }
    static GetDepthFormatOnly(format) {
        switch (format) {
            case "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */:
                return "depth16unorm" /* WebGPUConstants.TextureFormat.Depth16Unorm */;
            case "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */:
                return "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */;
            case "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:
                return "depth24plus" /* WebGPUConstants.TextureFormat.Depth24Plus */;
            case "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */:
                return "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */;
            case "depth32float-stencil8" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:
                return "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */;
        }
        return format;
    }
    static GetSample(sampleCount) {
        // WebGPU only supports 1 or 4
        return sampleCount > 1 ? 4 : 1;
    }
}
//# sourceMappingURL=webgpuTextureHelper.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuPerfCounter.js
var webgpuPerfCounter = __webpack_require__(39176);
;// ./node_modules/@babylonjs/core/Engines/thinWebGPUEngine.js





/**
 * The base engine class for WebGPU
 */
class ThinWebGPUEngine extends abstractEngine/* AbstractEngine */.$ {
    constructor() {
        super(...arguments);
        // TODO WEBGPU remove those variables when code stabilized
        /** @internal */
        this.dbgShowShaderCode = false;
        /** @internal */
        this.dbgSanityChecks = true;
        /** @internal */
        this.dbgVerboseLogsNumFrames = 10;
        /** @internal */
        this.dbgLogIfNotDrawWrapper = true;
        /** @internal */
        this.dbgShowEmptyEnableEffectCalls = true;
        /** @internal */
        this.dbgVerboseLogsForFirstFrames = false;
        /** @internal */
        this._currentRenderPass = null;
        this._snapshotRenderingMode = 0;
        /** @internal */
        this._timestampIndex = 0;
        /** @internal */
        this._debugStackRenderPass = [];
    }
    /**
     * Enables or disables GPU timing measurements.
     * Note that this is only supported if the "timestamp-query" extension is enabled in the options.
     */
    get enableGPUTimingMeasurements() {
        return this._timestampQuery.enable;
    }
    set enableGPUTimingMeasurements(enable) {
        if (this._timestampQuery.enable === enable) {
            return;
        }
        this.gpuTimeInFrameForMainPass = enable ? new webgpuPerfCounter/* WebGPUPerfCounter */.e() : undefined;
        this._timestampQuery.enable = enable;
    }
    _currentPassIsMainPass() {
        return this._currentRenderTarget === null;
    }
    /** @internal */
    _endCurrentRenderPass() {
        if (!this._currentRenderPass) {
            return 0;
        }
        if (this._debugStackRenderPass.length !== 0) {
            for (let i = 0; i < this._debugStackRenderPass.length; ++i) {
                this._currentRenderPass.popDebugGroup();
            }
        }
        const currentPassIndex = this._currentPassIsMainPass() ? 2 : 1;
        if (!this._snapshotRendering.endRenderPass(this._currentRenderPass) && !this.compatibilityMode) {
            this._bundleList.run(this._currentRenderPass);
            this._bundleList.reset();
        }
        this._currentRenderPass.end();
        this._timestampQuery.endPass(this._timestampIndex, (this._currentRenderTarget && this._currentRenderTarget.gpuTimeInFrame
            ? this._currentRenderTarget.gpuTimeInFrame
            : this.gpuTimeInFrameForMainPass));
        this._timestampIndex += 2;
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log("frame #" +
                    this._count +
                    " - " +
                    (currentPassIndex === 2 ? "main" : "render target") +
                    " end pass" +
                    (currentPassIndex === 1 ? " - internalTexture.uniqueId=" + this._currentRenderTarget?.texture?.uniqueId : ""));
            }
        }
        this._debugPopGroup?.(0);
        this._currentRenderPass = null;
        return currentPassIndex;
    }
    /**
     * @internal
     */
    _generateMipmaps(texture, commandEncoder) {
        commandEncoder = commandEncoder ?? this._renderEncoder;
        const gpuHardwareTexture = texture._hardwareTexture;
        if (!gpuHardwareTexture) {
            return;
        }
        if (commandEncoder === this._renderEncoder) {
            // We must close the current pass (if any) because we are going to use the render encoder to generate the mipmaps (so, we are going to create a new render pass)
            this._endCurrentRenderPass();
        }
        const format = texture._hardwareTexture.format;
        const mipmapCount = WebGPUTextureHelper.ComputeNumMipmapLevels(texture.width, texture.height);
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log("frame #" +
                    this._count +
                    " - generate mipmaps - width=" +
                    texture.width +
                    ", height=" +
                    texture.height +
                    ", isCube=" +
                    texture.isCube +
                    ", command encoder=" +
                    (commandEncoder === this._renderEncoder ? "render" : "copy"));
            }
        }
        if (texture.isCube) {
            this._textureHelper.generateCubeMipmaps(gpuHardwareTexture, format, mipmapCount, commandEncoder);
        }
        else {
            this._textureHelper.generateMipmaps(gpuHardwareTexture, format, mipmapCount, 0, texture.is3D, commandEncoder);
        }
    }
}
//# sourceMappingURL=thinWebGPUEngine.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.alpha.js




ThinWebGPUEngine.prototype.setAlphaMode = function (mode, noDepthWriteChange = false) {
    if (this._alphaMode === mode && ((mode === 0 && !this._alphaState.alphaBlend) || (mode !== 0 && this._alphaState.alphaBlend))) {
        if (!noDepthWriteChange) {
            // Make sure we still have the correct depth mask according to the alpha mode (a transparent material could have forced writting to the depth buffer, for instance)
            const depthMask = mode === 0;
            if (this.depthCullingState.depthMask !== depthMask) {
                this.setDepthWrite(depthMask);
                this._cacheRenderPipeline.setDepthWriteEnabled(depthMask);
            }
        }
        return;
    }
    switch (mode) {
        case 0:
            this._alphaState.alphaBlend = false;
            break;
        case 7:
            this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 1);
            this._alphaState.alphaBlend = true;
            break;
        case 8:
            this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771);
            this._alphaState.alphaBlend = true;
            break;
        case 2:
            this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 1);
            this._alphaState.alphaBlend = true;
            break;
        case 6:
            this._alphaState.setAlphaBlendFunctionParameters(1, 1, 0, 1);
            this._alphaState.alphaBlend = true;
            break;
        case 1:
            this._alphaState.setAlphaBlendFunctionParameters(770, 1, 0, 1);
            this._alphaState.alphaBlend = true;
            break;
        case 3:
            this._alphaState.setAlphaBlendFunctionParameters(0, 769, 1, 1);
            this._alphaState.alphaBlend = true;
            break;
        case 4:
            this._alphaState.setAlphaBlendFunctionParameters(774, 0, 1, 1);
            this._alphaState.alphaBlend = true;
            break;
        case 5:
            this._alphaState.setAlphaBlendFunctionParameters(770, 769, 1, 1);
            this._alphaState.alphaBlend = true;
            break;
        case 9:
            this._alphaState.setAlphaBlendFunctionParameters(32769, 32770, 32771, 32772);
            this._alphaState.alphaBlend = true;
            break;
        case 10:
            this._alphaState.setAlphaBlendFunctionParameters(1, 769, 1, 771);
            this._alphaState.alphaBlend = true;
            break;
        case 11:
            this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 1);
            this._alphaState.alphaBlend = true;
            break;
        case 12:
            this._alphaState.setAlphaBlendFunctionParameters(772, 1, 0, 0);
            this._alphaState.alphaBlend = true;
            break;
        case 13:
            this._alphaState.setAlphaBlendFunctionParameters(775, 769, 773, 771);
            this._alphaState.alphaBlend = true;
            break;
        case 14:
            this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771);
            this._alphaState.alphaBlend = true;
            break;
        case 15:
            this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 0);
            this._alphaState.alphaBlend = true;
            break;
        case 16:
            this._alphaState.setAlphaBlendFunctionParameters(775, 769, 0, 1);
            this._alphaState.alphaBlend = true;
            break;
        case 17:
            // Same as ALPHA_COMBINE but accumulates (1 - alpha) values in the alpha channel for a later readout in order independant transparency
            this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 771);
            this._alphaState.alphaBlend = true;
            break;
    }
    if (!noDepthWriteChange) {
        this.setDepthWrite(mode === 0);
        this._cacheRenderPipeline.setDepthWriteEnabled(mode === 0);
    }
    this._alphaMode = mode;
    this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend);
    this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);
};
ThinWebGPUEngine.prototype.setAlphaEquation = function (equation) {
    abstractEngine/* AbstractEngine */.$.prototype.setAlphaEquation.call(this, equation);
    this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);
};
//# sourceMappingURL=engine.alpha.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.js + 1 modules
var math = __webpack_require__(62956);
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuConstants.js
/** @internal */
// eslint-disable-next-line import/export
var PowerPreference;
(function (PowerPreference) {
    PowerPreference["LowPower"] = "low-power";
    PowerPreference["HighPerformance"] = "high-performance";
})(PowerPreference || (PowerPreference = {}));
/** @internal */
var FeatureName;
(function (FeatureName) {
    FeatureName["DepthClipControl"] = "depth-clip-control";
    FeatureName["Depth32FloatStencil8"] = "depth32float-stencil8";
    FeatureName["TextureCompressionBC"] = "texture-compression-bc";
    FeatureName["TextureCompressionBCSliced3D"] = "texture-compression-bc-sliced-3d";
    FeatureName["TextureCompressionETC2"] = "texture-compression-etc2";
    FeatureName["TextureCompressionASTC"] = "texture-compression-astc";
    FeatureName["TextureCompressionASTCSliced3D"] = "texture-compression-astc-sliced-3d";
    FeatureName["TimestampQuery"] = "timestamp-query";
    FeatureName["IndirectFirstInstance"] = "indirect-first-instance";
    FeatureName["ShaderF16"] = "shader-f16";
    FeatureName["RG11B10UFloatRenderable"] = "rg11b10ufloat-renderable";
    FeatureName["BGRA8UnormStorage"] = "bgra8unorm-storage";
    FeatureName["Float32Filterable"] = "float32-filterable";
    FeatureName["Float32Blendable"] = "float32-blendable";
    FeatureName["ClipDistances"] = "clip-distances";
    FeatureName["DualSourceBlending"] = "dual-source-blending";
})(FeatureName || (FeatureName = {}));
/** @internal */
var BufferMapState;
(function (BufferMapState) {
    BufferMapState["Unmapped"] = "unmapped";
    BufferMapState["Pending"] = "pending";
    BufferMapState["Mapped"] = "mapped";
})(BufferMapState || (BufferMapState = {}));
/** @internal */
var BufferUsage;
(function (BufferUsage) {
    BufferUsage[BufferUsage["MapRead"] = 1] = "MapRead";
    BufferUsage[BufferUsage["MapWrite"] = 2] = "MapWrite";
    BufferUsage[BufferUsage["CopySrc"] = 4] = "CopySrc";
    BufferUsage[BufferUsage["CopyDst"] = 8] = "CopyDst";
    BufferUsage[BufferUsage["Index"] = 16] = "Index";
    BufferUsage[BufferUsage["Vertex"] = 32] = "Vertex";
    BufferUsage[BufferUsage["Uniform"] = 64] = "Uniform";
    BufferUsage[BufferUsage["Storage"] = 128] = "Storage";
    BufferUsage[BufferUsage["Indirect"] = 256] = "Indirect";
    BufferUsage[BufferUsage["QueryResolve"] = 512] = "QueryResolve";
})(BufferUsage || (BufferUsage = {}));
/** @internal */
var MapMode;
(function (MapMode) {
    MapMode[MapMode["Read"] = 1] = "Read";
    MapMode[MapMode["Write"] = 2] = "Write";
})(MapMode || (MapMode = {}));
/** @internal */
var TextureDimension;
(function (TextureDimension) {
    TextureDimension["E1d"] = "1d";
    TextureDimension["E2d"] = "2d";
    TextureDimension["E3d"] = "3d";
})(TextureDimension || (TextureDimension = {}));
/** @internal */
var TextureUsage;
(function (TextureUsage) {
    TextureUsage[TextureUsage["CopySrc"] = 1] = "CopySrc";
    TextureUsage[TextureUsage["CopyDst"] = 2] = "CopyDst";
    TextureUsage[TextureUsage["TextureBinding"] = 4] = "TextureBinding";
    TextureUsage[TextureUsage["StorageBinding"] = 8] = "StorageBinding";
    TextureUsage[TextureUsage["RenderAttachment"] = 16] = "RenderAttachment";
})(TextureUsage || (TextureUsage = {}));
/** @internal */
var TextureViewDimension;
(function (TextureViewDimension) {
    TextureViewDimension["E1d"] = "1d";
    TextureViewDimension["E2d"] = "2d";
    TextureViewDimension["E2dArray"] = "2d-array";
    TextureViewDimension["Cube"] = "cube";
    TextureViewDimension["CubeArray"] = "cube-array";
    TextureViewDimension["E3d"] = "3d";
})(TextureViewDimension || (TextureViewDimension = {}));
/** @internal */
var TextureAspect;
(function (TextureAspect) {
    TextureAspect["All"] = "all";
    TextureAspect["StencilOnly"] = "stencil-only";
    TextureAspect["DepthOnly"] = "depth-only";
})(TextureAspect || (TextureAspect = {}));
/**
 * Comments taken from https://github.com/gfx-rs/wgpu/blob/master/wgpu-types/src/lib.rs
 * @internal
 */
var TextureFormat;
(function (TextureFormat) {
    // 8-bit formats
    TextureFormat["R8Unorm"] = "r8unorm";
    TextureFormat["R8Snorm"] = "r8snorm";
    TextureFormat["R8Uint"] = "r8uint";
    TextureFormat["R8Sint"] = "r8sint";
    // 16-bit formats
    TextureFormat["R16Uint"] = "r16uint";
    TextureFormat["R16Sint"] = "r16sint";
    TextureFormat["R16Float"] = "r16float";
    TextureFormat["RG8Unorm"] = "rg8unorm";
    TextureFormat["RG8Snorm"] = "rg8snorm";
    TextureFormat["RG8Uint"] = "rg8uint";
    TextureFormat["RG8Sint"] = "rg8sint";
    TextureFormat["R16Unorm"] = "r16unorm";
    TextureFormat["R16Snorm"] = "r16snorm";
    TextureFormat["RG16Unorm"] = "rg16unorm";
    TextureFormat["RG16Snorm"] = "rg16snorm";
    TextureFormat["RGBA16Unorm"] = "rgba16unorm";
    TextureFormat["RGBA16Snorm"] = "rgba16snorm";
    // 32-bit formats
    TextureFormat["R32Uint"] = "r32uint";
    TextureFormat["R32Sint"] = "r32sint";
    TextureFormat["R32Float"] = "r32float";
    TextureFormat["RG16Uint"] = "rg16uint";
    TextureFormat["RG16Sint"] = "rg16sint";
    TextureFormat["RG16Float"] = "rg16float";
    TextureFormat["RGBA8Unorm"] = "rgba8unorm";
    TextureFormat["RGBA8UnormSRGB"] = "rgba8unorm-srgb";
    TextureFormat["RGBA8Snorm"] = "rgba8snorm";
    TextureFormat["RGBA8Uint"] = "rgba8uint";
    TextureFormat["RGBA8Sint"] = "rgba8sint";
    TextureFormat["BGRA8Unorm"] = "bgra8unorm";
    TextureFormat["BGRA8UnormSRGB"] = "bgra8unorm-srgb";
    // Packed 32-bit formats
    TextureFormat["RGB9E5UFloat"] = "rgb9e5ufloat";
    TextureFormat["RGB10A2UINT"] = "rgb10a2uint";
    TextureFormat["RGB10A2Unorm"] = "rgb10a2unorm";
    TextureFormat["RG11B10UFloat"] = "rg11b10ufloat";
    // 64-bit formats
    TextureFormat["RG32Uint"] = "rg32uint";
    TextureFormat["RG32Sint"] = "rg32sint";
    TextureFormat["RG32Float"] = "rg32float";
    TextureFormat["RGBA16Uint"] = "rgba16uint";
    TextureFormat["RGBA16Sint"] = "rgba16sint";
    TextureFormat["RGBA16Float"] = "rgba16float";
    // 128-bit formats
    TextureFormat["RGBA32Uint"] = "rgba32uint";
    TextureFormat["RGBA32Sint"] = "rgba32sint";
    TextureFormat["RGBA32Float"] = "rgba32float";
    // Depth and stencil formats
    TextureFormat["Stencil8"] = "stencil8";
    TextureFormat["Depth16Unorm"] = "depth16unorm";
    TextureFormat["Depth24Plus"] = "depth24plus";
    TextureFormat["Depth24PlusStencil8"] = "depth24plus-stencil8";
    TextureFormat["Depth32Float"] = "depth32float";
    // BC compressed formats usable if "texture-compression-bc" is both
    // supported by the device/user agent and enabled in requestDevice.
    TextureFormat["BC1RGBAUnorm"] = "bc1-rgba-unorm";
    TextureFormat["BC1RGBAUnormSRGB"] = "bc1-rgba-unorm-srgb";
    TextureFormat["BC2RGBAUnorm"] = "bc2-rgba-unorm";
    TextureFormat["BC2RGBAUnormSRGB"] = "bc2-rgba-unorm-srgb";
    TextureFormat["BC3RGBAUnorm"] = "bc3-rgba-unorm";
    TextureFormat["BC3RGBAUnormSRGB"] = "bc3-rgba-unorm-srgb";
    TextureFormat["BC4RUnorm"] = "bc4-r-unorm";
    TextureFormat["BC4RSnorm"] = "bc4-r-snorm";
    TextureFormat["BC5RGUnorm"] = "bc5-rg-unorm";
    TextureFormat["BC5RGSnorm"] = "bc5-rg-snorm";
    TextureFormat["BC6HRGBUFloat"] = "bc6h-rgb-ufloat";
    TextureFormat["BC6HRGBFloat"] = "bc6h-rgb-float";
    TextureFormat["BC7RGBAUnorm"] = "bc7-rgba-unorm";
    TextureFormat["BC7RGBAUnormSRGB"] = "bc7-rgba-unorm-srgb";
    // ETC2 compressed formats usable if "texture-compression-etc2" is both
    // supported by the device/user agent and enabled in requestDevice.
    TextureFormat["ETC2RGB8Unorm"] = "etc2-rgb8unorm";
    TextureFormat["ETC2RGB8UnormSRGB"] = "etc2-rgb8unorm-srgb";
    TextureFormat["ETC2RGB8A1Unorm"] = "etc2-rgb8a1unorm";
    TextureFormat["ETC2RGB8A1UnormSRGB"] = "etc2-rgb8a1unorm-srgb";
    TextureFormat["ETC2RGBA8Unorm"] = "etc2-rgba8unorm";
    TextureFormat["ETC2RGBA8UnormSRGB"] = "etc2-rgba8unorm-srgb";
    TextureFormat["EACR11Unorm"] = "eac-r11unorm";
    TextureFormat["EACR11Snorm"] = "eac-r11snorm";
    TextureFormat["EACRG11Unorm"] = "eac-rg11unorm";
    TextureFormat["EACRG11Snorm"] = "eac-rg11snorm";
    // ASTC compressed formats usable if "texture-compression-astc" is both
    // supported by the device/user agent and enabled in requestDevice.
    TextureFormat["ASTC4x4Unorm"] = "astc-4x4-unorm";
    TextureFormat["ASTC4x4UnormSRGB"] = "astc-4x4-unorm-srgb";
    TextureFormat["ASTC5x4Unorm"] = "astc-5x4-unorm";
    TextureFormat["ASTC5x4UnormSRGB"] = "astc-5x4-unorm-srgb";
    TextureFormat["ASTC5x5Unorm"] = "astc-5x5-unorm";
    TextureFormat["ASTC5x5UnormSRGB"] = "astc-5x5-unorm-srgb";
    TextureFormat["ASTC6x5Unorm"] = "astc-6x5-unorm";
    TextureFormat["ASTC6x5UnormSRGB"] = "astc-6x5-unorm-srgb";
    TextureFormat["ASTC6x6Unorm"] = "astc-6x6-unorm";
    TextureFormat["ASTC6x6UnormSRGB"] = "astc-6x6-unorm-srgb";
    TextureFormat["ASTC8x5Unorm"] = "astc-8x5-unorm";
    TextureFormat["ASTC8x5UnormSRGB"] = "astc-8x5-unorm-srgb";
    TextureFormat["ASTC8x6Unorm"] = "astc-8x6-unorm";
    TextureFormat["ASTC8x6UnormSRGB"] = "astc-8x6-unorm-srgb";
    TextureFormat["ASTC8x8Unorm"] = "astc-8x8-unorm";
    TextureFormat["ASTC8x8UnormSRGB"] = "astc-8x8-unorm-srgb";
    TextureFormat["ASTC10x5Unorm"] = "astc-10x5-unorm";
    TextureFormat["ASTC10x5UnormSRGB"] = "astc-10x5-unorm-srgb";
    TextureFormat["ASTC10x6Unorm"] = "astc-10x6-unorm";
    TextureFormat["ASTC10x6UnormSRGB"] = "astc-10x6-unorm-srgb";
    TextureFormat["ASTC10x8Unorm"] = "astc-10x8-unorm";
    TextureFormat["ASTC10x8UnormSRGB"] = "astc-10x8-unorm-srgb";
    TextureFormat["ASTC10x10Unorm"] = "astc-10x10-unorm";
    TextureFormat["ASTC10x10UnormSRGB"] = "astc-10x10-unorm-srgb";
    TextureFormat["ASTC12x10Unorm"] = "astc-12x10-unorm";
    TextureFormat["ASTC12x10UnormSRGB"] = "astc-12x10-unorm-srgb";
    TextureFormat["ASTC12x12Unorm"] = "astc-12x12-unorm";
    TextureFormat["ASTC12x12UnormSRGB"] = "astc-12x12-unorm-srgb";
    // "depth32float-stencil8" feature
    TextureFormat["Depth32FloatStencil8"] = "depth32float-stencil8";
})(TextureFormat || (TextureFormat = {}));
/** @internal */
var AddressMode;
(function (AddressMode) {
    AddressMode["ClampToEdge"] = "clamp-to-edge";
    AddressMode["Repeat"] = "repeat";
    AddressMode["MirrorRepeat"] = "mirror-repeat";
})(AddressMode || (AddressMode = {}));
/** @internal */
var FilterMode;
(function (FilterMode) {
    FilterMode["Nearest"] = "nearest";
    FilterMode["Linear"] = "linear";
})(FilterMode || (FilterMode = {}));
/** @internal */
var MipmapFilterMode;
(function (MipmapFilterMode) {
    MipmapFilterMode["Nearest"] = "nearest";
    MipmapFilterMode["Linear"] = "linear";
})(MipmapFilterMode || (MipmapFilterMode = {}));
/** @internal */
var CompareFunction;
(function (CompareFunction) {
    CompareFunction["Never"] = "never";
    CompareFunction["Less"] = "less";
    CompareFunction["Equal"] = "equal";
    CompareFunction["LessEqual"] = "less-equal";
    CompareFunction["Greater"] = "greater";
    CompareFunction["NotEqual"] = "not-equal";
    CompareFunction["GreaterEqual"] = "greater-equal";
    CompareFunction["Always"] = "always";
})(CompareFunction || (CompareFunction = {}));
/** @internal */
var ShaderStage;
(function (ShaderStage) {
    ShaderStage[ShaderStage["Vertex"] = 1] = "Vertex";
    ShaderStage[ShaderStage["Fragment"] = 2] = "Fragment";
    ShaderStage[ShaderStage["Compute"] = 4] = "Compute";
})(ShaderStage || (ShaderStage = {}));
/** @internal */
var BufferBindingType;
(function (BufferBindingType) {
    BufferBindingType["Uniform"] = "uniform";
    BufferBindingType["Storage"] = "storage";
    BufferBindingType["ReadOnlyStorage"] = "read-only-storage";
})(BufferBindingType || (BufferBindingType = {}));
/** @internal */
var SamplerBindingType;
(function (SamplerBindingType) {
    SamplerBindingType["Filtering"] = "filtering";
    SamplerBindingType["NonFiltering"] = "non-filtering";
    SamplerBindingType["Comparison"] = "comparison";
})(SamplerBindingType || (SamplerBindingType = {}));
/** @internal */
var TextureSampleType;
(function (TextureSampleType) {
    TextureSampleType["Float"] = "float";
    TextureSampleType["UnfilterableFloat"] = "unfilterable-float";
    TextureSampleType["Depth"] = "depth";
    TextureSampleType["Sint"] = "sint";
    TextureSampleType["Uint"] = "uint";
})(TextureSampleType || (TextureSampleType = {}));
/** @internal */
var StorageTextureAccess;
(function (StorageTextureAccess) {
    StorageTextureAccess["WriteOnly"] = "write-only";
    StorageTextureAccess["ReadOnly"] = "read-only";
    StorageTextureAccess["ReadWrite"] = "read-write";
})(StorageTextureAccess || (StorageTextureAccess = {}));
/** @internal */
var CompilationMessageType;
(function (CompilationMessageType) {
    CompilationMessageType["Error"] = "error";
    CompilationMessageType["Warning"] = "warning";
    CompilationMessageType["Info"] = "info";
})(CompilationMessageType || (CompilationMessageType = {}));
/** @internal */
var PipelineErrorReason;
(function (PipelineErrorReason) {
    PipelineErrorReason["Validation"] = "validation";
    PipelineErrorReason["Internal"] = "internal";
})(PipelineErrorReason || (PipelineErrorReason = {}));
/** @internal */
var AutoLayoutMode;
(function (AutoLayoutMode) {
    AutoLayoutMode["Auto"] = "auto";
})(AutoLayoutMode || (AutoLayoutMode = {}));
/** @internal */
var PrimitiveTopology;
(function (PrimitiveTopology) {
    PrimitiveTopology["PointList"] = "point-list";
    PrimitiveTopology["LineList"] = "line-list";
    PrimitiveTopology["LineStrip"] = "line-strip";
    PrimitiveTopology["TriangleList"] = "triangle-list";
    PrimitiveTopology["TriangleStrip"] = "triangle-strip";
})(PrimitiveTopology || (PrimitiveTopology = {}));
/** @internal */
var FrontFace;
(function (FrontFace) {
    FrontFace["CCW"] = "ccw";
    FrontFace["CW"] = "cw";
})(FrontFace || (FrontFace = {}));
/** @internal */
var CullMode;
(function (CullMode) {
    CullMode["None"] = "none";
    CullMode["Front"] = "front";
    CullMode["Back"] = "back";
})(CullMode || (CullMode = {}));
/** @internal */
var ColorWrite;
(function (ColorWrite) {
    ColorWrite[ColorWrite["Red"] = 1] = "Red";
    ColorWrite[ColorWrite["Green"] = 2] = "Green";
    ColorWrite[ColorWrite["Blue"] = 4] = "Blue";
    ColorWrite[ColorWrite["Alpha"] = 8] = "Alpha";
    ColorWrite[ColorWrite["All"] = 15] = "All";
})(ColorWrite || (ColorWrite = {}));
/** @internal */
var BlendFactor;
(function (BlendFactor) {
    BlendFactor["Zero"] = "zero";
    BlendFactor["One"] = "one";
    BlendFactor["Src"] = "src";
    BlendFactor["OneMinusSrc"] = "one-minus-src";
    BlendFactor["SrcAlpha"] = "src-alpha";
    BlendFactor["OneMinusSrcAlpha"] = "one-minus-src-alpha";
    BlendFactor["Dst"] = "dst";
    BlendFactor["OneMinusDst"] = "one-minus-dst";
    BlendFactor["DstAlpha"] = "dst-alpha";
    BlendFactor["OneMinusDstAlpha"] = "one-minus-dst-alpha";
    BlendFactor["SrcAlphaSaturated"] = "src-alpha-saturated";
    BlendFactor["Constant"] = "constant";
    BlendFactor["OneMinusConstant"] = "one-minus-constant";
    BlendFactor["Src1"] = "src1";
    BlendFactor["OneMinusSrc1"] = "one-minus-src1";
    BlendFactor["Src1Alpha"] = "src1-alpha";
    BlendFactor["OneMinusSrc1Alpha"] = "one-minus-src1-alpha";
})(BlendFactor || (BlendFactor = {}));
/** @internal */
var BlendOperation;
(function (BlendOperation) {
    BlendOperation["Add"] = "add";
    BlendOperation["Subtract"] = "subtract";
    BlendOperation["ReverseSubtract"] = "reverse-subtract";
    BlendOperation["Min"] = "min";
    BlendOperation["Max"] = "max";
})(BlendOperation || (BlendOperation = {}));
/** @internal */
var StencilOperation;
(function (StencilOperation) {
    StencilOperation["Keep"] = "keep";
    StencilOperation["Zero"] = "zero";
    StencilOperation["Replace"] = "replace";
    StencilOperation["Invert"] = "invert";
    StencilOperation["IncrementClamp"] = "increment-clamp";
    StencilOperation["DecrementClamp"] = "decrement-clamp";
    StencilOperation["IncrementWrap"] = "increment-wrap";
    StencilOperation["DecrementWrap"] = "decrement-wrap";
})(StencilOperation || (StencilOperation = {}));
/** @internal */
var IndexFormat;
(function (IndexFormat) {
    IndexFormat["Uint16"] = "uint16";
    IndexFormat["Uint32"] = "uint32";
})(IndexFormat || (IndexFormat = {}));
/** @internal */
var VertexFormat;
(function (VertexFormat) {
    VertexFormat["Uint8x2"] = "uint8x2";
    VertexFormat["Uint8x4"] = "uint8x4";
    VertexFormat["Sint8x2"] = "sint8x2";
    VertexFormat["Sint8x4"] = "sint8x4";
    VertexFormat["Unorm8x2"] = "unorm8x2";
    VertexFormat["Unorm8x4"] = "unorm8x4";
    VertexFormat["Snorm8x2"] = "snorm8x2";
    VertexFormat["Snorm8x4"] = "snorm8x4";
    VertexFormat["Uint16x2"] = "uint16x2";
    VertexFormat["Uint16x4"] = "uint16x4";
    VertexFormat["Sint16x2"] = "sint16x2";
    VertexFormat["Sint16x4"] = "sint16x4";
    VertexFormat["Unorm16x2"] = "unorm16x2";
    VertexFormat["Unorm16x4"] = "unorm16x4";
    VertexFormat["Snorm16x2"] = "snorm16x2";
    VertexFormat["Snorm16x4"] = "snorm16x4";
    VertexFormat["Float16x2"] = "float16x2";
    VertexFormat["Float16x4"] = "float16x4";
    VertexFormat["Float32"] = "float32";
    VertexFormat["Float32x2"] = "float32x2";
    VertexFormat["Float32x3"] = "float32x3";
    VertexFormat["Float32x4"] = "float32x4";
    VertexFormat["Uint32"] = "uint32";
    VertexFormat["Uint32x2"] = "uint32x2";
    VertexFormat["Uint32x3"] = "uint32x3";
    VertexFormat["Uint32x4"] = "uint32x4";
    VertexFormat["Sint32"] = "sint32";
    VertexFormat["Sint32x2"] = "sint32x2";
    VertexFormat["Sint32x3"] = "sint32x3";
    VertexFormat["Sint32x4"] = "sint32x4";
    VertexFormat["UNORM10x10x10x2"] = "unorm10-10-10-2";
})(VertexFormat || (VertexFormat = {}));
/** @internal */
var VertexStepMode;
(function (VertexStepMode) {
    VertexStepMode["Vertex"] = "vertex";
    VertexStepMode["Instance"] = "instance";
})(VertexStepMode || (VertexStepMode = {}));
/** @internal */
var ComputePassTimestampLocation;
(function (ComputePassTimestampLocation) {
    ComputePassTimestampLocation["Beginning"] = "beginning";
    ComputePassTimestampLocation["End"] = "end";
})(ComputePassTimestampLocation || (ComputePassTimestampLocation = {}));
/** @internal */
var RenderPassTimestampLocation;
(function (RenderPassTimestampLocation) {
    RenderPassTimestampLocation["Beginning"] = "beginning";
    RenderPassTimestampLocation["End"] = "end";
})(RenderPassTimestampLocation || (RenderPassTimestampLocation = {}));
/** @internal */
var LoadOp;
(function (LoadOp) {
    LoadOp["Load"] = "load";
    LoadOp["Clear"] = "clear";
})(LoadOp || (LoadOp = {}));
/** @internal */
var StoreOp;
(function (StoreOp) {
    StoreOp["Store"] = "store";
    StoreOp["Discard"] = "discard";
})(StoreOp || (StoreOp = {}));
/** @internal */
var QueryType;
(function (QueryType) {
    QueryType["Occlusion"] = "occlusion";
    QueryType["Timestamp"] = "timestamp";
})(QueryType || (QueryType = {}));
/** @internal */
var CanvasAlphaMode;
(function (CanvasAlphaMode) {
    CanvasAlphaMode["Opaque"] = "opaque";
    CanvasAlphaMode["Premultiplied"] = "premultiplied";
})(CanvasAlphaMode || (CanvasAlphaMode = {}));
/** @internal */
var CanvasToneMappingMode;
(function (CanvasToneMappingMode) {
    CanvasToneMappingMode["Standard"] = "standard";
    CanvasToneMappingMode["Extended"] = "extended";
})(CanvasToneMappingMode || (CanvasToneMappingMode = {}));
/** @internal */
var DeviceLostReason;
(function (DeviceLostReason) {
    DeviceLostReason["Unknown"] = "unknown";
    DeviceLostReason["Destroyed"] = "destroyed";
})(DeviceLostReason || (DeviceLostReason = {}));
/** @internal */
var ErrorFilter;
(function (ErrorFilter) {
    ErrorFilter["Validation"] = "validation";
    ErrorFilter["OutOfMemory"] = "out-of-memory";
    ErrorFilter["Internal"] = "internal";
})(ErrorFilter || (ErrorFilter = {}));
//# sourceMappingURL=webgpuConstants.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessor.js
/** @internal */
class WebGPUShaderProcessor {
    constructor() {
        this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;
    }
    _addUniformToLeftOverUBO(name, uniformType, preProcessors) {
        let length = 0;
        [name, uniformType, length] = this._getArraySize(name, uniformType, preProcessors);
        for (let i = 0; i < this._webgpuProcessingContext.leftOverUniforms.length; i++) {
            if (this._webgpuProcessingContext.leftOverUniforms[i].name === name) {
                return;
            }
        }
        this._webgpuProcessingContext.leftOverUniforms.push({
            name,
            type: uniformType,
            length,
        });
    }
    _buildLeftOverUBO() {
        if (!this._webgpuProcessingContext.leftOverUniforms.length) {
            return "";
        }
        const name = WebGPUShaderProcessor.LeftOvertUBOName;
        let availableUBO = this._webgpuProcessingContext.availableBuffers[name];
        if (!availableUBO) {
            availableUBO = {
                binding: this._webgpuProcessingContext.getNextFreeUBOBinding(),
            };
            this._webgpuProcessingContext.availableBuffers[name] = availableUBO;
            this._addBufferBindingDescription(name, availableUBO, "uniform" /* WebGPUConstants.BufferBindingType.Uniform */, true);
            this._addBufferBindingDescription(name, availableUBO, "uniform" /* WebGPUConstants.BufferBindingType.Uniform */, false);
        }
        return this._generateLeftOverUBOCode(name, availableUBO);
    }
    _collectBindingNames() {
        // collect all the binding names for faster processing in WebGPUCacheBindGroup
        for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {
            const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i];
            if (setDefinition === undefined) {
                this._webgpuProcessingContext.bindGroupLayoutEntries[i] = [];
                continue;
            }
            for (let j = 0; j < setDefinition.length; j++) {
                const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j];
                const name = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name;
                const nameInArrayOfTexture = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].nameInArrayOfTexture;
                if (entry) {
                    if (entry.texture || entry.externalTexture || entry.storageTexture) {
                        this._webgpuProcessingContext.textureNames.push(nameInArrayOfTexture);
                    }
                    else if (entry.sampler) {
                        this._webgpuProcessingContext.samplerNames.push(name);
                    }
                    else if (entry.buffer) {
                        this._webgpuProcessingContext.bufferNames.push(name);
                    }
                }
            }
        }
    }
    _preCreateBindGroupEntries() {
        const bindGroupEntries = this._webgpuProcessingContext.bindGroupEntries;
        for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {
            const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i];
            const entries = [];
            for (let j = 0; j < setDefinition.length; j++) {
                const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j];
                if (entry.sampler || entry.texture || entry.storageTexture || entry.externalTexture) {
                    entries.push({
                        binding: entry.binding,
                        resource: undefined,
                    });
                }
                else if (entry.buffer) {
                    entries.push({
                        binding: entry.binding,
                        resource: {
                            buffer: undefined,
                            offset: 0,
                            size: 0,
                        },
                    });
                }
            }
            bindGroupEntries[i] = entries;
        }
    }
    _addTextureBindingDescription(name, textureInfo, textureIndex, dimension, format, isVertex) {
        // eslint-disable-next-line prefer-const
        let { groupIndex, bindingIndex } = textureInfo.textures[textureIndex];
        if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {
            this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];
            this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];
        }
        if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {
            let len;
            if (dimension === null) {
                len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({
                    binding: bindingIndex,
                    visibility: 0,
                    externalTexture: {},
                });
            }
            else if (format) {
                len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({
                    binding: bindingIndex,
                    visibility: 0,
                    storageTexture: {
                        access: "write-only" /* WebGPUConstants.StorageTextureAccess.WriteOnly */,
                        format,
                        viewDimension: dimension,
                    },
                });
            }
            else {
                len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({
                    binding: bindingIndex,
                    visibility: 0,
                    texture: {
                        sampleType: textureInfo.sampleType,
                        viewDimension: dimension,
                        multisampled: false,
                    },
                });
            }
            const textureName = textureInfo.isTextureArray ? name + textureIndex : name;
            this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1, nameInArrayOfTexture: textureName };
        }
        bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;
        if (isVertex) {
            this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;
        }
        else {
            this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;
        }
    }
    _addSamplerBindingDescription(name, samplerInfo, isVertex) {
        // eslint-disable-next-line prefer-const
        let { groupIndex, bindingIndex } = samplerInfo.binding;
        if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {
            this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];
            this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];
        }
        if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {
            const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({
                binding: bindingIndex,
                visibility: 0,
                sampler: {
                    type: samplerInfo.type,
                },
            });
            this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1 };
        }
        bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;
        if (isVertex) {
            this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;
        }
        else {
            this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;
        }
    }
    _addBufferBindingDescription(name, uniformBufferInfo, bufferType, isVertex) {
        // eslint-disable-next-line prefer-const
        let { groupIndex, bindingIndex } = uniformBufferInfo.binding;
        if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {
            this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];
            this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];
        }
        if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {
            const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({
                binding: bindingIndex,
                visibility: 0,
                buffer: {
                    type: bufferType,
                },
            });
            this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1 };
        }
        bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;
        if (isVertex) {
            this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;
        }
        else {
            this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;
        }
    }
}
WebGPUShaderProcessor.LeftOvertUBOName = "LeftOver";
WebGPUShaderProcessor.InternalsUBOName = "Internals";
WebGPUShaderProcessor.UniformSizes = {
    // GLSL types
    bool: 1,
    int: 1,
    float: 1,
    vec2: 2,
    ivec2: 2,
    uvec2: 2,
    vec3: 3,
    ivec3: 3,
    uvec3: 3,
    vec4: 4,
    ivec4: 4,
    uvec4: 4,
    mat2: 4,
    mat3: 12,
    mat4: 16,
    // WGSL types
    i32: 1,
    u32: 1,
    f32: 1,
    mat2x2: 4,
    mat3x3: 12,
    mat4x4: 16,
    mat2x2f: 4,
    mat3x3f: 12,
    mat4x4f: 16,
    vec2i: 2,
    vec3i: 3,
    vec4i: 4,
    vec2u: 2,
    vec3u: 3,
    vec4u: 4,
    vec2f: 2,
    vec3f: 3,
    vec4f: 4,
    vec2h: 1,
    vec3h: 2,
    vec4h: 2,
};
// eslint-disable-next-line @typescript-eslint/naming-convention
WebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType = {
    sampler2D: "sampler2D",
    sampler2DArray: "sampler2DArray",
    sampler2DShadow: "sampler2DShadow",
    sampler2DArrayShadow: "sampler2DArrayShadow",
    samplerCube: "samplerCube",
    sampler3D: "sampler3D",
};
// eslint-disable-next-line @typescript-eslint/naming-convention
WebGPUShaderProcessor._TextureTypeByWebGLSamplerType = {
    sampler2D: "texture2D",
    sampler2DArray: "texture2DArray",
    sampler2DShadow: "texture2D",
    sampler2DArrayShadow: "texture2DArray",
    samplerCube: "textureCube",
    samplerCubeArray: "textureCubeArray",
    sampler3D: "texture3D",
};
// eslint-disable-next-line @typescript-eslint/naming-convention
WebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType = {
    textureCube: "cube" /* WebGPUConstants.TextureViewDimension.Cube */,
    textureCubeArray: "cube-array" /* WebGPUConstants.TextureViewDimension.CubeArray */,
    texture2D: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
    texture2DArray: "2d-array" /* WebGPUConstants.TextureViewDimension.E2dArray */,
    texture3D: "3d" /* WebGPUConstants.TextureViewDimension.E3d */,
};
// if the webgl sampler type is not listed in this array, "sampler" is taken by default
// eslint-disable-next-line @typescript-eslint/naming-convention
WebGPUShaderProcessor._SamplerTypeByWebGLSamplerType = {
    sampler2DShadow: "samplerShadow",
    sampler2DArrayShadow: "samplerShadow",
};
// eslint-disable-next-line @typescript-eslint/naming-convention
WebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType = {
    samplerShadow: true,
    samplerArrayShadow: true,
    sampler: false,
};
//# sourceMappingURL=webgpuShaderProcessor.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuPipelineContext.js


/** @internal */
class WebGPUPipelineContext {
    get isAsync() {
        return false;
    }
    get isReady() {
        if (this.stages) {
            return true;
        }
        return false;
    }
    constructor(shaderProcessingContext, engine) {
        // The field is indexed by textureState. See @WebGPUMaterialContext.textureState for more information.
        this.bindGroupLayouts = {};
        this._name = "unnamed";
        this.shaderProcessingContext = shaderProcessingContext;
        this._leftOverUniformsByName = {};
        this.engine = engine;
        this.vertexBufferKindToType = {};
    }
    _handlesSpectorRebuildCallback() {
        // Nothing to do yet for spector.
    }
    _fillEffectInformation(effect, uniformBuffersNames, uniformsNames, uniforms, samplerList, samplers, attributesNames, attributes) {
        const engine = this.engine;
        if (engine._doNotHandleContextLost) {
            effect._fragmentSourceCode = "";
            effect._vertexSourceCode = "";
        }
        const foundSamplers = this.shaderProcessingContext.availableTextures;
        let index;
        for (index = 0; index < samplerList.length; index++) {
            const name = samplerList[index];
            const sampler = foundSamplers[samplerList[index]];
            if (sampler == null || sampler == undefined) {
                samplerList.splice(index, 1);
                index--;
            }
            else {
                samplers[name] = index;
            }
        }
        for (const attr of engine.getAttributes(this, attributesNames)) {
            attributes.push(attr);
        }
        // Build the uniform layout for the left over uniforms.
        this.buildUniformLayout();
        const attributeNamesFromEffect = [];
        const attributeLocationsFromEffect = [];
        for (index = 0; index < attributesNames.length; index++) {
            const location = attributes[index];
            if (location >= 0) {
                attributeNamesFromEffect.push(attributesNames[index]);
                attributeLocationsFromEffect.push(location);
            }
        }
        this.shaderProcessingContext.attributeNamesFromEffect = attributeNamesFromEffect;
        this.shaderProcessingContext.attributeLocationsFromEffect = attributeLocationsFromEffect;
    }
    /** @internal */
    /**
     * Build the uniform buffer used in the material.
     */
    buildUniformLayout() {
        if (!this.shaderProcessingContext.leftOverUniforms.length) {
            return;
        }
        this.uniformBuffer?.dispose();
        this.uniformBuffer = new uniformBuffer/* UniformBuffer */.D(this.engine, undefined, undefined, "leftOver-" + this._name);
        for (const leftOverUniform of this.shaderProcessingContext.leftOverUniforms) {
            const type = leftOverUniform.type.replace(/^(.*?)(<.*>)?$/, "$1");
            const size = WebGPUShaderProcessor.UniformSizes[type];
            this.uniformBuffer.addUniform(leftOverUniform.name, size, leftOverUniform.length);
            this._leftOverUniformsByName[leftOverUniform.name] = leftOverUniform.type;
        }
        this.uniformBuffer.create();
    }
    setEngine(engine) {
        this.engine = engine;
    }
    /**
     * Release all associated resources.
     **/
    dispose() {
        if (this.uniformBuffer) {
            this.uniformBuffer.dispose();
        }
    }
    /**
     * Sets an integer value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value Value to be set.
     */
    setInt(uniformName, value) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateInt(uniformName, value);
    }
    /**
     * Sets an int2 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int2.
     * @param y Second int in int2.
     */
    setInt2(uniformName, x, y) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateInt2(uniformName, x, y);
    }
    /**
     * Sets an int3 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int3.
     * @param y Second int in int3.
     * @param z Third int in int3.
     */
    setInt3(uniformName, x, y, z) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateInt3(uniformName, x, y, z);
    }
    /**
     * Sets an int4 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First int in int4.
     * @param y Second int in int4.
     * @param z Third int in int4.
     * @param w Fourth int in int4.
     */
    setInt4(uniformName, x, y, z, w) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateInt4(uniformName, x, y, z, w);
    }
    /**
     * Sets an int array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray(uniformName, array) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateIntArray(uniformName, array);
    }
    /**
     * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray2(uniformName, array) {
        this.setIntArray(uniformName, array);
    }
    /**
     * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray3(uniformName, array) {
        this.setIntArray(uniformName, array);
    }
    /**
     * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setIntArray4(uniformName, array) {
        this.setIntArray(uniformName, array);
    }
    /**
     * Sets an unsigned integer value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value Value to be set.
     */
    setUInt(uniformName, value) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateUInt(uniformName, value);
    }
    /**
     * Sets an unsigned int2 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint2.
     * @param y Second unsigned int in uint2.
     */
    setUInt2(uniformName, x, y) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateUInt2(uniformName, x, y);
    }
    /**
     * Sets an unsigned int3 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint3.
     * @param y Second unsigned int in uint3.
     * @param z Third unsigned int in uint3.
     */
    setUInt3(uniformName, x, y, z) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateUInt3(uniformName, x, y, z);
    }
    /**
     * Sets an unsigned int4 value on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First unsigned int in uint4.
     * @param y Second unsigned int in uint4.
     * @param z Third unsigned int in uint4.
     * @param w Fourth unsigned int in uint4.
     */
    setUInt4(uniformName, x, y, z, w) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateUInt4(uniformName, x, y, z, w);
    }
    /**
     * Sets an unsigned int array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray(uniformName, array) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateUIntArray(uniformName, array);
    }
    /**
     * Sets an unsigned int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray2(uniformName, array) {
        this.setUIntArray(uniformName, array);
    }
    /**
     * Sets an unsigned int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray3(uniformName, array) {
        this.setUIntArray(uniformName, array);
    }
    /**
     * Sets an unsigned int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setUIntArray4(uniformName, array) {
        this.setUIntArray(uniformName, array);
    }
    /**
     * Sets an array on a uniform variable.
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray(uniformName, array) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateArray(uniformName, array);
    }
    /**
     * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray2(uniformName, array) {
        this.setArray(uniformName, array);
    }
    /**
     * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray3(uniformName, array) {
        this.setArray(uniformName, array);
    }
    /**
     * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
     * @param uniformName Name of the variable.
     * @param array array to be set.
     */
    setArray4(uniformName, array) {
        this.setArray(uniformName, array);
    }
    /**
     * Sets matrices on a uniform variable.
     * @param uniformName Name of the variable.
     * @param matrices matrices to be set.
     */
    setMatrices(uniformName, matrices) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateMatrices(uniformName, matrices);
    }
    /**
     * Sets matrix on a uniform variable.
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     */
    setMatrix(uniformName, matrix) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateMatrix(uniformName, matrix);
    }
    /**
     * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     */
    setMatrix3x3(uniformName, matrix) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateMatrix3x3(uniformName, matrix);
    }
    /**
     * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
     * @param uniformName Name of the variable.
     * @param matrix matrix to be set.
     */
    setMatrix2x2(uniformName, matrix) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateMatrix2x2(uniformName, matrix);
    }
    /**
     * Sets a float on a uniform variable.
     * @param uniformName Name of the variable.
     * @param value value to be set.
     */
    setFloat(uniformName, value) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateFloat(uniformName, value);
    }
    /**
     * Sets a Vector2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector2 vector2 to be set.
     */
    setVector2(uniformName, vector2) {
        this.setFloat2(uniformName, vector2.x, vector2.y);
    }
    /**
     * Sets a float2 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float2.
     * @param y Second float in float2.
     */
    setFloat2(uniformName, x, y) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateFloat2(uniformName, x, y);
    }
    /**
     * Sets a Vector3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector3 Value to be set.
     */
    setVector3(uniformName, vector3) {
        this.setFloat3(uniformName, vector3.x, vector3.y, vector3.z);
    }
    /**
     * Sets a float3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float3.
     * @param y Second float in float3.
     * @param z Third float in float3.
     */
    setFloat3(uniformName, x, y, z) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateFloat3(uniformName, x, y, z);
    }
    /**
     * Sets a Vector4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param vector4 Value to be set.
     */
    setVector4(uniformName, vector4) {
        this.setFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w);
    }
    /**
     * Sets a Quaternion on a uniform variable.
     * @param uniformName Name of the variable.
     * @param quaternion Value to be set.
     */
    setQuaternion(uniformName, quaternion) {
        this.setFloat4(uniformName, quaternion.x, quaternion.y, quaternion.z, quaternion.w);
    }
    /**
     * Sets a float4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param x First float in float4.
     * @param y Second float in float4.
     * @param z Third float in float4.
     * @param w Fourth float in float4.
     */
    setFloat4(uniformName, x, y, z, w) {
        if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {
            return;
        }
        this.uniformBuffer.updateFloat4(uniformName, x, y, z, w);
    }
    /**
     * Sets a Color3 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param color3 Value to be set.
     */
    setColor3(uniformName, color3) {
        this.setFloat3(uniformName, color3.r, color3.g, color3.b);
    }
    /**
     * Sets a Color4 on a uniform variable.
     * @param uniformName Name of the variable.
     * @param color3 Value to be set.
     * @param alpha Alpha value to be set.
     */
    setColor4(uniformName, color3, alpha) {
        this.setFloat4(uniformName, color3.r, color3.g, color3.b, alpha);
    }
    /**
     * Sets a Color4 on a uniform variable
     * @param uniformName defines the name of the variable
     * @param color4 defines the value to be set
     */
    setDirectColor4(uniformName, color4) {
        this.setFloat4(uniformName, color4.r, color4.g, color4.b, color4.a);
    }
    _getVertexShaderCode() {
        return this.sources?.vertex;
    }
    _getFragmentShaderCode() {
        return this.sources?.fragment;
    }
}
//# sourceMappingURL=webgpuPipelineContext.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessingContext.js
const _maxGroups = 4;
const _maxBindingsPerGroup = 1 << 16;
// all types not listed are assumed to consume 1 location
const _typeToLocationSize = {
    // GLSL types
    mat2: 2,
    mat3: 3,
    mat4: 4,
    // WGSL types
    mat2x2: 2,
    mat3x3: 3,
    mat4x4: 4,
};
/**
 * @internal
 */
class WebGPUShaderProcessingContext {
    static get KnownUBOs() {
        return WebGPUShaderProcessingContext._SimplifiedKnownBindings ? WebGPUShaderProcessingContext._SimplifiedKnownUBOs : WebGPUShaderProcessingContext._KnownUBOs;
    }
    constructor(shaderLanguage, pureMode = false) {
        this.vertexBufferKindToNumberOfComponents = {};
        this.shaderLanguage = shaderLanguage;
        this._attributeNextLocation = 0;
        this._varyingNextLocation = 0;
        this.freeGroupIndex = 0;
        this.freeBindingIndex = 0;
        this.availableVaryings = {};
        this.availableAttributes = {};
        this.availableBuffers = {};
        this.availableTextures = {};
        this.availableSamplers = {};
        this.orderedAttributes = [];
        this.bindGroupLayoutEntries = [];
        this.bindGroupLayoutEntryInfo = [];
        this.bindGroupEntries = [];
        this.bufferNames = [];
        this.textureNames = [];
        this.samplerNames = [];
        this.leftOverUniforms = [];
        if (!pureMode) {
            this._findStartingGroupBinding();
        }
    }
    _findStartingGroupBinding() {
        const knownUBOs = WebGPUShaderProcessingContext.KnownUBOs;
        const groups = [];
        for (const name in knownUBOs) {
            const binding = knownUBOs[name].binding;
            if (binding.groupIndex === -1) {
                continue;
            }
            if (groups[binding.groupIndex] === undefined) {
                groups[binding.groupIndex] = binding.bindingIndex;
            }
            else {
                groups[binding.groupIndex] = Math.max(groups[binding.groupIndex], binding.bindingIndex);
            }
        }
        this.freeGroupIndex = groups.length - 1;
        if (this.freeGroupIndex === 0) {
            this.freeGroupIndex++;
            this.freeBindingIndex = 0;
        }
        else {
            this.freeBindingIndex = groups[groups.length - 1] + 1;
        }
    }
    getAttributeNextLocation(dataType, arrayLength = 0) {
        const index = this._attributeNextLocation;
        this._attributeNextLocation += (_typeToLocationSize[dataType] ?? 1) * (arrayLength || 1);
        return index;
    }
    getVaryingNextLocation(dataType, arrayLength = 0) {
        const index = this._varyingNextLocation;
        this._varyingNextLocation += (_typeToLocationSize[dataType] ?? 1) * (arrayLength || 1);
        return index;
    }
    getNextFreeUBOBinding() {
        return this._getNextFreeBinding(1);
    }
    _getNextFreeBinding(bindingCount) {
        if (this.freeBindingIndex > _maxBindingsPerGroup - bindingCount) {
            this.freeGroupIndex++;
            this.freeBindingIndex = 0;
        }
        if (this.freeGroupIndex === _maxGroups) {
            // eslint-disable-next-line no-throw-literal
            throw "Too many textures or UBOs have been declared and it is not supported in WebGPU.";
        }
        const returnValue = {
            groupIndex: this.freeGroupIndex,
            bindingIndex: this.freeBindingIndex,
        };
        this.freeBindingIndex += bindingCount;
        return returnValue;
    }
}
/** @internal */
WebGPUShaderProcessingContext._SimplifiedKnownBindings = true; // if true, use only group=0,binding=0 as a known group/binding for the Scene ubo and use group=1,binding=X for all other bindings
// if false, see _KnownUBOs for the known groups/bindings used
WebGPUShaderProcessingContext._SimplifiedKnownUBOs = {
    Scene: { binding: { groupIndex: 0, bindingIndex: 0 } },
    Light0: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light1: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light2: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light3: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light4: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light5: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light6: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light7: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light8: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light9: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light10: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light11: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light12: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light13: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light14: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light15: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light16: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light17: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light18: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light19: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light20: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light21: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light22: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light23: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light24: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light25: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light26: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light27: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light28: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light29: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light30: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Light31: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Material: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Mesh: { binding: { groupIndex: -1, bindingIndex: -1 } },
    Internals: { binding: { groupIndex: -1, bindingIndex: -1 } },
};
WebGPUShaderProcessingContext._KnownUBOs = {
    Scene: { binding: { groupIndex: 0, bindingIndex: 0 } },
    Light0: { binding: { groupIndex: 1, bindingIndex: 0 } },
    Light1: { binding: { groupIndex: 1, bindingIndex: 1 } },
    Light2: { binding: { groupIndex: 1, bindingIndex: 2 } },
    Light3: { binding: { groupIndex: 1, bindingIndex: 3 } },
    Light4: { binding: { groupIndex: 1, bindingIndex: 4 } },
    Light5: { binding: { groupIndex: 1, bindingIndex: 5 } },
    Light6: { binding: { groupIndex: 1, bindingIndex: 6 } },
    Light7: { binding: { groupIndex: 1, bindingIndex: 7 } },
    Light8: { binding: { groupIndex: 1, bindingIndex: 8 } },
    Light9: { binding: { groupIndex: 1, bindingIndex: 9 } },
    Light10: { binding: { groupIndex: 1, bindingIndex: 10 } },
    Light11: { binding: { groupIndex: 1, bindingIndex: 11 } },
    Light12: { binding: { groupIndex: 1, bindingIndex: 12 } },
    Light13: { binding: { groupIndex: 1, bindingIndex: 13 } },
    Light14: { binding: { groupIndex: 1, bindingIndex: 14 } },
    Light15: { binding: { groupIndex: 1, bindingIndex: 15 } },
    Light16: { binding: { groupIndex: 1, bindingIndex: 16 } },
    Light17: { binding: { groupIndex: 1, bindingIndex: 17 } },
    Light18: { binding: { groupIndex: 1, bindingIndex: 18 } },
    Light19: { binding: { groupIndex: 1, bindingIndex: 19 } },
    Light20: { binding: { groupIndex: 1, bindingIndex: 20 } },
    Light21: { binding: { groupIndex: 1, bindingIndex: 21 } },
    Light22: { binding: { groupIndex: 1, bindingIndex: 22 } },
    Light23: { binding: { groupIndex: 1, bindingIndex: 23 } },
    Light24: { binding: { groupIndex: 1, bindingIndex: 24 } },
    Light25: { binding: { groupIndex: 1, bindingIndex: 25 } },
    Light26: { binding: { groupIndex: 1, bindingIndex: 26 } },
    Light27: { binding: { groupIndex: 1, bindingIndex: 27 } },
    Light28: { binding: { groupIndex: 1, bindingIndex: 28 } },
    Light29: { binding: { groupIndex: 1, bindingIndex: 29 } },
    Light30: { binding: { groupIndex: 1, bindingIndex: 30 } },
    Light31: { binding: { groupIndex: 1, bindingIndex: 31 } },
    Material: { binding: { groupIndex: 2, bindingIndex: 0 } },
    Mesh: { binding: { groupIndex: 2, bindingIndex: 1 } },
    Internals: { binding: { groupIndex: 2, bindingIndex: 2 } },
};
//# sourceMappingURL=webgpuShaderProcessingContext.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessorsGLSL.js





/** @internal */
class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor {
    constructor() {
        super(...arguments);
        this._missingVaryings = [];
        this._textureArrayProcessing = [];
        this._vertexIsGLES3 = false;
        this._fragmentIsGLES3 = false;
        this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this.parseGLES3 = true;
    }
    _getArraySize(name, type, preProcessors) {
        let length = 0;
        const startArray = name.indexOf("[");
        const endArray = name.indexOf("]");
        if (startArray > 0 && endArray > 0) {
            const lengthInString = name.substring(startArray + 1, endArray);
            length = +lengthInString;
            if (isNaN(length)) {
                length = +preProcessors[lengthInString.trim()];
            }
            name = name.substring(0, startArray);
        }
        return [name, type, length];
    }
    initializeShaders(processingContext) {
        this._webgpuProcessingContext = processingContext;
        this._missingVaryings.length = 0;
        this._textureArrayProcessing.length = 0;
        this.attributeKeywordName = undefined;
        this.varyingVertexKeywordName = undefined;
        this.varyingFragmentKeywordName = undefined;
    }
    preProcessShaderCode(code, isFragment) {
        const ubDeclaration = `// Internals UBO\nuniform ${WebGPUShaderProcessor.InternalsUBOName} {\nfloat yFactor_;\nfloat textureOutputHeight_;\n};\n`;
        const alreadyInjected = code.indexOf("// Internals UBO") !== -1;
        if (isFragment) {
            this._fragmentIsGLES3 = code.indexOf("#version 3") !== -1;
            if (this._fragmentIsGLES3) {
                this.varyingFragmentKeywordName = "in";
            }
            return alreadyInjected ? code : ubDeclaration + "##INJECTCODE##\n" + code;
        }
        this._vertexIsGLES3 = code.indexOf("#version 3") !== -1;
        if (this._vertexIsGLES3) {
            this.attributeKeywordName = "in";
            this.varyingVertexKeywordName = "out";
        }
        return alreadyInjected ? code : ubDeclaration + code;
    }
    varyingCheck(varying, isFragment) {
        const outRegex = /(flat\s)?\s*\bout\b/;
        const inRegex = /(flat\s)?\s*\bin\b/;
        const varyingRegex = /(flat\s)?\s*\bvarying\b/;
        const regex = isFragment && this._fragmentIsGLES3 ? inRegex : !isFragment && this._vertexIsGLES3 ? outRegex : varyingRegex;
        return regex.test(varying);
    }
    varyingProcessor(varying, isFragment, preProcessors) {
        this._preProcessors = preProcessors;
        const outRegex = /\s*(flat)?\s*out\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm;
        const inRegex = /\s*(flat)?\s*in\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm;
        const varyingRegex = /\s*(flat)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm;
        const regex = isFragment && this._fragmentIsGLES3 ? inRegex : !isFragment && this._vertexIsGLES3 ? outRegex : varyingRegex;
        const match = regex.exec(varying);
        if (match !== null) {
            const interpolationQualifier = match[1] ?? "";
            const varyingType = match[2];
            const name = match[3];
            let location;
            if (isFragment) {
                location = this._webgpuProcessingContext.availableVaryings[name];
                this._missingVaryings[location] = "";
                if (location === undefined) {
                    logger/* Logger */.V.Warn(`Invalid fragment shader: The varying named "${name}" is not declared in the vertex shader! This declaration will be ignored.`);
                }
            }
            else {
                location = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name, varyingType, preProcessors)[2]);
                this._webgpuProcessingContext.availableVaryings[name] = location;
                this._missingVaryings[location] = `layout(location = ${location}) ${interpolationQualifier} in ${varyingType} ${name};`;
            }
            varying = varying.replace(match[0], location === undefined ? "" : `layout(location = ${location}) ${interpolationQualifier} ${isFragment ? "in" : "out"} ${varyingType} ${name};`);
        }
        return varying;
    }
    attributeProcessor(attribute, preProcessors) {
        this._preProcessors = preProcessors;
        const inRegex = /\s*in\s+(\S+)\s+(\S+)\s*;/gm;
        const attribRegex = /\s*attribute\s+(\S+)\s+(\S+)\s*;/gm;
        const regex = this._vertexIsGLES3 ? inRegex : attribRegex;
        const match = regex.exec(attribute);
        if (match !== null) {
            const attributeType = match[1];
            const name = match[2];
            const location = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name, attributeType, preProcessors)[2]);
            this._webgpuProcessingContext.availableAttributes[name] = location;
            this._webgpuProcessingContext.orderedAttributes[location] = name;
            const numComponents = this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[name];
            if (numComponents !== undefined) {
                // Special case for an int/ivecX vertex buffer that is used as a float/vecX attribute in the shader.
                const newType = numComponents < 0 ? (numComponents === -1 ? "int" : "ivec" + -numComponents) : numComponents === 1 ? "uint" : "uvec" + numComponents;
                const newName = `_int_${name}_`;
                attribute = attribute.replace(match[0], `layout(location = ${location}) in ${newType} ${newName}; ${attributeType} ${name} = ${attributeType}(${newName});`);
            }
            else {
                attribute = attribute.replace(match[0], `layout(location = ${location}) in ${attributeType} ${name};`);
            }
        }
        return attribute;
    }
    uniformProcessor(uniform, isFragment, preProcessors) {
        this._preProcessors = preProcessors;
        const uniformRegex = /\s*uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm;
        const match = uniformRegex.exec(uniform);
        if (match !== null) {
            let uniformType = match[1];
            let name = match[2];
            if (uniformType.indexOf("sampler") === 0 || uniformType.indexOf("sampler") === 1) {
                let arraySize = 0; // 0 means the texture is not declared as an array
                [name, uniformType, arraySize] = this._getArraySize(name, uniformType, preProcessors);
                let textureInfo = this._webgpuProcessingContext.availableTextures[name];
                if (!textureInfo) {
                    textureInfo = {
                        autoBindSampler: true,
                        isTextureArray: arraySize > 0,
                        isStorageTexture: false,
                        textures: [],
                        sampleType: "float" /* WebGPUConstants.TextureSampleType.Float */,
                    };
                    for (let i = 0; i < (arraySize || 1); ++i) {
                        textureInfo.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding());
                    }
                }
                const samplerType = WebGPUShaderProcessor._SamplerTypeByWebGLSamplerType[uniformType] ?? "sampler";
                const isComparisonSampler = !!WebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType[samplerType];
                const samplerBindingType = isComparisonSampler ? "comparison" /* WebGPUConstants.SamplerBindingType.Comparison */ : "filtering" /* WebGPUConstants.SamplerBindingType.Filtering */;
                const samplerName = name + `Sampler`;
                let samplerInfo = this._webgpuProcessingContext.availableSamplers[samplerName];
                if (!samplerInfo) {
                    samplerInfo = {
                        binding: this._webgpuProcessingContext.getNextFreeUBOBinding(),
                        type: samplerBindingType,
                    };
                }
                const componentType = uniformType.charAt(0) === "u" ? "u" : uniformType.charAt(0) === "i" ? "i" : "";
                if (componentType) {
                    uniformType = uniformType.substring(1);
                }
                const sampleType = isComparisonSampler
                    ? "depth" /* WebGPUConstants.TextureSampleType.Depth */
                    : componentType === "u"
                        ? "uint" /* WebGPUConstants.TextureSampleType.Uint */
                        : componentType === "i"
                            ? "sint" /* WebGPUConstants.TextureSampleType.Sint */
                            : "float" /* WebGPUConstants.TextureSampleType.Float */;
                textureInfo.sampleType = sampleType;
                const isTextureArray = arraySize > 0;
                const samplerGroupIndex = samplerInfo.binding.groupIndex;
                const samplerBindingIndex = samplerInfo.binding.bindingIndex;
                const samplerFunction = WebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType[uniformType];
                const textureType = WebGPUShaderProcessor._TextureTypeByWebGLSamplerType[uniformType];
                const textureDimension = WebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType[textureType];
                // Manage textures and samplers.
                if (!isTextureArray) {
                    arraySize = 1;
                    uniform = `layout(set = ${samplerGroupIndex}, binding = ${samplerBindingIndex}) uniform ${samplerType} ${samplerName};
                        layout(set = ${textureInfo.textures[0].groupIndex}, binding = ${textureInfo.textures[0].bindingIndex}) uniform ${componentType}${textureType} ${name}Texture;
                        #define ${name} ${componentType}${samplerFunction}(${name}Texture, ${samplerName})`;
                }
                else {
                    const layouts = [];
                    layouts.push(`layout(set = ${samplerGroupIndex}, binding = ${samplerBindingIndex}) uniform ${componentType}${samplerType} ${samplerName};`);
                    uniform = `\n`;
                    for (let i = 0; i < arraySize; ++i) {
                        const textureSetIndex = textureInfo.textures[i].groupIndex;
                        const textureBindingIndex = textureInfo.textures[i].bindingIndex;
                        layouts.push(`layout(set = ${textureSetIndex}, binding = ${textureBindingIndex}) uniform ${textureType} ${name}Texture${i};`);
                        uniform += `${i > 0 ? "\n" : ""}#define ${name}${i} ${componentType}${samplerFunction}(${name}Texture${i}, ${samplerName})`;
                    }
                    uniform = layouts.join("\n") + uniform;
                    this._textureArrayProcessing.push(name);
                }
                this._webgpuProcessingContext.availableTextures[name] = textureInfo;
                this._webgpuProcessingContext.availableSamplers[samplerName] = samplerInfo;
                this._addSamplerBindingDescription(samplerName, samplerInfo, !isFragment);
                for (let i = 0; i < arraySize; ++i) {
                    this._addTextureBindingDescription(name, textureInfo, i, textureDimension, null, !isFragment);
                }
            }
            else {
                this._addUniformToLeftOverUBO(name, uniformType, preProcessors);
                uniform = "";
            }
        }
        return uniform;
    }
    uniformBufferProcessor(uniformBuffer, isFragment) {
        const uboRegex = /uniform\s+(\w+)/gm;
        const match = uboRegex.exec(uniformBuffer);
        if (match !== null) {
            const name = match[1];
            let uniformBufferInfo = this._webgpuProcessingContext.availableBuffers[name];
            if (!uniformBufferInfo) {
                const knownUBO = WebGPUShaderProcessingContext.KnownUBOs[name];
                let binding;
                if (knownUBO && knownUBO.binding.groupIndex !== -1) {
                    binding = knownUBO.binding;
                }
                else {
                    binding = this._webgpuProcessingContext.getNextFreeUBOBinding();
                }
                uniformBufferInfo = { binding };
                this._webgpuProcessingContext.availableBuffers[name] = uniformBufferInfo;
            }
            this._addBufferBindingDescription(name, uniformBufferInfo, "uniform" /* WebGPUConstants.BufferBindingType.Uniform */, !isFragment);
            uniformBuffer = uniformBuffer.replace("uniform", `layout(set = ${uniformBufferInfo.binding.groupIndex}, binding = ${uniformBufferInfo.binding.bindingIndex}) uniform`);
        }
        return uniformBuffer;
    }
    postProcessor(code, defines, isFragment, _processingContext, _parameters) {
        const hasDrawBuffersExtension = code.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1;
        // Remove extensions
        const regex = /#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;
        code = code.replace(regex, "");
        // Replace instructions
        code = code.replace(/texture2D\s*\(/g, "texture(");
        if (isFragment) {
            const hasFragCoord = code.indexOf("gl_FragCoord") >= 0;
            const fragCoordCode = `
                glFragCoord_ = gl_FragCoord;
                if (yFactor_ == 1.) {
                    glFragCoord_.y = textureOutputHeight_ - glFragCoord_.y;
                }
            `;
            const injectCode = hasFragCoord ? "vec4 glFragCoord_;\n" : "";
            const hasOutput = code.search(/layout *\(location *= *0\) *out/g) !== -1;
            code = code.replace(/texture2DLodEXT\s*\(/g, "textureLod(");
            code = code.replace(/textureCubeLodEXT\s*\(/g, "textureLod(");
            code = code.replace(/textureCube\s*\(/g, "texture(");
            code = code.replace(/gl_FragDepthEXT/g, "gl_FragDepth");
            code = code.replace(/gl_FragColor/g, "glFragColor");
            code = code.replace(/gl_FragData/g, "glFragData");
            code = code.replace(/gl_FragCoord/g, "glFragCoord_");
            if (!this._fragmentIsGLES3) {
                code = code.replace(/void\s+?main\s*\(/g, (hasDrawBuffersExtension || hasOutput ? "" : "layout(location = 0) out vec4 glFragColor;\n") + "void main(");
            }
            else {
                const match = /^\s*out\s+\S+\s+\S+\s*;/gm.exec(code);
                if (match !== null) {
                    code = code.substring(0, match.index) + "layout(location = 0) " + code.substring(match.index);
                }
            }
            code = code.replace(/dFdy/g, "(-yFactor_)*dFdy"); // will also handle dFdyCoarse and dFdyFine
            code = code.replace("##INJECTCODE##", injectCode);
            if (hasFragCoord) {
                code = (0,codeStringParsingTools/* InjectStartingAndEndingCode */.bI)(code, "void main", fragCoordCode);
            }
        }
        else {
            code = code.replace(/gl_InstanceID/g, "gl_InstanceIndex");
            code = code.replace(/gl_VertexID/g, "gl_VertexIndex");
            const hasMultiviewExtension = defines.indexOf("#define MULTIVIEW") !== -1;
            if (hasMultiviewExtension) {
                return "#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n" + code;
            }
        }
        // Flip Y + convert z range from [-1,1] to [0,1]
        if (!isFragment) {
            const lastClosingCurly = code.lastIndexOf("}");
            code = code.substring(0, lastClosingCurly);
            code += "gl_Position.y *= yFactor_;\n";
            // isNDCHalfZRange is always true in WebGPU
            code += "}";
        }
        return code;
    }
    _applyTextureArrayProcessing(code, name) {
        // Replaces the occurrences of name[XX] by nameXX
        const regex = new RegExp(name + "\\s*\\[(.+)?\\]", "gm");
        let match = regex.exec(code);
        while (match !== null) {
            const index = match[1];
            let iindex = +index;
            if (this._preProcessors && isNaN(iindex)) {
                iindex = +this._preProcessors[index.trim()];
            }
            code = code.replace(match[0], name + iindex);
            match = regex.exec(code);
        }
        return code;
    }
    _generateLeftOverUBOCode(name, uniformBufferDescription) {
        let ubo = `layout(set = ${uniformBufferDescription.binding.groupIndex}, binding = ${uniformBufferDescription.binding.bindingIndex}) uniform ${name} {\n    `;
        for (const leftOverUniform of this._webgpuProcessingContext.leftOverUniforms) {
            if (leftOverUniform.length > 0) {
                ubo += `    ${leftOverUniform.type} ${leftOverUniform.name}[${leftOverUniform.length}];\n`;
            }
            else {
                ubo += `    ${leftOverUniform.type} ${leftOverUniform.name};\n`;
            }
        }
        ubo += "};\n\n";
        return ubo;
    }
    finalizeShaders(vertexCode, fragmentCode) {
        // make replacements for texture names in the texture array case
        for (let i = 0; i < this._textureArrayProcessing.length; ++i) {
            const name = this._textureArrayProcessing[i];
            vertexCode = this._applyTextureArrayProcessing(vertexCode, name);
            fragmentCode = this._applyTextureArrayProcessing(fragmentCode, name);
        }
        // inject the missing varying in the fragment shader
        for (let i = 0; i < this._missingVaryings.length; ++i) {
            const decl = this._missingVaryings[i];
            if (decl && decl.length > 0) {
                fragmentCode = decl + "\n" + fragmentCode;
            }
        }
        // Builds the leftover UBOs.
        const leftOverUBO = this._buildLeftOverUBO();
        vertexCode = leftOverUBO + vertexCode;
        fragmentCode = leftOverUBO + fragmentCode;
        this._collectBindingNames();
        this._preCreateBindGroupEntries();
        this._preProcessors = null;
        this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents = {};
        return { vertexCode, fragmentCode };
    }
}
//# sourceMappingURL=webgpuShaderProcessorsGLSL.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js
var bakedVertexAnimationDeclaration = __webpack_require__(98900);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js
var bakedVertexAnimation = __webpack_require__(40242);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js
var instancesDeclaration = __webpack_require__(44559);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js
var instancesVertex = __webpack_require__(91277);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js
var helperFunctions = __webpack_require__(79702);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fresnelFunction.js
var fresnelFunction = __webpack_require__(30976);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/meshUboDeclaration.js
var meshUboDeclaration = __webpack_require__(6874);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js
var sceneUboDeclaration = __webpack_require__(98327);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/decalFragment.js
var decalFragment = __webpack_require__(49306);
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessorsWGSL.js














const builtInName_frag_depth = "fragmentOutputs.fragDepth";
const leftOverVarName = "uniforms";
const internalsVarName = "internals";
const gpuTextureViewDimensionByWebGPUTextureFunction = {
    texture_1d: "1d" /* WebGPUConstants.TextureViewDimension.E1d */,
    texture_2d: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
    texture_2d_array: "2d-array" /* WebGPUConstants.TextureViewDimension.E2dArray */,
    texture_3d: "3d" /* WebGPUConstants.TextureViewDimension.E3d */,
    texture_cube: "cube" /* WebGPUConstants.TextureViewDimension.Cube */,
    texture_cube_array: "cube-array" /* WebGPUConstants.TextureViewDimension.CubeArray */,
    texture_multisampled_2d: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
    texture_depth_2d: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
    texture_depth_2d_array: "2d-array" /* WebGPUConstants.TextureViewDimension.E2dArray */,
    texture_depth_cube: "cube" /* WebGPUConstants.TextureViewDimension.Cube */,
    texture_depth_cube_array: "cube-array" /* WebGPUConstants.TextureViewDimension.CubeArray */,
    texture_depth_multisampled_2d: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
    texture_storage_1d: "1d" /* WebGPUConstants.TextureViewDimension.E1d */,
    texture_storage_2d: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
    texture_storage_2d_array: "2d-array" /* WebGPUConstants.TextureViewDimension.E2dArray */,
    texture_storage_3d: "3d" /* WebGPUConstants.TextureViewDimension.E3d */,
    texture_external: null,
};
/** @internal */
class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor {
    constructor() {
        super(...arguments);
        this.shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        this.uniformRegexp = /uniform\s+(\w+)\s*:\s*(.+)\s*;/;
        this.textureRegexp = /var\s+(\w+)\s*:\s*((array<\s*)?(texture_\w+)\s*(<\s*(.+)\s*>)?\s*(,\s*\w+\s*>\s*)?);/;
        this.noPrecision = true;
        this.pureMode = false;
    }
    preProcessor(code, defines, preProcessors, isFragment, processingContext) {
        // Convert defines into const
        for (const key in preProcessors) {
            if (key === "__VERSION__") {
                continue;
            }
            const value = preProcessors[key];
            if (!isNaN(parseInt(value)) || !isNaN(parseFloat(value))) {
                code = `const ${key} = ${value};\n` + code;
            }
        }
        return code;
    }
    _getArraySize(name, uniformType, preProcessors) {
        let length = 0;
        const endArray = uniformType.lastIndexOf(">");
        if (uniformType.indexOf("array") >= 0 && endArray > 0) {
            let startArray = endArray;
            while (startArray > 0 && uniformType.charAt(startArray) !== " " && uniformType.charAt(startArray) !== ",") {
                startArray--;
            }
            const lengthInString = uniformType.substring(startArray + 1, endArray);
            length = +lengthInString;
            if (isNaN(length)) {
                length = +preProcessors[lengthInString.trim()];
            }
            while (startArray > 0 && (uniformType.charAt(startArray) === " " || uniformType.charAt(startArray) === ",")) {
                startArray--;
            }
            uniformType = uniformType.substring(uniformType.indexOf("<") + 1, startArray + 1);
        }
        return [name, uniformType, length];
    }
    initializeShaders(processingContext) {
        this._webgpuProcessingContext = processingContext;
        this._attributesInputWGSL = [];
        this._attributesWGSL = [];
        this._attributesConversionCodeWGSL = [];
        this._hasNonFloatAttribute = false;
        this._varyingsWGSL = [];
        this._varyingNamesWGSL = [];
        this._stridedUniformArrays = [];
    }
    preProcessShaderCode(code) {
        // Same check as in webgpuShaderProcessorsGLSL to avoid same ubDelcaration to be injected twice.
        const ubDeclaration = this.pureMode
            ? ""
            : `struct ${WebGPUShaderProcessor.InternalsUBOName} {\n  yFactor_: f32,\n  textureOutputHeight_: f32,\n};\nvar<uniform> ${internalsVarName} : ${WebGPUShaderProcessor.InternalsUBOName};\n`;
        const alreadyInjected = code.indexOf(ubDeclaration) !== -1;
        return alreadyInjected ? code : ubDeclaration + (0,codeStringParsingTools/* RemoveComments */.RJ)(code);
    }
    varyingCheck(varying) {
        const regex = /(flat|linear|perspective)?\s*(center|centroid|sample)?\s*\bvarying\b/;
        return regex.test(varying);
    }
    varyingProcessor(varying, isFragment, preProcessors) {
        const varyingRegex = /\s*(flat|linear|perspective)?\s*(center|centroid|sample)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s*:\s*(.+)\s*;/gm;
        const match = varyingRegex.exec(varying);
        if (match !== null) {
            const interpolationType = match[1] ?? "perspective";
            const interpolationSampling = match[2] ?? "center";
            const varyingType = match[4];
            const name = match[3];
            const interpolation = interpolationType === "flat" ? `@interpolate(${interpolationType})` : `@interpolate(${interpolationType}, ${interpolationSampling})`;
            let location;
            if (isFragment) {
                location = this._webgpuProcessingContext.availableVaryings[name];
                if (location === undefined) {
                    logger/* Logger */.V.Warn(`Invalid fragment shader: The varying named "${name}" is not declared in the vertex shader! This declaration will be ignored.`);
                }
            }
            else {
                location = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name, varyingType, preProcessors)[2]);
                this._webgpuProcessingContext.availableVaryings[name] = location;
                this._varyingsWGSL.push(`  @location(${location}) ${interpolation} ${name} : ${varyingType},`);
                this._varyingNamesWGSL.push(name);
            }
            varying = "";
        }
        return varying;
    }
    attributeProcessor(attribute, preProcessors) {
        const attribRegex = /\s*attribute\s+(\S+)\s*:\s*(.+)\s*;/gm;
        const match = attribRegex.exec(attribute);
        if (match !== null) {
            const attributeType = match[2];
            const name = match[1];
            const location = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name, attributeType, preProcessors)[2]);
            this._webgpuProcessingContext.availableAttributes[name] = location;
            this._webgpuProcessingContext.orderedAttributes[location] = name;
            const numComponents = this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[name];
            if (numComponents !== undefined) {
                // Special case for an int/ivecX vertex buffer that is used as a float/vecX attribute in the shader.
                const newType = numComponents < 0 ? (numComponents === -1 ? "i32" : "vec" + -numComponents + "<i32>") : numComponents === 1 ? "u32" : "vec" + numComponents + "<u32>";
                const newName = `_int_${name}_`;
                this._attributesInputWGSL.push(`@location(${location}) ${newName} : ${newType},`);
                this._attributesWGSL.push(`${name} : ${attributeType},`);
                this._attributesConversionCodeWGSL.push(`vertexInputs.${name} = ${attributeType}(vertexInputs_.${newName});`);
                this._hasNonFloatAttribute = true;
            }
            else {
                this._attributesInputWGSL.push(`@location(${location}) ${name} : ${attributeType},`);
                this._attributesWGSL.push(`${name} : ${attributeType},`);
                this._attributesConversionCodeWGSL.push(`vertexInputs.${name} = vertexInputs_.${name};`);
            }
            attribute = "";
        }
        return attribute;
    }
    uniformProcessor(uniform, isFragment, preProcessors) {
        const match = this.uniformRegexp.exec(uniform);
        if (match !== null) {
            const uniformType = match[2];
            const name = match[1];
            this._addUniformToLeftOverUBO(name, uniformType, preProcessors);
            uniform = "";
        }
        return uniform;
    }
    textureProcessor(texture, isFragment, preProcessors) {
        const match = this.textureRegexp.exec(texture);
        if (match !== null) {
            const name = match[1]; // name of the variable
            const type = match[2]; // texture_2d<f32> or array<texture_2d_array<f32>, 5> for eg
            const isArrayOfTexture = !!match[3];
            const textureFunc = match[4]; // texture_2d, texture_depth_2d, etc
            const isStorageTexture = textureFunc.indexOf("storage") > 0;
            const componentType = match[6]; // f32 or i32 or u32 or undefined
            const storageTextureFormat = isStorageTexture ? componentType.substring(0, componentType.indexOf(",")).trim() : null;
            let arraySize = isArrayOfTexture ? this._getArraySize(name, type, preProcessors)[2] : 0;
            let textureInfo = this._webgpuProcessingContext.availableTextures[name];
            if (!textureInfo) {
                textureInfo = {
                    isTextureArray: arraySize > 0,
                    isStorageTexture,
                    textures: [],
                    sampleType: "float" /* WebGPUConstants.TextureSampleType.Float */,
                };
                arraySize = arraySize || 1;
                for (let i = 0; i < arraySize; ++i) {
                    textureInfo.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding());
                }
            }
            else {
                arraySize = textureInfo.textures.length;
            }
            this._webgpuProcessingContext.availableTextures[name] = textureInfo;
            const isDepthTexture = textureFunc.indexOf("depth") > 0;
            const textureDimension = gpuTextureViewDimensionByWebGPUTextureFunction[textureFunc];
            const sampleType = isDepthTexture
                ? "depth" /* WebGPUConstants.TextureSampleType.Depth */
                : componentType === "u32"
                    ? "uint" /* WebGPUConstants.TextureSampleType.Uint */
                    : componentType === "i32"
                        ? "sint" /* WebGPUConstants.TextureSampleType.Sint */
                        : "float" /* WebGPUConstants.TextureSampleType.Float */;
            textureInfo.sampleType = sampleType;
            if (textureDimension === undefined) {
                // eslint-disable-next-line no-throw-literal
                throw `Can't get the texture dimension corresponding to the texture function "${textureFunc}"!`;
            }
            for (let i = 0; i < arraySize; ++i) {
                const { groupIndex, bindingIndex } = textureInfo.textures[i];
                if (i === 0) {
                    texture = `@group(${groupIndex}) @binding(${bindingIndex}) ${texture}`;
                }
                this._addTextureBindingDescription(name, textureInfo, i, textureDimension, storageTextureFormat, !isFragment);
            }
        }
        return texture;
    }
    // We need to process defines which are directly in the files themselves
    postProcessor(code) {
        const definePattern = /#define (.+?) (.+?)$/gm;
        let match;
        while ((match = definePattern.exec(code)) !== null) {
            code = code.replace(new RegExp(match[1], "g"), match[2]);
        }
        return code;
    }
    finalizeShaders(vertexCode, fragmentCode) {
        const fragCoordCode = fragmentCode.indexOf("fragmentInputs.position") >= 0 && !this.pureMode
            ? `
            if (internals.yFactor_ == 1.) {
                fragmentInputs.position.y = internals.textureOutputHeight_ - fragmentInputs.position.y;
            }
        `
            : "";
        // Add the group/binding info to the sampler declaration (var xxx: sampler|sampler_comparison)
        vertexCode = this._processSamplers(vertexCode, true);
        fragmentCode = this._processSamplers(fragmentCode, false);
        // Add the group/binding info to the uniform/storage buffer declarations (var<uniform> XXX:YYY or var<storage(,read_write|read)> XXX:YYY)
        vertexCode = this._processCustomBuffers(vertexCode, true);
        fragmentCode = this._processCustomBuffers(fragmentCode, false);
        // Builds the leftover UBOs.
        const leftOverUBO = this._buildLeftOverUBO();
        vertexCode = leftOverUBO + vertexCode;
        fragmentCode = leftOverUBO + fragmentCode;
        // Vertex code
        vertexCode = vertexCode.replace(/#define (\w+)\s+(\d+\.?\d*)/g, "const $1 = $2;");
        vertexCode = vertexCode.replace(/#define /g, "//#define ");
        vertexCode = this._processStridedUniformArrays(vertexCode);
        let vertexInputs = "struct VertexInputs {\n  @builtin(vertex_index) vertexIndex : u32,\n  @builtin(instance_index) instanceIndex : u32,\n";
        if (this._attributesInputWGSL.length > 0) {
            vertexInputs += this._attributesInputWGSL.join("\n");
        }
        vertexInputs += "\n};\nvar<private> vertexInputs" + (this._hasNonFloatAttribute ? "_" : "") + " : VertexInputs;\n";
        if (this._hasNonFloatAttribute) {
            vertexInputs += "struct VertexInputs_ {\n  vertexIndex : u32, instanceIndex : u32,\n";
            vertexInputs += this._attributesWGSL.join("\n");
            vertexInputs += "\n};\nvar<private> vertexInputs : VertexInputs_;\n";
        }
        let vertexOutputs = "struct FragmentInputs {\n  @builtin(position) position : vec4<f32>,\n";
        if (this._varyingsWGSL.length > 0) {
            vertexOutputs += this._varyingsWGSL.join("\n");
        }
        vertexOutputs += "\n};\nvar<private> vertexOutputs : FragmentInputs;\n";
        vertexCode = vertexInputs + vertexOutputs + vertexCode;
        let vertexMainStartingCode = `\n  vertexInputs${this._hasNonFloatAttribute ? "_" : ""} = input;\n`;
        if (this._hasNonFloatAttribute) {
            vertexMainStartingCode += "vertexInputs.vertexIndex = vertexInputs_.vertexIndex;\nvertexInputs.instanceIndex = vertexInputs_.instanceIndex;\n";
            vertexMainStartingCode += this._attributesConversionCodeWGSL.join("\n");
            vertexMainStartingCode += "\n";
        }
        const vertexMainEndingCode = this.pureMode
            ? `  return vertexOutputs;`
            : `  vertexOutputs.position.y = vertexOutputs.position.y * internals.yFactor_;\n  return vertexOutputs;`;
        let needDiagnosticOff = vertexCode.indexOf(`#define DISABLE_UNIFORMITY_ANALYSIS`) !== -1;
        vertexCode =
            (needDiagnosticOff ? "diagnostic(off, derivative_uniformity);\n" : "") +
                "diagnostic(off, chromium.unreachable_code);\n" +
                (0,codeStringParsingTools/* InjectStartingAndEndingCode */.bI)(vertexCode, "fn main", vertexMainStartingCode, vertexMainEndingCode);
        // fragment code
        fragmentCode = fragmentCode.replace(/#define (\w+)\s+(\d+\.?\d*)/g, "const $1 = $2;");
        fragmentCode = fragmentCode.replace(/#define /g, "//#define ");
        fragmentCode = this._processStridedUniformArrays(fragmentCode);
        if (!this.pureMode) {
            fragmentCode = fragmentCode.replace(/dpdy/g, "(-internals.yFactor_)*dpdy"); // will also handle dpdyCoarse and dpdyFine
        }
        let fragmentInputs = "struct FragmentInputs {\n  @builtin(position) position : vec4<f32>,\n  @builtin(front_facing) frontFacing : bool,\n";
        if (this._varyingsWGSL.length > 0) {
            fragmentInputs += this._varyingsWGSL.join("\n");
        }
        fragmentInputs += "\n};\nvar<private> fragmentInputs : FragmentInputs;\n";
        let fragmentOutputs = "struct FragmentOutputs {\n";
        // Adding fragData output locations
        const regexRoot = "fragmentOutputs\\.fragData";
        let match = fragmentCode.match(new RegExp(regexRoot + "0", "g"));
        let indexLocation = 0;
        if (match) {
            fragmentOutputs += ` @location(${indexLocation}) fragData0 : vec4<f32>,\n`;
            indexLocation++;
            for (let index = 1; index < 8; index++) {
                match = fragmentCode.match(new RegExp(regexRoot + index, "g"));
                if (match) {
                    fragmentOutputs += ` @location(${indexLocation}) fragData${indexLocation} : vec4<f32>,\n`;
                    indexLocation++;
                }
            }
            if (fragmentCode.indexOf("MRT_AND_COLOR") !== -1) {
                fragmentOutputs += `  @location(${indexLocation}) color : vec4<f32>,\n`;
                indexLocation++;
            }
        }
        // Adding fragData output locations
        const regex = /oitDepthSampler/;
        match = fragmentCode.match(regex);
        if (match) {
            fragmentOutputs += ` @location(${indexLocation++}) depth : vec2<f32>,\n`;
            fragmentOutputs += ` @location(${indexLocation++}) frontColor : vec4<f32>,\n`;
            fragmentOutputs += ` @location(${indexLocation++}) backColor : vec4<f32>,\n`;
        }
        if (indexLocation === 0) {
            fragmentOutputs += "  @location(0) color : vec4<f32>,\n";
            indexLocation++;
        }
        // FragDepth
        let hasFragDepth = false;
        let idx = 0;
        while (!hasFragDepth) {
            idx = fragmentCode.indexOf(builtInName_frag_depth, idx);
            if (idx < 0) {
                break;
            }
            const saveIndex = idx;
            hasFragDepth = true;
            while (idx > 1 && fragmentCode.charAt(idx) !== "\n") {
                if (fragmentCode.charAt(idx) === "/" && fragmentCode.charAt(idx - 1) === "/") {
                    hasFragDepth = false;
                    break;
                }
                idx--;
            }
            idx = saveIndex + builtInName_frag_depth.length;
        }
        if (hasFragDepth) {
            fragmentOutputs += "  @builtin(frag_depth) fragDepth: f32,\n";
        }
        fragmentOutputs += "};\nvar<private> fragmentOutputs : FragmentOutputs;\n";
        fragmentCode = fragmentInputs + fragmentOutputs + fragmentCode;
        const fragmentStartingCode = "  fragmentInputs = input;\n  " + fragCoordCode;
        const fragmentEndingCode = "  return fragmentOutputs;";
        needDiagnosticOff = fragmentCode.indexOf(`#define DISABLE_UNIFORMITY_ANALYSIS`) !== -1;
        fragmentCode =
            (needDiagnosticOff ? "diagnostic(off, derivative_uniformity);\n" : "") +
                "diagnostic(off, chromium.unreachable_code);\n" +
                (0,codeStringParsingTools/* InjectStartingAndEndingCode */.bI)(fragmentCode, "fn main", fragmentStartingCode, fragmentEndingCode);
        this._collectBindingNames();
        this._preCreateBindGroupEntries();
        this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents = {};
        return { vertexCode, fragmentCode };
    }
    _generateLeftOverUBOCode(name, uniformBufferDescription) {
        let stridedArrays = "";
        let ubo = `struct ${name} {\n`;
        for (const leftOverUniform of this._webgpuProcessingContext.leftOverUniforms) {
            const type = leftOverUniform.type.replace(/^(.*?)(<.*>)?$/, "$1");
            const size = WebGPUShaderProcessor.UniformSizes[type];
            if (leftOverUniform.length > 0) {
                if (size <= 2) {
                    const stridedArrayType = `${name}_${this._stridedUniformArrays.length}_strided_arr`;
                    stridedArrays += `struct ${stridedArrayType} {
                        @size(16)
                        el: ${type},
                    }`;
                    this._stridedUniformArrays.push(leftOverUniform.name);
                    ubo += ` @align(16) ${leftOverUniform.name} : array<${stridedArrayType}, ${leftOverUniform.length}>,\n`;
                }
                else {
                    ubo += ` ${leftOverUniform.name} : array<${leftOverUniform.type}, ${leftOverUniform.length}>,\n`;
                }
            }
            else {
                ubo += `  ${leftOverUniform.name} : ${leftOverUniform.type},\n`;
            }
        }
        ubo += "};\n";
        ubo = `${stridedArrays}\n${ubo}`;
        ubo += `@group(${uniformBufferDescription.binding.groupIndex}) @binding(${uniformBufferDescription.binding.bindingIndex}) var<uniform> ${leftOverVarName} : ${name};\n`;
        return ubo;
    }
    _processSamplers(code, isVertex) {
        const samplerRegexp = /var\s+(\w+Sampler)\s*:\s*(sampler|sampler_comparison)\s*;/gm;
        // eslint-disable-next-line no-constant-condition
        while (true) {
            const match = samplerRegexp.exec(code);
            if (match === null) {
                break;
            }
            const name = match[1]; // name of the variable
            const samplerType = match[2]; // sampler or sampler_comparison
            const suffixLessLength = name.length - `Sampler`.length;
            const textureName = name.lastIndexOf(`Sampler`) === suffixLessLength ? name.substring(0, suffixLessLength) : null;
            const samplerBindingType = samplerType === "sampler_comparison" ? "comparison" /* WebGPUConstants.SamplerBindingType.Comparison */ : "filtering" /* WebGPUConstants.SamplerBindingType.Filtering */;
            if (textureName) {
                const textureInfo = this._webgpuProcessingContext.availableTextures[textureName];
                if (textureInfo) {
                    textureInfo.autoBindSampler = true;
                }
            }
            let samplerInfo = this._webgpuProcessingContext.availableSamplers[name];
            if (!samplerInfo) {
                samplerInfo = {
                    binding: this._webgpuProcessingContext.getNextFreeUBOBinding(),
                    type: samplerBindingType,
                };
                this._webgpuProcessingContext.availableSamplers[name] = samplerInfo;
            }
            this._addSamplerBindingDescription(name, samplerInfo, isVertex);
            const part1 = code.substring(0, match.index);
            const insertPart = `@group(${samplerInfo.binding.groupIndex}) @binding(${samplerInfo.binding.bindingIndex}) `;
            const part2 = code.substring(match.index);
            code = part1 + insertPart + part2;
            samplerRegexp.lastIndex += insertPart.length;
        }
        return code;
    }
    _processCustomBuffers(code, isVertex) {
        const instantiateBufferRegexp = /var<\s*(uniform|storage)\s*(,\s*(read|read_write)\s*)?>\s+(\S+)\s*:\s*(\S+)\s*;/gm;
        // eslint-disable-next-line no-constant-condition
        while (true) {
            const match = instantiateBufferRegexp.exec(code);
            if (match === null) {
                break;
            }
            const type = match[1];
            const decoration = match[3];
            let name = match[4];
            const structName = match[5];
            let bufferInfo = this._webgpuProcessingContext.availableBuffers[name];
            if (!bufferInfo) {
                const knownUBO = type === "uniform" ? WebGPUShaderProcessingContext.KnownUBOs[structName] : null;
                let binding;
                if (knownUBO) {
                    name = structName;
                    binding = knownUBO.binding;
                    if (binding.groupIndex === -1) {
                        binding = this._webgpuProcessingContext.availableBuffers[name]?.binding;
                        if (!binding) {
                            binding = this._webgpuProcessingContext.getNextFreeUBOBinding();
                        }
                    }
                }
                else {
                    binding = this._webgpuProcessingContext.getNextFreeUBOBinding();
                }
                bufferInfo = { binding };
                this._webgpuProcessingContext.availableBuffers[name] = bufferInfo;
            }
            this._addBufferBindingDescription(name, this._webgpuProcessingContext.availableBuffers[name], decoration === "read_write"
                ? "storage" /* WebGPUConstants.BufferBindingType.Storage */
                : type === "storage"
                    ? "read-only-storage" /* WebGPUConstants.BufferBindingType.ReadOnlyStorage */
                    : "uniform" /* WebGPUConstants.BufferBindingType.Uniform */, isVertex);
            const groupIndex = bufferInfo.binding.groupIndex;
            const bindingIndex = bufferInfo.binding.bindingIndex;
            const part1 = code.substring(0, match.index);
            const insertPart = `@group(${groupIndex}) @binding(${bindingIndex}) `;
            const part2 = code.substring(match.index);
            code = part1 + insertPart + part2;
            instantiateBufferRegexp.lastIndex += insertPart.length;
        }
        return code;
    }
    _processStridedUniformArrays(code) {
        for (const uniformArrayName of this._stridedUniformArrays) {
            code = code.replace(new RegExp(`${uniformArrayName}\\s*\\[(.*?)\\]`, "g"), `${uniformArrayName}[$1].el`);
        }
        return code;
    }
}
//# sourceMappingURL=webgpuShaderProcessorsWGSL.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuHardwareTexture.js


/** @internal */
class WebGPUHardwareTexture {
    get underlyingResource() {
        return this._webgpuTexture;
    }
    getMSAATexture(index) {
        return this._webgpuMSAATexture?.[index] ?? null;
    }
    setMSAATexture(texture, index) {
        if (!this._webgpuMSAATexture) {
            this._webgpuMSAATexture = [];
        }
        this._webgpuMSAATexture[index] = texture;
    }
    releaseMSAATexture(index) {
        if (this._webgpuMSAATexture) {
            if (index !== undefined) {
                this._engine._textureHelper.releaseTexture(this._webgpuMSAATexture[index]);
                delete this._webgpuMSAATexture[index];
            }
            else {
                for (const texture of this._webgpuMSAATexture) {
                    this._engine._textureHelper.releaseTexture(texture);
                }
                this._webgpuMSAATexture = null;
            }
        }
    }
    constructor(_engine, existingTexture = null) {
        this._engine = _engine;
        /** @internal */
        this._originalFormatIsRGB = false;
        this.format = "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;
        this.textureUsages = 0;
        this.textureAdditionalUsages = 0;
        this._webgpuTexture = existingTexture;
        this._webgpuMSAATexture = null;
        this.view = null;
        this.viewForWriting = null;
    }
    set(hardwareTexture) {
        this._webgpuTexture = hardwareTexture;
    }
    setUsage(_textureSource, generateMipMaps, is2DArray, isCube, is3D, width, height, depth) {
        let viewDimension = "2d" /* WebGPUConstants.TextureViewDimension.E2d */;
        let arrayLayerCount = 1;
        if (isCube) {
            viewDimension = is2DArray ? "cube-array" /* WebGPUConstants.TextureViewDimension.CubeArray */ : "cube" /* WebGPUConstants.TextureViewDimension.Cube */;
            arrayLayerCount = 6 * (depth || 1);
        }
        else if (is3D) {
            viewDimension = "3d" /* WebGPUConstants.TextureViewDimension.E3d */;
            arrayLayerCount = 1;
        }
        else if (is2DArray) {
            viewDimension = "2d-array" /* WebGPUConstants.TextureViewDimension.E2dArray */;
            arrayLayerCount = depth;
        }
        const format = WebGPUTextureHelper.GetDepthFormatOnly(this.format);
        const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(this.format) ? "depth-only" /* WebGPUConstants.TextureAspect.DepthOnly */ : "all" /* WebGPUConstants.TextureAspect.All */;
        this.createView({
            label: `TextureView${is3D ? "3D" : isCube ? "Cube" : "2D"}${is2DArray ? "_Array" + arrayLayerCount : ""}_${width}x${height}_${generateMipMaps ? "wmips" : "womips"}_${this.format}_${viewDimension}`,
            format,
            dimension: viewDimension,
            mipLevelCount: generateMipMaps ? (0,math_scalar_functions.ILog2)(Math.max(width, height)) + 1 : 1,
            baseArrayLayer: 0,
            baseMipLevel: 0,
            arrayLayerCount,
            aspect,
        });
    }
    createView(descriptor, createViewForWriting = false) {
        this.view = this._webgpuTexture.createView(descriptor);
        if (createViewForWriting && descriptor) {
            const saveNumMipMaps = descriptor.mipLevelCount;
            descriptor.mipLevelCount = 1;
            this.viewForWriting = this._webgpuTexture.createView(descriptor);
            descriptor.mipLevelCount = saveNumMipMaps;
        }
    }
    reset() {
        this._webgpuTexture = null;
        this._webgpuMSAATexture = null;
        this.view = null;
        this.viewForWriting = null;
    }
    release() {
        this._webgpuTexture?.destroy();
        this.releaseMSAATexture();
        this._copyInvertYTempTexture?.destroy();
        this.reset();
    }
}
//# sourceMappingURL=webgpuHardwareTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuTextureManager.js
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable babylonjs/available */
/* eslint-disable jsdoc/require-jsdoc */
// License for the mipmap generation code:
//
// Copyright 2020 Brandon Jones
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.





// TODO WEBGPU improve mipmap generation by using compute shaders
const mipmapVertexSource = `
    const pos = array<vec2<f32>, 4>( vec2f(-1.0f, 1.0f),  vec2f(1.0f, 1.0f),  vec2f(-1.0f, -1.0f),  vec2f(1.0f, -1.0f));
    const tex = array<vec2<f32>, 4>( vec2f(0.0f, 0.0f),  vec2f(1.0f, 0.0f),  vec2f(0.0f, 1.0f),  vec2f(1.0f, 1.0f));

    varying vTex: vec2f;

    @vertex
    fn main(input : VertexInputs) -> FragmentInputs {
        vertexOutputs.vTex = tex[input.vertexIndex];
        vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);
    }
    `;
const mipmapFragmentSource = `
    var imgSampler: sampler;
    var img: texture_2d<f32>;

    varying vTex: vec2f;

    @fragment
    fn main(input: FragmentInputs) -> FragmentOutputs {
        fragmentOutputs.color = textureSample(img, imgSampler, input.vTex);
    }
    `;
const invertYPreMultiplyAlphaVertexSource = `
    const pos = array<vec2<f32>, 4>( vec2f(-1.0f, 1.0f),  vec2f(1.0f, 1.0f),  vec2f(-1.0f, -1.0f),  vec2f(1.0f, -1.0f));
    const tex = array<vec2<f32>, 4>( vec2f(0.0f, 0.0f),  vec2f(1.0f, 0.0f),  vec2f(0.0f, 1.0f),  vec2f(1.0f, 1.0f));

    var img: texture_2d<f32>;

    #ifdef INVERTY
        varying vTextureSize: vec2f;
    #endif

    @vertex
    fn main(input : VertexInputs) -> FragmentInputs {
        #ifdef INVERTY
            vertexOutputs.vTextureSize = vec2f(textureDimensions(img, 0));
        #endif
        vertexOutputs.position =  vec4f(pos[input.vertexIndex], 0.0, 1.0);
    }
    `;
const invertYPreMultiplyAlphaFragmentSource = `
    var img: texture_2d<f32>;

    #ifdef INVERTY
        varying vTextureSize: vec2f;
    #endif

    @fragment
    fn main(input: FragmentInputs) -> FragmentOutputs {
    #ifdef INVERTY
        var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(input.vTextureSize.y - input.position.y)), 0);
    #else
        var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0);
    #endif
    #ifdef PREMULTIPLYALPHA
        fragmentOutputs.color = vec4f(color.rgb * color.a, color.a);
    #endif
        fragmentOutputs.color = color;
    }
    `;
const invertYPreMultiplyAlphaWithOfstVertexSource = invertYPreMultiplyAlphaVertexSource;
const invertYPreMultiplyAlphaWithOfstFragmentSource = `
    var img: texture_2d<f32>;
    uniform ofstX: f32;
    uniform ofstY: f32;
    uniform width: f32;
    uniform height: f32;

    #ifdef INVERTY
        varying vTextureSize: vec2f;
    #endif

    @fragment
    fn main(input: FragmentInputs) -> FragmentOutputs {
        if (input.position.x < uniforms.ofstX || input.position.x >= uniforms.ofstX + uniforms.width) {
            discard;
        }
        if (input.position.y < uniforms.ofstY || input.position.y >= uniforms.ofstY + uniforms.height) {
            discard;
        }
    #ifdef INVERTY
        var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(uniforms.ofstY + uniforms.height - (input.position.y - uniforms.ofstY))), 0);
    #else
        var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0);
    #endif
    #ifdef PREMULTIPLYALPHA
        color = vec4f(color.rgb * color.a, color.a);
    #endif
        fragmentOutputs.color = color;
    }
    `;
const clearVertexSource = `
    const pos = array<vec2<f32>, 4>( vec2f(-1.0f, 1.0f),  vec2f(1.0f, 1.0f),  vec2f(-1.0f, -1.0f),  vec2f(1.0f, -1.0f));

    @vertex
    fn main(input : VertexInputs) -> FragmentInputs {
        vertexOutputs.position =  vec4f(pos[input.vertexIndex], 0.0, 1.0);
    }
    `;
const clearFragmentSource = `
    uniform color: vec4f;


    @fragment
    fn main(input: FragmentInputs) -> FragmentOutputs {
        fragmentOutputs.color = uniforms.color;
    }
    `;
const copyVideoToTextureVertexSource = `
    struct VertexOutput {
        @builtin(position) Position : vec4<f32>,
        @location(0) fragUV : vec2<f32>
    }

    @vertex
    fn main(
        @builtin(vertex_index) VertexIndex : u32
    ) -> VertexOutput {
        var pos = array<vec2<f32>, 4>(
            vec2(-1.0,  1.0),
            vec2( 1.0,  1.0),
            vec2(-1.0, -1.0),
            vec2( 1.0, -1.0)
        );
        var tex = array<vec2<f32>, 4>(
            vec2(0.0, 0.0),
            vec2(1.0, 0.0),
            vec2(0.0, 1.0),
            vec2(1.0, 1.0)
        );

        var output: VertexOutput;

        output.Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);
        output.fragUV = tex[VertexIndex];

        return output;
    }
    `;
const copyVideoToTextureFragmentSource = `
    @group(0) @binding(0) var videoSampler: sampler;
    @group(0) @binding(1) var videoTexture: texture_external;

    @fragment
    fn main(
        @location(0) fragUV: vec2<f32>
    ) -> @location(0) vec4<f32> {
        return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV);
    }
    `;
const copyVideoToTextureInvertYFragmentSource = `
    @group(0) @binding(0) var videoSampler: sampler;
    @group(0) @binding(1) var videoTexture: texture_external;

    @fragment
    fn main(
        @location(0) fragUV: vec2<f32>
    ) -> @location(0) vec4<f32> {
        return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2<f32>(fragUV.x, 1.0 - fragUV.y));
    }
    `;
var PipelineType;
(function (PipelineType) {
    PipelineType[PipelineType["MipMap"] = 0] = "MipMap";
    PipelineType[PipelineType["InvertYPremultiplyAlpha"] = 1] = "InvertYPremultiplyAlpha";
    PipelineType[PipelineType["Clear"] = 2] = "Clear";
    PipelineType[PipelineType["InvertYPremultiplyAlphaWithOfst"] = 3] = "InvertYPremultiplyAlphaWithOfst";
})(PipelineType || (PipelineType = {}));
var VideoPipelineType;
(function (VideoPipelineType) {
    VideoPipelineType[VideoPipelineType["DontInvertY"] = 0] = "DontInvertY";
    VideoPipelineType[VideoPipelineType["InvertY"] = 1] = "InvertY";
})(VideoPipelineType || (VideoPipelineType = {}));
const shadersForPipelineType = [
    { vertex: mipmapVertexSource, fragment: mipmapFragmentSource },
    { vertex: invertYPreMultiplyAlphaVertexSource, fragment: invertYPreMultiplyAlphaFragmentSource },
    { vertex: clearVertexSource, fragment: clearFragmentSource },
    { vertex: invertYPreMultiplyAlphaWithOfstVertexSource, fragment: invertYPreMultiplyAlphaWithOfstFragmentSource },
];
/**
 * Map a (renderable) texture format (GPUTextureFormat) to an index for fast lookup (in caches for eg)
 * The number of entries should not go over 64! Else, the code in WebGPUCacheRenderPipeline.setMRT should be updated
 */
const renderableTextureFormatToIndex = {
    "": 0,
    r8unorm: 1,
    r8uint: 2,
    r8sint: 3,
    r16uint: 4,
    r16sint: 5,
    r16float: 6,
    rg8unorm: 7,
    rg8uint: 8,
    rg8sint: 9,
    r32uint: 10,
    r32sint: 11,
    r32float: 12,
    rg16uint: 13,
    rg16sint: 14,
    rg16float: 15,
    rgba8unorm: 16,
    "rgba8unorm-srgb": 17,
    rgba8uint: 18,
    rgba8sint: 19,
    bgra8unorm: 20,
    "bgra8unorm-srgb": 21,
    rgb10a2uint: 22,
    rgb10a2unorm: 23,
    /* rg11b10ufloat: this entry is dynamically added if the "RG11B10UFloatRenderable" extension is supported */
    rg32uint: 24,
    rg32sint: 25,
    rg32float: 26,
    rgba16uint: 27,
    rgba16sint: 28,
    rgba16float: 29,
    rgba32uint: 30,
    rgba32sint: 31,
    rgba32float: 32,
    stencil8: 33,
    depth16unorm: 34,
    depth24plus: 35,
    "depth24plus-stencil8": 36,
    depth32float: 37,
    "depth32float-stencil8": 38,
    r16unorm: 39,
    rg16unorm: 40,
    rgba16unorm: 41,
    r16snorm: 42,
    rg16snorm: 43,
    rgba16snorm: 44,
};
/** @internal */
class WebGPUTextureManager {
    //------------------------------------------------------------------------------
    //                         Initialization / Helpers
    //------------------------------------------------------------------------------
    constructor(engine, device, bufferManager, enabledExtensions) {
        this._pipelines = {};
        this._compiledShaders = [];
        this._videoPipelines = {};
        this._videoCompiledShaders = [];
        this._deferredReleaseTextures = [];
        this._engine = engine;
        this._device = device;
        this._bufferManager = bufferManager;
        if (enabledExtensions.indexOf("rg11b10ufloat-renderable" /* WebGPUConstants.FeatureName.RG11B10UFloatRenderable */) !== -1) {
            const keys = Object.keys(renderableTextureFormatToIndex);
            renderableTextureFormatToIndex["rg11b10ufloat" /* WebGPUConstants.TextureFormat.RG11B10UFloat */] = renderableTextureFormatToIndex[keys[keys.length - 1]] + 1;
        }
        this._mipmapSampler = device.createSampler({ minFilter: "linear" /* WebGPUConstants.FilterMode.Linear */ });
        this._videoSampler = device.createSampler({ minFilter: "linear" /* WebGPUConstants.FilterMode.Linear */ });
        this._ubCopyWithOfst = this._bufferManager.createBuffer(4 * 4, BufferUsage.Uniform | BufferUsage.CopyDst, "UBCopyWithOffset").underlyingResource;
        this._getPipeline("rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */);
        this._getVideoPipeline("rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */);
    }
    _getPipeline(format, type = PipelineType.MipMap, params) {
        const index = type === PipelineType.MipMap
            ? 1 << 0
            : type === PipelineType.InvertYPremultiplyAlpha
                ? ((params.invertY ? 1 : 0) << 1) + ((params.premultiplyAlpha ? 1 : 0) << 2)
                : type === PipelineType.Clear
                    ? 1 << 3
                    : type === PipelineType.InvertYPremultiplyAlphaWithOfst
                        ? ((params.invertY ? 1 : 0) << 4) + ((params.premultiplyAlpha ? 1 : 0) << 5)
                        : 0;
        if (!this._pipelines[format]) {
            this._pipelines[format] = [];
        }
        let pipelineAndBGL = this._pipelines[format][index];
        if (!pipelineAndBGL) {
            let defines = "";
            if (type === PipelineType.InvertYPremultiplyAlpha || type === PipelineType.InvertYPremultiplyAlphaWithOfst) {
                if (params.invertY) {
                    defines += "#define INVERTY\n";
                }
                if (params.premultiplyAlpha) {
                    defines += "#define PREMULTIPLYALPHA\n";
                }
            }
            let modules = this._compiledShaders[index];
            if (!modules) {
                let vertexCode = shadersForPipelineType[type].vertex;
                let fragmentCode = shadersForPipelineType[type].fragment;
                const processorOptions = {
                    defines: defines.split("\n"),
                    indexParameters: null,
                    isFragment: false,
                    shouldUseHighPrecisionShader: true,
                    processor: this._engine._getShaderProcessor(1 /* ShaderLanguage.WGSL */),
                    supportsUniformBuffers: true,
                    shadersRepository: "",
                    includesShadersStore: {},
                    version: (this._engine.version * 100).toString(),
                    platformName: this._engine.shaderPlatformName,
                    processingContext: this._engine._getShaderProcessingContext(1 /* ShaderLanguage.WGSL */, true),
                    isNDCHalfZRange: this._engine.isNDCHalfZRange,
                    useReverseDepthBuffer: this._engine.useReverseDepthBuffer,
                };
                (0,shaderProcessor/* Initialize */.pB)(processorOptions);
                // Disable special additions not needed here
                processorOptions.processor.pureMode = true;
                (0,shaderProcessor/* Process */.M0)(vertexCode, processorOptions, (migratedVertexCode) => {
                    vertexCode = migratedVertexCode;
                }, this._engine);
                processorOptions.isFragment = true;
                (0,shaderProcessor/* Process */.M0)(fragmentCode, processorOptions, (migratedFragmentCode) => {
                    fragmentCode = migratedFragmentCode;
                }, this._engine);
                const final = (0,shaderProcessor/* Finalize */.nO)(vertexCode, fragmentCode, processorOptions);
                // Restore
                processorOptions.processor.pureMode = false;
                const vertexModule = this._device.createShaderModule({
                    code: final.vertexCode,
                });
                const fragmentModule = this._device.createShaderModule({
                    code: final.fragmentCode,
                });
                modules = this._compiledShaders[index] = [vertexModule, fragmentModule];
            }
            const pipeline = this._device.createRenderPipeline({
                layout: "auto" /* WebGPUConstants.AutoLayoutMode.Auto */,
                vertex: {
                    module: modules[0],
                    entryPoint: "main",
                },
                fragment: {
                    module: modules[1],
                    entryPoint: "main",
                    targets: [
                        {
                            format,
                        },
                    ],
                },
                primitive: {
                    topology: "triangle-strip" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */,
                    stripIndexFormat: "uint16" /* WebGPUConstants.IndexFormat.Uint16 */,
                },
            });
            pipelineAndBGL = this._pipelines[format][index] = [pipeline, pipeline.getBindGroupLayout(0)];
        }
        return pipelineAndBGL;
    }
    _getVideoPipeline(format, type = VideoPipelineType.DontInvertY) {
        const index = type === VideoPipelineType.InvertY ? 1 << 0 : 0;
        if (!this._videoPipelines[format]) {
            this._videoPipelines[format] = [];
        }
        let pipelineAndBGL = this._videoPipelines[format][index];
        if (!pipelineAndBGL) {
            let modules = this._videoCompiledShaders[index];
            if (!modules) {
                const vertexModule = this._device.createShaderModule({
                    code: copyVideoToTextureVertexSource,
                });
                const fragmentModule = this._device.createShaderModule({
                    code: index === 0 ? copyVideoToTextureFragmentSource : copyVideoToTextureInvertYFragmentSource,
                });
                modules = this._videoCompiledShaders[index] = [vertexModule, fragmentModule];
            }
            const pipeline = this._device.createRenderPipeline({
                label: `BabylonWebGPUDevice${this._engine.uniqueId}_CopyVideoToTexture_${format}_${index === 0 ? "DontInvertY" : "InvertY"}`,
                layout: "auto" /* WebGPUConstants.AutoLayoutMode.Auto */,
                vertex: {
                    module: modules[0],
                    entryPoint: "main",
                },
                fragment: {
                    module: modules[1],
                    entryPoint: "main",
                    targets: [
                        {
                            format,
                        },
                    ],
                },
                primitive: {
                    topology: "triangle-strip" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */,
                    stripIndexFormat: "uint16" /* WebGPUConstants.IndexFormat.Uint16 */,
                },
            });
            pipelineAndBGL = this._videoPipelines[format][index] = [pipeline, pipeline.getBindGroupLayout(0)];
        }
        return pipelineAndBGL;
    }
    setCommandEncoder(encoder) {
        this._commandEncoderForCreation = encoder;
    }
    copyVideoToTexture(video, texture, format, invertY = false, commandEncoder) {
        const useOwnCommandEncoder = commandEncoder === undefined;
        const [pipeline, bindGroupLayout] = this._getVideoPipeline(format, invertY ? VideoPipelineType.InvertY : VideoPipelineType.DontInvertY);
        if (useOwnCommandEncoder) {
            commandEncoder = this._device.createCommandEncoder({});
        }
        commandEncoder.pushDebugGroup?.(`copy video to texture - invertY=${invertY}`);
        const webgpuHardwareTexture = texture._hardwareTexture;
        const renderPassDescriptor = {
            label: `BabylonWebGPUDevice${this._engine.uniqueId}_copyVideoToTexture_${format}_${invertY ? "InvertY" : "DontInvertY"}${texture.label ? "_" + texture.label : ""}`,
            colorAttachments: [
                {
                    view: webgpuHardwareTexture.underlyingResource.createView({
                        format,
                        dimension: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
                        mipLevelCount: 1,
                        baseArrayLayer: 0,
                        baseMipLevel: 0,
                        arrayLayerCount: 1,
                        aspect: "all" /* WebGPUConstants.TextureAspect.All */,
                    }),
                    loadOp: "load" /* WebGPUConstants.LoadOp.Load */,
                    storeOp: "store" /* WebGPUConstants.StoreOp.Store */,
                },
            ],
        };
        const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
        const descriptor = {
            layout: bindGroupLayout,
            entries: [
                {
                    binding: 0,
                    resource: this._videoSampler,
                },
                {
                    binding: 1,
                    resource: this._device.importExternalTexture({
                        source: video.underlyingResource,
                    }),
                },
            ],
        };
        const bindGroup = this._device.createBindGroup(descriptor);
        passEncoder.setPipeline(pipeline);
        passEncoder.setBindGroup(0, bindGroup);
        passEncoder.draw(4, 1, 0, 0);
        passEncoder.end();
        commandEncoder.popDebugGroup?.();
        if (useOwnCommandEncoder) {
            this._device.queue.submit([commandEncoder.finish()]);
            commandEncoder = null;
        }
    }
    invertYPreMultiplyAlpha(gpuOrHdwTexture, width, height, format, invertY = false, premultiplyAlpha = false, faceIndex = 0, mipLevel = 0, layers = 1, ofstX = 0, ofstY = 0, rectWidth = 0, rectHeight = 0, commandEncoder, 
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    allowGPUOptimization) {
        const useRect = rectWidth !== 0;
        const useOwnCommandEncoder = commandEncoder === undefined;
        const [pipeline, bindGroupLayout] = this._getPipeline(format, useRect ? PipelineType.InvertYPremultiplyAlphaWithOfst : PipelineType.InvertYPremultiplyAlpha, {
            invertY,
            premultiplyAlpha,
        });
        faceIndex = Math.max(faceIndex, 0);
        if (useOwnCommandEncoder) {
            commandEncoder = this._device.createCommandEncoder({});
        }
        commandEncoder.pushDebugGroup?.(`internal process texture - invertY=${invertY} premultiplyAlpha=${premultiplyAlpha}`);
        let gpuTexture;
        if (WebGPUTextureHelper.IsHardwareTexture(gpuOrHdwTexture)) {
            gpuTexture = gpuOrHdwTexture.underlyingResource;
            if (!(invertY && !premultiplyAlpha && layers === 1 && faceIndex === 0)) {
                // we optimize only for the most likely case (invertY=true, premultiplyAlpha=false, layers=1, faceIndex=0) to avoid dealing with big caches
                gpuOrHdwTexture = undefined;
            }
        }
        else {
            gpuTexture = gpuOrHdwTexture;
            gpuOrHdwTexture = undefined;
        }
        if (!gpuTexture) {
            return;
        }
        if (useRect) {
            this._bufferManager.setRawData(this._ubCopyWithOfst, 0, new Float32Array([ofstX, ofstY, rectWidth, rectHeight]), 0, 4 * 4);
        }
        const webgpuHardwareTexture = gpuOrHdwTexture;
        const outputTexture = webgpuHardwareTexture?._copyInvertYTempTexture ??
            this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, format, 1, commandEncoder, 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */, undefined, "TempTextureForCopyWithInvertY");
        const renderPassDescriptor = webgpuHardwareTexture?._copyInvertYRenderPassDescr ?? {
            label: `BabylonWebGPUDevice${this._engine.uniqueId}_invertYPreMultiplyAlpha_${format}_${invertY ? "InvertY" : "DontInvertY"}_${premultiplyAlpha ? "PremultiplyAlpha" : "DontPremultiplyAlpha"}`,
            colorAttachments: [
                {
                    view: outputTexture.createView({
                        format,
                        dimension: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
                        baseMipLevel: 0,
                        mipLevelCount: 1,
                        arrayLayerCount: 1,
                        baseArrayLayer: 0,
                    }),
                    loadOp: "load" /* WebGPUConstants.LoadOp.Load */,
                    storeOp: "store" /* WebGPUConstants.StoreOp.Store */,
                },
            ],
        };
        const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
        let bindGroup = useRect ? webgpuHardwareTexture?._copyInvertYBindGroupWithOfst : webgpuHardwareTexture?._copyInvertYBindGroup;
        if (!bindGroup) {
            const descriptor = {
                layout: bindGroupLayout,
                entries: [
                    {
                        binding: 0,
                        resource: gpuTexture.createView({
                            format,
                            dimension: "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
                            baseMipLevel: mipLevel,
                            mipLevelCount: 1,
                            arrayLayerCount: layers,
                            baseArrayLayer: faceIndex,
                        }),
                    },
                ],
            };
            if (useRect) {
                descriptor.entries.push({
                    binding: 1,
                    resource: {
                        buffer: this._ubCopyWithOfst,
                    },
                });
            }
            bindGroup = this._device.createBindGroup(descriptor);
        }
        passEncoder.setPipeline(pipeline);
        passEncoder.setBindGroup(0, bindGroup);
        passEncoder.draw(4, 1, 0, 0);
        passEncoder.end();
        commandEncoder.copyTextureToTexture({
            texture: outputTexture,
        }, {
            texture: gpuTexture,
            mipLevel,
            origin: {
                x: 0,
                y: 0,
                z: faceIndex,
            },
        }, {
            width,
            height,
            depthOrArrayLayers: 1,
        });
        if (webgpuHardwareTexture) {
            webgpuHardwareTexture._copyInvertYTempTexture = outputTexture;
            webgpuHardwareTexture._copyInvertYRenderPassDescr = renderPassDescriptor;
            if (useRect) {
                webgpuHardwareTexture._copyInvertYBindGroupWithOfst = bindGroup;
            }
            else {
                webgpuHardwareTexture._copyInvertYBindGroup = bindGroup;
            }
        }
        else {
            this._deferredReleaseTextures.push([outputTexture, null]);
        }
        commandEncoder.popDebugGroup?.();
        if (useOwnCommandEncoder) {
            this._device.queue.submit([commandEncoder.finish()]);
            commandEncoder = null;
        }
    }
    copyWithInvertY(srcTextureView, format, renderPassDescriptor, commandEncoder) {
        const useOwnCommandEncoder = commandEncoder === undefined;
        const [pipeline, bindGroupLayout] = this._getPipeline(format, PipelineType.InvertYPremultiplyAlpha, { invertY: true, premultiplyAlpha: false });
        if (useOwnCommandEncoder) {
            commandEncoder = this._device.createCommandEncoder({});
        }
        commandEncoder.pushDebugGroup?.(`internal copy texture with invertY`);
        const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
        const bindGroup = this._device.createBindGroup({
            layout: bindGroupLayout,
            entries: [
                {
                    binding: 0,
                    resource: srcTextureView,
                },
            ],
        });
        passEncoder.setPipeline(pipeline);
        passEncoder.setBindGroup(0, bindGroup);
        passEncoder.draw(4, 1, 0, 0);
        passEncoder.end();
        commandEncoder.popDebugGroup?.();
        if (useOwnCommandEncoder) {
            this._device.queue.submit([commandEncoder.finish()]);
            commandEncoder = null;
        }
    }
    //------------------------------------------------------------------------------
    //                               Creation
    //------------------------------------------------------------------------------
    createTexture(imageBitmap, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, is3D = false, format = "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0, label) {
        sampleCount = WebGPUTextureHelper.GetSample(sampleCount);
        const layerCount = imageBitmap.layers || 1;
        const textureSize = {
            width: imageBitmap.width,
            height: imageBitmap.height,
            depthOrArrayLayers: layerCount,
        };
        const renderAttachmentFlag = renderableTextureFormatToIndex[format] ? 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ : 0;
        const isCompressedFormat = WebGPUTextureHelper.IsCompressedFormat(format);
        const mipLevelCount = hasMipmaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(imageBitmap.width, imageBitmap.height) : 1;
        const usages = usage >= 0 ? usage : 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 2 /* WebGPUConstants.TextureUsage.CopyDst */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */;
        additionalUsages |= hasMipmaps && !isCompressedFormat ? 1 /* WebGPUConstants.TextureUsage.CopySrc */ | renderAttachmentFlag : 0;
        if (!isCompressedFormat && !is3D) {
            // we don't know in advance if the texture will be updated with copyExternalImageToTexture (which requires to have those flags), so we need to force the flags all the times
            additionalUsages |= renderAttachmentFlag | 2 /* WebGPUConstants.TextureUsage.CopyDst */;
        }
        const gpuTexture = this._device.createTexture({
            label: `BabylonWebGPUDevice${this._engine.uniqueId}_Texture${is3D ? "3D" : "2D"}_${label ? label + "_" : ""}${textureSize.width}x${textureSize.height}x${textureSize.depthOrArrayLayers}_${hasMipmaps ? "wmips" : "womips"}_${format}_samples${sampleCount}`,
            size: textureSize,
            dimension: is3D ? "3d" /* WebGPUConstants.TextureDimension.E3d */ : "2d" /* WebGPUConstants.TextureDimension.E2d */,
            format,
            usage: usages | additionalUsages,
            sampleCount,
            mipLevelCount,
        });
        if (WebGPUTextureHelper.IsImageBitmap(imageBitmap)) {
            this.updateTexture(imageBitmap, gpuTexture, imageBitmap.width, imageBitmap.height, layerCount, format, 0, 0, invertY, premultiplyAlpha, 0, 0);
            if (hasMipmaps && generateMipmaps) {
                this.generateMipmaps(gpuTexture, format, mipLevelCount, 0, is3D, commandEncoder);
            }
        }
        return gpuTexture;
    }
    createCubeTexture(imageBitmaps, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, format = "rgba8unorm" /* WebGPUConstants.TextureFormat.RGBA8Unorm */, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0, label) {
        sampleCount = WebGPUTextureHelper.GetSample(sampleCount);
        const width = WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps) ? imageBitmaps[0].width : imageBitmaps.width;
        const height = WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps) ? imageBitmaps[0].height : imageBitmaps.height;
        const renderAttachmentFlag = renderableTextureFormatToIndex[format] ? 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ : 0;
        const isCompressedFormat = WebGPUTextureHelper.IsCompressedFormat(format);
        const mipLevelCount = hasMipmaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(width, height) : 1;
        const usages = usage >= 0 ? usage : 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 2 /* WebGPUConstants.TextureUsage.CopyDst */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */;
        additionalUsages |= hasMipmaps && !isCompressedFormat ? 1 /* WebGPUConstants.TextureUsage.CopySrc */ | renderAttachmentFlag : 0;
        if (!isCompressedFormat) {
            // we don't know in advance if the texture will be updated with copyExternalImageToTexture (which requires to have those flags), so we need to force the flags all the times
            additionalUsages |= renderAttachmentFlag | 2 /* WebGPUConstants.TextureUsage.CopyDst */;
        }
        const gpuTexture = this._device.createTexture({
            label: `BabylonWebGPUDevice${this._engine.uniqueId}_TextureCube_${label ? label + "_" : ""}${width}x${height}x6_${hasMipmaps ? "wmips" : "womips"}_${format}_samples${sampleCount}`,
            size: {
                width,
                height,
                depthOrArrayLayers: 6,
            },
            dimension: "2d" /* WebGPUConstants.TextureDimension.E2d */,
            format,
            usage: usages | additionalUsages,
            sampleCount,
            mipLevelCount,
        });
        if (WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps)) {
            this.updateCubeTextures(imageBitmaps, gpuTexture, width, height, format, invertY, premultiplyAlpha, 0, 0);
            if (hasMipmaps && generateMipmaps) {
                this.generateCubeMipmaps(gpuTexture, format, mipLevelCount, commandEncoder);
            }
        }
        return gpuTexture;
    }
    generateCubeMipmaps(gpuTexture, format, mipLevelCount, commandEncoder) {
        const useOwnCommandEncoder = commandEncoder === undefined;
        if (useOwnCommandEncoder) {
            commandEncoder = this._device.createCommandEncoder({});
        }
        commandEncoder.pushDebugGroup?.(`create cube mipmaps - ${mipLevelCount} levels`);
        for (let f = 0; f < 6; ++f) {
            this.generateMipmaps(gpuTexture, format, mipLevelCount, f, false, commandEncoder);
        }
        commandEncoder.popDebugGroup?.();
        if (useOwnCommandEncoder) {
            this._device.queue.submit([commandEncoder.finish()]);
            commandEncoder = null;
        }
    }
    generateMipmaps(gpuOrHdwTexture, format, mipLevelCount, faceIndex = 0, is3D = false, commandEncoder) {
        const useOwnCommandEncoder = commandEncoder === undefined;
        const [pipeline, bindGroupLayout] = this._getPipeline(format);
        faceIndex = Math.max(faceIndex, 0);
        if (useOwnCommandEncoder) {
            commandEncoder = this._device.createCommandEncoder({});
        }
        commandEncoder.pushDebugGroup?.(`create mipmaps for face #${faceIndex} - ${mipLevelCount} levels`);
        let gpuTexture;
        if (WebGPUTextureHelper.IsHardwareTexture(gpuOrHdwTexture)) {
            gpuTexture = gpuOrHdwTexture.underlyingResource;
            gpuOrHdwTexture._mipmapGenRenderPassDescr = gpuOrHdwTexture._mipmapGenRenderPassDescr || [];
            gpuOrHdwTexture._mipmapGenBindGroup = gpuOrHdwTexture._mipmapGenBindGroup || [];
        }
        else {
            gpuTexture = gpuOrHdwTexture;
            gpuOrHdwTexture = undefined;
        }
        if (!gpuTexture) {
            return;
        }
        const webgpuHardwareTexture = gpuOrHdwTexture;
        for (let i = 1; i < mipLevelCount; ++i) {
            const renderPassDescriptor = webgpuHardwareTexture?._mipmapGenRenderPassDescr[faceIndex]?.[i - 1] ?? {
                label: `BabylonWebGPUDevice${this._engine.uniqueId}_generateMipmaps_${format}_faceIndex${faceIndex}_level${i}`,
                colorAttachments: [
                    {
                        view: gpuTexture.createView({
                            format,
                            dimension: is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
                            baseMipLevel: i,
                            mipLevelCount: 1,
                            arrayLayerCount: 1,
                            baseArrayLayer: faceIndex,
                        }),
                        loadOp: "load" /* WebGPUConstants.LoadOp.Load */,
                        storeOp: "store" /* WebGPUConstants.StoreOp.Store */,
                    },
                ],
            };
            if (webgpuHardwareTexture) {
                webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex] = webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex] || [];
                webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex][i - 1] = renderPassDescriptor;
            }
            const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
            const bindGroup = webgpuHardwareTexture?._mipmapGenBindGroup[faceIndex]?.[i - 1] ??
                this._device.createBindGroup({
                    layout: bindGroupLayout,
                    entries: [
                        {
                            binding: 0,
                            resource: gpuTexture.createView({
                                format,
                                dimension: is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
                                baseMipLevel: i - 1,
                                mipLevelCount: 1,
                                arrayLayerCount: 1,
                                baseArrayLayer: faceIndex,
                            }),
                        },
                        {
                            binding: 1,
                            resource: this._mipmapSampler,
                        },
                    ],
                });
            if (webgpuHardwareTexture) {
                webgpuHardwareTexture._mipmapGenBindGroup[faceIndex] = webgpuHardwareTexture._mipmapGenBindGroup[faceIndex] || [];
                webgpuHardwareTexture._mipmapGenBindGroup[faceIndex][i - 1] = bindGroup;
            }
            passEncoder.setPipeline(pipeline);
            passEncoder.setBindGroup(0, bindGroup);
            passEncoder.draw(4, 1, 0, 0);
            passEncoder.end();
        }
        commandEncoder.popDebugGroup?.();
        if (useOwnCommandEncoder) {
            this._device.queue.submit([commandEncoder.finish()]);
            commandEncoder = null;
        }
    }
    createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags, dontCreateMSAATexture) {
        if (!texture._hardwareTexture) {
            texture._hardwareTexture = new WebGPUHardwareTexture(this._engine);
        }
        if (width === undefined) {
            width = texture.width;
        }
        if (height === undefined) {
            height = texture.height;
        }
        if (depth === undefined) {
            depth = texture.depth;
        }
        const gpuTextureWrapper = texture._hardwareTexture;
        const isStorageTexture = ((creationFlags ?? 0) & 1) !== 0;
        gpuTextureWrapper.format = WebGPUTextureHelper.GetWebGPUTextureFormat(texture.type, texture.format, texture._useSRGBBuffer);
        gpuTextureWrapper.textureUsages =
            texture._source === 5 /* InternalTextureSource.RenderTarget */ || texture.source === 6 /* InternalTextureSource.MultiRenderTarget */
                ? 4 /* WebGPUConstants.TextureUsage.TextureBinding */ | 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 16 /* WebGPUConstants.TextureUsage.RenderAttachment */
                : texture._source === 12 /* InternalTextureSource.DepthStencil */
                    ? 4 /* WebGPUConstants.TextureUsage.TextureBinding */ | 16 /* WebGPUConstants.TextureUsage.RenderAttachment */
                    : -1;
        gpuTextureWrapper.textureAdditionalUsages = isStorageTexture ? 8 /* WebGPUConstants.TextureUsage.StorageBinding */ : 0;
        const hasMipMaps = texture.generateMipMaps;
        const layerCount = depth || 1;
        let mipmapCount;
        if (texture._maxLodLevel !== null) {
            mipmapCount = texture._maxLodLevel;
        }
        else {
            mipmapCount = hasMipMaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(width, height) : 1;
        }
        if (texture.isCube) {
            const gpuTexture = this.createCubeTexture({ width, height }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, false, gpuTextureWrapper.format, 1, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages, texture.label);
            gpuTextureWrapper.set(gpuTexture);
            const arrayLayerCount = texture.is3D ? 1 : layerCount;
            const format = WebGPUTextureHelper.GetDepthFormatOnly(gpuTextureWrapper.format);
            const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? "depth-only" /* WebGPUConstants.TextureAspect.DepthOnly */ : "all" /* WebGPUConstants.TextureAspect.All */;
            const dimension = texture.is2DArray ? "cube-array" /* WebGPUConstants.TextureViewDimension.CubeArray */ : "cube" /* WebGPUConstants.TextureViewDimension.Cube */;
            gpuTextureWrapper.createView({
                label: `BabylonWebGPUDevice${this._engine.uniqueId}_TextureViewCube${texture.is2DArray ? "_Array" + arrayLayerCount : ""}_${width}x${height}_${hasMipMaps ? "wmips" : "womips"}_${format}_${dimension}_${aspect}_${texture.label ?? "noname"}`,
                format,
                dimension,
                mipLevelCount: mipmapCount,
                baseArrayLayer: 0,
                baseMipLevel: 0,
                arrayLayerCount: 6,
                aspect,
            }, isStorageTexture);
        }
        else {
            const gpuTexture = this.createTexture({ width, height, layers: layerCount }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, false, texture.is3D, gpuTextureWrapper.format, 1, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages, texture.label);
            gpuTextureWrapper.set(gpuTexture);
            const arrayLayerCount = texture.is3D ? 1 : layerCount;
            const format = WebGPUTextureHelper.GetDepthFormatOnly(gpuTextureWrapper.format);
            const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? "depth-only" /* WebGPUConstants.TextureAspect.DepthOnly */ : "all" /* WebGPUConstants.TextureAspect.All */;
            const dimension = texture.is2DArray
                ? "2d-array" /* WebGPUConstants.TextureViewDimension.E2dArray */
                : texture.is3D
                    ? "3d" /* WebGPUConstants.TextureDimension.E3d */
                    : "2d" /* WebGPUConstants.TextureViewDimension.E2d */;
            gpuTextureWrapper.createView({
                label: `BabylonWebGPUDevice${this._engine.uniqueId}_TextureView${texture.is3D ? "3D" : "2D"}${texture.is2DArray ? "_Array" + arrayLayerCount : ""}_${width}x${height}${texture.is3D ? "x" + layerCount : ""}_${hasMipMaps ? "wmips" : "womips"}_${format}_${dimension}_${aspect}_${texture.label ?? "noname"}`,
                format,
                dimension,
                mipLevelCount: mipmapCount,
                baseArrayLayer: 0,
                baseMipLevel: 0,
                arrayLayerCount,
                aspect,
            }, isStorageTexture);
        }
        texture.width = texture.baseWidth = width;
        texture.height = texture.baseHeight = height;
        texture.depth = texture.baseDepth = depth;
        if (!dontCreateMSAATexture) {
            this.createMSAATexture(texture, texture.samples);
        }
        return gpuTextureWrapper;
    }
    createMSAATexture(texture, samples, releaseExisting = true, index = 0) {
        const gpuTextureWrapper = texture._hardwareTexture;
        if (releaseExisting) {
            gpuTextureWrapper?.releaseMSAATexture();
        }
        if (!gpuTextureWrapper || (samples ?? 1) <= 1) {
            return;
        }
        const width = texture.width;
        const height = texture.height;
        const gpuMSAATexture = this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, gpuTextureWrapper.format, samples, this._commandEncoderForCreation, 16 /* WebGPUConstants.TextureUsage.RenderAttachment */, 0, texture.label ? "MSAA_" + texture.label : "MSAA");
        gpuTextureWrapper.setMSAATexture(gpuMSAATexture, index);
    }
    //------------------------------------------------------------------------------
    //                                  Update
    //------------------------------------------------------------------------------
    updateCubeTextures(imageBitmaps, gpuTexture, width, height, format, invertY = false, premultiplyAlpha = false, offsetX = 0, offsetY = 0) {
        const faces = [0, 3, 1, 4, 2, 5];
        for (let f = 0; f < faces.length; ++f) {
            const imageBitmap = imageBitmaps[faces[f]];
            this.updateTexture(imageBitmap, gpuTexture, width, height, 1, format, f, 0, invertY, premultiplyAlpha, offsetX, offsetY);
        }
    }
    // TODO WEBGPU handle data source not being in the same format than the destination texture?
    updateTexture(imageBitmap, texture, width, height, layers, format, faceIndex = 0, mipLevel = 0, invertY = false, premultiplyAlpha = false, offsetX = 0, offsetY = 0, allowGPUOptimization) {
        const gpuTexture = WebGPUTextureHelper.IsInternalTexture(texture) ? texture._hardwareTexture.underlyingResource : texture;
        const blockInformation = WebGPUTextureHelper.GetBlockInformationFromFormat(format);
        const gpuOrHdwTexture = WebGPUTextureHelper.IsInternalTexture(texture) ? texture._hardwareTexture : texture;
        const textureCopyView = {
            texture: gpuTexture,
            origin: {
                x: offsetX,
                y: offsetY,
                z: Math.max(faceIndex, 0),
            },
            mipLevel: mipLevel,
            premultipliedAlpha: premultiplyAlpha,
        };
        const textureExtent = {
            width: Math.ceil(width / blockInformation.width) * blockInformation.width,
            height: Math.ceil(height / blockInformation.height) * blockInformation.height,
            depthOrArrayLayers: layers || 1,
        };
        if (imageBitmap.byteLength !== undefined) {
            imageBitmap = imageBitmap;
            const bytesPerRow = Math.ceil(width / blockInformation.width) * blockInformation.length;
            const aligned = Math.ceil(bytesPerRow / 256) * 256 === bytesPerRow;
            if (aligned) {
                const commandEncoder = this._device.createCommandEncoder({});
                const buffer = this._bufferManager.createRawBuffer(imageBitmap.byteLength, BufferUsage.MapWrite | BufferUsage.CopySrc, true, "TempBufferForUpdateTexture" + (gpuTexture ? "_" + gpuTexture.label : ""));
                const arrayBuffer = buffer.getMappedRange();
                new Uint8Array(arrayBuffer).set(imageBitmap);
                buffer.unmap();
                commandEncoder.copyBufferToTexture({
                    buffer: buffer,
                    offset: 0,
                    bytesPerRow,
                    rowsPerImage: height,
                }, textureCopyView, textureExtent);
                this._device.queue.submit([commandEncoder.finish()]);
                this._bufferManager.releaseBuffer(buffer);
            }
            else {
                this._device.queue.writeTexture(textureCopyView, imageBitmap, {
                    offset: 0,
                    bytesPerRow,
                    rowsPerImage: height,
                }, textureExtent);
            }
            if (invertY || premultiplyAlpha) {
                if (WebGPUTextureHelper.IsInternalTexture(texture)) {
                    const dontUseRect = offsetX === 0 && offsetY === 0 && width === texture.width && height === texture.height;
                    this.invertYPreMultiplyAlpha(gpuOrHdwTexture, texture.width, texture.height, format, invertY, premultiplyAlpha, faceIndex, mipLevel, layers || 1, offsetX, offsetY, dontUseRect ? 0 : width, dontUseRect ? 0 : height, undefined, allowGPUOptimization);
                }
                else {
                    // we should never take this code path
                    // eslint-disable-next-line no-throw-literal
                    throw "updateTexture: Can't process the texture data because a GPUTexture was provided instead of an InternalTexture!";
                }
            }
        }
        else {
            imageBitmap = imageBitmap;
            if (invertY) {
                textureCopyView.premultipliedAlpha = false; // we are going to handle premultiplyAlpha ourselves
                // we must preprocess the image
                if (WebGPUTextureHelper.IsInternalTexture(texture) && offsetX === 0 && offsetY === 0 && width === texture.width && height === texture.height) {
                    // optimization when the source image is the same size than the destination texture and offsets X/Y == 0:
                    // we simply copy the source to the destination and we apply the preprocessing on the destination
                    this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, textureCopyView, textureExtent);
                    this.invertYPreMultiplyAlpha(gpuOrHdwTexture, width, height, format, invertY, premultiplyAlpha, faceIndex, mipLevel, layers || 1, 0, 0, 0, 0, undefined, allowGPUOptimization);
                }
                else {
                    // we must apply the preprocessing on the source image before copying it into the destination texture
                    const commandEncoder = this._device.createCommandEncoder({});
                    // create a temp texture and copy the image to it
                    const srcTexture = this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, format, 1, commandEncoder, 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */, undefined, "TempTextureForUpdateTexture");
                    this._deferredReleaseTextures.push([srcTexture, null]);
                    textureExtent.depthOrArrayLayers = 1;
                    this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, { texture: srcTexture }, textureExtent);
                    textureExtent.depthOrArrayLayers = layers || 1;
                    // apply the preprocessing to this temp texture
                    this.invertYPreMultiplyAlpha(srcTexture, width, height, format, invertY, premultiplyAlpha, faceIndex, mipLevel, layers || 1, 0, 0, 0, 0, commandEncoder, allowGPUOptimization);
                    // copy the temp texture to the destination texture
                    commandEncoder.copyTextureToTexture({ texture: srcTexture }, textureCopyView, textureExtent);
                    this._device.queue.submit([commandEncoder.finish()]);
                }
            }
            else {
                // no preprocessing: direct copy to destination texture
                this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, textureCopyView, textureExtent);
            }
        }
    }
    readPixels(texture, x, y, width, height, format, faceIndex = 0, mipLevel = 0, buffer = null, noDataConversion = false) {
        const blockInformation = WebGPUTextureHelper.GetBlockInformationFromFormat(format);
        const bytesPerRow = Math.ceil(width / blockInformation.width) * blockInformation.length;
        const bytesPerRowAligned = Math.ceil(bytesPerRow / 256) * 256;
        const size = bytesPerRowAligned * height;
        const gpuBuffer = this._bufferManager.createRawBuffer(size, BufferUsage.MapRead | BufferUsage.CopyDst, undefined, "TempBufferForReadPixels" + (texture.label ? "_" + texture.label : ""));
        const commandEncoder = this._device.createCommandEncoder({});
        commandEncoder.copyTextureToBuffer({
            texture,
            mipLevel,
            origin: {
                x,
                y,
                z: Math.max(faceIndex, 0),
            },
        }, {
            buffer: gpuBuffer,
            offset: 0,
            bytesPerRow: bytesPerRowAligned,
        }, {
            width,
            height,
            depthOrArrayLayers: 1,
        });
        this._device.queue.submit([commandEncoder.finish()]);
        return this._bufferManager.readDataFromBuffer(gpuBuffer, size, width, height, bytesPerRow, bytesPerRowAligned, WebGPUTextureHelper.GetTextureTypeFromFormat(format), 0, buffer, true, noDataConversion);
    }
    //------------------------------------------------------------------------------
    //                              Dispose
    //------------------------------------------------------------------------------
    releaseTexture(texture) {
        if (WebGPUTextureHelper.IsInternalTexture(texture)) {
            const hardwareTexture = texture._hardwareTexture;
            const irradianceTexture = texture._irradianceTexture;
            // We can't destroy the objects just now because they could be used in the current frame - we delay the destroying after the end of the frame
            this._deferredReleaseTextures.push([hardwareTexture, irradianceTexture]);
        }
        else {
            this._deferredReleaseTextures.push([texture, null]);
        }
    }
    destroyDeferredTextures() {
        for (let i = 0; i < this._deferredReleaseTextures.length; ++i) {
            const [hardwareTexture, irradianceTexture] = this._deferredReleaseTextures[i];
            if (hardwareTexture) {
                if (WebGPUTextureHelper.IsHardwareTexture(hardwareTexture)) {
                    hardwareTexture.release();
                }
                else {
                    hardwareTexture.destroy();
                }
            }
            irradianceTexture?.dispose();
        }
        this._deferredReleaseTextures.length = 0;
    }
}
//# sourceMappingURL=webgpuTextureManager.js.map
;// ./node_modules/@babylonjs/core/Meshes/WebGPU/webgpuDataBuffer.js

/** @internal */
class WebGPUDataBuffer extends dataBuffer/* DataBuffer */.n {
    set buffer(buffer) {
        this._buffer = buffer;
    }
    constructor(resource, capacity = 0) {
        super();
        // Used to make sure the buffer is not recreated twice after a context loss/restoration
        this.engineId = -1;
        this.capacity = capacity;
        if (resource) {
            this._buffer = resource;
        }
    }
    get underlyingResource() {
        return this._buffer;
    }
}
//# sourceMappingURL=webgpuDataBuffer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/textureTools.js
var textureTools = __webpack_require__(42683);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/abstractEngine.functions.js
var abstractEngine_functions = __webpack_require__(16741);
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuBufferManager.js




// eslint-disable-next-line @typescript-eslint/naming-convention

/** @internal */
class WebGPUBufferManager {
    static _IsGPUBuffer(buffer) {
        return buffer.underlyingResource === undefined;
    }
    static _FlagsToString(flags, suffix = "") {
        let result = suffix;
        for (let i = 0; i <= 9; ++i) {
            if (flags & (1 << i)) {
                if (result) {
                    result += "_";
                }
                result += BufferUsage[1 << i];
            }
        }
        return result;
    }
    constructor(engine, device) {
        this._deferredReleaseBuffers = [];
        this._engine = engine;
        this._device = device;
    }
    createRawBuffer(viewOrSize, flags, mappedAtCreation = false, label) {
        const alignedLength = viewOrSize.byteLength !== undefined ? (viewOrSize.byteLength + 3) & ~3 : (viewOrSize + 3) & ~3; // 4 bytes alignments (because of the upload which requires this)
        const verticesBufferDescriptor = {
            label: "BabylonWebGPUDevice" + this._engine.uniqueId + "_" + WebGPUBufferManager._FlagsToString(flags, label ?? "Buffer") + "_size" + alignedLength,
            mappedAtCreation,
            size: alignedLength,
            usage: flags,
        };
        return this._device.createBuffer(verticesBufferDescriptor);
    }
    createBuffer(viewOrSize, flags, label) {
        const isView = viewOrSize.byteLength !== undefined;
        const dataBuffer = new WebGPUDataBuffer();
        const labelId = "DataBufferUniqueId=" + dataBuffer.uniqueId;
        dataBuffer.buffer = this.createRawBuffer(viewOrSize, flags, undefined, label ? labelId + "-" + label : labelId);
        dataBuffer.references = 1;
        dataBuffer.capacity = isView ? viewOrSize.byteLength : viewOrSize;
        dataBuffer.engineId = this._engine.uniqueId;
        if (isView) {
            this.setSubData(dataBuffer, 0, viewOrSize);
        }
        return dataBuffer;
    }
    setRawData(buffer, dstByteOffset, src, srcByteOffset, byteLength) {
        this._device.queue.writeBuffer(buffer, dstByteOffset, src.buffer, srcByteOffset, byteLength);
    }
    setSubData(dataBuffer, dstByteOffset, src, srcByteOffset = 0, byteLength = 0) {
        const buffer = dataBuffer.underlyingResource;
        byteLength = byteLength || src.byteLength;
        byteLength = Math.min(byteLength, dataBuffer.capacity - dstByteOffset);
        // After Migration to Canary
        let chunkStart = src.byteOffset + srcByteOffset;
        let chunkEnd = chunkStart + byteLength;
        // 4 bytes alignments for upload
        const alignedLength = (byteLength + 3) & ~3;
        if (alignedLength !== byteLength) {
            const tempView = new Uint8Array(src.buffer.slice(chunkStart, chunkEnd));
            src = new Uint8Array(alignedLength);
            src.set(tempView);
            srcByteOffset = 0;
            chunkStart = 0;
            chunkEnd = alignedLength;
            byteLength = alignedLength;
        }
        // Chunk
        const maxChunk = 1024 * 1024 * 15;
        let offset = 0;
        while (chunkEnd - (chunkStart + offset) > maxChunk) {
            this._device.queue.writeBuffer(buffer, dstByteOffset + offset, src.buffer, chunkStart + offset, maxChunk);
            offset += maxChunk;
        }
        this._device.queue.writeBuffer(buffer, dstByteOffset + offset, src.buffer, chunkStart + offset, byteLength - offset);
    }
    _getHalfFloatAsFloatRGBAArrayBuffer(dataLength, arrayBuffer, destArray) {
        if (!destArray) {
            destArray = new Float32Array(dataLength);
        }
        const srcData = new Uint16Array(arrayBuffer);
        while (dataLength--) {
            destArray[dataLength] = (0,textureTools/* FromHalfFloat */.SX)(srcData[dataLength]);
        }
        return destArray;
    }
    readDataFromBuffer(gpuBuffer, size, width, height, bytesPerRow, bytesPerRowAligned, type = 0, offset = 0, buffer = null, destroyBuffer = true, noDataConversion = false) {
        const floatFormat = type === 1 ? 2 : type === 2 ? 1 : 0;
        const engineId = this._engine.uniqueId;
        return new Promise((resolve, reject) => {
            gpuBuffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */, offset, size).then(() => {
                const copyArrayBuffer = gpuBuffer.getMappedRange(offset, size);
                let data = buffer;
                if (noDataConversion) {
                    if (data === null) {
                        data = (0,abstractEngine_functions/* allocateAndCopyTypedBuffer */.kZ)(type, size, true, copyArrayBuffer);
                    }
                    else {
                        data = (0,abstractEngine_functions/* allocateAndCopyTypedBuffer */.kZ)(type, data.buffer, undefined, copyArrayBuffer);
                    }
                }
                else {
                    if (data === null) {
                        switch (floatFormat) {
                            case 0: // byte format
                                data = new Uint8Array(size);
                                data.set(new Uint8Array(copyArrayBuffer));
                                break;
                            case 1: // half float
                                // TODO WEBGPU use computer shaders (or render pass) to make the conversion?
                                data = this._getHalfFloatAsFloatRGBAArrayBuffer(size / 2, copyArrayBuffer);
                                break;
                            case 2: // float
                                data = new Float32Array(size / 4);
                                data.set(new Float32Array(copyArrayBuffer));
                                break;
                        }
                    }
                    else {
                        switch (floatFormat) {
                            case 0: // byte format
                                data = new Uint8Array(data.buffer);
                                data.set(new Uint8Array(copyArrayBuffer));
                                break;
                            case 1: // half float
                                // TODO WEBGPU use computer shaders (or render pass) to make the conversion?
                                data = this._getHalfFloatAsFloatRGBAArrayBuffer(size / 2, copyArrayBuffer, buffer);
                                break;
                            case 2: // float
                                data = new Float32Array(data.buffer);
                                data.set(new Float32Array(copyArrayBuffer));
                                break;
                        }
                    }
                }
                if (bytesPerRow !== bytesPerRowAligned) {
                    // TODO WEBGPU use computer shaders (or render pass) to build the final buffer data?
                    if (floatFormat === 1 && !noDataConversion) {
                        // half float have been converted to float above
                        bytesPerRow *= 2;
                        bytesPerRowAligned *= 2;
                    }
                    const data2 = new Uint8Array(data.buffer);
                    let offset = bytesPerRow, offset2 = 0;
                    for (let y = 1; y < height; ++y) {
                        offset2 = y * bytesPerRowAligned;
                        for (let x = 0; x < bytesPerRow; ++x) {
                            data2[offset++] = data2[offset2++];
                        }
                    }
                    if (floatFormat !== 0 && !noDataConversion) {
                        data = new Float32Array(data2.buffer, 0, offset / 4);
                    }
                    else {
                        data = new Uint8Array(data2.buffer, 0, offset);
                    }
                }
                gpuBuffer.unmap();
                if (destroyBuffer) {
                    this.releaseBuffer(gpuBuffer);
                }
                resolve(data);
            }, (reason) => {
                if (this._engine.isDisposed || this._engine.uniqueId !== engineId) {
                    // The engine was disposed while waiting for the promise, or a context loss/restoration has occurred: don't reject
                    resolve(new Uint8Array());
                }
                else {
                    reject(reason);
                }
            });
        });
    }
    releaseBuffer(buffer) {
        if (WebGPUBufferManager._IsGPUBuffer(buffer)) {
            this._deferredReleaseBuffers.push(buffer);
            return true;
        }
        buffer.references--;
        if (buffer.references === 0) {
            this._deferredReleaseBuffers.push(buffer.underlyingResource);
            return true;
        }
        return false;
    }
    destroyDeferredBuffers() {
        for (let i = 0; i < this._deferredReleaseBuffers.length; ++i) {
            this._deferredReleaseBuffers[i].destroy();
        }
        this._deferredReleaseBuffers.length = 0;
    }
}
//# sourceMappingURL=webgpuBufferManager.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheSampler.js

const filterToBits = [
    0 | (0 << 1) | (0 << 2), // not used
    0 | (0 << 1) | (0 << 2), // TEXTURE_NEAREST_SAMPLINGMODE / TEXTURE_NEAREST_NEAREST
    1 | (1 << 1) | (0 << 2), // TEXTURE_BILINEAR_SAMPLINGMODE / TEXTURE_LINEAR_LINEAR
    1 | (1 << 1) | (1 << 2), // TEXTURE_TRILINEAR_SAMPLINGMODE / TEXTURE_LINEAR_LINEAR_MIPLINEAR
    0 | (0 << 1) | (0 << 2), // TEXTURE_NEAREST_NEAREST_MIPNEAREST
    0 | (1 << 1) | (0 << 2), // TEXTURE_NEAREST_LINEAR_MIPNEAREST
    0 | (1 << 1) | (1 << 2), // TEXTURE_NEAREST_LINEAR_MIPLINEAR
    0 | (1 << 1) | (0 << 2), // TEXTURE_NEAREST_LINEAR
    0 | (0 << 1) | (1 << 2), // TEXTURE_NEAREST_NEAREST_MIPLINEAR
    1 | (0 << 1) | (0 << 2), // TEXTURE_LINEAR_NEAREST_MIPNEAREST
    1 | (0 << 1) | (1 << 2), // TEXTURE_LINEAR_NEAREST_MIPLINEAR
    1 | (1 << 1) | (0 << 2), // TEXTURE_LINEAR_LINEAR_MIPNEAREST
    1 | (0 << 1) | (0 << 2), // TEXTURE_LINEAR_NEAREST
];
// subtract 0x01FF from the comparison function value before indexing this array!
const comparisonFunctionToBits = [
    (0 << 3) | (0 << 4) | (0 << 5) | (0 << 6), // undefined
    (0 << 3) | (0 << 4) | (0 << 5) | (1 << 6), // NEVER
    (0 << 3) | (0 << 4) | (1 << 5) | (0 << 6), // LESS
    (0 << 3) | (0 << 4) | (1 << 5) | (1 << 6), // EQUAL
    (0 << 3) | (1 << 4) | (0 << 5) | (0 << 6), // LEQUAL
    (0 << 3) | (1 << 4) | (0 << 5) | (1 << 6), // GREATER
    (0 << 3) | (1 << 4) | (1 << 5) | (0 << 6), // NOTEQUAL
    (0 << 3) | (1 << 4) | (1 << 5) | (1 << 6), // GEQUAL
    (1 << 3) | (0 << 4) | (0 << 5) | (0 << 6), // ALWAYS
];
const filterNoMipToBits = [
    0 << 7, // not used
    1 << 7, // TEXTURE_NEAREST_SAMPLINGMODE / TEXTURE_NEAREST_NEAREST
    1 << 7, // TEXTURE_BILINEAR_SAMPLINGMODE / TEXTURE_LINEAR_LINEAR
    0 << 7, // TEXTURE_TRILINEAR_SAMPLINGMODE / TEXTURE_LINEAR_LINEAR_MIPLINEAR
    0 << 7, // TEXTURE_NEAREST_NEAREST_MIPNEAREST
    0 << 7, // TEXTURE_NEAREST_LINEAR_MIPNEAREST
    0 << 7, // TEXTURE_NEAREST_LINEAR_MIPLINEAR
    1 << 7, // TEXTURE_NEAREST_LINEAR
    0 << 7, // TEXTURE_NEAREST_NEAREST_MIPLINEAR
    0 << 7, // TEXTURE_LINEAR_NEAREST_MIPNEAREST
    0 << 7, // TEXTURE_LINEAR_NEAREST_MIPLINEAR
    0 << 7, // TEXTURE_LINEAR_LINEAR_MIPNEAREST
    1 << 7, // TEXTURE_LINEAR_NEAREST
];
/** @internal */
class WebGPUCacheSampler {
    constructor(device) {
        this._samplers = {};
        this._device = device;
        this.disabled = false;
    }
    static GetSamplerHashCode(sampler) {
        // The WebGPU spec currently only allows values 1 and 4 for anisotropy
        const anisotropy = sampler._cachedAnisotropicFilteringLevel ? sampler._cachedAnisotropicFilteringLevel : 1;
        const code = filterToBits[sampler.samplingMode] +
            comparisonFunctionToBits[(sampler._comparisonFunction || 0x0202) - 0x0200 + 1] +
            filterNoMipToBits[sampler.samplingMode] + // handle the lodMinClamp = lodMaxClamp = 0 case when no filter used for mip mapping
            ((sampler._cachedWrapU ?? 1) << 8) +
            ((sampler._cachedWrapV ?? 1) << 10) +
            ((sampler._cachedWrapR ?? 1) << 12) +
            ((sampler.useMipMaps ? 1 : 0) << 14) + // need to factor this in because _getSamplerFilterDescriptor depends on samplingMode AND useMipMaps!
            (anisotropy << 15);
        return code;
    }
    static _GetSamplerFilterDescriptor(sampler, anisotropy) {
        let magFilter, minFilter, mipmapFilter, lodMinClamp, lodMaxClamp;
        const useMipMaps = sampler.useMipMaps;
        switch (sampler.samplingMode) {
            case 11:
                magFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                minFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                if (!useMipMaps) {
                    lodMinClamp = lodMaxClamp = 0;
                }
                break;
            case 3:
            case 3:
                magFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                minFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                if (!useMipMaps) {
                    mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                    lodMinClamp = lodMaxClamp = 0;
                }
                else {
                    mipmapFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                }
                break;
            case 8:
                magFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                minFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                if (!useMipMaps) {
                    mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                    lodMinClamp = lodMaxClamp = 0;
                }
                else {
                    mipmapFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                }
                break;
            case 4:
                magFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                minFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                if (!useMipMaps) {
                    lodMinClamp = lodMaxClamp = 0;
                }
                break;
            case 5:
                magFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                minFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                if (!useMipMaps) {
                    lodMinClamp = lodMaxClamp = 0;
                }
                break;
            case 6:
                magFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                minFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                if (!useMipMaps) {
                    mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                    lodMinClamp = lodMaxClamp = 0;
                }
                else {
                    mipmapFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                }
                break;
            case 7:
                magFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                minFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                lodMinClamp = lodMaxClamp = 0;
                break;
            case 1:
            case 1:
                magFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                minFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                lodMinClamp = lodMaxClamp = 0;
                break;
            case 9:
                magFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                minFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                if (!useMipMaps) {
                    lodMinClamp = lodMaxClamp = 0;
                }
                break;
            case 10:
                magFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                minFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                if (!useMipMaps) {
                    mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                    lodMinClamp = lodMaxClamp = 0;
                }
                else {
                    mipmapFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                }
                break;
            case 2:
            case 2:
                magFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                minFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                lodMinClamp = lodMaxClamp = 0;
                break;
            case 12:
                magFilter = "linear" /* WebGPUConstants.FilterMode.Linear */;
                minFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                lodMinClamp = lodMaxClamp = 0;
                break;
            default:
                magFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                minFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                mipmapFilter = "nearest" /* WebGPUConstants.FilterMode.Nearest */;
                lodMinClamp = lodMaxClamp = 0;
                break;
        }
        if (anisotropy > 1 && (lodMinClamp !== 0 || lodMaxClamp !== 0) && mipmapFilter !== "nearest" /* WebGPUConstants.FilterMode.Nearest */) {
            return {
                magFilter: "linear" /* WebGPUConstants.FilterMode.Linear */,
                minFilter: "linear" /* WebGPUConstants.FilterMode.Linear */,
                mipmapFilter: "linear" /* WebGPUConstants.FilterMode.Linear */,
                anisotropyEnabled: true,
            };
        }
        return {
            magFilter,
            minFilter,
            mipmapFilter,
            lodMinClamp,
            lodMaxClamp,
        };
    }
    static _GetWrappingMode(mode) {
        switch (mode) {
            case 1:
                return "repeat" /* WebGPUConstants.AddressMode.Repeat */;
            case 0:
                return "clamp-to-edge" /* WebGPUConstants.AddressMode.ClampToEdge */;
            case 2:
                return "mirror-repeat" /* WebGPUConstants.AddressMode.MirrorRepeat */;
        }
        return "repeat" /* WebGPUConstants.AddressMode.Repeat */;
    }
    static _GetSamplerWrappingDescriptor(sampler) {
        return {
            addressModeU: this._GetWrappingMode(sampler._cachedWrapU),
            addressModeV: this._GetWrappingMode(sampler._cachedWrapV),
            addressModeW: this._GetWrappingMode(sampler._cachedWrapR),
        };
    }
    static _GetSamplerDescriptor(sampler, label) {
        const anisotropy = sampler.useMipMaps && sampler._cachedAnisotropicFilteringLevel ? sampler._cachedAnisotropicFilteringLevel : 1;
        const filterDescriptor = this._GetSamplerFilterDescriptor(sampler, anisotropy);
        return {
            label,
            ...filterDescriptor,
            ...this._GetSamplerWrappingDescriptor(sampler),
            compare: sampler._comparisonFunction ? WebGPUCacheSampler.GetCompareFunction(sampler._comparisonFunction) : undefined,
            maxAnisotropy: filterDescriptor.anisotropyEnabled ? anisotropy : 1,
        };
    }
    static GetCompareFunction(compareFunction) {
        switch (compareFunction) {
            case 519:
                return "always" /* WebGPUConstants.CompareFunction.Always */;
            case 514:
                return "equal" /* WebGPUConstants.CompareFunction.Equal */;
            case 516:
                return "greater" /* WebGPUConstants.CompareFunction.Greater */;
            case 518:
                return "greater-equal" /* WebGPUConstants.CompareFunction.GreaterEqual */;
            case 513:
                return "less" /* WebGPUConstants.CompareFunction.Less */;
            case 515:
                return "less-equal" /* WebGPUConstants.CompareFunction.LessEqual */;
            case 512:
                return "never" /* WebGPUConstants.CompareFunction.Never */;
            case 517:
                return "not-equal" /* WebGPUConstants.CompareFunction.NotEqual */;
            default:
                return "less" /* WebGPUConstants.CompareFunction.Less */;
        }
    }
    getSampler(sampler, bypassCache = false, hash = 0, label) {
        if (this.disabled) {
            return this._device.createSampler(WebGPUCacheSampler._GetSamplerDescriptor(sampler, label));
        }
        if (bypassCache) {
            hash = 0;
        }
        else if (hash === 0) {
            hash = WebGPUCacheSampler.GetSamplerHashCode(sampler);
        }
        let gpuSampler = bypassCache ? undefined : this._samplers[hash];
        if (!gpuSampler) {
            gpuSampler = this._device.createSampler(WebGPUCacheSampler._GetSamplerDescriptor(sampler, label));
            if (!bypassCache) {
                this._samplers[hash] = gpuSampler;
            }
        }
        return gpuSampler;
    }
}
//# sourceMappingURL=webgpuCacheSampler.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheRenderPipeline.js
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable babylonjs/available */
/* eslint-disable jsdoc/require-jsdoc */





var StatePosition;
(function (StatePosition) {
    StatePosition[StatePosition["StencilReadMask"] = 0] = "StencilReadMask";
    StatePosition[StatePosition["StencilWriteMask"] = 1] = "StencilWriteMask";
    //DepthBiasClamp = 1, // not used, so remove it to improve perf
    StatePosition[StatePosition["DepthBias"] = 2] = "DepthBias";
    StatePosition[StatePosition["DepthBiasSlopeScale"] = 3] = "DepthBiasSlopeScale";
    StatePosition[StatePosition["DepthStencilState"] = 4] = "DepthStencilState";
    StatePosition[StatePosition["MRTAttachments1"] = 5] = "MRTAttachments1";
    StatePosition[StatePosition["MRTAttachments2"] = 6] = "MRTAttachments2";
    StatePosition[StatePosition["RasterizationState"] = 7] = "RasterizationState";
    StatePosition[StatePosition["ColorStates"] = 8] = "ColorStates";
    StatePosition[StatePosition["ShaderStage"] = 9] = "ShaderStage";
    StatePosition[StatePosition["TextureStage"] = 10] = "TextureStage";
    StatePosition[StatePosition["VertexState"] = 11] = "VertexState";
    StatePosition[StatePosition["NumStates"] = 12] = "NumStates";
})(StatePosition || (StatePosition = {}));
const alphaBlendFactorToIndex = {
    0: 1, // Zero
    1: 2, // One
    0x0300: 3, // SrcColor
    0x0301: 4, // OneMinusSrcColor
    0x0302: 5, // SrcAlpha
    0x0303: 6, // OneMinusSrcAlpha
    0x0304: 7, // DstAlpha
    0x0305: 8, // OneMinusDstAlpha
    0x0306: 9, // DstColor
    0x0307: 10, // OneMinusDstColor
    0x0308: 11, // SrcAlphaSaturated
    0x8001: 12, // BlendColor
    0x8002: 13, // OneMinusBlendColor
    0x8003: 12, // BlendColor (alpha)
    0x8004: 13, // OneMinusBlendColor (alpha)
};
const stencilOpToIndex = {
    0x0000: 0, // ZERO
    0x1e00: 1, // KEEP
    0x1e01: 2, // REPLACE
    0x1e02: 3, // INCR
    0x1e03: 4, // DECR
    0x150a: 5, // INVERT
    0x8507: 6, // INCR_WRAP
    0x8508: 7, // DECR_WRAP
};
/** @internal */
class WebGPUCacheRenderPipeline {
    constructor(device, emptyVertexBuffer) {
        this.mrtTextureCount = 0;
        this._device = device;
        this._useTextureStage = true; // we force usage because we must handle depth textures with "float" filtering, which can't be fixed by a caps (like "textureFloatLinearFiltering" can for float textures)
        this._states = new Array(30); // pre-allocate enough room so that no new allocation will take place afterwards
        this._statesLength = 0;
        this._stateDirtyLowestIndex = 0;
        this._emptyVertexBuffer = emptyVertexBuffer;
        this._mrtFormats = [];
        this._parameter = { token: undefined, pipeline: null };
        this.disabled = false;
        this.vertexBuffers = [];
        this._kMaxVertexBufferStride = device.limits.maxVertexBufferArrayStride || 2048;
        this.reset();
    }
    reset() {
        this._isDirty = true;
        this.vertexBuffers.length = 0;
        this.setAlphaToCoverage(false);
        this.resetDepthCullingState();
        this.setClampDepth(false);
        this.setDepthBias(0);
        //this.setDepthBiasClamp(0);
        this._webgpuColorFormat = ["bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */];
        this.setColorFormat("bgra8unorm" /* WebGPUConstants.TextureFormat.BGRA8Unorm */);
        this.setMRT([]);
        this.setAlphaBlendEnabled(false);
        this.setAlphaBlendFactors([null, null, null, null], [null, null]);
        this.setWriteMask(0xf);
        this.setDepthStencilFormat("depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */);
        this.setStencilEnabled(false);
        this.resetStencilState();
        this.setBuffers(null, null, null);
        this._setTextureState(0);
    }
    get colorFormats() {
        return this._mrtAttachments1 > 0 ? this._mrtFormats : this._webgpuColorFormat;
    }
    getRenderPipeline(fillMode, effect, sampleCount, textureState = 0) {
        sampleCount = WebGPUTextureHelper.GetSample(sampleCount);
        if (this.disabled) {
            const topology = WebGPUCacheRenderPipeline._GetTopology(fillMode);
            this._setVertexState(effect); // to fill this.vertexBuffers with correct data
            this._setTextureState(textureState);
            this._parameter.pipeline = this._createRenderPipeline(effect, topology, sampleCount);
            WebGPUCacheRenderPipeline.NumCacheMiss++;
            WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame++;
            return this._parameter.pipeline;
        }
        this._setShaderStage(effect.uniqueId);
        this._setRasterizationState(fillMode, sampleCount);
        this._setColorStates();
        this._setDepthStencilState();
        this._setVertexState(effect);
        this._setTextureState(textureState);
        this.lastStateDirtyLowestIndex = this._stateDirtyLowestIndex;
        if (!this._isDirty && this._parameter.pipeline) {
            this._stateDirtyLowestIndex = this._statesLength;
            WebGPUCacheRenderPipeline.NumCacheHitWithoutHash++;
            return this._parameter.pipeline;
        }
        this._getRenderPipeline(this._parameter);
        this._isDirty = false;
        this._stateDirtyLowestIndex = this._statesLength;
        if (this._parameter.pipeline) {
            WebGPUCacheRenderPipeline.NumCacheHitWithHash++;
            return this._parameter.pipeline;
        }
        const topology = WebGPUCacheRenderPipeline._GetTopology(fillMode);
        this._parameter.pipeline = this._createRenderPipeline(effect, topology, sampleCount);
        this._setRenderPipeline(this._parameter);
        WebGPUCacheRenderPipeline.NumCacheMiss++;
        WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame++;
        return this._parameter.pipeline;
    }
    endFrame() {
        WebGPUCacheRenderPipeline.NumPipelineCreationLastFrame = WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame;
        WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame = 0;
    }
    setAlphaToCoverage(enabled) {
        this._alphaToCoverageEnabled = enabled;
    }
    setFrontFace(frontFace) {
        this._frontFace = frontFace;
    }
    setCullEnabled(enabled) {
        this._cullEnabled = enabled;
    }
    setCullFace(cullFace) {
        this._cullFace = cullFace;
    }
    setClampDepth(clampDepth) {
        this._clampDepth = clampDepth;
    }
    resetDepthCullingState() {
        this.setDepthCullingState(false, 2, 1, 0, 0, true, true, 519);
    }
    setDepthCullingState(cullEnabled, frontFace, cullFace, zOffset, zOffsetUnits, depthTestEnabled, depthWriteEnabled, depthCompare) {
        this._depthWriteEnabled = depthWriteEnabled;
        this._depthTestEnabled = depthTestEnabled;
        this._depthCompare = (depthCompare ?? 519) - 0x0200;
        this._cullFace = cullFace;
        this._cullEnabled = cullEnabled;
        this._frontFace = frontFace;
        this.setDepthBiasSlopeScale(zOffset);
        this.setDepthBias(zOffsetUnits);
    }
    setDepthBias(depthBias) {
        if (this._depthBias !== depthBias) {
            this._depthBias = depthBias;
            this._states[StatePosition.DepthBias] = depthBias;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.DepthBias);
        }
    }
    /*public setDepthBiasClamp(depthBiasClamp: number): void {
        if (this._depthBiasClamp !== depthBiasClamp) {
            this._depthBiasClamp = depthBiasClamp;
            this._states[StatePosition.DepthBiasClamp] = depthBiasClamp.toString();
            this._isDirty = true;
        }
    }*/
    setDepthBiasSlopeScale(depthBiasSlopeScale) {
        if (this._depthBiasSlopeScale !== depthBiasSlopeScale) {
            this._depthBiasSlopeScale = depthBiasSlopeScale;
            this._states[StatePosition.DepthBiasSlopeScale] = depthBiasSlopeScale;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.DepthBiasSlopeScale);
        }
    }
    setColorFormat(format) {
        this._webgpuColorFormat[0] = format;
        this._colorFormat = renderableTextureFormatToIndex[format ?? ""];
    }
    setMRTAttachments(attachments) {
        this.mrtAttachments = attachments;
        let mask = 0;
        for (let i = 0; i < attachments.length; ++i) {
            if (attachments[i] !== 0) {
                mask += 1 << i;
            }
        }
        if (this._mrtEnabledMask !== mask) {
            this._mrtEnabledMask = mask;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.MRTAttachments1);
        }
    }
    setMRT(textureArray, textureCount) {
        textureCount = textureCount ?? textureArray.length;
        if (textureCount > 10) {
            // If we want more than 10 attachments we need to change this method (and the StatePosition enum) but 10 seems plenty: note that WebGPU only supports 8 at the time (2021/12/13)!
            // As we need ~39 different values we are using 6 bits to encode a texture format, meaning we can encode 5 texture formats in 32 bits
            // We are using 2x32 bit values to handle 10 textures
            // eslint-disable-next-line no-throw-literal
            throw "Can't handle more than 10 attachments for a MRT in cache render pipeline!";
        }
        this.mrtTextureArray = textureArray;
        this.mrtTextureCount = textureCount;
        this._mrtEnabledMask = 0xffff; // all textures are enabled at start (meaning we can write to them). Calls to setMRTAttachments may disable some
        const bits = [0, 0];
        let indexBits = 0, mask = 0, numRT = 0;
        for (let i = 0; i < textureCount; ++i) {
            const texture = textureArray[i];
            const gpuWrapper = texture?._hardwareTexture;
            this._mrtFormats[numRT] = gpuWrapper?.format ?? this._webgpuColorFormat[0];
            bits[indexBits] += renderableTextureFormatToIndex[this._mrtFormats[numRT] ?? ""] << mask;
            mask += 6;
            numRT++;
            if (mask >= 32) {
                mask = 0;
                indexBits++;
            }
        }
        this._mrtFormats.length = numRT;
        if (this._mrtAttachments1 !== bits[0] || this._mrtAttachments2 !== bits[1]) {
            this._mrtAttachments1 = bits[0];
            this._mrtAttachments2 = bits[1];
            this._states[StatePosition.MRTAttachments1] = bits[0];
            this._states[StatePosition.MRTAttachments2] = bits[1];
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.MRTAttachments1);
        }
    }
    setAlphaBlendEnabled(enabled) {
        this._alphaBlendEnabled = enabled;
    }
    setAlphaBlendFactors(factors, operations) {
        this._alphaBlendFuncParams = factors;
        this._alphaBlendEqParams = operations;
    }
    setWriteMask(mask) {
        this._writeMask = mask;
    }
    setDepthStencilFormat(format) {
        this._webgpuDepthStencilFormat = format;
        this._depthStencilFormat = format === undefined ? 0 : renderableTextureFormatToIndex[format];
    }
    setDepthTestEnabled(enabled) {
        this._depthTestEnabled = enabled;
    }
    setDepthWriteEnabled(enabled) {
        this._depthWriteEnabled = enabled;
    }
    setDepthCompare(func) {
        this._depthCompare = (func ?? 519) - 0x0200;
    }
    setStencilEnabled(enabled) {
        this._stencilEnabled = enabled;
    }
    setStencilCompare(func) {
        this._stencilFrontCompare = (func ?? 519) - 0x0200;
    }
    setStencilDepthFailOp(op) {
        this._stencilFrontDepthFailOp = op === null ? 1 /* KEEP */ : stencilOpToIndex[op];
    }
    setStencilPassOp(op) {
        this._stencilFrontPassOp = op === null ? 2 /* REPLACE */ : stencilOpToIndex[op];
    }
    setStencilFailOp(op) {
        this._stencilFrontFailOp = op === null ? 1 /* KEEP */ : stencilOpToIndex[op];
    }
    setStencilReadMask(mask) {
        if (this._stencilReadMask !== mask) {
            this._stencilReadMask = mask;
            this._states[StatePosition.StencilReadMask] = mask;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.StencilReadMask);
        }
    }
    setStencilWriteMask(mask) {
        if (this._stencilWriteMask !== mask) {
            this._stencilWriteMask = mask;
            this._states[StatePosition.StencilWriteMask] = mask;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.StencilWriteMask);
        }
    }
    resetStencilState() {
        this.setStencilState(false, 519, 7680, 7681, 7680, 0xff, 0xff);
    }
    setStencilState(stencilEnabled, compare, depthFailOp, passOp, failOp, readMask, writeMask) {
        this._stencilEnabled = stencilEnabled;
        this._stencilFrontCompare = (compare ?? 519) - 0x0200;
        this._stencilFrontDepthFailOp = depthFailOp === null ? 1 /* KEEP */ : stencilOpToIndex[depthFailOp];
        this._stencilFrontPassOp = passOp === null ? 2 /* REPLACE */ : stencilOpToIndex[passOp];
        this._stencilFrontFailOp = failOp === null ? 1 /* KEEP */ : stencilOpToIndex[failOp];
        this.setStencilReadMask(readMask);
        this.setStencilWriteMask(writeMask);
    }
    setBuffers(vertexBuffers, indexBuffer, overrideVertexBuffers) {
        this._vertexBuffers = vertexBuffers;
        this._overrideVertexBuffers = overrideVertexBuffers;
        this._indexBuffer = indexBuffer;
    }
    static _GetTopology(fillMode) {
        switch (fillMode) {
            // Triangle views
            case 0:
                return "triangle-list" /* WebGPUConstants.PrimitiveTopology.TriangleList */;
            case 2:
                return "point-list" /* WebGPUConstants.PrimitiveTopology.PointList */;
            case 1:
                return "line-list" /* WebGPUConstants.PrimitiveTopology.LineList */;
            // Draw modes
            case 3:
                return "point-list" /* WebGPUConstants.PrimitiveTopology.PointList */;
            case 4:
                return "line-list" /* WebGPUConstants.PrimitiveTopology.LineList */;
            case 5:
                // return this._gl.LINE_LOOP;
                // TODO WEBGPU. Line Loop Mode Fallback at buffer load time.
                // eslint-disable-next-line no-throw-literal
                throw "LineLoop is an unsupported fillmode in WebGPU";
            case 6:
                return "line-strip" /* WebGPUConstants.PrimitiveTopology.LineStrip */;
            case 7:
                return "triangle-strip" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */;
            case 8:
                // return this._gl.TRIANGLE_FAN;
                // TODO WEBGPU. Triangle Fan Mode Fallback at buffer load time.
                // eslint-disable-next-line no-throw-literal
                throw "TriangleFan is an unsupported fillmode in WebGPU";
            default:
                return "triangle-list" /* WebGPUConstants.PrimitiveTopology.TriangleList */;
        }
    }
    static _GetAphaBlendOperation(operation) {
        switch (operation) {
            case 32774:
                return "add" /* WebGPUConstants.BlendOperation.Add */;
            case 32778:
                return "subtract" /* WebGPUConstants.BlendOperation.Subtract */;
            case 32779:
                return "reverse-subtract" /* WebGPUConstants.BlendOperation.ReverseSubtract */;
            case 32775:
                return "min" /* WebGPUConstants.BlendOperation.Min */;
            case 32776:
                return "max" /* WebGPUConstants.BlendOperation.Max */;
            default:
                return "add" /* WebGPUConstants.BlendOperation.Add */;
        }
    }
    static _GetAphaBlendFactor(factor) {
        switch (factor) {
            case 0:
                return "zero" /* WebGPUConstants.BlendFactor.Zero */;
            case 1:
                return "one" /* WebGPUConstants.BlendFactor.One */;
            case 768:
                return "src" /* WebGPUConstants.BlendFactor.Src */;
            case 769:
                return "one-minus-src" /* WebGPUConstants.BlendFactor.OneMinusSrc */;
            case 770:
                return "src-alpha" /* WebGPUConstants.BlendFactor.SrcAlpha */;
            case 771:
                return "one-minus-src-alpha" /* WebGPUConstants.BlendFactor.OneMinusSrcAlpha */;
            case 772:
                return "dst-alpha" /* WebGPUConstants.BlendFactor.DstAlpha */;
            case 773:
                return "one-minus-dst-alpha" /* WebGPUConstants.BlendFactor.OneMinusDstAlpha */;
            case 774:
                return "dst" /* WebGPUConstants.BlendFactor.Dst */;
            case 775:
                return "one-minus-dst" /* WebGPUConstants.BlendFactor.OneMinusDst */;
            case 776:
                return "src-alpha-saturated" /* WebGPUConstants.BlendFactor.SrcAlphaSaturated */;
            case 32769:
                return "constant" /* WebGPUConstants.BlendFactor.Constant */;
            case 32770:
                return "one-minus-constant" /* WebGPUConstants.BlendFactor.OneMinusConstant */;
            case 32771:
                return "constant" /* WebGPUConstants.BlendFactor.Constant */;
            case 32772:
                return "one-minus-constant" /* WebGPUConstants.BlendFactor.OneMinusConstant */;
            case 35065:
                return "src1" /* WebGPUConstants.BlendFactor.Src1 */;
            case 35066:
                return "one-minus-src1" /* WebGPUConstants.BlendFactor.OneMinusSrc1 */;
            case 34185:
                return "src1-alpha" /* WebGPUConstants.BlendFactor.Src1Alpha */;
            case 35067:
                return "one-minus-src1-alpha" /* WebGPUConstants.BlendFactor.OneMinusSrc1Alpha */;
            default:
                return "one" /* WebGPUConstants.BlendFactor.One */;
        }
    }
    static _GetCompareFunction(compareFunction) {
        switch (compareFunction) {
            case 0: // NEVER
                return "never" /* WebGPUConstants.CompareFunction.Never */;
            case 1: // LESS
                return "less" /* WebGPUConstants.CompareFunction.Less */;
            case 2: // EQUAL
                return "equal" /* WebGPUConstants.CompareFunction.Equal */;
            case 3: // LEQUAL
                return "less-equal" /* WebGPUConstants.CompareFunction.LessEqual */;
            case 4: // GREATER
                return "greater" /* WebGPUConstants.CompareFunction.Greater */;
            case 5: // NOTEQUAL
                return "not-equal" /* WebGPUConstants.CompareFunction.NotEqual */;
            case 6: // GEQUAL
                return "greater-equal" /* WebGPUConstants.CompareFunction.GreaterEqual */;
            case 7: // ALWAYS
                return "always" /* WebGPUConstants.CompareFunction.Always */;
        }
        return "never" /* WebGPUConstants.CompareFunction.Never */;
    }
    static _GetStencilOpFunction(operation) {
        switch (operation) {
            case 0:
                return "zero" /* WebGPUConstants.StencilOperation.Zero */;
            case 1:
                return "keep" /* WebGPUConstants.StencilOperation.Keep */;
            case 2:
                return "replace" /* WebGPUConstants.StencilOperation.Replace */;
            case 3:
                return "increment-clamp" /* WebGPUConstants.StencilOperation.IncrementClamp */;
            case 4:
                return "decrement-clamp" /* WebGPUConstants.StencilOperation.DecrementClamp */;
            case 5:
                return "invert" /* WebGPUConstants.StencilOperation.Invert */;
            case 6:
                return "increment-wrap" /* WebGPUConstants.StencilOperation.IncrementWrap */;
            case 7:
                return "decrement-wrap" /* WebGPUConstants.StencilOperation.DecrementWrap */;
        }
        return "keep" /* WebGPUConstants.StencilOperation.Keep */;
    }
    static _GetVertexInputDescriptorFormat(vertexBuffer) {
        const type = vertexBuffer.type;
        const normalized = vertexBuffer.normalized;
        const size = vertexBuffer.getSize();
        switch (type) {
            case Buffers_buffer/* VertexBuffer */.R.BYTE:
                switch (size) {
                    case 1:
                    case 2:
                        return normalized ? "snorm8x2" /* WebGPUConstants.VertexFormat.Snorm8x2 */ : "sint8x2" /* WebGPUConstants.VertexFormat.Sint8x2 */;
                    case 3:
                    case 4:
                        return normalized ? "snorm8x4" /* WebGPUConstants.VertexFormat.Snorm8x4 */ : "sint8x4" /* WebGPUConstants.VertexFormat.Sint8x4 */;
                }
                break;
            case Buffers_buffer/* VertexBuffer */.R.UNSIGNED_BYTE:
                switch (size) {
                    case 1:
                    case 2:
                        return normalized ? "unorm8x2" /* WebGPUConstants.VertexFormat.Unorm8x2 */ : "uint8x2" /* WebGPUConstants.VertexFormat.Uint8x2 */;
                    case 3:
                    case 4:
                        return normalized ? "unorm8x4" /* WebGPUConstants.VertexFormat.Unorm8x4 */ : "uint8x4" /* WebGPUConstants.VertexFormat.Uint8x4 */;
                }
                break;
            case Buffers_buffer/* VertexBuffer */.R.SHORT:
                switch (size) {
                    case 1:
                    case 2:
                        return normalized ? "snorm16x2" /* WebGPUConstants.VertexFormat.Snorm16x2 */ : "sint16x2" /* WebGPUConstants.VertexFormat.Sint16x2 */;
                    case 3:
                    case 4:
                        return normalized ? "snorm16x4" /* WebGPUConstants.VertexFormat.Snorm16x4 */ : "sint16x4" /* WebGPUConstants.VertexFormat.Sint16x4 */;
                }
                break;
            case Buffers_buffer/* VertexBuffer */.R.UNSIGNED_SHORT:
                switch (size) {
                    case 1:
                    case 2:
                        return normalized ? "unorm16x2" /* WebGPUConstants.VertexFormat.Unorm16x2 */ : "uint16x2" /* WebGPUConstants.VertexFormat.Uint16x2 */;
                    case 3:
                    case 4:
                        return normalized ? "unorm16x4" /* WebGPUConstants.VertexFormat.Unorm16x4 */ : "uint16x4" /* WebGPUConstants.VertexFormat.Uint16x4 */;
                }
                break;
            case Buffers_buffer/* VertexBuffer */.R.INT:
                switch (size) {
                    case 1:
                        return "sint32" /* WebGPUConstants.VertexFormat.Sint32 */;
                    case 2:
                        return "sint32x2" /* WebGPUConstants.VertexFormat.Sint32x2 */;
                    case 3:
                        return "sint32x3" /* WebGPUConstants.VertexFormat.Sint32x3 */;
                    case 4:
                        return "sint32x4" /* WebGPUConstants.VertexFormat.Sint32x4 */;
                }
                break;
            case Buffers_buffer/* VertexBuffer */.R.UNSIGNED_INT:
                switch (size) {
                    case 1:
                        return "uint32" /* WebGPUConstants.VertexFormat.Uint32 */;
                    case 2:
                        return "uint32x2" /* WebGPUConstants.VertexFormat.Uint32x2 */;
                    case 3:
                        return "uint32x3" /* WebGPUConstants.VertexFormat.Uint32x3 */;
                    case 4:
                        return "uint32x4" /* WebGPUConstants.VertexFormat.Uint32x4 */;
                }
                break;
            case Buffers_buffer/* VertexBuffer */.R.FLOAT:
                switch (size) {
                    case 1:
                        return "float32" /* WebGPUConstants.VertexFormat.Float32 */;
                    case 2:
                        return "float32x2" /* WebGPUConstants.VertexFormat.Float32x2 */;
                    case 3:
                        return "float32x3" /* WebGPUConstants.VertexFormat.Float32x3 */;
                    case 4:
                        return "float32x4" /* WebGPUConstants.VertexFormat.Float32x4 */;
                }
                break;
        }
        throw new Error(`Invalid Format '${vertexBuffer.getKind()}' - type=${type}, normalized=${normalized}, size=${size}`);
    }
    _getAphaBlendState() {
        if (!this._alphaBlendEnabled) {
            return null;
        }
        return {
            srcFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[2]),
            dstFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[3]),
            operation: WebGPUCacheRenderPipeline._GetAphaBlendOperation(this._alphaBlendEqParams[1]),
        };
    }
    _getColorBlendState() {
        if (!this._alphaBlendEnabled) {
            return null;
        }
        return {
            srcFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[0]),
            dstFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[1]),
            operation: WebGPUCacheRenderPipeline._GetAphaBlendOperation(this._alphaBlendEqParams[0]),
        };
    }
    _setShaderStage(id) {
        if (this._shaderId !== id) {
            this._shaderId = id;
            this._states[StatePosition.ShaderStage] = id;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.ShaderStage);
        }
    }
    _setRasterizationState(topology, sampleCount) {
        const frontFace = this._frontFace;
        const cullMode = this._cullEnabled ? this._cullFace : 0;
        const clampDepth = this._clampDepth ? 1 : 0;
        const alphaToCoverage = this._alphaToCoverageEnabled ? 1 : 0;
        const rasterizationState = frontFace - 1 + (cullMode << 1) + (clampDepth << 3) + (alphaToCoverage << 4) + (topology << 5) + (sampleCount << 8);
        if (this._rasterizationState !== rasterizationState) {
            this._rasterizationState = rasterizationState;
            this._states[StatePosition.RasterizationState] = this._rasterizationState;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.RasterizationState);
        }
    }
    _setColorStates() {
        let colorStates = ((this._writeMask ? 1 : 0) << 22) + (this._colorFormat << 23) + ((this._depthWriteEnabled ? 1 : 0) << 29); // this state has been moved from depthStencilState here because alpha and depth are related (generally when alpha is on, depth write is off and the other way around)
        if (this._alphaBlendEnabled) {
            colorStates +=
                ((this._alphaBlendFuncParams[0] === null ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[0]]) << 0) +
                    ((this._alphaBlendFuncParams[1] === null ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[1]]) << 4) +
                    ((this._alphaBlendFuncParams[2] === null ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[2]]) << 8) +
                    ((this._alphaBlendFuncParams[3] === null ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[3]]) << 12) +
                    ((this._alphaBlendEqParams[0] === null ? 1 : this._alphaBlendEqParams[0] - 0x8005) << 16) +
                    ((this._alphaBlendEqParams[1] === null ? 1 : this._alphaBlendEqParams[1] - 0x8005) << 19);
        }
        if (colorStates !== this._colorStates) {
            this._colorStates = colorStates;
            this._states[StatePosition.ColorStates] = this._colorStates;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.ColorStates);
        }
    }
    _setDepthStencilState() {
        const stencilState = !this._stencilEnabled
            ? 7 /* ALWAYS */ + (1 /* KEEP */ << 3) + (1 /* KEEP */ << 6) + (1 /* KEEP */ << 9)
            : this._stencilFrontCompare + (this._stencilFrontDepthFailOp << 3) + (this._stencilFrontPassOp << 6) + (this._stencilFrontFailOp << 9);
        const depthStencilState = this._depthStencilFormat + ((this._depthTestEnabled ? this._depthCompare : 7) /* ALWAYS */ << 6) + (stencilState << 10); // stencil front - stencil back is the same
        if (this._depthStencilState !== depthStencilState) {
            this._depthStencilState = depthStencilState;
            this._states[StatePosition.DepthStencilState] = this._depthStencilState;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.DepthStencilState);
        }
    }
    _setVertexState(effect) {
        const currStateLen = this._statesLength;
        let newNumStates = StatePosition.VertexState;
        const webgpuPipelineContext = effect._pipelineContext;
        const attributes = webgpuPipelineContext.shaderProcessingContext.attributeNamesFromEffect;
        const locations = webgpuPipelineContext.shaderProcessingContext.attributeLocationsFromEffect;
        let currentGPUBuffer;
        let numVertexBuffers = 0;
        for (let index = 0; index < attributes.length; index++) {
            const location = locations[index];
            let vertexBuffer = (this._overrideVertexBuffers && this._overrideVertexBuffers[attributes[index]]) ?? this._vertexBuffers[attributes[index]];
            if (!vertexBuffer) {
                // In WebGL it's valid to not bind a vertex buffer to an attribute, but it's not valid in WebGPU
                // So we must bind a dummy buffer when we are not given one for a specific attribute
                vertexBuffer = this._emptyVertexBuffer;
            }
            const buffer = vertexBuffer.effectiveBuffer?.underlyingResource;
            // We optimize usage of GPUVertexBufferLayout: we will create a single GPUVertexBufferLayout for all the attributes which follow each other and which use the same GPU buffer
            // However, there are some constraints in the attribute.offset value range, so we must check for them before being able to reuse the same GPUVertexBufferLayout
            // See _getVertexInputDescriptor() below
            if (vertexBuffer._validOffsetRange === undefined) {
                const offset = vertexBuffer.effectiveByteOffset;
                const formatSize = vertexBuffer.getSize(true);
                const byteStride = vertexBuffer.effectiveByteStride;
                vertexBuffer._validOffsetRange =
                    (offset + formatSize <= this._kMaxVertexBufferStride && byteStride === 0) || (byteStride !== 0 && offset + formatSize <= byteStride);
            }
            if (!(currentGPUBuffer && currentGPUBuffer === buffer && vertexBuffer._validOffsetRange)) {
                // we can't combine the previous vertexBuffer with the current one
                this.vertexBuffers[numVertexBuffers++] = vertexBuffer;
                currentGPUBuffer = vertexBuffer._validOffsetRange ? buffer : null;
            }
            const vid = vertexBuffer.hashCode + (location << 7);
            this._isDirty = this._isDirty || this._states[newNumStates] !== vid;
            this._states[newNumStates++] = vid;
        }
        this.vertexBuffers.length = numVertexBuffers;
        this._statesLength = newNumStates;
        this._isDirty = this._isDirty || newNumStates !== currStateLen;
        if (this._isDirty) {
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.VertexState);
        }
    }
    _setTextureState(textureState) {
        if (this._textureState !== textureState) {
            this._textureState = textureState;
            this._states[StatePosition.TextureStage] = this._textureState;
            this._isDirty = true;
            this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.TextureStage);
        }
    }
    _createPipelineLayout(webgpuPipelineContext) {
        if (this._useTextureStage) {
            return this._createPipelineLayoutWithTextureStage(webgpuPipelineContext);
        }
        const bindGroupLayouts = [];
        const bindGroupLayoutEntries = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries;
        for (let i = 0; i < bindGroupLayoutEntries.length; i++) {
            const setDefinition = bindGroupLayoutEntries[i];
            bindGroupLayouts[i] = this._device.createBindGroupLayout({
                entries: setDefinition,
            });
        }
        webgpuPipelineContext.bindGroupLayouts[0] = bindGroupLayouts;
        return this._device.createPipelineLayout({ bindGroupLayouts });
    }
    _createPipelineLayoutWithTextureStage(webgpuPipelineContext) {
        const shaderProcessingContext = webgpuPipelineContext.shaderProcessingContext;
        const bindGroupLayoutEntries = shaderProcessingContext.bindGroupLayoutEntries;
        let bitVal = 1;
        for (let i = 0; i < bindGroupLayoutEntries.length; i++) {
            const setDefinition = bindGroupLayoutEntries[i];
            for (let j = 0; j < setDefinition.length; j++) {
                const entry = bindGroupLayoutEntries[i][j];
                if (entry.texture) {
                    const name = shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name;
                    const textureInfo = shaderProcessingContext.availableTextures[name];
                    const samplerInfo = textureInfo.autoBindSampler ? shaderProcessingContext.availableSamplers[name + `Sampler`] : null;
                    let sampleType = textureInfo.sampleType;
                    let samplerType = samplerInfo?.type ?? "filtering" /* WebGPUConstants.SamplerBindingType.Filtering */;
                    if (this._textureState & bitVal && sampleType !== "depth" /* WebGPUConstants.TextureSampleType.Depth */) {
                        // The texture is a 32 bits float texture but the system does not support linear filtering for them OR the texture is a depth texture with "float" filtering:
                        // we set the sampler to "non-filtering" and the texture sample type to "unfilterable-float"
                        if (textureInfo.autoBindSampler) {
                            samplerType = "non-filtering" /* WebGPUConstants.SamplerBindingType.NonFiltering */;
                        }
                        sampleType = "unfilterable-float" /* WebGPUConstants.TextureSampleType.UnfilterableFloat */;
                    }
                    entry.texture.sampleType = sampleType;
                    if (samplerInfo) {
                        const binding = shaderProcessingContext.bindGroupLayoutEntryInfo[samplerInfo.binding.groupIndex][samplerInfo.binding.bindingIndex].index;
                        bindGroupLayoutEntries[samplerInfo.binding.groupIndex][binding].sampler.type = samplerType;
                    }
                    bitVal = bitVal << 1;
                }
            }
        }
        const bindGroupLayouts = [];
        for (let i = 0; i < bindGroupLayoutEntries.length; ++i) {
            bindGroupLayouts[i] = this._device.createBindGroupLayout({
                entries: bindGroupLayoutEntries[i],
            });
        }
        webgpuPipelineContext.bindGroupLayouts[this._textureState] = bindGroupLayouts;
        return this._device.createPipelineLayout({ bindGroupLayouts });
    }
    _getVertexInputDescriptor(effect) {
        const descriptors = [];
        const webgpuPipelineContext = effect._pipelineContext;
        const attributes = webgpuPipelineContext.shaderProcessingContext.attributeNamesFromEffect;
        const locations = webgpuPipelineContext.shaderProcessingContext.attributeLocationsFromEffect;
        let currentGPUBuffer;
        let currentGPUAttributes;
        for (let index = 0; index < attributes.length; index++) {
            const location = locations[index];
            let vertexBuffer = (this._overrideVertexBuffers && this._overrideVertexBuffers[attributes[index]]) ?? this._vertexBuffers[attributes[index]];
            if (!vertexBuffer) {
                // In WebGL it's valid to not bind a vertex buffer to an attribute, but it's not valid in WebGPU
                // So we must bind a dummy buffer when we are not given one for a specific attribute
                vertexBuffer = this._emptyVertexBuffer;
            }
            let buffer = vertexBuffer.effectiveBuffer?.underlyingResource;
            // We reuse the same GPUVertexBufferLayout for all attributes that use the same underlying GPU buffer (and for attributes that follow each other in the attributes array)
            let offset = vertexBuffer.effectiveByteOffset;
            const invalidOffsetRange = !vertexBuffer._validOffsetRange;
            if (!(currentGPUBuffer && currentGPUAttributes && currentGPUBuffer === buffer) || invalidOffsetRange) {
                const vertexBufferDescriptor = {
                    arrayStride: vertexBuffer.effectiveByteStride,
                    stepMode: vertexBuffer.getIsInstanced() ? "instance" /* WebGPUConstants.VertexStepMode.Instance */ : "vertex" /* WebGPUConstants.VertexStepMode.Vertex */,
                    attributes: [],
                };
                descriptors.push(vertexBufferDescriptor);
                currentGPUAttributes = vertexBufferDescriptor.attributes;
                if (invalidOffsetRange) {
                    offset = 0; // the offset will be set directly in the setVertexBuffer call
                    buffer = null; // buffer can't be reused
                }
            }
            currentGPUAttributes.push({
                shaderLocation: location,
                offset,
                format: WebGPUCacheRenderPipeline._GetVertexInputDescriptorFormat(vertexBuffer),
            });
            currentGPUBuffer = buffer;
        }
        return descriptors;
    }
    _createRenderPipeline(effect, topology, sampleCount) {
        const webgpuPipelineContext = effect._pipelineContext;
        const inputStateDescriptor = this._getVertexInputDescriptor(effect);
        const pipelineLayout = this._createPipelineLayout(webgpuPipelineContext);
        const colorStates = [];
        const alphaBlend = this._getAphaBlendState();
        const colorBlend = this._getColorBlendState();
        if (this._vertexBuffers) {
            checkNonFloatVertexBuffers(this._vertexBuffers, effect);
        }
        if (this._mrtAttachments1 > 0) {
            for (let i = 0; i < this._mrtFormats.length; ++i) {
                const format = this._mrtFormats[i];
                if (format) {
                    const descr = {
                        format,
                        writeMask: (this._mrtEnabledMask & (1 << i)) !== 0 ? this._writeMask : 0,
                    };
                    if (alphaBlend && colorBlend) {
                        descr.blend = {
                            alpha: alphaBlend,
                            color: colorBlend,
                        };
                    }
                    colorStates.push(descr);
                }
                else {
                    colorStates.push(null);
                }
            }
        }
        else {
            if (this._webgpuColorFormat[0]) {
                const descr = {
                    format: this._webgpuColorFormat[0],
                    writeMask: this._writeMask,
                };
                if (alphaBlend && colorBlend) {
                    descr.blend = {
                        alpha: alphaBlend,
                        color: colorBlend,
                    };
                }
                colorStates.push(descr);
            }
            else {
                colorStates.push(null);
            }
        }
        const stencilFrontBack = {
            compare: WebGPUCacheRenderPipeline._GetCompareFunction(this._stencilEnabled ? this._stencilFrontCompare : 7 /* ALWAYS */),
            depthFailOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilEnabled ? this._stencilFrontDepthFailOp : 1 /* KEEP */),
            failOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilEnabled ? this._stencilFrontFailOp : 1 /* KEEP */),
            passOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilEnabled ? this._stencilFrontPassOp : 1 /* KEEP */),
        };
        const topologyIsTriangle = topology === "triangle-list" /* WebGPUConstants.PrimitiveTopology.TriangleList */ || topology === "triangle-strip" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */;
        let stripIndexFormat = undefined;
        if (topology === "line-strip" /* WebGPUConstants.PrimitiveTopology.LineStrip */ || topology === "triangle-strip" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */) {
            stripIndexFormat = !this._indexBuffer || this._indexBuffer.is32Bits ? "uint32" /* WebGPUConstants.IndexFormat.Uint32 */ : "uint16" /* WebGPUConstants.IndexFormat.Uint16 */;
        }
        const depthStencilFormatHasStencil = this._webgpuDepthStencilFormat ? WebGPUTextureHelper.HasStencilAspect(this._webgpuDepthStencilFormat) : false;
        return this._device.createRenderPipeline({
            label: `RenderPipeline_${colorStates[0]?.format ?? "nooutput"}_${this._webgpuDepthStencilFormat ?? "nodepth"}_samples${sampleCount}_textureState${this._textureState}`,
            layout: pipelineLayout,
            vertex: {
                module: webgpuPipelineContext.stages.vertexStage.module,
                entryPoint: webgpuPipelineContext.stages.vertexStage.entryPoint,
                buffers: inputStateDescriptor,
            },
            primitive: {
                topology,
                stripIndexFormat,
                frontFace: this._frontFace === 1 ? "ccw" /* WebGPUConstants.FrontFace.CCW */ : "cw" /* WebGPUConstants.FrontFace.CW */,
                cullMode: !this._cullEnabled ? "none" /* WebGPUConstants.CullMode.None */ : this._cullFace === 2 ? "front" /* WebGPUConstants.CullMode.Front */ : "back" /* WebGPUConstants.CullMode.Back */,
            },
            fragment: !webgpuPipelineContext.stages.fragmentStage
                ? undefined
                : {
                    module: webgpuPipelineContext.stages.fragmentStage.module,
                    entryPoint: webgpuPipelineContext.stages.fragmentStage.entryPoint,
                    targets: colorStates,
                },
            multisample: {
                count: sampleCount,
                /*mask,
                alphaToCoverageEnabled,*/
            },
            depthStencil: this._webgpuDepthStencilFormat === undefined
                ? undefined
                : {
                    depthWriteEnabled: this._depthWriteEnabled,
                    depthCompare: this._depthTestEnabled ? WebGPUCacheRenderPipeline._GetCompareFunction(this._depthCompare) : "always" /* WebGPUConstants.CompareFunction.Always */,
                    format: this._webgpuDepthStencilFormat,
                    stencilFront: this._stencilEnabled && depthStencilFormatHasStencil ? stencilFrontBack : undefined,
                    stencilBack: this._stencilEnabled && depthStencilFormatHasStencil ? stencilFrontBack : undefined,
                    stencilReadMask: this._stencilEnabled && depthStencilFormatHasStencil ? this._stencilReadMask : undefined,
                    stencilWriteMask: this._stencilEnabled && depthStencilFormatHasStencil ? this._stencilWriteMask : undefined,
                    depthBias: this._depthBias,
                    depthBiasClamp: topologyIsTriangle ? this._depthBiasClamp : 0,
                    depthBiasSlopeScale: topologyIsTriangle ? this._depthBiasSlopeScale : 0,
                },
        });
    }
}
WebGPUCacheRenderPipeline.NumCacheHitWithoutHash = 0;
WebGPUCacheRenderPipeline.NumCacheHitWithHash = 0;
WebGPUCacheRenderPipeline.NumCacheMiss = 0;
WebGPUCacheRenderPipeline.NumPipelineCreationLastFrame = 0;
WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame = 0;
//# sourceMappingURL=webgpuCacheRenderPipeline.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheRenderPipelineTree.js

/** @internal */
class NodeState {
    constructor() {
        this.values = {};
    }
    count() {
        let countNode = 0, countPipeline = this.pipeline ? 1 : 0;
        for (const value in this.values) {
            const node = this.values[value];
            const [childCountNodes, childCoundPipeline] = node.count();
            countNode += childCountNodes;
            countPipeline += childCoundPipeline;
            countNode++;
        }
        return [countNode, countPipeline];
    }
}
/** @internal */
class WebGPUCacheRenderPipelineTree extends WebGPUCacheRenderPipeline {
    static GetNodeCounts() {
        const counts = WebGPUCacheRenderPipelineTree._Cache.count();
        return { nodeCount: counts[0], pipelineCount: counts[1] };
    }
    static _GetPipelines(node, pipelines, curPath, curPathLen) {
        if (node.pipeline) {
            const path = curPath.slice();
            path.length = curPathLen;
            pipelines.push(path);
        }
        for (const value in node.values) {
            const nnode = node.values[value];
            curPath[curPathLen] = parseInt(value);
            WebGPUCacheRenderPipelineTree._GetPipelines(nnode, pipelines, curPath, curPathLen + 1);
        }
    }
    static GetPipelines() {
        const pipelines = [];
        WebGPUCacheRenderPipelineTree._GetPipelines(WebGPUCacheRenderPipelineTree._Cache, pipelines, [], 0);
        return pipelines;
    }
    static ResetCache() {
        WebGPUCacheRenderPipelineTree._Cache = new NodeState();
    }
    reset() {
        this._nodeStack = [];
        this._nodeStack[0] = WebGPUCacheRenderPipelineTree._Cache;
        super.reset();
    }
    _getRenderPipeline(param) {
        let node = this._nodeStack[this._stateDirtyLowestIndex];
        for (let i = this._stateDirtyLowestIndex; i < this._statesLength; ++i) {
            let nn = node.values[this._states[i]];
            if (!nn) {
                nn = new NodeState();
                node.values[this._states[i]] = nn;
            }
            node = nn;
            this._nodeStack[i + 1] = node;
        }
        param.token = node;
        param.pipeline = node.pipeline;
    }
    _setRenderPipeline(param) {
        param.token.pipeline = param.pipeline;
    }
}
WebGPUCacheRenderPipelineTree._Cache = new NodeState();
//# sourceMappingURL=webgpuCacheRenderPipelineTree.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/stencilStateComposer.js
var stencilStateComposer = __webpack_require__(82724);
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuStencilStateComposer.js

/**
 * @internal
 **/
class WebGPUStencilStateComposer extends stencilStateComposer/* StencilStateComposer */.u {
    constructor(cache) {
        super(false);
        this._cache = cache;
        this.reset();
    }
    get func() {
        return this._func;
    }
    set func(value) {
        if (this._func === value) {
            return;
        }
        this._func = value;
        this._cache.setStencilCompare(value);
    }
    get funcMask() {
        return this._funcMask;
    }
    set funcMask(value) {
        if (this._funcMask === value) {
            return;
        }
        this._funcMask = value;
        this._cache.setStencilReadMask(value);
    }
    get opStencilFail() {
        return this._opStencilFail;
    }
    set opStencilFail(value) {
        if (this._opStencilFail === value) {
            return;
        }
        this._opStencilFail = value;
        this._cache.setStencilFailOp(value);
    }
    get opDepthFail() {
        return this._opDepthFail;
    }
    set opDepthFail(value) {
        if (this._opDepthFail === value) {
            return;
        }
        this._opDepthFail = value;
        this._cache.setStencilDepthFailOp(value);
    }
    get opStencilDepthPass() {
        return this._opStencilDepthPass;
    }
    set opStencilDepthPass(value) {
        if (this._opStencilDepthPass === value) {
            return;
        }
        this._opStencilDepthPass = value;
        this._cache.setStencilPassOp(value);
    }
    get mask() {
        return this._mask;
    }
    set mask(value) {
        if (this._mask === value) {
            return;
        }
        this._mask = value;
        this._cache.setStencilWriteMask(value);
    }
    get enabled() {
        return this._enabled;
    }
    set enabled(value) {
        if (this._enabled === value) {
            return;
        }
        this._enabled = value;
        this._cache.setStencilEnabled(value);
    }
    reset() {
        super.reset();
        this._cache.resetStencilState();
    }
    apply() {
        const stencilMaterialEnabled = this.stencilMaterial?.enabled;
        this.enabled = stencilMaterialEnabled ? this.stencilMaterial.enabled : this.stencilGlobal.enabled;
        if (!this.enabled) {
            return;
        }
        this.func = stencilMaterialEnabled ? this.stencilMaterial.func : this.stencilGlobal.func;
        this.funcRef = stencilMaterialEnabled ? this.stencilMaterial.funcRef : this.stencilGlobal.funcRef;
        this.funcMask = stencilMaterialEnabled ? this.stencilMaterial.funcMask : this.stencilGlobal.funcMask;
        this.opStencilFail = stencilMaterialEnabled ? this.stencilMaterial.opStencilFail : this.stencilGlobal.opStencilFail;
        this.opDepthFail = stencilMaterialEnabled ? this.stencilMaterial.opDepthFail : this.stencilGlobal.opDepthFail;
        this.opStencilDepthPass = stencilMaterialEnabled ? this.stencilMaterial.opStencilDepthPass : this.stencilGlobal.opStencilDepthPass;
        this.mask = stencilMaterialEnabled ? this.stencilMaterial.mask : this.stencilGlobal.mask;
    }
}
//# sourceMappingURL=webgpuStencilStateComposer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/depthCullingState.js
var depthCullingState = __webpack_require__(86867);
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuDepthCullingState.js

/**
 * @internal
 **/
class WebGPUDepthCullingState extends depthCullingState/* DepthCullingState */.N {
    /**
     * Initializes the state.
     * @param cache
     */
    constructor(cache) {
        super(false);
        this._cache = cache;
        this.reset();
    }
    get zOffset() {
        return this._zOffset;
    }
    set zOffset(value) {
        if (this._zOffset === value) {
            return;
        }
        this._zOffset = value;
        this._isZOffsetDirty = true;
        this._cache.setDepthBiasSlopeScale(value);
    }
    get zOffsetUnits() {
        return this._zOffsetUnits;
    }
    set zOffsetUnits(value) {
        if (this._zOffsetUnits === value) {
            return;
        }
        this._zOffsetUnits = value;
        this._isZOffsetDirty = true;
        this._cache.setDepthBias(value);
    }
    get cullFace() {
        return this._cullFace;
    }
    set cullFace(value) {
        if (this._cullFace === value) {
            return;
        }
        this._cullFace = value;
        this._isCullFaceDirty = true;
        this._cache.setCullFace(value ?? 1);
    }
    get cull() {
        return this._cull;
    }
    set cull(value) {
        if (this._cull === value) {
            return;
        }
        this._cull = value;
        this._isCullDirty = true;
        this._cache.setCullEnabled(!!value);
    }
    get depthFunc() {
        return this._depthFunc;
    }
    set depthFunc(value) {
        if (this._depthFunc === value) {
            return;
        }
        this._depthFunc = value;
        this._isDepthFuncDirty = true;
        this._cache.setDepthCompare(value);
    }
    get depthMask() {
        return this._depthMask;
    }
    set depthMask(value) {
        if (this._depthMask === value) {
            return;
        }
        this._depthMask = value;
        this._isDepthMaskDirty = true;
        this._cache.setDepthWriteEnabled(value);
    }
    get depthTest() {
        return this._depthTest;
    }
    set depthTest(value) {
        if (this._depthTest === value) {
            return;
        }
        this._depthTest = value;
        this._isDepthTestDirty = true;
        this._cache.setDepthTestEnabled(value);
    }
    get frontFace() {
        return this._frontFace;
    }
    set frontFace(value) {
        if (this._frontFace === value) {
            return;
        }
        this._frontFace = value;
        this._isFrontFaceDirty = true;
        this._cache.setFrontFace(value ?? 2);
    }
    reset() {
        super.reset();
        this._cache.resetDepthCullingState();
    }
    apply() {
        // nothing to do
    }
}
//# sourceMappingURL=webgpuDepthCullingState.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/externalTexture.js


/**
 * Class used to store an external texture (like GPUExternalTexture in WebGPU)
 */
class ExternalTexture {
    /**
     * Checks if a texture is an external or internal texture
     * @param texture the external or internal texture
     * @returns true if the texture is an external texture, else false
     */
    static IsExternalTexture(texture) {
        return texture.underlyingResource !== undefined;
    }
    /**
     * Get the class name of the texture.
     * @returns "ExternalTexture"
     */
    getClassName() {
        return "ExternalTexture";
    }
    /**
     * Gets the underlying texture object
     */
    get underlyingResource() {
        return this._video;
    }
    /**
     * Constructs the texture
     * @param video The video the texture should be wrapped around
     */
    constructor(video) {
        /**
         * Gets a boolean indicating if the texture uses mipmaps
         */
        this.useMipMaps = false;
        /**
         * The type of the underlying texture is implementation dependent, so return "UNDEFINED" for the type
         */
        this.type = 16;
        /**
         * The format of the underlying texture is implementation dependent, so return "UNDEFINED" for the format
         */
        this.format = 4294967295;
        this._video = video;
        this.uniqueId = Textures_internalTexture/* InternalTexture */.hV._Counter++;
    }
    /**
     * Get if the texture is ready to be used (downloaded, converted, mip mapped...).
     * @returns true if fully ready
     */
    isReady() {
        return this._video.readyState >= this._video.HAVE_CURRENT_DATA;
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() { }
}
//# sourceMappingURL=externalTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuMaterialContext.js
/* eslint-disable babylonjs/available */
/* eslint-disable jsdoc/require-jsdoc */



/** @internal */
class WebGPUMaterialContext {
    get forceBindGroupCreation() {
        // If there is at least one external texture to bind, we must recreate the bind groups each time
        // because we need to retrieve a new texture each frame (by calling device.importExternalTexture)
        return this._numExternalTextures > 0;
    }
    get hasFloatOrDepthTextures() {
        return this._numFloatOrDepthTextures > 0;
    }
    constructor() {
        this.uniqueId = WebGPUMaterialContext._Counter++;
        this.updateId = 0;
        this.textureState = 0;
        this.reset();
    }
    reset() {
        this.samplers = {};
        this.textures = {};
        this.isDirty = true;
        this._numFloatOrDepthTextures = 0;
        this._numExternalTextures = 0;
    }
    setSampler(name, sampler) {
        let samplerCache = this.samplers[name];
        let currentHashCode = -1;
        if (!samplerCache) {
            this.samplers[name] = samplerCache = { sampler, hashCode: 0 };
        }
        else {
            currentHashCode = samplerCache.hashCode;
        }
        samplerCache.sampler = sampler;
        samplerCache.hashCode = sampler ? WebGPUCacheSampler.GetSamplerHashCode(sampler) : 0;
        const isDirty = currentHashCode !== samplerCache.hashCode;
        if (isDirty) {
            this.updateId++;
        }
        this.isDirty || (this.isDirty = isDirty);
    }
    setTexture(name, texture) {
        let textureCache = this.textures[name];
        let currentTextureId = -1;
        if (!textureCache) {
            this.textures[name] = textureCache = { texture, isFloatOrDepthTexture: false, isExternalTexture: false };
        }
        else {
            currentTextureId = textureCache.texture?.uniqueId ?? -1;
        }
        if (textureCache.isExternalTexture) {
            this._numExternalTextures--;
        }
        if (textureCache.isFloatOrDepthTexture) {
            this._numFloatOrDepthTextures--;
        }
        if (texture) {
            textureCache.isFloatOrDepthTexture =
                texture.type === 1 ||
                    (texture.format >= 13 && texture.format <= 18);
            textureCache.isExternalTexture = ExternalTexture.IsExternalTexture(texture);
            if (textureCache.isFloatOrDepthTexture) {
                this._numFloatOrDepthTextures++;
            }
            if (textureCache.isExternalTexture) {
                this._numExternalTextures++;
            }
        }
        else {
            textureCache.isFloatOrDepthTexture = false;
            textureCache.isExternalTexture = false;
        }
        textureCache.texture = texture;
        const isDirty = currentTextureId !== (texture?.uniqueId ?? -1);
        if (isDirty) {
            this.updateId++;
        }
        this.isDirty || (this.isDirty = isDirty);
    }
}
WebGPUMaterialContext._Counter = 0;
//# sourceMappingURL=webgpuMaterialContext.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuDrawContext.js

/** @internal */
class WebGPUDrawContext {
    isDirty(materialContextUpdateId) {
        return this._isDirty || this._materialContextUpdateId !== materialContextUpdateId;
    }
    resetIsDirty(materialContextUpdateId) {
        this._isDirty = false;
        this._materialContextUpdateId = materialContextUpdateId;
    }
    get useInstancing() {
        return this._useInstancing;
    }
    set useInstancing(use) {
        if (this._useInstancing === use) {
            return;
        }
        if (!use) {
            if (this.indirectDrawBuffer) {
                this._bufferManager.releaseBuffer(this.indirectDrawBuffer);
            }
            this.indirectDrawBuffer = undefined;
            this._indirectDrawData = undefined;
        }
        else {
            this.indirectDrawBuffer = this._bufferManager.createRawBuffer(20, BufferUsage.CopyDst | BufferUsage.Indirect | BufferUsage.Storage, undefined, "IndirectDrawBuffer");
            this._indirectDrawData = new Uint32Array(5);
            this._indirectDrawData[3] = 0;
            this._indirectDrawData[4] = 0;
        }
        this._useInstancing = use;
        this._currentInstanceCount = -1;
    }
    constructor(bufferManager) {
        this._bufferManager = bufferManager;
        this.uniqueId = WebGPUDrawContext._Counter++;
        this._useInstancing = false;
        this._currentInstanceCount = 0;
        this.reset();
    }
    reset() {
        this.buffers = {};
        this._isDirty = true;
        this._materialContextUpdateId = 0;
        this.fastBundle = undefined;
        this.bindGroups = undefined;
    }
    setBuffer(name, buffer) {
        this._isDirty || (this._isDirty = buffer?.uniqueId !== this.buffers[name]?.uniqueId);
        this.buffers[name] = buffer;
    }
    setIndirectData(indexOrVertexCount, instanceCount, firstIndexOrVertex) {
        if (instanceCount === this._currentInstanceCount || !this.indirectDrawBuffer || !this._indirectDrawData) {
            // The current buffer is already up to date so do nothing
            // Note that we only check for instanceCount and not indexOrVertexCount nor firstIndexOrVertex because those values
            // are supposed to not change during the lifetime of a draw context
            return;
        }
        this._currentInstanceCount = instanceCount;
        this._indirectDrawData[0] = indexOrVertexCount;
        this._indirectDrawData[1] = instanceCount;
        this._indirectDrawData[2] = firstIndexOrVertex;
        this._bufferManager.setRawData(this.indirectDrawBuffer, 0, this._indirectDrawData, 0, 20);
    }
    dispose() {
        if (this.indirectDrawBuffer) {
            this._bufferManager.releaseBuffer(this.indirectDrawBuffer);
            this.indirectDrawBuffer = undefined;
            this._indirectDrawData = undefined;
        }
        this.fastBundle = undefined;
        this.bindGroups = undefined;
        this.buffers = undefined;
    }
}
WebGPUDrawContext._Counter = 0;
//# sourceMappingURL=webgpuDrawContext.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheBindGroups.js
/* eslint-disable babylonjs/available */
/* eslint-disable jsdoc/require-jsdoc */

/**
 * Sampler hash codes are 19 bits long, so using a start value of 2^20 for buffer ids will ensure we can't have any collision with the sampler hash codes
 */
const bufferIdStart = 1 << 20;
/**
 * textureIdStart is added to texture ids to ensure we can't have any collision with the buffer ids / sampler hash codes.
 * 2^35 for textureIdStart means we can have:
 * - 2^(35-20) = 2^15 = 32768 possible buffer ids
 * - 2^(53-35) = 2^18 = 524288 possible texture ids
 */
const textureIdStart = 2 ** 35;
class WebGPUBindGroupCacheNode {
    constructor() {
        this.values = {};
    }
}
/** @internal */
class WebGPUCacheBindGroups {
    static get Statistics() {
        return {
            totalCreated: WebGPUCacheBindGroups.NumBindGroupsCreatedTotal,
            lastFrameCreated: WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame,
            lookupLastFrame: WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame,
            noLookupLastFrame: WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame,
        };
    }
    static ResetCache() {
        WebGPUCacheBindGroups._Cache = new WebGPUBindGroupCacheNode();
        WebGPUCacheBindGroups.NumBindGroupsCreatedTotal = 0;
        WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = 0;
        WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = 0;
        WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = 0;
        WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0;
        WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0;
        WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0;
    }
    constructor(device, cacheSampler, engine) {
        this.disabled = false;
        this._device = device;
        this._cacheSampler = cacheSampler;
        this._engine = engine;
    }
    endFrame() {
        WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame;
        WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame;
        WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame;
        WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0;
        WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0;
        WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0;
    }
    /**
     * Cache is currently based on the uniform/storage buffers, samplers and textures used by the binding groups.
     * Note that all uniform buffers have an offset of 0 in Babylon and we don't have a use case where we would have the same buffer used with different capacity values:
     * that means we don't need to factor in the offset/size of the buffer in the cache, only the id
     * @param webgpuPipelineContext
     * @param drawContext
     * @param materialContext
     * @returns a bind group array
     */
    getBindGroups(webgpuPipelineContext, drawContext, materialContext) {
        let bindGroups = undefined;
        let node = WebGPUCacheBindGroups._Cache;
        const cacheIsDisabled = this.disabled || materialContext.forceBindGroupCreation;
        if (!cacheIsDisabled) {
            if (!drawContext.isDirty(materialContext.updateId) && !materialContext.isDirty) {
                WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame++;
                return drawContext.bindGroups;
            }
            for (const bufferName of webgpuPipelineContext.shaderProcessingContext.bufferNames) {
                const uboId = (drawContext.buffers[bufferName]?.uniqueId ?? 0) + bufferIdStart;
                let nextNode = node.values[uboId];
                if (!nextNode) {
                    nextNode = new WebGPUBindGroupCacheNode();
                    node.values[uboId] = nextNode;
                }
                node = nextNode;
            }
            for (const samplerName of webgpuPipelineContext.shaderProcessingContext.samplerNames) {
                const samplerHashCode = materialContext.samplers[samplerName]?.hashCode ?? 0;
                let nextNode = node.values[samplerHashCode];
                if (!nextNode) {
                    nextNode = new WebGPUBindGroupCacheNode();
                    node.values[samplerHashCode] = nextNode;
                }
                node = nextNode;
            }
            for (const textureName of webgpuPipelineContext.shaderProcessingContext.textureNames) {
                const textureId = (materialContext.textures[textureName]?.texture?.uniqueId ?? 0) + textureIdStart;
                let nextNode = node.values[textureId];
                if (!nextNode) {
                    nextNode = new WebGPUBindGroupCacheNode();
                    node.values[textureId] = nextNode;
                }
                node = nextNode;
            }
            bindGroups = node.bindGroups;
        }
        drawContext.resetIsDirty(materialContext.updateId);
        materialContext.isDirty = false;
        if (bindGroups) {
            drawContext.bindGroups = bindGroups;
            WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame++;
            return bindGroups;
        }
        bindGroups = [];
        drawContext.bindGroups = bindGroups;
        if (!cacheIsDisabled) {
            node.bindGroups = bindGroups;
        }
        WebGPUCacheBindGroups.NumBindGroupsCreatedTotal++;
        WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame++;
        const bindGroupLayouts = webgpuPipelineContext.bindGroupLayouts[materialContext.textureState];
        for (let i = 0; i < webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries.length; i++) {
            const setDefinition = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries[i];
            const entries = webgpuPipelineContext.shaderProcessingContext.bindGroupEntries[i];
            for (let j = 0; j < setDefinition.length; j++) {
                const entry = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries[i][j];
                const entryInfo = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding];
                const name = entryInfo.nameInArrayOfTexture ?? entryInfo.name;
                if (entry.sampler) {
                    const bindingInfo = materialContext.samplers[name];
                    if (bindingInfo) {
                        const sampler = bindingInfo.sampler;
                        if (!sampler) {
                            if (this._engine.dbgSanityChecks) {
                                logger/* Logger */.V.Error(`Trying to bind a null sampler! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => (key === "texture" ? "<no dump>" : value))}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);
                            }
                            continue;
                        }
                        entries[j].resource = this._cacheSampler.getSampler(sampler, false, bindingInfo.hashCode, sampler.label);
                    }
                    else {
                        logger/* Logger */.V.Error(`Sampler "${name}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === "texture" || key === "sampler" ? "<no dump>" : value)}`, 50);
                    }
                }
                else if (entry.texture || entry.storageTexture) {
                    const bindingInfo = materialContext.textures[name];
                    if (bindingInfo) {
                        if (this._engine.dbgSanityChecks && bindingInfo.texture === null) {
                            logger/* Logger */.V.Error(`Trying to bind a null texture! entry=${JSON.stringify(entry)}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "<no dump>" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);
                            continue;
                        }
                        const hardwareTexture = bindingInfo.texture._hardwareTexture;
                        if (this._engine.dbgSanityChecks &&
                            (!hardwareTexture || (entry.texture && !hardwareTexture.view) || (entry.storageTexture && !hardwareTexture.viewForWriting))) {
                            logger/* Logger */.V.Error(`Trying to bind a null gpu texture or view! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => (key === "texture" ? "<no dump>" : value))}, isReady=${bindingInfo.texture?.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);
                            continue;
                        }
                        entries[j].resource = entry.storageTexture ? hardwareTexture.viewForWriting : hardwareTexture.view;
                    }
                    else {
                        logger/* Logger */.V.Error(`Texture "${name}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === "texture" || key === "sampler" ? "<no dump>" : value)}`, 50);
                    }
                }
                else if (entry.externalTexture) {
                    const bindingInfo = materialContext.textures[name];
                    if (bindingInfo) {
                        if (this._engine.dbgSanityChecks && bindingInfo.texture === null) {
                            logger/* Logger */.V.Error(`Trying to bind a null external texture! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => (key === "texture" ? "<no dump>" : value))}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);
                            continue;
                        }
                        const externalTexture = bindingInfo.texture.underlyingResource;
                        if (this._engine.dbgSanityChecks && !externalTexture) {
                            logger/* Logger */.V.Error(`Trying to bind a null gpu external texture! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => (key === "texture" ? "<no dump>" : value))}, isReady=${bindingInfo.texture?.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);
                            continue;
                        }
                        entries[j].resource = this._device.importExternalTexture({ source: externalTexture });
                    }
                    else {
                        logger/* Logger */.V.Error(`Texture "${name}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === "texture" || key === "sampler" ? "<no dump>" : value)}`, 50);
                    }
                }
                else if (entry.buffer) {
                    const dataBuffer = drawContext.buffers[name];
                    if (dataBuffer) {
                        const webgpuBuffer = dataBuffer.underlyingResource;
                        entries[j].resource.buffer = webgpuBuffer;
                        entries[j].resource.size = dataBuffer.capacity;
                    }
                    else {
                        logger/* Logger */.V.Error(`Can't find buffer "${name}". entry=${JSON.stringify(entry)}, buffers=${JSON.stringify(drawContext.buffers)}, drawContext.uniqueId=${drawContext.uniqueId}`, 50);
                    }
                }
            }
            const groupLayout = bindGroupLayouts[i];
            bindGroups[i] = this._device.createBindGroup({
                layout: groupLayout,
                entries,
            });
        }
        return bindGroups;
    }
}
WebGPUCacheBindGroups.NumBindGroupsCreatedTotal = 0;
WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = 0;
WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = 0;
WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = 0;
WebGPUCacheBindGroups._Cache = new WebGPUBindGroupCacheNode();
WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0;
WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0;
WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0;
//# sourceMappingURL=webgpuCacheBindGroups.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/clearQuad.vertex.js
// Do not edit.

const clearQuad_vertex_name = "clearQuadVertexShader";
const clearQuad_vertex_shader = `uniform depthValue: f32;const pos=array(
vec2f(-1.0,1.0),
vec2f(1.0,1.0),
vec2f(-1.0,-1.0),
vec2f(1.0,-1.0)
);
#define CUSTOM_VERTEX_DEFINITIONS
@vertex
fn main(input : VertexInputs)->FragmentInputs {
#define CUSTOM_VERTEX_MAIN_BEGIN
vertexOutputs.position=vec4f(pos[input.vertexIndex],uniforms.depthValue,1.0);
#define CUSTOM_VERTEX_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[clearQuad_vertex_name] = clearQuad_vertex_shader;
/** @internal */
const clearQuadVertexShaderWGSL = { name: clearQuad_vertex_name, shader: clearQuad_vertex_shader };
//# sourceMappingURL=clearQuad.vertex.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/clearQuad.fragment.js
// Do not edit.

const clearQuad_fragment_name = "clearQuadPixelShader";
const clearQuad_fragment_shader = `uniform color: vec4f;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=uniforms.color;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[clearQuad_fragment_name] = clearQuad_fragment_shader;
/** @internal */
const clearQuadPixelShaderWGSL = { name: clearQuad_fragment_name, shader: clearQuad_fragment_shader };
//# sourceMappingURL=clearQuad.fragment.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuClearQuad.js







/** @internal */
class WebGPUClearQuad {
    setDepthStencilFormat(format) {
        this._depthTextureFormat = format;
        this._cacheRenderPipeline.setDepthStencilFormat(format);
    }
    setColorFormat(format) {
        this._cacheRenderPipeline.setColorFormat(format);
    }
    setMRTAttachments(attachments, textureArray, textureCount) {
        this._cacheRenderPipeline.setMRT(textureArray, textureCount);
        this._cacheRenderPipeline.setMRTAttachments(attachments);
    }
    constructor(device, engine, emptyVertexBuffer) {
        this._bindGroups = {};
        this._bundleCache = {};
        this._keyTemp = [];
        this._device = device;
        this._engine = engine;
        this._cacheRenderPipeline = new WebGPUCacheRenderPipelineTree(this._device, emptyVertexBuffer);
        this._cacheRenderPipeline.setDepthTestEnabled(false);
        this._cacheRenderPipeline.setStencilReadMask(0xff);
        this._effect = engine.createEffect("clearQuad", [], ["color", "depthValue"], undefined, undefined, undefined, undefined, undefined, undefined, 1 /* ShaderLanguage.WGSL */);
    }
    clear(renderPass, clearColor, clearDepth, clearStencil, sampleCount = 1) {
        let renderPass2;
        let bundle = null;
        let bundleKey;
        const isRTTPass = !!this._engine._currentRenderTarget;
        if (renderPass) {
            renderPass2 = renderPass;
        }
        else {
            let idx = 0;
            this._keyTemp.length = 0;
            for (let i = 0; i < this._cacheRenderPipeline.colorFormats.length; ++i) {
                this._keyTemp[idx++] = renderableTextureFormatToIndex[this._cacheRenderPipeline.colorFormats[i] ?? ""];
            }
            const depthStencilFormatIndex = renderableTextureFormatToIndex[this._depthTextureFormat ?? 0];
            this._keyTemp[idx] =
                (clearColor ? clearColor.r + clearColor.g * 256 + clearColor.b * 256 * 256 + clearColor.a * 256 * 256 * 256 : 0) +
                    (clearDepth ? 2 ** 32 : 0) +
                    (clearStencil ? 2 ** 33 : 0) +
                    (this._engine.useReverseDepthBuffer ? 2 ** 34 : 0) +
                    (isRTTPass ? 2 ** 35 : 0) +
                    (sampleCount > 1 ? 2 ** 36 : 0) +
                    depthStencilFormatIndex * 2 ** 37;
            bundleKey = this._keyTemp.join("_");
            bundle = this._bundleCache[bundleKey];
            if (bundle) {
                return bundle;
            }
            renderPass2 = this._device.createRenderBundleEncoder({
                label: "clearQuadRenderBundle",
                colorFormats: this._cacheRenderPipeline.colorFormats,
                depthStencilFormat: this._depthTextureFormat,
                sampleCount: WebGPUTextureHelper.GetSample(sampleCount),
            });
        }
        this._cacheRenderPipeline.setDepthWriteEnabled(!!clearDepth);
        this._cacheRenderPipeline.setStencilEnabled(!!clearStencil && !!this._depthTextureFormat && WebGPUTextureHelper.HasStencilAspect(this._depthTextureFormat));
        this._cacheRenderPipeline.setStencilWriteMask(clearStencil ? 0xff : 0);
        this._cacheRenderPipeline.setStencilCompare(clearStencil ? 519 : 512);
        this._cacheRenderPipeline.setStencilPassOp(clearStencil ? 7681 : 7680);
        this._cacheRenderPipeline.setWriteMask(clearColor ? 0xf : 0);
        const pipeline = this._cacheRenderPipeline.getRenderPipeline(7, this._effect, sampleCount);
        const webgpuPipelineContext = this._effect._pipelineContext;
        if (clearColor) {
            this._effect.setDirectColor4("color", clearColor);
        }
        this._effect.setFloat("depthValue", this._engine.useReverseDepthBuffer ? this._engine._clearReverseDepthValue : this._engine._clearDepthValue);
        webgpuPipelineContext.uniformBuffer.update();
        const bufferInternals = isRTTPass ? this._engine._ubInvertY : this._engine._ubDontInvertY;
        const bufferLeftOver = webgpuPipelineContext.uniformBuffer.getBuffer();
        const key = bufferLeftOver.uniqueId + "-" + bufferInternals.uniqueId;
        let bindGroups = this._bindGroups[key];
        if (!bindGroups) {
            const bindGroupLayouts = webgpuPipelineContext.bindGroupLayouts[0];
            bindGroups = this._bindGroups[key] = [];
            bindGroups.push(this._device.createBindGroup({
                label: `clearQuadBindGroup0-${key}`,
                layout: bindGroupLayouts[0],
                entries: [],
            }));
            if (!WebGPUShaderProcessingContext._SimplifiedKnownBindings) {
                bindGroups.push(this._device.createBindGroup({
                    label: `clearQuadBindGroup1-${key}`,
                    layout: bindGroupLayouts[1],
                    entries: [],
                }));
            }
            bindGroups.push(this._device.createBindGroup({
                label: `clearQuadBindGroup${WebGPUShaderProcessingContext._SimplifiedKnownBindings ? 1 : 2}-${key}`,
                layout: bindGroupLayouts[WebGPUShaderProcessingContext._SimplifiedKnownBindings ? 1 : 2],
                entries: [
                    {
                        binding: 0,
                        resource: {
                            buffer: bufferInternals.underlyingResource,
                            size: bufferInternals.capacity,
                        },
                    },
                    {
                        binding: 1,
                        resource: {
                            buffer: bufferLeftOver.underlyingResource,
                            size: bufferLeftOver.capacity,
                        },
                    },
                ],
            }));
        }
        renderPass2.setPipeline(pipeline);
        for (let i = 0; i < bindGroups.length; ++i) {
            renderPass2.setBindGroup(i, bindGroups[i]);
        }
        renderPass2.draw(4, 1, 0, 0);
        if (!renderPass) {
            bundle = renderPass2.finish();
            this._bundleCache[bundleKey] = bundle;
        }
        return bundle;
    }
}
//# sourceMappingURL=webgpuClearQuad.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuBundleList.js

/** @internal */
class WebGPURenderItemViewport {
    constructor(x, y, w, h) {
        this.x = Math.floor(x);
        this.y = Math.floor(y);
        this.w = Math.floor(w);
        this.h = Math.floor(h);
    }
    run(renderPass) {
        renderPass.setViewport(this.x, this.y, this.w, this.h, 0, 1);
    }
    clone() {
        return new WebGPURenderItemViewport(this.x, this.y, this.w, this.h);
    }
}
/** @internal */
class WebGPURenderItemScissor {
    constructor(x, y, w, h) {
        this.x = x;
        this.y = y;
        this.w = w;
        this.h = h;
    }
    run(renderPass) {
        renderPass.setScissorRect(this.x, this.y, this.w, this.h);
    }
    clone() {
        return new WebGPURenderItemScissor(this.x, this.y, this.w, this.h);
    }
}
/** @internal */
class WebGPURenderItemStencilRef {
    constructor(ref) {
        this.ref = ref;
    }
    run(renderPass) {
        renderPass.setStencilReference(this.ref);
    }
    clone() {
        return new WebGPURenderItemStencilRef(this.ref);
    }
}
/** @internal */
class WebGPURenderItemBlendColor {
    constructor(color) {
        this.color = color;
    }
    run(renderPass) {
        renderPass.setBlendConstant(this.color);
    }
    clone() {
        return new WebGPURenderItemBlendColor(this.color);
    }
}
/** @internal */
class WebGPURenderItemBeginOcclusionQuery {
    constructor(query) {
        this.query = query;
    }
    run(renderPass) {
        renderPass.beginOcclusionQuery(this.query);
    }
    clone() {
        return new WebGPURenderItemBeginOcclusionQuery(this.query);
    }
}
/** @internal */
class WebGPURenderItemEndOcclusionQuery {
    constructor() { }
    run(renderPass) {
        renderPass.endOcclusionQuery();
    }
    clone() {
        return new WebGPURenderItemEndOcclusionQuery();
    }
}
class WebGPURenderItemBundles {
    constructor() {
        this.bundles = [];
    }
    run(renderPass) {
        renderPass.executeBundles(this.bundles);
    }
    clone() {
        const cloned = new WebGPURenderItemBundles();
        cloned.bundles = this.bundles;
        return cloned;
    }
}
/** @internal */
class WebGPUBundleList {
    constructor(device) {
        this.numDrawCalls = 0;
        this._device = device;
        this._list = new Array(10);
        this._listLength = 0;
    }
    addBundle(bundle) {
        if (!this._currentItemIsBundle) {
            const item = new WebGPURenderItemBundles();
            this._list[this._listLength++] = item;
            this._currentBundleList = item.bundles;
            this._currentItemIsBundle = true;
        }
        if (bundle) {
            this._currentBundleList.push(bundle);
        }
    }
    _finishBundle() {
        if (this._currentItemIsBundle && this._bundleEncoder) {
            this._currentBundleList.push(this._bundleEncoder.finish());
            this._bundleEncoder = undefined;
            this._currentItemIsBundle = false;
        }
    }
    addItem(item) {
        this._finishBundle();
        this._list[this._listLength++] = item;
        this._currentItemIsBundle = false;
    }
    getBundleEncoder(colorFormats, depthStencilFormat, sampleCount) {
        if (!this._currentItemIsBundle) {
            this.addBundle();
            this._bundleEncoder = this._device.createRenderBundleEncoder({
                colorFormats,
                depthStencilFormat,
                sampleCount: WebGPUTextureHelper.GetSample(sampleCount),
            });
        }
        return this._bundleEncoder;
    }
    close() {
        this._finishBundle();
    }
    run(renderPass) {
        this.close();
        for (let i = 0; i < this._listLength; ++i) {
            this._list[i].run(renderPass);
        }
    }
    reset() {
        this._listLength = 0;
        this._currentItemIsBundle = false;
        this.numDrawCalls = 0;
    }
    clone() {
        this.close();
        const cloned = new WebGPUBundleList(this._device);
        cloned._list = new Array(this._listLength);
        cloned._listLength = this._listLength;
        cloned.numDrawCalls = this.numDrawCalls;
        for (let i = 0; i < this._listLength; ++i) {
            cloned._list[i] = this._list[i].clone();
        }
        return cloned;
    }
}
//# sourceMappingURL=webgpuBundleList.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuQuerySet.js

/** @internal */
class WebGPUQuerySet {
    get querySet() {
        return this._querySet;
    }
    constructor(engine, count, type, device, bufferManager, canUseMultipleBuffers = true, label) {
        this._dstBuffers = [];
        this._engine = engine;
        this._device = device;
        this._bufferManager = bufferManager;
        this._count = count;
        this._canUseMultipleBuffers = canUseMultipleBuffers;
        this._querySet = device.createQuerySet({
            label: label ?? "QuerySet",
            type,
            count,
        });
        this._queryBuffer = bufferManager.createRawBuffer(8 * count, BufferUsage.QueryResolve | BufferUsage.CopySrc, undefined, "QueryBuffer");
        if (!canUseMultipleBuffers) {
            this._dstBuffers.push(this._bufferManager.createRawBuffer(8 * this._count, BufferUsage.MapRead | BufferUsage.CopyDst, undefined, "QueryBufferNoMultipleBuffers"));
        }
    }
    _getBuffer(firstQuery, queryCount) {
        if (!this._canUseMultipleBuffers && this._dstBuffers.length === 0) {
            return null;
        }
        const encoderResult = this._device.createCommandEncoder();
        let buffer;
        if (this._dstBuffers.length === 0) {
            buffer = this._bufferManager.createRawBuffer(8 * this._count, BufferUsage.MapRead | BufferUsage.CopyDst, undefined, "QueryBufferAdditionalBuffer");
        }
        else {
            buffer = this._dstBuffers[this._dstBuffers.length - 1];
            this._dstBuffers.length--;
        }
        encoderResult.resolveQuerySet(this._querySet, firstQuery, queryCount, this._queryBuffer, 0);
        encoderResult.copyBufferToBuffer(this._queryBuffer, 0, buffer, 0, 8 * queryCount);
        this._device.queue.submit([encoderResult.finish()]);
        return buffer;
    }
    async readValues(firstQuery = 0, queryCount = 1) {
        const buffer = this._getBuffer(firstQuery, queryCount);
        if (buffer === null) {
            return null;
        }
        const engineId = this._engine.uniqueId;
        return buffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */).then(() => {
            const arrayBuf = new BigUint64Array(buffer.getMappedRange()).slice();
            buffer.unmap();
            this._dstBuffers[this._dstBuffers.length] = buffer;
            return arrayBuf;
        }, (err) => {
            if (this._engine.isDisposed || this._engine.uniqueId !== engineId) {
                // Engine disposed or context loss/restoration
                return null;
            }
            throw err;
        });
    }
    async readValue(firstQuery = 0) {
        const buffer = this._getBuffer(firstQuery, 1);
        if (buffer === null) {
            return null;
        }
        const engineId = this._engine.uniqueId;
        return buffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */).then(() => {
            const arrayBuf = new BigUint64Array(buffer.getMappedRange());
            const value = Number(arrayBuf[0]);
            buffer.unmap();
            this._dstBuffers[this._dstBuffers.length] = buffer;
            return value;
        }, (err) => {
            if (this._engine.isDisposed || this._engine.uniqueId !== engineId) {
                // Engine disposed or context loss/restoration
                return 0;
            }
            throw err;
        });
    }
    async readTwoValuesAndSubtract(firstQuery = 0) {
        const buffer = this._getBuffer(firstQuery, 2);
        if (buffer === null) {
            return null;
        }
        const engineId = this._engine.uniqueId;
        return buffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */).then(() => {
            const arrayBuf = new BigUint64Array(buffer.getMappedRange());
            const value = Number(arrayBuf[1] - arrayBuf[0]);
            buffer.unmap();
            this._dstBuffers[this._dstBuffers.length] = buffer;
            return value;
        }, (err) => {
            if (this._engine.isDisposed || this._engine.uniqueId !== engineId) {
                // Engine disposed or context loss/restoration
                return 0;
            }
            throw err;
        });
    }
    dispose() {
        this._querySet.destroy();
        this._bufferManager.releaseBuffer(this._queryBuffer);
        for (let i = 0; i < this._dstBuffers.length; ++i) {
            this._bufferManager.releaseBuffer(this._dstBuffers[i]);
        }
    }
}
//# sourceMappingURL=webgpuQuerySet.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuTimestampQuery.js



/** @internal */
class WebGPUTimestampQuery {
    get gpuFrameTimeCounter() {
        return this._gpuFrameTimeCounter;
    }
    constructor(engine, device, bufferManager) {
        this._enabled = false;
        this._gpuFrameTimeCounter = new perfCounter/* PerfCounter */.A();
        this._measureDurationState = 0;
        this._engine = engine;
        this._device = device;
        this._bufferManager = bufferManager;
    }
    get enable() {
        return this._enabled;
    }
    set enable(value) {
        if (this._enabled === value) {
            return;
        }
        this._enabled = value;
        this._measureDurationState = 0;
        if (value) {
            try {
                this._measureDuration = new WebGPUDurationMeasure(this._engine, this._device, this._bufferManager, 2000, "QuerySet_TimestampQuery");
            }
            catch (e) {
                this._enabled = false;
                logger/* Logger */.V.Error("Could not create a WebGPUDurationMeasure!\nError: " + e.message + "\nMake sure timestamp query is supported and enabled in your browser.");
                return;
            }
        }
        else {
            this._measureDuration.dispose();
        }
    }
    startFrame(commandEncoder) {
        if (this._enabled && this._measureDurationState === 0) {
            this._measureDuration.start(commandEncoder);
            this._measureDurationState = 1;
        }
    }
    endFrame(commandEncoder) {
        if (this._measureDurationState === 1) {
            this._measureDurationState = 2;
            this._measureDuration.stop(commandEncoder).then((duration) => {
                if (duration !== null && duration >= 0) {
                    this._gpuFrameTimeCounter.fetchNewFrame();
                    this._gpuFrameTimeCounter.addCount(duration, true);
                }
                this._measureDurationState = 0;
            });
        }
    }
    startPass(descriptor, index) {
        if (this._enabled) {
            this._measureDuration.startPass(descriptor, index);
        }
        else {
            descriptor.timestampWrites = undefined;
        }
    }
    endPass(index, gpuPerfCounter) {
        if (!this._enabled || !gpuPerfCounter) {
            return;
        }
        const currentFrameId = this._engine.frameId;
        this._measureDuration.stopPass(index).then((duration_) => {
            gpuPerfCounter._addDuration(currentFrameId, duration_ !== null && duration_ > 0 ? duration_ : 0);
        });
    }
    dispose() {
        this._measureDuration?.dispose();
    }
}
/** @internal */
class WebGPUDurationMeasure {
    constructor(engine, device, bufferManager, count = 2, querySetLabel) {
        this._count = count;
        this._querySet = new WebGPUQuerySet(engine, count, "timestamp" /* WebGPUConstants.QueryType.Timestamp */, device, bufferManager, true, querySetLabel);
    }
    start(encoder) {
        encoder.writeTimestamp?.(this._querySet.querySet, 0);
    }
    async stop(encoder) {
        encoder.writeTimestamp?.(this._querySet.querySet, 1);
        return encoder.writeTimestamp ? this._querySet.readTwoValuesAndSubtract(0) : 0;
    }
    startPass(descriptor, index) {
        if (index + 3 > this._count) {
            throw new Error("WebGPUDurationMeasure: index out of range (" + index + ")");
        }
        descriptor.timestampWrites = {
            querySet: this._querySet.querySet,
            beginningOfPassWriteIndex: index + 2,
            endOfPassWriteIndex: index + 3,
        };
    }
    async stopPass(index) {
        return this._querySet.readTwoValuesAndSubtract(index + 2);
    }
    dispose() {
        this._querySet.dispose();
    }
}
//# sourceMappingURL=webgpuTimestampQuery.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuOcclusionQuery.js

/** @internal */
class WebGPUOcclusionQuery {
    get querySet() {
        return this._querySet.querySet;
    }
    get hasQueries() {
        return this._currentTotalIndices !== this._availableIndices.length;
    }
    canBeginQuery(index) {
        if (this._frameQuerySetIsDirty === this._engine.frameId || this._queryFrameId[index] === this._engine.frameId) {
            return false;
        }
        const canBegin = this._engine._getCurrentRenderPassWrapper().renderPassDescriptor.occlusionQuerySet !== undefined;
        if (canBegin) {
            this._queryFrameId[index] = this._engine.frameId;
        }
        return canBegin;
    }
    constructor(engine, device, bufferManager, startCount = 50, incrementCount = 100) {
        this._availableIndices = [];
        this._frameQuerySetIsDirty = -1;
        this._queryFrameId = [];
        this._engine = engine;
        this._device = device;
        this._bufferManager = bufferManager;
        this._frameLastBuffer = -1;
        this._currentTotalIndices = 0;
        this._countIncrement = incrementCount;
        this._allocateNewIndices(startCount);
    }
    createQuery() {
        if (this._availableIndices.length === 0) {
            this._allocateNewIndices();
        }
        const index = this._availableIndices[this._availableIndices.length - 1];
        this._availableIndices.length--;
        return index;
    }
    deleteQuery(index) {
        this._availableIndices[this._availableIndices.length] = index;
    }
    isQueryResultAvailable(index) {
        this._retrieveQueryBuffer();
        return !!this._lastBuffer && index < this._lastBuffer.length;
    }
    getQueryResult(index) {
        return Number(this._lastBuffer?.[index] ?? -1);
    }
    _retrieveQueryBuffer() {
        if (this._lastBuffer && this._frameLastBuffer === this._engine.frameId) {
            return;
        }
        if (this._frameLastBuffer !== this._engine.frameId) {
            this._frameLastBuffer = this._engine.frameId;
            this._querySet.readValues(0, this._currentTotalIndices).then((arrayBuffer) => {
                this._lastBuffer = arrayBuffer;
            });
        }
    }
    _allocateNewIndices(numIndices) {
        numIndices = numIndices ?? this._countIncrement;
        this._delayQuerySetDispose();
        for (let i = 0; i < numIndices; ++i) {
            this._availableIndices.push(this._currentTotalIndices + i);
        }
        this._currentTotalIndices += numIndices;
        this._querySet = new WebGPUQuerySet(this._engine, this._currentTotalIndices, "occlusion" /* WebGPUConstants.QueryType.Occlusion */, this._device, this._bufferManager, false, "QuerySet_OcclusionQuery_count_" + this._currentTotalIndices);
        this._frameQuerySetIsDirty = this._engine.frameId;
    }
    _delayQuerySetDispose() {
        const querySet = this._querySet;
        if (querySet) {
            // Wait a bit before disposing of the queryset, in case some queries are still running for it
            setTimeout(() => querySet.dispose, 1000);
        }
    }
    dispose() {
        this._querySet?.dispose();
        this._availableIndices.length = 0;
    }
}
//# sourceMappingURL=webgpuOcclusionQuery.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuTintWASM.js


/** @internal */
class WebGPUTintWASM {
    async initTwgsl(twgslOptions) {
        if (WebGPUTintWASM._Twgsl) {
            return;
        }
        twgslOptions = twgslOptions || {};
        twgslOptions = {
            ...WebGPUTintWASM._TWgslDefaultOptions,
            ...twgslOptions,
        };
        if (twgslOptions.twgsl) {
            WebGPUTintWASM._Twgsl = twgslOptions.twgsl;
            return Promise.resolve();
        }
        if (twgslOptions.jsPath && twgslOptions.wasmPath) {
            await tools/* Tools */.S0.LoadBabylonScriptAsync(twgslOptions.jsPath);
        }
        if (self.twgsl) {
            WebGPUTintWASM._Twgsl = await self.twgsl(tools/* Tools */.S0.GetBabylonScriptURL(twgslOptions.wasmPath));
            return Promise.resolve();
        }
        return Promise.reject("twgsl is not available.");
    }
    convertSpirV2WGSL(code, disableUniformityAnalysis = false) {
        const ccode = WebGPUTintWASM._Twgsl.convertSpirV2WGSL(code, WebGPUTintWASM.DisableUniformityAnalysis || disableUniformityAnalysis);
        if (WebGPUTintWASM.ShowWGSLShaderCode) {
            logger/* Logger */.V.Log(ccode);
            logger/* Logger */.V.Log("***********************************************");
        }
        return WebGPUTintWASM.DisableUniformityAnalysis || disableUniformityAnalysis ? "diagnostic(off, derivative_uniformity);\n" + ccode : ccode;
    }
}
// Default twgsl options.
WebGPUTintWASM._TWgslDefaultOptions = {
    jsPath: `${tools/* Tools */.S0._DefaultCdnUrl}/twgsl/twgsl.js`,
    wasmPath: `${tools/* Tools */.S0._DefaultCdnUrl}/twgsl/twgsl.wasm`,
};
WebGPUTintWASM.ShowWGSLShaderCode = false;
WebGPUTintWASM.DisableUniformityAnalysis = false;
WebGPUTintWASM._Twgsl = null;
//# sourceMappingURL=webgpuTintWASM.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuSnapshotRendering.js

/** @internal */
class WebGPUSnapshotRendering {
    constructor(engine, renderingMode, bundleList) {
        this._record = false;
        this._play = false;
        this._playBundleListIndex = 0;
        this._allBundleLists = [];
        this._enabled = false;
        this._engine = engine;
        this._mode = renderingMode;
        this._bundleList = bundleList;
    }
    get enabled() {
        return this._enabled;
    }
    get play() {
        return this._play;
    }
    get record() {
        return this._record;
    }
    set enabled(activate) {
        this._allBundleLists.length = 0;
        this._record = this._enabled = activate;
        this._play = false;
        if (activate) {
            this._modeSaved = this._mode;
            this._mode = 0; // need to reset to standard for the recording pass to avoid some code being bypassed
        }
    }
    get mode() {
        return this._mode;
    }
    set mode(mode) {
        if (this._record) {
            this._modeSaved = mode;
        }
        else {
            this._mode = mode;
        }
    }
    endRenderPass(currentRenderPass) {
        if (!this._record && !this._play) {
            // Snapshot rendering mode is not enabled
            return false;
        }
        let bundleList;
        if (this._record) {
            bundleList = this._bundleList.clone();
            this._allBundleLists.push(bundleList);
            this._bundleList.reset();
        }
        else {
            // We are playing the snapshot
            if (this._playBundleListIndex >= this._allBundleLists.length) {
                throw new Error(`Invalid playBundleListIndex! Your snapshot is no longer valid for the current frame, you should recreate a new one. playBundleListIndex=${this._playBundleListIndex}, allBundleLists.length=${this._allBundleLists.length}}`);
            }
            bundleList = this._allBundleLists[this._playBundleListIndex++];
        }
        bundleList.run(currentRenderPass);
        if (this._mode === 1) {
            this._engine._reportDrawCall(bundleList.numDrawCalls);
        }
        return true;
    }
    endFrame() {
        if (this._record) {
            // We stop recording and switch to replay mode for the next frames
            this._record = false;
            this._play = true;
            this._mode = this._modeSaved;
        }
        this._playBundleListIndex = 0;
    }
    reset() {
        if (this._record) {
            this._mode = this._modeSaved;
        }
        this.enabled = false;
        this.enabled = true;
    }
}
//# sourceMappingURL=webgpuSnapshotRendering.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/sphericalPolynomial.js
var sphericalPolynomial = __webpack_require__(77517);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/performanceMonitor.js
var performanceMonitor = __webpack_require__(84085);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engine.common.js
var engine_common = __webpack_require__(79161);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effect.functions.js
var effect_functions = __webpack_require__(57647);
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuExternalTexture.js

/**
 * Nothing specific to WebGPU in this class, but the spec is not final yet so let's remove it later on
 * if it is not needed
 * @internal
 **/
class WebGPUExternalTexture extends ExternalTexture {
    constructor(video) {
        super(video);
    }
}
//# sourceMappingURL=webgpuExternalTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture.js




ThinWebGPUEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = false) {
    const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 3 /* InternalTextureSource.Raw */);
    texture.baseWidth = width;
    texture.baseHeight = height;
    texture.width = width;
    texture.height = height;
    texture.format = format;
    texture.generateMipMaps = generateMipMaps;
    texture.samplingMode = samplingMode;
    texture.invertY = invertY;
    texture._compression = compression;
    texture.type = type;
    texture._creationFlags = creationFlags;
    texture._useSRGBBuffer = useSRGBBuffer;
    if (!this._doNotHandleContextLost) {
        texture._bufferView = data;
    }
    this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);
    this.updateRawTexture(texture, data, format, invertY, compression, type, useSRGBBuffer);
    this._internalTexturesCache.push(texture);
    return texture;
};
ThinWebGPUEngine.prototype.updateRawTexture = function (texture, bufferView, format, invertY, compression = null, type = 0, useSRGBBuffer = false) {
    if (!texture) {
        return;
    }
    if (!this._doNotHandleContextLost) {
        texture._bufferView = bufferView;
        texture.invertY = invertY;
        texture._compression = compression;
        texture._useSRGBBuffer = useSRGBBuffer;
    }
    if (bufferView) {
        const gpuTextureWrapper = texture._hardwareTexture;
        const needConversion = format === 4;
        if (needConversion) {
            bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, type);
        }
        const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);
        this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);
        if (texture.generateMipMaps) {
            this._generateMipmaps(texture, this._uploadEncoder);
        }
    }
    texture.isReady = true;
};
ThinWebGPUEngine.prototype.createRawCubeTexture = function (data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) {
    const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 8 /* InternalTextureSource.CubeRaw */);
    if (type === 1 && !this._caps.textureFloatLinearFiltering) {
        generateMipMaps = false;
        samplingMode = 1;
        logger/* Logger */.V.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
    }
    else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) {
        generateMipMaps = false;
        samplingMode = 1;
        logger/* Logger */.V.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
    }
    else if (type === 1 && !this._caps.textureFloatRender) {
        generateMipMaps = false;
        logger/* Logger */.V.Warn("Render to float textures is not supported. Mipmap generation forced to false.");
    }
    else if (type === 2 && !this._caps.colorBufferFloat) {
        generateMipMaps = false;
        logger/* Logger */.V.Warn("Render to half float textures is not supported. Mipmap generation forced to false.");
    }
    texture.isCube = true;
    texture._originalFormat = format;
    texture.format = format === 4 ? 5 : format;
    texture.type = type;
    texture.generateMipMaps = generateMipMaps;
    texture.width = size;
    texture.height = size;
    texture.samplingMode = samplingMode;
    if (!this._doNotHandleContextLost) {
        texture._bufferViewArray = data;
    }
    texture.invertY = invertY;
    texture._compression = compression;
    texture._cachedWrapU = 0;
    texture._cachedWrapV = 0;
    this._textureHelper.createGPUTextureForInternalTexture(texture);
    if (format === 4) {
        const gpuTextureWrapper = texture._hardwareTexture;
        gpuTextureWrapper._originalFormatIsRGB = true;
    }
    if (data) {
        this.updateRawCubeTexture(texture, data, format, type, invertY, compression);
    }
    texture.isReady = true;
    return texture;
};
ThinWebGPUEngine.prototype.updateRawCubeTexture = function (texture, bufferView, _format, type, invertY, compression = null) {
    texture._bufferViewArray = bufferView;
    texture.invertY = invertY;
    texture._compression = compression;
    const gpuTextureWrapper = texture._hardwareTexture;
    const needConversion = gpuTextureWrapper._originalFormatIsRGB;
    const faces = [0, 2, 4, 1, 3, 5];
    const data = [];
    for (let i = 0; i < bufferView.length; ++i) {
        let faceData = bufferView[faces[i]];
        if (needConversion) {
            faceData = _convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type);
        }
        data.push(new Uint8Array(faceData.buffer, faceData.byteOffset, faceData.byteLength));
    }
    this._textureHelper.updateCubeTextures(data, gpuTextureWrapper.underlyingResource, texture.width, texture.height, gpuTextureWrapper.format, invertY, false, 0, 0);
    if (texture.generateMipMaps) {
        this._generateMipmaps(texture, this._uploadEncoder);
    }
    texture.isReady = true;
};
ThinWebGPUEngine.prototype.createRawCubeTextureFromUrl = function (url, scene, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = 3, invertY = false) {
    const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);
    scene?.addPendingData(texture);
    texture.url = url;
    texture.isReady = false;
    this._internalTexturesCache.push(texture);
    const onerror = (request, exception) => {
        scene?.removePendingData(texture);
        if (onError && request) {
            onError(request.status + " " + request.statusText, exception);
        }
    };
    const internalCallback = (data) => {
        const width = texture.width;
        const faceDataArrays = callback(data);
        if (!faceDataArrays) {
            return;
        }
        if (mipmapGenerator) {
            const needConversion = format === 4;
            const mipData = mipmapGenerator(faceDataArrays);
            const gpuTextureWrapper = texture._hardwareTexture;
            const faces = [0, 1, 2, 3, 4, 5];
            for (let level = 0; level < mipData.length; level++) {
                const mipSize = width >> level;
                const allFaces = [];
                for (let faceIndex = 0; faceIndex < 6; faceIndex++) {
                    let mipFaceData = mipData[level][faces[faceIndex]];
                    if (needConversion) {
                        mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);
                    }
                    allFaces.push(new Uint8Array(mipFaceData.buffer, mipFaceData.byteOffset, mipFaceData.byteLength));
                }
                this._textureHelper.updateCubeTextures(allFaces, gpuTextureWrapper.underlyingResource, mipSize, mipSize, gpuTextureWrapper.format, invertY, false, 0, 0);
            }
        }
        else {
            this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY);
        }
        texture.isReady = true;
        scene?.removePendingData(texture);
        if (onLoad) {
            onLoad();
        }
    };
    this._loadFile(url, (data) => {
        internalCallback(data);
    }, undefined, scene?.offlineProvider, true, onerror);
    return texture;
};
ThinWebGPUEngine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0, creationFlags = 0) {
    const source = 10 /* InternalTextureSource.Raw3D */;
    const texture = new Textures_internalTexture/* InternalTexture */.hV(this, source);
    texture.baseWidth = width;
    texture.baseHeight = height;
    texture.baseDepth = depth;
    texture.width = width;
    texture.height = height;
    texture.depth = depth;
    texture.format = format;
    texture.type = textureType;
    texture.generateMipMaps = generateMipMaps;
    texture.samplingMode = samplingMode;
    texture.is3D = true;
    texture._creationFlags = creationFlags;
    if (!this._doNotHandleContextLost) {
        texture._bufferView = data;
    }
    this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);
    this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);
    this._internalTexturesCache.push(texture);
    return texture;
};
ThinWebGPUEngine.prototype.updateRawTexture3D = function (texture, bufferView, format, invertY, compression = null, textureType = 0) {
    if (!this._doNotHandleContextLost) {
        texture._bufferView = bufferView;
        texture.format = format;
        texture.invertY = invertY;
        texture._compression = compression;
    }
    if (bufferView) {
        const gpuTextureWrapper = texture._hardwareTexture;
        const needConversion = format === 4;
        if (needConversion) {
            bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);
        }
        const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);
        this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);
        if (texture.generateMipMaps) {
            this._generateMipmaps(texture, this._uploadEncoder);
        }
    }
    texture.isReady = true;
};
ThinWebGPUEngine.prototype.createRawTexture2DArray = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0, creationFlags = 0) {
    const source = 11 /* InternalTextureSource.Raw2DArray */;
    const texture = new Textures_internalTexture/* InternalTexture */.hV(this, source);
    texture.baseWidth = width;
    texture.baseHeight = height;
    texture.baseDepth = depth;
    texture.width = width;
    texture.height = height;
    texture.depth = depth;
    texture.format = format;
    texture.type = textureType;
    texture.generateMipMaps = generateMipMaps;
    texture.samplingMode = samplingMode;
    texture.is2DArray = true;
    texture._creationFlags = creationFlags;
    if (!this._doNotHandleContextLost) {
        texture._bufferView = data;
    }
    this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags);
    this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);
    this._internalTexturesCache.push(texture);
    return texture;
};
ThinWebGPUEngine.prototype.updateRawTexture2DArray = function (texture, bufferView, format, invertY, compression = null, textureType = 0) {
    if (!this._doNotHandleContextLost) {
        texture._bufferView = bufferView;
        texture.format = format;
        texture.invertY = invertY;
        texture._compression = compression;
    }
    if (bufferView) {
        const gpuTextureWrapper = texture._hardwareTexture;
        const needConversion = format === 4;
        if (needConversion) {
            bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);
        }
        const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);
        this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);
        if (texture.generateMipMaps) {
            this._generateMipmaps(texture, this._uploadEncoder);
        }
    }
    texture.isReady = true;
};
/**
 * @internal
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
function _convertRGBtoRGBATextureData(rgbData, width, height, textureType) {
    // Create new RGBA data container.
    let rgbaData;
    let val1 = 1;
    if (textureType === 1) {
        rgbaData = new Float32Array(width * height * 4);
    }
    else if (textureType === 2) {
        rgbaData = new Uint16Array(width * height * 4);
        val1 = 15360; // 15360 is the encoding of 1 in half float
    }
    else if (textureType === 7) {
        rgbaData = new Uint32Array(width * height * 4);
    }
    else {
        rgbaData = new Uint8Array(width * height * 4);
    }
    // Convert each pixel.
    for (let x = 0; x < width; x++) {
        for (let y = 0; y < height; y++) {
            const index = (y * width + x) * 3;
            const newIndex = (y * width + x) * 4;
            // Map Old Value to new value.
            rgbaData[newIndex + 0] = rgbData[index + 0];
            rgbaData[newIndex + 1] = rgbData[index + 1];
            rgbaData[newIndex + 2] = rgbData[index + 2];
            // Add fully opaque alpha channel.
            rgbaData[newIndex + 3] = val1;
        }
    }
    return rgbaData;
}
//# sourceMappingURL=engine.rawTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.readTexture.js

ThinWebGPUEngine.prototype._readTexturePixels = function (texture, width, height, faceIndex = -1, level = 0, buffer = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) {
    const gpuTextureWrapper = texture._hardwareTexture;
    if (flushRenderer) {
        this.flushFramebuffer();
    }
    return this._textureHelper.readPixels(gpuTextureWrapper.underlyingResource, x, y, width, height, gpuTextureWrapper.format, faceIndex, level, buffer, noDataConversion);
};
ThinWebGPUEngine.prototype._readTexturePixelsSync = function () {
    // eslint-disable-next-line no-throw-literal
    throw "_readTexturePixelsSync is unsupported in WebGPU!";
};
//# sourceMappingURL=engine.readTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.cubeTexture.js




ThinWebGPUEngine.prototype._createDepthStencilCubeTexture = function (size, options) {
    const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(this, options.generateStencil ? 12 /* InternalTextureSource.DepthStencil */ : 14 /* InternalTextureSource.Depth */);
    internalTexture.isCube = true;
    internalTexture.label = options.label;
    const internalOptions = {
        bilinearFiltering: false,
        comparisonFunction: 0,
        generateStencil: false,
        samples: 1,
        depthTextureFormat: options.generateStencil ? 13 : 14,
        ...options,
    };
    internalTexture.format = internalOptions.depthTextureFormat;
    this._setupDepthStencilTexture(internalTexture, size, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples);
    this._textureHelper.createGPUTextureForInternalTexture(internalTexture);
    // Now that the hardware texture is created, we can retrieve the GPU format and set the right type to the internal texture
    const gpuTextureWrapper = internalTexture._hardwareTexture;
    internalTexture.type = WebGPUTextureHelper.GetTextureTypeFromFormat(gpuTextureWrapper.format);
    this._internalTexturesCache.push(internalTexture);
    return internalTexture;
};
ThinWebGPUEngine.prototype.createCubeTexture = function (rootUrl, scene, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, loaderOptions, useSRGBBuffer = false, buffer = null) {
    return this.createCubeTextureBase(rootUrl, scene, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback, null, (texture, imgs) => {
        const imageBitmaps = imgs; // we will always get an ImageBitmap array in WebGPU
        const width = imageBitmaps[0].width;
        const height = width;
        this._setCubeMapTextureParams(texture, !noMipmap);
        texture.format = format ?? -1;
        const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);
        this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource, width, height, gpuTextureWrapper.format, false, false, 0, 0);
        if (!noMipmap) {
            this._generateMipmaps(texture, this._uploadEncoder);
        }
        texture.isReady = true;
        texture.onLoadedObservable.notifyObservers(texture);
        texture.onLoadedObservable.clear();
        if (onLoad) {
            onLoad();
        }
    }, !!useSRGBBuffer, buffer);
};
ThinWebGPUEngine.prototype._setCubeMapTextureParams = function (texture, loadMipmap, maxLevel) {
    texture.samplingMode = loadMipmap ? 3 : 2;
    texture._cachedWrapU = 0;
    texture._cachedWrapV = 0;
    if (maxLevel) {
        texture._maxLodLevel = maxLevel;
    }
};
ThinWebGPUEngine.prototype.generateMipMapsForCubemap = function (texture) {
    if (texture.generateMipMaps) {
        const gpuTexture = texture._hardwareTexture?.underlyingResource;
        if (!gpuTexture) {
            this._textureHelper.createGPUTextureForInternalTexture(texture);
        }
        this._generateMipmaps(texture);
    }
};
//# sourceMappingURL=engine.cubeTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuRenderTargetWrapper.js


/**
 * Specialized class used to store a render target of a WebGPU engine
 */
class WebGPURenderTargetWrapper extends renderTargetWrapper/* RenderTargetWrapper */.v {
    /**
     * Initializes the render target wrapper
     * @param isMulti true if the wrapper is a multi render target
     * @param isCube true if the wrapper should render to a cube texture
     * @param size size of the render target (width/height/layers)
     * @param engine engine used to create the render target
     * @param label defines the label to use for the wrapper (for debugging purpose only)
     */
    constructor(isMulti, isCube, size, engine, label) {
        super(isMulti, isCube, size, engine, label);
        if (engine.enableGPUTimingMeasurements) {
            this.gpuTimeInFrame = new webgpuPerfCounter/* WebGPUPerfCounter */.e();
        }
    }
}
//# sourceMappingURL=webgpuRenderTargetWrapper.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.renderTarget.js





ThinWebGPUEngine.prototype._createHardwareRenderTargetWrapper = function (isMulti, isCube, size) {
    const rtWrapper = new WebGPURenderTargetWrapper(isMulti, isCube, size, this);
    this._renderTargetWrapperCache.push(rtWrapper);
    return rtWrapper;
};
ThinWebGPUEngine.prototype.createRenderTargetTexture = function (size, options) {
    const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size);
    const fullOptions = {};
    if (options !== undefined && typeof options === "object") {
        fullOptions.generateMipMaps = options.generateMipMaps;
        fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
        fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;
        fullOptions.samplingMode = options.samplingMode === undefined ? 3 : options.samplingMode;
        fullOptions.creationFlags = options.creationFlags ?? 0;
        fullOptions.noColorAttachment = !!options.noColorAttachment;
        fullOptions.colorAttachment = options.colorAttachment;
        fullOptions.samples = options.samples;
        fullOptions.label = options.label;
        fullOptions.format = options.format;
        fullOptions.type = options.type;
    }
    else {
        fullOptions.generateMipMaps = options;
        fullOptions.generateDepthBuffer = true;
        fullOptions.generateStencilBuffer = false;
        fullOptions.samplingMode = 3;
        fullOptions.creationFlags = 0;
        fullOptions.noColorAttachment = false;
    }
    const texture = fullOptions.colorAttachment || (fullOptions.noColorAttachment ? null : this._createInternalTexture(size, fullOptions, true, 5 /* InternalTextureSource.RenderTarget */));
    rtWrapper.label = fullOptions.label ?? "RenderTargetWrapper";
    rtWrapper._samples = fullOptions.colorAttachment?.samples ?? fullOptions.samples ?? 1;
    rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;
    rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false;
    rtWrapper.setTextures(texture);
    if (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) {
        rtWrapper.createDepthStencilTexture(0, false, // force false as filtering is not supported for depth textures
        rtWrapper._generateStencilBuffer, rtWrapper.samples, fullOptions.generateStencilBuffer ? 13 : 14, fullOptions.label ? fullOptions.label + "-DepthStencil" : undefined);
    }
    if (texture && !fullOptions.colorAttachment) {
        if (options !== undefined && typeof options === "object" && options.createMipMaps && !fullOptions.generateMipMaps) {
            texture.generateMipMaps = true;
        }
        this._textureHelper.createGPUTextureForInternalTexture(texture, undefined, undefined, undefined, fullOptions.creationFlags);
        if (options !== undefined && typeof options === "object" && options.createMipMaps && !fullOptions.generateMipMaps) {
            texture.generateMipMaps = false;
        }
    }
    return rtWrapper;
};
ThinWebGPUEngine.prototype._createDepthStencilTexture = function (size, options, wrapper) {
    const internalOptions = {
        bilinearFiltering: false,
        comparisonFunction: 0,
        generateStencil: false,
        samples: 1,
        depthTextureFormat: options.generateStencil ? 13 : 14,
        ...options,
    };
    const hasStencil = internalOptions.depthTextureFormat === 17 ||
        internalOptions.depthTextureFormat === 13 ||
        internalOptions.depthTextureFormat === 18;
    wrapper._depthStencilTextureWithStencil = hasStencil;
    const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(this, hasStencil ? 12 /* InternalTextureSource.DepthStencil */ : 14 /* InternalTextureSource.Depth */);
    internalTexture.label = options.label;
    internalTexture.format = internalOptions.depthTextureFormat;
    internalTexture.type = (0,Textures_internalTexture/* GetTypeForDepthTexture */.GX)(internalTexture.format);
    this._setupDepthStencilTexture(internalTexture, size, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples);
    this._textureHelper.createGPUTextureForInternalTexture(internalTexture);
    this._internalTexturesCache.push(internalTexture);
    return internalTexture;
};
ThinWebGPUEngine.prototype._setupDepthStencilTexture = function (internalTexture, size, bilinearFiltering, comparisonFunction, samples = 1) {
    const width = size.width ?? size;
    const height = size.height ?? size;
    const layers = size.layers || 0;
    const depth = size.depth || 0;
    internalTexture.baseWidth = width;
    internalTexture.baseHeight = height;
    internalTexture.width = width;
    internalTexture.height = height;
    internalTexture.is2DArray = layers > 0;
    internalTexture.is3D = depth > 0;
    internalTexture.depth = layers || depth;
    internalTexture.isReady = true;
    internalTexture.samples = samples;
    internalTexture.generateMipMaps = false;
    internalTexture.samplingMode = bilinearFiltering ? 2 : 1;
    internalTexture.type = 1; // the right type will be set later
    internalTexture._comparisonFunction = comparisonFunction;
    internalTexture._cachedWrapU = 0;
    internalTexture._cachedWrapV = 0;
};
ThinWebGPUEngine.prototype.updateRenderTargetTextureSampleCount = function (rtWrapper, samples) {
    if (!rtWrapper || !rtWrapper.texture || rtWrapper.samples === samples) {
        return samples;
    }
    samples = Math.min(samples, this.getCaps().maxMSAASamples);
    this._textureHelper.createMSAATexture(rtWrapper.texture, samples);
    if (rtWrapper._depthStencilTexture) {
        this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples);
        rtWrapper._depthStencilTexture.samples = samples;
    }
    rtWrapper._samples = samples;
    rtWrapper.texture.samples = samples;
    return samples;
};
//# sourceMappingURL=engine.renderTarget.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.renderTargetTexture.js

ThinWebGPUEngine.prototype.setDepthStencilTexture = function (channel, uniform, texture, name) {
    if (!texture || !texture.depthStencilTexture) {
        this._setTexture(channel, null, undefined, undefined, name);
    }
    else {
        this._setTexture(channel, texture, false, true, name);
    }
};
//# sourceMappingURL=engine.renderTargetTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.renderTargetCube.js



ThinWebGPUEngine.prototype.createRenderTargetCubeTexture = function (size, options) {
    const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size);
    const fullOptions = {
        generateMipMaps: true,
        generateDepthBuffer: true,
        generateStencilBuffer: false,
        type: 0,
        samplingMode: 3,
        format: 5,
        samples: 1,
        ...options,
    };
    fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;
    rtWrapper.label = fullOptions.label ?? "RenderTargetWrapper";
    rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;
    rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer;
    const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 5 /* InternalTextureSource.RenderTarget */);
    texture.width = size;
    texture.height = size;
    texture.depth = 0;
    texture.isReady = true;
    texture.isCube = true;
    texture.samples = fullOptions.samples;
    texture.generateMipMaps = fullOptions.generateMipMaps;
    texture.samplingMode = fullOptions.samplingMode;
    texture.type = fullOptions.type;
    texture.format = fullOptions.format;
    this._internalTexturesCache.push(texture);
    rtWrapper.setTextures(texture);
    if (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) {
        rtWrapper.createDepthStencilTexture(0, fullOptions.samplingMode === undefined ||
            fullOptions.samplingMode === 2 ||
            fullOptions.samplingMode === 2 ||
            fullOptions.samplingMode === 3 ||
            fullOptions.samplingMode === 3 ||
            fullOptions.samplingMode === 5 ||
            fullOptions.samplingMode === 6 ||
            fullOptions.samplingMode === 7 ||
            fullOptions.samplingMode === 11, rtWrapper._generateStencilBuffer, rtWrapper.samples);
    }
    if (options && options.createMipMaps && !fullOptions.generateMipMaps) {
        texture.generateMipMaps = true;
    }
    this._textureHelper.createGPUTextureForInternalTexture(texture);
    if (options && options.createMipMaps && !fullOptions.generateMipMaps) {
        texture.generateMipMaps = false;
    }
    return rtWrapper;
};
//# sourceMappingURL=engine.renderTargetCube.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.query.js



ThinWebGPUEngine.prototype.getGPUFrameTimeCounter = function () {
    return this._timestampQuery.gpuFrameTimeCounter;
};
ThinWebGPUEngine.prototype.captureGPUFrameTime = function (value) {
    this._timestampQuery.enable = value && !!this._caps.timerQuery;
};
ThinWebGPUEngine.prototype.createQuery = function () {
    return this._occlusionQuery.createQuery();
};
ThinWebGPUEngine.prototype.deleteQuery = function (query) {
    this._occlusionQuery.deleteQuery(query);
    return this;
};
ThinWebGPUEngine.prototype.isQueryResultAvailable = function (query) {
    return this._occlusionQuery.isQueryResultAvailable(query);
};
ThinWebGPUEngine.prototype.getQueryResult = function (query) {
    return this._occlusionQuery.getQueryResult(query);
};
ThinWebGPUEngine.prototype.beginOcclusionQuery = function (algorithmType, query) {
    if (this.compatibilityMode) {
        if (this._occlusionQuery.canBeginQuery(query)) {
            this._currentRenderPass?.beginOcclusionQuery(query);
            return true;
        }
    }
    else {
        this._bundleList.addItem(new WebGPURenderItemBeginOcclusionQuery(query));
        return true;
    }
    return false;
};
ThinWebGPUEngine.prototype.endOcclusionQuery = function () {
    if (this.compatibilityMode) {
        this._currentRenderPass?.endOcclusionQuery();
    }
    else {
        this._bundleList.addItem(new WebGPURenderItemEndOcclusionQuery());
    }
    return this;
};
//# sourceMappingURL=engine.query.js.map
;// ./node_modules/@babylonjs/core/Engines/webgpuEngine.js
/* eslint-disable babylonjs/available */






// eslint-disable-next-line @typescript-eslint/naming-convention

















































const viewDescriptorSwapChainAntialiasing = {
    label: `TextureView_SwapChain_ResolveTarget`,
    dimension: "2d" /* WebGPUConstants.TextureDimension.E2d */,
    format: undefined, // will be updated with the right value
    mipLevelCount: 1,
    arrayLayerCount: 1,
};
const viewDescriptorSwapChain = {
    label: `TextureView_SwapChain`,
    dimension: "2d" /* WebGPUConstants.TextureDimension.E2d */,
    format: undefined, // will be updated with the right value
    mipLevelCount: 1,
    arrayLayerCount: 1,
};
const tempColor4 = new math/* Color4 */.ov();
/**
 * The web GPU engine class provides support for WebGPU version of babylon.js.
 * @since 5.0.0
 */
class WebGPUEngine extends ThinWebGPUEngine {
    /**
     * Gets or sets the snapshot rendering mode
     */
    get snapshotRenderingMode() {
        return this._snapshotRendering.mode;
    }
    set snapshotRenderingMode(mode) {
        this._snapshotRendering.mode = mode;
    }
    /**
     * Creates a new snapshot at the next frame using the current snapshotRenderingMode
     */
    snapshotRenderingReset() {
        this._snapshotRendering.reset();
    }
    /**
     * Enables or disables the snapshot rendering mode
     * Note that the WebGL engine does not support snapshot rendering so setting the value won't have any effect for this engine
     */
    get snapshotRendering() {
        return this._snapshotRendering.enabled;
    }
    set snapshotRendering(activate) {
        this._snapshotRendering.enabled = activate;
    }
    /**
     * Sets this to true to disable the cache for the samplers. You should do it only for testing purpose!
     */
    get disableCacheSamplers() {
        return this._cacheSampler ? this._cacheSampler.disabled : false;
    }
    set disableCacheSamplers(disable) {
        if (this._cacheSampler) {
            this._cacheSampler.disabled = disable;
        }
    }
    /**
     * Sets this to true to disable the cache for the render pipelines. You should do it only for testing purpose!
     */
    get disableCacheRenderPipelines() {
        return this._cacheRenderPipeline ? this._cacheRenderPipeline.disabled : false;
    }
    set disableCacheRenderPipelines(disable) {
        if (this._cacheRenderPipeline) {
            this._cacheRenderPipeline.disabled = disable;
        }
    }
    /**
     * Sets this to true to disable the cache for the bind groups. You should do it only for testing purpose!
     */
    get disableCacheBindGroups() {
        return this._cacheBindGroups ? this._cacheBindGroups.disabled : false;
    }
    set disableCacheBindGroups(disable) {
        if (this._cacheBindGroups) {
            this._cacheBindGroups.disabled = disable;
        }
    }
    /**
     * Gets a boolean indicating if all created effects are ready
     * @returns true if all effects are ready
     */
    areAllEffectsReady() {
        return true;
    }
    /**
     * Get Font size information
     * @param font font name
     * @returns an object containing ascent, height and descent
     */
    getFontOffset(font) {
        return (0,engine_common/* GetFontOffset */.PR)(font);
    }
    /**
     * Gets a Promise<boolean> indicating if the engine can be instantiated (ie. if a WebGPU context can be found)
     */
    static get IsSupportedAsync() {
        return !navigator.gpu
            ? Promise.resolve(false)
            : navigator.gpu
                .requestAdapter()
                .then((adapter) => !!adapter, () => false)
                .catch(() => false);
    }
    /**
     * Not supported by WebGPU, you should call IsSupportedAsync instead!
     */
    static get IsSupported() {
        logger/* Logger */.V.Warn("You must call IsSupportedAsync for WebGPU!");
        return false;
    }
    /**
     * Gets a boolean indicating that the engine supports uniform buffers
     */
    get supportsUniformBuffers() {
        return true;
    }
    /** Gets the supported extensions by the WebGPU adapter */
    get supportedExtensions() {
        return this._adapterSupportedExtensions;
    }
    /** Gets the currently enabled extensions on the WebGPU device */
    get enabledExtensions() {
        return this._deviceEnabledExtensions;
    }
    /** Gets the supported limits by the WebGPU adapter */
    get supportedLimits() {
        return this._adapterSupportedLimits;
    }
    /** Gets the current limits of the WebGPU device */
    get currentLimits() {
        return this._deviceLimits;
    }
    /**
     * Returns a string describing the current engine
     */
    get description() {
        const description = this.name + this.version;
        return description;
    }
    /**
     * Returns the version of the engine
     */
    get version() {
        return 1;
    }
    /**
     * Gets an object containing information about the current engine context
     * @returns an object containing the vendor, the renderer and the version of the current engine context
     */
    getInfo() {
        return {
            vendor: this._adapterInfo.vendor || "unknown vendor",
            renderer: this._adapterInfo.architecture || "unknown renderer",
            version: this._adapterInfo.description || "unknown version",
        };
    }
    /**
     * (WebGPU only) True (default) to be in compatibility mode, meaning rendering all existing scenes without artifacts (same rendering than WebGL).
     * Setting the property to false will improve performances but may not work in some scenes if some precautions are not taken.
     * See https://doc.babylonjs.com/setup/support/webGPU/webGPUOptimization/webGPUNonCompatibilityMode for more details
     */
    get compatibilityMode() {
        return this._compatibilityMode;
    }
    set compatibilityMode(mode) {
        this._compatibilityMode = mode;
    }
    /** @internal */
    get currentSampleCount() {
        return this._currentRenderTarget ? this._currentRenderTarget.samples : this._mainPassSampleCount;
    }
    /**
     * Create a new instance of the gpu engine asynchronously
     * @param canvas Defines the canvas to use to display the result
     * @param options Defines the options passed to the engine to create the GPU context dependencies
     * @returns a promise that resolves with the created engine
     */
    static CreateAsync(canvas, options = {}) {
        const engine = new WebGPUEngine(canvas, options);
        return new Promise((resolve) => {
            engine.initAsync(options.glslangOptions, options.twgslOptions).then(() => resolve(engine));
        });
    }
    /**
     * Create a new instance of the gpu engine.
     * @param canvas Defines the canvas to use to display the result
     * @param options Defines the options passed to the engine to create the GPU context dependencies
     */
    constructor(canvas, options = {}) {
        super(options.antialias ?? true, options);
        /** A unique id to identify this instance */
        this.uniqueId = -1;
        // Page Life cycle and constants
        this._uploadEncoderDescriptor = { label: "upload" };
        this._renderEncoderDescriptor = { label: "render" };
        /** @internal */
        this._clearDepthValue = 1;
        /** @internal */
        this._clearReverseDepthValue = 0;
        /** @internal */
        this._clearStencilValue = 0;
        this._defaultSampleCount = 4; // Only supported value for now.
        this._glslang = null;
        this._tintWASM = null;
        this._glslangAndTintAreFullyLoaded = false;
        this._adapterInfo = {
            vendor: "",
            architecture: "",
            device: "",
            description: "",
        };
        /** @internal */
        this._compiledComputeEffects = {};
        /** @internal */
        this._counters = {
            numEnableEffects: 0,
            numEnableDrawWrapper: 0,
            numBundleCreationNonCompatMode: 0,
            numBundleReuseNonCompatMode: 0,
        };
        /**
         * Counters from last frame
         */
        this.countersLastFrame = {
            numEnableEffects: 0,
            numEnableDrawWrapper: 0,
            numBundleCreationNonCompatMode: 0,
            numBundleReuseNonCompatMode: 0,
        };
        /**
         * Max number of uncaptured error messages to log
         */
        this.numMaxUncapturedErrors = 20;
        /**
         * Gets the list of created scenes
         */
        this.scenes = [];
        /** @internal */
        this._virtualScenes = new Array();
        this._commandBuffers = [null, null];
        // Frame Buffer Life Cycle (recreated for each render target pass)
        this._mainRenderPassWrapper = {
            renderPassDescriptor: null,
            colorAttachmentViewDescriptor: null,
            depthAttachmentViewDescriptor: null,
            colorAttachmentGPUTextures: [],
            depthTextureFormat: undefined,
        };
        this._rttRenderPassWrapper = {
            renderPassDescriptor: null,
            colorAttachmentViewDescriptor: null,
            depthAttachmentViewDescriptor: null,
            colorAttachmentGPUTextures: [],
            depthTextureFormat: undefined,
        };
        /** @internal */
        this._pendingDebugCommands = [];
        this._currentOverrideVertexBuffers = null;
        this._currentIndexBuffer = null;
        this._colorWriteLocal = true;
        this._forceEnableEffect = false;
        /**
         * Indicates if the z range in NDC space is 0..1 (value: true) or -1..1 (value: false)
         */
        this.isNDCHalfZRange = true;
        /**
         * Indicates that the origin of the texture/framebuffer space is the bottom left corner. If false, the origin is top left
         */
        this.hasOriginBottomLeft = false;
        //------------------------------------------------------------------------------
        //                              Initialization
        //------------------------------------------------------------------------------
        this._workingGlslangAndTintPromise = null;
        //------------------------------------------------------------------------------
        //                              Dynamic WebGPU States
        //------------------------------------------------------------------------------
        // index 0 is for main render pass, 1 for RTT render pass
        this._viewportsCurrent = { x: 0, y: 0, w: 0, h: 0 };
        this._scissorsCurrent = { x: 0, y: 0, w: 0, h: 0 };
        this._scissorCached = { x: 0, y: 0, z: 0, w: 0 };
        this._stencilRefsCurrent = -1;
        this._blendColorsCurrent = [null, null, null, null];
        this._performanceMonitor = new performanceMonitor/* PerformanceMonitor */.r();
        this._name = "WebGPU";
        this._drawCalls = new perfCounter/* PerfCounter */.A();
        options.deviceDescriptor = options.deviceDescriptor || {};
        options.enableGPUDebugMarkers = options.enableGPUDebugMarkers ?? false;
        logger/* Logger */.V.Log(`Babylon.js v${abstractEngine/* AbstractEngine */.$.Version} - ${this.description} engine`);
        if (!navigator.gpu) {
            logger/* Logger */.V.Error("WebGPU is not supported by your browser.");
            return;
        }
        options.swapChainFormat = options.swapChainFormat || navigator.gpu.getPreferredCanvasFormat();
        this._isWebGPU = true;
        this._shaderPlatformName = "WEBGPU";
        this._renderingCanvas = canvas;
        this._options = options;
        this._mainPassSampleCount = options.antialias ? this._defaultSampleCount : 1;
        if (navigator && navigator.userAgent) {
            this._setupMobileChecks();
        }
        this._sharedInit(this._renderingCanvas);
        this._shaderProcessor = new WebGPUShaderProcessorGLSL();
        this._shaderProcessorWGSL = new WebGPUShaderProcessorWGSL();
    }
    /**
     * Load the glslang and tintWASM libraries and prepare them for use.
     * @returns a promise that resolves when the engine is ready to use the glslang and tintWASM
     */
    prepareGlslangAndTintAsync() {
        if (!this._workingGlslangAndTintPromise) {
            this._workingGlslangAndTintPromise = new Promise((resolve) => {
                this._initGlslang(this._glslangOptions ?? this._options?.glslangOptions).then((glslang) => {
                    this._glslang = glslang;
                    this._tintWASM = new WebGPUTintWASM();
                    this._tintWASM.initTwgsl(this._twgslOptions ?? this._options?.twgslOptions).then(() => {
                        this._glslangAndTintAreFullyLoaded = true;
                        resolve();
                    });
                });
            });
        }
        return this._workingGlslangAndTintPromise;
    }
    /**
     * Initializes the WebGPU context and dependencies.
     * @param glslangOptions Defines the GLSLang compiler options if necessary
     * @param twgslOptions Defines the Twgsl compiler options if necessary
     * @returns a promise notifying the readiness of the engine.
     */
    initAsync(glslangOptions, twgslOptions) {
        this.uniqueId = WebGPUEngine._InstanceId++;
        this._glslangOptions = glslangOptions;
        this._twgslOptions = twgslOptions;
        return navigator
            .gpu.requestAdapter(this._options)
            .then((adapter) => {
            if (!adapter) {
                // eslint-disable-next-line no-throw-literal
                throw "Could not retrieve a WebGPU adapter (adapter is null).";
            }
            else {
                this._adapter = adapter;
                this._adapterSupportedExtensions = [];
                this._adapter.features?.forEach((feature) => this._adapterSupportedExtensions.push(feature));
                this._adapterSupportedLimits = this._adapter.limits;
                this._adapterInfo = this._adapter.info;
                const deviceDescriptor = this._options.deviceDescriptor ?? {};
                const requiredFeatures = deviceDescriptor?.requiredFeatures ?? (this._options.enableAllFeatures ? this._adapterSupportedExtensions : undefined);
                if (requiredFeatures) {
                    const requestedExtensions = requiredFeatures;
                    const validExtensions = [];
                    for (const extension of requestedExtensions) {
                        if (this._adapterSupportedExtensions.indexOf(extension) !== -1) {
                            validExtensions.push(extension);
                        }
                    }
                    deviceDescriptor.requiredFeatures = validExtensions;
                }
                if (this._options.setMaximumLimits && !deviceDescriptor.requiredLimits) {
                    deviceDescriptor.requiredLimits = {};
                    for (const name in this._adapterSupportedLimits) {
                        if (name === "minSubgroupSize" || name === "maxSubgroupSize") {
                            // Chrome exposes these limits in "webgpu developer" mode, but these can't be set on the device.
                            continue;
                        }
                        deviceDescriptor.requiredLimits[name] = this._adapterSupportedLimits[name];
                    }
                }
                deviceDescriptor.label = `BabylonWebGPUDevice${this.uniqueId}`;
                return this._adapter.requestDevice(deviceDescriptor);
            }
        })
            .then((device) => {
            this._device = device;
            this._deviceEnabledExtensions = [];
            this._device.features?.forEach((feature) => this._deviceEnabledExtensions.push(feature));
            this._deviceLimits = device.limits;
            let numUncapturedErrors = -1;
            this._device.addEventListener("uncapturederror", (event) => {
                if (++numUncapturedErrors < this.numMaxUncapturedErrors) {
                    logger/* Logger */.V.Warn(`WebGPU uncaptured error (${numUncapturedErrors + 1}): ${event.error} - ${event.error.message}`);
                }
                else if (numUncapturedErrors++ === this.numMaxUncapturedErrors) {
                    logger/* Logger */.V.Warn(`WebGPU uncaptured error: too many warnings (${this.numMaxUncapturedErrors}), no more warnings will be reported to the console for this engine.`);
                }
            });
            if (!this._doNotHandleContextLost) {
                this._device.lost?.then((info) => {
                    if (this._isDisposed) {
                        return;
                    }
                    this._contextWasLost = true;
                    logger/* Logger */.V.Warn("WebGPU context lost. " + info);
                    this.onContextLostObservable.notifyObservers(this);
                    this._restoreEngineAfterContextLost(async () => {
                        const snapshotRenderingMode = this.snapshotRenderingMode;
                        const snapshotRendering = this.snapshotRendering;
                        const disableCacheSamplers = this.disableCacheSamplers;
                        const disableCacheRenderPipelines = this.disableCacheRenderPipelines;
                        const disableCacheBindGroups = this.disableCacheBindGroups;
                        const enableGPUTimingMeasurements = this.enableGPUTimingMeasurements;
                        await this.initAsync(this._glslangOptions ?? this._options?.glslangOptions, this._twgslOptions ?? this._options?.twgslOptions);
                        this.snapshotRenderingMode = snapshotRenderingMode;
                        this.snapshotRendering = snapshotRendering;
                        this.disableCacheSamplers = disableCacheSamplers;
                        this.disableCacheRenderPipelines = disableCacheRenderPipelines;
                        this.disableCacheBindGroups = disableCacheBindGroups;
                        this.enableGPUTimingMeasurements = enableGPUTimingMeasurements;
                        this._currentRenderPass = null;
                    });
                });
            }
        })
            .then(() => {
            this._initializeLimits();
            this._bufferManager = new WebGPUBufferManager(this, this._device);
            this._textureHelper = new WebGPUTextureManager(this, this._device, this._bufferManager, this._deviceEnabledExtensions);
            this._cacheSampler = new WebGPUCacheSampler(this._device);
            this._cacheBindGroups = new WebGPUCacheBindGroups(this._device, this._cacheSampler, this);
            this._timestampQuery = new WebGPUTimestampQuery(this, this._device, this._bufferManager);
            this._occlusionQuery = this._device.createQuerySet ? new WebGPUOcclusionQuery(this, this._device, this._bufferManager) : undefined;
            this._bundleList = new WebGPUBundleList(this._device);
            this._snapshotRendering = new WebGPUSnapshotRendering(this, this._snapshotRenderingMode, this._bundleList);
            this._ubInvertY = this._bufferManager.createBuffer(new Float32Array([-1, 0]), BufferUsage.Uniform | BufferUsage.CopyDst, "UBInvertY");
            this._ubDontInvertY = this._bufferManager.createBuffer(new Float32Array([1, 0]), BufferUsage.Uniform | BufferUsage.CopyDst, "UBDontInvertY");
            if (this.dbgVerboseLogsForFirstFrames) {
                if (this._count === undefined) {
                    this._count = 0;
                    logger/* Logger */.V.Log(["%c frame #" + this._count + " - begin", "background: #ffff00"]);
                }
            }
            this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor);
            this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor);
            this._emptyVertexBuffer = new Buffers_buffer/* VertexBuffer */.R(this, [0], "", {
                stride: 1,
                offset: 0,
                size: 1,
                label: "EmptyVertexBuffer",
            });
            this._cacheRenderPipeline = new WebGPUCacheRenderPipelineTree(this._device, this._emptyVertexBuffer);
            this._depthCullingState = new WebGPUDepthCullingState(this._cacheRenderPipeline);
            this._stencilStateComposer = new WebGPUStencilStateComposer(this._cacheRenderPipeline);
            this._stencilStateComposer.stencilGlobal = this._stencilState;
            this._depthCullingState.depthTest = true;
            this._depthCullingState.depthFunc = 515;
            this._depthCullingState.depthMask = true;
            this._textureHelper.setCommandEncoder(this._uploadEncoder);
            this._clearQuad = new WebGPUClearQuad(this._device, this, this._emptyVertexBuffer);
            this._defaultDrawContext = this.createDrawContext();
            this._currentDrawContext = this._defaultDrawContext;
            this._defaultMaterialContext = this.createMaterialContext();
            this._currentMaterialContext = this._defaultMaterialContext;
            this._initializeContextAndSwapChain();
            this._initializeMainAttachments();
            this.resize();
        })
            .catch((e) => {
            logger/* Logger */.V.Error("A fatal error occurred during WebGPU creation/initialization.");
            throw e;
        });
    }
    _initGlslang(glslangOptions) {
        glslangOptions = glslangOptions || {};
        glslangOptions = {
            ...WebGPUEngine._GlslangDefaultOptions,
            ...glslangOptions,
        };
        if (glslangOptions.glslang) {
            return Promise.resolve(glslangOptions.glslang);
        }
        if (self.glslang) {
            return self.glslang(glslangOptions.wasmPath);
        }
        if (glslangOptions.jsPath && glslangOptions.wasmPath) {
            return tools/* Tools */.S0.LoadBabylonScriptAsync(glslangOptions.jsPath).then(() => {
                return self.glslang(tools/* Tools */.S0.GetBabylonScriptURL(glslangOptions.wasmPath));
            });
        }
        return Promise.reject("gslang is not available.");
    }
    _initializeLimits() {
        // Init caps
        // TODO WEBGPU Real Capability check once limits will be working.
        this._caps = {
            maxTexturesImageUnits: this._deviceLimits.maxSampledTexturesPerShaderStage,
            maxVertexTextureImageUnits: this._deviceLimits.maxSampledTexturesPerShaderStage,
            maxCombinedTexturesImageUnits: this._deviceLimits.maxSampledTexturesPerShaderStage * 2,
            maxTextureSize: this._deviceLimits.maxTextureDimension2D,
            maxCubemapTextureSize: this._deviceLimits.maxTextureDimension2D,
            maxRenderTextureSize: this._deviceLimits.maxTextureDimension2D,
            maxVertexAttribs: this._deviceLimits.maxVertexAttributes,
            maxDrawBuffers: 8,
            maxVaryingVectors: this._deviceLimits.maxInterStageShaderVariables,
            maxFragmentUniformVectors: Math.floor(this._deviceLimits.maxUniformBufferBindingSize / 4),
            maxVertexUniformVectors: Math.floor(this._deviceLimits.maxUniformBufferBindingSize / 4),
            standardDerivatives: true,
            astc: (this._deviceEnabledExtensions.indexOf("texture-compression-astc" /* WebGPUConstants.FeatureName.TextureCompressionASTC */) >= 0 ? true : undefined),
            s3tc: (this._deviceEnabledExtensions.indexOf("texture-compression-bc" /* WebGPUConstants.FeatureName.TextureCompressionBC */) >= 0 ? true : undefined),
            pvrtc: null,
            etc1: null,
            etc2: (this._deviceEnabledExtensions.indexOf("texture-compression-etc2" /* WebGPUConstants.FeatureName.TextureCompressionETC2 */) >= 0 ? true : undefined),
            bptc: this._deviceEnabledExtensions.indexOf("texture-compression-bc" /* WebGPUConstants.FeatureName.TextureCompressionBC */) >= 0 ? true : undefined,
            maxAnisotropy: 16, // Most implementations support maxAnisotropy values in range between 1 and 16, inclusive. The used value of maxAnisotropy will be clamped to the maximum value that the platform supports.
            uintIndices: true,
            fragmentDepthSupported: true,
            highPrecisionShaderSupported: true,
            colorBufferFloat: true,
            supportFloatTexturesResolve: false, // See https://github.com/gpuweb/gpuweb/issues/3844
            rg11b10ufColorRenderable: this._deviceEnabledExtensions.indexOf("rg11b10ufloat-renderable" /* WebGPUConstants.FeatureName.RG11B10UFloatRenderable */) >= 0,
            textureFloat: true,
            textureFloatLinearFiltering: this._deviceEnabledExtensions.indexOf("float32-filterable" /* WebGPUConstants.FeatureName.Float32Filterable */) >= 0,
            textureFloatRender: true,
            textureHalfFloat: true,
            textureHalfFloatLinearFiltering: true,
            textureHalfFloatRender: true,
            textureLOD: true,
            texelFetch: true,
            drawBuffersExtension: true,
            depthTextureExtension: true,
            vertexArrayObject: false,
            instancedArrays: true,
            timerQuery: typeof BigUint64Array !== "undefined" && this._deviceEnabledExtensions.indexOf("timestamp-query" /* WebGPUConstants.FeatureName.TimestampQuery */) !== -1 ? true : undefined,
            supportOcclusionQuery: typeof BigUint64Array !== "undefined",
            canUseTimestampForTimerQuery: true,
            multiview: false,
            oculusMultiview: false,
            parallelShaderCompile: undefined,
            blendMinMax: true,
            maxMSAASamples: 4, // the spec only supports values of 1 and 4
            canUseGLInstanceID: true,
            canUseGLVertexID: true,
            supportComputeShaders: true,
            supportSRGBBuffers: true,
            supportTransformFeedbacks: false,
            textureMaxLevel: true,
            texture2DArrayMaxLayerCount: this._deviceLimits.maxTextureArrayLayers,
            disableMorphTargetTexture: false,
            textureNorm16: false, // in the works: https://github.com/gpuweb/gpuweb/issues/3001
        };
        this._features = {
            forceBitmapOverHTMLImageElement: true,
            supportRenderAndCopyToLodForFloatTextures: true,
            supportDepthStencilTexture: true,
            supportShadowSamplers: true,
            uniformBufferHardCheckMatrix: false,
            allowTexturePrefiltering: true,
            trackUbosInFrame: true,
            checkUbosContentBeforeUpload: true,
            supportCSM: true,
            basisNeedsPOT: false,
            support3DTextures: true,
            needTypeSuffixInShaderConstants: true,
            supportMSAA: true,
            supportSSAO2: true,
            supportIBLShadows: true,
            supportExtendedTextureFormats: true,
            supportSwitchCaseInShader: true,
            supportSyncTextureRead: false,
            needsInvertingBitmap: false,
            useUBOBindingCache: false,
            needShaderCodeInlining: true,
            needToAlwaysBindUniformBuffers: true,
            supportRenderPasses: true,
            supportSpriteInstancing: true,
            forceVertexBufferStrideAndOffsetMultiple4Bytes: true,
            _checkNonFloatVertexBuffersDontRecreatePipelineContext: true,
            _collectUbosUpdatedInFrame: false,
        };
    }
    _initializeContextAndSwapChain() {
        if (!this._renderingCanvas) {
            // eslint-disable-next-line no-throw-literal
            throw "The rendering canvas has not been set!";
        }
        this._context = this._renderingCanvas.getContext("webgpu");
        this._configureContext();
        this._colorFormat = this._options.swapChainFormat;
        this._mainRenderPassWrapper.colorAttachmentGPUTextures = [new WebGPUHardwareTexture(this)];
        this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format = this._colorFormat;
        this._setColorFormat(this._mainRenderPassWrapper);
    }
    // Set default values as WebGL with depth and stencil attachment for the broadest Compat.
    _initializeMainAttachments() {
        if (!this._bufferManager) {
            return;
        }
        this.flushFramebuffer();
        this._mainTextureExtends = {
            width: this.getRenderWidth(true),
            height: this.getRenderHeight(true),
            depthOrArrayLayers: 1,
        };
        const bufferDataUpdate = new Float32Array([this.getRenderHeight(true)]);
        this._bufferManager.setSubData(this._ubInvertY, 4, bufferDataUpdate);
        this._bufferManager.setSubData(this._ubDontInvertY, 4, bufferDataUpdate);
        let mainColorAttachments;
        if (this._options.antialias) {
            const mainTextureDescriptor = {
                label: `Texture_MainColor_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}_antialiasing`,
                size: this._mainTextureExtends,
                mipLevelCount: 1,
                sampleCount: this._mainPassSampleCount,
                dimension: "2d" /* WebGPUConstants.TextureDimension.E2d */,
                format: this._options.swapChainFormat,
                usage: 16 /* WebGPUConstants.TextureUsage.RenderAttachment */,
            };
            if (this._mainTexture) {
                this._textureHelper.releaseTexture(this._mainTexture);
            }
            this._mainTexture = this._device.createTexture(mainTextureDescriptor);
            mainColorAttachments = [
                {
                    view: this._mainTexture.createView({
                        label: "TextureView_MainColor_antialiasing",
                        dimension: "2d" /* WebGPUConstants.TextureDimension.E2d */,
                        format: this._options.swapChainFormat,
                        mipLevelCount: 1,
                        arrayLayerCount: 1,
                    }),
                    clearValue: new math/* Color4 */.ov(0, 0, 0, 1),
                    loadOp: "clear" /* WebGPUConstants.LoadOp.Clear */,
                    storeOp: "store" /* WebGPUConstants.StoreOp.Store */, // don't use StoreOp.Discard, else using several cameras with different viewports or using scissors will fail because we call beginRenderPass / endPass several times for the same color attachment!
                },
            ];
        }
        else {
            mainColorAttachments = [
                {
                    view: undefined,
                    clearValue: new math/* Color4 */.ov(0, 0, 0, 1),
                    loadOp: "clear" /* WebGPUConstants.LoadOp.Clear */,
                    storeOp: "store" /* WebGPUConstants.StoreOp.Store */,
                },
            ];
        }
        this._mainRenderPassWrapper.depthTextureFormat = this.isStencilEnable ? "depth24plus-stencil8" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */ : "depth32float" /* WebGPUConstants.TextureFormat.Depth32Float */;
        this._setDepthTextureFormat(this._mainRenderPassWrapper);
        this._setColorFormat(this._mainRenderPassWrapper);
        const depthTextureDescriptor = {
            label: `Texture_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,
            size: this._mainTextureExtends,
            mipLevelCount: 1,
            sampleCount: this._mainPassSampleCount,
            dimension: "2d" /* WebGPUConstants.TextureDimension.E2d */,
            format: this._mainRenderPassWrapper.depthTextureFormat,
            usage: 16 /* WebGPUConstants.TextureUsage.RenderAttachment */,
        };
        if (this._depthTexture) {
            this._textureHelper.releaseTexture(this._depthTexture);
        }
        this._depthTexture = this._device.createTexture(depthTextureDescriptor);
        const mainDepthAttachment = {
            view: this._depthTexture.createView({
                label: `TextureView_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,
                dimension: "2d" /* WebGPUConstants.TextureDimension.E2d */,
                format: this._depthTexture.format,
                mipLevelCount: 1,
                arrayLayerCount: 1,
            }),
            depthClearValue: this._clearDepthValue,
            depthLoadOp: "clear" /* WebGPUConstants.LoadOp.Clear */,
            depthStoreOp: "store" /* WebGPUConstants.StoreOp.Store */,
            stencilClearValue: this._clearStencilValue,
            stencilLoadOp: !this.isStencilEnable ? undefined : "clear" /* WebGPUConstants.LoadOp.Clear */,
            stencilStoreOp: !this.isStencilEnable ? undefined : "store" /* WebGPUConstants.StoreOp.Store */,
        };
        this._mainRenderPassWrapper.renderPassDescriptor = {
            label: "MainRenderPass",
            colorAttachments: mainColorAttachments,
            depthStencilAttachment: mainDepthAttachment,
        };
    }
    /**
     * Shared initialization across engines types.
     * @param canvas The canvas associated with this instance of the engine.
     */
    _sharedInit(canvas) {
        super._sharedInit(canvas);
        (0,engine_common/* _CommonInit */.BG)(this, canvas, this._creationOptions);
    }
    _configureContext() {
        this._context.configure({
            device: this._device,
            format: this._options.swapChainFormat,
            usage: 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ | 1 /* WebGPUConstants.TextureUsage.CopySrc */,
            alphaMode: this.premultipliedAlpha ? "premultiplied" /* WebGPUConstants.CanvasAlphaMode.Premultiplied */ : "opaque" /* WebGPUConstants.CanvasAlphaMode.Opaque */,
        });
    }
    /**
     * Resize an image and returns the image data as an uint8array
     * @param image image to resize
     * @param bufferWidth destination buffer width
     * @param bufferHeight destination buffer height
     * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size
     */
    resizeImageBitmap(image, bufferWidth, bufferHeight) {
        return (0,engine_common/* ResizeImageBitmap */.jf)(this, image, bufferWidth, bufferHeight);
    }
    /**
     * Engine abstraction for loading and creating an image bitmap from a given source string.
     * @param imageSource source to load the image from.
     * @param options An object that sets options for the image's extraction.
     * @returns ImageBitmap
     */
    _createImageBitmapFromSource(imageSource, options) {
        return (0,engine_common/* CreateImageBitmapFromSource */.kF)(this, imageSource, options);
    }
    /**
     * Toggle full screen mode
     * @param requestPointerLock defines if a pointer lock should be requested from the user
     */
    switchFullscreen(requestPointerLock) {
        if (this.isFullscreen) {
            this.exitFullscreen();
        }
        else {
            this.enterFullscreen(requestPointerLock);
        }
    }
    /**
     * Enters full screen mode
     * @param requestPointerLock defines if a pointer lock should be requested from the user
     */
    enterFullscreen(requestPointerLock) {
        if (!this.isFullscreen) {
            this._pointerLockRequested = requestPointerLock;
            if (this._renderingCanvas) {
                (0,engine_common/* RequestFullscreen */.tl)(this._renderingCanvas);
            }
        }
    }
    /**
     * Exits full screen mode
     */
    exitFullscreen() {
        if (this.isFullscreen) {
            (0,engine_common/* ExitFullscreen */.g7)();
        }
    }
    /**
     * Enters Pointerlock mode
     */
    enterPointerlock() {
        if (this._renderingCanvas) {
            (0,engine_common/* RequestPointerlock */.eG)(this._renderingCanvas);
        }
    }
    /**
     * Exits Pointerlock mode
     */
    exitPointerlock() {
        (0,engine_common/* ExitPointerlock */.rT)();
    }
    _rebuildBuffers() {
        super._rebuildBuffers();
        for (const storageBuffer of this._storageBuffers) {
            // The buffer can already be rebuilt by the call to _rebuildGeometries(), which recreates the storage buffers for the ComputeShaderParticleSystem
            if (storageBuffer.getBuffer().engineId !== this.uniqueId) {
                storageBuffer._rebuild();
            }
        }
    }
    _restoreEngineAfterContextLost(initEngine) {
        WebGPUCacheRenderPipelineTree.ResetCache();
        WebGPUCacheBindGroups.ResetCache();
        // Clear the draw wrappers and material contexts
        const cleanScenes = (scenes) => {
            for (const scene of scenes) {
                for (const mesh of scene.meshes) {
                    const subMeshes = mesh.subMeshes;
                    if (!subMeshes) {
                        continue;
                    }
                    for (const subMesh of subMeshes) {
                        subMesh._drawWrappers = [];
                    }
                }
                for (const material of scene.materials) {
                    material._materialContext?.reset();
                }
            }
        };
        cleanScenes(this.scenes);
        cleanScenes(this._virtualScenes);
        // The leftOver uniform buffers are removed from the list because they will be recreated when we rebuild the effects
        const uboList = [];
        for (const uniformBuffer of this._uniformBuffers) {
            if (uniformBuffer.name.indexOf("leftOver") < 0) {
                uboList.push(uniformBuffer);
            }
        }
        this._uniformBuffers = uboList;
        super._restoreEngineAfterContextLost(initEngine);
    }
    /**
     * Force a specific size of the canvas
     * @param width defines the new canvas' width
     * @param height defines the new canvas' height
     * @param forceSetSize true to force setting the sizes of the underlying canvas
     * @returns true if the size was changed
     */
    setSize(width, height, forceSetSize = false) {
        if (!super.setSize(width, height, forceSetSize)) {
            return false;
        }
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log(["frame #" + this._count + " - setSize -", width, height]);
            }
        }
        this._initializeMainAttachments();
        if (this.snapshotRendering) {
            // reset snapshot rendering so that the next frame will record a new list of bundles
            this.snapshotRenderingReset();
        }
        return true;
    }
    /**
     * @internal
     */
    _getShaderProcessor(shaderLanguage) {
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return this._shaderProcessorWGSL;
        }
        return this._shaderProcessor;
    }
    /**
     * @internal
     */
    _getShaderProcessingContext(shaderLanguage, pureMode) {
        return new WebGPUShaderProcessingContext(shaderLanguage, pureMode);
    }
    _getCurrentRenderPass() {
        if (this._currentRenderTarget && !this._currentRenderPass) {
            // delayed creation of the render target pass, but we now need to create it as we are requested the render pass
            this._startRenderTargetRenderPass(this._currentRenderTarget, false, null, false, false);
        }
        else if (!this._currentRenderPass) {
            this._startMainRenderPass(false);
        }
        return this._currentRenderPass;
    }
    /** @internal */
    _getCurrentRenderPassWrapper() {
        return this._currentRenderTarget ? this._rttRenderPassWrapper : this._mainRenderPassWrapper;
    }
    //------------------------------------------------------------------------------
    //                          Static Pipeline WebGPU States
    //------------------------------------------------------------------------------
    /** @internal */
    applyStates() {
        this._stencilStateComposer.apply();
        this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend);
    }
    /**
     * Force the entire cache to be cleared
     * You should not have to use this function unless your engine needs to share the WebGPU context with another engine
     * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)
     */
    wipeCaches(bruteForce) {
        if (this.preventCacheWipeBetweenFrames && !bruteForce) {
            return;
        }
        //this._currentEffect = null; // can't reset _currentEffect, else some crashes can occur (for eg in ProceduralTexture which calls bindFrameBuffer (which calls wipeCaches) after having called enableEffect and before drawing into the texture)
        // _forceEnableEffect = true assumes the role of _currentEffect = null
        this._forceEnableEffect = true;
        this._currentIndexBuffer = null;
        this._currentOverrideVertexBuffers = null;
        this._cacheRenderPipeline.setBuffers(null, null, null);
        if (bruteForce) {
            this._stencilStateComposer.reset();
            this._depthCullingState.reset();
            this._depthCullingState.depthFunc = 515;
            this._alphaState.reset();
            this._alphaMode = 1;
            this._alphaEquation = 0;
            this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);
            this._cacheRenderPipeline.setAlphaBlendEnabled(false);
            this.setColorWrite(true);
        }
        this._cachedVertexBuffers = null;
        this._cachedIndexBuffer = null;
        this._cachedEffectForVertexBuffers = null;
    }
    /**
     * Enable or disable color writing
     * @param enable defines the state to set
     */
    setColorWrite(enable) {
        this._colorWriteLocal = enable;
        this._cacheRenderPipeline.setWriteMask(enable ? 0xf : 0);
    }
    /**
     * Gets a boolean indicating if color writing is enabled
     * @returns the current color writing state
     */
    getColorWrite() {
        return this._colorWriteLocal;
    }
    _mustUpdateViewport() {
        const x = this._viewportCached.x, y = this._viewportCached.y, w = this._viewportCached.z, h = this._viewportCached.w;
        const update = this._viewportsCurrent.x !== x || this._viewportsCurrent.y !== y || this._viewportsCurrent.w !== w || this._viewportsCurrent.h !== h;
        if (update) {
            this._viewportsCurrent.x = this._viewportCached.x;
            this._viewportsCurrent.y = this._viewportCached.y;
            this._viewportsCurrent.w = this._viewportCached.z;
            this._viewportsCurrent.h = this._viewportCached.w;
        }
        return update;
    }
    _applyViewport(bundleList) {
        const x = Math.floor(this._viewportCached.x);
        const w = Math.floor(this._viewportCached.z);
        const h = Math.floor(this._viewportCached.w);
        let y = Math.floor(this._viewportCached.y);
        if (!this._currentRenderTarget) {
            y = this.getRenderHeight(true) - y - h;
        }
        if (bundleList) {
            bundleList.addItem(new WebGPURenderItemViewport(x, y, w, h));
        }
        else {
            this._getCurrentRenderPass().setViewport(x, y, w, h, 0, 1);
        }
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log([
                    "frame #" + this._count + " - viewport applied - (",
                    this._viewportCached.x,
                    this._viewportCached.y,
                    this._viewportCached.z,
                    this._viewportCached.w,
                    ") current pass is main pass=" + this._currentPassIsMainPass(),
                ]);
            }
        }
    }
    /**
     * @internal
     */
    _viewport(x, y, width, height) {
        this._viewportCached.x = x;
        this._viewportCached.y = y;
        this._viewportCached.z = width;
        this._viewportCached.w = height;
    }
    _mustUpdateScissor() {
        const x = this._scissorCached.x, y = this._scissorCached.y, w = this._scissorCached.z, h = this._scissorCached.w;
        const update = this._scissorsCurrent.x !== x || this._scissorsCurrent.y !== y || this._scissorsCurrent.w !== w || this._scissorsCurrent.h !== h;
        if (update) {
            this._scissorsCurrent.x = this._scissorCached.x;
            this._scissorsCurrent.y = this._scissorCached.y;
            this._scissorsCurrent.w = this._scissorCached.z;
            this._scissorsCurrent.h = this._scissorCached.w;
        }
        return update;
    }
    _applyScissor(bundleList) {
        const y = this._currentRenderTarget ? this._scissorCached.y : this.getRenderHeight() - this._scissorCached.w - this._scissorCached.y;
        if (bundleList) {
            bundleList.addItem(new WebGPURenderItemScissor(this._scissorCached.x, y, this._scissorCached.z, this._scissorCached.w));
        }
        else {
            this._getCurrentRenderPass().setScissorRect(this._scissorCached.x, y, this._scissorCached.z, this._scissorCached.w);
        }
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log([
                    "frame #" + this._count + " - scissor applied - (",
                    this._scissorCached.x,
                    this._scissorCached.y,
                    this._scissorCached.z,
                    this._scissorCached.w,
                    ") current pass is main pass=" + this._currentPassIsMainPass(),
                ]);
            }
        }
    }
    _scissorIsActive() {
        return this._scissorCached.x !== 0 || this._scissorCached.y !== 0 || this._scissorCached.z !== 0 || this._scissorCached.w !== 0;
    }
    enableScissor(x, y, width, height) {
        this._scissorCached.x = x;
        this._scissorCached.y = y;
        this._scissorCached.z = width;
        this._scissorCached.w = height;
    }
    disableScissor() {
        this._scissorCached.x = this._scissorCached.y = this._scissorCached.z = this._scissorCached.w = 0;
        this._scissorsCurrent.x = this._scissorsCurrent.y = this._scissorsCurrent.w = this._scissorsCurrent.h = 0;
    }
    _mustUpdateStencilRef() {
        const update = this._stencilStateComposer.funcRef !== this._stencilRefsCurrent;
        if (update) {
            this._stencilRefsCurrent = this._stencilStateComposer.funcRef;
        }
        return update;
    }
    _applyStencilRef(bundleList) {
        if (bundleList) {
            bundleList.addItem(new WebGPURenderItemStencilRef(this._stencilStateComposer.funcRef ?? 0));
        }
        else {
            this._getCurrentRenderPass().setStencilReference(this._stencilStateComposer.funcRef ?? 0);
        }
    }
    _mustUpdateBlendColor() {
        const colorBlend = this._alphaState._blendConstants;
        const update = colorBlend[0] !== this._blendColorsCurrent[0] ||
            colorBlend[1] !== this._blendColorsCurrent[1] ||
            colorBlend[2] !== this._blendColorsCurrent[2] ||
            colorBlend[3] !== this._blendColorsCurrent[3];
        if (update) {
            this._blendColorsCurrent[0] = colorBlend[0];
            this._blendColorsCurrent[1] = colorBlend[1];
            this._blendColorsCurrent[2] = colorBlend[2];
            this._blendColorsCurrent[3] = colorBlend[3];
        }
        return update;
    }
    _applyBlendColor(bundleList) {
        if (bundleList) {
            bundleList.addItem(new WebGPURenderItemBlendColor(this._alphaState._blendConstants.slice()));
        }
        else {
            this._getCurrentRenderPass().setBlendConstant(this._alphaState._blendConstants);
        }
    }
    _resetRenderPassStates() {
        this._viewportsCurrent.x = this._viewportsCurrent.y = this._viewportsCurrent.w = this._viewportsCurrent.h = 0;
        this._scissorsCurrent.x = this._scissorsCurrent.y = this._scissorsCurrent.w = this._scissorsCurrent.h = 0;
        this._stencilRefsCurrent = -1;
        this._blendColorsCurrent[0] = this._blendColorsCurrent[1] = this._blendColorsCurrent[2] = this._blendColorsCurrent[3] = null;
    }
    /**
     * Clear the current render buffer or the current render target (if any is set up)
     * @param color defines the color to use
     * @param backBuffer defines if the back buffer must be cleared
     * @param depth defines if the depth buffer must be cleared
     * @param stencil defines if the stencil buffer must be cleared
     */
    clear(color, backBuffer, depth, stencil = false) {
        // Some PGs are using color3...
        if (color && color.a === undefined) {
            color.a = 1;
        }
        const hasScissor = this._scissorIsActive();
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log(["frame #" + this._count + " - clear - backBuffer=", backBuffer, " depth=", depth, " stencil=", stencil, " scissor is active=", hasScissor]);
            }
        }
        // We need to recreate the render pass so that the new parameters for clear color / depth / stencil are taken into account
        if (this._currentRenderTarget) {
            if (hasScissor) {
                if (!this._currentRenderPass) {
                    this._startRenderTargetRenderPass(this._currentRenderTarget, false, backBuffer ? color : null, depth, stencil);
                }
                this._applyScissor(!this.compatibilityMode ? this._bundleList : null);
                this._clearFullQuad(backBuffer ? color : null, depth, stencil);
            }
            else {
                if (this._currentRenderPass) {
                    this._endCurrentRenderPass();
                }
                this._startRenderTargetRenderPass(this._currentRenderTarget, true, backBuffer ? color : null, depth, stencil);
            }
        }
        else {
            if (!this._currentRenderPass || !hasScissor) {
                this._startMainRenderPass(!hasScissor, backBuffer ? color : null, depth, stencil);
            }
            if (hasScissor) {
                this._applyScissor(!this.compatibilityMode ? this._bundleList : null);
                this._clearFullQuad(backBuffer ? color : null, depth, stencil);
            }
        }
    }
    _clearFullQuad(clearColor, clearDepth, clearStencil) {
        const renderPass = !this.compatibilityMode ? null : this._getCurrentRenderPass();
        this._clearQuad.setColorFormat(this._colorFormat);
        this._clearQuad.setDepthStencilFormat(this._depthTextureFormat);
        this._clearQuad.setMRTAttachments(this._cacheRenderPipeline.mrtAttachments ?? [], this._cacheRenderPipeline.mrtTextureArray ?? [], this._cacheRenderPipeline.mrtTextureCount);
        if (!this.compatibilityMode) {
            this._bundleList.addItem(new WebGPURenderItemStencilRef(this._clearStencilValue));
        }
        else {
            renderPass.setStencilReference(this._clearStencilValue);
        }
        const bundle = this._clearQuad.clear(renderPass, clearColor, clearDepth, clearStencil, this.currentSampleCount);
        if (!this.compatibilityMode) {
            this._bundleList.addBundle(bundle);
            this._applyStencilRef(this._bundleList);
            this._reportDrawCall();
        }
        else {
            this._applyStencilRef(null);
        }
    }
    //------------------------------------------------------------------------------
    //                              Vertex/Index/Storage Buffers
    //------------------------------------------------------------------------------
    /**
     * Creates a vertex buffer
     * @param data the data or the size for the vertex buffer
     * @param _updatable whether the buffer should be created as updatable
     * @param label defines the label of the buffer (for debug purpose)
     * @returns the new buffer
     */
    createVertexBuffer(data, _updatable, label) {
        let view;
        if (data instanceof Array) {
            view = new Float32Array(data);
        }
        else if (data instanceof ArrayBuffer) {
            view = new Uint8Array(data);
        }
        else {
            view = data;
        }
        const dataBuffer = this._bufferManager.createBuffer(view, BufferUsage.Vertex | BufferUsage.CopyDst, label);
        return dataBuffer;
    }
    /**
     * Creates a vertex buffer
     * @param data the data for the dynamic vertex buffer
     * @param label defines the label of the buffer (for debug purpose)
     * @returns the new buffer
     */
    createDynamicVertexBuffer(data, label) {
        return this.createVertexBuffer(data, undefined, label);
    }
    /**
     * Creates a new index buffer
     * @param indices defines the content of the index buffer
     * @param _updatable defines if the index buffer must be updatable
     * @param label defines the label of the buffer (for debug purpose)
     * @returns a new buffer
     */
    createIndexBuffer(indices, _updatable, label) {
        let is32Bits = true;
        let view;
        if (indices instanceof Uint32Array || indices instanceof Int32Array) {
            view = indices;
        }
        else if (indices instanceof Uint16Array) {
            view = indices;
            is32Bits = false;
        }
        else {
            if (indices.length > 65535) {
                view = new Uint32Array(indices);
            }
            else {
                view = new Uint16Array(indices);
                is32Bits = false;
            }
        }
        const dataBuffer = this._bufferManager.createBuffer(view, BufferUsage.Index | BufferUsage.CopyDst, label);
        dataBuffer.is32Bits = is32Bits;
        return dataBuffer;
    }
    /**
     * Update a dynamic index buffer
     * @param indexBuffer defines the target index buffer
     * @param indices defines the data to update
     * @param offset defines the offset in the target index buffer where update should start
     */
    updateDynamicIndexBuffer(indexBuffer, indices, offset = 0) {
        const gpuBuffer = indexBuffer;
        let view;
        if (indexBuffer.is32Bits) {
            view = indices instanceof Uint32Array ? indices : new Uint32Array(indices);
        }
        else {
            view = indices instanceof Uint16Array ? indices : new Uint16Array(indices);
        }
        this._bufferManager.setSubData(gpuBuffer, offset, view);
    }
    /**
     * Updates a dynamic vertex buffer.
     * @param vertexBuffer the vertex buffer to update
     * @param data the data used to update the vertex buffer
     * @param byteOffset the byte offset of the data
     * @param byteLength the byte length of the data
     */
    updateDynamicVertexBuffer(vertexBuffer, data, byteOffset, byteLength) {
        const dataBuffer = vertexBuffer;
        if (byteOffset === undefined) {
            byteOffset = 0;
        }
        let view;
        if (byteLength === undefined) {
            if (data instanceof Array) {
                view = new Float32Array(data);
            }
            else if (data instanceof ArrayBuffer) {
                view = new Uint8Array(data);
            }
            else {
                view = data;
            }
            byteLength = view.byteLength;
        }
        else {
            if (data instanceof Array) {
                view = new Float32Array(data);
            }
            else if (data instanceof ArrayBuffer) {
                view = new Uint8Array(data);
            }
            else {
                view = data;
            }
        }
        this._bufferManager.setSubData(dataBuffer, byteOffset, view, 0, byteLength);
    }
    /**
     * @internal
     */
    _createBuffer(data, creationFlags, label) {
        let view;
        if (data instanceof Array) {
            view = new Float32Array(data);
        }
        else if (data instanceof ArrayBuffer) {
            view = new Uint8Array(data);
        }
        else {
            view = data;
        }
        let flags = 0;
        if (creationFlags & 1) {
            flags |= BufferUsage.CopySrc;
        }
        if (creationFlags & 2) {
            flags |= BufferUsage.CopyDst;
        }
        if (creationFlags & 4) {
            flags |= BufferUsage.Uniform;
        }
        if (creationFlags & 8) {
            flags |= BufferUsage.Vertex;
        }
        if (creationFlags & 16) {
            flags |= BufferUsage.Index;
        }
        if (creationFlags & 32) {
            flags |= BufferUsage.Storage;
        }
        if (creationFlags & 64) {
            flags |= BufferUsage.Indirect;
        }
        return this._bufferManager.createBuffer(view, flags, label);
    }
    /**
     * @internal
     */
    bindBuffersDirectly() {
        // eslint-disable-next-line no-throw-literal
        throw "Not implemented on WebGPU";
    }
    /**
     * @internal
     */
    updateAndBindInstancesBuffer() {
        // eslint-disable-next-line no-throw-literal
        throw "Not implemented on WebGPU";
    }
    /**
     * Unbind all instance attributes
     */
    unbindInstanceAttributes() {
        // Does nothing
    }
    /**
     * Bind a list of vertex buffers with the engine
     * @param vertexBuffers defines the list of vertex buffers to bind
     * @param indexBuffer defines the index buffer to bind
     * @param effect defines the effect associated with the vertex buffers
     * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
     */
    bindBuffers(vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {
        this._currentIndexBuffer = indexBuffer;
        this._currentOverrideVertexBuffers = overrideVertexBuffers ?? null;
        this._cacheRenderPipeline.setBuffers(vertexBuffers, indexBuffer, this._currentOverrideVertexBuffers);
    }
    /**
     * @internal
     */
    _releaseBuffer(buffer) {
        return this._bufferManager.releaseBuffer(buffer);
    }
    //------------------------------------------------------------------------------
    //                              Uniform Buffers
    //------------------------------------------------------------------------------
    /**
     * Create an uniform buffer
     * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
     * @param elements defines the content of the uniform buffer
     * @param label defines a name for the buffer (for debugging purpose)
     * @returns the webGL uniform buffer
     */
    createUniformBuffer(elements, label) {
        let view;
        if (elements instanceof Array) {
            view = new Float32Array(elements);
        }
        else {
            view = elements;
        }
        const dataBuffer = this._bufferManager.createBuffer(view, BufferUsage.Uniform | BufferUsage.CopyDst, label);
        return dataBuffer;
    }
    /**
     * Create a dynamic uniform buffer (no different from a non dynamic uniform buffer in WebGPU)
     * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
     * @param elements defines the content of the uniform buffer
     * @param label defines a name for the buffer (for debugging purpose)
     * @returns the webGL uniform buffer
     */
    createDynamicUniformBuffer(elements, label) {
        return this.createUniformBuffer(elements, label);
    }
    /**
     * Update an existing uniform buffer
     * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
     * @param uniformBuffer defines the target uniform buffer
     * @param elements defines the content to update
     * @param offset defines the offset in the uniform buffer where update should start
     * @param count defines the size of the data to update
     */
    updateUniformBuffer(uniformBuffer, elements, offset, count) {
        if (offset === undefined) {
            offset = 0;
        }
        const dataBuffer = uniformBuffer;
        let view;
        if (count === undefined) {
            if (elements instanceof Float32Array) {
                view = elements;
            }
            else {
                view = new Float32Array(elements);
            }
            count = view.byteLength;
        }
        else {
            if (elements instanceof Float32Array) {
                view = elements;
            }
            else {
                view = new Float32Array(elements);
            }
        }
        this._bufferManager.setSubData(dataBuffer, offset, view, 0, count);
    }
    /**
     * Bind a buffer to the current draw context
     * @param buffer defines the buffer to bind
     * @param _location not used in WebGPU
     * @param name Name of the uniform variable to bind
     */
    bindUniformBufferBase(buffer, _location, name) {
        this._currentDrawContext.setBuffer(name, buffer);
    }
    /**
     * Unused in WebGPU
     */
    bindUniformBlock() { }
    //------------------------------------------------------------------------------
    //                              Effects
    //------------------------------------------------------------------------------
    /**
     * Create a new effect (used to store vertex/fragment shaders)
     * @param baseName defines the base name of the effect (The name of file without .fragment.fx or .vertex.fx)
     * @param attributesNamesOrOptions defines either a list of attribute names or an IEffectCreationOptions object
     * @param uniformsNamesOrEngine defines either a list of uniform names or the engine to use
     * @param samplers defines an array of string used to represent textures
     * @param defines defines the string containing the defines to use to compile the shaders
     * @param fallbacks defines the list of potential fallbacks to use if shader compilation fails
     * @param onCompiled defines a function to call when the effect creation is successful
     * @param onError defines a function to call when the effect creation has failed
     * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
     * @param shaderLanguage the language the shader is written in (default: GLSL)
     * @param extraInitializationsAsync additional async code to run before preparing the effect
     * @returns the new Effect
     */
    createEffect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, defines, fallbacks, onCompiled, onError, indexParameters, shaderLanguage = 0 /* ShaderLanguage.GLSL */, extraInitializationsAsync) {
        const vertex = typeof baseName === "string" ? baseName : baseName.vertexToken || baseName.vertexSource || baseName.vertexElement || baseName.vertex;
        const fragment = typeof baseName === "string" ? baseName : baseName.fragmentToken || baseName.fragmentSource || baseName.fragmentElement || baseName.fragment;
        const globalDefines = this._getGlobalDefines();
        let fullDefines = defines ?? attributesNamesOrOptions.defines ?? "";
        if (globalDefines) {
            fullDefines += "\n" + globalDefines;
        }
        const name = vertex + "+" + fragment + "@" + fullDefines;
        if (this._compiledEffects[name]) {
            const compiledEffect = this._compiledEffects[name];
            if (onCompiled && compiledEffect.isReady()) {
                onCompiled(compiledEffect);
            }
            compiledEffect._refCount++;
            return compiledEffect;
        }
        const effect = new Materials_effect/* Effect */.M(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters, name, attributesNamesOrOptions.shaderLanguage ?? shaderLanguage, attributesNamesOrOptions.extraInitializationsAsync ?? extraInitializationsAsync);
        this._compiledEffects[name] = effect;
        return effect;
    }
    _compileRawShaderToSpirV(source, type) {
        return this._glslang.compileGLSL(source, type);
    }
    _compileShaderToSpirV(source, type, defines, shaderVersion) {
        return this._compileRawShaderToSpirV(shaderVersion + (defines ? defines + "\n" : "") + source, type);
    }
    _getWGSLShader(source, type, defines) {
        if (defines) {
            defines = "//" + defines.split("\n").join("\n//") + "\n";
        }
        else {
            defines = "";
        }
        return defines + source;
    }
    _createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage, disableUniformityAnalysisInVertex, disableUniformityAnalysisInFragment) {
        if (this._tintWASM && shaderLanguage === 0 /* ShaderLanguage.GLSL */) {
            vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader, disableUniformityAnalysisInVertex);
            fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader, disableUniformityAnalysisInFragment);
        }
        return {
            vertexStage: {
                module: this._device.createShaderModule({
                    label: "vertex",
                    code: vertexShader,
                }),
                entryPoint: "main",
            },
            fragmentStage: {
                module: this._device.createShaderModule({
                    label: "fragment",
                    code: fragmentShader,
                }),
                entryPoint: "main",
            },
        };
    }
    _compileRawPipelineStageDescriptor(vertexCode, fragmentCode, shaderLanguage) {
        const disableUniformityAnalysisInVertex = vertexCode.indexOf(`#define DISABLE_UNIFORMITY_ANALYSIS`) >= 0;
        const disableUniformityAnalysisInFragment = fragmentCode.indexOf(`#define DISABLE_UNIFORMITY_ANALYSIS`) >= 0;
        const vertexShader = shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? this._compileRawShaderToSpirV(vertexCode, "vertex") : vertexCode;
        const fragmentShader = shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? this._compileRawShaderToSpirV(fragmentCode, "fragment") : fragmentCode;
        return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage, disableUniformityAnalysisInVertex, disableUniformityAnalysisInFragment);
    }
    _compilePipelineStageDescriptor(vertexCode, fragmentCode, defines, shaderLanguage) {
        this.onBeforeShaderCompilationObservable.notifyObservers(this);
        const disableUniformityAnalysisInVertex = vertexCode.indexOf(`#define DISABLE_UNIFORMITY_ANALYSIS`) >= 0;
        const disableUniformityAnalysisInFragment = fragmentCode.indexOf(`#define DISABLE_UNIFORMITY_ANALYSIS`) >= 0;
        const shaderVersion = "#version 450\n";
        const vertexShader = shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? this._compileShaderToSpirV(vertexCode, "vertex", defines, shaderVersion) : this._getWGSLShader(vertexCode, "vertex", defines);
        const fragmentShader = shaderLanguage === 0 /* ShaderLanguage.GLSL */
            ? this._compileShaderToSpirV(fragmentCode, "fragment", defines, shaderVersion)
            : this._getWGSLShader(fragmentCode, "fragment", defines);
        const program = this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage, disableUniformityAnalysisInVertex, disableUniformityAnalysisInFragment);
        this.onAfterShaderCompilationObservable.notifyObservers(this);
        return program;
    }
    /**
     * @internal
     */
    createRawShaderProgram() {
        // eslint-disable-next-line no-throw-literal
        throw "Not available on WebGPU";
    }
    /**
     * @internal
     */
    createShaderProgram() {
        // eslint-disable-next-line no-throw-literal
        throw "Not available on WebGPU";
    }
    /**
     * Inline functions in shader code that are marked to be inlined
     * @param code code to inline
     * @returns inlined code
     */
    inlineShaderCode(code) {
        const sci = new shaderCodeInliner/* ShaderCodeInliner */.Y(code);
        sci.debug = false;
        sci.processCode();
        return sci.code;
    }
    /**
     * Creates a new pipeline context
     * @param shaderProcessingContext defines the shader processing context used during the processing if available
     * @returns the new pipeline
     */
    createPipelineContext(shaderProcessingContext) {
        return new WebGPUPipelineContext(shaderProcessingContext, this);
    }
    /**
     * Creates a new material context
     * @returns the new context
     */
    createMaterialContext() {
        return new WebGPUMaterialContext();
    }
    /**
     * Creates a new draw context
     * @returns the new context
     */
    createDrawContext() {
        return new WebGPUDrawContext(this._bufferManager);
    }
    /**
     * @internal
     */
    async _preparePipelineContext(pipelineContext, vertexSourceCode, fragmentSourceCode, createAsRaw, rawVertexSourceCode, rawFragmentSourceCode, _rebuildRebind, defines, _transformFeedbackVaryings, _key, onReady) {
        const webGpuContext = pipelineContext;
        const shaderLanguage = webGpuContext.shaderProcessingContext.shaderLanguage;
        if (shaderLanguage === 0 /* ShaderLanguage.GLSL */ && !this._glslangAndTintAreFullyLoaded) {
            await this.prepareGlslangAndTintAsync();
        }
        if (this.dbgShowShaderCode) {
            logger/* Logger */.V.Log(["defines", defines]);
            logger/* Logger */.V.Log(vertexSourceCode);
            logger/* Logger */.V.Log(fragmentSourceCode);
            logger/* Logger */.V.Log("***********************************************");
        }
        webGpuContext.sources = {
            fragment: fragmentSourceCode,
            vertex: vertexSourceCode,
            rawVertex: rawVertexSourceCode,
            rawFragment: rawFragmentSourceCode,
        };
        if (createAsRaw) {
            webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, shaderLanguage);
        }
        else {
            webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines, shaderLanguage);
        }
        onReady();
    }
    /**
     * Gets the list of active attributes for a given WebGPU program
     * @param pipelineContext defines the pipeline context to use
     * @param attributesNames defines the list of attribute names to get
     * @returns an array of indices indicating the offset of each attribute
     */
    getAttributes(pipelineContext, attributesNames) {
        const results = new Array(attributesNames.length);
        const gpuPipelineContext = pipelineContext;
        for (let i = 0; i < attributesNames.length; i++) {
            const attributeName = attributesNames[i];
            const attributeLocation = gpuPipelineContext.shaderProcessingContext.availableAttributes[attributeName];
            if (attributeLocation === undefined) {
                continue;
            }
            results[i] = attributeLocation;
        }
        return results;
    }
    /**
     * Activates an effect, making it the current one (ie. the one used for rendering)
     * @param effect defines the effect to activate
     */
    enableEffect(effect) {
        if (!effect) {
            return;
        }
        if (!(0,drawWrapper_functions/* IsWrapper */.E)(effect)) {
            this._currentEffect = effect;
            this._currentMaterialContext = this._defaultMaterialContext;
            this._currentDrawContext = this._defaultDrawContext;
            this._counters.numEnableEffects++;
            if (this.dbgLogIfNotDrawWrapper) {
                logger/* Logger */.V.Warn(`enableEffect has been called with an Effect and not a Wrapper! effect.uniqueId=${effect.uniqueId}, effect.name=${effect.name}, effect.name.vertex=${typeof effect.name === "string" ? "" : effect.name.vertex}, effect.name.fragment=${typeof effect.name === "string" ? "" : effect.name.fragment}`, 10);
            }
        }
        else if (!effect.effect ||
            (effect.effect === this._currentEffect &&
                effect.materialContext === this._currentMaterialContext &&
                effect.drawContext === this._currentDrawContext &&
                !this._forceEnableEffect)) {
            if (!effect.effect && this.dbgShowEmptyEnableEffectCalls) {
                logger/* Logger */.V.Log(["drawWrapper=", effect]);
                // eslint-disable-next-line no-throw-literal
                throw "Invalid call to enableEffect: the effect property is empty!";
            }
            return;
        }
        else {
            this._currentEffect = effect.effect;
            this._currentMaterialContext = effect.materialContext;
            this._currentDrawContext = effect.drawContext;
            this._counters.numEnableDrawWrapper++;
            if (!this._currentMaterialContext) {
                logger/* Logger */.V.Log(["drawWrapper=", effect]);
                // eslint-disable-next-line no-throw-literal
                throw `Invalid call to enableEffect: the materialContext property is empty!`;
            }
        }
        this._stencilStateComposer.stencilMaterial = undefined;
        this._forceEnableEffect = false;
        if (this._currentEffect.onBind) {
            this._currentEffect.onBind(this._currentEffect);
        }
        if (this._currentEffect._onBindObservable) {
            this._currentEffect._onBindObservable.notifyObservers(this._currentEffect);
        }
    }
    /**
     * @internal
     */
    _releaseEffect(effect) {
        if (this._compiledEffects[effect._key]) {
            delete this._compiledEffects[effect._key];
            this._deletePipelineContext(effect.getPipelineContext());
        }
    }
    /**
     * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled
     */
    releaseEffects() {
        for (const name in this._compiledEffects) {
            const webGPUPipelineContext = this._compiledEffects[name].getPipelineContext();
            this._deletePipelineContext(webGPUPipelineContext);
        }
        this._compiledEffects = {};
    }
    _deletePipelineContext(pipelineContext) {
        const webgpuPipelineContext = pipelineContext;
        if (webgpuPipelineContext) {
            (0,effect_functions/* resetCachedPipeline */.mO)(webgpuPipelineContext);
        }
    }
    //------------------------------------------------------------------------------
    //                              Textures
    //------------------------------------------------------------------------------
    /**
     * Gets a boolean indicating that only power of 2 textures are supported
     * Please note that you can still use non power of 2 textures but in this case the engine will forcefully convert them
     */
    get needPOTTextures() {
        return false;
    }
    /** @internal */
    _createHardwareTexture() {
        return new WebGPUHardwareTexture(this);
    }
    /**
     * @internal
     */
    _releaseTexture(texture) {
        const index = this._internalTexturesCache.indexOf(texture);
        if (index !== -1) {
            this._internalTexturesCache.splice(index, 1);
        }
        this._textureHelper.releaseTexture(texture);
    }
    /**
     * @internal
     */
    _getRGBABufferInternalSizedFormat() {
        return 5;
    }
    updateTextureComparisonFunction(texture, comparisonFunction) {
        texture._comparisonFunction = comparisonFunction;
    }
    /**
     * Creates an internal texture without binding it to a framebuffer
     * @internal
     * @param size defines the size of the texture
     * @param options defines the options used to create the texture
     * @param delayGPUTextureCreation true to delay the texture creation the first time it is really needed. false to create it right away
     * @param source source type of the texture
     * @returns a new internal texture
     */
    _createInternalTexture(size, options, delayGPUTextureCreation = true, source = 0 /* InternalTextureSource.Unknown */) {
        const fullOptions = {};
        if (options !== undefined && typeof options === "object") {
            fullOptions.generateMipMaps = options.generateMipMaps;
            fullOptions.createMipMaps = options.createMipMaps;
            fullOptions.type = options.type === undefined ? 0 : options.type;
            fullOptions.samplingMode = options.samplingMode === undefined ? 3 : options.samplingMode;
            fullOptions.format = options.format === undefined ? 5 : options.format;
            fullOptions.samples = options.samples ?? 1;
            fullOptions.creationFlags = options.creationFlags ?? 0;
            fullOptions.useSRGBBuffer = options.useSRGBBuffer ?? false;
            fullOptions.label = options.label;
        }
        else {
            fullOptions.generateMipMaps = options;
            fullOptions.type = 0;
            fullOptions.samplingMode = 3;
            fullOptions.format = 5;
            fullOptions.samples = 1;
            fullOptions.creationFlags = 0;
            fullOptions.useSRGBBuffer = false;
        }
        if (fullOptions.type === 1 && !this._caps.textureFloatLinearFiltering) {
            fullOptions.samplingMode = 1;
        }
        else if (fullOptions.type === 2 && !this._caps.textureHalfFloatLinearFiltering) {
            fullOptions.samplingMode = 1;
        }
        if (fullOptions.type === 1 && !this._caps.textureFloat) {
            fullOptions.type = 0;
            logger/* Logger */.V.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE");
        }
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, source);
        const width = size.width || size;
        const height = size.height || size;
        const depth = size.depth || 0;
        const layers = size.layers || 0;
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.width = width;
        texture.height = height;
        texture.depth = depth || layers;
        texture.isReady = true;
        texture.samples = fullOptions.samples;
        texture.generateMipMaps = !!fullOptions.generateMipMaps;
        texture.samplingMode = fullOptions.samplingMode;
        texture.type = fullOptions.type;
        texture.format = fullOptions.format;
        texture.is2DArray = layers > 0;
        texture.is3D = depth > 0;
        texture._cachedWrapU = 0;
        texture._cachedWrapV = 0;
        texture._useSRGBBuffer = fullOptions.useSRGBBuffer;
        texture.label = fullOptions.label;
        this._internalTexturesCache.push(texture);
        if (!delayGPUTextureCreation) {
            const createMipMapsOnly = !fullOptions.generateMipMaps && fullOptions.createMipMaps;
            if (createMipMapsOnly) {
                // So that the call to createGPUTextureForInternalTexture creates the mipmaps
                texture.generateMipMaps = true;
            }
            this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, layers || 1, fullOptions.creationFlags);
            if (createMipMapsOnly) {
                // So that we don't automatically generate mipmaps when the render target is unbound
                texture.generateMipMaps = false;
            }
        }
        return texture;
    }
    /**
     * Usually called from Texture.ts.
     * Passed information to create a hardware texture
     * @param url defines a value which contains one of the following:
     * * A conventional http URL, e.g. 'http://...' or 'file://...'
     * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
     * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
     * @param noMipmap defines a boolean indicating that no mipmaps shall be generated.  Ignored for compressed textures.  They must be in the file
     * @param invertY when true, image is flipped when loaded.  You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
     * @param scene needed for loading to the correct scene
     * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
     * @param onLoad optional callback to be called upon successful completion
     * @param onError optional callback to be called upon failure
     * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
     * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
     * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
     * @param forcedExtension defines the extension to use to pick the right loader
     * @param mimeType defines an optional mime type
     * @param loaderOptions options to be passed to the loader
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
     * @returns a InternalTexture for assignment back into BABYLON.Texture
     */
    createTexture(url, noMipmap, invertY, scene, samplingMode = 3, onLoad = null, onError = null, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, creationFlags, useSRGBBuffer) {
        return this._createTextureBase(url, noMipmap, invertY, scene, samplingMode, onLoad, onError, (texture, extension, scene, img, invertY, noMipmap, isCompressed, processFunction) => {
            const imageBitmap = img; // we will never get an HTMLImageElement in WebGPU
            texture.baseWidth = imageBitmap.width;
            texture.baseHeight = imageBitmap.height;
            texture.width = imageBitmap.width;
            texture.height = imageBitmap.height;
            texture.format = texture.format !== -1 ? texture.format : (format ?? 5);
            texture.type = texture.type !== -1 ? texture.type : 0;
            texture._creationFlags = creationFlags ?? 0;
            processFunction(texture.width, texture.height, imageBitmap, extension, texture, () => { });
            if (!texture._hardwareTexture?.underlyingResource) {
                // the texture could have been created before reaching this point so don't recreate it if already existing
                const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, imageBitmap.width, imageBitmap.height, undefined, creationFlags);
                if (WebGPUTextureHelper.IsImageBitmap(imageBitmap)) {
                    this._textureHelper.updateTexture(imageBitmap, texture, imageBitmap.width, imageBitmap.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);
                    if (!noMipmap && !isCompressed) {
                        this._generateMipmaps(texture, this._uploadEncoder);
                    }
                }
            }
            else if (!noMipmap && !isCompressed) {
                this._generateMipmaps(texture, this._uploadEncoder);
            }
            if (scene) {
                scene.removePendingData(texture);
            }
            texture.isReady = true;
            texture.onLoadedObservable.notifyObservers(texture);
            texture.onLoadedObservable.clear();
        }, () => false, buffer, fallback, format, forcedExtension, mimeType, loaderOptions, useSRGBBuffer);
    }
    /**
     * Wraps an external web gpu texture in a Babylon texture.
     * @param texture defines the external texture
     * @returns the babylon internal texture
     */
    wrapWebGPUTexture(texture) {
        const hardwareTexture = new WebGPUHardwareTexture(this, texture);
        const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(this, 0 /* InternalTextureSource.Unknown */, true);
        internalTexture._hardwareTexture = hardwareTexture;
        internalTexture.isReady = true;
        return internalTexture;
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Wraps an external web gl texture in a Babylon texture.
     * @returns the babylon internal texture
     */
    wrapWebGLTexture() {
        throw new Error("wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.");
    }
    /**
     * @internal
     */
    _getUseSRGBBuffer(useSRGBBuffer, _noMipmap) {
        return useSRGBBuffer && this._caps.supportSRGBBuffers;
    }
    /**
     * @internal
     */
    _unpackFlipY(value) { }
    /**
     * Update the sampling mode of a given texture
     * @param samplingMode defines the required sampling mode
     * @param texture defines the texture to update
     * @param generateMipMaps defines whether to generate mipmaps for the texture
     */
    updateTextureSamplingMode(samplingMode, texture, generateMipMaps = false) {
        if (generateMipMaps) {
            texture.generateMipMaps = true;
            this._generateMipmaps(texture);
        }
        texture.samplingMode = samplingMode;
    }
    /**
     * Update the sampling mode of a given texture
     * @param texture defines the texture to update
     * @param wrapU defines the texture wrap mode of the u coordinates
     * @param wrapV defines the texture wrap mode of the v coordinates
     * @param wrapR defines the texture wrap mode of the r coordinates
     */
    updateTextureWrappingMode(texture, wrapU, wrapV = null, wrapR = null) {
        if (wrapU !== null) {
            texture._cachedWrapU = wrapU;
        }
        if (wrapV !== null) {
            texture._cachedWrapV = wrapV;
        }
        if ((texture.is2DArray || texture.is3D) && wrapR !== null) {
            texture._cachedWrapR = wrapR;
        }
    }
    /**
     * Update the dimensions of a texture
     * @param texture texture to update
     * @param width new width of the texture
     * @param height new height of the texture
     * @param depth new depth of the texture
     */
    updateTextureDimensions(texture, width, height, depth = 1) {
        if (!texture._hardwareTexture) {
            // the gpu texture is not created yet, so when it is it will be created with the right dimensions
            return;
        }
        if (texture.width === width && texture.height === height && texture.depth === depth) {
            return;
        }
        const additionalUsages = texture._hardwareTexture.textureAdditionalUsages;
        texture._hardwareTexture.release(); // don't defer the releasing! Else we will release at the end of this frame the gpu texture we are about to create in the next line...
        this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, additionalUsages);
    }
    /**
     * @internal
     */
    _setInternalTexture(name, texture, baseName) {
        baseName = baseName ?? name;
        if (this._currentEffect) {
            const webgpuPipelineContext = this._currentEffect._pipelineContext;
            const availableTexture = webgpuPipelineContext.shaderProcessingContext.availableTextures[baseName];
            this._currentMaterialContext.setTexture(name, texture);
            if (availableTexture && availableTexture.autoBindSampler) {
                const samplerName = baseName + `Sampler`;
                this._currentMaterialContext.setSampler(samplerName, texture); // we can safely cast to InternalTexture because ExternalTexture always has autoBindSampler = false
            }
        }
    }
    /**
     * Create a cube texture from prefiltered data (ie. the mipmaps contain ready to use data for PBR reflection)
     * @param rootUrl defines the url where the file to load is located
     * @param scene defines the current scene
     * @param lodScale defines scale to apply to the mip map selection
     * @param lodOffset defines offset to apply to the mip map selection
     * @param onLoad defines an optional callback raised when the texture is loaded
     * @param onError defines an optional callback raised if there is an issue to load the texture
     * @param format defines the format of the data
     * @param forcedExtension defines the extension to use to pick the right loader
     * @param createPolynomials defines wheter or not to create polynomails harmonics for the texture
     * @returns the cube texture as an InternalTexture
     */
    createPrefilteredCubeTexture(rootUrl, scene, lodScale, lodOffset, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = true) {
        const callback = (loadData) => {
            if (!loadData) {
                if (onLoad) {
                    onLoad(null);
                }
                return;
            }
            const texture = loadData.texture;
            if (!createPolynomials) {
                texture._sphericalPolynomial = new sphericalPolynomial/* SphericalPolynomial */.Q();
            }
            else if (loadData.info.sphericalPolynomial) {
                texture._sphericalPolynomial = loadData.info.sphericalPolynomial;
            }
            texture._source = 9 /* InternalTextureSource.CubePrefiltered */;
            if (onLoad) {
                onLoad(texture);
            }
        };
        return this.createCubeTexture(rootUrl, scene, null, false, callback, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset);
    }
    /**
     * Sets a texture to the according uniform.
     * @param channel The texture channel
     * @param unused unused parameter
     * @param texture The texture to apply
     * @param name The name of the uniform in the effect
     */
    setTexture(channel, unused, texture, name) {
        this._setTexture(channel, texture, false, false, name, name);
    }
    /**
     * Sets an array of texture to the WebGPU context
     * @param channel defines the channel where the texture array must be set
     * @param unused unused parameter
     * @param textures defines the array of textures to bind
     * @param name name of the channel
     */
    setTextureArray(channel, unused, textures, name) {
        for (let index = 0; index < textures.length; index++) {
            this._setTexture(-1, textures[index], true, false, name + index.toString(), name);
        }
    }
    /**
     * @internal
     */
    _setTexture(channel, texture, 
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    isPartOfTextureArray = false, depthStencilTexture = false, name = "", baseName) {
        // name == baseName for a texture that is not part of a texture array
        // Else, name is something like 'myTexture0' / 'myTexture1' / ... and baseName is 'myTexture'
        // baseName is used to look up the texture in the shaderProcessingContext.availableTextures map
        // name is used to look up the texture in the _currentMaterialContext.textures map
        baseName = baseName ?? name;
        if (this._currentEffect) {
            if (!texture) {
                this._currentMaterialContext.setTexture(name, null);
                return false;
            }
            // Video
            if (texture.video) {
                texture.update();
            }
            else if (texture.delayLoadState === 4) {
                // Delay loading
                texture.delayLoad();
                return false;
            }
            let internalTexture = null;
            if (depthStencilTexture) {
                internalTexture = texture.depthStencilTexture;
            }
            else if (texture.isReady()) {
                internalTexture = texture.getInternalTexture();
            }
            else if (texture.isCube) {
                internalTexture = this.emptyCubeTexture;
            }
            else if (texture.is3D) {
                internalTexture = this.emptyTexture3D;
            }
            else if (texture.is2DArray) {
                internalTexture = this.emptyTexture2DArray;
            }
            else {
                internalTexture = this.emptyTexture;
            }
            if (internalTexture && !internalTexture.isMultiview) {
                // CUBIC_MODE and SKYBOX_MODE both require CLAMP_TO_EDGE.  All other modes use REPEAT.
                if (internalTexture.isCube && internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) {
                    internalTexture._cachedCoordinatesMode = texture.coordinatesMode;
                    const textureWrapMode = texture.coordinatesMode !== 3 && texture.coordinatesMode !== 5
                        ? 1
                        : 0;
                    texture.wrapU = textureWrapMode;
                    texture.wrapV = textureWrapMode;
                }
                internalTexture._cachedWrapU = texture.wrapU;
                internalTexture._cachedWrapV = texture.wrapV;
                if (internalTexture.is3D) {
                    internalTexture._cachedWrapR = texture.wrapR;
                }
                this._setAnisotropicLevel(0, internalTexture, texture.anisotropicFilteringLevel);
            }
            this._setInternalTexture(name, internalTexture, baseName);
        }
        else {
            if (this.dbgVerboseLogsForFirstFrames) {
                if (this._count === undefined) {
                    this._count = 0;
                }
                if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                    logger/* Logger */.V.Log(["frame #" + this._count + " - _setTexture called with a null _currentEffect! texture=", texture]);
                }
            }
        }
        return true;
    }
    /**
     * @internal
     */
    _setAnisotropicLevel(target, internalTexture, anisotropicFilteringLevel) {
        if (internalTexture._cachedAnisotropicFilteringLevel !== anisotropicFilteringLevel) {
            internalTexture._cachedAnisotropicFilteringLevel = Math.min(anisotropicFilteringLevel, this._caps.maxAnisotropy);
        }
    }
    /**
     * @internal
     */
    _bindTexture(channel, texture, name) {
        if (channel === undefined) {
            return;
        }
        this._setInternalTexture(name, texture);
    }
    /**
     * Generates the mipmaps for a texture
     * @param texture texture to generate the mipmaps for
     */
    generateMipmaps(texture) {
        this._generateMipmaps(texture);
    }
    /**
     * Update a portion of an internal texture
     * @param texture defines the texture to update
     * @param imageData defines the data to store into the texture
     * @param xOffset defines the x coordinates of the update rectangle
     * @param yOffset defines the y coordinates of the update rectangle
     * @param width defines the width of the update rectangle
     * @param height defines the height of the update rectangle
     * @param faceIndex defines the face index if texture is a cube (0 by default)
     * @param lod defines the lod level to update (0 by default)
     * @param generateMipMaps defines whether to generate mipmaps or not
     */
    updateTextureData(texture, imageData, xOffset, yOffset, width, height, faceIndex = 0, lod = 0, generateMipMaps = false) {
        let gpuTextureWrapper = texture._hardwareTexture;
        if (!texture._hardwareTexture?.underlyingResource) {
            gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture);
        }
        const data = new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength);
        this._textureHelper.updateTexture(data, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, false, xOffset, yOffset);
        if (generateMipMaps) {
            this._generateMipmaps(texture);
        }
    }
    /**
     * @internal
     */
    _uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, imageData, faceIndex = 0, lod = 0) {
        let gpuTextureWrapper = texture._hardwareTexture;
        if (!texture._hardwareTexture?.underlyingResource) {
            texture.format = internalFormat;
            gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);
        }
        const data = new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength);
        this._textureHelper.updateTexture(data, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, false, false, 0, 0);
    }
    /**
     * @internal
     */
    _uploadDataToTextureDirectly(texture, imageData, faceIndex = 0, lod = 0, babylonInternalFormat, useTextureWidthAndHeight = false) {
        const lodMaxWidth = Math.round(Math.log(texture.width) * Math.LOG2E);
        const lodMaxHeight = Math.round(Math.log(texture.height) * Math.LOG2E);
        const width = useTextureWidthAndHeight ? texture.width : Math.pow(2, Math.max(lodMaxWidth - lod, 0));
        const height = useTextureWidthAndHeight ? texture.height : Math.pow(2, Math.max(lodMaxHeight - lod, 0));
        let gpuTextureWrapper = texture._hardwareTexture;
        if (!texture._hardwareTexture?.underlyingResource) {
            gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);
        }
        const data = new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength);
        this._textureHelper.updateTexture(data, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, false, 0, 0);
    }
    /**
     * @internal
     */
    _uploadArrayBufferViewToTexture(texture, imageData, faceIndex = 0, lod = 0) {
        this._uploadDataToTextureDirectly(texture, imageData, faceIndex, lod);
    }
    /**
     * @internal
     */
    _uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) {
        let gpuTextureWrapper = texture._hardwareTexture;
        if (!texture._hardwareTexture?.underlyingResource) {
            gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture);
        }
        if (image instanceof HTMLImageElement) {
            // eslint-disable-next-line no-throw-literal
            throw "WebGPU engine: HTMLImageElement not supported in _uploadImageToTexture!";
        }
        const bitmap = image; // in WebGPU we will always get an ImageBitmap, not an HTMLImageElement
        const width = Math.ceil(texture.width / (1 << lod));
        const height = Math.ceil(texture.height / (1 << lod));
        this._textureHelper.updateTexture(bitmap, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, false, 0, 0);
    }
    /**
     * Reads pixels from the current frame buffer. Please note that this function can be slow
     * @param x defines the x coordinate of the rectangle where pixels must be read
     * @param y defines the y coordinate of the rectangle where pixels must be read
     * @param width defines the width of the rectangle where pixels must be read
     * @param height defines the height of the rectangle where pixels must be read
     * @param hasAlpha defines whether the output should have alpha or not (defaults to true)
     * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
     * @returns a ArrayBufferView promise (Uint8Array) containing RGBA colors
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    readPixels(x, y, width, height, hasAlpha = true, flushRenderer = true) {
        const renderPassWrapper = this._getCurrentRenderPassWrapper();
        const hardwareTexture = renderPassWrapper.colorAttachmentGPUTextures[0];
        if (!hardwareTexture) {
            // we are calling readPixels for a render pass with no color texture bound
            return Promise.resolve(new Uint8Array(0));
        }
        const gpuTexture = hardwareTexture.underlyingResource;
        const gpuTextureFormat = hardwareTexture.format;
        if (!gpuTexture) {
            // we are calling readPixels before startMainRenderPass has been called and no RTT is bound, so swapChainTexture is not setup yet!
            return Promise.resolve(new Uint8Array(0));
        }
        if (flushRenderer) {
            this.flushFramebuffer();
        }
        return this._textureHelper.readPixels(gpuTexture, x, y, width, height, gpuTextureFormat);
    }
    //------------------------------------------------------------------------------
    //                              Frame management
    //------------------------------------------------------------------------------
    _measureFps() {
        this._performanceMonitor.sampleFrame();
        this._fps = this._performanceMonitor.averageFPS;
        this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;
    }
    /**
     * Gets the performance monitor attached to this engine
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
     */
    get performanceMonitor() {
        return this._performanceMonitor;
    }
    /**
     * Begin a new frame
     */
    beginFrame() {
        this._measureFps();
        super.beginFrame();
    }
    /**
     * End the current frame
     */
    endFrame() {
        this._endCurrentRenderPass();
        this._snapshotRendering.endFrame();
        this._timestampQuery.endFrame(this._renderEncoder);
        this._timestampIndex = 0;
        this.flushFramebuffer();
        this._textureHelper.destroyDeferredTextures();
        this._bufferManager.destroyDeferredBuffers();
        if (this._features._collectUbosUpdatedInFrame) {
            if (this.dbgVerboseLogsForFirstFrames) {
                if (this._count === undefined) {
                    this._count = 0;
                }
                if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                    const list = [];
                    for (const name in uniformBuffer/* UniformBuffer */.D._UpdatedUbosInFrame) {
                        list.push(name + ":" + uniformBuffer/* UniformBuffer */.D._UpdatedUbosInFrame[name]);
                    }
                    logger/* Logger */.V.Log(["frame #" + this._count + " - updated ubos -", list.join(", ")]);
                }
            }
            uniformBuffer/* UniformBuffer */.D._UpdatedUbosInFrame = {};
        }
        this.countersLastFrame.numEnableEffects = this._counters.numEnableEffects;
        this.countersLastFrame.numEnableDrawWrapper = this._counters.numEnableDrawWrapper;
        this.countersLastFrame.numBundleCreationNonCompatMode = this._counters.numBundleCreationNonCompatMode;
        this.countersLastFrame.numBundleReuseNonCompatMode = this._counters.numBundleReuseNonCompatMode;
        this._counters.numEnableEffects = 0;
        this._counters.numEnableDrawWrapper = 0;
        this._counters.numBundleCreationNonCompatMode = 0;
        this._counters.numBundleReuseNonCompatMode = 0;
        this._cacheRenderPipeline.endFrame();
        this._cacheBindGroups.endFrame();
        this._pendingDebugCommands.length = 0;
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log(["%c frame #" + this._count + " - end", "background: #ffff00"]);
            }
            if (this._count < this.dbgVerboseLogsNumFrames) {
                this._count++;
                if (this._count !== this.dbgVerboseLogsNumFrames) {
                    logger/* Logger */.V.Log(["%c frame #" + this._count + " - begin", "background: #ffff00"]);
                }
            }
        }
        super.endFrame();
    }
    /**Gets driver info if available */
    extractDriverInfo() {
        return "";
    }
    /**
     * Force a WebGPU flush (ie. a flush of all waiting commands)
     */
    flushFramebuffer() {
        // we need to end the current render pass (main or rtt) if any as we are not allowed to submit the command buffers when being in a pass
        this._endCurrentRenderPass();
        this._commandBuffers[0] = this._uploadEncoder.finish();
        this._commandBuffers[1] = this._renderEncoder.finish();
        this._device.queue.submit(this._commandBuffers);
        this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor);
        this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor);
        this._timestampQuery.startFrame(this._uploadEncoder);
        this._textureHelper.setCommandEncoder(this._uploadEncoder);
        this._bundleList.reset();
    }
    /** @internal */
    _currentFrameBufferIsDefaultFrameBuffer() {
        return this._currentPassIsMainPass();
    }
    //------------------------------------------------------------------------------
    //                              Render Pass
    //------------------------------------------------------------------------------
    _startRenderTargetRenderPass(renderTargetWrapper, setClearStates, clearColor, clearDepth, clearStencil) {
        this._endCurrentRenderPass();
        const rtWrapper = renderTargetWrapper;
        const depthStencilTexture = rtWrapper._depthStencilTexture;
        const gpuDepthStencilWrapper = depthStencilTexture?._hardwareTexture;
        const gpuDepthStencilTexture = gpuDepthStencilWrapper?.underlyingResource;
        const gpuDepthStencilMSAATexture = gpuDepthStencilWrapper?.getMSAATexture(0);
        const depthTextureView = gpuDepthStencilTexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
        const depthMSAATextureView = gpuDepthStencilMSAATexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
        const depthTextureHasStencil = gpuDepthStencilWrapper ? WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format) : false;
        const colorAttachments = [];
        if (this.useReverseDepthBuffer) {
            this.setDepthFunctionToGreaterOrEqual();
        }
        const clearColorForIntegerRT = tempColor4;
        if (clearColor) {
            clearColorForIntegerRT.r = clearColor.r * 255;
            clearColorForIntegerRT.g = clearColor.g * 255;
            clearColorForIntegerRT.b = clearColor.b * 255;
            clearColorForIntegerRT.a = clearColor.a * 255;
        }
        const mustClearColor = setClearStates && clearColor;
        const mustClearDepth = setClearStates && clearDepth;
        const mustClearStencil = setClearStates && clearStencil;
        if (rtWrapper._attachments && rtWrapper.isMulti) {
            // multi render targets
            if (!this._mrtAttachments || this._mrtAttachments.length === 0) {
                this._mrtAttachments = rtWrapper._defaultAttachments;
            }
            for (let i = 0; i < this._mrtAttachments.length; ++i) {
                const index = this._mrtAttachments[i]; // if index == 0 it means the texture should not be written to => at render pass creation time, it means we should not clear it
                const mrtTexture = rtWrapper.textures[i];
                const gpuMRTWrapper = mrtTexture?._hardwareTexture;
                const gpuMRTTexture = gpuMRTWrapper?.underlyingResource;
                if (gpuMRTWrapper && gpuMRTTexture) {
                    const baseArrayLayer = rtWrapper.getBaseArrayLayer(i);
                    const gpuMSAATexture = gpuMRTWrapper.getMSAATexture(baseArrayLayer);
                    const viewDescriptor = {
                        ...this._rttRenderPassWrapper.colorAttachmentViewDescriptor,
                        dimension: mrtTexture.is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
                        format: gpuMRTWrapper.format,
                        baseArrayLayer,
                    };
                    const msaaViewDescriptor = {
                        ...this._rttRenderPassWrapper.colorAttachmentViewDescriptor,
                        dimension: mrtTexture.is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
                        format: gpuMRTWrapper.format,
                        baseArrayLayer: 0,
                    };
                    const isRTInteger = mrtTexture.type === 7 || mrtTexture.type === 5;
                    const colorTextureView = gpuMRTTexture.createView(viewDescriptor);
                    const colorMSAATextureView = gpuMSAATexture?.createView(msaaViewDescriptor);
                    colorAttachments.push({
                        view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,
                        resolveTarget: gpuMSAATexture ? colorTextureView : undefined,
                        depthSlice: mrtTexture.is3D ? (rtWrapper.layerIndices?.[i] ?? 0) : undefined,
                        clearValue: index !== 0 && mustClearColor ? (isRTInteger ? clearColorForIntegerRT : clearColor) : undefined,
                        loadOp: index !== 0 && mustClearColor ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */,
                        storeOp: "store" /* WebGPUConstants.StoreOp.Store */,
                    });
                }
            }
            this._cacheRenderPipeline.setMRT(rtWrapper.textures, this._mrtAttachments.length);
            this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);
        }
        else {
            // single render target
            const internalTexture = rtWrapper.texture;
            if (internalTexture) {
                const gpuWrapper = internalTexture._hardwareTexture;
                const gpuTexture = gpuWrapper.underlyingResource;
                let depthSlice = undefined;
                if (rtWrapper.is3D) {
                    depthSlice = this._rttRenderPassWrapper.colorAttachmentViewDescriptor.baseArrayLayer;
                    this._rttRenderPassWrapper.colorAttachmentViewDescriptor.baseArrayLayer = 0;
                }
                const gpuMSAATexture = gpuWrapper.getMSAATexture(0);
                const colorTextureView = gpuTexture.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor);
                const colorMSAATextureView = gpuMSAATexture?.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor);
                const isRTInteger = internalTexture.type === 7 || internalTexture.type === 5;
                colorAttachments.push({
                    view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,
                    resolveTarget: gpuMSAATexture ? colorTextureView : undefined,
                    depthSlice,
                    clearValue: mustClearColor ? (isRTInteger ? clearColorForIntegerRT : clearColor) : undefined,
                    loadOp: mustClearColor ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */,
                    storeOp: "store" /* WebGPUConstants.StoreOp.Store */,
                });
            }
            else {
                colorAttachments.push(null);
            }
        }
        this._debugPushGroup?.("render target pass" + (renderTargetWrapper.label ? " (" + renderTargetWrapper.label + ")" : ""), 0);
        this._rttRenderPassWrapper.renderPassDescriptor = {
            label: (renderTargetWrapper.label ?? "RTT") + " - RenderPass",
            colorAttachments,
            depthStencilAttachment: depthStencilTexture && gpuDepthStencilTexture
                ? {
                    view: depthMSAATextureView ? depthMSAATextureView : depthTextureView,
                    depthClearValue: mustClearDepth ? (this.useReverseDepthBuffer ? this._clearReverseDepthValue : this._clearDepthValue) : undefined,
                    depthLoadOp: mustClearDepth ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */,
                    depthStoreOp: "store" /* WebGPUConstants.StoreOp.Store */,
                    stencilClearValue: rtWrapper._depthStencilTextureWithStencil && mustClearStencil ? this._clearStencilValue : undefined,
                    stencilLoadOp: !depthTextureHasStencil
                        ? undefined
                        : rtWrapper._depthStencilTextureWithStencil && mustClearStencil
                            ? "clear" /* WebGPUConstants.LoadOp.Clear */
                            : "load" /* WebGPUConstants.LoadOp.Load */,
                    stencilStoreOp: !depthTextureHasStencil ? undefined : "store" /* WebGPUConstants.StoreOp.Store */,
                }
                : undefined,
            occlusionQuerySet: this._occlusionQuery?.hasQueries ? this._occlusionQuery.querySet : undefined,
        };
        this._timestampQuery.startPass(this._rttRenderPassWrapper.renderPassDescriptor, this._timestampIndex);
        this._currentRenderPass = this._renderEncoder.beginRenderPass(this._rttRenderPassWrapper.renderPassDescriptor);
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                const internalTexture = rtWrapper.texture;
                logger/* Logger */.V.Log([
                    "frame #" +
                        this._count +
                        " - render target begin pass - rtt name=" +
                        renderTargetWrapper.label +
                        ", internalTexture.uniqueId=" +
                        internalTexture.uniqueId +
                        ", width=" +
                        internalTexture.width +
                        ", height=" +
                        internalTexture.height +
                        ", setClearStates=" +
                        setClearStates,
                    "renderPassDescriptor=",
                    this._rttRenderPassWrapper.renderPassDescriptor,
                ]);
            }
        }
        this._debugFlushPendingCommands?.();
        this._resetRenderPassStates();
        if (!gpuDepthStencilWrapper || !WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format)) {
            this._stencilStateComposer.enabled = false;
        }
    }
    _startMainRenderPass(setClearStates, clearColor, clearDepth, clearStencil) {
        this._endCurrentRenderPass();
        if (this.useReverseDepthBuffer) {
            this.setDepthFunctionToGreaterOrEqual();
        }
        const mustClearColor = setClearStates && clearColor;
        const mustClearDepth = setClearStates && clearDepth;
        const mustClearStencil = setClearStates && clearStencil;
        this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].clearValue = mustClearColor ? clearColor : undefined;
        this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].loadOp = mustClearColor ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */;
        this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthClearValue = mustClearDepth
            ? this.useReverseDepthBuffer
                ? this._clearReverseDepthValue
                : this._clearDepthValue
            : undefined;
        this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthLoadOp = mustClearDepth ? "clear" /* WebGPUConstants.LoadOp.Clear */ : "load" /* WebGPUConstants.LoadOp.Load */;
        this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilClearValue = mustClearStencil ? this._clearStencilValue : undefined;
        this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilLoadOp = !this.isStencilEnable
            ? undefined
            : mustClearStencil
                ? "clear" /* WebGPUConstants.LoadOp.Clear */
                : "load" /* WebGPUConstants.LoadOp.Load */;
        this._mainRenderPassWrapper.renderPassDescriptor.occlusionQuerySet = this._occlusionQuery?.hasQueries ? this._occlusionQuery.querySet : undefined;
        const swapChainTexture = this._context.getCurrentTexture();
        this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].set(swapChainTexture);
        // Resolve in case of MSAA
        if (this._options.antialias) {
            viewDescriptorSwapChainAntialiasing.format = swapChainTexture.format;
            this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].resolveTarget = swapChainTexture.createView(viewDescriptorSwapChainAntialiasing);
        }
        else {
            viewDescriptorSwapChain.format = swapChainTexture.format;
            this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].view = swapChainTexture.createView(viewDescriptorSwapChain);
        }
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log([
                    "frame #" + this._count + " - main begin pass - texture width=" + this._mainTextureExtends.width,
                    " height=" + this._mainTextureExtends.height + ", setClearStates=" + setClearStates,
                    "renderPassDescriptor=",
                    this._mainRenderPassWrapper.renderPassDescriptor,
                ]);
            }
        }
        this._debugPushGroup?.("main pass", 0);
        this._timestampQuery.startPass(this._mainRenderPassWrapper.renderPassDescriptor, this._timestampIndex);
        this._currentRenderPass = this._renderEncoder.beginRenderPass(this._mainRenderPassWrapper.renderPassDescriptor);
        this._setDepthTextureFormat(this._mainRenderPassWrapper);
        this._setColorFormat(this._mainRenderPassWrapper);
        this._debugFlushPendingCommands?.();
        this._resetRenderPassStates();
        if (!this._isStencilEnable) {
            this._stencilStateComposer.enabled = false;
        }
    }
    /**
     * Binds the frame buffer to the specified texture.
     * @param texture The render target wrapper to render to
     * @param faceIndex The face of the texture to render to in case of cube texture
     * @param requiredWidth The width of the target to render to
     * @param requiredHeight The height of the target to render to
     * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true
     * @param lodLevel defines the lod level to bind to the frame buffer
     * @param layer defines the 2d array index to bind to frame buffer to
     */
    bindFramebuffer(texture, faceIndex = 0, requiredWidth, requiredHeight, forceFullscreenViewport, lodLevel = 0, layer = 0) {
        const hardwareTexture = texture.texture?._hardwareTexture;
        if (this._currentRenderTarget) {
            this.unBindFramebuffer(this._currentRenderTarget);
        }
        else {
            this._endCurrentRenderPass();
        }
        this._currentRenderTarget = texture;
        const depthStencilTexture = this._currentRenderTarget._depthStencilTexture;
        this._rttRenderPassWrapper.colorAttachmentGPUTextures[0] = hardwareTexture;
        this._rttRenderPassWrapper.depthTextureFormat = depthStencilTexture ? WebGPUTextureHelper.GetWebGPUTextureFormat(-1, depthStencilTexture.format) : undefined;
        this._setDepthTextureFormat(this._rttRenderPassWrapper);
        this._setColorFormat(this._rttRenderPassWrapper);
        this._rttRenderPassWrapper.colorAttachmentViewDescriptor = {
            format: this._colorFormat,
            dimension: texture.is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
            mipLevelCount: 1,
            baseArrayLayer: texture.isCube ? layer * 6 + faceIndex : layer,
            baseMipLevel: lodLevel,
            arrayLayerCount: 1,
            aspect: "all" /* WebGPUConstants.TextureAspect.All */,
        };
        this._rttRenderPassWrapper.depthAttachmentViewDescriptor = {
            format: this._depthTextureFormat,
            dimension: depthStencilTexture && depthStencilTexture.is3D ? "3d" /* WebGPUConstants.TextureViewDimension.E3d */ : "2d" /* WebGPUConstants.TextureViewDimension.E2d */,
            mipLevelCount: 1,
            baseArrayLayer: depthStencilTexture ? (depthStencilTexture.isCube ? layer * 6 + faceIndex : layer) : 0,
            baseMipLevel: 0,
            arrayLayerCount: 1,
            aspect: "all" /* WebGPUConstants.TextureAspect.All */,
        };
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log([
                    "frame #" +
                        this._count +
                        " - bindFramebuffer - rtt name=" +
                        texture.label +
                        ", internalTexture.uniqueId=" +
                        texture.texture?.uniqueId +
                        ", face=" +
                        faceIndex +
                        ", lodLevel=" +
                        lodLevel +
                        ", layer=" +
                        layer,
                    "colorAttachmentViewDescriptor=",
                    this._rttRenderPassWrapper.colorAttachmentViewDescriptor,
                    "depthAttachmentViewDescriptor=",
                    this._rttRenderPassWrapper.depthAttachmentViewDescriptor,
                ]);
            }
        }
        // We don't create the render pass just now, we do a lazy creation of the render pass, hoping the render pass will be created by a call to clear()...
        if (this._cachedViewport && !forceFullscreenViewport) {
            this.setViewport(this._cachedViewport, requiredWidth, requiredHeight);
        }
        else {
            if (!requiredWidth) {
                requiredWidth = texture.width;
                if (lodLevel) {
                    requiredWidth = requiredWidth / Math.pow(2, lodLevel);
                }
            }
            if (!requiredHeight) {
                requiredHeight = texture.height;
                if (lodLevel) {
                    requiredHeight = requiredHeight / Math.pow(2, lodLevel);
                }
            }
            this._viewport(0, 0, requiredWidth, requiredHeight);
        }
        this.wipeCaches();
    }
    /**
     * Unbind the current render target texture from the WebGPU context
     * @param texture defines the render target wrapper to unbind
     * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
     * @param onBeforeUnbind defines a function which will be called before the effective unbind
     */
    unBindFramebuffer(texture, disableGenerateMipMaps = false, onBeforeUnbind) {
        const saveCRT = this._currentRenderTarget;
        this._currentRenderTarget = null; // to be iso with abstractEngine, this._currentRenderTarget must be null when onBeforeUnbind is called
        if (onBeforeUnbind) {
            onBeforeUnbind();
        }
        this._currentRenderTarget = saveCRT;
        this._endCurrentRenderPass();
        if (!disableGenerateMipMaps) {
            if (texture.isMulti) {
                this.generateMipMapsMultiFramebuffer(texture);
            }
            else {
                this.generateMipMapsFramebuffer(texture);
            }
        }
        this._currentRenderTarget = null;
        if (this.dbgVerboseLogsForFirstFrames) {
            if (this._count === undefined) {
                this._count = 0;
            }
            if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {
                logger/* Logger */.V.Log("frame #" + this._count + " - unBindFramebuffer - rtt name=" + texture.label + ", internalTexture.uniqueId=", texture.texture?.uniqueId);
            }
        }
        this._mrtAttachments = [];
        this._cacheRenderPipeline.setMRT([]);
        this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);
    }
    /**
     * Generates mipmaps for the texture of the (single) render target
     * @param texture The render target containing the texture to generate the mipmaps for
     */
    generateMipMapsFramebuffer(texture) {
        if (!texture.isMulti && texture.texture?.generateMipMaps && !texture.isCube) {
            this._generateMipmaps(texture.texture);
        }
    }
    /**
     * Resolves the MSAA texture of the (single) render target into its non-MSAA version.
     * Note that if "texture" is not a MSAA render target, no resolve is performed.
     * @param _texture The render target texture containing the MSAA texture to resolve
     */
    resolveFramebuffer(_texture) {
        throw new Error("resolveFramebuffer is not yet implemented in WebGPU!");
    }
    /**
     * Unbind the current render target and bind the default framebuffer
     */
    restoreDefaultFramebuffer() {
        if (this._currentRenderTarget) {
            this.unBindFramebuffer(this._currentRenderTarget);
        }
        else if (!this._currentRenderPass) {
            this._startMainRenderPass(false);
        }
        if (this._cachedViewport) {
            this.setViewport(this._cachedViewport);
        }
        this.wipeCaches();
    }
    //------------------------------------------------------------------------------
    //                              Render
    //------------------------------------------------------------------------------
    /**
     * @internal
     */
    _setColorFormat(wrapper) {
        const format = wrapper.colorAttachmentGPUTextures[0]?.format ?? null;
        this._cacheRenderPipeline.setColorFormat(format);
        if (this._colorFormat === format) {
            return;
        }
        this._colorFormat = format;
    }
    /**
     * @internal
     */
    _setDepthTextureFormat(wrapper) {
        this._cacheRenderPipeline.setDepthStencilFormat(wrapper.depthTextureFormat);
        if (this._depthTextureFormat === wrapper.depthTextureFormat) {
            return;
        }
        this._depthTextureFormat = wrapper.depthTextureFormat;
    }
    setDitheringState() {
        // Does not exist in WebGPU
    }
    setRasterizerState() {
        // Does not exist in WebGPU
    }
    /**
     * @internal
     */
    _executeWhenRenderingStateIsCompiled(pipelineContext, action) {
        // No parallel shader compilation.
        // No Async, so direct launch
        action();
    }
    /**
     * @internal
     */
    bindSamplers() { }
    /** @internal */
    _getUnpackAlignement() {
        return 1;
    }
    /**
     * @internal
     */
    _bindTextureDirectly() {
        return false;
    }
    /**
     * Set various states to the webGL context
     * @param culling defines culling state: true to enable culling, false to disable it
     * @param zOffset defines the value to apply to zOffset (0 by default)
     * @param force defines if states must be applied even if cache is up to date
     * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)
     * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)
     * @param stencil stencil states to set
     * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)
     */
    setState(culling, zOffset = 0, force, reverseSide = false, cullBackFaces, stencil, zOffsetUnits = 0) {
        // Culling
        if (this._depthCullingState.cull !== culling || force) {
            this._depthCullingState.cull = culling;
        }
        // Cull face
        const cullFace = (this.cullBackFaces ?? cullBackFaces ?? true) ? 1 : 2;
        if (this._depthCullingState.cullFace !== cullFace || force) {
            this._depthCullingState.cullFace = cullFace;
        }
        // Z offset
        this.setZOffset(zOffset);
        this.setZOffsetUnits(zOffsetUnits);
        // Front face
        const frontFace = reverseSide ? (this._currentRenderTarget ? 1 : 2) : this._currentRenderTarget ? 2 : 1;
        if (this._depthCullingState.frontFace !== frontFace || force) {
            this._depthCullingState.frontFace = frontFace;
        }
        this._stencilStateComposer.stencilMaterial = stencil;
    }
    _applyRenderPassChanges(bundleList) {
        const mustUpdateStencilRef = !this._stencilStateComposer.enabled ? false : this._mustUpdateStencilRef();
        const mustUpdateBlendColor = !this._alphaState.alphaBlend ? false : this._mustUpdateBlendColor();
        if (this._mustUpdateViewport()) {
            this._applyViewport(bundleList);
        }
        if (this._mustUpdateScissor()) {
            this._applyScissor(bundleList);
        }
        if (mustUpdateStencilRef) {
            this._applyStencilRef(bundleList);
        }
        if (mustUpdateBlendColor) {
            this._applyBlendColor(bundleList);
        }
    }
    _draw(drawType, fillMode, start, count, instancesCount) {
        const renderPass = this._getCurrentRenderPass();
        const bundleList = this._bundleList;
        this.applyStates();
        const webgpuPipelineContext = this._currentEffect._pipelineContext;
        this.bindUniformBufferBase(this._currentRenderTarget ? this._ubInvertY : this._ubDontInvertY, 0, WebGPUShaderProcessor.InternalsUBOName);
        if (webgpuPipelineContext.uniformBuffer) {
            webgpuPipelineContext.uniformBuffer.update();
            this.bindUniformBufferBase(webgpuPipelineContext.uniformBuffer.getBuffer(), 0, WebGPUShaderProcessor.LeftOvertUBOName);
        }
        if (this._snapshotRendering.play) {
            this._reportDrawCall();
            return;
        }
        if (!this.compatibilityMode &&
            (this._currentDrawContext.isDirty(this._currentMaterialContext.updateId) || this._currentMaterialContext.isDirty || this._currentMaterialContext.forceBindGroupCreation)) {
            this._currentDrawContext.fastBundle = undefined;
        }
        const useFastPath = !this.compatibilityMode && this._currentDrawContext.fastBundle;
        let renderPass2 = renderPass;
        if (useFastPath || this._snapshotRendering.record) {
            this._applyRenderPassChanges(bundleList);
            if (!this._snapshotRendering.record) {
                this._counters.numBundleReuseNonCompatMode++;
                if (this._currentDrawContext.indirectDrawBuffer) {
                    this._currentDrawContext.setIndirectData(count, instancesCount || 1, start);
                }
                bundleList.addBundle(this._currentDrawContext.fastBundle);
                this._reportDrawCall();
                return;
            }
            renderPass2 = bundleList.getBundleEncoder(this._cacheRenderPipeline.colorFormats, this._depthTextureFormat, this.currentSampleCount); // for snapshot recording mode
            bundleList.numDrawCalls++;
        }
        let textureState = 0;
        if (this._currentMaterialContext.hasFloatOrDepthTextures) {
            let bitVal = 1;
            for (let i = 0; i < webgpuPipelineContext.shaderProcessingContext.textureNames.length; ++i) {
                const textureName = webgpuPipelineContext.shaderProcessingContext.textureNames[i];
                const texture = this._currentMaterialContext.textures[textureName]?.texture;
                const textureIsDepth = texture && texture.format >= 13 && texture.format <= 18;
                if ((texture?.type === 1 && !this._caps.textureFloatLinearFiltering) || textureIsDepth) {
                    textureState |= bitVal;
                }
                bitVal = bitVal << 1;
            }
        }
        this._currentMaterialContext.textureState = textureState;
        const pipeline = this._cacheRenderPipeline.getRenderPipeline(fillMode, this._currentEffect, this.currentSampleCount, textureState);
        const bindGroups = this._cacheBindGroups.getBindGroups(webgpuPipelineContext, this._currentDrawContext, this._currentMaterialContext);
        if (!this._snapshotRendering.record) {
            this._applyRenderPassChanges(!this.compatibilityMode ? bundleList : null);
            if (!this.compatibilityMode) {
                this._counters.numBundleCreationNonCompatMode++;
                renderPass2 = this._device.createRenderBundleEncoder({
                    colorFormats: this._cacheRenderPipeline.colorFormats,
                    depthStencilFormat: this._depthTextureFormat,
                    sampleCount: WebGPUTextureHelper.GetSample(this.currentSampleCount),
                });
            }
        }
        // bind pipeline
        renderPass2.setPipeline(pipeline);
        // bind index/vertex buffers
        if (this._currentIndexBuffer) {
            renderPass2.setIndexBuffer(this._currentIndexBuffer.underlyingResource, this._currentIndexBuffer.is32Bits ? "uint32" /* WebGPUConstants.IndexFormat.Uint32 */ : "uint16" /* WebGPUConstants.IndexFormat.Uint16 */, 0);
        }
        const vertexBuffers = this._cacheRenderPipeline.vertexBuffers;
        for (let index = 0; index < vertexBuffers.length; index++) {
            const vertexBuffer = vertexBuffers[index];
            const buffer = vertexBuffer.effectiveBuffer;
            if (buffer) {
                renderPass2.setVertexBuffer(index, buffer.underlyingResource, vertexBuffer._validOffsetRange ? 0 : vertexBuffer.byteOffset);
            }
        }
        // bind bind groups
        for (let i = 0; i < bindGroups.length; i++) {
            renderPass2.setBindGroup(i, bindGroups[i]);
        }
        // draw
        const nonCompatMode = !this.compatibilityMode && !this._snapshotRendering.record;
        if (nonCompatMode && this._currentDrawContext.indirectDrawBuffer) {
            this._currentDrawContext.setIndirectData(count, instancesCount || 1, start);
            if (drawType === 0) {
                renderPass2.drawIndexedIndirect(this._currentDrawContext.indirectDrawBuffer, 0);
            }
            else {
                renderPass2.drawIndirect(this._currentDrawContext.indirectDrawBuffer, 0);
            }
        }
        else if (drawType === 0) {
            renderPass2.drawIndexed(count, instancesCount || 1, start, 0, 0);
        }
        else {
            renderPass2.draw(count, instancesCount || 1, start, 0);
        }
        if (nonCompatMode) {
            this._currentDrawContext.fastBundle = renderPass2.finish();
            bundleList.addBundle(this._currentDrawContext.fastBundle);
        }
        this._reportDrawCall();
    }
    /**
     * Draw a list of indexed primitives
     * @param fillMode defines the primitive to use
     * @param indexStart defines the starting index
     * @param indexCount defines the number of index to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawElementsType(fillMode, indexStart, indexCount, instancesCount = 1) {
        this._draw(0, fillMode, indexStart, indexCount, instancesCount);
    }
    /**
     * Draw a list of unindexed primitives
     * @param fillMode defines the primitive to use
     * @param verticesStart defines the index of first vertex to draw
     * @param verticesCount defines the count of vertices to draw
     * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
     */
    drawArraysType(fillMode, verticesStart, verticesCount, instancesCount = 1) {
        this._currentIndexBuffer = null;
        this._draw(1, fillMode, verticesStart, verticesCount, instancesCount);
    }
    //------------------------------------------------------------------------------
    //                              Dispose
    //------------------------------------------------------------------------------
    /**
     * Dispose and release all associated resources
     */
    dispose() {
        this._isDisposed = true;
        this.hideLoadingUI();
        this._timestampQuery.dispose();
        this._mainTexture?.destroy();
        this._depthTexture?.destroy();
        this._textureHelper.destroyDeferredTextures();
        this._bufferManager.destroyDeferredBuffers();
        this._device.destroy();
        (0,engine_common/* _CommonDispose */.kX)(this, this._renderingCanvas);
        super.dispose();
    }
    //------------------------------------------------------------------------------
    //                              Misc
    //------------------------------------------------------------------------------
    /**
     * Gets the current render width
     * @param useScreen defines if screen size must be used (or the current render target if any)
     * @returns a number defining the current render width
     */
    getRenderWidth(useScreen = false) {
        if (!useScreen && this._currentRenderTarget) {
            return this._currentRenderTarget.width;
        }
        return this._renderingCanvas?.width ?? 0;
    }
    /**
     * Gets the current render height
     * @param useScreen defines if screen size must be used (or the current render target if any)
     * @returns a number defining the current render height
     */
    getRenderHeight(useScreen = false) {
        if (!useScreen && this._currentRenderTarget) {
            return this._currentRenderTarget.height;
        }
        return this._renderingCanvas?.height ?? 0;
    }
    //------------------------------------------------------------------------------
    //                              Errors
    //------------------------------------------------------------------------------
    /**
     * Get the current error code of the WebGPU context
     * @returns the error code
     */
    getError() {
        // TODO WEBGPU. from the webgpu errors.
        return 0;
    }
    //------------------------------------------------------------------------------
    //                              External Textures
    //------------------------------------------------------------------------------
    /**
     * Creates an external texture
     * @param video video element
     * @returns the external texture, or null if external textures are not supported by the engine
     */
    createExternalTexture(video) {
        const texture = new WebGPUExternalTexture(video);
        return texture;
    }
    /**
     * Sets an internal texture to the according uniform.
     * @param name The name of the uniform in the effect
     * @param texture The texture to apply
     */
    setExternalTexture(name, texture) {
        if (!texture) {
            this._currentMaterialContext.setTexture(name, null);
            return;
        }
        this._setInternalTexture(name, texture);
    }
    //------------------------------------------------------------------------------
    //                              Samplers
    //------------------------------------------------------------------------------
    /**
     * Sets a texture sampler to the according uniform.
     * @param name The name of the uniform in the effect
     * @param sampler The sampler to apply
     */
    setTextureSampler(name, sampler) {
        this._currentMaterialContext?.setSampler(name, sampler);
    }
    //------------------------------------------------------------------------------
    //                              Storage Buffers
    //------------------------------------------------------------------------------
    /**
     * Creates a storage buffer
     * @param data the data for the storage buffer or the size of the buffer
     * @param creationFlags flags to use when creating the buffer (see undefined). The BUFFER_CREATIONFLAG_STORAGE flag will be automatically added
     * @param label defines the label of the buffer (for debug purpose)
     * @returns the new buffer
     */
    createStorageBuffer(data, creationFlags, label) {
        return this._createBuffer(data, creationFlags | 32, label);
    }
    /**
     * Updates a storage buffer
     * @param buffer the storage buffer to update
     * @param data the data used to update the storage buffer
     * @param byteOffset the byte offset of the data
     * @param byteLength the byte length of the data
     */
    updateStorageBuffer(buffer, data, byteOffset, byteLength) {
        const dataBuffer = buffer;
        if (byteOffset === undefined) {
            byteOffset = 0;
        }
        let view;
        if (byteLength === undefined) {
            if (data instanceof Array) {
                view = new Float32Array(data);
            }
            else if (data instanceof ArrayBuffer) {
                view = new Uint8Array(data);
            }
            else {
                view = data;
            }
            byteLength = view.byteLength;
        }
        else {
            if (data instanceof Array) {
                view = new Float32Array(data);
            }
            else if (data instanceof ArrayBuffer) {
                view = new Uint8Array(data);
            }
            else {
                view = data;
            }
        }
        this._bufferManager.setSubData(dataBuffer, byteOffset, view, 0, byteLength);
    }
    _readFromGPUBuffer(gpuBuffer, size, buffer, noDelay) {
        return new Promise((resolve, reject) => {
            const readFromBuffer = () => {
                gpuBuffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */, 0, size).then(() => {
                    const copyArrayBuffer = gpuBuffer.getMappedRange(0, size);
                    let data = buffer;
                    if (data === undefined) {
                        data = new Uint8Array(size);
                        data.set(new Uint8Array(copyArrayBuffer));
                    }
                    else {
                        const ctor = data.constructor; // we want to create result data with the same type as buffer (Uint8Array, Float32Array, ...)
                        data = new ctor(data.buffer);
                        data.set(new ctor(copyArrayBuffer));
                    }
                    gpuBuffer.unmap();
                    this._bufferManager.releaseBuffer(gpuBuffer);
                    resolve(data);
                }, (reason) => {
                    if (this.isDisposed) {
                        resolve(new Uint8Array());
                    }
                    else {
                        reject(reason);
                    }
                });
            };
            if (noDelay) {
                this.flushFramebuffer();
                readFromBuffer();
            }
            else {
                // we are using onEndFrameObservable because we need to map the gpuBuffer AFTER the command buffers
                // have been submitted, else we get the error: "Buffer used in a submit while mapped"
                this.onEndFrameObservable.addOnce(() => {
                    readFromBuffer();
                });
            }
        });
    }
    /**
     * Read data from a storage buffer
     * @param storageBuffer The storage buffer to read from
     * @param offset The offset in the storage buffer to start reading from (default: 0)
     * @param size  The number of bytes to read from the storage buffer (default: capacity of the buffer)
     * @param buffer The buffer to write the data we have read from the storage buffer to (optional)
     * @param noDelay If true, a call to flushFramebuffer will be issued so that the data can be read back immediately and not in engine.onEndFrameObservable. This can speed up data retrieval, at the cost of a small perf penalty (default: false).
     * @returns If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer
     */
    readFromStorageBuffer(storageBuffer, offset, size, buffer, noDelay) {
        size = size || storageBuffer.capacity;
        const gpuBuffer = this._bufferManager.createRawBuffer(size, BufferUsage.MapRead | BufferUsage.CopyDst, undefined, "TempReadFromStorageBuffer");
        this._renderEncoder.copyBufferToBuffer(storageBuffer.underlyingResource, offset ?? 0, gpuBuffer, 0, size);
        return this._readFromGPUBuffer(gpuBuffer, size, buffer, noDelay);
    }
    /**
     * Read data from multiple storage buffers
     * @param storageBuffers The list of storage buffers to read from
     * @param offset The offset in the storage buffer to start reading from (default: 0). This is the same offset for all storage buffers!
     * @param size  The number of bytes to read from each storage buffer (default: capacity of the first buffer)
     * @param buffer The buffer to write the data we have read from the storage buffers to (optional). If provided, the buffer should be large enough to hold the data from all storage buffers!
     * @param noDelay If true, a call to flushFramebuffer will be issued so that the data can be read back immediately and not in engine.onEndFrameObservable. This can speed up data retrieval, at the cost of a small perf penalty (default: false).
     * @returns If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer
     */
    readFromMultipleStorageBuffers(storageBuffers, offset, size, buffer, noDelay) {
        size = size || storageBuffers[0].capacity;
        const gpuBuffer = this._bufferManager.createRawBuffer(size * storageBuffers.length, BufferUsage.MapRead | BufferUsage.CopyDst, undefined, "TempReadFromMultipleStorageBuffers");
        for (let i = 0; i < storageBuffers.length; i++) {
            this._renderEncoder.copyBufferToBuffer(storageBuffers[i].underlyingResource, offset ?? 0, gpuBuffer, i * size, size);
        }
        return this._readFromGPUBuffer(gpuBuffer, size * storageBuffers.length, buffer, noDelay);
    }
    /**
     * Sets a storage buffer in the shader
     * @param name Defines the name of the storage buffer as defined in the shader
     * @param buffer Defines the value to give to the uniform
     */
    setStorageBuffer(name, buffer) {
        this._currentDrawContext?.setBuffer(name, buffer?.getBuffer() ?? null);
    }
}
// Default glslang options.
WebGPUEngine._GlslangDefaultOptions = {
    jsPath: `${tools/* Tools */.S0._DefaultCdnUrl}/glslang/glslang.js`,
    wasmPath: `${tools/* Tools */.S0._DefaultCdnUrl}/glslang/glslang.wasm`,
};
WebGPUEngine._InstanceId = 0;
//# sourceMappingURL=webgpuEngine.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuComputeContext.js

/** @internal */
class WebGPUComputeContext {
    getBindGroups(bindings, computePipeline, bindingsMapping) {
        if (!bindingsMapping) {
            throw new Error("WebGPUComputeContext.getBindGroups: bindingsMapping is required until browsers support reflection for wgsl shaders!");
        }
        if (this._bindGroups.length === 0) {
            const bindGroupEntriesExist = this._bindGroupEntries.length > 0;
            for (const key in bindings) {
                const binding = bindings[key], location = bindingsMapping[key], group = location.group, index = location.binding, type = binding.type, object = binding.object;
                let indexInGroupEntries = binding.indexInGroupEntries;
                let entries = this._bindGroupEntries[group];
                if (!entries) {
                    entries = this._bindGroupEntries[group] = [];
                }
                switch (type) {
                    case 5 /* ComputeBindingType.Sampler */: {
                        const sampler = object;
                        if (indexInGroupEntries !== undefined && bindGroupEntriesExist) {
                            entries[indexInGroupEntries].resource = this._cacheSampler.getSampler(sampler);
                        }
                        else {
                            binding.indexInGroupEntries = entries.length;
                            entries.push({
                                binding: index,
                                resource: this._cacheSampler.getSampler(sampler),
                            });
                        }
                        break;
                    }
                    case 0 /* ComputeBindingType.Texture */:
                    case 4 /* ComputeBindingType.TextureWithoutSampler */: {
                        const texture = object;
                        const hardwareTexture = texture._texture._hardwareTexture;
                        if (indexInGroupEntries !== undefined && bindGroupEntriesExist) {
                            if (type === 0 /* ComputeBindingType.Texture */) {
                                entries[indexInGroupEntries++].resource = this._cacheSampler.getSampler(texture._texture);
                            }
                            entries[indexInGroupEntries].resource = hardwareTexture.view;
                        }
                        else {
                            binding.indexInGroupEntries = entries.length;
                            if (type === 0 /* ComputeBindingType.Texture */) {
                                entries.push({
                                    binding: index - 1,
                                    resource: this._cacheSampler.getSampler(texture._texture),
                                });
                            }
                            entries.push({
                                binding: index,
                                resource: hardwareTexture.view,
                            });
                        }
                        break;
                    }
                    case 1 /* ComputeBindingType.StorageTexture */: {
                        const texture = object;
                        const hardwareTexture = texture._texture._hardwareTexture;
                        if ((hardwareTexture.textureAdditionalUsages & 8 /* WebGPUConstants.TextureUsage.StorageBinding */) === 0) {
                            logger/* Logger */.V.Error(`computeDispatch: The texture (name=${texture.name}, uniqueId=${texture.uniqueId}) is not a storage texture!`, 50);
                        }
                        if (indexInGroupEntries !== undefined && bindGroupEntriesExist) {
                            entries[indexInGroupEntries].resource = hardwareTexture.viewForWriting;
                        }
                        else {
                            binding.indexInGroupEntries = entries.length;
                            entries.push({
                                binding: index,
                                resource: hardwareTexture.viewForWriting,
                            });
                        }
                        break;
                    }
                    case 6 /* ComputeBindingType.ExternalTexture */: {
                        const texture = object;
                        const externalTexture = texture.underlyingResource;
                        if (indexInGroupEntries !== undefined && bindGroupEntriesExist) {
                            entries[indexInGroupEntries].resource = this._device.importExternalTexture({ source: externalTexture });
                        }
                        else {
                            binding.indexInGroupEntries = entries.length;
                            entries.push({
                                binding: index,
                                resource: this._device.importExternalTexture({ source: externalTexture }),
                            });
                        }
                        break;
                    }
                    case 2 /* ComputeBindingType.UniformBuffer */:
                    case 3 /* ComputeBindingType.StorageBuffer */:
                    case 7 /* ComputeBindingType.DataBuffer */: {
                        const dataBuffer = type === 7 /* ComputeBindingType.DataBuffer */
                            ? object
                            : type === 2 /* ComputeBindingType.UniformBuffer */
                                ? object.getBuffer()
                                : object.getBuffer();
                        const webgpuBuffer = dataBuffer.underlyingResource;
                        if (indexInGroupEntries !== undefined && bindGroupEntriesExist) {
                            entries[indexInGroupEntries].resource.buffer = webgpuBuffer;
                            entries[indexInGroupEntries].resource.size = dataBuffer.capacity;
                        }
                        else {
                            binding.indexInGroupEntries = entries.length;
                            entries.push({
                                binding: index,
                                resource: {
                                    buffer: webgpuBuffer,
                                    offset: 0,
                                    size: dataBuffer.capacity,
                                },
                            });
                        }
                        break;
                    }
                }
            }
            for (let i = 0; i < this._bindGroupEntries.length; ++i) {
                const entries = this._bindGroupEntries[i];
                if (!entries) {
                    this._bindGroups[i] = undefined;
                    continue;
                }
                this._bindGroups[i] = this._device.createBindGroup({
                    layout: computePipeline.getBindGroupLayout(i),
                    entries,
                });
            }
            this._bindGroups.length = this._bindGroupEntries.length;
        }
        return this._bindGroups;
    }
    constructor(device, cacheSampler) {
        this._device = device;
        this._cacheSampler = cacheSampler;
        this.uniqueId = WebGPUComputeContext._Counter++;
        this._bindGroupEntries = [];
        this.clear();
    }
    clear() {
        this._bindGroups = [];
        // Don't reset _bindGroupEntries if they have already been created, they are still ok even if we have to clear _bindGroups (the layout of the compute shader can't change once created)
    }
}
WebGPUComputeContext._Counter = 0;
//# sourceMappingURL=webgpuComputeContext.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/webgpuComputePipelineContext.js
/** @internal */
class WebGPUComputePipelineContext {
    get isAsync() {
        return false;
    }
    get isReady() {
        if (this.isAsync) {
            // When async mode is implemented, this should return true if the pipeline is ready
            return false;
        }
        // In synchronous mode, we return false, the readiness being determined by ComputeEffect
        return false;
    }
    constructor(engine) {
        this._name = "unnamed";
        this.engine = engine;
    }
    _getComputeShaderCode() {
        return this.sources?.compute;
    }
    dispose() { }
}
//# sourceMappingURL=webgpuComputePipelineContext.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.computeShader.js





const computePassDescriptor = {};
WebGPUEngine.prototype.createComputeContext = function () {
    return new WebGPUComputeContext(this._device, this._cacheSampler);
};
WebGPUEngine.prototype.createComputeEffect = function (baseName, options) {
    const compute = typeof baseName === "string" ? baseName : baseName.computeToken || baseName.computeSource || baseName.computeElement || baseName.compute;
    const name = compute + "@" + options.defines;
    if (this._compiledComputeEffects[name]) {
        const compiledEffect = this._compiledComputeEffects[name];
        if (options.onCompiled && compiledEffect.isReady()) {
            options.onCompiled(compiledEffect);
        }
        return compiledEffect;
    }
    const effect = new ComputeEffect(baseName, options, this, name);
    this._compiledComputeEffects[name] = effect;
    return effect;
};
WebGPUEngine.prototype.createComputePipelineContext = function () {
    return new WebGPUComputePipelineContext(this);
};
WebGPUEngine.prototype.areAllComputeEffectsReady = function () {
    for (const key in this._compiledComputeEffects) {
        const effect = this._compiledComputeEffects[key];
        if (!effect.isReady()) {
            return false;
        }
    }
    return true;
};
WebGPUEngine.prototype.computeDispatch = function (effect, context, bindings, x, y = 1, z = 1, bindingsMapping, gpuPerfCounter) {
    this._computeDispatch(effect, context, bindings, x, y, z, undefined, undefined, bindingsMapping, gpuPerfCounter);
};
WebGPUEngine.prototype.computeDispatchIndirect = function (effect, context, bindings, buffer, offset = 0, bindingsMapping, gpuPerfCounter) {
    this._computeDispatch(effect, context, bindings, undefined, undefined, undefined, buffer, offset, bindingsMapping, gpuPerfCounter);
};
WebGPUEngine.prototype._computeDispatch = function (effect, context, bindings, x, y, z, buffer, offset, bindingsMapping, gpuPerfCounter) {
    this._endCurrentRenderPass();
    const contextPipeline = effect._pipelineContext;
    const computeContext = context;
    if (!contextPipeline.computePipeline) {
        contextPipeline.computePipeline = this._device.createComputePipeline({
            layout: "auto" /* WebGPUConstants.AutoLayoutMode.Auto */,
            compute: contextPipeline.stage,
        });
    }
    if (gpuPerfCounter) {
        this._timestampQuery.startPass(computePassDescriptor, this._timestampIndex);
    }
    const computePass = this._renderEncoder.beginComputePass(computePassDescriptor);
    computePass.setPipeline(contextPipeline.computePipeline);
    const bindGroups = computeContext.getBindGroups(bindings, contextPipeline.computePipeline, bindingsMapping);
    for (let i = 0; i < bindGroups.length; ++i) {
        const bindGroup = bindGroups[i];
        if (!bindGroup) {
            continue;
        }
        computePass.setBindGroup(i, bindGroup);
    }
    if (buffer !== undefined) {
        computePass.dispatchWorkgroupsIndirect(buffer.underlyingResource, offset);
    }
    else {
        if (x + y + z > 0) {
            computePass.dispatchWorkgroups(x, y, z);
        }
    }
    computePass.end();
    if (gpuPerfCounter) {
        this._timestampQuery.endPass(this._timestampIndex, gpuPerfCounter);
        this._timestampIndex += 2;
    }
};
WebGPUEngine.prototype.releaseComputeEffects = function () {
    for (const name in this._compiledComputeEffects) {
        const webGPUPipelineContextCompute = this._compiledComputeEffects[name].getPipelineContext();
        this._deleteComputePipelineContext(webGPUPipelineContextCompute);
    }
    this._compiledComputeEffects = {};
};
WebGPUEngine.prototype._prepareComputePipelineContext = function (pipelineContext, computeSourceCode, rawComputeSourceCode, defines, entryPoint) {
    const webGpuContext = pipelineContext;
    if (this.dbgShowShaderCode) {
        logger/* Logger */.V.Log(defines);
        logger/* Logger */.V.Log(computeSourceCode);
    }
    webGpuContext.sources = {
        compute: computeSourceCode,
        rawCompute: rawComputeSourceCode,
    };
    webGpuContext.stage = this._createComputePipelineStageDescriptor(computeSourceCode, defines, entryPoint);
};
WebGPUEngine.prototype._releaseComputeEffect = function (effect) {
    if (this._compiledComputeEffects[effect._key]) {
        delete this._compiledComputeEffects[effect._key];
        this._deleteComputePipelineContext(effect.getPipelineContext());
    }
};
WebGPUEngine.prototype._rebuildComputeEffects = function () {
    for (const key in this._compiledComputeEffects) {
        const effect = this._compiledComputeEffects[key];
        effect._pipelineContext = null;
        effect._wasPreviouslyReady = false;
        effect._prepareEffect();
    }
};
WebGPUEngine.prototype._executeWhenComputeStateIsCompiled = function (pipelineContext, action) {
    pipelineContext.stage.module.getCompilationInfo().then((info) => {
        const compilationMessages = {
            numErrors: 0,
            messages: [],
        };
        for (const message of info.messages) {
            if (message.type === "error") {
                compilationMessages.numErrors++;
            }
            compilationMessages.messages.push({
                type: message.type,
                text: message.message,
                line: message.lineNum,
                column: message.linePos,
                length: message.length,
                offset: message.offset,
            });
        }
        action(compilationMessages);
    });
};
WebGPUEngine.prototype._deleteComputePipelineContext = function (pipelineContext) {
    const webgpuPipelineContext = pipelineContext;
    if (webgpuPipelineContext) {
        pipelineContext.dispose();
    }
};
WebGPUEngine.prototype._createComputePipelineStageDescriptor = function (computeShader, defines, entryPoint) {
    if (defines) {
        defines = "//" + defines.split("\n").join("\n//") + "\n";
    }
    else {
        defines = "";
    }
    return {
        module: this._device.createShaderModule({
            code: defines + computeShader,
        }),
        entryPoint,
    };
};
//# sourceMappingURL=engine.computeShader.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.debugging.js

WebGPUEngine.prototype._debugPushGroup = function (groupName, targetObject) {
    if (!this._options.enableGPUDebugMarkers) {
        return;
    }
    if (targetObject === 0 || targetObject === 1) {
        if (targetObject === 1) {
            if (this._currentRenderTarget) {
                this.unBindFramebuffer(this._currentRenderTarget);
            }
            else {
                this._endCurrentRenderPass();
            }
        }
        this._renderEncoder.pushDebugGroup(groupName);
    }
    else if (this._currentRenderPass) {
        this._currentRenderPass.pushDebugGroup(groupName);
        this._debugStackRenderPass.push(groupName);
    }
    else {
        this._pendingDebugCommands.push(["push", groupName, targetObject]);
    }
};
WebGPUEngine.prototype._debugPopGroup = function (targetObject) {
    if (!this._options.enableGPUDebugMarkers) {
        return;
    }
    if (targetObject === 0 || targetObject === 1) {
        if (targetObject === 1) {
            if (this._currentRenderTarget) {
                this.unBindFramebuffer(this._currentRenderTarget);
            }
            else {
                this._endCurrentRenderPass();
            }
        }
        this._renderEncoder.popDebugGroup();
    }
    else if (this._currentRenderPass) {
        this._currentRenderPass.popDebugGroup();
        this._debugStackRenderPass.pop();
    }
    else {
        this._pendingDebugCommands.push(["pop", null, targetObject]);
    }
};
WebGPUEngine.prototype._debugInsertMarker = function (text, targetObject) {
    if (!this._options.enableGPUDebugMarkers) {
        return;
    }
    if (targetObject === 0 || targetObject === 1) {
        if (targetObject === 1) {
            if (this._currentRenderTarget) {
                this.unBindFramebuffer(this._currentRenderTarget);
            }
            else {
                this._endCurrentRenderPass();
            }
        }
        this._renderEncoder.insertDebugMarker(text);
    }
    else if (this._currentRenderPass) {
        this._currentRenderPass.insertDebugMarker(text);
    }
    else {
        this._pendingDebugCommands.push(["insert", text, targetObject]);
    }
};
WebGPUEngine.prototype._debugFlushPendingCommands = function () {
    if (this._debugStackRenderPass.length !== 0) {
        const currentDebugStack = this._debugStackRenderPass.slice();
        this._debugStackRenderPass.length = 0;
        for (let i = 0; i < currentDebugStack.length; ++i) {
            this._debugPushGroup(currentDebugStack[i], 2);
        }
    }
    for (let i = 0; i < this._pendingDebugCommands.length; ++i) {
        const [name, param, targetObject] = this._pendingDebugCommands[i];
        switch (name) {
            case "push":
                this._debugPushGroup(param, targetObject);
                break;
            case "pop":
                this._debugPopGroup(targetObject);
                break;
            case "insert":
                this._debugInsertMarker(param, targetObject);
                break;
        }
    }
    this._pendingDebugCommands.length = 0;
};
//# sourceMappingURL=engine.debugging.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.functions.js
var tools_functions = __webpack_require__(91597);
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.dynamicTexture.js



WebGPUEngine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {
    const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 4 /* InternalTextureSource.Dynamic */);
    texture.baseWidth = width;
    texture.baseHeight = height;
    if (generateMipMaps) {
        width = this.needPOTTextures ? (0,tools_functions/* GetExponentOfTwo */.R)(width, this._caps.maxTextureSize) : width;
        height = this.needPOTTextures ? (0,tools_functions/* GetExponentOfTwo */.R)(height, this._caps.maxTextureSize) : height;
    }
    texture.width = width;
    texture.height = height;
    texture.isReady = false;
    texture.generateMipMaps = generateMipMaps;
    texture.samplingMode = samplingMode;
    this.updateTextureSamplingMode(samplingMode, texture);
    this._internalTexturesCache.push(texture);
    if (width && height) {
        this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);
    }
    return texture;
};
WebGPUEngine.prototype.updateDynamicTexture = function (texture, source, invertY, premulAlpha = false, format, forceBindTexture, allowGPUOptimization) {
    if (!texture) {
        return;
    }
    const width = source.width, height = source.height;
    let gpuTextureWrapper = texture._hardwareTexture;
    if (!texture._hardwareTexture?.underlyingResource) {
        gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);
    }
    this._textureHelper.updateTexture(source, texture, width, height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, allowGPUOptimization);
    if (texture.generateMipMaps) {
        this._generateMipmaps(texture);
    }
    texture._dynamicTextureSource = source;
    texture._premulAlpha = premulAlpha;
    texture.invertY = invertY || false;
    texture.isReady = true;
};
//# sourceMappingURL=engine.dynamicTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.multiRender.js




WebGPUEngine.prototype.unBindMultiColorAttachmentFramebuffer = function (rtWrapper, disableGenerateMipMaps = false, onBeforeUnbind) {
    if (onBeforeUnbind) {
        onBeforeUnbind();
    }
    this._endCurrentRenderPass();
    if (!disableGenerateMipMaps) {
        this.generateMipMapsMultiFramebuffer(rtWrapper);
    }
    this._currentRenderTarget = null;
    this._mrtAttachments = [];
    this._cacheRenderPipeline.setMRT([]);
    this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);
};
WebGPUEngine.prototype.createMultipleRenderTarget = function (size, options, initializeBuffers) {
    let generateMipMaps = false;
    let generateDepthBuffer = true;
    let generateStencilBuffer = false;
    let generateDepthTexture = false;
    let depthTextureFormat = 15;
    let textureCount = 1;
    let samples = 1;
    const defaultType = 0;
    const defaultSamplingMode = 3;
    const defaultUseSRGBBuffer = false;
    const defaultFormat = 5;
    const defaultTarget = 3553;
    let types = [];
    let samplingModes = [];
    let useSRGBBuffers = [];
    let formats = [];
    let targets = [];
    let faceIndex = [];
    let layerIndex = [];
    let layers = [];
    let labels = [];
    let creationFlags = [];
    let dontCreateTextures = false;
    const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size);
    if (options !== undefined) {
        generateMipMaps = options.generateMipMaps ?? false;
        generateDepthBuffer = options.generateDepthBuffer ?? true;
        generateStencilBuffer = options.generateStencilBuffer ?? false;
        generateDepthTexture = options.generateDepthTexture ?? false;
        textureCount = options.textureCount ?? 1;
        depthTextureFormat = options.depthTextureFormat ?? 15;
        types = options.types || types;
        samplingModes = options.samplingModes || samplingModes;
        useSRGBBuffers = options.useSRGBBuffers || useSRGBBuffers;
        formats = options.formats || formats;
        targets = options.targetTypes || targets;
        faceIndex = options.faceIndex || faceIndex;
        layerIndex = options.layerIndex || layerIndex;
        layers = options.layerCounts || layers;
        labels = options.labels || labels;
        creationFlags = options.creationFlags || creationFlags;
        samples = options.samples ?? samples;
        dontCreateTextures = options.dontCreateTextures ?? false;
    }
    const width = size.width ?? size;
    const height = size.height ?? size;
    const textures = [];
    const attachments = [];
    const defaultAttachments = [];
    rtWrapper.label = options?.label ?? "MultiRenderTargetWrapper";
    rtWrapper._generateDepthBuffer = generateDepthBuffer;
    rtWrapper._generateStencilBuffer = generateStencilBuffer;
    rtWrapper._attachments = attachments;
    rtWrapper._defaultAttachments = defaultAttachments;
    let depthStencilTexture = null;
    if ((generateDepthBuffer || generateStencilBuffer || generateDepthTexture) && !dontCreateTextures) {
        if (!generateDepthTexture) {
            // The caller doesn't want a depth texture, so we are free to use the depth texture format we want.
            // So, we will align with what the WebGL engine does
            if (generateDepthBuffer && generateStencilBuffer) {
                depthTextureFormat = 13;
            }
            else if (generateDepthBuffer) {
                depthTextureFormat = 14;
            }
            else {
                depthTextureFormat = 19;
            }
        }
        depthStencilTexture = rtWrapper.createDepthStencilTexture(0, false, generateStencilBuffer, 1, depthTextureFormat, rtWrapper.label + "-DepthStencil");
    }
    const mipmapsCreationOnly = options !== undefined && typeof options === "object" && options.createMipMaps && !generateMipMaps;
    for (let i = 0; i < textureCount; i++) {
        let samplingMode = samplingModes[i] || defaultSamplingMode;
        let type = types[i] || defaultType;
        const format = formats[i] || defaultFormat;
        const useSRGBBuffer = (useSRGBBuffers[i] || defaultUseSRGBBuffer) && this._caps.supportSRGBBuffers;
        const target = targets[i] || defaultTarget;
        const layerCount = layers[i] ?? 1;
        const creationFlag = creationFlags[i];
        if (type === 1 && !this._caps.textureFloatLinearFiltering) {
            // if floating point linear (FLOAT) then force to NEAREST_SAMPLINGMODE
            samplingMode = 1;
        }
        else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) {
            // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
            samplingMode = 1;
        }
        if (type === 1 && !this._caps.textureFloat) {
            type = 0;
            logger/* Logger */.V.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type");
        }
        attachments.push(i + 1);
        defaultAttachments.push(initializeBuffers ? i + 1 : i === 0 ? 1 : 0);
        if (target === -1 || dontCreateTextures) {
            continue;
        }
        const texture = new Textures_internalTexture/* InternalTexture */.hV(this, 6 /* InternalTextureSource.MultiRenderTarget */);
        textures[i] = texture;
        switch (target) {
            case 34067:
                texture.isCube = true;
                break;
            case 32879:
                texture.is3D = true;
                texture.baseDepth = texture.depth = layerCount;
                break;
            case 35866:
                texture.is2DArray = true;
                texture.baseDepth = texture.depth = layerCount;
                break;
        }
        texture.baseWidth = width;
        texture.baseHeight = height;
        texture.width = width;
        texture.height = height;
        texture.isReady = true;
        texture.samples = 1;
        texture.generateMipMaps = generateMipMaps;
        texture.samplingMode = samplingMode;
        texture.type = type;
        texture._cachedWrapU = 0;
        texture._cachedWrapV = 0;
        texture._useSRGBBuffer = useSRGBBuffer;
        texture.format = format;
        texture.label = labels[i] ?? rtWrapper.label + "-Texture" + i;
        this._internalTexturesCache.push(texture);
        if (mipmapsCreationOnly) {
            // createGPUTextureForInternalTexture will only create a texture with mipmaps if generateMipMaps is true, as InternalTexture has no createMipMaps property, separate from generateMipMaps.
            texture.generateMipMaps = true;
        }
        this._textureHelper.createGPUTextureForInternalTexture(texture, undefined, undefined, undefined, creationFlag, true);
        if (mipmapsCreationOnly) {
            texture.generateMipMaps = false;
        }
    }
    if (depthStencilTexture) {
        depthStencilTexture.incrementReferences();
        textures[textureCount] = depthStencilTexture;
        this._internalTexturesCache.push(depthStencilTexture);
    }
    rtWrapper.setTextures(textures);
    rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex);
    if (!dontCreateTextures) {
        this.updateMultipleRenderTargetTextureSampleCount(rtWrapper, samples);
    }
    else {
        rtWrapper._samples = samples;
    }
    return rtWrapper;
};
WebGPUEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function (rtWrapper, samples) {
    if (!rtWrapper || !rtWrapper.textures || rtWrapper.textures.length === 0 || rtWrapper.textures[0].samples === samples) {
        return samples;
    }
    const count = rtWrapper.textures.length;
    if (count === 0) {
        return 1;
    }
    samples = Math.min(samples, this.getCaps().maxMSAASamples);
    for (let i = 0; i < count; ++i) {
        const texture = rtWrapper.textures[i];
        const gpuTextureWrapper = texture._hardwareTexture;
        gpuTextureWrapper?.releaseMSAATexture(rtWrapper.getBaseArrayLayer(i));
    }
    // Note that rtWrapper.textures can't have null textures, lastTextureIsDepthTexture can't be true if rtWrapper._depthStencilTexture is null
    const lastTextureIsDepthTexture = rtWrapper._depthStencilTexture === rtWrapper.textures[count - 1];
    for (let i = 0; i < count; ++i) {
        const texture = rtWrapper.textures[i];
        this._textureHelper.createMSAATexture(texture, samples, false, rtWrapper.getBaseArrayLayer(i));
        texture.samples = samples;
    }
    // Note that the last texture of textures is the depth texture if the depth texture has been generated by the MRT class and so the MSAA texture
    // will be recreated for this texture by the loop above: in that case, there's no need to create the MSAA texture for rtWrapper._depthStencilTexture
    // because rtWrapper._depthStencilTexture is the same texture than the depth texture
    if (rtWrapper._depthStencilTexture && !lastTextureIsDepthTexture) {
        this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples);
        rtWrapper._depthStencilTexture.samples = samples;
    }
    rtWrapper._samples = samples;
    return samples;
};
WebGPUEngine.prototype.generateMipMapsMultiFramebuffer = function (texture) {
    const rtWrapper = texture;
    if (!rtWrapper.isMulti) {
        return;
    }
    const attachments = rtWrapper._attachments;
    const count = attachments.length;
    for (let i = 0; i < count; i++) {
        const texture = rtWrapper.textures[i];
        if (texture.generateMipMaps && !texture.isCube && !texture.is3D) {
            this._generateMipmaps(texture);
        }
    }
};
WebGPUEngine.prototype.resolveMultiFramebuffer = function (_texture) {
    throw new Error("resolveMultiFramebuffer is not yet implemented in WebGPU!");
};
WebGPUEngine.prototype.bindAttachments = function (attachments) {
    if (attachments.length === 0 || !this._currentRenderTarget) {
        return;
    }
    this._mrtAttachments = attachments;
    if (this._currentRenderPass) {
        // the render pass has already been created, we need to call setMRTAttachments to update the state of the attachments
        this._cacheRenderPipeline.setMRTAttachments(attachments);
    }
    else {
        // the render pass is not created yet so we don't need to call setMRTAttachments: it will be called as part of the render pass creation (see WebGPUEngine._startRenderTargetRenderPass)
    }
};
WebGPUEngine.prototype.buildTextureLayout = function (textureStatus) {
    const result = [];
    for (let i = 0; i < textureStatus.length; i++) {
        if (textureStatus[i]) {
            result.push(i + 1);
        }
        else {
            result.push(0);
        }
    }
    return result;
};
WebGPUEngine.prototype.restoreSingleAttachment = function () {
    // not sure what to do, probably nothing... This function and restoreSingleAttachmentForRenderTarget are not called in Babylon.js so it's hard to know the use case
};
WebGPUEngine.prototype.restoreSingleAttachmentForRenderTarget = function () {
    // not sure what to do, probably nothing... This function and restoreSingleAttachment are not called in Babylon.js so it's hard to know the use case
};
//# sourceMappingURL=engine.multiRender.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.videoTexture.js

function IsExternalTexture(texture) {
    return texture && texture.underlyingResource !== undefined ? true : false;
}
WebGPUEngine.prototype.updateVideoTexture = function (texture, video, invertY) {
    if (!texture || texture._isDisabled) {
        return;
    }
    if (this._videoTextureSupported === undefined) {
        this._videoTextureSupported = true;
    }
    let gpuTextureWrapper = texture._hardwareTexture;
    if (!texture._hardwareTexture?.underlyingResource) {
        gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture);
    }
    if (IsExternalTexture(video)) {
        if (video.isReady()) {
            try {
                this._textureHelper.copyVideoToTexture(video, texture, gpuTextureWrapper.format, !invertY);
                if (texture.generateMipMaps) {
                    this._generateMipmaps(texture);
                }
            }
            catch (e) {
                // WebGPU doesn't support video element who are not playing so far
                // Ignore this error ensures we can start a video texture in a paused state
            }
            texture.isReady = true;
        }
    }
    else if (video) {
        this.createImageBitmap(video)
            .then((bitmap) => {
            this._textureHelper.updateTexture(bitmap, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, !invertY, false, 0, 0);
            if (texture.generateMipMaps) {
                this._generateMipmaps(texture);
            }
            texture.isReady = true;
        })
            .catch(() => {
            // Sometimes createImageBitmap(video) fails with "Failed to execute 'createImageBitmap' on 'Window': The provided element's player has no current data."
            // Just keep going on
            texture.isReady = true;
        });
    }
};
//# sourceMappingURL=engine.videoTexture.js.map
;// ./node_modules/@babylonjs/core/Engines/WebGPU/Extensions/index.js













//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Engines/IPipelineContext.js

//# sourceMappingURL=IPipelineContext.js.map
;// ./node_modules/@babylonjs/core/Engines/ICanvas.js

//# sourceMappingURL=ICanvas.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGLPipelineContext.js
var webGLPipelineContext = __webpack_require__(1886);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/WebGL/webGL2ShaderProcessors.js
var webGL2ShaderProcessors = __webpack_require__(58349);
;// ./node_modules/@babylonjs/core/Engines/engineFeatures.js

//# sourceMappingURL=engineFeatures.js.map
;// ./node_modules/@babylonjs/core/Engines/engineFactory.js



/**
 * Helper class to create the best engine depending on the current hardware
 */
class EngineFactory {
    /**
     * Creates an engine based on the capabilities of the underlying hardware
     * @param canvas Defines the canvas to use to display the result
     * @param options Defines the options passed to the engine to create the context dependencies
     * @returns a promise that resolves with the created engine
     */
    static async CreateAsync(canvas, options) {
        const supported = await WebGPUEngine.IsSupportedAsync;
        if (supported) {
            return WebGPUEngine.CreateAsync(canvas, options);
        }
        if (Engines_engine/* Engine */.N.IsSupported) {
            return new Engines_engine/* Engine */.N(canvas, undefined, options);
        }
        return new NullEngine(options);
    }
}
//# sourceMappingURL=engineFactory.js.map
;// ./node_modules/@babylonjs/core/Engines/IMaterialContext.js

//# sourceMappingURL=IMaterialContext.js.map
;// ./node_modules/@babylonjs/core/Engines/IDrawContext.js

//# sourceMappingURL=IDrawContext.js.map
;// ./node_modules/@babylonjs/core/Engines/Processors/iShaderProcessor.js

//# sourceMappingURL=iShaderProcessor.js.map
;// ./node_modules/@babylonjs/core/Engines/index.js
/* eslint-disable import/no-internal-modules */







































//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/clipboardEvents.js
var clipboardEvents = __webpack_require__(69579);
;// ./node_modules/@babylonjs/core/Events/index.js




//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraph.js
var flowGraph = __webpack_require__(10243);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphBlock.js
var flowGraphBlock = __webpack_require__(71294);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphSignalConnection.js
var flowGraphSignalConnection = __webpack_require__(22767);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphExecutionBlock.js
var flowGraphExecutionBlock = __webpack_require__(16972);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphEventBlock.js
var flowGraphEventBlock = __webpack_require__(22086);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphRichTypes.js
var flowGraphRichTypes = __webpack_require__(4720);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphContext.js
var flowGraphContext = __webpack_require__(5788);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphCoordinator.js
var flowGraphCoordinator = __webpack_require__(84813);
;// ./node_modules/@babylonjs/core/FlowGraph/typeDefinitions.js

//# sourceMappingURL=typeDefinitions.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/flowGraphContextLogger.js

/**
 * @experimental
 * This class is a decorator for the context which logs the nodes that were executed.
 */
class FlowGraphContextLogger {
    constructor(_context) {
        this._context = _context;
        this._context.onNodeExecutedObservable.add((node) => {
            tools/* Tools */.S0.Log(`Node executed: ${node.getClassName()}`);
        });
    }
}
//# sourceMappingURL=flowGraphContextLogger.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphConnection.js
var flowGraphConnection = __webpack_require__(54011);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphDataConnection.js
var flowGraphDataConnection = __webpack_require__(60707);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js
var flowGraphConsoleLogBlock = __webpack_require__(59693);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js
var flowGraphSetVariableBlock = __webpack_require__(15682);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js
var flowGraphSetPropertyBlock = __webpack_require__(481);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js
var flowGraphSendCustomEventBlock = __webpack_require__(74015);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js



/**
 * @experimental
 * A block that evaluates a condition and executes one of two branches.
 */
class FlowGraphBranchBlock extends flowGraphExecutionBlock/* FlowGraphExecutionBlock */.u {
    constructor(config) {
        super(config);
        this.condition = this.registerDataInput("condition", flowGraphRichTypes/* RichTypeBoolean */.RI);
        this.onTrue = this._registerSignalOutput("onTrue");
        this.onFalse = this._registerSignalOutput("onFalse");
    }
    _execute(context) {
        if (this.condition.getValue(context)) {
            this.onTrue._activateSignal(context);
        }
        else {
            this.onFalse._activateSignal(context);
        }
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGBranchBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGBranchBlock", FlowGraphBranchBlock);
//# sourceMappingURL=flowGraphBranchBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js
var flowGraphDoNBlock = __webpack_require__(84679);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphExecutionBlockWithOutSignal.js
var flowGraphExecutionBlockWithOutSignal = __webpack_require__(33006);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js



/**
 * @experimental
 * Block that executes an action in a loop.
 */
class FlowGraphForLoopBlock extends flowGraphExecutionBlockWithOutSignal/* FlowGraphExecutionBlockWithOutSignal */.w {
    constructor(config) {
        super(config);
        this.startIndex = this.registerDataInput("startIndex", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.endIndex = this.registerDataInput("endIndex", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.step = this.registerDataInput("step", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.index = this.registerDataOutput("index", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.onLoop = this._registerSignalOutput("onLoop");
    }
    _executeLoop(context) {
        let index = context._getExecutionVariable(this, "index");
        const endIndex = context._getExecutionVariable(this, "endIndex");
        if (index < endIndex) {
            this.index.setValue(index, context);
            this.onLoop._activateSignal(context);
            const step = context._getExecutionVariable(this, "step", 1);
            index += step;
            context._setExecutionVariable(this, "index", index);
            this._executeLoop(context);
        }
        else {
            this.out._activateSignal(context);
        }
    }
    /**
     * @internal
     */
    _execute(context) {
        const index = this.startIndex.getValue(context);
        const endIndex = this.endIndex.getValue(context);
        const step = this.step.getValue(context);
        context._setExecutionVariable(this, "index", index);
        context._setExecutionVariable(this, "endIndex", endIndex);
        context._setExecutionVariable(this, "step", step);
        this._executeLoop(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGForLoopBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGForLoopBlock", FlowGraphForLoopBlock);
//# sourceMappingURL=flowGraphForLoopBlock.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js



/**
 * @experimental
 * A block that throttles the execution of its output flow.
 */
class FlowGraphThrottleBlock extends flowGraphExecutionBlockWithOutSignal/* FlowGraphExecutionBlockWithOutSignal */.w {
    constructor(config) {
        super(config);
        this.reset = this._registerSignalInput("reset");
        this.duration = this.registerDataInput("duration", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.timeRemaining = this.registerDataOutput("timeRemaining", flowGraphRichTypes/* RichTypeNumber */.Es);
    }
    _execute(context, callingSignal) {
        const lastExecutedTime = context._getExecutionVariable(this, "lastExecutedTime");
        const durationValue = this.duration.getValue(context);
        const currentTime = Date.now();
        if (callingSignal === this.reset || lastExecutedTime === undefined || currentTime - lastExecutedTime > durationValue) {
            //activate the output flow
            this.timeRemaining.setValue(0, context);
            this.out._activateSignal(context);
            context._setExecutionVariable(this, "lastExecutedTime", currentTime);
        }
        else {
            //activate the output flow after the remaining time
            const remaining = durationValue - (currentTime - lastExecutedTime);
            this.timeRemaining.setValue(remaining, context);
        }
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGThrottleBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGThrottleBlock", FlowGraphThrottleBlock);
//# sourceMappingURL=flowGraphThrottleBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js
var flowGraphTimerBlock = __webpack_require__(91263);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js



/**
 * @experimental
 * A block that has an input flow and routes it to any potential output flows, randomly or sequentially
 * @see https://docs.google.com/document/d/1MT7gL-IEn_PUw-4XGBazMxsyqsxqgAVGYcNeC4Cj_9Q/edit#heading=h.i2sn85fbjo60
 */
class FlowGraphMultiGateBlock extends flowGraphExecutionBlock/* FlowGraphExecutionBlock */.u {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        this._cachedUnusedIndexes = [];
        this.reset = this._registerSignalInput("reset");
        this.currentIndex = this.registerDataOutput("currentIndex", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.config.startIndex = this.config.startIndex !== undefined ? this.config.startIndex : 0;
        this.config.startIndex = Math.max(0, Math.min(this.config.startIndex, this.config.numberOutputFlows - 1));
        this.outFlows = [];
        for (let i = 0; i < this.config.numberOutputFlows; i++) {
            this.outFlows.push(this._registerSignalOutput(`out${i}`));
        }
    }
    _getUnusedIndexes(context) {
        const result = this._cachedUnusedIndexes;
        result.length = 0;
        if (!context._hasExecutionVariable(this, "unusedIndexes")) {
            for (let i = 0; i < this.config.numberOutputFlows; i++) {
                result.push(i);
            }
        }
        else {
            const contextUnusedIndexes = context._getExecutionVariable(this, "unusedIndexes");
            for (let i = 0; i < contextUnusedIndexes.length; i++) {
                result.push(contextUnusedIndexes[i]);
            }
        }
        return result;
    }
    _getNextOutput(currentIndex, unusedIndexes) {
        if (this.config.isRandom) {
            const nextIndex = Math.floor(Math.random() * unusedIndexes.length);
            return unusedIndexes[nextIndex];
        }
        else {
            return currentIndex + 1;
        }
    }
    _execute(context, callingSignal) {
        const currentIndex = context._getExecutionVariable(this, "currentIndex") ?? this.config.startIndex - 1;
        let unusedIndexes = this._getUnusedIndexes(context);
        if (callingSignal === this.reset) {
            context._deleteExecutionVariable(this, "currentIndex");
            context._deleteExecutionVariable(this, "unusedIndexes");
            return;
        }
        let nextIndex = this._getNextOutput(currentIndex, unusedIndexes);
        if (nextIndex >= this.config.numberOutputFlows && this.config.loop) {
            nextIndex = 0;
        }
        else if (nextIndex >= this.config.numberOutputFlows && !this.config.loop) {
            return;
        }
        unusedIndexes = unusedIndexes.filter((i) => i !== nextIndex);
        if (unusedIndexes.length === 0) {
            for (let i = 0; i < this.config.numberOutputFlows; i++) {
                unusedIndexes.push(i);
            }
        }
        context._setExecutionVariable(this, "unusedIndexes", unusedIndexes);
        context._setExecutionVariable(this, "currentIndex", nextIndex);
        this.currentIndex.setValue(nextIndex, context);
        this.outFlows[nextIndex]._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGMultiGateBlock";
    }
    /**
     * Serializes the block.
     * @param serializationObject the object to serialize to.
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.config.numberOutputFlows = this.config.numberOutputFlows;
        serializationObject.config.isRandom = this.config.isRandom;
        serializationObject.config.loop = this.config.loop;
        serializationObject.config.startIndex = this.config.startIndex;
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGMultiGateBlock", FlowGraphMultiGateBlock);
//# sourceMappingURL=flowGraphMultiGateBlock.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js



/**
 * @experimental
 * A block that executes a branch based on a selection.
 */
class FlowGraphSwitchBlock extends flowGraphExecutionBlock/* FlowGraphExecutionBlock */.u {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        this.selection = this.registerDataInput("selection", flowGraphRichTypes/* RichTypeAny */.Vv);
        this.outputFlows = [];
        for (let i = 0; i <= this.config.cases.length; i++) {
            this.outputFlows.push(this._registerSignalOutput(`out${i}`));
        }
    }
    _execute(context, _callingSignal) {
        const selectionValue = this.selection.getValue(context);
        for (let i = 0; i < this.config.cases.length; i++) {
            if (selectionValue === this.config.cases[i]) {
                this.outputFlows[i]._activateSignal(context);
                return;
            }
        }
        // default case
        this.outputFlows[this.outputFlows.length - 1]._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGSwitchBlock";
    }
    /**
     * Serialize the block to a JSON representation.
     * @param serializationObject the object to serialize to.
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.cases = this.config.cases;
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGSwitchBlock", FlowGraphSwitchBlock);
//# sourceMappingURL=flowGraphSwitchBlock.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js


/**
 * @experimental
 * A block that waits for all input flows to be activated before activating its output flow.
 */
class FlowGraphWaitAllBlock extends flowGraphExecutionBlockWithOutSignal/* FlowGraphExecutionBlockWithOutSignal */.w {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        /**
         * Input connection: The 2nd to nth input flows (the first is named onStart)
         */
        this.inFlows = [];
        this._cachedActivationState = [];
        this.reset = this._registerSignalInput("reset");
        // The first inFlow is the default input signal all execution blocks have
        for (let i = 1; i < this.config.numberInputFlows; i++) {
            this.inFlows.push(this._registerSignalInput(`in${i}`));
        }
    }
    _getCurrentActivationState(context) {
        const activationState = this._cachedActivationState;
        activationState.length = 0;
        if (!context._hasExecutionVariable(this, "activationState")) {
            for (let i = 0; i < this.config.numberInputFlows; i++) {
                activationState.push(false);
            }
        }
        else {
            const contextActivationState = context._getExecutionVariable(this, "activationState");
            for (let i = 0; i < contextActivationState.length; i++) {
                activationState.push(contextActivationState[i]);
            }
        }
        return activationState;
    }
    _execute(context, callingSignal) {
        const activationState = this._getCurrentActivationState(context);
        if (callingSignal === this.reset) {
            for (let i = 0; i < this.config.numberInputFlows; i++) {
                activationState[i] = false;
            }
        }
        else if (callingSignal === this.in) {
            activationState[0] = true;
        }
        else {
            const index = this.inFlows.indexOf(callingSignal);
            if (index >= 0) {
                activationState[index + 1] = true;
            }
        }
        context._setExecutionVariable(this, "activationState", activationState.slice());
        if (activationState.every((value) => value)) {
            this.out._activateSignal(context);
            for (let i = 0; i < this.config.numberInputFlows; i++) {
                activationState[i] = false;
            }
        }
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGWaitAllBlock";
    }
    /**
     * Serializes this block into a object
     * @param serializationObject the object to serialize to
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.config.numberInputFlows = this.config.numberInputFlows;
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGWaitAllBlock", FlowGraphWaitAllBlock);
//# sourceMappingURL=flowGraphWaitAllBlock.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js



/**
 * @experimental
 * A block that counts the number of times it has been called.
 */
class FlowGraphCounterBlock extends flowGraphExecutionBlockWithOutSignal/* FlowGraphExecutionBlockWithOutSignal */.w {
    constructor(config) {
        super(config);
        this.count = this.registerDataOutput("count", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.reset = this._registerSignalInput("reset");
    }
    _execute(context, callingSignal) {
        if (callingSignal === this.reset) {
            context._setExecutionVariable(this, "count", 0);
            this.count.setValue(0, context);
            return;
        }
        const countValue = (context._getExecutionVariable(this, "count") ?? 0) + 1;
        context._setExecutionVariable(this, "count", countValue);
        this.count.setValue(countValue, context);
        this.out._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGCounterBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGCounterBlock", FlowGraphCounterBlock);
//# sourceMappingURL=flowGraphCounterBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js
var flowGraphWhileLoopBlock = __webpack_require__(87593);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js



/**
 * @experimental
 * This block debounces the execution of a input, i.e. ensures that the input is only executed once every X times
 */
class FlowGraphDebounceBlock extends flowGraphExecutionBlockWithOutSignal/* FlowGraphExecutionBlockWithOutSignal */.w {
    constructor(config) {
        super(config);
        this.count = this.registerDataInput("count", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.reset = this._registerSignalInput("reset");
        this.currentCount = this.registerDataOutput("currentCount", flowGraphRichTypes/* RichTypeNumber */.Es);
    }
    _execute(context, callingSignal) {
        if (callingSignal === this.reset) {
            context._setExecutionVariable(this, "debounceCount", 0);
            return;
        }
        const count = this.count.getValue(context);
        const currentCount = context._getExecutionVariable(this, "debounceCount", 0);
        const newCount = currentCount + 1;
        this.currentCount.setValue(newCount, context);
        context._setExecutionVariable(this, "debounceCount", newCount);
        if (newCount >= count) {
            this.out._activateSignal(context);
            context._setExecutionVariable(this, "debounceCount", 0);
        }
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGDebounceBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGDebounceBlock", FlowGraphDebounceBlock);
//# sourceMappingURL=flowGraphDebounceBlock.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js



/**
 * @experimental
 * This block flip flops between two outputs.
 */
class FlowGraphFlipFlopBlock extends flowGraphExecutionBlock/* FlowGraphExecutionBlock */.u {
    constructor(config) {
        super(config);
        this.onOn = this._registerSignalOutput("onOn");
        this.onOff = this._registerSignalOutput("onOff");
        this.isOn = this.registerDataOutput("isOn", flowGraphRichTypes/* RichTypeBoolean */.RI);
    }
    _execute(context, _callingSignal) {
        let value = context._getExecutionVariable(this, "value", false);
        value = !value;
        context._setExecutionVariable(this, "value", value);
        this.isOn.setValue(value, context);
        if (value) {
            this.onOn._activateSignal(context);
        }
        else {
            this.onOff._activateSignal(context);
        }
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGFlipFlopBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGFlipFlopBlock", FlowGraphFlipFlopBlock);
//# sourceMappingURL=flowGraphFlipFlopBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js
var flowGraphSequenceBlock = __webpack_require__(78855);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/index.js













//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphAsyncExecutionBlock.js
var flowGraphAsyncExecutionBlock = __webpack_require__(51000);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/flowGraphPathConverterComponent.js
var flowGraphPathConverterComponent = __webpack_require__(92579);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js




/**
 * @experimental
 * A block that plays an animation on an animatable object.
 */
class FlowGraphPlayAnimationBlock extends flowGraphAsyncExecutionBlock/* FlowGraphAsyncExecutionBlock */.M {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        this.templateTargetComponent = new flowGraphPathConverterComponent/* FlowGraphPathConverterComponent */.H(config.targetPath, this);
        this.templateAnimationComponent = new flowGraphPathConverterComponent/* FlowGraphPathConverterComponent */.H(config.animationPath, this);
        this.speed = this.registerDataInput("speed", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.loop = this.registerDataInput("loop", flowGraphRichTypes/* RichTypeBoolean */.RI);
        this.from = this.registerDataInput("from", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.to = this.registerDataInput("to", flowGraphRichTypes/* RichTypeNumber */.Es);
        this.runningAnimatable = this.registerDataOutput("runningAnimatable", flowGraphRichTypes/* RichTypeAny */.Vv);
    }
    /**
     * @internal
     * @param context
     */
    _preparePendingTasks(context) {
        const targetAccessor = this.templateTargetComponent.getAccessor(this.config.pathConverter, context);
        const targetValue = targetAccessor.info.getObject(targetAccessor.object);
        const animationAccessor = this.templateAnimationComponent.getAccessor(this.config.pathConverter, context);
        const animationValue = animationAccessor.info.get(animationAccessor.object);
        if (!targetValue || !animationValue) {
            throw new Error("Cannot play animation without target or animation");
        }
        const contextAnimatables = context._getExecutionVariable(this, "runningAnimatables") ?? [];
        // was an animation started on this target already and was just paused? if so, we can unpause it.
        const existingAnimatable = this.runningAnimatable.getValue(context);
        if (existingAnimatable && existingAnimatable.paused) {
            existingAnimatable.restart();
        }
        else {
            const scene = context.configuration.scene;
            const animatable = scene.beginDirectAnimation(targetValue, [animationValue], this.from.getValue(context), this.to.getValue(context), this.loop.getValue(context), this.speed.getValue(context), () => this._onAnimationEnd(animatable, context));
            this.runningAnimatable.setValue(animatable, context);
            contextAnimatables.push(animatable);
        }
        context._setExecutionVariable(this, "runningAnimatables", contextAnimatables);
    }
    _execute(context) {
        this._startPendingTasks(context);
        this.out._activateSignal(context);
    }
    _onAnimationEnd(animatable, context) {
        const contextAnims = context._getExecutionVariable(this, "runningAnimatables") ?? [];
        const index = contextAnims.indexOf(animatable);
        if (index !== -1) {
            contextAnims.splice(index, 1);
        }
        context._removePendingBlock(this);
        this.done._activateSignal(context);
    }
    /**
     * @internal
     * Stop any currently running animations.
     */
    _cancelPendingTasks(context) {
        const contextAnims = context._getExecutionVariable(this, "runningAnimatables") ?? [];
        for (const anim of contextAnims) {
            anim.stop();
        }
        context._deleteExecutionVariable(this, "runningAnimatables");
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return FlowGraphPlayAnimationBlock.ClassName;
    }
    /**
     * Serializes the block to a JSON object.
     * @param serializationObject the object to serialize to.
     */
    serialize(serializationObject = {}) {
        super.serialize(serializationObject);
        serializationObject.config.targetPath = this.config.targetPath;
        serializationObject.config.animationPath = this.config.animationPath;
    }
}
/**
 * Class name of the block.
 */
FlowGraphPlayAnimationBlock.ClassName = "FGPlayAnimationBlock";
(0,typeStore/* RegisterClass */.Y5)(FlowGraphPlayAnimationBlock.ClassName, FlowGraphPlayAnimationBlock);
//# sourceMappingURL=flowGraphPlayAnimationBlock.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js



/**
 * @experimental
 * Block that stops a running animation
 */
class FlowGraphStopAnimationBlock extends flowGraphExecutionBlockWithOutSignal/* FlowGraphExecutionBlockWithOutSignal */.w {
    constructor(config) {
        super(config);
        this.animationToStop = this.registerDataInput("animationToStop", flowGraphRichTypes/* RichTypeAny */.Vv);
    }
    _execute(context) {
        const animationToStopValue = this.animationToStop.getValue(context);
        animationToStopValue.stop();
        this.out._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGStopAnimationBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGStopAnimationBlock", FlowGraphStopAnimationBlock);
//# sourceMappingURL=flowGraphStopAnimationBlock.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js



/**
 * @experimental
 * Block that pauses a running animation
 */
class FlowGraphPauseAnimationBlock extends flowGraphExecutionBlockWithOutSignal/* FlowGraphExecutionBlockWithOutSignal */.w {
    constructor(config) {
        super(config);
        this.animationToPause = this.registerDataInput("animationToPause", flowGraphRichTypes/* RichTypeAny */.Vv);
    }
    _execute(context) {
        const animationToPauseValue = this.animationToPause.getValue(context);
        animationToPauseValue.pause();
        this.out._activateSignal(context);
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FGPauseAnimationBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGPauseAnimationBlock", FlowGraphPauseAnimationBlock);
//# sourceMappingURL=flowGraphPauseAnimationBlock.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/Animation/index.js



//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/index.js




// eslint-disable-next-line import/no-internal-modules

// eslint-disable-next-line import/no-internal-modules

//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js



/**
 * @experimental
 * Block that returns a value based on a condition.
 */
class FlowGraphConditionalDataBlock extends flowGraphBlock/* FlowGraphBlock */.e {
    constructor(config) {
        super(config);
        this.condition = this.registerDataInput("condition", flowGraphRichTypes/* RichTypeBoolean */.RI);
        this.trueValue = this.registerDataInput("trueValue", flowGraphRichTypes/* RichTypeAny */.Vv);
        this.falseValue = this.registerDataInput("falseValue", flowGraphRichTypes/* RichTypeAny */.Vv);
        this.output = this.registerDataOutput("output", flowGraphRichTypes/* RichTypeAny */.Vv);
    }
    /**
     * @internal
     */
    _updateOutputs(context) {
        this.output.setValue(this.condition.getValue(context) ? this.trueValue.getValue(context) : this.falseValue.getValue(context), context);
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return "FGConditionalDataBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGConditionalDataBlock", FlowGraphConditionalDataBlock);
//# sourceMappingURL=flowGraphConditionalDataBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js
var flowGraphGetVariableBlock = __webpack_require__(50926);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js




/**
 * @experimental
 * This blocks transforms a vector from one coordinate system to another.
 */
class FlowGraphCoordinateTransformBlock extends flowGraphBlock/* FlowGraphBlock */.e {
    /**
     * Creates a new FlowGraphCoordinateTransformBlock
     * @param config optional configuration for this block
     */
    constructor(config) {
        super(config);
        this.sourceSystem = this.registerDataInput("sourceSystem", flowGraphRichTypes/* RichTypeAny */.Vv);
        this.destinationSystem = this.registerDataInput("destinationSystem", flowGraphRichTypes/* RichTypeAny */.Vv);
        this.inputCoordinates = this.registerDataInput("inputCoordinates", flowGraphRichTypes/* RichTypeVector3 */.Dx);
        this.outputCoordinates = this.registerDataOutput("outputCoordinates", flowGraphRichTypes/* RichTypeVector3 */.Dx);
    }
    _updateOutputs(_context) {
        const sourceSystemValue = this.sourceSystem.getValue(_context);
        const destinationSystemValue = this.destinationSystem.getValue(_context);
        const inputCoordinatesValue = this.inputCoordinates.getValue(_context);
        // takes coordinates from source space to world space
        const sourceWorld = sourceSystemValue.getWorldMatrix();
        // takes coordinates from destination space to world space
        const destinationWorld = destinationSystemValue.getWorldMatrix();
        const destinationWorldInverse = math_vector/* TmpVectors */.AA.Matrix[0].copyFrom(destinationWorld);
        // takes coordinates from world space to destination space
        destinationWorldInverse.invert();
        const sourceToDestination = math_vector/* TmpVectors */.AA.Matrix[1];
        // takes coordinates from source space to world space to destination space
        destinationWorldInverse.multiplyToRef(sourceWorld, sourceToDestination);
        const outputCoordinatesValue = this.outputCoordinates.getValue(_context);
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(inputCoordinatesValue, sourceToDestination, outputCoordinatesValue);
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return "FGCoordinateTransformBlock";
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGCoordinateTransformBlock", FlowGraphCoordinateTransformBlock);
//# sourceMappingURL=flowGraphCoordinateTransformBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/serialization.js
var serialization = __webpack_require__(339);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphConstantBlock.js




/**
 * @experimental
 * Block that returns a constant value.
 */
class FlowGraphConstantBlock extends flowGraphBlock/* FlowGraphBlock */.e {
    constructor(
    /**
     * the configuration of the block
     */
    config) {
        super(config);
        this.config = config;
        this.output = this.registerDataOutput("output", (0,flowGraphRichTypes/* getRichTypeFromValue */.k4)(config.value));
    }
    _updateOutputs(context) {
        this.output.setValue(this.config.value, context);
    }
    /**
     * Gets the class name of this block
     * @returns the class name
     */
    getClassName() {
        return "FGConstantBlock";
    }
    /**
     * Serializes this block
     * @param serializationObject the object to serialize to
     * @param valueSerializeFunction the function to use to serialize the value
     */
    serialize(serializationObject = {}, valueSerializeFunction = serialization/* defaultValueSerializationFunction */.X5) {
        super.serialize(serializationObject);
        valueSerializeFunction("value", this.config.value, serializationObject.config);
    }
}
(0,typeStore/* RegisterClass */.Y5)("FGConstantBlock", FlowGraphConstantBlock);
//# sourceMappingURL=flowGraphConstantBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js
var flowGraphGetPropertyBlock = __webpack_require__(98285);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js
var flowGraphBinaryOperationBlock = __webpack_require__(77467);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js
var flowGraphUnaryOperationBlock = __webpack_require__(63318);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js




const PREFIX = "FGLogic";
const AND = "AndBlock";
const OR = "OrBlock";
const NOT = "NotBlock";
/**
 * Performs an AND operation on two boolean values.
 * @experimental
 */
class FlowGraphLogicAndBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeBoolean */.RI, flowGraphRichTypes/* RichTypeBoolean */.RI, flowGraphRichTypes/* RichTypeBoolean */.RI, (left, right) => left && right, `${PREFIX}${AND}`, config);
    }
}
(0,typeStore/* RegisterClass */.Y5)(`${PREFIX}${AND}`, FlowGraphLogicAndBlock);
/**
 * Performs an OR operation on two boolean values.
 * @experimental
 */
class FlowGraphLogicOrBlock extends flowGraphBinaryOperationBlock/* FlowGraphBinaryOperationBlock */.W {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeBoolean */.RI, flowGraphRichTypes/* RichTypeBoolean */.RI, flowGraphRichTypes/* RichTypeBoolean */.RI, (left, right) => left || right, `${PREFIX}${OR}`, config);
    }
}
(0,typeStore/* RegisterClass */.Y5)(`${PREFIX}${OR}`, FlowGraphLogicOrBlock);
/**
 * Performs a NOT operation on a boolean value
 * @experimental
 */
class FlowGraphLogicNotBlock extends flowGraphUnaryOperationBlock/* FlowGraphUnaryOperationBlock */.a {
    constructor(config) {
        super(flowGraphRichTypes/* RichTypeBoolean */.RI, flowGraphRichTypes/* RichTypeBoolean */.RI, (value) => !value, `${PREFIX}${NOT}`, config);
    }
}
(0,typeStore/* RegisterClass */.Y5)(`${PREFIX}${NOT}`, FlowGraphLogicNotBlock);
//# sourceMappingURL=flowGraphLogicBlocks.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Logic/index.js

//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js + 2 modules
var flowGraphMathBlocks = __webpack_require__(98334);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Math/index.js

//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Data/index.js





// eslint-disable-next-line import/no-internal-modules

// eslint-disable-next-line import/no-internal-modules

//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js
var flowGraphMeshPickEventBlock = __webpack_require__(72536);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js
var flowGraphSceneReadyEventBlock = __webpack_require__(15583);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js
var flowGraphReceiveCustomEventBlock = __webpack_require__(33314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js
var flowGraphSceneTickEventBlock = __webpack_require__(69569);
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/Event/index.js




//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/Blocks/index.js
/* eslint-disable import/no-internal-modules */



//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/FlowGraph/index.js












// eslint-disable-next-line import/no-internal-modules

//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FrameGraph/Node/nodeRenderGraphBlock.js
var nodeRenderGraphBlock = __webpack_require__(95166);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FrameGraph/Node/Types/nodeRenderGraphTypes.js
var nodeRenderGraphTypes = __webpack_require__(29388);
;// ./node_modules/@babylonjs/core/FrameGraph/frameGraphTypes.js
/**
 * Represents a texture handle for the backbuffer color texture.
 */
const backbufferColorTextureHandle = 0;
/**
 * Represents a texture handle for the backbuffer depth/stencil texture.
 */
const backbufferDepthStencilTextureHandle = 1;
//# sourceMappingURL=frameGraphTypes.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FrameGraph/frameGraphTask.js
var frameGraphTask = __webpack_require__(43314);
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js


/**
 * Task which copies a texture to the backbuffer color texture.
 */
class FrameGraphCopyToBackbufferColorTask extends frameGraphTask/* FrameGraphTask */.L {
    record() {
        if (this.sourceTexture === undefined) {
            throw new Error(`FrameGraphCopyToBackbufferColorTask "${this.name}": sourceTexture is required`);
        }
        const pass = this._frameGraph.addRenderPass(this.name);
        pass.setRenderTarget(backbufferColorTextureHandle);
        pass.setExecuteFunc((context) => {
            if (!context.isBackbuffer(this.sourceTexture)) {
                context.copyTexture(this.sourceTexture);
            }
        });
        const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
        passDisabled.setRenderTarget(backbufferColorTextureHandle);
        passDisabled.setExecuteFunc((_context) => { });
    }
}
//# sourceMappingURL=copyToBackbufferColorTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/outputBlock.js




/**
 * Block used to generate the final graph
 */
class NodeRenderGraphOutputBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphOutputBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this._isUnique = true;
        this.registerInput("texture", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.texture.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll);
        this._frameGraphTask = new FrameGraphCopyToBackbufferColorTask(name, frameGraph);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphOutputBlock";
    }
    /**
     * Gets the texture input component
     */
    get texture() {
        return this._inputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        const textureConnectedPoint = this.texture.connectedPoint;
        if (textureConnectedPoint) {
            this._frameGraphTask.sourceTexture = textureConnectedPoint.value;
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphOutputBlock", NodeRenderGraphOutputBlock);
//# sourceMappingURL=outputBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FrameGraph/Passes/pass.js
var Passes_pass = __webpack_require__(6785);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FrameGraph/Passes/renderPass.js
var renderPass = __webpack_require__(91133);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FrameGraph/Passes/cullPass.js
var cullPass = __webpack_require__(65021);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effectRenderer.js
var effectRenderer = __webpack_require__(84255);
;// ./node_modules/@babylonjs/core/Misc/copyTextureToTexture.js


/**
 * Conversion modes available when copying a texture into another one
 */
var ConversionMode;
(function (ConversionMode) {
    ConversionMode[ConversionMode["None"] = 0] = "None";
    ConversionMode[ConversionMode["ToLinearSpace"] = 1] = "ToLinearSpace";
    ConversionMode[ConversionMode["ToGammaSpace"] = 2] = "ToGammaSpace";
})(ConversionMode || (ConversionMode = {}));
/**
 * Class used for fast copy from one texture to another
 */
class CopyTextureToTexture {
    /**
     * Gets the shader language
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    _textureIsInternal(texture) {
        return texture.getInternalTexture === undefined;
    }
    /**
     * Constructs a new instance of the class
     * @param engine The engine to use for the copy
     * @param isDepthTexture True means that we should write (using gl_FragDepth) into the depth texture attached to the destination (default: false)
     */
    constructor(engine, isDepthTexture = false) {
        /** Shader language used */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._shadersLoaded = false;
        this._engine = engine;
        this._isDepthTexture = isDepthTexture;
        this._renderer = new effectRenderer/* EffectRenderer */.J(engine);
        this._initShaderSourceAsync(isDepthTexture);
    }
    async _initShaderSourceAsync(isDepthTexture) {
        const engine = this._engine;
        if (engine.isWebGPU) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 17770));
        }
        else {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 45963));
        }
        this._shadersLoaded = true;
        this._effectWrapper = new effectRenderer/* EffectWrapper */.$({
            engine: engine,
            name: "CopyTextureToTexture",
            fragmentShader: "copyTextureToTexture",
            useShaderStore: true,
            uniformNames: ["conversion"],
            samplerNames: ["textureSampler"],
            defines: isDepthTexture ? ["#define DEPTH_TEXTURE"] : [],
            shaderLanguage: this._shaderLanguage,
        });
        this._effectWrapper.onApplyObservable.add(() => {
            if (isDepthTexture) {
                engine.setState(false);
                engine.setDepthBuffer(true);
                engine.depthCullingState.depthMask = true;
                engine.depthCullingState.depthFunc = 519;
            }
            else {
                engine.depthCullingState.depthMask = false;
                // other states are already set by EffectRenderer.applyEffectWrapper
            }
            if (this._textureIsInternal(this._source)) {
                this._effectWrapper.effect._bindTexture("textureSampler", this._source);
            }
            else {
                this._effectWrapper.effect.setTexture("textureSampler", this._source);
            }
            this._effectWrapper.effect.setFloat("conversion", this._conversion);
        });
    }
    /**
     * Indicates if the effect is ready to be used for the copy
     * @returns true if "copy" can be called without delay, else false
     */
    isReady() {
        return this._shadersLoaded && this._effectWrapper.effect.isReady();
    }
    /**
     * Copy one texture into another
     * @param source The source texture
     * @param destination The destination texture. If null, copy the source to the currently bound framebuffer
     * @param conversion The conversion mode that should be applied when copying
     * @returns
     */
    copy(source, destination = null, conversion = 0 /* ConversionMode.None */) {
        if (!this.isReady()) {
            return false;
        }
        this._source = source;
        this._conversion = conversion;
        const engineDepthFunc = this._engine.getDepthFunction();
        const engineDepthMask = this._engine.getDepthWrite(); // for some reasons, depthWrite is not restored by EffectRenderer.restoreStates
        this._renderer.render(this._effectWrapper, destination);
        this._engine.setDepthWrite(engineDepthMask);
        if (this._isDepthTexture && engineDepthFunc) {
            this._engine.setDepthFunction(engineDepthFunc);
        }
        return true;
    }
    /**
     * Releases all the resources used by the class
     */
    dispose() {
        this._effectWrapper?.dispose();
        this._renderer.dispose();
    }
}
//# sourceMappingURL=copyTextureToTexture.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/frameGraphContext.js
/**
 * Base class for frame graph context.
 */
class FrameGraphContext {
}
//# sourceMappingURL=frameGraphContext.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/frameGraphRenderContext.js




/**
 * Frame graph context used render passes.
 * @experimental
 */
class FrameGraphRenderContext extends FrameGraphContext {
    static _IsObjectRenderer(value) {
        return value.initRender !== undefined;
    }
    /** @internal */
    constructor(_engine, _textureManager, _scene) {
        super();
        this._engine = _engine;
        this._textureManager = _textureManager;
        this._scene = _scene;
        this._debugMessageHasBeenPushed = false;
        this._renderTargetIsBound = true;
        this._effectRenderer = new effectRenderer/* EffectRenderer */.J(this._engine);
        this._copyTexture = new CopyTextureToTexture(this._engine);
    }
    /**
     * Checks whether a texture handle points to the backbuffer's color or depth texture
     * @param handle The handle to check
     * @returns True if the handle points to the backbuffer's color or depth texture, otherwise false
     */
    isBackbuffer(handle) {
        return this._textureManager.isBackbuffer(handle);
    }
    /**
     * Checks whether a texture handle points to the backbuffer's color texture
     * @param handle The handle to check
     * @returns True if the handle points to the backbuffer's color texture, otherwise false
     */
    isBackbufferColor(handle) {
        return this._textureManager.isBackbufferColor(handle);
    }
    /**
     * Checks whether a texture handle points to the backbuffer's depth texture
     * @param handle The handle to check
     * @returns True if the handle points to the backbuffer's depth texture, otherwise false
     */
    isBackbufferDepthStencil(handle) {
        return this._textureManager.isBackbufferDepthStencil(handle);
    }
    /**
     * Creates a (frame graph) render target wrapper
     * Note that renderTargets or renderTargetDepth can be undefined, but not both at the same time!
     * @param name Name of the render target wrapper
     * @param renderTargets Render target handles (textures) to use
     * @param renderTargetDepth Render target depth handle (texture) to use
     * @returns The created render target wrapper
     */
    createRenderTarget(name, renderTargets, renderTargetDepth) {
        return this._textureManager.createRenderTarget(name, renderTargets, renderTargetDepth);
    }
    /**
     * Clears the current render buffer or the current render target (if any is set up)
     * @param color Defines the color to use
     * @param backBuffer Defines if the back buffer must be cleared
     * @param depth Defines if the depth buffer must be cleared
     * @param stencil Defines if the stencil buffer must be cleared
     */
    clear(color, backBuffer, depth, stencil) {
        this._applyRenderTarget();
        this._engine.clear(color, backBuffer, depth, stencil);
    }
    /**
     * Clears the color attachments of the current render target
     * @param color Defines the color to use
     * @param attachments The attachments to clear
     */
    clearColorAttachments(color, attachments) {
        this._applyRenderTarget();
        this._engine.bindAttachments(attachments);
        this._engine.clear(color, true, false, false);
    }
    /**
     * Binds the attachments to the current render target
     * @param attachments The attachments to bind
     */
    bindAttachments(attachments) {
        this._applyRenderTarget();
        this._engine.bindAttachments(attachments);
    }
    /**
     * Generates mipmaps for the current render target
     */
    generateMipMaps() {
        if (this._currentRenderTarget?.renderTargetWrapper === undefined) {
            return;
        }
        if (this._renderTargetIsBound && this._engine._currentRenderTarget) {
            // we can't generate the mipmaps if the render target is bound
            this._flushDebugMessages();
            this._engine.unBindFramebuffer(this._engine._currentRenderTarget);
            this._renderTargetIsBound = false;
        }
        const textures = this._currentRenderTarget.renderTargetWrapper.textures;
        if (textures) {
            for (const texture of textures) {
                this._engine.generateMipmaps(texture);
            }
        }
    }
    /**
     * Sets the texture sampling mode for a given texture handle
     * @param handle Handle of the texture to set the sampling mode for
     * @param samplingMode Sampling mode to set
     */
    setTextureSamplingMode(handle, samplingMode) {
        const internalTexture = this._textureManager.getTextureFromHandle(handle);
        if (internalTexture && internalTexture.samplingMode !== samplingMode) {
            this._engine.updateTextureSamplingMode(samplingMode, internalTexture);
        }
    }
    /**
     * Binds a texture handle to a given effect (resolves the handle to a texture and binds it to the effect)
     * @param effect The effect to bind the texture to
     * @param name The name of the texture in the effect
     * @param handle The handle of the texture to bind
     */
    bindTextureHandle(effect, name, handle) {
        let texture;
        const historyEntry = this._textureManager._historyTextures.get(handle);
        if (historyEntry) {
            texture = historyEntry.textures[historyEntry.index]; // texture we write to in this frame
            if (this._currentRenderTarget !== undefined &&
                this._currentRenderTarget.renderTargetWrapper !== undefined &&
                this._currentRenderTarget.renderTargetWrapper.textures.includes(texture)) {
                // If the current render target renders to the history write texture, we bind the read texture instead
                texture = historyEntry.textures[historyEntry.index ^ 1];
            }
        }
        else {
            texture = this._textureManager._textures.get(handle).texture;
        }
        effect._bindTexture(name, texture);
    }
    /**
     * Sets the depth states for the current render target
     * @param depthTest If true, depth testing is enabled
     * @param depthWrite If true, depth writing is enabled
     */
    setDepthStates(depthTest, depthWrite) {
        this._engine.setDepthBuffer(depthTest);
        this._engine.setDepthWrite(depthWrite);
    }
    /**
     * Applies a full-screen effect to the current render target
     * @param drawWrapper The draw wrapper containing the effect to apply
     * @param customBindings The custom bindings to use when applying the effect (optional)
     * @returns True if the effect was applied, otherwise false (effect not ready)
     */
    applyFullScreenEffect(drawWrapper, customBindings) {
        if (!drawWrapper.effect?.isReady()) {
            return false;
        }
        this._applyRenderTarget();
        const engineDepthMask = this._engine.getDepthWrite(); // for some reasons, depthWrite is not restored by EffectRenderer.restoreStates
        this._effectRenderer.saveStates();
        this._effectRenderer.setViewport();
        this._engine.enableEffect(drawWrapper);
        this._engine.setState(false);
        this._engine.setDepthBuffer(false);
        this._engine.setDepthWrite(false);
        this._effectRenderer.bindBuffers(drawWrapper.effect);
        customBindings?.();
        this._effectRenderer.draw();
        this._effectRenderer.restoreStates();
        this._engine.setDepthWrite(engineDepthMask);
        this._engine.setAlphaMode(0);
        return true;
    }
    /**
     * Copies a texture to the current render target
     * @param sourceTexture The source texture to copy from
     * @param forceCopyToBackbuffer If true, the copy will be done to the back buffer regardless of the current render target
     */
    copyTexture(sourceTexture, forceCopyToBackbuffer = false) {
        if (forceCopyToBackbuffer) {
            this.bindRenderTarget();
        }
        this._applyRenderTarget();
        this._copyTexture.copy(this._textureManager.getTextureFromHandle(sourceTexture));
    }
    /**
     * Renders a RenderTargetTexture or a layer
     * @param object The RenderTargetTexture/Layer to render
     * @param viewportWidth The width of the viewport (optional for Layer, but mandatory for ObjectRenderer)
     * @param viewportHeight The height of the viewport (optional for Layer, but mandatory for ObjectRenderer)
     */
    render(object, viewportWidth, viewportHeight) {
        if (FrameGraphRenderContext._IsObjectRenderer(object)) {
            if (object.shouldRender()) {
                this._scene.incrementRenderId();
                this._scene.resetCachedMaterial();
                object.prepareRenderList();
                object.initRender(viewportWidth, viewportHeight);
                this._applyRenderTarget();
                object.render();
                object.finishRender();
            }
        }
        else {
            this._applyRenderTarget();
            object.render();
        }
    }
    /**
     * Binds a render target texture so that upcoming draw calls will render to it
     * Note: it is a lazy operation, so the render target will only be bound when needed. This way, it is possible to call
     *   this method several times with different render targets without incurring the cost of binding if no draw calls are made
     * @param renderTarget The handle of the render target texture to bind (default: undefined, meaning "back buffer"). Pass an array for MRT rendering.
     * @param debugMessage Optional debug message to display when the render target is bound (visible in PIX, for example)
     */
    bindRenderTarget(renderTarget, debugMessage) {
        if ((renderTarget?.renderTargetWrapper === undefined && this._currentRenderTarget === undefined) ||
            (renderTarget && this._currentRenderTarget && renderTarget.equals(this._currentRenderTarget))) {
            this._flushDebugMessages();
            if (debugMessage !== undefined) {
                this._engine._debugPushGroup?.(debugMessage, 2);
                this._debugMessageWhenTargetBound = undefined;
                this._debugMessageHasBeenPushed = true;
            }
            return;
        }
        this._currentRenderTarget = renderTarget?.renderTargetWrapper === undefined ? undefined : renderTarget;
        this._debugMessageWhenTargetBound = debugMessage;
        this._renderTargetIsBound = false;
    }
    /** @internal */
    _flushDebugMessages() {
        if (this._debugMessageHasBeenPushed) {
            this._engine._debugPopGroup?.(2);
            this._debugMessageHasBeenPushed = false;
        }
    }
    _applyRenderTarget() {
        if (this._renderTargetIsBound) {
            return;
        }
        this._flushDebugMessages();
        const renderTargetWrapper = this._currentRenderTarget?.renderTargetWrapper;
        if (renderTargetWrapper === undefined) {
            this._engine.restoreDefaultFramebuffer();
        }
        else {
            if (this._engine._currentRenderTarget) {
                this._engine.unBindFramebuffer(this._engine._currentRenderTarget);
            }
            this._engine.bindFramebuffer(renderTargetWrapper);
        }
        if (this._debugMessageWhenTargetBound !== undefined) {
            this._engine._debugPushGroup?.(this._debugMessageWhenTargetBound, 2);
            this._debugMessageWhenTargetBound = undefined;
            this._debugMessageHasBeenPushed = true;
        }
        this._renderTargetIsBound = true;
    }
    /** @internal */
    _isReady() {
        return this._copyTexture.isReady();
    }
    /** @internal */
    _dispose() {
        this._effectRenderer.dispose();
        this._copyTexture.dispose();
    }
}
//# sourceMappingURL=frameGraphRenderContext.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/textureCreationOptions.js
/**
 * Check if a TextureSize is an object
 * @param size The TextureSize to check
 * @returns True if the TextureSize is an object
 */
function textureSizeIsObject(size) {
    // eslint-disable-next-line jsdoc/require-jsdoc
    return size.width !== undefined;
}
/**
 * Get the width/height dimensions from a TextureSize
 * @param size The TextureSize to get the dimensions from
 * @returns The width and height as an object
 */
function getDimensionsFromTextureSize(size) {
    if (textureSizeIsObject(size)) {
        return { width: size.width, height: size.height };
    }
    return { width: size, height: size };
}
//# sourceMappingURL=textureCreationOptions.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/frameGraphRenderTarget.js
/**
 * @internal
 * @experimental
 */
class FrameGraphRenderTarget {
    constructor(name, textureManager, renderTargets, renderTargetDepth) {
        this._isBackBuffer = false;
        this.name = name;
        this._textureManager = textureManager;
        this._renderTargets = renderTargets === undefined ? undefined : Array.isArray(renderTargets) ? renderTargets : [renderTargets];
        this._renderTargetDepth = renderTargetDepth;
    }
    get renderTargetWrapper() {
        if (this._isBackBuffer) {
            return undefined;
        }
        if (!this._renderTargetWrapper) {
            const engine = this._textureManager.engine;
            // _renderTargets and _renderTargetDepth cannot both be undefined
            const textureHandle = this._renderTargets === undefined ? this._renderTargetDepth : this._renderTargets[0];
            if (this._textureManager.isBackbuffer(textureHandle)) {
                this._isBackBuffer = true;
                return undefined;
            }
            const textureDescription = this._textureManager.getTextureDescription(textureHandle);
            const creationOptionsForTexture = {
                textureCount: this._renderTargets?.length ?? 0,
                generateDepthBuffer: false,
                label: this.name,
                samples: textureDescription.options.samples ?? 1,
                dontCreateTextures: true,
            };
            this._renderTargetWrapper = engine.createMultipleRenderTarget(textureDescription.size, creationOptionsForTexture, true);
            for (let i = 0; i < creationOptionsForTexture.textureCount; i++) {
                const handle = this._renderTargets[i];
                const texture = this._textureManager.getTextureFromHandle(handle);
                if (!texture) {
                    throw new Error(`FrameGraphRenderTarget.renderTargetWrapper: Failed to get texture from handle. handle: ${handle}, name: ${this.name}, index: ${i}, renderTargets: ${this._renderTargets}`);
                }
                this._renderTargetWrapper.setTexture(texture, i, false);
            }
            if (this._renderTargetDepth !== undefined) {
                this._renderTargetWrapper.setDepthStencilTexture(this._textureManager.getTextureFromHandle(this._renderTargetDepth), false);
            }
        }
        return this._renderTargetWrapper;
    }
    equals(other) {
        const src = this._renderTargets;
        const dst = other._renderTargets;
        if (src !== undefined && dst !== undefined) {
            if (src.length !== dst.length) {
                return false;
            }
            for (let i = 0; i < src.length; i++) {
                if (src[i] !== dst[i]) {
                    return false;
                }
            }
        }
        else if ((src === undefined && dst !== undefined) || (src !== undefined && dst === undefined)) {
            return false;
        }
        return this._renderTargetDepth === other._renderTargetDepth;
    }
}
//# sourceMappingURL=frameGraphRenderTarget.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/frameGraphTextureManager.js






var FrameGraphTextureNamespace;
(function (FrameGraphTextureNamespace) {
    FrameGraphTextureNamespace[FrameGraphTextureNamespace["Task"] = 0] = "Task";
    FrameGraphTextureNamespace[FrameGraphTextureNamespace["Graph"] = 1] = "Graph";
    FrameGraphTextureNamespace[FrameGraphTextureNamespace["External"] = 2] = "External";
})(FrameGraphTextureNamespace || (FrameGraphTextureNamespace = {}));
/**
 * Manages the textures used by a frame graph
 * @experimental
 */
class FrameGraphTextureManager {
    /**
     * Constructs a new instance of the texture manager
     * @param engine The engine to use
     * @param _debugTextures If true, debug textures will be created so that they are visible in the inspector
     * @param _scene The scene the manager belongs to
     */
    constructor(engine, _debugTextures = false, _scene) {
        this.engine = engine;
        this._debugTextures = _debugTextures;
        this._scene = _scene;
        /** @internal */
        this._textures = new Map();
        /** @internal */
        this._historyTextures = new Map();
        /** @internal */
        this._isRecordingTask = false;
        this._addSystemTextures();
    }
    /**
     * Checks if a handle is a backbuffer handle (color or depth/stencil)
     * @param handle The handle to check
     * @returns True if the handle is a backbuffer handle
     */
    isBackbuffer(handle) {
        if (handle === backbufferColorTextureHandle || handle === backbufferDepthStencilTextureHandle) {
            return true;
        }
        const textureEntry = this._textures.get(handle);
        if (!textureEntry) {
            return false;
        }
        return textureEntry.refHandle === backbufferColorTextureHandle || textureEntry.refHandle === backbufferDepthStencilTextureHandle;
    }
    /**
     * Checks if a handle is a backbuffer color handle
     * @param handle The handle to check
     * @returns True if the handle is a backbuffer color handle
     */
    isBackbufferColor(handle) {
        if (handle === backbufferColorTextureHandle) {
            return true;
        }
        const textureEntry = this._textures.get(handle);
        if (!textureEntry) {
            return false;
        }
        return textureEntry.refHandle === backbufferColorTextureHandle;
    }
    /**
     * Checks if a handle is a backbuffer depth/stencil handle
     * @param handle The handle to check
     * @returns True if the handle is a backbuffer depth/stencil handle
     */
    isBackbufferDepthStencil(handle) {
        if (handle === backbufferDepthStencilTextureHandle) {
            return true;
        }
        const textureEntry = this._textures.get(handle);
        if (!textureEntry) {
            return false;
        }
        return textureEntry.refHandle === backbufferDepthStencilTextureHandle;
    }
    /**
     * Checks if a handle is a history texture (or points to a history texture, for a dangling handle)
     * @param handle The handle to check
     * @returns True if the handle is a history texture, otherwise false
     */
    isHistoryTexture(handle) {
        const entry = this._textures.get(handle);
        if (!entry) {
            return false;
        }
        handle = entry.refHandle ?? handle;
        return this._historyTextures.has(handle);
    }
    /**
     * Gets the creation options of a texture
     * @param handle Handle of the texture
     * @returns The creation options of the texture
     */
    getTextureCreationOptions(handle) {
        const entry = this._textures.get(handle);
        const creationOptions = entry.creationOptions;
        return {
            size: textureSizeIsObject(creationOptions.size) ? { ...creationOptions.size } : creationOptions.size,
            sizeIsPercentage: creationOptions.sizeIsPercentage,
            options: this._cloneTextureOptions(creationOptions.options, entry.textureIndex),
            isHistoryTexture: creationOptions.isHistoryTexture,
        };
    }
    /**
     * Gets the description of a texture
     * @param handle Handle of the texture
     * @returns The description of the texture
     */
    getTextureDescription(handle) {
        const creationOptions = this.getTextureCreationOptions(handle);
        const size = !creationOptions.sizeIsPercentage
            ? textureSizeIsObject(creationOptions.size)
                ? creationOptions.size
                : { width: creationOptions.size, height: creationOptions.size }
            : this.getAbsoluteDimensions(creationOptions.size);
        return {
            size,
            options: creationOptions.options,
        };
    }
    /**
     * Gets a texture handle or creates a new texture if the handle is not provided.
     * If handle is not provided, newTextureName and creationOptions must be provided.
     * @param handle If provided, will simply return the handle
     * @param newTextureName Name of the new texture to create
     * @param creationOptions Options to use when creating the new texture
     * @returns The handle to the texture.
     */
    getTextureHandleOrCreateTexture(handle, newTextureName, creationOptions) {
        if (handle === undefined) {
            if (newTextureName === undefined || creationOptions === undefined) {
                throw new Error("getTextureHandleOrCreateTexture: Either handle or newTextureName and creationOptions must be provided.");
            }
            return this.createRenderTargetTexture(newTextureName, creationOptions);
        }
        return handle;
    }
    /**
     * Gets a texture from a handle.
     * Note that if the texture is a history texture, the read texture for the current frame will be returned.
     * @param handle The handle of the texture
     * @returns The texture or null if not found
     */
    getTextureFromHandle(handle) {
        const historyEntry = this._historyTextures.get(handle);
        if (historyEntry) {
            return historyEntry.textures[historyEntry.index ^ 1]; // gets the read texture
        }
        return this._textures.get(handle).texture;
    }
    /**
     * Imports a texture into the texture manager
     * @param name Name of the texture
     * @param texture Texture to import
     * @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.
     * @returns The handle to the texture
     */
    importTexture(name, texture, handle) {
        if (handle !== undefined) {
            this._freeEntry(handle);
        }
        const creationOptions = {
            size: { width: texture.width, height: texture.height },
            sizeIsPercentage: false,
            isHistoryTexture: false,
            options: {
                createMipMaps: texture.generateMipMaps,
                samples: texture.samples,
                types: [texture.type],
                formats: [texture.format],
                useSRGBBuffers: [texture._useSRGBBuffer],
                creationFlags: [texture._creationFlags],
                labels: texture.label ? [texture.label] : ["imported"],
            },
        };
        return this._createHandleForTexture(name, texture, creationOptions, FrameGraphTextureNamespace.External, handle);
    }
    /**
     * Creates a new render target texture
     * If multiple textures are described in FrameGraphTextureCreationOptions, the handle of the first texture is returned, handle+1 is the handle of the second texture, etc.
     * @param name Name of the texture
     * @param creationOptions Options to use when creating the texture
     * @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.
     * @returns The handle to the texture
     */
    createRenderTargetTexture(name, creationOptions, handle) {
        return this._createHandleForTexture(name, null, {
            size: textureSizeIsObject(creationOptions.size) ? { ...creationOptions.size } : creationOptions.size,
            sizeIsPercentage: creationOptions.sizeIsPercentage,
            isHistoryTexture: creationOptions.isHistoryTexture,
            options: this._cloneTextureOptions(creationOptions.options),
        }, this._isRecordingTask ? FrameGraphTextureNamespace.Task : FrameGraphTextureNamespace.Graph, handle);
    }
    /**
     * Creates a (frame graph) render target wrapper
     * Note that renderTargets or renderTargetDepth can be undefined, but not both at the same time!
     * @param name Name of the render target wrapper
     * @param renderTargets Render target handles (textures) to use
     * @param renderTargetDepth Render target depth handle (texture) to use
     * @returns The created render target wrapper
     */
    createRenderTarget(name, renderTargets, renderTargetDepth) {
        const renderTarget = new FrameGraphRenderTarget(name, this, renderTargets, renderTargetDepth);
        const rtw = renderTarget.renderTargetWrapper;
        if (rtw !== undefined && renderTargets) {
            const handles = Array.isArray(renderTargets) ? renderTargets : [renderTargets];
            for (let i = 0; i < handles.length; i++) {
                let handle = handles[i];
                handle = this._textures.get(handle)?.refHandle ?? handle;
                const historyEntry = this._historyTextures.get(handle);
                if (historyEntry) {
                    historyEntry.references.push({ renderTargetWrapper: rtw, textureIndex: i });
                    rtw.setTexture(historyEntry.textures[historyEntry.index], i, false);
                }
            }
        }
        return renderTarget;
    }
    /**
     * Creates a handle which is not associated with any texture.
     * Call resolveDanglingHandle to associate the handle with a valid texture handle.
     * @returns The dangling handle
     */
    createDanglingHandle() {
        return FrameGraphTextureManager._Counter++;
    }
    /**
     * Associates a texture with a dangling handle
     * @param danglingHandle The dangling handle
     * @param handle The handle to associate with the dangling handle (if not provided, a new texture handle will be created, using the newTextureName and creationOptions parameters)
     * @param newTextureName The name of the new texture to create (if handle is not provided)
     * @param creationOptions The options to use when creating the new texture (if handle is not provided)
     */
    resolveDanglingHandle(danglingHandle, handle, newTextureName, creationOptions) {
        if (handle === undefined) {
            if (newTextureName === undefined || creationOptions === undefined) {
                throw new Error("resolveDanglingHandle: Either handle or newTextureName and creationOptions must be provided.");
            }
            this.createRenderTargetTexture(newTextureName, creationOptions, danglingHandle);
            return;
        }
        const textureEntry = this._textures.get(handle);
        if (textureEntry === undefined) {
            throw new Error(`resolveDanglingHandle: Handle ${handle} does not exist!`);
        }
        this._textures.set(danglingHandle, {
            texture: textureEntry.texture,
            refHandle: handle,
            name: textureEntry.name,
            creationOptions: {
                size: { ...textureEntry.creationOptions.size },
                options: this._cloneTextureOptions(textureEntry.creationOptions.options),
                sizeIsPercentage: textureEntry.creationOptions.sizeIsPercentage,
                isHistoryTexture: false,
            },
            namespace: textureEntry.namespace,
            textureIndex: textureEntry.textureIndex,
        });
    }
    /**
     * Gets the absolute dimensions of a texture.
     * @param size The size of the texture. Width and height must be expressed as a percentage of the screen size (100=100%)!
     * @param screenWidth The width of the screen (default: the width of the rendering canvas)
     * @param screenHeight The height of the screen (default: the height of the rendering canvas)
     * @returns The absolute dimensions of the texture
     */
    getAbsoluteDimensions(size, screenWidth = this.engine.getRenderWidth(true), screenHeight = this.engine.getRenderHeight(true)) {
        const { width, height } = getDimensionsFromTextureSize(size);
        return {
            width: Math.floor((width * screenWidth) / 100),
            height: Math.floor((height * screenHeight) / 100),
        };
    }
    /** @internal */
    _dispose() {
        this._releaseTextures();
    }
    /** @internal */
    _allocateTextures() {
        this._textures.forEach((entry) => {
            if (!entry.texture) {
                if (entry.refHandle !== undefined) {
                    // entry is a dangling handle which has been resolved to point to refHandle
                    // We simply update the texture to point to the refHandle texture
                    const refEntry = this._textures.get(entry.refHandle);
                    entry.texture = refEntry.texture;
                    if (refEntry.refHandle === backbufferColorTextureHandle) {
                        entry.refHandle = backbufferColorTextureHandle;
                    }
                    if (refEntry.refHandle === backbufferDepthStencilTextureHandle) {
                        entry.refHandle = backbufferDepthStencilTextureHandle;
                    }
                }
                else if (entry.namespace !== FrameGraphTextureNamespace.External) {
                    const creationOptions = entry.creationOptions;
                    const size = creationOptions.sizeIsPercentage ? this.getAbsoluteDimensions(creationOptions.size) : creationOptions.size;
                    const textureIndex = entry.textureIndex || 0;
                    const internalTextureCreationOptions = {
                        createMipMaps: creationOptions.options.createMipMaps,
                        samples: creationOptions.options.samples,
                        type: creationOptions.options.types?.[textureIndex],
                        format: creationOptions.options.formats?.[textureIndex],
                        useSRGBBuffer: creationOptions.options.useSRGBBuffers?.[textureIndex],
                        creationFlags: creationOptions.options.creationFlags?.[textureIndex],
                        label: creationOptions.options.labels?.[textureIndex] ?? `${entry.name}${textureIndex > 0 ? "#" + textureIndex : ""}`,
                        samplingMode: 1,
                        createMSAATexture: creationOptions.options.samples > 1,
                    };
                    const isDepthTexture = (0,Textures_internalTexture/* IsDepthTexture */.vl)(internalTextureCreationOptions.format);
                    const hasStencil = (0,Textures_internalTexture/* HasStencilAspect */.$l)(internalTextureCreationOptions.format);
                    const source = isDepthTexture && hasStencil
                        ? 12 /* InternalTextureSource.DepthStencil */
                        : isDepthTexture || hasStencil
                            ? 14 /* InternalTextureSource.Depth */
                            : 5 /* InternalTextureSource.RenderTarget */;
                    const internalTexture = this.engine._createInternalTexture(size, internalTextureCreationOptions, false, source);
                    if (isDepthTexture) {
                        internalTexture.type = (0,Textures_internalTexture/* GetTypeForDepthTexture */.GX)(internalTexture.format);
                    }
                    entry.texture = internalTexture;
                }
            }
            if (entry.texture && entry.refHandle === undefined) {
                entry.debug?.dispose();
                entry.debug = this._createDebugTexture(entry.name, entry.texture);
            }
        });
        this._historyTextures.forEach((entry) => {
            for (let i = 0; i < entry.handles.length; i++) {
                entry.textures[i] = this._textures.get(entry.handles[i]).texture;
            }
        });
    }
    /** @internal */
    _releaseTextures(releaseAll = true) {
        this._textures.forEach((entry, handle) => {
            if (releaseAll || entry.namespace !== FrameGraphTextureNamespace.External) {
                entry.debug?.dispose();
                entry.debug = undefined;
            }
            if (entry.namespace === FrameGraphTextureNamespace.External) {
                return;
            }
            entry.texture?.dispose();
            entry.texture = null;
            if (releaseAll || entry.namespace === FrameGraphTextureNamespace.Task) {
                this._textures.delete(handle);
            }
        });
        this._historyTextures.forEach((entry) => {
            for (let i = 0; i < entry.handles.length; i++) {
                entry.textures[i] = null;
            }
        });
        if (releaseAll) {
            this._textures.clear();
            this._historyTextures.clear();
            this._addSystemTextures();
        }
    }
    /** @internal */
    _updateHistoryTextures() {
        this._historyTextures.forEach((entry) => {
            entry.index = entry.index ^ 1;
            const currentTexture = entry.textures[entry.index];
            if (currentTexture) {
                for (const { renderTargetWrapper, textureIndex } of entry.references) {
                    renderTargetWrapper.setTexture(currentTexture, textureIndex, false);
                }
            }
        });
    }
    _addSystemTextures() {
        const size = { width: this.engine.getRenderWidth(true), height: this.engine.getRenderHeight(true) };
        this._textures.set(backbufferColorTextureHandle, {
            name: "backbuffer color",
            texture: null,
            creationOptions: {
                size,
                options: {
                    createMipMaps: false,
                    samples: this.engine.getCreationOptions().antialias ? 4 : 1,
                    types: [0], // todo? get from engine
                    formats: [5], // todo? get from engine
                    useSRGBBuffers: [false],
                    creationFlags: [0],
                    labels: ["backbuffer color"],
                },
                sizeIsPercentage: false,
            },
            namespace: FrameGraphTextureNamespace.External,
        });
        this._textures.set(backbufferDepthStencilTextureHandle, {
            name: "backbuffer depth/stencil",
            texture: null,
            creationOptions: {
                size,
                options: {
                    createMipMaps: false,
                    samples: this.engine.getCreationOptions().antialias ? 4 : 1,
                    types: [0], // todo? get from engine
                    formats: [16], // todo? get from engine
                    useSRGBBuffers: [false],
                    creationFlags: [0],
                    labels: ["backbuffer depth/stencil"],
                },
                sizeIsPercentage: false,
            },
            namespace: FrameGraphTextureNamespace.External,
        });
    }
    _createDebugTexture(name, texture) {
        if (!this._debugTextures) {
            return;
        }
        const textureDebug = new Textures_texture/* Texture */.g(null, this._scene);
        textureDebug.name = name;
        textureDebug._texture = texture;
        textureDebug._texture.incrementReferences();
        return textureDebug;
    }
    _freeEntry(handle) {
        const entry = this._textures.get(handle);
        if (entry) {
            entry.debug?.dispose();
            this._textures.delete(handle);
        }
    }
    _createHandleForTexture(name, texture, creationOptions, namespace, handle, textureIndex) {
        handle = handle ?? FrameGraphTextureManager._Counter++;
        textureIndex = textureIndex || 0;
        const textureName = creationOptions.isHistoryTexture ? `${name} ping` : name;
        const label = creationOptions.options.labels?.[textureIndex] ?? "";
        const textureEntry = {
            texture,
            name: `${textureName}${label ? " " + label : ""}`,
            creationOptions: {
                size: textureSizeIsObject(creationOptions.size) ? creationOptions.size : { width: creationOptions.size, height: creationOptions.size },
                options: creationOptions.options,
                sizeIsPercentage: creationOptions.sizeIsPercentage,
                isHistoryTexture: creationOptions.isHistoryTexture,
            },
            namespace,
            textureIndex,
        };
        this._textures.set(handle, textureEntry);
        if (namespace === FrameGraphTextureNamespace.External) {
            return handle;
        }
        if (creationOptions.isHistoryTexture) {
            const pongCreationOptions = {
                size: { ...textureEntry.creationOptions.size },
                options: { ...textureEntry.creationOptions.options },
                sizeIsPercentage: textureEntry.creationOptions.sizeIsPercentage,
                isHistoryTexture: false,
            };
            const pongTexture = this._createHandleForTexture(`${name} pong`, null, pongCreationOptions, namespace);
            this._historyTextures.set(handle, { textures: [null, null], handles: [handle, pongTexture], index: 0, references: [] });
            return handle;
        }
        if (creationOptions.options.types && creationOptions.options.types.length > 1 && textureIndex === 0) {
            const textureCount = creationOptions.options.types.length;
            const creationOptionsForTexture = {
                size: textureSizeIsObject(creationOptions.size) ? creationOptions.size : { width: creationOptions.size, height: creationOptions.size },
                options: creationOptions.options,
                sizeIsPercentage: creationOptions.sizeIsPercentage,
            };
            for (let i = 1; i < textureCount; i++) {
                this._createHandleForTexture(textureName, null, creationOptionsForTexture, namespace, handle + i, i);
            }
            FrameGraphTextureManager._Counter += textureCount - 1;
        }
        return handle;
    }
    _cloneTextureOptions(options, textureIndex) {
        return textureIndex !== undefined
            ? {
                createMipMaps: options.createMipMaps,
                samples: options.samples,
                types: options.types ? [options.types[textureIndex]] : undefined,
                formats: options.formats ? [options.formats[textureIndex]] : undefined,
                useSRGBBuffers: options.useSRGBBuffers ? [options.useSRGBBuffers[textureIndex]] : undefined,
                creationFlags: options.creationFlags ? [options.creationFlags[textureIndex]] : undefined,
                labels: options.labels ? [options.labels[textureIndex]] : undefined,
            }
            : {
                createMipMaps: options.createMipMaps,
                samples: options.samples,
                types: options.types ? [...options.types] : undefined,
                formats: options.formats ? [...options.formats] : undefined,
                useSRGBBuffers: options.useSRGBBuffers ? [...options.useSRGBBuffers] : undefined,
                creationFlags: options.creationFlags ? [...options.creationFlags] : undefined,
                labels: options.labels ? [...options.labels] : undefined,
            };
    }
}
FrameGraphTextureManager._Counter = 2; // 0 and 1 are reserved for backbuffer textures
//# sourceMappingURL=frameGraphTextureManager.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/frameGraph.js







var FrameGraphPassType;
(function (FrameGraphPassType) {
    FrameGraphPassType[FrameGraphPassType["Render"] = 0] = "Render";
    FrameGraphPassType[FrameGraphPassType["Cull"] = 1] = "Cull";
    FrameGraphPassType[FrameGraphPassType["Compute"] = 2] = "Compute";
})(FrameGraphPassType || (FrameGraphPassType = {}));
/**
 * Class used to implement a frame graph
 * @experimental
 */
class FrameGraph {
    /**
     * Gets the engine used by the frame graph
     */
    get engine() {
        return this._engine;
    }
    /**
     * Constructs the frame graph
     * @param engine defines the hosting engine
     * @param debugTextures defines a boolean indicating that textures created by the frame graph should be visible in the inspector
     * @param scene defines the scene the frame graph is associated with
     */
    constructor(engine, debugTextures = false, scene) {
        this._tasks = [];
        this._currentProcessedTask = null;
        /**
         * Observable raised when the node render graph is built
         */
        this.onBuildObservable = new Misc_observable/* Observable */.cP();
        this._engine = engine;
        this.textureManager = new FrameGraphTextureManager(this._engine, debugTextures, scene);
        this._passContext = new FrameGraphContext();
        this._renderContext = new FrameGraphRenderContext(this._engine, this.textureManager, scene);
    }
    /**
     * Gets a task by name
     * @param name Name of the task to get
     * @returns The task or undefined if not found
     */
    getTaskByName(name) {
        return this._tasks.find((t) => t.name === name);
    }
    /**
     * Adds a task to the frame graph
     * @param task Task to add
     */
    addTask(task) {
        if (this._currentProcessedTask !== null) {
            throw new Error(`FrameGraph.addTask: Can't add the task "${task.name}" while another task is currently building (task: ${this._currentProcessedTask.name}).`);
        }
        this._tasks.push(task);
    }
    /**
     * Adds a render pass to a task. This method can only be called during a Task.record execution.
     * @param name The name of the pass
     * @param whenTaskDisabled If true, the pass will be added to the list of passes to execute when the task is disabled (default is false)
     * @returns The render pass created
     */
    addRenderPass(name, whenTaskDisabled = false) {
        return this._addPass(name, FrameGraphPassType.Render, whenTaskDisabled);
    }
    /**
     * Adds a cull pass to a task. This method can only be called during a Task.record execution.
     * @param name The name of the pass
     * @param whenTaskDisabled If true, the pass will be added to the list of passes to execute when the task is disabled (default is false)
     * @returns The cull pass created
     */
    addCullPass(name, whenTaskDisabled = false) {
        return this._addPass(name, FrameGraphPassType.Cull, whenTaskDisabled);
    }
    _addPass(name, passType, whenTaskDisabled = false) {
        if (!this._currentProcessedTask) {
            throw new Error("FrameGraph: A pass must be created during a Task.record execution only.");
        }
        let pass;
        switch (passType) {
            case FrameGraphPassType.Render:
                pass = new renderPass/* FrameGraphRenderPass */.p(name, this._currentProcessedTask, this._renderContext, this._engine);
                break;
            case FrameGraphPassType.Cull:
                pass = new cullPass/* FrameGraphCullPass */.x(name, this._currentProcessedTask, this._passContext, this._engine);
                break;
            default:
                pass = new Passes_pass/* FrameGraphPass */.X(name, this._currentProcessedTask, this._passContext);
                break;
        }
        this._currentProcessedTask._addPass(pass, whenTaskDisabled);
        return pass;
    }
    /**
     * Builds the frame graph.
     * This method should be called after all tasks have been added to the frame graph (FrameGraph.addTask) and before the graph is executed (FrameGraph.execute).
     */
    build() {
        this.textureManager._releaseTextures(false);
        for (const task of this._tasks) {
            task._reset();
            this._currentProcessedTask = task;
            this.textureManager._isRecordingTask = true;
            task.record();
            this.textureManager._isRecordingTask = false;
            this._currentProcessedTask = null;
        }
        this.textureManager._allocateTextures();
        for (const task of this._tasks) {
            task._checkTask();
        }
        this.onBuildObservable.notifyObservers(this);
    }
    /**
     * Returns a promise that resolves when the frame graph is ready to be executed
     * This method must be called after the graph has been built (FrameGraph.build called)!
     * @param timeout Timeout in ms between retries (default is 16)
     * @returns The promise that resolves when the graph is ready
     */
    whenReadyAsync(timeout = 16) {
        return new Promise((resolve) => {
            const checkReady = () => {
                let ready = this._renderContext._isReady();
                for (const task of this._tasks) {
                    ready = task.isReady() && ready;
                }
                if (ready) {
                    resolve();
                }
                else {
                    setTimeout(checkReady, timeout);
                }
            };
            checkReady();
        });
    }
    /**
     * Executes the frame graph.
     */
    execute() {
        this._renderContext.bindRenderTarget();
        this.textureManager._updateHistoryTextures();
        for (const task of this._tasks) {
            const passes = task._getPasses();
            for (const pass of passes) {
                pass._execute();
            }
        }
    }
    /**
     * Clears the frame graph (remove the tasks and release the textures).
     * The frame graph can be built again after this method is called.
     */
    clear() {
        for (const task of this._tasks) {
            task._reset();
        }
        this._tasks.length = 0;
        this.textureManager._releaseTextures();
        this._currentProcessedTask = null;
    }
    /**
     * Disposes the frame graph
     */
    dispose() {
        this.clear();
        this.textureManager._dispose();
        this._renderContext._dispose();
    }
}
//# sourceMappingURL=frameGraph.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/webRequest.js
var webRequest = __webpack_require__(62366);
;// ./node_modules/@babylonjs/core/Decorators/nodeDecorator.js
/**
 * Enum defining the type of properties that can be edited in the property pages in the node editor
 */
var PropertyTypeForEdition;
(function (PropertyTypeForEdition) {
    /** property is a boolean */
    PropertyTypeForEdition[PropertyTypeForEdition["Boolean"] = 0] = "Boolean";
    /** property is a float */
    PropertyTypeForEdition[PropertyTypeForEdition["Float"] = 1] = "Float";
    /** property is a int */
    PropertyTypeForEdition[PropertyTypeForEdition["Int"] = 2] = "Int";
    /** property is a Vector2 */
    PropertyTypeForEdition[PropertyTypeForEdition["Vector2"] = 3] = "Vector2";
    /** property is a list of values */
    PropertyTypeForEdition[PropertyTypeForEdition["List"] = 4] = "List";
    /** property is a Color4 */
    PropertyTypeForEdition[PropertyTypeForEdition["Color4"] = 5] = "Color4";
    /** property (int) should be edited as a combo box with a list of sampling modes */
    PropertyTypeForEdition[PropertyTypeForEdition["SamplingMode"] = 6] = "SamplingMode";
    /** property (int) should be edited as a combo box with a list of texture formats */
    PropertyTypeForEdition[PropertyTypeForEdition["TextureFormat"] = 7] = "TextureFormat";
    /** property (int) should be edited as a combo box with a list of texture types */
    PropertyTypeForEdition[PropertyTypeForEdition["TextureType"] = 8] = "TextureType";
})(PropertyTypeForEdition || (PropertyTypeForEdition = {}));
/**
 * Decorator that flags a property in a node block as being editable
 * @param displayName the display name of the property
 * @param propertyType the type of the property
 * @param groupName the group name of the property
 * @param options the options of the property
 * @returns the decorator
 */
function editableInPropertyPage(displayName, propertyType = 0 /* PropertyTypeForEdition.Boolean */, groupName = "PROPERTIES", options) {
    return (target, propertyKey) => {
        let propStore = target._propStore;
        if (!propStore) {
            propStore = [];
            target._propStore = propStore;
        }
        propStore.push({
            propertyName: propertyKey,
            displayName: displayName,
            type: propertyType,
            groupName: groupName,
            options: options ?? {},
            className: target.constructor.name,
        });
    };
}
//# sourceMappingURL=nodeDecorator.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/inputBlock.js








/**
 * Block used to expose an input value
 */
class NodeRenderGraphInputBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets or sets the connection point type (default is Undefined)
     */
    get type() {
        return this._type;
    }
    /**
     * Creates a new NodeRenderGraphInputBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     * @param type defines the type of the input (can be set to NodeRenderGraphBlockConnectionPointTypes.Undefined)
     */
    constructor(name, frameGraph, scene, type = nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Undefined) {
        super(name, frameGraph, scene);
        this._storedValue = null;
        this._type = nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Undefined;
        /** Gets an observable raised when the value is changed */
        this.onValueChangedObservable = new Misc_observable/* Observable */.cP();
        /** Indicates that the input is externally managed */
        this.isExternal = false;
        this._type = type;
        this._isInput = true;
        this.registerOutput("output", type);
        this.setDefaultValue();
    }
    /**
     * Set the input block to its default value (based on its type)
     */
    setDefaultValue() {
        switch (this.type) {
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureViewDepth:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureScreenDepth:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureViewNormal:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureWorldNormal:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAlbedo:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureReflectivity:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureLocalPosition:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureWorldPosition:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureVelocity:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureLinearVelocity:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureIrradiance:
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAlbedoSqrt: {
                const options = {
                    size: { width: 100, height: 100 },
                    options: {
                        createMipMaps: false,
                        types: [0],
                        formats: [5],
                        samples: 1,
                        useSRGBBuffers: [false],
                    },
                    sizeIsPercentage: true,
                };
                this.creationOptions = options;
                break;
            }
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureDepthStencilAttachment: {
                const options = {
                    size: { width: 100, height: 100 },
                    options: {
                        createMipMaps: false,
                        types: [0],
                        formats: [13],
                        useSRGBBuffers: [false],
                        labels: [this.name],
                        samples: 1,
                    },
                    sizeIsPercentage: true,
                };
                this.creationOptions = options;
                break;
            }
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.ObjectList:
                this.value = { meshes: [], particleSystems: [] };
                this.isExternal = true;
                break;
            case nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Camera:
                this.value = this._scene.cameras[0];
                this.isExternal = true;
                break;
            default:
                this.isExternal = true;
        }
    }
    /**
     * Gets or sets the value of that point.
     */
    get value() {
        return this._storedValue;
    }
    set value(value) {
        this._storedValue = value;
        this.output.value = undefined;
        this.onValueChangedObservable.notifyObservers(this);
    }
    /**
     * Gets the value as a specific type
     * @returns the value as a specific type
     */
    getTypedValue() {
        return this._storedValue;
    }
    /**
     * Gets the value as an internal texture
     * @returns The internal texture stored in value if value is an internal texture, otherwise null
     */
    getInternalTextureFromValue() {
        if (this._storedValue._swapAndDie) {
            return this._storedValue;
        }
        return null;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphInputBlock";
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Check if the block is a texture of any type
     * @returns true if the block is a texture
     */
    isAnyTexture() {
        return (this.type & nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll) !== 0;
    }
    /**
     * Gets a boolean indicating that the connection point is the back buffer texture
     * @returns true if the connection point is the back buffer texture
     */
    isBackBuffer() {
        return (this.type & nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureBackBuffer) !== 0;
    }
    /**
     * Gets a boolean indicating that the connection point is a depth/stencil attachment texture
     * @returns true if the connection point is a depth/stencil attachment texture
     */
    isBackBufferDepthStencilAttachment() {
        return (this.type & nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureBackBufferDepthStencilAttachment) !== 0;
    }
    /**
     * Check if the block is a camera
     * @returns true if the block is a camera
     */
    isCamera() {
        return (this.type & nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Camera) !== 0;
    }
    /**
     * Check if the block is an object list
     * @returns true if the block is an object list
     */
    isObjectList() {
        return (this.type & nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.ObjectList) !== 0;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (this.isExternal) {
            if (this.isBackBuffer()) {
                this.output.value = backbufferColorTextureHandle;
            }
            else if (this.isBackBufferDepthStencilAttachment()) {
                this.output.value = backbufferDepthStencilTextureHandle;
            }
            else if (this.isCamera()) {
                this.output.value = this.getTypedValue();
            }
            else if (this.isObjectList()) {
                this.output.value = this.getTypedValue();
            }
            else {
                if (this._storedValue === undefined || this._storedValue === null) {
                    throw new Error(`NodeRenderGraphInputBlock: External input "${this.name}" is not set`);
                }
                const texture = this.getInternalTextureFromValue();
                if (texture) {
                    this.output.value = this._frameGraph.textureManager.importTexture(this.name, texture, this.output.value);
                }
            }
            return;
        }
        if ((this.type & nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer) !== 0) {
            const textureCreateOptions = this.creationOptions;
            if (!textureCreateOptions) {
                throw new Error(`NodeRenderGraphInputBlock: Creation options are missing for texture "${this.name}"`);
            }
            this.output.value = this._frameGraph.textureManager.createRenderTargetTexture(this.name, textureCreateOptions);
        }
    }
    dispose() {
        this._storedValue = null;
        this.onValueChangedObservable.clear();
        super.dispose();
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.isExternal = ${this.isExternal};`);
        if (this.isAnyTexture()) {
            if (!this.isExternal) {
                codes.push(`${this._codeVariableName}.creationOptions = ${JSON.stringify(this.creationOptions)};`);
            }
            else {
                codes.push(`${this._codeVariableName}.value = EXTERNAL_TEXTURE; // TODO: set the external texture`);
            }
        }
        else if (this.isCamera()) {
            codes.push(`${this._codeVariableName}.value = EXTERNAL_CAMERA; // TODO: set the external camera`);
        }
        else if (this.isObjectList()) {
            codes.push(`${this._codeVariableName}.value = EXTERNAL_OBJECT_LIST; // TODO: set the external object list`);
        }
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.type = this.type;
        serializationObject.isExternal = this.isExternal;
        if (this.creationOptions) {
            serializationObject.creationOptions = this.creationOptions;
        }
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this._type = serializationObject.type;
        this.output.type = this._type;
        this.isExternal = serializationObject.isExternal;
        if (serializationObject.creationOptions) {
            if (serializationObject.creationOptions.options.depthTextureFormat !== undefined) {
                // Backward compatibility - remove this code in the future
                serializationObject.creationOptions.options.formats = [serializationObject.creationOptions.options.depthTextureFormat];
            }
            this.creationOptions = serializationObject.creationOptions;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Is external", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphInputBlock.prototype, "isExternal", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphInputBlock", NodeRenderGraphInputBlock);
//# sourceMappingURL=inputBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/Texture/clearTextureTask.js


/**
 * Task used to clear a texture.
 */
class FrameGraphClearTextureTask extends frameGraphTask/* FrameGraphTask */.L {
    /**
     * Constructs a new clear task.
     * @param name The name of the task.
     * @param frameGraph The frame graph the task belongs to.
     */
    constructor(name, frameGraph) {
        super(name, frameGraph);
        /**
         * The color to clear the texture with.
         */
        this.color = new math_color/* Color4 */.ov(0.2, 0.2, 0.3, 1);
        /**
         * If the color should be cleared.
         */
        this.clearColor = true;
        /**
         * If the depth should be cleared.
         */
        this.clearDepth = false;
        /**
         * If the stencil should be cleared.
         */
        this.clearStencil = false;
        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
    }
    record() {
        if (this.destinationTexture === undefined && this.depthTexture === undefined) {
            throw new Error(`FrameGraphClearTextureTask ${this.name}: destinationTexture and depthTexture can't both be undefined.`);
        }
        if (this.destinationTexture !== undefined) {
            this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
        }
        if (this.depthTexture !== undefined) {
            this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);
        }
        const pass = this._frameGraph.addRenderPass(this.name);
        pass.setRenderTarget(this.destinationTexture);
        pass.setRenderTargetDepth(this.depthTexture);
        pass.setExecuteFunc((context) => {
            context.clear(this.color, !!this.clearColor, !!this.clearDepth, !!this.clearStencil);
        });
        const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
        passDisabled.setRenderTarget(this.destinationTexture);
        passDisabled.setRenderTargetDepth(this.depthTexture);
        passDisabled.setExecuteFunc((_context) => { });
    }
}
//# sourceMappingURL=clearTextureTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Textures/clearBlock.js







/**
 * Block used to clear a texture
 */
class NodeRenderGraphClearBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphClearBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("texture", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture, true);
        this.registerInput("depth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureBackBufferDepthStencilAttachment, true);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.registerOutput("outputDepth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.texture.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll);
        this.depth.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureDepthStencilAttachment);
        this.output._typeConnectionSource = this.texture;
        this.outputDepth._typeConnectionSource = this.depth;
        this._frameGraphTask = new FrameGraphClearTextureTask(name, frameGraph);
    }
    /** Gets or sets the clear color */
    get color() {
        return this._frameGraphTask.color;
    }
    set color(value) {
        this._frameGraphTask.color = value;
    }
    /** Gets or sets a boolean indicating whether the color part of the texture should be cleared. */
    get clearColor() {
        return !!this._frameGraphTask.clearColor;
    }
    set clearColor(value) {
        this._frameGraphTask.clearColor = value;
    }
    /** Gets or sets a boolean indicating whether the depth part of the texture should be cleared. */
    get clearDepth() {
        return !!this._frameGraphTask.clearDepth;
    }
    set clearDepth(value) {
        this._frameGraphTask.clearDepth = value;
    }
    /** Gets or sets a boolean indicating whether the stencil part of the texture should be cleared. */
    get clearStencil() {
        return !!this._frameGraphTask.clearStencil;
    }
    set clearStencil(value) {
        this._frameGraphTask.clearStencil = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphClearBlock";
    }
    /**
     * Gets the texture input component
     */
    get texture() {
        return this._inputs[0];
    }
    /**
     * Gets the depth texture input component
     */
    get depth() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the output depth component
     */
    get outputDepth() {
        return this._outputs[1];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this._propagateInputValueToOutput(this.texture, this.output);
        this._propagateInputValueToOutput(this.depth, this.outputDepth);
        const textureConnectedPoint = this.texture.connectedPoint;
        if (textureConnectedPoint) {
            this._frameGraphTask.destinationTexture = textureConnectedPoint.value;
        }
        const depthConnectedPoint = this.depth.connectedPoint;
        if (depthConnectedPoint) {
            this._frameGraphTask.depthTexture = depthConnectedPoint.value;
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.color = new BABYLON.Color4(${this.color.r}, ${this.color.g}, ${this.color.b}, ${this.color.a});`);
        codes.push(`${this._codeVariableName}.clearColor = ${this.clearColor};`);
        codes.push(`${this._codeVariableName}.clearDepth = ${this.clearDepth};`);
        codes.push(`${this._codeVariableName}.clearStencil = ${this.clearStencil};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.color = this.color.asArray();
        serializationObject.clearColor = this.clearColor;
        serializationObject.clearDepth = this.clearDepth;
        serializationObject.clearStencil = this.clearStencil;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.color = math_color/* Color4 */.ov.FromArray(serializationObject.color);
        this.clearColor = serializationObject.clearColor;
        this.clearDepth = serializationObject.clearDepth;
        this.clearStencil = serializationObject.clearStencil;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Color", 5 /* PropertyTypeForEdition.Color4 */)
], NodeRenderGraphClearBlock.prototype, "color", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Clear color", 0 /* PropertyTypeForEdition.Boolean */, undefined, { embedded: true })
], NodeRenderGraphClearBlock.prototype, "clearColor", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Clear depth", 0 /* PropertyTypeForEdition.Boolean */, undefined, { embedded: true })
], NodeRenderGraphClearBlock.prototype, "clearDepth", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Clear stencil", 0 /* PropertyTypeForEdition.Boolean */, undefined, { embedded: true })
], NodeRenderGraphClearBlock.prototype, "clearStencil", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphClearBlock", NodeRenderGraphClearBlock);
//# sourceMappingURL=clearBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/nodeRenderGraphBuildState.js

/**
 * Class used to store node based render graph build state
 */
class NodeRenderGraphBuildState {
    constructor() {
        /** Gets or sets a boolean indicating that verbose mode is on */
        this.verbose = false;
        /**
         * Gets or sets the list of non connected mandatory inputs
         * @internal
         */
        this._notConnectedNonOptionalInputs = [];
    }
    /**
     * Emits console errors and exceptions if there is a failing check
     * @param errorObservable defines an Observable to send the error message
     * @returns true if all checks pass
     */
    emitErrors(errorObservable = null) {
        let errorMessage = "";
        for (const notConnectedInput of this._notConnectedNonOptionalInputs) {
            errorMessage += `input "${notConnectedInput.name}" from block "${notConnectedInput.ownerBlock.name}"[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\n`;
        }
        if (errorMessage) {
            if (errorObservable) {
                errorObservable.notifyObservers(errorMessage);
            }
            logger/* Logger */.V.Error("Build of node render graph failed:\n" + errorMessage);
            return false;
        }
        return true;
    }
}
//# sourceMappingURL=nodeRenderGraphBuildState.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/nodeRenderGraph.js















/**
 * Defines a node render graph
 */
class NodeRenderGraph {
    /** @returns the inspector from bundle or global */
    _getGlobalNodeRenderGraphEditor() {
        // UMD Global name detection from Webpack Bundle UMD Name.
        if (typeof NODERENDERGRAPHEDITOR !== "undefined") {
            return NODERENDERGRAPHEDITOR;
        }
        // In case of module let's check the global emitted from the editor entry point.
        if (typeof BABYLON !== "undefined" && typeof BABYLON.NodeRenderGraphEditor !== "undefined") {
            return BABYLON;
        }
        return undefined;
    }
    /**
     * Gets the frame graph used by this node render graph
     */
    get frameGraph() {
        return this._frameGraph;
    }
    /**
     * Gets the scene used by this node render graph
     * @returns the scene used by this node render graph
     */
    getScene() {
        return this._scene;
    }
    /**
     * Creates a new node render graph
     * @param name defines the name of the node render graph
     * @param scene defines the scene to use to execute the graph
     * @param options defines the options to use when creating the graph
     */
    constructor(name, scene, options) {
        this._buildId = NodeRenderGraph._BuildIdGenerator++;
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.BJSNODERENDERGRAPHEDITOR = this._getGlobalNodeRenderGraphEditor();
        /**
         * Gets or sets data used by visual editor
         * @see https://nrge.babylonjs.com
         */
        this.editorData = null;
        /**
         * Gets an array of blocks that needs to be serialized even if they are not yet connected
         */
        this.attachedBlocks = [];
        /**
         * Observable raised when the node render graph is built
         */
        this.onBuildObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable raised when an error is detected
         */
        this.onBuildErrorObservable = new Misc_observable/* Observable */.cP();
        /** Gets or sets the RenderGraphOutputBlock used to gather the final node render graph data */
        this.outputBlock = null;
        this._resizeObserver = null;
        this.name = name;
        this._scene = scene;
        this._engine = scene.getEngine();
        options = {
            debugTextures: false,
            autoConfigure: false,
            verbose: false,
            rebuildGraphOnEngineResize: true,
            autoFillExternalInputs: true,
            ...options,
        };
        this._options = options;
        this._frameGraph = new FrameGraph(this._engine, options.debugTextures, this._scene);
        if (options.rebuildGraphOnEngineResize) {
            this._resizeObserver = this._engine.onResizeObservable.add(() => {
                this.build();
            });
        }
    }
    /**
     * Gets the current class name ("NodeRenderGraph")
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraph";
    }
    /**
     * Gets a block by its name
     * @param name defines the name of the block to retrieve
     * @returns the required block or null if not found
     */
    getBlockByName(name) {
        let result = null;
        for (const block of this.attachedBlocks) {
            if (block.name === name) {
                if (!result) {
                    result = block;
                }
                else {
                    tools/* Tools */.S0.Warn("More than one block was found with the name `" + name + "`");
                    return result;
                }
            }
        }
        return result;
    }
    /**
     * Get a block using a predicate
     * @param predicate defines the predicate used to find the good candidate
     * @returns the required block or null if not found
     */
    getBlockByPredicate(predicate) {
        for (const block of this.attachedBlocks) {
            if (predicate(block)) {
                return block;
            }
        }
        return null;
    }
    /**
     * Get all blocks that match a predicate
     * @param predicate defines the predicate used to find the good candidate(s)
     * @returns the list of blocks found
     */
    getBlocksByPredicate(predicate) {
        const blocks = [];
        for (const block of this.attachedBlocks) {
            if (predicate(block)) {
                blocks.push(block);
            }
        }
        return blocks;
    }
    /**
     * Gets the list of input blocks attached to this material
     * @returns an array of InputBlocks
     */
    getInputBlocks() {
        const blocks = [];
        for (const block of this.attachedBlocks) {
            if (block.isInput) {
                blocks.push(block);
            }
        }
        return blocks;
    }
    /**
     * Launch the node render graph editor
     * @param config Define the configuration of the editor
     * @returns a promise fulfilled when the node editor is visible
     */
    edit(config) {
        return new Promise((resolve) => {
            this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();
            if (typeof this.BJSNODERENDERGRAPHEDITOR == "undefined") {
                const editorUrl = config && config.editorURL ? config.editorURL : NodeRenderGraph.EditorURL;
                // Load editor and add it to the DOM
                tools/* Tools */.S0.LoadBabylonScript(editorUrl, () => {
                    this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();
                    this._createNodeEditor(config?.nodeRenderGraphEditorConfig);
                    resolve();
                });
            }
            else {
                // Otherwise creates the editor
                this._createNodeEditor(config?.nodeRenderGraphEditorConfig);
                resolve();
            }
        });
    }
    /**
     * Creates the node editor window.
     * @param additionalConfig Additional configuration for the FGE
     */
    _createNodeEditor(additionalConfig) {
        const nodeEditorConfig = {
            nodeRenderGraph: this,
            ...additionalConfig,
        };
        this.BJSNODERENDERGRAPHEDITOR.NodeRenderGraphEditor.Show(nodeEditorConfig);
    }
    /**
     * Build the final list of blocks that will be executed by the "execute" method
     */
    build() {
        if (!this.outputBlock) {
            throw new Error("You must define the outputBlock property before building the node render graph");
        }
        this._initializeBlock(this.outputBlock);
        this._frameGraph.clear();
        const state = new NodeRenderGraphBuildState();
        state.buildId = this._buildId;
        state.verbose = this._options.verbose;
        if (this._options.autoFillExternalInputs) {
            this._autoFillExternalInputs();
        }
        this.outputBlock.build(state);
        this._frameGraph.build();
        this._buildId = NodeRenderGraph._BuildIdGenerator++;
        if (state.emitErrors(this.onBuildErrorObservable)) {
            this.onBuildObservable.notifyObservers(this);
        }
    }
    _autoFillExternalInputs() {
        const allInputs = this.getInputBlocks();
        let cameraIndex = 0;
        for (const input of allInputs) {
            if (!input.isExternal) {
                continue;
            }
            if (!input.isAnAncestorOfType("NodeRenderGraphOutputBlock")) {
                continue;
            }
            if ((input.type & nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer) !== 0) {
                // nothing to do
            }
            else if (input.isCamera()) {
                const camera = this._scene.cameras[cameraIndex++] || this._scene.cameras[0];
                if (!this._scene.cameraToUseForPointers) {
                    this._scene.cameraToUseForPointers = camera;
                }
                input.value = camera;
            }
            else if (input.isObjectList()) {
                input.value = { meshes: this._scene.meshes, particleSystems: this._scene.particleSystems };
            }
        }
    }
    /**
     * Returns a promise that resolves when the node render graph is ready to be executed
     * This method must be called after the graph has been built (NodeRenderGraph.build called)!
     * @param timeout Timeout in ms between retries (default is 16)
     * @returns The promise that resolves when the graph is ready
     */
    whenReadyAsync(timeout = 16) {
        return this._frameGraph.whenReadyAsync(timeout);
    }
    /**
     * Execute the graph (the graph must have been built before!)
     */
    execute() {
        this._frameGraph.execute();
    }
    _initializeBlock(node) {
        node.initialize();
        if (this._options.autoConfigure) {
            node.autoConfigure();
        }
        if (this.attachedBlocks.indexOf(node) === -1) {
            this.attachedBlocks.push(node);
        }
        for (const input of node.inputs) {
            const connectedPoint = input.connectedPoint;
            if (connectedPoint) {
                const block = connectedPoint.ownerBlock;
                if (block !== node) {
                    this._initializeBlock(block);
                }
            }
        }
    }
    /**
     * Clear the current graph
     */
    clear() {
        this.outputBlock = null;
        this.attachedBlocks.length = 0;
    }
    /**
     * Remove a block from the current graph
     * @param block defines the block to remove
     */
    removeBlock(block) {
        const attachedBlockIndex = this.attachedBlocks.indexOf(block);
        if (attachedBlockIndex > -1) {
            this.attachedBlocks.splice(attachedBlockIndex, 1);
        }
        if (block === this.outputBlock) {
            this.outputBlock = null;
        }
    }
    /**
     * Clear the current graph and load a new one from a serialization object
     * @param source defines the JSON representation of the graph
     * @param merge defines whether or not the source must be merged or replace the current content
     */
    parseSerializedObject(source, merge = false) {
        if (!merge) {
            this.clear();
        }
        const map = {};
        // Create blocks
        for (const parsedBlock of source.blocks) {
            const blockType = (0,typeStore/* GetClass */.n9)(parsedBlock.customType);
            if (blockType) {
                const additionalConstructionParameters = parsedBlock.additionalConstructionParameters;
                const block = additionalConstructionParameters
                    ? new blockType("", this._frameGraph, this._scene, ...additionalConstructionParameters)
                    : new blockType("", this._frameGraph, this._scene);
                block._deserialize(parsedBlock);
                map[parsedBlock.id] = block;
                this.attachedBlocks.push(block);
            }
        }
        // Reconnect teleportation
        for (const block of this.attachedBlocks) {
            if (block.isTeleportOut) {
                const teleportOut = block;
                const id = teleportOut._tempEntryPointUniqueId;
                if (id) {
                    const source = map[id];
                    if (source) {
                        source.attachToEndpoint(teleportOut);
                    }
                }
            }
        }
        // Connections - Starts with input blocks only (except if in "merge" mode where we scan all blocks)
        for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {
            const parsedBlock = source.blocks[blockIndex];
            const block = map[parsedBlock.id];
            if (!block) {
                continue;
            }
            if (block.inputs.length && parsedBlock.inputs.some((i) => i.targetConnectionName) && !merge) {
                continue;
            }
            this._restoreConnections(block, source, map);
        }
        // Outputs
        if (source.outputNodeId) {
            this.outputBlock = map[source.outputNodeId];
        }
        // UI related info
        if (source.locations || (source.editorData && source.editorData.locations)) {
            const locations = source.locations || source.editorData.locations;
            for (const location of locations) {
                if (map[location.blockId]) {
                    location.blockId = map[location.blockId].uniqueId;
                }
            }
            if (merge && this.editorData && this.editorData.locations) {
                locations.concat(this.editorData.locations);
            }
            if (source.locations) {
                this.editorData = {
                    locations: locations,
                };
            }
            else {
                this.editorData = source.editorData;
                this.editorData.locations = locations;
            }
            const blockMap = [];
            for (const key in map) {
                blockMap[key] = map[key].uniqueId;
            }
            this.editorData.map = blockMap;
        }
        this.comment = source.comment;
    }
    _restoreConnections(block, source, map) {
        for (const outputPoint of block.outputs) {
            for (const candidate of source.blocks) {
                const target = map[candidate.id];
                if (!target) {
                    continue;
                }
                for (const input of candidate.inputs) {
                    if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {
                        const inputPoint = target.getInputByName(input.inputName);
                        if (!inputPoint || inputPoint.isConnected) {
                            continue;
                        }
                        outputPoint.connectTo(inputPoint, true);
                        this._restoreConnections(target, source, map);
                        continue;
                    }
                }
            }
        }
    }
    /**
     * Generate a string containing the code declaration required to create an equivalent of this node render graph
     * @returns a string
     */
    generateCode() {
        let alreadyDumped = [];
        const blocks = [];
        const uniqueNames = ["const", "var", "let"];
        // Gets active blocks
        if (this.outputBlock) {
            this._gatherBlocks(this.outputBlock, blocks);
        }
        // Generate
        const options = JSON.stringify(this._options);
        let codeString = `let nodeRenderGraph = new BABYLON.NodeRenderGraph("${this.name || "render graph"}", scene, ${options});\n`;
        for (const node of blocks) {
            if (node.isInput && alreadyDumped.indexOf(node) === -1) {
                codeString += node._dumpCode(uniqueNames, alreadyDumped) + "\n";
            }
        }
        if (this.outputBlock) {
            // Connections
            alreadyDumped = [];
            codeString += "// Connections\n";
            codeString += this.outputBlock._dumpCodeForOutputConnections(alreadyDumped);
            // Output nodes
            codeString += "// Output nodes\n";
            codeString += `nodeRenderGraph.outputBlock = ${this.outputBlock._codeVariableName};\n`;
            codeString += `nodeRenderGraph.build();\n`;
        }
        return codeString;
    }
    _gatherBlocks(rootNode, list) {
        if (list.indexOf(rootNode) !== -1) {
            return;
        }
        list.push(rootNode);
        for (const input of rootNode.inputs) {
            const connectedPoint = input.connectedPoint;
            if (connectedPoint) {
                const block = connectedPoint.ownerBlock;
                if (block !== rootNode) {
                    this._gatherBlocks(block, list);
                }
            }
        }
        // Teleportation
        if (rootNode.isTeleportOut) {
            const block = rootNode;
            if (block.entryPoint) {
                this._gatherBlocks(block.entryPoint, list);
            }
        }
    }
    /**
     * Clear the current graph and set it to a default state
     */
    setToDefault() {
        this.clear();
        this.editorData = null;
        // Source
        const backBuffer = new NodeRenderGraphInputBlock("BackBuffer color", this._frameGraph, this._scene, nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureBackBuffer);
        // Clear texture
        const clear = new NodeRenderGraphClearBlock("Clear", this._frameGraph, this._scene);
        backBuffer.output.connectTo(clear.texture);
        // Final output
        const output = new NodeRenderGraphOutputBlock("Output", this._frameGraph, this._scene);
        clear.output.connectTo(output.texture);
        this.outputBlock = output;
    }
    /**
     * Makes a duplicate of the current node render graph.
     * @param name defines the name to use for the new node render graph
     * @returns the new node render graph
     */
    clone(name) {
        const serializationObject = this.serialize();
        const clone = decorators_serialization/* SerializationHelper */.p.Clone(() => new NodeRenderGraph(name, this._scene), this);
        clone.name = name;
        clone.parseSerializedObject(serializationObject);
        clone._buildId = this._buildId;
        clone.build();
        return clone;
    }
    /**
     * Serializes this node render graph in a JSON representation
     * @param selectedBlocks defines the list of blocks to save (if null the whole node render graph will be saved)
     * @returns the serialized node render graph object
     */
    serialize(selectedBlocks) {
        const serializationObject = selectedBlocks ? {} : decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy
        let blocks = [];
        if (selectedBlocks) {
            blocks = selectedBlocks;
        }
        else {
            serializationObject.customType = "BABYLON.NodeRenderGraph";
            if (this.outputBlock) {
                serializationObject.outputNodeId = this.outputBlock.uniqueId;
            }
        }
        // Blocks
        serializationObject.blocks = [];
        for (const block of blocks) {
            serializationObject.blocks.push(block.serialize());
        }
        if (!selectedBlocks) {
            for (const block of this.attachedBlocks) {
                if (blocks.indexOf(block) !== -1) {
                    continue;
                }
                serializationObject.blocks.push(block.serialize());
            }
        }
        return serializationObject;
    }
    /**
     * Disposes the ressources
     */
    dispose() {
        for (const block of this.attachedBlocks) {
            block.dispose();
        }
        this._frameGraph.dispose();
        this._frameGraph = undefined;
        this._engine.onResizeObservable.remove(this._resizeObserver);
        this._resizeObserver = null;
        this.attachedBlocks.length = 0;
        this.onBuildObservable.clear();
        this.onBuildErrorObservable.clear();
    }
    /**
     * Creates a new node render graph set to default basic configuration
     * @param name defines the name of the node render graph
     * @param scene defines the scene to use
     * @param nodeRenderGraphOptions defines options to use when creating the node render graph
     * @returns a new NodeRenderGraph
     */
    static CreateDefault(name, scene, nodeRenderGraphOptions) {
        const renderGraph = new NodeRenderGraph(name, scene, nodeRenderGraphOptions);
        renderGraph.setToDefault();
        renderGraph.build();
        return renderGraph;
    }
    /**
     * Creates a node render graph from parsed graph data
     * @param source defines the JSON representation of the node render graph
     * @param scene defines the scene to use
     * @param nodeRenderGraphOptions defines options to use when creating the node render
     * @param skipBuild defines whether to skip building the node render graph (default is true)
     * @returns a new node render graph
     */
    static Parse(source, scene, nodeRenderGraphOptions, skipBuild = true) {
        const renderGraph = decorators_serialization/* SerializationHelper */.p.Parse(() => new NodeRenderGraph(source.name, scene, nodeRenderGraphOptions), source, null);
        renderGraph.parseSerializedObject(source);
        if (!skipBuild) {
            renderGraph.build();
        }
        return renderGraph;
    }
    /**
     * Creates a node render graph from a snippet saved by the node render graph editor
     * @param snippetId defines the snippet to load
     * @param scene defines the scene to use
     * @param nodeRenderGraphOptions defines options to use when creating the node render graph
     * @param nodeRenderGraph defines a node render graph to update (instead of creating a new one)
     * @param skipBuild defines whether to skip building the node render graph (default is true)
     * @returns a promise that will resolve to the new node render graph
     */
    static ParseFromSnippetAsync(snippetId, scene, nodeRenderGraphOptions, nodeRenderGraph, skipBuild = true) {
        if (snippetId === "_BLANK") {
            return Promise.resolve(NodeRenderGraph.CreateDefault("blank", scene, nodeRenderGraphOptions));
        }
        return new Promise((resolve, reject) => {
            const request = new webRequest/* WebRequest */.u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);
                        const serializationObject = JSON.parse(snippet.nodeRenderGraph);
                        if (!nodeRenderGraph) {
                            nodeRenderGraph = decorators_serialization/* SerializationHelper */.p.Parse(() => new NodeRenderGraph(snippetId, scene, nodeRenderGraphOptions), serializationObject, null);
                        }
                        nodeRenderGraph.parseSerializedObject(serializationObject);
                        nodeRenderGraph.snippetId = snippetId;
                        try {
                            if (!skipBuild) {
                                nodeRenderGraph.build();
                            }
                            resolve(nodeRenderGraph);
                        }
                        catch (err) {
                            reject(err);
                        }
                    }
                    else {
                        reject("Unable to load the snippet " + snippetId);
                    }
                }
            });
            request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/"));
            request.send();
        });
    }
}
NodeRenderGraph._BuildIdGenerator = 0;
/** Define the Url to load node editor script */
NodeRenderGraph.EditorURL = `${tools/* Tools */.S0._DefaultCdnUrl}/v${Engines_engine/* Engine */.N.Version}/NodeRenderGraph/babylon.nodeRenderGraph.js`;
/** Define the Url to load snippets */
NodeRenderGraph.SnippetUrl = `https://snippet.babylonjs.com`;
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], NodeRenderGraph.prototype, "name", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("comment")
], NodeRenderGraph.prototype, "comment", void 0);
//# sourceMappingURL=nodeRenderGraph.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js
var nodeRenderGraphBlockConnectionPoint = __webpack_require__(46566);
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/elbowBlock.js



/**
 * Block used as a pass through
 */
class NodeRenderGraphElbowBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Creates a new NodeRenderGraphElbowBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("input", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.AutoDetect);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphElbowBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const input = this._inputs[0];
        this._propagateInputValueToOutput(input, output);
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphElbowBlock", NodeRenderGraphElbowBlock);
//# sourceMappingURL=elbowBlock.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinBlackAndWhitePostProcess.js


/**
 * Post process used to render in black and white
 */
class ThinBlackAndWhitePostProcess extends effectRenderer/* EffectWrapper */.$ {
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 65783)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3996)));
        }
    }
    /**
     * Constructs a new black and white post process
     * @param name Name of the effect
     * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
     * @param options Options to configure the effect
     */
    constructor(name, engine = null, options) {
        super({
            ...options,
            name,
            engine: engine || Engines_engine/* Engine */.N.LastCreatedEngine,
            useShaderStore: true,
            useAsPostProcess: true,
            fragmentShader: ThinBlackAndWhitePostProcess.FragmentUrl,
            uniforms: ThinBlackAndWhitePostProcess.Uniforms,
        });
        /**
         * Effect intensity (default: 1)
         */
        this.degree = 1;
    }
    bind() {
        super.bind();
        this._drawWrapper.effect.setFloat("degree", this.degree);
    }
}
/**
 * The fragment shader url
 */
ThinBlackAndWhitePostProcess.FragmentUrl = "blackAndWhite";
/**
 * The list of uniforms used by the effect
 */
ThinBlackAndWhitePostProcess.Uniforms = ["degree"];
//# sourceMappingURL=thinBlackAndWhitePostProcess.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/postProcessTask.js


/**
 * Task which applies a post process.
 */
class FrameGraphPostProcessTask extends frameGraphTask/* FrameGraphTask */.L {
    /**
     * Constructs a new post process task.
     * @param name Name of the task.
     * @param frameGraph The frame graph this task is associated with.
     * @param postProcess The post process to apply.
     */
    constructor(name, frameGraph, postProcess) {
        super(name, frameGraph);
        /**
         * The sampling mode to use for the source texture.
         */
        this.sourceSamplingMode = 2;
        this.postProcess = postProcess;
        this._postProcessDrawWrapper = this.postProcess.drawWrapper;
        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
    }
    isReady() {
        return this.postProcess.isReady();
    }
    record(skipCreationOfDisabledPasses = false, additionalExecute, additionalBindings) {
        if (this.sourceTexture === undefined) {
            throw new Error(`FrameGraphPostProcessTask "${this.name}": sourceTexture is required`);
        }
        const sourceTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);
        sourceTextureCreationOptions.options.samples = 1;
        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture, this.name, sourceTextureCreationOptions);
        const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.outputTexture);
        this._outputWidth = outputTextureDescription.size.width;
        this._outputHeight = outputTextureDescription.size.height;
        const pass = this._frameGraph.addRenderPass(this.name);
        pass.useTexture(this.sourceTexture);
        pass.setRenderTarget(this.outputTexture);
        pass.setExecuteFunc((context) => {
            context.setTextureSamplingMode(this.sourceTexture, this.sourceSamplingMode);
            additionalExecute?.(context);
            context.applyFullScreenEffect(this._postProcessDrawWrapper, () => {
                context.bindTextureHandle(this._postProcessDrawWrapper.effect, "textureSampler", this.sourceTexture);
                additionalBindings?.(context);
                this.postProcess.bind();
            });
        });
        if (!skipCreationOfDisabledPasses) {
            const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
            passDisabled.setRenderTarget(this.outputTexture);
            passDisabled.setExecuteFunc((context) => {
                context.copyTexture(this.sourceTexture);
            });
        }
        return pass;
    }
    dispose() {
        this.postProcess.dispose();
        super.dispose();
    }
}
//# sourceMappingURL=postProcessTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js


/**
 * Task which applies a black and white post process.
 */
class FrameGraphBlackAndWhiteTask extends FrameGraphPostProcessTask {
    /**
     * Constructs a new black and white task.
     * @param name The name of the task.
     * @param frameGraph The frame graph this task is associated with.
     * @param thinPostProcess The thin post process to use for the black and white effect. If not provided, a new one will be created.
     */
    constructor(name, frameGraph, thinPostProcess) {
        super(name, frameGraph, thinPostProcess || new ThinBlackAndWhitePostProcess(name, frameGraph.engine));
    }
}
//# sourceMappingURL=blackAndWhiteTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js







/**
 * Block that implements the black and white post process
 */
class NodeRenderGraphBlackAndWhitePostProcessBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new BlackAndWhitePostProcessBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("source", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerInput("destination", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture, true);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.source.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer);
        this.destination.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll);
        this.output._typeConnectionSource = () => {
            return this.destination.isConnected ? this.destination : this.source;
        };
        this._frameGraphTask = new FrameGraphBlackAndWhiteTask(this.name, frameGraph, new ThinBlackAndWhitePostProcess(name, scene.getEngine()));
    }
    /** Sampling mode used to sample from the source texture */
    get sourceSamplingMode() {
        return this._frameGraphTask.sourceSamplingMode;
    }
    set sourceSamplingMode(value) {
        this._frameGraphTask.sourceSamplingMode = value;
    }
    /** Degree of conversion to black and white (default: 1 - full b&w conversion) */
    get degree() {
        return this._frameGraphTask.postProcess.degree;
    }
    set degree(value) {
        this._frameGraphTask.postProcess.degree = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphBlackAndWhitePostProcessBlock";
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[0];
    }
    /**
     * Gets the destination input component
     */
    get destination() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
        const sourceConnectedPoint = this.source.connectedPoint;
        if (sourceConnectedPoint) {
            this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
        }
        const destinationConnectedPoint = this.destination.connectedPoint;
        if (destinationConnectedPoint) {
            this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.degree = ${this.degree};`);
        codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.degree = this.degree;
        serializationObject.sourceSamplingMode = this.sourceSamplingMode;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.degree = serializationObject.degree;
        this.sourceSamplingMode = serializationObject.sourceSamplingMode;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
], NodeRenderGraphBlackAndWhitePostProcessBlock.prototype, "sourceSamplingMode", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Degree", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 1 })
], NodeRenderGraphBlackAndWhitePostProcessBlock.prototype, "degree", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphBlackAndWhitePostProcessBlock", NodeRenderGraphBlackAndWhitePostProcessBlock);
//# sourceMappingURL=blackAndWhitePostProcessBlock.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinBloomMergePostProcess.js


/**
 * @internal
 */
class ThinBloomMergePostProcess extends effectRenderer/* EffectWrapper */.$ {
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 96645)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 39336)));
        }
    }
    constructor(name, engine = null, options) {
        super({
            ...options,
            name,
            engine: engine || Engines_engine/* Engine */.N.LastCreatedEngine,
            useShaderStore: true,
            useAsPostProcess: true,
            fragmentShader: ThinBloomMergePostProcess.FragmentUrl,
            uniforms: ThinBloomMergePostProcess.Uniforms,
            samplers: ThinBloomMergePostProcess.Samplers,
        });
        /** Weight of the bloom to be added to the original input. */
        this.weight = 1;
    }
    bind() {
        super.bind();
        this._drawWrapper.effect.setFloat("bloomWeight", this.weight);
    }
}
ThinBloomMergePostProcess.FragmentUrl = "bloomMerge";
ThinBloomMergePostProcess.Uniforms = ["bloomWeight"];
ThinBloomMergePostProcess.Samplers = ["bloomBlur"];
//# sourceMappingURL=thinBloomMergePostProcess.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js


/**
 * @internal
 */
class FrameGraphBloomMergeTask extends FrameGraphPostProcessTask {
    constructor(name, frameGraph, thinPostProcess) {
        super(name, frameGraph, thinPostProcess || new ThinBloomMergePostProcess(name, frameGraph.engine));
    }
    record(skipCreationOfDisabledPasses = false) {
        if (this.sourceTexture === undefined || this.blurTexture === undefined) {
            throw new Error(`FrameGraphBloomMergeTask "${this.name}": sourceTexture and blurTexture are required`);
        }
        const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {
            context.bindTextureHandle(this._postProcessDrawWrapper.effect, "bloomBlur", this.blurTexture);
        });
        pass.useTexture(this.blurTexture);
        return pass;
    }
}
//# sourceMappingURL=bloomMergeTask.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinBlurPostProcess.js


/**
 * Post process used to apply a blur effect
 */
class ThinBlurPostProcess extends effectRenderer/* EffectWrapper */.$ {
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 12850)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85417))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 54509)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 83802))]));
        }
    }
    /**
     * Constructs a new blur post process
     * @param name Name of the effect
     * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
     * @param direction Direction in which to apply the blur
     * @param kernel Kernel size of the blur
     * @param options Options to configure the effect
     */
    constructor(name, engine = null, direction, kernel, options) {
        const blockCompilationFinal = !!options?.blockCompilation;
        super({
            ...options,
            name,
            engine: engine || Engines_engine/* Engine */.N.LastCreatedEngine,
            useShaderStore: true,
            useAsPostProcess: true,
            fragmentShader: ThinBlurPostProcess.FragmentUrl,
            uniforms: ThinBlurPostProcess.Uniforms,
            samplers: ThinBlurPostProcess.Samplers,
            vertexUrl: ThinBlurPostProcess.VertexUrl,
            blockCompilation: true,
        });
        this._packedFloat = false;
        this._staticDefines = "";
        /**
         * Width of the texture to apply the blur on
         */
        this.textureWidth = 0;
        /**
         * Height of the texture to apply the blur on
         */
        this.textureHeight = 0;
        this.options.blockCompilation = blockCompilationFinal;
        if (direction !== undefined) {
            this.direction = direction;
        }
        if (kernel !== undefined) {
            this.kernel = kernel;
        }
    }
    /**
     * Sets the length in pixels of the blur sample region
     */
    set kernel(v) {
        if (this._idealKernel === v) {
            return;
        }
        v = Math.max(v, 1);
        this._idealKernel = v;
        this._kernel = this._nearestBestKernel(v);
        if (!this.options.blockCompilation) {
            this._updateParameters();
        }
    }
    /**
     * Gets the length in pixels of the blur sample region
     */
    get kernel() {
        return this._idealKernel;
    }
    /**
     * Sets whether or not the blur needs to unpack/repack floats
     */
    set packedFloat(v) {
        if (this._packedFloat === v) {
            return;
        }
        this._packedFloat = v;
        if (!this.options.blockCompilation) {
            this._updateParameters();
        }
    }
    /**
     * Gets whether or not the blur is unpacking/repacking floats
     */
    get packedFloat() {
        return this._packedFloat;
    }
    bind() {
        super.bind();
        this._drawWrapper.effect.setFloat2("delta", (1 / this.textureWidth) * this.direction.x, (1 / this.textureHeight) * this.direction.y);
    }
    /** @internal */
    _updateParameters(onCompiled, onError) {
        // Generate sampling offsets and weights
        const N = this._kernel;
        const centerIndex = (N - 1) / 2;
        // Generate Gaussian sampling weights over kernel
        let offsets = [];
        let weights = [];
        let totalWeight = 0;
        for (let i = 0; i < N; i++) {
            const u = i / (N - 1);
            const w = this._gaussianWeight(u * 2.0 - 1);
            offsets[i] = i - centerIndex;
            weights[i] = w;
            totalWeight += w;
        }
        // Normalize weights
        for (let i = 0; i < weights.length; i++) {
            weights[i] /= totalWeight;
        }
        // Optimize: combine samples to take advantage of hardware linear sampling
        // Walk from left to center, combining pairs (symmetrically)
        const linearSamplingWeights = [];
        const linearSamplingOffsets = [];
        const linearSamplingMap = [];
        for (let i = 0; i <= centerIndex; i += 2) {
            const j = Math.min(i + 1, Math.floor(centerIndex));
            const singleCenterSample = i === j;
            if (singleCenterSample) {
                linearSamplingMap.push({ o: offsets[i], w: weights[i] });
            }
            else {
                const sharedCell = j === centerIndex;
                const weightLinear = weights[i] + weights[j] * (sharedCell ? 0.5 : 1);
                const offsetLinear = offsets[i] + 1 / (1 + weights[i] / weights[j]);
                if (offsetLinear === 0) {
                    linearSamplingMap.push({ o: offsets[i], w: weights[i] });
                    linearSamplingMap.push({ o: offsets[i + 1], w: weights[i + 1] });
                }
                else {
                    linearSamplingMap.push({ o: offsetLinear, w: weightLinear });
                    linearSamplingMap.push({ o: -offsetLinear, w: weightLinear });
                }
            }
        }
        for (let i = 0; i < linearSamplingMap.length; i++) {
            linearSamplingOffsets[i] = linearSamplingMap[i].o;
            linearSamplingWeights[i] = linearSamplingMap[i].w;
        }
        // Replace with optimized
        offsets = linearSamplingOffsets;
        weights = linearSamplingWeights;
        // Generate shaders
        const maxVaryingRows = this.options.engine.getCaps().maxVaryingVectors - (this.options.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? 1 : 0); // Because of the additional builtins
        const freeVaryingVec2 = Math.max(maxVaryingRows, 0) - 1; // Because of sampleCenter
        let varyingCount = Math.min(offsets.length, freeVaryingVec2);
        let defines = "";
        defines += this._staticDefines;
        // The DOF fragment should ignore the center pixel when looping as it is handled manually in the fragment shader.
        if (this._staticDefines.indexOf("DOF") != -1) {
            defines += `#define CENTER_WEIGHT ${this._glslFloat(weights[varyingCount - 1])}\n`;
            varyingCount--;
        }
        for (let i = 0; i < varyingCount; i++) {
            defines += `#define KERNEL_OFFSET${i} ${this._glslFloat(offsets[i])}\n`;
            defines += `#define KERNEL_WEIGHT${i} ${this._glslFloat(weights[i])}\n`;
        }
        let depCount = 0;
        for (let i = freeVaryingVec2; i < offsets.length; i++) {
            defines += `#define KERNEL_DEP_OFFSET${depCount} ${this._glslFloat(offsets[i])}\n`;
            defines += `#define KERNEL_DEP_WEIGHT${depCount} ${this._glslFloat(weights[i])}\n`;
            depCount++;
        }
        if (this.packedFloat) {
            defines += `#define PACKEDFLOAT 1`;
        }
        this.options.blockCompilation = false;
        this.updateEffect(defines, null, null, {
            varyingCount: varyingCount,
            depCount: depCount,
        }, onCompiled, onError);
    }
    /**
     * Best kernels are odd numbers that when divided by 2, their integer part is even, so 5, 9 or 13.
     * Other odd kernels optimize correctly but require proportionally more samples, even kernels are
     * possible but will produce minor visual artifacts. Since each new kernel requires a new shader we
     * want to minimize kernel changes, having gaps between physical kernels is helpful in that regard.
     * The gaps between physical kernels are compensated for in the weighting of the samples
     * @param idealKernel Ideal blur kernel.
     * @returns Nearest best kernel.
     */
    _nearestBestKernel(idealKernel) {
        const v = Math.round(idealKernel);
        for (const k of [v, v - 1, v + 1, v - 2, v + 2]) {
            if (k % 2 !== 0 && Math.floor(k / 2) % 2 === 0 && k > 0) {
                return Math.max(k, 3);
            }
        }
        return Math.max(v, 3);
    }
    /**
     * Calculates the value of a Gaussian distribution with sigma 3 at a given point.
     * @param x The point on the Gaussian distribution to sample.
     * @returns the value of the Gaussian function at x.
     */
    _gaussianWeight(x) {
        //reference: Engines/ImageProcessingBlur.cpp #dcc760
        // We are evaluating the Gaussian (normal) distribution over a kernel parameter space of [-1,1],
        // so we truncate at three standard deviations by setting stddev (sigma) to 1/3.
        // The choice of 3-sigma truncation is common but arbitrary, and means that the signal is
        // truncated at around 1.3% of peak strength.
        //the distribution is scaled to account for the difference between the actual kernel size and the requested kernel size
        const sigma = 1 / 3;
        const denominator = Math.sqrt(2.0 * Math.PI) * sigma;
        const exponent = -((x * x) / (2.0 * sigma * sigma));
        const weight = (1.0 / denominator) * Math.exp(exponent);
        return weight;
    }
    /**
     * Generates a string that can be used as a floating point number in GLSL.
     * @param x Value to print.
     * @param decimalFigures Number of decimal places to print the number to (excluding trailing 0s).
     * @returns GLSL float string.
     */
    _glslFloat(x, decimalFigures = 8) {
        return x.toFixed(decimalFigures).replace(/0+$/, "");
    }
}
/**
 * The vertex shader url
 */
ThinBlurPostProcess.VertexUrl = "kernelBlur";
/**
 * The fragment shader url
 */
ThinBlurPostProcess.FragmentUrl = "kernelBlur";
/**
 * The list of uniforms used by the effect
 */
ThinBlurPostProcess.Uniforms = ["delta", "direction"];
/**
 * The list of samplers used by the effect
 */
ThinBlurPostProcess.Samplers = ["circleOfConfusionSampler"];
//# sourceMappingURL=thinBlurPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinExtractHighlightsPostProcess.js



/**
 * Post process used to extract highlights.
 */
class ThinExtractHighlightsPostProcess extends effectRenderer/* EffectWrapper */.$ {
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 95516)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 55491)));
        }
    }
    /**
     * Constructs a new extract highlights post process
     * @param name Name of the effect
     * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
     * @param options Options to configure the effect
     */
    constructor(name, engine = null, options) {
        super({
            ...options,
            name,
            engine: engine || Engines_engine/* Engine */.N.LastCreatedEngine,
            useShaderStore: true,
            useAsPostProcess: true,
            fragmentShader: ThinExtractHighlightsPostProcess.FragmentUrl,
            uniforms: ThinExtractHighlightsPostProcess.Uniforms,
        });
        /**
         * The luminance threshold, pixels below this value will be set to black.
         */
        this.threshold = 0.9;
        /** @internal */
        this._exposure = 1;
    }
    bind() {
        super.bind();
        const effect = this._drawWrapper.effect;
        effect.setFloat("threshold", Math.pow(this.threshold, math_constants/* ToGammaSpace */.rv));
        effect.setFloat("exposure", this._exposure);
    }
}
/**
 * The fragment shader url
 */
ThinExtractHighlightsPostProcess.FragmentUrl = "extractHighlights";
/**
 * The list of uniforms used by the effect
 */
ThinExtractHighlightsPostProcess.Uniforms = ["threshold", "exposure"];
//# sourceMappingURL=thinExtractHighlightsPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinBloomEffect.js




/**
 * The bloom effect spreads bright areas of an image to simulate artifacts seen in cameras
 */
class ThinBloomEffect {
    /**
     * The luminance threshold to find bright areas of the image to bloom.
     */
    get threshold() {
        return this._downscale.threshold;
    }
    set threshold(value) {
        this._downscale.threshold = value;
    }
    /**
     * The strength of the bloom.
     */
    get weight() {
        return this._merge.weight;
    }
    set weight(value) {
        this._merge.weight = value;
    }
    /**
     * Specifies the size of the bloom blur kernel, relative to the final output size
     */
    get kernel() {
        return this._blurX.kernel / this.scale;
    }
    set kernel(value) {
        this._blurX.kernel = value * this.scale;
        this._blurY.kernel = value * this.scale;
    }
    /**
     * Creates a new instance of @see ThinBloomEffect
     * @param name The name of the bloom render effect
     * @param engine The engine which the render effect will be applied. (default: current engine)
     * @param scale The ratio of the blur texture to the input texture that should be used to compute the bloom.
     * @param blockCompilation If shaders should not be compiled when the effect is created (default: false)
     */
    constructor(name, engine, scale, blockCompilation = false) {
        this.scale = scale;
        this._downscale = new ThinExtractHighlightsPostProcess(name + "_downscale", engine, { blockCompilation });
        this._blurX = new ThinBlurPostProcess(name + "_blurX", engine, new math_vector/* Vector2 */.I9(1, 0), 10, { blockCompilation });
        this._blurY = new ThinBlurPostProcess(name + "_blurY", engine, new math_vector/* Vector2 */.I9(0, 1), 10, { blockCompilation });
        this._merge = new ThinBloomMergePostProcess(name + "_merge", engine, { blockCompilation });
    }
    /**
     * Checks if the effect is ready to be used
     * @returns if the effect is ready
     */
    isReady() {
        return this._downscale.isReady() && this._blurX.isReady() && this._blurY.isReady() && this._merge.isReady();
    }
}
//# sourceMappingURL=thinBloomEffect.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js


/**
 * Task used to extract highlights from a scene.
 */
class FrameGraphExtractHighlightsTask extends FrameGraphPostProcessTask {
    /**
     * Constructs a new extract highlights task.
     * @param name The name of the task.
     * @param frameGraph The frame graph the task belongs to.
     * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.
     */
    constructor(name, frameGraph, thinPostProcess) {
        super(name, frameGraph, thinPostProcess || new ThinExtractHighlightsPostProcess(name, frameGraph.engine));
    }
}
//# sourceMappingURL=extractHighlightsTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/blurTask.js



/**
 * Task which applies a blur post process.
 */
class FrameGraphBlurTask extends FrameGraphPostProcessTask {
    /**
     * Constructs a new blur task.
     * @param name Name of the task.
     * @param frameGraph Frame graph this task is associated with.
     * @param thinPostProcess The thin post process to use for the blur effect.
     */
    constructor(name, frameGraph, thinPostProcess) {
        super(name, frameGraph, thinPostProcess || new ThinBlurPostProcess(name, frameGraph.engine, new math_vector/* Vector2 */.I9(1, 0), 10));
    }
    record(skipCreationOfDisabledPasses = false, additionalExecute, additionalBindings) {
        const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);
        this.postProcess.textureWidth = this._outputWidth;
        this.postProcess.textureHeight = this._outputHeight;
        return pass;
    }
}
//# sourceMappingURL=blurTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/bloomTask.js






/**
 * Task which applies a bloom render effect.
 */
class FrameGraphBloomTask extends frameGraphTask/* FrameGraphTask */.L {
    /**
     * The name of the task.
     */
    get name() {
        return this._name;
    }
    set name(name) {
        this._name = name;
        if (this._downscale) {
            this._downscale.name = `${name} Downscale`;
        }
        if (this._blurX) {
            this._blurX.name = `${name} Blur X`;
        }
        if (this._blurY) {
            this._blurY.name = `${name} Blur Y`;
        }
        if (this._merge) {
            this._merge.name = `${name} Merge`;
        }
    }
    /**
     * Constructs a new bloom task.
     * @param name Name of the task.
     * @param frameGraph The frame graph this task is associated with.
     * @param engine The engine to use for the bloom effect.
     * @param weight Weight of the bloom effect.
     * @param kernel Kernel size of the bloom effect.
     * @param threshold Threshold of the bloom effect.
     * @param hdr Whether the bloom effect is HDR.
     * @param bloomScale The scale of the bloom effect. This value is multiplied by the source texture size to determine the bloom texture size.
     */
    constructor(name, frameGraph, engine, weight, kernel, threshold, hdr = false, bloomScale = 0.5) {
        super(name, frameGraph);
        /**
         * The sampling mode to use for the source texture.
         */
        this.sourceSamplingMode = 2;
        this.hdr = hdr;
        this._defaultPipelineTextureType = 0;
        if (hdr) {
            const caps = engine.getCaps();
            if (caps.textureHalfFloatRender) {
                this._defaultPipelineTextureType = 2;
            }
            else if (caps.textureFloatRender) {
                this._defaultPipelineTextureType = 1;
            }
        }
        this.bloom = new ThinBloomEffect(name, engine, bloomScale);
        this.bloom.threshold = threshold;
        this.bloom.kernel = kernel;
        this.bloom.weight = weight;
        this._downscale = new FrameGraphExtractHighlightsTask(`${name} Downscale`, this._frameGraph, this.bloom._downscale);
        this._blurX = new FrameGraphBlurTask(`${name} Blur X`, this._frameGraph, this.bloom._blurX);
        this._blurY = new FrameGraphBlurTask(`${name} Blur Y`, this._frameGraph, this.bloom._blurY);
        this._merge = new FrameGraphBloomMergeTask(`${name} Merge`, this._frameGraph, this.bloom._merge);
        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
    }
    isReady() {
        return this.bloom.isReady();
    }
    record() {
        if (this.sourceTexture === undefined) {
            throw new Error("FrameGraphBloomTask: sourceTexture is required");
        }
        const sourceTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);
        const textureCreationOptions = {
            size: {
                width: Math.floor(sourceTextureDescription.size.width * this.bloom.scale),
                height: Math.floor(sourceTextureDescription.size.height * this.bloom.scale),
            },
            options: {
                createMipMaps: false,
                types: [this._defaultPipelineTextureType],
                formats: [5],
                samples: 1,
                useSRGBBuffers: [false],
                labels: [""],
            },
            sizeIsPercentage: false,
        };
        const downscaleTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._downscale.name, textureCreationOptions);
        this._downscale.sourceTexture = this.sourceTexture;
        this._downscale.sourceSamplingMode = 2;
        this._downscale.destinationTexture = downscaleTextureHandle;
        this._downscale.record(true);
        const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX.name, textureCreationOptions);
        this._blurX.sourceTexture = downscaleTextureHandle;
        this._blurX.sourceSamplingMode = 2;
        this._blurX.destinationTexture = blurXTextureHandle;
        this._blurX.record(true);
        const blurYTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurY.name, textureCreationOptions);
        this._blurY.sourceTexture = blurXTextureHandle;
        this._blurY.sourceSamplingMode = 2;
        this._blurY.destinationTexture = blurYTextureHandle;
        this._blurY.record(true);
        const sourceTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);
        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture, this._merge.name, sourceTextureCreationOptions);
        this._merge.sourceTexture = this.sourceTexture;
        this._merge.sourceSamplingMode = this.sourceSamplingMode;
        this._merge.blurTexture = blurYTextureHandle;
        this._merge.destinationTexture = this.outputTexture;
        this._merge.record(true);
        const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
        passDisabled.setRenderTarget(this.outputTexture);
        passDisabled.setExecuteFunc((context) => {
            context.copyTexture(this.sourceTexture);
        });
    }
    dispose() {
        this._downscale.dispose();
        this._blurX.dispose();
        this._blurY.dispose();
        this._merge.dispose();
        super.dispose();
    }
}
//# sourceMappingURL=bloomTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js






/**
 * Block that implements the bloom post process
 */
class NodeRenderGraphBloomPostProcessBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphBloomPostProcessBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     * @param hdr If high dynamic range textures should be used (default: false)
     * @param bloomScale The scale of the bloom effect (default: 0.5)
     */
    constructor(name, frameGraph, scene, hdr = false, bloomScale = 0.5) {
        super(name, frameGraph, scene);
        this._additionalConstructionParameters = [hdr, bloomScale];
        this.registerInput("source", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerInput("destination", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture, true);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.source.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer);
        this.destination.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll);
        this.output._typeConnectionSource = () => {
            return this.destination.isConnected ? this.destination : this.source;
        };
        this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);
    }
    _createTask(bloomScale, hdr) {
        const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;
        const threshold = this._frameGraphTask.bloom.threshold;
        const weight = this._frameGraphTask.bloom.weight;
        const kernel = this._frameGraphTask.bloom.kernel;
        this._frameGraphTask.dispose();
        this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);
        this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;
        this._additionalConstructionParameters = [hdr, bloomScale];
    }
    /** The quality of the blur effect */
    get bloomScale() {
        return this._frameGraphTask.bloom.scale;
    }
    set bloomScale(value) {
        this._createTask(value, this._frameGraphTask.hdr);
    }
    /** If high dynamic range textures should be used */
    get hdr() {
        return this._frameGraphTask.hdr;
    }
    set hdr(value) {
        this._createTask(this._frameGraphTask.bloom.scale, value);
    }
    /** Sampling mode used to sample from the source texture */
    get sourceSamplingMode() {
        return this._frameGraphTask.sourceSamplingMode;
    }
    set sourceSamplingMode(value) {
        this._frameGraphTask.sourceSamplingMode = value;
    }
    /** The luminance threshold to find bright areas of the image to bloom. */
    get threshold() {
        return this._frameGraphTask.bloom.threshold;
    }
    set threshold(value) {
        this._frameGraphTask.bloom.threshold = value;
    }
    /** The strength of the bloom. */
    get weight() {
        return this._frameGraphTask.bloom.weight;
    }
    set weight(value) {
        this._frameGraphTask.bloom.weight = value;
    }
    /** Specifies the size of the bloom blur kernel, relative to the final output size */
    get kernel() {
        return this._frameGraphTask.bloom.kernel;
    }
    set kernel(value) {
        this._frameGraphTask.bloom.kernel = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphBloomPostProcessBlock";
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[0];
    }
    /**
     * Gets the destination input component
     */
    get destination() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
        const sourceConnectedPoint = this.source.connectedPoint;
        if (sourceConnectedPoint) {
            this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
        }
        const destinationConnectedPoint = this.destination.connectedPoint;
        if (destinationConnectedPoint) {
            this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);
        codes.push(`${this._codeVariableName}.weight = ${this.weight};`);
        codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);
        codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.threshold = this.threshold;
        serializationObject.weight = this.weight;
        serializationObject.kernel = this.kernel;
        serializationObject.sourceSamplingMode = this.sourceSamplingMode;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.threshold = serializationObject.threshold;
        this.weight = serializationObject.weight;
        this.kernel = serializationObject.kernel;
        this.sourceSamplingMode = serializationObject.sourceSamplingMode;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Bloom scale", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
], NodeRenderGraphBloomPostProcessBlock.prototype, "bloomScale", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("HDR", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphBloomPostProcessBlock.prototype, "hdr", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */)
], NodeRenderGraphBloomPostProcessBlock.prototype, "sourceSamplingMode", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Threshold", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 2 })
], NodeRenderGraphBloomPostProcessBlock.prototype, "threshold", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Weight", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 3 })
], NodeRenderGraphBloomPostProcessBlock.prototype, "weight", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Kernel", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES", { min: 1, max: 128 })
], NodeRenderGraphBloomPostProcessBlock.prototype, "kernel", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphBloomPostProcessBlock", NodeRenderGraphBloomPostProcessBlock);
//# sourceMappingURL=bloomPostProcessBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js








/**
 * Block that implements the blur post process
 */
class NodeRenderGraphBlurPostProcessBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphBlurPostProcessBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("source", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerInput("destination", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture, true);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.source.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer);
        this.destination.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll);
        this.output._typeConnectionSource = () => {
            return this.destination.isConnected ? this.destination : this.source;
        };
        this._frameGraphTask = new FrameGraphBlurTask(this.name, frameGraph, new ThinBlurPostProcess(name, scene.getEngine(), new math_vector/* Vector2 */.I9(1, 0), 32));
    }
    /** Sampling mode used to sample from the source texture */
    get sourceSamplingMode() {
        return this._frameGraphTask.sourceSamplingMode;
    }
    set sourceSamplingMode(value) {
        this._frameGraphTask.sourceSamplingMode = value;
    }
    /** The direction in which to blur the image */
    get direction() {
        return this._frameGraphTask.postProcess.direction;
    }
    set direction(value) {
        this._frameGraphTask.postProcess.direction = value;
    }
    /** Length in pixels of the blur sample region */
    get kernel() {
        return this._frameGraphTask.postProcess.kernel;
    }
    set kernel(value) {
        this._frameGraphTask.postProcess.kernel = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphBlurPostProcessBlock";
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[0];
    }
    /**
     * Gets the destination input component
     */
    get destination() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
        const sourceConnectedPoint = this.source.connectedPoint;
        if (sourceConnectedPoint) {
            this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
        }
        const destinationConnectedPoint = this.destination.connectedPoint;
        if (destinationConnectedPoint) {
            this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);
        codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);
        codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.direction = this.direction.asArray();
        serializationObject.kernel = this.kernel;
        serializationObject.sourceSamplingMode = this.sourceSamplingMode;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.direction.fromArray(serializationObject.direction);
        this.kernel = serializationObject.kernel;
        this.sourceSamplingMode = serializationObject.sourceSamplingMode;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
], NodeRenderGraphBlurPostProcessBlock.prototype, "sourceSamplingMode", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Direction", 3 /* PropertyTypeForEdition.Vector2 */, "PROPERTIES")
], NodeRenderGraphBlurPostProcessBlock.prototype, "direction", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Kernel", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES", { min: 1, max: 256 })
], NodeRenderGraphBlurPostProcessBlock.prototype, "kernel", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphBlurPostProcessBlock", NodeRenderGraphBlurPostProcessBlock);
//# sourceMappingURL=blurPostProcessBlock.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinCircleOfConfusionPostProcess.js


/**
 * Post process used to calculate the circle of confusion (used for depth of field, for example)
 */
class ThinCircleOfConfusionPostProcess extends effectRenderer/* EffectWrapper */.$ {
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22217)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 97694)));
        }
    }
    /**
     * Constructs a new circle of confusion post process
     * @param name Name of the effect
     * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
     * @param options Options to configure the effect
     */
    constructor(name, engine = null, options) {
        super({
            ...options,
            name,
            engine: engine || Engines_engine/* Engine */.N.LastCreatedEngine,
            useShaderStore: true,
            useAsPostProcess: true,
            fragmentShader: ThinCircleOfConfusionPostProcess.FragmentUrl,
            uniforms: ThinCircleOfConfusionPostProcess.Uniforms,
            samplers: ThinCircleOfConfusionPostProcess.Samplers,
            defines: options?.depthNotNormalized ? ThinCircleOfConfusionPostProcess.DefinesDepthNotNormalized : undefined,
        });
        /**
         * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.
         */
        this.lensSize = 50;
        /**
         * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)
         */
        this.fStop = 1.4;
        /**
         * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)
         */
        this.focusDistance = 2000;
        /**
         * Focal length of the effect's camera in scene units/1000 (eg. millimeter). (default: 50)
         */
        this.focalLength = 50;
    }
    bind() {
        super.bind();
        const options = this.options;
        const effect = this._drawWrapper.effect;
        if (!options.depthNotNormalized) {
            effect.setFloat2("cameraMinMaxZ", this.camera.minZ, this.camera.maxZ - this.camera.minZ);
        }
        // Circle of confusion calculation, See https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch23.html
        const aperture = this.lensSize / this.fStop;
        const cocPrecalculation = (aperture * this.focalLength) / (this.focusDistance - this.focalLength); // * ((this.focusDistance - pixelDistance)/pixelDistance) [This part is done in shader]
        effect.setFloat("focusDistance", this.focusDistance);
        effect.setFloat("cocPrecalculation", cocPrecalculation);
    }
}
/**
 * The fragment shader url
 */
ThinCircleOfConfusionPostProcess.FragmentUrl = "circleOfConfusion";
/**
 * The list of uniforms used by the effect
 */
ThinCircleOfConfusionPostProcess.Uniforms = ["cameraMinMaxZ", "focusDistance", "cocPrecalculation"];
/**
 * The list of samplers used by the effect
 */
ThinCircleOfConfusionPostProcess.Samplers = ["depthSampler"];
/**
 * Defines if the depth is normalized or not
 */
ThinCircleOfConfusionPostProcess.DefinesDepthNotNormalized = "#define COC_DEPTH_NOT_NORMALIZED";
//# sourceMappingURL=thinCircleOfConfusionPostProcess.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js



/**
 * Task which applies a circle of confusion post process.
 */
class FrameGraphCircleOfConfusionTask extends FrameGraphPostProcessTask {
    /**
     * Constructs a new circle of confusion task.
     * @param name The name of the task.
     * @param frameGraph The frame graph this task belongs to.
     * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.
     */
    constructor(name, frameGraph, thinPostProcess) {
        super(name, frameGraph, thinPostProcess || new ThinCircleOfConfusionPostProcess(name, frameGraph.engine));
        /**
         * The sampling mode to use for the depth texture.
         */
        this.depthSamplingMode = 2;
    }
    record(skipCreationOfDisabledPasses = false) {
        if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {
            throw new Error(`FrameGraphCircleOfConfusionTask "${this.name}": sourceTexture, depthTexture and camera are required`);
        }
        const pass = super.record(skipCreationOfDisabledPasses, (context) => {
            context.setTextureSamplingMode(this.depthTexture, this.depthSamplingMode);
        }, (context) => {
            this.postProcess.camera = this.camera;
            context.bindTextureHandle(this._postProcessDrawWrapper.effect, "depthSampler", this.depthTexture);
        });
        pass.useTexture(this.depthTexture);
        return pass;
    }
}
//# sourceMappingURL=circleOfConfusionTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js







/**
 * Block that implements the circle of confusion post process
 */
class NodeRenderGraphCircleOfConfusionPostProcessBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphCircleOfConfusionPostProcessBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("source", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerInput("geomViewDepth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureViewDepth);
        this.registerInput("destination", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture, true);
        this.registerInput("camera", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Camera);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.source.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer);
        this.destination.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll);
        this.output._typeConnectionSource = () => {
            return this.destination.isConnected ? this.destination : this.source;
        };
        this._frameGraphTask = new FrameGraphCircleOfConfusionTask(this.name, frameGraph, new ThinCircleOfConfusionPostProcess(name, scene.getEngine(), { depthNotNormalized: true }));
    }
    /** Sampling mode used to sample from the source texture */
    get sourceSamplingMode() {
        return this._frameGraphTask.sourceSamplingMode;
    }
    set sourceSamplingMode(value) {
        this._frameGraphTask.sourceSamplingMode = value;
    }
    /** Sampling mode used to sample from the depth texture */
    get depthSamplingMode() {
        return this._frameGraphTask.depthSamplingMode;
    }
    set depthSamplingMode(value) {
        this._frameGraphTask.depthSamplingMode = value;
    }
    /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */
    get lensSize() {
        return this._frameGraphTask.postProcess.lensSize;
    }
    set lensSize(value) {
        this._frameGraphTask.postProcess.lensSize = value;
    }
    /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop */
    get fStop() {
        return this._frameGraphTask.postProcess.fStop;
    }
    set fStop(value) {
        this._frameGraphTask.postProcess.fStop = value;
    }
    /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter) */
    get focusDistance() {
        return this._frameGraphTask.postProcess.focusDistance;
    }
    set focusDistance(value) {
        this._frameGraphTask.postProcess.focusDistance = value;
    }
    /** Focal length of the effect's camera in scene units/1000 (eg. millimeter) */
    get focalLength() {
        return this._frameGraphTask.postProcess.focalLength;
    }
    set focalLength(value) {
        this._frameGraphTask.postProcess.focalLength = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphCircleOfConfusionPostProcessBlock";
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[0];
    }
    /**
     * Gets the geometry view depth input component
     */
    get geomViewDepth() {
        return this._inputs[1];
    }
    /**
     * Gets the destination input component
     */
    get destination() {
        return this._inputs[2];
    }
    /**
     * Gets the camera input component
     */
    get camera() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this.output.value = this._frameGraphTask.outputTexture;
        const sourceConnectedPoint = this.source.connectedPoint;
        if (sourceConnectedPoint) {
            this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
        }
        const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;
        if (geomViewDepthConnectedPoint) {
            this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value;
        }
        const destinationConnectedPoint = this.destination.connectedPoint;
        if (destinationConnectedPoint) {
            this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
        }
        const cameraConnectedPoint = this.camera.connectedPoint;
        if (cameraConnectedPoint) {
            this._frameGraphTask.camera = cameraConnectedPoint.value;
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);
        codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);
        codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);
        codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);
        codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
        codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.lensSize = this.lensSize;
        serializationObject.fStop = this.fStop;
        serializationObject.focusDistance = this.focusDistance;
        serializationObject.focalLength = this.focalLength;
        serializationObject.sourceSamplingMode = this.sourceSamplingMode;
        serializationObject.depthSamplingMode = this.depthSamplingMode;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.lensSize = serializationObject.lensSize;
        this.fStop = serializationObject.fStop;
        this.focusDistance = serializationObject.focusDistance;
        this.focalLength = serializationObject.focalLength;
        this.sourceSamplingMode = serializationObject.sourceSamplingMode;
        this.depthSamplingMode = serializationObject.depthSamplingMode;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "sourceSamplingMode", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Depth sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "depthSamplingMode", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Lens size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "lensSize", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("F-Stop", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "fStop", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Focus distance", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "focusDistance", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Focal length", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "focalLength", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphCircleOfConfusionPostProcessBlock", NodeRenderGraphCircleOfConfusionPostProcessBlock);
//# sourceMappingURL=circleOfConfusionPostProcessBlock.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinDepthOfFieldMergePostProcess.js


/**
 * @internal
 */
class ThinDepthOfFieldMergePostProcess extends effectRenderer/* EffectWrapper */.$ {
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 89480)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 19411)));
        }
    }
    constructor(name, engine = null, options) {
        super({
            ...options,
            name,
            engine: engine || Engines_engine/* Engine */.N.LastCreatedEngine,
            useShaderStore: true,
            useAsPostProcess: true,
            fragmentShader: ThinDepthOfFieldMergePostProcess.FragmentUrl,
            samplers: ThinDepthOfFieldMergePostProcess.Samplers,
        });
    }
}
ThinDepthOfFieldMergePostProcess.FragmentUrl = "depthOfFieldMerge";
ThinDepthOfFieldMergePostProcess.Samplers = ["circleOfConfusionSampler", "blurStep0", "blurStep1", "blurStep2"];
//# sourceMappingURL=thinDepthOfFieldMergePostProcess.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js



/**
 * @internal
 */
class FrameGraphDepthOfFieldMergeTask extends FrameGraphPostProcessTask {
    constructor(name, frameGraph, thinPostProcess) {
        super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldMergePostProcess(name, frameGraph.engine));
        this.blurSteps = [];
    }
    record(skipCreationOfDisabledPasses = false) {
        if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined || this.blurSteps.length === 0) {
            throw new Error(`FrameGraphBloomMergeTask "${this.name}": sourceTexture, circleOfConfusionTexture and blurSteps are required`);
        }
        this.postProcess.updateEffect("#define BLUR_LEVEL " + (this.blurSteps.length - 1) + "\n");
        const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {
            context.bindTextureHandle(this._postProcessDrawWrapper.effect, "circleOfConfusionSampler", this.circleOfConfusionTexture);
            this.blurSteps.forEach((handle, index) => {
                if (index === this.blurSteps.length - 1) {
                    context.setTextureSamplingMode(handle, 2);
                }
                context.bindTextureHandle(this._postProcessDrawWrapper.effect, "blurStep" + (this.blurSteps.length - index - 1), handle);
            });
        });
        pass.useTexture(this.circleOfConfusionTexture);
        for (const handle of this.blurSteps) {
            pass.useTexture(handle);
        }
        return pass;
    }
}
//# sourceMappingURL=depthOfFieldMergeTask.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinDepthOfFieldBlurPostProcess.js

/**
 * @internal
 */
class ThinDepthOfFieldBlurPostProcess extends ThinBlurPostProcess {
    constructor(name, engine = null, direction, kernel, options) {
        super(name, engine, direction, kernel, {
            ...options,
            defines: `#define DOF 1\n`,
        });
    }
}
//# sourceMappingURL=thinDepthOfFieldBlurPostProcess.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js




/**
 * @internal
 */
class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {
    constructor(name, frameGraph, thinPostProcess) {
        super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldBlurPostProcess(name, frameGraph.engine, new math_vector/* Vector2 */.I9(1, 0), 10));
        this.circleOfConfusionSamplingMode = 2;
    }
    record(skipCreationOfDisabledPasses = false) {
        if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined) {
            throw new Error(`FrameGraphDepthOfFieldBlurTask "${this.name}": sourceTexture and circleOfConfusionTexture are required`);
        }
        const pass = super.record(skipCreationOfDisabledPasses, (context) => {
            context.setTextureSamplingMode(this.circleOfConfusionTexture, this.circleOfConfusionSamplingMode);
        }, (context) => {
            context.bindTextureHandle(this._postProcessDrawWrapper.effect, "circleOfConfusionSampler", this.circleOfConfusionTexture);
        });
        pass.useTexture(this.circleOfConfusionTexture);
        return pass;
    }
}
//# sourceMappingURL=depthOfFieldBlurTask.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinDepthOfFieldEffect.js




/**
 * Specifies the level of blur that should be applied when using the depth of field effect
 */
var ThinDepthOfFieldEffectBlurLevel;
(function (ThinDepthOfFieldEffectBlurLevel) {
    /**
     * Subtle blur
     */
    ThinDepthOfFieldEffectBlurLevel[ThinDepthOfFieldEffectBlurLevel["Low"] = 0] = "Low";
    /**
     * Medium blur
     */
    ThinDepthOfFieldEffectBlurLevel[ThinDepthOfFieldEffectBlurLevel["Medium"] = 1] = "Medium";
    /**
     * Large blur
     */
    ThinDepthOfFieldEffectBlurLevel[ThinDepthOfFieldEffectBlurLevel["High"] = 2] = "High";
})(ThinDepthOfFieldEffectBlurLevel || (ThinDepthOfFieldEffectBlurLevel = {}));
class ThinDepthOfFieldEffect {
    /**
     * The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)
     */
    set focalLength(value) {
        this._circleOfConfusion.focalLength = value;
    }
    get focalLength() {
        return this._circleOfConfusion.focalLength;
    }
    /**
     * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)
     */
    set fStop(value) {
        this._circleOfConfusion.fStop = value;
    }
    get fStop() {
        return this._circleOfConfusion.fStop;
    }
    /**
     * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)
     */
    set focusDistance(value) {
        this._circleOfConfusion.focusDistance = value;
    }
    get focusDistance() {
        return this._circleOfConfusion.focusDistance;
    }
    /**
     * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.
     */
    set lensSize(value) {
        this._circleOfConfusion.lensSize = value;
    }
    get lensSize() {
        return this._circleOfConfusion.lensSize;
    }
    /**
     * Creates a new instance of @see ThinDepthOfFieldEffect
     * @param name The name of the depth of field render effect
     * @param engine The engine which the render effect will be applied. (default: current engine)
     * @param blurLevel The quality of the effect. (default: DepthOfFieldEffectBlurLevel.Low)
     * @param depthNotNormalized If the (view) depth used in circle of confusion post-process is normalized (0.0 to 1.0 from near to far) or not (0 to camera max distance) (default: false)
     * @param blockCompilation If shaders should not be compiled when the effect is created (default: false)
     */
    constructor(name, engine, blurLevel = 0 /* ThinDepthOfFieldEffectBlurLevel.Low */, depthNotNormalized = false, blockCompilation = false) {
        /** @internal */
        this._depthOfFieldBlurX = [];
        /** @internal */
        this._depthOfFieldBlurY = [];
        this._circleOfConfusion = new ThinCircleOfConfusionPostProcess(name, engine, { depthNotNormalized, blockCompilation });
        this.blurLevel = blurLevel;
        let blurCount = 1;
        let kernelSize = 15;
        switch (blurLevel) {
            case 2 /* ThinDepthOfFieldEffectBlurLevel.High */: {
                blurCount = 3;
                kernelSize = 51;
                break;
            }
            case 1 /* ThinDepthOfFieldEffectBlurLevel.Medium */: {
                blurCount = 2;
                kernelSize = 31;
                break;
            }
            default: {
                kernelSize = 15;
                blurCount = 1;
                break;
            }
        }
        const adjustedKernelSize = kernelSize / Math.pow(2, blurCount - 1);
        let ratio = 1.0;
        for (let i = 0; i < blurCount; i++) {
            this._depthOfFieldBlurY.push([new ThinBlurPostProcess(name, engine, new math_vector/* Vector2 */.I9(0, 1), adjustedKernelSize, { blockCompilation }), ratio]);
            ratio = 0.75 / Math.pow(2, i);
            this._depthOfFieldBlurX.push([new ThinBlurPostProcess(name, engine, new math_vector/* Vector2 */.I9(1, 0), adjustedKernelSize, { blockCompilation }), ratio]);
        }
        this._dofMerge = new ThinDepthOfFieldMergePostProcess(name, engine, { blockCompilation });
    }
    /**
     * Checks if the effect is ready to be used
     * @returns if the effect is ready
     */
    isReady() {
        let isReady = this._circleOfConfusion.isReady() && this._dofMerge.isReady();
        for (let i = 0; i < this._depthOfFieldBlurX.length; i++) {
            isReady = isReady && this._depthOfFieldBlurX[i][0].isReady() && this._depthOfFieldBlurY[i][0].isReady();
        }
        return isReady;
    }
}
//# sourceMappingURL=thinDepthOfFieldEffect.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js






/**
 * Task which applies a depth of field effect.
 */
class FrameGraphDepthOfFieldTask extends frameGraphTask/* FrameGraphTask */.L {
    /**
     * The name of the task.
     */
    get name() {
        return this._name;
    }
    set name(name) {
        this._name = name;
        if (this._circleOfConfusion) {
            this._circleOfConfusion.name = `${name} Circle of Confusion`;
        }
        if (this._blurX) {
            for (let i = 0; i < this._blurX.length; i++) {
                this._blurX[i].name = `${name} Blur X`;
                this._blurY[i].name = `${name} Blur Y`;
            }
        }
        if (this._merge) {
            this._merge.name = `${name} Merge`;
        }
    }
    /**
     * Constructs a depth of field task.
     * @param name The name of the task.
     * @param frameGraph The frame graph this task belongs to.
     * @param engine The engine to use for the depth of field effect.
     * @param blurLevel The blur level of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low).
     * @param hdr Whether the depth of field effect is HDR.
     */
    constructor(name, frameGraph, engine, blurLevel = 0 /* ThinDepthOfFieldEffectBlurLevel.Low */, hdr = false) {
        super(name, frameGraph);
        /**
         * The sampling mode to use for the source texture.
         */
        this.sourceSamplingMode = 2;
        /**
         * The sampling mode to use for the depth texture.
         */
        this.depthSamplingMode = 2;
        this._blurX = [];
        this._blurY = [];
        this._engine = engine;
        this.hdr = hdr;
        this._defaultPipelineTextureType = 0;
        if (hdr) {
            const caps = engine.getCaps();
            if (caps.textureHalfFloatRender) {
                this._defaultPipelineTextureType = 2;
            }
            else if (caps.textureFloatRender) {
                this._defaultPipelineTextureType = 1;
            }
        }
        this.depthOfField = new ThinDepthOfFieldEffect(name, engine, blurLevel, true);
        this._circleOfConfusion = new FrameGraphCircleOfConfusionTask(`${name} Circle of Confusion`, this._frameGraph, this.depthOfField._circleOfConfusion);
        const blurCount = this.depthOfField._depthOfFieldBlurX.length;
        for (let i = 0; i < blurCount; i++) {
            this._blurX.push(new FrameGraphDepthOfFieldBlurTask(`${name} Blur X`, this._frameGraph, this.depthOfField._depthOfFieldBlurX[i][0]));
            this._blurY.push(new FrameGraphDepthOfFieldBlurTask(`${name} Blur Y`, this._frameGraph, this.depthOfField._depthOfFieldBlurY[i][0]));
        }
        this._merge = new FrameGraphDepthOfFieldMergeTask(`${name} Merge`, this._frameGraph, this.depthOfField._dofMerge);
        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
    }
    isReady() {
        return this.depthOfField.isReady();
    }
    record() {
        if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {
            throw new Error("FrameGraphDepthOfFieldTask: sourceTexture, depthTexture and camera are required");
        }
        const sourceTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);
        const textureSize = {
            width: sourceTextureDescription.size.width,
            height: sourceTextureDescription.size.height,
        };
        const circleOfConfusionTextureFormat = this._engine.isWebGPU || this._engine.version > 1 ? 6 : 5;
        const textureCreationOptions = {
            size: textureSize,
            options: {
                createMipMaps: false,
                types: [this._defaultPipelineTextureType],
                formats: [circleOfConfusionTextureFormat],
                samples: 1,
                useSRGBBuffers: [false],
                labels: [""],
            },
            sizeIsPercentage: false,
        };
        const circleOfConfusionTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._circleOfConfusion.name, textureCreationOptions);
        this._circleOfConfusion.sourceTexture = this.sourceTexture; // texture not used by the CoC shader
        this._circleOfConfusion.depthTexture = this.depthTexture;
        this._circleOfConfusion.depthSamplingMode = this.depthSamplingMode;
        this._circleOfConfusion.camera = this.camera;
        this._circleOfConfusion.destinationTexture = circleOfConfusionTextureHandle;
        this._circleOfConfusion.record(true);
        textureCreationOptions.options.formats = [5];
        const blurSteps = [];
        for (let i = 0; i < this._blurX.length; i++) {
            const ratio = this.depthOfField._depthOfFieldBlurX[i][1];
            textureSize.width = Math.floor(sourceTextureDescription.size.width * ratio);
            textureSize.height = Math.floor(sourceTextureDescription.size.height * ratio);
            textureCreationOptions.options.labels[0] = "step " + (i + 1);
            const blurYTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurY[i].name, textureCreationOptions);
            this._blurY[i].sourceTexture = i === 0 ? this.sourceTexture : this._blurX[i - 1].outputTexture;
            this._blurY[i].sourceSamplingMode = 2;
            this._blurY[i].circleOfConfusionTexture = circleOfConfusionTextureHandle;
            this._blurY[i].destinationTexture = blurYTextureHandle;
            this._blurY[i].record(true);
            const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX[i].name, textureCreationOptions);
            this._blurX[i].sourceTexture = this._blurY[i].outputTexture;
            this._blurX[i].sourceSamplingMode = 2;
            this._blurX[i].circleOfConfusionTexture = circleOfConfusionTextureHandle;
            this._blurX[i].destinationTexture = blurXTextureHandle;
            this._blurX[i].record(true);
            blurSteps.push(blurXTextureHandle);
        }
        const sourceTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);
        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture, this._merge.name, sourceTextureCreationOptions);
        this._merge.sourceTexture = this.sourceTexture;
        this._merge.sourceSamplingMode = this.sourceSamplingMode;
        this._merge.circleOfConfusionTexture = circleOfConfusionTextureHandle;
        this._merge.blurSteps = blurSteps;
        this._merge.destinationTexture = this.outputTexture;
        this._merge.record(true);
        const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
        passDisabled.setRenderTarget(this.outputTexture);
        passDisabled.setExecuteFunc((context) => {
            context.copyTexture(this.sourceTexture);
        });
    }
    dispose() {
        this._circleOfConfusion.dispose();
        for (let i = 0; i < this._blurX.length; i++) {
            this._blurX[i].dispose();
            this._blurY[i].dispose();
        }
        this._merge.dispose();
        super.dispose();
    }
}
//# sourceMappingURL=depthOfFieldTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js






/**
 * Block that implements the depth of field post process
 */
class NodeRenderGraphDepthOfFieldPostProcessBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphDepthOfFieldPostProcessBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     * @param blurLevel The quality of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low)
     * @param hdr If high dynamic range textures should be used (default: false)
     */
    constructor(name, frameGraph, scene, blurLevel = 0 /* ThinDepthOfFieldEffectBlurLevel.Low */, hdr = false) {
        super(name, frameGraph, scene);
        this._additionalConstructionParameters = [blurLevel, hdr];
        this.registerInput("source", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerInput("geomViewDepth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureViewDepth);
        this.registerInput("destination", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture, true);
        this.registerInput("camera", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Camera);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.source.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer);
        this.destination.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll);
        this.output._typeConnectionSource = () => {
            return this.destination.isConnected ? this.destination : this.source;
        };
        this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, scene.getEngine(), blurLevel, hdr);
    }
    _createTask(blurLevel, hdr) {
        const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;
        const depthSamplingMode = this._frameGraphTask.depthSamplingMode;
        const focalLength = this._frameGraphTask.depthOfField.focalLength;
        const fStop = this._frameGraphTask.depthOfField.fStop;
        const focusDistance = this._frameGraphTask.depthOfField.focusDistance;
        const lensSize = this._frameGraphTask.depthOfField.lensSize;
        this._frameGraphTask.dispose();
        this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, this._scene.getEngine(), blurLevel, hdr);
        this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;
        this._frameGraphTask.depthSamplingMode = depthSamplingMode;
        this._frameGraphTask.depthOfField.focalLength = focalLength;
        this._frameGraphTask.depthOfField.fStop = fStop;
        this._frameGraphTask.depthOfField.focusDistance = focusDistance;
        this._frameGraphTask.depthOfField.lensSize = lensSize;
        this._additionalConstructionParameters = [blurLevel, hdr];
    }
    /** The quality of the blur effect */
    get blurLevel() {
        return this._frameGraphTask.depthOfField.blurLevel;
    }
    set blurLevel(value) {
        this._createTask(value, this._frameGraphTask.hdr);
    }
    /** If high dynamic range textures should be used */
    get hdr() {
        return this._frameGraphTask.hdr;
    }
    set hdr(value) {
        this._createTask(this._frameGraphTask.depthOfField.blurLevel, value);
    }
    /** Sampling mode used to sample from the source texture */
    get sourceSamplingMode() {
        return this._frameGraphTask.sourceSamplingMode;
    }
    set sourceSamplingMode(value) {
        this._frameGraphTask.sourceSamplingMode = value;
    }
    /** Sampling mode used to sample from the depth texture */
    get depthSamplingMode() {
        return this._frameGraphTask.depthSamplingMode;
    }
    set depthSamplingMode(value) {
        this._frameGraphTask.depthSamplingMode = value;
    }
    /** The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter). */
    get focalLength() {
        return this._frameGraphTask.depthOfField.focalLength;
    }
    set focalLength(value) {
        this._frameGraphTask.depthOfField.focalLength = value;
    }
    /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. */
    get fStop() {
        return this._frameGraphTask.depthOfField.fStop;
    }
    set fStop(value) {
        this._frameGraphTask.depthOfField.fStop = value;
    }
    /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter). */
    get focusDistance() {
        return this._frameGraphTask.depthOfField.focusDistance;
    }
    set focusDistance(value) {
        this._frameGraphTask.depthOfField.focusDistance = value;
    }
    /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */
    get lensSize() {
        return this._frameGraphTask.depthOfField.lensSize;
    }
    set lensSize(value) {
        this._frameGraphTask.depthOfField.lensSize = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphDepthOfFieldPostProcessBlock";
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[0];
    }
    /**
     * Gets the geometry view depth input component
     */
    get geomViewDepth() {
        return this._inputs[1];
    }
    /**
     * Gets the destination input component
     */
    get destination() {
        return this._inputs[2];
    }
    /**
     * Gets the camera input component
     */
    get camera() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this.output.value = this._frameGraphTask.outputTexture;
        const sourceConnectedPoint = this.source.connectedPoint;
        if (sourceConnectedPoint) {
            this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
        }
        const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;
        if (geomViewDepthConnectedPoint) {
            this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value;
        }
        const destinationConnectedPoint = this.destination.connectedPoint;
        if (destinationConnectedPoint) {
            this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
        }
        const cameraConnectedPoint = this.camera.connectedPoint;
        if (cameraConnectedPoint) {
            this._frameGraphTask.camera = cameraConnectedPoint.value;
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);
        codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);
        codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);
        codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);
        codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
        codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.lensSize = this.lensSize;
        serializationObject.fStop = this.fStop;
        serializationObject.focusDistance = this.focusDistance;
        serializationObject.focalLength = this.focalLength;
        serializationObject.sourceSamplingMode = this.sourceSamplingMode;
        serializationObject.depthSamplingMode = this.depthSamplingMode;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.lensSize = serializationObject.lensSize;
        this.fStop = serializationObject.fStop;
        this.focusDistance = serializationObject.focusDistance;
        this.focalLength = serializationObject.focalLength;
        this.sourceSamplingMode = serializationObject.sourceSamplingMode;
        this.depthSamplingMode = serializationObject.depthSamplingMode;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Blur level", 4 /* PropertyTypeForEdition.List */, "PROPERTIES", {
        options: [
            { label: "Low", value: 0 /* ThinDepthOfFieldEffectBlurLevel.Low */ },
            { label: "Medium", value: 1 /* ThinDepthOfFieldEffectBlurLevel.Medium */ },
            { label: "High", value: 2 /* ThinDepthOfFieldEffectBlurLevel.High */ },
        ],
    })
], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "blurLevel", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("HDR", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "hdr", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "sourceSamplingMode", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Depth sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "depthSamplingMode", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Focal length", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "focalLength", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("F-Stop", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "fStop", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Focus distance", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "focusDistance", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Lens size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "lensSize", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphDepthOfFieldPostProcessBlock", NodeRenderGraphDepthOfFieldPostProcessBlock);
//# sourceMappingURL=depthOfFieldPostProcessBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js







/**
 * Block that implements the extract highlights post process
 */
class NodeRenderGraphExtractHighlightsPostProcessBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new ExtractHighlightsPostProcessBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("source", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerInput("destination", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture, true);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.source.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer);
        this.destination.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll);
        this.output._typeConnectionSource = () => {
            return this.destination.isConnected ? this.destination : this.source;
        };
        this._frameGraphTask = new FrameGraphExtractHighlightsTask(this.name, frameGraph, new ThinExtractHighlightsPostProcess(name, scene.getEngine()));
    }
    /** Sampling mode used to sample from the source texture */
    get sourceSamplingMode() {
        return this._frameGraphTask.sourceSamplingMode;
    }
    set sourceSamplingMode(value) {
        this._frameGraphTask.sourceSamplingMode = value;
    }
    /** The luminance threshold, pixels below this value will be set to black. */
    get threshold() {
        return this._frameGraphTask.postProcess.threshold;
    }
    set threshold(value) {
        this._frameGraphTask.postProcess.threshold = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphExtractHighlightsPostProcessBlock";
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[0];
    }
    /**
     * Gets the destination input component
     */
    get destination() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
        const sourceConnectedPoint = this.source.connectedPoint;
        if (sourceConnectedPoint) {
            this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
        }
        const destinationConnectedPoint = this.destination.connectedPoint;
        if (destinationConnectedPoint) {
            this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);
        codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.threshold = this.threshold;
        serializationObject.sourceSamplingMode = this.sourceSamplingMode;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.threshold = serializationObject.threshold;
        this.sourceSamplingMode = serializationObject.sourceSamplingMode;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
], NodeRenderGraphExtractHighlightsPostProcessBlock.prototype, "sourceSamplingMode", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Threshold", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 1 })
], NodeRenderGraphExtractHighlightsPostProcessBlock.prototype, "threshold", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphExtractHighlightsPostProcessBlock", NodeRenderGraphExtractHighlightsPostProcessBlock);
//# sourceMappingURL=extractHighlightsPostProcessBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/Rendering/cullObjectsTask.js

/**
 * Task used to cull objects that are not visible.
 */
class FrameGraphCullObjectsTask extends frameGraphTask/* FrameGraphTask */.L {
    /**
     * Creates a new cull objects task.
     * @param name The name of the task.
     * @param frameGraph The frame graph the task belongs to.
     * @param scene The scene to cull objects from.
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph);
        this._scene = scene;
        this.outputObjectList = {
            meshes: [],
            particleSystems: [],
        };
    }
    record() {
        if (this.objectList === undefined || this.camera === undefined) {
            throw new Error(`FrameGraphCullObjectsTask ${this.name}: objectList and camera are required`);
        }
        const pass = this._frameGraph.addCullPass(this.name);
        pass.setObjectList(this.outputObjectList);
        pass.setExecuteFunc((_context) => {
            this.outputObjectList.meshes = [];
            this.camera._updateFrustumPlanes();
            const frustumPlanes = this.camera._frustumPlanes;
            const meshes = this.objectList.meshes || this._scene.meshes;
            for (let i = 0; i < meshes.length; i++) {
                const mesh = meshes[i];
                if (mesh.isBlocked || !mesh.isReady() || !mesh.isEnabled() || mesh.scaling.hasAZeroComponent) {
                    continue;
                }
                if (mesh.isVisible &&
                    mesh.visibility > 0 &&
                    (mesh.layerMask & this.camera.layerMask) !== 0 &&
                    (this._scene.skipFrustumClipping || mesh.alwaysSelectAsActiveMesh || mesh.isInFrustum(frustumPlanes))) {
                    this.outputObjectList.meshes.push(mesh);
                }
            }
        });
        const passDisabled = this._frameGraph.addCullPass(this.name + "_disabled", true);
        passDisabled.setObjectList(this.outputObjectList);
        passDisabled.setExecuteFunc((_context) => {
            this.outputObjectList.meshes = this.objectList.meshes;
            this.outputObjectList.particleSystems = this.objectList.particleSystems;
        });
    }
}
//# sourceMappingURL=cullObjectsTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js




/**
 * Block that culls a list of objects
 */
class NodeRenderGraphCullObjectsBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphCullObjectsBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("camera", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Camera);
        this.registerInput("objects", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.ObjectList);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.ObjectList);
        this._frameGraphTask = new FrameGraphCullObjectsTask(this.name, frameGraph, scene);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphCullObjectsBlock";
    }
    /**
     * Gets the camera input component
     */
    get camera() {
        return this._inputs[0];
    }
    /**
     * Gets the objects input component
     */
    get objects() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this.output.value = this._frameGraphTask.outputObjectList;
        const cameraConnectedPoint = this.camera.connectedPoint;
        if (cameraConnectedPoint) {
            this._frameGraphTask.camera = cameraConnectedPoint.value;
        }
        const objectsConnectedPoint = this.objects.connectedPoint;
        if (objectsConnectedPoint) {
            this._frameGraphTask.objectList = objectsConnectedPoint.value;
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphCullObjectsBlock", NodeRenderGraphCullObjectsBlock);
//# sourceMappingURL=cullObjectsBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialHelper.geometryrendering.js
var materialHelper_geometryrendering = __webpack_require__(18598);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Rendering/objectRenderer.js
var objectRenderer = __webpack_require__(81283);
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/Rendering/geometryRendererTask.js






const clearColors = [new math_color/* Color4 */.ov(0, 0, 0, 0), new math_color/* Color4 */.ov(1, 1, 1, 1), new math_color/* Color4 */.ov(1e8, 1e8, 1e8, 1e8)];
/**
 * Task used to render geometry to a set of textures.
 */
class FrameGraphGeometryRendererTask extends frameGraphTask/* FrameGraphTask */.L {
    /**
     * Gets or sets the camera used for rendering.
     */
    get camera() {
        return this._camera;
    }
    set camera(camera) {
        this._camera = camera;
        this._renderer.activeCamera = this.camera;
    }
    /**
     * The object renderer used by the geometry renderer task.
     */
    get objectRenderer() {
        return this._renderer;
    }
    /**
     * Gets or sets the name of the task.
     */
    get name() {
        return this._name;
    }
    set name(value) {
        this._name = value;
        if (this._renderer) {
            this._renderer.name = value;
        }
    }
    /**
     * Constructs a new geometry renderer task.
     * @param name The name of the task.
     * @param frameGraph The frame graph the task belongs to.
     * @param scene The scene the frame graph is associated with.
     * @param options The options of the object renderer.
     */
    constructor(name, frameGraph, scene, options) {
        super(name, frameGraph);
        /**
         * Whether depth testing is enabled (default is true).
         */
        this.depthTest = true;
        /**
         * Whether depth writing is enabled (default is true).
         */
        this.depthWrite = true;
        /**
         * The size of the output textures (default is 100% of the back buffer texture size).
         */
        this.size = { width: 100, height: 100 };
        /**
         * Whether the size is a percentage of the back buffer size (default is true).
         */
        this.sizeIsPercentage = true;
        /**
         * The number of samples to use for the output textures (default is 1).
         */
        this.samples = 1;
        /**
         * The list of texture descriptions used by the geometry renderer task.
         */
        this.textureDescriptions = [];
        this._scene = scene;
        this._engine = this._scene.getEngine();
        this._renderer = new objectRenderer/* ObjectRenderer */.P(name, scene, options);
        this._renderer.renderSprites = false;
        this._renderer.renderParticles = false;
        this._renderer.onBeforeRenderingManagerRenderObservable.add(() => {
            if (!this._renderer.options.doNotChangeAspectRatio) {
                scene.updateTransformMatrix(true);
            }
        });
        this.name = name;
        this._clearAttachmentsLayout = new Map();
        this._allAttachmentsLayout = [];
        this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryViewDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryScreenDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryViewNormalTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryWorldNormalTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryLocalPositionTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryWorldPositionTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryAlbedoTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryReflectivityTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryVelocityTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.geometryLinearVelocityTexture = this._frameGraph.textureManager.createDanglingHandle();
    }
    /**
     * Gets the list of excluded meshes from the velocity texture.
     */
    get excludedSkinnedMeshFromVelocityTexture() {
        return materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.GetConfiguration(this._renderer.renderPassId).excludedSkinnedMesh;
    }
    isReady() {
        return this._renderer.isReadyForRendering(this._textureWidth, this._textureHeight);
    }
    record() {
        if (this.textureDescriptions.length === 0 || this.objectList === undefined) {
            throw new Error(`FrameGraphGeometryRendererTask ${this.name}: object list and at least one geometry texture description must be provided`);
        }
        const outputTextureHandle = this._createMultiRenderTargetTexture();
        const depthEnabled = this._checkDepthTextureCompatibility();
        this._buildClearAttachmentsLayout();
        this._registerForRenderPassId(this._renderer.renderPassId);
        const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(outputTextureHandle[0]);
        this._textureWidth = outputTextureDescription.size.width;
        this._textureHeight = outputTextureDescription.size.height;
        // Create pass
        materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.MarkAsDirty(this._renderer.renderPassId, this.objectList.meshes || this._scene.meshes);
        const pass = this._frameGraph.addRenderPass(this.name);
        pass.setRenderTarget(outputTextureHandle);
        for (let i = 0; i < this.textureDescriptions.length; i++) {
            const description = this.textureDescriptions[i];
            const handle = outputTextureHandle[i];
            const index = materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);
            const geometryDescription = materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.GeometryTextureDescriptions[index];
            switch (geometryDescription.type) {
                case 5:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryViewDepthTexture, handle);
                    break;
                case 10:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryScreenDepthTexture, handle);
                    break;
                case 6:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryViewNormalTexture, handle);
                    break;
                case 8:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryWorldNormalTexture, handle);
                    break;
                case 9:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryLocalPositionTexture, handle);
                    break;
                case 1:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryWorldPositionTexture, handle);
                    break;
                case 12:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryAlbedoTexture, handle);
                    break;
                case 3:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryReflectivityTexture, handle);
                    break;
                case 2:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryVelocityTexture, handle);
                    break;
                case 11:
                    this._frameGraph.textureManager.resolveDanglingHandle(this.geometryLinearVelocityTexture, handle);
                    break;
            }
        }
        pass.setRenderTargetDepth(this.depthTexture);
        pass.setExecuteFunc((context) => {
            this._renderer.renderList = this.objectList.meshes;
            this._renderer.particleSystemList = this.objectList.particleSystems;
            context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);
            this._clearAttachmentsLayout.forEach((layout, clearType) => {
                context.clearColorAttachments(clearColors[clearType], layout);
            });
            context.bindAttachments(this._allAttachmentsLayout);
            context.render(this._renderer, this._textureWidth, this._textureHeight);
        });
    }
    dispose() {
        materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.DeleteConfiguration(this._renderer.renderPassId);
        this._renderer.dispose();
        super.dispose();
    }
    _createMultiRenderTargetTexture() {
        const types = [];
        const formats = [];
        const labels = [];
        const useSRGBBuffers = [];
        for (let i = 0; i < this.textureDescriptions.length; i++) {
            const description = this.textureDescriptions[i];
            const index = materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);
            if (index === -1) {
                throw new Error(`FrameGraphGeometryRendererTask ${this.name}: unknown texture type ${description.type}`);
            }
            types[i] = description.textureType;
            formats[i] = description.textureFormat;
            labels[i] = materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.GeometryTextureDescriptions[index].name;
            useSRGBBuffers[i] = false;
        }
        const baseHandle = this._frameGraph.textureManager.createRenderTargetTexture(this.name, {
            size: this.size,
            sizeIsPercentage: this.sizeIsPercentage,
            options: {
                createMipMaps: false,
                samples: this.samples,
                types,
                formats,
                useSRGBBuffers,
                labels,
            },
        });
        const handles = [];
        for (let i = 0; i < this.textureDescriptions.length; i++) {
            handles.push(baseHandle + i);
        }
        return handles;
    }
    _checkDepthTextureCompatibility() {
        let depthEnabled = false;
        if (this.depthTexture !== undefined) {
            if (this.depthTexture === backbufferDepthStencilTextureHandle) {
                throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth/stencil back buffer is not allowed as a depth texture`);
            }
            const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);
            if (depthTextureDescription.options.samples !== this.samples) {
                throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);
            }
            this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);
            depthEnabled = true;
        }
        return depthEnabled;
    }
    _buildClearAttachmentsLayout() {
        const clearAttachmentsLayout = new Map();
        const allAttachmentsLayout = [];
        for (let i = 0; i < this.textureDescriptions.length; i++) {
            const description = this.textureDescriptions[i];
            const index = materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);
            const geometryDescription = materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.GeometryTextureDescriptions[index];
            let layout = clearAttachmentsLayout.get(geometryDescription.clearType);
            if (layout === undefined) {
                layout = [];
                clearAttachmentsLayout.set(geometryDescription.clearType, layout);
                for (let j = 0; j < i; j++) {
                    layout[j] = false;
                }
            }
            clearAttachmentsLayout.forEach((layout, clearType) => {
                layout.push(clearType === geometryDescription.clearType);
            });
            allAttachmentsLayout.push(true);
        }
        this._clearAttachmentsLayout = new Map();
        clearAttachmentsLayout.forEach((layout, clearType) => {
            this._clearAttachmentsLayout.set(clearType, this._engine.buildTextureLayout(layout));
        });
        this._allAttachmentsLayout = this._engine.buildTextureLayout(allAttachmentsLayout);
    }
    _registerForRenderPassId(renderPassId) {
        const configuration = materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.CreateConfiguration(renderPassId);
        for (let i = 0; i < this.textureDescriptions.length; i++) {
            const description = this.textureDescriptions[i];
            const index = materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);
            const geometryDescription = materialHelper_geometryrendering/* MaterialHelperGeometryRendering */.m.GeometryTextureDescriptions[index];
            configuration.defines[geometryDescription.defineIndex] = i;
        }
    }
}
//# sourceMappingURL=geometryRendererTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js







/**
 * Block that render geometry of objects to a multi render target
 */
class NodeRenderGraphGeometryRendererBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphGeometryRendererBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     * @param doNotChangeAspectRatio True (default) to not change the aspect ratio of the scene in the RTT
     */
    constructor(name, frameGraph, scene, doNotChangeAspectRatio = true) {
        super(name, frameGraph, scene);
        // View depth
        this.viewDepthFormat = 6;
        this.viewDepthType = 2;
        // Screen depth
        this.screenDepthFormat = 6;
        this.screenDepthType = 2;
        // View normal
        this.viewNormalFormat = 5;
        this.viewNormalType = 0;
        // World normal
        this.worldNormalFormat = 5;
        this.worldNormalType = 0;
        // Local position
        this.localPositionFormat = 5;
        this.localPositionType = 2;
        // World Position
        this.worldPositionFormat = 5;
        this.worldPositionType = 2;
        // Albedo
        this.albedoFormat = 5;
        this.albedoType = 0;
        // Reflectivity
        this.reflectivityFormat = 5;
        this.reflectivityType = 0;
        // Velocity
        this.velocityFormat = 5;
        this.velocityType = 0;
        // Linear velocity
        this.linearVelocityFormat = 5;
        this.linearVelocityType = 0;
        this._additionalConstructionParameters = [doNotChangeAspectRatio];
        this.registerInput("depth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureBackBufferDepthStencilAttachment, true);
        this.registerInput("camera", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Camera);
        this.registerInput("objects", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.ObjectList);
        this.registerOutput("outputDepth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.registerOutput("geomViewDepth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureViewDepth);
        this.registerOutput("geomScreenDepth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureScreenDepth);
        this.registerOutput("geomViewNormal", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureViewNormal);
        this.registerOutput("geomWorldNormal", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureViewNormal);
        this.registerOutput("geomLocalPosition", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureLocalPosition);
        this.registerOutput("geomWorldPosition", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureWorldPosition);
        this.registerOutput("geomAlbedo", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAlbedo);
        this.registerOutput("geomReflectivity", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureReflectivity);
        this.registerOutput("geomVelocity", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureVelocity);
        this.registerOutput("geomLinearVelocity", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureLinearVelocity);
        this.depth.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureDepthStencilAttachment);
        this.outputDepth._typeConnectionSource = this.depth;
        this._frameGraphTask = new FrameGraphGeometryRendererTask(this.name, frameGraph, scene, { doNotChangeAspectRatio });
    }
    /** Indicates if depth testing must be enabled or disabled */
    get depthTest() {
        return this._frameGraphTask.depthTest;
    }
    set depthTest(value) {
        this._frameGraphTask.depthTest = value;
    }
    /** Indicates if depth writing must be enabled or disabled */
    get depthWrite() {
        return this._frameGraphTask.depthWrite;
    }
    set depthWrite(value) {
        this._frameGraphTask.depthWrite = value;
    }
    /** True (default) to not change the aspect ratio of the scene in the RTT */
    get doNotChangeAspectRatio() {
        return this._frameGraphTask.objectRenderer.options.doNotChangeAspectRatio;
    }
    set doNotChangeAspectRatio(value) {
        this._frameGraphTask.dispose();
        this._frameGraphTask = new FrameGraphGeometryRendererTask(this.name, this._frameGraph, this._scene, { doNotChangeAspectRatio: value });
        this._additionalConstructionParameters = [value];
    }
    /** Width of the geometry texture */
    get width() {
        return this._frameGraphTask.size.width;
    }
    set width(value) {
        this._frameGraphTask.size.width = value;
    }
    /** Height of the geometry texture */
    get height() {
        return this._frameGraphTask.size.height;
    }
    set height(value) {
        this._frameGraphTask.size.height = value;
    }
    /** Indicates if the geometry texture width and height are percentages or absolute values */
    get sizeInPercentage() {
        return this._frameGraphTask.sizeIsPercentage;
    }
    set sizeInPercentage(value) {
        this._frameGraphTask.sizeIsPercentage = value;
    }
    /** Number of samples of the geometry texture */
    get samples() {
        return this._frameGraphTask.samples;
    }
    set samples(value) {
        this._frameGraphTask.samples = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphGeometryRendererBlock";
    }
    /**
     * Gets the depth texture input component
     */
    get depth() {
        return this._inputs[0];
    }
    /**
     * Gets the camera input component
     */
    get camera() {
        return this._inputs[1];
    }
    /**
     * Gets the objects input component
     */
    get objects() {
        return this._inputs[2];
    }
    /**
     * Gets the output depth component
     */
    get outputDepth() {
        return this._outputs[0];
    }
    /**
     * Gets the geometry view depth component
     */
    get geomViewDepth() {
        return this._outputs[1];
    }
    /**
     * Gets the geometry screen depth component
     */
    get geomScreenDepth() {
        return this._outputs[2];
    }
    /**
     * Gets the geometry view normal component
     */
    get geomViewNormal() {
        return this._outputs[3];
    }
    /**
     * Gets the world geometry normal component
     */
    get geomWorldNormal() {
        return this._outputs[4];
    }
    /**
     * Gets the geometry local position component
     */
    get geomLocalPosition() {
        return this._outputs[5];
    }
    /**
     * Gets the geometry world position component
     */
    get geomWorldPosition() {
        return this._outputs[6];
    }
    /**
     * Gets the geometry albedo component
     */
    get geomAlbedo() {
        return this._outputs[7];
    }
    /**
     * Gets the geometry reflectivity component
     */
    get geomReflectivity() {
        return this._outputs[8];
    }
    /**
     * Gets the geometry velocity component
     */
    get geomVelocity() {
        return this._outputs[9];
    }
    /**
     * Gets the geometry linear velocity component
     */
    get geomLinearVelocity() {
        return this._outputs[10];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const textureActivation = [
            this.geomViewDepth.isConnected,
            this.geomScreenDepth.isConnected,
            this.geomViewNormal.isConnected,
            this.geomWorldNormal.isConnected,
            this.geomLocalPosition.isConnected,
            this.geomWorldPosition.isConnected,
            this.geomAlbedo.isConnected,
            this.geomReflectivity.isConnected,
            this.geomVelocity.isConnected,
            this.geomLinearVelocity.isConnected,
        ];
        if (textureActivation.every((t) => !t)) {
            throw new Error("NodeRenderGraphGeometryRendererBlock: At least one output geometry buffer must be connected");
        }
        this._frameGraphTask.name = this.name;
        this.outputDepth.value = this._frameGraphTask.outputDepthTexture;
        this.geomViewDepth.value = this._frameGraphTask.geometryViewDepthTexture;
        this.geomScreenDepth.value = this._frameGraphTask.geometryScreenDepthTexture;
        this.geomViewNormal.value = this._frameGraphTask.geometryViewNormalTexture;
        this.geomWorldNormal.value = this._frameGraphTask.geometryWorldNormalTexture;
        this.geomLocalPosition.value = this._frameGraphTask.geometryLocalPositionTexture;
        this.geomWorldPosition.value = this._frameGraphTask.geometryWorldPositionTexture;
        this.geomAlbedo.value = this._frameGraphTask.geometryAlbedoTexture;
        this.geomReflectivity.value = this._frameGraphTask.geometryReflectivityTexture;
        this.geomVelocity.value = this._frameGraphTask.geometryVelocityTexture;
        this.geomLinearVelocity.value = this._frameGraphTask.geometryLinearVelocityTexture;
        const depthConnectedPoint = this.depth.connectedPoint;
        if (depthConnectedPoint) {
            this._frameGraphTask.depthTexture = depthConnectedPoint.value;
        }
        const cameraConnectedPoint = this.camera.connectedPoint;
        if (cameraConnectedPoint) {
            this._frameGraphTask.camera = cameraConnectedPoint.value;
        }
        const objectsConnectedPoint = this.objects.connectedPoint;
        if (objectsConnectedPoint) {
            this._frameGraphTask.objectList = objectsConnectedPoint.value;
        }
        this._frameGraphTask.textureDescriptions = [];
        const textureFormats = [
            this.viewDepthFormat,
            this.screenDepthFormat,
            this.viewNormalFormat,
            this.worldNormalFormat,
            this.localPositionFormat,
            this.worldPositionFormat,
            this.albedoFormat,
            this.reflectivityFormat,
            this.velocityFormat,
            this.linearVelocityFormat,
        ];
        const textureTypes = [
            this.viewDepthType,
            this.screenDepthType,
            this.viewNormalType,
            this.worldNormalType,
            this.localPositionType,
            this.worldPositionType,
            this.albedoType,
            this.reflectivityType,
            this.velocityType,
            this.linearVelocityType,
        ];
        const bufferTypes = [
            5,
            10,
            6,
            8,
            9,
            1,
            12,
            3,
            2,
            11,
        ];
        for (let i = 0; i < textureActivation.length; i++) {
            if (textureActivation[i]) {
                this._frameGraphTask.textureDescriptions.push({
                    textureFormat: textureFormats[i],
                    textureType: textureTypes[i],
                    type: bufferTypes[i],
                });
            }
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);
        codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);
        codes.push(`${this._codeVariableName}.samples = ${this.samples};`);
        codes.push(`${this._codeVariableName}.viewDepthFormat = ${this.viewDepthFormat};`);
        codes.push(`${this._codeVariableName}.viewDepthType = ${this.viewDepthType};`);
        codes.push(`${this._codeVariableName}.screenDepthFormat = ${this.screenDepthFormat};`);
        codes.push(`${this._codeVariableName}.screenDepthType = ${this.screenDepthType};`);
        codes.push(`${this._codeVariableName}.localPositionFormat = ${this.localPositionFormat};`);
        codes.push(`${this._codeVariableName}.localPositionType = ${this.localPositionType};`);
        codes.push(`${this._codeVariableName}.worldPositionFormat = ${this.worldPositionFormat};`);
        codes.push(`${this._codeVariableName}.worldPositionType = ${this.worldPositionType};`);
        codes.push(`${this._codeVariableName}.viewNormalFormat = ${this.viewNormalFormat};`);
        codes.push(`${this._codeVariableName}.viewNormalType = ${this.viewNormalType};`);
        codes.push(`${this._codeVariableName}.worldNormalFormat = ${this.worldNormalFormat};`);
        codes.push(`${this._codeVariableName}.worldNormalType = ${this.worldNormalType};`);
        codes.push(`${this._codeVariableName}.albedoFormat = ${this.albedoFormat};`);
        codes.push(`${this._codeVariableName}.albedoType = ${this.albedoType};`);
        codes.push(`${this._codeVariableName}.reflectivityFormat = ${this.reflectivityFormat};`);
        codes.push(`${this._codeVariableName}.reflectivityType = ${this.reflectivityType};`);
        codes.push(`${this._codeVariableName}.velocityFormat = ${this.velocityFormat};`);
        codes.push(`${this._codeVariableName}.velocityType = ${this.velocityType};`);
        codes.push(`${this._codeVariableName}.linearVelocityFormat = ${this.linearVelocityFormat};`);
        codes.push(`${this._codeVariableName}.linearVelocityType = ${this.linearVelocityType};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.depthTest = this.depthTest;
        serializationObject.depthWrite = this.depthWrite;
        serializationObject.samples = this.samples;
        serializationObject.viewDepthFormat = this.viewDepthFormat;
        serializationObject.viewDepthType = this.viewDepthType;
        serializationObject.screenDepthFormat = this.screenDepthFormat;
        serializationObject.screenDepthType = this.screenDepthType;
        serializationObject.localPositionFormat = this.localPositionFormat;
        serializationObject.localPositionType = this.localPositionType;
        serializationObject.worldPositionFormat = this.worldPositionFormat;
        serializationObject.worldPositionType = this.worldPositionType;
        serializationObject.viewNormalFormat = this.viewNormalFormat;
        serializationObject.viewNormalType = this.viewNormalType;
        serializationObject.worldNormalFormat = this.worldNormalFormat;
        serializationObject.worldNormalType = this.worldNormalType;
        serializationObject.albedoFormat = this.albedoFormat;
        serializationObject.albedoType = this.albedoType;
        serializationObject.reflectivityFormat = this.reflectivityFormat;
        serializationObject.reflectivityType = this.reflectivityType;
        serializationObject.velocityFormat = this.velocityFormat;
        serializationObject.velocityType = this.velocityType;
        serializationObject.linearVelocityFormat = this.linearVelocityFormat;
        serializationObject.linearVelocityType = this.linearVelocityType;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.depthTest = serializationObject.depthTest;
        this.depthWrite = serializationObject.depthWrite;
        this.samples = serializationObject.samples;
        this.viewDepthFormat = serializationObject.viewDepthFormat;
        this.viewDepthType = serializationObject.viewDepthType;
        this.screenDepthFormat = serializationObject.screenDepthFormat;
        this.screenDepthType = serializationObject.screenDepthType;
        this.localPositionFormat = serializationObject.localPositionFormat;
        this.localPositionType = serializationObject.localPositionType;
        this.worldPositionFormat = serializationObject.worldPositionFormat;
        this.worldPositionType = serializationObject.worldPositionType;
        this.viewNormalFormat = serializationObject.viewNormalFormat;
        this.viewNormalType = serializationObject.viewNormalType;
        this.worldNormalFormat = serializationObject.worldNormalFormat;
        this.worldNormalType = serializationObject.worldNormalType;
        this.albedoFormat = serializationObject.albedoFormat;
        this.albedoType = serializationObject.albedoType;
        this.reflectivityFormat = serializationObject.reflectivityFormat;
        this.reflectivityType = serializationObject.reflectivityType;
        this.velocityFormat = serializationObject.velocityFormat;
        this.velocityType = serializationObject.velocityType;
        this.linearVelocityFormat = serializationObject.linearVelocityFormat;
        this.linearVelocityType = serializationObject.linearVelocityType;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Depth test", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphGeometryRendererBlock.prototype, "depthTest", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Depth write", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphGeometryRendererBlock.prototype, "depthWrite", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Do not change aspect ratio", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphGeometryRendererBlock.prototype, "doNotChangeAspectRatio", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Texture width", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES")
], NodeRenderGraphGeometryRendererBlock.prototype, "width", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Texture height", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES")
], NodeRenderGraphGeometryRendererBlock.prototype, "height", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Size is in percentage", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphGeometryRendererBlock.prototype, "sizeInPercentage", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Samples", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES", { min: 1, max: 8 })
], NodeRenderGraphGeometryRendererBlock.prototype, "samples", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("View depth format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "viewDepthFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("View depth type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "viewDepthType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Screen depth format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "screenDepthFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Screen depth type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "screenDepthType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("View normal format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "viewNormalFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("View normal type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "viewNormalType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("World normal format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "worldNormalFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("World normal type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "worldNormalType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Local position format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "localPositionFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Local position type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "localPositionType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("World position format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "worldPositionFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("World position type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "worldPositionType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Albedo format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "albedoFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Albedo type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "albedoType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Reflectivity format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "reflectivityFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Reflectivity type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "reflectivityType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Velocity format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "velocityFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Velocity type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "velocityType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Linear velocity format", 7 /* PropertyTypeForEdition.TextureFormat */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "linearVelocityFormat", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Linear velocity type", 8 /* PropertyTypeForEdition.TextureType */, "GEOMETRY BUFFERS")
], NodeRenderGraphGeometryRendererBlock.prototype, "linearVelocityType", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphGeometryRendererBlock", NodeRenderGraphGeometryRendererBlock);
//# sourceMappingURL=geometryRendererBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/Rendering/objectRendererTask.js



/**
 * Task used to render objects to a texture.
 */
class FrameGraphObjectRendererTask extends frameGraphTask/* FrameGraphTask */.L {
    /**
     * Gets or sets the camera used to render the objects.
     */
    get camera() {
        return this._camera;
    }
    set camera(camera) {
        this._camera = camera;
        this._renderer.activeCamera = this.camera;
    }
    /**
     * The object renderer used to render the objects.
     */
    get objectRenderer() {
        return this._renderer;
    }
    get name() {
        return this._name;
    }
    set name(value) {
        this._name = value;
        if (this._renderer) {
            this._renderer.name = value;
        }
    }
    /**
     * Constructs a new object renderer task.
     * @param name The name of the task.
     * @param frameGraph The frame graph the task belongs to.
     * @param scene The scene the frame graph is associated with.
     * @param options The options of the object renderer.
     */
    constructor(name, frameGraph, scene, options) {
        super(name, frameGraph);
        /**
         * The dependencies of the task (optional).
         */
        this.dependencies = [];
        /**
         * If depth testing should be enabled (default is true).
         */
        this.depthTest = true;
        /**
         * If depth writing should be enabled (default is true).
         */
        this.depthWrite = true;
        this._scene = scene;
        this._renderer = new objectRenderer/* ObjectRenderer */.P(name, scene, options);
        this.name = name;
        this._renderer.onBeforeRenderingManagerRenderObservable.add(() => {
            if (!this._renderer.options.doNotChangeAspectRatio) {
                scene.updateTransformMatrix(true);
            }
        });
        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
        this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
    }
    isReady() {
        return this._renderer.isReadyForRendering(this._textureWidth, this._textureHeight);
    }
    record(skipCreationOfDisabledPasses = false, additionalExecute) {
        if (this.destinationTexture === undefined || this.objectList === undefined) {
            throw new Error(`FrameGraphObjectRendererTask ${this.name}: destinationTexture and objectList are required`);
        }
        const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);
        let depthEnabled = false;
        if (this.depthTexture !== undefined) {
            if (this.depthTexture === backbufferDepthStencilTextureHandle && this.destinationTexture !== backbufferColorTextureHandle) {
                throw new Error(`FrameGraphObjectRendererTask ${this.name}: the back buffer color texture is the only color texture allowed when the depth is the back buffer depth/stencil`);
            }
            if (this.depthTexture !== backbufferDepthStencilTextureHandle && this.destinationTexture === backbufferColorTextureHandle) {
                throw new Error(`FrameGraphObjectRendererTask ${this.name}: the back buffer depth/stencil texture is the only depth texture allowed when the destination is the back buffer color`);
            }
            const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);
            if (depthTextureDescription.options.samples !== outputTextureDescription.options.samples) {
                throw new Error(`FrameGraphObjectRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);
            }
            depthEnabled = true;
        }
        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
        if (this.depthTexture !== undefined) {
            this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);
        }
        this._textureWidth = outputTextureDescription.size.width;
        this._textureHeight = outputTextureDescription.size.height;
        const pass = this._frameGraph.addRenderPass(this.name);
        pass.setRenderTarget(this.destinationTexture);
        pass.setRenderTargetDepth(this.depthTexture);
        pass.setExecuteFunc((context) => {
            this._renderer.renderList = this.objectList.meshes;
            this._renderer.particleSystemList = this.objectList.particleSystems;
            context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);
            context.render(this._renderer, this._textureWidth, this._textureHeight);
            additionalExecute?.(context);
        });
        if (this.dependencies !== undefined) {
            for (const handle of this.dependencies) {
                pass.useTexture(handle);
            }
        }
        if (!skipCreationOfDisabledPasses) {
            const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
            passDisabled.setRenderTarget(this.destinationTexture);
            passDisabled.setRenderTargetDepth(this.depthTexture);
            passDisabled.setExecuteFunc((_context) => { });
            if (this.dependencies !== undefined) {
                for (const handle of this.dependencies) {
                    passDisabled.useTexture(handle);
                }
            }
        }
    }
    dispose() {
        this._renderer.dispose();
        super.dispose();
    }
}
//# sourceMappingURL=objectRendererTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js




/**
 * @internal
 */
class NodeRenderGraphBaseObjectRendererBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphBaseObjectRendererBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("destination", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerInput("depth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureBackBufferDepthStencilAttachment, true);
        this.registerInput("camera", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Camera);
        this.registerInput("objects", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.ObjectList);
        this.registerInput("dependencies", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture, true);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.registerOutput("outputDepth", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.destination.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBufferDepthStencil);
        this.depth.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureDepthStencilAttachment);
        this.dependencies.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer);
        this.output._typeConnectionSource = this.destination;
        this.outputDepth._typeConnectionSource = this.depth;
    }
    /** Indicates if depth testing must be enabled or disabled */
    get depthTest() {
        return this._frameGraphTask.depthTest;
    }
    set depthTest(value) {
        this._frameGraphTask.depthTest = value;
    }
    /** Indicates if depth writing must be enabled or disabled */
    get depthWrite() {
        return this._frameGraphTask.depthWrite;
    }
    set depthWrite(value) {
        this._frameGraphTask.depthWrite = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphBaseObjectRendererBlock";
    }
    /**
     * Gets the destination texture input component
     */
    get destination() {
        return this._inputs[0];
    }
    /**
     * Gets the depth texture input component
     */
    get depth() {
        return this._inputs[1];
    }
    /**
     * Gets the camera input component
     */
    get camera() {
        return this._inputs[2];
    }
    /**
     * Gets the objects input component
     */
    get objects() {
        return this._inputs[3];
    }
    /**
     * Gets the dependencies input component
     */
    get dependencies() {
        return this._inputs[4];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the output depth component
     */
    get outputDepth() {
        return this._outputs[1];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
        this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the "outputDepth" texture of the task
        const destinationConnectedPoint = this.destination.connectedPoint;
        if (destinationConnectedPoint) {
            this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
        }
        const depthConnectedPoint = this.depth.connectedPoint;
        if (depthConnectedPoint) {
            this._frameGraphTask.depthTexture = depthConnectedPoint.value;
        }
        const cameraConnectedPoint = this.camera.connectedPoint;
        if (cameraConnectedPoint) {
            this._frameGraphTask.camera = cameraConnectedPoint.value;
        }
        const objectsConnectedPoint = this.objects.connectedPoint;
        if (objectsConnectedPoint) {
            this._frameGraphTask.objectList = objectsConnectedPoint.value;
        }
        this._frameGraphTask.dependencies = [];
        const dependenciesConnectedPoint = this.dependencies.connectedPoint;
        if (dependenciesConnectedPoint) {
            this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value;
        }
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);
        codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.depthTest = this.depthTest;
        serializationObject.depthWrite = this.depthWrite;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.depthTest = serializationObject.depthTest;
        this.depthWrite = serializationObject.depthWrite;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Depth test", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphBaseObjectRendererBlock.prototype, "depthTest", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Depth write", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphBaseObjectRendererBlock.prototype, "depthWrite", null);
//# sourceMappingURL=baseObjectRendererBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js





/**
 * Block that render objects to a render target
 */
class NodeRenderGraphObjectRendererBlock extends NodeRenderGraphBaseObjectRendererBlock {
    /**
     * Create a new NodeRenderGraphObjectRendererBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     * @param doNotChangeAspectRatio True (default) to not change the aspect ratio of the scene in the RTT
     */
    constructor(name, frameGraph, scene, doNotChangeAspectRatio = true) {
        super(name, frameGraph, scene);
        this._additionalConstructionParameters = [doNotChangeAspectRatio];
        this._frameGraphTask = new FrameGraphObjectRendererTask(this.name, frameGraph, scene, { doNotChangeAspectRatio });
    }
    /** True (default) to not change the aspect ratio of the scene in the RTT */
    get doNotChangeAspectRatio() {
        return this._frameGraphTask.objectRenderer.options.doNotChangeAspectRatio;
    }
    set doNotChangeAspectRatio(value) {
        this._frameGraphTask.dispose();
        this._frameGraphTask = new FrameGraphObjectRendererTask(this.name, this._frameGraph, this._scene, { doNotChangeAspectRatio: value });
        this._additionalConstructionParameters = [value];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphObjectRendererBlock";
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Do not change aspect ratio", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphObjectRendererBlock.prototype, "doNotChangeAspectRatio", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphObjectRendererBlock", NodeRenderGraphObjectRendererBlock);
//# sourceMappingURL=objectRendererBlock.js.map
;// ./node_modules/@babylonjs/core/Maths/halton2DSequence.js
/**
 * Class for generating 2D Halton sequences.
 * From https://observablehq.com/@jrus/halton
 */
class Halton2DSequence {
    /**
     * Creates a new Halton2DSequence.
     * @param numSamples Number of samples in the sequence.
     * @param baseX The base for the x coordinate (default: 2).
     * @param baseY The base for the y coordinate (default: 3).
     * @param width Factor to scale the x coordinate by (default: 1). The scaling factor is 1/width.
     * @param height Factor to scale the y coordinate by (default: 1). The scaling factor is 1/height.
     */
    constructor(numSamples, baseX = 2, baseY = 3, width = 1, height = 1) {
        this._curIndex = 0;
        this._sequence = [];
        this._numSamples = 0;
        /**
         * The x coordinate of the current sample.
         */
        this.x = 0;
        /**
         * The y coordinate of the current sample.
         */
        this.y = 0;
        this._width = width;
        this._height = height;
        this._baseX = baseX;
        this._baseY = baseY;
        this._generateSequence(numSamples);
        this.next();
    }
    /**
     * Regenerates the sequence with a new number of samples.
     * @param numSamples Number of samples in the sequence.
     */
    regenerate(numSamples) {
        this._generateSequence(numSamples);
        this.next();
    }
    /**
     * Sets the dimensions of the sequence.
     * @param width Factor to scale the x coordinate by. The scaling factor is 1/width.
     * @param height Factor to scale the y coordinate by. The scaling factor is 1/height.
     */
    setDimensions(width, height) {
        this._width = width;
        this._height = height;
    }
    /**
     * Advances to the next sample in the sequence.
     */
    next() {
        this.x = this._sequence[this._curIndex] / this._width;
        this.y = this._sequence[this._curIndex + 1] / this._height;
        this._curIndex += 2;
        if (this._curIndex >= this._numSamples * 2) {
            this._curIndex = 0;
        }
    }
    _generateSequence(numSamples) {
        this._sequence = [];
        this._curIndex = 0;
        this._numSamples = numSamples;
        for (let i = 1; i <= numSamples; ++i) {
            this._sequence.push(this._halton(i, this._baseX) - 0.5, this._halton(i, this._baseY) - 0.5);
        }
    }
    _halton(index, base) {
        let fraction = 1;
        let result = 0;
        while (index > 0) {
            fraction /= base;
            result += fraction * (index % base);
            index = ~~(index / base); // floor division
        }
        return result;
    }
}
//# sourceMappingURL=halton2DSequence.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/thinTAAPostProcess.js




/**
 * Simple implementation of Temporal Anti-Aliasing (TAA).
 * This can be used to improve image quality for still pictures (screenshots for e.g.).
 */
class ThinTAAPostProcess extends effectRenderer/* EffectWrapper */.$ {
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 37706)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 71405)));
        }
    }
    /**
     * Number of accumulated samples (default: 8)
     */
    set samples(samples) {
        if (this._samples === samples) {
            return;
        }
        this._samples = samples;
        this._hs.regenerate(samples);
    }
    get samples() {
        return this._samples;
    }
    /**
     * Whether the TAA is disabled
     */
    get disabled() {
        return this._disabled;
    }
    set disabled(value) {
        if (this._disabled === value) {
            return;
        }
        this._disabled = value;
        this._reset();
    }
    /**
     * The width of the texture in which to render
     */
    get textureWidth() {
        return this._textureWidth;
    }
    set textureWidth(width) {
        if (this._textureWidth === width) {
            return;
        }
        this._textureWidth = width;
        this._reset();
    }
    /**
     * The height of the texture in which to render
     */
    get textureHeight() {
        return this._textureHeight;
    }
    set textureHeight(height) {
        if (this._textureHeight === height) {
            return;
        }
        this._textureHeight = height;
        this._reset();
    }
    /**
     * Constructs a new TAA post process
     * @param name Name of the effect
     * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
     * @param options Options to configure the effect
     */
    constructor(name, engine = null, options) {
        super({
            ...options,
            name,
            engine: engine || Engines_engine/* Engine */.N.LastCreatedEngine,
            useShaderStore: true,
            useAsPostProcess: true,
            fragmentShader: ThinTAAPostProcess.FragmentUrl,
            uniforms: ThinTAAPostProcess.Uniforms,
            samplers: ThinTAAPostProcess.Samplers,
        });
        this._samples = 8;
        /**
         * The factor used to blend the history frame with current frame (default: 0.05)
         */
        this.factor = 0.05;
        this._disabled = false;
        this._textureWidth = 0;
        this._textureHeight = 0;
        /**
         * Disable TAA on camera move (default: true).
         * You generally want to keep this enabled, otherwise you will get a ghost effect when the camera moves (but if it's what you want, go for it!)
         */
        this.disableOnCameraMove = true;
        this._firstUpdate = true;
        this._hs = new Halton2DSequence(this.samples);
    }
    /** @internal */
    _reset() {
        this._hs.setDimensions(this._textureWidth / 2, this._textureHeight / 2);
        this._hs.next();
        this._firstUpdate = true;
    }
    updateProjectionMatrix() {
        if (this.disabled) {
            return;
        }
        if (this.camera && !this.camera.hasMoved) {
            if (this.camera.mode === Cameras_camera/* Camera */.i.PERSPECTIVE_CAMERA) {
                const projMat = this.camera.getProjectionMatrix();
                projMat.setRowFromFloats(2, this._hs.x, this._hs.y, projMat.m[10], projMat.m[11]);
            }
            else {
                // We must force the update of the projection matrix so that m[12] and m[13] are recomputed, as we modified them the previous frame
                const projMat = this.camera.getProjectionMatrix(true);
                projMat.setRowFromFloats(3, this._hs.x + projMat.m[12], this._hs.y + projMat.m[13], projMat.m[14], projMat.m[15]);
            }
        }
        this._hs.next();
    }
    bind() {
        super.bind();
        if (this.disabled) {
            return;
        }
        const effect = this._drawWrapper.effect;
        effect.setFloat("factor", (this.camera?.hasMoved && this.disableOnCameraMove) || this._firstUpdate ? 1 : this.factor);
        this._firstUpdate = false;
    }
}
/**
 * The fragment shader url
 */
ThinTAAPostProcess.FragmentUrl = "taa";
/**
 * The list of uniforms used by the effect
 */
ThinTAAPostProcess.Uniforms = ["factor"];
/**
 * The list of samplers used by the effect
 */
ThinTAAPostProcess.Samplers = ["historySampler"];
//# sourceMappingURL=thinTAAPostProcess.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js




/**
 * Task used to render objects to a texture with Temporal Anti-Aliasing (TAA).
 */
class FrameGraphTAAObjectRendererTask extends FrameGraphObjectRendererTask {
    /**
     * Constructs a new TAA object renderer task.
     * @param name The name of the task
     * @param frameGraph The frame graph the task belongs to.
     * @param scene The scene the frame graph is associated with.
     * @param options The options of the object renderer.
     */
    constructor(name, frameGraph, scene, options) {
        super(name, frameGraph, scene, options);
        this.postProcess = new ThinTAAPostProcess(`${name} post-process`, scene.getEngine());
        this._postProcessDrawWrapper = this.postProcess.drawWrapper;
    }
    record() {
        if (this.destinationTexture === undefined || this.objectList === undefined) {
            throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: destinationTexture and objectList are required`);
        }
        if (this.destinationTexture === backbufferColorTextureHandle || this.depthTexture === backbufferDepthStencilTextureHandle) {
            throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: the back buffer color/depth textures are not allowed. Use regular textures instead.`);
        }
        const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);
        let depthEnabled = false;
        if (this.depthTexture !== undefined) {
            const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);
            if (depthTextureDescription.options.samples !== outputTextureDescription.options.samples) {
                throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);
            }
            depthEnabled = true;
        }
        this.postProcess.camera = this.camera;
        this.postProcess.textureWidth = outputTextureDescription.size.width;
        this.postProcess.textureHeight = outputTextureDescription.size.height;
        const textureCreationOptions = {
            size: outputTextureDescription.size,
            options: {
                createMipMaps: outputTextureDescription.options.createMipMaps,
                types: [2],
                formats: [5],
                samples: 1,
                useSRGBBuffers: [false],
                creationFlags: [0],
                labels: [""],
            },
            sizeIsPercentage: false,
            isHistoryTexture: true,
        };
        const pingPongHandle = this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} history`, textureCreationOptions);
        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, pingPongHandle);
        if (this.depthTexture !== undefined) {
            this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);
        }
        this._textureWidth = outputTextureDescription.size.width;
        this._textureHeight = outputTextureDescription.size.height;
        let pingPongRenderTargetWrapper;
        const pass = this._frameGraph.addRenderPass(this.name);
        pass.setRenderTarget(this.destinationTexture);
        pass.setRenderTargetDepth(this.depthTexture);
        pass.setExecuteFunc((context) => {
            this._renderer.renderList = this.objectList.meshes;
            this._renderer.particleSystemList = this.objectList.particleSystems;
            this.postProcess.updateProjectionMatrix();
            context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);
            // We define the active camera and transformation matrices ourselves, otherwise this will be done by calling context.render, in which case
            // getProjectionMatrix will be called with a "true" parameter, forcing recalculation of the projection matrix and losing our changes.
            if (!this.postProcess.disabled) {
                this._scene.activeCamera = this.camera;
                this._scene.setTransformMatrix(this.camera.getViewMatrix(), this.camera.getProjectionMatrix());
            }
            context.render(this._renderer, this._textureWidth, this._textureHeight);
            this._scene.activeCamera = null;
            pingPongRenderTargetWrapper = pingPongRenderTargetWrapper || context.createRenderTarget(`${this.name} ping/pong`, pingPongHandle);
            context.bindRenderTarget(pingPongRenderTargetWrapper, "frame graph - TAA merge with history texture");
            if (!this.postProcess.disabled) {
                context.applyFullScreenEffect(this._postProcessDrawWrapper, () => {
                    this.postProcess.bind();
                    context.bindTextureHandle(this._postProcessDrawWrapper.effect, "textureSampler", this.destinationTexture);
                    context.bindTextureHandle(this._postProcessDrawWrapper.effect, "historySampler", pingPongHandle);
                });
            }
            else {
                context.copyTexture(this.destinationTexture);
            }
        });
        const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
        passDisabled.setRenderTarget(this.outputTexture);
        passDisabled.setRenderTargetDepth(this.depthTexture);
        passDisabled.setExecuteFunc((context) => {
            context.copyTexture(this.destinationTexture);
        });
        if (this.dependencies !== undefined) {
            for (const handle of this.dependencies) {
                pass.useTexture(handle);
                passDisabled.useTexture(handle);
            }
        }
    }
}
//# sourceMappingURL=taaObjectRendererTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js





/**
 * Block that render objects with temporal anti-aliasing to a render target
 */
class NodeRenderGraphTAAObjectRendererBlock extends NodeRenderGraphBaseObjectRendererBlock {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphTAAObjectRendererBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     * @param doNotChangeAspectRatio True (default) to not change the aspect ratio of the scene in the RTT
     */
    constructor(name, frameGraph, scene, doNotChangeAspectRatio = true) {
        super(name, frameGraph, scene);
        this._additionalConstructionParameters = [doNotChangeAspectRatio];
        this._frameGraphTask = new FrameGraphTAAObjectRendererTask(this.name, frameGraph, scene, { doNotChangeAspectRatio });
    }
    /** True (default) to not change the aspect ratio of the scene in the RTT */
    get doNotChangeAspectRatio() {
        return this._frameGraphTask.objectRenderer.options.doNotChangeAspectRatio;
    }
    set doNotChangeAspectRatio(value) {
        this._frameGraphTask.dispose();
        this._frameGraphTask = new FrameGraphTAAObjectRendererTask(this.name, this._frameGraph, this._scene, { doNotChangeAspectRatio: value });
        this._additionalConstructionParameters = [value];
    }
    /** Number of accumulated samples */
    get samples() {
        return this._frameGraphTask.postProcess.samples;
    }
    set samples(value) {
        this._frameGraphTask.postProcess.samples = value;
    }
    /** The factor used to blend the history frame with current frame */
    get factor() {
        return this._frameGraphTask.postProcess.factor;
    }
    set factor(value) {
        this._frameGraphTask.postProcess.factor = value;
    }
    /** Indicates if depth testing must be enabled or disabled */
    get disableOnCameraMove() {
        return this._frameGraphTask.postProcess.disableOnCameraMove;
    }
    set disableOnCameraMove(value) {
        this._frameGraphTask.postProcess.disableOnCameraMove = value;
    }
    /** Indicates if TAA must be enabled or disabled */
    get disableTAA() {
        return this._frameGraphTask.postProcess.disabled;
    }
    set disableTAA(value) {
        this._frameGraphTask.postProcess.disabled = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphTAAObjectRendererBlock";
    }
    _dumpPropertiesCode() {
        const codes = [];
        codes.push(`${this._codeVariableName}.samples = ${this.samples};`);
        codes.push(`${this._codeVariableName}.factor = ${this.factor};`);
        codes.push(`${this._codeVariableName}.disableOnCameraMove = ${this.disableOnCameraMove};`);
        codes.push(`${this._codeVariableName}.disableTAA = ${this.disableTAA};`);
        return super._dumpPropertiesCode() + codes.join("\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.samples = this.samples;
        serializationObject.factor = this.factor;
        serializationObject.disableOnCameraMove = this.disableOnCameraMove;
        serializationObject.disableTAA = this.disableTAA;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.samples = serializationObject.samples;
        this.factor = serializationObject.factor;
        this.disableOnCameraMove = serializationObject.disableOnCameraMove;
        this.disableTAA = serializationObject.disableTAA;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Do not change aspect ratio", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
], NodeRenderGraphTAAObjectRendererBlock.prototype, "doNotChangeAspectRatio", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Samples", 2 /* PropertyTypeForEdition.Int */, "TEMPORAL ANTI-ALIASING")
], NodeRenderGraphTAAObjectRendererBlock.prototype, "samples", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Factor", 1 /* PropertyTypeForEdition.Float */, "TEMPORAL ANTI-ALIASING")
], NodeRenderGraphTAAObjectRendererBlock.prototype, "factor", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Disable on camera move", 0 /* PropertyTypeForEdition.Boolean */, "TEMPORAL ANTI-ALIASING")
], NodeRenderGraphTAAObjectRendererBlock.prototype, "disableOnCameraMove", null);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Disable TAA", 0 /* PropertyTypeForEdition.Boolean */, "TEMPORAL ANTI-ALIASING")
], NodeRenderGraphTAAObjectRendererBlock.prototype, "disableTAA", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphTAAObjectRendererBlock", NodeRenderGraphTAAObjectRendererBlock);
//# sourceMappingURL=taaObjectRendererBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js



/**
 * Defines a block used to teleport a value to an endpoint
 */
class NodeRenderGraphTeleportInBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /** Gets the list of attached endpoints */
    get endpoints() {
        return this._endpoints;
    }
    /**
     * Create a new NodeRenderGraphTeleportInBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this._endpoints = [];
        this._isTeleportIn = true;
        this.registerInput("input", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.AutoDetect);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphTeleportInBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    _dumpCode(uniqueNames, alreadyDumped) {
        let codeString = super._dumpCode(uniqueNames, alreadyDumped);
        for (const endpoint of this.endpoints) {
            if (alreadyDumped.indexOf(endpoint) === -1) {
                codeString += endpoint._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        return codeString;
    }
    /**
     * Checks if the current block is an ancestor of a given type
     * @param type defines the potential type to check
     * @returns true if block is a descendant
     */
    isAnAncestorOfType(type) {
        if (this.getClassName() === type) {
            return true;
        }
        for (const endpoint of this.endpoints) {
            if (endpoint.isAnAncestorOfType(type)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Checks if the current block is an ancestor of a given block
     * @param block defines the potential descendant block to check
     * @returns true if block is a descendant
     */
    isAnAncestorOf(block) {
        for (const endpoint of this.endpoints) {
            if (endpoint === block) {
                return true;
            }
            if (endpoint.isAnAncestorOf(block)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Get the first descendant using a predicate
     * @param predicate defines the predicate to check
     * @returns descendant or null if none found
     */
    getDescendantOfPredicate(predicate) {
        if (predicate(this)) {
            return this;
        }
        for (const endpoint of this.endpoints) {
            const descendant = endpoint.getDescendantOfPredicate(predicate);
            if (descendant) {
                return descendant;
            }
        }
        return null;
    }
    /**
     * Add an enpoint to this block
     * @param endpoint define the endpoint to attach to
     */
    attachToEndpoint(endpoint) {
        endpoint.detach();
        this._endpoints.push(endpoint);
        endpoint._entryPoint = this;
        endpoint._outputs[0]._typeConnectionSource = this._inputs[0];
        endpoint._tempEntryPointUniqueId = null;
        endpoint.name = "> " + this.name;
    }
    /**
     * Remove enpoint from this block
     * @param endpoint define the endpoint to remove
     */
    detachFromEndpoint(endpoint) {
        const index = this._endpoints.indexOf(endpoint);
        if (index !== -1) {
            this._endpoints.splice(index, 1);
            endpoint._outputs[0]._typeConnectionSource = null;
            endpoint._entryPoint = null;
        }
    }
    /**
     * Release resources
     */
    dispose() {
        super.dispose();
        for (const endpoint of this._endpoints) {
            this.detachFromEndpoint(endpoint);
        }
        this._endpoints = [];
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphTeleportInBlock", NodeRenderGraphTeleportInBlock);
//# sourceMappingURL=teleportInBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js



/**
 * Defines a block used to receive a value from a teleport entry point
 */
class NodeRenderGraphTeleportOutBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Create a new NodeRenderGraphTeleportOutBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        /** @internal */
        this._entryPoint = null;
        /** @internal */
        this._tempEntryPointUniqueId = null;
        this._isTeleportOut = true;
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
    }
    /**
     * Gets the entry point
     */
    get entryPoint() {
        return this._entryPoint;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphTeleportOutBlock";
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /** Detach from entry point */
    detach() {
        if (!this._entryPoint) {
            return;
        }
        this._entryPoint.detachFromEndpoint(this);
    }
    _buildBlock() {
        // Do nothing
        // All work done by the emitter
    }
    _customBuildStep(state) {
        if (this.entryPoint) {
            this.entryPoint.build(state);
        }
    }
    _dumpCode(uniqueNames, alreadyDumped) {
        let codeString = "";
        if (this.entryPoint) {
            if (alreadyDumped.indexOf(this.entryPoint) === -1) {
                codeString += this.entryPoint._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        return codeString + super._dumpCode(uniqueNames, alreadyDumped);
    }
    _dumpCodeForOutputConnections(alreadyDumped) {
        let codeString = super._dumpCodeForOutputConnections(alreadyDumped);
        if (this.entryPoint) {
            codeString += this.entryPoint._dumpCodeForOutputConnections(alreadyDumped);
        }
        return codeString;
    }
    /**
     * Clone the current block to a new identical block
     * @returns a copy of the current block
     */
    clone() {
        const clone = super.clone();
        if (this.entryPoint) {
            this.entryPoint.attachToEndpoint(clone);
        }
        return clone;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        if (this.entryPoint) {
            codeString += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\n`;
        }
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.entryPoint = this.entryPoint?.uniqueId ?? "";
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this._tempEntryPointUniqueId = serializationObject.entryPoint;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphTeleportOutBlock", NodeRenderGraphTeleportOutBlock);
//# sourceMappingURL=teleportOutBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/Texture/copyToTextureTask.js

/**
 * Task used to copy a texture to another texture.
 */
class FrameGraphCopyToTextureTask extends frameGraphTask/* FrameGraphTask */.L {
    /**
     * Constructs a new FrameGraphCopyToTextureTask.
     * @param name The name of the task.
     * @param frameGraph The frame graph the task belongs to.
     */
    constructor(name, frameGraph) {
        super(name, frameGraph);
        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
    }
    record() {
        if (this.sourceTexture === undefined || this.destinationTexture === undefined) {
            throw new Error(`FrameGraphCopyToTextureTask "${this.name}": sourceTexture and destinationTexture are required`);
        }
        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
        const pass = this._frameGraph.addRenderPass(this.name);
        pass.useTexture(this.sourceTexture);
        pass.setRenderTarget(this.outputTexture);
        pass.setExecuteFunc((context) => {
            context.copyTexture(this.sourceTexture);
        });
        const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
        passDisabled.setRenderTarget(this.outputTexture);
        passDisabled.setExecuteFunc((_context) => { });
    }
}
//# sourceMappingURL=copyToTextureTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js




/**
 * Block used to copy a texture
 */
class NodeRenderGraphCopyTextureBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphCopyTextureBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("source", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerInput("destination", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.source.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer);
        this.destination.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAll);
        this.output._typeConnectionSource = this.destination;
        this._frameGraphTask = new FrameGraphCopyToTextureTask(name, frameGraph);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphCopyTextureBlock";
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[0];
    }
    /**
     * Gets the destination input component
     */
    get destination() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
        const sourceConnectedPoint = this.source.connectedPoint;
        if (sourceConnectedPoint) {
            this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
        }
        const destinationConnectedPoint = this.destination.connectedPoint;
        if (destinationConnectedPoint) {
            this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphCopyTextureBlock", NodeRenderGraphCopyTextureBlock);
//# sourceMappingURL=copyTextureBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Tasks/Texture/generateMipMapsTask.js

/**
 * Task which generates mipmaps for a texture.
 */
class FrameGraphGenerateMipMapsTask extends frameGraphTask/* FrameGraphTask */.L {
    /**
     * Constructs a new FrameGraphGenerateMipMapsTask.
     * @param name The name of the task.
     * @param frameGraph The frame graph the task belongs to.
     */
    constructor(name, frameGraph) {
        super(name, frameGraph);
        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
    }
    record() {
        if (this.destinationTexture === undefined) {
            throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture is required`);
        }
        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
        const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);
        if (!outputTextureDescription.options.createMipMaps) {
            throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture must have createMipMaps set to true`);
        }
        const pass = this._frameGraph.addRenderPass(this.name);
        pass.setRenderTarget(this.outputTexture);
        pass.setExecuteFunc((context) => {
            context.generateMipMaps();
        });
        const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
        passDisabled.setRenderTarget(this.outputTexture);
        passDisabled.setExecuteFunc((_context) => { });
    }
}
//# sourceMappingURL=generateMipMapsTask.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js




/**
 * Block used to generate mipmaps for a texture
 */
class NodeRenderGraphGenerateMipmapsBlock extends nodeRenderGraphBlock/* NodeRenderGraphBlock */.E {
    /**
     * Gets the frame graph task associated with this block
     */
    get task() {
        return this._frameGraphTask;
    }
    /**
     * Create a new NodeRenderGraphGenerateMipmapsBlock
     * @param name defines the block name
     * @param frameGraph defines the hosting frame graph
     * @param scene defines the hosting scene
     */
    constructor(name, frameGraph, scene) {
        super(name, frameGraph, scene);
        this.registerInput("texture", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.Texture);
        this.registerOutput("output", nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.BasedOnInput);
        this.texture.addAcceptedConnectionPointTypes(nodeRenderGraphTypes/* NodeRenderGraphBlockConnectionPointTypes */.tp.TextureAllButBackBuffer);
        this.output._typeConnectionSource = this.texture;
        this._frameGraphTask = new FrameGraphGenerateMipMapsTask(name, frameGraph);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeRenderGraphGenerateMipmapsBlock";
    }
    /**
     * Gets the texture input component
     */
    get texture() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._frameGraphTask.name = this.name;
        this._propagateInputValueToOutput(this.texture, this.output);
        const textureConnectedPoint = this.texture.connectedPoint;
        if (textureConnectedPoint) {
            this._frameGraphTask.destinationTexture = textureConnectedPoint.value;
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeRenderGraphGenerateMipmapsBlock", NodeRenderGraphGenerateMipmapsBlock);
//# sourceMappingURL=generateMipmapsBlock.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/Node/Blocks/index.js


















//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/frameGraphObjectList.js
/**
 * Structure used by the frame graph to reference objects.
 * @experimental
 */
class FrameGraphObjectList {
}
//# sourceMappingURL=frameGraphObjectList.js.map
;// ./node_modules/@babylonjs/core/FrameGraph/index.js
/* eslint-disable import/no-internal-modules */






























//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Gamepads/index.js





//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Gizmos/axisScaleGizmo.js











/**
 * Single axis scale gizmo
 */
class AxisScaleGizmo extends gizmo/* Gizmo */.Fq {
    /** Default material used to render when gizmo is not disabled or hovered */
    get coloredMaterial() {
        return this._coloredMaterial;
    }
    /** Material used to render when gizmo is hovered with mouse*/
    get hoverMaterial() {
        return this._hoverMaterial;
    }
    /** Material used to render when gizmo is disabled. typically grey.*/
    get disableMaterial() {
        return this._disableMaterial;
    }
    /**
     * Creates an AxisScaleGizmo
     * @param dragAxis The axis which the gizmo will be able to scale on
     * @param color The color of the gizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     * @param parent
     * @param thickness display gizmo axis thickness
     * @param hoverColor The color of the gizmo when hovering over and dragging
     * @param disableColor The Color of the gizmo when its disabled
     */
    constructor(dragAxis, color = math_color/* Color3 */.v9.Gray(), gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer, parent = null, thickness = 1, hoverColor = math_color/* Color3 */.v9.Yellow(), disableColor = math_color/* Color3 */.v9.Gray()) {
        super(gizmoLayer);
        this._pointerObserver = null;
        /**
         * Scale distance in babylon units that the gizmo will snap to when dragged (Default: 0)
         */
        this.snapDistance = 0;
        /**
         * Event that fires each time the gizmo snaps to a new location.
         * * snapDistance is the change in distance
         */
        this.onSnapObservable = new Misc_observable/* Observable */.cP();
        /**
         * If the scaling operation should be done on all axis (default: false)
         */
        this.uniformScaling = false;
        /**
         * Custom sensitivity value for the drag strength
         */
        this.sensitivity = 1;
        /**
         * The magnitude of the drag strength (scaling factor)
         */
        this.dragScale = 1;
        /**
         * Incremental snap scaling (default is false). When true, with a snapDistance of 0.1, scaling will be 1.1,1.2,1.3 instead of, when false: 1.1,1.21,1.33,...
         */
        this.incrementalSnap = false;
        this._isEnabled = true;
        this._parent = null;
        this._dragging = false;
        this._tmpVector = new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._incrementalStartupValue = math_vector/* Vector3 */.Pq.Zero();
        this._parent = parent;
        // Create Material
        this._coloredMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._coloredMaterial.diffuseColor = color;
        this._coloredMaterial.specularColor = color.subtract(new math_color/* Color3 */.v9(0.1, 0.1, 0.1));
        this._hoverMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._hoverMaterial.diffuseColor = hoverColor;
        this._disableMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._disableMaterial.diffuseColor = disableColor;
        this._disableMaterial.alpha = 0.4;
        // Build mesh + Collider
        this._gizmoMesh = new Meshes_mesh/* Mesh */.e("axis", gizmoLayer.utilityLayerScene);
        const { arrowMesh, arrowTail } = this._createGizmoMesh(this._gizmoMesh, thickness);
        const collider = this._createGizmoMesh(this._gizmoMesh, thickness + 4, true);
        this._gizmoMesh.lookAt(this._rootMesh.position.add(dragAxis));
        this._rootMesh.addChild(this._gizmoMesh, gizmo/* Gizmo */.Fq.PreserveScaling);
        this._gizmoMesh.scaling.scaleInPlace(1 / 3);
        // Closure of initial prop values for resetting
        const nodePosition = arrowMesh.position.clone();
        const linePosition = arrowTail.position.clone();
        const lineScale = arrowTail.scaling.clone();
        const increaseGizmoMesh = (dragDistance) => {
            const dragStrength = dragDistance * (3 / this._rootMesh.scaling.length()) * 6;
            arrowMesh.position.z += dragStrength / 3.5;
            arrowTail.scaling.y += dragStrength;
            this.dragScale = arrowTail.scaling.y;
            arrowTail.position.z = arrowMesh.position.z / 2;
        };
        const resetGizmoMesh = () => {
            arrowMesh.position.set(nodePosition.x, nodePosition.y, nodePosition.z);
            arrowTail.position.set(linePosition.x, linePosition.y, linePosition.z);
            arrowTail.scaling.set(lineScale.x, lineScale.y, lineScale.z);
            this.dragScale = arrowTail.scaling.y;
            this._dragging = false;
        };
        // Add drag behavior to handle events when the gizmo is dragged
        this.dragBehavior = new pointerDragBehavior/* PointerDragBehavior */.C({ dragAxis: dragAxis });
        this.dragBehavior.moveAttached = false;
        this.dragBehavior.updateDragPlane = false;
        this._rootMesh.addBehavior(this.dragBehavior);
        let currentSnapDragDistance = 0;
        let currentSnapDragDistanceIncremental = 0;
        const tmpSnapEvent = { snapDistance: 0 };
        this.dragBehavior.onDragObservable.add((event) => {
            if (this.attachedNode) {
                // Drag strength is modified by the scale of the gizmo (eg. for small objects like boombox the strength will be increased to match the behavior of larger objects)
                const dragStrength = this.sensitivity * event.dragDistance * ((this.scaleRatio * 3) / this._rootMesh.scaling.length());
                const tmpVector = this._tmpVector;
                // Snapping logic
                let snapped = false;
                let dragSteps = 0;
                if (this.uniformScaling) {
                    tmpVector.setAll(0.57735); // 1 / sqrt(3)
                }
                else {
                    tmpVector.copyFrom(dragAxis);
                }
                if (this.snapDistance == 0) {
                    tmpVector.scaleToRef(dragStrength, tmpVector);
                }
                else {
                    currentSnapDragDistance += dragStrength;
                    currentSnapDragDistanceIncremental += dragStrength;
                    const currentSnap = this.incrementalSnap ? currentSnapDragDistanceIncremental : currentSnapDragDistance;
                    if (Math.abs(currentSnap) > this.snapDistance) {
                        dragSteps = Math.floor(Math.abs(currentSnap) / this.snapDistance);
                        if (currentSnap < 0) {
                            dragSteps *= -1;
                        }
                        currentSnapDragDistance = currentSnapDragDistance % this.snapDistance;
                        tmpVector.scaleToRef(this.snapDistance * dragSteps, tmpVector);
                        snapped = true;
                    }
                    else {
                        tmpVector.scaleInPlace(0);
                    }
                }
                tmpVector.addInPlaceFromFloats(1, 1, 1);
                // can't use Math.sign here because Math.sign(0) is 0 and it needs to be positive
                tmpVector.x = Math.abs(tmpVector.x) < AxisScaleGizmo.MinimumAbsoluteScale ? AxisScaleGizmo.MinimumAbsoluteScale * (tmpVector.x < 0 ? -1 : 1) : tmpVector.x;
                tmpVector.y = Math.abs(tmpVector.y) < AxisScaleGizmo.MinimumAbsoluteScale ? AxisScaleGizmo.MinimumAbsoluteScale * (tmpVector.y < 0 ? -1 : 1) : tmpVector.y;
                tmpVector.z = Math.abs(tmpVector.z) < AxisScaleGizmo.MinimumAbsoluteScale ? AxisScaleGizmo.MinimumAbsoluteScale * (tmpVector.z < 0 ? -1 : 1) : tmpVector.z;
                const transformNode = this.attachedNode._isMesh ? this.attachedNode : undefined;
                if (Math.abs(this.snapDistance) > 0 && this.incrementalSnap) {
                    // get current scaling
                    this.attachedNode.getWorldMatrix().decompose(undefined, math_vector/* TmpVectors */.AA.Quaternion[0], math_vector/* TmpVectors */.AA.Vector3[2], gizmo/* Gizmo */.Fq.PreserveScaling ? transformNode : undefined);
                    // apply incrementaly, without taking care of current scaling value
                    tmpVector.addInPlace(this._incrementalStartupValue);
                    tmpVector.addInPlaceFromFloats(-1, -1, -1);
                    // keep same sign or stretching close to 0 will change orientation at each drag and scaling will oscilate around 0
                    tmpVector.x = Math.abs(tmpVector.x) * (this._incrementalStartupValue.x > 0 ? 1 : -1);
                    tmpVector.y = Math.abs(tmpVector.y) * (this._incrementalStartupValue.y > 0 ? 1 : -1);
                    tmpVector.z = Math.abs(tmpVector.z) * (this._incrementalStartupValue.z > 0 ? 1 : -1);
                    math_vector/* Matrix */.uq.ComposeToRef(tmpVector, math_vector/* TmpVectors */.AA.Quaternion[0], math_vector/* TmpVectors */.AA.Vector3[2], math_vector/* TmpVectors */.AA.Matrix[1]);
                }
                else {
                    math_vector/* Matrix */.uq.ScalingToRef(tmpVector.x, tmpVector.y, tmpVector.z, math_vector/* TmpVectors */.AA.Matrix[2]);
                    math_vector/* TmpVectors */.AA.Matrix[2].multiplyToRef(this.attachedNode.getWorldMatrix(), math_vector/* TmpVectors */.AA.Matrix[1]);
                }
                // check scaling are not out of bounds. If not, copy resulting temp matrix to node world matrix
                math_vector/* TmpVectors */.AA.Matrix[1].decompose(math_vector/* TmpVectors */.AA.Vector3[1], undefined, undefined, gizmo/* Gizmo */.Fq.PreserveScaling ? transformNode : undefined);
                const maxScale = 100000;
                if (Math.abs(math_vector/* TmpVectors */.AA.Vector3[1].x) < maxScale && Math.abs(math_vector/* TmpVectors */.AA.Vector3[1].y) < maxScale && Math.abs(math_vector/* TmpVectors */.AA.Vector3[1].z) < maxScale) {
                    this.attachedNode.getWorldMatrix().copyFrom(math_vector/* TmpVectors */.AA.Matrix[1]);
                }
                // notify observers
                if (snapped) {
                    tmpSnapEvent.snapDistance = this.snapDistance * dragSteps;
                    this.onSnapObservable.notifyObservers(tmpSnapEvent);
                }
                this._matrixChanged();
            }
        });
        // On Drag Listener: to move gizmo mesh with user action
        this.dragBehavior.onDragStartObservable.add(() => {
            this._dragging = true;
            const transformNode = this.attachedNode._isMesh ? this.attachedNode : undefined;
            this.attachedNode?.getWorldMatrix().decompose(this._incrementalStartupValue, undefined, undefined, gizmo/* Gizmo */.Fq.PreserveScaling ? transformNode : undefined);
            currentSnapDragDistance = 0;
            currentSnapDragDistanceIncremental = 0;
        });
        this.dragBehavior.onDragObservable.add((e) => increaseGizmoMesh(e.dragDistance));
        this.dragBehavior.onDragEndObservable.add(resetGizmoMesh);
        // Listeners for Universal Scalar
        parent?.uniformScaleGizmo?.dragBehavior?.onDragObservable?.add((e) => increaseGizmoMesh(e.delta.y));
        parent?.uniformScaleGizmo?.dragBehavior?.onDragEndObservable?.add(resetGizmoMesh);
        const cache = {
            gizmoMeshes: [arrowMesh, arrowTail],
            colliderMeshes: [collider.arrowMesh, collider.arrowTail],
            material: this._coloredMaterial,
            hoverMaterial: this._hoverMaterial,
            disableMaterial: this._disableMaterial,
            active: false,
            dragBehavior: this.dragBehavior,
        };
        this._parent?.addToAxisCache(this._gizmoMesh, cache);
        this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
            if (this._customMeshSet) {
                return;
            }
            // axis mesh cache
            let meshCache = this._parent?.getAxisCache(this._gizmoMesh);
            this._isHovered = !!meshCache && !!(meshCache.colliderMeshes.indexOf(pointerInfo?.pickInfo?.pickedMesh) != -1);
            // uniform mesh cache
            meshCache = this._parent?.getAxisCache(this._rootMesh);
            this._isHovered || (this._isHovered = !!meshCache && !!(meshCache.colliderMeshes.indexOf(pointerInfo?.pickInfo?.pickedMesh) != -1));
            if (!this._parent) {
                const material = this.dragBehavior.enabled ? (this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial) : this._disableMaterial;
                this._setGizmoMeshMaterial(cache.gizmoMeshes, material);
            }
        });
        this.dragBehavior.onEnabledObservable.add((newState) => {
            this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? this._coloredMaterial : this._disableMaterial);
        });
        const light = gizmoLayer._getSharedGizmoLight();
        light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes());
    }
    /**
     * @internal
     * Create Geometry for Gizmo
     * @param parentMesh
     * @param thickness
     * @param isCollider
     * @returns the gizmo mesh
     */
    _createGizmoMesh(parentMesh, thickness, isCollider = false) {
        const arrowMesh = (0,boxBuilder/* CreateBox */.an)("yPosMesh", { size: 0.4 * (1 + (thickness - 1) / 4) }, this.gizmoLayer.utilityLayerScene);
        const arrowTail = CreateCylinder("cylinder", { diameterTop: 0.005 * thickness, height: 0.275, diameterBottom: 0.005 * thickness, tessellation: 96 }, this.gizmoLayer.utilityLayerScene);
        // Position arrow pointing in its drag axis
        arrowMesh.scaling.scaleInPlace(0.1);
        arrowMesh.material = this._coloredMaterial;
        arrowMesh.rotation.x = Math.PI / 2;
        arrowMesh.position.z += 0.3;
        arrowTail.material = this._coloredMaterial;
        arrowTail.position.z += 0.275 / 2;
        arrowTail.rotation.x = Math.PI / 2;
        if (isCollider) {
            arrowMesh.visibility = 0;
            arrowTail.visibility = 0;
        }
        parentMesh.addChild(arrowMesh);
        parentMesh.addChild(arrowTail);
        return { arrowMesh, arrowTail };
    }
    _attachedNodeChanged(value) {
        if (this.dragBehavior) {
            this.dragBehavior.enabled = value ? true : false;
        }
    }
    /**
     * If the gizmo is enabled
     */
    set isEnabled(value) {
        this._isEnabled = value;
        if (!value) {
            this.attachedMesh = null;
            this.attachedNode = null;
        }
        else {
            if (this._parent) {
                this.attachedMesh = this._parent.attachedMesh;
                this.attachedNode = this._parent.attachedNode;
            }
        }
    }
    get isEnabled() {
        return this._isEnabled;
    }
    /**
     * Disposes of the gizmo
     */
    dispose() {
        this.onSnapObservable.clear();
        this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
        this.dragBehavior.detach();
        if (this._gizmoMesh) {
            this._gizmoMesh.dispose();
        }
        [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {
            if (matl) {
                matl.dispose();
            }
        });
        super.dispose();
    }
    /**
     * Disposes and replaces the current meshes in the gizmo with the specified mesh
     * @param mesh The mesh to replace the default mesh of the gizmo
     * @param useGizmoMaterial If the gizmo's default material should be used (default: false)
     */
    setCustomMesh(mesh, useGizmoMaterial = false) {
        super.setCustomMesh(mesh);
        if (useGizmoMaterial) {
            this._rootMesh.getChildMeshes().forEach((m) => {
                m.material = this._coloredMaterial;
                if (m.color) {
                    m.color = this._coloredMaterial.diffuseColor;
                }
            });
            this._customMeshSet = false;
        }
    }
}
/**
 * The minimal absolute scale per component. can be positive or negative but never smaller.
 */
AxisScaleGizmo.MinimumAbsoluteScale = math_constants/* Epsilon */.bH;
//# sourceMappingURL=axisScaleGizmo.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/pivotTools.js
var pivotTools = __webpack_require__(23822);
;// ./node_modules/@babylonjs/core/Gizmos/boundingBoxGizmo.js














/**
 * Dragging operation in observable
 */
var DragOperation;
(function (DragOperation) {
    DragOperation[DragOperation["Rotation"] = 0] = "Rotation";
    DragOperation[DragOperation["Scaling"] = 1] = "Scaling";
})(DragOperation || (DragOperation = {}));
/**
 * Bounding box gizmo
 */
class BoundingBoxGizmo extends gizmo/* Gizmo */.Fq {
    /**
     * Sets the axis factor
     * @param factor the Vector3 value
     */
    set axisFactor(factor) {
        this._axisFactor = factor;
        // update scale cube visibility
        const scaleBoxes = this._scaleBoxesParent.getChildMeshes();
        let index = 0;
        for (let i = 0; i < 3; i++) {
            for (let j = 0; j < 3; j++) {
                for (let k = 0; k < 3; k++) {
                    const zeroAxisCount = (i === 1 ? 1 : 0) + (j === 1 ? 1 : 0) + (k === 1 ? 1 : 0);
                    if (zeroAxisCount === 1 || zeroAxisCount === 3) {
                        continue;
                    }
                    if (scaleBoxes[index]) {
                        const dragAxis = new math_vector/* Vector3 */.Pq(i - 1, j - 1, k - 1);
                        dragAxis.multiplyInPlace(this._axisFactor);
                        scaleBoxes[index].setEnabled(dragAxis.lengthSquared() > math_constants/* Epsilon */.bH);
                    }
                    index++;
                }
            }
        }
    }
    /**
     * Gets the axis factor
     * @returns the Vector3 factor value
     */
    get axisFactor() {
        return this._axisFactor;
    }
    /**
     * Sets scale drag speed value
     * @param value the new speed value
     */
    set scaleDragSpeed(value) {
        this._scaleDragSpeed = value;
    }
    /**
     * Gets scale drag speed
     * @returns the scale speed number
     */
    get scaleDragSpeed() {
        return this._scaleDragSpeed;
    }
    /** Default material used to render when gizmo is not disabled or hovered */
    get coloredMaterial() {
        return this._coloredMaterial;
    }
    /** Material used to render when gizmo is hovered with mouse*/
    get hoverMaterial() {
        return this._hoverColoredMaterial;
    }
    /**
     * Get the pointerDragBehavior
     */
    get pointerDragBehavior() {
        return this._pointerDragBehavior;
    }
    /** True when a rotation anchor or scale box or a attached mesh is dragged */
    get isDragging() {
        return this._dragging || this._pointerDragBehavior.dragging;
    }
    /**
     * Sets the color of the bounding box gizmo
     * @param color the color to set
     */
    setColor(color) {
        this._coloredMaterial.emissiveColor = color;
        this._hoverColoredMaterial.emissiveColor = color.clone().add(new math_color/* Color3 */.v9(0.3, 0.3, 0.3));
        this._lineBoundingBox.getChildren().forEach((l) => {
            if (l.color) {
                l.color = color;
            }
        });
    }
    /**
     * Creates an BoundingBoxGizmo
     * @param color The color of the gizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     */
    constructor(color = math_color/* Color3 */.v9.Gray(), gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultKeepDepthUtilityLayer) {
        super(gizmoLayer);
        this._boundingDimensions = new math_vector/* Vector3 */.Pq(1, 1, 1);
        this._renderObserver = null;
        this._pointerObserver = null;
        this._scaleDragSpeed = 0.2;
        this._rotateAnchorsDragBehaviors = [];
        this._scaleBoxesDragBehaviors = [];
        /**
         * boolean updated when a rotation anchor or scale box is dragged
         */
        this._dragging = false;
        this._tmpQuaternion = new math_vector/* Quaternion */.PT();
        this._tmpVector = new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._tmpRotationMatrix = new math_vector/* Matrix */.uq();
        this._incrementalStartupValue = math_vector/* Vector3 */.Pq.Zero();
        this._incrementalAnchorStartupValue = math_vector/* Vector3 */.Pq.Zero();
        /**
         * If child meshes should be ignored when calculating the bounding box. This should be set to true to avoid perf hits with heavily nested meshes (Default: false)
         */
        this.ignoreChildren = false;
        /**
         * Returns true if a descendant should be included when computing the bounding box. When null, all descendants are included. If ignoreChildren is set this will be ignored. (Default: null)
         */
        this.includeChildPredicate = null;
        /**
         * The size of the rotation anchors attached to the bounding box (Default: 0.1)
         */
        this.rotationSphereSize = 0.1;
        /**
         * The size of the scale boxes attached to the bounding box (Default: 0.1)
         */
        this.scaleBoxSize = 0.1;
        /**
         * If set, the rotation anchors and scale boxes will increase in size based on the distance away from the camera to have a consistent screen size (Default: false)
         * Note : fixedDragMeshScreenSize takes precedence over fixedDragMeshBoundsSize if both are true
         */
        this.fixedDragMeshScreenSize = false;
        /**
         * If set, the rotation anchors and scale boxes will increase in size based on the size of the bounding box
         * Note : fixedDragMeshScreenSize takes precedence over fixedDragMeshBoundsSize if both are true
         */
        this.fixedDragMeshBoundsSize = false;
        /**
         * The distance away from the object which the draggable meshes should appear world sized when fixedDragMeshScreenSize is set to true (default: 10)
         */
        this.fixedDragMeshScreenSizeDistanceFactor = 10;
        /**
         * Drag distance in babylon units that the gizmo will snap scaling to when dragged
         */
        this.scalingSnapDistance = 0;
        /**
         * Drag distance in babylon units that the gizmo will snap rotation to when dragged
         */
        this.rotationSnapDistance = 0;
        /**
         * Fired when a rotation anchor or scale box is dragged
         */
        this.onDragStartObservable = new Misc_observable/* Observable */.cP();
        /**
         * Fired when the gizmo mesh hovering starts
         */
        this.onHoverStartObservable = new Misc_observable/* Observable */.cP();
        /**
         * Fired when the gizmo mesh hovering ends
         */
        this.onHoverEndObservable = new Misc_observable/* Observable */.cP();
        /**
         * Fired when a scale box is dragged
         */
        this.onScaleBoxDragObservable = new Misc_observable/* Observable */.cP();
        /**
         * Fired when a scale box drag is ended
         */
        this.onScaleBoxDragEndObservable = new Misc_observable/* Observable */.cP();
        /**
         * Fired when a rotation anchor is dragged
         */
        this.onRotationSphereDragObservable = new Misc_observable/* Observable */.cP();
        /**
         * Fired when a rotation anchor drag is ended
         */
        this.onRotationSphereDragEndObservable = new Misc_observable/* Observable */.cP();
        /**
         * Relative bounding box pivot used when scaling the attached node. When null object with scale from the opposite corner. 0.5,0.5,0.5 for center and 0.5,0,0.5 for bottom (Default: null)
         */
        this.scalePivot = null;
        /**
         * Scale factor used for masking some axis
         */
        this._axisFactor = new math_vector/* Vector3 */.Pq(1, 1, 1);
        /**
         * Incremental snap scaling (default is false). When true, with a snapDistance of 0.1, scaling will be 1.1,1.2,1.3 instead of, when false: 1.1,1.21,1.33,...
         */
        this.incrementalSnap = false;
        this._existingMeshScale = new math_vector/* Vector3 */.Pq();
        // Dragging
        this._dragMesh = null;
        this._pointerDragBehavior = new pointerDragBehavior/* PointerDragBehavior */.C();
        // HL2 style corner mesh
        this._cornerMesh = null;
        // Do not update the gizmo's scale so it has a fixed size to the object its attached to
        this.updateScale = false;
        this._anchorMesh = new Meshes_transformNode/* TransformNode */.V("anchor", gizmoLayer.utilityLayerScene);
        // Create Materials
        this._coloredMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._coloredMaterial.disableLighting = true;
        this._hoverColoredMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._hoverColoredMaterial.disableLighting = true;
        // Build bounding box out of lines
        this._lineBoundingBox = new Meshes_transformNode/* TransformNode */.V("", gizmoLayer.utilityLayerScene);
        this._lineBoundingBox.rotationQuaternion = new math_vector/* Quaternion */.PT();
        const lines = [];
        lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(0, 0, 0), new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, 0, 0)] }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(0, 0, 0), new math_vector/* Vector3 */.Pq(0, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(0, 0, 0), new math_vector/* Vector3 */.Pq(0, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, 0, 0), new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, 0, 0), new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(0, this._boundingDimensions.y, 0), new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(0, this._boundingDimensions.y, 0), new math_vector/* Vector3 */.Pq(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(0, 0, this._boundingDimensions.z), new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(0, 0, this._boundingDimensions.z), new math_vector/* Vector3 */.Pq(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", {
            points: [
                new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z),
                new math_vector/* Vector3 */.Pq(0, this._boundingDimensions.y, this._boundingDimensions.z),
            ],
        }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", {
            points: [
                new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z),
                new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, 0, this._boundingDimensions.z),
            ],
        }, gizmoLayer.utilityLayerScene));
        lines.push(CreateLines("lines", {
            points: [
                new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z),
                new math_vector/* Vector3 */.Pq(this._boundingDimensions.x, this._boundingDimensions.y, 0),
            ],
        }, gizmoLayer.utilityLayerScene));
        lines.forEach((l) => {
            l.color = color;
            l.position.addInPlace(new math_vector/* Vector3 */.Pq(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
            l.isPickable = false;
            this._lineBoundingBox.addChild(l);
        });
        this._rootMesh.addChild(this._lineBoundingBox);
        this.setColor(color);
        // Create rotation anchors
        this._rotateAnchorsParent = new Meshes_transformNode/* TransformNode */.V("", gizmoLayer.utilityLayerScene);
        this._rotateAnchorsParent.rotationQuaternion = new math_vector/* Quaternion */.PT();
        for (let i = 0; i < 12; i++) {
            const anchor = (0,boxBuilder/* CreateBox */.an)("", { width: i < 4 || i >= 8 ? 1.6 : 0.4, height: i >= 4 && i < 8 ? 1.6 : 0.4, depth: 0.4 }, gizmoLayer.utilityLayerScene);
            anchor.rotation.x = i < 4 || i >= 8 ? Math.PI * 0.25 : 0;
            anchor.rotation.y = i >= 4 && i < 8 ? Math.PI * 0.25 : 0;
            anchor.bakeTransformIntoVertices(anchor.computeWorldMatrix(true));
            anchor.rotationQuaternion = new math_vector/* Quaternion */.PT();
            anchor.material = this._coloredMaterial;
            anchor.isNearGrabbable = true;
            // Drag behavior
            const rotateAnchorsDragBehavior = new pointerDragBehavior/* PointerDragBehavior */.C({});
            rotateAnchorsDragBehavior.moveAttached = false;
            rotateAnchorsDragBehavior.updateDragPlane = false;
            anchor.addBehavior(rotateAnchorsDragBehavior);
            const startingTurnDirection = new math_vector/* Vector3 */.Pq(1, 0, 0);
            let totalTurnAmountOfDrag = 0;
            let previousProjectDist = 0;
            rotateAnchorsDragBehavior.onDragStartObservable.add(() => {
                startingTurnDirection.copyFrom(anchor.forward);
                totalTurnAmountOfDrag = 0;
                previousProjectDist = 0;
            });
            const computeAxis = function () {
                const dragAxisIndex = Math.floor(i / 4);
                math_vector/* TmpVectors */.AA.Vector3[0].set(dragAxisIndex == 0 ? 1 : 0, dragAxisIndex == 1 ? 1 : 0, dragAxisIndex == 2 ? 1 : 0);
                return math_vector/* TmpVectors */.AA.Vector3[0];
            };
            rotateAnchorsDragBehavior.onDragObservable.add((event) => {
                this.onRotationSphereDragObservable.notifyObservers({ dragOperation: 0 /* DragOperation.Rotation */, dragAxis: computeAxis().clone() });
                if (this.attachedMesh) {
                    const originalParent = this.attachedMesh.parent;
                    if (originalParent && originalParent.scaling && originalParent.scaling.isNonUniformWithinEpsilon(0.001)) {
                        logger/* Logger */.V.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");
                        return;
                    }
                    pivotTools/* PivotTools */.G._RemoveAndStorePivotPoint(this.attachedMesh);
                    const worldDragDirection = startingTurnDirection;
                    // Project the world right on to the drag plane
                    const toSub = event.dragPlaneNormal.scale(math_vector/* Vector3 */.Pq.Dot(event.dragPlaneNormal, worldDragDirection));
                    const dragAxis = worldDragDirection.subtract(toSub).normalizeToNew();
                    // project drag delta on to the resulting drag axis and rotate based on that
                    let projectDist = math_vector/* Vector3 */.Pq.Dot(dragAxis, event.delta) < 0 ? Math.abs(event.delta.length()) : -Math.abs(event.delta.length());
                    // Make rotation relative to size of mesh.
                    projectDist = (projectDist / this._boundingDimensions.length()) * this._anchorMesh.scaling.length();
                    // Rotate based on axis
                    if (!this.attachedMesh.rotationQuaternion) {
                        this.attachedMesh.rotationQuaternion = math_vector/* Quaternion */.PT.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z);
                    }
                    if (!this._anchorMesh.rotationQuaternion) {
                        this._anchorMesh.rotationQuaternion = math_vector/* Quaternion */.PT.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z);
                    }
                    // Do not allow the object to turn more than a full circle
                    totalTurnAmountOfDrag += projectDist;
                    if (Math.abs(totalTurnAmountOfDrag) <= 2 * Math.PI) {
                        if (this.rotationSnapDistance > 0) {
                            const dragSteps = Math.floor(Math.abs(totalTurnAmountOfDrag) / this.rotationSnapDistance) * (totalTurnAmountOfDrag < 0 ? -1 : 1);
                            const angle = this.rotationSnapDistance * dragSteps;
                            projectDist = angle - previousProjectDist;
                            previousProjectDist = angle;
                        }
                        if (i >= 8) {
                            math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(0, 0, projectDist, this._tmpQuaternion);
                        }
                        else if (i >= 4) {
                            math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(projectDist, 0, 0, this._tmpQuaternion);
                        }
                        else {
                            math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(0, projectDist, 0, this._tmpQuaternion);
                        }
                        // if using pivot, move anchor so mesh will be at relative (0,0,0) when parented
                        if (this.attachedMesh.isUsingPivotMatrix()) {
                            this._anchorMesh.position.copyFrom(this.attachedMesh.position);
                        }
                        // Rotate around center of bounding box
                        this._anchorMesh.addChild(this.attachedMesh);
                        if (this._anchorMesh.getScene().useRightHandedSystem) {
                            this._tmpQuaternion.conjugateInPlace();
                        }
                        this._tmpQuaternion.normalize();
                        this._anchorMesh.rotationQuaternion.multiplyToRef(this._tmpQuaternion, this._anchorMesh.rotationQuaternion);
                        this._anchorMesh.rotationQuaternion.normalize();
                        this._anchorMesh.removeChild(this.attachedMesh);
                        this.attachedMesh.setParent(originalParent);
                    }
                    this.updateBoundingBox();
                    pivotTools/* PivotTools */.G._RestorePivotPoint(this.attachedMesh);
                }
                this._updateDummy();
            });
            // Selection/deselection
            rotateAnchorsDragBehavior.onDragStartObservable.add(() => {
                this.onDragStartObservable.notifyObservers({ dragOperation: 0 /* DragOperation.Rotation */, dragAxis: computeAxis().clone() });
                this._dragging = true;
                this._selectNode(anchor);
            });
            rotateAnchorsDragBehavior.onDragEndObservable.add((event) => {
                this.onRotationSphereDragEndObservable.notifyObservers({ dragOperation: 0 /* DragOperation.Rotation */, dragAxis: computeAxis().clone() });
                this._dragging = false;
                this._selectNode(null);
                this._updateDummy();
                this._unhoverMeshOnTouchUp(event.pointerInfo, anchor);
            });
            this._rotateAnchorsDragBehaviors.push(rotateAnchorsDragBehavior);
            this._rotateAnchorsParent.addChild(anchor);
        }
        this._rootMesh.addChild(this._rotateAnchorsParent);
        // Create scale cubes
        this._scaleBoxesParent = new Meshes_transformNode/* TransformNode */.V("", gizmoLayer.utilityLayerScene);
        this._scaleBoxesParent.rotationQuaternion = new math_vector/* Quaternion */.PT();
        for (let i = 0; i < 3; i++) {
            for (let j = 0; j < 3; j++) {
                for (let k = 0; k < 3; k++) {
                    // create box for relevant axis
                    const zeroAxisCount = (i === 1 ? 1 : 0) + (j === 1 ? 1 : 0) + (k === 1 ? 1 : 0);
                    if (zeroAxisCount === 1 || zeroAxisCount === 3) {
                        continue;
                    }
                    const box = zeroAxisCount === 2 ? (0,boxBuilder/* CreateBox */.an)("", { size: 1 }, gizmoLayer.utilityLayerScene) : this._getCornerMesh(gizmoLayer);
                    if (zeroAxisCount === 0) {
                        box.rotationQuaternion = math_vector/* Quaternion */.PT.FromEulerAngles(j * 0.25 * Math.PI, (k + 3 * i - i * k) * 0.25 * Math.PI, 0);
                    }
                    box.material = this._coloredMaterial;
                    box._internalMetadata = zeroAxisCount === 2; // None homogenous scale handle
                    box.isNearGrabbable = true;
                    // box is oriented so, transform world desired axis to local one
                    math_vector/* TmpVectors */.AA.Vector3[0].set(i - 1, j - 1, k - 1);
                    math_vector/* TmpVectors */.AA.Vector3[0].normalize();
                    box.computeWorldMatrix(true).invertToRef(math_vector/* TmpVectors */.AA.Matrix[0]);
                    const dragAxis = math_vector/* Vector3 */.Pq.TransformCoordinates(math_vector/* TmpVectors */.AA.Vector3[0], math_vector/* TmpVectors */.AA.Matrix[0]);
                    dragAxis.normalize();
                    // Dragging logic
                    const scaleBoxesDragBehavior = new pointerDragBehavior/* PointerDragBehavior */.C({ dragAxis: dragAxis });
                    scaleBoxesDragBehavior.updateDragPlane = false;
                    scaleBoxesDragBehavior.moveAttached = false;
                    let totalRelativeDragDistance = 0;
                    let previousScale = 0;
                    box.addBehavior(scaleBoxesDragBehavior);
                    scaleBoxesDragBehavior.onDragObservable.add((event) => {
                        this.onScaleBoxDragObservable.notifyObservers({ dragOperation: 1 /* DragOperation.Scaling */, dragAxis: new math_vector/* Vector3 */.Pq(i - 1, j - 1, k - 1) });
                        if (this.attachedMesh) {
                            const originalParent = this.attachedMesh.parent;
                            if (originalParent && originalParent.scaling && originalParent.scaling.isNonUniformWithinEpsilon(0.001)) {
                                logger/* Logger */.V.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");
                                return;
                            }
                            pivotTools/* PivotTools */.G._RemoveAndStorePivotPoint(this.attachedMesh);
                            let relativeDragDistance = (event.dragDistance / this._boundingDimensions.length()) * this._anchorMesh.scaling.length();
                            totalRelativeDragDistance += relativeDragDistance;
                            if (this.scalingSnapDistance > 0) {
                                const dragSteps = Math.floor(Math.abs(totalRelativeDragDistance) / this.scalingSnapDistance) * (totalRelativeDragDistance < 0 ? -1 : 1);
                                const scale = this.scalingSnapDistance * dragSteps;
                                relativeDragDistance = scale - previousScale;
                                previousScale = scale;
                            }
                            const deltaScale = new math_vector/* Vector3 */.Pq(relativeDragDistance, relativeDragDistance, relativeDragDistance);
                            const fullScale = new math_vector/* Vector3 */.Pq(previousScale, previousScale, previousScale);
                            if (zeroAxisCount === 2) {
                                // scale on 1 axis when using the anchor box in the face middle
                                deltaScale.x *= Math.abs(dragAxis.x);
                                deltaScale.y *= Math.abs(dragAxis.y);
                                deltaScale.z *= Math.abs(dragAxis.z);
                            }
                            deltaScale.scaleInPlace(this._scaleDragSpeed);
                            deltaScale.multiplyInPlace(this._axisFactor);
                            fullScale.scaleInPlace(this._scaleDragSpeed);
                            fullScale.multiplyInPlace(this._axisFactor);
                            fullScale.addInPlace(this._incrementalStartupValue);
                            this.updateBoundingBox();
                            if (this.scalePivot) {
                                this.attachedMesh.getWorldMatrix().getRotationMatrixToRef(this._tmpRotationMatrix);
                                // Move anchor to desired pivot point (Bottom left corner + dimension/2)
                                this._boundingDimensions.scaleToRef(0.5, this._tmpVector);
                                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._tmpVector, this._tmpRotationMatrix, this._tmpVector);
                                this._anchorMesh.position.subtractInPlace(this._tmpVector);
                                this._boundingDimensions.multiplyToRef(this.scalePivot, this._tmpVector);
                                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._tmpVector, this._tmpRotationMatrix, this._tmpVector);
                                this._anchorMesh.position.addInPlace(this._tmpVector);
                            }
                            else {
                                // Scale from the position of the opposite corner
                                box.absolutePosition.subtractToRef(this._anchorMesh.position, this._tmpVector);
                                this._anchorMesh.position.subtractInPlace(this._tmpVector);
                                if (this.attachedMesh.isUsingPivotMatrix()) {
                                    this._anchorMesh.position.subtractInPlace(this.attachedMesh.getPivotPoint());
                                }
                            }
                            this._anchorMesh.addChild(this.attachedMesh);
                            if (this.incrementalSnap) {
                                fullScale.x /= Math.abs(this._incrementalStartupValue.x) < math_constants/* Epsilon */.bH ? 1 : this._incrementalStartupValue.x;
                                fullScale.y /= Math.abs(this._incrementalStartupValue.y) < math_constants/* Epsilon */.bH ? 1 : this._incrementalStartupValue.y;
                                fullScale.z /= Math.abs(this._incrementalStartupValue.z) < math_constants/* Epsilon */.bH ? 1 : this._incrementalStartupValue.z;
                                fullScale.x = Math.max(this._incrementalAnchorStartupValue.x * fullScale.x, this.scalingSnapDistance);
                                fullScale.y = Math.max(this._incrementalAnchorStartupValue.y * fullScale.y, this.scalingSnapDistance);
                                fullScale.z = Math.max(this._incrementalAnchorStartupValue.z * fullScale.z, this.scalingSnapDistance);
                                this._anchorMesh.scaling.x += (fullScale.x - this._anchorMesh.scaling.x) * Math.abs(dragAxis.x);
                                this._anchorMesh.scaling.y += (fullScale.y - this._anchorMesh.scaling.y) * Math.abs(dragAxis.y);
                                this._anchorMesh.scaling.z += (fullScale.z - this._anchorMesh.scaling.z) * Math.abs(dragAxis.z);
                            }
                            else {
                                this._anchorMesh.scaling.addInPlace(deltaScale);
                                if (this._anchorMesh.scaling.x < 0 || this._anchorMesh.scaling.y < 0 || this._anchorMesh.scaling.z < 0) {
                                    this._anchorMesh.scaling.subtractInPlace(deltaScale);
                                }
                            }
                            this._anchorMesh.removeChild(this.attachedMesh);
                            this.attachedMesh.setParent(originalParent);
                            pivotTools/* PivotTools */.G._RestorePivotPoint(this.attachedMesh);
                        }
                        this._updateDummy();
                    });
                    // Selection/deselection
                    scaleBoxesDragBehavior.onDragStartObservable.add(() => {
                        this.onDragStartObservable.notifyObservers({ dragOperation: 1 /* DragOperation.Scaling */, dragAxis: new math_vector/* Vector3 */.Pq(i - 1, j - 1, k - 1) });
                        this._dragging = true;
                        this._selectNode(box);
                        totalRelativeDragDistance = 0;
                        previousScale = 0;
                        this._incrementalStartupValue.copyFrom(this.attachedMesh.scaling);
                        this._incrementalAnchorStartupValue.copyFrom(this._anchorMesh.scaling);
                    });
                    scaleBoxesDragBehavior.onDragEndObservable.add((event) => {
                        this.onScaleBoxDragEndObservable.notifyObservers({ dragOperation: 1 /* DragOperation.Scaling */, dragAxis: new math_vector/* Vector3 */.Pq(i - 1, j - 1, k - 1) });
                        this._dragging = false;
                        this._selectNode(null);
                        this._updateDummy();
                        this._unhoverMeshOnTouchUp(event.pointerInfo, box);
                    });
                    this._scaleBoxesParent.addChild(box);
                    this._scaleBoxesDragBehaviors.push(scaleBoxesDragBehavior);
                }
            }
        }
        this._rootMesh.addChild(this._scaleBoxesParent);
        // Hover color change
        const pointerIds = [];
        this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
            if (!pointerIds[pointerInfo.event.pointerId]) {
                this._rotateAnchorsParent
                    .getChildMeshes()
                    .concat(this._scaleBoxesParent.getChildMeshes())
                    .forEach((mesh) => {
                    if (pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh == mesh) {
                        pointerIds[pointerInfo.event.pointerId] = mesh;
                        mesh.material = this._hoverColoredMaterial;
                        this.onHoverStartObservable.notifyObservers();
                        this._isHovered = true;
                    }
                });
            }
            else {
                if (pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh != pointerIds[pointerInfo.event.pointerId]) {
                    pointerIds[pointerInfo.event.pointerId].material = this._coloredMaterial;
                    delete pointerIds[pointerInfo.event.pointerId];
                    this.onHoverEndObservable.notifyObservers();
                    this._isHovered = false;
                }
            }
        });
        // Update bounding box positions
        this._renderObserver = this.gizmoLayer.originalScene.onBeforeRenderObservable.add(() => {
            // Only update the bounding box if scaling has changed
            if (this.attachedMesh && !this._existingMeshScale.equals(this.attachedMesh.scaling)) {
                this.updateBoundingBox();
            }
            else if (this.fixedDragMeshScreenSize || this.fixedDragMeshBoundsSize) {
                this._updateRotationAnchors();
                this._updateScaleBoxes();
            }
            // If drag mesh is enabled and dragging, update the attached mesh pose to match the drag mesh
            if (this._dragMesh && this.attachedMesh && this._pointerDragBehavior.dragging) {
                this._lineBoundingBox.position.rotateByQuaternionToRef(this._rootMesh.rotationQuaternion, this._tmpVector);
                this.attachedMesh.setAbsolutePosition(this._dragMesh.position.add(this._tmpVector.scale(-1)));
            }
        });
        this.updateBoundingBox();
    }
    _getCornerMesh(gizmoLayer) {
        if (!this._cornerMesh) {
            const boxZ = (0,boxBuilder/* CreateBox */.an)("", { width: 0.4, height: 0.4, depth: 1.6 }, gizmoLayer.utilityLayerScene);
            boxZ.position.z = 0.6;
            const boxY = (0,boxBuilder/* CreateBox */.an)("", { width: 0.4, height: 1.6, depth: 0.4 }, gizmoLayer.utilityLayerScene);
            boxY.position.y = 0.6;
            const boxX = (0,boxBuilder/* CreateBox */.an)("", { width: 1.6, height: 0.4, depth: 0.4 }, gizmoLayer.utilityLayerScene);
            boxX.position.x = 0.6;
            this._cornerMesh = Meshes_mesh/* Mesh */.e.MergeMeshes([boxX, boxY, boxZ], true);
            return this._cornerMesh;
        }
        return this._cornerMesh.clone();
    }
    _attachedNodeChanged(value) {
        if (value) {
            // Reset anchor mesh to match attached mesh's scale
            // This is needed to avoid invalid box/anchor position on first drag
            this._anchorMesh.scaling.setAll(1);
            pivotTools/* PivotTools */.G._RemoveAndStorePivotPoint(value);
            const originalParent = value.parent;
            this._anchorMesh.addChild(value);
            this._anchorMesh.removeChild(value);
            value.setParent(originalParent);
            pivotTools/* PivotTools */.G._RestorePivotPoint(value);
            this.updateBoundingBox();
            value.getChildMeshes(false).forEach((m) => {
                m.markAsDirty("scaling");
            });
            this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce(() => {
                this._updateDummy();
            });
        }
    }
    _selectNode(selectedMesh) {
        this._rotateAnchorsParent
            .getChildMeshes()
            .concat(this._scaleBoxesParent.getChildMeshes())
            .forEach((m) => {
            m.isVisible = !selectedMesh || m == selectedMesh;
        });
    }
    _unhoverMeshOnTouchUp(pointerInfo, selectedMesh) {
        // force unhover mesh if not a mouse event
        if (pointerInfo?.event instanceof PointerEvent && pointerInfo?.event.pointerType === "touch") {
            selectedMesh.material = this._coloredMaterial;
        }
    }
    /**
     * returns an array containing all boxes used for scaling (in increasing x, y and z orders)
     * @returns array of scaling boxes
     */
    getScaleBoxes() {
        return this._scaleBoxesParent.getChildMeshes();
    }
    /**
     * Updates the bounding box information for the Gizmo
     */
    updateBoundingBox() {
        if (this.attachedMesh) {
            pivotTools/* PivotTools */.G._RemoveAndStorePivotPoint(this.attachedMesh);
            // Store original parent
            const originalParent = this.attachedMesh.parent;
            this.attachedMesh.setParent(null);
            this._update();
            // Rotate based on axis
            if (!this.attachedMesh.rotationQuaternion) {
                this.attachedMesh.rotationQuaternion = math_vector/* Quaternion */.PT.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z);
            }
            if (!this._anchorMesh.rotationQuaternion) {
                this._anchorMesh.rotationQuaternion = math_vector/* Quaternion */.PT.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z);
            }
            this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion);
            // 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
            const boundingMinMax = this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren, this.includeChildPredicate);
            boundingMinMax.max.subtractToRef(boundingMinMax.min, this._boundingDimensions);
            // Update gizmo to match bounding box scaling and rotation
            // The position set here is the offset from the origin for the boundingbox when the attached mesh is at the origin
            // The position of the gizmo is then set to the attachedMesh in gizmo._update
            this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions);
            this._lineBoundingBox.position.set((boundingMinMax.max.x + boundingMinMax.min.x) / 2, (boundingMinMax.max.y + boundingMinMax.min.y) / 2, (boundingMinMax.max.z + boundingMinMax.min.z) / 2);
            this._rotateAnchorsParent.position.copyFrom(this._lineBoundingBox.position);
            this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position);
            this._lineBoundingBox.computeWorldMatrix();
            this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition);
            // Restore position/rotation values
            this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion);
            this.attachedMesh.position.copyFrom(this._tmpVector);
            // Restore original parent
            this.attachedMesh.setParent(originalParent);
        }
        this._updateRotationAnchors();
        this._updateScaleBoxes();
        if (this.attachedMesh) {
            this._existingMeshScale.copyFrom(this.attachedMesh.scaling);
            pivotTools/* PivotTools */.G._RestorePivotPoint(this.attachedMesh);
        }
    }
    _updateRotationAnchors() {
        const rotateAnchors = this._rotateAnchorsParent.getChildMeshes();
        for (let i = 0; i < 3; i++) {
            for (let j = 0; j < 2; j++) {
                for (let k = 0; k < 2; k++) {
                    const index = i * 4 + j * 2 + k;
                    rotateAnchors[index].position.normalizeToRef(math_vector/* TmpVectors */.AA.Vector3[0]);
                    if (i == 0) {
                        rotateAnchors[index].position.set(0, this._boundingDimensions.y * (j - 0.5), this._boundingDimensions.z * (k - 0.5));
                        math_vector/* TmpVectors */.AA.Vector3[1].set(1, 0, 0);
                    }
                    if (i == 1) {
                        rotateAnchors[index].position.set(this._boundingDimensions.x * (j - 0.5), 0, this._boundingDimensions.z * (k - 0.5));
                        math_vector/* TmpVectors */.AA.Vector3[1].set(0, 1, 0);
                    }
                    if (i == 2) {
                        rotateAnchors[index].position.set(this._boundingDimensions.x * (j - 0.5), this._boundingDimensions.y * (k - 0.5), 0);
                        math_vector/* TmpVectors */.AA.Vector3[1].set(0, 0, 1);
                    }
                    const target = math_vector/* TmpVectors */.AA.Vector3[2];
                    math_vector/* Vector3 */.Pq.CrossToRef(math_vector/* TmpVectors */.AA.Vector3[0], math_vector/* TmpVectors */.AA.Vector3[1], target);
                    target.normalize();
                    target.addInPlace(rotateAnchors[index].position);
                    rotateAnchors[index].lookAt(target);
                    if (this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {
                        rotateAnchors[index].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);
                        const distanceFromCamera = (this.rotationSphereSize * this._tmpVector.length()) / this.fixedDragMeshScreenSizeDistanceFactor;
                        rotateAnchors[index].scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);
                    }
                    else if (this.fixedDragMeshBoundsSize) {
                        rotateAnchors[index].scaling.set(this.rotationSphereSize * this._boundingDimensions.x, this.rotationSphereSize * this._boundingDimensions.y, this.rotationSphereSize * this._boundingDimensions.z);
                    }
                    else {
                        rotateAnchors[index].scaling.set(this.rotationSphereSize, this.rotationSphereSize, this.rotationSphereSize);
                    }
                }
            }
        }
    }
    _updateScaleBoxes() {
        const scaleBoxes = this._scaleBoxesParent.getChildMeshes();
        let index = 0;
        for (let i = 0; i < 3; i++) {
            for (let j = 0; j < 3; j++) {
                for (let k = 0; k < 3; k++) {
                    const zeroAxisCount = (i === 1 ? 1 : 0) + (j === 1 ? 1 : 0) + (k === 1 ? 1 : 0);
                    if (zeroAxisCount === 1 || zeroAxisCount === 3) {
                        continue;
                    }
                    if (scaleBoxes[index]) {
                        scaleBoxes[index].position.set(this._boundingDimensions.x * (i / 2), this._boundingDimensions.y * (j / 2), this._boundingDimensions.z * (k / 2));
                        scaleBoxes[index].position.addInPlace(new math_vector/* Vector3 */.Pq(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
                        if (this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {
                            scaleBoxes[index].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.globalPosition, this._tmpVector);
                            const distanceFromCamera = (this.scaleBoxSize * this._tmpVector.length()) / this.fixedDragMeshScreenSizeDistanceFactor;
                            scaleBoxes[index].scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);
                        }
                        else if (this.fixedDragMeshBoundsSize) {
                            scaleBoxes[index].scaling.set(this.scaleBoxSize * this._boundingDimensions.x, this.scaleBoxSize * this._boundingDimensions.y, this.scaleBoxSize * this._boundingDimensions.z);
                        }
                        else {
                            scaleBoxes[index].scaling.set(this.scaleBoxSize, this.scaleBoxSize, this.scaleBoxSize);
                        }
                    }
                    index++;
                }
            }
        }
    }
    /**
     * Enables rotation on the specified axis and disables rotation on the others
     * @param axis The list of axis that should be enabled (eg. "xy" or "xyz")
     */
    setEnabledRotationAxis(axis) {
        this._rotateAnchorsParent.getChildMeshes().forEach((m, i) => {
            if (i < 4) {
                m.setEnabled(axis.indexOf("x") != -1);
            }
            else if (i < 8) {
                m.setEnabled(axis.indexOf("y") != -1);
            }
            else {
                m.setEnabled(axis.indexOf("z") != -1);
            }
        });
    }
    /**
     * Enables/disables scaling
     * @param enable if scaling should be enabled
     * @param homogeneousScaling defines if scaling should only be homogeneous
     */
    setEnabledScaling(enable, homogeneousScaling = false) {
        this._scaleBoxesParent.getChildMeshes().forEach((m) => {
            let enableMesh = enable;
            // Disable heterogeneous scale handles if requested.
            if (homogeneousScaling && m._internalMetadata === true) {
                enableMesh = false;
            }
            m.setEnabled(enableMesh);
        });
    }
    _updateDummy() {
        if (this._dragMesh) {
            this._dragMesh.position.copyFrom(this._lineBoundingBox.getAbsolutePosition());
            this._dragMesh.scaling.copyFrom(this._lineBoundingBox.scaling);
            this._dragMesh.rotationQuaternion.copyFrom(this._rootMesh.rotationQuaternion);
        }
    }
    /**
     * Enables a pointer drag behavior on the bounding box of the gizmo
     */
    enableDragBehavior() {
        this._dragMesh = (0,boxBuilder/* CreateBox */.an)("dummy", { size: 1 }, this.gizmoLayer.utilityLayerScene);
        this._dragMesh.visibility = 0;
        this._dragMesh.rotationQuaternion = new math_vector/* Quaternion */.PT();
        this._pointerDragBehavior.useObjectOrientationForDragging = false;
        this._dragMesh.addBehavior(this._pointerDragBehavior);
    }
    /**
     * Force release the drag action by code
     */
    releaseDrag() {
        this._scaleBoxesDragBehaviors.forEach((dragBehavior) => {
            dragBehavior.releaseDrag();
        });
        this._rotateAnchorsDragBehaviors.forEach((dragBehavior) => {
            dragBehavior.releaseDrag();
        });
        this._pointerDragBehavior.releaseDrag();
    }
    /**
     * Disposes of the gizmo
     */
    dispose() {
        this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
        this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver);
        this._lineBoundingBox.dispose();
        this._rotateAnchorsParent.dispose();
        this._scaleBoxesParent.dispose();
        if (this._dragMesh) {
            this._dragMesh.dispose();
        }
        this._scaleBoxesDragBehaviors.length = 0;
        this._rotateAnchorsDragBehaviors.length = 0;
        this.onDragStartObservable.clear();
        this.onHoverStartObservable.clear();
        this.onHoverEndObservable.clear();
        this.onScaleBoxDragObservable.clear();
        this.onScaleBoxDragEndObservable.clear();
        this.onRotationSphereDragObservable.clear();
        this.onRotationSphereDragEndObservable.clear();
        super.dispose();
    }
    /**
     * Makes a mesh not pickable and wraps the mesh inside of a bounding box mesh that is pickable. (This is useful to avoid picking within complex geometry)
     * @param mesh the mesh to wrap in the bounding box mesh and make not pickable
     * @returns the bounding box mesh with the passed in mesh as a child
     */
    static MakeNotPickableAndWrapInBoundingBox(mesh) {
        const makeNotPickable = (root) => {
            root.isPickable = false;
            root.getChildMeshes().forEach((c) => {
                makeNotPickable(c);
            });
        };
        makeNotPickable(mesh);
        // Reset position to get bounding box from origin with no rotation
        if (!mesh.rotationQuaternion) {
            mesh.rotationQuaternion = math_vector/* Quaternion */.PT.RotationYawPitchRoll(mesh.rotation.y, mesh.rotation.x, mesh.rotation.z);
        }
        const oldPos = mesh.position.clone();
        const oldRot = mesh.rotationQuaternion.clone();
        mesh.rotationQuaternion.set(0, 0, 0, 1);
        mesh.position.set(0, 0, 0);
        // Update bounding dimensions/positions
        const box = (0,boxBuilder/* CreateBox */.an)("box", { size: 1 }, mesh.getScene());
        const boundingMinMax = mesh.getHierarchyBoundingVectors();
        boundingMinMax.max.subtractToRef(boundingMinMax.min, box.scaling);
        // Adjust scale to avoid undefined behavior when adding child
        if (box.scaling.y === 0) {
            box.scaling.y = math_constants/* Epsilon */.bH;
        }
        if (box.scaling.x === 0) {
            box.scaling.x = math_constants/* Epsilon */.bH;
        }
        if (box.scaling.z === 0) {
            box.scaling.z = math_constants/* Epsilon */.bH;
        }
        box.position.set((boundingMinMax.max.x + boundingMinMax.min.x) / 2, (boundingMinMax.max.y + boundingMinMax.min.y) / 2, (boundingMinMax.max.z + boundingMinMax.min.z) / 2);
        // Restore original positions
        mesh.addChild(box);
        mesh.rotationQuaternion.copyFrom(oldRot);
        mesh.position.copyFrom(oldPos);
        // Reverse parenting
        mesh.removeChild(box);
        box.addChild(mesh);
        box.visibility = 0;
        return box;
    }
    /**
     * CustomMeshes are not supported by this gizmo
     */
    setCustomMesh() {
        logger/* Logger */.V.Error("Custom meshes are not supported on this gizmo");
    }
}
//# sourceMappingURL=boundingBoxGizmo.js.map
;// ./node_modules/@babylonjs/core/Gizmos/planeRotationGizmo.js















/**
 * Single plane rotation gizmo
 */
class PlaneRotationGizmo extends gizmo/* Gizmo */.Fq {
    /** Default material used to render when gizmo is not disabled or hovered */
    get coloredMaterial() {
        return this._coloredMaterial;
    }
    /** Material used to render when gizmo is hovered with mouse */
    get hoverMaterial() {
        return this._hoverMaterial;
    }
    /** Color used to render the drag angle sector when gizmo is rotated with mouse */
    set rotationColor(color) {
        this._rotationShaderMaterial.setColor3("rotationColor", color);
    }
    /** Material used to render when gizmo is disabled. typically grey. */
    get disableMaterial() {
        return this._disableMaterial;
    }
    /**
     * Creates a PlaneRotationGizmo
     * @param planeNormal The normal of the plane which the gizmo will be able to rotate on
     * @param color The color of the gizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     * @param tessellation Amount of tessellation to be used when creating rotation circles
     * @param parent
     * @param useEulerRotation Use and update Euler angle instead of quaternion
     * @param thickness display gizmo axis thickness
     * @param hoverColor The color of the gizmo when hovering over and dragging
     * @param disableColor The Color of the gizmo when its disabled
     */
    constructor(planeNormal, color = math_color/* Color3 */.v9.Gray(), gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer, tessellation = 32, parent = null, 
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    useEulerRotation = false, thickness = 1, hoverColor = math_color/* Color3 */.v9.Yellow(), disableColor = math_color/* Color3 */.v9.Gray()) {
        super(gizmoLayer);
        this._pointerObserver = null;
        /**
         * Rotation distance in radians that the gizmo will snap to (Default: 0)
         */
        this.snapDistance = 0;
        /**
         * Event that fires each time the gizmo snaps to a new location.
         * * snapDistance is the change in distance
         */
        this.onSnapObservable = new Misc_observable/* Observable */.cP();
        /**
         * Accumulated relative angle value for rotation on the axis. Reset to 0 when a dragStart occurs
         */
        this.angle = 0;
        /**
         * Custom sensitivity value for the drag strength
         */
        this.sensitivity = 1;
        this._isEnabled = true;
        this._parent = null;
        this._dragging = false;
        this._angles = new math_vector/* Vector3 */.Pq();
        this._parent = parent;
        // Create Material
        this._coloredMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._coloredMaterial.diffuseColor = color;
        this._coloredMaterial.specularColor = color.subtract(new math_color/* Color3 */.v9(0.1, 0.1, 0.1));
        this._hoverMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._hoverMaterial.diffuseColor = hoverColor;
        this._hoverMaterial.specularColor = hoverColor;
        this._disableMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._disableMaterial.diffuseColor = disableColor;
        this._disableMaterial.alpha = 0.4;
        // Build mesh on root node
        this._gizmoMesh = new Meshes_mesh/* Mesh */.e("", gizmoLayer.utilityLayerScene);
        const { rotationMesh, collider } = this._createGizmoMesh(this._gizmoMesh, thickness, tessellation);
        // Setup Rotation Circle
        this._rotationDisplayPlane = (0,planeBuilder/* CreatePlane */.x)("rotationDisplay", {
            size: 0.6,
            updatable: false,
        }, this.gizmoLayer.utilityLayerScene);
        this._rotationDisplayPlane.rotation.z = Math.PI * 0.5;
        this._rotationDisplayPlane.parent = this._gizmoMesh;
        this._rotationDisplayPlane.setEnabled(false);
        Materials_effect/* Effect */.M.ShadersStore["rotationGizmoVertexShader"] = PlaneRotationGizmo._RotationGizmoVertexShader;
        Materials_effect/* Effect */.M.ShadersStore["rotationGizmoFragmentShader"] = PlaneRotationGizmo._RotationGizmoFragmentShader;
        this._rotationShaderMaterial = new shaderMaterial/* ShaderMaterial */.B("shader", this.gizmoLayer.utilityLayerScene, {
            vertex: "rotationGizmo",
            fragment: "rotationGizmo",
        }, {
            attributes: ["position", "uv"],
            uniforms: ["worldViewProjection", "angles", "rotationColor"],
        });
        this._rotationShaderMaterial.backFaceCulling = false;
        this.rotationColor = hoverColor;
        this._rotationDisplayPlane.material = this._rotationShaderMaterial;
        this._rotationDisplayPlane.visibility = 0.999;
        this._gizmoMesh.lookAt(this._rootMesh.position.add(planeNormal));
        this._rootMesh.addChild(this._gizmoMesh, gizmo/* Gizmo */.Fq.PreserveScaling);
        this._gizmoMesh.scaling.scaleInPlace(1 / 3);
        // Add drag behavior to handle events when the gizmo is dragged
        this.dragBehavior = new pointerDragBehavior/* PointerDragBehavior */.C({ dragPlaneNormal: planeNormal });
        this.dragBehavior.moveAttached = false;
        this.dragBehavior.maxDragAngle = PlaneRotationGizmo.MaxDragAngle;
        this.dragBehavior._useAlternatePickedPointAboveMaxDragAngle = true;
        this._rootMesh.addBehavior(this.dragBehavior);
        // Closures for drag logic
        const lastDragPosition = new math_vector/* Vector3 */.Pq();
        const rotationMatrix = new math_vector/* Matrix */.uq();
        const planeNormalTowardsCamera = new math_vector/* Vector3 */.Pq();
        let localPlaneNormalTowardsCamera = new math_vector/* Vector3 */.Pq();
        this.dragBehavior.onDragStartObservable.add((e) => {
            if (this.attachedNode) {
                lastDragPosition.copyFrom(e.dragPlanePoint);
                this._rotationDisplayPlane.setEnabled(true);
                this._rotationDisplayPlane.getWorldMatrix().invertToRef(rotationMatrix);
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(e.dragPlanePoint, rotationMatrix, lastDragPosition);
                this._angles.x = Math.atan2(lastDragPosition.y, lastDragPosition.x) + Math.PI;
                this._angles.y = 0;
                this._angles.z = this.updateGizmoRotationToMatchAttachedMesh ? 1 : 0;
                this._dragging = true;
                lastDragPosition.copyFrom(e.dragPlanePoint);
                this._rotationShaderMaterial.setVector3("angles", this._angles);
                this.angle = 0;
            }
        });
        this.dragBehavior.onDragEndObservable.add(() => {
            this._dragging = false;
            this._rotationDisplayPlane.setEnabled(false);
        });
        const tmpSnapEvent = { snapDistance: 0 };
        let currentSnapDragDistance = 0;
        const tmpMatrix = new math_vector/* Matrix */.uq();
        const amountToRotate = new math_vector/* Quaternion */.PT();
        this.dragBehavior.onDragObservable.add((event) => {
            if (this.attachedNode) {
                // Calc angle over full 360 degree (https://stackoverflow.com/questions/43493711/the-angle-between-two-3d-vectors-with-a-result-range-0-360)
                const nodeScale = new math_vector/* Vector3 */.Pq(1, 1, 1);
                const nodeQuaternion = new math_vector/* Quaternion */.PT(0, 0, 0, 1);
                const nodeTranslation = new math_vector/* Vector3 */.Pq(0, 0, 0);
                this.attachedNode.getWorldMatrix().decompose(nodeScale, nodeQuaternion, nodeTranslation);
                // uniform scaling of absolute value of components
                // (-1,1,1) is uniform but (1,1.001,1) is not
                const uniformScaling = Math.abs(Math.abs(nodeScale.x) - Math.abs(nodeScale.y)) <= math_constants/* Epsilon */.bH && Math.abs(Math.abs(nodeScale.x) - Math.abs(nodeScale.z)) <= math_constants/* Epsilon */.bH;
                if (!uniformScaling && this.updateGizmoRotationToMatchAttachedMesh) {
                    logger/* Logger */.V.Warn("Unable to use a rotation gizmo matching mesh rotation with non uniform scaling. Use uniform scaling or set updateGizmoRotationToMatchAttachedMesh to false.");
                    return;
                }
                nodeQuaternion.normalize();
                const nodeTranslationForOperation = this.updateGizmoPositionToMatchAttachedMesh ? nodeTranslation : this._rootMesh.absolutePosition;
                const newVector = event.dragPlanePoint.subtract(nodeTranslationForOperation).normalize();
                const originalVector = lastDragPosition.subtract(nodeTranslationForOperation).normalize();
                const cross = math_vector/* Vector3 */.Pq.Cross(newVector, originalVector);
                const dot = math_vector/* Vector3 */.Pq.Dot(newVector, originalVector);
                let angle = Math.atan2(cross.length(), dot) * this.sensitivity;
                planeNormalTowardsCamera.copyFrom(planeNormal);
                localPlaneNormalTowardsCamera.copyFrom(planeNormal);
                if (this.updateGizmoRotationToMatchAttachedMesh) {
                    nodeQuaternion.toRotationMatrix(rotationMatrix);
                    localPlaneNormalTowardsCamera = math_vector/* Vector3 */.Pq.TransformCoordinates(planeNormalTowardsCamera, rotationMatrix);
                }
                // Flip up vector depending on which side the camera is on
                let cameraFlipped = false;
                if (gizmoLayer.utilityLayerScene.activeCamera) {
                    const camVec = gizmoLayer.utilityLayerScene.activeCamera.position.subtract(nodeTranslationForOperation).normalize();
                    if (math_vector/* Vector3 */.Pq.Dot(camVec, localPlaneNormalTowardsCamera) > 0) {
                        planeNormalTowardsCamera.scaleInPlace(-1);
                        localPlaneNormalTowardsCamera.scaleInPlace(-1);
                        cameraFlipped = true;
                    }
                }
                const halfCircleSide = math_vector/* Vector3 */.Pq.Dot(localPlaneNormalTowardsCamera, cross) > 0.0;
                if (halfCircleSide) {
                    angle = -angle;
                }
                math_vector/* TmpVectors */.AA.Vector3[0].set(angle, 0, 0);
                if (!this.dragBehavior.validateDrag(math_vector/* TmpVectors */.AA.Vector3[0])) {
                    angle = 0;
                }
                // Snapping logic
                let snapped = false;
                if (this.snapDistance != 0) {
                    currentSnapDragDistance += angle;
                    if (Math.abs(currentSnapDragDistance) > this.snapDistance) {
                        let dragSteps = Math.floor(Math.abs(currentSnapDragDistance) / this.snapDistance);
                        if (currentSnapDragDistance < 0) {
                            dragSteps *= -1;
                        }
                        currentSnapDragDistance = currentSnapDragDistance % this.snapDistance;
                        angle = this.snapDistance * dragSteps;
                        snapped = true;
                    }
                    else {
                        angle = 0;
                    }
                }
                // Convert angle and axis to quaternion (http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm)
                const quaternionCoefficient = Math.sin(angle / 2);
                amountToRotate.set(planeNormalTowardsCamera.x * quaternionCoefficient, planeNormalTowardsCamera.y * quaternionCoefficient, planeNormalTowardsCamera.z * quaternionCoefficient, Math.cos(angle / 2));
                // If the meshes local scale is inverted (eg. loaded gltf file parent with z scale of -1) the rotation needs to be inverted on the y axis
                if (tmpMatrix.determinant() > 0) {
                    const tmpVector = new math_vector/* Vector3 */.Pq();
                    amountToRotate.toEulerAnglesToRef(tmpVector);
                    math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(tmpVector.y, -tmpVector.x, -tmpVector.z, amountToRotate);
                }
                if (this.updateGizmoRotationToMatchAttachedMesh) {
                    // Rotate selected mesh quaternion over fixed axis
                    nodeQuaternion.multiplyToRef(amountToRotate, nodeQuaternion);
                    nodeQuaternion.normalize();
                    // recompose matrix
                    math_vector/* Matrix */.uq.ComposeToRef(nodeScale, nodeQuaternion, nodeTranslation, this.attachedNode.getWorldMatrix());
                }
                else {
                    // Rotate selected mesh quaternion over rotated axis
                    amountToRotate.toRotationMatrix(math_vector/* TmpVectors */.AA.Matrix[0]);
                    const translation = this.attachedNode.getWorldMatrix().getTranslation();
                    this.attachedNode.getWorldMatrix().multiplyToRef(math_vector/* TmpVectors */.AA.Matrix[0], this.attachedNode.getWorldMatrix());
                    this.attachedNode.getWorldMatrix().setTranslation(translation);
                }
                lastDragPosition.copyFrom(event.dragPlanePoint);
                if (snapped) {
                    tmpSnapEvent.snapDistance = angle;
                    this.onSnapObservable.notifyObservers(tmpSnapEvent);
                }
                this._angles.y += angle;
                this.angle += cameraFlipped ? -angle : angle;
                this._rotationShaderMaterial.setVector3("angles", this._angles);
                this._matrixChanged();
            }
        });
        const light = gizmoLayer._getSharedGizmoLight();
        light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(false));
        const cache = {
            colliderMeshes: [collider],
            gizmoMeshes: [rotationMesh],
            material: this._coloredMaterial,
            hoverMaterial: this._hoverMaterial,
            disableMaterial: this._disableMaterial,
            active: false,
            dragBehavior: this.dragBehavior,
        };
        this._parent?.addToAxisCache(this._gizmoMesh, cache);
        this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
            if (this._customMeshSet) {
                return;
            }
            // updating here the maxangle because ondragstart is too late (value already used) and the updated value is not taken into account
            this.dragBehavior.maxDragAngle = PlaneRotationGizmo.MaxDragAngle;
            this._isHovered = !!(cache.colliderMeshes.indexOf(pointerInfo?.pickInfo?.pickedMesh) != -1);
            if (!this._parent) {
                const material = cache.dragBehavior.enabled ? (this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial) : this._disableMaterial;
                this._setGizmoMeshMaterial(cache.gizmoMeshes, material);
            }
        });
        this.dragBehavior.onEnabledObservable.add((newState) => {
            this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? this._coloredMaterial : this._disableMaterial);
        });
    }
    /**
     * @internal
     * Create Geometry for Gizmo
     * @param parentMesh
     * @param thickness
     * @param tessellation
     * @returns
     */
    _createGizmoMesh(parentMesh, thickness, tessellation) {
        const collider = CreateTorus("ignore", {
            diameter: 0.6,
            thickness: 0.03 * thickness,
            tessellation,
        }, this.gizmoLayer.utilityLayerScene);
        collider.visibility = 0;
        const rotationMesh = CreateTorus("", {
            diameter: 0.6,
            thickness: 0.005 * thickness,
            tessellation,
        }, this.gizmoLayer.utilityLayerScene);
        rotationMesh.material = this._coloredMaterial;
        // Position arrow pointing in its drag axis
        rotationMesh.rotation.x = Math.PI / 2;
        collider.rotation.x = Math.PI / 2;
        parentMesh.addChild(rotationMesh, gizmo/* Gizmo */.Fq.PreserveScaling);
        parentMesh.addChild(collider, gizmo/* Gizmo */.Fq.PreserveScaling);
        return { rotationMesh, collider };
    }
    _attachedNodeChanged(value) {
        if (this.dragBehavior) {
            this.dragBehavior.enabled = value ? true : false;
        }
    }
    /**
     * If the gizmo is enabled
     */
    set isEnabled(value) {
        this._isEnabled = value;
        if (!value) {
            this.attachedMesh = null;
        }
        else {
            if (this._parent) {
                this.attachedMesh = this._parent.attachedMesh;
            }
        }
    }
    get isEnabled() {
        return this._isEnabled;
    }
    /**
     * Disposes of the gizmo
     */
    dispose() {
        this.onSnapObservable.clear();
        this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
        this.dragBehavior.detach();
        if (this._gizmoMesh) {
            this._gizmoMesh.dispose();
        }
        if (this._rotationDisplayPlane) {
            this._rotationDisplayPlane.dispose();
        }
        if (this._rotationShaderMaterial) {
            this._rotationShaderMaterial.dispose();
        }
        [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {
            if (matl) {
                matl.dispose();
            }
        });
        super.dispose();
    }
}
/**
 * The maximum angle between the camera and the rotation allowed for interaction
 * If a rotation plane appears 'flat', a lower value allows interaction.
 */
PlaneRotationGizmo.MaxDragAngle = (Math.PI * 9) / 20;
PlaneRotationGizmo._RotationGizmoVertexShader = `
        precision highp float;
        attribute vec3 position;
        attribute vec2 uv;
        uniform mat4 worldViewProjection;
        varying vec3 vPosition;
        varying vec2 vUV;

        void main(void) {
            gl_Position = worldViewProjection * vec4(position, 1.0);
            vUV = uv;
        }`;
PlaneRotationGizmo._RotationGizmoFragmentShader = `
        precision highp float;
        varying vec2 vUV;
        varying vec3 vPosition;
        uniform vec3 angles;
        uniform vec3 rotationColor;

        #define twopi 6.283185307

        void main(void) {
            vec2 uv = vUV - vec2(0.5);
            float angle = atan(uv.y, uv.x) + 3.141592;
            float delta = gl_FrontFacing ? angles.y : -angles.y;
            float begin = angles.x - delta * angles.z;
            float start = (begin < (begin + delta)) ? begin : (begin + delta);
            float end = (begin > (begin + delta)) ? begin : (begin + delta);
            float len = sqrt(dot(uv,uv));
            float opacity = 1. - step(0.5, len);

            float base = abs(floor(start / twopi)) * twopi;
            start += base;
            end += base;

            float intensity = 0.;
            for (int i = 0; i < 5; i++)
            {
                intensity += max(step(start, angle) - step(end, angle), 0.);
                angle += twopi;
            }
            gl_FragColor = vec4(rotationColor, min(intensity * 0.25, 0.8)) * opacity;
        }
    `;
//# sourceMappingURL=planeRotationGizmo.js.map
;// ./node_modules/@babylonjs/core/Gizmos/rotationGizmo.js







/**
 * Gizmo that enables rotating a mesh along 3 axis
 */
class RotationGizmo extends gizmo/* Gizmo */.Fq {
    get attachedMesh() {
        return this._meshAttached;
    }
    set attachedMesh(mesh) {
        this._meshAttached = mesh;
        this._nodeAttached = mesh;
        this._checkBillboardTransform();
        [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {
            if (gizmo.isEnabled) {
                gizmo.attachedMesh = mesh;
            }
            else {
                gizmo.attachedMesh = null;
            }
        });
    }
    get attachedNode() {
        return this._nodeAttached;
    }
    set attachedNode(node) {
        this._meshAttached = null;
        this._nodeAttached = node;
        this._checkBillboardTransform();
        [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {
            if (gizmo.isEnabled) {
                gizmo.attachedNode = node;
            }
            else {
                gizmo.attachedNode = null;
            }
        });
    }
    _checkBillboardTransform() {
        if (this._nodeAttached && this._nodeAttached.billboardMode) {
            logger/* Logger */.V.Log("Rotation Gizmo will not work with transforms in billboard mode.");
        }
    }
    /**
     * Sensitivity factor for dragging (Default: 1)
     */
    set sensitivity(value) {
        this._sensitivity = value;
        [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.sensitivity = value;
            }
        });
    }
    get sensitivity() {
        return this._sensitivity;
    }
    /**
     * True when the mouse pointer is hovering a gizmo mesh
     */
    get isHovered() {
        return this.xGizmo.isHovered || this.yGizmo.isHovered || this.zGizmo.isHovered;
    }
    /**
     * True when the mouse pointer is dragging a gizmo mesh
     */
    get isDragging() {
        return this.xGizmo.dragBehavior.dragging || this.yGizmo.dragBehavior.dragging || this.zGizmo.dragBehavior.dragging;
    }
    get additionalTransformNode() {
        return this._additionalTransformNode;
    }
    set additionalTransformNode(transformNode) {
        [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {
            gizmo.additionalTransformNode = transformNode;
        });
    }
    /**
     * Creates a RotationGizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     * @param tessellation Amount of tessellation to be used when creating rotation circles
     * @param useEulerRotation Use and update Euler angle instead of quaternion
     * @param thickness display gizmo axis thickness
     * @param gizmoManager Gizmo manager
     * @param options More options
     */
    constructor(gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer, tessellation = 32, useEulerRotation = false, thickness = 1, gizmoManager, options) {
        super(gizmoLayer);
        /** Fires an event when any of it's sub gizmos are dragged */
        this.onDragStartObservable = new Misc_observable/* Observable */.cP();
        /** Fires an event when any of it's sub gizmos are being dragged */
        this.onDragObservable = new Misc_observable/* Observable */.cP();
        /** Fires an event when any of it's sub gizmos are released from dragging */
        this.onDragEndObservable = new Misc_observable/* Observable */.cP();
        this._observables = [];
        this._sensitivity = 1;
        /** Node Caching for quick lookup */
        this._gizmoAxisCache = new Map();
        const xColor = options && options.xOptions && options.xOptions.color ? options.xOptions.color : math_color/* Color3 */.v9.Red().scale(0.5);
        const yColor = options && options.yOptions && options.yOptions.color ? options.yOptions.color : math_color/* Color3 */.v9.Green().scale(0.5);
        const zColor = options && options.zOptions && options.zOptions.color ? options.zOptions.color : math_color/* Color3 */.v9.Blue().scale(0.5);
        this.xGizmo = new PlaneRotationGizmo(new math_vector/* Vector3 */.Pq(1, 0, 0), xColor, gizmoLayer, tessellation, this, useEulerRotation, thickness);
        this.yGizmo = new PlaneRotationGizmo(new math_vector/* Vector3 */.Pq(0, 1, 0), yColor, gizmoLayer, tessellation, this, useEulerRotation, thickness);
        this.zGizmo = new PlaneRotationGizmo(new math_vector/* Vector3 */.Pq(0, 0, 1), zColor, gizmoLayer, tessellation, this, useEulerRotation, thickness);
        this.additionalTransformNode = options?.additionalTransformNode;
        // Relay drag events and set update scale
        [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {
            //must set updateScale on each gizmo, as setting it on root RotationGizmo doesnt prevent individual gizmos from updating
            //currently updateScale is a property with no getter/setter, so no good way to override behavior at runtime, so we will at least set it on startup
            if (options && options.updateScale != undefined) {
                gizmo.updateScale = options.updateScale;
            }
            gizmo.dragBehavior.onDragStartObservable.add(() => {
                this.onDragStartObservable.notifyObservers({});
            });
            gizmo.dragBehavior.onDragObservable.add(() => {
                this.onDragObservable.notifyObservers({});
            });
            gizmo.dragBehavior.onDragEndObservable.add(() => {
                this.onDragEndObservable.notifyObservers({});
            });
        });
        this.attachedMesh = null;
        this.attachedNode = null;
        if (gizmoManager) {
            gizmoManager.addToAxisCache(this._gizmoAxisCache);
        }
        else {
            // Only subscribe to pointer event if gizmoManager isnt
            gizmo/* Gizmo */.Fq.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache);
        }
    }
    /**
     * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
     * NOTE: This is only possible for meshes with uniform scaling, as otherwise it's not possible to decompose the rotation
     */
    set updateGizmoRotationToMatchAttachedMesh(value) {
        if (this.xGizmo) {
            this.xGizmo.updateGizmoRotationToMatchAttachedMesh = value;
            this.yGizmo.updateGizmoRotationToMatchAttachedMesh = value;
            this.zGizmo.updateGizmoRotationToMatchAttachedMesh = value;
        }
    }
    get updateGizmoRotationToMatchAttachedMesh() {
        return this.xGizmo.updateGizmoRotationToMatchAttachedMesh;
    }
    set updateGizmoPositionToMatchAttachedMesh(value) {
        if (this.xGizmo) {
            this.xGizmo.updateGizmoPositionToMatchAttachedMesh = value;
            this.yGizmo.updateGizmoPositionToMatchAttachedMesh = value;
            this.zGizmo.updateGizmoPositionToMatchAttachedMesh = value;
        }
    }
    get updateGizmoPositionToMatchAttachedMesh() {
        return this.xGizmo.updateGizmoPositionToMatchAttachedMesh;
    }
    set anchorPoint(value) {
        this._anchorPoint = value;
        [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {
            gizmo.anchorPoint = value;
        });
    }
    get anchorPoint() {
        return this._anchorPoint;
    }
    /**
     * Set the coordinate system to use. By default it's local.
     * But it's possible for a user to tweak so its local for translation and world for rotation.
     * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
     */
    set coordinatesMode(coordinatesMode) {
        [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {
            gizmo.coordinatesMode = coordinatesMode;
        });
    }
    set updateScale(value) {
        if (this.xGizmo) {
            this.xGizmo.updateScale = value;
            this.yGizmo.updateScale = value;
            this.zGizmo.updateScale = value;
        }
    }
    get updateScale() {
        return this.xGizmo.updateScale;
    }
    /**
     * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
     */
    set snapDistance(value) {
        if (this.xGizmo) {
            this.xGizmo.snapDistance = value;
            this.yGizmo.snapDistance = value;
            this.zGizmo.snapDistance = value;
        }
    }
    get snapDistance() {
        return this.xGizmo.snapDistance;
    }
    /**
     * Ratio for the scale of the gizmo (Default: 1)
     */
    set scaleRatio(value) {
        if (this.xGizmo) {
            this.xGizmo.scaleRatio = value;
            this.yGizmo.scaleRatio = value;
            this.zGizmo.scaleRatio = value;
        }
    }
    get scaleRatio() {
        return this.xGizmo.scaleRatio;
    }
    /**
     * posture that the gizmo will be display
     * When set null, default value will be used (Quaternion(0, 0, 0, 1))
     */
    get customRotationQuaternion() {
        return this._customRotationQuaternion;
    }
    set customRotationQuaternion(customRotationQuaternion) {
        this._customRotationQuaternion = customRotationQuaternion;
        [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.customRotationQuaternion = customRotationQuaternion;
            }
        });
    }
    /**
     * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
     * @param mesh Axis gizmo mesh
     * @param cache Gizmo axis definition used for reactive gizmo UI
     */
    addToAxisCache(mesh, cache) {
        this._gizmoAxisCache.set(mesh, cache);
    }
    /**
     * Force release the drag action by code
     */
    releaseDrag() {
        this.xGizmo.dragBehavior.releaseDrag();
        this.yGizmo.dragBehavior.releaseDrag();
        this.zGizmo.dragBehavior.releaseDrag();
    }
    /**
     * Disposes of the gizmo
     */
    dispose() {
        this.xGizmo.dispose();
        this.yGizmo.dispose();
        this.zGizmo.dispose();
        this.onDragStartObservable.clear();
        this.onDragObservable.clear();
        this.onDragEndObservable.clear();
        this._observables.forEach((obs) => {
            this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs);
        });
        super.dispose();
    }
    /**
     * CustomMeshes are not supported by this gizmo
     */
    setCustomMesh() {
        logger/* Logger */.V.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
    }
}
//# sourceMappingURL=rotationGizmo.js.map
;// ./node_modules/@babylonjs/core/Gizmos/planeDragGizmo.js









/**
 * Single plane drag gizmo
 */
class PlaneDragGizmo extends gizmo/* Gizmo */.Fq {
    /** Default material used to render when gizmo is not disabled or hovered */
    get coloredMaterial() {
        return this._coloredMaterial;
    }
    /** Material used to render when gizmo is hovered with mouse*/
    get hoverMaterial() {
        return this._hoverMaterial;
    }
    /** Material used to render when gizmo is disabled. typically grey.*/
    get disableMaterial() {
        return this._disableMaterial;
    }
    /**
     * @internal
     */
    static _CreatePlane(scene, material) {
        const plane = new Meshes_transformNode/* TransformNode */.V("plane", scene);
        //make sure plane is double sided
        const dragPlane = (0,planeBuilder/* CreatePlane */.x)("dragPlane", { width: 0.1375, height: 0.1375, sideOrientation: 2 }, scene);
        dragPlane.material = material;
        dragPlane.parent = plane;
        return plane;
    }
    /**
     * Creates a PlaneDragGizmo
     * @param dragPlaneNormal The axis normal to which the gizmo will be able to drag on
     * @param color The color of the gizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     * @param parent
     * @param hoverColor The color of the gizmo when hovering over and dragging
     * @param disableColor The Color of the gizmo when its disabled
     */
    constructor(dragPlaneNormal, color = math_color/* Color3 */.v9.Gray(), gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer, parent = null, hoverColor = math_color/* Color3 */.v9.Yellow(), disableColor = math_color/* Color3 */.v9.Gray()) {
        super(gizmoLayer);
        this._pointerObserver = null;
        /**
         * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
         */
        this.snapDistance = 0;
        /**
         * Event that fires each time the gizmo snaps to a new location.
         * * snapDistance is the change in distance
         */
        this.onSnapObservable = new Misc_observable/* Observable */.cP();
        this._isEnabled = false;
        this._parent = null;
        this._dragging = false;
        this._parent = parent;
        // Create Material
        this._coloredMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._coloredMaterial.diffuseColor = color;
        this._coloredMaterial.specularColor = color.subtract(new math_color/* Color3 */.v9(0.1, 0.1, 0.1));
        this._hoverMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._hoverMaterial.diffuseColor = hoverColor;
        this._disableMaterial = new standardMaterial/* StandardMaterial */.F("", gizmoLayer.utilityLayerScene);
        this._disableMaterial.diffuseColor = disableColor;
        this._disableMaterial.alpha = 0.4;
        // Build plane mesh on root node
        this._gizmoMesh = PlaneDragGizmo._CreatePlane(gizmoLayer.utilityLayerScene, this._coloredMaterial);
        this._gizmoMesh.lookAt(this._rootMesh.position.add(dragPlaneNormal));
        this._gizmoMesh.scaling.scaleInPlace(1 / 3);
        this._gizmoMesh.parent = this._rootMesh;
        let currentSnapDragDistance = 0;
        const tmpVector = new math_vector/* Vector3 */.Pq();
        const tmpSnapEvent = { snapDistance: 0 };
        // Add dragPlaneNormal drag behavior to handle events when the gizmo is dragged
        this.dragBehavior = new pointerDragBehavior/* PointerDragBehavior */.C({ dragPlaneNormal: dragPlaneNormal });
        this.dragBehavior.moveAttached = false;
        this._rootMesh.addBehavior(this.dragBehavior);
        this.dragBehavior.onDragObservable.add((event) => {
            if (this.attachedNode) {
                // Keep world translation and use it to update world transform
                // if the node has parent, the local transform properties (position, rotation, scale)
                // will be recomputed in _matrixChanged function
                // Snapping logic
                if (this.snapDistance == 0) {
                    this.attachedNode.getWorldMatrix().getTranslationToRef(math_vector/* TmpVectors */.AA.Vector3[0]);
                    math_vector/* TmpVectors */.AA.Vector3[0].addToRef(event.delta, math_vector/* TmpVectors */.AA.Vector3[0]);
                    if (this.dragBehavior.validateDrag(math_vector/* TmpVectors */.AA.Vector3[0])) {
                        this.attachedNode.getWorldMatrix().addTranslationFromFloats(event.delta.x, event.delta.y, event.delta.z);
                    }
                }
                else {
                    currentSnapDragDistance += event.dragDistance;
                    if (Math.abs(currentSnapDragDistance) > this.snapDistance) {
                        const dragSteps = Math.floor(Math.abs(currentSnapDragDistance) / this.snapDistance);
                        currentSnapDragDistance = currentSnapDragDistance % this.snapDistance;
                        event.delta.normalizeToRef(tmpVector);
                        tmpVector.scaleInPlace(this.snapDistance * dragSteps);
                        this.attachedNode.getWorldMatrix().getTranslationToRef(math_vector/* TmpVectors */.AA.Vector3[0]);
                        math_vector/* TmpVectors */.AA.Vector3[0].addToRef(tmpVector, math_vector/* TmpVectors */.AA.Vector3[0]);
                        if (this.dragBehavior.validateDrag(math_vector/* TmpVectors */.AA.Vector3[0])) {
                            this.attachedNode.getWorldMatrix().addTranslationFromFloats(tmpVector.x, tmpVector.y, tmpVector.z);
                            tmpSnapEvent.snapDistance = this.snapDistance * dragSteps;
                            this.onSnapObservable.notifyObservers(tmpSnapEvent);
                        }
                    }
                }
                this._matrixChanged();
            }
        });
        this.dragBehavior.onDragStartObservable.add(() => {
            this._dragging = true;
        });
        this.dragBehavior.onDragEndObservable.add(() => {
            this._dragging = false;
        });
        const light = gizmoLayer._getSharedGizmoLight();
        light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(false));
        const cache = {
            gizmoMeshes: this._gizmoMesh.getChildMeshes(),
            colliderMeshes: this._gizmoMesh.getChildMeshes(),
            material: this._coloredMaterial,
            hoverMaterial: this._hoverMaterial,
            disableMaterial: this._disableMaterial,
            active: false,
            dragBehavior: this.dragBehavior,
        };
        this._parent?.addToAxisCache(this._gizmoMesh, cache);
        this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
            if (this._customMeshSet) {
                return;
            }
            this._isHovered = !!(cache.colliderMeshes.indexOf(pointerInfo?.pickInfo?.pickedMesh) != -1);
            if (!this._parent) {
                const material = cache.dragBehavior.enabled ? (this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial) : this._disableMaterial;
                this._setGizmoMeshMaterial(cache.gizmoMeshes, material);
            }
        });
        this.dragBehavior.onEnabledObservable.add((newState) => {
            this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? this._coloredMaterial : this._disableMaterial);
        });
    }
    _attachedNodeChanged(value) {
        if (this.dragBehavior) {
            this.dragBehavior.enabled = value ? true : false;
        }
    }
    /**
     * If the gizmo is enabled
     */
    set isEnabled(value) {
        this._isEnabled = value;
        if (!value) {
            this.attachedNode = null;
        }
        else {
            if (this._parent) {
                this.attachedNode = this._parent.attachedNode;
            }
        }
    }
    get isEnabled() {
        return this._isEnabled;
    }
    /**
     * Disposes of the gizmo
     */
    dispose() {
        this.onSnapObservable.clear();
        this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
        this.dragBehavior.detach();
        super.dispose();
        if (this._gizmoMesh) {
            this._gizmoMesh.dispose();
        }
        [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {
            if (matl) {
                matl.dispose();
            }
        });
    }
}
//# sourceMappingURL=planeDragGizmo.js.map
;// ./node_modules/@babylonjs/core/Gizmos/positionGizmo.js








/**
 * Gizmo that enables dragging a mesh along 3 axis
 */
class PositionGizmo extends gizmo/* Gizmo */.Fq {
    get attachedMesh() {
        return this._meshAttached;
    }
    set attachedMesh(mesh) {
        this._meshAttached = mesh;
        this._nodeAttached = mesh;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            if (gizmo.isEnabled) {
                gizmo.attachedMesh = mesh;
            }
            else {
                gizmo.attachedMesh = null;
            }
        });
    }
    get attachedNode() {
        return this._nodeAttached;
    }
    set attachedNode(node) {
        this._meshAttached = null;
        this._nodeAttached = node;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            if (gizmo.isEnabled) {
                gizmo.attachedNode = node;
            }
            else {
                gizmo.attachedNode = null;
            }
        });
    }
    /**
     * True when the mouse pointer is hovering a gizmo mesh
     */
    get isHovered() {
        return this.xGizmo.isHovered || this.yGizmo.isHovered || this.zGizmo.isHovered || this.xPlaneGizmo.isHovered || this.yPlaneGizmo.isHovered || this.zPlaneGizmo.isHovered;
    }
    get isDragging() {
        return (this.xGizmo.dragBehavior.dragging ||
            this.yGizmo.dragBehavior.dragging ||
            this.zGizmo.dragBehavior.dragging ||
            this.xPlaneGizmo.dragBehavior.dragging ||
            this.yPlaneGizmo.dragBehavior.dragging ||
            this.zPlaneGizmo.dragBehavior.dragging);
    }
    get additionalTransformNode() {
        return this._additionalTransformNode;
    }
    set additionalTransformNode(transformNode) {
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            gizmo.additionalTransformNode = transformNode;
        });
    }
    /**
     * Creates a PositionGizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     * @param thickness display gizmo axis thickness
     * @param gizmoManager
     * @param options More options
     */
    constructor(gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer, thickness = 1, gizmoManager, options) {
        super(gizmoLayer);
        /**
         * protected variables
         */
        this._meshAttached = null;
        this._nodeAttached = null;
        this._observables = [];
        /** Node Caching for quick lookup */
        this._gizmoAxisCache = new Map();
        /** Fires an event when any of it's sub gizmos are dragged */
        this.onDragStartObservable = new Misc_observable/* Observable */.cP();
        /** Fires an event when any of it's sub gizmos are being dragged */
        this.onDragObservable = new Misc_observable/* Observable */.cP();
        /** Fires an event when any of it's sub gizmos are released from dragging */
        this.onDragEndObservable = new Misc_observable/* Observable */.cP();
        /**
         * If set to true, planar drag is enabled
         */
        this._planarGizmoEnabled = false;
        this.xGizmo = new AxisDragGizmo(new math_vector/* Vector3 */.Pq(1, 0, 0), math_color/* Color3 */.v9.Red().scale(0.5), gizmoLayer, this, thickness);
        this.yGizmo = new AxisDragGizmo(new math_vector/* Vector3 */.Pq(0, 1, 0), math_color/* Color3 */.v9.Green().scale(0.5), gizmoLayer, this, thickness);
        this.zGizmo = new AxisDragGizmo(new math_vector/* Vector3 */.Pq(0, 0, 1), math_color/* Color3 */.v9.Blue().scale(0.5), gizmoLayer, this, thickness);
        this.xPlaneGizmo = new PlaneDragGizmo(new math_vector/* Vector3 */.Pq(1, 0, 0), math_color/* Color3 */.v9.Red().scale(0.5), this.gizmoLayer, this);
        this.yPlaneGizmo = new PlaneDragGizmo(new math_vector/* Vector3 */.Pq(0, 1, 0), math_color/* Color3 */.v9.Green().scale(0.5), this.gizmoLayer, this);
        this.zPlaneGizmo = new PlaneDragGizmo(new math_vector/* Vector3 */.Pq(0, 0, 1), math_color/* Color3 */.v9.Blue().scale(0.5), this.gizmoLayer, this);
        this.additionalTransformNode = options?.additionalTransformNode;
        // Relay drag events
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            gizmo.dragBehavior.onDragStartObservable.add(() => {
                this.onDragStartObservable.notifyObservers({});
            });
            gizmo.dragBehavior.onDragObservable.add(() => {
                this.onDragObservable.notifyObservers({});
            });
            gizmo.dragBehavior.onDragEndObservable.add(() => {
                this.onDragEndObservable.notifyObservers({});
            });
        });
        this.attachedMesh = null;
        if (gizmoManager) {
            gizmoManager.addToAxisCache(this._gizmoAxisCache);
        }
        else {
            // Only subscribe to pointer event if gizmoManager isnt
            gizmo/* Gizmo */.Fq.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache);
        }
    }
    /**
     * If the planar drag gizmo is enabled
     * setting this will enable/disable XY, XZ and YZ planes regardless of individual gizmo settings.
     */
    set planarGizmoEnabled(value) {
        this._planarGizmoEnabled = value;
        [this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.isEnabled = value;
                if (value) {
                    if (gizmo.attachedMesh) {
                        gizmo.attachedMesh = this.attachedMesh;
                    }
                    else {
                        gizmo.attachedNode = this.attachedNode;
                    }
                }
            }
        }, this);
    }
    get planarGizmoEnabled() {
        return this._planarGizmoEnabled;
    }
    /**
     * posture that the gizmo will be display
     * When set null, default value will be used (Quaternion(0, 0, 0, 1))
     */
    get customRotationQuaternion() {
        return this._customRotationQuaternion;
    }
    set customRotationQuaternion(customRotationQuaternion) {
        this._customRotationQuaternion = customRotationQuaternion;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.customRotationQuaternion = customRotationQuaternion;
            }
        });
    }
    /**
     * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
     * NOTE: This is only possible for meshes with uniform scaling, as otherwise it's not possible to decompose the rotation
     */
    set updateGizmoRotationToMatchAttachedMesh(value) {
        this._updateGizmoRotationToMatchAttachedMesh = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.updateGizmoRotationToMatchAttachedMesh = value;
            }
        });
    }
    get updateGizmoRotationToMatchAttachedMesh() {
        return this._updateGizmoRotationToMatchAttachedMesh;
    }
    set updateGizmoPositionToMatchAttachedMesh(value) {
        this._updateGizmoPositionToMatchAttachedMesh = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.updateGizmoPositionToMatchAttachedMesh = value;
            }
        });
    }
    get updateGizmoPositionToMatchAttachedMesh() {
        return this._updateGizmoPositionToMatchAttachedMesh;
    }
    set anchorPoint(value) {
        this._anchorPoint = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            gizmo.anchorPoint = value;
        });
    }
    get anchorPoint() {
        return this._anchorPoint;
    }
    /**
     * Set the coordinate system to use. By default it's local.
     * But it's possible for a user to tweak so its local for translation and world for rotation.
     * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
     */
    set coordinatesMode(coordinatesMode) {
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            gizmo.coordinatesMode = coordinatesMode;
        });
    }
    set updateScale(value) {
        if (this.xGizmo) {
            this.xGizmo.updateScale = value;
            this.yGizmo.updateScale = value;
            this.zGizmo.updateScale = value;
        }
    }
    get updateScale() {
        return this.xGizmo.updateScale;
    }
    /**
     * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
     */
    set snapDistance(value) {
        this._snapDistance = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.snapDistance = value;
            }
        });
    }
    get snapDistance() {
        return this._snapDistance;
    }
    /**
     * Ratio for the scale of the gizmo (Default: 1)
     */
    set scaleRatio(value) {
        this._scaleRatio = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.scaleRatio = value;
            }
        });
    }
    get scaleRatio() {
        return this._scaleRatio;
    }
    /**
     * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
     * @param mesh Axis gizmo mesh
     * @param cache Gizmo axis definition used for reactive gizmo UI
     */
    addToAxisCache(mesh, cache) {
        this._gizmoAxisCache.set(mesh, cache);
    }
    /**
     * Force release the drag action by code
     */
    releaseDrag() {
        this.xGizmo.dragBehavior.releaseDrag();
        this.yGizmo.dragBehavior.releaseDrag();
        this.zGizmo.dragBehavior.releaseDrag();
        this.xPlaneGizmo.dragBehavior.releaseDrag();
        this.yPlaneGizmo.dragBehavior.releaseDrag();
        this.zPlaneGizmo.dragBehavior.releaseDrag();
    }
    /**
     * Disposes of the gizmo
     */
    dispose() {
        [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.dispose();
            }
        });
        this._observables.forEach((obs) => {
            this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs);
        });
        this.onDragStartObservable.clear();
        this.onDragObservable.clear();
        this.onDragEndObservable.clear();
        super.dispose();
    }
    /**
     * CustomMeshes are not supported by this gizmo
     */
    setCustomMesh() {
        logger/* Logger */.V.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)");
    }
}
//# sourceMappingURL=positionGizmo.js.map
;// ./node_modules/@babylonjs/core/Gizmos/scaleGizmo.js









/**
 * Gizmo that enables scaling a mesh along 3 axis
 */
class ScaleGizmo extends gizmo/* Gizmo */.Fq {
    /** Default material used to render when gizmo is not disabled or hovered */
    get coloredMaterial() {
        return this._coloredMaterial;
    }
    /** Material used to render when gizmo is hovered with mouse*/
    get hoverMaterial() {
        return this._hoverMaterial;
    }
    /** Material used to render when gizmo is disabled. typically grey.*/
    get disableMaterial() {
        return this._disableMaterial;
    }
    get attachedMesh() {
        return this._meshAttached;
    }
    set attachedMesh(mesh) {
        this._meshAttached = mesh;
        this._nodeAttached = mesh;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            if (gizmo.isEnabled) {
                gizmo.attachedMesh = mesh;
            }
            else {
                gizmo.attachedMesh = null;
            }
        });
    }
    get attachedNode() {
        return this._nodeAttached;
    }
    set attachedNode(node) {
        this._meshAttached = null;
        this._nodeAttached = node;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            if (gizmo.isEnabled) {
                gizmo.attachedNode = node;
            }
            else {
                gizmo.attachedNode = null;
            }
        });
    }
    set updateScale(value) {
        if (this.xGizmo) {
            this.xGizmo.updateScale = value;
            this.yGizmo.updateScale = value;
            this.zGizmo.updateScale = value;
        }
    }
    get updateScale() {
        return this.xGizmo.updateScale;
    }
    /**
     * True when the mouse pointer is hovering a gizmo mesh
     */
    get isHovered() {
        return this.xGizmo.isHovered || this.yGizmo.isHovered || this.zGizmo.isHovered || this.uniformScaleGizmo.isHovered;
    }
    /**
     * True when the mouse pointer is dragging a gizmo mesh
     */
    get isDragging() {
        return this.xGizmo.dragBehavior.dragging || this.yGizmo.dragBehavior.dragging || this.zGizmo.dragBehavior.dragging || this.uniformScaleGizmo.dragBehavior.dragging;
    }
    get additionalTransformNode() {
        return this._additionalTransformNode;
    }
    set additionalTransformNode(transformNode) {
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            gizmo.additionalTransformNode = transformNode;
        });
    }
    /**
     * Creates a ScaleGizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     * @param thickness display gizmo axis thickness
     * @param gizmoManager
     * @param options More options
     */
    constructor(gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer, thickness = 1, gizmoManager, options) {
        super(gizmoLayer);
        this._meshAttached = null;
        this._nodeAttached = null;
        this._incrementalSnap = false;
        this._sensitivity = 1;
        this._observables = [];
        /** Node Caching for quick lookup */
        this._gizmoAxisCache = new Map();
        /** Fires an event when any of it's sub gizmos are dragged */
        this.onDragStartObservable = new Misc_observable/* Observable */.cP();
        /** Fires an event when any of it's sub gizmos are being dragged */
        this.onDragObservable = new Misc_observable/* Observable */.cP();
        /** Fires an event when any of it's sub gizmos are released from dragging */
        this.onDragEndObservable = new Misc_observable/* Observable */.cP();
        this.uniformScaleGizmo = this._createUniformScaleMesh();
        this.xGizmo = new AxisScaleGizmo(new math_vector/* Vector3 */.Pq(1, 0, 0), math_color/* Color3 */.v9.Red().scale(0.5), gizmoLayer, this, thickness);
        this.yGizmo = new AxisScaleGizmo(new math_vector/* Vector3 */.Pq(0, 1, 0), math_color/* Color3 */.v9.Green().scale(0.5), gizmoLayer, this, thickness);
        this.zGizmo = new AxisScaleGizmo(new math_vector/* Vector3 */.Pq(0, 0, 1), math_color/* Color3 */.v9.Blue().scale(0.5), gizmoLayer, this, thickness);
        this.additionalTransformNode = options?.additionalTransformNode;
        // Relay drag events
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            gizmo.dragBehavior.onDragStartObservable.add(() => {
                this.onDragStartObservable.notifyObservers({});
            });
            gizmo.dragBehavior.onDragObservable.add(() => {
                this.onDragObservable.notifyObservers({});
            });
            gizmo.dragBehavior.onDragEndObservable.add(() => {
                this.onDragEndObservable.notifyObservers({});
            });
        });
        this.attachedMesh = null;
        this.attachedNode = null;
        if (gizmoManager) {
            gizmoManager.addToAxisCache(this._gizmoAxisCache);
        }
        else {
            // Only subscribe to pointer event if gizmoManager isnt
            gizmo/* Gizmo */.Fq.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache);
        }
    }
    /**
     * @internal
     * Create Geometry for Gizmo
     */
    _createUniformScaleMesh() {
        this._coloredMaterial = new standardMaterial/* StandardMaterial */.F("", this.gizmoLayer.utilityLayerScene);
        this._coloredMaterial.diffuseColor = math_color/* Color3 */.v9.Gray();
        this._hoverMaterial = new standardMaterial/* StandardMaterial */.F("", this.gizmoLayer.utilityLayerScene);
        this._hoverMaterial.diffuseColor = math_color/* Color3 */.v9.Yellow();
        this._disableMaterial = new standardMaterial/* StandardMaterial */.F("", this.gizmoLayer.utilityLayerScene);
        this._disableMaterial.diffuseColor = math_color/* Color3 */.v9.Gray();
        this._disableMaterial.alpha = 0.4;
        const uniformScaleGizmo = new AxisScaleGizmo(new math_vector/* Vector3 */.Pq(0, 1, 0), math_color/* Color3 */.v9.Gray().scale(0.5), this.gizmoLayer, this);
        uniformScaleGizmo.updateGizmoRotationToMatchAttachedMesh = false;
        uniformScaleGizmo.uniformScaling = true;
        this._uniformScalingMesh = CreatePolyhedron("uniform", { type: 1 }, uniformScaleGizmo.gizmoLayer.utilityLayerScene);
        this._uniformScalingMesh.scaling.scaleInPlace(0.01);
        this._uniformScalingMesh.visibility = 0;
        this._octahedron = CreatePolyhedron("", { type: 1 }, uniformScaleGizmo.gizmoLayer.utilityLayerScene);
        this._octahedron.scaling.scaleInPlace(0.007);
        this._uniformScalingMesh.addChild(this._octahedron);
        uniformScaleGizmo.setCustomMesh(this._uniformScalingMesh, true);
        const light = this.gizmoLayer._getSharedGizmoLight();
        light.includedOnlyMeshes = light.includedOnlyMeshes.concat(this._octahedron);
        const cache = {
            gizmoMeshes: [this._octahedron, this._uniformScalingMesh],
            colliderMeshes: [this._octahedron, this._uniformScalingMesh],
            material: this._coloredMaterial,
            hoverMaterial: this._hoverMaterial,
            disableMaterial: this._disableMaterial,
            active: false,
            dragBehavior: uniformScaleGizmo.dragBehavior,
        };
        this.addToAxisCache(uniformScaleGizmo._rootMesh, cache);
        return uniformScaleGizmo;
    }
    set updateGizmoRotationToMatchAttachedMesh(value) {
        if (!value) {
            logger/* Logger */.V.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported.");
        }
        else {
            this._updateGizmoRotationToMatchAttachedMesh = value;
            [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
                if (gizmo) {
                    gizmo.updateGizmoRotationToMatchAttachedMesh = value;
                }
            });
        }
    }
    get updateGizmoRotationToMatchAttachedMesh() {
        return this._updateGizmoRotationToMatchAttachedMesh;
    }
    set anchorPoint(value) {
        this._anchorPoint = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.anchorPoint = value;
            }
        });
    }
    get anchorPoint() {
        return this._anchorPoint;
    }
    /**
     * posture that the gizmo will be display
     * When set null, default value will be used (Quaternion(0, 0, 0, 1))
     */
    get customRotationQuaternion() {
        return this._customRotationQuaternion;
    }
    set customRotationQuaternion(customRotationQuaternion) {
        this._customRotationQuaternion = customRotationQuaternion;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.customRotationQuaternion = customRotationQuaternion;
            }
        });
    }
    /**
     * Set the coordinate system to use. By default it's local.
     * But it's possible for a user to tweak so its local for translation and world for rotation.
     * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
     */
    set coordinatesMode(coordinatesMode) {
        if (coordinatesMode == 0 /* GizmoCoordinatesMode.World */) {
            logger/* Logger */.V.Warn("Setting coordinates Mode to world on scaling gizmo is not supported.");
        }
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            gizmo.coordinatesMode = 1 /* GizmoCoordinatesMode.Local */;
        });
    }
    /**
     * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
     */
    set snapDistance(value) {
        this._snapDistance = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.snapDistance = value;
            }
        });
    }
    get snapDistance() {
        return this._snapDistance;
    }
    /**
     * Incremental snap scaling (default is false). When true, with a snapDistance of 0.1, scaling will be 1.1,1.2,1.3 instead of, when false: 1.1,1.21,1.33,...
     */
    set incrementalSnap(value) {
        this._incrementalSnap = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.incrementalSnap = value;
            }
        });
    }
    get incrementalSnap() {
        return this._incrementalSnap;
    }
    /**
     * Ratio for the scale of the gizmo (Default: 1)
     */
    set scaleRatio(value) {
        this._scaleRatio = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.scaleRatio = value;
            }
        });
    }
    get scaleRatio() {
        return this._scaleRatio;
    }
    /**
     * Sensitivity factor for dragging (Default: 1)
     */
    set sensitivity(value) {
        this._sensitivity = value;
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.sensitivity = value;
            }
        });
    }
    get sensitivity() {
        return this._sensitivity;
    }
    /**
     * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
     * @param mesh Axis gizmo mesh
     * @param cache Gizmo axis definition used for reactive gizmo UI
     */
    addToAxisCache(mesh, cache) {
        this._gizmoAxisCache.set(mesh, cache);
    }
    /**
     * Get the cache set with addToAxisCache for a specific mesh
     * @param mesh Axis gizmo mesh
     * @returns Gizmo axis definition used for reactive gizmo UI
     */
    getAxisCache(mesh) {
        return this._gizmoAxisCache.get(mesh);
    }
    /**
     * Force release the drag action by code
     */
    releaseDrag() {
        this.xGizmo.dragBehavior.releaseDrag();
        this.yGizmo.dragBehavior.releaseDrag();
        this.zGizmo.dragBehavior.releaseDrag();
        this.uniformScaleGizmo.dragBehavior.releaseDrag();
    }
    /**
     * Disposes of the gizmo
     */
    dispose() {
        [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.dispose();
            }
        });
        this._observables.forEach((obs) => {
            this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs);
        });
        this.onDragStartObservable.clear();
        this.onDragObservable.clear();
        this.onDragEndObservable.clear();
        [this._uniformScalingMesh, this._octahedron].forEach((msh) => {
            if (msh) {
                msh.dispose();
            }
        });
        [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => {
            if (matl) {
                matl.dispose();
            }
        });
    }
}
//# sourceMappingURL=scaleGizmo.js.map
;// ./node_modules/@babylonjs/core/Gizmos/gizmoManager.js











/**
 * Helps setup gizmo's in the scene to rotate/scale/position nodes
 */
class GizmoManager {
    /**
     * Utility layer that the bounding box gizmo belongs to
     */
    get keepDepthUtilityLayer() {
        return this._defaultKeepDepthUtilityLayer;
    }
    /**
     * Utility layer that all gizmos besides bounding box belong to
     */
    get utilityLayer() {
        return this._defaultUtilityLayer;
    }
    /**
     * True when the mouse pointer is hovering a gizmo mesh
     */
    get isHovered() {
        let hovered = false;
        for (const key in this.gizmos) {
            const gizmo = this.gizmos[key];
            if (gizmo && gizmo.isHovered) {
                hovered = true;
                break;
            }
        }
        return hovered;
    }
    /**
     * True when the mouse pointer is dragging a gizmo mesh
     */
    get isDragging() {
        let dragging = false;
        [this.gizmos.positionGizmo, this.gizmos.rotationGizmo, this.gizmos.scaleGizmo, this.gizmos.boundingBoxGizmo].forEach((gizmo) => {
            if (gizmo && gizmo.isDragging) {
                dragging = true;
            }
        });
        return dragging;
    }
    /**
     * Ratio for the scale of the gizmo (Default: 1)
     */
    set scaleRatio(value) {
        this._scaleRatio = value;
        [this.gizmos.positionGizmo, this.gizmos.rotationGizmo, this.gizmos.scaleGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.scaleRatio = value;
            }
        });
    }
    get scaleRatio() {
        return this._scaleRatio;
    }
    /**
     * Set the coordinate system to use. By default it's local.
     * But it's possible for a user to tweak so its local for translation and world for rotation.
     * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`
     */
    set coordinatesMode(coordinatesMode) {
        this._coordinatesMode = coordinatesMode;
        [this.gizmos.positionGizmo, this.gizmos.rotationGizmo, this.gizmos.scaleGizmo].forEach((gizmo) => {
            if (gizmo) {
                gizmo.coordinatesMode = coordinatesMode;
            }
        });
    }
    get coordinatesMode() {
        return this._coordinatesMode;
    }
    /**
     * The mesh the gizmo's is attached to
     */
    get attachedMesh() {
        return this._attachedMesh;
    }
    /**
     * The node the gizmo's is attached to
     */
    get attachedNode() {
        return this._attachedNode;
    }
    /**
     * Additional transform node that will be used to transform all the gizmos
     */
    get additionalTransformNode() {
        return this._additionalTransformNode;
    }
    /**
     * Instantiates a gizmo manager
     * @param _scene the scene to overlay the gizmos on top of
     * @param thickness display gizmo axis thickness
     * @param utilityLayer the layer where gizmos are rendered
     * @param keepDepthUtilityLayer the layer where occluded gizmos are rendered
     */
    constructor(_scene, thickness = 1, utilityLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer, keepDepthUtilityLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultKeepDepthUtilityLayer) {
        this._scene = _scene;
        /** When true, the gizmo will be detached from the current object when a pointer down occurs with an empty picked mesh */
        this.clearGizmoOnEmptyPointerEvent = false;
        /** When true (default), picking to attach a new mesh is enabled. This works in sync with inspector autopicking. */
        this.enableAutoPicking = true;
        /** Fires an event when the manager is attached to a mesh */
        this.onAttachedToMeshObservable = new Misc_observable/* Observable */.cP();
        /** Fires an event when the manager is attached to a node */
        this.onAttachedToNodeObservable = new Misc_observable/* Observable */.cP();
        this._gizmosEnabled = { positionGizmo: false, rotationGizmo: false, scaleGizmo: false, boundingBoxGizmo: false };
        this._pointerObservers = [];
        this._attachedMesh = null;
        this._attachedNode = null;
        this._boundingBoxColor = math_color/* Color3 */.v9.FromHexString("#0984e3");
        this._thickness = 1;
        this._scaleRatio = 1;
        this._coordinatesMode = 1 /* GizmoCoordinatesMode.Local */;
        /** Node Caching for quick lookup */
        this._gizmoAxisCache = new Map();
        /**
         * When bounding box gizmo is enabled, this can be used to track drag/end events
         */
        this.boundingBoxDragBehavior = new sixDofDragBehavior/* SixDofDragBehavior */.Y();
        /**
         * Array of meshes which will have the gizmo attached when a pointer selected them. If null, all meshes are attachable. (Default: null)
         */
        this.attachableMeshes = null;
        /**
         * Array of nodes which will have the gizmo attached when a pointer selected them. If null, all nodes are attachable. (Default: null)
         */
        this.attachableNodes = null;
        /**
         * If pointer events should perform attaching/detaching a gizmo, if false this can be done manually via attachToMesh/attachToNode. (Default: true)
         */
        this.usePointerToAttachGizmos = true;
        this._defaultUtilityLayer = utilityLayer;
        this._defaultKeepDepthUtilityLayer = keepDepthUtilityLayer;
        this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = false;
        this._thickness = thickness;
        this.gizmos = { positionGizmo: null, rotationGizmo: null, scaleGizmo: null, boundingBoxGizmo: null };
        const attachToMeshPointerObserver = this._attachToMeshPointerObserver(_scene);
        const gizmoAxisPointerObserver = gizmo/* Gizmo */.Fq.GizmoAxisPointerObserver(this._defaultUtilityLayer, this._gizmoAxisCache);
        this._pointerObservers = [attachToMeshPointerObserver, gizmoAxisPointerObserver];
    }
    /**
     * @internal
     * Subscribes to pointer down events, for attaching and detaching mesh
     * @param scene The scene layer the observer will be added to
     * @returns the pointer observer
     */
    _attachToMeshPointerObserver(scene) {
        // Instantiate/dispose gizmos based on pointer actions
        const pointerObserver = scene.onPointerObservable.add((pointerInfo) => {
            if (!this.usePointerToAttachGizmos) {
                return;
            }
            if (pointerInfo.type == pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN) {
                if (pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh) {
                    if (this.enableAutoPicking) {
                        let node = pointerInfo.pickInfo.pickedMesh;
                        if (this.attachableMeshes == null) {
                            // Attach to the most parent node
                            while (node && node.parent != null) {
                                node = node.parent;
                            }
                        }
                        else {
                            // Attach to the parent node that is an attachableMesh
                            let found = false;
                            this.attachableMeshes.forEach((mesh) => {
                                if (node && (node == mesh || node.isDescendantOf(mesh))) {
                                    node = mesh;
                                    found = true;
                                }
                            });
                            if (!found) {
                                node = null;
                            }
                        }
                        if (node instanceof abstractMesh/* AbstractMesh */.u) {
                            if (this._attachedMesh != node) {
                                this.attachToMesh(node);
                            }
                        }
                        else {
                            if (this.clearGizmoOnEmptyPointerEvent) {
                                this.attachToMesh(null);
                            }
                        }
                    }
                }
                else {
                    if (this.clearGizmoOnEmptyPointerEvent) {
                        this.attachToMesh(null);
                    }
                }
            }
        });
        return pointerObserver;
    }
    /**
     * Attaches a set of gizmos to the specified mesh
     * @param mesh The mesh the gizmo's should be attached to
     */
    attachToMesh(mesh) {
        if (this._attachedMesh) {
            this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior);
        }
        if (this._attachedNode) {
            this._attachedNode.removeBehavior(this.boundingBoxDragBehavior);
        }
        this._attachedMesh = mesh;
        this._attachedNode = null;
        for (const key in this.gizmos) {
            const gizmo = this.gizmos[key];
            if (gizmo && this._gizmosEnabled[key]) {
                gizmo.attachedMesh = mesh;
            }
        }
        if (this.boundingBoxGizmoEnabled && this._attachedMesh) {
            this._attachedMesh.addBehavior(this.boundingBoxDragBehavior);
        }
        this.onAttachedToMeshObservable.notifyObservers(mesh);
    }
    /**
     * Attaches a set of gizmos to the specified node
     * @param node The node the gizmo's should be attached to
     */
    attachToNode(node) {
        if (this._attachedMesh) {
            this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior);
        }
        if (this._attachedNode) {
            this._attachedNode.removeBehavior(this.boundingBoxDragBehavior);
        }
        this._attachedMesh = null;
        this._attachedNode = node;
        for (const key in this.gizmos) {
            const gizmo = this.gizmos[key];
            if (gizmo && this._gizmosEnabled[key]) {
                gizmo.attachedNode = node;
            }
        }
        if (this.boundingBoxGizmoEnabled && this._attachedNode) {
            this._attachedNode.addBehavior(this.boundingBoxDragBehavior);
        }
        this.onAttachedToNodeObservable.notifyObservers(node);
    }
    /**
     * If the position gizmo is enabled
     */
    set positionGizmoEnabled(value) {
        if (value) {
            if (!this.gizmos.positionGizmo) {
                this.gizmos.positionGizmo = new PositionGizmo(this._defaultUtilityLayer, this._thickness, this);
            }
            if (this._attachedNode) {
                this.gizmos.positionGizmo.attachedNode = this._attachedNode;
            }
            else {
                this.gizmos.positionGizmo.attachedMesh = this._attachedMesh;
            }
        }
        else if (this.gizmos.positionGizmo) {
            this.gizmos.positionGizmo.attachedNode = null;
        }
        this._gizmosEnabled.positionGizmo = value;
        this._setAdditionalTransformNode();
    }
    get positionGizmoEnabled() {
        return this._gizmosEnabled.positionGizmo;
    }
    /**
     * If the rotation gizmo is enabled
     */
    set rotationGizmoEnabled(value) {
        if (value) {
            if (!this.gizmos.rotationGizmo) {
                this.gizmos.rotationGizmo = new RotationGizmo(this._defaultUtilityLayer, 32, false, this._thickness, this);
            }
            if (this._attachedNode) {
                this.gizmos.rotationGizmo.attachedNode = this._attachedNode;
            }
            else {
                this.gizmos.rotationGizmo.attachedMesh = this._attachedMesh;
            }
        }
        else if (this.gizmos.rotationGizmo) {
            this.gizmos.rotationGizmo.attachedNode = null;
        }
        this._gizmosEnabled.rotationGizmo = value;
        this._setAdditionalTransformNode();
    }
    get rotationGizmoEnabled() {
        return this._gizmosEnabled.rotationGizmo;
    }
    /**
     * If the scale gizmo is enabled
     */
    set scaleGizmoEnabled(value) {
        if (value) {
            this.gizmos.scaleGizmo = this.gizmos.scaleGizmo || new ScaleGizmo(this._defaultUtilityLayer, this._thickness, this);
            if (this._attachedNode) {
                this.gizmos.scaleGizmo.attachedNode = this._attachedNode;
            }
            else {
                this.gizmos.scaleGizmo.attachedMesh = this._attachedMesh;
            }
        }
        else if (this.gizmos.scaleGizmo) {
            this.gizmos.scaleGizmo.attachedNode = null;
        }
        this._gizmosEnabled.scaleGizmo = value;
        this._setAdditionalTransformNode();
    }
    get scaleGizmoEnabled() {
        return this._gizmosEnabled.scaleGizmo;
    }
    /**
     * If the boundingBox gizmo is enabled
     */
    set boundingBoxGizmoEnabled(value) {
        if (value) {
            this.gizmos.boundingBoxGizmo = this.gizmos.boundingBoxGizmo || new BoundingBoxGizmo(this._boundingBoxColor, this._defaultKeepDepthUtilityLayer);
            if (this._attachedMesh) {
                this.gizmos.boundingBoxGizmo.attachedMesh = this._attachedMesh;
            }
            else {
                this.gizmos.boundingBoxGizmo.attachedNode = this._attachedNode;
            }
            if (this._attachedMesh) {
                this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior);
                this._attachedMesh.addBehavior(this.boundingBoxDragBehavior);
            }
            else if (this._attachedNode) {
                this._attachedNode.removeBehavior(this.boundingBoxDragBehavior);
                this._attachedNode.addBehavior(this.boundingBoxDragBehavior);
            }
        }
        else if (this.gizmos.boundingBoxGizmo) {
            if (this._attachedMesh) {
                this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior);
            }
            else if (this._attachedNode) {
                this._attachedNode.removeBehavior(this.boundingBoxDragBehavior);
            }
            this.gizmos.boundingBoxGizmo.attachedNode = null;
        }
        this._gizmosEnabled.boundingBoxGizmo = value;
        this._setAdditionalTransformNode();
    }
    get boundingBoxGizmoEnabled() {
        return this._gizmosEnabled.boundingBoxGizmo;
    }
    /**
     * Sets the additional transform applied to all the gizmos.
     * @See Gizmo.additionalTransformNode for more detail
     */
    set additionalTransformNode(node) {
        this._additionalTransformNode = node;
        this._setAdditionalTransformNode();
    }
    _setAdditionalTransformNode() {
        for (const key in this.gizmos) {
            const gizmo = this.gizmos[key];
            if (gizmo && this._gizmosEnabled[key]) {
                gizmo.additionalTransformNode = this._additionalTransformNode;
            }
        }
    }
    /**
     * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
     * @param gizmoAxisCache Gizmo axis definition used for reactive gizmo UI
     */
    addToAxisCache(gizmoAxisCache) {
        if (gizmoAxisCache.size > 0) {
            gizmoAxisCache.forEach((v, k) => {
                this._gizmoAxisCache.set(k, v);
            });
        }
    }
    /**
     * Force release the drag action by code
     */
    releaseDrag() {
        [this.gizmos.positionGizmo, this.gizmos.rotationGizmo, this.gizmos.scaleGizmo, this.gizmos.boundingBoxGizmo].forEach((gizmo) => {
            gizmo?.releaseDrag();
        });
    }
    /**
     * Disposes of the gizmo manager
     */
    dispose() {
        this._pointerObservers.forEach((observer) => {
            this._scene.onPointerObservable.remove(observer);
        });
        for (const key in this.gizmos) {
            const gizmo = this.gizmos[key];
            if (gizmo) {
                gizmo.dispose();
            }
        }
        if (this._defaultKeepDepthUtilityLayer !== utilityLayerRenderer/* UtilityLayerRenderer */.j._DefaultKeepDepthUtilityLayer) {
            this._defaultKeepDepthUtilityLayer?.dispose();
        }
        if (this._defaultUtilityLayer !== utilityLayerRenderer/* UtilityLayerRenderer */.j._DefaultUtilityLayer) {
            this._defaultUtilityLayer?.dispose();
        }
        this.boundingBoxDragBehavior.detach();
        this.onAttachedToMeshObservable.clear();
    }
}
//# sourceMappingURL=gizmoManager.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/hemisphericLight.js
var hemisphericLight = __webpack_require__(71513);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/directionalLight.js
var directionalLight = __webpack_require__(52046);
;// ./node_modules/@babylonjs/core/Meshes/Builders/hemisphereBuilder.js



/**
 * Creates a hemisphere mesh
 * @param name defines the name of the mesh
 * @param options defines the options used to create the mesh
 * @param scene defines the hosting scene
 * @returns the hemisphere mesh
 */
function CreateHemisphere(name, options = {}, scene) {
    if (!options.diameter) {
        options.diameter = 1;
    }
    if (!options.segments) {
        options.segments = 16;
    }
    const halfSphere = CreateSphere("", { slice: 0.5, diameter: options.diameter, segments: options.segments }, scene);
    const disc = CreateDisc("", { radius: options.diameter / 2, tessellation: options.segments * 3 + (4 - options.segments) }, scene);
    disc.rotation.x = -Math.PI / 2;
    disc.parent = halfSphere;
    const merged = Meshes_mesh/* Mesh */.e.MergeMeshes([disc, halfSphere], true);
    merged.name = name;
    return merged;
}
/**
 * Class containing static functions to help procedurally build meshes
 * @deprecated use the function directly from the module
 */
const HemisphereBuilder = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    CreateHemisphere,
};
/**
 * Creates a hemispheric light
 * @param name
 * @param segments
 * @param diameter
 * @param scene
 * @returns the mesh
 */
Meshes_mesh/* Mesh */.e.CreateHemisphere = (name, segments, diameter, scene) => {
    const options = {
        segments: segments,
        diameter: diameter,
    };
    return CreateHemisphere(name, options, scene);
};
//# sourceMappingURL=hemisphereBuilder.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/spotLight.js
var spotLight = __webpack_require__(40136);
;// ./node_modules/@babylonjs/core/Gizmos/lightGizmo.js
















/**
 * Gizmo that enables viewing a light
 */
class LightGizmo extends gizmo/* Gizmo */.Fq {
    /**
     * Creates a LightGizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     */
    constructor(gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer) {
        super(gizmoLayer);
        this._cachedPosition = new math_vector/* Vector3 */.Pq();
        this._cachedForward = new math_vector/* Vector3 */.Pq(0, 0, 1);
        this._pointerObserver = null;
        /**
         * Event that fires each time the gizmo is clicked
         */
        this.onClickedObservable = new Misc_observable/* Observable */.cP();
        this._light = null;
        this.attachedMesh = new Meshes_mesh/* Mesh */.e("", this.gizmoLayer.utilityLayerScene);
        this._attachedMeshParent = new Meshes_transformNode/* TransformNode */.V("parent", this.gizmoLayer.utilityLayerScene);
        this.attachedMesh.parent = this._attachedMeshParent;
        this._material = new standardMaterial/* StandardMaterial */.F("light", this.gizmoLayer.utilityLayerScene);
        this._material.diffuseColor = new math_color/* Color3 */.v9(0.5, 0.5, 0.5);
        this._material.specularColor = new math_color/* Color3 */.v9(0.1, 0.1, 0.1);
        this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
            if (!this._light) {
                return;
            }
            this._isHovered = !!(pointerInfo.pickInfo && this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1);
            if (this._isHovered && pointerInfo.event.button === 0) {
                this.onClickedObservable.notifyObservers(this._light);
            }
        }, pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN);
    }
    /**
     * Override attachedNode because lightgizmo only support attached mesh
     * It will return the attached mesh (if any) and setting an attached node will log
     * a warning
     */
    get attachedNode() {
        return this.attachedMesh;
    }
    set attachedNode(value) {
        logger/* Logger */.V.Warn("Nodes cannot be attached to LightGizmo. Attach to a mesh instead.");
    }
    /**
     * The light that the gizmo is attached to
     */
    set light(light) {
        this._light = light;
        if (light) {
            // Create the mesh for the given light type
            if (this._lightMesh) {
                this._lightMesh.dispose();
            }
            if (light instanceof hemisphericLight/* HemisphericLight */.g) {
                this._lightMesh = LightGizmo._CreateHemisphericLightMesh(this.gizmoLayer.utilityLayerScene);
            }
            else if (light instanceof directionalLight/* DirectionalLight */.Z) {
                this._lightMesh = LightGizmo._CreateDirectionalLightMesh(this.gizmoLayer.utilityLayerScene);
            }
            else if (light instanceof spotLight/* SpotLight */.n) {
                this._lightMesh = LightGizmo._CreateSpotLightMesh(this.gizmoLayer.utilityLayerScene);
            }
            else {
                this._lightMesh = LightGizmo._CreatePointLightMesh(this.gizmoLayer.utilityLayerScene);
            }
            this._lightMesh.getChildMeshes(false).forEach((m) => {
                m.material = this._material;
            });
            this._lightMesh.parent = this._rootMesh;
            // Add lighting to the light gizmo
            const gizmoLight = this.gizmoLayer._getSharedGizmoLight();
            gizmoLight.includedOnlyMeshes = gizmoLight.includedOnlyMeshes.concat(this._lightMesh.getChildMeshes(false));
            this._lightMesh.rotationQuaternion = new math_vector/* Quaternion */.PT();
            if (!this.attachedMesh.reservedDataStore) {
                this.attachedMesh.reservedDataStore = {};
            }
            this.attachedMesh.reservedDataStore.lightGizmo = this;
            if (light.parent) {
                this._attachedMeshParent.freezeWorldMatrix(light.parent.getWorldMatrix());
            }
            // Get update position and direction if the light has it
            if (light.position) {
                this.attachedMesh.position.copyFrom(light.position);
                this.attachedMesh.computeWorldMatrix(true);
                this._cachedPosition.copyFrom(this.attachedMesh.position);
            }
            if (light.direction) {
                this.attachedMesh.setDirection(light.direction);
                this.attachedMesh.computeWorldMatrix(true);
                const forward = this._getMeshForward();
                this._cachedForward.copyFrom(forward);
            }
            this._update();
        }
    }
    get light() {
        return this._light;
    }
    /**
     * Gets the material used to render the light gizmo
     */
    get material() {
        return this._material;
    }
    /**
     * @internal
     * returns mesh forward
     */
    _getMeshForward() {
        let forward = this.attachedMesh.forward;
        if (this.attachedMesh.getScene().useRightHandedSystem) {
            forward.negateToRef(math_vector/* TmpVectors */.AA.Vector3[0]);
            forward = math_vector/* TmpVectors */.AA.Vector3[0];
        }
        return forward;
    }
    /**
     * @internal
     * Updates the gizmo to match the attached mesh's position/rotation
     */
    _update() {
        super._update();
        if (!this._light) {
            return;
        }
        if (this._light.parent) {
            this._attachedMeshParent.freezeWorldMatrix(this._light.parent.getWorldMatrix());
        }
        // For light position and direction, a dirty flag is set to true in the setter
        // It means setting values individually or copying values will not call setter and
        // dirty flag will not be set to true. Hence creating a new Vector3.
        if (this._light.position) {
            // If the gizmo is moved update the light otherwise update the gizmo to match the light
            if (!this.attachedMesh.position.equals(this._cachedPosition)) {
                // update light to match gizmo
                const position = this.attachedMesh.position;
                this._light.position = new math_vector/* Vector3 */.Pq(position.x, position.y, position.z);
                this._cachedPosition.copyFrom(this.attachedMesh.position);
            }
            else {
                // update gizmo to match light
                this.attachedMesh.position.copyFrom(this._light.position);
                this.attachedMesh.computeWorldMatrix(true);
                this._cachedPosition.copyFrom(this.attachedMesh.position);
            }
        }
        if (this._light.direction) {
            // If the gizmo is moved update the light otherwise update the gizmo to match the light
            const forward = this._getMeshForward();
            if (math_vector/* Vector3 */.Pq.DistanceSquared(forward, this._cachedForward) > 0.0001) {
                // update light to match gizmo
                const direction = forward;
                this._light.direction = new math_vector/* Vector3 */.Pq(direction.x, direction.y, direction.z);
                this._cachedForward.copyFrom(forward);
            }
            else if (math_vector/* Vector3 */.Pq.DistanceSquared(forward, this._light.direction) > 0.0001) {
                // update gizmo to match light
                this.attachedMesh.setDirection(this._light.direction);
                this.attachedMesh.computeWorldMatrix(true);
                this._cachedForward.copyFrom(forward);
            }
        }
    }
    /**
     * Disposes of the light gizmo
     */
    dispose() {
        this.onClickedObservable.clear();
        this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
        this._material.dispose();
        super.dispose();
        this._attachedMeshParent.dispose();
    }
    static _CreateHemisphericLightMesh(scene) {
        const root = new Meshes_mesh/* Mesh */.e("hemisphereLight", scene);
        const hemisphere = CreateHemisphere(root.name, { segments: 10, diameter: 1 }, scene);
        hemisphere.position.z = -0.15;
        hemisphere.rotation.x = Math.PI / 2;
        hemisphere.parent = root;
        const lines = this._CreateLightLines(3, scene);
        lines.parent = root;
        root.scaling.scaleInPlace(LightGizmo._Scale);
        root.rotation.x = Math.PI / 2;
        return root;
    }
    static _CreatePointLightMesh(scene) {
        const root = new Meshes_mesh/* Mesh */.e("pointLight", scene);
        const sphere = CreateSphere(root.name, { segments: 10, diameter: 1 }, scene);
        sphere.rotation.x = Math.PI / 2;
        sphere.parent = root;
        const lines = this._CreateLightLines(5, scene);
        lines.parent = root;
        root.scaling.scaleInPlace(LightGizmo._Scale);
        root.rotation.x = Math.PI / 2;
        return root;
    }
    static _CreateSpotLightMesh(scene) {
        const root = new Meshes_mesh/* Mesh */.e("spotLight", scene);
        const sphere = CreateSphere(root.name, { segments: 10, diameter: 1 }, scene);
        sphere.parent = root;
        const hemisphere = CreateHemisphere(root.name, { segments: 10, diameter: 2 }, scene);
        hemisphere.parent = root;
        hemisphere.rotation.x = -Math.PI / 2;
        const lines = this._CreateLightLines(2, scene);
        lines.parent = root;
        root.scaling.scaleInPlace(LightGizmo._Scale);
        root.rotation.x = Math.PI / 2;
        return root;
    }
    static _CreateDirectionalLightMesh(scene) {
        const root = new Meshes_mesh/* Mesh */.e("directionalLight", scene);
        const mesh = new Meshes_mesh/* Mesh */.e(root.name, scene);
        mesh.parent = root;
        const sphere = CreateSphere(root.name, { diameter: 1.2, segments: 10 }, scene);
        sphere.parent = mesh;
        const line = CreateCylinder(root.name, {
            updatable: false,
            height: 6,
            diameterTop: 0.3,
            diameterBottom: 0.3,
            tessellation: 6,
            subdivisions: 1,
        }, scene);
        line.parent = mesh;
        let left = line.clone(root.name);
        left.scaling.y = 0.5;
        left.position.x += 1.25;
        let right = line.clone(root.name);
        right.scaling.y = 0.5;
        right.position.x += -1.25;
        const arrowHead = CreateCylinder(root.name, {
            updatable: false,
            height: 1,
            diameterTop: 0,
            diameterBottom: 0.6,
            tessellation: 6,
            subdivisions: 1,
        }, scene);
        arrowHead.position.y += 3;
        arrowHead.parent = mesh;
        left = arrowHead.clone(root.name);
        left.position.y = 1.5;
        left.position.x += 1.25;
        right = arrowHead.clone(root.name);
        right.position.y = 1.5;
        right.position.x += -1.25;
        mesh.scaling.scaleInPlace(LightGizmo._Scale);
        mesh.rotation.z = Math.PI / 2;
        mesh.rotation.y = Math.PI / 2;
        return root;
    }
}
// Static helper methods
LightGizmo._Scale = 0.007;
/**
 * Creates the lines for a light mesh
 * @param levels
 * @param scene
 * @returns the light lines mesh
 */
LightGizmo._CreateLightLines = (levels, scene) => {
    const distFromSphere = 1.2;
    const root = new Meshes_mesh/* Mesh */.e("root", scene);
    root.rotation.x = Math.PI / 2;
    // Create the top line, this will be cloned for all other lines
    const linePivot = new Meshes_mesh/* Mesh */.e("linePivot", scene);
    linePivot.parent = root;
    const line = CreateCylinder("line", {
        updatable: false,
        height: 2,
        diameterTop: 0.2,
        diameterBottom: 0.3,
        tessellation: 6,
        subdivisions: 1,
    }, scene);
    line.position.y = line.scaling.y / 2 + distFromSphere;
    line.parent = linePivot;
    if (levels < 2) {
        return linePivot;
    }
    for (let i = 0; i < 4; i++) {
        const l = linePivot.clone("lineParentClone");
        l.rotation.z = Math.PI / 4;
        l.rotation.y = Math.PI / 2 + (Math.PI / 2) * i;
        l.getChildMeshes()[0].scaling.y = 0.5;
        l.getChildMeshes()[0].scaling.x = l.getChildMeshes()[0].scaling.z = 0.8;
        l.getChildMeshes()[0].position.y = l.getChildMeshes()[0].scaling.y / 2 + distFromSphere;
    }
    if (levels < 3) {
        return root;
    }
    for (let i = 0; i < 4; i++) {
        const l = linePivot.clone("linePivotClone");
        l.rotation.z = Math.PI / 2;
        l.rotation.y = (Math.PI / 2) * i;
    }
    if (levels < 4) {
        return root;
    }
    for (let i = 0; i < 4; i++) {
        const l = linePivot.clone("linePivotClone");
        l.rotation.z = Math.PI + Math.PI / 4;
        l.rotation.y = Math.PI / 2 + (Math.PI / 2) * i;
        l.getChildMeshes()[0].scaling.y = 0.5;
        l.getChildMeshes()[0].scaling.x = l.getChildMeshes()[0].scaling.z = 0.8;
        l.getChildMeshes()[0].position.y = l.getChildMeshes()[0].scaling.y / 2 + distFromSphere;
    }
    if (levels < 5) {
        return root;
    }
    const l = linePivot.clone("linePivotClone");
    l.rotation.z = Math.PI;
    return root;
};
//# sourceMappingURL=lightGizmo.js.map
;// ./node_modules/@babylonjs/core/Gizmos/cameraGizmo.js












/**
 * Gizmo that enables viewing a camera
 */
class CameraGizmo extends gizmo/* Gizmo */.Fq {
    /**
     * Creates a CameraGizmo
     * @param gizmoLayer The utility layer the gizmo will be added to
     * @param gizmoColor Camera mesh color. Default is Gray
     * @param frustumLinesColor Frustum lines color. Default is White
     */
    constructor(gizmoLayer = utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer, gizmoColor, frustumLinesColor) {
        super(gizmoLayer);
        this._pointerObserver = null;
        /**
         * Event that fires each time the gizmo is clicked
         */
        this.onClickedObservable = new Misc_observable/* Observable */.cP();
        this._camera = null;
        this._invProjection = new math/* Matrix */.uq();
        this._material = new standardMaterial/* StandardMaterial */.F("cameraGizmoMaterial", this.gizmoLayer.utilityLayerScene);
        this._frustumLinesColor = frustumLinesColor;
        this._material.diffuseColor = gizmoColor ?? new math_color/* Color3 */.v9(0.5, 0.5, 0.5);
        this._material.specularColor = new math_color/* Color3 */.v9(0.1, 0.1, 0.1);
        this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => {
            if (!this._camera) {
                return;
            }
            this._isHovered = !!(pointerInfo.pickInfo && this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1);
            if (this._isHovered && pointerInfo.event.button === 0) {
                this.onClickedObservable.notifyObservers(this._camera);
            }
        }, pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN);
    }
    /** Gets or sets a boolean indicating if frustum lines must be rendered (true by default)) */
    get displayFrustum() {
        return this._cameraLinesMesh.isEnabled();
    }
    set displayFrustum(value) {
        this._cameraLinesMesh.setEnabled(value);
    }
    /**
     * The camera that the gizmo is attached to
     */
    set camera(camera) {
        this._camera = camera;
        this.attachedNode = camera;
        if (camera) {
            // Create the mesh for the given camera
            if (!this._customMeshSet) {
                if (this._cameraMesh) {
                    this._cameraMesh.dispose();
                }
                this._cameraMesh = CameraGizmo._CreateCameraMesh(this.gizmoLayer.utilityLayerScene);
                this._cameraMesh.getChildMeshes(false).forEach((m) => {
                    m.material = this._material;
                });
                this._cameraMesh.parent = this._rootMesh;
            }
            if (this._cameraLinesMesh) {
                this._cameraLinesMesh.dispose();
            }
            const linesColor = this._frustumLinesColor?.toColor4(1) ?? new math_color/* Color4 */.ov(1, 1, 1, 1);
            this._cameraLinesMesh = CameraGizmo._CreateCameraFrustum(this.gizmoLayer.utilityLayerScene, linesColor);
            this._cameraLinesMesh.parent = this._rootMesh;
            if (this.gizmoLayer.utilityLayerScene.activeCamera && this.gizmoLayer.utilityLayerScene.activeCamera.maxZ < camera.maxZ * 1.5) {
                this.gizmoLayer.utilityLayerScene.activeCamera.maxZ = camera.maxZ * 1.5;
            }
            if (!this.attachedNode.reservedDataStore) {
                this.attachedNode.reservedDataStore = {};
            }
            this.attachedNode.reservedDataStore.cameraGizmo = this;
            // Add lighting to the camera gizmo
            const gizmoLight = this.gizmoLayer._getSharedGizmoLight();
            gizmoLight.includedOnlyMeshes = gizmoLight.includedOnlyMeshes.concat(this._cameraMesh.getChildMeshes(false));
            this._update();
        }
    }
    get camera() {
        return this._camera;
    }
    /**
     * Gets the material used to render the camera gizmo
     */
    get material() {
        return this._material;
    }
    /**
     * @internal
     * Updates the gizmo to match the attached mesh's position/rotation
     */
    _update() {
        super._update();
        if (!this._camera) {
            return;
        }
        // frustum matrix
        this._camera.getProjectionMatrix().invertToRef(this._invProjection);
        this._cameraLinesMesh.setPivotMatrix(this._invProjection, false);
        this._cameraLinesMesh.scaling.x = 1 / this._rootMesh.scaling.x;
        this._cameraLinesMesh.scaling.y = 1 / this._rootMesh.scaling.y;
        this._cameraLinesMesh.scaling.z = 1 / this._rootMesh.scaling.z;
        // take care of coordinate system in camera scene to properly display the mesh with the good Y axis orientation in this scene
        this._cameraMesh.parent = null;
        this._cameraMesh.rotation.y = Math.PI * 0.5 * (this._camera.getScene().useRightHandedSystem ? 1 : -1);
        this._cameraMesh.parent = this._rootMesh;
    }
    /**
     * Disposes and replaces the current camera mesh in the gizmo with the specified mesh
     * @param mesh The mesh to replace the default mesh of the camera gizmo
     */
    setCustomMesh(mesh) {
        if (mesh.getScene() != this.gizmoLayer.utilityLayerScene) {
            // eslint-disable-next-line no-throw-literal
            throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";
        }
        if (this._cameraMesh) {
            this._cameraMesh.dispose();
        }
        this._cameraMesh = mesh;
        this._cameraMesh.parent = this._rootMesh;
        this._customMeshSet = true;
    }
    /**
     * Disposes of the camera gizmo
     */
    dispose() {
        this.onClickedObservable.clear();
        this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
        if (this._cameraMesh) {
            this._cameraMesh.dispose();
        }
        if (this._cameraLinesMesh) {
            this._cameraLinesMesh.dispose();
        }
        this._material.dispose();
        super.dispose();
    }
    static _CreateCameraMesh(scene) {
        const root = new Meshes_mesh/* Mesh */.e("rootCameraGizmo", scene);
        const mesh = new Meshes_mesh/* Mesh */.e(root.name, scene);
        mesh.parent = root;
        const box = (0,boxBuilder/* CreateBox */.an)(root.name, { width: 1.0, height: 0.8, depth: 0.5 }, scene);
        box.parent = mesh;
        const cyl1 = CreateCylinder(root.name, { height: 0.5, diameterTop: 0.8, diameterBottom: 0.8 }, scene);
        cyl1.parent = mesh;
        cyl1.position.y = 0.3;
        cyl1.position.x = -0.6;
        cyl1.rotation.x = Math.PI * 0.5;
        const cyl2 = CreateCylinder(root.name, { height: 0.5, diameterTop: 0.6, diameterBottom: 0.6 }, scene);
        cyl2.parent = mesh;
        cyl2.position.y = 0.5;
        cyl2.position.x = 0.4;
        cyl2.rotation.x = Math.PI * 0.5;
        const cyl3 = CreateCylinder(root.name, { height: 0.5, diameterTop: 0.5, diameterBottom: 0.5 }, scene);
        cyl3.parent = mesh;
        cyl3.position.y = 0.0;
        cyl3.position.x = 0.6;
        cyl3.rotation.z = Math.PI * 0.5;
        root.scaling.scaleInPlace(CameraGizmo._Scale);
        mesh.position.x = -0.9;
        return root;
    }
    static _CreateCameraFrustum(scene, linesColor) {
        const root = new Meshes_mesh/* Mesh */.e("rootCameraGizmo", scene);
        const mesh = new Meshes_mesh/* Mesh */.e(root.name, scene);
        mesh.parent = root;
        for (let y = 0; y < 4; y += 2) {
            for (let x = 0; x < 4; x += 2) {
                let line = CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(-1 + x, -1 + y, -1), new math_vector/* Vector3 */.Pq(-1 + x, -1 + y, 1)], colors: [linesColor, linesColor] }, scene);
                line.parent = mesh;
                line.alwaysSelectAsActiveMesh = true;
                line.isPickable = false;
                line = CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(-1, -1 + x, -1 + y), new math_vector/* Vector3 */.Pq(1, -1 + x, -1 + y)], colors: [linesColor, linesColor] }, scene);
                line.parent = mesh;
                line.alwaysSelectAsActiveMesh = true;
                line.isPickable = false;
                line = CreateLines("lines", { points: [new math_vector/* Vector3 */.Pq(-1 + x, -1, -1 + y), new math_vector/* Vector3 */.Pq(-1 + x, 1, -1 + y)], colors: [linesColor, linesColor] }, scene);
                line.parent = mesh;
                line.alwaysSelectAsActiveMesh = true;
                line.isPickable = false;
            }
        }
        return root;
    }
}
// Static helper methods
CameraGizmo._Scale = 0.05;
//# sourceMappingURL=cameraGizmo.js.map
;// ./node_modules/@babylonjs/core/Gizmos/index.js












//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/baseTexture.js
var baseTexture = __webpack_require__(56526);
;// ./node_modules/@babylonjs/core/PostProcesses/blurPostProcess.js








/**
 * The Blur Post Process which blurs an image based on a kernel and direction.
 * Can be used twice in x and y directions to perform a gaussian blur in two passes.
 */
class BlurPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /** The direction in which to blur the image. */
    get direction() {
        return this._effectWrapper.direction;
    }
    set direction(value) {
        this._effectWrapper.direction = value;
    }
    /**
     * Sets the length in pixels of the blur sample region
     */
    set kernel(v) {
        this._effectWrapper.kernel = v;
    }
    /**
     * Gets the length in pixels of the blur sample region
     */
    get kernel() {
        return this._effectWrapper.kernel;
    }
    /**
     * Sets whether or not the blur needs to unpack/repack floats
     */
    set packedFloat(v) {
        this._effectWrapper.packedFloat = v;
    }
    /**
     * Gets whether or not the blur is unpacking/repacking floats
     */
    get packedFloat() {
        return this._effectWrapper.packedFloat;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "BlurPostProcess" string
     */
    getClassName() {
        return "BlurPostProcess";
    }
    /**
     * Creates a new instance BlurPostProcess
     * @param name The name of the effect.
     * @param direction The direction in which to blur the image.
     * @param kernel The size of the kernel to be used when computing the blur. eg. Size of 3 will blur the center pixel by 2 pixels surrounding it.
     * @param options The required width/height ratio to downsize to before computing the render pass. (Use 1.0 for full size)
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param defines
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)
     */
    constructor(name, direction, kernel, options, camera = null, samplingMode = Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, reusable, textureType = 0, defines = "", blockCompilation = false, textureFormat = 5) {
        const blockCompilationFinal = typeof options === "number" ? blockCompilation : !!options.blockCompilation;
        const localOptions = {
            uniforms: ThinBlurPostProcess.Uniforms,
            samplers: ThinBlurPostProcess.Samplers,
            size: typeof options === "number" ? options : undefined,
            camera,
            samplingMode,
            engine,
            reusable,
            textureType,
            vertexUrl: ThinBlurPostProcess.VertexUrl,
            indexParameters: { varyingCount: 0, depCount: 0 },
            textureFormat,
            defines,
            ...options,
            blockCompilation: true,
        };
        super(name, ThinBlurPostProcess.FragmentUrl, {
            effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinBlurPostProcess(name, engine, undefined, undefined, localOptions) : undefined,
            ...localOptions,
        });
        this._effectWrapper.options.blockCompilation = blockCompilationFinal;
        this.direction = direction;
        this.onApplyObservable.add(() => {
            this._effectWrapper.textureWidth = this._outputTexture ? this._outputTexture.width : this.width;
            this._effectWrapper.textureHeight = this._outputTexture ? this._outputTexture.height : this.height;
        });
        this.kernel = kernel;
    }
    updateEffect(_defines = null, _uniforms = null, _samplers = null, _indexParameters, onCompiled, onError) {
        this._effectWrapper._updateParameters(onCompiled, onError);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new BlurPostProcess(parsedPostProcess.name, parsedPostProcess.direction, parsedPostProcess.kernel, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType, undefined, false);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsVector2 */.WM)()
], BlurPostProcess.prototype, "direction", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BlurPostProcess.prototype, "kernel", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BlurPostProcess.prototype, "packedFloat", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BlurPostProcess", BlurPostProcess);
//# sourceMappingURL=blurPostProcess.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/mirrorTexture.js






/**
 * Mirror texture can be used to simulate the view from a mirror in a scene.
 * It will dynamically be rendered every frame to adapt to the camera point of view.
 * You can then easily use it as a reflectionTexture on a flat surface.
 * In case the surface is not a plane, please consider relying on reflection probes.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#mirrortexture
 */
class MirrorTexture extends Textures_renderTargetTexture/* RenderTargetTexture */.$ {
    /**
     * Define the blur ratio used to blur the reflection if needed.
     */
    set blurRatio(value) {
        if (this._blurRatio === value) {
            return;
        }
        this._blurRatio = value;
        this._preparePostProcesses();
    }
    get blurRatio() {
        return this._blurRatio;
    }
    /**
     * Define the adaptive blur kernel used to blur the reflection if needed.
     * This will autocompute the closest best match for the `blurKernel`
     */
    set adaptiveBlurKernel(value) {
        this._adaptiveBlurKernel = value;
        this._autoComputeBlurKernel();
    }
    /**
     * Define the blur kernel used to blur the reflection if needed.
     * Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
     */
    set blurKernel(value) {
        this.blurKernelX = value;
        this.blurKernelY = value;
    }
    /**
     * Define the blur kernel on the X Axis used to blur the reflection if needed.
     * Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
     */
    set blurKernelX(value) {
        if (this._blurKernelX === value) {
            return;
        }
        this._blurKernelX = value;
        this._preparePostProcesses();
    }
    get blurKernelX() {
        return this._blurKernelX;
    }
    /**
     * Define the blur kernel on the Y Axis used to blur the reflection if needed.
     * Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
     */
    set blurKernelY(value) {
        if (this._blurKernelY === value) {
            return;
        }
        this._blurKernelY = value;
        this._preparePostProcesses();
    }
    get blurKernelY() {
        return this._blurKernelY;
    }
    _autoComputeBlurKernel() {
        const engine = this.getScene().getEngine();
        const dw = this.getRenderWidth() / engine.getRenderWidth();
        const dh = this.getRenderHeight() / engine.getRenderHeight();
        this.blurKernelX = this._adaptiveBlurKernel * dw;
        this.blurKernelY = this._adaptiveBlurKernel * dh;
    }
    _onRatioRescale() {
        if (this._sizeRatio) {
            this.resize(this._initialSizeParameter);
            if (!this._adaptiveBlurKernel) {
                this._preparePostProcesses();
            }
        }
        if (this._adaptiveBlurKernel) {
            this._autoComputeBlurKernel();
        }
    }
    _updateGammaSpace() {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        this.gammaSpace = !scene.imageProcessingConfiguration.isEnabled || !scene.imageProcessingConfiguration.applyByPostProcess;
    }
    /**
     * Instantiates a Mirror Texture.
     * Mirror texture can be used to simulate the view from a mirror in a scene.
     * It will dynamically be rendered every frame to adapt to the camera point of view.
     * You can then easily use it as a reflectionTexture on a flat surface.
     * In case the surface is not a plane, please consider relying on reflection probes.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#mirrors
     * @param name
     * @param size
     * @param scene
     * @param generateMipMaps
     * @param type
     * @param samplingMode
     * @param generateDepthBuffer
     */
    constructor(name, size, scene, generateMipMaps, type = 0, samplingMode = Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, generateDepthBuffer = true) {
        super(name, size, scene, generateMipMaps, true, type, false, samplingMode, generateDepthBuffer);
        /**
         * Define the reflection plane we want to use. The mirrorPlane is usually set to the constructed reflector.
         * It is possible to directly set the mirrorPlane by directly using a Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the mirrorPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the reflector as stated in the doc.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#mirrors
         */
        this.mirrorPlane = new math_plane/* Plane */.Z(0, 1, 0, 1);
        this._transformMatrix = math_vector/* Matrix */.uq.Zero();
        this._mirrorMatrix = math_vector/* Matrix */.uq.Zero();
        this._adaptiveBlurKernel = 0;
        this._blurKernelX = 0;
        this._blurKernelY = 0;
        this._blurRatio = 1.0;
        scene = this.getScene();
        if (!scene) {
            return this;
        }
        this.ignoreCameraViewport = true;
        this._updateGammaSpace();
        this._imageProcessingConfigChangeObserver = scene.imageProcessingConfiguration.onUpdateParameters.add(() => {
            this._updateGammaSpace();
        });
        const engine = scene.getEngine();
        if (engine.supportsUniformBuffers) {
            this._sceneUBO = scene.createSceneUniformBuffer(`Scene for Mirror Texture (name "${name}")`);
        }
        let saveClipPlane;
        this.onBeforeRenderObservable.add(() => {
            if (this._sceneUBO) {
                this._currentSceneUBO = scene.getSceneUniformBuffer();
                scene.setSceneUniformBuffer(this._sceneUBO);
                scene.getSceneUniformBuffer().unbindEffect();
            }
            math_vector/* Matrix */.uq.ReflectionToRef(this.mirrorPlane, this._mirrorMatrix);
            this._mirrorMatrix.multiplyToRef(scene.getViewMatrix(), this._transformMatrix);
            scene.setTransformMatrix(this._transformMatrix, scene.getProjectionMatrix());
            saveClipPlane = scene.clipPlane;
            scene.clipPlane = this.mirrorPlane;
            scene._mirroredCameraPosition = math_vector/* Vector3 */.Pq.TransformCoordinates(scene.activeCamera.globalPosition, this._mirrorMatrix);
        });
        this.onAfterRenderObservable.add(() => {
            if (this._sceneUBO) {
                scene.setSceneUniformBuffer(this._currentSceneUBO);
            }
            scene.updateTransformMatrix();
            scene._mirroredCameraPosition = null;
            scene.clipPlane = saveClipPlane;
        });
    }
    _preparePostProcesses() {
        this.clearPostProcesses(true);
        if (this._blurKernelX && this._blurKernelY) {
            const engine = this.getScene().getEngine();
            const textureType = engine.getCaps().textureFloatRender && engine.getCaps().textureFloatLinearFiltering ? 1 : 2;
            this._blurX = new BlurPostProcess("horizontal blur", new math_vector/* Vector2 */.I9(1.0, 0), this._blurKernelX, this._blurRatio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, textureType);
            this._blurX.autoClear = false;
            if (this._blurRatio === 1 && this.samples < 2 && this._texture) {
                this._blurX.inputTexture = this._renderTarget;
            }
            else {
                this._blurX.alwaysForcePOT = true;
            }
            this._blurY = new BlurPostProcess("vertical blur", new math_vector/* Vector2 */.I9(0, 1.0), this._blurKernelY, this._blurRatio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, textureType);
            this._blurY.autoClear = false;
            this._blurY.alwaysForcePOT = this._blurRatio !== 1;
            this.addPostProcess(this._blurX);
            this.addPostProcess(this._blurY);
        }
        else {
            if (this._blurY) {
                this.removePostProcess(this._blurY);
                this._blurY.dispose();
                this._blurY = null;
            }
            if (this._blurX) {
                this.removePostProcess(this._blurX);
                this._blurX.dispose();
                this._blurX = null;
            }
        }
    }
    /**
     * Clone the mirror texture.
     * @returns the cloned texture
     */
    clone() {
        const scene = this.getScene();
        if (!scene) {
            return this;
        }
        const textureSize = this.getSize();
        const newTexture = new MirrorTexture(this.name, textureSize.width, scene, this._renderTargetOptions.generateMipMaps, this._renderTargetOptions.type, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer);
        // Base texture
        newTexture.hasAlpha = this.hasAlpha;
        newTexture.level = this.level;
        // Mirror Texture
        newTexture.mirrorPlane = this.mirrorPlane.clone();
        if (this.renderList) {
            newTexture.renderList = this.renderList.slice(0);
        }
        return newTexture;
    }
    /**
     * Serialize the texture to a JSON representation you could use in Parse later on
     * @returns the serialized JSON representation
     */
    serialize() {
        if (!this.name) {
            return null;
        }
        const serializationObject = super.serialize();
        serializationObject.mirrorPlane = this.mirrorPlane.asArray();
        return serializationObject;
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() {
        super.dispose();
        const scene = this.getScene();
        if (scene) {
            scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver);
        }
        this._sceneUBO?.dispose();
    }
}
Textures_texture/* Texture */.g._CreateMirror = (name, renderTargetSize, scene, generateMipMaps) => {
    return new MirrorTexture(name, renderTargetSize, scene, generateMipMaps);
};
//# sourceMappingURL=mirrorTexture.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/cubeTexture.js
var Textures_cubeTexture = __webpack_require__(34294);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialDefines.js
var materialDefines = __webpack_require__(79526);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/pushMaterial.js
var pushMaterial = __webpack_require__(21644);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialFlags.js
var materialFlags = __webpack_require__(10633);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/effectFallbacks.js
var effectFallbacks = __webpack_require__(82565);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js
var clipPlaneMaterialHelper = __webpack_require__(30492);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialHelper.functions.js
var materialHelper_functions = __webpack_require__(80467);
;// ./node_modules/@babylonjs/core/Materials/Background/backgroundMaterial.js

/* eslint-disable @typescript-eslint/naming-convention */

















/**
 * Background material defines definition.
 * @internal Mainly internal Use
 */
class BackgroundMaterialDefines extends materialDefines/* MaterialDefines */.M {
    /**
     * Constructor of the defines.
     */
    constructor() {
        super();
        /**
         * True if the diffuse texture is in use.
         */
        this.DIFFUSE = false;
        /**
         * The direct UV channel to use.
         */
        this.DIFFUSEDIRECTUV = 0;
        /**
         * True if the diffuse texture is in gamma space.
         */
        this.GAMMADIFFUSE = false;
        /**
         * True if the diffuse texture has opacity in the alpha channel.
         */
        this.DIFFUSEHASALPHA = false;
        /**
         * True if you want the material to fade to transparent at grazing angle.
         */
        this.OPACITYFRESNEL = false;
        /**
         * True if an extra blur needs to be added in the reflection.
         */
        this.REFLECTIONBLUR = false;
        /**
         * True if you want the material to fade to reflection at grazing angle.
         */
        this.REFLECTIONFRESNEL = false;
        /**
         * True if you want the material to falloff as far as you move away from the scene center.
         */
        this.REFLECTIONFALLOFF = false;
        /**
         * False if the current Webgl implementation does not support the texture lod extension.
         */
        this.TEXTURELODSUPPORT = false;
        /**
         * True to ensure the data are premultiplied.
         */
        this.PREMULTIPLYALPHA = false;
        /**
         * True if the texture contains cooked RGB values and not gray scaled multipliers.
         */
        this.USERGBCOLOR = false;
        /**
         * True if highlight and shadow levels have been specified. It can help ensuring the main perceived color
         * stays aligned with the desired configuration.
         */
        this.USEHIGHLIGHTANDSHADOWCOLORS = false;
        /**
         * True if only shadows must be rendered
         */
        this.BACKMAT_SHADOWONLY = false;
        /**
         * True to add noise in order to reduce the banding effect.
         */
        this.NOISE = false;
        /**
         * is the reflection texture in BGR color scheme?
         * Mainly used to solve a bug in ios10 video tag
         */
        this.REFLECTIONBGR = false;
        /**
         * True if ground projection has been enabled.
         */
        this.PROJECTED_GROUND = false;
        this.IMAGEPROCESSING = false;
        this.VIGNETTE = false;
        this.VIGNETTEBLENDMODEMULTIPLY = false;
        this.VIGNETTEBLENDMODEOPAQUE = false;
        this.TONEMAPPING = 0;
        this.CONTRAST = false;
        this.COLORCURVES = false;
        this.COLORGRADING = false;
        this.COLORGRADING3D = false;
        this.SAMPLER3DGREENDEPTH = false;
        this.SAMPLER3DBGRMAP = false;
        this.DITHER = false;
        this.IMAGEPROCESSINGPOSTPROCESS = false;
        this.SKIPFINALCOLORCLAMP = false;
        this.EXPOSURE = false;
        this.MULTIVIEW = false;
        // Reflection.
        this.REFLECTION = false;
        this.REFLECTIONMAP_3D = false;
        this.REFLECTIONMAP_SPHERICAL = false;
        this.REFLECTIONMAP_PLANAR = false;
        this.REFLECTIONMAP_CUBIC = false;
        this.REFLECTIONMAP_PROJECTION = false;
        this.REFLECTIONMAP_SKYBOX = false;
        this.REFLECTIONMAP_EXPLICIT = false;
        this.REFLECTIONMAP_EQUIRECTANGULAR = false;
        this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
        this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
        this.INVERTCUBICMAP = false;
        this.REFLECTIONMAP_OPPOSITEZ = false;
        this.LODINREFLECTIONALPHA = false;
        this.GAMMAREFLECTION = false;
        this.RGBDREFLECTION = false;
        this.EQUIRECTANGULAR_RELFECTION_FOV = false;
        // Default BJS.
        this.MAINUV1 = false;
        this.MAINUV2 = false;
        this.UV1 = false;
        this.UV2 = false;
        this.CLIPPLANE = false;
        this.CLIPPLANE2 = false;
        this.CLIPPLANE3 = false;
        this.CLIPPLANE4 = false;
        this.CLIPPLANE5 = false;
        this.CLIPPLANE6 = false;
        this.POINTSIZE = false;
        this.FOG = false;
        this.NORMAL = false;
        this.NUM_BONE_INFLUENCERS = 0;
        this.BonesPerMesh = 0;
        this.INSTANCES = false;
        this.SHADOWFLOAT = false;
        this.LOGARITHMICDEPTH = false;
        this.NONUNIFORMSCALING = false;
        this.ALPHATEST = false;
        this.rebuild();
    }
}
/**
 * Background material used to create an efficient environment around your scene.
 * #157MGZ: simple test
 */
class BackgroundMaterial extends pushMaterial/* PushMaterial */.E {
    /**
     * Experimental Internal Use Only.
     *
     * Key light Color in "perceptual value" meaning the color you would like to see on screen.
     * This acts as a helper to set the primary color to a more "human friendly" value.
     * Conversion to linear space as well as exposure and tone mapping correction will be applied to keep the
     * output color as close as possible from the chosen value.
     * (This does not account for contrast color grading and color curves as they are considered post effect and not directly
     * part of lighting setup.)
     */
    get _perceptualColor() {
        return this.__perceptualColor;
    }
    set _perceptualColor(value) {
        this.__perceptualColor = value;
        this._computePrimaryColorFromPerceptualColor();
        this._markAllSubMeshesAsLightsDirty();
    }
    /**
     * Defines the level of the shadows (dark area of the reflection map) in order to help scaling the colors.
     * The color opposite to the primary color is used at the level chosen to define what the black area would look.
     */
    get primaryColorShadowLevel() {
        return this._primaryColorShadowLevel;
    }
    set primaryColorShadowLevel(value) {
        this._primaryColorShadowLevel = value;
        this._computePrimaryColors();
        this._markAllSubMeshesAsLightsDirty();
    }
    /**
     * Defines the level of the highlights (highlight area of the reflection map) in order to help scaling the colors.
     * The primary color is used at the level chosen to define what the white area would look.
     */
    get primaryColorHighlightLevel() {
        return this._primaryColorHighlightLevel;
    }
    set primaryColorHighlightLevel(value) {
        this._primaryColorHighlightLevel = value;
        this._computePrimaryColors();
        this._markAllSubMeshesAsLightsDirty();
    }
    /**
     * Sets the reflection reflectance fresnel values according to the default standard
     * empirically know to work well :-)
     */
    set reflectionStandardFresnelWeight(value) {
        let reflectionWeight = value;
        if (reflectionWeight < 0.5) {
            reflectionWeight = reflectionWeight * 2.0;
            this.reflectionReflectance0 = BackgroundMaterial.StandardReflectance0 * reflectionWeight;
            this.reflectionReflectance90 = BackgroundMaterial.StandardReflectance90 * reflectionWeight;
        }
        else {
            reflectionWeight = reflectionWeight * 2.0 - 1.0;
            this.reflectionReflectance0 = BackgroundMaterial.StandardReflectance0 + (1.0 - BackgroundMaterial.StandardReflectance0) * reflectionWeight;
            this.reflectionReflectance90 = BackgroundMaterial.StandardReflectance90 + (1.0 - BackgroundMaterial.StandardReflectance90) * reflectionWeight;
        }
    }
    /**
     * The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out".
     * Best used when trying to implement visual zoom effects like fish-eye or binoculars while not adjusting camera fov.
     * Recommended to be keep at 1.0 except for special cases.
     */
    get fovMultiplier() {
        return this._fovMultiplier;
    }
    set fovMultiplier(value) {
        if (isNaN(value)) {
            value = 1.0;
        }
        this._fovMultiplier = Math.max(0.0, Math.min(2.0, value));
    }
    /**
     * Attaches a new image processing configuration to the PBR Material.
     * @param configuration (if null the scene configuration will be use)
     */
    _attachImageProcessingConfiguration(configuration) {
        if (configuration === this._imageProcessingConfiguration) {
            return;
        }
        // Detaches observer.
        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
        }
        // Pick the scene configuration if needed.
        if (!configuration) {
            this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration;
        }
        else {
            this._imageProcessingConfiguration = configuration;
        }
        // Attaches observer.
        if (this._imageProcessingConfiguration) {
            this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
                this._computePrimaryColorFromPerceptualColor();
                this._markAllSubMeshesAsImageProcessingDirty();
            });
        }
    }
    /**
     * Gets the image processing configuration used either in this material.
     */
    get imageProcessingConfiguration() {
        return this._imageProcessingConfiguration;
    }
    /**
     * Sets the Default image processing configuration used either in the this material.
     *
     * If sets to null, the scene one is in use.
     */
    set imageProcessingConfiguration(value) {
        this._attachImageProcessingConfiguration(value);
        // Ensure the effect will be rebuilt.
        this._markAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets whether the color curves effect is enabled.
     */
    get cameraColorCurvesEnabled() {
        return this.imageProcessingConfiguration.colorCurvesEnabled;
    }
    /**
     * Sets whether the color curves effect is enabled.
     */
    set cameraColorCurvesEnabled(value) {
        this.imageProcessingConfiguration.colorCurvesEnabled = value;
    }
    /**
     * Gets whether the color grading effect is enabled.
     */
    get cameraColorGradingEnabled() {
        return this.imageProcessingConfiguration.colorGradingEnabled;
    }
    /**
     * Gets whether the color grading effect is enabled.
     */
    set cameraColorGradingEnabled(value) {
        this.imageProcessingConfiguration.colorGradingEnabled = value;
    }
    /**
     * Gets whether tonemapping is enabled or not.
     */
    get cameraToneMappingEnabled() {
        return this._imageProcessingConfiguration.toneMappingEnabled;
    }
    /**
     * Sets whether tonemapping is enabled or not
     */
    set cameraToneMappingEnabled(value) {
        this._imageProcessingConfiguration.toneMappingEnabled = value;
    }
    /**
     * The camera exposure used on this material.
     * This property is here and not in the camera to allow controlling exposure without full screen post process.
     * This corresponds to a photographic exposure.
     */
    get cameraExposure() {
        return this._imageProcessingConfiguration.exposure;
    }
    /**
     * The camera exposure used on this material.
     * This property is here and not in the camera to allow controlling exposure without full screen post process.
     * This corresponds to a photographic exposure.
     */
    set cameraExposure(value) {
        this._imageProcessingConfiguration.exposure = value;
    }
    /**
     * Gets The camera contrast used on this material.
     */
    get cameraContrast() {
        return this._imageProcessingConfiguration.contrast;
    }
    /**
     * Sets The camera contrast used on this material.
     */
    set cameraContrast(value) {
        this._imageProcessingConfiguration.contrast = value;
    }
    /**
     * Gets the Color Grading 2D Lookup Texture.
     */
    get cameraColorGradingTexture() {
        return this._imageProcessingConfiguration.colorGradingTexture;
    }
    /**
     * Sets the Color Grading 2D Lookup Texture.
     */
    set cameraColorGradingTexture(value) {
        this.imageProcessingConfiguration.colorGradingTexture = value;
    }
    /**
     * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
     * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
     * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
     * corresponding to low luminance, medium luminance, and high luminance areas respectively.
     */
    get cameraColorCurves() {
        return this.imageProcessingConfiguration.colorCurves;
    }
    /**
     * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
     * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
     * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
     * corresponding to low luminance, medium luminance, and high luminance areas respectively.
     */
    set cameraColorCurves(value) {
        this.imageProcessingConfiguration.colorCurves = value;
    }
    /**
     * Instantiates a Background Material in the given scene
     * @param name The friendly name of the material
     * @param scene The scene to add the material to
     * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
     */
    constructor(name, scene, forceGLSL = false) {
        super(name, scene, undefined, forceGLSL);
        /**
         * Key light Color (multiply against the environment texture)
         */
        this.primaryColor = math_color/* Color3 */.v9.White();
        this._primaryColorShadowLevel = 0;
        this._primaryColorHighlightLevel = 0;
        /**
         * Reflection Texture used in the material.
         * Should be author in a specific way for the best result (refer to the documentation).
         */
        this.reflectionTexture = null;
        /**
         * Reflection Texture level of blur.
         *
         * Can be use to reuse an existing HDR Texture and target a specific LOD to prevent authoring the
         * texture twice.
         */
        this.reflectionBlur = 0;
        /**
         * Diffuse Texture used in the material.
         * Should be author in a specific way for the best result (refer to the documentation).
         */
        this.diffuseTexture = null;
        this._shadowLights = null;
        /**
         * Specify the list of lights casting shadow on the material.
         * All scene shadow lights will be included if null.
         */
        this.shadowLights = null;
        /**
         * Helps adjusting the shadow to a softer level if required.
         * 0 means black shadows and 1 means no shadows.
         */
        this.shadowLevel = 0;
        /**
         * In case of opacity Fresnel or reflection falloff, this is use as a scene center.
         * It is usually zero but might be interesting to modify according to your setup.
         */
        this.sceneCenter = math_vector/* Vector3 */.Pq.Zero();
        /**
         * This helps specifying that the material is falling off to the sky box at grazing angle.
         * This helps ensuring a nice transition when the camera goes under the ground.
         */
        this.opacityFresnel = true;
        /**
         * This helps specifying that the material is falling off from diffuse to the reflection texture at grazing angle.
         * This helps adding a mirror texture on the ground.
         */
        this.reflectionFresnel = false;
        /**
         * This helps specifying the falloff radius off the reflection texture from the sceneCenter.
         * This helps adding a nice falloff effect to the reflection if used as a mirror for instance.
         */
        this.reflectionFalloffDistance = 0.0;
        /**
         * This specifies the weight of the reflection against the background in case of reflection Fresnel.
         */
        this.reflectionAmount = 1.0;
        /**
         * This specifies the weight of the reflection at grazing angle.
         */
        this.reflectionReflectance0 = 0.05;
        /**
         * This specifies the weight of the reflection at a perpendicular point of view.
         */
        this.reflectionReflectance90 = 0.5;
        /**
         * Helps to directly use the maps channels instead of their level.
         */
        this.useRGBColor = true;
        /**
         * This helps reducing the banding effect that could occur on the background.
         */
        this.enableNoise = false;
        this._fovMultiplier = 1.0;
        /**
         * Enable the FOV adjustment feature controlled by fovMultiplier.
         */
        this.useEquirectangularFOV = false;
        this._maxSimultaneousLights = 4;
        /**
         * Number of Simultaneous lights allowed on the material.
         */
        this.maxSimultaneousLights = 4;
        this._shadowOnly = false;
        /**
         * Make the material only render shadows
         */
        this.shadowOnly = false;
        /**
         * Keep track of the image processing observer to allow dispose and replace.
         */
        this._imageProcessingObserver = null;
        /**
         * Due to a bug in iOS10, video tags (which are using the background material) are in BGR and not RGB.
         * Setting this flag to true (not done automatically!) will convert it back to RGB.
         */
        this.switchToBGR = false;
        this._enableGroundProjection = false;
        /**
         * Enables the ground projection mode on the material.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
         */
        this.enableGroundProjection = false;
        /**
         * Defines the radius of the projected ground if enableGroundProjection is true.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
         */
        this.projectedGroundRadius = 1000;
        /**
         * Defines the height of the projected ground if enableGroundProjection is true.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
         */
        this.projectedGroundHeight = 10;
        // Temp values kept as cache in the material.
        this._renderTargets = new smartArray/* SmartArray */.L(16);
        this._reflectionControls = math_vector/* Vector4 */.IU.Zero();
        this._white = math_color/* Color3 */.v9.White();
        this._primaryShadowColor = math_color/* Color3 */.v9.Black();
        this._primaryHighlightColor = math_color/* Color3 */.v9.Black();
        this._shadersLoaded = false;
        // Setup the default processing configuration to the scene.
        this._attachImageProcessingConfiguration(null);
        this.getRenderTargetTextures = () => {
            this._renderTargets.reset();
            if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
                this._renderTargets.push(this._diffuseTexture);
            }
            if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
                this._renderTargets.push(this._reflectionTexture);
            }
            return this._renderTargets;
        };
    }
    /**
     * Gets a boolean indicating that current material needs to register RTT
     */
    get hasRenderTargetTextures() {
        if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
            return true;
        }
        if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
            return true;
        }
        return false;
    }
    /**
     * The entire material has been created in order to prevent overdraw.
     * @returns false
     */
    needAlphaTesting() {
        return true;
    }
    /**
     * The entire material has been created in order to prevent overdraw.
     * @returns true if blending is enable
     */
    needAlphaBlending() {
        return this.alpha < 1 || (this._diffuseTexture != null && this._diffuseTexture.hasAlpha) || this._shadowOnly;
    }
    /**
     * Checks whether the material is ready to be rendered for a given mesh.
     * @param mesh The mesh to render
     * @param subMesh The submesh to check against
     * @param useInstances Specify wether or not the material is used with instances
     * @returns true if all the dependencies are ready (Textures, Effects...)
     */
    isReadyForSubMesh(mesh, subMesh, useInstances = false) {
        const drawWrapper = subMesh._drawWrapper;
        if (drawWrapper.effect && this.isFrozen) {
            if (drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            subMesh.materialDefines = new BackgroundMaterialDefines();
        }
        const scene = this.getScene();
        const defines = subMesh.materialDefines;
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        const engine = scene.getEngine();
        // Lights
        (0,materialHelper_functions/* PrepareDefinesForLights */.az)(scene, mesh, defines, false, this._maxSimultaneousLights);
        defines._needNormals = true;
        // Multiview
        (0,materialHelper_functions/* PrepareDefinesForMultiview */.VO)(scene, defines);
        // Textures
        if (defines._areTexturesDirty) {
            defines._needUVs = false;
            if (scene.texturesEnabled) {
                if (scene.getEngine().getCaps().textureLOD) {
                    defines.TEXTURELODSUPPORT = true;
                }
                if (this._diffuseTexture && materialFlags/* MaterialFlags */.h.DiffuseTextureEnabled) {
                    if (!this._diffuseTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    (0,materialHelper_functions/* PrepareDefinesForMergedUV */.YT)(this._diffuseTexture, defines, "DIFFUSE");
                    defines.DIFFUSEHASALPHA = this._diffuseTexture.hasAlpha;
                    defines.GAMMADIFFUSE = this._diffuseTexture.gammaSpace;
                    defines.OPACITYFRESNEL = this._opacityFresnel;
                }
                else {
                    defines.DIFFUSE = false;
                    defines.DIFFUSEDIRECTUV = 0;
                    defines.DIFFUSEHASALPHA = false;
                    defines.GAMMADIFFUSE = false;
                    defines.OPACITYFRESNEL = false;
                }
                const reflectionTexture = this._reflectionTexture;
                if (reflectionTexture && materialFlags/* MaterialFlags */.h.ReflectionTextureEnabled) {
                    if (!reflectionTexture.isReadyOrNotBlocking()) {
                        return false;
                    }
                    defines.REFLECTION = true;
                    defines.GAMMAREFLECTION = reflectionTexture.gammaSpace;
                    defines.RGBDREFLECTION = reflectionTexture.isRGBD;
                    defines.REFLECTIONBLUR = this._reflectionBlur > 0;
                    defines.LODINREFLECTIONALPHA = reflectionTexture.lodLevelInAlpha;
                    defines.EQUIRECTANGULAR_RELFECTION_FOV = this.useEquirectangularFOV;
                    defines.REFLECTIONBGR = this.switchToBGR;
                    if (reflectionTexture.coordinatesMode === Textures_texture/* Texture */.g.INVCUBIC_MODE) {
                        defines.INVERTCUBICMAP = true;
                    }
                    defines.REFLECTIONMAP_3D = reflectionTexture.isCube;
                    defines.REFLECTIONMAP_OPPOSITEZ = defines.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !reflectionTexture.invertZ : reflectionTexture.invertZ;
                    switch (reflectionTexture.coordinatesMode) {
                        case Textures_texture/* Texture */.g.EXPLICIT_MODE:
                            defines.REFLECTIONMAP_EXPLICIT = true;
                            break;
                        case Textures_texture/* Texture */.g.PLANAR_MODE:
                            defines.REFLECTIONMAP_PLANAR = true;
                            break;
                        case Textures_texture/* Texture */.g.PROJECTION_MODE:
                            defines.REFLECTIONMAP_PROJECTION = true;
                            break;
                        case Textures_texture/* Texture */.g.SKYBOX_MODE:
                            defines.REFLECTIONMAP_SKYBOX = true;
                            break;
                        case Textures_texture/* Texture */.g.SPHERICAL_MODE:
                            defines.REFLECTIONMAP_SPHERICAL = true;
                            break;
                        case Textures_texture/* Texture */.g.EQUIRECTANGULAR_MODE:
                            defines.REFLECTIONMAP_EQUIRECTANGULAR = true;
                            break;
                        case Textures_texture/* Texture */.g.FIXED_EQUIRECTANGULAR_MODE:
                            defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = true;
                            break;
                        case Textures_texture/* Texture */.g.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
                            defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = true;
                            break;
                        case Textures_texture/* Texture */.g.CUBIC_MODE:
                        case Textures_texture/* Texture */.g.INVCUBIC_MODE:
                        default:
                            defines.REFLECTIONMAP_CUBIC = true;
                            break;
                    }
                    if (this.reflectionFresnel) {
                        defines.REFLECTIONFRESNEL = true;
                        defines.REFLECTIONFALLOFF = this.reflectionFalloffDistance > 0;
                        this._reflectionControls.x = this.reflectionAmount;
                        this._reflectionControls.y = this.reflectionReflectance0;
                        this._reflectionControls.z = this.reflectionReflectance90;
                        this._reflectionControls.w = 1 / this.reflectionFalloffDistance;
                    }
                    else {
                        defines.REFLECTIONFRESNEL = false;
                        defines.REFLECTIONFALLOFF = false;
                    }
                }
                else {
                    defines.REFLECTION = false;
                    defines.REFLECTIONFRESNEL = false;
                    defines.REFLECTIONFALLOFF = false;
                    defines.REFLECTIONBLUR = false;
                    defines.REFLECTIONMAP_3D = false;
                    defines.REFLECTIONMAP_SPHERICAL = false;
                    defines.REFLECTIONMAP_PLANAR = false;
                    defines.REFLECTIONMAP_CUBIC = false;
                    defines.REFLECTIONMAP_PROJECTION = false;
                    defines.REFLECTIONMAP_SKYBOX = false;
                    defines.REFLECTIONMAP_EXPLICIT = false;
                    defines.REFLECTIONMAP_EQUIRECTANGULAR = false;
                    defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
                    defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
                    defines.INVERTCUBICMAP = false;
                    defines.REFLECTIONMAP_OPPOSITEZ = false;
                    defines.LODINREFLECTIONALPHA = false;
                    defines.GAMMAREFLECTION = false;
                    defines.RGBDREFLECTION = false;
                }
            }
            defines.PREMULTIPLYALPHA = this.alphaMode === 7 || this.alphaMode === 8;
            defines.USERGBCOLOR = this._useRGBColor;
            defines.NOISE = this._enableNoise;
        }
        if (defines._areLightsDirty) {
            defines.USEHIGHLIGHTANDSHADOWCOLORS = !this._useRGBColor && (this._primaryColorShadowLevel !== 0 || this._primaryColorHighlightLevel !== 0);
            defines.BACKMAT_SHADOWONLY = this._shadowOnly;
        }
        if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {
            if (!this._imageProcessingConfiguration.isReady()) {
                return false;
            }
            this._imageProcessingConfiguration.prepareDefines(defines);
        }
        if (defines._areMiscDirty) {
            if (defines.REFLECTIONMAP_3D && this._enableGroundProjection) {
                defines.PROJECTED_GROUND = true;
                defines.REFLECTIONMAP_SKYBOX = true;
            }
            else {
                defines.PROJECTED_GROUND = false;
            }
        }
        // Misc.
        (0,materialHelper_functions/* PrepareDefinesForMisc */.fm)(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);
        // Values that need to be evaluated on every frame
        (0,materialHelper_functions/* PrepareDefinesForFrameBoundValues */.OR)(scene, engine, this, defines, useInstances, null, subMesh.getRenderingMesh().hasThinInstances);
        // Attribs
        if ((0,materialHelper_functions/* PrepareDefinesForAttributes */.qB)(mesh, defines, false, true, false)) {
            if (mesh) {
                if (!scene.getEngine().getCaps().standardDerivatives && !mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.NormalKind)) {
                    mesh.createNormals(true);
                    logger/* Logger */.V.Warn("BackgroundMaterial: Normals have been created for the mesh: " + mesh.name);
                }
            }
        }
        // Get correct effect
        if (defines.isDirty) {
            defines.markAsProcessed();
            scene.resetCachedMaterial();
            // Fallbacks
            const fallbacks = new effectFallbacks/* EffectFallbacks */.J();
            if (defines.FOG) {
                fallbacks.addFallback(0, "FOG");
            }
            if (defines.POINTSIZE) {
                fallbacks.addFallback(1, "POINTSIZE");
            }
            if (defines.MULTIVIEW) {
                fallbacks.addFallback(0, "MULTIVIEW");
            }
            (0,materialHelper_functions/* HandleFallbacksForShadows */.c4)(defines, fallbacks, this._maxSimultaneousLights);
            //Attributes
            const attribs = [Buffers_buffer/* VertexBuffer */.R.PositionKind];
            if (defines.NORMAL) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.NormalKind);
            }
            if (defines.UV1) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.UVKind);
            }
            if (defines.UV2) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.UV2Kind);
            }
            (0,materialHelper_functions/* PrepareAttributesForBones */.ni)(attribs, mesh, defines, fallbacks);
            (0,materialHelper_functions/* PrepareAttributesForInstances */.ER)(attribs, defines);
            const uniforms = [
                "world",
                "view",
                "viewProjection",
                "vEyePosition",
                "vLightsType",
                "vFogInfos",
                "vFogColor",
                "pointSize",
                "mBones",
                "vPrimaryColor",
                "vPrimaryColorShadow",
                "vReflectionInfos",
                "reflectionMatrix",
                "vReflectionMicrosurfaceInfos",
                "fFovMultiplier",
                "shadowLevel",
                "alpha",
                "vBackgroundCenter",
                "vReflectionControl",
                "vDiffuseInfos",
                "diffuseMatrix",
                "projectedGroundInfos",
                "logarithmicDepthConstant",
            ];
            (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.TV)(uniforms);
            const samplers = ["diffuseSampler", "reflectionSampler", "reflectionSamplerLow", "reflectionSamplerHigh"];
            const uniformBuffers = ["Material", "Scene"];
            if (Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p) {
                Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p.PrepareUniforms(uniforms, defines);
                Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p.PrepareSamplers(samplers, defines);
            }
            (0,materialHelper_functions/* PrepareUniformsAndSamplersList */.Bb)({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
                maxSimultaneousLights: this._maxSimultaneousLights,
            });
            const join = defines.toString();
            const effect = scene.getEngine().createEffect("background", {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights },
                shaderLanguage: this._shaderLanguage,
                extraInitializationsAsync: this._shadersLoaded
                    ? undefined
                    : async () => {
                        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 35616)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 81018))]);
                        }
                        else {
                            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 11114)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 94476))]);
                        }
                        this._shadersLoaded = true;
                    },
            }, engine);
            subMesh.setEffect(effect, defines, this._materialContext);
            this.buildUniformLayout();
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        drawWrapper._wasPreviouslyReady = true;
        drawWrapper._wasPreviouslyUsingInstances = useInstances;
        this._checkScenePerformancePriority();
        return true;
    }
    /**
     * Compute the primary color according to the chosen perceptual color.
     */
    _computePrimaryColorFromPerceptualColor() {
        if (!this.__perceptualColor) {
            return;
        }
        this._primaryColor.copyFrom(this.__perceptualColor);
        // Revert gamma space.
        this._primaryColor.toLinearSpaceToRef(this._primaryColor, this.getScene().getEngine().useExactSrgbConversions);
        // Revert image processing configuration.
        if (this._imageProcessingConfiguration) {
            // Revert Exposure.
            this._primaryColor.scaleToRef(1 / this._imageProcessingConfiguration.exposure, this._primaryColor);
        }
        this._computePrimaryColors();
    }
    /**
     * Compute the highlights and shadow colors according to their chosen levels.
     */
    _computePrimaryColors() {
        if (this._primaryColorShadowLevel === 0 && this._primaryColorHighlightLevel === 0) {
            return;
        }
        // Find the highlight color based on the configuration.
        this._primaryColor.scaleToRef(this._primaryColorShadowLevel, this._primaryShadowColor);
        this._primaryColor.subtractToRef(this._primaryShadowColor, this._primaryShadowColor);
        // Find the shadow color based on the configuration.
        this._white.subtractToRef(this._primaryColor, this._primaryHighlightColor);
        this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel, this._primaryHighlightColor);
        this._primaryColor.addToRef(this._primaryHighlightColor, this._primaryHighlightColor);
    }
    /**
     * Build the uniform buffer used in the material.
     */
    buildUniformLayout() {
        // Order is important !
        this._uniformBuffer.addUniform("vPrimaryColor", 4);
        this._uniformBuffer.addUniform("vPrimaryColorShadow", 4);
        this._uniformBuffer.addUniform("vDiffuseInfos", 2);
        this._uniformBuffer.addUniform("vReflectionInfos", 2);
        this._uniformBuffer.addUniform("diffuseMatrix", 16);
        this._uniformBuffer.addUniform("reflectionMatrix", 16);
        this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos", 3);
        this._uniformBuffer.addUniform("fFovMultiplier", 1);
        this._uniformBuffer.addUniform("pointSize", 1);
        this._uniformBuffer.addUniform("shadowLevel", 1);
        this._uniformBuffer.addUniform("alpha", 1);
        this._uniformBuffer.addUniform("vBackgroundCenter", 3);
        this._uniformBuffer.addUniform("vReflectionControl", 4);
        this._uniformBuffer.addUniform("projectedGroundInfos", 2);
        this._uniformBuffer.create();
    }
    /**
     * Unbind the material.
     */
    unbind() {
        if (this._diffuseTexture && this._diffuseTexture.isRenderTarget) {
            this._uniformBuffer.setTexture("diffuseSampler", null);
        }
        if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
            this._uniformBuffer.setTexture("reflectionSampler", null);
        }
        super.unbind();
    }
    /**
     * Bind only the world matrix to the material.
     * @param world The world matrix to bind.
     */
    bindOnlyWorldMatrix(world) {
        this._activeEffect.setMatrix("world", world);
    }
    /**
     * Bind the material for a dedicated submesh (every used meshes will be considered opaque).
     * @param world The world matrix to bind.
     * @param mesh the mesh to bind for.
     * @param subMesh The submesh to bind for.
     */
    bindForSubMesh(world, mesh, subMesh) {
        const scene = this.getScene();
        const defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        const effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices
        this.bindOnlyWorldMatrix(world);
        // Bones
        (0,materialHelper_functions/* BindBonesParameters */.f$)(mesh, this._activeEffect);
        const mustRebind = this._mustRebind(scene, effect, subMesh, mesh.visibility);
        if (mustRebind) {
            this._uniformBuffer.bindToEffect(effect, "Material");
            this.bindViewProjection(effect);
            const reflectionTexture = this._reflectionTexture;
            if (!this._uniformBuffer.useUbo || !this.isFrozen || !this._uniformBuffer.isSync || subMesh._drawWrapper._forceRebindOnNextCall) {
                // Texture uniforms
                if (scene.texturesEnabled) {
                    if (this._diffuseTexture && materialFlags/* MaterialFlags */.h.DiffuseTextureEnabled) {
                        this._uniformBuffer.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);
                        (0,materialHelper_functions/* BindTextureMatrix */.mA)(this._diffuseTexture, this._uniformBuffer, "diffuse");
                    }
                    if (reflectionTexture && materialFlags/* MaterialFlags */.h.ReflectionTextureEnabled) {
                        this._uniformBuffer.updateMatrix("reflectionMatrix", reflectionTexture.getReflectionTextureMatrix());
                        this._uniformBuffer.updateFloat2("vReflectionInfos", reflectionTexture.level, this._reflectionBlur);
                        this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos", reflectionTexture.getSize().width, reflectionTexture.lodGenerationScale, reflectionTexture.lodGenerationOffset);
                    }
                }
                if (this.shadowLevel > 0) {
                    this._uniformBuffer.updateFloat("shadowLevel", this.shadowLevel);
                }
                this._uniformBuffer.updateFloat("alpha", this.alpha);
                // Point size
                if (this.pointsCloud) {
                    this._uniformBuffer.updateFloat("pointSize", this.pointSize);
                }
                if (defines.USEHIGHLIGHTANDSHADOWCOLORS) {
                    this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryHighlightColor, 1.0);
                    this._uniformBuffer.updateColor4("vPrimaryColorShadow", this._primaryShadowColor, 1.0);
                }
                else {
                    this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryColor, 1.0);
                }
            }
            this._uniformBuffer.updateFloat("fFovMultiplier", this._fovMultiplier);
            // Textures
            if (scene.texturesEnabled) {
                if (this._diffuseTexture && materialFlags/* MaterialFlags */.h.DiffuseTextureEnabled) {
                    this._uniformBuffer.setTexture("diffuseSampler", this._diffuseTexture);
                }
                if (reflectionTexture && materialFlags/* MaterialFlags */.h.ReflectionTextureEnabled) {
                    if (defines.REFLECTIONBLUR && defines.TEXTURELODSUPPORT) {
                        this._uniformBuffer.setTexture("reflectionSampler", reflectionTexture);
                    }
                    else if (!defines.REFLECTIONBLUR) {
                        this._uniformBuffer.setTexture("reflectionSampler", reflectionTexture);
                    }
                    else {
                        this._uniformBuffer.setTexture("reflectionSampler", reflectionTexture._lodTextureMid || reflectionTexture);
                        this._uniformBuffer.setTexture("reflectionSamplerLow", reflectionTexture._lodTextureLow || reflectionTexture);
                        this._uniformBuffer.setTexture("reflectionSamplerHigh", reflectionTexture._lodTextureHigh || reflectionTexture);
                    }
                    if (defines.REFLECTIONFRESNEL) {
                        this._uniformBuffer.updateFloat3("vBackgroundCenter", this.sceneCenter.x, this.sceneCenter.y, this.sceneCenter.z);
                        this._uniformBuffer.updateFloat4("vReflectionControl", this._reflectionControls.x, this._reflectionControls.y, this._reflectionControls.z, this._reflectionControls.w);
                    }
                }
                if (defines.PROJECTED_GROUND) {
                    this._uniformBuffer.updateFloat2("projectedGroundInfos", this.projectedGroundRadius, this.projectedGroundHeight);
                }
            }
            // Clip plane
            (0,clipPlaneMaterialHelper/* bindClipPlane */.gS)(this._activeEffect, this, scene);
            scene.bindEyePosition(effect);
        }
        else if (scene.getEngine()._features.needToAlwaysBindUniformBuffers) {
            this._uniformBuffer.bindToEffect(effect, "Material");
            this._needToBindSceneUbo = true;
        }
        if (mustRebind || !this.isFrozen) {
            if (scene.lightsEnabled) {
                (0,materialHelper_functions/* BindLights */.RL)(scene, mesh, this._activeEffect, defines, this._maxSimultaneousLights);
            }
            // View
            this.bindView(effect);
            // Fog
            (0,materialHelper_functions/* BindFogParameters */.Yy)(scene, mesh, this._activeEffect, true);
            // Log. depth
            if (this._useLogarithmicDepth) {
                (0,materialHelper_functions/* BindLogDepth */.DL)(defines, effect, scene);
            }
            // image processing
            if (this._imageProcessingConfiguration) {
                this._imageProcessingConfiguration.bind(this._activeEffect);
            }
        }
        this._afterBind(mesh, this._activeEffect, subMesh);
        this._uniformBuffer.update();
    }
    /**
     * Checks to see if a texture is used in the material.
     * @param texture - Base texture to use.
     * @returns - Boolean specifying if a texture is used in the material.
     */
    hasTexture(texture) {
        if (super.hasTexture(texture)) {
            return true;
        }
        if (this._reflectionTexture === texture) {
            return true;
        }
        if (this._diffuseTexture === texture) {
            return true;
        }
        return false;
    }
    /**
     * Dispose the material.
     * @param forceDisposeEffect Force disposal of the associated effect.
     * @param forceDisposeTextures Force disposal of the associated textures.
     */
    dispose(forceDisposeEffect = false, forceDisposeTextures = false) {
        if (forceDisposeTextures) {
            if (this.diffuseTexture) {
                this.diffuseTexture.dispose();
            }
            if (this.reflectionTexture) {
                this.reflectionTexture.dispose();
            }
        }
        this._renderTargets.dispose();
        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
        }
        super.dispose(forceDisposeEffect);
    }
    /**
     * Clones the material.
     * @param name The cloned name.
     * @returns The cloned material.
     */
    clone(name) {
        return decorators_serialization/* SerializationHelper */.p.Clone(() => new BackgroundMaterial(name, this.getScene()), this);
    }
    /**
     * Serializes the current material to its JSON representation.
     * @returns The JSON representation.
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.customType = "BABYLON.BackgroundMaterial";
        return serializationObject;
    }
    /**
     * Gets the class name of the material
     * @returns "BackgroundMaterial"
     */
    getClassName() {
        return "BackgroundMaterial";
    }
    /**
     * Parse a JSON input to create back a background material.
     * @param source The JSON data to parse
     * @param scene The scene to create the parsed material in
     * @param rootUrl The root url of the assets the material depends upon
     * @returns the instantiated BackgroundMaterial.
     */
    static Parse(source, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => new BackgroundMaterial(source.name, scene), source, scene, rootUrl);
    }
}
/**
 * Standard reflectance value at parallel view angle.
 */
BackgroundMaterial.StandardReflectance0 = 0.05;
/**
 * Standard reflectance value at grazing angle.
 */
BackgroundMaterial.StandardReflectance90 = 0.5;
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], BackgroundMaterial.prototype, "_primaryColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsLightsDirty")
], BackgroundMaterial.prototype, "primaryColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], BackgroundMaterial.prototype, "__perceptualColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_primaryColorShadowLevel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_primaryColorHighlightLevel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsLightsDirty")
], BackgroundMaterial.prototype, "primaryColorHighlightLevel", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)()
], BackgroundMaterial.prototype, "_reflectionTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "reflectionTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_reflectionBlur", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "reflectionBlur", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)()
], BackgroundMaterial.prototype, "_diffuseTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "diffuseTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "shadowLights", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_shadowLevel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "shadowLevel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsVector3 */.P_)()
], BackgroundMaterial.prototype, "_sceneCenter", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "sceneCenter", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_opacityFresnel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "opacityFresnel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_reflectionFresnel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "reflectionFresnel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_reflectionFalloffDistance", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "reflectionFalloffDistance", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_reflectionAmount", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "reflectionAmount", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_reflectionReflectance0", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "reflectionReflectance0", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_reflectionReflectance90", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "reflectionReflectance90", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_useRGBColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "useRGBColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_enableNoise", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "enableNoise", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_maxSimultaneousLights", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], BackgroundMaterial.prototype, "maxSimultaneousLights", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "_shadowOnly", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsLightsDirty")
], BackgroundMaterial.prototype, "shadowOnly", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsImageProcessingConfiguration */.n1)()
], BackgroundMaterial.prototype, "_imageProcessingConfiguration", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsMiscDirty")
], BackgroundMaterial.prototype, "enableGroundProjection", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "projectedGroundRadius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BackgroundMaterial.prototype, "projectedGroundHeight", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BackgroundMaterial", BackgroundMaterial);
//# sourceMappingURL=backgroundMaterial.js.map
;// ./node_modules/@babylonjs/core/Helpers/environmentHelper.js














/**
 * The EnvironmentHelper class can be used to add a fully featured non-expensive background to your scene.
 * It includes by default a skybox and a ground relying on the BackgroundMaterial.
 * It also helps with the default setup of your ImageProcessingConfiguration.
 */
class EnvironmentHelper {
    /**
     * Creates the default options for the helper.
     * @param scene The scene the environment helper belongs to.
     * @returns default options for the helper.
     */
    static _GetDefaultOptions(scene) {
        return {
            createGround: true,
            groundSize: 15,
            groundTexture: this._GroundTextureCDNUrl,
            groundColor: new math_color/* Color3 */.v9(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),
            groundOpacity: 0.9,
            enableGroundShadow: true,
            groundShadowLevel: 0.5,
            enableGroundMirror: false,
            groundMirrorSizeRatio: 0.3,
            groundMirrorBlurKernel: 64,
            groundMirrorAmount: 1,
            groundMirrorFresnelWeight: 1,
            groundMirrorFallOffDistance: 0,
            groundMirrorTextureType: 0,
            groundYBias: 0.00001,
            createSkybox: true,
            skyboxSize: 20,
            skyboxTexture: this._SkyboxTextureCDNUrl,
            skyboxColor: new math_color/* Color3 */.v9(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),
            backgroundYRotation: 0,
            sizeAuto: true,
            rootPosition: math_vector/* Vector3 */.Pq.Zero(),
            setupImageProcessing: true,
            environmentTexture: this._EnvironmentTextureCDNUrl,
            cameraExposure: 0.8,
            cameraContrast: 1.2,
            toneMappingEnabled: true,
        };
    }
    /**
     * Gets the root mesh created by the helper.
     */
    get rootMesh() {
        return this._rootMesh;
    }
    /**
     * Gets the skybox created by the helper.
     */
    get skybox() {
        return this._skybox;
    }
    /**
     * Gets the skybox texture created by the helper.
     */
    get skyboxTexture() {
        return this._skyboxTexture;
    }
    /**
     * Gets the skybox material created by the helper.
     */
    get skyboxMaterial() {
        return this._skyboxMaterial;
    }
    /**
     * Gets the ground mesh created by the helper.
     */
    get ground() {
        return this._ground;
    }
    /**
     * Gets the ground texture created by the helper.
     */
    get groundTexture() {
        return this._groundTexture;
    }
    /**
     * Gets the ground mirror created by the helper.
     */
    get groundMirror() {
        return this._groundMirror;
    }
    /**
     * Gets the ground mirror render list to helps pushing the meshes
     * you wish in the ground reflection.
     */
    get groundMirrorRenderList() {
        if (this._groundMirror) {
            return this._groundMirror.renderList;
        }
        return null;
    }
    /**
     * Gets the ground material created by the helper.
     */
    get groundMaterial() {
        return this._groundMaterial;
    }
    /**
     * constructor
     * @param options Defines the options we want to customize the helper
     * @param scene The scene to add the material to
     */
    constructor(options, scene) {
        this._errorHandler = (message, exception) => {
            this.onErrorObservable.notifyObservers({ message: message, exception: exception });
        };
        this._options = {
            ...EnvironmentHelper._GetDefaultOptions(scene),
            ...options,
        };
        this._scene = scene;
        this.onErrorObservable = new Misc_observable/* Observable */.cP();
        this._setupBackground();
        this._setupImageProcessing();
    }
    /**
     * Updates the environment according to the new options
     * @param options options to configure the helper (IEnvironmentHelperOptions)
     */
    updateOptions(options) {
        const newOptions = {
            ...this._options,
            ...options,
        };
        if (this._ground && !newOptions.createGround) {
            this._ground.dispose();
            this._ground = null;
        }
        if (this._groundMaterial && !newOptions.createGround) {
            this._groundMaterial.dispose();
            this._groundMaterial = null;
        }
        if (this._groundTexture) {
            if (this._options.groundTexture != newOptions.groundTexture) {
                this._groundTexture.dispose();
                this._groundTexture = null;
            }
        }
        if (this._skybox && !newOptions.createSkybox) {
            this._skybox.dispose();
            this._skybox = null;
        }
        if (this._skyboxMaterial && !newOptions.createSkybox) {
            this._skyboxMaterial.dispose();
            this._skyboxMaterial = null;
        }
        if (this._skyboxTexture) {
            if (this._options.skyboxTexture != newOptions.skyboxTexture) {
                this._skyboxTexture.dispose();
                this._skyboxTexture = null;
            }
        }
        if (this._groundMirror && !newOptions.enableGroundMirror) {
            this._groundMirror.dispose();
            this._groundMirror = null;
        }
        if (this._scene.environmentTexture) {
            if (this._options.environmentTexture != newOptions.environmentTexture) {
                this._scene.environmentTexture.dispose();
            }
        }
        this._options = newOptions;
        this._setupBackground();
        this._setupImageProcessing();
    }
    /**
     * Sets the primary color of all the available elements.
     * @param color the main color to affect to the ground and the background
     */
    setMainColor(color) {
        if (this.groundMaterial) {
            this.groundMaterial.primaryColor = color;
        }
        if (this.skyboxMaterial) {
            this.skyboxMaterial.primaryColor = color;
        }
        if (this.groundMirror) {
            this.groundMirror.clearColor = new math_color/* Color4 */.ov(color.r, color.g, color.b, 1.0);
        }
    }
    /**
     * Setup the image processing according to the specified options.
     */
    _setupImageProcessing() {
        if (this._options.setupImageProcessing) {
            this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast;
            this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure;
            this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled;
            this._setupEnvironmentTexture();
        }
    }
    /**
     * Setup the environment texture according to the specified options.
     */
    _setupEnvironmentTexture() {
        if (this._scene.environmentTexture) {
            return;
        }
        if (this._options.environmentTexture instanceof baseTexture/* BaseTexture */.t) {
            this._scene.environmentTexture = this._options.environmentTexture;
            return;
        }
        const environmentTexture = Textures_cubeTexture/* CubeTexture */.b.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);
        this._scene.environmentTexture = environmentTexture;
    }
    /**
     * Setup the background according to the specified options.
     */
    _setupBackground() {
        if (!this._rootMesh) {
            this._rootMesh = new Meshes_mesh/* Mesh */.e("BackgroundHelper", this._scene);
        }
        this._rootMesh.rotation.y = this._options.backgroundYRotation;
        const sceneSize = this._getSceneSize();
        if (this._options.createGround) {
            this._setupGround(sceneSize);
            this._setupGroundMaterial();
            this._setupGroundDiffuseTexture();
            if (this._options.enableGroundMirror) {
                this._setupGroundMirrorTexture(sceneSize);
            }
            this._setupMirrorInGroundMaterial();
        }
        if (this._options.createSkybox) {
            this._setupSkybox(sceneSize);
            this._setupSkyboxMaterial();
            this._setupSkyboxReflectionTexture();
        }
        this._rootMesh.position.x = sceneSize.rootPosition.x;
        this._rootMesh.position.z = sceneSize.rootPosition.z;
        this._rootMesh.position.y = sceneSize.rootPosition.y;
    }
    /**
     * Get the scene sizes according to the setup.
     * @returns the different ground and skybox sizes.
     */
    _getSceneSize() {
        let groundSize = this._options.groundSize;
        let skyboxSize = this._options.skyboxSize;
        let rootPosition = this._options.rootPosition;
        if (!this._scene.meshes || this._scene.meshes.length === 1) {
            // 1 only means the root of the helper.
            return { groundSize, skyboxSize, rootPosition };
        }
        const sceneExtends = this._scene.getWorldExtends((mesh) => {
            return mesh !== this._ground && mesh !== this._rootMesh && mesh !== this._skybox;
        });
        const sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);
        if (this._options.sizeAuto) {
            if (this._scene.activeCamera instanceof ArcRotateCamera && this._scene.activeCamera.upperRadiusLimit) {
                groundSize = this._scene.activeCamera.upperRadiusLimit * 2;
                skyboxSize = groundSize;
            }
            const sceneDiagonalLenght = sceneDiagonal.length();
            if (sceneDiagonalLenght > groundSize) {
                groundSize = sceneDiagonalLenght * 2;
                skyboxSize = groundSize;
            }
            // 10 % bigger.
            groundSize *= 1.1;
            skyboxSize *= 1.5;
            rootPosition = sceneExtends.min.add(sceneDiagonal.scale(0.5));
            rootPosition.y = sceneExtends.min.y - this._options.groundYBias;
        }
        return { groundSize, skyboxSize, rootPosition };
    }
    /**
     * Setup the ground according to the specified options.
     * @param sceneSize
     */
    _setupGround(sceneSize) {
        if (!this._ground || this._ground.isDisposed()) {
            this._ground = (0,planeBuilder/* CreatePlane */.x)("BackgroundPlane", { size: sceneSize.groundSize }, this._scene);
            this._ground.rotation.x = Math.PI / 2; // Face up by default.
            this._ground.isPickable = false;
            this._ground.parent = this._rootMesh;
            this._ground.onDisposeObservable.add(() => {
                this._ground = null;
            });
        }
        this._ground.receiveShadows = this._options.enableGroundShadow;
    }
    /**
     * Setup the ground material according to the specified options.
     */
    _setupGroundMaterial() {
        if (!this._groundMaterial) {
            this._groundMaterial = new BackgroundMaterial("BackgroundPlaneMaterial", this._scene);
        }
        this._groundMaterial.alpha = this._options.groundOpacity;
        this._groundMaterial.alphaMode = 8;
        this._groundMaterial.shadowLevel = this._options.groundShadowLevel;
        this._groundMaterial.primaryColor = this._options.groundColor;
        this._groundMaterial.useRGBColor = false;
        this._groundMaterial.enableNoise = true;
        if (this._ground) {
            this._ground.material = this._groundMaterial;
        }
    }
    /**
     * Setup the ground diffuse texture according to the specified options.
     */
    _setupGroundDiffuseTexture() {
        if (!this._groundMaterial) {
            return;
        }
        if (this._groundTexture) {
            return;
        }
        if (this._options.groundTexture instanceof baseTexture/* BaseTexture */.t) {
            this._groundMaterial.diffuseTexture = this._options.groundTexture;
            return;
        }
        this._groundTexture = new Textures_texture/* Texture */.g(this._options.groundTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);
        this._groundTexture.gammaSpace = false;
        this._groundTexture.hasAlpha = true;
        this._groundMaterial.diffuseTexture = this._groundTexture;
    }
    /**
     * Setup the ground mirror texture according to the specified options.
     * @param sceneSize
     */
    _setupGroundMirrorTexture(sceneSize) {
        const wrapping = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        if (!this._groundMirror) {
            this._groundMirror = new MirrorTexture("BackgroundPlaneMirrorTexture", { ratio: this._options.groundMirrorSizeRatio }, this._scene, false, this._options.groundMirrorTextureType, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, true);
            this._groundMirror.mirrorPlane = new math_plane/* Plane */.Z(0, -1, 0, sceneSize.rootPosition.y);
            this._groundMirror.anisotropicFilteringLevel = 1;
            this._groundMirror.wrapU = wrapping;
            this._groundMirror.wrapV = wrapping;
            if (this._groundMirror.renderList) {
                for (let i = 0; i < this._scene.meshes.length; i++) {
                    const mesh = this._scene.meshes[i];
                    if (mesh !== this._ground && mesh !== this._skybox && mesh !== this._rootMesh) {
                        this._groundMirror.renderList.push(mesh);
                    }
                }
            }
        }
        const gammaGround = this._options.groundColor.toGammaSpace(this._scene.getEngine().useExactSrgbConversions);
        this._groundMirror.clearColor = new math_color/* Color4 */.ov(gammaGround.r, gammaGround.g, gammaGround.b, 1);
        this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;
    }
    /**
     * Setup the ground to receive the mirror texture.
     */
    _setupMirrorInGroundMaterial() {
        if (this._groundMaterial) {
            this._groundMaterial.reflectionTexture = this._groundMirror;
            this._groundMaterial.reflectionFresnel = true;
            this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount;
            this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight;
            this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance;
        }
    }
    /**
     * Setup the skybox according to the specified options.
     * @param sceneSize
     */
    _setupSkybox(sceneSize) {
        if (!this._skybox || this._skybox.isDisposed()) {
            this._skybox = (0,boxBuilder/* CreateBox */.an)("BackgroundSkybox", { size: sceneSize.skyboxSize, sideOrientation: Meshes_mesh/* Mesh */.e.BACKSIDE }, this._scene);
            this._skybox.isPickable = false;
            this._skybox.onDisposeObservable.add(() => {
                this._skybox = null;
            });
        }
        this._skybox.parent = this._rootMesh;
    }
    /**
     * Setup the skybox material according to the specified options.
     */
    _setupSkyboxMaterial() {
        if (!this._skybox) {
            return;
        }
        if (!this._skyboxMaterial) {
            this._skyboxMaterial = new BackgroundMaterial("BackgroundSkyboxMaterial", this._scene);
        }
        this._skyboxMaterial.useRGBColor = false;
        this._skyboxMaterial.primaryColor = this._options.skyboxColor;
        this._skyboxMaterial.enableNoise = true;
        this._skybox.material = this._skyboxMaterial;
    }
    /**
     * Setup the skybox reflection texture according to the specified options.
     */
    _setupSkyboxReflectionTexture() {
        if (!this._skyboxMaterial) {
            return;
        }
        if (this._skyboxTexture) {
            return;
        }
        if (this._options.skyboxTexture instanceof baseTexture/* BaseTexture */.t) {
            this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture;
            return;
        }
        this._skyboxTexture = new Textures_cubeTexture/* CubeTexture */.b(this._options.skyboxTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);
        this._skyboxTexture.coordinatesMode = Textures_texture/* Texture */.g.SKYBOX_MODE;
        this._skyboxTexture.gammaSpace = false;
        this._skyboxMaterial.reflectionTexture = this._skyboxTexture;
    }
    /**
     * Dispose all the elements created by the Helper.
     */
    dispose() {
        if (this._groundMaterial) {
            this._groundMaterial.dispose(true, true);
        }
        if (this._skyboxMaterial) {
            this._skyboxMaterial.dispose(true, true);
        }
        this._rootMesh.dispose(false);
    }
}
/**
 * Default ground texture URL.
 */
EnvironmentHelper._GroundTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundGround.png";
/**
 * Default skybox texture URL.
 */
EnvironmentHelper._SkyboxTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundSkybox.dds";
/**
 * Default environment texture URL.
 */
EnvironmentHelper._EnvironmentTextureCDNUrl = "https://assets.babylonjs.com/environments/environmentSpecular.env";
//# sourceMappingURL=environmentHelper.js.map
;// ./node_modules/@babylonjs/core/Helpers/textureDome.js








/**
 * Display a 360/180 degree texture on an approximately spherical surface, useful for VR applications or skyboxes.
 * As a subclass of TransformNode, this allow parenting to the camera or multiple textures with different locations in the scene.
 * This class achieves its effect with a Texture and a correctly configured BackgroundMaterial on an inverted sphere.
 * Potential additions to this helper include zoom and and non-infinite distance rendering effects.
 */
class TextureDome extends Meshes_transformNode/* TransformNode */.V {
    /**
     * Gets the texture being displayed on the sphere
     */
    get texture() {
        return this._texture;
    }
    /**
     * Sets the texture being displayed on the sphere
     */
    set texture(newTexture) {
        if (this._texture === newTexture) {
            return;
        }
        this._texture = newTexture;
        if (this._useDirectMapping) {
            this._texture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
            this._texture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
            this._material.diffuseTexture = this._texture;
        }
        else {
            this._texture.coordinatesMode = Textures_texture/* Texture */.g.FIXED_EQUIRECTANGULAR_MIRRORED_MODE; // matches orientation
            this._texture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
            this._material.reflectionTexture = this._texture;
        }
        this._changeTextureMode(this._textureMode);
    }
    /**
     * Gets the mesh used for the dome.
     */
    get mesh() {
        return this._mesh;
    }
    /**
     * The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out".
     * Also see the options.resolution property.
     */
    get fovMultiplier() {
        return this._material.fovMultiplier;
    }
    set fovMultiplier(value) {
        this._material.fovMultiplier = value;
    }
    /**
     * Gets or set the current texture mode for the texture. It can be:
     * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
     * * TextureDome.MODE_TOPBOTTOM  : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
     * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
     */
    get textureMode() {
        return this._textureMode;
    }
    /**
     * Sets the current texture mode for the texture. It can be:
     * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
     * * TextureDome.MODE_TOPBOTTOM  : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
     * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
     */
    set textureMode(value) {
        if (this._textureMode === value) {
            return;
        }
        this._changeTextureMode(value);
    }
    /**
     * Is it a 180 degrees dome (half dome) or 360 texture (full dome)
     */
    get halfDome() {
        return this._halfDome;
    }
    /**
     * Set the halfDome mode. If set, only the front (180 degrees) will be displayed and the back will be blacked out.
     */
    set halfDome(enabled) {
        this._halfDome = enabled;
        this._halfDomeMask.setEnabled(enabled);
        this._changeTextureMode(this._textureMode);
    }
    /**
     * Set the cross-eye mode. If set, images that can be seen when crossing eyes will render correctly
     */
    set crossEye(enabled) {
        this._crossEye = enabled;
        this._changeTextureMode(this._textureMode);
    }
    /**
     * Is it a cross-eye texture?
     */
    get crossEye() {
        return this._crossEye;
    }
    /**
     * The background material of this dome.
     */
    get material() {
        return this._material;
    }
    /**
     * Create an instance of this class and pass through the parameters to the relevant classes- Texture, StandardMaterial, and Mesh.
     * @param name Element's name, child elements will append suffixes for their own names.
     * @param textureUrlOrElement defines the url(s) or the (video) HTML element to use
     * @param options An object containing optional or exposed sub element properties
     * @param options.resolution
     * @param options.clickToPlay
     * @param options.autoPlay
     * @param options.loop
     * @param options.size
     * @param options.poster
     * @param options.faceForward
     * @param options.useDirectMapping
     * @param options.halfDomeMode
     * @param options.crossEyeMode
     * @param options.generateMipMaps
     * @param options.mesh
     * @param scene
     * @param onError
     */
    constructor(name, textureUrlOrElement, options, scene, 
    // eslint-disable-next-line @typescript-eslint/naming-convention
    onError = null) {
        super(name, scene);
        this.onError = onError;
        this._halfDome = false;
        this._crossEye = false;
        this._useDirectMapping = false;
        this._textureMode = TextureDome.MODE_MONOSCOPIC;
        /**
         * Oberserver used in Stereoscopic VR Mode.
         */
        this._onBeforeCameraRenderObserver = null;
        /**
         * Observable raised when an error occurred while loading the texture
         */
        this.onLoadErrorObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable raised when the texture finished loading
         */
        this.onLoadObservable = new Misc_observable/* Observable */.cP();
        scene = this.getScene();
        // set defaults and manage values
        name = name || "textureDome";
        options.resolution = Math.abs(options.resolution) | 0 || 32;
        options.clickToPlay = Boolean(options.clickToPlay);
        options.autoPlay = options.autoPlay === undefined ? true : Boolean(options.autoPlay);
        options.loop = options.loop === undefined ? true : Boolean(options.loop);
        options.size = Math.abs(options.size) || (scene.activeCamera ? scene.activeCamera.maxZ * 0.48 : 1000);
        if (options.useDirectMapping === undefined) {
            this._useDirectMapping = true;
        }
        else {
            this._useDirectMapping = options.useDirectMapping;
        }
        if (options.faceForward === undefined) {
            options.faceForward = true;
        }
        this._setReady(false);
        if (!options.mesh) {
            this._mesh = CreateSphere(name + "_mesh", { segments: options.resolution, diameter: options.size, updatable: false, sideOrientation: Meshes_mesh/* Mesh */.e.BACKSIDE }, scene);
        }
        else {
            this._mesh = options.mesh;
        }
        // configure material
        const material = (this._material = new BackgroundMaterial(name + "_material", scene));
        material.useEquirectangularFOV = true;
        material.fovMultiplier = 1.0;
        material.opacityFresnel = false;
        const texture = this._initTexture(textureUrlOrElement, scene, options);
        this.texture = texture;
        // configure mesh
        this._mesh.material = material;
        this._mesh.parent = this;
        // create a (disabled until needed) mask to cover unneeded segments of 180 texture.
        this._halfDomeMask = CreateSphere("", { slice: 0.5, diameter: options.size * 0.98, segments: options.resolution * 2, sideOrientation: Meshes_mesh/* Mesh */.e.BACKSIDE }, scene);
        this._halfDomeMask.rotate(math/* Axis */._0.X, -Math.PI / 2);
        // set the parent, so it will always be positioned correctly AND will be disposed when the main sphere is disposed
        this._halfDomeMask.parent = this._mesh;
        this._halfDome = !!options.halfDomeMode;
        // enable or disable according to the settings
        this._halfDomeMask.setEnabled(this._halfDome);
        this._crossEye = !!options.crossEyeMode;
        // create
        this._texture.anisotropicFilteringLevel = 1;
        this._texture.onLoadObservable.addOnce(() => {
            this._setReady(true);
        });
        // Initial rotation
        if (options.faceForward && scene.activeCamera) {
            const camera = scene.activeCamera;
            const forward = math_vector/* Vector3 */.Pq.Forward();
            const direction = math_vector/* Vector3 */.Pq.TransformNormal(forward, camera.getViewMatrix());
            direction.normalize();
            this.rotation.y = Math.acos(math_vector/* Vector3 */.Pq.Dot(forward, direction));
        }
        this._changeTextureMode(this._textureMode);
    }
    _changeTextureMode(value) {
        this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver);
        this._textureMode = value;
        // Default Setup and Reset.
        this._texture.uScale = 1;
        this._texture.vScale = 1;
        this._texture.uOffset = 0;
        this._texture.vOffset = 0;
        this._texture.vAng = 0;
        switch (value) {
            case TextureDome.MODE_MONOSCOPIC:
                if (this._halfDome) {
                    this._texture.uScale = 2;
                    this._texture.uOffset = -1;
                }
                break;
            case TextureDome.MODE_SIDEBYSIDE: {
                // in half-dome mode the uScale should be double of 360 texture
                // Use 0.99999 to boost perf by not switching program
                this._texture.uScale = this._halfDome ? 0.99999 : 0.5;
                const rightOffset = this._halfDome ? 0.0 : 0.5;
                const leftOffset = this._halfDome ? -0.5 : 0.0;
                this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
                    let isRightCamera = camera.isRightCamera;
                    if (this._crossEye) {
                        isRightCamera = !isRightCamera;
                    }
                    if (isRightCamera) {
                        this._texture.uOffset = rightOffset;
                    }
                    else {
                        this._texture.uOffset = leftOffset;
                    }
                });
                break;
            }
            case TextureDome.MODE_TOPBOTTOM:
                // in half-dome mode the vScale should be double of 360 texture
                // Use 0.99999 to boost perf by not switching program
                this._texture.vScale = this._halfDome ? 0.99999 : 0.5;
                this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
                    let isRightCamera = camera.isRightCamera;
                    // allow "cross-eye" if left and right were switched in this mode
                    if (this._crossEye) {
                        isRightCamera = !isRightCamera;
                    }
                    this._texture.vOffset = isRightCamera ? 0.5 : 0.0;
                });
                break;
        }
    }
    /**
     * Releases resources associated with this node.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        this._texture.dispose();
        this._mesh.dispose();
        this._material.dispose();
        this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver);
        this.onLoadErrorObservable.clear();
        this.onLoadObservable.clear();
        super.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
}
/**
 * Define the source as a Monoscopic panoramic 360/180.
 */
TextureDome.MODE_MONOSCOPIC = 0;
/**
 * Define the source as a Stereoscopic TopBottom/OverUnder panoramic 360/180.
 */
TextureDome.MODE_TOPBOTTOM = 1;
/**
 * Define the source as a Stereoscopic Side by Side panoramic 360/180.
 */
TextureDome.MODE_SIDEBYSIDE = 2;
//# sourceMappingURL=textureDome.js.map
;// ./node_modules/@babylonjs/core/Helpers/photoDome.js


/**
 * Display a 360 degree photo on an approximately spherical surface, useful for VR applications or skyboxes.
 * As a subclass of TransformNode, this allow parenting to the camera with different locations in the scene.
 * This class achieves its effect with a Texture and a correctly configured BackgroundMaterial on an inverted sphere.
 * Potential additions to this helper include zoom and and non-infinite distance rendering effects.
 */
class PhotoDome extends TextureDome {
    /**
     * Gets or sets the texture being displayed on the sphere
     */
    get photoTexture() {
        return this.texture;
    }
    /**
     * sets the texture being displayed on the sphere
     */
    set photoTexture(value) {
        this.texture = value;
    }
    /**
     * Gets the current video mode for the video. It can be:
     * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
     * * TextureDome.MODE_TOPBOTTOM  : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
     * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
     */
    get imageMode() {
        return this.textureMode;
    }
    /**
     * Sets the current video mode for the video. It can be:
     * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
     * * TextureDome.MODE_TOPBOTTOM  : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
     * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
     */
    set imageMode(value) {
        this.textureMode = value;
    }
    _initTexture(urlsOrElement, scene, options) {
        return new Textures_texture/* Texture */.g(urlsOrElement, scene, !options.generateMipMaps, !this._useDirectMapping, undefined, () => {
            this.onLoadObservable.notifyObservers();
        }, (message, exception) => {
            this.onLoadErrorObservable.notifyObservers(message || "Unknown error occured");
            if (this.onError) {
                this.onError(message, exception);
            }
        });
    }
}
/**
 * Define the image as a Monoscopic panoramic 360 image.
 */
PhotoDome.MODE_MONOSCOPIC = TextureDome.MODE_MONOSCOPIC;
/**
 * Define the image as a Stereoscopic TopBottom/OverUnder panoramic 360 image.
 */
PhotoDome.MODE_TOPBOTTOM = TextureDome.MODE_TOPBOTTOM;
/**
 * Define the image as a Stereoscopic Side by Side panoramic 360 image.
 */
PhotoDome.MODE_SIDEBYSIDE = TextureDome.MODE_SIDEBYSIDE;
//# sourceMappingURL=photoDome.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.js
var pbrMaterial = __webpack_require__(23975);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/ddsTextureLoader.js
var ddsTextureLoader = __webpack_require__(50994);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/envTextureLoader.js
var envTextureLoader = __webpack_require__(17136);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/ktxTextureLoader.js
var ktxTextureLoader = __webpack_require__(29158);
;// ./node_modules/@babylonjs/core/XR/webXRCamera.js






/**
 * WebXR Camera which holds the views for the xrSession
 * @see https://doc.babylonjs.com/features/featuresDeepDive/webXR/webXRCamera
 */
class WebXRCamera extends Cameras_freeCamera/* FreeCamera */.S {
    /**
     * Creates a new webXRCamera, this should only be set at the camera after it has been updated by the xrSessionManager
     * @param name the name of the camera
     * @param scene the scene to add the camera to
     * @param _xrSessionManager a constructed xr session manager
     */
    constructor(name, scene, _xrSessionManager) {
        super(name, math_vector/* Vector3 */.Pq.Zero(), scene);
        this._xrSessionManager = _xrSessionManager;
        this._firstFrame = false;
        this._referenceQuaternion = math_vector/* Quaternion */.PT.Identity();
        this._referencedPosition = new math_vector/* Vector3 */.Pq();
        this._trackingState = 0 /* WebXRTrackingState.NOT_TRACKING */;
        /**
         * This will be triggered after the first XR Frame initialized the camera,
         * including the right number of views and their rendering parameters
         */
        this.onXRCameraInitializedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable raised before camera teleportation
         * @deprecated use onBeforeCameraTeleport of the teleportation feature instead
         */
        this.onBeforeCameraTeleport = new Misc_observable/* Observable */.cP();
        /**
         *  Observable raised after camera teleportation
         * @deprecated use onAfterCameraTeleport of the teleportation feature instead
         */
        this.onAfterCameraTeleport = new Misc_observable/* Observable */.cP();
        /**
         * Notifies when the camera's tracking state has changed.
         * Notice - will also be triggered when tracking has started (at the beginning of the session)
         */
        this.onTrackingStateChanged = new Misc_observable/* Observable */.cP();
        /**
         * Should position compensation execute on first frame.
         * This is used when copying the position from a native (non XR) camera
         */
        this.compensateOnFirstFrame = true;
        this._rotate180 = new math_vector/* Quaternion */.PT(0, 1, 0, 0);
        // Initial camera configuration
        this.minZ = 0.1;
        this.rotationQuaternion = new math_vector/* Quaternion */.PT();
        this.cameraRigMode = Cameras_camera/* Camera */.i.RIG_MODE_CUSTOM;
        this.updateUpVectorFromRotation = true;
        this._updateNumberOfRigCameras(1);
        // freeze projection matrix, which will be copied later
        this.freezeProjectionMatrix();
        this._deferOnly = true;
        this._xrSessionManager.onXRSessionInit.add(() => {
            this._referencedPosition.copyFromFloats(0, 0, 0);
            this._referenceQuaternion.copyFromFloats(0, 0, 0, 1);
            // first frame - camera's y position should be 0 for the correct offset
            this._firstFrame = this.compensateOnFirstFrame;
            this._xrSessionManager.onWorldScaleFactorChangedObservable.add(() => {
                // only run if in session
                if (!this._xrSessionManager.currentFrame) {
                    return;
                }
                this._updateDepthNearFar();
            });
        });
        // Check transformation changes on each frame. Callback is added to be first so that the transformation will be
        // applied to the rest of the elements using the referenceSpace object
        this._xrSessionManager.onXRFrameObservable.add(() => {
            if (this._firstFrame) {
                this._updateFromXRSession();
            }
            if (this.onXRCameraInitializedObservable.hasObservers()) {
                this.onXRCameraInitializedObservable.notifyObservers(this);
                this.onXRCameraInitializedObservable.clear();
            }
            if (this._deferredUpdated) {
                this.position.copyFrom(this._deferredPositionUpdate);
                this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate);
            }
            this._updateReferenceSpace();
            this._updateFromXRSession();
        }, undefined, true);
    }
    /**
     * Get the current XR tracking state of the camera
     */
    get trackingState() {
        return this._trackingState;
    }
    _setTrackingState(newState) {
        if (this._trackingState !== newState) {
            this._trackingState = newState;
            this.onTrackingStateChanged.notifyObservers(newState);
        }
    }
    /**
     * Return the user's height, unrelated to the current ground.
     * This will be the y position of this camera, when ground level is 0.
     *
     * Note - this value is multiplied by the worldScalingFactor (if set), so it will be in the same units as the scene.
     */
    get realWorldHeight() {
        const basePose = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.baseReferenceSpace);
        if (basePose && basePose.transform) {
            return basePose.transform.position.y * this._xrSessionManager.worldScalingFactor;
        }
        else {
            return 0;
        }
    }
    /** @internal */
    _updateForDualEyeDebugging( /*pupilDistance = 0.01*/) {
        // Create initial camera rigs
        this._updateNumberOfRigCameras(2);
        this.rigCameras[0].viewport = new math_viewport/* Viewport */.L(0, 0, 0.5, 1.0);
        // this.rigCameras[0].position.x = -pupilDistance / 2;
        this.rigCameras[0].outputRenderTarget = null;
        this.rigCameras[1].viewport = new math_viewport/* Viewport */.L(0.5, 0, 0.5, 1.0);
        // this.rigCameras[1].position.x = pupilDistance / 2;
        this.rigCameras[1].outputRenderTarget = null;
    }
    /**
     * Sets this camera's transformation based on a non-vr camera
     * @param otherCamera the non-vr camera to copy the transformation from
     * @param resetToBaseReferenceSpace should XR reset to the base reference space
     */
    setTransformationFromNonVRCamera(otherCamera = this.getScene().activeCamera, resetToBaseReferenceSpace = true) {
        if (!otherCamera || otherCamera === this) {
            return;
        }
        const mat = otherCamera.computeWorldMatrix();
        mat.decompose(undefined, this.rotationQuaternion, this.position);
        // set the ground level
        this.position.y = 0;
        math_vector/* Quaternion */.PT.FromEulerAnglesToRef(0, this.rotationQuaternion.toEulerAngles().y, 0, this.rotationQuaternion);
        this._firstFrame = true;
        if (resetToBaseReferenceSpace) {
            this._xrSessionManager.resetReferenceSpace();
        }
    }
    /**
     * Gets the current instance class name ("WebXRCamera").
     * @returns the class name
     */
    getClassName() {
        return "WebXRCamera";
    }
    /**
     * Set the target for the camera to look at.
     * Note that this only rotates around the Y axis, as opposed to the default behavior of other cameras
     * @param target the target to set the camera to look at
     */
    setTarget(target) {
        // only rotate around the y axis!
        const tmpVector = math_vector/* TmpVectors */.AA.Vector3[1];
        target.subtractToRef(this.position, tmpVector);
        tmpVector.y = 0;
        tmpVector.normalize();
        const yRotation = Math.atan2(tmpVector.x, tmpVector.z);
        this.rotationQuaternion.toEulerAnglesToRef(tmpVector);
        math_vector/* Quaternion */.PT.FromEulerAnglesToRef(tmpVector.x, yRotation, tmpVector.z, this.rotationQuaternion);
    }
    dispose() {
        super.dispose();
        this._lastXRViewerPose = undefined;
        this.onTrackingStateChanged.clear();
    }
    _updateDepthNearFar() {
        const far = (this.maxZ || 10000) * this._xrSessionManager.worldScalingFactor;
        const xrRenderState = {
            // if maxZ is 0 it should be "Infinity", but it doesn't work with the WebXR API. Setting to a large number.
            depthFar: far,
            depthNear: this.minZ,
        };
        this._xrSessionManager.updateRenderState(xrRenderState);
        this._cache.minZ = this.minZ;
        this._cache.maxZ = far;
    }
    _updateFromXRSession() {
        const pose = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.referenceSpace);
        this._lastXRViewerPose = pose || undefined;
        if (!pose) {
            this._setTrackingState(0 /* WebXRTrackingState.NOT_TRACKING */);
            return;
        }
        // Set the tracking state. if it didn't change it is a no-op
        const trackingState = pose.emulatedPosition ? 1 /* WebXRTrackingState.TRACKING_LOST */ : 2 /* WebXRTrackingState.TRACKING */;
        this._setTrackingState(trackingState);
        // check min/max Z and update if not the same as in cache
        if (this.minZ !== this._cache.minZ || this.maxZ !== this._cache.maxZ) {
            this._updateDepthNearFar();
        }
        if (pose.transform) {
            const orientation = pose.transform.orientation;
            if (pose.transform.orientation.x === undefined) {
                // Babylon native polyfill can return an undefined orientation value
                // When not initialized
                return;
            }
            const pos = pose.transform.position;
            this._referencedPosition.set(pos.x, pos.y, pos.z).scaleInPlace(this._xrSessionManager.worldScalingFactor);
            this._referenceQuaternion.set(orientation.x, orientation.y, orientation.z, orientation.w);
            if (!this._scene.useRightHandedSystem) {
                this._referencedPosition.z *= -1;
                this._referenceQuaternion.z *= -1;
                this._referenceQuaternion.w *= -1;
            }
            if (this._firstFrame) {
                this._firstFrame = false;
                // we have the XR reference, now use this to find the offset to get the camera to be
                // in the right position
                // set the height to correlate to the current height
                this.position.y += this._referencedPosition.y;
                // avoid using the head rotation on the first frame.
                this._referenceQuaternion.copyFromFloats(0, 0, 0, 1);
            }
            else {
                // update position and rotation as reference
                this.rotationQuaternion.copyFrom(this._referenceQuaternion);
                this.position.copyFrom(this._referencedPosition);
            }
        }
        // Update camera rigs
        if (this.rigCameras.length !== pose.views.length) {
            this._updateNumberOfRigCameras(pose.views.length);
        }
        pose.views.forEach((view, i) => {
            const currentRig = this.rigCameras[i];
            // update right and left, where applicable
            if (!currentRig.isLeftCamera && !currentRig.isRightCamera) {
                if (view.eye === "right") {
                    currentRig._isRightCamera = true;
                }
                else if (view.eye === "left") {
                    currentRig._isLeftCamera = true;
                }
            }
            // add any custom render targets to this camera, if available in the scene
            const customRenderTargets = this.getScene().customRenderTargets;
            // use a for loop
            for (let i = 0; i < customRenderTargets.length; i++) {
                const rt = customRenderTargets[i];
                // make sure we don't add the same render target twice
                if (currentRig.customRenderTargets.indexOf(rt) === -1) {
                    currentRig.customRenderTargets.push(rt);
                }
            }
            // Update view/projection matrix
            const pos = view.transform.position;
            const orientation = view.transform.orientation;
            currentRig.parent = this.parent;
            currentRig.position.set(pos.x, pos.y, pos.z).scaleInPlace(this._xrSessionManager.worldScalingFactor);
            currentRig.rotationQuaternion.set(orientation.x, orientation.y, orientation.z, orientation.w);
            if (!this._scene.useRightHandedSystem) {
                currentRig.position.z *= -1;
                currentRig.rotationQuaternion.z *= -1;
                currentRig.rotationQuaternion.w *= -1;
            }
            else {
                currentRig.rotationQuaternion.multiplyInPlace(this._rotate180);
            }
            math_vector/* Matrix */.uq.FromFloat32ArrayToRefScaled(view.projectionMatrix, 0, 1, currentRig._projectionMatrix);
            if (!this._scene.useRightHandedSystem) {
                currentRig._projectionMatrix.toggleProjectionMatrixHandInPlace();
            }
            // fov
            const fov = Math.atan2(1, view.projectionMatrix[5]) * 2;
            currentRig.fov = fov;
            // first camera?
            if (i === 0) {
                this.fov = fov;
                this._projectionMatrix.copyFrom(currentRig._projectionMatrix);
            }
            const renderTargetTexture = this._xrSessionManager.getRenderTargetTextureForView(view);
            this._renderingMultiview = renderTargetTexture?._texture?.isMultiview || false;
            if (this._renderingMultiview) {
                // For multiview, the render target texture is the same per-view (just the slice index is different),
                // so we only need to set the output render target once for the rig parent.
                if (i == 0) {
                    this._xrSessionManager.trySetViewportForView(this.viewport, view);
                    this.outputRenderTarget = renderTargetTexture;
                }
            }
            else {
                // Update viewport
                this._xrSessionManager.trySetViewportForView(currentRig.viewport, view);
                // Set cameras to render to the session's render target
                currentRig.outputRenderTarget = renderTargetTexture || this._xrSessionManager.getRenderTargetTextureForView(view);
            }
            // Replicate parent rig camera behavior
            currentRig.layerMask = this.layerMask;
        });
    }
    _updateNumberOfRigCameras(viewCount = 1) {
        while (this.rigCameras.length < viewCount) {
            const newCamera = new targetCamera/* TargetCamera */.F("XR-RigCamera: " + this.rigCameras.length, math_vector/* Vector3 */.Pq.Zero(), this.getScene());
            newCamera.minZ = 0.1;
            newCamera.rotationQuaternion = new math_vector/* Quaternion */.PT();
            newCamera.updateUpVectorFromRotation = true;
            newCamera.isRigCamera = true;
            newCamera.rigParent = this;
            // do not compute projection matrix, provided by XR
            newCamera.freezeProjectionMatrix();
            this.rigCameras.push(newCamera);
        }
        while (this.rigCameras.length > viewCount) {
            const removedCamera = this.rigCameras.pop();
            if (removedCamera) {
                removedCamera.dispose();
            }
        }
    }
    _updateReferenceSpace() {
        // were position & rotation updated OUTSIDE of the xr update loop
        if (!this.position.equals(this._referencedPosition) || !this.rotationQuaternion.equals(this._referenceQuaternion)) {
            const referencedMat = math_vector/* TmpVectors */.AA.Matrix[0];
            const poseMat = math_vector/* TmpVectors */.AA.Matrix[1];
            const transformMat = math_vector/* TmpVectors */.AA.Matrix[2];
            math_vector/* Matrix */.uq.ComposeToRef(WebXRCamera._ScaleReadOnly, this._referenceQuaternion, this._referencedPosition, referencedMat);
            math_vector/* Matrix */.uq.ComposeToRef(WebXRCamera._ScaleReadOnly, this.rotationQuaternion, this.position, poseMat);
            referencedMat.invert().multiplyToRef(poseMat, transformMat);
            transformMat.invert();
            if (!this._scene.useRightHandedSystem) {
                transformMat.toggleModelMatrixHandInPlace();
            }
            transformMat.decompose(undefined, this._referenceQuaternion, this._referencedPosition);
            const transform = new XRRigidTransform({
                x: this._referencedPosition.x / this._xrSessionManager.worldScalingFactor,
                y: this._referencedPosition.y / this._xrSessionManager.worldScalingFactor,
                z: this._referencedPosition.z / this._xrSessionManager.worldScalingFactor,
            }, {
                x: this._referenceQuaternion.x,
                y: this._referenceQuaternion.y,
                z: this._referenceQuaternion.z,
                w: this._referenceQuaternion.w,
            });
            this._xrSessionManager.referenceSpace = this._xrSessionManager.referenceSpace.getOffsetReferenceSpace(transform);
        }
    }
}
WebXRCamera._ScaleReadOnly = math_vector/* Vector3 */.Pq.One();
//# sourceMappingURL=webXRCamera.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/XR/webXRFeaturesManager.js
var webXRFeaturesManager = __webpack_require__(75441);
;// ./node_modules/@babylonjs/core/XR/webXRExperienceHelper.js








/**
 * Base set of functionality needed to create an XR experience (WebXRSessionManager, Camera, StateManagement, etc.)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/webXR/webXRExperienceHelpers
 */
class WebXRExperienceHelper {
    /**
     * Creates a WebXRExperienceHelper
     * @param _scene The scene the helper should be created in
     */
    constructor(_scene) {
        this._scene = _scene;
        this._nonVRCamera = null;
        this._attachedToElement = false;
        this._spectatorCamera = null;
        this._originalSceneAutoClear = true;
        this._supported = false;
        this._spectatorMode = false;
        this._lastTimestamp = 0;
        /**
         * Observers registered here will be triggered after the camera's initial transformation is set
         * This can be used to set a different ground level or an extra rotation.
         *
         * Note that ground level is considered to be at 0. The height defined by the XR camera will be added
         * to the position set after this observable is done executing.
         */
        this.onInitialXRPoseSetObservable = new Misc_observable/* Observable */.cP();
        /**
         * Fires when the state of the experience helper has changed
         */
        this.onStateChangedObservable = new Misc_observable/* Observable */.cP();
        /**
         * The current state of the XR experience (eg. transitioning, in XR or not in XR)
         */
        this.state = 3 /* WebXRState.NOT_IN_XR */;
        this.sessionManager = new WebXRSessionManager(_scene);
        this.camera = new WebXRCamera("webxr", _scene, this.sessionManager);
        this.featuresManager = new webXRFeaturesManager/* WebXRFeaturesManager */.n(this.sessionManager);
        _scene.onDisposeObservable.addOnce(() => {
            this.dispose();
        });
    }
    /**
     * Creates the experience helper
     * @param scene the scene to attach the experience helper to
     * @returns a promise for the experience helper
     */
    static CreateAsync(scene) {
        const helper = new WebXRExperienceHelper(scene);
        return helper.sessionManager
            .initializeAsync()
            .then(() => {
            helper._supported = true;
            return helper;
        })
            .catch((e) => {
            helper._setState(3 /* WebXRState.NOT_IN_XR */);
            helper.dispose();
            throw e;
        });
    }
    /**
     * Disposes of the experience helper
     */
    dispose() {
        this.exitXRAsync();
        this.camera.dispose();
        this.onStateChangedObservable.clear();
        this.onInitialXRPoseSetObservable.clear();
        this.sessionManager.dispose();
        this._spectatorCamera?.dispose();
        if (this._nonVRCamera) {
            this._scene.activeCamera = this._nonVRCamera;
        }
    }
    /**
     * Enters XR mode (This must be done within a user interaction in most browsers eg. button click)
     * @param sessionMode options for the XR session
     * @param referenceSpaceType frame of reference of the XR session
     * @param renderTarget the output canvas that will be used to enter XR mode
     * @param sessionCreationOptions optional XRSessionInit object to init the session with
     * @returns promise that resolves after xr mode has entered
     */
    async enterXRAsync(sessionMode, referenceSpaceType, renderTarget = this.sessionManager.getWebXRRenderTarget(), sessionCreationOptions = {}) {
        if (!this._supported) {
            // eslint-disable-next-line no-throw-literal
            throw "WebXR not supported in this browser or environment";
        }
        this._setState(0 /* WebXRState.ENTERING_XR */);
        if (referenceSpaceType !== "viewer" && referenceSpaceType !== "local") {
            sessionCreationOptions.optionalFeatures = sessionCreationOptions.optionalFeatures || [];
            sessionCreationOptions.optionalFeatures.push(referenceSpaceType);
        }
        sessionCreationOptions = await this.featuresManager._extendXRSessionInitObject(sessionCreationOptions);
        // we currently recommend "unbounded" space in AR (#7959)
        if (sessionMode === "immersive-ar" && referenceSpaceType !== "unbounded") {
            logger/* Logger */.V.Warn("We recommend using 'unbounded' reference space type when using 'immersive-ar' session mode");
        }
        // make sure that the session mode is supported
        try {
            await this.sessionManager.initializeSessionAsync(sessionMode, sessionCreationOptions);
            await this.sessionManager.setReferenceSpaceTypeAsync(referenceSpaceType);
            const xrRenderState = {
                // if maxZ is 0 it should be "Infinity", but it doesn't work with the WebXR API. Setting to a large number.
                depthFar: this.camera.maxZ || 10000,
                depthNear: this.camera.minZ,
            };
            // The layers feature will have already initialized the xr session's layers on session init.
            if (!this.featuresManager.getEnabledFeature(webXRFeaturesManager/* WebXRFeatureName */._.LAYERS)) {
                const baseLayer = await renderTarget.initializeXRLayerAsync(this.sessionManager.session);
                xrRenderState.baseLayer = baseLayer;
            }
            this.sessionManager.updateRenderState(xrRenderState);
            // run the render loop
            this.sessionManager.runXRRenderLoop();
            // Cache pre xr scene settings
            this._originalSceneAutoClear = this._scene.autoClear;
            this._nonVRCamera = this._scene.activeCamera;
            this._attachedToElement = !!this._nonVRCamera?.inputs?.attachedToElement;
            this._nonVRCamera?.detachControl();
            this._scene.activeCamera = this.camera;
            // do not compensate when AR session is used
            if (sessionMode !== "immersive-ar") {
                this._nonXRToXRCamera();
            }
            else {
                // Kept here, TODO - check if needed
                this._scene.autoClear = false;
                this.camera.compensateOnFirstFrame = false;
                // reset the camera's position to the origin
                this.camera.position.set(0, 0, 0);
                this.camera.rotationQuaternion.set(0, 0, 0, 1);
                this.onInitialXRPoseSetObservable.notifyObservers(this.camera);
            }
            // Vision Pro suspends the audio context when entering XR, so we resume it here if needed.
            abstractEngine/* AbstractEngine */.$.audioEngine?._resumeAudioContextOnStateChange();
            this.sessionManager.onXRSessionEnded.addOnce(() => {
                // when using the back button and not the exit button (default on mobile), the session is ending but the EXITING state was not set
                if (this.state !== 1 /* WebXRState.EXITING_XR */) {
                    this._setState(1 /* WebXRState.EXITING_XR */);
                }
                // Reset camera rigs output render target to ensure sessions render target is not drawn after it ends
                this.camera.rigCameras.forEach((c) => {
                    c.outputRenderTarget = null;
                });
                // Restore scene settings
                this._scene.autoClear = this._originalSceneAutoClear;
                this._scene.activeCamera = this._nonVRCamera;
                if (this._attachedToElement && this._nonVRCamera) {
                    this._nonVRCamera.attachControl(!!this._nonVRCamera.inputs.noPreventDefault);
                }
                if (sessionMode !== "immersive-ar" && this.camera.compensateOnFirstFrame) {
                    if (this._nonVRCamera.setPosition) {
                        this._nonVRCamera.setPosition(this.camera.position);
                    }
                    else {
                        this._nonVRCamera.position.copyFrom(this.camera.position);
                    }
                }
                this._setState(3 /* WebXRState.NOT_IN_XR */);
            });
            // Wait until the first frame arrives before setting state to in xr
            this.sessionManager.onXRFrameObservable.addOnce(() => {
                this._setState(2 /* WebXRState.IN_XR */);
            });
            return this.sessionManager;
        }
        catch (e) {
            logger/* Logger */.V.Log(e);
            logger/* Logger */.V.Log(e.message);
            this._setState(3 /* WebXRState.NOT_IN_XR */);
            throw e;
        }
    }
    /**
     * Exits XR mode and returns the scene to its original state
     * @returns promise that resolves after xr mode has exited
     */
    exitXRAsync() {
        // only exit if state is IN_XR
        if (this.state !== 2 /* WebXRState.IN_XR */) {
            return Promise.resolve();
        }
        this._setState(1 /* WebXRState.EXITING_XR */);
        return this.sessionManager.exitXRAsync();
    }
    /**
     * Enable spectator mode for desktop VR experiences.
     * When spectator mode is enabled a camera will be attached to the desktop canvas and will
     * display the first rig camera's view on the desktop canvas.
     * Please note that this will degrade performance, as it requires another camera render.
     * It is also not recommended to enable this in devices like the quest, as it brings no benefit there.
     * @param options giving WebXRSpectatorModeOption for specutator camera to setup when the spectator mode is enabled.
     */
    enableSpectatorMode(options) {
        if (!this._spectatorMode) {
            this._spectatorMode = true;
            this._switchSpectatorMode(options);
        }
    }
    /**
     * Disable spectator mode for desktop VR experiences.
     */
    disableSpecatatorMode() {
        if (this._spectatorMode) {
            this._spectatorMode = false;
            this._switchSpectatorMode();
        }
    }
    _switchSpectatorMode(options) {
        const fps = options?.fps ? options.fps : 1000.0;
        const refreshRate = (1.0 / fps) * 1000.0;
        const cameraIndex = options?.preferredCameraIndex ? options?.preferredCameraIndex : 0;
        const updateSpectatorCamera = () => {
            if (this._spectatorCamera) {
                const delta = this.sessionManager.currentTimestamp - this._lastTimestamp;
                if (delta >= refreshRate) {
                    this._lastTimestamp = this.sessionManager.currentTimestamp;
                    this._spectatorCamera.position.copyFrom(this.camera.rigCameras[cameraIndex].globalPosition);
                    this._spectatorCamera.rotationQuaternion.copyFrom(this.camera.rigCameras[cameraIndex].absoluteRotation);
                }
            }
        };
        if (this._spectatorMode) {
            if (cameraIndex >= this.camera.rigCameras.length) {
                throw new Error("the preferred camera index is beyond the length of rig camera array.");
            }
            const onStateChanged = () => {
                if (this.state === 2 /* WebXRState.IN_XR */) {
                    this._spectatorCamera = new UniversalCamera("webxr-spectator", math_vector/* Vector3 */.Pq.Zero(), this._scene);
                    this._spectatorCamera.rotationQuaternion = new math_vector/* Quaternion */.PT();
                    this._scene.activeCameras = [this.camera, this._spectatorCamera];
                    this.sessionManager.onXRFrameObservable.add(updateSpectatorCamera);
                    this._scene.onAfterRenderCameraObservable.add((camera) => {
                        if (camera === this.camera) {
                            // reset the dimensions object for correct resizing
                            this._scene.getEngine().framebufferDimensionsObject = null;
                        }
                    });
                }
                else if (this.state === 1 /* WebXRState.EXITING_XR */) {
                    this.sessionManager.onXRFrameObservable.removeCallback(updateSpectatorCamera);
                    this._scene.activeCameras = null;
                }
            };
            this.onStateChangedObservable.add(onStateChanged);
            onStateChanged();
        }
        else {
            this.sessionManager.onXRFrameObservable.removeCallback(updateSpectatorCamera);
            this._scene.activeCameras = [this.camera];
        }
    }
    _nonXRToXRCamera() {
        this.camera.setTransformationFromNonVRCamera(this._nonVRCamera);
        this.onInitialXRPoseSetObservable.notifyObservers(this.camera);
    }
    _setState(val) {
        if (this.state === val) {
            return;
        }
        this.state = val;
        this.onStateChangedObservable.notifyObservers(this.state);
    }
}
//# sourceMappingURL=webXRExperienceHelper.js.map
;// ./node_modules/@babylonjs/core/XR/motionController/webXRControllerComponent.js

/**
 * This class represents a single component (for example button or thumbstick) of a motion controller
 */
class WebXRControllerComponent {
    /**
     * Creates a new component for a motion controller.
     * It is created by the motion controller itself
     *
     * @param id the id of this component
     * @param type the type of the component
     * @param _buttonIndex index in the buttons array of the gamepad
     * @param _axesIndices indices of the values in the axes array of the gamepad
     */
    constructor(
    /**
     * the id of this component
     */
    id, 
    /**
     * the type of the component
     */
    type, _buttonIndex = -1, _axesIndices = []) {
        this.id = id;
        this.type = type;
        this._buttonIndex = _buttonIndex;
        this._axesIndices = _axesIndices;
        this._axes = {
            x: 0,
            y: 0,
        };
        this._changes = {};
        this._currentValue = 0;
        this._hasChanges = false;
        this._pressed = false;
        this._touched = false;
        /**
         * If axes are available for this component (like a touchpad or thumbstick) the observers will be notified when
         * the axes data changes
         */
        this.onAxisValueChangedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will be triggered when the state of a button changes
         * State change is either pressed / touched / value
         */
        this.onButtonStateChangedObservable = new Misc_observable/* Observable */.cP();
    }
    /**
     * The current axes data. If this component has no axes it will still return an object { x: 0, y: 0 }
     */
    get axes() {
        return this._axes;
    }
    /**
     * Get the changes. Elements will be populated only if they changed with their previous and current value
     */
    get changes() {
        return this._changes;
    }
    /**
     * Return whether or not the component changed the last frame
     */
    get hasChanges() {
        return this._hasChanges;
    }
    /**
     * is the button currently pressed
     */
    get pressed() {
        return this._pressed;
    }
    /**
     * is the button currently touched
     */
    get touched() {
        return this._touched;
    }
    /**
     * Get the current value of this component
     */
    get value() {
        return this._currentValue;
    }
    /**
     * Dispose this component
     */
    dispose() {
        this.onAxisValueChangedObservable.clear();
        this.onButtonStateChangedObservable.clear();
    }
    /**
     * Are there axes correlating to this component
     * @returns true is axes data is available
     */
    isAxes() {
        return this._axesIndices.length !== 0;
    }
    /**
     * Is this component a button (hence - pressable)
     * @returns true if can be pressed
     */
    isButton() {
        return this._buttonIndex !== -1;
    }
    /**
     * update this component using the gamepad object it is in. Called on every frame
     * @param nativeController the native gamepad controller object
     */
    update(nativeController) {
        let buttonUpdated = false;
        let axesUpdate = false;
        this._hasChanges = false;
        this._changes = {};
        if (this.isButton()) {
            const button = nativeController.buttons[this._buttonIndex];
            // defensive, in case a profile was forced
            if (!button) {
                return;
            }
            if (this._currentValue !== button.value) {
                this.changes.value = {
                    current: button.value,
                    previous: this._currentValue,
                };
                buttonUpdated = true;
                this._currentValue = button.value;
            }
            if (this._touched !== button.touched) {
                this.changes.touched = {
                    current: button.touched,
                    previous: this._touched,
                };
                buttonUpdated = true;
                this._touched = button.touched;
            }
            if (this._pressed !== button.pressed) {
                this.changes.pressed = {
                    current: button.pressed,
                    previous: this._pressed,
                };
                buttonUpdated = true;
                this._pressed = button.pressed;
            }
        }
        if (this.isAxes()) {
            if (this._axes.x !== nativeController.axes[this._axesIndices[0]]) {
                this.changes.axes = {
                    current: {
                        x: nativeController.axes[this._axesIndices[0]],
                        y: this._axes.y,
                    },
                    previous: {
                        x: this._axes.x,
                        y: this._axes.y,
                    },
                };
                this._axes.x = nativeController.axes[this._axesIndices[0]];
                axesUpdate = true;
            }
            if (this._axes.y !== nativeController.axes[this._axesIndices[1]]) {
                if (this.changes.axes) {
                    this.changes.axes.current.y = nativeController.axes[this._axesIndices[1]];
                }
                else {
                    this.changes.axes = {
                        current: {
                            x: this._axes.x,
                            y: nativeController.axes[this._axesIndices[1]],
                        },
                        previous: {
                            x: this._axes.x,
                            y: this._axes.y,
                        },
                    };
                }
                this._axes.y = nativeController.axes[this._axesIndices[1]];
                axesUpdate = true;
            }
        }
        if (buttonUpdated) {
            this._hasChanges = true;
            this.onButtonStateChangedObservable.notifyObservers(this);
        }
        if (axesUpdate) {
            this._hasChanges = true;
            this.onAxisValueChangedObservable.notifyObservers(this._axes);
        }
    }
}
/**
 * button component type
 */
WebXRControllerComponent.BUTTON_TYPE = "button";
/**
 * squeeze component type
 */
WebXRControllerComponent.SQUEEZE_TYPE = "squeeze";
/**
 * Thumbstick component type
 */
WebXRControllerComponent.THUMBSTICK_TYPE = "thumbstick";
/**
 * Touchpad component type
 */
WebXRControllerComponent.TOUCHPAD_TYPE = "touchpad";
/**
 * trigger component type
 */
WebXRControllerComponent.TRIGGER_TYPE = "trigger";
//# sourceMappingURL=webXRControllerComponent.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Loading/sceneLoader.js + 1 modules
var sceneLoader = __webpack_require__(15909);
;// ./node_modules/@babylonjs/core/XR/motionController/webXRAbstractMotionController.js






/**
 * An Abstract Motion controller
 * This class receives an xrInput and a profile layout and uses those to initialize the components
 * Each component has an observable to check for changes in value and state
 */
class WebXRAbstractMotionController {
    /**
     * constructs a new abstract motion controller
     * @param scene the scene to which the model of the controller will be added
     * @param layout The profile layout to load
     * @param gamepadObject The gamepad object correlating to this controller
     * @param handedness handedness (left/right/none) of this controller
     * @param _doNotLoadControllerMesh set this flag to ignore the mesh loading
     * @param _controllerCache a cache holding controller models already loaded in this session
     */
    constructor(
    // eslint-disable-next-line @typescript-eslint/naming-convention
    scene, 
    // eslint-disable-next-line @typescript-eslint/naming-convention
    layout, 
    /**
     * The gamepad object correlating to this controller
     */
    gamepadObject, 
    /**
     * handedness (left/right/none) of this controller
     */
    handedness, 
    /**
     * @internal
     * [false]
     */
    _doNotLoadControllerMesh = false, _controllerCache) {
        this.scene = scene;
        this.layout = layout;
        this.gamepadObject = gamepadObject;
        this.handedness = handedness;
        this._doNotLoadControllerMesh = _doNotLoadControllerMesh;
        this._controllerCache = _controllerCache;
        this._initComponent = (id) => {
            if (!id) {
                return;
            }
            const componentDef = this.layout.components[id];
            const type = componentDef.type;
            const buttonIndex = componentDef.gamepadIndices.button;
            // search for axes
            const axes = [];
            if (componentDef.gamepadIndices.xAxis !== undefined && componentDef.gamepadIndices.yAxis !== undefined) {
                axes.push(componentDef.gamepadIndices.xAxis, componentDef.gamepadIndices.yAxis);
            }
            this.components[id] = new WebXRControllerComponent(id, type, buttonIndex, axes);
        };
        this._modelReady = false;
        /**
         * A map of components (WebXRControllerComponent) in this motion controller
         * Components have a ComponentType and can also have both button and axis definitions
         */
        this.components = {};
        /**
         * Disable the model's animation. Can be set at any time.
         */
        this.disableAnimation = false;
        /**
         * Observers registered here will be triggered when the model of this controller is done loading
         */
        this.onModelLoadedObservable = new Misc_observable/* Observable */.cP();
        // initialize the components
        if (layout.components) {
            Object.keys(layout.components).forEach(this._initComponent);
        }
        // Model is loaded in WebXRInput
    }
    /**
     * Dispose this controller, the model mesh and all its components
     */
    dispose() {
        this.getComponentIds().forEach((id) => this.getComponent(id).dispose());
        if (this.rootMesh) {
            this.rootMesh.getChildren(undefined, true).forEach((node) => {
                node.setEnabled(false);
            });
            this.rootMesh.dispose(!!this._controllerCache, !this._controllerCache);
        }
        this.onModelLoadedObservable.clear();
    }
    /**
     * Returns all components of specific type
     * @param type the type to search for
     * @returns an array of components with this type
     */
    getAllComponentsOfType(type) {
        return this.getComponentIds()
            .map((id) => this.components[id])
            .filter((component) => component.type === type);
    }
    /**
     * get a component based an its component id as defined in layout.components
     * @param id the id of the component
     * @returns the component correlates to the id or undefined if not found
     */
    getComponent(id) {
        return this.components[id];
    }
    /**
     * Get the list of components available in this motion controller
     * @returns an array of strings correlating to available components
     */
    getComponentIds() {
        return Object.keys(this.components);
    }
    /**
     * Get the first component of specific type
     * @param type type of component to find
     * @returns a controller component or null if not found
     */
    getComponentOfType(type) {
        return this.getAllComponentsOfType(type)[0] || null;
    }
    /**
     * Get the main (Select) component of this controller as defined in the layout
     * @returns the main component of this controller
     */
    getMainComponent() {
        return this.getComponent(this.layout.selectComponentId);
    }
    /**
     * Loads the model correlating to this controller
     * When the mesh is loaded, the onModelLoadedObservable will be triggered
     * @returns A promise fulfilled with the result of the model loading
     */
    async loadModel() {
        const useGeneric = !this._getModelLoadingConstraints();
        let loadingParams = this._getGenericFilenameAndPath();
        // Checking if GLB loader is present
        if (useGeneric) {
            logger/* Logger */.V.Warn("Falling back to generic models");
        }
        else {
            loadingParams = this._getFilenameAndPath();
        }
        return new Promise((resolve, reject) => {
            const meshesLoaded = (meshes) => {
                if (useGeneric) {
                    this._getGenericParentMesh(meshes);
                }
                else {
                    this._setRootMesh(meshes);
                }
                this._processLoadedModel(meshes);
                this._modelReady = true;
                this.onModelLoadedObservable.notifyObservers(this);
                resolve(true);
            };
            if (this._controllerCache) {
                // look for it in the cache
                const found = this._controllerCache.filter((c) => {
                    return c.filename === loadingParams.filename && c.path === loadingParams.path;
                });
                if (found[0]) {
                    found[0].meshes.forEach((mesh) => mesh.setEnabled(true));
                    meshesLoaded(found[0].meshes);
                    return;
                    // found, don't continue to load
                }
            }
            sceneLoader/* SceneLoader */.cn.ImportMesh("", loadingParams.path, loadingParams.filename, this.scene, (meshes) => {
                if (this._controllerCache) {
                    this._controllerCache.push({
                        ...loadingParams,
                        meshes,
                    });
                }
                meshesLoaded(meshes);
            }, null, (_scene, message) => {
                logger/* Logger */.V.Log(message);
                logger/* Logger */.V.Warn(`Failed to retrieve controller model of type ${this.profileId} from the remote server: ${loadingParams.path}${loadingParams.filename}`);
                reject(message);
            });
        });
    }
    /**
     * Update this model using the current XRFrame
     * @param xrFrame the current xr frame to use and update the model
     */
    updateFromXRFrame(xrFrame) {
        this.getComponentIds().forEach((id) => this.getComponent(id).update(this.gamepadObject));
        this.updateModel(xrFrame);
    }
    /**
     * Backwards compatibility due to a deeply-integrated typo
     */
    get handness() {
        return this.handedness;
    }
    /**
     * Pulse (vibrate) this controller
     * If the controller does not support pulses, this function will fail silently and return Promise<false> directly after called
     * Consecutive calls to this function will cancel the last pulse call
     *
     * @param value the strength of the pulse in 0.0...1.0 range
     * @param duration Duration of the pulse in milliseconds
     * @param hapticActuatorIndex optional index of actuator (will usually be 0)
     * @returns a promise that will send true when the pulse has ended and false if the device doesn't support pulse or an error accrued
     */
    pulse(value, duration, hapticActuatorIndex = 0) {
        if (this.gamepadObject.hapticActuators && this.gamepadObject.hapticActuators[hapticActuatorIndex]) {
            return this.gamepadObject.hapticActuators[hapticActuatorIndex].pulse(value, duration);
        }
        else {
            return Promise.resolve(false);
        }
    }
    // Look through all children recursively. This will return null if no mesh exists with the given name.
    _getChildByName(node, name) {
        return node.getChildren((n) => n.name === name, false)[0];
    }
    // Look through only immediate children. This will return null if no mesh exists with the given name.
    _getImmediateChildByName(node, name) {
        return node.getChildren((n) => n.name == name, true)[0];
    }
    /**
     * Moves the axis on the controller mesh based on its current state
     * @param axisMap
     * @param axisValue the value of the axis which determines the meshes new position
     * @internal
     */
    _lerpTransform(axisMap, axisValue, fixValueCoordinates) {
        if (!axisMap.minMesh || !axisMap.maxMesh || !axisMap.valueMesh) {
            return;
        }
        if (!axisMap.minMesh.rotationQuaternion || !axisMap.maxMesh.rotationQuaternion || !axisMap.valueMesh.rotationQuaternion) {
            return;
        }
        // Convert from gamepad value range (-1 to +1) to lerp range (0 to 1)
        const lerpValue = fixValueCoordinates ? axisValue * 0.5 + 0.5 : axisValue;
        math_vector/* Quaternion */.PT.SlerpToRef(axisMap.minMesh.rotationQuaternion, axisMap.maxMesh.rotationQuaternion, lerpValue, axisMap.valueMesh.rotationQuaternion);
        math_vector/* Vector3 */.Pq.LerpToRef(axisMap.minMesh.position, axisMap.maxMesh.position, lerpValue, axisMap.valueMesh.position);
    }
    /**
     * Update the model itself with the current frame data
     * @param xrFrame the frame to use for updating the model mesh
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    updateModel(xrFrame) {
        if (!this._modelReady) {
            return;
        }
        this._updateModel(xrFrame);
    }
    _getGenericFilenameAndPath() {
        return {
            filename: "generic.babylon",
            path: "https://controllers.babylonjs.com/generic/",
        };
    }
    _getGenericParentMesh(meshes) {
        this.rootMesh = new Meshes_mesh/* Mesh */.e(this.profileId + " " + this.handedness, this.scene);
        meshes.forEach((mesh) => {
            if (!mesh.parent) {
                mesh.isPickable = false;
                mesh.setParent(this.rootMesh);
            }
        });
        this.rootMesh.rotationQuaternion = math_vector/* Quaternion */.PT.FromEulerAngles(0, Math.PI, 0);
    }
}
//# sourceMappingURL=webXRAbstractMotionController.js.map
;// ./node_modules/@babylonjs/core/XR/motionController/webXRGenericMotionController.js



/**
 * A generic trigger-only motion controller for WebXR
 */
class WebXRGenericTriggerMotionController extends WebXRAbstractMotionController {
    constructor(scene, gamepadObject, handedness) {
        super(scene, GenericTriggerLayout[handedness], gamepadObject, handedness);
        this.profileId = WebXRGenericTriggerMotionController.ProfileId;
    }
    _getFilenameAndPath() {
        return {
            filename: "generic.babylon",
            path: "https://controllers.babylonjs.com/generic/",
        };
    }
    _getModelLoadingConstraints() {
        return true;
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _processLoadedModel(meshes) {
        // nothing to do
    }
    _setRootMesh(meshes) {
        this.rootMesh = new Meshes_mesh/* Mesh */.e(this.profileId + " " + this.handedness, this.scene);
        meshes.forEach((mesh) => {
            mesh.isPickable = false;
            if (!mesh.parent) {
                mesh.setParent(this.rootMesh);
            }
        });
        this.rootMesh.rotationQuaternion = math_vector/* Quaternion */.PT.FromEulerAngles(0, Math.PI, 0);
    }
    _updateModel() {
        // no-op
    }
}
/**
 * Static version of the profile id of this controller
 */
WebXRGenericTriggerMotionController.ProfileId = "generic-trigger";
// https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/generic/generic-trigger-touchpad-thumbstick.json
const GenericTriggerLayout = {
    left: {
        selectComponentId: "xr-standard-trigger",
        components: {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "generic-trigger-left",
        assetPath: "left.glb",
    },
    right: {
        selectComponentId: "xr-standard-trigger",
        components: {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "generic-trigger-right",
        assetPath: "right.glb",
    },
    none: {
        selectComponentId: "xr-standard-trigger",
        components: {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "generic-trigger-none",
        assetPath: "none.glb",
    },
};
//# sourceMappingURL=webXRGenericMotionController.js.map
;// ./node_modules/@babylonjs/core/XR/motionController/webXRProfiledMotionController.js









/**
 * A profiled motion controller has its profile loaded from an online repository.
 * The class is responsible of loading the model, mapping the keys and enabling model-animations
 */
class WebXRProfiledMotionController extends WebXRAbstractMotionController {
    constructor(scene, xrInput, _profile, _repositoryUrl, 
    // eslint-disable-next-line @typescript-eslint/naming-convention
    controllerCache) {
        super(scene, _profile.layouts[xrInput.handedness || "none"], xrInput.gamepad, xrInput.handedness, undefined, controllerCache);
        this._repositoryUrl = _repositoryUrl;
        this.controllerCache = controllerCache;
        this._buttonMeshMapping = {};
        this._touchDots = {};
        this.profileId = _profile.profileId;
    }
    dispose() {
        super.dispose();
        if (!this.controllerCache) {
            Object.keys(this._touchDots).forEach((visResKey) => {
                this._touchDots[visResKey].dispose();
            });
        }
    }
    _getFilenameAndPath() {
        return {
            filename: this.layout.assetPath,
            path: `${this._repositoryUrl}/profiles/${this.profileId}/`,
        };
    }
    _getModelLoadingConstraints() {
        const glbLoaded = sceneLoader/* SceneLoader */.cn.IsPluginForExtensionAvailable(".glb");
        if (!glbLoaded) {
            logger/* Logger */.V.Warn("glTF / glb loader was not registered, using generic controller instead");
        }
        return glbLoaded;
    }
    _processLoadedModel(_meshes) {
        this.getComponentIds().forEach((type) => {
            const componentInLayout = this.layout.components[type];
            this._buttonMeshMapping[type] = {
                mainMesh: this._getChildByName(this.rootMesh, componentInLayout.rootNodeName),
                states: {},
            };
            Object.keys(componentInLayout.visualResponses).forEach((visualResponseKey) => {
                const visResponse = componentInLayout.visualResponses[visualResponseKey];
                if (visResponse.valueNodeProperty === "transform") {
                    this._buttonMeshMapping[type].states[visualResponseKey] = {
                        valueMesh: this._getChildByName(this.rootMesh, visResponse.valueNodeName),
                        minMesh: this._getChildByName(this.rootMesh, visResponse.minNodeName),
                        maxMesh: this._getChildByName(this.rootMesh, visResponse.maxNodeName),
                    };
                }
                else {
                    // visibility, usually for touchpads
                    const nameOfMesh = componentInLayout.type === WebXRControllerComponent.TOUCHPAD_TYPE && componentInLayout.touchPointNodeName
                        ? componentInLayout.touchPointNodeName
                        : visResponse.valueNodeName;
                    this._buttonMeshMapping[type].states[visualResponseKey] = {
                        valueMesh: this._getChildByName(this.rootMesh, nameOfMesh),
                    };
                    if (componentInLayout.type === WebXRControllerComponent.TOUCHPAD_TYPE && !this._touchDots[visualResponseKey]) {
                        const dot = CreateSphere(visualResponseKey + "dot", {
                            diameter: 0.0015,
                            segments: 8,
                        }, this.scene);
                        dot.material = new standardMaterial/* StandardMaterial */.F(visualResponseKey + "mat", this.scene);
                        dot.material.diffuseColor = math_color/* Color3 */.v9.Red();
                        dot.parent = this._buttonMeshMapping[type].states[visualResponseKey].valueMesh || null;
                        dot.isVisible = false;
                        this._touchDots[visualResponseKey] = dot;
                    }
                }
            });
        });
    }
    _setRootMesh(meshes) {
        this.rootMesh = new Meshes_mesh/* Mesh */.e(this.profileId + "-" + this.handedness, this.scene);
        this.rootMesh.isPickable = false;
        let rootMesh;
        // Find the root node in the loaded glTF scene, and attach it as a child of 'parentMesh'
        for (let i = 0; i < meshes.length; i++) {
            const mesh = meshes[i];
            mesh.isPickable = false;
            if (!mesh.parent) {
                // Handle root node, attach to the new parentMesh
                rootMesh = mesh;
            }
        }
        if (rootMesh) {
            rootMesh.setParent(this.rootMesh);
        }
        if (!this.scene.useRightHandedSystem) {
            this.rootMesh.rotate(math_axis/* Axis */._0.Y, Math.PI, 1 /* Space.WORLD */);
        }
    }
    _updateModel(_xrFrame) {
        if (this.disableAnimation) {
            return;
        }
        this.getComponentIds().forEach((id) => {
            const component = this.getComponent(id);
            if (!component.hasChanges) {
                return;
            }
            const meshes = this._buttonMeshMapping[id];
            const componentInLayout = this.layout.components[id];
            Object.keys(componentInLayout.visualResponses).forEach((visualResponseKey) => {
                const visResponse = componentInLayout.visualResponses[visualResponseKey];
                let value = component.value;
                if (visResponse.componentProperty === "xAxis") {
                    value = component.axes.x;
                }
                else if (visResponse.componentProperty === "yAxis") {
                    value = component.axes.y;
                }
                if (visResponse.valueNodeProperty === "transform") {
                    this._lerpTransform(meshes.states[visualResponseKey], value, visResponse.componentProperty !== "button");
                }
                else {
                    // visibility
                    const valueMesh = meshes.states[visualResponseKey].valueMesh;
                    if (valueMesh) {
                        valueMesh.isVisible = component.touched || component.pressed;
                    }
                    if (this._touchDots[visualResponseKey]) {
                        this._touchDots[visualResponseKey].isVisible = component.touched || component.pressed;
                    }
                }
            });
        });
    }
}
//# sourceMappingURL=webXRProfiledMotionController.js.map
;// ./node_modules/@babylonjs/core/XR/motionController/webXRMotionControllerManager.js



/**
 * The MotionController Manager manages all registered motion controllers and loads the right one when needed.
 *
 * When this repository is complete: https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/assets
 * it should be replaced with auto-loaded controllers.
 *
 * When using a model try to stay as generic as possible. Eventually there will be no need in any of the controller classes
 */
const controllerCache = [];
/**
 * Motion controller manager is managing the different webxr profiles and makes sure the right
 * controller is being loaded.
 */
class WebXRMotionControllerManager {
    /**
     * Clear the cache used for profile loading and reload when requested again
     */
    static ClearProfilesCache() {
        this._ProfilesList = null;
        this._ProfileLoadingPromises = {};
    }
    /**
     * Register the default fallbacks.
     * This function is called automatically when this file is imported.
     */
    static DefaultFallbacks() {
        this.RegisterFallbacksForProfileId("google-daydream", ["generic-touchpad"]);
        this.RegisterFallbacksForProfileId("htc-vive-focus", ["generic-trigger-touchpad"]);
        this.RegisterFallbacksForProfileId("htc-vive", ["generic-trigger-squeeze-touchpad"]);
        this.RegisterFallbacksForProfileId("magicleap-one", ["generic-trigger-squeeze-touchpad"]);
        this.RegisterFallbacksForProfileId("windows-mixed-reality", ["generic-trigger-squeeze-touchpad-thumbstick"]);
        this.RegisterFallbacksForProfileId("microsoft-mixed-reality", ["windows-mixed-reality", "generic-trigger-squeeze-touchpad-thumbstick"]);
        this.RegisterFallbacksForProfileId("oculus-go", ["generic-trigger-touchpad"]);
        this.RegisterFallbacksForProfileId("oculus-touch-v2", ["oculus-touch", "generic-trigger-squeeze-thumbstick"]);
        this.RegisterFallbacksForProfileId("oculus-touch", ["generic-trigger-squeeze-thumbstick"]);
        this.RegisterFallbacksForProfileId("samsung-gearvr", ["windows-mixed-reality", "generic-trigger-squeeze-touchpad-thumbstick"]);
        this.RegisterFallbacksForProfileId("samsung-odyssey", ["generic-touchpad"]);
        this.RegisterFallbacksForProfileId("valve-index", ["generic-trigger-squeeze-touchpad-thumbstick"]);
        this.RegisterFallbacksForProfileId("generic-hand-select", ["generic-trigger"]);
    }
    /**
     * Find a fallback profile if the profile was not found. There are a few predefined generic profiles.
     * @param profileId the profile to which a fallback needs to be found
     * @returns an array with corresponding fallback profiles
     */
    static FindFallbackWithProfileId(profileId) {
        const returnArray = this._Fallbacks[profileId] || [];
        returnArray.unshift(profileId);
        return returnArray;
    }
    /**
     * When acquiring a new xrInput object (usually by the WebXRInput class), match it with the correct profile.
     * The order of search:
     *
     * 1) Iterate the profiles array of the xr input and try finding a corresponding motion controller
     * 2) (If not found) search in the gamepad id and try using it (legacy versions only)
     * 3) search for registered fallbacks (should be redundant, nonetheless it makes sense to check)
     * 4) return the generic trigger controller if none were found
     *
     * @param xrInput the xrInput to which a new controller is initialized
     * @param scene the scene to which the model will be added
     * @param forceProfile force a certain profile for this controller
     * @returns A promise that fulfils with the motion controller class for this profile id or the generic standard class if none was found
     */
    static GetMotionControllerWithXRInput(xrInput, scene, forceProfile) {
        const profileArray = [];
        if (forceProfile) {
            profileArray.push(forceProfile);
        }
        profileArray.push(...(xrInput.profiles || []));
        // emulator support
        if (profileArray.length && !profileArray[0]) {
            // remove the first "undefined" that the emulator is adding
            profileArray.pop();
        }
        // legacy support - try using the gamepad id
        if (xrInput.gamepad && xrInput.gamepad.id) {
            switch (xrInput.gamepad.id) {
                case xrInput.gamepad.id.match(/oculus touch/gi) ? xrInput.gamepad.id : undefined:
                    // oculus in gamepad id
                    profileArray.push("oculus-touch-v2");
                    break;
            }
        }
        // make sure microsoft/windows mixed reality works correctly
        const windowsMRIdx = profileArray.indexOf("windows-mixed-reality");
        if (windowsMRIdx !== -1) {
            profileArray.splice(windowsMRIdx, 0, "microsoft-mixed-reality");
        }
        if (!profileArray.length) {
            profileArray.push("generic-trigger");
        }
        if (this.UseOnlineRepository) {
            const firstFunction = this.PrioritizeOnlineRepository ? this._LoadProfileFromRepository : this._LoadProfilesFromAvailableControllers;
            const secondFunction = this.PrioritizeOnlineRepository ? this._LoadProfilesFromAvailableControllers : this._LoadProfileFromRepository;
            return firstFunction.call(this, profileArray, xrInput, scene).catch(() => {
                return secondFunction.call(this, profileArray, xrInput, scene);
            });
        }
        else {
            // use only available functions
            return this._LoadProfilesFromAvailableControllers(profileArray, xrInput, scene);
        }
    }
    /**
     * Register a new controller based on its profile. This function will be called by the controller classes themselves.
     *
     * If you are missing a profile, make sure it is imported in your source, otherwise it will not register.
     *
     * @param type the profile type to register
     * @param constructFunction the function to be called when loading this profile
     */
    static RegisterController(type, constructFunction) {
        this._AvailableControllers[type] = constructFunction;
    }
    /**
     * Register a fallback to a specific profile.
     * @param profileId the profileId that will receive the fallbacks
     * @param fallbacks A list of fallback profiles
     */
    static RegisterFallbacksForProfileId(profileId, fallbacks) {
        if (this._Fallbacks[profileId]) {
            this._Fallbacks[profileId].push(...fallbacks);
        }
        else {
            this._Fallbacks[profileId] = fallbacks;
        }
    }
    /**
     * Will update the list of profiles available in the repository
     * @returns a promise that resolves to a map of profiles available online
     */
    static UpdateProfilesList() {
        this._ProfilesList = tools/* Tools */.S0.LoadFileAsync(this.BaseRepositoryUrl + "/profiles/profilesList.json", false).then((data) => {
            return JSON.parse(data);
        });
        return this._ProfilesList;
    }
    /**
     * Clear the controller's cache (usually happens at the end of a session)
     */
    static ClearControllerCache() {
        controllerCache.forEach((cacheItem) => {
            cacheItem.meshes.forEach((mesh) => {
                mesh.dispose(false, true);
            });
        });
        controllerCache.length = 0;
    }
    static _LoadProfileFromRepository(profileArray, xrInput, scene) {
        return Promise.resolve()
            .then(() => {
            if (!this._ProfilesList) {
                return this.UpdateProfilesList();
            }
            else {
                return this._ProfilesList;
            }
        })
            .then((profilesList) => {
            // load the right profile
            for (let i = 0; i < profileArray.length; ++i) {
                // defensive
                if (!profileArray[i]) {
                    continue;
                }
                if (profilesList[profileArray[i]]) {
                    return profileArray[i];
                }
            }
            throw new Error(`neither controller ${profileArray[0]} nor all fallbacks were found in the repository,`);
        })
            .then((profileToLoad) => {
            // load the profile
            if (!this._ProfileLoadingPromises[profileToLoad]) {
                this._ProfileLoadingPromises[profileToLoad] = tools/* Tools */.S0.LoadFileAsync(`${this.BaseRepositoryUrl}/profiles/${profileToLoad}/profile.json`, false).then((data) => JSON.parse(data));
            }
            return this._ProfileLoadingPromises[profileToLoad];
        })
            .then((profile) => {
            return new WebXRProfiledMotionController(scene, xrInput, profile, this.BaseRepositoryUrl, this.DisableControllerCache ? undefined : controllerCache);
        });
    }
    static _LoadProfilesFromAvailableControllers(profileArray, xrInput, scene) {
        // check fallbacks
        for (let i = 0; i < profileArray.length; ++i) {
            // defensive
            if (!profileArray[i]) {
                continue;
            }
            const fallbacks = this.FindFallbackWithProfileId(profileArray[i]);
            for (let j = 0; j < fallbacks.length; ++j) {
                const constructionFunction = this._AvailableControllers[fallbacks[j]];
                if (constructionFunction) {
                    return Promise.resolve(constructionFunction(xrInput, scene));
                }
            }
        }
        throw new Error(`no controller requested was found in the available controllers list`);
    }
}
WebXRMotionControllerManager._AvailableControllers = {};
WebXRMotionControllerManager._Fallbacks = {};
// cache for loading
WebXRMotionControllerManager._ProfileLoadingPromises = {};
/**
 * The base URL of the online controller repository. Can be changed at any time.
 */
WebXRMotionControllerManager.BaseRepositoryUrl = "https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist";
/**
 * Which repository gets priority - local or online
 */
WebXRMotionControllerManager.PrioritizeOnlineRepository = true;
/**
 * Use the online repository, or use only locally-defined controllers
 */
WebXRMotionControllerManager.UseOnlineRepository = true;
/**
 * Disable the controller cache and load the models each time a new WebXRProfileMotionController is loaded.
 * Defaults to true.
 */
WebXRMotionControllerManager.DisableControllerCache = true;
// register the generic profile(s) here so we will at least have them
WebXRMotionControllerManager.RegisterController(WebXRGenericTriggerMotionController.ProfileId, (xrInput, scene) => {
    return new WebXRGenericTriggerMotionController(scene, xrInput.gamepad, xrInput.handedness);
});
// register fallbacks
WebXRMotionControllerManager.DefaultFallbacks();
//# sourceMappingURL=webXRMotionControllerManager.js.map
;// ./node_modules/@babylonjs/core/XR/webXRInputSource.js





let idCount = 0;
/**
 * Represents an XR controller
 */
class WebXRInputSource {
    /**
     * Creates the input source object
     * @see https://doc.babylonjs.com/features/featuresDeepDive/webXR/webXRInputControllerSupport
     * @param _scene the scene which the controller should be associated to
     * @param inputSource the underlying input source for the controller
     * @param _options options for this controller creation
     */
    constructor(_scene, 
    /** The underlying input source for the controller  */
    inputSource, _options = {}) {
        this._scene = _scene;
        this.inputSource = inputSource;
        this._options = _options;
        this._tmpVector = new math_vector/* Vector3 */.Pq();
        this._disposed = false;
        /**
         * Event that fires when the controller is removed/disposed.
         * The object provided as event data is this controller, after associated assets were disposed.
         * uniqueId is still available.
         */
        this.onDisposeObservable = new Misc_observable/* Observable */.cP();
        /**
         * Will be triggered when the mesh associated with the motion controller is done loading.
         * It is also possible that this will never trigger (!) if no mesh was loaded, or if the developer decides to load a different mesh
         * A shortened version of controller -> motion controller -> on mesh loaded.
         */
        this.onMeshLoadedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will trigger when a motion controller profile was assigned to this xr controller
         */
        this.onMotionControllerInitObservable = new Misc_observable/* Observable */.cP();
        this._uniqueId = `controller-${idCount++}-${inputSource.targetRayMode}-${inputSource.handedness}`;
        this.pointer = new Meshes_mesh/* Mesh */.e(`${this._uniqueId}-pointer`, _scene);
        this.pointer.rotationQuaternion = new math_vector/* Quaternion */.PT();
        if (this.inputSource.gripSpace) {
            this.grip = new Meshes_mesh/* Mesh */.e(`${this._uniqueId}-grip`, this._scene);
            this.grip.rotationQuaternion = new math_vector/* Quaternion */.PT();
        }
        this._tmpVector.set(0, 0, this._scene.useRightHandedSystem ? -1.0 : 1.0);
        // for now only load motion controllers if gamepad object available
        if (this.inputSource.gamepad && this.inputSource.targetRayMode === "tracked-pointer") {
            WebXRMotionControllerManager.GetMotionControllerWithXRInput(inputSource, _scene, this._options.forceControllerProfile).then((motionController) => {
                this.motionController = motionController;
                this.onMotionControllerInitObservable.notifyObservers(motionController);
                // should the model be loaded?
                if (!this._options.doNotLoadControllerMesh && !this.motionController._doNotLoadControllerMesh) {
                    this.motionController.loadModel().then((success) => {
                        if (success && this.motionController && this.motionController.rootMesh) {
                            if (this._options.renderingGroupId) {
                                // anything other than 0?
                                this.motionController.rootMesh.renderingGroupId = this._options.renderingGroupId;
                                this.motionController.rootMesh.getChildMeshes(false).forEach((mesh) => (mesh.renderingGroupId = this._options.renderingGroupId));
                            }
                            this.onMeshLoadedObservable.notifyObservers(this.motionController.rootMesh);
                            this.motionController.rootMesh.parent = this.grip || this.pointer;
                            this.motionController.disableAnimation = !!this._options.disableMotionControllerAnimation;
                        }
                        // make sure to dispose is the controller is already disposed
                        if (this._disposed) {
                            this.motionController?.dispose();
                        }
                    });
                }
            }, () => {
                tools/* Tools */.S0.Warn(`Could not find a matching motion controller for the registered input source`);
            });
        }
    }
    /**
     * Get this controllers unique id
     */
    get uniqueId() {
        return this._uniqueId;
    }
    /**
     * Disposes of the object
     */
    dispose() {
        if (this.grip) {
            this.grip.dispose(true);
        }
        if (this.motionController) {
            this.motionController.dispose();
        }
        this.pointer.dispose(true);
        this.onMotionControllerInitObservable.clear();
        this.onMeshLoadedObservable.clear();
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
        this._disposed = true;
    }
    /**
     * Gets a world space ray coming from the pointer or grip
     * @param result the resulting ray
     * @param gripIfAvailable use the grip mesh instead of the pointer, if available
     */
    getWorldPointerRayToRef(result, gripIfAvailable = false) {
        const object = gripIfAvailable && this.grip ? this.grip : this.pointer;
        math_vector/* Vector3 */.Pq.TransformNormalToRef(this._tmpVector, object.getWorldMatrix(), result.direction);
        result.direction.normalize();
        result.origin.copyFrom(object.absolutePosition);
        result.length = 1000;
    }
    /**
     * Updates the controller pose based on the given XRFrame
     * @param xrFrame xr frame to update the pose with
     * @param referenceSpace reference space to use
     * @param xrCamera the xr camera, used for parenting
     * @param xrSessionManager the session manager used to get the world reference system
     */
    updateFromXRFrame(xrFrame, referenceSpace, xrCamera, xrSessionManager) {
        const pose = xrFrame.getPose(this.inputSource.targetRaySpace, referenceSpace);
        this._lastXRPose = pose;
        // Update the pointer mesh
        if (pose) {
            const pos = pose.transform.position;
            this.pointer.position.set(pos.x, pos.y, pos.z).scaleInPlace(xrSessionManager.worldScalingFactor);
            const orientation = pose.transform.orientation;
            this.pointer.rotationQuaternion.set(orientation.x, orientation.y, orientation.z, orientation.w);
            if (!this._scene.useRightHandedSystem) {
                this.pointer.position.z *= -1;
                this.pointer.rotationQuaternion.z *= -1;
                this.pointer.rotationQuaternion.w *= -1;
            }
            this.pointer.parent = xrCamera.parent;
            this.pointer.scaling.setAll(xrSessionManager.worldScalingFactor);
        }
        // Update the grip mesh if it exists
        if (this.inputSource.gripSpace && this.grip) {
            const pose = xrFrame.getPose(this.inputSource.gripSpace, referenceSpace);
            if (pose) {
                const pos = pose.transform.position;
                const orientation = pose.transform.orientation;
                this.grip.position.set(pos.x, pos.y, pos.z).scaleInPlace(xrSessionManager.worldScalingFactor);
                this.grip.rotationQuaternion.set(orientation.x, orientation.y, orientation.z, orientation.w);
                if (!this._scene.useRightHandedSystem) {
                    this.grip.position.z *= -1;
                    this.grip.rotationQuaternion.z *= -1;
                    this.grip.rotationQuaternion.w *= -1;
                }
            }
            this.grip.parent = xrCamera.parent;
            this.grip.scaling.setAll(xrSessionManager.worldScalingFactor);
        }
        if (this.motionController) {
            // either update buttons only or also position, if in gamepad mode
            this.motionController.updateFromXRFrame(xrFrame);
        }
    }
}
//# sourceMappingURL=webXRInputSource.js.map
;// ./node_modules/@babylonjs/core/XR/webXRInput.js



/**
 * XR input used to track XR inputs such as controllers/rays
 */
class WebXRInput {
    /**
     * Initializes the WebXRInput
     * @param xrSessionManager the xr session manager for this session
     * @param xrCamera the WebXR camera for this session. Mainly used for teleportation
     * @param _options = initialization options for this xr input
     */
    constructor(
    /**
     * the xr session manager for this session
     */
    xrSessionManager, 
    /**
     * the WebXR camera for this session. Mainly used for teleportation
     */
    xrCamera, _options = {}) {
        this.xrSessionManager = xrSessionManager;
        this.xrCamera = xrCamera;
        this._options = _options;
        /**
         * XR controllers being tracked
         */
        this.controllers = [];
        /**
         * Event when a controller has been connected/added
         */
        this.onControllerAddedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Event when a controller has been removed/disconnected
         */
        this.onControllerRemovedObservable = new Misc_observable/* Observable */.cP();
        this._onInputSourcesChange = (event) => {
            this._addAndRemoveControllers(event.added, event.removed);
        };
        // Remove controllers when exiting XR
        this._sessionEndedObserver = this.xrSessionManager.onXRSessionEnded.add(() => {
            this._addAndRemoveControllers([], this.controllers.map((c) => {
                return c.inputSource;
            }));
        });
        this._sessionInitObserver = this.xrSessionManager.onXRSessionInit.add((session) => {
            session.addEventListener("inputsourceschange", this._onInputSourcesChange);
        });
        this._frameObserver = this.xrSessionManager.onXRFrameObservable.add((frame) => {
            // Update controller pose info
            this.controllers.forEach((controller) => {
                controller.updateFromXRFrame(frame, this.xrSessionManager.referenceSpace, this.xrCamera, this.xrSessionManager);
            });
        });
        if (this._options.customControllersRepositoryURL) {
            WebXRMotionControllerManager.BaseRepositoryUrl = this._options.customControllersRepositoryURL;
        }
        WebXRMotionControllerManager.UseOnlineRepository = !this._options.disableOnlineControllerRepository;
        if (WebXRMotionControllerManager.UseOnlineRepository) {
            // pre-load the profiles list to load the controllers quicker afterwards
            try {
                WebXRMotionControllerManager.UpdateProfilesList().catch(() => {
                    WebXRMotionControllerManager.UseOnlineRepository = false;
                });
            }
            catch (e) {
                WebXRMotionControllerManager.UseOnlineRepository = false;
            }
        }
    }
    _addAndRemoveControllers(addInputs, removeInputs) {
        // Add controllers if they don't already exist
        const sources = this.controllers.map((c) => {
            return c.inputSource;
        });
        for (const input of addInputs) {
            if (sources.indexOf(input) === -1) {
                const controller = new WebXRInputSource(this.xrSessionManager.scene, input, {
                    ...(this._options.controllerOptions || {}),
                    forceControllerProfile: this._options.forceInputProfile,
                    doNotLoadControllerMesh: this._options.doNotLoadControllerMeshes,
                    disableMotionControllerAnimation: this._options.disableControllerAnimation,
                });
                this.controllers.push(controller);
                this.onControllerAddedObservable.notifyObservers(controller);
            }
        }
        // Remove and dispose of controllers to be disposed
        const keepControllers = [];
        const removedControllers = [];
        this.controllers.forEach((c) => {
            if (removeInputs.indexOf(c.inputSource) === -1) {
                keepControllers.push(c);
            }
            else {
                removedControllers.push(c);
            }
        });
        this.controllers = keepControllers;
        removedControllers.forEach((c) => {
            this.onControllerRemovedObservable.notifyObservers(c);
            c.dispose();
        });
    }
    /**
     * Disposes of the object
     */
    dispose() {
        this.controllers.forEach((c) => {
            c.dispose();
        });
        this.xrSessionManager.onXRFrameObservable.remove(this._frameObserver);
        this.xrSessionManager.onXRSessionInit.remove(this._sessionInitObserver);
        this.xrSessionManager.onXRSessionEnded.remove(this._sessionEndedObserver);
        this.onControllerAddedObservable.clear();
        this.onControllerRemovedObservable.clear();
        // clear the controller cache
        WebXRMotionControllerManager.ClearControllerCache();
    }
}
//# sourceMappingURL=webXRInput.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRAbstractFeature.js


/**
 * This is the base class for all WebXR features.
 * Since most features require almost the same resources and callbacks, this class can be used to simplify the development
 * Note that since the features manager is using the `IWebXRFeature` you are in no way obligated to use this class
 */
class WebXRAbstractFeature {
    /**
     * The name of the native xr feature name (like anchor, hit-test, or hand-tracking)
     */
    get xrNativeFeatureName() {
        return this._xrNativeFeatureName;
    }
    set xrNativeFeatureName(name) {
        // check if feature was initialized while in session but needs to be initialized before the session starts
        if (!this._xrSessionManager.isNative && name && this._xrSessionManager.inXRSession && this._xrSessionManager.enabledFeatures?.indexOf(name) === -1) {
            logger/* Logger */.V.Warn(`The feature ${name} needs to be enabled before starting the XR session. Note - It is still possible it is not supported.`);
        }
        this._xrNativeFeatureName = name;
    }
    /**
     * Construct a new (abstract) WebXR feature
     * @param _xrSessionManager the xr session manager for this feature
     */
    constructor(_xrSessionManager) {
        this._xrSessionManager = _xrSessionManager;
        this._attached = false;
        this._removeOnDetach = [];
        /**
         * Is this feature disposed?
         */
        this.isDisposed = false;
        /**
         * Should auto-attach be disabled?
         */
        this.disableAutoAttach = false;
        this._xrNativeFeatureName = "";
        /**
         * Observers registered here will be executed when the feature is attached
         */
        this.onFeatureAttachObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will be executed when the feature is detached
         */
        this.onFeatureDetachObservable = new Misc_observable/* Observable */.cP();
    }
    /**
     * Is this feature attached
     */
    get attached() {
        return this._attached;
    }
    /**
     * attach this feature
     *
     * @param force should attachment be forced (even when already attached)
     * @returns true if successful, false is failed or already attached
     */
    attach(force) {
        // do not attach a disposed feature
        if (this.isDisposed) {
            return false;
        }
        if (!force) {
            if (this.attached) {
                return false;
            }
        }
        else {
            if (this.attached) {
                // detach first, to be sure
                this.detach();
            }
        }
        // if this is a native WebXR feature, check if it is enabled on the session
        // For now only check if not using babylon native
        // vision OS doesn't support the enabledFeatures array, so just warn instead of failing
        if (!this._xrSessionManager.enabledFeatures) {
            logger/* Logger */.V.Warn("session.enabledFeatures is not available on this device. It is possible that this feature is not supported.");
        }
        else if (!this._xrSessionManager.isNative && this.xrNativeFeatureName && this._xrSessionManager.enabledFeatures.indexOf(this.xrNativeFeatureName) === -1) {
            return false;
        }
        this._attached = true;
        this._addNewAttachObserver(this._xrSessionManager.onXRFrameObservable, (frame) => this._onXRFrame(frame));
        this.onFeatureAttachObservable.notifyObservers(this);
        return true;
    }
    /**
     * detach this feature.
     *
     * @returns true if successful, false if failed or already detached
     */
    detach() {
        if (!this._attached) {
            this.disableAutoAttach = true;
            return false;
        }
        this._attached = false;
        this._removeOnDetach.forEach((toRemove) => {
            toRemove.observable.remove(toRemove.observer);
        });
        this.onFeatureDetachObservable.notifyObservers(this);
        return true;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        this.detach();
        this.isDisposed = true;
        this.onFeatureAttachObservable.clear();
        this.onFeatureDetachObservable.clear();
    }
    /**
     * This function will be executed during before enabling the feature and can be used to not-allow enabling it.
     * Note that at this point the session has NOT started, so this is purely checking if the browser supports it
     *
     * @returns whether or not the feature is compatible in this environment
     */
    isCompatible() {
        return true;
    }
    /**
     * This is used to register callbacks that will automatically be removed when detach is called.
     * @param observable the observable to which the observer will be attached
     * @param callback the callback to register
     * @param insertFirst should the callback be executed as soon as it is registered
     */
    _addNewAttachObserver(observable, callback, insertFirst) {
        this._removeOnDetach.push({
            observable,
            observer: observable.add(callback, undefined, insertFirst),
        });
    }
}
//# sourceMappingURL=WebXRAbstractFeature.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRControllerPointerSelection.js













/**
 * A module that will enable pointer selection for motion controllers of XR Input Sources
 */
class WebXRControllerPointerSelection extends WebXRAbstractFeature {
    /**
     * constructs a new background remover module
     * @param _xrSessionManager the session manager for this module
     * @param _options read-only options to be used in this module
     */
    constructor(_xrSessionManager, _options) {
        super(_xrSessionManager);
        this._options = _options;
        this._attachController = (xrController) => {
            if (this._controllers[xrController.uniqueId]) {
                // already attached
                return;
            }
            const { laserPointer, selectionMesh } = this._generateNewMeshPair(this._options.forceGripIfAvailable && xrController.grip ? xrController.grip : xrController.pointer);
            // get two new meshes
            this._controllers[xrController.uniqueId] = {
                xrController,
                laserPointer,
                selectionMesh,
                meshUnderPointer: null,
                pick: null,
                tmpRay: new Culling_ray/* Ray */.Rl(new math_vector/* Vector3 */.Pq(), new math_vector/* Vector3 */.Pq()),
                disabledByNearInteraction: false,
                id: WebXRControllerPointerSelection._IdCounter++,
            };
            if (this._attachedController) {
                if (!this._options.enablePointerSelectionOnAllControllers &&
                    this._options.preferredHandedness &&
                    xrController.inputSource.handedness === this._options.preferredHandedness) {
                    this._attachedController = xrController.uniqueId;
                }
            }
            else {
                if (!this._options.enablePointerSelectionOnAllControllers) {
                    this._attachedController = xrController.uniqueId;
                }
            }
            switch (xrController.inputSource.targetRayMode) {
                case "tracked-pointer":
                    return this._attachTrackedPointerRayMode(xrController);
                case "gaze":
                    return this._attachGazeMode(xrController);
                case "screen":
                case "transient-pointer":
                    return this._attachScreenRayMode(xrController);
            }
        };
        this._controllers = {};
        this._tmpVectorForPickCompare = new math_vector/* Vector3 */.Pq();
        /**
         * Disable lighting on the laser pointer (so it will always be visible)
         */
        this.disablePointerLighting = true;
        /**
         * Disable lighting on the selection mesh (so it will always be visible)
         */
        this.disableSelectionMeshLighting = true;
        /**
         * Should the laser pointer be displayed
         */
        this.displayLaserPointer = true;
        /**
         * Should the selection mesh be displayed (The ring at the end of the laser pointer)
         */
        this.displaySelectionMesh = true;
        /**
         * This color will be set to the laser pointer when selection is triggered
         */
        this.laserPointerPickedColor = new math_color/* Color3 */.v9(0.9, 0.9, 0.9);
        /**
         * Default color of the laser pointer
         */
        this.laserPointerDefaultColor = new math_color/* Color3 */.v9(0.7, 0.7, 0.7);
        /**
         * default color of the selection ring
         */
        this.selectionMeshDefaultColor = new math_color/* Color3 */.v9(0.8, 0.8, 0.8);
        /**
         * This color will be applied to the selection ring when selection is triggered
         */
        this.selectionMeshPickedColor = new math_color/* Color3 */.v9(0.3, 0.3, 1.0);
        this._identityMatrix = math_vector/* Matrix */.uq.Identity();
        this._screenCoordinatesRef = math_vector/* Vector3 */.Pq.Zero();
        this._viewportRef = new math_viewport/* Viewport */.L(0, 0, 0, 0);
        this._scene = this._xrSessionManager.scene;
        // force look and pick mode if using WebXR on safari, assuming it is vision OS
        // Only if not explicitly set. If set to false, it will not be forced
        if (this._options.lookAndPickMode === undefined && (this._scene.getEngine()._badDesktopOS || this._scene.getEngine()._badOS)) {
            this._options.lookAndPickMode = true;
        }
        // look and pick mode extra state changes
        if (this._options.lookAndPickMode) {
            this._options.enablePointerSelectionOnAllControllers = true;
            this.displayLaserPointer = false;
        }
    }
    /**
     * attach this feature
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        this._options.xrInput.controllers.forEach(this._attachController);
        this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController, true);
        this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (controller) => {
            // REMOVE the controller
            this._detachController(controller.uniqueId);
        }, true);
        this._scene.constantlyUpdateMeshUnderPointer = true;
        if (this._options.gazeCamera) {
            const webXRCamera = this._options.gazeCamera;
            const { laserPointer, selectionMesh } = this._generateNewMeshPair(webXRCamera);
            this._controllers["camera"] = {
                webXRCamera,
                laserPointer,
                selectionMesh,
                meshUnderPointer: null,
                pick: null,
                tmpRay: new Culling_ray/* Ray */.Rl(new math_vector/* Vector3 */.Pq(), new math_vector/* Vector3 */.Pq()),
                disabledByNearInteraction: false,
                id: WebXRControllerPointerSelection._IdCounter++,
            };
            this._attachGazeMode();
        }
        return true;
    }
    /**
     * detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        Object.keys(this._controllers).forEach((controllerId) => {
            this._detachController(controllerId);
        });
        return true;
    }
    /**
     * Will get the mesh under a specific pointer.
     * `scene.meshUnderPointer` will only return one mesh - either left or right.
     * @param controllerId the controllerId to check
     * @returns The mesh under pointer or null if no mesh is under the pointer
     */
    getMeshUnderPointer(controllerId) {
        if (this._controllers[controllerId]) {
            return this._controllers[controllerId].meshUnderPointer;
        }
        else {
            return null;
        }
    }
    /**
     * Get the xr controller that correlates to the pointer id in the pointer event
     *
     * @param id the pointer id to search for
     * @returns the controller that correlates to this id or null if not found
     */
    getXRControllerByPointerId(id) {
        const keys = Object.keys(this._controllers);
        for (let i = 0; i < keys.length; ++i) {
            if (this._controllers[keys[i]].id === id) {
                return this._controllers[keys[i]].xrController || null;
            }
        }
        return null;
    }
    /**
     * @internal
     */
    _getPointerSelectionDisabledByPointerId(id) {
        const keys = Object.keys(this._controllers);
        for (let i = 0; i < keys.length; ++i) {
            if (this._controllers[keys[i]].id === id) {
                return this._controllers[keys[i]].disabledByNearInteraction;
            }
        }
        return true;
    }
    /**
     * @internal
     */
    _setPointerSelectionDisabledByPointerId(id, state) {
        const keys = Object.keys(this._controllers);
        for (let i = 0; i < keys.length; ++i) {
            if (this._controllers[keys[i]].id === id) {
                this._controllers[keys[i]].disabledByNearInteraction = state;
                return;
            }
        }
    }
    _onXRFrame(_xrFrame) {
        Object.keys(this._controllers).forEach((id) => {
            // look and pick mode
            // only do this for the selected pointer
            const controllerData = this._controllers[id];
            if (this._options.lookAndPickMode && controllerData.xrController?.inputSource.targetRayMode !== "transient-pointer") {
                return;
            }
            if ((!this._options.enablePointerSelectionOnAllControllers && id !== this._attachedController) || controllerData.disabledByNearInteraction) {
                controllerData.selectionMesh.isVisible = false;
                controllerData.laserPointer.isVisible = false;
                controllerData.pick = null;
                return;
            }
            controllerData.laserPointer.isVisible = this.displayLaserPointer;
            let controllerGlobalPosition;
            // Every frame check collisions/input
            if (controllerData.xrController) {
                controllerGlobalPosition =
                    this._options.forceGripIfAvailable && controllerData.xrController.grip
                        ? controllerData.xrController.grip.position
                        : controllerData.xrController.pointer.position;
                controllerData.xrController.getWorldPointerRayToRef(controllerData.tmpRay, this._options.forceGripIfAvailable);
            }
            else if (controllerData.webXRCamera) {
                controllerGlobalPosition = controllerData.webXRCamera.position;
                controllerData.webXRCamera.getForwardRayToRef(controllerData.tmpRay);
            }
            else {
                return;
            }
            if (this._options.maxPointerDistance) {
                controllerData.tmpRay.length = this._options.maxPointerDistance;
            }
            // update pointerX and pointerY of the scene. Only if the flag is set to true!
            if (!this._options.disableScenePointerVectorUpdate && controllerGlobalPosition) {
                const scene = this._xrSessionManager.scene;
                const camera = this._options.xrInput.xrCamera;
                if (camera) {
                    camera.viewport.toGlobalToRef(scene.getEngine().getRenderWidth() / camera.rigCameras.length, scene.getEngine().getRenderHeight(), this._viewportRef);
                    math_vector/* Vector3 */.Pq.ProjectToRef(controllerGlobalPosition, this._identityMatrix, camera.getTransformationMatrix(), this._viewportRef, this._screenCoordinatesRef);
                    // stay safe
                    if (typeof this._screenCoordinatesRef.x === "number" &&
                        typeof this._screenCoordinatesRef.y === "number" &&
                        !isNaN(this._screenCoordinatesRef.x) &&
                        !isNaN(this._screenCoordinatesRef.y) &&
                        this._screenCoordinatesRef.x !== Infinity &&
                        this._screenCoordinatesRef.y !== Infinity) {
                        scene.pointerX = this._screenCoordinatesRef.x;
                        scene.pointerY = this._screenCoordinatesRef.y;
                        controllerData.screenCoordinates = {
                            x: this._screenCoordinatesRef.x,
                            y: this._screenCoordinatesRef.y,
                        };
                    }
                }
            }
            let utilityScenePick = null;
            if (this._utilityLayerScene) {
                utilityScenePick = this._utilityLayerScene.pickWithRay(controllerData.tmpRay, this._utilityLayerScene.pointerMovePredicate || this.raySelectionPredicate);
            }
            const originalScenePick = this._scene.pickWithRay(controllerData.tmpRay, this._scene.pointerMovePredicate || this.raySelectionPredicate);
            if (!utilityScenePick || !utilityScenePick.hit) {
                // No hit in utility scene
                controllerData.pick = originalScenePick;
            }
            else if (!originalScenePick || !originalScenePick.hit) {
                // No hit in original scene
                controllerData.pick = utilityScenePick;
            }
            else if (utilityScenePick.distance < originalScenePick.distance) {
                // Hit is closer in utility scene
                controllerData.pick = utilityScenePick;
            }
            else {
                // Hit is closer in original scene
                controllerData.pick = originalScenePick;
            }
            if (controllerData.pick && controllerData.xrController) {
                controllerData.pick.aimTransform = controllerData.xrController.pointer;
                controllerData.pick.gripTransform = controllerData.xrController.grip || null;
                controllerData.pick.originMesh = controllerData.xrController.pointer;
            }
            const pick = controllerData.pick;
            if (pick && pick.pickedPoint && pick.hit) {
                // Update laser state
                this._updatePointerDistance(controllerData.laserPointer, pick.distance);
                // Update cursor state
                controllerData.selectionMesh.position.copyFrom(pick.pickedPoint);
                controllerData.selectionMesh.scaling.x = Math.sqrt(pick.distance);
                controllerData.selectionMesh.scaling.y = Math.sqrt(pick.distance);
                controllerData.selectionMesh.scaling.z = Math.sqrt(pick.distance);
                // To avoid z-fighting
                const pickNormal = this._convertNormalToDirectionOfRay(pick.getNormal(true), controllerData.tmpRay);
                const deltaFighting = 0.001;
                controllerData.selectionMesh.position.copyFrom(pick.pickedPoint);
                if (pickNormal) {
                    const axis1 = math_vector/* Vector3 */.Pq.Cross(math_axis/* Axis */._0.Y, pickNormal);
                    const axis2 = math_vector/* Vector3 */.Pq.Cross(pickNormal, axis1);
                    math_vector/* Vector3 */.Pq.RotationFromAxisToRef(axis2, pickNormal, axis1, controllerData.selectionMesh.rotation);
                    controllerData.selectionMesh.position.addInPlace(pickNormal.scale(deltaFighting));
                }
                controllerData.selectionMesh.isVisible = this.displaySelectionMesh;
                controllerData.meshUnderPointer = pick.pickedMesh;
            }
            else {
                controllerData.selectionMesh.isVisible = false;
                this._updatePointerDistance(controllerData.laserPointer, 1);
                controllerData.meshUnderPointer = null;
            }
        });
    }
    get _utilityLayerScene() {
        return this._options.customUtilityLayerScene || utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer.utilityLayerScene;
    }
    _attachGazeMode(xrController) {
        const controllerData = this._controllers[(xrController && xrController.uniqueId) || "camera"];
        // attached when touched, detaches when raised
        const timeToSelect = this._options.timeToSelect || 3000;
        const sceneToRenderTo = this._options.useUtilityLayer ? this._utilityLayerScene : this._scene;
        let oldPick = new Collisions_pickingInfo/* PickingInfo */.G();
        const discMesh = CreateTorus("selection", {
            diameter: 0.0035 * 15,
            thickness: 0.0025 * 6,
            tessellation: 20,
        }, sceneToRenderTo);
        discMesh.isVisible = false;
        discMesh.isPickable = false;
        discMesh.parent = controllerData.selectionMesh;
        let timer = 0;
        let downTriggered = false;
        const pointerEventInit = {
            pointerId: controllerData.id,
            pointerType: "xr",
        };
        controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {
            if (!controllerData.pick) {
                return;
            }
            this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates);
            controllerData.laserPointer.material.alpha = 0;
            discMesh.isVisible = false;
            if (controllerData.pick.hit) {
                if (!this._pickingMoved(oldPick, controllerData.pick)) {
                    if (timer > timeToSelect / 10) {
                        discMesh.isVisible = true;
                    }
                    timer += this._scene.getEngine().getDeltaTime();
                    if (timer >= timeToSelect) {
                        this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
                        // this pointerdown event is not setting the controllerData.pointerDownTriggered to avoid a pointerUp event when this feature is detached
                        downTriggered = true;
                        // pointer up right after down, if disable on touch out
                        if (this._options.disablePointerUpOnTouchOut) {
                            this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
                        }
                        discMesh.isVisible = false;
                    }
                    else {
                        const scaleFactor = 1 - timer / timeToSelect;
                        discMesh.scaling.set(scaleFactor, scaleFactor, scaleFactor);
                    }
                }
                else {
                    if (downTriggered) {
                        if (!this._options.disablePointerUpOnTouchOut) {
                            this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
                        }
                    }
                    downTriggered = false;
                    timer = 0;
                }
            }
            else {
                downTriggered = false;
                timer = 0;
            }
            this._scene.simulatePointerMove(controllerData.pick, pointerEventInit);
            oldPick = controllerData.pick;
        });
        if (this._options.renderingGroupId !== undefined) {
            discMesh.renderingGroupId = this._options.renderingGroupId;
        }
        if (xrController) {
            xrController.onDisposeObservable.addOnce(() => {
                if (controllerData.pick && !this._options.disablePointerUpOnTouchOut && downTriggered) {
                    this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
                    controllerData.finalPointerUpTriggered = true;
                }
                discMesh.dispose();
            });
        }
    }
    _attachScreenRayMode(xrController) {
        const controllerData = this._controllers[xrController.uniqueId];
        let downTriggered = false;
        const pointerEventInit = {
            pointerId: controllerData.id,
            pointerType: "xr",
        };
        controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {
            this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates);
            if (!controllerData.pick || (this._options.disablePointerUpOnTouchOut && downTriggered)) {
                return;
            }
            if (!downTriggered) {
                this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
                controllerData.pointerDownTriggered = true;
                downTriggered = true;
                if (this._options.disablePointerUpOnTouchOut) {
                    this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
                }
            }
            else {
                this._scene.simulatePointerMove(controllerData.pick, pointerEventInit);
            }
        });
        xrController.onDisposeObservable.addOnce(() => {
            this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates);
            this._xrSessionManager.runInXRFrame(() => {
                if (controllerData.pick && !controllerData.finalPointerUpTriggered && downTriggered && !this._options.disablePointerUpOnTouchOut) {
                    this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
                    controllerData.finalPointerUpTriggered = true;
                }
            });
        });
    }
    _attachTrackedPointerRayMode(xrController) {
        const controllerData = this._controllers[xrController.uniqueId];
        if (this._options.forceGazeMode) {
            return this._attachGazeMode(xrController);
        }
        const pointerEventInit = {
            pointerId: controllerData.id,
            pointerType: "xr",
        };
        controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {
            controllerData.laserPointer.material.disableLighting = this.disablePointerLighting;
            controllerData.selectionMesh.material.disableLighting = this.disableSelectionMeshLighting;
            if (controllerData.pick) {
                this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates);
                this._scene.simulatePointerMove(controllerData.pick, pointerEventInit);
            }
        });
        if (xrController.inputSource.gamepad) {
            const init = (motionController) => {
                if (this._options.overrideButtonId) {
                    controllerData.selectionComponent = motionController.getComponent(this._options.overrideButtonId);
                }
                if (!controllerData.selectionComponent) {
                    controllerData.selectionComponent = motionController.getMainComponent();
                }
                controllerData.onButtonChangedObserver = controllerData.selectionComponent.onButtonStateChangedObservable.add((component) => {
                    if (component.changes.pressed) {
                        const pressed = component.changes.pressed.current;
                        if (controllerData.pick) {
                            if (this._options.enablePointerSelectionOnAllControllers || xrController.uniqueId === this._attachedController) {
                                this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates);
                                if (pressed) {
                                    this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
                                    controllerData.pointerDownTriggered = true;
                                    controllerData.selectionMesh.material.emissiveColor = this.selectionMeshPickedColor;
                                    controllerData.laserPointer.material.emissiveColor = this.laserPointerPickedColor;
                                }
                                else {
                                    this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
                                    controllerData.selectionMesh.material.emissiveColor = this.selectionMeshDefaultColor;
                                    controllerData.laserPointer.material.emissiveColor = this.laserPointerDefaultColor;
                                }
                            }
                        }
                        else {
                            if (pressed && !this._options.enablePointerSelectionOnAllControllers && !this._options.disableSwitchOnClick) {
                                // force a pointer up if switching controllers
                                // get the controller that was attached before
                                const prevController = this._controllers[this._attachedController];
                                if (prevController && prevController.pointerDownTriggered && !prevController.finalPointerUpTriggered) {
                                    this._augmentPointerInit(pointerEventInit, prevController.id, prevController.screenCoordinates);
                                    this._scene.simulatePointerUp(new Collisions_pickingInfo/* PickingInfo */.G(), {
                                        pointerId: prevController.id,
                                        pointerType: "xr",
                                    });
                                    prevController.finalPointerUpTriggered = true;
                                }
                                this._attachedController = xrController.uniqueId;
                            }
                        }
                    }
                });
            };
            if (xrController.motionController) {
                init(xrController.motionController);
            }
            else {
                xrController.onMotionControllerInitObservable.add(init);
            }
        }
        else {
            // use the select and squeeze events
            const selectStartListener = (event) => {
                this._xrSessionManager.onXRFrameObservable.addOnce(() => {
                    this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates);
                    if (controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick) {
                        this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
                        controllerData.pointerDownTriggered = true;
                        controllerData.selectionMesh.material.emissiveColor = this.selectionMeshPickedColor;
                        controllerData.laserPointer.material.emissiveColor = this.laserPointerPickedColor;
                    }
                });
            };
            const selectEndListener = (event) => {
                this._xrSessionManager.onXRFrameObservable.addOnce(() => {
                    this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates);
                    if (controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick) {
                        this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
                        controllerData.selectionMesh.material.emissiveColor = this.selectionMeshDefaultColor;
                        controllerData.laserPointer.material.emissiveColor = this.laserPointerDefaultColor;
                    }
                });
            };
            controllerData.eventListeners = {
                selectend: selectEndListener,
                selectstart: selectStartListener,
            };
            this._xrSessionManager.session.addEventListener("selectstart", selectStartListener);
            this._xrSessionManager.session.addEventListener("selectend", selectEndListener);
        }
    }
    _convertNormalToDirectionOfRay(normal, ray) {
        if (normal) {
            const angle = Math.acos(math_vector/* Vector3 */.Pq.Dot(normal, ray.direction));
            if (angle < Math.PI / 2) {
                normal.scaleInPlace(-1);
            }
        }
        return normal;
    }
    _detachController(xrControllerUniqueId) {
        const controllerData = this._controllers[xrControllerUniqueId];
        if (!controllerData) {
            return;
        }
        if (controllerData.selectionComponent) {
            if (controllerData.onButtonChangedObserver) {
                controllerData.selectionComponent.onButtonStateChangedObservable.remove(controllerData.onButtonChangedObserver);
            }
        }
        if (controllerData.onFrameObserver) {
            this._xrSessionManager.onXRFrameObservable.remove(controllerData.onFrameObserver);
        }
        if (controllerData.eventListeners) {
            Object.keys(controllerData.eventListeners).forEach((eventName) => {
                const func = controllerData.eventListeners && controllerData.eventListeners[eventName];
                if (func) {
                    // For future reference - this is an issue in the WebXR typings.
                    this._xrSessionManager.session.removeEventListener(eventName, func);
                }
            });
        }
        if (!controllerData.finalPointerUpTriggered && controllerData.pointerDownTriggered) {
            // Stay safe and fire a pointerup, in case it wasn't already triggered
            const pointerEventInit = {
                pointerId: controllerData.id,
                pointerType: "xr",
            };
            this._xrSessionManager.runInXRFrame(() => {
                this._augmentPointerInit(pointerEventInit, controllerData.id, controllerData.screenCoordinates);
                this._scene.simulatePointerUp(controllerData.pick || new Collisions_pickingInfo/* PickingInfo */.G(), pointerEventInit);
                controllerData.finalPointerUpTriggered = true;
            });
        }
        this._xrSessionManager.scene.onBeforeRenderObservable.addOnce(() => {
            try {
                controllerData.selectionMesh.dispose();
                controllerData.laserPointer.dispose();
                // remove from the map
                delete this._controllers[xrControllerUniqueId];
                if (this._attachedController === xrControllerUniqueId) {
                    // check for other controllers
                    const keys = Object.keys(this._controllers);
                    if (keys.length) {
                        this._attachedController = keys[0];
                    }
                    else {
                        this._attachedController = "";
                    }
                }
            }
            catch (e) {
                tools/* Tools */.S0.Warn("controller already detached.");
            }
        });
    }
    _generateNewMeshPair(meshParent) {
        const sceneToRenderTo = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer.utilityLayerScene : this._scene;
        const laserPointer = this._options.customLasterPointerMeshGenerator
            ? this._options.customLasterPointerMeshGenerator()
            : CreateCylinder("laserPointer", {
                height: 1,
                diameterTop: 0.0002,
                diameterBottom: 0.004,
                tessellation: 20,
                subdivisions: 1,
            }, sceneToRenderTo);
        laserPointer.parent = meshParent;
        const laserPointerMaterial = new standardMaterial/* StandardMaterial */.F("laserPointerMat", sceneToRenderTo);
        laserPointerMaterial.emissiveColor = this.laserPointerDefaultColor;
        laserPointerMaterial.alpha = 0.7;
        laserPointer.material = laserPointerMaterial;
        laserPointer.rotation.x = Math.PI / 2;
        this._updatePointerDistance(laserPointer, 1);
        laserPointer.isPickable = false;
        laserPointer.isVisible = false;
        // Create a gaze tracker for the  XR controller
        const selectionMesh = this._options.customSelectionMeshGenerator
            ? this._options.customSelectionMeshGenerator()
            : CreateTorus("gazeTracker", {
                diameter: 0.0035 * 3,
                thickness: 0.0025 * 3,
                tessellation: 20,
            }, sceneToRenderTo);
        selectionMesh.bakeCurrentTransformIntoVertices();
        selectionMesh.isPickable = false;
        selectionMesh.isVisible = false;
        const targetMat = new standardMaterial/* StandardMaterial */.F("targetMat", sceneToRenderTo);
        targetMat.specularColor = math_color/* Color3 */.v9.Black();
        targetMat.emissiveColor = this.selectionMeshDefaultColor;
        targetMat.backFaceCulling = false;
        selectionMesh.material = targetMat;
        if (this._options.renderingGroupId !== undefined) {
            laserPointer.renderingGroupId = this._options.renderingGroupId;
            selectionMesh.renderingGroupId = this._options.renderingGroupId;
        }
        return {
            laserPointer,
            selectionMesh,
        };
    }
    _pickingMoved(oldPick, newPick) {
        if (!oldPick.hit || !newPick.hit) {
            return true;
        }
        if (!oldPick.pickedMesh || !oldPick.pickedPoint || !newPick.pickedMesh || !newPick.pickedPoint) {
            return true;
        }
        if (oldPick.pickedMesh !== newPick.pickedMesh) {
            return true;
        }
        oldPick.pickedPoint?.subtractToRef(newPick.pickedPoint, this._tmpVectorForPickCompare);
        this._tmpVectorForPickCompare.set(Math.abs(this._tmpVectorForPickCompare.x), Math.abs(this._tmpVectorForPickCompare.y), Math.abs(this._tmpVectorForPickCompare.z));
        const delta = (this._options.gazeModePointerMovedFactor || 1) * 0.01 * newPick.distance;
        const length = this._tmpVectorForPickCompare.length();
        if (length > delta) {
            return true;
        }
        return false;
    }
    _updatePointerDistance(_laserPointer, distance = 100) {
        _laserPointer.scaling.y = distance;
        // a bit of distance from the controller
        if (this._scene.useRightHandedSystem) {
            distance *= -1;
        }
        _laserPointer.position.z = distance / 2 + 0.05;
    }
    _augmentPointerInit(pointerEventInit, id, screenCoordinates) {
        pointerEventInit.pointerId = id;
        pointerEventInit.pointerType = "xr";
        if (screenCoordinates) {
            pointerEventInit.screenX = screenCoordinates.x;
            pointerEventInit.screenY = screenCoordinates.y;
        }
    }
    /** @internal */
    get lasterPointerDefaultColor() {
        // here due to a typo
        return this.laserPointerDefaultColor;
    }
}
WebXRControllerPointerSelection._IdCounter = 200;
/**
 * The module's name
 */
WebXRControllerPointerSelection.Name = webXRFeaturesManager/* WebXRFeatureName */._.POINTER_SELECTION;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRControllerPointerSelection.Version = 1;
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRControllerPointerSelection.Name, (xrSessionManager, options) => {
    return () => new WebXRControllerPointerSelection(xrSessionManager, options);
}, WebXRControllerPointerSelection.Version, true);
//# sourceMappingURL=WebXRControllerPointerSelection.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.js
/**
 * Defines the kind of connection point for node based material
 */
var NodeMaterialBlockConnectionPointTypes;
(function (NodeMaterialBlockConnectionPointTypes) {
    /** Float */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["Float"] = 1] = "Float";
    /** Int */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["Int"] = 2] = "Int";
    /** Vector2 */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["Vector2"] = 4] = "Vector2";
    /** Vector3 */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["Vector3"] = 8] = "Vector3";
    /** Vector4 */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["Vector4"] = 16] = "Vector4";
    /** Color3 */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["Color3"] = 32] = "Color3";
    /** Color4 */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["Color4"] = 64] = "Color4";
    /** Matrix */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["Matrix"] = 128] = "Matrix";
    /** Custom object */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["Object"] = 256] = "Object";
    /** Detect type based on connection */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["AutoDetect"] = 1024] = "AutoDetect";
    /** Output type that will be defined by input type */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["BasedOnInput"] = 2048] = "BasedOnInput";
    /** Bitmask of all types */
    NodeMaterialBlockConnectionPointTypes[NodeMaterialBlockConnectionPointTypes["All"] = 4095] = "All";
})(NodeMaterialBlockConnectionPointTypes || (NodeMaterialBlockConnectionPointTypes = {}));
//# sourceMappingURL=nodeMaterialBlockConnectionPointTypes.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockTargets.js
/**
 * Enum used to define the target of a block
 */
var NodeMaterialBlockTargets;
(function (NodeMaterialBlockTargets) {
    /** Vertex shader */
    NodeMaterialBlockTargets[NodeMaterialBlockTargets["Vertex"] = 1] = "Vertex";
    /** Fragment shader */
    NodeMaterialBlockTargets[NodeMaterialBlockTargets["Fragment"] = 2] = "Fragment";
    /** Neutral */
    NodeMaterialBlockTargets[NodeMaterialBlockTargets["Neutral"] = 4] = "Neutral";
    /** Vertex and Fragment */
    NodeMaterialBlockTargets[NodeMaterialBlockTargets["VertexAndFragment"] = 3] = "VertexAndFragment";
})(NodeMaterialBlockTargets || (NodeMaterialBlockTargets = {}));
//# sourceMappingURL=nodeMaterialBlockTargets.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialBuildState.js




/**
 * Class used to store node based material build state
 */
class NodeMaterialBuildState {
    constructor() {
        /** Gets or sets a boolean indicating if the current state can emit uniform buffers */
        this.supportUniformBuffers = false;
        /**
         * Gets the list of emitted attributes
         */
        this.attributes = [];
        /**
         * Gets the list of emitted uniforms
         */
        this.uniforms = [];
        /**
         * Gets the list of emitted constants
         */
        this.constants = [];
        /**
         * Gets the list of emitted samplers
         */
        this.samplers = [];
        /**
         * Gets the list of emitted functions
         */
        this.functions = {};
        /**
         * Gets the list of emitted extensions
         */
        this.extensions = {};
        /**
         * Gets the list of emitted prePass outputs - if using the prepass
         */
        this.prePassOutput = {};
        /**
         * Gets the list of emitted counters
         */
        this.counters = {};
        /** @internal */
        this._terminalBlocks = new Set();
        /** @internal */
        this._attributeDeclaration = "";
        /** @internal */
        this._uniformDeclaration = "";
        /** @internal */
        this._constantDeclaration = "";
        /** @internal */
        this._samplerDeclaration = "";
        /** @internal */
        this._varyingTransfer = "";
        /** @internal */
        this._injectAtEnd = "";
        this._repeatableContentAnchorIndex = 0;
        /** @internal */
        this._builtCompilationString = "";
        /**
         * Gets the emitted compilation strings
         */
        this.compilationString = "";
    }
    /**
     * Gets the current shader language to use
     */
    get shaderLanguage() {
        return this.sharedData.nodeMaterial.shaderLanguage;
    }
    /** Gets suffix to add behind type casting */
    get fSuffix() {
        return this.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "f" : "";
    }
    /**
     * Finalize the compilation strings
     * @param state defines the current compilation state
     */
    finalize(state) {
        const emitComments = state.sharedData.emitComments;
        const isFragmentMode = this.target === NodeMaterialBlockTargets.Fragment;
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            if (isFragmentMode) {
                this.compilationString = `\n${emitComments ? "//Entry point\n" : ""}@fragment\nfn main(input: FragmentInputs) -> FragmentOutputs {\n${this.compilationString}`;
            }
            else {
                this.compilationString = `\n${emitComments ? "//Entry point\n" : ""}@vertex\nfn main(input: VertexInputs) -> FragmentInputs{\n${this.compilationString}`;
            }
        }
        else {
            this.compilationString = `\n${emitComments ? "//Entry point\n" : ""}void main(void) {\n${this.compilationString}`;
        }
        if (this._constantDeclaration) {
            this.compilationString = `\n${emitComments ? "//Constants\n" : ""}${this._constantDeclaration}\n${this.compilationString}`;
        }
        let functionCode = "";
        for (const functionName in this.functions) {
            functionCode += this.functions[functionName] + `\n`;
        }
        this.compilationString = `\n${functionCode}\n${this.compilationString}`;
        if (!isFragmentMode && this._varyingTransfer) {
            this.compilationString = `${this.compilationString}\n${this._varyingTransfer}`;
        }
        if (this._injectAtEnd) {
            this.compilationString = `${this.compilationString}\n${this._injectAtEnd}`;
        }
        this.compilationString = `${this.compilationString}\n}`;
        if (this.sharedData.varyingDeclaration) {
            this.compilationString = `\n${emitComments ? "//Varyings\n" : ""}${this.sharedData.varyingDeclaration}\n${this.compilationString}`;
        }
        if (this._samplerDeclaration) {
            this.compilationString = `\n${emitComments ? "//Samplers\n" : ""}${this._samplerDeclaration}\n${this.compilationString}`;
        }
        if (this._uniformDeclaration) {
            this.compilationString = `\n${emitComments ? "//Uniforms\n" : ""}${this._uniformDeclaration}\n${this.compilationString}`;
        }
        if (this._attributeDeclaration && !isFragmentMode) {
            this.compilationString = `\n${emitComments ? "//Attributes\n" : ""}${this._attributeDeclaration}\n${this.compilationString}`;
        }
        if (this.shaderLanguage !== 1 /* ShaderLanguage.WGSL */) {
            this.compilationString = "precision highp float;\n" + this.compilationString;
            this.compilationString = "#if defined(WEBGL2) || defined(WEBGPU)\nprecision highp sampler2DArray;\n#endif\n" + this.compilationString;
            if (isFragmentMode) {
                this.compilationString =
                    "#if defined(PREPASS)\r\n#extension GL_EXT_draw_buffers : require\r\nlayout(location = 0) out highp vec4 glFragData[SCENE_MRT_COUNT];\r\nhighp vec4 gl_FragColor;\r\n#endif\r\n" +
                        this.compilationString;
            }
            for (const extensionName in this.extensions) {
                const extension = this.extensions[extensionName];
                this.compilationString = `\n${extension}\n${this.compilationString}`;
            }
        }
        this._builtCompilationString = this.compilationString;
    }
    /** @internal */
    get _repeatableContentAnchor() {
        return `###___ANCHOR${this._repeatableContentAnchorIndex++}___###`;
    }
    /**
     * @internal
     */
    _getFreeVariableName(prefix) {
        prefix = prefix.replace(/[^a-zA-Z_]+/g, "");
        if (this.sharedData.variableNames[prefix] === undefined) {
            this.sharedData.variableNames[prefix] = 0;
            // Check reserved words
            if (prefix === "output" || prefix === "texture") {
                return prefix + this.sharedData.variableNames[prefix];
            }
            return prefix;
        }
        else {
            this.sharedData.variableNames[prefix]++;
        }
        return prefix + this.sharedData.variableNames[prefix];
    }
    /**
     * @internal
     */
    _getFreeDefineName(prefix) {
        if (this.sharedData.defineNames[prefix] === undefined) {
            this.sharedData.defineNames[prefix] = 0;
        }
        else {
            this.sharedData.defineNames[prefix]++;
        }
        return prefix + this.sharedData.defineNames[prefix];
    }
    /**
     * @internal
     */
    _excludeVariableName(name) {
        this.sharedData.variableNames[name] = 0;
    }
    /**
     * @internal
     */
    _emit2DSampler(name, define = "", force = false) {
        if (this.samplers.indexOf(name) < 0 || force) {
            if (define) {
                this._samplerDeclaration += `#if ${define}\n`;
            }
            if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                this._samplerDeclaration += `var ${name + `Sampler`}: sampler;\n`;
                this._samplerDeclaration += `var ${name}: texture_2d<f32>;\n`;
            }
            else {
                this._samplerDeclaration += `uniform sampler2D ${name};\n`;
            }
            if (define) {
                this._samplerDeclaration += `#endif\n`;
            }
            if (!force) {
                this.samplers.push(name);
            }
        }
    }
    /**
     * @internal
     */
    _emitCubeSampler(name, define = "", force = false) {
        if (this.samplers.indexOf(name) < 0 || force) {
            if (define) {
                this._samplerDeclaration += `#if ${define}\n`;
            }
            if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                this._samplerDeclaration += `var ${name + `Sampler`}: sampler;\n`;
                this._samplerDeclaration += `var ${name}: texture_cube<f32>;\n`;
            }
            else {
                this._samplerDeclaration += `uniform samplerCube ${name};\n`;
            }
            if (define) {
                this._samplerDeclaration += `#endif\n`;
            }
            if (!force) {
                this.samplers.push(name);
            }
        }
    }
    /**
     * @internal
     */
    _emit2DArraySampler(name) {
        if (this.samplers.indexOf(name) < 0) {
            this._samplerDeclaration += `uniform sampler2DArray ${name};\n`;
            this.samplers.push(name);
        }
    }
    /**
     * @internal
     */
    _getGLType(type) {
        switch (type) {
            case NodeMaterialBlockConnectionPointTypes.Float:
                return "float";
            case NodeMaterialBlockConnectionPointTypes.Int:
                return "int";
            case NodeMaterialBlockConnectionPointTypes.Vector2:
                return "vec2";
            case NodeMaterialBlockConnectionPointTypes.Color3:
            case NodeMaterialBlockConnectionPointTypes.Vector3:
                return "vec3";
            case NodeMaterialBlockConnectionPointTypes.Color4:
            case NodeMaterialBlockConnectionPointTypes.Vector4:
                return "vec4";
            case NodeMaterialBlockConnectionPointTypes.Matrix:
                return "mat4";
        }
        return "";
    }
    /**
     * @internal
     */
    _getShaderType(type) {
        const isWGSL = this.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        switch (type) {
            case NodeMaterialBlockConnectionPointTypes.Float:
                return isWGSL ? "f32" : "float";
            case NodeMaterialBlockConnectionPointTypes.Int:
                return isWGSL ? "i32" : "int";
            case NodeMaterialBlockConnectionPointTypes.Vector2:
                return isWGSL ? "vec2f" : "vec2";
            case NodeMaterialBlockConnectionPointTypes.Color3:
            case NodeMaterialBlockConnectionPointTypes.Vector3:
                return isWGSL ? "vec3f" : "vec3";
            case NodeMaterialBlockConnectionPointTypes.Color4:
            case NodeMaterialBlockConnectionPointTypes.Vector4:
                return isWGSL ? "vec4f" : "vec4";
            case NodeMaterialBlockConnectionPointTypes.Matrix:
                return isWGSL ? "mat4x4f" : "mat4";
        }
        return "";
    }
    /**
     * @internal
     */
    _emitExtension(name, extension, define = "") {
        if (this.extensions[name]) {
            return;
        }
        if (define) {
            extension = `#if ${define}\n${extension}\n#endif`;
        }
        this.extensions[name] = extension;
    }
    /**
     * @internal
     */
    _emitFunction(name, code, comments) {
        if (this.functions[name]) {
            return;
        }
        if (this.sharedData.emitComments) {
            code = comments + `\n` + code;
        }
        this.functions[name] = code;
    }
    /**
     * @internal
     */
    _emitCodeFromInclude(includeName, comments, options) {
        const store = shaderStore/* ShaderStore */.l.GetIncludesShadersStore(this.shaderLanguage);
        if (options && options.repeatKey) {
            return `#include<${includeName}>${options.substitutionVars ? "(" + options.substitutionVars + ")" : ""}[0..${options.repeatKey}]\n`;
        }
        let code = store[includeName] + "\n";
        if (this.sharedData.emitComments) {
            code = comments + `\n` + code;
        }
        if (!options) {
            return code;
        }
        if (options.replaceStrings) {
            for (let index = 0; index < options.replaceStrings.length; index++) {
                const replaceString = options.replaceStrings[index];
                code = code.replace(replaceString.search, replaceString.replace);
            }
        }
        return code;
    }
    /**
     * @internal
     */
    _emitFunctionFromInclude(includeName, comments, options, storeKey = "") {
        const key = includeName + storeKey;
        if (this.functions[key]) {
            return;
        }
        const store = shaderStore/* ShaderStore */.l.GetIncludesShadersStore(this.shaderLanguage);
        if (!options || (!options.removeAttributes && !options.removeUniforms && !options.removeVaryings && !options.removeIfDef && !options.replaceStrings)) {
            if (options && options.repeatKey) {
                this.functions[key] = `#include<${includeName}>${options.substitutionVars ? "(" + options.substitutionVars + ")" : ""}[0..${options.repeatKey}]\n`;
            }
            else {
                this.functions[key] = `#include<${includeName}>${options?.substitutionVars ? "(" + options?.substitutionVars + ")" : ""}\n`;
            }
            if (this.sharedData.emitComments) {
                this.functions[key] = comments + `\n` + this.functions[key];
            }
            return;
        }
        this.functions[key] = store[includeName];
        if (this.sharedData.emitComments) {
            this.functions[key] = comments + `\n` + this.functions[key];
        }
        if (options.removeIfDef) {
            this.functions[key] = this.functions[key].replace(/^\s*?#ifdef.+$/gm, "");
            this.functions[key] = this.functions[key].replace(/^\s*?#endif.*$/gm, "");
            this.functions[key] = this.functions[key].replace(/^\s*?#else.*$/gm, "");
            this.functions[key] = this.functions[key].replace(/^\s*?#elif.*$/gm, "");
        }
        if (options.removeAttributes) {
            this.functions[key] = this.functions[key].replace(/\s*?attribute .+?;/g, "\n");
        }
        if (options.removeUniforms) {
            this.functions[key] = this.functions[key].replace(/\s*?uniform .*?;/g, "\n");
        }
        if (options.removeVaryings) {
            this.functions[key] = this.functions[key].replace(/\s*?(varying|in) .+?;/g, "\n");
        }
        if (options.replaceStrings) {
            for (let index = 0; index < options.replaceStrings.length; index++) {
                const replaceString = options.replaceStrings[index];
                this.functions[key] = this.functions[key].replace(replaceString.search, replaceString.replace);
            }
        }
    }
    /**
     * @internal
     */
    _registerTempVariable(name) {
        if (this.sharedData.temps.indexOf(name) !== -1) {
            return false;
        }
        this.sharedData.temps.push(name);
        return true;
    }
    /**
     * @internal
     */
    _emitVaryingFromString(name, type, define = "", notDefine = false) {
        if (this.sharedData.varyings.indexOf(name) !== -1) {
            return false;
        }
        this.sharedData.varyings.push(name);
        if (define) {
            if (define.startsWith("defined(")) {
                this.sharedData.varyingDeclaration += `#if ${define}\n`;
            }
            else {
                this.sharedData.varyingDeclaration += `${notDefine ? "#ifndef" : "#ifdef"} ${define}\n`;
            }
        }
        const shaderType = this._getShaderType(type);
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            this.sharedData.varyingDeclaration += `varying ${name}: ${shaderType};\n`;
        }
        else {
            this.sharedData.varyingDeclaration += `varying ${shaderType} ${name};\n`;
        }
        if (define) {
            this.sharedData.varyingDeclaration += `#endif\n`;
        }
        return true;
    }
    /**
     * @internal
     */
    _getVaryingName(name) {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return (this.target !== NodeMaterialBlockTargets.Fragment ? "vertexOutputs." : "fragmentInputs.") + name;
        }
        return name;
    }
    /**
     * @internal
     */
    _emitUniformFromString(name, type, define = "", notDefine = false) {
        if (this.uniforms.indexOf(name) !== -1) {
            return;
        }
        this.uniforms.push(name);
        if (define) {
            if (define.startsWith("defined(")) {
                this._uniformDeclaration += `#if ${define}\n`;
            }
            else {
                this._uniformDeclaration += `${notDefine ? "#ifndef" : "#ifdef"} ${define}\n`;
            }
        }
        const shaderType = this._getShaderType(type);
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            this._uniformDeclaration += `uniform ${name}: ${shaderType};\n`;
        }
        else {
            this._uniformDeclaration += `uniform ${shaderType} ${name};\n`;
        }
        if (define) {
            this._uniformDeclaration += `#endif\n`;
        }
    }
    /**
     * @internal
     */
    _generateTernary(trueStatement, falseStatement, condition) {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return `select(${falseStatement}, ${trueStatement}, ${condition})`;
        }
        return `(${condition}) ? ${trueStatement} : ${falseStatement}`;
    }
    /**
     * @internal
     */
    _emitFloat(value) {
        if (value.toString() === value.toFixed(0)) {
            return `${value}.0`;
        }
        return value.toString();
    }
    /**
     * @internal
     */
    _declareOutput(output, isConst) {
        return this._declareLocalVar(output.associatedVariableName, output.type, isConst);
    }
    /**
     * @internal
     */
    _declareLocalVar(name, type, isConst) {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return `${isConst ? "const" : "var"} ${name}: ${this._getShaderType(type)}`;
        }
        else {
            return `${this._getShaderType(type)} ${name}`;
        }
    }
    /**
     * @internal
     */
    _samplerCubeFunc() {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return "textureSample";
        }
        return "textureCube";
    }
    /**
     * @internal
     */
    _samplerFunc() {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return "textureSample";
        }
        return "texture2D";
    }
    /**
     * @internal
     */
    _samplerLODFunc() {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return "textureSampleLevel";
        }
        return "texture2DLodEXT";
    }
    _toLinearSpace(output) {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            if (output.type === NodeMaterialBlockConnectionPointTypes.Color3 || output.type === NodeMaterialBlockConnectionPointTypes.Vector3) {
                return `toLinearSpaceVec3(${output.associatedVariableName})`;
            }
            return `toLinearSpace(${output.associatedVariableName})`;
        }
        return `toLinearSpace(${output.associatedVariableName})`;
    }
    /**
     * @internal
     */
    _generateTextureSample(uv, samplerName) {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return `${this._samplerFunc()}(${samplerName},${samplerName + `Sampler`}, ${uv})`;
        }
        return `${this._samplerFunc()}(${samplerName}, ${uv})`;
    }
    /**
     * @internal
     */
    _generateTextureSampleLOD(uv, samplerName, lod) {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return `${this._samplerLODFunc()}(${samplerName},${samplerName + `Sampler`}, ${uv}, ${lod})`;
        }
        return `${this._samplerLODFunc()}(${samplerName}, ${uv}, ${lod})`;
    }
    /**
     * @internal
     */
    _generateTextureSampleCube(uv, samplerName) {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return `${this._samplerCubeFunc()}(${samplerName},${samplerName + `Sampler`}, ${uv})`;
        }
        return `${this._samplerCubeFunc()}(${samplerName}, ${uv})`;
    }
    /**
     * @internal
     */
    _generateTextureSampleCubeLOD(uv, samplerName, lod) {
        if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return `${this._samplerCubeFunc()}(${samplerName},${samplerName + `Sampler`}, ${uv}, ${lod})`;
        }
        return `${this._samplerCubeFunc()}(${samplerName}, ${uv}, ${lod})`;
    }
    _convertVariableDeclarationToWGSL(type, dest, source) {
        return source.replace(new RegExp(`(${type})\\s+(\\w+)`, "g"), `var $2: ${dest}`);
    }
    _convertVariableConstructorsToWGSL(type, dest, source) {
        return source.replace(new RegExp(`(${type})\\(`, "g"), ` ${dest}(`);
    }
    _convertOutParametersToWGSL(source) {
        return source.replace(new RegExp(`out\\s+var\\s+(\\w+)\\s*:\\s*(\\w+)`, "g"), `$1: ptr<function, $2>`);
    }
    _convertTernaryOperandsToWGSL(source) {
        return source.replace(new RegExp(`\\[(.*?)\\?(.*?):(.*)\\]`, "g"), (match, condition, trueCase, falseCase) => `select(${falseCase}, ${trueCase}, ${condition})`);
    }
    _convertModOperatorsToWGSL(source) {
        return source.replace(new RegExp(`mod\\((.+?),\\s*(.+?)\\)`, "g"), (match, left, right) => `((${left})%(${right}))`);
    }
    _convertConstToWGSL(source) {
        return source.replace(new RegExp(`const var`, "g"), `const`);
    }
    _convertInnerFunctionsToWGSL(source) {
        return source.replace(new RegExp(`inversesqrt`, "g"), `inverseSqrt`);
    }
    _convertFunctionsToWGSL(source) {
        const regex = /var\s+(\w+)\s*:\s*(\w+)\((.*)\)/g;
        let match;
        while ((match = regex.exec(source)) !== null) {
            const funcName = match[1];
            const funcType = match[2];
            const params = match[3]; // All parameters as a single string
            // Processing the parameters to match 'name: type' format
            const formattedParams = params.replace(/var\s/g, "");
            // Constructing the final output string
            source = source.replace(match[0], `fn ${funcName}(${formattedParams}) -> ${funcType}`);
        }
        return source;
    }
    _babylonSLtoWGSL(code) {
        // variable declarations
        code = this._convertVariableDeclarationToWGSL("void", "voidnull", code);
        code = this._convertVariableDeclarationToWGSL("bool", "bool", code);
        code = this._convertVariableDeclarationToWGSL("int", "i32", code);
        code = this._convertVariableDeclarationToWGSL("uint", "u32", code);
        code = this._convertVariableDeclarationToWGSL("float", "f32", code);
        code = this._convertVariableDeclarationToWGSL("vec2", "vec2f", code);
        code = this._convertVariableDeclarationToWGSL("vec3", "vec3f", code);
        code = this._convertVariableDeclarationToWGSL("vec4", "vec4f", code);
        code = this._convertVariableDeclarationToWGSL("mat2", "mat2x2f", code);
        code = this._convertVariableDeclarationToWGSL("mat3", "mat3x3f", code);
        code = this._convertVariableDeclarationToWGSL("mat4", "mat4x4f", code);
        // Type constructors
        code = this._convertVariableConstructorsToWGSL("float", "f32", code);
        code = this._convertVariableConstructorsToWGSL("vec2", "vec2f", code);
        code = this._convertVariableConstructorsToWGSL("vec3", "vec3f", code);
        code = this._convertVariableConstructorsToWGSL("vec4", "vec4f", code);
        code = this._convertVariableConstructorsToWGSL("mat2", "mat2x2f", code);
        code = this._convertVariableConstructorsToWGSL("mat3", "mat3x3f", code);
        code = this._convertVariableConstructorsToWGSL("mat4", "mat4x4f", code);
        // Ternary operands
        code = this._convertTernaryOperandsToWGSL(code);
        // Mod operators
        code = this._convertModOperatorsToWGSL(code);
        // Const
        code = this._convertConstToWGSL(code);
        // Inner functions
        code = this._convertInnerFunctionsToWGSL(code);
        // Out paramters
        code = this._convertOutParametersToWGSL(code);
        code = code.replace(/\[\*\]/g, "*");
        // Functions
        code = this._convertFunctionsToWGSL(code);
        // Remove voidnull
        code = code.replace(/\s->\svoidnull/g, "");
        // Derivatives
        code = code.replace(/dFdx/g, "dpdx");
        code = code.replace(/dFdy/g, "dpdy");
        return code;
    }
    _convertTernaryOperandsToGLSL(source) {
        return source.replace(new RegExp(`\\[(.+?)\\?(.+?):(.+)\\]`, "g"), (match, condition, trueCase, falseCase) => `${condition} ? ${trueCase} : ${falseCase}`);
    }
    _babylonSLtoGLSL(code) {
        /** Remove BSL specifics */
        code = code.replace(/\[\*\]/g, "");
        code = this._convertTernaryOperandsToGLSL(code);
        return code;
    }
}
//# sourceMappingURL=nodeMaterialBuildState.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialBuildStateSharedData.js

/**
 * Class used to store shared data between 2 NodeMaterialBuildState
 */
class NodeMaterialBuildStateSharedData {
    /** Creates a new shared data */
    constructor() {
        /**
         * Gets the list of emitted varyings
         */
        this.temps = [];
        /**
         * Gets the list of emitted varyings
         */
        this.varyings = [];
        /**
         * Gets the varying declaration string
         */
        this.varyingDeclaration = "";
        /**
         * Input blocks
         */
        this.inputBlocks = [];
        /**
         * Input blocks
         */
        this.textureBlocks = [];
        /**
         * Bindable blocks (Blocks that need to set data to the effect)
         */
        this.bindableBlocks = [];
        /**
         * Bindable blocks (Blocks that need to set data to the effect) that will always be called (by bindForSubMesh), contrary to bindableBlocks that won't be called if _mustRebind() returns false
         */
        this.forcedBindableBlocks = [];
        /**
         * List of blocks that can provide a compilation fallback
         */
        this.blocksWithFallbacks = [];
        /**
         * List of blocks that can provide a define update
         */
        this.blocksWithDefines = [];
        /**
         * List of blocks that can provide a repeatable content
         */
        this.repeatableContentBlocks = [];
        /**
         * List of blocks that can provide a dynamic list of uniforms
         */
        this.dynamicUniformBlocks = [];
        /**
         * List of blocks that can block the isReady function for the material
         */
        this.blockingBlocks = [];
        /**
         * Gets the list of animated inputs
         */
        this.animatedInputs = [];
        /** List of emitted variables */
        this.variableNames = {};
        /** List of emitted defines */
        this.defineNames = {};
        /**
         * Gets the compilation hints emitted at compilation time
         */
        this.hints = {
            needWorldViewMatrix: false,
            needWorldViewProjectionMatrix: false,
            needAlphaBlending: false,
            needAlphaTesting: false,
        };
        /**
         * List of compilation checks
         */
        this.checks = {
            emitVertex: false,
            emitFragment: false,
            notConnectedNonOptionalInputs: new Array(),
        };
        /**
         * Is vertex program allowed to be empty?
         */
        this.allowEmptyVertexProgram = false;
        // Exclude usual attributes from free variable names
        this.variableNames["position"] = 0;
        this.variableNames["normal"] = 0;
        this.variableNames["tangent"] = 0;
        this.variableNames["uv"] = 0;
        this.variableNames["uv2"] = 0;
        this.variableNames["uv3"] = 0;
        this.variableNames["uv4"] = 0;
        this.variableNames["uv5"] = 0;
        this.variableNames["uv6"] = 0;
        this.variableNames["color"] = 0;
        this.variableNames["matricesIndices"] = 0;
        this.variableNames["matricesWeights"] = 0;
        this.variableNames["matricesIndicesExtra"] = 0;
        this.variableNames["matricesWeightsExtra"] = 0;
        this.variableNames["diffuseBase"] = 0;
        this.variableNames["specularBase"] = 0;
        this.variableNames["worldPos"] = 0;
        this.variableNames["shadow"] = 0;
        this.variableNames["view"] = 0;
        // Exclude known varyings
        this.variableNames["vTBN"] = 0;
        // Exclude defines
        this.defineNames["MAINUV0"] = 0;
        this.defineNames["MAINUV1"] = 0;
        this.defineNames["MAINUV2"] = 0;
        this.defineNames["MAINUV3"] = 0;
        this.defineNames["MAINUV4"] = 0;
        this.defineNames["MAINUV5"] = 0;
        this.defineNames["MAINUV6"] = 0;
        this.defineNames["MAINUV7"] = 0;
    }
    /**
     * Emits console errors and exceptions if there is a failing check
     * @param errorObservable defines an Observable to send the error message
     * @returns true if all checks pass
     */
    emitErrors(errorObservable = null) {
        let errorMessage = "";
        if (!this.checks.emitVertex && !this.allowEmptyVertexProgram) {
            errorMessage += "NodeMaterial does not have a vertex output. You need to at least add a block that generates a position value.\n";
        }
        if (!this.checks.emitFragment) {
            errorMessage += "NodeMaterial does not have a fragment output. You need to at least add a block that generates a color value.\n";
        }
        for (const notConnectedInput of this.checks.notConnectedNonOptionalInputs) {
            errorMessage += `input ${notConnectedInput.name} from block ${notConnectedInput.ownerBlock.name}[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\n`;
        }
        if (errorMessage) {
            if (errorObservable) {
                errorObservable.notifyObservers(errorMessage);
            }
            logger/* Logger */.V.Error("Build of NodeMaterial failed:\n" + errorMessage);
            return false;
        }
        return true;
    }
}
//# sourceMappingURL=nodeMaterialBuildStateSharedData.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialBlockConnectionPoint.js



/**
 * Enum used to define the compatibility state between two connection points
 */
var NodeMaterialConnectionPointCompatibilityStates;
(function (NodeMaterialConnectionPointCompatibilityStates) {
    /** Points are compatibles */
    NodeMaterialConnectionPointCompatibilityStates[NodeMaterialConnectionPointCompatibilityStates["Compatible"] = 0] = "Compatible";
    /** Points are incompatible because of their types */
    NodeMaterialConnectionPointCompatibilityStates[NodeMaterialConnectionPointCompatibilityStates["TypeIncompatible"] = 1] = "TypeIncompatible";
    /** Points are incompatible because of their targets (vertex vs fragment) */
    NodeMaterialConnectionPointCompatibilityStates[NodeMaterialConnectionPointCompatibilityStates["TargetIncompatible"] = 2] = "TargetIncompatible";
    /** Points are incompatible because they are in the same hierarchy **/
    NodeMaterialConnectionPointCompatibilityStates[NodeMaterialConnectionPointCompatibilityStates["HierarchyIssue"] = 3] = "HierarchyIssue";
})(NodeMaterialConnectionPointCompatibilityStates || (NodeMaterialConnectionPointCompatibilityStates = {}));
/**
 * Defines the direction of a connection point
 */
var NodeMaterialConnectionPointDirection;
(function (NodeMaterialConnectionPointDirection) {
    /** Input */
    NodeMaterialConnectionPointDirection[NodeMaterialConnectionPointDirection["Input"] = 0] = "Input";
    /** Output */
    NodeMaterialConnectionPointDirection[NodeMaterialConnectionPointDirection["Output"] = 1] = "Output";
})(NodeMaterialConnectionPointDirection || (NodeMaterialConnectionPointDirection = {}));
/**
 * Defines a connection point for a block
 */
class NodeMaterialConnectionPoint {
    /**
     * Checks if two types are equivalent
     * @param type1 type 1 to check
     * @param type2 type 2 to check
     * @returns true if both types are equivalent, else false
     */
    static AreEquivalentTypes(type1, type2) {
        switch (type1) {
            case NodeMaterialBlockConnectionPointTypes.Vector3: {
                if (type2 === NodeMaterialBlockConnectionPointTypes.Color3) {
                    return true;
                }
                break;
            }
            case NodeMaterialBlockConnectionPointTypes.Vector4: {
                if (type2 === NodeMaterialBlockConnectionPointTypes.Color4) {
                    return true;
                }
                break;
            }
            case NodeMaterialBlockConnectionPointTypes.Color3: {
                if (type2 === NodeMaterialBlockConnectionPointTypes.Vector3) {
                    return true;
                }
                break;
            }
            case NodeMaterialBlockConnectionPointTypes.Color4: {
                if (type2 === NodeMaterialBlockConnectionPointTypes.Vector4) {
                    return true;
                }
                break;
            }
        }
        return false;
    }
    get _connectedPoint() {
        return this._connectedPointBackingField;
    }
    set _connectedPoint(value) {
        if (this._connectedPointBackingField === value) {
            return;
        }
        this._connectedPointTypeChangedObserver?.remove();
        this._updateTypeDependentState(() => (this._connectedPointBackingField = value));
        if (this._connectedPointBackingField) {
            this._connectedPointTypeChangedObserver = this._connectedPointBackingField.onTypeChangedObservable.add(() => {
                this._notifyTypeChanged();
            });
        }
    }
    /** @internal */
    get _typeConnectionSource() {
        return this._typeConnectionSourceBackingField;
    }
    /** @internal */
    set _typeConnectionSource(value) {
        if (this._typeConnectionSourceBackingField === value) {
            return;
        }
        this._typeConnectionSourceTypeChangedObserver?.remove();
        this._updateTypeDependentState(() => (this._typeConnectionSourceBackingField = value));
        if (this._typeConnectionSourceBackingField) {
            this._typeConnectionSourceTypeChangedObserver = this._typeConnectionSourceBackingField.onTypeChangedObservable.add(() => {
                this._notifyTypeChanged();
            });
        }
    }
    /** @internal */
    get _defaultConnectionPointType() {
        return this._defaultConnectionPointTypeBackingField;
    }
    /** @internal */
    set _defaultConnectionPointType(value) {
        this._updateTypeDependentState(() => (this._defaultConnectionPointTypeBackingField = value));
    }
    /** @internal */
    get _linkedConnectionSource() {
        return this._linkedConnectionSourceBackingField;
    }
    /** @internal */
    set _linkedConnectionSource(value) {
        if (this._linkedConnectionSourceBackingField === value) {
            return;
        }
        this._linkedConnectionSourceTypeChangedObserver?.remove();
        this._updateTypeDependentState(() => (this._linkedConnectionSourceBackingField = value));
        if (this._linkedConnectionSourceBackingField) {
            this._linkedConnectionSourceTypeChangedObserver = this._linkedConnectionSourceBackingField.onTypeChangedObservable.add(() => {
                this._notifyTypeChanged();
            });
        }
    }
    /** Gets the direction of the point */
    get direction() {
        return this._direction;
    }
    /**
     * Gets the declaration variable name in the shader
     */
    get declarationVariableName() {
        if (this._ownerBlock.isInput) {
            return this._ownerBlock.declarationVariableName;
        }
        if ((!this._enforceAssociatedVariableName || !this._associatedVariableName) && this._connectedPoint) {
            return this._connectedPoint.declarationVariableName;
        }
        return this._associatedVariableName;
    }
    /**
     * Gets or sets the associated variable name in the shader
     */
    get associatedVariableName() {
        if (this._ownerBlock.isInput) {
            return this._ownerBlock.associatedVariableName;
        }
        if ((!this._enforceAssociatedVariableName || !this._associatedVariableName) && this._connectedPoint) {
            return this._connectedPoint.associatedVariableName;
        }
        return this._associatedVariableName;
    }
    set associatedVariableName(value) {
        this._associatedVariableName = value;
    }
    /** Get the inner type (ie AutoDetect for instance instead of the inferred one) */
    get innerType() {
        if (this._linkedConnectionSource && this._linkedConnectionSource.isConnected) {
            return this.type;
        }
        return this._type;
    }
    /**
     * Gets or sets the connection point type (default is float)
     */
    get type() {
        if (this._type === NodeMaterialBlockConnectionPointTypes.AutoDetect) {
            if (this._ownerBlock.isInput) {
                return this._ownerBlock.type;
            }
            if (this._connectedPoint) {
                return this._connectedPoint.type;
            }
            if (this._linkedConnectionSource) {
                if (this._linkedConnectionSource.isConnected) {
                    if (this._linkedConnectionSource.connectedPoint._redirectedSource && this._linkedConnectionSource.connectedPoint._redirectedSource.isConnected) {
                        return this._linkedConnectionSource.connectedPoint._redirectedSource.type;
                    }
                    return this._linkedConnectionSource.type;
                }
                if (this._linkedConnectionSource._defaultConnectionPointType) {
                    return this._linkedConnectionSource._defaultConnectionPointType;
                }
            }
            if (this._defaultConnectionPointType) {
                return this._defaultConnectionPointType;
            }
        }
        if (this._type === NodeMaterialBlockConnectionPointTypes.BasedOnInput) {
            if (this._typeConnectionSource) {
                if (!this._typeConnectionSource.isConnected && this._defaultConnectionPointType) {
                    return this._defaultConnectionPointType;
                }
                return this._typeConnectionSource.type;
            }
            else if (this._defaultConnectionPointType) {
                return this._defaultConnectionPointType;
            }
        }
        return this._type;
    }
    set type(value) {
        this._updateTypeDependentState(() => (this._type = value));
    }
    /** Gets or sets the target of that connection point */
    get target() {
        if (!this._prioritizeVertex || !this._ownerBlock) {
            return this._target;
        }
        if (this._target !== NodeMaterialBlockTargets.VertexAndFragment) {
            return this._target;
        }
        if (this._ownerBlock.target === NodeMaterialBlockTargets.Fragment) {
            return NodeMaterialBlockTargets.Fragment;
        }
        return NodeMaterialBlockTargets.Vertex;
    }
    set target(value) {
        this._target = value;
    }
    /**
     * Gets a boolean indicating that the current point is connected to another NodeMaterialBlock
     */
    get isConnected() {
        return this.connectedPoint !== null || this.hasEndpoints;
    }
    /**
     * Gets a boolean indicating that the current point is connected to an input block
     */
    get isConnectedToInputBlock() {
        return this.connectedPoint !== null && this.connectedPoint.ownerBlock.isInput;
    }
    /**
     * Gets a the connected input block (if any)
     */
    get connectInputBlock() {
        if (!this.isConnectedToInputBlock) {
            return null;
        }
        return this.connectedPoint.ownerBlock;
    }
    /** Get the other side of the connection (if any) */
    get connectedPoint() {
        return this._connectedPoint;
    }
    /** Get the block that owns this connection point */
    get ownerBlock() {
        return this._ownerBlock;
    }
    /** Get the block connected on the other side of this connection (if any) */
    get sourceBlock() {
        if (!this._connectedPoint) {
            return null;
        }
        return this._connectedPoint.ownerBlock;
    }
    /** Get the block connected on the endpoints of this connection (if any) */
    get connectedBlocks() {
        if (this._endpoints.length === 0) {
            return [];
        }
        return this._endpoints.map((e) => e.ownerBlock);
    }
    /** Gets the list of connected endpoints */
    get endpoints() {
        return this._endpoints;
    }
    /** Gets a boolean indicating if that output point is connected to at least one input */
    get hasEndpoints() {
        return this._endpoints && this._endpoints.length > 0;
    }
    /** Gets a boolean indicating that this connection has a path to the vertex output*/
    get isDirectlyConnectedToVertexOutput() {
        if (!this.hasEndpoints) {
            return false;
        }
        for (const endpoint of this._endpoints) {
            if (endpoint.ownerBlock.target === NodeMaterialBlockTargets.Vertex) {
                return true;
            }
            if (endpoint.ownerBlock.target === NodeMaterialBlockTargets.Neutral || endpoint.ownerBlock.target === NodeMaterialBlockTargets.VertexAndFragment) {
                if (endpoint.ownerBlock.outputs.some((o) => o.isDirectlyConnectedToVertexOutput)) {
                    return true;
                }
            }
        }
        return false;
    }
    /** Gets a boolean indicating that this connection will be used in the vertex shader */
    get isConnectedInVertexShader() {
        if (this.target === NodeMaterialBlockTargets.Vertex) {
            return true;
        }
        if (!this.hasEndpoints) {
            return false;
        }
        for (const endpoint of this._endpoints) {
            if (endpoint.ownerBlock.target === NodeMaterialBlockTargets.Vertex) {
                return true;
            }
            if (endpoint.target === NodeMaterialBlockTargets.Vertex) {
                return true;
            }
            if (endpoint.ownerBlock.target === NodeMaterialBlockTargets.Neutral || endpoint.ownerBlock.target === NodeMaterialBlockTargets.VertexAndFragment) {
                if (endpoint.ownerBlock.outputs.some((o) => o.isConnectedInVertexShader)) {
                    return true;
                }
            }
        }
        return false;
    }
    /** Gets a boolean indicating that this connection will be used in the fragment shader */
    get isConnectedInFragmentShader() {
        if (this.target === NodeMaterialBlockTargets.Fragment) {
            return true;
        }
        if (!this.hasEndpoints) {
            return false;
        }
        for (const endpoint of this._endpoints) {
            if (endpoint.ownerBlock.target === NodeMaterialBlockTargets.Fragment) {
                return true;
            }
            if (endpoint.ownerBlock.target === NodeMaterialBlockTargets.Neutral || endpoint.ownerBlock.target === NodeMaterialBlockTargets.VertexAndFragment) {
                if (endpoint.ownerBlock.isConnectedInFragmentShader()) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Creates a block suitable to be used as an input for this input point.
     * If null is returned, a block based on the point type will be created.
     * @returns The returned string parameter is the name of the output point of NodeMaterialBlock (first parameter of the returned array) that can be connected to the input
     */
    createCustomInputBlock() {
        return null;
    }
    /**
     * Creates a new connection point
     * @param name defines the connection point name
     * @param ownerBlock defines the block hosting this connection point
     * @param direction defines the direction of the connection point
     */
    constructor(name, ownerBlock, direction) {
        /** @internal */
        this._preventBubbleUp = false;
        this._connectedPointBackingField = null;
        this._endpoints = new Array();
        /** @internal */
        this._redirectedSource = null;
        this._typeConnectionSourceBackingField = null;
        this._defaultConnectionPointTypeBackingField = null;
        this._linkedConnectionSourceBackingField = null;
        /** @internal */
        this._acceptedConnectionPointType = null;
        this._type = NodeMaterialBlockConnectionPointTypes.Float;
        /** @internal */
        this._enforceAssociatedVariableName = false;
        /** @internal */
        this._forPostBuild = false;
        /** Indicates that this connection point needs dual validation before being connected to another point */
        this.needDualDirectionValidation = false;
        /**
         * Gets or sets the additional types supported by this connection point
         */
        this.acceptedConnectionPointTypes = [];
        /**
         * Gets or sets the additional types excluded by this connection point
         */
        this.excludedConnectionPointTypes = [];
        /**
         * Observable triggered when this point is connected
         */
        this.onConnectionObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable triggered when this point is disconnected
         */
        this.onDisconnectionObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable triggered when the type of the connection point is changed
         */
        this.onTypeChangedObservable = new Misc_observable/* Observable */.cP();
        this._isTypeChangeObservableNotifying = false;
        /**
         * Gets or sets a boolean indicating that this connection point is exposed on a frame
         */
        this.isExposedOnFrame = false;
        /**
         * Gets or sets number indicating the position that the port is exposed to on a frame
         */
        this.exposedPortPosition = -1;
        /** @internal */
        this._prioritizeVertex = false;
        this._target = NodeMaterialBlockTargets.VertexAndFragment;
        this._ownerBlock = ownerBlock;
        this.name = name;
        this._direction = direction;
    }
    /**
     * Gets the current class name e.g. "NodeMaterialConnectionPoint"
     * @returns the class name
     */
    getClassName() {
        return "NodeMaterialConnectionPoint";
    }
    /**
     * Gets a boolean indicating if the current point can be connected to another point
     * @param connectionPoint defines the other connection point
     * @returns a boolean
     */
    canConnectTo(connectionPoint) {
        return this.checkCompatibilityState(connectionPoint) === 0 /* NodeMaterialConnectionPointCompatibilityStates.Compatible */;
    }
    /**
     * Gets a number indicating if the current point can be connected to another point
     * @param connectionPoint defines the other connection point
     * @returns a number defining the compatibility state
     */
    checkCompatibilityState(connectionPoint) {
        const ownerBlock = this._ownerBlock;
        const otherBlock = connectionPoint.ownerBlock;
        if (ownerBlock.target === NodeMaterialBlockTargets.Fragment) {
            // Let's check we are not going reverse
            if (otherBlock.target === NodeMaterialBlockTargets.Vertex) {
                return 2 /* NodeMaterialConnectionPointCompatibilityStates.TargetIncompatible */;
            }
            for (const output of otherBlock.outputs) {
                if (output.ownerBlock.target != NodeMaterialBlockTargets.Neutral && output.isConnectedInVertexShader) {
                    return 2 /* NodeMaterialConnectionPointCompatibilityStates.TargetIncompatible */;
                }
            }
        }
        if (this.type !== connectionPoint.type && connectionPoint.innerType !== NodeMaterialBlockConnectionPointTypes.AutoDetect) {
            // Equivalents
            if (NodeMaterialConnectionPoint.AreEquivalentTypes(this.type, connectionPoint.type)) {
                return 0 /* NodeMaterialConnectionPointCompatibilityStates.Compatible */;
            }
            // Accepted types
            if ((connectionPoint.acceptedConnectionPointTypes && connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) !== -1) ||
                (connectionPoint._acceptedConnectionPointType && NodeMaterialConnectionPoint.AreEquivalentTypes(connectionPoint._acceptedConnectionPointType.type, this.type))) {
                return 0 /* NodeMaterialConnectionPointCompatibilityStates.Compatible */;
            }
            else {
                return 1 /* NodeMaterialConnectionPointCompatibilityStates.TypeIncompatible */;
            }
        }
        // Excluded
        if (connectionPoint.excludedConnectionPointTypes && connectionPoint.excludedConnectionPointTypes.indexOf(this.type) !== -1) {
            return 1 /* NodeMaterialConnectionPointCompatibilityStates.TypeIncompatible */;
        }
        // Check hierarchy
        let targetBlock = otherBlock;
        let sourceBlock = ownerBlock;
        if (this.direction === 0 /* NodeMaterialConnectionPointDirection.Input */) {
            targetBlock = ownerBlock;
            sourceBlock = otherBlock;
        }
        if (targetBlock.isAnAncestorOf(sourceBlock)) {
            return 3 /* NodeMaterialConnectionPointCompatibilityStates.HierarchyIssue */;
        }
        return 0 /* NodeMaterialConnectionPointCompatibilityStates.Compatible */;
    }
    /**
     * Connect this point to another connection point
     * @param connectionPoint defines the other connection point
     * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)
     * @returns the current connection point
     */
    connectTo(connectionPoint, ignoreConstraints = false) {
        if (!ignoreConstraints && !this.canConnectTo(connectionPoint)) {
            // eslint-disable-next-line no-throw-literal
            throw "Cannot connect these two connectors.";
        }
        this._endpoints.push(connectionPoint);
        connectionPoint._connectedPoint = this;
        this._enforceAssociatedVariableName = false;
        this.onConnectionObservable.notifyObservers(connectionPoint);
        connectionPoint.onConnectionObservable.notifyObservers(this);
        return this;
    }
    /**
     * Disconnect this point from one of his endpoint
     * @param endpoint defines the other connection point
     * @returns the current connection point
     */
    disconnectFrom(endpoint) {
        const index = this._endpoints.indexOf(endpoint);
        if (index === -1) {
            return this;
        }
        this._endpoints.splice(index, 1);
        endpoint._connectedPoint = null;
        this._enforceAssociatedVariableName = false;
        endpoint._enforceAssociatedVariableName = false;
        this.onDisconnectionObservable.notifyObservers(endpoint);
        endpoint.onDisconnectionObservable.notifyObservers(this);
        return this;
    }
    /**
     * Fill the list of excluded connection point types with all types other than those passed in the parameter
     * @param mask Types (ORed values of NodeMaterialBlockConnectionPointTypes) that are allowed, and thus will not be pushed to the excluded list
     */
    addExcludedConnectionPointFromAllowedTypes(mask) {
        let bitmask = 1;
        while (bitmask < NodeMaterialBlockConnectionPointTypes.All) {
            if (!(mask & bitmask)) {
                this.excludedConnectionPointTypes.push(bitmask);
            }
            bitmask = bitmask << 1;
        }
    }
    /**
     * Serializes this point in a JSON representation
     * @param isInput defines if the connection point is an input (default is true)
     * @returns the serialized point object
     */
    serialize(isInput = true) {
        const serializationObject = {};
        serializationObject.name = this.name;
        if (this.displayName) {
            serializationObject.displayName = this.displayName;
        }
        if (isInput && this.connectedPoint) {
            serializationObject.inputName = this.name;
            serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId;
            serializationObject.targetConnectionName = this.connectedPoint.name;
            serializationObject.isExposedOnFrame = true;
            serializationObject.exposedPortPosition = this.exposedPortPosition;
        }
        if (this.isExposedOnFrame || this.exposedPortPosition >= 0) {
            serializationObject.isExposedOnFrame = true;
            serializationObject.exposedPortPosition = this.exposedPortPosition;
        }
        return serializationObject;
    }
    /**
     * Release resources
     */
    dispose() {
        this.onConnectionObservable.clear();
        this.onDisconnectionObservable.clear();
        this.onTypeChangedObservable.clear();
        this._connectedPoint = null;
        this._typeConnectionSource = null;
        this._linkedConnectionSource = null;
    }
    _updateTypeDependentState(update) {
        const previousType = this.type;
        update();
        if (this.type !== previousType) {
            this._notifyTypeChanged();
        }
    }
    _notifyTypeChanged() {
        // Disallow re-entrancy
        if (this._isTypeChangeObservableNotifying) {
            return;
        }
        this._isTypeChangeObservableNotifying = true;
        this.onTypeChangedObservable.notifyObservers(this.type);
        this._isTypeChangeObservableNotifying = false;
    }
}
//# sourceMappingURL=nodeMaterialBlockConnectionPoint.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/uniqueIdGenerator.js
var uniqueIdGenerator = __webpack_require__(82678);
;// ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialBlock.js







/**
 * Defines a block that can be used inside a node based material
 */
class NodeMaterialBlock {
    /**
     * Gets the name of the block
     */
    get name() {
        return this._name;
    }
    /**
     * Gets a boolean indicating that this block has is code ready to be used
     */
    get codeIsReady() {
        return this._codeIsReady;
    }
    /**
     * Sets the name of the block. Will check if the name is valid.
     */
    set name(newName) {
        if (!this.validateBlockName(newName)) {
            return;
        }
        this._name = newName;
    }
    /**
     * Gets a boolean indicating that this block can only be used once per NodeMaterial
     */
    get isUnique() {
        return this._isUnique;
    }
    /**
     * Gets a boolean indicating that this block is an end block (e.g. it is generating a system value)
     */
    get isFinalMerger() {
        return this._isFinalMerger;
    }
    /**
     * Gets a boolean indicating that this block is an input (e.g. it sends data to the shader)
     */
    get isInput() {
        return this._isInput;
    }
    /**
     * Gets a boolean indicating if this block is a teleport out
     */
    get isTeleportOut() {
        return this._isTeleportOut;
    }
    /**
     * Gets a boolean indicating if this block is a teleport in
     */
    get isTeleportIn() {
        return this._isTeleportIn;
    }
    /**
     * Gets a boolean indicating if this block is a loop
     */
    get isLoop() {
        return this._isLoop;
    }
    /**
     * Gets or sets the build Id
     */
    get buildId() {
        return this._buildId;
    }
    set buildId(value) {
        this._buildId = value;
    }
    /**
     * Gets or sets the target of the block
     */
    get target() {
        return this._target;
    }
    set target(value) {
        if ((this._target & value) !== 0) {
            return;
        }
        this._target = value;
    }
    /**
     * Gets the list of input points
     */
    get inputs() {
        return this._inputs;
    }
    /** Gets the list of output points */
    get outputs() {
        return this._outputs;
    }
    /**
     * Find an input by its name
     * @param name defines the name of the input to look for
     * @returns the input or null if not found
     */
    getInputByName(name) {
        const filter = this._inputs.filter((e) => e.name === name);
        if (filter.length) {
            return filter[0];
        }
        return null;
    }
    /**
     * Find an output by its name
     * @param name defines the name of the output to look for
     * @returns the output or null if not found
     */
    getOutputByName(name) {
        const filter = this._outputs.filter((e) => e.name === name);
        if (filter.length) {
            return filter[0];
        }
        return null;
    }
    /**
     * Creates a new NodeMaterialBlock
     * @param name defines the block name
     * @param target defines the target of that block (Vertex by default)
     * @param isFinalMerger defines a boolean indicating that this block is an end block (e.g. it is generating a system value). Default is false
     */
    constructor(name, target = NodeMaterialBlockTargets.Vertex, isFinalMerger = false) {
        this._isFinalMerger = false;
        this._isInput = false;
        this._isLoop = false;
        this._isTeleportOut = false;
        this._isTeleportIn = false;
        this._name = "";
        this._isUnique = false;
        this._codeIsReady = true;
        /**
         * Observable raised when the block code is ready (if the code loading is async)
         */
        this.onCodeIsReadyObservable = new Misc_observable/* Observable */.cP();
        /** Gets or sets a boolean indicating that only one input can be connected at a time */
        this.inputsAreExclusive = false;
        /** @internal */
        this._codeVariableName = "";
        /** @internal */
        this._inputs = new Array();
        /** @internal */
        this._outputs = new Array();
        /**
         * Gets or sets the comments associated with this block
         */
        this.comments = "";
        /** Gets or sets a boolean indicating that this input can be edited in the Inspector (false by default) */
        this.visibleInInspector = false;
        /** Gets or sets a boolean indicating that this input can be edited from a collapsed frame */
        this.visibleOnFrame = false;
        this._target = target;
        this._originalTargetIsNeutral = target === NodeMaterialBlockTargets.Neutral;
        this._isFinalMerger = isFinalMerger;
        switch (this.getClassName()) {
            case "InputBlock":
                this._isInput = true;
                break;
            case "NodeMaterialTeleportOutBlock":
                this._isTeleportOut = true;
                break;
            case "NodeMaterialTeleportInBlock":
                this._isTeleportIn = true;
                break;
            case "LoopBlock":
                this._isLoop = true;
                break;
        }
        this._name = name;
        this.uniqueId = uniqueIdGenerator/* UniqueIdGenerator */.K.UniqueId;
    }
    /** @internal */
    _setInitialTarget(target) {
        this._target = target;
        this._originalTargetIsNeutral = target === NodeMaterialBlockTargets.Neutral;
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    initialize(state) {
        // Do nothing
    }
    /**
     * Bind data to effect. Will only be called for blocks with isBindable === true
     * @param effect defines the effect to bind data to
     * @param nodeMaterial defines the hosting NodeMaterial
     * @param mesh defines the mesh that will be rendered
     * @param subMesh defines the submesh that will be rendered
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    bind(effect, nodeMaterial, mesh, subMesh) {
        // Do nothing
    }
    _writeVariable(currentPoint) {
        const connectionPoint = currentPoint.connectedPoint;
        if (connectionPoint) {
            return `${currentPoint.associatedVariableName}`;
        }
        return `0.`;
    }
    _writeFloat(value) {
        let stringVersion = value.toString();
        if (stringVersion.indexOf(".") === -1) {
            stringVersion += ".0";
        }
        return `${stringVersion}`;
    }
    /**
     * Gets the current class name e.g. "NodeMaterialBlock"
     * @returns the class name
     */
    getClassName() {
        return "NodeMaterialBlock";
    }
    /** Gets a boolean indicating that this connection will be used in the fragment shader
     * @returns true if connected in fragment shader
     */
    isConnectedInFragmentShader() {
        return this.outputs.some((o) => o.isConnectedInFragmentShader);
    }
    /**
     * Register a new input. Must be called inside a block constructor
     * @param name defines the connection point name
     * @param type defines the connection point type
     * @param isOptional defines a boolean indicating that this input can be omitted
     * @param target defines the target to use to limit the connection point (will be VertexAndFragment by default)
     * @param point an already created connection point. If not provided, create a new one
     * @returns the current block
     */
    registerInput(name, type, isOptional = false, target, point) {
        point = point ?? new NodeMaterialConnectionPoint(name, this, 0 /* NodeMaterialConnectionPointDirection.Input */);
        point.type = type;
        point.isOptional = isOptional;
        if (target) {
            point.target = target;
        }
        this._inputs.push(point);
        return this;
    }
    /**
     * Register a new output. Must be called inside a block constructor
     * @param name defines the connection point name
     * @param type defines the connection point type
     * @param target defines the target to use to limit the connection point (will be VertexAndFragment by default)
     * @param point an already created connection point. If not provided, create a new one
     * @returns the current block
     */
    registerOutput(name, type, target, point) {
        point = point ?? new NodeMaterialConnectionPoint(name, this, 1 /* NodeMaterialConnectionPointDirection.Output */);
        point.type = type;
        if (target) {
            point.target = target;
        }
        this._outputs.push(point);
        return this;
    }
    /**
     * Will return the first available input e.g. the first one which is not an uniform or an attribute
     * @param forOutput defines an optional connection point to check compatibility with
     * @returns the first available input or null
     */
    getFirstAvailableInput(forOutput = null) {
        for (const input of this._inputs) {
            if (!input.connectedPoint) {
                if (!forOutput ||
                    forOutput.type === input.type ||
                    input.type === NodeMaterialBlockConnectionPointTypes.AutoDetect ||
                    input.acceptedConnectionPointTypes.indexOf(forOutput.type) !== -1) {
                    return input;
                }
            }
        }
        return null;
    }
    /**
     * Will return the first available output e.g. the first one which is not yet connected and not a varying
     * @param forBlock defines an optional block to check compatibility with
     * @returns the first available input or null
     */
    getFirstAvailableOutput(forBlock = null) {
        for (const output of this._outputs) {
            if (!forBlock || !forBlock.target || forBlock.target === NodeMaterialBlockTargets.Neutral || (forBlock.target & output.target) !== 0) {
                return output;
            }
        }
        return null;
    }
    /**
     * Gets the sibling of the given output
     * @param current defines the current output
     * @returns the next output in the list or null
     */
    getSiblingOutput(current) {
        const index = this._outputs.indexOf(current);
        if (index === -1 || index >= this._outputs.length) {
            return null;
        }
        return this._outputs[index + 1];
    }
    /**
     * Checks if the current block is an ancestor of a given block
     * @param block defines the potential descendant block to check
     * @returns true if block is a descendant
     */
    isAnAncestorOf(block) {
        for (const output of this._outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                if (endpoint.ownerBlock === block) {
                    return true;
                }
                if (endpoint.ownerBlock.isAnAncestorOf(block)) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Connect current block with another block
     * @param other defines the block to connect with
     * @param options define the various options to help pick the right connections
     * @param options.input
     * @param options.output
     * @param options.outputSwizzle
     * @returns the current block
     */
    connectTo(other, options) {
        if (this._outputs.length === 0) {
            return;
        }
        let output = options && options.output ? this.getOutputByName(options.output) : this.getFirstAvailableOutput(other);
        let notFound = true;
        while (notFound) {
            const input = options && options.input ? other.getInputByName(options.input) : other.getFirstAvailableInput(output);
            if (output && input && output.canConnectTo(input)) {
                output.connectTo(input);
                notFound = false;
            }
            else if (!output) {
                // eslint-disable-next-line no-throw-literal
                throw "Unable to find a compatible match";
            }
            else {
                output = this.getSiblingOutput(output);
            }
        }
        return this;
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _buildBlock(state) {
        // Empty. Must be defined by child nodes
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _postBuildBlock(state) {
        // Empty. Must be defined by child nodes
    }
    /**
     * Add uniforms, samplers and uniform buffers at compilation time
     * @param state defines the state to update
     * @param nodeMaterial defines the node material requesting the update
     * @param defines defines the material defines to update
     * @param uniformBuffers defines the list of uniform buffer names
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    updateUniformsAndSamples(state, nodeMaterial, defines, uniformBuffers) {
        // Do nothing
    }
    /**
     * Add potential fallbacks if shader compilation fails
     * @param mesh defines the mesh to be rendered
     * @param fallbacks defines the current prioritized list of fallbacks
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    provideFallbacks(mesh, fallbacks) {
        // Do nothing
    }
    /**
     * Initialize defines for shader compilation
     * @param mesh defines the mesh to be rendered
     * @param nodeMaterial defines the node material requesting the update
     * @param defines defines the material defines to update
     * @param useInstances specifies that instances should be used
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    initializeDefines(mesh, nodeMaterial, defines, useInstances = false) { }
    /**
     * Update defines for shader compilation
     * @param mesh defines the mesh to be rendered
     * @param nodeMaterial defines the node material requesting the update
     * @param defines defines the material defines to update
     * @param useInstances specifies that instances should be used
     * @param subMesh defines which submesh to render
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    prepareDefines(mesh, nodeMaterial, defines, useInstances = false, subMesh) {
        // Do nothing
    }
    /**
     * Lets the block try to connect some inputs automatically
     * @param material defines the hosting NodeMaterial
     * @param additionalFilteringInfo optional additional filtering condition when looking for compatible blocks
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    autoConfigure(material, additionalFilteringInfo = () => true) {
        // Do nothing
    }
    /**
     * Function called when a block is declared as repeatable content generator
     * @param vertexShaderState defines the current compilation state for the vertex shader
     * @param fragmentShaderState defines the current compilation state for the fragment shader
     * @param mesh defines the mesh to be rendered
     * @param defines defines the material defines to update
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    replaceRepeatableContent(vertexShaderState, fragmentShaderState, mesh, defines) {
        // Do nothing
    }
    /** Gets a boolean indicating that the code of this block will be promoted to vertex shader even if connected to fragment output */
    get willBeGeneratedIntoVertexShaderFromFragmentShader() {
        if (this.isInput || this.isFinalMerger) {
            return false;
        }
        if (this._outputs.some((o) => o.isDirectlyConnectedToVertexOutput)) {
            return false;
        }
        if (this.target === NodeMaterialBlockTargets.Vertex) {
            return false;
        }
        if (this.target === NodeMaterialBlockTargets.VertexAndFragment || this.target === NodeMaterialBlockTargets.Neutral) {
            if (this._outputs.some((o) => o.isConnectedInVertexShader)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Checks if the block is ready
     * @param mesh defines the mesh to be rendered
     * @param nodeMaterial defines the node material requesting the update
     * @param defines defines the material defines to update
     * @param useInstances specifies that instances should be used
     * @returns true if the block is ready
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    isReady(mesh, nodeMaterial, defines, useInstances = false) {
        return true;
    }
    _linkConnectionTypes(inputIndex0, inputIndex1, looseCoupling = false) {
        if (looseCoupling) {
            this._inputs[inputIndex1]._acceptedConnectionPointType = this._inputs[inputIndex0];
        }
        else {
            this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1];
        }
        this._inputs[inputIndex1]._linkedConnectionSource = this._inputs[inputIndex0];
    }
    _processBuild(block, state, input, activeBlocks) {
        block.build(state, activeBlocks);
        const localBlockIsFragment = state._vertexState != null;
        const otherBlockWasGeneratedInVertexShader = block._buildTarget === NodeMaterialBlockTargets.Vertex && block.target !== NodeMaterialBlockTargets.VertexAndFragment;
        if (localBlockIsFragment &&
            ((block.target & block._buildTarget) === 0 ||
                (block.target & input.target) === 0 ||
                (this.target !== NodeMaterialBlockTargets.VertexAndFragment && otherBlockWasGeneratedInVertexShader))) {
            // context switch! We need a varying
            if ((!block.isInput && state.target !== block._buildTarget) || // block was already emitted by vertex shader
                (block.isInput && block.isAttribute && !block._noContextSwitch) // block is an attribute
            ) {
                const connectedPoint = input.connectedPoint;
                if (state._vertexState._emitVaryingFromString("v_" + connectedPoint.declarationVariableName, connectedPoint.type)) {
                    const prefix = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "vertexOutputs." : "";
                    state._vertexState.compilationString += `${prefix}${"v_" + connectedPoint.declarationVariableName} = ${connectedPoint.associatedVariableName};\n`;
                }
                const prefix = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "fragmentInputs." : "";
                input.associatedVariableName = prefix + "v_" + connectedPoint.declarationVariableName;
                input._enforceAssociatedVariableName = true;
            }
        }
    }
    /**
     * Validates the new name for the block node.
     * @param newName the new name to be given to the node.
     * @returns false if the name is a reserve word, else true.
     */
    validateBlockName(newName) {
        const reservedNames = [
            "position",
            "normal",
            "tangent",
            "particle_positionw",
            "uv",
            "uv2",
            "uv3",
            "uv4",
            "uv5",
            "uv6",
            "position2d",
            "particle_uv",
            "matricesIndices",
            "matricesWeights",
            "world0",
            "world1",
            "world2",
            "world3",
            "particle_color",
            "particle_texturemask",
        ];
        for (const reservedName of reservedNames) {
            if (newName === reservedName) {
                return false;
            }
        }
        return true;
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _customBuildStep(state, activeBlocks) {
        // Must be implemented by children
    }
    /**
     * Compile the current node and generate the shader code
     * @param state defines the current compilation state (uniforms, samplers, current string)
     * @param activeBlocks defines the list of active blocks (i.e. blocks to compile)
     * @returns true if already built
     */
    build(state, activeBlocks) {
        if (this._buildId === state.sharedData.buildId) {
            return true;
        }
        if (!this.isInput) {
            /** Prepare outputs */
            for (const output of this._outputs) {
                if (!output.associatedVariableName) {
                    output.associatedVariableName = state._getFreeVariableName(output.name);
                }
            }
        }
        // Check if "parent" blocks are compiled
        for (const input of this._inputs) {
            if (!input.connectedPoint) {
                if (!input.isOptional) {
                    // Emit a warning
                    state.sharedData.checks.notConnectedNonOptionalInputs.push(input);
                }
                continue;
            }
            if (this.target !== NodeMaterialBlockTargets.Neutral) {
                if ((input.target & this.target) === 0) {
                    continue;
                }
                if ((input.target & state.target) === 0) {
                    continue;
                }
            }
            const block = input.connectedPoint.ownerBlock;
            if (block && block !== this) {
                this._processBuild(block, state, input, activeBlocks);
            }
        }
        this._customBuildStep(state, activeBlocks);
        if (this._buildId === state.sharedData.buildId) {
            return true; // Need to check again as inputs can be connected multiple time to this endpoint
        }
        // Logs
        if (state.sharedData.verbose) {
            logger/* Logger */.V.Log(`${state.target === NodeMaterialBlockTargets.Vertex ? "Vertex shader" : "Fragment shader"}: Building ${this.name} [${this.getClassName()}]`);
        }
        // Checks final outputs
        if (this.isFinalMerger) {
            switch (state.target) {
                case NodeMaterialBlockTargets.Vertex:
                    state.sharedData.checks.emitVertex = true;
                    break;
                case NodeMaterialBlockTargets.Fragment:
                    state.sharedData.checks.emitFragment = true;
                    break;
            }
        }
        if (!this.isInput && state.sharedData.emitComments) {
            state.compilationString += `\n//${this.name}\n`;
        }
        this._buildBlock(state);
        this._buildId = state.sharedData.buildId;
        this._buildTarget = state.target;
        // Compile connected blocks
        for (const output of this._outputs) {
            if (output._forPostBuild) {
                continue;
            }
            if ((output.target & state.target) === 0) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                const block = endpoint.ownerBlock;
                if (block) {
                    if (((block.target & state.target) !== 0 && activeBlocks.indexOf(block) !== -1) || state._terminalBlocks.has(block)) {
                        this._processBuild(block, state, endpoint, activeBlocks);
                    }
                }
            }
        }
        this._postBuildBlock(state);
        // Compile post build connected blocks
        for (const output of this._outputs) {
            if (!output._forPostBuild) {
                continue;
            }
            if ((output.target & state.target) === 0) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                const block = endpoint.ownerBlock;
                if (block && (block.target & state.target) !== 0 && activeBlocks.indexOf(block) !== -1) {
                    this._processBuild(block, state, endpoint, activeBlocks);
                }
            }
        }
        return false;
    }
    _inputRename(name) {
        return name;
    }
    _outputRename(name) {
        return name;
    }
    _dumpPropertiesCode() {
        const variableName = this._codeVariableName;
        return `${variableName}.visibleInInspector = ${this.visibleInInspector};\n${variableName}.visibleOnFrame = ${this.visibleOnFrame};\n${variableName}.target = ${this.target};\n`;
    }
    /**
     * @internal
     */
    _dumpCode(uniqueNames, alreadyDumped) {
        alreadyDumped.push(this);
        // Get unique name
        const nameAsVariableName = this.name.replace(/[^A-Za-z_]+/g, "");
        this._codeVariableName = nameAsVariableName || `${this.getClassName()}_${this.uniqueId}`;
        if (uniqueNames.indexOf(this._codeVariableName) !== -1) {
            let index = 0;
            do {
                index++;
                this._codeVariableName = nameAsVariableName + index;
            } while (uniqueNames.indexOf(this._codeVariableName) !== -1);
        }
        uniqueNames.push(this._codeVariableName);
        // Declaration
        let codeString = `\n// ${this.getClassName()}\n`;
        if (this.comments) {
            codeString += `// ${this.comments}\n`;
        }
        codeString += `var ${this._codeVariableName} = new BABYLON.${this.getClassName()}("${this.name}");\n`;
        // Properties
        codeString += this._dumpPropertiesCode();
        // Inputs
        for (const input of this.inputs) {
            if (!input.isConnected) {
                continue;
            }
            const connectedOutput = input.connectedPoint;
            const connectedBlock = connectedOutput.ownerBlock;
            if (alreadyDumped.indexOf(connectedBlock) === -1) {
                codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        // Outputs
        for (const output of this.outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                const connectedBlock = endpoint.ownerBlock;
                if (connectedBlock && alreadyDumped.indexOf(connectedBlock) === -1) {
                    codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);
                }
            }
        }
        return codeString;
    }
    /**
     * @internal
     */
    _dumpCodeForOutputConnections(alreadyDumped) {
        let codeString = "";
        if (alreadyDumped.indexOf(this) !== -1) {
            return codeString;
        }
        alreadyDumped.push(this);
        for (const input of this.inputs) {
            if (!input.isConnected) {
                continue;
            }
            const connectedOutput = input.connectedPoint;
            const connectedBlock = connectedOutput.ownerBlock;
            codeString += connectedBlock._dumpCodeForOutputConnections(alreadyDumped);
            codeString += `${connectedBlock._codeVariableName}.${connectedBlock._outputRename(connectedOutput.name)}.connectTo(${this._codeVariableName}.${this._inputRename(input.name)});\n`;
        }
        return codeString;
    }
    /**
     * Clone the current block to a new identical block
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @returns a copy of the current block
     */
    clone(scene, rootUrl = "") {
        const serializationObject = this.serialize();
        const blockType = (0,typeStore/* GetClass */.n9)(serializationObject.customType);
        if (blockType) {
            const block = new blockType();
            block._deserialize(serializationObject, scene, rootUrl);
            return block;
        }
        return null;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.customType = "BABYLON." + this.getClassName();
        serializationObject.id = this.uniqueId;
        serializationObject.name = this.name;
        serializationObject.comments = this.comments;
        serializationObject.visibleInInspector = this.visibleInInspector;
        serializationObject.visibleOnFrame = this.visibleOnFrame;
        serializationObject.target = this.target;
        serializationObject.inputs = [];
        serializationObject.outputs = [];
        for (const input of this.inputs) {
            serializationObject.inputs.push(input.serialize());
        }
        for (const output of this.outputs) {
            serializationObject.outputs.push(output.serialize(false));
        }
        return serializationObject;
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _deserialize(serializationObject, scene, rootUrl, urlRewriter) {
        this.name = serializationObject.name;
        this.comments = serializationObject.comments;
        this.visibleInInspector = !!serializationObject.visibleInInspector;
        this.visibleOnFrame = !!serializationObject.visibleOnFrame;
        this._target = serializationObject.target ?? this.target;
        this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);
    }
    _deserializePortDisplayNamesAndExposedOnFrame(serializationObject) {
        const serializedInputs = serializationObject.inputs;
        const serializedOutputs = serializationObject.outputs;
        if (serializedInputs) {
            serializedInputs.forEach((port, i) => {
                if (port.displayName) {
                    this.inputs[i].displayName = port.displayName;
                }
                if (port.isExposedOnFrame) {
                    this.inputs[i].isExposedOnFrame = port.isExposedOnFrame;
                    this.inputs[i].exposedPortPosition = port.exposedPortPosition;
                }
            });
        }
        if (serializedOutputs) {
            serializedOutputs.forEach((port, i) => {
                if (port.displayName) {
                    this.outputs[i].displayName = port.displayName;
                }
                if (port.isExposedOnFrame) {
                    this.outputs[i].isExposedOnFrame = port.isExposedOnFrame;
                    this.outputs[i].exposedPortPosition = port.exposedPortPosition;
                }
            });
        }
    }
    /**
     * Release resources
     */
    dispose() {
        this.onCodeIsReadyObservable.clear();
        for (const input of this.inputs) {
            input.dispose();
        }
        for (const output of this.outputs) {
            output.dispose();
        }
    }
}
//# sourceMappingURL=nodeMaterialBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/transformBlock.js






/**
 * Block used to transform a vector (2, 3 or 4) with a matrix. It will generate a Vector4
 */
class TransformBlock extends NodeMaterialBlock {
    /**
     * Boolean indicating if the transformation is made for a direction vector and not a position vector
     * If set to true the complementW value will be set to 0 else it will be set to 1
     */
    get transformAsDirection() {
        return this.complementW === 0;
    }
    set transformAsDirection(value) {
        this.complementW = value ? 0 : 1;
    }
    /**
     * Creates a new TransformBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Defines the value to use to complement W value to transform it to a Vector4
         */
        this.complementW = 1;
        /**
         * Defines the value to use to complement z value to transform it to a Vector4
         */
        this.complementZ = 0;
        this.target = NodeMaterialBlockTargets.Vertex;
        this.registerInput("vector", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("transform", NodeMaterialBlockConnectionPointTypes.Matrix);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3);
        this._inputs[0].onConnectionObservable.add((other) => {
            if (other.ownerBlock.isInput) {
                const otherAsInput = other.ownerBlock;
                if (otherAsInput.name === "normal" || otherAsInput.name === "tangent") {
                    this.complementW = 0;
                }
            }
        });
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TransformBlock";
    }
    /**
     * Gets the vector input
     */
    get vector() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the xyz output component
     */
    get xyz() {
        return this._outputs[1];
    }
    /**
     * Gets the matrix transform input
     */
    get transform() {
        return this._inputs[1];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const vector = this.vector;
        const transform = this.transform;
        const vec4 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector4);
        const vec3 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector3);
        if (vector.connectedPoint) {
            // None uniform scaling case.
            if (this.complementW === 0 || this.transformAsDirection) {
                const comments = `//${this.name}`;
                state._emitFunctionFromInclude("helperFunctions", comments);
                state.sharedData.blocksWithDefines.push(this);
                const transformName = state._getFreeVariableName(`${transform.associatedVariableName}_NUS`);
                if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    state.compilationString += `var ${transformName}: mat3x3f = mat3x3f(${transform.associatedVariableName}[0].xyz, ${transform.associatedVariableName}[1].xyz, ${transform.associatedVariableName}[2].xyz);\n`;
                }
                else {
                    state.compilationString += `mat3 ${transformName} = mat3(${transform.associatedVariableName});\n`;
                }
                state.compilationString += `#ifdef NONUNIFORMSCALING\n`;
                state.compilationString += `${transformName} = transposeMat3(inverseMat3(${transformName}));\n`;
                state.compilationString += `#endif\n`;
                switch (vector.connectedPoint.type) {
                    case NodeMaterialBlockConnectionPointTypes.Vector2:
                        state.compilationString +=
                            state._declareOutput(this.output) +
                                ` = ${vec4}(${transformName} * ${vec3}(${vector.associatedVariableName}, ${this._writeFloat(this.complementZ)}), ${this._writeFloat(this.complementW)});\n`;
                        break;
                    case NodeMaterialBlockConnectionPointTypes.Vector3:
                    case NodeMaterialBlockConnectionPointTypes.Color3:
                        state.compilationString +=
                            state._declareOutput(this.output) + ` = ${vec4}(${transformName} * ${vector.associatedVariableName}, ${this._writeFloat(this.complementW)});\n`;
                        break;
                    default:
                        state.compilationString +=
                            state._declareOutput(this.output) + ` = ${vec4}(${transformName} * ${vector.associatedVariableName}.xyz, ${this._writeFloat(this.complementW)});\n`;
                        break;
                }
            }
            else {
                const transformName = transform.associatedVariableName;
                switch (vector.connectedPoint.type) {
                    case NodeMaterialBlockConnectionPointTypes.Vector2:
                        state.compilationString +=
                            state._declareOutput(this.output) +
                                ` = ${transformName} * ${vec4}(${vector.associatedVariableName}, ${this._writeFloat(this.complementZ)}, ${this._writeFloat(this.complementW)});\n`;
                        break;
                    case NodeMaterialBlockConnectionPointTypes.Vector3:
                    case NodeMaterialBlockConnectionPointTypes.Color3:
                        state.compilationString +=
                            state._declareOutput(this.output) + ` = ${transformName} * ${vec4}(${vector.associatedVariableName}, ${this._writeFloat(this.complementW)});\n`;
                        break;
                    default:
                        state.compilationString += state._declareOutput(this.output) + ` = ${transformName} * ${vector.associatedVariableName};\n`;
                        break;
                }
            }
            if (this.xyz.hasEndpoints) {
                state.compilationString += state._declareOutput(this.xyz) + ` = ${this.output.associatedVariableName}.xyz;\n`;
            }
        }
        return this;
    }
    /**
     * Update defines for shader compilation
     * @param mesh defines the mesh to be rendered
     * @param nodeMaterial defines the node material requesting the update
     * @param defines defines the material defines to update
     */
    prepareDefines(mesh, nodeMaterial, defines) {
        // Do nothing
        if (mesh.nonUniformScaling) {
            defines.setValue("NONUNIFORMSCALING", true);
        }
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.complementZ = this.complementZ;
        serializationObject.complementW = this.complementW;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.complementZ = serializationObject.complementZ !== undefined ? serializationObject.complementZ : 0.0;
        this.complementW = serializationObject.complementW !== undefined ? serializationObject.complementW : 1.0;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.complementZ = ${this.complementZ};\n`;
        codeString += `${this._codeVariableName}.complementW = ${this.complementW};\n`;
        return codeString;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Transform as direction", 0 /* PropertyTypeForEdition.Boolean */, undefined, { embedded: true })
], TransformBlock.prototype, "transformAsDirection", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TransformBlock", TransformBlock);
//# sourceMappingURL=transformBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/vertexOutputBlock.js




/**
 * Block used to output the vertex position
 */
class VertexOutputBlock extends NodeMaterialBlock {
    /**
     * Creates a new VertexOutputBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Vertex, true);
        this.registerInput("vector", NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "VertexOutputBlock";
    }
    /**
     * Gets the vector input component
     */
    get vector() {
        return this._inputs[0];
    }
    _isLogarithmicDepthEnabled(nodeList, useLogarithmicDepth) {
        if (useLogarithmicDepth) {
            return true;
        }
        for (const node of nodeList) {
            if (node.useLogarithmicDepth) {
                return true;
            }
        }
        return false;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const input = this.vector;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            state.compilationString += `vertexOutputs.position = ${input.associatedVariableName};\n`;
        }
        else {
            state.compilationString += `gl_Position = ${input.associatedVariableName};\n`;
        }
        // TODOWGSL
        if (this._isLogarithmicDepthEnabled(state.sharedData.fragmentOutputNodes, state.sharedData.nodeMaterial.useLogarithmicDepth)) {
            state._emitUniformFromString("logarithmicDepthConstant", NodeMaterialBlockConnectionPointTypes.Float);
            state._emitVaryingFromString("vFragmentDepth", NodeMaterialBlockConnectionPointTypes.Float);
            const fragDepth = isWebGPU ? "vertexOutputs.vFragmentDepth" : "vFragmentDepth";
            const uniformP = isWebGPU ? "uniforms." : "";
            const position = isWebGPU ? "vertexOutputs.position" : "gl_Position";
            state.compilationString += `${fragDepth} = 1.0 + ${position}.w;\n`;
            state.compilationString += `${position}.z = log2(max(0.000001, ${fragDepth})) * ${uniformP}logarithmicDepthConstant;\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.VertexOutputBlock", VertexOutputBlock);
//# sourceMappingURL=vertexOutputBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js







/**
 * Color spaces supported by the fragment output block
 */
var FragmentOutputBlockColorSpace;
(function (FragmentOutputBlockColorSpace) {
    /** Unspecified */
    FragmentOutputBlockColorSpace[FragmentOutputBlockColorSpace["NoColorSpace"] = 0] = "NoColorSpace";
    /** Gamma */
    FragmentOutputBlockColorSpace[FragmentOutputBlockColorSpace["Gamma"] = 1] = "Gamma";
    /** Linear */
    FragmentOutputBlockColorSpace[FragmentOutputBlockColorSpace["Linear"] = 2] = "Linear";
})(FragmentOutputBlockColorSpace || (FragmentOutputBlockColorSpace = {}));
/**
 * Block used to output the final color
 */
class FragmentOutputBlock extends NodeMaterialBlock {
    /**
     * Create a new FragmentOutputBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment, true);
        /** Gets or sets a boolean indicating if content needs to be converted to gamma space */
        this.convertToGammaSpace = false;
        /** Gets or sets a boolean indicating if content needs to be converted to linear space */
        this.convertToLinearSpace = false;
        /** Gets or sets a boolean indicating if logarithmic depth should be used */
        this.useLogarithmicDepth = false;
        this.registerInput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, true);
        this.registerInput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, true);
        this.registerInput("a", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.rgb.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector3);
        this.rgb.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets or sets the color space used for the block
     */
    get colorSpace() {
        if (this.convertToGammaSpace) {
            return FragmentOutputBlockColorSpace.Gamma;
        }
        if (this.convertToLinearSpace) {
            return FragmentOutputBlockColorSpace.Linear;
        }
        return FragmentOutputBlockColorSpace.NoColorSpace;
    }
    set colorSpace(value) {
        this.convertToGammaSpace = value === FragmentOutputBlockColorSpace.Gamma;
        this.convertToLinearSpace = value === FragmentOutputBlockColorSpace.Linear;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "FragmentOutputBlock";
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("logarithmicDepthConstant");
        state._excludeVariableName("vFragmentDepth");
    }
    /**
     * Gets the rgba input component
     */
    get rgba() {
        return this._inputs[0];
    }
    /**
     * Gets the rgb input component
     */
    get rgb() {
        return this._inputs[1];
    }
    /**
     * Gets the a input component
     */
    get a() {
        return this._inputs[2];
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        defines.setValue(this._linearDefineName, this.convertToLinearSpace, true);
        defines.setValue(this._gammaDefineName, this.convertToGammaSpace, true);
    }
    bind(effect, nodeMaterial, mesh) {
        if ((this.useLogarithmicDepth || nodeMaterial.useLogarithmicDepth) && mesh) {
            (0,materialHelper_functions/* BindLogDepth */.DL)(undefined, effect, mesh.getScene());
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const rgba = this.rgba;
        const rgb = this.rgb;
        const a = this.a;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        state.sharedData.hints.needAlphaBlending = rgba.isConnected || a.isConnected;
        state.sharedData.blocksWithDefines.push(this);
        if (this.useLogarithmicDepth || state.sharedData.nodeMaterial.useLogarithmicDepth) {
            state._emitUniformFromString("logarithmicDepthConstant", NodeMaterialBlockConnectionPointTypes.Float);
            state._emitVaryingFromString("vFragmentDepth", NodeMaterialBlockConnectionPointTypes.Float);
            state.sharedData.bindableBlocks.push(this);
        }
        this._linearDefineName = state._getFreeDefineName("CONVERTTOLINEAR");
        this._gammaDefineName = state._getFreeDefineName("CONVERTTOGAMMA");
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("helperFunctions", comments);
        let outputString = "gl_FragColor";
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            state.compilationString += `var fragmentOutputsColor : vec4<f32>;\r\n`;
            outputString = "fragmentOutputsColor";
        }
        const vec4 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector4);
        if (rgba.connectedPoint) {
            if (a.isConnected) {
                state.compilationString += `${outputString} = ${vec4}(${rgba.associatedVariableName}.rgb, ${a.associatedVariableName});\n`;
            }
            else {
                state.compilationString += `${outputString}  = ${rgba.associatedVariableName};\n`;
            }
        }
        else if (rgb.connectedPoint) {
            let aValue = "1.0";
            if (a.connectedPoint) {
                aValue = a.associatedVariableName;
            }
            if (rgb.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Float) {
                state.compilationString += `${outputString}  = ${vec4}(${rgb.associatedVariableName}, ${rgb.associatedVariableName}, ${rgb.associatedVariableName}, ${aValue});\n`;
            }
            else {
                state.compilationString += `${outputString}  = ${vec4}(${rgb.associatedVariableName}, ${aValue});\n`;
            }
        }
        else {
            state.sharedData.checks.notConnectedNonOptionalInputs.push(rgba);
        }
        state.compilationString += `#ifdef ${this._linearDefineName}\n`;
        state.compilationString += `${outputString}  = toLinearSpace(${outputString});\n`;
        state.compilationString += `#endif\n`;
        state.compilationString += `#ifdef ${this._gammaDefineName}\n`;
        state.compilationString += `${outputString}  = toGammaSpace(${outputString});\n`;
        state.compilationString += `#endif\n`;
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            state.compilationString += `#if !defined(PREPASS)\r\n`;
            state.compilationString += `fragmentOutputs.color = fragmentOutputsColor;\r\n`;
            state.compilationString += `#endif\r\n`;
        }
        if (this.useLogarithmicDepth || state.sharedData.nodeMaterial.useLogarithmicDepth) {
            const fragDepth = isWebGPU ? "input.vFragmentDepth" : "vFragmentDepth";
            const uniformP = isWebGPU ? "uniforms." : "";
            const output = isWebGPU ? "fragmentOutputs.fragDepth" : "gl_FragDepthEXT";
            state.compilationString += `${output} = log2(${fragDepth}) * ${uniformP}logarithmicDepthConstant * 0.5;\n`;
        }
        state.compilationString += `#if defined(PREPASS)\r\n`;
        state.compilationString += `${isWebGPU ? "fragmentOutputs.fragData0" : "gl_FragData[0]"} = ${outputString};\r\n`;
        state.compilationString += `#endif\r\n`;
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};\n`;
        codeString += `${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};\n`;
        codeString += `${this._codeVariableName}.useLogarithmicDepth = ${this.useLogarithmicDepth};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.convertToGammaSpace = this.convertToGammaSpace;
        serializationObject.convertToLinearSpace = this.convertToLinearSpace;
        serializationObject.useLogarithmicDepth = this.useLogarithmicDepth;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.convertToGammaSpace = !!serializationObject.convertToGammaSpace;
        this.convertToLinearSpace = !!serializationObject.convertToLinearSpace;
        this.useLogarithmicDepth = serializationObject.useLogarithmicDepth ?? false;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Use logarithmic depth", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { embedded: true })
], FragmentOutputBlock.prototype, "useLogarithmicDepth", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Color space", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "No color space", value: FragmentOutputBlockColorSpace.NoColorSpace },
            { label: "Gamma", value: FragmentOutputBlockColorSpace.Gamma },
            { label: "Linear", value: FragmentOutputBlockColorSpace.Linear },
        ],
    })
], FragmentOutputBlock.prototype, "colorSpace", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FragmentOutputBlock", FragmentOutputBlock);
//# sourceMappingURL=fragmentOutputBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialSystemValues.js
/**
 * Enum used to define system values e.g. values automatically provided by the system
 */
var NodeMaterialSystemValues;
(function (NodeMaterialSystemValues) {
    /** World */
    NodeMaterialSystemValues[NodeMaterialSystemValues["World"] = 1] = "World";
    /** View */
    NodeMaterialSystemValues[NodeMaterialSystemValues["View"] = 2] = "View";
    /** Projection */
    NodeMaterialSystemValues[NodeMaterialSystemValues["Projection"] = 3] = "Projection";
    /** ViewProjection */
    NodeMaterialSystemValues[NodeMaterialSystemValues["ViewProjection"] = 4] = "ViewProjection";
    /** WorldView */
    NodeMaterialSystemValues[NodeMaterialSystemValues["WorldView"] = 5] = "WorldView";
    /** WorldViewProjection */
    NodeMaterialSystemValues[NodeMaterialSystemValues["WorldViewProjection"] = 6] = "WorldViewProjection";
    /** CameraPosition */
    NodeMaterialSystemValues[NodeMaterialSystemValues["CameraPosition"] = 7] = "CameraPosition";
    /** Fog Color */
    NodeMaterialSystemValues[NodeMaterialSystemValues["FogColor"] = 8] = "FogColor";
    /** Delta time */
    NodeMaterialSystemValues[NodeMaterialSystemValues["DeltaTime"] = 9] = "DeltaTime";
    /** Camera parameters */
    NodeMaterialSystemValues[NodeMaterialSystemValues["CameraParameters"] = 10] = "CameraParameters";
    /** Material alpha */
    NodeMaterialSystemValues[NodeMaterialSystemValues["MaterialAlpha"] = 11] = "MaterialAlpha";
})(NodeMaterialSystemValues || (NodeMaterialSystemValues = {}));
//# sourceMappingURL=nodeMaterialSystemValues.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Input/animatedInputBlockTypes.js
/**
 * Enum defining the type of animations supported by InputBlock
 */
var AnimatedInputBlockTypes;
(function (AnimatedInputBlockTypes) {
    /** No animation */
    AnimatedInputBlockTypes[AnimatedInputBlockTypes["None"] = 0] = "None";
    /** Time based animation (is incremented by 0.6 each second). Will only work for floats */
    AnimatedInputBlockTypes[AnimatedInputBlockTypes["Time"] = 1] = "Time";
    /** Time elapsed (in seconds) since the engine was initialized. Will only work for floats */
    AnimatedInputBlockTypes[AnimatedInputBlockTypes["RealTime"] = 2] = "RealTime";
    AnimatedInputBlockTypes[AnimatedInputBlockTypes["MouseInfo"] = 3] = "MouseInfo";
})(AnimatedInputBlockTypes || (AnimatedInputBlockTypes = {}));
//# sourceMappingURL=animatedInputBlockTypes.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Input/inputBlock.js
/* eslint-disable @typescript-eslint/naming-convention */










const remapAttributeName = {
    position2d: "position",
    particle_uv: "vUV",
    particle_color: "vColor",
    particle_texturemask: "textureMask",
    particle_positionw: "vPositionW",
};
const attributeInFragmentOnly = {
    particle_uv: true,
    particle_color: true,
    particle_texturemask: true,
    particle_positionw: true,
};
const attributeAsUniform = {
    particle_texturemask: true,
};
/**
 * Block used to expose an input value
 */
class InputBlock extends NodeMaterialBlock {
    /**
     * Gets or sets the connection point type (default is float)
     */
    get type() {
        if (this._type === NodeMaterialBlockConnectionPointTypes.AutoDetect) {
            if (this.isUniform && this.value != null) {
                if (!isNaN(this.value)) {
                    this._type = NodeMaterialBlockConnectionPointTypes.Float;
                    return this._type;
                }
                switch (this.value.getClassName()) {
                    case "Vector2":
                        this._type = NodeMaterialBlockConnectionPointTypes.Vector2;
                        return this._type;
                    case "Vector3":
                        this._type = NodeMaterialBlockConnectionPointTypes.Vector3;
                        return this._type;
                    case "Vector4":
                        this._type = NodeMaterialBlockConnectionPointTypes.Vector4;
                        return this._type;
                    case "Color3":
                        this._type = NodeMaterialBlockConnectionPointTypes.Color3;
                        return this._type;
                    case "Color4":
                        this._type = NodeMaterialBlockConnectionPointTypes.Color4;
                        return this._type;
                    case "Matrix":
                        this._type = NodeMaterialBlockConnectionPointTypes.Matrix;
                        return this._type;
                }
            }
            if (this.isAttribute) {
                switch (this.name) {
                    case "splatIndex":
                        this._type = NodeMaterialBlockConnectionPointTypes.Float;
                        return this._type;
                    case "position":
                    case "normal":
                    case "particle_positionw":
                    case "splatPosition":
                        this._type = NodeMaterialBlockConnectionPointTypes.Vector3;
                        return this._type;
                    case "uv":
                    case "uv2":
                    case "uv3":
                    case "uv4":
                    case "uv5":
                    case "uv6":
                    case "position2d":
                    case "particle_uv":
                    case "splatScale":
                        this._type = NodeMaterialBlockConnectionPointTypes.Vector2;
                        return this._type;
                    case "matricesIndices":
                    case "matricesWeights":
                    case "matricesIndicesExtra":
                    case "matricesWeightsExtra":
                    case "world0":
                    case "world1":
                    case "world2":
                    case "world3":
                    case "tangent":
                        this._type = NodeMaterialBlockConnectionPointTypes.Vector4;
                        return this._type;
                    case "color":
                    case "instanceColor":
                    case "particle_color":
                    case "particle_texturemask":
                    case "splatColor":
                        this._type = NodeMaterialBlockConnectionPointTypes.Color4;
                        return this._type;
                }
            }
            if (this.isSystemValue) {
                switch (this._systemValue) {
                    case NodeMaterialSystemValues.World:
                    case NodeMaterialSystemValues.WorldView:
                    case NodeMaterialSystemValues.WorldViewProjection:
                    case NodeMaterialSystemValues.View:
                    case NodeMaterialSystemValues.ViewProjection:
                    case NodeMaterialSystemValues.Projection:
                        this._type = NodeMaterialBlockConnectionPointTypes.Matrix;
                        return this._type;
                    case NodeMaterialSystemValues.CameraPosition:
                        this._type = NodeMaterialBlockConnectionPointTypes.Vector3;
                        return this._type;
                    case NodeMaterialSystemValues.FogColor:
                        this._type = NodeMaterialBlockConnectionPointTypes.Color3;
                        return this._type;
                    case NodeMaterialSystemValues.DeltaTime:
                    case NodeMaterialSystemValues.MaterialAlpha:
                        this._type = NodeMaterialBlockConnectionPointTypes.Float;
                        return this._type;
                    case NodeMaterialSystemValues.CameraParameters:
                        this._type = NodeMaterialBlockConnectionPointTypes.Vector4;
                        return this._type;
                }
            }
        }
        return this._type;
    }
    /**
     * Creates a new InputBlock
     * @param name defines the block name
     * @param target defines the target of that block (Vertex by default)
     * @param type defines the type of the input (can be set to NodeMaterialBlockConnectionPointTypes.AutoDetect)
     */
    constructor(name, target = NodeMaterialBlockTargets.Vertex, type = NodeMaterialBlockConnectionPointTypes.AutoDetect) {
        super(name, target, false);
        this._mode = 3 /* NodeMaterialBlockConnectionPointMode.Undefined */;
        this._animationType = AnimatedInputBlockTypes.None;
        this._prefix = "";
        /** Gets or set a value used to limit the range of float values */
        this.min = 0;
        /** Gets or set a value used to limit the range of float values */
        this.max = 0;
        /** Gets or set a value indicating that this input can only get 0 and 1 values */
        this.isBoolean = false;
        /** Gets or sets a value used by the Node Material editor to determine how to configure the current value if it is a matrix */
        this.matrixMode = 0;
        /** @internal */
        this._systemValue = null;
        /** Gets or sets a boolean indicating that the value of this input will not change after a build */
        this.isConstant = false;
        /** Gets or sets the group to use to display this block in the Inspector */
        this.groupInInspector = "";
        /** Gets an observable raised when the value is changed */
        this.onValueChangedObservable = new Misc_observable/* Observable */.cP();
        /** Gets or sets a boolean indicating if content needs to be converted to gamma space (for color3/4 only) */
        this.convertToGammaSpace = false;
        /** Gets or sets a boolean indicating if content needs to be converted to linear space (for color3/4 only) */
        this.convertToLinearSpace = false;
        this._type = type;
        this.setDefaultValue();
        this.registerOutput("output", type);
    }
    /**
     * Validates if a name is a reserve word.
     * @param newName the new name to be given to the node.
     * @returns false if the name is a reserve word, else true.
     */
    validateBlockName(newName) {
        if (!this.isAttribute) {
            return super.validateBlockName(newName);
        }
        return true;
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Set the source of this connection point to a vertex attribute
     * @param attributeName defines the attribute name (position, uv, normal, etc...). If not specified it will take the connection point name
     * @returns the current connection point
     */
    setAsAttribute(attributeName) {
        this._mode = 1 /* NodeMaterialBlockConnectionPointMode.Attribute */;
        if (attributeName) {
            this.name = attributeName;
        }
        return this;
    }
    /**
     * Set the source of this connection point to a system value
     * @param value define the system value to use (world, view, etc...) or null to switch to manual value
     * @returns the current connection point
     */
    setAsSystemValue(value) {
        this.systemValue = value;
        return this;
    }
    /**
     * Gets or sets the value of that point.
     * Please note that this value will be ignored if valueCallback is defined
     */
    get value() {
        return this._storedValue;
    }
    set value(value) {
        if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {
            if (this.isBoolean) {
                value = value ? 1 : 0;
            }
            else if (this.min !== this.max) {
                value = Math.max(this.min, value);
                value = Math.min(this.max, value);
            }
        }
        this._storedValue = value;
        this._mode = 0 /* NodeMaterialBlockConnectionPointMode.Uniform */;
        this.onValueChangedObservable.notifyObservers(this);
    }
    /**
     * Gets or sets a callback used to get the value of that point.
     * Please note that setting this value will force the connection point to ignore the value property
     */
    get valueCallback() {
        return this._valueCallback;
    }
    set valueCallback(value) {
        this._valueCallback = value;
        this._mode = 0 /* NodeMaterialBlockConnectionPointMode.Uniform */;
    }
    /**
     * Gets the declaration variable name in the shader
     */
    get declarationVariableName() {
        return this._associatedVariableName;
    }
    /**
     * Gets or sets the associated variable name in the shader
     */
    get associatedVariableName() {
        return this._prefix + this._associatedVariableName;
    }
    set associatedVariableName(value) {
        this._associatedVariableName = value;
    }
    /** Gets or sets the type of animation applied to the input */
    get animationType() {
        return this._animationType;
    }
    set animationType(value) {
        this._animationType = value;
    }
    /**
     * Gets a boolean indicating that this connection point not defined yet
     */
    get isUndefined() {
        return this._mode === 3 /* NodeMaterialBlockConnectionPointMode.Undefined */;
    }
    /**
     * Gets or sets a boolean indicating that this connection point is coming from an uniform.
     * In this case the connection point name must be the name of the uniform to use.
     * Can only be set on inputs
     */
    get isUniform() {
        return this._mode === 0 /* NodeMaterialBlockConnectionPointMode.Uniform */;
    }
    set isUniform(value) {
        this._mode = value ? 0 /* NodeMaterialBlockConnectionPointMode.Uniform */ : 3 /* NodeMaterialBlockConnectionPointMode.Undefined */;
        this.associatedVariableName = "";
    }
    /**
     * Gets or sets a boolean indicating that this connection point is coming from an attribute.
     * In this case the connection point name must be the name of the attribute to use
     * Can only be set on inputs
     */
    get isAttribute() {
        return this._mode === 1 /* NodeMaterialBlockConnectionPointMode.Attribute */;
    }
    set isAttribute(value) {
        this._mode = value ? 1 /* NodeMaterialBlockConnectionPointMode.Attribute */ : 3 /* NodeMaterialBlockConnectionPointMode.Undefined */;
        this.associatedVariableName = "";
    }
    /**
     * Gets or sets a boolean indicating that this connection point is generating a varying variable.
     * Can only be set on exit points
     */
    get isVarying() {
        return this._mode === 2 /* NodeMaterialBlockConnectionPointMode.Varying */;
    }
    set isVarying(value) {
        this._mode = value ? 2 /* NodeMaterialBlockConnectionPointMode.Varying */ : 3 /* NodeMaterialBlockConnectionPointMode.Undefined */;
        this.associatedVariableName = "";
    }
    /**
     * Gets a boolean indicating that the current connection point is a system value
     */
    get isSystemValue() {
        return this._systemValue != null;
    }
    /**
     * Gets or sets the current well known value or null if not defined as a system value
     */
    get systemValue() {
        return this._systemValue;
    }
    set systemValue(value) {
        this._mode = 0 /* NodeMaterialBlockConnectionPointMode.Uniform */;
        this.associatedVariableName = "";
        this._systemValue = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "InputBlock";
    }
    /**
     * Animate the input if animationType !== None
     * @param scene defines the rendering scene
     */
    animate(scene) {
        switch (this._animationType) {
            case AnimatedInputBlockTypes.Time: {
                if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {
                    this.value += scene.getAnimationRatio() * 0.01;
                }
                break;
            }
            case AnimatedInputBlockTypes.RealTime: {
                if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {
                    this.value = (precisionDate/* PrecisionDate */.j.Now - scene.getEngine().startTime) / 1000;
                }
                break;
            }
            case AnimatedInputBlockTypes.MouseInfo: {
                if (this.type === NodeMaterialBlockConnectionPointTypes.Vector4) {
                    const event = scene._inputManager._originMouseEvent;
                    if (event) {
                        const x = event.offsetX;
                        const y = event.offsetY;
                        const z = (event.buttons & 1) != 0 ? 1 : 0;
                        const w = (event.buttons & 2) != 0 ? 1 : 0;
                        this.value = new math_vector/* Vector4 */.IU(x, y, z, w);
                    }
                    else {
                        this.value = new math_vector/* Vector4 */.IU(0, 0, 0, 0);
                    }
                }
                break;
            }
        }
    }
    _emitDefine(define) {
        if (define[0] === "!") {
            return `#ifndef ${define.substring(1)}\n`;
        }
        return `#ifdef ${define}\n`;
    }
    initialize() {
        this.associatedVariableName = "";
    }
    /**
     * Set the input block to its default value (based on its type)
     */
    setDefaultValue() {
        switch (this.type) {
            case NodeMaterialBlockConnectionPointTypes.Float:
                this.value = 0;
                break;
            case NodeMaterialBlockConnectionPointTypes.Vector2:
                this.value = math_vector/* Vector2 */.I9.Zero();
                break;
            case NodeMaterialBlockConnectionPointTypes.Vector3:
                this.value = math_vector/* Vector3 */.Pq.Zero();
                break;
            case NodeMaterialBlockConnectionPointTypes.Vector4:
                this.value = math_vector/* Vector4 */.IU.Zero();
                break;
            case NodeMaterialBlockConnectionPointTypes.Color3:
                this.value = math/* Color3 */.v9.White();
                break;
            case NodeMaterialBlockConnectionPointTypes.Color4:
                this.value = new math/* Color4 */.ov(1, 1, 1, 1);
                break;
            case NodeMaterialBlockConnectionPointTypes.Matrix:
                this.value = math_vector/* Matrix */.uq.Identity();
                break;
        }
    }
    _emitConstant(state) {
        switch (this.type) {
            case NodeMaterialBlockConnectionPointTypes.Float:
                return `${state._emitFloat(this.value)}`;
            case NodeMaterialBlockConnectionPointTypes.Vector2:
                return `vec2(${this.value.x}, ${this.value.y})`;
            case NodeMaterialBlockConnectionPointTypes.Vector3:
                return `vec3(${this.value.x}, ${this.value.y}, ${this.value.z})`;
            case NodeMaterialBlockConnectionPointTypes.Vector4:
                return `vec4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;
            case NodeMaterialBlockConnectionPointTypes.Color3:
                math/* TmpColors */.IG.Color3[0].set(this.value.r, this.value.g, this.value.b);
                if (this.convertToGammaSpace) {
                    math/* TmpColors */.IG.Color3[0].toGammaSpaceToRef(math/* TmpColors */.IG.Color3[0], state.sharedData.scene.getEngine().useExactSrgbConversions);
                }
                if (this.convertToLinearSpace) {
                    math/* TmpColors */.IG.Color3[0].toLinearSpaceToRef(math/* TmpColors */.IG.Color3[0], state.sharedData.scene.getEngine().useExactSrgbConversions);
                }
                return `vec3(${math/* TmpColors */.IG.Color3[0].r}, ${math/* TmpColors */.IG.Color3[0].g}, ${math/* TmpColors */.IG.Color3[0].b})`;
            case NodeMaterialBlockConnectionPointTypes.Color4:
                math/* TmpColors */.IG.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a);
                if (this.convertToGammaSpace) {
                    math/* TmpColors */.IG.Color4[0].toGammaSpaceToRef(math/* TmpColors */.IG.Color4[0], state.sharedData.scene.getEngine().useExactSrgbConversions);
                }
                if (this.convertToLinearSpace) {
                    math/* TmpColors */.IG.Color4[0].toLinearSpaceToRef(math/* TmpColors */.IG.Color4[0], state.sharedData.scene.getEngine().useExactSrgbConversions);
                }
                return `vec4(${math/* TmpColors */.IG.Color4[0].r}, ${math/* TmpColors */.IG.Color4[0].g}, ${math/* TmpColors */.IG.Color4[0].b}, ${math/* TmpColors */.IG.Color4[0].a})`;
        }
        return "";
    }
    /** @internal */
    get _noContextSwitch() {
        return attributeInFragmentOnly[this.name];
    }
    _emit(state, define) {
        // Uniforms
        if (this.isUniform) {
            if (!this._associatedVariableName) {
                this._associatedVariableName = state._getFreeVariableName("u_" + this.name);
            }
            if (this.isConstant) {
                if (state.constants.indexOf(this.associatedVariableName) !== -1) {
                    return;
                }
                state.constants.push(this.associatedVariableName);
                state._constantDeclaration += state._declareOutput(this.output, true) + ` = ${this._emitConstant(state)};\n`;
                return;
            }
            if (state.uniforms.indexOf(this.associatedVariableName) !== -1) {
                return;
            }
            state.uniforms.push(this.associatedVariableName);
            if (define) {
                state._uniformDeclaration += this._emitDefine(define);
            }
            const shaderType = state._getShaderType(this.type);
            if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                state._uniformDeclaration += `uniform ${this._associatedVariableName}: ${shaderType};\n`;
                this._prefix = "uniforms.";
            }
            else {
                state._uniformDeclaration += `uniform ${shaderType} ${this.associatedVariableName};\n`;
            }
            if (define) {
                state._uniformDeclaration += `#endif\n`;
            }
            // well known
            const hints = state.sharedData.hints;
            if (this._systemValue !== null && this._systemValue !== undefined) {
                switch (this._systemValue) {
                    case NodeMaterialSystemValues.WorldView:
                        hints.needWorldViewMatrix = true;
                        break;
                    case NodeMaterialSystemValues.WorldViewProjection:
                        hints.needWorldViewProjectionMatrix = true;
                        break;
                }
            }
            else {
                if (this._animationType !== AnimatedInputBlockTypes.None) {
                    state.sharedData.animatedInputs.push(this);
                }
            }
            return;
        }
        // Attribute
        if (this.isAttribute) {
            this.associatedVariableName = remapAttributeName[this.name] ?? this.name;
            if (this.target === NodeMaterialBlockTargets.Vertex && state._vertexState) {
                // Attribute for fragment need to be carried over by varyings
                if (attributeInFragmentOnly[this.name]) {
                    if (attributeAsUniform[this.name]) {
                        state._emitUniformFromString(this.declarationVariableName, this.type, define);
                        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                            this._prefix = `vertexInputs.`;
                        }
                    }
                    else {
                        state._emitVaryingFromString(this.declarationVariableName, this.type, define);
                    }
                }
                else {
                    this._emit(state._vertexState, define);
                }
                return;
            }
            const alreadyDeclared = state.attributes.indexOf(this.declarationVariableName) !== -1;
            if (!alreadyDeclared) {
                state.attributes.push(this.declarationVariableName);
            }
            if (attributeInFragmentOnly[this.name]) {
                if (attributeAsUniform[this.name]) {
                    if (!alreadyDeclared) {
                        state._emitUniformFromString(this.declarationVariableName, this.type, define);
                    }
                    if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                        this._prefix = `uniforms.`;
                    }
                }
                else {
                    if (!alreadyDeclared) {
                        state._emitVaryingFromString(this.declarationVariableName, this.type, define);
                    }
                    if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                        this._prefix = `fragmentInputs.`;
                    }
                }
            }
            else {
                if (define && !alreadyDeclared) {
                    state._attributeDeclaration += this._emitDefine(define);
                }
                if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    if (!alreadyDeclared) {
                        state._attributeDeclaration += `attribute ${this.declarationVariableName}: ${state._getShaderType(this.type)};\n`;
                    }
                    this._prefix = `vertexInputs.`;
                }
                else {
                    if (!alreadyDeclared) {
                        state._attributeDeclaration += `attribute ${state._getShaderType(this.type)} ${this.declarationVariableName};\n`;
                    }
                }
                if (define && !alreadyDeclared) {
                    state._attributeDeclaration += `#endif\n`;
                }
            }
        }
    }
    /**
     * @internal
     */
    _transmitWorld(effect, world, worldView, worldViewProjection) {
        if (!this._systemValue) {
            return;
        }
        const variableName = this._associatedVariableName;
        switch (this._systemValue) {
            case NodeMaterialSystemValues.World:
                effect.setMatrix(variableName, world);
                break;
            case NodeMaterialSystemValues.WorldView:
                effect.setMatrix(variableName, worldView);
                break;
            case NodeMaterialSystemValues.WorldViewProjection:
                effect.setMatrix(variableName, worldViewProjection);
                break;
        }
    }
    /**
     * @internal
     */
    _transmit(effect, scene, material) {
        if (this.isAttribute) {
            return;
        }
        const variableName = this._associatedVariableName;
        if (this._systemValue) {
            switch (this._systemValue) {
                case NodeMaterialSystemValues.World:
                case NodeMaterialSystemValues.WorldView:
                case NodeMaterialSystemValues.WorldViewProjection:
                    return;
                case NodeMaterialSystemValues.View:
                    effect.setMatrix(variableName, scene.getViewMatrix());
                    break;
                case NodeMaterialSystemValues.Projection:
                    effect.setMatrix(variableName, scene.getProjectionMatrix());
                    break;
                case NodeMaterialSystemValues.ViewProjection:
                    effect.setMatrix(variableName, scene.getTransformMatrix());
                    break;
                case NodeMaterialSystemValues.CameraPosition:
                    scene.bindEyePosition(effect, variableName, true);
                    break;
                case NodeMaterialSystemValues.FogColor:
                    effect.setColor3(variableName, scene.fogColor);
                    break;
                case NodeMaterialSystemValues.DeltaTime:
                    effect.setFloat(variableName, scene.deltaTime / 1000.0);
                    break;
                case NodeMaterialSystemValues.CameraParameters:
                    if (scene.activeCamera) {
                        effect.setFloat4(variableName, scene.getEngine().hasOriginBottomLeft ? -1 : 1, scene.activeCamera.minZ, scene.activeCamera.maxZ, 1 / scene.activeCamera.maxZ);
                    }
                    break;
                case NodeMaterialSystemValues.MaterialAlpha:
                    effect.setFloat(variableName, material.alpha);
                    break;
            }
            return;
        }
        const value = this._valueCallback ? this._valueCallback() : this._storedValue;
        if (value === null) {
            return;
        }
        switch (this.type) {
            case NodeMaterialBlockConnectionPointTypes.Float:
                effect.setFloat(variableName, value);
                break;
            case NodeMaterialBlockConnectionPointTypes.Int:
                effect.setInt(variableName, value);
                break;
            case NodeMaterialBlockConnectionPointTypes.Color3:
                math/* TmpColors */.IG.Color3[0].set(this.value.r, this.value.g, this.value.b);
                if (this.convertToGammaSpace) {
                    math/* TmpColors */.IG.Color3[0].toGammaSpaceToRef(math/* TmpColors */.IG.Color3[0], scene.getEngine().useExactSrgbConversions);
                }
                if (this.convertToLinearSpace) {
                    math/* TmpColors */.IG.Color3[0].toLinearSpaceToRef(math/* TmpColors */.IG.Color3[0], scene.getEngine().useExactSrgbConversions);
                }
                effect.setColor3(variableName, math/* TmpColors */.IG.Color3[0]);
                break;
            case NodeMaterialBlockConnectionPointTypes.Color4:
                math/* TmpColors */.IG.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a);
                if (this.convertToGammaSpace) {
                    math/* TmpColors */.IG.Color4[0].toGammaSpaceToRef(math/* TmpColors */.IG.Color4[0], scene.getEngine().useExactSrgbConversions);
                }
                if (this.convertToLinearSpace) {
                    math/* TmpColors */.IG.Color4[0].toLinearSpaceToRef(math/* TmpColors */.IG.Color4[0], scene.getEngine().useExactSrgbConversions);
                }
                effect.setDirectColor4(variableName, math/* TmpColors */.IG.Color4[0]);
                break;
            case NodeMaterialBlockConnectionPointTypes.Vector2:
                effect.setVector2(variableName, value);
                break;
            case NodeMaterialBlockConnectionPointTypes.Vector3:
                effect.setVector3(variableName, value);
                break;
            case NodeMaterialBlockConnectionPointTypes.Vector4:
                effect.setVector4(variableName, value);
                break;
            case NodeMaterialBlockConnectionPointTypes.Matrix:
                effect.setMatrix(variableName, value);
                break;
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (this.isUniform || this.isSystemValue) {
            state.sharedData.inputBlocks.push(this);
        }
        this._emit(state);
    }
    _dumpPropertiesCode() {
        const variableName = this._codeVariableName;
        if (this.isAttribute) {
            return super._dumpPropertiesCode() + `${variableName}.setAsAttribute("${this.name}");\n`;
        }
        if (this.isSystemValue) {
            return super._dumpPropertiesCode() + `${variableName}.setAsSystemValue(BABYLON.NodeMaterialSystemValues.${NodeMaterialSystemValues[this._systemValue]});\n`;
        }
        if (this.isUniform) {
            const codes = [];
            let valueString = "";
            switch (this.type) {
                case NodeMaterialBlockConnectionPointTypes.Float:
                    valueString = `${this.value}`;
                    break;
                case NodeMaterialBlockConnectionPointTypes.Vector2:
                    valueString = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;
                    break;
                case NodeMaterialBlockConnectionPointTypes.Vector3:
                    valueString = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;
                    break;
                case NodeMaterialBlockConnectionPointTypes.Vector4:
                    valueString = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;
                    break;
                case NodeMaterialBlockConnectionPointTypes.Color3:
                    valueString = `new BABYLON.Color3(${this.value.r}, ${this.value.g}, ${this.value.b})`;
                    if (this.convertToGammaSpace) {
                        valueString += ".toGammaSpace()";
                    }
                    if (this.convertToLinearSpace) {
                        valueString += ".toLinearSpace()";
                    }
                    break;
                case NodeMaterialBlockConnectionPointTypes.Color4:
                    valueString = `new BABYLON.Color4(${this.value.r}, ${this.value.g}, ${this.value.b}, ${this.value.a})`;
                    if (this.convertToGammaSpace) {
                        valueString += ".toGammaSpace()";
                    }
                    if (this.convertToLinearSpace) {
                        valueString += ".toLinearSpace()";
                    }
                    break;
                case NodeMaterialBlockConnectionPointTypes.Matrix:
                    valueString = `BABYLON.Matrix.FromArray([${this.value.m}])`;
                    break;
            }
            // Common Property "Value"
            codes.push(`${variableName}.value = ${valueString}`);
            // Float-Value-Specific Properties
            if (this.type === NodeMaterialBlockConnectionPointTypes.Float) {
                codes.push(`${variableName}.min = ${this.min}`, `${variableName}.max = ${this.max}`, `${variableName}.isBoolean = ${this.isBoolean}`, `${variableName}.matrixMode = ${this.matrixMode}`, `${variableName}.animationType = BABYLON.AnimatedInputBlockTypes.${AnimatedInputBlockTypes[this.animationType]}`);
            }
            // Common Property "Type"
            codes.push(`${variableName}.isConstant = ${this.isConstant}`);
            codes.push("");
            return super._dumpPropertiesCode() + codes.join(";\n");
        }
        return super._dumpPropertiesCode();
    }
    dispose() {
        this.onValueChangedObservable.clear();
        super.dispose();
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.type = this.type;
        serializationObject.mode = this._mode;
        serializationObject.systemValue = this._systemValue;
        serializationObject.animationType = this._animationType;
        serializationObject.min = this.min;
        serializationObject.max = this.max;
        serializationObject.isBoolean = this.isBoolean;
        serializationObject.matrixMode = this.matrixMode;
        serializationObject.isConstant = this.isConstant;
        serializationObject.groupInInspector = this.groupInInspector;
        serializationObject.convertToGammaSpace = this.convertToGammaSpace;
        serializationObject.convertToLinearSpace = this.convertToLinearSpace;
        if (this._storedValue != null && this._mode === 0 /* NodeMaterialBlockConnectionPointMode.Uniform */) {
            if (this._storedValue.asArray) {
                serializationObject.valueType = "BABYLON." + this._storedValue.getClassName();
                serializationObject.value = this._storedValue.asArray();
            }
            else {
                serializationObject.valueType = "number";
                serializationObject.value = this._storedValue;
            }
        }
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        this._mode = serializationObject.mode;
        super._deserialize(serializationObject, scene, rootUrl);
        this._type = serializationObject.type;
        this._systemValue = serializationObject.systemValue || serializationObject.wellKnownValue;
        this._animationType = serializationObject.animationType;
        this.min = serializationObject.min || 0;
        this.max = serializationObject.max || 0;
        this.isBoolean = !!serializationObject.isBoolean;
        this.matrixMode = serializationObject.matrixMode || 0;
        this.isConstant = !!serializationObject.isConstant;
        this.groupInInspector = serializationObject.groupInInspector || "";
        this.convertToGammaSpace = !!serializationObject.convertToGammaSpace;
        this.convertToLinearSpace = !!serializationObject.convertToLinearSpace;
        // Tangents back compat
        if (serializationObject.name === "tangent" &&
            serializationObject.mode === 1 /* NodeMaterialBlockConnectionPointMode.Attribute */ &&
            serializationObject.type === NodeMaterialBlockConnectionPointTypes.Vector3) {
            this._type = NodeMaterialBlockConnectionPointTypes.Vector4;
        }
        if (!serializationObject.valueType) {
            return;
        }
        if (serializationObject.valueType === "number") {
            this._storedValue = serializationObject.value;
        }
        else {
            const valueType = (0,typeStore/* GetClass */.n9)(serializationObject.valueType);
            if (valueType) {
                this._storedValue = valueType.FromArray(serializationObject.value);
            }
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.InputBlock", InputBlock);
//# sourceMappingURL=inputBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/currentScreenBlock.js






/**
 * Base block used as input for post process
 */
class CurrentScreenBlock extends NodeMaterialBlock {
    /**
     * Create a new CurrentScreenBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.VertexAndFragment);
        this._samplerName = "textureSampler";
        /**
         * Gets or sets a boolean indicating if content needs to be converted to gamma space
         */
        this.convertToGammaSpace = false;
        /**
         * Gets or sets a boolean indicating if content needs to be converted to linear space
         */
        this.convertToLinearSpace = false;
        this._isUnique = false;
        this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.VertexAndFragment);
        this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
        this._inputs[0]._prioritizeVertex = false;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "CurrentScreenBlock";
    }
    /**
     * Gets the uv input component
     */
    get uv() {
        return this._inputs[0];
    }
    /**
     * Gets the rgba output component
     */
    get rgba() {
        return this._outputs[0];
    }
    /**
     * Gets the rgb output component
     */
    get rgb() {
        return this._outputs[1];
    }
    /**
     * Gets the r output component
     */
    get r() {
        return this._outputs[2];
    }
    /**
     * Gets the g output component
     */
    get g() {
        return this._outputs[3];
    }
    /**
     * Gets the b output component
     */
    get b() {
        return this._outputs[4];
    }
    /**
     * Gets the a output component
     */
    get a() {
        return this._outputs[5];
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName(this._samplerName);
    }
    get target() {
        if (!this.uv.isConnected) {
            return NodeMaterialBlockTargets.VertexAndFragment;
        }
        if (this.uv.sourceBlock.isInput) {
            return NodeMaterialBlockTargets.VertexAndFragment;
        }
        return NodeMaterialBlockTargets.Fragment;
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        defines.setValue(this._linearDefineName, this.convertToGammaSpace, true);
        defines.setValue(this._gammaDefineName, this.convertToLinearSpace, true);
    }
    isReady() {
        if (this.texture && !this.texture.isReadyOrNotBlocking()) {
            return false;
        }
        return true;
    }
    _injectVertexCode(state) {
        const uvInput = this.uv;
        if (uvInput.connectedPoint.ownerBlock.isInput) {
            const uvInputOwnerBlock = uvInput.connectedPoint.ownerBlock;
            if (!uvInputOwnerBlock.isAttribute) {
                state._emitUniformFromString(uvInput.associatedVariableName, NodeMaterialBlockConnectionPointTypes.Vector2);
            }
        }
        this._mainUVName = "vMain" + uvInput.associatedVariableName;
        state._emitVaryingFromString(this._mainUVName, NodeMaterialBlockConnectionPointTypes.Vector2);
        state.compilationString += `${this._mainUVName} = ${uvInput.associatedVariableName}.xy;\n`;
        if (!this._outputs.some((o) => o.isConnectedInVertexShader)) {
            return;
        }
        this._writeTextureRead(state, true);
        for (const output of this._outputs) {
            if (output.hasEndpoints) {
                this._writeOutput(state, output, output.name, true);
            }
        }
    }
    _writeTextureRead(state, vertexMode = false) {
        const uvInput = this.uv;
        if (vertexMode) {
            if (state.target === NodeMaterialBlockTargets.Fragment) {
                return;
            }
            const textureReadFunc = state.shaderLanguage === 0 /* ShaderLanguage.GLSL */
                ? `texture2D(${this._samplerName},`
                : `textureSampleLevel(${this._samplerName}, ${this._samplerName + `Sampler`},`;
            const complement = state.shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? "" : ", 0";
            state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${textureReadFunc} ${uvInput.associatedVariableName}${complement});\n`;
            return;
        }
        const textureReadFunc = state.shaderLanguage === 0 /* ShaderLanguage.GLSL */
            ? `texture2D(${this._samplerName},`
            : `textureSample(${this._samplerName}, ${this._samplerName + `Sampler`},`;
        if (this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment) {
            state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${textureReadFunc} ${uvInput.associatedVariableName});\n`;
            return;
        }
        state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${textureReadFunc} ${this._mainUVName});\n`;
    }
    _writeOutput(state, output, swizzle, vertexMode = false) {
        if (vertexMode) {
            if (state.target === NodeMaterialBlockTargets.Fragment) {
                return;
            }
            state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle};\n`;
            return;
        }
        if (this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment) {
            state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle};\n`;
            return;
        }
        state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle};\n`;
        state.compilationString += `#ifdef ${this._linearDefineName}\n`;
        state.compilationString += `${output.associatedVariableName} = toGammaSpace(${output.associatedVariableName});\n`;
        state.compilationString += `#endif\n`;
        state.compilationString += `#ifdef ${this._gammaDefineName}\n`;
        state.compilationString += `${output.associatedVariableName} = toLinearSpace(${output.associatedVariableName});\n`;
        state.compilationString += `#endif\n`;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._tempTextureRead = state._getFreeVariableName("tempTextureRead");
        if (state.sharedData.blockingBlocks.indexOf(this) < 0) {
            state.sharedData.blockingBlocks.push(this);
        }
        if (state.sharedData.textureBlocks.indexOf(this) < 0) {
            state.sharedData.textureBlocks.push(this);
        }
        if (state.sharedData.blocksWithDefines.indexOf(this) < 0) {
            state.sharedData.blocksWithDefines.push(this);
        }
        if (state.target !== NodeMaterialBlockTargets.Fragment) {
            // Vertex
            state._emit2DSampler(this._samplerName);
            this._injectVertexCode(state);
            return;
        }
        // Fragment
        if (!this._outputs.some((o) => o.isConnectedInFragmentShader)) {
            return;
        }
        state._emit2DSampler(this._samplerName);
        this._linearDefineName = state._getFreeDefineName("ISLINEAR");
        this._gammaDefineName = state._getFreeDefineName("ISGAMMA");
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("helperFunctions", comments);
        this._writeTextureRead(state);
        for (const output of this._outputs) {
            if (output.hasEndpoints) {
                this._writeOutput(state, output, output.name);
            }
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.convertToGammaSpace = this.convertToGammaSpace;
        serializationObject.convertToLinearSpace = this.convertToLinearSpace;
        if (this.texture && !this.texture.isRenderTarget) {
            serializationObject.texture = this.texture.serialize();
        }
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.convertToGammaSpace = serializationObject.convertToGammaSpace;
        this.convertToLinearSpace = !!serializationObject.convertToLinearSpace;
        if (serializationObject.texture) {
            rootUrl = serializationObject.texture.url.indexOf("data:") === 0 ? "" : rootUrl;
            this.texture = Textures_texture/* Texture */.g.Parse(serializationObject.texture, scene, rootUrl);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CurrentScreenBlock", CurrentScreenBlock);
//# sourceMappingURL=currentScreenBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/particleTextureBlock.js






/**
 * Base block used for the particle texture
 */
class ParticleTextureBlock extends NodeMaterialBlock {
    /**
     * Create a new ParticleTextureBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this._samplerName = "diffuseSampler";
        /**
         * Gets or sets a boolean indicating if content needs to be converted to gamma space
         */
        this.convertToGammaSpace = false;
        /**
         * Gets or sets a boolean indicating if content needs to be converted to linear space
         */
        this.convertToLinearSpace = false;
        this._isUnique = false;
        this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.VertexAndFragment);
        this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ParticleTextureBlock";
    }
    /**
     * Gets the uv input component
     */
    get uv() {
        return this._inputs[0];
    }
    /**
     * Gets the rgba output component
     */
    get rgba() {
        return this._outputs[0];
    }
    /**
     * Gets the rgb output component
     */
    get rgb() {
        return this._outputs[1];
    }
    /**
     * Gets the r output component
     */
    get r() {
        return this._outputs[2];
    }
    /**
     * Gets the g output component
     */
    get g() {
        return this._outputs[3];
    }
    /**
     * Gets the b output component
     */
    get b() {
        return this._outputs[4];
    }
    /**
     * Gets the a output component
     */
    get a() {
        return this._outputs[5];
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("diffuseSampler");
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.uv.isConnected) {
            let uvInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "particle_uv" && additionalFilteringInfo(b));
            if (!uvInput) {
                uvInput = new InputBlock("uv");
                uvInput.setAsAttribute("particle_uv");
            }
            uvInput.output.connectTo(this.uv);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        defines.setValue(this._linearDefineName, this.convertToGammaSpace, true);
        defines.setValue(this._gammaDefineName, this.convertToLinearSpace, true);
    }
    isReady() {
        if (this.texture && !this.texture.isReadyOrNotBlocking()) {
            return false;
        }
        return true;
    }
    _writeOutput(state, output, swizzle) {
        state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle};\n`;
        state.compilationString += `#ifdef ${this._linearDefineName}\n`;
        state.compilationString += `${output.associatedVariableName} = toGammaSpace(${output.associatedVariableName});\n`;
        state.compilationString += `#endif\n`;
        state.compilationString += `#ifdef ${this._gammaDefineName}\n`;
        state.compilationString += `${output.associatedVariableName} = toLinearSpace(${output.associatedVariableName});\n`;
        state.compilationString += `#endif\n`;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Vertex) {
            return;
        }
        this._tempTextureRead = state._getFreeVariableName("tempTextureRead");
        state._emit2DSampler(this._samplerName);
        state.sharedData.blockingBlocks.push(this);
        state.sharedData.textureBlocks.push(this);
        state.sharedData.blocksWithDefines.push(this);
        this._linearDefineName = state._getFreeDefineName("ISLINEAR");
        this._gammaDefineName = state._getFreeDefineName("ISGAMMA");
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("helperFunctions", comments);
        state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${state._generateTextureSample(this.uv.associatedVariableName, this._samplerName)};\n`;
        for (const output of this._outputs) {
            if (output.hasEndpoints) {
                this._writeOutput(state, output, output.name);
            }
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.convertToGammaSpace = this.convertToGammaSpace;
        serializationObject.convertToLinearSpace = this.convertToLinearSpace;
        if (this.texture && !this.texture.isRenderTarget) {
            serializationObject.texture = this.texture.serialize();
        }
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.convertToGammaSpace = serializationObject.convertToGammaSpace;
        this.convertToLinearSpace = !!serializationObject.convertToLinearSpace;
        if (serializationObject.texture) {
            rootUrl = serializationObject.texture.url.indexOf("data:") === 0 ? "" : rootUrl;
            this.texture = Textures_texture/* Texture */.g.Parse(serializationObject.texture, scene, rootUrl);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ParticleTextureBlock", ParticleTextureBlock);
//# sourceMappingURL=particleTextureBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/particleRampGradientBlock.js




/**
 * Block used for the particle ramp gradient section
 */
class ParticleRampGradientBlock extends NodeMaterialBlock {
    /**
     * Create a new ParticleRampGradientBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this._isUnique = true;
        this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color4, false, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("rampColor", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ParticleRampGradientBlock";
    }
    /**
     * Gets the color input component
     */
    get color() {
        return this._inputs[0];
    }
    /**
     * Gets the rampColor output component
     */
    get rampColor() {
        return this._outputs[0];
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("remapRanges");
        state._excludeVariableName("rampSampler");
        state._excludeVariableName("baseColor");
        state._excludeVariableName("alpha");
        state._excludeVariableName("remappedColorIndex");
        state._excludeVariableName("rampColor");
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Vertex) {
            return;
        }
        state._emit2DSampler("rampSampler", "RAMPGRADIENT");
        state._emitVaryingFromString("remapRanges", NodeMaterialBlockConnectionPointTypes.Vector4, "RAMPGRADIENT");
        state.compilationString += `
            #ifdef RAMPGRADIENT
                ${state._declareLocalVar("baseColor", NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this.color.associatedVariableName};
                ${state._declareLocalVar("alpha", NodeMaterialBlockConnectionPointTypes.Float)} = ${this.color.associatedVariableName}.a;

                ${state._declareLocalVar("remappedColorIndex", NodeMaterialBlockConnectionPointTypes.Float)} = clamp((alpha - remapRanges.x) / remapRanges.y, 0.0, 1.0);

                ${state._declareLocalVar("rampColor", NodeMaterialBlockConnectionPointTypes.Vector4)} = ${state._generateTextureSample("vec2(1.0 - remappedColorIndex, 0.)", "rampSampler")};

                // Remapped alpha
                ${state._declareOutput(this.rampColor)} = vec4${state.fSuffix}(baseColor.rgb * rampColor.rgb, clamp((alpha * rampColor.a - remapRanges.z) / remapRanges.w, 0.0, 1.0));
            #else
                ${state._declareOutput(this.rampColor)} = ${this.color.associatedVariableName};
            #endif
        `;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ParticleRampGradientBlock", ParticleRampGradientBlock);
//# sourceMappingURL=particleRampGradientBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js




/**
 * Block used for the particle blend multiply section
 */
class ParticleBlendMultiplyBlock extends NodeMaterialBlock {
    /**
     * Create a new ParticleBlendMultiplyBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this._isUnique = true;
        this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color4, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("alphaTexture", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("alphaColor", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("blendColor", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ParticleBlendMultiplyBlock";
    }
    /**
     * Gets the color input component
     */
    get color() {
        return this._inputs[0];
    }
    /**
     * Gets the alphaTexture input component
     */
    get alphaTexture() {
        return this._inputs[1];
    }
    /**
     * Gets the alphaColor input component
     */
    get alphaColor() {
        return this._inputs[2];
    }
    /**
     * Gets the blendColor output component
     */
    get blendColor() {
        return this._outputs[0];
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("sourceAlpha");
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Vertex) {
            return;
        }
        state.compilationString += `
            #ifdef BLENDMULTIPLYMODE
                ${state._declareOutput(this.blendColor)};
                ${state._declareLocalVar("sourceAlpha", NodeMaterialBlockConnectionPointTypes.Float)}  = ${this.alphaColor.associatedVariableName} * ${this.alphaTexture.associatedVariableName};
                ${this.blendColor.associatedVariableName} = vec4${state.fSuffix}(${this.color.associatedVariableName}.rgb * sourceAlpha + vec3(1.0) * (1.0 - sourceAlpha), ${this.color.associatedVariableName}.a);
            #else
                ${state._declareOutput(this.blendColor)} = ${this.color.associatedVariableName};
            #endif
        `;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ParticleBlendMultiplyBlock", ParticleBlendMultiplyBlock);
//# sourceMappingURL=particleBlendMultiplyBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/vectorMergerBlock.js




/**
 * Block used to create a Vector2/3/4 out of individual inputs (one for each component)
 */
class VectorMergerBlock extends NodeMaterialBlock {
    /**
     * Create a new VectorMergerBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Gets or sets the swizzle for x (meaning which component to affect to the output.x)
         */
        this.xSwizzle = "x";
        /**
         * Gets or sets the swizzle for y (meaning which component to affect to the output.y)
         */
        this.ySwizzle = "y";
        /**
         * Gets or sets the swizzle for z (meaning which component to affect to the output.z)
         */
        this.zSwizzle = "z";
        /**
         * Gets or sets the swizzle for w (meaning which component to affect to the output.w)
         */
        this.wSwizzle = "w";
        this.registerInput("xyzw ", NodeMaterialBlockConnectionPointTypes.Vector4, true);
        this.registerInput("xyz ", NodeMaterialBlockConnectionPointTypes.Vector3, true);
        this.registerInput("xy ", NodeMaterialBlockConnectionPointTypes.Vector2, true);
        this.registerInput("zw ", NodeMaterialBlockConnectionPointTypes.Vector2, true);
        this.registerInput("x", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("y", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("z", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("w", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerOutput("xyzw", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerOutput("zw", NodeMaterialBlockConnectionPointTypes.Vector2);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "VectorMergerBlock";
    }
    /**
     * Gets the xyzw component (input)
     */
    get xyzwIn() {
        return this._inputs[0];
    }
    /**
     * Gets the xyz component (input)
     */
    get xyzIn() {
        return this._inputs[1];
    }
    /**
     * Gets the xy component (input)
     */
    get xyIn() {
        return this._inputs[2];
    }
    /**
     * Gets the zw component (input)
     */
    get zwIn() {
        return this._inputs[3];
    }
    /**
     * Gets the x component (input)
     */
    get x() {
        return this._inputs[4];
    }
    /**
     * Gets the y component (input)
     */
    get y() {
        return this._inputs[5];
    }
    /**
     * Gets the z component (input)
     */
    get z() {
        return this._inputs[6];
    }
    /**
     * Gets the w component (input)
     */
    get w() {
        return this._inputs[7];
    }
    /**
     * Gets the xyzw component (output)
     */
    get xyzw() {
        return this._outputs[0];
    }
    /**
     * Gets the xyz component (output)
     */
    get xyzOut() {
        return this._outputs[1];
    }
    /**
     * Gets the xy component (output)
     */
    get xyOut() {
        return this._outputs[2];
    }
    /**
     * Gets the zw component (output)
     */
    get zwOut() {
        return this._outputs[3];
    }
    /**
     * Gets the xy component (output)
     * @deprecated Please use xyOut instead.
     */
    get xy() {
        return this.xyOut;
    }
    /**
     * Gets the xyz component (output)
     * @deprecated Please use xyzOut instead.
     */
    get xyz() {
        return this.xyzOut;
    }
    _inputRename(name) {
        if (name === "xyzw ") {
            return "xyzwIn";
        }
        if (name === "xyz ") {
            return "xyzIn";
        }
        if (name === "xy ") {
            return "xyIn";
        }
        if (name === "zw ") {
            return "zwIn";
        }
        return name;
    }
    _buildSwizzle(len) {
        const swizzle = this.xSwizzle + this.ySwizzle + this.zSwizzle + this.wSwizzle;
        return "." + swizzle.substring(0, len);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const xInput = this.x;
        const yInput = this.y;
        const zInput = this.z;
        const wInput = this.w;
        const xyInput = this.xyIn;
        const zwInput = this.zwIn;
        const xyzInput = this.xyzIn;
        const xyzwInput = this.xyzwIn;
        const v4Output = this._outputs[0];
        const v3Output = this._outputs[1];
        const v2Output = this._outputs[2];
        const v2CompOutput = this._outputs[3];
        const vec4 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector4);
        const vec3 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector3);
        const vec2 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector2);
        if (xyzwInput.isConnected) {
            if (v4Output.hasEndpoints) {
                state.compilationString += state._declareOutput(v4Output) + ` = ${xyzwInput.associatedVariableName}${this._buildSwizzle(4)};\n`;
            }
            if (v3Output.hasEndpoints) {
                state.compilationString += state._declareOutput(v3Output) + ` = ${xyzwInput.associatedVariableName}${this._buildSwizzle(3)};\n`;
            }
            if (v2Output.hasEndpoints) {
                state.compilationString += state._declareOutput(v2Output) + ` = ${xyzwInput.associatedVariableName}${this._buildSwizzle(2)};\n`;
            }
        }
        else if (xyzInput.isConnected) {
            if (v4Output.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(v4Output) +
                        ` = ${vec4}(${xyzInput.associatedVariableName}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(4)};\n`;
            }
            if (v3Output.hasEndpoints) {
                state.compilationString += state._declareOutput(v3Output) + ` = ${xyzInput.associatedVariableName}${this._buildSwizzle(3)};\n`;
            }
            if (v2Output.hasEndpoints) {
                state.compilationString += state._declareOutput(v2Output) + ` = ${xyzInput.associatedVariableName}${this._buildSwizzle(2)};\n`;
            }
        }
        else if (xyInput.isConnected) {
            if (v4Output.hasEndpoints) {
                if (zwInput.isConnected) {
                    state.compilationString +=
                        state._declareOutput(v4Output) + ` = ${vec4}(${xyInput.associatedVariableName}, ${zwInput.associatedVariableName})${this._buildSwizzle(4)};\n`;
                }
                else {
                    state.compilationString +=
                        state._declareOutput(v4Output) +
                            ` = ${vec4}(${xyInput.associatedVariableName}, ${zInput.isConnected ? this._writeVariable(zInput) : "0.0"}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(4)};\n`;
                }
            }
            if (v3Output.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(v3Output) +
                        ` = ${vec3}(${xyInput.associatedVariableName}, ${zInput.isConnected ? this._writeVariable(zInput) : "0.0"})${this._buildSwizzle(3)};\n`;
            }
            if (v2Output.hasEndpoints) {
                state.compilationString += state._declareOutput(v2Output) + ` = ${xyInput.associatedVariableName}${this._buildSwizzle(2)};\n`;
            }
            if (v2CompOutput.hasEndpoints) {
                if (zwInput.isConnected) {
                    state.compilationString += state._declareOutput(v2CompOutput) + ` = ${zwInput.associatedVariableName}${this._buildSwizzle(2)};\n`;
                }
                else {
                    state.compilationString +=
                        state._declareOutput(v2CompOutput) +
                            ` = ${vec2}(${zInput.isConnected ? this._writeVariable(zInput) : "0.0"}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(2)};\n`;
                }
            }
        }
        else {
            if (v4Output.hasEndpoints) {
                if (zwInput.isConnected) {
                    state.compilationString +=
                        state._declareOutput(v4Output) +
                            ` = ${vec4}(${xInput.isConnected ? this._writeVariable(xInput) : "0.0"}, ${yInput.isConnected ? this._writeVariable(yInput) : "0.0"}, ${zwInput.associatedVariableName})${this._buildSwizzle(4)};\n`;
                }
                else {
                    state.compilationString +=
                        state._declareOutput(v4Output) +
                            ` = ${vec4}(${xInput.isConnected ? this._writeVariable(xInput) : "0.0"}, ${yInput.isConnected ? this._writeVariable(yInput) : "0.0"}, ${zInput.isConnected ? this._writeVariable(zInput) : "0.0"}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(4)};\n`;
                }
            }
            if (v3Output.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(v3Output) +
                        ` = ${vec3}(${xInput.isConnected ? this._writeVariable(xInput) : "0.0"}, ${yInput.isConnected ? this._writeVariable(yInput) : "0.0"}, ${zInput.isConnected ? this._writeVariable(zInput) : "0.0"})${this._buildSwizzle(3)};\n`;
            }
            if (v2Output.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(v2Output) +
                        ` = ${vec2}(${xInput.isConnected ? this._writeVariable(xInput) : "0.0"}, ${yInput.isConnected ? this._writeVariable(yInput) : "0.0"})${this._buildSwizzle(2)};\n`;
            }
            if (v2CompOutput.hasEndpoints) {
                if (zwInput.isConnected) {
                    state.compilationString += state._declareOutput(v2CompOutput) + ` = ${zwInput.associatedVariableName}${this._buildSwizzle(2)};\n`;
                }
                else {
                    state.compilationString +=
                        state._declareOutput(v2CompOutput) +
                            ` = ${vec2}(${zInput.isConnected ? this._writeVariable(zInput) : "0.0"}, ${wInput.isConnected ? this._writeVariable(wInput) : "0.0"})${this._buildSwizzle(2)};\n`;
                }
            }
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.xSwizzle = this.xSwizzle;
        serializationObject.ySwizzle = this.ySwizzle;
        serializationObject.zSwizzle = this.zSwizzle;
        serializationObject.wSwizzle = this.wSwizzle;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.xSwizzle = serializationObject.xSwizzle ?? "x";
        this.ySwizzle = serializationObject.ySwizzle ?? "y";
        this.zSwizzle = serializationObject.zSwizzle ?? "z";
        this.wSwizzle = serializationObject.wSwizzle ?? "w";
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.xSwizzle = "${this.xSwizzle}";\n`;
        codeString += `${this._codeVariableName}.ySwizzle = "${this.ySwizzle}";\n`;
        codeString += `${this._codeVariableName}.zSwizzle = "${this.zSwizzle}";\n`;
        codeString += `${this._codeVariableName}.wSwizzle = "${this.wSwizzle}";\n`;
        return codeString;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.VectorMergerBlock", VectorMergerBlock);
//# sourceMappingURL=vectorMergerBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/remapBlock.js







/**
 * Block used to remap a float from a range to a new one
 */
class RemapBlock extends NodeMaterialBlock {
    /**
     * Creates a new RemapBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Gets or sets the source range
         */
        this.sourceRange = new math_vector/* Vector2 */.I9(-1, 1);
        /**
         * Gets or sets the target range
         */
        this.targetRange = new math_vector/* Vector2 */.I9(0, 1);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("sourceMin", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("sourceMax", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("targetMin", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("targetMax", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "RemapBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the source min input component
     */
    get sourceMin() {
        return this._inputs[1];
    }
    /**
     * Gets the source max input component
     */
    get sourceMax() {
        return this._inputs[2];
    }
    /**
     * Gets the target min input component
     */
    get targetMin() {
        return this._inputs[3];
    }
    /**
     * Gets the target max input component
     */
    get targetMax() {
        return this._inputs[4];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const sourceMin = this.sourceMin.isConnected ? this.sourceMin.associatedVariableName : this._writeFloat(this.sourceRange.x);
        const sourceMax = this.sourceMax.isConnected ? this.sourceMax.associatedVariableName : this._writeFloat(this.sourceRange.y);
        const targetMin = this.targetMin.isConnected ? this.targetMin.associatedVariableName : this._writeFloat(this.targetRange.x);
        const targetMax = this.targetMax.isConnected ? this.targetMax.associatedVariableName : this._writeFloat(this.targetRange.y);
        state.compilationString +=
            state._declareOutput(output) +
                ` = ${targetMin} + (${this._inputs[0].associatedVariableName} - ${sourceMin}) * (${targetMax} - ${targetMin}) / (${sourceMax} - ${sourceMin});\n`;
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.sourceRange = new BABYLON.Vector2(${this.sourceRange.x}, ${this.sourceRange.y});\n`;
        codeString += `${this._codeVariableName}.targetRange = new BABYLON.Vector2(${this.targetRange.x}, ${this.targetRange.y});\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.sourceRange = this.sourceRange.asArray();
        serializationObject.targetRange = this.targetRange.asArray();
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.sourceRange = math_vector/* Vector2 */.I9.FromArray(serializationObject.sourceRange);
        this.targetRange = math_vector/* Vector2 */.I9.FromArray(serializationObject.targetRange);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("From", 3 /* PropertyTypeForEdition.Vector2 */)
], RemapBlock.prototype, "sourceRange", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("To", 3 /* PropertyTypeForEdition.Vector2 */)
], RemapBlock.prototype, "targetRange", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.RemapBlock", RemapBlock);
//# sourceMappingURL=remapBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/baseMathBlock.js



/**
 * Block used to perform a mathematical operation on 2 values
 */
class BaseMathBlock extends NodeMaterialBlock {
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this.output._typeConnectionSource = this.left;
        this._linkConnectionTypes(0, 1, true);
        this.left.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this.right.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._connectionObservers = [
            this.left.onTypeChangedObservable.add(() => this._updateInputOutputTypes()),
            this.right.onTypeChangedObservable.add(() => this._updateInputOutputTypes()),
        ];
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _updateInputOutputTypes() {
        // First update the output type with the initial assumption that we'll base it on the left input.
        this.output._typeConnectionSource = this.left;
        if (this.left.isConnected && this.right.isConnected) {
            // Both inputs are connected, so we need to determine the output type based on the input types.
            if (this.left.type === NodeMaterialBlockConnectionPointTypes.Int ||
                (this.left.type === NodeMaterialBlockConnectionPointTypes.Float && this.right.type !== NodeMaterialBlockConnectionPointTypes.Int)) {
                this.output._typeConnectionSource = this.right;
            }
        }
        else if (this.left.isConnected !== this.right.isConnected) {
            // Only one input is connected, so we need to determine the output type based on the connected input.
            this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;
        }
        // Next update the accepted connection point types for the inputs based on the current input connection state.
        if (this.left.isConnected || this.right.isConnected) {
            for (const [first, second] of [
                [this.left, this.right],
                [this.right, this.left],
            ]) {
                // Always allow Ints and Floats.
                first.acceptedConnectionPointTypes = [NodeMaterialBlockConnectionPointTypes.Int, NodeMaterialBlockConnectionPointTypes.Float];
                if (second.isConnected) {
                    // The same types as the connected input are always allowed.
                    first.acceptedConnectionPointTypes.push(second.type);
                    // If the other input is a scalar, then we also allow Vector/Color/Matrix types.
                    if (second.type === NodeMaterialBlockConnectionPointTypes.Int || second.type === NodeMaterialBlockConnectionPointTypes.Float) {
                        first.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2, NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockConnectionPointTypes.Vector4, NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockConnectionPointTypes.Matrix);
                    }
                }
            }
        }
    }
    /**
     * Release resources
     */
    dispose() {
        super.dispose();
        this._connectionObservers.forEach((observer) => observer.remove());
        this._connectionObservers.length = 0;
    }
}
//# sourceMappingURL=baseMathBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/multiplyBlock.js


/**
 * Block used to multiply 2 values
 */
class MultiplyBlock extends BaseMathBlock {
    /**
     * Creates a new MultiplyBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MultiplyBlock";
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MultiplyBlock", MultiplyBlock);
//# sourceMappingURL=multiplyBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialModes.js
/**
 * Enum used to define the material modes
 */
var NodeMaterialModes;
(function (NodeMaterialModes) {
    /** Regular material */
    NodeMaterialModes[NodeMaterialModes["Material"] = 0] = "Material";
    /** For post process */
    NodeMaterialModes[NodeMaterialModes["PostProcess"] = 1] = "PostProcess";
    /** For particle system */
    NodeMaterialModes[NodeMaterialModes["Particle"] = 2] = "Particle";
    /** For procedural texture */
    NodeMaterialModes[NodeMaterialModes["ProceduralTexture"] = 3] = "ProceduralTexture";
    /** For gaussian splatting */
    NodeMaterialModes[NodeMaterialModes["GaussianSplatting"] = 4] = "GaussianSplatting";
})(NodeMaterialModes || (NodeMaterialModes = {}));
//# sourceMappingURL=nodeMaterialModes.js.map
;// ./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.defines.js

/**
 * @internal
 */
class ImageProcessingConfigurationDefines extends materialDefines/* MaterialDefines */.M {
    constructor() {
        super();
        this.IMAGEPROCESSING = false;
        this.VIGNETTE = false;
        this.VIGNETTEBLENDMODEMULTIPLY = false;
        this.VIGNETTEBLENDMODEOPAQUE = false;
        this.TONEMAPPING = 0;
        this.CONTRAST = false;
        this.COLORCURVES = false;
        this.COLORGRADING = false;
        this.COLORGRADING3D = false;
        this.SAMPLER3DGREENDEPTH = false;
        this.SAMPLER3DBGRMAP = false;
        this.DITHER = false;
        this.IMAGEPROCESSINGPOSTPROCESS = false;
        this.EXPOSURE = false;
        this.SKIPFINALCOLORCLAMP = false;
        this.rebuild();
    }
}
//# sourceMappingURL=imageProcessingConfiguration.defines.js.map
;// ./node_modules/@babylonjs/core/Particles/baseParticleSystem.js






/**
 * This represents the base class for particle system in Babylon.
 * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
 * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function.
 * @example https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
 */
class BaseParticleSystem {
    /**
     * Gets or sets a texture used to add random noise to particle positions
     */
    get noiseTexture() {
        return this._noiseTexture;
    }
    set noiseTexture(value) {
        if (this._noiseTexture === value) {
            return;
        }
        this._noiseTexture = value;
        this._reset();
    }
    /**
     * Gets or sets whether an animation sprite sheet is enabled or not on the particle system
     */
    get isAnimationSheetEnabled() {
        return this._isAnimationSheetEnabled;
    }
    set isAnimationSheetEnabled(value) {
        if (this._isAnimationSheetEnabled == value) {
            return;
        }
        this._isAnimationSheetEnabled = value;
        this._reset();
    }
    /**
     * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.
     */
    get useLogarithmicDepth() {
        return this._useLogarithmicDepth;
    }
    set useLogarithmicDepth(value) {
        this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported;
    }
    /**
     * Get hosting scene
     * @returns the scene
     */
    getScene() {
        return this._scene;
    }
    _hasTargetStopDurationDependantGradient() {
        return ((this._startSizeGradients && this._startSizeGradients.length > 0) ||
            (this._emitRateGradients && this._emitRateGradients.length > 0) ||
            (this._lifeTimeGradients && this._lifeTimeGradients.length > 0));
    }
    /**
     * Gets the current list of drag gradients.
     * You must use addDragGradient and removeDragGradient to update this list
     * @returns the list of drag gradients
     */
    getDragGradients() {
        return this._dragGradients;
    }
    /**
     * Gets the current list of limit velocity gradients.
     * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list
     * @returns the list of limit velocity gradients
     */
    getLimitVelocityGradients() {
        return this._limitVelocityGradients;
    }
    /**
     * Gets the current list of color gradients.
     * You must use addColorGradient and removeColorGradient to update this list
     * @returns the list of color gradients
     */
    getColorGradients() {
        return this._colorGradients;
    }
    /**
     * Gets the current list of size gradients.
     * You must use addSizeGradient and removeSizeGradient to update this list
     * @returns the list of size gradients
     */
    getSizeGradients() {
        return this._sizeGradients;
    }
    /**
     * Gets the current list of color remap gradients.
     * You must use addColorRemapGradient and removeColorRemapGradient to update this list
     * @returns the list of color remap gradients
     */
    getColorRemapGradients() {
        return this._colorRemapGradients;
    }
    /**
     * Gets the current list of alpha remap gradients.
     * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list
     * @returns the list of alpha remap gradients
     */
    getAlphaRemapGradients() {
        return this._alphaRemapGradients;
    }
    /**
     * Gets the current list of life time gradients.
     * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list
     * @returns the list of life time gradients
     */
    getLifeTimeGradients() {
        return this._lifeTimeGradients;
    }
    /**
     * Gets the current list of angular speed gradients.
     * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list
     * @returns the list of angular speed gradients
     */
    getAngularSpeedGradients() {
        return this._angularSpeedGradients;
    }
    /**
     * Gets the current list of velocity gradients.
     * You must use addVelocityGradient and removeVelocityGradient to update this list
     * @returns the list of velocity gradients
     */
    getVelocityGradients() {
        return this._velocityGradients;
    }
    /**
     * Gets the current list of start size gradients.
     * You must use addStartSizeGradient and removeStartSizeGradient to update this list
     * @returns the list of start size gradients
     */
    getStartSizeGradients() {
        return this._startSizeGradients;
    }
    /**
     * Gets the current list of emit rate gradients.
     * You must use addEmitRateGradient and removeEmitRateGradient to update this list
     * @returns the list of emit rate gradients
     */
    getEmitRateGradients() {
        return this._emitRateGradients;
    }
    /**
     * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
     * This only works when particleEmitterTyps is a BoxParticleEmitter
     */
    get direction1() {
        if (this.particleEmitterType.direction1) {
            return this.particleEmitterType.direction1;
        }
        return math_vector/* Vector3 */.Pq.Zero();
    }
    set direction1(value) {
        if (this.particleEmitterType.direction1) {
            this.particleEmitterType.direction1 = value;
        }
    }
    /**
     * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
     * This only works when particleEmitterTyps is a BoxParticleEmitter
     */
    get direction2() {
        if (this.particleEmitterType.direction2) {
            return this.particleEmitterType.direction2;
        }
        return math_vector/* Vector3 */.Pq.Zero();
    }
    set direction2(value) {
        if (this.particleEmitterType.direction2) {
            this.particleEmitterType.direction2 = value;
        }
    }
    /**
     * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
     * This only works when particleEmitterTyps is a BoxParticleEmitter
     */
    get minEmitBox() {
        if (this.particleEmitterType.minEmitBox) {
            return this.particleEmitterType.minEmitBox;
        }
        return math_vector/* Vector3 */.Pq.Zero();
    }
    set minEmitBox(value) {
        if (this.particleEmitterType.minEmitBox) {
            this.particleEmitterType.minEmitBox = value;
        }
    }
    /**
     * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
     * This only works when particleEmitterTyps is a BoxParticleEmitter
     */
    get maxEmitBox() {
        if (this.particleEmitterType.maxEmitBox) {
            return this.particleEmitterType.maxEmitBox;
        }
        return math_vector/* Vector3 */.Pq.Zero();
    }
    set maxEmitBox(value) {
        if (this.particleEmitterType.maxEmitBox) {
            this.particleEmitterType.maxEmitBox = value;
        }
    }
    /**
     * Gets or sets the billboard mode to use when isBillboardBased = true.
     * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED
     */
    get billboardMode() {
        return this._billboardMode;
    }
    set billboardMode(value) {
        if (this._billboardMode === value) {
            return;
        }
        this._billboardMode = value;
        this._reset();
    }
    /**
     * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction
     */
    get isBillboardBased() {
        return this._isBillboardBased;
    }
    set isBillboardBased(value) {
        if (this._isBillboardBased === value) {
            return;
        }
        this._isBillboardBased = value;
        this._reset();
    }
    /**
     * Gets the image processing configuration used either in this material.
     */
    get imageProcessingConfiguration() {
        return this._imageProcessingConfiguration;
    }
    /**
     * Sets the Default image processing configuration used either in the this material.
     *
     * If sets to null, the scene one is in use.
     */
    set imageProcessingConfiguration(value) {
        this._attachImageProcessingConfiguration(value);
    }
    /**
     * Attaches a new image processing configuration to the Standard Material.
     * @param configuration
     */
    _attachImageProcessingConfiguration(configuration) {
        if (configuration === this._imageProcessingConfiguration) {
            return;
        }
        // Pick the scene configuration if needed.
        if (!configuration && this._scene) {
            this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration;
        }
        else {
            this._imageProcessingConfiguration = configuration;
        }
    }
    /** @internal */
    _reset() { }
    /**
     * @internal
     */
    _removeGradientAndTexture(gradient, gradients, texture) {
        if (!gradients) {
            return this;
        }
        let index = 0;
        for (const valueGradient of gradients) {
            if (valueGradient.gradient === gradient) {
                gradients.splice(index, 1);
                break;
            }
            index++;
        }
        if (texture) {
            texture.dispose();
        }
        return this;
    }
    /**
     * Instantiates a particle system.
     * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
     * @param name The name of the particle system
     */
    constructor(name) {
        /**
         * List of animations used by the particle system.
         */
        this.animations = [];
        /**
         * The rendering group used by the Particle system to chose when to render.
         */
        this.renderingGroupId = 0;
        /**
         * The emitter represents the Mesh or position we are attaching the particle system to.
         */
        this.emitter = math_vector/* Vector3 */.Pq.Zero();
        /**
         * The maximum number of particles to emit per frame
         */
        this.emitRate = 10;
        /**
         * If you want to launch only a few particles at once, that can be done, as well.
         */
        this.manualEmitCount = -1;
        /**
         * The overall motion speed (0.01 is default update speed, faster updates = faster animation)
         */
        this.updateSpeed = 0.01;
        /**
         * The amount of time the particle system is running (depends of the overall update speed).
         */
        this.targetStopDuration = 0;
        /**
         * Specifies whether the particle system will be disposed once it reaches the end of the animation.
         */
        this.disposeOnStop = false;
        /**
         * Minimum power of emitting particles.
         */
        this.minEmitPower = 1;
        /**
         * Maximum power of emitting particles.
         */
        this.maxEmitPower = 1;
        /**
         * Minimum life time of emitting particles.
         */
        this.minLifeTime = 1;
        /**
         * Maximum life time of emitting particles.
         */
        this.maxLifeTime = 1;
        /**
         * Minimum Size of emitting particles.
         */
        this.minSize = 1;
        /**
         * Maximum Size of emitting particles.
         */
        this.maxSize = 1;
        /**
         * Minimum scale of emitting particles on X axis.
         */
        this.minScaleX = 1;
        /**
         * Maximum scale of emitting particles on X axis.
         */
        this.maxScaleX = 1;
        /**
         * Minimum scale of emitting particles on Y axis.
         */
        this.minScaleY = 1;
        /**
         * Maximum scale of emitting particles on Y axis.
         */
        this.maxScaleY = 1;
        /**
         * Gets or sets the minimal initial rotation in radians.
         */
        this.minInitialRotation = 0;
        /**
         * Gets or sets the maximal initial rotation in radians.
         */
        this.maxInitialRotation = 0;
        /**
         * Minimum angular speed of emitting particles (Z-axis rotation for each particle).
         */
        this.minAngularSpeed = 0;
        /**
         * Maximum angular speed of emitting particles (Z-axis rotation for each particle).
         */
        this.maxAngularSpeed = 0;
        /**
         * The layer mask we are rendering the particles through.
         */
        this.layerMask = 0x0fffffff;
        /**
         * This can help using your own shader to render the particle system.
         * The according effect will be created
         */
        this.customShader = null;
        /**
         * By default particle system starts as soon as they are created. This prevents the
         * automatic start to happen and let you decide when to start emitting particles.
         */
        this.preventAutoStart = false;
        /**
         * Gets or sets a boolean indicating that this particle system will allow fog to be rendered on it (false by default)
         */
        this.applyFog = false;
        /** @internal */
        this._wasDispatched = false;
        this._rootUrl = "";
        /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */
        this.noiseStrength = new math_vector/* Vector3 */.Pq(10, 10, 10);
        /**
         * Callback triggered when the particle animation is ending.
         */
        this.onAnimationEnd = null;
        /**
         * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD.
         */
        this.blendMode = BaseParticleSystem.BLENDMODE_ONEONE;
        /**
         * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls
         * to override the particles.
         */
        this.forceDepthWrite = false;
        /** Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0 */
        this.preWarmCycles = 0;
        /** Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1) */
        this.preWarmStepOffset = 1;
        /**
         * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)
         */
        this.spriteCellChangeSpeed = 1;
        /**
         * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display
         */
        this.startSpriteCellID = 0;
        /**
         * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display
         */
        this.endSpriteCellID = 0;
        /**
         * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use
         */
        this.spriteCellWidth = 0;
        /**
         * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use
         */
        this.spriteCellHeight = 0;
        /**
         * If using a spritesheet (isAnimationSheetEnabled), defines wether the sprite animation is looping
         */
        this.spriteCellLoop = true;
        /**
         * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID
         */
        this.spriteRandomStartCell = false;
        /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */
        this.translationPivot = new math_vector/* Vector2 */.I9(0, 0);
        /**
         * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called
         */
        this.beginAnimationOnStart = false;
        /**
         * Gets or sets the frame to start the animation from when beginAnimationOnStart is true
         */
        this.beginAnimationFrom = 0;
        /**
         * Gets or sets the frame to end the animation on when beginAnimationOnStart is true
         */
        this.beginAnimationTo = 60;
        /**
         * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true
         */
        this.beginAnimationLoop = false;
        /**
         * Gets or sets a world offset applied to all particles
         */
        this.worldOffset = new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._useLogarithmicDepth = false;
        /**
         * You can use gravity if you want to give an orientation to your particles.
         */
        this.gravity = math_vector/* Vector3 */.Pq.Zero();
        this._colorGradients = null;
        this._sizeGradients = null;
        this._lifeTimeGradients = null;
        this._angularSpeedGradients = null;
        this._velocityGradients = null;
        this._limitVelocityGradients = null;
        this._dragGradients = null;
        this._emitRateGradients = null;
        this._startSizeGradients = null;
        this._rampGradients = null;
        this._colorRemapGradients = null;
        this._alphaRemapGradients = null;
        /**
         * Defines the delay in milliseconds before starting the system (0 by default)
         */
        this.startDelay = 0;
        /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */
        this.limitVelocityDamping = 0.4;
        /**
         * Random color of each particle after it has been emitted, between color1 and color2 vectors
         */
        this.color1 = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        /**
         * Random color of each particle after it has been emitted, between color1 and color2 vectors
         */
        this.color2 = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        /**
         * Color the particle will have at the end of its lifetime
         */
        this.colorDead = new math_color/* Color4 */.ov(0, 0, 0, 1.0);
        /**
         * An optional mask to filter some colors out of the texture, or filter a part of the alpha channel
         */
        this.textureMask = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        /** @internal */
        this._isSubEmitter = false;
        /** @internal */
        this._billboardMode = 7;
        /** @internal */
        this._isBillboardBased = true;
        /**
         * Local cache of defines for image processing.
         */
        this._imageProcessingConfigurationDefines = new ImageProcessingConfigurationDefines();
        this.id = name;
        this.name = name;
    }
    /**
     * Creates a Point Emitter for the particle system (emits directly from the emitter position)
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
     */
    createPointEmitter(direction1, direction2) {
        throw new Error("Method not implemented.");
    }
    /**
     * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)
     * @param radius The radius of the hemisphere to emit from
     * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
     */
    createHemisphericEmitter(radius = 1, radiusRange = 1) {
        throw new Error("Method not implemented.");
    }
    /**
     * Creates a Sphere Emitter for the particle system (emits along the sphere radius)
     * @param radius The radius of the sphere to emit from
     * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
     */
    createSphereEmitter(radius = 1, radiusRange = 1) {
        throw new Error("Method not implemented.");
    }
    /**
     * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)
     * @param radius The radius of the sphere to emit from
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere
     */
    createDirectedSphereEmitter(radius = 1, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
        throw new Error("Method not implemented.");
    }
    /**
     * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)
     * @param radius The radius of the emission cylinder
     * @param height The height of the emission cylinder
     * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius
     * @param directionRandomizer How much to randomize the particle direction [0-1]
     */
    createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0) {
        throw new Error("Method not implemented.");
    }
    /**
     * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)
     * @param radius The radius of the cylinder to emit from
     * @param height The height of the emission cylinder
     * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder
     */
    createDirectedCylinderEmitter(radius = 1, height = 1, radiusRange = 1, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
        throw new Error("Method not implemented.");
    }
    /**
     * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)
     * @param radius The radius of the cone to emit from
     * @param angle The base angle of the cone
     */
    createConeEmitter(radius = 1, angle = Math.PI / 4) {
        throw new Error("Method not implemented.");
    }
    createDirectedConeEmitter(radius = 1, angle = Math.PI / 4, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
        throw new Error("Method not implemented.");
    }
    /**
     * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
     * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox
     * @param maxEmitBox  Particles are emitted from the box between minEmitBox and maxEmitBox
     */
    createBoxEmitter(direction1, direction2, minEmitBox, maxEmitBox) {
        throw new Error("Method not implemented.");
    }
}
/**
 * Source color is added to the destination color without alpha affecting the result
 */
BaseParticleSystem.BLENDMODE_ONEONE = 0;
/**
 * Blend current color and particle color using particle’s alpha
 */
BaseParticleSystem.BLENDMODE_STANDARD = 1;
/**
 * Add current color and particle color multiplied by particle’s alpha
 */
BaseParticleSystem.BLENDMODE_ADD = 2;
/**
 * Multiply current color with particle color
 */
BaseParticleSystem.BLENDMODE_MULTIPLY = 3;
/**
 * Multiply current color with particle color then add current color and particle color multiplied by particle’s alpha
 */
BaseParticleSystem.BLENDMODE_MULTIPLYADD = 4;
// Register Class Name
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BaseParticleSystem", BaseParticleSystem);
//# sourceMappingURL=baseParticleSystem.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/colorSplitterBlock.js




/**
 * Block used to expand a Color3/4 into 4 outputs (one for each component)
 */
class ColorSplitterBlock extends NodeMaterialBlock {
    /**
     * Create a new ColorSplitterBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, true);
        this.registerInput("rgb ", NodeMaterialBlockConnectionPointTypes.Color3, true);
        this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3);
        this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float);
        this.inputsAreExclusive = true;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ColorSplitterBlock";
    }
    /**
     * Gets the rgba component (input)
     */
    get rgba() {
        return this._inputs[0];
    }
    /**
     * Gets the rgb component (input)
     */
    get rgbIn() {
        return this._inputs[1];
    }
    /**
     * Gets the rgb component (output)
     */
    get rgbOut() {
        return this._outputs[0];
    }
    /**
     * Gets the r component (output)
     */
    get r() {
        return this._outputs[1];
    }
    /**
     * Gets the g component (output)
     */
    get g() {
        return this._outputs[2];
    }
    /**
     * Gets the b component (output)
     */
    get b() {
        return this._outputs[3];
    }
    /**
     * Gets the a component (output)
     */
    get a() {
        return this._outputs[4];
    }
    _inputRename(name) {
        if (name === "rgb ") {
            return "rgbIn";
        }
        return name;
    }
    _outputRename(name) {
        if (name === "rgb") {
            return "rgbOut";
        }
        return name;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const input = this.rgba.isConnected ? this.rgba : this.rgbIn;
        if (!input.isConnected) {
            return;
        }
        const rgbOutput = this._outputs[0];
        const rOutput = this._outputs[1];
        const gOutput = this._outputs[2];
        const bOutput = this._outputs[3];
        const aOutput = this._outputs[4];
        if (rgbOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(rgbOutput) + ` = ${input.associatedVariableName}.rgb;\n`;
        }
        if (rOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(rOutput) + ` = ${input.associatedVariableName}.r;\n`;
        }
        if (gOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(gOutput) + ` = ${input.associatedVariableName}.g;\n`;
        }
        if (bOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(bOutput) + ` = ${input.associatedVariableName}.b;\n`;
        }
        if (aOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(aOutput) + ` = ${input.associatedVariableName}.a;\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ColorSplitterBlock", ColorSplitterBlock);
//# sourceMappingURL=colorSplitterBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/timingTools.js
var timingTools = __webpack_require__(2940);
;// ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js


/**
 * Defines the Procedural Texture scene component responsible to manage any Procedural Texture
 * in a given scene.
 */
class ProceduralTextureSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_PROCEDURALTEXTURE;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._beforeClearStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_BEFORECLEAR_PROCEDURALTEXTURE, this, this._beforeClear);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do here.
    }
    /**
     * Disposes the component and the associated resources.
     */
    dispose() {
        // Nothing to do here.
    }
    _beforeClear() {
        if (this.scene.proceduralTexturesEnabled) {
            tools/* Tools */.S0.StartPerformanceCounter("Procedural textures", this.scene.proceduralTextures.length > 0);
            for (let proceduralIndex = 0; proceduralIndex < this.scene.proceduralTextures.length; proceduralIndex++) {
                const proceduralTexture = this.scene.proceduralTextures[proceduralIndex];
                if (proceduralTexture._shouldRender()) {
                    proceduralTexture.render();
                }
            }
            tools/* Tools */.S0.EndPerformanceCounter("Procedural textures", this.scene.proceduralTextures.length > 0);
        }
    }
}
//# sourceMappingURL=proceduralTextureSceneComponent.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/drawWrapper.js
var Materials_drawWrapper = __webpack_require__(35476);
;// ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js













/**
 * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes calmpler' images.
 * This is the base class of any Procedural texture and contains most of the shareable code.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures
 */
class ProceduralTexture extends Textures_texture/* Texture */.g {
    /**
     * Gets the shader language type used to generate vertex and fragment source code.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Instantiates a new procedural texture.
     * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes called 'refMaps' or 'sampler' images.
     * This is the base class of any Procedural texture and contains most of the shareable code.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures
     * @param name  Define the name of the texture
     * @param size Define the size of the texture to create
     * @param fragment Define the fragment shader to use to generate the texture or null if it is defined later:
     *  * object: \{ fragmentElement: "fragmentShaderCode" \}, used with shader code in script tags
     *  * object: \{ fragmentSource: "fragment shader code string" \}, the string contains the shader code
     *  * string: the string contains a name "XXX" to lookup in Effect.ShadersStore["XXXFragmentShader"]
     * @param scene Define the scene the texture belongs to
     * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
     * @param generateMipMaps Define if the texture should creates mip maps or not
     * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
     * @param textureType The FBO internal texture type
     */
    constructor(name, size, fragment, scene, fallbackTexture = null, generateMipMaps = true, isCube = false, textureType = 0) {
        super(null, scene, !generateMipMaps);
        /**
         * Define if the texture is enabled or not (disabled texture will not render)
         */
        this.isEnabled = true;
        /**
         * Define if the texture must be cleared before rendering (default is true)
         */
        this.autoClear = true;
        /**
         * Event raised when the texture is generated
         */
        this.onGeneratedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Event raised before the texture is generated
         */
        this.onBeforeGenerationObservable = new Misc_observable/* Observable */.cP();
        /**
         * Gets or sets the node material used to create this texture (null if the texture was manually created)
         */
        this.nodeMaterialSource = null;
        /**
         * Define the list of custom preprocessor defines used in the shader
         */
        this.defines = "";
        /** @internal */
        this._textures = {};
        this._currentRefreshId = -1;
        this._frameId = -1;
        this._refreshRate = 1;
        this._vertexBuffers = {};
        this._uniforms = new Array();
        this._samplers = new Array();
        this._floats = {};
        this._ints = {};
        this._floatsArrays = {};
        this._colors3 = {};
        this._colors4 = {};
        this._vectors2 = {};
        this._vectors3 = {};
        this._vectors4 = {};
        this._matrices = {};
        this._fallbackTextureUsed = false;
        this._cachedDefines = null;
        this._contentUpdateId = -1;
        this._rtWrapper = null;
        if (fallbackTexture !== null && !(fallbackTexture instanceof Textures_texture/* Texture */.g)) {
            this._options = fallbackTexture;
            this._fallbackTexture = fallbackTexture.fallbackTexture ?? null;
        }
        else {
            this._options = {};
            this._fallbackTexture = fallbackTexture;
        }
        this._shaderLanguage = this._options.shaderLanguage ?? 0 /* ShaderLanguage.GLSL */;
        scene = this.getScene() || engineStore/* EngineStore */.q.LastCreatedScene;
        let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_PROCEDURALTEXTURE);
        if (!component) {
            component = new ProceduralTextureSceneComponent(scene);
            scene._addComponent(component);
        }
        scene.proceduralTextures.push(this);
        this._fullEngine = scene.getEngine();
        this.name = name;
        this.isRenderTarget = true;
        this._size = size;
        this._textureType = textureType;
        this._generateMipMaps = generateMipMaps;
        this._drawWrapper = new Materials_drawWrapper/* DrawWrapper */.E(this._fullEngine);
        this.setFragment(fragment);
        const rtWrapper = this._createRtWrapper(isCube, size, generateMipMaps, textureType);
        this._texture = rtWrapper.texture;
        // VBO
        const vertices = [];
        vertices.push(1, 1);
        vertices.push(-1, 1);
        vertices.push(-1, -1);
        vertices.push(1, -1);
        this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = new Buffers_buffer/* VertexBuffer */.R(this._fullEngine, vertices, Buffers_buffer/* VertexBuffer */.R.PositionKind, false, false, 2);
        this._createIndexBuffer();
    }
    _createRtWrapper(isCube, size, generateMipMaps, textureType) {
        if (isCube) {
            this._rtWrapper = this._fullEngine.createRenderTargetCubeTexture(size, {
                generateMipMaps: generateMipMaps,
                generateDepthBuffer: false,
                generateStencilBuffer: false,
                type: textureType,
                ...this._options,
            });
            this.setFloat("face", 0);
        }
        else {
            this._rtWrapper = this._fullEngine.createRenderTargetTexture(size, {
                generateMipMaps: generateMipMaps,
                generateDepthBuffer: false,
                generateStencilBuffer: false,
                type: textureType,
                ...this._options,
            });
            if (this._rtWrapper.is3D) {
                this.setFloat("layer", 0);
                this.setInt("layerNum", 0);
            }
        }
        return this._rtWrapper;
    }
    /**
     * The effect that is created when initializing the post process.
     * @returns The created effect corresponding the postprocess.
     */
    getEffect() {
        return this._drawWrapper.effect;
    }
    /**
     * @internal
     */
    _setEffect(effect) {
        this._drawWrapper.effect = effect;
    }
    /**
     * Gets texture content (Use this function wisely as reading from a texture can be slow)
     * @returns an ArrayBufferView promise (Uint8Array or Float32Array)
     */
    getContent() {
        if (this._contentData && this._frameId === this._contentUpdateId) {
            return this._contentData;
        }
        if (this._contentData) {
            this._contentData.then((buffer) => {
                this._contentData = this.readPixels(0, 0, buffer);
                this._contentUpdateId = this._frameId;
            });
        }
        else {
            this._contentData = this.readPixels(0, 0);
            this._contentUpdateId = this._frameId;
        }
        return this._contentData;
    }
    _createIndexBuffer() {
        const engine = this._fullEngine;
        // Indices
        const indices = [];
        indices.push(0);
        indices.push(1);
        indices.push(2);
        indices.push(0);
        indices.push(2);
        indices.push(3);
        this._indexBuffer = engine.createIndexBuffer(indices);
    }
    /** @internal */
    _rebuild() {
        const vb = this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind];
        if (vb) {
            vb._rebuild();
        }
        this._createIndexBuffer();
        if (this.refreshRate === Textures_renderTargetTexture/* RenderTargetTexture */.$.REFRESHRATE_RENDER_ONCE) {
            this.refreshRate = Textures_renderTargetTexture/* RenderTargetTexture */.$.REFRESHRATE_RENDER_ONCE;
        }
    }
    /**
     * Resets the texture in order to recreate its associated resources.
     * This can be called in case of context loss or if you change the shader code and need to regenerate the texture with the new code
     */
    reset() {
        this._drawWrapper.effect?.dispose();
        this._drawWrapper.effect = null;
        this._cachedDefines = null;
    }
    _getDefines() {
        return this.defines;
    }
    /**
     * Executes a function when the texture will be ready to be drawn.
     * @param func The callback to be used.
     */
    executeWhenReady(func) {
        if (this.isReady()) {
            func(this);
            return;
        }
        const effect = this.getEffect();
        if (effect) {
            effect.executeWhenCompiled(() => {
                func(this);
            });
        }
    }
    /**
     * Is the texture ready to be used ? (rendered at least once)
     * @returns true if ready, otherwise, false.
     */
    isReady() {
        const engine = this._fullEngine;
        if (this.nodeMaterialSource) {
            return this._drawWrapper.effect.isReady();
        }
        if (!this._fragment) {
            return false;
        }
        if (this._fallbackTextureUsed) {
            return true;
        }
        if (!this._texture) {
            return false;
        }
        const defines = this._getDefines();
        if (this._drawWrapper.effect && defines === this._cachedDefines && this._drawWrapper.effect.isReady()) {
            return true;
        }
        const shaders = {
            vertex: "procedural",
            fragmentElement: this._fragment.fragmentElement,
            fragmentSource: this._fragment.fragmentSource,
            fragment: typeof this._fragment === "string" ? this._fragment : undefined,
        };
        if (this._cachedDefines !== defines) {
            this._cachedDefines = defines;
            this._drawWrapper.effect = engine.createEffect(shaders, [Buffers_buffer/* VertexBuffer */.R.PositionKind], this._uniforms, this._samplers, defines, undefined, undefined, () => {
                this._rtWrapper?.dispose();
                this._rtWrapper = this._texture = null;
                if (this._fallbackTexture) {
                    this._texture = this._fallbackTexture._texture;
                    if (this._texture) {
                        this._texture.incrementReferences();
                    }
                }
                this._fallbackTextureUsed = true;
            }, undefined, this._shaderLanguage, async () => {
                if (this._options.extraInitializationsAsync) {
                    if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 14005)), this._options.extraInitializationsAsync()]);
                    }
                    else {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 17156)), this._options.extraInitializationsAsync()]);
                    }
                }
                else {
                    if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                        await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 14005));
                    }
                    else {
                        await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 17156));
                    }
                }
            });
        }
        return this._drawWrapper.effect.isReady();
    }
    /**
     * Resets the refresh counter of the texture and start bak from scratch.
     * Could be useful to regenerate the texture if it is setup to render only once.
     */
    resetRefreshCounter() {
        this._currentRefreshId = -1;
    }
    /**
     * Set the fragment shader to use in order to render the texture.
     * @param fragment This can be set to a path (into the shader store) or to a json object containing a fragmentElement property.
     */
    setFragment(fragment) {
        this._fragment = fragment;
    }
    /**
     * Define the refresh rate of the texture or the rendering frequency.
     * Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...
     */
    get refreshRate() {
        return this._refreshRate;
    }
    set refreshRate(value) {
        this._refreshRate = value;
        this.resetRefreshCounter();
    }
    /** @internal */
    _shouldRender() {
        if (!this.isEnabled || !this.isReady() || !this._texture) {
            if (this._texture) {
                this._texture.isReady = false;
            }
            return false;
        }
        if (this._fallbackTextureUsed) {
            return false;
        }
        if (this._currentRefreshId === -1) {
            // At least render once
            this._currentRefreshId = 1;
            this._frameId++;
            return true;
        }
        if (this.refreshRate === this._currentRefreshId) {
            this._currentRefreshId = 1;
            this._frameId++;
            return true;
        }
        this._currentRefreshId++;
        return false;
    }
    /**
     * Get the size the texture is rendering at.
     * @returns the size (on cube texture it is always squared)
     */
    getRenderSize() {
        return this._size;
    }
    /**
     * Resize the texture to new value.
     * @param size Define the new size the texture should have
     * @param generateMipMaps Define whether the new texture should create mip maps
     */
    resize(size, generateMipMaps) {
        if (this._fallbackTextureUsed || !this._rtWrapper || !this._texture) {
            return;
        }
        const isCube = this._texture.isCube;
        this._rtWrapper.dispose();
        const rtWrapper = this._createRtWrapper(isCube, size, generateMipMaps, this._textureType);
        this._texture = rtWrapper.texture;
        // Update properties
        this._size = size;
        this._generateMipMaps = generateMipMaps;
    }
    _checkUniform(uniformName) {
        if (this._uniforms.indexOf(uniformName) === -1) {
            this._uniforms.push(uniformName);
        }
    }
    /**
     * Set a texture in the shader program used to render.
     * @param name Define the name of the uniform samplers as defined in the shader
     * @param texture Define the texture to bind to this sampler
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setTexture(name, texture) {
        if (this._samplers.indexOf(name) === -1) {
            this._samplers.push(name);
        }
        this._textures[name] = texture;
        return this;
    }
    /**
     * Set a float in the shader.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setFloat(name, value) {
        this._checkUniform(name);
        this._floats[name] = value;
        return this;
    }
    /**
     * Set a int in the shader.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setInt(name, value) {
        this._checkUniform(name);
        this._ints[name] = value;
        return this;
    }
    /**
     * Set an array of floats in the shader.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setFloats(name, value) {
        this._checkUniform(name);
        this._floatsArrays[name] = value;
        return this;
    }
    /**
     * Set a vec3 in the shader from a Color3.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setColor3(name, value) {
        this._checkUniform(name);
        this._colors3[name] = value;
        return this;
    }
    /**
     * Set a vec4 in the shader from a Color4.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setColor4(name, value) {
        this._checkUniform(name);
        this._colors4[name] = value;
        return this;
    }
    /**
     * Set a vec2 in the shader from a Vector2.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setVector2(name, value) {
        this._checkUniform(name);
        this._vectors2[name] = value;
        return this;
    }
    /**
     * Set a vec3 in the shader from a Vector3.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setVector3(name, value) {
        this._checkUniform(name);
        this._vectors3[name] = value;
        return this;
    }
    /**
     * Set a vec4 in the shader from a Vector4.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setVector4(name, value) {
        this._checkUniform(name);
        this._vectors4[name] = value;
        return this;
    }
    /**
     * Set a mat4 in the shader from a MAtrix.
     * @param name Define the name of the uniform as defined in the shader
     * @param value Define the value to give to the uniform
     * @returns the texture itself allowing "fluent" like uniform updates
     */
    setMatrix(name, value) {
        this._checkUniform(name);
        this._matrices[name] = value;
        return this;
    }
    /**
     * Render the texture to its associated render target.
     * @param useCameraPostProcess Define if camera post process should be applied to the texture
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    render(useCameraPostProcess) {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        const engine = this._fullEngine;
        // Render
        engine.enableEffect(this._drawWrapper);
        this.onBeforeGenerationObservable.notifyObservers(this);
        engine.setState(false);
        if (!this.nodeMaterialSource) {
            // Texture
            for (const name in this._textures) {
                this._drawWrapper.effect.setTexture(name, this._textures[name]);
            }
            // Float
            for (const name in this._ints) {
                this._drawWrapper.effect.setInt(name, this._ints[name]);
            }
            // Float
            for (const name in this._floats) {
                this._drawWrapper.effect.setFloat(name, this._floats[name]);
            }
            // Floats
            for (const name in this._floatsArrays) {
                this._drawWrapper.effect.setArray(name, this._floatsArrays[name]);
            }
            // Color3
            for (const name in this._colors3) {
                this._drawWrapper.effect.setColor3(name, this._colors3[name]);
            }
            // Color4
            for (const name in this._colors4) {
                const color = this._colors4[name];
                this._drawWrapper.effect.setFloat4(name, color.r, color.g, color.b, color.a);
            }
            // Vector2
            for (const name in this._vectors2) {
                this._drawWrapper.effect.setVector2(name, this._vectors2[name]);
            }
            // Vector3
            for (const name in this._vectors3) {
                this._drawWrapper.effect.setVector3(name, this._vectors3[name]);
            }
            // Vector4
            for (const name in this._vectors4) {
                this._drawWrapper.effect.setVector4(name, this._vectors4[name]);
            }
            // Matrix
            for (const name in this._matrices) {
                this._drawWrapper.effect.setMatrix(name, this._matrices[name]);
            }
        }
        if (!this._texture || !this._rtWrapper) {
            return;
        }
        engine._debugPushGroup?.(`procedural texture generation for ${this.name}`, 1);
        const viewPort = engine.currentViewport;
        if (this.isCube) {
            for (let face = 0; face < 6; face++) {
                engine.bindFramebuffer(this._rtWrapper, face, undefined, undefined, true);
                // VBOs
                engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._drawWrapper.effect);
                this._drawWrapper.effect.setFloat("face", face);
                // Clear
                if (this.autoClear) {
                    engine.clear(scene.clearColor, true, false, false);
                }
                // Draw order
                engine.drawElementsType(Materials_material/* Material */.i.TriangleFillMode, 0, 6);
                // Unbind and restore viewport
                engine.unBindFramebuffer(this._rtWrapper, true);
            }
        }
        else {
            let numLayers = 1;
            if (this._rtWrapper.is3D) {
                numLayers = this._rtWrapper.depth;
            }
            else if (this._rtWrapper.is2DArray) {
                numLayers = this._rtWrapper.layers;
            }
            for (let layer = 0; layer < numLayers; layer++) {
                engine.bindFramebuffer(this._rtWrapper, 0, undefined, undefined, true, 0, layer);
                // VBOs
                engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._drawWrapper.effect);
                if (this._rtWrapper.is3D || this._rtWrapper.is2DArray) {
                    this._drawWrapper.effect?.setFloat("layer", numLayers !== 1 ? layer / (numLayers - 1) : 0);
                    this._drawWrapper.effect?.setInt("layerNum", layer);
                    for (const name in this._textures) {
                        this._drawWrapper.effect.setTexture(name, this._textures[name]);
                    }
                }
                // Clear
                if (this.autoClear) {
                    engine.clear(scene.clearColor, true, false, false);
                }
                // Draw order
                engine.drawElementsType(Materials_material/* Material */.i.TriangleFillMode, 0, 6);
                // Unbind and restore viewport
                engine.unBindFramebuffer(this._rtWrapper, !this._generateMipMaps);
            }
        }
        if (viewPort) {
            engine.setViewport(viewPort);
        }
        // Mipmaps
        if (this.isCube) {
            engine.generateMipMapsForCubemap(this._texture, true);
        }
        engine._debugPopGroup?.(1);
        if (this.onGenerated) {
            this.onGenerated();
        }
        this.onGeneratedObservable.notifyObservers(this);
    }
    /**
     * Clone the texture.
     * @returns the cloned texture
     */
    clone() {
        const textureSize = this.getSize();
        const newTexture = new ProceduralTexture(this.name, textureSize.width, this._fragment, this.getScene(), this._fallbackTexture, this._generateMipMaps);
        // Base texture
        newTexture.hasAlpha = this.hasAlpha;
        newTexture.level = this.level;
        // RenderTarget Texture
        newTexture.coordinatesMode = this.coordinatesMode;
        return newTexture;
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        const index = scene.proceduralTextures.indexOf(this);
        if (index >= 0) {
            scene.proceduralTextures.splice(index, 1);
        }
        const vertexBuffer = this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind];
        if (vertexBuffer) {
            vertexBuffer.dispose();
            this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = null;
        }
        if (this._indexBuffer && this._fullEngine._releaseBuffer(this._indexBuffer)) {
            this._indexBuffer = null;
        }
        this.onGeneratedObservable.clear();
        this.onBeforeGenerationObservable.clear();
        super.dispose();
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ProceduralTexture.prototype, "isEnabled", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ProceduralTexture.prototype, "autoClear", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ProceduralTexture.prototype, "_generateMipMaps", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ProceduralTexture.prototype, "_size", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ProceduralTexture.prototype, "refreshRate", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ProceduralTexture", ProceduralTexture);
//# sourceMappingURL=proceduralTexture.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/trigonometryBlock.js






/**
 * Operations supported by the Trigonometry block
 */
var TrigonometryBlockOperations;
(function (TrigonometryBlockOperations) {
    /** Cos */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Cos"] = 0] = "Cos";
    /** Sin */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Sin"] = 1] = "Sin";
    /** Abs */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Abs"] = 2] = "Abs";
    /** Exp */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Exp"] = 3] = "Exp";
    /** Exp2 */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Exp2"] = 4] = "Exp2";
    /** Round */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Round"] = 5] = "Round";
    /** Floor */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Floor"] = 6] = "Floor";
    /** Ceiling */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Ceiling"] = 7] = "Ceiling";
    /** Square root */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Sqrt"] = 8] = "Sqrt";
    /** Log */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Log"] = 9] = "Log";
    /** Tangent */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Tan"] = 10] = "Tan";
    /** Arc tangent */
    TrigonometryBlockOperations[TrigonometryBlockOperations["ArcTan"] = 11] = "ArcTan";
    /** Arc cosinus */
    TrigonometryBlockOperations[TrigonometryBlockOperations["ArcCos"] = 12] = "ArcCos";
    /** Arc sinus */
    TrigonometryBlockOperations[TrigonometryBlockOperations["ArcSin"] = 13] = "ArcSin";
    /** Fraction */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Fract"] = 14] = "Fract";
    /** Sign */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Sign"] = 15] = "Sign";
    /** To radians (from degrees) */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Radians"] = 16] = "Radians";
    /** To degrees (from radians) */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Degrees"] = 17] = "Degrees";
    /** To Set a = b */
    TrigonometryBlockOperations[TrigonometryBlockOperations["Set"] = 18] = "Set";
})(TrigonometryBlockOperations || (TrigonometryBlockOperations = {}));
/**
 * Block used to apply trigonometry operation to floats
 */
class TrigonometryBlock extends NodeMaterialBlock {
    /**
     * Creates a new TrigonometryBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Gets or sets the operation applied by the block
         */
        this.operation = TrigonometryBlockOperations.Cos;
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TrigonometryBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        let operation = "";
        switch (this.operation) {
            case TrigonometryBlockOperations.Cos: {
                operation = "cos";
                break;
            }
            case TrigonometryBlockOperations.Sin: {
                operation = "sin";
                break;
            }
            case TrigonometryBlockOperations.Abs: {
                operation = "abs";
                break;
            }
            case TrigonometryBlockOperations.Exp: {
                operation = "exp";
                break;
            }
            case TrigonometryBlockOperations.Exp2: {
                operation = "exp2";
                break;
            }
            case TrigonometryBlockOperations.Round: {
                operation = "round";
                break;
            }
            case TrigonometryBlockOperations.Floor: {
                operation = "floor";
                break;
            }
            case TrigonometryBlockOperations.Ceiling: {
                operation = "ceil";
                break;
            }
            case TrigonometryBlockOperations.Sqrt: {
                operation = "sqrt";
                break;
            }
            case TrigonometryBlockOperations.Log: {
                operation = "log";
                break;
            }
            case TrigonometryBlockOperations.Tan: {
                operation = "tan";
                break;
            }
            case TrigonometryBlockOperations.ArcTan: {
                operation = "atan";
                break;
            }
            case TrigonometryBlockOperations.ArcCos: {
                operation = "acos";
                break;
            }
            case TrigonometryBlockOperations.ArcSin: {
                operation = "asin";
                break;
            }
            case TrigonometryBlockOperations.Fract: {
                operation = "fract";
                break;
            }
            case TrigonometryBlockOperations.Sign: {
                operation = "sign";
                break;
            }
            case TrigonometryBlockOperations.Radians: {
                operation = "radians";
                break;
            }
            case TrigonometryBlockOperations.Degrees: {
                operation = "degrees";
                break;
            }
            case TrigonometryBlockOperations.Set: {
                operation = "";
                break;
            }
        }
        state.compilationString += state._declareOutput(output) + ` = ${operation}(${this.input.associatedVariableName});\n`;
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.operation = this.operation;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.operation = serializationObject.operation;
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.operation = BABYLON.TrigonometryBlockOperations.${TrigonometryBlockOperations[this.operation]};\n`;
        return codeString;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Operation", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "Cos", value: TrigonometryBlockOperations.Cos },
            { label: "Sin", value: TrigonometryBlockOperations.Sin },
            { label: "Abs", value: TrigonometryBlockOperations.Abs },
            { label: "Exp", value: TrigonometryBlockOperations.Exp },
            { label: "Exp2", value: TrigonometryBlockOperations.Exp2 },
            { label: "Round", value: TrigonometryBlockOperations.Round },
            { label: "Floor", value: TrigonometryBlockOperations.Floor },
            { label: "Ceiling", value: TrigonometryBlockOperations.Ceiling },
            { label: "Sqrt", value: TrigonometryBlockOperations.Sqrt },
            { label: "Log", value: TrigonometryBlockOperations.Log },
            { label: "Tan", value: TrigonometryBlockOperations.Tan },
            { label: "ArcTan", value: TrigonometryBlockOperations.ArcTan },
            { label: "ArcCos", value: TrigonometryBlockOperations.ArcCos },
            { label: "ArcSin", value: TrigonometryBlockOperations.ArcSin },
            { label: "Fract", value: TrigonometryBlockOperations.Fract },
            { label: "Sign", value: TrigonometryBlockOperations.Sign },
            { label: "Radians", value: TrigonometryBlockOperations.Radians },
            { label: "Degrees", value: TrigonometryBlockOperations.Degrees },
            { label: "Set", value: TrigonometryBlockOperations.Set },
        ],
    })
], TrigonometryBlock.prototype, "operation", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TrigonometryBlock", TrigonometryBlock);
//# sourceMappingURL=trigonometryBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/nodeMaterial.js












































const onCreatedEffectParameters = { effect: null, subMesh: null };
/** @internal */
class NodeMaterialDefines extends materialDefines/* MaterialDefines */.M {
    /**
     * Creates a new NodeMaterialDefines
     */
    constructor() {
        super();
        /** Normal */
        this.NORMAL = false;
        /** Tangent */
        this.TANGENT = false;
        /** Vertex color */
        this.VERTEXCOLOR_NME = false;
        /**  Uv1 **/
        this.UV1 = false;
        /** Uv2 **/
        this.UV2 = false;
        /** Uv3 **/
        this.UV3 = false;
        /** Uv4 **/
        this.UV4 = false;
        /** Uv5 **/
        this.UV5 = false;
        /** Uv6 **/
        this.UV6 = false;
        /** Prepass **/
        this.PREPASS = false;
        /** Prepass normal */
        this.PREPASS_NORMAL = false;
        /** Prepass normal index */
        this.PREPASS_NORMAL_INDEX = -1;
        /** Prepass world normal */
        this.PREPASS_WORLD_NORMAL = false;
        /** Prepass world normal index */
        this.PREPASS_WORLD_NORMAL_INDEX = -1;
        /** Prepass position */
        this.PREPASS_POSITION = false;
        /** Prepass position index */
        this.PREPASS_POSITION_INDEX = -1;
        /** Prepass local position */
        this.PREPASS_LOCAL_POSITION = false;
        /** Prepass local position index */
        this.PREPASS_LOCAL_POSITION_INDEX = -1;
        /** Prepass depth */
        this.PREPASS_DEPTH = false;
        /** Prepass depth index */
        this.PREPASS_DEPTH_INDEX = -1;
        /** Clip-space depth */
        this.PREPASS_SCREENSPACE_DEPTH = false;
        /** Clip-space depth index */
        this.PREPASS_SCREENSPACE_DEPTH_INDEX = -1;
        /** Scene MRT count */
        this.SCENE_MRT_COUNT = 0;
        /** BONES */
        this.NUM_BONE_INFLUENCERS = 0;
        /** Bones per mesh */
        this.BonesPerMesh = 0;
        /** Using texture for bone storage */
        this.BONETEXTURE = false;
        /** MORPH TARGETS */
        this.MORPHTARGETS = false;
        /** Morph target normal */
        this.MORPHTARGETS_NORMAL = false;
        /** Morph target tangent */
        this.MORPHTARGETS_TANGENT = false;
        /** Morph target uv */
        this.MORPHTARGETS_UV = false;
        /** Number of morph influencers */
        this.NUM_MORPH_INFLUENCERS = 0;
        /** Using a texture to store morph target data */
        this.MORPHTARGETS_TEXTURE = false;
        /** IMAGE PROCESSING */
        this.IMAGEPROCESSING = false;
        /** Vignette */
        this.VIGNETTE = false;
        /** Multiply blend mode for vignette */
        this.VIGNETTEBLENDMODEMULTIPLY = false;
        /** Opaque blend mode for vignette */
        this.VIGNETTEBLENDMODEOPAQUE = false;
        /** Tone mapping */
        this.TONEMAPPING = 0;
        /** Contrast */
        this.CONTRAST = false;
        /** Exposure */
        this.EXPOSURE = false;
        /** Color curves */
        this.COLORCURVES = false;
        /** Color grading */
        this.COLORGRADING = false;
        /** 3D color grading */
        this.COLORGRADING3D = false;
        /** Sampler green depth */
        this.SAMPLER3DGREENDEPTH = false;
        /** Sampler for BGR map */
        this.SAMPLER3DBGRMAP = false;
        /** Dithering */
        this.DITHER = false;
        /** Using post process for image processing */
        this.IMAGEPROCESSINGPOSTPROCESS = false;
        /** Skip color clamp */
        this.SKIPFINALCOLORCLAMP = false;
        /** MISC. */
        this.BUMPDIRECTUV = 0;
        /** Camera is orthographic */
        this.CAMERA_ORTHOGRAPHIC = false;
        /** Camera is perspective */
        this.CAMERA_PERSPECTIVE = false;
        this.rebuild();
    }
    /**
     * Set the value of a specific key
     * @param name defines the name of the key to set
     * @param value defines the value to set
     * @param markAsUnprocessedIfDirty Flag to indicate to the cache that this value needs processing
     */
    setValue(name, value, markAsUnprocessedIfDirty = false) {
        if (this[name] === undefined) {
            this._keys.push(name);
        }
        if (markAsUnprocessedIfDirty && this[name] !== value) {
            this.markAsUnprocessed();
        }
        this[name] = value;
    }
}
/**
 * Class used to create a node based material built by assembling shader blocks
 */
class NodeMaterial extends pushMaterial/* PushMaterial */.E {
    /**
     * Checks if a block is a texture block
     * @param block The block to check
     * @returns True if the block is a texture block
     */
    static _BlockIsTextureBlock(block) {
        return (block.getClassName() === "TextureBlock" ||
            block.getClassName() === "ReflectionTextureBaseBlock" ||
            block.getClassName() === "ReflectionTextureBlock" ||
            block.getClassName() === "ReflectionBlock" ||
            block.getClassName() === "RefractionBlock" ||
            block.getClassName() === "CurrentScreenBlock" ||
            block.getClassName() === "ParticleTextureBlock" ||
            block.getClassName() === "ImageSourceBlock" ||
            block.getClassName() === "TriPlanarBlock" ||
            block.getClassName() === "BiPlanarBlock" ||
            block.getClassName() === "PrePassTextureBlock");
    }
    /** Get the inspector from bundle or global
     * @returns the global NME
     */
    _getGlobalNodeMaterialEditor() {
        // UMD Global name detection from Webpack Bundle UMD Name.
        if (typeof NODEEDITOR !== "undefined") {
            return NODEEDITOR;
        }
        // In case of module let's check the global emitted from the editor entry point.
        if (typeof BABYLON !== "undefined" && typeof BABYLON.NodeEditor !== "undefined") {
            return BABYLON;
        }
        return undefined;
    }
    /** Gets or sets the active shader language */
    get shaderLanguage() {
        return this._options.shaderLanguage;
    }
    set shaderLanguage(value) {
        this._options.shaderLanguage = value;
    }
    /** Gets or sets options to control the node material overall behavior */
    get options() {
        return this._options;
    }
    set options(options) {
        this._options = options;
    }
    /**
     * Gets the image processing configuration used either in this material.
     */
    get imageProcessingConfiguration() {
        return this._imageProcessingConfiguration;
    }
    /**
     * Sets the Default image processing configuration used either in the this material.
     *
     * If sets to null, the scene one is in use.
     */
    set imageProcessingConfiguration(value) {
        this._attachImageProcessingConfiguration(value);
        // Ensure the effect will be rebuilt.
        this._markAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets or sets the mode property
     */
    get mode() {
        return this._mode;
    }
    set mode(value) {
        this._mode = value;
    }
    /** Gets or sets the unique identifier used to identified the effect associated with the material */
    get buildId() {
        return this._buildId;
    }
    set buildId(value) {
        this._buildId = value;
    }
    /**
     * Create a new node based material
     * @param name defines the material name
     * @param scene defines the hosting scene
     * @param options defines creation option
     */
    constructor(name, scene, options = {}) {
        super(name, scene || engineStore/* EngineStore */.q.LastCreatedScene);
        this._buildId = NodeMaterial._BuildIdGenerator++;
        this._buildWasSuccessful = false;
        this._cachedWorldViewMatrix = new math_vector/* Matrix */.uq();
        this._cachedWorldViewProjectionMatrix = new math_vector/* Matrix */.uq();
        this._optimizers = new Array();
        this._animationFrame = -1;
        this._buildIsInProgress = false;
        this.BJSNODEMATERIALEDITOR = this._getGlobalNodeMaterialEditor();
        /**
         * Gets or sets data used by visual editor
         * @see https://nme.babylonjs.com
         */
        this.editorData = null;
        /**
         * Gets or sets a boolean indicating that alpha value must be ignored (This will turn alpha blending off even if an alpha value is produced by the material)
         */
        this.ignoreAlpha = false;
        /**
         * Defines the maximum number of lights that can be used in the material
         */
        this.maxSimultaneousLights = 4;
        /**
         * Observable raised when the material is built
         */
        this.onBuildObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable raised when an error is detected
         */
        this.onBuildErrorObservable = new Misc_observable/* Observable */.cP();
        /**
         * Gets or sets the root nodes of the material vertex shader
         */
        this._vertexOutputNodes = new Array();
        /**
         * Gets or sets the root nodes of the material fragment (pixel) shader
         */
        this._fragmentOutputNodes = new Array();
        /**
         * Gets an array of blocks that needs to be serialized even if they are not yet connected
         */
        this.attachedBlocks = [];
        /**
         * Specifies the mode of the node material
         * @internal
         */
        this._mode = NodeMaterialModes.Material;
        /**
         * Gets or sets a boolean indicating that alpha blending must be enabled no matter what alpha value or alpha channel of the FragmentBlock are
         */
        this.forceAlphaBlending = false;
        if (options && options.shaderLanguage === 1 /* ShaderLanguage.WGSL */ && !this.getScene().getEngine().isWebGPU) {
            throw new Error("WebGPU shader language is only supported with WebGPU engine");
        }
        this._options = {
            emitComments: false,
            shaderLanguage: NodeMaterial.DefaultShaderLanguage,
            ...options,
        };
        // Setup the default processing configuration to the scene.
        this._attachImageProcessingConfiguration(null);
    }
    /**
     * Gets the current class name of the material e.g. "NodeMaterial"
     * @returns the class name
     */
    getClassName() {
        return "NodeMaterial";
    }
    /**
     * Attaches a new image processing configuration to the Standard Material.
     * @param configuration
     */
    _attachImageProcessingConfiguration(configuration) {
        if (configuration === this._imageProcessingConfiguration) {
            return;
        }
        // Detaches observer.
        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
        }
        // Pick the scene configuration if needed.
        if (!configuration) {
            this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration;
        }
        else {
            this._imageProcessingConfiguration = configuration;
        }
        // Attaches observer.
        if (this._imageProcessingConfiguration) {
            this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
                this._markAllSubMeshesAsImageProcessingDirty();
            });
        }
    }
    /**
     * Get a block by its name
     * @param name defines the name of the block to retrieve
     * @returns the required block or null if not found
     */
    getBlockByName(name) {
        let result = null;
        for (const block of this.attachedBlocks) {
            if (block.name === name) {
                if (!result) {
                    result = block;
                }
                else {
                    tools/* Tools */.S0.Warn("More than one block was found with the name `" + name + "`");
                    return result;
                }
            }
        }
        return result;
    }
    /**
     * Get a block using a predicate
     * @param predicate defines the predicate used to find the good candidate
     * @returns the required block or null if not found
     */
    getBlockByPredicate(predicate) {
        for (const block of this.attachedBlocks) {
            if (predicate(block)) {
                return block;
            }
        }
        return null;
    }
    /**
     * Get an input block using a predicate
     * @param predicate defines the predicate used to find the good candidate
     * @returns the required input block or null if not found
     */
    getInputBlockByPredicate(predicate) {
        for (const block of this.attachedBlocks) {
            if (block.isInput && predicate(block)) {
                return block;
            }
        }
        return null;
    }
    /**
     * Gets the list of input blocks attached to this material
     * @returns an array of InputBlocks
     */
    getInputBlocks() {
        const blocks = [];
        for (const block of this.attachedBlocks) {
            if (block.isInput) {
                blocks.push(block);
            }
        }
        return blocks;
    }
    /**
     * Adds a new optimizer to the list of optimizers
     * @param optimizer defines the optimizers to add
     * @returns the current material
     */
    registerOptimizer(optimizer) {
        const index = this._optimizers.indexOf(optimizer);
        if (index > -1) {
            return;
        }
        this._optimizers.push(optimizer);
        return this;
    }
    /**
     * Remove an optimizer from the list of optimizers
     * @param optimizer defines the optimizers to remove
     * @returns the current material
     */
    unregisterOptimizer(optimizer) {
        const index = this._optimizers.indexOf(optimizer);
        if (index === -1) {
            return;
        }
        this._optimizers.splice(index, 1);
        return this;
    }
    /**
     * Add a new block to the list of output nodes
     * @param node defines the node to add
     * @returns the current material
     */
    addOutputNode(node) {
        if (node.target === null) {
            // eslint-disable-next-line no-throw-literal
            throw "This node is not meant to be an output node. You may want to explicitly set its target value.";
        }
        if ((node.target & NodeMaterialBlockTargets.Vertex) !== 0) {
            this._addVertexOutputNode(node);
        }
        if ((node.target & NodeMaterialBlockTargets.Fragment) !== 0) {
            this._addFragmentOutputNode(node);
        }
        return this;
    }
    /**
     * Remove a block from the list of root nodes
     * @param node defines the node to remove
     * @returns the current material
     */
    removeOutputNode(node) {
        if (node.target === null) {
            return this;
        }
        if ((node.target & NodeMaterialBlockTargets.Vertex) !== 0) {
            this._removeVertexOutputNode(node);
        }
        if ((node.target & NodeMaterialBlockTargets.Fragment) !== 0) {
            this._removeFragmentOutputNode(node);
        }
        return this;
    }
    _addVertexOutputNode(node) {
        if (this._vertexOutputNodes.indexOf(node) !== -1) {
            return;
        }
        node.target = NodeMaterialBlockTargets.Vertex;
        this._vertexOutputNodes.push(node);
        return this;
    }
    _removeVertexOutputNode(node) {
        const index = this._vertexOutputNodes.indexOf(node);
        if (index === -1) {
            return;
        }
        this._vertexOutputNodes.splice(index, 1);
        return this;
    }
    _addFragmentOutputNode(node) {
        if (this._fragmentOutputNodes.indexOf(node) !== -1) {
            return;
        }
        node.target = NodeMaterialBlockTargets.Fragment;
        this._fragmentOutputNodes.push(node);
        return this;
    }
    _removeFragmentOutputNode(node) {
        const index = this._fragmentOutputNodes.indexOf(node);
        if (index === -1) {
            return;
        }
        this._fragmentOutputNodes.splice(index, 1);
        return this;
    }
    /**
     * Specifies if the material will require alpha blending
     * @returns a boolean specifying if alpha blending is needed
     */
    needAlphaBlending() {
        if (this.ignoreAlpha) {
            return false;
        }
        return this.forceAlphaBlending || this.alpha < 1.0 || (this._sharedData && this._sharedData.hints.needAlphaBlending);
    }
    /**
     * Specifies if this material should be rendered in alpha test mode
     * @returns a boolean specifying if an alpha test is needed.
     */
    needAlphaTesting() {
        return this._sharedData && this._sharedData.hints.needAlphaTesting;
    }
    _processInitializeOnLink(block, state, nodesToProcessForOtherBuildState, autoConfigure = true) {
        if (block.target === NodeMaterialBlockTargets.VertexAndFragment) {
            nodesToProcessForOtherBuildState.push(block);
        }
        else if (state.target === NodeMaterialBlockTargets.Fragment && block.target === NodeMaterialBlockTargets.Vertex && block._preparationId !== this._buildId) {
            nodesToProcessForOtherBuildState.push(block);
        }
        this._initializeBlock(block, state, nodesToProcessForOtherBuildState, autoConfigure);
    }
    _attachBlock(node) {
        if (this.attachedBlocks.indexOf(node) === -1) {
            if (node.isUnique) {
                const className = node.getClassName();
                for (const other of this.attachedBlocks) {
                    if (other.getClassName() === className) {
                        // eslint-disable-next-line no-throw-literal
                        throw `Cannot have multiple blocks of type ${className} in the same NodeMaterial`;
                    }
                }
            }
            this.attachedBlocks.push(node);
        }
    }
    _initializeBlock(node, state, nodesToProcessForOtherBuildState, autoConfigure = true) {
        node.initialize(state);
        if (autoConfigure) {
            node.autoConfigure(this);
        }
        node._preparationId = this._buildId;
        this._attachBlock(node);
        for (const input of node.inputs) {
            input.associatedVariableName = "";
            const connectedPoint = input.connectedPoint;
            if (connectedPoint && !connectedPoint._preventBubbleUp) {
                const block = connectedPoint.ownerBlock;
                if (block !== node) {
                    this._processInitializeOnLink(block, state, nodesToProcessForOtherBuildState, autoConfigure);
                }
            }
        }
        // Loop
        if (node.isLoop) {
            // We need to keep the storage write block in the active blocks
            const loopBlock = node;
            if (loopBlock.loopID.hasEndpoints) {
                for (const endpoint of loopBlock.loopID.endpoints) {
                    const block = endpoint.ownerBlock;
                    if (block.outputs.length !== 0) {
                        continue;
                    }
                    state._terminalBlocks.add(block); // Attach the storage write only
                    this._processInitializeOnLink(block, state, nodesToProcessForOtherBuildState, autoConfigure);
                }
            }
        }
        else if (node.isTeleportOut) {
            // Teleportation
            const teleport = node;
            if (teleport.entryPoint) {
                this._processInitializeOnLink(teleport.entryPoint, state, nodesToProcessForOtherBuildState, autoConfigure);
            }
        }
        for (const output of node.outputs) {
            output.associatedVariableName = "";
        }
    }
    _resetDualBlocks(node, id) {
        if (node.target === NodeMaterialBlockTargets.VertexAndFragment) {
            node.buildId = id;
        }
        for (const input of node.inputs) {
            const connectedPoint = input.connectedPoint;
            if (connectedPoint && !connectedPoint._preventBubbleUp) {
                const block = connectedPoint.ownerBlock;
                if (block !== node) {
                    this._resetDualBlocks(block, id);
                }
            }
        }
        // If this is a teleport out, we need to reset the connected block
        if (node.isTeleportOut) {
            const teleportOut = node;
            if (teleportOut.entryPoint) {
                this._resetDualBlocks(teleportOut.entryPoint, id);
            }
        }
        else if (node.isLoop) {
            // Loop
            const loopBlock = node;
            if (loopBlock.loopID.hasEndpoints) {
                for (const endpoint of loopBlock.loopID.endpoints) {
                    const block = endpoint.ownerBlock;
                    if (block.outputs.length !== 0) {
                        continue;
                    }
                    this._resetDualBlocks(block, id);
                }
            }
        }
    }
    /**
     * Remove a block from the current node material
     * @param block defines the block to remove
     */
    removeBlock(block) {
        const attachedBlockIndex = this.attachedBlocks.indexOf(block);
        if (attachedBlockIndex > -1) {
            this.attachedBlocks.splice(attachedBlockIndex, 1);
        }
        if (block.isFinalMerger) {
            this.removeOutputNode(block);
        }
    }
    /**
     * Build the material and generates the inner effect
     * @param verbose defines if the build should log activity
     * @param updateBuildId defines if the internal build Id should be updated (default is true)
     * @param autoConfigure defines if the autoConfigure method should be called when initializing blocks (default is false)
     */
    build(verbose = false, updateBuildId = true, autoConfigure = false) {
        if (this._buildIsInProgress) {
            logger/* Logger */.V.Warn("Build is already in progress, You can use NodeMaterial.onBuildObservable to determine when the build is completed.");
            return;
        }
        this._buildIsInProgress = true;
        // First time?
        if (!this._vertexCompilationState && !autoConfigure) {
            autoConfigure = true;
        }
        this._buildWasSuccessful = false;
        const engine = this.getScene().getEngine();
        const allowEmptyVertexProgram = this._mode === NodeMaterialModes.Particle;
        if (this._vertexOutputNodes.length === 0 && !allowEmptyVertexProgram) {
            // eslint-disable-next-line no-throw-literal
            throw "You must define at least one vertexOutputNode";
        }
        if (this._fragmentOutputNodes.length === 0) {
            // eslint-disable-next-line no-throw-literal
            throw "You must define at least one fragmentOutputNode";
        }
        // Compilation state
        this._vertexCompilationState = new NodeMaterialBuildState();
        this._vertexCompilationState.supportUniformBuffers = engine.supportsUniformBuffers;
        this._vertexCompilationState.target = NodeMaterialBlockTargets.Vertex;
        this._fragmentCompilationState = new NodeMaterialBuildState();
        this._fragmentCompilationState.supportUniformBuffers = engine.supportsUniformBuffers;
        this._fragmentCompilationState.target = NodeMaterialBlockTargets.Fragment;
        // Shared data
        this._sharedData = new NodeMaterialBuildStateSharedData();
        this._sharedData.nodeMaterial = this;
        this._sharedData.fragmentOutputNodes = this._fragmentOutputNodes;
        this._vertexCompilationState.sharedData = this._sharedData;
        this._fragmentCompilationState.sharedData = this._sharedData;
        this._sharedData.buildId = this._buildId;
        this._sharedData.emitComments = this._options.emitComments;
        this._sharedData.verbose = verbose;
        this._sharedData.scene = this.getScene();
        this._sharedData.allowEmptyVertexProgram = allowEmptyVertexProgram;
        // Initialize blocks
        const vertexNodes = [];
        const fragmentNodes = [];
        for (const vertexOutputNode of this._vertexOutputNodes) {
            vertexNodes.push(vertexOutputNode);
            this._initializeBlock(vertexOutputNode, this._vertexCompilationState, fragmentNodes, autoConfigure);
        }
        for (const fragmentOutputNode of this._fragmentOutputNodes) {
            fragmentNodes.push(fragmentOutputNode);
            this._initializeBlock(fragmentOutputNode, this._fragmentCompilationState, vertexNodes, autoConfigure);
        }
        // Are blocks code ready?
        let waitingNodeCount = 0;
        for (const node of this.attachedBlocks) {
            if (!node.codeIsReady) {
                waitingNodeCount++;
                node.onCodeIsReadyObservable.addOnce(() => {
                    waitingNodeCount--;
                    if (waitingNodeCount === 0) {
                        this._finishBuildProcess(verbose, updateBuildId, vertexNodes, fragmentNodes);
                    }
                });
            }
        }
        if (waitingNodeCount !== 0) {
            return;
        }
        this._finishBuildProcess(verbose, updateBuildId, vertexNodes, fragmentNodes);
    }
    _finishBuildProcess(verbose = false, updateBuildId = true, vertexNodes, fragmentNodes) {
        // Optimize
        this.optimize();
        // Vertex
        for (const vertexOutputNode of vertexNodes) {
            vertexOutputNode.build(this._vertexCompilationState, vertexNodes);
        }
        // Fragment
        this._fragmentCompilationState.uniforms = this._vertexCompilationState.uniforms.slice(0);
        this._fragmentCompilationState._uniformDeclaration = this._vertexCompilationState._uniformDeclaration;
        this._fragmentCompilationState._constantDeclaration = this._vertexCompilationState._constantDeclaration;
        this._fragmentCompilationState._vertexState = this._vertexCompilationState;
        for (const fragmentOutputNode of fragmentNodes) {
            this._resetDualBlocks(fragmentOutputNode, this._buildId - 1);
        }
        for (const fragmentOutputNode of fragmentNodes) {
            fragmentOutputNode.build(this._fragmentCompilationState, fragmentNodes);
        }
        // Finalize
        this._vertexCompilationState.finalize(this._vertexCompilationState);
        this._fragmentCompilationState.finalize(this._fragmentCompilationState);
        if (updateBuildId) {
            this._buildId = NodeMaterial._BuildIdGenerator++;
        }
        // Errors
        const noError = this._sharedData.emitErrors(this.onBuildErrorObservable);
        if (verbose) {
            logger/* Logger */.V.Log("Vertex shader:");
            logger/* Logger */.V.Log(this._vertexCompilationState.compilationString);
            logger/* Logger */.V.Log("Fragment shader:");
            logger/* Logger */.V.Log(this._fragmentCompilationState.compilationString);
        }
        this._buildIsInProgress = false;
        this._buildWasSuccessful = true;
        if (noError) {
            this.onBuildObservable.notifyObservers(this);
        }
        // Wipe defines
        const meshes = this.getScene().meshes;
        for (const mesh of meshes) {
            if (!mesh.subMeshes) {
                continue;
            }
            for (const subMesh of mesh.subMeshes) {
                if (subMesh.getMaterial() !== this) {
                    continue;
                }
                if (!subMesh.materialDefines) {
                    continue;
                }
                const defines = subMesh.materialDefines;
                defines.markAllAsDirty();
                defines.reset();
            }
        }
        if (this.prePassTextureInputs.length) {
            this.getScene().enablePrePassRenderer();
        }
        const prePassRenderer = this.getScene().prePassRenderer;
        if (prePassRenderer) {
            prePassRenderer.markAsDirty();
        }
    }
    /**
     * Runs an optimization phase to try to improve the shader code
     */
    optimize() {
        for (const optimizer of this._optimizers) {
            optimizer.optimize(this._vertexOutputNodes, this._fragmentOutputNodes);
        }
    }
    _prepareDefinesForAttributes(mesh, defines) {
        const oldNormal = defines["NORMAL"];
        const oldTangent = defines["TANGENT"];
        const oldColor = defines["VERTEXCOLOR_NME"];
        defines["NORMAL"] = mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.NormalKind);
        defines["TANGENT"] = mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.TangentKind);
        const hasVertexColors = mesh.useVertexColors && mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.ColorKind);
        defines["VERTEXCOLOR_NME"] = hasVertexColors;
        let uvChanged = false;
        for (let i = 1; i <= 6; ++i) {
            const oldUV = defines["UV" + i];
            defines["UV" + i] = mesh.isVerticesDataPresent(`uv${i === 1 ? "" : i}`);
            uvChanged = uvChanged || defines["UV" + i] !== oldUV;
        }
        // PrePass
        const oit = this.needAlphaBlendingForMesh(mesh) && this.getScene().useOrderIndependentTransparency;
        (0,materialHelper_functions/* PrepareDefinesForPrePass */.N4)(this.getScene(), defines, !oit);
        if (oldNormal !== defines["NORMAL"] || oldTangent !== defines["TANGENT"] || oldColor !== defines["VERTEXCOLOR_NME"] || uvChanged) {
            defines.markAsAttributesDirty();
        }
    }
    /**
     * Can this material render to prepass
     */
    get isPrePassCapable() {
        return true;
    }
    /**
     * Outputs written to the prepass
     */
    get prePassTextureOutputs() {
        const prePassOutputBlock = this.getBlockByPredicate((block) => block.getClassName() === "PrePassOutputBlock");
        const result = [4];
        if (!prePassOutputBlock) {
            return result;
        }
        // Cannot write to prepass if we alread read from prepass
        if (this.prePassTextureInputs.length) {
            return result;
        }
        if (prePassOutputBlock.viewDepth.isConnected) {
            result.push(5);
        }
        if (prePassOutputBlock.screenDepth.isConnected) {
            result.push(10);
        }
        if (prePassOutputBlock.viewNormal.isConnected) {
            result.push(6);
        }
        if (prePassOutputBlock.worldNormal.isConnected) {
            result.push(8);
        }
        if (prePassOutputBlock.worldPosition.isConnected) {
            result.push(1);
        }
        return result;
    }
    /**
     * Gets the list of prepass texture required
     */
    get prePassTextureInputs() {
        const prePassTextureBlocks = this.getAllTextureBlocks().filter((block) => block.getClassName() === "PrePassTextureBlock");
        const result = [];
        for (const block of prePassTextureBlocks) {
            if (block.position.isConnected && !result.includes(1)) {
                result.push(1);
            }
            if (block.localPosition.isConnected && !result.includes(9)) {
                result.push(9);
            }
            if (block.depth.isConnected && !result.includes(5)) {
                result.push(5);
            }
            if (block.screenDepth.isConnected && !result.includes(10)) {
                result.push(10);
            }
            if (block.normal.isConnected && !result.includes(6)) {
                result.push(6);
            }
            if (block.worldNormal.isConnected && !result.includes(8)) {
                result.push(8);
            }
        }
        return result;
    }
    /**
     * Sets the required values to the prepass renderer.
     * @param prePassRenderer defines the prepass renderer to set
     * @returns true if the pre pass is needed
     */
    setPrePassRenderer(prePassRenderer) {
        const prePassTexturesRequired = this.prePassTextureInputs.concat(this.prePassTextureOutputs);
        if (prePassRenderer && prePassTexturesRequired.length > 1) {
            let cfg = prePassRenderer.getEffectConfiguration("nodeMaterial");
            if (!cfg) {
                cfg = prePassRenderer.addEffectConfiguration({
                    enabled: true,
                    needsImageProcessing: false,
                    name: "nodeMaterial",
                    texturesRequired: [],
                });
            }
            for (const prePassTexture of prePassTexturesRequired) {
                if (!cfg.texturesRequired.includes(prePassTexture)) {
                    cfg.texturesRequired.push(prePassTexture);
                }
            }
            cfg.enabled = true;
        }
        // COLOR_TEXTURE is always required for prepass, length > 1 means
        // we actually need to write to special prepass textures
        return prePassTexturesRequired.length > 1;
    }
    /**
     * Create a post process from the material
     * @param camera The camera to apply the render pass to.
     * @param options The required width/height ratio to downsize to before computing the render pass. (Use 1.0 for full size)
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)
     * @returns the post process created
     */
    createPostProcess(camera, options = 1, samplingMode = 1, engine, reusable, textureType = 0, textureFormat = 5) {
        if (this.mode !== NodeMaterialModes.PostProcess) {
            logger/* Logger */.V.Log("Incompatible material mode");
            return null;
        }
        return this._createEffectForPostProcess(null, camera, options, samplingMode, engine, reusable, textureType, textureFormat);
    }
    /**
     * Create the post process effect from the material
     * @param postProcess The post process to create the effect for
     */
    createEffectForPostProcess(postProcess) {
        this._createEffectForPostProcess(postProcess);
    }
    _createEffectForPostProcess(postProcess, camera, options = 1, samplingMode = 1, engine, reusable, textureType = 0, textureFormat = 5) {
        let tempName = this.name + this._buildId;
        const defines = new NodeMaterialDefines();
        const dummyMesh = new Meshes_mesh/* Mesh */.e(tempName + "PostProcess", this.getScene());
        let buildId = this._buildId;
        this._processDefines(dummyMesh, defines);
        Materials_effect/* Effect */.M.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString, this.shaderLanguage);
        if (!postProcess) {
            postProcess = new PostProcesses_postProcess/* PostProcess */.w(this.name + "PostProcess", tempName, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, options, camera, samplingMode, engine, reusable, defines.toString(), textureType, tempName, { maxSimultaneousLights: this.maxSimultaneousLights }, false, textureFormat, this.shaderLanguage);
        }
        else {
            postProcess.updateEffect(defines.toString(), this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, { maxSimultaneousLights: this.maxSimultaneousLights }, undefined, undefined, tempName, tempName);
        }
        postProcess.nodeMaterialSource = this;
        postProcess.onApplyObservable.add((effect) => {
            if (buildId !== this._buildId) {
                delete Materials_effect/* Effect */.M.ShadersStore[tempName + "VertexShader"];
                delete Materials_effect/* Effect */.M.ShadersStore[tempName + "PixelShader"];
                tempName = this.name + this._buildId;
                defines.markAllAsDirty();
                buildId = this._buildId;
            }
            const result = this._processDefines(dummyMesh, defines);
            if (result) {
                Materials_effect/* Effect */.M.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString);
                timingTools/* TimingTools */._.SetImmediate(() => postProcess.updateEffect(defines.toString(), this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, { maxSimultaneousLights: this.maxSimultaneousLights }, undefined, undefined, tempName, tempName));
            }
            this._checkInternals(effect);
        });
        return postProcess;
    }
    /**
     * Create a new procedural texture based on this node material
     * @param size defines the size of the texture
     * @param scene defines the hosting scene
     * @returns the new procedural texture attached to this node material
     */
    createProceduralTexture(size, scene) {
        if (this.mode !== NodeMaterialModes.ProceduralTexture) {
            logger/* Logger */.V.Log("Incompatible material mode");
            return null;
        }
        let tempName = this.name + this._buildId;
        const proceduralTexture = new ProceduralTexture(tempName, size, null, scene);
        const dummyMesh = new Meshes_mesh/* Mesh */.e(tempName + "Procedural", this.getScene());
        dummyMesh.reservedDataStore = {
            hidden: true,
        };
        const defines = new NodeMaterialDefines();
        const result = this._processDefines(dummyMesh, defines);
        Materials_effect/* Effect */.M.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString, this.shaderLanguage);
        let effect = this.getScene().getEngine().createEffect({
            vertexElement: tempName,
            fragmentElement: tempName,
        }, [Buffers_buffer/* VertexBuffer */.R.PositionKind], this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, defines.toString(), result?.fallbacks, undefined, undefined, undefined, this.shaderLanguage);
        proceduralTexture.nodeMaterialSource = this;
        proceduralTexture._setEffect(effect);
        let buildId = this._buildId;
        const refreshEffect = () => {
            if (buildId !== this._buildId) {
                delete Materials_effect/* Effect */.M.ShadersStore[tempName + "VertexShader"];
                delete Materials_effect/* Effect */.M.ShadersStore[tempName + "PixelShader"];
                tempName = this.name + this._buildId;
                defines.markAllAsDirty();
                buildId = this._buildId;
            }
            const result = this._processDefines(dummyMesh, defines);
            if (result) {
                Materials_effect/* Effect */.M.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString, this.shaderLanguage);
                timingTools/* TimingTools */._.SetImmediate(() => {
                    effect = this.getScene().getEngine().createEffect({
                        vertexElement: tempName,
                        fragmentElement: tempName,
                    }, [Buffers_buffer/* VertexBuffer */.R.PositionKind], this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, defines.toString(), result?.fallbacks, undefined);
                    proceduralTexture._setEffect(effect);
                });
            }
            this._checkInternals(effect);
        };
        proceduralTexture.onBeforeGenerationObservable.add(() => {
            refreshEffect();
        });
        // This is needed if the procedural texture is not set to refresh automatically
        this.onBuildObservable.add(() => {
            refreshEffect();
        });
        return proceduralTexture;
    }
    _createEffectForParticles(particleSystem, blendMode, onCompiled, onError, effect, defines, dummyMesh, particleSystemDefinesJoined = "") {
        let tempName = this.name + this._buildId + "_" + blendMode;
        if (!defines) {
            defines = new NodeMaterialDefines();
        }
        if (!dummyMesh) {
            dummyMesh = this.getScene().getMeshByName(this.name + "Particle");
            if (!dummyMesh) {
                dummyMesh = new Meshes_mesh/* Mesh */.e(this.name + "Particle", this.getScene());
                dummyMesh.reservedDataStore = {
                    hidden: true,
                };
            }
        }
        let buildId = this._buildId;
        const particleSystemDefines = [];
        let join = particleSystemDefinesJoined;
        if (!effect) {
            const result = this._processDefines(dummyMesh, defines);
            Materials_effect/* Effect */.M.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, undefined, this.shaderLanguage);
            particleSystem.fillDefines(particleSystemDefines, blendMode, false);
            join = particleSystemDefines.join("\n");
            effect = this.getScene()
                .getEngine()
                .createEffectForParticles(tempName, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, defines.toString() + "\n" + join, result?.fallbacks, onCompiled, onError, particleSystem, this.shaderLanguage);
            particleSystem.setCustomEffect(effect, blendMode);
        }
        effect.onBindObservable.add((effect) => {
            if (buildId !== this._buildId) {
                delete Materials_effect/* Effect */.M.ShadersStore[tempName + "PixelShader"];
                tempName = this.name + this._buildId + "_" + blendMode;
                defines.markAllAsDirty();
                buildId = this._buildId;
            }
            particleSystemDefines.length = 0;
            particleSystem.fillDefines(particleSystemDefines, blendMode, false);
            const particleSystemDefinesJoinedCurrent = particleSystemDefines.join("\n");
            if (particleSystemDefinesJoinedCurrent !== join) {
                defines.markAllAsDirty();
                join = particleSystemDefinesJoinedCurrent;
            }
            const result = this._processDefines(dummyMesh, defines);
            if (result) {
                Materials_effect/* Effect */.M.RegisterShader(tempName, this._fragmentCompilationState._builtCompilationString, undefined, this.shaderLanguage);
                effect = this.getScene()
                    .getEngine()
                    .createEffectForParticles(tempName, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, defines.toString() + "\n" + join, result?.fallbacks, onCompiled, onError, particleSystem);
                particleSystem.setCustomEffect(effect, blendMode);
                this._createEffectForParticles(particleSystem, blendMode, onCompiled, onError, effect, defines, dummyMesh, particleSystemDefinesJoined); // add the effect.onBindObservable observer
                return;
            }
            this._checkInternals(effect);
        });
    }
    _checkInternals(effect) {
        // Animated blocks
        if (this._sharedData.animatedInputs) {
            const scene = this.getScene();
            const frameId = scene.getFrameId();
            if (this._animationFrame !== frameId) {
                for (const input of this._sharedData.animatedInputs) {
                    input.animate(scene);
                }
                this._animationFrame = frameId;
            }
        }
        // Bindable blocks
        for (const block of this._sharedData.bindableBlocks) {
            block.bind(effect, this);
        }
        // Connection points
        for (const inputBlock of this._sharedData.inputBlocks) {
            inputBlock._transmit(effect, this.getScene(), this);
        }
    }
    /**
     * Create the effect to be used as the custom effect for a particle system
     * @param particleSystem Particle system to create the effect for
     * @param onCompiled defines a function to call when the effect creation is successful
     * @param onError defines a function to call when the effect creation has failed
     */
    createEffectForParticles(particleSystem, onCompiled, onError) {
        if (this.mode !== NodeMaterialModes.Particle) {
            logger/* Logger */.V.Log("Incompatible material mode");
            return;
        }
        this._createEffectForParticles(particleSystem, BaseParticleSystem.BLENDMODE_ONEONE, onCompiled, onError);
        this._createEffectForParticles(particleSystem, BaseParticleSystem.BLENDMODE_MULTIPLY, onCompiled, onError);
    }
    /**
     * Use this material as the shadow depth wrapper of a target material
     * @param targetMaterial defines the target material
     */
    createAsShadowDepthWrapper(targetMaterial) {
        if (this.mode !== NodeMaterialModes.Material) {
            logger/* Logger */.V.Log("Incompatible material mode");
            return;
        }
        targetMaterial.shadowDepthWrapper = new BABYLON.ShadowDepthWrapper(this, this.getScene());
    }
    _processDefines(mesh, defines, useInstances = false, subMesh) {
        let result = null;
        // Global defines
        const scene = this.getScene();
        if ((0,materialHelper_functions/* PrepareDefinesForCamera */.Y7)(scene, defines)) {
            defines.markAsMiscDirty();
        }
        // Shared defines
        this._sharedData.blocksWithDefines.forEach((b) => {
            b.initializeDefines(mesh, this, defines, useInstances);
        });
        this._sharedData.blocksWithDefines.forEach((b) => {
            b.prepareDefines(mesh, this, defines, useInstances, subMesh);
        });
        // Need to recompile?
        if (defines.isDirty) {
            const lightDisposed = defines._areLightsDisposed;
            defines.markAsProcessed();
            // Repeatable content generators
            this._vertexCompilationState.compilationString = this._vertexCompilationState._builtCompilationString;
            this._fragmentCompilationState.compilationString = this._fragmentCompilationState._builtCompilationString;
            this._sharedData.repeatableContentBlocks.forEach((b) => {
                b.replaceRepeatableContent(this._vertexCompilationState, this._fragmentCompilationState, mesh, defines);
            });
            // Uniforms
            const uniformBuffers = [];
            this._sharedData.dynamicUniformBlocks.forEach((b) => {
                b.updateUniformsAndSamples(this._vertexCompilationState, this, defines, uniformBuffers);
            });
            const mergedUniforms = this._vertexCompilationState.uniforms;
            this._fragmentCompilationState.uniforms.forEach((u) => {
                const index = mergedUniforms.indexOf(u);
                if (index === -1) {
                    mergedUniforms.push(u);
                }
            });
            // Samplers
            const mergedSamplers = this._vertexCompilationState.samplers;
            this._fragmentCompilationState.samplers.forEach((s) => {
                const index = mergedSamplers.indexOf(s);
                if (index === -1) {
                    mergedSamplers.push(s);
                }
            });
            const fallbacks = new effectFallbacks/* EffectFallbacks */.J();
            this._sharedData.blocksWithFallbacks.forEach((b) => {
                b.provideFallbacks(mesh, fallbacks);
            });
            result = {
                lightDisposed,
                uniformBuffers,
                mergedUniforms,
                mergedSamplers,
                fallbacks,
            };
        }
        return result;
    }
    /**
     * Get if the submesh is ready to be used and all its information available.
     * Child classes can use it to update shaders
     * @param mesh defines the mesh to check
     * @param subMesh defines which submesh to check
     * @param useInstances specifies that instances should be used
     * @returns a boolean indicating that the submesh is ready or not
     */
    isReadyForSubMesh(mesh, subMesh, useInstances = false) {
        if (!this._buildWasSuccessful) {
            return false;
        }
        const scene = this.getScene();
        if (this._sharedData.animatedInputs) {
            const frameId = scene.getFrameId();
            if (this._animationFrame !== frameId) {
                for (const input of this._sharedData.animatedInputs) {
                    input.animate(scene);
                }
                this._animationFrame = frameId;
            }
        }
        const drawWrapper = subMesh._drawWrapper;
        if (drawWrapper.effect && this.isFrozen) {
            if (drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            subMesh.materialDefines = new NodeMaterialDefines();
        }
        const defines = subMesh.materialDefines;
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        const engine = scene.getEngine();
        this._prepareDefinesForAttributes(mesh, defines);
        // Check if blocks are ready
        if (this._sharedData.blockingBlocks.some((b) => !b.isReady(mesh, this, defines, useInstances))) {
            return false;
        }
        const result = this._processDefines(mesh, defines, useInstances, subMesh);
        if (result) {
            const previousEffect = subMesh.effect;
            // Compilation
            const join = defines.toString();
            let effect = engine.createEffect({
                vertex: "nodeMaterial" + this._buildId,
                fragment: "nodeMaterial" + this._buildId,
                vertexSource: this._vertexCompilationState.compilationString,
                fragmentSource: this._fragmentCompilationState.compilationString,
            }, {
                attributes: this._vertexCompilationState.attributes,
                uniformsNames: result.mergedUniforms,
                uniformBuffersNames: result.uniformBuffers,
                samplers: result.mergedSamplers,
                defines: join,
                fallbacks: result.fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                multiTarget: defines.PREPASS,
                indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS },
                shaderLanguage: this.shaderLanguage,
            }, engine);
            if (effect) {
                if (this._onEffectCreatedObservable) {
                    onCreatedEffectParameters.effect = effect;
                    onCreatedEffectParameters.subMesh = subMesh;
                    this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters);
                }
                // Use previous effect while new one is compiling
                if (this.allowShaderHotSwapping && previousEffect && !effect.isReady()) {
                    effect = previousEffect;
                    defines.markAsUnprocessed();
                    if (result.lightDisposed) {
                        // re register in case it takes more than one frame.
                        defines._areLightsDisposed = true;
                        return false;
                    }
                }
                else {
                    scene.resetCachedMaterial();
                    subMesh.setEffect(effect, defines, this._materialContext);
                }
            }
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        drawWrapper._wasPreviouslyReady = true;
        drawWrapper._wasPreviouslyUsingInstances = useInstances;
        this._checkScenePerformancePriority();
        return true;
    }
    /**
     * Get a string representing the shaders built by the current node graph
     */
    get compiledShaders() {
        if (!this._buildWasSuccessful) {
            this.build();
        }
        return `// Vertex shader\n${this._vertexCompilationState.compilationString}\n\n// Fragment shader\n${this._fragmentCompilationState.compilationString}`;
    }
    /**
     * Binds the world matrix to the material
     * @param world defines the world transformation matrix
     */
    bindOnlyWorldMatrix(world) {
        const scene = this.getScene();
        if (!this._activeEffect) {
            return;
        }
        const hints = this._sharedData.hints;
        if (hints.needWorldViewMatrix) {
            world.multiplyToRef(scene.getViewMatrix(), this._cachedWorldViewMatrix);
        }
        if (hints.needWorldViewProjectionMatrix) {
            world.multiplyToRef(scene.getTransformMatrix(), this._cachedWorldViewProjectionMatrix);
        }
        // Connection points
        for (const inputBlock of this._sharedData.inputBlocks) {
            inputBlock._transmitWorld(this._activeEffect, world, this._cachedWorldViewMatrix, this._cachedWorldViewProjectionMatrix);
        }
    }
    /**
     * Binds the submesh to this material by preparing the effect and shader to draw
     * @param world defines the world transformation matrix
     * @param mesh defines the mesh containing the submesh
     * @param subMesh defines the submesh to bind the material to
     */
    bindForSubMesh(world, mesh, subMesh) {
        const scene = this.getScene();
        const effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices
        this.bindOnlyWorldMatrix(world);
        const mustRebind = this._mustRebind(scene, effect, subMesh, mesh.visibility);
        const sharedData = this._sharedData;
        if (mustRebind) {
            // Bindable blocks
            for (const block of sharedData.bindableBlocks) {
                block.bind(effect, this, mesh, subMesh);
            }
            for (const block of sharedData.forcedBindableBlocks) {
                block.bind(effect, this, mesh, subMesh);
            }
            // Connection points
            for (const inputBlock of sharedData.inputBlocks) {
                inputBlock._transmit(effect, scene, this);
            }
        }
        else if (!this.isFrozen) {
            for (const block of sharedData.forcedBindableBlocks) {
                block.bind(effect, this, mesh, subMesh);
            }
        }
        this._afterBind(mesh, this._activeEffect, subMesh);
    }
    /**
     * Gets the active textures from the material
     * @returns an array of textures
     */
    getActiveTextures() {
        const activeTextures = super.getActiveTextures();
        if (this._sharedData) {
            activeTextures.push(...this._sharedData.textureBlocks.filter((tb) => tb.texture).map((tb) => tb.texture));
        }
        return activeTextures;
    }
    /**
     * Gets the list of texture blocks
     * Note that this method will only return blocks that are reachable from the final block(s) and only after the material has been built!
     * @returns an array of texture blocks
     */
    getTextureBlocks() {
        if (!this._sharedData) {
            return [];
        }
        return this._sharedData.textureBlocks;
    }
    /**
     * Gets the list of all texture blocks
     * Note that this method will scan all attachedBlocks and return blocks that are texture blocks
     * @returns
     */
    getAllTextureBlocks() {
        const textureBlocks = [];
        for (const block of this.attachedBlocks) {
            if (NodeMaterial._BlockIsTextureBlock(block)) {
                textureBlocks.push(block);
            }
        }
        return textureBlocks;
    }
    /**
     * Specifies if the material uses a texture
     * @param texture defines the texture to check against the material
     * @returns a boolean specifying if the material uses the texture
     */
    hasTexture(texture) {
        if (super.hasTexture(texture)) {
            return true;
        }
        if (!this._sharedData) {
            return false;
        }
        for (const t of this._sharedData.textureBlocks) {
            if (t.texture === texture) {
                return true;
            }
        }
        return false;
    }
    /**
     * Disposes the material
     * @param forceDisposeEffect specifies if effects should be forcefully disposed
     * @param forceDisposeTextures specifies if textures should be forcefully disposed
     * @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
     */
    dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh) {
        if (forceDisposeTextures) {
            for (const texture of this.getTextureBlocks()
                .filter((tb) => tb.texture)
                .map((tb) => tb.texture)) {
                texture.dispose();
            }
        }
        for (const block of this.attachedBlocks) {
            block.dispose();
        }
        this.attachedBlocks.length = 0;
        this._sharedData = null;
        this._vertexCompilationState = null;
        this._fragmentCompilationState = null;
        this.onBuildObservable.clear();
        this.onBuildErrorObservable.clear();
        if (this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
            this._imageProcessingObserver = null;
        }
        super.dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh);
    }
    /** Creates the node editor window.
     * @param additionalConfig Define the configuration of the editor
     */
    _createNodeEditor(additionalConfig) {
        const nodeEditorConfig = {
            nodeMaterial: this,
            ...additionalConfig,
        };
        this.BJSNODEMATERIALEDITOR.NodeEditor.Show(nodeEditorConfig);
    }
    /**
     * Launch the node material editor
     * @param config Define the configuration of the editor
     * @returns a promise fulfilled when the node editor is visible
     */
    edit(config) {
        return new Promise((resolve) => {
            this.BJSNODEMATERIALEDITOR = this.BJSNODEMATERIALEDITOR || this._getGlobalNodeMaterialEditor();
            if (typeof this.BJSNODEMATERIALEDITOR == "undefined") {
                const editorUrl = config && config.editorURL ? config.editorURL : NodeMaterial.EditorURL;
                // Load editor and add it to the DOM
                tools/* Tools */.S0.LoadBabylonScript(editorUrl, () => {
                    this.BJSNODEMATERIALEDITOR = this.BJSNODEMATERIALEDITOR || this._getGlobalNodeMaterialEditor();
                    this._createNodeEditor(config?.nodeEditorConfig);
                    resolve();
                });
            }
            else {
                // Otherwise creates the editor
                this._createNodeEditor(config?.nodeEditorConfig);
                resolve();
            }
        });
    }
    /**
     * Clear the current material
     */
    clear() {
        this._vertexOutputNodes.length = 0;
        this._fragmentOutputNodes.length = 0;
        this.attachedBlocks.length = 0;
        this._buildIsInProgress = false;
    }
    /**
     * Clear the current material and set it to a default state
     */
    setToDefault() {
        this.clear();
        this.editorData = null;
        const positionInput = new InputBlock("Position");
        positionInput.setAsAttribute("position");
        const worldInput = new InputBlock("World");
        worldInput.setAsSystemValue(NodeMaterialSystemValues.World);
        const worldPos = new TransformBlock("WorldPos");
        positionInput.connectTo(worldPos);
        worldInput.connectTo(worldPos);
        const viewProjectionInput = new InputBlock("ViewProjection");
        viewProjectionInput.setAsSystemValue(NodeMaterialSystemValues.ViewProjection);
        const worldPosdMultipliedByViewProjection = new TransformBlock("WorldPos * ViewProjectionTransform");
        worldPos.connectTo(worldPosdMultipliedByViewProjection);
        viewProjectionInput.connectTo(worldPosdMultipliedByViewProjection);
        const vertexOutput = new VertexOutputBlock("VertexOutput");
        worldPosdMultipliedByViewProjection.connectTo(vertexOutput);
        // Pixel
        const pixelColor = new InputBlock("color");
        pixelColor.value = new math_color/* Color4 */.ov(0.8, 0.8, 0.8, 1);
        const fragmentOutput = new FragmentOutputBlock("FragmentOutput");
        pixelColor.connectTo(fragmentOutput);
        // Add to nodes
        this.addOutputNode(vertexOutput);
        this.addOutputNode(fragmentOutput);
        this._mode = NodeMaterialModes.Material;
    }
    /**
     * Clear the current material and set it to a default state for post process
     */
    setToDefaultPostProcess() {
        this.clear();
        this.editorData = null;
        const position = new InputBlock("Position");
        position.setAsAttribute("position2d");
        const const1 = new InputBlock("Constant1");
        const1.isConstant = true;
        const1.value = 1;
        const vmerger = new VectorMergerBlock("Position3D");
        position.connectTo(vmerger);
        const1.connectTo(vmerger, { input: "w" });
        const vertexOutput = new VertexOutputBlock("VertexOutput");
        vmerger.connectTo(vertexOutput);
        // Pixel
        const scale = new InputBlock("Scale");
        scale.visibleInInspector = true;
        scale.value = new math_vector/* Vector2 */.I9(1, 1);
        const uv0 = new RemapBlock("uv0");
        position.connectTo(uv0);
        const uv = new MultiplyBlock("UV scale");
        uv0.connectTo(uv);
        scale.connectTo(uv);
        const currentScreen = new CurrentScreenBlock("CurrentScreen");
        uv.connectTo(currentScreen);
        currentScreen.texture = new Textures_texture/* Texture */.g("https://assets.babylonjs.com/nme/currentScreenPostProcess.png", this.getScene());
        const fragmentOutput = new FragmentOutputBlock("FragmentOutput");
        currentScreen.connectTo(fragmentOutput, { output: "rgba" });
        // Add to nodes
        this.addOutputNode(vertexOutput);
        this.addOutputNode(fragmentOutput);
        this._mode = NodeMaterialModes.PostProcess;
    }
    /**
     * Clear the current material and set it to a default state for procedural texture
     */
    setToDefaultProceduralTexture() {
        this.clear();
        this.editorData = null;
        const position = new InputBlock("Position");
        position.setAsAttribute("position2d");
        const const1 = new InputBlock("Constant1");
        const1.isConstant = true;
        const1.value = 1;
        const vmerger = new VectorMergerBlock("Position3D");
        position.connectTo(vmerger);
        const1.connectTo(vmerger, { input: "w" });
        const vertexOutput = new VertexOutputBlock("VertexOutput");
        vmerger.connectTo(vertexOutput);
        // Pixel
        const time = new InputBlock("Time");
        time.value = 0;
        time.min = 0;
        time.max = 0;
        time.isBoolean = false;
        time.matrixMode = 0;
        time.animationType = AnimatedInputBlockTypes.Time;
        time.isConstant = false;
        const color = new InputBlock("Color3");
        color.value = new math_color/* Color3 */.v9(1, 1, 1);
        color.isConstant = false;
        const fragmentOutput = new FragmentOutputBlock("FragmentOutput");
        const vectorMerger = new VectorMergerBlock("VectorMerger");
        vectorMerger.visibleInInspector = false;
        const cos = new TrigonometryBlock("Cos");
        cos.operation = TrigonometryBlockOperations.Cos;
        position.connectTo(vectorMerger);
        time.output.connectTo(cos.input);
        cos.output.connectTo(vectorMerger.z);
        vectorMerger.xyzOut.connectTo(fragmentOutput.rgb);
        // Add to nodes
        this.addOutputNode(vertexOutput);
        this.addOutputNode(fragmentOutput);
        this._mode = NodeMaterialModes.ProceduralTexture;
    }
    /**
     * Clear the current material and set it to a default state for particle
     */
    setToDefaultParticle() {
        this.clear();
        this.editorData = null;
        // Pixel
        const uv = new InputBlock("uv");
        uv.setAsAttribute("particle_uv");
        const texture = new ParticleTextureBlock("ParticleTexture");
        uv.connectTo(texture);
        const color = new InputBlock("Color");
        color.setAsAttribute("particle_color");
        const multiply = new MultiplyBlock("Texture * Color");
        texture.connectTo(multiply);
        color.connectTo(multiply);
        const rampGradient = new ParticleRampGradientBlock("ParticleRampGradient");
        multiply.connectTo(rampGradient);
        const cSplitter = new ColorSplitterBlock("ColorSplitter");
        color.connectTo(cSplitter);
        const blendMultiply = new ParticleBlendMultiplyBlock("ParticleBlendMultiply");
        rampGradient.connectTo(blendMultiply);
        texture.connectTo(blendMultiply, { output: "a" });
        cSplitter.connectTo(blendMultiply, { output: "a" });
        const fragmentOutput = new FragmentOutputBlock("FragmentOutput");
        blendMultiply.connectTo(fragmentOutput);
        // Add to nodes
        this.addOutputNode(fragmentOutput);
        this._mode = NodeMaterialModes.Particle;
    }
    /**
     * Loads the current Node Material from a url pointing to a file save by the Node Material Editor
     * @deprecated Please use NodeMaterial.ParseFromFileAsync instead
     * @param url defines the url to load from
     * @param rootUrl defines the root URL for nested url in the node material
     * @returns a promise that will fulfil when the material is fully loaded
     */
    async loadAsync(url, rootUrl = "") {
        return NodeMaterial.ParseFromFileAsync("", url, this.getScene(), rootUrl, true, this);
    }
    _gatherBlocks(rootNode, list) {
        if (list.indexOf(rootNode) !== -1) {
            return;
        }
        list.push(rootNode);
        for (const input of rootNode.inputs) {
            const connectedPoint = input.connectedPoint;
            if (connectedPoint) {
                const block = connectedPoint.ownerBlock;
                if (block !== rootNode) {
                    this._gatherBlocks(block, list);
                }
            }
        }
        // Teleportation
        if (rootNode.isTeleportOut) {
            const block = rootNode;
            if (block.entryPoint) {
                this._gatherBlocks(block.entryPoint, list);
            }
        }
    }
    /**
     * Generate a string containing the code declaration required to create an equivalent of this material
     * @returns a string
     */
    generateCode() {
        let alreadyDumped = [];
        const vertexBlocks = [];
        const uniqueNames = ["const", "var", "let"];
        // Gets active blocks
        for (const outputNode of this._vertexOutputNodes) {
            this._gatherBlocks(outputNode, vertexBlocks);
        }
        const fragmentBlocks = [];
        for (const outputNode of this._fragmentOutputNodes) {
            this._gatherBlocks(outputNode, fragmentBlocks);
        }
        // Generate vertex shader
        let codeString = `var nodeMaterial = new BABYLON.NodeMaterial("${this.name || "node material"}");\n`;
        codeString += `nodeMaterial.mode = BABYLON.NodeMaterialModes.${NodeMaterialModes[this.mode]};\n`;
        for (const node of vertexBlocks) {
            if (node.isInput && alreadyDumped.indexOf(node) === -1) {
                codeString += node._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        // Generate fragment shader
        for (const node of fragmentBlocks) {
            if (node.isInput && alreadyDumped.indexOf(node) === -1) {
                codeString += node._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        // Connections
        alreadyDumped = [];
        codeString += "\n// Connections\n";
        for (const node of this._vertexOutputNodes) {
            codeString += node._dumpCodeForOutputConnections(alreadyDumped);
        }
        for (const node of this._fragmentOutputNodes) {
            codeString += node._dumpCodeForOutputConnections(alreadyDumped);
        }
        // Output nodes
        codeString += "\n// Output nodes\n";
        for (const node of this._vertexOutputNodes) {
            codeString += `nodeMaterial.addOutputNode(${node._codeVariableName});\n`;
        }
        for (const node of this._fragmentOutputNodes) {
            codeString += `nodeMaterial.addOutputNode(${node._codeVariableName});\n`;
        }
        codeString += `nodeMaterial.build();\n`;
        return codeString;
    }
    /**
     * Serializes this material in a JSON representation
     * @param selectedBlocks defines an optional list of blocks to serialize
     * @returns the serialized material object
     */
    serialize(selectedBlocks) {
        const serializationObject = selectedBlocks ? {} : decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy
        let blocks = [];
        if (selectedBlocks) {
            blocks = selectedBlocks;
        }
        else {
            serializationObject.customType = "BABYLON.NodeMaterial";
            serializationObject.outputNodes = [];
            // Outputs
            for (const outputNode of this._vertexOutputNodes) {
                this._gatherBlocks(outputNode, blocks);
                serializationObject.outputNodes.push(outputNode.uniqueId);
            }
            for (const outputNode of this._fragmentOutputNodes) {
                this._gatherBlocks(outputNode, blocks);
                if (serializationObject.outputNodes.indexOf(outputNode.uniqueId) === -1) {
                    serializationObject.outputNodes.push(outputNode.uniqueId);
                }
            }
        }
        // Blocks
        serializationObject.blocks = [];
        for (const block of blocks) {
            serializationObject.blocks.push(block.serialize());
        }
        if (!selectedBlocks) {
            for (const block of this.attachedBlocks) {
                if (blocks.indexOf(block) !== -1) {
                    continue;
                }
                serializationObject.blocks.push(block.serialize());
            }
        }
        serializationObject.uniqueId = this.uniqueId;
        return serializationObject;
    }
    _restoreConnections(block, source, map) {
        for (const outputPoint of block.outputs) {
            for (const candidate of source.blocks) {
                const target = map[candidate.id];
                if (!target) {
                    continue;
                }
                for (const input of candidate.inputs) {
                    if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {
                        const inputPoint = target.getInputByName(input.inputName);
                        if (!inputPoint || inputPoint.isConnected) {
                            continue;
                        }
                        outputPoint.connectTo(inputPoint, true);
                        this._restoreConnections(target, source, map);
                        continue;
                    }
                }
            }
        }
    }
    /**
     * Clear the current graph and load a new one from a serialization object
     * @param source defines the JSON representation of the material
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @param merge defines whether or not the source must be merged or replace the current content
     * @param urlRewriter defines a function used to rewrite urls
     */
    parseSerializedObject(source, rootUrl = "", merge = false, urlRewriter) {
        if (!merge) {
            this.clear();
        }
        const map = {};
        // Create blocks
        for (const parsedBlock of source.blocks) {
            const blockType = (0,typeStore/* GetClass */.n9)(parsedBlock.customType);
            if (blockType) {
                const block = new blockType();
                block._deserialize(parsedBlock, this.getScene(), rootUrl, urlRewriter);
                map[parsedBlock.id] = block;
                this.attachedBlocks.push(block);
            }
        }
        // Reconnect teleportation
        for (const block of this.attachedBlocks) {
            if (block.isTeleportOut) {
                const teleportOut = block;
                const id = teleportOut._tempEntryPointUniqueId;
                if (id) {
                    const source = map[id];
                    source.attachToEndpoint(teleportOut);
                }
            }
        }
        // Connections - Starts with input blocks only (except if in "merge" mode where we scan all blocks)
        for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {
            const parsedBlock = source.blocks[blockIndex];
            const block = map[parsedBlock.id];
            if (!block) {
                continue;
            }
            if (block.inputs.length && !merge) {
                continue;
            }
            this._restoreConnections(block, source, map);
        }
        // Outputs
        if (source.outputNodes) {
            for (const outputNodeId of source.outputNodes) {
                this.addOutputNode(map[outputNodeId]);
            }
        }
        // UI related info
        if (source.locations || (source.editorData && source.editorData.locations)) {
            const locations = source.locations || source.editorData.locations;
            for (const location of locations) {
                if (map[location.blockId]) {
                    location.blockId = map[location.blockId].uniqueId;
                }
            }
            if (merge && this.editorData && this.editorData.locations) {
                locations.concat(this.editorData.locations);
            }
            if (source.locations) {
                this.editorData = {
                    locations: locations,
                };
            }
            else {
                this.editorData = source.editorData;
                this.editorData.locations = locations;
            }
            const blockMap = [];
            for (const key in map) {
                blockMap[key] = map[key].uniqueId;
            }
            this.editorData.map = blockMap;
        }
        this.comment = source.comment;
        if (source.forceAlphaBlending !== undefined) {
            this.forceAlphaBlending = source.forceAlphaBlending;
        }
        if (source.alphaMode !== undefined) {
            this.alphaMode = source.alphaMode;
        }
        if (!merge) {
            this._mode = source.mode ?? NodeMaterialModes.Material;
        }
    }
    /**
     * Clear the current graph and load a new one from a serialization object
     * @param source defines the JSON representation of the material
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @param merge defines whether or not the source must be merged or replace the current content
     * @deprecated Please use the parseSerializedObject method instead
     */
    loadFromSerialization(source, rootUrl = "", merge = false) {
        this.parseSerializedObject(source, rootUrl, merge);
    }
    /**
     * Makes a duplicate of the current material.
     * @param name defines the name to use for the new material
     * @param shareEffect defines if the clone material should share the same effect (default is false)
     * @returns the cloned material
     */
    clone(name, shareEffect = false) {
        const serializationObject = this.serialize();
        const clone = decorators_serialization/* SerializationHelper */.p.Clone(() => new NodeMaterial(name, this.getScene(), this.options), this);
        clone.id = name;
        clone.name = name;
        clone.parseSerializedObject(serializationObject);
        clone._buildId = this._buildId;
        clone.build(false, !shareEffect);
        return clone;
    }
    /**
     * Awaits for all the material textures to be ready before resolving the returned promise.
     * @returns A promise that resolves when the textures are ready.
     */
    whenTexturesReadyAsync() {
        // Ensures all textures are ready to render.
        const textureReadyPromises = [];
        this.getActiveTextures().forEach((texture) => {
            const internalTexture = texture.getInternalTexture();
            if (internalTexture && !internalTexture.isReady) {
                textureReadyPromises.push(new Promise((textureResolve, textureReject) => {
                    internalTexture.onLoadedObservable.addOnce(() => {
                        textureResolve();
                    });
                    internalTexture.onErrorObservable.addOnce((e) => {
                        textureReject(e);
                    });
                }));
            }
        });
        return Promise.all(textureReadyPromises);
    }
    /**
     * Creates a node material from parsed material data
     * @param source defines the JSON representation of the material
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @param shaderLanguage defines the language to use (GLSL by default)
     * @returns a new node material
     */
    static Parse(source, scene, rootUrl = "", shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        const nodeMaterial = decorators_serialization/* SerializationHelper */.p.Parse(() => new NodeMaterial(source.name, scene, { shaderLanguage: shaderLanguage }), source, scene, rootUrl);
        nodeMaterial.parseSerializedObject(source, rootUrl);
        nodeMaterial.build();
        return nodeMaterial;
    }
    /**
     * Creates a node material from a snippet saved in a remote file
     * @param name defines the name of the material to create
     * @param url defines the url to load from
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL for nested url in the node material
     * @param skipBuild defines whether to build the node material
     * @param targetMaterial defines a material to use instead of creating a new one
     * @param urlRewriter defines a function used to rewrite urls
     * @returns a promise that will resolve to the new node material
     */
    static async ParseFromFileAsync(name, url, scene, rootUrl = "", skipBuild = false, targetMaterial, urlRewriter) {
        const material = targetMaterial ?? new NodeMaterial(name, scene);
        const data = await scene._loadFileAsync(url);
        const serializationObject = JSON.parse(data);
        material.parseSerializedObject(serializationObject, rootUrl, undefined, urlRewriter);
        if (!skipBuild) {
            material.build();
        }
        return material;
    }
    /**
     * Creates a node material from a snippet saved by the node material editor
     * @param snippetId defines the snippet to load
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @param nodeMaterial defines a node material to update (instead of creating a new one)
     * @param skipBuild defines whether to build the node material
     * @param waitForTextureReadyness defines whether to wait for texture readiness resolving the promise (default: false)
     * @param urlRewriter defines a function used to rewrite urls
     * @returns a promise that will resolve to the new node material
     */
    static ParseFromSnippetAsync(snippetId, scene = engineStore/* EngineStore */.q.LastCreatedScene, rootUrl = "", nodeMaterial, skipBuild = false, waitForTextureReadyness = false, urlRewriter) {
        if (snippetId === "_BLANK") {
            return Promise.resolve(NodeMaterial.CreateDefault("blank", scene));
        }
        return new Promise((resolve, reject) => {
            const request = new webRequest/* WebRequest */.u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);
                        const serializationObject = JSON.parse(snippet.nodeMaterial);
                        if (!nodeMaterial) {
                            nodeMaterial = decorators_serialization/* SerializationHelper */.p.Parse(() => new NodeMaterial(snippetId, scene), serializationObject, scene, rootUrl);
                            nodeMaterial.uniqueId = scene.getUniqueId();
                        }
                        nodeMaterial.parseSerializedObject(serializationObject, undefined, undefined, urlRewriter);
                        nodeMaterial.snippetId = snippetId;
                        // We reset sideOrientation to default value
                        nodeMaterial.sideOrientation = null;
                        try {
                            if (!skipBuild) {
                                nodeMaterial.build();
                            }
                        }
                        catch (err) {
                            reject(err);
                        }
                        if (waitForTextureReadyness) {
                            nodeMaterial
                                .whenTexturesReadyAsync()
                                .then(() => {
                                resolve(nodeMaterial);
                            })
                                .catch((err) => {
                                reject(err);
                            });
                        }
                        else {
                            resolve(nodeMaterial);
                        }
                    }
                    else {
                        reject("Unable to load the snippet " + snippetId);
                    }
                }
            });
            request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/"));
            request.send();
        });
    }
    /**
     * Creates a new node material set to default basic configuration
     * @param name defines the name of the material
     * @param scene defines the hosting scene
     * @returns a new NodeMaterial
     */
    static CreateDefault(name, scene) {
        const newMaterial = new NodeMaterial(name, scene);
        newMaterial.setToDefault();
        newMaterial.build();
        return newMaterial;
    }
}
NodeMaterial._BuildIdGenerator = 0;
/** Define the Url to load node editor script */
NodeMaterial.EditorURL = `${tools/* Tools */.S0._DefaultCdnUrl}/v${abstractEngine/* AbstractEngine */.$.Version}/nodeEditor/babylon.nodeEditor.js`;
/** Define the Url to load snippets */
NodeMaterial.SnippetUrl = `https://snippet.babylonjs.com`;
/** Gets or sets a boolean indicating that node materials should not deserialize textures from json / snippet content */
NodeMaterial.IgnoreTexturesAtLoadTime = false;
/** Defines default shader language when no option is defined */
NodeMaterial.DefaultShaderLanguage = 0 /* ShaderLanguage.GLSL */;
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], NodeMaterial.prototype, "ignoreAlpha", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], NodeMaterial.prototype, "maxSimultaneousLights", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("mode")
], NodeMaterial.prototype, "_mode", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("comment")
], NodeMaterial.prototype, "comment", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], NodeMaterial.prototype, "forceAlphaBlending", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeMaterial", NodeMaterial);
//# sourceMappingURL=nodeMaterial.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/subMesh.js
var subMesh = __webpack_require__(65907);
;// ./node_modules/@babylonjs/core/Meshes/subMesh.project.js



/**
 * @internal
 */
subMesh/* SubMesh */.K.prototype._projectOnTrianglesToRef = function (vector, positions, indices, step, checkStopper, ref) {
    // Triangles test
    const proj = math_vector/* TmpVectors */.AA.Vector3[0];
    const tmp = math_vector/* TmpVectors */.AA.Vector3[1];
    let distance = +Infinity;
    for (let index = this.indexStart; index < this.indexStart + this.indexCount - (3 - step); index += step) {
        const indexA = indices[index];
        const indexB = indices[index + 1];
        const indexC = indices[index + 2];
        if (checkStopper && indexC === 0xffffffff) {
            index += 2;
            continue;
        }
        const p0 = positions[indexA];
        const p1 = positions[indexB];
        const p2 = positions[indexC];
        // stay defensive and don't check against undefined positions.
        if (!p0 || !p1 || !p2) {
            continue;
        }
        const tmpDist = math_vector/* Vector3 */.Pq.ProjectOnTriangleToRef(vector, p0, p1, p2, tmp);
        if (tmpDist < distance) {
            proj.copyFrom(tmp);
            distance = tmpDist;
        }
    }
    ref.copyFrom(proj);
    return distance;
};
/**
 * @internal
 */
subMesh/* SubMesh */.K.prototype._projectOnUnIndexedTrianglesToRef = function (vector, positions, indices, ref) {
    // Triangles test
    const proj = math_vector/* TmpVectors */.AA.Vector3[0];
    const tmp = math_vector/* TmpVectors */.AA.Vector3[1];
    let distance = +Infinity;
    for (let index = this.verticesStart; index < this.verticesStart + this.verticesCount; index += 3) {
        const p0 = positions[index];
        const p1 = positions[index + 1];
        const p2 = positions[index + 2];
        const tmpDist = math_vector/* Vector3 */.Pq.ProjectOnTriangleToRef(vector, p0, p1, p2, tmp);
        if (tmpDist < distance) {
            proj.copyFrom(tmp);
            distance = tmpDist;
        }
    }
    ref.copyFrom(proj);
    return distance;
};
subMesh/* SubMesh */.K.prototype.projectToRef = function (vector, positions, indices, ref) {
    const material = this.getMaterial();
    if (!material) {
        return -1;
    }
    let step = 3;
    let checkStopper = false;
    switch (material.fillMode) {
        case 3:
        case 5:
        case 6:
        case 8:
            return -1;
        case 7:
            step = 1;
            checkStopper = true;
            break;
        default:
            break;
    }
    // LineMesh first as it's also a Mesh...
    if (material.fillMode === 4) {
        return -1;
    }
    else {
        // Check if mesh is unindexed
        if (!indices.length && this._mesh._unIndexed) {
            return this._projectOnUnIndexedTrianglesToRef(vector, positions, indices, ref);
        }
        return this._projectOnTrianglesToRef(vector, positions, indices, step, checkStopper, ref);
    }
};
//# sourceMappingURL=subMesh.project.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRNearInteraction.js













// side effects


// Tracks the interaction animation state when using a motion controller with a near interaction orb
var ControllerOrbAnimationState;
(function (ControllerOrbAnimationState) {
    /**
     * Orb is invisible
     */
    ControllerOrbAnimationState[ControllerOrbAnimationState["DEHYDRATED"] = 0] = "DEHYDRATED";
    /**
     * Orb is visible and inside the hover range
     */
    ControllerOrbAnimationState[ControllerOrbAnimationState["HOVER"] = 1] = "HOVER";
    /**
     * Orb is visible and touching a near interaction target
     */
    ControllerOrbAnimationState[ControllerOrbAnimationState["TOUCH"] = 2] = "TOUCH";
})(ControllerOrbAnimationState || (ControllerOrbAnimationState = {}));
/**
 * Where should the near interaction mesh be attached to when using a motion controller for near interaction
 */
var WebXRNearControllerMode;
(function (WebXRNearControllerMode) {
    /**
     * Motion controllers will not support near interaction
     */
    WebXRNearControllerMode[WebXRNearControllerMode["DISABLED"] = 0] = "DISABLED";
    /**
     * The interaction point for motion controllers will be inside of them
     */
    WebXRNearControllerMode[WebXRNearControllerMode["CENTERED_ON_CONTROLLER"] = 1] = "CENTERED_ON_CONTROLLER";
    /**
     * The interaction point for motion controllers will be in front of the controller
     */
    WebXRNearControllerMode[WebXRNearControllerMode["CENTERED_IN_FRONT"] = 2] = "CENTERED_IN_FRONT";
})(WebXRNearControllerMode || (WebXRNearControllerMode = {}));
/**
 * A module that will enable near interaction near interaction for hands and motion controllers of XR Input Sources
 */
class WebXRNearInteraction extends WebXRAbstractFeature {
    /**
     * constructs a new background remover module
     * @param _xrSessionManager the session manager for this module
     * @param _options read-only options to be used in this module
     */
    constructor(_xrSessionManager, _options) {
        super(_xrSessionManager);
        this._options = _options;
        this._tmpRay = new Culling_ray/* Ray */.Rl(new math_vector/* Vector3 */.Pq(), new math_vector/* Vector3 */.Pq());
        this._attachController = (xrController) => {
            if (this._controllers[xrController.uniqueId]) {
                // already attached
                return;
            }
            // get two new meshes
            const { touchCollisionMesh, touchCollisionMeshFunction, hydrateCollisionMeshFunction } = this._generateNewTouchPointMesh();
            const selectionMesh = this._generateVisualCue();
            this._controllers[xrController.uniqueId] = {
                xrController,
                meshUnderPointer: null,
                nearInteractionTargetMesh: null,
                pick: null,
                stalePick: null,
                touchCollisionMesh,
                touchCollisionMeshFunction: touchCollisionMeshFunction,
                hydrateCollisionMeshFunction: hydrateCollisionMeshFunction,
                currentAnimationState: ControllerOrbAnimationState.DEHYDRATED,
                grabRay: new Culling_ray/* Ray */.Rl(new math_vector/* Vector3 */.Pq(), new math_vector/* Vector3 */.Pq()),
                hoverInteraction: false,
                nearInteraction: false,
                grabInteraction: false,
                downTriggered: false,
                id: WebXRNearInteraction._IdCounter++,
                pickedPointVisualCue: selectionMesh,
            };
            this._controllers[xrController.uniqueId]._worldScaleObserver =
                this._controllers[xrController.uniqueId]._worldScaleObserver ||
                    this._xrSessionManager.onWorldScaleFactorChangedObservable.add((values) => {
                        if (values.newScaleFactor !== values.previousScaleFactor) {
                            this._controllers[xrController.uniqueId].touchCollisionMesh.dispose();
                            this._controllers[xrController.uniqueId].pickedPointVisualCue.dispose();
                            const { touchCollisionMesh, touchCollisionMeshFunction, hydrateCollisionMeshFunction } = this._generateNewTouchPointMesh();
                            this._controllers[xrController.uniqueId].touchCollisionMesh = touchCollisionMesh;
                            this._controllers[xrController.uniqueId].touchCollisionMeshFunction = touchCollisionMeshFunction;
                            this._controllers[xrController.uniqueId].hydrateCollisionMeshFunction = hydrateCollisionMeshFunction;
                            this._controllers[xrController.uniqueId].pickedPointVisualCue = this._generateVisualCue();
                        }
                    });
            if (this._attachedController) {
                if (!this._options.enableNearInteractionOnAllControllers &&
                    this._options.preferredHandedness &&
                    xrController.inputSource.handedness === this._options.preferredHandedness) {
                    this._attachedController = xrController.uniqueId;
                }
            }
            else {
                if (!this._options.enableNearInteractionOnAllControllers) {
                    this._attachedController = xrController.uniqueId;
                }
            }
            switch (xrController.inputSource.targetRayMode) {
                case "tracked-pointer":
                    return this._attachNearInteractionMode(xrController);
                case "gaze":
                    return null;
                case "screen":
                    return null;
            }
        };
        this._controllers = {};
        this._farInteractionFeature = null;
        /**
         * default color of the selection ring
         */
        this.selectionMeshDefaultColor = new math_color/* Color3 */.v9(0.8, 0.8, 0.8);
        /**
         * This color will be applied to the selection ring when selection is triggered
         */
        this.selectionMeshPickedColor = new math_color/* Color3 */.v9(0.3, 0.3, 1.0);
        this._hoverRadius = 0.1;
        this._pickRadius = 0.02;
        this._controllerPickRadius = 0.03; // The radius is slightly larger here to make it easier to manipulate since it's not tied to the hand position
        this._nearGrabLengthScale = 5;
        this._scene = this._xrSessionManager.scene;
        if (this._options.nearInteractionControllerMode === undefined) {
            this._options.nearInteractionControllerMode = 2 /* WebXRNearControllerMode.CENTERED_IN_FRONT */;
        }
        if (this._options.farInteractionFeature) {
            this._farInteractionFeature = this._options.farInteractionFeature;
        }
    }
    /**
     * Attach this feature
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        this._options.xrInput.controllers.forEach(this._attachController);
        this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController);
        this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (controller) => {
            // REMOVE the controller
            this._detachController(controller.uniqueId);
        });
        this._scene.constantlyUpdateMeshUnderPointer = true;
        return true;
    }
    /**
     * Detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        Object.keys(this._controllers).forEach((controllerId) => {
            this._detachController(controllerId);
        });
        return true;
    }
    /**
     * Will get the mesh under a specific pointer.
     * `scene.meshUnderPointer` will only return one mesh - either left or right.
     * @param controllerId the controllerId to check
     * @returns The mesh under pointer or null if no mesh is under the pointer
     */
    getMeshUnderPointer(controllerId) {
        if (this._controllers[controllerId]) {
            return this._controllers[controllerId].meshUnderPointer;
        }
        else {
            return null;
        }
    }
    /**
     * Get the xr controller that correlates to the pointer id in the pointer event
     *
     * @param id the pointer id to search for
     * @returns the controller that correlates to this id or null if not found
     */
    getXRControllerByPointerId(id) {
        const keys = Object.keys(this._controllers);
        for (let i = 0; i < keys.length; ++i) {
            if (this._controllers[keys[i]].id === id) {
                return this._controllers[keys[i]].xrController || null;
            }
        }
        return null;
    }
    /**
     * This function sets webXRControllerPointerSelection feature that will be disabled when
     * the hover range is reached for a mesh and will be reattached when not in hover range.
     * This is used to remove the selection rays when moving.
     * @param farInteractionFeature the feature to disable when finger is in hover range for a mesh
     */
    setFarInteractionFeature(farInteractionFeature) {
        this._farInteractionFeature = farInteractionFeature;
    }
    /**
     * Filter used for near interaction pick and hover
     * @param mesh the mesh candidate to be pick-filtered
     * @returns if the mesh should be included in the list of candidate meshes for near interaction
     */
    _nearPickPredicate(mesh) {
        return mesh.isEnabled() && mesh.isVisible && mesh.isPickable && mesh.isNearPickable;
    }
    /**
     * Filter used for near interaction grab
     * @param mesh the mesh candidate to be pick-filtered
     * @returns if the mesh should be included in the list of candidate meshes for near interaction
     */
    _nearGrabPredicate(mesh) {
        return mesh.isEnabled() && mesh.isVisible && mesh.isPickable && mesh.isNearGrabbable;
    }
    /**
     * Filter used for any near interaction
     * @param mesh the mesh candidate to be pick-filtered
     * @returns if the mesh should be included in the list of candidate meshes for near interaction
     */
    _nearInteractionPredicate(mesh) {
        return mesh.isEnabled() && mesh.isVisible && mesh.isPickable && (mesh.isNearPickable || mesh.isNearGrabbable);
    }
    _controllerAvailablePredicate(mesh, controllerId) {
        let parent = mesh;
        while (parent) {
            if (parent.reservedDataStore && parent.reservedDataStore.nearInteraction && parent.reservedDataStore.nearInteraction.excludedControllerId === controllerId) {
                return false;
            }
            parent = parent.parent;
        }
        return true;
    }
    _handleTransitionAnimation(controllerData, newState) {
        if (controllerData.currentAnimationState === newState ||
            this._options.nearInteractionControllerMode !== 2 /* WebXRNearControllerMode.CENTERED_IN_FRONT */ ||
            !!controllerData.xrController?.inputSource.hand) {
            return;
        }
        // Don't always break to allow for animation fallthrough on rare cases of multi-transitions
        if (newState > controllerData.currentAnimationState) {
            switch (controllerData.currentAnimationState) {
                case ControllerOrbAnimationState.DEHYDRATED: {
                    controllerData.hydrateCollisionMeshFunction(true);
                    if (newState === ControllerOrbAnimationState.HOVER) {
                        break;
                    }
                }
                // eslint-disable-next-line no-fallthrough
                case ControllerOrbAnimationState.HOVER: {
                    controllerData.touchCollisionMeshFunction(true);
                    if (newState === ControllerOrbAnimationState.TOUCH) {
                        break;
                    }
                }
            }
        }
        else {
            switch (controllerData.currentAnimationState) {
                case ControllerOrbAnimationState.TOUCH: {
                    controllerData.touchCollisionMeshFunction(false);
                    if (newState === ControllerOrbAnimationState.HOVER) {
                        break;
                    }
                }
                // eslint-disable-next-line no-fallthrough
                case ControllerOrbAnimationState.HOVER: {
                    controllerData.hydrateCollisionMeshFunction(false);
                    if (newState === ControllerOrbAnimationState.DEHYDRATED) {
                        break;
                    }
                }
            }
        }
        controllerData.currentAnimationState = newState;
    }
    _processTouchPoint(id, position, orientation) {
        const controllerData = this._controllers[id];
        // Position and orientation could be temporary values, se we take care of them before calling any functions that use temporary vectors/quaternions
        controllerData.grabRay.origin.copyFrom(position);
        orientation.toEulerAnglesToRef(math_vector/* TmpVectors */.AA.Vector3[0]);
        controllerData.grabRay.direction.copyFrom(math_vector/* TmpVectors */.AA.Vector3[0]);
        if (this._options.nearInteractionControllerMode === 2 /* WebXRNearControllerMode.CENTERED_IN_FRONT */ && !controllerData.xrController?.inputSource.hand) {
            // offset the touch point in the direction the transform is facing
            controllerData.xrController.getWorldPointerRayToRef(this._tmpRay);
            controllerData.grabRay.origin.addInPlace(this._tmpRay.direction.scale(0.05));
        }
        controllerData.grabRay.length = this._nearGrabLengthScale * this._hoverRadius * this._xrSessionManager.worldScalingFactor;
        controllerData.touchCollisionMesh.position.copyFrom(controllerData.grabRay.origin).scaleInPlace(this._xrSessionManager.worldScalingFactor);
    }
    _onXRFrame(_xrFrame) {
        Object.keys(this._controllers).forEach((id) => {
            // only do this for the selected pointer
            const controllerData = this._controllers[id];
            const handData = controllerData.xrController?.inputSource.hand;
            // If near interaction is not enabled/available for this controller, return early
            if ((!this._options.enableNearInteractionOnAllControllers && id !== this._attachedController) ||
                !controllerData.xrController ||
                (!handData && (!this._options.nearInteractionControllerMode || !controllerData.xrController.inputSource.gamepad))) {
                controllerData.pick = null;
                return;
            }
            controllerData.hoverInteraction = false;
            controllerData.nearInteraction = false;
            // Every frame check collisions/input
            if (controllerData.xrController) {
                if (handData) {
                    const xrIndexTip = handData.get("index-finger-tip");
                    if (xrIndexTip) {
                        const indexTipPose = _xrFrame.getJointPose(xrIndexTip, this._xrSessionManager.referenceSpace);
                        if (indexTipPose && indexTipPose.transform) {
                            const axisRHSMultiplier = this._scene.useRightHandedSystem ? 1 : -1;
                            math_vector/* TmpVectors */.AA.Vector3[0].set(indexTipPose.transform.position.x, indexTipPose.transform.position.y, indexTipPose.transform.position.z * axisRHSMultiplier);
                            math_vector/* TmpVectors */.AA.Quaternion[0].set(indexTipPose.transform.orientation.x, indexTipPose.transform.orientation.y, indexTipPose.transform.orientation.z * axisRHSMultiplier, indexTipPose.transform.orientation.w * axisRHSMultiplier);
                            this._processTouchPoint(id, math_vector/* TmpVectors */.AA.Vector3[0], math_vector/* TmpVectors */.AA.Quaternion[0]);
                        }
                    }
                }
                else if (controllerData.xrController.inputSource.gamepad && this._options.nearInteractionControllerMode !== 0 /* WebXRNearControllerMode.DISABLED */) {
                    let controllerPose = controllerData.xrController.pointer;
                    if (controllerData.xrController.grip && this._options.nearInteractionControllerMode === 1 /* WebXRNearControllerMode.CENTERED_ON_CONTROLLER */) {
                        controllerPose = controllerData.xrController.grip;
                    }
                    this._processTouchPoint(id, controllerPose.position, controllerPose.rotationQuaternion);
                }
            }
            else {
                return;
            }
            const accuratePickInfo = (originalScenePick, utilityScenePick) => {
                let pick = null;
                if (!utilityScenePick || !utilityScenePick.hit) {
                    // No hit in utility scene
                    pick = originalScenePick;
                }
                else if (!originalScenePick || !originalScenePick.hit) {
                    // No hit in original scene
                    pick = utilityScenePick;
                }
                else if (utilityScenePick.distance < originalScenePick.distance) {
                    // Hit is closer in utility scene
                    pick = utilityScenePick;
                }
                else {
                    // Hit is closer in original scene
                    pick = originalScenePick;
                }
                return pick;
            };
            const populateNearInteractionInfo = (nearInteractionInfo) => {
                let result = new Collisions_pickingInfo/* PickingInfo */.G();
                let nearInteractionAtOrigin = false;
                const nearInteraction = nearInteractionInfo && nearInteractionInfo.pickedPoint && nearInteractionInfo.hit;
                if (nearInteractionInfo?.pickedPoint) {
                    nearInteractionAtOrigin = nearInteractionInfo.pickedPoint.x === 0 && nearInteractionInfo.pickedPoint.y === 0 && nearInteractionInfo.pickedPoint.z === 0;
                }
                if (nearInteraction && !nearInteractionAtOrigin) {
                    result = nearInteractionInfo;
                }
                return result;
            };
            // Don't perform touch logic while grabbing, to prevent triggering touch interactions while in the middle of a grab interaction
            // Dont update cursor logic either - the cursor should already be visible for the grab to be in range,
            // and in order to maintain its position on the target mesh it is parented for the duration of the grab.
            if (!controllerData.grabInteraction) {
                let pick = null;
                // near interaction hover
                let utilitySceneHoverPick = null;
                if (this._options.useUtilityLayer && this._utilityLayerScene) {
                    utilitySceneHoverPick = this._pickWithSphere(controllerData, this._hoverRadius * this._xrSessionManager.worldScalingFactor, this._utilityLayerScene, (mesh) => this._nearInteractionPredicate(mesh));
                }
                const originalSceneHoverPick = this._pickWithSphere(controllerData, this._hoverRadius * this._xrSessionManager.worldScalingFactor, this._scene, (mesh) => this._nearInteractionPredicate(mesh));
                const hoverPickInfo = accuratePickInfo(originalSceneHoverPick, utilitySceneHoverPick);
                if (hoverPickInfo && hoverPickInfo.hit) {
                    pick = populateNearInteractionInfo(hoverPickInfo);
                    if (pick.hit) {
                        controllerData.hoverInteraction = true;
                    }
                }
                // near interaction pick
                if (controllerData.hoverInteraction) {
                    let utilitySceneNearPick = null;
                    const radius = (handData ? this._pickRadius : this._controllerPickRadius) * this._xrSessionManager.worldScalingFactor;
                    if (this._options.useUtilityLayer && this._utilityLayerScene) {
                        utilitySceneNearPick = this._pickWithSphere(controllerData, radius, this._utilityLayerScene, (mesh) => this._nearPickPredicate(mesh));
                    }
                    const originalSceneNearPick = this._pickWithSphere(controllerData, radius, this._scene, (mesh) => this._nearPickPredicate(mesh));
                    const pickInfo = accuratePickInfo(originalSceneNearPick, utilitySceneNearPick);
                    const nearPick = populateNearInteractionInfo(pickInfo);
                    if (nearPick.hit) {
                        // Near pick takes precedence over hover interaction
                        pick = nearPick;
                        controllerData.nearInteraction = true;
                    }
                }
                controllerData.stalePick = controllerData.pick;
                controllerData.pick = pick;
                // Update mesh under pointer
                if (controllerData.pick && controllerData.pick.pickedPoint && controllerData.pick.hit) {
                    controllerData.meshUnderPointer = controllerData.pick.pickedMesh;
                    controllerData.pickedPointVisualCue.position.copyFrom(controllerData.pick.pickedPoint);
                    controllerData.pickedPointVisualCue.isVisible = true;
                    if (this._farInteractionFeature && this._farInteractionFeature.attached) {
                        this._farInteractionFeature._setPointerSelectionDisabledByPointerId(controllerData.id, true);
                    }
                }
                else {
                    controllerData.meshUnderPointer = null;
                    controllerData.pickedPointVisualCue.isVisible = false;
                    if (this._farInteractionFeature && this._farInteractionFeature.attached) {
                        this._farInteractionFeature._setPointerSelectionDisabledByPointerId(controllerData.id, false);
                    }
                }
            }
            // Update the interaction animation. Only updates if the visible touch mesh is active
            let state = ControllerOrbAnimationState.DEHYDRATED;
            if (controllerData.grabInteraction || controllerData.nearInteraction) {
                state = ControllerOrbAnimationState.TOUCH;
            }
            else if (controllerData.hoverInteraction) {
                state = ControllerOrbAnimationState.HOVER;
            }
            this._handleTransitionAnimation(controllerData, state);
        });
    }
    get _utilityLayerScene() {
        return this._options.customUtilityLayerScene || utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer.utilityLayerScene;
    }
    _generateVisualCue() {
        const sceneToRenderTo = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer.utilityLayerScene : this._scene;
        const selectionMesh = CreateSphere("nearInteraction", {
            diameter: 0.0035 * 3 * this._xrSessionManager.worldScalingFactor,
        }, sceneToRenderTo);
        selectionMesh.bakeCurrentTransformIntoVertices();
        selectionMesh.isPickable = false;
        selectionMesh.isVisible = false;
        selectionMesh.rotationQuaternion = math_vector/* Quaternion */.PT.Identity();
        const targetMat = new standardMaterial/* StandardMaterial */.F("targetMat", sceneToRenderTo);
        targetMat.specularColor = math_color/* Color3 */.v9.Black();
        targetMat.emissiveColor = this.selectionMeshDefaultColor;
        targetMat.backFaceCulling = false;
        selectionMesh.material = targetMat;
        return selectionMesh;
    }
    _isControllerReadyForNearInteraction(id) {
        if (this._farInteractionFeature) {
            return this._farInteractionFeature._getPointerSelectionDisabledByPointerId(id);
        }
        return true;
    }
    _attachNearInteractionMode(xrController) {
        const controllerData = this._controllers[xrController.uniqueId];
        const pointerEventInit = {
            pointerId: controllerData.id,
            pointerType: "xr-near",
        };
        controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => {
            if ((!this._options.enableNearInteractionOnAllControllers && xrController.uniqueId !== this._attachedController) ||
                !controllerData.xrController ||
                (!controllerData.xrController.inputSource.hand && (!this._options.nearInteractionControllerMode || !controllerData.xrController.inputSource.gamepad))) {
                return;
            }
            if (controllerData.pick) {
                controllerData.pick.ray = controllerData.grabRay;
            }
            if (controllerData.pick && this._isControllerReadyForNearInteraction(controllerData.id)) {
                this._scene.simulatePointerMove(controllerData.pick, pointerEventInit);
            }
            // Near pick pointer event
            if (controllerData.nearInteraction && controllerData.pick && controllerData.pick.hit) {
                if (!controllerData.nearInteractionTargetMesh) {
                    this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
                    controllerData.nearInteractionTargetMesh = controllerData.meshUnderPointer;
                    controllerData.downTriggered = true;
                }
            }
            else if (controllerData.nearInteractionTargetMesh && controllerData.stalePick) {
                this._scene.simulatePointerUp(controllerData.stalePick, pointerEventInit);
                controllerData.downTriggered = false;
                controllerData.nearInteractionTargetMesh = null;
            }
        });
        const grabCheck = (pressed) => {
            if (this._options.enableNearInteractionOnAllControllers ||
                (xrController.uniqueId === this._attachedController && this._isControllerReadyForNearInteraction(controllerData.id))) {
                if (controllerData.pick) {
                    controllerData.pick.ray = controllerData.grabRay;
                }
                if (pressed && controllerData.pick && controllerData.meshUnderPointer && this._nearGrabPredicate(controllerData.meshUnderPointer)) {
                    controllerData.grabInteraction = true;
                    controllerData.pickedPointVisualCue.isVisible = false;
                    this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
                    controllerData.downTriggered = true;
                }
                else if (!pressed && controllerData.pick && controllerData.grabInteraction) {
                    this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
                    controllerData.downTriggered = false;
                    controllerData.grabInteraction = false;
                    controllerData.pickedPointVisualCue.isVisible = true;
                }
            }
            else {
                if (pressed && !this._options.enableNearInteractionOnAllControllers && !this._options.disableSwitchOnClick) {
                    this._attachedController = xrController.uniqueId;
                }
            }
        };
        if (xrController.inputSource.gamepad) {
            const init = (motionController) => {
                controllerData.squeezeComponent = motionController.getComponent("grasp");
                if (controllerData.squeezeComponent) {
                    controllerData.onSqueezeButtonChangedObserver = controllerData.squeezeComponent.onButtonStateChangedObservable.add((component) => {
                        if (component.changes.pressed) {
                            const pressed = component.changes.pressed.current;
                            grabCheck(pressed);
                        }
                    });
                }
                else {
                    controllerData.selectionComponent = motionController.getMainComponent();
                    controllerData.onButtonChangedObserver = controllerData.selectionComponent.onButtonStateChangedObservable.add((component) => {
                        if (component.changes.pressed) {
                            const pressed = component.changes.pressed.current;
                            grabCheck(pressed);
                        }
                    });
                }
            };
            if (xrController.motionController) {
                init(xrController.motionController);
            }
            else {
                xrController.onMotionControllerInitObservable.add(init);
            }
        }
        else {
            // use the select and squeeze events
            const selectStartListener = (event) => {
                if (controllerData.xrController &&
                    event.inputSource === controllerData.xrController.inputSource &&
                    controllerData.pick &&
                    this._isControllerReadyForNearInteraction(controllerData.id) &&
                    controllerData.meshUnderPointer &&
                    this._nearGrabPredicate(controllerData.meshUnderPointer)) {
                    controllerData.grabInteraction = true;
                    controllerData.pickedPointVisualCue.isVisible = false;
                    this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
                    controllerData.downTriggered = true;
                }
            };
            const selectEndListener = (event) => {
                if (controllerData.xrController &&
                    event.inputSource === controllerData.xrController.inputSource &&
                    controllerData.pick &&
                    this._isControllerReadyForNearInteraction(controllerData.id)) {
                    this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
                    controllerData.grabInteraction = false;
                    controllerData.pickedPointVisualCue.isVisible = true;
                    controllerData.downTriggered = false;
                }
            };
            controllerData.eventListeners = {
                selectend: selectEndListener,
                selectstart: selectStartListener,
            };
            this._xrSessionManager.session.addEventListener("selectstart", selectStartListener);
            this._xrSessionManager.session.addEventListener("selectend", selectEndListener);
        }
    }
    _detachController(xrControllerUniqueId) {
        const controllerData = this._controllers[xrControllerUniqueId];
        if (!controllerData) {
            return;
        }
        if (controllerData.squeezeComponent) {
            if (controllerData.onSqueezeButtonChangedObserver) {
                controllerData.squeezeComponent.onButtonStateChangedObservable.remove(controllerData.onSqueezeButtonChangedObserver);
            }
        }
        if (controllerData.selectionComponent) {
            if (controllerData.onButtonChangedObserver) {
                controllerData.selectionComponent.onButtonStateChangedObservable.remove(controllerData.onButtonChangedObserver);
            }
        }
        if (controllerData.onFrameObserver) {
            this._xrSessionManager.onXRFrameObservable.remove(controllerData.onFrameObserver);
        }
        if (controllerData.eventListeners) {
            Object.keys(controllerData.eventListeners).forEach((eventName) => {
                const func = controllerData.eventListeners && controllerData.eventListeners[eventName];
                if (func) {
                    this._xrSessionManager.session.removeEventListener(eventName, func);
                }
            });
        }
        controllerData.touchCollisionMesh.dispose();
        controllerData.pickedPointVisualCue.dispose();
        this._xrSessionManager.runInXRFrame(() => {
            if (!controllerData.downTriggered) {
                return;
            }
            // Fire a pointerup in case controller was detached before a pointerup event was fired
            const pointerEventInit = {
                pointerId: controllerData.id,
                pointerType: "xr-near",
            };
            this._scene.simulatePointerUp(new Collisions_pickingInfo/* PickingInfo */.G(), pointerEventInit);
        });
        // remove world scale observer
        if (controllerData._worldScaleObserver) {
            this._xrSessionManager.onWorldScaleFactorChangedObservable.remove(controllerData._worldScaleObserver);
        }
        // remove from the map
        delete this._controllers[xrControllerUniqueId];
        if (this._attachedController === xrControllerUniqueId) {
            // check for other controllers
            const keys = Object.keys(this._controllers);
            if (keys.length) {
                this._attachedController = keys[0];
            }
            else {
                this._attachedController = "";
            }
        }
    }
    _generateNewTouchPointMesh() {
        const worldScale = this._xrSessionManager.worldScalingFactor;
        // populate information for near hover, pick and pinch
        const meshCreationScene = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer.utilityLayerScene : this._scene;
        const touchCollisionMesh = CreateSphere("PickSphere", { diameter: 1 * worldScale }, meshCreationScene);
        touchCollisionMesh.isVisible = false;
        // Generate the material for the touch mesh visuals
        if (this._options.motionControllerOrbMaterial) {
            touchCollisionMesh.material = this._options.motionControllerOrbMaterial;
        }
        else {
            let parsePromise;
            if (this._options.motionControllerTouchMaterialSnippetUrl) {
                parsePromise = NodeMaterial.ParseFromFileAsync("motionControllerTouchMaterial", this._options.motionControllerTouchMaterialSnippetUrl, meshCreationScene);
            }
            else {
                parsePromise = NodeMaterial.ParseFromSnippetAsync("8RUNKL#3", meshCreationScene);
            }
            parsePromise
                .then((mat) => {
                touchCollisionMesh.material = mat;
            })
                .catch((err) => {
                logger/* Logger */.V.Warn(`Error creating touch material in WebXRNearInteraction: ${err}`);
            });
        }
        const easingFunction = new QuadraticEase();
        easingFunction.setEasingMode(EasingFunction.EASINGMODE_EASEINOUT);
        // Adjust the visual size based off of the size of the touch collision orb.
        // Having the size perfectly match for hover gives a more accurate tell for when the user will start interacting with the target
        // Sizes for other states are somewhat arbitrary, as they are based on what feels nice during an interaction
        const hoverSizeVec = new math_vector/* Vector3 */.Pq(this._controllerPickRadius, this._controllerPickRadius, this._controllerPickRadius).scaleInPlace(worldScale);
        const touchSize = this._controllerPickRadius * (4 / 3);
        const touchSizeVec = new math_vector/* Vector3 */.Pq(touchSize, touchSize, touchSize).scaleInPlace(worldScale);
        const hydrateTransitionSize = this._controllerPickRadius * (7 / 6);
        const hydrateTransitionSizeVec = new math_vector/* Vector3 */.Pq(hydrateTransitionSize, hydrateTransitionSize, hydrateTransitionSize).scaleInPlace(worldScale);
        const touchHoverTransitionSize = this._controllerPickRadius * (4 / 5);
        const touchHoverTransitionSizeVec = new math_vector/* Vector3 */.Pq(touchHoverTransitionSize, touchHoverTransitionSize, touchHoverTransitionSize).scaleInPlace(worldScale);
        const hoverTouchTransitionSize = this._controllerPickRadius * (3 / 2);
        const hoverTouchTransitionSizeVec = new math_vector/* Vector3 */.Pq(hoverTouchTransitionSize, hoverTouchTransitionSize, hoverTouchTransitionSize).scaleInPlace(worldScale);
        const touchKeys = [
            { frame: 0, value: hoverSizeVec },
            { frame: 10, value: hoverTouchTransitionSizeVec },
            { frame: 18, value: touchSizeVec },
        ];
        const releaseKeys = [
            { frame: 0, value: touchSizeVec },
            { frame: 10, value: touchHoverTransitionSizeVec },
            { frame: 18, value: hoverSizeVec },
        ];
        const hydrateKeys = [
            { frame: 0, value: math_vector/* Vector3 */.Pq.ZeroReadOnly },
            { frame: 12, value: hydrateTransitionSizeVec },
            { frame: 15, value: hoverSizeVec },
        ];
        const dehydrateKeys = [
            { frame: 0, value: hoverSizeVec },
            { frame: 10, value: math_vector/* Vector3 */.Pq.ZeroReadOnly },
            { frame: 15, value: math_vector/* Vector3 */.Pq.ZeroReadOnly },
        ];
        const touchAction = new Animations_animation/* Animation */.X5("touch", "scaling", 60, Animations_animation/* Animation */.X5.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        const releaseAction = new Animations_animation/* Animation */.X5("release", "scaling", 60, Animations_animation/* Animation */.X5.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        const hydrateAction = new Animations_animation/* Animation */.X5("hydrate", "scaling", 60, Animations_animation/* Animation */.X5.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        const dehydrateAction = new Animations_animation/* Animation */.X5("dehydrate", "scaling", 60, Animations_animation/* Animation */.X5.ANIMATIONTYPE_VECTOR3, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CONSTANT);
        touchAction.setEasingFunction(easingFunction);
        releaseAction.setEasingFunction(easingFunction);
        hydrateAction.setEasingFunction(easingFunction);
        dehydrateAction.setEasingFunction(easingFunction);
        touchAction.setKeys(touchKeys);
        releaseAction.setKeys(releaseKeys);
        hydrateAction.setKeys(hydrateKeys);
        dehydrateAction.setKeys(dehydrateKeys);
        const touchCollisionMeshFunction = (isTouch) => {
            const action = isTouch ? touchAction : releaseAction;
            meshCreationScene.beginDirectAnimation(touchCollisionMesh, [action], 0, 18, false, 1);
        };
        const hydrateCollisionMeshFunction = (isHydration) => {
            const action = isHydration ? hydrateAction : dehydrateAction;
            if (isHydration) {
                touchCollisionMesh.isVisible = true;
            }
            meshCreationScene.beginDirectAnimation(touchCollisionMesh, [action], 0, 15, false, 1, () => {
                if (!isHydration) {
                    touchCollisionMesh.isVisible = false;
                }
            });
        };
        return { touchCollisionMesh, touchCollisionMeshFunction, hydrateCollisionMeshFunction };
    }
    _pickWithSphere(controllerData, radius, sceneToUse, predicate) {
        const pickingInfo = new Collisions_pickingInfo/* PickingInfo */.G();
        pickingInfo.distance = +Infinity;
        if (controllerData.touchCollisionMesh && controllerData.xrController) {
            const position = controllerData.touchCollisionMesh.position;
            const sphere = boundingSphere/* BoundingSphere */.i.CreateFromCenterAndRadius(position, radius);
            for (let meshIndex = 0; meshIndex < sceneToUse.meshes.length; meshIndex++) {
                const mesh = sceneToUse.meshes[meshIndex];
                if (!predicate(mesh) || !this._controllerAvailablePredicate(mesh, controllerData.xrController.uniqueId)) {
                    continue;
                }
                const result = WebXRNearInteraction.PickMeshWithSphere(mesh, sphere);
                if (result && result.hit && result.distance < pickingInfo.distance) {
                    pickingInfo.hit = result.hit;
                    pickingInfo.pickedMesh = mesh;
                    pickingInfo.pickedPoint = result.pickedPoint;
                    pickingInfo.aimTransform = controllerData.xrController.pointer;
                    pickingInfo.gripTransform = controllerData.xrController.grip || null;
                    pickingInfo.originMesh = controllerData.touchCollisionMesh;
                    pickingInfo.distance = result.distance;
                    pickingInfo.bu = result.bu;
                    pickingInfo.bv = result.bv;
                    pickingInfo.faceId = result.faceId;
                    pickingInfo.subMeshId = result.subMeshId;
                }
            }
        }
        return pickingInfo;
    }
    /**
     * Picks a mesh with a sphere
     * @param mesh the mesh to pick
     * @param sphere picking sphere in world coordinates
     * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
     * @returns the picking info
     */
    static PickMeshWithSphere(mesh, sphere, skipBoundingInfo = false) {
        const subMeshes = mesh.subMeshes;
        const pi = new Collisions_pickingInfo/* PickingInfo */.G();
        const boundingInfo = mesh.getBoundingInfo();
        if (!mesh._generatePointsArray()) {
            return pi;
        }
        if (!mesh.subMeshes || !boundingInfo) {
            return pi;
        }
        if (!skipBoundingInfo && !boundingSphere/* BoundingSphere */.i.Intersects(boundingInfo.boundingSphere, sphere)) {
            return pi;
        }
        const result = math_vector/* TmpVectors */.AA.Vector3[0];
        const tmpVec = math_vector/* TmpVectors */.AA.Vector3[1];
        const tmpRay = new Culling_ray/* Ray */.Rl(math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Zero(), 1);
        let distance = +Infinity;
        let tmp, tmpDistanceSphereToCenter, tmpDistanceSurfaceToCenter, intersectionInfo;
        const center = math_vector/* TmpVectors */.AA.Vector3[2];
        const worldToMesh = math_vector/* TmpVectors */.AA.Matrix[0];
        worldToMesh.copyFrom(mesh.getWorldMatrix());
        worldToMesh.invert();
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(sphere.center, worldToMesh, center);
        for (let index = 0; index < subMeshes.length; index++) {
            const subMesh = subMeshes[index];
            subMesh.projectToRef(center, mesh._positions, mesh.getIndices(), tmpVec);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(tmpVec, mesh.getWorldMatrix(), tmpVec);
            tmp = math_vector/* Vector3 */.Pq.Distance(tmpVec, sphere.center);
            // Check for finger inside of mesh
            tmpDistanceSurfaceToCenter = math_vector/* Vector3 */.Pq.Distance(tmpVec, mesh.getAbsolutePosition());
            tmpDistanceSphereToCenter = math_vector/* Vector3 */.Pq.Distance(sphere.center, mesh.getAbsolutePosition());
            if (tmpDistanceSphereToCenter !== -1 && tmpDistanceSurfaceToCenter !== -1 && tmpDistanceSurfaceToCenter > tmpDistanceSphereToCenter) {
                tmp = 0;
                tmpVec.copyFrom(sphere.center);
            }
            if (tmp !== -1 && tmp < distance) {
                distance = tmp;
                // ray between the sphere center and the point on the mesh
                Culling_ray/* Ray */.Rl.CreateFromToToRef(sphere.center, tmpVec, tmpRay);
                tmpRay.length = distance * 2;
                intersectionInfo = tmpRay.intersectsMesh(mesh);
                result.copyFrom(tmpVec);
            }
        }
        if (distance < sphere.radius) {
            pi.hit = true;
            pi.distance = distance;
            pi.pickedMesh = mesh;
            pi.pickedPoint = result.clone();
            if (intersectionInfo && intersectionInfo.bu !== null && intersectionInfo.bv !== null) {
                pi.faceId = intersectionInfo.faceId;
                pi.subMeshId = intersectionInfo.subMeshId;
                pi.bu = intersectionInfo.bu;
                pi.bv = intersectionInfo.bv;
            }
        }
        return pi;
    }
}
WebXRNearInteraction._IdCounter = 200;
/**
 * The module's name
 */
WebXRNearInteraction.Name = webXRFeaturesManager/* WebXRFeatureName */._.NEAR_INTERACTION;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRNearInteraction.Version = 1;
//Register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRNearInteraction.Name, (xrSessionManager, options) => {
    return () => new WebXRNearInteraction(xrSessionManager, options);
}, WebXRNearInteraction.Version, true);
//# sourceMappingURL=WebXRNearInteraction.js.map
;// ./node_modules/@babylonjs/core/XR/webXREnterExitUI.js


/**
 * Button which can be used to enter a different mode of XR
 */
class WebXREnterExitUIButton {
    /**
     * Creates a WebXREnterExitUIButton
     * @param element button element
     * @param sessionMode XR initialization session mode
     * @param referenceSpaceType the type of reference space to be used
     */
    constructor(
    /** button element */
    element, 
    /** XR initialization options for the button */
    sessionMode, 
    /** Reference space type */
    referenceSpaceType) {
        this.element = element;
        this.sessionMode = sessionMode;
        this.referenceSpaceType = referenceSpaceType;
    }
    /**
     * Extendable function which can be used to update the button's visuals when the state changes
     * @param activeButton the current active button in the UI
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    update(activeButton) { }
}
/**
 * Options to create the webXR UI
 */
class WebXREnterExitUIOptions {
}
/**
 * UI to allow the user to enter/exit XR mode
 */
class WebXREnterExitUI {
    /**
     * Construct a new EnterExit UI class
     *
     * @param _scene babylon scene object to use
     * @param options (read-only) version of the options passed to this UI
     */
    constructor(_scene, 
    /** version of the options passed to this UI */
    options) {
        this._scene = _scene;
        this.options = options;
        this._activeButton = null;
        this._buttons = [];
        /**
         * Fired every time the active button is changed.
         *
         * When xr is entered via a button that launches xr that button will be the callback parameter
         *
         * When exiting xr the callback parameter will be null)
         */
        this.activeButtonChangedObservable = new Misc_observable/* Observable */.cP();
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        this._onSessionGranted = (evt) => {
            // This section is for future reference.
            // As per specs, evt.session.mode should have the supported session mode, but no browser supports it for now.
            // // check if the session granted is the same as the one requested
            // const grantedMode = (evt.session as any).mode;
            // if (grantedMode) {
            //     this._buttons.some((btn, idx) => {
            //         if (btn.sessionMode === grantedMode) {
            //             this._enterXRWithButtonIndex(idx);
            //             return true;
            //         }
            //         return false;
            //     });
            // } else
            if (this._helper) {
                this._enterXRWithButtonIndex(0);
            }
        };
        this.overlay = document.createElement("div");
        this.overlay.classList.add("xr-button-overlay");
        // prepare for session granted event
        if (!options.ignoreSessionGrantedEvent && navigator.xr) {
            navigator.xr.addEventListener("sessiongranted", this._onSessionGranted);
        }
        // if served over HTTP, warn people.
        // Hopefully the browsers will catch up
        if (typeof window !== "undefined") {
            if (window.location && window.location.protocol === "http:" && window.location.hostname !== "localhost") {
                tools/* Tools */.S0.Warn("WebXR can only be served over HTTPS");
                throw new Error("WebXR can only be served over HTTPS");
            }
        }
        if (options.customButtons) {
            this._buttons = options.customButtons;
        }
        else {
            this.overlay.style.cssText = "z-index:11;position: absolute; right: 20px;bottom: 50px;";
            const sessionMode = options.sessionMode || "immersive-vr";
            const referenceSpaceType = options.referenceSpaceType || "local-floor";
            const url = typeof SVGSVGElement === "undefined"
                ? "https://cdn.babylonjs.com/Assets/vrButton.png"
                : "data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A";
            let css = ".babylonVRicon { color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(" +
                url +
                "); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";
            css += '.babylonVRicon.vrdisplaypresenting { background-image: none;} .vrdisplaypresenting::after { content: "EXIT"} .xr-error::after { content: "ERROR"}';
            const style = document.createElement("style");
            style.appendChild(document.createTextNode(css));
            document.getElementsByTagName("head")[0].appendChild(style);
            const hmdBtn = document.createElement("button");
            hmdBtn.className = "babylonVRicon";
            hmdBtn.title = `${sessionMode} - ${referenceSpaceType}`;
            this._buttons.push(new WebXREnterExitUIButton(hmdBtn, sessionMode, referenceSpaceType));
            this._buttons[this._buttons.length - 1].update = function (activeButton) {
                this.element.style.display = activeButton === null || activeButton === this ? "" : "none";
                hmdBtn.className = "babylonVRicon" + (activeButton === this ? " vrdisplaypresenting" : "");
            };
            this._updateButtons(null);
        }
        const renderCanvas = _scene.getEngine().getInputElement();
        if (renderCanvas && renderCanvas.parentNode) {
            renderCanvas.parentNode.appendChild(this.overlay);
            _scene.onDisposeObservable.addOnce(() => {
                this.dispose();
            });
        }
    }
    /**
     * Set the helper to be used with this UI component.
     * The UI is bound to an experience helper. If not provided the UI can still be used but the events should be registered by the developer.
     *
     * @param helper the experience helper to attach
     * @param renderTarget an optional render target (in case it is created outside of the helper scope)
     * @returns a promise that resolves when the ui is ready
     */
    async setHelperAsync(helper, renderTarget) {
        this._helper = helper;
        this._renderTarget = renderTarget;
        const supportedPromises = this._buttons.map((btn) => {
            return helper.sessionManager.isSessionSupportedAsync(btn.sessionMode);
        });
        helper.onStateChangedObservable.add((state) => {
            if (state == 3 /* WebXRState.NOT_IN_XR */) {
                this._updateButtons(null);
            }
        });
        const results = await Promise.all(supportedPromises);
        results.forEach((supported, i) => {
            if (supported) {
                this.overlay.appendChild(this._buttons[i].element);
                this._buttons[i].element.onclick = this._enterXRWithButtonIndex.bind(this, i);
            }
            else {
                tools/* Tools */.S0.Warn(`Session mode "${this._buttons[i].sessionMode}" not supported in browser`);
            }
        });
    }
    /**
     * Creates UI to allow the user to enter/exit XR mode
     * @param scene the scene to add the ui to
     * @param helper the xr experience helper to enter/exit xr with
     * @param options options to configure the UI
     * @returns the created ui
     */
    static async CreateAsync(scene, helper, options) {
        const ui = new WebXREnterExitUI(scene, options);
        await ui.setHelperAsync(helper, options.renderTarget || undefined);
        return ui;
    }
    async _enterXRWithButtonIndex(idx = 0) {
        if (this._helper.state == 2 /* WebXRState.IN_XR */) {
            await this._helper.exitXRAsync();
            this._updateButtons(null);
        }
        else if (this._helper.state == 3 /* WebXRState.NOT_IN_XR */) {
            try {
                await this._helper.enterXRAsync(this._buttons[idx].sessionMode, this._buttons[idx].referenceSpaceType, this._renderTarget, {
                    optionalFeatures: this.options.optionalFeatures,
                    requiredFeatures: this.options.requiredFeatures,
                });
                this._updateButtons(this._buttons[idx]);
            }
            catch (e) {
                // make sure button is visible
                this._updateButtons(null);
                const element = this._buttons[idx].element;
                const prevTitle = element.title;
                element.title = "Error entering XR session : " + prevTitle;
                element.classList.add("xr-error");
                if (this.options.onError) {
                    this.options.onError(e);
                }
            }
        }
    }
    /**
     * Disposes of the XR UI component
     */
    dispose() {
        const renderCanvas = this._scene.getEngine().getInputElement();
        if (renderCanvas && renderCanvas.parentNode && renderCanvas.parentNode.contains(this.overlay)) {
            renderCanvas.parentNode.removeChild(this.overlay);
        }
        this.activeButtonChangedObservable.clear();
        navigator.xr.removeEventListener("sessiongranted", this._onSessionGranted);
    }
    _updateButtons(activeButton) {
        this._activeButton = activeButton;
        this._buttons.forEach((b) => {
            b.update(this._activeButton);
        });
        this.activeButtonChangedObservable.notifyObservers(this._activeButton);
    }
}
//# sourceMappingURL=webXREnterExitUI.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRHandTracking.js














/**
 * Parts of the hands divided to writs and finger names
 */
var HandPart;
(function (HandPart) {
    /**
     * HandPart - Wrist
     */
    HandPart["WRIST"] = "wrist";
    /**
     * HandPart - The thumb
     */
    HandPart["THUMB"] = "thumb";
    /**
     * HandPart - Index finger
     */
    HandPart["INDEX"] = "index";
    /**
     * HandPart - Middle finger
     */
    HandPart["MIDDLE"] = "middle";
    /**
     * HandPart - Ring finger
     */
    HandPart["RING"] = "ring";
    /**
     * HandPart - Little finger
     */
    HandPart["LITTLE"] = "little";
})(HandPart || (HandPart = {}));
/**
 * Joints of the hand as defined by the WebXR specification.
 * https://immersive-web.github.io/webxr-hand-input/#skeleton-joints-section
 */
var WebXRHandJoint;
(function (WebXRHandJoint) {
    /** Wrist */
    WebXRHandJoint["WRIST"] = "wrist";
    /** Thumb near wrist */
    WebXRHandJoint["THUMB_METACARPAL"] = "thumb-metacarpal";
    /** Thumb first knuckle */
    WebXRHandJoint["THUMB_PHALANX_PROXIMAL"] = "thumb-phalanx-proximal";
    /** Thumb second knuckle */
    WebXRHandJoint["THUMB_PHALANX_DISTAL"] = "thumb-phalanx-distal";
    /** Thumb tip */
    WebXRHandJoint["THUMB_TIP"] = "thumb-tip";
    /** Index finger near wrist */
    WebXRHandJoint["INDEX_FINGER_METACARPAL"] = "index-finger-metacarpal";
    /** Index finger first knuckle */
    WebXRHandJoint["INDEX_FINGER_PHALANX_PROXIMAL"] = "index-finger-phalanx-proximal";
    /** Index finger second knuckle */
    WebXRHandJoint["INDEX_FINGER_PHALANX_INTERMEDIATE"] = "index-finger-phalanx-intermediate";
    /** Index finger third knuckle */
    WebXRHandJoint["INDEX_FINGER_PHALANX_DISTAL"] = "index-finger-phalanx-distal";
    /** Index finger tip */
    WebXRHandJoint["INDEX_FINGER_TIP"] = "index-finger-tip";
    /** Middle finger near wrist */
    WebXRHandJoint["MIDDLE_FINGER_METACARPAL"] = "middle-finger-metacarpal";
    /** Middle finger first knuckle */
    WebXRHandJoint["MIDDLE_FINGER_PHALANX_PROXIMAL"] = "middle-finger-phalanx-proximal";
    /** Middle finger second knuckle */
    WebXRHandJoint["MIDDLE_FINGER_PHALANX_INTERMEDIATE"] = "middle-finger-phalanx-intermediate";
    /** Middle finger third knuckle */
    WebXRHandJoint["MIDDLE_FINGER_PHALANX_DISTAL"] = "middle-finger-phalanx-distal";
    /** Middle finger tip */
    WebXRHandJoint["MIDDLE_FINGER_TIP"] = "middle-finger-tip";
    /** Ring finger near wrist */
    WebXRHandJoint["RING_FINGER_METACARPAL"] = "ring-finger-metacarpal";
    /** Ring finger first knuckle */
    WebXRHandJoint["RING_FINGER_PHALANX_PROXIMAL"] = "ring-finger-phalanx-proximal";
    /** Ring finger second knuckle */
    WebXRHandJoint["RING_FINGER_PHALANX_INTERMEDIATE"] = "ring-finger-phalanx-intermediate";
    /** Ring finger third knuckle */
    WebXRHandJoint["RING_FINGER_PHALANX_DISTAL"] = "ring-finger-phalanx-distal";
    /** Ring finger tip */
    WebXRHandJoint["RING_FINGER_TIP"] = "ring-finger-tip";
    /** Pinky finger near wrist */
    WebXRHandJoint["PINKY_FINGER_METACARPAL"] = "pinky-finger-metacarpal";
    /** Pinky finger first knuckle */
    WebXRHandJoint["PINKY_FINGER_PHALANX_PROXIMAL"] = "pinky-finger-phalanx-proximal";
    /** Pinky finger second knuckle */
    WebXRHandJoint["PINKY_FINGER_PHALANX_INTERMEDIATE"] = "pinky-finger-phalanx-intermediate";
    /** Pinky finger third knuckle */
    WebXRHandJoint["PINKY_FINGER_PHALANX_DISTAL"] = "pinky-finger-phalanx-distal";
    /** Pinky finger tip */
    WebXRHandJoint["PINKY_FINGER_TIP"] = "pinky-finger-tip";
})(WebXRHandJoint || (WebXRHandJoint = {}));
const handJointReferenceArray = [
    "wrist" /* WebXRHandJoint.WRIST */,
    "thumb-metacarpal" /* WebXRHandJoint.THUMB_METACARPAL */,
    "thumb-phalanx-proximal" /* WebXRHandJoint.THUMB_PHALANX_PROXIMAL */,
    "thumb-phalanx-distal" /* WebXRHandJoint.THUMB_PHALANX_DISTAL */,
    "thumb-tip" /* WebXRHandJoint.THUMB_TIP */,
    "index-finger-metacarpal" /* WebXRHandJoint.INDEX_FINGER_METACARPAL */,
    "index-finger-phalanx-proximal" /* WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL */,
    "index-finger-phalanx-intermediate" /* WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE */,
    "index-finger-phalanx-distal" /* WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL */,
    "index-finger-tip" /* WebXRHandJoint.INDEX_FINGER_TIP */,
    "middle-finger-metacarpal" /* WebXRHandJoint.MIDDLE_FINGER_METACARPAL */,
    "middle-finger-phalanx-proximal" /* WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL */,
    "middle-finger-phalanx-intermediate" /* WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE */,
    "middle-finger-phalanx-distal" /* WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL */,
    "middle-finger-tip" /* WebXRHandJoint.MIDDLE_FINGER_TIP */,
    "ring-finger-metacarpal" /* WebXRHandJoint.RING_FINGER_METACARPAL */,
    "ring-finger-phalanx-proximal" /* WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL */,
    "ring-finger-phalanx-intermediate" /* WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE */,
    "ring-finger-phalanx-distal" /* WebXRHandJoint.RING_FINGER_PHALANX_DISTAL */,
    "ring-finger-tip" /* WebXRHandJoint.RING_FINGER_TIP */,
    "pinky-finger-metacarpal" /* WebXRHandJoint.PINKY_FINGER_METACARPAL */,
    "pinky-finger-phalanx-proximal" /* WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL */,
    "pinky-finger-phalanx-intermediate" /* WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE */,
    "pinky-finger-phalanx-distal" /* WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL */,
    "pinky-finger-tip" /* WebXRHandJoint.PINKY_FINGER_TIP */,
];
const handPartsDefinition = {
    ["wrist" /* HandPart.WRIST */]: ["wrist" /* WebXRHandJoint.WRIST */],
    ["thumb" /* HandPart.THUMB */]: ["thumb-metacarpal" /* WebXRHandJoint.THUMB_METACARPAL */, "thumb-phalanx-proximal" /* WebXRHandJoint.THUMB_PHALANX_PROXIMAL */, "thumb-phalanx-distal" /* WebXRHandJoint.THUMB_PHALANX_DISTAL */, "thumb-tip" /* WebXRHandJoint.THUMB_TIP */],
    ["index" /* HandPart.INDEX */]: [
        "index-finger-metacarpal" /* WebXRHandJoint.INDEX_FINGER_METACARPAL */,
        "index-finger-phalanx-proximal" /* WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL */,
        "index-finger-phalanx-intermediate" /* WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE */,
        "index-finger-phalanx-distal" /* WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL */,
        "index-finger-tip" /* WebXRHandJoint.INDEX_FINGER_TIP */,
    ],
    ["middle" /* HandPart.MIDDLE */]: [
        "middle-finger-metacarpal" /* WebXRHandJoint.MIDDLE_FINGER_METACARPAL */,
        "middle-finger-phalanx-proximal" /* WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL */,
        "middle-finger-phalanx-intermediate" /* WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE */,
        "middle-finger-phalanx-distal" /* WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL */,
        "middle-finger-tip" /* WebXRHandJoint.MIDDLE_FINGER_TIP */,
    ],
    ["ring" /* HandPart.RING */]: [
        "ring-finger-metacarpal" /* WebXRHandJoint.RING_FINGER_METACARPAL */,
        "ring-finger-phalanx-proximal" /* WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL */,
        "ring-finger-phalanx-intermediate" /* WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE */,
        "ring-finger-phalanx-distal" /* WebXRHandJoint.RING_FINGER_PHALANX_DISTAL */,
        "ring-finger-tip" /* WebXRHandJoint.RING_FINGER_TIP */,
    ],
    ["little" /* HandPart.LITTLE */]: [
        "pinky-finger-metacarpal" /* WebXRHandJoint.PINKY_FINGER_METACARPAL */,
        "pinky-finger-phalanx-proximal" /* WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL */,
        "pinky-finger-phalanx-intermediate" /* WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE */,
        "pinky-finger-phalanx-distal" /* WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL */,
        "pinky-finger-tip" /* WebXRHandJoint.PINKY_FINGER_TIP */,
    ],
};
/**
 * Representing a single hand (with its corresponding native XRHand object)
 */
class WebXRHand {
    /**
     * Get the hand mesh.
     */
    get handMesh() {
        return this._handMesh;
    }
    /**
     * Get meshes of part of the hand.
     * @param part The part of hand to get.
     * @returns An array of meshes that correlate to the hand part requested.
     */
    getHandPartMeshes(part) {
        return handPartsDefinition[part].map((name) => this._jointMeshes[handJointReferenceArray.indexOf(name)]);
    }
    /**
     * Retrieves a mesh linked to a named joint in the hand.
     * @param jointName The name of the joint.
     * @returns An AbstractMesh whose position corresponds with the joint position.
     */
    getJointMesh(jointName) {
        return this._jointMeshes[handJointReferenceArray.indexOf(jointName)];
    }
    /**
     * Construct a new hand object
     * @param xrController The controller to which the hand correlates.
     * @param _jointMeshes The meshes to be used to track the hand joints.
     * @param _handMesh An optional hand mesh.
     * @param rigMapping An optional rig mapping for the hand mesh.
     *                   If not provided (but a hand mesh is provided),
     *                   it will be assumed that the hand mesh's bones are named
     *                   directly after the WebXR bone names.
     * @param _leftHandedMeshes Are the hand meshes left-handed-system meshes
     * @param _jointsInvisible Are the tracked joint meshes visible
     * @param _jointScaleFactor Scale factor for all joint meshes
     */
    constructor(
    /** The controller to which the hand correlates. */
    xrController, _jointMeshes, _handMesh, 
    /** An optional rig mapping for the hand mesh. If not provided (but a hand mesh is provided),
     * it will be assumed that the hand mesh's bones are named directly after the WebXR bone names. */
    rigMapping, _leftHandedMeshes = false, _jointsInvisible = false, _jointScaleFactor = 1) {
        this.xrController = xrController;
        this._jointMeshes = _jointMeshes;
        this._handMesh = _handMesh;
        this.rigMapping = rigMapping;
        this._leftHandedMeshes = _leftHandedMeshes;
        this._jointsInvisible = _jointsInvisible;
        this._jointScaleFactor = _jointScaleFactor;
        /**
         * This observable will notify registered observers when the hand object has been set with a new mesh.
         * you can get the hand mesh using `webxrHand.handMesh`
         */
        this.onHandMeshSetObservable = new Misc_observable/* Observable */.cP();
        /**
         * Transform nodes that will directly receive the transforms from the WebXR matrix data.
         */
        this._jointTransforms = new Array(handJointReferenceArray.length);
        /**
         * The float array that will directly receive the transform matrix data from WebXR.
         */
        this._jointTransformMatrices = new Float32Array(handJointReferenceArray.length * 16);
        this._tempJointMatrix = new math_vector/* Matrix */.uq();
        /**
         * The float array that will directly receive the joint radii from WebXR.
         */
        this._jointRadii = new Float32Array(handJointReferenceArray.length);
        this._scene = _jointMeshes[0].getScene();
        // Initialize the joint transform quaternions and link the transforms to the bones.
        for (let jointIdx = 0; jointIdx < this._jointTransforms.length; jointIdx++) {
            this._jointTransforms[jointIdx] = new Meshes_transformNode/* TransformNode */.V(handJointReferenceArray[jointIdx], this._scene);
            this._jointTransforms[jointIdx].rotationQuaternion = new math_vector/* Quaternion */.PT();
            // Set the rotation quaternion so we can use it later for tracking.
            if (_jointMeshes[jointIdx].rotationQuaternion) {
                _jointMeshes[jointIdx].rotationQuaternion = new math_vector/* Quaternion */.PT();
            }
            else {
                _jointMeshes[jointIdx].rotationQuaternion?.set(0, 0, 0, 1);
            }
        }
        if (_handMesh) {
            // Note that this logic needs to happen after we initialize the joint tracking transform nodes.
            this.setHandMesh(_handMesh, rigMapping);
        }
        // hide the motion controller, if available/loaded
        if (this.xrController.motionController) {
            if (this.xrController.motionController.rootMesh) {
                this.xrController.motionController.rootMesh.dispose(false, true);
            }
        }
        this.xrController.onMotionControllerInitObservable.add((motionController) => {
            motionController._doNotLoadControllerMesh = true;
        });
    }
    /**
     * Sets the current hand mesh to render for the WebXRHand.
     * @param handMesh The rigged hand mesh that will be tracked to the user's hand.
     * @param rigMapping The mapping from XRHandJoint to bone names to use with the mesh.
     * @param _xrSessionManager The XRSessionManager used to initialize the hand mesh.
     */
    setHandMesh(handMesh, rigMapping, _xrSessionManager) {
        this._handMesh = handMesh;
        // Avoid any strange frustum culling. We will manually control visibility via attach and detach.
        handMesh.alwaysSelectAsActiveMesh = true;
        handMesh.getChildMeshes().forEach((mesh) => {
            mesh.alwaysSelectAsActiveMesh = true;
        });
        // Link the bones in the hand mesh to the transform nodes that will be bound to the WebXR tracked joints.
        if (this._handMesh.skeleton) {
            const handMeshSkeleton = this._handMesh.skeleton;
            handJointReferenceArray.forEach((jointName, jointIdx) => {
                const jointBoneIdx = handMeshSkeleton.getBoneIndexByName(rigMapping ? rigMapping[jointName] : jointName);
                if (jointBoneIdx !== -1) {
                    handMeshSkeleton.bones[jointBoneIdx].linkTransformNode(this._jointTransforms[jointIdx]);
                }
            });
        }
        this.onHandMeshSetObservable.notifyObservers(this);
    }
    /**
     * Update this hand from the latest xr frame.
     * @param xrFrame The latest frame received from WebXR.
     * @param referenceSpace The current viewer reference space.
     */
    updateFromXRFrame(xrFrame, referenceSpace) {
        const hand = this.xrController.inputSource.hand;
        if (!hand) {
            return;
        }
        // TODO: Modify webxr.d.ts to better match WebXR IDL so we don't need this any cast.
        const anyHand = hand;
        const jointSpaces = handJointReferenceArray.map((jointName) => anyHand[jointName] || hand.get(jointName));
        let trackingSuccessful = false;
        if (xrFrame.fillPoses && xrFrame.fillJointRadii) {
            trackingSuccessful = xrFrame.fillPoses(jointSpaces, referenceSpace, this._jointTransformMatrices) && xrFrame.fillJointRadii(jointSpaces, this._jointRadii);
        }
        else if (xrFrame.getJointPose) {
            trackingSuccessful = true;
            // Warning: This codepath is slow by comparison, only here for compat.
            for (let jointIdx = 0; jointIdx < jointSpaces.length; jointIdx++) {
                const jointPose = xrFrame.getJointPose(jointSpaces[jointIdx], referenceSpace);
                if (jointPose) {
                    this._jointTransformMatrices.set(jointPose.transform.matrix, jointIdx * 16);
                    this._jointRadii[jointIdx] = jointPose.radius || 0.008;
                }
                else {
                    trackingSuccessful = false;
                    break;
                }
            }
        }
        if (!trackingSuccessful) {
            return;
        }
        handJointReferenceArray.forEach((_jointName, jointIdx) => {
            const jointTransform = this._jointTransforms[jointIdx];
            math_vector/* Matrix */.uq.FromArrayToRef(this._jointTransformMatrices, jointIdx * 16, this._tempJointMatrix);
            this._tempJointMatrix.decompose(undefined, jointTransform.rotationQuaternion, jointTransform.position);
            // The radius we need to make the joint in order for it to roughly cover the joints of the user's real hand.
            const scaledJointRadius = this._jointRadii[jointIdx] * this._jointScaleFactor;
            const jointMesh = this._jointMeshes[jointIdx];
            jointMesh.isVisible = !this._handMesh && !this._jointsInvisible;
            jointMesh.position.copyFrom(jointTransform.position);
            jointMesh.rotationQuaternion.copyFrom(jointTransform.rotationQuaternion);
            jointMesh.scaling.setAll(scaledJointRadius);
            // The WebXR data comes as right-handed, so we might need to do some conversions.
            if (!this._scene.useRightHandedSystem) {
                jointMesh.position.z *= -1;
                jointMesh.rotationQuaternion.z *= -1;
                jointMesh.rotationQuaternion.w *= -1;
                if (this._leftHandedMeshes && this._handMesh) {
                    jointTransform.position.z *= -1;
                    jointTransform.rotationQuaternion.z *= -1;
                    jointTransform.rotationQuaternion.w *= -1;
                }
            }
        });
        if (this._handMesh) {
            this._handMesh.isVisible = true;
        }
    }
    /**
     * Dispose this Hand object
     * @param disposeMeshes Should the meshes be disposed as well
     */
    dispose(disposeMeshes = false) {
        if (this._handMesh) {
            if (disposeMeshes) {
                this._handMesh.skeleton?.dispose();
                this._handMesh.dispose(false, true);
            }
            else {
                this._handMesh.isVisible = false;
            }
        }
        this._jointTransforms.forEach((transform) => transform.dispose());
        this._jointTransforms.length = 0;
        this.onHandMeshSetObservable.clear();
    }
}
/**
 * WebXR Hand Joint tracking feature, available for selected browsers and devices
 */
class WebXRHandTracking extends WebXRAbstractFeature {
    static _GenerateTrackedJointMeshes(featureOptions, originalMesh = CreateIcoSphere("jointParent", WebXRHandTracking._ICOSPHERE_PARAMS)) {
        const meshes = {};
        ["left", "right"].map((handedness) => {
            const trackedMeshes = [];
            originalMesh.isVisible = !!featureOptions.jointMeshes?.keepOriginalVisible;
            for (let i = 0; i < handJointReferenceArray.length; ++i) {
                let newInstance = originalMesh.createInstance(`${handedness}-handJoint-${i}`);
                if (featureOptions.jointMeshes?.onHandJointMeshGenerated) {
                    const returnedMesh = featureOptions.jointMeshes.onHandJointMeshGenerated(newInstance, i, handedness);
                    if (returnedMesh) {
                        if (returnedMesh !== newInstance) {
                            newInstance.dispose();
                            newInstance = returnedMesh;
                        }
                    }
                }
                newInstance.isPickable = false;
                if (featureOptions.jointMeshes?.enablePhysics) {
                    const props = featureOptions.jointMeshes?.physicsProps || {};
                    // downscale the instances so that physics will be initialized correctly
                    newInstance.scaling.setAll(0.02);
                    const type = props.impostorType !== undefined ? props.impostorType : PhysicsImpostor.SphereImpostor;
                    newInstance.physicsImpostor = new PhysicsImpostor(newInstance, type, { mass: 0, ...props });
                }
                newInstance.rotationQuaternion = new math_vector/* Quaternion */.PT();
                newInstance.isVisible = false;
                trackedMeshes.push(newInstance);
            }
            meshes[handedness] = trackedMeshes;
        });
        return { left: meshes.left, right: meshes.right };
    }
    static _GenerateDefaultHandMeshesAsync(scene, xrSessionManager, options) {
        // eslint-disable-next-line no-async-promise-executor
        return new Promise(async (resolve) => {
            const riggedMeshes = {};
            // check the cache, defensive
            if (WebXRHandTracking._RightHandGLB?.meshes[1]?.isDisposed()) {
                WebXRHandTracking._RightHandGLB = null;
            }
            if (WebXRHandTracking._LeftHandGLB?.meshes[1]?.isDisposed()) {
                WebXRHandTracking._LeftHandGLB = null;
            }
            const handsDefined = !!(WebXRHandTracking._RightHandGLB && WebXRHandTracking._LeftHandGLB);
            // load them in parallel
            const handGLBs = await Promise.all([
                WebXRHandTracking._RightHandGLB ||
                    sceneLoader/* SceneLoader */.cn.ImportMeshAsync("", WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL, WebXRHandTracking.DEFAULT_HAND_MODEL_RIGHT_FILENAME, scene),
                WebXRHandTracking._LeftHandGLB ||
                    sceneLoader/* SceneLoader */.cn.ImportMeshAsync("", WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL, WebXRHandTracking.DEFAULT_HAND_MODEL_LEFT_FILENAME, scene),
            ]);
            WebXRHandTracking._RightHandGLB = handGLBs[0];
            WebXRHandTracking._LeftHandGLB = handGLBs[1];
            const handShader = await NodeMaterial.ParseFromFileAsync("handShader", WebXRHandTracking.DEFAULT_HAND_MODEL_SHADER_URL, scene, undefined, true);
            // depth prepass and alpha mode
            handShader.needDepthPrePass = true;
            handShader.transparencyMode = Materials_material/* Material */.i.MATERIAL_ALPHABLEND;
            handShader.alphaMode = 2;
            // build node materials
            handShader.build(false);
            // shader
            const handColors = {
                base: math_color/* Color3 */.v9.FromInts(116, 63, 203),
                fresnel: math_color/* Color3 */.v9.FromInts(149, 102, 229),
                fingerColor: math_color/* Color3 */.v9.FromInts(177, 130, 255),
                tipFresnel: math_color/* Color3 */.v9.FromInts(220, 200, 255),
                ...options?.handMeshes?.customColors,
            };
            const handNodes = {
                base: handShader.getBlockByName("baseColor"),
                fresnel: handShader.getBlockByName("fresnelColor"),
                fingerColor: handShader.getBlockByName("fingerColor"),
                tipFresnel: handShader.getBlockByName("tipFresnelColor"),
            };
            handNodes.base.value = handColors.base;
            handNodes.fresnel.value = handColors.fresnel;
            handNodes.fingerColor.value = handColors.fingerColor;
            handNodes.tipFresnel.value = handColors.tipFresnel;
            const isMultiview = xrSessionManager._getBaseLayerWrapper()?.isMultiview;
            ["left", "right"].forEach((handedness) => {
                const handGLB = handedness == "left" ? WebXRHandTracking._LeftHandGLB : WebXRHandTracking._RightHandGLB;
                if (!handGLB) {
                    // this should never happen!
                    throw new Error("Could not load hand model");
                }
                const handMesh = handGLB.meshes[1];
                handMesh._internalAbstractMeshDataInfo._computeBonesUsingShaders = true;
                // if in multiview do not use the material
                if (!isMultiview && !options?.handMeshes?.disableHandShader) {
                    handMesh.material = handShader.clone(`${handedness}HandShaderClone`, true);
                }
                handMesh.isVisible = false;
                riggedMeshes[handedness] = handMesh;
                // single change for left handed systems
                if (!handsDefined && !scene.useRightHandedSystem) {
                    handGLB.meshes[1].rotate(math_axis/* Axis */._0.Y, Math.PI);
                }
            });
            handShader.dispose();
            resolve({ left: riggedMeshes.left, right: riggedMeshes.right });
        });
    }
    /**
     * Generates a mapping from XRHandJoint to bone name for the default hand mesh.
     * @param handedness The handedness being mapped for.
     * @returns A mapping from XRHandJoint to bone name.
     */
    static _GenerateDefaultHandMeshRigMapping(handedness) {
        const H = handedness == "right" ? "R" : "L";
        return {
            ["wrist" /* WebXRHandJoint.WRIST */]: `wrist_${H}`,
            ["thumb-metacarpal" /* WebXRHandJoint.THUMB_METACARPAL */]: `thumb_metacarpal_${H}`,
            ["thumb-phalanx-proximal" /* WebXRHandJoint.THUMB_PHALANX_PROXIMAL */]: `thumb_proxPhalanx_${H}`,
            ["thumb-phalanx-distal" /* WebXRHandJoint.THUMB_PHALANX_DISTAL */]: `thumb_distPhalanx_${H}`,
            ["thumb-tip" /* WebXRHandJoint.THUMB_TIP */]: `thumb_tip_${H}`,
            ["index-finger-metacarpal" /* WebXRHandJoint.INDEX_FINGER_METACARPAL */]: `index_metacarpal_${H}`,
            ["index-finger-phalanx-proximal" /* WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL */]: `index_proxPhalanx_${H}`,
            ["index-finger-phalanx-intermediate" /* WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE */]: `index_intPhalanx_${H}`,
            ["index-finger-phalanx-distal" /* WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL */]: `index_distPhalanx_${H}`,
            ["index-finger-tip" /* WebXRHandJoint.INDEX_FINGER_TIP */]: `index_tip_${H}`,
            ["middle-finger-metacarpal" /* WebXRHandJoint.MIDDLE_FINGER_METACARPAL */]: `middle_metacarpal_${H}`,
            ["middle-finger-phalanx-proximal" /* WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL */]: `middle_proxPhalanx_${H}`,
            ["middle-finger-phalanx-intermediate" /* WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE */]: `middle_intPhalanx_${H}`,
            ["middle-finger-phalanx-distal" /* WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL */]: `middle_distPhalanx_${H}`,
            ["middle-finger-tip" /* WebXRHandJoint.MIDDLE_FINGER_TIP */]: `middle_tip_${H}`,
            ["ring-finger-metacarpal" /* WebXRHandJoint.RING_FINGER_METACARPAL */]: `ring_metacarpal_${H}`,
            ["ring-finger-phalanx-proximal" /* WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL */]: `ring_proxPhalanx_${H}`,
            ["ring-finger-phalanx-intermediate" /* WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE */]: `ring_intPhalanx_${H}`,
            ["ring-finger-phalanx-distal" /* WebXRHandJoint.RING_FINGER_PHALANX_DISTAL */]: `ring_distPhalanx_${H}`,
            ["ring-finger-tip" /* WebXRHandJoint.RING_FINGER_TIP */]: `ring_tip_${H}`,
            ["pinky-finger-metacarpal" /* WebXRHandJoint.PINKY_FINGER_METACARPAL */]: `little_metacarpal_${H}`,
            ["pinky-finger-phalanx-proximal" /* WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL */]: `little_proxPhalanx_${H}`,
            ["pinky-finger-phalanx-intermediate" /* WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE */]: `little_intPhalanx_${H}`,
            ["pinky-finger-phalanx-distal" /* WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL */]: `little_distPhalanx_${H}`,
            ["pinky-finger-tip" /* WebXRHandJoint.PINKY_FINGER_TIP */]: `little_tip_${H}`,
        };
    }
    /**
     * Check if the needed objects are defined.
     * This does not mean that the feature is enabled, but that the objects needed are well defined.
     * @returns true if the needed objects for this feature are defined
     */
    isCompatible() {
        return typeof XRHand !== "undefined";
    }
    /**
     * Get the hand object according to the controller id
     * @param controllerId the controller id to which we want to get the hand
     * @returns null if not found or the WebXRHand object if found
     */
    getHandByControllerId(controllerId) {
        return this._attachedHands[controllerId];
    }
    /**
     * Get a hand object according to the requested handedness
     * @param handedness the handedness to request
     * @returns null if not found or the WebXRHand object if found
     */
    getHandByHandedness(handedness) {
        if (handedness == "none") {
            return null;
        }
        return this._trackingHands[handedness];
    }
    /**
     * Creates a new instance of the XR hand tracking feature.
     * @param _xrSessionManager An instance of WebXRSessionManager.
     * @param options Options to use when constructing this feature.
     */
    constructor(_xrSessionManager, 
    /** Options to use when constructing this feature. */
    options) {
        super(_xrSessionManager);
        this.options = options;
        this._attachedHands = {};
        this._trackingHands = { left: null, right: null };
        this._handResources = { jointMeshes: null, handMeshes: null, rigMappings: null };
        this._worldScaleObserver = null;
        /**
         * This observable will notify registered observers when a new hand object was added and initialized
         */
        this.onHandAddedObservable = new Misc_observable/* Observable */.cP();
        /**
         * This observable will notify its observers right before the hand object is disposed
         */
        this.onHandRemovedObservable = new Misc_observable/* Observable */.cP();
        this._attachHand = (xrController) => {
            if (!xrController.inputSource.hand || xrController.inputSource.handedness == "none" || !this._handResources.jointMeshes) {
                return;
            }
            const handedness = xrController.inputSource.handedness;
            const webxrHand = new WebXRHand(xrController, this._handResources.jointMeshes[handedness], this._handResources.handMeshes && this._handResources.handMeshes[handedness], this._handResources.rigMappings && this._handResources.rigMappings[handedness], this.options.handMeshes?.meshesUseLeftHandedCoordinates, this.options.jointMeshes?.invisible, this.options.jointMeshes?.scaleFactor);
            this._attachedHands[xrController.uniqueId] = webxrHand;
            this._trackingHands[handedness] = webxrHand;
            this.onHandAddedObservable.notifyObservers(webxrHand);
        };
        this._detachHand = (xrController) => {
            this._detachHandById(xrController.uniqueId);
        };
        this.xrNativeFeatureName = "hand-tracking";
        // Support legacy versions of the options object by copying over joint mesh properties
        const anyOptions = options;
        const anyJointMeshOptions = anyOptions.jointMeshes;
        if (anyJointMeshOptions) {
            if (typeof anyJointMeshOptions.disableDefaultHandMesh !== "undefined") {
                options.handMeshes = options.handMeshes || {};
                options.handMeshes.disableDefaultMeshes = anyJointMeshOptions.disableDefaultHandMesh;
            }
            if (typeof anyJointMeshOptions.handMeshes !== "undefined") {
                options.handMeshes = options.handMeshes || {};
                options.handMeshes.customMeshes = anyJointMeshOptions.handMeshes;
            }
            if (typeof anyJointMeshOptions.leftHandedSystemMeshes !== "undefined") {
                options.handMeshes = options.handMeshes || {};
                options.handMeshes.meshesUseLeftHandedCoordinates = anyJointMeshOptions.leftHandedSystemMeshes;
            }
            if (typeof anyJointMeshOptions.rigMapping !== "undefined") {
                options.handMeshes = options.handMeshes || {};
                const leftRigMapping = {};
                const rightRigMapping = {};
                [
                    [anyJointMeshOptions.rigMapping.left, leftRigMapping],
                    [anyJointMeshOptions.rigMapping.right, rightRigMapping],
                ].forEach((rigMappingTuple) => {
                    const legacyRigMapping = rigMappingTuple[0];
                    const rigMapping = rigMappingTuple[1];
                    legacyRigMapping.forEach((modelJointName, index) => {
                        rigMapping[handJointReferenceArray[index]] = modelJointName;
                    });
                });
                options.handMeshes.customRigMappings = {
                    left: leftRigMapping,
                    right: rightRigMapping,
                };
            }
        }
    }
    /**
     * Attach this feature.
     * Will usually be called by the features manager.
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        if (!this._handResources.jointMeshes) {
            this._originalMesh = this._originalMesh || this.options.jointMeshes?.sourceMesh || CreateIcoSphere("jointParent", WebXRHandTracking._ICOSPHERE_PARAMS);
            this._originalMesh.isVisible = false;
            this._handResources.jointMeshes = WebXRHandTracking._GenerateTrackedJointMeshes(this.options, this._originalMesh);
        }
        this._handResources.handMeshes = this.options.handMeshes?.customMeshes || null;
        this._handResources.rigMappings = this.options.handMeshes?.customRigMappings || null;
        // If they didn't supply custom meshes and are not disabling the default meshes...
        if (!this.options.handMeshes?.customMeshes && !this.options.handMeshes?.disableDefaultMeshes) {
            WebXRHandTracking._GenerateDefaultHandMeshesAsync(engineStore/* EngineStore */.q.LastCreatedScene, this._xrSessionManager, this.options).then((defaultHandMeshes) => {
                this._handResources.handMeshes = defaultHandMeshes;
                this._handResources.rigMappings = {
                    left: WebXRHandTracking._GenerateDefaultHandMeshRigMapping("left"),
                    right: WebXRHandTracking._GenerateDefaultHandMeshRigMapping("right"),
                };
                // Apply meshes to existing hands if already tracking.
                this._trackingHands.left?.setHandMesh(this._handResources.handMeshes.left, this._handResources.rigMappings.left, this._xrSessionManager);
                this._trackingHands.right?.setHandMesh(this._handResources.handMeshes.right, this._handResources.rigMappings.right, this._xrSessionManager);
                this._handResources.handMeshes.left.scaling.setAll(this._xrSessionManager.worldScalingFactor);
                this._handResources.handMeshes.right.scaling.setAll(this._xrSessionManager.worldScalingFactor);
            });
            this._worldScaleObserver = this._xrSessionManager.onWorldScaleFactorChangedObservable.add((scalingFactors) => {
                if (this._handResources.handMeshes) {
                    this._handResources.handMeshes.left.scaling.scaleInPlace(scalingFactors.newScaleFactor / scalingFactors.previousScaleFactor);
                    this._handResources.handMeshes.right.scaling.scaleInPlace(scalingFactors.newScaleFactor / scalingFactors.previousScaleFactor);
                }
            });
        }
        this.options.xrInput.controllers.forEach(this._attachHand);
        this._addNewAttachObserver(this.options.xrInput.onControllerAddedObservable, this._attachHand);
        this._addNewAttachObserver(this.options.xrInput.onControllerRemovedObservable, this._detachHand);
        return true;
    }
    _onXRFrame(_xrFrame) {
        this._trackingHands.left?.updateFromXRFrame(_xrFrame, this._xrSessionManager.referenceSpace);
        this._trackingHands.right?.updateFromXRFrame(_xrFrame, this._xrSessionManager.referenceSpace);
    }
    _detachHandById(controllerId, disposeMesh) {
        const hand = this.getHandByControllerId(controllerId);
        if (hand) {
            const handedness = hand.xrController.inputSource.handedness == "left" ? "left" : "right";
            if (this._trackingHands[handedness]?.xrController.uniqueId === controllerId) {
                this._trackingHands[handedness] = null;
            }
            this.onHandRemovedObservable.notifyObservers(hand);
            hand.dispose(disposeMesh);
            delete this._attachedHands[controllerId];
        }
    }
    /**
     * Detach this feature.
     * Will usually be called by the features manager.
     *
     * @returns true if successful.
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        Object.keys(this._attachedHands).forEach((uniqueId) => this._detachHandById(uniqueId, this.options.handMeshes?.disposeOnSessionEnd));
        if (this.options.handMeshes?.disposeOnSessionEnd) {
            if (this._handResources.jointMeshes) {
                this._handResources.jointMeshes.left.forEach((trackedMesh) => trackedMesh.dispose());
                this._handResources.jointMeshes.right.forEach((trackedMesh) => trackedMesh.dispose());
                this._handResources.jointMeshes = null;
            }
            if (this._handResources.handMeshes) {
                this._handResources.handMeshes.left.dispose();
                this._handResources.handMeshes.right.dispose();
                this._handResources.handMeshes = null;
            }
            WebXRHandTracking._RightHandGLB?.meshes.forEach((mesh) => mesh.dispose());
            WebXRHandTracking._LeftHandGLB?.meshes.forEach((mesh) => mesh.dispose());
            WebXRHandTracking._RightHandGLB = null;
            WebXRHandTracking._LeftHandGLB = null;
            this._originalMesh?.dispose();
            this._originalMesh = undefined;
        }
        // remove world scale observer
        if (this._worldScaleObserver) {
            this._xrSessionManager.onWorldScaleFactorChangedObservable.remove(this._worldScaleObserver);
        }
        return true;
    }
    /**
     * Dispose this feature and all of the resources attached.
     */
    dispose() {
        super.dispose();
        this.onHandAddedObservable.clear();
        this.onHandRemovedObservable.clear();
        if (this._handResources.handMeshes && !this.options.handMeshes?.customMeshes) {
            // this will dispose the cached meshes
            this._handResources.handMeshes.left.dispose();
            this._handResources.handMeshes.right.dispose();
            // remove the cached meshes
            WebXRHandTracking._RightHandGLB?.meshes.forEach((mesh) => mesh.dispose());
            WebXRHandTracking._LeftHandGLB?.meshes.forEach((mesh) => mesh.dispose());
            WebXRHandTracking._RightHandGLB = null;
            WebXRHandTracking._LeftHandGLB = null;
        }
        if (this._handResources.jointMeshes) {
            this._handResources.jointMeshes.left.forEach((trackedMesh) => trackedMesh.dispose());
            this._handResources.jointMeshes.right.forEach((trackedMesh) => trackedMesh.dispose());
        }
    }
}
/**
 * The module's name
 */
WebXRHandTracking.Name = webXRFeaturesManager/* WebXRFeatureName */._.HAND_TRACKING;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRHandTracking.Version = 1;
/** The base URL for the default hand model. */
WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/HandMeshes/";
/** The filename to use for the default right hand model. */
WebXRHandTracking.DEFAULT_HAND_MODEL_RIGHT_FILENAME = "r_hand_rhs.glb";
/** The filename to use for the default left hand model. */
WebXRHandTracking.DEFAULT_HAND_MODEL_LEFT_FILENAME = "l_hand_rhs.glb";
/** The URL pointing to the default hand model NodeMaterial shader. */
WebXRHandTracking.DEFAULT_HAND_MODEL_SHADER_URL = "https://assets.babylonjs.com/meshes/HandMeshes/handsShader.json";
// We want to use lightweight models, diameter will initially be 1 but scaled to the values returned from WebXR.
WebXRHandTracking._ICOSPHERE_PARAMS = { radius: 0.5, flat: false, subdivisions: 2 };
WebXRHandTracking._RightHandGLB = null;
WebXRHandTracking._LeftHandGLB = null;
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRHandTracking.Name, (xrSessionManager, options) => {
    return () => new WebXRHandTracking(xrSessionManager, options);
}, WebXRHandTracking.Version, false);
//# sourceMappingURL=WebXRHandTracking.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/timer.js
var timer = __webpack_require__(20472);
;// ./node_modules/@babylonjs/core/XR/features/WebXRControllerTeleportation.js




















/**
 * This is a teleportation feature to be used with WebXR-enabled motion controllers.
 * When enabled and attached, the feature will allow a user to move around and rotate in the scene using
 * the input of the attached controllers.
 */
class WebXRMotionControllerTeleportation extends WebXRAbstractFeature {
    /**
     * Is rotation enabled when moving forward?
     * Disabling this feature will prevent the user from deciding the direction when teleporting
     */
    get rotationEnabled() {
        return this._rotationEnabled;
    }
    /**
     * Sets whether rotation is enabled or not
     * @param enabled is rotation enabled when teleportation is shown
     */
    set rotationEnabled(enabled) {
        this._rotationEnabled = enabled;
        if (this._options.teleportationTargetMesh) {
            const children = this._options.teleportationTargetMesh.getChildMeshes(false, (node) => node.name === "rotationCone");
            if (children[0]) {
                children[0].setEnabled(enabled);
            }
        }
    }
    /**
     * Exposes the currently set teleportation target mesh.
     */
    get teleportationTargetMesh() {
        return this._options.teleportationTargetMesh || null;
    }
    /**
     * constructs a new teleportation system
     * @param _xrSessionManager an instance of WebXRSessionManager
     * @param _options configuration object for this feature
     */
    constructor(_xrSessionManager, _options) {
        super(_xrSessionManager);
        this._options = _options;
        this._controllers = {};
        this._snappedToPoint = false;
        this._cachedColor4White = new math_color/* Color4 */.ov(1, 1, 1, 1);
        this._tmpRay = new Culling_ray/* Ray */.Rl(new math_vector/* Vector3 */.Pq(), new math_vector/* Vector3 */.Pq());
        this._tmpVector = new math_vector/* Vector3 */.Pq();
        this._tmpQuaternion = new math_vector/* Quaternion */.PT();
        this._worldScaleObserver = null;
        /**
         * Skip the next teleportation. This can be controlled by the user to prevent the user from teleportation
         * to sections that are not yet "unlocked", but should still show the teleportation mesh.
         */
        this.skipNextTeleportation = false;
        /**
         * Is movement backwards enabled
         */
        this.backwardsMovementEnabled = true;
        /**
         * Distance to travel when moving backwards
         */
        this.backwardsTeleportationDistance = 0.7;
        /**
         * The distance from the user to the inspection point in the direction of the controller
         * A higher number will allow the user to move further
         * defaults to 5 (meters, in xr units)
         */
        this.parabolicCheckRadius = 5;
        /**
         * Should the module support parabolic ray on top of direct ray
         * If enabled, the user will be able to point "at the sky" and move according to predefined radius distance
         * Very helpful when moving between floors / different heights
         */
        this.parabolicRayEnabled = true;
        /**
         * The second type of ray - straight line.
         * Should it be enabled or should the parabolic line be the only one.
         */
        this.straightRayEnabled = true;
        /**
         * How much rotation should be applied when rotating right and left
         */
        this.rotationAngle = Math.PI / 8;
        /**
         * This observable will notify when the target mesh position was updated.
         * The picking info it provides contains the point to which the target mesh will move ()
         */
        this.onTargetMeshPositionUpdatedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Is teleportation enabled. Can be used to allow rotation only.
         */
        this.teleportationEnabled = true;
        this._rotationEnabled = true;
        /**
         * Observable raised before camera rotation
         */
        this.onBeforeCameraTeleportRotation = new Misc_observable/* Observable */.cP();
        /**
         *  Observable raised after camera rotation
         */
        this.onAfterCameraTeleportRotation = new Misc_observable/* Observable */.cP();
        this._attachController = (xrController) => {
            if (this._controllers[xrController.uniqueId] || (this._options.forceHandedness && xrController.inputSource.handedness !== this._options.forceHandedness)) {
                // already attached
                return;
            }
            this._controllers[xrController.uniqueId] = {
                xrController,
                teleportationState: {
                    forward: false,
                    backwards: false,
                    rotating: false,
                    currentRotation: 0,
                    baseRotation: 0,
                    blocked: false,
                    initialHit: false,
                    mainComponentUsed: false,
                },
            };
            const controllerData = this._controllers[xrController.uniqueId];
            // motion controller only available to gamepad-enabled input sources.
            if (controllerData.xrController.inputSource.targetRayMode === "tracked-pointer" && controllerData.xrController.inputSource.gamepad) {
                // motion controller support
                const initMotionController = () => {
                    if (xrController.motionController) {
                        const movementController = xrController.motionController.getComponentOfType(WebXRControllerComponent.THUMBSTICK_TYPE) ||
                            xrController.motionController.getComponentOfType(WebXRControllerComponent.TOUCHPAD_TYPE);
                        if (!movementController || this._options.useMainComponentOnly) {
                            // use trigger to move on long press
                            const mainComponent = xrController.motionController.getMainComponent();
                            if (!mainComponent) {
                                return;
                            }
                            controllerData.teleportationState.mainComponentUsed = true;
                            controllerData.teleportationComponent = mainComponent;
                            controllerData.onButtonChangedObserver = mainComponent.onButtonStateChangedObservable.add(() => {
                                if (!this.teleportationEnabled) {
                                    return;
                                }
                                const teleportLocal = () => {
                                    // simulate "forward" thumbstick push
                                    controllerData.teleportationState.forward = true;
                                    controllerData.teleportationState.initialHit = false;
                                    this._currentTeleportationControllerId = controllerData.xrController.uniqueId;
                                    controllerData.teleportationState.baseRotation = this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y;
                                    controllerData.teleportationState.currentRotation = 0;
                                    const timeToSelect = this._options.timeToTeleport || 3000;
                                    (0,timer/* setAndStartTimer */.fj)({
                                        timeout: timeToSelect,
                                        contextObservable: this._xrSessionManager.onXRFrameObservable,
                                        breakCondition: () => !mainComponent.pressed,
                                        onEnded: () => {
                                            if (this._currentTeleportationControllerId === controllerData.xrController.uniqueId && controllerData.teleportationState.forward) {
                                                this._teleportForward(xrController.uniqueId);
                                            }
                                        },
                                    });
                                };
                                // did "pressed" changed?
                                if (mainComponent.changes.pressed) {
                                    if (mainComponent.changes.pressed.current) {
                                        // delay if the start time is defined
                                        if (this._options.timeToTeleportStart) {
                                            (0,timer/* setAndStartTimer */.fj)({
                                                timeout: this._options.timeToTeleportStart,
                                                contextObservable: this._xrSessionManager.onXRFrameObservable,
                                                onEnded: () => {
                                                    // check if still pressed
                                                    if (mainComponent.pressed) {
                                                        teleportLocal();
                                                    }
                                                },
                                            });
                                        }
                                        else {
                                            teleportLocal();
                                        }
                                    }
                                    else {
                                        controllerData.teleportationState.forward = false;
                                        this._currentTeleportationControllerId = "";
                                    }
                                }
                            });
                        }
                        else {
                            controllerData.teleportationComponent = movementController;
                            // use thumbstick (or touchpad if thumbstick not available)
                            controllerData.onAxisChangedObserver = movementController.onAxisValueChangedObservable.add((axesData) => {
                                if (axesData.y <= 0.7 && controllerData.teleportationState.backwards) {
                                    controllerData.teleportationState.backwards = false;
                                }
                                if (axesData.y > 0.7 && !controllerData.teleportationState.forward && this.backwardsMovementEnabled && !this.snapPointsOnly) {
                                    // teleport backwards
                                    // General gist: Go Back N units, cast a ray towards the floor. If collided, move.
                                    if (!controllerData.teleportationState.backwards) {
                                        controllerData.teleportationState.backwards = true;
                                        // teleport backwards ONCE
                                        this._tmpQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion);
                                        this._tmpQuaternion.toEulerAnglesToRef(this._tmpVector);
                                        // get only the y rotation
                                        this._tmpVector.x = 0;
                                        this._tmpVector.z = 0;
                                        // get the quaternion
                                        math_vector/* Quaternion */.PT.FromEulerVectorToRef(this._tmpVector, this._tmpQuaternion);
                                        this._tmpVector.set(0, 0, this.backwardsTeleportationDistance * (this._xrSessionManager.scene.useRightHandedSystem ? 1.0 : -1.0));
                                        this._tmpVector.rotateByQuaternionToRef(this._tmpQuaternion, this._tmpVector);
                                        this._tmpVector.addInPlace(this._options.xrInput.xrCamera.position);
                                        this._tmpRay.origin.copyFrom(this._tmpVector);
                                        // This will prevent the user from "falling" to a lower platform!
                                        // TODO - should this be a flag? 'allow falling to lower platforms'?
                                        this._tmpRay.length = this._options.xrInput.xrCamera.realWorldHeight + 0.1;
                                        // Right handed system had here "1" instead of -1. This is unneeded.
                                        this._tmpRay.direction.set(0, -1, 0);
                                        const pick = this._xrSessionManager.scene.pickWithRay(this._tmpRay, (o) => {
                                            return this._floorMeshes.indexOf(o) !== -1;
                                        });
                                        // pick must exist, but stay safe
                                        if (pick && pick.pickedPoint) {
                                            // Teleport the users feet to where they targeted. Ignore the Y axis.
                                            // If the "falling to lower platforms" feature is implemented the Y axis should be set here as well
                                            this._options.xrInput.xrCamera.position.x = pick.pickedPoint.x;
                                            this._options.xrInput.xrCamera.position.z = pick.pickedPoint.z;
                                        }
                                    }
                                }
                                if (axesData.y < -0.7 && !this._currentTeleportationControllerId && !controllerData.teleportationState.rotating && this.teleportationEnabled) {
                                    controllerData.teleportationState.forward = true;
                                    this._currentTeleportationControllerId = controllerData.xrController.uniqueId;
                                    controllerData.teleportationState.baseRotation = this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y;
                                }
                                if (axesData.x) {
                                    if (!controllerData.teleportationState.forward) {
                                        if (!controllerData.teleportationState.rotating && Math.abs(axesData.x) > 0.7) {
                                            // rotate in the right direction positive is right
                                            controllerData.teleportationState.rotating = true;
                                            const rotation = this.rotationAngle * (axesData.x > 0 ? 1 : -1) * (this._xrSessionManager.scene.useRightHandedSystem ? -1 : 1);
                                            this.onBeforeCameraTeleportRotation.notifyObservers(rotation);
                                            math_vector/* Quaternion */.PT.FromEulerAngles(0, rotation, 0).multiplyToRef(this._options.xrInput.xrCamera.rotationQuaternion, this._options.xrInput.xrCamera.rotationQuaternion);
                                            this.onAfterCameraTeleportRotation.notifyObservers(this._options.xrInput.xrCamera.rotationQuaternion);
                                        }
                                    }
                                    else {
                                        if (this._currentTeleportationControllerId === controllerData.xrController.uniqueId) {
                                            // set the rotation of the forward movement
                                            if (this.rotationEnabled) {
                                                setTimeout(() => {
                                                    controllerData.teleportationState.currentRotation = Math.atan2(axesData.x, axesData.y * (this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1));
                                                });
                                            }
                                            else {
                                                controllerData.teleportationState.currentRotation = 0;
                                            }
                                        }
                                    }
                                }
                                else {
                                    controllerData.teleportationState.rotating = false;
                                }
                                if (axesData.x === 0 && axesData.y === 0) {
                                    if (controllerData.teleportationState.blocked) {
                                        controllerData.teleportationState.blocked = false;
                                        this._setTargetMeshVisibility(false);
                                    }
                                    if (controllerData.teleportationState.forward) {
                                        this._teleportForward(xrController.uniqueId);
                                    }
                                }
                            });
                        }
                    }
                };
                if (xrController.motionController) {
                    initMotionController();
                }
                else {
                    xrController.onMotionControllerInitObservable.addOnce(() => {
                        initMotionController();
                    });
                }
            }
            else {
                controllerData.teleportationState.mainComponentUsed = true;
                let breakObserver = false;
                const teleportLocal = () => {
                    this._currentTeleportationControllerId = controllerData.xrController.uniqueId;
                    controllerData.teleportationState.forward = true;
                    controllerData.teleportationState.initialHit = false;
                    controllerData.teleportationState.baseRotation = this._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y;
                    controllerData.teleportationState.currentRotation = 0;
                    const timeToSelect = this._options.timeToTeleport || 3000;
                    (0,timer/* setAndStartTimer */.fj)({
                        timeout: timeToSelect,
                        contextObservable: this._xrSessionManager.onXRFrameObservable,
                        onEnded: () => {
                            if (this._currentTeleportationControllerId === controllerData.xrController.uniqueId && controllerData.teleportationState.forward) {
                                this._teleportForward(xrController.uniqueId);
                            }
                        },
                    });
                };
                this._xrSessionManager.scene.onPointerObservable.add((pointerInfo) => {
                    if (pointerInfo.type === pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN) {
                        breakObserver = false;
                        // check if start time is defined
                        if (this._options.timeToTeleportStart) {
                            (0,timer/* setAndStartTimer */.fj)({
                                timeout: this._options.timeToTeleportStart,
                                contextObservable: this._xrSessionManager.onXRFrameObservable,
                                onEnded: () => {
                                    // make sure pointer up was not triggered during this time
                                    if (this._currentTeleportationControllerId === controllerData.xrController.uniqueId) {
                                        teleportLocal();
                                    }
                                },
                                breakCondition: () => {
                                    if (breakObserver) {
                                        breakObserver = false;
                                        return true;
                                    }
                                    return false;
                                },
                            });
                        }
                        else {
                            teleportLocal();
                        }
                    }
                    else if (pointerInfo.type === pointerEvents/* PointerEventTypes */.Zp.POINTERUP) {
                        breakObserver = true;
                        controllerData.teleportationState.forward = false;
                        this._currentTeleportationControllerId = "";
                    }
                });
            }
        };
        this._colorArray = Array(24).fill(this._cachedColor4White);
        // create default mesh if not provided
        if (!this._options.teleportationTargetMesh) {
            this._createDefaultTargetMesh();
        }
        this._floorMeshes = this._options.floorMeshes || [];
        this._snapToPositions = this._options.snapPositions || [];
        this._blockedRayColor = this._options.blockedRayColor || new math_color/* Color4 */.ov(1, 0, 0, 0.75);
        this._setTargetMeshVisibility(false);
        // set the observables
        this.onBeforeCameraTeleport = _options.xrInput.xrCamera.onBeforeCameraTeleport;
        this.onAfterCameraTeleport = _options.xrInput.xrCamera.onAfterCameraTeleport;
        this.parabolicCheckRadius *= this._xrSessionManager.worldScalingFactor;
        this._worldScaleObserver = _xrSessionManager.onWorldScaleFactorChangedObservable.add((values) => {
            this.parabolicCheckRadius = (this.parabolicCheckRadius / values.previousScaleFactor) * values.newScaleFactor;
            this._options.teleportationTargetMesh?.scaling.scaleInPlace(values.newScaleFactor / values.previousScaleFactor);
        });
    }
    /**
     * Get the snapPointsOnly flag
     */
    get snapPointsOnly() {
        return !!this._options.snapPointsOnly;
    }
    /**
     * Sets the snapPointsOnly flag
     * @param snapToPoints should teleportation be exclusively to snap points
     */
    set snapPointsOnly(snapToPoints) {
        this._options.snapPointsOnly = snapToPoints;
    }
    /**
     * Add a new mesh to the floor meshes array
     * @param mesh the mesh to use as floor mesh
     */
    addFloorMesh(mesh) {
        this._floorMeshes.push(mesh);
    }
    /**
     * Add a mesh to the list of meshes blocking the teleportation ray
     * @param mesh The mesh to add to the teleportation-blocking meshes
     */
    addBlockerMesh(mesh) {
        this._options.pickBlockerMeshes = this._options.pickBlockerMeshes || [];
        this._options.pickBlockerMeshes.push(mesh);
    }
    /**
     * Add a new snap-to point to fix teleportation to this position
     * @param newSnapPoint The new Snap-To point
     */
    addSnapPoint(newSnapPoint) {
        this._snapToPositions.push(newSnapPoint);
    }
    attach() {
        if (!super.attach()) {
            return false;
        }
        // Safety reset
        this._currentTeleportationControllerId = "";
        this._options.xrInput.controllers.forEach(this._attachController);
        this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController);
        this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (controller) => {
            // REMOVE the controller
            this._detachController(controller.uniqueId);
        });
        return true;
    }
    detach() {
        if (!super.detach()) {
            return false;
        }
        Object.keys(this._controllers).forEach((controllerId) => {
            this._detachController(controllerId);
        });
        this._setTargetMeshVisibility(false);
        this._currentTeleportationControllerId = "";
        this._controllers = {};
        return true;
    }
    dispose() {
        super.dispose();
        this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.dispose(false, true);
        if (this._worldScaleObserver) {
            this._xrSessionManager.onWorldScaleFactorChangedObservable.remove(this._worldScaleObserver);
        }
        this.onTargetMeshPositionUpdatedObservable.clear();
        this.onTargetMeshPositionUpdatedObservable.clear();
        this.onBeforeCameraTeleportRotation.clear();
        this.onAfterCameraTeleportRotation.clear();
        this.onBeforeCameraTeleport.clear();
        this.onAfterCameraTeleport.clear();
    }
    /**
     * Remove a mesh from the floor meshes array
     * @param mesh the mesh to remove
     */
    removeFloorMesh(mesh) {
        const index = this._floorMeshes.indexOf(mesh);
        if (index !== -1) {
            this._floorMeshes.splice(index, 1);
        }
    }
    /**
     * Remove a mesh from the blocker meshes array
     * @param mesh the mesh to remove
     */
    removeBlockerMesh(mesh) {
        this._options.pickBlockerMeshes = this._options.pickBlockerMeshes || [];
        const index = this._options.pickBlockerMeshes.indexOf(mesh);
        if (index !== -1) {
            this._options.pickBlockerMeshes.splice(index, 1);
        }
    }
    /**
     * Remove a mesh from the floor meshes array using its name
     * @param name the mesh name to remove
     */
    removeFloorMeshByName(name) {
        const mesh = this._xrSessionManager.scene.getMeshByName(name);
        if (mesh) {
            this.removeFloorMesh(mesh);
        }
    }
    /**
     * This function will iterate through the array, searching for this point or equal to it. It will then remove it from the snap-to array
     * @param snapPointToRemove the point (or a clone of it) to be removed from the array
     * @returns was the point found and removed or not
     */
    removeSnapPoint(snapPointToRemove) {
        // check if the object is in the array
        let index = this._snapToPositions.indexOf(snapPointToRemove);
        // if not found as an object, compare to the points
        if (index === -1) {
            for (let i = 0; i < this._snapToPositions.length; ++i) {
                // equals? index is i, break the loop
                if (this._snapToPositions[i].equals(snapPointToRemove)) {
                    index = i;
                    break;
                }
            }
        }
        // index is not -1? remove the object
        if (index !== -1) {
            this._snapToPositions.splice(index, 1);
            return true;
        }
        return false;
    }
    /**
     * This function sets a selection feature that will be disabled when
     * the forward ray is shown and will be reattached when hidden.
     * This is used to remove the selection rays when moving.
     * @param selectionFeature the feature to disable when forward movement is enabled
     */
    setSelectionFeature(selectionFeature) {
        this._selectionFeature = selectionFeature;
    }
    _onXRFrame(_xrFrame) {
        const frame = this._xrSessionManager.currentFrame;
        const scene = this._xrSessionManager.scene;
        if (!this.attach || !frame) {
            return;
        }
        // render target if needed
        const targetMesh = this._options.teleportationTargetMesh;
        if (this._currentTeleportationControllerId) {
            if (!targetMesh) {
                return;
            }
            targetMesh.rotationQuaternion = targetMesh.rotationQuaternion || new math_vector/* Quaternion */.PT();
            const controllerData = this._controllers[this._currentTeleportationControllerId];
            if (controllerData && controllerData.teleportationState.forward) {
                // set the rotation
                math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(controllerData.teleportationState.currentRotation + controllerData.teleportationState.baseRotation, 0, 0, targetMesh.rotationQuaternion);
                // set the ray and position
                let hitPossible = false;
                const controlSelectionFeature = controllerData.xrController.inputSource.targetRayMode !== "transient-pointer";
                controllerData.xrController.getWorldPointerRayToRef(this._tmpRay);
                if (this.straightRayEnabled) {
                    // first check if direct ray possible
                    // pick grounds that are LOWER only. upper will use parabolic path
                    const pick = scene.pickWithRay(this._tmpRay, (o) => {
                        if (this._options.blockerMeshesPredicate && this._options.blockerMeshesPredicate(o)) {
                            return true;
                        }
                        if (this._options.blockAllPickableMeshes && o.isPickable) {
                            return true;
                        }
                        // check for mesh-blockers
                        if (this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(o) !== -1) {
                            return true;
                        }
                        const index = this._floorMeshes.indexOf(o);
                        if (index === -1) {
                            return false;
                        }
                        return this._floorMeshes[index].absolutePosition.y < this._options.xrInput.xrCamera.globalPosition.y;
                    });
                    const floorMeshPicked = pick && pick.pickedMesh && this._floorMeshes.indexOf(pick.pickedMesh) !== -1;
                    if (pick && pick.pickedMesh && !floorMeshPicked) {
                        if (controllerData.teleportationState.mainComponentUsed && !controllerData.teleportationState.initialHit) {
                            controllerData.teleportationState.forward = false;
                            return;
                        }
                        controllerData.teleportationState.blocked = true;
                        this._setTargetMeshVisibility(false, false, controlSelectionFeature);
                        this._showParabolicPath(pick);
                        return;
                    }
                    else if (pick && pick.pickedPoint) {
                        controllerData.teleportationState.initialHit = true;
                        controllerData.teleportationState.blocked = false;
                        hitPossible = true;
                        this._setTargetMeshPosition(pick);
                        this._setTargetMeshVisibility(true, false, controlSelectionFeature);
                        this._showParabolicPath(pick);
                    }
                }
                // straight ray is still the main ray, but disabling the straight line will force parabolic line.
                if (this.parabolicRayEnabled && !hitPossible) {
                    // radius compensation according to pointer rotation around X
                    const xRotation = controllerData.xrController.pointer.rotationQuaternion.toEulerAngles().x;
                    const compensation = 1 + (Math.PI / 2 - Math.abs(xRotation));
                    // check parabolic ray
                    const radius = this.parabolicCheckRadius * compensation;
                    this._tmpRay.origin.addToRef(this._tmpRay.direction.scale(radius * 2), this._tmpVector);
                    this._tmpVector.y = this._tmpRay.origin.y;
                    this._tmpRay.origin.addInPlace(this._tmpRay.direction.scale(radius));
                    this._tmpVector.subtractToRef(this._tmpRay.origin, this._tmpRay.direction);
                    this._tmpRay.direction.normalize();
                    const pick = scene.pickWithRay(this._tmpRay, (o) => {
                        if (this._options.blockerMeshesPredicate && this._options.blockerMeshesPredicate(o)) {
                            return true;
                        }
                        if (this._options.blockAllPickableMeshes && o.isPickable) {
                            return true;
                        }
                        // check for mesh-blockers
                        if (this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(o) !== -1) {
                            return true;
                        }
                        return this._floorMeshes.indexOf(o) !== -1;
                    });
                    const floorMeshPicked = pick && pick.pickedMesh && this._floorMeshes.indexOf(pick.pickedMesh) !== -1;
                    if (pick && pick.pickedMesh && !floorMeshPicked) {
                        if (controllerData.teleportationState.mainComponentUsed && !controllerData.teleportationState.initialHit) {
                            controllerData.teleportationState.forward = false;
                            return;
                        }
                        controllerData.teleportationState.blocked = true;
                        this._setTargetMeshVisibility(false, false, controlSelectionFeature);
                        this._showParabolicPath(pick);
                        return;
                    }
                    else if (pick && pick.pickedPoint) {
                        controllerData.teleportationState.initialHit = true;
                        controllerData.teleportationState.blocked = false;
                        hitPossible = true;
                        this._setTargetMeshPosition(pick);
                        this._setTargetMeshVisibility(true, false, controlSelectionFeature);
                        this._showParabolicPath(pick);
                    }
                }
                // if needed, set visible:
                this._setTargetMeshVisibility(hitPossible, false, controlSelectionFeature);
            }
            else {
                this._setTargetMeshVisibility(false, false, true);
            }
        }
        else {
            this._disposeBezierCurve();
            this._setTargetMeshVisibility(false, false, true);
        }
    }
    _createDefaultTargetMesh() {
        // set defaults
        this._options.defaultTargetMeshOptions = this._options.defaultTargetMeshOptions || {};
        const sceneToRenderTo = this._options.useUtilityLayer
            ? this._options.customUtilityLayerScene || utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer.utilityLayerScene
            : this._xrSessionManager.scene;
        const teleportationTarget = (0,groundBuilder/* CreateGround */.km)("teleportationTarget", { width: 2, height: 2, subdivisions: 2 }, sceneToRenderTo);
        teleportationTarget.isPickable = false;
        if (this._options.defaultTargetMeshOptions.teleportationCircleMaterial) {
            teleportationTarget.material = this._options.defaultTargetMeshOptions.teleportationCircleMaterial;
        }
        else {
            const length = 512;
            const dynamicTexture = new Textures_dynamicTexture/* DynamicTexture */.R("teleportationPlaneDynamicTexture", length, sceneToRenderTo, true);
            dynamicTexture.hasAlpha = true;
            const context = dynamicTexture.getContext();
            const centerX = length / 2;
            const centerY = length / 2;
            const radius = 200;
            context.beginPath();
            context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
            context.fillStyle = this._options.defaultTargetMeshOptions.teleportationFillColor || "#444444";
            context.fill();
            context.lineWidth = 10;
            context.strokeStyle = this._options.defaultTargetMeshOptions.teleportationBorderColor || "#FFFFFF";
            context.stroke();
            context.closePath();
            dynamicTexture.update();
            const teleportationCircleMaterial = new standardMaterial/* StandardMaterial */.F("teleportationPlaneMaterial", sceneToRenderTo);
            teleportationCircleMaterial.diffuseTexture = dynamicTexture;
            teleportationTarget.material = teleportationCircleMaterial;
        }
        const torus = CreateTorus("torusTeleportation", {
            diameter: 0.75,
            thickness: 0.1,
            tessellation: 20,
        }, sceneToRenderTo);
        torus.isPickable = false;
        torus.parent = teleportationTarget;
        if (!this._options.defaultTargetMeshOptions.disableAnimation) {
            const animationInnerCircle = new Animations_animation/* Animation */.X5("animationInnerCircle", "position.y", 30, Animations_animation/* Animation */.X5.ANIMATIONTYPE_FLOAT, Animations_animation/* Animation */.X5.ANIMATIONLOOPMODE_CYCLE);
            const keys = [];
            keys.push({
                frame: 0,
                value: 0,
            });
            keys.push({
                frame: 30,
                value: 0.4,
            });
            keys.push({
                frame: 60,
                value: 0,
            });
            animationInnerCircle.setKeys(keys);
            const easingFunction = new SineEase();
            easingFunction.setEasingMode(EasingFunction.EASINGMODE_EASEINOUT);
            animationInnerCircle.setEasingFunction(easingFunction);
            torus.animations = [];
            torus.animations.push(animationInnerCircle);
            sceneToRenderTo.beginAnimation(torus, 0, 60, true);
        }
        const cone = CreateCylinder("rotationCone", { diameterTop: 0, tessellation: 4 }, sceneToRenderTo);
        cone.isPickable = false;
        cone.scaling.set(0.5, 0.12, 0.2);
        cone.rotate(math_axis/* Axis */._0.X, Math.PI / 2);
        cone.position.z = 0.6;
        cone.parent = torus;
        if (this._options.defaultTargetMeshOptions.torusArrowMaterial) {
            torus.material = this._options.defaultTargetMeshOptions.torusArrowMaterial;
            cone.material = this._options.defaultTargetMeshOptions.torusArrowMaterial;
        }
        else {
            const torusConeMaterial = new standardMaterial/* StandardMaterial */.F("torusConsMat", sceneToRenderTo);
            torusConeMaterial.disableLighting = !!this._options.defaultTargetMeshOptions.disableLighting;
            if (torusConeMaterial.disableLighting) {
                torusConeMaterial.emissiveColor = new math_color/* Color3 */.v9(0.3, 0.3, 1.0);
            }
            else {
                torusConeMaterial.diffuseColor = new math_color/* Color3 */.v9(0.3, 0.3, 1.0);
            }
            torusConeMaterial.alpha = 0.9;
            torus.material = torusConeMaterial;
            cone.material = torusConeMaterial;
            this._teleportationRingMaterial = torusConeMaterial;
        }
        if (this._options.renderingGroupId !== undefined) {
            teleportationTarget.renderingGroupId = this._options.renderingGroupId;
            torus.renderingGroupId = this._options.renderingGroupId;
            cone.renderingGroupId = this._options.renderingGroupId;
        }
        this._options.teleportationTargetMesh = teleportationTarget;
        this._options.teleportationTargetMesh.scaling.setAll(this._xrSessionManager.worldScalingFactor);
        // hide the teleportation target mesh right after creating it.
        this._setTargetMeshVisibility(false);
    }
    _detachController(xrControllerUniqueId) {
        const controllerData = this._controllers[xrControllerUniqueId];
        if (!controllerData) {
            return;
        }
        if (controllerData.teleportationComponent) {
            if (controllerData.onAxisChangedObserver) {
                controllerData.teleportationComponent.onAxisValueChangedObservable.remove(controllerData.onAxisChangedObserver);
            }
            if (controllerData.onButtonChangedObserver) {
                controllerData.teleportationComponent.onButtonStateChangedObservable.remove(controllerData.onButtonChangedObserver);
            }
        }
        // remove from the map
        delete this._controllers[xrControllerUniqueId];
    }
    _findClosestSnapPointWithRadius(realPosition, radius = this._options.snapToPositionRadius || 0.8) {
        let closestPoint = null;
        let closestDistance = Number.MAX_VALUE;
        if (this._snapToPositions.length) {
            const radiusSquared = radius * radius;
            this._snapToPositions.forEach((position) => {
                const dist = math_vector/* Vector3 */.Pq.DistanceSquared(position, realPosition);
                if (dist <= radiusSquared && dist < closestDistance) {
                    closestDistance = dist;
                    closestPoint = position;
                }
            });
        }
        return closestPoint;
    }
    _setTargetMeshPosition(pickInfo) {
        const newPosition = pickInfo.pickedPoint;
        if (!this._options.teleportationTargetMesh || !newPosition) {
            return;
        }
        const snapPosition = this._findClosestSnapPointWithRadius(newPosition);
        this._snappedToPoint = !!snapPosition;
        if (this.snapPointsOnly && !this._snappedToPoint && this._teleportationRingMaterial) {
            this._teleportationRingMaterial.diffuseColor.set(1.0, 0.3, 0.3);
        }
        else if (this.snapPointsOnly && this._snappedToPoint && this._teleportationRingMaterial) {
            this._teleportationRingMaterial.diffuseColor.set(0.3, 0.3, 1.0);
        }
        this._options.teleportationTargetMesh.position.copyFrom(snapPosition || newPosition);
        this._options.teleportationTargetMesh.position.y += 0.01;
        this.onTargetMeshPositionUpdatedObservable.notifyObservers(pickInfo);
    }
    _setTargetMeshVisibility(visible, force, controlSelectionFeature) {
        if (!this._options.teleportationTargetMesh) {
            return;
        }
        if (this._options.teleportationTargetMesh.isVisible === visible && !force) {
            return;
        }
        this._options.teleportationTargetMesh.isVisible = visible;
        this._options.teleportationTargetMesh.getChildren(undefined, false).forEach((m) => {
            m.isVisible = visible;
        });
        if (!visible) {
            if (this._quadraticBezierCurve) {
                this._quadraticBezierCurve.dispose();
                this._quadraticBezierCurve = null;
            }
            if (this._selectionFeature && controlSelectionFeature) {
                this._selectionFeature.attach();
            }
        }
        else {
            if (this._selectionFeature && controlSelectionFeature) {
                this._selectionFeature.detach();
            }
        }
    }
    _disposeBezierCurve() {
        if (this._quadraticBezierCurve) {
            this._quadraticBezierCurve.dispose();
            this._quadraticBezierCurve = null;
        }
    }
    _showParabolicPath(pickInfo) {
        if (!pickInfo.pickedPoint || !this._currentTeleportationControllerId) {
            return;
        }
        const sceneToRenderTo = this._options.useUtilityLayer
            ? this._options.customUtilityLayerScene || utilityLayerRenderer/* UtilityLayerRenderer */.j.DefaultUtilityLayer.utilityLayerScene
            : this._xrSessionManager.scene;
        const controllerData = this._controllers[this._currentTeleportationControllerId];
        const quadraticBezierVectors = math_path/* Curve3 */.jj.CreateQuadraticBezier(controllerData.xrController.pointer.absolutePosition, pickInfo.ray.origin, pickInfo.pickedPoint, 25);
        const color = controllerData.teleportationState.blocked ? this._blockedRayColor : undefined;
        const colorsArray = this._colorArray.fill(color || this._cachedColor4White);
        // take out the first 2 points, to not start directly from the controller
        const points = quadraticBezierVectors.getPoints();
        points.shift();
        points.shift();
        if (!this._options.generateRayPathMesh) {
            this._quadraticBezierCurve = CreateLines("teleportation path line", { points: points, instance: this._quadraticBezierCurve, updatable: true, colors: colorsArray }, sceneToRenderTo);
        }
        else {
            this._quadraticBezierCurve = this._options.generateRayPathMesh(quadraticBezierVectors.getPoints(), pickInfo);
        }
        this._quadraticBezierCurve.isPickable = false;
        if (this._options.renderingGroupId !== undefined) {
            this._quadraticBezierCurve.renderingGroupId = this._options.renderingGroupId;
        }
    }
    _teleportForward(controllerId) {
        const controllerData = this._controllers[controllerId];
        if (!controllerData || !controllerData.teleportationState.forward || !this.teleportationEnabled) {
            return;
        }
        controllerData.teleportationState.forward = false;
        this._currentTeleportationControllerId = "";
        if (this.snapPointsOnly && !this._snappedToPoint) {
            return;
        }
        if (this.skipNextTeleportation) {
            this.skipNextTeleportation = false;
            return;
        }
        // do the movement forward here
        if (this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.isVisible) {
            const height = this._options.xrInput.xrCamera.realWorldHeight;
            this.onBeforeCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position);
            this._options.xrInput.xrCamera.position.copyFrom(this._options.teleportationTargetMesh.position);
            this._options.xrInput.xrCamera.position.y += height;
            math_vector/* Quaternion */.PT.FromEulerAngles(0, controllerData.teleportationState.currentRotation - (this._xrSessionManager.scene.useRightHandedSystem ? Math.PI : 0), 0).multiplyToRef(this._options.xrInput.xrCamera.rotationQuaternion, this._options.xrInput.xrCamera.rotationQuaternion);
            this.onAfterCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position);
        }
    }
}
/**
 * The module's name
 */
WebXRMotionControllerTeleportation.Name = webXRFeaturesManager/* WebXRFeatureName */._.TELEPORTATION;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the webxr specs version
 */
WebXRMotionControllerTeleportation.Version = 1;
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRMotionControllerTeleportation.Name, (xrSessionManager, options) => {
    return () => new WebXRMotionControllerTeleportation(xrSessionManager, options);
}, WebXRMotionControllerTeleportation.Version, true);
//# sourceMappingURL=WebXRControllerTeleportation.js.map
;// ./node_modules/@babylonjs/core/XR/webXRDefaultExperience.js








/**
 * Options for the default xr helper
 */
class WebXRDefaultExperienceOptions {
}
/**
 * Default experience for webxr
 */
class WebXRDefaultExperience {
    constructor() { }
    /**
     * Creates the default xr experience
     * @param scene scene
     * @param options options for basic configuration
     * @returns resulting WebXRDefaultExperience
     */
    static CreateAsync(scene, options = {}) {
        const result = new WebXRDefaultExperience();
        scene.onDisposeObservable.addOnce(() => {
            result.dispose();
        });
        // init the UI right after construction
        if (!options.disableDefaultUI) {
            const uiOptions = {
                renderTarget: result.renderTarget,
                ...(options.uiOptions || {}),
            };
            if (options.optionalFeatures) {
                if (typeof options.optionalFeatures === "boolean") {
                    uiOptions.optionalFeatures = ["hit-test", "anchors", "plane-detection", "hand-tracking"];
                }
                else {
                    uiOptions.optionalFeatures = options.optionalFeatures;
                }
            }
            result.enterExitUI = new WebXREnterExitUI(scene, uiOptions);
        }
        // Create base experience
        return WebXRExperienceHelper.CreateAsync(scene)
            .then((xrHelper) => {
            result.baseExperience = xrHelper;
            if (options.ignoreNativeCameraTransformation) {
                result.baseExperience.camera.compensateOnFirstFrame = false;
            }
            // Add controller support
            result.input = new WebXRInput(xrHelper.sessionManager, xrHelper.camera, {
                controllerOptions: {
                    renderingGroupId: options.renderingGroupId,
                },
                ...(options.inputOptions || {}),
            });
            if (!options.disablePointerSelection) {
                // Add default pointer selection
                const pointerSelectionOptions = {
                    ...options.pointerSelectionOptions,
                    xrInput: result.input,
                    renderingGroupId: options.renderingGroupId,
                };
                result.pointerSelection = (result.baseExperience.featuresManager.enableFeature(WebXRControllerPointerSelection.Name, options.useStablePlugins ? "stable" : "latest", pointerSelectionOptions));
                if (!options.disableTeleportation) {
                    // Add default teleportation, including rotation
                    result.teleportation = result.baseExperience.featuresManager.enableFeature(WebXRMotionControllerTeleportation.Name, options.useStablePlugins ? "stable" : "latest", {
                        floorMeshes: options.floorMeshes,
                        xrInput: result.input,
                        renderingGroupId: options.renderingGroupId,
                        ...options.teleportationOptions,
                    });
                    result.teleportation.setSelectionFeature(result.pointerSelection);
                }
            }
            if (!options.disableNearInteraction) {
                // Add default pointer selection
                result.nearInteraction = result.baseExperience.featuresManager.enableFeature(WebXRNearInteraction.Name, options.useStablePlugins ? "stable" : "latest", {
                    xrInput: result.input,
                    farInteractionFeature: result.pointerSelection,
                    renderingGroupId: options.renderingGroupId,
                    useUtilityLayer: true,
                    enableNearInteractionOnAllControllers: true,
                    ...options.nearInteractionOptions,
                });
            }
            if (!options.disableHandTracking) {
                // Add default hand tracking
                result.baseExperience.featuresManager.enableFeature(WebXRHandTracking.Name, options.useStablePlugins ? "stable" : "latest", {
                    xrInput: result.input,
                    ...options.handSupportOptions,
                }, undefined, false);
            }
            // Create the WebXR output target
            result.renderTarget = result.baseExperience.sessionManager.getWebXRRenderTarget(options.outputCanvasOptions);
            if (!options.disableDefaultUI) {
                // Create ui for entering/exiting xr
                return result.enterExitUI.setHelperAsync(result.baseExperience, result.renderTarget);
            }
            else {
                return;
            }
        })
            .then(() => {
            return result;
        })
            .catch((error) => {
            logger/* Logger */.V.Error("Error initializing XR");
            logger/* Logger */.V.Error(error);
            return result;
        });
    }
    /**
     * Disposes of the experience helper
     */
    dispose() {
        if (this.baseExperience) {
            this.baseExperience.dispose();
        }
        if (this.input) {
            this.input.dispose();
        }
        if (this.enterExitUI) {
            this.enterExitUI.dispose();
        }
        if (this.renderTarget) {
            this.renderTarget.dispose();
        }
    }
}
//# sourceMappingURL=webXRDefaultExperience.js.map
;// ./node_modules/@babylonjs/core/Helpers/sceneHelpers.js
















/** @internal */
// eslint-disable-next-line no-var
var _forceSceneHelpersToBundle = true;
core_scene/* Scene */.Z.prototype.createDefaultLight = function (replace = false) {
    // Dispose existing light in replace mode.
    if (replace) {
        if (this.lights) {
            for (let i = 0; i < this.lights.length; i++) {
                this.lights[i].dispose();
            }
        }
    }
    // Light
    if (this.lights.length === 0) {
        new hemisphericLight/* HemisphericLight */.g("default light", math_vector/* Vector3 */.Pq.Up(), this);
    }
};
core_scene/* Scene */.Z.prototype.createDefaultCamera = function (createArcRotateCamera = false, replace = false, attachCameraControls = false) {
    // Dispose existing camera in replace mode.
    if (replace) {
        if (this.activeCamera) {
            this.activeCamera.dispose();
            this.activeCamera = null;
        }
    }
    // Camera
    if (!this.activeCamera) {
        const worldExtends = this.getWorldExtends((mesh) => mesh.isVisible && mesh.isEnabled());
        const worldSize = worldExtends.max.subtract(worldExtends.min);
        const worldCenter = worldExtends.min.add(worldSize.scale(0.5));
        let camera;
        let radius = worldSize.length() * 1.5;
        // empty scene scenario!
        if (!isFinite(radius)) {
            radius = 1;
            worldCenter.copyFromFloats(0, 0, 0);
        }
        if (createArcRotateCamera) {
            const arcRotateCamera = new ArcRotateCamera("default camera", -(Math.PI / 2), Math.PI / 2, radius, worldCenter, this);
            arcRotateCamera.lowerRadiusLimit = radius * 0.01;
            arcRotateCamera.wheelPrecision = 100 / radius;
            camera = arcRotateCamera;
        }
        else {
            const freeCamera = new Cameras_freeCamera/* FreeCamera */.S("default camera", new math_vector/* Vector3 */.Pq(worldCenter.x, worldCenter.y, -radius), this);
            freeCamera.setTarget(worldCenter);
            camera = freeCamera;
        }
        camera.minZ = radius * 0.01;
        camera.maxZ = radius * 1000;
        camera.speed = radius * 0.2;
        this.activeCamera = camera;
        if (attachCameraControls) {
            camera.attachControl();
        }
    }
};
core_scene/* Scene */.Z.prototype.createDefaultCameraOrLight = function (createArcRotateCamera = false, replace = false, attachCameraControls = false) {
    this.createDefaultLight(replace);
    this.createDefaultCamera(createArcRotateCamera, replace, attachCameraControls);
};
core_scene/* Scene */.Z.prototype.createDefaultSkybox = function (environmentTexture, pbr = false, scale = 1000, blur = 0, setGlobalEnvTexture = true) {
    if (!environmentTexture) {
        logger/* Logger */.V.Warn("Can not create default skybox without environment texture.");
        return null;
    }
    if (setGlobalEnvTexture) {
        if (environmentTexture) {
            this.environmentTexture = environmentTexture;
        }
    }
    // Skybox
    const hdrSkybox = (0,boxBuilder/* CreateBox */.an)("hdrSkyBox", { size: scale }, this);
    if (pbr) {
        const hdrSkyboxMaterial = new pbrMaterial/* PBRMaterial */.Y("skyBox", this);
        hdrSkyboxMaterial.backFaceCulling = false;
        hdrSkyboxMaterial.reflectionTexture = environmentTexture.clone();
        if (hdrSkyboxMaterial.reflectionTexture) {
            hdrSkyboxMaterial.reflectionTexture.coordinatesMode = Textures_texture/* Texture */.g.SKYBOX_MODE;
        }
        hdrSkyboxMaterial.microSurface = 1.0 - blur;
        hdrSkyboxMaterial.disableLighting = true;
        hdrSkyboxMaterial.twoSidedLighting = true;
        hdrSkybox.material = hdrSkyboxMaterial;
    }
    else {
        const skyboxMaterial = new standardMaterial/* StandardMaterial */.F("skyBox", this);
        skyboxMaterial.backFaceCulling = false;
        skyboxMaterial.reflectionTexture = environmentTexture.clone();
        if (skyboxMaterial.reflectionTexture) {
            skyboxMaterial.reflectionTexture.coordinatesMode = Textures_texture/* Texture */.g.SKYBOX_MODE;
        }
        skyboxMaterial.disableLighting = true;
        hdrSkybox.material = skyboxMaterial;
    }
    hdrSkybox.isPickable = false;
    hdrSkybox.infiniteDistance = true;
    hdrSkybox.ignoreCameraMaxZ = true;
    return hdrSkybox;
};
core_scene/* Scene */.Z.prototype.createDefaultEnvironment = function (options) {
    if (EnvironmentHelper) {
        return new EnvironmentHelper(options, this);
    }
    return null;
};
core_scene/* Scene */.Z.prototype.createDefaultVRExperience = function (webVROptions = {}) {
    return new VRExperienceHelper(this, webVROptions);
};
core_scene/* Scene */.Z.prototype.createDefaultXRExperienceAsync = function (options = {}) {
    return WebXRDefaultExperience.CreateAsync(this, options).then((helper) => {
        return helper;
    });
};
//# sourceMappingURL=sceneHelpers.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/videoTexture.js










function removeSource(video) {
    // Remove any <source> elements, etc.
    while (video.firstChild) {
        video.removeChild(video.firstChild);
    }
    // detach srcObject
    video.srcObject = null;
    // Set a blank src (https://html.spec.whatwg.org/multipage/media.html#best-practices-for-authors-using-media-elements)
    video.src = "";
    // Prevent non-important errors maybe (https://twitter.com/beraliv/status/1205214277956775936)
    video.removeAttribute("src");
}
/**
 * If you want to display a video in your scene, this is the special texture for that.
 * This special texture works similar to other textures, with the exception of a few parameters.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/videoTexture
 */
class VideoTexture extends Textures_texture/* Texture */.g {
    /**
     * Event triggered when a dom action is required by the user to play the video.
     * This happens due to recent changes in browser policies preventing video to auto start.
     */
    get onUserActionRequestedObservable() {
        if (!this._onUserActionRequestedObservable) {
            this._onUserActionRequestedObservable = new Misc_observable/* Observable */.cP();
        }
        return this._onUserActionRequestedObservable;
    }
    _processError(reason) {
        this._errorFound = true;
        if (this._onError) {
            this._onError(reason?.message);
        }
        else {
            logger/* Logger */.V.Error(reason?.message);
        }
    }
    _handlePlay() {
        this._errorFound = false;
        this.video.play().catch((reason) => {
            if (reason?.name === "NotAllowedError") {
                if (this._onUserActionRequestedObservable && this._onUserActionRequestedObservable.hasObservers()) {
                    this._onUserActionRequestedObservable.notifyObservers(this);
                    return;
                }
                else if (!this.video.muted) {
                    logger/* Logger */.V.Warn("Unable to autoplay a video with sound. Trying again with muted turned true");
                    this.video.muted = true;
                    this._errorFound = false;
                    this.video.play().catch((otherReason) => {
                        this._processError(otherReason);
                    });
                    return;
                }
            }
            this._processError(reason);
        });
    }
    /**
     * Creates a video texture.
     * If you want to display a video in your scene, this is the special texture for that.
     * This special texture works similar to other textures, with the exception of a few parameters.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/videoTexture
     * @param name optional name, will detect from video source, if not defined
     * @param src can be used to provide an url, array of urls or an already setup HTML video element.
     * @param scene is obviously the current scene.
     * @param generateMipMaps can be used to turn on mipmaps (Can be expensive for videoTextures because they are often updated).
     * @param invertY is false by default but can be used to invert video on Y axis
     * @param samplingMode controls the sampling method and is set to TRILINEAR_SAMPLINGMODE by default
     * @param settings allows finer control over video usage
     * @param onError defines a callback triggered when an error occurred during the loading session
     * @param format defines the texture format to use (Engine.TEXTUREFORMAT_RGBA by default)
     */
    constructor(name, src, scene, generateMipMaps = false, invertY = false, samplingMode = Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) {
        super(null, scene, !generateMipMaps, invertY);
        this._externalTexture = null;
        this._onUserActionRequestedObservable = null;
        this._stillImageCaptured = false;
        this._displayingPosterTexture = false;
        this._frameId = -1;
        this._currentSrc = null;
        this._errorFound = false;
        /**
         * Serialize the flag to define this texture as a video texture
         */
        this.isVideo = true;
        this._resizeInternalTexture = () => {
            // Cleanup the old texture before replacing it
            if (this._texture != null) {
                this._texture.dispose();
            }
            if (!this._getEngine().needPOTTextures || (tools/* Tools */.S0.IsExponentOfTwo(this.video.videoWidth) && tools/* Tools */.S0.IsExponentOfTwo(this.video.videoHeight))) {
                this.wrapU = Textures_texture/* Texture */.g.WRAP_ADDRESSMODE;
                this.wrapV = Textures_texture/* Texture */.g.WRAP_ADDRESSMODE;
            }
            else {
                this.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                this.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                this._generateMipMaps = false;
            }
            this._texture = this._getEngine().createDynamicTexture(this.video.videoWidth, this.video.videoHeight, this._generateMipMaps, this.samplingMode);
            this._texture.format = this._format ?? 5;
            // Reset the frame ID and update the new texture to ensure it pulls in the current video frame
            this._frameId = -1;
            this._updateInternalTexture();
        };
        this._createInternalTexture = () => {
            if (this._texture != null) {
                if (this._displayingPosterTexture) {
                    this._displayingPosterTexture = false;
                }
                else {
                    return;
                }
            }
            this.video.addEventListener("resize", this._resizeInternalTexture);
            this._resizeInternalTexture();
            if (!this.video.autoplay && !this._settings.poster && !this._settings.independentVideoSource) {
                const oldHandler = this.video.onplaying;
                const oldMuted = this.video.muted;
                this.video.muted = true;
                this.video.onplaying = () => {
                    this.video.muted = oldMuted;
                    this.video.onplaying = oldHandler;
                    this._updateInternalTexture();
                    if (!this._errorFound) {
                        this.video.pause();
                    }
                    if (this.onLoadObservable.hasObservers()) {
                        this.onLoadObservable.notifyObservers(this);
                    }
                };
                this._handlePlay();
            }
            else {
                this._updateInternalTexture();
                if (this.onLoadObservable.hasObservers()) {
                    this.onLoadObservable.notifyObservers(this);
                }
            }
        };
        this._reset = () => {
            if (this._texture == null) {
                return;
            }
            if (!this._displayingPosterTexture) {
                this._texture.dispose();
                this._texture = null;
            }
        };
        this._updateInternalTexture = () => {
            if (this._texture == null) {
                return;
            }
            if (this.video.readyState < this.video.HAVE_CURRENT_DATA) {
                return;
            }
            if (this._displayingPosterTexture) {
                return;
            }
            const frameId = this.getScene().getFrameId();
            if (this._frameId === frameId) {
                return;
            }
            this._frameId = frameId;
            this._getEngine().updateVideoTexture(this._texture, this._externalTexture ? this._externalTexture : this.video, this._invertY);
        };
        this._settings = {
            autoPlay: true,
            loop: true,
            autoUpdateTexture: true,
            ...settings,
        };
        this._onError = onError;
        this._generateMipMaps = generateMipMaps;
        this._initialSamplingMode = samplingMode;
        this.autoUpdateTexture = this._settings.autoUpdateTexture;
        this._currentSrc = src;
        this.name = name || this._getName(src);
        this.video = this._getVideo(src);
        const engineWebGPU = this._engine;
        const createExternalTexture = engineWebGPU?.createExternalTexture;
        if (createExternalTexture) {
            this._externalTexture = createExternalTexture.call(engineWebGPU, this.video);
        }
        if (!this._settings.independentVideoSource) {
            if (this._settings.poster) {
                this.video.poster = this._settings.poster;
            }
            if (this._settings.autoPlay !== undefined) {
                this.video.autoplay = this._settings.autoPlay;
            }
            if (this._settings.loop !== undefined) {
                this.video.loop = this._settings.loop;
            }
            if (this._settings.muted !== undefined) {
                this.video.muted = this._settings.muted;
            }
            this.video.setAttribute("playsinline", "");
            this.video.addEventListener("paused", this._updateInternalTexture);
            this.video.addEventListener("seeked", this._updateInternalTexture);
            this.video.addEventListener("loadeddata", this._updateInternalTexture);
            this.video.addEventListener("emptied", this._reset);
            if (this._settings.autoPlay) {
                this._handlePlay();
            }
        }
        this._createInternalTextureOnEvent = this._settings.poster && !this._settings.autoPlay ? "play" : "canplay";
        this.video.addEventListener(this._createInternalTextureOnEvent, this._createInternalTexture);
        this._format = format;
        const videoHasEnoughData = this.video.readyState >= this.video.HAVE_CURRENT_DATA;
        if (this._settings.poster && (!this._settings.autoPlay || !videoHasEnoughData)) {
            this._texture = this._getEngine().createTexture(this._settings.poster, false, !this.invertY, scene);
            this._displayingPosterTexture = true;
        }
        else if (videoHasEnoughData) {
            this._createInternalTexture();
        }
    }
    /**
     * Get the current class name of the video texture useful for serialization or dynamic coding.
     * @returns "VideoTexture"
     */
    getClassName() {
        return "VideoTexture";
    }
    _getName(src) {
        if (src instanceof HTMLVideoElement) {
            return src.currentSrc;
        }
        if (typeof src === "object") {
            return src.toString();
        }
        return src;
    }
    _getVideo(src) {
        if (src.isNative) {
            return src;
        }
        if (src instanceof HTMLVideoElement) {
            tools/* Tools */.S0.SetCorsBehavior(src.currentSrc, src);
            return src;
        }
        const video = document.createElement("video");
        if (typeof src === "string") {
            tools/* Tools */.S0.SetCorsBehavior(src, video);
            video.src = src;
        }
        else {
            tools/* Tools */.S0.SetCorsBehavior(src[0], video);
            src.forEach((url) => {
                const source = document.createElement("source");
                source.src = url;
                video.appendChild(source);
            });
        }
        this.onDisposeObservable.addOnce(() => {
            removeSource(video);
        });
        return video;
    }
    /**
     * @internal Internal method to initiate `update`.
     */
    _rebuild() {
        this.update();
    }
    /**
     * Update Texture in the `auto` mode. Does not do anything if `settings.autoUpdateTexture` is false.
     */
    update() {
        if (!this.autoUpdateTexture) {
            // Expecting user to call `updateTexture` manually
            return;
        }
        this.updateTexture(true);
    }
    /**
     * Update Texture in `manual` mode. Does not do anything if not visible or paused.
     * @param isVisible Visibility state, detected by user using `scene.getActiveMeshes()` or otherwise.
     */
    updateTexture(isVisible) {
        if (!isVisible) {
            return;
        }
        if (this.video.paused && this._stillImageCaptured) {
            return;
        }
        this._stillImageCaptured = true;
        this._updateInternalTexture();
    }
    /**
     * Get the underlying external texture (if supported by the current engine, else null)
     */
    get externalTexture() {
        return this._externalTexture;
    }
    /**
     * Change video content. Changing video instance or setting multiple urls (as in constructor) is not supported.
     * @param url New url.
     */
    updateURL(url) {
        this.video.src = url;
        this._currentSrc = url;
    }
    /**
     * Clones the texture.
     * @returns the cloned texture
     */
    clone() {
        return new VideoTexture(this.name, this._currentSrc, this.getScene(), this._generateMipMaps, this.invertY, this.samplingMode, this._settings);
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() {
        super.dispose();
        this._currentSrc = null;
        if (this._onUserActionRequestedObservable) {
            this._onUserActionRequestedObservable.clear();
            this._onUserActionRequestedObservable = null;
        }
        this.video.removeEventListener(this._createInternalTextureOnEvent, this._createInternalTexture);
        if (!this._settings.independentVideoSource) {
            this.video.removeEventListener("paused", this._updateInternalTexture);
            this.video.removeEventListener("seeked", this._updateInternalTexture);
            this.video.removeEventListener("loadeddata", this._updateInternalTexture);
            this.video.removeEventListener("emptied", this._reset);
            this.video.removeEventListener("resize", this._resizeInternalTexture);
            this.video.pause();
        }
        this._externalTexture?.dispose();
    }
    /**
     * Creates a video texture straight from a stream.
     * @param scene Define the scene the texture should be created in
     * @param stream Define the stream the texture should be created from
     * @param constraints video constraints
     * @param invertY Defines if the video should be stored with invert Y set to true (true by default)
     * @returns The created video texture as a promise
     */
    static CreateFromStreamAsync(scene, stream, constraints, invertY = true) {
        const video = scene.getEngine().createVideoElement(constraints);
        if (scene.getEngine()._badOS) {
            // Yes... I know and I hope to remove it soon...
            document.body.appendChild(video);
            video.style.transform = "scale(0.0001, 0.0001)";
            video.style.opacity = "0";
            video.style.position = "fixed";
            video.style.bottom = "0px";
            video.style.right = "0px";
        }
        video.setAttribute("autoplay", "");
        video.setAttribute("muted", "true");
        video.setAttribute("playsinline", "");
        video.muted = true;
        if (video.isNative) {
            // No additional configuration needed for native
        }
        else {
            if (typeof video.srcObject == "object") {
                video.srcObject = stream;
            }
            else {
                // older API. See https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL#using_object_urls_for_media_streams
                video.src = window.URL && window.URL.createObjectURL(stream);
            }
        }
        return new Promise((resolve) => {
            const onPlaying = () => {
                const videoTexture = new VideoTexture("video", video, scene, true, invertY, undefined, undefined, undefined, 4);
                if (scene.getEngine()._badOS) {
                    videoTexture.onDisposeObservable.addOnce(() => {
                        video.remove();
                    });
                }
                videoTexture.onDisposeObservable.addOnce(() => {
                    removeSource(video);
                });
                resolve(videoTexture);
                video.removeEventListener("playing", onPlaying);
            };
            video.addEventListener("playing", onPlaying);
            video.play();
        });
    }
    /**
     * Creates a video texture straight from your WebCam video feed.
     * @param scene Define the scene the texture should be created in
     * @param constraints Define the constraints to use to create the web cam feed from WebRTC
     * @param audioConstaints Define the audio constraints to use to create the web cam feed from WebRTC
     * @param invertY Defines if the video should be stored with invert Y set to true (true by default)
     * @returns The created video texture as a promise
     */
    static async CreateFromWebCamAsync(scene, constraints, audioConstaints = false, invertY = true) {
        if (navigator.mediaDevices) {
            const stream = await navigator.mediaDevices.getUserMedia({
                video: constraints,
                audio: audioConstaints,
            });
            const videoTexture = await this.CreateFromStreamAsync(scene, stream, constraints, invertY);
            videoTexture.onDisposeObservable.addOnce(() => {
                stream.getTracks().forEach((track) => {
                    track.stop();
                });
            });
            return videoTexture;
        }
        return Promise.reject("No support for userMedia on this device");
    }
    /**
     * Creates a video texture straight from your WebCam video feed.
     * @param scene Defines the scene the texture should be created in
     * @param onReady Defines a callback to triggered once the texture will be ready
     * @param constraints Defines the constraints to use to create the web cam feed from WebRTC
     * @param audioConstaints Defines the audio constraints to use to create the web cam feed from WebRTC
     * @param invertY Defines if the video should be stored with invert Y set to true (true by default)
     */
    static CreateFromWebCam(scene, onReady, constraints, audioConstaints = false, invertY = true) {
        this.CreateFromWebCamAsync(scene, constraints, audioConstaints, invertY)
            .then(function (videoTexture) {
            if (onReady) {
                onReady(videoTexture);
            }
        })
            .catch(function (err) {
            logger/* Logger */.V.Error(err.name);
        });
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("settings")
], VideoTexture.prototype, "_settings", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("src")
], VideoTexture.prototype, "_currentSrc", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], VideoTexture.prototype, "isVideo", void 0);
Textures_texture/* Texture */.g._CreateVideoTexture = (name, src, scene, generateMipMaps = false, invertY = false, samplingMode = Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) => {
    return new VideoTexture(name, src, scene, generateMipMaps, invertY, samplingMode, settings, onError, format);
};
// Some exporters relies on Tools.Instantiate
(0,typeStore/* RegisterClass */.Y5)("BABYLON.VideoTexture", VideoTexture);
//# sourceMappingURL=videoTexture.js.map
;// ./node_modules/@babylonjs/core/Helpers/videoDome.js




/**
 * Display a 360/180 degree video on an approximately spherical surface, useful for VR applications or skyboxes.
 * As a subclass of TransformNode, this allow parenting to the camera or multiple videos with different locations in the scene.
 * This class achieves its effect with a VideoTexture and a correctly configured BackgroundMaterial on an inverted sphere.
 * Potential additions to this helper include zoom and and non-infinite distance rendering effects.
 */
class VideoDome extends TextureDome {
    /**
     * Get the video texture associated with this video dome
     */
    get videoTexture() {
        return this._texture;
    }
    /**
     * Get the video mode of this dome
     */
    get videoMode() {
        return this.textureMode;
    }
    /**
     * Set the video mode of this dome.
     * @see textureMode
     */
    set videoMode(value) {
        this.textureMode = value;
    }
    _initTexture(urlsOrElement, scene, options) {
        const tempOptions = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true, poster: options.poster };
        const texture = new VideoTexture((this.name || "videoDome") + "_texture", urlsOrElement, scene, options.generateMipMaps, this._useDirectMapping, Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, tempOptions);
        // optional configuration
        if (options.clickToPlay) {
            this._pointerObserver = scene.onPointerObservable.add((data) => {
                data.pickInfo?.pickedMesh === this.mesh && this._texture.video.play();
            }, pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN);
        }
        this._textureObserver = texture.onLoadObservable.add(() => {
            this.onLoadObservable.notifyObservers();
        });
        return texture;
    }
    /**
     * Releases resources associated with this node.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        this._texture.onLoadObservable.remove(this._textureObserver);
        this._scene.onPointerObservable.remove(this._pointerObserver);
        super.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
}
/**
 * Define the video source as a Monoscopic panoramic 360 video.
 */
VideoDome.MODE_MONOSCOPIC = TextureDome.MODE_MONOSCOPIC;
/**
 * Define the video source as a Stereoscopic TopBottom/OverUnder panoramic 360 video.
 */
VideoDome.MODE_TOPBOTTOM = TextureDome.MODE_TOPBOTTOM;
/**
 * Define the video source as a Stereoscopic Side by Side panoramic 360 video.
 */
VideoDome.MODE_SIDEBYSIDE = TextureDome.MODE_SIDEBYSIDE;
//# sourceMappingURL=videoDome.js.map
;// ./node_modules/@babylonjs/core/Helpers/index.js




//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Instrumentation/engineInstrumentation.js

/**
 * This class can be used to get instrumentation data from a Babylon engine
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
 */
class EngineInstrumentation {
    // Properties
    /**
     * Gets the perf counter used for GPU frame time
     */
    get gpuFrameTimeCounter() {
        return this.engine.getGPUFrameTimeCounter();
    }
    /**
     * Gets the GPU frame time capture status
     */
    get captureGPUFrameTime() {
        return this._captureGPUFrameTime;
    }
    /**
     * Enable or disable the GPU frame time capture
     */
    set captureGPUFrameTime(value) {
        if (value === this._captureGPUFrameTime) {
            return;
        }
        this._captureGPUFrameTime = value;
        this.engine.captureGPUFrameTime(value);
    }
    /**
     * Gets the perf counter used for shader compilation time
     */
    get shaderCompilationTimeCounter() {
        return this._shaderCompilationTime;
    }
    /**
     * Gets the shader compilation time capture status
     */
    get captureShaderCompilationTime() {
        return this._captureShaderCompilationTime;
    }
    /**
     * Enable or disable the shader compilation time capture
     */
    set captureShaderCompilationTime(value) {
        if (value === this._captureShaderCompilationTime) {
            return;
        }
        this._captureShaderCompilationTime = value;
        if (value) {
            this._onBeforeShaderCompilationObserver = this.engine.onBeforeShaderCompilationObservable.add(() => {
                this._shaderCompilationTime.fetchNewFrame();
                this._shaderCompilationTime.beginMonitoring();
            });
            this._onAfterShaderCompilationObserver = this.engine.onAfterShaderCompilationObservable.add(() => {
                this._shaderCompilationTime.endMonitoring();
            });
        }
        else {
            this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver);
            this._onBeforeShaderCompilationObserver = null;
            this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver);
            this._onAfterShaderCompilationObserver = null;
        }
    }
    /**
     * Instantiates a new engine instrumentation.
     * This class can be used to get instrumentation data from a Babylon engine
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
     * @param engine Defines the engine to instrument
     */
    constructor(
    /**
     * Define the instrumented engine.
     */
    engine) {
        this.engine = engine;
        this._captureGPUFrameTime = false;
        this._captureShaderCompilationTime = false;
        this._shaderCompilationTime = new perfCounter/* PerfCounter */.A();
        // Observers
        this._onBeginFrameObserver = null;
        this._onEndFrameObserver = null;
        this._onBeforeShaderCompilationObserver = null;
        this._onAfterShaderCompilationObserver = null;
    }
    /**
     * Dispose and release associated resources.
     */
    dispose() {
        this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver);
        this._onBeginFrameObserver = null;
        this.engine.onEndFrameObservable.remove(this._onEndFrameObserver);
        this._onEndFrameObserver = null;
        this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver);
        this._onBeforeShaderCompilationObserver = null;
        this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver);
        this._onAfterShaderCompilationObserver = null;
        this.engine = null;
    }
}
//# sourceMappingURL=engineInstrumentation.js.map
;// ./node_modules/@babylonjs/core/Instrumentation/sceneInstrumentation.js


/**
 * This class can be used to get instrumentation data from a Babylon engine
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#sceneinstrumentation
 */
class SceneInstrumentation {
    // Properties
    /**
     * Gets the perf counter used for active meshes evaluation time
     */
    get activeMeshesEvaluationTimeCounter() {
        return this._activeMeshesEvaluationTime;
    }
    /**
     * Gets the active meshes evaluation time capture status
     */
    get captureActiveMeshesEvaluationTime() {
        return this._captureActiveMeshesEvaluationTime;
    }
    /**
     * Enable or disable the active meshes evaluation time capture
     */
    set captureActiveMeshesEvaluationTime(value) {
        if (value === this._captureActiveMeshesEvaluationTime) {
            return;
        }
        this._captureActiveMeshesEvaluationTime = value;
        if (value) {
            this._onBeforeActiveMeshesEvaluationObserver = this.scene.onBeforeActiveMeshesEvaluationObservable.add(() => {
                tools/* Tools */.S0.StartPerformanceCounter("Active meshes evaluation");
                this._activeMeshesEvaluationTime.beginMonitoring();
            });
            this._onAfterActiveMeshesEvaluationObserver = this.scene.onAfterActiveMeshesEvaluationObservable.add(() => {
                tools/* Tools */.S0.EndPerformanceCounter("Active meshes evaluation");
                this._activeMeshesEvaluationTime.endMonitoring(false);
            });
        }
        else {
            this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver);
            this._onBeforeActiveMeshesEvaluationObserver = null;
            this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver);
            this._onAfterActiveMeshesEvaluationObserver = null;
        }
    }
    /**
     * Gets the perf counter used for render targets render time
     */
    get renderTargetsRenderTimeCounter() {
        return this._renderTargetsRenderTime;
    }
    /**
     * Gets the render targets render time capture status
     */
    get captureRenderTargetsRenderTime() {
        return this._captureRenderTargetsRenderTime;
    }
    /**
     * Enable or disable the render targets render time capture
     */
    set captureRenderTargetsRenderTime(value) {
        if (value === this._captureRenderTargetsRenderTime) {
            return;
        }
        this._captureRenderTargetsRenderTime = value;
        if (value) {
            this._onBeforeRenderTargetsRenderObserver = this.scene.onBeforeRenderTargetsRenderObservable.add(() => {
                tools/* Tools */.S0.StartPerformanceCounter("Render targets rendering");
                this._renderTargetsRenderTime.beginMonitoring();
            });
            this._onAfterRenderTargetsRenderObserver = this.scene.onAfterRenderTargetsRenderObservable.add(() => {
                tools/* Tools */.S0.EndPerformanceCounter("Render targets rendering");
                this._renderTargetsRenderTime.endMonitoring(false);
            });
        }
        else {
            this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver);
            this._onBeforeRenderTargetsRenderObserver = null;
            this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver);
            this._onAfterRenderTargetsRenderObserver = null;
        }
    }
    /**
     * Gets the perf counter used for particles render time
     */
    get particlesRenderTimeCounter() {
        return this._particlesRenderTime;
    }
    /**
     * Gets the particles render time capture status
     */
    get captureParticlesRenderTime() {
        return this._captureParticlesRenderTime;
    }
    /**
     * Enable or disable the particles render time capture
     */
    set captureParticlesRenderTime(value) {
        if (value === this._captureParticlesRenderTime) {
            return;
        }
        this._captureParticlesRenderTime = value;
        if (value) {
            this._onBeforeParticlesRenderingObserver = this.scene.onBeforeParticlesRenderingObservable.add(() => {
                tools/* Tools */.S0.StartPerformanceCounter("Particles");
                this._particlesRenderTime.beginMonitoring();
            });
            this._onAfterParticlesRenderingObserver = this.scene.onAfterParticlesRenderingObservable.add(() => {
                tools/* Tools */.S0.EndPerformanceCounter("Particles");
                this._particlesRenderTime.endMonitoring(false);
            });
        }
        else {
            this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver);
            this._onBeforeParticlesRenderingObserver = null;
            this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver);
            this._onAfterParticlesRenderingObserver = null;
        }
    }
    /**
     * Gets the perf counter used for sprites render time
     */
    get spritesRenderTimeCounter() {
        return this._spritesRenderTime;
    }
    /**
     * Gets the sprites render time capture status
     */
    get captureSpritesRenderTime() {
        return this._captureSpritesRenderTime;
    }
    /**
     * Enable or disable the sprites render time capture
     */
    set captureSpritesRenderTime(value) {
        if (value === this._captureSpritesRenderTime) {
            return;
        }
        this._captureSpritesRenderTime = value;
        if (!this.scene.spriteManagers) {
            return;
        }
        if (value) {
            this._onBeforeSpritesRenderingObserver = this.scene.onBeforeSpritesRenderingObservable.add(() => {
                tools/* Tools */.S0.StartPerformanceCounter("Sprites");
                this._spritesRenderTime.beginMonitoring();
            });
            this._onAfterSpritesRenderingObserver = this.scene.onAfterSpritesRenderingObservable.add(() => {
                tools/* Tools */.S0.EndPerformanceCounter("Sprites");
                this._spritesRenderTime.endMonitoring(false);
            });
        }
        else {
            this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver);
            this._onBeforeSpritesRenderingObserver = null;
            this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver);
            this._onAfterSpritesRenderingObserver = null;
        }
    }
    /**
     * Gets the perf counter used for physics time
     */
    get physicsTimeCounter() {
        return this._physicsTime;
    }
    /**
     * Gets the physics time capture status
     */
    get capturePhysicsTime() {
        return this._capturePhysicsTime;
    }
    /**
     * Enable or disable the physics time capture
     */
    set capturePhysicsTime(value) {
        if (value === this._capturePhysicsTime) {
            return;
        }
        if (!this.scene.onBeforePhysicsObservable) {
            return;
        }
        this._capturePhysicsTime = value;
        if (value) {
            this._onBeforePhysicsObserver = this.scene.onBeforePhysicsObservable.add(() => {
                tools/* Tools */.S0.StartPerformanceCounter("Physics");
                this._physicsTime.beginMonitoring();
            });
            this._onAfterPhysicsObserver = this.scene.onAfterPhysicsObservable.add(() => {
                tools/* Tools */.S0.EndPerformanceCounter("Physics");
                this._physicsTime.endMonitoring();
            });
        }
        else {
            this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver);
            this._onBeforePhysicsObserver = null;
            this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver);
            this._onAfterPhysicsObserver = null;
        }
    }
    /**
     * Gets the perf counter used for animations time
     */
    get animationsTimeCounter() {
        return this._animationsTime;
    }
    /**
     * Gets the animations time capture status
     */
    get captureAnimationsTime() {
        return this._captureAnimationsTime;
    }
    /**
     * Enable or disable the animations time capture
     */
    set captureAnimationsTime(value) {
        if (value === this._captureAnimationsTime) {
            return;
        }
        this._captureAnimationsTime = value;
        if (value) {
            this._onAfterAnimationsObserver = this.scene.onAfterAnimationsObservable.add(() => {
                this._animationsTime.endMonitoring();
            });
        }
        else {
            this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver);
            this._onAfterAnimationsObserver = null;
        }
    }
    /**
     * Gets the perf counter used for frame time capture
     */
    get frameTimeCounter() {
        return this._frameTime;
    }
    /**
     * Gets the frame time capture status
     */
    get captureFrameTime() {
        return this._captureFrameTime;
    }
    /**
     * Enable or disable the frame time capture
     */
    set captureFrameTime(value) {
        this._captureFrameTime = value;
    }
    /**
     * Gets the perf counter used for inter-frames time capture
     */
    get interFrameTimeCounter() {
        return this._interFrameTime;
    }
    /**
     * Gets the inter-frames time capture status
     */
    get captureInterFrameTime() {
        return this._captureInterFrameTime;
    }
    /**
     * Enable or disable the inter-frames time capture
     */
    set captureInterFrameTime(value) {
        this._captureInterFrameTime = value;
    }
    /**
     * Gets the perf counter used for render time capture
     */
    get renderTimeCounter() {
        return this._renderTime;
    }
    /**
     * Gets the render time capture status
     */
    get captureRenderTime() {
        return this._captureRenderTime;
    }
    /**
     * Enable or disable the render time capture
     */
    set captureRenderTime(value) {
        if (value === this._captureRenderTime) {
            return;
        }
        this._captureRenderTime = value;
        if (value) {
            this._onBeforeDrawPhaseObserver = this.scene.onBeforeDrawPhaseObservable.add(() => {
                this._renderTime.beginMonitoring();
                tools/* Tools */.S0.StartPerformanceCounter("Main render");
            });
            this._onAfterDrawPhaseObserver = this.scene.onAfterDrawPhaseObservable.add(() => {
                this._renderTime.endMonitoring(false);
                tools/* Tools */.S0.EndPerformanceCounter("Main render");
            });
        }
        else {
            this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver);
            this._onBeforeDrawPhaseObserver = null;
            this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver);
            this._onAfterDrawPhaseObserver = null;
        }
    }
    /**
     * Gets the perf counter used for camera render time capture
     */
    get cameraRenderTimeCounter() {
        return this._cameraRenderTime;
    }
    /**
     * Gets the camera render time capture status
     */
    get captureCameraRenderTime() {
        return this._captureCameraRenderTime;
    }
    /**
     * Enable or disable the camera render time capture
     */
    set captureCameraRenderTime(value) {
        if (value === this._captureCameraRenderTime) {
            return;
        }
        this._captureCameraRenderTime = value;
        if (value) {
            this._onBeforeCameraRenderObserver = this.scene.onBeforeCameraRenderObservable.add((camera) => {
                this._cameraRenderTime.beginMonitoring();
                tools/* Tools */.S0.StartPerformanceCounter(`Rendering camera ${camera.name}`);
            });
            this._onAfterCameraRenderObserver = this.scene.onAfterCameraRenderObservable.add((camera) => {
                this._cameraRenderTime.endMonitoring(false);
                tools/* Tools */.S0.EndPerformanceCounter(`Rendering camera ${camera.name}`);
            });
        }
        else {
            this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver);
            this._onBeforeCameraRenderObserver = null;
            this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver);
            this._onAfterCameraRenderObserver = null;
        }
    }
    /**
     * Gets the perf counter used for draw calls
     */
    get drawCallsCounter() {
        return this.scene.getEngine()._drawCalls;
    }
    /**
     * Instantiates a new scene instrumentation.
     * This class can be used to get instrumentation data from a Babylon engine
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#sceneinstrumentation
     * @param scene Defines the scene to instrument
     */
    constructor(
    /**
     * Defines the scene to instrument
     */
    scene) {
        this.scene = scene;
        this._captureActiveMeshesEvaluationTime = false;
        this._activeMeshesEvaluationTime = new perfCounter/* PerfCounter */.A();
        this._captureRenderTargetsRenderTime = false;
        this._renderTargetsRenderTime = new perfCounter/* PerfCounter */.A();
        this._captureFrameTime = false;
        this._frameTime = new perfCounter/* PerfCounter */.A();
        this._captureRenderTime = false;
        this._renderTime = new perfCounter/* PerfCounter */.A();
        this._captureInterFrameTime = false;
        this._interFrameTime = new perfCounter/* PerfCounter */.A();
        this._captureParticlesRenderTime = false;
        this._particlesRenderTime = new perfCounter/* PerfCounter */.A();
        this._captureSpritesRenderTime = false;
        this._spritesRenderTime = new perfCounter/* PerfCounter */.A();
        this._capturePhysicsTime = false;
        this._physicsTime = new perfCounter/* PerfCounter */.A();
        this._captureAnimationsTime = false;
        this._animationsTime = new perfCounter/* PerfCounter */.A();
        this._captureCameraRenderTime = false;
        this._cameraRenderTime = new perfCounter/* PerfCounter */.A();
        // Observers
        this._onBeforeActiveMeshesEvaluationObserver = null;
        this._onAfterActiveMeshesEvaluationObserver = null;
        this._onBeforeRenderTargetsRenderObserver = null;
        this._onAfterRenderTargetsRenderObserver = null;
        this._onAfterRenderObserver = null;
        this._onBeforeDrawPhaseObserver = null;
        this._onAfterDrawPhaseObserver = null;
        this._onBeforeAnimationsObserver = null;
        this._onBeforeParticlesRenderingObserver = null;
        this._onAfterParticlesRenderingObserver = null;
        this._onBeforeSpritesRenderingObserver = null;
        this._onAfterSpritesRenderingObserver = null;
        this._onBeforePhysicsObserver = null;
        this._onAfterPhysicsObserver = null;
        this._onAfterAnimationsObserver = null;
        this._onBeforeCameraRenderObserver = null;
        this._onAfterCameraRenderObserver = null;
        // Before render
        this._onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {
            if (this._captureActiveMeshesEvaluationTime) {
                this._activeMeshesEvaluationTime.fetchNewFrame();
            }
            if (this._captureRenderTargetsRenderTime) {
                this._renderTargetsRenderTime.fetchNewFrame();
            }
            if (this._captureFrameTime) {
                tools/* Tools */.S0.StartPerformanceCounter("Scene rendering");
                this._frameTime.beginMonitoring();
            }
            if (this._captureInterFrameTime) {
                this._interFrameTime.endMonitoring();
            }
            if (this._captureParticlesRenderTime) {
                this._particlesRenderTime.fetchNewFrame();
            }
            if (this._captureSpritesRenderTime) {
                this._spritesRenderTime.fetchNewFrame();
            }
            if (this._captureAnimationsTime) {
                this._animationsTime.beginMonitoring();
            }
            if (this._captureRenderTime) {
                this._renderTime.fetchNewFrame();
            }
            if (this._captureCameraRenderTime) {
                this._cameraRenderTime.fetchNewFrame();
            }
            this.scene.getEngine()._drawCalls.fetchNewFrame();
        });
        // After render
        this._onAfterRenderObserver = scene.onAfterRenderObservable.add(() => {
            if (this._captureFrameTime) {
                tools/* Tools */.S0.EndPerformanceCounter("Scene rendering");
                this._frameTime.endMonitoring();
            }
            if (this._captureRenderTime) {
                this._renderTime.endMonitoring(false);
            }
            if (this._captureInterFrameTime) {
                this._interFrameTime.beginMonitoring();
            }
            if (this._captureActiveMeshesEvaluationTime) {
                this._activeMeshesEvaluationTime.endFrame();
            }
            if (this._captureRenderTargetsRenderTime) {
                this._renderTargetsRenderTime.endFrame();
            }
            if (this._captureParticlesRenderTime) {
                this._particlesRenderTime.endFrame();
            }
            if (this._captureSpritesRenderTime) {
                this._spritesRenderTime.endFrame();
            }
            if (this._captureRenderTime) {
                this._renderTime.endFrame();
            }
            if (this._captureCameraRenderTime) {
                this._cameraRenderTime.endFrame();
            }
        });
    }
    /**
     * Dispose and release associated resources.
     */
    dispose() {
        this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver);
        this._onAfterRenderObserver = null;
        this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver);
        this._onBeforeActiveMeshesEvaluationObserver = null;
        this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver);
        this._onAfterActiveMeshesEvaluationObserver = null;
        this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver);
        this._onBeforeRenderTargetsRenderObserver = null;
        this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver);
        this._onAfterRenderTargetsRenderObserver = null;
        this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver);
        this._onBeforeAnimationsObserver = null;
        this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver);
        this._onBeforeParticlesRenderingObserver = null;
        this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver);
        this._onAfterParticlesRenderingObserver = null;
        if (this._onBeforeSpritesRenderingObserver) {
            this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver);
            this._onBeforeSpritesRenderingObserver = null;
        }
        if (this._onAfterSpritesRenderingObserver) {
            this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver);
            this._onAfterSpritesRenderingObserver = null;
        }
        this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver);
        this._onBeforeDrawPhaseObserver = null;
        this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver);
        this._onAfterDrawPhaseObserver = null;
        if (this._onBeforePhysicsObserver) {
            this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver);
            this._onBeforePhysicsObserver = null;
        }
        if (this._onAfterPhysicsObserver) {
            this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver);
            this._onAfterPhysicsObserver = null;
        }
        this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver);
        this._onAfterAnimationsObserver = null;
        this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver);
        this._onBeforeCameraRenderObserver = null;
        this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver);
        this._onAfterCameraRenderObserver = null;
        this.scene = null;
    }
}
//# sourceMappingURL=sceneInstrumentation.js.map
;// ./node_modules/@babylonjs/core/Instrumentation/index.js



//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/devTools.js
var devTools = __webpack_require__(45503);
;// ./node_modules/@babylonjs/core/Layers/effectLayer.js

















/**
 * The effect layer Helps adding post process effect blended with the main pass.
 *
 * This can be for instance use to generate glow or highlight effects on the scene.
 *
 * The effect layer class can not be used directly and is intented to inherited from to be
 * customized per effects.
 */
class EffectLayer {
    /**
     * Gets the camera attached to the layer.
     */
    get camera() {
        return this._effectLayerOptions.camera;
    }
    /**
     * Gets the rendering group id the layer should render in.
     */
    get renderingGroupId() {
        return this._effectLayerOptions.renderingGroupId;
    }
    set renderingGroupId(renderingGroupId) {
        this._effectLayerOptions.renderingGroupId = renderingGroupId;
    }
    /**
     * Gets the main texture where the effect is rendered
     */
    get mainTexture() {
        return this._mainTexture;
    }
    /**
     * Gets the shader language used in this material.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Sets a specific material to be used to render a mesh/a list of meshes in the layer
     * @param mesh mesh or array of meshes
     * @param material material to use by the layer when rendering the mesh(es). If undefined is passed, the specific material created by the layer will be used.
     */
    setMaterialForRendering(mesh, material) {
        this._mainTexture.setMaterialForRendering(mesh, material);
        if (Array.isArray(mesh)) {
            for (let i = 0; i < mesh.length; ++i) {
                const currentMesh = mesh[i];
                if (!material) {
                    delete this._materialForRendering[currentMesh.uniqueId];
                }
                else {
                    this._materialForRendering[currentMesh.uniqueId] = [currentMesh, material];
                }
            }
        }
        else {
            if (!material) {
                delete this._materialForRendering[mesh.uniqueId];
            }
            else {
                this._materialForRendering[mesh.uniqueId] = [mesh, material];
            }
        }
    }
    /**
     * Gets the intensity of the effect for a specific mesh.
     * @param mesh The mesh to get the effect intensity for
     * @returns The intensity of the effect for the mesh
     */
    getEffectIntensity(mesh) {
        return this._effectIntensity[mesh.uniqueId] ?? 1;
    }
    /**
     * Sets the intensity of the effect for a specific mesh.
     * @param mesh The mesh to set the effect intensity for
     * @param intensity The intensity of the effect for the mesh
     */
    setEffectIntensity(mesh, intensity) {
        this._effectIntensity[mesh.uniqueId] = intensity;
    }
    /**
     * Instantiates a new effect Layer and references it in the scene.
     * @param name The name of the layer
     * @param scene The scene to use the layer in
     * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
     */
    constructor(
    /** The Friendly of the effect in the scene */
    name, scene, forceGLSL = false) {
        this._vertexBuffers = {};
        this._maxSize = 0;
        this._mainTextureDesiredSize = { width: 0, height: 0 };
        this._shouldRender = true;
        this._postProcesses = [];
        this._textures = [];
        this._emissiveTextureAndColor = { texture: null, color: new math_color/* Color4 */.ov() };
        this._effectIntensity = {};
        /**
         * The clear color of the texture used to generate the glow map.
         */
        this.neutralColor = new math_color/* Color4 */.ov();
        /**
         * Specifies whether the highlight layer is enabled or not.
         */
        this.isEnabled = true;
        /**
         * Specifies if the bounding boxes should be rendered normally or if they should undergo the effect of the layer
         */
        this.disableBoundingBoxesFromEffectLayer = false;
        /**
         * An event triggered when the effect layer has been disposed.
         */
        this.onDisposeObservable = new Misc_observable/* Observable */.cP();
        /**
         * An event triggered when the effect layer is about rendering the main texture with the glowy parts.
         */
        this.onBeforeRenderMainTextureObservable = new Misc_observable/* Observable */.cP();
        /**
         * An event triggered when the generated texture is being merged in the scene.
         */
        this.onBeforeComposeObservable = new Misc_observable/* Observable */.cP();
        /**
         * An event triggered when the mesh is rendered into the effect render target.
         */
        this.onBeforeRenderMeshToEffect = new Misc_observable/* Observable */.cP();
        /**
         * An event triggered after the mesh has been rendered into the effect render target.
         */
        this.onAfterRenderMeshToEffect = new Misc_observable/* Observable */.cP();
        /**
         * An event triggered when the generated texture has been merged in the scene.
         */
        this.onAfterComposeObservable = new Misc_observable/* Observable */.cP();
        /**
         * An event triggered when the effect layer changes its size.
         */
        this.onSizeChangedObservable = new Misc_observable/* Observable */.cP();
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._materialForRendering = {};
        this._shadersLoaded = false;
        this.name = name;
        this._scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        EffectLayer._SceneComponentInitialization(this._scene);
        const engine = this._scene.getEngine();
        if (engine.isWebGPU && !forceGLSL && !EffectLayer.ForceGLSL) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
        this._engine = this._scene.getEngine();
        this._maxSize = this._engine.getCaps().maxTextureSize;
        this._scene.effectLayers.push(this);
        this._mergeDrawWrapper = [];
        // Generate Buffers
        this._generateIndexBuffer();
        this._generateVertexBuffer();
    }
    /**
     * Number of times _internalRender will be called. Some effect layers need to render the mesh several times, so they should override this method with the number of times the mesh should be rendered
     * @returns Number of times a mesh must be rendered in the layer
     */
    _numInternalDraws() {
        return 1;
    }
    /**
     * Initializes the effect layer with the required options.
     * @param options Sets of none mandatory options to use with the layer (see IEffectLayerOptions for more information)
     */
    _init(options) {
        // Adapt options
        this._effectLayerOptions = {
            mainTextureRatio: 0.5,
            alphaBlendingMode: 2,
            camera: null,
            renderingGroupId: -1,
            mainTextureType: 0,
            generateStencilBuffer: false,
            ...options,
        };
        this._setMainTextureSize();
        this._createMainTexture();
        this._createTextureAndPostProcesses();
    }
    /**
     * Generates the index buffer of the full screen quad blending to the main canvas.
     */
    _generateIndexBuffer() {
        // Indices
        const indices = [];
        indices.push(0);
        indices.push(1);
        indices.push(2);
        indices.push(0);
        indices.push(2);
        indices.push(3);
        this._indexBuffer = this._engine.createIndexBuffer(indices);
    }
    /**
     * Generates the vertex buffer of the full screen quad blending to the main canvas.
     */
    _generateVertexBuffer() {
        // VBO
        const vertices = [];
        vertices.push(1, 1);
        vertices.push(-1, 1);
        vertices.push(-1, -1);
        vertices.push(1, -1);
        const vertexBuffer = new Buffers_buffer/* VertexBuffer */.R(this._engine, vertices, Buffers_buffer/* VertexBuffer */.R.PositionKind, false, false, 2);
        this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = vertexBuffer;
    }
    /**
     * Sets the main texture desired size which is the closest power of two
     * of the engine canvas size.
     */
    _setMainTextureSize() {
        if (this._effectLayerOptions.mainTextureFixedSize) {
            this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize;
            this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize;
        }
        else {
            this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio;
            this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio;
            this._mainTextureDesiredSize.width = this._engine.needPOTTextures
                ? (0,tools_functions/* GetExponentOfTwo */.R)(this._mainTextureDesiredSize.width, this._maxSize)
                : this._mainTextureDesiredSize.width;
            this._mainTextureDesiredSize.height = this._engine.needPOTTextures
                ? (0,tools_functions/* GetExponentOfTwo */.R)(this._mainTextureDesiredSize.height, this._maxSize)
                : this._mainTextureDesiredSize.height;
        }
        this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width);
        this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height);
    }
    /**
     * Creates the main texture for the effect layer.
     */
    _createMainTexture() {
        this._mainTexture = new Textures_renderTargetTexture/* RenderTargetTexture */.$("EffectLayerMainRTT", {
            width: this._mainTextureDesiredSize.width,
            height: this._mainTextureDesiredSize.height,
        }, this._scene, false, true, this._effectLayerOptions.mainTextureType, false, Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, true, this._effectLayerOptions.generateStencilBuffer);
        this._mainTexture.activeCamera = this._effectLayerOptions.camera;
        this._mainTexture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._mainTexture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._mainTexture.anisotropicFilteringLevel = 1;
        this._mainTexture.updateSamplingMode(Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE);
        this._mainTexture.renderParticles = false;
        this._mainTexture.renderList = null;
        this._mainTexture.ignoreCameraViewport = true;
        for (const id in this._materialForRendering) {
            const [mesh, material] = this._materialForRendering[id];
            this._mainTexture.setMaterialForRendering(mesh, material);
        }
        this._mainTexture.customIsReadyFunction = (mesh, refreshRate, preWarm) => {
            if ((preWarm || refreshRate === 0) && mesh.subMeshes) {
                for (let i = 0; i < mesh.subMeshes.length; ++i) {
                    const subMesh = mesh.subMeshes[i];
                    const material = subMesh.getMaterial();
                    const renderingMesh = subMesh.getRenderingMesh();
                    if (!material) {
                        continue;
                    }
                    const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());
                    const hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || renderingMesh.hasThinInstances;
                    this._setEmissiveTextureAndColor(renderingMesh, subMesh, material);
                    if (!this._isReady(subMesh, hardwareInstancedRendering, this._emissiveTextureAndColor.texture)) {
                        return false;
                    }
                }
            }
            return true;
        };
        // Custom render function
        this._mainTexture.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => {
            this.onBeforeRenderMainTextureObservable.notifyObservers(this);
            let index;
            const engine = this._scene.getEngine();
            if (depthOnlySubMeshes.length) {
                engine.setColorWrite(false);
                for (index = 0; index < depthOnlySubMeshes.length; index++) {
                    this._renderSubMesh(depthOnlySubMeshes.data[index]);
                }
                engine.setColorWrite(true);
            }
            for (index = 0; index < opaqueSubMeshes.length; index++) {
                this._renderSubMesh(opaqueSubMeshes.data[index]);
            }
            for (index = 0; index < alphaTestSubMeshes.length; index++) {
                this._renderSubMesh(alphaTestSubMeshes.data[index]);
            }
            const previousAlphaMode = engine.getAlphaMode();
            for (index = 0; index < transparentSubMeshes.length; index++) {
                const subMesh = transparentSubMeshes.data[index];
                const material = subMesh.getMaterial();
                if (material && material.needDepthPrePass) {
                    const engine = material.getScene().getEngine();
                    engine.setColorWrite(false);
                    this._renderSubMesh(subMesh);
                    engine.setColorWrite(true);
                }
                this._renderSubMesh(subMesh, true);
            }
            engine.setAlphaMode(previousAlphaMode);
        };
        this._mainTexture.onClearObservable.add((engine) => {
            engine.clear(this.neutralColor, true, true, true);
        });
        // Prevent package size in es6 (getBoundingBoxRenderer might not be present)
        if (this._scene.getBoundingBoxRenderer) {
            const boundingBoxRendererEnabled = this._scene.getBoundingBoxRenderer().enabled;
            this._mainTexture.onBeforeBindObservable.add(() => {
                this._scene.getBoundingBoxRenderer().enabled = !this.disableBoundingBoxesFromEffectLayer && boundingBoxRendererEnabled;
            });
            this._mainTexture.onAfterUnbindObservable.add(() => {
                this._scene.getBoundingBoxRenderer().enabled = boundingBoxRendererEnabled;
            });
        }
    }
    /**
     * Adds specific effects defines.
     * @param defines The defines to add specifics to.
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _addCustomEffectDefines(defines) {
        // Nothing to add by default.
    }
    /**
     * Checks for the readiness of the element composing the layer.
     * @param subMesh the mesh to check for
     * @param useInstances specify whether or not to use instances to render the mesh
     * @param emissiveTexture the associated emissive texture used to generate the glow
     * @returns true if ready otherwise, false
     */
    _isReady(subMesh, useInstances, emissiveTexture) {
        const engine = this._scene.getEngine();
        const mesh = subMesh.getMesh();
        const renderingMaterial = mesh._internalAbstractMeshDataInfo._materialForRenderPass?.[engine.currentRenderPassId];
        if (renderingMaterial) {
            return renderingMaterial.isReadyForSubMesh(mesh, subMesh, useInstances);
        }
        const material = subMesh.getMaterial();
        if (!material) {
            return false;
        }
        if (this._useMeshMaterial(subMesh.getRenderingMesh())) {
            return material.isReadyForSubMesh(subMesh.getMesh(), subMesh, useInstances);
        }
        const defines = [];
        const attribs = [Buffers_buffer/* VertexBuffer */.R.PositionKind];
        let uv1 = false;
        let uv2 = false;
        // Diffuse
        if (material) {
            const needAlphaTest = material.needAlphaTesting();
            const diffuseTexture = material.getAlphaTestTexture();
            const needAlphaBlendFromDiffuse = diffuseTexture && diffuseTexture.hasAlpha && (material.useAlphaFromDiffuseTexture || material._useAlphaFromAlbedoTexture);
            if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) {
                defines.push("#define DIFFUSE");
                if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UV2Kind) && diffuseTexture.coordinatesIndex === 1) {
                    defines.push("#define DIFFUSEUV2");
                    uv2 = true;
                }
                else if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UVKind)) {
                    defines.push("#define DIFFUSEUV1");
                    uv1 = true;
                }
                if (needAlphaTest) {
                    defines.push("#define ALPHATEST");
                    defines.push("#define ALPHATESTVALUE 0.4");
                }
                if (!diffuseTexture.gammaSpace) {
                    defines.push("#define DIFFUSE_ISLINEAR");
                }
            }
            const opacityTexture = material.opacityTexture;
            if (opacityTexture) {
                defines.push("#define OPACITY");
                if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UV2Kind) && opacityTexture.coordinatesIndex === 1) {
                    defines.push("#define OPACITYUV2");
                    uv2 = true;
                }
                else if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UVKind)) {
                    defines.push("#define OPACITYUV1");
                    uv1 = true;
                }
            }
        }
        // Emissive
        if (emissiveTexture) {
            defines.push("#define EMISSIVE");
            if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UV2Kind) && emissiveTexture.coordinatesIndex === 1) {
                defines.push("#define EMISSIVEUV2");
                uv2 = true;
            }
            else if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UVKind)) {
                defines.push("#define EMISSIVEUV1");
                uv1 = true;
            }
            if (!emissiveTexture.gammaSpace) {
                defines.push("#define EMISSIVE_ISLINEAR");
            }
        }
        // Vertex
        if (mesh.useVertexColors && mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.ColorKind) && mesh.hasVertexAlpha && material.transparencyMode !== Materials_material/* Material */.i.MATERIAL_OPAQUE) {
            attribs.push(Buffers_buffer/* VertexBuffer */.R.ColorKind);
            defines.push("#define VERTEXALPHA");
        }
        if (uv1) {
            attribs.push(Buffers_buffer/* VertexBuffer */.R.UVKind);
            defines.push("#define UV1");
        }
        if (uv2) {
            attribs.push(Buffers_buffer/* VertexBuffer */.R.UV2Kind);
            defines.push("#define UV2");
        }
        // Bones
        const fallbacks = new effectFallbacks/* EffectFallbacks */.J();
        if (mesh.useBones && mesh.computeBonesUsingShaders) {
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind);
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind);
            if (mesh.numBoneInfluencers > 4) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind);
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind);
            }
            defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
            const skeleton = mesh.skeleton;
            if (skeleton && skeleton.isUsingTextureForMatrices) {
                defines.push("#define BONETEXTURE");
            }
            else {
                defines.push("#define BonesPerMesh " + (skeleton ? skeleton.bones.length + 1 : 0));
            }
            if (mesh.numBoneInfluencers > 0) {
                fallbacks.addCPUSkinningFallback(0, mesh);
            }
        }
        else {
            defines.push("#define NUM_BONE_INFLUENCERS 0");
        }
        // Morph targets
        const manager = mesh.morphTargetManager;
        let morphInfluencers = 0;
        if (manager) {
            morphInfluencers = manager.numMaxInfluencers || manager.numInfluencers;
            if (morphInfluencers > 0) {
                defines.push("#define MORPHTARGETS");
                defines.push("#define NUM_MORPH_INFLUENCERS " + morphInfluencers);
                if (manager.isUsingTextureForTargets) {
                    defines.push("#define MORPHTARGETS_TEXTURE");
                }
                (0,materialHelper_functions/* PrepareAttributesForMorphTargetsInfluencers */.MF)(attribs, mesh, morphInfluencers);
            }
        }
        // Instances
        if (useInstances) {
            defines.push("#define INSTANCES");
            (0,materialHelper_functions/* PushAttributesForInstances */.te)(attribs);
            if (subMesh.getRenderingMesh().hasThinInstances) {
                defines.push("#define THIN_INSTANCES");
            }
        }
        // ClipPlanes
        (0,clipPlaneMaterialHelper/* prepareStringDefinesForClipPlanes */.tv)(material, this._scene, defines);
        this._addCustomEffectDefines(defines);
        // Get correct effect
        const drawWrapper = subMesh._getDrawWrapper(undefined, true);
        const cachedDefines = drawWrapper.defines;
        const join = defines.join("\n");
        if (cachedDefines !== join) {
            const uniforms = [
                "world",
                "mBones",
                "viewProjection",
                "glowColor",
                "morphTargetInfluences",
                "morphTargetCount",
                "boneTextureWidth",
                "diffuseMatrix",
                "emissiveMatrix",
                "opacityMatrix",
                "opacityIntensity",
                "morphTargetTextureInfo",
                "morphTargetTextureIndices",
                "glowIntensity",
            ];
            (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.TV)(uniforms);
            drawWrapper.setEffect(this._engine.createEffect("glowMapGeneration", attribs, uniforms, ["diffuseSampler", "emissiveSampler", "opacitySampler", "boneSampler", "morphTargets"], join, fallbacks, undefined, undefined, { maxSimultaneousMorphTargets: morphInfluencers }, this._shaderLanguage, this._shadersLoaded
                ? undefined
                : async () => {
                    await this._importShadersAsync();
                    this._shadersLoaded = true;
                }), join);
        }
        const effectIsReady = drawWrapper.effect.isReady();
        return this._arePostProcessAndMergeReady() && effectIsReady;
    }
    async _importShadersAsync() {
        if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 48267)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 19073))]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 50136)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 83234))]);
        }
    }
    _arePostProcessAndMergeReady() {
        let isReady = true;
        for (let i = 0; i < this._postProcesses.length; i++) {
            isReady = this._postProcesses[i].isReady() && isReady;
        }
        const numDraws = this._numInternalDraws();
        for (let i = 0; i < numDraws; ++i) {
            let currentEffect = this._mergeDrawWrapper[i];
            if (!currentEffect) {
                currentEffect = this._mergeDrawWrapper[i] = new Materials_drawWrapper/* DrawWrapper */.E(this._engine);
                currentEffect.setEffect(this._createMergeEffect());
            }
            isReady = currentEffect.effect.isReady() && isReady;
        }
        return isReady;
    }
    /**
     * Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.
     */
    render() {
        if (!this._arePostProcessAndMergeReady()) {
            return;
        }
        const engine = this._scene.getEngine();
        const numDraws = this._numInternalDraws();
        this.onBeforeComposeObservable.notifyObservers(this);
        const previousAlphaMode = engine.getAlphaMode();
        for (let i = 0; i < numDraws; ++i) {
            const currentEffect = this._mergeDrawWrapper[i];
            // Render
            engine.enableEffect(currentEffect);
            engine.setState(false);
            // VBOs
            engine.bindBuffers(this._vertexBuffers, this._indexBuffer, currentEffect.effect);
            // Go Blend.
            engine.setAlphaMode(this._effectLayerOptions.alphaBlendingMode);
            // Blends the map on the main canvas.
            this._internalRender(currentEffect.effect, i);
        }
        // Restore Alpha
        engine.setAlphaMode(previousAlphaMode);
        this.onAfterComposeObservable.notifyObservers(this);
        // Handle size changes.
        const size = this._mainTexture.getSize();
        this._setMainTextureSize();
        if ((size.width !== this._mainTextureDesiredSize.width || size.height !== this._mainTextureDesiredSize.height) &&
            this._mainTextureDesiredSize.width !== 0 &&
            this._mainTextureDesiredSize.height !== 0) {
            // Recreate RTT and post processes on size change.
            this.onSizeChangedObservable.notifyObservers(this);
            this._disposeTextureAndPostProcesses();
            this._createMainTexture();
            this._createTextureAndPostProcesses();
        }
    }
    /**
     * Determine if a given mesh will be used in the current effect.
     * @param mesh mesh to test
     * @returns true if the mesh will be used
     */
    hasMesh(mesh) {
        if (this.renderingGroupId === -1 || mesh.renderingGroupId === this.renderingGroupId) {
            return true;
        }
        return false;
    }
    /**
     * Returns true if the layer contains information to display, otherwise false.
     * @returns true if the glow layer should be rendered
     */
    shouldRender() {
        return this.isEnabled && this._shouldRender;
    }
    /**
     * Returns true if the mesh should render, otherwise false.
     * @param mesh The mesh to render
     * @returns true if it should render otherwise false
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _shouldRenderMesh(mesh) {
        return true;
    }
    /**
     * Returns true if the mesh can be rendered, otherwise false.
     * @param mesh The mesh to render
     * @param material The material used on the mesh
     * @returns true if it can be rendered otherwise false
     */
    _canRenderMesh(mesh, material) {
        return !material.needAlphaBlendingForMesh(mesh);
    }
    /**
     * Returns true if the mesh should render, otherwise false.
     * @returns true if it should render otherwise false
     */
    _shouldRenderEmissiveTextureForMesh() {
        return true;
    }
    /**
     * Renders the submesh passed in parameter to the generation map.
     * @param subMesh
     * @param enableAlphaMode
     */
    _renderSubMesh(subMesh, enableAlphaMode = false) {
        if (!this.shouldRender()) {
            return;
        }
        const material = subMesh.getMaterial();
        const ownerMesh = subMesh.getMesh();
        const replacementMesh = subMesh.getReplacementMesh();
        const renderingMesh = subMesh.getRenderingMesh();
        const effectiveMesh = subMesh.getEffectiveMesh();
        const scene = this._scene;
        const engine = scene.getEngine();
        effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = false;
        if (!material) {
            return;
        }
        // Do not block in blend mode.
        if (!this._canRenderMesh(renderingMesh, material)) {
            return;
        }
        // Culling
        let sideOrientation = material._getEffectiveOrientation(renderingMesh);
        const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();
        if (mainDeterminant < 0) {
            sideOrientation = sideOrientation === Materials_material/* Material */.i.ClockWiseSideOrientation ? Materials_material/* Material */.i.CounterClockWiseSideOrientation : Materials_material/* Material */.i.ClockWiseSideOrientation;
        }
        const reverse = sideOrientation === Materials_material/* Material */.i.ClockWiseSideOrientation;
        engine.setState(material.backFaceCulling, material.zOffset, undefined, reverse, material.cullBackFaces, undefined, material.zOffsetUnits);
        // Managing instances
        const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!replacementMesh);
        if (batch.mustReturn) {
            return;
        }
        // Early Exit per mesh
        if (!this._shouldRenderMesh(renderingMesh)) {
            return;
        }
        const hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || renderingMesh.hasThinInstances;
        this._setEmissiveTextureAndColor(renderingMesh, subMesh, material);
        this.onBeforeRenderMeshToEffect.notifyObservers(ownerMesh);
        if (this._useMeshMaterial(renderingMesh)) {
            renderingMesh.render(subMesh, enableAlphaMode, replacementMesh || undefined);
        }
        else if (this._isReady(subMesh, hardwareInstancedRendering, this._emissiveTextureAndColor.texture)) {
            const renderingMaterial = effectiveMesh._internalAbstractMeshDataInfo._materialForRenderPass?.[engine.currentRenderPassId];
            let drawWrapper = subMesh._getDrawWrapper();
            if (!drawWrapper && renderingMaterial) {
                drawWrapper = renderingMaterial._getDrawWrapper();
            }
            if (!drawWrapper) {
                return;
            }
            const effect = drawWrapper.effect;
            engine.enableEffect(drawWrapper);
            if (!hardwareInstancedRendering) {
                renderingMesh._bind(subMesh, effect, material.fillMode);
            }
            if (!renderingMaterial) {
                effect.setMatrix("viewProjection", scene.getTransformMatrix());
                effect.setMatrix("world", effectiveMesh.getWorldMatrix());
                effect.setFloat4("glowColor", this._emissiveTextureAndColor.color.r, this._emissiveTextureAndColor.color.g, this._emissiveTextureAndColor.color.b, this._emissiveTextureAndColor.color.a);
            }
            else {
                renderingMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), effectiveMesh, subMesh);
            }
            if (!renderingMaterial) {
                const needAlphaTest = material.needAlphaTesting();
                const diffuseTexture = material.getAlphaTestTexture();
                const needAlphaBlendFromDiffuse = diffuseTexture && diffuseTexture.hasAlpha && (material.useAlphaFromDiffuseTexture || material._useAlphaFromAlbedoTexture);
                if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) {
                    effect.setTexture("diffuseSampler", diffuseTexture);
                    const textureMatrix = diffuseTexture.getTextureMatrix();
                    if (textureMatrix) {
                        effect.setMatrix("diffuseMatrix", textureMatrix);
                    }
                }
                const opacityTexture = material.opacityTexture;
                if (opacityTexture) {
                    effect.setTexture("opacitySampler", opacityTexture);
                    effect.setFloat("opacityIntensity", opacityTexture.level);
                    const textureMatrix = opacityTexture.getTextureMatrix();
                    if (textureMatrix) {
                        effect.setMatrix("opacityMatrix", textureMatrix);
                    }
                }
                // Glow emissive only
                if (this._emissiveTextureAndColor.texture) {
                    effect.setTexture("emissiveSampler", this._emissiveTextureAndColor.texture);
                    effect.setMatrix("emissiveMatrix", this._emissiveTextureAndColor.texture.getTextureMatrix());
                }
                // Bones
                if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {
                    const skeleton = renderingMesh.skeleton;
                    if (skeleton.isUsingTextureForMatrices) {
                        const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);
                        if (!boneTexture) {
                            return;
                        }
                        effect.setTexture("boneSampler", boneTexture);
                        effect.setFloat("boneTextureWidth", 4.0 * (skeleton.bones.length + 1));
                    }
                    else {
                        effect.setMatrices("mBones", skeleton.getTransformMatrices(renderingMesh));
                    }
                }
                // Morph targets
                (0,materialHelper_functions/* BindMorphTargetParameters */.nR)(renderingMesh, effect);
                if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {
                    renderingMesh.morphTargetManager._bind(effect);
                }
                // Alpha mode
                if (enableAlphaMode) {
                    engine.setAlphaMode(material.alphaMode);
                }
                // Intensity of effect
                effect.setFloat("glowIntensity", this.getEffectIntensity(renderingMesh));
                // Clip planes
                (0,clipPlaneMaterialHelper/* bindClipPlane */.gS)(effect, material, scene);
            }
            // Draw
            renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, world) => effect.setMatrix("world", world));
        }
        else {
            // Need to reset refresh rate of the main map
            this._mainTexture.resetRefreshCounter();
        }
        this.onAfterRenderMeshToEffect.notifyObservers(ownerMesh);
    }
    /**
     * Defines whether the current material of the mesh should be use to render the effect.
     * @param mesh defines the current mesh to render
     * @returns true if the mesh material should be use
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _useMeshMaterial(mesh) {
        return false;
    }
    /**
     * Rebuild the required buffers.
     * @internal Internal use only.
     */
    _rebuild() {
        const vb = this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind];
        if (vb) {
            vb._rebuild();
        }
        this._generateIndexBuffer();
    }
    /**
     * Dispose only the render target textures and post process.
     */
    _disposeTextureAndPostProcesses() {
        this._mainTexture.dispose();
        for (let i = 0; i < this._postProcesses.length; i++) {
            if (this._postProcesses[i]) {
                this._postProcesses[i].dispose();
            }
        }
        this._postProcesses = [];
        for (let i = 0; i < this._textures.length; i++) {
            if (this._textures[i]) {
                this._textures[i].dispose();
            }
        }
        this._textures = [];
    }
    /**
     * Dispose the highlight layer and free resources.
     */
    dispose() {
        const vertexBuffer = this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind];
        if (vertexBuffer) {
            vertexBuffer.dispose();
            this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = null;
        }
        if (this._indexBuffer) {
            this._scene.getEngine()._releaseBuffer(this._indexBuffer);
            this._indexBuffer = null;
        }
        for (const drawWrapper of this._mergeDrawWrapper) {
            drawWrapper.dispose();
        }
        this._mergeDrawWrapper = [];
        // Clean textures and post processes
        this._disposeTextureAndPostProcesses();
        // Remove from scene
        const index = this._scene.effectLayers.indexOf(this, 0);
        if (index > -1) {
            this._scene.effectLayers.splice(index, 1);
        }
        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
        this.onBeforeRenderMainTextureObservable.clear();
        this.onBeforeComposeObservable.clear();
        this.onBeforeRenderMeshToEffect.clear();
        this.onAfterRenderMeshToEffect.clear();
        this.onAfterComposeObservable.clear();
        this.onSizeChangedObservable.clear();
    }
    /**
     * Gets the class name of the effect layer
     * @returns the string with the class name of the effect layer
     */
    getClassName() {
        return "EffectLayer";
    }
    /**
     * Creates an effect layer from parsed effect layer data
     * @param parsedEffectLayer defines effect layer data
     * @param scene defines the current scene
     * @param rootUrl defines the root URL containing the effect layer information
     * @returns a parsed effect Layer
     */
    static Parse(parsedEffectLayer, scene, rootUrl) {
        const effectLayerType = tools/* Tools */.S0.Instantiate(parsedEffectLayer.customType);
        return effectLayerType.Parse(parsedEffectLayer, scene, rootUrl);
    }
}
/**
 * Force all the effect layers to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
EffectLayer.ForceGLSL = false;
/**
 * @internal
 */
EffectLayer._SceneComponentInitialization = (_) => {
    throw (0,devTools/* _WarnImport */.n)("EffectLayerSceneComponent");
};
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], EffectLayer.prototype, "name", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor4 */.qK)()
], EffectLayer.prototype, "neutralColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], EffectLayer.prototype, "isEnabled", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsCameraReference */.fW)()
], EffectLayer.prototype, "camera", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], EffectLayer.prototype, "renderingGroupId", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], EffectLayer.prototype, "disableBoundingBoxesFromEffectLayer", void 0);
//# sourceMappingURL=effectLayer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Loading/Plugins/babylonFileParser.function.js
var babylonFileParser_function = __webpack_require__(93084);
;// ./node_modules/@babylonjs/core/Layers/effectLayerSceneComponent.js






// Adds the parser to the scene parsers.
(0,babylonFileParser_function/* AddParser */.ji)(sceneComponent/* SceneComponentConstants */.v.NAME_EFFECTLAYER, (parsedData, scene, container, rootUrl) => {
    if (parsedData.effectLayers) {
        if (!container.effectLayers) {
            container.effectLayers = [];
        }
        for (let index = 0; index < parsedData.effectLayers.length; index++) {
            const effectLayer = EffectLayer.Parse(parsedData.effectLayers[index], scene, rootUrl);
            container.effectLayers.push(effectLayer);
        }
    }
});
core_scene/* Scene */.Z.prototype.removeEffectLayer = function (toRemove) {
    const index = this.effectLayers.indexOf(toRemove);
    if (index !== -1) {
        this.effectLayers.splice(index, 1);
    }
    return index;
};
core_scene/* Scene */.Z.prototype.addEffectLayer = function (newEffectLayer) {
    this.effectLayers.push(newEffectLayer);
};
/**
 * Defines the layer scene component responsible to manage any effect layers
 * in a given scene.
 */
class EffectLayerSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_EFFECTLAYER;
        this._renderEffects = false;
        this._needStencil = false;
        this._previousStencilState = false;
        this.scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        if (!this.scene) {
            return;
        }
        this._engine = this.scene.getEngine();
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._isReadyForMeshStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_ISREADYFORMESH_EFFECTLAYER, this, this._isReadyForMesh);
        this.scene._cameraDrawRenderTargetStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER, this, this._renderMainTexture);
        this.scene._beforeCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_BEFORECAMERADRAW_EFFECTLAYER, this, this._setStencil);
        this.scene._afterRenderingGroupDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW, this, this._drawRenderingGroup);
        this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_AFTERCAMERADRAW_EFFECTLAYER, this, this._setStencilBack);
        this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW, this, this._drawCamera);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        const layers = this.scene.effectLayers;
        for (const effectLayer of layers) {
            effectLayer._rebuild();
        }
    }
    /**
     * Serializes the component data to the specified json object
     * @param serializationObject The object to serialize to
     */
    serialize(serializationObject) {
        // Effect layers
        serializationObject.effectLayers = [];
        const layers = this.scene.effectLayers;
        for (const effectLayer of layers) {
            if (effectLayer.serialize) {
                serializationObject.effectLayers.push(effectLayer.serialize());
            }
        }
    }
    /**
     * Adds all the elements from the container to the scene
     * @param container the container holding the elements
     */
    addFromContainer(container) {
        if (!container.effectLayers) {
            return;
        }
        container.effectLayers.forEach((o) => {
            this.scene.addEffectLayer(o);
        });
    }
    /**
     * Removes all the elements in the container from the scene
     * @param container contains the elements to remove
     * @param dispose if the removed element should be disposed (default: false)
     */
    removeFromContainer(container, dispose) {
        if (!container.effectLayers) {
            return;
        }
        container.effectLayers.forEach((o) => {
            this.scene.removeEffectLayer(o);
            if (dispose) {
                o.dispose();
            }
        });
    }
    /**
     * Disposes the component and the associated resources.
     */
    dispose() {
        const layers = this.scene.effectLayers;
        while (layers.length) {
            layers[0].dispose();
        }
    }
    _isReadyForMesh(mesh, hardwareInstancedRendering) {
        const currentRenderPassId = this._engine.currentRenderPassId;
        const layers = this.scene.effectLayers;
        for (const layer of layers) {
            if (!layer.hasMesh(mesh)) {
                continue;
            }
            const renderTarget = layer._mainTexture;
            this._engine.currentRenderPassId = renderTarget.renderPassId;
            for (const subMesh of mesh.subMeshes) {
                if (!layer.isReady(subMesh, hardwareInstancedRendering)) {
                    this._engine.currentRenderPassId = currentRenderPassId;
                    return false;
                }
            }
        }
        this._engine.currentRenderPassId = currentRenderPassId;
        return true;
    }
    _renderMainTexture(camera) {
        this._renderEffects = false;
        this._needStencil = false;
        let needRebind = false;
        const layers = this.scene.effectLayers;
        if (layers && layers.length > 0) {
            this._previousStencilState = this._engine.getStencilBuffer();
            for (const effectLayer of layers) {
                if (effectLayer.shouldRender() &&
                    (!effectLayer.camera ||
                        (effectLayer.camera.cameraRigMode === Cameras_camera/* Camera */.i.RIG_MODE_NONE && camera === effectLayer.camera) ||
                        (effectLayer.camera.cameraRigMode !== Cameras_camera/* Camera */.i.RIG_MODE_NONE && effectLayer.camera._rigCameras.indexOf(camera) > -1))) {
                    this._renderEffects = true;
                    this._needStencil = this._needStencil || effectLayer.needStencil();
                    const renderTarget = effectLayer._mainTexture;
                    if (renderTarget._shouldRender()) {
                        this.scene.incrementRenderId();
                        renderTarget.render(false, false);
                        needRebind = true;
                    }
                }
            }
            this.scene.incrementRenderId();
        }
        return needRebind;
    }
    _setStencil() {
        // Activate effect Layer stencil
        if (this._needStencil) {
            this._engine.setStencilBuffer(true);
        }
    }
    _setStencilBack() {
        // Restore effect Layer stencil
        if (this._needStencil) {
            this._engine.setStencilBuffer(this._previousStencilState);
        }
    }
    _draw(renderingGroupId) {
        if (this._renderEffects) {
            this._engine.setDepthBuffer(false);
            const layers = this.scene.effectLayers;
            for (let i = 0; i < layers.length; i++) {
                const effectLayer = layers[i];
                if (effectLayer.renderingGroupId === renderingGroupId) {
                    if (effectLayer.shouldRender()) {
                        effectLayer.render();
                    }
                }
            }
            this._engine.setDepthBuffer(true);
        }
    }
    _drawCamera() {
        if (this._renderEffects) {
            this._draw(-1);
        }
    }
    _drawRenderingGroup(index) {
        if (!this.scene._isInIntermediateRendering() && this._renderEffects) {
            this._draw(index);
        }
    }
}
EffectLayer._SceneComponentInitialization = (scene) => {
    let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_EFFECTLAYER);
    if (!component) {
        component = new EffectLayerSceneComponent(scene);
        scene._addComponent(component);
    }
};
//# sourceMappingURL=effectLayerSceneComponent.js.map
;// ./node_modules/@babylonjs/core/Layers/glowLayer.js

/* eslint-disable @typescript-eslint/no-unused-vars */















core_scene/* Scene */.Z.prototype.getGlowLayerByName = function (name) {
    for (let index = 0; index < this.effectLayers?.length; index++) {
        if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === GlowLayer.EffectName) {
            return this.effectLayers[index];
        }
    }
    return null;
};
/**
 * The glow layer Helps adding a glow effect around the emissive parts of a mesh.
 *
 * Once instantiated in a scene, by default, all the emissive meshes will glow.
 *
 * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/mesh/glowLayer
 */
class GlowLayer extends EffectLayer {
    /**
     * Sets the kernel size of the blur.
     */
    set blurKernelSize(value) {
        if (value === this._options.blurKernelSize) {
            return;
        }
        this._options.blurKernelSize = value;
        const effectiveKernel = this._getEffectiveBlurKernelSize();
        this._horizontalBlurPostprocess1.kernel = effectiveKernel;
        this._verticalBlurPostprocess1.kernel = effectiveKernel;
        this._horizontalBlurPostprocess2.kernel = effectiveKernel;
        this._verticalBlurPostprocess2.kernel = effectiveKernel;
    }
    /**
     * Gets the kernel size of the blur.
     */
    get blurKernelSize() {
        return this._options.blurKernelSize;
    }
    /**
     * Sets the glow intensity.
     */
    set intensity(value) {
        this._intensity = value;
    }
    /**
     * Gets the glow intensity.
     */
    get intensity() {
        return this._intensity;
    }
    /**
     * Instantiates a new glow Layer and references it to the scene.
     * @param name The name of the layer
     * @param scene The scene to use the layer in
     * @param options Sets of none mandatory options to use with the layer (see IGlowLayerOptions for more information)
     */
    constructor(name, scene, options) {
        super(name, scene);
        this._intensity = 1.0;
        this._includedOnlyMeshes = [];
        this._excludedMeshes = [];
        this._meshesUsingTheirOwnMaterials = [];
        this.neutralColor = new math_color/* Color4 */.ov(0, 0, 0, 1);
        // Adapt options
        this._options = {
            mainTextureRatio: GlowLayer.DefaultTextureRatio,
            blurKernelSize: 32,
            mainTextureFixedSize: undefined,
            camera: null,
            mainTextureSamples: 1,
            renderingGroupId: -1,
            ldrMerge: false,
            alphaBlendingMode: 1,
            mainTextureType: 0,
            generateStencilBuffer: false,
            ...options,
        };
        // Initialize the layer
        this._init({
            alphaBlendingMode: this._options.alphaBlendingMode,
            camera: this._options.camera,
            mainTextureFixedSize: this._options.mainTextureFixedSize,
            mainTextureRatio: this._options.mainTextureRatio,
            renderingGroupId: this._options.renderingGroupId,
            mainTextureType: this._options.mainTextureType,
            generateStencilBuffer: this._options.generateStencilBuffer,
        });
    }
    async _importShadersAsync() {
        if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22147)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 7101)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 82937)),
            ]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99858)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 41288)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 57094))]);
        }
        await super._importShadersAsync();
    }
    /**
     * Get the effect name of the layer.
     * @returns The effect name
     */
    getEffectName() {
        return GlowLayer.EffectName;
    }
    /**
     * @internal
     * Create the merge effect. This is the shader use to blit the information back
     * to the main canvas at the end of the scene rendering.
     */
    _createMergeEffect() {
        let defines = "#define EMISSIVE \n";
        if (this._options.ldrMerge) {
            defines += "#define LDR \n";
        }
        // Effect
        return this._engine.createEffect("glowMapMerge", [Buffers_buffer/* VertexBuffer */.R.PositionKind], ["offset"], ["textureSampler", "textureSampler2"], defines, undefined, undefined, undefined, undefined, this.shaderLanguage, this._shadersLoaded
            ? undefined
            : async () => {
                await this._importShadersAsync();
                this._shadersLoaded = true;
            });
    }
    /**
     * Creates the render target textures and post processes used in the glow layer.
     */
    _createTextureAndPostProcesses() {
        let blurTextureWidth = this._mainTextureDesiredSize.width;
        let blurTextureHeight = this._mainTextureDesiredSize.height;
        blurTextureWidth = this._engine.needPOTTextures ? (0,tools_functions/* GetExponentOfTwo */.R)(blurTextureWidth, this._maxSize) : blurTextureWidth;
        blurTextureHeight = this._engine.needPOTTextures ? (0,tools_functions/* GetExponentOfTwo */.R)(blurTextureHeight, this._maxSize) : blurTextureHeight;
        let textureType = 0;
        if (this._engine.getCaps().textureHalfFloatRender) {
            textureType = 2;
        }
        else {
            textureType = 0;
        }
        this._blurTexture1 = new Textures_renderTargetTexture/* RenderTargetTexture */.$("GlowLayerBlurRTT", {
            width: blurTextureWidth,
            height: blurTextureHeight,
        }, this._scene, false, true, textureType);
        this._blurTexture1.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._blurTexture1.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._blurTexture1.updateSamplingMode(Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE);
        this._blurTexture1.renderParticles = false;
        this._blurTexture1.ignoreCameraViewport = true;
        const blurTextureWidth2 = Math.floor(blurTextureWidth / 2);
        const blurTextureHeight2 = Math.floor(blurTextureHeight / 2);
        this._blurTexture2 = new Textures_renderTargetTexture/* RenderTargetTexture */.$("GlowLayerBlurRTT2", {
            width: blurTextureWidth2,
            height: blurTextureHeight2,
        }, this._scene, false, true, textureType);
        this._blurTexture2.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._blurTexture2.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._blurTexture2.updateSamplingMode(Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE);
        this._blurTexture2.renderParticles = false;
        this._blurTexture2.ignoreCameraViewport = true;
        this._textures = [this._blurTexture1, this._blurTexture2];
        const effectiveKernel = this._getEffectiveBlurKernelSize();
        this._horizontalBlurPostprocess1 = new BlurPostProcess("GlowLayerHBP1", new math_vector/* Vector2 */.I9(1.0, 0), effectiveKernel, {
            width: blurTextureWidth,
            height: blurTextureHeight,
        }, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
        this._horizontalBlurPostprocess1.width = blurTextureWidth;
        this._horizontalBlurPostprocess1.height = blurTextureHeight;
        this._horizontalBlurPostprocess1.externalTextureSamplerBinding = true;
        this._horizontalBlurPostprocess1.onApplyObservable.add((effect) => {
            effect.setTexture("textureSampler", this._mainTexture);
        });
        this._verticalBlurPostprocess1 = new BlurPostProcess("GlowLayerVBP1", new math_vector/* Vector2 */.I9(0, 1.0), effectiveKernel, {
            width: blurTextureWidth,
            height: blurTextureHeight,
        }, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
        this._horizontalBlurPostprocess2 = new BlurPostProcess("GlowLayerHBP2", new math_vector/* Vector2 */.I9(1.0, 0), effectiveKernel, {
            width: blurTextureWidth2,
            height: blurTextureHeight2,
        }, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
        this._horizontalBlurPostprocess2.width = blurTextureWidth2;
        this._horizontalBlurPostprocess2.height = blurTextureHeight2;
        this._horizontalBlurPostprocess2.externalTextureSamplerBinding = true;
        this._horizontalBlurPostprocess2.onApplyObservable.add((effect) => {
            effect.setTexture("textureSampler", this._blurTexture1);
        });
        this._verticalBlurPostprocess2 = new BlurPostProcess("GlowLayerVBP2", new math_vector/* Vector2 */.I9(0, 1.0), effectiveKernel, {
            width: blurTextureWidth2,
            height: blurTextureHeight2,
        }, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
        this._postProcesses = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1, this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2];
        this._postProcesses1 = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1];
        this._postProcesses2 = [this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2];
        this._mainTexture.samples = this._options.mainTextureSamples;
        this._mainTexture.onAfterUnbindObservable.add(() => {
            const internalTexture = this._blurTexture1.renderTarget;
            if (internalTexture) {
                this._scene.postProcessManager.directRender(this._postProcesses1, internalTexture, true);
                const internalTexture2 = this._blurTexture2.renderTarget;
                if (internalTexture2) {
                    this._scene.postProcessManager.directRender(this._postProcesses2, internalTexture2, true);
                }
                this._engine.unBindFramebuffer(internalTexture2 ?? internalTexture, true);
            }
        });
        // Prevent autoClear.
        this._postProcesses.map((pp) => {
            pp.autoClear = false;
        });
    }
    /**
     * @returns The blur kernel size used by the glow.
     * Note: The value passed in the options is divided by 2 for back compatibility.
     */
    _getEffectiveBlurKernelSize() {
        return this._options.blurKernelSize / 2;
    }
    /**
     * Checks for the readiness of the element composing the layer.
     * @param subMesh the mesh to check for
     * @param useInstances specify whether or not to use instances to render the mesh
     * @returns true if ready otherwise, false
     */
    isReady(subMesh, useInstances) {
        const material = subMesh.getMaterial();
        const mesh = subMesh.getRenderingMesh();
        if (!material || !mesh) {
            return false;
        }
        const emissiveTexture = material.emissiveTexture;
        return super._isReady(subMesh, useInstances, emissiveTexture);
    }
    /**
     * @returns whether or not the layer needs stencil enabled during the mesh rendering.
     */
    needStencil() {
        return false;
    }
    /**
     * Returns true if the mesh can be rendered, otherwise false.
     * @param mesh The mesh to render
     * @param material The material used on the mesh
     * @returns true if it can be rendered otherwise false
     */
    _canRenderMesh(mesh, material) {
        return true;
    }
    /**
     * Implementation specific of rendering the generating effect on the main canvas.
     * @param effect The effect used to render through
     */
    _internalRender(effect) {
        // Texture
        effect.setTexture("textureSampler", this._blurTexture1);
        effect.setTexture("textureSampler2", this._blurTexture2);
        effect.setFloat("offset", this._intensity);
        // Cache
        const engine = this._engine;
        const previousStencilBuffer = engine.getStencilBuffer();
        // Draw order
        engine.setStencilBuffer(false);
        engine.drawElementsType(Materials_material/* Material */.i.TriangleFillMode, 0, 6);
        // Draw order
        engine.setStencilBuffer(previousStencilBuffer);
    }
    /**
     * Sets the required values for both the emissive texture and and the main color.
     * @param mesh
     * @param subMesh
     * @param material
     */
    _setEmissiveTextureAndColor(mesh, subMesh, material) {
        let textureLevel = 1.0;
        if (this.customEmissiveTextureSelector) {
            this._emissiveTextureAndColor.texture = this.customEmissiveTextureSelector(mesh, subMesh, material);
        }
        else {
            if (material) {
                this._emissiveTextureAndColor.texture = material.emissiveTexture;
                if (this._emissiveTextureAndColor.texture) {
                    textureLevel = this._emissiveTextureAndColor.texture.level;
                }
            }
            else {
                this._emissiveTextureAndColor.texture = null;
            }
        }
        if (this.customEmissiveColorSelector) {
            this.customEmissiveColorSelector(mesh, subMesh, material, this._emissiveTextureAndColor.color);
        }
        else {
            if (material.emissiveColor) {
                const emissiveIntensity = material.emissiveIntensity ?? 1;
                textureLevel *= emissiveIntensity;
                this._emissiveTextureAndColor.color.set(material.emissiveColor.r * textureLevel, material.emissiveColor.g * textureLevel, material.emissiveColor.b * textureLevel, material.alpha);
            }
            else {
                this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);
            }
        }
    }
    /**
     * Returns true if the mesh should render, otherwise false.
     * @param mesh The mesh to render
     * @returns true if it should render otherwise false
     */
    _shouldRenderMesh(mesh) {
        return this.hasMesh(mesh);
    }
    /**
     * Adds specific effects defines.
     * @param defines The defines to add specifics to.
     */
    _addCustomEffectDefines(defines) {
        defines.push("#define GLOW");
    }
    /**
     * Add a mesh in the exclusion list to prevent it to impact or being impacted by the glow layer.
     * @param mesh The mesh to exclude from the glow layer
     */
    addExcludedMesh(mesh) {
        if (this._excludedMeshes.indexOf(mesh.uniqueId) === -1) {
            this._excludedMeshes.push(mesh.uniqueId);
        }
    }
    /**
     * Remove a mesh from the exclusion list to let it impact or being impacted by the glow layer.
     * @param mesh The mesh to remove
     */
    removeExcludedMesh(mesh) {
        const index = this._excludedMeshes.indexOf(mesh.uniqueId);
        if (index !== -1) {
            this._excludedMeshes.splice(index, 1);
        }
    }
    /**
     * Add a mesh in the inclusion list to impact or being impacted by the glow layer.
     * @param mesh The mesh to include in the glow layer
     */
    addIncludedOnlyMesh(mesh) {
        if (this._includedOnlyMeshes.indexOf(mesh.uniqueId) === -1) {
            this._includedOnlyMeshes.push(mesh.uniqueId);
        }
    }
    /**
     * Remove a mesh from the Inclusion list to prevent it to impact or being impacted by the glow layer.
     * @param mesh The mesh to remove
     */
    removeIncludedOnlyMesh(mesh) {
        const index = this._includedOnlyMeshes.indexOf(mesh.uniqueId);
        if (index !== -1) {
            this._includedOnlyMeshes.splice(index, 1);
        }
    }
    /**
     * Determine if a given mesh will be used in the glow layer
     * @param mesh The mesh to test
     * @returns true if the mesh will be highlighted by the current glow layer
     */
    hasMesh(mesh) {
        if (!super.hasMesh(mesh)) {
            return false;
        }
        // Included Mesh
        if (this._includedOnlyMeshes.length) {
            return this._includedOnlyMeshes.indexOf(mesh.uniqueId) !== -1;
        }
        // Excluded Mesh
        if (this._excludedMeshes.length) {
            return this._excludedMeshes.indexOf(mesh.uniqueId) === -1;
        }
        return true;
    }
    /**
     * Defines whether the current material of the mesh should be use to render the effect.
     * @param mesh defines the current mesh to render
     * @returns true if the material of the mesh should be use to render the effect
     */
    _useMeshMaterial(mesh) {
        if (this._meshesUsingTheirOwnMaterials.length == 0) {
            return false;
        }
        return this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId) > -1;
    }
    /**
     * Add a mesh to be rendered through its own material and not with emissive only.
     * @param mesh The mesh for which we need to use its material
     */
    referenceMeshToUseItsOwnMaterial(mesh) {
        mesh.resetDrawCache(this._mainTexture.renderPassId);
        this._meshesUsingTheirOwnMaterials.push(mesh.uniqueId);
        mesh.onDisposeObservable.add(() => {
            this._disposeMesh(mesh);
        });
    }
    /**
     * Remove a mesh from being rendered through its own material and not with emissive only.
     * @param mesh The mesh for which we need to not use its material
     */
    unReferenceMeshFromUsingItsOwnMaterial(mesh) {
        let index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);
        while (index >= 0) {
            this._meshesUsingTheirOwnMaterials.splice(index, 1);
            index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);
        }
        mesh.resetDrawCache(this._mainTexture.renderPassId);
    }
    /**
     * Free any resources and references associated to a mesh.
     * Internal use
     * @param mesh The mesh to free.
     * @internal
     */
    _disposeMesh(mesh) {
        this.removeIncludedOnlyMesh(mesh);
        this.removeExcludedMesh(mesh);
    }
    /**
     * Gets the class name of the effect layer
     * @returns the string with the class name of the effect layer
     */
    getClassName() {
        return "GlowLayer";
    }
    /**
     * Serializes this glow layer
     * @returns a serialized glow layer object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.customType = "BABYLON.GlowLayer";
        let index;
        // Included meshes
        serializationObject.includedMeshes = [];
        if (this._includedOnlyMeshes.length) {
            for (index = 0; index < this._includedOnlyMeshes.length; index++) {
                const mesh = this._scene.getMeshByUniqueId(this._includedOnlyMeshes[index]);
                if (mesh) {
                    serializationObject.includedMeshes.push(mesh.id);
                }
            }
        }
        // Excluded meshes
        serializationObject.excludedMeshes = [];
        if (this._excludedMeshes.length) {
            for (index = 0; index < this._excludedMeshes.length; index++) {
                const mesh = this._scene.getMeshByUniqueId(this._excludedMeshes[index]);
                if (mesh) {
                    serializationObject.excludedMeshes.push(mesh.id);
                }
            }
        }
        return serializationObject;
    }
    /**
     * Creates a Glow Layer from parsed glow layer data
     * @param parsedGlowLayer defines glow layer data
     * @param scene defines the current scene
     * @param rootUrl defines the root URL containing the glow layer information
     * @returns a parsed Glow Layer
     */
    static Parse(parsedGlowLayer, scene, rootUrl) {
        const gl = decorators_serialization/* SerializationHelper */.p.Parse(() => new GlowLayer(parsedGlowLayer.name, scene, parsedGlowLayer.options), parsedGlowLayer, scene, rootUrl);
        let index;
        // Excluded meshes
        for (index = 0; index < parsedGlowLayer.excludedMeshes.length; index++) {
            const mesh = scene.getMeshById(parsedGlowLayer.excludedMeshes[index]);
            if (mesh) {
                gl.addExcludedMesh(mesh);
            }
        }
        // Included meshes
        for (index = 0; index < parsedGlowLayer.includedMeshes.length; index++) {
            const mesh = scene.getMeshById(parsedGlowLayer.includedMeshes[index]);
            if (mesh) {
                gl.addIncludedOnlyMesh(mesh);
            }
        }
        return gl;
    }
}
/**
 * Effect Name of the layer.
 */
GlowLayer.EffectName = "GlowLayer";
/**
 * The default blur kernel size used for the glow.
 */
GlowLayer.DefaultBlurKernelSize = 32;
/**
 * The default texture size ratio used for the glow.
 */
GlowLayer.DefaultTextureRatio = 0.5;
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], GlowLayer.prototype, "blurKernelSize", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], GlowLayer.prototype, "intensity", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("options")
], GlowLayer.prototype, "_options", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GlowLayer", GlowLayer);
//# sourceMappingURL=glowLayer.js.map
;// ./node_modules/@babylonjs/core/Layers/highlightLayer.js

/* eslint-disable @typescript-eslint/no-unused-vars */


















core_scene/* Scene */.Z.prototype.getHighlightLayerByName = function (name) {
    for (let index = 0; index < this.effectLayers?.length; index++) {
        if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === HighlightLayer.EffectName) {
            return this.effectLayers[index];
        }
    }
    return null;
};
/**
 * Special Glow Blur post process only blurring the alpha channel
 * It enforces keeping the most luminous color in the color channel.
 */
class GlowBlurPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    constructor(name, direction, kernel, options, camera, samplingMode = Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, reusable) {
        super(name, "glowBlurPostProcess", ["screenSize", "direction", "blurWidth"], null, options, camera, samplingMode, engine, reusable);
        this.direction = direction;
        this.kernel = kernel;
        this.onApplyObservable.add((effect) => {
            effect.setFloat2("screenSize", this.width, this.height);
            effect.setVector2("direction", this.direction);
            effect.setFloat("blurWidth", this.kernel);
        });
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 82937)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 57094)));
        }
        super._gatherImports(useWebGPU, list);
    }
}
/**
 * The highlight layer Helps adding a glow effect around a mesh.
 *
 * Once instantiated in a scene, simply use the addMesh or removeMesh method to add or remove
 * glowy meshes to your scene.
 *
 * !!! THIS REQUIRES AN ACTIVE STENCIL BUFFER ON THE CANVAS !!!
 */
class HighlightLayer extends EffectLayer {
    /**
     * Specifies the horizontal size of the blur.
     */
    set blurHorizontalSize(value) {
        this._horizontalBlurPostprocess.kernel = value;
        this._options.blurHorizontalSize = value;
    }
    /**
     * Specifies the vertical size of the blur.
     */
    set blurVerticalSize(value) {
        this._verticalBlurPostprocess.kernel = value;
        this._options.blurVerticalSize = value;
    }
    /**
     * Gets the horizontal size of the blur.
     */
    get blurHorizontalSize() {
        return this._horizontalBlurPostprocess.kernel;
    }
    /**
     * Gets the vertical size of the blur.
     */
    get blurVerticalSize() {
        return this._verticalBlurPostprocess.kernel;
    }
    /**
     * Instantiates a new highlight Layer and references it to the scene..
     * @param name The name of the layer
     * @param scene The scene to use the layer in
     * @param options Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)
     */
    constructor(name, scene, options) {
        super(name, scene, options !== undefined ? !!options.forceGLSL : false);
        this.name = name;
        /**
         * Specifies whether or not the inner glow is ACTIVE in the layer.
         */
        this.innerGlow = true;
        /**
         * Specifies whether or not the outer glow is ACTIVE in the layer.
         */
        this.outerGlow = true;
        /**
         * An event triggered when the highlight layer is being blurred.
         */
        this.onBeforeBlurObservable = new Misc_observable/* Observable */.cP();
        /**
         * An event triggered when the highlight layer has been blurred.
         */
        this.onAfterBlurObservable = new Misc_observable/* Observable */.cP();
        this._instanceGlowingMeshStencilReference = HighlightLayer.GlowingMeshStencilReference++;
        this._meshes = {};
        this._excludedMeshes = {};
        this.neutralColor = HighlightLayer.NeutralColor;
        // Warn on stencil
        if (!this._engine.isStencilEnable) {
            logger/* Logger */.V.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }");
        }
        // Adapt options
        this._options = {
            mainTextureRatio: 0.5,
            blurTextureSizeRatio: 0.5,
            blurHorizontalSize: 1.0,
            blurVerticalSize: 1.0,
            alphaBlendingMode: 2,
            camera: null,
            renderingGroupId: -1,
            mainTextureType: 0,
            forceGLSL: false,
            ...options,
        };
        // Initialize the layer
        this._init({
            alphaBlendingMode: this._options.alphaBlendingMode,
            camera: this._options.camera,
            mainTextureFixedSize: this._options.mainTextureFixedSize,
            mainTextureRatio: this._options.mainTextureRatio,
            renderingGroupId: this._options.renderingGroupId,
            mainTextureType: this._options.mainTextureType,
        });
        // Do not render as long as no meshes have been added
        this._shouldRender = false;
    }
    async _importShadersAsync() {
        if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22147)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 7101)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 82937)),
            ]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99858)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 41288)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 57094))]);
        }
        await super._importShadersAsync();
    }
    /**
     * Get the effect name of the layer.
     * @returns The effect name
     */
    getEffectName() {
        return HighlightLayer.EffectName;
    }
    _numInternalDraws() {
        return 2; // we need two rendering, one for the inner glow and the other for the outer glow
    }
    /**
     * Create the merge effect. This is the shader use to blit the information back
     * to the main canvas at the end of the scene rendering.
     * @returns The effect created
     */
    _createMergeEffect() {
        // Effect
        return this._engine.createEffect("glowMapMerge", [Buffers_buffer/* VertexBuffer */.R.PositionKind], ["offset"], ["textureSampler"], this._options.isStroke ? "#define STROKE \n" : undefined, undefined, undefined, undefined, undefined, this._shaderLanguage, this._shadersLoaded
            ? undefined
            : async () => {
                await this._importShadersAsync();
                this._shadersLoaded = true;
            });
    }
    /**
     * Creates the render target textures and post processes used in the highlight layer.
     */
    _createTextureAndPostProcesses() {
        let blurTextureWidth = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio;
        let blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;
        blurTextureWidth = this._engine.needPOTTextures ? (0,tools_functions/* GetExponentOfTwo */.R)(blurTextureWidth, this._maxSize) : blurTextureWidth;
        blurTextureHeight = this._engine.needPOTTextures ? (0,tools_functions/* GetExponentOfTwo */.R)(blurTextureHeight, this._maxSize) : blurTextureHeight;
        let textureType = 0;
        if (this._engine.getCaps().textureHalfFloatRender) {
            textureType = 2;
        }
        else {
            textureType = 0;
        }
        this._blurTexture = new Textures_renderTargetTexture/* RenderTargetTexture */.$("HighlightLayerBlurRTT", {
            width: blurTextureWidth,
            height: blurTextureHeight,
        }, this._scene, false, true, textureType);
        this._blurTexture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._blurTexture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._blurTexture.anisotropicFilteringLevel = 16;
        this._blurTexture.updateSamplingMode(Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE);
        this._blurTexture.renderParticles = false;
        this._blurTexture.ignoreCameraViewport = true;
        this._textures = [this._blurTexture];
        if (this._options.alphaBlendingMode === 2) {
            this._downSamplePostprocess = new passPostProcess/* PassPostProcess */.v("HighlightLayerPPP", this._options.blurTextureSizeRatio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine());
            this._downSamplePostprocess.externalTextureSamplerBinding = true;
            this._downSamplePostprocess.onApplyObservable.add((effect) => {
                effect.setTexture("textureSampler", this._mainTexture);
            });
            this._horizontalBlurPostprocess = new GlowBlurPostProcess("HighlightLayerHBP", new math_vector/* Vector2 */.I9(1.0, 0), this._options.blurHorizontalSize, 1, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine());
            this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {
                effect.setFloat2("screenSize", blurTextureWidth, blurTextureHeight);
            });
            this._verticalBlurPostprocess = new GlowBlurPostProcess("HighlightLayerVBP", new math_vector/* Vector2 */.I9(0, 1.0), this._options.blurVerticalSize, 1, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine());
            this._verticalBlurPostprocess.onApplyObservable.add((effect) => {
                effect.setFloat2("screenSize", blurTextureWidth, blurTextureHeight);
            });
            this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess];
        }
        else {
            this._horizontalBlurPostprocess = new BlurPostProcess("HighlightLayerHBP", new math_vector/* Vector2 */.I9(1.0, 0), this._options.blurHorizontalSize / 2, {
                width: blurTextureWidth,
                height: blurTextureHeight,
            }, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
            const horizontalBlurPostprocess = this._horizontalBlurPostprocess;
            horizontalBlurPostprocess.width = blurTextureWidth;
            horizontalBlurPostprocess.height = blurTextureHeight;
            horizontalBlurPostprocess.externalTextureSamplerBinding = true;
            horizontalBlurPostprocess.onApplyObservable.add((effect) => {
                effect.setTexture("textureSampler", this._mainTexture);
            });
            this._verticalBlurPostprocess = new BlurPostProcess("HighlightLayerVBP", new math_vector/* Vector2 */.I9(0, 1.0), this._options.blurVerticalSize / 2, {
                width: blurTextureWidth,
                height: blurTextureHeight,
            }, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
            this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];
        }
        this._mainTexture.onAfterUnbindObservable.add(() => {
            this.onBeforeBlurObservable.notifyObservers(this);
            const internalTexture = this._blurTexture.renderTarget;
            if (internalTexture) {
                this._scene.postProcessManager.directRender(this._postProcesses, internalTexture, true);
                this._engine.unBindFramebuffer(internalTexture, true);
            }
            this.onAfterBlurObservable.notifyObservers(this);
        });
        // Prevent autoClear.
        this._postProcesses.map((pp) => {
            pp.autoClear = false;
        });
    }
    /**
     * @returns whether or not the layer needs stencil enabled during the mesh rendering.
     */
    needStencil() {
        return true;
    }
    /**
     * Checks for the readiness of the element composing the layer.
     * @param subMesh the mesh to check for
     * @param useInstances specify whether or not to use instances to render the mesh
     * @returns true if ready otherwise, false
     */
    isReady(subMesh, useInstances) {
        const material = subMesh.getMaterial();
        const mesh = subMesh.getRenderingMesh();
        if (!material || !mesh || !this._meshes) {
            return false;
        }
        let emissiveTexture = null;
        const highlightLayerMesh = this._meshes[mesh.uniqueId];
        if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {
            emissiveTexture = material.emissiveTexture;
        }
        return super._isReady(subMesh, useInstances, emissiveTexture);
    }
    /**
     * Implementation specific of rendering the generating effect on the main canvas.
     * @param effect The effect used to render through
     * @param renderIndex
     */
    _internalRender(effect, renderIndex) {
        // Texture
        effect.setTexture("textureSampler", this._blurTexture);
        // Cache
        const engine = this._engine;
        engine.cacheStencilState();
        // Stencil operations
        engine.setStencilOperationPass(7681);
        engine.setStencilOperationFail(7680);
        engine.setStencilOperationDepthFail(7680);
        // Draw order
        engine.setStencilMask(0x00);
        engine.setStencilBuffer(true);
        engine.setStencilFunctionReference(this._instanceGlowingMeshStencilReference);
        // 2 passes inner outer
        if (this.outerGlow && renderIndex === 0) {
            // the outer glow is rendered the first time _internalRender is called, so when renderIndex == 0 (and only if outerGlow is enabled)
            effect.setFloat("offset", 0);
            engine.setStencilFunction(517);
            engine.drawElementsType(Materials_material/* Material */.i.TriangleFillMode, 0, 6);
        }
        if (this.innerGlow && renderIndex === 1) {
            // the inner glow is rendered the second time _internalRender is called, so when renderIndex == 1 (and only if innerGlow is enabled)
            effect.setFloat("offset", 1);
            engine.setStencilFunction(514);
            engine.drawElementsType(Materials_material/* Material */.i.TriangleFillMode, 0, 6);
        }
        // Restore Cache
        engine.restoreStencilState();
    }
    /**
     * @returns true if the layer contains information to display, otherwise false.
     */
    shouldRender() {
        if (super.shouldRender()) {
            return this._meshes ? true : false;
        }
        return false;
    }
    /**
     * Returns true if the mesh should render, otherwise false.
     * @param mesh The mesh to render
     * @returns true if it should render otherwise false
     */
    _shouldRenderMesh(mesh) {
        // Excluded Mesh
        if (this._excludedMeshes && this._excludedMeshes[mesh.uniqueId]) {
            return false;
        }
        if (!super.hasMesh(mesh)) {
            return false;
        }
        return true;
    }
    /**
     * Returns true if the mesh can be rendered, otherwise false.
     * @param mesh The mesh to render
     * @param material The material used on the mesh
     * @returns true if it can be rendered otherwise false
     */
    _canRenderMesh(mesh, material) {
        // all meshes can be rendered in the highlight layer, even transparent ones
        return true;
    }
    /**
     * Adds specific effects defines.
     * @param defines The defines to add specifics to.
     */
    _addCustomEffectDefines(defines) {
        defines.push("#define HIGHLIGHT");
    }
    /**
     * Sets the required values for both the emissive texture and and the main color.
     * @param mesh
     * @param subMesh
     * @param material
     */
    _setEmissiveTextureAndColor(mesh, subMesh, material) {
        const highlightLayerMesh = this._meshes[mesh.uniqueId];
        if (highlightLayerMesh) {
            this._emissiveTextureAndColor.color.set(highlightLayerMesh.color.r, highlightLayerMesh.color.g, highlightLayerMesh.color.b, 1.0);
        }
        else {
            this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);
        }
        if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {
            this._emissiveTextureAndColor.texture = material.emissiveTexture;
            this._emissiveTextureAndColor.color.set(1.0, 1.0, 1.0, 1.0);
        }
        else {
            this._emissiveTextureAndColor.texture = null;
        }
    }
    /**
     * Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer.
     * @param mesh The mesh to exclude from the highlight layer
     */
    addExcludedMesh(mesh) {
        if (!this._excludedMeshes) {
            return;
        }
        const meshExcluded = this._excludedMeshes[mesh.uniqueId];
        if (!meshExcluded) {
            const obj = {
                mesh: mesh,
                beforeBind: null,
                afterRender: null,
                stencilState: false,
            };
            obj.beforeBind = mesh.onBeforeBindObservable.add((mesh) => {
                obj.stencilState = mesh.getEngine().getStencilBuffer();
                mesh.getEngine().setStencilBuffer(false);
            });
            obj.afterRender = mesh.onAfterRenderObservable.add((mesh) => {
                mesh.getEngine().setStencilBuffer(obj.stencilState);
            });
            this._excludedMeshes[mesh.uniqueId] = obj;
        }
    }
    /**
     * Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer.
     * @param mesh The mesh to highlight
     */
    removeExcludedMesh(mesh) {
        if (!this._excludedMeshes) {
            return;
        }
        const meshExcluded = this._excludedMeshes[mesh.uniqueId];
        if (meshExcluded) {
            if (meshExcluded.beforeBind) {
                mesh.onBeforeBindObservable.remove(meshExcluded.beforeBind);
            }
            if (meshExcluded.afterRender) {
                mesh.onAfterRenderObservable.remove(meshExcluded.afterRender);
            }
        }
        this._excludedMeshes[mesh.uniqueId] = null;
    }
    /**
     * Determine if a given mesh will be highlighted by the current HighlightLayer
     * @param mesh mesh to test
     * @returns true if the mesh will be highlighted by the current HighlightLayer
     */
    hasMesh(mesh) {
        if (!this._meshes) {
            return false;
        }
        if (!super.hasMesh(mesh)) {
            return false;
        }
        return this._meshes[mesh.uniqueId] !== undefined && this._meshes[mesh.uniqueId] !== null;
    }
    /**
     * Add a mesh in the highlight layer in order to make it glow with the chosen color.
     * @param mesh The mesh to highlight
     * @param color The color of the highlight
     * @param glowEmissiveOnly Extract the glow from the emissive texture
     */
    addMesh(mesh, color, glowEmissiveOnly = false) {
        if (!this._meshes) {
            return;
        }
        const meshHighlight = this._meshes[mesh.uniqueId];
        if (meshHighlight) {
            meshHighlight.color = color;
        }
        else {
            this._meshes[mesh.uniqueId] = {
                mesh: mesh,
                color: color,
                // Lambda required for capture due to Observable this context
                observerHighlight: mesh.onBeforeBindObservable.add((mesh) => {
                    if (this.isEnabled) {
                        if (this._excludedMeshes && this._excludedMeshes[mesh.uniqueId]) {
                            this._defaultStencilReference(mesh);
                        }
                        else {
                            mesh.getScene().getEngine().setStencilFunctionReference(this._instanceGlowingMeshStencilReference);
                        }
                    }
                }),
                observerDefault: mesh.onAfterRenderObservable.add((mesh) => {
                    if (this.isEnabled) {
                        this._defaultStencilReference(mesh);
                    }
                }),
                glowEmissiveOnly: glowEmissiveOnly,
            };
            mesh.onDisposeObservable.add(() => {
                this._disposeMesh(mesh);
            });
        }
        this._shouldRender = true;
    }
    /**
     * Remove a mesh from the highlight layer in order to make it stop glowing.
     * @param mesh The mesh to highlight
     */
    removeMesh(mesh) {
        if (!this._meshes) {
            return;
        }
        const meshHighlight = this._meshes[mesh.uniqueId];
        if (meshHighlight) {
            if (meshHighlight.observerHighlight) {
                mesh.onBeforeBindObservable.remove(meshHighlight.observerHighlight);
            }
            if (meshHighlight.observerDefault) {
                mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault);
            }
            delete this._meshes[mesh.uniqueId];
        }
        this._shouldRender = false;
        for (const meshHighlightToCheck in this._meshes) {
            if (this._meshes[meshHighlightToCheck]) {
                this._shouldRender = true;
                break;
            }
        }
    }
    /**
     * Remove all the meshes currently referenced in the highlight layer
     */
    removeAllMeshes() {
        if (!this._meshes) {
            return;
        }
        for (const uniqueId in this._meshes) {
            if (Object.prototype.hasOwnProperty.call(this._meshes, uniqueId)) {
                const mesh = this._meshes[uniqueId];
                if (mesh) {
                    this.removeMesh(mesh.mesh);
                }
            }
        }
    }
    /**
     * Force the stencil to the normal expected value for none glowing parts
     * @param mesh
     */
    _defaultStencilReference(mesh) {
        mesh.getScene().getEngine().setStencilFunctionReference(HighlightLayer.NormalMeshStencilReference);
    }
    /**
     * Free any resources and references associated to a mesh.
     * Internal use
     * @param mesh The mesh to free.
     * @internal
     */
    _disposeMesh(mesh) {
        this.removeMesh(mesh);
        this.removeExcludedMesh(mesh);
    }
    /**
     * Dispose the highlight layer and free resources.
     */
    dispose() {
        if (this._meshes) {
            // Clean mesh references
            for (const id in this._meshes) {
                const meshHighlight = this._meshes[id];
                if (meshHighlight && meshHighlight.mesh) {
                    if (meshHighlight.observerHighlight) {
                        meshHighlight.mesh.onBeforeBindObservable.remove(meshHighlight.observerHighlight);
                    }
                    if (meshHighlight.observerDefault) {
                        meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault);
                    }
                }
            }
            this._meshes = null;
        }
        if (this._excludedMeshes) {
            for (const id in this._excludedMeshes) {
                const meshHighlight = this._excludedMeshes[id];
                if (meshHighlight) {
                    if (meshHighlight.beforeBind) {
                        meshHighlight.mesh.onBeforeBindObservable.remove(meshHighlight.beforeBind);
                    }
                    if (meshHighlight.afterRender) {
                        meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.afterRender);
                    }
                }
            }
            this._excludedMeshes = null;
        }
        super.dispose();
    }
    /**
     * Gets the class name of the effect layer
     * @returns the string with the class name of the effect layer
     */
    getClassName() {
        return "HighlightLayer";
    }
    /**
     * Serializes this Highlight layer
     * @returns a serialized Highlight layer object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.customType = "BABYLON.HighlightLayer";
        // Highlighted meshes
        serializationObject.meshes = [];
        if (this._meshes) {
            for (const m in this._meshes) {
                const mesh = this._meshes[m];
                if (mesh) {
                    serializationObject.meshes.push({
                        glowEmissiveOnly: mesh.glowEmissiveOnly,
                        color: mesh.color.asArray(),
                        meshId: mesh.mesh.id,
                    });
                }
            }
        }
        // Excluded meshes
        serializationObject.excludedMeshes = [];
        if (this._excludedMeshes) {
            for (const e in this._excludedMeshes) {
                const excludedMesh = this._excludedMeshes[e];
                if (excludedMesh) {
                    serializationObject.excludedMeshes.push(excludedMesh.mesh.id);
                }
            }
        }
        return serializationObject;
    }
    /**
     * Creates a Highlight layer from parsed Highlight layer data
     * @param parsedHightlightLayer defines the Highlight layer data
     * @param scene defines the current scene
     * @param rootUrl defines the root URL containing the Highlight layer information
     * @returns a parsed Highlight layer
     */
    static Parse(parsedHightlightLayer, scene, rootUrl) {
        const hl = decorators_serialization/* SerializationHelper */.p.Parse(() => new HighlightLayer(parsedHightlightLayer.name, scene, parsedHightlightLayer.options), parsedHightlightLayer, scene, rootUrl);
        let index;
        // Excluded meshes
        for (index = 0; index < parsedHightlightLayer.excludedMeshes.length; index++) {
            const mesh = scene.getMeshById(parsedHightlightLayer.excludedMeshes[index]);
            if (mesh) {
                hl.addExcludedMesh(mesh);
            }
        }
        // Included meshes
        for (index = 0; index < parsedHightlightLayer.meshes.length; index++) {
            const highlightedMesh = parsedHightlightLayer.meshes[index];
            const mesh = scene.getMeshById(highlightedMesh.meshId);
            if (mesh) {
                hl.addMesh(mesh, math_color/* Color3 */.v9.FromArray(highlightedMesh.color), highlightedMesh.glowEmissiveOnly);
            }
        }
        return hl;
    }
}
/**
 * Effect Name of the highlight layer.
 */
HighlightLayer.EffectName = "HighlightLayer";
/**
 * The neutral color used during the preparation of the glow effect.
 * This is black by default as the blend operation is a blend operation.
 */
HighlightLayer.NeutralColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
/**
 * Stencil value used for glowing meshes.
 */
HighlightLayer.GlowingMeshStencilReference = 0x02;
/**
 * Stencil value used for the other meshes in the scene.
 */
HighlightLayer.NormalMeshStencilReference = 0x01;
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], HighlightLayer.prototype, "innerGlow", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], HighlightLayer.prototype, "outerGlow", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], HighlightLayer.prototype, "blurHorizontalSize", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], HighlightLayer.prototype, "blurVerticalSize", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("options")
], HighlightLayer.prototype, "_options", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.HighlightLayer", HighlightLayer);
//# sourceMappingURL=highlightLayer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Layers/layer.js
var Layers_layer = __webpack_require__(22230);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Layers/layerSceneComponent.js
var layerSceneComponent = __webpack_require__(75561);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/glowMapGeneration.fragment.js
var glowMapGeneration_fragment = __webpack_require__(83234);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/glowMapGeneration.vertex.js
var glowMapGeneration_vertex = __webpack_require__(50136);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/glowMapGeneration.fragment.js
var ShadersWGSL_glowMapGeneration_fragment = __webpack_require__(19073);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/glowMapGeneration.vertex.js
var ShadersWGSL_glowMapGeneration_vertex = __webpack_require__(48267);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/glowMapMerge.fragment.js
var glowMapMerge_fragment = __webpack_require__(99858);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/glowMapMerge.vertex.js
var glowMapMerge_vertex = __webpack_require__(41288);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/glowBlurPostProcess.fragment.js
var glowBlurPostProcess_fragment = __webpack_require__(57094);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/glowMapMerge.fragment.js
var ShadersWGSL_glowMapMerge_fragment = __webpack_require__(22147);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/glowMapMerge.vertex.js
var ShadersWGSL_glowMapMerge_vertex = __webpack_require__(7101);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/glowBlurPostProcess.fragment.js
var ShadersWGSL_glowBlurPostProcess_fragment = __webpack_require__(82937);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/layer.fragment.js
var layer_fragment = __webpack_require__(35256);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/layer.vertex.js
var layer_vertex = __webpack_require__(22614);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/layer.fragment.js
var ShadersWGSL_layer_fragment = __webpack_require__(70711);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/layer.vertex.js
var ShadersWGSL_layer_vertex = __webpack_require__(16913);
;// ./node_modules/@babylonjs/core/Layers/index.js






// EffectLayer




// Highlights






// Layers shaders




//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/LensFlares/lensFlare.js





/**
 * This represents one of the lens effect in a `lensFlareSystem`.
 * It controls one of the individual texture used in the effect.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
 */
class LensFlare {
    /**
     * Creates a new Lens Flare.
     * This represents one of the lens effect in a `lensFlareSystem`.
     * It controls one of the individual texture used in the effect.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
     * @param size Define the size of the lens flare (a floating value between 0 and 1)
     * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
     * @param color Define the lens color
     * @param imgUrl Define the lens texture url
     * @param system Define the `lensFlareSystem` this flare is part of
     * @returns The newly created Lens Flare
     */
    static AddFlare(size, position, color, imgUrl, system) {
        return new LensFlare(size, position, color, imgUrl, system);
    }
    /**
     * Instantiates a new Lens Flare.
     * This represents one of the lens effect in a `lensFlareSystem`.
     * It controls one of the individual texture used in the effect.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
     * @param size Define the size of the lens flare in the system (a floating value between 0 and 1)
     * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
     * @param color Define the lens color
     * @param imgUrl Define the lens texture url
     * @param system Define the `lensFlareSystem` this flare is part of
     */
    constructor(
    /**
     * Define the size of the lens flare in the system (a floating value between 0 and 1)
     */
    size, 
    /**
     * Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
     */
    position, color, imgUrl, system) {
        this.size = size;
        this.position = position;
        /**
         * Define the alpha mode to render this particular lens.
         */
        this.alphaMode = 6;
        this.color = color || new math_color/* Color3 */.v9(1, 1, 1);
        this.texture = imgUrl ? new Textures_texture/* Texture */.g(imgUrl, system.getScene(), true) : null;
        this._system = system;
        const engine = system.scene.getEngine();
        system._onShadersLoaded.addOnce(() => {
            this._drawWrapper = new Materials_drawWrapper/* DrawWrapper */.E(engine);
            this._drawWrapper.effect = engine.createEffect("lensFlare", [Buffers_buffer/* VertexBuffer */.R.PositionKind], ["color", "viewportMatrix"], ["textureSampler"], "", undefined, undefined, undefined, undefined, system.shaderLanguage);
        });
        system.lensFlares.push(this);
    }
    /**
     * Dispose and release the lens flare with its associated resources.
     */
    dispose() {
        if (this.texture) {
            this.texture.dispose();
        }
        // Remove from scene
        const index = this._system.lensFlares.indexOf(this);
        this._system.lensFlares.splice(index, 1);
    }
}
//# sourceMappingURL=lensFlare.js.map
;// ./node_modules/@babylonjs/core/LensFlares/lensFlareSystem.js












/**
 * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
 * It is usually composed of several `lensFlare`.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
 */
class LensFlareSystem {
    /** Gets the scene */
    get scene() {
        return this._scene;
    }
    /**
     * Gets the shader language used in this system.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Instantiates a lens flare system.
     * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
     * It is usually composed of several `lensFlare`.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
     * @param name Define the name of the lens flare system in the scene
     * @param emitter Define the source (the emitter) of the lens flares (it can be a camera, a light or a mesh).
     * @param scene Define the scene the lens flare system belongs to
     */
    constructor(
    /**
     * Define the name of the lens flare system
     */
    name, emitter, scene) {
        this.name = name;
        /**
         * List of lens flares used in this system.
         */
        this.lensFlares = [];
        /**
         * Define a limit from the border the lens flare can be visible.
         */
        this.borderLimit = 300;
        /**
         * Define a viewport border we do not want to see the lens flare in.
         */
        this.viewportBorder = 0;
        /**
         * Restricts the rendering of the effect to only the camera rendering this layer mask.
         */
        this.layerMask = 0x0fffffff;
        /** Shader language used by the system */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._vertexBuffers = {};
        this._isEnabled = true;
        /** @internal */
        this._onShadersLoaded = new Misc_observable/* Observable */.cP(undefined, true);
        this._shadersLoaded = false;
        this._scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        LensFlareSystem._SceneComponentInitialization(this._scene);
        this._emitter = emitter;
        this.id = name;
        scene.lensFlareSystems.push(this);
        this.meshesSelectionPredicate = (m) => (scene.activeCamera && m.material && m.isVisible && m.isEnabled() && m.isBlocker && (m.layerMask & scene.activeCamera.layerMask) != 0);
        const engine = scene.getEngine();
        // VBO
        const vertices = [];
        vertices.push(1, 1);
        vertices.push(-1, 1);
        vertices.push(-1, -1);
        vertices.push(1, -1);
        this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = new Buffers_buffer/* VertexBuffer */.R(engine, vertices, Buffers_buffer/* VertexBuffer */.R.PositionKind, false, false, 2);
        // Indices
        this._createIndexBuffer();
        this._initShaderSourceAsync();
    }
    async _initShaderSourceAsync() {
        const engine = this._scene.getEngine();
        if (engine.isWebGPU && !LensFlareSystem.ForceGLSL) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 53880)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 59382))]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 5823)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 70633))]);
        }
        this._shadersLoaded = true;
        this._onShadersLoaded.notifyObservers();
    }
    _createIndexBuffer() {
        const indices = [];
        indices.push(0);
        indices.push(1);
        indices.push(2);
        indices.push(0);
        indices.push(2);
        indices.push(3);
        this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);
    }
    /**
     * Define if the lens flare system is enabled.
     */
    get isEnabled() {
        return this._isEnabled;
    }
    set isEnabled(value) {
        this._isEnabled = value;
    }
    /**
     * Get the scene the effects belongs to.
     * @returns the scene holding the lens flare system
     */
    getScene() {
        return this._scene;
    }
    /**
     * Get the emitter of the lens flare system.
     * It defines the source of the lens flares (it can be a camera, a light or a mesh).
     * @returns the emitter of the lens flare system
     */
    getEmitter() {
        return this._emitter;
    }
    /**
     * Set the emitter of the lens flare system.
     * It defines the source of the lens flares (it can be a camera, a light or a mesh).
     * @param newEmitter Define the new emitter of the system
     */
    setEmitter(newEmitter) {
        this._emitter = newEmitter;
    }
    /**
     * Get the lens flare system emitter position.
     * The emitter defines the source of the lens flares (it can be a camera, a light or a mesh).
     * @returns the position
     */
    getEmitterPosition() {
        return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;
    }
    /**
     * @internal
     */
    computeEffectivePosition(globalViewport) {
        let position = this.getEmitterPosition();
        position = math_vector/* Vector3 */.Pq.Project(position, math_vector/* Matrix */.uq.Identity(), this._scene.getTransformMatrix(), globalViewport);
        this._positionX = position.x;
        this._positionY = position.y;
        position = math_vector/* Vector3 */.Pq.TransformCoordinates(this.getEmitterPosition(), this._scene.getViewMatrix());
        if (this.viewportBorder > 0) {
            globalViewport.x -= this.viewportBorder;
            globalViewport.y -= this.viewportBorder;
            globalViewport.width += this.viewportBorder * 2;
            globalViewport.height += this.viewportBorder * 2;
            position.x += this.viewportBorder;
            position.y += this.viewportBorder;
            this._positionX += this.viewportBorder;
            this._positionY += this.viewportBorder;
        }
        const rhs = this._scene.useRightHandedSystem;
        const okZ = (position.z > 0 && !rhs) || (position.z < 0 && rhs);
        if (okZ) {
            if (this._positionX > globalViewport.x && this._positionX < globalViewport.x + globalViewport.width) {
                if (this._positionY > globalViewport.y && this._positionY < globalViewport.y + globalViewport.height) {
                    return true;
                }
            }
            return true;
        }
        return false;
    }
    /** @internal */
    _isVisible() {
        if (!this._isEnabled || !this._scene.activeCamera) {
            return false;
        }
        const emitterPosition = this.getEmitterPosition();
        const direction = emitterPosition.subtract(this._scene.activeCamera.globalPosition);
        const distance = direction.length();
        direction.normalize();
        const ray = new Culling_ray/* Ray */.Rl(this._scene.activeCamera.globalPosition, direction);
        const pickInfo = this._scene.pickWithRay(ray, this.meshesSelectionPredicate, true);
        return !pickInfo || !pickInfo.hit || pickInfo.distance > distance;
    }
    /**
     * @internal
     */
    render() {
        if (!this._scene.activeCamera || !this._shadersLoaded) {
            return false;
        }
        const engine = this._scene.getEngine();
        const viewport = this._scene.activeCamera.viewport;
        const globalViewport = viewport.toGlobal(engine.getRenderWidth(true), engine.getRenderHeight(true));
        // Position
        if (!this.computeEffectivePosition(globalViewport)) {
            return false;
        }
        // Visibility
        if (!this._isVisible()) {
            return false;
        }
        // Intensity
        let awayX;
        let awayY;
        if (this._positionX < this.borderLimit + globalViewport.x) {
            awayX = this.borderLimit + globalViewport.x - this._positionX;
        }
        else if (this._positionX > globalViewport.x + globalViewport.width - this.borderLimit) {
            awayX = this._positionX - globalViewport.x - globalViewport.width + this.borderLimit;
        }
        else {
            awayX = 0;
        }
        if (this._positionY < this.borderLimit + globalViewport.y) {
            awayY = this.borderLimit + globalViewport.y - this._positionY;
        }
        else if (this._positionY > globalViewport.y + globalViewport.height - this.borderLimit) {
            awayY = this._positionY - globalViewport.y - globalViewport.height + this.borderLimit;
        }
        else {
            awayY = 0;
        }
        let away = awayX > awayY ? awayX : awayY;
        away -= this.viewportBorder;
        if (away > this.borderLimit) {
            away = this.borderLimit;
        }
        let intensity = 1.0 - (0,math_scalar_functions.Clamp)(away / this.borderLimit, 0, 1);
        if (intensity < 0) {
            return false;
        }
        if (intensity > 1.0) {
            intensity = 1.0;
        }
        if (this.viewportBorder > 0) {
            globalViewport.x += this.viewportBorder;
            globalViewport.y += this.viewportBorder;
            globalViewport.width -= this.viewportBorder * 2;
            globalViewport.height -= this.viewportBorder * 2;
            this._positionX -= this.viewportBorder;
            this._positionY -= this.viewportBorder;
        }
        // Position
        const centerX = globalViewport.x + globalViewport.width / 2;
        const centerY = globalViewport.y + globalViewport.height / 2;
        const distX = centerX - this._positionX;
        const distY = centerY - this._positionY;
        // Effects
        engine.setState(false);
        engine.setDepthBuffer(false);
        // Flares
        for (let index = 0; index < this.lensFlares.length; index++) {
            const flare = this.lensFlares[index];
            if (!flare._drawWrapper.effect.isReady() || (flare.texture && !flare.texture.isReady())) {
                continue;
            }
            engine.enableEffect(flare._drawWrapper);
            engine.bindBuffers(this._vertexBuffers, this._indexBuffer, flare._drawWrapper.effect);
            engine.setAlphaMode(flare.alphaMode);
            const x = centerX - distX * flare.position;
            const y = centerY - distY * flare.position;
            const cw = flare.size;
            const ch = flare.size * engine.getAspectRatio(this._scene.activeCamera, true);
            const cx = 2 * ((x - globalViewport.x) / globalViewport.width) - 1.0;
            const cy = 1.0 - 2 * ((y - globalViewport.y) / globalViewport.height);
            const viewportMatrix = math_vector/* Matrix */.uq.FromValues(cw / 2, 0, 0, 0, 0, ch / 2, 0, 0, 0, 0, 1, 0, cx, cy, 0, 1);
            flare._drawWrapper.effect.setMatrix("viewportMatrix", viewportMatrix);
            // Texture
            flare._drawWrapper.effect.setTexture("textureSampler", flare.texture);
            // Color
            flare._drawWrapper.effect.setFloat4("color", flare.color.r * intensity, flare.color.g * intensity, flare.color.b * intensity, 1.0);
            // Draw order
            engine.drawElementsType(Materials_material/* Material */.i.TriangleFillMode, 0, 6);
        }
        engine.setDepthBuffer(true);
        engine.setAlphaMode(0);
        return true;
    }
    /**
     * Rebuilds the lens flare system
     */
    rebuild() {
        this._createIndexBuffer();
        for (const key in this._vertexBuffers) {
            this._vertexBuffers[key]?._rebuild();
        }
    }
    /**
     * Dispose and release the lens flare with its associated resources.
     */
    dispose() {
        this._onShadersLoaded.clear();
        const vertexBuffer = this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind];
        if (vertexBuffer) {
            vertexBuffer.dispose();
            this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = null;
        }
        if (this._indexBuffer) {
            this._scene.getEngine()._releaseBuffer(this._indexBuffer);
            this._indexBuffer = null;
        }
        while (this.lensFlares.length) {
            this.lensFlares[0].dispose();
        }
        // Remove from scene
        const index = this._scene.lensFlareSystems.indexOf(this);
        this._scene.lensFlareSystems.splice(index, 1);
    }
    /**
     * Parse a lens flare system from a JSON representation
     * @param parsedLensFlareSystem Define the JSON to parse
     * @param scene Define the scene the parsed system should be instantiated in
     * @param rootUrl Define the rootUrl of the load sequence to easily find a load relative dependencies such as textures
     * @returns the parsed system
     */
    static Parse(parsedLensFlareSystem, scene, rootUrl) {
        const emitter = scene.getLastEntryById(parsedLensFlareSystem.emitterId);
        const name = parsedLensFlareSystem.name || "lensFlareSystem#" + parsedLensFlareSystem.emitterId;
        const lensFlareSystem = new LensFlareSystem(name, emitter, scene);
        lensFlareSystem.id = parsedLensFlareSystem.id || name;
        lensFlareSystem.borderLimit = parsedLensFlareSystem.borderLimit;
        for (let index = 0; index < parsedLensFlareSystem.flares.length; index++) {
            const parsedFlare = parsedLensFlareSystem.flares[index];
            LensFlare.AddFlare(parsedFlare.size, parsedFlare.position, math_color/* Color3 */.v9.FromArray(parsedFlare.color), parsedFlare.textureName ? rootUrl + parsedFlare.textureName : "", lensFlareSystem);
        }
        return lensFlareSystem;
    }
    /**
     * Serialize the current Lens Flare System into a JSON representation.
     * @returns the serialized JSON
     */
    serialize() {
        const serializationObject = {};
        serializationObject.id = this.id;
        serializationObject.name = this.name;
        serializationObject.emitterId = this.getEmitter().id;
        serializationObject.borderLimit = this.borderLimit;
        serializationObject.flares = [];
        for (let index = 0; index < this.lensFlares.length; index++) {
            const flare = this.lensFlares[index];
            serializationObject.flares.push({
                size: flare.size,
                position: flare.position,
                color: flare.color.asArray(),
                textureName: tools/* Tools */.S0.GetFilename(flare.texture ? flare.texture.name : ""),
            });
        }
        return serializationObject;
    }
}
/**
 * Force all the lens flare systems to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
LensFlareSystem.ForceGLSL = false;
/**
 * @internal
 */
LensFlareSystem._SceneComponentInitialization = (_) => {
    throw (0,devTools/* _WarnImport */.n)("LensFlareSystemSceneComponent");
};
//# sourceMappingURL=lensFlareSystem.js.map
;// ./node_modules/@babylonjs/core/LensFlares/lensFlareSystemSceneComponent.js





// Adds the parser to the scene parsers.
(0,babylonFileParser_function/* AddParser */.ji)(sceneComponent/* SceneComponentConstants */.v.NAME_LENSFLARESYSTEM, (parsedData, scene, container, rootUrl) => {
    // Lens flares
    if (parsedData.lensFlareSystems !== undefined && parsedData.lensFlareSystems !== null) {
        if (!container.lensFlareSystems) {
            container.lensFlareSystems = [];
        }
        for (let index = 0, cache = parsedData.lensFlareSystems.length; index < cache; index++) {
            const parsedLensFlareSystem = parsedData.lensFlareSystems[index];
            const lf = LensFlareSystem.Parse(parsedLensFlareSystem, scene, rootUrl);
            container.lensFlareSystems.push(lf);
        }
    }
});
core_scene/* Scene */.Z.prototype.getLensFlareSystemByName = function (name) {
    for (let index = 0; index < this.lensFlareSystems.length; index++) {
        if (this.lensFlareSystems[index].name === name) {
            return this.lensFlareSystems[index];
        }
    }
    return null;
};
core_scene/* Scene */.Z.prototype.getLensFlareSystemById = function (id) {
    for (let index = 0; index < this.lensFlareSystems.length; index++) {
        if (this.lensFlareSystems[index].id === id) {
            return this.lensFlareSystems[index];
        }
    }
    return null;
};
core_scene/* Scene */.Z.prototype.getLensFlareSystemByID = function (id) {
    return this.getLensFlareSystemById(id);
};
core_scene/* Scene */.Z.prototype.removeLensFlareSystem = function (toRemove) {
    const index = this.lensFlareSystems.indexOf(toRemove);
    if (index !== -1) {
        this.lensFlareSystems.splice(index, 1);
    }
    return index;
};
core_scene/* Scene */.Z.prototype.addLensFlareSystem = function (newLensFlareSystem) {
    this.lensFlareSystems.push(newLensFlareSystem);
};
/**
 * Defines the lens flare scene component responsible to manage any lens flares
 * in a given scene.
 */
class LensFlareSystemSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_LENSFLARESYSTEM;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM, this, this._draw);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        for (let index = 0; index < this.scene.lensFlareSystems.length; index++) {
            this.scene.lensFlareSystems[index].rebuild();
        }
    }
    /**
     * Adds all the elements from the container to the scene
     * @param container the container holding the elements
     */
    addFromContainer(container) {
        if (!container.lensFlareSystems) {
            return;
        }
        container.lensFlareSystems.forEach((o) => {
            this.scene.addLensFlareSystem(o);
        });
    }
    /**
     * Removes all the elements in the container from the scene
     * @param container contains the elements to remove
     * @param dispose if the removed element should be disposed (default: false)
     */
    removeFromContainer(container, dispose) {
        if (!container.lensFlareSystems) {
            return;
        }
        container.lensFlareSystems.forEach((o) => {
            this.scene.removeLensFlareSystem(o);
            if (dispose) {
                o.dispose();
            }
        });
    }
    /**
     * Serializes the component data to the specified json object
     * @param serializationObject The object to serialize to
     */
    serialize(serializationObject) {
        // Lens flares
        serializationObject.lensFlareSystems = [];
        const lensFlareSystems = this.scene.lensFlareSystems;
        for (const lensFlareSystem of lensFlareSystems) {
            serializationObject.lensFlareSystems.push(lensFlareSystem.serialize());
        }
    }
    /**
     * Disposes the component and the associated resources.
     */
    dispose() {
        const lensFlareSystems = this.scene.lensFlareSystems;
        while (lensFlareSystems.length) {
            lensFlareSystems[0].dispose();
        }
    }
    _draw(camera) {
        // Lens flares
        if (this.scene.lensFlaresEnabled) {
            const lensFlareSystems = this.scene.lensFlareSystems;
            tools/* Tools */.S0.StartPerformanceCounter("Lens flares", lensFlareSystems.length > 0);
            for (const lensFlareSystem of lensFlareSystems) {
                if ((camera.layerMask & lensFlareSystem.layerMask) !== 0) {
                    lensFlareSystem.render();
                }
            }
            tools/* Tools */.S0.EndPerformanceCounter("Lens flares", lensFlareSystems.length > 0);
        }
    }
}
LensFlareSystem._SceneComponentInitialization = (scene) => {
    let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_LENSFLARESYSTEM);
    if (!component) {
        component = new LensFlareSystemSceneComponent(scene);
        scene._addComponent(component);
    }
};
//# sourceMappingURL=lensFlareSystemSceneComponent.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/lensFlare.fragment.js
var lensFlare_fragment = __webpack_require__(5823);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/lensFlare.vertex.js
var lensFlare_vertex = __webpack_require__(70633);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/lensFlare.fragment.js
var ShadersWGSL_lensFlare_fragment = __webpack_require__(53880);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/lensFlare.vertex.js
var ShadersWGSL_lensFlare_vertex = __webpack_require__(59382);
;// ./node_modules/@babylonjs/core/LensFlares/index.js







//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/light.js
var Lights_light = __webpack_require__(64704);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/shadowLight.js
var shadowLight = __webpack_require__(83316);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Rendering/renderingManager.js
var renderingManager = __webpack_require__(15808);
;// ./node_modules/@babylonjs/core/Lights/Shadows/shadowGenerator.js
















/**
 * Default implementation IShadowGenerator.
 * This is the main object responsible of generating shadows in the framework.
 * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
 * #IFYDRS#0: WebGL
 * #IFYDRS#835: WebGPU
 */
class ShadowGenerator {
    /**
     * Gets the bias: offset applied on the depth preventing acnea (in light direction).
     */
    get bias() {
        return this._bias;
    }
    /**
     * Sets the bias: offset applied on the depth preventing acnea (in light direction).
     */
    set bias(bias) {
        this._bias = bias;
    }
    /**
     * Gets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).
     */
    get normalBias() {
        return this._normalBias;
    }
    /**
     * Sets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).
     */
    set normalBias(normalBias) {
        this._normalBias = normalBias;
    }
    /**
     * Gets the blur box offset: offset applied during the blur pass.
     * Only useful if useKernelBlur = false
     */
    get blurBoxOffset() {
        return this._blurBoxOffset;
    }
    /**
     * Sets the blur box offset: offset applied during the blur pass.
     * Only useful if useKernelBlur = false
     */
    set blurBoxOffset(value) {
        if (this._blurBoxOffset === value) {
            return;
        }
        this._blurBoxOffset = value;
        this._disposeBlurPostProcesses();
    }
    /**
     * Gets the blur scale: scale of the blurred texture compared to the main shadow map.
     * 2 means half of the size.
     */
    get blurScale() {
        return this._blurScale;
    }
    /**
     * Sets the blur scale: scale of the blurred texture compared to the main shadow map.
     * 2 means half of the size.
     */
    set blurScale(value) {
        if (this._blurScale === value) {
            return;
        }
        this._blurScale = value;
        this._disposeBlurPostProcesses();
    }
    /**
     * Gets the blur kernel: kernel size of the blur pass.
     * Only useful if useKernelBlur = true
     */
    get blurKernel() {
        return this._blurKernel;
    }
    /**
     * Sets the blur kernel: kernel size of the blur pass.
     * Only useful if useKernelBlur = true
     */
    set blurKernel(value) {
        if (this._blurKernel === value) {
            return;
        }
        this._blurKernel = value;
        this._disposeBlurPostProcesses();
    }
    /**
     * Gets whether the blur pass is a kernel blur (if true) or box blur.
     * Only useful in filtered mode (useBlurExponentialShadowMap...)
     */
    get useKernelBlur() {
        return this._useKernelBlur;
    }
    /**
     * Sets whether the blur pass is a kernel blur (if true) or box blur.
     * Only useful in filtered mode (useBlurExponentialShadowMap...)
     */
    set useKernelBlur(value) {
        if (this._useKernelBlur === value) {
            return;
        }
        this._useKernelBlur = value;
        this._disposeBlurPostProcesses();
    }
    /**
     * Gets the depth scale used in ESM mode.
     */
    get depthScale() {
        return this._depthScale !== undefined ? this._depthScale : this._light.getDepthScale();
    }
    /**
     * Sets the depth scale used in ESM mode.
     * This can override the scale stored on the light.
     */
    set depthScale(value) {
        this._depthScale = value;
    }
    _validateFilter(filter) {
        return filter;
    }
    /**
     * Gets the current mode of the shadow generator (normal, PCF, ESM...).
     * The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE
     */
    get filter() {
        return this._filter;
    }
    /**
     * Sets the current mode of the shadow generator (normal, PCF, ESM...).
     * The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE
     */
    set filter(value) {
        value = this._validateFilter(value);
        // Blurring the cubemap is going to be too expensive. Reverting to unblurred version
        if (this._light.needCube()) {
            if (value === ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP) {
                this.useExponentialShadowMap = true;
                return;
            }
            else if (value === ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) {
                this.useCloseExponentialShadowMap = true;
                return;
            }
            // PCF on cubemap would also be expensive
            else if (value === ShadowGenerator.FILTER_PCF || value === ShadowGenerator.FILTER_PCSS) {
                this.usePoissonSampling = true;
                return;
            }
        }
        // Weblg1 fallback for PCF.
        if (value === ShadowGenerator.FILTER_PCF || value === ShadowGenerator.FILTER_PCSS) {
            if (!this._scene.getEngine()._features.supportShadowSamplers) {
                this.usePoissonSampling = true;
                return;
            }
        }
        if (this._filter === value) {
            return;
        }
        this._filter = value;
        this._disposeBlurPostProcesses();
        this._applyFilterValues();
        this._light._markMeshesAsLightDirty();
    }
    /**
     * Gets if the current filter is set to Poisson Sampling.
     */
    get usePoissonSampling() {
        return this.filter === ShadowGenerator.FILTER_POISSONSAMPLING;
    }
    /**
     * Sets the current filter to Poisson Sampling.
     */
    set usePoissonSampling(value) {
        const filter = this._validateFilter(ShadowGenerator.FILTER_POISSONSAMPLING);
        if (!value && this.filter !== ShadowGenerator.FILTER_POISSONSAMPLING) {
            return;
        }
        this.filter = value ? filter : ShadowGenerator.FILTER_NONE;
    }
    /**
     * Gets if the current filter is set to ESM.
     */
    get useExponentialShadowMap() {
        return this.filter === ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP;
    }
    /**
     * Sets the current filter is to ESM.
     */
    set useExponentialShadowMap(value) {
        const filter = this._validateFilter(ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP);
        if (!value && this.filter !== ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP) {
            return;
        }
        this.filter = value ? filter : ShadowGenerator.FILTER_NONE;
    }
    /**
     * Gets if the current filter is set to filtered ESM.
     */
    get useBlurExponentialShadowMap() {
        return this.filter === ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP;
    }
    /**
     * Gets if the current filter is set to filtered  ESM.
     */
    set useBlurExponentialShadowMap(value) {
        const filter = this._validateFilter(ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP);
        if (!value && this.filter !== ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP) {
            return;
        }
        this.filter = value ? filter : ShadowGenerator.FILTER_NONE;
    }
    /**
     * Gets if the current filter is set to "close ESM" (using the inverse of the
     * exponential to prevent steep falloff artifacts).
     */
    get useCloseExponentialShadowMap() {
        return this.filter === ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP;
    }
    /**
     * Sets the current filter to "close ESM" (using the inverse of the
     * exponential to prevent steep falloff artifacts).
     */
    set useCloseExponentialShadowMap(value) {
        const filter = this._validateFilter(ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP);
        if (!value && this.filter !== ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP) {
            return;
        }
        this.filter = value ? filter : ShadowGenerator.FILTER_NONE;
    }
    /**
     * Gets if the current filter is set to filtered "close ESM" (using the inverse of the
     * exponential to prevent steep falloff artifacts).
     */
    get useBlurCloseExponentialShadowMap() {
        return this.filter === ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP;
    }
    /**
     * Sets the current filter to filtered "close ESM" (using the inverse of the
     * exponential to prevent steep falloff artifacts).
     */
    set useBlurCloseExponentialShadowMap(value) {
        const filter = this._validateFilter(ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);
        if (!value && this.filter !== ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) {
            return;
        }
        this.filter = value ? filter : ShadowGenerator.FILTER_NONE;
    }
    /**
     * Gets if the current filter is set to "PCF" (percentage closer filtering).
     */
    get usePercentageCloserFiltering() {
        return this.filter === ShadowGenerator.FILTER_PCF;
    }
    /**
     * Sets the current filter to "PCF" (percentage closer filtering).
     */
    set usePercentageCloserFiltering(value) {
        const filter = this._validateFilter(ShadowGenerator.FILTER_PCF);
        if (!value && this.filter !== ShadowGenerator.FILTER_PCF) {
            return;
        }
        this.filter = value ? filter : ShadowGenerator.FILTER_NONE;
    }
    /**
     * Gets the PCF or PCSS Quality.
     * Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.
     */
    get filteringQuality() {
        return this._filteringQuality;
    }
    /**
     * Sets the PCF or PCSS Quality.
     * Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.
     */
    set filteringQuality(filteringQuality) {
        if (this._filteringQuality === filteringQuality) {
            return;
        }
        this._filteringQuality = filteringQuality;
        this._disposeBlurPostProcesses();
        this._applyFilterValues();
        this._light._markMeshesAsLightDirty();
    }
    /**
     * Gets if the current filter is set to "PCSS" (contact hardening).
     */
    get useContactHardeningShadow() {
        return this.filter === ShadowGenerator.FILTER_PCSS;
    }
    /**
     * Sets the current filter to "PCSS" (contact hardening).
     */
    set useContactHardeningShadow(value) {
        const filter = this._validateFilter(ShadowGenerator.FILTER_PCSS);
        if (!value && this.filter !== ShadowGenerator.FILTER_PCSS) {
            return;
        }
        this.filter = value ? filter : ShadowGenerator.FILTER_NONE;
    }
    /**
     * Gets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.
     * Using a ratio helps keeping shape stability independently of the map size.
     *
     * It does not account for the light projection as it was having too much
     * instability during the light setup or during light position changes.
     *
     * Only valid if useContactHardeningShadow is true.
     */
    get contactHardeningLightSizeUVRatio() {
        return this._contactHardeningLightSizeUVRatio;
    }
    /**
     * Sets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.
     * Using a ratio helps keeping shape stability independently of the map size.
     *
     * It does not account for the light projection as it was having too much
     * instability during the light setup or during light position changes.
     *
     * Only valid if useContactHardeningShadow is true.
     */
    set contactHardeningLightSizeUVRatio(contactHardeningLightSizeUVRatio) {
        this._contactHardeningLightSizeUVRatio = contactHardeningLightSizeUVRatio;
    }
    /** Gets or sets the actual darkness of a shadow */
    get darkness() {
        return this._darkness;
    }
    set darkness(value) {
        this.setDarkness(value);
    }
    /**
     * Returns the darkness value (float). This can only decrease the actual darkness of a shadow.
     * 0 means strongest and 1 would means no shadow.
     * @returns the darkness.
     */
    getDarkness() {
        return this._darkness;
    }
    /**
     * Sets the darkness value (float). This can only decrease the actual darkness of a shadow.
     * @param darkness The darkness value 0 means strongest and 1 would means no shadow.
     * @returns the shadow generator allowing fluent coding.
     */
    setDarkness(darkness) {
        if (darkness >= 1.0) {
            this._darkness = 1.0;
        }
        else if (darkness <= 0.0) {
            this._darkness = 0.0;
        }
        else {
            this._darkness = darkness;
        }
        return this;
    }
    /** Gets or sets the ability to have transparent shadow  */
    get transparencyShadow() {
        return this._transparencyShadow;
    }
    set transparencyShadow(value) {
        this.setTransparencyShadow(value);
    }
    /**
     * Sets the ability to have transparent shadow (boolean).
     * @param transparent True if transparent else False
     * @returns the shadow generator allowing fluent coding
     */
    setTransparencyShadow(transparent) {
        this._transparencyShadow = transparent;
        return this;
    }
    /**
     * Gets the main RTT containing the shadow map (usually storing depth from the light point of view).
     * @returns The render target texture if present otherwise, null
     */
    getShadowMap() {
        return this._shadowMap;
    }
    /**
     * Gets the RTT used during rendering (can be a blurred version of the shadow map or the shadow map itself).
     * @returns The render target texture if the shadow map is present otherwise, null
     */
    getShadowMapForRendering() {
        if (this._shadowMap2) {
            return this._shadowMap2;
        }
        return this._shadowMap;
    }
    /**
     * Gets the class name of that object
     * @returns "ShadowGenerator"
     */
    getClassName() {
        return ShadowGenerator.CLASSNAME;
    }
    /**
     * Helper function to add a mesh and its descendants to the list of shadow casters.
     * @param mesh Mesh to add
     * @param includeDescendants boolean indicating if the descendants should be added. Default to true
     * @returns the Shadow Generator itself
     */
    addShadowCaster(mesh, includeDescendants = true) {
        if (!this._shadowMap) {
            return this;
        }
        if (!this._shadowMap.renderList) {
            this._shadowMap.renderList = [];
        }
        if (this._shadowMap.renderList.indexOf(mesh) === -1) {
            this._shadowMap.renderList.push(mesh);
        }
        if (includeDescendants) {
            for (const childMesh of mesh.getChildMeshes()) {
                if (this._shadowMap.renderList.indexOf(childMesh) === -1) {
                    this._shadowMap.renderList.push(childMesh);
                }
            }
        }
        return this;
    }
    /**
     * Helper function to remove a mesh and its descendants from the list of shadow casters
     * @param mesh Mesh to remove
     * @param includeDescendants boolean indicating if the descendants should be removed. Default to true
     * @returns the Shadow Generator itself
     */
    removeShadowCaster(mesh, includeDescendants = true) {
        if (!this._shadowMap || !this._shadowMap.renderList) {
            return this;
        }
        const index = this._shadowMap.renderList.indexOf(mesh);
        if (index !== -1) {
            this._shadowMap.renderList.splice(index, 1);
        }
        if (includeDescendants) {
            for (const child of mesh.getChildren()) {
                this.removeShadowCaster(child);
            }
        }
        return this;
    }
    /**
     * Returns the associated light object.
     * @returns the light generating the shadow
     */
    getLight() {
        return this._light;
    }
    /**
     * Gets the shader language used in this generator.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    _getCamera() {
        return this._camera ?? this._scene.activeCamera;
    }
    /**
     * Gets or sets the size of the texture what stores the shadows
     */
    get mapSize() {
        return this._mapSize;
    }
    set mapSize(size) {
        this._mapSize = size;
        this._light._markMeshesAsLightDirty();
        this.recreateShadowMap();
    }
    /**
     * Creates a ShadowGenerator object.
     * A ShadowGenerator is the required tool to use the shadows.
     * Each light casting shadows needs to use its own ShadowGenerator.
     * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
     * @param mapSize The size of the texture what stores the shadows. Example : 1024.
     * @param light The light object generating the shadows.
     * @param usefullFloatFirst By default the generator will try to use half float textures but if you need precision (for self shadowing for instance), you can use this option to enforce full float texture.
     * @param camera Camera associated with this shadow generator (default: null). If null, takes the scene active camera at the time we need to access it
     * @param useRedTextureType Forces the generator to use a Red instead of a RGBA type for the shadow map texture format (default: false)
     * @param forceGLSL defines a boolean indicating if the shader must be compiled in GLSL even if we are using WebGPU
     */
    constructor(mapSize, light, usefullFloatFirst, camera, useRedTextureType, forceGLSL = false) {
        /**
         * Observable triggered before the shadow is rendered. Can be used to update internal effect state
         */
        this.onBeforeShadowMapRenderObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable triggered after the shadow is rendered. Can be used to restore internal effect state
         */
        this.onAfterShadowMapRenderObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable triggered before a mesh is rendered in the shadow map.
         * Can be used to update internal effect state (that you can get from the onBeforeShadowMapRenderObservable)
         */
        this.onBeforeShadowMapRenderMeshObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable triggered after a mesh is rendered in the shadow map.
         * Can be used to update internal effect state (that you can get from the onAfterShadowMapRenderObservable)
         */
        this.onAfterShadowMapRenderMeshObservable = new Misc_observable/* Observable */.cP();
        this._bias = 0.00005;
        this._normalBias = 0;
        this._blurBoxOffset = 1;
        this._blurScale = 2;
        this._blurKernel = 1;
        this._useKernelBlur = false;
        this._filter = ShadowGenerator.FILTER_NONE;
        this._filteringQuality = ShadowGenerator.QUALITY_HIGH;
        this._contactHardeningLightSizeUVRatio = 0.1;
        this._darkness = 0;
        this._transparencyShadow = false;
        /**
         * Enables or disables shadows with varying strength based on the transparency
         * When it is enabled, the strength of the shadow is taken equal to mesh.visibility
         * If you enabled an alpha texture on your material, the alpha value red from the texture is also combined to compute the strength:
         *          mesh.visibility * alphaTexture.a
         * The texture used is the diffuse by default, but it can be set to the opacity by setting useOpacityTextureForTransparentShadow
         * Note that by definition transparencyShadow must be set to true for enableSoftTransparentShadow to work!
         */
        this.enableSoftTransparentShadow = false;
        /**
         * If this is true, use the opacity texture's alpha channel for transparent shadows instead of the diffuse one
         */
        this.useOpacityTextureForTransparentShadow = false;
        /**
         * Controls the extent to which the shadows fade out at the edge of the frustum
         */
        this.frustumEdgeFalloff = 0;
        /** Shader language used by the generator */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        /**
         * If true the shadow map is generated by rendering the back face of the mesh instead of the front face.
         * This can help with self-shadowing as the geometry making up the back of objects is slightly offset.
         * It might on the other hand introduce peter panning.
         */
        this.forceBackFacesOnly = false;
        this._lightDirection = math_vector/* Vector3 */.Pq.Zero();
        this._viewMatrix = math_vector/* Matrix */.uq.Zero();
        this._projectionMatrix = math_vector/* Matrix */.uq.Zero();
        this._transformMatrix = math_vector/* Matrix */.uq.Zero();
        this._cachedPosition = new math_vector/* Vector3 */.Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        this._cachedDirection = new math_vector/* Vector3 */.Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        this._currentFaceIndex = 0;
        this._currentFaceIndexCache = 0;
        this._defaultTextureMatrix = math_vector/* Matrix */.uq.Identity();
        this._shadersLoaded = false;
        this._mapSize = mapSize;
        this._light = light;
        this._scene = light.getScene();
        this._camera = camera ?? null;
        this._useRedTextureType = !!useRedTextureType;
        this._initShaderSourceAsync(forceGLSL);
        let shadowGenerators = light._shadowGenerators;
        if (!shadowGenerators) {
            shadowGenerators = light._shadowGenerators = new Map();
        }
        shadowGenerators.set(this._camera, this);
        this.id = light.id;
        this._useUBO = this._scene.getEngine().supportsUniformBuffers;
        if (this._useUBO) {
            this._sceneUBOs = [];
            this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for Shadow Generator (light "${this._light.name}")`));
        }
        ShadowGenerator._SceneComponentInitialization(this._scene);
        // Texture type fallback from float to int if not supported.
        const caps = this._scene.getEngine().getCaps();
        if (!usefullFloatFirst) {
            if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {
                this._textureType = 2;
            }
            else if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {
                this._textureType = 1;
            }
            else {
                this._textureType = 0;
            }
        }
        else {
            if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {
                this._textureType = 1;
            }
            else if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {
                this._textureType = 2;
            }
            else {
                this._textureType = 0;
            }
        }
        this._initializeGenerator();
        this._applyFilterValues();
    }
    _initializeGenerator() {
        this._light._markMeshesAsLightDirty();
        this._initializeShadowMap();
    }
    _createTargetRenderTexture() {
        const engine = this._scene.getEngine();
        if (engine._features.supportDepthStencilTexture) {
            this._shadowMap = new Textures_renderTargetTexture/* RenderTargetTexture */.$(this._light.name + "_shadowMap", this._mapSize, this._scene, false, true, this._textureType, this._light.needCube(), undefined, false, false, undefined, this._useRedTextureType ? 6 : 5);
            this._shadowMap.createDepthStencilTexture(engine.useReverseDepthBuffer ? 516 : 513, true, undefined, undefined, undefined, `DepthStencilForShadowGenerator-${this._light.name}`);
        }
        else {
            this._shadowMap = new Textures_renderTargetTexture/* RenderTargetTexture */.$(this._light.name + "_shadowMap", this._mapSize, this._scene, false, true, this._textureType, this._light.needCube());
        }
        this._shadowMap.noPrePassRenderer = true;
    }
    _initializeShadowMap() {
        this._createTargetRenderTexture();
        if (this._shadowMap === null) {
            return;
        }
        this._shadowMap.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._shadowMap.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._shadowMap.anisotropicFilteringLevel = 1;
        this._shadowMap.updateSamplingMode(Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE);
        this._shadowMap.renderParticles = false;
        this._shadowMap.ignoreCameraViewport = true;
        if (this._storedUniqueId) {
            this._shadowMap.uniqueId = this._storedUniqueId;
        }
        // Custom render function.
        this._shadowMap.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => this._renderForShadowMap(opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes);
        // Force the mesh is ready function to true as we are double checking it
        // in the custom render function. Also it prevents side effects and useless
        // shader variations in DEPTHPREPASS mode.
        this._shadowMap.customIsReadyFunction = () => {
            return true;
        };
        const engine = this._scene.getEngine();
        this._shadowMap.onBeforeBindObservable.add(() => {
            this._currentSceneUBO = this._scene.getSceneUniformBuffer();
            engine._debugPushGroup?.(`shadow map generation for pass id ${engine.currentRenderPassId}`, 1);
        });
        // Record Face Index before render.
        this._shadowMap.onBeforeRenderObservable.add((faceIndex) => {
            if (this._sceneUBOs) {
                this._scene.setSceneUniformBuffer(this._sceneUBOs[0]);
            }
            this._currentFaceIndex = faceIndex;
            if (this._filter === ShadowGenerator.FILTER_PCF) {
                engine.setColorWrite(false);
            }
            this.getTransformMatrix(); // generate the view/projection matrix
            this._scene.setTransformMatrix(this._viewMatrix, this._projectionMatrix);
            if (this._useUBO) {
                this._scene.getSceneUniformBuffer().unbindEffect();
                this._scene.finalizeSceneUbo();
            }
        });
        // Blur if required after render.
        this._shadowMap.onAfterUnbindObservable.add(() => {
            if (this._sceneUBOs) {
                this._scene.setSceneUniformBuffer(this._currentSceneUBO);
            }
            this._scene.updateTransformMatrix(); // restore the view/projection matrices of the active camera
            if (this._filter === ShadowGenerator.FILTER_PCF) {
                engine.setColorWrite(true);
            }
            if (!this.useBlurExponentialShadowMap && !this.useBlurCloseExponentialShadowMap) {
                engine._debugPopGroup?.(1);
                return;
            }
            const shadowMap = this.getShadowMapForRendering();
            if (shadowMap) {
                this._scene.postProcessManager.directRender(this._blurPostProcesses, shadowMap.renderTarget, true);
                engine.unBindFramebuffer(shadowMap.renderTarget, true);
            }
            engine._debugPopGroup?.(1);
        });
        // Clear according to the chosen filter.
        const clearZero = new math_color/* Color4 */.ov(0, 0, 0, 0);
        const clearOne = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        this._shadowMap.onClearObservable.add((engine) => {
            if (this._filter === ShadowGenerator.FILTER_PCF) {
                engine.clear(clearOne, false, true, false);
            }
            else if (this.useExponentialShadowMap || this.useBlurExponentialShadowMap) {
                engine.clear(clearZero, true, true, false);
            }
            else {
                engine.clear(clearOne, true, true, false);
            }
        });
        // Recreate on resize.
        this._shadowMap.onResizeObservable.add((rtt) => {
            this._storedUniqueId = this._shadowMap.uniqueId;
            this._mapSize = rtt.getRenderSize();
            this._light._markMeshesAsLightDirty();
            this.recreateShadowMap();
        });
        // Ensures rendering groupids do not erase the depth buffer
        // or we would lose the shadows information.
        for (let i = renderingManager/* RenderingManager */.m.MIN_RENDERINGGROUPS; i < renderingManager/* RenderingManager */.m.MAX_RENDERINGGROUPS; i++) {
            this._shadowMap.setRenderingAutoClearDepthStencil(i, false);
        }
    }
    async _initShaderSourceAsync(forceGLSL = false) {
        const engine = this._scene.getEngine();
        if (engine.isWebGPU && !forceGLSL && !ShadowGenerator.ForceGLSL) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 87428)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 32303)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 10355)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 95799)),
            ]);
        }
        else {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 70169)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 29468)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 69386)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85426)),
            ]);
        }
        this._shadersLoaded = true;
    }
    _initializeBlurRTTAndPostProcesses() {
        const engine = this._scene.getEngine();
        const targetSize = this._mapSize / this.blurScale;
        if (!this.useKernelBlur || this.blurScale !== 1.0) {
            this._shadowMap2 = new Textures_renderTargetTexture/* RenderTargetTexture */.$(this._light.name + "_shadowMap2", targetSize, this._scene, false, true, this._textureType, undefined, undefined, false);
            this._shadowMap2.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
            this._shadowMap2.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
            this._shadowMap2.updateSamplingMode(Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE);
        }
        if (this.useKernelBlur) {
            this._kernelBlurXPostprocess = new BlurPostProcess(this._light.name + "KernelBlurX", new math_vector/* Vector2 */.I9(1, 0), this.blurKernel, 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, this._textureType);
            this._kernelBlurXPostprocess.width = targetSize;
            this._kernelBlurXPostprocess.height = targetSize;
            this._kernelBlurXPostprocess.externalTextureSamplerBinding = true;
            this._kernelBlurXPostprocess.onApplyObservable.add((effect) => {
                effect.setTexture("textureSampler", this._shadowMap);
            });
            this._kernelBlurYPostprocess = new BlurPostProcess(this._light.name + "KernelBlurY", new math_vector/* Vector2 */.I9(0, 1), this.blurKernel, 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, this._textureType);
            this._kernelBlurXPostprocess.autoClear = false;
            this._kernelBlurYPostprocess.autoClear = false;
            if (this._textureType === 0) {
                this._kernelBlurXPostprocess.packedFloat = true;
                this._kernelBlurYPostprocess.packedFloat = true;
            }
            this._blurPostProcesses = [this._kernelBlurXPostprocess, this._kernelBlurYPostprocess];
        }
        else {
            this._boxBlurPostprocess = new PostProcesses_postProcess/* PostProcess */.w(this._light.name + "DepthBoxBlur", "depthBoxBlur", ["screenSize", "boxOffset"], [], 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, "#define OFFSET " + this._blurBoxOffset, this._textureType, undefined, undefined, undefined, undefined, this._shaderLanguage);
            this._boxBlurPostprocess.externalTextureSamplerBinding = true;
            this._boxBlurPostprocess.onApplyObservable.add((effect) => {
                effect.setFloat2("screenSize", targetSize, targetSize);
                effect.setTexture("textureSampler", this._shadowMap);
            });
            this._boxBlurPostprocess.autoClear = false;
            this._blurPostProcesses = [this._boxBlurPostprocess];
        }
    }
    _renderForShadowMap(opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) {
        let index;
        if (depthOnlySubMeshes.length) {
            for (index = 0; index < depthOnlySubMeshes.length; index++) {
                this._renderSubMeshForShadowMap(depthOnlySubMeshes.data[index]);
            }
        }
        for (index = 0; index < opaqueSubMeshes.length; index++) {
            this._renderSubMeshForShadowMap(opaqueSubMeshes.data[index]);
        }
        for (index = 0; index < alphaTestSubMeshes.length; index++) {
            this._renderSubMeshForShadowMap(alphaTestSubMeshes.data[index]);
        }
        if (this._transparencyShadow) {
            for (index = 0; index < transparentSubMeshes.length; index++) {
                this._renderSubMeshForShadowMap(transparentSubMeshes.data[index], true);
            }
        }
        else {
            for (index = 0; index < transparentSubMeshes.length; index++) {
                transparentSubMeshes.data[index].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = false;
            }
        }
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect, mesh) {
        effect.setMatrix("viewProjection", this.getTransformMatrix());
    }
    _renderSubMeshForShadowMap(subMesh, isTransparent = false) {
        const renderingMesh = subMesh.getRenderingMesh();
        const effectiveMesh = subMesh.getEffectiveMesh();
        const scene = this._scene;
        const engine = scene.getEngine();
        const material = subMesh.getMaterial();
        effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = false;
        if (!material || subMesh.verticesCount === 0 || subMesh._renderId === scene.getRenderId()) {
            return;
        }
        // Culling
        // Note:
        // In rhs mode, we assume that meshes will be rendered in right-handed space (i.e. with an RHS camera), so the default value of material.sideOrientation is updated accordingly (see material constructor).
        // However, when generating a shadow map, we render from the point of view of the light, whose view/projection matrices are always in lhs mode.
        // We therefore need to "undo" the sideOrientation inversion that was previously performed when constructing the material.
        const useRHS = scene.useRightHandedSystem;
        const detNeg = effectiveMesh._getWorldMatrixDeterminant() < 0;
        let sideOrientation = material._getEffectiveOrientation(renderingMesh);
        if ((detNeg && !useRHS) || (!detNeg && useRHS)) {
            sideOrientation =
                sideOrientation === 0 ? 1 : 0;
        }
        const reverseSideOrientation = sideOrientation === 0;
        engine.setState(material.backFaceCulling, undefined, undefined, reverseSideOrientation, material.cullBackFaces);
        // Managing instances
        const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());
        if (batch.mustReturn) {
            return;
        }
        const hardwareInstancedRendering = engine.getCaps().instancedArrays &&
            ((batch.visibleInstances[subMesh._id] !== null && batch.visibleInstances[subMesh._id] !== undefined) || renderingMesh.hasThinInstances);
        if (this.customAllowRendering && !this.customAllowRendering(subMesh)) {
            return;
        }
        if (this.isReady(subMesh, hardwareInstancedRendering, isTransparent)) {
            subMesh._renderId = scene.getRenderId();
            const shadowDepthWrapper = material.shadowDepthWrapper;
            const drawWrapper = shadowDepthWrapper?.getEffect(subMesh, this, engine.currentRenderPassId) ?? subMesh._getDrawWrapper();
            const effect = Materials_drawWrapper/* DrawWrapper */.E.GetEffect(drawWrapper);
            engine.enableEffect(drawWrapper);
            if (!hardwareInstancedRendering) {
                renderingMesh._bind(subMesh, effect, material.fillMode);
            }
            this.getTransformMatrix(); // make sure _cachedDirection et _cachedPosition are up to date
            effect.setFloat3("biasAndScaleSM", this.bias, this.normalBias, this.depthScale);
            if (this.getLight().getTypeID() === Lights_light/* Light */.v.LIGHTTYPEID_DIRECTIONALLIGHT) {
                effect.setVector3("lightDataSM", this._cachedDirection);
            }
            else {
                effect.setVector3("lightDataSM", this._cachedPosition);
            }
            const camera = this._getCamera();
            if (camera) {
                effect.setFloat2("depthValuesSM", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera));
            }
            if (isTransparent && this.enableSoftTransparentShadow) {
                effect.setFloat2("softTransparentShadowSM", effectiveMesh.visibility * material.alpha, this._opacityTexture?.getAlphaFromRGB ? 1 : 0);
            }
            if (shadowDepthWrapper) {
                subMesh._setMainDrawWrapperOverride(drawWrapper);
                if (shadowDepthWrapper.standalone) {
                    shadowDepthWrapper.baseMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), renderingMesh, subMesh);
                }
                else {
                    material.bindForSubMesh(effectiveMesh.getWorldMatrix(), renderingMesh, subMesh);
                }
                subMesh._setMainDrawWrapperOverride(null);
            }
            else {
                // Alpha test
                if (this._opacityTexture) {
                    effect.setTexture("diffuseSampler", this._opacityTexture);
                    effect.setMatrix("diffuseMatrix", this._opacityTexture.getTextureMatrix() || this._defaultTextureMatrix);
                }
                // Bones
                if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {
                    const skeleton = renderingMesh.skeleton;
                    if (skeleton.isUsingTextureForMatrices) {
                        const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);
                        if (!boneTexture) {
                            return;
                        }
                        effect.setTexture("boneSampler", boneTexture);
                        effect.setFloat("boneTextureWidth", 4.0 * (skeleton.bones.length + 1));
                    }
                    else {
                        effect.setMatrices("mBones", skeleton.getTransformMatrices(renderingMesh));
                    }
                }
                // Morph targets
                (0,materialHelper_functions/* BindMorphTargetParameters */.nR)(renderingMesh, effect);
                if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {
                    renderingMesh.morphTargetManager._bind(effect);
                }
                // Baked vertex animations
                const bvaManager = subMesh.getMesh().bakedVertexAnimationManager;
                if (bvaManager && bvaManager.isEnabled) {
                    bvaManager.bind(effect, hardwareInstancedRendering);
                }
                // Clip planes
                (0,clipPlaneMaterialHelper/* bindClipPlane */.gS)(effect, material, scene);
            }
            if (!this._useUBO && !shadowDepthWrapper) {
                this._bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect, effectiveMesh);
            }
            (0,materialHelper_functions/* BindSceneUniformBuffer */._8)(effect, this._scene.getSceneUniformBuffer());
            this._scene.getSceneUniformBuffer().bindUniformBuffer();
            const world = effectiveMesh.getWorldMatrix();
            // In the non hardware instanced mode, the Mesh ubo update is done by the callback passed to renderingMesh._processRendering (see below)
            if (hardwareInstancedRendering) {
                effectiveMesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
                effectiveMesh.transferToEffect(world);
            }
            if (this.forceBackFacesOnly) {
                engine.setState(true, 0, false, true, material.cullBackFaces);
            }
            // Observables
            this.onBeforeShadowMapRenderMeshObservable.notifyObservers(renderingMesh);
            this.onBeforeShadowMapRenderObservable.notifyObservers(effect);
            // Draw
            renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, worldOverride) => {
                if (effectiveMesh !== renderingMesh && !isInstance) {
                    renderingMesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
                    renderingMesh.transferToEffect(worldOverride);
                }
                else {
                    effectiveMesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
                    effectiveMesh.transferToEffect(isInstance ? worldOverride : world);
                }
            });
            if (this.forceBackFacesOnly) {
                engine.setState(true, 0, false, false, material.cullBackFaces);
            }
            // Observables
            this.onAfterShadowMapRenderObservable.notifyObservers(effect);
            this.onAfterShadowMapRenderMeshObservable.notifyObservers(renderingMesh);
        }
        else {
            // Need to reset refresh rate of the shadowMap
            if (this._shadowMap) {
                this._shadowMap.resetRefreshCounter();
            }
        }
    }
    _applyFilterValues() {
        if (!this._shadowMap) {
            return;
        }
        if (this.filter === ShadowGenerator.FILTER_NONE || this.filter === ShadowGenerator.FILTER_PCSS) {
            this._shadowMap.updateSamplingMode(Textures_texture/* Texture */.g.NEAREST_SAMPLINGMODE);
        }
        else {
            this._shadowMap.updateSamplingMode(Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE);
        }
    }
    /**
     * Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.
     * @param onCompiled Callback triggered at the and of the effects compilation
     * @param options Sets of optional options forcing the compilation with different modes
     */
    forceCompilation(onCompiled, options) {
        const localOptions = {
            useInstances: false,
            ...options,
        };
        const shadowMap = this.getShadowMap();
        if (!shadowMap) {
            if (onCompiled) {
                onCompiled(this);
            }
            return;
        }
        const renderList = shadowMap.renderList;
        if (!renderList) {
            if (onCompiled) {
                onCompiled(this);
            }
            return;
        }
        const subMeshes = [];
        for (const mesh of renderList) {
            subMeshes.push(...mesh.subMeshes);
        }
        if (subMeshes.length === 0) {
            if (onCompiled) {
                onCompiled(this);
            }
            return;
        }
        let currentIndex = 0;
        const checkReady = () => {
            if (!this._scene || !this._scene.getEngine()) {
                return;
            }
            while (this.isReady(subMeshes[currentIndex], localOptions.useInstances, subMeshes[currentIndex].getMaterial()?.needAlphaBlendingForMesh(subMeshes[currentIndex].getMesh()) ?? false)) {
                currentIndex++;
                if (currentIndex >= subMeshes.length) {
                    if (onCompiled) {
                        onCompiled(this);
                    }
                    return;
                }
            }
            setTimeout(checkReady, 16);
        };
        checkReady();
    }
    /**
     * Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.
     * @param options Sets of optional options forcing the compilation with different modes
     * @returns A promise that resolves when the compilation completes
     */
    forceCompilationAsync(options) {
        return new Promise((resolve) => {
            this.forceCompilation(() => {
                resolve();
            }, options);
        });
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _isReadyCustomDefines(defines, subMesh, useInstances) { }
    _prepareShadowDefines(subMesh, useInstances, defines, isTransparent) {
        defines.push("#define SM_LIGHTTYPE_" + this._light.getClassName().toUpperCase());
        defines.push("#define SM_FLOAT " + (this._textureType !== 0 ? "1" : "0"));
        defines.push("#define SM_ESM " + (this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? "1" : "0"));
        defines.push("#define SM_DEPTHTEXTURE " + (this.usePercentageCloserFiltering || this.useContactHardeningShadow ? "1" : "0"));
        const mesh = subMesh.getMesh();
        // Normal bias.
        defines.push("#define SM_NORMALBIAS " + (this.normalBias && mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.NormalKind) ? "1" : "0"));
        defines.push("#define SM_DIRECTIONINLIGHTDATA " + (this.getLight().getTypeID() === Lights_light/* Light */.v.LIGHTTYPEID_DIRECTIONALLIGHT ? "1" : "0"));
        // Point light
        defines.push("#define SM_USEDISTANCE " + (this._light.needCube() ? "1" : "0"));
        // Soft transparent shadows
        defines.push("#define SM_SOFTTRANSPARENTSHADOW " + (this.enableSoftTransparentShadow && isTransparent ? "1" : "0"));
        this._isReadyCustomDefines(defines, subMesh, useInstances);
        return defines;
    }
    /**
     * Determine whether the shadow generator is ready or not (mainly all effects and related post processes needs to be ready).
     * @param subMesh The submesh we want to render in the shadow map
     * @param useInstances Defines whether will draw in the map using instances
     * @param isTransparent Indicates that isReady is called for a transparent subMesh
     * @returns true if ready otherwise, false
     */
    isReady(subMesh, useInstances, isTransparent) {
        if (!this._shadersLoaded) {
            return false;
        }
        const material = subMesh.getMaterial(), shadowDepthWrapper = material?.shadowDepthWrapper;
        this._opacityTexture = null;
        if (!material) {
            return false;
        }
        const defines = [];
        this._prepareShadowDefines(subMesh, useInstances, defines, isTransparent);
        if (shadowDepthWrapper) {
            if (!shadowDepthWrapper.isReadyForSubMesh(subMesh, defines, this, useInstances, this._scene.getEngine().currentRenderPassId)) {
                return false;
            }
        }
        else {
            const subMeshEffect = subMesh._getDrawWrapper(undefined, true);
            let effect = subMeshEffect.effect;
            let cachedDefines = subMeshEffect.defines;
            const attribs = [Buffers_buffer/* VertexBuffer */.R.PositionKind];
            const mesh = subMesh.getMesh();
            // Normal bias.
            if (this.normalBias && mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.NormalKind)) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.NormalKind);
                defines.push("#define NORMAL");
                if (mesh.nonUniformScaling) {
                    defines.push("#define NONUNIFORMSCALING");
                }
            }
            // Alpha test
            const needAlphaTesting = material.needAlphaTesting();
            if (needAlphaTesting || material.needAlphaBlending()) {
                if (this.useOpacityTextureForTransparentShadow) {
                    this._opacityTexture = material.opacityTexture;
                }
                else {
                    this._opacityTexture = material.getAlphaTestTexture();
                }
                if (this._opacityTexture) {
                    if (!this._opacityTexture.isReady()) {
                        return false;
                    }
                    const alphaCutOff = material.alphaCutOff ?? ShadowGenerator.DEFAULT_ALPHA_CUTOFF;
                    defines.push("#define ALPHATEXTURE");
                    if (needAlphaTesting) {
                        defines.push(`#define ALPHATESTVALUE ${alphaCutOff}${alphaCutOff % 1 === 0 ? "." : ""}`);
                    }
                    if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UVKind)) {
                        attribs.push(Buffers_buffer/* VertexBuffer */.R.UVKind);
                        defines.push("#define UV1");
                    }
                    if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UV2Kind)) {
                        if (this._opacityTexture.coordinatesIndex === 1) {
                            attribs.push(Buffers_buffer/* VertexBuffer */.R.UV2Kind);
                            defines.push("#define UV2");
                        }
                    }
                }
            }
            // Bones
            const fallbacks = new effectFallbacks/* EffectFallbacks */.J();
            if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind);
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind);
                if (mesh.numBoneInfluencers > 4) {
                    attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind);
                    attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind);
                }
                const skeleton = mesh.skeleton;
                defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
                if (mesh.numBoneInfluencers > 0) {
                    fallbacks.addCPUSkinningFallback(0, mesh);
                }
                if (skeleton.isUsingTextureForMatrices) {
                    defines.push("#define BONETEXTURE");
                }
                else {
                    defines.push("#define BonesPerMesh " + (skeleton.bones.length + 1));
                }
            }
            else {
                defines.push("#define NUM_BONE_INFLUENCERS 0");
            }
            // Morph targets
            const manager = mesh.morphTargetManager;
            let morphInfluencers = 0;
            if (manager) {
                morphInfluencers = manager.numMaxInfluencers || manager.numInfluencers;
                if (morphInfluencers > 0) {
                    defines.push("#define MORPHTARGETS");
                    defines.push("#define NUM_MORPH_INFLUENCERS " + morphInfluencers);
                    if (manager.isUsingTextureForTargets) {
                        defines.push("#define MORPHTARGETS_TEXTURE");
                    }
                    (0,materialHelper_functions/* PrepareAttributesForMorphTargetsInfluencers */.MF)(attribs, mesh, morphInfluencers);
                }
            }
            // ClipPlanes
            (0,clipPlaneMaterialHelper/* prepareStringDefinesForClipPlanes */.tv)(material, this._scene, defines);
            // Instances
            if (useInstances) {
                defines.push("#define INSTANCES");
                (0,materialHelper_functions/* PushAttributesForInstances */.te)(attribs);
                if (subMesh.getRenderingMesh().hasThinInstances) {
                    defines.push("#define THIN_INSTANCES");
                }
            }
            if (this.customShaderOptions) {
                if (this.customShaderOptions.defines) {
                    for (const define of this.customShaderOptions.defines) {
                        if (defines.indexOf(define) === -1) {
                            defines.push(define);
                        }
                    }
                }
            }
            // Baked vertex animations
            const bvaManager = mesh.bakedVertexAnimationManager;
            if (bvaManager && bvaManager.isEnabled) {
                defines.push("#define BAKED_VERTEX_ANIMATION_TEXTURE");
                if (useInstances) {
                    attribs.push("bakedVertexAnimationSettingsInstanced");
                }
            }
            // Get correct effect
            const join = defines.join("\n");
            if (cachedDefines !== join) {
                cachedDefines = join;
                let shaderName = "shadowMap";
                const uniforms = [
                    "world",
                    "mBones",
                    "viewProjection",
                    "diffuseMatrix",
                    "lightDataSM",
                    "depthValuesSM",
                    "biasAndScaleSM",
                    "morphTargetInfluences",
                    "morphTargetCount",
                    "boneTextureWidth",
                    "softTransparentShadowSM",
                    "morphTargetTextureInfo",
                    "morphTargetTextureIndices",
                    "bakedVertexAnimationSettings",
                    "bakedVertexAnimationTextureSizeInverted",
                    "bakedVertexAnimationTime",
                    "bakedVertexAnimationTexture",
                ];
                const samplers = ["diffuseSampler", "boneSampler", "morphTargets", "bakedVertexAnimationTexture"];
                const uniformBuffers = ["Scene", "Mesh"];
                (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.TV)(uniforms);
                // Custom shader?
                if (this.customShaderOptions) {
                    shaderName = this.customShaderOptions.shaderName;
                    if (this.customShaderOptions.attributes) {
                        for (const attrib of this.customShaderOptions.attributes) {
                            if (attribs.indexOf(attrib) === -1) {
                                attribs.push(attrib);
                            }
                        }
                    }
                    if (this.customShaderOptions.uniforms) {
                        for (const uniform of this.customShaderOptions.uniforms) {
                            if (uniforms.indexOf(uniform) === -1) {
                                uniforms.push(uniform);
                            }
                        }
                    }
                    if (this.customShaderOptions.samplers) {
                        for (const sampler of this.customShaderOptions.samplers) {
                            if (samplers.indexOf(sampler) === -1) {
                                samplers.push(sampler);
                            }
                        }
                    }
                }
                const engine = this._scene.getEngine();
                effect = engine.createEffect(shaderName, {
                    attributes: attribs,
                    uniformsNames: uniforms,
                    uniformBuffersNames: uniformBuffers,
                    samplers: samplers,
                    defines: join,
                    fallbacks: fallbacks,
                    onCompiled: null,
                    onError: null,
                    indexParameters: { maxSimultaneousMorphTargets: morphInfluencers },
                    shaderLanguage: this._shaderLanguage,
                }, engine);
                subMeshEffect.setEffect(effect, cachedDefines);
            }
            if (!effect.isReady()) {
                return false;
            }
        }
        if (this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) {
            if (!this._blurPostProcesses || !this._blurPostProcesses.length) {
                this._initializeBlurRTTAndPostProcesses();
            }
        }
        if (this._kernelBlurXPostprocess && !this._kernelBlurXPostprocess.isReady()) {
            return false;
        }
        if (this._kernelBlurYPostprocess && !this._kernelBlurYPostprocess.isReady()) {
            return false;
        }
        if (this._boxBlurPostprocess && !this._boxBlurPostprocess.isReady()) {
            return false;
        }
        return true;
    }
    /**
     * Prepare all the defines in a material relying on a shadow map at the specified light index.
     * @param defines Defines of the material we want to update
     * @param lightIndex Index of the light in the enabled light list of the material
     */
    prepareDefines(defines, lightIndex) {
        const scene = this._scene;
        const light = this._light;
        if (!scene.shadowsEnabled || !light.shadowEnabled) {
            return;
        }
        defines["SHADOW" + lightIndex] = true;
        if (this.useContactHardeningShadow) {
            defines["SHADOWPCSS" + lightIndex] = true;
            if (this._filteringQuality === ShadowGenerator.QUALITY_LOW) {
                defines["SHADOWLOWQUALITY" + lightIndex] = true;
            }
            else if (this._filteringQuality === ShadowGenerator.QUALITY_MEDIUM) {
                defines["SHADOWMEDIUMQUALITY" + lightIndex] = true;
            }
            // else default to high.
        }
        else if (this.usePercentageCloserFiltering) {
            defines["SHADOWPCF" + lightIndex] = true;
            if (this._filteringQuality === ShadowGenerator.QUALITY_LOW) {
                defines["SHADOWLOWQUALITY" + lightIndex] = true;
            }
            else if (this._filteringQuality === ShadowGenerator.QUALITY_MEDIUM) {
                defines["SHADOWMEDIUMQUALITY" + lightIndex] = true;
            }
            // else default to high.
        }
        else if (this.usePoissonSampling) {
            defines["SHADOWPOISSON" + lightIndex] = true;
        }
        else if (this.useExponentialShadowMap || this.useBlurExponentialShadowMap) {
            defines["SHADOWESM" + lightIndex] = true;
        }
        else if (this.useCloseExponentialShadowMap || this.useBlurCloseExponentialShadowMap) {
            defines["SHADOWCLOSEESM" + lightIndex] = true;
        }
        if (light.needCube()) {
            defines["SHADOWCUBE" + lightIndex] = true;
        }
    }
    /**
     * Binds the shadow related information inside of an effect (information like near, far, darkness...
     * defined in the generator but impacting the effect).
     * @param lightIndex Index of the light in the enabled light list of the material owning the effect
     * @param effect The effect we are binding the information for
     */
    bindShadowLight(lightIndex, effect) {
        const light = this._light;
        const scene = this._scene;
        if (!scene.shadowsEnabled || !light.shadowEnabled) {
            return;
        }
        const camera = this._getCamera();
        if (!camera) {
            return;
        }
        const shadowMap = this.getShadowMap();
        if (!shadowMap) {
            return;
        }
        if (!light.needCube()) {
            effect.setMatrix("lightMatrix" + lightIndex, this.getTransformMatrix());
        }
        // Only PCF uses depth stencil texture.
        const shadowMapForRendering = this.getShadowMapForRendering();
        if (this._filter === ShadowGenerator.FILTER_PCF) {
            effect.setDepthStencilTexture("shadowTexture" + lightIndex, shadowMapForRendering);
            light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), shadowMap.getSize().width, 1 / shadowMap.getSize().width, this.frustumEdgeFalloff, lightIndex);
        }
        else if (this._filter === ShadowGenerator.FILTER_PCSS) {
            effect.setDepthStencilTexture("shadowTexture" + lightIndex, shadowMapForRendering);
            effect.setTexture("depthTexture" + lightIndex, shadowMapForRendering);
            light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), 1 / shadowMap.getSize().width, this._contactHardeningLightSizeUVRatio * shadowMap.getSize().width, this.frustumEdgeFalloff, lightIndex);
        }
        else {
            effect.setTexture("shadowTexture" + lightIndex, shadowMapForRendering);
            light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), this.blurScale / shadowMap.getSize().width, this.depthScale, this.frustumEdgeFalloff, lightIndex);
        }
        light._uniformBuffer.updateFloat2("depthValues", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera), lightIndex);
    }
    /**
     * Gets the view matrix used to render the shadow map.
     */
    get viewMatrix() {
        return this._viewMatrix;
    }
    /**
     * Gets the projection matrix used to render the shadow map.
     */
    get projectionMatrix() {
        return this._projectionMatrix;
    }
    /**
     * Gets the transformation matrix used to project the meshes into the map from the light point of view.
     * (eq to shadow projection matrix * light transform matrix)
     * @returns The transform matrix used to create the shadow map
     */
    getTransformMatrix() {
        const scene = this._scene;
        if (this._currentRenderId === scene.getRenderId() && this._currentFaceIndexCache === this._currentFaceIndex) {
            return this._transformMatrix;
        }
        this._currentRenderId = scene.getRenderId();
        this._currentFaceIndexCache = this._currentFaceIndex;
        let lightPosition = this._light.position;
        if (this._light.computeTransformedInformation()) {
            lightPosition = this._light.transformedPosition;
        }
        math_vector/* Vector3 */.Pq.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex), this._lightDirection);
        if (Math.abs(math_vector/* Vector3 */.Pq.Dot(this._lightDirection, math_vector/* Vector3 */.Pq.Up())) === 1.0) {
            this._lightDirection.z = 0.0000000000001; // Required to avoid perfectly perpendicular light
        }
        if (this._light.needProjectionMatrixCompute() ||
            !this._cachedPosition ||
            !this._cachedDirection ||
            !lightPosition.equals(this._cachedPosition) ||
            !this._lightDirection.equals(this._cachedDirection)) {
            this._cachedPosition.copyFrom(lightPosition);
            this._cachedDirection.copyFrom(this._lightDirection);
            math_vector/* Matrix */.uq.LookAtLHToRef(lightPosition, lightPosition.add(this._lightDirection), math_vector/* Vector3 */.Pq.Up(), this._viewMatrix);
            const shadowMap = this.getShadowMap();
            if (shadowMap) {
                const renderList = shadowMap.renderList;
                if (renderList) {
                    this._light.setShadowProjectionMatrix(this._projectionMatrix, this._viewMatrix, renderList);
                }
            }
            this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);
        }
        return this._transformMatrix;
    }
    /**
     * Recreates the shadow map dependencies like RTT and post processes. This can be used during the switch between
     * Cube and 2D textures for instance.
     */
    recreateShadowMap() {
        const shadowMap = this._shadowMap;
        if (!shadowMap) {
            return;
        }
        // Track render list.
        const renderList = shadowMap.renderList;
        // Clean up existing data.
        this._disposeRTTandPostProcesses();
        // Reinitializes.
        this._initializeGenerator();
        // Reaffect the filter to ensure a correct fallback if necessary.
        this.filter = this._filter;
        // Reaffect the filter.
        this._applyFilterValues();
        // Reaffect Render List.
        if (renderList) {
            // Note: don't do this._shadowMap!.renderList = renderList;
            // The renderList hooked array is accessing the old RenderTargetTexture (see RenderTargetTexture._hookArray), which is disposed at this point (by the call to _disposeRTTandPostProcesses)
            if (!this._shadowMap.renderList) {
                this._shadowMap.renderList = [];
            }
            for (const mesh of renderList) {
                this._shadowMap.renderList.push(mesh);
            }
        }
        else {
            this._shadowMap.renderList = null;
        }
    }
    _disposeBlurPostProcesses() {
        if (this._shadowMap2) {
            this._shadowMap2.dispose();
            this._shadowMap2 = null;
        }
        if (this._boxBlurPostprocess) {
            this._boxBlurPostprocess.dispose();
            this._boxBlurPostprocess = null;
        }
        if (this._kernelBlurXPostprocess) {
            this._kernelBlurXPostprocess.dispose();
            this._kernelBlurXPostprocess = null;
        }
        if (this._kernelBlurYPostprocess) {
            this._kernelBlurYPostprocess.dispose();
            this._kernelBlurYPostprocess = null;
        }
        this._blurPostProcesses = [];
    }
    _disposeRTTandPostProcesses() {
        if (this._shadowMap) {
            this._shadowMap.dispose();
            this._shadowMap = null;
        }
        this._disposeBlurPostProcesses();
    }
    _disposeSceneUBOs() {
        if (this._sceneUBOs) {
            for (const ubo of this._sceneUBOs) {
                ubo.dispose();
            }
            this._sceneUBOs = [];
        }
    }
    /**
     * Disposes the ShadowGenerator.
     * Returns nothing.
     */
    dispose() {
        this._disposeRTTandPostProcesses();
        this._disposeSceneUBOs();
        if (this._light) {
            if (this._light._shadowGenerators) {
                const iterator = this._light._shadowGenerators.entries();
                for (let entry = iterator.next(); entry.done !== true; entry = iterator.next()) {
                    const [camera, shadowGenerator] = entry.value;
                    if (shadowGenerator === this) {
                        this._light._shadowGenerators.delete(camera);
                    }
                }
                if (this._light._shadowGenerators.size === 0) {
                    this._light._shadowGenerators = null;
                }
            }
            this._light._markMeshesAsLightDirty();
        }
        this.onBeforeShadowMapRenderMeshObservable.clear();
        this.onBeforeShadowMapRenderObservable.clear();
        this.onAfterShadowMapRenderMeshObservable.clear();
        this.onAfterShadowMapRenderObservable.clear();
    }
    /**
     * Serializes the shadow generator setup to a json object.
     * @returns The serialized JSON object
     */
    serialize() {
        const serializationObject = {};
        const shadowMap = this.getShadowMap();
        if (!shadowMap) {
            return serializationObject;
        }
        serializationObject.className = this.getClassName();
        serializationObject.lightId = this._light.id;
        serializationObject.cameraId = this._camera?.id;
        serializationObject.id = this.id;
        serializationObject.mapSize = shadowMap.getRenderSize();
        serializationObject.forceBackFacesOnly = this.forceBackFacesOnly;
        serializationObject.darkness = this.getDarkness();
        serializationObject.transparencyShadow = this._transparencyShadow;
        serializationObject.frustumEdgeFalloff = this.frustumEdgeFalloff;
        serializationObject.bias = this.bias;
        serializationObject.normalBias = this.normalBias;
        serializationObject.usePercentageCloserFiltering = this.usePercentageCloserFiltering;
        serializationObject.useContactHardeningShadow = this.useContactHardeningShadow;
        serializationObject.contactHardeningLightSizeUVRatio = this.contactHardeningLightSizeUVRatio;
        serializationObject.filteringQuality = this.filteringQuality;
        serializationObject.useExponentialShadowMap = this.useExponentialShadowMap;
        serializationObject.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap;
        serializationObject.useCloseExponentialShadowMap = this.useBlurExponentialShadowMap;
        serializationObject.useBlurCloseExponentialShadowMap = this.useBlurExponentialShadowMap;
        serializationObject.usePoissonSampling = this.usePoissonSampling;
        serializationObject.depthScale = this.depthScale;
        serializationObject.blurBoxOffset = this.blurBoxOffset;
        serializationObject.blurKernel = this.blurKernel;
        serializationObject.blurScale = this.blurScale;
        serializationObject.useKernelBlur = this.useKernelBlur;
        serializationObject.renderList = [];
        if (shadowMap.renderList) {
            for (let meshIndex = 0; meshIndex < shadowMap.renderList.length; meshIndex++) {
                const mesh = shadowMap.renderList[meshIndex];
                serializationObject.renderList.push(mesh.id);
            }
        }
        return serializationObject;
    }
    /**
     * Parses a serialized ShadowGenerator and returns a new ShadowGenerator.
     * @param parsedShadowGenerator The JSON object to parse
     * @param scene The scene to create the shadow map for
     * @param constr A function that builds a shadow generator or undefined to create an instance of the default shadow generator
     * @returns The parsed shadow generator
     */
    static Parse(parsedShadowGenerator, scene, constr) {
        const light = scene.getLightById(parsedShadowGenerator.lightId);
        const camera = parsedShadowGenerator.cameraId !== undefined ? scene.getCameraById(parsedShadowGenerator.cameraId) : null;
        const shadowGenerator = constr ? constr(parsedShadowGenerator.mapSize, light, camera) : new ShadowGenerator(parsedShadowGenerator.mapSize, light, undefined, camera);
        const shadowMap = shadowGenerator.getShadowMap();
        for (let meshIndex = 0; meshIndex < parsedShadowGenerator.renderList.length; meshIndex++) {
            const meshes = scene.getMeshesById(parsedShadowGenerator.renderList[meshIndex]);
            meshes.forEach(function (mesh) {
                if (!shadowMap) {
                    return;
                }
                if (!shadowMap.renderList) {
                    shadowMap.renderList = [];
                }
                shadowMap.renderList.push(mesh);
            });
        }
        if (parsedShadowGenerator.id !== undefined) {
            shadowGenerator.id = parsedShadowGenerator.id;
        }
        shadowGenerator.forceBackFacesOnly = !!parsedShadowGenerator.forceBackFacesOnly;
        if (parsedShadowGenerator.darkness !== undefined) {
            shadowGenerator.setDarkness(parsedShadowGenerator.darkness);
        }
        if (parsedShadowGenerator.transparencyShadow) {
            shadowGenerator.setTransparencyShadow(true);
        }
        if (parsedShadowGenerator.frustumEdgeFalloff !== undefined) {
            shadowGenerator.frustumEdgeFalloff = parsedShadowGenerator.frustumEdgeFalloff;
        }
        if (parsedShadowGenerator.bias !== undefined) {
            shadowGenerator.bias = parsedShadowGenerator.bias;
        }
        if (parsedShadowGenerator.normalBias !== undefined) {
            shadowGenerator.normalBias = parsedShadowGenerator.normalBias;
        }
        if (parsedShadowGenerator.usePercentageCloserFiltering) {
            shadowGenerator.usePercentageCloserFiltering = true;
        }
        else if (parsedShadowGenerator.useContactHardeningShadow) {
            shadowGenerator.useContactHardeningShadow = true;
        }
        else if (parsedShadowGenerator.usePoissonSampling) {
            shadowGenerator.usePoissonSampling = true;
        }
        else if (parsedShadowGenerator.useExponentialShadowMap) {
            shadowGenerator.useExponentialShadowMap = true;
        }
        else if (parsedShadowGenerator.useBlurExponentialShadowMap) {
            shadowGenerator.useBlurExponentialShadowMap = true;
        }
        else if (parsedShadowGenerator.useCloseExponentialShadowMap) {
            shadowGenerator.useCloseExponentialShadowMap = true;
        }
        else if (parsedShadowGenerator.useBlurCloseExponentialShadowMap) {
            shadowGenerator.useBlurCloseExponentialShadowMap = true;
        }
        // Backward compat
        else if (parsedShadowGenerator.useVarianceShadowMap) {
            shadowGenerator.useExponentialShadowMap = true;
        }
        else if (parsedShadowGenerator.useBlurVarianceShadowMap) {
            shadowGenerator.useBlurExponentialShadowMap = true;
        }
        if (parsedShadowGenerator.contactHardeningLightSizeUVRatio !== undefined) {
            shadowGenerator.contactHardeningLightSizeUVRatio = parsedShadowGenerator.contactHardeningLightSizeUVRatio;
        }
        if (parsedShadowGenerator.filteringQuality !== undefined) {
            shadowGenerator.filteringQuality = parsedShadowGenerator.filteringQuality;
        }
        if (parsedShadowGenerator.depthScale) {
            shadowGenerator.depthScale = parsedShadowGenerator.depthScale;
        }
        if (parsedShadowGenerator.blurScale) {
            shadowGenerator.blurScale = parsedShadowGenerator.blurScale;
        }
        if (parsedShadowGenerator.blurBoxOffset) {
            shadowGenerator.blurBoxOffset = parsedShadowGenerator.blurBoxOffset;
        }
        if (parsedShadowGenerator.useKernelBlur) {
            shadowGenerator.useKernelBlur = parsedShadowGenerator.useKernelBlur;
        }
        if (parsedShadowGenerator.blurKernel) {
            shadowGenerator.blurKernel = parsedShadowGenerator.blurKernel;
        }
        return shadowGenerator;
    }
}
/**
 * Name of the shadow generator class
 */
ShadowGenerator.CLASSNAME = "ShadowGenerator";
/**
 * Force all the shadow generators to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
ShadowGenerator.ForceGLSL = false;
/**
 * Shadow generator mode None: no filtering applied.
 */
ShadowGenerator.FILTER_NONE = 0;
/**
 * Shadow generator mode ESM: Exponential Shadow Mapping.
 * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)
 */
ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP = 1;
/**
 * Shadow generator mode Poisson Sampling: Percentage Closer Filtering.
 * (Multiple Tap around evenly distributed around the pixel are used to evaluate the shadow strength)
 */
ShadowGenerator.FILTER_POISSONSAMPLING = 2;
/**
 * Shadow generator mode ESM: Blurred Exponential Shadow Mapping.
 * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)
 */
ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP = 3;
/**
 * Shadow generator mode ESM: Exponential Shadow Mapping using the inverse of the exponential preventing
 * edge artifacts on steep falloff.
 * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)
 */
ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4;
/**
 * Shadow generator mode ESM: Blurred Exponential Shadow Mapping using the inverse of the exponential preventing
 * edge artifacts on steep falloff.
 * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)
 */
ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5;
/**
 * Shadow generator mode PCF: Percentage Closer Filtering
 * benefits from Webgl 2 shadow samplers. Fallback to Poisson Sampling in Webgl 1
 * (https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch11.html)
 */
ShadowGenerator.FILTER_PCF = 6;
/**
 * Shadow generator mode PCSS: Percentage Closering Soft Shadow.
 * benefits from Webgl 2 shadow samplers. Fallback to Poisson Sampling in Webgl 1
 * Contact Hardening
 */
ShadowGenerator.FILTER_PCSS = 7;
/**
 * Reserved for PCF and PCSS
 * Highest Quality.
 *
 * Execute PCF on a 5*5 kernel improving a lot the shadow aliasing artifacts.
 *
 * Execute PCSS with 32 taps blocker search and 64 taps PCF.
 */
ShadowGenerator.QUALITY_HIGH = 0;
/**
 * Reserved for PCF and PCSS
 * Good tradeoff for quality/perf cross devices
 *
 * Execute PCF on a 3*3 kernel.
 *
 * Execute PCSS with 16 taps blocker search and 32 taps PCF.
 */
ShadowGenerator.QUALITY_MEDIUM = 1;
/**
 * Reserved for PCF and PCSS
 * The lowest quality but the fastest.
 *
 * Execute PCF on a 1*1 kernel.
 *
 * Execute PCSS with 16 taps blocker search and 16 taps PCF.
 */
ShadowGenerator.QUALITY_LOW = 2;
/**
 * Defines the default alpha cutoff value used for transparent alpha tested materials.
 */
ShadowGenerator.DEFAULT_ALPHA_CUTOFF = 0.5;
/**
 * @internal
 */
ShadowGenerator._SceneComponentInitialization = (_) => {
    throw (0,devTools/* _WarnImport */.n)("ShadowGeneratorSceneComponent");
};
//# sourceMappingURL=shadowGenerator.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/depth.fragment.js
var depth_fragment = __webpack_require__(88852);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/depth.vertex.js + 1 modules
var depth_vertex = __webpack_require__(9977);
;// ./node_modules/@babylonjs/core/Rendering/depthRenderer.js












/**
 * This represents a depth renderer in Babylon.
 * A depth renderer will render to it's depth map every frame which can be displayed or used in post processing
 */
class DepthRenderer {
    /**
     * Gets the shader language used in this material.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Sets a specific material to be used to render a mesh/a list of meshes by the depth renderer
     * @param mesh mesh or array of meshes
     * @param material material to use by the depth render when rendering the mesh(es). If undefined is passed, the specific material created by the depth renderer will be used.
     */
    setMaterialForRendering(mesh, material) {
        this._depthMap.setMaterialForRendering(mesh, material);
    }
    /**
     * Instantiates a depth renderer
     * @param scene The scene the renderer belongs to
     * @param type The texture type of the depth map (default: Engine.TEXTURETYPE_FLOAT)
     * @param camera The camera to be used to render the depth map (default: scene's active camera)
     * @param storeNonLinearDepth Defines whether the depth is stored linearly like in Babylon Shadows or directly like glFragCoord.z
     * @param samplingMode The sampling mode to be used with the render target (Linear, Nearest...) (default: TRILINEAR_SAMPLINGMODE)
     * @param storeCameraSpaceZ Defines whether the depth stored is the Z coordinate in camera space. If true, storeNonLinearDepth has no effect. (Default: false)
     * @param name Name of the render target (default: DepthRenderer)
     */
    constructor(scene, type = 1, camera = null, storeNonLinearDepth = false, samplingMode = Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, storeCameraSpaceZ = false, name) {
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        /** Enable or disable the depth renderer. When disabled, the depth texture is not updated */
        this.enabled = true;
        /** Force writing the transparent objects into the depth map */
        this.forceDepthWriteTransparentMeshes = false;
        /**
         * Specifies that the depth renderer will only be used within
         * the camera it is created for.
         * This can help forcing its rendering during the camera processing.
         */
        this.useOnlyInActiveCamera = false;
        /** If true, reverse the culling of materials before writing to the depth texture.
         * So, basically, when "true", back facing instead of front facing faces are rasterized into the texture
         */
        this.reverseCulling = false;
        this._shadersLoaded = false;
        this._scene = scene;
        this._storeNonLinearDepth = storeNonLinearDepth;
        this._storeCameraSpaceZ = storeCameraSpaceZ;
        this.isPacked = type === 0;
        if (this.isPacked) {
            this.clearColor = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        }
        else {
            this.clearColor = new math_color/* Color4 */.ov(storeCameraSpaceZ ? 1e8 : 1.0, 0.0, 0.0, 1.0);
        }
        this._initShaderSourceAsync();
        DepthRenderer._SceneComponentInitialization(this._scene);
        const engine = scene.getEngine();
        this._camera = camera;
        if (samplingMode !== Textures_texture/* Texture */.g.NEAREST_SAMPLINGMODE) {
            if (type === 1 && !engine._caps.textureFloatLinearFiltering) {
                samplingMode = Textures_texture/* Texture */.g.NEAREST_SAMPLINGMODE;
            }
            if (type === 2 && !engine._caps.textureHalfFloatLinearFiltering) {
                samplingMode = Textures_texture/* Texture */.g.NEAREST_SAMPLINGMODE;
            }
        }
        // Render target
        const format = this.isPacked || !engine._features.supportExtendedTextureFormats ? 5 : 6;
        this._depthMap = new Textures_renderTargetTexture/* RenderTargetTexture */.$(name ?? "DepthRenderer", { width: engine.getRenderWidth(), height: engine.getRenderHeight() }, this._scene, false, true, type, false, samplingMode, undefined, undefined, undefined, format);
        this._depthMap.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._depthMap.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._depthMap.refreshRate = 1;
        this._depthMap.renderParticles = false;
        this._depthMap.renderList = null;
        this._depthMap.noPrePassRenderer = true;
        // Camera to get depth map from to support multiple concurrent cameras
        this._depthMap.activeCamera = this._camera;
        this._depthMap.ignoreCameraViewport = true;
        this._depthMap.useCameraPostProcesses = false;
        // set default depth value to 1.0 (far away)
        this._depthMap.onClearObservable.add((engine) => {
            engine.clear(this.clearColor, true, true, true);
        });
        this._depthMap.onBeforeBindObservable.add(() => {
            engine._debugPushGroup?.("depth renderer", 1);
        });
        this._depthMap.onAfterUnbindObservable.add(() => {
            engine._debugPopGroup?.(1);
        });
        this._depthMap.customIsReadyFunction = (mesh, refreshRate, preWarm) => {
            if ((preWarm || refreshRate === 0) && mesh.subMeshes) {
                for (let i = 0; i < mesh.subMeshes.length; ++i) {
                    const subMesh = mesh.subMeshes[i];
                    const renderingMesh = subMesh.getRenderingMesh();
                    const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());
                    const hardwareInstancedRendering = engine.getCaps().instancedArrays &&
                        ((batch.visibleInstances[subMesh._id] !== null && batch.visibleInstances[subMesh._id] !== undefined) || renderingMesh.hasThinInstances);
                    if (!this.isReady(subMesh, hardwareInstancedRendering)) {
                        return false;
                    }
                }
            }
            return true;
        };
        // Custom render function
        const renderSubMesh = (subMesh) => {
            const renderingMesh = subMesh.getRenderingMesh();
            const effectiveMesh = subMesh.getEffectiveMesh();
            const scene = this._scene;
            const engine = scene.getEngine();
            const material = subMesh.getMaterial();
            effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = false;
            if (!material || effectiveMesh.infiniteDistance || material.disableDepthWrite || subMesh.verticesCount === 0 || subMesh._renderId === scene.getRenderId()) {
                return;
            }
            // Culling
            const detNeg = effectiveMesh._getWorldMatrixDeterminant() < 0;
            let sideOrientation = material._getEffectiveOrientation(renderingMesh);
            if (detNeg) {
                sideOrientation =
                    sideOrientation === 0
                        ? 1
                        : 0;
            }
            const reverseSideOrientation = sideOrientation === 0;
            engine.setState(material.backFaceCulling, 0, false, reverseSideOrientation, this.reverseCulling ? !material.cullBackFaces : material.cullBackFaces);
            // Managing instances
            const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());
            if (batch.mustReturn) {
                return;
            }
            const hardwareInstancedRendering = engine.getCaps().instancedArrays &&
                ((batch.visibleInstances[subMesh._id] !== null && batch.visibleInstances[subMesh._id] !== undefined) || renderingMesh.hasThinInstances);
            const camera = this._camera || scene.activeCamera;
            if (this.isReady(subMesh, hardwareInstancedRendering) && camera) {
                subMesh._renderId = scene.getRenderId();
                const renderingMaterial = effectiveMesh._internalAbstractMeshDataInfo._materialForRenderPass?.[engine.currentRenderPassId];
                let drawWrapper = subMesh._getDrawWrapper();
                if (!drawWrapper && renderingMaterial) {
                    drawWrapper = renderingMaterial._getDrawWrapper();
                }
                const cameraIsOrtho = camera.mode === Cameras_camera/* Camera */.i.ORTHOGRAPHIC_CAMERA;
                if (!drawWrapper) {
                    return;
                }
                const effect = drawWrapper.effect;
                engine.enableEffect(drawWrapper);
                if (!hardwareInstancedRendering) {
                    renderingMesh._bind(subMesh, effect, material.fillMode);
                }
                if (!renderingMaterial) {
                    effect.setMatrix("viewProjection", scene.getTransformMatrix());
                    effect.setMatrix("world", effectiveMesh.getWorldMatrix());
                    if (this._storeCameraSpaceZ) {
                        effect.setMatrix("view", scene.getViewMatrix());
                    }
                }
                else {
                    renderingMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), effectiveMesh, subMesh);
                }
                let minZ, maxZ;
                if (cameraIsOrtho) {
                    minZ = !engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
                    maxZ = engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
                }
                else {
                    minZ = engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? camera.minZ : engine.isNDCHalfZRange ? 0 : camera.minZ;
                    maxZ = engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : camera.maxZ;
                }
                effect.setFloat2("depthValues", minZ, minZ + maxZ);
                if (!renderingMaterial) {
                    // Alpha test
                    if (material.needAlphaTesting()) {
                        const alphaTexture = material.getAlphaTestTexture();
                        if (alphaTexture) {
                            effect.setTexture("diffuseSampler", alphaTexture);
                            effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
                        }
                    }
                    // Bones
                    (0,materialHelper_functions/* BindBonesParameters */.f$)(renderingMesh, effect);
                    // Clip planes
                    (0,clipPlaneMaterialHelper/* bindClipPlane */.gS)(effect, material, scene);
                    // Morph targets
                    (0,materialHelper_functions/* BindMorphTargetParameters */.nR)(renderingMesh, effect);
                    if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {
                        renderingMesh.morphTargetManager._bind(effect);
                    }
                    // Baked vertex animations
                    const bvaManager = subMesh.getMesh().bakedVertexAnimationManager;
                    if (bvaManager && bvaManager.isEnabled) {
                        bvaManager.bind(effect, hardwareInstancedRendering);
                    }
                    // Points cloud rendering
                    if (material.pointsCloud) {
                        effect.setFloat("pointSize", material.pointSize);
                    }
                }
                // Draw
                renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, world) => effect.setMatrix("world", world));
            }
        };
        this._depthMap.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => {
            let index;
            if (depthOnlySubMeshes.length) {
                for (index = 0; index < depthOnlySubMeshes.length; index++) {
                    renderSubMesh(depthOnlySubMeshes.data[index]);
                }
            }
            for (index = 0; index < opaqueSubMeshes.length; index++) {
                renderSubMesh(opaqueSubMeshes.data[index]);
            }
            for (index = 0; index < alphaTestSubMeshes.length; index++) {
                renderSubMesh(alphaTestSubMeshes.data[index]);
            }
            if (this.forceDepthWriteTransparentMeshes) {
                for (index = 0; index < transparentSubMeshes.length; index++) {
                    renderSubMesh(transparentSubMeshes.data[index]);
                }
            }
            else {
                for (index = 0; index < transparentSubMeshes.length; index++) {
                    transparentSubMeshes.data[index].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = false;
                }
            }
        };
    }
    async _initShaderSourceAsync(forceGLSL = false) {
        const engine = this._scene.getEngine();
        if (engine.isWebGPU && !forceGLSL && !DepthRenderer.ForceGLSL) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 48453)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 38939))]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 9977)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 88852))]);
        }
        this._shadersLoaded = true;
    }
    /**
     * Creates the depth rendering effect and checks if the effect is ready.
     * @param subMesh The submesh to be used to render the depth map of
     * @param useInstances If multiple world instances should be used
     * @returns if the depth renderer is ready to render the depth map
     */
    isReady(subMesh, useInstances) {
        if (!this._shadersLoaded) {
            return false;
        }
        const engine = this._scene.getEngine();
        const mesh = subMesh.getMesh();
        const scene = mesh.getScene();
        const renderingMaterial = mesh._internalAbstractMeshDataInfo._materialForRenderPass?.[engine.currentRenderPassId];
        if (renderingMaterial) {
            return renderingMaterial.isReadyForSubMesh(mesh, subMesh, useInstances);
        }
        const material = subMesh.getMaterial();
        if (!material || material.disableDepthWrite) {
            return false;
        }
        const defines = [];
        const attribs = [Buffers_buffer/* VertexBuffer */.R.PositionKind];
        // Alpha test
        if (material.needAlphaTesting() && material.getAlphaTestTexture()) {
            defines.push("#define ALPHATEST");
            if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UVKind)) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.UVKind);
                defines.push("#define UV1");
            }
            if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UV2Kind)) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.UV2Kind);
                defines.push("#define UV2");
            }
        }
        // Bones
        const fallbacks = new effectFallbacks/* EffectFallbacks */.J();
        if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind);
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind);
            if (mesh.numBoneInfluencers > 4) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind);
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind);
            }
            defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
            if (mesh.numBoneInfluencers > 0) {
                fallbacks.addCPUSkinningFallback(0, mesh);
            }
            const skeleton = mesh.skeleton;
            if (skeleton.isUsingTextureForMatrices) {
                defines.push("#define BONETEXTURE");
            }
            else {
                defines.push("#define BonesPerMesh " + (skeleton.bones.length + 1));
            }
        }
        else {
            defines.push("#define NUM_BONE_INFLUENCERS 0");
        }
        // Morph targets
        const morphTargetManager = mesh.morphTargetManager;
        let numMorphInfluencers = 0;
        if (morphTargetManager) {
            numMorphInfluencers = morphTargetManager.numMaxInfluencers || morphTargetManager.numInfluencers;
            if (numMorphInfluencers > 0) {
                defines.push("#define MORPHTARGETS");
                defines.push("#define NUM_MORPH_INFLUENCERS " + numMorphInfluencers);
                if (morphTargetManager.isUsingTextureForTargets) {
                    defines.push("#define MORPHTARGETS_TEXTURE");
                }
                (0,materialHelper_functions/* PrepareAttributesForMorphTargetsInfluencers */.MF)(attribs, mesh, numMorphInfluencers);
            }
        }
        // Points cloud rendering
        if (material.pointsCloud) {
            defines.push("#define POINTSIZE");
        }
        // Instances
        if (useInstances) {
            defines.push("#define INSTANCES");
            (0,materialHelper_functions/* PushAttributesForInstances */.te)(attribs);
            if (subMesh.getRenderingMesh().hasThinInstances) {
                defines.push("#define THIN_INSTANCES");
            }
        }
        // Baked vertex animations
        const bvaManager = mesh.bakedVertexAnimationManager;
        if (bvaManager && bvaManager.isEnabled) {
            defines.push("#define BAKED_VERTEX_ANIMATION_TEXTURE");
            if (useInstances) {
                attribs.push("bakedVertexAnimationSettingsInstanced");
            }
        }
        // None linear depth
        if (this._storeNonLinearDepth) {
            defines.push("#define NONLINEARDEPTH");
        }
        // Store camera space Z coordinate instead of NDC Z
        if (this._storeCameraSpaceZ) {
            defines.push("#define STORE_CAMERASPACE_Z");
        }
        // Float Mode
        if (this.isPacked) {
            defines.push("#define PACKED");
        }
        // Clip planes
        (0,clipPlaneMaterialHelper/* prepareStringDefinesForClipPlanes */.tv)(material, scene, defines);
        // Get correct effect
        const drawWrapper = subMesh._getDrawWrapper(undefined, true);
        const cachedDefines = drawWrapper.defines;
        const join = defines.join("\n");
        if (cachedDefines !== join) {
            const uniforms = [
                "world",
                "mBones",
                "boneTextureWidth",
                "pointSize",
                "viewProjection",
                "view",
                "diffuseMatrix",
                "depthValues",
                "morphTargetInfluences",
                "morphTargetCount",
                "morphTargetTextureInfo",
                "morphTargetTextureIndices",
                "bakedVertexAnimationSettings",
                "bakedVertexAnimationTextureSizeInverted",
                "bakedVertexAnimationTime",
                "bakedVertexAnimationTexture",
            ];
            const samplers = ["diffuseSampler", "morphTargets", "boneSampler", "bakedVertexAnimationTexture"];
            (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.TV)(uniforms);
            drawWrapper.setEffect(engine.createEffect("depth", {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: [],
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: null,
                onError: null,
                indexParameters: { maxSimultaneousMorphTargets: numMorphInfluencers },
                shaderLanguage: this._shaderLanguage,
            }, engine));
        }
        return drawWrapper.effect.isReady();
    }
    /**
     * Gets the texture which the depth map will be written to.
     * @returns The depth map texture
     */
    getDepthMap() {
        return this._depthMap;
    }
    /**
     * Disposes of the depth renderer.
     */
    dispose() {
        const keysToDelete = [];
        for (const key in this._scene._depthRenderer) {
            const depthRenderer = this._scene._depthRenderer[key];
            if (depthRenderer === this) {
                keysToDelete.push(key);
            }
        }
        if (keysToDelete.length > 0) {
            this._depthMap.dispose();
            for (const key of keysToDelete) {
                delete this._scene._depthRenderer[key];
            }
        }
    }
}
/**
 * Force all the depth renderer to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
DepthRenderer.ForceGLSL = false;
/**
 * @internal
 */
DepthRenderer._SceneComponentInitialization = (_) => {
    throw (0,devTools/* _WarnImport */.n)("DepthRendererSceneComponent");
};
//# sourceMappingURL=depthRenderer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/postProcessManager.js
var postProcessManager = __webpack_require__(36096);
;// ./node_modules/@babylonjs/core/Shaders/minmaxRedux.fragment.js
// Do not edit.

const minmaxRedux_fragment_name = "minmaxReduxPixelShader";
const minmaxRedux_fragment_shader = `varying vec2 vUV;uniform sampler2D textureSampler;
#if defined(INITIAL)
uniform sampler2D sourceTexture;uniform vec2 texSize;void main(void)
{ivec2 coord=ivec2(vUV*(texSize-1.0));float f1=texelFetch(sourceTexture,coord,0).r;float f2=texelFetch(sourceTexture,coord+ivec2(1,0),0).r;float f3=texelFetch(sourceTexture,coord+ivec2(1,1),0).r;float f4=texelFetch(sourceTexture,coord+ivec2(0,1),0).r;float minz=min(min(min(f1,f2),f3),f4);
#ifdef DEPTH_REDUX
float maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4);
#else
float maxz=max(max(max(f1,f2),f3),f4);
#endif
glFragColor=vec4(minz,maxz,0.,0.);}
#elif defined(MAIN)
uniform vec2 texSize;void main(void)
{ivec2 coord=ivec2(vUV*(texSize-1.0));vec2 f1=texelFetch(textureSampler,coord,0).rg;vec2 f2=texelFetch(textureSampler,coord+ivec2(1,0),0).rg;vec2 f3=texelFetch(textureSampler,coord+ivec2(1,1),0).rg;vec2 f4=texelFetch(textureSampler,coord+ivec2(0,1),0).rg;float minz=min(min(min(f1.x,f2.x),f3.x),f4.x);float maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);glFragColor=vec4(minz,maxz,0.,0.);}
#elif defined(ONEBEFORELAST)
uniform ivec2 texSize;void main(void)
{ivec2 coord=ivec2(vUV*vec2(texSize-1));vec2 f1=texelFetch(textureSampler,coord % texSize,0).rg;vec2 f2=texelFetch(textureSampler,(coord+ivec2(1,0)) % texSize,0).rg;vec2 f3=texelFetch(textureSampler,(coord+ivec2(1,1)) % texSize,0).rg;vec2 f4=texelFetch(textureSampler,(coord+ivec2(0,1)) % texSize,0).rg;float minz=min(f1.x,f2.x);float maxz=max(f1.y,f2.y);glFragColor=vec4(minz,maxz,0.,0.);}
#elif defined(LAST)
void main(void)
{glFragColor=vec4(0.);if (true) { 
discard;}}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[minmaxRedux_fragment_name] = minmaxRedux_fragment_shader;
/** @internal */
const minmaxReduxPixelShader = { name: minmaxRedux_fragment_name, shader: minmaxRedux_fragment_shader };
//# sourceMappingURL=minmaxRedux.fragment.js.map
;// ./node_modules/@babylonjs/core/Misc/minMaxReducer.js





/**
 * This class computes a min/max reduction from a texture: it means it computes the minimum
 * and maximum values from all values of the texture.
 * It is performed on the GPU for better performances, thanks to a succession of post processes.
 * The source values are read from the red channel of the texture.
 */
class MinMaxReducer {
    /**
     * Creates a min/max reducer
     * @param camera The camera to use for the post processes
     */
    constructor(camera) {
        /**
         * Observable triggered when the computation has been performed
         */
        this.onAfterReductionPerformed = new Misc_observable/* Observable */.cP();
        this._forceFullscreenViewport = true;
        this._activated = false;
        this._camera = camera;
        this._postProcessManager = new postProcessManager/* PostProcessManager */.X(camera.getScene());
        this._onContextRestoredObserver = camera.getEngine().onContextRestoredObservable.add(() => {
            this._postProcessManager._rebuild();
        });
    }
    /**
     * Gets the texture used to read the values from.
     */
    get sourceTexture() {
        return this._sourceTexture;
    }
    /**
     * Sets the source texture to read the values from.
     * One must indicate if the texture is a depth texture or not through the depthRedux parameter
     * because in such textures '1' value must not be taken into account to compute the maximum
     * as this value is used to clear the texture.
     * Note that the computation is not activated by calling this function, you must call activate() for that!
     * @param sourceTexture The texture to read the values from. The values should be in the red channel.
     * @param depthRedux Indicates if the texture is a depth texture or not
     * @param type The type of the textures created for the reduction (defaults to TEXTURETYPE_HALF_FLOAT)
     * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
     */
    setSourceTexture(sourceTexture, depthRedux, type = 2, forceFullscreenViewport = true) {
        if (sourceTexture === this._sourceTexture) {
            return;
        }
        this.dispose(false);
        this._sourceTexture = sourceTexture;
        this._reductionSteps = [];
        this._forceFullscreenViewport = forceFullscreenViewport;
        const scene = this._camera.getScene();
        // create the first step
        const reductionInitial = new PostProcesses_postProcess/* PostProcess */.w("Initial reduction phase", "minmaxRedux", // shader
        ["texSize"], ["sourceTexture"], // textures
        1.0, // options
        null, // camera
        1, // sampling
        scene.getEngine(), // engine
        false, // reusable
        "#define INITIAL" + (depthRedux ? "\n#define DEPTH_REDUX" : ""), // defines
        type, undefined, undefined, undefined, 7);
        reductionInitial.autoClear = false;
        reductionInitial.forceFullscreenViewport = forceFullscreenViewport;
        let w = this._sourceTexture.getRenderWidth(), h = this._sourceTexture.getRenderHeight();
        reductionInitial.onApply = ((w, h) => {
            return (effect) => {
                effect.setTexture("sourceTexture", this._sourceTexture);
                effect.setFloat2("texSize", w, h);
            };
        })(w, h);
        this._reductionSteps.push(reductionInitial);
        let index = 1;
        // create the additional steps
        while (w > 1 || h > 1) {
            w = Math.max(Math.round(w / 2), 1);
            h = Math.max(Math.round(h / 2), 1);
            const reduction = new PostProcesses_postProcess/* PostProcess */.w("Reduction phase " + index, "minmaxRedux", // shader
            ["texSize"], null, { width: w, height: h }, // options
            null, // camera
            1, // sampling
            scene.getEngine(), // engine
            false, // reusable
            "#define " + (w == 1 && h == 1 ? "LAST" : w == 1 || h == 1 ? "ONEBEFORELAST" : "MAIN"), // defines
            type, undefined, undefined, undefined, 7);
            reduction.autoClear = false;
            reduction.forceFullscreenViewport = forceFullscreenViewport;
            reduction.onApply = ((w, h) => {
                return (effect) => {
                    if (w == 1 || h == 1) {
                        effect.setInt2("texSize", w, h);
                    }
                    else {
                        effect.setFloat2("texSize", w, h);
                    }
                };
            })(w, h);
            this._reductionSteps.push(reduction);
            index++;
            if (w == 1 && h == 1) {
                const func = (w, h, reduction) => {
                    const buffer = new Float32Array(4 * w * h), minmax = { min: 0, max: 0 };
                    return () => {
                        scene.getEngine()._readTexturePixels(reduction.inputTexture.texture, w, h, -1, 0, buffer, false);
                        minmax.min = buffer[0];
                        minmax.max = buffer[1];
                        this.onAfterReductionPerformed.notifyObservers(minmax);
                    };
                };
                reduction.onAfterRenderObservable.add(func(w, h, reduction));
            }
        }
    }
    /**
     * Defines the refresh rate of the computation.
     * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...
     */
    get refreshRate() {
        return this._sourceTexture ? this._sourceTexture.refreshRate : -1;
    }
    set refreshRate(value) {
        if (this._sourceTexture) {
            this._sourceTexture.refreshRate = value;
        }
    }
    /**
     * Gets the activation status of the reducer
     */
    get activated() {
        return this._activated;
    }
    /**
     * Activates the reduction computation.
     * When activated, the observers registered in onAfterReductionPerformed are
     * called after the computation is performed
     */
    activate() {
        if (this._onAfterUnbindObserver || !this._sourceTexture) {
            return;
        }
        this._onAfterUnbindObserver = this._sourceTexture.onAfterUnbindObservable.add(() => {
            const engine = this._camera.getScene().getEngine();
            engine._debugPushGroup?.(`min max reduction`, 1);
            this._reductionSteps[0].activate(this._camera);
            this._postProcessManager.directRender(this._reductionSteps, this._reductionSteps[0].inputTexture, this._forceFullscreenViewport);
            engine.unBindFramebuffer(this._reductionSteps[0].inputTexture, false);
            engine._debugPopGroup?.(1);
        });
        this._activated = true;
    }
    /**
     * Deactivates the reduction computation.
     */
    deactivate() {
        if (!this._onAfterUnbindObserver || !this._sourceTexture) {
            return;
        }
        this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver);
        this._onAfterUnbindObserver = null;
        this._activated = false;
    }
    /**
     * Disposes the min/max reducer
     * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.
     */
    dispose(disposeAll = true) {
        if (disposeAll) {
            this.onAfterReductionPerformed.clear();
            if (this._onContextRestoredObserver) {
                this._camera.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver);
                this._onContextRestoredObserver = null;
            }
        }
        this.deactivate();
        if (this._reductionSteps) {
            for (let i = 0; i < this._reductionSteps.length; ++i) {
                this._reductionSteps[i].dispose();
            }
            this._reductionSteps = null;
        }
        if (this._postProcessManager && disposeAll) {
            this._postProcessManager.dispose();
        }
        this._sourceTexture = null;
    }
}
//# sourceMappingURL=minMaxReducer.js.map
;// ./node_modules/@babylonjs/core/Misc/depthReducer.js



/**
 * This class is a small wrapper around the MinMaxReducer class to compute the min/max values of a depth texture
 */
class DepthReducer extends MinMaxReducer {
    /**
     * Gets the depth renderer used for the computation.
     * Note that the result is null if you provide your own renderer when calling setDepthRenderer.
     */
    get depthRenderer() {
        return this._depthRenderer;
    }
    /**
     * Creates a depth reducer
     * @param camera The camera used to render the depth texture
     */
    constructor(camera) {
        super(camera);
    }
    /**
     * Sets the depth renderer to use to generate the depth map
     * @param depthRenderer The depth renderer to use. If not provided, a new one will be created automatically
     * @param type The texture type of the depth map (default: TEXTURETYPE_HALF_FLOAT)
     * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
     */
    setDepthRenderer(depthRenderer = null, type = 2, forceFullscreenViewport = true) {
        const scene = this._camera.getScene();
        if (this._depthRenderer) {
            delete scene._depthRenderer[this._depthRendererId];
            this._depthRenderer.dispose();
            this._depthRenderer = null;
        }
        if (depthRenderer === null) {
            if (!scene._depthRenderer) {
                scene._depthRenderer = {};
            }
            depthRenderer = this._depthRenderer = new DepthRenderer(scene, type, this._camera, false, 1);
            depthRenderer.enabled = false;
            this._depthRendererId = "minmax" + this._camera.id;
            scene._depthRenderer[this._depthRendererId] = depthRenderer;
        }
        super.setSourceTexture(depthRenderer.getDepthMap(), true, type, forceFullscreenViewport);
    }
    /**
     * @internal
     */
    setSourceTexture(sourceTexture, depthRedux, type = 2, forceFullscreenViewport = true) {
        super.setSourceTexture(sourceTexture, depthRedux, type, forceFullscreenViewport);
    }
    /**
     * Activates the reduction computation.
     * When activated, the observers registered in onAfterReductionPerformed are
     * called after the computation is performed
     */
    activate() {
        if (this._depthRenderer) {
            this._depthRenderer.enabled = true;
        }
        super.activate();
    }
    /**
     * Deactivates the reduction computation.
     */
    deactivate() {
        super.deactivate();
        if (this._depthRenderer) {
            this._depthRenderer.enabled = false;
        }
    }
    /**
     * Disposes the depth reducer
     * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.
     */
    dispose(disposeAll = true) {
        super.dispose(disposeAll);
        if (this._depthRenderer && disposeAll) {
            const scene = this._depthRenderer.getDepthMap().getScene();
            if (scene) {
                delete scene._depthRenderer[this._depthRendererId];
            }
            this._depthRenderer.dispose();
            this._depthRenderer = null;
        }
    }
}
//# sourceMappingURL=depthReducer.js.map
;// ./node_modules/@babylonjs/core/Lights/Shadows/cascadedShadowGenerator.js









// eslint-disable-next-line @typescript-eslint/naming-convention
const UpDir = math_vector/* Vector3 */.Pq.Up();
// eslint-disable-next-line @typescript-eslint/naming-convention
const ZeroVec = math_vector/* Vector3 */.Pq.Zero();
const tmpv1 = new math_vector/* Vector3 */.Pq(), tmpv2 = new math_vector/* Vector3 */.Pq(), tmpMatrix = new math_vector/* Matrix */.uq();
/**
 * A CSM implementation allowing casting shadows on large scenes.
 * Documentation : https://doc.babylonjs.com/babylon101/cascadedShadows
 * Based on: https://github.com/TheRealMJP/Shadows and https://johanmedestrom.wordpress.com/2016/03/18/opengl-cascaded-shadow-maps/
 */
class CascadedShadowGenerator extends ShadowGenerator {
    _validateFilter(filter) {
        if (filter === ShadowGenerator.FILTER_NONE || filter === ShadowGenerator.FILTER_PCF || filter === ShadowGenerator.FILTER_PCSS) {
            return filter;
        }
        logger/* Logger */.V.Error('Unsupported filter "' + filter + '"!');
        return ShadowGenerator.FILTER_NONE;
    }
    /**
     * Gets or set the number of cascades used by the CSM.
     */
    get numCascades() {
        return this._numCascades;
    }
    set numCascades(value) {
        value = Math.min(Math.max(value, CascadedShadowGenerator.MIN_CASCADES_COUNT), CascadedShadowGenerator.MAX_CASCADES_COUNT);
        if (value === this._numCascades) {
            return;
        }
        this._numCascades = value;
        this.recreateShadowMap();
        this._recreateSceneUBOs();
    }
    /**
     * Enables or disables the shadow casters bounding info computation.
     * If your shadow casters don't move, you can disable this feature.
     * If it is enabled, the bounding box computation is done every frame.
     */
    get freezeShadowCastersBoundingInfo() {
        return this._freezeShadowCastersBoundingInfo;
    }
    set freezeShadowCastersBoundingInfo(freeze) {
        if (this._freezeShadowCastersBoundingInfoObservable && freeze) {
            this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable);
            this._freezeShadowCastersBoundingInfoObservable = null;
        }
        if (!this._freezeShadowCastersBoundingInfoObservable && !freeze) {
            this._freezeShadowCastersBoundingInfoObservable = this._scene.onBeforeRenderObservable.add(() => this._computeShadowCastersBoundingInfo());
        }
        this._freezeShadowCastersBoundingInfo = freeze;
        if (freeze) {
            this._computeShadowCastersBoundingInfo();
        }
    }
    _computeShadowCastersBoundingInfo() {
        this._scbiMin.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        this._scbiMax.copyFromFloats(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
        if (this._shadowMap && this._shadowMap.renderList) {
            const renderList = this._shadowMap.renderList;
            for (let meshIndex = 0; meshIndex < renderList.length; meshIndex++) {
                const mesh = renderList[meshIndex];
                if (!mesh) {
                    continue;
                }
                const boundingInfo = mesh.getBoundingInfo(), boundingBox = boundingInfo.boundingBox;
                this._scbiMin.minimizeInPlace(boundingBox.minimumWorld);
                this._scbiMax.maximizeInPlace(boundingBox.maximumWorld);
            }
            const meshes = this._scene.meshes;
            for (let meshIndex = 0; meshIndex < meshes.length; meshIndex++) {
                const mesh = meshes[meshIndex];
                if (!mesh || !mesh.isVisible || !mesh.isEnabled || !mesh.receiveShadows) {
                    continue;
                }
                const boundingInfo = mesh.getBoundingInfo(), boundingBox = boundingInfo.boundingBox;
                this._scbiMin.minimizeInPlace(boundingBox.minimumWorld);
                this._scbiMax.maximizeInPlace(boundingBox.maximumWorld);
            }
        }
        this._shadowCastersBoundingInfo.reConstruct(this._scbiMin, this._scbiMax);
    }
    /**
     * Gets or sets the shadow casters bounding info.
     * If you provide your own shadow casters bounding info, first enable freezeShadowCastersBoundingInfo
     * so that the system won't overwrite the bounds you provide
     */
    get shadowCastersBoundingInfo() {
        return this._shadowCastersBoundingInfo;
    }
    set shadowCastersBoundingInfo(boundingInfo) {
        this._shadowCastersBoundingInfo = boundingInfo;
    }
    /**
     * Sets the minimal and maximal distances to use when computing the cascade breaks.
     *
     * The values of min / max are typically the depth zmin and zmax values of your scene, for a given frame.
     * If you don't know these values, simply leave them to their defaults and don't call this function.
     * @param min minimal distance for the breaks (default to 0.)
     * @param max maximal distance for the breaks (default to 1.)
     */
    setMinMaxDistance(min, max) {
        if (this._minDistance === min && this._maxDistance === max) {
            return;
        }
        if (min > max) {
            min = 0;
            max = 1;
        }
        if (min < 0) {
            min = 0;
        }
        if (max > 1) {
            max = 1;
        }
        this._minDistance = min;
        this._maxDistance = max;
        this._breaksAreDirty = true;
    }
    /** Gets the minimal distance used in the cascade break computation */
    get minDistance() {
        return this._minDistance;
    }
    /** Gets the maximal distance used in the cascade break computation */
    get maxDistance() {
        return this._maxDistance;
    }
    /**
     * Gets the class name of that object
     * @returns "CascadedShadowGenerator"
     */
    getClassName() {
        return CascadedShadowGenerator.CLASSNAME;
    }
    /**
     * Gets a cascade minimum extents
     * @param cascadeIndex index of the cascade
     * @returns the minimum cascade extents
     */
    getCascadeMinExtents(cascadeIndex) {
        return cascadeIndex >= 0 && cascadeIndex < this._numCascades ? this._cascadeMinExtents[cascadeIndex] : null;
    }
    /**
     * Gets a cascade maximum extents
     * @param cascadeIndex index of the cascade
     * @returns the maximum cascade extents
     */
    getCascadeMaxExtents(cascadeIndex) {
        return cascadeIndex >= 0 && cascadeIndex < this._numCascades ? this._cascadeMaxExtents[cascadeIndex] : null;
    }
    /**
     * Gets the shadow max z distance. It's the limit beyond which shadows are not displayed.
     * It defaults to camera.maxZ
     */
    get shadowMaxZ() {
        if (!this._getCamera()) {
            return 0;
        }
        return this._shadowMaxZ;
    }
    /**
     * Sets the shadow max z distance.
     */
    set shadowMaxZ(value) {
        const camera = this._getCamera();
        if (!camera) {
            this._shadowMaxZ = value;
            return;
        }
        if (this._shadowMaxZ === value || value < camera.minZ || (value > camera.maxZ && camera.maxZ !== 0)) {
            return;
        }
        this._shadowMaxZ = value;
        this._light._markMeshesAsLightDirty();
        this._breaksAreDirty = true;
    }
    /**
     * Gets or sets the debug flag.
     * When enabled, the cascades are materialized by different colors on the screen.
     */
    get debug() {
        return this._debug;
    }
    set debug(dbg) {
        this._debug = dbg;
        this._light._markMeshesAsLightDirty();
    }
    /**
     * Gets or sets the depth clamping value.
     *
     * When enabled, it improves the shadow quality because the near z plane of the light frustum don't need to be adjusted
     * to account for the shadow casters far away.
     *
     * Note that this property is incompatible with PCSS filtering, so it won't be used in that case.
     */
    get depthClamp() {
        return this._depthClamp;
    }
    set depthClamp(value) {
        this._depthClamp = value;
    }
    /**
     * Gets or sets the percentage of blending between two cascades (value between 0. and 1.).
     * It defaults to 0.1 (10% blending).
     */
    get cascadeBlendPercentage() {
        return this._cascadeBlendPercentage;
    }
    set cascadeBlendPercentage(value) {
        this._cascadeBlendPercentage = value;
        this._light._markMeshesAsLightDirty();
    }
    /**
     * Gets or set the lambda parameter.
     * This parameter is used to split the camera frustum and create the cascades.
     * It's a value between 0. and 1.: If 0, the split is a uniform split of the frustum, if 1 it is a logarithmic split.
     * For all values in-between, it's a linear combination of the uniform and logarithm split algorithm.
     */
    get lambda() {
        return this._lambda;
    }
    set lambda(value) {
        const lambda = Math.min(Math.max(value, 0), 1);
        if (this._lambda == lambda) {
            return;
        }
        this._lambda = lambda;
        this._breaksAreDirty = true;
    }
    /**
     * Gets the view matrix corresponding to a given cascade
     * @param cascadeNum cascade to retrieve the view matrix from
     * @returns the cascade view matrix
     */
    getCascadeViewMatrix(cascadeNum) {
        return cascadeNum >= 0 && cascadeNum < this._numCascades ? this._viewMatrices[cascadeNum] : null;
    }
    /**
     * Gets the projection matrix corresponding to a given cascade
     * @param cascadeNum cascade to retrieve the projection matrix from
     * @returns the cascade projection matrix
     */
    getCascadeProjectionMatrix(cascadeNum) {
        return cascadeNum >= 0 && cascadeNum < this._numCascades ? this._projectionMatrices[cascadeNum] : null;
    }
    /**
     * Gets the transformation matrix corresponding to a given cascade
     * @param cascadeNum cascade to retrieve the transformation matrix from
     * @returns the cascade transformation matrix
     */
    getCascadeTransformMatrix(cascadeNum) {
        return cascadeNum >= 0 && cascadeNum < this._numCascades ? this._transformMatrices[cascadeNum] : null;
    }
    /**
     * Sets the depth renderer to use when autoCalcDepthBounds is enabled.
     *
     * Note that if no depth renderer is set, a new one will be automatically created internally when necessary.
     *
     * You should call this function if you already have a depth renderer enabled in your scene, to avoid
     * doing multiple depth rendering each frame. If you provide your own depth renderer, make sure it stores linear depth!
     * @param depthRenderer The depth renderer to use when autoCalcDepthBounds is enabled. If you pass null or don't call this function at all, a depth renderer will be automatically created
     */
    setDepthRenderer(depthRenderer) {
        this._depthRenderer = depthRenderer;
        if (this._depthReducer) {
            this._depthReducer.setDepthRenderer(this._depthRenderer);
        }
    }
    /**
     * Gets or sets the autoCalcDepthBounds property.
     *
     * When enabled, a depth rendering pass is first performed (with an internally created depth renderer or with the one
     * you provide by calling setDepthRenderer). Then, a min/max reducing is applied on the depth map to compute the
     * minimal and maximal depth of the map and those values are used as inputs for the setMinMaxDistance() function.
     * It can greatly enhance the shadow quality, at the expense of more GPU works.
     * When using this option, you should increase the value of the lambda parameter, and even set it to 1 for best results.
     */
    get autoCalcDepthBounds() {
        return this._autoCalcDepthBounds;
    }
    set autoCalcDepthBounds(value) {
        const camera = this._getCamera();
        if (!camera) {
            return;
        }
        this._autoCalcDepthBounds = value;
        if (!value) {
            if (this._depthReducer) {
                this._depthReducer.deactivate();
            }
            this.setMinMaxDistance(0, 1);
            return;
        }
        if (!this._depthReducer) {
            this._depthReducer = new DepthReducer(camera);
            this._depthReducer.onAfterReductionPerformed.add((minmax) => {
                let min = minmax.min, max = minmax.max;
                if (min >= max) {
                    min = 0;
                    max = 1;
                }
                if (min != this._minDistance || max != this._maxDistance) {
                    this.setMinMaxDistance(min, max);
                }
            });
            this._depthReducer.setDepthRenderer(this._depthRenderer);
        }
        this._depthReducer.activate();
    }
    /**
     * Defines the refresh rate of the min/max computation used when autoCalcDepthBounds is set to true
     * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...
     * Note that if you provided your own depth renderer through a call to setDepthRenderer, you are responsible
     * for setting the refresh rate on the renderer yourself!
     */
    get autoCalcDepthBoundsRefreshRate() {
        return this._depthReducer?.depthRenderer?.getDepthMap().refreshRate ?? -1;
    }
    set autoCalcDepthBoundsRefreshRate(value) {
        if (this._depthReducer?.depthRenderer) {
            this._depthReducer.depthRenderer.getDepthMap().refreshRate = value;
        }
    }
    /**
     * Create the cascade breaks according to the lambda, shadowMaxZ and min/max distance properties, as well as the camera near and far planes.
     * This function is automatically called when updating lambda, shadowMaxZ and min/max distances, however you should call it yourself if
     * you change the camera near/far planes!
     */
    splitFrustum() {
        this._breaksAreDirty = true;
    }
    _splitFrustum() {
        const camera = this._getCamera();
        if (!camera) {
            return;
        }
        const near = camera.minZ, far = camera.maxZ || this._shadowMaxZ, // account for infinite far plane (ie. maxZ = 0)
        cameraRange = far - near, minDistance = this._minDistance, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? Math.min((this._shadowMaxZ - near) / (far - near), this._maxDistance) : this._maxDistance;
        const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange;
        const range = maxZ - minZ, ratio = maxZ / minZ;
        for (let cascadeIndex = 0; cascadeIndex < this._cascades.length; ++cascadeIndex) {
            const p = (cascadeIndex + 1) / this._numCascades, log = minZ * ratio ** p, uniform = minZ + range * p;
            const d = this._lambda * (log - uniform) + uniform;
            this._cascades[cascadeIndex].prevBreakDistance = cascadeIndex === 0 ? minDistance : this._cascades[cascadeIndex - 1].breakDistance;
            this._cascades[cascadeIndex].breakDistance = (d - near) / cameraRange;
            this._viewSpaceFrustumsZ[cascadeIndex] = d;
            this._frustumLengths[cascadeIndex] = (this._cascades[cascadeIndex].breakDistance - this._cascades[cascadeIndex].prevBreakDistance) * cameraRange;
        }
        this._breaksAreDirty = false;
    }
    _computeMatrices() {
        const scene = this._scene;
        const camera = this._getCamera();
        if (!camera) {
            return;
        }
        math_vector/* Vector3 */.Pq.NormalizeToRef(this._light.getShadowDirection(0), this._lightDirection);
        if (Math.abs(math_vector/* Vector3 */.Pq.Dot(this._lightDirection, math_vector/* Vector3 */.Pq.Up())) === 1.0) {
            this._lightDirection.z = 0.0000000000001; // Required to avoid perfectly perpendicular light
        }
        this._cachedDirection.copyFrom(this._lightDirection);
        const useReverseDepthBuffer = scene.getEngine().useReverseDepthBuffer;
        for (let cascadeIndex = 0; cascadeIndex < this._numCascades; ++cascadeIndex) {
            this._computeFrustumInWorldSpace(cascadeIndex);
            this._computeCascadeFrustum(cascadeIndex);
            this._cascadeMaxExtents[cascadeIndex].subtractToRef(this._cascadeMinExtents[cascadeIndex], tmpv1); // tmpv1 = cascadeExtents
            // Get position of the shadow camera
            this._frustumCenter[cascadeIndex].addToRef(this._lightDirection.scale(this._cascadeMinExtents[cascadeIndex].z), this._shadowCameraPos[cascadeIndex]);
            // Come up with a new orthographic camera for the shadow caster
            math_vector/* Matrix */.uq.LookAtLHToRef(this._shadowCameraPos[cascadeIndex], this._frustumCenter[cascadeIndex], UpDir, this._viewMatrices[cascadeIndex]);
            let minZ = 0, maxZ = tmpv1.z;
            // Try to tighten minZ and maxZ based on the bounding box of the shadow casters
            const boundingInfo = this._shadowCastersBoundingInfo;
            boundingInfo.update(this._viewMatrices[cascadeIndex]);
            maxZ = Math.min(maxZ, boundingInfo.boundingBox.maximumWorld.z);
            if (!this._depthClamp || this.filter === ShadowGenerator.FILTER_PCSS) {
                // If we don't use depth clamping, we must set minZ so that all shadow casters are in the light frustum
                minZ = Math.min(minZ, boundingInfo.boundingBox.minimumWorld.z);
            }
            else {
                // If using depth clamping, we can adjust minZ to reduce the [minZ, maxZ] range (and get some additional precision in the shadow map)
                minZ = Math.max(minZ, boundingInfo.boundingBox.minimumWorld.z);
            }
            math_vector/* Matrix */.uq.OrthoOffCenterLHToRef(this._cascadeMinExtents[cascadeIndex].x, this._cascadeMaxExtents[cascadeIndex].x, this._cascadeMinExtents[cascadeIndex].y, this._cascadeMaxExtents[cascadeIndex].y, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, this._projectionMatrices[cascadeIndex], scene.getEngine().isNDCHalfZRange);
            this._cascadeMinExtents[cascadeIndex].z = minZ;
            this._cascadeMaxExtents[cascadeIndex].z = maxZ;
            this._viewMatrices[cascadeIndex].multiplyToRef(this._projectionMatrices[cascadeIndex], this._transformMatrices[cascadeIndex]);
            // Create the rounding matrix, by projecting the world-space origin and determining
            // the fractional offset in texel space
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(ZeroVec, this._transformMatrices[cascadeIndex], tmpv1); // tmpv1 = shadowOrigin
            tmpv1.scaleInPlace(this._mapSize / 2);
            tmpv2.copyFromFloats(Math.round(tmpv1.x), Math.round(tmpv1.y), Math.round(tmpv1.z)); // tmpv2 = roundedOrigin
            tmpv2.subtractInPlace(tmpv1).scaleInPlace(2 / this._mapSize); // tmpv2 = roundOffset
            math_vector/* Matrix */.uq.TranslationToRef(tmpv2.x, tmpv2.y, 0.0, tmpMatrix);
            this._projectionMatrices[cascadeIndex].multiplyToRef(tmpMatrix, this._projectionMatrices[cascadeIndex]);
            this._viewMatrices[cascadeIndex].multiplyToRef(this._projectionMatrices[cascadeIndex], this._transformMatrices[cascadeIndex]);
            this._transformMatrices[cascadeIndex].copyToArray(this._transformMatricesAsArray, cascadeIndex * 16);
        }
    }
    // Get the 8 points of the view frustum in world space
    _computeFrustumInWorldSpace(cascadeIndex) {
        const camera = this._getCamera();
        if (!camera) {
            return;
        }
        const prevSplitDist = this._cascades[cascadeIndex].prevBreakDistance, splitDist = this._cascades[cascadeIndex].breakDistance;
        const isNDCHalfZRange = this._scene.getEngine().isNDCHalfZRange;
        camera.getViewMatrix(); // make sure the transformation matrix we get when calling 'getTransformationMatrix()' is calculated with an up to date view matrix
        const cameraInfiniteFarPlane = camera.maxZ === 0;
        const saveCameraMaxZ = camera.maxZ;
        if (cameraInfiniteFarPlane) {
            camera.maxZ = this._shadowMaxZ;
            camera.getProjectionMatrix(true);
        }
        const invViewProj = math_vector/* Matrix */.uq.Invert(camera.getTransformationMatrix());
        if (cameraInfiniteFarPlane) {
            camera.maxZ = saveCameraMaxZ;
            camera.getProjectionMatrix(true);
        }
        const cornerIndexOffset = this._scene.getEngine().useReverseDepthBuffer ? 4 : 0;
        for (let cornerIndex = 0; cornerIndex < CascadedShadowGenerator._FrustumCornersNDCSpace.length; ++cornerIndex) {
            tmpv1.copyFrom(CascadedShadowGenerator._FrustumCornersNDCSpace[(cornerIndex + cornerIndexOffset) % CascadedShadowGenerator._FrustumCornersNDCSpace.length]);
            if (isNDCHalfZRange && tmpv1.z === -1) {
                tmpv1.z = 0;
            }
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(tmpv1, invViewProj, this._frustumCornersWorldSpace[cascadeIndex][cornerIndex]);
        }
        // Get the corners of the current cascade slice of the view frustum
        for (let cornerIndex = 0; cornerIndex < CascadedShadowGenerator._FrustumCornersNDCSpace.length / 2; ++cornerIndex) {
            tmpv1.copyFrom(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex + 4]).subtractInPlace(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex]);
            tmpv2.copyFrom(tmpv1).scaleInPlace(prevSplitDist); // near corner ray
            tmpv1.scaleInPlace(splitDist); // far corner ray
            tmpv1.addInPlace(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex]);
            this._frustumCornersWorldSpace[cascadeIndex][cornerIndex + 4].copyFrom(tmpv1);
            this._frustumCornersWorldSpace[cascadeIndex][cornerIndex].addInPlace(tmpv2);
        }
    }
    _computeCascadeFrustum(cascadeIndex) {
        this._cascadeMinExtents[cascadeIndex].copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        this._cascadeMaxExtents[cascadeIndex].copyFromFloats(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
        this._frustumCenter[cascadeIndex].copyFromFloats(0, 0, 0);
        const camera = this._getCamera();
        if (!camera) {
            return;
        }
        // Calculate the centroid of the view frustum slice
        for (let cornerIndex = 0; cornerIndex < this._frustumCornersWorldSpace[cascadeIndex].length; ++cornerIndex) {
            this._frustumCenter[cascadeIndex].addInPlace(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex]);
        }
        this._frustumCenter[cascadeIndex].scaleInPlace(1 / this._frustumCornersWorldSpace[cascadeIndex].length);
        if (this.stabilizeCascades) {
            // Calculate the radius of a bounding sphere surrounding the frustum corners
            let sphereRadius = 0;
            for (let cornerIndex = 0; cornerIndex < this._frustumCornersWorldSpace[cascadeIndex].length; ++cornerIndex) {
                const dist = this._frustumCornersWorldSpace[cascadeIndex][cornerIndex].subtractToRef(this._frustumCenter[cascadeIndex], tmpv1).length();
                sphereRadius = Math.max(sphereRadius, dist);
            }
            sphereRadius = Math.ceil(sphereRadius * 16) / 16;
            this._cascadeMaxExtents[cascadeIndex].copyFromFloats(sphereRadius, sphereRadius, sphereRadius);
            this._cascadeMinExtents[cascadeIndex].copyFromFloats(-sphereRadius, -sphereRadius, -sphereRadius);
        }
        else {
            // Create a temporary view matrix for the light
            const lightCameraPos = this._frustumCenter[cascadeIndex];
            this._frustumCenter[cascadeIndex].addToRef(this._lightDirection, tmpv1); // tmpv1 = look at
            math_vector/* Matrix */.uq.LookAtLHToRef(lightCameraPos, tmpv1, UpDir, tmpMatrix); // matrix = lightView
            // Calculate an AABB around the frustum corners
            for (let cornerIndex = 0; cornerIndex < this._frustumCornersWorldSpace[cascadeIndex].length; ++cornerIndex) {
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._frustumCornersWorldSpace[cascadeIndex][cornerIndex], tmpMatrix, tmpv1);
                this._cascadeMinExtents[cascadeIndex].minimizeInPlace(tmpv1);
                this._cascadeMaxExtents[cascadeIndex].maximizeInPlace(tmpv1);
            }
        }
    }
    _recreateSceneUBOs() {
        this._disposeSceneUBOs();
        if (this._sceneUBOs) {
            for (let i = 0; i < this._numCascades; ++i) {
                this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for CSM Shadow Generator (light "${this._light.name}" cascade #${i})`));
            }
        }
    }
    /**
     *  Support test.
     */
    static get IsSupported() {
        const engine = engineStore/* EngineStore */.q.LastCreatedEngine;
        if (!engine) {
            return false;
        }
        return engine._features.supportCSM;
    }
    /**
     * Creates a Cascaded Shadow Generator object.
     * A ShadowGenerator is the required tool to use the shadows.
     * Each directional light casting shadows needs to use its own ShadowGenerator.
     * Documentation : https://doc.babylonjs.com/babylon101/cascadedShadows
     * @param mapSize The size of the texture what stores the shadows. Example : 1024.
     * @param light The directional light object generating the shadows.
     * @param usefulFloatFirst By default the generator will try to use half float textures but if you need precision (for self shadowing for instance), you can use this option to enforce full float texture.
     * @param camera Camera associated with this shadow generator (default: null). If null, takes the scene active camera at the time we need to access it
     * @param useRedTextureType Forces the generator to use a Red instead of a RGBA type for the shadow map texture format (default: true)
     */
    constructor(mapSize, light, usefulFloatFirst, camera, useRedTextureType = true) {
        if (!CascadedShadowGenerator.IsSupported) {
            logger/* Logger */.V.Error("CascadedShadowMap is not supported by the current engine.");
            return;
        }
        super(mapSize, light, usefulFloatFirst, camera, useRedTextureType);
        this.usePercentageCloserFiltering = true;
    }
    _initializeGenerator() {
        this.penumbraDarkness = this.penumbraDarkness ?? 1.0;
        this._numCascades = this._numCascades ?? CascadedShadowGenerator.DEFAULT_CASCADES_COUNT;
        this.stabilizeCascades = this.stabilizeCascades ?? false;
        this._freezeShadowCastersBoundingInfoObservable = this._freezeShadowCastersBoundingInfoObservable ?? null;
        this.freezeShadowCastersBoundingInfo = this.freezeShadowCastersBoundingInfo ?? false;
        this._scbiMin = this._scbiMin ?? new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._scbiMax = this._scbiMax ?? new math_vector/* Vector3 */.Pq(0, 0, 0);
        this._shadowCastersBoundingInfo = this._shadowCastersBoundingInfo ?? new boundingInfo/* BoundingInfo */.j(new math_vector/* Vector3 */.Pq(0, 0, 0), new math_vector/* Vector3 */.Pq(0, 0, 0));
        this._breaksAreDirty = this._breaksAreDirty ?? true;
        this._minDistance = this._minDistance ?? 0;
        this._maxDistance = this._maxDistance ?? 1;
        this._currentLayer = this._currentLayer ?? 0;
        this._shadowMaxZ = this._shadowMaxZ ?? this._getCamera()?.maxZ ?? 10000;
        this._debug = this._debug ?? false;
        this._depthClamp = this._depthClamp ?? true;
        this._cascadeBlendPercentage = this._cascadeBlendPercentage ?? 0.1;
        this._lambda = this._lambda ?? 0.5;
        this._autoCalcDepthBounds = this._autoCalcDepthBounds ?? false;
        this._recreateSceneUBOs();
        super._initializeGenerator();
    }
    _createTargetRenderTexture() {
        const engine = this._scene.getEngine();
        const size = { width: this._mapSize, height: this._mapSize, layers: this.numCascades };
        this._shadowMap = new Textures_renderTargetTexture/* RenderTargetTexture */.$(this._light.name + "_CSMShadowMap", size, this._scene, false, true, this._textureType, false, undefined, false, false, undefined, this._useRedTextureType ? 6 : 5);
        this._shadowMap.createDepthStencilTexture(engine.useReverseDepthBuffer ? 516 : 513, true, undefined, undefined, undefined, `DepthStencilForCSMShadowGenerator-${this._light.name}`);
        this._shadowMap.noPrePassRenderer = true;
    }
    _initializeShadowMap() {
        super._initializeShadowMap();
        if (this._shadowMap === null) {
            return;
        }
        this._transformMatricesAsArray = new Float32Array(this._numCascades * 16);
        this._viewSpaceFrustumsZ = new Array(this._numCascades);
        this._frustumLengths = new Array(this._numCascades);
        this._lightSizeUVCorrection = new Array(this._numCascades * 2);
        this._depthCorrection = new Array(this._numCascades);
        this._cascades = [];
        this._viewMatrices = [];
        this._projectionMatrices = [];
        this._transformMatrices = [];
        this._cascadeMinExtents = [];
        this._cascadeMaxExtents = [];
        this._frustumCenter = [];
        this._shadowCameraPos = [];
        this._frustumCornersWorldSpace = [];
        for (let cascadeIndex = 0; cascadeIndex < this._numCascades; ++cascadeIndex) {
            this._cascades[cascadeIndex] = {
                prevBreakDistance: 0,
                breakDistance: 0,
            };
            this._viewMatrices[cascadeIndex] = math_vector/* Matrix */.uq.Zero();
            this._projectionMatrices[cascadeIndex] = math_vector/* Matrix */.uq.Zero();
            this._transformMatrices[cascadeIndex] = math_vector/* Matrix */.uq.Zero();
            this._cascadeMinExtents[cascadeIndex] = new math_vector/* Vector3 */.Pq();
            this._cascadeMaxExtents[cascadeIndex] = new math_vector/* Vector3 */.Pq();
            this._frustumCenter[cascadeIndex] = new math_vector/* Vector3 */.Pq();
            this._shadowCameraPos[cascadeIndex] = new math_vector/* Vector3 */.Pq();
            this._frustumCornersWorldSpace[cascadeIndex] = new Array(CascadedShadowGenerator._FrustumCornersNDCSpace.length);
            for (let i = 0; i < CascadedShadowGenerator._FrustumCornersNDCSpace.length; ++i) {
                this._frustumCornersWorldSpace[cascadeIndex][i] = new math_vector/* Vector3 */.Pq();
            }
        }
        const engine = this._scene.getEngine();
        this._shadowMap.onBeforeBindObservable.clear();
        this._shadowMap.onBeforeRenderObservable.clear();
        this._shadowMap.onBeforeRenderObservable.add((layer) => {
            if (this._sceneUBOs) {
                this._scene.setSceneUniformBuffer(this._sceneUBOs[layer]);
            }
            this._currentLayer = layer;
            if (this._filter === ShadowGenerator.FILTER_PCF) {
                engine.setColorWrite(false);
            }
            this._scene.setTransformMatrix(this.getCascadeViewMatrix(layer), this.getCascadeProjectionMatrix(layer));
            if (this._useUBO) {
                this._scene.getSceneUniformBuffer().unbindEffect();
                this._scene.finalizeSceneUbo();
            }
        });
        this._shadowMap.onBeforeBindObservable.add(() => {
            this._currentSceneUBO = this._scene.getSceneUniformBuffer();
            engine._debugPushGroup?.(`cascaded shadow map generation for pass id ${engine.currentRenderPassId}`, 1);
            if (this._breaksAreDirty) {
                this._splitFrustum();
            }
            this._computeMatrices();
        });
        this._splitFrustum();
    }
    _bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect) {
        effect.setMatrix("viewProjection", this.getCascadeTransformMatrix(this._currentLayer));
    }
    _isReadyCustomDefines(defines) {
        defines.push("#define SM_DEPTHCLAMP " + (this._depthClamp && this._filter !== ShadowGenerator.FILTER_PCSS ? "1" : "0"));
    }
    /**
     * Prepare all the defines in a material relying on a shadow map at the specified light index.
     * @param defines Defines of the material we want to update
     * @param lightIndex Index of the light in the enabled light list of the material
     */
    prepareDefines(defines, lightIndex) {
        super.prepareDefines(defines, lightIndex);
        const scene = this._scene;
        const light = this._light;
        if (!scene.shadowsEnabled || !light.shadowEnabled) {
            return;
        }
        defines["SHADOWCSM" + lightIndex] = true;
        defines["SHADOWCSMDEBUG" + lightIndex] = this.debug;
        defines["SHADOWCSMNUM_CASCADES" + lightIndex] = this.numCascades;
        defines["SHADOWCSM_RIGHTHANDED" + lightIndex] = scene.useRightHandedSystem;
        const camera = this._getCamera();
        if (camera && this._shadowMaxZ <= (camera.maxZ || this._shadowMaxZ)) {
            defines["SHADOWCSMUSESHADOWMAXZ" + lightIndex] = true;
        }
        if (this.cascadeBlendPercentage === 0) {
            defines["SHADOWCSMNOBLEND" + lightIndex] = true;
        }
    }
    /**
     * Binds the shadow related information inside of an effect (information like near, far, darkness...
     * defined in the generator but impacting the effect).
     * @param lightIndex Index of the light in the enabled light list of the material owning the effect
     * @param effect The effect we are binfing the information for
     */
    bindShadowLight(lightIndex, effect) {
        const light = this._light;
        const scene = this._scene;
        if (!scene.shadowsEnabled || !light.shadowEnabled) {
            return;
        }
        const camera = this._getCamera();
        if (!camera) {
            return;
        }
        const shadowMap = this.getShadowMap();
        if (!shadowMap) {
            return;
        }
        const width = shadowMap.getSize().width;
        effect.setMatrices("lightMatrix" + lightIndex, this._transformMatricesAsArray);
        effect.setArray("viewFrustumZ" + lightIndex, this._viewSpaceFrustumsZ);
        effect.setFloat("cascadeBlendFactor" + lightIndex, this.cascadeBlendPercentage === 0 ? 10000 : 1 / this.cascadeBlendPercentage);
        effect.setArray("frustumLengths" + lightIndex, this._frustumLengths);
        // Only PCF uses depth stencil texture.
        if (this._filter === ShadowGenerator.FILTER_PCF) {
            effect.setDepthStencilTexture("shadowTexture" + lightIndex, shadowMap);
            light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), width, 1 / width, this.frustumEdgeFalloff, lightIndex);
        }
        else if (this._filter === ShadowGenerator.FILTER_PCSS) {
            for (let cascadeIndex = 0; cascadeIndex < this._numCascades; ++cascadeIndex) {
                this._lightSizeUVCorrection[cascadeIndex * 2 + 0] =
                    cascadeIndex === 0
                        ? 1
                        : (this._cascadeMaxExtents[0].x - this._cascadeMinExtents[0].x) / (this._cascadeMaxExtents[cascadeIndex].x - this._cascadeMinExtents[cascadeIndex].x); // x correction
                this._lightSizeUVCorrection[cascadeIndex * 2 + 1] =
                    cascadeIndex === 0
                        ? 1
                        : (this._cascadeMaxExtents[0].y - this._cascadeMinExtents[0].y) / (this._cascadeMaxExtents[cascadeIndex].y - this._cascadeMinExtents[cascadeIndex].y); // y correction
                this._depthCorrection[cascadeIndex] =
                    cascadeIndex === 0
                        ? 1
                        : (this._cascadeMaxExtents[cascadeIndex].z - this._cascadeMinExtents[cascadeIndex].z) / (this._cascadeMaxExtents[0].z - this._cascadeMinExtents[0].z);
            }
            effect.setDepthStencilTexture("shadowTexture" + lightIndex, shadowMap);
            effect.setTexture("depthTexture" + lightIndex, shadowMap);
            effect.setArray2("lightSizeUVCorrection" + lightIndex, this._lightSizeUVCorrection);
            effect.setArray("depthCorrection" + lightIndex, this._depthCorrection);
            effect.setFloat("penumbraDarkness" + lightIndex, this.penumbraDarkness);
            light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), 1 / width, this._contactHardeningLightSizeUVRatio * width, this.frustumEdgeFalloff, lightIndex);
        }
        else {
            effect.setTexture("shadowTexture" + lightIndex, shadowMap);
            light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), width, 1 / width, this.frustumEdgeFalloff, lightIndex);
        }
        light._uniformBuffer.updateFloat2("depthValues", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera), lightIndex);
    }
    /**
     * Gets the transformation matrix of the first cascade used to project the meshes into the map from the light point of view.
     * (eq to view projection * shadow projection matrices)
     * @returns The transform matrix used to create the shadow map
     */
    getTransformMatrix() {
        return this.getCascadeTransformMatrix(0);
    }
    /**
     * Disposes the ShadowGenerator.
     * Returns nothing.
     */
    dispose() {
        super.dispose();
        if (this._freezeShadowCastersBoundingInfoObservable) {
            this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable);
            this._freezeShadowCastersBoundingInfoObservable = null;
        }
        if (this._depthReducer) {
            this._depthReducer.dispose();
            this._depthReducer = null;
        }
    }
    /**
     * Serializes the shadow generator setup to a json object.
     * @returns The serialized JSON object
     */
    serialize() {
        const serializationObject = super.serialize();
        const shadowMap = this.getShadowMap();
        if (!shadowMap) {
            return serializationObject;
        }
        serializationObject.numCascades = this._numCascades;
        serializationObject.debug = this._debug;
        serializationObject.stabilizeCascades = this.stabilizeCascades;
        serializationObject.lambda = this._lambda;
        serializationObject.cascadeBlendPercentage = this.cascadeBlendPercentage;
        serializationObject.depthClamp = this._depthClamp;
        serializationObject.autoCalcDepthBounds = this.autoCalcDepthBounds;
        serializationObject.shadowMaxZ = this._shadowMaxZ;
        serializationObject.penumbraDarkness = this.penumbraDarkness;
        serializationObject.freezeShadowCastersBoundingInfo = this._freezeShadowCastersBoundingInfo;
        serializationObject.minDistance = this.minDistance;
        serializationObject.maxDistance = this.maxDistance;
        serializationObject.renderList = [];
        if (shadowMap.renderList) {
            for (let meshIndex = 0; meshIndex < shadowMap.renderList.length; meshIndex++) {
                const mesh = shadowMap.renderList[meshIndex];
                serializationObject.renderList.push(mesh.id);
            }
        }
        return serializationObject;
    }
    /**
     * Parses a serialized ShadowGenerator and returns a new ShadowGenerator.
     * @param parsedShadowGenerator The JSON object to parse
     * @param scene The scene to create the shadow map for
     * @returns The parsed shadow generator
     */
    static Parse(parsedShadowGenerator, scene) {
        const shadowGenerator = ShadowGenerator.Parse(parsedShadowGenerator, scene, (mapSize, light, camera) => new CascadedShadowGenerator(mapSize, light, undefined, camera));
        if (parsedShadowGenerator.numCascades !== undefined) {
            shadowGenerator.numCascades = parsedShadowGenerator.numCascades;
        }
        if (parsedShadowGenerator.debug !== undefined) {
            shadowGenerator.debug = parsedShadowGenerator.debug;
        }
        if (parsedShadowGenerator.stabilizeCascades !== undefined) {
            shadowGenerator.stabilizeCascades = parsedShadowGenerator.stabilizeCascades;
        }
        if (parsedShadowGenerator.lambda !== undefined) {
            shadowGenerator.lambda = parsedShadowGenerator.lambda;
        }
        if (parsedShadowGenerator.cascadeBlendPercentage !== undefined) {
            shadowGenerator.cascadeBlendPercentage = parsedShadowGenerator.cascadeBlendPercentage;
        }
        if (parsedShadowGenerator.depthClamp !== undefined) {
            shadowGenerator.depthClamp = parsedShadowGenerator.depthClamp;
        }
        if (parsedShadowGenerator.autoCalcDepthBounds !== undefined) {
            shadowGenerator.autoCalcDepthBounds = parsedShadowGenerator.autoCalcDepthBounds;
        }
        if (parsedShadowGenerator.shadowMaxZ !== undefined) {
            shadowGenerator.shadowMaxZ = parsedShadowGenerator.shadowMaxZ;
        }
        if (parsedShadowGenerator.penumbraDarkness !== undefined) {
            shadowGenerator.penumbraDarkness = parsedShadowGenerator.penumbraDarkness;
        }
        if (parsedShadowGenerator.freezeShadowCastersBoundingInfo !== undefined) {
            shadowGenerator.freezeShadowCastersBoundingInfo = parsedShadowGenerator.freezeShadowCastersBoundingInfo;
        }
        if (parsedShadowGenerator.minDistance !== undefined && parsedShadowGenerator.maxDistance !== undefined) {
            shadowGenerator.setMinMaxDistance(parsedShadowGenerator.minDistance, parsedShadowGenerator.maxDistance);
        }
        return shadowGenerator;
    }
}
CascadedShadowGenerator._FrustumCornersNDCSpace = [
    new math_vector/* Vector3 */.Pq(-1.0, +1.0, -1.0),
    new math_vector/* Vector3 */.Pq(+1.0, +1.0, -1.0),
    new math_vector/* Vector3 */.Pq(+1.0, -1.0, -1.0),
    new math_vector/* Vector3 */.Pq(-1.0, -1.0, -1.0),
    new math_vector/* Vector3 */.Pq(-1.0, +1.0, +1.0),
    new math_vector/* Vector3 */.Pq(+1.0, +1.0, +1.0),
    new math_vector/* Vector3 */.Pq(+1.0, -1.0, +1.0),
    new math_vector/* Vector3 */.Pq(-1.0, -1.0, +1.0),
];
/**
 * Name of the CSM class
 */
CascadedShadowGenerator.CLASSNAME = "CascadedShadowGenerator";
/**
 * Defines the default number of cascades used by the CSM.
 */
CascadedShadowGenerator.DEFAULT_CASCADES_COUNT = 4;
/**
 * Defines the minimum number of cascades used by the CSM.
 */
CascadedShadowGenerator.MIN_CASCADES_COUNT = 2;
/**
 * Defines the maximum number of cascades used by the CSM.
 */
CascadedShadowGenerator.MAX_CASCADES_COUNT = 4;
/**
 * @internal
 */
CascadedShadowGenerator._SceneComponentInitialization = (_) => {
    throw (0,devTools/* _WarnImport */.n)("ShadowGeneratorSceneComponent");
};
//# sourceMappingURL=cascadedShadowGenerator.js.map
;// ./node_modules/@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js




// Adds the parser to the scene parsers.
(0,babylonFileParser_function/* AddParser */.ji)(sceneComponent/* SceneComponentConstants */.v.NAME_SHADOWGENERATOR, (parsedData, scene) => {
    // Shadows
    if (parsedData.shadowGenerators !== undefined && parsedData.shadowGenerators !== null) {
        for (let index = 0, cache = parsedData.shadowGenerators.length; index < cache; index++) {
            const parsedShadowGenerator = parsedData.shadowGenerators[index];
            if (parsedShadowGenerator.className === CascadedShadowGenerator.CLASSNAME) {
                CascadedShadowGenerator.Parse(parsedShadowGenerator, scene);
            }
            else {
                ShadowGenerator.Parse(parsedShadowGenerator, scene);
            }
            // SG would be available on their associated lights
        }
    }
});
/**
 * Defines the shadow generator component responsible to manage any shadow generators
 * in a given scene.
 */
class ShadowGeneratorSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_SHADOWGENERATOR;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._gatherRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR, this, this._gatherRenderTargets);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing To Do Here.
    }
    /**
     * Serializes the component data to the specified json object
     * @param serializationObject The object to serialize to
     */
    serialize(serializationObject) {
        // Shadows
        serializationObject.shadowGenerators = [];
        const lights = this.scene.lights;
        for (const light of lights) {
            const shadowGenerators = light.getShadowGenerators();
            if (shadowGenerators) {
                const iterator = shadowGenerators.values();
                for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
                    const shadowGenerator = key.value;
                    serializationObject.shadowGenerators.push(shadowGenerator.serialize());
                }
            }
        }
    }
    /**
     * Adds all the elements from the container to the scene
     * @param container the container holding the elements
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    addFromContainer(container) {
        // Nothing To Do Here. (directly attached to a light)
    }
    /**
     * Removes all the elements in the container from the scene
     * @param container contains the elements to remove
     * @param dispose if the removed element should be disposed (default: false)
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    removeFromContainer(container, dispose) {
        // Nothing To Do Here. (directly attached to a light)
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    dispose() {
        // Nothing To Do Here.
    }
    _gatherRenderTargets(renderTargets) {
        // Shadows
        const scene = this.scene;
        if (this.scene.shadowsEnabled) {
            for (let lightIndex = 0; lightIndex < scene.lights.length; lightIndex++) {
                const light = scene.lights[lightIndex];
                const shadowGenerators = light.getShadowGenerators();
                if (light.isEnabled() && light.shadowEnabled && shadowGenerators) {
                    const iterator = shadowGenerators.values();
                    for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
                        const shadowGenerator = key.value;
                        const shadowMap = shadowGenerator.getShadowMap();
                        if (scene.textures.indexOf(shadowMap) !== -1) {
                            renderTargets.push(shadowMap);
                        }
                    }
                }
            }
        }
    }
}
ShadowGenerator._SceneComponentInitialization = (scene) => {
    let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_SHADOWGENERATOR);
    if (!component) {
        component = new ShadowGeneratorSceneComponent(scene);
        scene._addComponent(component);
    }
};
//# sourceMappingURL=shadowGeneratorSceneComponent.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/shadowMap.fragment.js + 2 modules
var shadowMap_fragment = __webpack_require__(87428);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/shadowMap.vertex.js + 2 modules
var shadowMap_vertex = __webpack_require__(32303);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/depthBoxBlur.fragment.js
var depthBoxBlur_fragment = __webpack_require__(10355);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowMapFragmentSoftTransparentShadow.js
var shadowMapFragmentSoftTransparentShadow = __webpack_require__(95799);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/shadowMap.fragment.js + 2 modules
var Shaders_shadowMap_fragment = __webpack_require__(70169);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/shadowMap.vertex.js + 6 modules
var Shaders_shadowMap_vertex = __webpack_require__(29468);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/depthBoxBlur.fragment.js
var Shaders_depthBoxBlur_fragment = __webpack_require__(69386);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow.js
var ShadersInclude_shadowMapFragmentSoftTransparentShadow = __webpack_require__(85426);
;// ./node_modules/@babylonjs/core/Lights/Shadows/index.js



// Blur postprocess








//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/pointLight.js
var pointLight = __webpack_require__(67524);
;// ./node_modules/@babylonjs/core/Lights/index.js
/* eslint-disable import/no-internal-modules */







//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Loading/loadingScreen.js

/**
 * Class used for the default loading screen
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
 */
class DefaultLoadingScreen {
    /**
     * Creates a new default loading screen
     * @param _renderingCanvas defines the canvas used to render the scene
     * @param _loadingText defines the default text to display
     * @param _loadingDivBackgroundColor defines the default background color
     */
    constructor(_renderingCanvas, _loadingText = "", _loadingDivBackgroundColor = "black") {
        this._renderingCanvas = _renderingCanvas;
        this._loadingText = _loadingText;
        this._loadingDivBackgroundColor = _loadingDivBackgroundColor;
        // Resize
        this._resizeLoadingUI = () => {
            const canvasRect = this._renderingCanvas.getBoundingClientRect();
            const canvasPositioning = window.getComputedStyle(this._renderingCanvas).position;
            if (!this._loadingDiv) {
                return;
            }
            this._loadingDiv.style.position = canvasPositioning === "fixed" ? "fixed" : "absolute";
            this._loadingDiv.style.left = canvasRect.left + "px";
            this._loadingDiv.style.top = canvasRect.top + "px";
            this._loadingDiv.style.width = canvasRect.width + "px";
            this._loadingDiv.style.height = canvasRect.height + "px";
        };
    }
    /**
     * Function called to display the loading screen
     */
    displayLoadingUI() {
        if (this._loadingDiv) {
            // Do not add a loading screen if there is already one
            return;
        }
        this._loadingDiv = document.createElement("div");
        this._loadingDiv.id = "babylonjsLoadingDiv";
        this._loadingDiv.style.opacity = "0";
        this._loadingDiv.style.transition = "opacity 1.5s ease";
        this._loadingDiv.style.pointerEvents = "none";
        this._loadingDiv.style.display = "grid";
        this._loadingDiv.style.gridTemplateRows = "100%";
        this._loadingDiv.style.gridTemplateColumns = "100%";
        this._loadingDiv.style.justifyItems = "center";
        this._loadingDiv.style.alignItems = "center";
        // Loading text
        this._loadingTextDiv = document.createElement("div");
        this._loadingTextDiv.style.position = "absolute";
        this._loadingTextDiv.style.left = "0";
        this._loadingTextDiv.style.top = "50%";
        this._loadingTextDiv.style.marginTop = "80px";
        this._loadingTextDiv.style.width = "100%";
        this._loadingTextDiv.style.height = "20px";
        this._loadingTextDiv.style.fontFamily = "Arial";
        this._loadingTextDiv.style.fontSize = "14px";
        this._loadingTextDiv.style.color = "white";
        this._loadingTextDiv.style.textAlign = "center";
        this._loadingTextDiv.style.zIndex = "1";
        this._loadingTextDiv.innerHTML = "Loading";
        this._loadingDiv.appendChild(this._loadingTextDiv);
        //set the predefined text
        this._loadingTextDiv.innerHTML = this._loadingText;
        // Generating keyframes
        this._style = document.createElement("style");
        this._style.type = "text/css";
        const keyFrames = `@-webkit-keyframes spin1 {\
                    0% { -webkit-transform: rotate(0deg);}
                    100% { -webkit-transform: rotate(360deg);}
                }\
                @keyframes spin1 {\
                    0% { transform: rotate(0deg);}
                    100% { transform: rotate(360deg);}
                }`;
        this._style.innerHTML = keyFrames;
        document.getElementsByTagName("head")[0].appendChild(this._style);
        const svgSupport = !!window.SVGSVGElement;
        // Loading img
        const imgBack = new Image();
        if (!DefaultLoadingScreen.DefaultLogoUrl) {
            imgBack.src = !svgSupport
                ? "https://cdn.babylonjs.com/Assets/babylonLogo.png"
                : `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODAuMTcgMjA4LjA0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6I2UwNjg0Yjt9LmNscy0ze2ZpbGw6I2JiNDY0Yjt9LmNscy00e2ZpbGw6I2UwZGVkODt9LmNscy01e2ZpbGw6I2Q1ZDJjYTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkJhYnlsb25Mb2dvPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iUGFnZV9FbGVtZW50cyIgZGF0YS1uYW1lPSJQYWdlIEVsZW1lbnRzIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05MC4wOSwwLDAsNTJWMTU2bDkwLjA5LDUyLDkwLjA4LTUyVjUyWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxODAuMTcgNTIuMDEgMTUxLjk3IDM1LjczIDEyNC44NSA1MS4zOSAxNTMuMDUgNjcuNjcgMTgwLjE3IDUyLjAxIi8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjI3LjEyIDY3LjY3IDExNy4yMSAxNS42NiA5MC4wOCAwIDAgNTIuMDEgMjcuMTIgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iNjEuODkgMTIwLjMgOTAuMDggMTM2LjU4IDExOC4yOCAxMjAuMyA5MC4wOCAxMDQuMDIgNjEuODkgMTIwLjMiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDE1My4wNSAxNDAuMzcgOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyAwIDUyLjAxIDAgMTU2LjAzIDkwLjA4IDIwOC4wNCAxODAuMTcgMTU2LjAzIDE4MC4xNyA1Mi4wMSAxNTMuMDUgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iOTAuMDggNzEuNDYgNjEuODkgODcuNzQgNjEuODkgMTIwLjMgOTAuMDggMTA0LjAyIDExOC4yOCAxMjAuMyAxMTguMjggODcuNzQgOTAuMDggNzEuNDYiLz48cG9seWdvbiBjbGFzcz0iY2xzLTQiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDExOC4yOCA4Ny43NCAxMTguMjggMTIwLjMgOTAuMDggMTM2LjU4IDkwLjA4IDE3Ni43MiAxNTMuMDUgMTQwLjM3IDE1My4wNSA2Ny42NyIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSIyNy4xMiA2Ny42NyA2MS44OSA4Ny43NCA2MS44OSAxMjAuMyA5MC4wOCAxMzYuNTggOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyIvPjwvZz48L2c+PC9zdmc+`;
        }
        else {
            imgBack.src = DefaultLoadingScreen.DefaultLogoUrl;
        }
        imgBack.style.width = "150px";
        imgBack.style.gridColumn = "1";
        imgBack.style.gridRow = "1";
        imgBack.style.top = "50%";
        imgBack.style.left = "50%";
        imgBack.style.transform = "translate(-50%, -50%)";
        imgBack.style.position = "absolute";
        const imageSpinnerContainer = document.createElement("div");
        imageSpinnerContainer.style.width = "300px";
        imageSpinnerContainer.style.gridColumn = "1";
        imageSpinnerContainer.style.gridRow = "1";
        imageSpinnerContainer.style.top = "50%";
        imageSpinnerContainer.style.left = "50%";
        imageSpinnerContainer.style.transform = "translate(-50%, -50%)";
        imageSpinnerContainer.style.position = "absolute";
        // Loading spinner
        const imgSpinner = new Image();
        if (!DefaultLoadingScreen.DefaultSpinnerUrl) {
            imgSpinner.src = !svgSupport
                ? "https://cdn.babylonjs.com/Assets/loadingIcon.png"
                : `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOTIgMzkyIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UwNjg0Yjt9LmNscy0ye2ZpbGw6bm9uZTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlNwaW5uZXJJY29uPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iU3Bpbm5lciI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDAuMjEsMTI2LjQzYzMuNy03LjMxLDcuNjctMTQuNDQsMTItMjEuMzJsMy4zNi01LjEsMy41Mi01YzEuMjMtMS42MywyLjQxLTMuMjksMy42NS00LjkxczIuNTMtMy4yMSwzLjgyLTQuNzlBMTg1LjIsMTg1LjIsMCwwLDEsODMuNCw2Ny40M2EyMDgsMjA4LDAsMCwxLDE5LTE1LjY2YzMuMzUtMi40MSw2Ljc0LTQuNzgsMTAuMjUtN3M3LjExLTQuMjgsMTAuNzUtNi4zMmM3LjI5LTQsMTQuNzMtOCwyMi41My0xMS40OSwzLjktMS43Miw3Ljg4LTMuMywxMi00LjY0YTEwNC4yMiwxMDQuMjIsMCwwLDEsMTIuNDQtMy4yMyw2Mi40NCw2Mi40NCwwLDAsMSwxMi43OC0xLjM5QTI1LjkyLDI1LjkyLDAsMCwxLDE5NiwyMS40NGE2LjU1LDYuNTUsMCwwLDEsMi4wNSw5LDYuNjYsNi42NiwwLDAsMS0xLjY0LDEuNzhsLS40MS4yOWEyMi4wNywyMi4wNywwLDAsMS01Ljc4LDMsMzAuNDIsMzAuNDIsMCwwLDEtNS42NywxLjYyLDM3LjgyLDM3LjgyLDAsMCwxLTUuNjkuNzFjLTEsMC0xLjkuMTgtMi44NS4yNmwtMi44NS4yNHEtNS43Mi41MS0xMS40OCwxLjFjLTMuODQuNC03LjcxLjgyLTExLjU4LDEuNGExMTIuMzQsMTEyLjM0LDAsMCwwLTIyLjk0LDUuNjFjLTMuNzIsMS4zNS03LjM0LDMtMTAuOTQsNC42NHMtNy4xNCwzLjUxLTEwLjYsNS41MUExNTEuNiwxNTEuNiwwLDAsMCw2OC41Niw4N0M2Ny4yMyw4OC40OCw2Niw5MCw2NC42NCw5MS41NnMtMi41MSwzLjE1LTMuNzUsNC43M2wtMy41NCw0LjljLTEuMTMsMS42Ni0yLjIzLDMuMzUtMy4zMyw1YTEyNywxMjcsMCwwLDAtMTAuOTMsMjEuNDksMS41OCwxLjU4LDAsMSwxLTMtMS4xNVM0MC4xOSwxMjYuNDcsNDAuMjEsMTI2LjQzWiIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjM5MiIgaGVpZ2h0PSIzOTIiLz48L2c+PC9nPjwvc3ZnPg==`;
        }
        else {
            imgSpinner.src = DefaultLoadingScreen.DefaultSpinnerUrl;
        }
        imgSpinner.style.animation = "spin1 0.75s infinite linear";
        imgSpinner.style.transformOrigin = "50% 50%";
        if (!svgSupport) {
            const logoSize = { w: 16, h: 18.5 };
            const loadingSize = { w: 30, h: 30 };
            // set styling correctly
            imgBack.style.width = `${logoSize.w}vh`;
            imgBack.style.height = `${logoSize.h}vh`;
            imgBack.style.left = `calc(50% - ${logoSize.w / 2}vh)`;
            imgBack.style.top = `calc(50% - ${logoSize.h / 2}vh)`;
            imgSpinner.style.width = `${loadingSize.w}vh`;
            imgSpinner.style.height = `${loadingSize.h}vh`;
            imgSpinner.style.left = `calc(50% - ${loadingSize.w / 2}vh)`;
            imgSpinner.style.top = `calc(50% - ${loadingSize.h / 2}vh)`;
        }
        imageSpinnerContainer.appendChild(imgSpinner);
        this._loadingDiv.appendChild(imgBack);
        this._loadingDiv.appendChild(imageSpinnerContainer);
        this._resizeLoadingUI();
        window.addEventListener("resize", this._resizeLoadingUI);
        this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor;
        document.body.appendChild(this._loadingDiv);
        this._loadingDiv.style.opacity = "1";
    }
    /**
     * Function called to hide the loading screen
     */
    hideLoadingUI() {
        if (!this._loadingDiv) {
            return;
        }
        const onTransitionEnd = () => {
            if (this._loadingTextDiv) {
                this._loadingTextDiv.remove();
                this._loadingTextDiv = null;
            }
            if (this._loadingDiv) {
                this._loadingDiv.remove();
                this._loadingDiv = null;
            }
            if (this._style) {
                this._style.remove();
                this._style = null;
            }
            window.removeEventListener("resize", this._resizeLoadingUI);
        };
        this._loadingDiv.style.opacity = "0";
        this._loadingDiv.addEventListener("transitionend", onTransitionEnd);
    }
    /**
     * Gets or sets the text to display while loading
     */
    set loadingUIText(text) {
        this._loadingText = text;
        if (this._loadingTextDiv) {
            this._loadingTextDiv.innerHTML = this._loadingText;
        }
    }
    get loadingUIText() {
        return this._loadingText;
    }
    /**
     * Gets or sets the color to use for the background
     */
    get loadingUIBackgroundColor() {
        return this._loadingDivBackgroundColor;
    }
    set loadingUIBackgroundColor(color) {
        this._loadingDivBackgroundColor = color;
        if (!this._loadingDiv) {
            return;
        }
        this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor;
    }
}
/** Gets or sets the logo url to use for the default loading screen */
DefaultLoadingScreen.DefaultLogoUrl = "";
/** Gets or sets the spinner url to use for the default loading screen */
DefaultLoadingScreen.DefaultSpinnerUrl = "";
abstractEngine/* AbstractEngine */.$.DefaultLoadingScreenFactory = (canvas) => {
    return new DefaultLoadingScreen(canvas);
};
//# sourceMappingURL=loadingScreen.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/geometry.js
var geometry = __webpack_require__(27050);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/multiMaterial.js
var Materials_multiMaterial = __webpack_require__(55157);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/HighDynamicRange/hdr.js
var hdr = __webpack_require__(82814);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js
var cubemapToSphericalPolynomial = __webpack_require__(36755);
;// ./node_modules/@babylonjs/core/Materials/Textures/Filtering/hdrFiltering.js





/**
 * Filters HDR maps to get correct renderings of PBR reflections
 */
class HDRFiltering {
    /**
     * Instantiates HDR filter for reflection maps
     *
     * @param engine Thin engine
     * @param options Options
     */
    constructor(engine, options = {}) {
        this._lodGenerationOffset = 0;
        this._lodGenerationScale = 0.8;
        /**
         * Quality switch for prefiltering. Should be set to `4096` unless
         * you care about baking speed.
         */
        this.quality = 4096;
        /**
         * Scales pixel intensity for the input HDR map.
         */
        this.hdrScale = 1;
        // pass
        this._engine = engine;
        this.hdrScale = options.hdrScale || this.hdrScale;
        this.quality = options.quality || this.quality;
    }
    _createRenderTarget(size) {
        let textureType = 0;
        if (this._engine.getCaps().textureHalfFloatRender) {
            textureType = 2;
        }
        else if (this._engine.getCaps().textureFloatRender) {
            textureType = 1;
        }
        const rtWrapper = this._engine.createRenderTargetCubeTexture(size, {
            format: 5,
            type: textureType,
            createMipMaps: true,
            generateMipMaps: false,
            generateDepthBuffer: false,
            generateStencilBuffer: false,
            samplingMode: 1,
        });
        this._engine.updateTextureWrappingMode(rtWrapper.texture, 0, 0, 0);
        this._engine.updateTextureSamplingMode(3, rtWrapper.texture, true);
        return rtWrapper;
    }
    _prefilterInternal(texture) {
        const width = texture.getSize().width;
        const mipmapsCount = (0,math_scalar_functions.ILog2)(width) + 1;
        const effect = this._effectWrapper.effect;
        const outputTexture = this._createRenderTarget(width);
        this._effectRenderer.saveStates();
        this._effectRenderer.setViewport();
        const intTexture = texture.getInternalTexture();
        if (intTexture) {
            // Just in case generate fresh clean mips.
            this._engine.updateTextureSamplingMode(3, intTexture, true);
        }
        this._effectRenderer.applyEffectWrapper(this._effectWrapper);
        const directions = [
            [new math/* Vector3 */.Pq(0, 0, -1), new math/* Vector3 */.Pq(0, -1, 0), new math/* Vector3 */.Pq(1, 0, 0)], // PositiveX
            [new math/* Vector3 */.Pq(0, 0, 1), new math/* Vector3 */.Pq(0, -1, 0), new math/* Vector3 */.Pq(-1, 0, 0)], // NegativeX
            [new math/* Vector3 */.Pq(1, 0, 0), new math/* Vector3 */.Pq(0, 0, 1), new math/* Vector3 */.Pq(0, 1, 0)], // PositiveY
            [new math/* Vector3 */.Pq(1, 0, 0), new math/* Vector3 */.Pq(0, 0, -1), new math/* Vector3 */.Pq(0, -1, 0)], // NegativeY
            [new math/* Vector3 */.Pq(1, 0, 0), new math/* Vector3 */.Pq(0, -1, 0), new math/* Vector3 */.Pq(0, 0, 1)], // PositiveZ
            [new math/* Vector3 */.Pq(-1, 0, 0), new math/* Vector3 */.Pq(0, -1, 0), new math/* Vector3 */.Pq(0, 0, -1)], // NegativeZ
        ];
        effect.setFloat("hdrScale", this.hdrScale);
        effect.setFloat2("vFilteringInfo", texture.getSize().width, mipmapsCount);
        effect.setTexture("inputTexture", texture);
        for (let face = 0; face < 6; face++) {
            effect.setVector3("up", directions[face][0]);
            effect.setVector3("right", directions[face][1]);
            effect.setVector3("front", directions[face][2]);
            for (let lod = 0; lod < mipmapsCount; lod++) {
                this._engine.bindFramebuffer(outputTexture, face, undefined, undefined, true, lod);
                this._effectRenderer.applyEffectWrapper(this._effectWrapper);
                let alpha = Math.pow(2, (lod - this._lodGenerationOffset) / this._lodGenerationScale) / width;
                if (lod === 0) {
                    alpha = 0;
                }
                effect.setFloat("alphaG", alpha);
                this._effectRenderer.draw();
            }
        }
        // Cleanup
        this._effectRenderer.restoreStates();
        this._engine.restoreDefaultFramebuffer();
        this._engine._releaseTexture(texture._texture);
        // Internal Swap
        const type = outputTexture.texture.type;
        const format = outputTexture.texture.format;
        outputTexture._swapAndDie(texture._texture);
        texture._texture.type = type;
        texture._texture.format = format;
        // New settings
        texture.gammaSpace = false;
        texture.lodGenerationOffset = this._lodGenerationOffset;
        texture.lodGenerationScale = this._lodGenerationScale;
        texture._prefiltered = true;
        return texture;
    }
    _createEffect(texture, onCompiled) {
        const defines = [];
        if (texture.gammaSpace) {
            defines.push("#define GAMMA_INPUT");
        }
        defines.push("#define NUM_SAMPLES " + this.quality + "u"); // unsigned int
        const isWebGPU = this._engine.isWebGPU;
        const effectWrapper = new effectRenderer/* EffectWrapper */.$({
            engine: this._engine,
            name: "hdrFiltering",
            vertexShader: "hdrFiltering",
            fragmentShader: "hdrFiltering",
            samplerNames: ["inputTexture"],
            uniformNames: ["vSampleDirections", "vWeights", "up", "right", "front", "vFilteringInfo", "hdrScale", "alphaG"],
            useShaderStore: true,
            defines,
            onCompiled: onCompiled,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 92248)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 50274))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 86109)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 55779))]);
                }
            },
        });
        return effectWrapper;
    }
    /**
     * Get a value indicating if the filter is ready to be used
     * @param texture Texture to filter
     * @returns true if the filter is ready
     */
    isReady(texture) {
        return texture.isReady() && this._effectWrapper.effect.isReady();
    }
    /**
     * Prefilters a cube texture to have mipmap levels representing roughness values.
     * Prefiltering will be invoked at the end of next rendering pass.
     * This has to be done once the map is loaded, and has not been prefiltered by a third party software.
     * See http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf for more information
     * @param texture Texture to filter
     * @param onFinished Callback when filtering is done
     * @returns Promise called when prefiltering is done
     */
    prefilter(texture, onFinished = null) {
        if (!this._engine._features.allowTexturePrefiltering) {
            logger/* Logger */.V.Warn("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.");
            return Promise.reject("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.");
        }
        return new Promise((resolve) => {
            this._effectRenderer = new effectRenderer/* EffectRenderer */.J(this._engine);
            this._effectWrapper = this._createEffect(texture);
            this._effectWrapper.effect.executeWhenCompiled(() => {
                this._prefilterInternal(texture);
                this._effectRenderer.dispose();
                this._effectWrapper.dispose();
                resolve();
                if (onFinished) {
                    onFinished();
                }
            });
        });
    }
}
//# sourceMappingURL=hdrFiltering.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.js
var baseTexture_polynomial = __webpack_require__(69764);
;// ./node_modules/@babylonjs/core/Materials/Textures/hdrCubeTexture.js













/**
 * This represents a texture coming from an HDR input.
 *
 * The only supported format is currently panorama picture stored in RGBE format.
 * Example of such files can be found on Poly Haven: https://polyhaven.com/hdris
 */
class HDRCubeTexture extends baseTexture/* BaseTexture */.t {
    /**
     * Sets whether or not the texture is blocking during loading.
     */
    set isBlocking(value) {
        this._isBlocking = value;
    }
    /**
     * Gets whether or not the texture is blocking during loading.
     */
    get isBlocking() {
        return this._isBlocking;
    }
    /**
     * Sets texture matrix rotation angle around Y axis in radians.
     */
    set rotationY(value) {
        this._rotationY = value;
        this.setReflectionTextureMatrix(math_vector/* Matrix */.uq.RotationY(this._rotationY));
    }
    /**
     * Gets texture matrix rotation angle around Y axis radians.
     */
    get rotationY() {
        return this._rotationY;
    }
    /**
     * Gets or sets the size of the bounding box associated with the cube texture
     * When defined, the cubemap will switch to local mode
     * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity
     * @example https://www.babylonjs-playground.com/#RNASML
     */
    set boundingBoxSize(value) {
        if (this._boundingBoxSize && this._boundingBoxSize.equals(value)) {
            return;
        }
        this._boundingBoxSize = value;
        const scene = this.getScene();
        if (scene) {
            scene.markAllMaterialsAsDirty(1);
        }
    }
    get boundingBoxSize() {
        return this._boundingBoxSize;
    }
    /**
     * Instantiates an HDRTexture from the following parameters.
     *
     * @param url The location of the HDR raw data (Panorama stored in RGBE format)
     * @param sceneOrEngine The scene or engine the texture will be used in
     * @param size The cubemap desired size (the more it increases the longer the generation will be)
     * @param noMipmap Forces to not generate the mipmap if true
     * @param generateHarmonics Specifies whether you want to extract the polynomial harmonics during the generation process
     * @param gammaSpace Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)
     * @param prefilterOnLoad Prefilters HDR texture to allow use of this texture as a PBR reflection texture.
     * @param onLoad on success callback function
     * @param onError on error callback function
     * @param supersample Defines if texture must be supersampled (default: false)
     */
    constructor(url, sceneOrEngine, size, noMipmap = false, generateHarmonics = true, gammaSpace = false, prefilterOnLoad = false, onLoad = null, onError = null, supersample = false) {
        super(sceneOrEngine);
        this._generateHarmonics = true;
        this._onError = null;
        this._isBlocking = true;
        this._rotationY = 0;
        /**
         * Gets or sets the center of the bounding box associated with the cube texture
         * It must define where the camera used to render the texture was set
         */
        this.boundingBoxPosition = math_vector/* Vector3 */.Pq.Zero();
        /**
         * Observable triggered once the texture has been loaded.
         */
        this.onLoadObservable = new Misc_observable/* Observable */.cP();
        if (!url) {
            return;
        }
        this._coordinatesMode = Textures_texture/* Texture */.g.CUBIC_MODE;
        this.name = url;
        this.url = url;
        this.hasAlpha = false;
        this.isCube = true;
        this._textureMatrix = math_vector/* Matrix */.uq.Identity();
        this._prefilterOnLoad = prefilterOnLoad;
        this._onLoad = () => {
            this.onLoadObservable.notifyObservers(this);
            if (onLoad) {
                onLoad();
            }
        };
        this._onError = onError;
        this.gammaSpace = gammaSpace;
        this._noMipmap = noMipmap;
        this._size = size;
        this._supersample = supersample;
        this._generateHarmonics = generateHarmonics;
        this._texture = this._getFromCache(url, this._noMipmap, undefined, undefined, undefined, this.isCube);
        if (!this._texture) {
            if (!this.getScene()?.useDelayedTextureLoading) {
                this._loadTexture();
            }
            else {
                this.delayLoadState = 4;
            }
        }
        else {
            if (this._texture.isReady) {
                tools/* Tools */.S0.SetImmediate(() => this._onLoad());
            }
            else {
                this._texture.onLoadedObservable.add(this._onLoad);
            }
        }
    }
    /**
     * Get the current class name of the texture useful for serialization or dynamic coding.
     * @returns "HDRCubeTexture"
     */
    getClassName() {
        return "HDRCubeTexture";
    }
    /**
     * Occurs when the file is raw .hdr file.
     */
    _loadTexture() {
        const engine = this._getEngine();
        const caps = engine.getCaps();
        let textureType = 0;
        if (caps.textureFloat && caps.textureFloatLinearFiltering) {
            textureType = 1;
        }
        else if (caps.textureHalfFloat && caps.textureHalfFloatLinearFiltering) {
            textureType = 2;
        }
        const callback = (buffer) => {
            this.lodGenerationOffset = 0.0;
            this.lodGenerationScale = 0.8;
            // Extract the raw linear data.
            const data = (0,hdr/* GetCubeMapTextureData */.VH)(buffer, this._size, this._supersample);
            // Generate harmonics if needed.
            if (this._generateHarmonics) {
                const sphericalPolynomial = cubemapToSphericalPolynomial/* CubeMapToSphericalPolynomialTools */.d.ConvertCubeMapToSphericalPolynomial(data);
                this.sphericalPolynomial = sphericalPolynomial;
            }
            const results = [];
            let byteArray = null;
            let shortArray = null;
            // Push each faces.
            for (let j = 0; j < 6; j++) {
                // Create fallback array
                if (textureType === 2) {
                    shortArray = new Uint16Array(this._size * this._size * 3);
                }
                else if (textureType === 0) {
                    // 3 channels of 1 bytes per pixel in bytes.
                    byteArray = new Uint8Array(this._size * this._size * 3);
                }
                const dataFace = data[HDRCubeTexture._FacesMapping[j]];
                // If special cases.
                if (this.gammaSpace || shortArray || byteArray) {
                    for (let i = 0; i < this._size * this._size; i++) {
                        // Put in gamma space if requested.
                        if (this.gammaSpace) {
                            dataFace[i * 3 + 0] = Math.pow(dataFace[i * 3 + 0], math_constants/* ToGammaSpace */.rv);
                            dataFace[i * 3 + 1] = Math.pow(dataFace[i * 3 + 1], math_constants/* ToGammaSpace */.rv);
                            dataFace[i * 3 + 2] = Math.pow(dataFace[i * 3 + 2], math_constants/* ToGammaSpace */.rv);
                        }
                        // Convert to half float texture for fallback.
                        if (shortArray) {
                            shortArray[i * 3 + 0] = (0,textureTools/* ToHalfFloat */.LZ)(dataFace[i * 3 + 0]);
                            shortArray[i * 3 + 1] = (0,textureTools/* ToHalfFloat */.LZ)(dataFace[i * 3 + 1]);
                            shortArray[i * 3 + 2] = (0,textureTools/* ToHalfFloat */.LZ)(dataFace[i * 3 + 2]);
                        }
                        // Convert to int texture for fallback.
                        if (byteArray) {
                            let r = Math.max(dataFace[i * 3 + 0] * 255, 0);
                            let g = Math.max(dataFace[i * 3 + 1] * 255, 0);
                            let b = Math.max(dataFace[i * 3 + 2] * 255, 0);
                            // May use luminance instead if the result is not accurate.
                            const max = Math.max(Math.max(r, g), b);
                            if (max > 255) {
                                const scale = 255 / max;
                                r *= scale;
                                g *= scale;
                                b *= scale;
                            }
                            byteArray[i * 3 + 0] = r;
                            byteArray[i * 3 + 1] = g;
                            byteArray[i * 3 + 2] = b;
                        }
                    }
                }
                if (shortArray) {
                    results.push(shortArray);
                }
                else if (byteArray) {
                    results.push(byteArray);
                }
                else {
                    results.push(dataFace);
                }
            }
            return results;
        };
        if (engine._features.allowTexturePrefiltering && this._prefilterOnLoad) {
            const previousOnLoad = this._onLoad;
            const hdrFiltering = new HDRFiltering(engine);
            this._onLoad = () => {
                hdrFiltering.prefilter(this, previousOnLoad);
            };
        }
        this._texture = engine.createRawCubeTextureFromUrl(this.url, this.getScene(), this._size, 4, textureType, this._noMipmap, callback, null, this._onLoad, this._onError);
    }
    clone() {
        const newTexture = new HDRCubeTexture(this.url, this.getScene() || this._getEngine(), this._size, this._noMipmap, this._generateHarmonics, this.gammaSpace);
        // Base texture
        newTexture.level = this.level;
        newTexture.wrapU = this.wrapU;
        newTexture.wrapV = this.wrapV;
        newTexture.coordinatesIndex = this.coordinatesIndex;
        newTexture.coordinatesMode = this.coordinatesMode;
        return newTexture;
    }
    // Methods
    delayLoad() {
        if (this.delayLoadState !== 4) {
            return;
        }
        this.delayLoadState = 1;
        this._texture = this._getFromCache(this.url, this._noMipmap);
        if (!this._texture) {
            this._loadTexture();
        }
    }
    /**
     * Get the texture reflection matrix used to rotate/transform the reflection.
     * @returns the reflection matrix
     */
    getReflectionTextureMatrix() {
        return this._textureMatrix;
    }
    /**
     * Set the texture reflection matrix used to rotate/transform the reflection.
     * @param value Define the reflection matrix to set
     */
    setReflectionTextureMatrix(value) {
        this._textureMatrix = value;
        if (value.updateFlag === this._textureMatrix.updateFlag) {
            return;
        }
        if (value.isIdentity() !== this._textureMatrix.isIdentity()) {
            this.getScene()?.markAllMaterialsAsDirty(1, (mat) => mat.getActiveTextures().indexOf(this) !== -1);
        }
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() {
        this.onLoadObservable.clear();
        super.dispose();
    }
    /**
     * Parses a JSON representation of an HDR Texture in order to create the texture
     * @param parsedTexture Define the JSON representation
     * @param scene Define the scene the texture should be created in
     * @param rootUrl Define the root url in case we need to load relative dependencies
     * @returns the newly created texture after parsing
     */
    static Parse(parsedTexture, scene, rootUrl) {
        let texture = null;
        if (parsedTexture.name && !parsedTexture.isRenderTarget) {
            texture = new HDRCubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.size, parsedTexture.noMipmap, parsedTexture.generateHarmonics, parsedTexture.useInGammaSpace);
            texture.name = parsedTexture.name;
            texture.hasAlpha = parsedTexture.hasAlpha;
            texture.level = parsedTexture.level;
            texture.coordinatesMode = parsedTexture.coordinatesMode;
            texture.isBlocking = parsedTexture.isBlocking;
        }
        if (texture) {
            if (parsedTexture.boundingBoxPosition) {
                texture.boundingBoxPosition = math_vector/* Vector3 */.Pq.FromArray(parsedTexture.boundingBoxPosition);
            }
            if (parsedTexture.boundingBoxSize) {
                texture.boundingBoxSize = math_vector/* Vector3 */.Pq.FromArray(parsedTexture.boundingBoxSize);
            }
            if (parsedTexture.rotationY) {
                texture.rotationY = parsedTexture.rotationY;
            }
        }
        return texture;
    }
    serialize() {
        if (!this.name) {
            return null;
        }
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.hasAlpha = this.hasAlpha;
        serializationObject.isCube = true;
        serializationObject.level = this.level;
        serializationObject.size = this._size;
        serializationObject.coordinatesMode = this.coordinatesMode;
        serializationObject.useInGammaSpace = this.gammaSpace;
        serializationObject.generateHarmonics = this._generateHarmonics;
        serializationObject.customType = "BABYLON.HDRCubeTexture";
        serializationObject.noMipmap = this._noMipmap;
        serializationObject.isBlocking = this._isBlocking;
        serializationObject.rotationY = this._rotationY;
        return serializationObject;
    }
}
HDRCubeTexture._FacesMapping = ["right", "left", "up", "down", "front", "back"];
(0,typeStore/* RegisterClass */.Y5)("BABYLON.HDRCubeTexture", HDRCubeTexture);
//# sourceMappingURL=hdrCubeTexture.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Morph/morphTargetManager.js
var Morph_morphTargetManager = __webpack_require__(98639);
;// ./node_modules/@babylonjs/core/Physics/castingResult.js

/**
 * Base class for results of casts.
 */
class CastingResult {
    constructor() {
        this._hasHit = false;
        this._hitNormal = math_vector/* Vector3 */.Pq.Zero();
        this._hitPoint = math_vector/* Vector3 */.Pq.Zero();
        this._triangleIndex = -1;
    }
    /**
     * Gets the hit point.
     */
    get hitPoint() {
        return this._hitPoint;
    }
    /**
     * Gets the hit normal.
     */
    get hitNormal() {
        return this._hitNormal;
    }
    /**
     * Gets if there was a hit
     */
    get hasHit() {
        return this._hasHit;
    }
    /*
     * The index of the original triangle which was hit. Will be -1 if contact point is not on a mesh shape
     */
    get triangleIndex() {
        return this._triangleIndex;
    }
    /**
     * Sets the hit data
     * @param hitNormal defines the normal in world space
     * @param hitPoint defines the point in world space
     * @param triangleIndex defines the index of the triangle in case of mesh shape
     */
    setHitData(hitNormal, hitPoint, triangleIndex) {
        this._hasHit = true;
        this._hitNormal.set(hitNormal.x, hitNormal.y, hitNormal.z);
        this._hitPoint.set(hitPoint.x, hitPoint.y, hitPoint.z);
        this._triangleIndex = triangleIndex ?? -1;
    }
    /**
     * Resets all the values to default
     */
    reset() {
        this._hasHit = false;
        this._hitNormal.setAll(0);
        this._hitPoint.setAll(0);
        this._triangleIndex = -1;
        this.body = undefined;
        this.bodyIndex = undefined;
        this.shape = undefined;
    }
}
//# sourceMappingURL=castingResult.js.map
;// ./node_modules/@babylonjs/core/Physics/physicsRaycastResult.js


/**
 * Holds the data for the raycast result
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class PhysicsRaycastResult extends CastingResult {
    constructor() {
        super(...arguments);
        this._hitDistance = 0;
        this._rayFromWorld = math_vector/* Vector3 */.Pq.Zero();
        this._rayToWorld = math_vector/* Vector3 */.Pq.Zero();
    }
    /**
     * Gets the distance from the hit
     */
    get hitDistance() {
        return this._hitDistance;
    }
    /**
     * Gets the hit normal/direction in the world
     */
    get hitNormalWorld() {
        return this._hitNormal;
    }
    /**
     * Gets the hit point in the world
     */
    get hitPointWorld() {
        return this._hitPoint;
    }
    /**
     * Gets the ray "start point" of the ray in the world
     */
    get rayFromWorld() {
        return this._rayFromWorld;
    }
    /**
     * Gets the ray "end point" of the ray in the world
     */
    get rayToWorld() {
        return this._rayToWorld;
    }
    /**
     * Sets the distance from the start point to the hit point
     * @param distance defines the distance to set
     */
    setHitDistance(distance) {
        this._hitDistance = distance;
    }
    /**
     * Calculates the distance manually
     */
    calculateHitDistance() {
        this._hitDistance = math_vector/* Vector3 */.Pq.Distance(this._rayFromWorld, this._hitPoint);
    }
    /**
     * Resets all the values to default
     * @param from The from point on world space
     * @param to The to point on world space
     */
    reset(from = math_vector/* Vector3 */.Pq.Zero(), to = math_vector/* Vector3 */.Pq.Zero()) {
        super.reset();
        this._rayFromWorld.copyFrom(from);
        this._rayToWorld.copyFrom(to);
        this._hitDistance = 0;
    }
}
//# sourceMappingURL=physicsRaycastResult.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/physicsEngine.js


/**
 * Class used to control physics engine
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class PhysicsEngine {
    /**
     *
     * @returns version
     */
    getPluginVersion() {
        return this._physicsPlugin.getPluginVersion();
    }
    /**
     * @virtual
     * Factory used to create the default physics plugin.
     * @returns The default physics plugin
     */
    static DefaultPluginFactory() {
        throw (0,devTools/* _WarnImport */.n)("CannonJSPlugin");
    }
    /**
     * Creates a new Physics Engine
     * @param gravity defines the gravity vector used by the simulation
     * @param _physicsPlugin defines the plugin to use (CannonJS by default)
     */
    constructor(gravity, _physicsPlugin = PhysicsEngine.DefaultPluginFactory()) {
        this._physicsPlugin = _physicsPlugin;
        /**
         * Global value used to control the smallest number supported by the simulation
         */
        this._impostors = [];
        this._joints = [];
        this._subTimeStep = 0;
        this._uniqueIdCounter = 0;
        if (!this._physicsPlugin.isSupported()) {
            throw new Error("Physics Engine " + this._physicsPlugin.name + " cannot be found. " + "Please make sure it is included.");
        }
        gravity = gravity || new math_vector/* Vector3 */.Pq(0, -9.807, 0);
        this.setGravity(gravity);
        this.setTimeStep();
    }
    /**
     * Sets the gravity vector used by the simulation
     * @param gravity defines the gravity vector to use
     */
    setGravity(gravity) {
        this.gravity = gravity;
        this._physicsPlugin.setGravity(this.gravity);
    }
    /**
     * Set the time step of the physics engine.
     * Default is 1/60.
     * To slow it down, enter 1/600 for example.
     * To speed it up, 1/30
     * @param newTimeStep defines the new timestep to apply to this world.
     */
    setTimeStep(newTimeStep = 1 / 60) {
        this._physicsPlugin.setTimeStep(newTimeStep);
    }
    /**
     * Get the time step of the physics engine.
     * @returns the current time step
     */
    getTimeStep() {
        return this._physicsPlugin.getTimeStep();
    }
    /**
     * Set the sub time step of the physics engine.
     * Default is 0 meaning there is no sub steps
     * To increase physics resolution precision, set a small value (like 1 ms)
     * @param subTimeStep defines the new sub timestep used for physics resolution.
     */
    setSubTimeStep(subTimeStep = 0) {
        this._subTimeStep = subTimeStep;
    }
    /**
     * Get the sub time step of the physics engine.
     * @returns the current sub time step
     */
    getSubTimeStep() {
        return this._subTimeStep;
    }
    /**
     * Release all resources
     */
    dispose() {
        this._impostors.forEach(function (impostor) {
            impostor.dispose();
        });
        this._physicsPlugin.dispose();
    }
    /**
     * Gets the name of the current physics plugin
     * @returns the name of the plugin
     */
    getPhysicsPluginName() {
        return this._physicsPlugin.name;
    }
    /**
     * Adding a new impostor for the impostor tracking.
     * This will be done by the impostor itself.
     * @param impostor the impostor to add
     */
    addImpostor(impostor) {
        this._impostors.push(impostor);
        impostor.uniqueId = this._uniqueIdCounter++;
        //if no parent, generate the body
        if (!impostor.parent) {
            this._physicsPlugin.generatePhysicsBody(impostor);
        }
    }
    /**
     * Remove an impostor from the engine.
     * This impostor and its mesh will not longer be updated by the physics engine.
     * @param impostor the impostor to remove
     */
    removeImpostor(impostor) {
        const index = this._impostors.indexOf(impostor);
        if (index > -1) {
            const removed = this._impostors.splice(index, 1);
            //Is it needed?
            if (removed.length) {
                this.getPhysicsPlugin().removePhysicsBody(impostor);
            }
        }
    }
    /**
     * Add a joint to the physics engine
     * @param mainImpostor defines the main impostor to which the joint is added.
     * @param connectedImpostor defines the impostor that is connected to the main impostor using this joint
     * @param joint defines the joint that will connect both impostors.
     */
    addJoint(mainImpostor, connectedImpostor, joint) {
        const impostorJoint = {
            mainImpostor: mainImpostor,
            connectedImpostor: connectedImpostor,
            joint: joint,
        };
        joint.physicsPlugin = this._physicsPlugin;
        this._joints.push(impostorJoint);
        this._physicsPlugin.generateJoint(impostorJoint);
    }
    /**
     * Removes a joint from the simulation
     * @param mainImpostor defines the impostor used with the joint
     * @param connectedImpostor defines the other impostor connected to the main one by the joint
     * @param joint defines the joint to remove
     */
    removeJoint(mainImpostor, connectedImpostor, joint) {
        const matchingJoints = this._joints.filter(function (impostorJoint) {
            return impostorJoint.connectedImpostor === connectedImpostor && impostorJoint.joint === joint && impostorJoint.mainImpostor === mainImpostor;
        });
        if (matchingJoints.length) {
            this._physicsPlugin.removeJoint(matchingJoints[0]);
            //TODO remove it from the list as well
        }
    }
    /**
     * Called by the scene. No need to call it.
     * @param delta defines the timespan between frames
     */
    _step(delta) {
        //check if any mesh has no body / requires an update
        this._impostors.forEach((impostor) => {
            if (impostor.isBodyInitRequired()) {
                this._physicsPlugin.generatePhysicsBody(impostor);
            }
        });
        if (delta > 0.1) {
            delta = 0.1;
        }
        else if (delta <= 0) {
            delta = 1.0 / 60.0;
        }
        this._physicsPlugin.executeStep(delta, this._impostors);
    }
    /**
     * Gets the current plugin used to run the simulation
     * @returns current plugin
     */
    getPhysicsPlugin() {
        return this._physicsPlugin;
    }
    /**
     * Gets the list of physic impostors
     * @returns an array of PhysicsImpostor
     */
    getImpostors() {
        return this._impostors;
    }
    /**
     * Gets the impostor for a physics enabled object
     * @param object defines the object impersonated by the impostor
     * @returns the PhysicsImpostor or null if not found
     */
    getImpostorForPhysicsObject(object) {
        for (let i = 0; i < this._impostors.length; ++i) {
            if (this._impostors[i].object === object) {
                return this._impostors[i];
            }
        }
        return null;
    }
    /**
     * Gets the impostor for a physics body object
     * @param body defines physics body used by the impostor
     * @returns the PhysicsImpostor or null if not found
     */
    getImpostorWithPhysicsBody(body) {
        for (let i = 0; i < this._impostors.length; ++i) {
            if (this._impostors[i].physicsBody === body) {
                return this._impostors[i];
            }
        }
        return null;
    }
    /**
     * Does a raycast in the physics world
     * @param from when should the ray start?
     * @param to when should the ray end?
     * @returns PhysicsRaycastResult
     */
    raycast(from, to) {
        return this._physicsPlugin.raycast(from, to);
    }
    /**
     * Does a raycast in the physics world
     * @param from when should the ray start?
     * @param to when should the ray end?
     * @param result resulting PhysicsRaycastResult
     * @returns true if the ray hits an impostor, else false
     */
    raycastToRef(from, to, result) {
        return this._physicsPlugin.raycastToRef(from, to, result);
    }
}
//# sourceMappingURL=physicsEngine.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/Plugins/cannonJSPlugin.js








/** @internal */
class CannonJSPlugin {
    constructor(_useDeltaForWorldStep = true, iterations = 10, cannonInjection = CANNON) {
        this._useDeltaForWorldStep = _useDeltaForWorldStep;
        this.name = "CannonJSPlugin";
        this._physicsMaterials = new Array();
        this._fixedTimeStep = 1 / 60;
        this._physicsBodiesToRemoveAfterStep = new Array();
        this._firstFrame = true;
        this._tmpQuaternion = new math_vector/* Quaternion */.PT();
        this._minus90X = new math_vector/* Quaternion */.PT(-0.7071067811865475, 0, 0, 0.7071067811865475);
        this._plus90X = new math_vector/* Quaternion */.PT(0.7071067811865475, 0, 0, 0.7071067811865475);
        this._tmpPosition = math_vector/* Vector3 */.Pq.Zero();
        this._tmpDeltaPosition = math_vector/* Vector3 */.Pq.Zero();
        this._tmpUnityRotation = new math_vector/* Quaternion */.PT();
        this.BJSCANNON = cannonInjection;
        if (!this.isSupported()) {
            logger/* Logger */.V.Error("CannonJS is not available. Please make sure you included the js file.");
            return;
        }
        this._extendNamespace();
        this.world = new this.BJSCANNON.World();
        this.world.broadphase = new this.BJSCANNON.NaiveBroadphase();
        this.world.solver.iterations = iterations;
        this._cannonRaycastResult = new this.BJSCANNON.RaycastResult();
        this._raycastResult = new PhysicsRaycastResult();
    }
    /**
     *
     * @returns plugin version
     */
    getPluginVersion() {
        return 1;
    }
    setGravity(gravity) {
        const vec = gravity;
        this.world.gravity.set(vec.x, vec.y, vec.z);
    }
    setTimeStep(timeStep) {
        this._fixedTimeStep = timeStep;
    }
    getTimeStep() {
        return this._fixedTimeStep;
    }
    executeStep(delta, impostors) {
        // due to cannon's architecture, the first frame's before-step is skipped.
        if (this._firstFrame) {
            this._firstFrame = false;
            for (const impostor of impostors) {
                if (!(impostor.type == PhysicsImpostor.HeightmapImpostor || impostor.type === PhysicsImpostor.PlaneImpostor)) {
                    impostor.beforeStep();
                }
            }
        }
        this.world.step(this._useDeltaForWorldStep ? delta : this._fixedTimeStep);
        this._removeMarkedPhysicsBodiesFromWorld();
    }
    _removeMarkedPhysicsBodiesFromWorld() {
        if (this._physicsBodiesToRemoveAfterStep.length > 0) {
            this._physicsBodiesToRemoveAfterStep.forEach((physicsBody) => {
                if (typeof this.world.removeBody === "function") {
                    this.world.removeBody(physicsBody);
                }
                else {
                    this.world.remove(physicsBody);
                }
            });
            this._physicsBodiesToRemoveAfterStep.length = 0;
        }
    }
    applyImpulse(impostor, force, contactPoint) {
        const worldPoint = new this.BJSCANNON.Vec3(contactPoint.x, contactPoint.y, contactPoint.z);
        const impulse = new this.BJSCANNON.Vec3(force.x, force.y, force.z);
        impostor.physicsBody.applyImpulse(impulse, worldPoint);
    }
    applyForce(impostor, force, contactPoint) {
        const worldPoint = new this.BJSCANNON.Vec3(contactPoint.x, contactPoint.y, contactPoint.z);
        const impulse = new this.BJSCANNON.Vec3(force.x, force.y, force.z);
        impostor.physicsBody.applyForce(impulse, worldPoint);
    }
    generatePhysicsBody(impostor) {
        // When calling forceUpdate generatePhysicsBody is called again, ensure that the updated body does not instantly collide with removed body
        this._removeMarkedPhysicsBodiesFromWorld();
        //parent-child relationship. Does this impostor have a parent impostor?
        if (impostor.parent) {
            if (impostor.physicsBody) {
                this.removePhysicsBody(impostor);
                //TODO is that needed?
                impostor.forceUpdate();
            }
            return;
        }
        //should a new body be created for this impostor?
        if (impostor.isBodyInitRequired()) {
            const shape = this._createShape(impostor);
            if (!shape) {
                logger/* Logger */.V.Warn("It was not possible to create a physics body for this object.");
                return;
            }
            //unregister events if body is being changed
            const oldBody = impostor.physicsBody;
            if (oldBody) {
                this.removePhysicsBody(impostor);
            }
            //create the body and material
            const material = this._addMaterial("mat-" + impostor.uniqueId, impostor.getParam("friction"), impostor.getParam("restitution"));
            const bodyCreationObject = {
                mass: impostor.getParam("mass"),
                material: material,
            };
            // A simple extend, in case native options were used.
            const nativeOptions = impostor.getParam("nativeOptions");
            for (const key in nativeOptions) {
                if (Object.prototype.hasOwnProperty.call(nativeOptions, key)) {
                    bodyCreationObject[key] = nativeOptions[key];
                }
            }
            impostor.physicsBody = new this.BJSCANNON.Body(bodyCreationObject);
            impostor.physicsBody.addEventListener("collide", impostor.onCollide);
            this.world.addEventListener("preStep", impostor.beforeStep);
            this.world.addEventListener("postStep", impostor.afterStep);
            impostor.physicsBody.addShape(shape);
            if (typeof this.world.addBody === "function") {
                this.world.addBody(impostor.physicsBody);
            }
            else {
                this.world.add(impostor.physicsBody);
            }
            //try to keep the body moving in the right direction by taking old properties.
            //Should be tested!
            if (oldBody) {
                ["force", "torque", "velocity", "angularVelocity"].forEach(function (param) {
                    const vec = oldBody[param];
                    impostor.physicsBody[param].set(vec.x, vec.y, vec.z);
                });
            }
            this._processChildMeshes(impostor);
        }
        //now update the body's transformation
        this._updatePhysicsBodyTransformation(impostor);
    }
    _processChildMeshes(mainImpostor) {
        const meshChildren = mainImpostor.object.getChildMeshes ? mainImpostor.object.getChildMeshes(true) : [];
        const mainRotation = mainImpostor.object.rotationQuaternion;
        if (mainRotation) {
            mainRotation.conjugateToRef(this._tmpQuaternion);
        }
        else {
            this._tmpQuaternion.set(0, 0, 0, 1);
        }
        if (meshChildren.length) {
            const processMesh = (mesh) => {
                if (!mesh.rotationQuaternion) {
                    return;
                }
                const childImpostor = mesh.getPhysicsImpostor();
                if (childImpostor) {
                    const parent = childImpostor.parent;
                    if (parent !== mainImpostor && mesh.parent) {
                        const pPosition = mesh.getAbsolutePosition().subtract(mesh.parent.getAbsolutePosition());
                        const q = mesh.rotationQuaternion.multiply(this._tmpQuaternion);
                        if (childImpostor.physicsBody) {
                            this.removePhysicsBody(childImpostor);
                            childImpostor.physicsBody = null;
                        }
                        childImpostor.parent = mainImpostor;
                        childImpostor.resetUpdateFlags();
                        mainImpostor.physicsBody.addShape(this._createShape(childImpostor), new this.BJSCANNON.Vec3(pPosition.x, pPosition.y, pPosition.z), new this.BJSCANNON.Quaternion(q.x, q.y, q.z, q.w));
                        //Add the mass of the children.
                        mainImpostor.physicsBody.mass += childImpostor.getParam("mass");
                    }
                }
                mesh.getChildMeshes(true)
                    .filter((m) => !!m.physicsImpostor)
                    .forEach(processMesh);
            };
            meshChildren.filter((m) => !!m.physicsImpostor).forEach(processMesh);
        }
    }
    removePhysicsBody(impostor) {
        impostor.physicsBody.removeEventListener("collide", impostor.onCollide);
        this.world.removeEventListener("preStep", impostor.beforeStep);
        this.world.removeEventListener("postStep", impostor.afterStep);
        // Only remove the physics body after the physics step to avoid disrupting cannon's internal state
        if (this._physicsBodiesToRemoveAfterStep.indexOf(impostor.physicsBody) === -1) {
            this._physicsBodiesToRemoveAfterStep.push(impostor.physicsBody);
        }
    }
    generateJoint(impostorJoint) {
        const mainBody = impostorJoint.mainImpostor.physicsBody;
        const connectedBody = impostorJoint.connectedImpostor.physicsBody;
        if (!mainBody || !connectedBody) {
            return;
        }
        let constraint;
        const jointData = impostorJoint.joint.jointData;
        //TODO - https://github.com/schteppe/this.BJSCANNON.js/blob/gh-pages/demos/collisionFilter.html
        const constraintData = {
            pivotA: jointData.mainPivot ? new this.BJSCANNON.Vec3().set(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z) : null,
            pivotB: jointData.connectedPivot ? new this.BJSCANNON.Vec3().set(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z) : null,
            axisA: jointData.mainAxis ? new this.BJSCANNON.Vec3().set(jointData.mainAxis.x, jointData.mainAxis.y, jointData.mainAxis.z) : null,
            axisB: jointData.connectedAxis ? new this.BJSCANNON.Vec3().set(jointData.connectedAxis.x, jointData.connectedAxis.y, jointData.connectedAxis.z) : null,
            maxForce: jointData.nativeParams.maxForce,
            collideConnected: !!jointData.collision,
        };
        switch (impostorJoint.joint.type) {
            case PhysicsJoint.HingeJoint:
            case PhysicsJoint.Hinge2Joint:
                constraint = new this.BJSCANNON.HingeConstraint(mainBody, connectedBody, constraintData);
                break;
            case PhysicsJoint.DistanceJoint:
                constraint = new this.BJSCANNON.DistanceConstraint(mainBody, connectedBody, jointData.maxDistance || 2);
                break;
            case PhysicsJoint.SpringJoint: {
                const springData = jointData;
                constraint = new this.BJSCANNON.Spring(mainBody, connectedBody, {
                    restLength: springData.length,
                    stiffness: springData.stiffness,
                    damping: springData.damping,
                    localAnchorA: constraintData.pivotA,
                    localAnchorB: constraintData.pivotB,
                });
                break;
            }
            case PhysicsJoint.LockJoint:
                constraint = new this.BJSCANNON.LockConstraint(mainBody, connectedBody, constraintData);
                break;
            case PhysicsJoint.PointToPointJoint:
            case PhysicsJoint.BallAndSocketJoint:
            default:
                constraint = new this.BJSCANNON.PointToPointConstraint(mainBody, constraintData.pivotA, connectedBody, constraintData.pivotB, constraintData.maxForce);
                break;
        }
        //set the collideConnected flag after the creation, since DistanceJoint ignores it.
        constraint.collideConnected = !!jointData.collision;
        impostorJoint.joint.physicsJoint = constraint;
        //don't add spring as constraint, as it is not one.
        if (impostorJoint.joint.type !== PhysicsJoint.SpringJoint) {
            this.world.addConstraint(constraint);
        }
        else {
            impostorJoint.joint.jointData.forceApplicationCallback =
                impostorJoint.joint.jointData.forceApplicationCallback ||
                    function () {
                        constraint.applyForce();
                    };
            impostorJoint.mainImpostor.registerAfterPhysicsStep(impostorJoint.joint.jointData.forceApplicationCallback);
        }
    }
    removeJoint(impostorJoint) {
        if (impostorJoint.joint.type !== PhysicsJoint.SpringJoint) {
            this.world.removeConstraint(impostorJoint.joint.physicsJoint);
        }
        else {
            impostorJoint.mainImpostor.unregisterAfterPhysicsStep(impostorJoint.joint.jointData.forceApplicationCallback);
        }
    }
    _addMaterial(name, friction, restitution) {
        let index;
        let mat;
        for (index = 0; index < this._physicsMaterials.length; index++) {
            mat = this._physicsMaterials[index];
            if (mat.friction === friction && mat.restitution === restitution) {
                return mat;
            }
        }
        const currentMat = new this.BJSCANNON.Material(name);
        currentMat.friction = friction;
        currentMat.restitution = restitution;
        this._physicsMaterials.push(currentMat);
        return currentMat;
    }
    _checkWithEpsilon(value) {
        return value < math_constants/* Epsilon */.bH ? math_constants/* Epsilon */.bH : value;
    }
    _createShape(impostor) {
        const object = impostor.object;
        let returnValue;
        const impostorExtents = impostor.getObjectExtents();
        switch (impostor.type) {
            case PhysicsImpostor.SphereImpostor: {
                const radiusX = impostorExtents.x;
                const radiusY = impostorExtents.y;
                const radiusZ = impostorExtents.z;
                returnValue = new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(radiusX), this._checkWithEpsilon(radiusY), this._checkWithEpsilon(radiusZ)) / 2);
                break;
            }
            //TMP also for cylinder - TODO Cannon supports cylinder natively.
            case PhysicsImpostor.CylinderImpostor: {
                let nativeParams = impostor.getParam("nativeOptions");
                if (!nativeParams) {
                    nativeParams = {};
                }
                const radiusTop = nativeParams.radiusTop !== undefined ? nativeParams.radiusTop : this._checkWithEpsilon(impostorExtents.x) / 2;
                const radiusBottom = nativeParams.radiusBottom !== undefined ? nativeParams.radiusBottom : this._checkWithEpsilon(impostorExtents.x) / 2;
                const height = nativeParams.height !== undefined ? nativeParams.height : this._checkWithEpsilon(impostorExtents.y);
                const numSegments = nativeParams.numSegments !== undefined ? nativeParams.numSegments : 16;
                returnValue = new this.BJSCANNON.Cylinder(radiusTop, radiusBottom, height, numSegments);
                // Rotate 90 degrees as this shape is horizontal in cannon
                const quat = new this.BJSCANNON.Quaternion();
                quat.setFromAxisAngle(new this.BJSCANNON.Vec3(1, 0, 0), -Math.PI / 2);
                const translation = new this.BJSCANNON.Vec3(0, 0, 0);
                returnValue.transformAllPoints(translation, quat);
                break;
            }
            case PhysicsImpostor.BoxImpostor: {
                const box = impostorExtents.scale(0.5);
                returnValue = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(this._checkWithEpsilon(box.x), this._checkWithEpsilon(box.y), this._checkWithEpsilon(box.z)));
                break;
            }
            case PhysicsImpostor.PlaneImpostor:
                logger/* Logger */.V.Warn("Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead");
                returnValue = new this.BJSCANNON.Plane();
                break;
            case PhysicsImpostor.MeshImpostor: {
                // should transform the vertex data to world coordinates!!
                const rawVerts = object.getVerticesData ? object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind) : [];
                const rawFaces = object.getIndices ? object.getIndices() : [];
                if (!rawVerts) {
                    logger/* Logger */.V.Warn("Tried to create a MeshImpostor for an object without vertices. This will fail.");
                    return;
                }
                // get only scale! so the object could transform correctly.
                const oldPosition = object.position.clone();
                const oldRotation = object.rotation && object.rotation.clone();
                const oldQuaternion = object.rotationQuaternion && object.rotationQuaternion.clone();
                object.position.copyFromFloats(0, 0, 0);
                object.rotation && object.rotation.copyFromFloats(0, 0, 0);
                object.rotationQuaternion && object.rotationQuaternion.copyFrom(impostor.getParentsRotation());
                object.rotationQuaternion && object.parent && object.rotationQuaternion.conjugateInPlace();
                const transform = object.computeWorldMatrix(true);
                // convert rawVerts to object space
                const transformedVertices = [];
                let index;
                for (index = 0; index < rawVerts.length; index += 3) {
                    math_vector/* Vector3 */.Pq.TransformCoordinates(math_vector/* Vector3 */.Pq.FromArray(rawVerts, index), transform).toArray(transformedVertices, index);
                }
                logger/* Logger */.V.Warn("MeshImpostor only collides against spheres.");
                returnValue = new this.BJSCANNON.Trimesh(transformedVertices, rawFaces);
                //now set back the transformation!
                object.position.copyFrom(oldPosition);
                oldRotation && object.rotation && object.rotation.copyFrom(oldRotation);
                oldQuaternion && object.rotationQuaternion && object.rotationQuaternion.copyFrom(oldQuaternion);
                break;
            }
            case PhysicsImpostor.HeightmapImpostor: {
                const oldPosition2 = object.position.clone();
                const oldRotation2 = object.rotation && object.rotation.clone();
                const oldQuaternion2 = object.rotationQuaternion && object.rotationQuaternion.clone();
                object.position.copyFromFloats(0, 0, 0);
                object.rotation && object.rotation.copyFromFloats(0, 0, 0);
                object.rotationQuaternion && object.rotationQuaternion.copyFrom(impostor.getParentsRotation());
                object.rotationQuaternion && object.parent && object.rotationQuaternion.conjugateInPlace();
                object.rotationQuaternion && object.rotationQuaternion.multiplyInPlace(this._minus90X);
                returnValue = this._createHeightmap(object);
                object.position.copyFrom(oldPosition2);
                oldRotation2 && object.rotation && object.rotation.copyFrom(oldRotation2);
                oldQuaternion2 && object.rotationQuaternion && object.rotationQuaternion.copyFrom(oldQuaternion2);
                object.computeWorldMatrix(true);
                break;
            }
            case PhysicsImpostor.ParticleImpostor:
                returnValue = new this.BJSCANNON.Particle();
                break;
            case PhysicsImpostor.NoImpostor:
                returnValue = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0, 0, 0));
                break;
        }
        return returnValue;
    }
    _createHeightmap(object, pointDepth) {
        let pos = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const transform = object.computeWorldMatrix(true);
        // convert rawVerts to object space
        const transformedVertices = [];
        let index;
        for (index = 0; index < pos.length; index += 3) {
            math_vector/* Vector3 */.Pq.TransformCoordinates(math_vector/* Vector3 */.Pq.FromArray(pos, index), transform).toArray(transformedVertices, index);
        }
        pos = transformedVertices;
        const matrix = new Array();
        //For now pointDepth will not be used and will be automatically calculated.
        //Future reference - try and find the best place to add a reference to the pointDepth variable.
        const arraySize = pointDepth || ~~(Math.sqrt(pos.length / 3) - 1);
        const boundingInfo = object.getBoundingInfo();
        const dim = Math.min(boundingInfo.boundingBox.extendSizeWorld.x, boundingInfo.boundingBox.extendSizeWorld.y);
        const minY = boundingInfo.boundingBox.extendSizeWorld.z;
        const elementSize = (dim * 2) / arraySize;
        for (let i = 0; i < pos.length; i = i + 3) {
            const x = Math.round(pos[i + 0] / elementSize + arraySize / 2);
            const z = Math.round((pos[i + 1] / elementSize - arraySize / 2) * -1);
            const y = -pos[i + 2] + minY;
            if (!matrix[x]) {
                matrix[x] = [];
            }
            if (!matrix[x][z]) {
                matrix[x][z] = y;
            }
            matrix[x][z] = Math.max(y, matrix[x][z]);
        }
        for (let x = 0; x <= arraySize; ++x) {
            if (!matrix[x]) {
                let loc = 1;
                while (!matrix[(x + loc) % arraySize]) {
                    loc++;
                }
                matrix[x] = matrix[(x + loc) % arraySize].slice();
                //console.log("missing x", x);
            }
            for (let z = 0; z <= arraySize; ++z) {
                if (!matrix[x][z]) {
                    let loc = 1;
                    let newValue;
                    while (newValue === undefined) {
                        newValue = matrix[x][(z + loc++) % arraySize];
                    }
                    matrix[x][z] = newValue;
                }
            }
        }
        const shape = new this.BJSCANNON.Heightfield(matrix, {
            elementSize: elementSize,
        });
        //For future reference, needed for body transformation
        shape.minY = minY;
        return shape;
    }
    _updatePhysicsBodyTransformation(impostor) {
        const object = impostor.object;
        //make sure it is updated...
        object.computeWorldMatrix && object.computeWorldMatrix(true);
        if (!object.getBoundingInfo()) {
            return;
        }
        const center = impostor.getObjectCenter();
        //m.getAbsolutePosition().subtract(m.getBoundingInfo().boundingBox.centerWorld)
        // The delta between the mesh position and the mesh bounding box center
        this._tmpDeltaPosition.copyFrom(object.getAbsolutePivotPoint().subtract(center));
        this._tmpDeltaPosition.divideInPlace(impostor.object.scaling);
        this._tmpPosition.copyFrom(center);
        let quaternion = object.rotationQuaternion;
        if (!quaternion) {
            return;
        }
        //is shape is a plane or a heightmap, it must be rotated 90 degs in the X axis.
        //ideally these would be rotated at time of creation like cylinder but they dont extend ConvexPolyhedron
        if (impostor.type === PhysicsImpostor.PlaneImpostor || impostor.type === PhysicsImpostor.HeightmapImpostor) {
            //-90 DEG in X, precalculated
            quaternion = quaternion.multiply(this._minus90X);
            //Invert! (Precalculated, 90 deg in X)
            //No need to clone. this will never change.
            impostor.setDeltaRotation(this._plus90X);
        }
        //If it is a heightfield, if should be centered.
        if (impostor.type === PhysicsImpostor.HeightmapImpostor) {
            const mesh = object;
            let boundingInfo = mesh.getBoundingInfo();
            //calculate the correct body position:
            const rotationQuaternion = mesh.rotationQuaternion;
            mesh.rotationQuaternion = this._tmpUnityRotation;
            mesh.computeWorldMatrix(true);
            //get original center with no rotation
            const c = center.clone();
            let oldPivot = mesh.getPivotMatrix();
            if (oldPivot) {
                // create a copy the pivot Matrix as it is modified in place
                oldPivot = oldPivot.clone();
            }
            else {
                oldPivot = math_vector/* Matrix */.uq.Identity();
            }
            //calculate the new center using a pivot (since this.BJSCANNON.js doesn't center height maps)
            const p = math_vector/* Matrix */.uq.Translation(boundingInfo.boundingBox.extendSizeWorld.x, 0, -boundingInfo.boundingBox.extendSizeWorld.z);
            mesh.setPreTransformMatrix(p);
            mesh.computeWorldMatrix(true);
            // force bounding box recomputation
            boundingInfo = mesh.getBoundingInfo();
            //calculate the translation
            const translation = boundingInfo.boundingBox.centerWorld.subtract(center).subtract(mesh.position).negate();
            this._tmpPosition.copyFromFloats(translation.x, translation.y - boundingInfo.boundingBox.extendSizeWorld.y, translation.z);
            //add it inverted to the delta
            this._tmpDeltaPosition.copyFrom(boundingInfo.boundingBox.centerWorld.subtract(c));
            this._tmpDeltaPosition.y += boundingInfo.boundingBox.extendSizeWorld.y;
            //rotation is back
            mesh.rotationQuaternion = rotationQuaternion;
            mesh.setPreTransformMatrix(oldPivot);
            mesh.computeWorldMatrix(true);
        }
        else if (impostor.type === PhysicsImpostor.MeshImpostor) {
            this._tmpDeltaPosition.copyFromFloats(0, 0, 0);
        }
        impostor.setDeltaPosition(this._tmpDeltaPosition);
        //Now update the impostor object
        impostor.physicsBody.position.set(this._tmpPosition.x, this._tmpPosition.y, this._tmpPosition.z);
        impostor.physicsBody.quaternion.set(quaternion.x, quaternion.y, quaternion.z, quaternion.w);
    }
    setTransformationFromPhysicsBody(impostor) {
        impostor.object.position.set(impostor.physicsBody.position.x, impostor.physicsBody.position.y, impostor.physicsBody.position.z);
        if (impostor.object.rotationQuaternion) {
            const q = impostor.physicsBody.quaternion;
            impostor.object.rotationQuaternion.set(q.x, q.y, q.z, q.w);
        }
    }
    setPhysicsBodyTransformation(impostor, newPosition, newRotation) {
        impostor.physicsBody.position.set(newPosition.x, newPosition.y, newPosition.z);
        impostor.physicsBody.quaternion.set(newRotation.x, newRotation.y, newRotation.z, newRotation.w);
    }
    isSupported() {
        return this.BJSCANNON !== undefined;
    }
    setLinearVelocity(impostor, velocity) {
        impostor.physicsBody.velocity.set(velocity.x, velocity.y, velocity.z);
    }
    setAngularVelocity(impostor, velocity) {
        impostor.physicsBody.angularVelocity.set(velocity.x, velocity.y, velocity.z);
    }
    getLinearVelocity(impostor) {
        const v = impostor.physicsBody.velocity;
        if (!v) {
            return null;
        }
        return new math_vector/* Vector3 */.Pq(v.x, v.y, v.z);
    }
    getAngularVelocity(impostor) {
        const v = impostor.physicsBody.angularVelocity;
        if (!v) {
            return null;
        }
        return new math_vector/* Vector3 */.Pq(v.x, v.y, v.z);
    }
    setBodyMass(impostor, mass) {
        impostor.physicsBody.mass = mass;
        impostor.physicsBody.updateMassProperties();
    }
    getBodyMass(impostor) {
        return impostor.physicsBody.mass;
    }
    getBodyFriction(impostor) {
        return impostor.physicsBody.material.friction;
    }
    setBodyFriction(impostor, friction) {
        impostor.physicsBody.material.friction = friction;
    }
    getBodyRestitution(impostor) {
        return impostor.physicsBody.material.restitution;
    }
    setBodyRestitution(impostor, restitution) {
        impostor.physicsBody.material.restitution = restitution;
    }
    sleepBody(impostor) {
        impostor.physicsBody.sleep();
    }
    wakeUpBody(impostor) {
        impostor.physicsBody.wakeUp();
    }
    updateDistanceJoint(joint, maxDistance) {
        joint.physicsJoint.distance = maxDistance;
    }
    setMotor(joint, speed, maxForce, motorIndex) {
        if (!motorIndex) {
            joint.physicsJoint.enableMotor();
            joint.physicsJoint.setMotorSpeed(speed);
            if (maxForce) {
                this.setLimit(joint, maxForce);
            }
        }
    }
    setLimit(joint, minForce, maxForce) {
        joint.physicsJoint.motorEquation.maxForce = maxForce;
        joint.physicsJoint.motorEquation.minForce = minForce === void 0 ? -minForce : minForce;
    }
    syncMeshWithImpostor(mesh, impostor) {
        const body = impostor.physicsBody;
        mesh.position.x = body.position.x;
        mesh.position.y = body.position.y;
        mesh.position.z = body.position.z;
        if (mesh.rotationQuaternion) {
            mesh.rotationQuaternion.x = body.quaternion.x;
            mesh.rotationQuaternion.y = body.quaternion.y;
            mesh.rotationQuaternion.z = body.quaternion.z;
            mesh.rotationQuaternion.w = body.quaternion.w;
        }
    }
    getRadius(impostor) {
        const shape = impostor.physicsBody.shapes[0];
        return shape.boundingSphereRadius;
    }
    getBoxSizeToRef(impostor, result) {
        const shape = impostor.physicsBody.shapes[0];
        result.x = shape.halfExtents.x * 2;
        result.y = shape.halfExtents.y * 2;
        result.z = shape.halfExtents.z * 2;
    }
    dispose() { }
    _extendNamespace() {
        //this will force cannon to execute at least one step when using interpolation
        const step_tmp1 = new this.BJSCANNON.Vec3();
        const engine = this.BJSCANNON;
        this.BJSCANNON.World.prototype.step = function (dt, timeSinceLastCalled, maxSubSteps) {
            maxSubSteps = maxSubSteps || 10;
            timeSinceLastCalled = timeSinceLastCalled || 0;
            if (timeSinceLastCalled === 0) {
                this.internalStep(dt);
                this.time += dt;
            }
            else {
                let internalSteps = Math.floor((this.time + timeSinceLastCalled) / dt) - Math.floor(this.time / dt);
                internalSteps = Math.min(internalSteps, maxSubSteps) || 1;
                const t0 = performance.now();
                for (let i = 0; i !== internalSteps; i++) {
                    this.internalStep(dt);
                    if (performance.now() - t0 > dt * 1000) {
                        break;
                    }
                }
                this.time += timeSinceLastCalled;
                const h = this.time % dt;
                const h_div_dt = h / dt;
                const interpvelo = step_tmp1;
                const bodies = this.bodies;
                for (let j = 0; j !== bodies.length; j++) {
                    const b = bodies[j];
                    if (b.type !== engine.Body.STATIC && b.sleepState !== engine.Body.SLEEPING) {
                        b.position.vsub(b.previousPosition, interpvelo);
                        interpvelo.scale(h_div_dt, interpvelo);
                        b.position.vadd(interpvelo, b.interpolatedPosition);
                    }
                    else {
                        b.interpolatedPosition.set(b.position.x, b.position.y, b.position.z);
                        b.interpolatedQuaternion.set(b.quaternion.x, b.quaternion.y, b.quaternion.z, b.quaternion.w);
                    }
                }
            }
        };
    }
    /**
     * Does a raycast in the physics world
     * @param from when should the ray start?
     * @param to when should the ray end?
     * @returns PhysicsRaycastResult
     */
    raycast(from, to) {
        this._raycastResult.reset(from, to);
        this.raycastToRef(from, to, this._raycastResult);
        return this._raycastResult;
    }
    /**
     * Does a raycast in the physics world
     * @param from when should the ray start?
     * @param to when should the ray end?
     * @param result resulting PhysicsRaycastResult
     */
    raycastToRef(from, to, result) {
        this._cannonRaycastResult.reset();
        this.world.raycastClosest(from, to, {}, this._cannonRaycastResult);
        result.reset(from, to);
        if (this._cannonRaycastResult.hasHit) {
            // TODO: do we also want to get the body it hit?
            result.setHitData({
                x: this._cannonRaycastResult.hitNormalWorld.x,
                y: this._cannonRaycastResult.hitNormalWorld.y,
                z: this._cannonRaycastResult.hitNormalWorld.z,
            }, {
                x: this._cannonRaycastResult.hitPointWorld.x,
                y: this._cannonRaycastResult.hitPointWorld.y,
                z: this._cannonRaycastResult.hitPointWorld.z,
            });
            result.setHitDistance(this._cannonRaycastResult.distance);
        }
    }
}
PhysicsEngine.DefaultPluginFactory = () => {
    return new CannonJSPlugin();
};
//# sourceMappingURL=cannonJSPlugin.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/Plugins/oimoJSPlugin.js






/** @internal */
class OimoJSPlugin {
    constructor(_useDeltaForWorldStep = true, iterations, oimoInjection = OIMO) {
        this._useDeltaForWorldStep = _useDeltaForWorldStep;
        this.name = "OimoJSPlugin";
        this._fixedTimeStep = 1 / 60;
        this._tmpImpostorsArray = [];
        this._tmpPositionVector = math_vector/* Vector3 */.Pq.Zero();
        this.BJSOIMO = oimoInjection;
        this.world = new this.BJSOIMO.World({
            iterations: iterations,
        });
        this.world.clear();
        this._raycastResult = new PhysicsRaycastResult();
    }
    /**
     *
     * @returns plugin version
     */
    getPluginVersion() {
        return 1;
    }
    setGravity(gravity) {
        this.world.gravity.set(gravity.x, gravity.y, gravity.z);
    }
    setTimeStep(timeStep) {
        this.world.timeStep = timeStep;
    }
    getTimeStep() {
        return this.world.timeStep;
    }
    executeStep(delta, impostors) {
        impostors.forEach(function (impostor) {
            impostor.beforeStep();
        });
        this.world.timeStep = this._useDeltaForWorldStep ? delta : this._fixedTimeStep;
        this.world.step();
        impostors.forEach((impostor) => {
            impostor.afterStep();
            //update the ordered impostors array
            this._tmpImpostorsArray[impostor.uniqueId] = impostor;
        });
        //check for collisions
        let contact = this.world.contacts;
        while (contact !== null) {
            if (contact.touching && !contact.body1.sleeping && !contact.body2.sleeping) {
                contact = contact.next;
                continue;
            }
            //is this body colliding with any other? get the impostor
            const mainImpostor = this._tmpImpostorsArray[+contact.body1.name];
            const collidingImpostor = this._tmpImpostorsArray[+contact.body2.name];
            if (!mainImpostor || !collidingImpostor) {
                contact = contact.next;
                continue;
            }
            mainImpostor.onCollide({ body: collidingImpostor.physicsBody, point: null, distance: 0, impulse: 0, normal: null });
            collidingImpostor.onCollide({ body: mainImpostor.physicsBody, point: null, distance: 0, impulse: 0, normal: null });
            contact = contact.next;
        }
    }
    applyImpulse(impostor, force, contactPoint) {
        const mass = impostor.physicsBody.mass;
        impostor.physicsBody.applyImpulse(contactPoint.scale(this.world.invScale), force.scale(this.world.invScale * mass));
    }
    applyForce(impostor, force, contactPoint) {
        logger/* Logger */.V.Warn("Oimo doesn't support applying force. Using impulse instead.");
        this.applyImpulse(impostor, force, contactPoint);
    }
    generatePhysicsBody(impostor) {
        //parent-child relationship. Does this impostor has a parent impostor?
        if (impostor.parent) {
            if (impostor.physicsBody) {
                this.removePhysicsBody(impostor);
                //TODO is that needed?
                impostor.forceUpdate();
            }
            return;
        }
        if (impostor.isBodyInitRequired()) {
            const bodyConfig = {
                name: impostor.uniqueId,
                //Oimo must have mass, also for static objects.
                config: [impostor.getParam("mass") || 0.001, impostor.getParam("friction"), impostor.getParam("restitution")],
                size: [],
                type: [],
                pos: [],
                posShape: [],
                rot: [],
                rotShape: [],
                move: impostor.getParam("mass") !== 0,
                density: impostor.getParam("mass"),
                friction: impostor.getParam("friction"),
                restitution: impostor.getParam("restitution"),
                //Supporting older versions of Oimo
                world: this.world,
            };
            const impostors = [impostor];
            const addToArray = (parent) => {
                if (!parent.getChildMeshes) {
                    return;
                }
                parent.getChildMeshes().forEach(function (m) {
                    if (m.physicsImpostor) {
                        impostors.push(m.physicsImpostor);
                        //m.physicsImpostor._init();
                    }
                });
            };
            addToArray(impostor.object);
            const checkWithEpsilon = (value) => {
                return Math.max(value, math_constants/* Epsilon */.bH);
            };
            const globalQuaternion = new math_vector/* Quaternion */.PT();
            impostors.forEach((i) => {
                if (!i.object.rotationQuaternion) {
                    return;
                }
                //get the correct bounding box
                const oldQuaternion = i.object.rotationQuaternion;
                globalQuaternion.copyFrom(oldQuaternion);
                i.object.rotationQuaternion.set(0, 0, 0, 1);
                i.object.computeWorldMatrix(true);
                const rot = globalQuaternion.toEulerAngles();
                const impostorExtents = i.getObjectExtents();
                // eslint-disable-next-line no-loss-of-precision
                const radToDeg = 57.295779513082320876;
                if (i === impostor) {
                    const center = impostor.getObjectCenter();
                    impostor.object.getAbsolutePivotPoint().subtractToRef(center, this._tmpPositionVector);
                    this._tmpPositionVector.divideInPlace(impostor.object.scaling);
                    //Can also use Array.prototype.push.apply
                    bodyConfig.pos.push(center.x);
                    bodyConfig.pos.push(center.y);
                    bodyConfig.pos.push(center.z);
                    bodyConfig.posShape.push(0, 0, 0);
                    bodyConfig.rotShape.push(0, 0, 0);
                }
                else {
                    const localPosition = i.object.position.clone();
                    bodyConfig.posShape.push(localPosition.x);
                    bodyConfig.posShape.push(localPosition.y);
                    bodyConfig.posShape.push(localPosition.z);
                    // bodyConfig.pos.push(0, 0, 0);
                    bodyConfig.rotShape.push(rot.x * radToDeg, rot.y * radToDeg, rot.z * radToDeg);
                }
                i.object.rotationQuaternion.copyFrom(globalQuaternion);
                // register mesh
                switch (i.type) {
                    case PhysicsImpostor.ParticleImpostor:
                        logger/* Logger */.V.Warn("No Particle support in OIMO.js. using SphereImpostor instead");
                    // eslint-disable-next-line no-fallthrough
                    case PhysicsImpostor.SphereImpostor: {
                        const radiusX = impostorExtents.x;
                        const radiusY = impostorExtents.y;
                        const radiusZ = impostorExtents.z;
                        const size = Math.max(checkWithEpsilon(radiusX), checkWithEpsilon(radiusY), checkWithEpsilon(radiusZ)) / 2;
                        bodyConfig.type.push("sphere");
                        //due to the way oimo works with compounds, add 3 times
                        bodyConfig.size.push(size);
                        bodyConfig.size.push(size);
                        bodyConfig.size.push(size);
                        break;
                    }
                    case PhysicsImpostor.CylinderImpostor: {
                        const sizeX = checkWithEpsilon(impostorExtents.x) / 2;
                        const sizeY = checkWithEpsilon(impostorExtents.y);
                        bodyConfig.type.push("cylinder");
                        bodyConfig.size.push(sizeX);
                        bodyConfig.size.push(sizeY);
                        //due to the way oimo works with compounds, add one more value.
                        bodyConfig.size.push(sizeY);
                        break;
                    }
                    case PhysicsImpostor.PlaneImpostor:
                    case PhysicsImpostor.BoxImpostor:
                    default: {
                        const sizeX = checkWithEpsilon(impostorExtents.x);
                        const sizeY = checkWithEpsilon(impostorExtents.y);
                        const sizeZ = checkWithEpsilon(impostorExtents.z);
                        bodyConfig.type.push("box");
                        //if (i === impostor) {
                        bodyConfig.size.push(sizeX);
                        bodyConfig.size.push(sizeY);
                        bodyConfig.size.push(sizeZ);
                        //} else {
                        //    bodyConfig.size.push(0,0,0);
                        //}
                        break;
                    }
                }
                //actually not needed, but hey...
                i.object.rotationQuaternion = oldQuaternion;
            });
            impostor.physicsBody = this.world.add(bodyConfig);
            // set the quaternion, ignoring the previously defined (euler) rotation
            impostor.physicsBody.resetQuaternion(globalQuaternion);
            // update with delta 0, so the body will receive the new rotation.
            impostor.physicsBody.updatePosition(0);
        }
        else {
            this._tmpPositionVector.copyFromFloats(0, 0, 0);
        }
        impostor.setDeltaPosition(this._tmpPositionVector);
        //this._tmpPositionVector.addInPlace(impostor.mesh.getBoundingInfo().boundingBox.center);
        //this.setPhysicsBodyTransformation(impostor, this._tmpPositionVector, impostor.mesh.rotationQuaternion);
    }
    removePhysicsBody(impostor) {
        //impostor.physicsBody.dispose();
        this.world.removeRigidBody(impostor.physicsBody);
    }
    generateJoint(impostorJoint) {
        const mainBody = impostorJoint.mainImpostor.physicsBody;
        const connectedBody = impostorJoint.connectedImpostor.physicsBody;
        if (!mainBody || !connectedBody) {
            return;
        }
        const jointData = impostorJoint.joint.jointData;
        const options = jointData.nativeParams || {};
        let type;
        const nativeJointData = {
            body1: mainBody,
            body2: connectedBody,
            axe1: options.axe1 || (jointData.mainAxis ? jointData.mainAxis.asArray() : null),
            axe2: options.axe2 || (jointData.connectedAxis ? jointData.connectedAxis.asArray() : null),
            pos1: options.pos1 || (jointData.mainPivot ? jointData.mainPivot.asArray() : null),
            pos2: options.pos2 || (jointData.connectedPivot ? jointData.connectedPivot.asArray() : null),
            min: options.min,
            max: options.max,
            collision: options.collision || jointData.collision,
            spring: options.spring,
            //supporting older version of Oimo
            world: this.world,
        };
        switch (impostorJoint.joint.type) {
            case PhysicsJoint.BallAndSocketJoint:
                type = "jointBall";
                break;
            case PhysicsJoint.SpringJoint: {
                logger/* Logger */.V.Warn("OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead");
                const springData = jointData;
                nativeJointData.min = springData.length || nativeJointData.min;
                //Max should also be set, just make sure it is at least min
                nativeJointData.max = Math.max(nativeJointData.min, nativeJointData.max);
            }
            // eslint-disable-next-line no-fallthrough
            case PhysicsJoint.DistanceJoint:
                type = "jointDistance";
                nativeJointData.max = jointData.maxDistance;
                break;
            case PhysicsJoint.PrismaticJoint:
                type = "jointPrisme";
                break;
            case PhysicsJoint.SliderJoint:
                type = "jointSlide";
                break;
            case PhysicsJoint.WheelJoint:
                type = "jointWheel";
                break;
            case PhysicsJoint.HingeJoint:
            default:
                type = "jointHinge";
                break;
        }
        nativeJointData.type = type;
        impostorJoint.joint.physicsJoint = this.world.add(nativeJointData);
    }
    removeJoint(impostorJoint) {
        //Bug in Oimo prevents us from disposing a joint in the playground
        //joint.joint.physicsJoint.dispose();
        //So we will bruteforce it!
        try {
            this.world.removeJoint(impostorJoint.joint.physicsJoint);
        }
        catch (e) {
            logger/* Logger */.V.Warn(e);
        }
    }
    isSupported() {
        return this.BJSOIMO !== undefined;
    }
    setTransformationFromPhysicsBody(impostor) {
        if (!impostor.physicsBody.sleeping) {
            if (impostor.physicsBody.shapes.next) {
                let parent = impostor.physicsBody.shapes;
                while (parent.next) {
                    parent = parent.next;
                }
                impostor.object.position.set(parent.position.x, parent.position.y, parent.position.z);
            }
            else {
                const pos = impostor.physicsBody.getPosition();
                impostor.object.position.set(pos.x, pos.y, pos.z);
            }
            if (impostor.object.rotationQuaternion) {
                const quat = impostor.physicsBody.getQuaternion();
                impostor.object.rotationQuaternion.set(quat.x, quat.y, quat.z, quat.w);
            }
        }
    }
    setPhysicsBodyTransformation(impostor, newPosition, newRotation) {
        const body = impostor.physicsBody;
        // disable bidirectional for compound meshes
        if (impostor.physicsBody.shapes.next) {
            return;
        }
        body.position.set(newPosition.x, newPosition.y, newPosition.z);
        body.orientation.set(newRotation.x, newRotation.y, newRotation.z, newRotation.w);
        body.syncShapes();
        body.awake();
    }
    /*private _getLastShape(body: any): any {
        var lastShape = body.shapes;
        while (lastShape.next) {
            lastShape = lastShape.next;
        }
        return lastShape;
    }*/
    setLinearVelocity(impostor, velocity) {
        impostor.physicsBody.linearVelocity.set(velocity.x, velocity.y, velocity.z);
    }
    setAngularVelocity(impostor, velocity) {
        impostor.physicsBody.angularVelocity.set(velocity.x, velocity.y, velocity.z);
    }
    getLinearVelocity(impostor) {
        const v = impostor.physicsBody.linearVelocity;
        if (!v) {
            return null;
        }
        return new math_vector/* Vector3 */.Pq(v.x, v.y, v.z);
    }
    getAngularVelocity(impostor) {
        const v = impostor.physicsBody.angularVelocity;
        if (!v) {
            return null;
        }
        return new math_vector/* Vector3 */.Pq(v.x, v.y, v.z);
    }
    setBodyMass(impostor, mass) {
        const staticBody = mass === 0;
        //this will actually set the body's density and not its mass.
        //But this is how oimo treats the mass variable.
        impostor.physicsBody.shapes.density = staticBody ? 1 : mass;
        impostor.physicsBody.setupMass(staticBody ? 0x2 : 0x1);
    }
    getBodyMass(impostor) {
        return impostor.physicsBody.shapes.density;
    }
    getBodyFriction(impostor) {
        return impostor.physicsBody.shapes.friction;
    }
    setBodyFriction(impostor, friction) {
        impostor.physicsBody.shapes.friction = friction;
    }
    getBodyRestitution(impostor) {
        return impostor.physicsBody.shapes.restitution;
    }
    setBodyRestitution(impostor, restitution) {
        impostor.physicsBody.shapes.restitution = restitution;
    }
    sleepBody(impostor) {
        impostor.physicsBody.sleep();
    }
    wakeUpBody(impostor) {
        impostor.physicsBody.awake();
    }
    updateDistanceJoint(joint, maxDistance, minDistance) {
        joint.physicsJoint.limitMotor.upperLimit = maxDistance;
        if (minDistance !== void 0) {
            joint.physicsJoint.limitMotor.lowerLimit = minDistance;
        }
    }
    setMotor(joint, speed, force, motorIndex) {
        if (force !== undefined) {
            logger/* Logger */.V.Warn("OimoJS plugin currently has unexpected behavior when using setMotor with force parameter");
        }
        else {
            force = 1e6;
        }
        speed *= -1;
        //TODO separate rotational and transational motors.
        const motor = motorIndex
            ? joint.physicsJoint.rotationalLimitMotor2
            : joint.physicsJoint.rotationalLimitMotor1 || joint.physicsJoint.rotationalLimitMotor || joint.physicsJoint.limitMotor;
        if (motor) {
            motor.setMotor(speed, force);
        }
    }
    setLimit(joint, upperLimit, lowerLimit, motorIndex) {
        //TODO separate rotational and transational motors.
        const motor = motorIndex
            ? joint.physicsJoint.rotationalLimitMotor2
            : joint.physicsJoint.rotationalLimitMotor1 || joint.physicsJoint.rotationalLimitMotor || joint.physicsJoint.limitMotor;
        if (motor) {
            motor.setLimit(upperLimit, lowerLimit === void 0 ? -upperLimit : lowerLimit);
        }
    }
    syncMeshWithImpostor(mesh, impostor) {
        const body = impostor.physicsBody;
        mesh.position.x = body.position.x;
        mesh.position.y = body.position.y;
        mesh.position.z = body.position.z;
        if (mesh.rotationQuaternion) {
            mesh.rotationQuaternion.x = body.orientation.x;
            mesh.rotationQuaternion.y = body.orientation.y;
            mesh.rotationQuaternion.z = body.orientation.z;
            mesh.rotationQuaternion.w = body.orientation.w;
        }
    }
    getRadius(impostor) {
        return impostor.physicsBody.shapes.radius;
    }
    getBoxSizeToRef(impostor, result) {
        const shape = impostor.physicsBody.shapes;
        result.x = shape.halfWidth * 2;
        result.y = shape.halfHeight * 2;
        result.z = shape.halfDepth * 2;
    }
    dispose() {
        this.world.clear();
    }
    /**
     * Does a raycast in the physics world
     * @param from when should the ray start?
     * @param to when should the ray end?
     * @returns PhysicsRaycastResult
     */
    raycast(from, to) {
        logger/* Logger */.V.Warn("raycast is not currently supported by the Oimo physics plugin");
        this._raycastResult.reset(from, to);
        return this._raycastResult;
    }
    /**
     * Does a raycast in the physics world
     * @param from when should the ray start?
     * @param to when should the ray end?
     * @param result resulting PhysicsRaycastResult
     */
    raycastToRef(from, to, result) {
        logger/* Logger */.V.Warn("raycast is not currently supported by the Oimo physics plugin");
        result.reset(from, to);
    }
}
//# sourceMappingURL=oimoJSPlugin.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/Plugins/ammoJSPlugin.js











/**
 * AmmoJS Physics plugin
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 * @see https://github.com/kripken/ammo.js/
 */
class AmmoJSPlugin {
    /**
     * Initializes the ammoJS plugin
     * @param _useDeltaForWorldStep if the time between frames should be used when calculating physics steps (Default: true)
     * @param ammoInjection can be used to inject your own ammo reference
     * @param overlappingPairCache can be used to specify your own overlapping pair cache
     */
    constructor(_useDeltaForWorldStep = true, ammoInjection = Ammo, overlappingPairCache = null) {
        this._useDeltaForWorldStep = _useDeltaForWorldStep;
        /**
         * Reference to the Ammo library
         */
        this.bjsAMMO = {};
        /**
         * Name of the plugin
         */
        this.name = "AmmoJSPlugin";
        this._timeStep = 1 / 60;
        this._fixedTimeStep = 1 / 60;
        this._maxSteps = 5;
        this._tmpQuaternion = new math_vector/* Quaternion */.PT();
        this._tmpContactCallbackResult = false;
        this._tmpContactPoint = new math_vector/* Vector3 */.Pq();
        this._tmpContactNormal = new math_vector/* Vector3 */.Pq();
        this._tmpVec3 = new math_vector/* Vector3 */.Pq();
        this._tmpMatrix = new math_vector/* Matrix */.uq();
        if (typeof ammoInjection === "function") {
            logger/* Logger */.V.Error("AmmoJS is not ready. Please make sure you await Ammo() before using the plugin.");
            return;
        }
        else {
            this.bjsAMMO = ammoInjection;
        }
        if (!this.isSupported()) {
            logger/* Logger */.V.Error("AmmoJS is not available. Please make sure you included the js file.");
            return;
        }
        // Initialize the physics world
        this._collisionConfiguration = new this.bjsAMMO.btSoftBodyRigidBodyCollisionConfiguration();
        this._dispatcher = new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration);
        this._overlappingPairCache = overlappingPairCache || new this.bjsAMMO.btDbvtBroadphase();
        this._solver = new this.bjsAMMO.btSequentialImpulseConstraintSolver();
        this._softBodySolver = new this.bjsAMMO.btDefaultSoftBodySolver();
        this.world = new this.bjsAMMO.btSoftRigidDynamicsWorld(this._dispatcher, this._overlappingPairCache, this._solver, this._collisionConfiguration, this._softBodySolver);
        this._tmpAmmoConcreteContactResultCallback = new this.bjsAMMO.ConcreteContactResultCallback();
        this._tmpAmmoConcreteContactResultCallback.addSingleResult = (contactPoint) => {
            contactPoint = this.bjsAMMO.wrapPointer(contactPoint, this.bjsAMMO.btManifoldPoint);
            const worldPoint = contactPoint.getPositionWorldOnA();
            const worldNormal = contactPoint.m_normalWorldOnB;
            this._tmpContactPoint.x = worldPoint.x();
            this._tmpContactPoint.y = worldPoint.y();
            this._tmpContactPoint.z = worldPoint.z();
            this._tmpContactNormal.x = worldNormal.x();
            this._tmpContactNormal.y = worldNormal.y();
            this._tmpContactNormal.z = worldNormal.z();
            this._tmpContactImpulse = contactPoint.getAppliedImpulse();
            this._tmpContactDistance = contactPoint.getDistance();
            this._tmpContactCallbackResult = true;
        };
        this._raycastResult = new PhysicsRaycastResult();
        // Create temp ammo variables
        this._tmpAmmoTransform = new this.bjsAMMO.btTransform();
        this._tmpAmmoTransform.setIdentity();
        this._tmpAmmoQuaternion = new this.bjsAMMO.btQuaternion(0, 0, 0, 1);
        this._tmpAmmoVectorA = new this.bjsAMMO.btVector3(0, 0, 0);
        this._tmpAmmoVectorB = new this.bjsAMMO.btVector3(0, 0, 0);
        this._tmpAmmoVectorC = new this.bjsAMMO.btVector3(0, 0, 0);
        this._tmpAmmoVectorD = new this.bjsAMMO.btVector3(0, 0, 0);
    }
    /**
     *
     * @returns plugin version
     */
    getPluginVersion() {
        return 1;
    }
    /**
     * Sets the gravity of the physics world (m/(s^2))
     * @param gravity Gravity to set
     */
    setGravity(gravity) {
        this._tmpAmmoVectorA.setValue(gravity.x, gravity.y, gravity.z);
        this.world.setGravity(this._tmpAmmoVectorA);
        this.world.getWorldInfo().set_m_gravity(this._tmpAmmoVectorA);
    }
    /**
     * Amount of time to step forward on each frame (only used if useDeltaForWorldStep is false in the constructor)
     * @param timeStep timestep to use in seconds
     */
    setTimeStep(timeStep) {
        this._timeStep = timeStep;
    }
    /**
     * Increment to step forward in the physics engine (If timeStep is set to 1/60 and fixedTimeStep is set to 1/120 the physics engine should run 2 steps per frame) (Default: 1/60)
     * @param fixedTimeStep fixedTimeStep to use in seconds
     */
    setFixedTimeStep(fixedTimeStep) {
        this._fixedTimeStep = fixedTimeStep;
    }
    /**
     * Sets the maximum number of steps by the physics engine per frame (Default: 5)
     * @param maxSteps the maximum number of steps by the physics engine per frame
     */
    setMaxSteps(maxSteps) {
        this._maxSteps = maxSteps;
    }
    /**
     * Gets the current timestep (only used if useDeltaForWorldStep is false in the constructor)
     * @returns the current timestep in seconds
     */
    getTimeStep() {
        return this._timeStep;
    }
    // Ammo's contactTest and contactPairTest take a callback that runs synchronously, wrap them so that they are easier to consume
    _isImpostorInContact(impostor) {
        this._tmpContactCallbackResult = false;
        this.world.contactTest(impostor.physicsBody, this._tmpAmmoConcreteContactResultCallback);
        return this._tmpContactCallbackResult;
    }
    // Ammo's collision events have some weird quirks
    // contactPairTest fires too many events as it fires events even when objects are close together but contactTest does not
    // so only fire event if both contactTest and contactPairTest have a hit
    _isImpostorPairInContact(impostorA, impostorB) {
        this._tmpContactCallbackResult = false;
        this.world.contactPairTest(impostorA.physicsBody, impostorB.physicsBody, this._tmpAmmoConcreteContactResultCallback);
        return this._tmpContactCallbackResult;
    }
    // Ammo's behavior when maxSteps > 0 does not behave as described in docs
    // @see http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Stepping_The_World
    //
    // When maxSteps is 0 do the entire simulation in one step
    // When maxSteps is > 0, run up to maxStep times, if on the last step the (remaining step - fixedTimeStep) is < fixedTimeStep, the remainder will be used for the step. (eg. if remainder is 1.001 and fixedTimeStep is 1 the last step will be 1.001, if instead it did 2 steps (1, 0.001) issues occuered when having a tiny step in ammo)
    // Note: To get deterministic physics, timeStep would always need to be divisible by fixedTimeStep
    _stepSimulation(timeStep = 1 / 60, maxSteps = 10, fixedTimeStep = 1 / 60) {
        if (maxSteps == 0) {
            this.world.stepSimulation(timeStep, 0);
        }
        else {
            while (maxSteps > 0 && timeStep > 0) {
                if (timeStep - fixedTimeStep < fixedTimeStep) {
                    this.world.stepSimulation(timeStep, 0);
                    timeStep = 0;
                }
                else {
                    timeStep -= fixedTimeStep;
                    this.world.stepSimulation(fixedTimeStep, 0);
                }
                maxSteps--;
            }
        }
    }
    /**
     * Moves the physics simulation forward delta seconds and updates the given physics imposters
     * Prior to the step the imposters physics location is set to the position of the babylon meshes
     * After the step the babylon meshes are set to the position of the physics imposters
     * @param delta amount of time to step forward
     * @param impostors array of imposters to update before/after the step
     */
    executeStep(delta, impostors) {
        for (const impostor of impostors) {
            // Update physics world objects to match babylon world
            if (!impostor.soft) {
                impostor.beforeStep();
            }
        }
        this._stepSimulation(this._useDeltaForWorldStep ? delta : this._timeStep, this._maxSteps, this._fixedTimeStep);
        for (const mainImpostor of impostors) {
            // After physics update make babylon world objects match physics world objects
            if (mainImpostor.soft) {
                this._afterSoftStep(mainImpostor);
            }
            else {
                mainImpostor.afterStep();
            }
            // Handle collision event
            if (mainImpostor._onPhysicsCollideCallbacks.length > 0) {
                if (this._isImpostorInContact(mainImpostor)) {
                    for (const collideCallback of mainImpostor._onPhysicsCollideCallbacks) {
                        for (const otherImpostor of collideCallback.otherImpostors) {
                            if (mainImpostor.physicsBody.isActive() || otherImpostor.physicsBody.isActive()) {
                                if (this._isImpostorPairInContact(mainImpostor, otherImpostor)) {
                                    mainImpostor.onCollide({
                                        body: otherImpostor.physicsBody,
                                        point: this._tmpContactPoint,
                                        distance: this._tmpContactDistance,
                                        impulse: this._tmpContactImpulse,
                                        normal: this._tmpContactNormal,
                                    });
                                    otherImpostor.onCollide({
                                        body: mainImpostor.physicsBody,
                                        point: this._tmpContactPoint,
                                        distance: this._tmpContactDistance,
                                        impulse: this._tmpContactImpulse,
                                        normal: this._tmpContactNormal,
                                    });
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    /**
     * Update babylon mesh to match physics world object
     * @param impostor imposter to match
     */
    _afterSoftStep(impostor) {
        if (impostor.type === PhysicsImpostor.RopeImpostor) {
            this._ropeStep(impostor);
        }
        else {
            this._softbodyOrClothStep(impostor);
        }
    }
    /**
     * Update babylon mesh vertices vertices to match physics world softbody or cloth
     * @param impostor imposter to match
     */
    _ropeStep(impostor) {
        const bodyVertices = impostor.physicsBody.get_m_nodes();
        const nbVertices = bodyVertices.size();
        let node;
        let nodePositions;
        let x, y, z;
        const path = new Array();
        for (let n = 0; n < nbVertices; n++) {
            node = bodyVertices.at(n);
            nodePositions = node.get_m_x();
            x = nodePositions.x();
            y = nodePositions.y();
            z = nodePositions.z();
            path.push(new math_vector/* Vector3 */.Pq(x, y, z));
        }
        const object = impostor.object;
        const shape = impostor.getParam("shape");
        if (impostor._isFromLine) {
            impostor.object = CreateLines("lines", { points: path, instance: object });
        }
        else {
            impostor.object = ExtrudeShape("ext", { shape: shape, path: path, instance: object });
        }
    }
    /**
     * Update babylon mesh vertices vertices to match physics world softbody or cloth
     * @param impostor imposter to match
     */
    _softbodyOrClothStep(impostor) {
        const normalDirection = impostor.type === PhysicsImpostor.ClothImpostor ? 1 : -1;
        const object = impostor.object;
        let vertexPositions = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        if (!vertexPositions) {
            vertexPositions = [];
        }
        let vertexNormals = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
        if (!vertexNormals) {
            vertexNormals = [];
        }
        const nbVertices = vertexPositions.length / 3;
        const bodyVertices = impostor.physicsBody.get_m_nodes();
        let node;
        let nodePositions;
        let x, y, z;
        let nx, ny, nz;
        for (let n = 0; n < nbVertices; n++) {
            node = bodyVertices.at(n);
            nodePositions = node.get_m_x();
            x = nodePositions.x();
            y = nodePositions.y();
            z = nodePositions.z() * normalDirection;
            const nodeNormals = node.get_m_n();
            nx = nodeNormals.x();
            ny = nodeNormals.y();
            nz = nodeNormals.z() * normalDirection;
            vertexPositions[3 * n] = x;
            vertexPositions[3 * n + 1] = y;
            vertexPositions[3 * n + 2] = z;
            vertexNormals[3 * n] = nx;
            vertexNormals[3 * n + 1] = ny;
            vertexNormals[3 * n + 2] = nz;
        }
        const vertex_data = new mesh_vertexData/* VertexData */.P();
        vertex_data.positions = vertexPositions;
        vertex_data.normals = vertexNormals;
        vertex_data.uvs = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind);
        vertex_data.colors = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind);
        if (object && object.getIndices) {
            vertex_data.indices = object.getIndices();
        }
        vertex_data.applyToMesh(object);
    }
    /**
     * Applies an impulse on the imposter
     * @param impostor imposter to apply impulse to
     * @param force amount of force to be applied to the imposter
     * @param contactPoint the location to apply the impulse on the imposter
     */
    applyImpulse(impostor, force, contactPoint) {
        if (!impostor.soft) {
            impostor.physicsBody.activate();
            const worldPoint = this._tmpAmmoVectorA;
            const impulse = this._tmpAmmoVectorB;
            // Convert contactPoint relative to center of mass
            if (impostor.object && impostor.object.getWorldMatrix) {
                contactPoint.subtractInPlace(impostor.object.getWorldMatrix().getTranslation());
            }
            worldPoint.setValue(contactPoint.x, contactPoint.y, contactPoint.z);
            impulse.setValue(force.x, force.y, force.z);
            impostor.physicsBody.applyImpulse(impulse, worldPoint);
        }
        else {
            logger/* Logger */.V.Warn("Cannot be applied to a soft body");
        }
    }
    /**
     * Applies a force on the imposter
     * @param impostor imposter to apply force
     * @param force amount of force to be applied to the imposter
     * @param contactPoint the location to apply the force on the imposter
     */
    applyForce(impostor, force, contactPoint) {
        if (!impostor.soft) {
            impostor.physicsBody.activate();
            const worldPoint = this._tmpAmmoVectorA;
            const impulse = this._tmpAmmoVectorB;
            // Convert contactPoint relative to center of mass
            if (impostor.object && impostor.object.getWorldMatrix) {
                const localTranslation = impostor.object.getWorldMatrix().getTranslation();
                worldPoint.setValue(contactPoint.x - localTranslation.x, contactPoint.y - localTranslation.y, contactPoint.z - localTranslation.z);
            }
            else {
                worldPoint.setValue(contactPoint.x, contactPoint.y, contactPoint.z);
            }
            impulse.setValue(force.x, force.y, force.z);
            impostor.physicsBody.applyForce(impulse, worldPoint);
        }
        else {
            logger/* Logger */.V.Warn("Cannot be applied to a soft body");
        }
    }
    /**
     * Creates a physics body using the plugin
     * @param impostor the imposter to create the physics body on
     */
    generatePhysicsBody(impostor) {
        // Note: this method will not be called on child imposotrs for compound impostors
        impostor._pluginData.toDispose = [];
        //parent-child relationship
        if (impostor.parent) {
            if (impostor.physicsBody) {
                this.removePhysicsBody(impostor);
                impostor.forceUpdate();
            }
            return;
        }
        if (impostor.isBodyInitRequired()) {
            const colShape = this._createShape(impostor);
            const mass = impostor.getParam("mass");
            impostor._pluginData.mass = mass;
            if (impostor.soft) {
                colShape.get_m_cfg().set_collisions(0x11);
                colShape.get_m_cfg().set_kDP(impostor.getParam("damping"));
                this.bjsAMMO.castObject(colShape, this.bjsAMMO.btCollisionObject).getCollisionShape().setMargin(impostor.getParam("margin"));
                colShape.setActivationState(AmmoJSPlugin._DISABLE_DEACTIVATION_FLAG);
                this.world.addSoftBody(colShape, 1, -1);
                impostor.physicsBody = colShape;
                impostor._pluginData.toDispose.push(colShape);
                this.setBodyPressure(impostor, 0);
                if (impostor.type === PhysicsImpostor.SoftbodyImpostor) {
                    this.setBodyPressure(impostor, impostor.getParam("pressure"));
                }
                this.setBodyStiffness(impostor, impostor.getParam("stiffness"));
                this.setBodyVelocityIterations(impostor, impostor.getParam("velocityIterations"));
                this.setBodyPositionIterations(impostor, impostor.getParam("positionIterations"));
            }
            else {
                const localInertia = new this.bjsAMMO.btVector3(0, 0, 0);
                const startTransform = new this.bjsAMMO.btTransform();
                impostor.object.computeWorldMatrix(true);
                startTransform.setIdentity();
                if (mass !== 0) {
                    colShape.calculateLocalInertia(mass, localInertia);
                }
                this._tmpAmmoVectorA.setValue(impostor.object.position.x, impostor.object.position.y, impostor.object.position.z);
                this._tmpAmmoQuaternion.setValue(impostor.object.rotationQuaternion.x, impostor.object.rotationQuaternion.y, impostor.object.rotationQuaternion.z, impostor.object.rotationQuaternion.w);
                startTransform.setOrigin(this._tmpAmmoVectorA);
                startTransform.setRotation(this._tmpAmmoQuaternion);
                const myMotionState = new this.bjsAMMO.btDefaultMotionState(startTransform);
                const rbInfo = new this.bjsAMMO.btRigidBodyConstructionInfo(mass, myMotionState, colShape, localInertia);
                const body = new this.bjsAMMO.btRigidBody(rbInfo);
                // Make objects kinematic if it's mass is 0
                if (mass === 0) {
                    body.setCollisionFlags(body.getCollisionFlags() | AmmoJSPlugin._KINEMATIC_FLAG);
                    body.setActivationState(AmmoJSPlugin._DISABLE_DEACTIVATION_FLAG);
                }
                // Disable collision if NoImpostor, but keep collision if shape is btCompoundShape
                if (impostor.type == PhysicsImpostor.NoImpostor && !colShape.getChildShape) {
                    body.setCollisionFlags(body.getCollisionFlags() | AmmoJSPlugin._DISABLE_COLLISION_FLAG);
                }
                // compute delta position: compensate the difference between shape center and mesh origin
                if (impostor.type !== PhysicsImpostor.MeshImpostor && impostor.type !== PhysicsImpostor.NoImpostor) {
                    const boundingInfo = impostor.object.getBoundingInfo();
                    this._tmpVec3.copyFrom(impostor.object.getAbsolutePosition());
                    this._tmpVec3.subtractInPlace(boundingInfo.boundingBox.centerWorld);
                    this._tmpVec3.x /= impostor.object.scaling.x;
                    this._tmpVec3.y /= impostor.object.scaling.y;
                    this._tmpVec3.z /= impostor.object.scaling.z;
                    impostor.setDeltaPosition(this._tmpVec3);
                }
                const group = impostor.getParam("group");
                const mask = impostor.getParam("mask");
                if (group && mask) {
                    this.world.addRigidBody(body, group, mask);
                }
                else {
                    this.world.addRigidBody(body);
                }
                impostor.physicsBody = body;
                impostor._pluginData.toDispose = impostor._pluginData.toDispose.concat([body, rbInfo, myMotionState, startTransform, localInertia, colShape]);
            }
            this.setBodyRestitution(impostor, impostor.getParam("restitution"));
            this.setBodyFriction(impostor, impostor.getParam("friction"));
        }
    }
    /**
     * Removes the physics body from the imposter and disposes of the body's memory
     * @param impostor imposter to remove the physics body from
     */
    removePhysicsBody(impostor) {
        if (this.world) {
            if (impostor.soft) {
                this.world.removeSoftBody(impostor.physicsBody);
            }
            else {
                this.world.removeRigidBody(impostor.physicsBody);
            }
            if (impostor._pluginData) {
                impostor._pluginData.toDispose.forEach((d) => {
                    this.bjsAMMO.destroy(d);
                });
                impostor._pluginData.toDispose = [];
            }
        }
    }
    /**
     * Generates a joint
     * @param impostorJoint the imposter joint to create the joint with
     */
    generateJoint(impostorJoint) {
        const mainBody = impostorJoint.mainImpostor.physicsBody;
        const connectedBody = impostorJoint.connectedImpostor.physicsBody;
        if (!mainBody || !connectedBody) {
            return;
        }
        // if the joint is already created, don't create it again for preventing memory leaks
        if (impostorJoint.joint.physicsJoint) {
            return;
        }
        const jointData = impostorJoint.joint.jointData;
        if (!jointData.mainPivot) {
            jointData.mainPivot = new math_vector/* Vector3 */.Pq(0, 0, 0);
        }
        if (!jointData.connectedPivot) {
            jointData.connectedPivot = new math_vector/* Vector3 */.Pq(0, 0, 0);
        }
        let joint;
        switch (impostorJoint.joint.type) {
            case PhysicsJoint.DistanceJoint: {
                const distance = jointData.maxDistance;
                if (distance) {
                    jointData.mainPivot = new math_vector/* Vector3 */.Pq(0, -distance / 2, 0);
                    jointData.connectedPivot = new math_vector/* Vector3 */.Pq(0, distance / 2, 0);
                }
                const mainPivot = this._tmpAmmoVectorA;
                mainPivot.setValue(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z);
                const connectedPivot = this._tmpAmmoVectorB;
                connectedPivot.setValue(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z);
                joint = new this.bjsAMMO.btPoint2PointConstraint(mainBody, connectedBody, mainPivot, connectedPivot);
                break;
            }
            case PhysicsJoint.HingeJoint: {
                if (!jointData.mainAxis) {
                    jointData.mainAxis = new math_vector/* Vector3 */.Pq(0, 0, 0);
                }
                if (!jointData.connectedAxis) {
                    jointData.connectedAxis = new math_vector/* Vector3 */.Pq(0, 0, 0);
                }
                const mainPivot = this._tmpAmmoVectorA;
                mainPivot.setValue(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z);
                const connectedPivot = this._tmpAmmoVectorB;
                connectedPivot.setValue(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z);
                const mainAxis = this._tmpAmmoVectorC;
                mainAxis.setValue(jointData.mainAxis.x, jointData.mainAxis.y, jointData.mainAxis.z);
                const connectedAxis = this._tmpAmmoVectorD;
                connectedAxis.setValue(jointData.connectedAxis.x, jointData.connectedAxis.y, jointData.connectedAxis.z);
                joint = new this.bjsAMMO.btHingeConstraint(mainBody, connectedBody, mainPivot, connectedPivot, mainAxis, connectedAxis);
                break;
            }
            case PhysicsJoint.BallAndSocketJoint: {
                const mainPivot = this._tmpAmmoVectorA;
                mainPivot.setValue(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z);
                const connectedPivot = this._tmpAmmoVectorB;
                connectedPivot.setValue(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z);
                joint = new this.bjsAMMO.btPoint2PointConstraint(mainBody, connectedBody, mainPivot, connectedPivot);
                break;
            }
            default: {
                logger/* Logger */.V.Warn("JointType not currently supported by the Ammo plugin, falling back to PhysicsJoint.BallAndSocketJoint");
                const mainPivot = this._tmpAmmoVectorA;
                mainPivot.setValue(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z);
                const connectedPivot = this._tmpAmmoVectorB;
                connectedPivot.setValue(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z);
                joint = new this.bjsAMMO.btPoint2PointConstraint(mainBody, connectedBody, mainPivot, connectedPivot);
                break;
            }
        }
        this.world.addConstraint(joint, !impostorJoint.joint.jointData.collision);
        impostorJoint.joint.physicsJoint = joint;
    }
    /**
     * Removes a joint
     * @param impostorJoint the imposter joint to remove the joint from
     */
    removeJoint(impostorJoint) {
        if (this.world) {
            this.world.removeConstraint(impostorJoint.joint.physicsJoint);
        }
        this.bjsAMMO.destroy(impostorJoint.joint.physicsJoint);
    }
    // adds all verticies (including child verticies) to the triangle mesh
    _addMeshVerts(btTriangleMesh, topLevelObject, object) {
        let triangleCount = 0;
        if (object && object.getIndices && object.getWorldMatrix && object.getChildMeshes) {
            let indices = object.getIndices();
            if (!indices) {
                indices = [];
            }
            let vertexPositions = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
            if (!vertexPositions) {
                vertexPositions = [];
            }
            let localMatrix;
            if (topLevelObject && topLevelObject !== object) {
                // top level matrix used for shape transform doesn't take scale into account.
                // Moreover, every children vertex position must be in that space.
                // So, each vertex position here is transform by (mesh world matrix * toplevelMatrix -1)
                let topLevelQuaternion;
                if (topLevelObject.rotationQuaternion) {
                    topLevelQuaternion = topLevelObject.rotationQuaternion;
                }
                else if (topLevelObject.rotation) {
                    topLevelQuaternion = math_vector/* Quaternion */.PT.FromEulerAngles(topLevelObject.rotation.x, topLevelObject.rotation.y, topLevelObject.rotation.z);
                }
                else {
                    topLevelQuaternion = math_vector/* Quaternion */.PT.Identity();
                }
                const topLevelMatrix = math_vector/* Matrix */.uq.Compose(math_vector/* Vector3 */.Pq.One(), topLevelQuaternion, topLevelObject.position);
                topLevelMatrix.invertToRef(this._tmpMatrix);
                const wm = object.computeWorldMatrix(false);
                localMatrix = wm.multiply(this._tmpMatrix);
            }
            else {
                // current top level is same as object level -> only use local scaling
                math_vector/* Matrix */.uq.ScalingToRef(object.scaling.x, object.scaling.y, object.scaling.z, this._tmpMatrix);
                localMatrix = this._tmpMatrix;
            }
            const faceCount = indices.length / 3;
            for (let i = 0; i < faceCount; i++) {
                const triPoints = [];
                for (let point = 0; point < 3; point++) {
                    let v = new math_vector/* Vector3 */.Pq(vertexPositions[indices[i * 3 + point] * 3 + 0], vertexPositions[indices[i * 3 + point] * 3 + 1], vertexPositions[indices[i * 3 + point] * 3 + 2]);
                    v = math_vector/* Vector3 */.Pq.TransformCoordinates(v, localMatrix);
                    let vec;
                    if (point == 0) {
                        vec = this._tmpAmmoVectorA;
                    }
                    else if (point == 1) {
                        vec = this._tmpAmmoVectorB;
                    }
                    else {
                        vec = this._tmpAmmoVectorC;
                    }
                    vec.setValue(v.x, v.y, v.z);
                    triPoints.push(vec);
                }
                btTriangleMesh.addTriangle(triPoints[0], triPoints[1], triPoints[2]);
                triangleCount++;
            }
            object.getChildMeshes().forEach((m) => {
                triangleCount += this._addMeshVerts(btTriangleMesh, topLevelObject, m);
            });
        }
        return triangleCount;
    }
    /**
     * Initialise the soft body vertices to match its object's (mesh) vertices
     * Softbody vertices (nodes) are in world space and to match this
     * The object's position and rotation is set to zero and so its vertices are also then set in world space
     * @param impostor to create the softbody for
     * @returns the number of vertices added to the softbody
     */
    _softVertexData(impostor) {
        const object = impostor.object;
        if (object && object.getIndices && object.getWorldMatrix && object.getChildMeshes) {
            let indices = object.getIndices();
            if (!indices) {
                indices = [];
            }
            let vertexPositions = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
            if (!vertexPositions) {
                vertexPositions = [];
            }
            let vertexNormals = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
            if (!vertexNormals) {
                vertexNormals = [];
            }
            object.computeWorldMatrix(false);
            const newPoints = [];
            const newNorms = [];
            for (let i = 0; i < vertexPositions.length; i += 3) {
                let v = new math_vector/* Vector3 */.Pq(vertexPositions[i], vertexPositions[i + 1], vertexPositions[i + 2]);
                let n = new math_vector/* Vector3 */.Pq(vertexNormals[i], vertexNormals[i + 1], vertexNormals[i + 2]);
                v = math_vector/* Vector3 */.Pq.TransformCoordinates(v, object.getWorldMatrix());
                n = math_vector/* Vector3 */.Pq.TransformNormal(n, object.getWorldMatrix());
                newPoints.push(v.x, v.y, v.z);
                newNorms.push(n.x, n.y, n.z);
            }
            const vertex_data = new mesh_vertexData/* VertexData */.P();
            vertex_data.positions = newPoints;
            vertex_data.normals = newNorms;
            vertex_data.uvs = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind);
            vertex_data.colors = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind);
            if (object && object.getIndices) {
                vertex_data.indices = object.getIndices();
            }
            vertex_data.applyToMesh(object);
            object.position = math_vector/* Vector3 */.Pq.Zero();
            object.rotationQuaternion = null;
            object.rotation = math_vector/* Vector3 */.Pq.Zero();
            object.computeWorldMatrix(true);
            return vertex_data;
        }
        return mesh_vertexData/* VertexData */.P.ExtractFromMesh(object);
    }
    /**
     * Create an impostor's soft body
     * @param impostor to create the softbody for
     * @returns the softbody
     */
    _createSoftbody(impostor) {
        const object = impostor.object;
        if (object && object.getIndices) {
            let indices = object.getIndices();
            if (!indices) {
                indices = [];
            }
            const vertex_data = this._softVertexData(impostor);
            const vertexPositions = vertex_data.positions;
            const vertexNormals = vertex_data.normals;
            if (vertexPositions === null || vertexNormals === null) {
                return new this.bjsAMMO.btCompoundShape();
            }
            else {
                const triPoints = [];
                const triNorms = [];
                for (let i = 0; i < vertexPositions.length; i += 3) {
                    const v = new math_vector/* Vector3 */.Pq(vertexPositions[i], vertexPositions[i + 1], vertexPositions[i + 2]);
                    const n = new math_vector/* Vector3 */.Pq(vertexNormals[i], vertexNormals[i + 1], vertexNormals[i + 2]);
                    triPoints.push(v.x, v.y, -v.z);
                    triNorms.push(n.x, n.y, -n.z);
                }
                const softBody = new this.bjsAMMO.btSoftBodyHelpers().CreateFromTriMesh(this.world.getWorldInfo(), triPoints, object.getIndices(), indices.length / 3, true);
                const nbVertices = vertexPositions.length / 3;
                const bodyVertices = softBody.get_m_nodes();
                let node;
                let nodeNormals;
                for (let i = 0; i < nbVertices; i++) {
                    node = bodyVertices.at(i);
                    nodeNormals = node.get_m_n();
                    nodeNormals.setX(triNorms[3 * i]);
                    nodeNormals.setY(triNorms[3 * i + 1]);
                    nodeNormals.setZ(triNorms[3 * i + 2]);
                }
                return softBody;
            }
        }
    }
    /**
     * Create cloth for an impostor
     * @param impostor to create the softbody for
     * @returns the cloth
     */
    _createCloth(impostor) {
        const object = impostor.object;
        if (object && object.getIndices) {
            let indices = object.getIndices();
            if (!indices) {
                indices = [];
            }
            const vertex_data = this._softVertexData(impostor);
            const vertexPositions = vertex_data.positions;
            const vertexNormals = vertex_data.normals;
            if (vertexPositions === null || vertexNormals === null) {
                return new this.bjsAMMO.btCompoundShape();
            }
            else {
                const len = vertexPositions.length;
                const segments = Math.sqrt(len / 3);
                impostor.segments = segments;
                const segs = segments - 1;
                this._tmpAmmoVectorA.setValue(vertexPositions[0], vertexPositions[1], vertexPositions[2]);
                this._tmpAmmoVectorB.setValue(vertexPositions[3 * segs], vertexPositions[3 * segs + 1], vertexPositions[3 * segs + 2]);
                this._tmpAmmoVectorD.setValue(vertexPositions[len - 3], vertexPositions[len - 2], vertexPositions[len - 1]);
                this._tmpAmmoVectorC.setValue(vertexPositions[len - 3 - 3 * segs], vertexPositions[len - 2 - 3 * segs], vertexPositions[len - 1 - 3 * segs]);
                const clothBody = new this.bjsAMMO.btSoftBodyHelpers().CreatePatch(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, this._tmpAmmoVectorC, this._tmpAmmoVectorD, segments, segments, impostor.getParam("fixedPoints"), true);
                return clothBody;
            }
        }
    }
    /**
     * Create rope for an impostor
     * @param impostor to create the softbody for
     * @returns the rope
     */
    _createRope(impostor) {
        let len;
        let segments;
        const vertex_data = this._softVertexData(impostor);
        const vertexPositions = vertex_data.positions;
        const vertexNormals = vertex_data.normals;
        if (vertexPositions === null || vertexNormals === null) {
            return new this.bjsAMMO.btCompoundShape();
        }
        //force the mesh to be updatable
        vertex_data.applyToMesh(impostor.object, true);
        impostor._isFromLine = true;
        // If in lines mesh all normals will be zero
        const vertexSquared = vertexNormals.map((x) => x * x);
        const reducer = (accumulator, currentValue) => accumulator + currentValue;
        const reduced = vertexSquared.reduce(reducer);
        if (reduced === 0) {
            // line mesh
            len = vertexPositions.length;
            segments = len / 3 - 1;
            this._tmpAmmoVectorA.setValue(vertexPositions[0], vertexPositions[1], vertexPositions[2]);
            this._tmpAmmoVectorB.setValue(vertexPositions[len - 3], vertexPositions[len - 2], vertexPositions[len - 1]);
        }
        else {
            //extruded mesh
            impostor._isFromLine = false;
            const pathVectors = impostor.getParam("path");
            const shape = impostor.getParam("shape");
            if (shape === null) {
                logger/* Logger */.V.Warn("No shape available for extruded mesh");
                return new this.bjsAMMO.btCompoundShape();
            }
            len = pathVectors.length;
            segments = len - 1;
            this._tmpAmmoVectorA.setValue(pathVectors[0].x, pathVectors[0].y, pathVectors[0].z);
            this._tmpAmmoVectorB.setValue(pathVectors[len - 1].x, pathVectors[len - 1].y, pathVectors[len - 1].z);
        }
        impostor.segments = segments;
        let fixedPoints = impostor.getParam("fixedPoints");
        fixedPoints = fixedPoints > 3 ? 3 : fixedPoints;
        const ropeBody = new this.bjsAMMO.btSoftBodyHelpers().CreateRope(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, segments - 1, fixedPoints);
        ropeBody.get_m_cfg().set_collisions(0x11);
        return ropeBody;
    }
    /**
     * Create a custom physics impostor shape using the plugin's onCreateCustomShape handler
     * @param impostor to create the custom physics shape for
     * @returns the custom physics shape
     */
    _createCustom(impostor) {
        let returnValue = null;
        if (this.onCreateCustomShape) {
            returnValue = this.onCreateCustomShape(impostor);
        }
        if (returnValue == null) {
            returnValue = new this.bjsAMMO.btCompoundShape();
        }
        return returnValue;
    }
    // adds all verticies (including child verticies) to the convex hull shape
    _addHullVerts(btConvexHullShape, topLevelObject, object) {
        let triangleCount = 0;
        if (object && object.getIndices && object.getWorldMatrix && object.getChildMeshes) {
            let indices = object.getIndices();
            if (!indices) {
                indices = [];
            }
            let vertexPositions = object.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
            if (!vertexPositions) {
                vertexPositions = [];
            }
            object.computeWorldMatrix(false);
            const faceCount = indices.length / 3;
            for (let i = 0; i < faceCount; i++) {
                const triPoints = [];
                for (let point = 0; point < 3; point++) {
                    let v = new math_vector/* Vector3 */.Pq(vertexPositions[indices[i * 3 + point] * 3 + 0], vertexPositions[indices[i * 3 + point] * 3 + 1], vertexPositions[indices[i * 3 + point] * 3 + 2]);
                    // Adjust for initial scaling
                    math_vector/* Matrix */.uq.ScalingToRef(object.scaling.x, object.scaling.y, object.scaling.z, this._tmpMatrix);
                    v = math_vector/* Vector3 */.Pq.TransformCoordinates(v, this._tmpMatrix);
                    let vec;
                    if (point == 0) {
                        vec = this._tmpAmmoVectorA;
                    }
                    else if (point == 1) {
                        vec = this._tmpAmmoVectorB;
                    }
                    else {
                        vec = this._tmpAmmoVectorC;
                    }
                    vec.setValue(v.x, v.y, v.z);
                    triPoints.push(vec);
                }
                btConvexHullShape.addPoint(triPoints[0], true);
                btConvexHullShape.addPoint(triPoints[1], true);
                btConvexHullShape.addPoint(triPoints[2], true);
                triangleCount++;
            }
            object.getChildMeshes().forEach((m) => {
                triangleCount += this._addHullVerts(btConvexHullShape, topLevelObject, m);
            });
        }
        return triangleCount;
    }
    _createShape(impostor, ignoreChildren = false) {
        const object = impostor.object;
        let returnValue;
        const impostorExtents = impostor.getObjectExtents();
        if (!ignoreChildren) {
            const meshChildren = impostor.object.getChildMeshes ? impostor.object.getChildMeshes(true) : [];
            returnValue = new this.bjsAMMO.btCompoundShape();
            // Add shape of all children to the compound shape
            let childrenAdded = 0;
            meshChildren.forEach((childMesh) => {
                const childImpostor = childMesh.getPhysicsImpostor();
                if (childImpostor) {
                    if (childImpostor.type == PhysicsImpostor.MeshImpostor) {
                        // eslint-disable-next-line no-throw-literal
                        throw "A child MeshImpostor is not supported. Only primitive impostors are supported as children (eg. box or sphere)";
                    }
                    const shape = this._createShape(childImpostor);
                    // Position needs to be scaled based on parent's scaling
                    const parentMat = childMesh.parent.getWorldMatrix().clone();
                    const s = new math_vector/* Vector3 */.Pq();
                    parentMat.decompose(s);
                    this._tmpAmmoTransform.getOrigin().setValue(childMesh.position.x * s.x, childMesh.position.y * s.y, childMesh.position.z * s.z);
                    this._tmpAmmoQuaternion.setValue(childMesh.rotationQuaternion.x, childMesh.rotationQuaternion.y, childMesh.rotationQuaternion.z, childMesh.rotationQuaternion.w);
                    this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion);
                    returnValue.addChildShape(this._tmpAmmoTransform, shape);
                    childImpostor.dispose();
                    childrenAdded++;
                }
            });
            if (childrenAdded > 0) {
                // Add parents shape as a child if present
                if (impostor.type != PhysicsImpostor.NoImpostor) {
                    const shape = this._createShape(impostor, true);
                    if (shape) {
                        this._tmpAmmoTransform.getOrigin().setValue(0, 0, 0);
                        this._tmpAmmoQuaternion.setValue(0, 0, 0, 1);
                        this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion);
                        returnValue.addChildShape(this._tmpAmmoTransform, shape);
                    }
                }
                return returnValue;
            }
            else {
                // If no children with impostors create the actual shape below instead
                this.bjsAMMO.destroy(returnValue);
                returnValue = null;
            }
        }
        switch (impostor.type) {
            case PhysicsImpostor.SphereImpostor:
                // Is there a better way to compare floats number? With an epsilon or with a Math function
                if ((0,math_scalar_functions.WithinEpsilon)(impostorExtents.x, impostorExtents.y, 0.0001) && (0,math_scalar_functions.WithinEpsilon)(impostorExtents.x, impostorExtents.z, 0.0001)) {
                    returnValue = new this.bjsAMMO.btSphereShape(impostorExtents.x / 2);
                }
                else {
                    // create a btMultiSphereShape because it's not possible to set a local scaling on a btSphereShape
                    this._tmpAmmoVectorA.setValue(0, 0, 0);
                    const positions = [this._tmpAmmoVectorA];
                    const radii = [1];
                    returnValue = new this.bjsAMMO.btMultiSphereShape(positions, radii, 1);
                    this._tmpAmmoVectorA.setValue(impostorExtents.x / 2, impostorExtents.y / 2, impostorExtents.z / 2);
                    returnValue.setLocalScaling(this._tmpAmmoVectorA);
                }
                break;
            case PhysicsImpostor.CapsuleImpostor:
                {
                    // https://pybullet.org/Bullet/BulletFull/classbtCapsuleShape.html#details
                    // Height is just the height between the center of each 'sphere' of the capsule caps
                    const capRadius = impostorExtents.x / 2;
                    returnValue = new this.bjsAMMO.btCapsuleShape(capRadius, impostorExtents.y - capRadius * 2);
                }
                break;
            case PhysicsImpostor.CylinderImpostor:
                this._tmpAmmoVectorA.setValue(impostorExtents.x / 2, impostorExtents.y / 2, impostorExtents.z / 2);
                returnValue = new this.bjsAMMO.btCylinderShape(this._tmpAmmoVectorA);
                break;
            case PhysicsImpostor.PlaneImpostor:
            case PhysicsImpostor.BoxImpostor:
                this._tmpAmmoVectorA.setValue(impostorExtents.x / 2, impostorExtents.y / 2, impostorExtents.z / 2);
                returnValue = new this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);
                break;
            case PhysicsImpostor.MeshImpostor: {
                if (impostor.getParam("mass") == 0) {
                    // Only create btBvhTriangleMeshShape if the impostor is static
                    // See https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=7283
                    if (this.onCreateCustomMeshImpostor) {
                        returnValue = this.onCreateCustomMeshImpostor(impostor);
                    }
                    else {
                        const triMesh = new this.bjsAMMO.btTriangleMesh();
                        impostor._pluginData.toDispose.push(triMesh);
                        const triangleCount = this._addMeshVerts(triMesh, object, object);
                        if (triangleCount == 0) {
                            returnValue = new this.bjsAMMO.btCompoundShape();
                        }
                        else {
                            returnValue = new this.bjsAMMO.btBvhTriangleMeshShape(triMesh);
                        }
                    }
                    break;
                }
            }
            // Otherwise create convexHullImpostor
            // eslint-disable-next-line no-fallthrough
            case PhysicsImpostor.ConvexHullImpostor: {
                if (this.onCreateCustomConvexHullImpostor) {
                    returnValue = this.onCreateCustomConvexHullImpostor(impostor);
                }
                else {
                    const convexHull = new this.bjsAMMO.btConvexHullShape();
                    const triangleCount = this._addHullVerts(convexHull, object, object);
                    if (triangleCount == 0) {
                        // Cleanup Unused Convex Hull Shape
                        impostor._pluginData.toDispose.push(convexHull);
                        returnValue = new this.bjsAMMO.btCompoundShape();
                    }
                    else {
                        returnValue = convexHull;
                    }
                }
                break;
            }
            case PhysicsImpostor.NoImpostor:
                // Fill with sphere but collision is disabled on the rigid body in generatePhysicsBody, using an empty shape caused unexpected movement with joints
                returnValue = new this.bjsAMMO.btSphereShape(impostorExtents.x / 2);
                break;
            case PhysicsImpostor.CustomImpostor:
                // Only usable when the plugin's onCreateCustomShape is set
                returnValue = this._createCustom(impostor);
                break;
            case PhysicsImpostor.SoftbodyImpostor:
                // Only usable with a mesh that has sufficient and shared vertices
                returnValue = this._createSoftbody(impostor);
                break;
            case PhysicsImpostor.ClothImpostor:
                // Only usable with a ground mesh that has sufficient and shared vertices
                returnValue = this._createCloth(impostor);
                break;
            case PhysicsImpostor.RopeImpostor:
                // Only usable with a line mesh or an extruded mesh that is updatable
                returnValue = this._createRope(impostor);
                break;
            default:
                logger/* Logger */.V.Warn("The impostor type is not currently supported by the ammo plugin.");
                break;
        }
        return returnValue;
    }
    /**
     * Sets the mesh body position/rotation from the babylon impostor
     * @param impostor imposter containing the physics body and babylon object
     */
    setTransformationFromPhysicsBody(impostor) {
        impostor.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform);
        impostor.object.position.set(this._tmpAmmoTransform.getOrigin().x(), this._tmpAmmoTransform.getOrigin().y(), this._tmpAmmoTransform.getOrigin().z());
        if (!impostor.object.rotationQuaternion) {
            if (impostor.object.rotation) {
                this._tmpQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w());
                this._tmpQuaternion.toEulerAnglesToRef(impostor.object.rotation);
            }
        }
        else {
            impostor.object.rotationQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w());
        }
    }
    /**
     * Sets the babylon object's position/rotation from the physics body's position/rotation
     * @param impostor imposter containing the physics body and babylon object
     * @param newPosition new position
     * @param newRotation new rotation
     */
    setPhysicsBodyTransformation(impostor, newPosition, newRotation) {
        const trans = impostor.physicsBody.getWorldTransform();
        // If rotation/position has changed update and activate rigged body
        if (Math.abs(trans.getOrigin().x() - newPosition.x) > math_constants/* Epsilon */.bH ||
            Math.abs(trans.getOrigin().y() - newPosition.y) > math_constants/* Epsilon */.bH ||
            Math.abs(trans.getOrigin().z() - newPosition.z) > math_constants/* Epsilon */.bH ||
            Math.abs(trans.getRotation().x() - newRotation.x) > math_constants/* Epsilon */.bH ||
            Math.abs(trans.getRotation().y() - newRotation.y) > math_constants/* Epsilon */.bH ||
            Math.abs(trans.getRotation().z() - newRotation.z) > math_constants/* Epsilon */.bH ||
            Math.abs(trans.getRotation().w() - newRotation.w) > math_constants/* Epsilon */.bH) {
            this._tmpAmmoVectorA.setValue(newPosition.x, newPosition.y, newPosition.z);
            trans.setOrigin(this._tmpAmmoVectorA);
            this._tmpAmmoQuaternion.setValue(newRotation.x, newRotation.y, newRotation.z, newRotation.w);
            trans.setRotation(this._tmpAmmoQuaternion);
            impostor.physicsBody.setWorldTransform(trans);
            if (impostor.mass == 0) {
                // Kinematic objects must be updated using motion state
                const motionState = impostor.physicsBody.getMotionState();
                if (motionState) {
                    motionState.setWorldTransform(trans);
                }
            }
            else {
                impostor.physicsBody.activate();
            }
        }
    }
    /**
     * If this plugin is supported
     * @returns true if its supported
     */
    isSupported() {
        return this.bjsAMMO !== undefined;
    }
    /**
     * Sets the linear velocity of the physics body
     * @param impostor imposter to set the velocity on
     * @param velocity velocity to set
     */
    setLinearVelocity(impostor, velocity) {
        this._tmpAmmoVectorA.setValue(velocity.x, velocity.y, velocity.z);
        if (impostor.soft) {
            impostor.physicsBody.linearVelocity(this._tmpAmmoVectorA);
        }
        else {
            impostor.physicsBody.setLinearVelocity(this._tmpAmmoVectorA);
        }
    }
    /**
     * Sets the angular velocity of the physics body
     * @param impostor imposter to set the velocity on
     * @param velocity velocity to set
     */
    setAngularVelocity(impostor, velocity) {
        this._tmpAmmoVectorA.setValue(velocity.x, velocity.y, velocity.z);
        if (impostor.soft) {
            impostor.physicsBody.angularVelocity(this._tmpAmmoVectorA);
        }
        else {
            impostor.physicsBody.setAngularVelocity(this._tmpAmmoVectorA);
        }
    }
    /**
     * gets the linear velocity
     * @param impostor imposter to get linear velocity from
     * @returns linear velocity
     */
    getLinearVelocity(impostor) {
        let v;
        if (impostor.soft) {
            v = impostor.physicsBody.linearVelocity();
        }
        else {
            v = impostor.physicsBody.getLinearVelocity();
        }
        if (!v) {
            return null;
        }
        const result = new math_vector/* Vector3 */.Pq(v.x(), v.y(), v.z());
        this.bjsAMMO.destroy(v);
        return result;
    }
    /**
     * gets the angular velocity
     * @param impostor imposter to get angular velocity from
     * @returns angular velocity
     */
    getAngularVelocity(impostor) {
        let v;
        if (impostor.soft) {
            v = impostor.physicsBody.angularVelocity();
        }
        else {
            v = impostor.physicsBody.getAngularVelocity();
        }
        if (!v) {
            return null;
        }
        const result = new math_vector/* Vector3 */.Pq(v.x(), v.y(), v.z());
        this.bjsAMMO.destroy(v);
        return result;
    }
    /**
     * Sets the mass of physics body
     * @param impostor imposter to set the mass on
     * @param mass mass to set
     */
    setBodyMass(impostor, mass) {
        if (impostor.soft) {
            impostor.physicsBody.setTotalMass(mass, false);
        }
        else {
            impostor.physicsBody.setMassProps(mass);
        }
        impostor._pluginData.mass = mass;
    }
    /**
     * Gets the mass of the physics body
     * @param impostor imposter to get the mass from
     * @returns mass
     */
    getBodyMass(impostor) {
        return impostor._pluginData.mass || 0;
    }
    /**
     * Gets friction of the impostor
     * @param impostor impostor to get friction from
     * @returns friction value
     */
    getBodyFriction(impostor) {
        return impostor._pluginData.friction || 0;
    }
    /**
     * Sets friction of the impostor
     * @param impostor impostor to set friction on
     * @param friction friction value
     */
    setBodyFriction(impostor, friction) {
        if (impostor.soft) {
            impostor.physicsBody.get_m_cfg().set_kDF(friction);
        }
        else {
            impostor.physicsBody.setFriction(friction);
        }
        impostor._pluginData.friction = friction;
    }
    /**
     * Gets restitution of the impostor
     * @param impostor impostor to get restitution from
     * @returns restitution value
     */
    getBodyRestitution(impostor) {
        return impostor._pluginData.restitution || 0;
    }
    /**
     * Sets restitution of the impostor
     * @param impostor impostor to set resitution on
     * @param restitution resitution value
     */
    setBodyRestitution(impostor, restitution) {
        impostor.physicsBody.setRestitution(restitution);
        impostor._pluginData.restitution = restitution;
    }
    /**
     * Gets pressure inside the impostor
     * @param impostor impostor to get pressure from
     * @returns pressure value
     */
    getBodyPressure(impostor) {
        if (!impostor.soft) {
            logger/* Logger */.V.Warn("Pressure is not a property of a rigid body");
            return 0;
        }
        return impostor._pluginData.pressure || 0;
    }
    /**
     * Sets pressure inside a soft body impostor
     * Cloth and rope must remain 0 pressure
     * @param impostor impostor to set pressure on
     * @param pressure pressure value
     */
    setBodyPressure(impostor, pressure) {
        if (impostor.soft) {
            if (impostor.type === PhysicsImpostor.SoftbodyImpostor) {
                impostor.physicsBody.get_m_cfg().set_kPR(pressure);
                impostor._pluginData.pressure = pressure;
            }
            else {
                impostor.physicsBody.get_m_cfg().set_kPR(0);
                impostor._pluginData.pressure = 0;
            }
        }
        else {
            logger/* Logger */.V.Warn("Pressure can only be applied to a softbody");
        }
    }
    /**
     * Gets stiffness of the impostor
     * @param impostor impostor to get stiffness from
     * @returns pressure value
     */
    getBodyStiffness(impostor) {
        if (!impostor.soft) {
            logger/* Logger */.V.Warn("Stiffness is not a property of a rigid body");
            return 0;
        }
        return impostor._pluginData.stiffness || 0;
    }
    /**
     * Sets stiffness of the impostor
     * @param impostor impostor to set stiffness on
     * @param stiffness stiffness value from 0 to 1
     */
    setBodyStiffness(impostor, stiffness) {
        if (impostor.soft) {
            stiffness = stiffness < 0 ? 0 : stiffness;
            stiffness = stiffness > 1 ? 1 : stiffness;
            impostor.physicsBody.get_m_materials().at(0).set_m_kLST(stiffness);
            impostor._pluginData.stiffness = stiffness;
        }
        else {
            logger/* Logger */.V.Warn("Stiffness cannot be applied to a rigid body");
        }
    }
    /**
     * Gets velocityIterations of the impostor
     * @param impostor impostor to get velocity iterations from
     * @returns velocityIterations value
     */
    getBodyVelocityIterations(impostor) {
        if (!impostor.soft) {
            logger/* Logger */.V.Warn("Velocity iterations is not a property of a rigid body");
            return 0;
        }
        return impostor._pluginData.velocityIterations || 0;
    }
    /**
     * Sets velocityIterations of the impostor
     * @param impostor impostor to set velocity iterations on
     * @param velocityIterations velocityIterations value
     */
    setBodyVelocityIterations(impostor, velocityIterations) {
        if (impostor.soft) {
            velocityIterations = velocityIterations < 0 ? 0 : velocityIterations;
            impostor.physicsBody.get_m_cfg().set_viterations(velocityIterations);
            impostor._pluginData.velocityIterations = velocityIterations;
        }
        else {
            logger/* Logger */.V.Warn("Velocity iterations cannot be applied to a rigid body");
        }
    }
    /**
     * Gets positionIterations of the impostor
     * @param impostor impostor to get position iterations from
     * @returns positionIterations value
     */
    getBodyPositionIterations(impostor) {
        if (!impostor.soft) {
            logger/* Logger */.V.Warn("Position iterations is not a property of a rigid body");
            return 0;
        }
        return impostor._pluginData.positionIterations || 0;
    }
    /**
     * Sets positionIterations of the impostor
     * @param impostor impostor to set position on
     * @param positionIterations positionIterations value
     */
    setBodyPositionIterations(impostor, positionIterations) {
        if (impostor.soft) {
            positionIterations = positionIterations < 0 ? 0 : positionIterations;
            impostor.physicsBody.get_m_cfg().set_piterations(positionIterations);
            impostor._pluginData.positionIterations = positionIterations;
        }
        else {
            logger/* Logger */.V.Warn("Position iterations cannot be applied to a rigid body");
        }
    }
    /**
     * Append an anchor to a cloth object
     * @param impostor is the cloth impostor to add anchor to
     * @param otherImpostor is the rigid impostor to anchor to
     * @param width ratio across width from 0 to 1
     * @param height ratio up height from 0 to 1
     * @param influence the elasticity between cloth impostor and anchor from 0, very stretchy to 1, little stretch
     * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
     */
    appendAnchor(impostor, otherImpostor, width, height, influence = 1, noCollisionBetweenLinkedBodies = false) {
        const segs = impostor.segments;
        const nbAcross = Math.round((segs - 1) * width);
        const nbUp = Math.round((segs - 1) * height);
        const nbDown = segs - 1 - nbUp;
        const node = nbAcross + segs * nbDown;
        impostor.physicsBody.appendAnchor(node, otherImpostor.physicsBody, noCollisionBetweenLinkedBodies, influence);
    }
    /**
     * Append an hook to a rope object
     * @param impostor is the rope impostor to add hook to
     * @param otherImpostor is the rigid impostor to hook to
     * @param length ratio along the rope from 0 to 1
     * @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, little stretch
     * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
     */
    appendHook(impostor, otherImpostor, length, influence = 1, noCollisionBetweenLinkedBodies = false) {
        const node = Math.round(impostor.segments * length);
        impostor.physicsBody.appendAnchor(node, otherImpostor.physicsBody, noCollisionBetweenLinkedBodies, influence);
    }
    /**
     * Sleeps the physics body and stops it from being active
     * @param impostor impostor to sleep
     */
    sleepBody(impostor) {
        impostor.physicsBody.forceActivationState(0);
    }
    /**
     * Activates the physics body
     * @param impostor impostor to activate
     */
    wakeUpBody(impostor) {
        impostor.physicsBody.activate();
    }
    /**
     * Updates the distance parameters of the joint
     */
    updateDistanceJoint() {
        logger/* Logger */.V.Warn("updateDistanceJoint is not currently supported by the Ammo physics plugin");
    }
    /**
     * Sets a motor on the joint
     * @param joint joint to set motor on
     * @param speed speed of the motor
     * @param maxForce maximum force of the motor
     */
    setMotor(joint, speed, maxForce) {
        joint.physicsJoint.enableAngularMotor(true, speed, maxForce);
    }
    /**
     * Sets the motors limit
     */
    setLimit() {
        logger/* Logger */.V.Warn("setLimit is not currently supported by the Ammo physics plugin");
    }
    /**
     * Syncs the position and rotation of a mesh with the impostor
     * @param mesh mesh to sync
     * @param impostor impostor to update the mesh with
     */
    syncMeshWithImpostor(mesh, impostor) {
        const body = impostor.physicsBody;
        body.getMotionState().getWorldTransform(this._tmpAmmoTransform);
        mesh.position.x = this._tmpAmmoTransform.getOrigin().x();
        mesh.position.y = this._tmpAmmoTransform.getOrigin().y();
        mesh.position.z = this._tmpAmmoTransform.getOrigin().z();
        if (mesh.rotationQuaternion) {
            mesh.rotationQuaternion.x = this._tmpAmmoTransform.getRotation().x();
            mesh.rotationQuaternion.y = this._tmpAmmoTransform.getRotation().y();
            mesh.rotationQuaternion.z = this._tmpAmmoTransform.getRotation().z();
            mesh.rotationQuaternion.w = this._tmpAmmoTransform.getRotation().w();
        }
    }
    /**
     * Gets the radius of the impostor
     * @param impostor impostor to get radius from
     * @returns the radius
     */
    getRadius(impostor) {
        const extents = impostor.getObjectExtents();
        return extents.x / 2;
    }
    /**
     * Gets the box size of the impostor
     * @param impostor impostor to get box size from
     * @param result the resulting box size
     */
    getBoxSizeToRef(impostor, result) {
        const extents = impostor.getObjectExtents();
        result.x = extents.x;
        result.y = extents.y;
        result.z = extents.z;
    }
    /**
     * Disposes of the impostor
     */
    dispose() {
        // Dispose of world
        this.bjsAMMO.destroy(this.world);
        this.bjsAMMO.destroy(this._softBodySolver);
        this.bjsAMMO.destroy(this._solver);
        this.bjsAMMO.destroy(this._overlappingPairCache);
        this.bjsAMMO.destroy(this._dispatcher);
        this.bjsAMMO.destroy(this._collisionConfiguration);
        // Dispose of temp variables
        this.bjsAMMO.destroy(this._tmpAmmoVectorA);
        this.bjsAMMO.destroy(this._tmpAmmoVectorB);
        this.bjsAMMO.destroy(this._tmpAmmoVectorC);
        this.bjsAMMO.destroy(this._tmpAmmoVectorD);
        this.bjsAMMO.destroy(this._tmpAmmoTransform);
        this.bjsAMMO.destroy(this._tmpAmmoQuaternion);
        this.bjsAMMO.destroy(this._tmpAmmoConcreteContactResultCallback);
        this.world = null;
    }
    /**
     * Does a raycast in the physics world
     * @param from where should the ray start?
     * @param to where should the ray end?
     * @returns PhysicsRaycastResult
     */
    raycast(from, to) {
        this.raycastToRef(from, to, this._raycastResult);
        return this._raycastResult;
    }
    /**
     * Does a raycast in the physics world
     * @param from when should the ray start?
     * @param to when should the ray end?
     * @param result resulting PhysicsRaycastResult
     */
    raycastToRef(from, to, result) {
        this._tmpAmmoVectorRCA = new this.bjsAMMO.btVector3(from.x, from.y, from.z);
        this._tmpAmmoVectorRCB = new this.bjsAMMO.btVector3(to.x, to.y, to.z);
        const rayCallback = new this.bjsAMMO.ClosestRayResultCallback(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB);
        this.world.rayTest(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB, rayCallback);
        result.reset(from, to);
        if (rayCallback.hasHit()) {
            // TODO: do we want/need the body? If so, set all the data
            /*
            var rigidBody = this.bjsAMMO.btRigidBody.prototype.upcast(
                rayCallback.get_m_collisionObject()
            );
            var body = {};
            */
            result.setHitData({
                x: rayCallback.get_m_hitNormalWorld().x(),
                y: rayCallback.get_m_hitNormalWorld().y(),
                z: rayCallback.get_m_hitNormalWorld().z(),
            }, {
                x: rayCallback.get_m_hitPointWorld().x(),
                y: rayCallback.get_m_hitPointWorld().y(),
                z: rayCallback.get_m_hitPointWorld().z(),
            });
            result.calculateHitDistance();
        }
        this.bjsAMMO.destroy(rayCallback);
        this.bjsAMMO.destroy(this._tmpAmmoVectorRCA);
        this.bjsAMMO.destroy(this._tmpAmmoVectorRCB);
    }
}
AmmoJSPlugin._DISABLE_COLLISION_FLAG = 4;
AmmoJSPlugin._KINEMATIC_FLAG = 2;
AmmoJSPlugin._DISABLE_DEACTIVATION_FLAG = 4;
//# sourceMappingURL=ammoJSPlugin.js.map
;// ./node_modules/@babylonjs/core/Probes/reflectionProbe.js







core_scene/* Scene */.Z.prototype.removeReflectionProbe = function (toRemove) {
    if (!this.reflectionProbes) {
        return -1;
    }
    const index = this.reflectionProbes.indexOf(toRemove);
    if (index !== -1) {
        this.reflectionProbes.splice(index, 1);
    }
    return index;
};
core_scene/* Scene */.Z.prototype.addReflectionProbe = function (newReflectionProbe) {
    if (!this.reflectionProbes) {
        this.reflectionProbes = [];
    }
    this.reflectionProbes.push(newReflectionProbe);
};
/**
 * Class used to generate realtime reflection / refraction cube textures
 * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/reflectionProbes
 */
class ReflectionProbe {
    /**
     * Creates a new reflection probe
     * @param name defines the name of the probe
     * @param size defines the texture resolution (for each face)
     * @param scene defines the hosting scene
     * @param generateMipMaps defines if mip maps should be generated automatically (true by default)
     * @param useFloat defines if HDR data (float data) should be used to store colors (false by default)
     * @param linearSpace defines if the probe should be generated in linear space or not (false by default)
     */
    constructor(
    /** defines the name of the probe */
    name, size, scene, generateMipMaps = true, useFloat = false, linearSpace = false) {
        this.name = name;
        this._viewMatrix = math_vector/* Matrix */.uq.Identity();
        this._target = math_vector/* Vector3 */.Pq.Zero();
        this._add = math_vector/* Vector3 */.Pq.Zero();
        this._invertYAxis = false;
        /** Gets or sets probe position (center of the cube map) */
        this.position = math_vector/* Vector3 */.Pq.Zero();
        /**
         * Gets or sets an object used to store user defined information for the reflection probe.
         */
        this.metadata = null;
        /** @internal */
        this._parentContainer = null;
        this._scene = scene;
        if (scene.getEngine().supportsUniformBuffers) {
            this._sceneUBOs = [];
            for (let i = 0; i < 6; ++i) {
                this._sceneUBOs.push(scene.createSceneUniformBuffer(`Scene for Reflection Probe (name "${name}") face #${i}`));
            }
        }
        // Create the scene field if not exist.
        if (!this._scene.reflectionProbes) {
            this._scene.reflectionProbes = [];
        }
        this._scene.reflectionProbes.push(this);
        let textureType = 0;
        if (useFloat) {
            const caps = this._scene.getEngine().getCaps();
            if (caps.textureHalfFloatRender) {
                textureType = 2;
            }
            else if (caps.textureFloatRender) {
                textureType = 1;
            }
        }
        this._renderTargetTexture = new Textures_renderTargetTexture/* RenderTargetTexture */.$(name, size, scene, generateMipMaps, true, textureType, true);
        this._renderTargetTexture.gammaSpace = !linearSpace;
        this._renderTargetTexture.invertZ = scene.useRightHandedSystem;
        const useReverseDepthBuffer = scene.getEngine().useReverseDepthBuffer;
        this._renderTargetTexture.onBeforeRenderObservable.add((faceIndex) => {
            if (this._sceneUBOs) {
                scene.setSceneUniformBuffer(this._sceneUBOs[faceIndex]);
                scene.getSceneUniformBuffer().unbindEffect();
            }
            switch (faceIndex) {
                case 0:
                    this._add.copyFromFloats(1, 0, 0);
                    break;
                case 1:
                    this._add.copyFromFloats(-1, 0, 0);
                    break;
                case 2:
                    this._add.copyFromFloats(0, this._invertYAxis ? 1 : -1, 0);
                    break;
                case 3:
                    this._add.copyFromFloats(0, this._invertYAxis ? -1 : 1, 0);
                    break;
                case 4:
                    this._add.copyFromFloats(0, 0, scene.useRightHandedSystem ? -1 : 1);
                    break;
                case 5:
                    this._add.copyFromFloats(0, 0, scene.useRightHandedSystem ? 1 : -1);
                    break;
            }
            if (this._attachedMesh) {
                this.position.copyFrom(this._attachedMesh.getAbsolutePosition());
            }
            this.position.addToRef(this._add, this._target);
            const lookAtFunction = scene.useRightHandedSystem ? math_vector/* Matrix */.uq.LookAtRHToRef : math_vector/* Matrix */.uq.LookAtLHToRef;
            const perspectiveFunction = scene.useRightHandedSystem ? math_vector/* Matrix */.uq.PerspectiveFovRH : math_vector/* Matrix */.uq.PerspectiveFovLH;
            lookAtFunction(this.position, this._target, math_vector/* Vector3 */.Pq.Up(), this._viewMatrix);
            if (scene.activeCamera) {
                this._projectionMatrix = perspectiveFunction(Math.PI / 2, 1, useReverseDepthBuffer ? scene.activeCamera.maxZ : scene.activeCamera.minZ, useReverseDepthBuffer ? scene.activeCamera.minZ : scene.activeCamera.maxZ, this._scene.getEngine().isNDCHalfZRange);
                scene.setTransformMatrix(this._viewMatrix, this._projectionMatrix);
                if (scene.activeCamera.isRigCamera && !this._renderTargetTexture.activeCamera) {
                    this._renderTargetTexture.activeCamera = scene.activeCamera.rigParent || null;
                }
            }
            scene._forcedViewPosition = this.position;
        });
        let currentApplyByPostProcess;
        this._renderTargetTexture.onBeforeBindObservable.add(() => {
            this._currentSceneUBO = scene.getSceneUniformBuffer();
            scene.getEngine()._debugPushGroup?.(`reflection probe generation for ${name}`, 1);
            currentApplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess;
            if (linearSpace) {
                scene.imageProcessingConfiguration.applyByPostProcess = true;
            }
        });
        this._renderTargetTexture.onAfterUnbindObservable.add(() => {
            scene.imageProcessingConfiguration.applyByPostProcess = currentApplyByPostProcess;
            scene._forcedViewPosition = null;
            if (this._sceneUBOs) {
                scene.setSceneUniformBuffer(this._currentSceneUBO);
            }
            scene.updateTransformMatrix(true);
            scene.getEngine()._debugPopGroup?.(1);
        });
    }
    /** Gets or sets the number of samples to use for multi-sampling (0 by default). Required WebGL2 */
    get samples() {
        return this._renderTargetTexture.samples;
    }
    set samples(value) {
        this._renderTargetTexture.samples = value;
    }
    /** Gets or sets the refresh rate to use (on every frame by default) */
    get refreshRate() {
        return this._renderTargetTexture.refreshRate;
    }
    set refreshRate(value) {
        this._renderTargetTexture.refreshRate = value;
    }
    /**
     * Gets the hosting scene
     * @returns a Scene
     */
    getScene() {
        return this._scene;
    }
    /** Gets the internal CubeTexture used to render to */
    get cubeTexture() {
        return this._renderTargetTexture;
    }
    /** Gets or sets the list of meshes to render */
    get renderList() {
        return this._renderTargetTexture.renderList;
    }
    set renderList(value) {
        this._renderTargetTexture.renderList = value;
    }
    /**
     * Attach the probe to a specific mesh (Rendering will be done from attached mesh's position)
     * @param mesh defines the mesh to attach to
     */
    attachToMesh(mesh) {
        this._attachedMesh = mesh;
    }
    /**
     * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups
     * @param renderingGroupId The rendering group id corresponding to its index
     * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
     */
    setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil) {
        this._renderTargetTexture.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil);
    }
    /**
     * Clean all associated resources
     */
    dispose() {
        const index = this._scene.reflectionProbes.indexOf(this);
        if (index !== -1) {
            // Remove from the scene if found
            this._scene.reflectionProbes.splice(index, 1);
        }
        if (this._parentContainer) {
            const index = this._parentContainer.reflectionProbes.indexOf(this);
            if (index > -1) {
                this._parentContainer.reflectionProbes.splice(index, 1);
            }
            this._parentContainer = null;
        }
        if (this._renderTargetTexture) {
            this._renderTargetTexture.dispose();
            this._renderTargetTexture = null;
        }
        if (this._sceneUBOs) {
            for (const ubo of this._sceneUBOs) {
                ubo.dispose();
            }
            this._sceneUBOs = [];
        }
    }
    /**
     * Converts the reflection probe information to a readable string for debug purpose.
     * @param fullDetails Supports for multiple levels of logging within scene loading
     * @returns the human readable reflection probe info
     */
    toString(fullDetails) {
        let ret = "Name: " + this.name;
        if (fullDetails) {
            ret += ", position: " + this.position.toString();
            if (this._attachedMesh) {
                ret += ", attached mesh: " + this._attachedMesh.name;
            }
        }
        return ret;
    }
    /**
     * Get the class name of the refection probe.
     * @returns "ReflectionProbe"
     */
    getClassName() {
        return "ReflectionProbe";
    }
    /**
     * Serialize the reflection probe to a JSON representation we can easily use in the respective Parse function.
     * @returns The JSON representation of the texture
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this, this._renderTargetTexture.serialize());
        serializationObject.isReflectionProbe = true;
        serializationObject.metadata = this.metadata;
        return serializationObject;
    }
    /**
     * Parse the JSON representation of a reflection probe in order to recreate the reflection probe in the given scene.
     * @param parsedReflectionProbe Define the JSON representation of the reflection probe
     * @param scene Define the scene the parsed reflection probe should be instantiated in
     * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies
     * @returns The parsed reflection probe if successful
     */
    static Parse(parsedReflectionProbe, scene, rootUrl) {
        let reflectionProbe = null;
        if (scene.reflectionProbes) {
            for (let index = 0; index < scene.reflectionProbes.length; index++) {
                const rp = scene.reflectionProbes[index];
                if (rp.name === parsedReflectionProbe.name) {
                    reflectionProbe = rp;
                    break;
                }
            }
        }
        reflectionProbe = decorators_serialization/* SerializationHelper */.p.Parse(() => reflectionProbe || new ReflectionProbe(parsedReflectionProbe.name, parsedReflectionProbe.renderTargetSize, scene, parsedReflectionProbe._generateMipMaps), parsedReflectionProbe, scene, rootUrl);
        reflectionProbe.cubeTexture._waitingRenderList = parsedReflectionProbe.renderList;
        if (parsedReflectionProbe._attachedMesh) {
            reflectionProbe.attachToMesh(scene.getMeshById(parsedReflectionProbe._attachedMesh));
        }
        if (parsedReflectionProbe.metadata) {
            reflectionProbe.metadata = parsedReflectionProbe.metadata;
        }
        return reflectionProbe;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsMeshReference */.xG)()
], ReflectionProbe.prototype, "_attachedMesh", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsVector3 */.P_)()
], ReflectionProbe.prototype, "position", void 0);
//# sourceMappingURL=reflectionProbe.js.map
;// ./node_modules/@babylonjs/core/Sprites/thinSprite.js
/**
 * ThinSprite Class used to represent a thin sprite
 * This is the base class for sprites but can also directly be used with ThinEngine
 * @see https://doc.babylonjs.com/features/featuresDeepDive/sprites
 */
class ThinSprite {
    /**
     * Returns a boolean indicating if the animation is started
     */
    get animationStarted() {
        return this._animationStarted;
    }
    /** Gets the initial key for the animation (setting it will restart the animation)  */
    get fromIndex() {
        return this._fromIndex;
    }
    /** Gets or sets the end key for the animation (setting it will restart the animation)  */
    get toIndex() {
        return this._toIndex;
    }
    /** Gets or sets a boolean indicating if the animation is looping (setting it will restart the animation)  */
    get loopAnimation() {
        return this._loopAnimation;
    }
    /** Gets or sets the delay between cell changes (setting it will restart the animation)  */
    get delay() {
        return Math.max(this._delay, 1);
    }
    /**
     * Creates a new Thin Sprite
     */
    constructor() {
        /** Gets or sets the width */
        this.width = 1.0;
        /** Gets or sets the height */
        this.height = 1.0;
        /** Gets or sets rotation angle */
        this.angle = 0;
        /** Gets or sets a boolean indicating if UV coordinates should be inverted in U axis */
        this.invertU = false;
        /** Gets or sets a boolean indicating if UV coordinates should be inverted in B axis */
        this.invertV = false;
        /** Gets or sets a boolean indicating if the sprite is visible (renderable). Default is true */
        this.isVisible = true;
        this._animationStarted = false;
        this._loopAnimation = false;
        this._fromIndex = 0;
        this._toIndex = 0;
        this._delay = 0;
        this._direction = 1;
        this._time = 0;
        this._onBaseAnimationEnd = null;
        this.position = { x: 1.0, y: 1.0, z: 1.0 };
        this.color = { r: 1.0, g: 1.0, b: 1.0, a: 1.0 };
    }
    /**
     * Starts an animation
     * @param from defines the initial key
     * @param to defines the end key
     * @param loop defines if the animation must loop
     * @param delay defines the start delay (in ms)
     * @param onAnimationEnd defines a callback for when the animation ends
     */
    playAnimation(from, to, loop, delay, onAnimationEnd) {
        this._fromIndex = from;
        this._toIndex = to;
        this._loopAnimation = loop;
        this._delay = delay || 1;
        this._animationStarted = true;
        this._onBaseAnimationEnd = onAnimationEnd;
        if (from < to) {
            this._direction = 1;
        }
        else {
            this._direction = -1;
            this._toIndex = from;
            this._fromIndex = to;
        }
        this.cellIndex = from;
        this._time = 0;
    }
    /** Stops current animation (if any) */
    stopAnimation() {
        this._animationStarted = false;
    }
    /**
     * @internal
     */
    _animate(deltaTime) {
        if (!this._animationStarted) {
            return;
        }
        this._time += deltaTime;
        if (this._time > this._delay) {
            this._time = this._time % this._delay;
            this.cellIndex += this._direction;
            if ((this._direction > 0 && this.cellIndex > this._toIndex) || (this._direction < 0 && this.cellIndex < this._fromIndex)) {
                if (this._loopAnimation) {
                    this.cellIndex = this._direction > 0 ? this._fromIndex : this._toIndex;
                }
                else {
                    this.cellIndex = this._toIndex;
                    this._animationStarted = false;
                    if (this._onBaseAnimationEnd) {
                        this._onBaseAnimationEnd();
                    }
                }
            }
        }
    }
}
//# sourceMappingURL=thinSprite.js.map
;// ./node_modules/@babylonjs/core/Sprites/sprite.js




/**
 * Class used to represent a sprite
 * @see https://doc.babylonjs.com/features/featuresDeepDive/sprites
 */
class Sprite extends ThinSprite {
    /**
     * Gets or sets the sprite size
     */
    get size() {
        return this.width;
    }
    set size(value) {
        this.width = value;
        this.height = value;
    }
    /**
     * Gets the manager of this sprite
     */
    get manager() {
        return this._manager;
    }
    /**
     * Creates a new Sprite
     * @param name defines the name
     * @param manager defines the manager
     */
    constructor(
    /** defines the name */
    name, manager) {
        super();
        this.name = name;
        /** Gets the list of attached animations */
        this.animations = new Array();
        /** Gets or sets a boolean indicating if the sprite can be picked */
        this.isPickable = false;
        /** Gets or sets a boolean indicating that sprite texture alpha will be used for precise picking (false by default) */
        this.useAlphaForPicking = false;
        /**
         * An event triggered when the control has been disposed
         */
        this.onDisposeObservable = new Misc_observable/* Observable */.cP();
        this._onAnimationEnd = null;
        this._endAnimation = () => {
            if (this._onAnimationEnd) {
                this._onAnimationEnd();
            }
            if (this.disposeWhenFinishedAnimating) {
                this.dispose();
            }
        };
        this.color = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        this.position = math_vector/* Vector3 */.Pq.Zero();
        this._manager = manager;
        this._manager.sprites.push(this);
        this.uniqueId = this._manager.scene.getUniqueId();
    }
    /**
     * Returns the string "Sprite"
     * @returns "Sprite"
     */
    getClassName() {
        return "Sprite";
    }
    /** Gets or sets the initial key for the animation (setting it will restart the animation)  */
    get fromIndex() {
        return this._fromIndex;
    }
    set fromIndex(value) {
        this.playAnimation(value, this._toIndex, this._loopAnimation, this._delay, this._onAnimationEnd);
    }
    /** Gets or sets the end key for the animation (setting it will restart the animation)  */
    get toIndex() {
        return this._toIndex;
    }
    set toIndex(value) {
        this.playAnimation(this._fromIndex, value, this._loopAnimation, this._delay, this._onAnimationEnd);
    }
    /** Gets or sets a boolean indicating if the animation is looping (setting it will restart the animation)  */
    get loopAnimation() {
        return this._loopAnimation;
    }
    set loopAnimation(value) {
        this.playAnimation(this._fromIndex, this._toIndex, value, this._delay, this._onAnimationEnd);
    }
    /** Gets or sets the delay between cell changes (setting it will restart the animation)  */
    get delay() {
        return Math.max(this._delay, 1);
    }
    set delay(value) {
        this.playAnimation(this._fromIndex, this._toIndex, this._loopAnimation, value, this._onAnimationEnd);
    }
    /**
     * Starts an animation
     * @param from defines the initial key
     * @param to defines the end key
     * @param loop defines if the animation must loop
     * @param delay defines the start delay (in ms)
     * @param onAnimationEnd defines a callback to call when animation ends
     */
    playAnimation(from, to, loop, delay, onAnimationEnd = null) {
        this._onAnimationEnd = onAnimationEnd;
        super.playAnimation(from, to, loop, delay, this._endAnimation);
    }
    /** Release associated resources */
    dispose() {
        for (let i = 0; i < this._manager.sprites.length; i++) {
            if (this._manager.sprites[i] == this) {
                this._manager.sprites.splice(i, 1);
            }
        }
        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
    }
    /**
     * Serializes the sprite to a JSON object
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.position = this.position.asArray();
        serializationObject.color = this.color.asArray();
        serializationObject.width = this.width;
        serializationObject.height = this.height;
        serializationObject.angle = this.angle;
        serializationObject.cellIndex = this.cellIndex;
        serializationObject.cellRef = this.cellRef;
        serializationObject.invertU = this.invertU;
        serializationObject.invertV = this.invertV;
        serializationObject.disposeWhenFinishedAnimating = this.disposeWhenFinishedAnimating;
        serializationObject.isPickable = this.isPickable;
        serializationObject.isVisible = this.isVisible;
        serializationObject.useAlphaForPicking = this.useAlphaForPicking;
        serializationObject.animationStarted = this.animationStarted;
        serializationObject.fromIndex = this.fromIndex;
        serializationObject.toIndex = this.toIndex;
        serializationObject.loopAnimation = this.loopAnimation;
        serializationObject.delay = this.delay;
        return serializationObject;
    }
    /**
     * Parses a JSON object to create a new sprite
     * @param parsedSprite The JSON object to parse
     * @param manager defines the hosting manager
     * @returns the new sprite
     */
    static Parse(parsedSprite, manager) {
        const sprite = new Sprite(parsedSprite.name, manager);
        sprite.position = math_vector/* Vector3 */.Pq.FromArray(parsedSprite.position);
        sprite.color = math_color/* Color4 */.ov.FromArray(parsedSprite.color);
        sprite.width = parsedSprite.width;
        sprite.height = parsedSprite.height;
        sprite.angle = parsedSprite.angle;
        sprite.cellIndex = parsedSprite.cellIndex;
        sprite.cellRef = parsedSprite.cellRef;
        sprite.invertU = parsedSprite.invertU;
        sprite.invertV = parsedSprite.invertV;
        sprite.disposeWhenFinishedAnimating = parsedSprite.disposeWhenFinishedAnimating;
        sprite.isPickable = parsedSprite.isPickable;
        sprite.isVisible = parsedSprite.isVisible;
        sprite.useAlphaForPicking = parsedSprite.useAlphaForPicking;
        sprite._fromIndex = parsedSprite.fromIndex;
        sprite._toIndex = parsedSprite.toIndex;
        sprite._loopAnimation = parsedSprite.loopAnimation;
        sprite._delay = parsedSprite.delay;
        if (parsedSprite.animationStarted) {
            sprite.playAnimation(sprite.fromIndex, sprite.toIndex, sprite.loopAnimation, sprite.delay);
        }
        return sprite;
    }
}
//# sourceMappingURL=sprite.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Culling/ray.core.js
var ray_core = __webpack_require__(48086);
;// ./node_modules/@babylonjs/core/Sprites/spriteSceneComponent.js







core_scene/* Scene */.Z.prototype._internalPickSprites = function (ray, predicate, fastCheck, camera) {
    if (!Collisions_pickingInfo/* PickingInfo */.G) {
        return null;
    }
    let pickingInfo = null;
    if (!camera) {
        if (!this.activeCamera) {
            return null;
        }
        camera = this.activeCamera;
    }
    if (this.spriteManagers && this.spriteManagers.length > 0) {
        for (let spriteIndex = 0; spriteIndex < this.spriteManagers.length; spriteIndex++) {
            const spriteManager = this.spriteManagers[spriteIndex];
            if (!spriteManager.isPickable) {
                continue;
            }
            const result = spriteManager.intersects(ray, camera, predicate, fastCheck);
            if (!result || !result.hit) {
                continue;
            }
            if (!fastCheck && pickingInfo != null && result.distance >= pickingInfo.distance) {
                continue;
            }
            pickingInfo = result;
            if (fastCheck) {
                break;
            }
        }
    }
    return pickingInfo || new Collisions_pickingInfo/* PickingInfo */.G();
};
core_scene/* Scene */.Z.prototype._internalMultiPickSprites = function (ray, predicate, camera) {
    if (!Collisions_pickingInfo/* PickingInfo */.G) {
        return null;
    }
    let pickingInfos = [];
    if (!camera) {
        if (!this.activeCamera) {
            return null;
        }
        camera = this.activeCamera;
    }
    if (this.spriteManagers && this.spriteManagers.length > 0) {
        for (let spriteIndex = 0; spriteIndex < this.spriteManagers.length; spriteIndex++) {
            const spriteManager = this.spriteManagers[spriteIndex];
            if (!spriteManager.isPickable) {
                continue;
            }
            const results = spriteManager.multiIntersects(ray, camera, predicate);
            if (results !== null) {
                pickingInfos = pickingInfos.concat(results);
            }
        }
    }
    return pickingInfos;
};
core_scene/* Scene */.Z.prototype.pickSprite = function (x, y, predicate, fastCheck, camera) {
    if (!this._tempSpritePickingRay) {
        return null;
    }
    (0,ray_core/* CreatePickingRayInCameraSpaceToRef */.oZ)(this, x, y, this._tempSpritePickingRay, camera);
    const result = this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera);
    if (result) {
        result.ray = (0,ray_core/* CreatePickingRayInCameraSpace */.AU)(this, x, y, camera);
    }
    return result;
};
core_scene/* Scene */.Z.prototype.pickSpriteWithRay = function (ray, predicate, fastCheck, camera) {
    if (!this._tempSpritePickingRay) {
        return null;
    }
    if (!camera) {
        if (!this.activeCamera) {
            return null;
        }
        camera = this.activeCamera;
    }
    ray_core/* Ray */.Rl.TransformToRef(ray, camera.getViewMatrix(), this._tempSpritePickingRay);
    const result = this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera);
    if (result) {
        result.ray = ray;
    }
    return result;
};
core_scene/* Scene */.Z.prototype.multiPickSprite = function (x, y, predicate, camera) {
    (0,ray_core/* CreatePickingRayInCameraSpaceToRef */.oZ)(this, x, y, this._tempSpritePickingRay, camera);
    return this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera);
};
core_scene/* Scene */.Z.prototype.multiPickSpriteWithRay = function (ray, predicate, camera) {
    if (!this._tempSpritePickingRay) {
        return null;
    }
    if (!camera) {
        if (!this.activeCamera) {
            return null;
        }
        camera = this.activeCamera;
    }
    ray_core/* Ray */.Rl.TransformToRef(ray, camera.getViewMatrix(), this._tempSpritePickingRay);
    return this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera);
};
core_scene/* Scene */.Z.prototype.setPointerOverSprite = function (sprite) {
    if (this._pointerOverSprite === sprite) {
        return;
    }
    if (this._pointerOverSprite && this._pointerOverSprite.actionManager) {
        this._pointerOverSprite.actionManager.processTrigger(10, actionEvent/* ActionEvent */.X.CreateNewFromSprite(this._pointerOverSprite, this));
    }
    this._pointerOverSprite = sprite;
    if (this._pointerOverSprite && this._pointerOverSprite.actionManager) {
        this._pointerOverSprite.actionManager.processTrigger(9, actionEvent/* ActionEvent */.X.CreateNewFromSprite(this._pointerOverSprite, this));
    }
};
core_scene/* Scene */.Z.prototype.getPointerOverSprite = function () {
    return this._pointerOverSprite;
};
/**
 * Defines the sprite scene component responsible to manage sprites
 * in a given scene.
 */
class SpriteSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpfull to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_SPRITE;
        this.scene = scene;
        this.scene.spriteManagers = [];
        this.scene._tempSpritePickingRay = ray_core/* Ray */.Rl ? ray_core/* Ray */.Rl.Zero() : null;
        this.scene.onBeforeSpritesRenderingObservable = new Misc_observable/* Observable */.cP();
        this.scene.onAfterSpritesRenderingObservable = new Misc_observable/* Observable */.cP();
        this._spritePredicate = (sprite) => {
            if (!sprite.actionManager) {
                return false;
            }
            return sprite.isPickable && sprite.actionManager.hasPointerTriggers;
        };
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._pointerMoveStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_POINTERMOVE_SPRITE, this, this._pointerMove);
        this.scene._pointerDownStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_POINTERDOWN_SPRITE, this, this._pointerDown);
        this.scene._pointerUpStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_POINTERUP_SPRITE, this, this._pointerUp);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        /** Nothing to do for sprites */
    }
    /**
     * Disposes the component and the associated resources.
     */
    dispose() {
        this.scene.onBeforeSpritesRenderingObservable.clear();
        this.scene.onAfterSpritesRenderingObservable.clear();
        const spriteManagers = this.scene.spriteManagers;
        if (!spriteManagers) {
            return;
        }
        while (spriteManagers.length) {
            spriteManagers[0].dispose();
        }
    }
    _pickSpriteButKeepRay(originalPointerInfo, x, y, fastCheck, camera) {
        const result = this.scene.pickSprite(x, y, this._spritePredicate, fastCheck, camera);
        if (result) {
            result.ray = originalPointerInfo ? originalPointerInfo.ray : null;
        }
        return result;
    }
    _pointerMove(unTranslatedPointerX, unTranslatedPointerY, pickResult, isMeshPicked, element) {
        const scene = this.scene;
        if (isMeshPicked) {
            scene.setPointerOverSprite(null);
        }
        else {
            pickResult = this._pickSpriteButKeepRay(pickResult, unTranslatedPointerX, unTranslatedPointerY, false, scene.cameraToUseForPointers || undefined);
            if (pickResult && pickResult.hit && pickResult.pickedSprite) {
                scene.setPointerOverSprite(pickResult.pickedSprite);
                if (!scene.doNotHandleCursors && element) {
                    if (scene._pointerOverSprite && scene._pointerOverSprite.actionManager && scene._pointerOverSprite.actionManager.hoverCursor) {
                        element.style.cursor = scene._pointerOverSprite.actionManager.hoverCursor;
                    }
                    else {
                        element.style.cursor = scene.hoverCursor;
                    }
                }
            }
            else {
                scene.setPointerOverSprite(null);
            }
        }
        return pickResult;
    }
    _pointerDown(unTranslatedPointerX, unTranslatedPointerY, pickResult, evt) {
        const scene = this.scene;
        scene._pickedDownSprite = null;
        if (scene.spriteManagers && scene.spriteManagers.length > 0) {
            pickResult = scene.pickSprite(unTranslatedPointerX, unTranslatedPointerY, this._spritePredicate, false, scene.cameraToUseForPointers || undefined);
            if (pickResult && pickResult.hit && pickResult.pickedSprite) {
                if (pickResult.pickedSprite.actionManager) {
                    scene._pickedDownSprite = pickResult.pickedSprite;
                    switch (evt.button) {
                        case 0:
                            pickResult.pickedSprite.actionManager.processTrigger(2, actionEvent/* ActionEvent */.X.CreateNewFromSprite(pickResult.pickedSprite, scene, evt));
                            break;
                        case 1:
                            pickResult.pickedSprite.actionManager.processTrigger(4, actionEvent/* ActionEvent */.X.CreateNewFromSprite(pickResult.pickedSprite, scene, evt));
                            break;
                        case 2:
                            pickResult.pickedSprite.actionManager.processTrigger(3, actionEvent/* ActionEvent */.X.CreateNewFromSprite(pickResult.pickedSprite, scene, evt));
                            break;
                    }
                    if (pickResult.pickedSprite.actionManager) {
                        pickResult.pickedSprite.actionManager.processTrigger(5, actionEvent/* ActionEvent */.X.CreateNewFromSprite(pickResult.pickedSprite, scene, evt));
                    }
                }
            }
        }
        return pickResult;
    }
    _pointerUp(unTranslatedPointerX, unTranslatedPointerY, pickResult, evt, doubleClick) {
        const scene = this.scene;
        if (scene.spriteManagers && scene.spriteManagers.length > 0) {
            const spritePickResult = scene.pickSprite(unTranslatedPointerX, unTranslatedPointerY, this._spritePredicate, false, scene.cameraToUseForPointers || undefined);
            if (spritePickResult) {
                if (spritePickResult.hit && spritePickResult.pickedSprite) {
                    if (spritePickResult.pickedSprite.actionManager) {
                        spritePickResult.pickedSprite.actionManager.processTrigger(7, actionEvent/* ActionEvent */.X.CreateNewFromSprite(spritePickResult.pickedSprite, scene, evt));
                        if (spritePickResult.pickedSprite.actionManager) {
                            if (!this.scene._inputManager._isPointerSwiping()) {
                                spritePickResult.pickedSprite.actionManager.processTrigger(1, actionEvent/* ActionEvent */.X.CreateNewFromSprite(spritePickResult.pickedSprite, scene, evt));
                            }
                            if (doubleClick) {
                                spritePickResult.pickedSprite.actionManager.processTrigger(6, actionEvent/* ActionEvent */.X.CreateNewFromSprite(spritePickResult.pickedSprite, scene, evt));
                            }
                        }
                    }
                }
                if (scene._pickedDownSprite && scene._pickedDownSprite.actionManager && scene._pickedDownSprite !== spritePickResult.pickedSprite) {
                    scene._pickedDownSprite.actionManager.processTrigger(16, actionEvent/* ActionEvent */.X.CreateNewFromSprite(scene._pickedDownSprite, scene, evt));
                }
            }
        }
        return pickResult;
    }
}
//# sourceMappingURL=spriteSceneComponent.js.map
;// ./node_modules/@babylonjs/core/Sprites/spriteRenderer.js





/**
 * Class used to render sprites.
 *
 * It can be used either to render Sprites or ThinSprites with ThinEngine only.
 */
class SpriteRenderer {
    /**
     * Gets or sets a boolean indicating if the manager must consider scene fog when rendering
     */
    get fogEnabled() {
        return this._fogEnabled;
    }
    set fogEnabled(value) {
        if (this._fogEnabled === value) {
            return;
        }
        this._fogEnabled = value;
        this._createEffects();
    }
    /**
     * In case the depth buffer does not allow enough depth precision for your scene (might be the case in large scenes)
     * You can try switching to logarithmic depth.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/logarithmicDepthBuffer
     */
    get useLogarithmicDepth() {
        return this._useLogarithmicDepth;
    }
    set useLogarithmicDepth(value) {
        const fragmentDepthSupported = !!this._scene?.getEngine().getCaps().fragmentDepthSupported;
        if (value && !fragmentDepthSupported) {
            logger/* Logger */.V.Warn("Logarithmic depth has been requested for a sprite renderer on a device that doesn't support it.");
        }
        this._useLogarithmicDepth = value && fragmentDepthSupported;
        this._createEffects();
    }
    /**
     * Gets the capacity of the manager
     */
    get capacity() {
        return this._capacity;
    }
    /**
     * Gets or sets a boolean indicating if the renderer must render sprites with pixel perfect rendering
     * Note that pixel perfect mode is not supported in WebGL 1
     */
    get pixelPerfect() {
        return this._pixelPerfect;
    }
    set pixelPerfect(value) {
        if (this._pixelPerfect === value) {
            return;
        }
        this._pixelPerfect = value;
        this._createEffects();
    }
    /**
     * Gets the shader language used in this renderer.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Creates a new sprite renderer
     * @param engine defines the engine the renderer works with
     * @param capacity defines the maximum allowed number of sprites
     * @param epsilon defines the epsilon value to align texture (0.01 by default)
     * @param scene defines the hosting scene
     * @param rendererOptions options for the sprite renderer
     */
    constructor(engine, capacity, epsilon = 0.01, scene = null, rendererOptions) {
        /**
         * Blend mode use to render the particle, it can be any of
         * the static undefined properties provided in this class.
         * Default value is 2
         */
        this.blendMode = 2;
        /**
         * Gets or sets a boolean indicating if alpha mode is automatically
         * reset.
         */
        this.autoResetAlpha = true;
        /**
         * Disables writing to the depth buffer when rendering the sprites.
         * It can be handy to disable depth writing when using textures without alpha channel
         * and setting some specific blend modes.
         */
        this.disableDepthWrite = false;
        this._fogEnabled = true;
        this._pixelPerfect = false;
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._useVAO = false;
        this._useInstancing = false;
        this._vertexBuffers = {};
        this._isDisposed = false;
        this._shadersLoaded = false;
        this._pixelPerfect = rendererOptions?.pixelPerfect ?? false;
        this._capacity = capacity;
        this._epsilon = epsilon;
        this._engine = engine;
        this._useInstancing = engine.getCaps().instancedArrays && engine._features.supportSpriteInstancing;
        this._useVAO = engine.getCaps().vertexArrayObject && !engine.disableVertexArrayObjects;
        this._scene = scene;
        if (!this._useInstancing) {
            this._buildIndexBuffer();
        }
        // VBO
        // 18 floats per sprite (x, y, z, angle, sizeX, sizeY, offsetX, offsetY, invertU, invertV, cellLeft, cellTop, cellWidth, cellHeight, color r, color g, color b, color a)
        // 16 when using instances
        this._vertexBufferSize = this._useInstancing ? 16 : 18;
        this._vertexData = new Float32Array(capacity * this._vertexBufferSize * (this._useInstancing ? 1 : 4));
        this._buffer = new Buffers_buffer/* Buffer */.h(engine, this._vertexData, true, this._vertexBufferSize);
        const positions = this._buffer.createVertexBuffer(Buffers_buffer/* VertexBuffer */.R.PositionKind, 0, 4, this._vertexBufferSize, this._useInstancing);
        const options = this._buffer.createVertexBuffer("options", 4, 2, this._vertexBufferSize, this._useInstancing);
        let offset = 6;
        let offsets;
        if (this._useInstancing) {
            const spriteData = new Float32Array([
                this._epsilon,
                this._epsilon,
                1 - this._epsilon,
                this._epsilon,
                this._epsilon,
                1 - this._epsilon,
                1 - this._epsilon,
                1 - this._epsilon,
            ]);
            this._spriteBuffer = new Buffers_buffer/* Buffer */.h(engine, spriteData, false, 2);
            offsets = this._spriteBuffer.createVertexBuffer("offsets", 0, 2);
        }
        else {
            offsets = this._buffer.createVertexBuffer("offsets", offset, 2, this._vertexBufferSize, this._useInstancing);
            offset += 2;
        }
        const inverts = this._buffer.createVertexBuffer("inverts", offset, 2, this._vertexBufferSize, this._useInstancing);
        const cellInfo = this._buffer.createVertexBuffer("cellInfo", offset + 2, 4, this._vertexBufferSize, this._useInstancing);
        const colors = this._buffer.createVertexBuffer(Buffers_buffer/* VertexBuffer */.R.ColorKind, offset + 6, 4, this._vertexBufferSize, this._useInstancing);
        this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = positions;
        this._vertexBuffers["options"] = options;
        this._vertexBuffers["offsets"] = offsets;
        this._vertexBuffers["inverts"] = inverts;
        this._vertexBuffers["cellInfo"] = cellInfo;
        this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.ColorKind] = colors;
        this._initShaderSourceAsync();
    }
    async _initShaderSourceAsync() {
        const engine = this._engine;
        if (engine.isWebGPU && !SpriteRenderer.ForceGLSL) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 24448)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 62843))]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79831)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 12093))]);
        }
        this._shadersLoaded = true;
        this._createEffects();
    }
    _createEffects() {
        if (this._isDisposed || !this._shadersLoaded) {
            return;
        }
        this._drawWrapperBase?.dispose();
        this._drawWrapperDepth?.dispose();
        this._drawWrapperBase = new Materials_drawWrapper/* DrawWrapper */.E(this._engine);
        this._drawWrapperDepth = new Materials_drawWrapper/* DrawWrapper */.E(this._engine, false);
        if (this._drawWrapperBase.drawContext) {
            this._drawWrapperBase.drawContext.useInstancing = this._useInstancing;
        }
        if (this._drawWrapperDepth.drawContext) {
            this._drawWrapperDepth.drawContext.useInstancing = this._useInstancing;
        }
        let defines = "";
        if (this._pixelPerfect) {
            defines += "#define PIXEL_PERFECT\n";
        }
        if (this._scene && this._scene.fogEnabled && this._scene.fogMode !== 0 && this._fogEnabled) {
            defines += "#define FOG\n";
        }
        if (this._useLogarithmicDepth) {
            defines += "#define LOGARITHMICDEPTH\n";
        }
        this._drawWrapperBase.effect = this._engine.createEffect("sprites", [Buffers_buffer/* VertexBuffer */.R.PositionKind, "options", "offsets", "inverts", "cellInfo", Buffers_buffer/* VertexBuffer */.R.ColorKind], ["view", "projection", "textureInfos", "alphaTest", "vFogInfos", "vFogColor", "logarithmicDepthConstant"], ["diffuseSampler"], defines, undefined, undefined, undefined, undefined, this._shaderLanguage);
        this._drawWrapperDepth.effect = this._drawWrapperBase.effect;
        this._drawWrapperDepth.materialContext = this._drawWrapperBase.materialContext;
    }
    /**
     * Render all child sprites
     * @param sprites defines the list of sprites to render
     * @param deltaTime defines the time since last frame
     * @param viewMatrix defines the viewMatrix to use to render the sprites
     * @param projectionMatrix defines the projectionMatrix to use to render the sprites
     * @param customSpriteUpdate defines a custom function to update the sprites data before they render
     */
    render(sprites, deltaTime, viewMatrix, projectionMatrix, customSpriteUpdate = null) {
        if (!this._shadersLoaded || !this.texture || !this.texture.isReady() || !sprites.length) {
            return;
        }
        const drawWrapper = this._drawWrapperBase;
        const drawWrapperDepth = this._drawWrapperDepth;
        const shouldRenderFog = this.fogEnabled && this._scene && this._scene.fogEnabled && this._scene.fogMode !== 0;
        const effect = drawWrapper.effect;
        // Check
        if (!effect.isReady()) {
            return;
        }
        const engine = this._engine;
        const useRightHandedSystem = !!(this._scene && this._scene.useRightHandedSystem);
        // Sprites
        const max = Math.min(this._capacity, sprites.length);
        let offset = 0;
        let noSprite = true;
        for (let index = 0; index < max; index++) {
            const sprite = sprites[index];
            if (!sprite || !sprite.isVisible) {
                continue;
            }
            noSprite = false;
            sprite._animate(deltaTime);
            const baseSize = this.texture.getBaseSize(); // This could be change by the user inside the animate callback (like onAnimationEnd)
            this._appendSpriteVertex(offset++, sprite, 0, 0, baseSize, useRightHandedSystem, customSpriteUpdate);
            if (!this._useInstancing) {
                this._appendSpriteVertex(offset++, sprite, 1, 0, baseSize, useRightHandedSystem, customSpriteUpdate);
                this._appendSpriteVertex(offset++, sprite, 1, 1, baseSize, useRightHandedSystem, customSpriteUpdate);
                this._appendSpriteVertex(offset++, sprite, 0, 1, baseSize, useRightHandedSystem, customSpriteUpdate);
            }
        }
        if (noSprite) {
            return;
        }
        this._buffer.update(this._vertexData);
        const culling = !!engine.depthCullingState.cull;
        const zOffset = engine.depthCullingState.zOffset;
        const zOffsetUnits = engine.depthCullingState.zOffsetUnits;
        engine.setState(culling, zOffset, false, false, undefined, undefined, zOffsetUnits);
        // Render
        engine.enableEffect(drawWrapper);
        effect.setTexture("diffuseSampler", this.texture);
        effect.setMatrix("view", viewMatrix);
        effect.setMatrix("projection", projectionMatrix);
        // Scene Info
        if (shouldRenderFog) {
            const scene = this._scene;
            // Fog
            effect.setFloat4("vFogInfos", scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity);
            effect.setColor3("vFogColor", scene.fogColor);
        }
        // Log. depth
        if (this.useLogarithmicDepth && this._scene) {
            (0,materialHelper_functions/* BindLogDepth */.DL)(drawWrapper.defines, effect, this._scene);
        }
        if (this._useVAO) {
            if (!this._vertexArrayObject) {
                this._vertexArrayObject = engine.recordVertexArrayObject(this._vertexBuffers, this._indexBuffer, effect);
            }
            engine.bindVertexArrayObject(this._vertexArrayObject, this._indexBuffer);
        }
        else {
            // VBOs
            engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect);
        }
        // Draw order
        engine.depthCullingState.depthFunc = engine.useReverseDepthBuffer ? 518 : 515;
        if (!this.disableDepthWrite) {
            effect.setBool("alphaTest", true);
            engine.setColorWrite(false);
            engine.enableEffect(drawWrapperDepth);
            if (this._useInstancing) {
                engine.drawArraysType(7, 0, 4, offset);
            }
            else {
                engine.drawElementsType(0, 0, (offset / 4) * 6);
            }
            engine.enableEffect(drawWrapper);
            engine.setColorWrite(true);
            effect.setBool("alphaTest", false);
        }
        engine.setAlphaMode(this.blendMode);
        if (this._useInstancing) {
            engine.drawArraysType(7, 0, 4, offset);
        }
        else {
            engine.drawElementsType(0, 0, (offset / 4) * 6);
        }
        if (this.autoResetAlpha) {
            engine.setAlphaMode(0);
        }
        // Restore Right Handed
        if (useRightHandedSystem) {
            this._scene.getEngine().setState(culling, zOffset, false, true, undefined, undefined, zOffsetUnits);
        }
        engine.unbindInstanceAttributes();
    }
    _appendSpriteVertex(index, sprite, offsetX, offsetY, baseSize, useRightHandedSystem, customSpriteUpdate) {
        let arrayOffset = index * this._vertexBufferSize;
        if (offsetX === 0) {
            offsetX = this._epsilon;
        }
        else if (offsetX === 1) {
            offsetX = 1 - this._epsilon;
        }
        if (offsetY === 0) {
            offsetY = this._epsilon;
        }
        else if (offsetY === 1) {
            offsetY = 1 - this._epsilon;
        }
        if (customSpriteUpdate) {
            customSpriteUpdate(sprite, baseSize);
        }
        else {
            if (!sprite.cellIndex) {
                sprite.cellIndex = 0;
            }
            const rowSize = baseSize.width / this.cellWidth;
            const offset = (sprite.cellIndex / rowSize) >> 0;
            sprite._xOffset = ((sprite.cellIndex - offset * rowSize) * this.cellWidth) / baseSize.width;
            sprite._yOffset = (offset * this.cellHeight) / baseSize.height;
            sprite._xSize = this.cellWidth;
            sprite._ySize = this.cellHeight;
        }
        // Positions
        this._vertexData[arrayOffset] = sprite.position.x;
        this._vertexData[arrayOffset + 1] = sprite.position.y;
        this._vertexData[arrayOffset + 2] = sprite.position.z;
        this._vertexData[arrayOffset + 3] = sprite.angle;
        // Options
        this._vertexData[arrayOffset + 4] = sprite.width;
        this._vertexData[arrayOffset + 5] = sprite.height;
        if (!this._useInstancing) {
            this._vertexData[arrayOffset + 6] = offsetX;
            this._vertexData[arrayOffset + 7] = offsetY;
        }
        else {
            arrayOffset -= 2;
        }
        // Inverts according to Right Handed
        if (useRightHandedSystem) {
            this._vertexData[arrayOffset + 8] = sprite.invertU ? 0 : 1;
        }
        else {
            this._vertexData[arrayOffset + 8] = sprite.invertU ? 1 : 0;
        }
        this._vertexData[arrayOffset + 9] = sprite.invertV ? 1 : 0;
        this._vertexData[arrayOffset + 10] = sprite._xOffset;
        this._vertexData[arrayOffset + 11] = sprite._yOffset;
        this._vertexData[arrayOffset + 12] = sprite._xSize / baseSize.width;
        this._vertexData[arrayOffset + 13] = sprite._ySize / baseSize.height;
        // Color
        this._vertexData[arrayOffset + 14] = sprite.color.r;
        this._vertexData[arrayOffset + 15] = sprite.color.g;
        this._vertexData[arrayOffset + 16] = sprite.color.b;
        this._vertexData[arrayOffset + 17] = sprite.color.a;
    }
    _buildIndexBuffer() {
        const indices = [];
        let index = 0;
        for (let count = 0; count < this._capacity; count++) {
            indices.push(index);
            indices.push(index + 1);
            indices.push(index + 2);
            indices.push(index);
            indices.push(index + 2);
            indices.push(index + 3);
            index += 4;
        }
        this._indexBuffer = this._engine.createIndexBuffer(indices);
    }
    /**
     * Rebuilds the renderer (after a context lost, for eg)
     */
    rebuild() {
        if (this._indexBuffer) {
            this._buildIndexBuffer();
        }
        if (this._useVAO) {
            this._vertexArrayObject = undefined;
        }
        this._buffer._rebuild();
        for (const key in this._vertexBuffers) {
            const vertexBuffer = this._vertexBuffers[key];
            vertexBuffer._rebuild();
        }
        this._spriteBuffer?._rebuild();
    }
    /**
     * Release associated resources
     */
    dispose() {
        if (this._buffer) {
            this._buffer.dispose();
            this._buffer = null;
        }
        if (this._spriteBuffer) {
            this._spriteBuffer.dispose();
            this._spriteBuffer = null;
        }
        if (this._indexBuffer) {
            this._engine._releaseBuffer(this._indexBuffer);
            this._indexBuffer = null;
        }
        if (this._vertexArrayObject) {
            this._engine.releaseVertexArrayObject(this._vertexArrayObject);
            this._vertexArrayObject = null;
        }
        if (this.texture) {
            this.texture.dispose();
            this.texture = null;
        }
        this._drawWrapperBase?.dispose();
        this._drawWrapperDepth?.dispose();
        this._isDisposed = true;
    }
}
/**
 * Force all the sprites to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
SpriteRenderer.ForceGLSL = false;
//# sourceMappingURL=spriteRenderer.js.map
;// ./node_modules/@babylonjs/core/Sprites/spriteManager.js













/**
 * Class used to manage multiple sprites on the same spritesheet
 * @see https://doc.babylonjs.com/features/featuresDeepDive/sprites
 */
class SpriteManager {
    /**
     * Callback called when the manager is disposed
     */
    set onDispose(callback) {
        if (this._onDisposeObserver) {
            this.onDisposeObservable.remove(this._onDisposeObserver);
        }
        this._onDisposeObserver = this.onDisposeObservable.add(callback);
    }
    /**
     * Gets the array of sprites
     */
    get children() {
        return this.sprites;
    }
    /**
     * Gets the hosting scene
     */
    get scene() {
        return this._scene;
    }
    /**
     * Gets the capacity of the manager
     */
    get capacity() {
        return this._spriteRenderer.capacity;
    }
    /**
     * Gets or sets the spritesheet texture
     */
    get texture() {
        return this._spriteRenderer.texture;
    }
    set texture(value) {
        value.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        value.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._spriteRenderer.texture = value;
        this._textureContent = null;
    }
    /** Defines the default width of a cell in the spritesheet */
    get cellWidth() {
        return this._spriteRenderer.cellWidth;
    }
    set cellWidth(value) {
        this._spriteRenderer.cellWidth = value;
    }
    /** Defines the default height of a cell in the spritesheet */
    get cellHeight() {
        return this._spriteRenderer.cellHeight;
    }
    set cellHeight(value) {
        this._spriteRenderer.cellHeight = value;
    }
    /** Gets or sets a boolean indicating if the manager must consider scene fog when rendering */
    get fogEnabled() {
        return this._spriteRenderer.fogEnabled;
    }
    set fogEnabled(value) {
        this._spriteRenderer.fogEnabled = value;
    }
    /** Gets or sets a boolean indicating if the manager must use logarithmic depth when rendering */
    get useLogarithmicDepth() {
        return this._spriteRenderer.useLogarithmicDepth;
    }
    set useLogarithmicDepth(value) {
        this._spriteRenderer.useLogarithmicDepth = value;
    }
    /**
     * Blend mode use to render the particle, it can be any of
     * the static undefined properties provided in this class.
     * Default value is 2
     */
    get blendMode() {
        return this._spriteRenderer.blendMode;
    }
    set blendMode(blendMode) {
        this._spriteRenderer.blendMode = blendMode;
    }
    /** Disables writing to the depth buffer when rendering the sprites.
     *  It can be handy to disable depth writing when using textures without alpha channel
     *  and setting some specific blend modes.
     */
    get disableDepthWrite() {
        return this._disableDepthWrite;
    }
    set disableDepthWrite(value) {
        this._disableDepthWrite = value;
        this._spriteRenderer.disableDepthWrite = value;
    }
    /**
     * Gets or sets a boolean indicating if the renderer must render sprites with pixel perfect rendering
     * In this mode, sprites are rendered as "pixel art", which means that they appear as pixelated but remain stable when moving or when rotated or scaled.
     * Note that for this mode to work as expected, the sprite texture must use the BILINEAR sampling mode, not NEAREST!
     */
    get pixelPerfect() {
        return this._spriteRenderer.pixelPerfect;
    }
    set pixelPerfect(value) {
        this._spriteRenderer.pixelPerfect = value;
        if (value && this.texture.samplingMode !== 3) {
            this.texture.updateSamplingMode(3);
        }
    }
    /**
     * Creates a new sprite manager
     * @param name defines the manager's name
     * @param imgUrl defines the sprite sheet url
     * @param capacity defines the maximum allowed number of sprites
     * @param cellSize defines the size of a sprite cell
     * @param scene defines the hosting scene
     * @param epsilon defines the epsilon value to align texture (0.01 by default)
     * @param samplingMode defines the sampling mode to use with spritesheet
     * @param fromPacked set to false; do not alter
     * @param spriteJSON null otherwise a JSON object defining sprite sheet data; do not alter
     * @param options options used to create the SpriteManager instance
     */
    constructor(
    /** defines the manager's name */
    name, imgUrl, capacity, cellSize, scene, epsilon = 0.01, samplingMode = Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, fromPacked = false, spriteJSON = null, options) {
        this.name = name;
        /** Gets the list of sprites */
        this.sprites = [];
        /** Gets or sets the rendering group id (0 by default) */
        this.renderingGroupId = 0;
        /** Gets or sets camera layer mask */
        this.layerMask = 0x0fffffff;
        /** Gets or sets a boolean indicating if the sprites are pickable */
        this.isPickable = false;
        /**
         * Gets or sets an object used to store user defined information for the sprite manager
         */
        this.metadata = null;
        /** @internal */
        this._wasDispatched = false;
        /**
         * An event triggered when the manager is disposed.
         */
        this.onDisposeObservable = new Misc_observable/* Observable */.cP();
        this._disableDepthWrite = false;
        /** True when packed cell data from JSON file is ready*/
        this._packedAndReady = false;
        this._customUpdate = (sprite, baseSize) => {
            if (!sprite.cellRef) {
                sprite.cellIndex = 0;
            }
            const num = sprite.cellIndex;
            if (typeof num === "number" && isFinite(num) && Math.floor(num) === num) {
                sprite.cellRef = this._spriteMap[sprite.cellIndex];
            }
            sprite._xOffset = this._cellData[sprite.cellRef].frame.x / baseSize.width;
            sprite._yOffset = this._cellData[sprite.cellRef].frame.y / baseSize.height;
            sprite._xSize = this._cellData[sprite.cellRef].frame.w;
            sprite._ySize = this._cellData[sprite.cellRef].frame.h;
        };
        if (!scene) {
            scene = engineStore/* EngineStore */.q.LastCreatedScene;
        }
        if (!scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_SPRITE)) {
            scene._addComponent(new SpriteSceneComponent(scene));
        }
        this._fromPacked = fromPacked;
        this._scene = scene;
        const engine = this._scene.getEngine();
        this._spriteRenderer = new SpriteRenderer(engine, capacity, epsilon, scene, options?.spriteRendererOptions);
        if (cellSize.width && cellSize.height) {
            this.cellWidth = cellSize.width;
            this.cellHeight = cellSize.height;
        }
        else if (cellSize !== undefined) {
            this.cellWidth = cellSize;
            this.cellHeight = cellSize;
        }
        else {
            this._spriteRenderer = null;
            return;
        }
        this._scene.spriteManagers && this._scene.spriteManagers.push(this);
        this.uniqueId = this.scene.getUniqueId();
        if (imgUrl) {
            this.texture = new Textures_texture/* Texture */.g(imgUrl, scene, true, false, samplingMode);
        }
        if (this._fromPacked) {
            this._makePacked(imgUrl, spriteJSON);
        }
    }
    /**
     * Returns the string "SpriteManager"
     * @returns "SpriteManager"
     */
    getClassName() {
        return "SpriteManager";
    }
    _makePacked(imgUrl, spriteJSON) {
        if (spriteJSON !== null) {
            try {
                //Get the JSON and Check its structure.  If its an array parse it if its a JSON string etc...
                let celldata;
                if (typeof spriteJSON === "string") {
                    celldata = JSON.parse(spriteJSON);
                }
                else {
                    celldata = spriteJSON;
                }
                if (celldata.frames.length) {
                    const frametemp = {};
                    for (let i = 0; i < celldata.frames.length; i++) {
                        const _f = celldata.frames[i];
                        if (typeof Object.keys(_f)[0] !== "string") {
                            throw new Error("Invalid JSON Format.  Check the frame values and make sure the name is the first parameter.");
                        }
                        const name = _f[Object.keys(_f)[0]];
                        frametemp[name] = _f;
                    }
                    celldata.frames = frametemp;
                }
                const spritemap = Reflect.ownKeys(celldata.frames);
                this._spriteMap = spritemap;
                this._packedAndReady = true;
                this._cellData = celldata.frames;
            }
            catch (e) {
                this._fromPacked = false;
                this._packedAndReady = false;
                throw new Error("Invalid JSON from string. Spritesheet managed with constant cell size.");
            }
        }
        else {
            const re = /\./g;
            let li;
            do {
                li = re.lastIndex;
                re.test(imgUrl);
            } while (re.lastIndex > 0);
            const jsonUrl = imgUrl.substring(0, li - 1) + ".json";
            const onerror = () => {
                logger/* Logger */.V.Error("JSON ERROR: Unable to load JSON file.");
                this._fromPacked = false;
                this._packedAndReady = false;
            };
            const onload = (data) => {
                try {
                    const celldata = JSON.parse(data);
                    const spritemap = Reflect.ownKeys(celldata.frames);
                    this._spriteMap = spritemap;
                    this._packedAndReady = true;
                    this._cellData = celldata.frames;
                }
                catch (e) {
                    this._fromPacked = false;
                    this._packedAndReady = false;
                    throw new Error("Invalid JSON format. Please check documentation for format specifications.");
                }
            };
            tools/* Tools */.S0.LoadFile(jsonUrl, onload, undefined, undefined, false, onerror);
        }
    }
    _checkTextureAlpha(sprite, ray, distance, min, max) {
        if (!sprite.useAlphaForPicking || !this.texture) {
            return true;
        }
        const textureSize = this.texture.getSize();
        if (!this._textureContent) {
            this._textureContent = new Uint8Array(textureSize.width * textureSize.height * 4);
            this.texture.readPixels(0, 0, this._textureContent);
        }
        const contactPoint = math_vector/* TmpVectors */.AA.Vector3[0];
        contactPoint.copyFrom(ray.direction);
        contactPoint.normalize();
        contactPoint.scaleInPlace(distance);
        contactPoint.addInPlace(ray.origin);
        const contactPointU = (contactPoint.x - min.x) / (max.x - min.x);
        const contactPointV = 1.0 - (contactPoint.y - min.y) / (max.y - min.y);
        const u = (sprite._xOffset * textureSize.width + contactPointU * sprite._xSize) | 0;
        const v = (sprite._yOffset * textureSize.height + contactPointV * sprite._ySize) | 0;
        const alpha = this._textureContent[(u + v * textureSize.width) * 4 + 3];
        return alpha > 0.5;
    }
    /**
     * Intersects the sprites with a ray
     * @param ray defines the ray to intersect with
     * @param camera defines the current active camera
     * @param predicate defines a predicate used to select candidate sprites
     * @param fastCheck defines if a fast check only must be done (the first potential sprite is will be used and not the closer)
     * @returns null if no hit or a PickingInfo
     */
    intersects(ray, camera, predicate, fastCheck) {
        const count = Math.min(this.capacity, this.sprites.length);
        const min = math_vector/* Vector3 */.Pq.Zero();
        const max = math_vector/* Vector3 */.Pq.Zero();
        let distance = Number.MAX_VALUE;
        let currentSprite = null;
        const pickedPoint = math_vector/* TmpVectors */.AA.Vector3[0];
        const cameraSpacePosition = math_vector/* TmpVectors */.AA.Vector3[1];
        const cameraView = camera.getViewMatrix();
        let activeRay = ray;
        let pickedRay = ray;
        for (let index = 0; index < count; index++) {
            const sprite = this.sprites[index];
            if (!sprite) {
                continue;
            }
            if (predicate) {
                if (!predicate(sprite)) {
                    continue;
                }
            }
            else if (!sprite.isPickable) {
                continue;
            }
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(sprite.position, cameraView, cameraSpacePosition);
            if (sprite.angle) {
                // Create a rotation matrix to rotate the ray to the sprite's rotation
                math_vector/* Matrix */.uq.TranslationToRef(-cameraSpacePosition.x, -cameraSpacePosition.y, 0, math_vector/* TmpVectors */.AA.Matrix[1]);
                math_vector/* Matrix */.uq.TranslationToRef(cameraSpacePosition.x, cameraSpacePosition.y, 0, math_vector/* TmpVectors */.AA.Matrix[2]);
                math_vector/* Matrix */.uq.RotationZToRef(-sprite.angle, math_vector/* TmpVectors */.AA.Matrix[3]);
                // inv translation x rotation x translation
                math_vector/* TmpVectors */.AA.Matrix[1].multiplyToRef(math_vector/* TmpVectors */.AA.Matrix[3], math_vector/* TmpVectors */.AA.Matrix[4]);
                math_vector/* TmpVectors */.AA.Matrix[4].multiplyToRef(math_vector/* TmpVectors */.AA.Matrix[2], math_vector/* TmpVectors */.AA.Matrix[0]);
                activeRay = ray.clone();
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(ray.origin, math_vector/* TmpVectors */.AA.Matrix[0], activeRay.origin);
                math_vector/* Vector3 */.Pq.TransformNormalToRef(ray.direction, math_vector/* TmpVectors */.AA.Matrix[0], activeRay.direction);
            }
            else {
                activeRay = ray;
            }
            min.copyFromFloats(cameraSpacePosition.x - sprite.width / 2, cameraSpacePosition.y - sprite.height / 2, cameraSpacePosition.z);
            max.copyFromFloats(cameraSpacePosition.x + sprite.width / 2, cameraSpacePosition.y + sprite.height / 2, cameraSpacePosition.z);
            if (activeRay.intersectsBoxMinMax(min, max)) {
                const currentDistance = math_vector/* Vector3 */.Pq.Distance(cameraSpacePosition, activeRay.origin);
                if (distance > currentDistance) {
                    if (!this._checkTextureAlpha(sprite, activeRay, currentDistance, min, max)) {
                        continue;
                    }
                    pickedRay = activeRay;
                    distance = currentDistance;
                    currentSprite = sprite;
                    if (fastCheck) {
                        break;
                    }
                }
            }
        }
        if (currentSprite) {
            const result = new Collisions_pickingInfo/* PickingInfo */.G();
            cameraView.invertToRef(math_vector/* TmpVectors */.AA.Matrix[0]);
            result.hit = true;
            result.pickedSprite = currentSprite;
            result.distance = distance;
            // Get picked point
            const direction = math_vector/* TmpVectors */.AA.Vector3[2];
            direction.copyFrom(pickedRay.direction);
            direction.normalize();
            direction.scaleInPlace(distance);
            pickedRay.origin.addToRef(direction, pickedPoint);
            result.pickedPoint = math_vector/* Vector3 */.Pq.TransformCoordinates(pickedPoint, math_vector/* TmpVectors */.AA.Matrix[0]);
            return result;
        }
        return null;
    }
    /**
     * Intersects the sprites with a ray
     * @param ray defines the ray to intersect with
     * @param camera defines the current active camera
     * @param predicate defines a predicate used to select candidate sprites
     * @returns null if no hit or a PickingInfo array
     */
    multiIntersects(ray, camera, predicate) {
        const count = Math.min(this.capacity, this.sprites.length);
        const min = math_vector/* Vector3 */.Pq.Zero();
        const max = math_vector/* Vector3 */.Pq.Zero();
        let distance;
        const results = [];
        const pickedPoint = math_vector/* TmpVectors */.AA.Vector3[0].copyFromFloats(0, 0, 0);
        const cameraSpacePosition = math_vector/* TmpVectors */.AA.Vector3[1].copyFromFloats(0, 0, 0);
        const cameraView = camera.getViewMatrix();
        for (let index = 0; index < count; index++) {
            const sprite = this.sprites[index];
            if (!sprite) {
                continue;
            }
            if (predicate) {
                if (!predicate(sprite)) {
                    continue;
                }
            }
            else if (!sprite.isPickable) {
                continue;
            }
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(sprite.position, cameraView, cameraSpacePosition);
            min.copyFromFloats(cameraSpacePosition.x - sprite.width / 2, cameraSpacePosition.y - sprite.height / 2, cameraSpacePosition.z);
            max.copyFromFloats(cameraSpacePosition.x + sprite.width / 2, cameraSpacePosition.y + sprite.height / 2, cameraSpacePosition.z);
            if (ray.intersectsBoxMinMax(min, max)) {
                distance = math_vector/* Vector3 */.Pq.Distance(cameraSpacePosition, ray.origin);
                if (!this._checkTextureAlpha(sprite, ray, distance, min, max)) {
                    continue;
                }
                const result = new Collisions_pickingInfo/* PickingInfo */.G();
                results.push(result);
                cameraView.invertToRef(math_vector/* TmpVectors */.AA.Matrix[0]);
                result.hit = true;
                result.pickedSprite = sprite;
                result.distance = distance;
                // Get picked point
                const direction = math_vector/* TmpVectors */.AA.Vector3[2];
                direction.copyFrom(ray.direction);
                direction.normalize();
                direction.scaleInPlace(distance);
                ray.origin.addToRef(direction, pickedPoint);
                result.pickedPoint = math_vector/* Vector3 */.Pq.TransformCoordinates(pickedPoint, math_vector/* TmpVectors */.AA.Matrix[0]);
            }
        }
        return results;
    }
    /**
     * Render all child sprites
     */
    render() {
        // Check
        if (this._fromPacked && (!this._packedAndReady || !this._spriteMap || !this._cellData)) {
            return;
        }
        const engine = this._scene.getEngine();
        const deltaTime = engine.getDeltaTime();
        if (this._packedAndReady) {
            this._spriteRenderer.render(this.sprites, deltaTime, this._scene.getViewMatrix(), this._scene.getProjectionMatrix(), this._customUpdate);
        }
        else {
            this._spriteRenderer.render(this.sprites, deltaTime, this._scene.getViewMatrix(), this._scene.getProjectionMatrix());
        }
    }
    /**
     * Rebuilds the manager (after a context lost, for eg)
     */
    rebuild() {
        this._spriteRenderer?.rebuild();
    }
    /**
     * Release associated resources
     */
    dispose() {
        if (this._spriteRenderer) {
            this._spriteRenderer.dispose();
            this._spriteRenderer = null;
        }
        this._textureContent = null;
        // Remove from scene
        if (this._scene.spriteManagers) {
            const index = this._scene.spriteManagers.indexOf(this);
            this._scene.spriteManagers.splice(index, 1);
        }
        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
        this.metadata = null;
    }
    /**
     * Serializes the sprite manager to a JSON object
     * @param serializeTexture defines if the texture must be serialized as well
     * @returns the JSON object
     */
    serialize(serializeTexture = false) {
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.capacity = this.capacity;
        serializationObject.cellWidth = this.cellWidth;
        serializationObject.cellHeight = this.cellHeight;
        serializationObject.fogEnabled = this.fogEnabled;
        serializationObject.blendMode = this.blendMode;
        serializationObject.disableDepthWrite = this.disableDepthWrite;
        serializationObject.pixelPerfect = this.pixelPerfect;
        serializationObject.useLogarithmicDepth = this.useLogarithmicDepth;
        if (this.texture) {
            if (serializeTexture) {
                serializationObject.texture = this.texture.serialize();
            }
            else {
                serializationObject.textureUrl = this.texture.name;
                serializationObject.invertY = this.texture._invertY;
            }
        }
        serializationObject.sprites = [];
        for (const sprite of this.sprites) {
            serializationObject.sprites.push(sprite.serialize());
        }
        serializationObject.metadata = this.metadata;
        return serializationObject;
    }
    /**
     * Parses a JSON object to create a new sprite manager.
     * @param parsedManager The JSON object to parse
     * @param scene The scene to create the sprite manager
     * @param rootUrl The root url to use to load external dependencies like texture
     * @returns the new sprite manager
     */
    static Parse(parsedManager, scene, rootUrl) {
        const manager = new SpriteManager(parsedManager.name, "", parsedManager.capacity, {
            width: parsedManager.cellWidth,
            height: parsedManager.cellHeight,
        }, scene);
        if (parsedManager.fogEnabled !== undefined) {
            manager.fogEnabled = parsedManager.fogEnabled;
        }
        if (parsedManager.blendMode !== undefined) {
            manager.blendMode = parsedManager.blendMode;
        }
        if (parsedManager.disableDepthWrite !== undefined) {
            manager.disableDepthWrite = parsedManager.disableDepthWrite;
        }
        if (parsedManager.pixelPerfect !== undefined) {
            manager.pixelPerfect = parsedManager.pixelPerfect;
        }
        if (parsedManager.useLogarithmicDepth !== undefined) {
            manager.useLogarithmicDepth = parsedManager.useLogarithmicDepth;
        }
        if (parsedManager.metadata !== undefined) {
            manager.metadata = parsedManager.metadata;
        }
        if (parsedManager.texture) {
            manager.texture = Textures_texture/* Texture */.g.Parse(parsedManager.texture, scene, rootUrl);
        }
        else if (parsedManager.textureName) {
            manager.texture = new Textures_texture/* Texture */.g(rootUrl + parsedManager.textureUrl, scene, false, parsedManager.invertY !== undefined ? parsedManager.invertY : true);
        }
        for (const parsedSprite of parsedManager.sprites) {
            Sprite.Parse(parsedSprite, manager);
        }
        return manager;
    }
    /**
     * Creates a sprite manager from a snippet saved in a remote file
     * @param name defines the name of the sprite manager to create (can be null or empty to use the one from the json data)
     * @param url defines the url to load from
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @returns a promise that will resolve to the new sprite manager
     */
    static ParseFromFileAsync(name, url, scene, rootUrl = "") {
        return new Promise((resolve, reject) => {
            const request = new webRequest/* WebRequest */.u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const serializationObject = JSON.parse(request.responseText);
                        const output = SpriteManager.Parse(serializationObject, scene || engineStore/* EngineStore */.q.LastCreatedScene, rootUrl);
                        if (name) {
                            output.name = name;
                        }
                        resolve(output);
                    }
                    else {
                        reject("Unable to load the sprite manager");
                    }
                }
            });
            request.open("GET", url);
            request.send();
        });
    }
    /**
     * Creates a sprite manager from a snippet saved by the sprite editor
     * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @returns a promise that will resolve to the new sprite manager
     */
    static ParseFromSnippetAsync(snippetId, scene, rootUrl = "") {
        if (snippetId === "_BLANK") {
            return Promise.resolve(new SpriteManager("Default sprite manager", "//playground.babylonjs.com/textures/player.png", 500, 64, scene));
        }
        return new Promise((resolve, reject) => {
            const request = new webRequest/* WebRequest */.u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);
                        const serializationObject = JSON.parse(snippet.spriteManager);
                        const output = SpriteManager.Parse(serializationObject, scene || engineStore/* EngineStore */.q.LastCreatedScene, rootUrl);
                        output.snippetId = snippetId;
                        resolve(output);
                    }
                    else {
                        reject("Unable to load the snippet " + snippetId);
                    }
                }
            });
            request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/"));
            request.send();
        });
    }
}
/** Define the Url to load snippets */
SpriteManager.SnippetUrl = `https://snippet.babylonjs.com`;
/**
 * Creates a sprite manager from a snippet saved by the sprite editor
 * @deprecated Please use ParseFromSnippetAsync instead
 * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)
 * @param scene defines the hosting scene
 * @param rootUrl defines the root URL to use to load textures and relative dependencies
 * @returns a promise that will resolve to the new sprite manager
 */
SpriteManager.CreateFromSnippetAsync = SpriteManager.ParseFromSnippetAsync;
//# sourceMappingURL=spriteManager.js.map
;// ./node_modules/@babylonjs/core/Loading/Plugins/babylonFileLoader.js




























/** @internal */
// eslint-disable-next-line @typescript-eslint/naming-convention, no-var
var _BabylonLoaderRegistered = true;
/**
 * Helps setting up some configuration for the babylon file loader.
 */
class BabylonFileLoaderConfiguration {
}
/**
 * The loader does not allow injecting custom physics engine into the plugins.
 * Unfortunately in ES6, we need to manually inject them into the plugin.
 * So you could set this variable to your engine import to make it work.
 */
BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine = undefined;
let tempIndexContainer = {};
let tempMaterialIndexContainer = {};
let tempMorphTargetManagerIndexContainer = {};
const parseMaterialByPredicate = (predicate, parsedData, scene, rootUrl) => {
    if (!parsedData.materials) {
        return null;
    }
    for (let index = 0, cache = parsedData.materials.length; index < cache; index++) {
        const parsedMaterial = parsedData.materials[index];
        if (predicate(parsedMaterial)) {
            return { parsedMaterial, material: Materials_material/* Material */.i.Parse(parsedMaterial, scene, rootUrl) };
        }
    }
    return null;
};
const isDescendantOf = (mesh, names, hierarchyIds) => {
    for (const i in names) {
        if (mesh.name === names[i]) {
            hierarchyIds.push(mesh.id);
            return true;
        }
    }
    if (mesh.parentId !== undefined && hierarchyIds.indexOf(mesh.parentId) !== -1) {
        hierarchyIds.push(mesh.id);
        return true;
    }
    return false;
};
// eslint-disable-next-line @typescript-eslint/naming-convention
const logOperation = (operation, producer) => {
    return (operation +
        " of " +
        (producer ? producer.file + " from " + producer.name + " version: " + producer.version + ", exporter version: " + producer.exporter_version : "unknown"));
};
const loadDetailLevels = (scene, mesh) => {
    const mastermesh = mesh;
    // Every value specified in the ids array of the lod data points to another mesh which should be used as the lower LOD level.
    // The distances (or coverages) array values specified are used along with the lod mesh ids as a hint to determine the switching threshold for the various LODs.
    if (mesh._waitingData.lods) {
        if (mesh._waitingData.lods.ids && mesh._waitingData.lods.ids.length > 0) {
            const lodmeshes = mesh._waitingData.lods.ids;
            const wasenabled = mastermesh.isEnabled(false);
            if (mesh._waitingData.lods.distances) {
                const distances = mesh._waitingData.lods.distances;
                if (distances.length >= lodmeshes.length) {
                    const culling = distances.length > lodmeshes.length ? distances[distances.length - 1] : 0;
                    mastermesh.setEnabled(false);
                    for (let index = 0; index < lodmeshes.length; index++) {
                        const lodid = lodmeshes[index];
                        const lodmesh = scene.getMeshById(lodid);
                        if (lodmesh != null) {
                            mastermesh.addLODLevel(distances[index], lodmesh);
                        }
                    }
                    if (culling > 0) {
                        mastermesh.addLODLevel(culling, null);
                    }
                    if (wasenabled === true) {
                        mastermesh.setEnabled(true);
                    }
                }
                else {
                    tools/* Tools */.S0.Warn("Invalid level of detail distances for " + mesh.name);
                }
            }
        }
        mesh._waitingData.lods = null;
    }
};
const findParent = (parentId, parentInstanceIndex, scene) => {
    if (typeof parentId !== "number") {
        const parentEntry = scene.getLastEntryById(parentId);
        if (parentEntry && parentInstanceIndex !== undefined && parentInstanceIndex !== null) {
            const instance = parentEntry.instances[parseInt(parentInstanceIndex)];
            return instance;
        }
        return parentEntry;
    }
    const parent = tempIndexContainer[parentId];
    if (parent && parentInstanceIndex !== undefined && parentInstanceIndex !== null) {
        const instance = parent.instances[parseInt(parentInstanceIndex)];
        return instance;
    }
    return parent;
};
const findMaterial = (materialId, scene) => {
    if (typeof materialId !== "number") {
        return scene.getLastMaterialById(materialId, true);
    }
    return tempMaterialIndexContainer[materialId];
};
const loadAssetContainer = (scene, data, rootUrl, onError, addToScene = false) => {
    const container = new assetContainer/* AssetContainer */.WZ(scene);
    // Entire method running in try block, so ALWAYS logs as far as it got, only actually writes details
    // when SceneLoader.debugLogging = true (default), or exception encountered.
    // Everything stored in var log instead of writing separate lines to support only writing in exception,
    // and avoid problems with multiple concurrent .babylon loads.
    let log = "importScene has failed JSON parse";
    try {
        // eslint-disable-next-line no-var
        var parsedData = JSON.parse(data);
        log = "";
        const fullDetails = sceneLoader/* SceneLoader */.cn.loggingLevel === sceneLoader/* SceneLoader */.cn.DETAILED_LOGGING;
        let index;
        let cache;
        // Environment texture
        if (parsedData.environmentTexture !== undefined && parsedData.environmentTexture !== null) {
            // PBR needed for both HDR texture (gamma space) & a sky box
            const isPBR = parsedData.isPBR !== undefined ? parsedData.isPBR : true;
            if (parsedData.environmentTextureType && parsedData.environmentTextureType === "BABYLON.HDRCubeTexture") {
                const hdrSize = parsedData.environmentTextureSize ? parsedData.environmentTextureSize : 128;
                const hdrTexture = new HDRCubeTexture((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene, hdrSize, true, !isPBR, undefined, parsedData.environmentTexturePrefilterOnLoad);
                if (parsedData.environmentTextureRotationY) {
                    hdrTexture.rotationY = parsedData.environmentTextureRotationY;
                }
                scene.environmentTexture = hdrTexture;
            }
            else {
                if (typeof parsedData.environmentTexture === "object") {
                    const environmentTexture = Textures_cubeTexture/* CubeTexture */.b.Parse(parsedData.environmentTexture, scene, rootUrl);
                    scene.environmentTexture = environmentTexture;
                }
                else if (parsedData.environmentTexture.endsWith(".env")) {
                    const compressedTexture = new Textures_cubeTexture/* CubeTexture */.b((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene, parsedData.environmentTextureForcedExtension);
                    if (parsedData.environmentTextureRotationY) {
                        compressedTexture.rotationY = parsedData.environmentTextureRotationY;
                    }
                    scene.environmentTexture = compressedTexture;
                }
                else {
                    const cubeTexture = Textures_cubeTexture/* CubeTexture */.b.CreateFromPrefilteredData((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene, parsedData.environmentTextureForcedExtension);
                    if (parsedData.environmentTextureRotationY) {
                        cubeTexture.rotationY = parsedData.environmentTextureRotationY;
                    }
                    scene.environmentTexture = cubeTexture;
                }
            }
            if (parsedData.createDefaultSkybox === true) {
                const skyboxScale = scene.activeCamera !== undefined && scene.activeCamera !== null ? (scene.activeCamera.maxZ - scene.activeCamera.minZ) / 2 : 1000;
                const skyboxBlurLevel = parsedData.skyboxBlurLevel || 0;
                scene.createDefaultSkybox(scene.environmentTexture, isPBR, skyboxScale, skyboxBlurLevel);
            }
            container.environmentTexture = scene.environmentTexture;
        }
        // Environment Intensity
        if (parsedData.environmentIntensity !== undefined && parsedData.environmentIntensity !== null) {
            scene.environmentIntensity = parsedData.environmentIntensity;
        }
        // Lights
        if (parsedData.lights !== undefined && parsedData.lights !== null) {
            for (index = 0, cache = parsedData.lights.length; index < cache; index++) {
                const parsedLight = parsedData.lights[index];
                const light = Lights_light/* Light */.v.Parse(parsedLight, scene);
                if (light) {
                    tempIndexContainer[parsedLight.uniqueId] = light;
                    container.lights.push(light);
                    light._parentContainer = container;
                    log += index === 0 ? "\n\tLights:" : "";
                    log += "\n\t\t" + light.toString(fullDetails);
                }
            }
        }
        // Reflection probes
        if (parsedData.reflectionProbes !== undefined && parsedData.reflectionProbes !== null) {
            for (index = 0, cache = parsedData.reflectionProbes.length; index < cache; index++) {
                const parsedReflectionProbe = parsedData.reflectionProbes[index];
                const reflectionProbe = ReflectionProbe.Parse(parsedReflectionProbe, scene, rootUrl);
                if (reflectionProbe) {
                    container.reflectionProbes.push(reflectionProbe);
                    reflectionProbe._parentContainer = container;
                    log += index === 0 ? "\n\tReflection Probes:" : "";
                    log += "\n\t\t" + reflectionProbe.toString(fullDetails);
                }
            }
        }
        // Animations
        if (parsedData.animations !== undefined && parsedData.animations !== null) {
            for (index = 0, cache = parsedData.animations.length; index < cache; index++) {
                const parsedAnimation = parsedData.animations[index];
                const internalClass = (0,typeStore/* GetClass */.n9)("BABYLON.Animation");
                if (internalClass) {
                    const animation = internalClass.Parse(parsedAnimation);
                    scene.animations.push(animation);
                    container.animations.push(animation);
                    log += index === 0 ? "\n\tAnimations:" : "";
                    log += "\n\t\t" + animation.toString(fullDetails);
                }
            }
        }
        // Materials
        if (parsedData.materials !== undefined && parsedData.materials !== null) {
            for (index = 0, cache = parsedData.materials.length; index < cache; index++) {
                const parsedMaterial = parsedData.materials[index];
                const mat = Materials_material/* Material */.i.Parse(parsedMaterial, scene, rootUrl);
                if (mat) {
                    tempMaterialIndexContainer[parsedMaterial.uniqueId || parsedMaterial.id] = mat;
                    container.materials.push(mat);
                    mat._parentContainer = container;
                    log += index === 0 ? "\n\tMaterials:" : "";
                    log += "\n\t\t" + mat.toString(fullDetails);
                    // Textures
                    const textures = mat.getActiveTextures();
                    textures.forEach((t) => {
                        if (container.textures.indexOf(t) == -1) {
                            container.textures.push(t);
                            t._parentContainer = container;
                        }
                    });
                }
            }
        }
        if (parsedData.multiMaterials !== undefined && parsedData.multiMaterials !== null) {
            for (index = 0, cache = parsedData.multiMaterials.length; index < cache; index++) {
                const parsedMultiMaterial = parsedData.multiMaterials[index];
                const mmat = Materials_multiMaterial/* MultiMaterial */.F.ParseMultiMaterial(parsedMultiMaterial, scene);
                tempMaterialIndexContainer[parsedMultiMaterial.uniqueId || parsedMultiMaterial.id] = mmat;
                container.multiMaterials.push(mmat);
                mmat._parentContainer = container;
                log += index === 0 ? "\n\tMultiMaterials:" : "";
                log += "\n\t\t" + mmat.toString(fullDetails);
                // Textures
                const textures = mmat.getActiveTextures();
                textures.forEach((t) => {
                    if (container.textures.indexOf(t) == -1) {
                        container.textures.push(t);
                        t._parentContainer = container;
                    }
                });
            }
        }
        // Morph targets
        if (parsedData.morphTargetManagers !== undefined && parsedData.morphTargetManagers !== null) {
            for (const parsedManager of parsedData.morphTargetManagers) {
                const manager = Morph_morphTargetManager/* MorphTargetManager */.j.Parse(parsedManager, scene);
                tempMorphTargetManagerIndexContainer[parsedManager.id] = manager;
                container.morphTargetManagers.push(manager);
                manager._parentContainer = container;
            }
        }
        // Skeletons
        if (parsedData.skeletons !== undefined && parsedData.skeletons !== null) {
            for (index = 0, cache = parsedData.skeletons.length; index < cache; index++) {
                const parsedSkeleton = parsedData.skeletons[index];
                const skeleton = Bones_skeleton/* Skeleton */.E.Parse(parsedSkeleton, scene);
                container.skeletons.push(skeleton);
                skeleton._parentContainer = container;
                log += index === 0 ? "\n\tSkeletons:" : "";
                log += "\n\t\t" + skeleton.toString(fullDetails);
            }
        }
        // Geometries
        const geometries = parsedData.geometries;
        if (geometries !== undefined && geometries !== null) {
            const addedGeometry = new Array();
            // VertexData
            const vertexData = geometries.vertexData;
            if (vertexData !== undefined && vertexData !== null) {
                for (index = 0, cache = vertexData.length; index < cache; index++) {
                    const parsedVertexData = vertexData[index];
                    addedGeometry.push(geometry/* Geometry */.V.Parse(parsedVertexData, scene, rootUrl));
                }
            }
            addedGeometry.forEach((g) => {
                if (g) {
                    container.geometries.push(g);
                    g._parentContainer = container;
                }
            });
        }
        // Transform nodes
        if (parsedData.transformNodes !== undefined && parsedData.transformNodes !== null) {
            for (index = 0, cache = parsedData.transformNodes.length; index < cache; index++) {
                const parsedTransformNode = parsedData.transformNodes[index];
                const node = Meshes_transformNode/* TransformNode */.V.Parse(parsedTransformNode, scene, rootUrl);
                tempIndexContainer[parsedTransformNode.uniqueId] = node;
                container.transformNodes.push(node);
                node._parentContainer = container;
            }
        }
        // Meshes
        if (parsedData.meshes !== undefined && parsedData.meshes !== null) {
            for (index = 0, cache = parsedData.meshes.length; index < cache; index++) {
                const parsedMesh = parsedData.meshes[index];
                const mesh = Meshes_mesh/* Mesh */.e.Parse(parsedMesh, scene, rootUrl);
                tempIndexContainer[parsedMesh.uniqueId] = mesh;
                container.meshes.push(mesh);
                mesh._parentContainer = container;
                if (mesh.hasInstances) {
                    for (const instance of mesh.instances) {
                        container.meshes.push(instance);
                        instance._parentContainer = container;
                    }
                }
                log += index === 0 ? "\n\tMeshes:" : "";
                log += "\n\t\t" + mesh.toString(fullDetails);
            }
        }
        // Cameras
        if (parsedData.cameras !== undefined && parsedData.cameras !== null) {
            for (index = 0, cache = parsedData.cameras.length; index < cache; index++) {
                const parsedCamera = parsedData.cameras[index];
                const camera = Cameras_camera/* Camera */.i.Parse(parsedCamera, scene);
                tempIndexContainer[parsedCamera.uniqueId] = camera;
                container.cameras.push(camera);
                camera._parentContainer = container;
                log += index === 0 ? "\n\tCameras:" : "";
                log += "\n\t\t" + camera.toString(fullDetails);
            }
        }
        // Postprocesses
        if (parsedData.postProcesses !== undefined && parsedData.postProcesses !== null) {
            for (index = 0, cache = parsedData.postProcesses.length; index < cache; index++) {
                const parsedPostProcess = parsedData.postProcesses[index];
                const postProcess = PostProcesses_postProcess/* PostProcess */.w.Parse(parsedPostProcess, scene, rootUrl);
                if (postProcess) {
                    container.postProcesses.push(postProcess);
                    postProcess._parentContainer = container;
                    log += index === 0 ? "\nPostprocesses:" : "";
                    log += "\n\t\t" + postProcess.toString();
                }
            }
        }
        // Animation Groups
        if (parsedData.animationGroups !== undefined && parsedData.animationGroups !== null) {
            for (index = 0, cache = parsedData.animationGroups.length; index < cache; index++) {
                const parsedAnimationGroup = parsedData.animationGroups[index];
                const animationGroup = Animations_animationGroup.AnimationGroup.Parse(parsedAnimationGroup, scene);
                container.animationGroups.push(animationGroup);
                animationGroup._parentContainer = container;
                log += index === 0 ? "\n\tAnimationGroups:" : "";
                log += "\n\t\t" + animationGroup.toString(fullDetails);
            }
        }
        // Sprites
        if (parsedData.spriteManagers) {
            for (let index = 0, cache = parsedData.spriteManagers.length; index < cache; index++) {
                const parsedSpriteManager = parsedData.spriteManagers[index];
                const spriteManager = SpriteManager.Parse(parsedSpriteManager, scene, rootUrl);
                log += "\n\t\tSpriteManager " + spriteManager.name;
            }
        }
        // Browsing all the graph to connect the dots
        for (index = 0, cache = scene.cameras.length; index < cache; index++) {
            const camera = scene.cameras[index];
            if (camera._waitingParentId !== null) {
                camera.parent = findParent(camera._waitingParentId, camera._waitingParentInstanceIndex, scene);
                camera._waitingParentId = null;
                camera._waitingParentInstanceIndex = null;
            }
        }
        for (index = 0, cache = scene.lights.length; index < cache; index++) {
            const light = scene.lights[index];
            if (light && light._waitingParentId !== null) {
                light.parent = findParent(light._waitingParentId, light._waitingParentInstanceIndex, scene);
                light._waitingParentId = null;
                light._waitingParentInstanceIndex = null;
            }
        }
        // Connect parents & children and parse actions and lods
        for (index = 0, cache = scene.transformNodes.length; index < cache; index++) {
            const transformNode = scene.transformNodes[index];
            if (transformNode._waitingParentId !== null) {
                transformNode.parent = findParent(transformNode._waitingParentId, transformNode._waitingParentInstanceIndex, scene);
                transformNode._waitingParentId = null;
                transformNode._waitingParentInstanceIndex = null;
            }
        }
        for (index = 0, cache = scene.meshes.length; index < cache; index++) {
            const mesh = scene.meshes[index];
            if (mesh._waitingParentId !== null) {
                mesh.parent = findParent(mesh._waitingParentId, mesh._waitingParentInstanceIndex, scene);
                mesh._waitingParentId = null;
                mesh._waitingParentInstanceIndex = null;
            }
            if (mesh._waitingData.lods) {
                loadDetailLevels(scene, mesh);
            }
        }
        // link multimats with materials
        scene.multiMaterials.forEach((multimat) => {
            multimat._waitingSubMaterialsUniqueIds.forEach((subMaterial) => {
                multimat.subMaterials.push(findMaterial(subMaterial, scene));
            });
            multimat._waitingSubMaterialsUniqueIds = [];
        });
        // link meshes with materials
        scene.meshes.forEach((mesh) => {
            if (mesh._waitingMaterialId !== null) {
                mesh.material = findMaterial(mesh._waitingMaterialId, scene);
                mesh._waitingMaterialId = null;
            }
        });
        // link meshes with morph target managers
        scene.meshes.forEach((mesh) => {
            if (mesh._waitingMorphTargetManagerId !== null) {
                mesh.morphTargetManager = tempMorphTargetManagerIndexContainer[mesh._waitingMorphTargetManagerId];
                mesh._waitingMorphTargetManagerId = null;
            }
        });
        // link skeleton transform nodes
        for (index = 0, cache = scene.skeletons.length; index < cache; index++) {
            const skeleton = scene.skeletons[index];
            if (skeleton._hasWaitingData) {
                if (skeleton.bones != null) {
                    skeleton.bones.forEach((bone) => {
                        if (bone._waitingTransformNodeId) {
                            const linkTransformNode = scene.getLastEntryById(bone._waitingTransformNodeId);
                            if (linkTransformNode) {
                                bone.linkTransformNode(linkTransformNode);
                            }
                            bone._waitingTransformNodeId = null;
                        }
                    });
                }
                skeleton._hasWaitingData = null;
            }
        }
        // freeze world matrix application
        for (index = 0, cache = scene.meshes.length; index < cache; index++) {
            const currentMesh = scene.meshes[index];
            if (currentMesh._waitingData.freezeWorldMatrix) {
                currentMesh.freezeWorldMatrix();
                currentMesh._waitingData.freezeWorldMatrix = null;
            }
            else {
                currentMesh.computeWorldMatrix(true);
            }
        }
        // Lights exclusions / inclusions
        for (index = 0, cache = scene.lights.length; index < cache; index++) {
            const light = scene.lights[index];
            // Excluded check
            if (light._excludedMeshesIds.length > 0) {
                for (let excludedIndex = 0; excludedIndex < light._excludedMeshesIds.length; excludedIndex++) {
                    const excludedMesh = scene.getMeshById(light._excludedMeshesIds[excludedIndex]);
                    if (excludedMesh) {
                        light.excludedMeshes.push(excludedMesh);
                    }
                }
                light._excludedMeshesIds = [];
            }
            // Included check
            if (light._includedOnlyMeshesIds.length > 0) {
                for (let includedOnlyIndex = 0; includedOnlyIndex < light._includedOnlyMeshesIds.length; includedOnlyIndex++) {
                    const includedOnlyMesh = scene.getMeshById(light._includedOnlyMeshesIds[includedOnlyIndex]);
                    if (includedOnlyMesh) {
                        light.includedOnlyMeshes.push(includedOnlyMesh);
                    }
                }
                light._includedOnlyMeshesIds = [];
            }
        }
        scene.geometries.forEach((g) => {
            g._loadedUniqueId = "";
        });
        (0,babylonFileParser_function/* Parse */.oj)(parsedData, scene, container, rootUrl);
        // Actions (scene) Done last as it can access other objects.
        for (index = 0, cache = scene.meshes.length; index < cache; index++) {
            const mesh = scene.meshes[index];
            if (mesh._waitingData.actions) {
                ActionManager.Parse(mesh._waitingData.actions, mesh, scene);
                mesh._waitingData.actions = null;
            }
        }
        if (parsedData.actions !== undefined && parsedData.actions !== null) {
            ActionManager.Parse(parsedData.actions, null, scene);
        }
    }
    catch (err) {
        const msg = logOperation("loadAssets", parsedData ? parsedData.producer : "Unknown") + log;
        if (onError) {
            onError(msg, err);
        }
        else {
            logger/* Logger */.V.Log(msg);
            throw err;
        }
    }
    finally {
        tempIndexContainer = {};
        tempMaterialIndexContainer = {};
        tempMorphTargetManagerIndexContainer = {};
        if (!addToScene) {
            container.removeAllFromScene();
        }
        if (log !== null && sceneLoader/* SceneLoader */.cn.loggingLevel !== sceneLoader/* SceneLoader */.cn.NO_LOGGING) {
            logger/* Logger */.V.Log(logOperation("loadAssets", parsedData ? parsedData.producer : "Unknown") + (sceneLoader/* SceneLoader */.cn.loggingLevel !== sceneLoader/* SceneLoader */.cn.MINIMAL_LOGGING ? log : ""));
        }
    }
    return container;
};
sceneLoader/* SceneLoader */.cn.RegisterPlugin({
    name: "babylon.js",
    extensions: ".babylon",
    canDirectLoad: (data) => {
        if (data.indexOf("babylon") !== -1) {
            // We consider that the producer string is filled
            return true;
        }
        return false;
    },
    importMesh: (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons, onError) => {
        // Entire method running in try block, so ALWAYS logs as far as it got, only actually writes details
        // when SceneLoader.debugLogging = true (default), or exception encountered.
        // Everything stored in var log instead of writing separate lines to support only writing in exception,
        // and avoid problems with multiple concurrent .babylon loads.
        let log = "importMesh has failed JSON parse";
        try {
            // eslint-disable-next-line no-var
            var parsedData = JSON.parse(data);
            log = "";
            const fullDetails = sceneLoader/* SceneLoader */.cn.loggingLevel === sceneLoader/* SceneLoader */.cn.DETAILED_LOGGING;
            if (!meshesNames) {
                meshesNames = null;
            }
            else if (!Array.isArray(meshesNames)) {
                meshesNames = [meshesNames];
            }
            const hierarchyIds = [];
            const parsedIdToNodeMap = new Map();
            // Transform nodes (the overall idea is to load all of them as this is super fast and then get rid of the ones we don't need)
            const loadedTransformNodes = [];
            if (parsedData.transformNodes !== undefined && parsedData.transformNodes !== null) {
                for (let index = 0, cache = parsedData.transformNodes.length; index < cache; index++) {
                    const parsedJSONTransformNode = parsedData.transformNodes[index];
                    const parsedTransformNode = Meshes_transformNode/* TransformNode */.V.Parse(parsedJSONTransformNode, scene, rootUrl);
                    loadedTransformNodes.push(parsedTransformNode);
                    parsedIdToNodeMap.set(parsedTransformNode._waitingParsedUniqueId, parsedTransformNode);
                    parsedTransformNode._waitingParsedUniqueId = null;
                }
            }
            if (parsedData.meshes !== undefined && parsedData.meshes !== null) {
                const loadedSkeletonsIds = [];
                const loadedMaterialsIds = [];
                const loadedMaterialsUniqueIds = [];
                const loadedMorphTargetManagerIds = [];
                for (let index = 0, cache = parsedData.meshes.length; index < cache; index++) {
                    const parsedMesh = parsedData.meshes[index];
                    if (meshesNames === null || isDescendantOf(parsedMesh, meshesNames, hierarchyIds)) {
                        if (meshesNames !== null) {
                            // Remove found mesh name from list.
                            delete meshesNames[meshesNames.indexOf(parsedMesh.name)];
                        }
                        //Geometry?
                        if (parsedMesh.geometryId !== undefined && parsedMesh.geometryId !== null) {
                            //does the file contain geometries?
                            if (parsedData.geometries !== undefined && parsedData.geometries !== null) {
                                //find the correct geometry and add it to the scene
                                let found = false;
                                ["boxes", "spheres", "cylinders", "toruses", "grounds", "planes", "torusKnots", "vertexData"].forEach((geometryType) => {
                                    if (found === true || !parsedData.geometries[geometryType] || !Array.isArray(parsedData.geometries[geometryType])) {
                                        return;
                                    }
                                    else {
                                        parsedData.geometries[geometryType].forEach((parsedGeometryData) => {
                                            if (parsedGeometryData.id === parsedMesh.geometryId) {
                                                switch (geometryType) {
                                                    case "vertexData":
                                                        geometry/* Geometry */.V.Parse(parsedGeometryData, scene, rootUrl);
                                                        break;
                                                }
                                                found = true;
                                            }
                                        });
                                    }
                                });
                                if (found === false) {
                                    logger/* Logger */.V.Warn("Geometry not found for mesh " + parsedMesh.id);
                                }
                            }
                        }
                        // Material ?
                        if (parsedMesh.materialUniqueId || parsedMesh.materialId) {
                            // if we have a unique ID, look up and store in loadedMaterialsUniqueIds, else use loadedMaterialsIds
                            const materialArray = parsedMesh.materialUniqueId ? loadedMaterialsUniqueIds : loadedMaterialsIds;
                            let materialFound = materialArray.indexOf(parsedMesh.materialUniqueId || parsedMesh.materialId) !== -1;
                            if (materialFound === false && parsedData.multiMaterials !== undefined && parsedData.multiMaterials !== null) {
                                // Loads a submaterial of a multimaterial
                                const loadSubMaterial = (subMatId, predicate) => {
                                    materialArray.push(subMatId);
                                    const mat = parseMaterialByPredicate(predicate, parsedData, scene, rootUrl);
                                    if (mat && mat.material) {
                                        tempMaterialIndexContainer[mat.parsedMaterial.uniqueId || mat.parsedMaterial.id] = mat.material;
                                        log += "\n\tMaterial " + mat.material.toString(fullDetails);
                                    }
                                };
                                for (let multimatIndex = 0, multimatCache = parsedData.multiMaterials.length; multimatIndex < multimatCache; multimatIndex++) {
                                    const parsedMultiMaterial = parsedData.multiMaterials[multimatIndex];
                                    if ((parsedMesh.materialUniqueId && parsedMultiMaterial.uniqueId === parsedMesh.materialUniqueId) ||
                                        parsedMultiMaterial.id === parsedMesh.materialId) {
                                        if (parsedMultiMaterial.materialsUniqueIds) {
                                            // if the materials inside the multimat are stored by unique id
                                            parsedMultiMaterial.materialsUniqueIds.forEach((subMatId) => loadSubMaterial(subMatId, (parsedMaterial) => parsedMaterial.uniqueId === subMatId));
                                        }
                                        else {
                                            // if the mats are stored by id instead
                                            parsedMultiMaterial.materials.forEach((subMatId) => loadSubMaterial(subMatId, (parsedMaterial) => parsedMaterial.id === subMatId));
                                        }
                                        materialArray.push(parsedMultiMaterial.uniqueId || parsedMultiMaterial.id);
                                        const mmat = Materials_multiMaterial/* MultiMaterial */.F.ParseMultiMaterial(parsedMultiMaterial, scene);
                                        tempMaterialIndexContainer[parsedMultiMaterial.uniqueId || parsedMultiMaterial.id] = mmat;
                                        if (mmat) {
                                            materialFound = true;
                                            log += "\n\tMulti-Material " + mmat.toString(fullDetails);
                                        }
                                        break;
                                    }
                                }
                            }
                            if (materialFound === false) {
                                materialArray.push(parsedMesh.materialUniqueId || parsedMesh.materialId);
                                const mat = parseMaterialByPredicate((parsedMaterial) => (parsedMesh.materialUniqueId && parsedMaterial.uniqueId === parsedMesh.materialUniqueId) || parsedMaterial.id === parsedMesh.materialId, parsedData, scene, rootUrl);
                                if (!mat || !mat.material) {
                                    logger/* Logger */.V.Warn("Material not found for mesh " + parsedMesh.id);
                                }
                                else {
                                    tempMaterialIndexContainer[mat.parsedMaterial.uniqueId || mat.parsedMaterial.id] = mat.material;
                                    log += "\n\tMaterial " + mat.material.toString(fullDetails);
                                }
                            }
                        }
                        // Skeleton ?
                        if (parsedMesh.skeletonId !== null &&
                            parsedMesh.skeletonId !== undefined &&
                            parsedData.skeletonId !== -1 &&
                            parsedData.skeletons !== undefined &&
                            parsedData.skeletons !== null) {
                            const skeletonAlreadyLoaded = loadedSkeletonsIds.indexOf(parsedMesh.skeletonId) > -1;
                            if (!skeletonAlreadyLoaded) {
                                for (let skeletonIndex = 0, skeletonCache = parsedData.skeletons.length; skeletonIndex < skeletonCache; skeletonIndex++) {
                                    const parsedSkeleton = parsedData.skeletons[skeletonIndex];
                                    if (parsedSkeleton.id === parsedMesh.skeletonId) {
                                        const skeleton = Bones_skeleton/* Skeleton */.E.Parse(parsedSkeleton, scene);
                                        skeletons.push(skeleton);
                                        loadedSkeletonsIds.push(parsedSkeleton.id);
                                        log += "\n\tSkeleton " + skeleton.toString(fullDetails);
                                    }
                                }
                            }
                        }
                        // Morph targets ?
                        if (parsedMesh.morphTargetManagerId > -1 && parsedData.morphTargetManagers !== undefined && parsedData.morphTargetManagers !== null) {
                            const morphTargetManagerAlreadyLoaded = loadedMorphTargetManagerIds.indexOf(parsedMesh.morphTargetManagerId) > -1;
                            if (!morphTargetManagerAlreadyLoaded) {
                                for (let morphTargetManagerIndex = 0; morphTargetManagerIndex < parsedData.morphTargetManagers.length; morphTargetManagerIndex++) {
                                    const parsedManager = parsedData.morphTargetManagers[morphTargetManagerIndex];
                                    if (parsedManager.id === parsedMesh.morphTargetManagerId) {
                                        const morphTargetManager = Morph_morphTargetManager/* MorphTargetManager */.j.Parse(parsedManager, scene);
                                        tempMorphTargetManagerIndexContainer[parsedManager.id] = morphTargetManager;
                                        loadedMorphTargetManagerIds.push(parsedManager.id);
                                        log += "\nMorph target manager" + morphTargetManager.toString();
                                    }
                                }
                            }
                        }
                        const mesh = Meshes_mesh/* Mesh */.e.Parse(parsedMesh, scene, rootUrl);
                        meshes.push(mesh);
                        parsedIdToNodeMap.set(mesh._waitingParsedUniqueId, mesh);
                        mesh._waitingParsedUniqueId = null;
                        log += "\n\tMesh " + mesh.toString(fullDetails);
                    }
                }
                // link multimats with materials
                scene.multiMaterials.forEach((multimat) => {
                    multimat._waitingSubMaterialsUniqueIds.forEach((subMaterial) => {
                        multimat.subMaterials.push(findMaterial(subMaterial, scene));
                    });
                    multimat._waitingSubMaterialsUniqueIds = [];
                });
                // link meshes with materials
                scene.meshes.forEach((mesh) => {
                    if (mesh._waitingMaterialId !== null) {
                        mesh.material = findMaterial(mesh._waitingMaterialId, scene);
                        mesh._waitingMaterialId = null;
                    }
                });
                // link meshes with morph target managers
                scene.meshes.forEach((mesh) => {
                    if (mesh._waitingMorphTargetManagerId !== null) {
                        mesh.morphTargetManager = tempMorphTargetManagerIndexContainer[mesh._waitingMorphTargetManagerId];
                        mesh._waitingMorphTargetManagerId = null;
                    }
                });
                // Connecting parents and lods
                for (let index = 0, cache = scene.transformNodes.length; index < cache; index++) {
                    const transformNode = scene.transformNodes[index];
                    if (transformNode._waitingParentId !== null) {
                        let parent = parsedIdToNodeMap.get(parseInt(transformNode._waitingParentId)) || null;
                        if (parent === null) {
                            parent = scene.getLastEntryById(transformNode._waitingParentId);
                        }
                        let parentNode = parent;
                        if (transformNode._waitingParentInstanceIndex) {
                            parentNode = parent.instances[parseInt(transformNode._waitingParentInstanceIndex)];
                            transformNode._waitingParentInstanceIndex = null;
                        }
                        transformNode.parent = parentNode;
                        transformNode._waitingParentId = null;
                    }
                }
                let currentMesh;
                for (let index = 0, cache = scene.meshes.length; index < cache; index++) {
                    currentMesh = scene.meshes[index];
                    if (currentMesh._waitingParentId) {
                        let parent = parsedIdToNodeMap.get(parseInt(currentMesh._waitingParentId)) || null;
                        if (parent === null) {
                            parent = scene.getLastEntryById(currentMesh._waitingParentId);
                        }
                        let parentNode = parent;
                        if (currentMesh._waitingParentInstanceIndex) {
                            parentNode = parent.instances[parseInt(currentMesh._waitingParentInstanceIndex)];
                            currentMesh._waitingParentInstanceIndex = null;
                        }
                        currentMesh.parent = parentNode;
                        currentMesh._waitingParentId = null;
                    }
                    if (currentMesh._waitingData.lods) {
                        loadDetailLevels(scene, currentMesh);
                    }
                }
                // Remove unused transform nodes
                for (const transformNode of loadedTransformNodes) {
                    const childMeshes = transformNode.getChildMeshes(false);
                    if (!childMeshes.length) {
                        transformNode.dispose();
                    }
                }
                // link skeleton transform nodes
                for (let index = 0, cache = scene.skeletons.length; index < cache; index++) {
                    const skeleton = scene.skeletons[index];
                    if (skeleton._hasWaitingData) {
                        if (skeleton.bones != null) {
                            skeleton.bones.forEach((bone) => {
                                if (bone._waitingTransformNodeId) {
                                    const linkTransformNode = scene.getLastEntryById(bone._waitingTransformNodeId);
                                    if (linkTransformNode) {
                                        bone.linkTransformNode(linkTransformNode);
                                    }
                                    bone._waitingTransformNodeId = null;
                                }
                            });
                        }
                        skeleton._hasWaitingData = null;
                    }
                }
                // freeze and compute world matrix application
                for (let index = 0, cache = scene.meshes.length; index < cache; index++) {
                    currentMesh = scene.meshes[index];
                    if (currentMesh._waitingData.freezeWorldMatrix) {
                        currentMesh.freezeWorldMatrix();
                        currentMesh._waitingData.freezeWorldMatrix = null;
                    }
                    else {
                        currentMesh.computeWorldMatrix(true);
                    }
                }
            }
            // Particles
            if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) {
                const parser = (0,babylonFileParser_function/* GetIndividualParser */.LO)(sceneComponent/* SceneComponentConstants */.v.NAME_PARTICLESYSTEM);
                if (parser) {
                    for (let index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {
                        const parsedParticleSystem = parsedData.particleSystems[index];
                        if (hierarchyIds.indexOf(parsedParticleSystem.emitterId) !== -1) {
                            particleSystems.push(parser(parsedParticleSystem, scene, rootUrl));
                        }
                    }
                }
            }
            scene.geometries.forEach((g) => {
                g._loadedUniqueId = "";
            });
            return true;
        }
        catch (err) {
            const msg = logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + log;
            if (onError) {
                onError(msg, err);
            }
            else {
                logger/* Logger */.V.Log(msg);
                throw err;
            }
        }
        finally {
            if (log !== null && sceneLoader/* SceneLoader */.cn.loggingLevel !== sceneLoader/* SceneLoader */.cn.NO_LOGGING) {
                logger/* Logger */.V.Log(logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + (sceneLoader/* SceneLoader */.cn.loggingLevel !== sceneLoader/* SceneLoader */.cn.MINIMAL_LOGGING ? log : ""));
            }
            tempMaterialIndexContainer = {};
            tempMorphTargetManagerIndexContainer = {};
        }
        return false;
    },
    load: (scene, data, rootUrl, onError) => {
        // Entire method running in try block, so ALWAYS logs as far as it got, only actually writes details
        // when SceneLoader.debugLogging = true (default), or exception encountered.
        // Everything stored in var log instead of writing separate lines to support only writing in exception,
        // and avoid problems with multiple concurrent .babylon loads.
        let log = "importScene has failed JSON parse";
        try {
            // eslint-disable-next-line no-var
            var parsedData = JSON.parse(data);
            log = "";
            // Scene
            if (parsedData.useDelayedTextureLoading !== undefined && parsedData.useDelayedTextureLoading !== null) {
                scene.useDelayedTextureLoading = parsedData.useDelayedTextureLoading && !sceneLoader/* SceneLoader */.cn.ForceFullSceneLoadingForIncremental;
            }
            if (parsedData.autoClear !== undefined && parsedData.autoClear !== null) {
                scene.autoClear = parsedData.autoClear;
            }
            if (parsedData.clearColor !== undefined && parsedData.clearColor !== null) {
                scene.clearColor = math_color/* Color4 */.ov.FromArray(parsedData.clearColor);
            }
            if (parsedData.ambientColor !== undefined && parsedData.ambientColor !== null) {
                scene.ambientColor = math_color/* Color3 */.v9.FromArray(parsedData.ambientColor);
            }
            if (parsedData.gravity !== undefined && parsedData.gravity !== null) {
                scene.gravity = math_vector/* Vector3 */.Pq.FromArray(parsedData.gravity);
            }
            if (parsedData.useRightHandedSystem !== undefined) {
                scene.useRightHandedSystem = !!parsedData.useRightHandedSystem;
            }
            // Fog
            if (parsedData.fogMode !== undefined && parsedData.fogMode !== null) {
                scene.fogMode = parsedData.fogMode;
            }
            if (parsedData.fogColor !== undefined && parsedData.fogColor !== null) {
                scene.fogColor = math_color/* Color3 */.v9.FromArray(parsedData.fogColor);
            }
            if (parsedData.fogStart !== undefined && parsedData.fogStart !== null) {
                scene.fogStart = parsedData.fogStart;
            }
            if (parsedData.fogEnd !== undefined && parsedData.fogEnd !== null) {
                scene.fogEnd = parsedData.fogEnd;
            }
            if (parsedData.fogDensity !== undefined && parsedData.fogDensity !== null) {
                scene.fogDensity = parsedData.fogDensity;
            }
            log += "\tFog mode for scene:  ";
            switch (scene.fogMode) {
                case 0:
                    log += "none\n";
                    break;
                // getters not compiling, so using hardcoded
                case 1:
                    log += "exp\n";
                    break;
                case 2:
                    log += "exp2\n";
                    break;
                case 3:
                    log += "linear\n";
                    break;
            }
            //Physics
            if (parsedData.physicsEnabled) {
                let physicsPlugin;
                if (parsedData.physicsEngine === "cannon" || parsedData.physicsEngine === CannonJSPlugin.name) {
                    physicsPlugin = new CannonJSPlugin(undefined, undefined, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine);
                }
                else if (parsedData.physicsEngine === "oimo" || parsedData.physicsEngine === OimoJSPlugin.name) {
                    physicsPlugin = new OimoJSPlugin(undefined, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine);
                }
                else if (parsedData.physicsEngine === "ammo" || parsedData.physicsEngine === AmmoJSPlugin.name) {
                    physicsPlugin = new AmmoJSPlugin(undefined, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine, undefined);
                }
                log = "\tPhysics engine " + (parsedData.physicsEngine ? parsedData.physicsEngine : "oimo") + " enabled\n";
                //else - default engine, which is currently oimo
                const physicsGravity = parsedData.gravity ? math_vector/* Vector3 */.Pq.FromArray(parsedData.gravity) : parsedData.physicsGravity ? math_vector/* Vector3 */.Pq.FromArray(parsedData.physicsGravity) : null;
                scene.enablePhysics(physicsGravity, physicsPlugin);
            }
            // Metadata
            if (parsedData.metadata !== undefined && parsedData.metadata !== null) {
                scene.metadata = parsedData.metadata;
            }
            //collisions, if defined. otherwise, default is true
            if (parsedData.collisionsEnabled !== undefined && parsedData.collisionsEnabled !== null) {
                scene.collisionsEnabled = parsedData.collisionsEnabled;
            }
            const container = loadAssetContainer(scene, data, rootUrl, onError, true);
            if (!container) {
                return false;
            }
            if (parsedData.autoAnimate) {
                scene.beginAnimation(scene, parsedData.autoAnimateFrom, parsedData.autoAnimateTo, parsedData.autoAnimateLoop, parsedData.autoAnimateSpeed || 1.0);
            }
            if (parsedData.activeCameraID !== undefined && parsedData.activeCameraID !== null) {
                scene.setActiveCameraById(parsedData.activeCameraID);
            }
            // Finish
            return true;
        }
        catch (err) {
            const msg = logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + log;
            if (onError) {
                onError(msg, err);
            }
            else {
                logger/* Logger */.V.Log(msg);
                throw err;
            }
        }
        finally {
            if (log !== null && sceneLoader/* SceneLoader */.cn.loggingLevel !== sceneLoader/* SceneLoader */.cn.NO_LOGGING) {
                logger/* Logger */.V.Log(logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + (sceneLoader/* SceneLoader */.cn.loggingLevel !== sceneLoader/* SceneLoader */.cn.MINIMAL_LOGGING ? log : ""));
            }
        }
        return false;
    },
    loadAssetContainer: (scene, data, rootUrl, onError) => {
        const container = loadAssetContainer(scene, data, rootUrl, onError);
        return container;
    },
});
//# sourceMappingURL=babylonFileLoader.js.map
;// ./node_modules/@babylonjs/core/Loading/Plugins/index.js


//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Loading/sceneLoaderFlags.js
var sceneLoaderFlags = __webpack_require__(7597);
;// ./node_modules/@babylonjs/core/Loading/index.js
/* eslint-disable import/no-internal-modules */




//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/background.vertex.js
var background_vertex = __webpack_require__(35616);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/background.fragment.js
var background_fragment = __webpack_require__(81018);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/background.vertex.js + 1 modules
var Shaders_background_vertex = __webpack_require__(11114);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/background.fragment.js + 1 modules
var Shaders_background_fragment = __webpack_require__(94476);
;// ./node_modules/@babylonjs/core/Materials/Background/index.js

// async-loaded shaders
// backgroundMaterial




//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/colorCurves.js
var colorCurves = __webpack_require__(35198);
;// ./node_modules/@babylonjs/core/Materials/iEffectFallbacks.js

//# sourceMappingURL=iEffectFallbacks.js.map
;// ./node_modules/@babylonjs/core/Materials/fresnelParameters.js





/**
 * This represents all the required information to add a fresnel effect on a material:
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/fresnelParameters
 */
class FresnelParameters {
    /**
     * Define if the fresnel effect is enable or not.
     */
    get isEnabled() {
        return this._isEnabled;
    }
    set isEnabled(value) {
        if (this._isEnabled === value) {
            return;
        }
        this._isEnabled = value;
        abstractEngine/* AbstractEngine */.$.MarkAllMaterialsAsDirty(4 | 16);
    }
    /**
     * Creates a new FresnelParameters object.
     *
     * @param options provide your own settings to optionally to override defaults
     */
    constructor(options = {}) {
        this._isEnabled = true;
        this.bias = options.bias === undefined ? 0 : options.bias;
        this.power = options.power === undefined ? 1 : options.power;
        this.leftColor = options.leftColor || math_color/* Color3 */.v9.White();
        this.rightColor = options.rightColor || math_color/* Color3 */.v9.Black();
        if (options.isEnabled === false) {
            this.isEnabled = false;
        }
    }
    /**
     * Clones the current fresnel and its values
     * @returns a clone fresnel configuration
     */
    clone() {
        const newFresnelParameters = new FresnelParameters();
        deepCopier/* DeepCopier */.r.DeepCopy(this, newFresnelParameters);
        return newFresnelParameters;
    }
    /**
     * Determines equality between FresnelParameters objects
     * @param otherFresnelParameters defines the second operand
     * @returns true if the power, bias, leftColor, rightColor and isEnabled values are equal to the given ones
     */
    equals(otherFresnelParameters) {
        return (otherFresnelParameters &&
            this.bias === otherFresnelParameters.bias &&
            this.power === otherFresnelParameters.power &&
            this.leftColor.equals(otherFresnelParameters.leftColor) &&
            this.rightColor.equals(otherFresnelParameters.rightColor) &&
            this.isEnabled === otherFresnelParameters.isEnabled);
    }
    /**
     * Serializes the current fresnel parameters to a JSON representation.
     * @returns the JSON serialization
     */
    serialize() {
        return {
            isEnabled: this.isEnabled,
            leftColor: this.leftColor.asArray(),
            rightColor: this.rightColor.asArray(),
            bias: this.bias,
            power: this.power,
        };
    }
    /**
     * Parse a JSON object and deserialize it to a new Fresnel parameter object.
     * @param parsedFresnelParameters Define the JSON representation
     * @returns the parsed parameters
     */
    static Parse(parsedFresnelParameters) {
        return new FresnelParameters({
            isEnabled: parsedFresnelParameters.isEnabled,
            leftColor: math_color/* Color3 */.v9.FromArray(parsedFresnelParameters.leftColor),
            rightColor: math_color/* Color3 */.v9.FromArray(parsedFresnelParameters.rightColor),
            bias: parsedFresnelParameters.bias,
            power: parsedFresnelParameters.power || 1.0,
        });
    }
}
// References the dependencies.
decorators_serialization/* SerializationHelper */.p._FresnelParametersParser = FresnelParameters.Parse;
//# sourceMappingURL=fresnelParameters.js.map
;// ./node_modules/@babylonjs/core/Materials/materialHelper.js

/**
 * "Static Class" containing the most commonly used helper while dealing with material for rendering purpose.
 *
 * It contains the basic tools to help defining defines, binding uniform for the common part of the materials.
 *
 * This works by convention in BabylonJS but is meant to be use only with shader following the in place naming rules and conventions.
 */
class MaterialHelper {
}
/**
 * Binds the scene's uniform buffer to the effect.
 * @param effect defines the effect to bind to the scene uniform buffer
 * @param sceneUbo defines the uniform buffer storing scene data
 */
MaterialHelper.BindSceneUniformBuffer = materialHelper_functions/* BindSceneUniformBuffer */._8;
/**
 * Helps preparing the defines values about the UVs in used in the effect.
 * UVs are shared as much as we can across channels in the shaders.
 * @param texture The texture we are preparing the UVs for
 * @param defines The defines to update
 * @param key The channel key "diffuse", "specular"... used in the shader
 */
MaterialHelper.PrepareDefinesForMergedUV = materialHelper_functions/* PrepareDefinesForMergedUV */.YT;
/**
 * Binds a texture matrix value to its corresponding uniform
 * @param texture The texture to bind the matrix for
 * @param uniformBuffer The uniform buffer receiving the data
 * @param key The channel key "diffuse", "specular"... used in the shader
 */
MaterialHelper.BindTextureMatrix = materialHelper_functions/* BindTextureMatrix */.mA;
/**
 * Gets the current status of the fog (should it be enabled?)
 * @param mesh defines the mesh to evaluate for fog support
 * @param scene defines the hosting scene
 * @returns true if fog must be enabled
 */
MaterialHelper.GetFogState = materialHelper_functions/* GetFogState */.qL;
/**
 * Helper used to prepare the list of defines associated with misc. values for shader compilation
 * @param mesh defines the current mesh
 * @param scene defines the current scene
 * @param useLogarithmicDepth defines if logarithmic depth has to be turned on
 * @param pointsCloud defines if point cloud rendering has to be turned on
 * @param fogEnabled defines if fog has to be turned on
 * @param alphaTest defines if alpha testing has to be turned on
 * @param defines defines the current list of defines
 * @param applyDecalAfterDetail Defines if the decal is applied after or before the detail
 */
MaterialHelper.PrepareDefinesForMisc = materialHelper_functions/* PrepareDefinesForMisc */.fm;
/**
 * Helper used to prepare the defines relative to the active camera
 * @param scene defines the current scene
 * @param defines specifies the list of active defines
 * @returns true if the defines have been updated, else false
 */
MaterialHelper.PrepareDefinesForCamera = materialHelper_functions/* PrepareDefinesForCamera */.Y7;
/**
 * Helper used to prepare the list of defines associated with frame values for shader compilation
 * @param scene defines the current scene
 * @param engine defines the current engine
 * @param material defines the material we are compiling the shader for
 * @param defines specifies the list of active defines
 * @param useInstances defines if instances have to be turned on
 * @param useClipPlane defines if clip plane have to be turned on
 * @param useThinInstances defines if thin instances have to be turned on
 */
MaterialHelper.PrepareDefinesForFrameBoundValues = materialHelper_functions/* PrepareDefinesForFrameBoundValues */.OR;
/**
 * Prepares the defines for bones
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 */
MaterialHelper.PrepareDefinesForBones = materialHelper_functions/* PrepareDefinesForBones */.IC;
/**
 * Prepares the defines for morph targets
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 */
MaterialHelper.PrepareDefinesForMorphTargets = materialHelper_functions/* PrepareDefinesForMorphTargets */.Jz;
/**
 * Prepares the defines for baked vertex animation
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 */
MaterialHelper.PrepareDefinesForBakedVertexAnimation = materialHelper_functions/* PrepareDefinesForBakedVertexAnimation */.wu;
/**
 * Prepares the defines used in the shader depending on the attributes data available in the mesh
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 * @param useVertexColor Precise whether vertex colors should be used or not (override mesh info)
 * @param useBones Precise whether bones should be used or not (override mesh info)
 * @param useMorphTargets Precise whether morph targets should be used or not (override mesh info)
 * @param useVertexAlpha Precise whether vertex alpha should be used or not (override mesh info)
 * @param useBakedVertexAnimation Precise whether baked vertex animation should be used or not (override mesh info)
 * @returns false if defines are considered not dirty and have not been checked
 */
MaterialHelper.PrepareDefinesForAttributes = materialHelper_functions/* PrepareDefinesForAttributes */.qB;
/**
 * Prepares the defines related to multiview
 * @param scene The scene we are intending to draw
 * @param defines The defines to update
 */
MaterialHelper.PrepareDefinesForMultiview = materialHelper_functions/* PrepareDefinesForMultiview */.VO;
/**
 * Prepares the defines related to order independant transparency
 * @param scene The scene we are intending to draw
 * @param defines The defines to update
 * @param needAlphaBlending Determines if the material needs alpha blending
 */
MaterialHelper.PrepareDefinesForOIT = materialHelper_functions/* PrepareDefinesForOIT */.Nc;
/**
 * Prepares the defines related to the prepass
 * @param scene The scene we are intending to draw
 * @param defines The defines to update
 * @param canRenderToMRT Indicates if this material renders to several textures in the prepass
 */
MaterialHelper.PrepareDefinesForPrePass = materialHelper_functions/* PrepareDefinesForPrePass */.N4;
/**
 * Prepares the defines related to the light information passed in parameter
 * @param scene The scene we are intending to draw
 * @param mesh The mesh the effect is compiling for
 * @param light The light the effect is compiling for
 * @param lightIndex The index of the light
 * @param defines The defines to update
 * @param specularSupported Specifies whether specular is supported or not (override lights data)
 * @param state Defines the current state regarding what is needed (normals, etc...)
 * @param state.needNormals
 * @param state.needRebuild
 * @param state.shadowEnabled
 * @param state.specularEnabled
 * @param state.lightmapMode
 */
MaterialHelper.PrepareDefinesForLight = materialHelper_functions/* PrepareDefinesForLight */.lo;
/**
 * Prepares the defines related to the light information passed in parameter
 * @param scene The scene we are intending to draw
 * @param mesh The mesh the effect is compiling for
 * @param defines The defines to update
 * @param specularSupported Specifies whether specular is supported or not (override lights data)
 * @param maxSimultaneousLights Specifies how manuy lights can be added to the effect at max
 * @param disableLighting Specifies whether the lighting is disabled (override scene and light)
 * @returns true if normals will be required for the rest of the effect
 */
MaterialHelper.PrepareDefinesForLights = materialHelper_functions/* PrepareDefinesForLights */.az;
/**
 * Prepares the uniforms and samplers list to be used in the effect (for a specific light)
 * @param lightIndex defines the light index
 * @param uniformsList The uniform list
 * @param samplersList The sampler list
 * @param projectedLightTexture defines if projected texture must be used
 * @param uniformBuffersList defines an optional list of uniform buffers
 * @param updateOnlyBuffersList True to only update the uniformBuffersList array
 */
MaterialHelper.PrepareUniformsAndSamplersForLight = materialHelper_functions/* PrepareUniformsAndSamplersForLight */.GD;
/**
 * Prepares the uniforms and samplers list to be used in the effect
 * @param uniformsListOrOptions The uniform names to prepare or an EffectCreationOptions containing the list and extra information
 * @param samplersList The sampler list
 * @param defines The defines helping in the list generation
 * @param maxSimultaneousLights The maximum number of simultaneous light allowed in the effect
 */
MaterialHelper.PrepareUniformsAndSamplersList = materialHelper_functions/* PrepareUniformsAndSamplersList */.Bb;
/**
 * This helps decreasing rank by rank the shadow quality (0 being the highest rank and quality)
 * @param defines The defines to update while falling back
 * @param fallbacks The authorized effect fallbacks
 * @param maxSimultaneousLights The maximum number of lights allowed
 * @param rank the current rank of the Effect
 * @returns The newly affected rank
 */
MaterialHelper.HandleFallbacksForShadows = materialHelper_functions/* HandleFallbacksForShadows */.c4;
/**
 * Prepares the list of attributes required for morph targets according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare the morph targets attributes for
 * @param influencers The number of influencers
 */
MaterialHelper.PrepareAttributesForMorphTargetsInfluencers = materialHelper_functions/* PrepareAttributesForMorphTargetsInfluencers */.MF;
/**
 * Prepares the list of attributes required for morph targets according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare the morph targets attributes for
 * @param defines The current Defines of the effect
 */
MaterialHelper.PrepareAttributesForMorphTargets = materialHelper_functions/* PrepareAttributesForMorphTargets */.IF;
/**
 * Prepares the list of attributes required for baked vertex animations according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare for baked vertex animations
 * @param defines The current Defines of the effect
 */
MaterialHelper.PrepareAttributesForBakedVertexAnimation = materialHelper_functions/* PrepareAttributesForBakedVertexAnimation */.J2;
/**
 * Prepares the list of attributes required for bones according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare the bones attributes for
 * @param defines The current Defines of the effect
 * @param fallbacks The current effect fallback strategy
 */
MaterialHelper.PrepareAttributesForBones = materialHelper_functions/* PrepareAttributesForBones */.ni;
/**
 * Check and prepare the list of attributes required for instances according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param defines The current MaterialDefines of the effect
 */
MaterialHelper.PrepareAttributesForInstances = materialHelper_functions/* PrepareAttributesForInstances */.ER;
/**
 * Add the list of attributes required for instances to the attribs array.
 * @param attribs The current list of supported attribs
 * @param needsPreviousMatrices If the shader needs previous matrices
 */
MaterialHelper.PushAttributesForInstances = materialHelper_functions/* PushAttributesForInstances */.te;
/**
 * Binds the light information to the effect.
 * @param light The light containing the generator
 * @param effect The effect we are binding the data to
 * @param lightIndex The light index in the effect used to render
 */
MaterialHelper.BindLightProperties = materialHelper_functions/* BindLightProperties */.L0;
/**
 * Binds the lights information from the scene to the effect for the given mesh.
 * @param light Light to bind
 * @param lightIndex Light index
 * @param scene The scene where the light belongs to
 * @param effect The effect we are binding the data to
 * @param useSpecular Defines if specular is supported
 * @param receiveShadows Defines if the effect (mesh) we bind the light for receives shadows
 */
MaterialHelper.BindLight = materialHelper_functions/* BindLight */.Kd;
/**
 * Binds the lights information from the scene to the effect for the given mesh.
 * @param scene The scene the lights belongs to
 * @param mesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 * @param defines The generated defines for the effect
 * @param maxSimultaneousLights The maximum number of light that can be bound to the effect
 */
MaterialHelper.BindLights = materialHelper_functions/* BindLights */.RL;
/**
 * Binds the fog information from the scene to the effect for the given mesh.
 * @param scene The scene the lights belongs to
 * @param mesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 * @param linearSpace Defines if the fog effect is applied in linear space
 */
MaterialHelper.BindFogParameters = materialHelper_functions/* BindFogParameters */.Yy;
/**
 * Binds the bones information from the mesh to the effect.
 * @param mesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 * @param prePassConfiguration Configuration for the prepass, in case prepass is activated
 */
MaterialHelper.BindBonesParameters = materialHelper_functions/* BindBonesParameters */.f$;
/**
 * Binds the morph targets information from the mesh to the effect.
 * @param abstractMesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 */
MaterialHelper.BindMorphTargetParameters = materialHelper_functions/* BindMorphTargetParameters */.nR;
/**
 * Binds the logarithmic depth information from the scene to the effect for the given defines.
 * @param defines The generated defines used in the effect
 * @param effect The effect we are binding the data to
 * @param scene The scene we are willing to render with logarithmic scale for
 */
MaterialHelper.BindLogDepth = materialHelper_functions/* BindLogDepth */.DL;
//# sourceMappingURL=materialHelper.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/color.fragment.js
var color_fragment = __webpack_require__(15450);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/color.vertex.js
var color_vertex = __webpack_require__(5216);
;// ./node_modules/@babylonjs/core/Materials/Occlusion/occlusionMaterial.js




/**
 * A material to use for fast depth-only rendering.
 * @since 5.0.0
 */
class OcclusionMaterial extends shaderMaterial/* ShaderMaterial */.B {
    constructor(name, scene) {
        super(name, scene, "color", {
            attributes: ["position"],
            uniforms: ["world", "viewProjection", "color"],
        });
        this.disableColorWrite = true;
        this.forceDepthWrite = true;
        this.setColor4("color", new math_color/* Color4 */.ov(0, 0, 0, 1));
    }
}
//# sourceMappingURL=occlusionMaterial.js.map
;// ./node_modules/@babylonjs/core/Materials/Occlusion/index.js

//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrAnisotropicConfiguration.js
var pbrAnisotropicConfiguration = __webpack_require__(92895);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrBaseMaterial.js
var pbrBaseMaterial = __webpack_require__(1018);
;// ./node_modules/@babylonjs/core/Materials/PBR/pbrBaseSimpleMaterial.js




/**
 * The Physically based simple base material of BJS.
 *
 * This enables better naming and convention enforcements on top of the pbrMaterial.
 * It is used as the base class for both the specGloss and metalRough conventions.
 */
class PBRBaseSimpleMaterial extends pbrBaseMaterial/* PBRBaseMaterial */.d {
    /**
     * Gets the current double sided mode.
     */
    get doubleSided() {
        return this._twoSidedLighting;
    }
    /**
     * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
     */
    set doubleSided(value) {
        if (this._twoSidedLighting === value) {
            return;
        }
        this._twoSidedLighting = value;
        this.backFaceCulling = !value;
        this._markAllSubMeshesAsTexturesDirty();
    }
    /**
     * Instantiates a new PBRMaterial instance.
     *
     * @param name The material name
     * @param scene The scene the material will be use in.
     */
    constructor(name, scene) {
        super(name, scene);
        /**
         * Number of Simultaneous lights allowed on the material.
         */
        this.maxSimultaneousLights = 4;
        /**
         * If sets to true, disables all the lights affecting the material.
         */
        this.disableLighting = false;
        /**
         * If sets to true, x component of normal map value will invert (x = 1.0 - x).
         */
        this.invertNormalMapX = false;
        /**
         * If sets to true, y component of normal map value will invert (y = 1.0 - y).
         */
        this.invertNormalMapY = false;
        /**
         * Emissivie color used to self-illuminate the model.
         */
        this.emissiveColor = new math_color/* Color3 */.v9(0, 0, 0);
        /**
         * Occlusion Channel Strength.
         */
        this.occlusionStrength = 1.0;
        /**
         * If true, the light map contains occlusion information instead of lighting info.
         */
        this.useLightmapAsShadowmap = false;
        this._useAlphaFromAlbedoTexture = true;
        this._useAmbientInGrayScale = true;
    }
    getClassName() {
        return "PBRBaseSimpleMaterial";
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsLightsDirty")
], PBRBaseSimpleMaterial.prototype, "maxSimultaneousLights", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsLightsDirty")
], PBRBaseSimpleMaterial.prototype, "disableLighting", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_reflectionTexture")
], PBRBaseSimpleMaterial.prototype, "environmentTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], PBRBaseSimpleMaterial.prototype, "invertNormalMapX", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], PBRBaseSimpleMaterial.prototype, "invertNormalMapY", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_bumpTexture")
], PBRBaseSimpleMaterial.prototype, "normalTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)("emissive"),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], PBRBaseSimpleMaterial.prototype, "emissiveColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], PBRBaseSimpleMaterial.prototype, "emissiveTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_ambientTextureStrength")
], PBRBaseSimpleMaterial.prototype, "occlusionStrength", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_ambientTexture")
], PBRBaseSimpleMaterial.prototype, "occlusionTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_alphaCutOff")
], PBRBaseSimpleMaterial.prototype, "alphaCutOff", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], PBRBaseSimpleMaterial.prototype, "doubleSided", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", null)
], PBRBaseSimpleMaterial.prototype, "lightmapTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], PBRBaseSimpleMaterial.prototype, "useLightmapAsShadowmap", void 0);
//# sourceMappingURL=pbrBaseSimpleMaterial.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrClearCoatConfiguration.js
var pbrClearCoatConfiguration = __webpack_require__(83670);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrIridescenceConfiguration.js
var pbrIridescenceConfiguration = __webpack_require__(89696);
;// ./node_modules/@babylonjs/core/Materials/PBR/pbrMetallicRoughnessMaterial.js





/**
 * The PBR material of BJS following the metal roughness convention.
 *
 * This fits to the PBR convention in the GLTF definition:
 * https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Archived/KHR_materials_pbrSpecularGlossiness/README.md
 */
class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial {
    /**
     * Instantiates a new PBRMetalRoughnessMaterial instance.
     *
     * @param name The material name
     * @param scene The scene the material will be use in.
     */
    constructor(name, scene) {
        super(name, scene);
        this._useRoughnessFromMetallicTextureAlpha = false;
        this._useRoughnessFromMetallicTextureGreen = true;
        this._useMetallnessFromMetallicTextureBlue = true;
        this.metallic = 1.0;
        this.roughness = 1.0;
    }
    /**
     * @returns the current class name of the material.
     */
    getClassName() {
        return "PBRMetallicRoughnessMaterial";
    }
    /**
     * Makes a duplicate of the current material.
     * @param name - name to use for the new material.
     * @returns cloned material instance
     */
    clone(name) {
        const clone = decorators_serialization/* SerializationHelper */.p.Clone(() => new PBRMetallicRoughnessMaterial(name, this.getScene()), this);
        clone.id = name;
        clone.name = name;
        this.clearCoat.copyTo(clone.clearCoat);
        this.anisotropy.copyTo(clone.anisotropy);
        this.brdf.copyTo(clone.brdf);
        this.sheen.copyTo(clone.sheen);
        this.subSurface.copyTo(clone.subSurface);
        return clone;
    }
    /**
     * Serialize the material to a parsable JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.customType = "BABYLON.PBRMetallicRoughnessMaterial";
        serializationObject.clearCoat = this.clearCoat.serialize();
        serializationObject.anisotropy = this.anisotropy.serialize();
        serializationObject.brdf = this.brdf.serialize();
        serializationObject.sheen = this.sheen.serialize();
        serializationObject.subSurface = this.subSurface.serialize();
        serializationObject.iridescence = this.iridescence.serialize();
        return serializationObject;
    }
    /**
     * Parses a JSON object corresponding to the serialize function.
     * @param source - JSON source object.
     * @param scene - Defines the scene we are parsing for
     * @param rootUrl - Defines the rootUrl of this parsed object
     * @returns a new PBRMetalRoughnessMaterial
     */
    static Parse(source, scene, rootUrl) {
        const material = decorators_serialization/* SerializationHelper */.p.Parse(() => new PBRMetallicRoughnessMaterial(source.name, scene), source, scene, rootUrl);
        if (source.clearCoat) {
            material.clearCoat.parse(source.clearCoat, scene, rootUrl);
        }
        if (source.anisotropy) {
            material.anisotropy.parse(source.anisotropy, scene, rootUrl);
        }
        if (source.brdf) {
            material.brdf.parse(source.brdf, scene, rootUrl);
        }
        if (source.sheen) {
            material.sheen.parse(source.sheen, scene, rootUrl);
        }
        if (source.subSurface) {
            material.subSurface.parse(source.subSurface, scene, rootUrl);
        }
        if (source.iridescence) {
            material.iridescence.parse(source.iridescence, scene, rootUrl);
        }
        return material;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_albedoColor")
], PBRMetallicRoughnessMaterial.prototype, "baseColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_albedoTexture")
], PBRMetallicRoughnessMaterial.prototype, "baseTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMetallicRoughnessMaterial.prototype, "metallic", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], PBRMetallicRoughnessMaterial.prototype, "roughness", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_metallicTexture")
], PBRMetallicRoughnessMaterial.prototype, "metallicRoughnessTexture", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PBRMetallicRoughnessMaterial", PBRMetallicRoughnessMaterial);
//# sourceMappingURL=pbrMetallicRoughnessMaterial.js.map
;// ./node_modules/@babylonjs/core/Materials/PBR/pbrSpecularGlossinessMaterial.js





/**
 * The PBR material of BJS following the specular glossiness convention.
 *
 * This fits to the PBR convention in the GLTF definition:
 * https://github.com/KhronosGroup/glTF/tree/2.0/extensions/Khronos/KHR_materials_pbrSpecularGlossiness
 */
class PBRSpecularGlossinessMaterial extends PBRBaseSimpleMaterial {
    /**
     * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.
     */
    get useMicroSurfaceFromReflectivityMapAlpha() {
        return this._useMicroSurfaceFromReflectivityMapAlpha;
    }
    /**
     * Instantiates a new PBRSpecularGlossinessMaterial instance.
     *
     * @param name The material name
     * @param scene The scene the material will be use in.
     */
    constructor(name, scene) {
        super(name, scene);
        this._useMicroSurfaceFromReflectivityMapAlpha = true;
    }
    /**
     * @returns the current class name of the material.
     */
    getClassName() {
        return "PBRSpecularGlossinessMaterial";
    }
    /**
     * Makes a duplicate of the current material.
     * @param name - name to use for the new material.
     * @returns cloned material instance
     */
    clone(name) {
        const clone = decorators_serialization/* SerializationHelper */.p.Clone(() => new PBRSpecularGlossinessMaterial(name, this.getScene()), this);
        clone.id = name;
        clone.name = name;
        this.clearCoat.copyTo(clone.clearCoat);
        this.anisotropy.copyTo(clone.anisotropy);
        this.brdf.copyTo(clone.brdf);
        this.sheen.copyTo(clone.sheen);
        this.subSurface.copyTo(clone.subSurface);
        return clone;
    }
    /**
     * Serialize the material to a parsable JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.customType = "BABYLON.PBRSpecularGlossinessMaterial";
        serializationObject.clearCoat = this.clearCoat.serialize();
        serializationObject.anisotropy = this.anisotropy.serialize();
        serializationObject.brdf = this.brdf.serialize();
        serializationObject.sheen = this.sheen.serialize();
        serializationObject.subSurface = this.subSurface.serialize();
        serializationObject.iridescence = this.iridescence.serialize();
        return serializationObject;
    }
    /**
     * Parses a JSON object corresponding to the serialize function.
     * @param source - JSON source object.
     * @param scene - the scene to parse to.
     * @param rootUrl - root url of the assets.
     * @returns a new PBRSpecularGlossinessMaterial.
     */
    static Parse(source, scene, rootUrl) {
        const material = decorators_serialization/* SerializationHelper */.p.Parse(() => new PBRSpecularGlossinessMaterial(source.name, scene), source, scene, rootUrl);
        if (source.clearCoat) {
            material.clearCoat.parse(source.clearCoat, scene, rootUrl);
        }
        if (source.anisotropy) {
            material.anisotropy.parse(source.anisotropy, scene, rootUrl);
        }
        if (source.brdf) {
            material.brdf.parse(source.brdf, scene, rootUrl);
        }
        if (source.sheen) {
            material.sheen.parse(source.sheen, scene, rootUrl);
        }
        if (source.subSurface) {
            material.subSurface.parse(source.subSurface, scene, rootUrl);
        }
        if (source.iridescence) {
            material.iridescence.parse(source.iridescence, scene, rootUrl);
        }
        return material;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)("diffuse"),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_albedoColor")
], PBRSpecularGlossinessMaterial.prototype, "diffuseColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_albedoTexture")
], PBRSpecularGlossinessMaterial.prototype, "diffuseTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)("specular"),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_reflectivityColor")
], PBRSpecularGlossinessMaterial.prototype, "specularColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_microSurface")
], PBRSpecularGlossinessMaterial.prototype, "glossiness", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty", "_reflectivityTexture")
], PBRSpecularGlossinessMaterial.prototype, "specularGlossinessTexture", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PBRSpecularGlossinessMaterial", PBRSpecularGlossinessMaterial);
//# sourceMappingURL=pbrSpecularGlossinessMaterial.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrSheenConfiguration.js
var pbrSheenConfiguration = __webpack_require__(84307);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrSubSurfaceConfiguration.js
var pbrSubSurfaceConfiguration = __webpack_require__(86097);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/pbr.vertex.js
var pbr_vertex = __webpack_require__(39174);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/pbr.fragment.js + 32 modules
var pbr_fragment = __webpack_require__(22625);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/pbr.vertex.js + 1 modules
var Shaders_pbr_vertex = __webpack_require__(81448);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/pbr.fragment.js + 32 modules
var Shaders_pbr_fragment = __webpack_require__(84037);
;// ./node_modules/@babylonjs/core/Materials/PBR/index.js










// async-loaded shaders




//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/shaderLanguage.js
/**
 * Language of the shader code
 */
var ShaderLanguage;
(function (ShaderLanguage) {
    /** language is GLSL (used by WebGL) */
    ShaderLanguage[ShaderLanguage["GLSL"] = 0] = "GLSL";
    /** language is WGSL (used by WebGPU) */
    ShaderLanguage[ShaderLanguage["WGSL"] = 1] = "WGSL";
})(ShaderLanguage || (ShaderLanguage = {}));
//# sourceMappingURL=shaderLanguage.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/colorGradingTexture.js




/**
 * This represents a color grading texture. This acts as a lookup table LUT, useful during post process
 * It can help converting any input color in a desired output one. This can then be used to create effects
 * from sepia, black and white to sixties or futuristic rendering...
 *
 * The only supported format is currently 3dl.
 * More information on LUT: https://en.wikipedia.org/wiki/3D_lookup_table
 */
class ColorGradingTexture extends baseTexture/* BaseTexture */.t {
    /**
     * Instantiates a ColorGradingTexture from the following parameters.
     *
     * @param url The location of the color grading data (currently only supporting 3dl)
     * @param sceneOrEngine The scene or engine the texture will be used in
     * @param onLoad defines a callback triggered when the texture has been loaded
     */
    constructor(url, sceneOrEngine, onLoad = null) {
        super(sceneOrEngine);
        if (!url) {
            return;
        }
        this._textureMatrix = math_vector/* Matrix */.uq.Identity();
        this.name = url;
        this.url = url;
        this._onLoad = onLoad;
        this._texture = this._getFromCache(url, true);
        if (!this._texture) {
            const scene = this.getScene();
            if (scene) {
                if (!scene.useDelayedTextureLoading) {
                    this._loadTexture();
                }
                else {
                    this.delayLoadState = 4;
                }
            }
            else {
                this._loadTexture();
            }
        }
        else {
            this._triggerOnLoad();
        }
    }
    /**
     * Fires the onload event from the constructor if requested.
     */
    _triggerOnLoad() {
        if (this._onLoad) {
            this._onLoad();
        }
    }
    /**
     * @returns the texture matrix used in most of the material.
     * This is not used in color grading but keep for troubleshooting purpose (easily swap diffuse by colorgrading to look in).
     */
    getTextureMatrix() {
        return this._textureMatrix;
    }
    /**
     * Occurs when the file being loaded is a .3dl LUT file.
     * @returns the 3D LUT texture
     */
    _load3dlTexture() {
        const engine = this._getEngine();
        let texture;
        if (!engine._features.support3DTextures) {
            texture = engine.createRawTexture(null, 1, 1, 5, false, false, 2, null, 0);
        }
        else {
            texture = engine.createRawTexture3D(null, 1, 1, 1, 5, false, false, 2, null, 0);
        }
        this._texture = texture;
        this._texture.isReady = false;
        this.isCube = false;
        this.is3D = engine._features.support3DTextures;
        this.wrapU = 0;
        this.wrapV = 0;
        this.wrapR = 0;
        this.anisotropicFilteringLevel = 1;
        const callback = (text) => {
            if (typeof text !== "string") {
                return;
            }
            let data = null;
            let tempData = null;
            let line;
            const lines = text.split("\n");
            let size = 0, pixelIndexW = 0, pixelIndexH = 0, pixelIndexSlice = 0;
            let maxColor = 0;
            for (let i = 0; i < lines.length; i++) {
                line = lines[i];
                if (!ColorGradingTexture._NoneEmptyLineRegex.test(line)) {
                    continue;
                }
                if (line.indexOf("#") === 0) {
                    continue;
                }
                const words = line.split(" ");
                if (size === 0) {
                    // Number of space + one
                    size = words.length;
                    data = new Uint8Array(size * size * size * 4); // volume texture of side size and rgb 8
                    tempData = new Float32Array(size * size * size * 4);
                    continue;
                }
                if (size != 0) {
                    const r = Math.max(parseInt(words[0]), 0);
                    const g = Math.max(parseInt(words[1]), 0);
                    const b = Math.max(parseInt(words[2]), 0);
                    maxColor = Math.max(r, maxColor);
                    maxColor = Math.max(g, maxColor);
                    maxColor = Math.max(b, maxColor);
                    const pixelStorageIndex = (pixelIndexW + pixelIndexSlice * size + pixelIndexH * size * size) * 4;
                    if (tempData) {
                        tempData[pixelStorageIndex + 0] = r;
                        tempData[pixelStorageIndex + 1] = g;
                        tempData[pixelStorageIndex + 2] = b;
                    }
                    // Keep for reference in case of back compat problems.
                    // pixelIndexSlice++;
                    // if (pixelIndexSlice % size == 0) {
                    //     pixelIndexH++;
                    //     pixelIndexSlice = 0;
                    //     if (pixelIndexH % size == 0) {
                    //         pixelIndexW++;
                    //         pixelIndexH = 0;
                    //     }
                    // }
                    pixelIndexH++;
                    if (pixelIndexH % size == 0) {
                        pixelIndexSlice++;
                        pixelIndexH = 0;
                        if (pixelIndexSlice % size == 0) {
                            pixelIndexW++;
                            pixelIndexSlice = 0;
                        }
                    }
                }
            }
            if (tempData && data) {
                for (let i = 0; i < tempData.length; i++) {
                    if (i > 0 && (i + 1) % 4 === 0) {
                        data[i] = 255;
                    }
                    else {
                        const value = tempData[i];
                        data[i] = (value / maxColor) * 255;
                    }
                }
            }
            if (texture.is3D) {
                texture.updateSize(size, size, size);
                engine.updateRawTexture3D(texture, data, 5, false);
            }
            else {
                texture.updateSize(size * size, size);
                engine.updateRawTexture(texture, data, 5, false);
            }
            texture.isReady = true;
            this._triggerOnLoad();
        };
        const scene = this.getScene();
        if (scene) {
            scene._loadFile(this.url, callback);
        }
        else {
            engine._loadFile(this.url, callback);
        }
        return this._texture;
    }
    /**
     * Starts the loading process of the texture.
     */
    _loadTexture() {
        if (this.url && this.url.toLocaleLowerCase().indexOf(".3dl") == this.url.length - 4) {
            this._load3dlTexture();
        }
    }
    /**
     * Clones the color grading texture.
     * @returns the cloned texture
     */
    clone() {
        const newTexture = new ColorGradingTexture(this.url, this.getScene() || this._getEngine());
        // Base texture
        newTexture.level = this.level;
        return newTexture;
    }
    /**
     * Called during delayed load for textures.
     */
    delayLoad() {
        if (this.delayLoadState !== 4) {
            return;
        }
        this.delayLoadState = 1;
        this._texture = this._getFromCache(this.url, true);
        if (!this._texture) {
            this._loadTexture();
        }
    }
    /**
     * Parses a color grading texture serialized by Babylon.
     * @param parsedTexture The texture information being parsedTexture
     * @param scene The scene to load the texture in
     * @returns A color grading texture
     */
    static Parse(parsedTexture, scene) {
        let texture = null;
        if (parsedTexture.name && !parsedTexture.isRenderTarget) {
            texture = new ColorGradingTexture(parsedTexture.name, scene);
            texture.name = parsedTexture.name;
            texture.level = parsedTexture.level;
        }
        return texture;
    }
    /**
     * Serializes the LUT texture to json format.
     * @returns The JSON representation of the texture
     */
    serialize() {
        if (!this.name) {
            return null;
        }
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.level = this.level;
        serializationObject.customType = "BABYLON.ColorGradingTexture";
        return serializationObject;
    }
}
/**
 * Empty line regex stored for GC.
 */
ColorGradingTexture._NoneEmptyLineRegex = /\S+/;
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ColorGradingTexture", ColorGradingTexture);
//# sourceMappingURL=colorGradingTexture.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/HighDynamicRange/panoramaToCubemap.js
var panoramaToCubemap = __webpack_require__(73647);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/fileTools.js
var fileTools = __webpack_require__(8532);
;// ./node_modules/@babylonjs/core/Materials/Textures/equiRectangularCubeTexture.js







/**
 * This represents a texture coming from an equirectangular image supported by the web browser canvas.
 */
class EquiRectangularCubeTexture extends baseTexture/* BaseTexture */.t {
    /**
     * Instantiates an EquiRectangularCubeTexture from the following parameters.
     * @param url The location of the image
     * @param scene The scene the texture will be used in
     * @param size The cubemap desired size (the more it increases the longer the generation will be)
     * @param noMipmap Forces to not generate the mipmap if true
     * @param gammaSpace Specifies if the texture will be used in gamma or linear space
     * (the PBR material requires those textures in linear space, but the standard material would require them in Gamma space)
     * @param onLoad — defines a callback called when texture is loaded
     * @param onError — defines a callback called if there is an error
     * @param supersample — defines if texture must be supersampled (default: false)
     */
    constructor(url, scene, size, noMipmap = false, gammaSpace = true, onLoad = null, onError = null, supersample = false) {
        super(scene);
        this._onLoad = null;
        this._onError = null;
        if (!url) {
            throw new Error("Image url is not set");
        }
        this._coordinatesMode = Textures_texture/* Texture */.g.CUBIC_MODE;
        this.name = url;
        this.url = url;
        this._size = size;
        this._supersample = supersample;
        this._noMipmap = noMipmap;
        this.gammaSpace = gammaSpace;
        this._onLoad = onLoad;
        this._onError = onError;
        this.hasAlpha = false;
        this.isCube = true;
        this._texture = this._getFromCache(url, this._noMipmap, undefined, undefined, undefined, this.isCube);
        if (!this._texture) {
            if (!scene.useDelayedTextureLoading) {
                this._loadImage(() => this._loadTexture(), this._onError);
            }
            else {
                this.delayLoadState = 4;
            }
        }
        else if (onLoad) {
            if (this._texture.isReady) {
                tools/* Tools */.S0.SetImmediate(() => onLoad());
            }
            else {
                this._texture.onLoadedObservable.add(onLoad);
            }
        }
    }
    /**
     * Load the image data, by putting the image on a canvas and extracting its buffer.
     * @param loadTextureCallback
     * @param onError
     */
    _loadImage(loadTextureCallback, onError) {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        // Create texture before loading
        const texture = scene
            .getEngine()
            .createRawCubeTexture(null, this._size, 4, scene.getEngine().getCaps().textureFloat ? 1 : 7, !this._noMipmap, false, 3);
        texture.generateMipMaps = !this._noMipmap;
        scene.addPendingData(texture);
        texture.url = this.url;
        texture.isReady = false;
        scene.getEngine()._internalTexturesCache.push(texture);
        this._texture = texture;
        (0,fileTools/* LoadImage */.W$)(this.url, (image) => {
            this._width = image.width;
            this._height = image.height;
            let canvas;
            if ((0,domManagement/* IsDocumentAvailable */.Nf)()) {
                canvas = document.createElement("canvas");
                canvas.width = this._width;
                canvas.height = this._height;
            }
            else {
                // Canvas is not available in the current environment
                canvas = new OffscreenCanvas(this._width, this._height);
            }
            const ctx = canvas.getContext("2d");
            ctx.drawImage(image, 0, 0);
            const imageData = ctx.getImageData(0, 0, image.width, image.height);
            this._buffer = imageData.data.buffer;
            if (canvas.remove) {
                canvas.remove();
            }
            loadTextureCallback();
        }, (_, e) => {
            scene.removePendingData(texture);
            if (onError) {
                onError(`${this.getClassName()} could not be loaded`, e);
            }
        }, scene ? scene.offlineProvider : null);
    }
    /**
     * Convert the image buffer into a cubemap and create a CubeTexture.
     */
    _loadTexture() {
        const scene = this.getScene();
        const callback = () => {
            const imageData = this._getFloat32ArrayFromArrayBuffer(this._buffer);
            // Extract the raw linear data.
            const data = panoramaToCubemap/* PanoramaToCubeMapTools */.D.ConvertPanoramaToCubemap(imageData, this._width, this._height, this._size, this._supersample);
            const results = [];
            // Push each faces.
            for (let i = 0; i < 6; i++) {
                const dataFace = data[EquiRectangularCubeTexture._FacesMapping[i]];
                results.push(dataFace);
            }
            return results;
        };
        if (!scene) {
            return;
        }
        const faceDataArrays = callback();
        const texture = this._texture;
        scene.getEngine().updateRawCubeTexture(texture, faceDataArrays, texture.format, texture.type, texture.invertY);
        texture.isReady = true;
        scene.removePendingData(texture);
        texture.onLoadedObservable.notifyObservers(texture);
        texture.onLoadedObservable.clear();
        if (this._onLoad) {
            this._onLoad();
        }
    }
    /**
     * Convert the ArrayBuffer into a Float32Array and drop the transparency channel.
     * @param buffer The ArrayBuffer that should be converted.
     * @returns The buffer as Float32Array.
     */
    _getFloat32ArrayFromArrayBuffer(buffer) {
        const dataView = new DataView(buffer);
        const floatImageData = new Float32Array((buffer.byteLength * 3) / 4);
        let k = 0;
        for (let i = 0; i < buffer.byteLength; i++) {
            // We drop the transparency channel, because we do not need/want it
            if ((i + 1) % 4 !== 0) {
                floatImageData[k++] = dataView.getUint8(i) / 255;
            }
        }
        return floatImageData;
    }
    /**
     * Get the current class name of the texture useful for serialization or dynamic coding.
     * @returns "EquiRectangularCubeTexture"
     */
    getClassName() {
        return "EquiRectangularCubeTexture";
    }
    /**
     * Create a clone of the current EquiRectangularCubeTexture and return it.
     * @returns A clone of the current EquiRectangularCubeTexture.
     */
    clone() {
        const scene = this.getScene();
        if (!scene) {
            return this;
        }
        const newTexture = new EquiRectangularCubeTexture(this.url, scene, this._size, this._noMipmap, this.gammaSpace);
        // Base texture
        newTexture.level = this.level;
        newTexture.wrapU = this.wrapU;
        newTexture.wrapV = this.wrapV;
        newTexture.coordinatesIndex = this.coordinatesIndex;
        newTexture.coordinatesMode = this.coordinatesMode;
        return newTexture;
    }
}
/** The six faces of the cube. */
EquiRectangularCubeTexture._FacesMapping = ["right", "left", "up", "down", "front", "back"];
//# sourceMappingURL=equiRectangularCubeTexture.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/htmlElementTexture.js






/**
 * This represents the smallest workload to use an already existing element (Canvas or Video) as a texture.
 * To be as efficient as possible depending on your constraints nothing aside the first upload
 * is automatically managed.
 * It is a cheap VideoTexture or DynamicTexture if you prefer to keep full control of the elements
 * in your application.
 *
 * As the update is not automatic, you need to call them manually.
 */
class HtmlElementTexture extends baseTexture/* BaseTexture */.t {
    /**
     * Instantiates a HtmlElementTexture from the following parameters.
     *
     * @param name Defines the name of the texture
     * @param element Defines the video or canvas the texture is filled with
     * @param options Defines the other none mandatory texture creation options
     */
    constructor(name, element, options) {
        super(options.scene || options.engine);
        /**
         * Observable triggered once the texture has been loaded.
         */
        this.onLoadObservable = new Misc_observable/* Observable */.cP();
        if (!element || (!options.engine && !options.scene)) {
            return;
        }
        options = {
            ...HtmlElementTexture._DefaultOptions,
            ...options,
        };
        this._generateMipMaps = options.generateMipMaps;
        this._samplingMode = options.samplingMode;
        this._textureMatrix = math_vector/* Matrix */.uq.Identity();
        this._format = options.format;
        this.name = name;
        this.element = element;
        this._isVideo = !!element.getVideoPlaybackQuality;
        if (this._isVideo) {
            const engineWebGPU = this._engine;
            const createExternalTexture = engineWebGPU?.createExternalTexture;
            if (createExternalTexture) {
                this._externalTexture = createExternalTexture.call(engineWebGPU, element);
            }
        }
        this.anisotropicFilteringLevel = 1;
        this._createInternalTexture();
    }
    _createInternalTexture() {
        let width = 0;
        let height = 0;
        if (this._isVideo) {
            width = this.element.videoWidth;
            height = this.element.videoHeight;
        }
        else {
            width = this.element.width;
            height = this.element.height;
        }
        const engine = this._getEngine();
        if (engine) {
            this._texture = engine.createDynamicTexture(width, height, this._generateMipMaps, this._samplingMode);
            this._texture.format = this._format;
        }
        this.update();
    }
    /**
     * @returns the texture matrix used in most of the material.
     */
    getTextureMatrix() {
        return this._textureMatrix;
    }
    /**
     * Updates the content of the texture.
     * @param invertY Defines whether the texture should be inverted on Y (false by default on video and true on canvas)
     */
    update(invertY = null) {
        const engine = this._getEngine();
        if (this._texture == null || engine == null) {
            return;
        }
        const wasReady = this.isReady();
        if (this._isVideo) {
            const videoElement = this.element;
            if (videoElement.readyState < videoElement.HAVE_CURRENT_DATA) {
                return;
            }
            engine.updateVideoTexture(this._texture, this._externalTexture ? this._externalTexture : videoElement, invertY === null ? true : invertY);
        }
        else {
            const canvasElement = this.element;
            engine.updateDynamicTexture(this._texture, canvasElement, invertY === null ? true : invertY, false, this._format);
        }
        if (!wasReady && this.isReady()) {
            this.onLoadObservable.notifyObservers(this);
        }
    }
    /**
     * Dispose the texture and release its associated resources.
     */
    dispose() {
        this.onLoadObservable.clear();
        super.dispose();
    }
}
HtmlElementTexture._DefaultOptions = {
    generateMipMaps: false,
    samplingMode: 2,
    format: 5,
    engine: null,
    scene: null,
};
//# sourceMappingURL=htmlElementTexture.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/Loaders/internalTextureLoader.js

//# sourceMappingURL=internalTextureLoader.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/tgaTextureLoader.js
var tgaTextureLoader = __webpack_require__(7169);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/hdrTextureLoader.js
var hdrTextureLoader = __webpack_require__(27911);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/basisTextureLoader.js
var basisTextureLoader = __webpack_require__(41427);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/exrTextureLoader.js
var exrTextureLoader = __webpack_require__(51958);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/EXR/exrLoader.compression.js
var exrLoader_compression = __webpack_require__(52093);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/EXR/exrLoader.compression.huf.js
var exrLoader_compression_huf = __webpack_require__(72156);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.js
var exrLoader_compression_rle = __webpack_require__(64942);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/EXR/exrLoader.configuration.js
var exrLoader_configuration = __webpack_require__(9629);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/EXR/exrLoader.core.js
var exrLoader_core = __webpack_require__(86700);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/EXR/exrLoader.decoder.js
var exrLoader_decoder = __webpack_require__(50863);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/Loaders/EXR/exrLoader.header.js
var exrLoader_header = __webpack_require__(98078);
;// ./node_modules/@babylonjs/core/Materials/Textures/Loaders/EXR/index.js







//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/Loaders/index.js









// eslint-disable-next-line import/no-internal-modules

//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/multiRenderTarget.js




/**
 * A multi render target, like a render target provides the ability to render to a texture.
 * Unlike the render target, it can render to several draw buffers (render textures) in one draw.
 * This is specially interesting in deferred rendering or for any effects requiring more than
 * just one color from a single pass.
 */
class MultiRenderTarget extends Textures_renderTargetTexture/* RenderTargetTexture */.$ {
    /**
     * Get if draw buffers (render textures) are currently supported by the used hardware and browser.
     */
    get isSupported() {
        return this._engine?.getCaps().drawBuffersExtension ?? false;
    }
    /**
     * Get the list of textures generated by the multi render target.
     */
    get textures() {
        return this._textures;
    }
    /**
     * Gets the number of textures in this MRT. This number can be different from `_textures.length` in case a depth texture is generated.
     */
    get count() {
        return this._count;
    }
    /**
     * Get the depth texture generated by the multi render target if options.generateDepthTexture has been set
     */
    get depthTexture() {
        return this._textures[this._textures.length - 1];
    }
    /**
     * Set the wrapping mode on U of all the textures we are rendering to.
     * Can be any of the Texture. (CLAMP_ADDRESSMODE, MIRROR_ADDRESSMODE or WRAP_ADDRESSMODE)
     */
    set wrapU(wrap) {
        if (this._textures) {
            for (let i = 0; i < this._textures.length; i++) {
                this._textures[i].wrapU = wrap;
            }
        }
    }
    /**
     * Set the wrapping mode on V of all the textures we are rendering to.
     * Can be any of the Texture. (CLAMP_ADDRESSMODE, MIRROR_ADDRESSMODE or WRAP_ADDRESSMODE)
     */
    set wrapV(wrap) {
        if (this._textures) {
            for (let i = 0; i < this._textures.length; i++) {
                this._textures[i].wrapV = wrap;
            }
        }
    }
    /**
     * Instantiate a new multi render target texture.
     * A multi render target, like a render target provides the ability to render to a texture.
     * Unlike the render target, it can render to several draw buffers (render textures) in one draw.
     * This is specially interesting in deferred rendering or for any effects requiring more than
     * just one color from a single pass.
     * @param name Define the name of the texture
     * @param size Define the size of the buffers to render to
     * @param count Define the number of target we are rendering into
     * @param scene Define the scene the texture belongs to
     * @param options Define the options used to create the multi render target
     * @param textureNames Define the names to set to the textures (if count \> 0 - optional)
     */
    constructor(name, size, count, scene, options, textureNames) {
        const generateMipMaps = options && options.generateMipMaps ? options.generateMipMaps : false;
        const generateDepthTexture = options && options.generateDepthTexture ? options.generateDepthTexture : false;
        const depthTextureFormat = options && options.depthTextureFormat ? options.depthTextureFormat : 15;
        const doNotChangeAspectRatio = !options || options.doNotChangeAspectRatio === undefined ? true : options.doNotChangeAspectRatio;
        const drawOnlyOnFirstAttachmentByDefault = options && options.drawOnlyOnFirstAttachmentByDefault ? options.drawOnlyOnFirstAttachmentByDefault : false;
        super(name, size, scene, generateMipMaps, doNotChangeAspectRatio, undefined, undefined, undefined, undefined, undefined, undefined, undefined, true);
        if (!this.isSupported) {
            this.dispose();
            return;
        }
        this._textureNames = textureNames;
        const types = [];
        const samplingModes = [];
        const useSRGBBuffers = [];
        const formats = [];
        const targetTypes = [];
        const faceIndex = [];
        const layerIndex = [];
        const layerCounts = [];
        this._initTypes(count, types, samplingModes, useSRGBBuffers, formats, targetTypes, faceIndex, layerIndex, layerCounts, options);
        const generateDepthBuffer = !options || options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
        const generateStencilBuffer = !options || options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer;
        const samples = options && options.samples ? options.samples : 1;
        this._multiRenderTargetOptions = {
            samplingModes: samplingModes,
            generateMipMaps: generateMipMaps,
            generateDepthBuffer: generateDepthBuffer,
            generateStencilBuffer: generateStencilBuffer,
            generateDepthTexture: generateDepthTexture,
            depthTextureFormat: depthTextureFormat,
            types: types,
            textureCount: count,
            useSRGBBuffers: useSRGBBuffers,
            samples,
            formats: formats,
            targetTypes: targetTypes,
            faceIndex: faceIndex,
            layerIndex: layerIndex,
            layerCounts: layerCounts,
            labels: textureNames,
            label: name,
        };
        this._count = count;
        this._drawOnlyOnFirstAttachmentByDefault = drawOnlyOnFirstAttachmentByDefault;
        if (count > 0) {
            this._createInternalTextures();
            this._createTextures(textureNames);
        }
    }
    _initTypes(count, types, samplingModes, useSRGBBuffers, formats, targets, faceIndex, layerIndex, layerCounts, options) {
        for (let i = 0; i < count; i++) {
            if (options && options.types && options.types[i] !== undefined) {
                types.push(options.types[i]);
            }
            else {
                types.push(options && options.defaultType ? options.defaultType : 0);
            }
            if (options && options.samplingModes && options.samplingModes[i] !== undefined) {
                samplingModes.push(options.samplingModes[i]);
            }
            else {
                samplingModes.push(Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE);
            }
            if (options && options.useSRGBBuffers && options.useSRGBBuffers[i] !== undefined) {
                useSRGBBuffers.push(options.useSRGBBuffers[i]);
            }
            else {
                useSRGBBuffers.push(false);
            }
            if (options && options.formats && options.formats[i] !== undefined) {
                formats.push(options.formats[i]);
            }
            else {
                formats.push(5);
            }
            if (options && options.targetTypes && options.targetTypes[i] !== undefined) {
                targets.push(options.targetTypes[i]);
            }
            else {
                targets.push(3553);
            }
            if (options && options.faceIndex && options.faceIndex[i] !== undefined) {
                faceIndex.push(options.faceIndex[i]);
            }
            else {
                faceIndex.push(0);
            }
            if (options && options.layerIndex && options.layerIndex[i] !== undefined) {
                layerIndex.push(options.layerIndex[i]);
            }
            else {
                layerIndex.push(0);
            }
            if (options && options.layerCounts && options.layerCounts[i] !== undefined) {
                layerCounts.push(options.layerCounts[i]);
            }
            else {
                layerCounts.push(1);
            }
        }
    }
    _createInternaTextureIndexMapping() {
        const mapMainInternalTexture2Index = {};
        const mapInternalTexture2MainIndex = [];
        if (!this._renderTarget) {
            return mapInternalTexture2MainIndex;
        }
        const internalTextures = this._renderTarget.textures;
        for (let i = 0; i < internalTextures.length; i++) {
            const texture = internalTextures[i];
            if (!texture) {
                continue;
            }
            const mainIndex = mapMainInternalTexture2Index[texture.uniqueId];
            if (mainIndex !== undefined) {
                mapInternalTexture2MainIndex[i] = mainIndex;
            }
            else {
                mapMainInternalTexture2Index[texture.uniqueId] = i;
            }
        }
        return mapInternalTexture2MainIndex;
    }
    /**
     * @internal
     */
    _rebuild(fromContextLost = false, forceFullRebuild = false, textureNames) {
        if (this._count < 1 || fromContextLost) {
            return;
        }
        const mapInternalTexture2MainIndex = this._createInternaTextureIndexMapping();
        this.releaseInternalTextures();
        this._createInternalTextures();
        if (forceFullRebuild) {
            this._releaseTextures();
            this._createTextures(textureNames);
        }
        const internalTextures = this._renderTarget.textures;
        for (let i = 0; i < internalTextures.length; i++) {
            const texture = this._textures[i];
            if (mapInternalTexture2MainIndex[i] !== undefined) {
                this._renderTarget.setTexture(internalTextures[mapInternalTexture2MainIndex[i]], i);
            }
            texture._texture = internalTextures[i];
            if (texture._texture) {
                texture._noMipmap = !texture._texture.useMipMaps;
                texture._useSRGBBuffer = texture._texture._useSRGBBuffer;
            }
        }
        if (this.samples !== 1) {
            this._renderTarget.setSamples(this.samples, !this._drawOnlyOnFirstAttachmentByDefault, true);
        }
    }
    _createInternalTextures() {
        this._renderTarget = this._getEngine().createMultipleRenderTarget(this._size, this._multiRenderTargetOptions, !this._drawOnlyOnFirstAttachmentByDefault);
        this._texture = this._renderTarget.texture;
    }
    _releaseTextures() {
        if (this._textures) {
            for (let i = 0; i < this._textures.length; i++) {
                this._textures[i]._texture = null; // internal textures are released by a call to releaseInternalTextures()
                this._textures[i].dispose();
            }
        }
    }
    _createTextures(textureNames) {
        const internalTextures = this._renderTarget.textures;
        this._textures = [];
        for (let i = 0; i < internalTextures.length; i++) {
            const texture = new Textures_texture/* Texture */.g(null, this.getScene());
            if (textureNames?.[i]) {
                texture.name = textureNames[i];
            }
            texture._texture = internalTextures[i];
            if (texture._texture) {
                texture._noMipmap = !texture._texture.useMipMaps;
                texture._useSRGBBuffer = texture._texture._useSRGBBuffer;
            }
            this._textures.push(texture);
        }
    }
    /**
     * Replaces an internal texture within the MRT. Useful to share textures between MultiRenderTarget.
     * @param texture The new texture to set in the MRT
     * @param index The index of the texture to replace
     * @param disposePrevious Set to true if the previous internal texture should be disposed
     */
    setInternalTexture(texture, index, disposePrevious = true) {
        if (!this.renderTarget) {
            return;
        }
        if (index === 0) {
            this._texture = texture;
        }
        this.renderTarget.setTexture(texture, index, disposePrevious);
        if (!this.textures[index]) {
            this.textures[index] = new Textures_texture/* Texture */.g(null, this.getScene());
            this.textures[index].name = this._textureNames?.[index] ?? this.textures[index].name;
        }
        this.textures[index]._texture = texture;
        this.textures[index]._noMipmap = !texture.useMipMaps;
        this.textures[index]._useSRGBBuffer = texture._useSRGBBuffer;
        this._count = this.renderTarget.textures ? this.renderTarget.textures.length : 0;
        if (this._multiRenderTargetOptions.types) {
            this._multiRenderTargetOptions.types[index] = texture.type;
        }
        if (this._multiRenderTargetOptions.samplingModes) {
            this._multiRenderTargetOptions.samplingModes[index] = texture.samplingMode;
        }
        if (this._multiRenderTargetOptions.useSRGBBuffers) {
            this._multiRenderTargetOptions.useSRGBBuffers[index] = texture._useSRGBBuffer;
        }
        if (this._multiRenderTargetOptions.targetTypes && this._multiRenderTargetOptions.targetTypes[index] !== -1) {
            let target = 0;
            if (texture.is2DArray) {
                target = 35866;
            }
            else if (texture.isCube) {
                target = 34067;
            } /*else if (texture.isCubeArray) {
                target = 3735928559;
            }*/
            else if (texture.is3D) {
                target = 32879;
            }
            else {
                target = 3553;
            }
            this._multiRenderTargetOptions.targetTypes[index] = target;
        }
    }
    /**
     * Changes an attached texture's face index or layer.
     * @param index The index of the texture to modify the attachment of
     * @param layerIndex The layer index of the texture to be attached to the framebuffer
     * @param faceIndex The face index of the texture to be attached to the framebuffer
     */
    setLayerAndFaceIndex(index, layerIndex = -1, faceIndex = -1) {
        if (!this.textures[index] || !this.renderTarget) {
            return;
        }
        if (this._multiRenderTargetOptions.layerIndex) {
            this._multiRenderTargetOptions.layerIndex[index] = layerIndex;
        }
        if (this._multiRenderTargetOptions.faceIndex) {
            this._multiRenderTargetOptions.faceIndex[index] = faceIndex;
        }
        this.renderTarget.setLayerAndFaceIndex(index, layerIndex, faceIndex);
    }
    /**
     * Changes every attached texture's face index or layer.
     * @param layerIndices The layer indices of the texture to be attached to the framebuffer
     * @param faceIndices The face indices of the texture to be attached to the framebuffer
     */
    setLayerAndFaceIndices(layerIndices, faceIndices) {
        if (!this.renderTarget) {
            return;
        }
        this._multiRenderTargetOptions.layerIndex = layerIndices;
        this._multiRenderTargetOptions.faceIndex = faceIndices;
        this.renderTarget.setLayerAndFaceIndices(layerIndices, faceIndices);
    }
    /**
     * Define the number of samples used if MSAA is enabled.
     */
    get samples() {
        return this._samples;
    }
    set samples(value) {
        if (this._renderTarget) {
            this._samples = this._renderTarget.setSamples(value);
        }
        else {
            // In case samples are set with 0 textures created, we must save the desired samples value
            this._samples = value;
        }
    }
    /**
     * Resize all the textures in the multi render target.
     * Be careful as it will recreate all the data in the new texture.
     * @param size Define the new size
     */
    resize(size) {
        this._processSizeParameter(size);
        this._rebuild(false, undefined, this._textureNames);
    }
    /**
     * Changes the number of render targets in this MRT
     * Be careful as it will recreate all the data in the new texture.
     * @param count new texture count
     * @param options Specifies texture types and sampling modes for new textures
     * @param textureNames Specifies the names of the textures (optional)
     */
    updateCount(count, options, textureNames) {
        this._multiRenderTargetOptions.textureCount = count;
        this._count = count;
        const types = [];
        const samplingModes = [];
        const useSRGBBuffers = [];
        const formats = [];
        const targetTypes = [];
        const faceIndex = [];
        const layerIndex = [];
        const layerCounts = [];
        this._textureNames = textureNames;
        this._initTypes(count, types, samplingModes, useSRGBBuffers, formats, targetTypes, faceIndex, layerIndex, layerCounts, options);
        this._multiRenderTargetOptions.types = types;
        this._multiRenderTargetOptions.samplingModes = samplingModes;
        this._multiRenderTargetOptions.useSRGBBuffers = useSRGBBuffers;
        this._multiRenderTargetOptions.formats = formats;
        this._multiRenderTargetOptions.targetTypes = targetTypes;
        this._multiRenderTargetOptions.faceIndex = faceIndex;
        this._multiRenderTargetOptions.layerIndex = layerIndex;
        this._multiRenderTargetOptions.layerCounts = layerCounts;
        this._multiRenderTargetOptions.labels = textureNames;
        this._rebuild(false, true, textureNames);
    }
    _unbindFrameBuffer(engine, faceIndex) {
        if (this._renderTarget) {
            engine.unBindMultiColorAttachmentFramebuffer(this._renderTarget, this.isCube, () => {
                this.onAfterRenderObservable.notifyObservers(faceIndex);
            });
        }
    }
    /**
     * Dispose the render targets and their associated resources
     * @param doNotDisposeInternalTextures if set to true, internal textures won't be disposed (default: false).
     */
    dispose(doNotDisposeInternalTextures = false) {
        this._releaseTextures();
        if (!doNotDisposeInternalTextures) {
            this.releaseInternalTextures();
        }
        else {
            // Prevent internal texture dispose in super.dispose
            this._texture = null;
        }
        super.dispose();
    }
    /**
     * Release all the underlying texture used as draw buffers (render textures).
     */
    releaseInternalTextures() {
        const internalTextures = this._renderTarget?.textures;
        if (!internalTextures) {
            return;
        }
        for (let i = internalTextures.length - 1; i >= 0; i--) {
            this._textures[i]._texture = null;
        }
        this._renderTarget?.dispose();
        this._renderTarget = null;
    }
}
//# sourceMappingURL=multiRenderTarget.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/Packer/frame.js
/**
 * This is a support class for frame Data on texture packer sets.
 */
class TexturePackerFrame {
    /**
     * Initializes a texture package frame.
     * @param id The numerical frame identifier
     * @param scale Scalar Vector2 for UV frame
     * @param offset Vector2 for the frame position in UV units.
     * @returns TexturePackerFrame
     */
    constructor(id, scale, offset) {
        this.id = id;
        this.scale = scale;
        this.offset = offset;
    }
}
//# sourceMappingURL=frame.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/Packer/packer.js









/**
 * This is a support class that generates a series of packed texture sets.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
 */
class TexturePacker {
    /**
     * Initializes a texture package series from an array of meshes or a single mesh.
     * @param name The name of the package
     * @param meshes The target meshes to compose the package from
     * @param options The arguments that texture packer should follow while building.
     * @param scene The scene which the textures are scoped to.
     * @returns TexturePacker
     */
    constructor(name, meshes, options, scene) {
        this.name = name;
        this.meshes = meshes;
        this.scene = scene;
        /**
         * Run through the options and set what ever defaults are needed that where not declared.
         */
        this.options = options;
        this.options.map = this.options.map ?? [
            "ambientTexture",
            "bumpTexture",
            "diffuseTexture",
            "emissiveTexture",
            "lightmapTexture",
            "opacityTexture",
            "reflectionTexture",
            "refractionTexture",
            "specularTexture",
        ];
        this.options.uvsIn = this.options.uvsIn ?? Buffers_buffer/* VertexBuffer */.R.UVKind;
        this.options.uvsOut = this.options.uvsOut ?? Buffers_buffer/* VertexBuffer */.R.UVKind;
        this.options.layout = this.options.layout ?? TexturePacker.LAYOUT_STRIP;
        if (this.options.layout === TexturePacker.LAYOUT_COLNUM) {
            this.options.colnum = this.options.colnum ?? 8;
        }
        this.options.updateInputMeshes = this.options.updateInputMeshes ?? true;
        this.options.disposeSources = this.options.disposeSources ?? true;
        this._expecting = 0;
        this.options.fillBlanks = this.options.fillBlanks ?? true;
        if (this.options.fillBlanks === true) {
            this.options.customFillColor = this.options.customFillColor ?? "black";
        }
        this.options.frameSize = this.options.frameSize ?? 256;
        this.options.paddingRatio = this.options.paddingRatio ?? 0.0115;
        this._paddingValue = Math.ceil(this.options.frameSize * this.options.paddingRatio);
        //Make it an even padding Number.
        if (this._paddingValue % 2 !== 0) {
            this._paddingValue++;
        }
        this.options.paddingMode = this.options.paddingMode ?? TexturePacker.SUBUV_WRAP;
        if (this.options.paddingMode === TexturePacker.SUBUV_COLOR) {
            this.options.paddingColor = this.options.paddingColor ?? new math_color/* Color4 */.ov(0, 0, 0, 1.0);
        }
        this.sets = {};
        this.frames = [];
        return this;
    }
    /**
     * Starts the package process
     * @param resolve The promises resolution function
     */
    _createFrames(resolve) {
        const dtSize = this._calculateSize();
        const dtUnits = new math_vector/* Vector2 */.I9(1, 1).divide(dtSize);
        let doneCount = 0;
        const expecting = this._expecting;
        const meshLength = this.meshes.length;
        const sKeys = Object.keys(this.sets);
        for (let i = 0; i < sKeys.length; i++) {
            const setName = sKeys[i];
            const dt = new Textures_dynamicTexture/* DynamicTexture */.R(this.name + ".TexturePack." + setName + "Set", { width: dtSize.x, height: dtSize.y }, this.scene, true, //Generate Mips
            Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, 5);
            const dtx = dt.getContext();
            dtx.fillStyle = "rgba(0,0,0,0)";
            dtx.fillRect(0, 0, dtSize.x, dtSize.y);
            dt.update(false);
            this.sets[setName] = dt;
        }
        const baseSize = this.options.frameSize || 256;
        const padding = this._paddingValue;
        const tcs = baseSize + 2 * padding;
        const done = () => {
            this._calculateMeshUVFrames(baseSize, padding, dtSize, dtUnits, this.options.updateInputMeshes || false);
        };
        //Update the Textures
        for (let i = 0; i < meshLength; i++) {
            const m = this.meshes[i];
            const mat = m.material;
            //Check if the material has the texture
            //Create a temporary canvas the same size as 1 frame
            //Then apply the texture to the center and the 8 offsets
            //Copy the Context and place in the correct frame on the DT
            for (let j = 0; j < sKeys.length; j++) {
                const tempTexture = new Textures_dynamicTexture/* DynamicTexture */.R("temp", tcs, this.scene, true);
                const tcx = tempTexture.getContext();
                const offset = this._getFrameOffset(i);
                const updateDt = () => {
                    doneCount++;
                    tempTexture.update(false);
                    const iDat = tcx.getImageData(0, 0, tcs, tcs);
                    //Update Set
                    const dt = this.sets[setName];
                    const dtx = dt.getContext();
                    dtx.putImageData(iDat, dtSize.x * offset.x, dtSize.y * offset.y);
                    tempTexture.dispose();
                    dt.update(false);
                    if (doneCount == expecting) {
                        done();
                        resolve();
                        return;
                    }
                };
                const setName = sKeys[j] || "_blank";
                if (!mat || mat[setName] === null) {
                    tcx.fillStyle = "rgba(0,0,0,0)";
                    if (this.options.fillBlanks) {
                        tcx.fillStyle = this.options.customFillColor;
                    }
                    tcx.fillRect(0, 0, tcs, tcs);
                    updateDt();
                }
                else {
                    const setTexture = mat[setName];
                    const img = new Image();
                    if (setTexture instanceof Textures_dynamicTexture/* DynamicTexture */.R) {
                        img.src = setTexture.getContext().canvas.toDataURL("image/png");
                    }
                    else {
                        img.src = setTexture.url;
                    }
                    tools/* Tools */.S0.SetCorsBehavior(img.src, img);
                    img.onload = () => {
                        tcx.fillStyle = "rgba(0,0,0,0)";
                        tcx.fillRect(0, 0, tcs, tcs);
                        tempTexture.update(false);
                        tcx.setTransform(1, 0, 0, -1, 0, 0);
                        const cellOffsets = [0, 0, 1, 0, 1, 1, 0, 1, -1, 1, -1, 0, -1 - 1, 0, -1, 1, -1];
                        switch (this.options.paddingMode) {
                            //Wrap Mode
                            case 0:
                                for (let i = 0; i < 9; i++) {
                                    tcx.drawImage(img, 0, 0, img.width, img.height, padding + baseSize * cellOffsets[i], padding + baseSize * cellOffsets[i + 1] - tcs, baseSize, baseSize);
                                }
                                break;
                            //Extend Mode
                            case 1:
                                for (let i = 0; i < padding; i++) {
                                    tcx.drawImage(img, 0, 0, img.width, img.height, i + baseSize * cellOffsets[0], padding - tcs, baseSize, baseSize);
                                    tcx.drawImage(img, 0, 0, img.width, img.height, padding * 2 - i, padding - tcs, baseSize, baseSize);
                                    tcx.drawImage(img, 0, 0, img.width, img.height, padding, i - tcs, baseSize, baseSize);
                                    tcx.drawImage(img, 0, 0, img.width, img.height, padding, padding * 2 - i - tcs, baseSize, baseSize);
                                }
                                tcx.drawImage(img, 0, 0, img.width, img.height, padding + baseSize * cellOffsets[0], padding + baseSize * cellOffsets[1] - tcs, baseSize, baseSize);
                                break;
                            //Color Mode
                            case 2:
                                tcx.fillStyle = (this.options.paddingColor || math_color/* Color3 */.v9.Black()).toHexString();
                                tcx.fillRect(0, 0, tcs, -tcs);
                                tcx.clearRect(padding, padding, baseSize, baseSize);
                                tcx.drawImage(img, 0, 0, img.width, img.height, padding + baseSize * cellOffsets[0], padding + baseSize * cellOffsets[1] - tcs, baseSize, baseSize);
                                break;
                        }
                        tcx.setTransform(1, 0, 0, 1, 0, 0);
                        updateDt();
                    };
                }
            }
        }
    }
    /**
     * Calculates the Size of the Channel Sets
     * @returns Vector2
     */
    _calculateSize() {
        const meshLength = this.meshes.length || 0;
        const baseSize = this.options.frameSize || 0;
        const padding = this._paddingValue || 0;
        switch (this.options.layout) {
            case 0: {
                //STRIP_LAYOUT
                return new math_vector/* Vector2 */.I9(baseSize * meshLength + 2 * padding * meshLength, baseSize + 2 * padding);
            }
            case 1: {
                //POWER2
                const sqrtCount = Math.max(2, Math.ceil(Math.sqrt(meshLength)));
                const size = baseSize * sqrtCount + 2 * padding * sqrtCount;
                return new math_vector/* Vector2 */.I9(size, size);
            }
            case 2: {
                //COLNUM
                const cols = this.options.colnum || 1;
                const rowCnt = Math.max(1, Math.ceil(meshLength / cols));
                return new math_vector/* Vector2 */.I9(baseSize * cols + 2 * padding * cols, baseSize * rowCnt + 2 * padding * rowCnt);
            }
        }
        return math_vector/* Vector2 */.I9.Zero();
    }
    /**
     * Calculates the UV data for the frames.
     * @param baseSize the base frameSize
     * @param padding the base frame padding
     * @param dtSize size of the Dynamic Texture for that channel
     * @param dtUnits is 1/dtSize
     * @param update flag to update the input meshes
     */
    _calculateMeshUVFrames(baseSize, padding, dtSize, dtUnits, update) {
        const meshLength = this.meshes.length;
        for (let i = 0; i < meshLength; i++) {
            const m = this.meshes[i];
            const scale = new math_vector/* Vector2 */.I9(baseSize / dtSize.x, baseSize / dtSize.y);
            const pOffset = dtUnits.clone().scale(padding);
            const frameOffset = this._getFrameOffset(i);
            const offset = frameOffset.add(pOffset);
            const frame = new TexturePackerFrame(i, scale, offset);
            this.frames.push(frame);
            //Update Output UVs
            if (update) {
                this._updateMeshUV(m, i);
                this._updateTextureReferences(m);
            }
        }
    }
    /**
     * Calculates the frames Offset.
     * @param index of the frame
     * @returns Vector2
     */
    _getFrameOffset(index) {
        const meshLength = this.meshes.length;
        let uvStep, yStep, xStep;
        switch (this.options.layout) {
            case 0: {
                //STRIP_LAYOUT
                uvStep = 1 / meshLength;
                return new math_vector/* Vector2 */.I9(index * uvStep, 0);
            }
            case 1: {
                //POWER2
                const sqrtCount = Math.max(2, Math.ceil(Math.sqrt(meshLength)));
                yStep = Math.floor(index / sqrtCount);
                xStep = index - yStep * sqrtCount;
                uvStep = 1 / sqrtCount;
                return new math_vector/* Vector2 */.I9(xStep * uvStep, yStep * uvStep);
            }
            case 2: {
                //COLNUM
                const cols = this.options.colnum || 1;
                const rowCnt = Math.max(1, Math.ceil(meshLength / cols));
                xStep = Math.floor(index / rowCnt);
                yStep = index - xStep * rowCnt;
                uvStep = new math_vector/* Vector2 */.I9(1 / cols, 1 / rowCnt);
                return new math_vector/* Vector2 */.I9(xStep * uvStep.x, yStep * uvStep.y);
            }
        }
        return math_vector/* Vector2 */.I9.Zero();
    }
    /**
     * Updates a Mesh to the frame data
     * @param mesh that is the target
     * @param frameID or the frame index
     */
    _updateMeshUV(mesh, frameID) {
        const frame = this.frames[frameID];
        const uvIn = mesh.getVerticesData(this.options.uvsIn || Buffers_buffer/* VertexBuffer */.R.UVKind);
        const uvOut = [];
        let toCount = 0;
        if (uvIn.length) {
            toCount = uvIn.length || 0;
        }
        for (let i = 0; i < toCount; i += 2) {
            uvOut.push(uvIn[i] * frame.scale.x + frame.offset.x, uvIn[i + 1] * frame.scale.y + frame.offset.y);
        }
        mesh.setVerticesData(this.options.uvsOut || Buffers_buffer/* VertexBuffer */.R.UVKind, uvOut);
    }
    /**
     * Updates a Meshes materials to use the texture packer channels
     * @param m is the mesh to target
     * @param force all channels on the packer to be set.
     */
    _updateTextureReferences(m, force = false) {
        const mat = m.material;
        const sKeys = Object.keys(this.sets);
        const _dispose = (_t) => {
            if (_t.dispose) {
                _t.dispose();
            }
        };
        for (let i = 0; i < sKeys.length; i++) {
            const setName = sKeys[i];
            if (!force) {
                if (!mat) {
                    return;
                }
                if (mat[setName] !== null) {
                    _dispose(mat[setName]);
                    mat[setName] = this.sets[setName];
                }
            }
            else {
                if (mat[setName] !== null) {
                    _dispose(mat[setName]);
                }
                mat[setName] = this.sets[setName];
            }
        }
    }
    /**
     * Public method to set a Mesh to a frame
     * @param m that is the target
     * @param frameID or the frame index
     * @param updateMaterial trigger for if the Meshes attached Material be updated?
     */
    setMeshToFrame(m, frameID, updateMaterial = false) {
        this._updateMeshUV(m, frameID);
        if (updateMaterial) {
            this._updateTextureReferences(m, true);
        }
    }
    /**
     * Starts the async promise to compile the texture packer.
     * @returns Promise<void>
     */
    processAsync() {
        return new Promise((resolve, reject) => {
            try {
                if (this.meshes.length === 0) {
                    //Must be a JSON load!
                    resolve();
                    return;
                }
                let done = 0;
                const doneCheck = (mat) => {
                    done++;
                    //Check Status of all Textures on all meshes, till they are ready.
                    if (this.options.map) {
                        for (let j = 0; j < this.options.map.length; j++) {
                            const index = this.options.map[j];
                            const t = mat[index];
                            if (t !== null) {
                                if (!this.sets[this.options.map[j]]) {
                                    this.sets[this.options.map[j]] = true;
                                }
                                this._expecting++;
                            }
                        }
                        if (done === this.meshes.length) {
                            this._createFrames(resolve);
                        }
                    }
                };
                for (let i = 0; i < this.meshes.length; i++) {
                    const mesh = this.meshes[i];
                    const material = mesh.material;
                    if (!material) {
                        done++;
                        if (done === this.meshes.length) {
                            return this._createFrames(resolve);
                        }
                        continue;
                    }
                    material.forceCompilationAsync(mesh).then(() => {
                        doneCheck(material);
                    });
                }
            }
            catch (e) {
                return reject(e);
            }
        });
    }
    /**
     * Disposes all textures associated with this packer
     */
    dispose() {
        const sKeys = Object.keys(this.sets);
        for (let i = 0; i < sKeys.length; i++) {
            const channel = sKeys[i];
            this.sets[channel].dispose();
        }
    }
    /**
     * Starts the download process for all the channels converting them to base64 data and embedding it all in a JSON file.
     * @param imageType is the image type to use.
     * @param quality of the image if downloading as jpeg, Ranges from >0 to 1.
     */
    download(imageType = "png", quality = 1) {
        setTimeout(() => {
            const pack = {
                name: this.name,
                sets: {},
                options: {},
                frames: [],
            };
            const sKeys = Object.keys(this.sets);
            const oKeys = Object.keys(this.options);
            try {
                for (let i = 0; i < sKeys.length; i++) {
                    const channel = sKeys[i];
                    const dt = this.sets[channel];
                    pack.sets[channel] = dt.getContext().canvas.toDataURL("image/" + imageType, quality);
                }
                for (let i = 0; i < oKeys.length; i++) {
                    const opt = oKeys[i];
                    pack.options[opt] = this.options[opt];
                }
                for (let i = 0; i < this.frames.length; i++) {
                    const _f = this.frames[i];
                    pack.frames.push(_f.scale.x, _f.scale.y, _f.offset.x, _f.offset.y);
                }
            }
            catch (err) {
                logger/* Logger */.V.Warn("Unable to download: " + err);
                return;
            }
            const data = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(pack, null, 4));
            const _a = document.createElement("a");
            _a.setAttribute("href", data);
            _a.setAttribute("download", this.name + "_texurePackage.json");
            document.body.appendChild(_a);
            _a.click();
            _a.remove();
        }, 0);
    }
    /**
     * Public method to load a texturePacker JSON file.
     * @param data of the JSON file in string format.
     */
    updateFromJSON(data) {
        try {
            const parsedData = JSON.parse(data);
            this.name = parsedData.name;
            const _options = Object.keys(parsedData.options);
            for (let i = 0; i < _options.length; i++) {
                this.options[_options[i]] = parsedData.options[_options[i]];
            }
            for (let i = 0; i < parsedData.frames.length; i += 4) {
                const frame = new TexturePackerFrame(i / 4, new math_vector/* Vector2 */.I9(parsedData.frames[i], parsedData.frames[i + 1]), new math_vector/* Vector2 */.I9(parsedData.frames[i + 2], parsedData.frames[i + 3]));
                this.frames.push(frame);
            }
            const channels = Object.keys(parsedData.sets);
            for (let i = 0; i < channels.length; i++) {
                const _t = new Textures_texture/* Texture */.g(parsedData.sets[channels[i]], this.scene, false, false);
                this.sets[channels[i]] = _t;
            }
        }
        catch (err) {
            logger/* Logger */.V.Warn("Unable to update from JSON: " + err);
        }
    }
}
/** Packer Layout Constant 0 */
TexturePacker.LAYOUT_STRIP = 0;
/** Packer Layout Constant 1 */
TexturePacker.LAYOUT_POWER2 = 1;
/** Packer Layout Constant 2 */
TexturePacker.LAYOUT_COLNUM = 2;
/** Packer Layout Constant 0 */
TexturePacker.SUBUV_WRAP = 0;
/** Packer Layout Constant 1 */
TexturePacker.SUBUV_EXTEND = 1;
/** Packer Layout Constant 2 */
TexturePacker.SUBUV_COLOR = 2;
//# sourceMappingURL=packer.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/Packer/index.js


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/customProceduralTexture.js






/**
 * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes called 'refMaps' or 'sampler' images.
 * Custom Procedural textures are the easiest way to create your own procedural in your application.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures#creating-custom-procedural-textures
 */
class CustomProceduralTexture extends ProceduralTexture {
    /**
     * Instantiates a new Custom Procedural Texture.
     * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes called 'refMaps' or 'sampler' images.
     * Custom Procedural textures are the easiest way to create your own procedural in your application.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures#creating-custom-procedural-textures
     * @param name Define the name of the texture
     * @param texturePath Define the folder path containing all the custom texture related files (config, shaders...)
     * @param size Define the size of the texture to create
     * @param scene Define the scene the texture belongs to
     * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
     * @param generateMipMaps Define if the texture should creates mip maps or not
     * @param skipJson Define a boolena indicating that there is no json config file to load
     */
    constructor(name, texturePath, size, scene, fallbackTexture, generateMipMaps, skipJson) {
        super(name, size, null, scene, fallbackTexture, generateMipMaps);
        this._animate = true;
        this._time = 0;
        this._texturePath = texturePath;
        if (fallbackTexture && !(fallbackTexture instanceof Textures_texture/* Texture */.g)) {
            skipJson = !!fallbackTexture.skipJson;
        }
        if (!skipJson) {
            //Try to load json
            this._loadJson(texturePath);
        }
        else {
            this.setFragment(this._texturePath);
        }
        this.refreshRate = 1;
    }
    _loadJson(jsonUrl) {
        const noConfigFile = () => {
            try {
                this.setFragment(this._texturePath);
            }
            catch (ex) {
                logger/* Logger */.V.Log("No json or ShaderStore or DOM element found for CustomProceduralTexture");
            }
        };
        const configFileUrl = jsonUrl + "/config.json";
        const xhr = new webRequest/* WebRequest */.u();
        xhr.open("GET", configFileUrl);
        xhr.addEventListener("load", () => {
            if (xhr.status === 200 || (xhr.responseText && xhr.responseText.length > 0)) {
                try {
                    this._config = JSON.parse(xhr.response);
                    this.updateShaderUniforms();
                    this.updateTextures();
                    this.setFragment(this._texturePath + "/custom");
                    this._animate = this._config.animate;
                    this.refreshRate = this._config.refreshrate;
                }
                catch (ex) {
                    noConfigFile();
                }
            }
            else {
                noConfigFile();
            }
        }, false);
        xhr.addEventListener("error", () => {
            noConfigFile();
        }, false);
        try {
            xhr.send();
        }
        catch (ex) {
            logger/* Logger */.V.Error("CustomProceduralTexture: Error on XHR send request.");
        }
    }
    /**
     * Is the texture ready to be used ? (rendered at least once)
     * @returns true if ready, otherwise, false.
     */
    isReady() {
        if (!super.isReady()) {
            return false;
        }
        for (const name in this._textures) {
            const texture = this._textures[name];
            if (!texture.isReady()) {
                return false;
            }
        }
        return true;
    }
    /**
     * Render the texture to its associated render target.
     * @param useCameraPostProcess Define if camera post process should be applied to the texture
     */
    render(useCameraPostProcess) {
        const scene = this.getScene();
        if (this._animate && scene) {
            this._time += scene.getAnimationRatio() * 0.03;
            this.updateShaderUniforms();
        }
        super.render(useCameraPostProcess);
    }
    /**
     * Update the list of dependant textures samplers in the shader.
     */
    updateTextures() {
        for (let i = 0; i < this._config.sampler2Ds.length; i++) {
            this.setTexture(this._config.sampler2Ds[i].sample2Dname, new Textures_texture/* Texture */.g(this._texturePath + "/" + this._config.sampler2Ds[i].textureRelativeUrl, this.getScene()));
        }
    }
    /**
     * Update the uniform values of the procedural texture in the shader.
     */
    updateShaderUniforms() {
        if (this._config) {
            for (let j = 0; j < this._config.uniforms.length; j++) {
                const uniform = this._config.uniforms[j];
                switch (uniform.type) {
                    case "float":
                        this.setFloat(uniform.name, uniform.value);
                        break;
                    case "color3":
                        this.setColor3(uniform.name, new math_color/* Color3 */.v9(uniform.r, uniform.g, uniform.b));
                        break;
                    case "color4":
                        this.setColor4(uniform.name, new math_color/* Color4 */.ov(uniform.r, uniform.g, uniform.b, uniform.a));
                        break;
                    case "vector2":
                        this.setVector2(uniform.name, new math_vector/* Vector2 */.I9(uniform.x, uniform.y));
                        break;
                    case "vector3":
                        this.setVector3(uniform.name, new math_vector/* Vector3 */.Pq(uniform.x, uniform.y, uniform.z));
                        break;
                }
            }
        }
        this.setFloat("time", this._time);
    }
    /**
     * Define if the texture animates or not.
     */
    get animate() {
        return this._animate;
    }
    set animate(value) {
        this._animate = value;
    }
}
//# sourceMappingURL=customProceduralTexture.js.map
;// ./node_modules/@babylonjs/core/Shaders/noise.fragment.js
// Do not edit.

const noise_fragment_name = "noisePixelShader";
const noise_fragment_shader = `uniform float brightness;uniform float persistence;uniform float timeScale;varying vec2 vUV;vec2 hash22(vec2 p)
{p=p*mat2(127.1,311.7,269.5,183.3);p=-1.0+2.0*fract(sin(p)*43758.5453123);return sin(p*6.283+timeScale);}
float interpolationNoise(vec2 p)
{vec2 pi=floor(p);vec2 pf=p-pi;vec2 w=pf*pf*(3.-2.*pf);float f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));float f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));float f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));float f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));float xm1=mix(f00,f10,w.x);float xm2=mix(f01,f11,w.x);float ym=mix(xm1,xm2,w.y); 
return ym;}
float perlinNoise2D(float x,float y)
{float sum=0.0;float frequency=0.0;float amplitude=0.0;for(int i=0; i<OCTAVES; i++)
{frequency=pow(2.0,float(i));amplitude=pow(persistence,float(i));sum=sum+interpolationNoise(vec2(x*frequency,y*frequency))*amplitude;}
return sum;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{float x=abs(vUV.x);float y=abs(vUV.y);float noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);gl_FragColor=vec4(noise,noise,noise,1.0);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[noise_fragment_name] = noise_fragment_shader;
/** @internal */
const noisePixelShader = { name: noise_fragment_name, shader: noise_fragment_shader };
//# sourceMappingURL=noise.fragment.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/noiseProceduralTexture.js




/**
 * Class used to generate noise procedural textures
 */
class NoiseProceduralTexture extends ProceduralTexture {
    /**
     * Creates a new NoiseProceduralTexture
     * @param name defines the name fo the texture
     * @param size defines the size of the texture (default is 256)
     * @param scene defines the hosting scene
     * @param fallbackTexture defines the texture to use if the NoiseProceduralTexture can't be created
     * @param generateMipMaps defines if mipmaps must be generated (true by default)
     */
    constructor(name, size = 256, scene = engineStore/* EngineStore */.q.LastCreatedScene, fallbackTexture, generateMipMaps) {
        super(name, size, "noise", scene, fallbackTexture, generateMipMaps);
        /** Gets or sets the start time (default is 0) */
        this.time = 0.0;
        /** Gets or sets a value between 0 and 1 indicating the overall brightness of the texture (default is 0.2) */
        this.brightness = 0.2;
        /** Defines the number of octaves to process */
        this.octaves = 3;
        /** Defines the level of persistence (0.8 by default) */
        this.persistence = 0.8;
        /** Gets or sets animation speed factor (default is 1) */
        this.animationSpeedFactor = 1;
        this.autoClear = false;
        this._updateShaderUniforms();
    }
    _updateShaderUniforms() {
        const scene = this.getScene();
        if (!scene) {
            return;
        }
        this.time += scene.getAnimationRatio() * this.animationSpeedFactor * 0.01;
        this.setFloat("brightness", this.brightness);
        this.setFloat("persistence", this.persistence);
        this.setFloat("timeScale", this.time);
    }
    _getDefines() {
        return "#define OCTAVES " + (this.octaves | 0);
    }
    /**
     * Generate the current state of the procedural texture
     * @param useCameraPostProcess Define if camera post process should be applied to the texture
     */
    render(useCameraPostProcess) {
        this._updateShaderUniforms();
        super.render(useCameraPostProcess);
    }
    /**
     * Serializes this noise procedural texture
     * @returns a serialized noise procedural texture object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.customType = "BABYLON.NoiseProceduralTexture";
        serializationObject.brightness = this.brightness;
        serializationObject.octaves = this.octaves;
        serializationObject.persistence = this.persistence;
        serializationObject.animationSpeedFactor = this.animationSpeedFactor;
        serializationObject.size = this.getSize().width;
        serializationObject.generateMipMaps = this._generateMipMaps;
        serializationObject.time = this.time;
        return serializationObject;
    }
    /**
     * Clone the texture.
     * @returns the cloned texture
     */
    clone() {
        const textureSize = this.getSize();
        const newTexture = new NoiseProceduralTexture(this.name, textureSize.width, this.getScene(), this._fallbackTexture ? this._fallbackTexture : undefined, this._generateMipMaps);
        // Base texture
        newTexture.hasAlpha = this.hasAlpha;
        newTexture.level = this.level;
        // RenderTarget Texture
        newTexture.coordinatesMode = this.coordinatesMode;
        // Noise Specifics
        newTexture.brightness = this.brightness;
        newTexture.octaves = this.octaves;
        newTexture.persistence = this.persistence;
        newTexture.animationSpeedFactor = this.animationSpeedFactor;
        newTexture.time = this.time;
        return newTexture;
    }
    /**
     * Creates a NoiseProceduralTexture from parsed noise procedural texture data
     * @param parsedTexture defines parsed texture data
     * @param scene defines the current scene
     * @returns a parsed NoiseProceduralTexture
     */
    static Parse(parsedTexture, scene) {
        const texture = new NoiseProceduralTexture(parsedTexture.name, parsedTexture.size, scene, undefined, parsedTexture.generateMipMaps);
        texture.brightness = parsedTexture.brightness;
        texture.octaves = parsedTexture.octaves;
        texture.persistence = parsedTexture.persistence;
        texture.animationSpeedFactor = parsedTexture.animationSpeedFactor;
        texture.time = parsedTexture.time ?? 0;
        return texture;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NoiseProceduralTexture", NoiseProceduralTexture);
//# sourceMappingURL=noiseProceduralTexture.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/Procedurals/index.js




//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/rawCubeTexture.js
var rawCubeTexture = __webpack_require__(61094);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/rawTexture2DArray.js
var rawTexture2DArray = __webpack_require__(12462);
;// ./node_modules/@babylonjs/core/Materials/Textures/rawTexture3D.js


/**
 * Class used to store 3D textures containing user data
 */
class RawTexture3D extends Textures_texture/* Texture */.g {
    /**
     * Gets the width of the texture
     */
    get width() {
        return this._texture ? this._texture.width : 0;
    }
    /**
     * Gets the height of the texture
     */
    get height() {
        return this._texture ? this._texture.height : 0;
    }
    /**
     * Gets the depth of the texture
     */
    get depth() {
        return this._texture ? this._texture.depth : 0;
    }
    /**
     * Create a new RawTexture3D
     * @param data defines the data of the texture
     * @param width defines the width of the texture
     * @param height defines the height of the texture
     * @param depth defines the depth of the texture
     * @param format defines the texture format to use
     * @param scene defines the hosting scene
     * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
     * @param invertY defines if texture must be stored with Y axis inverted
     * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)
     * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)
     * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
     */
    constructor(data, width, height, depth, 
    /** Gets or sets the texture format to use */
    format, scene, generateMipMaps = true, invertY = false, samplingMode = Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, textureType = 0, creationFlags) {
        super(null, scene, !generateMipMaps, invertY);
        this.format = format;
        this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);
        this.is3D = true;
    }
    /**
     * Update the texture with new data
     * @param data defines the data to store in the texture
     */
    update(data) {
        if (!this._texture) {
            return;
        }
        this._getEngine().updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);
    }
}
//# sourceMappingURL=rawTexture3D.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/refractionTexture.js


/**
 * Creates a refraction texture used by refraction channel of the standard material.
 * It is like a mirror but to see through a material.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refractiontexture
 */
class RefractionTexture extends Textures_renderTargetTexture/* RenderTargetTexture */.$ {
    /**
     * Creates a refraction texture used by refraction channel of the standard material.
     * It is like a mirror but to see through a material.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refraction
     * @param name Define the texture name
     * @param size Define the size of the underlying texture
     * @param scene Define the scene the refraction belongs to
     * @param generateMipMaps Define if we need to generate mips level for the refraction
     */
    constructor(name, size, scene, generateMipMaps) {
        super(name, size, scene, generateMipMaps, true);
        /**
         * Define the reflection plane we want to use. The refractionPlane is usually set to the constructed refractor.
         * It is possible to directly set the refractionPlane by directly using a Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the refractionPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the refractor as stated in the doc.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refraction
         */
        this.refractionPlane = new math_plane/* Plane */.Z(0, 1, 0, 1);
        /**
         * Define how deep under the surface we should see.
         */
        this.depth = 2.0;
        this.onBeforeRenderObservable.add(() => {
            this.getScene().clipPlane = this.refractionPlane;
        });
        this.onAfterRenderObservable.add(() => {
            this.getScene().clipPlane = null;
        });
    }
    /**
     * Clone the refraction texture.
     * @returns the cloned texture
     */
    clone() {
        const scene = this.getScene();
        if (!scene) {
            return this;
        }
        const textureSize = this.getSize();
        const newTexture = new RefractionTexture(this.name, textureSize.width, scene, this._generateMipMaps);
        // Base texture
        newTexture.hasAlpha = this.hasAlpha;
        newTexture.level = this.level;
        // Refraction Texture
        newTexture.refractionPlane = this.refractionPlane.clone();
        if (this.renderList) {
            newTexture.renderList = this.renderList.slice(0);
        }
        newTexture.depth = this.depth;
        return newTexture;
    }
    /**
     * Serialize the texture to a JSON representation you could use in Parse later on
     * @returns the serialized JSON representation
     */
    serialize() {
        if (!this.name) {
            return null;
        }
        const serializationObject = super.serialize();
        serializationObject.mirrorPlane = this.refractionPlane.asArray();
        serializationObject.depth = this.depth;
        return serializationObject;
    }
}
//# sourceMappingURL=refractionTexture.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/textureSampler.js
var textureSampler = __webpack_require__(38573);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/thinTexture.js
var thinTexture = __webpack_require__(35928);
;// ./node_modules/@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js

/**
 * This is a tiny helper class to wrap a RenderTargetWrapper in a texture
 * usable as the input of an effect.
 */
class ThinRenderTargetTexture extends thinTexture/* ThinTexture */.D {
    /**
     * Gets the render target wrapper associated with this render target
     */
    get renderTarget() {
        return this._renderTarget;
    }
    /**
     * Instantiates a new ThinRenderTargetTexture.
     * Tiny helper class to wrap a RenderTargetWrapper in a texture.
     * This can be used as an internal texture wrapper in ThinEngine to benefit from the cache and to hold on the associated RTT
     * @param engine Define the internalTexture to wrap
     * @param size Define the size of the RTT to create
     * @param options Define rendertarget options
     */
    constructor(engine, size, options) {
        super(null);
        this._renderTarget = null;
        this._engine = engine;
        this._renderTargetOptions = options;
        this.resize(size);
    }
    /**
     * Resize the texture to a new desired size.
     * Be careful as it will recreate all the data in the new texture.
     * @param size Define the new size. It can be:
     *   - a number for squared texture,
     *   - an object containing { width: number, height: number }
     */
    resize(size) {
        this._renderTarget?.dispose();
        this._renderTarget = null;
        this._texture = null;
        this._size = size;
        if (this._engine) {
            this._renderTarget = this._engine.createRenderTargetTexture(this._size, this._renderTargetOptions);
        }
        this._texture = this.renderTarget.texture;
    }
    /**
     * Get the underlying lower level texture from Babylon.
     * @returns the internal texture
     */
    getInternalTexture() {
        return this._texture;
    }
    /**
     * Get the class name of the texture.
     * @returns "ThinRenderTargetTexture"
     */
    getClassName() {
        return "ThinRenderTargetTexture";
    }
    /**
     * Dispose the texture and release its associated resources.
     * @param disposeOnlyFramebuffers if set to true it will dispose only the frame buffers (default: false)
     */
    dispose(disposeOnlyFramebuffers = false) {
        this._renderTarget?.dispose(true);
        this._renderTarget = null;
        if (!disposeOnlyFramebuffers) {
            super.dispose();
        }
    }
}
//# sourceMappingURL=thinRenderTargetTexture.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/Textures/ktx2decoderTypes.js
var ktx2decoderTypes = __webpack_require__(60572);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/procedural.vertex.js
var procedural_vertex = __webpack_require__(14005);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/procedural.vertex.js
var Shaders_procedural_vertex = __webpack_require__(17156);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/hdrFiltering.vertex.js
var hdrFiltering_vertex = __webpack_require__(86109);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/hdrFiltering.fragment.js
var hdrFiltering_fragment = __webpack_require__(55779);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/hdrFiltering.vertex.js
var ShadersWGSL_hdrFiltering_vertex = __webpack_require__(92248);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/hdrFiltering.fragment.js
var ShadersWGSL_hdrFiltering_fragment = __webpack_require__(50274);
;// ./node_modules/@babylonjs/core/Materials/Textures/index.js
/* eslint-disable import/no-internal-modules */

// eslint-disable-next-line import/export




























// Shaders for procedural textures


// HDR filtering




//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.js
/**
 * Enum defining the mode of a NodeMaterialBlockConnectionPoint
 */
var NodeMaterialBlockConnectionPointMode;
(function (NodeMaterialBlockConnectionPointMode) {
    /** Value is an uniform */
    NodeMaterialBlockConnectionPointMode[NodeMaterialBlockConnectionPointMode["Uniform"] = 0] = "Uniform";
    /** Value is a mesh attribute */
    NodeMaterialBlockConnectionPointMode[NodeMaterialBlockConnectionPointMode["Attribute"] = 1] = "Attribute";
    /** Value is a varying between vertex and fragment shaders */
    NodeMaterialBlockConnectionPointMode[NodeMaterialBlockConnectionPointMode["Varying"] = 2] = "Varying";
    /** Mode is undefined */
    NodeMaterialBlockConnectionPointMode[NodeMaterialBlockConnectionPointMode["Undefined"] = 3] = "Undefined";
})(NodeMaterialBlockConnectionPointMode || (NodeMaterialBlockConnectionPointMode = {}));
//# sourceMappingURL=nodeMaterialBlockConnectionPointMode.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Enums/index.js





//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialConnectionPointCustomObject.js

/**
 * Defines a connection point to be used for points with a custom object type
 */
class NodeMaterialConnectionPointCustomObject extends NodeMaterialConnectionPoint {
    /**
     * Creates a new connection point
     * @param name defines the connection point name
     * @param ownerBlock defines the block hosting this connection point
     * @param direction defines the direction of the connection point
     * @param _blockType
     * @param _blockName
     */
    constructor(name, ownerBlock, direction, 
    // @internal
    _blockType, _blockName) {
        super(name, ownerBlock, direction);
        this._blockType = _blockType;
        this._blockName = _blockName;
        this.needDualDirectionValidation = true;
    }
    /**
     * Gets a number indicating if the current point can be connected to another point
     * @param connectionPoint defines the other connection point
     * @returns a number defining the compatibility state
     */
    checkCompatibilityState(connectionPoint) {
        return connectionPoint instanceof NodeMaterialConnectionPointCustomObject && connectionPoint._blockName === this._blockName
            ? 0 /* NodeMaterialConnectionPointCompatibilityStates.Compatible */
            : 1 /* NodeMaterialConnectionPointCompatibilityStates.TypeIncompatible */;
    }
    /**
     * Creates a block suitable to be used as an input for this input point.
     * If null is returned, a block based on the point type will be created.
     * @returns The returned string parameter is the name of the output point of NodeMaterialBlock (first parameter of the returned array) that can be connected to the input
     */
    createCustomInputBlock() {
        return [new this._blockType(this._blockName), this.name];
    }
}
//# sourceMappingURL=nodeMaterialConnectionPointCustomObject.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js





/**
 * Block used for the Gaussian Splatting
 */
class GaussianSplattingBlock extends NodeMaterialBlock {
    /**
     * Create a new GaussianSplattingBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Vertex);
        this._isUnique = true;
        this.registerInput("splatPosition", NodeMaterialBlockConnectionPointTypes.Vector3, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("splatScale", NodeMaterialBlockConnectionPointTypes.Vector2, true, NodeMaterialBlockTargets.Vertex);
        this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("projection", NodeMaterialBlockConnectionPointTypes.Matrix, false, NodeMaterialBlockTargets.Vertex);
        this.registerOutput("splatVertex", NodeMaterialBlockConnectionPointTypes.Vector4, NodeMaterialBlockTargets.Vertex);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GaussianSplattingBlock";
    }
    /**
     * Gets the position input component
     */
    get splatPosition() {
        return this._inputs[0];
    }
    /**
     * Gets the scale input component
     */
    get splatScale() {
        return this._inputs[1];
    }
    /**
     * Gets the View matrix input component
     */
    get world() {
        return this._inputs[2];
    }
    /**
     * Gets the View matrix input component
     */
    get view() {
        return this._inputs[3];
    }
    /**
     * Gets the projection matrix input component
     */
    get projection() {
        return this._inputs[4];
    }
    /**
     * Gets the splatVertex output component
     */
    get splatVertex() {
        return this._outputs[0];
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("focal");
        state._excludeVariableName("invViewport");
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            return;
        }
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("gaussianSplattingVertexDeclaration", comments);
        state._emitFunctionFromInclude("gaussianSplatting", comments);
        state._emitUniformFromString("focal", NodeMaterialBlockConnectionPointTypes.Vector2);
        state._emitUniformFromString("invViewport", NodeMaterialBlockConnectionPointTypes.Vector2);
        state.attributes.push(Meshes_buffer/* VertexBuffer */.R.PositionKind);
        state.sharedData.nodeMaterial.backFaceCulling = false;
        const splatPosition = this.splatPosition;
        const splatScale = this.splatScale;
        const world = this.world;
        const view = this.view;
        const projection = this.projection;
        const output = this.splatVertex;
        const addF = state.fSuffix;
        let splatScaleParameter = `vec2${addF}(1.,1.)`;
        if (splatScale.isConnected) {
            splatScaleParameter = splatScale.associatedVariableName;
        }
        let input = "position";
        let uniforms = "";
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            input = "input.position";
            uniforms = ", uniforms.focal, uniforms.invViewport";
        }
        state.compilationString += `${state._declareOutput(output)} = gaussianSplatting(${input}, ${splatPosition.associatedVariableName}, ${splatScaleParameter}, covA, covB, ${world.associatedVariableName}, ${view.associatedVariableName}, ${projection.associatedVariableName}${uniforms});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GaussianSplattingBlock", GaussianSplattingBlock);
//# sourceMappingURL=gaussianSplattingBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.js




/**
 * Block used for the Gaussian Splatting Fragment part
 */
class GaussianBlock extends NodeMaterialBlock {
    /**
     * Create a new GaussianBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this._isUnique = false;
        this.registerInput("splatColor", NodeMaterialBlockConnectionPointTypes.Color4, false, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GaussianBlock";
    }
    /**
     * Gets the color input component
     */
    get splatColor() {
        return this._inputs[0];
    }
    /**
     * Gets the rgba output component
     */
    get rgba() {
        return this._outputs[0];
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("vPosition");
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Vertex) {
            return;
        }
        // Emit code
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("clipPlaneFragmentDeclaration", comments);
        state._emitFunctionFromInclude("logDepthDeclaration", comments);
        state._emitFunctionFromInclude("fogFragmentDeclaration", comments);
        state._emitFunctionFromInclude("gaussianSplattingFragmentDeclaration", comments);
        state._emitVaryingFromString("vPosition", NodeMaterialBlockConnectionPointTypes.Vector2);
        const color = this.splatColor;
        const output = this._outputs[0];
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            state.compilationString += `${state._declareOutput(output)} = gaussianColor(${color.associatedVariableName}, input.vPosition);\n`;
        }
        else {
            state.compilationString += `${state._declareOutput(output)} = gaussianColor(${color.associatedVariableName});\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GaussianBlock", GaussianBlock);
//# sourceMappingURL=gaussianBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/GaussianSplatting/gaussianSplattingMaterial.js
var gaussianSplattingMaterial = __webpack_require__(20927);
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js





/**
 * Block used for Reading components of the Gaussian Splatting
 */
class SplatReaderBlock extends NodeMaterialBlock {
    /**
     * Create a new SplatReaderBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Vertex);
        this._isUnique = true;
        this.registerInput("splatIndex", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Vertex);
        this.registerOutput("splatPosition", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Vertex);
        this.registerOutput("splatColor", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Vertex);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SplatReaderBlock";
    }
    /**
     * Gets the splat index input component
     */
    get splatIndex() {
        return this._inputs[0];
    }
    /**
     * Gets the splatPosition output component
     */
    get splatPosition() {
        return this._outputs[0];
    }
    /**
     * Gets the splatColor output component
     */
    get splatColor() {
        return this._outputs[1];
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("covA");
        state._excludeVariableName("covB");
        state._excludeVariableName("vPosition");
        state._excludeVariableName("covariancesATexture");
        state._excludeVariableName("covariancesBTexture");
        state._excludeVariableName("centersTexture");
        state._excludeVariableName("colorsTexture");
        state._excludeVariableName("dataTextureSize");
    }
    bind(effect, nodeMaterial, mesh) {
        if (!mesh) {
            return;
        }
        const scene = mesh.getScene();
        gaussianSplattingMaterial/* GaussianSplattingMaterial */.b.BindEffect(mesh, effect, scene);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            return;
        }
        state.sharedData.bindableBlocks.push(this);
        // Emit code
        const comments = `//${this.name}`;
        state._emit2DSampler("covariancesATexture");
        state._emit2DSampler("covariancesBTexture");
        state._emit2DSampler("centersTexture");
        state._emit2DSampler("colorsTexture");
        state._emitFunctionFromInclude("gaussianSplattingVertexDeclaration", comments);
        state._emitFunctionFromInclude("gaussianSplatting", comments);
        state._emitVaryingFromString("vPosition", NodeMaterialBlockConnectionPointTypes.Vector2);
        state._emitUniformFromString("dataTextureSize", NodeMaterialBlockConnectionPointTypes.Vector2);
        const splatIndex = this.splatIndex;
        const splatPosition = this.splatPosition;
        const splatColor = this.splatColor;
        const splatVariablename = state._getFreeVariableName("splat");
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            state.compilationString += `var ${splatVariablename}: Splat = readSplat(${splatIndex.associatedVariableName}, uniforms.dataTextureSize);\n`;
            state.compilationString += `var covA: vec3f = splat.covA.xyz; var covB: vec3f = vec3f(splat.covA.w, splat.covB.xy);\n`;
            state.compilationString += "vertexOutputs.vPosition = input.position;\n";
        }
        else {
            state.compilationString += `Splat ${splatVariablename} = readSplat(${splatIndex.associatedVariableName});\n`;
            state.compilationString += `vec3 covA = splat.covA.xyz; vec3 covB = vec3(splat.covA.w, splat.covB.xy);\n`;
            state.compilationString += "vPosition = position;\n";
        }
        state.compilationString += `${state._declareOutput(splatPosition)} = ${splatVariablename}.center.xyz;\n`;
        state.compilationString += `${state._declareOutput(splatColor)} = ${splatVariablename}.color;\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SplatReaderBlock", SplatReaderBlock);
//# sourceMappingURL=splatReaderBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/nodeMaterialDefault.js









/**
 * Clear the material and set it to a default state for gaussian splatting
 * @param nodeMaterial node material to use
 */
function SetToDefaultGaussianSplatting(nodeMaterial) {
    nodeMaterial.clear();
    nodeMaterial.editorData = null;
    // reading splat datas
    const splatIndex = new InputBlock("SplatIndex");
    splatIndex.setAsAttribute("splatIndex");
    const splatReader = new SplatReaderBlock("SplatReader");
    splatIndex.connectTo(splatReader);
    // transforming datas into renderable positions
    const gs = new GaussianSplattingBlock("GaussianSplatting");
    splatReader.connectTo(gs);
    // world transformation
    const worldInput = new InputBlock("World");
    worldInput.setAsSystemValue(NodeMaterialSystemValues.World);
    const worldPos = new TransformBlock("WorldPos");
    splatReader.connectTo(worldPos);
    worldInput.connectTo(worldPos);
    worldPos.connectTo(gs, { output: "xyz", input: "splatPosition" });
    // view and projections
    const view = new InputBlock("view");
    view.setAsSystemValue(NodeMaterialSystemValues.View);
    const projection = new InputBlock("Projection");
    projection.setAsSystemValue(NodeMaterialSystemValues.Projection);
    worldInput.connectTo(gs, { input: "world" });
    view.connectTo(gs, { input: "view" });
    projection.connectTo(gs, { input: "projection" });
    // from color to gaussian color
    const gaussian = new GaussianBlock("Gaussian");
    splatReader.connectTo(gaussian, { input: "splatColor", output: "splatColor" });
    // fragment and vertex outputs
    const fragmentOutput = new FragmentOutputBlock("FragmentOutput");
    gaussian.connectTo(fragmentOutput);
    const vertexOutput = new VertexOutputBlock("VertexOutput");
    gs.connectTo(vertexOutput);
    // Add to nodes
    nodeMaterial.addOutputNode(vertexOutput);
    nodeMaterial.addOutputNode(fragmentOutput);
    nodeMaterial._mode = NodeMaterialModes.GaussianSplatting;
}
//# sourceMappingURL=nodeMaterialDefault.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/bonesBlock.js







/**
 * Block used to add support for vertex skinning (bones)
 */
class BonesBlock extends NodeMaterialBlock {
    /**
     * Creates a new BonesBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Vertex);
        this.registerInput("matricesIndices", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("matricesWeights", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("matricesIndicesExtra", NodeMaterialBlockConnectionPointTypes.Vector4, true);
        this.registerInput("matricesWeightsExtra", NodeMaterialBlockConnectionPointTypes.Vector4, true);
        this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("boneSampler");
        state._excludeVariableName("boneTextureWidth");
        state._excludeVariableName("mBones");
        state._excludeVariableName("BonesPerMesh");
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 32806)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 65470))]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 69707)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3361))]);
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "BonesBlock";
    }
    /**
     * Gets the matrix indices input component
     */
    get matricesIndices() {
        return this._inputs[0];
    }
    /**
     * Gets the matrix weights input component
     */
    get matricesWeights() {
        return this._inputs[1];
    }
    /**
     * Gets the extra matrix indices input component
     */
    get matricesIndicesExtra() {
        return this._inputs[2];
    }
    /**
     * Gets the extra matrix weights input component
     */
    get matricesWeightsExtra() {
        return this._inputs[3];
    }
    /**
     * Gets the world input component
     */
    get world() {
        return this._inputs[4];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.matricesIndices.isConnected) {
            let matricesIndicesInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "matricesIndices" && additionalFilteringInfo(b));
            if (!matricesIndicesInput) {
                matricesIndicesInput = new InputBlock("matricesIndices");
                matricesIndicesInput.setAsAttribute("matricesIndices");
            }
            matricesIndicesInput.output.connectTo(this.matricesIndices);
        }
        if (!this.matricesWeights.isConnected) {
            let matricesWeightsInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "matricesWeights" && additionalFilteringInfo(b));
            if (!matricesWeightsInput) {
                matricesWeightsInput = new InputBlock("matricesWeights");
                matricesWeightsInput.setAsAttribute("matricesWeights");
            }
            matricesWeightsInput.output.connectTo(this.matricesWeights);
        }
        if (!this.world.isConnected) {
            let worldInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.World && additionalFilteringInfo(b));
            if (!worldInput) {
                worldInput = new InputBlock("world");
                worldInput.setAsSystemValue(NodeMaterialSystemValues.World);
            }
            worldInput.output.connectTo(this.world);
        }
    }
    provideFallbacks(mesh, fallbacks) {
        if (mesh && mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
            fallbacks.addCPUSkinningFallback(0, mesh);
        }
    }
    bind(effect, nodeMaterial, mesh) {
        (0,materialHelper_functions/* BindBonesParameters */.f$)(mesh, effect);
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        if (!defines._areAttributesDirty) {
            return;
        }
        (0,materialHelper_functions/* PrepareDefinesForBones */.IC)(mesh, defines);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        // Register for compilation fallbacks
        state.sharedData.blocksWithFallbacks.push(this);
        // Register for binding
        state.sharedData.forcedBindableBlocks.push(this);
        // Register for defines
        state.sharedData.blocksWithDefines.push(this);
        // Register internal uniforms and samplers
        state.uniforms.push("boneTextureWidth");
        state.uniforms.push("mBones");
        state.samplers.push("boneSampler");
        // Emit code
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("bonesDeclaration", comments, {
            removeAttributes: true,
            removeUniforms: false,
            removeVaryings: true,
            removeIfDef: false,
        });
        const influenceVariablename = state._getFreeVariableName("influence");
        state.compilationString += state._emitCodeFromInclude("bonesVertex", comments, {
            replaceStrings: [
                {
                    search: /finalWorld=finalWorld\*influence;/,
                    replace: "",
                },
                {
                    search: /influence/gm,
                    replace: influenceVariablename,
                },
            ],
        });
        const output = this._outputs[0];
        const worldInput = this.world;
        state.compilationString += `#if NUM_BONE_INFLUENCERS>0\n`;
        state.compilationString += state._declareOutput(output) + ` = ${worldInput.associatedVariableName} * ${influenceVariablename};\n`;
        state.compilationString += `#else\n`;
        state.compilationString += state._declareOutput(output) + ` = ${worldInput.associatedVariableName};\n`;
        state.compilationString += `#endif\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BonesBlock", BonesBlock);
//# sourceMappingURL=bonesBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/instancesBlock.js






/**
 * Block used to add support for instances
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
 */
class InstancesBlock extends NodeMaterialBlock {
    /**
     * Creates a new InstancesBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Vertex);
        this.registerInput("world0", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("world1", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("world2", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("world3", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, true);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix);
        this.registerOutput("instanceID", NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "InstancesBlock";
    }
    /**
     * Gets the first world row input component
     */
    get world0() {
        return this._inputs[0];
    }
    /**
     * Gets the second world row input component
     */
    get world1() {
        return this._inputs[1];
    }
    /**
     * Gets the third world row input component
     */
    get world2() {
        return this._inputs[2];
    }
    /**
     * Gets the forth world row input component
     */
    get world3() {
        return this._inputs[3];
    }
    /**
     * Gets the world input component
     */
    get world() {
        return this._inputs[4];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the instanceID component
     */
    get instanceID() {
        return this._outputs[1];
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.world0.connectedPoint) {
            let world0Input = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "world0" && additionalFilteringInfo(b));
            if (!world0Input) {
                world0Input = new InputBlock("world0");
                world0Input.setAsAttribute("world0");
            }
            world0Input.output.connectTo(this.world0);
        }
        if (!this.world1.connectedPoint) {
            let world1Input = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "world1" && additionalFilteringInfo(b));
            if (!world1Input) {
                world1Input = new InputBlock("world1");
                world1Input.setAsAttribute("world1");
            }
            world1Input.output.connectTo(this.world1);
        }
        if (!this.world2.connectedPoint) {
            let world2Input = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "world2" && additionalFilteringInfo(b));
            if (!world2Input) {
                world2Input = new InputBlock("world2");
                world2Input.setAsAttribute("world2");
            }
            world2Input.output.connectTo(this.world2);
        }
        if (!this.world3.connectedPoint) {
            let world3Input = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "world3" && additionalFilteringInfo(b));
            if (!world3Input) {
                world3Input = new InputBlock("world3");
                world3Input.setAsAttribute("world3");
            }
            world3Input.output.connectTo(this.world3);
        }
        if (!this.world.connectedPoint) {
            let worldInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "world" && additionalFilteringInfo(b));
            if (!worldInput) {
                worldInput = new InputBlock("world");
                worldInput.setAsSystemValue(NodeMaterialSystemValues.World);
            }
            worldInput.output.connectTo(this.world);
        }
        this.world.define = "!INSTANCES || THIN_INSTANCES";
    }
    prepareDefines(mesh, nodeMaterial, defines, useInstances = false, subMesh) {
        let changed = false;
        if (defines["INSTANCES"] !== useInstances) {
            defines.setValue("INSTANCES", useInstances);
            changed = true;
        }
        if (subMesh && defines["THIN_INSTANCES"] !== !!subMesh?.getRenderingMesh().hasThinInstances) {
            defines.setValue("THIN_INSTANCES", !!subMesh?.getRenderingMesh().hasThinInstances);
            changed = true;
        }
        if (changed) {
            defines.markAsUnprocessed();
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const engine = state.sharedData.scene.getEngine();
        // Register for defines
        state.sharedData.blocksWithDefines.push(this);
        // Emit code
        const output = this._outputs[0];
        const instanceID = this._outputs[1];
        const world0 = this.world0;
        const world1 = this.world1;
        const world2 = this.world2;
        const world3 = this.world3;
        let mat4 = "mat4";
        let instance = "gl_InstanceID";
        let floatCast = "float";
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            mat4 = "mat4x4f";
            instance = "vertexInputs.instanceIndex";
            floatCast = "f32";
        }
        state.compilationString += `#ifdef INSTANCES\n`;
        state.compilationString +=
            state._declareOutput(output) +
                ` = ${mat4}(${world0.associatedVariableName}, ${world1.associatedVariableName}, ${world2.associatedVariableName}, ${world3.associatedVariableName});\n`;
        state.compilationString += `#ifdef THIN_INSTANCES\n`;
        state.compilationString += `${output.associatedVariableName} = ${this.world.associatedVariableName} * ${output.associatedVariableName};\n`;
        state.compilationString += `#endif\n`;
        if (engine._caps.canUseGLInstanceID) {
            state.compilationString += state._declareOutput(instanceID) + ` = ${floatCast}(${instance});\n`;
        }
        else {
            state.compilationString += state._declareOutput(instanceID) + ` = 0.0;\n`;
        }
        state.compilationString += `#else\n`;
        state.compilationString += state._declareOutput(output) + ` = ${this.world.associatedVariableName};\n`;
        state.compilationString += state._declareOutput(instanceID) + ` = 0.0;\n`;
        state.compilationString += `#endif\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.InstancesBlock", InstancesBlock);
//# sourceMappingURL=instancesBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/morphTargetsBlock.js







/**
 * Block used to add morph targets support to vertex shader
 */
class MorphTargetsBlock extends NodeMaterialBlock {
    /**
     * Create a new MorphTargetsBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Vertex);
        this.registerInput("position", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerInput("tangent", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.tangent.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerOutput("positionOutput", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerOutput("normalOutput", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerOutput("tangentOutput", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerOutput("uvOutput", NodeMaterialBlockConnectionPointTypes.Vector2);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MorphTargetsBlock";
    }
    /**
     * Gets the position input component
     */
    get position() {
        return this._inputs[0];
    }
    /**
     * Gets the normal input component
     */
    get normal() {
        return this._inputs[1];
    }
    /**
     * Gets the tangent input component
     */
    get tangent() {
        return this._inputs[2];
    }
    /**
     * Gets the tangent input component
     */
    get uv() {
        return this._inputs[3];
    }
    /**
     * Gets the position output component
     */
    get positionOutput() {
        return this._outputs[0];
    }
    /**
     * Gets the normal output component
     */
    get normalOutput() {
        return this._outputs[1];
    }
    /**
     * Gets the tangent output component
     */
    get tangentOutput() {
        return this._outputs[2];
    }
    /**
     * Gets the tangent output component
     */
    get uvOutput() {
        return this._outputs[3];
    }
    initialize(state) {
        state._excludeVariableName("morphTargetInfluences");
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 9129)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 8217)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 18258)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 76340)),
            ]);
        }
        else {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 15060)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 90738)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 48451)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 27999)),
            ]);
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.position.isConnected) {
            let positionInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "position" && additionalFilteringInfo(b));
            if (!positionInput) {
                positionInput = new InputBlock("position");
                positionInput.setAsAttribute();
            }
            positionInput.output.connectTo(this.position);
        }
        if (!this.normal.isConnected) {
            let normalInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "normal" && additionalFilteringInfo(b));
            if (!normalInput) {
                normalInput = new InputBlock("normal");
                normalInput.setAsAttribute("normal");
            }
            normalInput.output.connectTo(this.normal);
        }
        if (!this.tangent.isConnected) {
            let tangentInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "tangent" && additionalFilteringInfo(b));
            if (!tangentInput) {
                tangentInput = new InputBlock("tangent");
                tangentInput.setAsAttribute("tangent");
            }
            tangentInput.output.connectTo(this.tangent);
        }
        if (!this.uv.isConnected) {
            let uvInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "uv" && additionalFilteringInfo(b));
            if (!uvInput) {
                uvInput = new InputBlock("uv");
                uvInput.setAsAttribute("uv");
            }
            uvInput.output.connectTo(this.uv);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        if (mesh.morphTargetManager) {
            const morphTargetManager = mesh.morphTargetManager;
            if (morphTargetManager?.isUsingTextureForTargets && (morphTargetManager.numMaxInfluencers || morphTargetManager.numInfluencers) !== defines["NUM_MORPH_INFLUENCERS"]) {
                defines.markAsAttributesDirty();
            }
        }
        if (!defines._areAttributesDirty) {
            return;
        }
        (0,materialHelper_functions/* PrepareDefinesForMorphTargets */.Jz)(mesh, defines);
    }
    bind(effect, nodeMaterial, mesh) {
        if (mesh && mesh.morphTargetManager && mesh.morphTargetManager.numInfluencers > 0) {
            (0,materialHelper_functions/* BindMorphTargetParameters */.nR)(mesh, effect);
            if (mesh.morphTargetManager.isUsingTextureForTargets) {
                mesh.morphTargetManager._bind(effect);
            }
        }
    }
    replaceRepeatableContent(vertexShaderState, fragmentShaderState, mesh, defines) {
        const position = this.position;
        const normal = this.normal;
        const tangent = this.tangent;
        const uv = this.uv;
        const positionOutput = this.positionOutput;
        const normalOutput = this.normalOutput;
        const tangentOutput = this.tangentOutput;
        const uvOutput = this.uvOutput;
        const state = vertexShaderState;
        const repeatCount = defines.NUM_MORPH_INFLUENCERS;
        const manager = mesh.morphTargetManager;
        const hasNormals = manager && manager.supportsNormals && defines["NORMAL"];
        const hasTangents = manager && manager.supportsTangents && defines["TANGENT"];
        const hasUVs = manager && manager.supportsUVs && defines["UV1"];
        let injectionCode = "";
        if (manager?.isUsingTextureForTargets && repeatCount > 0) {
            injectionCode += `${state._declareLocalVar("vertexID", NodeMaterialBlockConnectionPointTypes.Float)};\n`;
        }
        injectionCode += `#ifdef MORPHTARGETS\n`;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        const uniformsPrefix = isWebGPU ? "uniforms." : "";
        if (manager?.isUsingTextureForTargets) {
            injectionCode += `for (${isWebGPU ? "var" : "int"} i = 0; i < NUM_MORPH_INFLUENCERS; i++) {\n`;
            injectionCode += `if (i >= ${uniformsPrefix}morphTargetCount) { break; }\n`;
            injectionCode += `vertexID = ${isWebGPU ? "f32(vertexInputs.vertexIndex" : "float(gl_VertexID"}) * ${uniformsPrefix}morphTargetTextureInfo.x;\n`;
            injectionCode += `${positionOutput.associatedVariableName} += (readVector3FromRawSampler(i, vertexID) - ${position.associatedVariableName}) * ${uniformsPrefix}morphTargetInfluences[i];\n`;
            injectionCode += `vertexID += 1.0;\n`;
            if (hasNormals) {
                injectionCode += `#ifdef MORPHTARGETS_NORMAL\n`;
                injectionCode += `${normalOutput.associatedVariableName} += (readVector3FromRawSampler(i, vertexID) - ${normal.associatedVariableName}) * ${uniformsPrefix}morphTargetInfluences[i];\n`;
                injectionCode += `vertexID += 1.0;\n`;
                injectionCode += `#endif\n`;
            }
            if (hasUVs) {
                injectionCode += `#ifdef MORPHTARGETS_UV\n`;
                injectionCode += `${uvOutput.associatedVariableName} += (readVector3FromRawSampler(i, vertexID).xy - ${uv.associatedVariableName}) * ${uniformsPrefix}morphTargetInfluences[i];\n`;
                injectionCode += `vertexID += 1.0;\n`;
                injectionCode += `#endif\n`;
            }
            if (hasTangents) {
                injectionCode += `#ifdef MORPHTARGETS_TANGENT\n`;
                injectionCode += `${tangentOutput.associatedVariableName}.xyz += (readVector3FromRawSampler(i, vertexID) - ${tangent.associatedVariableName}.xyz) * ${uniformsPrefix}morphTargetInfluences[i];\n`;
                if (tangent.type === NodeMaterialBlockConnectionPointTypes.Vector4) {
                    injectionCode += `${tangentOutput.associatedVariableName}.w = ${tangent.associatedVariableName}.w;\n`;
                }
                else {
                    injectionCode += `${tangentOutput.associatedVariableName}.w = 1.;\n`;
                }
                injectionCode += `#endif\n`;
            }
            injectionCode += "}\n";
        }
        else {
            for (let index = 0; index < repeatCount; index++) {
                injectionCode += `${positionOutput.associatedVariableName} += (position${index} - ${position.associatedVariableName}) * ${uniformsPrefix}morphTargetInfluences[${index}];\n`;
                if (hasNormals) {
                    injectionCode += `#ifdef MORPHTARGETS_NORMAL\n`;
                    injectionCode += `${normalOutput.associatedVariableName} += (normal${index} - ${normal.associatedVariableName}) * ${uniformsPrefix}morphTargetInfluences[${index}];\n`;
                    injectionCode += `#endif\n`;
                }
                if (hasUVs) {
                    injectionCode += `#ifdef MORPHTARGETS_UV\n`;
                    injectionCode += `${uvOutput.associatedVariableName}.xy += (uv_${index} - ${uv.associatedVariableName}.xy) * ${uniformsPrefix}morphTargetInfluences[${index}];\n`;
                    injectionCode += `#endif\n`;
                }
                if (hasTangents) {
                    injectionCode += `#ifdef MORPHTARGETS_TANGENT\n`;
                    injectionCode += `${tangentOutput.associatedVariableName}.xyz += (tangent${index} - ${tangent.associatedVariableName}.xyz) * ${uniformsPrefix}morphTargetInfluences[${index}];\n`;
                    if (tangent.type === NodeMaterialBlockConnectionPointTypes.Vector4) {
                        injectionCode += `${tangentOutput.associatedVariableName}.w = ${tangent.associatedVariableName}.w;\n`;
                    }
                    else {
                        injectionCode += `${tangentOutput.associatedVariableName}.w = 1.;\n`;
                    }
                    injectionCode += `#endif\n`;
                }
            }
        }
        injectionCode += `#endif\n`;
        state.compilationString = state.compilationString.replace(this._repeatableContentAnchor, injectionCode);
        if (repeatCount > 0) {
            for (let index = 0; index < repeatCount; index++) {
                state.attributes.push(Buffers_buffer/* VertexBuffer */.R.PositionKind + index);
                if (hasNormals) {
                    state.attributes.push(Buffers_buffer/* VertexBuffer */.R.NormalKind + index);
                }
                if (hasTangents) {
                    state.attributes.push(Buffers_buffer/* VertexBuffer */.R.TangentKind + index);
                }
                if (hasUVs) {
                    state.attributes.push(Buffers_buffer/* VertexBuffer */.R.UVKind + "_" + index);
                }
            }
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        // Register for defines
        state.sharedData.blocksWithDefines.push(this);
        // Register for binding
        state.sharedData.bindableBlocks.push(this);
        // Register for repeatable content generation
        state.sharedData.repeatableContentBlocks.push(this);
        // Emit code
        const position = this.position;
        const normal = this.normal;
        const tangent = this.tangent;
        const uv = this.uv;
        const positionOutput = this.positionOutput;
        const normalOutput = this.normalOutput;
        const tangentOutput = this.tangentOutput;
        const uvOutput = this.uvOutput;
        const comments = `//${this.name}`;
        state.uniforms.push("morphTargetInfluences");
        state.uniforms.push("morphTargetCount");
        state.uniforms.push("morphTargetTextureInfo");
        state.uniforms.push("morphTargetTextureIndices");
        state.samplers.push("morphTargets");
        state._emitFunctionFromInclude("morphTargetsVertexGlobalDeclaration", comments);
        state._emitFunctionFromInclude("morphTargetsVertexDeclaration", comments, {
            repeatKey: "maxSimultaneousMorphTargets",
        });
        state.compilationString += `${state._declareOutput(positionOutput)} = ${position.associatedVariableName};\n`;
        state.compilationString += `#ifdef NORMAL\n`;
        state.compilationString += `${state._declareOutput(normalOutput)} = ${normal.associatedVariableName};\n`;
        state.compilationString += `#else\n`;
        state.compilationString += `${state._declareOutput(normalOutput)} = vec3(0., 0., 0.);\n`;
        state.compilationString += `#endif\n`;
        state.compilationString += `#ifdef TANGENT\n`;
        state.compilationString += `${state._declareOutput(tangentOutput)} = ${tangent.associatedVariableName};\n`;
        state.compilationString += `#else\n`;
        state.compilationString += `${state._declareOutput(tangentOutput)} = vec4(0., 0., 0., 0.);\n`;
        state.compilationString += `#endif\n`;
        state.compilationString += `#ifdef UV1\n`;
        state.compilationString += `${state._declareOutput(uvOutput)} = ${uv.associatedVariableName};\n`;
        state.compilationString += `#else\n`;
        state.compilationString += `${state._declareOutput(uvOutput)} = vec2(0., 0.);\n`;
        state.compilationString += `#endif\n`;
        // Repeatable content
        this._repeatableContentAnchor = state._repeatableContentAnchor;
        state.compilationString += this._repeatableContentAnchor;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MorphTargetsBlock", MorphTargetsBlock);
//# sourceMappingURL=morphTargetsBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/lightInformationBlock.js





/**
 * Block used to get data information from a light
 */
class LightInformationBlock extends NodeMaterialBlock {
    /**
     * Creates a new LightInformationBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Vertex);
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Vertex);
        this.registerOutput("direction", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerOutput("color", NodeMaterialBlockConnectionPointTypes.Color3);
        this.registerOutput("intensity", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("shadowBias", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("shadowNormalBias", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("shadowDepthScale", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("shadowDepthRange", NodeMaterialBlockConnectionPointTypes.Vector2);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "LightInformationBlock";
    }
    /**
     * Gets the world position input component
     */
    get worldPosition() {
        return this._inputs[0];
    }
    /**
     * Gets the direction output component
     */
    get direction() {
        return this._outputs[0];
    }
    /**
     * Gets the direction output component
     */
    get color() {
        return this._outputs[1];
    }
    /**
     * Gets the direction output component
     */
    get intensity() {
        return this._outputs[2];
    }
    /**
     * Gets the shadow bias output component
     */
    get shadowBias() {
        return this._outputs[3];
    }
    /**
     * Gets the shadow normal bias output component
     */
    get shadowNormalBias() {
        return this._outputs[4];
    }
    /**
     * Gets the shadow depth scale component
     */
    get shadowDepthScale() {
        return this._outputs[5];
    }
    /**
     * Gets the shadow depth range component
     */
    get shadowDepthRange() {
        return this._outputs[6];
    }
    bind(effect, nodeMaterial, mesh) {
        if (!mesh) {
            return;
        }
        if (this.light && this.light.isDisposed()) {
            this.light = null;
        }
        let light = this.light;
        const scene = nodeMaterial.getScene();
        if (!light && scene.lights.length) {
            light = this.light = scene.lights[0];
            this._forcePrepareDefines = true;
        }
        if (!light || !light.isEnabled) {
            effect.setFloat3(this._lightDataUniformName, 0, 0, 0);
            effect.setFloat4(this._lightColorUniformName, 0, 0, 0, 0);
            return;
        }
        light.transferToNodeMaterialEffect(effect, this._lightDataUniformName);
        effect.setColor4(this._lightColorUniformName, light.diffuse, light.intensity);
        const generator = light.getShadowGenerator();
        if (this.shadowBias.hasEndpoints || this.shadowNormalBias.hasEndpoints || this.shadowDepthScale.hasEndpoints) {
            if (generator) {
                effect.setFloat3(this._lightShadowUniformName, generator.bias, generator.normalBias, generator.depthScale);
            }
            else {
                effect.setFloat3(this._lightShadowUniformName, 0, 0, 0);
            }
        }
        if (this.shadowDepthRange) {
            if (generator && scene.activeCamera) {
                const shadowLight = light;
                effect.setFloat2(this._lightShadowExtraUniformName, shadowLight.getDepthMinZ(scene.activeCamera), shadowLight.getDepthMinZ(scene.activeCamera) + shadowLight.getDepthMaxZ(scene.activeCamera));
            }
            else {
                effect.setFloat2(this._lightShadowExtraUniformName, 0, 0);
            }
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        if (!defines._areLightsDirty && !this._forcePrepareDefines) {
            return;
        }
        this._forcePrepareDefines = false;
        const light = this.light;
        defines.setValue(this._lightTypeDefineName, light && light instanceof pointLight/* PointLight */.H ? true : false, true);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        state.sharedData.bindableBlocks.push(this);
        state.sharedData.blocksWithDefines.push(this);
        const direction = this.direction;
        const color = this.color;
        const intensity = this.intensity;
        const shadowBias = this.shadowBias;
        const shadowNormalBias = this.shadowNormalBias;
        const shadowDepthScale = this.shadowDepthScale;
        const shadowDepthRange = this.shadowDepthRange;
        this._lightDataUniformName = state._getFreeVariableName("lightData");
        this._lightColorUniformName = state._getFreeVariableName("lightColor");
        this._lightShadowUniformName = state._getFreeVariableName("shadowData");
        this._lightShadowExtraUniformName = state._getFreeVariableName("shadowExtraData");
        this._lightTypeDefineName = state._getFreeDefineName("LIGHTPOINTTYPE");
        const uniformAdd = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "uniforms." : "";
        state._emitUniformFromString(this._lightDataUniformName, NodeMaterialBlockConnectionPointTypes.Vector3);
        state._emitUniformFromString(this._lightColorUniformName, NodeMaterialBlockConnectionPointTypes.Vector4);
        state.compilationString += `#ifdef ${this._lightTypeDefineName}\n`;
        state.compilationString +=
            state._declareOutput(direction) + ` = normalize(${this.worldPosition.associatedVariableName}.xyz - ${uniformAdd}${this._lightDataUniformName});\n`;
        state.compilationString += `#else\n`;
        state.compilationString += state._declareOutput(direction) + ` = ${uniformAdd}${this._lightDataUniformName};\n`;
        state.compilationString += `#endif\n`;
        state.compilationString += state._declareOutput(color) + ` = ${uniformAdd}${this._lightColorUniformName}.rgb;\n`;
        state.compilationString += state._declareOutput(intensity) + ` = ${uniformAdd}${this._lightColorUniformName}.a;\n`;
        if (shadowBias.hasEndpoints || shadowNormalBias.hasEndpoints || shadowDepthScale.hasEndpoints) {
            state._emitUniformFromString(this._lightShadowUniformName, NodeMaterialBlockConnectionPointTypes.Vector3);
            if (shadowBias.hasEndpoints) {
                state.compilationString += state._declareOutput(shadowBias) + ` = ${uniformAdd}${this._lightShadowUniformName}.x;\n`;
            }
            if (shadowNormalBias.hasEndpoints) {
                state.compilationString += state._declareOutput(shadowNormalBias) + ` = ${uniformAdd}${this._lightShadowUniformName}.y;\n`;
            }
            if (shadowDepthScale.hasEndpoints) {
                state.compilationString += state._declareOutput(shadowDepthScale) + ` = ${uniformAdd}${this._lightShadowUniformName}.z;\n`;
            }
        }
        if (shadowDepthRange.hasEndpoints) {
            state._emitUniformFromString(this._lightShadowExtraUniformName, NodeMaterialBlockConnectionPointTypes.Vector2);
            state.compilationString += state._declareOutput(shadowDepthRange) + ` = ${this._lightShadowUniformName};\n`;
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        if (this.light) {
            serializationObject.lightId = this.light.id;
        }
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        if (serializationObject.lightId) {
            this.light = scene.getLightById(serializationObject.lightId);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.LightInformationBlock", LightInformationBlock);
//# sourceMappingURL=lightInformationBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js
var bonesDeclaration = __webpack_require__(32806);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js
var bonesVertex = __webpack_require__(65470);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js
var ShadersInclude_bonesDeclaration = __webpack_require__(69707);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js
var ShadersInclude_bonesVertex = __webpack_require__(3361);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertex.js
var morphTargetsVertex = __webpack_require__(9129);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js
var morphTargetsVertexDeclaration = __webpack_require__(8217);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobal.js
var morphTargetsVertexGlobal = __webpack_require__(18258);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var morphTargetsVertexGlobalDeclaration = __webpack_require__(76340);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js
var ShadersInclude_morphTargetsVertex = __webpack_require__(15060);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js
var ShadersInclude_morphTargetsVertexDeclaration = __webpack_require__(90738);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js
var ShadersInclude_morphTargetsVertexGlobal = __webpack_require__(48451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js
var ShadersInclude_morphTargetsVertexGlobalDeclaration = __webpack_require__(27999);
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/index.js





// async-loaded shaders
// bonesBlock




// morphTargetsBlock








//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/imageProcessingBlock.js






/**
 * Block used to add image processing support to fragment shader
 */
class ImageProcessingBlock extends NodeMaterialBlock {
    /**
     * Create a new ImageProcessingBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        /**
         * Defines if the input should be converted to linear space (default: true)
         */
        this.convertInputToLinearSpace = true;
        this.registerInput("color", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color4);
        this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4 |
            NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ImageProcessingBlock";
    }
    /**
     * Gets the color input component
     */
    get color() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the rgb component
     */
    get rgb() {
        return this._outputs[1];
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("exposureLinear");
        state._excludeVariableName("contrast");
        state._excludeVariableName("vInverseScreenSize");
        state._excludeVariableName("vignetteSettings1");
        state._excludeVariableName("vignetteSettings2");
        state._excludeVariableName("vCameraColorCurveNegative");
        state._excludeVariableName("vCameraColorCurveNeutral");
        state._excludeVariableName("vCameraColorCurvePositive");
        state._excludeVariableName("txColorTransform");
        state._excludeVariableName("colorTransformSettings");
        state._excludeVariableName("ditherIntensity");
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79702)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 16205)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 88996)),
            ]);
        }
        else {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 73325)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 89392)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 64017)),
            ]);
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    isReady(mesh, nodeMaterial, defines) {
        if (defines._areImageProcessingDirty && nodeMaterial.imageProcessingConfiguration) {
            if (!nodeMaterial.imageProcessingConfiguration.isReady()) {
                return false;
            }
        }
        return true;
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        if (defines._areImageProcessingDirty && nodeMaterial.imageProcessingConfiguration) {
            nodeMaterial.imageProcessingConfiguration.prepareDefines(defines);
        }
    }
    bind(effect, nodeMaterial, mesh) {
        if (!mesh) {
            return;
        }
        if (!nodeMaterial.imageProcessingConfiguration) {
            return;
        }
        nodeMaterial.imageProcessingConfiguration.bind(effect);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        // Register for defines
        state.sharedData.blocksWithDefines.push(this);
        // Register for blocking
        state.sharedData.blockingBlocks.push(this);
        // Register for binding
        state.sharedData.bindableBlocks.push(this);
        // Uniforms
        state.uniforms.push("exposureLinear");
        state.uniforms.push("contrast");
        state.uniforms.push("vInverseScreenSize");
        state.uniforms.push("vignetteSettings1");
        state.uniforms.push("vignetteSettings2");
        state.uniforms.push("vCameraColorCurveNegative");
        state.uniforms.push("vCameraColorCurveNeutral");
        state.uniforms.push("vCameraColorCurvePositive");
        state.uniforms.push("txColorTransform");
        state.uniforms.push("colorTransformSettings");
        state.uniforms.push("ditherIntensity");
        // Emit code
        const color = this.color;
        const output = this._outputs[0];
        const comments = `//${this.name}`;
        const overrideText = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "Vec3" : "";
        state._emitFunctionFromInclude("helperFunctions", comments);
        state._emitFunctionFromInclude("imageProcessingDeclaration", comments);
        state._emitFunctionFromInclude("imageProcessingFunctions", comments);
        if (color.connectedPoint?.isConnected) {
            if (color.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Color4 || color.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Vector4) {
                state.compilationString += `${state._declareOutput(output)} = ${color.associatedVariableName};\n`;
            }
            else {
                state.compilationString += `${state._declareOutput(output)} = vec4${state.fSuffix}(${color.associatedVariableName}, 1.0);\n`;
            }
            state.compilationString += `#ifdef IMAGEPROCESSINGPOSTPROCESS\n`;
            if (this.convertInputToLinearSpace) {
                state.compilationString += `${output.associatedVariableName} = vec4${state.fSuffix}(toLinearSpace${overrideText}(${color.associatedVariableName}.rgb), ${color.associatedVariableName}.a);\n`;
            }
            state.compilationString += `#else\n`;
            state.compilationString += `#ifdef IMAGEPROCESSING\n`;
            if (this.convertInputToLinearSpace) {
                state.compilationString += `${output.associatedVariableName} = vec4${state.fSuffix}(toLinearSpace${overrideText}(${color.associatedVariableName}.rgb), ${color.associatedVariableName}.a);\n`;
            }
            state.compilationString += `${output.associatedVariableName} = applyImageProcessing(${output.associatedVariableName});\n`;
            state.compilationString += `#endif\n`;
            state.compilationString += `#endif\n`;
            if (this.rgb.hasEndpoints) {
                state.compilationString += state._declareOutput(this.rgb) + ` = ${this.output.associatedVariableName}.xyz;\n`;
            }
        }
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.convertInputToLinearSpace = ${this.convertInputToLinearSpace};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.convertInputToLinearSpace = this.convertInputToLinearSpace;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.convertInputToLinearSpace = serializationObject.convertInputToLinearSpace ?? true;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Convert input to linear space", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED")
], ImageProcessingBlock.prototype, "convertInputToLinearSpace", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ImageProcessingBlock", ImageProcessingBlock);
//# sourceMappingURL=imageProcessingBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/TBNBlock.js







/**
 * Block used to implement TBN matrix
 */
class TBNBlock extends NodeMaterialBlock {
    /**
     * Create a new TBNBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment, true);
        this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect, false);
        this.normal.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerInput("tangent", NodeMaterialBlockConnectionPointTypes.Vector4, false);
        this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, false);
        this.registerOutput("TBN", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("TBN", this, 1 /* NodeMaterialConnectionPointDirection.Output */, TBNBlock, "TBNBlock"));
        this.registerOutput("row0", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("row1", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("row2", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Fragment);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TBNBlock";
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("tbnNormal");
        state._excludeVariableName("tbnTangent");
        state._excludeVariableName("tbnBitangent");
        state._excludeVariableName("TBN");
    }
    /**
     * Gets the normal input component
     */
    get normal() {
        return this._inputs[0];
    }
    /**
     * Gets the tangent input component
     */
    get tangent() {
        return this._inputs[1];
    }
    /**
     * Gets the world matrix input component
     */
    get world() {
        return this._inputs[2];
    }
    /**
     * Gets the TBN output component
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    get TBN() {
        return this._outputs[0];
    }
    /**
     * Gets the row0 of the output matrix
     */
    get row0() {
        return this._outputs[1];
    }
    /**
     * Gets the row1 of the output matrix
     */
    get row1() {
        return this._outputs[2];
    }
    /**
     * Gets the row2 of the output matrix
     */
    get row2() {
        return this._outputs[3];
    }
    get target() {
        return NodeMaterialBlockTargets.Fragment;
    }
    set target(value) { }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.world.isConnected) {
            let worldInput = material.getInputBlockByPredicate((b) => b.isSystemValue && b.systemValue === NodeMaterialSystemValues.World && additionalFilteringInfo(b));
            if (!worldInput) {
                worldInput = new InputBlock("world");
                worldInput.setAsSystemValue(NodeMaterialSystemValues.World);
            }
            worldInput.output.connectTo(this.world);
        }
        if (!this.normal.isConnected) {
            let normalInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "normal" && additionalFilteringInfo(b));
            if (!normalInput) {
                normalInput = new InputBlock("normal");
                normalInput.setAsAttribute("normal");
            }
            normalInput.output.connectTo(this.normal);
        }
        if (!this.tangent.isConnected) {
            let tangentInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "tangent" && b.type === NodeMaterialBlockConnectionPointTypes.Vector4 && additionalFilteringInfo(b));
            if (!tangentInput) {
                tangentInput = new InputBlock("tangent");
                tangentInput.setAsAttribute("tangent");
            }
            tangentInput.output.connectTo(this.tangent);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        const normal = this.normal;
        const tangent = this.tangent;
        let normalAvailable = normal.isConnected;
        if (normal.connectInputBlock?.isAttribute && !mesh.isVerticesDataPresent(normal.connectInputBlock?.name)) {
            normalAvailable = false;
        }
        let tangentAvailable = tangent.isConnected;
        if (tangent.connectInputBlock?.isAttribute && !mesh.isVerticesDataPresent(tangent.connectInputBlock?.name)) {
            tangentAvailable = false;
        }
        const useTBNBlock = normalAvailable && tangentAvailable;
        defines.setValue("TBNBLOCK", useTBNBlock, true);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const normal = this.normal;
        const tangent = this.tangent;
        const world = this.world;
        const TBN = this.TBN;
        const row0 = this.row0;
        const row1 = this.row1;
        const row2 = this.row2;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        const mat3 = isWebGPU ? "mat3x3f" : "mat3";
        const fSuffix = isWebGPU ? "f" : "";
        // Fragment
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            state.compilationString += `
                // ${this.name}
                ${state._declareLocalVar("tbnNormal", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${normal.associatedVariableName}).xyz;
                ${state._declareLocalVar("tbnTangent", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${tangent.associatedVariableName}.xyz);
                ${state._declareLocalVar("tbnBitangent", NodeMaterialBlockConnectionPointTypes.Vector3)} = cross(tbnNormal, tbnTangent) * ${tangent.associatedVariableName}.w;
                ${isWebGPU ? "var" : "mat3"} ${TBN.associatedVariableName} = ${mat3}(${world.associatedVariableName}[0].xyz, ${world.associatedVariableName}[1].xyz, ${world.associatedVariableName}[2].xyz) * ${mat3}(tbnTangent, tbnBitangent, tbnNormal);
            `;
            if (row0.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(row0) +
                        ` = vec3${fSuffix}(${TBN.associatedVariableName}[0][0], ${TBN.associatedVariableName}[0][1], ${TBN.associatedVariableName}[0][2]);\n`;
            }
            if (row1.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(row1) +
                        ` = vec3${fSuffix}(${TBN.associatedVariableName}[1[0], ${TBN.associatedVariableName}[1][1], ${TBN.associatedVariableName}[1][2]);\n`;
            }
            if (row2.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(row2) +
                        ` = vec3${fSuffix}(${TBN.associatedVariableName}[2][0], ${TBN.associatedVariableName}[2][1], ${TBN.associatedVariableName}[2][2]);\n`;
            }
            state.sharedData.blocksWithDefines.push(this);
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TBNBlock", TBNBlock);
//# sourceMappingURL=TBNBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/perturbNormalBlock.js










/**
 * Block used to perturb normals based on a normal map
 */
class PerturbNormalBlock extends NodeMaterialBlock {
    /**
     * Create a new PerturbNormalBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this._tangentSpaceParameterName = "";
        this._tangentCorrectionFactorName = "";
        this._worldMatrixName = "";
        /** Gets or sets a boolean indicating that normal should be inverted on X axis */
        this.invertX = false;
        /** Gets or sets a boolean indicating that normal should be inverted on Y axis */
        this.invertY = false;
        /** Gets or sets a boolean indicating that parallax occlusion should be enabled */
        this.useParallaxOcclusion = false;
        /** Gets or sets a boolean indicating that sampling mode is in Object space */
        this.useObjectSpaceNormalMap = false;
        this._isUnique = true;
        // Vertex
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false);
        this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, false);
        this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.Vector4, true);
        this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.Vector2, false);
        this.registerInput("normalMapColor", NodeMaterialBlockConnectionPointTypes.Color3, false);
        this.registerInput("strength", NodeMaterialBlockConnectionPointTypes.Float, false);
        this.registerInput("viewDirection", NodeMaterialBlockConnectionPointTypes.Vector3, true);
        this.registerInput("parallaxScale", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("parallaxHeight", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("TBN", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("TBN", this, 0 /* NodeMaterialConnectionPointDirection.Input */, TBNBlock, "TBNBlock"));
        this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, true);
        // Fragment
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerOutput("uvOffset", NodeMaterialBlockConnectionPointTypes.Vector2);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "PerturbNormalBlock";
    }
    /**
     * Gets the world position input component
     */
    get worldPosition() {
        return this._inputs[0];
    }
    /**
     * Gets the world normal input component
     */
    get worldNormal() {
        return this._inputs[1];
    }
    /**
     * Gets the world tangent input component
     */
    get worldTangent() {
        return this._inputs[2];
    }
    /**
     * Gets the uv input component
     */
    get uv() {
        return this._inputs[3];
    }
    /**
     * Gets the normal map color input component
     */
    get normalMapColor() {
        return this._inputs[4];
    }
    /**
     * Gets the strength input component
     */
    get strength() {
        return this._inputs[5];
    }
    /**
     * Gets the view direction input component
     */
    get viewDirection() {
        return this._inputs[6];
    }
    /**
     * Gets the parallax scale input component
     */
    get parallaxScale() {
        return this._inputs[7];
    }
    /**
     * Gets the parallax height input component
     */
    get parallaxHeight() {
        return this._inputs[8];
    }
    /**
     * Gets the TBN input component
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    get TBN() {
        return this._inputs[9];
    }
    /**
     * Gets the World input component
     */
    get world() {
        return this._inputs[10];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the uv offset output component
     */
    get uvOffset() {
        return this._outputs[1];
    }
    initialize(state) {
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 20727)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 15697)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 91258)),
            ]);
        }
        else {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 27018)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 17494)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 8269)),
            ]);
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        const normalSamplerName = this.normalMapColor.connectedPoint._ownerBlock.samplerName;
        const useParallax = this.viewDirection.isConnected && ((this.useParallaxOcclusion && normalSamplerName) || (!this.useParallaxOcclusion && this.parallaxHeight.isConnected));
        defines.setValue("BUMP", true);
        defines.setValue("PARALLAX", useParallax, true);
        defines.setValue("PARALLAX_RHS", nodeMaterial.getScene().useRightHandedSystem, true);
        defines.setValue("PARALLAXOCCLUSION", this.useParallaxOcclusion, true);
        defines.setValue("OBJECTSPACE_NORMALMAP", this.useObjectSpaceNormalMap, true);
    }
    bind(effect, nodeMaterial, mesh) {
        if (nodeMaterial.getScene()._mirroredCameraPosition) {
            effect.setFloat2(this._tangentSpaceParameterName, this.invertX ? 1.0 : -1.0, this.invertY ? 1.0 : -1.0);
        }
        else {
            effect.setFloat2(this._tangentSpaceParameterName, this.invertX ? -1.0 : 1.0, this.invertY ? -1.0 : 1.0);
        }
        if (mesh) {
            effect.setFloat(this._tangentCorrectionFactorName, mesh.getWorldMatrix().determinant() < 0 ? -1 : 1);
            if (this.useObjectSpaceNormalMap && !this.world.isConnected) {
                // World default to the mesh world matrix
                effect.setMatrix(this._worldMatrixName, mesh.getWorldMatrix());
            }
        }
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.uv.isConnected) {
            let uvInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "uv" && additionalFilteringInfo(b));
            if (!uvInput) {
                uvInput = new InputBlock("uv");
                uvInput.setAsAttribute();
            }
            uvInput.output.connectTo(this.uv);
        }
        if (!this.strength.isConnected) {
            const strengthInput = new InputBlock("strength");
            strengthInput.value = 1.0;
            strengthInput.output.connectTo(this.strength);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const comments = `//${this.name}`;
        const uv = this.uv;
        const worldPosition = this.worldPosition;
        const worldNormal = this.worldNormal;
        const worldTangent = this.worldTangent;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        const mat3 = isWebGPU ? "mat3x3f" : "mat3";
        const fSuffix = isWebGPU ? "f" : "";
        const uniformPrefix = isWebGPU ? "uniforms." : "";
        state.sharedData.blocksWithDefines.push(this);
        state.sharedData.bindableBlocks.push(this);
        this._tangentSpaceParameterName = state._getFreeDefineName("tangentSpaceParameter");
        state._emitUniformFromString(this._tangentSpaceParameterName, NodeMaterialBlockConnectionPointTypes.Vector2);
        this._tangentCorrectionFactorName = state._getFreeDefineName("tangentCorrectionFactor");
        state._emitUniformFromString(this._tangentCorrectionFactorName, NodeMaterialBlockConnectionPointTypes.Float);
        this._worldMatrixName = state._getFreeDefineName("perturbNormalWorldMatrix");
        state._emitUniformFromString(this._worldMatrixName, NodeMaterialBlockConnectionPointTypes.Matrix);
        let normalSamplerName = null;
        if (this.normalMapColor.connectedPoint) {
            normalSamplerName = this.normalMapColor.connectedPoint._ownerBlock.samplerName;
        }
        const useParallax = this.viewDirection.isConnected && ((this.useParallaxOcclusion && normalSamplerName) || (!this.useParallaxOcclusion && this.parallaxHeight.isConnected));
        const replaceForParallaxInfos = !this.parallaxScale.isConnectedToInputBlock
            ? "0.05"
            : this.parallaxScale.connectInputBlock.isConstant
                ? state._emitFloat(this.parallaxScale.connectInputBlock.value)
                : this.parallaxScale.associatedVariableName;
        const replaceForBumpInfos = this.strength.isConnectedToInputBlock && this.strength.connectInputBlock.isConstant
            ? `\n#if !defined(NORMALXYSCALE)\n1.0/\n#endif\n${state._emitFloat(this.strength.connectInputBlock.value)}`
            : `\n#if !defined(NORMALXYSCALE)\n1.0/\n#endif\n${this.strength.associatedVariableName}`;
        if (!isWebGPU) {
            state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
        }
        const tangentReplaceString = { search: /defined\(TANGENT\)/g, replace: worldTangent.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" };
        const tbnVarying = { search: /varying mat3 vTBN;/g, replace: "" };
        const normalMatrixReplaceString = { search: /uniform mat4 normalMatrix;/g, replace: "" };
        const TBN = this.TBN;
        if (TBN.isConnected) {
            state.compilationString += `
            #ifdef TBNBLOCK
            ${isWebGPU ? "var" : "mat3"} vTBN = ${TBN.associatedVariableName};
            #endif
            `;
        }
        else if (worldTangent.isConnected) {
            state.compilationString += `${state._declareLocalVar("tbnNormal", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${worldNormal.associatedVariableName}.xyz);\n`;
            state.compilationString += `${state._declareLocalVar("tbnTangent", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${worldTangent.associatedVariableName}.xyz);\n`;
            state.compilationString += `${state._declareLocalVar("tbnBitangent", NodeMaterialBlockConnectionPointTypes.Vector3)} = cross(tbnNormal, tbnTangent) * ${isWebGPU ? "uniforms." : ""}${this._tangentCorrectionFactorName};\n`;
            state.compilationString += `${isWebGPU ? "var" : "mat3"} vTBN = ${mat3}(tbnTangent, tbnBitangent, tbnNormal);\n`;
        }
        let replaceStrings = [tangentReplaceString, tbnVarying, normalMatrixReplaceString];
        if (isWebGPU) {
            replaceStrings.push({ search: /varying vTBN0: vec3f;/g, replace: "" });
            replaceStrings.push({ search: /varying vTBN1: vec3f;/g, replace: "" });
            replaceStrings.push({ search: /varying vTBN2: vec3f;/g, replace: "" });
        }
        state._emitFunctionFromInclude("bumpFragmentMainFunctions", comments, {
            replaceStrings: replaceStrings,
        });
        const replaceString0 = isWebGPU
            ? "fn parallaxOcclusion(vViewDirCoT: vec3f, vNormalCoT: vec3f, texCoord: vec2f, parallaxScale:f32, bump: texture_2d<f32>, bumpSampler: sampler)"
            : "#define inline\nvec2 parallaxOcclusion(vec3 vViewDirCoT, vec3 vNormalCoT, vec2 texCoord, float parallaxScale, sampler2D bumpSampler)";
        const searchExp0 = isWebGPU
            ? /fn parallaxOcclusion\(vViewDirCoT: vec3f,vNormalCoT: vec3f,texCoord: vec2f,parallaxScale: f32\)/g
            : /vec2 parallaxOcclusion\(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale\)/g;
        const replaceString1 = isWebGPU
            ? "fn parallaxOffset(viewDir: vec3f, heightScale: f32, height_: f32)"
            : "vec2 parallaxOffset(vec3 viewDir, float heightScale, float height_)";
        const searchExp1 = isWebGPU ? /fn parallaxOffset\(viewDir: vec3f,heightScale: f32\)/g : /vec2 parallaxOffset\(vec3 viewDir,float heightScale\)/g;
        state._emitFunctionFromInclude("bumpFragmentFunctions", comments, {
            replaceStrings: [
                { search: /#include<samplerFragmentDeclaration>\(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump\)/g, replace: "" },
                { search: /uniform sampler2D bumpSampler;/g, replace: "" },
                {
                    search: searchExp0,
                    replace: replaceString0,
                },
                { search: searchExp1, replace: replaceString1 },
                { search: /texture.+?bumpSampler,vBumpUV\)\.w/g, replace: "height_" },
            ],
        });
        const normalRead = isWebGPU ? `textureSample(${normalSamplerName}, ${normalSamplerName + `Sampler`}` : `texture2D(${normalSamplerName}`;
        const uvForPerturbNormal = !useParallax || !normalSamplerName ? this.normalMapColor.associatedVariableName : `${normalRead}, ${uv.associatedVariableName} + uvOffset).xyz`;
        const tempOutput = state._getFreeVariableName("tempOutput");
        state.compilationString += state._declareLocalVar(tempOutput, NodeMaterialBlockConnectionPointTypes.Vector3) + ` = vec3${fSuffix}(0.);\n`;
        replaceStrings = [
            { search: new RegExp(`texture.+?bumpSampler${isWebGPU ? "Sampler,fragmentInputs." : ","}vBumpUV\\)`, "g"), replace: `${uvForPerturbNormal}` },
            {
                search: /#define CUSTOM_FRAGMENT_BUMP_FRAGMENT/g,
                replace: `${state._declareLocalVar("normalMatrix", NodeMaterialBlockConnectionPointTypes.Matrix)} = toNormalMatrix(${this.world.isConnected ? this.world.associatedVariableName : this._worldMatrixName});`,
            },
            {
                search: new RegExp(`perturbNormal\\(TBN,texture.+?bumpSampler${isWebGPU ? "Sampler,fragmentInputs." : ","}vBumpUV\\+uvOffset\\).xyz,${isWebGPU ? "uniforms." : ""}vBumpInfos.y\\)`, "g"),
                replace: `perturbNormal(TBN, ${uvForPerturbNormal}, vBumpInfos.y)`,
            },
            {
                search: /parallaxOcclusion\(invTBN\*-viewDirectionW,invTBN\*normalW,vBumpUV,vBumpInfos.z\)/g,
                replace: `parallaxOcclusion((invTBN * -viewDirectionW), (invTBN * normalW), vBumpUV, vBumpInfos.z, ${isWebGPU
                    ? useParallax && this.useParallaxOcclusion
                        ? `${normalSamplerName}, ${normalSamplerName + `Sampler`}`
                        : "bump, bumpSampler"
                    : useParallax && this.useParallaxOcclusion
                        ? normalSamplerName
                        : "bumpSampler"})`,
            },
            {
                search: /parallaxOffset\(invTBN\*viewDirectionW,vBumpInfos\.z\)/g,
                replace: `parallaxOffset(invTBN * viewDirectionW, vBumpInfos.z, ${useParallax ? this.parallaxHeight.associatedVariableName : "0."})`,
            },
            { search: /vBumpInfos.y/g, replace: replaceForBumpInfos },
            { search: /vBumpInfos.z/g, replace: replaceForParallaxInfos },
            { search: /normalW=/g, replace: tempOutput + " = " },
            { search: /mat3\(normalMatrix\)\*normalW/g, replace: `${mat3}(normalMatrix) * ` + tempOutput },
            { search: /normalW/g, replace: worldNormal.associatedVariableName + ".xyz" },
            { search: /viewDirectionW/g, replace: useParallax ? this.viewDirection.associatedVariableName : `vec3${fSuffix}(0.)` },
            tangentReplaceString,
        ];
        if (isWebGPU) {
            replaceStrings.push({ search: /fragmentInputs.vBumpUV/g, replace: uv.associatedVariableName });
            replaceStrings.push({ search: /input.vPositionW/g, replace: worldPosition.associatedVariableName + ".xyz" });
            replaceStrings.push({ search: /uniforms.vTangentSpaceParams/g, replace: uniformPrefix + this._tangentSpaceParameterName });
            replaceStrings.push({ search: /var TBN: mat3x3f=mat3x3<f32>\(input.vTBN0,input.vTBN1,input.vTBN2\);/g, replace: `var TBN = vTBN;` });
        }
        else {
            replaceStrings.push({ search: /vBumpUV/g, replace: uv.associatedVariableName });
            replaceStrings.push({ search: /vPositionW/g, replace: worldPosition.associatedVariableName + ".xyz" });
            replaceStrings.push({ search: /vTangentSpaceParams/g, replace: uniformPrefix + this._tangentSpaceParameterName });
        }
        state.compilationString += state._emitCodeFromInclude("bumpFragment", comments, {
            replaceStrings: replaceStrings,
        });
        state.compilationString += state._declareOutput(this.output) + ` = vec4${fSuffix}(${tempOutput}, 0.);\n`;
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.invertX = ${this.invertX};\n`;
        codeString += `${this._codeVariableName}.invertY = ${this.invertY};\n`;
        codeString += `${this._codeVariableName}.useParallaxOcclusion = ${this.useParallaxOcclusion};\n`;
        codeString += `${this._codeVariableName}.useObjectSpaceNormalMap = ${this.useObjectSpaceNormalMap};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.invertX = this.invertX;
        serializationObject.invertY = this.invertY;
        serializationObject.useParallaxOcclusion = this.useParallaxOcclusion;
        serializationObject.useObjectSpaceNormalMap = this.useObjectSpaceNormalMap;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.invertX = serializationObject.invertX;
        this.invertY = serializationObject.invertY;
        this.useParallaxOcclusion = !!serializationObject.useParallaxOcclusion;
        this.useObjectSpaceNormalMap = !!serializationObject.useObjectSpaceNormalMap;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Invert X axis", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { embedded: true, notifiers: { update: false } })
], PerturbNormalBlock.prototype, "invertX", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Invert Y axis", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { embedded: true, notifiers: { update: false } })
], PerturbNormalBlock.prototype, "invertY", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Use parallax occlusion", 0 /* PropertyTypeForEdition.Boolean */, undefined, { embedded: true, notifiers: { update: false } })
], PerturbNormalBlock.prototype, "useParallaxOcclusion", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Object Space Mode", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { embedded: true, notifiers: { update: false } })
], PerturbNormalBlock.prototype, "useObjectSpaceNormalMap", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PerturbNormalBlock", PerturbNormalBlock);
//# sourceMappingURL=perturbNormalBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/discardBlock.js




/**
 * Block used to discard a pixel if a value is smaller than a cutoff
 */
class DiscardBlock extends NodeMaterialBlock {
    /**
     * Create a new DiscardBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment, true);
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("cutoff", NodeMaterialBlockConnectionPointTypes.Float, true);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "DiscardBlock";
    }
    /**
     * Gets the color input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the cutoff input component
     */
    get cutoff() {
        return this._inputs[1];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        state.sharedData.hints.needAlphaTesting = true;
        if (!this.cutoff.isConnected || !this.value.isConnected) {
            return;
        }
        state.compilationString += `if (${this.value.associatedVariableName} < ${this.cutoff.associatedVariableName}) { discard; }\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DiscardBlock", DiscardBlock);
//# sourceMappingURL=discardBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/frontFacingBlock.js




/**
 * Block used to test if the fragment shader is front facing
 */
class FrontFacingBlock extends NodeMaterialBlock {
    /**
     * Creates a new FrontFacingBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "FrontFacingBlock";
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Vertex) {
            // eslint-disable-next-line no-throw-literal
            throw "FrontFacingBlock must only be used in a fragment shader";
        }
        const output = this._outputs[0];
        state.compilationString +=
            state._declareOutput(output) +
                ` = ${state._generateTernary("1.0", "0.0", state.shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? "gl_FrontFacing" : "fragmentInputs.frontFacing")};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FrontFacingBlock", FrontFacingBlock);
//# sourceMappingURL=frontFacingBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/derivativeBlock.js




/**
 * Block used to get the derivative value on x and y of a given input
 */
class DerivativeBlock extends NodeMaterialBlock {
    /**
     * Create a new DerivativeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect, false);
        this.registerOutput("dx", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this.registerOutput("dy", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._outputs[1]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "DerivativeBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the derivative output on x
     */
    get dx() {
        return this._outputs[0];
    }
    /**
     * Gets the derivative output on y
     */
    get dy() {
        return this._outputs[1];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const dx = this._outputs[0];
        const dy = this._outputs[1];
        state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
        let dpdx = "dFdx";
        let dpdy = "dFdy";
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            dpdx = "dpdx";
            dpdy = "dpdy";
        }
        if (dx.hasEndpoints) {
            state.compilationString += state._declareOutput(dx) + ` = ${dpdx}(${this.input.associatedVariableName});\n`;
        }
        if (dy.hasEndpoints) {
            state.compilationString += state._declareOutput(dy) + ` = ${dpdy}(${this.input.associatedVariableName});\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DerivativeBlock", DerivativeBlock);
//# sourceMappingURL=derivativeBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/fragCoordBlock.js




/**
 * Block used to make gl_FragCoord available
 */
class FragCoordBlock extends NodeMaterialBlock {
    /**
     * Creates a new FragCoordBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("xyzw", NodeMaterialBlockConnectionPointTypes.Vector4, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("z", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("w", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "FragCoordBlock";
    }
    /**
     * Gets the xy component
     */
    get xy() {
        return this._outputs[0];
    }
    /**
     * Gets the xyz component
     */
    get xyz() {
        return this._outputs[1];
    }
    /**
     * Gets the xyzw component
     */
    get xyzw() {
        return this._outputs[2];
    }
    /**
     * Gets the x component
     */
    get x() {
        return this._outputs[3];
    }
    /**
     * Gets the y component
     */
    get y() {
        return this._outputs[4];
    }
    /**
     * Gets the z component
     */
    get z() {
        return this._outputs[5];
    }
    /**
     * Gets the w component
     */
    get output() {
        return this._outputs[6];
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    writeOutputs(state) {
        let code = "";
        const coord = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "fragmentInputs.position" : "gl_FragCoord";
        for (const output of this._outputs) {
            if (output.hasEndpoints) {
                code += `${state._declareOutput(output)} = ${coord}.${output.name};\n`;
            }
        }
        return code;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Vertex) {
            // eslint-disable-next-line no-throw-literal
            throw "FragCoordBlock must only be used in a fragment shader";
        }
        state.compilationString += this.writeOutputs(state);
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FragCoordBlock", FragCoordBlock);
//# sourceMappingURL=fragCoordBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/screenSizeBlock.js




/**
 * Block used to get the screen sizes
 */
class ScreenSizeBlock extends NodeMaterialBlock {
    /**
     * Creates a new ScreenSizeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ScreenSizeBlock";
    }
    /**
     * Gets the xy component
     */
    get xy() {
        return this._outputs[0];
    }
    /**
     * Gets the x component
     */
    get x() {
        return this._outputs[1];
    }
    /**
     * Gets the y component
     */
    get y() {
        return this._outputs[2];
    }
    bind(effect) {
        const engine = this._scene.getEngine();
        effect.setFloat2(this._varName, engine.getRenderWidth(), engine.getRenderHeight());
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    writeOutputs(state, varName) {
        let code = "";
        for (const output of this._outputs) {
            if (output.hasEndpoints) {
                code += `${state._declareOutput(output)} = ${varName}.${output.name};\n`;
            }
        }
        return code;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._scene = state.sharedData.scene;
        if (state.target === NodeMaterialBlockTargets.Vertex) {
            // eslint-disable-next-line no-throw-literal
            throw "ScreenSizeBlock must only be used in a fragment shader";
        }
        state.sharedData.bindableBlocks.push(this);
        this._varName = state._getFreeVariableName("screenSize");
        state._emitUniformFromString(this._varName, NodeMaterialBlockConnectionPointTypes.Vector2);
        const prefix = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "uniforms." : "";
        state.compilationString += this.writeOutputs(state, prefix + this._varName);
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ScreenSizeBlock", ScreenSizeBlock);
//# sourceMappingURL=screenSizeBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/screenSpaceBlock.js






/**
 * Block used to transform a vector3 or a vector4 into screen space
 */
class ScreenSpaceBlock extends NodeMaterialBlock {
    /**
     * Creates a new ScreenSpaceBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this.registerInput("vector", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("worldViewProjection", NodeMaterialBlockConnectionPointTypes.Matrix);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float);
        this.inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ScreenSpaceBlock";
    }
    /**
     * Gets the vector input
     */
    get vector() {
        return this._inputs[0];
    }
    /**
     * Gets the worldViewProjection transform input
     */
    get worldViewProjection() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the x output component
     */
    get x() {
        return this._outputs[1];
    }
    /**
     * Gets the y output component
     */
    get y() {
        return this._outputs[2];
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.worldViewProjection.isConnected) {
            let worldViewProjectionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.WorldViewProjection && additionalFilteringInfo(b));
            if (!worldViewProjectionInput) {
                worldViewProjectionInput = new InputBlock("worldViewProjection");
                worldViewProjectionInput.setAsSystemValue(NodeMaterialSystemValues.WorldViewProjection);
            }
            worldViewProjectionInput.output.connectTo(this.worldViewProjection);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const vector = this.vector;
        const worldViewProjection = this.worldViewProjection;
        if (!vector.connectedPoint) {
            return;
        }
        const worldViewProjectionName = worldViewProjection.associatedVariableName;
        const tempVariableName = state._getFreeVariableName("screenSpaceTemp");
        switch (vector.connectedPoint.type) {
            case NodeMaterialBlockConnectionPointTypes.Vector3:
                state.compilationString += `${state._declareLocalVar(tempVariableName, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${worldViewProjectionName} * vec4${state.fSuffix}(${vector.associatedVariableName}, 1.0);\n`;
                break;
            case NodeMaterialBlockConnectionPointTypes.Vector4:
                state.compilationString += `${state._declareLocalVar(tempVariableName, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${worldViewProjectionName} * ${vector.associatedVariableName};\n`;
                break;
        }
        state.compilationString += `${tempVariableName} = vec4${state.fSuffix}(${tempVariableName}.xy / ${tempVariableName}.w, ${tempVariableName}.zw);`;
        state.compilationString += `${tempVariableName} = vec4${state.fSuffix}(${tempVariableName}.xy * 0.5 + vec2${state.fSuffix}(0.5, 0.5), ${tempVariableName}.zw);`;
        if (this.output.hasEndpoints) {
            state.compilationString += state._declareOutput(this.output) + ` = ${tempVariableName}.xy;\n`;
        }
        if (this.x.hasEndpoints) {
            state.compilationString += state._declareOutput(this.x) + ` = ${tempVariableName}.x;\n`;
        }
        if (this.y.hasEndpoints) {
            state.compilationString += state._declareOutput(this.y) + ` = ${tempVariableName}.y;\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ScreenSpaceBlock", ScreenSpaceBlock);
//# sourceMappingURL=screenSpaceBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/twirlBlock.js






/**
 * Block used to generate a twirl
 */
class TwirlBlock extends NodeMaterialBlock {
    /**
     * Creates a new TwirlBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerInput("strength", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("center", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerInput("offset", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TwirlBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the strength component
     */
    get strength() {
        return this._inputs[1];
    }
    /**
     * Gets the center component
     */
    get center() {
        return this._inputs[2];
    }
    /**
     * Gets the offset component
     */
    get offset() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the x output component
     */
    get x() {
        return this._outputs[1];
    }
    /**
     * Gets the y output component
     */
    get y() {
        return this._outputs[2];
    }
    autoConfigure() {
        if (!this.center.isConnected) {
            const centerInput = new InputBlock("center");
            centerInput.value = new math_vector/* Vector2 */.I9(0.5, 0.5);
            centerInput.output.connectTo(this.center);
        }
        if (!this.strength.isConnected) {
            const strengthInput = new InputBlock("strength");
            strengthInput.value = 1.0;
            strengthInput.output.connectTo(this.strength);
        }
        if (!this.offset.isConnected) {
            const offsetInput = new InputBlock("offset");
            offsetInput.value = new math_vector/* Vector2 */.I9(0, 0);
            offsetInput.output.connectTo(this.offset);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const tempDelta = state._getFreeVariableName("delta");
        const tempAngle = state._getFreeVariableName("angle");
        const tempX = state._getFreeVariableName("x");
        const tempY = state._getFreeVariableName("y");
        const tempResult = state._getFreeVariableName("result");
        state.compilationString += `        
            ${state._declareLocalVar(tempDelta, NodeMaterialBlockConnectionPointTypes.Vector2)} = ${this.input.associatedVariableName} - ${this.center.associatedVariableName};
            ${state._declareLocalVar(tempAngle, NodeMaterialBlockConnectionPointTypes.Float)} = ${this.strength.associatedVariableName} * length(${tempDelta});
            ${state._declareLocalVar(tempX, NodeMaterialBlockConnectionPointTypes.Float)} = cos(${tempAngle}) * ${tempDelta}.x - sin(${tempAngle}) * ${tempDelta}.y;
            ${state._declareLocalVar(tempY, NodeMaterialBlockConnectionPointTypes.Float)} = sin(${tempAngle}) * ${tempDelta}.x + cos(${tempAngle}) * ${tempDelta}.y;
            ${state._declareLocalVar(tempResult, NodeMaterialBlockConnectionPointTypes.Vector2)} = vec2(${tempX} + ${this.center.associatedVariableName}.x + ${this.offset.associatedVariableName}.x, ${tempY} + ${this.center.associatedVariableName}.y + ${this.offset.associatedVariableName}.y);
        `;
        if (this.output.hasEndpoints) {
            state.compilationString += state._declareOutput(this.output) + ` = ${tempResult};\n`;
        }
        if (this.x.hasEndpoints) {
            state.compilationString += state._declareOutput(this.x) + ` = ${tempResult}.x;\n`;
        }
        if (this.y.hasEndpoints) {
            state.compilationString += state._declareOutput(this.y) + ` = ${tempResult}.y;\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TwirlBlock", TwirlBlock);
//# sourceMappingURL=twirlBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/heightToNormalBlock.js







/**
 * Block used to convert a height vector to a normal
 */
class HeightToNormalBlock extends NodeMaterialBlock {
    /**
     * Creates a new HeightToNormalBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        /**
         * Defines if the output should be generated in world or tangent space.
         * Note that in tangent space the result is also scaled by 0.5 and offsetted by 0.5 so that it can directly be used as a PerturbNormal.normalMapColor input
         */
        this.generateInWorldSpace = false;
        /**
         * Defines that the worldNormal input will be normalized by the HeightToNormal block before being used
         */
        this.automaticNormalizationNormal = true;
        /**
         * Defines that the worldTangent input will be normalized by the HeightToNormal block before being used
         */
        this.automaticNormalizationTangent = true;
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3);
        this._inputs[3].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "HeightToNormalBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the position component
     */
    get worldPosition() {
        return this._inputs[1];
    }
    /**
     * Gets the normal component
     */
    get worldNormal() {
        return this._inputs[2];
    }
    /**
     * Gets the tangent component
     */
    get worldTangent() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the xyz component
     */
    get xyz() {
        return this._outputs[1];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        const fPrefix = state.fSuffix;
        if (!this.generateInWorldSpace && !this.worldTangent.isConnected) {
            logger/* Logger */.V.Error(`You must connect the 'worldTangent' input of the ${this.name} block!`);
        }
        const startCode = this.generateInWorldSpace
            ? ""
            : `
            vec3 biTangent = cross(norm, tgt);
            mat3 TBN = mat3(tgt, biTangent, norm);
            `;
        const endCode = this.generateInWorldSpace
            ? ""
            : `
            result = TBN * result;
            result = result * vec3(0.5) + vec3(0.5);
            `;
        let heightToNormal = `
            vec4 heightToNormal(float height, vec3 position, vec3 tangent, vec3 normal) {
                vec3 tgt = ${this.automaticNormalizationTangent ? "normalize(tangent);" : "tangent;"}
                vec3 norm = ${this.automaticNormalizationNormal ? "normalize(normal);" : "normal;"}
                ${startCode}
                vec3 worlddX = dFdx(position);
                vec3 worlddY = dFdy(position);
                vec3 crossX = cross(norm, worlddX);
                vec3 crossY = cross(worlddY, norm);
                float d = abs(dot(crossY, worlddX));
                vec3 inToNormal = vec3(((((height + dFdx(height)) - height) * crossY) + (((height + dFdy(height)) - height) * crossX)) * sign(d));
                inToNormal.y *= -1.0;
                vec3 result = normalize((d * norm) - inToNormal);
                ${endCode}
                return vec4(result, 0.);
            }`;
        if (isWebGPU) {
            heightToNormal = state._babylonSLtoWGSL(heightToNormal);
        }
        else {
            state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
        }
        state._emitFunction("heightToNormal", heightToNormal, "// heightToNormal");
        state.compilationString +=
            state._declareOutput(output) +
                ` = heightToNormal(${this.input.associatedVariableName}, ${this.worldPosition.associatedVariableName}, ${this.worldTangent.isConnected ? this.worldTangent.associatedVariableName : `vec3${fPrefix}(0.)`}.xyz, ${this.worldNormal.associatedVariableName});\n`;
        if (this.xyz.hasEndpoints) {
            state.compilationString += state._declareOutput(this.xyz) + ` = ${this.output.associatedVariableName}.xyz;\n`;
        }
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.generateInWorldSpace = ${this.generateInWorldSpace};\n`;
        codeString += `${this._codeVariableName}.automaticNormalizationNormal = ${this.automaticNormalizationNormal};\n`;
        codeString += `${this._codeVariableName}.automaticNormalizationTangent = ${this.automaticNormalizationTangent};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.generateInWorldSpace = this.generateInWorldSpace;
        serializationObject.automaticNormalizationNormal = this.automaticNormalizationNormal;
        serializationObject.automaticNormalizationTangent = this.automaticNormalizationTangent;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.generateInWorldSpace = serializationObject.generateInWorldSpace;
        this.automaticNormalizationNormal = serializationObject.automaticNormalizationNormal;
        this.automaticNormalizationTangent = serializationObject.automaticNormalizationTangent;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Generate in world space instead of tangent space", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { notifiers: { update: true } })
], HeightToNormalBlock.prototype, "generateInWorldSpace", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Force normalization for the worldNormal input", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { notifiers: { update: true } })
], HeightToNormalBlock.prototype, "automaticNormalizationNormal", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Force normalization for the worldTangent input", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { notifiers: { update: true } })
], HeightToNormalBlock.prototype, "automaticNormalizationTangent", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.HeightToNormalBlock", HeightToNormalBlock);
//# sourceMappingURL=heightToNormalBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/fragDepthBlock.js





/**
 * Block used to write the fragment depth
 */
class FragDepthBlock extends NodeMaterialBlock {
    /**
     * Create a new FragDepthBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment, true);
        this.registerInput("depth", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("worldPos", NodeMaterialBlockConnectionPointTypes.Vector4, true);
        this.registerInput("viewProjection", NodeMaterialBlockConnectionPointTypes.Matrix, true);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "FragDepthBlock";
    }
    /**
     * Gets the depth input component
     */
    get depth() {
        return this._inputs[0];
    }
    /**
     * Gets the worldPos input component
     */
    get worldPos() {
        return this._inputs[1];
    }
    /**
     * Gets the viewProjection input component
     */
    get viewProjection() {
        return this._inputs[2];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const fragDepth = state.shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? "gl_FragDepth" : "fragmentOutputs.fragDepth";
        if (this.depth.isConnected) {
            state.compilationString += `${fragDepth} = ${this.depth.associatedVariableName};\n`;
        }
        else if (this.worldPos.isConnected && this.viewProjection.isConnected) {
            state.compilationString += `
                ${state._declareLocalVar("p", NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this.viewProjection.associatedVariableName} * ${this.worldPos.associatedVariableName};
                ${state._declareLocalVar("v", NodeMaterialBlockConnectionPointTypes.Float)} = p.z / p.w;
                #ifndef IS_NDC_HALF_ZRANGE
                    v = v * 0.5 + 0.5;
                #endif
                ${fragDepth} = v;
    
            `;
        }
        else {
            logger/* Logger */.V.Warn("FragDepthBlock: either the depth input or both the worldPos and viewProjection inputs must be connected!");
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FragDepthBlock", FragDepthBlock);
//# sourceMappingURL=fragDepthBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/shadowMapBlock.js




/**
 * Block used to output the depth to a shadow map
 */
class ShadowMapBlock extends NodeMaterialBlock {
    /**
     * Create a new ShadowMapBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false);
        this.registerInput("viewProjection", NodeMaterialBlockConnectionPointTypes.Matrix, false);
        this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.registerOutput("depth", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.worldNormal.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ShadowMapBlock";
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("vPositionWSM");
        state._excludeVariableName("lightDataSM");
        state._excludeVariableName("biasAndScaleSM");
        state._excludeVariableName("depthValuesSM");
        state._excludeVariableName("clipPos");
        state._excludeVariableName("worldPos");
        state._excludeVariableName("zSM");
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 71311)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 5543)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 89273)),
            ]);
        }
        else {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 29796)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 8334)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 98322)),
            ]);
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    /**
     * Gets the world position input component
     */
    get worldPosition() {
        return this._inputs[0];
    }
    /**
     * Gets the view x projection input component
     */
    get viewProjection() {
        return this._inputs[1];
    }
    /**
     * Gets the world normal input component
     */
    get worldNormal() {
        return this._inputs[2];
    }
    /**
     * Gets the depth output component
     */
    get depth() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const comments = `//${this.name}`;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        state._emitUniformFromString("biasAndScaleSM", NodeMaterialBlockConnectionPointTypes.Vector3);
        state._emitUniformFromString("lightDataSM", NodeMaterialBlockConnectionPointTypes.Vector3);
        state._emitUniformFromString("depthValuesSM", NodeMaterialBlockConnectionPointTypes.Vector2);
        state._emitFunctionFromInclude("packingFunctions", comments);
        state.compilationString += `${state._declareLocalVar("worldPos", NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this.worldPosition.associatedVariableName};\n`;
        state.compilationString += `${state._declareLocalVar("vPositionWSM", NodeMaterialBlockConnectionPointTypes.Vector3)};\n`;
        state.compilationString += `${state._declareLocalVar("vDepthMetricSM", NodeMaterialBlockConnectionPointTypes.Float)} = 0.0;\n`;
        state.compilationString += `${state._declareLocalVar("zSM", NodeMaterialBlockConnectionPointTypes.Float)};\n`;
        if (this.worldNormal.isConnected) {
            state.compilationString += `${state._declareLocalVar("vNormalW", NodeMaterialBlockConnectionPointTypes.Vector3)} = ${this.worldNormal.associatedVariableName}.xyz;\n`;
            state.compilationString += state._emitCodeFromInclude("shadowMapVertexNormalBias", comments);
        }
        state.compilationString += `${state._declareLocalVar("clipPos", NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this.viewProjection.associatedVariableName} * worldPos;\n`;
        state.compilationString += state._emitCodeFromInclude("shadowMapVertexMetric", comments, {
            replaceStrings: [
                {
                    search: /gl_Position/g,
                    replace: "clipPos",
                },
                {
                    search: /vertexOutputs.position/g,
                    replace: "clipPos",
                },
            ],
        });
        state.compilationString += state._emitCodeFromInclude("shadowMapFragment", comments, {
            replaceStrings: [
                {
                    search: /return;/g,
                    replace: "",
                },
            ],
        });
        const output = isWebGPU ? "fragmentOutputs.fragDepth" : "gl_FragDepth";
        state.compilationString += `
            #if SM_DEPTHTEXTURE == 1
                #ifdef IS_NDC_HALF_ZRANGE
                    ${output} = (clipPos.z / clipPos.w);
                #else
                    ${output} = (clipPos.z / clipPos.w) * 0.5 + 0.5;
                #endif
            #endif
        `;
        state.compilationString += `${state._declareOutput(this.depth)} = vec3${state.fSuffix}(depthSM, 1., 1.);\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ShadowMapBlock", ShadowMapBlock);
//# sourceMappingURL=shadowMapBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/prePassOutputBlock.js




/**
 * Block used to output values on the prepass textures
 * #WW65SN#9
 */
class PrePassOutputBlock extends NodeMaterialBlock {
    /**
     * Create a new PrePassOutputBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment, true);
        this.registerInput("viewDepth", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("screenDepth", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.registerInput("localPosition", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.registerInput("viewNormal", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.registerInput("reflectivity", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.inputs[2].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
        this.inputs[3].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
        this.inputs[4].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
        this.inputs[5].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
        this.inputs[6].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4 |
            NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "PrePassOutputBlock";
    }
    /**
     * Gets the view depth component
     */
    get viewDepth() {
        return this._inputs[0];
    }
    /**
     * Gets the screen depth component
     */
    get screenDepth() {
        return this._inputs[1];
    }
    /**
     * Gets the world position component
     */
    get worldPosition() {
        return this._inputs[2];
    }
    /**
     * Gets the position in local space component
     */
    get localPosition() {
        return this._inputs[3];
    }
    /**
     * Gets the view normal component
     */
    get viewNormal() {
        return this._inputs[4];
    }
    /**
     * Gets the world normal component
     */
    get worldNormal() {
        return this._inputs[5];
    }
    /**
     * Gets the reflectivity component
     */
    get reflectivity() {
        return this._inputs[6];
    }
    _getFragData(isWebGPU, index) {
        return isWebGPU ? `fragmentOutputs.fragData${index}` : `gl_FragData[${index}]`;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const worldPosition = this.worldPosition;
        const localPosition = this.localPosition;
        const viewNormal = this.viewNormal;
        const worldNormal = this.worldNormal;
        const viewDepth = this.viewDepth;
        const reflectivity = this.reflectivity;
        const screenDepth = this.screenDepth;
        state.sharedData.blocksWithDefines.push(this);
        const comments = `//${this.name}`;
        const vec4 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector4);
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        state._emitFunctionFromInclude("helperFunctions", comments);
        state.compilationString += `#if defined(PREPASS)\r\n`;
        state.compilationString += isWebGPU ? `var fragData: array<vec4<f32>, SCENE_MRT_COUNT>;\r\n` : `vec4 fragData[SCENE_MRT_COUNT];\r\n`;
        state.compilationString += `#ifdef PREPASS_DEPTH\r\n`;
        if (viewDepth.connectedPoint) {
            state.compilationString += ` fragData[PREPASS_DEPTH_INDEX] = ${vec4}(${viewDepth.associatedVariableName}, 0.0, 0.0, 1.0);\r\n`;
        }
        else {
            // We have to write something on the viewDepth output or it will raise a gl error
            state.compilationString += ` fragData[PREPASS_DEPTH_INDEX] = ${vec4}(0.0, 0.0, 0.0, 0.0);\r\n`;
        }
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#ifdef PREPASS_SCREENSPACE_DEPTH\r\n`;
        if (screenDepth.connectedPoint) {
            state.compilationString += ` gl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX] = vec4(${screenDepth.associatedVariableName}, 0.0, 0.0, 1.0);\r\n`;
        }
        else {
            // We have to write something on the viewDepth output or it will raise a gl error
            state.compilationString += ` gl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX] = vec4(0.0, 0.0, 0.0, 0.0);\r\n`;
        }
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#ifdef PREPASS_POSITION\r\n`;
        if (worldPosition.connectedPoint) {
            state.compilationString += `fragData[PREPASS_POSITION_INDEX] = ${vec4}(${worldPosition.associatedVariableName}.rgb, ${worldPosition.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Vector4 ? worldPosition.associatedVariableName + ".a" : "1.0"});\r\n`;
        }
        else {
            // We have to write something on the position output or it will raise a gl error
            state.compilationString += ` fragData[PREPASS_POSITION_INDEX] = ${vec4}(0.0, 0.0, 0.0, 0.0);\r\n`;
        }
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#ifdef PREPASS_LOCAL_POSITION\r\n`;
        if (localPosition.connectedPoint) {
            state.compilationString += ` gl_FragData[PREPASS_LOCAL_POSITION_INDEX] = vec4(${localPosition.associatedVariableName}.rgb, ${localPosition.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Vector4 ? localPosition.associatedVariableName + ".a" : "1.0"});\r\n`;
        }
        else {
            // We have to write something on the position output or it will raise a gl error
            state.compilationString += ` gl_FragData[PREPASS_LOCAL_POSITION_INDEX] = vec4(0.0, 0.0, 0.0, 0.0);\r\n`;
        }
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#ifdef PREPASS_NORMAL\r\n`;
        if (viewNormal.connectedPoint) {
            state.compilationString += ` fragData[PREPASS_NORMAL_INDEX] = ${vec4}(${viewNormal.associatedVariableName}.rgb, ${viewNormal.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Vector4 ? viewNormal.associatedVariableName + ".a" : "1.0"});\r\n`;
        }
        else {
            // We have to write something on the normal output or it will raise a gl error
            state.compilationString += ` fragData[PREPASS_NORMAL_INDEX] = ${vec4}(0.0, 0.0, 0.0, 0.0);\r\n`;
        }
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#ifdef PREPASS_WORLD_NORMAL\r\n`;
        if (worldNormal.connectedPoint) {
            state.compilationString += ` gl_FragData[PREPASS_WORLD_NORMAL_INDEX] = vec4(${worldNormal.associatedVariableName}.rgb, ${worldNormal.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Vector4 ? worldNormal.associatedVariableName + ".a" : "1.0"});\r\n`;
        }
        else {
            // We have to write something on the normal output or it will raise a gl error
            state.compilationString += ` gl_FragData[PREPASS_WORLD_NORMAL_INDEX] = vec4(0.0, 0.0, 0.0, 0.0);\r\n`;
        }
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#ifdef PREPASS_REFLECTIVITY\r\n`;
        if (reflectivity.connectedPoint) {
            state.compilationString += ` fragData[PREPASS_REFLECTIVITY_INDEX] = ${vec4}(${reflectivity.associatedVariableName}.rgb, ${reflectivity.connectedPoint.type === NodeMaterialBlockConnectionPointTypes.Vector4 ? reflectivity.associatedVariableName + ".a" : "1.0"});\r\n`;
        }
        else {
            // We have to write something on the reflectivity output or it will raise a gl error
            state.compilationString += ` fragData[PREPASS_REFLECTIVITY_INDEX] = ${vec4}(0.0, 0.0, 0.0, 1.0);\r\n`;
        }
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#if SCENE_MRT_COUNT > 1\r\n`;
        state.compilationString += `${this._getFragData(isWebGPU, 1)} = fragData[1];\r\n`;
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#if SCENE_MRT_COUNT > 2\r\n`;
        state.compilationString += `${this._getFragData(isWebGPU, 2)} = fragData[2];\r\n`;
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#if SCENE_MRT_COUNT > 3\r\n`;
        state.compilationString += `${this._getFragData(isWebGPU, 3)} = fragData[3];\r\n`;
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#if SCENE_MRT_COUNT > 4\r\n`;
        state.compilationString += `${this._getFragData(isWebGPU, 4)} = fragData[4];\r\n`;
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#if SCENE_MRT_COUNT > 5\r\n`;
        state.compilationString += `${this._getFragData(isWebGPU, 5)} = fragData[5];\r\n`;
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#if SCENE_MRT_COUNT > 6\r\n`;
        state.compilationString += `${this._getFragData(isWebGPU, 6)} = fragData[6];\r\n`;
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#if SCENE_MRT_COUNT > 7\r\n`;
        state.compilationString += `${this._getFragData(isWebGPU, 7)} = fragData[7];\r\n`;
        state.compilationString += `#endif\r\n`;
        state.compilationString += `#endif\r\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PrePassOutputBlock", PrePassOutputBlock);
//# sourceMappingURL=prePassOutputBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js
var imageProcessingDeclaration = __webpack_require__(16205);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js
var imageProcessingFunctions = __webpack_require__(88996);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js
var ShadersInclude_helperFunctions = __webpack_require__(73325);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js
var ShadersInclude_imageProcessingDeclaration = __webpack_require__(89392);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js
var ShadersInclude_imageProcessingFunctions = __webpack_require__(64017);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bumpFragment.js
var bumpFragment = __webpack_require__(20727);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js
var bumpFragmentMainFunctions = __webpack_require__(15697);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bumpFragmentFunctions.js
var bumpFragmentFunctions = __webpack_require__(91258);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js
var ShadersInclude_bumpFragment = __webpack_require__(27018);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js
var ShadersInclude_bumpFragmentMainFunctions = __webpack_require__(17494);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js
var ShadersInclude_bumpFragmentFunctions = __webpack_require__(8269);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowMapVertexMetric.js
var shadowMapVertexMetric = __webpack_require__(71311);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/packingFunctions.js
var packingFunctions = __webpack_require__(5543);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowMapFragment.js
var shadowMapFragment = __webpack_require__(89273);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexMetric.js
var ShadersInclude_shadowMapVertexMetric = __webpack_require__(29796);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/packingFunctions.js
var ShadersInclude_packingFunctions = __webpack_require__(8334);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragment.js
var ShadersInclude_shadowMapFragment = __webpack_require__(98322);
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/index.js















// async-loaded shaders
// imageProcessingBlock






// perturbNormalBlock






// shadowMapBlock






//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/fogBlock.js







/**
 * Block used to add support for scene fog
 */
class FogBlock extends NodeMaterialBlock {
    /**
     * Create a new FogBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.VertexAndFragment, false);
        // Vertex
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, false, NodeMaterialBlockTargets.Vertex);
        // Fragment
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("fogColor", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.input.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Color4);
        this.fogColor.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Color4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "FogBlock";
    }
    /**
     * Gets the world position input component
     */
    get worldPosition() {
        return this._inputs[0];
    }
    /**
     * Gets the view input component
     */
    get view() {
        return this._inputs[1];
    }
    /**
     * Gets the color input component
     */
    get input() {
        return this._inputs[2];
    }
    /**
     * Gets the fog color input component
     */
    get fogColor() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    initialize(state) {
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 66407));
        }
        else {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 7806));
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.view.isConnected) {
            let viewInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.View && additionalFilteringInfo(b));
            if (!viewInput) {
                viewInput = new InputBlock("view");
                viewInput.setAsSystemValue(NodeMaterialSystemValues.View);
            }
            viewInput.output.connectTo(this.view);
        }
        if (!this.fogColor.isConnected) {
            let fogColorInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.FogColor && additionalFilteringInfo(b));
            if (!fogColorInput) {
                fogColorInput = new InputBlock("fogColor", undefined, NodeMaterialBlockConnectionPointTypes.Color3);
                fogColorInput.setAsSystemValue(NodeMaterialSystemValues.FogColor);
            }
            fogColorInput.output.connectTo(this.fogColor);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        const scene = mesh.getScene();
        defines.setValue("FOG", nodeMaterial.fogEnabled && (0,materialHelper_functions/* GetFogState */.qL)(mesh, scene));
    }
    bind(effect, nodeMaterial, mesh) {
        if (!mesh) {
            return;
        }
        const scene = mesh.getScene();
        effect.setFloat4(this._fogParameters, scene.fogMode, scene.fogStart, scene.fogEnd, scene.fogDensity);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            state.sharedData.blocksWithDefines.push(this);
            state.sharedData.bindableBlocks.push(this);
            let replaceStrings = [];
            let prefix1 = "";
            let prefix2 = "";
            if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                replaceStrings = [
                    { search: /fn CalcFogFactor\(\)/, replace: "fn CalcFogFactor(vFogDistance: vec3f, vFogInfos: vec4f)" },
                    { search: /uniforms.vFogInfos/g, replace: "vFogInfos" },
                    { search: /fragmentInputs.vFogDistance/g, replace: "vFogDistance" },
                ];
                prefix1 = "fragmentInputs.";
                prefix2 = "uniforms.";
            }
            else {
                replaceStrings = [{ search: /float CalcFogFactor\(\)/, replace: "float CalcFogFactor(vec3 vFogDistance, vec4 vFogInfos)" }];
            }
            state._emitFunctionFromInclude("fogFragmentDeclaration", `//${this.name}`, {
                removeUniforms: true,
                removeVaryings: true,
                removeIfDef: false,
                replaceStrings: replaceStrings,
            });
            const tempFogVariablename = state._getFreeVariableName("fog");
            const color = this.input;
            const fogColor = this.fogColor;
            this._fogParameters = state._getFreeVariableName("fogParameters");
            const output = this._outputs[0];
            state._emitUniformFromString(this._fogParameters, NodeMaterialBlockConnectionPointTypes.Vector4);
            state.compilationString += `#ifdef FOG\n`;
            state.compilationString += `${state._declareLocalVar(tempFogVariablename, NodeMaterialBlockConnectionPointTypes.Float)} = CalcFogFactor(${prefix1}${this._fogDistanceName}, ${prefix2}${this._fogParameters});\n`;
            state.compilationString +=
                state._declareOutput(output) +
                    ` = ${tempFogVariablename} * ${color.associatedVariableName}.rgb + (1.0 - ${tempFogVariablename}) * ${fogColor.associatedVariableName}.rgb;\n`;
            state.compilationString += `#else\n${state._declareOutput(output)} =  ${color.associatedVariableName}.rgb;\n`;
            state.compilationString += `#endif\n`;
        }
        else {
            const worldPos = this.worldPosition;
            const view = this.view;
            this._fogDistanceName = state._getFreeVariableName("vFogDistance");
            state._emitVaryingFromString(this._fogDistanceName, NodeMaterialBlockConnectionPointTypes.Vector3);
            const prefix = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "vertexOutputs." : "";
            state.compilationString += `${prefix}${this._fogDistanceName} = (${view.associatedVariableName} * ${worldPos.associatedVariableName}).xyz;\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FogBlock", FogBlock);
//# sourceMappingURL=fogBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/lightBlock.js










/**
 * Block used to add light in the fragment shader
 */
class LightBlock extends NodeMaterialBlock {
    static _OnGenerateOnlyFragmentCodeChanged(block, _propertyName) {
        const that = block;
        if (that.worldPosition.isConnected) {
            that.generateOnlyFragmentCode = !that.generateOnlyFragmentCode;
            logger/* Logger */.V.Error("The worldPosition input must not be connected to be able to switch!");
            return false;
        }
        that._setTarget();
        return true;
    }
    _setTarget() {
        this._setInitialTarget(this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment);
        this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex;
    }
    /**
     * Create a new LightBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.VertexAndFragment);
        this._lightId = 0;
        /** Indicates that no code should be generated in the vertex shader. Can be useful in some specific circumstances (like when doing ray marching for eg) */
        this.generateOnlyFragmentCode = false;
        this._isUnique = true;
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("glossiness", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("glossPower", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("diffuseColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("specularColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, true);
        this.registerOutput("diffuseOutput", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("specularOutput", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("shadow", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "LightBlock";
    }
    /**
     * Gets the world position input component
     */
    get worldPosition() {
        return this._inputs[0];
    }
    /**
     * Gets the world normal input component
     */
    get worldNormal() {
        return this._inputs[1];
    }
    /**
     * Gets the camera (or eye) position component
     */
    get cameraPosition() {
        return this._inputs[2];
    }
    /**
     * Gets the glossiness component
     */
    get glossiness() {
        return this._inputs[3];
    }
    /**
     * Gets the glossiness power component
     */
    get glossPower() {
        return this._inputs[4];
    }
    /**
     * Gets the diffuse color component
     */
    get diffuseColor() {
        return this._inputs[5];
    }
    /**
     * Gets the specular color component
     */
    get specularColor() {
        return this._inputs[6];
    }
    /**
     * Gets the view matrix component
     */
    get view() {
        return this._inputs[7];
    }
    /**
     * Gets the diffuse output component
     */
    get diffuseOutput() {
        return this._outputs[0];
    }
    /**
     * Gets the specular output component
     */
    get specularOutput() {
        return this._outputs[1];
    }
    /**
     * Gets the shadow output component
     */
    get shadow() {
        return this._outputs[2];
    }
    initialize(state) {
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 25271)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 30379)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3925)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79702)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 76493)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 78589)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79456)),
            ]);
        }
        else {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 92270)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 37256)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22448)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 4662)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 47059)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 73325)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 21962)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 66812)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 35687)),
            ]);
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.cameraPosition.isConnected) {
            let cameraPositionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.CameraPosition && additionalFilteringInfo(b));
            if (!cameraPositionInput) {
                cameraPositionInput = new InputBlock("cameraPosition");
                cameraPositionInput.setAsSystemValue(NodeMaterialSystemValues.CameraPosition);
            }
            cameraPositionInput.output.connectTo(this.cameraPosition);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        if (!defines._areLightsDirty) {
            return;
        }
        const scene = mesh.getScene();
        if (!this.light) {
            (0,materialHelper_functions/* PrepareDefinesForLights */.az)(scene, mesh, defines, true, nodeMaterial.maxSimultaneousLights);
        }
        else {
            const state = {
                needNormals: false,
                needRebuild: false,
                lightmapMode: false,
                shadowEnabled: false,
                specularEnabled: false,
            };
            (0,materialHelper_functions/* PrepareDefinesForLight */.lo)(scene, mesh, this.light, this._lightId, defines, true, state);
            if (state.needRebuild) {
                defines.rebuild();
            }
        }
    }
    updateUniformsAndSamples(state, nodeMaterial, defines, uniformBuffers) {
        for (let lightIndex = 0; lightIndex < nodeMaterial.maxSimultaneousLights; lightIndex++) {
            if (!defines["LIGHT" + lightIndex]) {
                break;
            }
            const onlyUpdateBuffersList = state.uniforms.indexOf("vLightData" + lightIndex) >= 0;
            (0,materialHelper_functions/* PrepareUniformsAndSamplersForLight */.GD)(lightIndex, state.uniforms, state.samplers, defines["PROJECTEDLIGHTTEXTURE" + lightIndex], uniformBuffers, onlyUpdateBuffersList);
        }
    }
    bind(effect, nodeMaterial, mesh) {
        if (!mesh) {
            return;
        }
        const scene = mesh.getScene();
        if (!this.light) {
            (0,materialHelper_functions/* BindLights */.RL)(scene, mesh, effect, true, nodeMaterial.maxSimultaneousLights);
        }
        else {
            (0,materialHelper_functions/* BindLight */.Kd)(this.light, this._lightId, scene, effect, true);
        }
    }
    _injectVertexCode(state) {
        const worldPos = this.worldPosition;
        const comments = `//${this.name}`;
        // Declaration
        if (!this.light) {
            // Emit for all lights
            state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", comments, {
                repeatKey: "maxSimultaneousLights",
            });
            this._lightId = 0;
            state.sharedData.dynamicUniformBlocks.push(this);
        }
        else {
            this._lightId = (state.counters["lightCounter"] !== undefined ? state.counters["lightCounter"] : -1) + 1;
            state.counters["lightCounter"] = this._lightId;
            state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", comments, {
                replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }],
            }, this._lightId.toString());
        }
        // Inject code in vertex
        const worldPosVaryingName = "v_" + worldPos.associatedVariableName;
        if (state._emitVaryingFromString(worldPosVaryingName, NodeMaterialBlockConnectionPointTypes.Vector4)) {
            state.compilationString += (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "vertexOutputs." : "") + `${worldPosVaryingName} = ${worldPos.associatedVariableName};\n`;
        }
        if (this.light) {
            state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, {
                replaceStrings: [
                    { search: /{X}/g, replace: this._lightId.toString() },
                    { search: /worldPos/g, replace: worldPos.associatedVariableName },
                ],
            });
        }
        else {
            state.compilationString += `${state._declareLocalVar("worldPos", NodeMaterialBlockConnectionPointTypes.Vector4)} = ${worldPos.associatedVariableName};\n`;
            if (this.view.isConnected) {
                state.compilationString += `${state._declareLocalVar("view", NodeMaterialBlockConnectionPointTypes.Matrix)} = ${this.view.associatedVariableName};\n`;
            }
            state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, {
                repeatKey: "maxSimultaneousLights",
            });
        }
    }
    _injectUBODeclaration(state) {
        const comments = `//${this.name}`;
        if (!this.light) {
            // Emit for all lights
            state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", comments, {
                repeatKey: "maxSimultaneousLights",
                substitutionVars: this.generateOnlyFragmentCode ? "varying," : undefined,
            });
        }
        else {
            state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", comments, {
                replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }],
            }, this._lightId.toString());
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const isWGSL = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        const addF = isWGSL ? "f" : "";
        const comments = `//${this.name}`;
        if (state.target !== NodeMaterialBlockTargets.Fragment) {
            // Vertex
            this._injectVertexCode(state);
            return;
        }
        if (this.generateOnlyFragmentCode) {
            state.sharedData.dynamicUniformBlocks.push(this);
        }
        // Fragment
        const accessor = isWGSL ? "fragmentInputs." : "";
        state.sharedData.forcedBindableBlocks.push(this);
        state.sharedData.blocksWithDefines.push(this);
        const worldPos = this.worldPosition;
        let worldPosVariableName = worldPos.associatedVariableName;
        if (this.generateOnlyFragmentCode) {
            worldPosVariableName = state._getFreeVariableName("globalWorldPos");
            state._emitFunction("light_globalworldpos", `${state._declareLocalVar(worldPosVariableName, NodeMaterialBlockConnectionPointTypes.Vector3)};\n`, comments);
            state.compilationString += `${worldPosVariableName} = ${worldPos.associatedVariableName}.xyz;\n`;
            state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, {
                repeatKey: "maxSimultaneousLights",
                substitutionVars: this.generateOnlyFragmentCode ? `worldPos,${worldPos.associatedVariableName}` : undefined,
            });
        }
        else {
            worldPosVariableName = accessor + "v_" + worldPosVariableName + ".xyz";
        }
        state._emitFunctionFromInclude("helperFunctions", comments);
        let replaceString = { search: /vPositionW/g, replace: worldPosVariableName };
        if (isWGSL) {
            replaceString = { search: /fragmentInputs\.vPositionW/g, replace: worldPosVariableName };
        }
        state._emitFunctionFromInclude("lightsFragmentFunctions", comments, {
            replaceStrings: [replaceString],
        });
        state._emitFunctionFromInclude("shadowsFragmentFunctions", comments, {
            replaceStrings: [replaceString],
        });
        this._injectUBODeclaration(state);
        // Code
        if (this._lightId === 0) {
            if (state._registerTempVariable("viewDirectionW")) {
                state.compilationString += `${state._declareLocalVar("viewDirectionW", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${this.cameraPosition.associatedVariableName} - ${worldPosVariableName});\n`;
            }
            state.compilationString += isWGSL ? `var info: lightingInfo;\n` : `lightingInfo info;\n`;
            state.compilationString += `${state._declareLocalVar("shadow", NodeMaterialBlockConnectionPointTypes.Float)} = 1.;\n`;
            state.compilationString += `${state._declareLocalVar("aggShadow", NodeMaterialBlockConnectionPointTypes.Float)} = 0.;\n`;
            state.compilationString += `${state._declareLocalVar("numLights", NodeMaterialBlockConnectionPointTypes.Float)} = 0.;\n`;
            state.compilationString += `${state._declareLocalVar("glossiness", NodeMaterialBlockConnectionPointTypes.Float)} = ${this.glossiness.isConnected ? this.glossiness.associatedVariableName : "1.0"} * ${this.glossPower.isConnected ? this.glossPower.associatedVariableName : "1024.0"};\n`;
            state.compilationString += `${state._declareLocalVar("diffuseBase", NodeMaterialBlockConnectionPointTypes.Vector3)} = vec3${addF}(0., 0., 0.);\n`;
            state.compilationString += `${state._declareLocalVar("specularBase", NodeMaterialBlockConnectionPointTypes.Vector3)}  = vec3${addF}(0., 0., 0.);\n`;
            state.compilationString += `${state._declareLocalVar("normalW", NodeMaterialBlockConnectionPointTypes.Vector3)} = ${this.worldNormal.associatedVariableName}.xyz;\n`;
        }
        if (this.light) {
            let replaceString = { search: /vPositionW/g, replace: worldPosVariableName + ".xyz" };
            if (isWGSL) {
                replaceString = { search: /fragmentInputs\.vPositionW/g, replace: worldPosVariableName + ".xyz" };
            }
            state.compilationString += state._emitCodeFromInclude("lightFragment", comments, {
                replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }, replaceString],
            });
        }
        else {
            let substitutionVars = `vPositionW,${worldPosVariableName}.xyz`;
            if (isWGSL) {
                substitutionVars = `fragmentInputs.vPositionW,${worldPosVariableName}.xyz`;
            }
            state.compilationString += state._emitCodeFromInclude("lightFragment", comments, {
                repeatKey: "maxSimultaneousLights",
                substitutionVars: substitutionVars,
            });
        }
        if (this._lightId === 0) {
            state.compilationString += `aggShadow = aggShadow / numLights;\n`;
        }
        const diffuseOutput = this.diffuseOutput;
        const specularOutput = this.specularOutput;
        state.compilationString +=
            state._declareOutput(diffuseOutput) + ` = diffuseBase${this.diffuseColor.isConnected ? " * " + this.diffuseColor.associatedVariableName : ""};\n`;
        if (specularOutput.hasEndpoints) {
            state.compilationString +=
                state._declareOutput(specularOutput) + ` = specularBase${this.specularColor.isConnected ? " * " + this.specularColor.associatedVariableName : ""};\n`;
        }
        if (this.shadow.hasEndpoints) {
            state.compilationString += state._declareOutput(this.shadow) + ` = aggShadow;\n`;
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.generateOnlyFragmentCode = this.generateOnlyFragmentCode;
        if (this.light) {
            serializationObject.lightId = this.light.id;
        }
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        if (serializationObject.lightId) {
            this.light = scene.getLightById(serializationObject.lightId);
        }
        this.generateOnlyFragmentCode = serializationObject.generateOnlyFragmentCode;
        this._setTarget();
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Generate only fragment code", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", {
        notifiers: { rebuild: true, update: true, onValidation: LightBlock._OnGenerateOnlyFragmentCodeChanged },
    })
], LightBlock.prototype, "generateOnlyFragmentCode", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.LightBlock", LightBlock);
//# sourceMappingURL=lightBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/imageSourceBlock.js









/**
 * Block used to provide an image for a TextureBlock
 */
class ImageSourceBlock extends NodeMaterialBlock {
    /**
     * Gets or sets the texture associated with the node
     */
    get texture() {
        return this._texture;
    }
    set texture(texture) {
        if (this._texture === texture) {
            return;
        }
        const scene = texture?.getScene() ?? engineStore/* EngineStore */.q.LastCreatedScene;
        if (!texture && scene) {
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this._texture);
            });
        }
        this._texture = texture;
        if (texture && scene) {
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(texture);
            });
        }
    }
    /**
     * Gets the sampler name associated with this image source
     */
    get samplerName() {
        return this._samplerName;
    }
    /**
     * Creates a new ImageSourceBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.VertexAndFragment);
        this.registerOutput("source", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("source", this, 1 /* NodeMaterialConnectionPointDirection.Output */, ImageSourceBlock, "ImageSourceBlock"));
        this.registerOutput("dimensions", NodeMaterialBlockConnectionPointTypes.Vector2);
    }
    bind(effect) {
        if (!this.texture) {
            return;
        }
        effect.setTexture(this._samplerName, this.texture);
    }
    isReady() {
        if (this.texture && !this.texture.isReadyOrNotBlocking()) {
            return false;
        }
        return true;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ImageSourceBlock";
    }
    /**
     * Gets the output component
     */
    get source() {
        return this._outputs[0];
    }
    /**
     * Gets the dimension component
     */
    get dimensions() {
        return this._outputs[1];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Vertex) {
            this._samplerName = state._getFreeVariableName(this.name + "Texture");
            // Declarations
            state.sharedData.blockingBlocks.push(this);
            state.sharedData.textureBlocks.push(this);
            state.sharedData.bindableBlocks.push(this);
        }
        if (this.dimensions.isConnected) {
            let affect = "";
            if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                affect = `vec2f(textureDimensions(${this._samplerName}, 0).xy)`;
            }
            else {
                affect = `vec2(textureSize(${this._samplerName}, 0).xy)`;
            }
            state.compilationString += `${state._declareOutput(this.dimensions)} = ${affect};\n`;
        }
        state._emit2DSampler(this._samplerName);
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        if (!this.texture) {
            return codeString;
        }
        codeString += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});\n`;
        codeString += `${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};\n`;
        codeString += `${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};\n`;
        codeString += `${this._codeVariableName}.texture.uAng = ${this.texture.uAng};\n`;
        codeString += `${this._codeVariableName}.texture.vAng = ${this.texture.vAng};\n`;
        codeString += `${this._codeVariableName}.texture.wAng = ${this.texture.wAng};\n`;
        codeString += `${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};\n`;
        codeString += `${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};\n`;
        codeString += `${this._codeVariableName}.texture.uScale = ${this.texture.uScale};\n`;
        codeString += `${this._codeVariableName}.texture.vScale = ${this.texture.vScale};\n`;
        codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        if (this.texture && !this.texture.isRenderTarget && this.texture.getClassName() !== "VideoTexture") {
            serializationObject.texture = this.texture.serialize();
        }
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl, urlRewriter) {
        super._deserialize(serializationObject, scene, rootUrl, urlRewriter);
        if (serializationObject.texture && !NodeMaterial.IgnoreTexturesAtLoadTime && serializationObject.texture.url !== undefined) {
            if (serializationObject.texture.url.indexOf("data:") === 0) {
                rootUrl = "";
            }
            else if (urlRewriter) {
                serializationObject.texture.url = urlRewriter(serializationObject.texture.url);
                serializationObject.texture.name = serializationObject.texture.url;
            }
            this.texture = Textures_texture/* Texture */.g.Parse(serializationObject.texture, scene, rootUrl);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ImageSourceBlock", ImageSourceBlock);
//# sourceMappingURL=imageSourceBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/textureBlock.js













/**
 * Block used to read a texture from a sampler
 */
class TextureBlock extends NodeMaterialBlock {
    /**
     * Gets or sets the texture associated with the node
     */
    get texture() {
        if (this.source.isConnected) {
            return (this.source.connectedPoint?.ownerBlock).texture;
        }
        return this._texture;
    }
    set texture(texture) {
        if (this._texture === texture) {
            return;
        }
        const scene = texture?.getScene() ?? engineStore/* EngineStore */.q.LastCreatedScene;
        if (!texture && scene) {
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this._texture);
            });
        }
        this._texture = texture;
        if (texture && scene) {
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(texture);
            });
        }
    }
    static _IsPrePassTextureBlock(block) {
        return block?.getClassName() === "PrePassTextureBlock";
    }
    get _isSourcePrePass() {
        return TextureBlock._IsPrePassTextureBlock(this._imageSource);
    }
    /**
     * Gets the sampler name associated with this texture
     */
    get samplerName() {
        if (this._imageSource) {
            if (!TextureBlock._IsPrePassTextureBlock(this._imageSource)) {
                return this._imageSource.samplerName;
            }
            if (this.source.connectedPoint) {
                return this._imageSource.getSamplerName(this.source.connectedPoint);
            }
        }
        return this._samplerName;
    }
    /**
     * Gets a boolean indicating that this block is linked to an ImageSourceBlock
     */
    get hasImageSource() {
        return this.source.isConnected;
    }
    /**
     * Gets or sets a boolean indicating if content needs to be converted to gamma space
     */
    set convertToGammaSpace(value) {
        if (value === this._convertToGammaSpace) {
            return;
        }
        this._convertToGammaSpace = value;
        if (this.texture) {
            const scene = this.texture.getScene() ?? engineStore/* EngineStore */.q.LastCreatedScene;
            scene?.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this.texture);
            });
        }
    }
    get convertToGammaSpace() {
        return this._convertToGammaSpace;
    }
    /**
     * Gets or sets a boolean indicating if content needs to be converted to linear space
     */
    set convertToLinearSpace(value) {
        if (value === this._convertToLinearSpace) {
            return;
        }
        this._convertToLinearSpace = value;
        if (this.texture) {
            const scene = this.texture.getScene() ?? engineStore/* EngineStore */.q.LastCreatedScene;
            scene?.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this.texture);
            });
        }
    }
    get convertToLinearSpace() {
        return this._convertToLinearSpace;
    }
    /**
     * Create a new TextureBlock
     * @param name defines the block name
     * @param fragmentOnly
     */
    constructor(name, fragmentOnly = false) {
        super(name, fragmentOnly ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment);
        this._convertToGammaSpace = false;
        this._convertToLinearSpace = false;
        /**
         * Gets or sets a boolean indicating if multiplication of texture with level should be disabled
         */
        this.disableLevelMultiplication = false;
        this._fragmentOnly = fragmentOnly;
        this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.VertexAndFragment);
        this.registerInput("source", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("source", this, 0 /* NodeMaterialConnectionPointDirection.Input */, ImageSourceBlock, "ImageSourceBlock"));
        this.registerInput("layer", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("lod", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("level", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
        this._inputs[0]._prioritizeVertex = !fragmentOnly;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TextureBlock";
    }
    /**
     * Gets the uv input component
     */
    get uv() {
        return this._inputs[0];
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[1];
    }
    /**
     * Gets the layer input component
     */
    get layer() {
        return this._inputs[2];
    }
    /**
     * Gets the LOD input component
     */
    get lod() {
        return this._inputs[3];
    }
    /**
     * Gets the rgba output component
     */
    get rgba() {
        return this._outputs[0];
    }
    /**
     * Gets the rgb output component
     */
    get rgb() {
        return this._outputs[1];
    }
    /**
     * Gets the r output component
     */
    get r() {
        return this._outputs[2];
    }
    /**
     * Gets the g output component
     */
    get g() {
        return this._outputs[3];
    }
    /**
     * Gets the b output component
     */
    get b() {
        return this._outputs[4];
    }
    /**
     * Gets the a output component
     */
    get a() {
        return this._outputs[5];
    }
    /**
     * Gets the level output component
     */
    get level() {
        return this._outputs[6];
    }
    _isTiedToFragment(input) {
        if (input.target === NodeMaterialBlockTargets.Fragment) {
            return true;
        }
        if (input.target === NodeMaterialBlockTargets.Vertex) {
            return false;
        }
        if (input.target === NodeMaterialBlockTargets.Neutral || input.target === NodeMaterialBlockTargets.VertexAndFragment) {
            const parentBlock = input.ownerBlock;
            if (parentBlock.target === NodeMaterialBlockTargets.Fragment) {
                return true;
            }
            for (const input of parentBlock.inputs) {
                if (!input.isConnected) {
                    continue;
                }
                if (this._isTiedToFragment(input.connectedPoint)) {
                    return true;
                }
            }
        }
        return false;
    }
    _getEffectiveTarget() {
        if (this._fragmentOnly) {
            return NodeMaterialBlockTargets.Fragment;
        }
        // TextureBlock has a special optimizations for uvs that come from the vertex shaders as they can be packed into a single varyings.
        // But we need to detect uvs coming from fragment then
        if (!this.uv.isConnected) {
            return NodeMaterialBlockTargets.VertexAndFragment;
        }
        if (this.uv.sourceBlock.isInput) {
            return NodeMaterialBlockTargets.VertexAndFragment;
        }
        if (this._isTiedToFragment(this.uv.connectedPoint)) {
            return NodeMaterialBlockTargets.Fragment;
        }
        return NodeMaterialBlockTargets.VertexAndFragment;
    }
    get target() {
        return this._getEffectiveTarget();
    }
    set target(value) { }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.uv.isConnected) {
            if (material.mode === NodeMaterialModes.PostProcess) {
                const uvInput = material.getBlockByPredicate((b) => b.name === "uv" && additionalFilteringInfo(b));
                if (uvInput) {
                    uvInput.connectTo(this);
                }
            }
            else if (material.mode !== NodeMaterialModes.ProceduralTexture) {
                const attributeName = material.mode === NodeMaterialModes.Particle ? "particle_uv" : "uv";
                let uvInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === attributeName && additionalFilteringInfo(b));
                if (!uvInput) {
                    uvInput = new InputBlock("uv");
                    uvInput.setAsAttribute(attributeName);
                }
                uvInput.output.connectTo(this.uv);
            }
        }
    }
    initializeDefines(mesh, nodeMaterial, defines) {
        if (!defines._areTexturesDirty) {
            return;
        }
        if (this._mainUVDefineName !== undefined) {
            defines.setValue(this._mainUVDefineName, false, true);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        if (!defines._areTexturesDirty) {
            return;
        }
        if (!this.texture || !this.texture.getTextureMatrix) {
            if (this._isMixed) {
                defines.setValue(this._defineName, false, true);
                defines.setValue(this._mainUVDefineName, true, true);
            }
            return;
        }
        const toGamma = this.convertToGammaSpace && this.texture && !this.texture.gammaSpace;
        const toLinear = this.convertToLinearSpace && this.texture && this.texture.gammaSpace;
        // Not a bug... Name defines the texture space not the required conversion
        defines.setValue(this._linearDefineName, toGamma, true);
        defines.setValue(this._gammaDefineName, toLinear, true);
        if (this._isMixed) {
            if (!this.texture.getTextureMatrix().isIdentityAs3x2()) {
                defines.setValue(this._defineName, true);
                if (defines[this._mainUVDefineName] == undefined) {
                    defines.setValue(this._mainUVDefineName, false, true);
                }
            }
            else {
                defines.setValue(this._defineName, false, true);
                defines.setValue(this._mainUVDefineName, true, true);
            }
        }
    }
    isReady() {
        if (this._isSourcePrePass) {
            return true;
        }
        if (this.texture && !this.texture.isReadyOrNotBlocking()) {
            return false;
        }
        return true;
    }
    bind(effect) {
        if (this._isSourcePrePass) {
            effect.setFloat(this._textureInfoName, 1);
        }
        if (!this.texture) {
            return;
        }
        if (this._isMixed) {
            effect.setFloat(this._textureInfoName, this.texture.level);
            effect.setMatrix(this._textureTransformName, this.texture.getTextureMatrix());
        }
        if (!this._imageSource) {
            effect.setTexture(this._samplerName, this.texture);
        }
    }
    get _isMixed() {
        return this.target !== NodeMaterialBlockTargets.Fragment;
    }
    _injectVertexCode(state) {
        const uvInput = this.uv;
        // Inject code in vertex
        this._defineName = state._getFreeDefineName("UVTRANSFORM");
        this._mainUVDefineName = "VMAIN" + uvInput.declarationVariableName.toUpperCase();
        this._mainUVName = "vMain" + uvInput.declarationVariableName;
        this._transformedUVName = state._getFreeVariableName("transformedUV");
        this._textureTransformName = state._getFreeVariableName("textureTransform");
        this._textureInfoName = state._getFreeVariableName("textureInfoName");
        this.level.associatedVariableName = this._textureInfoName;
        state._emitVaryingFromString(this._transformedUVName, NodeMaterialBlockConnectionPointTypes.Vector2, this._defineName);
        state._emitVaryingFromString(this._mainUVName, NodeMaterialBlockConnectionPointTypes.Vector2, this._mainUVDefineName);
        state._emitUniformFromString(this._textureTransformName, NodeMaterialBlockConnectionPointTypes.Matrix, this._defineName);
        const vec4 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector4);
        const vec2 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector2);
        state.compilationString += `#ifdef ${this._defineName}\n`;
        state.compilationString += `${state._getVaryingName(this._transformedUVName)} = ${vec2}(${this._textureTransformName} * ${vec4}(${uvInput.associatedVariableName}.xy, 1.0, 0.0));\n`;
        state.compilationString += `#elif defined(${this._mainUVDefineName})\n`;
        let automaticPrefix = "";
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            if (uvInput.isConnectedToInputBlock && uvInput.associatedVariableName.indexOf("vertexInputs.") === -1) {
                automaticPrefix = "vertexInputs."; // Force the prefix
            }
        }
        state.compilationString += `${state._getVaryingName(this._mainUVName)} = ${automaticPrefix}${uvInput.associatedVariableName}.xy;\n`;
        state.compilationString += `#endif\n`;
        if (!this._outputs.some((o) => o.isConnectedInVertexShader)) {
            return;
        }
        this._writeTextureRead(state, true);
        for (const output of this._outputs) {
            if (output.hasEndpoints && output.name !== "level") {
                this._writeOutput(state, output, output.name, true);
            }
        }
    }
    _getUVW(uvName) {
        let coords = uvName;
        const is2DArrayTexture = this._texture?._texture?.is2DArray ?? false;
        const is3D = this._texture?._texture?.is3D ?? false;
        if (is2DArrayTexture) {
            const layerValue = this.layer.isConnected ? this.layer.associatedVariableName : "0";
            coords = `vec3(${uvName}, ${layerValue})`;
        }
        else if (is3D) {
            const layerValue = this.layer.isConnected ? this.layer.associatedVariableName : "0";
            coords = `vec3(${uvName}, ${layerValue})`;
        }
        return coords;
    }
    _samplerFunc(state) {
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return state.target === NodeMaterialBlockTargets.Vertex ? "textureSampleLevel" : "textureSample";
        }
        return this.lod.isConnected ? "texture2DLodEXT" : "texture2D";
    }
    get _samplerLodSuffix() {
        return this.lod.isConnected ? `, ${this.lod.associatedVariableName}` : "";
    }
    _generateTextureSample(uv, state) {
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            const isVertex = state.target === NodeMaterialBlockTargets.Vertex;
            return `${this._samplerFunc(state)}(${this.samplerName},${this.samplerName + `Sampler`}, ${this._getUVW(uv)}${this._samplerLodSuffix}${isVertex ? ", 0" : ""})`;
        }
        return `${this._samplerFunc(state)}(${this.samplerName}, ${this._getUVW(uv)}${this._samplerLodSuffix})`;
    }
    _generateTextureLookup(state) {
        state.compilationString += `#ifdef ${this._defineName}\n`;
        state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this._generateTextureSample(state._getVaryingName(this._transformedUVName), state)};\n`;
        state.compilationString += `#elif defined(${this._mainUVDefineName})\n`;
        state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this._generateTextureSample(this._mainUVName ? state._getVaryingName(this._mainUVName) : this.uv.associatedVariableName, state)}${this._samplerLodSuffix};\n`;
        state.compilationString += `#endif\n`;
    }
    _writeTextureRead(state, vertexMode = false) {
        const uvInput = this.uv;
        if (vertexMode) {
            if (state.target === NodeMaterialBlockTargets.Fragment) {
                return;
            }
            this._generateTextureLookup(state);
            return;
        }
        if (this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment) {
            state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this._generateTextureSample(uvInput.associatedVariableName, state)}${this._samplerLodSuffix};\n`;
            return;
        }
        this._generateTextureLookup(state);
    }
    _generateConversionCode(state, output, swizzle) {
        if (swizzle !== "a") {
            // no conversion if the output is "a" (alpha)
            if (!this.texture || !this.texture.gammaSpace) {
                state.compilationString += `#ifdef ${this._linearDefineName}
                    ${output.associatedVariableName} = toGammaSpace(${output.associatedVariableName});
                    #endif
                `;
            }
            state.compilationString += `#ifdef ${this._gammaDefineName}
                ${output.associatedVariableName} = ${state._toLinearSpace(output)};
                #endif
            `;
        }
    }
    _writeOutput(state, output, swizzle, vertexMode = false) {
        if (vertexMode) {
            if (state.target === NodeMaterialBlockTargets.Fragment) {
                return;
            }
            state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle};\n`;
            this._generateConversionCode(state, output, swizzle);
            return;
        }
        if (this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment) {
            state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle};\n`;
            this._generateConversionCode(state, output, swizzle);
            return;
        }
        let complement = "";
        if (!this.disableLevelMultiplication) {
            complement = ` * ${(state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "uniforms." : "") + this._textureInfoName}`;
        }
        state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle}${complement};\n`;
        this._generateConversionCode(state, output, swizzle);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (this.source.isConnected) {
            this._imageSource = this.source.connectedPoint.ownerBlock;
        }
        else {
            this._imageSource = null;
        }
        if (state.target === NodeMaterialBlockTargets.Vertex || this._fragmentOnly || state.target === NodeMaterialBlockTargets.Fragment) {
            this._tempTextureRead = state._getFreeVariableName("tempTextureRead");
            this._linearDefineName = state._getFreeDefineName("ISLINEAR");
            this._gammaDefineName = state._getFreeDefineName("ISGAMMA");
        }
        if ((!this._isMixed && state.target === NodeMaterialBlockTargets.Fragment) || (this._isMixed && state.target === NodeMaterialBlockTargets.Vertex)) {
            if (!this._imageSource) {
                const varName = state._getFreeVariableName(this.name);
                this._samplerName = varName + "Texture";
                if (this._texture?._texture?.is2DArray) {
                    state._emit2DArraySampler(this._samplerName);
                }
                else {
                    state._emit2DSampler(this._samplerName);
                }
            }
            // Declarations
            state.sharedData.blockingBlocks.push(this);
            state.sharedData.textureBlocks.push(this);
            state.sharedData.blocksWithDefines.push(this);
            state.sharedData.bindableBlocks.push(this);
        }
        if (state.target !== NodeMaterialBlockTargets.Fragment) {
            // Vertex
            this._injectVertexCode(state);
            return;
        }
        // Fragment
        if (!this._outputs.some((o) => o.isConnectedInFragmentShader)) {
            return;
        }
        if (this._isMixed && !this._imageSource) {
            // Reexport the sampler
            if (this._texture?._texture?.is2DArray) {
                state._emit2DArraySampler(this._samplerName);
            }
            else {
                state._emit2DSampler(this._samplerName);
            }
        }
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("helperFunctions", comments);
        if (this._isMixed) {
            state._emitUniformFromString(this._textureInfoName, NodeMaterialBlockConnectionPointTypes.Float);
        }
        this._writeTextureRead(state);
        for (const output of this._outputs) {
            if (output.hasEndpoints && output.name !== "level") {
                this._writeOutput(state, output, output.name);
            }
        }
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};\n`;
        codeString += `${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};\n`;
        codeString += `${this._codeVariableName}.disableLevelMultiplication = ${this.disableLevelMultiplication};\n`;
        if (!this.texture) {
            return codeString;
        }
        codeString += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});\n`;
        codeString += `${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};\n`;
        codeString += `${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};\n`;
        codeString += `${this._codeVariableName}.texture.uAng = ${this.texture.uAng};\n`;
        codeString += `${this._codeVariableName}.texture.vAng = ${this.texture.vAng};\n`;
        codeString += `${this._codeVariableName}.texture.wAng = ${this.texture.wAng};\n`;
        codeString += `${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};\n`;
        codeString += `${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};\n`;
        codeString += `${this._codeVariableName}.texture.uScale = ${this.texture.uScale};\n`;
        codeString += `${this._codeVariableName}.texture.vScale = ${this.texture.vScale};\n`;
        codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.convertToGammaSpace = this.convertToGammaSpace;
        serializationObject.convertToLinearSpace = this.convertToLinearSpace;
        serializationObject.fragmentOnly = this._fragmentOnly;
        serializationObject.disableLevelMultiplication = this.disableLevelMultiplication;
        if (!this.hasImageSource && this.texture && !this.texture.isRenderTarget && this.texture.getClassName() !== "VideoTexture") {
            serializationObject.texture = this.texture.serialize();
        }
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl, urlRewriter) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.convertToGammaSpace = serializationObject.convertToGammaSpace;
        this.convertToLinearSpace = !!serializationObject.convertToLinearSpace;
        this._fragmentOnly = !!serializationObject.fragmentOnly;
        this.disableLevelMultiplication = !!serializationObject.disableLevelMultiplication;
        if (serializationObject.texture && !NodeMaterial.IgnoreTexturesAtLoadTime && serializationObject.texture.url !== undefined) {
            if (serializationObject.texture.url.indexOf("data:") === 0) {
                rootUrl = "";
            }
            else if (urlRewriter) {
                serializationObject.texture.url = urlRewriter(serializationObject.texture.url);
                serializationObject.texture.name = serializationObject.texture.url;
            }
            this.texture = Textures_texture/* Texture */.g.Parse(serializationObject.texture, scene, rootUrl);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TextureBlock", TextureBlock);
//# sourceMappingURL=textureBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js













/**
 * Base block used to read a reflection texture from a sampler
 */
class ReflectionTextureBaseBlock extends NodeMaterialBlock {
    /**
     * Gets or sets the texture associated with the node
     */
    get texture() {
        return this._texture;
    }
    set texture(texture) {
        if (this._texture === texture) {
            return;
        }
        const scene = texture?.getScene() ?? engineStore/* EngineStore */.q.LastCreatedScene;
        if (!texture && scene) {
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this._texture);
            });
        }
        this._texture = texture;
        if (texture && scene) {
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(texture);
            });
        }
    }
    static _OnGenerateOnlyFragmentCodeChanged(block, _propertyName) {
        const that = block;
        return that._onGenerateOnlyFragmentCodeChanged();
    }
    _onGenerateOnlyFragmentCodeChanged() {
        this._setTarget();
        return true;
    }
    _setTarget() {
        this._setInitialTarget(this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment);
    }
    /**
     * Create a new ReflectionTextureBaseBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.VertexAndFragment);
        /** Indicates that no code should be generated in the vertex shader. Can be useful in some specific circumstances (like when doing ray marching for eg) */
        this.generateOnlyFragmentCode = false;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ReflectionTextureBaseBlock";
    }
    _getTexture() {
        return this.texture;
    }
    initialize(state) {
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 72230));
        }
        else {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 18223));
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    /**
     * Auto configure the node based on the existing material
     * @param material defines the material to configure
     * @param additionalFilteringInfo defines additional info to be used when filtering inputs (we might want to skip some non relevant blocks)
     */
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.position.isConnected) {
            let positionInput = material.getInputBlockByPredicate((b) => b.isAttribute && b.name === "position" && additionalFilteringInfo(b));
            if (!positionInput) {
                positionInput = new InputBlock("position");
                positionInput.setAsAttribute();
            }
            positionInput.output.connectTo(this.position);
        }
        if (!this.world.isConnected) {
            let worldInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.World && additionalFilteringInfo(b));
            if (!worldInput) {
                worldInput = new InputBlock("world");
                worldInput.setAsSystemValue(NodeMaterialSystemValues.World);
            }
            worldInput.output.connectTo(this.world);
        }
        if (this.view && !this.view.isConnected) {
            let viewInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.View && additionalFilteringInfo(b));
            if (!viewInput) {
                viewInput = new InputBlock("view");
                viewInput.setAsSystemValue(NodeMaterialSystemValues.View);
            }
            viewInput.output.connectTo(this.view);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        if (!defines._areTexturesDirty) {
            return;
        }
        const texture = this._getTexture();
        if (!texture || !texture.getTextureMatrix) {
            return;
        }
        defines.setValue(this._define3DName, texture.isCube, true);
        defines.setValue(this._defineLocalCubicName, texture.boundingBoxSize ? true : false, true);
        defines.setValue(this._defineExplicitName, texture.coordinatesMode === 0, true);
        defines.setValue(this._defineSkyboxName, texture.coordinatesMode === 5, true);
        defines.setValue(this._defineCubicName, texture.coordinatesMode === 3 || texture.coordinatesMode === 6, true);
        defines.setValue("INVERTCUBICMAP", texture.coordinatesMode === 6, true);
        defines.setValue(this._defineSphericalName, texture.coordinatesMode === 1, true);
        defines.setValue(this._definePlanarName, texture.coordinatesMode === 2, true);
        defines.setValue(this._defineProjectionName, texture.coordinatesMode === 4, true);
        defines.setValue(this._defineEquirectangularName, texture.coordinatesMode === 7, true);
        defines.setValue(this._defineEquirectangularFixedName, texture.coordinatesMode === 8, true);
        defines.setValue(this._defineMirroredEquirectangularFixedName, texture.coordinatesMode === 9, true);
    }
    isReady() {
        const texture = this._getTexture();
        if (texture && !texture.isReadyOrNotBlocking()) {
            return false;
        }
        return true;
    }
    bind(effect, nodeMaterial, mesh, _subMesh) {
        const texture = this._getTexture();
        if (!mesh || !texture) {
            return;
        }
        effect.setMatrix(this._reflectionMatrixName, texture.getReflectionTextureMatrix());
        if (texture.isCube) {
            effect.setTexture(this._cubeSamplerName, texture);
        }
        else {
            effect.setTexture(this._2DSamplerName, texture);
        }
        if (texture.boundingBoxSize) {
            const cubeTexture = texture;
            effect.setVector3(this._reflectionPositionName, cubeTexture.boundingBoxPosition);
            effect.setVector3(this._reflectionSizeName, cubeTexture.boundingBoxSize);
        }
    }
    /**
     * Gets the code to inject in the vertex shader
     * @param state current state of the node material building
     * @returns the shader code
     */
    handleVertexSide(state) {
        if (this.generateOnlyFragmentCode && state.target === NodeMaterialBlockTargets.Vertex) {
            return "";
        }
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        this._define3DName = state._getFreeDefineName("REFLECTIONMAP_3D");
        this._defineCubicName = state._getFreeDefineName("REFLECTIONMAP_CUBIC");
        this._defineSphericalName = state._getFreeDefineName("REFLECTIONMAP_SPHERICAL");
        this._definePlanarName = state._getFreeDefineName("REFLECTIONMAP_PLANAR");
        this._defineProjectionName = state._getFreeDefineName("REFLECTIONMAP_PROJECTION");
        this._defineExplicitName = state._getFreeDefineName("REFLECTIONMAP_EXPLICIT");
        this._defineEquirectangularName = state._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR");
        this._defineLocalCubicName = state._getFreeDefineName("USE_LOCAL_REFLECTIONMAP_CUBIC");
        this._defineMirroredEquirectangularFixedName = state._getFreeDefineName("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");
        this._defineEquirectangularFixedName = state._getFreeDefineName("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");
        this._defineSkyboxName = state._getFreeDefineName("REFLECTIONMAP_SKYBOX");
        this._defineOppositeZ = state._getFreeDefineName("REFLECTIONMAP_OPPOSITEZ");
        this._reflectionMatrixName = state._getFreeVariableName("reflectionMatrix");
        state._emitUniformFromString(this._reflectionMatrixName, NodeMaterialBlockConnectionPointTypes.Matrix);
        let code = "";
        this._worldPositionNameInFragmentOnlyMode = state._getFreeVariableName("worldPosition");
        const worldPosVaryingName = this.generateOnlyFragmentCode ? this._worldPositionNameInFragmentOnlyMode : "v_" + this.worldPosition.associatedVariableName;
        if (this.generateOnlyFragmentCode || state._emitVaryingFromString(worldPosVaryingName, NodeMaterialBlockConnectionPointTypes.Vector4)) {
            if (this.generateOnlyFragmentCode) {
                code += `${state._declareLocalVar(worldPosVaryingName, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this.worldPosition.associatedVariableName};\n`;
            }
            else {
                code += `${isWebGPU ? "vertexOutputs." : ""}${worldPosVaryingName} = ${this.worldPosition.associatedVariableName};\n`;
            }
        }
        this._positionUVWName = state._getFreeVariableName("positionUVW");
        this._directionWName = state._getFreeVariableName("directionW");
        if (this.generateOnlyFragmentCode || state._emitVaryingFromString(this._positionUVWName, NodeMaterialBlockConnectionPointTypes.Vector3, this._defineSkyboxName)) {
            code += `#ifdef ${this._defineSkyboxName}\n`;
            if (this.generateOnlyFragmentCode) {
                code += `${state._declareLocalVar(this._positionUVWName, NodeMaterialBlockConnectionPointTypes.Vector3)} = ${this.position.associatedVariableName}.xyz;\n`;
            }
            else {
                code += `${isWebGPU ? "vertexOutputs." : ""}${this._positionUVWName} = ${this.position.associatedVariableName}.xyz;\n`;
            }
            code += `#endif\n`;
        }
        if (this.generateOnlyFragmentCode ||
            state._emitVaryingFromString(this._directionWName, NodeMaterialBlockConnectionPointTypes.Vector3, `defined(${this._defineEquirectangularFixedName}) || defined(${this._defineMirroredEquirectangularFixedName})`)) {
            code += `#if defined(${this._defineEquirectangularFixedName}) || defined(${this._defineMirroredEquirectangularFixedName})\n`;
            if (this.generateOnlyFragmentCode) {
                code += `${state._declareLocalVar(this._directionWName, NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(vec3${state.fSuffix}(${this.world.associatedVariableName} * vec4${state.fSuffix}(${this.position.associatedVariableName}.xyz, 0.0)));\n`;
            }
            else {
                code += `${isWebGPU ? "vertexOutputs." : ""}${this._directionWName} = normalize(vec3${state.fSuffix}(${this.world.associatedVariableName} * vec4${state.fSuffix}(${this.position.associatedVariableName}.xyz, 0.0)));\n`;
            }
            code += `#endif\n`;
        }
        return code;
    }
    /**
     * Handles the inits for the fragment code path
     * @param state node material build state
     */
    handleFragmentSideInits(state) {
        state.sharedData.blockingBlocks.push(this);
        state.sharedData.textureBlocks.push(this);
        // Samplers
        this._cubeSamplerName = state._getFreeVariableName(this.name + "CubeSampler");
        state.samplers.push(this._cubeSamplerName);
        this._2DSamplerName = state._getFreeVariableName(this.name + "2DSampler");
        state.samplers.push(this._2DSamplerName);
        state._samplerDeclaration += `#ifdef ${this._define3DName}\n`;
        state._emitCubeSampler(this._cubeSamplerName, "", true);
        state._samplerDeclaration += `#else\n`;
        state._emit2DSampler(this._2DSamplerName, "", true);
        state._samplerDeclaration += `#endif\n`;
        // Fragment
        state.sharedData.blocksWithDefines.push(this);
        state.sharedData.bindableBlocks.push(this);
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("helperFunctions", comments);
        state._emitFunctionFromInclude("reflectionFunction", comments, {
            replaceStrings: [
                { search: /vec3 computeReflectionCoords/g, replace: "void DUMMYFUNC" },
                { search: /fn computeReflectionCoords\(worldPos: vec4f,worldNormal: vec3f\)->vec3f/g, replace: "fn DUMMYFUNC()" },
            ],
        });
        this._reflectionColorName = state._getFreeVariableName("reflectionColor");
        this._reflectionVectorName = state._getFreeVariableName("reflectionUVW");
        this._reflectionCoordsName = state._getFreeVariableName("reflectionCoords");
        this._reflectionPositionName = state._getFreeVariableName("vReflectionPosition");
        state._emitUniformFromString(this._reflectionPositionName, NodeMaterialBlockConnectionPointTypes.Vector3);
        this._reflectionSizeName = state._getFreeVariableName("vReflectionPosition");
        state._emitUniformFromString(this._reflectionSizeName, NodeMaterialBlockConnectionPointTypes.Vector3);
    }
    /**
     * Generates the reflection coords code for the fragment code path
     * @param state defines the build state
     * @param worldNormalVarName name of the world normal variable
     * @param worldPos name of the world position variable. If not provided, will use the world position connected to this block
     * @param onlyReflectionVector if true, generates code only for the reflection vector computation, not for the reflection coordinates
     * @param doNotEmitInvertZ if true, does not emit the invertZ code
     * @returns the shader code
     */
    handleFragmentSideCodeReflectionCoords(state, worldNormalVarName, worldPos, onlyReflectionVector = false, doNotEmitInvertZ = false) {
        if (!worldPos) {
            worldPos = this.generateOnlyFragmentCode ? this._worldPositionNameInFragmentOnlyMode : `v_${this.worldPosition.associatedVariableName}`;
        }
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        const reflectionMatrix = (isWebGPU ? "uniforms." : "") + this._reflectionMatrixName;
        const direction = `normalize(${this._directionWName})`;
        const positionUVW = `${this._positionUVWName}`;
        const vEyePosition = `${this.cameraPosition.associatedVariableName}`;
        const view = `${this.view.associatedVariableName}`;
        worldNormalVarName += ".xyz";
        let code = `
            #ifdef ${this._defineMirroredEquirectangularFixedName}
               ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = computeMirroredFixedEquirectangularCoords(${worldPos}, ${worldNormalVarName}, ${direction});
            #endif

            #ifdef ${this._defineEquirectangularFixedName}
                ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = computeFixedEquirectangularCoords(${worldPos}, ${worldNormalVarName}, ${direction});
            #endif

            #ifdef ${this._defineEquirectangularName}
                ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = computeEquirectangularCoords(${worldPos}, ${worldNormalVarName}, ${vEyePosition}.xyz, ${reflectionMatrix});
            #endif

            #ifdef ${this._defineSphericalName}
                ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = computeSphericalCoords(${worldPos}, ${worldNormalVarName}, ${view}, ${reflectionMatrix});
            #endif

            #ifdef ${this._definePlanarName}
                ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = computePlanarCoords(${worldPos}, ${worldNormalVarName}, ${vEyePosition}.xyz, ${reflectionMatrix});
            #endif

            #ifdef ${this._defineCubicName}
                #ifdef ${this._defineLocalCubicName}
                    ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = computeCubicLocalCoords(${worldPos}, ${worldNormalVarName}, ${vEyePosition}.xyz, ${reflectionMatrix}, ${this._reflectionSizeName}, ${this._reflectionPositionName});
                #else
                ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = computeCubicCoords(${worldPos}, ${worldNormalVarName}, ${vEyePosition}.xyz, ${reflectionMatrix});
                #endif
            #endif

            #ifdef ${this._defineProjectionName}
                ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = computeProjectionCoords(${worldPos}, ${view}, ${reflectionMatrix});
            #endif

            #ifdef ${this._defineSkyboxName}
                ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = computeSkyBoxCoords(${positionUVW}, ${reflectionMatrix});
            #endif

            #ifdef ${this._defineExplicitName}
                ${state._declareLocalVar(this._reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = vec3(0, 0, 0);
            #endif\n`;
        if (!doNotEmitInvertZ) {
            code += `#ifdef ${this._defineOppositeZ}
                ${this._reflectionVectorName}.z *= -1.0;
            #endif\n`;
        }
        if (!onlyReflectionVector) {
            code += `
                #ifdef ${this._define3DName}
                    ${state._declareLocalVar(this._reflectionCoordsName, NodeMaterialBlockConnectionPointTypes.Vector3)} = ${this._reflectionVectorName};
                #else
                    ${state._declareLocalVar(this._reflectionCoordsName, NodeMaterialBlockConnectionPointTypes.Vector2)} = ${this._reflectionVectorName}.xy;
                    #ifdef ${this._defineProjectionName}
                        ${this._reflectionCoordsName} /= ${this._reflectionVectorName}.z;
                    #endif
                    ${this._reflectionCoordsName}.y = 1.0 - ${this._reflectionCoordsName}.y;
                #endif\n`;
        }
        return code;
    }
    /**
     * Generates the reflection color code for the fragment code path
     * @param state defines the build state
     * @param lodVarName name of the lod variable
     * @param swizzleLookupTexture swizzle to use for the final color variable
     * @returns the shader code
     */
    handleFragmentSideCodeReflectionColor(state, lodVarName, swizzleLookupTexture = ".rgb") {
        let colorType = NodeMaterialBlockConnectionPointTypes.Vector4;
        if (swizzleLookupTexture.length === 3) {
            colorType = NodeMaterialBlockConnectionPointTypes.Vector3;
        }
        let code = `${state._declareLocalVar(this._reflectionColorName, colorType)};
            #ifdef ${this._define3DName}\n`;
        if (lodVarName) {
            code += `${this._reflectionColorName} = ${state._generateTextureSampleCubeLOD(this._reflectionVectorName, this._cubeSamplerName, lodVarName)}${swizzleLookupTexture};\n`;
        }
        else {
            code += `${this._reflectionColorName} = ${state._generateTextureSampleCube(this._reflectionVectorName, this._cubeSamplerName)}${swizzleLookupTexture};\n`;
        }
        code += `
            #else\n`;
        if (lodVarName) {
            code += `${this._reflectionColorName} =${state._generateTextureSampleLOD(this._reflectionCoordsName, this._2DSamplerName, lodVarName)}${swizzleLookupTexture};\n`;
        }
        else {
            code += `${this._reflectionColorName} = ${state._generateTextureSample(this._reflectionCoordsName, this._2DSamplerName)}${swizzleLookupTexture};\n`;
        }
        code += `#endif\n`;
        return code;
    }
    /**
     * Generates the code corresponding to the connected output points
     * @param state node material build state
     * @param varName name of the variable to output
     * @returns the shader code
     */
    writeOutputs(state, varName) {
        let code = "";
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            for (const output of this._outputs) {
                if (output.hasEndpoints) {
                    code += `${state._declareOutput(output)} = ${varName}.${output.name};\n`;
                }
            }
        }
        return code;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        if (!this.texture) {
            return codeString;
        }
        if (this.texture.isCube) {
            const forcedExtension = this.texture.forcedExtension;
            codeString += `${this._codeVariableName}.texture = new BABYLON.CubeTexture("${this.texture.name}", undefined, undefined, ${this.texture.noMipmap}, null, undefined, undefined, undefined, ${this.texture._prefiltered}, ${forcedExtension ? '"' + forcedExtension + '"' : "null"});\n`;
        }
        else {
            codeString += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null);\n`;
        }
        codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        if (this.texture && !this.texture.isRenderTarget) {
            serializationObject.texture = this.texture.serialize();
        }
        serializationObject.generateOnlyFragmentCode = this.generateOnlyFragmentCode;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        if (serializationObject.texture && !NodeMaterial.IgnoreTexturesAtLoadTime) {
            rootUrl = serializationObject.texture.url.indexOf("data:") === 0 ? "" : rootUrl;
            if (serializationObject.texture.isCube) {
                this.texture = Textures_cubeTexture/* CubeTexture */.b.Parse(serializationObject.texture, scene, rootUrl);
            }
            else {
                this.texture = Textures_texture/* Texture */.g.Parse(serializationObject.texture, scene, rootUrl);
            }
        }
        this.generateOnlyFragmentCode = serializationObject.generateOnlyFragmentCode;
        this._setTarget();
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Generate only fragment code", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", {
        notifiers: { rebuild: true, update: true, onValidation: ReflectionTextureBaseBlock._OnGenerateOnlyFragmentCodeChanged },
    })
], ReflectionTextureBaseBlock.prototype, "generateOnlyFragmentCode", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ReflectionTextureBaseBlock", ReflectionTextureBaseBlock);
//# sourceMappingURL=reflectionTextureBaseBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/reflectionTextureBlock.js







/**
 * Block used to read a reflection texture from a sampler
 */
class ReflectionTextureBlock extends ReflectionTextureBaseBlock {
    _onGenerateOnlyFragmentCodeChanged() {
        if (this.position.isConnected) {
            this.generateOnlyFragmentCode = !this.generateOnlyFragmentCode;
            logger/* Logger */.V.Error("The position input must not be connected to be able to switch!");
            return false;
        }
        if (this.worldPosition.isConnected) {
            this.generateOnlyFragmentCode = !this.generateOnlyFragmentCode;
            logger/* Logger */.V.Error("The worldPosition input must not be connected to be able to switch!");
            return false;
        }
        this._setTarget();
        return true;
    }
    _setTarget() {
        super._setTarget();
        this.getInputByName("position").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex;
        this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex;
    }
    /**
     * Create a new ReflectionTextureBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("position", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Fragment); // Flagging as fragment as the normal can be changed by fragment code
        this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, false, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ReflectionTextureBlock";
    }
    /**
     * Gets the world position input component
     */
    get position() {
        return this._inputs[0];
    }
    /**
     * Gets the world position input component
     */
    get worldPosition() {
        return this._inputs[1];
    }
    /**
     * Gets the world normal input component
     */
    get worldNormal() {
        return this._inputs[2];
    }
    /**
     * Gets the world input component
     */
    get world() {
        return this._inputs[3];
    }
    /**
     * Gets the camera (or eye) position component
     */
    get cameraPosition() {
        return this._inputs[4];
    }
    /**
     * Gets the view input component
     */
    get view() {
        return this._inputs[5];
    }
    /**
     * Gets the rgb output component
     */
    get rgb() {
        return this._outputs[0];
    }
    /**
     * Gets the rgba output component
     */
    get rgba() {
        return this._outputs[1];
    }
    /**
     * Gets the r output component
     */
    get r() {
        return this._outputs[2];
    }
    /**
     * Gets the g output component
     */
    get g() {
        return this._outputs[3];
    }
    /**
     * Gets the b output component
     */
    get b() {
        return this._outputs[4];
    }
    /**
     * Gets the a output component
     */
    get a() {
        return this._outputs[5];
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        super.autoConfigure(material);
        if (!this.cameraPosition.isConnected) {
            let cameraPositionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.CameraPosition && additionalFilteringInfo(b));
            if (!cameraPositionInput) {
                cameraPositionInput = new InputBlock("cameraPosition");
                cameraPositionInput.setAsSystemValue(NodeMaterialSystemValues.CameraPosition);
            }
            cameraPositionInput.output.connectTo(this.cameraPosition);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (!this.texture) {
            state.compilationString += this.writeOutputs(state, `vec4${state.fSuffix}(0.)`);
            return this;
        }
        if (state.target !== NodeMaterialBlockTargets.Fragment) {
            state.compilationString += this.handleVertexSide(state);
            return this;
        }
        if (this.generateOnlyFragmentCode) {
            state.compilationString += this.handleVertexSide(state);
        }
        this.handleFragmentSideInits(state);
        const normalWUnit = state._getFreeVariableName("normalWUnit");
        state.compilationString += `${state._declareLocalVar(normalWUnit, NodeMaterialBlockConnectionPointTypes.Vector4)} = normalize(${this.worldNormal.associatedVariableName});\n`;
        state.compilationString += this.handleFragmentSideCodeReflectionCoords(state, normalWUnit);
        state.compilationString += this.handleFragmentSideCodeReflectionColor(state, undefined, "");
        state.compilationString += this.writeOutputs(state, this._reflectionColorName);
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ReflectionTextureBlock", ReflectionTextureBlock);
//# sourceMappingURL=reflectionTextureBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/sceneDepthBlock.js







/**
 * Block used to retrieve the depth (zbuffer) of the scene
 * @since 5.0.0
 */
class SceneDepthBlock extends NodeMaterialBlock {
    /**
     * Create a new SceneDepthBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.VertexAndFragment);
        /**
         * Defines if the depth renderer should be setup in non linear mode
         */
        this.useNonLinearDepth = false;
        /**
         * Defines if the depth renderer should be setup in camera space Z mode (if set, useNonLinearDepth has no effect)
         */
        this.storeCameraSpaceZ = false;
        /**
         * Defines if the depth renderer should be setup in full 32 bits float mode
         */
        this.force32itsFloat = false;
        this._isUnique = true;
        this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.VertexAndFragment);
        this.registerOutput("depth", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
        this._inputs[0]._prioritizeVertex = false;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SceneDepthBlock";
    }
    /**
     * Gets the uv input component
     */
    get uv() {
        return this._inputs[0];
    }
    /**
     * Gets the depth output component
     */
    get depth() {
        return this._outputs[0];
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("textureSampler");
    }
    get target() {
        if (!this.uv.isConnected) {
            return NodeMaterialBlockTargets.VertexAndFragment;
        }
        if (this.uv.sourceBlock.isInput) {
            return NodeMaterialBlockTargets.VertexAndFragment;
        }
        return NodeMaterialBlockTargets.Fragment;
    }
    _getTexture(scene) {
        const depthRenderer = scene.enableDepthRenderer(undefined, this.useNonLinearDepth, this.force32itsFloat, undefined, this.storeCameraSpaceZ);
        return depthRenderer.getDepthMap();
    }
    bind(effect, nodeMaterial) {
        const texture = this._getTexture(nodeMaterial.getScene());
        effect.setTexture(this._samplerName, texture);
    }
    _injectVertexCode(state) {
        const uvInput = this.uv;
        if (uvInput.connectedPoint.ownerBlock.isInput) {
            const uvInputOwnerBlock = uvInput.connectedPoint.ownerBlock;
            if (!uvInputOwnerBlock.isAttribute) {
                state._emitUniformFromString(uvInput.associatedVariableName, uvInput.type === NodeMaterialBlockConnectionPointTypes.Vector3
                    ? NodeMaterialBlockConnectionPointTypes.Vector3
                    : uvInput.type === NodeMaterialBlockConnectionPointTypes.Vector4
                        ? NodeMaterialBlockConnectionPointTypes.Vector4
                        : NodeMaterialBlockConnectionPointTypes.Vector2);
            }
        }
        this._mainUVName = "vMain" + uvInput.associatedVariableName;
        state._emitVaryingFromString(this._mainUVName, NodeMaterialBlockConnectionPointTypes.Vector2);
        state.compilationString += `${this._mainUVName} = ${uvInput.associatedVariableName}.xy;\n`;
        if (!this._outputs.some((o) => o.isConnectedInVertexShader)) {
            return;
        }
        this._writeTextureRead(state, true);
        for (const output of this._outputs) {
            if (output.hasEndpoints) {
                this._writeOutput(state, output, "r", true);
            }
        }
    }
    _writeTextureRead(state, vertexMode = false) {
        const uvInput = this.uv;
        if (vertexMode) {
            if (state.target === NodeMaterialBlockTargets.Fragment) {
                return;
            }
            const textureReadFunc = state.shaderLanguage === 0 /* ShaderLanguage.GLSL */
                ? `texture2D(${this._samplerName},`
                : `textureSampleLevel(${this._samplerName}, ${this._samplerName + `Sampler`},`;
            const complement = state.shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? "" : ", 0";
            state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)}=  ${textureReadFunc} ${uvInput.associatedVariableName}.xy${complement});\n`;
            return;
        }
        const textureReadFunc = state.shaderLanguage === 0 /* ShaderLanguage.GLSL */
            ? `texture2D(${this._samplerName},`
            : `textureSample(${this._samplerName}, ${this._samplerName + `Sampler`},`;
        if (this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment) {
            state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${textureReadFunc} ${uvInput.associatedVariableName}.xy);\n`;
            return;
        }
        state.compilationString += `${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${textureReadFunc} ${this._mainUVName});\n`;
    }
    _writeOutput(state, output, swizzle, vertexMode = false) {
        if (vertexMode) {
            if (state.target === NodeMaterialBlockTargets.Fragment) {
                return;
            }
            state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle};\n`;
            return;
        }
        if (this.uv.ownerBlock.target === NodeMaterialBlockTargets.Fragment) {
            state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle};\n`;
            return;
        }
        state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle};\n`;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._samplerName = state._getFreeVariableName(this.name + "Sampler");
        this._tempTextureRead = state._getFreeVariableName("tempTextureRead");
        if (state.sharedData.bindableBlocks.indexOf(this) < 0) {
            state.sharedData.bindableBlocks.push(this);
        }
        if (state.target !== NodeMaterialBlockTargets.Fragment) {
            // Vertex
            state._emit2DSampler(this._samplerName);
            this._injectVertexCode(state);
            return;
        }
        // Fragment
        if (!this._outputs.some((o) => o.isConnectedInFragmentShader)) {
            return;
        }
        state._emit2DSampler(this._samplerName);
        this._writeTextureRead(state);
        for (const output of this._outputs) {
            if (output.hasEndpoints) {
                this._writeOutput(state, output, "r");
            }
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.useNonLinearDepth = this.useNonLinearDepth;
        serializationObject.storeCameraSpaceZ = this.storeCameraSpaceZ;
        serializationObject.force32itsFloat = this.force32itsFloat;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.useNonLinearDepth = serializationObject.useNonLinearDepth;
        this.storeCameraSpaceZ = !!serializationObject.storeCameraSpaceZ;
        this.force32itsFloat = serializationObject.force32itsFloat;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Use non linear depth", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", {
        embedded: true,
        notifiers: {
            activatePreviewCommand: true,
            callback: (scene, block) => {
                const sceneDepthBlock = block;
                let retVal = false;
                if (sceneDepthBlock.useNonLinearDepth) {
                    sceneDepthBlock.storeCameraSpaceZ = false;
                    retVal = true;
                }
                if (scene) {
                    scene.disableDepthRenderer();
                }
                return retVal;
            },
        },
    })
], SceneDepthBlock.prototype, "useNonLinearDepth", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Store Camera space Z", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", {
        notifiers: {
            activatePreviewCommand: true,
            callback: (scene, block) => {
                const sceneDepthBlock = block;
                let retVal = false;
                if (sceneDepthBlock.storeCameraSpaceZ) {
                    sceneDepthBlock.useNonLinearDepth = false;
                    retVal = true;
                }
                if (scene) {
                    scene.disableDepthRenderer();
                }
                return retVal;
            },
        },
    })
], SceneDepthBlock.prototype, "storeCameraSpaceZ", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Force 32 bits float", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", {
        notifiers: { activatePreviewCommand: true, callback: (scene) => scene?.disableDepthRenderer() },
    })
], SceneDepthBlock.prototype, "force32itsFloat", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SceneDepthBlock", SceneDepthBlock);
//# sourceMappingURL=sceneDepthBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/clipPlanesBlock.js





/**
 * Block used to implement clip planes
 */
class ClipPlanesBlock extends NodeMaterialBlock {
    /**
     * Create a new ClipPlanesBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.VertexAndFragment, true);
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ClipPlanesBlock";
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("vClipPlane");
        state._excludeVariableName("fClipDistance");
        state._excludeVariableName("vClipPlane2");
        state._excludeVariableName("fClipDistance2");
        state._excludeVariableName("vClipPlane3");
        state._excludeVariableName("fClipDistance3");
        state._excludeVariableName("vClipPlane4");
        state._excludeVariableName("fClipDistance4");
        state._excludeVariableName("vClipPlane5");
        state._excludeVariableName("fClipDistance5");
        state._excludeVariableName("vClipPlane6");
        state._excludeVariableName("fClipDistance6");
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 97715)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 39759)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85197)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 77029)),
            ]);
        }
        else {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 7412)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 6194)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 47314)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 71636)),
            ]);
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    /**
     * Gets the worldPosition input component
     */
    get worldPosition() {
        return this._inputs[0];
    }
    get target() {
        return NodeMaterialBlockTargets.VertexAndFragment;
    }
    set target(value) { }
    prepareDefines(mesh, nodeMaterial, defines) {
        const scene = mesh.getScene();
        const useClipPlane1 = (nodeMaterial.clipPlane ?? scene.clipPlane) ? true : false;
        const useClipPlane2 = (nodeMaterial.clipPlane2 ?? scene.clipPlane2) ? true : false;
        const useClipPlane3 = (nodeMaterial.clipPlane3 ?? scene.clipPlane3) ? true : false;
        const useClipPlane4 = (nodeMaterial.clipPlane4 ?? scene.clipPlane4) ? true : false;
        const useClipPlane5 = (nodeMaterial.clipPlane5 ?? scene.clipPlane5) ? true : false;
        const useClipPlane6 = (nodeMaterial.clipPlane6 ?? scene.clipPlane6) ? true : false;
        defines.setValue("CLIPPLANE", useClipPlane1, true);
        defines.setValue("CLIPPLANE2", useClipPlane2, true);
        defines.setValue("CLIPPLANE3", useClipPlane3, true);
        defines.setValue("CLIPPLANE4", useClipPlane4, true);
        defines.setValue("CLIPPLANE5", useClipPlane5, true);
        defines.setValue("CLIPPLANE6", useClipPlane6, true);
    }
    bind(effect, nodeMaterial, mesh) {
        if (!mesh) {
            return;
        }
        const scene = mesh.getScene();
        (0,clipPlaneMaterialHelper/* bindClipPlane */.gS)(effect, nodeMaterial, scene);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const comments = `//${this.name}`;
        if (state.target !== NodeMaterialBlockTargets.Fragment) {
            // Vertex
            const worldPos = this.worldPosition;
            state._emitFunctionFromInclude("clipPlaneVertexDeclaration", comments, {
                replaceStrings: [{ search: /uniform vec4 vClipPlane\d*;/g, replace: "" }],
            });
            state.compilationString += state._emitCodeFromInclude("clipPlaneVertex", comments, {
                replaceStrings: [{ search: /worldPos/g, replace: worldPos.associatedVariableName }],
            });
            state._emitUniformFromString("vClipPlane", NodeMaterialBlockConnectionPointTypes.Vector4);
            state._emitUniformFromString("vClipPlane2", NodeMaterialBlockConnectionPointTypes.Vector4);
            state._emitUniformFromString("vClipPlane3", NodeMaterialBlockConnectionPointTypes.Vector4);
            state._emitUniformFromString("vClipPlane4", NodeMaterialBlockConnectionPointTypes.Vector4);
            state._emitUniformFromString("vClipPlane5", NodeMaterialBlockConnectionPointTypes.Vector4);
            state._emitUniformFromString("vClipPlane6", NodeMaterialBlockConnectionPointTypes.Vector4);
            return;
        }
        // Fragment
        state.sharedData.bindableBlocks.push(this);
        state.sharedData.blocksWithDefines.push(this);
        state._emitFunctionFromInclude("clipPlaneFragmentDeclaration", comments);
        state.compilationString += state._emitCodeFromInclude("clipPlaneFragment", comments);
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ClipPlanesBlock", ClipPlanesBlock);
//# sourceMappingURL=clipPlanesBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js
var clipPlaneFragment = __webpack_require__(97715);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js
var clipPlaneFragmentDeclaration = __webpack_require__(39759);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js
var clipPlaneVertex = __webpack_require__(85197);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js
var clipPlaneVertexDeclaration = __webpack_require__(77029);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js
var ShadersInclude_clipPlaneFragment = __webpack_require__(7412);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js
var ShadersInclude_clipPlaneFragmentDeclaration = __webpack_require__(6194);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js
var ShadersInclude_clipPlaneVertex = __webpack_require__(47314);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js
var ShadersInclude_clipPlaneVertexDeclaration = __webpack_require__(71636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js
var fogFragmentDeclaration = __webpack_require__(66407);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js
var ShadersInclude_fogFragmentDeclaration = __webpack_require__(7806);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/lightFragment.js
var lightFragment = __webpack_require__(25271);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/lightUboDeclaration.js
var lightUboDeclaration = __webpack_require__(30379);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js
var lightVxUboDeclaration = __webpack_require__(3925);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js
var lightsFragmentFunctions = __webpack_require__(76493);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js
var shadowsFragmentFunctions = __webpack_require__(78589);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsVertex.js
var shadowsVertex = __webpack_require__(79456);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js
var lightFragmentDeclaration = __webpack_require__(92270);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js
var ShadersInclude_lightFragment = __webpack_require__(37256);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js
var ShadersInclude_lightUboDeclaration = __webpack_require__(22448);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js
var ShadersInclude_lightVxUboDeclaration = __webpack_require__(4662);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js
var lightVxFragmentDeclaration = __webpack_require__(47059);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js
var ShadersInclude_lightsFragmentFunctions = __webpack_require__(21962);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js
var ShadersInclude_shadowsFragmentFunctions = __webpack_require__(66812);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js
var ShadersInclude_shadowsVertex = __webpack_require__(35687);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/reflectionFunction.js
var reflectionFunction = __webpack_require__(72230);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js
var ShadersInclude_reflectionFunction = __webpack_require__(18223);
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/index.js









// async-loaded shaders
// clipPlaneBlock








// fogBlock


// lightBlock
















// reflectionTextureBlock


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Input/prePassTextureBlock.js







/**
 * Block used to read from prepass textures
 */
class PrePassTextureBlock extends NodeMaterialBlock {
    /**
     * The texture associated with the node is the prepass texture
     */
    get texture() {
        return null;
    }
    set texture(value) {
        return;
    }
    /**
     * Creates a new PrePassTextureBlock
     * @param name defines the block name
     * @param target defines the target of that block (VertexAndFragment by default)
     */
    constructor(name, target = NodeMaterialBlockTargets.VertexAndFragment) {
        super(name, target, false);
        this.registerOutput("position", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("position", this, 1 /* NodeMaterialConnectionPointDirection.Output */, ImageSourceBlock, "ImageSourceBlock"));
        this.registerOutput("localPosition", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("localPosition", this, 1 /* NodeMaterialConnectionPointDirection.Output */, ImageSourceBlock, "ImageSourceBlock"));
        this.registerOutput("depth", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("depth", this, 1 /* NodeMaterialConnectionPointDirection.Output */, ImageSourceBlock, "ImageSourceBlock"));
        this.registerOutput("screenDepth", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("screenDepth", this, 1 /* NodeMaterialConnectionPointDirection.Output */, ImageSourceBlock, "ImageSourceBlock"));
        this.registerOutput("normal", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("normal", this, 1 /* NodeMaterialConnectionPointDirection.Output */, ImageSourceBlock, "ImageSourceBlock"));
        this.registerOutput("worldNormal", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("worldNormal", this, 1 /* NodeMaterialConnectionPointDirection.Output */, ImageSourceBlock, "ImageSourceBlock"));
    }
    /**
     * Returns the sampler name associated with the node connection point
     * @param output defines the connection point to get the associated sampler name
     * @returns
     */
    getSamplerName(output) {
        if (output === this._outputs[0]) {
            return this._positionSamplerName;
        }
        if (output === this._outputs[1]) {
            return this._localPositionSamplerName;
        }
        if (output === this._outputs[2]) {
            return this._depthSamplerName;
        }
        if (output === this._outputs[3]) {
            return this._screenSpaceDepthSamplerName;
        }
        if (output === this._outputs[4]) {
            return this._normalSamplerName;
        }
        if (output === this._outputs[5]) {
            return this._worldNormalSamplerName;
        }
        return "";
    }
    /**
     * Gets the position texture
     */
    get position() {
        return this._outputs[0];
    }
    /**
     * Gets the local position texture
     */
    get localPosition() {
        return this._outputs[1];
    }
    /**
     * Gets the depth texture
     */
    get depth() {
        return this._outputs[2];
    }
    /**
     * Gets the screen depth texture
     */
    get screenDepth() {
        return this._outputs[3];
    }
    /**
     * Gets the normal texture
     */
    get normal() {
        return this._outputs[4];
    }
    /**
     * Gets the world normal texture
     */
    get worldNormal() {
        return this._outputs[5];
    }
    /**
     * Gets the sampler name associated with this image source
     */
    get positionSamplerName() {
        return this._positionSamplerName;
    }
    /**
     * Gets the sampler name associated with this image source
     */
    get localPositionSamplerName() {
        return this._localPositionSamplerName;
    }
    /**
     * Gets the sampler name associated with this image source
     */
    get normalSamplerName() {
        return this._normalSamplerName;
    }
    /**
     * Gets the sampler name associated with this image source
     */
    get worldNormalSamplerName() {
        return this._worldNormalSamplerName;
    }
    /**
     * Gets the sampler name associated with this image source
     */
    get depthSamplerName() {
        return this._depthSamplerName;
    }
    /**
     * Gets the sampler name associated with this image source
     */
    get linearDepthSamplerName() {
        return this._screenSpaceDepthSamplerName;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "PrePassTextureBlock";
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (state.target === NodeMaterialBlockTargets.Vertex) {
            return;
        }
        this._positionSamplerName = "prepassPositionSampler";
        this._depthSamplerName = "prepassDepthSampler";
        this._normalSamplerName = "prepassNormalSampler";
        this._worldNormalSamplerName = "prepassWorldNormalSampler";
        this._localPositionSamplerName = "prepassLocalPositionSampler";
        this._screenSpaceDepthSamplerName = "prepassScreenSpaceDepthSampler";
        // Unique sampler names for every prepasstexture block
        state.sharedData.variableNames.prepassPositionSampler = 0;
        state.sharedData.variableNames.prepassDepthSampler = 0;
        state.sharedData.variableNames.prepassNormalSampler = 0;
        state.sharedData.variableNames.prepassWorldNormalSampler = 0;
        state.sharedData.variableNames.prepassLocalPositionSampler = 0;
        state.sharedData.variableNames.prepassScreenSpaceDepthSampler = 0;
        // Declarations
        state.sharedData.textureBlocks.push(this);
        state.sharedData.bindableBlocks.push(this);
        if (this.position.isConnected) {
            state._emit2DSampler(this._positionSamplerName);
        }
        if (this.depth.isConnected) {
            state._emit2DSampler(this._depthSamplerName);
        }
        if (this.normal.isConnected) {
            state._emit2DSampler(this._normalSamplerName);
        }
        if (this.worldNormal.isConnected) {
            state._emit2DSampler(this._worldNormalSamplerName);
        }
        if (this.localPosition.isConnected) {
            state._emit2DSampler(this._localPositionSamplerName);
        }
        if (this.screenDepth.isConnected) {
            state._emit2DSampler(this._screenSpaceDepthSamplerName);
        }
        return this;
    }
    bind(effect, nodeMaterial) {
        const scene = nodeMaterial.getScene();
        const prePassRenderer = scene.enablePrePassRenderer();
        if (!prePassRenderer) {
            return;
        }
        const sceneRT = prePassRenderer.defaultRT;
        if (!sceneRT.textures) {
            return;
        }
        if (this.position.isConnected) {
            effect.setTexture(this._positionSamplerName, sceneRT.textures[prePassRenderer.getIndex(1)]);
        }
        if (this.localPosition.isConnected) {
            effect.setTexture(this._localPositionSamplerName, sceneRT.textures[prePassRenderer.getIndex(9)]);
        }
        if (this.depth.isConnected) {
            effect.setTexture(this._depthSamplerName, sceneRT.textures[prePassRenderer.getIndex(5)]);
        }
        if (this.screenDepth.isConnected) {
            effect.setTexture(this._screenSpaceDepthSamplerName, sceneRT.textures[prePassRenderer.getIndex(10)]);
        }
        if (this.normal.isConnected) {
            effect.setTexture(this._normalSamplerName, sceneRT.textures[prePassRenderer.getIndex(6)]);
        }
        if (this.worldNormal.isConnected) {
            effect.setTexture(this._worldNormalSamplerName, sceneRT.textures[prePassRenderer.getIndex(8)]);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PrePassTextureBlock", PrePassTextureBlock);
//# sourceMappingURL=prePassTextureBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Input/index.js



//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Teleport/teleportInBlock.js




/**
 * Defines a block used to teleport a value to an endpoint
 */
class NodeMaterialTeleportInBlock extends NodeMaterialBlock {
    /** Gets the list of attached endpoints */
    get endpoints() {
        return this._endpoints;
    }
    /**
     * Gets or sets the target of the block
     */
    get target() {
        const input = this._inputs[0];
        if (input.isConnected) {
            const block = input.connectedPoint.ownerBlock;
            if (block.target !== NodeMaterialBlockTargets.VertexAndFragment) {
                return block.target;
            }
            if (input.connectedPoint.target !== NodeMaterialBlockTargets.VertexAndFragment) {
                return input.connectedPoint.target;
            }
        }
        return this._target;
    }
    set target(value) {
        if ((this._target & value) !== 0) {
            return;
        }
        this._target = value;
    }
    /**
     * Create a new NodeMaterialTeleportInBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this._endpoints = [];
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeMaterialTeleportInBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * @returns a boolean indicating that this connection will be used in the fragment shader
     */
    isConnectedInFragmentShader() {
        return this.endpoints.some((e) => e.output.isConnectedInFragmentShader);
    }
    _dumpCode(uniqueNames, alreadyDumped) {
        let codeString = super._dumpCode(uniqueNames, alreadyDumped);
        for (const endpoint of this.endpoints) {
            if (alreadyDumped.indexOf(endpoint) === -1) {
                codeString += endpoint._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        return codeString;
    }
    /**
     * Checks if the current block is an ancestor of a given block
     * @param block defines the potential descendant block to check
     * @returns true if block is a descendant
     */
    isAnAncestorOf(block) {
        for (const endpoint of this.endpoints) {
            if (endpoint === block) {
                return true;
            }
            if (endpoint.isAnAncestorOf(block)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Add an enpoint to this block
     * @param endpoint define the endpoint to attach to
     */
    attachToEndpoint(endpoint) {
        endpoint.detach();
        this._endpoints.push(endpoint);
        endpoint._entryPoint = this;
        endpoint._outputs[0]._typeConnectionSource = this._inputs[0];
        endpoint._tempEntryPointUniqueId = null;
        endpoint.name = "> " + this.name;
        this._outputs = this._endpoints.map((e) => e.output);
    }
    /**
     * Remove enpoint from this block
     * @param endpoint define the endpoint to remove
     */
    detachFromEndpoint(endpoint) {
        const index = this._endpoints.indexOf(endpoint);
        if (index !== -1) {
            this._endpoints.splice(index, 1);
            endpoint._outputs[0]._typeConnectionSource = null;
            endpoint._entryPoint = null;
            this._outputs = this._endpoints.map((e) => e.output);
        }
    }
    /**
     * Release resources
     */
    dispose() {
        super.dispose();
        for (const endpoint of this._endpoints) {
            this.detachFromEndpoint(endpoint);
        }
        this._endpoints = [];
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeMaterialTeleportInBlock", NodeMaterialTeleportInBlock);
//# sourceMappingURL=teleportInBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Teleport/teleportOutBlock.js




/**
 * Defines a block used to receive a value from a teleport entry point
 */
class NodeMaterialTeleportOutBlock extends NodeMaterialBlock {
    /**
     * Create a new TeleportOutBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /** @internal */
        this._entryPoint = null;
        /** @internal */
        this._tempEntryPointUniqueId = null;
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
    }
    /**
     * Gets the entry point
     */
    get entryPoint() {
        return this._entryPoint;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NodeMaterialTeleportOutBlock";
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets or sets the target of the block
     */
    get target() {
        return this._entryPoint ? this._entryPoint.target : this._target;
    }
    set target(value) {
        if ((this._target & value) !== 0) {
            return;
        }
        this._target = value;
    }
    /** Detach from entry point */
    detach() {
        if (!this._entryPoint) {
            return;
        }
        this._entryPoint.detachFromEndpoint(this);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (this.entryPoint) {
            state.compilationString += state._declareOutput(this.output) + ` = ${this.entryPoint.input.associatedVariableName};\n`;
        }
    }
    /**
     * Clone the current block to a new identical block
     * @param scene defines the hosting scene
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @returns a copy of the current block
     */
    clone(scene, rootUrl = "") {
        const clone = super.clone(scene, rootUrl);
        if (this.entryPoint) {
            this.entryPoint.attachToEndpoint(clone);
        }
        return clone;
    }
    _customBuildStep(state, activeBlocks) {
        if (this.entryPoint) {
            this.entryPoint.build(state, activeBlocks);
        }
    }
    _dumpCode(uniqueNames, alreadyDumped) {
        let codeString = "";
        if (this.entryPoint) {
            if (alreadyDumped.indexOf(this.entryPoint) === -1) {
                codeString += this.entryPoint._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        return codeString + super._dumpCode(uniqueNames, alreadyDumped);
    }
    _dumpCodeForOutputConnections(alreadyDumped) {
        let codeString = super._dumpCodeForOutputConnections(alreadyDumped);
        if (this.entryPoint) {
            codeString += this.entryPoint._dumpCodeForOutputConnections(alreadyDumped);
        }
        return codeString;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        if (this.entryPoint) {
            codeString += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\n`;
        }
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.entryPoint = this.entryPoint?.uniqueId ?? "";
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this._tempEntryPointUniqueId = serializationObject.entryPoint;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NodeMaterialTeleportOutBlock", NodeMaterialTeleportOutBlock);
//# sourceMappingURL=teleportOutBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Teleport/index.js


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/addBlock.js


/**
 * Block used to add 2 vectors
 */
class AddBlock extends BaseMathBlock {
    /**
     * Creates a new AddBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "AddBlock";
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = ${this.left.associatedVariableName} + ${this.right.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.AddBlock", AddBlock);
//# sourceMappingURL=addBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/scaleBlock.js




/**
 * Block used to scale a vector by a float
 */
class ScaleBlock extends NodeMaterialBlock {
    /**
     * Creates a new ScaleBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("factor", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ScaleBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the factor input component
     */
    get factor() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = ${this.input.associatedVariableName} * ${this.factor.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ScaleBlock", ScaleBlock);
//# sourceMappingURL=scaleBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/clampBlock.js






/**
 * Block used to clamp a float
 */
class ClampBlock extends NodeMaterialBlock {
    /**
     * Creates a new ClampBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /** Gets or sets the minimum range */
        this.minimum = 0.0;
        /** Gets or sets the maximum range */
        this.maximum = 1.0;
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ClampBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const cast = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? state._getShaderType(this.value.type) : "";
        state.compilationString +=
            state._declareOutput(output) +
                ` = clamp(${this.value.associatedVariableName}, ${cast}(${this._writeFloat(this.minimum)}), ${cast}(${this._writeFloat(this.maximum)}));\n`;
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.minimum = ${this.minimum};\n`;
        codeString += `${this._codeVariableName}.maximum = ${this.maximum};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.minimum = this.minimum;
        serializationObject.maximum = this.maximum;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.minimum = serializationObject.minimum;
        this.maximum = serializationObject.maximum;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Minimum", 1 /* PropertyTypeForEdition.Float */, undefined, { embedded: true })
], ClampBlock.prototype, "minimum", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Maximum", 1 /* PropertyTypeForEdition.Float */, undefined, { embedded: true })
], ClampBlock.prototype, "maximum", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ClampBlock", ClampBlock);
//# sourceMappingURL=clampBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/crossBlock.js




/**
 * Block used to apply a cross product between 2 vectors
 */
class CrossBlock extends NodeMaterialBlock {
    /**
     * Creates a new CrossBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3);
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "CrossBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = cross(${this.left.associatedVariableName}.xyz, ${this.right.associatedVariableName}.xyz);\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CrossBlock", CrossBlock);
//# sourceMappingURL=crossBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/customBlock.js






/**
 * Custom block created from user-defined json
 */
class CustomBlock extends NodeMaterialBlock {
    /**
     * Gets or sets the options for this custom block
     */
    get options() {
        return this._options;
    }
    set options(options) {
        this._deserializeOptions(options);
    }
    /**
     * Creates a new CustomBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "CustomBlock";
    }
    _buildBlock(state) {
        super._buildBlock(state);
        let code = this._code;
        let functionName = this._options.functionName;
        // Replace the TYPE_XXX placeholders (if any)
        this._inputs.forEach((input) => {
            const rexp = new RegExp("\\{TYPE_" + input.name + "\\}", "gm");
            const type = state._getGLType(input.type);
            code = code.replace(rexp, type);
            functionName = functionName.replace(rexp, type);
        });
        this._outputs.forEach((output) => {
            const rexp = new RegExp("\\{TYPE_" + output.name + "\\}", "gm");
            const type = state._getGLType(output.type);
            code = code.replace(rexp, type);
            functionName = functionName.replace(rexp, type);
        });
        state._emitFunction(functionName, code, "");
        // Declare the output variables
        this._outputs.forEach((output) => {
            state.compilationString += state._declareOutput(output) + ";\n";
        });
        // Generate the function call
        state.compilationString += functionName + "(";
        let hasInput = false;
        this._inputs.forEach((input, index) => {
            if (index > 0) {
                state.compilationString += ", ";
            }
            if (this._inputSamplers && this._inputSamplers.indexOf(input.name) !== -1) {
                state.compilationString += input.connectedPoint?.ownerBlock?.samplerName ?? input.associatedVariableName;
            }
            else {
                state.compilationString += input.associatedVariableName;
            }
            hasInput = true;
        });
        this._outputs.forEach((output, index) => {
            if (index > 0 || hasInput) {
                state.compilationString += ", ";
            }
            state.compilationString += output.associatedVariableName;
        });
        state.compilationString += ");\n";
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.options = ${JSON.stringify(this._options)};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.options = this._options;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        this._deserializeOptions(serializationObject.options);
        super._deserialize(serializationObject, scene, rootUrl);
    }
    _deserializeOptions(options) {
        this._options = options;
        this._code = options.code.join("\n") + "\n";
        this.name = this.name || options.name;
        this.target = NodeMaterialBlockTargets[options.target];
        options.inParameters?.forEach((input, index) => {
            const type = NodeMaterialBlockConnectionPointTypes[input.type];
            if (input.type === "sampler2D" || input.type === "samplerCube") {
                this._inputSamplers = this._inputSamplers || [];
                this._inputSamplers.push(input.name);
                this.registerInput(input.name, NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject(input.name, this, 0 /* NodeMaterialConnectionPointDirection.Input */, ImageSourceBlock, "ImageSourceBlock"));
            }
            else {
                this.registerInput(input.name, type);
            }
            Object.defineProperty(this, input.name, {
                get: function () {
                    return this._inputs[index];
                },
                enumerable: true,
                configurable: true,
            });
        });
        options.outParameters?.forEach((output, index) => {
            this.registerOutput(output.name, NodeMaterialBlockConnectionPointTypes[output.type]);
            Object.defineProperty(this, output.name, {
                get: function () {
                    return this._outputs[index];
                },
                enumerable: true,
                configurable: true,
            });
            if (output.type === "BasedOnInput") {
                this._outputs[index]._typeConnectionSource = this._findInputByName(output.typeFromInput)[0];
            }
        });
        options.inLinkedConnectionTypes?.forEach((connection) => {
            this._linkConnectionTypes(this._findInputByName(connection.input1)[1], this._findInputByName(connection.input2)[1]);
        });
    }
    _findInputByName(name) {
        if (!name) {
            return null;
        }
        for (let i = 0; i < this._inputs.length; i++) {
            if (this._inputs[i].name === name) {
                return [this._inputs[i], i];
            }
        }
        return null;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CustomBlock", CustomBlock);
//# sourceMappingURL=customBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/dotBlock.js




/**
 * Block used to apply a dot product between 2 vectors
 */
class DotBlock extends NodeMaterialBlock {
    /**
     * Creates a new DotBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "DotBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = dot(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DotBlock", DotBlock);
//# sourceMappingURL=dotBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/normalizeBlock.js




/**
 * Block used to normalize a vector
 */
class NormalizeBlock extends NodeMaterialBlock {
    /**
     * Creates a new NormalizeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NormalizeBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const input = this._inputs[0];
        state.compilationString += state._declareOutput(output) + ` = normalize(${input.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NormalizeBlock", NormalizeBlock);
//# sourceMappingURL=normalizeBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/colorMergerBlock.js




/**
 * Block used to create a Color3/4 out of individual inputs (one for each component)
 */
class ColorMergerBlock extends NodeMaterialBlock {
    /**
     * Create a new ColorMergerBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Gets or sets the swizzle for r (meaning which component to affect to the output.r)
         */
        this.rSwizzle = "r";
        /**
         * Gets or sets the swizzle for g (meaning which component to affect to the output.g)
         */
        this.gSwizzle = "g";
        /**
         * Gets or sets the swizzle for b (meaning which component to affect to the output.b)
         */
        this.bSwizzle = "b";
        /**
         * Gets or sets the swizzle for a (meaning which component to affect to the output.a)
         */
        this.aSwizzle = "a";
        this.registerInput("rgb ", NodeMaterialBlockConnectionPointTypes.Color3, true);
        this.registerInput("r", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("g", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("b", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("a", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4);
        this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ColorMergerBlock";
    }
    /**
     * Gets the rgb component (input)
     */
    get rgbIn() {
        return this._inputs[0];
    }
    /**
     * Gets the r component (input)
     */
    get r() {
        return this._inputs[1];
    }
    /**
     * Gets the g component (input)
     */
    get g() {
        return this._inputs[2];
    }
    /**
     * Gets the b component (input)
     */
    get b() {
        return this._inputs[3];
    }
    /**
     * Gets the a component (input)
     */
    get a() {
        return this._inputs[4];
    }
    /**
     * Gets the rgba component (output)
     */
    get rgba() {
        return this._outputs[0];
    }
    /**
     * Gets the rgb component (output)
     */
    get rgbOut() {
        return this._outputs[1];
    }
    /**
     * Gets the rgb component (output)
     * @deprecated Please use rgbOut instead.
     */
    get rgb() {
        return this.rgbOut;
    }
    _inputRename(name) {
        if (name === "rgb ") {
            return "rgbIn";
        }
        return name;
    }
    _buildSwizzle(len) {
        const swizzle = this.rSwizzle + this.gSwizzle + this.bSwizzle + this.aSwizzle;
        return "." + swizzle.substring(0, len);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const rInput = this.r;
        const gInput = this.g;
        const bInput = this.b;
        const aInput = this.a;
        const rgbInput = this.rgbIn;
        const color4Output = this._outputs[0];
        const color3Output = this._outputs[1];
        const vec4 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector4);
        const vec3 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector3);
        if (rgbInput.isConnected) {
            if (color4Output.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(color4Output) +
                        ` = ${vec4}(${rgbInput.associatedVariableName}, ${aInput.isConnected ? this._writeVariable(aInput) : "0.0"})${this._buildSwizzle(4)};\n`;
            }
            if (color3Output.hasEndpoints) {
                state.compilationString += state._declareOutput(color3Output) + ` = ${rgbInput.associatedVariableName}${this._buildSwizzle(3)};\n`;
            }
        }
        else {
            if (color4Output.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(color4Output) +
                        ` = ${vec4}(${rInput.isConnected ? this._writeVariable(rInput) : "0.0"}, ${gInput.isConnected ? this._writeVariable(gInput) : "0.0"}, ${bInput.isConnected ? this._writeVariable(bInput) : "0.0"}, ${aInput.isConnected ? this._writeVariable(aInput) : "0.0"})${this._buildSwizzle(4)};\n`;
            }
            if (color3Output.hasEndpoints) {
                state.compilationString +=
                    state._declareOutput(color3Output) +
                        ` = ${vec3}(${rInput.isConnected ? this._writeVariable(rInput) : "0.0"}, ${gInput.isConnected ? this._writeVariable(gInput) : "0.0"}, ${bInput.isConnected ? this._writeVariable(bInput) : "0.0"})${this._buildSwizzle(3)};\n`;
            }
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.rSwizzle = this.rSwizzle;
        serializationObject.gSwizzle = this.gSwizzle;
        serializationObject.bSwizzle = this.bSwizzle;
        serializationObject.aSwizzle = this.aSwizzle;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.rSwizzle = serializationObject.rSwizzle ?? "r";
        this.gSwizzle = serializationObject.gSwizzle ?? "g";
        this.bSwizzle = serializationObject.bSwizzle ?? "b";
        this.aSwizzle = serializationObject.aSwizzle ?? "a";
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.rSwizzle = "${this.rSwizzle}";\n`;
        codeString += `${this._codeVariableName}.gSwizzle = "${this.gSwizzle}";\n`;
        codeString += `${this._codeVariableName}.bSwizzle = "${this.bSwizzle}";\n`;
        codeString += `${this._codeVariableName}.aSwizzle = "${this.aSwizzle}";\n`;
        return codeString;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ColorMergerBlock", ColorMergerBlock);
//# sourceMappingURL=colorMergerBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/vectorSplitterBlock.js




/**
 * Block used to expand a Vector3/4 into 4 outputs (one for each component)
 */
class VectorSplitterBlock extends NodeMaterialBlock {
    /**
     * Create a new VectorSplitterBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("xyzw", NodeMaterialBlockConnectionPointTypes.Vector4, true);
        this.registerInput("xyz ", NodeMaterialBlockConnectionPointTypes.Vector3, true);
        this.registerInput("xy ", NodeMaterialBlockConnectionPointTypes.Vector2, true);
        this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerOutput("zw", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("z", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("w", NodeMaterialBlockConnectionPointTypes.Float);
        this.inputsAreExclusive = true;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "VectorSplitterBlock";
    }
    /**
     * Gets the xyzw component (input)
     */
    get xyzw() {
        return this._inputs[0];
    }
    /**
     * Gets the xyz component (input)
     */
    get xyzIn() {
        return this._inputs[1];
    }
    /**
     * Gets the xy component (input)
     */
    get xyIn() {
        return this._inputs[2];
    }
    /**
     * Gets the xyz component (output)
     */
    get xyzOut() {
        return this._outputs[0];
    }
    /**
     * Gets the xy component (output)
     */
    get xyOut() {
        return this._outputs[1];
    }
    /**
     * Gets the zw component (output)
     */
    get zw() {
        return this._outputs[2];
    }
    /**
     * Gets the x component (output)
     */
    get x() {
        return this._outputs[3];
    }
    /**
     * Gets the y component (output)
     */
    get y() {
        return this._outputs[4];
    }
    /**
     * Gets the z component (output)
     */
    get z() {
        return this._outputs[5];
    }
    /**
     * Gets the w component (output)
     */
    get w() {
        return this._outputs[6];
    }
    _inputRename(name) {
        switch (name) {
            case "xy ":
                return "xyIn";
            case "xyz ":
                return "xyzIn";
            default:
                return name;
        }
    }
    _outputRename(name) {
        switch (name) {
            case "xy":
                return "xyOut";
            case "xyz":
                return "xyzOut";
            default:
                return name;
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const input = this.xyzw.isConnected ? this.xyzw : this.xyzIn.isConnected ? this.xyzIn : this.xyIn;
        const xyzOutput = this._outputs[0];
        const xyOutput = this._outputs[1];
        const zwOutput = this._outputs[2];
        const xOutput = this._outputs[3];
        const yOutput = this._outputs[4];
        const zOutput = this._outputs[5];
        const wOutput = this._outputs[6];
        const vec3 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector3);
        if (xyzOutput.hasEndpoints) {
            if (input === this.xyIn) {
                state.compilationString += state._declareOutput(xyzOutput) + ` = ${vec3}(${input.associatedVariableName}, 0.0);\n`;
            }
            else {
                state.compilationString += state._declareOutput(xyzOutput) + ` = ${input.associatedVariableName}.xyz;\n`;
            }
        }
        if (zwOutput.hasEndpoints && this.xyzw.isConnected) {
            state.compilationString += state._declareOutput(zwOutput) + ` = ${this.xyzw.associatedVariableName}.zw;\n`;
        }
        if (xyOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(xyOutput) + ` = ${input.associatedVariableName}.xy;\n`;
        }
        if (xOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(xOutput) + ` = ${input.associatedVariableName}.x;\n`;
        }
        if (yOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(yOutput) + ` = ${input.associatedVariableName}.y;\n`;
        }
        if (zOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(zOutput) + ` = ${input.associatedVariableName}.z;\n`;
        }
        if (wOutput.hasEndpoints) {
            state.compilationString += state._declareOutput(wOutput) + ` = ${input.associatedVariableName}.w;\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.VectorSplitterBlock", VectorSplitterBlock);
//# sourceMappingURL=vectorSplitterBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/lerpBlock.js




/**
 * Block used to lerp between 2 values
 */
class LerpBlock extends NodeMaterialBlock {
    /**
     * Creates a new LerpBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("gradient", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._linkConnectionTypes(1, 2, true);
        this._inputs[2].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "LerpBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the gradient operand input component
     */
    get gradient() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString +=
            state._declareOutput(output) + ` = mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.LerpBlock", LerpBlock);
//# sourceMappingURL=lerpBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/divideBlock.js


/**
 * Block used to divide 2 vectors
 */
class DivideBlock extends BaseMathBlock {
    /**
     * Creates a new DivideBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "DivideBlock";
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = ${this.left.associatedVariableName} / ${this.right.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DivideBlock", DivideBlock);
//# sourceMappingURL=divideBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/subtractBlock.js


/**
 * Block used to subtract 2 vectors
 */
class SubtractBlock extends BaseMathBlock {
    /**
     * Creates a new SubtractBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SubtractBlock";
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = ${this.left.associatedVariableName} - ${this.right.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SubtractBlock", SubtractBlock);
//# sourceMappingURL=subtractBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/stepBlock.js




/**
 * Block used to step a value
 */
class StepBlock extends NodeMaterialBlock {
    /**
     * Creates a new StepBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("edge", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "StepBlock";
    }
    /**
     * Gets the value operand input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the edge operand input component
     */
    get edge() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = step(${this.edge.associatedVariableName}, ${this.value.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.StepBlock", StepBlock);
//# sourceMappingURL=stepBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/oneMinusBlock.js




/**
 * Block used to get the opposite (1 - x) of a value
 */
class OneMinusBlock extends NodeMaterialBlock {
    /**
     * Creates a new OneMinusBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._outputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "OneMinusBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = 1. - ${this.input.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.OneMinusBlock", OneMinusBlock);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.OppositeBlock", OneMinusBlock); // Backward compatibility
//# sourceMappingURL=oneMinusBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/viewDirectionBlock.js






/**
 * Block used to get the view direction
 */
class ViewDirectionBlock extends NodeMaterialBlock {
    /**
     * Creates a new ViewDirectionBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ViewDirectionBlock";
    }
    /**
     * Gets the world position component
     */
    get worldPosition() {
        return this._inputs[0];
    }
    /**
     * Gets the camera position component
     */
    get cameraPosition() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.cameraPosition.isConnected) {
            let cameraPositionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.CameraPosition && additionalFilteringInfo(b));
            if (!cameraPositionInput) {
                cameraPositionInput = new InputBlock("cameraPosition");
                cameraPositionInput.setAsSystemValue(NodeMaterialSystemValues.CameraPosition);
            }
            cameraPositionInput.output.connectTo(this.cameraPosition);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString +=
            state._declareOutput(output) + ` = normalize(${this.cameraPosition.associatedVariableName} - ${this.worldPosition.associatedVariableName}.xyz);\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ViewDirectionBlock", ViewDirectionBlock);
//# sourceMappingURL=viewDirectionBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fresnelFunction.js
var ShadersInclude_fresnelFunction = __webpack_require__(51339);
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/fresnelBlock.js







/**
 * Block used to compute fresnel value
 */
class FresnelBlock extends NodeMaterialBlock {
    /**
     * Create a new FresnelBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("viewDirection", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerInput("bias", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("power", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("fresnel", NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "FresnelBlock";
    }
    /**
     * Gets the world normal input component
     */
    get worldNormal() {
        return this._inputs[0];
    }
    /**
     * Gets the view direction input component
     */
    get viewDirection() {
        return this._inputs[1];
    }
    /**
     * Gets the bias input component
     */
    get bias() {
        return this._inputs[2];
    }
    /**
     * Gets the camera (or eye) position component
     */
    get power() {
        return this._inputs[3];
    }
    /**
     * Gets the fresnel output component
     */
    get fresnel() {
        return this._outputs[0];
    }
    autoConfigure(material) {
        if (!this.viewDirection.isConnected) {
            const viewDirectionInput = new ViewDirectionBlock("View direction");
            viewDirectionInput.output.connectTo(this.viewDirection);
            viewDirectionInput.autoConfigure(material);
        }
        if (!this.bias.isConnected) {
            const biasInput = new InputBlock("bias");
            biasInput.value = 0;
            biasInput.output.connectTo(this.bias);
        }
        if (!this.power.isConnected) {
            const powerInput = new InputBlock("power");
            powerInput.value = 1;
            powerInput.output.connectTo(this.power);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("fresnelFunction", comments, { removeIfDef: true });
        state.compilationString +=
            state._declareOutput(this.fresnel) +
                ` = computeFresnelTerm(${this.viewDirection.associatedVariableName}.xyz, ${this.worldNormal.associatedVariableName}.xyz, ${this.bias.associatedVariableName}, ${this.power.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FresnelBlock", FresnelBlock);
//# sourceMappingURL=fresnelBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/maxBlock.js




/**
 * Block used to get the max of 2 values
 */
class MaxBlock extends NodeMaterialBlock {
    /**
     * Creates a new MaxBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MaxBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = max(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MaxBlock", MaxBlock);
//# sourceMappingURL=maxBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/minBlock.js




/**
 * Block used to get the min of 2 values
 */
class MinBlock extends NodeMaterialBlock {
    /**
     * Creates a new MinBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MinBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = min(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MinBlock", MinBlock);
//# sourceMappingURL=minBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/distanceBlock.js




/**
 * Block used to get the distance between 2 values
 */
class DistanceBlock extends NodeMaterialBlock {
    /**
     * Creates a new DistanceBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "DistanceBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = length(${this.left.associatedVariableName} - ${this.right.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DistanceBlock", DistanceBlock);
//# sourceMappingURL=distanceBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/lengthBlock.js




/**
 * Block used to get the length of a vector
 */
class LengthBlock extends NodeMaterialBlock {
    /**
     * Creates a new LengthBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "LengthBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = length(${this.value.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.LengthBlock", LengthBlock);
//# sourceMappingURL=lengthBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/negateBlock.js




/**
 * Block used to get negative version of a value (i.e. x * -1)
 */
class NegateBlock extends NodeMaterialBlock {
    /**
     * Creates a new NegateBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NegateBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = -1.0 * ${this.value.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NegateBlock", NegateBlock);
//# sourceMappingURL=negateBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/powBlock.js




/**
 * Block used to get the value of the first parameter raised to the power of the second
 */
class PowBlock extends NodeMaterialBlock {
    /**
     * Creates a new PowBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("power", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "PowBlock";
    }
    /**
     * Gets the value operand input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the power operand input component
     */
    get power() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = pow(max(${this.value.associatedVariableName}, 0.), ${this.power.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PowBlock", PowBlock);
//# sourceMappingURL=powBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/randomNumberBlock.js





/**
 * Block used to get a random number
 */
class RandomNumberBlock extends NodeMaterialBlock {
    /**
     * Creates a new RandomNumberBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 |
            NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4 |
            NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "RandomNumberBlock";
    }
    /**
     * Gets the seed input component
     */
    get seed() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("helperFunctions", comments);
        state.compilationString += state._declareOutput(output) + ` = getRand(${this.seed.associatedVariableName}.xy);\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.RandomNumberBlock", RandomNumberBlock);
//# sourceMappingURL=randomNumberBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/arcTan2Block.js




/**
 * Block used to compute arc tangent of 2 values
 */
class ArcTan2Block extends NodeMaterialBlock {
    /**
     * Creates a new ArcTan2Block
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("x", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("y", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ArcTan2Block";
    }
    /**
     * Gets the x operand input component
     */
    get x() {
        return this._inputs[0];
    }
    /**
     * Gets the y operand input component
     */
    get y() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const func = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "atan2" : "atan";
        state.compilationString += state._declareOutput(output) + ` = ${func}(${this.x.associatedVariableName}, ${this.y.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ArcTan2Block", ArcTan2Block);
//# sourceMappingURL=arcTan2Block.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/smoothStepBlock.js




/**
 * Block used to smooth step a value
 */
class SmoothStepBlock extends NodeMaterialBlock {
    /**
     * Creates a new SmoothStepBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("edge0", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("edge1", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SmoothStepBlock";
    }
    /**
     * Gets the value operand input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the first edge operand input component
     */
    get edge0() {
        return this._inputs[1];
    }
    /**
     * Gets the second edge operand input component
     */
    get edge1() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const cast = state._getShaderType(this.value.type);
        state.compilationString +=
            state._declareOutput(output) +
                ` = smoothstep(${cast}(${this.edge0.associatedVariableName}), ${cast}(${this.edge1.associatedVariableName}), ${this.value.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SmoothStepBlock", SmoothStepBlock);
//# sourceMappingURL=smoothStepBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/reciprocalBlock.js




/**
 * Block used to get the reciprocal (1 / x) of a value
 */
class ReciprocalBlock extends NodeMaterialBlock {
    /**
     * Creates a new ReciprocalBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ReciprocalBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        if (this.input.type === NodeMaterialBlockConnectionPointTypes.Matrix) {
            state.compilationString += state._declareOutput(output) + ` = inverse(${this.input.associatedVariableName});\n`;
        }
        else {
            state.compilationString += state._declareOutput(output) + ` = 1. / ${this.input.associatedVariableName};\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ReciprocalBlock", ReciprocalBlock);
//# sourceMappingURL=reciprocalBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/replaceColorBlock.js




/**
 * Block used to replace a color by another one
 */
class ReplaceColorBlock extends NodeMaterialBlock {
    /**
     * Creates a new ReplaceColorBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("reference", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("distance", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("replacement", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._linkConnectionTypes(0, 3);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
        this._inputs[3].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[3].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ReplaceColorBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the reference input component
     */
    get reference() {
        return this._inputs[1];
    }
    /**
     * Gets the distance input component
     */
    get distance() {
        return this._inputs[2];
    }
    /**
     * Gets the replacement input component
     */
    get replacement() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + `;\n`;
        state.compilationString += `if (length(${this.value.associatedVariableName} - ${this.reference.associatedVariableName}) < ${this.distance.associatedVariableName}) {\n`;
        state.compilationString += `${output.associatedVariableName} = ${this.replacement.associatedVariableName};\n`;
        state.compilationString += `} else {\n`;
        state.compilationString += `${output.associatedVariableName} = ${this.value.associatedVariableName};\n`;
        state.compilationString += `}\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ReplaceColorBlock", ReplaceColorBlock);
//# sourceMappingURL=replaceColorBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/posterizeBlock.js




/**
 * Block used to posterize a value
 * @see https://en.wikipedia.org/wiki/Posterization
 */
class PosterizeBlock extends NodeMaterialBlock {
    /**
     * Creates a new PosterizeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("steps", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
        this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "PosterizeBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the steps input component
     */
    get steps() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString +=
            state._declareOutput(output) +
                ` = floor(${this.value.associatedVariableName} / (1.0 / ${this.steps.associatedVariableName})) * (1.0 / ${this.steps.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PosterizeBlock", PosterizeBlock);
//# sourceMappingURL=posterizeBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/waveBlock.js






/**
 * Operations supported by the Wave block
 */
var WaveBlockKind;
(function (WaveBlockKind) {
    /** SawTooth */
    WaveBlockKind[WaveBlockKind["SawTooth"] = 0] = "SawTooth";
    /** Square */
    WaveBlockKind[WaveBlockKind["Square"] = 1] = "Square";
    /** Triangle */
    WaveBlockKind[WaveBlockKind["Triangle"] = 2] = "Triangle";
})(WaveBlockKind || (WaveBlockKind = {}));
/**
 * Block used to apply wave operation to floats
 */
class WaveBlock extends NodeMaterialBlock {
    /**
     * Creates a new WaveBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Gets or sets the kibnd of wave to be applied by the block
         */
        this.kind = 0 /* WaveBlockKind.SawTooth */;
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "WaveBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        switch (this.kind) {
            case 0 /* WaveBlockKind.SawTooth */: {
                state.compilationString += state._declareOutput(output) + ` = ${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName});\n`;
                break;
            }
            case 1 /* WaveBlockKind.Square */: {
                state.compilationString += state._declareOutput(output) + ` = 1.0 - 2.0 * round(fract(${this.input.associatedVariableName}));\n`;
                break;
            }
            case 2 /* WaveBlockKind.Triangle */: {
                state.compilationString +=
                    state._declareOutput(output) + ` = 2.0 * abs(2.0 * (${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName}))) - 1.0;\n`;
                break;
            }
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.kind = this.kind;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.kind = serializationObject.kind;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Kind", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "SawTooth", value: 0 /* WaveBlockKind.SawTooth */ },
            { label: "Square", value: 1 /* WaveBlockKind.Square */ },
            { label: "Triangle", value: 2 /* WaveBlockKind.Triangle */ },
        ],
    })
], WaveBlock.prototype, "kind", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.WaveBlock", WaveBlock);
//# sourceMappingURL=waveBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/gradientBlock.js






/**
 * Class used to store a color step for the GradientBlock
 */
class GradientBlockColorStep {
    /**
     * Gets value indicating which step this color is associated with (between 0 and 1)
     */
    get step() {
        return this._step;
    }
    /**
     * Sets a value indicating which step this color is associated with (between 0 and 1)
     */
    set step(val) {
        this._step = val;
    }
    /**
     * Gets the color associated with this step
     */
    get color() {
        return this._color;
    }
    /**
     * Sets the color associated with this step
     */
    set color(val) {
        this._color = val;
    }
    /**
     * Creates a new GradientBlockColorStep
     * @param step defines a value indicating which step this color is associated with (between 0 and 1)
     * @param color defines the color associated with this step
     */
    constructor(step, color) {
        this.step = step;
        this.color = color;
    }
}
/**
 * Block used to return a color from a gradient based on an input value between 0 and 1
 */
class GradientBlock extends NodeMaterialBlock {
    /** calls observable when the value is changed*/
    colorStepsUpdated() {
        this.onValueChangedObservable.notifyObservers(this);
    }
    /**
     * Creates a new GradientBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Gets or sets the list of color steps
         */
        this.colorSteps = [new GradientBlockColorStep(0, math_color/* Color3 */.v9.Black()), new GradientBlockColorStep(1.0, math_color/* Color3 */.v9.White())];
        /** Gets an observable raised when the value is changed */
        this.onValueChangedObservable = new Misc_observable/* Observable */.cP();
        this.registerInput("gradient", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color3);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Float |
            NodeMaterialBlockConnectionPointTypes.Vector2 |
            NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4 |
            NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GradientBlock";
    }
    /**
     * Gets the gradient input component
     */
    get gradient() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _writeColorConstant(index, vec3) {
        const step = this.colorSteps[index];
        return `${vec3}(${step.color.r}, ${step.color.g}, ${step.color.b})`;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const vec3 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector3);
        if (!this.colorSteps.length || !this.gradient.connectedPoint) {
            state.compilationString += state._declareOutput(output) + ` = ${vec3}(0., 0., 0.);\n`;
            return;
        }
        const tempColor = state._getFreeVariableName("gradientTempColor");
        const tempPosition = state._getFreeVariableName("gradientTempPosition");
        state.compilationString += `${state._declareLocalVar(tempColor, NodeMaterialBlockConnectionPointTypes.Vector3)} = ${this._writeColorConstant(0, vec3)};\n`;
        state.compilationString += `${state._declareLocalVar(tempPosition, NodeMaterialBlockConnectionPointTypes.Float)};\n`;
        let gradientSource = this.gradient.associatedVariableName;
        if (this.gradient.connectedPoint.type !== NodeMaterialBlockConnectionPointTypes.Float) {
            gradientSource += ".x";
        }
        for (let index = 1; index < this.colorSteps.length; index++) {
            const step = this.colorSteps[index];
            const previousStep = this.colorSteps[index - 1];
            state.compilationString += `${tempPosition} = clamp((${gradientSource} - ${state._emitFloat(previousStep.step)}) / (${state._emitFloat(step.step)} -  ${state._emitFloat(previousStep.step)}), 0.0, 1.0) * step(${state._emitFloat(index)}, ${state._emitFloat(this.colorSteps.length - 1)});\n`;
            state.compilationString += `${tempColor} = mix(${tempColor}, ${this._writeColorConstant(index, vec3)}, ${tempPosition});\n`;
        }
        state.compilationString += state._declareOutput(output) + ` = ${tempColor};\n`;
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.colorSteps = [];
        for (const step of this.colorSteps) {
            serializationObject.colorSteps.push({
                step: step.step,
                color: {
                    r: step.color.r,
                    g: step.color.g,
                    b: step.color.b,
                },
            });
        }
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.colorSteps.length = 0;
        for (const step of serializationObject.colorSteps) {
            this.colorSteps.push(new GradientBlockColorStep(step.step, new math_color/* Color3 */.v9(step.color.r, step.color.g, step.color.b)));
        }
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.colorSteps = [];\n`;
        for (const colorStep of this.colorSteps) {
            codeString += `${this._codeVariableName}.colorSteps.push(new BABYLON.GradientBlockColorStep(${colorStep.step}, new BABYLON.Color3(${colorStep.color.r}, ${colorStep.color.g}, ${colorStep.color.b})));\n`;
        }
        return codeString;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GradientBlock", GradientBlock);
//# sourceMappingURL=gradientBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/nLerpBlock.js




/**
 * Block used to normalize lerp between 2 values
 */
class NLerpBlock extends NodeMaterialBlock {
    /**
     * Creates a new NLerpBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("gradient", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._linkConnectionTypes(1, 2, true);
        this._inputs[2].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NLerpBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the gradient operand input component
     */
    get gradient() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString +=
            state._declareOutput(output) +
                ` = normalize(mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName}));\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NLerpBlock", NLerpBlock);
//# sourceMappingURL=nLerpBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/worleyNoise3DBlock.js






/**
 * block used to Generate a Worley Noise 3D Noise Pattern
 */
//  Source: https://github.com/Erkaman/glsl-worley
//  Converted to BJS by Pryme8
//
//  Worley Noise 3D
//  Return vec2 value range of -1.0->1.0, F1-F2 respectivly
class WorleyNoise3DBlock extends NodeMaterialBlock {
    /**
     * Creates a new WorleyNoise3DBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /** Gets or sets a boolean indicating that normal should be inverted on X axis */
        this.manhattanDistance = false;
        this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerInput("jitter", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "WorleyNoise3DBlock";
    }
    /**
     * Gets the seed input component
     */
    get seed() {
        return this._inputs[0];
    }
    /**
     * Gets the jitter input component
     */
    get jitter() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the x component
     */
    get x() {
        return this._outputs[1];
    }
    /**
     * Gets the y component
     */
    get y() {
        return this._outputs[2];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (!this.seed.isConnected) {
            return;
        }
        if (!this.output.hasEndpoints && !this.x.hasEndpoints && !this.y.hasEndpoints) {
            return;
        }
        let functionString = `vec3 permute(vec3 x){\n`;
        functionString += `    return mod((34.0 * x + 1.0) * x, 289.0);\n`;
        functionString += `}\n\n`;
        functionString += `vec3 dist(vec3 x, vec3 y, vec3 z,  bool manhattanDistance){\n`;
        functionString += `    return [manhattanDistance ?  abs(x) + abs(y) + abs(z) :  (x * x + y * y + z * z)];\n`;
        functionString += `}\n\n`;
        functionString += `vec2 worley(vec3 P, float jitter, bool manhattanDistance){\n`;
        functionString += `    float K = 0.142857142857; // 1/7\n`;
        functionString += `    float Ko = 0.428571428571; // 1/2-K/2\n`;
        functionString += `    float  K2 = 0.020408163265306; // 1/(7*7)\n`;
        functionString += `    float Kz = 0.166666666667; // 1/6\n`;
        functionString += `    float Kzo = 0.416666666667; // 1/2-1/6*2\n`;
        functionString += `\n`;
        functionString += `    vec3 Pi = mod(floor(P), 289.0);\n`;
        functionString += `    vec3 Pf = fract(P) - 0.5;\n`;
        functionString += `\n`;
        functionString += `    vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0);\n`;
        functionString += `    vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0);\n`;
        functionString += `    vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0);\n`;
        functionString += `\n`;
        functionString += `    vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0));\n`;
        functionString += `    vec3 p1 = permute(p + Pi.y - 1.0);\n`;
        functionString += `    vec3 p2 = permute(p + Pi.y);\n`;
        functionString += `    vec3 p3 = permute(p + Pi.y + 1.0);\n`;
        functionString += `\n`;
        functionString += `    vec3 p11 = permute(p1 + Pi.z - 1.0);\n`;
        functionString += `    vec3 p12 = permute(p1 + Pi.z);\n`;
        functionString += `    vec3 p13 = permute(p1 + Pi.z + 1.0);\n`;
        functionString += `\n`;
        functionString += `    vec3 p21 = permute(p2 + Pi.z - 1.0);\n`;
        functionString += `    vec3 p22 = permute(p2 + Pi.z);\n`;
        functionString += `    vec3 p23 = permute(p2 + Pi.z + 1.0);\n`;
        functionString += `\n`;
        functionString += `    vec3 p31 = permute(p3 + Pi.z - 1.0);\n`;
        functionString += `    vec3 p32 = permute(p3 + Pi.z);\n`;
        functionString += `    vec3 p33 = permute(p3 + Pi.z + 1.0);\n`;
        functionString += `\n`;
        functionString += `    vec3 ox11 = fract(p11*K) - Ko;\n`;
        functionString += `    vec3 oy11 = mod(floor(p11*K), 7.0)*K - Ko;\n`;
        functionString += `    vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed\n`;
        functionString += `\n`;
        functionString += `    vec3 ox12 = fract(p12*K) - Ko;\n`;
        functionString += `    vec3 oy12 = mod(floor(p12*K), 7.0)*K - Ko;\n`;
        functionString += `    vec3 oz12 = floor(p12*K2)*Kz - Kzo;\n`;
        functionString += `\n`;
        functionString += `    vec3 ox13 = fract(p13*K) - Ko;\n`;
        functionString += `    vec3 oy13 = mod(floor(p13*K), 7.0)*K - Ko;\n`;
        functionString += `    vec3 oz13 = floor(p13*K2)*Kz - Kzo;\n`;
        functionString += `\n`;
        functionString += `    vec3 ox21 = fract(p21*K) - Ko;\n`;
        functionString += `    vec3 oy21 = mod(floor(p21*K), 7.0)*K - Ko;\n`;
        functionString += `    vec3 oz21 = floor(p21*K2)*Kz - Kzo;\n`;
        functionString += `\n`;
        functionString += `    vec3 ox22 = fract(p22*K) - Ko;\n`;
        functionString += `    vec3 oy22 = mod(floor(p22*K), 7.0)*K - Ko;\n`;
        functionString += `    vec3 oz22 = floor(p22*K2)*Kz - Kzo;\n`;
        functionString += `\n`;
        functionString += `    vec3 ox23 = fract(p23*K) - Ko;\n`;
        functionString += `    vec3 oy23 = mod(floor(p23*K), 7.0)*K - Ko;\n`;
        functionString += `    vec3 oz23 = floor(p23*K2)*Kz - Kzo;\n`;
        functionString += `\n`;
        functionString += `    vec3 ox31 = fract(p31*K) - Ko;\n`;
        functionString += `    vec3 oy31 = mod(floor(p31*K), 7.0)*K - Ko;\n`;
        functionString += `    vec3 oz31 = floor(p31*K2)*Kz - Kzo;\n`;
        functionString += `\n`;
        functionString += `    vec3 ox32 = fract(p32*K) - Ko;\n`;
        functionString += `    vec3 oy32 = mod(floor(p32*K), 7.0)*K - Ko;\n`;
        functionString += `    vec3 oz32 = floor(p32*K2)*Kz - Kzo;\n`;
        functionString += `\n`;
        functionString += `    vec3 ox33 = fract(p33*K) - Ko;\n`;
        functionString += `    vec3 oy33 = mod(floor(p33*K), 7.0)*K - Ko;\n`;
        functionString += `    vec3 oz33 = floor(p33*K2)*Kz - Kzo;\n`;
        functionString += `\n`;
        functionString += `    vec3 dx11 = Pfx + jitter*ox11;\n`;
        functionString += `    vec3 dy11 = Pfy.x + jitter*oy11;\n`;
        functionString += `    vec3 dz11 = Pfz.x + jitter*oz11;\n`;
        functionString += `\n`;
        functionString += `    vec3 dx12 = Pfx + jitter*ox12;\n`;
        functionString += `    vec3 dy12 = Pfy.x + jitter*oy12;\n`;
        functionString += `    vec3 dz12 = Pfz.y + jitter*oz12;\n`;
        functionString += `\n`;
        functionString += `    vec3 dx13 = Pfx + jitter*ox13;\n`;
        functionString += `    vec3 dy13 = Pfy.x + jitter*oy13;\n`;
        functionString += `    vec3 dz13 = Pfz.z + jitter*oz13;\n`;
        functionString += `\n`;
        functionString += `    vec3 dx21 = Pfx + jitter*ox21;\n`;
        functionString += `    vec3 dy21 = Pfy.y + jitter*oy21;\n`;
        functionString += `    vec3 dz21 = Pfz.x + jitter*oz21;\n`;
        functionString += `\n`;
        functionString += `    vec3 dx22 = Pfx + jitter*ox22;\n`;
        functionString += `    vec3 dy22 = Pfy.y + jitter*oy22;\n`;
        functionString += `    vec3 dz22 = Pfz.y + jitter*oz22;\n`;
        functionString += `\n`;
        functionString += `    vec3 dx23 = Pfx + jitter*ox23;\n`;
        functionString += `    vec3 dy23 = Pfy.y + jitter*oy23;\n`;
        functionString += `    vec3 dz23 = Pfz.z + jitter*oz23;\n`;
        functionString += `\n`;
        functionString += `    vec3 dx31 = Pfx + jitter*ox31;\n`;
        functionString += `    vec3 dy31 = Pfy.z + jitter*oy31;\n`;
        functionString += `    vec3 dz31 = Pfz.x + jitter*oz31;\n`;
        functionString += `\n`;
        functionString += `    vec3 dx32 = Pfx + jitter*ox32;\n`;
        functionString += `    vec3 dy32 = Pfy.z + jitter*oy32;\n`;
        functionString += `    vec3 dz32 = Pfz.y + jitter*oz32;\n`;
        functionString += `\n`;
        functionString += `    vec3 dx33 = Pfx + jitter*ox33;\n`;
        functionString += `    vec3 dy33 = Pfy.z + jitter*oy33;\n`;
        functionString += `    vec3 dz33 = Pfz.z + jitter*oz33;\n`;
        functionString += `\n`;
        functionString += `    vec3 d11 = dist(dx11, dy11, dz11, manhattanDistance);\n`;
        functionString += `    vec3 d12 = dist(dx12, dy12, dz12, manhattanDistance);\n`;
        functionString += `    vec3 d13 = dist(dx13, dy13, dz13, manhattanDistance);\n`;
        functionString += `    vec3 d21 = dist(dx21, dy21, dz21, manhattanDistance);\n`;
        functionString += `    vec3 d22 = dist(dx22, dy22, dz22, manhattanDistance);\n`;
        functionString += `    vec3 d23 = dist(dx23, dy23, dz23, manhattanDistance);\n`;
        functionString += `    vec3 d31 = dist(dx31, dy31, dz31, manhattanDistance);\n`;
        functionString += `    vec3 d32 = dist(dx32, dy32, dz32, manhattanDistance);\n`;
        functionString += `    vec3 d33 = dist(dx33, dy33, dz33, manhattanDistance);\n`;
        functionString += `\n`;
        functionString += `    vec3 d1a = min(d11, d12);\n`;
        functionString += `    d12 = max(d11, d12);\n`;
        functionString += `    d11 = min(d1a, d13); // Smallest now not in d12 or d13\n`;
        functionString += `    d13 = max(d1a, d13);\n`;
        functionString += `    d12 = min(d12, d13); // 2nd smallest now not in d13\n`;
        functionString += `    vec3 d2a = min(d21, d22);\n`;
        functionString += `    d22 = max(d21, d22);\n`;
        functionString += `    d21 = min(d2a, d23); // Smallest now not in d22 or d23\n`;
        functionString += `    d23 = max(d2a, d23);\n`;
        functionString += `    d22 = min(d22, d23); // 2nd smallest now not in d23\n`;
        functionString += `    vec3 d3a = min(d31, d32);\n`;
        functionString += `    d32 = max(d31, d32);\n`;
        functionString += `    d31 = min(d3a, d33); // Smallest now not in d32 or d33\n`;
        functionString += `    d33 = max(d3a, d33);\n`;
        functionString += `    d32 = min(d32, d33); // 2nd smallest now not in d33\n`;
        functionString += `    vec3 da = min(d11, d21);\n`;
        functionString += `    d21 = max(d11, d21);\n`;
        functionString += `    d11 = min(da, d31); // Smallest now in d11\n`;
        functionString += `    d31 = max(da, d31); // 2nd smallest now not in d31\n`;
        functionString += `    if (d11.x >= d11.y) { vec2 temp = d11.yx; d11.x = temp.x; d11.y = temp.y; }\n`;
        functionString += `    if (d11.x >= d11.z) { vec2 temp = d11.zx; d11.x = temp.x; d11.z = temp.y; }\n`;
        functionString += `    d12 = min(d12, d21); // 2nd smallest now not in d21\n`;
        functionString += `    d12 = min(d12, d22); // nor in d22\n`;
        functionString += `    d12 = min(d12, d31); // nor in d31\n`;
        functionString += `    d12 = min(d12, d32); // nor in d32\n`;
        functionString += `    vec2 temp2 = min(d11.yz, d12.xy); // nor in d12.yz\n`;
        functionString += `    d11.y = temp2.x;\n`;
        functionString += `    d11.z = temp2.y;\n`;
        functionString += `    d11.y = min(d11.y, d12.z); // Only two more to go\n`;
        functionString += `    d11.y = min(d11.y, d11.z); // Done! (Phew!)\n`;
        functionString += `    return sqrt(d11.xy); // F1, F2\n`;
        functionString += `}\n\n`;
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            functionString = state._babylonSLtoWGSL(functionString);
        }
        else {
            functionString = state._babylonSLtoGLSL(functionString);
        }
        state._emitFunction("worley3D", functionString, "// Worley3D");
        const tempVariable = state._getFreeVariableName("worleyTemp");
        state.compilationString += `${state._declareLocalVar(tempVariable, NodeMaterialBlockConnectionPointTypes.Vector2)} = worley(${this.seed.associatedVariableName}, ${this.jitter.associatedVariableName}, ${this.manhattanDistance});\n`;
        if (this.output.hasEndpoints) {
            state.compilationString += state._declareOutput(this.output) + ` = ${tempVariable};\n`;
        }
        if (this.x.hasEndpoints) {
            state.compilationString += state._declareOutput(this.x) + ` = ${tempVariable}.x;\n`;
        }
        if (this.y.hasEndpoints) {
            state.compilationString += state._declareOutput(this.y) + ` = ${tempVariable}.y;\n`;
        }
        return this;
    }
    /**
     * Exposes the properties to the UI?
     * @returns - boolean indicating if the block has properties or not
     */
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.manhattanDistance = ${this.manhattanDistance};\n`;
        return codeString;
    }
    /**
     * Exposes the properties to the Serialize?
     * @returns - a serialized object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.manhattanDistance = this.manhattanDistance;
        return serializationObject;
    }
    /**
     * Exposes the properties to the deserialize?
     * @param serializationObject
     * @param scene
     * @param rootUrl
     */
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.manhattanDistance = serializationObject.manhattanDistance;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Use Manhattan Distance", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { embedded: true, notifiers: { update: false } })
], WorleyNoise3DBlock.prototype, "manhattanDistance", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.WorleyNoise3DBlock", WorleyNoise3DBlock);
//# sourceMappingURL=worleyNoise3DBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/simplexPerlin3DBlock.js




/**
 * block used to Generate a Simplex Perlin 3d Noise Pattern
 */
//
//  Wombat
//  An efficient texture-free GLSL procedural noise library
//  Source: https://github.com/BrianSharpe/Wombat
//  Derived from: https://github.com/BrianSharpe/GPU-Noise-Lib
//
//  I'm not one for copyrights.  Use the code however you wish.
//  All I ask is that credit be given back to the blog or myself when appropriate.
//  And also to let me know if you come up with any changes, improvements, thoughts or interesting uses for this stuff. :)
//  Thanks!
//
//  Brian Sharpe
//  brisharpe CIRCLE_A yahoo DOT com
//  http://briansharpe.wordpress.com
//  https://github.com/BrianSharpe
//
//
//  This is a modified version of Stefan Gustavson's and Ian McEwan's work at http://github.com/ashima/webgl-noise
//  Modifications are...
//  - faster random number generation
//  - analytical final normalization
//  - space scaled can have an approx feature size of 1.0
//  - filter kernel changed to fix discontinuities at tetrahedron boundaries
//
//  Converted to BJS by Pryme8
//
//  Simplex Perlin Noise 3D
//  Return value range of -1.0->1.0
//
class SimplexPerlin3DBlock extends NodeMaterialBlock {
    /**
     * Creates a new SimplexPerlin3DBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SimplexPerlin3DBlock";
    }
    /**
     * Gets the seed operand input component
     */
    get seed() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (!this.seed.isConnected) {
            return;
        }
        if (!this._outputs[0].hasEndpoints) {
            return;
        }
        let functionString = `const float SKEWFACTOR = 1.0/3.0;\n`;
        functionString += `const float UNSKEWFACTOR = 1.0/6.0;\n`;
        functionString += `const float SIMPLEX_CORNER_POS = 0.5;\n`;
        functionString += `const float SIMPLEX_TETRAHADRON_HEIGHT = 0.70710678118654752440084436210485;\n`;
        functionString += `float SimplexPerlin3D( vec3 source ){\n`;
        functionString += `    vec3 P = source;\n`;
        functionString += `    P.x = [P.x == 0. && P.y == 0. && P.z == 0. ? 0.00001 : P.x];\n`;
        functionString += `    P *= SIMPLEX_TETRAHADRON_HEIGHT;\n`;
        functionString += `    vec3 Pi = floor( P + dot( P, vec3( SKEWFACTOR) ) );`;
        functionString += `    vec3 x0 = P - Pi + dot(Pi, vec3( UNSKEWFACTOR ) );\n`;
        functionString += `    vec3 g = step(x0.yzx, x0.xyz);\n`;
        functionString += `    vec3 l = 1.0 - g;\n`;
        functionString += `    vec3 Pi_1 = min( g.xyz, l.zxy );\n`;
        functionString += `    vec3 Pi_2 = max( g.xyz, l.zxy );\n`;
        functionString += `    vec3 x1 = x0 - Pi_1 + UNSKEWFACTOR;\n`;
        functionString += `    vec3 x2 = x0 - Pi_2 + SKEWFACTOR;\n`;
        functionString += `    vec3 x3 = x0 - SIMPLEX_CORNER_POS;\n`;
        functionString += `    vec4 v1234_x = vec4( x0.x, x1.x, x2.x, x3.x );\n`;
        functionString += `    vec4 v1234_y = vec4( x0.y, x1.y, x2.y, x3.y );\n`;
        functionString += `    vec4 v1234_z = vec4( x0.z, x1.z, x2.z, x3.z );\n`;
        functionString += `    Pi = Pi.xyz - floor(Pi.xyz * ( 1.0 / 69.0 )) * 69.0;\n`;
        functionString += `    vec3 Pi_inc1 = step( Pi, vec3( 69.0 - 1.5 ) ) * ( Pi + 1.0 );\n`;
        functionString += `    vec4 Pt = vec4( Pi.xy, Pi_inc1.xy ) + vec2( 50.0, 161.0 ).xyxy;\n`;
        functionString += `    Pt *= Pt;\n`;
        functionString += `    vec4 V1xy_V2xy = mix( Pt.xyxy, Pt.zwzw, vec4( Pi_1.xy, Pi_2.xy ) );\n`;
        functionString += `    Pt = vec4( Pt.x, V1xy_V2xy.xz, Pt.z ) * vec4( Pt.y, V1xy_V2xy.yw, Pt.w );\n`;
        functionString += `    const vec3 SOMELARGEFLOATS = vec3( 635.298681, 682.357502, 668.926525 );\n`;
        functionString += `    const vec3 ZINC = vec3( 48.500388, 65.294118, 63.934599 );\n`;
        functionString += `    vec3 lowz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi.zzz * ZINC.xyz ) );\n`;
        functionString += `    vec3 highz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi_inc1.zzz * ZINC.xyz ) );\n`;
        functionString += `    Pi_1 = [( Pi_1.z < 0.5 ) ? lowz_mods : highz_mods];\n`;
        functionString += `    Pi_2 = [( Pi_2.z < 0.5 ) ? lowz_mods : highz_mods];\n`;
        functionString += `    vec4 hash_0 = fract( Pt * vec4( lowz_mods.x, Pi_1.x, Pi_2.x, highz_mods.x ) ) - 0.49999;\n`;
        functionString += `    vec4 hash_1 = fract( Pt * vec4( lowz_mods.y, Pi_1.y, Pi_2.y, highz_mods.y ) ) - 0.49999;\n`;
        functionString += `    vec4 hash_2 = fract( Pt * vec4( lowz_mods.z, Pi_1.z, Pi_2.z, highz_mods.z ) ) - 0.49999;\n`;
        functionString += `    vec4 grad_results = inversesqrt( hash_0 * hash_0 + hash_1 * hash_1 + hash_2 * hash_2 ) * ( hash_0 * v1234_x + hash_1 * v1234_y + hash_2 * v1234_z );\n`;
        functionString += `    const float FINAL_NORMALIZATION = 37.837227241611314102871574478976;\n`;
        functionString += `    vec4 kernel_weights = v1234_x * v1234_x + v1234_y * v1234_y + v1234_z * v1234_z;\n`;
        functionString += `    kernel_weights = max(0.5 - kernel_weights, vec4(0.));\n`;
        functionString += `    kernel_weights = kernel_weights*kernel_weights*kernel_weights;\n`;
        functionString += `    return dot( kernel_weights, grad_results ) * FINAL_NORMALIZATION;\n`;
        functionString += `}\n`;
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            functionString = state._babylonSLtoWGSL(functionString);
        }
        else {
            functionString = state._babylonSLtoGLSL(functionString);
        }
        state._emitFunction("SimplexPerlin3D", functionString, "// SimplexPerlin3D");
        state.compilationString += state._declareOutput(this._outputs[0]) + ` = SimplexPerlin3D(${this.seed.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SimplexPerlin3DBlock", SimplexPerlin3DBlock);
//# sourceMappingURL=simplexPerlin3DBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/normalBlendBlock.js




/**
 * Block used to blend normals
 */
class NormalBlendBlock extends NodeMaterialBlock {
    /**
     * Creates a new NormalBlendBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("normalMap0", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("normalMap1", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4 |
            NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4);
        this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4 |
            NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NormalBlendBlock";
    }
    /**
     * Gets the first input component
     */
    get normalMap0() {
        return this._inputs[0];
    }
    /**
     * Gets the second input component
     */
    get normalMap1() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const input0 = this._inputs[0];
        const input1 = this._inputs[1];
        const stepR = state._getFreeVariableName("stepR");
        const stepG = state._getFreeVariableName("stepG");
        state.compilationString += `${state._declareLocalVar(stepR, NodeMaterialBlockConnectionPointTypes.Float)} = step(0.5, ${input0.associatedVariableName}.r);\n`;
        state.compilationString += `${state._declareLocalVar(stepG, NodeMaterialBlockConnectionPointTypes.Float)} = step(0.5, ${input0.associatedVariableName}.g);\n`;
        state.compilationString += state._declareOutput(output) + `;\n`;
        state.compilationString += `${output.associatedVariableName}.r = (1.0 - ${stepR}) * ${input0.associatedVariableName}.r * ${input1.associatedVariableName}.r * 2.0 + ${stepR} * (1.0 - (1.0 - ${input0.associatedVariableName}.r) * (1.0 - ${input1.associatedVariableName}.r) * 2.0);\n`;
        state.compilationString += `${output.associatedVariableName}.g = (1.0 - ${stepG}) * ${input0.associatedVariableName}.g * ${input1.associatedVariableName}.g * 2.0 + ${stepG} * (1.0 - (1.0 - ${input0.associatedVariableName}.g) * (1.0 - ${input1.associatedVariableName}.g) * 2.0);\n`;
        state.compilationString += `${output.associatedVariableName}.b = ${input0.associatedVariableName}.b * ${input1.associatedVariableName}.b;\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NormalBlendBlock", NormalBlendBlock);
//# sourceMappingURL=normalBlendBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/rotate2dBlock.js





/**
 * Block used to rotate a 2d vector by a given angle
 */
class Rotate2dBlock extends NodeMaterialBlock {
    /**
     * Creates a new Rotate2dBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerInput("angle", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "Rotate2dBlock";
    }
    /**
     * Gets the input vector
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the input angle
     */
    get angle() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.angle.isConnected) {
            const angleInput = new InputBlock("angle");
            angleInput.value = 0;
            angleInput.output.connectTo(this.angle);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const angle = this.angle;
        const input = this.input;
        state.compilationString +=
            state._declareOutput(output) +
                ` = vec2(cos(${angle.associatedVariableName}) * ${input.associatedVariableName}.x - sin(${angle.associatedVariableName}) * ${input.associatedVariableName}.y, sin(${angle.associatedVariableName}) * ${input.associatedVariableName}.x + cos(${angle.associatedVariableName}) * ${input.associatedVariableName}.y);\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.Rotate2dBlock", Rotate2dBlock);
//# sourceMappingURL=rotate2dBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/reflectBlock.js




/**
 * Block used to get the reflected vector from a direction and a normal
 */
class ReflectBlock extends NodeMaterialBlock {
    /**
     * Creates a new ReflectBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("incident", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4 |
            NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4);
        this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4 |
            NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ReflectBlock";
    }
    /**
     * Gets the incident component
     */
    get incident() {
        return this._inputs[0];
    }
    /**
     * Gets the normal component
     */
    get normal() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString += state._declareOutput(output) + ` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ReflectBlock", ReflectBlock);
//# sourceMappingURL=reflectBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/refractBlock.js




/**
 * Block used to get the refracted vector from a direction and a normal
 */
class RefractBlock extends NodeMaterialBlock {
    /**
     * Creates a new RefractBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("incident", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("ior", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4 |
            NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4);
        this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 |
            NodeMaterialBlockConnectionPointTypes.Vector4 |
            NodeMaterialBlockConnectionPointTypes.Color3 |
            NodeMaterialBlockConnectionPointTypes.Color4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "RefractBlock";
    }
    /**
     * Gets the incident component
     */
    get incident() {
        return this._inputs[0];
    }
    /**
     * Gets the normal component
     */
    get normal() {
        return this._inputs[1];
    }
    /**
     * Gets the index of refraction component
     */
    get ior() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        state.compilationString +=
            state._declareOutput(output) +
                ` = refract(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz, ${this.ior.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.RefractBlock", RefractBlock);
//# sourceMappingURL=refractBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/desaturateBlock.js




/**
 * Block used to desaturate a color
 */
class DesaturateBlock extends NodeMaterialBlock {
    /**
     * Creates a new DesaturateBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color3);
        this.registerInput("level", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color3);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "DesaturateBlock";
    }
    /**
     * Gets the color operand input component
     */
    get color() {
        return this._inputs[0];
    }
    /**
     * Gets the level operand input component
     */
    get level() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const color = this.color;
        const colorName = color.associatedVariableName;
        const tempMin = state._getFreeVariableName("colorMin");
        const tempMax = state._getFreeVariableName("colorMax");
        const tempMerge = state._getFreeVariableName("colorMerge");
        state.compilationString += `${state._declareLocalVar(tempMin, NodeMaterialBlockConnectionPointTypes.Float)} = min(min(${colorName}.x, ${colorName}.y), ${colorName}.z);\n`;
        state.compilationString += `${state._declareLocalVar(tempMax, NodeMaterialBlockConnectionPointTypes.Float)} = max(max(${colorName}.x, ${colorName}.y), ${colorName}.z);\n`;
        state.compilationString += `${state._declareLocalVar(tempMerge, NodeMaterialBlockConnectionPointTypes.Float)} = 0.5 * (${tempMin} + ${tempMax});\n`;
        state.compilationString +=
            state._declareOutput(output) +
                ` = mix(${colorName}, ${state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector3)}(${tempMerge}, ${tempMerge}, ${tempMerge}), ${this.level.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DesaturateBlock", DesaturateBlock);
//# sourceMappingURL=desaturateBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/sheenBlock.js







/**
 * Block used to implement the sheen module of the PBR material
 */
class SheenBlock extends NodeMaterialBlock {
    /**
     * Create a new SheenBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        /**
         * If true, the sheen effect is layered above the base BRDF with the albedo-scaling technique.
         * It allows the strength of the sheen effect to not depend on the base color of the material,
         * making it easier to setup and tweak the effect
         */
        this.albedoScaling = false;
        /**
         * Defines if the sheen is linked to the sheen color.
         */
        this.linkSheenWithAlbedo = false;
        this._isUnique = true;
        this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("roughness", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("sheen", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("sheen", this, 1 /* NodeMaterialConnectionPointDirection.Output */, SheenBlock, "SheenBlock"));
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("sheenOut");
        state._excludeVariableName("sheenMapData");
        state._excludeVariableName("vSheenColor");
        state._excludeVariableName("vSheenRoughness");
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SheenBlock";
    }
    /**
     * Gets the intensity input component
     */
    get intensity() {
        return this._inputs[0];
    }
    /**
     * Gets the color input component
     */
    get color() {
        return this._inputs[1];
    }
    /**
     * Gets the roughness input component
     */
    get roughness() {
        return this._inputs[2];
    }
    /**
     * Gets the sheen object output component
     */
    get sheen() {
        return this._outputs[0];
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        super.prepareDefines(mesh, nodeMaterial, defines);
        defines.setValue("SHEEN", true);
        defines.setValue("SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE", true, true);
        defines.setValue("SHEEN_LINKWITHALBEDO", this.linkSheenWithAlbedo, true);
        defines.setValue("SHEEN_ROUGHNESS", this.roughness.isConnected, true);
        defines.setValue("SHEEN_ALBEDOSCALING", this.albedoScaling, true);
    }
    /**
     * Gets the main code of the block (fragment side)
     * @param reflectionBlock instance of a ReflectionBlock null if the code must be generated without an active reflection module
     * @param state define the build state
     * @returns the shader code
     */
    getCode(reflectionBlock, state) {
        let code = "";
        const color = this.color.isConnected ? this.color.associatedVariableName : `vec3${state.fSuffix}(1.)`;
        const intensity = this.intensity.isConnected ? this.intensity.associatedVariableName : "1.";
        const roughness = this.roughness.isConnected ? this.roughness.associatedVariableName : "0.";
        const texture = `vec4${state.fSuffix}(0.)`;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        code = `#ifdef SHEEN
            ${isWebGPU ? "var sheenOut: sheenOutParams" : "sheenOutParams sheenOut"};

            ${state._declareLocalVar("vSheenColor", NodeMaterialBlockConnectionPointTypes.Vector4)} = vec4${state.fSuffix}(${color}, ${intensity});

            sheenOut = sheenBlock(
                vSheenColor
            #ifdef SHEEN_ROUGHNESS
                , ${roughness}
            #endif
                , roughness
            #ifdef SHEEN_TEXTURE
                , ${texture}
                ${isWebGPU ? `, ${texture}Sampler` : ""}
                , 1.0
            #endif
                , reflectance
            #ifdef SHEEN_LINKWITHALBEDO
                , baseColor
                , surfaceAlbedo
            #endif
            #ifdef ENVIRONMENTBRDF
                , NdotV
                , environmentBrdf
            #endif
            #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
                , AARoughnessFactors
                , ${isWebGPU ? "uniforms." : ""}${reflectionBlock?._vReflectionMicrosurfaceInfosName}
                , ${reflectionBlock?._vReflectionInfosName}
                , ${reflectionBlock?.reflectionColor}
                , ${isWebGPU ? "uniforms." : ""}vLightingIntensity
                #ifdef ${reflectionBlock?._define3DName}
                    , ${reflectionBlock?._cubeSamplerName}                                      
                    ${isWebGPU ? `, ${reflectionBlock?._cubeSamplerName}Sampler` : ""}
                #else
                    , ${reflectionBlock?._2DSamplerName}
                    ${isWebGPU ? `, ${reflectionBlock?._2DSamplerName}Sampler` : ""}
                #endif
                , reflectionOut.reflectionCoords
                , NdotVUnclamped
                #ifndef LODBASEDMICROSFURACE
                    #ifdef ${reflectionBlock?._define3DName}
                        , ${reflectionBlock?._cubeSamplerName}                        
                        ${isWebGPU ? `, ${reflectionBlock?._cubeSamplerName}Sampler` : ""}
                        , ${reflectionBlock?._cubeSamplerName}
                        ${isWebGPU ? `, ${reflectionBlock?._cubeSamplerName}Sampler` : ""}
                    #else
                        , ${reflectionBlock?._2DSamplerName}
                        ${isWebGPU ? `, ${reflectionBlock?._2DSamplerName}Sampler` : ""}
                        , ${reflectionBlock?._2DSamplerName}
                        ${isWebGPU ? `, ${reflectionBlock?._2DSamplerName}Sampler` : ""}
                    #endif
                #endif
                #if !defined(${reflectionBlock?._defineSkyboxName}) && defined(RADIANCEOCCLUSION)
                    , seo
                #endif
                #if !defined(${reflectionBlock?._defineSkyboxName}) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(${reflectionBlock?._define3DName})
                    , eho
                #endif
            #endif
            );

            #ifdef SHEEN_LINKWITHALBEDO
                surfaceAlbedo = sheenOut.surfaceAlbedo;
            #endif
        #endif\n`;
        return code;
    }
    _buildBlock(state) {
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            state.sharedData.blocksWithDefines.push(this);
        }
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.albedoScaling = ${this.albedoScaling};\n`;
        codeString += `${this._codeVariableName}.linkSheenWithAlbedo = ${this.linkSheenWithAlbedo};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.albedoScaling = this.albedoScaling;
        serializationObject.linkSheenWithAlbedo = this.linkSheenWithAlbedo;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.albedoScaling = serializationObject.albedoScaling;
        this.linkSheenWithAlbedo = serializationObject.linkSheenWithAlbedo;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Albedo scaling", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { embedded: true, notifiers: { update: true } })
], SheenBlock.prototype, "albedoScaling", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Link sheen with albedo", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES", { embedded: true, notifiers: { update: true } })
], SheenBlock.prototype, "linkSheenWithAlbedo", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SheenBlock", SheenBlock);
//# sourceMappingURL=sheenBlock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/brdfTextureTools.js
var brdfTextureTools = __webpack_require__(4109);
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/anisotropyBlock.js







/**
 * Block used to implement the anisotropy module of the PBR material
 */
class AnisotropyBlock extends NodeMaterialBlock {
    /**
     * Create a new AnisotropyBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this._tangentCorrectionFactorName = "";
        this._isUnique = true;
        this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("direction", NodeMaterialBlockConnectionPointTypes.Vector2, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.Vector2, true); // need this property and the next one in case there's no PerturbNormal block connected to the main PBR block
        this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.Vector4, true);
        this.registerInput("TBN", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("TBN", this, 0 /* NodeMaterialConnectionPointDirection.Input */, TBNBlock, "TBNBlock"));
        this.registerInput("roughness", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("anisotropy", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("anisotropy", this, 1 /* NodeMaterialConnectionPointDirection.Output */, AnisotropyBlock, "AnisotropyBlock"));
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("anisotropicOut");
        state._excludeVariableName("TBN");
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "AnisotropyBlock";
    }
    /**
     * Gets the intensity input component
     */
    get intensity() {
        return this._inputs[0];
    }
    /**
     * Gets the direction input component
     */
    get direction() {
        return this._inputs[1];
    }
    /**
     * Gets the uv input component
     */
    get uv() {
        return this._inputs[2];
    }
    /**
     * Gets the worldTangent input component
     */
    get worldTangent() {
        return this._inputs[3];
    }
    /**
     * Gets the TBN input component
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    get TBN() {
        return this._inputs[4];
    }
    /**
     * Gets the roughness input component
     */
    get roughness() {
        return this._inputs[5];
    }
    /**
     * Gets the anisotropy object output component
     */
    get anisotropy() {
        return this._outputs[0];
    }
    _generateTBNSpace(state) {
        let code = "";
        const comments = `//${this.name}`;
        const uv = this.uv;
        const worldPosition = this.worldPositionConnectionPoint;
        const worldNormal = this.worldNormalConnectionPoint;
        const worldTangent = this.worldTangent;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        if (!uv.isConnected) {
            // we must set the uv input as optional because we may not end up in this method (in case a PerturbNormal block is linked to the PBR material)
            // in which case uv is not required. But if we do come here, we do need the uv, so we have to raise an error but not with throw, else
            // it will stop the building of the node material and will lead to errors in the editor!
            logger/* Logger */.V.Error("You must connect the 'uv' input of the Anisotropy block!");
        }
        state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
        const tangentReplaceString = { search: /defined\(TANGENT\)/g, replace: worldTangent.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" };
        const TBN = this.TBN;
        if (TBN.isConnected) {
            state.compilationString += `
            #ifdef TBNBLOCK
            ${isWebGPU ? "var TBN" : "mat3 TBN"} = ${TBN.associatedVariableName};
            #endif
            `;
        }
        else if (worldTangent.isConnected) {
            code += `${state._declareLocalVar("tbnNormal", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${worldNormal.associatedVariableName}.xyz);\n`;
            code += `${state._declareLocalVar("tbnTangent", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${worldTangent.associatedVariableName}.xyz);\n`;
            code += `${state._declareLocalVar("tbnBitangent", NodeMaterialBlockConnectionPointTypes.Vector3)} = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};\n`;
            code += `${isWebGPU ? "var vTBN" : "mat3 vTBN"} = ${isWebGPU ? "mat3x3f" : "mat3"}(tbnTangent, tbnBitangent, tbnNormal);\n`;
        }
        code += `
            #if defined(${worldTangent.isConnected ? "TANGENT" : "IGNORE"}) && defined(NORMAL)
                ${isWebGPU ? "var TBN" : "mat3 TBN"} = vTBN;
            #else
                ${isWebGPU ? "var TBN" : "mat3 TBN"} = cotangent_frame(${worldNormal.associatedVariableName + ".xyz"}, ${"v_" + worldPosition.associatedVariableName + ".xyz"}, ${uv.isConnected ? uv.associatedVariableName : "vec2(0.)"}, vec2${state.fSuffix}(1., 1.));
            #endif\n`;
        state._emitFunctionFromInclude("bumpFragmentMainFunctions", comments, {
            replaceStrings: [tangentReplaceString],
        });
        return code;
    }
    /**
     * Gets the main code of the block (fragment side)
     * @param state current state of the node material building
     * @param generateTBNSpace if true, the code needed to create the TBN coordinate space is generated
     * @returns the shader code
     */
    getCode(state, generateTBNSpace = false) {
        let code = "";
        if (generateTBNSpace) {
            code += this._generateTBNSpace(state);
        }
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        const intensity = this.intensity.isConnected ? this.intensity.associatedVariableName : "1.0";
        const direction = this.direction.isConnected ? this.direction.associatedVariableName : "vec2(1., 0.)";
        const roughness = this.roughness.isConnected ? this.roughness.associatedVariableName : "0.";
        code += `${isWebGPU ? "var anisotropicOut: anisotropicOutParams" : "anisotropicOutParams anisotropicOut"};
            anisotropicOut = anisotropicBlock(
                vec3(${direction}, ${intensity}),
                ${roughness},
            #ifdef ANISOTROPIC_TEXTURE
                vec3(0.),
            #endif
                TBN,
                normalW,
                viewDirectionW
            );\n`;
        return code;
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        super.prepareDefines(mesh, nodeMaterial, defines);
        defines.setValue("ANISOTROPIC", true);
        defines.setValue("ANISOTROPIC_TEXTURE", false, true);
        defines.setValue("ANISOTROPIC_LEGACY", !this.roughness.isConnected);
    }
    bind(effect, nodeMaterial, mesh) {
        super.bind(effect, nodeMaterial, mesh);
        if (mesh) {
            effect.setFloat(this._tangentCorrectionFactorName, mesh.getWorldMatrix().determinant() < 0 ? -1 : 1);
        }
    }
    _buildBlock(state) {
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            state.sharedData.blocksWithDefines.push(this);
            state.sharedData.bindableBlocks.push(this);
            this._tangentCorrectionFactorName = state._getFreeDefineName("tangentCorrectionFactor");
            state._emitUniformFromString(this._tangentCorrectionFactorName, NodeMaterialBlockConnectionPointTypes.Float);
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.AnisotropyBlock", AnisotropyBlock);
//# sourceMappingURL=anisotropyBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/reflectionBlock.js









/**
 * Block used to implement the reflection module of the PBR material
 */
class ReflectionBlock extends ReflectionTextureBaseBlock {
    _onGenerateOnlyFragmentCodeChanged() {
        if (this.position.isConnected) {
            this.generateOnlyFragmentCode = !this.generateOnlyFragmentCode;
            logger/* Logger */.V.Error("The position input must not be connected to be able to switch!");
            return false;
        }
        this._setTarget();
        return true;
    }
    _setTarget() {
        super._setTarget();
        this.getInputByName("position").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex;
        if (this.generateOnlyFragmentCode) {
            this.forceIrradianceInFragment = true;
        }
    }
    /**
     * Create a new ReflectionBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Defines if the material uses spherical harmonics vs spherical polynomials for the
         * diffuse part of the IBL.
         */
        this.useSphericalHarmonics = true;
        /**
         * Force the shader to compute irradiance in the fragment shader in order to take bump in account.
         */
        this.forceIrradianceInFragment = false;
        this._isUnique = true;
        this.registerInput("position", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("world", NodeMaterialBlockConnectionPointTypes.Matrix, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("reflection", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("reflection", this, 1 /* NodeMaterialConnectionPointDirection.Output */, ReflectionBlock, "ReflectionBlock"));
        this.position.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ReflectionBlock";
    }
    /**
     * Gets the position input component
     */
    get position() {
        return this._inputs[0];
    }
    /**
     * Gets the world position input component
     */
    get worldPosition() {
        return this.worldPositionConnectionPoint;
    }
    /**
     * Gets the world normal input component
     */
    get worldNormal() {
        return this.worldNormalConnectionPoint;
    }
    /**
     * Gets the world input component
     */
    get world() {
        return this._inputs[1];
    }
    /**
     * Gets the camera (or eye) position component
     */
    get cameraPosition() {
        return this.cameraPositionConnectionPoint;
    }
    /**
     * Gets the view input component
     */
    get view() {
        return this.viewConnectionPoint;
    }
    /**
     * Gets the color input component
     */
    get color() {
        return this._inputs[2];
    }
    /**
     * Gets the reflection object output component
     */
    get reflection() {
        return this._outputs[0];
    }
    /**
     * Returns true if the block has a texture (either its own texture or the environment texture from the scene, if set)
     */
    get hasTexture() {
        return !!this._getTexture();
    }
    /**
     * Gets the reflection color (either the name of the variable if the color input is connected, else a default value)
     */
    get reflectionColor() {
        return this.color.isConnected ? this.color.associatedVariableName : "vec3(1., 1., 1.)";
    }
    _getTexture() {
        if (this.texture) {
            return this.texture;
        }
        return this._scene.environmentTexture;
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        super.prepareDefines(mesh, nodeMaterial, defines);
        const reflectionTexture = this._getTexture();
        const reflection = reflectionTexture && reflectionTexture.getTextureMatrix;
        defines.setValue("REFLECTION", reflection, true);
        if (!reflection) {
            return;
        }
        defines.setValue(this._defineLODReflectionAlpha, reflectionTexture.lodLevelInAlpha, true);
        defines.setValue(this._defineLinearSpecularReflection, reflectionTexture.linearSpecularLOD, true);
        defines.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem ? !reflectionTexture.invertZ : reflectionTexture.invertZ, true);
        defines.setValue("SPHERICAL_HARMONICS", this.useSphericalHarmonics, true);
        defines.setValue("GAMMAREFLECTION", reflectionTexture.gammaSpace, true);
        defines.setValue("RGBDREFLECTION", reflectionTexture.isRGBD, true);
        if (reflectionTexture && reflectionTexture.coordinatesMode !== Textures_texture/* Texture */.g.SKYBOX_MODE) {
            if (reflectionTexture.isCube) {
                defines.setValue("USESPHERICALFROMREFLECTIONMAP", true);
                defines.setValue("USEIRRADIANCEMAP", false);
                if (this.forceIrradianceInFragment || this._scene.getEngine().getCaps().maxVaryingVectors <= 8) {
                    defines.setValue("USESPHERICALINVERTEX", false);
                }
                else {
                    defines.setValue("USESPHERICALINVERTEX", true);
                }
            }
        }
    }
    bind(effect, nodeMaterial, mesh, subMesh) {
        super.bind(effect, nodeMaterial, mesh);
        const reflectionTexture = this._getTexture();
        if (!reflectionTexture || !subMesh) {
            return;
        }
        if (reflectionTexture.isCube) {
            effect.setTexture(this._cubeSamplerName, reflectionTexture);
        }
        else {
            effect.setTexture(this._2DSamplerName, reflectionTexture);
        }
        const width = reflectionTexture.getSize().width;
        effect.setFloat3(this._vReflectionMicrosurfaceInfosName, width, reflectionTexture.lodGenerationScale, reflectionTexture.lodGenerationOffset);
        effect.setFloat2(this._vReflectionFilteringInfoName, width, Math.log2(width));
        const defines = subMesh.materialDefines;
        const polynomials = reflectionTexture.sphericalPolynomial;
        if (defines.USESPHERICALFROMREFLECTIONMAP && polynomials) {
            if (defines.SPHERICAL_HARMONICS) {
                const preScaledHarmonics = polynomials.preScaledHarmonics;
                effect.setVector3("vSphericalL00", preScaledHarmonics.l00);
                effect.setVector3("vSphericalL1_1", preScaledHarmonics.l1_1);
                effect.setVector3("vSphericalL10", preScaledHarmonics.l10);
                effect.setVector3("vSphericalL11", preScaledHarmonics.l11);
                effect.setVector3("vSphericalL2_2", preScaledHarmonics.l2_2);
                effect.setVector3("vSphericalL2_1", preScaledHarmonics.l2_1);
                effect.setVector3("vSphericalL20", preScaledHarmonics.l20);
                effect.setVector3("vSphericalL21", preScaledHarmonics.l21);
                effect.setVector3("vSphericalL22", preScaledHarmonics.l22);
            }
            else {
                effect.setFloat3("vSphericalX", polynomials.x.x, polynomials.x.y, polynomials.x.z);
                effect.setFloat3("vSphericalY", polynomials.y.x, polynomials.y.y, polynomials.y.z);
                effect.setFloat3("vSphericalZ", polynomials.z.x, polynomials.z.y, polynomials.z.z);
                effect.setFloat3("vSphericalXX_ZZ", polynomials.xx.x - polynomials.zz.x, polynomials.xx.y - polynomials.zz.y, polynomials.xx.z - polynomials.zz.z);
                effect.setFloat3("vSphericalYY_ZZ", polynomials.yy.x - polynomials.zz.x, polynomials.yy.y - polynomials.zz.y, polynomials.yy.z - polynomials.zz.z);
                effect.setFloat3("vSphericalZZ", polynomials.zz.x, polynomials.zz.y, polynomials.zz.z);
                effect.setFloat3("vSphericalXY", polynomials.xy.x, polynomials.xy.y, polynomials.xy.z);
                effect.setFloat3("vSphericalYZ", polynomials.yz.x, polynomials.yz.y, polynomials.yz.z);
                effect.setFloat3("vSphericalZX", polynomials.zx.x, polynomials.zx.y, polynomials.zx.z);
            }
        }
    }
    /**
     * Gets the code to inject in the vertex shader
     * @param state current state of the node material building
     * @returns the shader code
     */
    handleVertexSide(state) {
        let code = super.handleVertexSide(state);
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        state._emitFunctionFromInclude("harmonicsFunctions", `//${this.name}`, {
            replaceStrings: [
                { search: /uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g, replace: "" },
                { search: /uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g, replace: "" },
            ],
        });
        const reflectionVectorName = state._getFreeVariableName("reflectionVector");
        this._vEnvironmentIrradianceName = state._getFreeVariableName("vEnvironmentIrradiance");
        state._emitVaryingFromString(this._vEnvironmentIrradianceName, NodeMaterialBlockConnectionPointTypes.Vector3, "defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)");
        state._emitUniformFromString("vSphericalL00", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS");
        state._emitUniformFromString("vSphericalL1_1", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS");
        state._emitUniformFromString("vSphericalL10", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS");
        state._emitUniformFromString("vSphericalL11", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS");
        state._emitUniformFromString("vSphericalL2_2", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS");
        state._emitUniformFromString("vSphericalL2_1", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS");
        state._emitUniformFromString("vSphericalL20", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS");
        state._emitUniformFromString("vSphericalL21", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS");
        state._emitUniformFromString("vSphericalL22", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS");
        state._emitUniformFromString("vSphericalX", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS", true);
        state._emitUniformFromString("vSphericalY", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS", true);
        state._emitUniformFromString("vSphericalZ", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS", true);
        state._emitUniformFromString("vSphericalXX_ZZ", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS", true);
        state._emitUniformFromString("vSphericalYY_ZZ", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS", true);
        state._emitUniformFromString("vSphericalZZ", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS", true);
        state._emitUniformFromString("vSphericalXY", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS", true);
        state._emitUniformFromString("vSphericalYZ", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS", true);
        state._emitUniformFromString("vSphericalZX", NodeMaterialBlockConnectionPointTypes.Vector3, "SPHERICAL_HARMONICS", true);
        code += `#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
                ${state._declareLocalVar(reflectionVectorName, NodeMaterialBlockConnectionPointTypes.Vector3)} = (${(isWebGPU ? "uniforms." : "") + this._reflectionMatrixName} * vec4${state.fSuffix}(normalize(${this.worldNormal.associatedVariableName}).xyz, 0)).xyz;
                #ifdef ${this._defineOppositeZ}
                    ${reflectionVectorName}.z *= -1.0;
                #endif
                ${isWebGPU ? "vertexOutputs." : ""}${this._vEnvironmentIrradianceName} = computeEnvironmentIrradiance(${reflectionVectorName});
            #endif\n`;
        return code;
    }
    /**
     * Gets the main code of the block (fragment side)
     * @param state current state of the node material building
     * @param normalVarName name of the existing variable corresponding to the normal
     * @returns the shader code
     */
    getCode(state, normalVarName) {
        let code = "";
        this.handleFragmentSideInits(state);
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        state._emitFunctionFromInclude("harmonicsFunctions", `//${this.name}`, {
            replaceStrings: [
                { search: /uniform vec3 vSphericalL00;[\s\S]*?uniform vec3 vSphericalL22;/g, replace: "" },
                { search: /uniform vec3 vSphericalX;[\s\S]*?uniform vec3 vSphericalZX;/g, replace: "" },
            ],
        });
        if (!isWebGPU) {
            state._emitFunction("sampleReflection", `
                #ifdef ${this._define3DName}
                    #define sampleReflection(s, c) textureCube(s, c)
                #else
                    #define sampleReflection(s, c) texture2D(s, c)
                #endif\n`, `//${this.name}`);
            state._emitFunction("sampleReflectionLod", `
                #ifdef ${this._define3DName}
                    #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)
                #else
                    #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)
                #endif\n`, `//${this.name}`);
        }
        const computeReflectionCoordsFunc = isWebGPU
            ? `
            fn computeReflectionCoordsPBR(worldPos: vec4f, worldNormal: vec3f) -> vec3f {
                ${this.handleFragmentSideCodeReflectionCoords(state, "worldNormal", "worldPos", true, true)}
                return ${this._reflectionVectorName};
            }\n`
            : `
            vec3 computeReflectionCoordsPBR(vec4 worldPos, vec3 worldNormal) {
                ${this.handleFragmentSideCodeReflectionCoords(state, "worldNormal", "worldPos", true, true)}
                return ${this._reflectionVectorName};
            }\n`;
        state._emitFunction("computeReflectionCoordsPBR", computeReflectionCoordsFunc, `//${this.name}`);
        this._vReflectionMicrosurfaceInfosName = state._getFreeVariableName("vReflectionMicrosurfaceInfos");
        state._emitUniformFromString(this._vReflectionMicrosurfaceInfosName, NodeMaterialBlockConnectionPointTypes.Vector3);
        this._vReflectionInfosName = state._getFreeVariableName("vReflectionInfos");
        this._vReflectionFilteringInfoName = state._getFreeVariableName("vReflectionFilteringInfo");
        state._emitUniformFromString(this._vReflectionFilteringInfoName, NodeMaterialBlockConnectionPointTypes.Vector2);
        code += `#ifdef REFLECTION
            ${state._declareLocalVar(this._vReflectionInfosName, NodeMaterialBlockConnectionPointTypes.Vector2)} = vec2${state.fSuffix}(1., 0.);

            ${isWebGPU ? "var reflectionOut: reflectionOutParams" : "reflectionOutParams reflectionOut"};

            reflectionOut = reflectionBlock(
                ${this.generateOnlyFragmentCode ? this._worldPositionNameInFragmentOnlyMode : (isWebGPU ? "input." : "") + "v_" + this.worldPosition.associatedVariableName}.xyz
                , ${normalVarName}
                , alphaG
                , ${(isWebGPU ? "uniforms." : "") + this._vReflectionMicrosurfaceInfosName}
                , ${this._vReflectionInfosName}
                , ${this.reflectionColor}
            #ifdef ANISOTROPIC
                ,anisotropicOut
            #endif
            #if defined(${this._defineLODReflectionAlpha}) && !defined(${this._defineSkyboxName})
                ,NdotVUnclamped
            #endif
            #ifdef ${this._defineLinearSpecularReflection}
                , roughness
            #endif
            #ifdef ${this._define3DName}
                , ${this._cubeSamplerName}
                ${isWebGPU ? `, ${this._cubeSamplerName}Sampler` : ""}
            #else
                , ${this._2DSamplerName}
                ${isWebGPU ? `, ${this._2DSamplerName}Sampler` : ""}
            #endif
            #if defined(NORMAL) && defined(USESPHERICALINVERTEX)
                , ${isWebGPU ? "input." : ""}${this._vEnvironmentIrradianceName}
            #endif
            #ifdef USESPHERICALFROMREFLECTIONMAP
                #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
                    , ${this._reflectionMatrixName}
                #endif
            #endif
            #ifdef USEIRRADIANCEMAP
                , irradianceSampler         // ** not handled **
                ${isWebGPU ? `, irradianceSamplerSampler` : ""}
            #endif
            #ifndef LODBASEDMICROSFURACE
                #ifdef ${this._define3DName}
                    , ${this._cubeSamplerName}
                    ${isWebGPU ? `, ${this._cubeSamplerName}Sampler` : ""}
                    , ${this._cubeSamplerName}
                    ${isWebGPU ? `, ${this._cubeSamplerName}Sampler` : ""}
                #else
                    , ${this._2DSamplerName}
                    ${isWebGPU ? `, ${this._2DSamplerName}Sampler` : ""}
                    , ${this._2DSamplerName}                    
                    ${isWebGPU ? `, ${this._2DSamplerName}Sampler` : ""}
                #endif
            #endif
            #ifdef REALTIME_FILTERING
                , ${this._vReflectionFilteringInfoName}
            #endif
            );
        #endif\n`;
        return code;
    }
    _buildBlock(state) {
        this._scene = state.sharedData.scene;
        if (state.target !== NodeMaterialBlockTargets.Fragment) {
            this._defineLODReflectionAlpha = state._getFreeDefineName("LODINREFLECTIONALPHA");
            this._defineLinearSpecularReflection = state._getFreeDefineName("LINEARSPECULARREFLECTION");
        }
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        if (this.texture) {
            codeString += `${this._codeVariableName}.texture.gammaSpace = ${this.texture.gammaSpace};\n`;
        }
        codeString += `${this._codeVariableName}.useSphericalHarmonics = ${this.useSphericalHarmonics};\n`;
        codeString += `${this._codeVariableName}.forceIrradianceInFragment = ${this.forceIrradianceInFragment};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.useSphericalHarmonics = this.useSphericalHarmonics;
        serializationObject.forceIrradianceInFragment = this.forceIrradianceInFragment;
        serializationObject.gammaSpace = this.texture?.gammaSpace ?? true;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.useSphericalHarmonics = serializationObject.useSphericalHarmonics;
        this.forceIrradianceInFragment = serializationObject.forceIrradianceInFragment;
        if (this.texture) {
            this.texture.gammaSpace = serializationObject.gammaSpace;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Spherical Harmonics", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { update: true } })
], ReflectionBlock.prototype, "useSphericalHarmonics", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Force irradiance in fragment", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { update: true } })
], ReflectionBlock.prototype, "forceIrradianceInFragment", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ReflectionBlock", ReflectionBlock);
//# sourceMappingURL=reflectionBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/clearCoatBlock.js










/**
 * Block used to implement the clear coat module of the PBR material
 */
class ClearCoatBlock extends NodeMaterialBlock {
    /**
     * Create a new ClearCoatBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this._tangentCorrectionFactorName = "";
        /**
         * Defines if the F0 value should be remapped to account for the interface change in the material.
         */
        this.remapF0OnInterfaceChange = true;
        this._isUnique = true;
        this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("roughness", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("indexOfRefraction", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("normalMapColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("uv", NodeMaterialBlockConnectionPointTypes.Vector2, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("tintColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("tintAtDistance", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("tintThickness", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("worldTangent", NodeMaterialBlockConnectionPointTypes.Vector4, true);
        this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.worldNormal.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Vector3);
        this.registerInput("TBN", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("TBN", this, 0 /* NodeMaterialConnectionPointDirection.Input */, TBNBlock, "TBNBlock"));
        this.registerOutput("clearcoat", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("clearcoat", this, 1 /* NodeMaterialConnectionPointDirection.Output */, ClearCoatBlock, "ClearCoatBlock"));
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("clearcoatOut");
        state._excludeVariableName("vClearCoatParams");
        state._excludeVariableName("vClearCoatTintParams");
        state._excludeVariableName("vClearCoatRefractionParams");
        state._excludeVariableName("vClearCoatTangentSpaceParams");
        state._excludeVariableName("vGeometricNormaClearCoatW");
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ClearCoatBlock";
    }
    /**
     * Gets the intensity input component
     */
    get intensity() {
        return this._inputs[0];
    }
    /**
     * Gets the roughness input component
     */
    get roughness() {
        return this._inputs[1];
    }
    /**
     * Gets the ior input component
     */
    get indexOfRefraction() {
        return this._inputs[2];
    }
    /**
     * Gets the bump texture input component
     */
    get normalMapColor() {
        return this._inputs[3];
    }
    /**
     * Gets the uv input component
     */
    get uv() {
        return this._inputs[4];
    }
    /**
     * Gets the tint color input component
     */
    get tintColor() {
        return this._inputs[5];
    }
    /**
     * Gets the tint "at distance" input component
     */
    get tintAtDistance() {
        return this._inputs[6];
    }
    /**
     * Gets the tint thickness input component
     */
    get tintThickness() {
        return this._inputs[7];
    }
    /**
     * Gets the world tangent input component
     */
    get worldTangent() {
        return this._inputs[8];
    }
    /**
     * Gets the world normal input component
     */
    get worldNormal() {
        return this._inputs[9];
    }
    /**
     * Gets the TBN input component
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    get TBN() {
        return this._inputs[10];
    }
    /**
     * Gets the clear coat object output component
     */
    get clearcoat() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.intensity.isConnected) {
            const intensityInput = new InputBlock("ClearCoat intensity", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);
            intensityInput.value = 1;
            intensityInput.output.connectTo(this.intensity);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        super.prepareDefines(mesh, nodeMaterial, defines);
        defines.setValue("CLEARCOAT", true);
        defines.setValue("CLEARCOAT_TEXTURE", false, true);
        defines.setValue("CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE", true, true);
        defines.setValue("CLEARCOAT_TINT", this.tintColor.isConnected || this.tintThickness.isConnected || this.tintAtDistance.isConnected, true);
        defines.setValue("CLEARCOAT_BUMP", this.normalMapColor.isConnected, true);
        defines.setValue("CLEARCOAT_DEFAULTIOR", this.indexOfRefraction.isConnected ? this.indexOfRefraction.connectInputBlock.value === pbrClearCoatConfiguration/* PBRClearCoatConfiguration */.t._DefaultIndexOfRefraction : true, true);
        defines.setValue("CLEARCOAT_REMAP_F0", this.remapF0OnInterfaceChange, true);
    }
    bind(effect, nodeMaterial, mesh) {
        super.bind(effect, nodeMaterial, mesh);
        // Clear Coat Refraction params
        const indexOfRefraction = this.indexOfRefraction.connectInputBlock?.value ?? pbrClearCoatConfiguration/* PBRClearCoatConfiguration */.t._DefaultIndexOfRefraction;
        const a = 1 - indexOfRefraction;
        const b = 1 + indexOfRefraction;
        const f0 = Math.pow(-a / b, 2); // Schlicks approx: (ior1 - ior2) / (ior1 + ior2) where ior2 for air is close to vacuum = 1.
        const eta = 1 / indexOfRefraction;
        effect.setFloat4("vClearCoatRefractionParams", f0, eta, a, b);
        // Clear Coat tangent space params
        const mainPBRBlock = this.clearcoat.hasEndpoints ? this.clearcoat.endpoints[0].ownerBlock : null;
        const perturbedNormalBlock = mainPBRBlock?.perturbedNormal.isConnected ? mainPBRBlock.perturbedNormal.connectedPoint.ownerBlock : null;
        if (this._scene._mirroredCameraPosition) {
            effect.setFloat2("vClearCoatTangentSpaceParams", perturbedNormalBlock?.invertX ? 1.0 : -1.0, perturbedNormalBlock?.invertY ? 1.0 : -1.0);
        }
        else {
            effect.setFloat2("vClearCoatTangentSpaceParams", perturbedNormalBlock?.invertX ? -1.0 : 1.0, perturbedNormalBlock?.invertY ? -1.0 : 1.0);
        }
        if (mesh) {
            effect.setFloat(this._tangentCorrectionFactorName, mesh.getWorldMatrix().determinant() < 0 ? -1 : 1);
        }
    }
    _generateTBNSpace(state, worldPositionVarName, worldNormalVarName) {
        let code = "";
        const comments = `//${this.name}`;
        const worldTangent = this.worldTangent;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        if (!isWebGPU) {
            state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
        }
        const tangentReplaceString = { search: /defined\(TANGENT\)/g, replace: worldTangent.isConnected ? "defined(TANGENT)" : "defined(IGNORE)" };
        const TBN = this.TBN;
        if (TBN.isConnected) {
            state.compilationString += `
            #ifdef TBNBLOCK
                ${isWebGPU ? "var TBN" : "mat3 TBN"} = ${TBN.associatedVariableName};
            #endif
            `;
        }
        else if (worldTangent.isConnected) {
            code += `${state._declareLocalVar("tbnNormal", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${worldNormalVarName}.xyz);\n`;
            code += `${state._declareLocalVar("tbnTangent", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${worldTangent.associatedVariableName}.xyz);\n`;
            code += `${state._declareLocalVar("tbnBitangent", NodeMaterialBlockConnectionPointTypes.Vector3)} = cross(tbnNormal, tbnTangent) * ${this._tangentCorrectionFactorName};\n`;
            code += `${isWebGPU ? "var vTBN" : "mat3 vTBN"} = ${isWebGPU ? "mat3x3f" : "mat3"}(tbnTangent, tbnBitangent, tbnNormal);\n`;
        }
        state._emitFunctionFromInclude("bumpFragmentMainFunctions", comments, {
            replaceStrings: [tangentReplaceString],
        });
        return code;
    }
    /**
     * Gets the main code of the block (fragment side)
     * @param state current state of the node material building
     * @param ccBlock instance of a ClearCoatBlock or null if the code must be generated without an active clear coat module
     * @param reflectionBlock instance of a ReflectionBlock null if the code must be generated without an active reflection module
     * @param worldPosVarName name of the variable holding the world position
     * @param generateTBNSpace if true, the code needed to create the TBN coordinate space is generated
     * @param vTBNAvailable indicate that the vTBN variable is already existing because it has already been generated by another block (PerturbNormal or Anisotropy)
     * @param worldNormalVarName name of the variable holding the world normal
     * @returns the shader code
     */
    static GetCode(state, ccBlock, reflectionBlock, worldPosVarName, generateTBNSpace, vTBNAvailable, worldNormalVarName) {
        let code = "";
        const intensity = ccBlock?.intensity.isConnected ? ccBlock.intensity.associatedVariableName : "1.";
        const roughness = ccBlock?.roughness.isConnected ? ccBlock.roughness.associatedVariableName : "0.";
        const normalMapColor = ccBlock?.normalMapColor.isConnected ? ccBlock.normalMapColor.associatedVariableName : `vec3${state.fSuffix}(0.)`;
        const uv = ccBlock?.uv.isConnected ? ccBlock.uv.associatedVariableName : `vec2${state.fSuffix}(0.)`;
        const tintColor = ccBlock?.tintColor.isConnected ? ccBlock.tintColor.associatedVariableName : `vec3${state.fSuffix}(1.)`;
        const tintThickness = ccBlock?.tintThickness.isConnected ? ccBlock.tintThickness.associatedVariableName : "1.";
        const tintAtDistance = ccBlock?.tintAtDistance.isConnected ? ccBlock.tintAtDistance.associatedVariableName : "1.";
        const tintTexture = `vec4${state.fSuffix}(0.)`;
        if (ccBlock) {
            state._emitUniformFromString("vClearCoatRefractionParams", NodeMaterialBlockConnectionPointTypes.Vector4);
            state._emitUniformFromString("vClearCoatTangentSpaceParams", NodeMaterialBlockConnectionPointTypes.Vector2);
            const normalShading = ccBlock.worldNormal;
            code += `${state._declareLocalVar("vGeometricNormaClearCoatW", NodeMaterialBlockConnectionPointTypes.Vector3)} = ${normalShading.isConnected ? "normalize(" + normalShading.associatedVariableName + ".xyz)" : "geometricNormalW"};\n`;
        }
        else {
            code += `${state._declareLocalVar("vGeometricNormaClearCoatW", NodeMaterialBlockConnectionPointTypes.Vector3)} = geometricNormalW;\n`;
        }
        if (generateTBNSpace && ccBlock) {
            code += ccBlock._generateTBNSpace(state, worldPosVarName, worldNormalVarName);
            vTBNAvailable = ccBlock.worldTangent.isConnected;
        }
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        code += `${isWebGPU ? "var clearcoatOut: clearcoatOutParams" : "clearcoatOutParams clearcoatOut"};

        #ifdef CLEARCOAT
            ${state._declareLocalVar("vClearCoatParams", NodeMaterialBlockConnectionPointTypes.Vector2)} = vec2${state.fSuffix}(${intensity}, ${roughness});
            ${state._declareLocalVar("vClearCoatTintParams", NodeMaterialBlockConnectionPointTypes.Vector4)} = vec4${state.fSuffix}(${tintColor}, ${tintThickness});

            clearcoatOut = clearcoatBlock(
                ${worldPosVarName}.xyz
                , vGeometricNormaClearCoatW
                , viewDirectionW
                , vClearCoatParams
                , specularEnvironmentR0
            #ifdef CLEARCOAT_TEXTURE
                , vec2${state.fSuffix}(0.)
            #endif
            #ifdef CLEARCOAT_TINT
                , vClearCoatTintParams
                , ${tintAtDistance}
                , ${isWebGPU ? "uniforms." : ""}vClearCoatRefractionParams
                #ifdef CLEARCOAT_TINT_TEXTURE
                    , ${tintTexture}
                #endif
            #endif
            #ifdef CLEARCOAT_BUMP
                , vec2${state.fSuffix}(0., 1.)
                , vec4${state.fSuffix}(${normalMapColor}, 0.)
                , ${uv}
                #if defined(${vTBNAvailable ? "TANGENT" : "IGNORE"}) && defined(NORMAL)
                    , vTBN
                #else
                    , ${isWebGPU ? "uniforms." : ""}vClearCoatTangentSpaceParams
                #endif
                #ifdef OBJECTSPACE_NORMALMAP
                    , normalMatrix
                #endif
            #endif
            #if defined(FORCENORMALFORWARD) && defined(NORMAL)
                , faceNormal
            #endif
            #ifdef REFLECTION
                , ${isWebGPU ? "uniforms." : ""}${reflectionBlock?._vReflectionMicrosurfaceInfosName}
                , ${reflectionBlock?._vReflectionInfosName}
                , ${reflectionBlock?.reflectionColor}
                , ${isWebGPU ? "uniforms." : ""}vLightingIntensity
                #ifdef ${reflectionBlock?._define3DName}
                    , ${reflectionBlock?._cubeSamplerName}       
                    ${isWebGPU ? `, ${reflectionBlock?._cubeSamplerName}Sampler` : ""}
                #else
                    , ${reflectionBlock?._2DSamplerName}       
                    ${isWebGPU ? `, ${reflectionBlock?._2DSamplerName}Sampler` : ""}
                #endif
                #ifndef LODBASEDMICROSFURACE
                    #ifdef ${reflectionBlock?._define3DName}
                        , ${reflectionBlock?._cubeSamplerName}       
                        ${isWebGPU ? `, ${reflectionBlock?._cubeSamplerName}Sampler` : ""}
                        , ${reflectionBlock?._cubeSamplerName}
                        ${isWebGPU ? `, ${reflectionBlock?._cubeSamplerName}Sampler` : ""}
                    #else
                        , ${reflectionBlock?._2DSamplerName}
                        ${isWebGPU ? `, ${reflectionBlock?._2DSamplerName}Sampler` : ""}
                        , ${reflectionBlock?._2DSamplerName}
                        ${isWebGPU ? `, ${reflectionBlock?._2DSamplerName}Sampler` : ""}                        
                    #endif
                #endif
            #endif
            #if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)
                , (${state._generateTernary("1.", "-1.", isWebGPU ? "fragmentInputs.frontFacing" : "gl_FrontFacing")})
            #endif
            );
        #else
            clearcoatOut.specularEnvironmentR0 = specularEnvironmentR0;
        #endif\n`;
        return code;
    }
    _buildBlock(state) {
        this._scene = state.sharedData.scene;
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            state.sharedData.bindableBlocks.push(this);
            state.sharedData.blocksWithDefines.push(this);
            this._tangentCorrectionFactorName = state._getFreeDefineName("tangentCorrectionFactor");
            state._emitUniformFromString(this._tangentCorrectionFactorName, NodeMaterialBlockConnectionPointTypes.Float);
        }
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.remapF0OnInterfaceChange = ${this.remapF0OnInterfaceChange};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.remapF0OnInterfaceChange = this.remapF0OnInterfaceChange;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.remapF0OnInterfaceChange = serializationObject.remapF0OnInterfaceChange ?? true;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Remap F0 on interface change", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true })
], ClearCoatBlock.prototype, "remapF0OnInterfaceChange", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ClearCoatBlock", ClearCoatBlock);
//# sourceMappingURL=clearCoatBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/iridescenceBlock.js







/**
 * Block used to implement the iridescence module of the PBR material
 */
class IridescenceBlock extends NodeMaterialBlock {
    /**
     * Create a new IridescenceBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this._isUnique = true;
        this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("indexOfRefraction", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("thickness", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("iridescence", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("iridescence", this, 1 /* NodeMaterialConnectionPointDirection.Output */, IridescenceBlock, "IridescenceBlock"));
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("iridescenceOut");
        state._excludeVariableName("vIridescenceParams");
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "IridescenceBlock";
    }
    /**
     * Gets the intensity input component
     */
    get intensity() {
        return this._inputs[0];
    }
    /**
     * Gets the indexOfRefraction input component
     */
    get indexOfRefraction() {
        return this._inputs[1];
    }
    /**
     * Gets the thickness input component
     */
    get thickness() {
        return this._inputs[2];
    }
    /**
     * Gets the iridescence object output component
     */
    get iridescence() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.intensity.isConnected) {
            const intensityInput = new InputBlock("Iridescence intensity", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);
            intensityInput.value = 1;
            intensityInput.output.connectTo(this.intensity);
            const indexOfRefractionInput = new InputBlock("Iridescence ior", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);
            indexOfRefractionInput.value = 1.3;
            indexOfRefractionInput.output.connectTo(this.indexOfRefraction);
            const thicknessInput = new InputBlock("Iridescence thickness", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);
            thicknessInput.value = 400;
            thicknessInput.output.connectTo(this.thickness);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        super.prepareDefines(mesh, nodeMaterial, defines);
        defines.setValue("IRIDESCENCE", true, true);
        defines.setValue("IRIDESCENCE_TEXTURE", false, true);
        defines.setValue("IRIDESCENCE_THICKNESS_TEXTURE", false, true);
    }
    /**
     * Gets the main code of the block (fragment side)
     * @param iridescenceBlock instance of a IridescenceBlock or null if the code must be generated without an active iridescence module
     * @param state defines the build state
     * @returns the shader code
     */
    static GetCode(iridescenceBlock, state) {
        let code = "";
        const intensityName = iridescenceBlock?.intensity.isConnected ? iridescenceBlock.intensity.associatedVariableName : "1.";
        const indexOfRefraction = iridescenceBlock?.indexOfRefraction.isConnected
            ? iridescenceBlock.indexOfRefraction.associatedVariableName
            : pbrIridescenceConfiguration/* PBRIridescenceConfiguration */.z._DefaultIndexOfRefraction;
        const thickness = iridescenceBlock?.thickness.isConnected ? iridescenceBlock.thickness.associatedVariableName : pbrIridescenceConfiguration/* PBRIridescenceConfiguration */.z._DefaultMaximumThickness;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        code += `${isWebGPU ? "var iridescenceOut: iridescenceOutParams" : "iridescenceOutParams iridescenceOut"};

        #ifdef IRIDESCENCE
            iridescenceOut = iridescenceBlock(
                vec4(${intensityName}, ${indexOfRefraction}, 1., ${thickness})
                , NdotV
                , specularEnvironmentR0
                #ifdef CLEARCOAT
                    , NdotVUnclamped
                #endif                
            );

            float iridescenceIntensity = iridescenceOut.iridescenceIntensity;
            specularEnvironmentR0 = iridescenceOut.specularEnvironmentR0;
        #endif\n`;
        return code;
    }
    _buildBlock(state) {
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            state.sharedData.bindableBlocks.push(this);
            state.sharedData.blocksWithDefines.push(this);
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.IridescenceBlock", IridescenceBlock);
//# sourceMappingURL=iridescenceBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/refractionBlock.js











/**
 * Block used to implement the refraction part of the sub surface module of the PBR material
 */
class RefractionBlock extends NodeMaterialBlock {
    /**
     * Create a new RefractionBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        /**
         * This parameters will make the material used its opacity to control how much it is refracting against not.
         * Materials half opaque for instance using refraction could benefit from this control.
         */
        this.linkRefractionWithTransparency = false;
        /**
         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
         */
        this.invertRefractionY = false;
        /**
         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
         */
        this.useThicknessAsDepth = false;
        this._isUnique = true;
        this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("tintAtDistance", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("volumeIndexOfRefraction", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("refraction", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("refraction", this, 1 /* NodeMaterialConnectionPointDirection.Output */, RefractionBlock, "RefractionBlock"));
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("vRefractionPosition");
        state._excludeVariableName("vRefractionSize");
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "RefractionBlock";
    }
    /**
     * Gets the intensity input component
     */
    get intensity() {
        return this._inputs[0];
    }
    /**
     * Gets the tint at distance input component
     */
    get tintAtDistance() {
        return this._inputs[1];
    }
    /**
     * Gets the volume index of refraction input component
     */
    get volumeIndexOfRefraction() {
        return this._inputs[2];
    }
    /**
     * Gets the view input component
     */
    get view() {
        return this.viewConnectionPoint;
    }
    /**
     * Gets the refraction object output component
     */
    get refraction() {
        return this._outputs[0];
    }
    /**
     * Returns true if the block has a texture
     */
    get hasTexture() {
        return !!this._getTexture();
    }
    _getTexture() {
        if (this.texture) {
            return this.texture;
        }
        return this._scene.environmentTexture;
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.intensity.isConnected) {
            const intensityInput = new InputBlock("Refraction intensity", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);
            intensityInput.value = 1;
            intensityInput.output.connectTo(this.intensity);
        }
        if (this.view && !this.view.isConnected) {
            let viewInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.View && additionalFilteringInfo(b));
            if (!viewInput) {
                viewInput = new InputBlock("view");
                viewInput.setAsSystemValue(NodeMaterialSystemValues.View);
            }
            viewInput.output.connectTo(this.view);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        super.prepareDefines(mesh, nodeMaterial, defines);
        const refractionTexture = this._getTexture();
        const refraction = refractionTexture && refractionTexture.getTextureMatrix;
        defines.setValue("SS_REFRACTION", refraction, true);
        if (!refraction) {
            return;
        }
        defines.setValue(this._define3DName, refractionTexture.isCube, true);
        defines.setValue(this._defineLODRefractionAlpha, refractionTexture.lodLevelInAlpha, true);
        defines.setValue(this._defineLinearSpecularRefraction, refractionTexture.linearSpecularLOD, true);
        defines.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem && refractionTexture.isCube ? !refractionTexture.invertZ : refractionTexture.invertZ, true);
        defines.setValue("SS_LINKREFRACTIONTOTRANSPARENCY", this.linkRefractionWithTransparency, true);
        defines.setValue("SS_GAMMAREFRACTION", refractionTexture.gammaSpace, true);
        defines.setValue("SS_RGBDREFRACTION", refractionTexture.isRGBD, true);
        defines.setValue("SS_USE_LOCAL_REFRACTIONMAP_CUBIC", refractionTexture.boundingBoxSize ? true : false, true);
        defines.setValue("SS_USE_THICKNESS_AS_DEPTH", this.useThicknessAsDepth, true);
    }
    isReady() {
        const texture = this._getTexture();
        if (texture && !texture.isReadyOrNotBlocking()) {
            return false;
        }
        return true;
    }
    bind(effect, nodeMaterial, mesh) {
        super.bind(effect, nodeMaterial, mesh);
        const refractionTexture = this._getTexture();
        if (!refractionTexture) {
            return;
        }
        if (refractionTexture.isCube) {
            effect.setTexture(this._cubeSamplerName, refractionTexture);
        }
        else {
            effect.setTexture(this._2DSamplerName, refractionTexture);
        }
        effect.setMatrix(this._refractionMatrixName, refractionTexture.getRefractionTextureMatrix());
        let depth = 1.0;
        if (!refractionTexture.isCube) {
            if (refractionTexture.depth) {
                depth = refractionTexture.depth;
            }
        }
        const indexOfRefraction = this.volumeIndexOfRefraction.connectInputBlock?.value ?? this.indexOfRefractionConnectionPoint.connectInputBlock?.value ?? 1.5;
        effect.setFloat4(this._vRefractionInfosName, refractionTexture.level, 1 / indexOfRefraction, depth, this.invertRefractionY ? -1 : 1);
        effect.setFloat4(this._vRefractionMicrosurfaceInfosName, refractionTexture.getSize().width, refractionTexture.lodGenerationScale, refractionTexture.lodGenerationOffset, 1 / indexOfRefraction);
        const width = refractionTexture.getSize().width;
        effect.setFloat2(this._vRefractionFilteringInfoName, width, Math.log2(width));
        if (refractionTexture.boundingBoxSize) {
            const cubeTexture = refractionTexture;
            effect.setVector3("vRefractionPosition", cubeTexture.boundingBoxPosition);
            effect.setVector3("vRefractionSize", cubeTexture.boundingBoxSize);
        }
    }
    /**
     * Gets the main code of the block (fragment side)
     * @param state current state of the node material building
     * @returns the shader code
     */
    getCode(state) {
        const code = "";
        state.sharedData.blockingBlocks.push(this);
        state.sharedData.textureBlocks.push(this);
        // Samplers
        this._cubeSamplerName = state._getFreeVariableName(this.name + "CubeSampler");
        state.samplers.push(this._cubeSamplerName);
        this._2DSamplerName = state._getFreeVariableName(this.name + "2DSampler");
        state.samplers.push(this._2DSamplerName);
        this._define3DName = state._getFreeDefineName("SS_REFRACTIONMAP_3D");
        const refractionTexture = this._getTexture();
        if (refractionTexture) {
            state._samplerDeclaration += `#ifdef ${this._define3DName}\n`;
            state._emitCubeSampler(this._cubeSamplerName, undefined, true);
            state._samplerDeclaration += `#else\n`;
            state._emit2DSampler(this._2DSamplerName, undefined, true);
            state._samplerDeclaration += `#endif\n`;
        }
        // Fragment
        state.sharedData.blocksWithDefines.push(this);
        state.sharedData.bindableBlocks.push(this);
        this._defineLODRefractionAlpha = state._getFreeDefineName("SS_LODINREFRACTIONALPHA");
        this._defineLinearSpecularRefraction = state._getFreeDefineName("SS_LINEARSPECULARREFRACTION");
        this._defineOppositeZ = state._getFreeDefineName("SS_REFRACTIONMAP_OPPOSITEZ");
        this._refractionMatrixName = state._getFreeVariableName("refractionMatrix");
        state._emitUniformFromString(this._refractionMatrixName, NodeMaterialBlockConnectionPointTypes.Matrix);
        if (state.shaderLanguage !== 1 /* ShaderLanguage.WGSL */) {
            state._emitFunction("sampleRefraction", `
                #ifdef ${this._define3DName}
                    #define sampleRefraction(s, c) textureCube(s, c)
                #else
                    #define sampleRefraction(s, c) texture2D(s, c)
                #endif\n`, `//${this.name}`);
            state._emitFunction("sampleRefractionLod", `
                #ifdef ${this._define3DName}
                    #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)
                #else
                    #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)
                #endif\n`, `//${this.name}`);
        }
        this._vRefractionMicrosurfaceInfosName = state._getFreeVariableName("vRefractionMicrosurfaceInfos");
        state._emitUniformFromString(this._vRefractionMicrosurfaceInfosName, NodeMaterialBlockConnectionPointTypes.Vector4);
        this._vRefractionInfosName = state._getFreeVariableName("vRefractionInfos");
        state._emitUniformFromString(this._vRefractionInfosName, NodeMaterialBlockConnectionPointTypes.Vector4);
        this._vRefractionFilteringInfoName = state._getFreeVariableName("vRefractionFilteringInfo");
        state._emitUniformFromString(this._vRefractionFilteringInfoName, NodeMaterialBlockConnectionPointTypes.Vector2);
        state._emitUniformFromString("vRefractionPosition", NodeMaterialBlockConnectionPointTypes.Vector3);
        state._emitUniformFromString("vRefractionSize", NodeMaterialBlockConnectionPointTypes.Vector3);
        return code;
    }
    _buildBlock(state) {
        this._scene = state.sharedData.scene;
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        if (this.texture) {
            if (this.texture.isCube) {
                codeString = `${this._codeVariableName}.texture = new BABYLON.CubeTexture("${this.texture.name}");\n`;
            }
            else {
                codeString = `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}");\n`;
            }
            codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`;
        }
        codeString += `${this._codeVariableName}.linkRefractionWithTransparency = ${this.linkRefractionWithTransparency};\n`;
        codeString += `${this._codeVariableName}.invertRefractionY = ${this.invertRefractionY};\n`;
        codeString += `${this._codeVariableName}.useThicknessAsDepth = ${this.useThicknessAsDepth};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        if (this.texture && !this.texture.isRenderTarget) {
            serializationObject.texture = this.texture.serialize();
        }
        serializationObject.linkRefractionWithTransparency = this.linkRefractionWithTransparency;
        serializationObject.invertRefractionY = this.invertRefractionY;
        serializationObject.useThicknessAsDepth = this.useThicknessAsDepth;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        if (serializationObject.texture) {
            rootUrl = serializationObject.texture.url.indexOf("data:") === 0 ? "" : rootUrl;
            if (serializationObject.texture.isCube) {
                this.texture = Textures_cubeTexture/* CubeTexture */.b.Parse(serializationObject.texture, scene, rootUrl);
            }
            else {
                this.texture = Textures_texture/* Texture */.g.Parse(serializationObject.texture, scene, rootUrl);
            }
        }
        this.linkRefractionWithTransparency = serializationObject.linkRefractionWithTransparency;
        this.invertRefractionY = serializationObject.invertRefractionY;
        this.useThicknessAsDepth = !!serializationObject.useThicknessAsDepth;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Link refraction to transparency", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { update: true } })
], RefractionBlock.prototype, "linkRefractionWithTransparency", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Invert refraction Y", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { update: true } })
], RefractionBlock.prototype, "invertRefractionY", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Use thickness as depth", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { update: true } })
], RefractionBlock.prototype, "useThicknessAsDepth", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.RefractionBlock", RefractionBlock);
//# sourceMappingURL=refractionBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/subSurfaceBlock.js







/**
 * Block used to implement the sub surface module of the PBR material
 */
class SubSurfaceBlock extends NodeMaterialBlock {
    /**
     * Create a new SubSurfaceBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Fragment);
        this._isUnique = true;
        this.registerInput("thickness", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("tintColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("translucencyIntensity", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("translucencyDiffusionDist", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("refraction", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("refraction", this, 0 /* NodeMaterialConnectionPointDirection.Input */, RefractionBlock, "RefractionBlock"));
        this.registerInput("dispersion", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("subsurface", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("subsurface", this, 1 /* NodeMaterialConnectionPointDirection.Output */, SubSurfaceBlock, "SubSurfaceBlock"));
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("subSurfaceOut");
        state._excludeVariableName("vThicknessParam");
        state._excludeVariableName("vTintColor");
        state._excludeVariableName("vTranslucencyColor");
        state._excludeVariableName("vSubSurfaceIntensity");
        state._excludeVariableName("dispersion");
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SubSurfaceBlock";
    }
    /**
     * Gets the thickness component
     */
    get thickness() {
        return this._inputs[0];
    }
    /**
     * Gets the tint color input component
     */
    get tintColor() {
        return this._inputs[1];
    }
    /**
     * Gets the translucency intensity input component
     */
    get translucencyIntensity() {
        return this._inputs[2];
    }
    /**
     * Gets the translucency diffusion distance input component
     */
    get translucencyDiffusionDist() {
        return this._inputs[3];
    }
    /**
     * Gets the refraction object parameters
     */
    get refraction() {
        return this._inputs[4];
    }
    /**
     * Gets the dispersion input component
     */
    get dispersion() {
        return this._inputs[5];
    }
    /**
     * Gets the sub surface object output component
     */
    get subsurface() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.thickness.isConnected) {
            const thicknessInput = new InputBlock("SubSurface thickness", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);
            thicknessInput.value = 0;
            thicknessInput.output.connectTo(this.thickness);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        super.prepareDefines(mesh, nodeMaterial, defines);
        const translucencyEnabled = this.translucencyDiffusionDist.isConnected || this.translucencyIntensity.isConnected;
        defines.setValue("SUBSURFACE", translucencyEnabled || this.refraction.isConnected, true);
        defines.setValue("SS_TRANSLUCENCY", translucencyEnabled, true);
        defines.setValue("SS_THICKNESSANDMASK_TEXTURE", false, true);
        defines.setValue("SS_REFRACTIONINTENSITY_TEXTURE", false, true);
        defines.setValue("SS_TRANSLUCENCYINTENSITY_TEXTURE", false, true);
        defines.setValue("SS_USE_GLTF_TEXTURES", false, true);
        defines.setValue("SS_DISPERSION", this.dispersion.isConnected, true);
    }
    /**
     * Gets the main code of the block (fragment side)
     * @param state current state of the node material building
     * @param ssBlock instance of a SubSurfaceBlock or null if the code must be generated without an active sub surface module
     * @param reflectionBlock instance of a ReflectionBlock null if the code must be generated without an active reflection module
     * @param worldPosVarName name of the variable holding the world position
     * @returns the shader code
     */
    static GetCode(state, ssBlock, reflectionBlock, worldPosVarName) {
        let code = "";
        const thickness = ssBlock?.thickness.isConnected ? ssBlock.thickness.associatedVariableName : "0.";
        const tintColor = ssBlock?.tintColor.isConnected ? ssBlock.tintColor.associatedVariableName : "vec3(1.)";
        const translucencyIntensity = ssBlock?.translucencyIntensity.isConnected ? ssBlock?.translucencyIntensity.associatedVariableName : "1.";
        const translucencyDiffusionDistance = ssBlock?.translucencyDiffusionDist.isConnected ? ssBlock?.translucencyDiffusionDist.associatedVariableName : "vec3(1.)";
        const refractionBlock = (ssBlock?.refraction.isConnected ? ssBlock?.refraction.connectedPoint?.ownerBlock : null);
        const refractionTintAtDistance = refractionBlock?.tintAtDistance.isConnected ? refractionBlock.tintAtDistance.associatedVariableName : "1.";
        const refractionIntensity = refractionBlock?.intensity.isConnected ? refractionBlock.intensity.associatedVariableName : "1.";
        const refractionView = refractionBlock?.view.isConnected ? refractionBlock.view.associatedVariableName : "";
        const dispersion = ssBlock?.dispersion.isConnected ? ssBlock?.dispersion.associatedVariableName : "0.0";
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        code += refractionBlock?.getCode(state) ?? "";
        code += `${isWebGPU ? "var subSurfaceOut: subSurfaceOutParams" : "subSurfaceOutParams subSurfaceOut"};

        #ifdef SUBSURFACE
            ${state._declareLocalVar("vThicknessParam", NodeMaterialBlockConnectionPointTypes.Vector2)} = vec2${state.fSuffix}(0., ${thickness});
            ${state._declareLocalVar("vTintColor", NodeMaterialBlockConnectionPointTypes.Vector4)} = vec4${state.fSuffix}(${tintColor}, ${refractionTintAtDistance});
            ${state._declareLocalVar("vSubSurfaceIntensity", NodeMaterialBlockConnectionPointTypes.Vector3)} = vec3(${refractionIntensity}, ${translucencyIntensity}, 0.);
            ${state._declareLocalVar("dispersion", NodeMaterialBlockConnectionPointTypes.Float)} = ${dispersion};
            subSurfaceOut = subSurfaceBlock(
                vSubSurfaceIntensity
                , vThicknessParam
                , vTintColor
                , normalW
                , specularEnvironmentReflectance
            #ifdef SS_THICKNESSANDMASK_TEXTURE
                , vec4${state.fSuffix}(0.)
            #endif
            #ifdef REFLECTION
                #ifdef SS_TRANSLUCENCY
                    , ${(isWebGPU ? "uniforms." : "") + reflectionBlock?._reflectionMatrixName}
                    #ifdef USESPHERICALFROMREFLECTIONMAP
                        #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)
                            , reflectionOut.irradianceVector
                        #endif
                        #if defined(REALTIME_FILTERING)
                            , ${reflectionBlock?._cubeSamplerName}
                            ${isWebGPU ? `, ${reflectionBlock?._cubeSamplerName}Sampler` : ""}
                            , ${reflectionBlock?._vReflectionFilteringInfoName}
                        #endif
                        #endif
                    #ifdef USEIRRADIANCEMAP
                        , irradianceSampler
                        ${isWebGPU ? `, irradianceSamplerSampler` : ""}
                    #endif
                #endif
            #endif
            #if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)
                , surfaceAlbedo
            #endif
            #ifdef SS_REFRACTION
                , ${worldPosVarName}.xyz
                , viewDirectionW
                , ${refractionView}
                , ${(isWebGPU ? "uniforms." : "") + refractionBlock?._vRefractionInfosName ?? ""}
                , ${(isWebGPU ? "uniforms." : "") + refractionBlock?._refractionMatrixName ?? ""}
                , ${(isWebGPU ? "uniforms." : "") + refractionBlock?._vRefractionMicrosurfaceInfosName ?? ""}
                , ${isWebGPU ? "uniforms." : ""}vLightingIntensity
                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY
                    , alpha
                #endif
                #ifdef ${refractionBlock?._defineLODRefractionAlpha ?? "IGNORE"}
                    , NdotVUnclamped
                #endif
                #ifdef ${refractionBlock?._defineLinearSpecularRefraction ?? "IGNORE"}
                    , roughness
                #endif
                , alphaG
                #ifdef ${refractionBlock?._define3DName ?? "IGNORE"}
                    , ${refractionBlock?._cubeSamplerName ?? ""}
                    ${isWebGPU ? `, ${refractionBlock?._cubeSamplerName}Sampler` : ""}
                #else
                    , ${refractionBlock?._2DSamplerName ?? ""}
                    ${isWebGPU ? `, ${refractionBlock?._2DSamplerName}Sampler` : ""}
                #endif
                #ifndef LODBASEDMICROSFURACE
                    #ifdef ${refractionBlock?._define3DName ?? "IGNORE"}
                        , ${refractionBlock?._cubeSamplerName ?? ""}                        
                        ${isWebGPU ? `, ${refractionBlock?._cubeSamplerName}Sampler` : ""}
                        , ${refractionBlock?._cubeSamplerName ?? ""}                        
                        ${isWebGPU ? `, ${refractionBlock?._cubeSamplerName}Sampler` : ""}
                    #else
                        , ${refractionBlock?._2DSamplerName ?? ""}
                        ${isWebGPU ? `, ${refractionBlock?._2DSamplerName}Sampler` : ""}
                        , ${refractionBlock?._2DSamplerName ?? ""}
                        ${isWebGPU ? `, ${refractionBlock?._2DSamplerName}Sampler` : ""}
                    #endif
                #endif
                #ifdef ANISOTROPIC
                    , anisotropicOut
                #endif
                #ifdef REALTIME_FILTERING
                    , ${refractionBlock?._vRefractionFilteringInfoName ?? ""}
                #endif
                #ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC
                    , vRefractionPosition
                    , vRefractionSize
                #endif
                #ifdef SS_DISPERSION
                    , dispersion
                #endif
            #endif
            #ifdef SS_TRANSLUCENCY
                , ${translucencyDiffusionDistance}
                , vTintColor
                #ifdef SS_TRANSLUCENCYCOLOR_TEXTURE
                    , vec4${state.fSuffix}(0.)
                #endif
            #endif                
            );

            #ifdef SS_REFRACTION
                surfaceAlbedo = subSurfaceOut.surfaceAlbedo;
                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY
                    alpha = subSurfaceOut.alpha;
                #endif
            #endif
        #else
            subSurfaceOut.specularEnvironmentReflectance = specularEnvironmentReflectance;
        #endif\n`;
        return code;
    }
    _buildBlock(state) {
        if (state.target === NodeMaterialBlockTargets.Fragment) {
            state.sharedData.blocksWithDefines.push(this);
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SubSurfaceBlock", SubSurfaceBlock);
//# sourceMappingURL=subSurfaceBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js






















const mapOutputToVariable = {
    ambientClr: ["finalAmbient", ""],
    diffuseDir: ["finalDiffuse", ""],
    specularDir: ["finalSpecularScaled", "!defined(UNLIT) && defined(SPECULARTERM)"],
    clearcoatDir: ["finalClearCoatScaled", "!defined(UNLIT) && defined(CLEARCOAT)"],
    sheenDir: ["finalSheenScaled", "!defined(UNLIT) && defined(SHEEN)"],
    diffuseInd: ["finalIrradiance", "!defined(UNLIT) && defined(REFLECTION)"],
    specularInd: ["finalRadianceScaled", "!defined(UNLIT) && defined(REFLECTION)"],
    clearcoatInd: ["clearcoatOut.finalClearCoatRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)"],
    sheenInd: ["sheenOut.finalSheenRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)"],
    refraction: ["subSurfaceOut.finalRefraction", "!defined(UNLIT) && defined(SS_REFRACTION)"],
    lighting: ["finalColor.rgb", ""],
    shadow: ["aggShadow", ""],
    alpha: ["alpha", ""],
};
/**
 * Block used to implement the PBR metallic/roughness model
 * #D8AK3Z#80
 */
class PBRMetallicRoughnessBlock extends NodeMaterialBlock {
    static _OnGenerateOnlyFragmentCodeChanged(block, _propertyName) {
        const that = block;
        if (that.worldPosition.isConnected) {
            that.generateOnlyFragmentCode = !that.generateOnlyFragmentCode;
            logger/* Logger */.V.Error("The worldPosition input must not be connected to be able to switch!");
            return false;
        }
        that._setTarget();
        return true;
    }
    _setTarget() {
        this._setInitialTarget(this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment);
        this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex;
    }
    /**
     * Create a new ReflectionBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.VertexAndFragment);
        this._environmentBRDFTexture = null;
        this._metallicReflectanceColor = math_color/* Color3 */.v9.White();
        this._metallicF0Factor = 1;
        /**
         * Intensity of the direct lights e.g. the four lights available in your scene.
         * This impacts both the direct diffuse and specular highlights.
         */
        this.directIntensity = 1.0;
        /**
         * Intensity of the environment e.g. how much the environment will light the object
         * either through harmonics for rough material or through the reflection for shiny ones.
         */
        this.environmentIntensity = 1.0;
        /**
         * This is a special control allowing the reduction of the specular highlights coming from the
         * four lights of the scene. Those highlights may not be needed in full environment lighting.
         */
        this.specularIntensity = 1.0;
        /**
         * Defines the  falloff type used in this material.
         * It by default is Physical.
         */
        this.lightFalloff = 0;
        /**
         * Specifies that alpha test should be used
         */
        this.useAlphaTest = false;
        /**
         * Defines the alpha limits in alpha test mode.
         */
        this.alphaTestCutoff = 0.5;
        /**
         * Specifies that alpha blending should be used
         */
        this.useAlphaBlending = false;
        /**
         * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones).
         * A car glass is a good example of that. When the street lights reflects on it you can not see what is behind.
         */
        this.useRadianceOverAlpha = true;
        /**
         * Specifies that the material will keeps the specular highlights over a transparent surface (only the most luminous ones).
         * A car glass is a good example of that. When sun reflects on it you can not see what is behind.
         */
        this.useSpecularOverAlpha = true;
        /**
         * Enables specular anti aliasing in the PBR shader.
         * It will both interacts on the Geometry for analytical and IBL lighting.
         * It also prefilter the roughness map based on the bump values.
         */
        this.enableSpecularAntiAliasing = false;
        /**
         * Enables realtime filtering on the texture.
         */
        this.realTimeFiltering = false;
        /**
         * Quality switch for realtime filtering
         */
        this.realTimeFilteringQuality = 8;
        /**
         * Defines if the material uses energy conservation.
         */
        this.useEnergyConservation = true;
        /**
         * This parameters will enable/disable radiance occlusion by preventing the radiance to lit
         * too much the area relying on ambient texture to define their ambient occlusion.
         */
        this.useRadianceOcclusion = true;
        /**
         * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal
         * makes the reflect vector face the model (under horizon).
         */
        this.useHorizonOcclusion = true;
        /**
         * If set to true, no lighting calculations will be applied.
         */
        this.unlit = false;
        /**
         * Force normal to face away from face.
         */
        this.forceNormalForward = false;
        /** Indicates that no code should be generated in the vertex shader. Can be useful in some specific circumstances (like when doing ray marching for eg) */
        this.generateOnlyFragmentCode = false;
        /**
         * Defines the material debug mode.
         * It helps seeing only some components of the material while troubleshooting.
         */
        this.debugMode = 0;
        /**
         * Specify from where on screen the debug mode should start.
         * The value goes from -1 (full screen) to 1 (not visible)
         * It helps with side by side comparison against the final render
         * This defaults to 0
         */
        this.debugLimit = 0;
        /**
         * As the default viewing range might not be enough (if the ambient is really small for instance)
         * You can use the factor to better multiply the final value.
         */
        this.debugFactor = 1;
        this._isUnique = true;
        this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Vertex);
        this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, false);
        this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("perturbedNormal", NodeMaterialBlockConnectionPointTypes.Vector4, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("baseColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("metallic", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("roughness", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment);
        this.registerInput("ambientOcc", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("opacity", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("indexOfRefraction", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("ambientColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
        this.registerInput("reflection", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("reflection", this, 0 /* NodeMaterialConnectionPointDirection.Input */, ReflectionBlock, "ReflectionBlock"));
        this.registerInput("clearcoat", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("clearcoat", this, 0 /* NodeMaterialConnectionPointDirection.Input */, ClearCoatBlock, "ClearCoatBlock"));
        this.registerInput("sheen", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("sheen", this, 0 /* NodeMaterialConnectionPointDirection.Input */, SheenBlock, "SheenBlock"));
        this.registerInput("subsurface", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("subsurface", this, 0 /* NodeMaterialConnectionPointDirection.Input */, SubSurfaceBlock, "SubSurfaceBlock"));
        this.registerInput("anisotropy", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("anisotropy", this, 0 /* NodeMaterialConnectionPointDirection.Input */, AnisotropyBlock, "AnisotropyBlock"));
        this.registerInput("iridescence", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject("iridescence", this, 0 /* NodeMaterialConnectionPointDirection.Input */, IridescenceBlock, "IridescenceBlock"));
        this.registerOutput("ambientClr", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("diffuseDir", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("specularDir", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("clearcoatDir", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("sheenDir", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("diffuseInd", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("specularInd", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("clearcoatInd", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("sheenInd", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("refraction", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("lighting", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("shadow", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("alpha", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
    }
    /**
     * Initialize the block and prepare the context for build
     * @param state defines the state that will be used for the build
     */
    initialize(state) {
        state._excludeVariableName("vLightingIntensity");
        state._excludeVariableName("geometricNormalW");
        state._excludeVariableName("normalW");
        state._excludeVariableName("faceNormal");
        state._excludeVariableName("albedoOpacityOut");
        state._excludeVariableName("surfaceAlbedo");
        state._excludeVariableName("alpha");
        state._excludeVariableName("aoOut");
        state._excludeVariableName("baseColor");
        state._excludeVariableName("reflectivityOut");
        state._excludeVariableName("microSurface");
        state._excludeVariableName("roughness");
        state._excludeVariableName("NdotVUnclamped");
        state._excludeVariableName("NdotV");
        state._excludeVariableName("alphaG");
        state._excludeVariableName("AARoughnessFactors");
        state._excludeVariableName("environmentBrdf");
        state._excludeVariableName("ambientMonochrome");
        state._excludeVariableName("seo");
        state._excludeVariableName("eho");
        state._excludeVariableName("environmentRadiance");
        state._excludeVariableName("irradianceVector");
        state._excludeVariableName("environmentIrradiance");
        state._excludeVariableName("diffuseBase");
        state._excludeVariableName("specularBase");
        state._excludeVariableName("preInfo");
        state._excludeVariableName("info");
        state._excludeVariableName("shadow");
        state._excludeVariableName("finalDiffuse");
        state._excludeVariableName("finalAmbient");
        state._excludeVariableName("ambientOcclusionForDirectDiffuse");
        state._excludeVariableName("finalColor");
        state._excludeVariableName("vClipSpacePosition");
        state._excludeVariableName("vDebugMode");
        this._initShaderSourceAsync(state.shaderLanguage);
    }
    async _initShaderSourceAsync(shaderLanguage) {
        this._codeIsReady = false;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 39174)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22625))]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 81448)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 84037))]);
        }
        this._codeIsReady = true;
        this.onCodeIsReadyObservable.notifyObservers(this);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "PBRMetallicRoughnessBlock";
    }
    /**
     * Gets the world position input component
     */
    get worldPosition() {
        return this._inputs[0];
    }
    /**
     * Gets the world normal input component
     */
    get worldNormal() {
        return this._inputs[1];
    }
    /**
     * Gets the view matrix parameter
     */
    get view() {
        return this._inputs[2];
    }
    /**
     * Gets the camera position input component
     */
    get cameraPosition() {
        return this._inputs[3];
    }
    /**
     * Gets the perturbed normal input component
     */
    get perturbedNormal() {
        return this._inputs[4];
    }
    /**
     * Gets the base color input component
     */
    get baseColor() {
        return this._inputs[5];
    }
    /**
     * Gets the metallic input component
     */
    get metallic() {
        return this._inputs[6];
    }
    /**
     * Gets the roughness input component
     */
    get roughness() {
        return this._inputs[7];
    }
    /**
     * Gets the ambient occlusion input component
     */
    get ambientOcc() {
        return this._inputs[8];
    }
    /**
     * Gets the opacity input component
     */
    get opacity() {
        return this._inputs[9];
    }
    /**
     * Gets the index of refraction input component
     */
    get indexOfRefraction() {
        return this._inputs[10];
    }
    /**
     * Gets the ambient color input component
     */
    get ambientColor() {
        return this._inputs[11];
    }
    /**
     * Gets the reflection object parameters
     */
    get reflection() {
        return this._inputs[12];
    }
    /**
     * Gets the clear coat object parameters
     */
    get clearcoat() {
        return this._inputs[13];
    }
    /**
     * Gets the sheen object parameters
     */
    get sheen() {
        return this._inputs[14];
    }
    /**
     * Gets the sub surface object parameters
     */
    get subsurface() {
        return this._inputs[15];
    }
    /**
     * Gets the anisotropy object parameters
     */
    get anisotropy() {
        return this._inputs[16];
    }
    /**
     * Gets the iridescence object parameters
     */
    get iridescence() {
        return this._inputs[17];
    }
    /**
     * Gets the ambient output component
     */
    get ambientClr() {
        return this._outputs[0];
    }
    /**
     * Gets the diffuse output component
     */
    get diffuseDir() {
        return this._outputs[1];
    }
    /**
     * Gets the specular output component
     */
    get specularDir() {
        return this._outputs[2];
    }
    /**
     * Gets the clear coat output component
     */
    get clearcoatDir() {
        return this._outputs[3];
    }
    /**
     * Gets the sheen output component
     */
    get sheenDir() {
        return this._outputs[4];
    }
    /**
     * Gets the indirect diffuse output component
     */
    get diffuseInd() {
        return this._outputs[5];
    }
    /**
     * Gets the indirect specular output component
     */
    get specularInd() {
        return this._outputs[6];
    }
    /**
     * Gets the indirect clear coat output component
     */
    get clearcoatInd() {
        return this._outputs[7];
    }
    /**
     * Gets the indirect sheen output component
     */
    get sheenInd() {
        return this._outputs[8];
    }
    /**
     * Gets the refraction output component
     */
    get refraction() {
        return this._outputs[9];
    }
    /**
     * Gets the global lighting output component
     */
    get lighting() {
        return this._outputs[10];
    }
    /**
     * Gets the shadow output component
     */
    get shadow() {
        return this._outputs[11];
    }
    /**
     * Gets the alpha output component
     */
    get alpha() {
        return this._outputs[12];
    }
    autoConfigure(material, additionalFilteringInfo = () => true) {
        if (!this.cameraPosition.isConnected) {
            let cameraPositionInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.CameraPosition && additionalFilteringInfo(b));
            if (!cameraPositionInput) {
                cameraPositionInput = new InputBlock("cameraPosition");
                cameraPositionInput.setAsSystemValue(NodeMaterialSystemValues.CameraPosition);
            }
            cameraPositionInput.output.connectTo(this.cameraPosition);
        }
        if (!this.view.isConnected) {
            let viewInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.View && additionalFilteringInfo(b));
            if (!viewInput) {
                viewInput = new InputBlock("view");
                viewInput.setAsSystemValue(NodeMaterialSystemValues.View);
            }
            viewInput.output.connectTo(this.view);
        }
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        // General
        defines.setValue("PBR", true);
        defines.setValue("METALLICWORKFLOW", true);
        defines.setValue("DEBUGMODE", this.debugMode, true);
        defines.setValue("DEBUGMODE_FORCERETURN", true);
        defines.setValue("NORMALXYSCALE", true);
        defines.setValue("BUMP", this.perturbedNormal.isConnected, true);
        defines.setValue("LODBASEDMICROSFURACE", this._scene.getEngine().getCaps().textureLOD);
        // Albedo & Opacity
        defines.setValue("ALBEDO", false, true);
        defines.setValue("OPACITY", this.opacity.isConnected, true);
        // Ambient occlusion
        defines.setValue("AMBIENT", true, true);
        defines.setValue("AMBIENTINGRAYSCALE", false, true);
        // Reflectivity
        defines.setValue("REFLECTIVITY", false, true);
        defines.setValue("AOSTOREINMETALMAPRED", false, true);
        defines.setValue("METALLNESSSTOREINMETALMAPBLUE", false, true);
        defines.setValue("ROUGHNESSSTOREINMETALMAPALPHA", false, true);
        defines.setValue("ROUGHNESSSTOREINMETALMAPGREEN", false, true);
        // Lighting & colors
        if (this.lightFalloff === pbrBaseMaterial/* PBRBaseMaterial */.d.LIGHTFALLOFF_STANDARD) {
            defines.setValue("USEPHYSICALLIGHTFALLOFF", false);
            defines.setValue("USEGLTFLIGHTFALLOFF", false);
        }
        else if (this.lightFalloff === pbrBaseMaterial/* PBRBaseMaterial */.d.LIGHTFALLOFF_GLTF) {
            defines.setValue("USEPHYSICALLIGHTFALLOFF", false);
            defines.setValue("USEGLTFLIGHTFALLOFF", true);
        }
        else {
            defines.setValue("USEPHYSICALLIGHTFALLOFF", true);
            defines.setValue("USEGLTFLIGHTFALLOFF", false);
        }
        // Transparency
        const alphaTestCutOffString = this.alphaTestCutoff.toString();
        defines.setValue("ALPHABLEND", this.useAlphaBlending, true);
        defines.setValue("ALPHAFROMALBEDO", false, true);
        defines.setValue("ALPHATEST", this.useAlphaTest, true);
        defines.setValue("ALPHATESTVALUE", alphaTestCutOffString.indexOf(".") < 0 ? alphaTestCutOffString + "." : alphaTestCutOffString, true);
        defines.setValue("OPACITYRGB", false, true);
        // Rendering
        defines.setValue("RADIANCEOVERALPHA", this.useRadianceOverAlpha, true);
        defines.setValue("SPECULAROVERALPHA", this.useSpecularOverAlpha, true);
        defines.setValue("SPECULARAA", this._scene.getEngine().getCaps().standardDerivatives && this.enableSpecularAntiAliasing, true);
        defines.setValue("REALTIME_FILTERING", this.realTimeFiltering, true);
        const scene = mesh.getScene();
        const engine = scene.getEngine();
        if (engine._features.needTypeSuffixInShaderConstants) {
            defines.setValue("NUM_SAMPLES", this.realTimeFilteringQuality + "u", true);
        }
        else {
            defines.setValue("NUM_SAMPLES", "" + this.realTimeFilteringQuality, true);
        }
        // Advanced
        defines.setValue("BRDF_V_HEIGHT_CORRELATED", true);
        defines.setValue("MS_BRDF_ENERGY_CONSERVATION", this.useEnergyConservation, true);
        defines.setValue("RADIANCEOCCLUSION", this.useRadianceOcclusion, true);
        defines.setValue("HORIZONOCCLUSION", this.useHorizonOcclusion, true);
        defines.setValue("UNLIT", this.unlit, true);
        defines.setValue("FORCENORMALFORWARD", this.forceNormalForward, true);
        if (this._environmentBRDFTexture && materialFlags/* MaterialFlags */.h.ReflectionTextureEnabled) {
            defines.setValue("ENVIRONMENTBRDF", true);
            defines.setValue("ENVIRONMENTBRDF_RGBD", this._environmentBRDFTexture.isRGBD, true);
        }
        else {
            defines.setValue("ENVIRONMENTBRDF", false);
            defines.setValue("ENVIRONMENTBRDF_RGBD", false);
        }
        if (defines._areImageProcessingDirty && nodeMaterial.imageProcessingConfiguration) {
            nodeMaterial.imageProcessingConfiguration.prepareDefines(defines);
        }
        if (!defines._areLightsDirty) {
            return;
        }
        if (!this.light) {
            // Lights
            (0,materialHelper_functions/* PrepareDefinesForLights */.az)(scene, mesh, defines, true, nodeMaterial.maxSimultaneousLights);
            defines._needNormals = true;
            // Multiview
            (0,materialHelper_functions/* PrepareDefinesForMultiview */.VO)(scene, defines);
        }
        else {
            const state = {
                needNormals: false,
                needRebuild: false,
                lightmapMode: false,
                shadowEnabled: false,
                specularEnabled: false,
            };
            (0,materialHelper_functions/* PrepareDefinesForLight */.lo)(scene, mesh, this.light, this._lightId, defines, true, state);
            if (state.needRebuild) {
                defines.rebuild();
            }
        }
    }
    updateUniformsAndSamples(state, nodeMaterial, defines, uniformBuffers) {
        for (let lightIndex = 0; lightIndex < nodeMaterial.maxSimultaneousLights; lightIndex++) {
            if (!defines["LIGHT" + lightIndex]) {
                break;
            }
            const onlyUpdateBuffersList = state.uniforms.indexOf("vLightData" + lightIndex) >= 0;
            (0,materialHelper_functions/* PrepareUniformsAndSamplersForLight */.GD)(lightIndex, state.uniforms, state.samplers, defines["PROJECTEDLIGHTTEXTURE" + lightIndex], uniformBuffers, onlyUpdateBuffersList);
        }
    }
    isReady(mesh, nodeMaterial, defines) {
        if (this._environmentBRDFTexture && !this._environmentBRDFTexture.isReady()) {
            return false;
        }
        if (defines._areImageProcessingDirty && nodeMaterial.imageProcessingConfiguration) {
            if (!nodeMaterial.imageProcessingConfiguration.isReady()) {
                return false;
            }
        }
        return true;
    }
    bind(effect, nodeMaterial, mesh) {
        if (!mesh) {
            return;
        }
        const scene = mesh.getScene();
        if (!this.light) {
            (0,materialHelper_functions/* BindLights */.RL)(scene, mesh, effect, true, nodeMaterial.maxSimultaneousLights);
        }
        else {
            (0,materialHelper_functions/* BindLight */.Kd)(this.light, this._lightId, scene, effect, true);
        }
        effect.setTexture(this._environmentBrdfSamplerName, this._environmentBRDFTexture);
        effect.setFloat2("vDebugMode", this.debugLimit, this.debugFactor);
        const ambientScene = this._scene.ambientColor;
        if (ambientScene) {
            effect.setColor3("ambientFromScene", ambientScene);
        }
        const invertNormal = scene.useRightHandedSystem === (scene._mirroredCameraPosition != null);
        effect.setFloat(this._invertNormalName, invertNormal ? -1 : 1);
        effect.setFloat4("vLightingIntensity", this.directIntensity, 1, this.environmentIntensity * this._scene.environmentIntensity, this.specularIntensity);
        // reflectivity bindings
        const outsideIOR = 1; // consider air as clear coat and other layers would remap in the shader.
        const ior = this.indexOfRefraction.connectInputBlock?.value ?? 1.5;
        // We are here deriving our default reflectance from a common value for none metallic surface.
        // Based of the schlick fresnel approximation model
        // for dielectrics.
        const f0 = Math.pow((ior - outsideIOR) / (ior + outsideIOR), 2);
        // Tweak the default F0 and F90 based on our given setup
        this._metallicReflectanceColor.scaleToRef(f0 * this._metallicF0Factor, math_color/* TmpColors */.IG.Color3[0]);
        const metallicF90 = this._metallicF0Factor;
        effect.setColor4(this._vMetallicReflectanceFactorsName, math_color/* TmpColors */.IG.Color3[0], metallicF90);
        if (nodeMaterial.imageProcessingConfiguration) {
            nodeMaterial.imageProcessingConfiguration.bind(effect);
        }
    }
    _injectVertexCode(state) {
        const worldPos = this.worldPosition;
        const worldNormal = this.worldNormal;
        const comments = `//${this.name}`;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        // Declaration
        if (!this.light) {
            // Emit for all lights
            state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", comments, {
                repeatKey: "maxSimultaneousLights",
            });
            this._lightId = 0;
            state.sharedData.dynamicUniformBlocks.push(this);
        }
        else {
            this._lightId = (state.counters["lightCounter"] !== undefined ? state.counters["lightCounter"] : -1) + 1;
            state.counters["lightCounter"] = this._lightId;
            state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightVxUboDeclaration" : "lightVxFragmentDeclaration", comments, {
                replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }],
            }, this._lightId.toString());
        }
        // Inject code in vertex
        const worldPosVaryingName = "v_" + worldPos.associatedVariableName;
        if (state._emitVaryingFromString(worldPosVaryingName, NodeMaterialBlockConnectionPointTypes.Vector4)) {
            state.compilationString += (isWebGPU ? "vertexOutputs." : "") + `${worldPosVaryingName} = ${worldPos.associatedVariableName};\n`;
        }
        const worldNormalVaryingName = "v_" + worldNormal.associatedVariableName;
        if (state._emitVaryingFromString(worldNormalVaryingName, NodeMaterialBlockConnectionPointTypes.Vector4)) {
            state.compilationString += (isWebGPU ? "vertexOutputs." : "") + `${worldNormalVaryingName} = ${worldNormal.associatedVariableName};\n`;
        }
        const reflectionBlock = this.reflection.isConnected ? this.reflection.connectedPoint?.ownerBlock : null;
        if (reflectionBlock) {
            reflectionBlock.viewConnectionPoint = this.view;
        }
        state.compilationString += reflectionBlock?.handleVertexSide(state) ?? "";
        if (state._emitVaryingFromString("vClipSpacePosition", NodeMaterialBlockConnectionPointTypes.Vector4, "defined(IGNORE) || DEBUGMODE > 0")) {
            state._injectAtEnd += `#if DEBUGMODE > 0\n`;
            state._injectAtEnd += (isWebGPU ? "vertexOutputs." : "") + `vClipSpacePosition = ${isWebGPU ? "vertexOutputs.position" : "gl_Position"};\n`;
            state._injectAtEnd += `#endif\n`;
        }
        if (this.light) {
            state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, {
                replaceStrings: [
                    { search: /{X}/g, replace: this._lightId.toString() },
                    { search: /worldPos/g, replace: worldPos.associatedVariableName },
                ],
            });
        }
        else {
            state.compilationString += `${state._declareLocalVar("worldPos", NodeMaterialBlockConnectionPointTypes.Vector4)} = ${worldPos.associatedVariableName};\n`;
            if (this.view.isConnected) {
                state.compilationString += `${state._declareLocalVar("view", NodeMaterialBlockConnectionPointTypes.Matrix)} = ${this.view.associatedVariableName};\n`;
            }
            state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, {
                repeatKey: "maxSimultaneousLights",
            });
        }
    }
    _getAlbedoOpacityCode(state) {
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        let code = isWebGPU ? "var albedoOpacityOut: albedoOpacityOutParams;\n" : `albedoOpacityOutParams albedoOpacityOut;\n`;
        const albedoColor = this.baseColor.isConnected ? this.baseColor.associatedVariableName : "vec3(1.)";
        const opacity = this.opacity.isConnected ? this.opacity.associatedVariableName : "1.";
        code += `albedoOpacityOut = albedoOpacityBlock(
                vec4${state.fSuffix}(${albedoColor}, 1.)
            #ifdef ALBEDO
                ,vec4${state.fSuffix}(1.)
                ,vec2${state.fSuffix}(1., 1.)
            #endif
            #ifdef OPACITY
                ,vec4${state.fSuffix}(${opacity})
                ,vec2${state.fSuffix}(1., 1.)
            #endif                
            );

            ${state._declareLocalVar("surfaceAlbedo", NodeMaterialBlockConnectionPointTypes.Vector3)} = albedoOpacityOut.surfaceAlbedo;
            ${state._declareLocalVar("alpha", NodeMaterialBlockConnectionPointTypes.Float)} = albedoOpacityOut.alpha;\n`;
        return code;
    }
    _getAmbientOcclusionCode(state) {
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        let code = isWebGPU ? "var aoOut: ambientOcclusionOutParams;\n" : `ambientOcclusionOutParams aoOut;\n`;
        const ao = this.ambientOcc.isConnected ? this.ambientOcc.associatedVariableName : "1.";
        code += `aoOut = ambientOcclusionBlock(
            #ifdef AMBIENT
                vec3${state.fSuffix}(${ao}),
                vec4${state.fSuffix}(0., 1.0, 1.0, 0.)
            #endif
            );\n`;
        return code;
    }
    _getReflectivityCode(state) {
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        let code = isWebGPU ? "var reflectivityOut: reflectivityOutParams;\n" : `reflectivityOutParams reflectivityOut;\n`;
        const aoIntensity = "1.";
        this._vMetallicReflectanceFactorsName = state._getFreeVariableName("vMetallicReflectanceFactors");
        state._emitUniformFromString(this._vMetallicReflectanceFactorsName, NodeMaterialBlockConnectionPointTypes.Vector4);
        code += `${state._declareLocalVar("baseColor", NodeMaterialBlockConnectionPointTypes.Vector3)} = surfaceAlbedo;

            reflectivityOut = reflectivityBlock(
                vec4${state.fSuffix}(${this.metallic.associatedVariableName}, ${this.roughness.associatedVariableName}, 0., 0.)
            #ifdef METALLICWORKFLOW
                , surfaceAlbedo
                , ${(isWebGPU ? "uniforms." : "") + this._vMetallicReflectanceFactorsName}
            #endif
            #ifdef REFLECTIVITY
                , vec3${state.fSuffix}(0., 0., ${aoIntensity})
                , vec4${state.fSuffix}(1.)
            #endif
            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY)  && defined(AOSTOREINMETALMAPRED)
                , aoOut.ambientOcclusionColor
            #endif
            #ifdef MICROSURFACEMAP
                , microSurfaceTexel <== not handled!
            #endif
            );

            ${state._declareLocalVar("microSurface", NodeMaterialBlockConnectionPointTypes.Float)} = reflectivityOut.microSurface;
            ${state._declareLocalVar("roughness", NodeMaterialBlockConnectionPointTypes.Float)} = reflectivityOut.roughness;

            #ifdef METALLICWORKFLOW
                surfaceAlbedo = reflectivityOut.surfaceAlbedo;
            #endif
            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
                aoOut.ambientOcclusionColor = reflectivityOut.ambientOcclusionColor;
            #endif\n`;
        return code;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this._scene = state.sharedData.scene;
        const isWebGPU = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        if (!this._environmentBRDFTexture) {
            this._environmentBRDFTexture = (0,brdfTextureTools/* GetEnvironmentBRDFTexture */.X)(this._scene);
        }
        const reflectionBlock = this.reflection.isConnected ? this.reflection.connectedPoint?.ownerBlock : null;
        if (reflectionBlock) {
            // Need those variables to be setup when calling _injectVertexCode
            reflectionBlock.worldPositionConnectionPoint = this.worldPosition;
            reflectionBlock.cameraPositionConnectionPoint = this.cameraPosition;
            reflectionBlock.worldNormalConnectionPoint = this.worldNormal;
            reflectionBlock.viewConnectionPoint = this.view;
        }
        if (state.target !== NodeMaterialBlockTargets.Fragment) {
            // Vertex
            this._injectVertexCode(state);
            return this;
        }
        // Fragment
        state.sharedData.forcedBindableBlocks.push(this);
        state.sharedData.blocksWithDefines.push(this);
        state.sharedData.blockingBlocks.push(this);
        if (this.generateOnlyFragmentCode) {
            state.sharedData.dynamicUniformBlocks.push(this);
        }
        const comments = `//${this.name}`;
        const normalShading = this.perturbedNormal;
        let worldPosVarName = this.worldPosition.associatedVariableName;
        let worldNormalVarName = this.worldNormal.associatedVariableName;
        if (this.generateOnlyFragmentCode) {
            worldPosVarName = state._getFreeVariableName("globalWorldPos");
            state.compilationString += `${worldPosVarName} = ${this.worldPosition.associatedVariableName}.xyz;\n`;
            worldNormalVarName = state._getFreeVariableName("globalWorldNormal");
            state.compilationString += `${worldNormalVarName} = ${this.worldNormal.associatedVariableName}.xyz;\n`;
            state.compilationString += state._emitCodeFromInclude("shadowsVertex", comments, {
                repeatKey: "maxSimultaneousLights",
                substitutionVars: this.generateOnlyFragmentCode ? `worldPos,${this.worldPosition.associatedVariableName}` : undefined,
            });
            state.compilationString += `#if DEBUGMODE > 0\n`;
            state.compilationString += `${state._declareLocalVar("vClipSpacePosition", NodeMaterialBlockConnectionPointTypes.Vector4)} = vec4${state.fSuffix}((vec2${state.fSuffix}(${isWebGPU ? "fragmentInputs.position" : "gl_FragCoord.xy"}) / vec2${state.fSuffix}(1.0)) * 2.0 - 1.0, 0.0, 1.0);\n`;
            state.compilationString += `#endif\n`;
        }
        else {
            worldPosVarName = (isWebGPU ? "input." : "") + "v_" + worldPosVarName;
            worldNormalVarName = (isWebGPU ? "input." : "") + "v_" + worldNormalVarName;
        }
        this._environmentBrdfSamplerName = state._getFreeVariableName("environmentBrdfSampler");
        state._emit2DSampler(this._environmentBrdfSamplerName);
        state.sharedData.hints.needAlphaBlending = state.sharedData.hints.needAlphaBlending || this.useAlphaBlending;
        state.sharedData.hints.needAlphaTesting = state.sharedData.hints.needAlphaTesting || this.useAlphaTest;
        state._emitExtension("lod", "#extension GL_EXT_shader_texture_lod : enable", "defined(LODBASEDMICROSFURACE)");
        state._emitExtension("derivatives", "#extension GL_OES_standard_derivatives : enable");
        state._emitUniformFromString("vDebugMode", NodeMaterialBlockConnectionPointTypes.Vector2, "defined(IGNORE) || DEBUGMODE > 0");
        state._emitUniformFromString("ambientFromScene", NodeMaterialBlockConnectionPointTypes.Vector3);
        // Image processing uniforms
        state.uniforms.push("exposureLinear");
        state.uniforms.push("contrast");
        state.uniforms.push("vInverseScreenSize");
        state.uniforms.push("vignetteSettings1");
        state.uniforms.push("vignetteSettings2");
        state.uniforms.push("vCameraColorCurveNegative");
        state.uniforms.push("vCameraColorCurveNeutral");
        state.uniforms.push("vCameraColorCurvePositive");
        state.uniforms.push("txColorTransform");
        state.uniforms.push("colorTransformSettings");
        state.uniforms.push("ditherIntensity");
        //
        // Includes
        //
        if (!this.light) {
            // Emit for all lights
            state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", comments, {
                repeatKey: "maxSimultaneousLights",
                substitutionVars: this.generateOnlyFragmentCode ? "varying," : undefined,
            });
        }
        else {
            state._emitFunctionFromInclude(state.supportUniformBuffers ? "lightUboDeclaration" : "lightFragmentDeclaration", comments, {
                replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }],
            }, this._lightId.toString());
        }
        state._emitFunctionFromInclude("helperFunctions", comments);
        state._emitFunctionFromInclude("importanceSampling", comments);
        state._emitFunctionFromInclude("pbrHelperFunctions", comments);
        state._emitFunctionFromInclude("imageProcessingDeclaration", comments);
        state._emitFunctionFromInclude("imageProcessingFunctions", comments);
        state._emitFunctionFromInclude("shadowsFragmentFunctions", comments);
        state._emitFunctionFromInclude("pbrDirectLightingSetupFunctions", comments);
        state._emitFunctionFromInclude("pbrDirectLightingFalloffFunctions", comments);
        state._emitFunctionFromInclude("pbrBRDFFunctions", comments, {
            replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: reflectionBlock?._defineSkyboxName ?? "REFLECTIONMAP_SKYBOX" }],
        });
        state._emitFunctionFromInclude("hdrFilteringFunctions", comments);
        state._emitFunctionFromInclude("pbrDirectLightingFunctions", comments);
        state._emitFunctionFromInclude("pbrIBLFunctions", comments);
        state._emitFunctionFromInclude("pbrBlockAlbedoOpacity", comments);
        state._emitFunctionFromInclude("pbrBlockReflectivity", comments);
        state._emitFunctionFromInclude("pbrBlockAmbientOcclusion", comments);
        state._emitFunctionFromInclude("pbrBlockAlphaFresnel", comments);
        state._emitFunctionFromInclude("pbrBlockAnisotropic", comments);
        //
        // code
        //
        state._emitUniformFromString("vLightingIntensity", NodeMaterialBlockConnectionPointTypes.Vector4);
        if (reflectionBlock?.generateOnlyFragmentCode) {
            state.compilationString += reflectionBlock.handleVertexSide(state);
        }
        // _____________________________ Geometry Information ____________________________
        this._vNormalWName = state._getFreeVariableName("vNormalW");
        state.compilationString += `${state._declareLocalVar(this._vNormalWName, NodeMaterialBlockConnectionPointTypes.Vector4)} = normalize(${worldNormalVarName});\n`;
        if (state._registerTempVariable("viewDirectionW")) {
            state.compilationString += `${state._declareLocalVar("viewDirectionW", NodeMaterialBlockConnectionPointTypes.Vector3)} = normalize(${this.cameraPosition.associatedVariableName} - ${worldPosVarName}.xyz);\n`;
        }
        state.compilationString += `${state._declareLocalVar("geometricNormalW", NodeMaterialBlockConnectionPointTypes.Vector3)} = ${this._vNormalWName}.xyz;\n`;
        state.compilationString += `${state._declareLocalVar("normalW", NodeMaterialBlockConnectionPointTypes.Vector3)} = ${normalShading.isConnected ? "normalize(" + normalShading.associatedVariableName + ".xyz)" : "geometricNormalW"};\n`;
        this._invertNormalName = state._getFreeVariableName("invertNormal");
        state._emitUniformFromString(this._invertNormalName, NodeMaterialBlockConnectionPointTypes.Float);
        state.compilationString += state._emitCodeFromInclude("pbrBlockNormalFinal", comments, {
            replaceStrings: [
                { search: /vPositionW/g, replace: worldPosVarName + ".xyz" },
                { search: /vEyePosition.w/g, replace: this._invertNormalName },
            ],
        });
        // _____________________________ Albedo & Opacity ______________________________
        state.compilationString += this._getAlbedoOpacityCode(state);
        state.compilationString += state._emitCodeFromInclude("depthPrePass", comments);
        // _____________________________ AO  _______________________________
        state.compilationString += this._getAmbientOcclusionCode(state);
        state.compilationString += state._emitCodeFromInclude("pbrBlockLightmapInit", comments);
        // _____________________________ UNLIT  _______________________________
        state.compilationString += `#ifdef UNLIT
                ${state._declareLocalVar("diffuseBase", NodeMaterialBlockConnectionPointTypes.Vector3)} = vec3${state.fSuffix}(1., 1., 1.);
            #else\n`;
        // _____________________________ Reflectivity _______________________________
        state.compilationString += this._getReflectivityCode(state);
        // _____________________________ Geometry info _________________________________
        state.compilationString += state._emitCodeFromInclude("pbrBlockGeometryInfo", comments, {
            replaceStrings: [
                { search: /REFLECTIONMAP_SKYBOX/g, replace: reflectionBlock?._defineSkyboxName ?? "REFLECTIONMAP_SKYBOX" },
                { search: /REFLECTIONMAP_3D/g, replace: reflectionBlock?._define3DName ?? "REFLECTIONMAP_3D" },
            ],
        });
        // _____________________________ Anisotropy _______________________________________
        const anisotropyBlock = this.anisotropy.isConnected ? this.anisotropy.connectedPoint?.ownerBlock : null;
        if (anisotropyBlock) {
            anisotropyBlock.worldPositionConnectionPoint = this.worldPosition;
            anisotropyBlock.worldNormalConnectionPoint = this.worldNormal;
            state.compilationString += anisotropyBlock.getCode(state, !this.perturbedNormal.isConnected);
        }
        // _____________________________ Reflection _______________________________________
        if (reflectionBlock && reflectionBlock.hasTexture) {
            state.compilationString += reflectionBlock.getCode(state, anisotropyBlock ? "anisotropicOut.anisotropicNormal" : "normalW");
        }
        state._emitFunctionFromInclude("pbrBlockReflection", comments, {
            replaceStrings: [
                { search: /computeReflectionCoords/g, replace: "computeReflectionCoordsPBR" },
                { search: /REFLECTIONMAP_3D/g, replace: reflectionBlock?._define3DName ?? "REFLECTIONMAP_3D" },
                { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: reflectionBlock?._defineOppositeZ ?? "REFLECTIONMAP_OPPOSITEZ" },
                { search: /REFLECTIONMAP_PROJECTION/g, replace: reflectionBlock?._defineProjectionName ?? "REFLECTIONMAP_PROJECTION" },
                { search: /REFLECTIONMAP_SKYBOX/g, replace: reflectionBlock?._defineSkyboxName ?? "REFLECTIONMAP_SKYBOX" },
                { search: /LODINREFLECTIONALPHA/g, replace: reflectionBlock?._defineLODReflectionAlpha ?? "LODINREFLECTIONALPHA" },
                { search: /LINEARSPECULARREFLECTION/g, replace: reflectionBlock?._defineLinearSpecularReflection ?? "LINEARSPECULARREFLECTION" },
                { search: /vReflectionFilteringInfo/g, replace: reflectionBlock?._vReflectionFilteringInfoName ?? "vReflectionFilteringInfo" },
            ],
        });
        // ___________________ Compute Reflectance aka R0 F0 info _________________________
        state.compilationString += state._emitCodeFromInclude("pbrBlockReflectance0", comments, {
            replaceStrings: [{ search: /metallicReflectanceFactors/g, replace: (isWebGPU ? "uniforms." : "") + this._vMetallicReflectanceFactorsName }],
        });
        // ________________________________ Sheen ______________________________
        const sheenBlock = this.sheen.isConnected ? this.sheen.connectedPoint?.ownerBlock : null;
        if (sheenBlock) {
            state.compilationString += sheenBlock.getCode(reflectionBlock, state);
        }
        state._emitFunctionFromInclude("pbrBlockSheen", comments, {
            replaceStrings: [
                { search: /REFLECTIONMAP_3D/g, replace: reflectionBlock?._define3DName ?? "REFLECTIONMAP_3D" },
                { search: /REFLECTIONMAP_SKYBOX/g, replace: reflectionBlock?._defineSkyboxName ?? "REFLECTIONMAP_SKYBOX" },
                { search: /LODINREFLECTIONALPHA/g, replace: reflectionBlock?._defineLODReflectionAlpha ?? "LODINREFLECTIONALPHA" },
                { search: /LINEARSPECULARREFLECTION/g, replace: reflectionBlock?._defineLinearSpecularReflection ?? "LINEARSPECULARREFLECTION" },
            ],
        });
        // _____________________________ Iridescence _______________________________
        const iridescenceBlock = this.iridescence.isConnected ? this.iridescence.connectedPoint?.ownerBlock : null;
        state.compilationString += IridescenceBlock.GetCode(iridescenceBlock, state);
        state._emitFunctionFromInclude("pbrBlockIridescence", comments, {
            replaceStrings: [],
        });
        // _____________________________ Clear Coat ____________________________
        const clearcoatBlock = this.clearcoat.isConnected ? this.clearcoat.connectedPoint?.ownerBlock : null;
        const generateTBNSpace = !this.perturbedNormal.isConnected && !this.anisotropy.isConnected;
        const isTangentConnectedToPerturbNormal = this.perturbedNormal.isConnected && (this.perturbedNormal.connectedPoint?.ownerBlock).worldTangent?.isConnected;
        const isTangentConnectedToAnisotropy = this.anisotropy.isConnected && (this.anisotropy.connectedPoint?.ownerBlock).worldTangent.isConnected;
        let vTBNAvailable = isTangentConnectedToPerturbNormal || (!this.perturbedNormal.isConnected && isTangentConnectedToAnisotropy);
        state.compilationString += ClearCoatBlock.GetCode(state, clearcoatBlock, reflectionBlock, worldPosVarName, generateTBNSpace, vTBNAvailable, worldNormalVarName);
        if (generateTBNSpace) {
            vTBNAvailable = clearcoatBlock?.worldTangent.isConnected ?? false;
        }
        state._emitFunctionFromInclude("pbrBlockClearcoat", comments, {
            replaceStrings: [
                { search: /computeReflectionCoords/g, replace: "computeReflectionCoordsPBR" },
                { search: /REFLECTIONMAP_3D/g, replace: reflectionBlock?._define3DName ?? "REFLECTIONMAP_3D" },
                { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: reflectionBlock?._defineOppositeZ ?? "REFLECTIONMAP_OPPOSITEZ" },
                { search: /REFLECTIONMAP_PROJECTION/g, replace: reflectionBlock?._defineProjectionName ?? "REFLECTIONMAP_PROJECTION" },
                { search: /REFLECTIONMAP_SKYBOX/g, replace: reflectionBlock?._defineSkyboxName ?? "REFLECTIONMAP_SKYBOX" },
                { search: /LODINREFLECTIONALPHA/g, replace: reflectionBlock?._defineLODReflectionAlpha ?? "LODINREFLECTIONALPHA" },
                { search: /LINEARSPECULARREFLECTION/g, replace: reflectionBlock?._defineLinearSpecularReflection ?? "LINEARSPECULARREFLECTION" },
                { search: /defined\(TANGENT\)/g, replace: vTBNAvailable ? "defined(TANGENT)" : "defined(IGNORE)" },
            ],
        });
        // _________________________ Specular Environment Reflectance __________________________
        state.compilationString += state._emitCodeFromInclude("pbrBlockReflectance", comments, {
            replaceStrings: [
                { search: /REFLECTIONMAP_SKYBOX/g, replace: reflectionBlock?._defineSkyboxName ?? "REFLECTIONMAP_SKYBOX" },
                { search: /REFLECTIONMAP_3D/g, replace: reflectionBlock?._define3DName ?? "REFLECTIONMAP_3D" },
            ],
        });
        // ___________________________________ SubSurface ______________________________________
        const subsurfaceBlock = this.subsurface.isConnected ? this.subsurface.connectedPoint?.ownerBlock : null;
        const refractionBlock = this.subsurface.isConnected
            ? (this.subsurface.connectedPoint?.ownerBlock).refraction.connectedPoint?.ownerBlock
            : null;
        if (refractionBlock) {
            refractionBlock.viewConnectionPoint = this.view;
            refractionBlock.indexOfRefractionConnectionPoint = this.indexOfRefraction;
        }
        state.compilationString += SubSurfaceBlock.GetCode(state, subsurfaceBlock, reflectionBlock, worldPosVarName);
        state._emitFunctionFromInclude("pbrBlockSubSurface", comments, {
            replaceStrings: [
                { search: /REFLECTIONMAP_3D/g, replace: reflectionBlock?._define3DName ?? "REFLECTIONMAP_3D" },
                { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: reflectionBlock?._defineOppositeZ ?? "REFLECTIONMAP_OPPOSITEZ" },
                { search: /REFLECTIONMAP_PROJECTION/g, replace: reflectionBlock?._defineProjectionName ?? "REFLECTIONMAP_PROJECTION" },
                { search: /SS_REFRACTIONMAP_3D/g, replace: refractionBlock?._define3DName ?? "SS_REFRACTIONMAP_3D" },
                { search: /SS_LODINREFRACTIONALPHA/g, replace: refractionBlock?._defineLODRefractionAlpha ?? "SS_LODINREFRACTIONALPHA" },
                { search: /SS_LINEARSPECULARREFRACTION/g, replace: refractionBlock?._defineLinearSpecularRefraction ?? "SS_LINEARSPECULARREFRACTION" },
                { search: /SS_REFRACTIONMAP_OPPOSITEZ/g, replace: refractionBlock?._defineOppositeZ ?? "SS_REFRACTIONMAP_OPPOSITEZ" },
            ],
        });
        // _____________________________ Direct Lighting Info __________________________________
        state.compilationString += state._emitCodeFromInclude("pbrBlockDirectLighting", comments);
        if (this.light) {
            state.compilationString += state._emitCodeFromInclude("lightFragment", comments, {
                replaceStrings: [
                    { search: /{X}/g, replace: this._lightId.toString() },
                    { search: new RegExp(`${isWebGPU ? "fragmentInputs." : ""}vPositionW`, "g"), replace: worldPosVarName + ".xyz" },
                ],
            });
        }
        else {
            state.compilationString += state._emitCodeFromInclude("lightFragment", comments, {
                repeatKey: "maxSimultaneousLights",
                substitutionVars: `${isWebGPU ? "fragmentInputs." : ""}vPositionW,${worldPosVarName}.xyz`,
            });
        }
        // _____________________________ Compute Final Lit Components ________________________
        state.compilationString += state._emitCodeFromInclude("pbrBlockFinalLitComponents", comments);
        // _____________________________ UNLIT (2) ________________________
        state.compilationString += `#endif\n`; // UNLIT
        // _____________________________ Compute Final Unlit Components ________________________
        const aoColor = this.ambientColor.isConnected ? this.ambientColor.associatedVariableName : `vec3${state.fSuffix}(0., 0., 0.)`;
        let aoDirectLightIntensity = pbrBaseMaterial/* PBRBaseMaterial */.d.DEFAULT_AO_ON_ANALYTICAL_LIGHTS.toString();
        if (aoDirectLightIntensity.indexOf(".") === -1) {
            aoDirectLightIntensity += ".";
        }
        let replaceStrings = [
            { search: /vec3 finalEmissive[\s\S]*?finalEmissive\*=vLightingIntensity\.y;/g, replace: "" },
            { search: new RegExp(`${isWebGPU ? "uniforms." : ""}vAmbientColor`, "g"), replace: aoColor + ` * ${isWebGPU ? "uniforms." : ""}ambientFromScene` },
            { search: new RegExp(`${isWebGPU ? "uniforms." : ""}vAmbientInfos.w`, "g"), replace: aoDirectLightIntensity },
        ];
        if (isWebGPU) {
            replaceStrings[0] = { search: /var finalEmissive[\s\S]*?finalEmissive\*=uniforms.vLightingIntensity\.y;/g, replace: "" };
        }
        state.compilationString += state._emitCodeFromInclude("pbrBlockFinalUnlitComponents", comments, {
            replaceStrings: replaceStrings,
        });
        // _____________________________ Output Final Color Composition ________________________
        state.compilationString += state._emitCodeFromInclude("pbrBlockFinalColorComposition", comments, {
            replaceStrings: [{ search: /finalEmissive/g, replace: `vec3${state.fSuffix}(0.)` }],
        });
        // _____________________________ Apply image processing ________________________
        if (isWebGPU) {
            replaceStrings = [{ search: /mesh.visibility/g, replace: "1." }];
        }
        else {
            replaceStrings = [{ search: /visibility/g, replace: "1." }];
        }
        state.compilationString += state._emitCodeFromInclude("pbrBlockImageProcessing", comments, {
            replaceStrings: replaceStrings,
        });
        // _____________________________ Generate debug code ________________________
        const colorOutput = isWebGPU ? "fragmentOutputs.color" : "gl_FragColor";
        replaceStrings = [
            { search: new RegExp(`${isWebGPU ? "fragmentInputs." : ""}vNormalW`, "g"), replace: this._vNormalWName },
            { search: new RegExp(`${isWebGPU ? "fragmentInputs." : ""}vPositionW`, "g"), replace: worldPosVarName },
            {
                search: /albedoTexture\.rgb;/g,
                replace: `vec3${state.fSuffix}(1.);\n${colorOutput}.rgb = toGammaSpace(${colorOutput}.rgb);\n`,
            },
        ];
        state.compilationString += state._emitCodeFromInclude("pbrDebug", comments, {
            replaceStrings: replaceStrings,
        });
        // _____________________________ Generate end points ________________________
        for (const output of this._outputs) {
            if (output.hasEndpoints) {
                const remap = mapOutputToVariable[output.name];
                if (remap) {
                    const [varName, conditions] = remap;
                    if (conditions) {
                        state.compilationString += `#if ${conditions}\n`;
                    }
                    state.compilationString += `${state._declareOutput(output)} = ${varName};\n`;
                    if (conditions) {
                        state.compilationString += `#else\n`;
                        state.compilationString += `${state._declareOutput(output)} = vec3${state.fSuffix}(0.);\n`;
                        state.compilationString += `#endif\n`;
                    }
                }
                else {
                    logger/* Logger */.V.Error(`There's no remapping for the ${output.name} end point! No code generated`);
                }
            }
        }
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.lightFalloff = ${this.lightFalloff};\n`;
        codeString += `${this._codeVariableName}.useAlphaTest = ${this.useAlphaTest};\n`;
        codeString += `${this._codeVariableName}.alphaTestCutoff = ${this.alphaTestCutoff};\n`;
        codeString += `${this._codeVariableName}.useAlphaBlending = ${this.useAlphaBlending};\n`;
        codeString += `${this._codeVariableName}.useRadianceOverAlpha = ${this.useRadianceOverAlpha};\n`;
        codeString += `${this._codeVariableName}.useSpecularOverAlpha = ${this.useSpecularOverAlpha};\n`;
        codeString += `${this._codeVariableName}.enableSpecularAntiAliasing = ${this.enableSpecularAntiAliasing};\n`;
        codeString += `${this._codeVariableName}.realTimeFiltering = ${this.realTimeFiltering};\n`;
        codeString += `${this._codeVariableName}.realTimeFilteringQuality = ${this.realTimeFilteringQuality};\n`;
        codeString += `${this._codeVariableName}.useEnergyConservation = ${this.useEnergyConservation};\n`;
        codeString += `${this._codeVariableName}.useRadianceOcclusion = ${this.useRadianceOcclusion};\n`;
        codeString += `${this._codeVariableName}.useHorizonOcclusion = ${this.useHorizonOcclusion};\n`;
        codeString += `${this._codeVariableName}.unlit = ${this.unlit};\n`;
        codeString += `${this._codeVariableName}.forceNormalForward = ${this.forceNormalForward};\n`;
        codeString += `${this._codeVariableName}.debugMode = ${this.debugMode};\n`;
        codeString += `${this._codeVariableName}.debugLimit = ${this.debugLimit};\n`;
        codeString += `${this._codeVariableName}.debugFactor = ${this.debugFactor};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        if (this.light) {
            serializationObject.lightId = this.light.id;
        }
        serializationObject.lightFalloff = this.lightFalloff;
        serializationObject.useAlphaTest = this.useAlphaTest;
        serializationObject.alphaTestCutoff = this.alphaTestCutoff;
        serializationObject.useAlphaBlending = this.useAlphaBlending;
        serializationObject.useRadianceOverAlpha = this.useRadianceOverAlpha;
        serializationObject.useSpecularOverAlpha = this.useSpecularOverAlpha;
        serializationObject.enableSpecularAntiAliasing = this.enableSpecularAntiAliasing;
        serializationObject.realTimeFiltering = this.realTimeFiltering;
        serializationObject.realTimeFilteringQuality = this.realTimeFilteringQuality;
        serializationObject.useEnergyConservation = this.useEnergyConservation;
        serializationObject.useRadianceOcclusion = this.useRadianceOcclusion;
        serializationObject.useHorizonOcclusion = this.useHorizonOcclusion;
        serializationObject.unlit = this.unlit;
        serializationObject.forceNormalForward = this.forceNormalForward;
        serializationObject.debugMode = this.debugMode;
        serializationObject.debugLimit = this.debugLimit;
        serializationObject.debugFactor = this.debugFactor;
        serializationObject.generateOnlyFragmentCode = this.generateOnlyFragmentCode;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        if (serializationObject.lightId) {
            this.light = scene.getLightById(serializationObject.lightId);
        }
        this.lightFalloff = serializationObject.lightFalloff ?? 0;
        this.useAlphaTest = serializationObject.useAlphaTest;
        this.alphaTestCutoff = serializationObject.alphaTestCutoff;
        this.useAlphaBlending = serializationObject.useAlphaBlending;
        this.useRadianceOverAlpha = serializationObject.useRadianceOverAlpha;
        this.useSpecularOverAlpha = serializationObject.useSpecularOverAlpha;
        this.enableSpecularAntiAliasing = serializationObject.enableSpecularAntiAliasing;
        this.realTimeFiltering = !!serializationObject.realTimeFiltering;
        this.realTimeFilteringQuality = serializationObject.realTimeFilteringQuality ?? 8;
        this.useEnergyConservation = serializationObject.useEnergyConservation;
        this.useRadianceOcclusion = serializationObject.useRadianceOcclusion;
        this.useHorizonOcclusion = serializationObject.useHorizonOcclusion;
        this.unlit = serializationObject.unlit;
        this.forceNormalForward = !!serializationObject.forceNormalForward;
        this.debugMode = serializationObject.debugMode;
        this.debugLimit = serializationObject.debugLimit;
        this.debugFactor = serializationObject.debugFactor;
        this.generateOnlyFragmentCode = !!serializationObject.generateOnlyFragmentCode;
        this._setTarget();
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Direct lights", 1 /* PropertyTypeForEdition.Float */, "INTENSITY", { min: 0, max: 1, notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "directIntensity", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Environment lights", 1 /* PropertyTypeForEdition.Float */, "INTENSITY", { min: 0, max: 1, notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "environmentIntensity", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Specular highlights", 1 /* PropertyTypeForEdition.Float */, "INTENSITY", { min: 0, max: 1, notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "specularIntensity", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Light falloff", 4 /* PropertyTypeForEdition.List */, "LIGHTING & COLORS", {
        notifiers: { update: true },
        options: [
            { label: "Physical", value: pbrBaseMaterial/* PBRBaseMaterial */.d.LIGHTFALLOFF_PHYSICAL },
            { label: "GLTF", value: pbrBaseMaterial/* PBRBaseMaterial */.d.LIGHTFALLOFF_GLTF },
            { label: "Standard", value: pbrBaseMaterial/* PBRBaseMaterial */.d.LIGHTFALLOFF_STANDARD },
        ],
    })
], PBRMetallicRoughnessBlock.prototype, "lightFalloff", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Alpha Testing", 0 /* PropertyTypeForEdition.Boolean */, "OPACITY")
], PBRMetallicRoughnessBlock.prototype, "useAlphaTest", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Alpha CutOff", 1 /* PropertyTypeForEdition.Float */, "OPACITY", { min: 0, max: 1, notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "alphaTestCutoff", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Alpha blending", 0 /* PropertyTypeForEdition.Boolean */, "OPACITY")
], PBRMetallicRoughnessBlock.prototype, "useAlphaBlending", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Radiance over alpha", 0 /* PropertyTypeForEdition.Boolean */, "RENDERING", { notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "useRadianceOverAlpha", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Specular over alpha", 0 /* PropertyTypeForEdition.Boolean */, "RENDERING", { notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "useSpecularOverAlpha", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Specular anti-aliasing", 0 /* PropertyTypeForEdition.Boolean */, "RENDERING", { notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "enableSpecularAntiAliasing", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Realtime filtering", 0 /* PropertyTypeForEdition.Boolean */, "RENDERING", { notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "realTimeFiltering", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Realtime filtering quality", 4 /* PropertyTypeForEdition.List */, "RENDERING", {
        notifiers: { update: true },
        options: [
            { label: "Low", value: 8 },
            { label: "Medium", value: 16 },
            { label: "High", value: 64 },
        ],
    })
], PBRMetallicRoughnessBlock.prototype, "realTimeFilteringQuality", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Energy Conservation", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "useEnergyConservation", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Radiance occlusion", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "useRadianceOcclusion", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Horizon occlusion", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "useHorizonOcclusion", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Unlit", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "unlit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Force normal forward", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "forceNormalForward", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Generate only fragment code", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", {
        notifiers: { rebuild: true, update: true, onValidation: PBRMetallicRoughnessBlock._OnGenerateOnlyFragmentCodeChanged },
    })
], PBRMetallicRoughnessBlock.prototype, "generateOnlyFragmentCode", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Debug mode", 4 /* PropertyTypeForEdition.List */, "DEBUG", {
        notifiers: { update: true },
        options: [
            { label: "None", value: 0 },
            // Geometry
            { label: "Normalized position", value: 1 },
            { label: "Normals", value: 2 },
            { label: "Tangents", value: 3 },
            { label: "Bitangents", value: 4 },
            { label: "Bump Normals", value: 5 },
            //{ label: "UV1", value: 6 },
            //{ label: "UV2", value: 7 },
            { label: "ClearCoat Normals", value: 8 },
            { label: "ClearCoat Tangents", value: 9 },
            { label: "ClearCoat Bitangents", value: 10 },
            { label: "Anisotropic Normals", value: 11 },
            { label: "Anisotropic Tangents", value: 12 },
            { label: "Anisotropic Bitangents", value: 13 },
            // Maps
            //{ label: "Emissive Map", value: 23 },
            //{ label: "Light Map", value: 24 },
            // Env
            { label: "Env Refraction", value: 40 },
            { label: "Env Reflection", value: 41 },
            { label: "Env Clear Coat", value: 42 },
            // Lighting
            { label: "Direct Diffuse", value: 50 },
            { label: "Direct Specular", value: 51 },
            { label: "Direct Clear Coat", value: 52 },
            { label: "Direct Sheen", value: 53 },
            { label: "Env Irradiance", value: 54 },
            // Lighting Params
            { label: "Surface Albedo", value: 60 },
            { label: "Reflectance 0", value: 61 },
            { label: "Metallic", value: 62 },
            { label: "Metallic F0", value: 71 },
            { label: "Roughness", value: 63 },
            { label: "AlphaG", value: 64 },
            { label: "NdotV", value: 65 },
            { label: "ClearCoat Color", value: 66 },
            { label: "ClearCoat Roughness", value: 67 },
            { label: "ClearCoat NdotV", value: 68 },
            { label: "Transmittance", value: 69 },
            { label: "Refraction Transmittance", value: 70 },
            // Misc
            { label: "SEO", value: 80 },
            { label: "EHO", value: 81 },
            { label: "Energy Factor", value: 82 },
            { label: "Specular Reflectance", value: 83 },
            { label: "Clear Coat Reflectance", value: 84 },
            { label: "Sheen Reflectance", value: 85 },
            { label: "Luminance Over Alpha", value: 86 },
            { label: "Alpha", value: 87 },
            { label: "Albedo color", value: 88 },
            { label: "Ambient occlusion color", value: 89 },
        ],
    })
], PBRMetallicRoughnessBlock.prototype, "debugMode", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Split position", 1 /* PropertyTypeForEdition.Float */, "DEBUG", { min: -1, max: 1, notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "debugLimit", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Output factor", 1 /* PropertyTypeForEdition.Float */, "DEBUG", { min: 0, max: 5, notifiers: { update: true } })
], PBRMetallicRoughnessBlock.prototype, "debugFactor", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PBRMetallicRoughnessBlock", PBRMetallicRoughnessBlock);
//# sourceMappingURL=pbrMetallicRoughnessBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/index.js







//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/index.js



//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/modBlock.js




/**
 * Block used to compute value of one parameter modulo another
 */
class ModBlock extends NodeMaterialBlock {
    /**
     * Creates a new ModBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ModBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        if (state.shaderLanguage === 0 /* ShaderLanguage.GLSL */) {
            state.compilationString += state._declareOutput(output) + ` = mod(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`;
        }
        else {
            state.compilationString += state._declareOutput(output) + ` = (${this.left.associatedVariableName} % ${this.right.associatedVariableName});\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ModBlock", ModBlock);
//# sourceMappingURL=modBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/matrixBuilderBlock.js






/**
 * Block used to build a matrix from 4 Vector4
 */
class MatrixBuilderBlock extends NodeMaterialBlock {
    /**
     * Creates a new MatrixBuilder
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("row0", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("row1", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("row2", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerInput("row3", NodeMaterialBlockConnectionPointTypes.Vector4);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MatrixBuilder";
    }
    /**
     * Gets the row0 vector
     */
    get row0() {
        return this._inputs[0];
    }
    /**
     * Gets the row1 vector
     */
    get row1() {
        return this._inputs[1];
    }
    /**
     * Gets the row2 vector
     */
    get row2() {
        return this._inputs[2];
    }
    /**
     * Gets the row3 vector
     */
    get row3() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.row0.isConnected) {
            const row0Input = new InputBlock("row0");
            row0Input.value = new math_vector/* Vector4 */.IU(1, 0, 0, 0);
            row0Input.output.connectTo(this.row0);
        }
        if (!this.row1.isConnected) {
            const row1Input = new InputBlock("row1");
            row1Input.value = new math_vector/* Vector4 */.IU(0, 1, 0, 0);
            row1Input.output.connectTo(this.row1);
        }
        if (!this.row2.isConnected) {
            const row2Input = new InputBlock("row2");
            row2Input.value = new math_vector/* Vector4 */.IU(0, 0, 1, 0);
            row2Input.output.connectTo(this.row2);
        }
        if (!this.row3.isConnected) {
            const row3Input = new InputBlock("row3");
            row3Input.value = new math_vector/* Vector4 */.IU(0, 0, 0, 1);
            row3Input.output.connectTo(this.row3);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const row0 = this.row0;
        const row1 = this.row1;
        const row2 = this.row2;
        const row3 = this.row3;
        const mat4 = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "mat4x4f" : "mat4";
        state.compilationString +=
            state._declareOutput(output) +
                ` = ${mat4}(${row0.associatedVariableName}, ${row1.associatedVariableName}, ${row2.associatedVariableName}, ${row3.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MatrixBuilder", MatrixBuilderBlock);
//# sourceMappingURL=matrixBuilderBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/conditionalBlock.js







/**
 * Operations supported by the ConditionalBlock block
 */
var ConditionalBlockConditions;
(function (ConditionalBlockConditions) {
    /** Equal */
    ConditionalBlockConditions[ConditionalBlockConditions["Equal"] = 0] = "Equal";
    /** NotEqual */
    ConditionalBlockConditions[ConditionalBlockConditions["NotEqual"] = 1] = "NotEqual";
    /** LessThan */
    ConditionalBlockConditions[ConditionalBlockConditions["LessThan"] = 2] = "LessThan";
    /** GreaterThan */
    ConditionalBlockConditions[ConditionalBlockConditions["GreaterThan"] = 3] = "GreaterThan";
    /** LessOrEqual */
    ConditionalBlockConditions[ConditionalBlockConditions["LessOrEqual"] = 4] = "LessOrEqual";
    /** GreaterOrEqual */
    ConditionalBlockConditions[ConditionalBlockConditions["GreaterOrEqual"] = 5] = "GreaterOrEqual";
    /** Logical Exclusive OR */
    ConditionalBlockConditions[ConditionalBlockConditions["Xor"] = 6] = "Xor";
    /** Logical Or */
    ConditionalBlockConditions[ConditionalBlockConditions["Or"] = 7] = "Or";
    /** Logical And */
    ConditionalBlockConditions[ConditionalBlockConditions["And"] = 8] = "And";
})(ConditionalBlockConditions || (ConditionalBlockConditions = {}));
/**
 * Block used to apply conditional operation between floats
 * @since 5.0.0
 */
class ConditionalBlock extends NodeMaterialBlock {
    /**
     * Creates a new ConditionalBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Gets or sets the condition applied by the block
         */
        this.condition = ConditionalBlockConditions.LessThan;
        this.registerInput("a", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("b", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("true", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.registerInput("false", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._linkConnectionTypes(2, 3);
        this._outputs[0]._typeConnectionSource = this._inputs[2];
        this._outputs[0]._defaultConnectionPointType = NodeMaterialBlockConnectionPointTypes.Float;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ConditionalBlock";
    }
    /**
     * Gets the first operand component
     */
    get a() {
        return this._inputs[0];
    }
    /**
     * Gets the second operand component
     */
    get b() {
        return this._inputs[1];
    }
    /**
     * Gets the value to return if condition is true
     */
    get true() {
        return this._inputs[2];
    }
    /**
     * Gets the value to return if condition is false
     */
    get false() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    autoConfigure(nodeMaterial) {
        if (!this.true.isConnected) {
            const minInput = nodeMaterial.getBlockByPredicate((b) => b.isInput && b.value === 1 && b.name === "True") || new InputBlock("True");
            minInput.value = 1;
            minInput.output.connectTo(this.true);
        }
        if (!this.false.isConnected) {
            const maxInput = nodeMaterial.getBlockByPredicate((b) => b.isInput && b.value === 0 && b.name === "False") || new InputBlock("False");
            maxInput.value = 0;
            maxInput.output.connectTo(this.false);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const trueStatement = this.true.isConnected ? this.true.associatedVariableName : "1.0";
        const falseStatement = this.false.isConnected ? this.false.associatedVariableName : "0.0";
        switch (this.condition) {
            case ConditionalBlockConditions.Equal: {
                state.compilationString +=
                    state._declareOutput(output) +
                        ` = ${state._generateTernary(trueStatement, falseStatement, `${this.a.associatedVariableName} == ${this.b.associatedVariableName}`)};\n`;
                break;
            }
            case ConditionalBlockConditions.NotEqual: {
                state.compilationString +=
                    state._declareOutput(output) +
                        ` = ${state._generateTernary(trueStatement, falseStatement, `${this.a.associatedVariableName} != ${this.b.associatedVariableName}`)};\n`;
                break;
            }
            case ConditionalBlockConditions.LessThan: {
                state.compilationString +=
                    state._declareOutput(output) +
                        ` = ${state._generateTernary(trueStatement, falseStatement, `${this.a.associatedVariableName} < ${this.b.associatedVariableName}`)};\n`;
                break;
            }
            case ConditionalBlockConditions.LessOrEqual: {
                state.compilationString +=
                    state._declareOutput(output) +
                        ` = ${state._generateTernary(trueStatement, falseStatement, `${this.a.associatedVariableName} <= ${this.b.associatedVariableName}`)};\n`;
                break;
            }
            case ConditionalBlockConditions.GreaterThan: {
                state.compilationString +=
                    state._declareOutput(output) +
                        ` = ${state._generateTernary(trueStatement, falseStatement, `${this.a.associatedVariableName} > ${this.b.associatedVariableName}`)};\n`;
                break;
            }
            case ConditionalBlockConditions.GreaterOrEqual: {
                state.compilationString +=
                    state._declareOutput(output) +
                        ` = ${state._generateTernary(trueStatement, falseStatement, `${this.a.associatedVariableName} >= ${this.b.associatedVariableName}`)};\n`;
                break;
            }
            case ConditionalBlockConditions.Xor: {
                state.compilationString +=
                    state._declareOutput(output) +
                        ` = ${state._generateTernary(trueStatement, falseStatement, `(((${this.a.associatedVariableName} + ${this.b.associatedVariableName}) % 2.0) > 0.0)`)};\n`;
                break;
            }
            case ConditionalBlockConditions.Or: {
                state.compilationString +=
                    state._declareOutput(output) +
                        ` = ${state._generateTernary(trueStatement, falseStatement, `(min(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 1.0) > 0.0)`)};\n`;
                break;
            }
            case ConditionalBlockConditions.And: {
                state.compilationString +=
                    state._declareOutput(output) +
                        ` = ${state._generateTernary(trueStatement, falseStatement, `(${this.a.associatedVariableName} * ${this.b.associatedVariableName} > 0.0)`)};\n`;
                break;
            }
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.condition = this.condition;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.condition = serializationObject.condition;
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.condition = BABYLON.ConditionalBlockConditions.${ConditionalBlockConditions[this.condition]};\n`;
        return codeString;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Condition", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "Equal", value: ConditionalBlockConditions.Equal },
            { label: "NotEqual", value: ConditionalBlockConditions.NotEqual },
            { label: "LessThan", value: ConditionalBlockConditions.LessThan },
            { label: "GreaterThan", value: ConditionalBlockConditions.GreaterThan },
            { label: "LessOrEqual", value: ConditionalBlockConditions.LessOrEqual },
            { label: "GreaterOrEqual", value: ConditionalBlockConditions.GreaterOrEqual },
            { label: "Xor", value: ConditionalBlockConditions.Xor },
            { label: "And", value: ConditionalBlockConditions.And },
            { label: "Or", value: ConditionalBlockConditions.Or },
        ],
    })
], ConditionalBlock.prototype, "condition", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ConditionalBlock", ConditionalBlock);
//# sourceMappingURL=conditionalBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/cloudBlock.js






/**
 * block used to Generate Fractal Brownian Motion Clouds
 */
class CloudBlock extends NodeMaterialBlock {
    /**
     * Creates a new CloudBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /** Gets or sets the number of octaves */
        this.octaves = 6.0;
        this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("chaos", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);
        this.registerInput("offsetX", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("offsetY", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("offsetZ", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
        this._inputs[0].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);
        this._inputs[0].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector3);
        this._linkConnectionTypes(0, 1);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "CloudBlock";
    }
    /**
     * Gets the seed input component
     */
    get seed() {
        return this._inputs[0];
    }
    /**
     * Gets the chaos input component
     */
    get chaos() {
        return this._inputs[1];
    }
    /**
     * Gets the offset X input component
     */
    get offsetX() {
        return this._inputs[2];
    }
    /**
     * Gets the offset Y input component
     */
    get offsetY() {
        return this._inputs[3];
    }
    /**
     * Gets the offset Z input component
     */
    get offsetZ() {
        return this._inputs[4];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (!this.seed.isConnected) {
            return;
        }
        if (!this._outputs[0].hasEndpoints) {
            return;
        }
        let functionString = `

        float cloudRandom(float p) { 
            float temp = fract(p * 0.011); 
            temp *= temp + 7.5; 
            temp *= temp + temp; 
            return fract(temp); 
        }

        // Based on Morgan McGuire @morgan3d
        // https://www.shadertoy.com/view/4dS3Wd
        float cloudNoise2(vec2 x, vec2 chaos) {
            vec2 step = chaos * vec2(75., 120.) + vec2(75., 120.);

            vec2 i = floor(x);
            vec2 f = fract(x);

            float n = dot(i, step);

            vec2 u = f * f * (3.0 - 2.0 * f);
            return mix(
                    mix(cloudRandom(n + dot(step, vec2(0, 0))), cloudRandom(n + dot(step, vec2(1, 0))), u.x),
                    mix(cloudRandom(n + dot(step, vec2(0, 1))), cloudRandom(n + dot(step, vec2(1, 1))), u.x),
                    u.y
                );
        }

        float cloudNoise3(vec3 x, vec3 chaos) {
            vec3 step = chaos * vec3(60., 120., 75.) + vec3(60., 120., 75.);

            vec3 i = floor(x);
            vec3 f = fract(x);

            float n = dot(i, step);

            vec3 u = f * f * (3.0 - 2.0 * f);
            return mix(mix(mix( cloudRandom(n + dot(step, vec3(0, 0, 0))), cloudRandom(n + dot(step, vec3(1, 0, 0))), u.x),
                           mix( cloudRandom(n + dot(step, vec3(0, 1, 0))), cloudRandom(n + dot(step, vec3(1, 1, 0))), u.x), u.y),
                       mix(mix( cloudRandom(n + dot(step, vec3(0, 0, 1))), cloudRandom(n + dot(step, vec3(1, 0, 1))), u.x),
                           mix( cloudRandom(n + dot(step, vec3(0, 1, 1))), cloudRandom(n + dot(step, vec3(1, 1, 1))), u.x), u.y), u.z);
        }`;
        let fractalBrownianString = `
        float fbm2(vec2 st, vec2 chaos) {
            // Initial values
            float value = 0.0;
            float amplitude = .5;
            float frequency = 0.;

            // Loop of octaves
            vec2 tempST = st;
            for (int i = 0; i < OCTAVES; i++) {
                value += amplitude * cloudNoise2(tempST, chaos);
                tempST *= 2.0;
                amplitude *= 0.5;
            }
            return value;
        }

        float fbm3(vec3 x, vec3 chaos) {
            // Initial values
            float value = 0.0;
            float amplitude = 0.5;
            vec3 tempX = x;
            for (int i = 0; i < OCTAVES; i++) {
                value += amplitude * cloudNoise3(tempX, chaos);
                tempX = tempX * 2.0;
                amplitude *= 0.5;
            }
            return value;
        }`;
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            functionString = state._babylonSLtoWGSL(functionString);
            fractalBrownianString = state._babylonSLtoWGSL(fractalBrownianString);
        }
        const fbmNewName = `fbm${this.octaves}`;
        state._emitFunction("CloudBlockCode", functionString, "// CloudBlockCode");
        state._emitFunction("CloudBlockCodeFBM" + this.octaves, fractalBrownianString.replace(/fbm/gi, fbmNewName).replace(/OCTAVES/gi, (this.octaves | 0).toString()), "// CloudBlockCode FBM");
        const localVariable = state._getFreeVariableName("st");
        const seedType = this.seed.connectedPoint?.type || NodeMaterialBlockConnectionPointTypes.Vector3;
        state.compilationString += `${state._declareLocalVar(localVariable, seedType)} = ${this.seed.associatedVariableName};\n`;
        if (this.offsetX.isConnected) {
            state.compilationString += `${localVariable}.x += 0.1 * ${this.offsetX.associatedVariableName};\n`;
        }
        if (this.offsetY.isConnected) {
            state.compilationString += `${localVariable}.y += 0.1 * ${this.offsetY.associatedVariableName};\n`;
        }
        if (this.offsetZ.isConnected && seedType === NodeMaterialBlockConnectionPointTypes.Vector3) {
            state.compilationString += `${localVariable}.z += 0.1 * ${this.offsetZ.associatedVariableName};\n`;
        }
        let chaosValue = "";
        if (this.chaos.isConnected) {
            chaosValue = this.chaos.associatedVariableName;
        }
        else {
            const addF = state.fSuffix;
            chaosValue = this.seed.connectedPoint?.type === NodeMaterialBlockConnectionPointTypes.Vector2 ? `vec2${addF}(0., 0.)` : `vec3${addF}(0., 0., 0.)`;
        }
        state.compilationString +=
            state._declareOutput(this._outputs[0]) +
                ` = ${fbmNewName}${this.seed.connectedPoint?.type === NodeMaterialBlockConnectionPointTypes.Vector2 ? "2" : "3"}(${localVariable}, ${chaosValue});\n`;
        return this;
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.octaves = ${this.octaves};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.octaves = this.octaves;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.octaves = serializationObject.octaves;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Octaves", 2 /* PropertyTypeForEdition.Int */, undefined, { embedded: true })
], CloudBlock.prototype, "octaves", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CloudBlock", CloudBlock);
//# sourceMappingURL=cloudBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/voronoiNoiseBlock.js




/**
 * block used to Generate a Voronoi Noise Pattern
 */
class VoronoiNoiseBlock extends NodeMaterialBlock {
    /**
     * Creates a new VoronoiNoiseBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.Vector2);
        this.registerInput("offset", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerInput("density", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
        this.registerOutput("cells", NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "VoronoiNoiseBlock";
    }
    /**
     * Gets the seed input component
     */
    get seed() {
        return this._inputs[0];
    }
    /**
     * Gets the offset input component
     */
    get offset() {
        return this._inputs[1];
    }
    /**
     * Gets the density input component
     */
    get density() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the output component
     */
    get cells() {
        return this._outputs[1];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (!this.seed.isConnected) {
            return;
        }
        // Adapted from https://www.shadertoy.com/view/MslGD8
        let functionString = `vec2 voronoiRandom(vec2 p){
            p = vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3)));
            return fract(sin(p)*18.5453);
        }
        `;
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            functionString = state._babylonSLtoWGSL(functionString);
        }
        state._emitFunction("voronoiRandom", functionString, "// Voronoi random generator");
        functionString = `void voronoi(vec2 seed, float offset, float density, out float outValue, out float cells){
            vec2 n = floor(seed * density);
            vec2 f = fract(seed * density);
            vec3 m = vec3( 8.0 );
            for( int j=-1; j<=1; j++ ){
                for( int i=-1; i<=1; i++ ){
                    vec2  g = vec2( float(i), float(j) );
                    vec2  o = voronoiRandom( n + g);
                    vec2  r = g - f + (0.5+0.5*sin(offset+6.2831*o));
                    float d = dot( r, r );
                    if( d<m.x ){
                        m = vec3( d, o );
                        outValue = m.x;
                        cells = m.y;
                    }
                }
			}
        }
        `;
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            functionString = state._babylonSLtoWGSL(functionString);
        }
        else {
            functionString = state._babylonSLtoGLSL(functionString);
        }
        state._emitFunction("voronoi", functionString, "// Voronoi");
        const tempOutput = state._getFreeVariableName("tempOutput");
        const tempCells = state._getFreeVariableName("tempCells");
        const ref = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "&" : "";
        state.compilationString += `${state._declareLocalVar(tempOutput, NodeMaterialBlockConnectionPointTypes.Float)} = 0.0;\n`;
        state.compilationString += `${state._declareLocalVar(tempCells, NodeMaterialBlockConnectionPointTypes.Float)} = 0.0;\n`;
        state.compilationString += `voronoi(${this.seed.associatedVariableName}, ${this.offset.associatedVariableName}, ${this.density.associatedVariableName}, ${ref}${tempOutput}, ${ref}${tempCells});\n`;
        if (this.output.hasEndpoints) {
            state.compilationString += state._declareOutput(this.output) + ` = ${tempOutput};\n`;
        }
        if (this.cells.hasEndpoints) {
            state.compilationString += state._declareOutput(this.cells) + ` = ${tempCells};\n`;
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.VoronoiNoiseBlock", VoronoiNoiseBlock);
//# sourceMappingURL=voronoiNoiseBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/elbowBlock.js




/**
 * Block used as a pass through
 */
class ElbowBlock extends NodeMaterialBlock {
    /**
     * Creates a new ElbowBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ElbowBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets or sets the target of the block
     */
    get target() {
        const input = this._inputs[0];
        if (input.isConnected) {
            const block = input.connectedPoint.ownerBlock;
            if (block.target !== NodeMaterialBlockTargets.VertexAndFragment) {
                return block.target;
            }
            if (input.connectedPoint.target !== NodeMaterialBlockTargets.VertexAndFragment) {
                return input.connectedPoint.target;
            }
        }
        return this._target;
    }
    set target(value) {
        if ((this._target & value) !== 0) {
            return;
        }
        this._target = value;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const input = this._inputs[0];
        state.compilationString += state._declareOutput(output) + ` = ${input.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ElbowBlock", ElbowBlock);
//# sourceMappingURL=elbowBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/triPlanarBlock.js













/**
 * Block used to read a texture with triplanar mapping (see "boxmap" in https://iquilezles.org/articles/biplanar/)
 */
class TriPlanarBlock extends NodeMaterialBlock {
    /**
     * Gets or sets the texture associated with the node
     */
    get texture() {
        if (this.source.isConnected) {
            return (this.source.connectedPoint?.ownerBlock).texture;
        }
        return this._texture;
    }
    set texture(texture) {
        if (this._texture === texture) {
            return;
        }
        const scene = texture?.getScene() ?? engineStore/* EngineStore */.q.LastCreatedScene;
        if (!texture && scene) {
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this._texture);
            });
        }
        this._texture = texture;
        if (texture && scene) {
            scene.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(texture);
            });
        }
    }
    /**
     * Gets the textureY associated with the node
     */
    get textureY() {
        if (this.sourceY.isConnected) {
            return (this.sourceY.connectedPoint?.ownerBlock).texture;
        }
        return null;
    }
    /**
     * Gets the textureZ associated with the node
     */
    get textureZ() {
        if (this.sourceZ?.isConnected) {
            return (this.sourceY.connectedPoint?.ownerBlock).texture;
        }
        return null;
    }
    _getImageSourceBlock(connectionPoint) {
        return connectionPoint?.isConnected ? connectionPoint.connectedPoint.ownerBlock : null;
    }
    /**
     * Gets the sampler name associated with this texture
     */
    get samplerName() {
        const imageSourceBlock = this._getImageSourceBlock(this.source);
        if (imageSourceBlock) {
            return imageSourceBlock.samplerName;
        }
        return this._samplerName;
    }
    /**
     * Gets the samplerY name associated with this texture
     */
    get samplerYName() {
        return this._getImageSourceBlock(this.sourceY)?.samplerName ?? null;
    }
    /**
     * Gets the samplerZ name associated with this texture
     */
    get samplerZName() {
        return this._getImageSourceBlock(this.sourceZ)?.samplerName ?? null;
    }
    /**
     * Gets a boolean indicating that this block is linked to an ImageSourceBlock
     */
    get hasImageSource() {
        return this.source.isConnected;
    }
    /**
     * Gets or sets a boolean indicating if content needs to be converted to gamma space
     */
    set convertToGammaSpace(value) {
        if (value === this._convertToGammaSpace) {
            return;
        }
        this._convertToGammaSpace = value;
        if (this.texture) {
            const scene = this.texture.getScene() ?? engineStore/* EngineStore */.q.LastCreatedScene;
            scene?.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this.texture);
            });
        }
    }
    get convertToGammaSpace() {
        return this._convertToGammaSpace;
    }
    /**
     * Gets or sets a boolean indicating if content needs to be converted to linear space
     */
    set convertToLinearSpace(value) {
        if (value === this._convertToLinearSpace) {
            return;
        }
        this._convertToLinearSpace = value;
        if (this.texture) {
            const scene = this.texture.getScene() ?? engineStore/* EngineStore */.q.LastCreatedScene;
            scene?.markAllMaterialsAsDirty(1, (mat) => {
                return mat.hasTexture(this.texture);
            });
        }
    }
    get convertToLinearSpace() {
        return this._convertToLinearSpace;
    }
    /**
     * Create a new TriPlanarBlock
     * @param name defines the block name
     * @param hideSourceZ defines a boolean indicating that normal Z should not be used (false by default)
     */
    constructor(name, hideSourceZ = false) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Project the texture(s) for a better fit to a cube
         */
        this.projectAsCube = false;
        this._convertToGammaSpace = false;
        this._convertToLinearSpace = false;
        /**
         * Gets or sets a boolean indicating if multiplication of texture with level should be disabled
         */
        this.disableLevelMultiplication = false;
        this.registerInput("position", NodeMaterialBlockConnectionPointTypes.AutoDetect, false);
        this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect, false);
        this.registerInput("sharpness", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerInput("source", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("source", this, 0 /* NodeMaterialConnectionPointDirection.Input */, ImageSourceBlock, "ImageSourceBlock"));
        this.registerInput("sourceY", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("sourceY", this, 0 /* NodeMaterialConnectionPointDirection.Input */, ImageSourceBlock, "ImageSourceBlock"));
        if (!hideSourceZ) {
            this.registerInput("sourceZ", NodeMaterialBlockConnectionPointTypes.Object, true, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("sourceZ", this, 0 /* NodeMaterialConnectionPointDirection.Input */, ImageSourceBlock, "ImageSourceBlock"));
        }
        this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this.registerOutput("level", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Neutral);
        this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
        this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TriPlanarBlock";
    }
    /**
     * Gets the position input component
     */
    get position() {
        return this._inputs[0];
    }
    /**
     * Gets the normal input component
     */
    get normal() {
        return this._inputs[1];
    }
    /**
     * Gets the sharpness input component
     */
    get sharpness() {
        return this._inputs[2];
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[3];
    }
    /**
     * Gets the sourceY input component
     */
    get sourceY() {
        return this._inputs[4];
    }
    /**
     * Gets the sourceZ input component
     */
    get sourceZ() {
        return this._inputs[5];
    }
    /**
     * Gets the rgba output component
     */
    get rgba() {
        return this._outputs[0];
    }
    /**
     * Gets the rgb output component
     */
    get rgb() {
        return this._outputs[1];
    }
    /**
     * Gets the r output component
     */
    get r() {
        return this._outputs[2];
    }
    /**
     * Gets the g output component
     */
    get g() {
        return this._outputs[3];
    }
    /**
     * Gets the b output component
     */
    get b() {
        return this._outputs[4];
    }
    /**
     * Gets the a output component
     */
    get a() {
        return this._outputs[5];
    }
    /**
     * Gets the level output component
     */
    get level() {
        return this._outputs[6];
    }
    prepareDefines(mesh, nodeMaterial, defines) {
        if (!defines._areTexturesDirty) {
            return;
        }
        const toGamma = this.convertToGammaSpace && this.texture && !this.texture.gammaSpace;
        const toLinear = this.convertToLinearSpace && this.texture && this.texture.gammaSpace;
        // Not a bug... Name defines the texture space not the required conversion
        defines.setValue(this._linearDefineName, toGamma, true);
        defines.setValue(this._gammaDefineName, toLinear, true);
    }
    isReady() {
        if (this.texture && !this.texture.isReadyOrNotBlocking()) {
            return false;
        }
        return true;
    }
    bind(effect) {
        if (!this.texture) {
            return;
        }
        effect.setFloat(this._textureInfoName, this.texture.level);
        if (!this._imageSource) {
            effect.setTexture(this._samplerName, this.texture);
        }
    }
    _samplerFunc(state) {
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return "textureSample";
        }
        return "texture2D";
    }
    _generateTextureSample(textureName, uv, state) {
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return `${this._samplerFunc(state)}(${textureName},${textureName + `Sampler`}, ${uv})`;
        }
        return `${this._samplerFunc(state)}(${textureName}, ${uv})`;
    }
    _generateTextureLookup(state) {
        const samplerName = this.samplerName;
        const samplerYName = this.samplerYName ?? samplerName;
        const samplerZName = this.samplerZName ?? samplerName;
        const sharpness = this.sharpness.isConnected ? this.sharpness.associatedVariableName : "1.0";
        const x = state._getFreeVariableName("x");
        const y = state._getFreeVariableName("y");
        const z = state._getFreeVariableName("z");
        const w = state._getFreeVariableName("w");
        const n = state._getFreeVariableName("n");
        const uvx = state._getFreeVariableName("uvx");
        const uvy = state._getFreeVariableName("uvy");
        const uvz = state._getFreeVariableName("uvz");
        state.compilationString += `
            ${state._declareLocalVar(n, NodeMaterialBlockConnectionPointTypes.Vector3)} = ${this.normal.associatedVariableName}.xyz;

            ${state._declareLocalVar(uvx, NodeMaterialBlockConnectionPointTypes.Vector2)} = ${this.position.associatedVariableName}.yz;
            ${state._declareLocalVar(uvy, NodeMaterialBlockConnectionPointTypes.Vector2)} = ${this.position.associatedVariableName}.zx;
            ${state._declareLocalVar(uvz, NodeMaterialBlockConnectionPointTypes.Vector2)} = ${this.position.associatedVariableName}.xy;
        `;
        if (this.projectAsCube) {
            state.compilationString += `
                ${uvx}.xy = ${uvx}.yx;

                if (${n}.x >= 0.0) {
                    ${uvx}.x = -${uvx}.x;
                }
                if (${n}.y < 0.0) {
                    ${uvy}.y = -${uvy}.y;
                }
                if (${n}.z < 0.0) {
                    ${uvz}.x = -${uvz}.x;
                }
            `;
        }
        const suffix = state.fSuffix;
        state.compilationString += `
            ${state._declareLocalVar(x, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this._generateTextureSample(samplerName, uvx, state)};
            ${state._declareLocalVar(y, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this._generateTextureSample(samplerYName, uvy, state)};
            ${state._declareLocalVar(z, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this._generateTextureSample(samplerZName, uvz, state)};
           
            // blend weights
            ${state._declareLocalVar(w, NodeMaterialBlockConnectionPointTypes.Vector3)} = pow(abs(${n}), vec3${suffix}(${sharpness}));

            // blend and return
            ${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = (${x}*${w}.x + ${y}*${w}.y + ${z}*${w}.z) / (${w}.x + ${w}.y + ${w}.z);        
        `;
    }
    _generateConversionCode(state, output, swizzle) {
        let vecSpecifier = "";
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ &&
            (output.type === NodeMaterialBlockConnectionPointTypes.Vector3 || output.type === NodeMaterialBlockConnectionPointTypes.Color3)) {
            vecSpecifier = "Vec3";
        }
        if (swizzle !== "a") {
            // no conversion if the output is "a" (alpha)
            if (!this.texture || !this.texture.gammaSpace) {
                state.compilationString += `#ifdef ${this._linearDefineName}
                    ${output.associatedVariableName} = toGammaSpace${vecSpecifier}(${output.associatedVariableName});
                    #endif
                `;
            }
            state.compilationString += `#ifdef ${this._gammaDefineName}
                ${output.associatedVariableName} = toLinearSpace${vecSpecifier}(${output.associatedVariableName});
                #endif
            `;
        }
    }
    _writeOutput(state, output, swizzle) {
        let complement = "";
        if (!this.disableLevelMultiplication) {
            complement = ` * ${state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "uniforms." : ""}${this._textureInfoName}`;
        }
        state.compilationString += `${state._declareOutput(output)} = ${this._tempTextureRead}.${swizzle}${complement};\n`;
        this._generateConversionCode(state, output, swizzle);
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (this.source.isConnected) {
            this._imageSource = this.source.connectedPoint.ownerBlock;
        }
        else {
            this._imageSource = null;
        }
        this._textureInfoName = state._getFreeVariableName("textureInfoName");
        this.level.associatedVariableName = (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "uniforms." : "") + this._textureInfoName;
        this._tempTextureRead = state._getFreeVariableName("tempTextureRead");
        this._linearDefineName = state._getFreeDefineName("ISLINEAR");
        this._gammaDefineName = state._getFreeDefineName("ISGAMMA");
        if (!this._imageSource) {
            this._samplerName = state._getFreeVariableName(this.name + "Texture");
            state._emit2DSampler(this._samplerName);
        }
        // Declarations
        state.sharedData.blockingBlocks.push(this);
        state.sharedData.textureBlocks.push(this);
        state.sharedData.blocksWithDefines.push(this);
        state.sharedData.bindableBlocks.push(this);
        const comments = `//${this.name}`;
        state._emitFunctionFromInclude("helperFunctions", comments);
        state._emitUniformFromString(this._textureInfoName, NodeMaterialBlockConnectionPointTypes.Float);
        this._generateTextureLookup(state);
        for (const output of this._outputs) {
            if (output.hasEndpoints && output.name !== "level") {
                this._writeOutput(state, output, output.name);
            }
        }
        return this;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.convertToGammaSpace = ${this.convertToGammaSpace};\n`;
        codeString += `${this._codeVariableName}.convertToLinearSpace = ${this.convertToLinearSpace};\n`;
        codeString += `${this._codeVariableName}.disableLevelMultiplication = ${this.disableLevelMultiplication};\n`;
        codeString += `${this._codeVariableName}.projectAsCube = ${this.projectAsCube};\n`;
        if (!this.texture) {
            return codeString;
        }
        codeString += `${this._codeVariableName}.texture = new BABYLON.Texture("${this.texture.name}", null, ${this.texture.noMipmap}, ${this.texture.invertY}, ${this.texture.samplingMode});\n`;
        codeString += `${this._codeVariableName}.texture.wrapU = ${this.texture.wrapU};\n`;
        codeString += `${this._codeVariableName}.texture.wrapV = ${this.texture.wrapV};\n`;
        codeString += `${this._codeVariableName}.texture.uAng = ${this.texture.uAng};\n`;
        codeString += `${this._codeVariableName}.texture.vAng = ${this.texture.vAng};\n`;
        codeString += `${this._codeVariableName}.texture.wAng = ${this.texture.wAng};\n`;
        codeString += `${this._codeVariableName}.texture.uOffset = ${this.texture.uOffset};\n`;
        codeString += `${this._codeVariableName}.texture.vOffset = ${this.texture.vOffset};\n`;
        codeString += `${this._codeVariableName}.texture.uScale = ${this.texture.uScale};\n`;
        codeString += `${this._codeVariableName}.texture.vScale = ${this.texture.vScale};\n`;
        codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\n`;
        return codeString;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.convertToGammaSpace = this.convertToGammaSpace;
        serializationObject.convertToLinearSpace = this.convertToLinearSpace;
        serializationObject.disableLevelMultiplication = this.disableLevelMultiplication;
        serializationObject.projectAsCube = this.projectAsCube;
        if (!this.hasImageSource && this.texture && !this.texture.isRenderTarget && this.texture.getClassName() !== "VideoTexture") {
            serializationObject.texture = this.texture.serialize();
        }
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.convertToGammaSpace = serializationObject.convertToGammaSpace;
        this.convertToLinearSpace = !!serializationObject.convertToLinearSpace;
        this.disableLevelMultiplication = !!serializationObject.disableLevelMultiplication;
        this.projectAsCube = !!serializationObject.projectAsCube;
        if (serializationObject.texture && !NodeMaterial.IgnoreTexturesAtLoadTime && serializationObject.texture.url !== undefined) {
            rootUrl = serializationObject.texture.url.indexOf("data:") === 0 ? "" : rootUrl;
            this.texture = Textures_texture/* Texture */.g.Parse(serializationObject.texture, scene, rootUrl);
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Project as cube", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { update: true } })
], TriPlanarBlock.prototype, "projectAsCube", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TriPlanarBlock", TriPlanarBlock);
//# sourceMappingURL=triPlanarBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/biPlanarBlock.js




/**
 * Block used to read a texture with triplanar mapping (see https://iquilezles.org/articles/biplanar/)
 */
class BiPlanarBlock extends TriPlanarBlock {
    /**
     * Create a new BiPlanarBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, true);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "BiPlanarBlock";
    }
    _declareLocalVarAsVec3I(name, state) {
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return `var ${name}: vec3<i32>`;
        }
        else {
            return `ivec3 ${name}`;
        }
    }
    _getTextureGrad(state, samplerName) {
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return `textureSampleGrad(${samplerName},${samplerName + `Sampler`}`;
        }
        return `textureGrad(${samplerName}`;
    }
    _generateTextureLookup(state) {
        const samplerName = this.samplerName;
        const samplerYName = this.samplerYName ?? this.samplerName;
        const sharpness = this.sharpness.isConnected ? this.sharpness.associatedVariableName : "1.0";
        const dpdx = state._getFreeVariableName("dxValue");
        const dpdy = state._getFreeVariableName("dyValue");
        const n = state._getFreeVariableName("n");
        const ma = state._getFreeVariableName("ma");
        const mi = state._getFreeVariableName("mi");
        const me = state._getFreeVariableName("me");
        const x = state._getFreeVariableName("x");
        const y = state._getFreeVariableName("y");
        const w = state._getFreeVariableName("w");
        let ivec3 = "ivec3";
        let dpdxFunc = "dFdx";
        let dpdyFunc = "dFdy";
        const suffix = state.fSuffix;
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            ivec3 = "vec3<i32>";
            dpdxFunc = "dpdx";
            dpdyFunc = "dpdy";
        }
        state.compilationString += `
            // grab coord derivatives for texturing
            ${state._declareLocalVar(dpdx, NodeMaterialBlockConnectionPointTypes.Vector3)} = ${dpdxFunc}(${this.position.associatedVariableName}.xyz);
            ${state._declareLocalVar(dpdy, NodeMaterialBlockConnectionPointTypes.Vector3)} = ${dpdyFunc}(${this.position.associatedVariableName}.xyz);
            ${state._declareLocalVar(n, NodeMaterialBlockConnectionPointTypes.Vector3)} = abs(${this.normal.associatedVariableName}.xyz);
        
            // determine major axis (in x; yz are following axis)
            ${this._declareLocalVarAsVec3I(ma, state)} = ${state._generateTernary(`${ivec3}(0,1,2)`, `${state._generateTernary(`${ivec3}(1,2,0)`, `${ivec3}(2,0,1)`, `(${n}.y>${n}.z)`)}`, `(${n}.x>${n}.y && ${n}.x>${n}.z)`)};                    

            // determine minor axis (in x; yz are following axis)
            ${this._declareLocalVarAsVec3I(mi, state)} =  ${state._generateTernary(`${ivec3}(0,1,2)`, `${state._generateTernary(`${ivec3}(1,2,0)`, `${ivec3}(2,0,1)`, `(${n}.y<${n}.z)`)}`, `(${n}.x<${n}.y && ${n}.x<${n}.z)`)};  
                              
            // determine median axis (in x;  yz are following axis)
            ${this._declareLocalVarAsVec3I(me, state)} = ${ivec3}(3) - ${mi} - ${ma};
            
            // project+fetch
            ${state._declareLocalVar(x, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this._getTextureGrad(state, samplerName)}, vec2${suffix}(${this.position.associatedVariableName}[${ma}.y], ${this.position.associatedVariableName}[${ma}.z]), 
                                    vec2${suffix}(${dpdx}[${ma}.y],${dpdx}[${ma}.z]), 
                                    vec2${suffix}(${dpdy}[${ma}.y],${dpdy}[${ma}.z]));
            ${state._declareLocalVar(y, NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this._getTextureGrad(state, samplerYName)}, vec2${suffix}(${this.position.associatedVariableName}[${me}.y], ${this.position.associatedVariableName}[${me}.z]), 
                                    vec2${suffix}(${dpdx}[${me}.y],${dpdx}[${me}.z]),
                                    vec2${suffix}(${dpdy}[${me}.y],${dpdy}[${me}.z]));
            
            // blend factors
            ${state._declareLocalVar(w, NodeMaterialBlockConnectionPointTypes.Vector2)} = vec2${suffix}(${n}[${ma}.x],${n}[${me}.x]);
            // make local support
            ${w} = clamp( (${w}-0.5773)/(1.0-0.5773), vec2${suffix}(0.0), vec2${suffix}(1.0) );
            // shape transition
            ${w} = pow( ${w}, vec2${suffix}(${sharpness}/8.0) );
            // blend and return
            ${state._declareLocalVar(this._tempTextureRead, NodeMaterialBlockConnectionPointTypes.Vector4)} = (${x}*${w}.x + ${y}*${w}.y) / (${w}.x + ${w}.y);
        `;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BiPlanarBlock", BiPlanarBlock);
//# sourceMappingURL=biPlanarBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/matrixDeterminantBlock.js




/**
 * Block used to compute the determinant of a matrix
 */
class MatrixDeterminantBlock extends NodeMaterialBlock {
    /**
     * Creates a new MatrixDeterminantBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Matrix);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MatrixDeterminantBlock";
    }
    /**
     * Gets the input matrix
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this.output;
        const input = this.input;
        state.compilationString += state._declareOutput(output) + ` = determinant(${input.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MatrixDeterminantBlock", MatrixDeterminantBlock);
//# sourceMappingURL=matrixDeterminantBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/matrixTransposeBlock.js




/**
 * Block used to transpose a matrix
 */
class MatrixTransposeBlock extends NodeMaterialBlock {
    /**
     * Creates a new MatrixTransposeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Matrix);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MatrixTransposeBlock";
    }
    /**
     * Gets the input matrix
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this.output;
        const input = this.input;
        state.compilationString += state._declareOutput(output) + ` = transpose(${input.associatedVariableName});\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MatrixTransposeBlock", MatrixTransposeBlock);
//# sourceMappingURL=matrixTransposeBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/meshAttributeExistsBlock.js








var MeshAttributeExistsBlockTypes;
(function (MeshAttributeExistsBlockTypes) {
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["None"] = 0] = "None";
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["Normal"] = 1] = "Normal";
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["Tangent"] = 2] = "Tangent";
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["VertexColor"] = 3] = "VertexColor";
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["UV1"] = 4] = "UV1";
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["UV2"] = 5] = "UV2";
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["UV3"] = 6] = "UV3";
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["UV4"] = 7] = "UV4";
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["UV5"] = 8] = "UV5";
    MeshAttributeExistsBlockTypes[MeshAttributeExistsBlockTypes["UV6"] = 9] = "UV6";
})(MeshAttributeExistsBlockTypes || (MeshAttributeExistsBlockTypes = {}));
/**
 * Block used to check if Mesh attribute of specified type exists
 * and provide an alternative fallback input for to use in such case
 */
class MeshAttributeExistsBlock extends NodeMaterialBlock {
    /**
     * Creates a new MeshAttributeExistsBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Defines which mesh attribute to use
         */
        this.attributeType = 0 /* MeshAttributeExistsBlockTypes.None */;
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("fallback", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        // Try to auto determine attributeType
        this._inputs[0].onConnectionObservable.add((other) => {
            if (this.attributeType) {
                // But only if not already specified
                return;
            }
            const sourceBlock = other.ownerBlock;
            if (sourceBlock instanceof InputBlock && sourceBlock.isAttribute) {
                switch (sourceBlock.name) {
                    case "color":
                        this.attributeType = 3 /* MeshAttributeExistsBlockTypes.VertexColor */;
                        break;
                    case "normal":
                        this.attributeType = 1 /* MeshAttributeExistsBlockTypes.Normal */;
                        break;
                    case "tangent":
                        this.attributeType = 2 /* MeshAttributeExistsBlockTypes.Tangent */;
                        break;
                    case "uv":
                        this.attributeType = 4 /* MeshAttributeExistsBlockTypes.UV1 */;
                        break;
                    case "uv2":
                        this.attributeType = 5 /* MeshAttributeExistsBlockTypes.UV2 */;
                        break;
                    case "uv3":
                        this.attributeType = 6 /* MeshAttributeExistsBlockTypes.UV3 */;
                        break;
                    case "uv4":
                        this.attributeType = 7 /* MeshAttributeExistsBlockTypes.UV4 */;
                        break;
                    case "uv5":
                        this.attributeType = 8 /* MeshAttributeExistsBlockTypes.UV5 */;
                        break;
                    case "uv6":
                        this.attributeType = 9 /* MeshAttributeExistsBlockTypes.UV6 */;
                        break;
                }
            }
            else if (sourceBlock instanceof MorphTargetsBlock) {
                switch (this.input.connectedPoint?.name) {
                    case "normalOutput":
                        this.attributeType = 1 /* MeshAttributeExistsBlockTypes.Normal */;
                        break;
                    case "tangentOutput":
                        this.attributeType = 2 /* MeshAttributeExistsBlockTypes.Tangent */;
                        break;
                    case "uvOutput":
                        this.attributeType = 4 /* MeshAttributeExistsBlockTypes.UV1 */;
                        break;
                }
            }
        });
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MeshAttributeExistsBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the fallback component when speciefied attribute doesn't exist
     */
    get fallback() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        let attributeDefine = null;
        switch (this.attributeType) {
            case 3 /* MeshAttributeExistsBlockTypes.VertexColor */:
                attributeDefine = "VERTEXCOLOR_NME";
                break;
            case 1 /* MeshAttributeExistsBlockTypes.Normal */:
                attributeDefine = "NORMAL";
                break;
            case 2 /* MeshAttributeExistsBlockTypes.Tangent */:
                attributeDefine = "TANGENT";
                break;
            case 4 /* MeshAttributeExistsBlockTypes.UV1 */:
                attributeDefine = "UV1";
                break;
            case 5 /* MeshAttributeExistsBlockTypes.UV2 */:
                attributeDefine = "UV2";
                break;
            case 6 /* MeshAttributeExistsBlockTypes.UV3 */:
                attributeDefine = "UV3";
                break;
            case 7 /* MeshAttributeExistsBlockTypes.UV4 */:
                attributeDefine = "UV4";
                break;
            case 8 /* MeshAttributeExistsBlockTypes.UV5 */:
                attributeDefine = "UV5";
                break;
            case 9 /* MeshAttributeExistsBlockTypes.UV6 */:
                attributeDefine = "UV6";
                break;
        }
        const output = state._declareOutput(this.output);
        if (attributeDefine) {
            state.compilationString += `#ifdef ${attributeDefine}\n`;
        }
        state.compilationString += `${output} = ${this.input.associatedVariableName};\n`;
        if (attributeDefine) {
            state.compilationString += `#else\n`;
            state.compilationString += `${output} = ${this.fallback.associatedVariableName};\n`;
            state.compilationString += `#endif\n`;
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.attributeType = this.attributeType;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.attributeType = serializationObject.attributeType ?? 0 /* MeshAttributeExistsBlockTypes.None */;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        codeString += `${this._codeVariableName}.attributeType = ${this.attributeType};\n`;
        return codeString;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Attribute lookup", 4 /* PropertyTypeForEdition.List */, undefined, {
        notifiers: { update: true },
        embedded: true,
        options: [
            { label: "(None)", value: 0 /* MeshAttributeExistsBlockTypes.None */ },
            { label: "Normal", value: 1 /* MeshAttributeExistsBlockTypes.Normal */ },
            { label: "Tangent", value: 2 /* MeshAttributeExistsBlockTypes.Tangent */ },
            { label: "Vertex Color", value: 3 /* MeshAttributeExistsBlockTypes.VertexColor */ },
            { label: "UV1", value: 4 /* MeshAttributeExistsBlockTypes.UV1 */ },
            { label: "UV2", value: 5 /* MeshAttributeExistsBlockTypes.UV2 */ },
            { label: "UV3", value: 6 /* MeshAttributeExistsBlockTypes.UV3 */ },
            { label: "UV4", value: 7 /* MeshAttributeExistsBlockTypes.UV4 */ },
            { label: "UV5", value: 8 /* MeshAttributeExistsBlockTypes.UV5 */ },
            { label: "UV6", value: 9 /* MeshAttributeExistsBlockTypes.UV6 */ },
        ],
    })
], MeshAttributeExistsBlock.prototype, "attributeType", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MeshAttributeExistsBlock", MeshAttributeExistsBlock);
//# sourceMappingURL=meshAttributeExistsBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/curveBlock.js






/**
 * Types of curves supported by the Curve block
 */
var CurveBlockTypes;
(function (CurveBlockTypes) {
    /** EaseInSine */
    CurveBlockTypes[CurveBlockTypes["EaseInSine"] = 0] = "EaseInSine";
    /** EaseOutSine */
    CurveBlockTypes[CurveBlockTypes["EaseOutSine"] = 1] = "EaseOutSine";
    /** EaseInOutSine */
    CurveBlockTypes[CurveBlockTypes["EaseInOutSine"] = 2] = "EaseInOutSine";
    /** EaseInQuad */
    CurveBlockTypes[CurveBlockTypes["EaseInQuad"] = 3] = "EaseInQuad";
    /** EaseOutQuad */
    CurveBlockTypes[CurveBlockTypes["EaseOutQuad"] = 4] = "EaseOutQuad";
    /** EaseInOutQuad */
    CurveBlockTypes[CurveBlockTypes["EaseInOutQuad"] = 5] = "EaseInOutQuad";
    /** EaseInCubic */
    CurveBlockTypes[CurveBlockTypes["EaseInCubic"] = 6] = "EaseInCubic";
    /** EaseOutCubic */
    CurveBlockTypes[CurveBlockTypes["EaseOutCubic"] = 7] = "EaseOutCubic";
    /** EaseInOutCubic */
    CurveBlockTypes[CurveBlockTypes["EaseInOutCubic"] = 8] = "EaseInOutCubic";
    /** EaseInQuart */
    CurveBlockTypes[CurveBlockTypes["EaseInQuart"] = 9] = "EaseInQuart";
    /** EaseOutQuart */
    CurveBlockTypes[CurveBlockTypes["EaseOutQuart"] = 10] = "EaseOutQuart";
    /** EaseInOutQuart */
    CurveBlockTypes[CurveBlockTypes["EaseInOutQuart"] = 11] = "EaseInOutQuart";
    /** EaseInQuint */
    CurveBlockTypes[CurveBlockTypes["EaseInQuint"] = 12] = "EaseInQuint";
    /** EaseOutQuint */
    CurveBlockTypes[CurveBlockTypes["EaseOutQuint"] = 13] = "EaseOutQuint";
    /** EaseInOutQuint */
    CurveBlockTypes[CurveBlockTypes["EaseInOutQuint"] = 14] = "EaseInOutQuint";
    /** EaseInExpo */
    CurveBlockTypes[CurveBlockTypes["EaseInExpo"] = 15] = "EaseInExpo";
    /** EaseOutExpo */
    CurveBlockTypes[CurveBlockTypes["EaseOutExpo"] = 16] = "EaseOutExpo";
    /** EaseInOutExpo */
    CurveBlockTypes[CurveBlockTypes["EaseInOutExpo"] = 17] = "EaseInOutExpo";
    /** EaseInCirc */
    CurveBlockTypes[CurveBlockTypes["EaseInCirc"] = 18] = "EaseInCirc";
    /** EaseOutCirc */
    CurveBlockTypes[CurveBlockTypes["EaseOutCirc"] = 19] = "EaseOutCirc";
    /** EaseInOutCirc */
    CurveBlockTypes[CurveBlockTypes["EaseInOutCirc"] = 20] = "EaseInOutCirc";
    /** EaseInBack */
    CurveBlockTypes[CurveBlockTypes["EaseInBack"] = 21] = "EaseInBack";
    /** EaseOutBack */
    CurveBlockTypes[CurveBlockTypes["EaseOutBack"] = 22] = "EaseOutBack";
    /** EaseInOutBack */
    CurveBlockTypes[CurveBlockTypes["EaseInOutBack"] = 23] = "EaseInOutBack";
    /** EaseInElastic */
    CurveBlockTypes[CurveBlockTypes["EaseInElastic"] = 24] = "EaseInElastic";
    /** EaseOutElastic */
    CurveBlockTypes[CurveBlockTypes["EaseOutElastic"] = 25] = "EaseOutElastic";
    /** EaseInOutElastic */
    CurveBlockTypes[CurveBlockTypes["EaseInOutElastic"] = 26] = "EaseInOutElastic";
})(CurveBlockTypes || (CurveBlockTypes = {}));
/**
 * Block used to apply curve operation
 */
class CurveBlock extends NodeMaterialBlock {
    /**
     * Creates a new CurveBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Gets or sets the type of the curve applied by the block
         */
        this.type = CurveBlockTypes.EaseInOutSine;
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Object);
        this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Int);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "CurveBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _duplicateEntry(entry, component) {
        return `ret.${component} = ${entry.replace(/VAL/g, "v." + component)}`;
    }
    _duplicateEntryDirect(entry) {
        return `return ${entry.replace(/VAL/g, "v")}`;
    }
    _duplicateVector(entry, inputType, isWGSL) {
        if (inputType === "float" || inputType === "f32") {
            return this._duplicateEntryDirect(entry);
        }
        const size = parseInt(inputType.replace("vec", ""));
        let code = isWGSL
            ? `
            var ret: vec${size}f = vec${size}f(0.0);
        `
            : `
            vec${size} ret = vec${size}(0.0);
        `;
        for (let i = 1; i <= size; i++) {
            code += this._duplicateEntry(entry, i === 1 ? "x" : i === 2 ? "y" : i === 3 ? "z" : "w") + ";\n";
        }
        code += "return ret;\n";
        return code;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        let registeredFunction = "";
        let registeredFunctionName = "";
        const inputType = state._getShaderType(this.input.type);
        const isWGSL = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */;
        registeredFunctionName = CurveBlockTypes[this.type] + "_" + inputType.replace("<", "").replace(">", "");
        switch (this.type) {
            case CurveBlockTypes.EaseInSine:
                registeredFunction = `return 1.0 - cos((v * 3.1415) / 2.0)`;
                break;
            case CurveBlockTypes.EaseOutSine:
                registeredFunction = `return sin((v * 3.1415) / 2.0)`;
                break;
            case CurveBlockTypes.EaseInOutSine:
                registeredFunction = `return -(cos(v * 3.1415) - 1.0) / 2.0`;
                break;
            case CurveBlockTypes.EaseInQuad:
                registeredFunction = `return v * v`;
                break;
            case CurveBlockTypes.EaseOutQuad:
                registeredFunction = `return (1.0 - v) * (1.0 - v)`;
                break;
            case CurveBlockTypes.EaseInOutQuad: {
                const entry = state._generateTernary("2.0 * VAL * VAL", "1.0 - pow(-2.0 * VAL + 2.0, 2.0) / 2.0", "VAL < 0.5");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInCubic:
                registeredFunction = `return v * v * v`;
                break;
            case CurveBlockTypes.EaseOutCubic: {
                const entry = "1.0 - pow(1.0 - VAL, 3.0)";
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInOutCubic: {
                const entry = state._generateTernary("4.0 * VAL * VAL * VAL", "1.0 - pow(-2.0 * VAL + 2.0, 3.0) / 2.0", "VAL < 0.5");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInQuart:
                registeredFunction = `return v * v * v * v`;
                break;
            case CurveBlockTypes.EaseOutQuart: {
                const entry = "1.0 - pow(1.0 - VAL, 4.0)";
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInOutQuart: {
                const entry = state._generateTernary("8.0 * VAL * VAL * VAL * VAL", "1.0 - pow(-2.0 * VAL + 2.0, 4.0) / 2.0", "VAL < 0.5");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInQuint:
                registeredFunction = `return v * v * v * v * v`;
                break;
            case CurveBlockTypes.EaseOutQuint: {
                const entry = "1.0 - pow(1.0 - VAL, 5.0)";
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInOutQuint: {
                const entry = state._generateTernary("16.0 * VAL * VAL * VAL * VAL * VAL", "1.0 - pow(-2.0 * VAL + 2.0, 5.0) / 2.0", "VAL < 0.5");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInExpo: {
                const entry = state._generateTernary("0.0", "pow(2.0, 10.0 * VAL - 10.0)", "VAL == 0.0");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseOutExpo: {
                const entry = state._generateTernary("1.0", "1.0 - pow(2.0, -10.0 * VAL)", "VAL == 1.0");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInOutExpo: {
                const entry = state._generateTernary("0.0", state._generateTernary("1.0", state._generateTernary("pow(2.0, 20.0 * VAL - 10.0) / 2.0", "(2.0 - pow(2.0, -20.0 * VAL + 10.0)) / 2.0", "VAL < 0.5"), "VAL == 1.0"), "VAL == 0.0");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInCirc: {
                const entry = "1.0 - sqrt(1.0 - pow(VAL, 2.0))";
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseOutCirc: {
                const entry = "sqrt(1.0 - pow(VAL - 1.0, 2.0))";
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInOutCirc: {
                const entry = state._generateTernary("(1.0 - sqrt(1.0 - pow(2.0 * VAL, 2.0))) / 2.0", "(sqrt(1.0 - pow(-2.0 * VAL + 2.0, 2.0)) + 1.0) / 2.0", "VAL < 0.5");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInBack: {
                registeredFunction = "return 2.70158 * v * v * v - 1.70158 * v * v";
                break;
            }
            case CurveBlockTypes.EaseOutBack: {
                const entry = "2.70158 * pow(VAL - 1.0, 3.0) + 1.70158 * pow(VAL - 1.0, 2.0)";
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInOutBack: {
                const entry = state._generateTernary("(pow(2.0 * VAL, 2.0) * ((3.5949095) * 2.0 * VAL - 2.5949095)) / 2.0", "(pow(2.0 * VAL - 2.0, 2.0) * (3.5949095 * (VAL * 2.0 - 2.0) + 3.5949095) + 2.0) / 2.0", "VAL < 0.5");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInElastic: {
                const entry = state._generateTernary("0.0", state._generateTernary("1.0", "-pow(2.0, 10.0 * VAL - 10.0) * sin((VAL * 10.0 - 10.75) * ((2.0 * 3.1415) / 3.0))", "VAL == 1.0"), "VAL == 0.0");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseOutElastic: {
                const entry = state._generateTernary("0.0", state._generateTernary("1.0", "pow(2.0, -10.0 * VAL) * sin((VAL * 10.0 - 0.75) * ((2.0 * 3.1415) / 3.0)) + 1.0", "VAL == 1.0"), "VAL == 0.0");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
            case CurveBlockTypes.EaseInOutElastic: {
                const entry = state._generateTernary("0.0", state._generateTernary("1.0", state._generateTernary("-(pow(2.0, 20.0 * VAL - 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0", "(pow(2.0, -20.0 * VAL + 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 + 1.0", "VAL < 0.5"), "VAL == 1.0"), "VAL == 0.0");
                registeredFunction = this._duplicateVector(entry, inputType, isWGSL);
                break;
            }
        }
        if (isWGSL) {
            state._emitFunction(registeredFunctionName, `fn ${registeredFunctionName}(v: ${inputType}) -> ${inputType}  {${registeredFunction};}\n`, "");
        }
        else {
            state._emitFunction(registeredFunctionName, `${inputType} ${registeredFunctionName}(${inputType} v) {${registeredFunction};}\n`, "");
        }
        state.compilationString += state._declareOutput(output) + ` = ${registeredFunctionName}(${this.input.associatedVariableName});\n`;
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.curveType = this.type;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.type = serializationObject.curveType;
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.type = BABYLON.CurveBlockTypes.${CurveBlockTypes[this.type]};\n`;
        return codeString;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Type", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "EaseInSine", value: CurveBlockTypes.EaseInSine },
            { label: "EaseOutSine", value: CurveBlockTypes.EaseOutSine },
            { label: "EaseInOutSine", value: CurveBlockTypes.EaseInOutSine },
            { label: "EaseInQuad", value: CurveBlockTypes.EaseInQuad },
            { label: "EaseOutQuad", value: CurveBlockTypes.EaseOutQuad },
            { label: "EaseInOutQuad", value: CurveBlockTypes.EaseInOutQuad },
            { label: "EaseInCubic", value: CurveBlockTypes.EaseInCubic },
            { label: "EaseOutCubic", value: CurveBlockTypes.EaseOutCubic },
            { label: "EaseInOutCubic", value: CurveBlockTypes.EaseInOutCubic },
            { label: "EaseInQuart", value: CurveBlockTypes.EaseInQuart },
            { label: "EaseOutQuart", value: CurveBlockTypes.EaseOutQuart },
            { label: "EaseInOutQuart", value: CurveBlockTypes.EaseInOutQuart },
            { label: "EaseInQuint", value: CurveBlockTypes.EaseInQuint },
            { label: "EaseOutQuint", value: CurveBlockTypes.EaseOutQuint },
            { label: "EaseInOutQuint", value: CurveBlockTypes.EaseInOutQuint },
            { label: "EaseInExpo", value: CurveBlockTypes.EaseInExpo },
            { label: "EaseOutExpo", value: CurveBlockTypes.EaseOutExpo },
            { label: "EaseInOutExpo", value: CurveBlockTypes.EaseInOutExpo },
            { label: "EaseInCirc", value: CurveBlockTypes.EaseInCirc },
            { label: "EaseOutCirc", value: CurveBlockTypes.EaseOutCirc },
            { label: "EaseInOutCirc", value: CurveBlockTypes.EaseInOutCirc },
            { label: "EaseInBack", value: CurveBlockTypes.EaseInBack },
            { label: "EaseOutBack", value: CurveBlockTypes.EaseOutBack },
            { label: "EaseInOutBack", value: CurveBlockTypes.EaseInOutBack },
            { label: "EaseInElastic", value: CurveBlockTypes.EaseInElastic },
            { label: "EaseOutElastic", value: CurveBlockTypes.EaseOutElastic },
            { label: "EaseInOutElastic", value: CurveBlockTypes.EaseInOutElastic },
        ],
    })
], CurveBlock.prototype, "type", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CurveBlock", CurveBlock);
//# sourceMappingURL=curveBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/colorConverterBlock.js




/**
 * Block used to apply rgb/hsl convertions
 */
class ColorConverterBlock extends NodeMaterialBlock {
    /**
     * Create a new ColorConverterBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("rgb ", NodeMaterialBlockConnectionPointTypes.Color3, true);
        this.registerInput("hsl ", NodeMaterialBlockConnectionPointTypes.Color3, true);
        this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3);
        this.registerOutput("hsl", NodeMaterialBlockConnectionPointTypes.Color3);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ColorConverterBlock";
    }
    /**
     * Gets the rgb value (input)
     */
    get rgbIn() {
        return this._inputs[0];
    }
    /**
     * Gets the hsl value (input)
     */
    get hslIn() {
        return this._inputs[1];
    }
    /**
     * Gets the rgb value (output)
     */
    get rgbOut() {
        return this._outputs[0];
    }
    /**
     * Gets the hsl value (output)
     */
    get hslOut() {
        return this._outputs[1];
    }
    _inputRename(name) {
        if (name === "rgb ") {
            return "rgbIn";
        }
        if (name === "hsl ") {
            return "hslIn";
        }
        return name;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const rgbInput = this.rgbIn;
        const hslInput = this.hslIn;
        const rbgOutput = this._outputs[0];
        const hslOutput = this._outputs[1];
        const vec3 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector3);
        let rgb2hsl = `
            vec3 rgb2hsl(vec3 color) {
                float r = color.r;
                float g = color.g;
                float b = color.b;

                float maxc = max(r, max(g, b));
                float minc = min(r, min(g, b));
                float h = 0.0;
                float s = 0.0;
                float l = (maxc + minc) / 2.0;

                if (maxc != minc) {
                    float d = maxc - minc;
                    if (l > 0.5) {
                        s = d / (2.0 - maxc - minc);
                    } else {
                        s = d / (maxc + minc);
                    }

                    if (maxc == r) {
                        float add = 0.0;
                        if (g < b) {
                            add = 6.0;
                        }
                        h = (g - b) / d + add;
                    } else if (maxc == g) {
                        h = (b - r) / d + 2.0;
                    } else if (maxc == b) {
                        h = (r - g) / d + 4.0;
                    }
                    h /= 6.0;
                }

                return vec3(h, s, l);
            }`;
        let hue2rgb = `
            float hue2rgb(float p, float q, float tt) {
                float t = tt;
                if (t < 0.0) {
                    t += 1.0;
                }
                if (t > 1.0) {
                    t -= 1.0;
                }
                if (t < 1.0/6.0) {
                    return p + (q - p) * 6.0 * t;
                }
                if (t < 1.0/2.0) {
                    return q;
                }
                if (t < 2.0/3.0) {
                    return p + (q - p) * (2.0/3.0 - t) * 6.0;
                }
                return p;
            }`;
        let hsl2rgb = `
            vec3 hsl2rgb(vec3 hsl) {
                float h = hsl.x;
                float s = hsl.y;
                float l = hsl.z;

                float r;
                float g;
                float b;

                if (s == 0.0) {
                    // Achromatic (grey)
                    r = l;
                    g = l;
                    b = l; 
                } else {
                    float q;
                
                    if (l < 0.5) {
                        q = l * (1.0 + s);
                    } else {
                        q = (l + s - l * s);
                    }

                    float p = 2.0 * l - q;

                    r = hue2rgb(p, q, h + 1.0/3.0);
                    g = hue2rgb(p, q, h);
                    b = hue2rgb(p, q, h - 1.0/3.0);
                }

                return vec3(r, g, b);
            }`;
        if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            rgb2hsl = state._babylonSLtoWGSL(rgb2hsl);
            hue2rgb = state._babylonSLtoWGSL(hue2rgb);
            hsl2rgb = state._babylonSLtoWGSL(hsl2rgb);
        }
        state._emitFunction("rgb2hsl", rgb2hsl, "");
        state._emitFunction("hue2rgb", hue2rgb, "");
        state._emitFunction("hsl2rgb", hsl2rgb, "");
        if (rgbInput.isConnected) {
            if (rbgOutput.hasEndpoints) {
                state.compilationString += state._declareOutput(rbgOutput) + ` = ${rgbInput.associatedVariableName};\n`;
            }
            if (hslOutput.hasEndpoints) {
                state.compilationString += state._declareOutput(hslOutput) + ` = rgb2hsl(${rgbInput.associatedVariableName});\n`;
            }
        }
        else if (hslInput.isConnected) {
            if (rbgOutput.hasEndpoints) {
                state.compilationString += state._declareOutput(rbgOutput) + ` = hsl2rgb(${hslInput.associatedVariableName});\n`;
            }
            if (hslOutput.hasEndpoints) {
                state.compilationString += state._declareOutput(hslOutput) + ` = ${hslInput.associatedVariableName};\n`;
            }
        }
        else {
            if (rbgOutput.hasEndpoints) {
                state.compilationString += state._declareOutput(rbgOutput) + ` =  ${vec3}(0.);\n`;
            }
            if (hslOutput.hasEndpoints) {
                state.compilationString += state._declareOutput(hslOutput) + ` =  ${vec3}(0.);\n`;
            }
        }
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ColorConverterBlock", ColorConverterBlock);
//# sourceMappingURL=colorConverterBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/loopBlock.js







/**
 * Block used to repeat code
 */
class LoopBlock extends NodeMaterialBlock {
    /**
     * Creates a new LoopBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        /**
         * Gets or sets number of iterations
         * Will be ignored if the iterations input is connected
         */
        this.iterations = 4;
        this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this.registerInput("iterations", NodeMaterialBlockConnectionPointTypes.Float, true);
        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
        this.registerOutput("index", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
        this.registerOutput("loopID", NodeMaterialBlockConnectionPointTypes.Object, undefined, new NodeMaterialConnectionPointCustomObject("loopID", this, 1 /* NodeMaterialConnectionPointDirection.Output */, LoopBlock, "LoopBlock"));
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._outputs[0]._forPostBuild = true;
        this._outputs[2]._redirectedSource = this._inputs[0];
        this._outputs[1]._preventBubbleUp = true;
        this._outputs[2]._preventBubbleUp = true;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "LoopBlock";
    }
    /**
     * Gets the main input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the iterations input component
     */
    get iterationsInput() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the index component which will be incremented at each iteration
     */
    get index() {
        return this._outputs[1];
    }
    /**
     * Gets the loop ID component
     */
    get loopID() {
        return this._outputs[2];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const index = this._outputs[1];
        const indexName = state._getFreeVariableName("index");
        const decl = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "var" : "int";
        const castFloat = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "f32" : "float";
        const castInt = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? "i32" : "int";
        // Declare storage variable and store initial value
        state.compilationString += state._declareOutput(output) + ` = ${this.input.associatedVariableName};\n`;
        // Iterations
        const iterations = this.iterationsInput.isConnected ? `${castInt}(${this.iterationsInput.associatedVariableName})` : this.iterations;
        // Loop
        state.compilationString += `for (${decl} ${indexName} = 0; ${indexName} < ${iterations}; ${indexName}++){\n`;
        state.compilationString += `${state._declareOutput(index)} = ${castFloat}(${indexName});\n`;
        return this;
    }
    _postBuildBlock(state) {
        super._postBuildBlock(state);
        state.compilationString += `}\n`;
        return this;
    }
    _dumpPropertiesCode() {
        return super._dumpPropertiesCode() + `${this._codeVariableName}.iterations = ${this.iterations};\n`;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.iterations = this.iterations;
        return serializationObject;
    }
    _deserialize(serializationObject, scene, rootUrl) {
        super._deserialize(serializationObject, scene, rootUrl);
        this.iterations = serializationObject.iterations;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Iterations", 2 /* PropertyTypeForEdition.Int */, undefined, { embedded: true })
], LoopBlock.prototype, "iterations", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.LoopBlock", LoopBlock);
//# sourceMappingURL=loopBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/storageReadBlock.js






/**
 * Block used to read from a variable within a loop
 */
class StorageReadBlock extends NodeMaterialBlock {
    /**
     * Creates a new StorageReadBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("loopID", NodeMaterialBlockConnectionPointTypes.Object, false, undefined, new NodeMaterialConnectionPointCustomObject("loopID", this, 0 /* NodeMaterialConnectionPointDirection.Input */, LoopBlock, "LoopBlock"));
        this.registerOutput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this._outputs[0]._linkedConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "StorageReadBlock";
    }
    /**
     * Gets the loop link component
     */
    get loopID() {
        return this._inputs[0];
    }
    /**
     * Gets the value component
     */
    get value() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const value = this.value;
        if (!this.loopID.isConnected) {
            return this;
        }
        const loopBlock = this.loopID.connectedPoint.ownerBlock;
        state.compilationString += state._declareOutput(value) + ` = ${loopBlock.output.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.StorageReadBlock", StorageReadBlock);
//# sourceMappingURL=storageReadBlock.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/storageWriteBlock.js






/**
 * Block used to write to a variable within a loop
 */
class StorageWriteBlock extends NodeMaterialBlock {
    /**
     * Creates a new StorageWriteBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name, NodeMaterialBlockTargets.Neutral);
        this.registerInput("loopID", NodeMaterialBlockConnectionPointTypes.Object, false, undefined, new NodeMaterialConnectionPointCustomObject("loopID", this, 0 /* NodeMaterialConnectionPointDirection.Input */, LoopBlock, "LoopBlock"));
        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
        this._linkConnectionTypes(0, 1);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "StorageWriteBlock";
    }
    /**
     * Gets the loop link component
     */
    get loopID() {
        return this._inputs[0];
    }
    /**
     * Gets the value component
     */
    get value() {
        return this._inputs[1];
    }
    /** Gets a boolean indicating that this connection will be used in the fragment shader
     * @returns true if connected in fragment shader
     */
    isConnectedInFragmentShader() {
        if (!this.loopID.isConnected) {
            return false;
        }
        const loopBlock = this.loopID.connectedPoint.ownerBlock;
        return loopBlock.output.isConnectedInFragmentShader;
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const value = this.value;
        if (!this.loopID.isConnected) {
            return this;
        }
        const loopBlock = this.loopID.connectedPoint.ownerBlock;
        state.compilationString += `${loopBlock.output.associatedVariableName} = ${value.associatedVariableName};\n`;
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.StorageWriteBlock", StorageWriteBlock);
//# sourceMappingURL=storageWriteBlock.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/gaussianSplattingVertexDeclaration.js
// Do not edit.

const gaussianSplattingVertexDeclaration_name = "gaussianSplattingVertexDeclaration";
const gaussianSplattingVertexDeclaration_shader = `attribute position: vec2f;
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStoreWGSL[gaussianSplattingVertexDeclaration_name] = gaussianSplattingVertexDeclaration_shader;
/** @internal */
const gaussianSplattingVertexDeclarationWGSL = { name: gaussianSplattingVertexDeclaration_name, shader: gaussianSplattingVertexDeclaration_shader };
//# sourceMappingURL=gaussianSplattingVertexDeclaration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js
var gaussianSplattingVertexDeclaration = __webpack_require__(39775);
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/GaussianSplatting/index.js



// Gaussian


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Blocks/index.js
/* eslint-disable import/no-internal-modules */




































































//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Optimizers/nodeMaterialOptimizer.js
/**
 * Root class for all node material optimizers
 */
class NodeMaterialOptimizer {
    /**
     * Function used to optimize a NodeMaterial graph
     * @param _vertexOutputNodes defines the list of output nodes for the vertex shader
     * @param _fragmentOutputNodes defines the list of output nodes for the fragment shader
     */
    optimize(_vertexOutputNodes, _fragmentOutputNodes) {
        // Do nothing by default
    }
}
//# sourceMappingURL=nodeMaterialOptimizer.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/Optimizers/index.js

//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/Node/index.js
/* eslint-disable import/no-internal-modules */









//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/guid.js
var guid = __webpack_require__(38688);
;// ./node_modules/@babylonjs/core/Materials/shadowDepthWrapper.js




class MapMap {
    constructor() {
        this.mm = new Map();
    }
    get(a, b) {
        const m = this.mm.get(a);
        if (m !== undefined) {
            return m.get(b);
        }
        return undefined;
    }
    set(a, b, v) {
        let m = this.mm.get(a);
        if (m === undefined) {
            this.mm.set(a, (m = new Map()));
        }
        m.set(b, v);
    }
}
/**
 * Class that can be used to wrap a base material to generate accurate shadows when using custom vertex/fragment code in the base material
 */
class ShadowDepthWrapper {
    /** Gets the standalone status of the wrapper */
    get standalone() {
        return this._options?.standalone ?? false;
    }
    /** Gets the base material the wrapper is built upon */
    get baseMaterial() {
        return this._baseMaterial;
    }
    /** Gets the doNotInjectCode status of the wrapper */
    get doNotInjectCode() {
        return this._options?.doNotInjectCode ?? false;
    }
    /**
     * Instantiate a new shadow depth wrapper.
     * It works by injecting some specific code in the vertex/fragment shaders of the base material and is used by a shadow generator to
     * generate the shadow depth map. For more information, please refer to the documentation:
     * https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
     * @param baseMaterial Material to wrap
     * @param scene Define the scene the material belongs to
     * @param options Options used to create the wrapper
     */
    constructor(baseMaterial, scene, options) {
        this._baseMaterial = baseMaterial;
        this._scene = scene ?? engineStore/* EngineStore */.q.LastCreatedScene;
        this._options = options;
        this._subMeshToEffect = new Map();
        this._subMeshToDepthWrapper = new MapMap();
        this._meshes = new Map();
        // Register for onEffectCreated to store the effect of the base material when it is (re)generated. This effect will be used
        // to create the depth effect later on
        this._onEffectCreatedObserver = this._baseMaterial.onEffectCreatedObservable.add((params) => {
            const mesh = params.subMesh?.getMesh();
            if (mesh && !this._meshes.has(mesh)) {
                // Register for mesh onDispose to clean up our internal maps when a mesh is disposed
                this._meshes.set(mesh, mesh.onDisposeObservable.add((mesh) => {
                    const iterator = this._subMeshToEffect.keys();
                    for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
                        const subMesh = key.value;
                        if (subMesh?.getMesh() === mesh) {
                            this._subMeshToEffect.delete(subMesh);
                            this._deleteDepthWrapperEffect(subMesh);
                        }
                    }
                }));
            }
            if (this._subMeshToEffect.get(params.subMesh)?.[0] !== params.effect) {
                this._subMeshToEffect.set(params.subMesh, [params.effect, this._scene.getEngine().currentRenderPassId]);
                this._deleteDepthWrapperEffect(params.subMesh);
            }
        });
    }
    _deleteDepthWrapperEffect(subMesh) {
        const depthWrapperEntries = this._subMeshToDepthWrapper.mm.get(subMesh);
        if (depthWrapperEntries) {
            // find and release the previous depth effect
            depthWrapperEntries.forEach((depthWrapper) => {
                depthWrapper.mainDrawWrapper.effect?.dispose();
            });
            this._subMeshToDepthWrapper.mm.delete(subMesh); // trigger a depth effect recreation
        }
    }
    /**
     * Gets the effect to use to generate the depth map
     * @param subMesh subMesh to get the effect for
     * @param shadowGenerator shadow generator to get the effect for
     * @param passIdForDrawWrapper Id of the pass for which the effect from the draw wrapper must be retrieved from
     * @returns the effect to use to generate the depth map for the subMesh + shadow generator specified
     */
    getEffect(subMesh, shadowGenerator, passIdForDrawWrapper) {
        const entry = this._subMeshToDepthWrapper.mm.get(subMesh)?.get(shadowGenerator);
        if (!entry) {
            return null;
        }
        let drawWrapper = entry.drawWrapper[passIdForDrawWrapper];
        if (!drawWrapper) {
            drawWrapper = entry.drawWrapper[passIdForDrawWrapper] = new Materials_drawWrapper/* DrawWrapper */.E(this._scene.getEngine());
            drawWrapper.setEffect(entry.mainDrawWrapper.effect, entry.mainDrawWrapper.defines);
        }
        return drawWrapper;
    }
    /**
     * Specifies that the submesh is ready to be used for depth rendering
     * @param subMesh submesh to check
     * @param defines the list of defines to take into account when checking the effect
     * @param shadowGenerator combined with subMesh, it defines the effect to check
     * @param useInstances specifies that instances should be used
     * @param passIdForDrawWrapper Id of the pass for which the draw wrapper should be created
     * @returns a boolean indicating that the submesh is ready or not
     */
    isReadyForSubMesh(subMesh, defines, shadowGenerator, useInstances, passIdForDrawWrapper) {
        if (this.standalone) {
            // will ensure the effect is (re)created for the base material
            if (!this._baseMaterial.isReadyForSubMesh(subMesh.getMesh(), subMesh, useInstances)) {
                return false;
            }
        }
        return this._makeEffect(subMesh, defines, shadowGenerator, passIdForDrawWrapper)?.isReady() ?? false;
    }
    /**
     * Disposes the resources
     */
    dispose() {
        this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver);
        this._onEffectCreatedObserver = null;
        const iterator = this._meshes.entries();
        for (let entry = iterator.next(); entry.done !== true; entry = iterator.next()) {
            const [mesh, observer] = entry.value;
            mesh.onDisposeObservable.remove(observer);
        }
    }
    _makeEffect(subMesh, defines, shadowGenerator, passIdForDrawWrapper) {
        const engine = this._scene.getEngine();
        const origEffectAndRenderPassId = this._subMeshToEffect.get(subMesh);
        if (!origEffectAndRenderPassId) {
            return null;
        }
        const [origEffect, origRenderPassId] = origEffectAndRenderPassId;
        let params = this._subMeshToDepthWrapper.get(subMesh, shadowGenerator);
        if (!params) {
            const mainDrawWrapper = new Materials_drawWrapper/* DrawWrapper */.E(engine);
            mainDrawWrapper.defines = subMesh._getDrawWrapper(origRenderPassId)?.defines ?? null;
            params = {
                drawWrapper: [],
                mainDrawWrapper,
                depthDefines: "",
                token: (0,guid/* RandomGUID */.z)(),
            };
            params.drawWrapper[passIdForDrawWrapper] = mainDrawWrapper;
            this._subMeshToDepthWrapper.set(subMesh, shadowGenerator, params);
        }
        const join = defines.join("\n");
        if (params.mainDrawWrapper.effect) {
            if (join === params.depthDefines) {
                // we already created the depth effect and it is still up to date for this submesh + shadow generator
                return params.mainDrawWrapper.effect;
            }
        }
        params.depthDefines = join;
        const uniforms = origEffect.getUniformNames().slice();
        // the depth effect is either out of date or has not been created yet
        let vertexCode = origEffect.vertexSourceCodeBeforeMigration, fragmentCode = origEffect.fragmentSourceCodeBeforeMigration;
        if (!this.doNotInjectCode) {
            // Declare the shadow map includes
            const vertexNormalBiasCode = this._options && this._options.remappedVariables
                ? `#include<shadowMapVertexNormalBias>(${this._options.remappedVariables.join(",")})`
                : `#include<shadowMapVertexNormalBias>`, vertexMetricCode = this._options && this._options.remappedVariables
                ? `#include<shadowMapVertexMetric>(${this._options.remappedVariables.join(",")})`
                : `#include<shadowMapVertexMetric>`, fragmentSoftTransparentShadow = this._options && this._options.remappedVariables
                ? `#include<shadowMapFragmentSoftTransparentShadow>(${this._options.remappedVariables.join(",")})`
                : `#include<shadowMapFragmentSoftTransparentShadow>`, fragmentBlockCode = `#include<shadowMapFragment>`, vertexExtraDeclartion = `#include<shadowMapVertexExtraDeclaration>`;
            // vertex code
            if (origEffect.shaderLanguage === 0 /* ShaderLanguage.GLSL */) {
                vertexCode = vertexCode.replace(/void\s+?main/g, `\n${vertexExtraDeclartion}\nvoid main`);
            }
            else {
                vertexCode = vertexCode.replace(/@vertex/g, `\n${vertexExtraDeclartion}\n@vertex`);
            }
            vertexCode = vertexCode.replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g, vertexNormalBiasCode);
            if (vertexCode.indexOf("#define SHADOWDEPTH_METRIC") !== -1) {
                vertexCode = vertexCode.replace(/#define SHADOWDEPTH_METRIC/g, vertexMetricCode);
            }
            else {
                vertexCode = vertexCode.replace(/}\s*$/g, vertexMetricCode + "\n}");
            }
            vertexCode = vertexCode.replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g, "");
            // fragment code
            const hasLocationForSoftTransparentShadow = fragmentCode.indexOf("#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW") >= 0 || fragmentCode.indexOf("#define CUSTOM_FRAGMENT_BEFORE_FOG") >= 0;
            const hasLocationForFragment = fragmentCode.indexOf("#define SHADOWDEPTH_FRAGMENT") !== -1;
            let fragmentCodeToInjectAtEnd = "";
            if (!hasLocationForSoftTransparentShadow) {
                fragmentCodeToInjectAtEnd = fragmentSoftTransparentShadow + "\n";
            }
            else {
                fragmentCode = fragmentCode.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g, fragmentSoftTransparentShadow);
            }
            fragmentCode = fragmentCode.replace(/void\s+?main/g, Materials_effect/* Effect */.M.IncludesShadersStore["shadowMapFragmentExtraDeclaration"] + "\nvoid main");
            if (hasLocationForFragment) {
                fragmentCode = fragmentCode.replace(/#define SHADOWDEPTH_FRAGMENT/g, fragmentBlockCode);
            }
            else {
                fragmentCodeToInjectAtEnd += fragmentBlockCode + "\n";
            }
            if (fragmentCodeToInjectAtEnd) {
                fragmentCode = fragmentCode.replace(/}\s*$/g, fragmentCodeToInjectAtEnd + "}");
            }
            uniforms.push("biasAndScaleSM", "depthValuesSM", "lightDataSM", "softTransparentShadowSM");
        }
        params.mainDrawWrapper.effect = engine.createEffect({
            vertexSource: vertexCode,
            fragmentSource: fragmentCode,
            vertexToken: params.token,
            fragmentToken: params.token,
        }, {
            attributes: origEffect.getAttributesNames(),
            uniformsNames: uniforms,
            uniformBuffersNames: origEffect.getUniformBuffersNames(),
            samplers: origEffect.getSamplers(),
            defines: join + "\n" + origEffect.defines.replace("#define SHADOWS", "").replace(/#define SHADOW\d/g, ""),
            indexParameters: origEffect.getIndexParameters(),
            shaderLanguage: origEffect.shaderLanguage,
        }, engine);
        for (let id = 0; id < params.drawWrapper.length; ++id) {
            if (id !== passIdForDrawWrapper) {
                params.drawWrapper[id]?.setEffect(params.mainDrawWrapper.effect, params.mainDrawWrapper.defines);
            }
        }
        return params.mainDrawWrapper.effect;
    }
}
//# sourceMappingURL=shadowDepthWrapper.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialPluginBase.js
var materialPluginBase = __webpack_require__(50074);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/materialPluginManager.js
var materialPluginManager = __webpack_require__(83040);
;// ./node_modules/@babylonjs/core/Materials/materialPluginEvent.js
/**
 * @internal
 */
var MaterialPluginEvent;
(function (MaterialPluginEvent) {
    MaterialPluginEvent[MaterialPluginEvent["Created"] = 1] = "Created";
    MaterialPluginEvent[MaterialPluginEvent["Disposed"] = 2] = "Disposed";
    MaterialPluginEvent[MaterialPluginEvent["GetDefineNames"] = 4] = "GetDefineNames";
    MaterialPluginEvent[MaterialPluginEvent["PrepareUniformBuffer"] = 8] = "PrepareUniformBuffer";
    MaterialPluginEvent[MaterialPluginEvent["IsReadyForSubMesh"] = 16] = "IsReadyForSubMesh";
    MaterialPluginEvent[MaterialPluginEvent["PrepareDefines"] = 32] = "PrepareDefines";
    MaterialPluginEvent[MaterialPluginEvent["BindForSubMesh"] = 64] = "BindForSubMesh";
    MaterialPluginEvent[MaterialPluginEvent["PrepareEffect"] = 128] = "PrepareEffect";
    MaterialPluginEvent[MaterialPluginEvent["GetAnimatables"] = 256] = "GetAnimatables";
    MaterialPluginEvent[MaterialPluginEvent["GetActiveTextures"] = 512] = "GetActiveTextures";
    MaterialPluginEvent[MaterialPluginEvent["HasTexture"] = 1024] = "HasTexture";
    MaterialPluginEvent[MaterialPluginEvent["FillRenderTargetTextures"] = 2048] = "FillRenderTargetTextures";
    MaterialPluginEvent[MaterialPluginEvent["HasRenderTargetTextures"] = 4096] = "HasRenderTargetTextures";
    MaterialPluginEvent[MaterialPluginEvent["HardBindForSubMesh"] = 8192] = "HardBindForSubMesh";
})(MaterialPluginEvent || (MaterialPluginEvent = {}));
//# sourceMappingURL=materialPluginEvent.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.js
var material_detailMapConfiguration = __webpack_require__(97841);
;// ./node_modules/@babylonjs/core/Materials/material.decalMapConfiguration.js








/**
 * @internal
 */
class DecalMapDefines extends materialDefines/* MaterialDefines */.M {
    constructor() {
        super(...arguments);
        this.DECAL = false;
        this.DECALDIRECTUV = 0;
        this.DECAL_SMOOTHALPHA = false;
        this.GAMMADECAL = false;
    }
}
/**
 * Plugin that implements the decal map component of a material
 * @since 5.49.1
 */
class DecalMapConfiguration extends materialPluginBase/* MaterialPluginBase */.y {
    /** @internal */
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    /**
     * Creates a new DecalMapConfiguration
     * @param material The material to attach the decal map plugin to
     * @param addToPluginList If the plugin should be added to the material plugin list
     */
    constructor(material, addToPluginList = true) {
        super(material, "DecalMap", 150, new DecalMapDefines(), addToPluginList);
        this._isEnabled = false;
        /**
         * Enables or disables the decal map on this material
         */
        this.isEnabled = false;
        this._smoothAlpha = false;
        /**
         * Enables or disables the smooth alpha mode on this material. Default: false.
         * When enabled, the alpha value used to blend the decal map will be the squared value and will produce a smoother result.
         */
        this.smoothAlpha = false;
        this.registerForExtraEvents = true; // because we override the hardBindForSubMesh method
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
    }
    isReadyForSubMesh(defines, scene, engine, subMesh) {
        const decalMap = subMesh.getMesh().decalMap;
        if (!this._isEnabled || !decalMap?.texture || !materialFlags/* MaterialFlags */.h.DecalMapEnabled || !scene.texturesEnabled) {
            return true;
        }
        return decalMap.isReady();
    }
    prepareDefinesBeforeAttributes(defines, scene, mesh) {
        const decalMap = mesh.decalMap;
        if (!this._isEnabled || !decalMap?.texture || !materialFlags/* MaterialFlags */.h.DecalMapEnabled || !scene.texturesEnabled) {
            const isDirty = defines.DECAL;
            if (isDirty) {
                defines.markAsTexturesDirty();
            }
            defines.DECAL = false;
        }
        else {
            const isDirty = !defines.DECAL || defines.GAMMADECAL !== decalMap.texture.gammaSpace;
            if (isDirty) {
                defines.markAsTexturesDirty();
            }
            defines.DECAL = true;
            defines.GAMMADECAL = decalMap.texture.gammaSpace;
            defines.DECAL_SMOOTHALPHA = this._smoothAlpha;
            (0,materialHelper_functions/* PrepareDefinesForMergedUV */.YT)(decalMap.texture, defines, "DECAL");
        }
    }
    hardBindForSubMesh(uniformBuffer, scene, _engine, subMesh) {
        /**
         * Note that we override hardBindForSubMesh and not bindForSubMesh because the material can be shared by multiple meshes,
         * in which case mustRebind could return false even though the decal map is different for each mesh: that's because the decal map
         * is not part of the material but hosted by the decalMap of the mesh instead.
         */
        const decalMap = subMesh.getMesh().decalMap;
        if (!this._isEnabled || !decalMap?.texture || !materialFlags/* MaterialFlags */.h.DecalMapEnabled || !scene.texturesEnabled) {
            return;
        }
        const isFrozen = this._material.isFrozen;
        const texture = decalMap.texture;
        if (!uniformBuffer.useUbo || !isFrozen || !uniformBuffer.isSync) {
            uniformBuffer.updateFloat4("vDecalInfos", texture.coordinatesIndex, 0, 0, 0);
            (0,materialHelper_functions/* BindTextureMatrix */.mA)(texture, uniformBuffer, "decal");
        }
        uniformBuffer.setTexture("decalSampler", texture);
    }
    getClassName() {
        return "DecalMapConfiguration";
    }
    getSamplers(samplers) {
        samplers.push("decalSampler");
    }
    getUniforms() {
        return {
            ubo: [
                { name: "vDecalInfos", size: 4, type: "vec4" },
                { name: "decalMatrix", size: 16, type: "mat4" },
            ],
        };
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], DecalMapConfiguration.prototype, "isEnabled", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], DecalMapConfiguration.prototype, "smoothAlpha", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DecalMapConfiguration", DecalMapConfiguration);
//# sourceMappingURL=material.decalMapConfiguration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/PBR/pbrBRDFConfiguration.js
var pbrBRDFConfiguration = __webpack_require__(1500);
;// ./node_modules/@babylonjs/core/Materials/materialPluginFactoryExport.js









/**
 * Creates an instance of the anisotropic plugin
 * @param material parent material the plugin will be created for
 * @returns the plugin instance or null if the plugin is incompatible with material
 */
function createPBRAnisotropicPlugin(material) {
    if (material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d) {
        return new pbrAnisotropicConfiguration/* PBRAnisotropicConfiguration */.i(material);
    }
    return null;
}
/**
 * Creates an instance of the brdf plugin
 * @param material parent material the plugin will be created for
 * @returns the plugin instance or null if the plugin is incompatible with material
 */
function createPBRBRDFPlugin(material) {
    if (material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d) {
        return new pbrBRDFConfiguration/* PBRBRDFConfiguration */.j(material);
    }
    return null;
}
/**
 * Creates an instance of the clear coat plugin
 * @param material parent material the plugin will be created for
 * @returns the plugin instance or null if the plugin is incompatible with material
 */
function createPBRClearCoatPlugin(material) {
    if (material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d) {
        return new pbrClearCoatConfiguration/* PBRClearCoatConfiguration */.t(material);
    }
    return null;
}
/**
 * Creates an instance of the iridescence plugin
 * @param material parent material the plugin will be created for
 * @returns the plugin instance or null if the plugin is incompatible with material
 */
function createPBRIridescencePlugin(material) {
    if (material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d) {
        return new pbrIridescenceConfiguration/* PBRIridescenceConfiguration */.z(material);
    }
    return null;
}
/**
 * Creates an instance of the sheen plugin
 * @param material parent material the plugin will be created for
 * @returns the plugin instance or null if the plugin is incompatible with material
 */
function createPBRSheenPlugin(material) {
    if (material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d) {
        return new pbrSheenConfiguration/* PBRSheenConfiguration */.C(material);
    }
    return null;
}
/**
 * Creates an instance of the sub surface plugin
 * @param material parent material the plugin will be created for
 * @returns the plugin instance or null if the plugin is incompatible with material
 */
function createPBRSubSurfacePlugin(material) {
    if (material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d) {
        return new pbrSubSurfaceConfiguration/* PBRSubSurfaceConfiguration */.I(material);
    }
    return null;
}
/**
 * Creates an instance of the detail map plugin
 * @param material parent material the plugin will be created for
 * @returns the plugin instance or null if the plugin is incompatible with material
 */
function createDetailMapPlugin(material) {
    if (material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d || material instanceof standardMaterial/* StandardMaterial */.F) {
        return new material_detailMapConfiguration/* DetailMapConfiguration */.c(material);
    }
    return null;
}
//# sourceMappingURL=materialPluginFactoryExport.js.map
;// ./node_modules/@babylonjs/core/Materials/GreasedLine/greasedLineMaterialDefaults.js

/**
 * Default settings for GreasedLine materials
 */
class GreasedLineMaterialDefaults {
}
/**
 * Default line color for newly created lines
 */
GreasedLineMaterialDefaults.DEFAULT_COLOR = math_color/* Color3 */.v9.White();
/**
 * Default line width when sizeAttenuation is true
 */
GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED = 1;
/**
 * Defaule line width
 */
GreasedLineMaterialDefaults.DEFAULT_WIDTH = 0.1;
//# sourceMappingURL=greasedLineMaterialDefaults.js.map
;// ./node_modules/@babylonjs/core/Misc/greasedLineTools.js







/**
 * Tool functions for GreasedLine
 */
class GreasedLineTools {
    /**
     * Converts GreasedLinePoints to number[][]
     * @param points GreasedLinePoints
     * @param options GreasedLineToolsConvertPointsOptions
     * @returns number[][] with x, y, z coordinates of the points, like [[x, y, z, x, y, z, ...], [x, y, z, ...]]
     */
    static ConvertPoints(points, options) {
        if (points.length && Array.isArray(points) && typeof points[0] === "number") {
            return [points];
        }
        else if (points.length && Array.isArray(points[0]) && typeof points[0][0] === "number") {
            return points;
        }
        else if (points.length && !Array.isArray(points[0]) && points[0] instanceof math_vector/* Vector3 */.Pq) {
            const positions = [];
            for (let j = 0; j < points.length; j++) {
                const p = points[j];
                positions.push(p.x, p.y, p.z);
            }
            return [positions];
        }
        else if (points.length > 0 && Array.isArray(points[0]) && points[0].length > 0 && points[0][0] instanceof math_vector/* Vector3 */.Pq) {
            const positions = [];
            const vectorPoints = points;
            vectorPoints.forEach((p) => {
                positions.push(p.flatMap((p2) => [p2.x, p2.y, p2.z]));
            });
            return positions;
        }
        else if (points instanceof Float32Array) {
            if (options?.floatArrayStride) {
                const positions = [];
                const stride = options.floatArrayStride * 3;
                for (let i = 0; i < points.length; i += stride) {
                    const linePoints = new Array(stride); // Pre-allocate memory for the line
                    for (let j = 0; j < stride; j++) {
                        linePoints[j] = points[i + j];
                    }
                    positions.push(linePoints);
                }
                return positions;
            }
            else {
                return [Array.from(points)];
            }
        }
        else if (points.length && points[0] instanceof Float32Array) {
            const positions = [];
            points.forEach((p) => {
                positions.push(Array.from(p));
            });
            return positions;
        }
        return [];
    }
    /**
     * Omit zero length lines predicate for the MeshesToLines function
     * @param p1 point1 position of the face
     * @param p2 point2 position of the face
     * @param p3 point3 position of the face
     * @returns original points or null if any edge length is zero
     */
    static OmitZeroLengthPredicate(p1, p2, p3) {
        const fileredPoints = [];
        // edge1
        if (p2.subtract(p1).lengthSquared() > 0) {
            fileredPoints.push([p1, p2]);
        }
        // edge2
        if (p3.subtract(p2).lengthSquared() > 0) {
            fileredPoints.push([p2, p3]);
        }
        // edge3
        if (p1.subtract(p3).lengthSquared() > 0) {
            fileredPoints.push([p3, p1]);
        }
        return fileredPoints.length === 0 ? null : fileredPoints;
    }
    /**
     * Omit duplicate lines predicate for the MeshesToLines function
     * @param p1 point1 position of the face
     * @param p2 point2 position of the face
     * @param p3 point3 position of the face
     * @param points array of points to search in
     * @returns original points or null if any edge length is zero
     */
    static OmitDuplicatesPredicate(p1, p2, p3, points) {
        const fileredPoints = [];
        // edge1
        if (!GreasedLineTools._SearchInPoints(p1, p2, points)) {
            fileredPoints.push([p1, p2]);
        }
        // edge2
        if (!GreasedLineTools._SearchInPoints(p2, p3, points)) {
            fileredPoints.push([p2, p3]);
        }
        // edge3
        if (!GreasedLineTools._SearchInPoints(p3, p1, points)) {
            fileredPoints.push([p3, p1]);
        }
        return fileredPoints.length === 0 ? null : fileredPoints;
    }
    static _SearchInPoints(p1, p2, points) {
        for (const ps of points) {
            for (let i = 0; i < ps.length; i++) {
                if (ps[i]?.equals(p1)) {
                    // find the first point
                    // if it has a sibling of p2 the line already exists
                    if (ps[i + 1]?.equals(p2) || ps[i - 1]?.equals(p2)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
    /**
     * Gets mesh triangles as line positions
     * @param meshes array of meshes
     * @param predicate predicate function which decides whether to include the mesh triangle/face in the ouput
     * @returns array of arrays of points
     */
    static MeshesToLines(meshes, predicate) {
        const points = [];
        meshes.forEach((m, meshIndex) => {
            const vertices = m.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
            const indices = m.getIndices();
            if (vertices && indices) {
                for (let i = 0, ii = 0; i < indices.length; i++) {
                    const vi1 = indices[ii++] * 3;
                    const vi2 = indices[ii++] * 3;
                    const vi3 = indices[ii++] * 3;
                    const p1 = new math_vector/* Vector3 */.Pq(vertices[vi1], vertices[vi1 + 1], vertices[vi1 + 2]);
                    const p2 = new math_vector/* Vector3 */.Pq(vertices[vi2], vertices[vi2 + 1], vertices[vi2 + 2]);
                    const p3 = new math_vector/* Vector3 */.Pq(vertices[vi3], vertices[vi3 + 1], vertices[vi3 + 2]);
                    if (predicate) {
                        const pointsFromPredicate = predicate(p1, p2, p3, points, i, vi1, m, meshIndex, vertices, indices);
                        if (pointsFromPredicate) {
                            for (const p of pointsFromPredicate) {
                                points.push(p);
                            }
                        }
                    }
                    else {
                        points.push([p1, p2], [p2, p3], [p3, p1]);
                    }
                }
            }
        });
        return points;
    }
    /**
     * Converts number coordinates to Vector3s
     * @param points number array of x, y, z, x, y z, ... coordinates
     * @returns Vector3 array
     */
    static ToVector3Array(points) {
        if (Array.isArray(points[0])) {
            const array = [];
            const inputArray = points;
            for (const subInputArray of inputArray) {
                const subArray = [];
                for (let i = 0; i < subInputArray.length; i += 3) {
                    subArray.push(new math_vector/* Vector3 */.Pq(subInputArray[i], subInputArray[i + 1], subInputArray[i + 2]));
                }
                array.push(subArray);
            }
            return array;
        }
        const inputArray = points;
        const array = [];
        for (let i = 0; i < inputArray.length; i += 3) {
            array.push(new math_vector/* Vector3 */.Pq(inputArray[i], inputArray[i + 1], inputArray[i + 2]));
        }
        return array;
    }
    /**
     * Gets a number array from a Vector3 array.
     * You can you for example to convert your Vector3[] offsets to the required number[] for the offsets option.
     * @param points Vector3 array
     * @returns an array of x, y, z coordinates as numbers [x, y, z, x, y, z, x, y, z, ....]
     */
    static ToNumberArray(points) {
        return points.flatMap((v) => [v.x, v.y, v.z]);
    }
    /**
     * Calculates the sum of points of every line and the number of points in each line.
     * This function is useful when you are drawing multiple lines in one mesh and you want
     * to know the counts. For example for creating an offsets table.
     * @param points point array
     * @returns points count info
     */
    static GetPointsCountInfo(points) {
        const counts = new Array(points.length);
        let total = 0;
        for (let n = points.length; n--;) {
            counts[n] = points[n].length / 3;
            total += counts[n];
        }
        return { total, counts };
    }
    /**
     * Gets the length of the line counting all it's segments length
     * @param data array of line points
     * @returns length of the line
     */
    static GetLineLength(data) {
        if (data.length === 0) {
            return 0;
        }
        let points;
        if (typeof data[0] === "number") {
            points = GreasedLineTools.ToVector3Array(data);
        }
        else {
            points = data;
        }
        const tmp = math_vector/* TmpVectors */.AA.Vector3[0];
        let length = 0;
        for (let index = 0; index < points.length - 1; index++) {
            const point1 = points[index];
            const point2 = points[index + 1];
            length += point2.subtractToRef(point1, tmp).length();
        }
        return length;
    }
    /**
     * Gets the the length from the beginning to each point of the line as array.
     * @param data array of line points
     * @returns length array of the line
     */
    static GetLineLengthArray(data) {
        const out = new Float32Array(data.length / 3);
        let length = 0;
        for (let index = 0, pointsLength = data.length / 3 - 1; index < pointsLength; index++) {
            let x = data[index * 3 + 0];
            let y = data[index * 3 + 1];
            let z = data[index * 3 + 2];
            x -= data[index * 3 + 3];
            y -= data[index * 3 + 4];
            z -= data[index * 3 + 5];
            const currentLength = Math.sqrt(x * x + y * y + z * z);
            length += currentLength;
            out[index + 1] = length;
        }
        return out;
    }
    /**
     * Divides a segment into smaller segments.
     * A segment is a part of the line between it's two points.
     * @param point1 first point of the line
     * @param point2 second point of the line
     * @param segmentCount number of segments we want to have in the divided line
     * @returns
     */
    static SegmentizeSegmentByCount(point1, point2, segmentCount) {
        const dividedLinePoints = [];
        const diff = point2.subtract(point1);
        const divisor = math_vector/* TmpVectors */.AA.Vector3[0];
        divisor.setAll(segmentCount);
        const segmentVector = math_vector/* TmpVectors */.AA.Vector3[1];
        diff.divideToRef(divisor, segmentVector);
        let nextPoint = point1.clone();
        dividedLinePoints.push(nextPoint);
        for (let index = 0; index < segmentCount; index++) {
            nextPoint = nextPoint.clone();
            dividedLinePoints.push(nextPoint.addInPlace(segmentVector));
        }
        return dividedLinePoints;
    }
    /**
     * Divides a line into segments.
     * A segment is a part of the line between it's two points.
     * @param what line points
     * @param segmentLength length of each segment of the resulting line (distance between two line points)
     * @returns line point
     */
    static SegmentizeLineBySegmentLength(what, segmentLength) {
        const subLines = what[0] instanceof math_vector/* Vector3 */.Pq
            ? GreasedLineTools.GetLineSegments(what)
            : typeof what[0] === "number"
                ? GreasedLineTools.GetLineSegments(GreasedLineTools.ToVector3Array(what))
                : what;
        const points = [];
        subLines.forEach((s) => {
            if (s.length > segmentLength) {
                const segments = GreasedLineTools.SegmentizeSegmentByCount(s.point1, s.point2, Math.ceil(s.length / segmentLength));
                segments.forEach((seg) => {
                    points.push(seg);
                });
            }
            else {
                points.push(s.point1);
                points.push(s.point2);
            }
        });
        return points;
    }
    /**
     * Divides a line into segments.
     * A segment is a part of the line between it's two points.
     * @param what line points
     * @param segmentCount number of segments
     * @returns line point
     */
    static SegmentizeLineBySegmentCount(what, segmentCount) {
        const points = (typeof what[0] === "number" ? GreasedLineTools.ToVector3Array(what) : what);
        const segmentLength = GreasedLineTools.GetLineLength(points) / segmentCount;
        return GreasedLineTools.SegmentizeLineBySegmentLength(points, segmentLength);
    }
    /**
     * Gets line segments.
     * A segment is a part of the line between it's two points.
     * @param points line points
     * @returns segments information of the line segment including starting point, ending point and the distance between them
     */
    static GetLineSegments(points) {
        const segments = [];
        for (let index = 0; index < points.length - 1; index++) {
            const point1 = points[index];
            const point2 = points[index + 1];
            const length = point2.subtract(point1).length();
            segments.push({ point1, point2, length });
        }
        return segments;
    }
    /**
     * Gets the minimum and the maximum length of a line segment in the line.
     * A segment is a part of the line between it's two points.
     * @param points line points
     * @returns
     */
    static GetMinMaxSegmentLength(points) {
        const subLines = GreasedLineTools.GetLineSegments(points);
        const sorted = subLines.sort((s) => s.length);
        return {
            min: sorted[0].length,
            max: sorted[sorted.length - 1].length,
        };
    }
    /**
     * Finds the last visible position in world space of the line according to the visibility parameter
     * @param lineSegments segments of the line
     * @param lineLength total length of the line
     * @param visbility normalized value of visibility
     * @param localSpace if true the result will be in local space (default is false)
     * @returns world space coordinate of the last visible piece of the line
     */
    static GetPositionOnLineByVisibility(lineSegments, lineLength, visbility, localSpace = false) {
        const lengthVisibilityRatio = lineLength * visbility;
        let sumSegmentLengths = 0;
        let segmentIndex = 0;
        const lineSegmentsLength = lineSegments.length;
        for (let i = 0; i < lineSegmentsLength; i++) {
            if (lengthVisibilityRatio <= sumSegmentLengths + lineSegments[i].length) {
                segmentIndex = i;
                break;
            }
            sumSegmentLengths += lineSegments[i].length;
        }
        const s = (lengthVisibilityRatio - sumSegmentLengths) / lineSegments[segmentIndex].length;
        lineSegments[segmentIndex].point2.subtractToRef(lineSegments[segmentIndex].point1, math_vector/* TmpVectors */.AA.Vector3[0]);
        math_vector/* TmpVectors */.AA.Vector3[1] = math_vector/* TmpVectors */.AA.Vector3[0].multiplyByFloats(s, s, s);
        if (!localSpace) {
            math_vector/* TmpVectors */.AA.Vector3[1].addInPlace(lineSegments[segmentIndex].point1);
        }
        return math_vector/* TmpVectors */.AA.Vector3[1].clone();
    }
    /**
     * Creates lines in a shape of circle/arc.
     * A segment is a part of the line between it's two points.
     * @param radiusX radiusX of the circle
     * @param segments number of segments in the circle
     * @param z z coordinate of the points. Defaults to 0.
     * @param radiusY radiusY of the circle - you can draw an oval if using different values
     * @param segmentAngle angle offset of the segments. Defaults to Math.PI * 2 / segments. Change this value to draw a part of the circle.
     * @returns line points
     */
    static GetCircleLinePoints(radiusX, segments, z = 0, radiusY = radiusX, segmentAngle = (Math.PI * 2) / segments) {
        const points = [];
        for (let i = 0; i <= segments; i++) {
            points.push(new math_vector/* Vector3 */.Pq(Math.cos(i * segmentAngle) * radiusX, Math.sin(i * segmentAngle) * radiusY, z));
        }
        return points;
    }
    /**
     * Gets line points in a shape of a bezier curve
     * @param p0 bezier point0
     * @param p1 bezier point1
     * @param p2 bezier point2
     * @param segments number of segments in the curve
     * @returns
     */
    static GetBezierLinePoints(p0, p1, p2, segments) {
        return math_path/* Curve3 */.jj.CreateQuadraticBezier(p0, p1, p2, segments)
            .getPoints()
            .flatMap((v) => [v.x, v.y, v.z]);
    }
    /**
     *
     * @param position position of the arrow cap (mainly you want to create a triangle, set widthUp and widthDown to the same value and omit widthStartUp and widthStartDown)
     * @param direction direction which the arrow points to
     * @param length length (size) of the arrow cap itself
     * @param widthUp the arrow width above the line
     * @param widthDown the arrow width belove the line
     * @param widthStartUp the arrow width at the start of the arrow above the line. In most scenarios this is 0.
     * @param widthStartDown the arrow width at the start of the arrow below the line. In most scenarios this is 0.
     * @returns
     */
    static GetArrowCap(position, direction, length, widthUp, widthDown, widthStartUp = 0, widthStartDown = 0) {
        const points = [position.clone(), position.add(direction.multiplyByFloats(length, length, length))];
        const widths = [widthUp, widthDown, widthStartUp, widthStartDown];
        return {
            points,
            widths,
        };
    }
    /**
     * Gets 3D positions of points from a text and font
     * @param text Text
     * @param size Size of the font
     * @param resolution Resolution of the font
     * @param fontData defines the font data (can be generated with http://gero3.github.io/facetype.js/)
     * @param z z coordinate
     * @param includeInner include the inner parts of the font in the result. Default true. If false, only the outlines will be returned.
     * @returns number[][] of 3D positions
     */
    static GetPointsFromText(text, size, resolution, fontData, z = 0, includeInner = true) {
        const allPoints = [];
        const shapePaths = CreateTextShapePaths(text, size, resolution, fontData);
        for (const sp of shapePaths) {
            for (const p of sp.paths) {
                const points = [];
                const points2d = p.getPoints();
                for (const p2d of points2d) {
                    points.push(p2d.x, p2d.y, z);
                }
                allPoints.push(points);
            }
            if (includeInner) {
                for (const h of sp.holes) {
                    const holes = [];
                    const points2d = h.getPoints();
                    for (const p2d of points2d) {
                        holes.push(p2d.x, p2d.y, z);
                    }
                    allPoints.push(holes);
                }
            }
        }
        return allPoints;
    }
    /**
     * Converts an array of Color3 to Uint8Array
     * @param colors Arrray of Color3
     * @returns Uin8Array of colors [r, g, b, a, r, g, b, a, ...]
     */
    static Color3toRGBAUint8(colors) {
        const colorTable = new Uint8Array(colors.length * 4);
        for (let i = 0, j = 0; i < colors.length; i++) {
            colorTable[j++] = colors[i].r * 255;
            colorTable[j++] = colors[i].g * 255;
            colorTable[j++] = colors[i].b * 255;
            colorTable[j++] = 255;
        }
        return colorTable;
    }
    /**
     * Creates a RawTexture from an RGBA color array and sets it on the plugin material instance.
     * @param name name of the texture
     * @param colors Uint8Array of colors
     * @param colorsSampling sampling mode of the created texture
     * @param scene Scene
     * @returns the colors texture
     */
    static CreateColorsTexture(name, colors, colorsSampling, scene) {
        const maxTextureSize = scene.getEngine().getCaps().maxTextureSize ?? 1;
        const width = colors.length > maxTextureSize ? maxTextureSize : colors.length;
        const height = Math.ceil(colors.length / maxTextureSize);
        if (height > 1) {
            colors = [...colors, ...Array(width * height - colors.length).fill(colors[0])];
        }
        const colorsArray = GreasedLineTools.Color3toRGBAUint8(colors);
        const colorsTexture = new rawTexture/* RawTexture */.I(colorsArray, width, height, Engines_engine/* Engine */.N.TEXTUREFORMAT_RGBA, scene, false, true, colorsSampling);
        colorsTexture.name = name;
        return colorsTexture;
    }
    /**
     * A minimum size texture for the colors sampler2D when there is no colors texture defined yet.
     * For fast switching using the useColors property without the need to use defines.
     * @param scene Scene
     * @returns empty colors texture
     */
    static PrepareEmptyColorsTexture(scene) {
        if (!GreasedLineMaterialDefaults.EmptyColorsTexture) {
            const colorsArray = new Uint8Array(4);
            GreasedLineMaterialDefaults.EmptyColorsTexture = new rawTexture/* RawTexture */.I(colorsArray, 1, 1, Engines_engine/* Engine */.N.TEXTUREFORMAT_RGBA, scene, false, false, rawTexture/* RawTexture */.I.NEAREST_NEAREST);
            GreasedLineMaterialDefaults.EmptyColorsTexture.name = "grlEmptyColorsTexture";
        }
        return GreasedLineMaterialDefaults.EmptyColorsTexture;
    }
    /**
     * Diposes the shared empty colors texture
     */
    static DisposeEmptyColorsTexture() {
        GreasedLineMaterialDefaults.EmptyColorsTexture?.dispose();
        GreasedLineMaterialDefaults.EmptyColorsTexture = null;
    }
    /**
     * Converts boolean to number.
     * @param bool the bool value
     * @returns 1 if true, 0 if false.
     */
    static BooleanToNumber(bool) {
        return bool ? 1 : 0;
    }
}
//# sourceMappingURL=greasedLineTools.js.map
;// ./node_modules/@babylonjs/core/Materials/GreasedLine/greasedLinePluginMaterial.js







/**
 * @internal
 */
class MaterialGreasedLineDefines extends materialDefines/* MaterialDefines */.M {
    constructor() {
        super(...arguments);
        /**
         * The material has a color option specified
         */
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.GREASED_LINE_HAS_COLOR = false;
        /**
         * The material's size attenuation optiom
         */
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.GREASED_LINE_SIZE_ATTENUATION = false;
        /**
         * The type of color distribution is set to line this value equals to true.
         */
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = false;
        /**
         * True if scene is in right handed coordinate system.
         */
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = false;
        /**
         * True if the line is in camera facing mode
         */
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.GREASED_LINE_CAMERA_FACING = true;
    }
}
/**
 * GreasedLinePluginMaterial for GreasedLineMesh/GreasedLineRibbonMesh.
 * Use the GreasedLineBuilder.CreateGreasedLineMaterial function to create and instance of this class.
 */
class GreasedLinePluginMaterial extends materialPluginBase/* MaterialPluginBase */.y {
    /**
     * Creates a new instance of the GreasedLinePluginMaterial
     * @param material base material for the plugin
     * @param scene the scene
     * @param options plugin options
     */
    constructor(material, scene, options) {
        options = options || {
            color: GreasedLineMaterialDefaults.DEFAULT_COLOR,
        };
        const defines = new MaterialGreasedLineDefines();
        defines.GREASED_LINE_HAS_COLOR = !!options.color && !options.useColors;
        defines.GREASED_LINE_SIZE_ATTENUATION = options.sizeAttenuation ?? false;
        defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = options.colorDistributionType === 1 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE */;
        defines.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = (scene ?? material.getScene()).useRightHandedSystem;
        defines.GREASED_LINE_CAMERA_FACING = options.cameraFacing ?? true;
        super(material, GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME, 200, defines);
        /**
         * You can provide a colorsTexture to use instead of one generated from the 'colors' option
         */
        this.colorsTexture = null;
        this._scene = scene ?? material.getScene();
        this._engine = this._scene.getEngine();
        this._cameraFacing = options.cameraFacing ?? true;
        this.visibility = options.visibility ?? 1;
        this.useDash = options.useDash ?? false;
        this.dashRatio = options.dashRatio ?? 0.5;
        this.dashOffset = options.dashOffset ?? 0;
        this.width = options.width ? options.width : options.sizeAttenuation ? GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED : GreasedLineMaterialDefaults.DEFAULT_WIDTH;
        this._sizeAttenuation = options.sizeAttenuation ?? false;
        this.colorMode = options.colorMode ?? 0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */;
        this._color = options.color ?? null;
        this.useColors = options.useColors ?? false;
        this._colorsDistributionType = options.colorDistributionType ?? 0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */;
        this.colorsSampling = options.colorsSampling ?? rawTexture/* RawTexture */.I.NEAREST_NEAREST;
        this._colors = options.colors ?? null;
        this.dashCount = options.dashCount ?? 1; // calculate the _dashArray value, call the setter
        this.resolution = options.resolution ?? new math_vector/* Vector2 */.I9(this._engine.getRenderWidth(), this._engine.getRenderHeight()); // calculate aspect call the setter
        if (options.colorsTexture) {
            this.colorsTexture = options.colorsTexture; // colorsTexture from options takes precedence
        }
        else {
            if (this._colors) {
                this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${material.name}-colors-texture`, this._colors, this.colorsSampling, this._scene);
            }
            else {
                this._color = this._color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR;
                GreasedLineTools.PrepareEmptyColorsTexture(this._scene);
            }
        }
        this._engine.onDisposeObservable.add(() => {
            GreasedLineTools.DisposeEmptyColorsTexture();
        });
        this._enable(true); // always enabled
    }
    /**
     * Get the shader attributes
     * @param attributes array which will be filled with the attributes
     */
    getAttributes(attributes) {
        attributes.push("grl_offsets");
        attributes.push("grl_widths");
        attributes.push("grl_colorPointers");
        attributes.push("grl_counters");
        if (this._cameraFacing) {
            attributes.push("grl_previousAndSide");
            attributes.push("grl_nextAndCounters");
        }
        else {
            attributes.push("grl_slopes");
        }
    }
    /**
     * Get the shader samplers
     * @param samplers
     */
    getSamplers(samplers) {
        samplers.push("grl_colors");
    }
    /**
     * Get the shader textures
     * @param activeTextures array which will be filled with the textures
     */
    getActiveTextures(activeTextures) {
        if (this.colorsTexture) {
            activeTextures.push(this.colorsTexture);
        }
    }
    /**
     * Get the shader uniforms
     * @returns uniforms
     */
    getUniforms() {
        const ubo = [
            { name: "grl_singleColor", size: 3, type: "vec3" },
            { name: "grl_textureSize", size: 2, type: "vec2" },
            { name: "grl_dashOptions", size: 4, type: "vec4" },
            { name: "grl_colorMode_visibility_colorsWidth_useColors", size: 4, type: "vec4" },
        ];
        if (this._cameraFacing) {
            ubo.push({ name: "grl_projection", size: 16, type: "mat4" }, { name: "grl_aspect_resolution_lineWidth", size: 4, type: "vec4" });
        }
        return {
            ubo,
            vertex: this._cameraFacing
                ? `
                uniform vec4 grl_aspect_resolution_lineWidth;
                uniform mat4 grl_projection;
                `
                : "",
            fragment: `
                uniform vec4 grl_dashOptions;
                uniform vec2 grl_textureSize;
                uniform vec4 grl_colorMode_visibility_colorsWidth_useColors;
                uniform vec3 grl_singleColor;
                `,
        };
    }
    // only getter, it doesn't make sense to use this plugin on a mesh other than GreasedLineMesh
    // and it doesn't make sense to disable it on the mesh
    get isEnabled() {
        return true;
    }
    /**
     * Bind the uniform buffer
     * @param uniformBuffer
     */
    bindForSubMesh(uniformBuffer) {
        if (this._cameraFacing) {
            const activeCamera = this._scene.activeCamera;
            if (activeCamera) {
                const projection = activeCamera.getProjectionMatrix();
                uniformBuffer.updateMatrix("grl_projection", projection);
            }
            else {
                throw Error("GreasedLinePluginMaterial requires an active camera.");
            }
            const resolutionLineWidth = math_vector/* TmpVectors */.AA.Vector4[0];
            resolutionLineWidth.x = this._aspect;
            resolutionLineWidth.y = this._resolution.x;
            resolutionLineWidth.z = this._resolution.y;
            resolutionLineWidth.w = this.width;
            uniformBuffer.updateVector4("grl_aspect_resolution_lineWidth", resolutionLineWidth);
        }
        const dashOptions = math_vector/* TmpVectors */.AA.Vector4[0];
        dashOptions.x = GreasedLineTools.BooleanToNumber(this.useDash);
        dashOptions.y = this._dashArray;
        dashOptions.z = this.dashOffset;
        dashOptions.w = this.dashRatio;
        uniformBuffer.updateVector4("grl_dashOptions", dashOptions);
        const colorModeVisibilityColorsWidthUseColors = math_vector/* TmpVectors */.AA.Vector4[1];
        colorModeVisibilityColorsWidthUseColors.x = this.colorMode;
        colorModeVisibilityColorsWidthUseColors.y = this.visibility;
        colorModeVisibilityColorsWidthUseColors.z = this.colorsTexture ? this.colorsTexture.getSize().width : 0;
        colorModeVisibilityColorsWidthUseColors.w = GreasedLineTools.BooleanToNumber(this.useColors);
        uniformBuffer.updateVector4("grl_colorMode_visibility_colorsWidth_useColors", colorModeVisibilityColorsWidthUseColors);
        if (this._color) {
            uniformBuffer.updateColor3("grl_singleColor", this._color);
        }
        const texture = this.colorsTexture ?? GreasedLineMaterialDefaults.EmptyColorsTexture;
        uniformBuffer.setTexture("grl_colors", texture);
        uniformBuffer.updateFloat2("grl_textureSize", texture?.getSize().width ?? 1, texture?.getSize().height ?? 1);
    }
    /**
     * Prepare the defines
     * @param defines
     * @param _scene
     * @param _mesh
     */
    prepareDefines(defines, _scene, _mesh) {
        defines.GREASED_LINE_HAS_COLOR = !!this.color && !this.useColors;
        defines.GREASED_LINE_SIZE_ATTENUATION = this._sizeAttenuation;
        defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = this._colorsDistributionType === 1 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE */;
        defines.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = _scene.useRightHandedSystem;
        defines.GREASED_LINE_CAMERA_FACING = this._cameraFacing;
    }
    /**
     * Get the class name
     * @returns class name
     */
    getClassName() {
        return GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME;
    }
    /**
     * Get shader code
     * @param shaderType vertex/fragment
     * @returns shader code
     */
    getCustomCode(shaderType) {
        if (shaderType === "vertex") {
            const obj = {
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_VERTEX_DEFINITIONS: `
                attribute float grl_widths;
                attribute vec3 grl_offsets;
                attribute float grl_colorPointers;
                varying float grlCounters;
                varying float grlColorPointer;

                #ifdef GREASED_LINE_CAMERA_FACING
                    attribute vec4 grl_previousAndSide;
                    attribute vec4 grl_nextAndCounters;

                    vec2 grlFix( vec4 i, float aspect ) {
                        vec2 res = i.xy / i.w;
                        res.x *= aspect;
                        return res;
                    }
                #else
                    attribute vec3 grl_slopes;
                    attribute float grl_counters;
                #endif
                `,
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_VERTEX_UPDATE_POSITION: `
                #ifdef GREASED_LINE_CAMERA_FACING
                    vec3 grlPositionOffset = grl_offsets;
                    positionUpdated += grlPositionOffset;
                #else
                    positionUpdated = (positionUpdated + grl_offsets) + (grl_slopes * grl_widths);
                #endif
                `,
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_VERTEX_MAIN_END: `
                grlColorPointer = grl_colorPointers;

                #ifdef GREASED_LINE_CAMERA_FACING

                    float grlAspect = grl_aspect_resolution_lineWidth.x;
                    float grlBaseWidth = grl_aspect_resolution_lineWidth.w;


                    vec3 grlPrevious = grl_previousAndSide.xyz;
                    float grlSide = grl_previousAndSide.w;

                    vec3 grlNext = grl_nextAndCounters.xyz;
                    grlCounters = grl_nextAndCounters.w;

                    mat4 grlMatrix = viewProjection * finalWorld;
                    vec4 grlFinalPosition = grlMatrix * vec4( positionUpdated , 1.0 );
                    vec4 grlPrevPos = grlMatrix * vec4( grlPrevious + grlPositionOffset, 1.0 );
                    vec4 grlNextPos = grlMatrix * vec4( grlNext + grlPositionOffset, 1.0 );

                    vec2 grlCurrentP = grlFix( grlFinalPosition, grlAspect );
                    vec2 grlPrevP = grlFix( grlPrevPos, grlAspect );
                    vec2 grlNextP = grlFix( grlNextPos, grlAspect );

                    float grlWidth = grlBaseWidth * grl_widths;

                    vec2 grlDir;
                    if( grlNextP == grlCurrentP ) grlDir = normalize( grlCurrentP - grlPrevP );
                    else if( grlPrevP == grlCurrentP ) grlDir = normalize( grlNextP - grlCurrentP );
                    else {
                        vec2 grlDir1 = normalize( grlCurrentP - grlPrevP );
                        vec2 grlDir2 = normalize( grlNextP - grlCurrentP );
                        grlDir = normalize( grlDir1 + grlDir2 );
                    }
                    vec4 grlNormal = vec4( -grlDir.y, grlDir.x, 0., 1. );
                    #ifdef GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM
                        grlNormal.xy *= -.5 * grlWidth;
                    #else
                        grlNormal.xy *= .5 * grlWidth;
                    #endif

                    grlNormal *= grl_projection;

                    #ifdef GREASED_LINE_SIZE_ATTENUATION
                        grlNormal.xy *= grlFinalPosition.w;
                        grlNormal.xy /= ( vec4( grl_aspect_resolution_lineWidth.yz, 0., 1. ) * grl_projection ).xy;
                    #endif

                    grlFinalPosition.xy += grlNormal.xy * grlSide;
                    gl_Position = grlFinalPosition;

                    vPositionW = vec3(grlFinalPosition);
                #else
                    grlCounters = grl_counters;
                #endif
                `,
            };
            this._cameraFacing && (obj["!gl_Position\\=viewProjection\\*worldPos;"] = "//"); // not needed for camera facing GRL
            return obj;
        }
        if (shaderType === "fragment") {
            return {
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_DEFINITIONS: `
                    varying float grlCounters;
                    varying float grlColorPointer;
                    uniform sampler2D grl_colors;
                `,
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_MAIN_END: `
                    float grlColorMode = grl_colorMode_visibility_colorsWidth_useColors.x;
                    float grlVisibility = grl_colorMode_visibility_colorsWidth_useColors.y;
                    float grlColorsWidth = grl_colorMode_visibility_colorsWidth_useColors.z;
                    float grlUseColors = grl_colorMode_visibility_colorsWidth_useColors.w;

                    float grlUseDash = grl_dashOptions.x;
                    float grlDashArray = grl_dashOptions.y;
                    float grlDashOffset = grl_dashOptions.z;
                    float grlDashRatio = grl_dashOptions.w;

                    gl_FragColor.a *= step(grlCounters, grlVisibility);
                    if( gl_FragColor.a == 0. ) discard;

                    if(grlUseDash == 1.){
                        gl_FragColor.a *= ceil(mod(grlCounters + grlDashOffset, grlDashArray) - (grlDashArray * grlDashRatio));
                        if (gl_FragColor.a == 0.) discard;
                    }

                    #ifdef GREASED_LINE_HAS_COLOR
                        if (grlColorMode == ${0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */}.) {
                            gl_FragColor.rgb = grl_singleColor;
                        } else if (grlColorMode == ${1 /* GreasedLineMeshColorMode.COLOR_MODE_ADD */}.) {
                            gl_FragColor.rgb += grl_singleColor;
                        } else if (grlColorMode == ${2 /* GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY */}.) {
                            gl_FragColor.rgb *= grl_singleColor;
                        }
                    #else
                        if (grlUseColors == 1.) {
                            #ifdef GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE
                                vec4 grlColor = texture2D(grl_colors, vec2(grlCounters, 0.), 0.);
                            #else
                                vec2 lookup = vec2(fract(grlColorPointer / grl_textureSize.x), 1.0 - floor(grlColorPointer / grl_textureSize.x) / max(grl_textureSize.y - 1.0, 1.0));
                                vec4 grlColor = texture2D(grl_colors, lookup, 0.0);
                            #endif
                            if (grlColorMode == ${0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */}.) {
                                gl_FragColor = grlColor;
                            } else if (grlColorMode == ${1 /* GreasedLineMeshColorMode.COLOR_MODE_ADD */}.) {
                                gl_FragColor += grlColor;
                            } else if (grlColorMode == ${2 /* GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY */}.) {
                                gl_FragColor *= grlColor;
                            }
                        }
                    #endif

                `,
            };
        }
        return null;
    }
    /**
     * Disposes the plugin material.
     */
    dispose() {
        this.colorsTexture?.dispose();
        super.dispose();
    }
    /**
     * Returns the colors used to colorize the line
     */
    get colors() {
        return this._colors;
    }
    /**
     * Sets the colors used to colorize the line
     */
    set colors(value) {
        this.setColors(value);
    }
    /**
     * Creates or updates the colors texture
     * @param colors color table RGBA
     * @param lazy if lazy, the colors are not updated
     * @param forceNewTexture force creation of a new texture
     */
    setColors(colors, lazy = false, forceNewTexture = false) {
        const origColorsCount = this._colors?.length ?? 0;
        this._colors = colors;
        if (colors === null || colors.length === 0) {
            this.colorsTexture?.dispose();
            return;
        }
        if (lazy && !forceNewTexture) {
            return;
        }
        if (this.colorsTexture && origColorsCount === colors.length && !forceNewTexture) {
            const colorArray = GreasedLineTools.Color3toRGBAUint8(colors);
            this.colorsTexture.update(colorArray);
        }
        else {
            this.colorsTexture?.dispose();
            this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this._material.name}-colors-texture`, colors, this.colorsSampling, this._scene);
        }
    }
    /**
     * Updates the material. Use when material created in lazy mode.
     */
    updateLazy() {
        if (this._colors) {
            this.setColors(this._colors, false, true);
        }
    }
    /**
     * Gets the number of dashes in the line
     */
    get dashCount() {
        return this._dashCount;
    }
    /**
     * Sets the number of dashes in the line
     * @param value dash
     */
    set dashCount(value) {
        this._dashCount = value;
        this._dashArray = 1 / value;
    }
    /**
     * If set to true the line will be rendered always with the same width regardless how far it is located from the camera.
     * Not supported for non camera facing lines.
     */
    get sizeAttenuation() {
        return this._sizeAttenuation;
    }
    /**
     * Turn on/off size attenuation of the width option and widths array.
     * Not supported for non camera facing lines.
     * @param value If set to true the line will be rendered always with the same width regardless how far it is located from the camera.
     */
    set sizeAttenuation(value) {
        this._sizeAttenuation = value;
        this.markAllDefinesAsDirty();
    }
    /**
     * Gets the color of the line
     */
    get color() {
        return this._color;
    }
    /**
     * Sets the color of the line
     * @param value Color3 or null to clear the color. You need to clear the color if you use colors and useColors = true
     */
    set color(value) {
        this.setColor(value);
    }
    /**
     * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.
     * @param value color
     * @param doNotMarkDirty if true, the material will not be marked as dirty
     */
    setColor(value, doNotMarkDirty = false) {
        if ((this._color === null && value !== null) || (this._color !== null && value === null)) {
            this._color = value;
            !doNotMarkDirty && this.markAllDefinesAsDirty();
        }
        else {
            this._color = value;
        }
    }
    /**
     * Gets the color distributiopn type
     */
    get colorsDistributionType() {
        return this._colorsDistributionType;
    }
    /**
     * Sets the color distribution type
     * @see GreasedLineMeshColorDistributionType
     * @param value color distribution type
     */
    set colorsDistributionType(value) {
        this._colorsDistributionType = value;
        this.markAllDefinesAsDirty();
    }
    /**
     * Gets the resolution
     */
    get resolution() {
        return this._resolution;
    }
    /**
     * Sets the resolution
     * @param value resolution of the screen for GreasedLine
     */
    set resolution(value) {
        this._aspect = value.x / value.y;
        this._resolution = value;
    }
    /**
     * Serializes this plugin material
     * @returns serializationObjec
     */
    serialize() {
        const serializationObject = super.serialize();
        const greasedLineMaterialOptions = {
            colorDistributionType: this._colorsDistributionType,
            colorsSampling: this.colorsSampling,
            colorMode: this.colorMode,
            dashCount: this._dashCount,
            dashOffset: this.dashOffset,
            dashRatio: this.dashRatio,
            resolution: this._resolution,
            sizeAttenuation: this._sizeAttenuation,
            useColors: this.useColors,
            useDash: this.useDash,
            visibility: this.visibility,
            width: this.width,
        };
        this._colors && (greasedLineMaterialOptions.colors = this._colors);
        this._color && (greasedLineMaterialOptions.color = this._color);
        serializationObject.greasedLineMaterialOptions = greasedLineMaterialOptions;
        return serializationObject;
    }
    /**
     * Parses a serialized objects
     * @param source serialized object
     * @param scene scene
     * @param rootUrl root url for textures
     */
    parse(source, scene, rootUrl) {
        super.parse(source, scene, rootUrl);
        const greasedLineMaterialOptions = source.greasedLineMaterialOptions;
        this.colorsTexture?.dispose();
        greasedLineMaterialOptions.color && this.setColor(greasedLineMaterialOptions.color, true);
        greasedLineMaterialOptions.colorDistributionType && (this.colorsDistributionType = greasedLineMaterialOptions.colorDistributionType);
        greasedLineMaterialOptions.colors && (this.colors = greasedLineMaterialOptions.colors);
        greasedLineMaterialOptions.colorsSampling && (this.colorsSampling = greasedLineMaterialOptions.colorsSampling);
        greasedLineMaterialOptions.colorMode && (this.colorMode = greasedLineMaterialOptions.colorMode);
        greasedLineMaterialOptions.useColors && (this.useColors = greasedLineMaterialOptions.useColors);
        greasedLineMaterialOptions.visibility && (this.visibility = greasedLineMaterialOptions.visibility);
        greasedLineMaterialOptions.useDash && (this.useDash = greasedLineMaterialOptions.useDash);
        greasedLineMaterialOptions.dashCount && (this.dashCount = greasedLineMaterialOptions.dashCount);
        greasedLineMaterialOptions.dashRatio && (this.dashRatio = greasedLineMaterialOptions.dashRatio);
        greasedLineMaterialOptions.dashOffset && (this.dashOffset = greasedLineMaterialOptions.dashOffset);
        greasedLineMaterialOptions.width && (this.width = greasedLineMaterialOptions.width);
        greasedLineMaterialOptions.sizeAttenuation && (this.sizeAttenuation = greasedLineMaterialOptions.sizeAttenuation);
        greasedLineMaterialOptions.resolution && (this.resolution = greasedLineMaterialOptions.resolution);
        if (this.colors) {
            this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this._material.name}-colors-texture`, this.colors, this.colorsSampling, scene);
        }
        else {
            GreasedLineTools.PrepareEmptyColorsTexture(scene);
        }
        this.markAllDefinesAsDirty();
    }
    /**
     * Makes a duplicate of the current configuration into another one.
     * @param plugin define the config where to copy the info
     */
    copyTo(plugin) {
        const dest = plugin;
        dest.colorsTexture?.dispose();
        if (this._colors) {
            dest.colorsTexture = GreasedLineTools.CreateColorsTexture(`${dest._material.name}-colors-texture`, this._colors, dest.colorsSampling, this._scene);
        }
        dest.setColor(this.color, true);
        dest.colorsDistributionType = this.colorsDistributionType;
        dest.colorsSampling = this.colorsSampling;
        dest.colorMode = this.colorMode;
        dest.useColors = this.useColors;
        dest.visibility = this.visibility;
        dest.useDash = this.useDash;
        dest.dashCount = this.dashCount;
        dest.dashRatio = this.dashRatio;
        dest.dashOffset = this.dashOffset;
        dest.width = this.width;
        dest.sizeAttenuation = this.sizeAttenuation;
        dest.resolution = this.resolution;
        dest.markAllDefinesAsDirty();
    }
}
/**
 * Plugin name
 */
GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME = "GreasedLinePluginMaterial";
(0,typeStore/* RegisterClass */.Y5)(`BABYLON.${GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME}`, GreasedLinePluginMaterial);
//# sourceMappingURL=greasedLinePluginMaterial.js.map
;// ./node_modules/@babylonjs/core/Shaders/greasedLine.fragment.js
// Do not edit.

const greasedLine_fragment_name = "greasedLinePixelShader";
const greasedLine_fragment_shader = `precision highp float;uniform sampler2D grlColors;uniform float grlUseColors;uniform float grlUseDash;uniform float grlDashArray;uniform float grlDashOffset;uniform float grlDashRatio;uniform float grlVisibility;uniform float grlColorsWidth;uniform vec2 grl_colorModeAndColorDistributionType;uniform vec3 grlColor;varying float grlCounters;varying float grlColorPointer;void main() {float grlColorMode=grl_colorModeAndColorDistributionType.x;float grlColorDistributionType=grl_colorModeAndColorDistributionType.y;gl_FragColor=vec4(grlColor,1.);gl_FragColor.a=step(grlCounters,grlVisibility);if (gl_FragColor.a==0.) discard;if( grlUseDash==1. ){gl_FragColor.a=ceil(mod(grlCounters+grlDashOffset,grlDashArray)-(grlDashArray*grlDashRatio));if (gl_FragColor.a==0.) discard;}
if (grlUseColors==1.) {vec4 textureColor;if (grlColorDistributionType==COLOR_DISTRIBUTION_TYPE_LINE) { 
textureColor=texture2D(grlColors,vec2(grlCounters,0.),0.);} else {textureColor=texture2D(grlColors,vec2(grlColorPointer/grlColorsWidth,0.),0.);}
if (grlColorMode==COLOR_MODE_SET) {gl_FragColor=textureColor;} else if (grlColorMode==COLOR_MODE_ADD) {gl_FragColor+=textureColor;} else if (grlColorMode==COLOR_MODE_MULTIPLY) {gl_FragColor*=textureColor;}}}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[greasedLine_fragment_name] = greasedLine_fragment_shader;
/** @internal */
const greasedLinePixelShader = { name: greasedLine_fragment_name, shader: greasedLine_fragment_shader };
//# sourceMappingURL=greasedLine.fragment.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js
var ShadersInclude_instancesDeclaration = __webpack_require__(1218);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js
var ShadersInclude_instancesVertex = __webpack_require__(3298);
;// ./node_modules/@babylonjs/core/Shaders/greasedLine.vertex.js
// Do not edit.



const greasedLine_vertex_name = "greasedLineVertexShader";
const greasedLine_vertex_shader = `precision highp float;
#include<instancesDeclaration>
attribute float grl_widths;attribute vec3 grl_offsets;attribute float grl_colorPointers;attribute vec3 position;uniform mat4 viewProjection;uniform mat4 projection;varying float grlCounters;varying float grlColorPointer;
#ifdef GREASED_LINE_CAMERA_FACING
attribute vec4 grl_nextAndCounters;attribute vec4 grl_previousAndSide;uniform vec2 grlResolution;uniform float grlAspect;uniform float grlWidth;uniform float grlSizeAttenuation;vec2 grlFix( vec4 i,float aspect ) {vec2 res=i.xy/i.w;res.x*=aspect;return res;}
#else
attribute vec3 grl_slopes;attribute float grl_counters;
#endif
void main() {
#include<instancesVertex>
grlColorPointer=grl_colorPointers;mat4 grlMatrix=viewProjection*finalWorld ;
#ifdef GREASED_LINE_CAMERA_FACING
float grlBaseWidth=grlWidth;vec3 grlPrevious=grl_previousAndSide.xyz;float grlSide=grl_previousAndSide.w;vec3 grlNext=grl_nextAndCounters.xyz;grlCounters=grl_nextAndCounters.w;vec3 grlPositionOffset=grl_offsets;vec4 grlFinalPosition=grlMatrix*vec4( position+grlPositionOffset ,1.0 );vec4 grlPrevPos=grlMatrix*vec4( grlPrevious+grlPositionOffset,1.0 );vec4 grlNextPos=grlMatrix*vec4( grlNext+grlPositionOffset,1.0 );vec2 grlCurrentP=grlFix( grlFinalPosition,grlAspect );vec2 grlPrevP=grlFix( grlPrevPos,grlAspect );vec2 grlNextP=grlFix( grlNextPos,grlAspect );float grlWidth=grlBaseWidth*grl_widths;vec2 grlDir;if( grlNextP==grlCurrentP ) grlDir=normalize( grlCurrentP-grlPrevP );else if( grlPrevP==grlCurrentP ) grlDir=normalize( grlNextP-grlCurrentP );else {vec2 grlDir1=normalize( grlCurrentP-grlPrevP );vec2 grlDir2=normalize( grlNextP-grlCurrentP );grlDir=normalize( grlDir1+grlDir2 );}
vec4 grlNormal=vec4( -grlDir.y,grlDir.x,0.,1. );
#ifdef GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM
grlNormal.xy*=-.5*grlWidth;
#else
grlNormal.xy*=.5*grlWidth;
#endif
grlNormal*=projection;if (grlSizeAttenuation==1.) {grlNormal.xy*=grlFinalPosition.w;grlNormal.xy/=( vec4( grlResolution,0.,1. )*projection ).xy;}
grlFinalPosition.xy+=grlNormal.xy*grlSide;gl_Position=grlFinalPosition;
#else
grlCounters=grl_counters;vec4 grlFinalPosition=grlMatrix*vec4( (position+grl_offsets)+grl_slopes*grl_widths ,1.0 ) ;gl_Position=grlFinalPosition;
#endif
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[greasedLine_vertex_name] = greasedLine_vertex_shader;
/** @internal */
const greasedLineVertexShader = { name: greasedLine_vertex_name, shader: greasedLine_vertex_shader };
//# sourceMappingURL=greasedLine.vertex.js.map
;// ./node_modules/@babylonjs/core/Materials/GreasedLine/greasedLineSimpleMaterial.js








/**
 * GreasedLineSimpleMaterial
 */
class GreasedLineSimpleMaterial extends shaderMaterial/* ShaderMaterial */.B {
    /**
     * GreasedLineSimple material constructor
     * @param name material name
     * @param scene the scene
     * @param options material options
     */
    constructor(name, scene, options) {
        const defines = [
            `COLOR_DISTRIBUTION_TYPE_LINE ${1 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE */}.`,
            `COLOR_DISTRIBUTION_TYPE_SEGMENT ${0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */}.`,
            `COLOR_MODE_SET ${0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */}.`,
            `COLOR_MODE_ADD ${1 /* GreasedLineMeshColorMode.COLOR_MODE_ADD */}.`,
            `COLOR_MODE_MULTIPLY ${2 /* GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY */}.`,
        ];
        const attributes = ["position", "grl_widths", "grl_offsets", "grl_colorPointers"];
        scene.useRightHandedSystem && defines.push("GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM");
        if (options.cameraFacing) {
            defines.push("GREASED_LINE_CAMERA_FACING");
            attributes.push("grl_previousAndSide", "grl_nextAndCounters");
        }
        else {
            attributes.push("grl_slopes");
            attributes.push("grl_counters");
        }
        super(name, scene, {
            vertex: "greasedLine",
            fragment: "greasedLine",
        }, {
            attributes,
            uniforms: [
                "world",
                "viewProjection",
                "view",
                "projection",
                "grlColorsWidth",
                "grlUseColors",
                "grlWidth",
                "grlColor",
                "grl_colorModeAndColorDistributionType",
                "grlResolution",
                "grlAspect",
                "grlAizeAttenuation",
                "grlDashArray",
                "grlDashOffset",
                "grlDashRatio",
                "grlUseDash",
                "grlVisibility",
            ],
            samplers: ["grlColors"],
            defines,
        });
        this._color = math_color/* Color3 */.v9.White();
        this._colorsDistributionType = 0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */;
        this._colorsTexture = null;
        options = options || {
            color: GreasedLineMaterialDefaults.DEFAULT_COLOR,
        };
        const engine = scene.getEngine();
        this.visibility = options.visibility ?? 1;
        this.useDash = options.useDash ?? false;
        this.dashRatio = options.dashRatio ?? 0.5;
        this.dashOffset = options.dashOffset ?? 0;
        this.dashCount = options.dashCount ?? 1; // calculate the _dashArray value, call the setter
        this.width = options.width
            ? options.width
            : options.sizeAttenuation && options.cameraFacing
                ? GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED
                : GreasedLineMaterialDefaults.DEFAULT_WIDTH;
        this.sizeAttenuation = options.sizeAttenuation ?? false;
        this.color = options.color ?? math_color/* Color3 */.v9.White();
        this.useColors = options.useColors ?? false;
        this.colorsDistributionType = options.colorDistributionType ?? 0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */;
        this.colorsSampling = options.colorsSampling ?? rawTexture/* RawTexture */.I.NEAREST_NEAREST;
        this.colorMode = options.colorMode ?? 0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */;
        this._colors = options.colors ?? null;
        this._cameraFacing = options.cameraFacing ?? true;
        this.resolution = options.resolution ?? new math_vector/* Vector2 */.I9(engine.getRenderWidth(), engine.getRenderHeight()); // calculate aspect call the setter
        if (options.colorsTexture) {
            this.colorsTexture = options.colorsTexture;
        }
        else {
            this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);
        }
        if (this._colors) {
            if (this.useColors) {
                this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, this._colors, this.colorsSampling, scene);
            }
        }
        engine.onDisposeObservable.add(() => {
            GreasedLineTools.DisposeEmptyColorsTexture();
        });
    }
    /**
     * Disposes the plugin material.
     */
    dispose() {
        this._colorsTexture?.dispose();
        super.dispose();
    }
    _setColorModeAndColorDistributionType() {
        this.setVector2("grl_colorModeAndColorDistributionType", new math_vector/* Vector2 */.I9(this._colorMode, this._colorsDistributionType));
    }
    /**
     * Updates the material. Use when material created in lazy mode.
     */
    updateLazy() {
        if (this._colors) {
            this.setColors(this._colors, false, true);
        }
    }
    /**
     * Returns the colors used to colorize the line
     */
    get colors() {
        return this._colors;
    }
    /**
     * Sets the colors used to colorize the line
     */
    set colors(value) {
        this.setColors(value);
    }
    /**
     * Creates or updates the colors texture
     * @param colors color table RGBA
     * @param lazy if lazy, the colors are not updated
     * @param forceNewTexture force creation of a new texture
     */
    setColors(colors, lazy = false, forceNewTexture = false) {
        const origColorsCount = this._colors?.length ?? 0;
        this._colors = colors;
        if (colors === null || colors.length === 0) {
            this._colorsTexture?.dispose();
            return;
        }
        if (lazy && !forceNewTexture) {
            return;
        }
        if (this._colorsTexture && origColorsCount === colors.length && !forceNewTexture) {
            const colorArray = GreasedLineTools.Color3toRGBAUint8(colors);
            this._colorsTexture.update(colorArray);
        }
        else {
            this._colorsTexture?.dispose();
            this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, colors, this.colorsSampling, this.getScene());
        }
    }
    /**
     * Gets the colors texture
     */
    get colorsTexture() {
        return this._colorsTexture ?? null;
    }
    /**
     * Sets the colorsTexture
     */
    set colorsTexture(value) {
        this._colorsTexture = value;
        this.setFloat("grlColorsWidth", this._colorsTexture.getSize().width);
        this.setTexture("grlColors", this._colorsTexture);
    }
    /**
     * Line base width. At each point the line width is calculated by widths[pointIndex] * width
     */
    get width() {
        return this._width;
    }
    /**
     * Line base width. At each point the line width is calculated by widths[pointIndex] * width
     */
    set width(value) {
        this._width = value;
        this.setFloat("grlWidth", value);
    }
    /**
     * Whether to use the colors option to colorize the line
     */
    get useColors() {
        return this._useColors;
    }
    set useColors(value) {
        this._useColors = value;
        this.setFloat("grlUseColors", GreasedLineTools.BooleanToNumber(value));
    }
    /**
     * The type of sampling of the colors texture. The values are the same when using with textures.
     */
    get colorsSampling() {
        return this._colorsSampling;
    }
    /**
     * The type of sampling of the colors texture. The values are the same when using with textures.
     */
    set colorsSampling(value) {
        this._colorsSampling = value;
    }
    /**
     * Normalized value of how much of the line will be visible
     * 0 - 0% of the line will be visible
     * 1 - 100% of the line will be visible
     */
    get visibility() {
        return this._visibility;
    }
    set visibility(value) {
        this._visibility = value;
        this.setFloat("grlVisibility", value);
    }
    /**
     * Turns on/off dash mode
     */
    get useDash() {
        return this._useDash;
    }
    /**
     * Turns on/off dash mode
     */
    set useDash(value) {
        this._useDash = value;
        this.setFloat("grlUseDash", GreasedLineTools.BooleanToNumber(value));
    }
    /**
     * Gets the dash offset
     */
    get dashOffset() {
        return this._dashOffset;
    }
    /**
     * Sets the dash offset
     */
    set dashOffset(value) {
        this._dashOffset = value;
        this.setFloat("grlDashOffset", value);
    }
    /**
     * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.
     */
    get dashRatio() {
        return this._dashRatio;
    }
    /**
     * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.
     */
    set dashRatio(value) {
        this._dashRatio = value;
        this.setFloat("grlDashRatio", value);
    }
    /**
     * Gets the number of dashes in the line
     */
    get dashCount() {
        return this._dashCount;
    }
    /**
     * Sets the number of dashes in the line
     * @param value dash
     */
    set dashCount(value) {
        this._dashCount = value;
        this._dashArray = 1 / value;
        this.setFloat("grlDashArray", this._dashArray);
    }
    /**
     * False means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines
     */
    get sizeAttenuation() {
        return this._sizeAttenuation;
    }
    /**
     * Turn on/off attenuation of the width option and widths array.
     * @param value false means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines
     */
    set sizeAttenuation(value) {
        this._sizeAttenuation = value;
        this.setFloat("grlSizeAttenuation", GreasedLineTools.BooleanToNumber(value));
    }
    /**
     * Gets the color of the line
     */
    get color() {
        return this._color;
    }
    /**
     * Sets the color of the line
     * @param value Color3
     */
    set color(value) {
        this.setColor(value);
    }
    /**
     * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.
     * The simple material always needs a color to be set. If you set it to null it will set the color to the default color (GreasedLineSimpleMaterial.DEFAULT_COLOR).
     * @param value color
     */
    setColor(value) {
        value = value ?? GreasedLineMaterialDefaults.DEFAULT_COLOR;
        this._color = value;
        this.setColor3("grlColor", value);
    }
    /**
     * Gets the color distributiopn type
     */
    get colorsDistributionType() {
        return this._colorsDistributionType;
    }
    /**
     * Sets the color distribution type
     * @see GreasedLineMeshColorDistributionType
     * @param value color distribution type
     */
    set colorsDistributionType(value) {
        this._colorsDistributionType = value;
        this._setColorModeAndColorDistributionType();
    }
    /**
     * Gets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.
     * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.
     * @see GreasedLineMeshColorMode
     */
    get colorMode() {
        return this._colorMode;
    }
    /**
     * Sets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.
     * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.
     * @see GreasedLineMeshColorMode
     */
    set colorMode(value) {
        this._colorMode = value;
        this._setColorModeAndColorDistributionType();
    }
    /**
     * Gets the resolution
     */
    get resolution() {
        return this._resolution;
    }
    /**
     * Sets the resolution
     * @param value resolution of the screen for GreasedLine
     */
    set resolution(value) {
        this._resolution = value;
        this.setVector2("grlResolution", value);
        this.setFloat("grlAspect", value.x / value.y);
    }
    /**
     * Serializes this plugin material
     * @returns serializationObjec
     */
    serialize() {
        const serializationObject = super.serialize();
        const greasedLineMaterialOptions = {
            colorDistributionType: this._colorsDistributionType,
            colorsSampling: this._colorsSampling,
            colorMode: this._colorMode,
            color: this._color,
            dashCount: this._dashCount,
            dashOffset: this._dashOffset,
            dashRatio: this._dashRatio,
            resolution: this._resolution,
            sizeAttenuation: this._sizeAttenuation,
            useColors: this._useColors,
            useDash: this._useDash,
            visibility: this._visibility,
            width: this._width,
            cameraFacing: this._cameraFacing,
        };
        this._colors && (greasedLineMaterialOptions.colors = this._colors);
        serializationObject.greasedLineMaterialOptions = greasedLineMaterialOptions;
        return serializationObject;
    }
    /**
     * Parses a serialized objects
     * @param source serialized object
     * @param scene scene
     * @param _rootUrl root url for textures
     */
    parse(source, scene, _rootUrl) {
        // TODO: super.parse?
        const greasedLineMaterialOptions = source.greasedLineMaterialOptions;
        this._colorsTexture?.dispose();
        greasedLineMaterialOptions.color && (this.color = greasedLineMaterialOptions.color);
        greasedLineMaterialOptions.colorDistributionType && (this.colorsDistributionType = greasedLineMaterialOptions.colorDistributionType);
        greasedLineMaterialOptions.colorsSampling && (this.colorsSampling = greasedLineMaterialOptions.colorsSampling);
        greasedLineMaterialOptions.colorMode && (this.colorMode = greasedLineMaterialOptions.colorMode);
        greasedLineMaterialOptions.useColors && (this.useColors = greasedLineMaterialOptions.useColors);
        greasedLineMaterialOptions.visibility && (this.visibility = greasedLineMaterialOptions.visibility);
        greasedLineMaterialOptions.useDash && (this.useDash = greasedLineMaterialOptions.useDash);
        greasedLineMaterialOptions.dashCount && (this.dashCount = greasedLineMaterialOptions.dashCount);
        greasedLineMaterialOptions.dashRatio && (this.dashRatio = greasedLineMaterialOptions.dashRatio);
        greasedLineMaterialOptions.dashOffset && (this.dashOffset = greasedLineMaterialOptions.dashOffset);
        greasedLineMaterialOptions.width && (this.width = greasedLineMaterialOptions.width);
        greasedLineMaterialOptions.sizeAttenuation && (this.sizeAttenuation = greasedLineMaterialOptions.sizeAttenuation);
        greasedLineMaterialOptions.resolution && (this.resolution = greasedLineMaterialOptions.resolution);
        if (greasedLineMaterialOptions.colors) {
            this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, greasedLineMaterialOptions.colors, this.colorsSampling, this.getScene());
        }
        else {
            this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);
        }
        this._cameraFacing = greasedLineMaterialOptions.cameraFacing ?? true;
        this.setDefine("GREASED_LINE_CAMERA_FACING", this._cameraFacing);
    }
}
//# sourceMappingURL=greasedLineSimpleMaterial.js.map
;// ./node_modules/@babylonjs/core/Materials/GreasedLine/greasedLineMaterialInterfaces.js
/**
 * Material types for GreasedLine
 * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#materialtype}
 */
var GreasedLineMeshMaterialType;
(function (GreasedLineMeshMaterialType) {
    /**
     * StandardMaterial
     */
    GreasedLineMeshMaterialType[GreasedLineMeshMaterialType["MATERIAL_TYPE_STANDARD"] = 0] = "MATERIAL_TYPE_STANDARD";
    /**
     * PBR Material
     */
    GreasedLineMeshMaterialType[GreasedLineMeshMaterialType["MATERIAL_TYPE_PBR"] = 1] = "MATERIAL_TYPE_PBR";
    /**
     * Simple and fast shader material without texture, light, fog, instances, ... support.
     * Just raw colored lines.
     * Dashing and visibility is supported.
     */
    GreasedLineMeshMaterialType[GreasedLineMeshMaterialType["MATERIAL_TYPE_SIMPLE"] = 2] = "MATERIAL_TYPE_SIMPLE";
})(GreasedLineMeshMaterialType || (GreasedLineMeshMaterialType = {}));
/**
 * Color blending mode of the @see GreasedLineMaterial and the base material
 * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colormode}
 */
var GreasedLineMeshColorMode;
(function (GreasedLineMeshColorMode) {
    /**
     * Color blending mode SET
     */
    GreasedLineMeshColorMode[GreasedLineMeshColorMode["COLOR_MODE_SET"] = 0] = "COLOR_MODE_SET";
    /**
     * Color blending mode ADD
     */
    GreasedLineMeshColorMode[GreasedLineMeshColorMode["COLOR_MODE_ADD"] = 1] = "COLOR_MODE_ADD";
    /**
     * Color blending mode ADD
     */
    GreasedLineMeshColorMode[GreasedLineMeshColorMode["COLOR_MODE_MULTIPLY"] = 2] = "COLOR_MODE_MULTIPLY";
})(GreasedLineMeshColorMode || (GreasedLineMeshColorMode = {}));
/**
 * Color distribution type of the @see colors.
 * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colordistributiontype}
 *
 */
var GreasedLineMeshColorDistributionType;
(function (GreasedLineMeshColorDistributionType) {
    /**
     * Colors distributed between segments of the line
     */
    GreasedLineMeshColorDistributionType[GreasedLineMeshColorDistributionType["COLOR_DISTRIBUTION_TYPE_SEGMENT"] = 0] = "COLOR_DISTRIBUTION_TYPE_SEGMENT";
    /**
     * Colors distributed along the line ingoring the segments
     */
    GreasedLineMeshColorDistributionType[GreasedLineMeshColorDistributionType["COLOR_DISTRIBUTION_TYPE_LINE"] = 1] = "COLOR_DISTRIBUTION_TYPE_LINE";
})(GreasedLineMeshColorDistributionType || (GreasedLineMeshColorDistributionType = {}));
//# sourceMappingURL=greasedLineMaterialInterfaces.js.map
;// ./node_modules/@babylonjs/core/Materials/meshDebugPluginMaterial.js

/* eslint-disable @typescript-eslint/naming-convention */






const vertexDefinitions = `#if defined(DBG_ENABLED)
attribute float dbg_initialPass;
varying vec3 dbg_vBarycentric;
flat varying vec3 dbg_vVertexWorldPos;
flat varying float dbg_vPass;
#endif`;
const vertexDefinitionsWebGPU = `#if defined(DBG_ENABLED)
attribute dbg_initialPass: f32;
varying dbg_vBarycentric: vec3f;
varying dbg_vVertexWorldPos: vec3f;
varying dbg_vPass: f32;
#endif`;
const vertexMainEnd = `#if defined(DBG_ENABLED)
float dbg_vertexIndex = mod(float(gl_VertexID), 3.);
if (dbg_vertexIndex == 0.0) { 
    dbg_vBarycentric = vec3(1.,0.,0.); 
}
else if (dbg_vertexIndex == 1.0) { 
    dbg_vBarycentric = vec3(0.,1.,0.); 
}
else { 
    dbg_vBarycentric = vec3(0.,0.,1.); 
}

dbg_vVertexWorldPos = vPositionW;
dbg_vPass = dbg_initialPass;
#endif`;
const vertexMainEndWebGPU = `#if defined(DBG_ENABLED)
var dbg_vertexIndex = f32(input.vertexIndex) % 3.;
if (dbg_vertexIndex == 0.0) { 
    vertexOutputs.dbg_vBarycentric = vec3f(1.,0.,0.); 
}
else if (dbg_vertexIndex == 1.0) { 
    vertexOutputs.dbg_vBarycentric = vec3f(0.,1.,0.); 
}
else { 
    vertexOutputs.dbg_vBarycentric = vec3f(0.,0.,1.); 
}

vertexOutputs.dbg_vVertexWorldPos = vertexOutputs.vPositionW;
vertexOutputs.dbg_vPass = input.dbg_initialPass;
#endif`;
const fragmentUniforms = `#if defined(DBG_ENABLED)
uniform vec3 dbg_shadedDiffuseColor;
uniform vec4 dbg_shadedSpecularColorPower;
uniform vec3 dbg_thicknessRadiusScale;

#if DBG_MODE == 2 || DBG_MODE == 3
    uniform vec3 dbg_vertexColor;
#endif

#if DBG_MODE == 1
    uniform vec3 dbg_wireframeTrianglesColor;
#elif DBG_MODE == 3
    uniform vec3 dbg_wireframeVerticesColor;
#elif DBG_MODE == 4 || DBG_MODE == 5
    uniform vec3 dbg_uvPrimaryColor;
    uniform vec3 dbg_uvSecondaryColor;
#elif DBG_MODE == 7
    uniform vec3 dbg_materialColor;
#endif
#endif`;
const fragmentUniformsWebGPU = `#if defined(DBG_ENABLED)
uniform dbg_shadedDiffuseColor: vec3f;
uniform dbg_shadedSpecularColorPower: vec4f;
uniform dbg_thicknessRadiusScale: vec3f;

#if DBG_MODE == 2 || DBG_MODE == 3
    uniform dbg_vertexColor: vec3f;
#endif

#if DBG_MODE == 1
    uniform dbg_wireframeTrianglesColor: vec3f;
#elif DBG_MODE == 3
    uniform  dbg_wireframeVerticesColor: vec3f;
#elif DBG_MODE == 4 || DBG_MODE == 5
    uniform dbg_uvPrimaryColor: vec3f;
    uniform dbg_uvSecondaryColor: vec3f;
#elif DBG_MODE == 7
    uniform dbg_materialColor: vec3f;
#endif
#endif`;
const fragmentDefinitions = `#if defined(DBG_ENABLED)
varying vec3 dbg_vBarycentric;
flat varying vec3 dbg_vVertexWorldPos;
flat varying float dbg_vPass;

#if !defined(DBG_MULTIPLY)
    vec3 dbg_applyShading(vec3 color) {
        vec3 N = vNormalW.xyz;
        vec3 L = normalize(vEyePosition.xyz - vPositionW.xyz);
        vec3 H = normalize(L + L);
        float LdotN = clamp(dot(L,N), 0., 1.);
        float HdotN = clamp(dot(H,N), 0., 1.);
        float specTerm = pow(HdotN, dbg_shadedSpecularColorPower.w);
        color *= (LdotN / PI);
        color += dbg_shadedSpecularColorPower.rgb * (specTerm / PI);
        return color;
    }
#endif

#if DBG_MODE == 1 || DBG_MODE == 3
    float dbg_edgeFactor() {
        vec3 d = fwidth(dbg_vBarycentric);
        vec3 a3 = smoothstep(vec3(0.), d * dbg_thicknessRadiusScale.x, dbg_vBarycentric);
        return min(min(a3.x, a3.y), a3.z);
    }
#endif

#if DBG_MODE == 2 || DBG_MODE == 3
    float dbg_cornerFactor() {
        vec3 worldPos = vPositionW;
        float dist = length(worldPos - dbg_vVertexWorldPos);
        float camDist = length(worldPos - vEyePosition.xyz);
        float d = sqrt(camDist) * .001;
        return smoothstep((dbg_thicknessRadiusScale.y * d), ((dbg_thicknessRadiusScale.y * 1.01) * d), dist);
    }
#endif

#if (DBG_MODE == 4 && defined(UV1)) || (DBG_MODE == 5 && defined(UV2))
    float dbg_checkerboardFactor(vec2 uv) {
        vec2 f = fract(uv * dbg_thicknessRadiusScale.z);
        f -= .5;
        return (f.x * f.y) > 0. ? 1. : 0.;
    }
#endif
#endif`;
const fragmentDefinitionsWebGPU = `#if defined(DBG_ENABLED)
varying dbg_vBarycentric: vec3f;
varying dbg_vVertexWorldPos: vec3f;
varying dbg_vPass: f32;

#if !defined(DBG_MULTIPLY)
    fn dbg_applyShading(color: vec3f) -> vec3f {
        var N = fragmentInputs.vNormalW.xyz;
        var L = normalize(scene.vEyePosition.xyz - fragmentInputs.vPositionW.xyz);
        var H = normalize(L + L);
        var LdotN = clamp(dot(L,N), 0., 1.);
        var HdotN = clamp(dot(H,N), 0., 1.);
        var specTerm = pow(HdotN, uniforms.dbg_shadedSpecularColorPower.w);
        var result = color * (LdotN / PI);
        result += uniforms.dbg_shadedSpecularColorPower.rgb * (specTerm / PI);
        return result;
    }
#endif

#if DBG_MODE == 1 || DBG_MODE == 3
    fn dbg_edgeFactor() -> f32 {
        var d = fwidth(fragmentInputs.dbg_vBarycentric);
        var a3 = smoothstep(vec3f(0.), d * uniforms.dbg_thicknessRadiusScale.x, fragmentInputs.dbg_vBarycentric);
        return min(min(a3.x, a3.y), a3.z);
    }
#endif

#if DBG_MODE == 2 || DBG_MODE == 3
    fn dbg_cornerFactor() -> f32 {
        var worldPos = fragmentInputs.vPositionW;
        float dist = length(worldPos - fragmentInputs.dbg_vVertexWorldPos);
        float camDist = length(worldPos - scene.vEyePosition.xyz);
        float d = sqrt(camDist) * .001;
        return smoothstep((uniforms.dbg_thicknessRadiusScale.y * d), ((uniforms.dbg_thicknessRadiusScale.y * 1.01) * d), dist);
    }
#endif

#if (DBG_MODE == 4 && defined(UV1)) || (DBG_MODE == 5 && defined(UV2))
    fn dbg_checkerboardFactor(uv: vec2f) -> f32 {
        var f = fract(uv * uniforms.dbg_thicknessRadiusScale.z);
        f -= .5;
        return (f.x * f.y) > 0. ? 1. : 0.;
    }
#endif
#endif`;
const fragmentMainEnd = `#if defined(DBG_ENABLED)
vec3 dbg_color = vec3(1.);
#if DBG_MODE == 1
    dbg_color = mix(dbg_wireframeTrianglesColor, vec3(1.), dbg_edgeFactor());
#elif DBG_MODE == 2 || DBG_MODE == 3
    float dbg_cornerFactor = dbg_cornerFactor();
    if (dbg_vPass == 0. && dbg_cornerFactor == 1.) discard;
    dbg_color = mix(dbg_vertexColor, vec3(1.), dbg_cornerFactor);
    #if DBG_MODE == 3
        dbg_color *= mix(dbg_wireframeVerticesColor, vec3(1.), dbg_edgeFactor());
    #endif
#elif DBG_MODE == 4 && defined(MAINUV1)
    dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV1));
#elif DBG_MODE == 5 && defined(MAINUV2)
    dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV2));
#elif DBG_MODE == 6 && defined(VERTEXCOLOR)
    dbg_color = vColor.rgb;
#elif DBG_MODE == 7
    dbg_color = dbg_materialColor;
#endif

#if defined(DBG_MULTIPLY)
    gl_FragColor *= vec4(dbg_color, 1.);
#else
    #if DBG_MODE != 6
        gl_FragColor = vec4(dbg_applyShading(dbg_shadedDiffuseColor) * dbg_color, 1.);
    #else
        gl_FragColor = vec4(dbg_color, 1.);
    #endif
#endif
#endif`;
const fragmentMainEndWebGPU = `#if defined(DBG_ENABLED)
var dbg_color = vec3f(1.);
#if DBG_MODE == 1
    dbg_color = mix(uniforms.dbg_wireframeTrianglesColor, vec3f(1.), dbg_edgeFactor());
#elif DBG_MODE == 2 || DBG_MODE == 3
    var dbg_cornerFactor = dbg_cornerFactor();
    if (fragmentInputs.dbg_vPass == 0. && dbg_cornerFactor == 1.) discard;
    dbg_color = mix(uniforms.dbg_vertexColor, vec3(1.), dbg_cornerFactor);
    #if DBG_MODE == 3
        dbg_color *= mix(uniforms.dbg_wireframeVerticesColor, vec3f(1.), dbg_edgeFactor());
    #endif
#elif DBG_MODE == 4 && defined(MAINUV1)
    dbg_color = mix(uniforms.dbg_uvPrimaryColor, uniforms.dbg_uvSecondaryColor, dbg_checkerboardFactor(fragmentInputs.vMainUV1));
#elif DBG_MODE == 5 && defined(MAINUV2)
    dbg_color = mix(uniforms.dbg_uvPrimaryColor, uniforms.dbg_uvSecondaryColor, dbg_checkerboardFactor(fragmentInputs.vMainUV2));
#elif DBG_MODE == 6 && defined(VERTEXCOLOR)
    dbg_color = fragmentInputs.vColor.rgb;
#elif DBG_MODE == 7
    dbg_color = uniforms.dbg_materialColor;
#endif

#if defined(DBG_MULTIPLY)
    fragmentOutputs.color *= vec4f(dbg_color, 1.);
#else
    #if DBG_MODE != 6
        fragmentOutputs.color = vec4f(dbg_applyShading(dbg_shadedDiffuseColor) * dbg_color, 1.);
    #else
        fragmentOutputs.color = vec4f(dbg_color, 1.);
    #endif
#endif
#endif`;
const defaultMaterialColors = [
    new math/* Color3 */.v9(0.98, 0.26, 0.38),
    new math/* Color3 */.v9(0.47, 0.75, 0.3),
    new math/* Color3 */.v9(0, 0.26, 0.77),
    new math/* Color3 */.v9(0.97, 0.6, 0.76),
    new math/* Color3 */.v9(0.19, 0.63, 0.78),
    new math/* Color3 */.v9(0.98, 0.8, 0.6),
    new math/* Color3 */.v9(0.65, 0.43, 0.15),
    new math/* Color3 */.v9(0.15, 0.47, 0.22),
    new math/* Color3 */.v9(0.67, 0.71, 0.86),
    new math/* Color3 */.v9(0.09, 0.46, 0.56),
    new math/* Color3 */.v9(0.8, 0.98, 0.02),
    new math/* Color3 */.v9(0.39, 0.29, 0.13),
    new math/* Color3 */.v9(0.53, 0.63, 0.06),
    new math/* Color3 */.v9(0.95, 0.96, 0.41),
    new math/* Color3 */.v9(1, 0.72, 0.94),
    new math/* Color3 */.v9(0.63, 0.08, 0.31),
    new math/* Color3 */.v9(0.66, 0.96, 0.95),
    new math/* Color3 */.v9(0.22, 0.14, 0.19),
    new math/* Color3 */.v9(0.14, 0.65, 0.59),
    new math/* Color3 */.v9(0.93, 1, 0.68),
    new math/* Color3 */.v9(0.93, 0.14, 0.44),
    new math/* Color3 */.v9(0.47, 0.86, 0.67),
    new math/* Color3 */.v9(0.85, 0.07, 0.78),
    new math/* Color3 */.v9(0.53, 0.64, 0.98),
    new math/* Color3 */.v9(0.43, 0.37, 0.56),
    new math/* Color3 */.v9(0.71, 0.65, 0.25),
    new math/* Color3 */.v9(0.66, 0.19, 0.01),
    new math/* Color3 */.v9(0.94, 0.53, 0.12),
    new math/* Color3 */.v9(0.41, 0.44, 0.44),
    new math/* Color3 */.v9(0.24, 0.71, 0.96),
    new math/* Color3 */.v9(0.57, 0.28, 0.56),
    new math/* Color3 */.v9(0.44, 0.98, 0.42),
];
/**
 * Supported visualizations of MeshDebugPluginMaterial
 */
var MeshDebugMode;
(function (MeshDebugMode) {
    /**
     * Material without any mesh debug visualization
     */
    MeshDebugMode[MeshDebugMode["NONE"] = 0] = "NONE";
    /**
     * A wireframe of the mesh
     * NOTE: For this mode to work correctly, convertToUnIndexedMesh() or MeshDebugPluginMaterial.PrepareMeshForTrianglesAndVerticesMode() must first be called on mesh.
     */
    MeshDebugMode[MeshDebugMode["TRIANGLES"] = 1] = "TRIANGLES";
    /**
     * Points drawn over vertices of mesh
     * NOTE: For this mode to work correctly, MeshDebugPluginMaterial.PrepareMeshForTrianglesAndVerticesMode() must first be called on mesh.
     */
    MeshDebugMode[MeshDebugMode["VERTICES"] = 2] = "VERTICES";
    /**
     * A wireframe of the mesh, with points drawn over vertices
     * NOTE: For this mode to work correctly, MeshDebugPluginMaterial.PrepareMeshForTrianglesAndVerticesMode() must first be called on mesh.
     */
    MeshDebugMode[MeshDebugMode["TRIANGLES_VERTICES"] = 3] = "TRIANGLES_VERTICES";
    /**
     * A checkerboard grid of the mesh's UV set 0
     */
    MeshDebugMode[MeshDebugMode["UV0"] = 4] = "UV0";
    /**
     * A checkerboard grid of the mesh's UV set 1
     */
    MeshDebugMode[MeshDebugMode["UV1"] = 5] = "UV1";
    /**
     * The mesh's vertex colors displayed as the primary texture
     */
    MeshDebugMode[MeshDebugMode["VERTEXCOLORS"] = 6] = "VERTEXCOLORS";
    /**
     * An arbitrary, distinguishable color to identify the material
     */
    MeshDebugMode[MeshDebugMode["MATERIALIDS"] = 7] = "MATERIALIDS";
})(MeshDebugMode || (MeshDebugMode = {}));
/** @internal */
class MeshDebugDefines extends materialDefines/* MaterialDefines */.M {
    constructor() {
        super(...arguments);
        /**
         * Current mesh debug visualization.
         * Defaults to NONE.
         */
        this.DBG_MODE = 0 /* MeshDebugMode.NONE */;
        /**
         * Whether the mesh debug visualization multiplies with colors underneath.
         * Defaults to true.
         */
        this.DBG_MULTIPLY = true;
        /**
         * Whether the mesh debug plugin is enabled in the material.
         * Defaults to true.
         */
        this.DBG_ENABLED = true;
    }
}
/**
 * Plugin that implements various mesh debug visualizations,
 * List of available visualizations can be found in MeshDebugMode enum.
 */
class MeshDebugPluginMaterial extends materialPluginBase/* MaterialPluginBase */.y {
    /** @internal */
    _markAllDefinesAsDirty() {
        this._enable(this._isEnabled);
        this.markAllDefinesAsDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a given shader language.
     * @param shaderLanguage The shader language to use.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible(shaderLanguage) {
        switch (shaderLanguage) {
            case 0 /* ShaderLanguage.GLSL */:
            case 1 /* ShaderLanguage.WGSL */:
                return true;
            default:
                return false;
        }
    }
    /**
     * Creates a new MeshDebugPluginMaterial
     * @param material Material to attach the mesh debug plugin to
     * @param options Options for the mesh debug plugin
     */
    constructor(material, options = {}) {
        const defines = new MeshDebugDefines();
        defines.DBG_MODE = options.mode ?? defines.DBG_MODE;
        defines.DBG_MULTIPLY = options.multiply ?? defines.DBG_MULTIPLY;
        super(material, "MeshDebug", 200, defines, true, true);
        this._mode = defines.DBG_MODE;
        this._multiply = defines.DBG_MULTIPLY;
        this.shadedDiffuseColor = options.shadedDiffuseColor ?? new math/* Color3 */.v9(1, 1, 1);
        this.shadedSpecularColor = options.shadedSpecularColor ?? new math/* Color3 */.v9(0.8, 0.8, 0.8);
        this.shadedSpecularPower = options.shadedSpecularPower ?? 10;
        this.wireframeThickness = options.wireframeThickness ?? 0.7;
        this.wireframeTrianglesColor = options.wireframeTrianglesColor ?? new math/* Color3 */.v9(0, 0, 0);
        this.wireframeVerticesColor = options.wireframeVerticesColor ?? new math/* Color3 */.v9(0.8, 0.8, 0.8);
        this.vertexColor = options.vertexColor ?? new math/* Color3 */.v9(0, 0, 0);
        this.vertexRadius = options.vertexRadius ?? 1.2;
        this.uvScale = options.uvScale ?? 20;
        this.uvPrimaryColor = options.uvPrimaryColor ?? new math/* Color3 */.v9(1, 1, 1);
        this.uvSecondaryColor = options.uvSecondaryColor ?? new math/* Color3 */.v9(0.5, 0.5, 0.5);
        this._materialColor = MeshDebugPluginMaterial.MaterialColors[MeshDebugPluginMaterial._PluginCount++ % MeshDebugPluginMaterial.MaterialColors.length];
        this.isEnabled = true;
    }
    /**
     * Get the class name
     * @returns Class name
     */
    getClassName() {
        return "MeshDebugPluginMaterial";
    }
    /**
     * Gets whether the mesh debug plugin is enabled in the material.
     */
    get isEnabled() {
        return this._isEnabled;
    }
    /**
     * Sets whether the mesh debug plugin is enabled in the material.
     * @param value enabled
     */
    set isEnabled(value) {
        if (this._isEnabled === value) {
            return;
        }
        if (!this._material.getScene().getEngine().isWebGPU && this._material.getScene().getEngine().version == 1) {
            logger/* Logger */.V.Error("MeshDebugPluginMaterial is not supported on WebGL 1.0.");
            this._isEnabled = false;
            return;
        }
        this._isEnabled = value;
        this._markAllDefinesAsDirty();
    }
    /**
     * Prepare the defines
     * @param defines Mesh debug defines
     * @param scene Scene
     * @param mesh Mesh associated with material
     */
    prepareDefines(defines, scene, mesh) {
        if ((this._mode == 2 /* MeshDebugMode.VERTICES */ || this._mode == 1 /* MeshDebugMode.TRIANGLES */ || this._mode == 3 /* MeshDebugMode.TRIANGLES_VERTICES */) &&
            !mesh.isVerticesDataPresent("dbg_initialPass")) {
            logger/* Logger */.V.Warn("For best results with TRIANGLES, TRIANGLES_VERTICES, or VERTICES modes, please use MeshDebugPluginMaterial.PrepareMeshForTrianglesAndVerticesMode() on mesh.", 1);
        }
        defines.DBG_MODE = this._mode;
        defines.DBG_MULTIPLY = this._multiply;
        defines.DBG_ENABLED = this._isEnabled;
    }
    /**
     * Get the shader attributes
     * @param attributes Array of attributes
     */
    getAttributes(attributes) {
        attributes.push("dbg_initialPass");
    }
    /**
     * Get the shader uniforms
     * @param shaderLanguage The shader language to use.
     * @returns Uniforms
     */
    getUniforms(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        return {
            ubo: [
                { name: "dbg_shadedDiffuseColor", size: 3, type: "vec3" },
                { name: "dbg_shadedSpecularColorPower", size: 4, type: "vec4" }, // shadedSpecularColor, shadedSpecularPower
                { name: "dbg_thicknessRadiusScale", size: 3, type: "vec3" }, // wireframeThickness, vertexRadius, uvScale
                { name: "dbg_wireframeTrianglesColor", size: 3, type: "vec3" },
                { name: "dbg_wireframeVerticesColor", size: 3, type: "vec3" },
                { name: "dbg_vertexColor", size: 3, type: "vec3" },
                { name: "dbg_uvPrimaryColor", size: 3, type: "vec3" },
                { name: "dbg_uvSecondaryColor", size: 3, type: "vec3" },
                { name: "dbg_materialColor", size: 3, type: "vec3" },
            ],
            fragment: shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? fragmentUniforms : fragmentUniformsWebGPU,
        };
    }
    /**
     * Bind the uniform buffer
     * @param uniformBuffer Uniform buffer
     */
    bindForSubMesh(uniformBuffer) {
        if (!this._isEnabled) {
            return;
        }
        uniformBuffer.updateFloat3("dbg_shadedDiffuseColor", this.shadedDiffuseColor.r, this.shadedDiffuseColor.g, this.shadedDiffuseColor.b);
        uniformBuffer.updateFloat4("dbg_shadedSpecularColorPower", this.shadedSpecularColor.r, this.shadedSpecularColor.g, this.shadedSpecularColor.b, this.shadedSpecularPower);
        uniformBuffer.updateFloat3("dbg_thicknessRadiusScale", this.wireframeThickness, this.vertexRadius, this.uvScale);
        uniformBuffer.updateColor3("dbg_wireframeTrianglesColor", this.wireframeTrianglesColor);
        uniformBuffer.updateColor3("dbg_wireframeVerticesColor", this.wireframeVerticesColor);
        uniformBuffer.updateColor3("dbg_vertexColor", this.vertexColor);
        uniformBuffer.updateColor3("dbg_uvPrimaryColor", this.uvPrimaryColor);
        uniformBuffer.updateColor3("dbg_uvSecondaryColor", this.uvSecondaryColor);
        uniformBuffer.updateColor3("dbg_materialColor", this._materialColor);
    }
    /**
     * Get shader code
     * @param shaderType "vertex" or "fragment"
     * @param shaderLanguage The shader language to use.
     * @returns Shader code
     */
    getCustomCode(shaderType, shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return shaderType === "vertex"
                ? {
                    CUSTOM_VERTEX_DEFINITIONS: vertexDefinitionsWebGPU,
                    CUSTOM_VERTEX_MAIN_END: vertexMainEndWebGPU,
                }
                : {
                    CUSTOM_FRAGMENT_DEFINITIONS: fragmentDefinitionsWebGPU,
                    CUSTOM_FRAGMENT_MAIN_END: fragmentMainEndWebGPU,
                };
        }
        return shaderType === "vertex"
            ? {
                CUSTOM_VERTEX_DEFINITIONS: vertexDefinitions,
                CUSTOM_VERTEX_MAIN_END: vertexMainEnd,
            }
            : {
                CUSTOM_FRAGMENT_DEFINITIONS: fragmentDefinitions,
                CUSTOM_FRAGMENT_MAIN_END: fragmentMainEnd,
            };
    }
    /**
     * Resets static variables of the plugin to their original state
     */
    static Reset() {
        this._PluginCount = 0;
        this.MaterialColors = defaultMaterialColors;
    }
    /**
     * Renders triangles in a mesh 3 times by tripling the indices in the index buffer.
     * Used to prepare a mesh to be rendered in `TRIANGLES`, `VERTICES`, or `TRIANGLES_VERTICES` modes.
     * NOTE: This is a destructive operation. The mesh's index buffer and vertex buffers are modified, and a new vertex buffer is allocated.
     * If you'd like the ability to revert these changes, toggle the optional `returnRollback` flag.
     * @param mesh the mesh to target
     * @param returnRollback whether or not to return a function that reverts mesh to its initial state. Default: false.
     * @returns a rollback function if `returnRollback` is true, otherwise an empty function.
     */
    static PrepareMeshForTrianglesAndVerticesMode(mesh, returnRollback = false) {
        let rollback = () => { };
        if (mesh.getTotalIndices() == 0)
            return rollback;
        if (returnRollback) {
            const kinds = mesh.getVerticesDataKinds();
            const indices = mesh.getIndices();
            const data = {};
            for (const kind of kinds) {
                data[kind] = mesh.getVerticesData(kind);
            }
            rollback = function () {
                mesh.setIndices(indices);
                for (const kind of kinds) {
                    const stride = mesh.getVertexBuffer(kind).getStrideSize();
                    mesh.setVerticesData(kind, data[kind], undefined, stride);
                }
                mesh.removeVerticesData("dbg_initialPass");
            };
        }
        let indices = Array.from(mesh.getIndices());
        const newIndices1 = [];
        for (let i = 0; i < indices.length; i += 3) {
            newIndices1.push(indices[i + 1], indices[i + 2], indices[i + 0]);
        }
        mesh.setIndices(indices.concat(newIndices1));
        mesh.convertToUnIndexedMesh();
        mesh.isUnIndexed = false;
        indices = Array.from(mesh.getIndices());
        const newIndices2 = [];
        for (let i = indices.length / 2; i < indices.length; i += 3) {
            newIndices2.push(indices[i + 1], indices[i + 2], indices[i + 0]);
        }
        mesh.setIndices(indices.concat(newIndices2));
        const num = mesh.getTotalVertices();
        const mid = num / 2;
        const pass = new Array(num).fill(1, 0, mid).fill(0, mid, num);
        mesh.setVerticesData("dbg_initialPass", pass, false, 1);
        return rollback;
    }
}
/**
 * Total number of instances of the plugin.
 * Starts at 0.
 */
MeshDebugPluginMaterial._PluginCount = 0;
/**
 * Color palette used for MATERIALIDS mode.
 * Defaults to `defaultMaterialColors`
 */
MeshDebugPluginMaterial.MaterialColors = defaultMaterialColors;
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], MeshDebugPluginMaterial.prototype, "_materialColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MeshDebugPluginMaterial.prototype, "_isEnabled", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllDefinesAsDirty")
], MeshDebugPluginMaterial.prototype, "mode", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllDefinesAsDirty")
], MeshDebugPluginMaterial.prototype, "multiply", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], MeshDebugPluginMaterial.prototype, "shadedDiffuseColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], MeshDebugPluginMaterial.prototype, "shadedSpecularColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MeshDebugPluginMaterial.prototype, "shadedSpecularPower", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MeshDebugPluginMaterial.prototype, "wireframeThickness", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], MeshDebugPluginMaterial.prototype, "wireframeTrianglesColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], MeshDebugPluginMaterial.prototype, "wireframeVerticesColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], MeshDebugPluginMaterial.prototype, "vertexColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MeshDebugPluginMaterial.prototype, "vertexRadius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MeshDebugPluginMaterial.prototype, "uvScale", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], MeshDebugPluginMaterial.prototype, "uvPrimaryColor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsColor3 */.jT)()
], MeshDebugPluginMaterial.prototype, "uvSecondaryColor", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MeshDebugPluginMaterial", MeshDebugPluginMaterial);
//# sourceMappingURL=meshDebugPluginMaterial.js.map
;// ./node_modules/@babylonjs/core/Materials/standardMaterial.decalMap.js


Object.defineProperty(standardMaterial/* StandardMaterial */.F.prototype, "decalMap", {
    get: function () {
        if (!this._decalMap) {
            if (this._uniformBufferLayoutBuilt) {
                // Material already used to display a mesh, so it's invalid to add the decal map plugin at that point
                // Returns null instead of having new DecalMapConfiguration throws an exception
                return null;
            }
            this._decalMap = new DecalMapConfiguration(this);
        }
        return this._decalMap;
    },
    enumerable: true,
    configurable: true,
});
//# sourceMappingURL=standardMaterial.decalMap.js.map
;// ./node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.decalMap.js


Object.defineProperty(pbrBaseMaterial/* PBRBaseMaterial */.d.prototype, "decalMap", {
    get: function () {
        if (!this._decalMap) {
            if (this._uniformBufferLayoutBuilt) {
                // Material already used to display a mesh, so it's invalid to add the decal map plugin at that point
                // Returns null instead of having new DecalMapConfiguration throws an exception
                return null;
            }
            this._decalMap = new DecalMapConfiguration(this);
        }
        return this._decalMap;
    },
    enumerable: true,
    configurable: true,
});
//# sourceMappingURL=pbrMaterial.decalMap.js.map
;// ./node_modules/@babylonjs/core/Meshes/abstractMesh.decalMap.js

Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "decalMap", {
    get: function () {
        return this._decalMap;
    },
    set: function (decalMap) {
        this._decalMap = decalMap;
    },
    enumerable: true,
    configurable: true,
});
//# sourceMappingURL=abstractMesh.decalMap.js.map
;// ./node_modules/@babylonjs/core/Materials/material.decalMap.js



//# sourceMappingURL=material.decalMap.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/default.fragment.js + 1 modules
var default_fragment = __webpack_require__(42319);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/default.vertex.js + 1 modules
var default_vertex = __webpack_require__(14268);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/default.fragment.js
var ShadersWGSL_default_fragment = __webpack_require__(45791);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/default.vertex.js + 1 modules
var ShadersWGSL_default_vertex = __webpack_require__(59235);
;// ./node_modules/@babylonjs/core/Materials/index.js
/* eslint-disable import/no-internal-modules */









































// async-loaded shaders
// StandardMaterial




//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.scalar.js
var math_scalar = __webpack_require__(62128);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.functions.js
var math_functions = __webpack_require__(71139);
;// ./node_modules/@babylonjs/core/Maths/math.polar.js

/**
 * Class used to store (r, theta) vector representation
 */
class Polar {
    /**
     * Creates a new Polar object
     * @param radius the radius of the vector
     * @param theta the angle of the vector
     */
    constructor(radius, theta) {
        this.radius = radius;
        this.theta = theta;
        this.radius = radius;
        this.theta = theta;
    }
    /**
     * Gets the class name
     * @returns the string "Polar"
     */
    getClassName() {
        return "Polar";
    }
    /**
     * Converts the current polar to a string
     * @returns the current polar as a string
     */
    toString() {
        return JSON.stringify(this);
    }
    /**
     * Converts the current polar to an array
     * @returns the current polar as an array
     */
    asArray() {
        return [this.radius, this.theta];
    }
    /**
     * Adds the current Polar and the given Polar and stores the result
     * @param polar the polar to add
     * @param ref the polar to store the result in
     * @returns the updated ref
     */
    addToRef(polar, ref) {
        ref.radius = this.radius + polar.radius;
        ref.theta = this.theta + polar.theta;
        return ref;
    }
    /**
     * Adds the current Polar and the given Polar
     * @param polar the polar to add
     * @returns the sum polar
     */
    add(polar) {
        const ref = new Polar(0, 0);
        this.addToRef(polar, ref);
        return ref;
    }
    /**
     * Adds the given polar to the current polar
     * @param polar the polar to add
     * @returns the current polar
     */
    addInPlace(polar) {
        this.addToRef(polar, this);
        return this;
    }
    /**
     * Adds the provided values to the current polar
     * @param radius the amount to add to the radius
     * @param theta the amount to add to the theta
     * @returns the current polar
     */
    addInPlaceFromFloats(radius, theta) {
        this.radius += radius;
        this.theta += theta;
        return this;
    }
    /**
     * Subtracts the given Polar from the current Polar and stores the result
     * @param polar the polar to subtract
     * @param ref the polar to store the result in
     * @returns the updated ref
     */
    subtractToRef(polar, ref) {
        ref.radius = this.radius - polar.radius;
        ref.theta = this.theta - polar.theta;
        return ref;
    }
    /**
     * Subtracts the given Polar from the current Polar
     * @param polar the polar to subtract
     * @returns the difference polar
     */
    subtract(polar) {
        const ref = new Polar(0, 0);
        this.subtractToRef(polar, ref);
        return ref;
    }
    /**
     * Subtracts the given Polar from the current Polar
     * @param polar the polar to subtract
     * @returns the current polar
     */
    subtractInPlace(polar) {
        this.subtractToRef(polar, this);
        return this;
    }
    /**
     * Subtracts the given floats from the current polar
     * @param radius the amount to subtract from the radius
     * @param theta the amount to subtract from the theta
     * @param ref the polar to store the result in
     * @returns the updated ref
     */
    subtractFromFloatsToRef(radius, theta, ref) {
        ref.radius = this.radius - radius;
        ref.theta = this.theta - theta;
        return ref;
    }
    /**
     * Subtracts the given floats from the current polar
     * @param radius the amount to subtract from the radius
     * @param theta the amount to subtract from the theta
     * @returns the difference polar
     */
    subtractFromFloats(radius, theta) {
        const ref = new Polar(0, 0);
        this.subtractFromFloatsToRef(radius, theta, ref);
        return ref;
    }
    /**
     * Multiplies the given Polar with the current Polar and stores the result
     * @param polar the polar to multiply
     * @param ref the polar to store the result in
     * @returns the updated ref
     */
    multiplyToRef(polar, ref) {
        ref.radius = this.radius * polar.radius;
        ref.theta = this.theta * polar.theta;
        return ref;
    }
    /**
     * Multiplies the given Polar with the current Polar
     * @param polar the polar to multiply
     * @returns the product polar
     */
    multiply(polar) {
        const ref = new Polar(0, 0);
        this.multiplyToRef(polar, ref);
        return ref;
    }
    /**
     * Multiplies the given Polar with the current Polar
     * @param polar the polar to multiply
     * @returns the current polar
     */
    multiplyInPlace(polar) {
        this.multiplyToRef(polar, this);
        return this;
    }
    /**
     * Divides the current Polar by the given Polar and stores the result
     * @param polar the polar to divide
     * @param ref the polar to store the result in
     * @returns the updated ref
     */
    divideToRef(polar, ref) {
        ref.radius = this.radius / polar.radius;
        ref.theta = this.theta / polar.theta;
        return ref;
    }
    /**
     * Divides the current Polar by the given Polar
     * @param polar the polar to divide
     * @returns the quotient polar
     */
    divide(polar) {
        const ref = new Polar(0, 0);
        this.divideToRef(polar, ref);
        return ref;
    }
    /**
     * Divides the current Polar by the given Polar
     * @param polar the polar to divide
     * @returns the current polar
     */
    divideInPlace(polar) {
        this.divideToRef(polar, this);
        return this;
    }
    /**
     * Clones the current polar
     * @returns a clone of the current polar
     */
    clone() {
        return new Polar(this.radius, this.theta);
    }
    /**
     * Copies the source polar into the current polar
     * @param source the polar to copy from
     * @returns the current polar
     */
    copyFrom(source) {
        this.radius = source.radius;
        this.theta = source.theta;
        return this;
    }
    /**
     * Copies the given values into the current polar
     * @param radius the radius to use
     * @param theta the theta to use
     * @returns the current polar
     */
    copyFromFloats(radius, theta) {
        this.radius = radius;
        this.theta = theta;
        return this;
    }
    /**
     * Scales the current polar and stores the result
     * @param scale defines the multiplication factor
     * @param ref where to store the result
     * @returns the updated ref
     */
    scaleToRef(scale, ref) {
        ref.radius = this.radius * scale;
        ref.theta = this.theta * scale;
        return ref;
    }
    /**
     * Scales the current polar and returns a new polar with the scaled coordinates
     * @param scale defines the multiplication factor
     * @returns the scaled polar
     */
    scale(scale) {
        const ref = new Polar(0, 0);
        this.scaleToRef(scale, ref);
        return ref;
    }
    /**
     * Scales the current polar
     * @param scale defines the multiplication factor
     * @returns the current polar
     */
    scaleInPlace(scale) {
        this.scaleToRef(scale, this);
        return this;
    }
    /**
     * Sets the values of the current polar
     * @param radius the new radius
     * @param theta the new theta
     * @returns the current polar
     */
    set(radius, theta) {
        this.radius = radius;
        this.theta = theta;
        return this;
    }
    /**
     * Sets the values of the current polar
     * @param value the new values
     * @returns the current polar
     */
    setAll(value) {
        this.set(value, value);
        return this;
    }
    /**
     * Gets the rectangular coordinates of the current Polar
     * @param ref the reference to assign the result
     * @returns the updated reference
     */
    toVector2ToRef(ref) {
        const x = this.radius * Math.cos(this.theta);
        const y = this.radius * Math.sin(this.theta);
        ref.set(x, y);
        return ref;
    }
    /**
     * Gets the rectangular coordinates of the current Polar
     * @returns the rectangular coordinates
     */
    toVector2() {
        const ref = new math_vector/* Vector2 */.I9(0, 0);
        return this.toVector2ToRef(ref);
    }
    /**
     * Converts a given Vector2 to its polar coordinates
     * @param v the Vector2 to convert
     * @param ref the reference to assign the result
     * @returns the updated reference
     */
    static FromVector2ToRef(v, ref) {
        const theta = Math.sign(v.y) * Math.acos(v.x / v.length());
        ref.radius = v.length();
        ref.theta = theta;
        return ref;
    }
    /**
     * Converts a given Vector2 to its polar coordinates
     * @param v the Vector2 to convert
     * @returns a Polar
     */
    static FromVector2(v) {
        const polar = new Polar(0, 0);
        Polar.FromVector2ToRef(v, polar);
        return polar;
    }
    /**
     * Converts an array of floats to a polar
     * @param array the array to convert
     * @returns the converted polar
     */
    static FromArray(array) {
        return new Polar(array[0], array[1]);
    }
}
/**
 * Class used for (radius, theta, phi) vector representation.
 */
class Spherical {
    /**
     * Creates a new Spherical object from the given spherical coordinates
     * @param radius spherical radius
     * @param theta angle from positive y axis to radial line from 0 to PI (vertical)
     * @param phi angle from positive x axis measured anticlockwise from -PI to PI (horizontal)
     */
    constructor(radius, theta, phi) {
        this.radius = radius;
        this.theta = theta;
        this.phi = phi;
        this.radius = radius;
        this.theta = theta;
        this.phi = phi;
    }
    /**
     * Gets the class name
     * @returns the string "Spherical"
     */
    getClassName() {
        return "Spherical";
    }
    /**
     * Converts the current spherical to a string
     * @returns the current spherical as a string
     */
    toString() {
        return JSON.stringify(this);
    }
    /**
     * Converts the current spherical to an array
     * @returns the current spherical as an array
     */
    asArray() {
        return [this.radius, this.theta, this.phi];
    }
    /**
     * Adds the current Spherical and the given Spherical and stores the result
     * @param spherical the spherical to add
     * @param ref the spherical to store the result in
     * @returns the updated ref
     */
    addToRef(spherical, ref) {
        ref.radius = this.radius + spherical.radius;
        ref.theta = this.theta + spherical.theta;
        ref.phi = this.phi + spherical.phi;
        return ref;
    }
    /**
     * Adds the current Spherical and the given Spherical
     * @param spherical the spherical to add
     * @returns the sum spherical
     */
    add(spherical) {
        const ref = new Spherical(0, 0, 0);
        this.addToRef(spherical, ref);
        return ref;
    }
    /**
     * Adds the given spherical to the current spherical
     * @param spherical the spherical to add
     * @returns the current spherical
     */
    addInPlace(spherical) {
        this.addToRef(spherical, this);
        return this;
    }
    /**
     * Adds the provided values to the current spherical
     * @param radius the amount to add to the radius
     * @param theta the amount to add to the theta
     * @param phi the amount to add to the phi
     * @returns the current spherical
     */
    addInPlaceFromFloats(radius, theta, phi) {
        this.radius += radius;
        this.theta += theta;
        this.phi += phi;
        return this;
    }
    /**
     * Subtracts the given Spherical from the current Spherical and stores the result
     * @param spherical the spherical to subtract
     * @param ref the spherical to store the result in
     * @returns the updated ref
     */
    subtractToRef(spherical, ref) {
        ref.radius = this.radius - spherical.radius;
        ref.theta = this.theta - spherical.theta;
        ref.phi = this.phi - spherical.phi;
        return ref;
    }
    /**
     * Subtracts the given Spherical from the current Spherical
     * @param spherical the spherical to subtract
     * @returns the difference spherical
     */
    subtract(spherical) {
        const ref = new Spherical(0, 0, 0);
        this.subtractToRef(spherical, ref);
        return ref;
    }
    /**
     * Subtracts the given Spherical from the current Spherical
     * @param spherical the spherical to subtract
     * @returns the current spherical
     */
    subtractInPlace(spherical) {
        this.subtractToRef(spherical, this);
        return this;
    }
    /**
     * Subtracts the given floats from the current spherical
     * @param radius the amount to subtract from the radius
     * @param theta the amount to subtract from the theta
     * @param phi the amount to subtract from the phi
     * @param ref the spherical to store the result in
     * @returns the updated ref
     */
    subtractFromFloatsToRef(radius, theta, phi, ref) {
        ref.radius = this.radius - radius;
        ref.theta = this.theta - theta;
        ref.phi = this.phi - phi;
        return ref;
    }
    /**
     * Subtracts the given floats from the current spherical
     * @param radius the amount to subtract from the radius
     * @param theta the amount to subtract from the theta
     * @param phi the amount to subtract from the phi
     * @returns the difference spherical
     */
    subtractFromFloats(radius, theta, phi) {
        const ref = new Spherical(0, 0, 0);
        this.subtractFromFloatsToRef(radius, theta, phi, ref);
        return ref;
    }
    /**
     * Multiplies the given Spherical with the current Spherical and stores the result
     * @param spherical the spherical to multiply
     * @param ref the spherical to store the result in
     * @returns the updated ref
     */
    multiplyToRef(spherical, ref) {
        ref.radius = this.radius * spherical.radius;
        ref.theta = this.theta * spherical.theta;
        ref.phi = this.phi * spherical.phi;
        return ref;
    }
    /**
     * Multiplies the given Spherical with the current Spherical
     * @param spherical the spherical to multiply
     * @returns the product spherical
     */
    multiply(spherical) {
        const ref = new Spherical(0, 0, 0);
        this.multiplyToRef(spherical, ref);
        return ref;
    }
    /**
     * Multiplies the given Spherical with the current Spherical
     * @param spherical the spherical to multiply
     * @returns the current spherical
     */
    multiplyInPlace(spherical) {
        this.multiplyToRef(spherical, this);
        return this;
    }
    /**
     * Divides the current Spherical by the given Spherical and stores the result
     * @param spherical the spherical to divide
     * @param ref the spherical to store the result in
     * @returns the updated ref
     */
    divideToRef(spherical, ref) {
        ref.radius = this.radius / spherical.radius;
        ref.theta = this.theta / spherical.theta;
        ref.phi = this.phi / spherical.phi;
        return ref;
    }
    /**
     * Divides the current Spherical by the given Spherical
     * @param spherical the spherical to divide
     * @returns the quotient spherical
     */
    divide(spherical) {
        const ref = new Spherical(0, 0, 0);
        this.divideToRef(spherical, ref);
        return ref;
    }
    /**
     * Divides the current Spherical by the given Spherical
     * @param spherical the spherical to divide
     * @returns the current spherical
     */
    divideInPlace(spherical) {
        this.divideToRef(spherical, this);
        return this;
    }
    /**
     * Clones the current spherical
     * @returns a clone of the current spherical
     */
    clone() {
        return new Spherical(this.radius, this.theta, this.phi);
    }
    /**
     * Copies the source spherical into the current spherical
     * @param source the spherical to copy from
     * @returns the current spherical
     */
    copyFrom(source) {
        this.radius = source.radius;
        this.theta = source.theta;
        this.phi = source.phi;
        return this;
    }
    /**
     * Copies the given values into the current spherical
     * @param radius the radius to use
     * @param theta the theta to use
     * @param phi the phi to use
     * @returns the current spherical
     */
    copyFromFloats(radius, theta, phi) {
        this.radius = radius;
        this.theta = theta;
        this.phi = phi;
        return this;
    }
    /**
     * Scales the current spherical and stores the result
     * @param scale defines the multiplication factor
     * @param ref where to store the result
     * @returns the updated ref
     */
    scaleToRef(scale, ref) {
        ref.radius = this.radius * scale;
        ref.theta = this.theta * scale;
        ref.phi = this.phi * scale;
        return ref;
    }
    /**
     * Scales the current spherical and returns a new spherical with the scaled coordinates
     * @param scale defines the multiplication factor
     * @returns the scaled spherical
     */
    scale(scale) {
        const ref = new Spherical(0, 0, 0);
        this.scaleToRef(scale, ref);
        return ref;
    }
    /**
     * Scales the current spherical
     * @param scale defines the multiplication factor
     * @returns the current spherical
     */
    scaleInPlace(scale) {
        this.scaleToRef(scale, this);
        return this;
    }
    /**
     * Sets the values of the current spherical
     * @param radius the new radius
     * @param theta the new theta
     * @param phi the new phi
     * @returns the current spherical
     */
    set(radius, theta, phi) {
        this.radius = radius;
        this.theta = theta;
        this.phi = phi;
        return this;
    }
    /**
     * Sets the values of the current spherical
     * @param value the new values
     * @returns the current spherical
     */
    setAll(value) {
        this.set(value, value, value);
        return this;
    }
    /**
     * Assigns the rectangular coordinates of the current Spherical to a Vector3
     * @param ref the Vector3 to update
     * @returns the updated Vector3
     */
    toVector3ToRef(ref) {
        const x = this.radius * Math.sin(this.theta) * Math.cos(this.phi);
        const y = this.radius * Math.cos(this.theta);
        const z = this.radius * Math.sin(this.theta) * Math.sin(this.phi);
        ref.set(x, y, z);
        return ref;
    }
    /**
     * Gets a Vector3 from the current spherical coordinates
     * @returns the (x, y,z) form of the current Spherical
     */
    toVector3() {
        const ref = new math_vector/* Vector3 */.Pq(0, 0, 0);
        return this.toVector3ToRef(ref);
    }
    /**
     * Assigns the spherical coordinates from a Vector3
     * @param vector the vector to convert
     * @param ref the Spherical to update
     * @returns the updated ref
     */
    static FromVector3ToRef(vector, ref) {
        ref.radius = vector.length();
        ref.theta = Math.acos(vector.y / ref.radius);
        ref.phi = Math.atan2(vector.z, vector.x);
        return ref;
    }
    /**
     * Gets a Spherical from a Vector3
     * @param vector defines the vector in (x, y, z) coordinate space
     * @returns a new Spherical
     */
    static FromVector3(vector) {
        const spherical = new Spherical(0, 0, 0);
        Spherical.FromVector3ToRef(vector, spherical);
        return spherical;
    }
    /**
     * Converts an array of floats to a spherical
     * @param array the array to convert
     * @returns the converted spherical
     */
    static FromArray(array) {
        return new Spherical(array[0], array[1], array[2]);
    }
}
//# sourceMappingURL=math.polar.js.map
;// ./node_modules/@babylonjs/core/Maths/math.like.js

//# sourceMappingURL=math.like.js.map
;// ./node_modules/@babylonjs/core/Maths/math.vector.functions.js
/**
 * Creates a string representation of the Vector2
 * @param vector defines the Vector2 to stringify
 * @param decimalCount defines the number of decimals to use
 * @returns a string with the Vector2 coordinates.
 */
function Vector2ToFixed(vector, decimalCount) {
    return `{X: ${vector.x.toFixed(decimalCount)} Y: ${vector.y.toFixed(decimalCount)}}`;
}
/**
 * Creates a string representation of the Vector3
 * @param vector defines the Vector3 to stringify
 * @param decimalCount defines the number of decimals to use
 * @returns a string with the Vector3 coordinates.
 */
function Vector3ToFixed(vector, decimalCount) {
    return `{X: ${vector._x.toFixed(decimalCount)} Y: ${vector._y.toFixed(decimalCount)} Z: ${vector._z.toFixed(decimalCount)}}`;
}
/**
 * Creates a string representation of the Vector4
 * @param vector defines the Vector4 to stringify
 * @param decimalCount defines the number of decimals to use
 * @returns a string with the Vector4 coordinates.
 */
function Vector4ToFixed(vector, decimalCount) {
    return `{X: ${vector.x.toFixed(decimalCount)} Y: ${vector.y.toFixed(decimalCount)} Z: ${vector.z.toFixed(decimalCount)} W: ${vector.w.toFixed(decimalCount)}}`;
}
//# sourceMappingURL=math.vector.functions.js.map
;// ./node_modules/@babylonjs/core/Maths/index.js








//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Meshes/abstractMesh.hotSpot.js



/**
 * Return a transformed local position from a mesh and vertex index
 * @param mesh mesh used to get vertex array from
 * @param index vertex index
 * @param res resulting local position
 * @returns false if it was not possible to compute the position for that vertex
 */
function GetTransformedPosition(mesh, index, res) {
    const data = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
    if (!data) {
        return false;
    }
    const base = index * 3;
    const values = [data[base + 0], data[base + 1], data[base + 2]];
    if (values.some((value) => isNaN(value ?? Number.NaN))) {
        return false;
    }
    if (mesh.morphTargetManager) {
        for (let component = 0; component < 3; component++) {
            let value = values[component];
            for (let targetCount = 0; targetCount < mesh.morphTargetManager.numTargets; targetCount++) {
                const target = mesh.morphTargetManager.getTarget(targetCount);
                const influence = target.influence;
                if (influence !== 0) {
                    const targetData = target.getPositions();
                    if (targetData) {
                        value += (targetData[base + component] - data[base + component]) * influence;
                    }
                }
            }
            values[component] = value;
        }
    }
    res.fromArray(values);
    if (mesh.skeleton) {
        const matricesIndicesData = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind);
        const matricesWeightsData = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind);
        if (matricesWeightsData && matricesIndicesData) {
            const needExtras = mesh.numBoneInfluencers > 4;
            const matricesIndicesExtraData = needExtras ? mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind) : null;
            const matricesWeightsExtraData = needExtras ? mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind) : null;
            const skeletonMatrices = mesh.skeleton.getTransformMatrices(mesh);
            const finalMatrix = math_vector/* TmpVectors */.AA.Matrix[0];
            const tempMatrix = math_vector/* TmpVectors */.AA.Matrix[1];
            finalMatrix.reset();
            const matWeightIdx = index * 4;
            let inf;
            let weight;
            for (inf = 0; inf < 4; inf++) {
                weight = matricesWeightsData[matWeightIdx + inf];
                if (weight > 0) {
                    math_vector/* Matrix */.uq.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);
                    finalMatrix.addToSelf(tempMatrix);
                }
            }
            if (matricesIndicesExtraData && matricesWeightsExtraData) {
                for (inf = 0; inf < 4; inf++) {
                    weight = matricesWeightsExtraData[matWeightIdx + inf];
                    if (weight > 0) {
                        math_vector/* Matrix */.uq.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);
                        finalMatrix.addToSelf(tempMatrix);
                    }
                }
            }
            math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(values[0], values[1], values[2], finalMatrix, res);
        }
    }
    return true;
}
/**
 * Compute a world space hotspot position
 * TmpVectors.Vector3[0..4] are modified by this function. Do not use them as result output.
 * @param mesh mesh used to get hotspot from
 * @param hotSpotQuery point indices and barycentric
 * @param resPosition output world position
 * @param resNormal optional output world normal
 * @returns false if it was not possible to compute the hotspot position
 */
function GetHotSpotToRef(mesh, hotSpotQuery, resPosition, resNormal) {
    resPosition.set(0, 0, 0);
    for (let i = 0; i < 3; i++) {
        const index = hotSpotQuery.pointIndex[i];
        if (!GetTransformedPosition(mesh, index, math_vector/* TmpVectors */.AA.Vector3[i])) {
            return false;
        }
        math_vector/* TmpVectors */.AA.Vector3[i].scaleAndAddToRef(hotSpotQuery.barycentric[i], resPosition);
    }
    // Convert the result to world space
    math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(resPosition, mesh.getWorldMatrix(), resPosition);
    // compute normal in world space
    if (resNormal) {
        const pointA = math_vector/* TmpVectors */.AA.Vector3[0];
        const pointB = math_vector/* TmpVectors */.AA.Vector3[1];
        const pointC = math_vector/* TmpVectors */.AA.Vector3[2];
        const segmentA = math_vector/* TmpVectors */.AA.Vector3[3];
        const segmentB = math_vector/* TmpVectors */.AA.Vector3[4];
        segmentA.copyFrom(pointB);
        segmentA.subtractInPlace(pointA);
        segmentB.copyFrom(pointC);
        segmentB.subtractInPlace(pointA);
        segmentA.normalize();
        segmentB.normalize();
        math_vector/* Vector3 */.Pq.CrossToRef(segmentA, segmentB, resNormal);
        // flip normal when face culling is changed
        const flipNormal = mesh.material &&
            mesh.material.sideOrientation ===
                (mesh.getScene().useRightHandedSystem ? 0 : 1);
        if (flipNormal) {
            resNormal.scaleInPlace(-1);
        }
        // Convert the result to world space
        math_vector/* Vector3 */.Pq.TransformNormalToRef(resNormal, mesh.getWorldMatrix(), resNormal);
        resNormal.normalize();
    }
    return true;
}
//# sourceMappingURL=abstractMesh.hotSpot.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.js + 1 modules
var dracoCompression = __webpack_require__(74498);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/Compression/meshoptCompression.js
var meshoptCompression = __webpack_require__(59185);
;// ./node_modules/@babylonjs/core/Meshes/Compression/index.js


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Meshes/csg.js







/**
 * Unique ID when we import meshes from Babylon to CSG
 */
let currentCSGMeshId = 0;
/**
 * Represents a vertex of a polygon. Use your own vertex class instead of this
 * one to provide additional features like texture coordinates and vertex
 * colors. Custom vertex classes need to provide a `pos` property and `clone()`,
 * `flip()`, and `interpolate()` methods that behave analogous to the ones
 * defined by `BABYLON.CSG.Vertex`. This class provides `normal` so convenience
 * functions like `BABYLON.CSG.sphere()` can return a smooth vertex normal, but `normal`
 * is not used anywhere else.
 * Same goes for uv, it allows to keep the original vertex uv coordinates of the 2 meshes
 */
class Vertex {
    /**
     * Initializes the vertex
     * @param pos The position of the vertex
     * @param normal The normal of the vertex
     * @param uv The texture coordinate of the vertex
     * @param vertColor The RGBA color of the vertex
     */
    constructor(
    /**
     * The position of the vertex
     */
    pos, 
    /**
     * The normal of the vertex
     */
    normal, 
    /**
     * The texture coordinate of the vertex
     */
    uv, 
    /**
     * The texture coordinate of the vertex
     */
    vertColor) {
        this.pos = pos;
        this.normal = normal;
        this.uv = uv;
        this.vertColor = vertColor;
    }
    /**
     * Make a clone, or deep copy, of the vertex
     * @returns A new Vertex
     */
    clone() {
        return new Vertex(this.pos.clone(), this.normal.clone(), this.uv?.clone(), this.vertColor?.clone());
    }
    /**
     * Invert all orientation-specific data (e.g. vertex normal). Called when the
     * orientation of a polygon is flipped.
     */
    flip() {
        this.normal = this.normal.scale(-1);
    }
    /**
     * Create a new vertex between this vertex and `other` by linearly
     * interpolating all properties using a parameter of `t`. Subclasses should
     * override this to interpolate additional properties.
     * @param other the vertex to interpolate against
     * @param t The factor used to linearly interpolate between the vertices
     * @returns The new interpolated vertex
     */
    interpolate(other, t) {
        return new Vertex(math_vector/* Vector3 */.Pq.Lerp(this.pos, other.pos, t), math_vector/* Vector3 */.Pq.Lerp(this.normal, other.normal, t), this.uv && other.uv ? math_vector/* Vector2 */.I9.Lerp(this.uv, other.uv, t) : undefined, this.vertColor && other.vertColor ? math_color/* Color4 */.ov.Lerp(this.vertColor, other.vertColor, t) : undefined);
    }
}
/**
 * Represents a plane in 3D space.
 */
class CSGPlane {
    /**
     * Initializes the plane
     * @param normal The normal for the plane
     * @param w
     */
    constructor(normal, w) {
        this.normal = normal;
        this.w = w;
    }
    /**
     * Construct a plane from three points
     * @param a Point a
     * @param b Point b
     * @param c Point c
     * @returns A new plane
     */
    static FromPoints(a, b, c) {
        const v0 = c.subtract(a);
        const v1 = b.subtract(a);
        if (v0.lengthSquared() === 0 || v1.lengthSquared() === 0) {
            return null;
        }
        const n = math_vector/* Vector3 */.Pq.Normalize(math_vector/* Vector3 */.Pq.Cross(v0, v1));
        return new CSGPlane(n, math_vector/* Vector3 */.Pq.Dot(n, a));
    }
    /**
     * Clone, or make a deep copy of the plane
     * @returns a new Plane
     */
    clone() {
        return new CSGPlane(this.normal.clone(), this.w);
    }
    /**
     * Flip the face of the plane
     */
    flip() {
        this.normal.scaleInPlace(-1);
        this.w = -this.w;
    }
    /**
     * Split `polygon` by this plane if needed, then put the polygon or polygon
     * fragments in the appropriate lists. Coplanar polygons go into either
    `* coplanarFront` or `coplanarBack` depending on their orientation with
     * respect to this plane. Polygons in front or in back of this plane go into
     * either `front` or `back`
     * @param polygon The polygon to be split
     * @param coplanarFront Will contain polygons coplanar with the plane that are oriented to the front of the plane
     * @param coplanarBack Will contain polygons coplanar with the plane that are oriented to the back of the plane
     * @param front Will contain the polygons in front of the plane
     * @param back Will contain the polygons begind the plane
     */
    splitPolygon(polygon, coplanarFront, coplanarBack, front, back) {
        const COPLANAR = 0;
        const FRONT = 1;
        const BACK = 2;
        const SPANNING = 3;
        // Classify each point as well as the entire polygon into one of the above
        // four classes.
        let polygonType = 0;
        const types = [];
        let i;
        let t;
        for (i = 0; i < polygon.vertices.length; i++) {
            t = math_vector/* Vector3 */.Pq.Dot(this.normal, polygon.vertices[i].pos) - this.w;
            const type = t < -CSGPlane.EPSILON ? BACK : t > CSGPlane.EPSILON ? FRONT : COPLANAR;
            polygonType |= type;
            types.push(type);
        }
        // Put the polygon in the correct list, splitting it when necessary
        switch (polygonType) {
            case COPLANAR:
                (math_vector/* Vector3 */.Pq.Dot(this.normal, polygon.plane.normal) > 0 ? coplanarFront : coplanarBack).push(polygon);
                break;
            case FRONT:
                front.push(polygon);
                break;
            case BACK:
                back.push(polygon);
                break;
            case SPANNING: {
                const f = [], b = [];
                for (i = 0; i < polygon.vertices.length; i++) {
                    const j = (i + 1) % polygon.vertices.length;
                    const ti = types[i], tj = types[j];
                    const vi = polygon.vertices[i], vj = polygon.vertices[j];
                    if (ti !== BACK) {
                        f.push(vi);
                    }
                    if (ti !== FRONT) {
                        b.push(ti !== BACK ? vi.clone() : vi);
                    }
                    if ((ti | tj) === SPANNING) {
                        t = (this.w - math_vector/* Vector3 */.Pq.Dot(this.normal, vi.pos)) / math_vector/* Vector3 */.Pq.Dot(this.normal, vj.pos.subtract(vi.pos));
                        const v = vi.interpolate(vj, t);
                        f.push(v);
                        b.push(v.clone());
                    }
                }
                let poly;
                if (f.length >= 3) {
                    poly = new CSGPolygon(f, polygon.shared);
                    if (poly.plane) {
                        front.push(poly);
                    }
                }
                if (b.length >= 3) {
                    poly = new CSGPolygon(b, polygon.shared);
                    if (poly.plane) {
                        back.push(poly);
                    }
                }
                break;
            }
        }
    }
}
/**
 * `CSG.Plane.EPSILON` is the tolerance used by `splitPolygon()` to decide if a
 * point is on the plane
 */
CSGPlane.EPSILON = 1e-5;
/**
 * Represents a convex polygon. The vertices used to initialize a polygon must
 * be coplanar and form a convex loop.
 *
 * Each convex polygon has a `shared` property, which is shared between all
 * polygons that are clones of each other or were split from the same polygon.
 * This can be used to define per-polygon properties (such as surface color)
 */
class CSGPolygon {
    /**
     * Initializes the polygon
     * @param vertices The vertices of the polygon
     * @param shared The properties shared across all polygons
     */
    constructor(vertices, shared) {
        this.vertices = vertices;
        this.shared = shared;
        this.plane = CSGPlane.FromPoints(vertices[0].pos, vertices[1].pos, vertices[2].pos);
    }
    /**
     * Clones, or makes a deep copy, or the polygon
     * @returns A new CSGPolygon
     */
    clone() {
        const vertices = this.vertices.map((v) => v.clone());
        return new CSGPolygon(vertices, this.shared);
    }
    /**
     * Flips the faces of the polygon
     */
    flip() {
        this.vertices.reverse().map((v) => {
            v.flip();
        });
        this.plane.flip();
    }
}
/**
 * Holds a node in a BSP tree. A BSP tree is built from a collection of polygons
 * by picking a polygon to split along. That polygon (and all other coplanar
 * polygons) are added directly to that node and the other polygons are added to
 * the front and/or back subtrees. This is not a leafy BSP tree since there is
 * no distinction between internal and leaf nodes
 */
class csg_Node {
    /**
     * Initializes the node
     * @param polygons A collection of polygons held in the node
     */
    constructor(polygons) {
        this._plane = null;
        this._front = null;
        this._back = null;
        this._polygons = new Array();
        if (polygons) {
            this.build(polygons);
        }
    }
    /**
     * Clones, or makes a deep copy, of the node
     * @returns The cloned node
     */
    clone() {
        const node = new csg_Node();
        node._plane = this._plane && this._plane.clone();
        node._front = this._front && this._front.clone();
        node._back = this._back && this._back.clone();
        node._polygons = this._polygons.map((p) => p.clone());
        return node;
    }
    /**
     * Convert solid space to empty space and empty space to solid space
     */
    invert() {
        for (let i = 0; i < this._polygons.length; i++) {
            this._polygons[i].flip();
        }
        if (this._plane) {
            this._plane.flip();
        }
        if (this._front) {
            this._front.invert();
        }
        if (this._back) {
            this._back.invert();
        }
        const temp = this._front;
        this._front = this._back;
        this._back = temp;
    }
    /**
     * Recursively remove all polygons in `polygons` that are inside this BSP
     * tree.
     * @param polygons Polygons to remove from the BSP
     * @returns Polygons clipped from the BSP
     */
    clipPolygons(polygons) {
        if (!this._plane) {
            return polygons.slice();
        }
        let front = [], back = [];
        for (let i = 0; i < polygons.length; i++) {
            this._plane.splitPolygon(polygons[i], front, back, front, back);
        }
        if (this._front) {
            front = this._front.clipPolygons(front);
        }
        if (this._back) {
            back = this._back.clipPolygons(back);
        }
        else {
            back = [];
        }
        return front.concat(back);
    }
    /**
     * Remove all polygons in this BSP tree that are inside the other BSP tree
     * `bsp`.
     * @param bsp BSP containing polygons to remove from this BSP
     */
    clipTo(bsp) {
        this._polygons = bsp.clipPolygons(this._polygons);
        if (this._front) {
            this._front.clipTo(bsp);
        }
        if (this._back) {
            this._back.clipTo(bsp);
        }
    }
    /**
     * Return a list of all polygons in this BSP tree
     * @returns List of all polygons in this BSP tree
     */
    allPolygons() {
        let polygons = this._polygons.slice();
        if (this._front) {
            polygons = polygons.concat(this._front.allPolygons());
        }
        if (this._back) {
            polygons = polygons.concat(this._back.allPolygons());
        }
        return polygons;
    }
    /**
     * Build a BSP tree out of `polygons`. When called on an existing tree, the
     * new polygons are filtered down to the bottom of the tree and become new
     * nodes there. Each set of polygons is partitioned using the first polygon
     * (no heuristic is used to pick a good split)
     * @param polygons Polygons used to construct the BSP tree
     */
    build(polygons) {
        if (!polygons.length) {
            return;
        }
        if (!this._plane) {
            this._plane = polygons[0].plane.clone();
        }
        const front = [], back = [];
        for (let i = 0; i < polygons.length; i++) {
            this._plane.splitPolygon(polygons[i], this._polygons, this._polygons, front, back);
        }
        if (front.length) {
            if (!this._front) {
                this._front = new csg_Node();
            }
            this._front.build(front);
        }
        if (back.length) {
            if (!this._back) {
                this._back = new csg_Node();
            }
            this._back.build(back);
        }
    }
}
/**
 * Class for building Constructive Solid Geometry
 * @deprecated Please use CSG2 instead
 */
class CSG {
    constructor() {
        this._polygons = new Array();
    }
    /**
     * Convert a VertexData to CSG
     * @param data defines the VertexData to convert to CSG
     * @returns the new CSG
     */
    static FromVertexData(data) {
        let vertex, polygon, vertices;
        const polygons = [];
        const indices = data.indices;
        const positions = data.positions;
        const normals = data.normals;
        const uvs = data.uvs;
        const vertColors = data.colors;
        if (!indices || !positions) {
            // eslint-disable-next-line no-throw-literal
            throw "BABYLON.CSG: VertexData must at least contain positions and indices";
        }
        for (let i = 0; i < indices.length; i += 3) {
            vertices = [];
            for (let j = 0; j < 3; j++) {
                const indexIndices = i + j;
                const offset = indices[indexIndices];
                const normal = normals ? math_vector/* Vector3 */.Pq.FromArray(normals, offset * 3) : math_vector/* Vector3 */.Pq.Zero();
                const uv = uvs ? math_vector/* Vector2 */.I9.FromArray(uvs, offset * 2) : undefined;
                const vertColor = vertColors ? math_color/* Color4 */.ov.FromArray(vertColors, offset * 4) : undefined;
                const position = math_vector/* Vector3 */.Pq.FromArray(positions, offset * 3);
                vertex = new Vertex(position, normal, uv, vertColor);
                vertices.push(vertex);
            }
            polygon = new CSGPolygon(vertices, { subMeshId: 0, meshId: currentCSGMeshId, materialIndex: 0 });
            // To handle the case of degenerated triangle
            // polygon.plane == null <=> the polygon does not represent 1 single plane <=> the triangle is degenerated
            if (polygon.plane) {
                polygons.push(polygon);
            }
        }
        const csg = CSG._FromPolygons(polygons);
        csg.matrix = math_vector/* Matrix */.uq.Identity();
        csg.position = math_vector/* Vector3 */.Pq.Zero();
        csg.rotation = math_vector/* Vector3 */.Pq.Zero();
        csg.scaling = math_vector/* Vector3 */.Pq.One();
        csg.rotationQuaternion = math_vector/* Quaternion */.PT.Identity();
        currentCSGMeshId++;
        return csg;
    }
    /**
     * Convert the Mesh to CSG
     * @param mesh The Mesh to convert to CSG
     * @param absolute If true, the final (local) matrix transformation is set to the identity and not to that of `mesh`. It can help when dealing with right-handed meshes (default: false)
     * @returns A new CSG from the Mesh
     */
    static FromMesh(mesh, absolute = false) {
        let vertex, normal, uv = undefined, position, vertColor = undefined, polygon, vertices;
        const polygons = [];
        let matrix, meshPosition, meshRotation, meshRotationQuaternion = null, meshScaling;
        let invertWinding = false;
        if (mesh instanceof Meshes_mesh/* Mesh */.e) {
            mesh.computeWorldMatrix(true);
            matrix = mesh.getWorldMatrix();
            meshPosition = mesh.position.clone();
            meshRotation = mesh.rotation.clone();
            if (mesh.rotationQuaternion) {
                meshRotationQuaternion = mesh.rotationQuaternion.clone();
            }
            meshScaling = mesh.scaling.clone();
            if (mesh.material && absolute) {
                invertWinding = mesh.material.sideOrientation === 0;
            }
        }
        else {
            // eslint-disable-next-line no-throw-literal
            throw "BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh";
        }
        const indices = mesh.getIndices(), positions = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind), normals = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind), uvs = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind), vertColors = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind);
        if (indices === null) {
            // eslint-disable-next-line no-throw-literal
            throw "BABYLON.CSG: Mesh has no indices";
        }
        if (positions === null) {
            // eslint-disable-next-line no-throw-literal
            throw "BABYLON.CSG: Mesh has no positions";
        }
        if (normals === null) {
            // eslint-disable-next-line no-throw-literal
            throw "BABYLON.CSG: Mesh has no normals";
        }
        const subMeshes = mesh.subMeshes;
        for (let sm = 0, sml = subMeshes.length; sm < sml; sm++) {
            for (let i = subMeshes[sm].indexStart, il = subMeshes[sm].indexCount + subMeshes[sm].indexStart; i < il; i += 3) {
                vertices = [];
                for (let j = 0; j < 3; j++) {
                    const indexIndices = j === 0 ? i + j : invertWinding ? i + 3 - j : i + j;
                    const sourceNormal = new math_vector/* Vector3 */.Pq(normals[indices[indexIndices] * 3], normals[indices[indexIndices] * 3 + 1], normals[indices[indexIndices] * 3 + 2]);
                    if (uvs) {
                        uv = new math_vector/* Vector2 */.I9(uvs[indices[indexIndices] * 2], uvs[indices[indexIndices] * 2 + 1]);
                    }
                    if (vertColors) {
                        vertColor = new math_color/* Color4 */.ov(vertColors[indices[indexIndices] * 4], vertColors[indices[indexIndices] * 4 + 1], vertColors[indices[indexIndices] * 4 + 2], vertColors[indices[indexIndices] * 4 + 3]);
                    }
                    const sourcePosition = new math_vector/* Vector3 */.Pq(positions[indices[indexIndices] * 3], positions[indices[indexIndices] * 3 + 1], positions[indices[indexIndices] * 3 + 2]);
                    position = math_vector/* Vector3 */.Pq.TransformCoordinates(sourcePosition, matrix);
                    normal = math_vector/* Vector3 */.Pq.TransformNormal(sourceNormal, matrix);
                    vertex = new Vertex(position, normal, uv, vertColor);
                    vertices.push(vertex);
                }
                polygon = new CSGPolygon(vertices, { subMeshId: sm, meshId: currentCSGMeshId, materialIndex: subMeshes[sm].materialIndex });
                // To handle the case of degenerated triangle
                // polygon.plane == null <=> the polygon does not represent 1 single plane <=> the triangle is degenerated
                if (polygon.plane) {
                    polygons.push(polygon);
                }
            }
        }
        const csg = CSG._FromPolygons(polygons);
        csg.matrix = absolute ? math_vector/* Matrix */.uq.Identity() : matrix;
        csg.position = absolute ? math_vector/* Vector3 */.Pq.Zero() : meshPosition;
        csg.rotation = absolute ? math_vector/* Vector3 */.Pq.Zero() : meshRotation;
        csg.scaling = absolute ? math_vector/* Vector3 */.Pq.One() : meshScaling;
        csg.rotationQuaternion = absolute && meshRotationQuaternion ? math_vector/* Quaternion */.PT.Identity() : meshRotationQuaternion;
        currentCSGMeshId++;
        return csg;
    }
    /**
     * Construct a CSG solid from a list of `CSG.Polygon` instances.
     * @param polygons Polygons used to construct a CSG solid
     * @returns A new CSG solid
     */
    static _FromPolygons(polygons) {
        const csg = new CSG();
        csg._polygons = polygons;
        return csg;
    }
    /**
     * Clones, or makes a deep copy, of the CSG
     * @returns A new CSG
     */
    clone() {
        const csg = new CSG();
        csg._polygons = this._polygons.map((p) => p.clone());
        csg.copyTransformAttributes(this);
        return csg;
    }
    /**
     * Unions this CSG with another CSG
     * @param csg The CSG to union against this CSG
     * @returns The unioned CSG
     */
    union(csg) {
        const a = new csg_Node(this.clone()._polygons);
        const b = new csg_Node(csg.clone()._polygons);
        a.clipTo(b);
        b.clipTo(a);
        b.invert();
        b.clipTo(a);
        b.invert();
        a.build(b.allPolygons());
        return CSG._FromPolygons(a.allPolygons()).copyTransformAttributes(this);
    }
    /**
     * Unions this CSG with another CSG in place
     * @param csg The CSG to union against this CSG
     */
    unionInPlace(csg) {
        const a = new csg_Node(this._polygons);
        const b = new csg_Node(csg._polygons);
        a.clipTo(b);
        b.clipTo(a);
        b.invert();
        b.clipTo(a);
        b.invert();
        a.build(b.allPolygons());
        this._polygons = a.allPolygons();
    }
    /**
     * Subtracts this CSG with another CSG
     * @param csg The CSG to subtract against this CSG
     * @returns A new CSG
     */
    subtract(csg) {
        const a = new csg_Node(this.clone()._polygons);
        const b = new csg_Node(csg.clone()._polygons);
        a.invert();
        a.clipTo(b);
        b.clipTo(a);
        b.invert();
        b.clipTo(a);
        b.invert();
        a.build(b.allPolygons());
        a.invert();
        return CSG._FromPolygons(a.allPolygons()).copyTransformAttributes(this);
    }
    /**
     * Subtracts this CSG with another CSG in place
     * @param csg The CSG to subtract against this CSG
     */
    subtractInPlace(csg) {
        const a = new csg_Node(this._polygons);
        const b = new csg_Node(csg._polygons);
        a.invert();
        a.clipTo(b);
        b.clipTo(a);
        b.invert();
        b.clipTo(a);
        b.invert();
        a.build(b.allPolygons());
        a.invert();
        this._polygons = a.allPolygons();
    }
    /**
     * Intersect this CSG with another CSG
     * @param csg The CSG to intersect against this CSG
     * @returns A new CSG
     */
    intersect(csg) {
        const a = new csg_Node(this.clone()._polygons);
        const b = new csg_Node(csg.clone()._polygons);
        a.invert();
        b.clipTo(a);
        b.invert();
        a.clipTo(b);
        b.clipTo(a);
        a.build(b.allPolygons());
        a.invert();
        return CSG._FromPolygons(a.allPolygons()).copyTransformAttributes(this);
    }
    /**
     * Intersects this CSG with another CSG in place
     * @param csg The CSG to intersect against this CSG
     */
    intersectInPlace(csg) {
        const a = new csg_Node(this._polygons);
        const b = new csg_Node(csg._polygons);
        a.invert();
        b.clipTo(a);
        b.invert();
        a.clipTo(b);
        b.clipTo(a);
        a.build(b.allPolygons());
        a.invert();
        this._polygons = a.allPolygons();
    }
    /**
     * Return a new CSG solid with solid and empty space switched. This solid is
     * not modified.
     * @returns A new CSG solid with solid and empty space switched
     */
    inverse() {
        const csg = this.clone();
        csg.inverseInPlace();
        return csg;
    }
    /**
     * Inverses the CSG in place
     */
    inverseInPlace() {
        this._polygons.map((p) => {
            p.flip();
        });
    }
    /**
     * This is used to keep meshes transformations so they can be restored
     * when we build back a Babylon Mesh
     * NB : All CSG operations are performed in world coordinates
     * @param csg The CSG to copy the transform attributes from
     * @returns This CSG
     */
    copyTransformAttributes(csg) {
        this.matrix = csg.matrix;
        this.position = csg.position;
        this.rotation = csg.rotation;
        this.scaling = csg.scaling;
        this.rotationQuaternion = csg.rotationQuaternion;
        return this;
    }
    /**
     * Build vertex data from CSG
     * Coordinates here are in world space
     * @param onBeforePolygonProcessing called before each polygon is being processed
     * @param onAfterPolygonProcessing called after each polygon has been processed
     * @returns the final vertex data
     */
    toVertexData(onBeforePolygonProcessing = null, onAfterPolygonProcessing = null) {
        const matrix = this.matrix.clone();
        matrix.invert();
        const polygons = this._polygons;
        const vertices = [];
        const indices = [];
        const normals = [];
        let uvs = null;
        let vertColors = null;
        const vertex = math_vector/* Vector3 */.Pq.Zero();
        const normal = math_vector/* Vector3 */.Pq.Zero();
        const uv = math_vector/* Vector2 */.I9.Zero();
        const vertColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
        const polygonIndices = [0, 0, 0];
        const vertice_dict = {};
        let vertex_idx;
        for (let i = 0, il = polygons.length; i < il; i++) {
            const polygon = polygons[i];
            if (onBeforePolygonProcessing) {
                onBeforePolygonProcessing(polygon);
            }
            for (let j = 2, jl = polygon.vertices.length; j < jl; j++) {
                polygonIndices[0] = 0;
                polygonIndices[1] = j - 1;
                polygonIndices[2] = j;
                for (let k = 0; k < 3; k++) {
                    vertex.copyFrom(polygon.vertices[polygonIndices[k]].pos);
                    normal.copyFrom(polygon.vertices[polygonIndices[k]].normal);
                    if (polygon.vertices[polygonIndices[k]].uv) {
                        if (!uvs) {
                            uvs = [];
                        }
                        uv.copyFrom(polygon.vertices[polygonIndices[k]].uv);
                    }
                    if (polygon.vertices[polygonIndices[k]].vertColor) {
                        if (!vertColors) {
                            vertColors = [];
                        }
                        vertColor.copyFrom(polygon.vertices[polygonIndices[k]].vertColor);
                    }
                    const localVertex = math_vector/* Vector3 */.Pq.TransformCoordinates(vertex, matrix);
                    const localNormal = math_vector/* Vector3 */.Pq.TransformNormal(normal, matrix);
                    vertex_idx = vertice_dict[localVertex.x + "," + localVertex.y + "," + localVertex.z];
                    let areUvsDifferent = false;
                    if (uvs && !(uvs[vertex_idx * 2] === uv.x || uvs[vertex_idx * 2 + 1] === uv.y)) {
                        areUvsDifferent = true;
                    }
                    let areColorsDifferent = false;
                    if (vertColors &&
                        !(vertColors[vertex_idx * 4] === vertColor.r ||
                            vertColors[vertex_idx * 4 + 1] === vertColor.g ||
                            vertColors[vertex_idx * 4 + 2] === vertColor.b ||
                            vertColors[vertex_idx * 4 + 3] === vertColor.a)) {
                        areColorsDifferent = true;
                    }
                    // Check if 2 points can be merged
                    if (!(typeof vertex_idx !== "undefined" &&
                        normals[vertex_idx * 3] === localNormal.x &&
                        normals[vertex_idx * 3 + 1] === localNormal.y &&
                        normals[vertex_idx * 3 + 2] === localNormal.z) ||
                        areUvsDifferent ||
                        areColorsDifferent) {
                        vertices.push(localVertex.x, localVertex.y, localVertex.z);
                        if (uvs) {
                            uvs.push(uv.x, uv.y);
                        }
                        normals.push(normal.x, normal.y, normal.z);
                        if (vertColors) {
                            vertColors.push(vertColor.r, vertColor.g, vertColor.b, vertColor.a);
                        }
                        vertex_idx = vertice_dict[localVertex.x + "," + localVertex.y + "," + localVertex.z] = vertices.length / 3 - 1;
                    }
                    indices.push(vertex_idx);
                    if (onAfterPolygonProcessing) {
                        onAfterPolygonProcessing();
                    }
                }
            }
        }
        const result = new mesh_vertexData/* VertexData */.P();
        result.positions = vertices;
        result.normals = normals;
        if (uvs) {
            result.uvs = uvs;
        }
        if (vertColors) {
            result.colors = vertColors;
        }
        result.indices = indices;
        return result;
    }
    /**
     * Build Raw mesh from CSG
     * Coordinates here are in world space
     * @param name The name of the mesh geometry
     * @param scene The Scene
     * @param keepSubMeshes Specifies if the submeshes should be kept
     * @returns A new Mesh
     */
    buildMeshGeometry(name, scene, keepSubMeshes) {
        const mesh = new Meshes_mesh/* Mesh */.e(name, scene);
        const polygons = this._polygons;
        let currentIndex = 0;
        const subMeshDict = {};
        let subMeshObj;
        if (keepSubMeshes) {
            // Sort Polygons, since subMeshes are indices range
            polygons.sort((a, b) => {
                if (a.shared.meshId === b.shared.meshId) {
                    return a.shared.subMeshId - b.shared.subMeshId;
                }
                else {
                    return a.shared.meshId - b.shared.meshId;
                }
            });
        }
        const vertexData = this.toVertexData((polygon) => {
            // Building SubMeshes
            if (!subMeshDict[polygon.shared.meshId]) {
                subMeshDict[polygon.shared.meshId] = {};
            }
            if (!subMeshDict[polygon.shared.meshId][polygon.shared.subMeshId]) {
                subMeshDict[polygon.shared.meshId][polygon.shared.subMeshId] = {
                    indexStart: +Infinity,
                    indexEnd: -Infinity,
                    materialIndex: polygon.shared.materialIndex,
                };
            }
            subMeshObj = subMeshDict[polygon.shared.meshId][polygon.shared.subMeshId];
        }, () => {
            subMeshObj.indexStart = Math.min(currentIndex, subMeshObj.indexStart);
            subMeshObj.indexEnd = Math.max(currentIndex, subMeshObj.indexEnd);
            currentIndex++;
        });
        vertexData.applyToMesh(mesh);
        if (keepSubMeshes) {
            // We offset the materialIndex by the previous number of materials in the CSG mixed meshes
            let materialIndexOffset = 0, materialMaxIndex;
            mesh.subMeshes = [];
            for (const m in subMeshDict) {
                materialMaxIndex = -1;
                for (const sm in subMeshDict[m]) {
                    subMeshObj = subMeshDict[m][sm];
                    subMesh/* SubMesh */.K.CreateFromIndices(subMeshObj.materialIndex + materialIndexOffset, subMeshObj.indexStart, subMeshObj.indexEnd - subMeshObj.indexStart + 1, mesh);
                    materialMaxIndex = Math.max(subMeshObj.materialIndex, materialMaxIndex);
                }
                materialIndexOffset += ++materialMaxIndex;
            }
        }
        return mesh;
    }
    /**
     * Build Mesh from CSG taking material and transforms into account
     * @param name The name of the Mesh
     * @param material The material of the Mesh
     * @param scene The Scene
     * @param keepSubMeshes Specifies if submeshes should be kept
     * @returns The new Mesh
     */
    toMesh(name, material = null, scene, keepSubMeshes) {
        const mesh = this.buildMeshGeometry(name, scene, keepSubMeshes);
        mesh.material = material;
        mesh.position.copyFrom(this.position);
        mesh.rotation.copyFrom(this.rotation);
        if (this.rotationQuaternion) {
            mesh.rotationQuaternion = this.rotationQuaternion.clone();
        }
        mesh.scaling.copyFrom(this.scaling);
        mesh.computeWorldMatrix(true);
        return mesh;
    }
}
//# sourceMappingURL=csg.js.map
;// ./node_modules/@babylonjs/core/Meshes/meshUVSpaceRenderer.js






/**
 * Class used to render in the mesh UV space
 * @since 5.49.1
 */
class MeshUVSpaceRenderer {
    static _GetShader(scene, shaderLanguage) {
        if (!scene._meshUVSpaceRendererShader) {
            const shader = new shaderMaterial/* ShaderMaterial */.B("meshUVSpaceRendererShader", scene, {
                vertex: "meshUVSpaceRenderer",
                fragment: "meshUVSpaceRenderer",
            }, {
                attributes: ["position", "normal", "uv"],
                uniforms: ["world", "projMatrix"],
                samplers: ["textureSampler"],
                needAlphaBlending: true,
                shaderLanguage: shaderLanguage,
            });
            shader.backFaceCulling = false;
            shader.alphaMode = 2;
            scene.onDisposeObservable.add(() => {
                scene._meshUVSpaceRendererShader?.dispose();
                scene._meshUVSpaceRendererShader = null;
            });
            scene._meshUVSpaceRendererShader = shader;
        }
        return scene._meshUVSpaceRendererShader;
    }
    static _GetMaskShader(scene, shaderLanguage) {
        if (!scene._meshUVSpaceRendererMaskShader) {
            const shader = new shaderMaterial/* ShaderMaterial */.B("meshUVSpaceRendererMaskShader", scene, {
                vertex: "meshUVSpaceRendererMasker",
                fragment: "meshUVSpaceRendererMasker",
            }, {
                attributes: ["position", "uv"],
                uniforms: ["worldViewProjection"],
                shaderLanguage: shaderLanguage,
            });
            shader.backFaceCulling = false;
            shader.alphaMode = 2;
            scene.onDisposeObservable.add(() => {
                scene._meshUVSpaceRendererMaskShader?.dispose();
                scene._meshUVSpaceRendererMaskShader = null;
            });
            scene._meshUVSpaceRendererMaskShader = shader;
        }
        return scene._meshUVSpaceRendererMaskShader;
    }
    static _IsRenderTargetTexture(texture) {
        return texture.renderList !== undefined;
    }
    /**
     * Gets the shader language used in this material.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Creates a new MeshUVSpaceRenderer
     * @param mesh The mesh used for the source UV space
     * @param scene The scene the mesh belongs to
     * @param options The options to use when creating the texture
     */
    constructor(mesh, scene, options) {
        this._textureCreatedInternally = false;
        this._configureUserCreatedTexture = true;
        this._maskTexture = null;
        this._finalPostProcess = null;
        this._shadersLoaded = false;
        this._isDisposed = false;
        /**
         * Clear color of the texture
         */
        this.clearColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
        /**
         * Target texture used for rendering
         * If you don't set the property, a RenderTargetTexture will be created internally given the options provided to the constructor.
         * If you provide a RenderTargetTexture, it will be used directly.
         */
        this.texture = null;
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._mesh = mesh;
        this._scene = scene;
        this._options = {
            width: 1024,
            height: 1024,
            textureType: 0,
            generateMipMaps: true,
            optimizeUVAllocation: true,
            uvEdgeBlending: false,
            ...options,
        };
        this._initShaderSourceAsync();
    }
    async _initShaderSourceAsync() {
        const engine = this._scene.getEngine();
        if (engine.isWebGPU) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 23451)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 72657)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 19226)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 4044)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 33570)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 29700)),
            ]);
        }
        else {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99764)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 30)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 54561)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 78439)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 18507)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 15105)),
            ]);
        }
        if (this._isDisposed) {
            return;
        }
        this._shadersLoaded = true;
    }
    /**
     * Checks if the texture is ready to be used
     * @returns true if the texture is ready to be used
     */
    isReady() {
        if (!this._shadersLoaded) {
            return false;
        }
        if (!this.texture) {
            this._createDiffuseRTT();
        }
        else if (this._configureUserCreatedTexture) {
            this._configureUserCreatedRTT();
        }
        // this.texture is guaranteed to be non-null here as it is created in _createDiffuseRTT above
        const textureIsReady = MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture) ? this.texture.isReadyForRendering() : this.texture.isReady();
        const maskIsReady = this._maskTexture?.isReadyForRendering() ?? true;
        const postProcessIsReady = this._finalPostProcess?.isReady() ?? true;
        return textureIsReady && maskIsReady && postProcessIsReady;
    }
    /**
     * Projects and renders a texture in the mesh UV space
     * @param texture The texture
     * @param position The position of the center of projection (world space coordinates)
     * @param normal The direction of the projection (world space coordinates)
     * @param size The size of the projection
     * @param angle The rotation angle around the direction of the projection (default: 0)
     * @param checkIsReady If true, it will check if the texture is ready before rendering (default: true). If the texture is not ready, a new attempt will be scheduled in 16ms
     */
    renderTexture(texture, position, normal, size, angle = 0, checkIsReady = true) {
        if (checkIsReady && !this.isReady()) {
            setTimeout(() => {
                this.renderTexture(texture, position, normal, size, angle, checkIsReady);
            }, 16);
            return;
        }
        if (!this.texture) {
            this._createDiffuseRTT();
        }
        else if (this._configureUserCreatedTexture) {
            this._configureUserCreatedRTT();
        }
        // this.texture is guaranteed to be non-null here as it is created in _createDiffuseRTT above
        if (MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture)) {
            const matrix = this._createProjectionMatrix(position, normal, size, angle);
            const shader = MeshUVSpaceRenderer._GetShader(this._scene, this._shaderLanguage);
            shader.setTexture("textureSampler", texture);
            shader.setMatrix("projMatrix", matrix);
            this.texture.render();
            // We needed the texture only once for the render() call above, so we can remove it from the shader.
            // It's important to do that, because this texture could be disposed by the user, meaning that shader.isReady() would return false as part of the this.texture.isReadyForRendering() call of isReady()
            shader.removeTexture("textureSampler");
        }
    }
    /**
     * Clears the texture map
     */
    clear() {
        if (this.texture && MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture) && this.texture.renderTarget) {
            const engine = this._scene.getEngine();
            engine.bindFramebuffer(this.texture.renderTarget);
            engine.clear(this.clearColor, true, true, true);
            engine.unBindFramebuffer(this.texture.renderTarget);
        }
        if (this._finalPostProcess?.inputTexture) {
            const engine = this._scene.getEngine();
            engine.bindFramebuffer(this._finalPostProcess?.inputTexture);
            engine.clear(this.clearColor, true, true, true);
            engine.unBindFramebuffer(this._finalPostProcess?.inputTexture);
        }
    }
    /**
     * Disposes of the resources
     */
    dispose() {
        if (this._textureCreatedInternally) {
            this.texture?.dispose();
            this._textureCreatedInternally = false;
        }
        this._configureUserCreatedTexture = true;
        this._maskTexture?.dispose();
        this._maskTexture = null;
        this._finalPostProcess?.dispose();
        this._finalPostProcess = null;
        this._isDisposed = true;
    }
    _configureUserCreatedRTT() {
        this._configureUserCreatedTexture = false;
        if (this.texture && MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture)) {
            this.texture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetShader(this._scene, this._shaderLanguage));
            this.texture.onClearObservable.add(() => { });
            this.texture.renderList = [this._mesh];
            if (this._options.uvEdgeBlending) {
                this._createMaskTexture();
                this._createPostProcess();
                this.texture.addPostProcess(this._finalPostProcess);
            }
        }
    }
    _createDiffuseRTT() {
        this._textureCreatedInternally = true;
        const texture = this._createRenderTargetTexture(this._options.width, this._options.height);
        texture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetShader(this._scene, this._shaderLanguage));
        this.texture = texture;
        this._configureUserCreatedTexture = false;
        if (this._options.uvEdgeBlending) {
            this._createMaskTexture();
            this._createPostProcess();
            texture.addPostProcess(this._finalPostProcess);
        }
    }
    _createMaskTexture() {
        if (this._maskTexture) {
            return;
        }
        this._maskTexture = new Textures_renderTargetTexture/* RenderTargetTexture */.$(this._mesh.name + "_maskTexture", { width: this._options.width, height: this._options.height }, this._scene, false, // No mipmaps for the mask texture
        true, 0, false, 2, undefined, undefined, undefined, 6);
        this._maskTexture.clearColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
        // Render the mesh with the mask material to the mask texture
        this._maskTexture.renderList.push(this._mesh);
        this._maskTexture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetMaskShader(this._scene, this._shaderLanguage));
        // Ensure the mask texture is updated
        this._maskTexture.refreshRate = Textures_renderTargetTexture/* RenderTargetTexture */.$.REFRESHRATE_RENDER_ONCE;
        this._scene.customRenderTargets.push(this._maskTexture);
    }
    _createPostProcess() {
        if (this._finalPostProcess) {
            return;
        }
        this._finalPostProcess = new PostProcesses_postProcess/* PostProcess */.w(this._mesh.name + "_fixSeamsPostProcess", "meshUVSpaceRendererFinaliser", ["textureSize"], ["textureSampler", "maskTextureSampler"], 1.0, null, 1, this._scene.getEngine(), false, null, this._options.textureType, undefined, undefined, undefined, undefined, this._shaderLanguage);
        this._finalPostProcess.onApplyObservable.add((effect) => {
            effect.setTexture("maskTextureSampler", this._maskTexture);
            effect.setFloat2("textureSize", this._options.width, this._options.height);
        });
    }
    _createRenderTargetTexture(width, height) {
        const rtt = new Textures_renderTargetTexture/* RenderTargetTexture */.$(this._mesh.name + "_uvspaceTexture", { width, height }, this._scene, this._options.generateMipMaps, true, this._options.textureType, false, this._options.generateMipMaps ? 3 : 2, false, false, false, 5);
        rtt.renderParticles = false;
        rtt.optimizeUVAllocation = !!this._options.optimizeUVAllocation;
        rtt.onClearObservable.addOnce(() => {
            this._scene.getEngine().clear(this.clearColor, true, true, true);
            rtt.onClearObservable.add(() => { }); // this disables clearing the texture for the next frames
        });
        rtt.renderList = [this._mesh];
        return rtt;
    }
    _createProjectionMatrix(position, normal, size, angle = 0) {
        const yaw = -Math.atan2(normal.z, normal.x) - Math.PI / 2;
        const len = Math.sqrt(normal.x * normal.x + normal.z * normal.z);
        const pitch = Math.atan2(normal.y, len);
        const p = position.add(normal.scale(size.z * 0.5));
        const projWorldMatrix = math_vector/* Matrix */.uq.RotationYawPitchRoll(yaw, pitch, angle).multiply(math_vector/* Matrix */.uq.Translation(p.x, p.y, p.z));
        const inverseProjWorldMatrix = math_vector/* Matrix */.uq.Invert(projWorldMatrix);
        const projMatrix = math_vector/* Matrix */.uq.FromArray([2 / size.x, 0, 0, 0, 0, 2 / size.y, 0, 0, 0, 0, 1 / size.z, 0, 0, 0, 0, 1]);
        const screenMatrix = math_vector/* Matrix */.uq.FromArray([0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0.5, 0.5, 0.0, 1]);
        return inverseProjWorldMatrix.multiply(projMatrix).multiply(screenMatrix);
    }
}
//# sourceMappingURL=meshUVSpaceRenderer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/groundMesh.js
var groundMesh = __webpack_require__(11420);
;// ./node_modules/@babylonjs/core/Meshes/trailMesh.js






Meshes_mesh/* Mesh */.e._TrailMeshParser = (parsedMesh, scene) => {
    return TrailMesh.Parse(parsedMesh, scene);
};
/**
 * Class used to create a trail following a mesh
 */
class TrailMesh extends Meshes_mesh/* Mesh */.e {
    /** @internal */
    constructor(name, generator, scene, diameterOrOptions, length = 60, autoStart = true) {
        super(name, scene);
        this._sectionPolygonPointsCount = 4;
        this._running = false;
        this._generator = generator;
        if (typeof diameterOrOptions === "object" && diameterOrOptions !== null) {
            this.diameter = diameterOrOptions.diameter || 1;
            this._length = diameterOrOptions.length || 60;
            this._segments = diameterOrOptions.segments ? (diameterOrOptions.segments > this._length ? this._length : diameterOrOptions.segments) : this._length;
            this._sectionPolygonPointsCount = diameterOrOptions.sections || 4;
            this._doNotTaper = diameterOrOptions.doNotTaper || false;
            this._autoStart = diameterOrOptions.autoStart || true;
        }
        else {
            this.diameter = diameterOrOptions || 1;
            this._length = length;
            this._segments = this._length;
            this._doNotTaper = false;
            this._autoStart = autoStart;
        }
        this._sectionVectors = [];
        this._sectionNormalVectors = [];
        for (let i = 0; i <= this._sectionPolygonPointsCount; i++) {
            this._sectionVectors[i] = math_vector/* Vector3 */.Pq.Zero();
            this._sectionNormalVectors[i] = math_vector/* Vector3 */.Pq.Zero();
        }
        this._createMesh();
    }
    /**
     * "TrailMesh"
     * @returns "TrailMesh"
     */
    getClassName() {
        return "TrailMesh";
    }
    _createMesh() {
        const data = new mesh_vertexData/* VertexData */.P();
        const positions = [];
        const normals = [];
        const indices = [];
        const uvs = [];
        let meshCenter = math_vector/* Vector3 */.Pq.Zero();
        if (this._generator instanceof abstractMesh/* AbstractMesh */.u && this._generator.hasBoundingInfo) {
            meshCenter = this._generator.getBoundingInfo().boundingBox.centerWorld;
        }
        else {
            meshCenter = this._generator.absolutePosition;
        }
        const alpha = (2 * Math.PI) / this._sectionPolygonPointsCount;
        for (let i = 0; i <= this._sectionPolygonPointsCount; i++) {
            const angle = i !== this._sectionPolygonPointsCount ? i * alpha : 0;
            positions.push(meshCenter.x + Math.cos(angle) * this.diameter, meshCenter.y + Math.sin(angle) * this.diameter, meshCenter.z);
            uvs.push(i / this._sectionPolygonPointsCount, 0);
        }
        for (let i = 1; i <= this._segments; i++) {
            for (let j = 0; j <= this._sectionPolygonPointsCount; j++) {
                const angle = j !== this._sectionPolygonPointsCount ? j * alpha : 0;
                positions.push(meshCenter.x + Math.cos(angle) * this.diameter, meshCenter.y + Math.sin(angle) * this.diameter, meshCenter.z);
                uvs.push(j / this._sectionPolygonPointsCount, i / this._segments);
            }
            const l = positions.length / 3 - 2 * (this._sectionPolygonPointsCount + 1);
            for (let j = 0; j <= this._sectionPolygonPointsCount; j++) {
                indices.push(l + j, l + j + this._sectionPolygonPointsCount, l + j + this._sectionPolygonPointsCount + 1);
                indices.push(l + j, l + j + this._sectionPolygonPointsCount + 1, l + j + 1);
            }
        }
        mesh_vertexData/* VertexData */.P.ComputeNormals(positions, indices, normals);
        data.positions = positions;
        data.normals = normals;
        data.indices = indices;
        data.uvs = uvs;
        data.applyToMesh(this, true);
        if (this._autoStart) {
            this.start();
        }
    }
    _updateSectionVectors() {
        const wm = this._generator.getWorldMatrix();
        const alpha = (2 * Math.PI) / this._sectionPolygonPointsCount;
        for (let i = 0; i <= this._sectionPolygonPointsCount; i++) {
            const angle = i !== this._sectionPolygonPointsCount ? i * alpha : 0;
            this._sectionVectors[i].copyFromFloats(Math.cos(angle) * this.diameter, Math.sin(angle) * this.diameter, 0);
            this._sectionNormalVectors[i].copyFromFloats(Math.cos(angle), Math.sin(angle), 0);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._sectionVectors[i], wm, this._sectionVectors[i]);
            math_vector/* Vector3 */.Pq.TransformNormalToRef(this._sectionNormalVectors[i], wm, this._sectionNormalVectors[i]);
        }
    }
    /**
     * Start trailing mesh.
     */
    start() {
        if (!this._running) {
            this._running = true;
            this._beforeRenderObserver = this.getScene().onBeforeRenderObservable.add(() => {
                this.update();
            });
        }
    }
    /**
     * Stop trailing mesh.
     */
    stop() {
        if (this._beforeRenderObserver && this._running) {
            this._running = false;
            this.getScene().onBeforeRenderObservable.remove(this._beforeRenderObserver);
        }
    }
    /**
     * Update trailing mesh geometry.
     */
    update() {
        const positions = this.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const normals = this.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
        const index = 3 * (this._sectionPolygonPointsCount + 1);
        if (positions && normals) {
            if (this._doNotTaper) {
                for (let i = index; i < positions.length; i++) {
                    positions[i - index] = (0,math_scalar_functions.Lerp)(positions[i - index], positions[i], this._segments / this._length);
                }
            }
            else {
                for (let i = index; i < positions.length; i++) {
                    positions[i - index] = (0,math_scalar_functions.Lerp)(positions[i - index], positions[i], this._segments / this._length) - (normals[i] / this._length) * this.diameter;
                }
            }
            for (let i = index; i < normals.length; i++) {
                normals[i - index] = (0,math_scalar_functions.Lerp)(normals[i - index], normals[i], this._segments / this._length);
            }
            this._updateSectionVectors();
            const l = positions.length - 3 * (this._sectionPolygonPointsCount + 1);
            for (let i = 0; i <= this._sectionPolygonPointsCount; i++) {
                positions[l + 3 * i] = this._sectionVectors[i].x;
                positions[l + 3 * i + 1] = this._sectionVectors[i].y;
                positions[l + 3 * i + 2] = this._sectionVectors[i].z;
                normals[l + 3 * i] = this._sectionNormalVectors[i].x;
                normals[l + 3 * i + 1] = this._sectionNormalVectors[i].y;
                normals[l + 3 * i + 2] = this._sectionNormalVectors[i].z;
            }
            this.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, positions, true, false);
            this.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind, normals, true, false);
        }
    }
    /**
     * Reset trailing mesh geometry.
     */
    reset() {
        const positions = this.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const normals = this.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
        if (positions && normals) {
            this._updateSectionVectors();
            for (let i = 0; i <= this._segments; i++) {
                const l = 3 * i * (this._sectionPolygonPointsCount + 1);
                for (let j = 0; j <= this._sectionPolygonPointsCount; j++) {
                    positions[l + 3 * j] = this._sectionVectors[j].x;
                    positions[l + 3 * j + 1] = this._sectionVectors[j].y;
                    positions[l + 3 * j + 2] = this._sectionVectors[j].z;
                    normals[l + 3 * j] = this._sectionNormalVectors[j].x;
                    normals[l + 3 * j + 1] = this._sectionNormalVectors[j].y;
                    normals[l + 3 * j + 2] = this._sectionNormalVectors[j].z;
                }
            }
            this.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, positions, true, false);
            this.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind, normals, true, false);
        }
    }
    /**
     * Returns a new TrailMesh object.
     * @param name is a string, the name given to the new mesh
     * @param newGenerator use new generator object for cloned trail mesh
     * @returns a new mesh
     */
    clone(name = "", newGenerator) {
        const options = {
            diameter: this.diameter,
            length: this._length,
            segments: this._segments,
            sections: this._sectionPolygonPointsCount,
            doNotTaper: this._doNotTaper,
            autoStart: this._autoStart,
        };
        return new TrailMesh(name, newGenerator ?? this._generator, this.getScene(), options);
    }
    /**
     * Serializes this trail mesh
     * @param serializationObject object to write serialization to
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.generatorId = this._generator.id;
    }
    /**
     * Parses a serialized trail mesh
     * @param parsedMesh the serialized mesh
     * @param scene the scene to create the trail mesh in
     * @returns the created trail mesh
     */
    static Parse(parsedMesh, scene) {
        const generator = scene.getLastMeshById(parsedMesh.generatorId) ?? scene.getLastTransformNodeById(parsedMesh.generatorId);
        if (!generator) {
            throw new Error("TrailMesh: generator not found with ID " + parsedMesh.generatorId);
        }
        const options = {
            diameter: parsedMesh.diameter ?? parsedMesh._diameter,
            length: parsedMesh._length,
            segments: parsedMesh._segments,
            sections: parsedMesh._sectionPolygonPointsCount,
            doNotTaper: parsedMesh._doNotTaper,
            autoStart: parsedMesh._autoStart,
        };
        return new TrailMesh(parsedMesh.name, generator, scene, options);
    }
}
//# sourceMappingURL=trailMesh.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/instancedMesh.js
var instancedMesh = __webpack_require__(61440);
;// ./node_modules/@babylonjs/core/Meshes/meshSimplification.js






/**
 * Class used to specify simplification options
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/simplifyingMeshes
 */
class SimplificationSettings {
    /**
     * Creates a SimplificationSettings
     * @param quality expected quality
     * @param distance distance when this optimized version should be used
     * @param optimizeMesh already optimized mesh
     */
    constructor(
    /** expected quality */
    quality, 
    /** distance when this optimized version should be used */
    distance, 
    /** already optimized mesh  */
    optimizeMesh) {
        this.quality = quality;
        this.distance = distance;
        this.optimizeMesh = optimizeMesh;
    }
}
/**
 * Queue used to order the simplification tasks
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/simplifyingMeshes
 */
class SimplificationQueue {
    /**
     * Creates a new queue
     */
    constructor() {
        this.running = false;
        this._simplificationArray = [];
    }
    /**
     * Adds a new simplification task
     * @param task defines a task to add
     */
    addTask(task) {
        this._simplificationArray.push(task);
    }
    /**
     * Execute next task
     */
    executeNext() {
        const task = this._simplificationArray.pop();
        if (task) {
            this.running = true;
            this.runSimplification(task);
        }
        else {
            this.running = false;
        }
    }
    /**
     * Execute a simplification task
     * @param task defines the task to run
     */
    runSimplification(task) {
        if (task.parallelProcessing) {
            //parallel simplifier
            task.settings.forEach((setting) => {
                const simplifier = this._getSimplifier(task);
                simplifier.simplify(setting, (newMesh) => {
                    if (setting.distance !== undefined) {
                        task.mesh.addLODLevel(setting.distance, newMesh);
                    }
                    newMesh.isVisible = true;
                    //check if it is the last
                    if (setting.quality === task.settings[task.settings.length - 1].quality && task.successCallback) {
                        //all done, run the success callback.
                        task.successCallback();
                    }
                    this.executeNext();
                });
            });
        }
        else {
            //single simplifier.
            const simplifier = this._getSimplifier(task);
            const runDecimation = (setting, callback) => {
                simplifier.simplify(setting, (newMesh) => {
                    if (setting.distance !== undefined) {
                        task.mesh.addLODLevel(setting.distance, newMesh);
                    }
                    newMesh.isVisible = true;
                    //run the next quality level
                    callback();
                });
            };
            tools/* AsyncLoop */.LV.Run(task.settings.length, (loop) => {
                runDecimation(task.settings[loop.index], () => {
                    loop.executeNext();
                });
            }, () => {
                //execution ended, run the success callback.
                if (task.successCallback) {
                    task.successCallback();
                }
                this.executeNext();
            });
        }
    }
    _getSimplifier(task) {
        switch (task.simplificationType) {
            case 0 /* SimplificationType.QUADRATIC */:
            default:
                return new QuadraticErrorSimplification(task.mesh);
        }
    }
}
/**
 * The implemented types of simplification
 * At the moment only Quadratic Error Decimation is implemented
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/simplifyingMeshes
 */
var SimplificationType;
(function (SimplificationType) {
    /** Quadratic error decimation */
    SimplificationType[SimplificationType["QUADRATIC"] = 0] = "QUADRATIC";
})(SimplificationType || (SimplificationType = {}));
class DecimationTriangle {
    constructor(_vertices) {
        this._vertices = _vertices;
        this.error = new Array(4);
        this.deleted = false;
        this.isDirty = false;
        this.deletePending = false;
        this.borderFactor = 0;
    }
}
class DecimationVertex {
    constructor(position, id) {
        this.position = position;
        this.id = id;
        this.isBorder = true;
        this.q = new QuadraticMatrix();
        this.triangleCount = 0;
        this.triangleStart = 0;
        this.originalOffsets = [];
    }
    updatePosition(newPosition) {
        this.position.copyFrom(newPosition);
    }
}
class QuadraticMatrix {
    constructor(data) {
        this.data = new Array(10);
        for (let i = 0; i < 10; ++i) {
            if (data && data[i]) {
                this.data[i] = data[i];
            }
            else {
                this.data[i] = 0;
            }
        }
    }
    det(a11, a12, a13, a21, a22, a23, a31, a32, a33) {
        const det = this.data[a11] * this.data[a22] * this.data[a33] +
            this.data[a13] * this.data[a21] * this.data[a32] +
            this.data[a12] * this.data[a23] * this.data[a31] -
            this.data[a13] * this.data[a22] * this.data[a31] -
            this.data[a11] * this.data[a23] * this.data[a32] -
            this.data[a12] * this.data[a21] * this.data[a33];
        return det;
    }
    addInPlace(matrix) {
        for (let i = 0; i < 10; ++i) {
            this.data[i] += matrix.data[i];
        }
    }
    addArrayInPlace(data) {
        for (let i = 0; i < 10; ++i) {
            this.data[i] += data[i];
        }
    }
    add(matrix) {
        const m = new QuadraticMatrix();
        for (let i = 0; i < 10; ++i) {
            m.data[i] = this.data[i] + matrix.data[i];
        }
        return m;
    }
    static FromData(a, b, c, d) {
        return new QuadraticMatrix(QuadraticMatrix.DataFromNumbers(a, b, c, d));
    }
    //returning an array to avoid garbage collection
    static DataFromNumbers(a, b, c, d) {
        return [a * a, a * b, a * c, a * d, b * b, b * c, b * d, c * c, c * d, d * d];
    }
}
class Reference {
    constructor(vertexId, triangleId) {
        this.vertexId = vertexId;
        this.triangleId = triangleId;
    }
}
/**
 * An implementation of the Quadratic Error simplification algorithm.
 * Original paper : http://www1.cs.columbia.edu/~cs4162/html05s/garland97.pdf
 * Ported mostly from QSlim and http://voxels.blogspot.de/2014/05/quadric-mesh-simplification-with-source.html to babylon JS
 * @author RaananW
 * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/simplifyingMeshes
 */
class QuadraticErrorSimplification {
    /**
     * Creates a new QuadraticErrorSimplification
     * @param _mesh defines the target mesh
     */
    constructor(_mesh) {
        this._mesh = _mesh;
        /** Gets or sets the number pf sync iterations */
        this.syncIterations = 5000;
        this.aggressiveness = 7;
        this.decimationIterations = 100;
        this.boundingBoxEpsilon = math_constants/* Epsilon */.bH;
    }
    /**
     * Simplification of a given mesh according to the given settings.
     * Since this requires computation, it is assumed that the function runs async.
     * @param settings The settings of the simplification, including quality and distance
     * @param successCallback A callback that will be called after the mesh was simplified.
     */
    simplify(settings, successCallback) {
        this._initDecimatedMesh();
        //iterating through the submeshes array, one after the other.
        tools/* AsyncLoop */.LV.Run(this._mesh.subMeshes.length, (loop) => {
            this._initWithMesh(loop.index, () => {
                this._runDecimation(settings, loop.index, () => {
                    loop.executeNext();
                });
            }, settings.optimizeMesh);
        }, () => {
            setTimeout(() => {
                successCallback(this._reconstructedMesh);
            }, 0);
        });
    }
    _runDecimation(settings, submeshIndex, successCallback) {
        const targetCount = ~~(this._triangles.length * settings.quality);
        let deletedTriangles = 0;
        const triangleCount = this._triangles.length;
        const iterationFunction = (iteration, callback) => {
            setTimeout(() => {
                if (iteration % 5 === 0) {
                    this._updateMesh(iteration === 0);
                }
                for (let i = 0; i < this._triangles.length; ++i) {
                    this._triangles[i].isDirty = false;
                }
                const threshold = 0.000000001 * Math.pow(iteration + 3, this.aggressiveness);
                const trianglesIterator = (i) => {
                    const tIdx = ~~((this._triangles.length / 2 + i) % this._triangles.length);
                    const t = this._triangles[tIdx];
                    if (!t) {
                        return;
                    }
                    if (t.error[3] > threshold || t.deleted || t.isDirty) {
                        return;
                    }
                    for (let j = 0; j < 3; ++j) {
                        if (t.error[j] < threshold) {
                            const deleted0 = [];
                            const deleted1 = [];
                            const v0 = t._vertices[j];
                            const v1 = t._vertices[(j + 1) % 3];
                            if (v0.isBorder || v1.isBorder) {
                                continue;
                            }
                            const p = math_vector/* Vector3 */.Pq.Zero();
                            // var n = Vector3.Zero();
                            // var uv = Vector2.Zero();
                            // var color = new Color4(0, 0, 0, 1);
                            this._calculateError(v0, v1, p);
                            const delTr = [];
                            if (this._isFlipped(v0, v1, p, deleted0, delTr)) {
                                continue;
                            }
                            if (this._isFlipped(v1, v0, p, deleted1, delTr)) {
                                continue;
                            }
                            if (deleted0.indexOf(true) < 0 || deleted1.indexOf(true) < 0) {
                                continue;
                            }
                            const uniqueArray = [];
                            delTr.forEach((deletedT) => {
                                if (uniqueArray.indexOf(deletedT) === -1) {
                                    deletedT.deletePending = true;
                                    uniqueArray.push(deletedT);
                                }
                            });
                            if (uniqueArray.length % 2 !== 0) {
                                continue;
                            }
                            v0.q = v1.q.add(v0.q);
                            v0.updatePosition(p);
                            const tStart = this._references.length;
                            deletedTriangles = this._updateTriangles(v0, v0, deleted0, deletedTriangles);
                            deletedTriangles = this._updateTriangles(v0, v1, deleted1, deletedTriangles);
                            const tCount = this._references.length - tStart;
                            if (tCount <= v0.triangleCount) {
                                if (tCount) {
                                    for (let c = 0; c < tCount; c++) {
                                        this._references[v0.triangleStart + c] = this._references[tStart + c];
                                    }
                                }
                            }
                            else {
                                v0.triangleStart = tStart;
                            }
                            v0.triangleCount = tCount;
                            break;
                        }
                    }
                };
                tools/* AsyncLoop */.LV.SyncAsyncForLoop(this._triangles.length, this.syncIterations, trianglesIterator, callback, () => {
                    return triangleCount - deletedTriangles <= targetCount;
                });
            }, 0);
        };
        tools/* AsyncLoop */.LV.Run(this.decimationIterations, (loop) => {
            if (triangleCount - deletedTriangles <= targetCount) {
                loop.breakLoop();
            }
            else {
                iterationFunction(loop.index, () => {
                    loop.executeNext();
                });
            }
        }, () => {
            setTimeout(() => {
                //reconstruct this part of the mesh
                this._reconstructMesh(submeshIndex);
                successCallback();
            }, 0);
        });
    }
    _initWithMesh(submeshIndex, callback, optimizeMesh) {
        this._vertices = [];
        this._triangles = [];
        const positionData = this._mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const indices = this._mesh.getIndices();
        const submesh = this._mesh.subMeshes[submeshIndex];
        const findInVertices = (positionToSearch) => {
            if (optimizeMesh) {
                for (let ii = 0; ii < this._vertices.length; ++ii) {
                    if (this._vertices[ii].position.equalsWithEpsilon(positionToSearch, 0.0001)) {
                        return this._vertices[ii];
                    }
                }
            }
            return null;
        };
        const vertexReferences = [];
        const vertexInit = (i) => {
            if (!positionData) {
                return;
            }
            const offset = i + submesh.verticesStart;
            const position = math_vector/* Vector3 */.Pq.FromArray(positionData, offset * 3);
            const vertex = findInVertices(position) || new DecimationVertex(position, this._vertices.length);
            vertex.originalOffsets.push(offset);
            if (vertex.id === this._vertices.length) {
                this._vertices.push(vertex);
            }
            vertexReferences.push(vertex.id);
        };
        //var totalVertices = mesh.getTotalVertices();
        const totalVertices = submesh.verticesCount;
        tools/* AsyncLoop */.LV.SyncAsyncForLoop(totalVertices, (this.syncIterations / 4) >> 0, vertexInit, () => {
            const indicesInit = (i) => {
                if (!indices) {
                    return;
                }
                const offset = submesh.indexStart / 3 + i;
                const pos = offset * 3;
                const i0 = indices[pos + 0];
                const i1 = indices[pos + 1];
                const i2 = indices[pos + 2];
                const v0 = this._vertices[vertexReferences[i0 - submesh.verticesStart]];
                const v1 = this._vertices[vertexReferences[i1 - submesh.verticesStart]];
                const v2 = this._vertices[vertexReferences[i2 - submesh.verticesStart]];
                const triangle = new DecimationTriangle([v0, v1, v2]);
                triangle.originalOffset = pos;
                this._triangles.push(triangle);
            };
            tools/* AsyncLoop */.LV.SyncAsyncForLoop(submesh.indexCount / 3, this.syncIterations, indicesInit, () => {
                this._init(callback);
            });
        });
    }
    _init(callback) {
        const triangleInit1 = (i) => {
            const t = this._triangles[i];
            t.normal = math_vector/* Vector3 */.Pq.Cross(t._vertices[1].position.subtract(t._vertices[0].position), t._vertices[2].position.subtract(t._vertices[0].position)).normalize();
            for (let j = 0; j < 3; j++) {
                t._vertices[j].q.addArrayInPlace(QuadraticMatrix.DataFromNumbers(t.normal.x, t.normal.y, t.normal.z, -math_vector/* Vector3 */.Pq.Dot(t.normal, t._vertices[0].position)));
            }
        };
        tools/* AsyncLoop */.LV.SyncAsyncForLoop(this._triangles.length, this.syncIterations, triangleInit1, () => {
            const triangleInit2 = (i) => {
                const t = this._triangles[i];
                for (let j = 0; j < 3; ++j) {
                    t.error[j] = this._calculateError(t._vertices[j], t._vertices[(j + 1) % 3]);
                }
                t.error[3] = Math.min(t.error[0], t.error[1], t.error[2]);
            };
            tools/* AsyncLoop */.LV.SyncAsyncForLoop(this._triangles.length, this.syncIterations, triangleInit2, () => {
                callback();
            });
        });
    }
    _reconstructMesh(submeshIndex) {
        const newTriangles = [];
        let i;
        for (i = 0; i < this._vertices.length; ++i) {
            this._vertices[i].triangleCount = 0;
        }
        let t;
        let j;
        for (i = 0; i < this._triangles.length; ++i) {
            if (!this._triangles[i].deleted) {
                t = this._triangles[i];
                for (j = 0; j < 3; ++j) {
                    t._vertices[j].triangleCount = 1;
                }
                newTriangles.push(t);
            }
        }
        const newPositionData = (this._reconstructedMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind) || []);
        const newNormalData = (this._reconstructedMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind) || []);
        const newUVsData = (this._reconstructedMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind) || []);
        const newColorsData = (this._reconstructedMesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind) || []);
        const normalData = this._mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
        const uvs = this._mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind);
        const colorsData = this._mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind);
        let vertexCount = 0;
        for (i = 0; i < this._vertices.length; ++i) {
            const vertex = this._vertices[i];
            vertex.id = vertexCount;
            if (vertex.triangleCount) {
                vertex.originalOffsets.forEach((originalOffset) => {
                    newPositionData.push(vertex.position.x);
                    newPositionData.push(vertex.position.y);
                    newPositionData.push(vertex.position.z);
                    if (normalData && normalData.length) {
                        newNormalData.push(normalData[originalOffset * 3]);
                        newNormalData.push(normalData[originalOffset * 3 + 1]);
                        newNormalData.push(normalData[originalOffset * 3 + 2]);
                    }
                    if (uvs && uvs.length) {
                        newUVsData.push(uvs[originalOffset * 2]);
                        newUVsData.push(uvs[originalOffset * 2 + 1]);
                    }
                    if (colorsData && colorsData.length) {
                        newColorsData.push(colorsData[originalOffset * 4]);
                        newColorsData.push(colorsData[originalOffset * 4 + 1]);
                        newColorsData.push(colorsData[originalOffset * 4 + 2]);
                        newColorsData.push(colorsData[originalOffset * 4 + 3]);
                    }
                    ++vertexCount;
                });
            }
        }
        const startingIndex = this._reconstructedMesh.getTotalIndices();
        const startingVertex = this._reconstructedMesh.getTotalVertices();
        const submeshesArray = this._reconstructedMesh.subMeshes;
        this._reconstructedMesh.subMeshes = [];
        const newIndicesArray = this._reconstructedMesh.getIndices(); //[];
        const originalIndices = this._mesh.getIndices();
        for (i = 0; i < newTriangles.length; ++i) {
            t = newTriangles[i]; //now get the new referencing point for each vertex
            [0, 1, 2].forEach((idx) => {
                const id = originalIndices[t.originalOffset + idx];
                let offset = t._vertices[idx].originalOffsets.indexOf(id);
                if (offset < 0) {
                    offset = 0;
                }
                newIndicesArray.push(t._vertices[idx].id + offset + startingVertex);
            });
        }
        //overwriting the old vertex buffers and indices.
        this._reconstructedMesh.setIndices(newIndicesArray);
        this._reconstructedMesh.setVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, newPositionData);
        if (newNormalData.length > 0) {
            this._reconstructedMesh.setVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind, newNormalData);
        }
        if (newUVsData.length > 0) {
            this._reconstructedMesh.setVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind, newUVsData);
        }
        if (newColorsData.length > 0) {
            this._reconstructedMesh.setVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind, newColorsData);
        }
        //create submesh
        const originalSubmesh = this._mesh.subMeshes[submeshIndex];
        if (submeshIndex > 0) {
            this._reconstructedMesh.subMeshes = [];
            submeshesArray.forEach((submesh) => {
                subMesh/* SubMesh */.K.AddToMesh(submesh.materialIndex, submesh.verticesStart, submesh.verticesCount, 
                /* 0, newPositionData.length/3, */ submesh.indexStart, submesh.indexCount, submesh.getMesh());
            });
            subMesh/* SubMesh */.K.AddToMesh(originalSubmesh.materialIndex, startingVertex, vertexCount, 
            /* 0, newPositionData.length / 3, */ startingIndex, newTriangles.length * 3, this._reconstructedMesh);
        }
    }
    _initDecimatedMesh() {
        this._reconstructedMesh = new Meshes_mesh/* Mesh */.e(this._mesh.name + "Decimated", this._mesh.getScene());
        this._reconstructedMesh.material = this._mesh.material;
        this._reconstructedMesh.parent = this._mesh.parent;
        this._reconstructedMesh.isVisible = false;
        this._reconstructedMesh.renderingGroupId = this._mesh.renderingGroupId;
    }
    _isFlipped(vertex1, vertex2, point, deletedArray, delTr) {
        for (let i = 0; i < vertex1.triangleCount; ++i) {
            const t = this._triangles[this._references[vertex1.triangleStart + i].triangleId];
            if (t.deleted) {
                continue;
            }
            const s = this._references[vertex1.triangleStart + i].vertexId;
            const v1 = t._vertices[(s + 1) % 3];
            const v2 = t._vertices[(s + 2) % 3];
            if (v1 === vertex2 || v2 === vertex2) {
                deletedArray[i] = true;
                delTr.push(t);
                continue;
            }
            let d1 = v1.position.subtract(point);
            d1 = d1.normalize();
            let d2 = v2.position.subtract(point);
            d2 = d2.normalize();
            if (Math.abs(math_vector/* Vector3 */.Pq.Dot(d1, d2)) > 0.999) {
                return true;
            }
            const normal = math_vector/* Vector3 */.Pq.Cross(d1, d2).normalize();
            deletedArray[i] = false;
            if (math_vector/* Vector3 */.Pq.Dot(normal, t.normal) < 0.2) {
                return true;
            }
        }
        return false;
    }
    _updateTriangles(origVertex, vertex, deletedArray, deletedTriangles) {
        let newDeleted = deletedTriangles;
        for (let i = 0; i < vertex.triangleCount; ++i) {
            const ref = this._references[vertex.triangleStart + i];
            const t = this._triangles[ref.triangleId];
            if (t.deleted) {
                continue;
            }
            if (deletedArray[i] && t.deletePending) {
                t.deleted = true;
                newDeleted++;
                continue;
            }
            t._vertices[ref.vertexId] = origVertex;
            t.isDirty = true;
            t.error[0] = this._calculateError(t._vertices[0], t._vertices[1]) + t.borderFactor / 2;
            t.error[1] = this._calculateError(t._vertices[1], t._vertices[2]) + t.borderFactor / 2;
            t.error[2] = this._calculateError(t._vertices[2], t._vertices[0]) + t.borderFactor / 2;
            t.error[3] = Math.min(t.error[0], t.error[1], t.error[2]);
            this._references.push(ref);
        }
        return newDeleted;
    }
    _identifyBorder() {
        for (let i = 0; i < this._vertices.length; ++i) {
            const vCount = [];
            const vId = [];
            const v = this._vertices[i];
            let j;
            for (j = 0; j < v.triangleCount; ++j) {
                const triangle = this._triangles[this._references[v.triangleStart + j].triangleId];
                for (let ii = 0; ii < 3; ii++) {
                    let ofs = 0;
                    const vv = triangle._vertices[ii];
                    while (ofs < vCount.length) {
                        if (vId[ofs] === vv.id) {
                            break;
                        }
                        ++ofs;
                    }
                    if (ofs === vCount.length) {
                        vCount.push(1);
                        vId.push(vv.id);
                    }
                    else {
                        vCount[ofs]++;
                    }
                }
            }
            for (j = 0; j < vCount.length; ++j) {
                if (vCount[j] === 1) {
                    this._vertices[vId[j]].isBorder = true;
                }
                else {
                    this._vertices[vId[j]].isBorder = false;
                }
            }
        }
    }
    _updateMesh(identifyBorders = false) {
        let i;
        if (!identifyBorders) {
            const newTrianglesVector = [];
            for (i = 0; i < this._triangles.length; ++i) {
                if (!this._triangles[i].deleted) {
                    newTrianglesVector.push(this._triangles[i]);
                }
            }
            this._triangles = newTrianglesVector;
        }
        for (i = 0; i < this._vertices.length; ++i) {
            this._vertices[i].triangleCount = 0;
            this._vertices[i].triangleStart = 0;
        }
        let t;
        let j;
        let v;
        for (i = 0; i < this._triangles.length; ++i) {
            t = this._triangles[i];
            for (j = 0; j < 3; ++j) {
                v = t._vertices[j];
                v.triangleCount++;
            }
        }
        let tStart = 0;
        for (i = 0; i < this._vertices.length; ++i) {
            this._vertices[i].triangleStart = tStart;
            tStart += this._vertices[i].triangleCount;
            this._vertices[i].triangleCount = 0;
        }
        const newReferences = new Array(this._triangles.length * 3);
        for (i = 0; i < this._triangles.length; ++i) {
            t = this._triangles[i];
            for (j = 0; j < 3; ++j) {
                v = t._vertices[j];
                newReferences[v.triangleStart + v.triangleCount] = new Reference(j, i);
                v.triangleCount++;
            }
        }
        this._references = newReferences;
        if (identifyBorders) {
            this._identifyBorder();
        }
    }
    _vertexError(q, point) {
        const x = point.x;
        const y = point.y;
        const z = point.z;
        return (q.data[0] * x * x +
            2 * q.data[1] * x * y +
            2 * q.data[2] * x * z +
            2 * q.data[3] * x +
            q.data[4] * y * y +
            2 * q.data[5] * y * z +
            2 * q.data[6] * y +
            q.data[7] * z * z +
            2 * q.data[8] * z +
            q.data[9]);
    }
    _calculateError(vertex1, vertex2, pointResult) {
        const q = vertex1.q.add(vertex2.q);
        const border = vertex1.isBorder && vertex2.isBorder;
        let error = 0;
        const qDet = q.det(0, 1, 2, 1, 4, 5, 2, 5, 7);
        if (qDet !== 0 && !border) {
            if (!pointResult) {
                pointResult = math_vector/* Vector3 */.Pq.Zero();
            }
            pointResult.x = (-1 / qDet) * q.det(1, 2, 3, 4, 5, 6, 5, 7, 8);
            pointResult.y = (1 / qDet) * q.det(0, 2, 3, 1, 5, 6, 2, 7, 8);
            pointResult.z = (-1 / qDet) * q.det(0, 1, 3, 1, 4, 6, 2, 5, 8);
            error = this._vertexError(q, pointResult);
        }
        else {
            const p3 = vertex1.position.add(vertex2.position).divide(new math_vector/* Vector3 */.Pq(2, 2, 2));
            //var norm3 = (vertex1.normal.add(vertex2.normal)).divide(new Vector3(2, 2, 2)).normalize();
            const error1 = this._vertexError(q, vertex1.position);
            const error2 = this._vertexError(q, vertex2.position);
            const error3 = this._vertexError(q, p3);
            error = Math.min(error1, error2, error3);
            if (error === error1) {
                if (pointResult) {
                    pointResult.copyFrom(vertex1.position);
                }
            }
            else if (error === error2) {
                if (pointResult) {
                    pointResult.copyFrom(vertex2.position);
                }
            }
            else {
                if (pointResult) {
                    pointResult.copyFrom(p3);
                }
            }
        }
        return error;
    }
}
//# sourceMappingURL=meshSimplification.js.map
;// ./node_modules/@babylonjs/core/Meshes/meshSimplificationSceneComponent.js




Object.defineProperty(core_scene/* Scene */.Z.prototype, "simplificationQueue", {
    get: function () {
        if (!this._simplificationQueue) {
            this._simplificationQueue = new SimplificationQueue();
            let component = this._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_SIMPLIFICATIONQUEUE);
            if (!component) {
                component = new SimplicationQueueSceneComponent(this);
                this._addComponent(component);
            }
        }
        return this._simplificationQueue;
    },
    set: function (value) {
        this._simplificationQueue = value;
    },
    enumerable: true,
    configurable: true,
});
Meshes_mesh/* Mesh */.e.prototype.simplify = function (settings, parallelProcessing = true, simplificationType = 0 /* SimplificationType.QUADRATIC */, successCallback) {
    this.getScene().simplificationQueue.addTask({
        settings: settings,
        parallelProcessing: parallelProcessing,
        mesh: this,
        simplificationType: simplificationType,
        successCallback: successCallback,
    });
    return this;
};
/**
 * Defines the simplification queue scene component responsible to help scheduling the various simplification task
 * created in a scene
 */
class SimplicationQueueSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpfull to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_SIMPLIFICATIONQUEUE;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._beforeCameraUpdateStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE, this, this._beforeCameraUpdate);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do for this component
    }
    /**
     * Disposes the component and the associated resources
     */
    dispose() {
        // Nothing to do for this component
    }
    _beforeCameraUpdate() {
        if (this.scene._simplificationQueue && !this.scene._simplificationQueue.running) {
            this.scene._simplificationQueue.executeNext();
        }
    }
}
//# sourceMappingURL=meshSimplificationSceneComponent.js.map
;// ./node_modules/@babylonjs/core/Meshes/meshUtils.js


function getExtentCorners(extent) {
    const minX = extent.minimum.x;
    const minY = extent.minimum.y;
    const minZ = extent.minimum.z;
    const maxX = extent.maximum.x;
    const maxY = extent.maximum.y;
    const maxZ = extent.maximum.z;
    return [
        new math_vector/* Vector3 */.Pq(minX, minY, minZ),
        new math_vector/* Vector3 */.Pq(maxX, maxY, maxZ),
        new math_vector/* Vector3 */.Pq(maxX, minY, minZ),
        new math_vector/* Vector3 */.Pq(minX, maxY, minZ),
        new math_vector/* Vector3 */.Pq(minX, minY, maxZ),
        new math_vector/* Vector3 */.Pq(maxX, maxY, minZ),
        new math_vector/* Vector3 */.Pq(minX, maxY, maxZ),
        new math_vector/* Vector3 */.Pq(maxX, minY, maxZ),
    ];
}
/**
 * Computes the maximum extents of the given meshes considering animation, skeleton, and morph targets.
 * @param meshes The array of meshes to compute
 * @param animationGroup An optional animation group to animate (must be started to take effect)
 * @param animationStep An optional value indicating the number of seconds to step while looping through the given animation group
 * @returns An array of world space extents corresponding to the given meshes
 */
function computeMaxExtents(meshes, animationGroup = null, animationStep = 1 / 6) {
    // Local vector to avoid allocations.
    const position = math_vector/* TmpVectors */.AA.Vector3[0];
    const meshExtents = new Map();
    const skinnedMeshExtents = new Map();
    // Compute the non-skinned and skinned mesh extents.
    const maxLength = meshes.reduce((previous, current) => Math.max(previous, current.getTotalVertices()), 0);
    const minPositions = Array.from({ length: maxLength }, () => new math_vector/* Vector3 */.Pq());
    const maxPositions = Array.from({ length: maxLength }, () => new math_vector/* Vector3 */.Pq());
    for (const mesh of meshes) {
        const positions = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        if (!positions) {
            continue;
        }
        // Initialize min/max positions with the original positions.
        const numVertices = mesh.getTotalVertices();
        minPositions.length = Math.max(minPositions.length, numVertices);
        maxPositions.length = Math.max(minPositions.length, numVertices);
        for (let i = 0, j = 0; i < numVertices; i++, j += 3) {
            position.set(positions[j], positions[j + 1], positions[j + 2]);
            minPositions[i].copyFrom(position);
            maxPositions[i].copyFrom(position);
        }
        // Apply morph targets to the min/max positions.
        const morphTargetManager = mesh.morphTargetManager;
        if (morphTargetManager) {
            for (let targetIndex = 0; targetIndex < morphTargetManager.numTargets; ++targetIndex) {
                const target = morphTargetManager.getTarget(targetIndex);
                const positions = target.getPositions();
                if (positions) {
                    for (let i = 0, j = 0; i < numVertices; i++, j += 3) {
                        position.set(positions[j], positions[j + 1], positions[j + 2]);
                        minPositions[i].minimizeInPlace(position);
                        maxPositions[i].maximizeInPlace(position);
                    }
                }
            }
        }
        // Compute extent per mesh.
        const skeleton = mesh.skeleton;
        const weights = skeleton ? mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind) : null;
        const indices = skeleton ? mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind) : null;
        if (weights && indices) {
            // Compute extent per bone for skinned meshes.
            const needsExtra = mesh.numBoneInfluencers > 4;
            const weightsExtra = needsExtra ? mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind) : null;
            const indicesExtra = needsExtra ? mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind) : null;
            const perBoneExtents = skinnedMeshExtents.get(mesh.uniqueId) || new Map();
            skinnedMeshExtents.set(mesh.uniqueId, perBoneExtents);
            const updateExtents = (i, j, weights, indices) => {
                for (let k = j; k < j + 4; k++) {
                    if (weights[k] > 0) {
                        const boneIndex = indices[k];
                        const extent = perBoneExtents.get(boneIndex);
                        if (extent) {
                            extent.minimum.minimizeInPlace(minPositions[i]);
                            extent.maximum.maximizeInPlace(maxPositions[i]);
                        }
                        else {
                            perBoneExtents.set(boneIndex, {
                                minimum: minPositions[i].clone(),
                                maximum: maxPositions[i].clone(),
                            });
                        }
                    }
                }
            };
            for (let i = 0, j = 0; i < numVertices; i++, j += 4) {
                updateExtents(i, j, weights, indices);
                if (weightsExtra && indicesExtra) {
                    updateExtents(i, j, weightsExtra, indicesExtra);
                }
            }
        }
        else {
            // Compute extent for the whole mesh for non-skinned meshes.
            const extent = meshExtents.get(mesh.uniqueId) || {
                minimum: new math_vector/* Vector3 */.Pq().setAll(Number.POSITIVE_INFINITY),
                maximum: new math_vector/* Vector3 */.Pq().setAll(Number.NEGATIVE_INFINITY),
            };
            meshExtents.set(mesh.uniqueId, extent);
            for (let i = 0; i < numVertices; i++) {
                extent.minimum.minimizeInPlace(minPositions[i]);
                extent.maximum.maximizeInPlace(maxPositions[i]);
            }
        }
    }
    // Create the 8 corners of each non-skinned and skinned extent.
    const meshCorners = new Map();
    const skinnedMeshCorners = new Map();
    for (const mesh of meshes) {
        const extent = meshExtents.get(mesh.uniqueId);
        if (extent) {
            meshCorners.set(mesh.uniqueId, getExtentCorners(extent));
        }
        else {
            const perBoneExtents = skinnedMeshExtents.get(mesh.uniqueId);
            if (perBoneExtents) {
                const bones = mesh.skeleton.bones;
                const perBoneCorners = new Map();
                skinnedMeshCorners.set(mesh.uniqueId, perBoneCorners);
                perBoneExtents.forEach((extent, boneIndex) => {
                    const corners = getExtentCorners(extent);
                    // Transform the coordinates of the corners for skinned meshes to bone space.
                    const inverseBindMatrix = bones[boneIndex].getAbsoluteInverseBindMatrix();
                    for (const corner of corners) {
                        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(corner, inverseBindMatrix, corner);
                    }
                    perBoneCorners.set(boneIndex, corners);
                });
            }
        }
    }
    const maxExtents = Array.from({ length: meshes.length }, () => ({
        minimum: new math_vector/* Vector3 */.Pq().setAll(Number.POSITIVE_INFINITY),
        maximum: new math_vector/* Vector3 */.Pq().setAll(Number.NEGATIVE_INFINITY),
    }));
    const updateMaxExtents = () => {
        for (let i = 0; i < meshes.length; i++) {
            const mesh = meshes[i];
            const positions = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
            if (!positions) {
                continue;
            }
            const worldMatrix = mesh.computeWorldMatrix(true);
            const skeleton = mesh.skeleton;
            if (skeleton) {
                skeleton.prepare(true);
                const bones = skeleton.bones;
                const perBoneCorners = skinnedMeshCorners.get(mesh.uniqueId);
                perBoneCorners.forEach((corners, boneIndex) => {
                    // Transform the per-bone corners into world space and update the max extent for each corner.
                    for (const corner of corners) {
                        const matrix = bones[boneIndex].getFinalMatrix().multiplyToRef(worldMatrix, math_vector/* TmpVectors */.AA.Matrix[0]);
                        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(corner, matrix, position);
                        maxExtents[i].minimum.minimizeInPlace(position);
                        maxExtents[i].maximum.maximizeInPlace(position);
                    }
                });
            }
            else {
                // Transform the corners into world space and update the max extent for each corner.
                for (const corner of meshCorners.get(mesh.uniqueId)) {
                    math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(corner, worldMatrix, position);
                    maxExtents[i].minimum.minimizeInPlace(position);
                    maxExtents[i].maximum.maximizeInPlace(position);
                }
            }
        }
    };
    if (animationGroup && animationGroup.isStarted) {
        const currentFrame = animationGroup.getCurrentFrame();
        const step = animationStep / animationGroup.getLength(0, 1);
        for (let frame = animationGroup.from; frame <= animationGroup.to; frame += step) {
            animationGroup.goToFrame(frame);
            updateMaxExtents();
        }
        animationGroup.goToFrame(currentFrame);
    }
    else {
        updateMaxExtents();
    }
    return maxExtents;
}
//# sourceMappingURL=meshUtils.js.map
;// ./node_modules/@babylonjs/core/Meshes/lattice.js



/**
 * Class used to represent a lattice
 * #MDVD75#18 - Moving lattice bounds
 * #MDVD75#23 - Twist
 */
class Lattice {
    /**
     * @returns the string "Lattice"
     */
    getClassName() {
        return "Lattice";
    }
    /**
     * Gets the resolution on x axis
     */
    get resolutionX() {
        return this._resolutionX;
    }
    /**
     * Gets the resolution on y axis
     */
    get resolutionY() {
        return this._resolutionY;
    }
    /**
     * Gets the resolution on z axis
     */
    get resolutionZ() {
        return this._resolutionZ;
    }
    /**
     * Gets the size of the lattice along each axis in object space
     * Updating the size requires you to call update afterwards
     */
    get size() {
        return this._size;
    }
    /**
     * Gets the lattice position in object space
     */
    get position() {
        return this._position;
    }
    /**
     * Gets the data of the lattice
     */
    get data() {
        return this._data;
    }
    /**
     * Gets the size of each cell in the lattice
     */
    get cellSize() {
        return this._cellSize;
    }
    /**
     * Gets the min bounds of the lattice
     */
    get min() {
        return this._min;
    }
    /**
     * Gets the max bounds of the lattice
     */
    get max() {
        return this._max;
    }
    /**
     * Creates a new Lattice
     * @param options options for creating
     */
    constructor(options) {
        this._cellSize = new math_vector/* Vector3 */.Pq();
        // Cache
        this._min = new math_vector/* Vector3 */.Pq(-0.5, -0.5, -0.5);
        this._max = new math_vector/* Vector3 */.Pq(0.5, 0.5, 0.5);
        this._localPos = new math_vector/* Vector3 */.Pq();
        this._tmpVector = new math_vector/* Vector3 */.Pq();
        this._lerpVector0 = new math_vector/* Vector3 */.Pq();
        this._lerpVector1 = new math_vector/* Vector3 */.Pq();
        this._lerpVector2 = new math_vector/* Vector3 */.Pq();
        this._lerpVector3 = new math_vector/* Vector3 */.Pq();
        this._lerpVector4 = new math_vector/* Vector3 */.Pq();
        this._lerpVector5 = new math_vector/* Vector3 */.Pq();
        const localOptions = {
            resolutionX: 3,
            resolutionY: 3,
            resolutionZ: 3,
            position: math_vector/* Vector3 */.Pq.Zero(),
            size: math_vector/* Vector3 */.Pq.One(),
            ...options,
        };
        this._resolutionX = localOptions.resolutionX;
        this._resolutionY = localOptions.resolutionY;
        this._resolutionZ = localOptions.resolutionZ;
        this._position = localOptions.position;
        this._size = localOptions.autoAdaptToMesh ? localOptions.autoAdaptToMesh.getBoundingInfo().boundingBox.extendSize.scale(2) : localOptions.size;
        // Allocate data
        this._allocateData();
        this.update();
    }
    _allocateData() {
        this._data = new Array(this.resolutionX);
        for (let i = 0; i < this.resolutionX; i++) {
            this._data[i] = new Array(this.resolutionY);
            for (let j = 0; j < this.resolutionY; j++) {
                this._data[i][j] = new Array(this.resolutionZ);
                for (let k = 0; k < this.resolutionZ; k++) {
                    this._data[i][j][k] = math_vector/* Vector3 */.Pq.Zero();
                }
            }
        }
    }
    /**
     * Update of the lattice data
     */
    update() {
        for (let i = 0; i < this.resolutionX; i++) {
            for (let j = 0; j < this.resolutionY; j++) {
                for (let k = 0; k < this.resolutionZ; k++) {
                    const x = -this.size.x / 2 + this.size.x * (i / (this.resolutionX - 1));
                    const y = -this.size.y / 2 + this.size.y * (j / (this.resolutionY - 1));
                    const z = -this.size.z / 2 + this.size.z * (k / (this.resolutionZ - 1));
                    this._data[i][j][k].set(x, y, z);
                }
            }
        }
    }
    /**
     * Apply the lattice to a mesh
     * @param mesh mesh to deform
     */
    deformMesh(mesh) {
        const positions = mesh.getVerticesData(Meshes_buffer/* VertexBuffer */.R.PositionKind);
        if (!positions) {
            return;
        }
        // Apply the lattice
        this.deform(positions);
        // Update back the mesh
        mesh.setVerticesData(Meshes_buffer/* VertexBuffer */.R.PositionKind, positions, true);
    }
    /**
     * Update the lattice internals (like min, max and cell size)
     */
    updateInternals() {
        const nx = this._resolutionX;
        const ny = this._resolutionY;
        const nz = this._resolutionZ;
        // Calculate the size of each cell in the lattice
        this._cellSize.set(this.size.x / (nx - 1), this.size.y / (ny - 1), this.size.z / (nz - 1));
        // Calculate the lattice bounds
        this._min.set(this.position.x - this.size.x / 2, this.position.y - this.size.y / 2, this.position.z - this.size.z / 2);
        this._min.addToRef(this._size, this._max);
    }
    /**
     * Apply the lattice to a set of points
     * @param positions vertex data to deform
     * @param target optional target array to store the result (operation will be done in place in not defined)
     */
    deform(positions, target) {
        const nx = this._resolutionX;
        const ny = this._resolutionY;
        const nz = this._resolutionZ;
        this.updateInternals();
        const min = this._min;
        const max = this._max;
        // Loop over each vertex
        for (let i = 0; i < positions.length; i += 3) {
            const vertex = this._tmpVector.fromArray(positions, i);
            // Check we are inside
            if (vertex.x < min.x || vertex.x > max.x || vertex.y < min.y || vertex.y > max.y || vertex.z < min.z || vertex.z > max.z) {
                if (target) {
                    vertex.toArray(target, i);
                }
                continue;
            }
            // Map vertex position to lattice local coordinates
            const localPos = this._localPos.set((vertex.x - min.x) / this._cellSize.x, (vertex.y - min.y) / this._cellSize.y, (vertex.z - min.z) / this._cellSize.z);
            // Get integer lattice indices
            const i0 = Math.floor(localPos.x);
            const j0 = Math.floor(localPos.y);
            const k0 = Math.floor(localPos.z);
            const i1 = Math.min(i0 + 1, nx - 1);
            const j1 = Math.min(j0 + 1, ny - 1);
            const k1 = Math.min(k0 + 1, nz - 1);
            // Compute interpolation weights
            const tx = localPos.x - i0;
            const ty = localPos.y - j0;
            const tz = localPos.z - k0;
            // Ensure indices are within bounds
            const ii0 = (0,math_scalar_functions.Clamp)(i0, 0, nx - 1);
            const jj0 = (0,math_scalar_functions.Clamp)(j0, 0, ny - 1);
            const kk0 = (0,math_scalar_functions.Clamp)(k0, 0, nz - 1);
            const ii1 = (0,math_scalar_functions.Clamp)(i1, 0, nx - 1);
            const jj1 = (0,math_scalar_functions.Clamp)(j1, 0, ny - 1);
            const kk1 = (0,math_scalar_functions.Clamp)(k1, 0, nz - 1);
            // Get lattice control points
            const p000 = this._data[ii0][jj0][kk0];
            const p100 = this._data[ii1][jj0][kk0];
            const p010 = this._data[ii0][jj1][kk0];
            const p110 = this._data[ii1][jj1][kk0];
            const p001 = this._data[ii0][jj0][kk1];
            const p101 = this._data[ii1][jj0][kk1];
            const p011 = this._data[ii0][jj1][kk1];
            const p111 = this._data[ii1][jj1][kk1];
            // Trilinear interpolation
            const p00 = math_vector/* Vector3 */.Pq.LerpToRef(p000, p100, tx, this._lerpVector0);
            const p01 = math_vector/* Vector3 */.Pq.LerpToRef(p001, p101, tx, this._lerpVector1);
            const p10 = math_vector/* Vector3 */.Pq.LerpToRef(p010, p110, tx, this._lerpVector2);
            const p11 = math_vector/* Vector3 */.Pq.LerpToRef(p011, p111, tx, this._lerpVector3);
            const p0 = math_vector/* Vector3 */.Pq.LerpToRef(p00, p10, ty, this._lerpVector4);
            const p1 = math_vector/* Vector3 */.Pq.LerpToRef(p01, p11, ty, this._lerpVector5);
            const deformedPos = math_vector/* Vector3 */.Pq.LerpToRef(p0, p1, tz, this._lerpVector0);
            deformedPos.addInPlace(this.position);
            // Apply deformation to the vertex
            deformedPos.toArray(target || positions, i);
        }
    }
}
//# sourceMappingURL=lattice.js.map
;// ./node_modules/@babylonjs/core/Meshes/lattice.material.js



/**
 * Material plugin to add hardware accelerated lattice support
 * #HBZD72#5 - webgl2
 * #HBZD72#6 - webgpu
 */
class LatticePluginMaterial extends materialPluginBase/* MaterialPluginBase */.y {
    /**
     * Create a new LatticePluginMaterial
     * @param lattice defines the lattice this plugin is associated with
     * @param material defines the material this plugin is associated with
     */
    constructor(lattice, material) {
        super(material, "Lattice", 200);
        this._lattice = lattice;
        this.refreshData();
        // let's enable it by default
        this._enable(true);
    }
    /**
     * Get the class name of the plugin
     * @returns the string "LatticePluginMaterial"
     */
    getClassName() {
        return "LatticePluginMaterial";
    }
    /**
     * Defines if the plugin supports the specified shader language
     * @param shaderLanguage defines the shader language to check
     * @returns true if supported, false otherwise
     */
    isCompatible(shaderLanguage) {
        switch (shaderLanguage) {
            case 0 /* ShaderLanguage.GLSL */:
            case 1 /* ShaderLanguage.WGSL */:
                return true;
            default:
                return false;
        }
    }
    /**
     * Must be called when the lattice data was updated
     */
    refreshData() {
        const length = this._lattice.resolutionX * this._lattice.resolutionY * this._lattice.resolutionZ * 4;
        if (!this._latticeData || this._latticeData.length !== length) {
            this._latticeData = new Float32Array(length);
        }
        for (let i = 0; i < this._lattice.resolutionX; i++) {
            for (let j = 0; j < this._lattice.resolutionY; j++) {
                for (let k = 0; k < this._lattice.resolutionZ; k++) {
                    const control = this._lattice.data[i][j][k];
                    const index = i + this._lattice.resolutionX * (j + this._lattice.resolutionY * k);
                    control.toArray(this._latticeData, index * 4);
                }
            }
        }
        if (!this._latticeDataTexture ||
            this._latticeDataTexture.width !== this._lattice.resolutionX ||
            this._latticeDataTexture.height !== this._lattice.resolutionY ||
            this._latticeDataTexture.depth !== this._lattice.resolutionZ) {
            if (this._latticeDataTexture) {
                this._latticeDataTexture.dispose();
            }
            this._latticeDataTexture = new RawTexture3D(this._latticeData, this._lattice.resolutionX, this._lattice.resolutionY, this._lattice.resolutionZ, 5, this._material.getScene(), false, false, 1, 1);
        }
        else {
            this._latticeDataTexture.update(this._latticeData);
        }
    }
    /**
     * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)
     * @param shaderLanguage The shader language to use.
     * @returns the description of the uniforms
     */
    getUniforms(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            // For webgpu we only define the UBO with the correct type and size.
            return {
                ubo: [
                    { name: "lattice_cellSize", size: 3, type: "vec3" },
                    { name: "lattice_min", size: 3, type: "vec3" },
                    { name: "lattice_max", size: 3, type: "vec3" },
                    { name: "lattice_resolution", size: 3, type: "vec3" },
                    { name: "lattice_position", size: 3, type: "vec3" },
                ],
            };
        }
        return {
            // first, define the UBO with the correct type and size.
            ubo: [
                { name: "lattice_cellSize", size: 3, type: "vec3" },
                { name: "lattice_min", size: 3, type: "vec3" },
                { name: "lattice_max", size: 3, type: "vec3" },
                { name: "lattice_resolution", size: 3, type: "vec3" },
                { name: "lattice_position", size: 3, type: "vec3" },
            ],
            // now, on the vertex shader, add the uniform itself in case uniform buffers are not supported by the engine
            vertex: `
                    uniform vec3 lattice_cellSize;
                    uniform vec3 lattice_min;
                    uniform vec3 lattice_max;
                    uniform vec3 lattice_resolution;
                    uniform vec3 lattice_position;
                    `,
        };
    }
    /**
     * Binds the material data.
     * @param uniformBuffer defines the Uniform buffer to fill in.
     */
    bindForSubMesh(uniformBuffer) {
        this._lattice.updateInternals();
        uniformBuffer.updateVector3("lattice_cellSize", this._lattice.cellSize);
        uniformBuffer.updateVector3("lattice_min", this._lattice.min);
        uniformBuffer.updateVector3("lattice_max", this._lattice.max);
        uniformBuffer.updateFloat3("lattice_resolution", this._lattice.resolutionX, this._lattice.resolutionY, this._lattice.resolutionZ);
        uniformBuffer.updateVector3("lattice_position", this._lattice.position);
        uniformBuffer.setTexture("latticeData", this._latticeDataTexture);
    }
    /**
     * Gets the samplers used by the plugin.
     * @param samplers list that the sampler names should be added to.
     */
    getSamplers(samplers) {
        samplers.push("latticeData");
    }
    _prepareCode(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        if (this._code) {
            return this._code;
        }
        let code = `
            if (positionUpdated.x >= lattice_min.x && positionUpdated.x <= lattice_max.x &&
                positionUpdated.y >= lattice_min.y && positionUpdated.y <= lattice_max.y &&
                positionUpdated.z >= lattice_min.z && positionUpdated.z <= lattice_max.z) {

                // Map vertex position to lattice local coordinates
                vec3d localPos = vec3c((positionUpdated.x - lattice_min.x) / lattice_cellSize.x, (positionUpdated.y - lattice_min.y) / lattice_cellSize.y, (positionUpdated.z - lattice_min.z) / lattice_cellSize.z);

                // Get integer lattice indices
                intd i0 = intc(floor(localPos.x));
                intd j0 = intc(floor(localPos.y));
                intd k0 = intc(floor(localPos.z));

                intd resX = intc(lattice_resolution.x) - 1;
                intd resY = intc(lattice_resolution.y) - 1;
                intd resZ = intc(lattice_resolution.z) - 1;

                intd i1 = min(i0 + 1, resX);
                intd j1 = min(j0 + 1, resY);
                intd k1 = min(k0 + 1, resZ);

                // Compute interpolation weights
                floatd tx = localPos.x - floatc(i0);
                floatd ty = localPos.y - floatc(j0);
                floatd tz = localPos.z - floatc(k0);

                // Ensure indices are within bounds
                intd ii0 = clamp(i0, 0, resX);
                intd jj0 = clamp(j0, 0, resY);
                intd kk0 = clamp(k0, 0, resZ);
                intd ii1 = clamp(i1, 0, resX);
                intd jj1 = clamp(j1, 0, resY);
                intd kk1 = clamp(k1, 0, resZ);

                // Get lattice control points
                vec3d p000 = texelFetch(latticeData, ivec3c(ii0, jj0, kk0), 0).rgb;
                vec3d p100 = texelFetch(latticeData, ivec3c(ii1, jj0, kk0), 0).rgb;
                vec3d p010 = texelFetch(latticeData, ivec3c(ii0, jj1, kk0), 0).rgb;
                vec3d p110 = texelFetch(latticeData, ivec3c(ii1, jj1, kk0), 0).rgb;
                vec3d p001 = texelFetch(latticeData, ivec3c(ii0, jj0, kk1), 0).rgb;
                vec3d p101 = texelFetch(latticeData, ivec3c(ii1, jj0, kk1), 0).rgb;
                vec3d p011 = texelFetch(latticeData, ivec3c(ii0, jj1, kk1), 0).rgb;
                vec3d p111 = texelFetch(latticeData, ivec3c(ii1, jj1, kk1), 0).rgb;

                // Trilinear interpolation
                vec3d p00 = mix(p000, p100, tx);
                vec3d p01 = mix(p001, p101, tx);
                vec3d p10 = mix(p010, p110, tx);
                vec3d p11 = mix(p011, p111, tx);

                vec3d p0 = mix(p00, p10, ty);
                vec3d p1 = mix(p01, p11, ty);

                vec3d deformedPos = mix(p0, p1, tz);
                positionUpdated = deformedPos + lattice_position;
            };
        `;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            code =
                `
                let lattice_min = uniforms.lattice_min;
                let lattice_max = uniforms.lattice_max;
                let lattice_resolution = uniforms.lattice_resolution;
                let lattice_position = uniforms.lattice_position;
                let lattice_cellSize = uniforms.lattice_cellSize;
            ` + code;
            code = code.replace(/ivec3c/g, "vec3i");
            code = code.replace(/vec3d/g, "var");
            code = code.replace(/vec3c/g, "vec3f");
            code = code.replace(/intd/g, "var");
            code = code.replace(/intc/g, "i32");
            code = code.replace(/floatd/g, "var");
            code = code.replace(/floatc/g, "f32");
            code = code.replace(/texelFetch/g, "textureLoad");
        }
        else {
            code = code.replace(/ivec3c/g, "ivec3");
            code = code.replace(/vec3d/g, "vec3");
            code = code.replace(/vec3c/g, "vec3");
            code = code.replace(/intd/g, "int");
            code = code.replace(/intc/g, "int");
            code = code.replace(/floatd/g, "float");
            code = code.replace(/floatc/g, "float");
        }
        this._code = code;
        return this._code;
    }
    /**
     * Returns a list of custom shader code fragments to customize the shader.
     * @param shaderType "vertex" or "fragment"
     * @param shaderLanguage The shader language to use.
     * @returns null if no code to be added, or a list of pointName =\> code.
     */
    getCustomCode(shaderType, shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
        if (shaderType === "vertex") {
            // we're adding this specific code at the end of the main() function
            if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                return {
                    CUSTOM_VERTEX_DEFINITIONS: `
                        var latticeData: texture_3d<f32>;
                    `,
                    CUSTOM_VERTEX_UPDATE_POSITION: this._prepareCode(shaderLanguage),
                };
            }
            return {
                CUSTOM_VERTEX_DEFINITIONS: `
                    precision highp sampler3D;
                    uniform sampler3D latticeData;
                `,
                CUSTOM_VERTEX_UPDATE_POSITION: this._prepareCode(shaderLanguage),
            };
        }
        // for other shader types we're not doing anything, return null
        return null;
    }
    /**
     * Disposes the resources of the material.
     */
    dispose() {
        if (this._latticeDataTexture) {
            this._latticeDataTexture.dispose();
            this._latticeDataTexture = null;
        }
    }
}
//# sourceMappingURL=lattice.material.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/meshLODLevel.js
var meshLODLevel = __webpack_require__(16400);
;// ./node_modules/@babylonjs/core/Meshes/GreasedLine/greasedLineBaseMesh.js







/**
 * In POINTS_MODE_POINTS every array of points will become the center (backbone) of the ribbon. The ribbon will be expanded by `width / 2` to `+direction` and `-direction` as well.
 * In POINTS_MODE_PATHS every array of points specifies an edge. These will be used to build one ribbon.
 */
var GreasedLineRibbonPointsMode;
(function (GreasedLineRibbonPointsMode) {
    GreasedLineRibbonPointsMode[GreasedLineRibbonPointsMode["POINTS_MODE_POINTS"] = 0] = "POINTS_MODE_POINTS";
    GreasedLineRibbonPointsMode[GreasedLineRibbonPointsMode["POINTS_MODE_PATHS"] = 1] = "POINTS_MODE_PATHS";
})(GreasedLineRibbonPointsMode || (GreasedLineRibbonPointsMode = {}));
/**
 * FACES_MODE_SINGLE_SIDED single sided with back face culling. Default value.
 * FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING single sided without back face culling. Sets backFaceCulling = false on the material so it affects all line ribbons added to the line ribbon instance.
 * FACES_MODE_DOUBLE_SIDED extra back faces are created. This doubles the amount of faces of the mesh.
 */
var GreasedLineRibbonFacesMode;
(function (GreasedLineRibbonFacesMode) {
    GreasedLineRibbonFacesMode[GreasedLineRibbonFacesMode["FACES_MODE_SINGLE_SIDED"] = 0] = "FACES_MODE_SINGLE_SIDED";
    GreasedLineRibbonFacesMode[GreasedLineRibbonFacesMode["FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING"] = 1] = "FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING";
    GreasedLineRibbonFacesMode[GreasedLineRibbonFacesMode["FACES_MODE_DOUBLE_SIDED"] = 2] = "FACES_MODE_DOUBLE_SIDED";
})(GreasedLineRibbonFacesMode || (GreasedLineRibbonFacesMode = {}));
/**
 * Only with POINTS_MODE_PATHS.
 * AUTO_DIRECTIONS_FROM_FIRST_SEGMENT sets the direction (slope) of the ribbon from the direction of the first line segment. Recommended.
 * AUTO_DIRECTIONS_FROM_ALL_SEGMENTS in this mode the direction (slope) will be calculated for each line segment according to the direction vector between each point of the line segments. Slow method.
 * AUTO_DIRECTIONS_ENHANCED in this mode the direction (slope) will be calculated for each line segment according to the direction vector between each point of the line segments using a more sophisitcaed algorithm. Slowest method.
 * AUTO_DIRECTIONS_FACE_TO in this mode the direction (slope) will be calculated for each line segment according to the direction vector between each point of the line segments and a direction (face-to) vector specified in direction. The resulting line will face to the direction of this face-to vector.
 * AUTO_DIRECTIONS_NONE you have to set the direction (slope) manually. Recommended.
 */
var GreasedLineRibbonAutoDirectionMode;
(function (GreasedLineRibbonAutoDirectionMode) {
    GreasedLineRibbonAutoDirectionMode[GreasedLineRibbonAutoDirectionMode["AUTO_DIRECTIONS_FROM_FIRST_SEGMENT"] = 0] = "AUTO_DIRECTIONS_FROM_FIRST_SEGMENT";
    GreasedLineRibbonAutoDirectionMode[GreasedLineRibbonAutoDirectionMode["AUTO_DIRECTIONS_FROM_ALL_SEGMENTS"] = 1] = "AUTO_DIRECTIONS_FROM_ALL_SEGMENTS";
    GreasedLineRibbonAutoDirectionMode[GreasedLineRibbonAutoDirectionMode["AUTO_DIRECTIONS_ENHANCED"] = 2] = "AUTO_DIRECTIONS_ENHANCED";
    GreasedLineRibbonAutoDirectionMode[GreasedLineRibbonAutoDirectionMode["AUTO_DIRECTIONS_FACE_TO"] = 3] = "AUTO_DIRECTIONS_FACE_TO";
    GreasedLineRibbonAutoDirectionMode[GreasedLineRibbonAutoDirectionMode["AUTO_DIRECTIONS_NONE"] = 99] = "AUTO_DIRECTIONS_NONE";
})(GreasedLineRibbonAutoDirectionMode || (GreasedLineRibbonAutoDirectionMode = {}));
/**
 * GreasedLineBaseMesh
 */
class GreasedLineBaseMesh extends Meshes_mesh/* Mesh */.e {
    constructor(name, scene, _options) {
        super(name, scene, null, null, false, false);
        this.name = name;
        this._options = _options;
        this._lazy = false;
        this._updatable = false;
        this._engine = scene.getEngine();
        this._lazy = _options.lazy ?? false;
        this._updatable = _options.updatable ?? false;
        this._vertexPositions = [];
        this._indices = [];
        this._uvs = [];
        this._points = [];
        this._colorPointers = _options.colorPointers ?? [];
        this._widths = _options.widths ?? new Array(_options.points.length).fill(1);
    }
    /**
     * "GreasedLineMesh"
     * @returns "GreasedLineMesh"
     */
    getClassName() {
        return "GreasedLineMesh";
    }
    _updateWidthsWithValue(defaulValue) {
        let pointCount = 0;
        for (const points of this._points) {
            pointCount += points.length;
        }
        const countDiff = (pointCount / 3) * 2 - this._widths.length;
        for (let i = 0; i < countDiff; i++) {
            this._widths.push(defaulValue);
        }
    }
    /**
     * Updated a lazy line. Rerenders the line and updates boundinfo as well.
     */
    updateLazy() {
        this._setPoints(this._points);
        if (!this._options.colorPointers) {
            this._updateColorPointers();
        }
        this._createVertexBuffers(this._options.ribbonOptions?.smoothShading);
        !this.doNotSyncBoundingInfo && this.refreshBoundingInfo();
        this.greasedLineMaterial?.updateLazy();
    }
    /**
     * Adds new points to the line. It doesn't rerenders the line if in lazy mode.
     * @param points points table
     * @param options optional options
     */
    addPoints(points, options) {
        for (const p of points) {
            this._points.push(p);
        }
        if (!this._lazy) {
            this.setPoints(this._points, options);
        }
    }
    /**
     * Dispose the line and it's resources
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        super.dispose(doNotRecurse, disposeMaterialAndTextures);
    }
    /**
     * @returns true if the mesh was created in lazy mode
     */
    isLazy() {
        return this._lazy;
    }
    /**
     * Returns the UVs
     */
    get uvs() {
        return this._uvs;
    }
    /**
     * Sets the UVs
     * @param uvs the UVs
     */
    set uvs(uvs) {
        this._uvs = uvs instanceof Float32Array ? uvs : new Float32Array(uvs);
        this._createVertexBuffers();
    }
    /**
     * Returns the points offsets
     * Return the points offsets
     */
    get offsets() {
        return this._offsets;
    }
    /**
     * Sets point offests
     * @param offsets offset table [x,y,z, x,y,z, ....]
     */
    set offsets(offsets) {
        this._offsets = offsets;
        if (!this._offsetsBuffer) {
            this._createOffsetsBuffer(offsets);
        }
        else {
            this._offsetsBuffer.update(offsets);
        }
    }
    /**
     * Gets widths at each line point like [widthLower, widthUpper, widthLower, widthUpper, ...]
     */
    get widths() {
        return this._widths;
    }
    /**
     * Sets widths at each line point
     * @param widths width table [widthLower, widthUpper, widthLower, widthUpper ...]
     */
    set widths(widths) {
        this._widths = widths;
        if (!this._lazy) {
            this._widthsBuffer && this._widthsBuffer.update(widths);
        }
    }
    /**
     * Gets the color pointer. Each vertex need a color pointer. These color pointers points to the colors in the color table @see colors
     */
    get colorPointers() {
        return this._colorPointers;
    }
    /**
     * Sets the color pointer
     * @param colorPointers array of color pointer in the colors array. One pointer for every vertex is needed.
     */
    set colorPointers(colorPointers) {
        this._colorPointers = colorPointers;
        if (!this._lazy) {
            this._colorPointersBuffer && this._colorPointersBuffer.update(colorPointers);
        }
    }
    /**
     * Gets the pluginMaterial associated with line
     */
    get greasedLineMaterial() {
        if (this.material && this.material instanceof GreasedLineSimpleMaterial) {
            return this.material;
        }
        const materialPlugin = this.material?.pluginManager?.getPlugin(GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME);
        if (materialPlugin) {
            return materialPlugin;
        }
        return;
    }
    /**
     * Return copy the points.
     */
    get points() {
        const pointsCopy = [];
        deepCopier/* DeepCopier */.r.DeepCopy(this._points, pointsCopy);
        return pointsCopy;
    }
    /**
     * Sets line points and rerenders the line.
     * @param points points table
     * @param options optional options
     */
    setPoints(points, options) {
        this._points = GreasedLineTools.ConvertPoints(points, options?.pointsOptions ?? this._options.pointsOptions);
        this._updateWidths();
        if (!options?.colorPointers) {
            this._updateColorPointers();
        }
        this._setPoints(this._points, options);
    }
    _initGreasedLine() {
        this._vertexPositions = [];
        this._indices = [];
        this._uvs = [];
    }
    _createLineOptions() {
        const lineOptions = {
            points: this._points,
            colorPointers: this._colorPointers,
            lazy: this._lazy,
            updatable: this._updatable,
            uvs: this._uvs,
            widths: this._widths,
            ribbonOptions: this._options.ribbonOptions,
        };
        return lineOptions;
    }
    /**
     * Serializes this GreasedLineMesh
     * @param serializationObject object to write serialization to
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.type = this.getClassName();
        serializationObject.lineOptions = this._createLineOptions();
    }
    _createVertexBuffers(computeNormals = false) {
        const vertexData = new mesh_vertexData/* VertexData */.P();
        vertexData.positions = this._vertexPositions;
        vertexData.indices = this._indices;
        vertexData.uvs = this._uvs;
        if (computeNormals) {
            vertexData.normals = [];
            mesh_vertexData/* VertexData */.P.ComputeNormals(this._vertexPositions, this._indices, vertexData.normals);
        }
        vertexData.applyToMesh(this, this._options.updatable);
        return vertexData;
    }
    _createOffsetsBuffer(offsets) {
        const engine = this._scene.getEngine();
        const offsetBuffer = new Buffers_buffer/* Buffer */.h(engine, offsets, this._updatable, 3);
        this.setVerticesBuffer(offsetBuffer.createVertexBuffer("grl_offsets", 0, 3));
        this._offsetsBuffer = offsetBuffer;
    }
}
//# sourceMappingURL=greasedLineBaseMesh.js.map
;// ./node_modules/@babylonjs/core/Meshes/GreasedLine/greasedLineMesh.js







Meshes_mesh/* Mesh */.e._GreasedLineMeshParser = (parsedMesh, scene) => {
    return GreasedLineMesh.Parse(parsedMesh, scene);
};
/**
 * GreasedLineMesh
 * Use the GreasedLineBuilder.CreateGreasedLine function to create an instance of this class.
 */
class GreasedLineMesh extends GreasedLineBaseMesh {
    /**
     * GreasedLineMesh
     * @param name name of the mesh
     * @param scene the scene
     * @param _options mesh options
     */
    constructor(name, scene, _options) {
        super(name, scene, _options);
        this.name = name;
        /**
         * Treshold used to pick the mesh
         */
        this.intersectionThreshold = 0.1;
        this._previousAndSide = [];
        this._nextAndCounters = [];
        if (_options.points) {
            this.addPoints(GreasedLineTools.ConvertPoints(_options.points));
        }
    }
    /**
     * "GreasedLineMesh"
     * @returns "GreasedLineMesh"
     */
    getClassName() {
        return "GreasedLineMesh";
    }
    _updateColorPointers() {
        if (this._options.colorPointers) {
            return;
        }
        let colorPointer = 0;
        this._colorPointers = [];
        this._points.forEach((p) => {
            for (let jj = 0; jj < p.length; jj += 3) {
                this._colorPointers.push(colorPointer);
                this._colorPointers.push(colorPointer++);
            }
        });
    }
    _updateWidths() {
        // intentionally left blank
    }
    _setPoints(points) {
        this._points = points;
        this._options.points = points;
        this._initGreasedLine();
        let indiceOffset = 0;
        let vertexPositionsLen = 0, indicesLength = 0, uvLength = 0, previousAndSideLength = 0;
        points.forEach((p) => {
            vertexPositionsLen += p.length * 2;
            indicesLength += (p.length - 3) * 2;
            uvLength += (p.length * 4) / 3;
            previousAndSideLength += (p.length * 8) / 3;
        });
        const vertexPositionsArr = new Float32Array(vertexPositionsLen);
        const indicesArr = vertexPositionsLen > 65535 ? new Uint32Array(indicesLength) : new Uint16Array(indicesLength);
        const uvArr = new Float32Array(uvLength);
        const previousAndSide = new Float32Array(previousAndSideLength);
        // it's the same length here
        const nextAndCounters = new Float32Array(previousAndSideLength);
        let vertexPositionsOffset = 0, indicesOffset = 0, uvOffset = 0, previousAndSideOffset = 0, nextAndCountersOffset = 0;
        points.forEach((p) => {
            const lengthArray = GreasedLineTools.GetLineLengthArray(p);
            const totalLength = lengthArray[lengthArray.length - 1];
            for (let j = 0, jj = 0; jj < p.length; j++, jj += 3) {
                const baseOffset = vertexPositionsOffset + jj * 2;
                vertexPositionsArr[baseOffset + 0] = p[jj + 0];
                vertexPositionsArr[baseOffset + 1] = p[jj + 1];
                vertexPositionsArr[baseOffset + 2] = p[jj + 2];
                vertexPositionsArr[baseOffset + 3] = p[jj + 0];
                vertexPositionsArr[baseOffset + 4] = p[jj + 1];
                vertexPositionsArr[baseOffset + 5] = p[jj + 2];
                if (jj < p.length - 3) {
                    const n = j * 2 + indiceOffset;
                    const baseIndicesOffset = indicesOffset + jj * 2;
                    indicesArr[baseIndicesOffset + 0] = n;
                    indicesArr[baseIndicesOffset + 1] = n + 1;
                    indicesArr[baseIndicesOffset + 2] = n + 2;
                    indicesArr[baseIndicesOffset + 3] = n + 2;
                    indicesArr[baseIndicesOffset + 4] = n + 1;
                    indicesArr[baseIndicesOffset + 5] = n + 3;
                }
            }
            indiceOffset += (p.length / 3) * 2;
            const currVertexPositionsOffsetLength = p.length * 2;
            const positions = vertexPositionsArr.subarray(vertexPositionsOffset, vertexPositionsOffset + currVertexPositionsOffsetLength);
            vertexPositionsOffset += currVertexPositionsOffsetLength;
            indicesOffset += (p.length - 3) * 2;
            const previous = new Float32Array(positions.length);
            const next = new Float32Array(positions.length);
            const l = positions.length / 6;
            let v;
            if (GreasedLineMesh._CompareV3(0, l - 1, positions)) {
                v = positions.subarray((l - 2) * 6, (l - 1) * 6);
            }
            else {
                v = positions.subarray(0, 6);
            }
            previous.set(v);
            previous.set(positions.subarray(0, positions.length - 6), 6);
            next.set(positions.subarray(6));
            if (GreasedLineMesh._CompareV3(l - 1, 0, positions)) {
                v = positions.subarray(6, 12);
            }
            else {
                v = positions.subarray((l - 1) * 6, l * 6);
            }
            next.set(v, next.length - 6);
            for (let i = 0, sidesLength = positions.length / 3; i < sidesLength; i++) {
                previousAndSide[previousAndSideOffset++] = previous[i * 3];
                previousAndSide[previousAndSideOffset++] = previous[i * 3 + 1];
                previousAndSide[previousAndSideOffset++] = previous[i * 3 + 2];
                // side[i] = i % 2 ? -1 : 1;
                // side[i] = 1 - ((i & 1) << 1);
                previousAndSide[previousAndSideOffset++] = 1 - ((i & 1) << 1);
                nextAndCounters[nextAndCountersOffset++] = next[i * 3];
                nextAndCounters[nextAndCountersOffset++] = next[i * 3 + 1];
                nextAndCounters[nextAndCountersOffset++] = next[i * 3 + 2];
                // counters[i] = lengthArray[i >> 1] / totalLength;
                nextAndCounters[nextAndCountersOffset++] = lengthArray[i >> 1] / totalLength;
            }
            if (this._options.uvs) {
                for (let i = 0; i < this._options.uvs.length; i++) {
                    uvArr[uvOffset++] = this._options.uvs[i];
                }
            }
            else {
                for (let j = 0; j < l; j++) {
                    // uvs
                    const lengthRatio = lengthArray[j] / totalLength;
                    const uvOffsetBase = uvOffset + j * 4;
                    uvArr[uvOffsetBase + 0] = lengthRatio;
                    uvArr[uvOffsetBase + 1] = 0;
                    uvArr[uvOffsetBase + 2] = lengthRatio;
                    uvArr[uvOffsetBase + 3] = 1;
                }
            }
        });
        this._vertexPositions = vertexPositionsArr;
        this._indices = indicesArr;
        this._uvs = uvArr;
        this._previousAndSide = previousAndSide;
        this._nextAndCounters = nextAndCounters;
        if (!this._lazy) {
            if (!this._options.colorPointers) {
                this._updateColorPointers();
            }
            this._createVertexBuffers();
            !this.doNotSyncBoundingInfo && this.refreshBoundingInfo();
        }
    }
    /**
     * Clones the GreasedLineMesh.
     * @param name new line name
     * @param newParent new parent node
     * @returns cloned line
     */
    clone(name = `${this.name}-cloned`, newParent) {
        const lineOptions = this._createLineOptions();
        const deepCopiedLineOptions = {};
        deepCopier/* DeepCopier */.r.DeepCopy(lineOptions, deepCopiedLineOptions, ["instance"], undefined, true);
        const cloned = new GreasedLineMesh(name, this._scene, deepCopiedLineOptions);
        if (newParent) {
            cloned.parent = newParent;
        }
        cloned.material = this.material;
        return cloned;
    }
    /**
     * Serializes this GreasedLineMesh
     * @param serializationObject object to write serialization to
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.type = this.getClassName();
        serializationObject.lineOptions = this._createLineOptions();
    }
    /**
     * Parses a serialized GreasedLineMesh
     * @param parsedMesh the serialized GreasedLineMesh
     * @param scene the scene to create the GreasedLineMesh in
     * @returns the created GreasedLineMesh
     */
    static Parse(parsedMesh, scene) {
        const lineOptions = parsedMesh.lineOptions;
        const name = parsedMesh.name;
        const result = new GreasedLineMesh(name, scene, lineOptions);
        return result;
    }
    _initGreasedLine() {
        super._initGreasedLine();
        this._previousAndSide = [];
        this._nextAndCounters = [];
    }
    /**
     * Checks whether a ray is intersecting this GreasedLineMesh
     * @param ray ray to check the intersection of this mesh with
     * @param fastCheck not supported
     * @param trianglePredicate not supported
     * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
     * @param worldToUse not supported
     * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
     * @returns the picking info
     */
    intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo = false, worldToUse, skipBoundingInfo = false) {
        const pickingInfo = new Collisions_pickingInfo/* PickingInfo */.G();
        const intersections = this.findAllIntersections(ray, fastCheck, trianglePredicate, onlyBoundingInfo, worldToUse, skipBoundingInfo, true);
        if (intersections?.length === 1) {
            const intersection = intersections[0];
            pickingInfo.hit = true;
            pickingInfo.distance = intersection.distance;
            pickingInfo.ray = ray;
            pickingInfo.pickedMesh = this;
            pickingInfo.pickedPoint = intersection.point;
        }
        return pickingInfo;
    }
    /**
     * Gets all intersections of a ray and the line
     * @param ray Ray to check the intersection of this mesh with
     * @param _fastCheck not supported
     * @param _trianglePredicate not supported
     * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)
     * @param _worldToUse not supported
     * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check
     * @param firstOnly If true, the first and only intersection is immediatelly returned if found
     * @returns intersection(s)
     */
    findAllIntersections(ray, _fastCheck, _trianglePredicate, onlyBoundingInfo = false, _worldToUse, skipBoundingInfo = false, firstOnly = false) {
        if (onlyBoundingInfo && !skipBoundingInfo && ray.intersectsSphere(this._boundingSphere, this.intersectionThreshold) === false) {
            return;
        }
        const indices = this.getIndices();
        const positions = this.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const widths = this._widths;
        const lineWidth = this.greasedLineMaterial?.width ?? 1;
        const intersects = [];
        if (indices && positions && widths) {
            let i = 0, l = 0;
            for (i = 0, l = indices.length - 1; i < l; i += 3) {
                const a = indices[i];
                const b = indices[i + 1];
                GreasedLineMesh._V_START.fromArray(positions, a * 3);
                GreasedLineMesh._V_END.fromArray(positions, b * 3);
                if (this._offsets) {
                    GreasedLineMesh._V_OFFSET_START.fromArray(this._offsets, a * 3);
                    GreasedLineMesh._V_OFFSET_END.fromArray(this._offsets, b * 3);
                    GreasedLineMesh._V_START.addInPlace(GreasedLineMesh._V_OFFSET_START);
                    GreasedLineMesh._V_END.addInPlace(GreasedLineMesh._V_OFFSET_END);
                }
                const iFloored = Math.floor(i / 3);
                const width = widths[iFloored] !== undefined ? widths[iFloored] : 1;
                const precision = (this.intersectionThreshold * (lineWidth * width)) / 2;
                const distance = ray.intersectionSegment(GreasedLineMesh._V_START, GreasedLineMesh._V_END, precision);
                if (distance !== -1) {
                    intersects.push({
                        distance: distance,
                        point: ray.direction.normalize().multiplyByFloats(distance, distance, distance).add(ray.origin),
                    });
                    if (firstOnly) {
                        return intersects;
                    }
                }
            }
            i = l;
        }
        return intersects;
    }
    get _boundingSphere() {
        return this.getBoundingInfo().boundingSphere;
    }
    static _CompareV3(positionIdx1, positionIdx2, positions) {
        const arrayIdx1 = positionIdx1 * 6;
        const arrayIdx2 = positionIdx2 * 6;
        return positions[arrayIdx1] === positions[arrayIdx2] && positions[arrayIdx1 + 1] === positions[arrayIdx2 + 1] && positions[arrayIdx1 + 2] === positions[arrayIdx2 + 2];
    }
    _createVertexBuffers() {
        const vertexData = super._createVertexBuffers();
        const engine = this._scene.getEngine();
        const previousAndSideBuffer = new Buffers_buffer/* Buffer */.h(engine, this._previousAndSide, false, 4);
        this.setVerticesBuffer(previousAndSideBuffer.createVertexBuffer("grl_previousAndSide", 0, 4));
        const nextAndCountersBuffer = new Buffers_buffer/* Buffer */.h(engine, this._nextAndCounters, false, 4);
        this.setVerticesBuffer(nextAndCountersBuffer.createVertexBuffer("grl_nextAndCounters", 0, 4));
        const widthBuffer = new Buffers_buffer/* Buffer */.h(engine, this._widths, this._updatable, 1);
        this.setVerticesBuffer(widthBuffer.createVertexBuffer("grl_widths", 0, 1));
        this._widthsBuffer = widthBuffer;
        const colorPointersBuffer = new Buffers_buffer/* Buffer */.h(engine, this._colorPointers, this._updatable, 1);
        this.setVerticesBuffer(colorPointersBuffer.createVertexBuffer("grl_colorPointers", 0, 1));
        this._colorPointersBuffer = colorPointersBuffer;
        return vertexData;
    }
}
GreasedLineMesh._V_START = new math_vector/* Vector3 */.Pq();
GreasedLineMesh._V_END = new math_vector/* Vector3 */.Pq();
GreasedLineMesh._V_OFFSET_START = new math_vector/* Vector3 */.Pq();
GreasedLineMesh._V_OFFSET_END = new math_vector/* Vector3 */.Pq();
//# sourceMappingURL=greasedLineMesh.js.map
;// ./node_modules/@babylonjs/core/Meshes/GreasedLine/greasedLineRibbonMesh.js






Meshes_mesh/* Mesh */.e._GreasedLineRibbonMeshParser = (parsedMesh, scene) => {
    return GreasedLineRibbonMesh.Parse(parsedMesh, scene);
};
/**
 * GreasedLineRibbonMesh
 * Use the GreasedLineBuilder.CreateGreasedLine function to create an instance of this class.
 */
class GreasedLineRibbonMesh extends GreasedLineBaseMesh {
    /**
     * GreasedLineRibbonMesh
     * @param name name of the mesh
     * @param scene the scene
     * @param _options mesh options
     * @param _pathOptions used internaly when parsing a serialized GreasedLineRibbonMesh
     */
    constructor(name, scene, _options, _pathOptions) {
        super(name, scene, _options);
        this.name = name;
        if (!_options.ribbonOptions) {
            // eslint-disable-next-line no-throw-literal
            throw "'GreasedLineMeshOptions.ribbonOptions' is not set.";
        }
        this._paths = [];
        this._counters = [];
        this._slopes = [];
        this._widths = _options.widths ?? [];
        this._ribbonWidths = [];
        this._pathsOptions = _pathOptions ?? [];
        if (_options.points) {
            this.addPoints(GreasedLineTools.ConvertPoints(_options.points), _options, !!_pathOptions);
        }
    }
    /**
     * Adds new points to the line. It doesn't rerenders the line if in lazy mode.
     * @param points points table
     * @param options mesh options
     * @param hasPathOptions defaults to false
     */
    addPoints(points, options, hasPathOptions = false) {
        if (!options.ribbonOptions) {
            // eslint-disable-next-line no-throw-literal
            throw "addPoints() on GreasedLineRibbonMesh instance requires 'GreasedLineMeshOptions.ribbonOptions'.";
        }
        if (!hasPathOptions) {
            this._pathsOptions.push({ options, pathCount: points.length });
        }
        super.addPoints(points, options);
    }
    /**
     * "GreasedLineRibbonMesh"
     * @returns "GreasedLineRibbonMesh"
     */
    getClassName() {
        return "GreasedLineRibbonMesh";
    }
    /**
     * Return true if the line was created from two edge paths or one points path.
     * In this case the line is always flat.
     */
    get isFlatLine() {
        return this._paths.length < 3;
    }
    /**
     * Returns the slopes of the line at each point relative to the center of the line
     */
    get slopes() {
        return this._slopes;
    }
    /**
     * Set the slopes of the line at each point relative to the center of the line
     */
    set slopes(slopes) {
        this._slopes = slopes;
    }
    _updateColorPointers() {
        if (this._options.colorPointers) {
            return;
        }
        let colorPointer = 0;
        this._colorPointers = [];
        for (let i = 0; i < this._pathsOptions.length; i++) {
            const { options: pathOptions, pathCount } = this._pathsOptions[i];
            const points = this._points[i];
            if (pathOptions.ribbonOptions.pointsMode === 0 /* GreasedLineRibbonPointsMode.POINTS_MODE_POINTS */) {
                for (let k = 0; k < pathCount; k++) {
                    for (let j = 0; j < points.length; j += 3) {
                        this._colorPointers.push(colorPointer);
                        this._colorPointers.push(colorPointer++);
                    }
                }
            }
            else {
                for (let j = 0; j < points.length; j += 3) {
                    for (let k = 0; k < pathCount; k++) {
                        this._colorPointers.push(colorPointer);
                    }
                    colorPointer++;
                }
            }
        }
    }
    _updateWidths() {
        super._updateWidthsWithValue(1);
    }
    _setPoints(points, _options) {
        if (!this._options.ribbonOptions) {
            // eslint-disable-next-line no-throw-literal
            throw "No 'GreasedLineMeshOptions.ribbonOptions' provided.";
        }
        this._points = points;
        this._options.points = points;
        this._initGreasedLine();
        let indiceOffset = 0;
        let directionPlanes;
        for (let i = 0, c = 0; i < this._pathsOptions.length; i++) {
            const { options: pathOptions, pathCount } = this._pathsOptions[i];
            const subPoints = points.slice(c, c + pathCount);
            c += pathCount;
            if (pathOptions.ribbonOptions?.pointsMode === 1 /* GreasedLineRibbonPointsMode.POINTS_MODE_PATHS */) {
                indiceOffset = this._preprocess(GreasedLineTools.ToVector3Array(subPoints), indiceOffset, pathOptions);
            }
            else {
                if (pathOptions.ribbonOptions?.directionsAutoMode === 99 /* GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE */) {
                    if (!pathOptions.ribbonOptions.directions) {
                        // eslint-disable-next-line no-throw-literal
                        throw "In GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE 'GreasedLineMeshOptions.ribbonOptions.directions' must be defined.";
                    }
                    directionPlanes = GreasedLineRibbonMesh._GetDirectionPlanesFromDirectionsOption(subPoints.length, pathOptions.ribbonOptions.directions);
                }
                subPoints.forEach((p, idx) => {
                    const pathArray = GreasedLineRibbonMesh._ConvertToRibbonPath(p, pathOptions.ribbonOptions, this._scene.useRightHandedSystem, directionPlanes ? directionPlanes[idx] : directionPlanes);
                    indiceOffset = this._preprocess(pathArray, indiceOffset, pathOptions);
                });
            }
        }
        if (!this._lazy) {
            this._createVertexBuffers();
            !this.doNotSyncBoundingInfo && this.refreshBoundingInfo();
        }
    }
    static _GetDirectionPlanesFromDirectionsOption(count, directions) {
        if (Array.isArray(directions)) {
            return directions;
        }
        return new Array(count).fill(directions);
    }
    static _CreateRibbonVertexData(pathArray, options) {
        const numOfPaths = pathArray.length;
        if (numOfPaths < 2) {
            // eslint-disable-next-line no-throw-literal
            throw "Minimum of two paths are required to create a GreasedLineRibbonMesh.";
        }
        const positions = [];
        const indices = [];
        const path = pathArray[0];
        for (let i = 0; i < path.length; i++) {
            for (let pi = 0; pi < pathArray.length; pi++) {
                const v = pathArray[pi][i];
                positions.push(v.x, v.y, v.z);
            }
        }
        const v = [1, 0, numOfPaths];
        const doubleSided = options.ribbonOptions?.facesMode === 2 /* GreasedLineRibbonFacesMode.FACES_MODE_DOUBLE_SIDED */ ?? false;
        const closePath = options.ribbonOptions?.pointsMode === 1 /* GreasedLineRibbonPointsMode.POINTS_MODE_PATHS */ && options.ribbonOptions.closePath;
        if (numOfPaths > 2) {
            for (let i = 0; i < path.length - 1; i++) {
                v[0] = 1 + numOfPaths * i;
                v[1] = numOfPaths * i;
                v[2] = (i + 1) * numOfPaths;
                for (let pi = 0; pi < (numOfPaths - 1) * 2; pi++) {
                    if (pi % 2 !== 0) {
                        v[2] += 1;
                    }
                    if (pi % 2 === 0 && pi > 0) {
                        v[0] += 1;
                        v[1] += 1;
                    }
                    indices.push(v[1] + (pi % 2 !== 0 ? numOfPaths : 0), v[0], v[2]);
                    if (doubleSided) {
                        indices.push(v[0], v[1] + (pi % 2 !== 0 ? numOfPaths : 0), v[2]);
                    }
                }
            }
        }
        else {
            for (let i = 0; i < positions.length / 3 - 3; i += 2) {
                indices.push(i, i + 1, i + 2);
                indices.push(i + 2, i + 1, i + 3);
                if (doubleSided) {
                    indices.push(i + 1, i, i + 2);
                    indices.push(i + 1, i + 2, i + 3);
                }
            }
        }
        if (closePath) {
            let lastIndice = numOfPaths * (path.length - 1);
            for (let pi = 0; pi < numOfPaths - 1; pi++) {
                indices.push(lastIndice, pi + 1, pi);
                indices.push(lastIndice + 1, pi + 1, lastIndice);
                if (doubleSided) {
                    indices.push(pi, pi + 1, lastIndice);
                    indices.push(lastIndice, pi + 1, lastIndice + 1);
                }
                lastIndice++;
            }
        }
        return {
            positions,
            indices,
        };
    }
    _preprocess(pathArray, indiceOffset, options) {
        this._paths = pathArray;
        const ribbonVertexData = GreasedLineRibbonMesh._CreateRibbonVertexData(pathArray, options);
        const positions = ribbonVertexData.positions;
        if (!this._options.widths) {
            // eslint-disable-next-line no-throw-literal
            throw "No 'GreasedLineMeshOptions.widths' table is specified.";
        }
        const vertexPositions = Array.isArray(this._vertexPositions) ? this._vertexPositions : Array.from(this._vertexPositions);
        this._vertexPositions = vertexPositions;
        const uvs = Array.isArray(this._uvs) ? this._uvs : Array.from(this._uvs);
        this._uvs = uvs;
        const indices = Array.isArray(this._indices) ? this._indices : Array.from(this._indices);
        this._indices = indices;
        for (const p of positions) {
            vertexPositions.push(p);
        }
        let pathArrayCopy = pathArray;
        if (options.ribbonOptions?.pointsMode === 1 /* GreasedLineRibbonPointsMode.POINTS_MODE_PATHS */ && options.ribbonOptions.closePath) {
            pathArrayCopy = [];
            for (let i = 0; i < pathArray.length; i++) {
                const pathCopy = pathArray[i].slice();
                pathCopy.push(pathArray[i][0].clone());
                pathArrayCopy.push(pathCopy);
            }
        }
        this._calculateSegmentLengths(pathArrayCopy);
        const pathArrayLength = pathArrayCopy.length;
        const previousCounters = new Array(pathArrayLength).fill(0);
        for (let i = 0; i < pathArrayCopy[0].length; i++) {
            let v = 0;
            for (let pi = 0; pi < pathArrayLength; pi++) {
                const counter = previousCounters[pi] + this._vSegmentLengths[pi][i] / this._vTotalLengths[pi];
                this._counters.push(counter);
                uvs.push(counter, v);
                previousCounters[pi] = counter;
                v += this._uSegmentLengths[i][pi] / this._uTotalLengths[i];
            }
        }
        for (let i = 0, c = 0; i < pathArrayCopy[0].length; i++) {
            const widthLower = this._uSegmentLengths[i][0] / 2;
            const widthUpper = this._uSegmentLengths[i][pathArrayLength - 1] / 2;
            this._ribbonWidths.push(((this._widths[c++] ?? 1) - 1) * widthLower);
            for (let pi = 0; pi < pathArrayLength - 2; pi++) {
                this._ribbonWidths.push(0);
            }
            this._ribbonWidths.push(((this._widths[c++] ?? 1) - 1) * widthUpper);
        }
        const slopes = options.ribbonOptions?.pointsMode === 1 /* GreasedLineRibbonPointsMode.POINTS_MODE_PATHS */
            ? new Array(pathArrayCopy[0].length * pathArrayCopy.length * 6).fill(0)
            : GreasedLineRibbonMesh._CalculateSlopes(pathArrayCopy);
        for (const s of slopes) {
            this._slopes.push(s);
        }
        if (ribbonVertexData.indices) {
            for (let i = 0; i < ribbonVertexData.indices.length; i++) {
                indices.push(ribbonVertexData.indices[i] + indiceOffset);
            }
        }
        indiceOffset += positions.length / 3;
        return indiceOffset;
    }
    static _ConvertToRibbonPath(points, ribbonInfo, rightHandedSystem, directionPlane) {
        if (ribbonInfo.pointsMode === 0 /* GreasedLineRibbonPointsMode.POINTS_MODE_POINTS */ && !ribbonInfo.width) {
            // eslint-disable-next-line no-throw-literal
            throw "'GreasedLineMeshOptions.ribbonOptiosn.width' must be specified in GreasedLineRibbonPointsMode.POINTS_MODE_POINTS.";
        }
        const path1 = [];
        const path2 = [];
        if (ribbonInfo.pointsMode === 0 /* GreasedLineRibbonPointsMode.POINTS_MODE_POINTS */) {
            const width = ribbonInfo.width / 2;
            const pointVectors = GreasedLineTools.ToVector3Array(points);
            let direction = null;
            let fatDirection = null;
            if (ribbonInfo.directionsAutoMode === 0 /* GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT */) {
                // set the direction plane from the first line segment for the whole line
                directionPlane = GreasedLineRibbonMesh._GetDirectionFromPoints(pointVectors[0], pointVectors[1], null);
            }
            if (ribbonInfo.directionsAutoMode === 3 /* GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FACE_TO */ && !(ribbonInfo.directions instanceof math_vector/* Vector3 */.Pq)) {
                // eslint-disable-next-line no-throw-literal
                throw "In GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FACE_TO 'GreasedLineMeshOptions.ribbonOptions.directions' must be a Vector3.";
            }
            math_vector/* TmpVectors */.AA.Vector3[1] = ribbonInfo.directions instanceof math_vector/* Vector3 */.Pq ? ribbonInfo.directions : GreasedLineRibbonMesh.DIRECTION_XZ;
            for (let i = 0; i < pointVectors.length - (directionPlane ? 0 : 1); i++) {
                const p1 = pointVectors[i];
                const p2 = pointVectors[i + 1];
                if (directionPlane) {
                    direction = directionPlane;
                }
                else if (ribbonInfo.directionsAutoMode === 3 /* GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FACE_TO */) {
                    p2.subtractToRef(p1, math_vector/* TmpVectors */.AA.Vector3[0]);
                    direction = math_vector/* Vector3 */.Pq.CrossToRef(math_vector/* TmpVectors */.AA.Vector3[0], math_vector/* TmpVectors */.AA.Vector3[1], math_vector/* TmpVectors */.AA.Vector3[2]).normalize();
                }
                else if (ribbonInfo.directionsAutoMode === 1 /* GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FROM_ALL_SEGMENTS */) {
                    direction = GreasedLineRibbonMesh._GetDirectionFromPoints(p1, p2, direction);
                }
                else {
                    // GreasedLineRibbonAutoDirectionMode.DIRECTION_ENHANCED
                    const directionTemp = p2.subtract(p1);
                    directionTemp.applyRotationQuaternionInPlace(directionTemp.x > directionTemp.y && directionTemp.x > directionTemp.z
                        ? rightHandedSystem
                            ? GreasedLineRibbonMesh._RightHandedForwardReadOnlyQuaternion
                            : GreasedLineRibbonMesh._LeftHandedForwardReadOnlyQuaternion
                        : GreasedLineRibbonMesh._LeftReadOnlyQuaternion);
                    direction = directionTemp.normalize();
                }
                fatDirection = direction.multiplyByFloats(width, width, width);
                path1.push(p1.add(fatDirection));
                path2.push(p1.subtract(fatDirection));
            }
            if (!directionPlane) {
                path1.push(pointVectors[pointVectors.length - 1].add(fatDirection));
                path2.push(pointVectors[pointVectors.length - 1].subtract(fatDirection));
            }
        }
        return [path1, path2];
    }
    static _GetDirectionFromPoints(p1, p2, previousDirection) {
        // handle straight lines
        if (p1.x === p2.x && (!previousDirection || previousDirection?.x === 1)) {
            return GreasedLineRibbonMesh.DIRECTION_YZ;
        }
        if (p1.y === p2.y) {
            return GreasedLineRibbonMesh.DIRECTION_XZ;
        }
        if (p1.z === p2.z) {
            return GreasedLineRibbonMesh.DIRECTION_XY;
        }
        return GreasedLineRibbonMesh.DIRECTION_XZ;
    }
    /**
     * Clones the GreasedLineRibbonMesh.
     * @param name new line name
     * @param newParent new parent node
     * @returns cloned line
     */
    clone(name = `${this.name}-cloned`, newParent) {
        const lineOptions = this._createLineOptions();
        const deepCopiedLineOptions = {};
        const pathOptionsCloned = [];
        deepCopier/* DeepCopier */.r.DeepCopy(this._pathsOptions, pathOptionsCloned, undefined, undefined, true);
        deepCopier/* DeepCopier */.r.DeepCopy(lineOptions, deepCopiedLineOptions, ["instance"], undefined, true);
        const cloned = new GreasedLineRibbonMesh(name, this._scene, deepCopiedLineOptions, pathOptionsCloned);
        if (newParent) {
            cloned.parent = newParent;
        }
        cloned.material = this.material;
        return cloned;
    }
    /**
     * Serializes this GreasedLineRibbonMesh
     * @param serializationObject object to write serialization to
     */
    serialize(serializationObject) {
        super.serialize(serializationObject);
        serializationObject.type = this.getClassName();
        serializationObject.lineOptions = this._createLineOptions();
        serializationObject.pathsOptions = this._pathsOptions;
    }
    /**
     * Parses a serialized GreasedLineRibbonMesh
     * @param parsedMesh the serialized GreasedLineRibbonMesh
     * @param scene the scene to create the GreasedLineRibbonMesh in
     * @returns the created GreasedLineRibbonMesh
     */
    static Parse(parsedMesh, scene) {
        const lineOptions = parsedMesh.lineOptions;
        const name = parsedMesh.name;
        const pathOptions = parsedMesh.pathOptions;
        const result = new GreasedLineRibbonMesh(name, scene, lineOptions, pathOptions);
        return result;
    }
    _initGreasedLine() {
        super._initGreasedLine();
        this._paths = [];
        this._counters = [];
        this._slopes = [];
        this._ribbonWidths = [];
    }
    _calculateSegmentLengths(pathArray) {
        const pathArrayLength = pathArray.length;
        this._vSegmentLengths = new Array(pathArrayLength);
        this._vTotalLengths = new Array(pathArrayLength);
        let length = 0;
        for (let pi = 0; pi < pathArrayLength; pi++) {
            const points = pathArray[pi];
            this._vSegmentLengths[pi] = [0]; // first point has 0 distance
            length = 0;
            for (let i = 0; i < points.length - 1; i++) {
                const l = Math.abs(points[i].subtract(points[i + 1]).lengthSquared()); // it's ok to have lengthSquared() here
                length += l;
                this._vSegmentLengths[pi].push(l);
            }
            this._vTotalLengths[pi] = length;
        }
        const positionsLength = pathArray[0].length;
        this._uSegmentLengths = new Array(positionsLength).fill([]);
        this._uTotalLengths = new Array(positionsLength).fill([]);
        const uLength = new math_vector/* Vector3 */.Pq();
        for (let i = 0; i < positionsLength; i++) {
            length = 0;
            for (let pi = 1; pi < pathArrayLength; pi++) {
                pathArray[pi][i].subtractToRef(pathArray[pi - 1][i], uLength);
                const l = uLength.length(); // must be length()
                length += l;
                this._uSegmentLengths[i].push(l);
            }
            this._uTotalLengths[i] = length;
        }
    }
    static _CalculateSlopes(paths) {
        const points1 = paths[0];
        const points2 = paths.length === 2 ? paths[1] : paths[paths.length - 1];
        const slopes = [];
        const slope = new math_vector/* Vector3 */.Pq();
        for (let i = 0; i < points1.length; i++) {
            for (let pi = 0; pi < paths.length; pi++) {
                if (pi === 0 || pi === paths.length - 1) {
                    points1[i].subtract(points2[i]).normalizeToRef(slope);
                    slopes.push(slope.x, slope.y, slope.z);
                    slopes.push(-slope.x, -slope.y, -slope.z);
                }
                else {
                    slopes.push(0, 0, 0, 0, 0, 0);
                }
            }
        }
        return slopes;
    }
    _createVertexBuffers() {
        this._uvs = this._options.uvs ?? this._uvs;
        const vertexData = super._createVertexBuffers(this._options.ribbonOptions?.smoothShading);
        const countersBuffer = new Buffers_buffer/* Buffer */.h(this._engine, this._counters, this._updatable, 1);
        this.setVerticesBuffer(countersBuffer.createVertexBuffer("grl_counters", 0, 1));
        const colorPointersBuffer = new Buffers_buffer/* Buffer */.h(this._engine, this._colorPointers, this._updatable, 1);
        this.setVerticesBuffer(colorPointersBuffer.createVertexBuffer("grl_colorPointers", 0, 1));
        const slopesBuffer = new Buffers_buffer/* Buffer */.h(this._engine, this._slopes, this._updatable, 3);
        this.setVerticesBuffer(slopesBuffer.createVertexBuffer("grl_slopes", 0, 3));
        const widthsBuffer = new Buffers_buffer/* Buffer */.h(this._engine, this._ribbonWidths, this._updatable, 1);
        this.setVerticesBuffer(widthsBuffer.createVertexBuffer("grl_widths", 0, 1));
        this._widthsBuffer = widthsBuffer;
        return vertexData;
    }
}
/**
 * Default line width
 */
GreasedLineRibbonMesh.DEFAULT_WIDTH = 0.1;
GreasedLineRibbonMesh._RightHandedForwardReadOnlyQuaternion = math_vector/* Quaternion */.PT.RotationAxis(math_vector/* Vector3 */.Pq.RightHandedForwardReadOnly, Math.PI / 2);
GreasedLineRibbonMesh._LeftHandedForwardReadOnlyQuaternion = math_vector/* Quaternion */.PT.RotationAxis(math_vector/* Vector3 */.Pq.LeftHandedForwardReadOnly, Math.PI / 2);
GreasedLineRibbonMesh._LeftReadOnlyQuaternion = math_vector/* Quaternion */.PT.RotationAxis(math_vector/* Vector3 */.Pq.LeftReadOnly, Math.PI / 2);
/**
 * Direction which the line segment will be thickened if drawn on the XY plane
 */
GreasedLineRibbonMesh.DIRECTION_XY = math_vector/* Vector3 */.Pq.LeftHandedForwardReadOnly; // doesn't matter in which handed system the scene operates
/**
 * Direction which the line segment will be thickened if drawn on the XZ plane
 */
GreasedLineRibbonMesh.DIRECTION_XZ = math_vector/* Vector3 */.Pq.UpReadOnly;
/**
 * Direction which the line segment will be thickened if drawn on the YZ plane
 */
GreasedLineRibbonMesh.DIRECTION_YZ = math_vector/* Vector3 */.Pq.LeftReadOnly;
//# sourceMappingURL=greasedLineRibbonMesh.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/greasedLineBuilder.js









/**
 * How are the colors distributed along the color table
 * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colors-and-colordistribution}
 */
var GreasedLineMeshColorDistribution;
(function (GreasedLineMeshColorDistribution) {
    /**
     * Do no modify the color table
     */
    GreasedLineMeshColorDistribution[GreasedLineMeshColorDistribution["COLOR_DISTRIBUTION_NONE"] = 0] = "COLOR_DISTRIBUTION_NONE";
    /**
     * Repeat the colors until the color table is full
     */
    GreasedLineMeshColorDistribution[GreasedLineMeshColorDistribution["COLOR_DISTRIBUTION_REPEAT"] = 1] = "COLOR_DISTRIBUTION_REPEAT";
    /**
     * Distribute the colors evenly through the color table
     */
    GreasedLineMeshColorDistribution[GreasedLineMeshColorDistribution["COLOR_DISTRIBUTION_EVEN"] = 2] = "COLOR_DISTRIBUTION_EVEN";
    /**
     * Put the colors to start of the color table a fill the rest with the default color
     */
    GreasedLineMeshColorDistribution[GreasedLineMeshColorDistribution["COLOR_DISTRIBUTION_START"] = 3] = "COLOR_DISTRIBUTION_START";
    /**
     * Put the colors to the end of the color table and fill the rest with the default color
     */
    GreasedLineMeshColorDistribution[GreasedLineMeshColorDistribution["COLOR_DISTRIBUTION_END"] = 4] = "COLOR_DISTRIBUTION_END";
    /**
     * Put the colors to start and to the end of the color table and fill the gap between with the default color
     */
    GreasedLineMeshColorDistribution[GreasedLineMeshColorDistribution["COLOR_DISTRIBUTION_START_END"] = 5] = "COLOR_DISTRIBUTION_START_END";
})(GreasedLineMeshColorDistribution || (GreasedLineMeshColorDistribution = {}));
/**
 * How are the widths distributed along the width table
 * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#widths-and-widthdistribution}
 */
var GreasedLineMeshWidthDistribution;
(function (GreasedLineMeshWidthDistribution) {
    /**
     * Do no modify the width table
     */
    GreasedLineMeshWidthDistribution[GreasedLineMeshWidthDistribution["WIDTH_DISTRIBUTION_NONE"] = 0] = "WIDTH_DISTRIBUTION_NONE";
    /**
     * Repeat the widths until the width table is full
     */
    GreasedLineMeshWidthDistribution[GreasedLineMeshWidthDistribution["WIDTH_DISTRIBUTION_REPEAT"] = 1] = "WIDTH_DISTRIBUTION_REPEAT";
    /**
     * Distribute the widths evenly through the width table
     */
    GreasedLineMeshWidthDistribution[GreasedLineMeshWidthDistribution["WIDTH_DISTRIBUTION_EVEN"] = 2] = "WIDTH_DISTRIBUTION_EVEN";
    /**
     * Put the widths to start of the width table a fill the rest with the default width
     */
    GreasedLineMeshWidthDistribution[GreasedLineMeshWidthDistribution["WIDTH_DISTRIBUTION_START"] = 3] = "WIDTH_DISTRIBUTION_START";
    /**
     * Put the widths to the end of the width table and fill the rest with the default width
     */
    GreasedLineMeshWidthDistribution[GreasedLineMeshWidthDistribution["WIDTH_DISTRIBUTION_END"] = 4] = "WIDTH_DISTRIBUTION_END";
    /**
     * Put the widths to start and to the end of the width table and fill the gap between with the default width
     */
    GreasedLineMeshWidthDistribution[GreasedLineMeshWidthDistribution["WIDTH_DISTRIBUTION_START_END"] = 5] = "WIDTH_DISTRIBUTION_START_END";
})(GreasedLineMeshWidthDistribution || (GreasedLineMeshWidthDistribution = {}));
/**
 * Builder functions for creating GreasedLineMeshes
 */
/**
 * Creates a new @see GreasedLinePluginMaterial
 * @param name name of the material
 * @param options material options @see GreasedLineMaterialOptions
 * @param scene scene or null to use the last scene
 * @returns StandardMaterial or PBRMaterial with the @see GreasedLinePluginMaterial attached to it
 */
function CreateGreasedLineMaterial(name, options, scene) {
    scene = (scene ?? engineStore/* EngineStore */.q.LastCreatedScene);
    let material;
    switch (options.materialType) {
        case 1 /* GreasedLineMeshMaterialType.MATERIAL_TYPE_PBR */:
            material = new pbrMaterial/* PBRMaterial */.Y(name, scene, true); // Forcing glsl for now
            new GreasedLinePluginMaterial(material, scene, options);
            break;
        case 2 /* GreasedLineMeshMaterialType.MATERIAL_TYPE_SIMPLE */:
            material = new GreasedLineSimpleMaterial(name, scene, options);
            break;
        default:
            material = new standardMaterial/* StandardMaterial */.F(name, scene, true); // Forcing glsl for now
            new GreasedLinePluginMaterial(material, scene, options);
            break;
    }
    return material;
}
/**
 * Creates a GreasedLine mesh
 * @param name name of the mesh
 * @param options options for the mesh
 * @param materialOptions material options for the mesh
 * @param scene scene where the mesh will be created
 * @returns instance of GreasedLineMesh
 */
function CreateGreasedLine(name, options, materialOptions, scene) {
    scene = (scene ?? engineStore/* EngineStore */.q.LastCreatedScene);
    let instance;
    const allPoints = GreasedLineTools.ConvertPoints(options.points, options.pointsOptions);
    options.widthDistribution = options.widthDistribution ?? 3 /* GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START */;
    if (options.ribbonOptions) {
        options.ribbonOptions.facesMode = options.ribbonOptions.facesMode ?? 1 /* GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING */;
        options.ribbonOptions.pointsMode = options.ribbonOptions.pointsMode ?? 0 /* GreasedLineRibbonPointsMode.POINTS_MODE_POINTS */;
        options.ribbonOptions.directionsAutoMode =
            options.ribbonOptions.directionsAutoMode ??
                (options.ribbonOptions.directions ? 99 /* GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE */ : 0 /* GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT */);
    }
    materialOptions = materialOptions ?? {
        color: GreasedLineMaterialDefaults.DEFAULT_COLOR,
    };
    materialOptions.createAndAssignMaterial = materialOptions.createAndAssignMaterial ?? true;
    materialOptions.colorDistribution = materialOptions?.colorDistribution ?? 3 /* GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START */;
    materialOptions.materialType = materialOptions.materialType ?? 0 /* GreasedLineMeshMaterialType.MATERIAL_TYPE_STANDARD */;
    const pointsCount = GetPointsCount(allPoints);
    const widths = CompleteGreasedLineWidthTable(pointsCount, options.widths ?? [], options.widthDistribution);
    const colors = materialOptions?.colors
        ? CompleteGreasedLineColorTable(pointsCount, materialOptions.colors, materialOptions.colorDistribution, materialOptions.color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR)
        : undefined;
    // create new mesh if instance is not defined
    const initialGreasedLineOptions = {
        points: allPoints,
        updatable: options.updatable,
        widths,
        lazy: options.lazy,
        ribbonOptions: options.ribbonOptions,
        uvs: options.uvs,
        colorPointers: options.colorPointers,
    };
    if (initialGreasedLineOptions.ribbonOptions) {
        if (initialGreasedLineOptions.ribbonOptions.pointsMode === 0 /* GreasedLineRibbonPointsMode.POINTS_MODE_POINTS */) {
            initialGreasedLineOptions.ribbonOptions.width = materialOptions.width ?? initialGreasedLineOptions.ribbonOptions.width ?? GreasedLineMaterialDefaults.DEFAULT_WIDTH;
        }
    }
    if (!options.instance) {
        instance = initialGreasedLineOptions.ribbonOptions
            ? new GreasedLineRibbonMesh(name, scene, initialGreasedLineOptions)
            : new GreasedLineMesh(name, scene, initialGreasedLineOptions);
        if (materialOptions) {
            const initialMaterialOptions = {
                materialType: materialOptions.materialType,
                dashCount: materialOptions.dashCount,
                dashOffset: materialOptions.dashOffset,
                dashRatio: materialOptions.dashRatio,
                resolution: materialOptions.resolution,
                sizeAttenuation: materialOptions.sizeAttenuation,
                useColors: materialOptions.useColors,
                useDash: materialOptions.useDash,
                visibility: materialOptions.visibility,
                width: materialOptions.width,
                color: materialOptions.color,
                colorMode: materialOptions.colorMode,
                colorsSampling: materialOptions.colorsSampling,
                colorDistributionType: materialOptions.colorDistributionType,
                colors,
                cameraFacing: !options.ribbonOptions,
                colorsTexture: materialOptions.colorsTexture,
            };
            if (materialOptions.createAndAssignMaterial) {
                const material = CreateGreasedLineMaterial(name, initialMaterialOptions, scene);
                instance.material = material;
                if (options.ribbonOptions?.facesMode === 1 /* GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING */) {
                    material.backFaceCulling = false;
                }
            }
        }
    }
    else {
        // update the data on the mesh instance
        instance = options.instance;
        if (instance instanceof GreasedLineRibbonMesh) {
            instance.addPoints(allPoints, initialGreasedLineOptions);
        }
        else {
            // add widths
            const currentWidths = instance.widths;
            if (currentWidths) {
                const newWidths = currentWidths.slice();
                for (const w of widths) {
                    newWidths.push(w);
                }
                instance.widths = newWidths;
            }
            else {
                instance.widths = widths;
            }
            instance.addPoints(allPoints);
            // add UVs
            if (options.uvs) {
                const currentUVs = instance.uvs;
                if (currentUVs) {
                    const newUVs = new Float32Array(currentUVs.length + options.uvs.length);
                    newUVs.set(currentUVs, 0);
                    newUVs.set(options.uvs, currentUVs.length);
                    instance.uvs = newUVs;
                }
                else {
                    instance.uvs = options.uvs;
                }
            }
        }
    }
    // add colors
    // it will merge if any colors already on the instance
    if (colors && options.instance) {
        if (options.instance.greasedLineMaterial) {
            const currentColors = options.instance.greasedLineMaterial.colors;
            if (currentColors) {
                const newColors = currentColors.concat(colors);
                options.instance.greasedLineMaterial.setColors(newColors, instance.isLazy());
            }
        }
    }
    return instance;
}
/**
 * Counts the number of points
 * @param allPoints Array of points [[x, y, z], [x, y, z], ...] or Array of points [x, y, z, x, y, z, ...]
 * @returns total number of points
 */
function GetPointsCount(allPoints) {
    let pointCount = 0;
    for (const points of allPoints) {
        pointCount += points.length / 3;
    }
    return pointCount;
}
/**
 * Completes the width table/fills the missing entries. It means it creates a width entry for every point of the line mesh.
 * You can provide more points the widths when creating the mesh. This function will fill the empty entries.
 * The algorithm used to fill the empty entries can be
 * GreasedLineMeshWidthDistribution.REPEAT - the width table will be repeatedly copied to the empty values [wL, wU] = [wL, wU, wL, wU, wL, wU, wL, wU, ...]
 * GreasedLineMeshWidthDistribution.EVEN - the width table will be evenly copied to the empty values [wL, wU] = [wL, wL, wL, wL, wU, wU, wU, wU]
 * GreasedLineMeshWidthDistribution.START - the width table will be copied at the start of the empty values
 * and rest will be filled width the default width upper and default width lower values [wU, wL] = [wL, wU, dwL, dwU, dwL, dwU, dwL, dwU]
 * GreasedLineMeshWidthDistribution.END - the width table will be copied at the end of the empty values
 * and rest will be filled width the default values [wL, wU] = [wL, wU, dwL, dwU, dwL, dwU, wL, wU]
 * @param pointCount number of points of the line mesh
 * @param widths array of widths [widhtLower, widthUpper, widthLower, widthUpper ...]. Two widths (lower/upper) per point.
 * @param widthsDistribution how to distribute widths if the widths array has fewer entries than pointCount
 * @param defaultWidthUpper the default value which will be used to fill empty width entries - upper width
 * @param defaultWidthLower the default value which will be used to fill empty width entries - lower width
 * @returns completed width table.
 */
function CompleteGreasedLineWidthTable(pointCount, widths, widthsDistribution, defaultWidthUpper = 1, defaultWidthLower = 1) {
    const missingCount = pointCount - widths.length / 2;
    const widthsData = [];
    if (missingCount < 0) {
        return widths.slice(0, pointCount * 2);
    }
    // is the width table shorter than the point table?
    if (missingCount > 0) {
        if (widths.length % 2 != 0) {
            widths.push(defaultWidthUpper);
        }
        // it is, fill in the missing elements
        if (widthsDistribution === 5 /* GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START_END */) {
            const halfCount = Math.floor(widths.length / 2);
            // start sector
            for (let i = 0, j = 0; i < halfCount - 1; i++) {
                widthsData.push(widths[j++]);
                widthsData.push(widths[j++]);
            }
            // middle sector
            const widthL = widths[halfCount / 2];
            const widthU = widths[halfCount / 2 + 1];
            for (let i = 0; i < missingCount; i++) {
                widthsData.push(widthU);
                widthsData.push(widthL);
            }
            // end sector
            for (let i = halfCount; i < widths.length; i += 2) {
                widthsData.push(widths[i]);
                widthsData.push(widths[i + 1]);
            }
        }
        else if (widthsDistribution === 3 /* GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START */) {
            // start sector
            for (let i = 0; i < widths.length; i += 2) {
                widthsData.push(widths[i]);
                widthsData.push(widths[i + 1]);
            }
            // end sector
            for (let i = 0; i < missingCount; i++) {
                widthsData.push(defaultWidthUpper);
                widthsData.push(defaultWidthLower);
            }
        }
        else if (widthsDistribution === 4 /* GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_END */) {
            // start sector
            for (let i = 0; i < missingCount; i++) {
                widthsData.push(defaultWidthUpper);
                widthsData.push(defaultWidthLower);
            }
            // end sector
            for (let i = 0; i < widths.length; i += 2) {
                widthsData.push(widths[i]);
                widthsData.push(widths[i + 1]);
            }
        }
        else if (widthsDistribution === 1 /* GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_REPEAT */) {
            let i = 0;
            for (let x = 0; x < pointCount; x++) {
                widthsData.push(widths[i++]);
                widthsData.push(widths[i++]);
                if (i === widths.length) {
                    i = 0;
                }
            }
        }
        else if (widthsDistribution === 2 /* GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_EVEN */) {
            let j = 0;
            const widthsectorLength = widths.length / ((pointCount - 1) * 2);
            for (let x = 0; x < pointCount; x++) {
                const i = Math.floor(j);
                widthsData.push(widths[i]);
                widthsData.push(widths[i + 1]);
                j += widthsectorLength;
            }
        }
    }
    else {
        for (let i = 0; i < widths.length; i++) {
            widthsData.push(widths[i]);
        }
    }
    return widthsData;
}
/**
 * Completes the color table/fill the missing color entries. It means it creates a color entry for every point of the line mesh.
 * You can provide more points the colors when creating the mesh. This function will fill the empty entries.
 * The algorithm used to fill the empty entries can be
 * GreasedLineMesColorhDistribution.REPEAT - the color table will be repeatedly copied to the empty values [c1, c2] = [c1, c2, c1, c2, c1, c2, c1, c2]
 * GreasedLineMesColorhDistribution.EVEN - the color table will be evenly copied to the empty values [c1, c2] = [c1, c1, c1, c1, c2, c2, c2, c2]
 * GreasedLineMesColorhDistribution.START - the color table will be copied at the start of the empty values
 * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, dc, dc]
 * GreasedLineMesColorhDistribution.START_END - the color table will be copied at the start and the end of the empty values
 * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, c1, c2]
 * @param pointCount number of points of the line mesh
 * @param colors array of Color3 for the color table
 * @param colorDistribution how to distribute colors if the colors array has fewer entries than pointCount
 * @param defaultColor default color to be used to fill empty entries in the color table
 * @returns completed array of Color3s
 */
function CompleteGreasedLineColorTable(pointCount, colors, colorDistribution, defaultColor) {
    pointCount = Math.max(colors.length, pointCount);
    const missingCount = pointCount - colors.length;
    if (missingCount < 0) {
        return colors.slice(0, pointCount);
    }
    const colorsData = [];
    // is the color table shorter than the point table?
    if (missingCount > 0) {
        // it is, fill in the missing elements
        if (colorDistribution === 5 /* GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START_END */) {
            const halfCount = Math.floor(colors.length / 2);
            // start sector
            for (let i = 0; i < halfCount; i++) {
                colorsData.push(colors[i]);
            }
            // middle sector
            for (let i = 0; i < missingCount - 1; i++) {
                colorsData.push(defaultColor);
            }
            // end sector
            for (let i = halfCount; i < colors.length; i++) {
                colorsData.push(colors[i]);
            }
        }
        else if (colorDistribution === 3 /* GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START */) {
            // start sector
            for (let i = 0; i < colors.length; i++) {
                colorsData.push(colors[i]);
            }
            // end sector
            for (let i = 0; i < missingCount; i++) {
                colorsData.push(defaultColor);
            }
        }
        else if (colorDistribution === 4 /* GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_END */) {
            // start sector
            for (let i = 0; i < missingCount - 1; i++) {
                colorsData.push(defaultColor);
            }
            // end sector
            for (let i = 0; i < colors.length; i++) {
                colorsData.push(colors[i]);
            }
        }
        else if (colorDistribution === 1 /* GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_REPEAT */) {
            let i = 0;
            for (let x = 0; x < pointCount; x++) {
                colorsData.push(colors[i]);
                i++;
                if (i === colors.length) {
                    i = 0;
                }
            }
        }
        else if (colorDistribution === 2 /* GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_EVEN */) {
            let j = 0;
            const colorSectorLength = colors.length / (pointCount - 1);
            for (let x = 0; x < pointCount - 1; x++) {
                const i = Math.floor(j);
                colorsData.push(colors[i]);
                j += colorSectorLength;
            }
        }
        else if (colorDistribution === 0 /* GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_NONE */) {
            for (let i = 0; i < colors.length; i++) {
                colorsData.push(colors[i]);
            }
        }
    }
    else {
        for (let i = 0; i < pointCount; i++) {
            colorsData.push(colors[i]);
        }
    }
    return colorsData;
}
//# sourceMappingURL=greasedLineBuilder.js.map
;// ./node_modules/@babylonjs/core/Meshes/Builders/index.js

























//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js
var webGLDataBuffer = __webpack_require__(54329);
;// ./node_modules/@babylonjs/core/Misc/tools.internals.js
/* eslint-disable @typescript-eslint/naming-convention */
/**
 * This file is only for internal use only and should not be used in your code
 */


let _UniqueResolveID = 0;
/**
 * Load an asynchronous script (identified by an url) in a module way. When the url returns, the
 * content of this file is added into a new script element, attached to the DOM (body element)
 * @param scriptUrl defines the url of the script to load
 * @param scriptId defines the id of the script element
 * @returns a promise request object
 * It is up to the caller to provide a script that will do the import and prepare a "returnedValue" variable
 * @internal DO NOT USE outside of Babylon.js core
 */
function _LoadScriptModuleAsync(scriptUrl, scriptId) {
    return new Promise((resolve, reject) => {
        // Need a relay
        let windowAsAny;
        let windowString;
        if ((0,domManagement/* IsWindowObjectExist */.BA)()) {
            windowAsAny = window;
            windowString = "window";
        }
        else if (typeof self !== "undefined") {
            windowAsAny = self;
            windowString = "self";
        }
        else {
            reject(new Error("Cannot load script module outside of a window or a worker"));
            return;
        }
        if (!windowAsAny._LoadScriptModuleResolve) {
            windowAsAny._LoadScriptModuleResolve = {};
        }
        windowAsAny._LoadScriptModuleResolve[_UniqueResolveID] = resolve;
        scriptUrl += `
            ${windowString}._LoadScriptModuleResolve[${_UniqueResolveID}](returnedValue);
            ${windowString}._LoadScriptModuleResolve[${_UniqueResolveID}] = undefined;
        `;
        _UniqueResolveID++;
        tools/* Tools */.S0.LoadScript(scriptUrl, undefined, (message, exception) => {
            reject(exception || new Error(message));
        }, scriptId, true);
    });
}
//# sourceMappingURL=tools.internals.js.map
;// ./node_modules/@babylonjs/core/Meshes/csg2.js








/**
 * Main manifold library
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
let Manifold;
/**
 * Manifold mesh
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
let ManifoldMesh;
/**
 * First ID to use for materials indexing
 */
// eslint-disable-next-line @typescript-eslint/naming-convention
let FirstID;
/**
 * Wrapper around the Manifold library
 * https://manifoldcad.org/
 * Use this class to perform fast boolean operations on meshes
 * #IW43EB#15 - basic operations
 * #JUKXQD#6104 - skull vs box
 * #JUKXQD#6111 - skull vs vertex data
 */
class CSG2 {
    /**
     * Return the size of a vertex (at least 3 for the position)
     */
    get numProp() {
        return this._numProp;
    }
    constructor(manifold, numProp, vertexStructure) {
        this._manifold = manifold;
        this._numProp = numProp;
        this._vertexStructure = vertexStructure;
    }
    _process(operation, csg) {
        if (this.numProp !== csg.numProp) {
            throw new Error("CSG must be used with geometries having the same number of properties");
        }
        return new CSG2(Manifold[operation](this._manifold, csg._manifold), this.numProp, this._vertexStructure);
    }
    /**
     * Run a difference operation between two CSG
     * @param csg defines the CSG to use to create the difference
     * @returns a new csg
     */
    subtract(csg) {
        return this._process("difference", csg);
    }
    /**
     * Run an intersection operation between two CSG
     * @param csg defines the CSG to use to create the intersection
     * @returns a new csg
     */
    intersect(csg) {
        return this._process("intersection", csg);
    }
    /**
     * Run an union operation between two CSG
     * @param csg defines the CSG to use to create the union
     * @returns a new csg
     */
    add(csg) {
        return this._process("union", csg);
    }
    /**
     * Print debug information about the CSG
     */
    printDebug() {
        logger/* Logger */.V.Log("Genus:" + this._manifold.genus());
        const properties = this._manifold.getProperties();
        logger/* Logger */.V.Log("Volume:" + properties.volume);
        logger/* Logger */.V.Log("surface area:" + properties.surfaceArea);
    }
    /**
     * Generate a vertex data from the CSG
     * @param options defines the options to use to rebuild the vertex data
     * @returns a new vertex data
     */
    toVertexData(options) {
        const localOptions = {
            rebuildNormals: false,
            ...options,
        };
        const vertexData = new mesh_vertexData/* VertexData */.P();
        const normalComponent = this._vertexStructure.find((c) => c.kind === Buffers_buffer/* VertexBuffer */.R.NormalKind);
        const manifoldMesh = this._manifold.getMesh(localOptions.rebuildNormals && normalComponent ? [3, 4, 5] : undefined);
        vertexData.indices = manifoldMesh.triVerts.length > 65535 ? new Uint32Array(manifoldMesh.triVerts) : new Uint16Array(manifoldMesh.triVerts);
        for (let i = 0; i < manifoldMesh.triVerts.length; i += 3) {
            vertexData.indices[i] = manifoldMesh.triVerts[i + 2];
            vertexData.indices[i + 1] = manifoldMesh.triVerts[i + 1];
            vertexData.indices[i + 2] = manifoldMesh.triVerts[i];
        }
        const vertexCount = manifoldMesh.vertProperties.length / manifoldMesh.numProp;
        // Attributes
        let offset = 0;
        for (let componentIndex = 0; componentIndex < this._vertexStructure.length; componentIndex++) {
            const component = this._vertexStructure[componentIndex];
            const data = new Float32Array(vertexCount * component.stride);
            for (let i = 0; i < vertexCount; i++) {
                for (let strideIndex = 0; strideIndex < component.stride; strideIndex++) {
                    data[i * component.stride + strideIndex] = manifoldMesh.vertProperties[i * manifoldMesh.numProp + offset + strideIndex];
                }
            }
            vertexData.set(data, component.kind);
            offset += component.stride;
        }
        // Rebuild mesh from vertex data
        return vertexData;
    }
    /**
     * Generate a mesh from the CSG
     * @param name defines the name of the mesh
     * @param scene defines the scene to use to create the mesh
     * @param options defines the options to use to rebuild the mesh
     * @returns a new Mesh
     */
    toMesh(name, scene, options) {
        const localOptions = {
            rebuildNormals: false,
            centerMesh: true,
            ...options,
        };
        const vertexData = this.toVertexData({ rebuildNormals: localOptions.rebuildNormals });
        const normalComponent = this._vertexStructure.find((c) => c.kind === Buffers_buffer/* VertexBuffer */.R.NormalKind);
        const manifoldMesh = this._manifold.getMesh(localOptions.rebuildNormals && normalComponent ? [3, 4, 5] : undefined);
        const vertexCount = manifoldMesh.vertProperties.length / manifoldMesh.numProp;
        // Rebuild mesh from vertex data
        const output = new Meshes_mesh/* Mesh */.e(name, scene);
        vertexData.applyToMesh(output);
        // Center mesh
        if (localOptions.centerMesh) {
            const extents = output.getBoundingInfo().boundingSphere.center;
            output.position.set(-extents.x, -extents.y, -extents.z);
            output.bakeCurrentTransformIntoVertices();
        }
        // Submeshes
        let id = manifoldMesh.runOriginalID[0];
        let start = manifoldMesh.runIndex[0];
        let materialIndex = 0;
        const materials = [];
        scene = output.getScene();
        for (let run = 0; run < manifoldMesh.numRun; ++run) {
            const nextID = manifoldMesh.runOriginalID[run + 1];
            if (nextID !== id) {
                const end = manifoldMesh.runIndex[run + 1];
                new subMesh/* SubMesh */.K(materialIndex, 0, vertexCount, start, end - start, output);
                materials.push(scene.getMaterialByUniqueID(id - FirstID) || scene.defaultMaterial);
                id = nextID;
                start = end;
                materialIndex++;
            }
        }
        if (localOptions.materialToUse) {
            output.material = localOptions.materialToUse;
        }
        else {
            if (materials.length > 1) {
                const multiMaterial = new Materials_multiMaterial/* MultiMaterial */.F(name, scene);
                multiMaterial.subMaterials = materials;
                output.material = multiMaterial;
            }
            else {
                output.material = materials[0];
            }
        }
        return output;
    }
    /**
     * Dispose the CSG resources
     */
    dispose() {
        if (this._manifold) {
            this._manifold.delete();
            this._manifold = null;
        }
    }
    static _ProcessData(vertexCount, triVerts, structure, numProp, runIndex, runOriginalID) {
        const vertProperties = new Float32Array(vertexCount * structure.reduce((acc, cur) => acc + cur.stride, 0));
        for (let i = 0; i < vertexCount; i++) {
            let offset = 0;
            for (let idx = 0; idx < structure.length; idx++) {
                const component = structure[idx];
                for (let strideIndex = 0; strideIndex < component.stride; strideIndex++) {
                    vertProperties[i * numProp + offset + strideIndex] = component.data[i * component.stride + strideIndex];
                }
                offset += component.stride;
            }
        }
        const manifoldMesh = new ManifoldMesh({ numProp: numProp, vertProperties, triVerts, runIndex, runOriginalID });
        manifoldMesh.merge();
        let returnValue;
        try {
            returnValue = new CSG2(new Manifold(manifoldMesh), numProp, structure);
        }
        catch (e) {
            throw new Error("Error while creating the CSG: " + e.message);
        }
        return returnValue;
    }
    static _Construct(data, worldMatrix, runIndex, runOriginalID) {
        // Create the MeshGL for I/O with Manifold library.
        const triVerts = new Uint32Array(data.indices.length);
        // Revert order
        for (let i = 0; i < data.indices.length; i += 3) {
            triVerts[i] = data.indices[i + 2];
            triVerts[i + 1] = data.indices[i + 1];
            triVerts[i + 2] = data.indices[i];
        }
        const tempVector3 = new math_vector/* Vector3 */.Pq();
        let numProp = 3;
        const structure = [{ stride: 3, kind: Buffers_buffer/* VertexBuffer */.R.PositionKind }];
        if (!worldMatrix) {
            structure[0].data = data.positions;
        }
        else {
            const positions = new Float32Array(data.positions.length);
            for (let i = 0; i < data.positions.length; i += 3) {
                math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(data.positions[i], data.positions[i + 1], data.positions[i + 2], worldMatrix, tempVector3);
                tempVector3.toArray(positions, i);
            }
            structure[0].data = positions;
        }
        // Normals
        const sourceNormals = data.normals;
        if (sourceNormals) {
            numProp += 3;
            structure.push({ stride: 3, kind: Buffers_buffer/* VertexBuffer */.R.NormalKind });
            if (!worldMatrix) {
                structure[1].data = sourceNormals;
            }
            else {
                const normals = new Float32Array(sourceNormals.length);
                for (let i = 0; i < sourceNormals.length; i += 3) {
                    math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(sourceNormals[i], sourceNormals[i + 1], sourceNormals[i + 2], worldMatrix, tempVector3);
                    tempVector3.toArray(normals, i);
                }
                structure[1].data = normals;
            }
        }
        // UVs
        for (const kind of [Buffers_buffer/* VertexBuffer */.R.UVKind, Buffers_buffer/* VertexBuffer */.R.UV2Kind, Buffers_buffer/* VertexBuffer */.R.UV3Kind, Buffers_buffer/* VertexBuffer */.R.UV4Kind, Buffers_buffer/* VertexBuffer */.R.UV5Kind, Buffers_buffer/* VertexBuffer */.R.UV6Kind]) {
            const sourceUV = data[kind === Buffers_buffer/* VertexBuffer */.R.UVKind ? "uvs" : kind];
            if (sourceUV) {
                numProp += 2;
                structure.push({ stride: 2, kind: kind, data: sourceUV });
            }
        }
        // Colors
        const sourceColors = data.colors;
        if (sourceColors) {
            numProp += 4;
            structure.push({ stride: 4, kind: Buffers_buffer/* VertexBuffer */.R.ColorKind, data: sourceColors });
        }
        return this._ProcessData(data.positions.length / 3, triVerts, structure, numProp, runIndex, runOriginalID);
    }
    /**
     * Create a new Constructive Solid Geometry from a vertexData
     * @param vertexData defines the vertexData to use to create the CSG
     * @returns a new CSG2 class
     */
    static FromVertexData(vertexData) {
        const sourceVertices = vertexData.positions;
        const sourceIndices = vertexData.indices;
        if (!sourceVertices || !sourceIndices) {
            throw new Error("The vertexData must at least have positions and indices");
        }
        return this._Construct(vertexData, null);
    }
    /**
     * Create a new Constructive Solid Geometry from a mesh
     * @param mesh defines the mesh to use to create the CSG
     * @param ignoreWorldMatrix defines if the world matrix should be ignored
     * @returns a new CSG2 class
     */
    static FromMesh(mesh, ignoreWorldMatrix = false) {
        const sourceVertices = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const sourceIndices = mesh.getIndices();
        const worldMatrix = mesh.computeWorldMatrix(true);
        if (!sourceVertices || !sourceIndices) {
            throw new Error("The mesh must at least have positions and indices");
        }
        // Create a triangle run for each submesh (material)
        const starts = [...Array(mesh.subMeshes.length)].map((_, idx) => mesh.subMeshes[idx].indexStart);
        // Map the materials to ID.
        const sourceMaterial = mesh.material || mesh.getScene().defaultMaterial;
        const isMultiMaterial = sourceMaterial.getClassName() === "MultiMaterial";
        const originalIDs = [...Array(mesh.subMeshes.length)].map((_, idx) => {
            if (isMultiMaterial) {
                return FirstID + sourceMaterial.subMaterials[mesh.subMeshes[idx].materialIndex].uniqueId;
            }
            return FirstID + sourceMaterial.uniqueId;
        });
        // List the runs in sequence.
        const indices = Array.from(starts.keys());
        indices.sort((a, b) => starts[a] - starts[b]);
        const runIndex = new Uint32Array(indices.map((i) => starts[i]));
        const runOriginalID = new Uint32Array(indices.map((i) => originalIDs[i]));
        // Process
        const data = {
            positions: sourceVertices,
            indices: sourceIndices,
            normals: mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind),
            colors: mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind),
            uvs: mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind),
            uvs2: mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UV2Kind),
            uvs3: mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UV3Kind),
            uvs4: mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UV4Kind),
            uvs5: mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UV5Kind),
            uvs6: mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UV6Kind),
        };
        return this._Construct(data, ignoreWorldMatrix ? null : worldMatrix, runIndex, runOriginalID);
    }
}
/**
 * Checks if the Manifold library is ready
 * @returns true if the Manifold library is ready
 */
function IsCSG2Ready() {
    return Manifold !== undefined;
}
/**
 * Initialize the Manifold library
 * @param options defines the options to use to initialize the library
 */
async function InitializeCSG2Async(options) {
    const localOptions = {
        manifoldUrl: "https://unpkg.com/manifold-3d@3.0.0",
        ...options,
    };
    if (localOptions.manifoldInstance) {
        Manifold = localOptions.manifoldInstance;
        ManifoldMesh = localOptions.manifoldMeshInstance;
    }
    else {
        const result = await _LoadScriptModuleAsync(`
            import Module from '${localOptions.manifoldUrl}/manifold.js';
            const wasm = await Module();
            wasm.setup();
            const {Manifold, Mesh} = wasm;
            const returnedValue =  {Manifold, Mesh};
        `);
        Manifold = result.Manifold;
        ManifoldMesh = result.Mesh;
    }
    // Reserve IDs for materials (we consider that there will be no more than 65536 materials)
    FirstID = Manifold.reserveIDs(65536);
}
//# sourceMappingURL=csg2.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/thinInstanceMesh.js
var thinInstanceMesh = __webpack_require__(90203);
;// ./node_modules/@babylonjs/core/Meshes/Node/Enums/nodeGeometryConnectionPointTypes.js
/**
 * Defines the kind of connection point for node geometry
 */
var NodeGeometryBlockConnectionPointTypes;
(function (NodeGeometryBlockConnectionPointTypes) {
    /** Int */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["Int"] = 1] = "Int";
    /** Float */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["Float"] = 2] = "Float";
    /** Vector2 */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["Vector2"] = 4] = "Vector2";
    /** Vector3 */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["Vector3"] = 8] = "Vector3";
    /** Vector4 */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["Vector4"] = 16] = "Vector4";
    /** Matrix */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["Matrix"] = 32] = "Matrix";
    /** Geometry */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["Geometry"] = 64] = "Geometry";
    /** Texture */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["Texture"] = 128] = "Texture";
    /** Detect type based on connection */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["AutoDetect"] = 1024] = "AutoDetect";
    /** Output type that will be defined by input type */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["BasedOnInput"] = 2048] = "BasedOnInput";
    /** Undefined */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["Undefined"] = 4096] = "Undefined";
    /** Bitmask of all types */
    NodeGeometryBlockConnectionPointTypes[NodeGeometryBlockConnectionPointTypes["All"] = 4095] = "All";
})(NodeGeometryBlockConnectionPointTypes || (NodeGeometryBlockConnectionPointTypes = {}));
//# sourceMappingURL=nodeGeometryConnectionPointTypes.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/nodeGeometryBlockConnectionPoint.js


/**
 * Enum used to define the compatibility state between two connection points
 */
var NodeGeometryConnectionPointCompatibilityStates;
(function (NodeGeometryConnectionPointCompatibilityStates) {
    /** Points are compatibles */
    NodeGeometryConnectionPointCompatibilityStates[NodeGeometryConnectionPointCompatibilityStates["Compatible"] = 0] = "Compatible";
    /** Points are incompatible because of their types */
    NodeGeometryConnectionPointCompatibilityStates[NodeGeometryConnectionPointCompatibilityStates["TypeIncompatible"] = 1] = "TypeIncompatible";
    /** Points are incompatible because they are in the same hierarchy **/
    NodeGeometryConnectionPointCompatibilityStates[NodeGeometryConnectionPointCompatibilityStates["HierarchyIssue"] = 2] = "HierarchyIssue";
})(NodeGeometryConnectionPointCompatibilityStates || (NodeGeometryConnectionPointCompatibilityStates = {}));
/**
 * Defines the direction of a connection point
 */
var NodeGeometryConnectionPointDirection;
(function (NodeGeometryConnectionPointDirection) {
    /** Input */
    NodeGeometryConnectionPointDirection[NodeGeometryConnectionPointDirection["Input"] = 0] = "Input";
    /** Output */
    NodeGeometryConnectionPointDirection[NodeGeometryConnectionPointDirection["Output"] = 1] = "Output";
})(NodeGeometryConnectionPointDirection || (NodeGeometryConnectionPointDirection = {}));
/**
 * Defines a connection point for a block
 */
class NodeGeometryConnectionPoint {
    /** Gets the direction of the point */
    get direction() {
        return this._direction;
    }
    /**
     * Gets or sets the connection point type (default is float)
     */
    get type() {
        if (this._type === NodeGeometryBlockConnectionPointTypes.AutoDetect) {
            if (this._ownerBlock.isInput) {
                return this._ownerBlock.type;
            }
            if (this._connectedPoint) {
                return this._connectedPoint.type;
            }
            if (this._linkedConnectionSource) {
                if (this._linkedConnectionSource.isConnected) {
                    return this._linkedConnectionSource.type;
                }
                if (this._linkedConnectionSource._defaultConnectionPointType) {
                    return this._linkedConnectionSource._defaultConnectionPointType;
                }
            }
            if (this._defaultConnectionPointType) {
                return this._defaultConnectionPointType;
            }
        }
        if (this._type === NodeGeometryBlockConnectionPointTypes.BasedOnInput) {
            if (this._typeConnectionSource) {
                if (!this._typeConnectionSource.isConnected && this._defaultConnectionPointType) {
                    return this._defaultConnectionPointType;
                }
                return this._typeConnectionSource.type;
            }
            else if (this._defaultConnectionPointType) {
                return this._defaultConnectionPointType;
            }
        }
        return this._type;
    }
    set type(value) {
        this._type = value;
    }
    /**
     * Gets a boolean indicating that the current point is connected to another NodeMaterialBlock
     */
    get isConnected() {
        return this.connectedPoint !== null || this.hasEndpoints;
    }
    /** Get the other side of the connection (if any) */
    get connectedPoint() {
        return this._connectedPoint;
    }
    /** Get the block that owns this connection point */
    get ownerBlock() {
        return this._ownerBlock;
    }
    /** Get the block connected on the other side of this connection (if any) */
    get sourceBlock() {
        if (!this._connectedPoint) {
            return null;
        }
        return this._connectedPoint.ownerBlock;
    }
    /** Get the block connected on the endpoints of this connection (if any) */
    get connectedBlocks() {
        if (this._endpoints.length === 0) {
            return [];
        }
        return this._endpoints.map((e) => e.ownerBlock);
    }
    /** Gets the list of connected endpoints */
    get endpoints() {
        return this._endpoints;
    }
    /** Gets a boolean indicating if that output point is connected to at least one input */
    get hasEndpoints() {
        return this._endpoints && this._endpoints.length > 0;
    }
    /** Get the inner type (ie AutoDetect for instance instead of the inferred one) */
    get innerType() {
        if (this._linkedConnectionSource && this._linkedConnectionSource.isConnected) {
            return this.type;
        }
        return this._type;
    }
    /** @internal */
    _resetCounters() {
        this._callCount = 0;
        this._executionCount = 0;
    }
    /**
     * Gets the number of times this point was called
     */
    get callCount() {
        return this._callCount;
    }
    /**
     * Gets the number of times this point was executed
     */
    get executionCount() {
        return this._executionCount;
    }
    /**
     * Gets the value represented by this connection point
     * @param state current evaluation state
     * @returns the connected value or the value if nothing is connected
     */
    getConnectedValue(state) {
        if (this.isConnected) {
            if (this._connectedPoint?._storedFunction) {
                this._connectedPoint._callCount++;
                this._connectedPoint._executionCount++;
                return this._connectedPoint._storedFunction(state);
            }
            this._connectedPoint._callCount++;
            this._connectedPoint._executionCount = 1;
            return this._connectedPoint._storedValue;
        }
        this._callCount++;
        this._executionCount = 1;
        return this.value;
    }
    /**
     * Creates a new connection point
     * @param name defines the connection point name
     * @param ownerBlock defines the block hosting this connection point
     * @param direction defines the direction of the connection point
     */
    constructor(name, ownerBlock, direction) {
        /** @internal */
        this._connectedPoint = null;
        /** @internal */
        this._storedValue = null;
        /** @internal */
        this._storedFunction = null;
        /** @internal */
        this._acceptedConnectionPointType = null;
        this._endpoints = new Array();
        this._type = NodeGeometryBlockConnectionPointTypes.Geometry;
        /** @internal */
        this._linkedConnectionSource = null;
        /** @internal */
        this._typeConnectionSource = null;
        /** @internal */
        this._defaultConnectionPointType = null;
        /**
         * Gets or sets the additional types supported by this connection point
         */
        this.acceptedConnectionPointTypes = [];
        /**
         * Gets or sets the additional types excluded by this connection point
         */
        this.excludedConnectionPointTypes = [];
        /**
         * Observable triggered when this point is connected
         */
        this.onConnectionObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable triggered when this point is disconnected
         */
        this.onDisconnectionObservable = new Misc_observable/* Observable */.cP();
        /**
         * Gets or sets a boolean indicating that this connection point is exposed on a frame
         */
        this.isExposedOnFrame = false;
        /**
         * Gets or sets number indicating the position that the port is exposed to on a frame
         */
        this.exposedPortPosition = -1;
        /**
         * Gets the default value used for this point at creation time
         */
        this.defaultValue = null;
        /**
         * Gets or sets the default value used for this point if nothing is connected
         */
        this.value = null;
        /**
         * Gets or sets the min value accepted for this point if nothing is connected
         */
        this.valueMin = null;
        /**
         * Gets or sets the max value accepted for this point if nothing is connected
         */
        this.valueMax = null;
        /** @internal */
        this._callCount = 0;
        /** @internal */
        this._executionCount = 0;
        this._ownerBlock = ownerBlock;
        this.name = name;
        this._direction = direction;
    }
    /**
     * Gets the current class name e.g. "NodeMaterialConnectionPoint"
     * @returns the class name
     */
    getClassName() {
        return "NodeGeometryConnectionPoint";
    }
    /**
     * Gets a boolean indicating if the current point can be connected to another point
     * @param connectionPoint defines the other connection point
     * @returns a boolean
     */
    canConnectTo(connectionPoint) {
        return this.checkCompatibilityState(connectionPoint) === 0 /* NodeGeometryConnectionPointCompatibilityStates.Compatible */;
    }
    /**
     * Gets a number indicating if the current point can be connected to another point
     * @param connectionPoint defines the other connection point
     * @returns a number defining the compatibility state
     */
    checkCompatibilityState(connectionPoint) {
        const ownerBlock = this._ownerBlock;
        const otherBlock = connectionPoint.ownerBlock;
        if (this.type !== connectionPoint.type && connectionPoint.innerType !== NodeGeometryBlockConnectionPointTypes.AutoDetect) {
            // Accepted types
            if (connectionPoint.acceptedConnectionPointTypes && connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) !== -1) {
                return 0 /* NodeGeometryConnectionPointCompatibilityStates.Compatible */;
            }
            else {
                return 1 /* NodeGeometryConnectionPointCompatibilityStates.TypeIncompatible */;
            }
        }
        // Excluded
        if (connectionPoint.excludedConnectionPointTypes && connectionPoint.excludedConnectionPointTypes.indexOf(this.type) !== -1) {
            return 1 /* NodeGeometryConnectionPointCompatibilityStates.TypeIncompatible */;
        }
        // Check hierarchy
        let targetBlock = otherBlock;
        let sourceBlock = ownerBlock;
        if (this.direction === 0 /* NodeGeometryConnectionPointDirection.Input */) {
            targetBlock = ownerBlock;
            sourceBlock = otherBlock;
        }
        if (targetBlock.isAnAncestorOf(sourceBlock)) {
            return 2 /* NodeGeometryConnectionPointCompatibilityStates.HierarchyIssue */;
        }
        return 0 /* NodeGeometryConnectionPointCompatibilityStates.Compatible */;
    }
    /**
     * Connect this point to another connection point
     * @param connectionPoint defines the other connection point
     * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)
     * @returns the current connection point
     */
    connectTo(connectionPoint, ignoreConstraints = false) {
        if (!ignoreConstraints && !this.canConnectTo(connectionPoint)) {
            // eslint-disable-next-line no-throw-literal
            throw "Cannot connect these two connectors.";
        }
        this._endpoints.push(connectionPoint);
        connectionPoint._connectedPoint = this;
        this.onConnectionObservable.notifyObservers(connectionPoint);
        connectionPoint.onConnectionObservable.notifyObservers(this);
        return this;
    }
    /**
     * Disconnect this point from one of his endpoint
     * @param endpoint defines the other connection point
     * @returns the current connection point
     */
    disconnectFrom(endpoint) {
        const index = this._endpoints.indexOf(endpoint);
        if (index === -1) {
            return this;
        }
        this._endpoints.splice(index, 1);
        endpoint._connectedPoint = null;
        this.onDisconnectionObservable.notifyObservers(endpoint);
        endpoint.onDisconnectionObservable.notifyObservers(this);
        return this;
    }
    /**
     * Fill the list of excluded connection point types with all types other than those passed in the parameter
     * @param mask Types (ORed values of NodeMaterialBlockConnectionPointTypes) that are allowed, and thus will not be pushed to the excluded list
     */
    addExcludedConnectionPointFromAllowedTypes(mask) {
        let bitmask = 1;
        while (bitmask < NodeGeometryBlockConnectionPointTypes.All) {
            if (!(mask & bitmask)) {
                this.excludedConnectionPointTypes.push(bitmask);
            }
            bitmask = bitmask << 1;
        }
    }
    /**
     * Serializes this point in a JSON representation
     * @param isInput defines if the connection point is an input (default is true)
     * @returns the serialized point object
     */
    serialize(isInput = true) {
        const serializationObject = {};
        serializationObject.name = this.name;
        serializationObject.displayName = this.displayName;
        if (this.value !== undefined && this.value !== null) {
            if (this.value.asArray) {
                serializationObject.valueType = "BABYLON." + this.value.getClassName();
                serializationObject.value = this.value.asArray();
            }
            else {
                serializationObject.valueType = "number";
                serializationObject.value = this.value;
            }
        }
        if (isInput && this.connectedPoint) {
            serializationObject.inputName = this.name;
            serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId;
            serializationObject.targetConnectionName = this.connectedPoint.name;
            serializationObject.isExposedOnFrame = true;
            serializationObject.exposedPortPosition = this.exposedPortPosition;
        }
        if (this.isExposedOnFrame || this.exposedPortPosition >= 0) {
            serializationObject.isExposedOnFrame = true;
            serializationObject.exposedPortPosition = this.exposedPortPosition;
        }
        return serializationObject;
    }
    /**
     * Release resources
     */
    dispose() {
        this.onConnectionObservable.clear();
        this.onDisconnectionObservable.clear();
    }
}
//# sourceMappingURL=nodeGeometryBlockConnectionPoint.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/nodeGeometryBlock.js








/**
 * Defines a block that can be used inside a node based geometry
 */
class NodeGeometryBlock {
    /**
     * Gets the time spent to build this block (in ms)
     */
    get buildExecutionTime() {
        return this._buildExecutionTime;
    }
    /**
     * Gets the list of input points
     */
    get inputs() {
        return this._inputs;
    }
    /** Gets the list of output points */
    get outputs() {
        return this._outputs;
    }
    /**
     * Gets or set the name of the block
     */
    get name() {
        return this._name;
    }
    set name(value) {
        this._name = value;
    }
    /**
     * Gets a boolean indicating if this block is an input
     */
    get isInput() {
        return this._isInput;
    }
    /**
     * Gets a boolean indicating if this block is a teleport out
     */
    get isTeleportOut() {
        return this._isTeleportOut;
    }
    /**
     * Gets a boolean indicating if this block is a teleport in
     */
    get isTeleportIn() {
        return this._isTeleportIn;
    }
    /**
     * Gets a boolean indicating if this block is a debug block
     */
    get isDebug() {
        return this._isDebug;
    }
    /**
     * Gets a boolean indicating that this block can only be used once per NodeGeometry
     */
    get isUnique() {
        return this._isUnique;
    }
    /**
     * Gets the current class name e.g. "NodeGeometryBlock"
     * @returns the class name
     */
    getClassName() {
        return "NodeGeometryBlock";
    }
    _inputRename(name) {
        return name;
    }
    _outputRename(name) {
        return name;
    }
    /**
     * Checks if the current block is an ancestor of a given block
     * @param block defines the potential descendant block to check
     * @returns true if block is a descendant
     */
    isAnAncestorOf(block) {
        for (const output of this._outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                if (endpoint.ownerBlock === block) {
                    return true;
                }
                if (endpoint.ownerBlock.isAnAncestorOf(block)) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Checks if the current block is an ancestor of a given type
     * @param type defines the potential type to check
     * @returns true if block is a descendant
     */
    isAnAncestorOfType(type) {
        if (this.getClassName() === type) {
            return true;
        }
        for (const output of this._outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                if (endpoint.ownerBlock.isAnAncestorOfType(type)) {
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * Get the first descendant using a predicate
     * @param predicate defines the predicate to check
     * @returns descendant or null if none found
     */
    getDescendantOfPredicate(predicate) {
        if (predicate(this)) {
            return this;
        }
        for (const output of this._outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                const descendant = endpoint.ownerBlock.getDescendantOfPredicate(predicate);
                if (descendant) {
                    return descendant;
                }
            }
        }
        return null;
    }
    /**
     * @internal
     */
    get _isReadyState() {
        return null;
    }
    /**
     * Creates a new NodeGeometryBlock
     * @param name defines the block name
     */
    constructor(name) {
        this._name = "";
        this._isInput = false;
        this._isTeleportOut = false;
        this._isTeleportIn = false;
        this._isDebug = false;
        this._isUnique = false;
        this._buildExecutionTime = 0;
        /**
         * Gets an observable raised when the block is built
         */
        this.onBuildObservable = new Misc_observable/* Observable */.cP();
        /** @internal */
        this._inputs = new Array();
        /** @internal */
        this._outputs = new Array();
        /** @internal */
        this._codeVariableName = "";
        /** Gets or sets a boolean indicating that this input can be edited from a collapsed frame */
        this.visibleOnFrame = false;
        this._name = name;
        this.uniqueId = uniqueIdGenerator/* UniqueIdGenerator */.K.UniqueId;
    }
    /**
     * Register a new input. Must be called inside a block constructor
     * @param name defines the connection point name
     * @param type defines the connection point type
     * @param isOptional defines a boolean indicating that this input can be omitted
     * @param value value to return if there is no connection
     * @param valueMin min value accepted for value
     * @param valueMax max value accepted for value
     * @returns the current block
     */
    registerInput(name, type, isOptional = false, value, valueMin, valueMax) {
        const point = new NodeGeometryConnectionPoint(name, this, 0 /* NodeGeometryConnectionPointDirection.Input */);
        point.type = type;
        point.isOptional = isOptional;
        point.defaultValue = value;
        point.value = value;
        point.valueMin = valueMin;
        point.valueMax = valueMax;
        this._inputs.push(point);
        return this;
    }
    /**
     * Register a new output. Must be called inside a block constructor
     * @param name defines the connection point name
     * @param type defines the connection point type
     * @param point an already created connection point. If not provided, create a new one
     * @returns the current block
     */
    registerOutput(name, type, point) {
        point = point ?? new NodeGeometryConnectionPoint(name, this, 1 /* NodeGeometryConnectionPointDirection.Output */);
        point.type = type;
        this._outputs.push(point);
        return this;
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _buildBlock(state) {
        // Empty. Must be defined by child nodes
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _customBuildStep(state) {
        // Must be implemented by children
    }
    /**
     * Build the current node and generate the vertex data
     * @param state defines the current generation state
     * @returns true if already built
     */
    build(state) {
        if (this._buildId === state.buildId) {
            return true;
        }
        if (this._outputs.length > 0) {
            if (!this._outputs.some((o) => o.hasEndpoints) && !this.isDebug) {
                return false;
            }
            this.outputs.forEach((o) => o._resetCounters());
        }
        this._buildId = state.buildId;
        // Check if "parent" blocks are compiled
        for (const input of this._inputs) {
            if (!input.connectedPoint) {
                if (!input.isOptional) {
                    // Emit a warning
                    state.notConnectedNonOptionalInputs.push(input);
                }
                continue;
            }
            const block = input.connectedPoint.ownerBlock;
            if (block && block !== this) {
                block.build(state);
            }
        }
        this._customBuildStep(state);
        // Logs
        if (state.verbose) {
            logger/* Logger */.V.Log(`Building ${this.name} [${this.getClassName()}]`);
        }
        const now = precisionDate/* PrecisionDate */.j.Now;
        this._buildBlock(state);
        this._buildExecutionTime = precisionDate/* PrecisionDate */.j.Now - now;
        this.onBuildObservable.notifyObservers(this);
        return false;
    }
    _linkConnectionTypes(inputIndex0, inputIndex1, looseCoupling = false) {
        if (looseCoupling) {
            this._inputs[inputIndex1]._acceptedConnectionPointType = this._inputs[inputIndex0];
        }
        else {
            this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1];
        }
        this._inputs[inputIndex1]._linkedConnectionSource = this._inputs[inputIndex0];
    }
    /**
     * Initialize the block and prepare the context for build
     */
    initialize() {
        // Do nothing
    }
    /**
     * Lets the block try to connect some inputs automatically
     * @param _nodeGeometry defines the node geometry to use for auto connection
     */
    autoConfigure(_nodeGeometry) {
        // Do nothing
    }
    /**
     * Find an input by its name
     * @param name defines the name of the input to look for
     * @returns the input or null if not found
     */
    getInputByName(name) {
        const filter = this._inputs.filter((e) => e.name === name);
        if (filter.length) {
            return filter[0];
        }
        return null;
    }
    /**
     * Find an output by its name
     * @param name defines the name of the output to look for
     * @returns the output or null if not found
     */
    getOutputByName(name) {
        const filter = this._outputs.filter((e) => e.name === name);
        if (filter.length) {
            return filter[0];
        }
        return null;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.customType = "BABYLON." + this.getClassName();
        serializationObject.id = this.uniqueId;
        serializationObject.name = this.name;
        serializationObject.visibleOnFrame = this.visibleOnFrame;
        serializationObject.inputs = [];
        serializationObject.outputs = [];
        for (const input of this.inputs) {
            serializationObject.inputs.push(input.serialize());
        }
        for (const output of this.outputs) {
            serializationObject.outputs.push(output.serialize(false));
        }
        return serializationObject;
    }
    /**
     * @internal
     */
    _deserialize(serializationObject) {
        this._name = serializationObject.name;
        this.comments = serializationObject.comments;
        this.visibleOnFrame = !!serializationObject.visibleOnFrame;
        this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);
    }
    _deserializePortDisplayNamesAndExposedOnFrame(serializationObject) {
        const serializedInputs = serializationObject.inputs;
        const serializedOutputs = serializationObject.outputs;
        if (serializedInputs) {
            serializedInputs.forEach((port) => {
                const input = this.inputs.find((i) => i.name === port.name);
                if (!input) {
                    return;
                }
                if (port.displayName) {
                    input.displayName = port.displayName;
                }
                if (port.isExposedOnFrame) {
                    input.isExposedOnFrame = port.isExposedOnFrame;
                    input.exposedPortPosition = port.exposedPortPosition;
                }
                if (port.value !== undefined && port.value !== null) {
                    if (port.valueType === "number") {
                        input.value = port.value;
                    }
                    else {
                        const valueType = (0,typeStore/* GetClass */.n9)(port.valueType);
                        if (valueType) {
                            input.value = valueType.FromArray(port.value);
                        }
                    }
                }
            });
        }
        if (serializedOutputs) {
            serializedOutputs.forEach((port, i) => {
                if (port.displayName) {
                    this.outputs[i].displayName = port.displayName;
                }
                if (port.isExposedOnFrame) {
                    this.outputs[i].isExposedOnFrame = port.isExposedOnFrame;
                    this.outputs[i].exposedPortPosition = port.exposedPortPosition;
                }
            });
        }
    }
    _dumpPropertiesCode() {
        const variableName = this._codeVariableName;
        return `${variableName}.visibleOnFrame = ${this.visibleOnFrame};\n`;
    }
    /**
     * @internal
     */
    _dumpCodeForOutputConnections(alreadyDumped) {
        let codeString = "";
        if (alreadyDumped.indexOf(this) !== -1) {
            return codeString;
        }
        alreadyDumped.push(this);
        for (const input of this.inputs) {
            if (!input.isConnected) {
                continue;
            }
            const connectedOutput = input.connectedPoint;
            const connectedBlock = connectedOutput.ownerBlock;
            codeString += connectedBlock._dumpCodeForOutputConnections(alreadyDumped);
            codeString += `${connectedBlock._codeVariableName}.${connectedBlock._outputRename(connectedOutput.name)}.connectTo(${this._codeVariableName}.${this._inputRename(input.name)});\n`;
        }
        return codeString;
    }
    /**
     * @internal
     */
    _dumpCode(uniqueNames, alreadyDumped) {
        alreadyDumped.push(this);
        // Get unique name
        const nameAsVariableName = this.name.replace(/[^A-Za-z_]+/g, "");
        this._codeVariableName = nameAsVariableName || `${this.getClassName()}_${this.uniqueId}`;
        if (uniqueNames.indexOf(this._codeVariableName) !== -1) {
            let index = 0;
            do {
                index++;
                this._codeVariableName = nameAsVariableName + index;
            } while (uniqueNames.indexOf(this._codeVariableName) !== -1);
        }
        uniqueNames.push(this._codeVariableName);
        // Declaration
        let codeString = `\n// ${this.getClassName()}\n`;
        if (this.comments) {
            codeString += `// ${this.comments}\n`;
        }
        const className = this.getClassName();
        if (className === "GeometryInputBlock") {
            const block = this;
            const blockType = block.type;
            codeString += `var ${this._codeVariableName} = new BABYLON.GeometryInputBlock("${this.name}", ${blockType});\n`;
        }
        else {
            codeString += `var ${this._codeVariableName} = new BABYLON.${className}("${this.name}");\n`;
        }
        // Properties
        codeString += this._dumpPropertiesCode();
        // Inputs
        for (const input of this.inputs) {
            if (!input.isConnected) {
                continue;
            }
            const connectedOutput = input.connectedPoint;
            const connectedBlock = connectedOutput.ownerBlock;
            if (alreadyDumped.indexOf(connectedBlock) === -1) {
                codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        // Outputs
        for (const output of this.outputs) {
            if (!output.hasEndpoints) {
                continue;
            }
            for (const endpoint of output.endpoints) {
                const connectedBlock = endpoint.ownerBlock;
                if (connectedBlock && alreadyDumped.indexOf(connectedBlock) === -1) {
                    codeString += connectedBlock._dumpCode(uniqueNames, alreadyDumped);
                }
            }
        }
        return codeString;
    }
    /**
     * Clone the current block to a new identical block
     * @returns a copy of the current block
     */
    clone() {
        const serializationObject = this.serialize();
        const blockType = (0,typeStore/* GetClass */.n9)(serializationObject.customType);
        if (blockType) {
            const block = new blockType();
            block._deserialize(serializationObject);
            return block;
        }
        return null;
    }
    /**
     * Release resources
     */
    dispose() {
        for (const input of this.inputs) {
            input.dispose();
        }
        for (const output of this.outputs) {
            output.dispose();
        }
        this.onBuildObservable.clear();
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("comment")
], NodeGeometryBlock.prototype, "comments", void 0);
//# sourceMappingURL=nodeGeometryBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryOutputBlock.js



/**
 * Block used to generate the final geometry
 */
class GeometryOutputBlock extends NodeGeometryBlock {
    /**
     * Gets the current vertex data if the graph was successfully built
     */
    get currentVertexData() {
        return this._vertexData;
    }
    /**
     * Create a new GeometryOutputBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._vertexData = null;
        this._isUnique = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryOutputBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    _buildBlock(state) {
        state.vertexData = this.geometry.getConnectedValue(state);
        this._vertexData = state.vertexData;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryOutputBlock", GeometryOutputBlock);
//# sourceMappingURL=geometryOutputBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Enums/nodeGeometryContextualSources.js
/**
 * Defines the kind of contextual sources for node geometry
 */
var NodeGeometryContextualSources;
(function (NodeGeometryContextualSources) {
    /** None */
    NodeGeometryContextualSources[NodeGeometryContextualSources["None"] = 0] = "None";
    /** Positions */
    NodeGeometryContextualSources[NodeGeometryContextualSources["Positions"] = 1] = "Positions";
    /** Normals */
    NodeGeometryContextualSources[NodeGeometryContextualSources["Normals"] = 2] = "Normals";
    /** Tangents */
    NodeGeometryContextualSources[NodeGeometryContextualSources["Tangents"] = 3] = "Tangents";
    /** UV */
    NodeGeometryContextualSources[NodeGeometryContextualSources["UV"] = 4] = "UV";
    /** UV2 */
    NodeGeometryContextualSources[NodeGeometryContextualSources["UV2"] = 5] = "UV2";
    /** UV3 */
    NodeGeometryContextualSources[NodeGeometryContextualSources["UV3"] = 6] = "UV3";
    /** UV4 */
    NodeGeometryContextualSources[NodeGeometryContextualSources["UV4"] = 7] = "UV4";
    /** UV5 */
    NodeGeometryContextualSources[NodeGeometryContextualSources["UV5"] = 8] = "UV5";
    /** UV6 */
    NodeGeometryContextualSources[NodeGeometryContextualSources["UV6"] = 9] = "UV6";
    /** Colors */
    NodeGeometryContextualSources[NodeGeometryContextualSources["Colors"] = 10] = "Colors";
    /** VertexID */
    NodeGeometryContextualSources[NodeGeometryContextualSources["VertexID"] = 11] = "VertexID";
    /** FaceID */
    NodeGeometryContextualSources[NodeGeometryContextualSources["FaceID"] = 12] = "FaceID";
    /** GeometryID */
    NodeGeometryContextualSources[NodeGeometryContextualSources["GeometryID"] = 13] = "GeometryID";
    /** CollectionID */
    NodeGeometryContextualSources[NodeGeometryContextualSources["CollectionID"] = 14] = "CollectionID";
    /** LoopID */
    NodeGeometryContextualSources[NodeGeometryContextualSources["LoopID"] = 15] = "LoopID";
    /** InstanceID */
    NodeGeometryContextualSources[NodeGeometryContextualSources["InstanceID"] = 16] = "InstanceID";
    /** LatticeID */
    NodeGeometryContextualSources[NodeGeometryContextualSources["LatticeID"] = 17] = "LatticeID";
    /** LatticeControl */
    NodeGeometryContextualSources[NodeGeometryContextualSources["LatticeControl"] = 18] = "LatticeControl";
})(NodeGeometryContextualSources || (NodeGeometryContextualSources = {}));
//# sourceMappingURL=nodeGeometryContextualSources.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/nodeGeometryBuildState.js



/**
 * Class used to store node based geometry build state
 */
class NodeGeometryBuildState {
    constructor() {
        this._rotationMatrix = new math_vector/* Matrix */.uq();
        this._scalingMatrix = new math_vector/* Matrix */.uq();
        this._positionMatrix = new math_vector/* Matrix */.uq();
        this._scalingRotationMatrix = new math_vector/* Matrix */.uq();
        this._transformMatrix = new math_vector/* Matrix */.uq();
        this._tempVector3 = new math_vector/* Vector3 */.Pq();
        /** Gets or sets the list of non connected mandatory inputs */
        this.notConnectedNonOptionalInputs = [];
        /** Gets or sets the list of non contextual inputs having no contextudal data */
        this.noContextualData = [];
        /** Gets or sets the vertex data */
        this.vertexData = null;
        this._geometryContext = null;
        this._executionContext = null;
        this._instancingContext = null;
        this._geometryContextStack = [];
        this._executionContextStack = [];
        this._instancingContextStack = [];
    }
    /** Gets or sets the geometry context */
    get geometryContext() {
        return this._geometryContext;
    }
    /** Gets or sets the execution context */
    get executionContext() {
        return this._executionContext;
    }
    /** Gets or sets the instancing context */
    get instancingContext() {
        return this._instancingContext;
    }
    /**
     * Push the new active geometry context
     * @param geometryContext defines the geometry context
     */
    pushGeometryContext(geometryContext) {
        this._geometryContext = geometryContext;
        this._geometryContextStack.push(this._geometryContext);
    }
    /**
     * Push the new active execution context
     * @param executionContext defines the execution context
     */
    pushExecutionContext(executionContext) {
        this._executionContext = executionContext;
        this._executionContextStack.push(this._executionContext);
    }
    /**
     * Push the new active instancing context
     * @param instancingContext defines the instancing context
     */
    pushInstancingContext(instancingContext) {
        this._instancingContext = instancingContext;
        this._instancingContextStack.push(this._instancingContext);
    }
    /**
     * Remove current geometry context and restore the previous one
     */
    restoreGeometryContext() {
        this._geometryContextStack.pop();
        this._geometryContext = this._geometryContextStack.length > 0 ? this._geometryContextStack[this._geometryContextStack.length - 1] : null;
    }
    /**
     * Remove current execution context and restore the previous one
     */
    restoreExecutionContext() {
        this._executionContextStack.pop();
        this._executionContext = this._executionContextStack.length > 0 ? this._executionContextStack[this._executionContextStack.length - 1] : null;
    }
    /**
     * Remove current isntancing context and restore the previous one
     */
    restoreInstancingContext() {
        this._instancingContextStack.pop();
        this._instancingContext = this._instancingContextStack.length > 0 ? this._instancingContextStack[this._instancingContextStack.length - 1] : null;
    }
    /**
     * Gets the value associated with a contextual source
     * @param source Source of the contextual value
     * @param skipWarning Do not store the warning for reporting if true
     * @returns the value associated with the source
     */
    getContextualValue(source, skipWarning = false) {
        if (!this.executionContext) {
            if (!skipWarning) {
                this.noContextualData.push(source);
            }
            return null;
        }
        const index = this.executionContext.getExecutionIndex();
        switch (source) {
            case NodeGeometryContextualSources.Positions:
                if (this.executionContext.getOverridePositionsContextualValue) {
                    return this.executionContext.getOverridePositionsContextualValue();
                }
                if (!this.geometryContext || !this.geometryContext.positions) {
                    return math_vector/* Vector3 */.Pq.Zero();
                }
                return math_vector/* Vector3 */.Pq.FromArray(this.geometryContext.positions, index * 3);
            case NodeGeometryContextualSources.Normals:
                if (this.executionContext.getOverrideNormalsContextualValue) {
                    return this.executionContext.getOverrideNormalsContextualValue();
                }
                if (!this.geometryContext || !this.geometryContext.normals) {
                    return math_vector/* Vector3 */.Pq.Zero();
                }
                return math_vector/* Vector3 */.Pq.FromArray(this.geometryContext.normals, index * 3);
            case NodeGeometryContextualSources.Colors:
                if (!this.geometryContext || !this.geometryContext.colors) {
                    return math_vector/* Vector4 */.IU.Zero();
                }
                return math_vector/* Vector4 */.IU.FromArray(this.geometryContext.colors, index * 4);
            case NodeGeometryContextualSources.Tangents:
                if (!this.geometryContext || !this.geometryContext.tangents) {
                    return math_vector/* Vector4 */.IU.Zero();
                }
                return math_vector/* Vector4 */.IU.FromArray(this.geometryContext.tangents, index * 4);
            case NodeGeometryContextualSources.UV:
                if (this.executionContext.getOverrideUVs1ContextualValue) {
                    return this.executionContext.getOverrideUVs1ContextualValue();
                }
                if (!this.geometryContext || !this.geometryContext.uvs) {
                    return math_vector/* Vector2 */.I9.Zero();
                }
                return math_vector/* Vector2 */.I9.FromArray(this.geometryContext.uvs, index * 2);
            case NodeGeometryContextualSources.UV2:
                if (!this.geometryContext || !this.geometryContext.uvs2) {
                    return math_vector/* Vector2 */.I9.Zero();
                }
                return math_vector/* Vector2 */.I9.FromArray(this.geometryContext.uvs2, index * 2);
            case NodeGeometryContextualSources.UV3:
                if (!this.geometryContext || !this.geometryContext.uvs3) {
                    return math_vector/* Vector2 */.I9.Zero();
                }
                return math_vector/* Vector2 */.I9.FromArray(this.geometryContext.uvs3, index * 2);
            case NodeGeometryContextualSources.UV4:
                if (!this.geometryContext || !this.geometryContext.uvs4) {
                    return math_vector/* Vector2 */.I9.Zero();
                }
                return math_vector/* Vector2 */.I9.FromArray(this.geometryContext.uvs4, index * 2);
            case NodeGeometryContextualSources.UV5:
                if (!this.geometryContext || !this.geometryContext.uvs5) {
                    return math_vector/* Vector2 */.I9.Zero();
                }
                return math_vector/* Vector2 */.I9.FromArray(this.geometryContext.uvs5, index * 2);
            case NodeGeometryContextualSources.UV6:
                if (!this.geometryContext || !this.geometryContext.uvs6) {
                    return math_vector/* Vector2 */.I9.Zero();
                }
                return math_vector/* Vector2 */.I9.FromArray(this.geometryContext.uvs6, index * 2);
            case NodeGeometryContextualSources.VertexID:
                return index;
            case NodeGeometryContextualSources.FaceID:
                return this.executionContext.getExecutionFaceIndex();
            case NodeGeometryContextualSources.LoopID:
                return this.executionContext.getExecutionLoopIndex();
            case NodeGeometryContextualSources.InstanceID:
                return this.instancingContext ? this.instancingContext.getInstanceIndex() : 0;
            case NodeGeometryContextualSources.GeometryID:
                return !this.geometryContext ? 0 : this.geometryContext.uniqueId;
            case NodeGeometryContextualSources.CollectionID: {
                if (!this.geometryContext || !this.geometryContext.metadata) {
                    return 0;
                }
                return this.geometryContext.metadata.collectionId || 0;
            }
            case NodeGeometryContextualSources.LatticeID: {
                if (this.executionContext.getOverridePositionsContextualValue) {
                    return this.executionContext.getOverridePositionsContextualValue();
                }
                return math_vector/* Vector3 */.Pq.Zero();
            }
            case NodeGeometryContextualSources.LatticeControl: {
                if (this.executionContext.getOverrideNormalsContextualValue) {
                    return this.executionContext.getOverrideNormalsContextualValue();
                }
                return math_vector/* Vector3 */.Pq.Zero();
            }
        }
        return null;
    }
    /**
     * Adapt a value to a target type
     * @param source defines the value to adapt
     * @param targetType defines the target type
     * @returns the adapted value
     */
    adapt(source, targetType) {
        const value = source.getConnectedValue(this) || 0;
        if (source.type === targetType) {
            return value;
        }
        switch (targetType) {
            case NodeGeometryBlockConnectionPointTypes.Vector2:
                return new math_vector/* Vector2 */.I9(value, value);
            case NodeGeometryBlockConnectionPointTypes.Vector3:
                return new math_vector/* Vector3 */.Pq(value, value, value);
            case NodeGeometryBlockConnectionPointTypes.Vector4:
                return new math_vector/* Vector4 */.IU(value, value, value, value);
        }
        return null;
    }
    /**
     * Adapt an input value to a target type
     * @param source defines the value to adapt
     * @param targetType defines the target type
     * @param defaultValue defines the default value to use if not connected
     * @returns the adapted value
     */
    adaptInput(source, targetType, defaultValue) {
        if (!source.isConnected) {
            return source.value || defaultValue;
        }
        const value = source.getConnectedValue(this);
        if (source._connectedPoint?.type === targetType) {
            return value;
        }
        switch (targetType) {
            case NodeGeometryBlockConnectionPointTypes.Vector2:
                return new math_vector/* Vector2 */.I9(value, value);
            case NodeGeometryBlockConnectionPointTypes.Vector3:
                return new math_vector/* Vector3 */.Pq(value, value, value);
            case NodeGeometryBlockConnectionPointTypes.Vector4:
                return new math_vector/* Vector4 */.IU(value, value, value, value);
        }
        return null;
    }
    /**
     * Emits console errors and exceptions if there is a failing check
     */
    emitErrors() {
        let errorMessage = "";
        for (const notConnectedInput of this.notConnectedNonOptionalInputs) {
            errorMessage += `input ${notConnectedInput.name} from block ${notConnectedInput.ownerBlock.name}[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\n`;
        }
        for (const source of this.noContextualData) {
            errorMessage += `Contextual input ${NodeGeometryContextualSources[source]} has no context to pull data from (must be connected to a setXXX block or a instantiateXXX block).\n`;
        }
        if (errorMessage) {
            // eslint-disable-next-line no-throw-literal
            throw "Build of NodeGeometry failed:\n" + errorMessage;
        }
    }
    /** @internal  */
    _instantiate(clone, currentPosition, rotation, scaling, additionalVertexData) {
        // Transform
        math_vector/* Matrix */.uq.ScalingToRef(scaling.x, scaling.y, scaling.z, this._scalingMatrix);
        math_vector/* Matrix */.uq.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, this._rotationMatrix);
        math_vector/* Matrix */.uq.TranslationToRef(currentPosition.x, currentPosition.y, currentPosition.z, this._positionMatrix);
        this._scalingMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix);
        this._scalingRotationMatrix.multiplyToRef(this._positionMatrix, this._transformMatrix);
        for (let clonePositionIndex = 0; clonePositionIndex < clone.positions.length; clonePositionIndex += 3) {
            this._tempVector3.fromArray(clone.positions, clonePositionIndex);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._tempVector3, this._transformMatrix, this._tempVector3);
            this._tempVector3.toArray(clone.positions, clonePositionIndex);
            if (clone.normals) {
                this._tempVector3.fromArray(clone.normals, clonePositionIndex);
                math_vector/* Vector3 */.Pq.TransformNormalToRef(this._tempVector3, this._scalingRotationMatrix, this._tempVector3);
                this._tempVector3.toArray(clone.normals, clonePositionIndex);
            }
        }
        additionalVertexData.push(clone);
    }
    /** @internal  */
    _instantiateWithMatrix(clone, transform, additionalVertexData) {
        for (let clonePositionIndex = 0; clonePositionIndex < clone.positions.length; clonePositionIndex += 3) {
            this._tempVector3.fromArray(clone.positions, clonePositionIndex);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._tempVector3, transform, this._tempVector3);
            this._tempVector3.toArray(clone.positions, clonePositionIndex);
            if (clone.normals) {
                this._tempVector3.fromArray(clone.normals, clonePositionIndex);
                math_vector/* Vector3 */.Pq.TransformNormalToRef(this._tempVector3, transform, this._tempVector3);
                this._tempVector3.toArray(clone.normals, clonePositionIndex);
            }
        }
        additionalVertexData.push(clone);
    }
    /** @internal  */
    _instantiateWithPositionAndMatrix(clone, currentPosition, transform, additionalVertexData) {
        math_vector/* Matrix */.uq.TranslationToRef(currentPosition.x, currentPosition.y, currentPosition.z, this._positionMatrix);
        transform.multiplyToRef(this._positionMatrix, this._transformMatrix);
        for (let clonePositionIndex = 0; clonePositionIndex < clone.positions.length; clonePositionIndex += 3) {
            this._tempVector3.fromArray(clone.positions, clonePositionIndex);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._tempVector3, this._transformMatrix, this._tempVector3);
            this._tempVector3.toArray(clone.positions, clonePositionIndex);
            if (clone.normals) {
                this._tempVector3.fromArray(clone.normals, clonePositionIndex);
                math_vector/* Vector3 */.Pq.TransformNormalToRef(this._tempVector3, this._transformMatrix, this._tempVector3);
                this._tempVector3.toArray(clone.normals, clonePositionIndex);
            }
        }
        additionalVertexData.push(clone);
    }
}
//# sourceMappingURL=nodeGeometryBuildState.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryInputBlock.js






/**
 * Block used to expose an input value
 */
class GeometryInputBlock extends NodeGeometryBlock {
    /**
     * Gets or sets the connection point type (default is float)
     */
    get type() {
        if (this._type === NodeGeometryBlockConnectionPointTypes.AutoDetect) {
            if (this.value != null) {
                if (!isNaN(this.value)) {
                    this._type = NodeGeometryBlockConnectionPointTypes.Float;
                    return this._type;
                }
                switch (this.value.getClassName()) {
                    case "Vector2":
                        this._type = NodeGeometryBlockConnectionPointTypes.Vector2;
                        return this._type;
                    case "Vector3":
                        this._type = NodeGeometryBlockConnectionPointTypes.Vector3;
                        return this._type;
                    case "Vector4":
                        this._type = NodeGeometryBlockConnectionPointTypes.Vector4;
                        return this._type;
                    case "Matrix":
                        this._type = NodeGeometryBlockConnectionPointTypes.Matrix;
                        return this._type;
                }
            }
        }
        return this._type;
    }
    /**
     * Gets a boolean indicating that the current connection point is a contextual value
     */
    get isContextual() {
        return this._contextualSource !== NodeGeometryContextualSources.None;
    }
    /**
     * Gets or sets the current contextual value
     */
    get contextualValue() {
        return this._contextualSource;
    }
    set contextualValue(value) {
        this._contextualSource = value;
        switch (value) {
            case NodeGeometryContextualSources.Positions:
            case NodeGeometryContextualSources.Normals:
            case NodeGeometryContextualSources.LatticeID:
            case NodeGeometryContextualSources.LatticeControl:
                this._type = NodeGeometryBlockConnectionPointTypes.Vector3;
                break;
            case NodeGeometryContextualSources.Colors:
            case NodeGeometryContextualSources.Tangents:
                this._type = NodeGeometryBlockConnectionPointTypes.Vector4;
                break;
            case NodeGeometryContextualSources.UV:
            case NodeGeometryContextualSources.UV2:
            case NodeGeometryContextualSources.UV3:
            case NodeGeometryContextualSources.UV4:
            case NodeGeometryContextualSources.UV5:
            case NodeGeometryContextualSources.UV6:
                this._type = NodeGeometryBlockConnectionPointTypes.Vector2;
                break;
            case NodeGeometryContextualSources.VertexID:
            case NodeGeometryContextualSources.GeometryID:
            case NodeGeometryContextualSources.CollectionID:
            case NodeGeometryContextualSources.FaceID:
            case NodeGeometryContextualSources.LoopID:
            case NodeGeometryContextualSources.InstanceID:
                this._type = NodeGeometryBlockConnectionPointTypes.Int;
                break;
        }
        if (this.output) {
            this.output.type = this._type;
        }
    }
    /**
     * Creates a new InputBlock
     * @param name defines the block name
     * @param type defines the type of the input (can be set to NodeGeometryBlockConnectionPointTypes.AutoDetect)
     */
    constructor(name, type = NodeGeometryBlockConnectionPointTypes.AutoDetect) {
        super(name);
        this._type = NodeGeometryBlockConnectionPointTypes.Undefined;
        this._contextualSource = NodeGeometryContextualSources.None;
        /** Gets or set a value used to limit the range of float values */
        this.min = 0;
        /** Gets or set a value used to limit the range of float values */
        this.max = 0;
        /** Gets or sets the group to use to display this block in the Inspector */
        this.groupInInspector = "";
        /** Gets an observable raised when the value is changed */
        this.onValueChangedObservable = new Misc_observable/* Observable */.cP();
        this._type = type;
        this._isInput = true;
        this.setDefaultValue();
        this.registerOutput("output", type);
    }
    /**
     * Gets or sets the value of that point.
     * Please note that this value will be ignored if valueCallback is defined
     */
    get value() {
        return this._storedValue;
    }
    set value(value) {
        if (this.type === NodeGeometryBlockConnectionPointTypes.Float) {
            if (this.min !== this.max) {
                value = Math.max(this.min, value);
                value = Math.min(this.max, value);
            }
        }
        this._storedValue = value;
        this.onValueChangedObservable.notifyObservers(this);
    }
    /**
     * Gets or sets a callback used to get the value of that point.
     * Please note that setting this value will force the connection point to ignore the value property
     */
    get valueCallback() {
        return this._valueCallback;
    }
    set valueCallback(value) {
        this._valueCallback = value;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryInputBlock";
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Set the input block to its default value (based on its type)
     */
    setDefaultValue() {
        this.contextualValue = NodeGeometryContextualSources.None;
        switch (this.type) {
            case NodeGeometryBlockConnectionPointTypes.Int:
            case NodeGeometryBlockConnectionPointTypes.Float:
                this.value = 0;
                break;
            case NodeGeometryBlockConnectionPointTypes.Vector2:
                this.value = math_vector/* Vector2 */.I9.Zero();
                break;
            case NodeGeometryBlockConnectionPointTypes.Vector3:
                this.value = math_vector/* Vector3 */.Pq.Zero();
                break;
            case NodeGeometryBlockConnectionPointTypes.Vector4:
                this.value = math_vector/* Vector4 */.IU.Zero();
                break;
            case NodeGeometryBlockConnectionPointTypes.Matrix:
                this.value = math_vector/* Matrix */.uq.Identity();
                break;
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        if (this.isContextual) {
            this.output._storedValue = null;
            this.output._storedFunction = (state) => {
                return state.getContextualValue(this._contextualSource);
            };
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = this.value;
        }
    }
    dispose() {
        this.onValueChangedObservable.clear();
        super.dispose();
    }
    _dumpPropertiesCode() {
        const variableName = this._codeVariableName;
        if (this.isContextual) {
            return (super._dumpPropertiesCode() + `${variableName}.contextualValue = BABYLON.NodeGeometryContextualSources.${NodeGeometryContextualSources[this._contextualSource]};\n`);
        }
        const codes = [];
        let valueString = "";
        switch (this.type) {
            case NodeGeometryBlockConnectionPointTypes.Float:
            case NodeGeometryBlockConnectionPointTypes.Int:
                valueString = `${this.value}`;
                break;
            case NodeGeometryBlockConnectionPointTypes.Vector2:
                valueString = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;
                break;
            case NodeGeometryBlockConnectionPointTypes.Vector3:
                valueString = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;
                break;
            case NodeGeometryBlockConnectionPointTypes.Vector4:
                valueString = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;
                break;
        }
        // Common Property "Value"
        codes.push(`${variableName}.value = ${valueString}`);
        // Float-Value-Specific Properties
        if (this.type === NodeGeometryBlockConnectionPointTypes.Float || this.type === NodeGeometryBlockConnectionPointTypes.Int) {
            codes.push(`${variableName}.min = ${this.min}`, `${variableName}.max = ${this.max}`);
        }
        codes.push("");
        return super._dumpPropertiesCode() + codes.join(";\n");
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.type = this.type;
        serializationObject.contextualValue = this.contextualValue;
        serializationObject.min = this.min;
        serializationObject.max = this.max;
        serializationObject.groupInInspector = this.groupInInspector;
        if (this._storedValue !== null && !this.isContextual) {
            if (this._storedValue.asArray) {
                serializationObject.valueType = "BABYLON." + this._storedValue.getClassName();
                serializationObject.value = this._storedValue.asArray();
            }
            else {
                serializationObject.valueType = "number";
                serializationObject.value = this._storedValue;
            }
        }
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this._type = serializationObject.type;
        this.contextualValue = serializationObject.contextualValue;
        this.min = serializationObject.min || 0;
        this.max = serializationObject.max || 0;
        this.groupInInspector = serializationObject.groupInInspector || "";
        if (!serializationObject.valueType) {
            return;
        }
        if (serializationObject.valueType === "number") {
            this._storedValue = serializationObject.value;
        }
        else {
            const valueType = (0,typeStore/* GetClass */.n9)(serializationObject.valueType);
            if (valueType) {
                this._storedValue = valueType.FromArray(serializationObject.value);
            }
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryInputBlock", GeometryInputBlock);
//# sourceMappingURL=geometryInputBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/boxBlock.js







/**
 * Defines a block used to generate box geometry data
 */
class BoxBlock extends NodeGeometryBlock {
    /**
     * Create a new BoxBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("size", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("width", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("depth", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1);
        this.registerInput("subdivisionsX", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
        this.registerInput("subdivisionsY", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
        this.registerInput("subdivisionsZ", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "BoxBlock";
    }
    /**
     * Gets the size input component
     */
    get size() {
        return this._inputs[0];
    }
    /**
     * Gets the width input component
     */
    get width() {
        return this._inputs[1];
    }
    /**
     * Gets the height input component
     */
    get height() {
        return this._inputs[2];
    }
    /**
     * Gets the depth input component
     */
    get depth() {
        return this._inputs[3];
    }
    /**
     * Gets the subdivisions input component
     */
    get subdivisions() {
        return this._inputs[4];
    }
    /**
     * Gets the subdivisionsX input component
     */
    get subdivisionsX() {
        return this._inputs[5];
    }
    /**
     * Gets the subdivisionsY input component
     */
    get subdivisionsY() {
        return this._inputs[6];
    }
    /**
     * Gets the subdivisionsZ input component
     */
    get subdivisionsZ() {
        return this._inputs[7];
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (this.size.isConnected) {
            return;
        }
        if (!this.width.isConnected && !this.height.isConnected && !this.depth.isConnected) {
            const sizeInput = new GeometryInputBlock("Size");
            sizeInput.value = 1;
            sizeInput.output.connectTo(this.size);
            return;
        }
        if (!this.width.isConnected) {
            const widthInput = new GeometryInputBlock("Width");
            widthInput.value = 1;
            widthInput.output.connectTo(this.width);
        }
        if (!this.height.isConnected) {
            const heightInput = new GeometryInputBlock("Height");
            heightInput.value = 1;
            heightInput.output.connectTo(this.height);
        }
        if (!this.depth.isConnected) {
            const depthInput = new GeometryInputBlock("Depth");
            depthInput.value = 1;
            depthInput.output.connectTo(this.depth);
        }
    }
    _buildBlock(state) {
        const options = {};
        const func = (state) => {
            options.size = this.size.getConnectedValue(state);
            options.width = this.width.getConnectedValue(state);
            options.height = this.height.getConnectedValue(state);
            options.depth = this.depth.getConnectedValue(state);
            const subdivisions = this.subdivisions.getConnectedValue(state);
            const subdivisionsX = this.subdivisionsX.getConnectedValue(state);
            const subdivisionsY = this.subdivisionsY.getConnectedValue(state);
            const subdivisionsZ = this.subdivisionsZ.getConnectedValue(state);
            if (subdivisions) {
                options.segments = subdivisions;
            }
            if (subdivisionsX) {
                options.widthSegments = subdivisionsX;
            }
            if (subdivisionsY) {
                options.heightSegments = subdivisionsY;
            }
            if (subdivisionsZ) {
                options.depthSegments = subdivisionsZ;
            }
            // Append vertex data from the plane builder
            return (0,boxBuilder/* CreateSegmentedBoxVertexData */.G$)(options);
        };
        if (this.evaluateContext) {
            this.geometry._storedFunction = func;
        }
        else {
            const value = func(state);
            this.geometry._storedFunction = () => {
                this.geometry._executionCount = 1;
                return value.clone();
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], BoxBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BoxBlock", BoxBlock);
//# sourceMappingURL=boxBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/nodeGeometry.js














/**
 * Defines a node based geometry
 * @see demo at https://playground.babylonjs.com#PYY6XE#69
 */
class NodeGeometry {
    /** @returns the inspector from bundle or global */
    _getGlobalNodeGeometryEditor() {
        // UMD Global name detection from Webpack Bundle UMD Name.
        if (typeof NODEGEOMETRYEDITOR !== "undefined") {
            return NODEGEOMETRYEDITOR;
        }
        // In case of module let's check the global emitted from the editor entry point.
        if (typeof BABYLON !== "undefined" && typeof BABYLON.NodeGeometryEditor !== "undefined") {
            return BABYLON;
        }
        return undefined;
    }
    /**
     * Gets the time spent to build this block (in ms)
     */
    get buildExecutionTime() {
        return this._buildExecutionTime;
    }
    /**
     * Creates a new geometry
     * @param name defines the name of the geometry
     */
    constructor(name) {
        this._buildId = NodeGeometry._BuildIdGenerator++;
        this._buildWasSuccessful = false;
        this._vertexData = null;
        this._buildExecutionTime = 0;
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this.BJSNODEGEOMETRYEDITOR = this._getGlobalNodeGeometryEditor();
        /**
         * Gets or sets data used by visual editor
         * @see https://nge.babylonjs.com
         */
        this.editorData = null;
        /**
         * Gets an array of blocks that needs to be serialized even if they are not yet connected
         */
        this.attachedBlocks = [];
        /**
         * Observable raised when the geometry is built
         */
        this.onBuildObservable = new Misc_observable/* Observable */.cP();
        /** Gets or sets the GeometryOutputBlock used to gather the final geometry data */
        this.outputBlock = null;
        this.name = name;
    }
    /**
     * Gets the current class name of the geometry e.g. "NodeGeometry"
     * @returns the class name
     */
    getClassName() {
        return "NodeGeometry";
    }
    /**
     * Gets the vertex data. This needs to be done after build() was called.
     * This is used to access vertexData when creating a mesh is not required.
     */
    get vertexData() {
        return this._vertexData;
    }
    /**
     * Get a block by its name
     * @param name defines the name of the block to retrieve
     * @returns the required block or null if not found
     */
    getBlockByName(name) {
        let result = null;
        for (const block of this.attachedBlocks) {
            if (block.name === name) {
                if (!result) {
                    result = block;
                }
                else {
                    tools/* Tools */.S0.Warn("More than one block was found with the name `" + name + "`");
                    return result;
                }
            }
        }
        return result;
    }
    /**
     * Get a block using a predicate
     * @param predicate defines the predicate used to find the good candidate
     * @returns the required block or null if not found
     */
    getBlockByPredicate(predicate) {
        for (const block of this.attachedBlocks) {
            if (predicate(block)) {
                return block;
            }
        }
        return null;
    }
    /**
     * Gets the list of input blocks attached to this material
     * @returns an array of InputBlocks
     */
    getInputBlocks() {
        const blocks = [];
        for (const block of this.attachedBlocks) {
            if (block.isInput) {
                blocks.push(block);
            }
        }
        return blocks;
    }
    /**
     * Launch the node geometry editor
     * @param config Define the configuration of the editor
     * @returns a promise fulfilled when the node editor is visible
     */
    edit(config) {
        return new Promise((resolve) => {
            this.BJSNODEGEOMETRYEDITOR = this.BJSNODEGEOMETRYEDITOR || this._getGlobalNodeGeometryEditor();
            if (typeof this.BJSNODEGEOMETRYEDITOR == "undefined") {
                const editorUrl = config && config.editorURL ? config.editorURL : NodeGeometry.EditorURL;
                // Load editor and add it to the DOM
                tools/* Tools */.S0.LoadBabylonScript(editorUrl, () => {
                    this.BJSNODEGEOMETRYEDITOR = this.BJSNODEGEOMETRYEDITOR || this._getGlobalNodeGeometryEditor();
                    this._createNodeEditor(config?.nodeGeometryEditorConfig);
                    resolve();
                });
            }
            else {
                // Otherwise creates the editor
                this._createNodeEditor(config?.nodeGeometryEditorConfig);
                resolve();
            }
        });
    }
    /**
     * Creates the node editor window.
     * @param additionalConfig Additional configuration for the NGE
     */
    _createNodeEditor(additionalConfig) {
        const nodeEditorConfig = {
            nodeGeometry: this,
            ...additionalConfig,
        };
        this.BJSNODEGEOMETRYEDITOR.NodeGeometryEditor.Show(nodeEditorConfig);
    }
    /**
     * Build the final geometry. Please note that the geometry MAY not be ready until the onBuildObservable is raised.
     * @param verbose defines if the build should log activity
     * @param updateBuildId defines if the internal build Id should be updated (default is true)
     * @param autoConfigure defines if the autoConfigure method should be called when initializing blocks (default is false)
     */
    build(verbose = false, updateBuildId = true, autoConfigure = false) {
        this._buildWasSuccessful = false;
        if (!this.outputBlock) {
            // eslint-disable-next-line no-throw-literal
            throw "You must define the outputBlock property before building the geometry";
        }
        const now = precisionDate/* PrecisionDate */.j.Now;
        // Initialize blocks
        this._initializeBlock(this.outputBlock, autoConfigure);
        // Check async states
        const promises = [];
        for (const block of this.attachedBlocks) {
            if (block._isReadyState) {
                promises.push(block._isReadyState);
            }
        }
        if (promises.length) {
            Promise.all(promises).then(() => {
                this.build(verbose, updateBuildId, autoConfigure);
            });
            return;
        }
        // Build
        const state = new NodeGeometryBuildState();
        state.buildId = this._buildId;
        state.verbose = verbose;
        try {
            this.outputBlock.build(state);
        }
        finally {
            if (updateBuildId) {
                this._buildId = NodeGeometry._BuildIdGenerator++;
            }
        }
        this._buildExecutionTime = precisionDate/* PrecisionDate */.j.Now - now;
        // Errors
        state.emitErrors();
        this._buildWasSuccessful = true;
        this._vertexData = state.vertexData;
        this.onBuildObservable.notifyObservers(this);
    }
    /**
     * Creates a mesh from the geometry blocks
     * @param name defines the name of the mesh
     * @param scene The scene the mesh is scoped to
     * @returns The new mesh
     */
    createMesh(name, scene = null) {
        if (!this._buildWasSuccessful) {
            this.build();
        }
        if (!this._vertexData) {
            return null;
        }
        const mesh = new Meshes_mesh/* Mesh */.e(name, scene);
        this._vertexData.applyToMesh(mesh);
        mesh._internalMetadata = mesh._internalMetadata || {};
        mesh._internalMetadata.nodeGeometry = this;
        return mesh;
    }
    /**
     * Creates a mesh from the geometry blocks
     * @param mesh the mesh to update
     * @returns True if successfully updated
     */
    updateMesh(mesh) {
        if (!this._buildWasSuccessful) {
            this.build();
        }
        if (!this._vertexData) {
            return false;
        }
        this._vertexData.applyToMesh(mesh);
        mesh._internalMetadata = mesh._internalMetadata || {};
        mesh._internalMetadata.nodeGeometry = this;
        return mesh;
    }
    _initializeBlock(node, autoConfigure = true) {
        node.initialize();
        if (autoConfigure) {
            node.autoConfigure(this);
        }
        node._preparationId = this._buildId;
        if (this.attachedBlocks.indexOf(node) === -1) {
            this.attachedBlocks.push(node);
        }
        for (const input of node.inputs) {
            const connectedPoint = input.connectedPoint;
            if (connectedPoint) {
                const block = connectedPoint.ownerBlock;
                if (block !== node) {
                    this._initializeBlock(block, autoConfigure);
                }
            }
        }
    }
    /**
     * Clear the current geometry
     */
    clear() {
        this.outputBlock = null;
        this.attachedBlocks.length = 0;
    }
    /**
     * Remove a block from the current geometry
     * @param block defines the block to remove
     */
    removeBlock(block) {
        const attachedBlockIndex = this.attachedBlocks.indexOf(block);
        if (attachedBlockIndex > -1) {
            this.attachedBlocks.splice(attachedBlockIndex, 1);
        }
        if (block === this.outputBlock) {
            this.outputBlock = null;
        }
    }
    /**
     * Clear the current graph and load a new one from a serialization object
     * @param source defines the JSON representation of the geometry
     * @param merge defines whether or not the source must be merged or replace the current content
     */
    parseSerializedObject(source, merge = false) {
        if (!merge) {
            this.clear();
        }
        const map = {};
        // Create blocks
        for (const parsedBlock of source.blocks) {
            const blockType = (0,typeStore/* GetClass */.n9)(parsedBlock.customType);
            if (blockType) {
                const block = new blockType();
                block._deserialize(parsedBlock);
                map[parsedBlock.id] = block;
                this.attachedBlocks.push(block);
            }
        }
        // Reconnect teleportation
        for (const block of this.attachedBlocks) {
            if (block.isTeleportOut) {
                const teleportOut = block;
                const id = teleportOut._tempEntryPointUniqueId;
                if (id) {
                    const source = map[id];
                    if (source) {
                        source.attachToEndpoint(teleportOut);
                    }
                }
            }
        }
        // Connections - Starts with input blocks only (except if in "merge" mode where we scan all blocks)
        for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {
            const parsedBlock = source.blocks[blockIndex];
            const block = map[parsedBlock.id];
            if (!block) {
                continue;
            }
            if (block.inputs.length && parsedBlock.inputs.some((i) => i.targetConnectionName) && !merge) {
                continue;
            }
            this._restoreConnections(block, source, map);
        }
        // Outputs
        if (source.outputNodeId) {
            this.outputBlock = map[source.outputNodeId];
        }
        // UI related info
        if (source.locations || (source.editorData && source.editorData.locations)) {
            const locations = source.locations || source.editorData.locations;
            for (const location of locations) {
                if (map[location.blockId]) {
                    location.blockId = map[location.blockId].uniqueId;
                }
            }
            if (merge && this.editorData && this.editorData.locations) {
                locations.concat(this.editorData.locations);
            }
            if (source.locations) {
                this.editorData = {
                    locations: locations,
                };
            }
            else {
                this.editorData = source.editorData;
                this.editorData.locations = locations;
            }
            const blockMap = [];
            for (const key in map) {
                blockMap[key] = map[key].uniqueId;
            }
            this.editorData.map = blockMap;
        }
        this.comment = source.comment;
    }
    _restoreConnections(block, source, map) {
        for (const outputPoint of block.outputs) {
            for (const candidate of source.blocks) {
                const target = map[candidate.id];
                if (!target) {
                    continue;
                }
                for (const input of candidate.inputs) {
                    if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {
                        const inputPoint = target.getInputByName(input.inputName);
                        if (!inputPoint || inputPoint.isConnected) {
                            continue;
                        }
                        outputPoint.connectTo(inputPoint, true);
                        this._restoreConnections(target, source, map);
                        continue;
                    }
                }
            }
        }
    }
    /**
     * Generate a string containing the code declaration required to create an equivalent of this geometry
     * @returns a string
     */
    generateCode() {
        let alreadyDumped = [];
        const blocks = [];
        const uniqueNames = ["const", "var", "let"];
        // Gets active blocks
        if (this.outputBlock) {
            this._gatherBlocks(this.outputBlock, blocks);
        }
        // Generate
        let codeString = `let nodeGeometry = new BABYLON.NodeGeometry("${this.name || "node geometry"}");\n`;
        for (const node of blocks) {
            if (node.isInput && alreadyDumped.indexOf(node) === -1) {
                codeString += node._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        if (this.outputBlock) {
            // Connections
            alreadyDumped = [];
            codeString += "// Connections\n";
            codeString += this.outputBlock._dumpCodeForOutputConnections(alreadyDumped);
            // Output nodes
            codeString += "// Output nodes\n";
            codeString += `nodeGeometry.outputBlock = ${this.outputBlock._codeVariableName};\n`;
            codeString += `nodeGeometry.build();\n`;
        }
        return codeString;
    }
    _gatherBlocks(rootNode, list) {
        if (list.indexOf(rootNode) !== -1) {
            return;
        }
        list.push(rootNode);
        for (const input of rootNode.inputs) {
            const connectedPoint = input.connectedPoint;
            if (connectedPoint) {
                const block = connectedPoint.ownerBlock;
                if (block !== rootNode) {
                    this._gatherBlocks(block, list);
                }
            }
        }
        // Teleportation
        if (rootNode.isTeleportOut) {
            const block = rootNode;
            if (block.entryPoint) {
                this._gatherBlocks(block.entryPoint, list);
            }
        }
    }
    /**
     * Clear the current geometry and set it to a default state
     */
    setToDefault() {
        this.clear();
        this.editorData = null;
        // Source
        const dataBlock = new BoxBlock("Box");
        dataBlock.autoConfigure();
        // Final output
        const output = new GeometryOutputBlock("Geometry Output");
        dataBlock.geometry.connectTo(output.geometry);
        this.outputBlock = output;
    }
    /**
     * Makes a duplicate of the current geometry.
     * @param name defines the name to use for the new geometry
     * @returns the new geometry
     */
    clone(name) {
        const serializationObject = this.serialize();
        const clone = decorators_serialization/* SerializationHelper */.p.Clone(() => new NodeGeometry(name), this);
        clone.name = name;
        clone.parseSerializedObject(serializationObject);
        clone._buildId = this._buildId;
        clone.build(false);
        return clone;
    }
    /**
     * Serializes this geometry in a JSON representation
     * @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)
     * @returns the serialized geometry object
     */
    serialize(selectedBlocks) {
        const serializationObject = selectedBlocks ? {} : decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy
        let blocks = [];
        if (selectedBlocks) {
            blocks = selectedBlocks;
        }
        else {
            serializationObject.customType = "BABYLON.NodeGeometry";
            if (this.outputBlock) {
                serializationObject.outputNodeId = this.outputBlock.uniqueId;
            }
        }
        // Blocks
        serializationObject.blocks = [];
        for (const block of blocks) {
            serializationObject.blocks.push(block.serialize());
        }
        if (!selectedBlocks) {
            for (const block of this.attachedBlocks) {
                if (blocks.indexOf(block) !== -1) {
                    continue;
                }
                serializationObject.blocks.push(block.serialize());
            }
        }
        return serializationObject;
    }
    /**
     * Disposes the ressources
     */
    dispose() {
        for (const block of this.attachedBlocks) {
            block.dispose();
        }
        this.attachedBlocks.length = 0;
        this.onBuildObservable.clear();
    }
    /**
     * Creates a new node geometry set to default basic configuration
     * @param name defines the name of the geometry
     * @returns a new NodeGeometry
     */
    static CreateDefault(name) {
        const nodeGeometry = new NodeGeometry(name);
        nodeGeometry.setToDefault();
        nodeGeometry.build();
        return nodeGeometry;
    }
    /**
     * Creates a node geometry from parsed geometry data
     * @param source defines the JSON representation of the geometry
     * @returns a new node geometry
     */
    static Parse(source) {
        const nodeGeometry = decorators_serialization/* SerializationHelper */.p.Parse(() => new NodeGeometry(source.name), source, null);
        nodeGeometry.parseSerializedObject(source);
        nodeGeometry.build();
        return nodeGeometry;
    }
    /**
     * Creates a node geometry from a snippet saved by the node geometry editor
     * @param snippetId defines the snippet to load
     * @param nodeGeometry defines a node geometry to update (instead of creating a new one)
     * @param skipBuild defines whether to build the node geometry
     * @returns a promise that will resolve to the new node geometry
     */
    static ParseFromSnippetAsync(snippetId, nodeGeometry, skipBuild = false) {
        if (snippetId === "_BLANK") {
            return Promise.resolve(NodeGeometry.CreateDefault("blank"));
        }
        return new Promise((resolve, reject) => {
            const request = new webRequest/* WebRequest */.u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);
                        const serializationObject = JSON.parse(snippet.nodeGeometry);
                        if (!nodeGeometry) {
                            nodeGeometry = decorators_serialization/* SerializationHelper */.p.Parse(() => new NodeGeometry(snippetId), serializationObject, null);
                        }
                        nodeGeometry.parseSerializedObject(serializationObject);
                        nodeGeometry.snippetId = snippetId;
                        try {
                            if (!skipBuild) {
                                nodeGeometry.build();
                            }
                            resolve(nodeGeometry);
                        }
                        catch (err) {
                            reject(err);
                        }
                    }
                    else {
                        reject("Unable to load the snippet " + snippetId);
                    }
                }
            });
            request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/"));
            request.send();
        });
    }
}
NodeGeometry._BuildIdGenerator = 0;
/** Define the Url to load node editor script */
NodeGeometry.EditorURL = `${tools/* Tools */.S0._DefaultCdnUrl}/v${abstractEngine/* AbstractEngine */.$.Version}/nodeGeometryEditor/babylon.nodeGeometryEditor.js`;
/** Define the Url to load snippets */
NodeGeometry.SnippetUrl = `https://snippet.babylonjs.com`;
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], NodeGeometry.prototype, "name", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("comment")
], NodeGeometry.prototype, "comment", void 0);
//# sourceMappingURL=nodeGeometry.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Interfaces/nodeGeometryExecutionContext.js

//# sourceMappingURL=nodeGeometryExecutionContext.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryOptimizeBlock.js








/**
 * Block used to extract unique positions from a geometry
 */
class GeometryOptimizeBlock extends NodeGeometryBlock {
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Creates a new GeometryOptimizeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        /**
         * Define the epsilon used to compare similar positions
         */
        this.epsilon = math_constants/* Epsilon */.bH;
        /**
         * Optimize faces (by removing duplicates)
         */
        this.optimizeFaces = false;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("selector", NodeGeometryBlockConnectionPointTypes.Int, true);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryOptimizeBlock";
    }
    /**
     * Gets the geometry component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the selector component
     */
    get selector() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            if (!this.geometry.isConnected) {
                return null;
            }
            const vertexData = this.geometry.getConnectedValue(state);
            const newPositions = [];
            const newIndicesMap = {};
            state.pushExecutionContext(this);
            state.pushGeometryContext(vertexData);
            // Optimize positions
            for (let index = 0; index < vertexData.positions.length; index += 3) {
                this._currentIndex = index / 3;
                if (this.selector.isConnected) {
                    const selector = this.selector.getConnectedValue(state);
                    if (!selector) {
                        continue;
                    }
                }
                const x = vertexData.positions[index];
                const y = vertexData.positions[index + 1];
                const z = vertexData.positions[index + 2];
                // check if we already have it
                let found = false;
                for (let checkIndex = 0; checkIndex < newPositions.length; checkIndex += 3) {
                    if ((0,math_scalar_functions.WithinEpsilon)(x, newPositions[checkIndex], this.epsilon) &&
                        (0,math_scalar_functions.WithinEpsilon)(y, newPositions[checkIndex + 1], this.epsilon) &&
                        (0,math_scalar_functions.WithinEpsilon)(z, newPositions[checkIndex + 2], this.epsilon)) {
                        newIndicesMap[index / 3] = checkIndex / 3;
                        found = true;
                        continue;
                    }
                }
                if (!found) {
                    newIndicesMap[index / 3] = newPositions.length / 3;
                    newPositions.push(x, y, z);
                }
            }
            const newVertexData = new mesh_vertexData/* VertexData */.P();
            newVertexData.positions = newPositions;
            const indices = vertexData.indices.map((index) => newIndicesMap[index]);
            const newIndices = [];
            if (this.optimizeFaces) {
                // Optimize indices
                for (let index = 0; index < indices.length; index += 3) {
                    const a = indices[index];
                    const b = indices[index + 1];
                    const c = indices[index + 2];
                    if (a === b || b == c || c === a) {
                        continue;
                    }
                    // check if we already have it
                    let found = false;
                    for (let checkIndex = 0; checkIndex < newIndices.length; checkIndex += 3) {
                        if (a === newIndices[checkIndex] && b === newIndices[checkIndex + 1] && c === newIndices[checkIndex + 2]) {
                            found = true;
                            continue;
                        }
                        if (a === newIndices[checkIndex + 1] && b === newIndices[checkIndex + 2] && c === newIndices[checkIndex]) {
                            found = true;
                            continue;
                        }
                        if (a === newIndices[checkIndex + 2] && b === newIndices[checkIndex] && c === newIndices[checkIndex + 1]) {
                            found = true;
                            continue;
                        }
                    }
                    if (!found) {
                        newIndices.push(a, b, c);
                    }
                }
                newVertexData.indices = newIndices;
            }
            else {
                newVertexData.indices = indices;
            }
            return newVertexData;
        };
        state.restoreGeometryContext();
        state.restoreExecutionContext();
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        codeString += `${this._codeVariableName}.epsilon = ${this.epsilon};\n`;
        codeString += `${this._codeVariableName}.optimizeFaces = ${this.optimizeFaces ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        serializationObject.epsilon = this.epsilon;
        serializationObject.optimizeFaces = this.optimizeFaces;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
        this.epsilon = serializationObject.epsilon;
        this.optimizeFaces = serializationObject.optimizeFaces;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], GeometryOptimizeBlock.prototype, "evaluateContext", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Epsilon", 1 /* PropertyTypeForEdition.Float */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], GeometryOptimizeBlock.prototype, "epsilon", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Optimize faces", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], GeometryOptimizeBlock.prototype, "optimizeFaces", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryOptimizeBlock", GeometryOptimizeBlock);
//# sourceMappingURL=geometryOptimizeBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/planeBlock.js








/**
 * Defines a block used to generate plane geometry data
 */
class PlaneBlock extends NodeGeometryBlock {
    /**
     * Create a new PlaneBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._rotationMatrix = new math_vector/* Matrix */.uq();
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("size", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("width", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1);
        this.registerInput("subdivisionsX", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
        this.registerInput("subdivisionsY", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "PlaneBlock";
    }
    /**
     * Gets the size input component
     */
    get size() {
        return this._inputs[0];
    }
    /**
     * Gets the width input component
     */
    get width() {
        return this._inputs[1];
    }
    /**
     * Gets the height input component
     */
    get height() {
        return this._inputs[2];
    }
    /**
     * Gets the subdivisions input component
     */
    get subdivisions() {
        return this._inputs[3];
    }
    /**
     * Gets the subdivisionsX input component
     */
    get subdivisionsX() {
        return this._inputs[4];
    }
    /**
     * Gets the subdivisionsY input component
     */
    get subdivisionsY() {
        return this._inputs[5];
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (this.size.isConnected) {
            return;
        }
        if (!this.width.isConnected && !this.height.isConnected) {
            const sizeInput = new GeometryInputBlock("Size");
            sizeInput.value = 1;
            sizeInput.output.connectTo(this.size);
            return;
        }
        if (!this.width.isConnected) {
            const widthInput = new GeometryInputBlock("Width");
            widthInput.value = 1;
            widthInput.output.connectTo(this.width);
        }
        if (!this.height.isConnected) {
            const heightInput = new GeometryInputBlock("Height");
            heightInput.value = 1;
            heightInput.output.connectTo(this.height);
        }
    }
    _buildBlock(state) {
        const options = {};
        const func = (state) => {
            options.size = this.size.getConnectedValue(state);
            options.width = this.width.getConnectedValue(state);
            options.height = this.height.getConnectedValue(state);
            const subdivisions = this.subdivisions.getConnectedValue(state);
            const subdivisionsX = this.subdivisionsX.getConnectedValue(state);
            const subdivisionsY = this.subdivisionsY.getConnectedValue(state);
            if (subdivisions) {
                options.subdivisions = subdivisions;
            }
            if (subdivisionsX) {
                options.subdivisionsX = subdivisionsX;
            }
            if (subdivisionsY) {
                options.subdivisionsY = subdivisionsY;
            }
            // Append vertex data from the ground builder (to get access to subdivisions)
            const vertexData = (0,groundBuilder/* CreateGroundVertexData */.EH)(options);
            math_vector/* Matrix */.uq.RotationYawPitchRollToRef(-Math.PI / 2, 0, Math.PI / 2, this._rotationMatrix);
            vertexData.transform(this._rotationMatrix);
            return vertexData;
        };
        if (this.evaluateContext) {
            this.geometry._storedFunction = func;
        }
        else {
            const value = func(state);
            this.geometry._storedFunction = () => {
                this.geometry._executionCount = 1;
                return value.clone();
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], PlaneBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.PlaneBlock", PlaneBlock);
//# sourceMappingURL=planeBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/meshBlock.js






/**
 * Defines a block used to generate a user defined mesh geometry data
 */
class MeshBlock extends NodeGeometryBlock {
    /**
     * Gets or sets the mesh to use to get vertex data
     */
    get mesh() {
        return this._mesh;
    }
    set mesh(value) {
        this._mesh = value;
    }
    /**
     * Create a new MeshBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._cachedVertexData = null;
        /**
         * Gets or sets a boolean indicating that winding order needs to be reserved
         */
        this.reverseWindingOrder = false;
        /**
         * Gets or sets a boolean indicating that this block should serialize its cached data
         */
        this.serializedCachedData = false;
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MeshBlock";
    }
    /**
     * Gets a boolean indicating if the block is using cached data
     */
    get isUsingCachedData() {
        return !this.mesh && !!this._cachedVertexData;
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    /**
     * Remove stored data
     */
    cleanData() {
        this._mesh = null;
        this._cachedVertexData = null;
    }
    _buildBlock() {
        if (!this._mesh) {
            if (this._cachedVertexData) {
                this.geometry._storedValue = this._cachedVertexData.clone();
            }
            else {
                this.geometry._storedValue = null;
            }
            return;
        }
        const vertexData = mesh_vertexData/* VertexData */.P.ExtractFromMesh(this._mesh, false, true);
        this._cachedVertexData = null;
        if (this.reverseWindingOrder && vertexData.indices) {
            for (let index = 0; index < vertexData.indices.length; index += 3) {
                const tmp = vertexData.indices[index];
                vertexData.indices[index] = vertexData.indices[index + 2];
                vertexData.indices[index + 2] = tmp;
            }
        }
        this.geometry._storedFunction = () => {
            return vertexData.clone();
        };
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.serializedCachedData = this.serializedCachedData;
        if (this.serializedCachedData) {
            if (this._mesh) {
                serializationObject.cachedVertexData = mesh_vertexData/* VertexData */.P.ExtractFromMesh(this._mesh, false, true).serialize();
            }
            else if (this._cachedVertexData) {
                serializationObject.cachedVertexData = this._cachedVertexData.serialize();
            }
        }
        serializationObject.reverseWindingOrder = this.reverseWindingOrder;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.cachedVertexData) {
            this._cachedVertexData = mesh_vertexData/* VertexData */.P.Parse(serializationObject.cachedVertexData);
        }
        this.serializedCachedData = !!serializationObject.serializedCachedData;
        this.reverseWindingOrder = serializationObject.reverseWindingOrder;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Serialize cached data", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], MeshBlock.prototype, "serializedCachedData", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MeshBlock", MeshBlock);
//# sourceMappingURL=meshBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/icoSphereBlock.js







/**
 * Defines a block used to generate icosphere geometry data
 */
class IcoSphereBlock extends NodeGeometryBlock {
    /**
     * Create a new IcoSphereBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("radius", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("radiusX", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("radiusY", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("radiusZ", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 4);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "IcoSphereBlock";
    }
    /**
     * Gets the radius input component
     */
    get radius() {
        return this._inputs[0];
    }
    /**
     * Gets the radiusX input component
     */
    get radiusX() {
        return this._inputs[1];
    }
    /**
     * Gets the radiusY input component
     */
    get radiusY() {
        return this._inputs[2];
    }
    /**
     * Gets the radiusZ input component
     */
    get radiusZ() {
        return this._inputs[3];
    }
    /**
     * Gets the subdivisions input component
     */
    get subdivisions() {
        return this._inputs[4];
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.radius.isConnected) {
            const radiusInput = new GeometryInputBlock("Radius");
            radiusInput.value = 0.2;
            radiusInput.output.connectTo(this.radius);
        }
    }
    _buildBlock(state) {
        const options = {};
        const func = (state) => {
            options.radius = this.radius.getConnectedValue(state);
            options.subdivisions = this.subdivisions.getConnectedValue(state);
            options.radiusX = this.radiusX.getConnectedValue(state);
            options.radiusY = this.radiusY.getConnectedValue(state);
            options.radiusZ = this.radiusZ.getConnectedValue(state);
            // Append vertex data from the plane builder
            return CreateIcoSphereVertexData(options);
        };
        if (this.evaluateContext) {
            this.geometry._storedFunction = func;
        }
        else {
            const value = func(state);
            this.geometry._storedFunction = () => {
                this.geometry._executionCount = 1;
                return value.clone();
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], IcoSphereBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.IcoSphereBlock", IcoSphereBlock);
//# sourceMappingURL=icoSphereBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/sphereBlock.js







/**
 * Defines a block used to generate sphere geometry data
 */
class SphereBlock extends NodeGeometryBlock {
    /**
     * Create a new SphereBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("segments", NodeGeometryBlockConnectionPointTypes.Int, true, 32);
        this.registerInput("diameter", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("diameterX", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("diameterY", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("diameterZ", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("arc", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("slice", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SphereBlock";
    }
    /**
     * Gets the segments input component
     */
    get segments() {
        return this._inputs[0];
    }
    /**
     * Gets the diameter input component
     */
    get diameter() {
        return this._inputs[1];
    }
    /**
     * Gets the diameterX input component
     */
    get diameterX() {
        return this._inputs[2];
    }
    /**
     * Gets the diameterY input component
     */
    get diameterY() {
        return this._inputs[3];
    }
    /**
     * Gets the diameterZ input component
     */
    get diameterZ() {
        return this._inputs[4];
    }
    /**
     * Gets the arc input component
     */
    get arc() {
        return this._inputs[5];
    }
    /**
     * Gets the slice input component
     */
    get slice() {
        return this._inputs[6];
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.diameter.isConnected) {
            const diameterInput = new GeometryInputBlock("Diameter");
            diameterInput.value = 1;
            diameterInput.output.connectTo(this.diameter);
        }
    }
    _buildBlock(state) {
        const options = {};
        const func = (state) => {
            options.segments = this.segments.getConnectedValue(state);
            options.diameter = this.diameter.getConnectedValue(state);
            options.diameterX = this.diameterX.getConnectedValue(state);
            options.diameterY = this.diameterY.getConnectedValue(state);
            options.diameterZ = this.diameterZ.getConnectedValue(state);
            options.arc = this.arc.getConnectedValue(state);
            options.slice = this.slice.getConnectedValue(state);
            // Append vertex data from the plane builder
            return CreateSphereVertexData(options);
        };
        if (this.evaluateContext) {
            this.geometry._storedFunction = func;
        }
        else {
            const value = func(state);
            this.geometry._storedFunction = () => {
                this.geometry._executionCount = 1;
                return value.clone();
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], SphereBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SphereBlock", SphereBlock);
//# sourceMappingURL=sphereBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/gridBlock.js







/**
 * Defines a block used to generate grid geometry data
 */
class GridBlock extends NodeGeometryBlock {
    /**
     * Create a new GridBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("width", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1);
        this.registerInput("subdivisionsX", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
        this.registerInput("subdivisionsY", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GridBlock";
    }
    /**
     * Gets the width input component
     */
    get width() {
        return this._inputs[0];
    }
    /**
     * Gets the height input component
     */
    get height() {
        return this._inputs[1];
    }
    /**
     * Gets the subdivisions input component
     */
    get subdivisions() {
        return this._inputs[2];
    }
    /**
     * Gets the subdivisionsX input component
     */
    get subdivisionsX() {
        return this._inputs[3];
    }
    /**
     * Gets the subdivisionsY input component
     */
    get subdivisionsY() {
        return this._inputs[4];
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.width.isConnected) {
            const widthInput = new GeometryInputBlock("Width");
            widthInput.value = 1;
            widthInput.output.connectTo(this.width);
        }
        if (!this.height.isConnected) {
            const heightInput = new GeometryInputBlock("Height");
            heightInput.value = 1;
            heightInput.output.connectTo(this.height);
        }
    }
    _buildBlock(state) {
        const options = {};
        const func = (state) => {
            options.width = this.width.getConnectedValue(state);
            options.height = this.height.getConnectedValue(state);
            options.subdivisions = this.subdivisions.getConnectedValue(state);
            options.subdivisionsX = this.subdivisionsX.getConnectedValue(state);
            options.subdivisionsY = this.subdivisionsY.getConnectedValue(state);
            // Append vertex data from the plane builder
            return (0,groundBuilder/* CreateGroundVertexData */.EH)(options);
        };
        if (this.evaluateContext) {
            this.geometry._storedFunction = func;
        }
        else {
            const value = func(state);
            this.geometry._storedFunction = () => {
                this.geometry._executionCount = 1;
                return value.clone();
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], GridBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GridBlock", GridBlock);
//# sourceMappingURL=gridBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/torusBlock.js







/**
 * Defines a block used to generate torus geometry data
 */
class TorusBlock extends NodeGeometryBlock {
    /**
     * Create a new TorusBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("diameter", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("thickness", NodeGeometryBlockConnectionPointTypes.Float, true, 0.5);
        this.registerInput("tessellation", NodeGeometryBlockConnectionPointTypes.Int, true, 16);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TorusBlock";
    }
    /**
     * Gets the diameter input component
     */
    get diameter() {
        return this._inputs[0];
    }
    /**
     * Gets the thickness input component
     */
    get thickness() {
        return this._inputs[1];
    }
    /**
     * Gets the tessellation input component
     */
    get tessellation() {
        return this._inputs[2];
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.diameter.isConnected) {
            const diameterInput = new GeometryInputBlock("Diameter");
            diameterInput.value = 1;
            diameterInput.output.connectTo(this.diameter);
        }
    }
    _buildBlock(state) {
        const options = {};
        const func = (state) => {
            options.thickness = this.thickness.getConnectedValue(state);
            options.diameter = this.diameter.getConnectedValue(state);
            options.tessellation = this.tessellation.getConnectedValue(state);
            // Append vertex data from the plane builder
            return CreateTorusVertexData(options);
        };
        if (this.evaluateContext) {
            this.geometry._storedFunction = func;
        }
        else {
            const value = func(state);
            this.geometry._storedFunction = () => {
                this.geometry._executionCount = 1;
                return value.clone();
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], TorusBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TorusBlock", TorusBlock);
//# sourceMappingURL=torusBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/cylinderBlock.js







/**
 * Defines a block used to generate cylinder geometry data
 */
class CylinderBlock extends NodeGeometryBlock {
    /**
     * Create a new SphereBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 25);
        this.registerInput("diameter", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("diameterTop", NodeGeometryBlockConnectionPointTypes.Float, true, -1);
        this.registerInput("diameterBottom", NodeGeometryBlockConnectionPointTypes.Float, true, -1);
        this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1);
        this.registerInput("tessellation", NodeGeometryBlockConnectionPointTypes.Int, true, 24);
        this.registerInput("arc", NodeGeometryBlockConnectionPointTypes.Float, true, 1.0);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "CylinderBlock";
    }
    /**
     * Gets the height input component
     */
    get height() {
        return this._inputs[0];
    }
    /**
     * Gets the diameter input component
     */
    get diameter() {
        return this._inputs[1];
    }
    /**
     * Gets the diameterTop input component
     */
    get diameterTop() {
        return this._inputs[2];
    }
    /**
     * Gets the diameterBottom input component
     */
    get diameterBottom() {
        return this._inputs[3];
    }
    /**
     * Gets the subdivisions input component
     */
    get subdivisions() {
        return this._inputs[4];
    }
    /**
     * Gets the tessellation input component
     */
    get tessellation() {
        return this._inputs[5];
    }
    /**
     * Gets the arc input component
     */
    get arc() {
        return this._inputs[6];
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.diameter.isConnected) {
            const diameterInput = new GeometryInputBlock("Diameter");
            diameterInput.value = 1;
            diameterInput.output.connectTo(this.diameter);
        }
        if (!this.height.isConnected) {
            const heightInput = new GeometryInputBlock("Height");
            heightInput.value = 1;
            heightInput.output.connectTo(this.height);
        }
    }
    _buildBlock(state) {
        const options = {};
        const func = (state) => {
            options.height = this.height.getConnectedValue(state);
            options.diameter = this.diameter.getConnectedValue(state);
            options.diameterTop = this.diameterTop.getConnectedValue(state);
            options.diameterBottom = this.diameterBottom.getConnectedValue(state);
            if (options.diameterTop === -1) {
                options.diameterTop = options.diameter;
            }
            if (options.diameterBottom === -1) {
                options.diameterBottom = options.diameter;
            }
            options.tessellation = this.tessellation.getConnectedValue(state);
            options.subdivisions = this.subdivisions.getConnectedValue(state);
            options.arc = this.arc.getConnectedValue(state);
            // Append vertex data from the plane builder
            return CreateCylinderVertexData(options);
        };
        if (this.evaluateContext) {
            this.geometry._storedFunction = func;
        }
        else {
            const value = func(state);
            this.geometry._storedFunction = () => {
                this.geometry._executionCount = 1;
                return value.clone();
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], CylinderBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CylinderBlock", CylinderBlock);
//# sourceMappingURL=cylinderBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/capsuleBlock.js







/**
 * Defines a block used to generate capsule geometry data
 */
class CapsuleBlock extends NodeGeometryBlock {
    /**
     * Create a new CapsuleBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("radius", NodeGeometryBlockConnectionPointTypes.Float, true, 0.25);
        this.registerInput("tessellation", NodeGeometryBlockConnectionPointTypes.Int, true, 16);
        this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 2);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "CapsuleBlock";
    }
    /**
     * Gets the height input component
     */
    get height() {
        return this._inputs[0];
    }
    /**
     * Gets the radius input component
     */
    get radius() {
        return this._inputs[1];
    }
    /**
     * Gets the tessellation input component
     */
    get tessellation() {
        return this._inputs[2];
    }
    /**
     * Gets the subdivisions input component
     */
    get subdivisions() {
        return this._inputs[3];
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.height.isConnected) {
            const heightInput = new GeometryInputBlock("Height");
            heightInput.value = 1;
            heightInput.output.connectTo(this.height);
        }
        if (!this.radius.isConnected) {
            const radiusInput = new GeometryInputBlock("Radius");
            radiusInput.value = 0.2;
            radiusInput.output.connectTo(this.radius);
        }
    }
    _buildBlock(state) {
        const options = {};
        const func = (state) => {
            options.height = this.height.getConnectedValue(state);
            options.radius = this.radius.getConnectedValue(state);
            options.tessellation = this.tessellation.getConnectedValue(state);
            options.subdivisions = this.subdivisions.getConnectedValue(state);
            // Append vertex data from the plane builder
            return CreateCapsuleVertexData(options);
        };
        if (this.evaluateContext) {
            this.geometry._storedFunction = func;
        }
        else {
            const value = func(state);
            this.geometry._storedFunction = () => {
                this.geometry._executionCount = 1;
                return value.clone();
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], CapsuleBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CapsuleBlock", CapsuleBlock);
//# sourceMappingURL=capsuleBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/discBlock.js







/**
 * Defines a block used to generate disc geometry data
 */
class DiscBlock extends NodeGeometryBlock {
    /**
     * Create a new DiscBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("radius", NodeGeometryBlockConnectionPointTypes.Float, true, 0.5);
        this.registerInput("tessellation", NodeGeometryBlockConnectionPointTypes.Int, true, 64);
        this.registerInput("arc", NodeGeometryBlockConnectionPointTypes.Float, true, 1.0);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "DiscBlock";
    }
    /**
     * Gets the radius input component
     */
    get radius() {
        return this._inputs[0];
    }
    /**
     * Gets the tessellation input component
     */
    get tessellation() {
        return this._inputs[1];
    }
    /**
     * Gets the arc input component
     */
    get arc() {
        return this._inputs[2];
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.radius.isConnected) {
            const radiusInput = new GeometryInputBlock("Radius");
            radiusInput.value = 0.2;
            radiusInput.output.connectTo(this.radius);
        }
    }
    _buildBlock(state) {
        const options = {};
        const func = (state) => {
            options.radius = this.radius.getConnectedValue(state);
            options.tessellation = this.tessellation.getConnectedValue(state);
            options.arc = this.arc.getConnectedValue(state);
            // Append vertex data from the plane builder
            return CreateDiscVertexData(options);
        };
        if (this.evaluateContext) {
            this.geometry._storedFunction = func;
        }
        else {
            const value = func(state);
            this.geometry._storedFunction = () => {
                this.geometry._executionCount = 1;
                return value.clone();
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], DiscBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DiscBlock", DiscBlock);
//# sourceMappingURL=discBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/nullBlock.js



/**
 * Defines a block used to generate a null geometry data
 */
class NullBlock extends NodeGeometryBlock {
    /**
     * Create a new NullBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerOutput("vector", NodeGeometryBlockConnectionPointTypes.Vector3);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NullBlock";
    }
    /**
     * Gets the geometry output component
     */
    get geometry() {
        return this._outputs[0];
    }
    /**
     * Gets the vector output component
     */
    get vector() {
        return this._outputs[1];
    }
    _buildBlock() {
        this.geometry._storedValue = null;
        this.vector._storedValue = null;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NullBlock", NullBlock);
//# sourceMappingURL=nullBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setPositionsBlock.js





/**
 * Block used to set positions for a geometry
 */
class SetPositionsBlock extends NodeGeometryBlock {
    /**
     * Create a new SetPositionsBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("positions", NodeGeometryBlockConnectionPointTypes.Vector3);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SetPositionsBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the positions input component
     */
    get positions() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _remapVector3Data(source, remap) {
        const newData = [];
        for (let index = 0; index < source.length; index += 3) {
            const remappedIndex = remap[index / 3];
            if (remappedIndex !== undefined) {
                newData.push(source[index], source[index + 1], source[index + 2]);
            }
        }
        return newData;
    }
    _remapVector4Data(source, remap) {
        const newData = [];
        for (let index = 0; index < source.length; index += 4) {
            const remappedIndex = remap[index / 4];
            if (remappedIndex !== undefined) {
                newData.push(source[index], source[index + 1], source[index + 2], source[index + 3]);
            }
        }
        return newData;
    }
    _remapVector2Data(source, remap) {
        const newData = [];
        for (let index = 0; index < source.length; index += 2) {
            const remappedIndex = remap[index / 2];
            if (remappedIndex !== undefined) {
                newData.push(source[index], source[index + 1]);
            }
        }
        return newData;
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            if (this._vertexData) {
                this._vertexData = this._vertexData.clone(); // Preserve source data
            }
            state.pushGeometryContext(this._vertexData);
            if (!this._vertexData || !this._vertexData.positions || !this.positions.isConnected) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = null;
                return;
            }
            // Processing
            const remap = {};
            const vertexCount = this._vertexData.positions.length / 3;
            const newPositions = [];
            let activeIndex = 0;
            let resize = false;
            for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {
                const tempVector3 = this.positions.getConnectedValue(state);
                if (tempVector3) {
                    tempVector3.toArray(newPositions, activeIndex * 3);
                    remap[this._currentIndex] = activeIndex;
                    activeIndex++;
                }
                else {
                    resize = true;
                }
            }
            if (resize) {
                // Indices remap
                if (this._vertexData.indices) {
                    const newIndices = [];
                    for (let index = 0; index < this._vertexData.indices.length; index += 3) {
                        const a = this._vertexData.indices[index];
                        const b = this._vertexData.indices[index + 1];
                        const c = this._vertexData.indices[index + 2];
                        const remappedA = remap[a];
                        const remappedB = remap[b];
                        const remappedC = remap[c];
                        if (remappedA !== undefined && remappedB !== undefined && remappedC !== undefined) {
                            newIndices.push(remappedA);
                            newIndices.push(remappedB);
                            newIndices.push(remappedC);
                        }
                    }
                    this._vertexData.indices = newIndices;
                }
                // Normals remap
                if (this._vertexData.normals) {
                    this._vertexData.normals = this._remapVector3Data(this._vertexData.normals, remap);
                }
                // Tangents remap
                if (this._vertexData.tangents) {
                    this._vertexData.tangents = this._remapVector4Data(this._vertexData.tangents, remap);
                }
                // Colors remap
                if (this._vertexData.colors) {
                    this._vertexData.colors = this._remapVector4Data(this._vertexData.colors, remap);
                }
                // UVs remap
                if (this._vertexData.uvs) {
                    this._vertexData.uvs = this._remapVector2Data(this._vertexData.uvs, remap);
                }
                if (this._vertexData.uvs2) {
                    this._vertexData.uvs2 = this._remapVector2Data(this._vertexData.uvs2, remap);
                }
                if (this._vertexData.uvs3) {
                    this._vertexData.uvs3 = this._remapVector2Data(this._vertexData.uvs3, remap);
                }
                if (this._vertexData.uvs4) {
                    this._vertexData.uvs4 = this._remapVector2Data(this._vertexData.uvs4, remap);
                }
                if (this._vertexData.uvs5) {
                    this._vertexData.uvs5 = this._remapVector2Data(this._vertexData.uvs5, remap);
                }
                if (this._vertexData.uvs6) {
                    this._vertexData.uvs6 = this._remapVector2Data(this._vertexData.uvs6, remap);
                }
            }
            // Update positions
            this._vertexData.positions = newPositions;
            // Storage
            state.restoreGeometryContext();
            state.restoreExecutionContext();
            return this._vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], SetPositionsBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetPositionsBlock", SetPositionsBlock);
//# sourceMappingURL=setPositionsBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setNormalsBlock.js





/**
 * Block used to set normals for a geometry
 */
class SetNormalsBlock extends NodeGeometryBlock {
    /**
     * Create a new SetNormalsBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("normals", NodeGeometryBlockConnectionPointTypes.Vector3);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SetNormalsBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the normals input component
     */
    get normals() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            if (this._vertexData) {
                this._vertexData = this._vertexData.clone(); // Preserve source data
            }
            state.pushGeometryContext(this._vertexData);
            if (!this._vertexData || !this._vertexData.positions) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = null;
                return;
            }
            if (!this.normals.isConnected) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = this._vertexData;
                return;
            }
            if (!this._vertexData.normals) {
                this._vertexData.normals = [];
            }
            // Processing
            const vertexCount = this._vertexData.positions.length / 3;
            for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {
                const tempVector3 = this.normals.getConnectedValue(state);
                if (tempVector3) {
                    tempVector3.toArray(this._vertexData.normals, this._currentIndex * 3);
                }
            }
            // Storage
            state.restoreGeometryContext();
            state.restoreExecutionContext();
            return this._vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], SetNormalsBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetNormalsBlock", SetNormalsBlock);
//# sourceMappingURL=setNormalsBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setUVsBlock.js





/**
 * Block used to set texture coordinates for a geometry
 */
class SetUVsBlock extends NodeGeometryBlock {
    /**
     * Create a new SetUVsBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        /**
         * Gets or sets a value indicating which UV to set
         */
        this.textureCoordinateIndex = 0;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("uvs", NodeGeometryBlockConnectionPointTypes.Vector2);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SetUVsBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the uvs input component
     */
    get uvs() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            if (this._vertexData) {
                this._vertexData = this._vertexData.clone(); // Preserve source data
            }
            state.pushGeometryContext(this._vertexData);
            if (!this._vertexData || !this._vertexData.positions) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = null;
                return;
            }
            if (!this.uvs.isConnected) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = this._vertexData;
                return;
            }
            const uvs = [];
            // Processing
            const vertexCount = this._vertexData.positions.length / 3;
            for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {
                const tempVector2 = this.uvs.getConnectedValue(state);
                if (tempVector2) {
                    tempVector2.toArray(uvs, this._currentIndex * 2);
                }
            }
            switch (this.textureCoordinateIndex) {
                case 0:
                    this._vertexData.uvs = uvs;
                    break;
                case 1:
                    this._vertexData.uvs2 = uvs;
                    break;
                case 2:
                    this._vertexData.uvs3 = uvs;
                    break;
                case 3:
                    this._vertexData.uvs4 = uvs;
                    break;
                case 4:
                    this._vertexData.uvs5 = uvs;
                    break;
                case 5:
                    this._vertexData.uvs6 = uvs;
                    break;
            }
            // Storage
            state.restoreGeometryContext();
            state.restoreExecutionContext();
            return this._vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.textureCoordinateIndex};\n`;
        codeString += `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        serializationObject.textureCoordinateIndex = this.textureCoordinateIndex;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.textureCoordinateIndex = serializationObject.textureCoordinateIndex;
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], SetUVsBlock.prototype, "evaluateContext", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Texture coordinates index", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { update: true },
        embedded: true,
        options: [
            { label: "UV1", value: 0 },
            { label: "UV2", value: 1 },
            { label: "UV3", value: 2 },
            { label: "UV4", value: 3 },
            { label: "UV5", value: 4 },
            { label: "UV6", value: 5 },
        ],
    })
], SetUVsBlock.prototype, "textureCoordinateIndex", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetUVsBlock", SetUVsBlock);
//# sourceMappingURL=setUVsBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setColorsBlock.js





/**
 * Block used to set colors for a geometry
 */
class SetColorsBlock extends NodeGeometryBlock {
    /**
     * Create a new SetColorsBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("colors", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector2);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SetColorsBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the colors input component
     */
    get colors() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            if (this._vertexData) {
                this._vertexData = this._vertexData.clone(); // Preserve source data
            }
            state.pushGeometryContext(this._vertexData);
            if (!this._vertexData || !this._vertexData.positions) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = null;
                return;
            }
            if (!this.colors.isConnected) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = this._vertexData;
                return;
            }
            if (!this._vertexData.colors) {
                this._vertexData.colors = [];
            }
            // Processing
            const vertexCount = this._vertexData.positions.length / 3;
            for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {
                if (this.colors.connectedPoint?.type === NodeGeometryBlockConnectionPointTypes.Vector3) {
                    const tempVector3 = this.colors.getConnectedValue(state);
                    if (tempVector3) {
                        tempVector3.toArray(this._vertexData.colors, this._currentIndex * 4);
                        this._vertexData.colors[this._currentIndex * 4 + 3] = 1; // Alpha
                        this._vertexData.hasVertexAlpha = false;
                    }
                }
                else {
                    const tempVector4 = this.colors.getConnectedValue(state);
                    if (tempVector4) {
                        tempVector4.toArray(this._vertexData.colors, this._currentIndex * 4);
                        this._vertexData.hasVertexAlpha = true;
                    }
                }
            }
            // Storage
            state.restoreGeometryContext();
            state.restoreExecutionContext();
            return this._vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], SetColorsBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetColorsBlock", SetColorsBlock);
//# sourceMappingURL=setColorsBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setTangentsBlock.js





/**
 * Block used to set tangents for a geometry
 */
class SetTangentsBlock extends NodeGeometryBlock {
    /**
     * Create a new SetTangentsBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("tangents", NodeGeometryBlockConnectionPointTypes.Vector4);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SetTangentsBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the tangents input component
     */
    get tangents() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            if (this._vertexData) {
                this._vertexData = this._vertexData.clone(); // Preserve source data
            }
            state.pushGeometryContext(this._vertexData);
            if (!this._vertexData || !this._vertexData.positions) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = null;
                return;
            }
            if (!this.tangents.isConnected) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = this._vertexData;
                return;
            }
            if (!this._vertexData.tangents) {
                this._vertexData.tangents = [];
            }
            // Processing
            const vertexCount = this._vertexData.positions.length / 3;
            for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {
                const tempVector4 = this.tangents.getConnectedValue(state);
                if (tempVector4) {
                    tempVector4.toArray(this._vertexData.tangents, this._currentIndex * 4);
                }
            }
            // Storage
            state.restoreGeometryContext();
            state.restoreExecutionContext();
            return this._vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], SetTangentsBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetTangentsBlock", SetTangentsBlock);
//# sourceMappingURL=setTangentsBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/mathBlock.js






/**
 * Operations supported by the Math block
 */
var MathBlockOperations;
(function (MathBlockOperations) {
    /** Add */
    MathBlockOperations[MathBlockOperations["Add"] = 0] = "Add";
    /** Subtract */
    MathBlockOperations[MathBlockOperations["Subtract"] = 1] = "Subtract";
    /** Multiply */
    MathBlockOperations[MathBlockOperations["Multiply"] = 2] = "Multiply";
    /** Divide */
    MathBlockOperations[MathBlockOperations["Divide"] = 3] = "Divide";
    /** Max */
    MathBlockOperations[MathBlockOperations["Max"] = 4] = "Max";
    /** Min */
    MathBlockOperations[MathBlockOperations["Min"] = 5] = "Min";
})(MathBlockOperations || (MathBlockOperations = {}));
/**
 * Block used to apply math functions
 */
class MathBlock extends NodeGeometryBlock {
    /**
     * Create a new MathBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets the operation applied by the block
         */
        this.operation = MathBlockOperations.Add;
        this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this.output._typeConnectionSource = this.left;
        const excludedConnectionPointTypes = [
            NodeGeometryBlockConnectionPointTypes.Matrix,
            NodeGeometryBlockConnectionPointTypes.Geometry,
            NodeGeometryBlockConnectionPointTypes.Texture,
        ];
        this.left.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);
        this.right.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);
        this._linkConnectionTypes(0, 1);
        this._connectionObservers = [
            this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),
            this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
            this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),
            this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
        ];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MathBlock";
    }
    /**
     * Gets the left input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        let func;
        const left = this.left;
        const right = this.right;
        if (!left.isConnected || !right.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const leftIsScalar = left.type === NodeGeometryBlockConnectionPointTypes.Float || left.type === NodeGeometryBlockConnectionPointTypes.Int;
        const rightIsScalar = right.type === NodeGeometryBlockConnectionPointTypes.Float || right.type === NodeGeometryBlockConnectionPointTypes.Int;
        // If both input types are scalars, then this is a scalar operation.
        const isScalar = leftIsScalar && rightIsScalar;
        switch (this.operation) {
            case MathBlockOperations.Add: {
                if (isScalar) {
                    func = (state) => {
                        return left.getConnectedValue(state) + right.getConnectedValue(state);
                    };
                }
                else if (leftIsScalar) {
                    func = (state) => {
                        return state.adapt(left, right.type).add(right.getConnectedValue(state));
                    };
                }
                else {
                    func = (state) => {
                        return left.getConnectedValue(state).add(state.adapt(right, left.type));
                    };
                }
                break;
            }
            case MathBlockOperations.Subtract: {
                if (isScalar) {
                    func = (state) => {
                        return left.getConnectedValue(state) - right.getConnectedValue(state);
                    };
                }
                else if (leftIsScalar) {
                    func = (state) => {
                        return state.adapt(left, right.type).subtract(right.getConnectedValue(state));
                    };
                }
                else {
                    func = (state) => {
                        return left.getConnectedValue(state).subtract(state.adapt(right, left.type));
                    };
                }
                break;
            }
            case MathBlockOperations.Multiply: {
                if (isScalar) {
                    func = (state) => {
                        return left.getConnectedValue(state) * right.getConnectedValue(state);
                    };
                }
                else if (leftIsScalar) {
                    func = (state) => {
                        return state.adapt(left, right.type).multiply(right.getConnectedValue(state));
                    };
                }
                else {
                    func = (state) => {
                        return left.getConnectedValue(state).multiply(state.adapt(right, left.type));
                    };
                }
                break;
            }
            case MathBlockOperations.Divide: {
                if (isScalar) {
                    func = (state) => {
                        return left.getConnectedValue(state) / right.getConnectedValue(state);
                    };
                }
                else if (leftIsScalar) {
                    func = (state) => {
                        return state.adapt(left, right.type).divide(right.getConnectedValue(state));
                    };
                }
                else {
                    func = (state) => {
                        return left.getConnectedValue(state).divide(state.adapt(right, left.type));
                    };
                }
                break;
            }
            case MathBlockOperations.Min: {
                if (isScalar) {
                    func = (state) => {
                        return Math.min(left.getConnectedValue(state), right.getConnectedValue(state));
                    };
                }
                else {
                    const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];
                    switch (vector.type) {
                        case NodeGeometryBlockConnectionPointTypes.Vector2: {
                            func = (state) => {
                                return math_vector/* Vector2 */.I9.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
                            };
                            break;
                        }
                        case NodeGeometryBlockConnectionPointTypes.Vector3: {
                            func = (state) => {
                                return math_vector/* Vector3 */.Pq.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
                            };
                            break;
                        }
                        case NodeGeometryBlockConnectionPointTypes.Vector4: {
                            func = (state) => {
                                return math_vector/* Vector4 */.IU.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
                            };
                            break;
                        }
                    }
                }
                break;
            }
            case MathBlockOperations.Max: {
                if (isScalar) {
                    func = (state) => {
                        return Math.max(left.getConnectedValue(state), right.getConnectedValue(state));
                    };
                }
                else {
                    const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];
                    switch (vector.type) {
                        case NodeGeometryBlockConnectionPointTypes.Vector2: {
                            func = (state) => {
                                return math_vector/* Vector2 */.I9.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
                            };
                            break;
                        }
                        case NodeGeometryBlockConnectionPointTypes.Vector3: {
                            func = (state) => {
                                return math_vector/* Vector3 */.Pq.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
                            };
                            break;
                        }
                        case NodeGeometryBlockConnectionPointTypes.Vector4: {
                            func = (state) => {
                                return math_vector/* Vector4 */.IU.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
                            };
                            break;
                        }
                    }
                    break;
                }
            }
        }
        this.output._storedFunction = (state) => {
            if (left.type === NodeGeometryBlockConnectionPointTypes.Int) {
                return func(state) | 0;
            }
            return func(state);
        };
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.operation = BABYLON.MathBlockOperations.${MathBlockOperations[this.operation]};\n`;
        return codeString;
    }
    _updateInputOutputTypes() {
        // First update the output type with the initial assumption that we'll base it on the left input.
        this.output._typeConnectionSource = this.left;
        if (this.left.isConnected && this.right.isConnected) {
            // Both inputs are connected, so we need to determine the output type based on the input types.
            if (this.left.type === NodeGeometryBlockConnectionPointTypes.Int ||
                (this.left.type === NodeGeometryBlockConnectionPointTypes.Float && this.right.type !== NodeGeometryBlockConnectionPointTypes.Int)) {
                this.output._typeConnectionSource = this.right;
            }
        }
        else if (this.left.isConnected !== this.right.isConnected) {
            // Only one input is connected, so we need to determine the output type based on the connected input.
            this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;
        }
        // Next update the accepted connection point types for the inputs based on the current input connection state.
        if (this.left.isConnected || this.right.isConnected) {
            for (const [first, second] of [
                [this.left, this.right],
                [this.right, this.left],
            ]) {
                // Always allow Ints and Floats.
                first.acceptedConnectionPointTypes = [NodeGeometryBlockConnectionPointTypes.Int, NodeGeometryBlockConnectionPointTypes.Float];
                if (second.isConnected) {
                    // The same types as the connected input are always allowed.
                    first.acceptedConnectionPointTypes.push(second.type);
                    // If the other input is a scalar, then we also allow Vector types.
                    if (second.type === NodeGeometryBlockConnectionPointTypes.Int || second.type === NodeGeometryBlockConnectionPointTypes.Float) {
                        first.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector2, NodeGeometryBlockConnectionPointTypes.Vector3, NodeGeometryBlockConnectionPointTypes.Vector4);
                    }
                }
            }
        }
    }
    /**
     * Release resources
     */
    dispose() {
        super.dispose();
        this._connectionObservers.forEach((observer) => observer.remove());
        this._connectionObservers.length = 0;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.operation = this.operation;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.operation = serializationObject.operation;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Operation", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "Add", value: MathBlockOperations.Add },
            { label: "Subtract", value: MathBlockOperations.Subtract },
            { label: "Multiply", value: MathBlockOperations.Multiply },
            { label: "Divide", value: MathBlockOperations.Divide },
            { label: "Max", value: MathBlockOperations.Max },
            { label: "Min", value: MathBlockOperations.Min },
        ],
    })
], MathBlock.prototype, "operation", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MathBlock", MathBlock);
//# sourceMappingURL=mathBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/mapRangeBlock.js



/**
 * Defines a block used to move a value from a range to another
 */
class MapRangeBlock extends NodeGeometryBlock {
    /**
     * Create a new MapRangeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("fromMin", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("fromMax", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("toMin", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("toMax", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector2);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector3);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector4);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MapRangeBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the fromMin input component
     */
    get fromMin() {
        return this._inputs[1];
    }
    /**
     * Gets the fromMax input component
     */
    get fromMax() {
        return this._inputs[2];
    }
    /**
     * Gets the toMin input component
     */
    get toMin() {
        return this._inputs[3];
    }
    /**
     * Gets the toMax input component
     */
    get toMax() {
        return this._inputs[4];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.value.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => {
            const value = this.value.getConnectedValue(state);
            const fromMin = this.fromMin.getConnectedValue(state);
            const fromMax = this.fromMax.getConnectedValue(state);
            const toMin = this.toMin.getConnectedValue(state);
            const toMax = this.toMax.getConnectedValue(state);
            const result = ((value - fromMin) / (fromMax - fromMin)) * (toMax - toMin) + toMin;
            if (this.output.type === NodeGeometryBlockConnectionPointTypes.Int) {
                return Math.floor(result);
            }
            return result;
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MapRangeBlock", MapRangeBlock);
//# sourceMappingURL=mapRangeBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/conditionBlock.js








/**
 * Conditions supported by the condition block
 */
var ConditionBlockTests;
(function (ConditionBlockTests) {
    /** Equal */
    ConditionBlockTests[ConditionBlockTests["Equal"] = 0] = "Equal";
    /** NotEqual */
    ConditionBlockTests[ConditionBlockTests["NotEqual"] = 1] = "NotEqual";
    /** LessThan */
    ConditionBlockTests[ConditionBlockTests["LessThan"] = 2] = "LessThan";
    /** GreaterThan */
    ConditionBlockTests[ConditionBlockTests["GreaterThan"] = 3] = "GreaterThan";
    /** LessOrEqual */
    ConditionBlockTests[ConditionBlockTests["LessOrEqual"] = 4] = "LessOrEqual";
    /** GreaterOrEqual */
    ConditionBlockTests[ConditionBlockTests["GreaterOrEqual"] = 5] = "GreaterOrEqual";
    /** Logical Exclusive OR */
    ConditionBlockTests[ConditionBlockTests["Xor"] = 6] = "Xor";
    /** Logical Or */
    ConditionBlockTests[ConditionBlockTests["Or"] = 7] = "Or";
    /** Logical And */
    ConditionBlockTests[ConditionBlockTests["And"] = 8] = "And";
})(ConditionBlockTests || (ConditionBlockTests = {}));
/**
 * Block used to evaluate a condition and return a true or false value
 */
class ConditionBlock extends NodeGeometryBlock {
    /**
     * Create a new ConditionBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets the test used by the block
         */
        this.test = ConditionBlockTests.Equal;
        this.registerInput("left", NodeGeometryBlockConnectionPointTypes.Float);
        this.registerInput("right", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("ifTrue", NodeGeometryBlockConnectionPointTypes.AutoDetect, true, 1);
        this.registerInput("ifFalse", NodeGeometryBlockConnectionPointTypes.AutoDetect, true, 0);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[2];
        this._outputs[0]._defaultConnectionPointType = NodeGeometryBlockConnectionPointTypes.Float;
        this._inputs[0].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
        this._inputs[1].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
        this._linkConnectionTypes(2, 3);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ConditionBlock";
    }
    /**
     * Gets the left input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the ifTrue input component
     */
    get ifTrue() {
        return this._inputs[2];
    }
    /**
     * Gets the ifFalse input component
     */
    get ifFalse() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    autoConfigure(nodeGeometry) {
        if (!this.ifTrue.isConnected) {
            const minInput = nodeGeometry.getBlockByPredicate((b) => b.isInput && b.value === 1 && b.name === "True") ||
                new GeometryInputBlock("True");
            minInput.value = 1;
            minInput.output.connectTo(this.ifTrue);
        }
        if (!this.ifFalse.isConnected) {
            const maxInput = nodeGeometry.getBlockByPredicate((b) => b.isInput && b.value === 0 && b.name === "False") ||
                new GeometryInputBlock("False");
            maxInput.value = 0;
            maxInput.output.connectTo(this.ifFalse);
        }
    }
    _buildBlock() {
        if (!this.left.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (state) => {
            const left = this.left.getConnectedValue(state);
            const right = this.right.getConnectedValue(state);
            let condition = false;
            switch (this.test) {
                case ConditionBlockTests.Equal:
                    condition = (0,math_scalar_functions.WithinEpsilon)(left, right, math_constants/* Epsilon */.bH);
                    break;
                case ConditionBlockTests.NotEqual:
                    condition = left !== right;
                    break;
                case ConditionBlockTests.LessThan:
                    condition = left < right;
                    break;
                case ConditionBlockTests.GreaterThan:
                    condition = left > right;
                    break;
                case ConditionBlockTests.LessOrEqual:
                    condition = left <= right;
                    break;
                case ConditionBlockTests.GreaterOrEqual:
                    condition = left >= right;
                    break;
                case ConditionBlockTests.Xor:
                    condition = (!!left && !right) || (!left && !!right);
                    break;
                case ConditionBlockTests.Or:
                    condition = !!left || !!right;
                    break;
                case ConditionBlockTests.And:
                    condition = !!left && !!right;
                    break;
            }
            return condition;
        };
        this.output._storedFunction = (state) => {
            if (func(state)) {
                return this.ifTrue.getConnectedValue(state);
            }
            return this.ifFalse.getConnectedValue(state);
        };
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.test = BABYLON.ConditionBlockTests.${ConditionBlockTests[this.test]};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.test = this.test;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.test = serializationObject.test;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Test", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "Equal", value: ConditionBlockTests.Equal },
            { label: "NotEqual", value: ConditionBlockTests.NotEqual },
            { label: "LessThan", value: ConditionBlockTests.LessThan },
            { label: "GreaterThan", value: ConditionBlockTests.GreaterThan },
            { label: "LessOrEqual", value: ConditionBlockTests.LessOrEqual },
            { label: "GreaterOrEqual", value: ConditionBlockTests.GreaterOrEqual },
            { label: "Xor", value: ConditionBlockTests.Xor },
            { label: "Or", value: ConditionBlockTests.Or },
            { label: "And", value: ConditionBlockTests.And },
        ],
    })
], ConditionBlock.prototype, "test", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ConditionBlock", ConditionBlock);
//# sourceMappingURL=conditionBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/randomBlock.js








/**
 * Locks supported by the random block
 */
var RandomBlockLocks;
(function (RandomBlockLocks) {
    /** None */
    RandomBlockLocks[RandomBlockLocks["None"] = 0] = "None";
    /** LoopID */
    RandomBlockLocks[RandomBlockLocks["LoopID"] = 1] = "LoopID";
    /** InstanceID */
    RandomBlockLocks[RandomBlockLocks["InstanceID"] = 2] = "InstanceID";
    /** Once */
    RandomBlockLocks[RandomBlockLocks["Once"] = 3] = "Once";
})(RandomBlockLocks || (RandomBlockLocks = {}));
/**
 * Block used to get a random number
 */
class RandomBlock extends NodeGeometryBlock {
    /**
     * Create a new RandomBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._currentLockId = -1;
        /**
         * Gets or sets a value indicating if that block will lock its value for a specific duration
         */
        this.lockMode = RandomBlockLocks.None;
        this.registerInput("min", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("max", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "RandomBlock";
    }
    /**
     * Gets the min input component
     */
    get min() {
        return this._inputs[0];
    }
    /**
     * Gets the max input component
     */
    get max() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.min.isConnected) {
            const minInput = new GeometryInputBlock("Min");
            minInput.value = 0;
            minInput.output.connectTo(this.min);
        }
        if (!this.max.isConnected) {
            const maxInput = new GeometryInputBlock("Max");
            maxInput.value = 1;
            maxInput.output.connectTo(this.max);
        }
    }
    _buildBlock() {
        let func = null;
        this._currentLockId = -1;
        switch (this.min.type) {
            case NodeGeometryBlockConnectionPointTypes.Int:
            case NodeGeometryBlockConnectionPointTypes.Float: {
                func = (state) => {
                    const min = this.min.getConnectedValue(state) || 0;
                    const max = this.max.getConnectedValue(state) || 0;
                    return min + Math.random() * (max - min);
                };
                break;
            }
            case NodeGeometryBlockConnectionPointTypes.Vector2: {
                func = (state) => {
                    const min = this.min.getConnectedValue(state) || math_vector/* Vector2 */.I9.Zero();
                    const max = this.max.getConnectedValue(state) || math_vector/* Vector2 */.I9.Zero();
                    return new math_vector/* Vector2 */.I9(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y));
                };
                break;
            }
            case NodeGeometryBlockConnectionPointTypes.Vector3: {
                func = (state) => {
                    const min = this.min.getConnectedValue(state) || math_vector/* Vector3 */.Pq.Zero();
                    const max = this.max.getConnectedValue(state) || math_vector/* Vector3 */.Pq.Zero();
                    return new math_vector/* Vector3 */.Pq(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y), min.z + Math.random() * (max.z - min.z));
                };
                break;
            }
            case NodeGeometryBlockConnectionPointTypes.Vector4: {
                func = (state) => {
                    const min = this.min.getConnectedValue(state) || math_vector/* Vector4 */.IU.Zero();
                    const max = this.max.getConnectedValue(state) || math_vector/* Vector4 */.IU.Zero();
                    return new math_vector/* Vector4 */.IU(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y), min.z + Math.random() * (max.z - min.z), min.w + Math.random() * (max.w - min.w));
                };
                break;
            }
        }
        if (this.lockMode === RandomBlockLocks.None || !func) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = (state) => {
                let lockId = 0;
                switch (this.lockMode) {
                    case RandomBlockLocks.InstanceID:
                        lockId = state.getContextualValue(NodeGeometryContextualSources.InstanceID, true) || 0;
                        break;
                    case RandomBlockLocks.LoopID:
                        lockId = state.getContextualValue(NodeGeometryContextualSources.LoopID, true) || 0;
                        break;
                    case RandomBlockLocks.Once:
                        lockId = state.buildId || 0;
                        break;
                }
                if (this._currentLockId !== lockId || this.lockMode === RandomBlockLocks.None) {
                    this._currentLockId = lockId;
                    this.output._storedValue = func(state);
                }
                return this.output._storedValue;
            };
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.lockMode = BABYLON.RandomBlockLocks.${RandomBlockLocks[this.lockMode]};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.lockMode = this.lockMode;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.lockMode = serializationObject.lockMode;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("LockMode", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "None", value: RandomBlockLocks.None },
            { label: "LoopID", value: RandomBlockLocks.LoopID },
            { label: "InstanceID", value: RandomBlockLocks.InstanceID },
            { label: "Once", value: RandomBlockLocks.Once },
        ],
    })
], RandomBlock.prototype, "lockMode", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.RandomBlock", RandomBlock);
//# sourceMappingURL=randomBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/noiseBlock.js






/**
 * Block used to get a noise value
 */
class NoiseBlock extends NodeGeometryBlock {
    /**
     * Create a new NoiseBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("offset", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerInput("scale", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerInput("octaves", NodeGeometryBlockConnectionPointTypes.Float, true, 2, 0, 16);
        this.registerInput("roughness", NodeGeometryBlockConnectionPointTypes.Float, true, 0.5, 0, 1);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NoiseBlock";
    }
    /**
     * Gets the offset input component
     */
    get offset() {
        return this._inputs[0];
    }
    /**
     * Gets the scale input component
     */
    get scale() {
        return this._inputs[1];
    }
    /**
     * Gets the octaves input component
     */
    get octaves() {
        return this._inputs[2];
    }
    /**
     * Gets the roughtness input component
     */
    get roughness() {
        return this._inputs[3];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _negateIf(value, condition) {
        return condition !== 0 ? -value : value;
    }
    _noiseGrad(hash, x, y, z) {
        const h = hash & 15;
        const u = h < 8 ? x : y;
        const vt = h === 12 || h == 14 ? x : z;
        const v = h < 4 ? y : vt;
        return this._negateIf(u, h & u) + this._negateIf(v, h & 2);
    }
    _fade(t) {
        return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
    }
    _hashBitRotate(x, k) {
        return (x << k) | (x >> (32 - k));
    }
    _hash(kx, ky, kz) {
        let a, b, c;
        a = b = c = 0xdeadbeef + (3 << 2) + 13;
        c += kz;
        b += ky;
        a += kx;
        c ^= b;
        c -= this._hashBitRotate(b, 14);
        a ^= c;
        a -= this._hashBitRotate(c, 11);
        b ^= a;
        b -= this._hashBitRotate(a, 25);
        c ^= b;
        c -= this._hashBitRotate(b, 16);
        a ^= c;
        a -= this._hashBitRotate(c, 4);
        b ^= a;
        b -= this._hashBitRotate(a, 14);
        c ^= b;
        c -= this._hashBitRotate(b, 24);
        return c;
    }
    _mix(v0, v1, v2, v3, v4, v5, v6, v7, x, y, z) {
        const x1 = 1.0 - x;
        const y1 = 1.0 - y;
        const z1 = 1.0 - z;
        return z1 * (y1 * (v0 * x1 + v1 * x) + y * (v2 * x1 + v3 * x)) + z * (y1 * (v4 * x1 + v5 * x) + y * (v6 * x1 + v7 * x));
    }
    _perlinNoise(position) {
        const X = (position.x | 0) - (position.x < 0 ? 1 : 0);
        const Y = (position.y | 0) - (position.y < 0 ? 1 : 0);
        const Z = (position.z | 0) - (position.z < 0 ? 1 : 0);
        const fx = position.x - X;
        const fy = position.y - Y;
        const fz = position.z - Z;
        const u = this._fade(fx);
        const v = this._fade(fy);
        const w = this._fade(fz);
        return this._mix(this._noiseGrad(this._hash(X, Y, Z), fx, fy, fz), this._noiseGrad(this._hash(X + 1, Y, Z), fx - 1, fy, fz), this._noiseGrad(this._hash(X, Y + 1, Z), fx, fy - 1, fz), this._noiseGrad(this._hash(X + 1, Y + 1, Z), fx - 1, fy - 1, fz), this._noiseGrad(this._hash(X, Y, Z + 1), fx, fy, fz - 1), this._noiseGrad(this._hash(X + 1, Y, Z + 1), fx - 1, fy, fz - 1), this._noiseGrad(this._hash(X, Y + 1, Z + 1), fx, fy - 1, fz - 1), this._noiseGrad(this._hash(X + 1, Y + 1, Z + 1), fx - 1, fy - 1, fz - 1), u, v, w);
    }
    _perlinSigned(position) {
        return this._perlinNoise(position) * 0.982;
    }
    _perlin(position) {
        return this._perlinSigned(position) / 2.0 + 0.5;
    }
    /**
     * Gets a perlin noise value
     * @param octaves number of octaves
     * @param roughness roughness
     * @param _position position vector
     * @param offset offset vector
     * @param scale scale value
     * @returns a value between 0 and 1
     * @see Based on https://github.com/blender/blender/blob/main/source/blender/blenlib/intern/noise.cc#L533
     */
    noise(octaves, roughness, _position, offset, scale) {
        const position = new math_vector/* Vector3 */.Pq(_position.x * scale + offset.x, _position.y * scale + offset.y, _position.z * scale + offset.z);
        let fscale = 1.0;
        let amp = 1.0;
        let maxamp = 0.0;
        let sum = 0.0;
        octaves = (0,math_scalar_functions.Clamp)(octaves, 0, 15.0);
        const step = octaves | 0;
        for (let i = 0; i <= step; i++) {
            const t = this._perlin(position.scale(fscale));
            sum += t * amp;
            maxamp += amp;
            amp *= (0,math_scalar_functions.Clamp)(roughness, 0.0, 1.0);
            fscale *= 2.0;
        }
        const rmd = octaves - Math.floor(octaves);
        if (rmd == 0.0) {
            return sum / maxamp;
        }
        const t = this._perlin(position.scale(fscale));
        let sum2 = sum + t * amp;
        sum /= maxamp;
        sum2 /= maxamp + amp;
        return (1.0 - rmd) * sum + rmd * sum2;
    }
    _buildBlock() {
        this.output._storedFunction = (state) => {
            const position = state.getContextualValue(NodeGeometryContextualSources.Positions);
            const octaves = this.octaves.getConnectedValue(state);
            const roughness = this.roughness.getConnectedValue(state);
            const offset = this.offset.getConnectedValue(state);
            const scale = this.scale.getConnectedValue(state);
            return this.noise(octaves, roughness, position, offset, scale);
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NoiseBlock", NoiseBlock);
//# sourceMappingURL=noiseBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/mergeGeometryBlock.js





/**
 * Block used to merge several geometries
 */
class MergeGeometryBlock extends NodeGeometryBlock {
    /**
     * Create a new MergeGeometryBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        this.registerInput("geometry0", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("geometry1", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry2", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry3", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry4", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MergeGeometryBlock";
    }
    /**
     * Gets the geometry0 input component
     */
    get geometry0() {
        return this._inputs[0];
    }
    /**
     * Gets the geometry1 input component
     */
    get geometry1() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry2 input component
     */
    get geometry2() {
        return this._inputs[2];
    }
    /**
     * Gets the geometry3 input component
     */
    get geometry3() {
        return this._inputs[3];
    }
    /**
     * Gets the geometry4 input component
     */
    get geometry4() {
        return this._inputs[4];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            const vertexDataSource = [];
            if (this.geometry0.isConnected) {
                const data = this.geometry0.getConnectedValue(state);
                if (data) {
                    vertexDataSource.push(data);
                }
            }
            if (this.geometry1.isConnected) {
                const data = this.geometry1.getConnectedValue(state);
                if (data) {
                    vertexDataSource.push(data);
                }
            }
            if (this.geometry2.isConnected) {
                const data = this.geometry2.getConnectedValue(state);
                if (data) {
                    vertexDataSource.push(data);
                }
            }
            if (this.geometry3.isConnected) {
                const data = this.geometry3.getConnectedValue(state);
                if (data) {
                    vertexDataSource.push(data);
                }
            }
            if (this.geometry4.isConnected) {
                const data = this.geometry4.getConnectedValue(state);
                if (data) {
                    vertexDataSource.push(data);
                }
            }
            if (vertexDataSource.length === 0) {
                return null;
            }
            let vertexData = vertexDataSource[0].clone(); // Preserve source data
            const additionalVertexData = vertexDataSource.slice(1);
            if (additionalVertexData.length && vertexData) {
                vertexData = vertexData.merge(additionalVertexData, true, false, true, true);
            }
            return vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], MergeGeometryBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MergeGeometryBlock", MergeGeometryBlock);
//# sourceMappingURL=mergeGeometryBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryCollectionBlock.js





/**
 * Block used to randomly pick a geometry from a collection
 */
class GeometryCollectionBlock extends NodeGeometryBlock {
    /**
     * Create a new GeometryCollectionBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("geometry0", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry1", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry2", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry3", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry4", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry5", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry6", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry7", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry8", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("geometry9", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryCollectionBlock";
    }
    /**
     * Gets the geometry0 input component
     */
    get geometry0() {
        return this._inputs[0];
    }
    /**
     * Gets the geometry1 input component
     */
    get geometry1() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry2 input component
     */
    get geometry2() {
        return this._inputs[2];
    }
    /**
     * Gets the geometry3 input component
     */
    get geometry3() {
        return this._inputs[3];
    }
    /**
     * Gets the geometry4 input component
     */
    get geometry4() {
        return this._inputs[4];
    }
    /**
     * Gets the geometry5 input component
     */
    get geometry5() {
        return this._inputs[5];
    }
    /**
     * Gets the geometry6 input component
     */
    get geometry6() {
        return this._inputs[6];
    }
    /**
     * Gets the geometry7 input component
     */
    get geometry7() {
        return this._inputs[7];
    }
    /**
     * Gets the geometry8 input component
     */
    get geometry8() {
        return this._inputs[8];
    }
    /**
     * Gets the geometry9 input component
     */
    get geometry9() {
        return this._inputs[9];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _storeGeometry(input, state, index, availables) {
        if (input.isConnected) {
            const vertexData = input.getConnectedValue(state);
            if (!vertexData) {
                return;
            }
            vertexData.metadata = vertexData.metadata || {};
            vertexData.metadata.collectionId = index;
            availables.push(vertexData);
        }
    }
    _buildBlock(state) {
        const func = (state) => {
            const availables = [];
            this._storeGeometry(this.geometry0, state, 0, availables);
            this._storeGeometry(this.geometry1, state, 1, availables);
            this._storeGeometry(this.geometry2, state, 2, availables);
            this._storeGeometry(this.geometry3, state, 3, availables);
            this._storeGeometry(this.geometry4, state, 4, availables);
            this._storeGeometry(this.geometry5, state, 5, availables);
            this._storeGeometry(this.geometry6, state, 6, availables);
            this._storeGeometry(this.geometry7, state, 7, availables);
            this._storeGeometry(this.geometry8, state, 8, availables);
            this._storeGeometry(this.geometry9, state, 9, availables);
            if (!availables.length) {
                return null;
            }
            return availables[Math.round(Math.random() * (availables.length - 1))];
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], GeometryCollectionBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryCollectionBlock", GeometryCollectionBlock);
//# sourceMappingURL=geometryCollectionBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/cleanGeometryBlock.js






/**
 * Block used to clean a geometry
 */
class CleanGeometryBlock extends NodeGeometryBlock {
    /**
     * Creates a new CleanGeometryBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "CleanGeometryBlock";
    }
    /**
     * Gets the geometry component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            if (!this.geometry.isConnected) {
                return null;
            }
            const vertexData = this.geometry.getConnectedValue(state).clone();
            if (!vertexData.positions || !vertexData.indices || !vertexData.normals) {
                return vertexData;
            }
            const indices = vertexData.indices;
            const positions = vertexData.positions;
            (0,math_functions/* FixFlippedFaces */.Y4)(positions, indices);
            return vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], CleanGeometryBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CleanGeometryBlock", CleanGeometryBlock);
//# sourceMappingURL=cleanGeometryBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryElbowBlock.js



/**
 * Block used as a pass through
 */
class GeometryElbowBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryElbowBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the time spent to build this block (in ms)
     */
    get buildExecutionTime() {
        return -1;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryElbowBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const input = this._inputs[0];
        output._storedFunction = (state) => {
            return input.getConnectedValue(state);
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryElbowBlock", GeometryElbowBlock);
//# sourceMappingURL=geometryElbowBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/computeNormalsBlock.js




/**
 * Block used to recompute normals for a geometry
 */
class ComputeNormalsBlock extends NodeGeometryBlock {
    /**
     * Creates a new ComputeNormalsBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ComputeNormalsBlock";
    }
    /**
     * Gets the geometry component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        this.output._storedFunction = (state) => {
            if (!this.geometry.isConnected) {
                return null;
            }
            const vertexData = this.geometry.getConnectedValue(state);
            if (!vertexData.normals) {
                vertexData.normals = [];
            }
            mesh_vertexData/* VertexData */.P.ComputeNormals(vertexData.positions, vertexData.indices, vertexData.normals);
            return vertexData;
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ComputeNormalsBlock", ComputeNormalsBlock);
//# sourceMappingURL=computeNormalsBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/vectorConverterBlock.js




/**
 * Block used to create a Vector2/3/4 out of individual or partial inputs
 */
class VectorConverterBlock extends NodeGeometryBlock {
    /**
     * Create a new VectorConverterBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("xyzw ", NodeGeometryBlockConnectionPointTypes.Vector4, true);
        this.registerInput("xyz ", NodeGeometryBlockConnectionPointTypes.Vector3, true);
        this.registerInput("xy ", NodeGeometryBlockConnectionPointTypes.Vector2, true);
        this.registerInput("zw ", NodeGeometryBlockConnectionPointTypes.Vector2, true);
        this.registerInput("x ", NodeGeometryBlockConnectionPointTypes.Float, true);
        this.registerInput("y ", NodeGeometryBlockConnectionPointTypes.Float, true);
        this.registerInput("z ", NodeGeometryBlockConnectionPointTypes.Float, true);
        this.registerInput("w ", NodeGeometryBlockConnectionPointTypes.Float, true);
        this.registerOutput("xyzw", NodeGeometryBlockConnectionPointTypes.Vector4);
        this.registerOutput("xyz", NodeGeometryBlockConnectionPointTypes.Vector3);
        this.registerOutput("xy", NodeGeometryBlockConnectionPointTypes.Vector2);
        this.registerOutput("zw", NodeGeometryBlockConnectionPointTypes.Vector2);
        this.registerOutput("x", NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("y", NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("z", NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("w", NodeGeometryBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "VectorConverterBlock";
    }
    /**
     * Gets the xyzw component (input)
     */
    get xyzwIn() {
        return this._inputs[0];
    }
    /**
     * Gets the xyz component (input)
     */
    get xyzIn() {
        return this._inputs[1];
    }
    /**
     * Gets the xy component (input)
     */
    get xyIn() {
        return this._inputs[2];
    }
    /**
     * Gets the zw component (input)
     */
    get zwIn() {
        return this._inputs[3];
    }
    /**
     * Gets the x component (input)
     */
    get xIn() {
        return this._inputs[4];
    }
    /**
     * Gets the y component (input)
     */
    get yIn() {
        return this._inputs[5];
    }
    /**
     * Gets the z component (input)
     */
    get zIn() {
        return this._inputs[6];
    }
    /**
     * Gets the w component (input)
     */
    get wIn() {
        return this._inputs[7];
    }
    /**
     * Gets the xyzw component (output)
     */
    get xyzwOut() {
        return this._outputs[0];
    }
    /**
     * Gets the xyz component (output)
     */
    get xyzOut() {
        return this._outputs[1];
    }
    /**
     * Gets the xy component (output)
     */
    get xyOut() {
        return this._outputs[2];
    }
    /**
     * Gets the zw component (output)
     */
    get zwOut() {
        return this._outputs[3];
    }
    /**
     * Gets the x component (output)
     */
    get xOut() {
        return this._outputs[4];
    }
    /**
     * Gets the y component (output)
     */
    get yOut() {
        return this._outputs[5];
    }
    /**
     * Gets the z component (output)
     */
    get zOut() {
        return this._outputs[6];
    }
    /**
     * Gets the w component (output)
     */
    get wOut() {
        return this._outputs[7];
    }
    _inputRename(name) {
        if (name === "xyzw ") {
            return "xyzwIn";
        }
        if (name === "xyz ") {
            return "xyzIn";
        }
        if (name === "xy ") {
            return "xyIn";
        }
        if (name === "zw ") {
            return "zwIn";
        }
        if (name === "x ") {
            return "xIn";
        }
        if (name === "y ") {
            return "yIn";
        }
        if (name === "z ") {
            return "zIn";
        }
        if (name === "w ") {
            return "wIn";
        }
        return name;
    }
    _outputRename(name) {
        switch (name) {
            case "x":
                return "xOut";
            case "y":
                return "yOut";
            case "z":
                return "zOut";
            case "w":
                return "wOut";
            case "xy":
                return "xyOut";
            case "zw":
                return "zwOut";
            case "xyz":
                return "xyzOut";
            case "xyzw":
                return "xyzwOut";
            default:
                return name;
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const xInput = this.xIn;
        const yInput = this.yIn;
        const zInput = this.zIn;
        const wInput = this.wIn;
        const xyInput = this.xyIn;
        const zwInput = this.zwIn;
        const xyzInput = this.xyzIn;
        const xyzwInput = this.xyzwIn;
        const xyzwOutput = this.xyzwOut;
        const xyzOutput = this.xyzOut;
        const xyOutput = this.xyOut;
        const zwOutput = this.zwOut;
        const xOutput = this.xOut;
        const yOutput = this.yOut;
        const zOutput = this.zOut;
        const wOutput = this.wOut;
        const getData = (state) => {
            if (xyzwInput.isConnected) {
                return xyzwInput.getConnectedValue(state);
            }
            let x = 0;
            let y = 0;
            let z = 0;
            let w = 0;
            if (xInput.isConnected) {
                x = xInput.getConnectedValue(state);
            }
            if (yInput.isConnected) {
                y = yInput.getConnectedValue(state);
            }
            if (zInput.isConnected) {
                z = zInput.getConnectedValue(state);
            }
            if (wInput.isConnected) {
                w = wInput.getConnectedValue(state);
            }
            if (xyInput.isConnected) {
                const temp = xyInput.getConnectedValue(state);
                if (temp) {
                    x = temp.x;
                    y = temp.y;
                }
            }
            if (zwInput.isConnected) {
                const temp = zwInput.getConnectedValue(state);
                if (temp) {
                    z = temp.x;
                    w = temp.y;
                }
            }
            if (xyzInput.isConnected) {
                const temp = xyzInput.getConnectedValue(state);
                if (temp) {
                    x = temp.x;
                    y = temp.y;
                    z = temp.z;
                }
            }
            return new math_vector/* Vector4 */.IU(x, y, z, w);
        };
        xyzwOutput._storedFunction = (state) => getData(state);
        xyzOutput._storedFunction = (state) => {
            const data = getData(state);
            return new math_vector/* Vector3 */.Pq(data.x, data.y, data.z);
        };
        xyOutput._storedFunction = (state) => {
            const data = getData(state);
            return new math_vector/* Vector2 */.I9(data.x, data.y);
        };
        zwOutput._storedFunction = (state) => {
            const data = getData(state);
            return new math_vector/* Vector2 */.I9(data.z, data.w);
        };
        xOutput._storedFunction = (state) => getData(state).x;
        yOutput._storedFunction = (state) => getData(state).y;
        zOutput._storedFunction = (state) => getData(state).z;
        wOutput._storedFunction = (state) => getData(state).w;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.VectorConverterBlock", VectorConverterBlock);
//# sourceMappingURL=vectorConverterBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/normalizeVectorBlock.js



/**
 * Block used to normalize vectors
 */
class NormalizeVectorBlock extends NodeGeometryBlock {
    /**
     * Creates a new NormalizeVectorBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "NormalizeVectorBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this.output._storedFunction = null;
        if (!this.input.isConnected) {
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => this.input.getConnectedValue(state).normalize();
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.NormalizeVectorBlock", NormalizeVectorBlock);
//# sourceMappingURL=normalizeVectorBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setMaterialIDBlock.js






/**
 * Block used to affect a material ID to a geometry
 */
class SetMaterialIDBlock extends NodeGeometryBlock {
    /**
     * Create a new SetMaterialIDBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("id", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.id.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "SetMaterialIDBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the id input component
     */
    get id() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        if (!this.geometry.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (state) => {
            const vertexData = this.geometry.getConnectedValue(state);
            if (!vertexData || !vertexData.indices || !vertexData.positions) {
                return vertexData;
            }
            const materialInfo = new mesh_vertexData/* VertexDataMaterialInfo */.o();
            materialInfo.materialIndex = this.id.getConnectedValue(state) | 0;
            materialInfo.indexStart = 0;
            materialInfo.indexCount = vertexData.indices.length;
            materialInfo.verticesStart = 0;
            materialInfo.verticesCount = vertexData.positions.length / 3;
            vertexData.materialInfos = [materialInfo];
            return vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], SetMaterialIDBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SetMaterialIDBlock", SetMaterialIDBlock);
//# sourceMappingURL=setMaterialIDBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/latticeBlock.js








/**
 * Block used to apply Lattice on geometry
 */
class LatticeBlock extends NodeGeometryBlock {
    /**
     * Create a new LatticeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._indexVector3 = new math_vector/* Vector3 */.Pq();
        this._currentControl = new math_vector/* Vector3 */.Pq();
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        /**
         * Resolution on x axis
         */
        this.resolutionX = 3;
        /**
         * Resolution on y axis
         */
        this.resolutionY = 3;
        /**
         * Resolution on z axis
         */
        this.resolutionZ = 3;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("controls", NodeGeometryBlockConnectionPointTypes.Vector3);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndexX + this.resolutionX * (this._currentIndexY + this.resolutionY * this._currentIndexZ);
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this.getExecutionIndex();
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "LatticeBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the controls input component
     */
    get controls() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the value associated with a contextual positions
     * In this case it will be the current position in the lattice
     * @returns the current position in the lattice
     */
    getOverridePositionsContextualValue() {
        return this._indexVector3;
    }
    /**
     * Gets the value associated with a contextual normals
     * In this case it will be the current control point being processed
     * @returns the current control point being processed
     */
    getOverrideNormalsContextualValue() {
        return this._currentControl;
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            if (this._vertexData) {
                this._vertexData = this._vertexData.clone(); // Preserve source data
            }
            if (!this._vertexData || !this._vertexData.positions) {
                state.restoreExecutionContext();
                this.output._storedValue = null;
                return;
            }
            const positions = this._vertexData.positions;
            const boundingInfo = (0,math_functions/* extractMinAndMax */.b8)(positions, 0, positions.length / 3);
            // Building the lattice
            const size = boundingInfo.maximum.subtract(boundingInfo.minimum);
            this._lattice = new Lattice({
                resolutionX: this.resolutionX,
                resolutionY: this.resolutionY,
                resolutionZ: this.resolutionZ,
                size: size,
                position: boundingInfo.minimum.add(size.scale(0.5)),
            });
            for (this._currentIndexX = 0; this._currentIndexX < this.resolutionX; this._currentIndexX++) {
                for (this._currentIndexY = 0; this._currentIndexY < this.resolutionY; this._currentIndexY++) {
                    for (this._currentIndexZ = 0; this._currentIndexZ < this.resolutionZ; this._currentIndexZ++) {
                        this._indexVector3.set(this._currentIndexX, this._currentIndexY, this._currentIndexZ);
                        const latticeControl = this._lattice.data[this._currentIndexX][this._currentIndexY][this._currentIndexZ];
                        this._currentControl.copyFrom(latticeControl);
                        const tempVector3 = this.controls.getConnectedValue(state);
                        if (tempVector3) {
                            latticeControl.set(tempVector3.x, tempVector3.y, tempVector3.z);
                        }
                    }
                }
            }
            // Apply lattice
            this._lattice.deform(positions);
            // Storage
            state.restoreExecutionContext();
            return this._vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        codeString += `${this._codeVariableName}.resolutionX = ${this.resolutionX};\n`;
        codeString += `${this._codeVariableName}.resolutionY = ${this.resolutionY};\n`;
        codeString += `${this._codeVariableName}.resolutionZ = ${this.resolutionZ};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        serializationObject.resolutionX = this.resolutionX;
        serializationObject.resolutionY = this.resolutionY;
        serializationObject.resolutionZ = this.resolutionZ;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
            this.resolutionX = serializationObject.resolutionX;
            this.resolutionY = serializationObject.resolutionY;
            this.resolutionZ = serializationObject.resolutionZ;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], LatticeBlock.prototype, "evaluateContext", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("resolutionX", 2 /* PropertyTypeForEdition.Int */, "ADVANCED", { embedded: true, notifiers: { rebuild: true }, min: 1, max: 10 })
], LatticeBlock.prototype, "resolutionX", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("resolutionY", 2 /* PropertyTypeForEdition.Int */, "ADVANCED", { embedded: true, notifiers: { rebuild: true }, min: 1, max: 10 })
], LatticeBlock.prototype, "resolutionY", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("resolutionZ", 2 /* PropertyTypeForEdition.Int */, "ADVANCED", { embedded: true, notifiers: { rebuild: true }, min: 1, max: 10 })
], LatticeBlock.prototype, "resolutionZ", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.LatticeBlock", LatticeBlock);
//# sourceMappingURL=latticeBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryTrigonometryBlock.js






/**
 * Operations supported by the Trigonometry block
 */
var GeometryTrigonometryBlockOperations;
(function (GeometryTrigonometryBlockOperations) {
    /** Cos */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Cos"] = 0] = "Cos";
    /** Sin */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Sin"] = 1] = "Sin";
    /** Abs */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Abs"] = 2] = "Abs";
    /** Exp */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Exp"] = 3] = "Exp";
    /** Round */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Round"] = 4] = "Round";
    /** Floor */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Floor"] = 5] = "Floor";
    /** Ceiling */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Ceiling"] = 6] = "Ceiling";
    /** Square root */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Sqrt"] = 7] = "Sqrt";
    /** Log */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Log"] = 8] = "Log";
    /** Tangent */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Tan"] = 9] = "Tan";
    /** Arc tangent */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["ArcTan"] = 10] = "ArcTan";
    /** Arc cosinus */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["ArcCos"] = 11] = "ArcCos";
    /** Arc sinus */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["ArcSin"] = 12] = "ArcSin";
    /** Sign */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Sign"] = 13] = "Sign";
    /** Negate */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Negate"] = 14] = "Negate";
    /** OneMinus */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["OneMinus"] = 15] = "OneMinus";
    /** Reciprocal */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Reciprocal"] = 16] = "Reciprocal";
    /** ToDegrees */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["ToDegrees"] = 17] = "ToDegrees";
    /** ToRadians */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["ToRadians"] = 18] = "ToRadians";
    /** Fract */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Fract"] = 19] = "Fract";
    /** Exp2 */
    GeometryTrigonometryBlockOperations[GeometryTrigonometryBlockOperations["Exp2"] = 20] = "Exp2";
})(GeometryTrigonometryBlockOperations || (GeometryTrigonometryBlockOperations = {}));
/**
 * Block used to apply trigonometry operation to floats
 */
class GeometryTrigonometryBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryTrigonometryBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets the operation applied by the block
         */
        this.operation = GeometryTrigonometryBlockOperations.Cos;
        this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryTrigonometryBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        let func = null;
        switch (this.operation) {
            case GeometryTrigonometryBlockOperations.Cos: {
                func = (value) => Math.cos(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Sin: {
                func = (value) => Math.sin(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Abs: {
                func = (value) => Math.abs(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Exp: {
                func = (value) => Math.exp(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Exp2: {
                func = (value) => Math.pow(2, value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Round: {
                func = (value) => Math.round(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Floor: {
                func = (value) => Math.floor(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Ceiling: {
                func = (value) => Math.ceil(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Sqrt: {
                func = (value) => Math.sqrt(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Log: {
                func = (value) => Math.log(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Tan: {
                func = (value) => Math.tan(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.ArcTan: {
                func = (value) => Math.atan(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.ArcCos: {
                func = (value) => Math.acos(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.ArcSin: {
                func = (value) => Math.asin(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Sign: {
                func = (value) => Math.sign(value);
                break;
            }
            case GeometryTrigonometryBlockOperations.Negate: {
                func = (value) => -value;
                break;
            }
            case GeometryTrigonometryBlockOperations.OneMinus: {
                func = (value) => 1 - value;
                break;
            }
            case GeometryTrigonometryBlockOperations.Reciprocal: {
                func = (value) => 1 / value;
                break;
            }
            case GeometryTrigonometryBlockOperations.ToRadians: {
                func = (value) => (value * Math.PI) / 180;
                break;
            }
            case GeometryTrigonometryBlockOperations.ToDegrees: {
                func = (value) => (value * 180) / Math.PI;
                break;
            }
            case GeometryTrigonometryBlockOperations.Fract: {
                func = (value) => {
                    if (value >= 0) {
                        return value - Math.floor(value);
                    }
                    else {
                        return value - Math.ceil(value);
                    }
                };
                break;
            }
        }
        if (!func) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        switch (this.input.type) {
            case NodeGeometryBlockConnectionPointTypes.Int:
            case NodeGeometryBlockConnectionPointTypes.Float: {
                this.output._storedFunction = (state) => {
                    const source = this.input.getConnectedValue(state);
                    return func(source);
                };
                break;
            }
            case NodeGeometryBlockConnectionPointTypes.Vector2: {
                this.output._storedFunction = (state) => {
                    const source = this.input.getConnectedValue(state);
                    return new math_vector/* Vector2 */.I9(func(source.x), func(source.y));
                };
                break;
            }
            case NodeGeometryBlockConnectionPointTypes.Vector3: {
                this.output._storedFunction = (state) => {
                    const source = this.input.getConnectedValue(state);
                    return new math_vector/* Vector3 */.Pq(func(source.x), func(source.y), func(source.z));
                };
                break;
            }
            case NodeGeometryBlockConnectionPointTypes.Vector4: {
                this.output._storedFunction = (state) => {
                    const source = this.input.getConnectedValue(state);
                    return new math_vector/* Vector4 */.IU(func(source.x), func(source.y), func(source.z), func(source.w));
                };
                break;
            }
        }
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.operation = this.operation;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.operation = serializationObject.operation;
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() +
            `${this._codeVariableName}.operation = BABYLON.GeometryTrigonometryBlockOperations.${GeometryTrigonometryBlockOperations[this.operation]};\n`;
        return codeString;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Operation", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        embedded: true,
        notifiers: { rebuild: true },
        options: [
            { label: "Cos", value: GeometryTrigonometryBlockOperations.Cos },
            { label: "Sin", value: GeometryTrigonometryBlockOperations.Sin },
            { label: "Abs", value: GeometryTrigonometryBlockOperations.Abs },
            { label: "Exp", value: GeometryTrigonometryBlockOperations.Exp },
            { label: "Exp2", value: GeometryTrigonometryBlockOperations.Exp2 },
            { label: "Round", value: GeometryTrigonometryBlockOperations.Round },
            { label: "Floor", value: GeometryTrigonometryBlockOperations.Floor },
            { label: "Ceiling", value: GeometryTrigonometryBlockOperations.Ceiling },
            { label: "Sqrt", value: GeometryTrigonometryBlockOperations.Sqrt },
            { label: "Log", value: GeometryTrigonometryBlockOperations.Log },
            { label: "Tan", value: GeometryTrigonometryBlockOperations.Tan },
            { label: "ArcTan", value: GeometryTrigonometryBlockOperations.ArcTan },
            { label: "ArcCos", value: GeometryTrigonometryBlockOperations.ArcCos },
            { label: "ArcSin", value: GeometryTrigonometryBlockOperations.ArcSin },
            { label: "Sign", value: GeometryTrigonometryBlockOperations.Sign },
            { label: "Negate", value: GeometryTrigonometryBlockOperations.Negate },
            { label: "OneMinus", value: GeometryTrigonometryBlockOperations.OneMinus },
            { label: "Reciprocal", value: GeometryTrigonometryBlockOperations.Reciprocal },
            { label: "ToDegrees", value: GeometryTrigonometryBlockOperations.ToDegrees },
            { label: "ToRadians", value: GeometryTrigonometryBlockOperations.ToRadians },
            { label: "Fract", value: GeometryTrigonometryBlockOperations.Fract },
        ],
    })
], GeometryTrigonometryBlock.prototype, "operation", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryTrigonometryBlock", GeometryTrigonometryBlock);
//# sourceMappingURL=geometryTrigonometryBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryTransformBlock.js






/**
 * Block used to apply a transform to a vector / geometry
 */
class GeometryTransformBlock extends NodeGeometryBlock {
    /**
     * Create a new GeometryTransformBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._rotationMatrix = new math_vector/* Matrix */.uq();
        this._scalingMatrix = new math_vector/* Matrix */.uq();
        this._translationMatrix = new math_vector/* Matrix */.uq();
        this._scalingRotationMatrix = new math_vector/* Matrix */.uq();
        this._pivotMatrix = new math_vector/* Matrix */.uq();
        this._backPivotMatrix = new math_vector/* Matrix */.uq();
        this._transformMatrix = new math_vector/* Matrix */.uq();
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix, true);
        this.registerInput("translation", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.One());
        this.registerInput("pivot", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryTransformBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the matrix input component
     */
    get matrix() {
        return this._inputs[1];
    }
    /**
     * Gets the translation input component
     */
    get translation() {
        return this._inputs[2];
    }
    /**
     * Gets the rotation input component
     */
    get rotation() {
        return this._inputs[3];
    }
    /**
     * Gets the scaling input component
     */
    get scaling() {
        return this._inputs[4];
    }
    /**
     * Gets the pivot input component
     */
    get pivot() {
        return this._inputs[5];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        if (!this.value.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (state) => {
            const value = this.value.getConnectedValue(state);
            if (!value) {
                return null;
            }
            let matrix;
            if (this.matrix.isConnected) {
                matrix = this.matrix.getConnectedValue(state);
            }
            else {
                const scaling = this.scaling.getConnectedValue(state) || math_vector/* Vector3 */.Pq.OneReadOnly;
                const rotation = this.rotation.getConnectedValue(state) || math_vector/* Vector3 */.Pq.ZeroReadOnly;
                const translation = this.translation.getConnectedValue(state) || math_vector/* Vector3 */.Pq.ZeroReadOnly;
                const pivot = this.pivot.getConnectedValue(state) || math_vector/* Vector3 */.Pq.ZeroReadOnly;
                // Transform
                math_vector/* Matrix */.uq.TranslationToRef(-pivot.x, -pivot.y, -pivot.z, this._pivotMatrix);
                math_vector/* Matrix */.uq.ScalingToRef(scaling.x, scaling.y, scaling.z, this._scalingMatrix);
                math_vector/* Matrix */.uq.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, this._rotationMatrix);
                math_vector/* Matrix */.uq.TranslationToRef(translation.x + pivot.x, translation.y + pivot.y, translation.z + pivot.z, this._translationMatrix);
                this._pivotMatrix.multiplyToRef(this._scalingMatrix, this._backPivotMatrix);
                this._backPivotMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix);
                this._scalingRotationMatrix.multiplyToRef(this._translationMatrix, this._transformMatrix);
                matrix = this._transformMatrix;
            }
            switch (this.value.type) {
                case NodeGeometryBlockConnectionPointTypes.Geometry: {
                    const geometry = value.clone();
                    geometry.transform(matrix);
                    return geometry;
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2:
                    return math_vector/* Vector2 */.I9.Transform(value, matrix);
                case NodeGeometryBlockConnectionPointTypes.Vector3:
                    return math_vector/* Vector3 */.Pq.TransformCoordinates(value, matrix);
                case NodeGeometryBlockConnectionPointTypes.Vector4:
                    return math_vector/* Vector4 */.IU.TransformCoordinates(value, matrix);
            }
            return null;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], GeometryTransformBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryTransformBlock", GeometryTransformBlock);
//# sourceMappingURL=geometryTransformBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/rotationXBlock.js




/**
 * Block used to get a rotation matrix on X Axis
 */
class RotationXBlock extends NodeGeometryBlock {
    /**
     * Create a new RotationXBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "RotationXBlock";
    }
    /**
     * Gets the angle input component
     */
    get angle() {
        return this._inputs[0];
    }
    /**
     * Gets the matrix output component
     */
    get matrix() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this.matrix._storedFunction = (state) => {
            return math_vector/* Matrix */.uq.RotationX(this.angle.getConnectedValue(state));
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.RotationXBlock", RotationXBlock);
//# sourceMappingURL=rotationXBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/rotationYBlock.js




/**
 * Block used to get a rotation matrix on Y Axis
 */
class RotationYBlock extends NodeGeometryBlock {
    /**
     * Create a new RotationYBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "RotationYBlock";
    }
    /**
     * Gets the angle input component
     */
    get angle() {
        return this._inputs[0];
    }
    /**
     * Gets the matrix output component
     */
    get matrix() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this.matrix._storedFunction = (state) => {
            return math_vector/* Matrix */.uq.RotationY(this.angle.getConnectedValue(state));
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.RotationYBlock", RotationYBlock);
//# sourceMappingURL=rotationYBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/rotationZBlock.js




/**
 * Block used to get a rotation matrix on Z Axis
 */
class RotationZBlock extends NodeGeometryBlock {
    /**
     * Create a new RotationZBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "RotationZBlock";
    }
    /**
     * Gets the angle input component
     */
    get angle() {
        return this._inputs[0];
    }
    /**
     * Gets the matrix output component
     */
    get matrix() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this.matrix._storedFunction = (state) => {
            return math_vector/* Matrix */.uq.RotationZ(this.angle.getConnectedValue(state));
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.RotationZBlock", RotationZBlock);
//# sourceMappingURL=rotationZBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/scalingBlock.js





/**
 * Block used to get a scaling matrix
 */
class ScalingBlock extends NodeGeometryBlock {
    /**
     * Create a new ScalingBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("scale", NodeGeometryBlockConnectionPointTypes.Vector3, false, math_vector/* Vector3 */.Pq.One());
        this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "ScalingBlock";
    }
    /**
     * Gets the scale input component
     */
    get scale() {
        return this._inputs[0];
    }
    /**
     * Gets the matrix output component
     */
    get matrix() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.scale.isConnected) {
            const scaleInput = new GeometryInputBlock("Scale");
            scaleInput.value = new math_vector/* Vector3 */.Pq(1, 1, 1);
            scaleInput.output.connectTo(this.scale);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this.matrix._storedFunction = (state) => {
            const value = this.scale.getConnectedValue(state);
            return math_vector/* Matrix */.uq.Scaling(value.x, value.y, value.z);
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ScalingBlock", ScalingBlock);
//# sourceMappingURL=scalingBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/alignBlock.js




/**
 * Block used to get a align matrix
 */
class AlignBlock extends NodeGeometryBlock {
    /**
     * Create a new AlignBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("source", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Up());
        this.registerInput("target", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Left());
        this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "AlignBlock";
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[0];
    }
    /**
     * Gets the target input component
     */
    get target() {
        return this._inputs[1];
    }
    /**
     * Gets the matrix output component
     */
    get matrix() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this.matrix._storedFunction = (state) => {
            const source = this.source.getConnectedValue(state).clone();
            const target = this.target.getConnectedValue(state).clone();
            const result = new math_vector/* Matrix */.uq();
            source.normalize();
            target.normalize();
            math_vector/* Matrix */.uq.RotationAlignToRef(source, target, result, true);
            return result;
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.AlignBlock", AlignBlock);
//# sourceMappingURL=alignBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/translationBlock.js





/**
 * Block used to get a translation matrix
 */
class TranslationBlock extends NodeGeometryBlock {
    /**
     * Create a new TranslationBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("translation", NodeGeometryBlockConnectionPointTypes.Vector3, false, math_vector/* Vector3 */.Pq.Zero());
        this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TranslationBlock";
    }
    /**
     * Gets the translation input component
     */
    get translation() {
        return this._inputs[0];
    }
    /**
     * Gets the matrix output component
     */
    get matrix() {
        return this._outputs[0];
    }
    autoConfigure() {
        if (!this.translation.isConnected) {
            const translationInput = new GeometryInputBlock("Translation");
            translationInput.value = new math_vector/* Vector3 */.Pq(0, 0, 0);
            translationInput.output.connectTo(this.translation);
        }
    }
    _buildBlock(state) {
        super._buildBlock(state);
        this.matrix._storedFunction = (state) => {
            const value = this.translation.getConnectedValue(state);
            return math_vector/* Matrix */.uq.Translation(value.x, value.y, value.z);
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TranslationBlock", TranslationBlock);
//# sourceMappingURL=translationBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js







/**
 * Block used to instance geometry on every vertex of a geometry
 */
class InstantiateOnVerticesBlock extends NodeGeometryBlock {
    /**
     * Create a new InstantiateOnVerticesBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._indexTranslation = null;
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        /**
         * Gets or sets a boolean indicating if the block should remove duplicated positions
         */
        this.removeDuplicatedPositions = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("instance", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("density", NodeGeometryBlockConnectionPointTypes.Float, true, 1, 0, 1);
        this.registerInput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix, true);
        this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.One());
        this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current instance index in the current flow
     * @returns the current index
     */
    getInstanceIndex() {
        return this._currentLoopIndex;
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._indexTranslation ? this._indexTranslation[this._currentIndex] : this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentLoopIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "InstantiateOnVerticesBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the instance input component
     */
    get instance() {
        return this._inputs[1];
    }
    /**
     * Gets the density input component
     */
    get density() {
        return this._inputs[2];
    }
    /**
     * Gets the matrix input component
     */
    get matrix() {
        return this._inputs[3];
    }
    /**
     * Gets the rotation input component
     */
    get rotation() {
        return this._inputs[4];
    }
    /**
     * Gets the scaling input component
     */
    get scaling() {
        return this._inputs[5];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            state.pushInstancingContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            state.pushGeometryContext(this._vertexData);
            if (!this._vertexData || !this._vertexData.positions || !this.instance.isConnected) {
                state.restoreExecutionContext();
                state.restoreInstancingContext();
                state.restoreGeometryContext();
                this.output._storedValue = null;
                return;
            }
            // Processing
            let vertexCount = this._vertexData.positions.length / 3;
            const additionalVertexData = [];
            const currentPosition = new math_vector/* Vector3 */.Pq();
            const alreadyDone = [];
            let vertices = this._vertexData.positions;
            this._currentLoopIndex = 0;
            if (this.removeDuplicatedPositions) {
                this._indexTranslation = {};
                for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {
                    const x = vertices[this._currentIndex * 3];
                    const y = vertices[this._currentIndex * 3 + 1];
                    const z = vertices[this._currentIndex * 3 + 2];
                    let found = false;
                    for (let index = 0; index < alreadyDone.length; index += 3) {
                        if (Math.abs(alreadyDone[index] - x) < math_constants/* Epsilon */.bH && Math.abs(alreadyDone[index + 1] - y) < math_constants/* Epsilon */.bH && Math.abs(alreadyDone[index + 2] - z) < math_constants/* Epsilon */.bH) {
                            found = true;
                            break;
                        }
                    }
                    if (found) {
                        continue;
                    }
                    this._indexTranslation[alreadyDone.length / 3] = this._currentIndex;
                    alreadyDone.push(x, y, z);
                }
                vertices = alreadyDone;
                vertexCount = vertices.length / 3;
            }
            else {
                this._indexTranslation = null;
            }
            for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {
                const instanceGeometry = this.instance.getConnectedValue(state);
                if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {
                    continue;
                }
                const density = this.density.getConnectedValue(state);
                if (density < 1) {
                    if (Math.random() > density) {
                        continue;
                    }
                }
                currentPosition.fromArray(vertices, this._currentIndex * 3);
                // Clone the instance
                const clone = instanceGeometry.clone();
                // Transform
                if (this.matrix.isConnected) {
                    const transform = this.matrix.getConnectedValue(state);
                    state._instantiateWithPositionAndMatrix(clone, currentPosition, transform, additionalVertexData);
                }
                else {
                    const scaling = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, math_vector/* Vector3 */.Pq.OneReadOnly);
                    const rotation = this.rotation.getConnectedValue(state) || math_vector/* Vector3 */.Pq.ZeroReadOnly;
                    state._instantiate(clone, currentPosition, rotation, scaling, additionalVertexData);
                }
                this._currentLoopIndex++;
            }
            // Restore
            state.restoreGeometryContext();
            state.restoreExecutionContext();
            state.restoreInstancingContext();
            // Merge
            if (additionalVertexData.length) {
                if (additionalVertexData.length === 1) {
                    this._vertexData = additionalVertexData[0];
                }
                else {
                    // We do not merge the main one as user can use a merge node if wanted
                    const main = additionalVertexData.splice(0, 1)[0];
                    this._vertexData = main.merge(additionalVertexData, true, false, true, true);
                }
            }
            else {
                return null;
            }
            return this._vertexData;
        };
        // Storage
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.removeDuplicatedPositions = ${this.removeDuplicatedPositions ? "true" : "false"};\n`;
        codeString += `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.removeDuplicatedPositions = this.removeDuplicatedPositions;
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.removeDuplicatedPositions = serializationObject.removeDuplicatedPositions;
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
], InstantiateOnVerticesBlock.prototype, "evaluateContext", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Remove duplicated positions", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { update: true } })
], InstantiateOnVerticesBlock.prototype, "removeDuplicatedPositions", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.InstantiateOnVerticesBlock", InstantiateOnVerticesBlock);
//# sourceMappingURL=instantiateOnVerticesBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js






/**
 * Block used to instance geometry on every face of a geometry
 */
class InstantiateOnFacesBlock extends NodeGeometryBlock {
    /**
     * Create a new InstantiateOnFacesBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._currentPosition = new math_vector/* Vector3 */.Pq();
        this._currentUV = new math_vector/* Vector2 */.I9();
        this._vertex0 = new math_vector/* Vector3 */.Pq();
        this._vertex1 = new math_vector/* Vector3 */.Pq();
        this._vertex2 = new math_vector/* Vector3 */.Pq();
        this._tempVector0 = new math_vector/* Vector3 */.Pq();
        this._tempVector1 = new math_vector/* Vector3 */.Pq();
        this._uv0 = new math_vector/* Vector2 */.I9();
        this._uv1 = new math_vector/* Vector2 */.I9();
        this._uv2 = new math_vector/* Vector2 */.I9();
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("instance", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("count", NodeGeometryBlockConnectionPointTypes.Int, true, 256);
        this.registerInput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix, true);
        this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.One());
        this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current instance index in the current flow
     * @returns the current index
     */
    getInstanceIndex() {
        return this._currentLoopIndex;
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return 0;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return this._currentFaceIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentLoopIndex;
    }
    /**
     * Gets the value associated with a contextual positions
     * @returns the value associated with the source
     */
    getOverridePositionsContextualValue() {
        return this._currentPosition;
    }
    /**
     * Gets the value associated with a contextual normals
     * @returns the value associated with the source
     */
    getOverrideNormalsContextualValue() {
        this._vertex1.subtractToRef(this._vertex0, this._tempVector0);
        this._vertex2.subtractToRef(this._vertex1, this._tempVector1);
        this._tempVector0.normalize();
        this._tempVector1.normalize();
        return math_vector/* Vector3 */.Pq.Cross(this._tempVector1, this._tempVector0);
    }
    /**
     * Gets the value associated with a contextual UV1 se
     * @returns the value associated with the source
     */
    getOverrideUVs1ContextualValue() {
        return this._currentUV;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "InstantiateOnFacesBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the instance input component
     */
    get instance() {
        return this._inputs[1];
    }
    /**
     * Gets the count input component
     */
    get count() {
        return this._inputs[2];
    }
    /**
     * Gets the matrix input component
     */
    get matrix() {
        return this._inputs[3];
    }
    /**
     * Gets the rotation input component
     */
    get rotation() {
        return this._inputs[4];
    }
    /**
     * Gets the scaling input component
     */
    get scaling() {
        return this._inputs[5];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            state.pushInstancingContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            state.pushGeometryContext(this._vertexData);
            if (!this._vertexData || !this._vertexData.positions || !this._vertexData.indices || !this.instance.isConnected) {
                state.restoreExecutionContext();
                state.restoreInstancingContext();
                state.restoreGeometryContext();
                this.output._storedValue = null;
                return;
            }
            // Processing
            let instanceGeometry = null;
            const instanceCount = this.count.getConnectedValue(state);
            const faceCount = this._vertexData.indices.length / 3;
            const instancePerFace = instanceCount / faceCount;
            let accumulatedCount = 0;
            const additionalVertexData = [];
            let totalDone = 0;
            this._currentLoopIndex = 0;
            for (this._currentFaceIndex = 0; this._currentFaceIndex < faceCount; this._currentFaceIndex++) {
                accumulatedCount += instancePerFace;
                const countPerFace = (accumulatedCount | 0) - totalDone;
                if (countPerFace < 1) {
                    continue;
                }
                const faceID0 = this._vertexData.indices[this._currentFaceIndex * 3];
                const faceID1 = this._vertexData.indices[this._currentFaceIndex * 3 + 1];
                const faceID2 = this._vertexData.indices[this._currentFaceIndex * 3 + 2];
                // Extract face vertices
                this._vertex0.fromArray(this._vertexData.positions, faceID0 * 3);
                this._vertex1.fromArray(this._vertexData.positions, faceID1 * 3);
                this._vertex2.fromArray(this._vertexData.positions, faceID2 * 3);
                if (this._vertexData.uvs) {
                    this._uv0.fromArray(this._vertexData.uvs, faceID0 * 2);
                    this._uv1.fromArray(this._vertexData.uvs, faceID1 * 2);
                    this._uv2.fromArray(this._vertexData.uvs, faceID2 * 2);
                }
                for (let faceDispatchCount = 0; faceDispatchCount < countPerFace; faceDispatchCount++) {
                    if (totalDone >= instanceCount) {
                        break;
                    }
                    // Get random point on face
                    let x = Math.random();
                    let y = Math.random();
                    if (x > y) {
                        const temp = x;
                        x = y;
                        y = temp;
                    }
                    const s = x;
                    const t = y - x;
                    const u = 1 - s - t;
                    this._currentPosition.set(s * this._vertex0.x + t * this._vertex1.x + u * this._vertex2.x, s * this._vertex0.y + t * this._vertex1.y + u * this._vertex2.y, s * this._vertex0.z + t * this._vertex1.z + u * this._vertex2.z);
                    if (this._vertexData.uvs) {
                        this._currentUV.set(s * this._uv0.x + t * this._uv1.x + u * this._uv2.x, s * this._uv0.y + t * this._uv1.y + u * this._uv2.y);
                    }
                    // Clone the instance
                    instanceGeometry = this.instance.getConnectedValue(state);
                    if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {
                        accumulatedCount -= instancePerFace;
                        continue;
                    }
                    const clone = instanceGeometry.clone();
                    if (this.matrix.isConnected) {
                        const transform = this.matrix.getConnectedValue(state);
                        state._instantiateWithPositionAndMatrix(clone, this._currentPosition, transform, additionalVertexData);
                    }
                    else {
                        const scaling = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, math_vector/* Vector3 */.Pq.OneReadOnly);
                        const rotation = this.rotation.getConnectedValue(state) || math_vector/* Vector3 */.Pq.ZeroReadOnly;
                        state._instantiate(clone, this._currentPosition, rotation, scaling, additionalVertexData);
                    }
                    totalDone++;
                    this._currentLoopIndex++;
                }
            }
            // Merge
            if (additionalVertexData.length) {
                if (additionalVertexData.length === 1) {
                    this._vertexData = additionalVertexData[0];
                }
                else {
                    // We do not merge the main one as user can use a merge node if wanted
                    const main = additionalVertexData.splice(0, 1)[0];
                    this._vertexData = main.merge(additionalVertexData, true, false, true, true);
                }
            }
            state.restoreExecutionContext();
            state.restoreInstancingContext();
            state.restoreGeometryContext();
            return this._vertexData;
        };
        // Storage
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
], InstantiateOnFacesBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.InstantiateOnFacesBlock", InstantiateOnFacesBlock);
//# sourceMappingURL=instantiateOnFacesBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js








/**
 * Block used to instance geometry inside a geometry
 */
class InstantiateOnVolumeBlock extends NodeGeometryBlock {
    /**
     * Create a new InstantiateOnVolumeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._currentPosition = new math_vector/* Vector3 */.Pq();
        this._vertex0 = new math_vector/* Vector3 */.Pq();
        this._vertex1 = new math_vector/* Vector3 */.Pq();
        this._vertex2 = new math_vector/* Vector3 */.Pq();
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        /**
         * Gets or sets a boolean indicating that a grid pattern should be used
         */
        this.gridMode = false;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("instance", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("count", NodeGeometryBlockConnectionPointTypes.Int, true, 256);
        this.registerInput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix, true);
        this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.One());
        this.registerInput("gridSize", NodeGeometryBlockConnectionPointTypes.Int, true, 10);
        this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current instance index in the current flow
     * @returns the current index
     */
    getInstanceIndex() {
        return this._currentLoopIndex;
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return 0;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentLoopIndex;
    }
    /**
     * Gets the value associated with a contextual positions
     * @returns the value associated with the source
     */
    getOverridePositionsContextualValue() {
        return this._currentPosition;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "InstantiateOnVolumeBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the instance input component
     */
    get instance() {
        return this._inputs[1];
    }
    /**
     * Gets the count input component
     */
    get count() {
        return this._inputs[2];
    }
    /**
     * Gets the matrix input component
     */
    get matrix() {
        return this._inputs[3];
    }
    /**
     * Gets the rotation input component
     */
    get rotation() {
        return this._inputs[4];
    }
    /**
     * Gets the scaling input component
     */
    get scaling() {
        return this._inputs[5];
    }
    /**
     * Gets the grid size input component
     */
    get gridSize() {
        return this._inputs[6];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _getValueOnGrid(step, size, min, max) {
        const cellSize = (max - min) / size;
        return min + cellSize / 2 + step * cellSize;
    }
    _getIndexinGrid(x, y, z, size) {
        return x + y * size + z * size * size;
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            state.pushInstancingContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            state.pushGeometryContext(this._vertexData);
            if (!this._vertexData || !this._vertexData.positions || !this._vertexData.indices || !this.instance.isConnected) {
                state.restoreExecutionContext();
                state.restoreInstancingContext();
                state.restoreGeometryContext();
                this.output._storedValue = null;
                return;
            }
            // Processing
            let instanceGeometry = null;
            const instanceCount = this.count.getConnectedValue(state);
            const additionalVertexData = [];
            const boundingInfo = (0,math_functions/* extractMinAndMax */.b8)(this._vertexData.positions, 0, this._vertexData.positions.length / 3);
            const min = boundingInfo.minimum;
            const max = boundingInfo.maximum;
            const direction = new math_vector/* Vector3 */.Pq(0.5, 0.8, 0.2);
            const faceCount = this._vertexData.indices.length / 3;
            const gridSize = this.gridSize.getConnectedValue(state);
            this._currentLoopIndex = 0;
            let candidatesCells;
            if (this.gridMode) {
                candidatesCells = [];
                // Generates the list of candidates cells
                for (let index = 0; index < gridSize * gridSize * gridSize; index++) {
                    candidatesCells[index] = false;
                }
            }
            for (let index = 0; index < instanceCount; index++) {
                if (this.gridMode) {
                    // Get a random cell
                    let cellX = Math.floor(Math.random() * gridSize);
                    let cellY = Math.floor(Math.random() * gridSize);
                    let cellZ = Math.floor(Math.random() * gridSize);
                    let cellIndex = this._getIndexinGrid(cellX, cellY, cellZ, gridSize);
                    if (candidatesCells[cellIndex]) {
                        // Find the first one that is free
                        let found = false;
                        for (let candidateIndex = 0; candidateIndex < gridSize * gridSize * gridSize; candidateIndex++) {
                            if (!candidatesCells[candidateIndex]) {
                                cellZ = Math.floor(candidateIndex / (gridSize * gridSize));
                                cellY = Math.floor((candidateIndex - cellZ * gridSize * gridSize) / gridSize);
                                cellX = candidateIndex - cellZ * gridSize * gridSize - cellY * gridSize;
                                cellIndex = this._getIndexinGrid(cellX, cellY, cellZ, gridSize);
                                found = true;
                                break;
                            }
                        }
                        if (!found) {
                            // No more free cells
                            break;
                        }
                    }
                    if (!candidatesCells[cellIndex]) {
                        // Cell is free
                        const x = this._getValueOnGrid(cellX, gridSize, min.x, max.x);
                        const y = this._getValueOnGrid(cellY, gridSize, min.y, max.y);
                        const z = this._getValueOnGrid(cellZ, gridSize, min.z, max.z);
                        this._currentPosition.set(x, y, z);
                        candidatesCells[cellIndex] = true;
                    }
                }
                else {
                    this._currentPosition.set(Math.random() * (max.x - min.x) + min.x, Math.random() * (max.y - min.y) + min.y, Math.random() * (max.z - min.z) + min.z);
                }
                // Cast a ray from the random point in an arbitrary direction
                const ray = new Culling_ray/* Ray */.Rl(this._currentPosition, direction);
                let intersectionCount = 0;
                for (let currentFaceIndex = 0; currentFaceIndex < faceCount; currentFaceIndex++) {
                    // Extract face vertices
                    this._vertex0.fromArray(this._vertexData.positions, this._vertexData.indices[currentFaceIndex * 3] * 3);
                    this._vertex1.fromArray(this._vertexData.positions, this._vertexData.indices[currentFaceIndex * 3 + 1] * 3);
                    this._vertex2.fromArray(this._vertexData.positions, this._vertexData.indices[currentFaceIndex * 3 + 2] * 3);
                    const currentIntersectInfo = ray.intersectsTriangle(this._vertex0, this._vertex1, this._vertex2);
                    if (currentIntersectInfo && currentIntersectInfo.distance > 0) {
                        intersectionCount++;
                    }
                }
                if (intersectionCount % 2 === 0) {
                    // We are outside, try again
                    index--;
                    continue;
                }
                // Clone the instance
                instanceGeometry = this.instance.getConnectedValue(state);
                if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {
                    continue;
                }
                const clone = instanceGeometry.clone();
                if (this.matrix.isConnected) {
                    const transform = this.matrix.getConnectedValue(state);
                    state._instantiateWithPositionAndMatrix(clone, this._currentPosition, transform, additionalVertexData);
                }
                else {
                    const scaling = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, math_vector/* Vector3 */.Pq.OneReadOnly);
                    const rotation = this.rotation.getConnectedValue(state) || math_vector/* Vector3 */.Pq.ZeroReadOnly;
                    state._instantiate(clone, this._currentPosition, rotation, scaling, additionalVertexData);
                }
                this._currentLoopIndex++;
            }
            // Merge
            if (additionalVertexData.length) {
                if (additionalVertexData.length === 1) {
                    this._vertexData = additionalVertexData[0];
                }
                else {
                    // We do not merge the main one as user can use a merge node if wanted
                    const main = additionalVertexData.splice(0, 1)[0];
                    this._vertexData = main.merge(additionalVertexData, true, false, true, true);
                }
            }
            state.restoreGeometryContext();
            state.restoreExecutionContext();
            state.restoreInstancingContext();
            return this._vertexData;
        };
        // Storage
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        codeString += `${this._codeVariableName}.gridMode = ${this.gridMode ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        serializationObject.gridMode = this.gridMode;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
        if (serializationObject.gridMode !== undefined) {
            this.gridMode = serializationObject.gridMode;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
], InstantiateOnVolumeBlock.prototype, "evaluateContext", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Grid mode", 0 /* PropertyTypeForEdition.Boolean */, "MODES", { notifiers: { rebuild: true } })
], InstantiateOnVolumeBlock.prototype, "gridMode", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.InstantiateOnVolumeBlock", InstantiateOnVolumeBlock);
//# sourceMappingURL=instantiateOnVolumeBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js




/**
 * Block used as a base for InstantiateXXX blocks
 */
class InstantiateBaseBlock extends NodeGeometryBlock {
    /**
     * Create a new InstantiateBaseBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("instance", NodeGeometryBlockConnectionPointTypes.Geometry, true);
        this.registerInput("count", NodeGeometryBlockConnectionPointTypes.Int, true, 1);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current instance index in the current flow
     * @returns the current index
     */
    getInstanceIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "InstantiateBaseBlock";
    }
    /**
     * Gets the instance input component
     */
    get instance() {
        return this._inputs[0];
    }
    /**
     * Gets the count input component
     */
    get count() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], InstantiateBaseBlock.prototype, "evaluateContext", void 0);
//# sourceMappingURL=instantiateBaseBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateBlock.js




/**
 * Block used to instantiate a geometry inside a loop
 */
class InstantiateBlock extends InstantiateBaseBlock {
    /**
     * Create a new InstantiateBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix, true);
        this.registerInput("position", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.One());
        this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current instance index in the current flow
     * @returns the current index
     */
    getInstanceIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "InstantiateBlock";
    }
    /**
     * Gets the matrix input component
     */
    get matrix() {
        return this._inputs[2];
    }
    /**
     * Gets the position input component
     */
    get position() {
        return this._inputs[3];
    }
    /**
     * Gets the rotation input component
     */
    get rotation() {
        return this._inputs[4];
    }
    /**
     * Gets the scaling input component
     */
    get scaling() {
        return this._inputs[5];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            state.pushInstancingContext(this);
            // Processing
            const iterationCount = this.count.getConnectedValue(state);
            const additionalVertexData = [];
            for (this._currentIndex = 0; this._currentIndex < iterationCount; this._currentIndex++) {
                const instanceGeometry = this.instance.getConnectedValue(state);
                if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {
                    continue;
                }
                // Clone the instance
                const clone = instanceGeometry.clone();
                // Transform
                if (this.matrix.isConnected) {
                    const transform = this.matrix.getConnectedValue(state);
                    state._instantiateWithMatrix(clone, transform, additionalVertexData);
                }
                else {
                    const position = this.position.getConnectedValue(state) || math_vector/* Vector3 */.Pq.ZeroReadOnly;
                    const scaling = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, math_vector/* Vector3 */.Pq.OneReadOnly);
                    const rotation = this.rotation.getConnectedValue(state) || math_vector/* Vector3 */.Pq.ZeroReadOnly;
                    state._instantiate(clone, position, rotation, scaling, additionalVertexData);
                }
            }
            // Merge
            if (additionalVertexData.length) {
                if (additionalVertexData.length === 1) {
                    this._vertexData = additionalVertexData[0];
                }
                else {
                    // We do not merge the main one as user can use a merge node if wanted
                    const main = additionalVertexData.splice(0, 1)[0];
                    this._vertexData = main.merge(additionalVertexData, true, false, true, true);
                }
            }
            state.restoreExecutionContext();
            state.restoreInstancingContext();
            return this._vertexData;
        };
        // Storage
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.InstantiateBlock", InstantiateBlock);
//# sourceMappingURL=instantiateBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateLinearBlock.js




/**
 * Block used to clone geometry along a line
 */
class InstantiateLinearBlock extends InstantiateBaseBlock {
    /**
     * Create a new Instantiate Linear Block
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        // Direction is magnitude per step
        this.registerInput("direction", NodeGeometryBlockConnectionPointTypes.Vector3, true, new math_vector/* Vector3 */.Pq(1, 0, 0));
        // Rotation is magnitude per step
        this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, new math_vector/* Vector3 */.Pq(0, 0, 0));
        // Scaling is magnitude per step
        this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, new math_vector/* Vector3 */.Pq(0, 0, 0));
        this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "InstantiateLinearBlock";
    }
    /**
     * Gets the direction input component
     */
    get direction() {
        return this._inputs[2];
    }
    /**
     * Gets the rotation input component
     */
    get rotation() {
        return this._inputs[3];
    }
    /**
     * Gets the scaling input component
     */
    get scaling() {
        return this._inputs[4];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            state.pushInstancingContext(this);
            const iterationCount = this.count.getConnectedValue(state);
            const additionalVertexData = [];
            const transformMatrix = math_vector/* Matrix */.uq.Identity();
            const transformOffset = math_vector/* Vector3 */.Pq.Zero();
            const rotationOffset = math_vector/* Vector3 */.Pq.Zero();
            const scaleOffset = math_vector/* Vector3 */.Pq.Zero();
            for (this._currentIndex = 0; this._currentIndex < iterationCount; this._currentIndex++) {
                const instanceGeometry = this.instance.getConnectedValue(state);
                if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {
                    continue;
                }
                // Clone the instance
                const clone = instanceGeometry.clone();
                const direction = this.direction.getConnectedValue(state);
                const rotation = this.rotation.getConnectedValue(state);
                const scale = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, math_vector/* Vector3 */.Pq.OneReadOnly);
                transformOffset.copyFrom(direction.clone().scale(this._currentIndex));
                rotationOffset.copyFrom(rotation.clone().scale(this._currentIndex));
                scaleOffset.copyFrom(scale.clone().scale(this._currentIndex));
                scaleOffset.addInPlaceFromFloats(1, 1, 1);
                math_vector/* Matrix */.uq.ComposeToRef(scaleOffset, math_vector/* Quaternion */.PT.FromEulerAngles(rotationOffset.x, rotationOffset.y, rotationOffset.z), transformOffset, transformMatrix);
                state._instantiateWithMatrix(clone, transformMatrix, additionalVertexData);
            }
            // Merge
            if (additionalVertexData.length) {
                if (additionalVertexData.length === 1) {
                    this._vertexData = additionalVertexData[0];
                }
                else {
                    // We do not merge the main one as user can use a merge node if wanted
                    const main = additionalVertexData.splice(0, 1)[0];
                    this._vertexData = main.merge(additionalVertexData, true, false, true, true);
                }
            }
            state.restoreExecutionContext();
            state.restoreInstancingContext();
            // Storage
            return this._vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.InstantiateLinearBlock", InstantiateLinearBlock);
//# sourceMappingURL=instantiateLinearBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateRadialBlock.js




/**
 * Block used to clone geometry in a radial shape
 */
class InstantiateRadialBlock extends InstantiateBaseBlock {
    /**
     * Create a new InstantiateRadialBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("radius", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);
        // Angle start and end
        this.registerInput("angleStart", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("angleEnd", NodeGeometryBlockConnectionPointTypes.Float, true, Math.PI * 2);
        // Transform offset
        this.registerInput("transform", NodeGeometryBlockConnectionPointTypes.Vector3, true, new math_vector/* Vector3 */.Pq(0, 0, 0));
        // Rotation is magnitude per step
        this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, new math_vector/* Vector3 */.Pq(0, 0, 0));
        // Scale is magnitude per step
        this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, new math_vector/* Vector3 */.Pq(0, 0, 0));
        this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "InstantiateRadialBlock";
    }
    /**
     * Gets the direction input component
     */
    get radius() {
        return this._inputs[2];
    }
    /**
     * Gets the direction input component
     */
    get angleStart() {
        return this._inputs[3];
    }
    /**
     * Gets the direction input component
     */
    get angleEnd() {
        return this._inputs[4];
    }
    /**
     * Gets the transform input component
     */
    get transform() {
        return this._inputs[5];
    }
    /**
     * Gets the rotation input component
     */
    get rotation() {
        return this._inputs[6];
    }
    /**
     * Gets the scaling input component
     */
    get scaling() {
        return this._inputs[7];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            state.pushInstancingContext(this);
            const iterationCount = this.count.getConnectedValue(state);
            const additionalVertexData = [];
            const rotMatrix = math_vector/* Matrix */.uq.Identity();
            const radiusMatrix = math_vector/* Matrix */.uq.Identity();
            const transformMatrix = math_vector/* Matrix */.uq.Identity();
            const transformOffset = math_vector/* Vector3 */.Pq.Zero();
            const rotationOffset = math_vector/* Vector3 */.Pq.Zero();
            const scaleOffset = math_vector/* Vector3 */.Pq.Zero();
            for (this._currentIndex = 0; this._currentIndex < iterationCount; this._currentIndex++) {
                const instanceGeometry = this.instance.getConnectedValue(state);
                if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {
                    continue;
                }
                // Clone the instance
                const clone = instanceGeometry.clone();
                const radius = this.radius.getConnectedValue(state);
                const angleStart = this.angleStart.getConnectedValue(state);
                const angleEnd = this.angleEnd.getConnectedValue(state);
                const transform = this.transform.getConnectedValue(state);
                const rotation = this.rotation.getConnectedValue(state);
                const scale = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, math_vector/* Vector3 */.Pq.OneReadOnly);
                // Define arc size
                const pieSlice = angleEnd - angleStart;
                const rStep = pieSlice / iterationCount;
                const angle = angleStart + rStep * this._currentIndex;
                const angleQuat = math_vector/* Quaternion */.PT.FromEulerAngles(0, angle, 0);
                // Get local transforms
                transformOffset.copyFrom(transform.clone().scale(this._currentIndex));
                rotationOffset.copyFrom(rotation.clone().scale(this._currentIndex));
                scaleOffset.copyFrom(scale.clone().scale(this._currentIndex));
                scaleOffset.addInPlaceFromFloats(1, 1, 1);
                // Compose (rotMatrix x radius x scale x angle x user transform)
                math_vector/* Matrix */.uq.RotationYawPitchRollToRef(rotationOffset.y, rotationOffset.x, rotationOffset.z, rotMatrix);
                radiusMatrix.setTranslationFromFloats(0, 0, radius);
                math_vector/* Matrix */.uq.ComposeToRef(scaleOffset, angleQuat, transformOffset, transformMatrix);
                rotMatrix.multiplyToRef(radiusMatrix, radiusMatrix);
                radiusMatrix.multiplyToRef(transformMatrix, transformMatrix);
                state._instantiateWithMatrix(clone, transformMatrix, additionalVertexData);
            }
            // Merge
            if (additionalVertexData.length) {
                if (additionalVertexData.length === 1) {
                    this._vertexData = additionalVertexData[0];
                }
                else {
                    // We do not merge the main one as user can use a merge node if wanted
                    const main = additionalVertexData.splice(0, 1)[0];
                    this._vertexData = main.merge(additionalVertexData, true, false, true, true);
                }
            }
            // Storage
            state.restoreExecutionContext();
            state.restoreInstancingContext();
            return this._vertexData;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.InstantiateRadialBlock", InstantiateRadialBlock);
//# sourceMappingURL=instantiateRadialBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/intFloatConverterBlock.js



/**
 * Defines a block used to convert from int to float
 */
class IntFloatConverterBlock extends NodeGeometryBlock {
    /**
     * Create a new IntFloatConverterBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("float ", NodeGeometryBlockConnectionPointTypes.Float, true);
        this.registerInput("int ", NodeGeometryBlockConnectionPointTypes.Int, true);
        this.registerOutput("float", NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("int", NodeGeometryBlockConnectionPointTypes.Int);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "IntFloatConverterBlock";
    }
    /**
     * Gets the float input component
     */
    get floatIn() {
        return this._inputs[0];
    }
    /**
     * Gets the int input component
     */
    get intIn() {
        return this._inputs[1];
    }
    /**
     * Gets the float output component
     */
    get floatOut() {
        return this._outputs[0];
    }
    /**
     * Gets the int output component
     */
    get intOut() {
        return this._outputs[1];
    }
    _inputRename(name) {
        if (name === "float ") {
            return "floatIn";
        }
        if (name === "int ") {
            return "intIn";
        }
        return name;
    }
    _buildBlock() {
        this.floatOut._storedFunction = (state) => {
            if (this.floatIn.isConnected) {
                return this.floatIn.getConnectedValue(state);
            }
            if (this.intIn.isConnected) {
                return this.intIn.getConnectedValue(state);
            }
            return 0;
        };
        this.intOut._storedFunction = (state) => {
            if (this.floatIn.isConnected) {
                return Math.floor(this.floatIn.getConnectedValue(state));
            }
            if (this.intIn.isConnected) {
                return Math.floor(this.intIn.getConnectedValue(state));
            }
            return 0;
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.IntFloatConverterBlock", IntFloatConverterBlock);
//# sourceMappingURL=intFloatConverterBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/debugBlock.js




/**
 * Defines a block used to debug values going through it
 */
class DebugBlock extends NodeGeometryBlock {
    /**
     * Create a new DebugBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets the log entries
         */
        this.log = [];
        this._isDebug = true;
        this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the time spent to build this block (in ms)
     */
    get buildExecutionTime() {
        return -1;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "DebugBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        if (!this.input.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.log = [];
        const func = (state) => {
            const input = this.input.getConnectedValue(state);
            if (input === null || input === undefined) {
                this.log.push(["null", ""]);
                return input;
            }
            switch (this.input.type) {
                case NodeGeometryBlockConnectionPointTypes.Vector2:
                    this.log.push([Vector2ToFixed(input, 4), input.toString()]);
                    break;
                case NodeGeometryBlockConnectionPointTypes.Vector3:
                    this.log.push([Vector3ToFixed(input, 4), input.toString()]);
                    break;
                case NodeGeometryBlockConnectionPointTypes.Vector4:
                    this.log.push([Vector4ToFixed(input, 4), input.toString()]);
                    break;
                default:
                    this.log.push([input.toString(), input.toString()]);
                    break;
            }
            return input;
        };
        if (this.output.isConnected) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedValue = func(state);
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DebugBlock", DebugBlock);
//# sourceMappingURL=debugBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryInfoBlock.js



/**
 * Block used to get information about a geometry
 */
class GeometryInfoBlock extends NodeGeometryBlock {
    /**
     * Create a new GeometryInfoBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerOutput("id", NodeGeometryBlockConnectionPointTypes.Int);
        this.registerOutput("collectionId", NodeGeometryBlockConnectionPointTypes.Int);
        this.registerOutput("verticesCount", NodeGeometryBlockConnectionPointTypes.Int);
        this.registerOutput("facesCount", NodeGeometryBlockConnectionPointTypes.Int);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryInfoBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    /**
     * Gets the id output component
     */
    get id() {
        return this._outputs[1];
    }
    /**
     * Gets the collectionId output component
     */
    get collectionId() {
        return this._outputs[2];
    }
    /**
     * Gets the verticesCount output component
     */
    get verticesCount() {
        return this._outputs[3];
    }
    /**
     * Gets the facesCount output component
     */
    get facesCount() {
        return this._outputs[4];
    }
    _buildBlock() {
        if (!this.geometry.isConnected) {
            this.id._storedValue = 0;
            this.collectionId._storedValue = 0;
            this.verticesCount._storedValue = 0;
            this.facesCount._storedValue = 0;
            this.output._storedValue = 0;
            this.id._storedFunction = null;
            this.collectionId._storedFunction = null;
            this.verticesCount._storedFunction = null;
            this.facesCount._storedFunction = null;
            this.output._storedFunction = null;
            return;
        }
        this.output._storedFunction = (state) => {
            this._currentVertexData = this.geometry.getConnectedValue(state);
            return this._currentVertexData;
        };
        this.id._storedFunction = (state) => {
            this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);
            return this._currentVertexData.uniqueId;
        };
        this.collectionId._storedFunction = (state) => {
            this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);
            return this._currentVertexData.metadata ? this._currentVertexData.metadata.collectionId : 0;
        };
        this.verticesCount._storedFunction = (state) => {
            this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);
            return this._currentVertexData.positions ? this._currentVertexData.positions.length / 3 : 0;
        };
        this.facesCount._storedFunction = (state) => {
            this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);
            return this._currentVertexData.indices ? this._currentVertexData.indices.length / 3 : 0;
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryInfoBlock", GeometryInfoBlock);
//# sourceMappingURL=geometryInfoBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/mappingBlock.js






/**
 * Type of mappings supported by the mapping block
 */
var MappingTypes;
(function (MappingTypes) {
    /** Spherical */
    MappingTypes[MappingTypes["Spherical"] = 0] = "Spherical";
    /** Cylindrical */
    MappingTypes[MappingTypes["Cylindrical"] = 1] = "Cylindrical";
    /** Cubic */
    MappingTypes[MappingTypes["Cubic"] = 2] = "Cubic";
})(MappingTypes || (MappingTypes = {}));
/**
 * Block used to generate UV coordinates
 */
class MappingBlock extends NodeGeometryBlock {
    /**
     * Create a new MappingBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets the mapping type used by the block
         */
        this.mapping = MappingTypes.Spherical;
        this.registerInput("position", NodeGeometryBlockConnectionPointTypes.Vector3);
        this.registerInput("normal", NodeGeometryBlockConnectionPointTypes.Vector3);
        this.registerInput("center", NodeGeometryBlockConnectionPointTypes.Vector3, true, math_vector/* Vector3 */.Pq.Zero());
        this.registerOutput("uv", NodeGeometryBlockConnectionPointTypes.Vector2);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MappingBlock";
    }
    /**
     * Gets the position input component
     */
    get position() {
        return this._inputs[0];
    }
    /**
     * Gets the normal input component
     */
    get normal() {
        return this._inputs[1];
    }
    /**
     * Gets the center input component
     */
    get center() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get uv() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.position.isConnected) {
            this.uv._storedFunction = null;
            this.uv._storedValue = null;
            return;
        }
        const tempDirection = math_vector/* Vector3 */.Pq.Zero();
        const func = (state) => {
            const position = this.position.getConnectedValue(state) || math_vector/* Vector3 */.Pq.Zero();
            const normal = this.normal.getConnectedValue(state) || math_vector/* Vector3 */.Pq.Zero();
            const center = this.center.getConnectedValue(state);
            const uv = math_vector/* Vector2 */.I9.Zero();
            switch (this.mapping) {
                case MappingTypes.Spherical: {
                    position.subtractToRef(center, tempDirection);
                    const len = tempDirection.length();
                    if (len > 0) {
                        uv.x = Math.acos(tempDirection.y / len) / Math.PI;
                        if (tempDirection.x !== 0 || tempDirection.z !== 0) {
                            uv.y = Math.atan2(tempDirection.x, tempDirection.z) / (Math.PI * 2);
                        }
                    }
                    break;
                }
                case MappingTypes.Cylindrical: {
                    position.subtractToRef(center, tempDirection);
                    const len = tempDirection.length();
                    if (len > 0) {
                        uv.x = Math.atan2(tempDirection.x / len, tempDirection.z / len) / (Math.PI * 2);
                        uv.y = (tempDirection.y + 1.0) / 2.0;
                    }
                    break;
                }
                case MappingTypes.Cubic: {
                    // Find the largest component of the normal vector
                    const absX = Math.abs(normal.x);
                    const absY = Math.abs(normal.y);
                    const absZ = Math.abs(normal.z);
                    const maxDim = Math.max(Math.abs(position.x), Math.abs(position.y), Math.abs(position.z));
                    let u = 0, v = 0;
                    if (absX >= absY && absX >= absZ) {
                        u = position.y / maxDim - center.y;
                        v = position.z / maxDim - center.z;
                    }
                    else if (absY >= absX && absY >= absZ) {
                        u = position.x / maxDim - center.x;
                        v = position.z / maxDim - center.z;
                    }
                    else {
                        u = position.x / maxDim - center.x;
                        v = position.y / maxDim - center.y;
                    }
                    uv.x = (u + 1) / 2;
                    uv.y = (v + 1) / 2;
                }
            }
            return uv;
        };
        this.uv._storedFunction = (state) => {
            return func(state);
        };
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.mapping = BABYLON.MappingTypes.${MappingTypes[this.mapping]};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.mapping = this.mapping;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.mapping = serializationObject.mapping;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Mapping", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "Spherical", value: MappingTypes.Spherical },
            { label: "Cylindrical", value: MappingTypes.Cylindrical },
            { label: "Cubic", value: MappingTypes.Cubic },
        ],
    })
], MappingBlock.prototype, "mapping", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MappingBlock", MappingBlock);
//# sourceMappingURL=mappingBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/matrixComposeBlock.js



/**
 * Block used to compose two matrices
 */
class MatrixComposeBlock extends NodeGeometryBlock {
    /**
     * Create a new MatrixComposeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("matrix0", NodeGeometryBlockConnectionPointTypes.Matrix);
        this.registerInput("matrix1", NodeGeometryBlockConnectionPointTypes.Matrix);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "MatrixComposeBlock";
    }
    /**
     * Gets the matrix0 input component
     */
    get matrix0() {
        return this._inputs[0];
    }
    /**
     * Gets the matrix1 input component
     */
    get matrix1() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        this.output._storedFunction = (state) => {
            if (!this.matrix0.isConnected || !this.matrix1.isConnected) {
                return null;
            }
            const matrix0 = this.matrix0.getConnectedValue(state);
            const matrix1 = this.matrix1.getConnectedValue(state);
            if (!matrix0 || !matrix1) {
                return null;
            }
            return matrix0.multiply(matrix1);
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MatrixComposeBlock", MatrixComposeBlock);
//# sourceMappingURL=matrixComposeBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Teleport/teleportInBlock.js



/**
 * Defines a block used to teleport a value to an endpoint
 */
class TeleportInBlock extends NodeGeometryBlock {
    /** Gets the list of attached endpoints */
    get endpoints() {
        return this._endpoints;
    }
    /**
     * Create a new TeleportInBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._endpoints = [];
        this._isTeleportIn = true;
        this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TeleportInBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    _dumpCode(uniqueNames, alreadyDumped) {
        let codeString = super._dumpCode(uniqueNames, alreadyDumped);
        for (const endpoint of this.endpoints) {
            if (alreadyDumped.indexOf(endpoint) === -1) {
                codeString += endpoint._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        return codeString;
    }
    /**
     * Checks if the current block is an ancestor of a given type
     * @param type defines the potential type to check
     * @returns true if block is a descendant
     */
    isAnAncestorOfType(type) {
        if (this.getClassName() === type) {
            return true;
        }
        for (const endpoint of this.endpoints) {
            if (endpoint.isAnAncestorOfType(type)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Checks if the current block is an ancestor of a given block
     * @param block defines the potential descendant block to check
     * @returns true if block is a descendant
     */
    isAnAncestorOf(block) {
        for (const endpoint of this.endpoints) {
            if (endpoint === block) {
                return true;
            }
            if (endpoint.isAnAncestorOf(block)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Get the first descendant using a predicate
     * @param predicate defines the predicate to check
     * @returns descendant or null if none found
     */
    getDescendantOfPredicate(predicate) {
        if (predicate(this)) {
            return this;
        }
        for (const endpoint of this.endpoints) {
            const descendant = endpoint.getDescendantOfPredicate(predicate);
            if (descendant) {
                return descendant;
            }
        }
        return null;
    }
    /**
     * Add an enpoint to this block
     * @param endpoint define the endpoint to attach to
     */
    attachToEndpoint(endpoint) {
        endpoint.detach();
        this._endpoints.push(endpoint);
        endpoint._entryPoint = this;
        endpoint._outputs[0]._typeConnectionSource = this._inputs[0];
        endpoint._tempEntryPointUniqueId = null;
        endpoint.name = "> " + this.name;
    }
    /**
     * Remove enpoint from this block
     * @param endpoint define the endpoint to remove
     */
    detachFromEndpoint(endpoint) {
        const index = this._endpoints.indexOf(endpoint);
        if (index !== -1) {
            this._endpoints.splice(index, 1);
            endpoint._outputs[0]._typeConnectionSource = null;
            endpoint._entryPoint = null;
        }
    }
    _buildBlock() {
        for (const endpoint of this._endpoints) {
            endpoint.output._storedFunction = (state) => {
                return this.input.getConnectedValue(state);
            };
        }
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TeleportInBlock", TeleportInBlock);
//# sourceMappingURL=teleportInBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Teleport/teleportOutBlock.js



/**
 * Defines a block used to receive a value from a teleport entry point
 */
class TeleportOutBlock extends NodeGeometryBlock {
    /**
     * Create a new TeleportOutBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /** @internal */
        this._entryPoint = null;
        /** @internal */
        this._tempEntryPointUniqueId = null;
        this._isTeleportOut = true;
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
    }
    /**
     * Gets the entry point
     */
    get entryPoint() {
        return this._entryPoint;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "TeleportOutBlock";
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    /** Detach from entry point */
    detach() {
        if (!this._entryPoint) {
            return;
        }
        this._entryPoint.detachFromEndpoint(this);
    }
    _buildBlock() {
        // Do nothing
        // All work done by the emitter
    }
    _customBuildStep(state) {
        if (this.entryPoint) {
            this.entryPoint.build(state);
        }
    }
    _dumpCode(uniqueNames, alreadyDumped) {
        let codeString = "";
        if (this.entryPoint) {
            if (alreadyDumped.indexOf(this.entryPoint) === -1) {
                codeString += this.entryPoint._dumpCode(uniqueNames, alreadyDumped);
            }
        }
        return codeString + super._dumpCode(uniqueNames, alreadyDumped);
    }
    _dumpCodeForOutputConnections(alreadyDumped) {
        let codeString = super._dumpCodeForOutputConnections(alreadyDumped);
        if (this.entryPoint) {
            codeString += this.entryPoint._dumpCodeForOutputConnections(alreadyDumped);
        }
        return codeString;
    }
    /**
     * Clone the current block to a new identical block
     * @returns a copy of the current block
     */
    clone() {
        const clone = super.clone();
        if (this.entryPoint) {
            this.entryPoint.attachToEndpoint(clone);
        }
        return clone;
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode();
        if (this.entryPoint) {
            codeString += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\n`;
        }
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.entryPoint = this.entryPoint?.uniqueId ?? "";
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this._tempEntryPointUniqueId = serializationObject.entryPoint;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TeleportOutBlock", TeleportOutBlock);
//# sourceMappingURL=teleportOutBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Textures/geometryTextureBlock.js






/**
 * Block used to load texture data
 */
class GeometryTextureBlock extends NodeGeometryBlock {
    /**
     * Gets the texture data
     */
    get textureData() {
        return this._data;
    }
    /**
     * Gets the texture width
     */
    get textureWidth() {
        return this._width;
    }
    /**
     * Gets the texture height
     */
    get textureHeight() {
        return this._height;
    }
    /**
     * Creates a new GeometryTextureBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this._data = null;
        /**
         * Gets or sets a boolean indicating that this block should serialize its cached data
         */
        this.serializedCachedData = false;
        this.registerOutput("texture", NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryTextureBlock";
    }
    /**
     * Gets the texture component
     */
    get texture() {
        return this._outputs[0];
    }
    _prepareImgToLoadAsync(url) {
        return new Promise((resolve, reject) => {
            const img = new Image();
            const canvas = document.createElement("canvas");
            const ctx = canvas.getContext("2d");
            img.onload = () => {
                canvas.width = img.width;
                canvas.height = img.height;
                ctx.drawImage(img, 0, 0);
                const imageData = ctx.getImageData(0, 0, img.width, img.height);
                const pixels = imageData.data;
                const floatArray = new Float32Array(pixels.length);
                for (let i = 0; i < pixels.length; i++) {
                    floatArray[i] = pixels[i] / 255.0;
                }
                this._data = floatArray;
                this._width = img.width;
                this._height = img.height;
                resolve();
            };
            img.onerror = () => {
                this._data = null;
                reject();
            };
            img.src = url;
        });
    }
    /**
     * Remove stored data
     */
    cleanData() {
        this._data = null;
    }
    /**
     * Load the texture data
     * @param imageFile defines the file to load data from
     * @returns a promise fulfilled when image data is loaded
     */
    loadTextureFromFileAsync(imageFile) {
        return this._prepareImgToLoadAsync(URL.createObjectURL(imageFile));
    }
    /**
     * Load the texture data
     * @param url defines the url to load data from
     * @returns a promise fulfilled when image data is loaded
     */
    loadTextureFromUrlAsync(url) {
        return this._prepareImgToLoadAsync(url);
    }
    /**
     * Load the texture data
     * @param texture defines the source texture
     * @returns a promise fulfilled when image data is loaded
     */
    extractFromTextureAsync(texture) {
        return new Promise((resolve, reject) => {
            if (!texture.isReady()) {
                texture.onLoadObservable.addOnce(() => {
                    return this.extractFromTextureAsync(texture).then(resolve).catch(reject);
                });
                return;
            }
            const size = texture.getSize();
            textureTools/* TextureTools */.LO.GetTextureDataAsync(texture, size.width, size.height)
                .then(async (data) => {
                const floatArray = new Float32Array(data.length);
                for (let i = 0; i < data.length; i++) {
                    floatArray[i] = data[i] / 255.0;
                }
                this._data = floatArray;
                this._width = size.width;
                this._height = size.height;
                resolve();
            })
                .catch(reject);
        });
    }
    _buildBlock() {
        if (!this._data) {
            this.texture._storedValue = null;
            return;
        }
        const textureData = {
            data: this._data,
            width: this._width,
            height: this._height,
        };
        this.texture._storedValue = textureData;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.width = this._width;
        serializationObject.height = this._height;
        serializationObject.serializedCachedData = this.serializedCachedData;
        if (this._data && this.serializedCachedData) {
            serializationObject.data = Array.from(this._data);
        }
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this._width = serializationObject.width;
        this._height = serializationObject.height;
        if (serializationObject.data) {
            this._data = new Float32Array(serializationObject.data);
            this.serializedCachedData = true;
        }
        else {
            this.serializedCachedData = !!serializationObject.serializedCachedData;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Serialize cached data", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], GeometryTextureBlock.prototype, "serializedCachedData", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryTextureBlock", GeometryTextureBlock);
//# sourceMappingURL=geometryTextureBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js






/**
 * Block used to fetch a color from texture data
 */
class GeometryTextureFetchBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryTextureFetchBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating if coordinates should be clamped between 0 and 1
         */
        this.clampCoordinates = true;
        this.registerInput("texture", NodeGeometryBlockConnectionPointTypes.Texture);
        this.registerInput("coordinates", NodeGeometryBlockConnectionPointTypes.Vector2);
        this.registerOutput("rgba", NodeGeometryBlockConnectionPointTypes.Vector4);
        this.registerOutput("rgb", NodeGeometryBlockConnectionPointTypes.Vector3);
        this.registerOutput("r", NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("g", NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("b", NodeGeometryBlockConnectionPointTypes.Float);
        this.registerOutput("a", NodeGeometryBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryTextureFetchBlock";
    }
    /**
     * Gets the texture component
     */
    get texture() {
        return this.inputs[0];
    }
    /**
     * Gets the coordinates component
     */
    get coordinates() {
        return this.inputs[1];
    }
    /**
     * Gets the rgba component
     */
    get rgba() {
        return this._outputs[0];
    }
    /**
     * Gets the rgb component
     */
    get rgb() {
        return this._outputs[1];
    }
    /**
     * Gets the r component
     */
    get r() {
        return this._outputs[2];
    }
    /**
     * Gets the g component
     */
    get g() {
        return this._outputs[3];
    }
    /**
     * Gets the b component
     */
    get b() {
        return this._outputs[4];
    }
    /**
     * Gets the a component
     */
    get a() {
        return this._outputs[5];
    }
    _repeatClamp(num) {
        if (num >= 0) {
            return num % 1;
        }
        else {
            return 1 - (Math.abs(num) % 1);
        }
    }
    _buildBlock() {
        const func = (state) => {
            const textureData = this.texture.getConnectedValue(state);
            if (!textureData || !textureData.data) {
                return null;
            }
            const uv = this.coordinates.getConnectedValue(state);
            if (!uv) {
                return null;
            }
            const u = this.clampCoordinates ? Math.max(0, Math.min(uv.x, 1.0)) : this._repeatClamp(uv.x);
            const v = this.clampCoordinates ? Math.max(0, Math.min(uv.y, 1.0)) : this._repeatClamp(uv.y);
            const x = Math.floor(u * (textureData.width - 1));
            const y = Math.floor(v * (textureData.height - 1));
            const index = x + textureData.width * y;
            return math_vector/* Vector4 */.IU.FromArray(textureData.data, index * 4);
        };
        this.rgba._storedFunction = (state) => {
            return func(state);
        };
        this.rgb._storedFunction = (state) => {
            const color = func(state);
            return color ? color.toVector3() : null;
        };
        this.r._storedFunction = (state) => {
            const color = func(state);
            return color ? color.x : null;
        };
        this.g._storedFunction = (state) => {
            const color = func(state);
            return color ? color.y : null;
        };
        this.b._storedFunction = (state) => {
            const color = func(state);
            return color ? color.z : null;
        };
        this.a._storedFunction = (state) => {
            const color = func(state);
            return color ? color.w : null;
        };
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.clampCoordinates = ${this.clampCoordinates};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.clampCoordinates = this.clampCoordinates;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.clampCoordinates = serializationObject.clampCoordinates;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Clamp Coordinates", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], GeometryTextureFetchBlock.prototype, "clampCoordinates", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryTextureFetchBlock", GeometryTextureFetchBlock);
//# sourceMappingURL=geometryTextureFetchBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/boundingBlock.js




/**
 * Block used to get the bounding info of a geometry
 */
class BoundingBlock extends NodeGeometryBlock {
    /**
     * Create a new BoundingBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerOutput("min", NodeGeometryBlockConnectionPointTypes.Vector3);
        this.registerOutput("max", NodeGeometryBlockConnectionPointTypes.Vector3);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "BoundingBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the min output component
     */
    get min() {
        return this._outputs[0];
    }
    /**
     * Gets the max output component
     */
    get max() {
        return this._outputs[1];
    }
    _buildBlock() {
        this.min._storedFunction = (state) => {
            const geometry = this.geometry.getConnectedValue(state);
            if (!geometry) {
                return null;
            }
            const boundingInfo = (0,math_functions/* extractMinAndMax */.b8)(geometry.positions, 0, geometry.positions.length / 3);
            return boundingInfo.minimum;
        };
        this.max._storedFunction = (state) => {
            const geometry = this.geometry.getConnectedValue(state);
            if (!geometry) {
                return null;
            }
            const boundingInfo = (0,math_functions/* extractMinAndMax */.b8)(geometry.positions, 0, geometry.positions.length / 3);
            return boundingInfo.maximum;
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BoundingBlock", BoundingBlock);
//# sourceMappingURL=boundingBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/booleanGeometryBlock.js







/**
 * Operations supported by the boolean block
 */
var BooleanGeometryOperations;
(function (BooleanGeometryOperations) {
    /** Intersect */
    BooleanGeometryOperations[BooleanGeometryOperations["Intersect"] = 0] = "Intersect";
    /** Subtract */
    BooleanGeometryOperations[BooleanGeometryOperations["Subtract"] = 1] = "Subtract";
    /** Union */
    BooleanGeometryOperations[BooleanGeometryOperations["Union"] = 2] = "Union";
})(BooleanGeometryOperations || (BooleanGeometryOperations = {}));
/**
 * Block used to apply a boolean operation between 2 geometries
 */
class BooleanGeometryBlock extends NodeGeometryBlock {
    /**
     * @internal
     */
    get _isReadyState() {
        if (IsCSG2Ready()) {
            return null;
        }
        if (!this._csg2LoadingPromise) {
            this._csg2LoadingPromise = InitializeCSG2Async();
        }
        return this._csg2LoadingPromise;
    }
    /**
     * Create a new BooleanGeometryBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = false;
        /**
         * Gets or sets the operation applied by the block
         */
        this.operation = BooleanGeometryOperations.Intersect;
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.useOldCSGEngine = false;
        this.registerInput("geometry0", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("geometry1", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "BooleanGeometryBlock";
    }
    /**
     * Gets the geometry0 input component
     */
    get geometry0() {
        return this._inputs[0];
    }
    /**
     * Gets the geometry1 input component
     */
    get geometry1() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            const vertexData0 = this.geometry0.getConnectedValue(state);
            const vertexData1 = this.geometry1.getConnectedValue(state);
            if (!vertexData0 || !vertexData1) {
                return null;
            }
            const vertexCount = vertexData0.positions.length / 3;
            // Ensure that all the fields are filled to avoid problems later on in the graph
            if (!vertexData0.normals && vertexData1.normals) {
                vertexData0.normals = new Array(vertexData0.positions.length);
            }
            if (!vertexData1.normals && vertexData0.normals) {
                vertexData1.normals = new Array(vertexData1.positions.length);
            }
            if (!vertexData0.uvs && vertexData1.uvs) {
                vertexData0.uvs = new Array(vertexCount * 2);
            }
            if (!vertexData1.uvs && vertexData0.uvs) {
                vertexData1.uvs = new Array(vertexCount * 2);
            }
            if (!vertexData0.colors && vertexData1.colors) {
                vertexData0.colors = new Array(vertexCount * 4);
            }
            if (!vertexData1.colors && vertexData0.colors) {
                vertexData1.colors = new Array(vertexCount * 4);
            }
            let boolCSG;
            if (this.useOldCSGEngine) {
                const CSG0 = CSG.FromVertexData(vertexData0);
                const CSG1 = CSG.FromVertexData(vertexData1);
                switch (this.operation) {
                    case BooleanGeometryOperations.Intersect:
                        boolCSG = CSG0.intersect(CSG1);
                        break;
                    case BooleanGeometryOperations.Subtract:
                        boolCSG = CSG0.subtract(CSG1);
                        break;
                    case BooleanGeometryOperations.Union:
                        boolCSG = CSG0.union(CSG1);
                        break;
                }
            }
            else {
                const CSG0 = CSG2.FromVertexData(vertexData0);
                const CSG1 = CSG2.FromVertexData(vertexData1);
                switch (this.operation) {
                    case BooleanGeometryOperations.Intersect:
                        boolCSG = CSG0.intersect(CSG1);
                        break;
                    case BooleanGeometryOperations.Subtract:
                        boolCSG = CSG0.subtract(CSG1);
                        break;
                    case BooleanGeometryOperations.Union:
                        boolCSG = CSG0.add(CSG1);
                        break;
                }
            }
            return boolCSG.toVertexData();
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        codeString += `${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${BooleanGeometryOperations[this.operation]};\n`;
        codeString += `${this._codeVariableName}.useOldCSGEngine = ${this.useOldCSGEngine ? "true" : "false"};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        serializationObject.operation = this.operation;
        serializationObject.useOldCSGEngine = this.useOldCSGEngine;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.evaluateContext = serializationObject.evaluateContext;
        if (serializationObject.operation) {
            this.operation = serializationObject.operation;
        }
        this.useOldCSGEngine = !!serializationObject.useOldCSGEngine;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], BooleanGeometryBlock.prototype, "evaluateContext", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Operation", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "Intersect", value: BooleanGeometryOperations.Intersect },
            { label: "Subtract", value: BooleanGeometryOperations.Subtract },
            { label: "Union", value: BooleanGeometryOperations.Union },
        ],
    })
], BooleanGeometryBlock.prototype, "operation", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Use old CSG engine", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
], BooleanGeometryBlock.prototype, "useOldCSGEngine", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BooleanGeometryBlock", BooleanGeometryBlock);
//# sourceMappingURL=booleanGeometryBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryArcTan2Block.js




/**
 * Block used to compute arc tangent of 2 values
 */
class GeometryArcTan2Block extends NodeGeometryBlock {
    /**
     * Creates a new GeometryArcTan2Block
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("x", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("y", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryArcTan2Block";
    }
    /**
     * Gets the x operand input component
     */
    get x() {
        return this._inputs[0];
    }
    /**
     * Gets the y operand input component
     */
    get y() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.x.isConnected || !this.y.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (x, y) => {
            return Math.atan2(x, y);
        };
        this.output._storedFunction = (state) => {
            const x = this.x.getConnectedValue(state);
            const y = this.y.getConnectedValue(state);
            switch (this.x.type) {
                case NodeGeometryBlockConnectionPointTypes.Int:
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    return func(x, y);
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    return new math_vector/* Vector2 */.I9(func(x.x, y.x), func(x.y, y.y));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    return new math_vector/* Vector3 */.Pq(func(x.x, y.x), func(x.y, y.y), func(x.z, y.z));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    return new math_vector/* Vector4 */.IU(func(x.x, y.x), func(x.y, y.y), func(x.z, y.z), func(x.w, y.w));
                }
            }
            return 0;
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryArcTan2Block", GeometryArcTan2Block);
//# sourceMappingURL=geometryArcTan2Block.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryLerpBlock.js




/**
 * Block used to lerp between 2 values
 */
class GeometryLerpBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryLerpBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("gradient", NodeGeometryBlockConnectionPointTypes.Float, true, 0, 0, 1);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryLerpBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the gradient operand input component
     */
    get gradient() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.left.isConnected || !this.right.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (gradient, left, right) => {
            return (1 - gradient) * left + gradient * right;
        };
        this.output._storedFunction = (state) => {
            const left = this.left.getConnectedValue(state);
            const right = this.right.getConnectedValue(state);
            const gradient = this.gradient.getConnectedValue(state);
            switch (this.left.type) {
                case NodeGeometryBlockConnectionPointTypes.Int:
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    return func(gradient, left, right);
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    return new math_vector/* Vector2 */.I9(func(gradient, left.x, right.x), func(gradient, left.y, right.y));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    return new math_vector/* Vector3 */.Pq(func(gradient, left.x, right.x), func(gradient, left.y, right.y), func(gradient, left.z, right.z));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    return new math_vector/* Vector4 */.IU(func(gradient, left.x, right.x), func(gradient, left.y, right.y), func(gradient, left.z, right.z), func(gradient, left.w, right.w));
                }
            }
            return 0;
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryLerpBlock", GeometryLerpBlock);
//# sourceMappingURL=geometryLerpBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryNLerpBlock.js




/**
 * Block used to normalize lerp between 2 values
 */
class GeometryNLerpBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryNLerpBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("gradient", NodeGeometryBlockConnectionPointTypes.Float, true, 0, 0, 1);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryNLerpBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the gradient operand input component
     */
    get gradient() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.left.isConnected || !this.right.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (gradient, left, right) => {
            return (1 - gradient) * left + gradient * right;
        };
        this.output._storedFunction = (state) => {
            const left = this.left.getConnectedValue(state);
            const right = this.right.getConnectedValue(state);
            const gradient = this.gradient.getConnectedValue(state);
            switch (this.left.type) {
                case NodeGeometryBlockConnectionPointTypes.Int:
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    return func(gradient, left, right); // NLerp is really lerp in that case
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    const result = new math_vector/* Vector2 */.I9(func(gradient, left.x, right.x), func(gradient, left.y, right.y));
                    result.normalize();
                    return result;
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    const result = new math_vector/* Vector3 */.Pq(func(gradient, left.x, right.x), func(gradient, left.y, right.y), func(gradient, left.z, right.z));
                    result.normalize();
                    return result;
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    const result = new math_vector/* Vector4 */.IU(func(gradient, left.x, right.x), func(gradient, left.y, right.y), func(gradient, left.z, right.z), func(gradient, left.w, right.w));
                    result.normalize();
                    return result;
                }
            }
            return 0;
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryNLerpBlock", GeometryNLerpBlock);
//# sourceMappingURL=geometryNLerpBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryStepBlock.js




/**
 * Block used to step a value
 */
class GeometryStepBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryStepBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("edge", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryStepBlock";
    }
    /**
     * Gets the value operand input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the edge operand input component
     */
    get edge() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.value.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (value, edge) => {
            if (value < edge) {
                return 0;
            }
            return 1;
        };
        this.output._storedFunction = (state) => {
            const source = this.value.getConnectedValue(state);
            const edge = this.edge.getConnectedValue(state);
            switch (this.value.type) {
                case NodeGeometryBlockConnectionPointTypes.Int:
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    return func(source, edge);
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    return new math_vector/* Vector2 */.I9(func(source.x, edge), func(source.y, edge));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    return new math_vector/* Vector3 */.Pq(func(source.x, edge), func(source.y, edge), func(source.z, edge));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    return new math_vector/* Vector4 */.IU(func(source.x, edge), func(source.y, edge), func(source.z, edge), func(source.w, edge));
                }
            }
            return 0;
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryStepBlock", GeometryStepBlock);
//# sourceMappingURL=geometryStepBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometrySmoothStepBlock.js




/**
 * Block used to smooth step a value
 */
class GeometrySmoothStepBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometrySmoothStepBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("edge0", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("edge1", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometrySmoothStepBlock";
    }
    /**
     * Gets the value operand input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the first edge operand input component
     */
    get edge0() {
        return this._inputs[1];
    }
    /**
     * Gets the second edge operand input component
     */
    get edge1() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.value.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (value, edge0, edge1) => {
            const x = Math.max(0, Math.min((value - edge0) / (edge1 - edge0), 1));
            // Smoothstep formula: 3x^2 - 2x^3
            return x * x * (3 - 2 * x);
        };
        this.output._storedFunction = (state) => {
            const source = this.value.getConnectedValue(state);
            const edge0 = this.edge0.getConnectedValue(state);
            const edge1 = this.edge1.getConnectedValue(state);
            switch (this.value.type) {
                case NodeGeometryBlockConnectionPointTypes.Int:
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    return func(source, edge0, edge1);
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    return new math_vector/* Vector2 */.I9(func(source.x, edge0, edge1), func(source.y, edge0, edge1));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    return new math_vector/* Vector3 */.Pq(func(source.x, edge0, edge1), func(source.y, edge0, edge1), func(source.z, edge0, edge1));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    return new math_vector/* Vector4 */.IU(func(source.x, edge0, edge1), func(source.y, edge0, edge1), func(source.z, edge0, edge1), func(source.w, edge0, edge1));
                }
            }
            return 0;
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometrySmoothStepBlock", GeometrySmoothStepBlock);
//# sourceMappingURL=geometrySmoothStepBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryModBlock.js




/**
 * Block used to compute value of one parameter modulo another
 */
class GeometryModBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryModBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryModBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.left.isConnected || !this.right.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (left, right) => {
            return left - Math.floor(left / right) * right;
        };
        this.output._storedFunction = (state) => {
            const left = this.left.getConnectedValue(state);
            const right = this.right.getConnectedValue(state);
            switch (this.left.type) {
                case NodeGeometryBlockConnectionPointTypes.Int:
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    return func(left, right);
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    return new math_vector/* Vector2 */.I9(func(left.x, right.x), func(left.y, right.y));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    return new math_vector/* Vector3 */.Pq(func(left.x, right.x), func(left.y, right.y), func(left.z, right.z));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    return new math_vector/* Vector4 */.IU(func(left.x, right.x), func(left.y, right.y), func(left.z, right.z), func(left.w, right.w));
                }
            }
            return 0;
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryModBlock", GeometryModBlock);
//# sourceMappingURL=geometryModBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryPowBlock.js




/**
 * Block used to get the value of the first parameter raised to the power of the second
 */
class GeometryPowBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryPowBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("power", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryPowBlock";
    }
    /**
     * Gets the value operand input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the power operand input component
     */
    get power() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.value.isConnected || !this.power.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (value, power) => {
            return Math.pow(value, power);
        };
        this.output._storedFunction = (state) => {
            const source = this.value.getConnectedValue(state);
            const power = this.power.getConnectedValue(state);
            switch (this.value.type) {
                case NodeGeometryBlockConnectionPointTypes.Int:
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    return func(source, power);
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    return new math_vector/* Vector2 */.I9(func(source.x, power), func(source.y, power));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    return new math_vector/* Vector3 */.Pq(func(source.x, power), func(source.y, power), func(source.z, power));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    return new math_vector/* Vector4 */.IU(func(source.x, power), func(source.y, power), func(source.z, power), func(source.w, power));
                }
            }
            return 0;
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryPowBlock", GeometryPowBlock);
//# sourceMappingURL=geometryPowBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryClampBlock.js




/**
 * Block used to clamp a float
 */
class GeometryClampBlock extends NodeGeometryBlock {
    /** Gets or sets the minimum range */
    get minimum() {
        return this.min.value;
    }
    set minimum(value) {
        this.min.value = value;
    }
    /** Gets or sets the maximum range */
    get maximum() {
        return this.max.value;
    }
    set maximum(value) {
        this.max.value = value;
    }
    /**
     * Creates a new GeometryClampBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("min", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("max", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryClampBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the min input component
     */
    get min() {
        return this._inputs[1];
    }
    /**
     * Gets the max input component
     */
    get max() {
        return this._inputs[2];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.value.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        const func = (value, min, max) => {
            return Math.max(min, Math.min(value, max));
        };
        this.output._storedFunction = (state) => {
            const value = this.value.getConnectedValue(state);
            const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;
            const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;
            switch (this.value.type) {
                case NodeGeometryBlockConnectionPointTypes.Int:
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    return func(value, min, max);
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    return new math_vector/* Vector2 */.I9(func(value.x, min, max), func(value.y, min, max));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    return new math_vector/* Vector3 */.Pq(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    return new math_vector/* Vector4 */.IU(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max), func(value.w, min, max));
                }
            }
            return 0;
        };
        return this;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.minimum = serializationObject.minimum;
        this.maximum = serializationObject.maximum;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryClampBlock", GeometryClampBlock);
//# sourceMappingURL=geometryClampBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryCrossBlock.js




/**
 * Block used to apply a cross product between 2 vectors
 */
class GeometryCrossBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryCrossBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Vector3);
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector2);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector2);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryCrossBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.left.isConnected || !this.right.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => {
            const left = this.left.getConnectedValue(state);
            const right = this.right.getConnectedValue(state);
            switch (this.left.type) {
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    return math_vector/* Vector3 */.Pq.Cross(left, right);
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    return math_vector/* Vector3 */.Pq.Cross(left.toVector3(), right.toVector3());
                }
            }
            return 0;
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryCrossBlock", GeometryCrossBlock);
//# sourceMappingURL=geometryCrossBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryCurveBlock.js






/**
 * Types of curves supported by the Curve block
 */
var GeometryCurveBlockTypes;
(function (GeometryCurveBlockTypes) {
    /** EaseInSine */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInSine"] = 0] = "EaseInSine";
    /** EaseOutSine */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseOutSine"] = 1] = "EaseOutSine";
    /** EaseInOutSine */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInOutSine"] = 2] = "EaseInOutSine";
    /** EaseInQuad */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInQuad"] = 3] = "EaseInQuad";
    /** EaseOutQuad */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseOutQuad"] = 4] = "EaseOutQuad";
    /** EaseInOutQuad */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInOutQuad"] = 5] = "EaseInOutQuad";
    /** EaseInCubic */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInCubic"] = 6] = "EaseInCubic";
    /** EaseOutCubic */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseOutCubic"] = 7] = "EaseOutCubic";
    /** EaseInOutCubic */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInOutCubic"] = 8] = "EaseInOutCubic";
    /** EaseInQuart */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInQuart"] = 9] = "EaseInQuart";
    /** EaseOutQuart */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseOutQuart"] = 10] = "EaseOutQuart";
    /** EaseInOutQuart */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInOutQuart"] = 11] = "EaseInOutQuart";
    /** EaseInQuint */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInQuint"] = 12] = "EaseInQuint";
    /** EaseOutQuint */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseOutQuint"] = 13] = "EaseOutQuint";
    /** EaseInOutQuint */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInOutQuint"] = 14] = "EaseInOutQuint";
    /** EaseInExpo */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInExpo"] = 15] = "EaseInExpo";
    /** EaseOutExpo */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseOutExpo"] = 16] = "EaseOutExpo";
    /** EaseInOutExpo */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInOutExpo"] = 17] = "EaseInOutExpo";
    /** EaseInCirc */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInCirc"] = 18] = "EaseInCirc";
    /** EaseOutCirc */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseOutCirc"] = 19] = "EaseOutCirc";
    /** EaseInOutCirc */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInOutCirc"] = 20] = "EaseInOutCirc";
    /** EaseInBack */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInBack"] = 21] = "EaseInBack";
    /** EaseOutBack */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseOutBack"] = 22] = "EaseOutBack";
    /** EaseInOutBack */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInOutBack"] = 23] = "EaseInOutBack";
    /** EaseInElastic */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInElastic"] = 24] = "EaseInElastic";
    /** EaseOutElastic */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseOutElastic"] = 25] = "EaseOutElastic";
    /** EaseInOutElastic */
    GeometryCurveBlockTypes[GeometryCurveBlockTypes["EaseInOutElastic"] = 26] = "EaseInOutElastic";
})(GeometryCurveBlockTypes || (GeometryCurveBlockTypes = {}));
/**
 * Block used to apply curve operation
 */
class GeometryCurveBlock extends NodeGeometryBlock {
    /**
     * Creates a new CurveBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets the type of the curve applied by the block
         */
        this.type = GeometryCurveBlockTypes.EaseInOutSine;
        this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryCurveBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.input.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        let func;
        switch (this.type) {
            case GeometryCurveBlockTypes.EaseInSine:
                func = (v) => 1.0 - Math.cos((v * 3.1415) / 2.0);
                break;
            case GeometryCurveBlockTypes.EaseOutSine:
                func = (v) => Math.sin((v * 3.1415) / 2.0);
                break;
            case GeometryCurveBlockTypes.EaseInOutSine:
                func = (v) => -(Math.cos(v * 3.1415) - 1.0) / 2.0;
                break;
            case GeometryCurveBlockTypes.EaseInQuad:
                func = (v) => v * v;
                break;
            case GeometryCurveBlockTypes.EaseOutQuad:
                func = (v) => (1.0 - v) * (1.0 - v);
                break;
            case GeometryCurveBlockTypes.EaseInOutQuad: {
                func = (v) => (v < 0.5 ? 2.0 * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 2.0) / 2.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInCubic:
                func = (v) => v * v * v;
                break;
            case GeometryCurveBlockTypes.EaseOutCubic: {
                func = (v) => 1.0 - Math.pow(1.0 - v, 3.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInOutCubic: {
                func = (v) => (v < 0.5 ? 4.0 * v * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 3.0) / 2.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInQuart:
                func = (v) => v * v * v * v;
                break;
            case GeometryCurveBlockTypes.EaseOutQuart: {
                func = (v) => 1.0 - Math.pow(1.0 - v, 4.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInOutQuart: {
                func = (v) => (v < 0.5 ? 8.0 * v * v * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 4.0) / 2.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInQuint:
                func = (v) => v * v * v * v * v;
                break;
            case GeometryCurveBlockTypes.EaseOutQuint: {
                func = (v) => 1.0 - Math.pow(1.0 - v, 5.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInOutQuint: {
                func = (v) => (v < 0.5 ? 16.0 * v * v * v * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 5.0) / 2.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInExpo: {
                func = (v) => (v === 0.0 ? 0.0 : Math.pow(2.0, 10.0 * v - 10.0));
                break;
            }
            case GeometryCurveBlockTypes.EaseOutExpo: {
                func = (v) => (v === 1.0 ? 1.0 : 1.0 - Math.pow(2.0, -10.0 * v));
                break;
            }
            case GeometryCurveBlockTypes.EaseInOutExpo: {
                func = (v) => (v === 0.0 ? 0.0 : v === 1.0 ? 1.0 : v < 0.5 ? Math.pow(2.0, 20.0 * v - 10.0) / 2.0 : (2.0 - Math.pow(2.0, -20.0 * v + 10.0)) / 2.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInCirc: {
                func = (v) => 1.0 - Math.sqrt(1.0 - Math.pow(v, 2.0));
                break;
            }
            case GeometryCurveBlockTypes.EaseOutCirc: {
                func = (v) => Math.sqrt(1.0 - Math.pow(v - 1.0, 2.0));
                break;
            }
            case GeometryCurveBlockTypes.EaseInOutCirc: {
                func = (v) => (v < 0.5 ? (1.0 - Math.sqrt(1.0 - Math.pow(2.0 * v, 2.0))) / 2.0 : (Math.sqrt(1.0 - Math.pow(-2.0 * v + 2.0, 2.0)) + 1.0) / 2.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInBack: {
                func = (v) => 2.70158 * v * v * v - 1.70158 * v * v;
                break;
            }
            case GeometryCurveBlockTypes.EaseOutBack: {
                func = (v) => 2.70158 * Math.pow(v - 1.0, 3.0) + 1.70158 * Math.pow(v - 1.0, 2.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInOutBack: {
                func = (v) => v < 0.5
                    ? (Math.pow(2.0 * v, 2.0) * (3.5949095 * 2.0 * v - 2.5949095)) / 2.0
                    : (Math.pow(2.0 * v - 2.0, 2.0) * (3.5949095 * (v * 2.0 - 2.0) + 3.5949095) + 2.0) / 2.0;
                break;
            }
            case GeometryCurveBlockTypes.EaseInElastic: {
                func = (v) => (v === 0.0 ? 0.0 : v === 1.0 ? 1.0 : -Math.pow(2.0, 10.0 * v - 10.0) * Math.sin((v * 10.0 - 10.75) * ((2.0 * 3.1415) / 3.0)));
                break;
            }
            case GeometryCurveBlockTypes.EaseOutElastic: {
                func = (v) => (v === 0.0 ? 0.0 : v === 1.0 ? 1.0 : Math.pow(2.0, -10.0 * v) * Math.sin((v * 10.0 - 0.75) * ((2.0 * 3.1415) / 3.0)) + 1.0);
                break;
            }
            case GeometryCurveBlockTypes.EaseInOutElastic: {
                func = (v) => v === 0.0
                    ? 0.0
                    : v == 1.0
                        ? 1.0
                        : v < 0.5
                            ? -(Math.pow(2.0, 20.0 * v - 10.0) * Math.sin((20.0 * v - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0
                            : (Math.pow(2.0, -20.0 * v + 10.0) * Math.sin((20.0 * v - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 + 1.0;
                break;
            }
        }
        this.output._storedFunction = (state) => {
            const input = this.input.getConnectedValue(state);
            switch (this.input.type) {
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    return func(input);
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    return new math_vector/* Vector2 */.I9(func(input.x), func(input.y));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    return new math_vector/* Vector3 */.Pq(func(input.x), func(input.y), func(input.z));
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    return new math_vector/* Vector4 */.IU(func(input.x), func(input.y), func(input.z), func(input.w));
                }
            }
            return 0;
        };
        return this;
    }
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.curveType = this.type;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        this.type = serializationObject.curveType;
    }
    _dumpPropertiesCode() {
        const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.type = BABYLON.GeometryCurveBlockTypes.${GeometryCurveBlockTypes[this.type]};\n`;
        return codeString;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Type", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "EaseInSine", value: GeometryCurveBlockTypes.EaseInSine },
            { label: "EaseOutSine", value: GeometryCurveBlockTypes.EaseOutSine },
            { label: "EaseInOutSine", value: GeometryCurveBlockTypes.EaseInOutSine },
            { label: "EaseInQuad", value: GeometryCurveBlockTypes.EaseInQuad },
            { label: "EaseOutQuad", value: GeometryCurveBlockTypes.EaseOutQuad },
            { label: "EaseInOutQuad", value: GeometryCurveBlockTypes.EaseInOutQuad },
            { label: "EaseInCubic", value: GeometryCurveBlockTypes.EaseInCubic },
            { label: "EaseOutCubic", value: GeometryCurveBlockTypes.EaseOutCubic },
            { label: "EaseInOutCubic", value: GeometryCurveBlockTypes.EaseInOutCubic },
            { label: "EaseInQuart", value: GeometryCurveBlockTypes.EaseInQuart },
            { label: "EaseOutQuart", value: GeometryCurveBlockTypes.EaseOutQuart },
            { label: "EaseInOutQuart", value: GeometryCurveBlockTypes.EaseInOutQuart },
            { label: "EaseInQuint", value: GeometryCurveBlockTypes.EaseInQuint },
            { label: "EaseOutQuint", value: GeometryCurveBlockTypes.EaseOutQuint },
            { label: "EaseInOutQuint", value: GeometryCurveBlockTypes.EaseInOutQuint },
            { label: "EaseInExpo", value: GeometryCurveBlockTypes.EaseInExpo },
            { label: "EaseOutExpo", value: GeometryCurveBlockTypes.EaseOutExpo },
            { label: "EaseInOutExpo", value: GeometryCurveBlockTypes.EaseInOutExpo },
            { label: "EaseInCirc", value: GeometryCurveBlockTypes.EaseInCirc },
            { label: "EaseOutCirc", value: GeometryCurveBlockTypes.EaseOutCirc },
            { label: "EaseInOutCirc", value: GeometryCurveBlockTypes.EaseInOutCirc },
            { label: "EaseInBack", value: GeometryCurveBlockTypes.EaseInBack },
            { label: "EaseOutBack", value: GeometryCurveBlockTypes.EaseOutBack },
            { label: "EaseInOutBack", value: GeometryCurveBlockTypes.EaseInOutBack },
            { label: "EaseInElastic", value: GeometryCurveBlockTypes.EaseInElastic },
            { label: "EaseOutElastic", value: GeometryCurveBlockTypes.EaseOutElastic },
            { label: "EaseInOutElastic", value: GeometryCurveBlockTypes.EaseInOutElastic },
        ],
    })
], GeometryCurveBlock.prototype, "type", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryCurveBlock", GeometryCurveBlock);
//# sourceMappingURL=geometryCurveBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryDesaturateBlock.js




/**
 * Block used to desaturate a color
 */
class GeometryDesaturateBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryDesaturateBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("color", NodeGeometryBlockConnectionPointTypes.Vector3);
        this.registerInput("level", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Vector3);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryDesaturateBlock";
    }
    /**
     * Gets the color operand input component
     */
    get color() {
        return this._inputs[0];
    }
    /**
     * Gets the level operand input component
     */
    get level() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.color.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => {
            const color = this.color.getConnectedValue(state);
            const level = this.level.getConnectedValue(state);
            const tempMin = Math.min(color.x, color.y, color.z);
            const tempMax = Math.max(color.x, color.y, color.z);
            const tempMerge = 0.5 * (tempMin + tempMax);
            return new math_vector/* Vector3 */.Pq(color.x * (1 - level) + tempMerge * level, color.y * (1 - level) + tempMerge * level, color.z * (1 - level) + tempMerge * level);
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryDesaturateBlock", GeometryDesaturateBlock);
//# sourceMappingURL=geometryDesaturateBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryPosterizeBlock.js




/**
 * Block used to posterize a value
 * @see https://en.wikipedia.org/wiki/Posterization
 */
class GeometryPosterizeBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryPosterizeBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("steps", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[1].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryPosterizeBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the steps input component
     */
    get steps() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.value.isConnected || !this.steps.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => {
            const source = this.value.getConnectedValue(state);
            const steps = this.steps.getConnectedValue(state);
            let stepVector = steps;
            if (this.steps.type === NodeGeometryBlockConnectionPointTypes.Float) {
                switch (this.value.type) {
                    case NodeGeometryBlockConnectionPointTypes.Vector2:
                        stepVector = new math_vector/* Vector2 */.I9(steps, steps);
                        break;
                    case NodeGeometryBlockConnectionPointTypes.Vector3:
                        stepVector = new math_vector/* Vector3 */.Pq(steps, steps, steps);
                        break;
                    case NodeGeometryBlockConnectionPointTypes.Vector4:
                        stepVector = new math_vector/* Vector4 */.IU(steps, steps, steps, steps);
                        break;
                }
            }
            switch (this.value.type) {
                case NodeGeometryBlockConnectionPointTypes.Vector2:
                    return new math_vector/* Vector2 */.I9((source.x / (1.0 / stepVector.x)) * (1.0 / stepVector.x), (source.y / (1.0 / stepVector.y)) * (1.0 / stepVector.y));
                case NodeGeometryBlockConnectionPointTypes.Vector3:
                    return new math_vector/* Vector3 */.Pq((source.x / (1.0 / stepVector.x)) * (1.0 / stepVector.x), (source.y / (1.0 / stepVector.y)) * (1.0 / stepVector.y), (source.z / (1.0 / stepVector.z)) * (1.0 / stepVector.z));
                case NodeGeometryBlockConnectionPointTypes.Vector4:
                    return new math_vector/* Vector4 */.IU((source.x / (1.0 / stepVector.x)) * (1.0 / stepVector.x), (source.y / (1.0 / stepVector.y)) * (1.0 / stepVector.y), (source.z / (1.0 / stepVector.z)) * (1.0 / stepVector.z), (source.w / (1.0 / stepVector.w)) * (1.0 / stepVector.w));
                default:
                    return Math.floor((source / (1.0 / steps)) * (1.0 / steps));
            }
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryPosterizeBlock", GeometryPosterizeBlock);
//# sourceMappingURL=geometryPosterizeBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryReplaceColorBlock.js



/**
 * Block used to replace a color by another one
 */
class GeometryReplaceColorBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryReplaceColorBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("reference", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("distance", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerInput("replacement", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
        this._linkConnectionTypes(0, 1);
        this._linkConnectionTypes(0, 3);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryReplaceColorBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the reference input component
     */
    get reference() {
        return this._inputs[1];
    }
    /**
     * Gets the distance input component
     */
    get distance() {
        return this._inputs[2];
    }
    /**
     * Gets the replacement input component
     */
    get replacement() {
        return this._inputs[3];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.value.isConnected || !this.reference.isConnected || !this.replacement.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => {
            const value = this.value.getConnectedValue(state);
            const reference = this.reference.getConnectedValue(state);
            const distance = this.distance.getConnectedValue(state);
            const replacement = this.replacement.getConnectedValue(state);
            if (value.subtract(reference).length() < distance) {
                return replacement;
            }
            else {
                return value;
            }
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryReplaceColorBlock", GeometryReplaceColorBlock);
//# sourceMappingURL=geometryReplaceColorBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryDistanceBlock.js



/**
 * Block used to get the distance between 2 values
 */
class GeometryDistanceBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryDistanceBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Float);
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryDistanceBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.left.isConnected || !this.right.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => {
            const left = this.left.getConnectedValue(state);
            const right = this.right.getConnectedValue(state);
            return left.subtract(right).length();
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryDistanceBlock", GeometryDistanceBlock);
//# sourceMappingURL=geometryDistanceBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryDotBlock.js



/**
 * Block used to apply a dot product between 2 vectors
 */
class GeometryDotBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryDotBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Float);
        this._linkConnectionTypes(0, 1);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryDotBlock";
    }
    /**
     * Gets the left operand input component
     */
    get left() {
        return this._inputs[0];
    }
    /**
     * Gets the right operand input component
     */
    get right() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.left.isConnected || !this.right.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => {
            const left = this.left.getConnectedValue(state);
            const right = this.right.getConnectedValue(state);
            return left.dot(right);
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryDotBlock", GeometryDotBlock);
//# sourceMappingURL=geometryDotBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryLengthBlock.js



/**
 * Block used to get the length of a vector
 */
class GeometryLengthBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryLengthBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
        this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryLengthBlock";
    }
    /**
     * Gets the value input component
     */
    get value() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.value.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => {
            const value = this.value.getConnectedValue(state);
            return value.length();
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryLengthBlock", GeometryLengthBlock);
//# sourceMappingURL=geometryLengthBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryRotate2dBlock.js




/**
 * Block used to rotate a 2d vector by a given angle
 */
class GeometryRotate2dBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryRotate2dBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        this.registerInput("input", NodeGeometryBlockConnectionPointTypes.Vector2);
        this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Vector2);
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryRotate2dBlock";
    }
    /**
     * Gets the input vector
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the input angle
     */
    get angle() {
        return this._inputs[1];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock() {
        if (!this.input.isConnected) {
            this.output._storedFunction = null;
            this.output._storedValue = null;
            return;
        }
        this.output._storedFunction = (state) => {
            const input = this.input.getConnectedValue(state);
            const angle = this.angle.getConnectedValue(state);
            return new math_vector/* Vector2 */.I9(Math.cos(angle) * input.x - Math.sin(angle) * input.y, Math.sin(angle) * input.x + Math.cos(angle) * input.y);
        };
        return this;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryRotate2dBlock", GeometryRotate2dBlock);
//# sourceMappingURL=geometryRotate2dBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryInterceptorBlock.js




/**
 * Block used to trigger an observable when traversed
 * It can also be used to execute a function when traversed
 */
class GeometryInterceptorBlock extends NodeGeometryBlock {
    /**
     * Creates a new GeometryInterceptorBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Observable triggered when the block is traversed
         */
        this.onInterceptionObservable = new Misc_observable/* Observable */.cP(undefined, true);
        this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[0];
    }
    /**
     * Gets the time spent to build this block (in ms)
     */
    get buildExecutionTime() {
        return -1;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "GeometryInterceptorBlock";
    }
    /**
     * Gets the input component
     */
    get input() {
        return this._inputs[0];
    }
    /**
     * Gets the output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        super._buildBlock(state);
        const output = this._outputs[0];
        const input = this._inputs[0];
        output._storedFunction = (state) => {
            let value = input.getConnectedValue(state);
            if (this.customFunction) {
                value = this.customFunction(value, state);
            }
            this.onInterceptionObservable.notifyObservers(value);
            return value;
        };
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GeometryInterceptorBlock", GeometryInterceptorBlock);
//# sourceMappingURL=geometryInterceptorBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/aggregatorBlock.js






/**
 * Conditions supported by the condition block
 */
var Aggregations;
(function (Aggregations) {
    /** Max */
    Aggregations[Aggregations["Max"] = 0] = "Max";
    /** Min */
    Aggregations[Aggregations["Min"] = 1] = "Min";
    /** Sum */
    Aggregations[Aggregations["Sum"] = 2] = "Sum";
})(Aggregations || (Aggregations = {}));
/**
 * Block used to extract a valuefrom a geometry
 */
class AggregatorBlock extends NodeGeometryBlock {
    /**
     * Create a new SetPositionsBlock
     * @param name defines the block name
     */
    constructor(name) {
        super(name);
        /**
         * Gets or sets the test used by the block
         */
        this.aggregation = Aggregations.Sum;
        /**
         * Gets or sets a boolean indicating that this block can evaluate context
         * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
         */
        this.evaluateContext = true;
        this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
        this.registerInput("source", NodeGeometryBlockConnectionPointTypes.AutoDetect);
        this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
        this._outputs[0]._typeConnectionSource = this._inputs[1];
    }
    /**
     * Gets the current index in the current flow
     * @returns the current index
     */
    getExecutionIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current loop index in the current flow
     * @returns the current loop index
     */
    getExecutionLoopIndex() {
        return this._currentIndex;
    }
    /**
     * Gets the current face index in the current flow
     * @returns the current face index
     */
    getExecutionFaceIndex() {
        return 0;
    }
    /**
     * Gets the current class name
     * @returns the class name
     */
    getClassName() {
        return "AggregatorBlock";
    }
    /**
     * Gets the geometry input component
     */
    get geometry() {
        return this._inputs[0];
    }
    /**
     * Gets the source input component
     */
    get source() {
        return this._inputs[1];
    }
    /**
     * Gets the geometry output component
     */
    get output() {
        return this._outputs[0];
    }
    _buildBlock(state) {
        const func = (state) => {
            state.pushExecutionContext(this);
            this._vertexData = this.geometry.getConnectedValue(state);
            state.pushGeometryContext(this._vertexData);
            if (!this._vertexData || !this._vertexData.positions || !this.source.isConnected) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedValue = null;
                return;
            }
            // Processing
            const vertexCount = this._vertexData.positions.length / 3;
            const context = [];
            for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {
                context.push(this.source.getConnectedValue(state));
            }
            // Aggregation
            let func = null;
            switch (this.aggregation) {
                case Aggregations.Max: {
                    func = (a, b) => Math.max(a, b);
                    break;
                }
                case Aggregations.Min: {
                    func = (a, b) => Math.min(a, b);
                    break;
                }
                case Aggregations.Sum: {
                    func = (a, b) => a + b;
                    break;
                }
            }
            if (!func) {
                state.restoreGeometryContext();
                state.restoreExecutionContext();
                this.output._storedFunction = null;
                this.output._storedValue = null;
                return;
            }
            let returnValue;
            switch (this.source.type) {
                case NodeGeometryBlockConnectionPointTypes.Int:
                case NodeGeometryBlockConnectionPointTypes.Float: {
                    returnValue = context.reduce(func);
                    break;
                }
                case NodeGeometryBlockConnectionPointTypes.Vector2: {
                    const x = context.map((v) => v.x).reduce(func);
                    const y = context.map((v) => v.y).reduce(func);
                    returnValue = new math_vector/* Vector2 */.I9(x, y);
                    break;
                }
                case NodeGeometryBlockConnectionPointTypes.Vector3: {
                    const x = context.map((v) => v.x).reduce(func);
                    const y = context.map((v) => v.y).reduce(func);
                    const z = context.map((v) => v.z).reduce(func);
                    returnValue = new math_vector/* Vector3 */.Pq(x, y, z);
                    break;
                }
                case NodeGeometryBlockConnectionPointTypes.Vector4: {
                    const x = context.map((v) => v.x).reduce(func);
                    const y = context.map((v) => v.y).reduce(func);
                    const z = context.map((v) => v.z).reduce(func);
                    const w = context.map((v) => v.w).reduce(func);
                    returnValue = new math_vector/* Vector4 */.IU(x, y, z, w);
                    break;
                }
            }
            // Storage
            state.restoreGeometryContext();
            state.restoreExecutionContext();
            return returnValue;
        };
        if (this.evaluateContext) {
            this.output._storedFunction = func;
        }
        else {
            this.output._storedFunction = null;
            this.output._storedValue = func(state);
        }
    }
    _dumpPropertiesCode() {
        let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
        codeString += `${this._codeVariableName}.aggregation = BABYLON.Aggregations.${Aggregations[this.aggregation]};\n`;
        return codeString;
    }
    /**
     * Serializes this block in a JSON representation
     * @returns the serialized block object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.evaluateContext = this.evaluateContext;
        serializationObject.aggregation = this.aggregation;
        return serializationObject;
    }
    _deserialize(serializationObject) {
        super._deserialize(serializationObject);
        if (serializationObject.evaluateContext !== undefined) {
            this.evaluateContext = serializationObject.evaluateContext;
        }
        if (serializationObject.aggregation !== undefined) {
            this.aggregation = serializationObject.aggregation;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Aggregation", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
        notifiers: { rebuild: true },
        embedded: true,
        options: [
            { label: "Max", value: Aggregations.Max },
            { label: "Min", value: Aggregations.Min },
            { label: "Sum", value: Aggregations.Sum },
        ],
    })
], AggregatorBlock.prototype, "aggregation", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
], AggregatorBlock.prototype, "evaluateContext", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.AggregatorBlock", AggregatorBlock);
//# sourceMappingURL=aggregatorBlock.js.map
;// ./node_modules/@babylonjs/core/Meshes/Node/index.js




















































































//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Meshes/GaussianSplatting/gaussianSplattingMesh.js
var gaussianSplattingMesh = __webpack_require__(98058);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/color.fragment.js
var ShadersWGSL_color_fragment = __webpack_require__(50861);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/color.vertex.js
var ShadersWGSL_color_vertex = __webpack_require__(84935);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/meshUVSpaceRenderer.vertex.js
var meshUVSpaceRenderer_vertex = __webpack_require__(99764);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/meshUVSpaceRenderer.fragment.js
var meshUVSpaceRenderer_fragment = __webpack_require__(30);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/meshUVSpaceRendererMasker.vertex.js
var meshUVSpaceRendererMasker_vertex = __webpack_require__(54561);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/meshUVSpaceRendererMasker.fragment.js
var meshUVSpaceRendererMasker_fragment = __webpack_require__(78439);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/meshUVSpaceRendererFinaliser.fragment.js
var meshUVSpaceRendererFinaliser_fragment = __webpack_require__(15105);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/meshUVSpaceRendererFinaliser.vertex.js
var meshUVSpaceRendererFinaliser_vertex = __webpack_require__(18507);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/meshUVSpaceRenderer.vertex.js
var ShadersWGSL_meshUVSpaceRenderer_vertex = __webpack_require__(23451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/meshUVSpaceRenderer.fragment.js
var ShadersWGSL_meshUVSpaceRenderer_fragment = __webpack_require__(72657);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/meshUVSpaceRendererMasker.vertex.js
var ShadersWGSL_meshUVSpaceRendererMasker_vertex = __webpack_require__(19226);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/meshUVSpaceRendererMasker.fragment.js
var ShadersWGSL_meshUVSpaceRendererMasker_fragment = __webpack_require__(4044);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/meshUVSpaceRendererFinaliser.fragment.js
var ShadersWGSL_meshUVSpaceRendererFinaliser_fragment = __webpack_require__(29700);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/meshUVSpaceRendererFinaliser.vertex.js
var ShadersWGSL_meshUVSpaceRendererFinaliser_vertex = __webpack_require__(33570);
;// ./node_modules/@babylonjs/core/Meshes/index.js
/* eslint-disable import/export */
/* eslint-disable import/no-internal-modules */


































// eslint-disable-next-line no-duplicate-imports



// LineMesh




// MeshUVSPaceRenderer












//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/andOrNotEvaluator.js
var andOrNotEvaluator = __webpack_require__(33619);
;// ./node_modules/@babylonjs/core/Misc/assetsManager.js









/**
 * Defines the list of states available for a task inside a AssetsManager
 */
var AssetTaskState;
(function (AssetTaskState) {
    /**
     * Initialization
     */
    AssetTaskState[AssetTaskState["INIT"] = 0] = "INIT";
    /**
     * Running
     */
    AssetTaskState[AssetTaskState["RUNNING"] = 1] = "RUNNING";
    /**
     * Done
     */
    AssetTaskState[AssetTaskState["DONE"] = 2] = "DONE";
    /**
     * Error
     */
    AssetTaskState[AssetTaskState["ERROR"] = 3] = "ERROR";
})(AssetTaskState || (AssetTaskState = {}));
/**
 * Define an abstract asset task used with a AssetsManager class to load assets into a scene
 */
class AbstractAssetTask {
    /**
     * Creates a new AssetsManager
     * @param name defines the name of the task
     */
    constructor(
    /**
     * Task name
     */ name) {
        this.name = name;
        this._isCompleted = false;
        this._taskState = 0 /* AssetTaskState.INIT */;
    }
    /**
     * Get if the task is completed
     */
    get isCompleted() {
        return this._isCompleted;
    }
    /**
     * Gets the current state of the task
     */
    get taskState() {
        return this._taskState;
    }
    /**
     * Gets the current error object (if task is in error)
     */
    get errorObject() {
        return this._errorObject;
    }
    /**
     * Internal only
     * @internal
     */
    _setErrorObject(message, exception) {
        if (this._errorObject) {
            return;
        }
        this._errorObject = {
            message: message,
            exception: exception,
        };
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    run(scene, onSuccess, onError) {
        this._taskState = 1 /* AssetTaskState.RUNNING */;
        this.runTask(scene, () => {
            this._onDoneCallback(onSuccess, onError);
        }, (msg, exception) => {
            this._onErrorCallback(onError, msg, exception);
        });
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    runTask(scene, onSuccess, onError) {
        throw new Error("runTask is not implemented");
    }
    /**
     * Reset will set the task state back to INIT, so the next load call of the assets manager will execute this task again.
     * This can be used with failed tasks that have the reason for failure fixed.
     */
    reset() {
        this._taskState = 0 /* AssetTaskState.INIT */;
    }
    _onErrorCallback(onError, message, exception) {
        this._taskState = 3 /* AssetTaskState.ERROR */;
        this._errorObject = {
            message: message,
            exception: exception,
        };
        if (this.onError) {
            this.onError(this, message, exception);
        }
        onError();
    }
    _onDoneCallback(onSuccess, onError) {
        try {
            this._taskState = 2 /* AssetTaskState.DONE */;
            this._isCompleted = true;
            if (this.onSuccess) {
                this.onSuccess(this);
            }
            onSuccess();
        }
        catch (e) {
            this._onErrorCallback(onError, "Task is done, error executing success callback(s)", e);
        }
    }
}
/**
 * Class used to share progress information about assets loading
 */
class AssetsProgressEvent {
    /**
     * Creates a AssetsProgressEvent
     * @param remainingCount defines the number of remaining tasks to process
     * @param totalCount defines the total number of tasks
     * @param task defines the task that was just processed
     */
    constructor(remainingCount, totalCount, task) {
        this.remainingCount = remainingCount;
        this.totalCount = totalCount;
        this.task = task;
    }
}
/**
 * Define a task used by AssetsManager to load assets into a container
 */
class ContainerAssetTask extends AbstractAssetTask {
    /**
     * Creates a new ContainerAssetTask
     * @param name defines the name of the task
     * @param meshesNames defines the list of mesh's names you want to load
     * @param rootUrl defines the root url to use as a base to load your meshes and associated resources
     * @param sceneFilename defines the filename or File of the scene to load from
     * @param extension defines the extension to use to load the scene (if not defined, ".babylon" will be used)
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the list of mesh's names you want to load
     */
    meshesNames, 
    /**
     * Defines the root url to use as a base to load your meshes and associated resources
     */
    rootUrl, 
    /**
     * Defines the filename or File of the scene to load from
     */
    sceneFilename, 
    /**
     * Defines the extension to use to load the scene (if not defined, ".babylon" will be used)
     */
    extension) {
        super(name);
        this.name = name;
        this.meshesNames = meshesNames;
        this.rootUrl = rootUrl;
        this.sceneFilename = sceneFilename;
        this.extension = extension;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        sceneLoader/* SceneLoader */.cn.LoadAssetContainer(this.rootUrl, this.sceneFilename, scene, (container) => {
            this.loadedContainer = container;
            this.loadedMeshes = container.meshes;
            this.loadedTransformNodes = container.transformNodes;
            this.loadedParticleSystems = container.particleSystems;
            this.loadedSkeletons = container.skeletons;
            this.loadedAnimationGroups = container.animationGroups;
            onSuccess();
        }, null, (scene, message, exception) => {
            onError(message, exception);
        }, this.extension);
    }
}
/**
 * Define a task used by AssetsManager to load meshes
 */
class MeshAssetTask extends AbstractAssetTask {
    /**
     * Creates a new MeshAssetTask
     * @param name defines the name of the task
     * @param meshesNames defines the list of mesh's names you want to load
     * @param rootUrl defines the root url to use as a base to load your meshes and associated resources
     * @param sceneFilename defines the filename or File of the scene to load from
     * @param extension defines the extension to use to load the scene (if not defined, ".babylon" will be used)
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the list of mesh's names you want to load
     */
    meshesNames, 
    /**
     * Defines the root url to use as a base to load your meshes and associated resources
     */
    rootUrl, 
    /**
     * Defines the filename or File of the scene to load from
     */
    sceneFilename, 
    /**
     * Defines the extension to use to load the scene (if not defined, ".babylon" will be used)
     */
    extension) {
        super(name);
        this.name = name;
        this.meshesNames = meshesNames;
        this.rootUrl = rootUrl;
        this.sceneFilename = sceneFilename;
        this.extension = extension;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        sceneLoader/* SceneLoader */.cn.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, scene, (meshes, particleSystems, skeletons, animationGroups, transformNodes) => {
            this.loadedMeshes = meshes;
            this.loadedTransformNodes = transformNodes;
            this.loadedParticleSystems = particleSystems;
            this.loadedSkeletons = skeletons;
            this.loadedAnimationGroups = animationGroups;
            onSuccess();
        }, null, (scene, message, exception) => {
            onError(message, exception);
        }, this.extension);
    }
}
/**
 * Define a task used by AssetsManager to load animations
 */
class AnimationAssetTask extends AbstractAssetTask {
    /**
     * Creates a new AnimationAssetTask
     * @param name defines the name of the task
     * @param rootUrl defines the root url to use as a base to load your meshes and associated resources
     * @param filename defines the filename or File of the scene to load from
     * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
     * @param extension defines the extension to use to load the scene (if not defined, ".babylon" will be used)
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the root url to use as a base to load your meshes and associated resources
     */
    rootUrl, 
    /**
     * Defines the filename to load from
     */
    filename, 
    /**
     * Defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
     */
    targetConverter, 
    /**
     * Defines the extension to use to load the scene (if not defined, ".babylon" will be used)
     */
    extension) {
        super(name);
        this.name = name;
        this.rootUrl = rootUrl;
        this.filename = filename;
        this.targetConverter = targetConverter;
        this.extension = extension;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        const startingIndexForNewAnimatables = scene.animatables.length;
        const startingIndexForNewAnimationGroups = scene.animationGroups.length;
        this.loadedAnimatables = [];
        this.loadedAnimationGroups = [];
        sceneLoader/* SceneLoader */.cn.ImportAnimations(this.rootUrl, this.filename, scene, false, 3 /* SceneLoaderAnimationGroupLoadingMode.NoSync */, this.targetConverter, () => {
            this.loadedAnimatables = scene.animatables.slice(startingIndexForNewAnimatables);
            this.loadedAnimationGroups = scene.animationGroups.slice(startingIndexForNewAnimationGroups);
            onSuccess();
        }, null, (scene, message, exception) => {
            onError(message, exception);
        }, this.extension);
    }
}
/**
 * Define a task used by AssetsManager to load text content
 */
class TextFileAssetTask extends AbstractAssetTask {
    /**
     * Creates a new TextFileAssetTask object
     * @param name defines the name of the task
     * @param url defines the location of the file to load
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the location of the file to load
     */
    url) {
        super(name);
        this.name = name;
        this.url = url;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        scene._loadFile(this.url, (data) => {
            this.text = data;
            onSuccess();
        }, undefined, false, false, (request, exception) => {
            if (request) {
                onError(request.status + " " + request.statusText, exception);
            }
        });
    }
}
/**
 * Define a task used by AssetsManager to load binary data
 */
class BinaryFileAssetTask extends AbstractAssetTask {
    /**
     * Creates a new BinaryFileAssetTask object
     * @param name defines the name of the new task
     * @param url defines the location of the file to load
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the location of the file to load
     */
    url) {
        super(name);
        this.name = name;
        this.url = url;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        scene._loadFile(this.url, (data) => {
            this.data = data;
            onSuccess();
        }, undefined, true, true, (request, exception) => {
            if (request) {
                onError(request.status + " " + request.statusText, exception);
            }
        });
    }
}
/**
 * Define a task used by AssetsManager to load images
 */
class ImageAssetTask extends AbstractAssetTask {
    /**
     * Creates a new ImageAssetTask
     * @param name defines the name of the task
     * @param url defines the location of the image to load
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the location of the image to load
     */
    url) {
        super(name);
        this.name = name;
        this.url = url;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        const img = new Image();
        tools/* Tools */.S0.SetCorsBehavior(this.url, img);
        img.onload = () => {
            this.image = img;
            onSuccess();
        };
        img.onerror = (err) => {
            onError("Error loading image", err);
        };
        img.src = this.url;
    }
}
/**
 * Define a task used by AssetsManager to load 2D textures
 */
class TextureAssetTask extends AbstractAssetTask {
    /**
     * Creates a new TextureAssetTask object
     * @param name defines the name of the task
     * @param url defines the location of the file to load
     * @param noMipmap defines if mipmap should not be generated (default is false)
     * @param invertY defines if texture must be inverted on Y axis (default is true)
     * @param samplingMode defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the location of the file to load
     */
    url, 
    /**
     * Defines if mipmap should not be generated (default is false)
     */
    noMipmap, 
    /**
     * [true] Defines if texture must be inverted on Y axis (default is true)
     */
    invertY = true, 
    /**
     * [3] Defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)
     */
    samplingMode = Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE) {
        super(name);
        this.name = name;
        this.url = url;
        this.noMipmap = noMipmap;
        this.invertY = invertY;
        this.samplingMode = samplingMode;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        const onload = () => {
            onSuccess();
        };
        const onerror = (message, exception) => {
            onError(message, exception);
        };
        this.texture = new Textures_texture/* Texture */.g(this.url, scene, this.noMipmap, this.invertY, this.samplingMode, onload, onerror);
    }
}
/**
 * Define a task used by AssetsManager to load cube textures
 */
class CubeTextureAssetTask extends AbstractAssetTask {
    /**
     * Creates a new CubeTextureAssetTask
     * @param name defines the name of the task
     * @param url defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)
     * @param extensions defines the extensions to use to load files (["_px", "_py", "_pz", "_nx", "_ny", "_nz"] by default)
     * @param noMipmap defines if mipmaps should not be generated (default is false)
     * @param files defines the explicit list of files (undefined by default)
     * @param prefiltered
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)
     */
    url, 
    /**
     * Defines the extensions to use to load files (["_px", "_py", "_pz", "_nx", "_ny", "_nz"] by default)
     */
    extensions, 
    /**
     * Defines if mipmaps should not be generated (default is false)
     */
    noMipmap, 
    /**
     * Defines the explicit list of files (undefined by default)
     */
    files, 
    /**
     * Defines the prefiltered texture option (default is false)
     */
    prefiltered) {
        super(name);
        this.name = name;
        this.url = url;
        this.extensions = extensions;
        this.noMipmap = noMipmap;
        this.files = files;
        this.prefiltered = prefiltered;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        const onload = () => {
            onSuccess();
        };
        const onerror = (message, exception) => {
            onError(message, exception);
        };
        this.texture = new Textures_cubeTexture/* CubeTexture */.b(this.url, scene, this.extensions, this.noMipmap, this.files, onload, onerror, undefined, this.prefiltered);
    }
}
/**
 * Define a task used by AssetsManager to load HDR cube textures
 */
class HDRCubeTextureAssetTask extends AbstractAssetTask {
    /**
     * Creates a new HDRCubeTextureAssetTask object
     * @param name defines the name of the task
     * @param url defines the location of the file to load
     * @param size defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.
     * @param noMipmap defines if mipmaps should not be generated (default is false)
     * @param generateHarmonics specifies whether you want to extract the polynomial harmonics during the generation process (default is true)
     * @param gammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)
     * @param reserved Internal use only
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the location of the file to load
     */
    url, 
    /**
     * Defines the desired size (the more it increases the longer the generation will be)
     */
    size, 
    /**
     * [false] Defines if mipmaps should not be generated (default is false)
     */
    noMipmap = false, 
    /**
     * [true] Specifies whether you want to extract the polynomial harmonics during the generation process (default is true)
     */
    generateHarmonics = true, 
    /**
     * [false] Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)
     */
    gammaSpace = false, 
    /**
     * [false] Internal Use Only
     */
    reserved = false) {
        super(name);
        this.name = name;
        this.url = url;
        this.size = size;
        this.noMipmap = noMipmap;
        this.generateHarmonics = generateHarmonics;
        this.gammaSpace = gammaSpace;
        this.reserved = reserved;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        const onload = () => {
            onSuccess();
        };
        const onerror = (message, exception) => {
            onError(message, exception);
        };
        this.texture = new HDRCubeTexture(this.url, scene, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, onload, onerror);
    }
}
/**
 * Define a task used by AssetsManager to load Equirectangular cube textures
 */
class EquiRectangularCubeTextureAssetTask extends AbstractAssetTask {
    /**
     * Creates a new EquiRectangularCubeTextureAssetTask object
     * @param name defines the name of the task
     * @param url defines the location of the file to load
     * @param size defines the desired size (the more it increases the longer the generation will be)
     * If the size is omitted this implies you are using a preprocessed cubemap.
     * @param noMipmap defines if mipmaps should not be generated (default is false)
     * @param gammaSpace specifies if the texture will be used in gamma or linear space
     * (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)
     * (default is true)
     */
    constructor(
    /**
     * Defines the name of the task
     */
    name, 
    /**
     * Defines the location of the file to load
     */
    url, 
    /**
     * Defines the desired size (the more it increases the longer the generation will be)
     */
    size, 
    /**
     * [false] Defines if mipmaps should not be generated (default is false)
     */
    noMipmap = false, 
    /**
     * [true] Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space,
     * but the standard material would require them in Gamma space) (default is true)
     */
    gammaSpace = true) {
        super(name);
        this.name = name;
        this.url = url;
        this.size = size;
        this.noMipmap = noMipmap;
        this.gammaSpace = gammaSpace;
    }
    /**
     * Execute the current task
     * @param scene defines the scene where you want your assets to be loaded
     * @param onSuccess is a callback called when the task is successfully executed
     * @param onError is a callback called if an error occurs
     */
    runTask(scene, onSuccess, onError) {
        const onload = () => {
            onSuccess();
        };
        const onerror = (message, exception) => {
            onError(message, exception);
        };
        this.texture = new EquiRectangularCubeTexture(this.url, scene, this.size, this.noMipmap, this.gammaSpace, onload, onerror);
    }
}
/**
 * This class can be used to easily import assets into a scene
 * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/assetManager
 */
class AssetsManager {
    /**
     * Creates a new AssetsManager
     * @param scene defines the scene to work on
     */
    constructor(scene) {
        this._isLoading = false;
        this._tasks = new Array();
        this._waitingTasksCount = 0;
        this._totalTasksCount = 0;
        /**
         * Observable called when all tasks are processed
         */
        this.onTaskSuccessObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable called when a task had an error
         */
        this.onTaskErrorObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable called when all tasks were executed
         */
        this.onTasksDoneObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable called when a task is done (whatever the result is)
         */
        this.onProgressObservable = new Misc_observable/* Observable */.cP();
        /**
         * Gets or sets a boolean defining if the AssetsManager should use the default loading screen
         * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen
         */
        this.useDefaultLoadingScreen = true;
        /**
         * Gets or sets a boolean defining if the AssetsManager should automatically hide the loading screen
         * when all assets have been downloaded.
         * If set to false, you need to manually call in hideLoadingUI() once your scene is ready.
         */
        this.autoHideLoadingUI = true;
        this._scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
    }
    /**
     * Add a ContainerAssetTask to the list of active tasks
     * @param taskName defines the name of the new task
     * @param meshesNames defines the name of meshes to load
     * @param rootUrl defines the root url to use to locate files
     * @param sceneFilename defines the filename of the scene file or the File itself
     * @param extension defines the extension to use to load the file
     * @returns a new ContainerAssetTask object
     */
    addContainerTask(taskName, meshesNames, rootUrl, sceneFilename, extension) {
        const task = new ContainerAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);
        this._tasks.push(task);
        return task;
    }
    /**
     * Add a MeshAssetTask to the list of active tasks
     * @param taskName defines the name of the new task
     * @param meshesNames defines the name of meshes to load
     * @param rootUrl defines the root url to use to locate files
     * @param sceneFilename defines the filename of the scene file or the File itself
     * @param extension defines the extension to use to load the file
     * @returns a new MeshAssetTask object
     */
    addMeshTask(taskName, meshesNames, rootUrl, sceneFilename, extension) {
        const task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);
        this._tasks.push(task);
        return task;
    }
    /**
     * Add a TextFileAssetTask to the list of active tasks
     * @param taskName defines the name of the new task
     * @param url defines the url of the file to load
     * @returns a new TextFileAssetTask object
     */
    addTextFileTask(taskName, url) {
        const task = new TextFileAssetTask(taskName, url);
        this._tasks.push(task);
        return task;
    }
    /**
     * Add a BinaryFileAssetTask to the list of active tasks
     * @param taskName defines the name of the new task
     * @param url defines the url of the file to load
     * @returns a new BinaryFileAssetTask object
     */
    addBinaryFileTask(taskName, url) {
        const task = new BinaryFileAssetTask(taskName, url);
        this._tasks.push(task);
        return task;
    }
    /**
     * Add a ImageAssetTask to the list of active tasks
     * @param taskName defines the name of the new task
     * @param url defines the url of the file to load
     * @returns a new ImageAssetTask object
     */
    addImageTask(taskName, url) {
        const task = new ImageAssetTask(taskName, url);
        this._tasks.push(task);
        return task;
    }
    /**
     * Add a TextureAssetTask to the list of active tasks
     * @param taskName defines the name of the new task
     * @param url defines the url of the file to load
     * @param noMipmap defines if the texture must not receive mipmaps (false by default)
     * @param invertY defines if you want to invert Y axis of the loaded texture (true by default)
     * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)
     * @returns a new TextureAssetTask object
     */
    addTextureTask(taskName, url, noMipmap, invertY, samplingMode = Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE) {
        const task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode);
        this._tasks.push(task);
        return task;
    }
    /**
     * Add a CubeTextureAssetTask to the list of active tasks
     * @param taskName defines the name of the new task
     * @param url defines the url of the file to load
     * @param extensions defines the extension to use to load the cube map (can be null)
     * @param noMipmap defines if the texture must not receive mipmaps (false by default)
     * @param files defines the list of files to load (can be null)
     * @param prefiltered defines the prefiltered texture option (default is false)
     * @returns a new CubeTextureAssetTask object
     */
    addCubeTextureTask(taskName, url, extensions, noMipmap, files, prefiltered) {
        const task = new CubeTextureAssetTask(taskName, url, extensions, noMipmap, files, prefiltered);
        this._tasks.push(task);
        return task;
    }
    /**
     *
     * Add a HDRCubeTextureAssetTask to the list of active tasks
     * @param taskName defines the name of the new task
     * @param url defines the url of the file to load
     * @param size defines the size you want for the cubemap (can be null)
     * @param noMipmap defines if the texture must not receive mipmaps (false by default)
     * @param generateHarmonics defines if you want to automatically generate (true by default)
     * @param gammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)
     * @param reserved Internal use only
     * @returns a new HDRCubeTextureAssetTask object
     */
    addHDRCubeTextureTask(taskName, url, size, noMipmap = false, generateHarmonics = true, gammaSpace = false, reserved = false) {
        const task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, gammaSpace, reserved);
        this._tasks.push(task);
        return task;
    }
    /**
     *
     * Add a EquiRectangularCubeTextureAssetTask to the list of active tasks
     * @param taskName defines the name of the new task
     * @param url defines the url of the file to load
     * @param size defines the size you want for the cubemap (can be null)
     * @param noMipmap defines if the texture must not receive mipmaps (false by default)
     * @param gammaSpace Specifies if the texture will be used in gamma or linear space
     * (the PBR material requires those textures in linear space, but the standard material would require them in Gamma space)
     * @returns a new EquiRectangularCubeTextureAssetTask object
     */
    addEquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap = false, gammaSpace = true) {
        const task = new EquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap, gammaSpace);
        this._tasks.push(task);
        return task;
    }
    /**
     * Remove a task from the assets manager.
     * @param task the task to remove
     */
    removeTask(task) {
        const index = this._tasks.indexOf(task);
        if (index > -1) {
            this._tasks.splice(index, 1);
        }
    }
    _decreaseWaitingTasksCount(task) {
        this._waitingTasksCount--;
        try {
            if (this.onProgress) {
                this.onProgress(this._waitingTasksCount, this._totalTasksCount, task);
            }
            this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this._waitingTasksCount, this._totalTasksCount, task));
        }
        catch (e) {
            logger/* Logger */.V.Error("Error running progress callbacks.");
            logger/* Logger */.V.Log(e);
        }
        if (this._waitingTasksCount === 0) {
            try {
                const currentTasks = this._tasks.slice();
                if (this.onFinish) {
                    // Calling onFinish with immutable array of tasks
                    this.onFinish(currentTasks);
                }
                // Let's remove successful tasks
                for (const task of currentTasks) {
                    if (task.taskState === 2 /* AssetTaskState.DONE */) {
                        const index = this._tasks.indexOf(task);
                        if (index > -1) {
                            this._tasks.splice(index, 1);
                        }
                    }
                }
                this.onTasksDoneObservable.notifyObservers(this._tasks);
            }
            catch (e) {
                logger/* Logger */.V.Error("Error running tasks-done callbacks.");
                logger/* Logger */.V.Log(e);
            }
            this._isLoading = false;
            if (this.autoHideLoadingUI) {
                this._scene.getEngine().hideLoadingUI();
            }
        }
    }
    _runTask(task) {
        const done = () => {
            try {
                if (this.onTaskSuccess) {
                    this.onTaskSuccess(task);
                }
                this.onTaskSuccessObservable.notifyObservers(task);
                this._decreaseWaitingTasksCount(task);
            }
            catch (e) {
                error("Error executing task success callbacks", e);
            }
        };
        const error = (message, exception) => {
            task._setErrorObject(message, exception);
            if (this.onTaskError) {
                this.onTaskError(task);
            }
            else if (!task.onError) {
                logger/* Logger */.V.Error(this._formatTaskErrorMessage(task));
            }
            this.onTaskErrorObservable.notifyObservers(task);
            this._decreaseWaitingTasksCount(task);
        };
        task.run(this._scene, done, error);
    }
    _formatTaskErrorMessage(task) {
        let errorMessage = "Unable to complete task " + task.name;
        if (task.errorObject.message) {
            errorMessage += `: ${task.errorObject.message}`;
        }
        if (task.errorObject.exception) {
            errorMessage += `: ${task.errorObject.exception}`;
        }
        return errorMessage;
    }
    /**
     * Reset the AssetsManager and remove all tasks
     * @returns the current instance of the AssetsManager
     */
    reset() {
        this._isLoading = false;
        this._tasks = new Array();
        return this;
    }
    /**
     * Start the loading process
     * @returns the current instance of the AssetsManager
     */
    load() {
        if (this._isLoading) {
            return this;
        }
        this._isLoading = true;
        this._waitingTasksCount = this._tasks.length;
        this._totalTasksCount = this._tasks.length;
        if (this._waitingTasksCount === 0) {
            this._isLoading = false;
            if (this.onFinish) {
                this.onFinish(this._tasks);
            }
            this.onTasksDoneObservable.notifyObservers(this._tasks);
            return this;
        }
        if (this.useDefaultLoadingScreen) {
            this._scene.getEngine().displayLoadingUI();
        }
        for (let index = 0; index < this._tasks.length; index++) {
            const task = this._tasks[index];
            if (task.taskState === 0 /* AssetTaskState.INIT */) {
                this._runTask(task);
            }
        }
        return this;
    }
    /**
     * Start the loading process as an async operation
     * @returns a promise returning the list of failed tasks
     */
    loadAsync() {
        return new Promise((resolve, reject) => {
            if (this._isLoading) {
                resolve();
                return;
            }
            this.onTasksDoneObservable.addOnce((remainingTasks) => {
                if (remainingTasks && remainingTasks.length) {
                    reject(remainingTasks);
                }
                else {
                    resolve();
                }
            });
            this.load();
        });
    }
}
//# sourceMappingURL=assetsManager.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/basis.js + 1 modules
var basis = __webpack_require__(59057);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/dds.js
var dds = __webpack_require__(36464);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/deferred.js
var Misc_deferred = __webpack_require__(39018);
;// ./node_modules/@babylonjs/core/Misc/meshExploder.js

/**
 * Class used to explode meshes (ie. to have a center and move them away from that center to better see the overall organization)
 */
class MeshExploder {
    /**
     * Explodes meshes from a center mesh.
     * @param meshes The meshes to explode.
     * @param centerMesh The mesh to be center of explosion.
     */
    constructor(meshes, centerMesh) {
        this._meshesOrigins = [];
        this._toCenterVectors = [];
        this._scaledDirection = new math_vector/* Vector3 */.Pq(1, 1, 1);
        this._newPosition = math_vector/* Vector3 */.Pq.Zero();
        this._centerPosition = math_vector/* Vector3 */.Pq.Zero();
        this._meshes = meshes.slice();
        if (centerMesh) {
            this._centerMesh = centerMesh;
        }
        else {
            this._setCenterMesh();
        }
        this._centerMesh.computeWorldMatrix(true);
        const centerMeshIndex = this._meshes.indexOf(this._centerMesh);
        if (centerMeshIndex >= 0) {
            this._meshes.splice(centerMeshIndex, 1);
        }
        this._centerPosition = this._centerMesh.getAbsolutePosition().clone();
        for (let index = 0; index < this._meshes.length; index++) {
            if (this._meshes[index]) {
                const mesh = this._meshes[index];
                this._meshesOrigins[index] = mesh.getAbsolutePosition().clone();
                this._toCenterVectors[index] = math_vector/* Vector3 */.Pq.Zero();
                if (mesh.hasBoundingInfo && this._centerMesh.hasBoundingInfo) {
                    mesh.computeWorldMatrix(true);
                    mesh.getBoundingInfo().boundingBox.centerWorld.subtractToRef(this._centerMesh.getBoundingInfo().boundingBox.centerWorld, this._toCenterVectors[index]);
                }
            }
        }
    }
    _setCenterMesh() {
        let averageCenter = math_vector/* Vector3 */.Pq.Zero();
        const totalCenters = math_vector/* Vector3 */.Pq.Zero();
        let shortestToCenter = Number.MAX_VALUE;
        for (let index = 0; index < this._meshes.length; index++) {
            if (this._meshes[index]) {
                const mesh = this._meshes[index];
                const boundingInfo = mesh.getBoundingInfo();
                if (boundingInfo) {
                    totalCenters.addInPlace(boundingInfo.boundingBox.centerWorld);
                }
            }
        }
        averageCenter = totalCenters.scale(1 / this._meshes.length);
        for (let index = 0; index < this._meshes.length; index++) {
            if (this._meshes[index]) {
                const mesh = this._meshes[index];
                const boundingInfo = mesh.getBoundingInfo();
                if (boundingInfo) {
                    const distanceToCenter = boundingInfo.boundingBox.centerWorld.subtract(averageCenter).lengthSquared();
                    if (distanceToCenter < shortestToCenter) {
                        this._centerMesh = mesh;
                        shortestToCenter = distanceToCenter;
                    }
                }
            }
        }
    }
    /**
     * Get class name
     * @returns "MeshExploder"
     */
    getClassName() {
        return "MeshExploder";
    }
    /**
     * "Exploded meshes"
     * @returns Array of meshes with the centerMesh at index 0.
     */
    getMeshes() {
        const meshArray = this._meshes.slice();
        meshArray.unshift(this._centerMesh);
        return meshArray;
    }
    /**
     * Explodes meshes giving a specific direction
     * @param direction Number to multiply distance of each mesh's origin from center. Use a negative number to implode, or zero to reset.
     */
    explode(direction = 1.0) {
        for (let index = 0; index < this._meshes.length; index++) {
            if (this._meshes[index] && this._meshesOrigins[index] && this._toCenterVectors[index]) {
                this._toCenterVectors[index].scaleToRef(direction, this._scaledDirection);
                this._meshesOrigins[index].addToRef(this._scaledDirection, this._newPosition);
                this._meshes[index].setAbsolutePosition(this._newPosition);
            }
        }
        this._centerMesh.setAbsolutePosition(this._centerPosition);
    }
}
//# sourceMappingURL=meshExploder.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/filesInputStore.js
var filesInputStore = __webpack_require__(60715);
;// ./node_modules/@babylonjs/core/Misc/filesInput.js



/**
 * Class used to help managing file picking and drag-n-drop
 */
class FilesInput {
    /**
     * List of files ready to be loaded
     */
    static get FilesToLoad() {
        return filesInputStore/* FilesInputStore */.T.FilesToLoad;
    }
    /**
     * Creates a new FilesInput
     * @param engine defines the rendering engine
     * @param scene defines the hosting scene
     * @param sceneLoadedCallback callback called when scene (files provided) is loaded
     * @param progressCallback callback called to track progress
     * @param additionalRenderLoopLogicCallback callback called to add user logic to the rendering loop
     * @param textureLoadingCallback callback called when a texture is loading
     * @param startingProcessingFilesCallback callback called when the system is about to process all files
     * @param onReloadCallback callback called when a reload is requested
     * @param errorCallback callback call if an error occurs
     * @param useAppend defines if the file loaded must be appended (true) or have the scene replaced (false, default behavior)
     */
    constructor(engine, scene, sceneLoadedCallback, progressCallback, additionalRenderLoopLogicCallback, textureLoadingCallback, startingProcessingFilesCallback, onReloadCallback, errorCallback, useAppend = false) {
        this.useAppend = useAppend;
        /**
         * Callback called when a file is processed
         * @returns false to abort the process
         */
        this.onProcessFileCallback = () => {
            return true;
        };
        /**
         * If a loading UI should be displayed while loading a file
         */
        this.displayLoadingUI = true;
        /**
         * Function used when loading the scene file
         * @param sceneFile defines the file to load
         * @param onProgress onProgress callback called while loading the file
         * @returns a promise completing when the load is complete
         */
        this.loadAsync = (sceneFile, onProgress) => this.useAppend ? sceneLoader/* SceneLoader */.cn.AppendAsync("file:", sceneFile, this._currentScene, onProgress) : sceneLoader/* SceneLoader */.cn.LoadAsync("file:", sceneFile, this._engine, onProgress);
        this._engine = engine;
        this._currentScene = scene;
        this._sceneLoadedCallback = sceneLoadedCallback;
        this._progressCallback = progressCallback;
        this._additionalRenderLoopLogicCallback = additionalRenderLoopLogicCallback;
        this._textureLoadingCallback = textureLoadingCallback;
        this._startingProcessingFilesCallback = startingProcessingFilesCallback;
        this._onReloadCallback = onReloadCallback;
        this._errorCallback = errorCallback;
    }
    /**
     * Calls this function to listen to drag'n'drop events on a specific DOM element
     * @param elementToMonitor defines the DOM element to track
     */
    monitorElementForDragNDrop(elementToMonitor) {
        if (elementToMonitor) {
            this._elementToMonitor = elementToMonitor;
            this._dragEnterHandler = (e) => {
                this._drag(e);
            };
            this._dragOverHandler = (e) => {
                this._drag(e);
            };
            this._dropHandler = (e) => {
                this._drop(e);
            };
            this._elementToMonitor.addEventListener("dragenter", this._dragEnterHandler, false);
            this._elementToMonitor.addEventListener("dragover", this._dragOverHandler, false);
            this._elementToMonitor.addEventListener("drop", this._dropHandler, false);
        }
    }
    /** Gets the current list of files to load */
    get filesToLoad() {
        return this._filesToLoad;
    }
    /**
     * Release all associated resources
     */
    dispose() {
        if (!this._elementToMonitor) {
            return;
        }
        this._elementToMonitor.removeEventListener("dragenter", this._dragEnterHandler);
        this._elementToMonitor.removeEventListener("dragover", this._dragOverHandler);
        this._elementToMonitor.removeEventListener("drop", this._dropHandler);
    }
    _renderFunction() {
        if (this._additionalRenderLoopLogicCallback) {
            this._additionalRenderLoopLogicCallback();
        }
        if (this._currentScene) {
            if (this._textureLoadingCallback) {
                const remaining = this._currentScene.getWaitingItemsCount();
                if (remaining > 0) {
                    this._textureLoadingCallback(remaining);
                }
            }
            this._currentScene.render();
        }
    }
    _drag(e) {
        e.stopPropagation();
        e.preventDefault();
    }
    _drop(eventDrop) {
        eventDrop.stopPropagation();
        eventDrop.preventDefault();
        this.loadFiles(eventDrop);
    }
    _traverseFolder(folder, files, remaining, callback) {
        const reader = folder.createReader();
        const relativePath = folder.fullPath.replace(/^\//, "").replace(/(.+?)\/?$/, "$1/");
        reader.readEntries((entries) => {
            remaining.count += entries.length;
            for (const entry of entries) {
                if (entry.isFile) {
                    entry.file((file) => {
                        file.correctName = relativePath + file.name;
                        files.push(file);
                        if (--remaining.count === 0) {
                            callback();
                        }
                    });
                }
                else if (entry.isDirectory) {
                    this._traverseFolder(entry, files, remaining, callback);
                }
            }
            if (--remaining.count === 0) {
                callback();
            }
        });
    }
    _processFiles(files) {
        for (let i = 0; i < files.length; i++) {
            const name = files[i].correctName.toLowerCase();
            const extension = name.split(".").pop();
            if (!this.onProcessFileCallback(files[i], name, extension, (sceneFile) => (this._sceneFileToLoad = sceneFile))) {
                continue;
            }
            if (sceneLoader/* SceneLoader */.cn.IsPluginForExtensionAvailable("." + extension)) {
                this._sceneFileToLoad = files[i];
            }
            FilesInput.FilesToLoad[name] = files[i];
        }
    }
    /**
     * Load files from a drop event
     * @param event defines the drop event to use as source
     */
    loadFiles(event) {
        // Handling data transfer via drag'n'drop
        if (event && event.dataTransfer && event.dataTransfer.files) {
            this._filesToLoad = event.dataTransfer.files;
        }
        // Handling files from input files
        if (event && event.target && event.target.files) {
            this._filesToLoad = event.target.files;
        }
        if (!this._filesToLoad || this._filesToLoad.length === 0) {
            return;
        }
        if (this._startingProcessingFilesCallback) {
            this._startingProcessingFilesCallback(this._filesToLoad);
        }
        if (this._filesToLoad && this._filesToLoad.length > 0) {
            const files = [];
            const folders = [];
            const items = event.dataTransfer ? event.dataTransfer.items : null;
            for (let i = 0; i < this._filesToLoad.length; i++) {
                const fileToLoad = this._filesToLoad[i];
                const name = fileToLoad.name.toLowerCase();
                let entry;
                fileToLoad.correctName = name;
                if (items) {
                    const item = items[i];
                    if (item.getAsEntry) {
                        entry = item.getAsEntry();
                    }
                    else if (item.webkitGetAsEntry) {
                        entry = item.webkitGetAsEntry();
                    }
                }
                if (!entry) {
                    files.push(fileToLoad);
                }
                else {
                    if (entry.isDirectory) {
                        folders.push(entry);
                    }
                    else {
                        files.push(fileToLoad);
                    }
                }
            }
            if (folders.length === 0) {
                this._processFiles(files);
                this._processReload();
            }
            else {
                const remaining = { count: folders.length };
                for (const folder of folders) {
                    this._traverseFolder(folder, files, remaining, () => {
                        this._processFiles(files);
                        if (remaining.count === 0) {
                            this._processReload();
                        }
                    });
                }
            }
        }
    }
    _processReload() {
        if (this._onReloadCallback) {
            this._onReloadCallback(this._sceneFileToLoad);
        }
        else {
            this.reload();
        }
    }
    /**
     * Reload the current scene from the loaded files
     */
    reload() {
        // If a scene file has been provided
        if (this._sceneFileToLoad) {
            if (!this.useAppend) {
                if (this._currentScene) {
                    if (logger/* Logger */.V.errorsCount > 0) {
                        logger/* Logger */.V.ClearLogCache();
                    }
                    this._engine.stopRenderLoop();
                }
            }
            sceneLoader/* SceneLoader */.cn.ShowLoadingScreen = false;
            if (this.displayLoadingUI) {
                this._engine.displayLoadingUI();
            }
            this.loadAsync(this._sceneFileToLoad, this._progressCallback)
                .then((scene) => {
                // if appending do nothing
                if (!this.useAppend) {
                    if (this._currentScene) {
                        this._currentScene.dispose();
                    }
                    this._currentScene = scene;
                    // Wait for textures and shaders to be ready
                    this._currentScene.executeWhenReady(() => {
                        if (this.displayLoadingUI) {
                            this._engine.hideLoadingUI();
                        }
                        this._engine.runRenderLoop(() => {
                            this._renderFunction();
                        });
                    });
                }
                else {
                    if (this.displayLoadingUI) {
                        this._engine.hideLoadingUI();
                    }
                }
                if (this._sceneLoadedCallback && this._currentScene) {
                    this._sceneLoadedCallback(this._sceneFileToLoad, this._currentScene);
                }
            })
                .catch((error) => {
                if (this.displayLoadingUI) {
                    this._engine.hideLoadingUI();
                }
                if (this._errorCallback) {
                    this._errorCallback(this._sceneFileToLoad, this._currentScene, error.message);
                }
            });
        }
        else {
            if (this._filesToLoad.length === 1) {
                const name = this._filesToLoad[0].name.toLowerCase();
                const extension = name.split(".").pop();
                if (extension) {
                    switch (extension.toLowerCase()) {
                        case "dds":
                        case "env":
                        case "hdr": {
                            return; // Ignore error in that case
                        }
                    }
                }
            }
            logger/* Logger */.V.Error("Please provide a valid .babylon file.");
        }
    }
}
//# sourceMappingURL=filesInput.js.map
;// ./node_modules/@babylonjs/core/Misc/HighDynamicRange/index.js



//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/khronosTextureContainer.js
var khronosTextureContainer = __webpack_require__(6443);
;// ./node_modules/@babylonjs/core/Misc/observable.extensions.js

/**
 * Represent a list of observers registered to multiple Observables object.
 */
class MultiObserver {
    /**
     * Release associated resources
     */
    dispose() {
        if (this._observers && this._observables) {
            for (let index = 0; index < this._observers.length; index++) {
                this._observables[index].remove(this._observers[index]);
            }
        }
        this._observers = null;
        this._observables = null;
    }
    /**
     * Raise a callback when one of the observable will notify
     * @param observables defines a list of observables to watch
     * @param callback defines the callback to call on notification
     * @param mask defines the mask used to filter notifications
     * @param scope defines the current scope used to restore the JS context
     * @returns the new MultiObserver
     */
    static Watch(observables, callback, mask = -1, scope = null) {
        const result = new MultiObserver();
        result._observers = new Array();
        result._observables = observables;
        for (const observable of observables) {
            const observer = observable.add(callback, mask, false, scope);
            if (observer) {
                result._observers.push(observer);
            }
        }
        return result;
    }
}
Misc_observable/* Observable */.cP.prototype.notifyObserversWithPromise = async function (eventData, mask = -1, target, currentTarget, userInfo) {
    // create an empty promise
    let p = Promise.resolve(eventData);
    // no observers? return this promise.
    if (!this.observers.length) {
        return p;
    }
    const state = this._eventState;
    state.mask = mask;
    state.target = target;
    state.currentTarget = currentTarget;
    state.skipNextObservers = false;
    state.userInfo = userInfo;
    // execute one callback after another (not using Promise.all, the order is important)
    this.observers.forEach((obs) => {
        if (state.skipNextObservers) {
            return;
        }
        if (obs._willBeUnregistered) {
            return;
        }
        if (obs.mask & mask) {
            if (obs.scope) {
                p = p.then((lastReturnedValue) => {
                    state.lastReturnValue = lastReturnedValue;
                    return obs.callback.apply(obs.scope, [eventData, state]);
                });
            }
            else {
                p = p.then((lastReturnedValue) => {
                    state.lastReturnValue = lastReturnedValue;
                    return obs.callback(eventData, state);
                });
            }
            if (obs.unregisterOnNextCall) {
                this._deferUnregister(obs);
            }
        }
    });
    // return the eventData
    await p;
    return eventData;
};
//# sourceMappingURL=observable.extensions.js.map
;// ./node_modules/@babylonjs/core/Misc/sceneOptimizer.js



/**
 * Defines the root class used to create scene optimization to use with SceneOptimizer
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class SceneOptimization {
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        return "";
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer) {
        return true;
    }
    /**
     * Creates the SceneOptimization object
     * @param priority defines the priority of this optimization (0 by default which means first in the list)
     */
    constructor(
    /**
     * [0] Defines the priority of this optimization (0 by default which means first in the list)
     */
    priority = 0) {
        this.priority = priority;
    }
}
/**
 * Defines an optimization used to reduce the size of render target textures
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class TextureOptimization extends SceneOptimization {
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        return "Reducing render target texture size to " + this.maximumSize;
    }
    /**
     * Creates the TextureOptimization object
     * @param priority defines the priority of this optimization (0 by default which means first in the list)
     * @param maximumSize defines the maximum sized allowed for textures (1024 is the default value). If a texture is bigger, it will be scaled down using a factor defined by the step parameter
     * @param step defines the factor (0.5 by default) used to scale down textures bigger than maximum sized allowed.
     */
    constructor(
    /**
     * [0] Defines the priority of this optimization (0 by default which means first in the list)
     */
    priority = 0, 
    /**
     * [1024] Defines the maximum sized allowed for textures (1024 is the default value). If a texture is bigger, it will be scaled down using a factor defined by the step parameter
     */
    maximumSize = 1024, 
    /**
     * [0.5] Defines the factor (0.5 by default) used to scale down textures bigger than maximum sized allowed.
     */
    step = 0.5) {
        super(priority);
        this.priority = priority;
        this.maximumSize = maximumSize;
        this.step = step;
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer) {
        let allDone = true;
        for (let index = 0; index < scene.textures.length; index++) {
            const texture = scene.textures[index];
            if (!texture.canRescale || texture.getContext) {
                continue;
            }
            const currentSize = texture.getSize();
            const maxDimension = Math.max(currentSize.width, currentSize.height);
            if (maxDimension > this.maximumSize) {
                texture.scale(this.step);
                allDone = false;
            }
        }
        return allDone;
    }
}
/**
 * Defines an optimization used to increase or decrease the rendering resolution
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class HardwareScalingOptimization extends SceneOptimization {
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        return "Setting hardware scaling level to " + this._currentScale;
    }
    /**
     * Creates the HardwareScalingOptimization object
     * @param priority defines the priority of this optimization (0 by default which means first in the list)
     * @param maximumScale defines the maximum scale to use (2 by default)
     * @param step defines the step to use between two passes (0.5 by default)
     */
    constructor(
    /**
     * [0] Defines the priority of this optimization (0 by default which means first in the list)
     */
    priority = 0, 
    /**
     * [2] Defines the maximum scale to use (2 by default)
     */
    maximumScale = 2, 
    /**
     * [0.25] Defines the step to use between two passes (0.5 by default)
     */
    step = 0.25) {
        super(priority);
        this.priority = priority;
        this.maximumScale = maximumScale;
        this.step = step;
        this._currentScale = -1;
        this._directionOffset = 1;
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer) {
        if (this._currentScale === -1) {
            this._currentScale = scene.getEngine().getHardwareScalingLevel();
            if (this._currentScale > this.maximumScale) {
                this._directionOffset = -1;
            }
        }
        this._currentScale += this._directionOffset * this.step;
        scene.getEngine().setHardwareScalingLevel(this._currentScale);
        return this._directionOffset === 1 ? this._currentScale >= this.maximumScale : this._currentScale <= this.maximumScale;
    }
}
/**
 * Defines an optimization used to remove shadows
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class ShadowsOptimization extends SceneOptimization {
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        return "Turning shadows on/off";
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer) {
        scene.shadowsEnabled = optimizer.isInImprovementMode;
        return true;
    }
}
/**
 * Defines an optimization used to turn post-processes off
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class PostProcessesOptimization extends SceneOptimization {
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        return "Turning post-processes on/off";
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer) {
        scene.postProcessesEnabled = optimizer.isInImprovementMode;
        return true;
    }
}
/**
 * Defines an optimization used to turn lens flares off
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class LensFlaresOptimization extends SceneOptimization {
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        return "Turning lens flares on/off";
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer) {
        scene.lensFlaresEnabled = optimizer.isInImprovementMode;
        return true;
    }
}
/**
 * Defines an optimization based on user defined callback.
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class CustomOptimization extends SceneOptimization {
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        if (this.onGetDescription) {
            return this.onGetDescription();
        }
        return "Running user defined callback";
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer) {
        if (this.onApply) {
            return this.onApply(scene, optimizer);
        }
        return true;
    }
}
/**
 * Defines an optimization used to turn particles off
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class ParticlesOptimization extends SceneOptimization {
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        return "Turning particles on/off";
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer) {
        scene.particlesEnabled = optimizer.isInImprovementMode;
        return true;
    }
}
/**
 * Defines an optimization used to turn render targets off
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class RenderTargetsOptimization extends SceneOptimization {
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        return "Turning render targets off";
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer) {
        scene.renderTargetsEnabled = optimizer.isInImprovementMode;
        return true;
    }
}
/**
 * Defines an optimization used to merge meshes with compatible materials
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class MergeMeshesOptimization extends SceneOptimization {
    constructor() {
        super(...arguments);
        this._canBeMerged = (abstractMesh) => {
            if (!(abstractMesh instanceof Meshes_mesh/* Mesh */.e)) {
                return false;
            }
            const mesh = abstractMesh;
            if (mesh.isDisposed()) {
                return false;
            }
            if (!mesh.isVisible || !mesh.isEnabled()) {
                return false;
            }
            if (mesh.instances.length > 0) {
                return false;
            }
            if (mesh.skeleton || mesh.hasLODLevels) {
                return false;
            }
            if (mesh.getTotalVertices() === 0) {
                return false;
            }
            return true;
        };
    }
    /**
     * Gets or sets a boolean which defines if optimization octree has to be updated
     */
    static get UpdateSelectionTree() {
        return MergeMeshesOptimization._UpdateSelectionTree;
    }
    /**
     * Gets or sets a boolean which defines if optimization octree has to be updated
     */
    static set UpdateSelectionTree(value) {
        MergeMeshesOptimization._UpdateSelectionTree = value;
    }
    /**
     * Gets a string describing the action executed by the current optimization
     * @returns description string
     */
    getDescription() {
        return "Merging similar meshes together";
    }
    /**
     * This function will be called by the SceneOptimizer when its priority is reached in order to apply the change required by the current optimization
     * @param scene defines the current scene where to apply this optimization
     * @param optimizer defines the current optimizer
     * @param updateSelectionTree defines that the selection octree has to be updated (false by default)
     * @returns true if everything that can be done was applied
     */
    apply(scene, optimizer, updateSelectionTree) {
        const globalPool = scene.meshes.slice(0);
        let globalLength = globalPool.length;
        for (let index = 0; index < globalLength; index++) {
            const currentPool = [];
            const current = globalPool[index];
            // Checks
            if (!this._canBeMerged(current)) {
                continue;
            }
            currentPool.push(current);
            // Find compatible meshes
            for (let subIndex = index + 1; subIndex < globalLength; subIndex++) {
                const otherMesh = globalPool[subIndex];
                if (!this._canBeMerged(otherMesh)) {
                    continue;
                }
                if (otherMesh.material !== current.material) {
                    continue;
                }
                if (otherMesh.checkCollisions !== current.checkCollisions) {
                    continue;
                }
                currentPool.push(otherMesh);
                globalLength--;
                globalPool.splice(subIndex, 1);
                subIndex--;
            }
            if (currentPool.length < 2) {
                continue;
            }
            // Merge meshes
            Meshes_mesh/* Mesh */.e.MergeMeshes(currentPool, undefined, true);
        }
        // Call the octree system optimization if it is defined.
        const sceneAsAny = scene;
        if (sceneAsAny.createOrUpdateSelectionOctree) {
            if (updateSelectionTree != undefined) {
                if (updateSelectionTree) {
                    sceneAsAny.createOrUpdateSelectionOctree();
                }
            }
            else if (MergeMeshesOptimization.UpdateSelectionTree) {
                sceneAsAny.createOrUpdateSelectionOctree();
            }
        }
        return true;
    }
}
MergeMeshesOptimization._UpdateSelectionTree = false;
/**
 * Defines a list of options used by SceneOptimizer
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class SceneOptimizerOptions {
    /**
     * Creates a new list of options used by SceneOptimizer
     * @param targetFrameRate defines the target frame rate to reach (60 by default)
     * @param trackerDuration defines the interval between two checks (2000ms by default)
     */
    constructor(
    /**
     * [60] Defines the target frame rate to reach (60 by default)
     */
    targetFrameRate = 60, 
    /**
     * [2000] Defines the interval between two checks (2000ms by default)
     */
    trackerDuration = 2000) {
        this.targetFrameRate = targetFrameRate;
        this.trackerDuration = trackerDuration;
        /**
         * Gets the list of optimizations to apply
         */
        this.optimizations = [];
    }
    /**
     * Add a new optimization
     * @param optimization defines the SceneOptimization to add to the list of active optimizations
     * @returns the current SceneOptimizerOptions
     */
    addOptimization(optimization) {
        this.optimizations.push(optimization);
        return this;
    }
    /**
     * Add a new custom optimization
     * @param onApply defines the callback called to apply the custom optimization (true if everything that can be done was applied)
     * @param onGetDescription defines the callback called to get the description attached with the optimization.
     * @param priority defines the priority of this optimization (0 by default which means first in the list)
     * @returns the current SceneOptimizerOptions
     */
    addCustomOptimization(onApply, onGetDescription, priority = 0) {
        const optimization = new CustomOptimization(priority);
        optimization.onApply = onApply;
        optimization.onGetDescription = onGetDescription;
        this.optimizations.push(optimization);
        return this;
    }
    /**
     * Creates a list of pre-defined optimizations aimed to reduce the visual impact on the scene
     * @param targetFrameRate defines the target frame rate (60 by default)
     * @returns a SceneOptimizerOptions object
     */
    static LowDegradationAllowed(targetFrameRate) {
        const result = new SceneOptimizerOptions(targetFrameRate);
        let priority = 0;
        result.addOptimization(new MergeMeshesOptimization(priority));
        result.addOptimization(new ShadowsOptimization(priority));
        result.addOptimization(new LensFlaresOptimization(priority));
        // Next priority
        priority++;
        result.addOptimization(new PostProcessesOptimization(priority));
        result.addOptimization(new ParticlesOptimization(priority));
        // Next priority
        priority++;
        result.addOptimization(new TextureOptimization(priority, 1024));
        return result;
    }
    /**
     * Creates a list of pre-defined optimizations aimed to have a moderate impact on the scene visual
     * @param targetFrameRate defines the target frame rate (60 by default)
     * @returns a SceneOptimizerOptions object
     */
    static ModerateDegradationAllowed(targetFrameRate) {
        const result = new SceneOptimizerOptions(targetFrameRate);
        let priority = 0;
        result.addOptimization(new MergeMeshesOptimization(priority));
        result.addOptimization(new ShadowsOptimization(priority));
        result.addOptimization(new LensFlaresOptimization(priority));
        // Next priority
        priority++;
        result.addOptimization(new PostProcessesOptimization(priority));
        result.addOptimization(new ParticlesOptimization(priority));
        // Next priority
        priority++;
        result.addOptimization(new TextureOptimization(priority, 512));
        // Next priority
        priority++;
        result.addOptimization(new RenderTargetsOptimization(priority));
        // Next priority
        priority++;
        result.addOptimization(new HardwareScalingOptimization(priority, 2));
        return result;
    }
    /**
     * Creates a list of pre-defined optimizations aimed to have a big impact on the scene visual
     * @param targetFrameRate defines the target frame rate (60 by default)
     * @returns a SceneOptimizerOptions object
     */
    static HighDegradationAllowed(targetFrameRate) {
        const result = new SceneOptimizerOptions(targetFrameRate);
        let priority = 0;
        result.addOptimization(new MergeMeshesOptimization(priority));
        result.addOptimization(new ShadowsOptimization(priority));
        result.addOptimization(new LensFlaresOptimization(priority));
        // Next priority
        priority++;
        result.addOptimization(new PostProcessesOptimization(priority));
        result.addOptimization(new ParticlesOptimization(priority));
        // Next priority
        priority++;
        result.addOptimization(new TextureOptimization(priority, 256));
        // Next priority
        priority++;
        result.addOptimization(new RenderTargetsOptimization(priority));
        // Next priority
        priority++;
        result.addOptimization(new HardwareScalingOptimization(priority, 4));
        return result;
    }
}
/**
 * Class used to run optimizations in order to reach a target frame rate
 * @description More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer
 */
class SceneOptimizer {
    /**
     * Gets or sets a boolean indicating if the optimizer is in improvement mode
     */
    get isInImprovementMode() {
        return this._improvementMode;
    }
    set isInImprovementMode(value) {
        this._improvementMode = value;
    }
    /**
     * Gets the current priority level (0 at start)
     */
    get currentPriorityLevel() {
        return this._currentPriorityLevel;
    }
    /**
     * Gets the current frame rate checked by the SceneOptimizer
     */
    get currentFrameRate() {
        return this._currentFrameRate;
    }
    /**
     * Gets or sets the current target frame rate (60 by default)
     */
    get targetFrameRate() {
        return this._targetFrameRate;
    }
    /**
     * Gets or sets the current target frame rate (60 by default)
     */
    set targetFrameRate(value) {
        this._targetFrameRate = value;
    }
    /**
     * Gets or sets the current interval between two checks (every 2000ms by default)
     */
    get trackerDuration() {
        return this._trackerDuration;
    }
    /**
     * Gets or sets the current interval between two checks (every 2000ms by default)
     */
    set trackerDuration(value) {
        this._trackerDuration = value;
    }
    /**
     * Gets the list of active optimizations
     */
    get optimizations() {
        return this._options.optimizations;
    }
    /**
     * Creates a new SceneOptimizer
     * @param scene defines the scene to work on
     * @param options defines the options to use with the SceneOptimizer
     * @param autoGeneratePriorities defines if priorities must be generated and not read from SceneOptimization property (true by default)
     * @param improvementMode defines if the scene optimizer must run the maximum optimization while staying over a target frame instead of trying to reach the target framerate (false by default)
     */
    constructor(scene, options, autoGeneratePriorities = true, improvementMode = false) {
        this._isRunning = false;
        this._currentPriorityLevel = 0;
        this._targetFrameRate = 60;
        this._trackerDuration = 2000;
        this._currentFrameRate = 0;
        this._improvementMode = false;
        /**
         * Defines an observable called when the optimizer reaches the target frame rate
         */
        this.onSuccessObservable = new Misc_observable/* Observable */.cP();
        /**
         * Defines an observable called when the optimizer enables an optimization
         */
        this.onNewOptimizationAppliedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Defines an observable called when the optimizer is not able to reach the target frame rate
         */
        this.onFailureObservable = new Misc_observable/* Observable */.cP();
        if (!options) {
            this._options = new SceneOptimizerOptions();
        }
        else {
            this._options = options;
        }
        if (this._options.targetFrameRate) {
            this._targetFrameRate = this._options.targetFrameRate;
        }
        if (this._options.trackerDuration) {
            this._trackerDuration = this._options.trackerDuration;
        }
        if (autoGeneratePriorities) {
            let priority = 0;
            for (const optim of this._options.optimizations) {
                optim.priority = priority++;
            }
        }
        this._improvementMode = improvementMode;
        this._scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => {
            this._sceneDisposeObserver = null;
            this.dispose();
        });
    }
    /**
     * Stops the current optimizer
     */
    stop() {
        this._isRunning = false;
    }
    /**
     * Reset the optimizer to initial step (current priority level = 0)
     */
    reset() {
        this._currentPriorityLevel = 0;
    }
    /**
     * Start the optimizer. By default it will try to reach a specific framerate
     * but if the optimizer is set with improvementMode === true then it will run all optimization while frame rate is above the target frame rate
     */
    start() {
        if (this._isRunning) {
            return;
        }
        this._isRunning = true;
        // Let's wait for the scene to be ready before running our check
        this._scene.executeWhenReady(() => {
            setTimeout(() => {
                this._checkCurrentState();
            }, this._trackerDuration);
        });
    }
    _checkCurrentState() {
        if (!this._isRunning) {
            return;
        }
        const scene = this._scene;
        const options = this._options;
        this._currentFrameRate = Math.round(scene.getEngine().getFps());
        if ((this._improvementMode && this._currentFrameRate <= this._targetFrameRate) || (!this._improvementMode && this._currentFrameRate >= this._targetFrameRate)) {
            this._isRunning = false;
            this.onSuccessObservable.notifyObservers(this);
            return;
        }
        // Apply current level of optimizations
        let allDone = true;
        let noOptimizationApplied = true;
        for (let index = 0; index < options.optimizations.length; index++) {
            const optimization = options.optimizations[index];
            if (optimization.priority === this._currentPriorityLevel) {
                noOptimizationApplied = false;
                allDone = allDone && optimization.apply(scene, this);
                this.onNewOptimizationAppliedObservable.notifyObservers(optimization);
            }
        }
        // If no optimization was applied, this is a failure :(
        if (noOptimizationApplied) {
            this._isRunning = false;
            this.onFailureObservable.notifyObservers(this);
            return;
        }
        // If all optimizations were done, move to next level
        if (allDone) {
            this._currentPriorityLevel++;
        }
        // Let's the system running for a specific amount of time before checking FPS
        scene.executeWhenReady(() => {
            setTimeout(() => {
                this._checkCurrentState();
            }, this._trackerDuration);
        });
    }
    /**
     * Release all resources
     */
    dispose() {
        this.stop();
        this.onSuccessObservable.clear();
        this.onFailureObservable.clear();
        this.onNewOptimizationAppliedObservable.clear();
        if (this._sceneDisposeObserver) {
            this._scene.onDisposeObservable.remove(this._sceneDisposeObserver);
        }
    }
    /**
     * Helper function to create a SceneOptimizer with one single line of code
     * @param scene defines the scene to work on
     * @param options defines the options to use with the SceneOptimizer
     * @param onSuccess defines a callback to call on success
     * @param onFailure defines a callback to call on failure
     * @returns the new SceneOptimizer object
     */
    static OptimizeAsync(scene, options, onSuccess, onFailure) {
        const optimizer = new SceneOptimizer(scene, options || SceneOptimizerOptions.ModerateDegradationAllowed(), false);
        if (onSuccess) {
            optimizer.onSuccessObservable.add(() => {
                onSuccess();
            });
        }
        if (onFailure) {
            optimizer.onFailureObservable.add(() => {
                onFailure();
            });
        }
        optimizer.start();
        return optimizer;
    }
}
//# sourceMappingURL=sceneOptimizer.js.map
;// ./node_modules/@babylonjs/core/Misc/sceneSerializer.js






let serializedGeometries = [];
const SerializeGeometry = (geometry, serializationGeometries) => {
    if (geometry.doNotSerialize) {
        return;
    }
    serializationGeometries.vertexData.push(geometry.serializeVerticeData());
    serializedGeometries[geometry.id] = true;
};
const SerializeMesh = (mesh, serializationScene) => {
    const serializationObject = {};
    // Geometry
    const geometry = mesh._geometry;
    if (geometry) {
        if (!mesh.getScene().getGeometryById(geometry.id)) {
            // Geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
            SerializeGeometry(geometry, serializationScene.geometries);
        }
    }
    // Custom
    if (mesh.serialize) {
        mesh.serialize(serializationObject);
    }
    return serializationObject;
};
const FinalizeSingleNode = (node, serializationObject) => {
    if (node._isMesh) {
        const mesh = node;
        //only works if the mesh is already loaded
        if (mesh.delayLoadState === 1 || mesh.delayLoadState === 0) {
            const serializeMaterial = (material) => {
                serializationObject.materials = serializationObject.materials || [];
                if (mesh.material && !serializationObject.materials.some((mat) => mat.id === mesh.material.id)) {
                    serializationObject.materials.push(material.serialize());
                }
            };
            //serialize material
            if (mesh.material && !mesh.material.doNotSerialize) {
                if (mesh.material instanceof Materials_multiMaterial/* MultiMaterial */.F) {
                    serializationObject.multiMaterials = serializationObject.multiMaterials || [];
                    if (!serializationObject.multiMaterials.some((mat) => mat.id === mesh.material.id)) {
                        serializationObject.multiMaterials.push(mesh.material.serialize());
                        for (const submaterial of mesh.material.subMaterials) {
                            if (submaterial) {
                                serializeMaterial(submaterial);
                            }
                        }
                    }
                }
                else {
                    serializeMaterial(mesh.material);
                }
            }
            else if (!mesh.material) {
                serializeMaterial(mesh.getScene().defaultMaterial);
            }
            //serialize geometry
            const geometry = mesh._geometry;
            if (geometry) {
                if (!serializationObject.geometries) {
                    serializationObject.geometries = {};
                    serializationObject.geometries.boxes = [];
                    serializationObject.geometries.spheres = [];
                    serializationObject.geometries.cylinders = [];
                    serializationObject.geometries.toruses = [];
                    serializationObject.geometries.grounds = [];
                    serializationObject.geometries.planes = [];
                    serializationObject.geometries.torusKnots = [];
                    serializationObject.geometries.vertexData = [];
                }
                SerializeGeometry(geometry, serializationObject.geometries);
            }
            // Skeletons
            if (mesh.skeleton && !mesh.skeleton.doNotSerialize) {
                serializationObject.skeletons = serializationObject.skeletons || [];
                serializationObject.skeletons.push(mesh.skeleton.serialize());
            }
            //serialize the actual mesh
            serializationObject.meshes = serializationObject.meshes || [];
            serializationObject.meshes.push(SerializeMesh(mesh, serializationObject));
        }
    }
    else if (node.getClassName() === "TransformNode") {
        const transformNode = node;
        serializationObject.transformNodes.push(transformNode.serialize());
    }
    else if (node.getClassName().indexOf("Camera") !== -1) {
        const camera = node;
        serializationObject.cameras.push(camera.serialize());
    }
    else if (node.getClassName().indexOf("Light") !== -1) {
        const light = node;
        serializationObject.lights.push(light.serialize());
    }
};
/**
 * Class used to serialize a scene into a string
 */
class SceneSerializer {
    /**
     * Clear cache used by a previous serialization
     */
    static ClearCache() {
        serializedGeometries = [];
    }
    /**
     * Serialize a scene into a JSON compatible object
     * Note that if the current engine does not support synchronous texture reading (like WebGPU), you should use SerializeAsync instead
     * as else you may not retrieve the proper base64 encoded texture data (when using the Texture.ForceSerializeBuffers flag)
     * @param scene defines the scene to serialize
     * @returns a JSON compatible object
     */
    static Serialize(scene) {
        return SceneSerializer._Serialize(scene);
    }
    static _Serialize(scene, checkSyncReadSupported = true) {
        const serializationObject = {};
        if (checkSyncReadSupported && !scene.getEngine()._features.supportSyncTextureRead && Textures_texture/* Texture */.g.ForceSerializeBuffers) {
            logger/* Logger */.V.Warn("The serialization object may not contain the proper base64 encoded texture data! You should use the SerializeAsync method instead.");
        }
        SceneSerializer.ClearCache();
        // Scene
        serializationObject.useDelayedTextureLoading = scene.useDelayedTextureLoading;
        serializationObject.autoClear = scene.autoClear;
        serializationObject.clearColor = scene.clearColor.asArray();
        serializationObject.ambientColor = scene.ambientColor.asArray();
        serializationObject.gravity = scene.gravity.asArray();
        serializationObject.collisionsEnabled = scene.collisionsEnabled;
        serializationObject.useRightHandedSystem = scene.useRightHandedSystem;
        // Fog
        if (scene.fogMode !== undefined && scene.fogMode !== null) {
            serializationObject.fogMode = scene.fogMode;
        }
        if (scene.fogColor !== undefined && scene.fogColor !== null) {
            serializationObject.fogColor = scene.fogColor.asArray();
        }
        if (scene.fogStart !== undefined && scene.fogStart !== null) {
            serializationObject.fogStart = scene.fogStart;
        }
        if (scene.fogEnd !== undefined && scene.fogEnd !== null) {
            serializationObject.fogEnd = scene.fogEnd;
        }
        if (scene.fogDensity !== undefined && scene.fogDensity !== null) {
            serializationObject.fogDensity = scene.fogDensity;
        }
        //Physics
        if (scene.isPhysicsEnabled && scene.isPhysicsEnabled()) {
            const physicEngine = scene.getPhysicsEngine();
            if (physicEngine) {
                serializationObject.physicsEnabled = true;
                serializationObject.physicsGravity = physicEngine.gravity.asArray();
                serializationObject.physicsEngine = physicEngine.getPhysicsPluginName();
            }
        }
        // Metadata
        if (scene.metadata) {
            serializationObject.metadata = scene.metadata;
        }
        // Morph targets
        serializationObject.morphTargetManagers = [];
        for (const abstractMesh of scene.meshes) {
            const manager = abstractMesh.morphTargetManager;
            if (manager) {
                serializationObject.morphTargetManagers.push(manager.serialize());
            }
        }
        // Lights
        serializationObject.lights = [];
        let index;
        let light;
        for (index = 0; index < scene.lights.length; index++) {
            light = scene.lights[index];
            if (!light.doNotSerialize) {
                serializationObject.lights.push(light.serialize());
            }
        }
        // Cameras
        serializationObject.cameras = [];
        for (index = 0; index < scene.cameras.length; index++) {
            const camera = scene.cameras[index];
            if (!camera.doNotSerialize) {
                serializationObject.cameras.push(camera.serialize());
            }
        }
        if (scene.activeCamera) {
            serializationObject.activeCameraID = scene.activeCamera.id;
        }
        // Animations
        decorators_serialization/* SerializationHelper */.p.AppendSerializedAnimations(scene, serializationObject);
        // Animation Groups
        if (scene.animationGroups && scene.animationGroups.length > 0) {
            serializationObject.animationGroups = [];
            for (let animationGroupIndex = 0; animationGroupIndex < scene.animationGroups.length; animationGroupIndex++) {
                const animationGroup = scene.animationGroups[animationGroupIndex];
                serializationObject.animationGroups.push(animationGroup.serialize());
            }
        }
        // Reflection probes
        if (scene.reflectionProbes && scene.reflectionProbes.length > 0) {
            serializationObject.reflectionProbes = [];
            for (index = 0; index < scene.reflectionProbes.length; index++) {
                const reflectionProbe = scene.reflectionProbes[index];
                serializationObject.reflectionProbes.push(reflectionProbe.serialize());
            }
        }
        // Materials
        serializationObject.materials = [];
        serializationObject.multiMaterials = [];
        let material;
        for (index = 0; index < scene.materials.length; index++) {
            material = scene.materials[index];
            if (!material.doNotSerialize) {
                serializationObject.materials.push(material.serialize());
            }
        }
        // MultiMaterials
        serializationObject.multiMaterials = [];
        for (index = 0; index < scene.multiMaterials.length; index++) {
            const multiMaterial = scene.multiMaterials[index];
            serializationObject.multiMaterials.push(multiMaterial.serialize());
        }
        // Environment texture
        if (scene.environmentTexture) {
            if (scene.environmentTexture._files) {
                serializationObject.environmentTexture = scene.environmentTexture.serialize();
            }
            else {
                serializationObject.environmentTexture = scene.environmentTexture.name;
                serializationObject.environmentTextureRotationY = scene.environmentTexture.rotationY;
            }
        }
        // Environment Intensity
        serializationObject.environmentIntensity = scene.environmentIntensity;
        // Skeletons
        serializationObject.skeletons = [];
        for (index = 0; index < scene.skeletons.length; index++) {
            const skeleton = scene.skeletons[index];
            if (!skeleton.doNotSerialize) {
                serializationObject.skeletons.push(skeleton.serialize());
            }
        }
        // Transform nodes
        serializationObject.transformNodes = [];
        for (index = 0; index < scene.transformNodes.length; index++) {
            if (!scene.transformNodes[index].doNotSerialize) {
                serializationObject.transformNodes.push(scene.transformNodes[index].serialize());
            }
        }
        // Geometries
        serializationObject.geometries = {};
        serializationObject.geometries.boxes = [];
        serializationObject.geometries.spheres = [];
        serializationObject.geometries.cylinders = [];
        serializationObject.geometries.toruses = [];
        serializationObject.geometries.grounds = [];
        serializationObject.geometries.planes = [];
        serializationObject.geometries.torusKnots = [];
        serializationObject.geometries.vertexData = [];
        serializedGeometries = [];
        const geometries = scene.getGeometries();
        for (index = 0; index < geometries.length; index++) {
            const geometry = geometries[index];
            if (geometry.isReady()) {
                SerializeGeometry(geometry, serializationObject.geometries);
            }
        }
        // Meshes
        serializationObject.meshes = [];
        for (index = 0; index < scene.meshes.length; index++) {
            const abstractMesh = scene.meshes[index];
            if (abstractMesh instanceof Meshes_mesh/* Mesh */.e) {
                const mesh = abstractMesh;
                if (!mesh.doNotSerialize) {
                    if (mesh.delayLoadState === 1 || mesh.delayLoadState === 0) {
                        serializationObject.meshes.push(SerializeMesh(mesh, serializationObject));
                    }
                }
            }
        }
        // Particles Systems
        serializationObject.particleSystems = [];
        for (index = 0; index < scene.particleSystems.length; index++) {
            serializationObject.particleSystems.push(scene.particleSystems[index].serialize(false));
        }
        // Post processes
        serializationObject.postProcesses = [];
        for (index = 0; index < scene.postProcesses.length; index++) {
            serializationObject.postProcesses.push(scene.postProcesses[index].serialize());
        }
        // Action Manager
        if (scene.actionManager) {
            serializationObject.actions = scene.actionManager.serialize("scene");
        }
        // Components
        for (const component of scene._serializableComponents) {
            component.serialize(serializationObject);
        }
        // Sprites
        if (scene.spriteManagers) {
            serializationObject.spriteManagers = [];
            for (index = 0; index < scene.spriteManagers.length; index++) {
                serializationObject.spriteManagers.push(scene.spriteManagers[index].serialize(true));
            }
        }
        return serializationObject;
    }
    /**
     * Serialize a scene into a JSON compatible object
     * @param scene defines the scene to serialize
     * @returns a JSON promise compatible object
     */
    static SerializeAsync(scene) {
        const serializationObject = SceneSerializer._Serialize(scene, false);
        const promises = [];
        this._CollectPromises(serializationObject, promises);
        return Promise.all(promises).then(() => serializationObject);
    }
    static _CollectPromises(obj, promises) {
        if (Array.isArray(obj)) {
            for (let i = 0; i < obj.length; ++i) {
                const o = obj[i];
                if (o instanceof Promise) {
                    promises.push(o.then((res) => (obj[i] = res)));
                }
                else if (o instanceof Object || Array.isArray(o)) {
                    this._CollectPromises(o, promises);
                }
            }
        }
        else if (obj instanceof Object) {
            for (const name in obj) {
                if (Object.prototype.hasOwnProperty.call(obj, name)) {
                    const o = obj[name];
                    if (o instanceof Promise) {
                        promises.push(o.then((res) => (obj[name] = res)));
                    }
                    else if (o instanceof Object || Array.isArray(o)) {
                        this._CollectPromises(o, promises);
                    }
                }
            }
        }
    }
    /**
     * Serialize a mesh into a JSON compatible object
     * @param toSerialize defines the mesh to serialize
     * @param withParents defines if parents must be serialized as well
     * @param withChildren defines if children must be serialized as well
     * @returns a JSON compatible object
     */
    static SerializeMesh(toSerialize /* Mesh || Mesh[] */, withParents = false, withChildren = false) {
        const serializationObject = {};
        serializationObject.meshes = [];
        serializationObject.transformNodes = [];
        serializationObject.cameras = [];
        serializationObject.lights = [];
        SceneSerializer.ClearCache();
        toSerialize = toSerialize instanceof Array ? toSerialize : [toSerialize];
        if (withParents || withChildren) {
            //deliberate for loop! not for each, appended should be processed as well.
            for (let i = 0; i < toSerialize.length; ++i) {
                if (withChildren) {
                    toSerialize[i].getDescendants().forEach((node) => {
                        if (toSerialize.indexOf(node) < 0 && !node.doNotSerialize) {
                            toSerialize.push(node);
                        }
                    });
                }
                //make sure the array doesn't contain the object already
                if (withParents && toSerialize[i].parent && toSerialize.indexOf(toSerialize[i].parent) < 0 && !toSerialize[i].parent.doNotSerialize) {
                    toSerialize.push(toSerialize[i].parent);
                }
            }
        }
        toSerialize.forEach((mesh) => {
            FinalizeSingleNode(mesh, serializationObject);
        });
        return serializationObject;
    }
}
//# sourceMappingURL=sceneSerializer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tags.js
var tags = __webpack_require__(27152);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/lodCube.fragment.js
var lodCube_fragment = __webpack_require__(92905);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/lod.fragment.js
var lod_fragment = __webpack_require__(19278);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/lodCube.fragment.js
var ShadersWGSL_lodCube_fragment = __webpack_require__(91650);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/lod.fragment.js
var ShadersWGSL_lod_fragment = __webpack_require__(3613);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tga.js
var tga = __webpack_require__(52053);
;// ./node_modules/@babylonjs/core/Misc/videoRecorder.js

/**
 * This can help with recording videos from BabylonJS.
 * This is based on the available WebRTC functionalities of the browser.
 *
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToVideo
 */
class VideoRecorder {
    /**
     * Returns whether or not the VideoRecorder is available in your browser.
     * @param engine Defines the Babylon Engine.
     * @param canvas Defines the canvas to record. If not provided, the engine canvas will be used.
     * @returns true if supported otherwise false.
     */
    static IsSupported(engine, canvas) {
        const targetCanvas = canvas ?? engine.getRenderingCanvas();
        return !!targetCanvas && typeof targetCanvas.captureStream === "function";
    }
    /**
     * True when a recording is already in progress.
     */
    get isRecording() {
        return !!this._canvas && this._isRecording;
    }
    /**
     * Create a new VideoCapture object which can help converting what you see in Babylon to a video file.
     * @param engine Defines the BabylonJS Engine you wish to record.
     * @param options Defines options that can be used to customize the capture.
     */
    constructor(engine, options = {}) {
        if (!VideoRecorder.IsSupported(engine, options.canvas)) {
            // eslint-disable-next-line no-throw-literal
            throw "Your browser does not support recording so far.";
        }
        const canvas = options.canvas ?? engine.getRenderingCanvas();
        if (!canvas) {
            // eslint-disable-next-line no-throw-literal
            throw "The babylon engine must have a canvas to be recorded";
        }
        this._canvas = canvas;
        this._isRecording = false;
        this._options = {
            ...VideoRecorder._DefaultOptions,
            ...options,
        };
        const stream = this._canvas.captureStream(this._options.fps);
        if (this._options.audioTracks) {
            for (const track of this._options.audioTracks) {
                stream.addTrack(track);
            }
        }
        this._mediaRecorder = new MediaRecorder(stream, { mimeType: this._options.mimeType });
        this._mediaRecorder.ondataavailable = (evt) => this._handleDataAvailable(evt);
        this._mediaRecorder.onerror = (evt) => this._handleError(evt);
        this._mediaRecorder.onstop = () => this._handleStop();
    }
    /**
     * Stops the current recording before the default capture timeout passed in the startRecording function.
     */
    stopRecording() {
        if (!this._canvas || !this._mediaRecorder) {
            return;
        }
        if (!this.isRecording) {
            return;
        }
        this._isRecording = false;
        this._mediaRecorder.stop();
    }
    /**
     * Starts recording the canvas for a max duration specified in parameters.
     * @param fileName Defines the name of the file to be downloaded when the recording stop.
     * If null no automatic download will start and you can rely on the promise to get the data back.
     * @param maxDuration Defines the maximum recording time in seconds.
     * It defaults to 7 seconds. A value of zero will not stop automatically, you would need to call stopRecording manually.
     * @returns A promise callback at the end of the recording with the video data in Blob.
     */
    startRecording(fileName = "babylonjs.webm", maxDuration = 7) {
        if (!this._canvas || !this._mediaRecorder) {
            // eslint-disable-next-line no-throw-literal
            throw "Recorder has already been disposed";
        }
        if (this.isRecording) {
            // eslint-disable-next-line no-throw-literal
            throw "Recording already in progress";
        }
        if (maxDuration > 0) {
            setTimeout(() => {
                this.stopRecording();
            }, maxDuration * 1000);
        }
        this._fileName = fileName;
        this._recordedChunks = [];
        this._resolve = null;
        this._reject = null;
        this._isRecording = true;
        this._mediaRecorder.start(this._options.recordChunckSize);
        return new Promise((resolve, reject) => {
            this._resolve = resolve;
            this._reject = reject;
        });
    }
    /**
     * Releases internal resources used during the recording.
     */
    dispose() {
        this._canvas = null;
        this._mediaRecorder = null;
        this._recordedChunks = [];
        this._fileName = null;
        this._resolve = null;
        this._reject = null;
    }
    _handleDataAvailable(event) {
        if (event.data.size > 0) {
            this._recordedChunks.push(event.data);
        }
    }
    _handleError(event) {
        this.stopRecording();
        if (this._reject) {
            this._reject(event.error);
        }
        else {
            throw new event.error();
        }
    }
    _handleStop() {
        this.stopRecording();
        const superBuffer = new Blob(this._recordedChunks);
        if (this._resolve) {
            this._resolve(superBuffer);
        }
        window.URL.createObjectURL(superBuffer);
        if (this._fileName) {
            tools/* Tools */.S0.Download(superBuffer, this._fileName);
        }
    }
}
VideoRecorder._DefaultOptions = {
    mimeType: "video/webm",
    fps: 25,
    recordChunckSize: 3000,
};
//# sourceMappingURL=videoRecorder.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/workerPool.js
var workerPool = __webpack_require__(97573);
;// ./node_modules/@babylonjs/core/PostProcesses/fxaaPostProcess.js





/**
 * Fxaa post process
 * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#fxaa
 */
class FxaaPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "FxaaPostProcess" string
     */
    getClassName() {
        return "FxaaPostProcess";
    }
    constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0) {
        super(name, "fxaa", ["texelSize"], null, options, camera, samplingMode || Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, reusable, null, textureType, "fxaa", undefined, true);
        const defines = this._getDefines();
        this.updateEffect(defines);
        this.onApplyObservable.add((effect) => {
            const texelSize = this.texelSize;
            effect.setFloat2("texelSize", texelSize.x, texelSize.y);
        });
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 72578)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 53208))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 5499)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 9669))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    _getDefines() {
        const engine = this.getEngine();
        if (!engine) {
            return null;
        }
        const driverInfo = engine.extractDriverInfo();
        if (driverInfo.toLowerCase().indexOf("mali") > -1) {
            return "#define MALI 1\n";
        }
        return null;
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new FxaaPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FxaaPostProcess", FxaaPostProcess);
//# sourceMappingURL=fxaaPostProcess.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/dumpTools.js
var dumpTools = __webpack_require__(89928);
;// ./node_modules/@babylonjs/core/Misc/screenshotTools.js








let screenshotCanvas = null;
/**
 * Captures a screenshot of the current rendering
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
 * @param engine defines the rendering engine
 * @param camera defines the source camera
 * @param size This parameter can be set to a single number or to an object with the
 * following (optional) properties: precision, width, height. If a single number is passed,
 * it will be used for both width and height. If an object is passed, the screenshot size
 * will be derived from the parameters. The precision property is a multiplier allowing
 * rendering at a higher or lower resolution
 * @param successCallback defines the callback receives a single parameter which contains the
 * screenshot as a string of base64-encoded characters. This string can be assigned to the
 * src parameter of an <img> to display it
 * @param mimeType defines the MIME type of the screenshot image (default: image/png).
 * Check your browser for supported MIME types
 * @param forceDownload force the system to download the image even if a successCallback is provided
 * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
 */
function CreateScreenshot(engine, camera, size, successCallback, mimeType = "image/png", forceDownload = false, quality) {
    const { height, width } = _GetScreenshotSize(engine, camera, size);
    if (!(height && width)) {
        logger/* Logger */.V.Error("Invalid 'size' parameter !");
        return;
    }
    if (!screenshotCanvas) {
        screenshotCanvas = document.createElement("canvas");
    }
    screenshotCanvas.width = width;
    screenshotCanvas.height = height;
    const renderContext = screenshotCanvas.getContext("2d");
    const ratio = engine.getRenderWidth() / engine.getRenderHeight();
    let newWidth = width;
    let newHeight = newWidth / ratio;
    if (newHeight > height) {
        newHeight = height;
        newWidth = newHeight * ratio;
    }
    const offsetX = Math.max(0, width - newWidth) / 2;
    const offsetY = Math.max(0, height - newHeight) / 2;
    const scene = camera.getScene();
    if (scene.activeCamera !== camera) {
        CreateScreenshotUsingRenderTarget(engine, camera, size, (data) => {
            if (forceDownload) {
                const blob = new Blob([data]);
                tools/* Tools */.S0.DownloadBlob(blob);
                if (successCallback) {
                    successCallback("");
                }
            }
            else if (successCallback) {
                successCallback(data);
            }
        }, mimeType, 1.0, engine.getCreationOptions().antialias, undefined, undefined, undefined, undefined, quality);
    }
    else {
        engine.onEndFrameObservable.addOnce(() => {
            const renderingCanvas = engine.getRenderingCanvas();
            if (renderContext && renderingCanvas) {
                renderContext.drawImage(renderingCanvas, offsetX, offsetY, newWidth, newHeight);
            }
            if (screenshotCanvas) {
                if (forceDownload) {
                    tools/* Tools */.S0.EncodeScreenshotCanvasData(screenshotCanvas, undefined, mimeType, undefined, quality);
                    if (successCallback) {
                        successCallback("");
                    }
                }
                else {
                    tools/* Tools */.S0.EncodeScreenshotCanvasData(screenshotCanvas, successCallback, mimeType, undefined, quality);
                }
            }
        });
    }
}
/**
 * Captures a screenshot of the current rendering
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
 * @param engine defines the rendering engine
 * @param camera defines the source camera
 * @param size This parameter can be set to a single number or to an object with the
 * following (optional) properties: precision, width, height. If a single number is passed,
 * it will be used for both width and height. If an object is passed, the screenshot size
 * will be derived from the parameters. The precision property is a multiplier allowing
 * rendering at a higher or lower resolution
 * @param mimeType defines the MIME type of the screenshot image (default: image/png).
 * Check your browser for supported MIME types
 * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
 * @returns screenshot as a string of base64-encoded characters. This string can be assigned
 * to the src parameter of an <img> to display it
 */
function CreateScreenshotAsync(engine, camera, size, mimeType = "image/png", quality) {
    return new Promise((resolve, reject) => {
        CreateScreenshot(engine, camera, size, (data) => {
            if (typeof data !== "undefined") {
                resolve(data);
            }
            else {
                reject(new Error("Data is undefined"));
            }
        }, mimeType, undefined, quality);
    });
}
/**
 * Captures a screenshot of the current rendering for a specific size. This will render the entire canvas but will generate a blink (due to canvas resize)
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
 * @param engine defines the rendering engine
 * @param camera defines the source camera
 * @param width defines the expected width
 * @param height defines the expected height
 * @param mimeType defines the MIME type of the screenshot image (default: image/png).
 * Check your browser for supported MIME types
 * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
 * @returns screenshot as a string of base64-encoded characters. This string can be assigned
 * to the src parameter of an <img> to display it
 */
function CreateScreenshotWithResizeAsync(engine, camera, width, height, mimeType = "image/png", quality) {
    return new Promise((resolve) => {
        CreateScreenshot(engine, camera, { width: width, height: height }, () => {
            resolve();
        }, mimeType, true, quality);
    });
}
/**
 * Generates an image screenshot from the specified camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
 * @param engine The engine to use for rendering
 * @param camera The camera to use for rendering
 * @param size This parameter can be set to a single number or to an object with the
 * following (optional) properties: precision, width, height, finalWidth, finalHeight. If a single number is passed,
 * it will be used for both width and height, as well as finalWidth, finalHeight. If an object is passed, the screenshot size
 * will be derived from the parameters. The precision property is a multiplier allowing
 * rendering at a higher or lower resolution
 * @param successCallback The callback receives a single parameter which contains the
 * screenshot as a string of base64-encoded characters. This string can be assigned to the
 * src parameter of an <img> to display it
 * @param mimeType The MIME type of the screenshot image (default: image/png).
 * Check your browser for supported MIME types
 * @param samples Texture samples (default: 1)
 * @param antialiasing Whether antialiasing should be turned on or not (default: false)
 * @param fileName A name for for the downloaded file.
 * @param renderSprites Whether the sprites should be rendered or not (default: false)
 * @param enableStencilBuffer Whether the stencil buffer should be enabled or not (default: false)
 * @param useLayerMask if the camera's layer mask should be used to filter what should be rendered (default: true)
 * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
 * @param customizeTexture An optional callback that can be used to modify the render target texture before taking the screenshot. This can be used, for instance, to enable camera post-processes before taking the screenshot.
 */
function CreateScreenshotUsingRenderTarget(engine, camera, size, successCallback, mimeType = "image/png", samples = 1, antialiasing = false, fileName, renderSprites = false, enableStencilBuffer = false, useLayerMask = true, quality, customizeTexture) {
    const { height, width, finalWidth, finalHeight } = _GetScreenshotSize(engine, camera, size);
    const targetTextureSize = { width, height };
    if (!(height && width)) {
        logger/* Logger */.V.Error("Invalid 'size' parameter !");
        return;
    }
    const originalSize = { width: engine.getRenderWidth(), height: engine.getRenderHeight() };
    engine.setSize(width, height); // we need this call to trigger onResizeObservable with the screenshot width/height on all the subsystems that are observing this event and that needs to (re)create some resources with the right dimensions
    const scene = camera.getScene();
    // At this point size can be a number, or an object (according to engine.prototype.createRenderTargetTexture method)
    const texture = new Textures_renderTargetTexture/* RenderTargetTexture */.$("screenShot", targetTextureSize, scene, false, false, 0, false, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, undefined, enableStencilBuffer, undefined, undefined, undefined, samples);
    texture.renderList = scene.meshes.slice();
    texture.samples = samples;
    texture.renderSprites = renderSprites;
    texture.activeCamera = camera;
    texture.forceLayerMaskCheck = useLayerMask;
    customizeTexture?.(texture);
    const renderWhenReady = () => {
        if (texture.isReadyForRendering() && camera.isReady(true)) {
            engine.onEndFrameObservable.addOnce(() => {
                if (finalWidth === width && finalHeight === height) {
                    texture.readPixels(undefined, undefined, undefined, false).then((data) => {
                        (0,dumpTools.DumpData)(width, height, data, successCallback, mimeType, fileName, true, undefined, quality);
                        texture.dispose();
                    });
                }
                else {
                    const importPromise = engine.isWebGPU ? Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99965)) : Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79820));
                    importPromise.then(() => (0,textureTools/* ApplyPostProcess */.Qs)("pass", texture.getInternalTexture(), scene, undefined, undefined, undefined, finalWidth, finalHeight).then((texture) => {
                        engine._readTexturePixels(texture, finalWidth, finalHeight, -1, 0, null, true, false, 0, 0).then((data) => {
                            (0,dumpTools.DumpData)(finalWidth, finalHeight, data, successCallback, mimeType, fileName, true, undefined, quality);
                            texture.dispose();
                        });
                    }));
                }
            });
            scene.incrementRenderId();
            scene.resetCachedMaterial();
            texture.render(true);
            engine.setSize(originalSize.width, originalSize.height);
            camera.getProjectionMatrix(true); // Force cache refresh;
        }
        else {
            setTimeout(renderWhenReady, 16);
        }
    };
    const renderToTexture = () => {
        // render the RTT
        scene.incrementRenderId();
        scene.resetCachedMaterial();
        renderWhenReady();
    };
    if (antialiasing) {
        const fxaaPostProcess = new FxaaPostProcess("antialiasing", 1.0, scene.activeCamera);
        texture.addPostProcess(fxaaPostProcess);
        // Async Shader Compilation can lead to none ready effects in synchronous code
        fxaaPostProcess.onEffectCreatedObservable.addOnce((e) => {
            if (!e.isReady()) {
                e.onCompiled = () => {
                    renderToTexture();
                };
            }
            // The effect is ready we can render
            else {
                renderToTexture();
            }
        });
    }
    else {
        // No need to wait for extra resources to be ready
        renderToTexture();
    }
}
/**
 * Generates an image screenshot from the specified camera.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
 * @param engine The engine to use for rendering
 * @param camera The camera to use for rendering
 * @param size This parameter can be set to a single number or to an object with the
 * following (optional) properties: precision, width, height. If a single number is passed,
 * it will be used for both width and height. If an object is passed, the screenshot size
 * will be derived from the parameters. The precision property is a multiplier allowing
 * rendering at a higher or lower resolution
 * @param mimeType The MIME type of the screenshot image (default: image/png).
 * Check your browser for supported MIME types
 * @param samples Texture samples (default: 1)
 * @param antialiasing Whether antialiasing should be turned on or not (default: false)
 * @param fileName A name for for the downloaded file.
 * @param renderSprites Whether the sprites should be rendered or not (default: false)
 * @param enableStencilBuffer Whether the stencil buffer should be enabled or not (default: false)
 * @param useLayerMask if the camera's layer mask should be used to filter what should be rendered (default: true)
 * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
 * @param customizeTexture An optional callback that can be used to modify the render target texture before taking the screenshot. This can be used, for instance, to enable camera post-processes before taking the screenshot.
 * @returns screenshot as a string of base64-encoded characters. This string can be assigned
 * to the src parameter of an <img> to display it
 */
function CreateScreenshotUsingRenderTargetAsync(engine, camera, size, mimeType = "image/png", samples = 1, antialiasing = false, fileName, renderSprites = false, enableStencilBuffer = false, useLayerMask = true, quality, customizeTexture) {
    return new Promise((resolve, reject) => {
        CreateScreenshotUsingRenderTarget(engine, camera, size, (data) => {
            if (typeof data !== "undefined") {
                resolve(data);
            }
            else {
                reject(new Error("Data is undefined"));
            }
        }, mimeType, samples, antialiasing, fileName, renderSprites, enableStencilBuffer, useLayerMask, quality, customizeTexture);
    });
}
/**
 * Gets height and width for screenshot size
 * @param engine
 * @param camera
 * @param size
 * @private
 */
function _GetScreenshotSize(engine, camera, size) {
    let height = 0;
    let width = 0;
    let finalWidth = 0;
    let finalHeight = 0;
    //If a size value defined as object
    if (typeof size === "object") {
        const precision = size.precision
            ? Math.abs(size.precision) // prevent GL_INVALID_VALUE : glViewport: negative width/height
            : 1;
        //If a width and height values is specified
        if (size.width && size.height) {
            height = size.height * precision;
            width = size.width * precision;
        }
        //If passing only width, computing height to keep display canvas ratio.
        else if (size.width && !size.height) {
            width = size.width * precision;
            height = Math.round(width / engine.getAspectRatio(camera));
        }
        //If passing only height, computing width to keep display canvas ratio.
        else if (size.height && !size.width) {
            height = size.height * precision;
            width = Math.round(height * engine.getAspectRatio(camera));
        }
        else {
            width = Math.round(engine.getRenderWidth() * precision);
            height = Math.round(width / engine.getAspectRatio(camera));
        }
        //If a finalWidth and finalHeight values is specified
        if (size.finalWidth && size.finalHeight) {
            finalHeight = size.finalHeight;
            finalWidth = size.finalWidth;
        }
        //If passing only finalWidth, computing finalHeight to keep display canvas ratio.
        else if (size.finalWidth && !size.finalHeight) {
            finalWidth = size.finalWidth;
            finalHeight = Math.round(finalWidth / engine.getAspectRatio(camera));
        }
        //If passing only finalHeight, computing finalWidth to keep display canvas ratio.
        else if (size.finalHeight && !size.finalWidth) {
            finalHeight = size.finalHeight;
            finalWidth = Math.round(finalHeight * engine.getAspectRatio(camera));
        }
        else {
            finalWidth = width;
            finalHeight = height;
        }
    }
    //Assuming here that "size" parameter is a number
    else if (!isNaN(size)) {
        height = size;
        width = size;
        finalWidth = size;
        finalHeight = size;
    }
    // When creating the image data from the CanvasRenderingContext2D, the width and height is clamped to the size of the _gl context
    // On certain GPUs, it seems as if the _gl context truncates to an integer automatically. Therefore, if a user tries to pass the width of their canvas element
    // and it happens to be a float (1000.5 x 600.5 px), the engine.readPixels will return a different size array than context.createImageData
    // to resolve this, we truncate the floats here to ensure the same size
    if (width) {
        width = Math.floor(width);
    }
    if (height) {
        height = Math.floor(height);
    }
    if (finalWidth) {
        finalWidth = Math.floor(finalWidth);
    }
    if (finalHeight) {
        finalHeight = Math.floor(finalHeight);
    }
    return { height: height | 0, width: width | 0, finalWidth: finalWidth | 0, finalHeight: finalHeight | 0 };
}
/**
 * Class containing a set of static utilities functions for screenshots
 */
const ScreenshotTools = {
    /**
     * Captures a screenshot of the current rendering
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
     * @param engine defines the rendering engine
     * @param camera defines the source camera
     * @param size This parameter can be set to a single number or to an object with the
     * following (optional) properties: precision, width, height. If a single number is passed,
     * it will be used for both width and height. If an object is passed, the screenshot size
     * will be derived from the parameters. The precision property is a multiplier allowing
     * rendering at a higher or lower resolution
     * @param successCallback defines the callback receives a single parameter which contains the
     * screenshot as a string of base64-encoded characters. This string can be assigned to the
     * src parameter of an <img> to display it
     * @param mimeType defines the MIME type of the screenshot image (default: image/png).
     * Check your browser for supported MIME types
     * @param forceDownload force the system to download the image even if a successCallback is provided
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     */
    CreateScreenshot,
    /**
     * Captures a screenshot of the current rendering
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
     * @param engine defines the rendering engine
     * @param camera defines the source camera
     * @param size This parameter can be set to a single number or to an object with the
     * following (optional) properties: precision, width, height. If a single number is passed,
     * it will be used for both width and height. If an object is passed, the screenshot size
     * will be derived from the parameters. The precision property is a multiplier allowing
     * rendering at a higher or lower resolution
     * @param mimeType defines the MIME type of the screenshot image (default: image/png).
     * Check your browser for supported MIME types
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     * @returns screenshot as a string of base64-encoded characters. This string can be assigned
     * to the src parameter of an <img> to display it
     */
    CreateScreenshotAsync,
    /**
     * Captures a screenshot of the current rendering for a specific size. This will render the entire canvas but will generate a blink (due to canvas resize)
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
     * @param engine defines the rendering engine
     * @param camera defines the source camera
     * @param width defines the expected width
     * @param height defines the expected height
     * @param mimeType defines the MIME type of the screenshot image (default: image/png).
     * Check your browser for supported MIME types
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     * @returns screenshot as a string of base64-encoded characters. This string can be assigned
     * to the src parameter of an <img> to display it
     */
    CreateScreenshotWithResizeAsync,
    /**
     * Generates an image screenshot from the specified camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
     * @param engine The engine to use for rendering
     * @param camera The camera to use for rendering
     * @param size This parameter can be set to a single number or to an object with the
     * following (optional) properties: precision, width, height. If a single number is passed,
     * it will be used for both width and height. If an object is passed, the screenshot size
     * will be derived from the parameters. The precision property is a multiplier allowing
     * rendering at a higher or lower resolution
     * @param successCallback The callback receives a single parameter which contains the
     * screenshot as a string of base64-encoded characters. This string can be assigned to the
     * src parameter of an <img> to display it
     * @param mimeType The MIME type of the screenshot image (default: image/png).
     * Check your browser for supported MIME types
     * @param samples Texture samples (default: 1)
     * @param antialiasing Whether antialiasing should be turned on or not (default: false)
     * @param fileName A name for for the downloaded file.
     * @param renderSprites Whether the sprites should be rendered or not (default: false)
     * @param enableStencilBuffer Whether the stencil buffer should be enabled or not (default: false)
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     */
    CreateScreenshotUsingRenderTarget,
    /**
     * Generates an image screenshot from the specified camera.
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToPNG
     * @param engine The engine to use for rendering
     * @param camera The camera to use for rendering
     * @param size This parameter can be set to a single number or to an object with the
     * following (optional) properties: precision, width, height. If a single number is passed,
     * it will be used for both width and height. If an object is passed, the screenshot size
     * will be derived from the parameters. The precision property is a multiplier allowing
     * rendering at a higher or lower resolution
     * @param mimeType The MIME type of the screenshot image (default: image/png).
     * Check your browser for supported MIME types
     * @param samples Texture samples (default: 1)
     * @param antialiasing Whether antialiasing should be turned on or not (default: false)
     * @param fileName A name for for the downloaded file.
     * @param renderSprites Whether the sprites should be rendered or not (default: false)
     * @param quality The quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob | HTMLCanvasElement.toBlob()}'s `quality` parameter.
     * @returns screenshot as a string of base64-encoded characters. This string can be assigned
     * to the src parameter of an <img> to display it
     */
    CreateScreenshotUsingRenderTargetAsync,
};
/**
 * This will be executed automatically for UMD and es5.
 * If esm dev wants the side effects to execute they will have to run it manually
 * Once we build native modules those need to be exported.
 * @internal
 */
const initSideEffects = () => {
    // References the dependencies.
    tools/* Tools */.S0.CreateScreenshot = CreateScreenshot;
    tools/* Tools */.S0.CreateScreenshotAsync = CreateScreenshotAsync;
    tools/* Tools */.S0.CreateScreenshotUsingRenderTarget = CreateScreenshotUsingRenderTarget;
    tools/* Tools */.S0.CreateScreenshotUsingRenderTargetAsync = CreateScreenshotUsingRenderTargetAsync;
};
initSideEffects();
//# sourceMappingURL=screenshotTools.js.map
;// ./node_modules/@babylonjs/core/Misc/iInspectable.js
/**
 * Enum that determines the text-wrapping mode to use.
 */
var InspectableType;
(function (InspectableType) {
    /**
     * Checkbox for booleans
     */
    InspectableType[InspectableType["Checkbox"] = 0] = "Checkbox";
    /**
     * Sliders for numbers
     */
    InspectableType[InspectableType["Slider"] = 1] = "Slider";
    /**
     * Vector3
     */
    InspectableType[InspectableType["Vector3"] = 2] = "Vector3";
    /**
     * Quaternions
     */
    InspectableType[InspectableType["Quaternion"] = 3] = "Quaternion";
    /**
     * Color3
     */
    InspectableType[InspectableType["Color3"] = 4] = "Color3";
    /**
     * String
     */
    InspectableType[InspectableType["String"] = 5] = "String";
    /**
     * Button
     */
    InspectableType[InspectableType["Button"] = 6] = "Button";
    /**
     * Options
     */
    InspectableType[InspectableType["Options"] = 7] = "Options";
    /**
     * Tab
     */
    InspectableType[InspectableType["Tab"] = 8] = "Tab";
    /**
     * File button
     */
    InspectableType[InspectableType["FileButton"] = 9] = "FileButton";
    /**
     * Vector2
     */
    InspectableType[InspectableType["Vector2"] = 10] = "Vector2";
})(InspectableType || (InspectableType = {}));
//# sourceMappingURL=iInspectable.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/rgbdTextureTools.js
var rgbdTextureTools = __webpack_require__(97126);
;// ./node_modules/@babylonjs/core/Misc/gradients.js

/** Class used to store color4 gradient */
class ColorGradient {
    /**
     * Creates a new color4 gradient
     * @param gradient gets or sets the gradient value (between 0 and 1)
     * @param color1 gets or sets first associated color
     * @param color2 gets or sets first second color
     */
    constructor(
    /**
     * Gets or sets the gradient value (between 0 and 1)
     */
    gradient, 
    /**
     * Gets or sets first associated color
     */
    color1, 
    /**
     * Gets or sets second associated color
     */
    color2) {
        this.gradient = gradient;
        this.color1 = color1;
        this.color2 = color2;
    }
    /**
     * Will get a color picked randomly between color1 and color2.
     * If color2 is undefined then color1 will be used
     * @param result defines the target Color4 to store the result in
     */
    getColorToRef(result) {
        if (!this.color2) {
            result.copyFrom(this.color1);
            return;
        }
        math_color/* Color4 */.ov.LerpToRef(this.color1, this.color2, Math.random(), result);
    }
}
/** Class used to store color 3 gradient */
class Color3Gradient {
    /**
     * Creates a new color3 gradient
     * @param gradient gets or sets the gradient value (between 0 and 1)
     * @param color gets or sets associated color
     */
    constructor(
    /**
     * Gets or sets the gradient value (between 0 and 1)
     */
    gradient, 
    /**
     * Gets or sets the associated color
     */
    color) {
        this.gradient = gradient;
        this.color = color;
    }
}
/** Class used to store factor gradient */
class FactorGradient {
    /**
     * Creates a new factor gradient
     * @param gradient gets or sets the gradient value (between 0 and 1)
     * @param factor1 gets or sets first associated factor
     * @param factor2 gets or sets second associated factor
     */
    constructor(
    /**
     * Gets or sets the gradient value (between 0 and 1)
     */
    gradient, 
    /**
     * Gets or sets first associated factor
     */
    factor1, 
    /**
     * Gets or sets second associated factor
     */
    factor2) {
        this.gradient = gradient;
        this.factor1 = factor1;
        this.factor2 = factor2;
    }
    /**
     * Will get a number picked randomly between factor1 and factor2.
     * If factor2 is undefined then factor1 will be used
     * @returns the picked number
     */
    getFactor() {
        if (this.factor2 === undefined || this.factor2 === this.factor1) {
            return this.factor1;
        }
        return this.factor1 + (this.factor2 - this.factor1) * Math.random();
    }
}
/**
 * Helper used to simplify some generic gradient tasks
 */
class GradientHelper {
    /**
     * Gets the current gradient from an array of IValueGradient
     * @param ratio defines the current ratio to get
     * @param gradients defines the array of IValueGradient
     * @param updateFunc defines the callback function used to get the final value from the selected gradients
     */
    static GetCurrentGradient(ratio, gradients, updateFunc) {
        // Use last index if over
        if (gradients[0].gradient > ratio) {
            updateFunc(gradients[0], gradients[0], 1.0);
            return;
        }
        for (let gradientIndex = 0; gradientIndex < gradients.length - 1; gradientIndex++) {
            const currentGradient = gradients[gradientIndex];
            const nextGradient = gradients[gradientIndex + 1];
            if (ratio >= currentGradient.gradient && ratio <= nextGradient.gradient) {
                const scale = (ratio - currentGradient.gradient) / (nextGradient.gradient - currentGradient.gradient);
                updateFunc(currentGradient, nextGradient, scale);
                return;
            }
        }
        // Use last index if over
        const lastIndex = gradients.length - 1;
        updateFunc(gradients[lastIndex], gradients[lastIndex], 1.0);
    }
}
//# sourceMappingURL=gradients.js.map
;// ./node_modules/@babylonjs/core/Misc/fileRequest.js

//# sourceMappingURL=fileRequest.js.map
;// ./node_modules/@babylonjs/core/Misc/customAnimationFrameRequester.js

//# sourceMappingURL=customAnimationFrameRequester.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/retryStrategy.js
var retryStrategy = __webpack_require__(61326);
;// ./node_modules/@babylonjs/core/Misc/interfaces/screenshotSize.js

//# sourceMappingURL=screenshotSize.js.map
;// ./node_modules/@babylonjs/core/Misc/interfaces/iPerfViewer.js

//# sourceMappingURL=iPerfViewer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/dataReader.js
var dataReader = __webpack_require__(97974);
;// ./node_modules/@babylonjs/core/Misc/dataStorage.js
/**
 * Class for storing data to local storage if available or in-memory storage otherwise
 */
class DataStorage {
    static _GetStorage() {
        try {
            localStorage.setItem("test", "");
            localStorage.removeItem("test");
            return localStorage;
        }
        catch {
            const inMemoryStorage = {};
            return {
                getItem: (key) => {
                    const value = inMemoryStorage[key];
                    return value === undefined ? null : value;
                },
                setItem: (key, value) => {
                    inMemoryStorage[key] = value;
                },
            };
        }
    }
    /**
     * Reads a string from the data storage
     * @param key The key to read
     * @param defaultValue The value if the key doesn't exist
     * @returns The string value
     */
    static ReadString(key, defaultValue) {
        const value = this._Storage.getItem(key);
        return value !== null ? value : defaultValue;
    }
    /**
     * Writes a string to the data storage
     * @param key The key to write
     * @param value The value to write
     */
    static WriteString(key, value) {
        this._Storage.setItem(key, value);
    }
    /**
     * Reads a boolean from the data storage
     * @param key The key to read
     * @param defaultValue The value if the key doesn't exist
     * @returns The boolean value
     */
    static ReadBoolean(key, defaultValue) {
        const value = this._Storage.getItem(key);
        return value !== null ? value === "true" : defaultValue;
    }
    /**
     * Writes a boolean to the data storage
     * @param key The key to write
     * @param value The value to write
     */
    static WriteBoolean(key, value) {
        this._Storage.setItem(key, value ? "true" : "false");
    }
    /**
     * Reads a number from the data storage
     * @param key The key to read
     * @param defaultValue The value if the key doesn't exist
     * @returns The number value
     */
    static ReadNumber(key, defaultValue) {
        const value = this._Storage.getItem(key);
        return value !== null ? parseFloat(value) : defaultValue;
    }
    /**
     * Writes a number to the data storage
     * @param key The key to write
     * @param value The value to write
     */
    static WriteNumber(key, value) {
        this._Storage.setItem(key, value.toString());
    }
}
DataStorage._Storage = DataStorage._GetStorage();
//# sourceMappingURL=dataStorage.js.map
;// ./node_modules/@babylonjs/core/Particles/particle.js



/**
 * A particle represents one of the element emitted by a particle system.
 * This is mainly define by its coordinates, direction, velocity and age.
 */
class Particle {
    /**
     * Creates a new instance Particle
     * @param particleSystem the particle system the particle belongs to
     */
    constructor(
    /**
     * The particle system the particle belongs to.
     */
    particleSystem) {
        this.particleSystem = particleSystem;
        /**
         * The world position of the particle in the scene.
         */
        this.position = math_vector/* Vector3 */.Pq.Zero();
        /**
         * The world direction of the particle in the scene.
         */
        this.direction = math_vector/* Vector3 */.Pq.Zero();
        /**
         * The color of the particle.
         */
        this.color = new math_color/* Color4 */.ov(0, 0, 0, 0);
        /**
         * The color change of the particle per step.
         */
        this.colorStep = new math_color/* Color4 */.ov(0, 0, 0, 0);
        /**
         * Defines how long will the life of the particle be.
         */
        this.lifeTime = 1.0;
        /**
         * The current age of the particle.
         */
        this.age = 0;
        /**
         * The current size of the particle.
         */
        this.size = 0;
        /**
         * The current scale of the particle.
         */
        this.scale = new math_vector/* Vector2 */.I9(1, 1);
        /**
         * The current angle of the particle.
         */
        this.angle = 0;
        /**
         * Defines how fast is the angle changing.
         */
        this.angularSpeed = 0;
        /**
         * Defines the cell index used by the particle to be rendered from a sprite.
         */
        this.cellIndex = 0;
        /** @internal */
        this._attachedSubEmitters = null;
        /** @internal */
        this._currentColor1 = new math_color/* Color4 */.ov(0, 0, 0, 0);
        /** @internal */
        this._currentColor2 = new math_color/* Color4 */.ov(0, 0, 0, 0);
        /** @internal */
        this._currentSize1 = 0;
        /** @internal */
        this._currentSize2 = 0;
        /** @internal */
        this._currentAngularSpeed1 = 0;
        /** @internal */
        this._currentAngularSpeed2 = 0;
        /** @internal */
        this._currentVelocity1 = 0;
        /** @internal */
        this._currentVelocity2 = 0;
        /** @internal */
        this._currentLimitVelocity1 = 0;
        /** @internal */
        this._currentLimitVelocity2 = 0;
        /** @internal */
        this._currentDrag1 = 0;
        /** @internal */
        this._currentDrag2 = 0;
        this.id = Particle._Count++;
        if (!this.particleSystem.isAnimationSheetEnabled) {
            return;
        }
        this._updateCellInfoFromSystem();
    }
    _updateCellInfoFromSystem() {
        this.cellIndex = this.particleSystem.startSpriteCellID;
    }
    /**
     * Defines how the sprite cell index is updated for the particle
     */
    updateCellIndex() {
        let offsetAge = this.age;
        let changeSpeed = this.particleSystem.spriteCellChangeSpeed;
        if (this.particleSystem.spriteRandomStartCell) {
            if (this._randomCellOffset === undefined) {
                this._randomCellOffset = Math.random() * this.lifeTime;
            }
            if (changeSpeed === 0) {
                // Special case when speed = 0 meaning we want to stay on initial cell
                changeSpeed = 1;
                offsetAge = this._randomCellOffset;
            }
            else {
                offsetAge += this._randomCellOffset;
            }
        }
        const dist = this._initialEndSpriteCellID - this._initialStartSpriteCellID + 1;
        let ratio;
        if (this._initialSpriteCellLoop) {
            ratio = (0,math_scalar_functions.Clamp)(((offsetAge * changeSpeed) % this.lifeTime) / this.lifeTime);
        }
        else {
            ratio = (0,math_scalar_functions.Clamp)((offsetAge * changeSpeed) / this.lifeTime);
        }
        this.cellIndex = (this._initialStartSpriteCellID + ratio * dist) | 0;
    }
    /**
     * @internal
     */
    _inheritParticleInfoToSubEmitter(subEmitter) {
        if (subEmitter.particleSystem.emitter.position) {
            const emitterMesh = subEmitter.particleSystem.emitter;
            emitterMesh.position.copyFrom(this.position);
            if (subEmitter.inheritDirection) {
                const temp = math_vector/* TmpVectors */.AA.Vector3[0];
                this.direction.normalizeToRef(temp);
                emitterMesh.setDirection(temp, 0, Math.PI / 2);
            }
        }
        else {
            const emitterPosition = subEmitter.particleSystem.emitter;
            emitterPosition.copyFrom(this.position);
        }
        // Set inheritedVelocityOffset to be used when new particles are created
        this.direction.scaleToRef(subEmitter.inheritedVelocityAmount / 2, math_vector/* TmpVectors */.AA.Vector3[0]);
        subEmitter.particleSystem._inheritedVelocityOffset.copyFrom(math_vector/* TmpVectors */.AA.Vector3[0]);
    }
    /** @internal */
    _inheritParticleInfoToSubEmitters() {
        if (this._attachedSubEmitters && this._attachedSubEmitters.length > 0) {
            this._attachedSubEmitters.forEach((subEmitter) => {
                this._inheritParticleInfoToSubEmitter(subEmitter);
            });
        }
    }
    /** @internal */
    _reset() {
        this.age = 0;
        this.id = Particle._Count++;
        this._currentColorGradient = null;
        this._currentSizeGradient = null;
        this._currentAngularSpeedGradient = null;
        this._currentVelocityGradient = null;
        this._currentLimitVelocityGradient = null;
        this._currentDragGradient = null;
        this.cellIndex = this.particleSystem.startSpriteCellID;
        this._randomCellOffset = undefined;
    }
    /**
     * Copy the properties of particle to another one.
     * @param other the particle to copy the information to.
     */
    copyTo(other) {
        other.position.copyFrom(this.position);
        if (this._initialDirection) {
            if (other._initialDirection) {
                other._initialDirection.copyFrom(this._initialDirection);
            }
            else {
                other._initialDirection = this._initialDirection.clone();
            }
        }
        else {
            other._initialDirection = null;
        }
        other.direction.copyFrom(this.direction);
        if (this._localPosition) {
            if (other._localPosition) {
                other._localPosition.copyFrom(this._localPosition);
            }
            else {
                other._localPosition = this._localPosition.clone();
            }
        }
        other.color.copyFrom(this.color);
        other.colorStep.copyFrom(this.colorStep);
        other.lifeTime = this.lifeTime;
        other.age = this.age;
        other._randomCellOffset = this._randomCellOffset;
        other.size = this.size;
        other.scale.copyFrom(this.scale);
        other.angle = this.angle;
        other.angularSpeed = this.angularSpeed;
        other.particleSystem = this.particleSystem;
        other.cellIndex = this.cellIndex;
        other.id = this.id;
        other._attachedSubEmitters = this._attachedSubEmitters;
        if (this._currentColorGradient) {
            other._currentColorGradient = this._currentColorGradient;
            other._currentColor1.copyFrom(this._currentColor1);
            other._currentColor2.copyFrom(this._currentColor2);
        }
        if (this._currentSizeGradient) {
            other._currentSizeGradient = this._currentSizeGradient;
            other._currentSize1 = this._currentSize1;
            other._currentSize2 = this._currentSize2;
        }
        if (this._currentAngularSpeedGradient) {
            other._currentAngularSpeedGradient = this._currentAngularSpeedGradient;
            other._currentAngularSpeed1 = this._currentAngularSpeed1;
            other._currentAngularSpeed2 = this._currentAngularSpeed2;
        }
        if (this._currentVelocityGradient) {
            other._currentVelocityGradient = this._currentVelocityGradient;
            other._currentVelocity1 = this._currentVelocity1;
            other._currentVelocity2 = this._currentVelocity2;
        }
        if (this._currentLimitVelocityGradient) {
            other._currentLimitVelocityGradient = this._currentLimitVelocityGradient;
            other._currentLimitVelocity1 = this._currentLimitVelocity1;
            other._currentLimitVelocity2 = this._currentLimitVelocity2;
        }
        if (this._currentDragGradient) {
            other._currentDragGradient = this._currentDragGradient;
            other._currentDrag1 = this._currentDrag1;
            other._currentDrag2 = this._currentDrag2;
        }
        if (this.particleSystem.isAnimationSheetEnabled) {
            other._initialStartSpriteCellID = this._initialStartSpriteCellID;
            other._initialEndSpriteCellID = this._initialEndSpriteCellID;
            other._initialSpriteCellLoop = this._initialSpriteCellLoop;
        }
        if (this.particleSystem.useRampGradients) {
            if (other.remapData && this.remapData) {
                other.remapData.copyFrom(this.remapData);
            }
            else {
                other.remapData = new math_vector/* Vector4 */.IU(0, 0, 0, 0);
            }
        }
        if (this._randomNoiseCoordinates1) {
            if (other._randomNoiseCoordinates1) {
                other._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1);
                other._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2);
            }
            else {
                other._randomNoiseCoordinates1 = this._randomNoiseCoordinates1.clone();
                other._randomNoiseCoordinates2 = this._randomNoiseCoordinates2.clone();
            }
        }
    }
}
Particle._Count = 0;
//# sourceMappingURL=particle.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/boxParticleEmitter.js



/**
 * Particle emitter emitting particles from the inside of a box.
 * It emits the particles randomly between 2 given directions.
 */
class BoxParticleEmitter {
    /**
     * Creates a new instance BoxParticleEmitter
     */
    constructor() {
        /**
         * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
         */
        this.direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0);
        /**
         * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
         */
        this.direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0);
        /**
         * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
         */
        this.minEmitBox = new math_vector/* Vector3 */.Pq(-0.5, -0.5, -0.5);
        /**
         * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
         */
        this.maxEmitBox = new math_vector/* Vector3 */.Pq(0.5, 0.5, 0.5);
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     * @param particle is the particle we are computed the direction for
     * @param isLocal defines if the direction should be set in local space
     */
    startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {
        const randX = (0,math_scalar_functions.RandomRange)(this.direction1.x, this.direction2.x);
        const randY = (0,math_scalar_functions.RandomRange)(this.direction1.y, this.direction2.y);
        const randZ = (0,math_scalar_functions.RandomRange)(this.direction1.z, this.direction2.z);
        if (isLocal) {
            directionToUpdate.x = randX;
            directionToUpdate.y = randY;
            directionToUpdate.z = randZ;
            return;
        }
        math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);
    }
    /**
     * Called by the particle System when the position is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param positionToUpdate is the position vector to update with the result
     * @param particle is the particle we are computed the position for
     * @param isLocal defines if the position should be set in local space
     */
    startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {
        const randX = (0,math_scalar_functions.RandomRange)(this.minEmitBox.x, this.maxEmitBox.x);
        const randY = (0,math_scalar_functions.RandomRange)(this.minEmitBox.y, this.maxEmitBox.y);
        const randZ = (0,math_scalar_functions.RandomRange)(this.minEmitBox.z, this.maxEmitBox.z);
        if (isLocal) {
            positionToUpdate.x = randX;
            positionToUpdate.y = randY;
            positionToUpdate.z = randZ;
            return;
        }
        math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new BoxParticleEmitter();
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setVector3("direction1", this.direction1);
        uboOrEffect.setVector3("direction2", this.direction2);
        uboOrEffect.setVector3("minEmitBox", this.minEmitBox);
        uboOrEffect.setVector3("maxEmitBox", this.maxEmitBox);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("direction1", 3);
        ubo.addUniform("direction2", 3);
        ubo.addUniform("minEmitBox", 3);
        ubo.addUniform("maxEmitBox", 3);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "#define BOXEMITTER";
    }
    /**
     * Returns the string "BoxParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "BoxParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.type = this.getClassName();
        serializationObject.direction1 = this.direction1.asArray();
        serializationObject.direction2 = this.direction2.asArray();
        serializationObject.minEmitBox = this.minEmitBox.asArray();
        serializationObject.maxEmitBox = this.maxEmitBox.asArray();
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.direction1, 0, this.direction1);
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.direction2, 0, this.direction2);
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.minEmitBox, 0, this.minEmitBox);
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.maxEmitBox, 0, this.maxEmitBox);
    }
}
//# sourceMappingURL=boxParticleEmitter.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.functions.js
var imageProcessingConfiguration_functions = __webpack_require__(80010);
;// ./node_modules/@babylonjs/core/Particles/thinParticleSystem.js

















/**
 * This represents a thin particle system in Babylon.
 * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
 * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function.
 * This thin version contains a limited subset of the total features in order to provide users with a way to get particles but with a smaller footprint
 * @example https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
 */
class ThinParticleSystem extends BaseParticleSystem {
    /**
     * Sets a callback that will be triggered when the system is disposed
     */
    set onDispose(callback) {
        if (this._onDisposeObserver) {
            this.onDisposeObservable.remove(this._onDisposeObserver);
        }
        this._onDisposeObserver = this.onDisposeObservable.add(callback);
    }
    /** Gets or sets a boolean indicating that ramp gradients must be used
     * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro#ramp-gradients
     */
    get useRampGradients() {
        return this._useRampGradients;
    }
    set useRampGradients(value) {
        if (this._useRampGradients === value) {
            return;
        }
        this._useRampGradients = value;
        this._resetEffect();
    }
    /**
     * Gets the current list of active particles
     */
    get particles() {
        return this._particles;
    }
    /**
     * Gets the shader language used in this material.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Gets the number of particles active at the same time.
     * @returns The number of active particles.
     */
    getActiveCount() {
        return this._particles.length;
    }
    /**
     * Returns the string "ParticleSystem"
     * @returns a string containing the class name
     */
    getClassName() {
        return "ParticleSystem";
    }
    /**
     * Gets a boolean indicating that the system is stopping
     * @returns true if the system is currently stopping
     */
    isStopping() {
        return this._stopped && this.isAlive();
    }
    /**
     * Gets the custom effect used to render the particles
     * @param blendMode Blend mode for which the effect should be retrieved
     * @returns The effect
     */
    getCustomEffect(blendMode = 0) {
        return this._customWrappers[blendMode]?.effect ?? this._customWrappers[0].effect;
    }
    _getCustomDrawWrapper(blendMode = 0) {
        return this._customWrappers[blendMode] ?? this._customWrappers[0];
    }
    /**
     * Sets the custom effect used to render the particles
     * @param effect The effect to set
     * @param blendMode Blend mode for which the effect should be set
     */
    setCustomEffect(effect, blendMode = 0) {
        this._customWrappers[blendMode] = new Materials_drawWrapper/* DrawWrapper */.E(this._engine);
        this._customWrappers[blendMode].effect = effect;
        if (this._customWrappers[blendMode].drawContext) {
            this._customWrappers[blendMode].drawContext.useInstancing = this._useInstancing;
        }
    }
    /**
     * Observable that will be called just before the particles are drawn
     */
    get onBeforeDrawParticlesObservable() {
        if (!this._onBeforeDrawParticlesObservable) {
            this._onBeforeDrawParticlesObservable = new Misc_observable/* Observable */.cP();
        }
        return this._onBeforeDrawParticlesObservable;
    }
    /**
     * Gets the name of the particle vertex shader
     */
    get vertexShaderName() {
        return "particles";
    }
    /**
     * Gets the vertex buffers used by the particle system
     */
    get vertexBuffers() {
        return this._vertexBuffers;
    }
    /**
     * Gets the index buffer used by the particle system (or null if no index buffer is used (if _useInstancing=true))
     */
    get indexBuffer() {
        return this._indexBuffer;
    }
    /**
     * Instantiates a particle system.
     * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
     * @param name The name of the particle system
     * @param capacity The max number of particles alive at the same time
     * @param sceneOrEngine The scene the particle system belongs to or the engine to use if no scene
     * @param customEffect a custom effect used to change the way particles are rendered by default
     * @param isAnimationSheetEnabled Must be true if using a spritesheet to animate the particles texture
     * @param epsilon Offset used to render the particles
     */
    constructor(name, capacity, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = false, epsilon = 0.01) {
        super(name);
        this._emitterInverseWorldMatrix = math_vector/* Matrix */.uq.Identity();
        /**
         * @internal
         */
        this._inheritedVelocityOffset = new math_vector/* Vector3 */.Pq();
        /**
         * An event triggered when the system is disposed
         */
        this.onDisposeObservable = new Misc_observable/* Observable */.cP();
        /**
         * An event triggered when the system is stopped
         */
        this.onStoppedObservable = new Misc_observable/* Observable */.cP();
        this._particles = new Array();
        this._stockParticles = new Array();
        this._newPartsExcess = 0;
        this._vertexBuffers = {};
        this._scaledColorStep = new math_color/* Color4 */.ov(0, 0, 0, 0);
        this._colorDiff = new math_color/* Color4 */.ov(0, 0, 0, 0);
        this._scaledDirection = math_vector/* Vector3 */.Pq.Zero();
        this._scaledGravity = math_vector/* Vector3 */.Pq.Zero();
        this._currentRenderId = -1;
        this._useInstancing = false;
        this._started = false;
        this._stopped = false;
        this._actualFrame = 0;
        /** @internal */
        this._currentEmitRate1 = 0;
        /** @internal */
        this._currentEmitRate2 = 0;
        /** @internal */
        this._currentStartSize1 = 0;
        /** @internal */
        this._currentStartSize2 = 0;
        /** Indicates that the update of particles is done in the animate function */
        this.updateInAnimate = true;
        this._rawTextureWidth = 256;
        this._useRampGradients = false;
        /**
         * Specifies if the particles are updated in emitter local space or world space
         */
        this.isLocal = false;
        /** Indicates that the particle system is CPU based */
        this.isGPU = false;
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        /** @internal */
        this._onBeforeDrawParticlesObservable = null;
        /** @internal */
        this._emitFromParticle = (particle) => {
            // Do nothing
        };
        // start of sub system methods
        /**
         * "Recycles" one of the particle by copying it back to the "stock" of particles and removing it from the active list.
         * Its lifetime will start back at 0.
         * @param particle
         */
        this.recycleParticle = (particle) => {
            // move particle from activeParticle list to stock particles
            const lastParticle = this._particles.pop();
            if (lastParticle !== particle) {
                lastParticle.copyTo(particle);
            }
            this._stockParticles.push(lastParticle);
        };
        this._createParticle = () => {
            let particle;
            if (this._stockParticles.length !== 0) {
                particle = this._stockParticles.pop();
                particle._reset();
            }
            else {
                particle = new Particle(this);
            }
            this._prepareParticle(particle);
            return particle;
        };
        this._shadersLoaded = false;
        this._capacity = capacity;
        this._epsilon = epsilon;
        this._isAnimationSheetEnabled = isAnimationSheetEnabled;
        if (!sceneOrEngine || sceneOrEngine.getClassName() === "Scene") {
            this._scene = sceneOrEngine || engineStore/* EngineStore */.q.LastCreatedScene;
            this._engine = this._scene.getEngine();
            this.uniqueId = this._scene.getUniqueId();
            this._scene.particleSystems.push(this);
        }
        else {
            this._engine = sceneOrEngine;
            this.defaultProjectionMatrix = math_vector/* Matrix */.uq.PerspectiveFovLH(0.8, 1, 0.1, 100, this._engine.isNDCHalfZRange);
        }
        if (this._engine.getCaps().vertexArrayObject) {
            this._vertexArrayObject = null;
        }
        this._initShaderSourceAsync();
        // Setup the default processing configuration to the scene.
        this._attachImageProcessingConfiguration(null);
        // eslint-disable-next-line @typescript-eslint/naming-convention
        this._customWrappers = { 0: new Materials_drawWrapper/* DrawWrapper */.E(this._engine) };
        this._customWrappers[0].effect = customEffect;
        this._drawWrappers = [];
        this._useInstancing = this._engine.getCaps().instancedArrays;
        this._createIndexBuffer();
        this._createVertexBuffers();
        // Default emitter type
        this.particleEmitterType = new BoxParticleEmitter();
        let noiseTextureData = null;
        // Update
        this.updateFunction = (particles) => {
            let noiseTextureSize = null;
            if (this.noiseTexture) {
                // We need to get texture data back to CPU
                noiseTextureSize = this.noiseTexture.getSize();
                this.noiseTexture.getContent()?.then((data) => {
                    noiseTextureData = data;
                });
            }
            const sameParticleArray = particles === this._particles;
            for (let index = 0; index < particles.length; index++) {
                const particle = particles[index];
                let scaledUpdateSpeed = this._scaledUpdateSpeed;
                const previousAge = particle.age;
                particle.age += scaledUpdateSpeed;
                // Evaluate step to death
                if (particle.age > particle.lifeTime) {
                    const diff = particle.age - previousAge;
                    const oldDiff = particle.lifeTime - previousAge;
                    scaledUpdateSpeed = (oldDiff * scaledUpdateSpeed) / diff;
                    particle.age = particle.lifeTime;
                }
                const ratio = particle.age / particle.lifeTime;
                // Color
                if (this._colorGradients && this._colorGradients.length > 0) {
                    GradientHelper.GetCurrentGradient(ratio, this._colorGradients, (currentGradient, nextGradient, scale) => {
                        if (currentGradient !== particle._currentColorGradient) {
                            particle._currentColor1.copyFrom(particle._currentColor2);
                            nextGradient.getColorToRef(particle._currentColor2);
                            particle._currentColorGradient = currentGradient;
                        }
                        math_color/* Color4 */.ov.LerpToRef(particle._currentColor1, particle._currentColor2, scale, particle.color);
                    });
                }
                else {
                    particle.colorStep.scaleToRef(scaledUpdateSpeed, this._scaledColorStep);
                    particle.color.addInPlace(this._scaledColorStep);
                    if (particle.color.a < 0) {
                        particle.color.a = 0;
                    }
                }
                // Angular speed
                if (this._angularSpeedGradients && this._angularSpeedGradients.length > 0) {
                    GradientHelper.GetCurrentGradient(ratio, this._angularSpeedGradients, (currentGradient, nextGradient, scale) => {
                        if (currentGradient !== particle._currentAngularSpeedGradient) {
                            particle._currentAngularSpeed1 = particle._currentAngularSpeed2;
                            particle._currentAngularSpeed2 = nextGradient.getFactor();
                            particle._currentAngularSpeedGradient = currentGradient;
                        }
                        particle.angularSpeed = (0,math_scalar_functions.Lerp)(particle._currentAngularSpeed1, particle._currentAngularSpeed2, scale);
                    });
                }
                particle.angle += particle.angularSpeed * scaledUpdateSpeed;
                // Direction
                let directionScale = scaledUpdateSpeed;
                /// Velocity
                if (this._velocityGradients && this._velocityGradients.length > 0) {
                    GradientHelper.GetCurrentGradient(ratio, this._velocityGradients, (currentGradient, nextGradient, scale) => {
                        if (currentGradient !== particle._currentVelocityGradient) {
                            particle._currentVelocity1 = particle._currentVelocity2;
                            particle._currentVelocity2 = nextGradient.getFactor();
                            particle._currentVelocityGradient = currentGradient;
                        }
                        directionScale *= (0,math_scalar_functions.Lerp)(particle._currentVelocity1, particle._currentVelocity2, scale);
                    });
                }
                particle.direction.scaleToRef(directionScale, this._scaledDirection);
                /// Limit velocity
                if (this._limitVelocityGradients && this._limitVelocityGradients.length > 0) {
                    GradientHelper.GetCurrentGradient(ratio, this._limitVelocityGradients, (currentGradient, nextGradient, scale) => {
                        if (currentGradient !== particle._currentLimitVelocityGradient) {
                            particle._currentLimitVelocity1 = particle._currentLimitVelocity2;
                            particle._currentLimitVelocity2 = nextGradient.getFactor();
                            particle._currentLimitVelocityGradient = currentGradient;
                        }
                        const limitVelocity = (0,math_scalar_functions.Lerp)(particle._currentLimitVelocity1, particle._currentLimitVelocity2, scale);
                        const currentVelocity = particle.direction.length();
                        if (currentVelocity > limitVelocity) {
                            particle.direction.scaleInPlace(this.limitVelocityDamping);
                        }
                    });
                }
                /// Drag
                if (this._dragGradients && this._dragGradients.length > 0) {
                    GradientHelper.GetCurrentGradient(ratio, this._dragGradients, (currentGradient, nextGradient, scale) => {
                        if (currentGradient !== particle._currentDragGradient) {
                            particle._currentDrag1 = particle._currentDrag2;
                            particle._currentDrag2 = nextGradient.getFactor();
                            particle._currentDragGradient = currentGradient;
                        }
                        const drag = (0,math_scalar_functions.Lerp)(particle._currentDrag1, particle._currentDrag2, scale);
                        this._scaledDirection.scaleInPlace(1.0 - drag);
                    });
                }
                if (this.isLocal && particle._localPosition) {
                    particle._localPosition.addInPlace(this._scaledDirection);
                    math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(particle._localPosition, this._emitterWorldMatrix, particle.position);
                }
                else {
                    particle.position.addInPlace(this._scaledDirection);
                }
                // Noise
                if (noiseTextureData && noiseTextureSize && particle._randomNoiseCoordinates1) {
                    const fetchedColorR = this._fetchR(particle._randomNoiseCoordinates1.x, particle._randomNoiseCoordinates1.y, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData);
                    const fetchedColorG = this._fetchR(particle._randomNoiseCoordinates1.z, particle._randomNoiseCoordinates2.x, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData);
                    const fetchedColorB = this._fetchR(particle._randomNoiseCoordinates2.y, particle._randomNoiseCoordinates2.z, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData);
                    const force = math_vector/* TmpVectors */.AA.Vector3[0];
                    const scaledForce = math_vector/* TmpVectors */.AA.Vector3[1];
                    force.copyFromFloats((2 * fetchedColorR - 1) * this.noiseStrength.x, (2 * fetchedColorG - 1) * this.noiseStrength.y, (2 * fetchedColorB - 1) * this.noiseStrength.z);
                    force.scaleToRef(scaledUpdateSpeed, scaledForce);
                    particle.direction.addInPlace(scaledForce);
                }
                // Gravity
                this.gravity.scaleToRef(scaledUpdateSpeed, this._scaledGravity);
                particle.direction.addInPlace(this._scaledGravity);
                // Size
                if (this._sizeGradients && this._sizeGradients.length > 0) {
                    GradientHelper.GetCurrentGradient(ratio, this._sizeGradients, (currentGradient, nextGradient, scale) => {
                        if (currentGradient !== particle._currentSizeGradient) {
                            particle._currentSize1 = particle._currentSize2;
                            particle._currentSize2 = nextGradient.getFactor();
                            particle._currentSizeGradient = currentGradient;
                        }
                        particle.size = (0,math_scalar_functions.Lerp)(particle._currentSize1, particle._currentSize2, scale);
                    });
                }
                // Remap data
                if (this._useRampGradients) {
                    if (this._colorRemapGradients && this._colorRemapGradients.length > 0) {
                        GradientHelper.GetCurrentGradient(ratio, this._colorRemapGradients, (currentGradient, nextGradient, scale) => {
                            const min = (0,math_scalar_functions.Lerp)(currentGradient.factor1, nextGradient.factor1, scale);
                            const max = (0,math_scalar_functions.Lerp)(currentGradient.factor2, nextGradient.factor2, scale);
                            particle.remapData.x = min;
                            particle.remapData.y = max - min;
                        });
                    }
                    if (this._alphaRemapGradients && this._alphaRemapGradients.length > 0) {
                        GradientHelper.GetCurrentGradient(ratio, this._alphaRemapGradients, (currentGradient, nextGradient, scale) => {
                            const min = (0,math_scalar_functions.Lerp)(currentGradient.factor1, nextGradient.factor1, scale);
                            const max = (0,math_scalar_functions.Lerp)(currentGradient.factor2, nextGradient.factor2, scale);
                            particle.remapData.z = min;
                            particle.remapData.w = max - min;
                        });
                    }
                }
                if (this._isAnimationSheetEnabled) {
                    particle.updateCellIndex();
                }
                // Update the position of the attached sub-emitters to match their attached particle
                particle._inheritParticleInfoToSubEmitters();
                if (particle.age >= particle.lifeTime) {
                    // Recycle by swapping with last particle
                    this._emitFromParticle(particle);
                    if (particle._attachedSubEmitters) {
                        particle._attachedSubEmitters.forEach((subEmitter) => {
                            subEmitter.particleSystem.disposeOnStop = true;
                            subEmitter.particleSystem.stop();
                        });
                        particle._attachedSubEmitters = null;
                    }
                    this.recycleParticle(particle);
                    if (sameParticleArray) {
                        index--;
                    }
                    continue;
                }
            }
        };
    }
    serialize(serializeTexture) {
        throw new Error("Method not implemented.");
    }
    /**
     * Clones the particle system.
     * @param name The name of the cloned object
     * @param newEmitter The new emitter to use
     * @param cloneTexture Also clone the textures if true
     */
    clone(name, newEmitter, cloneTexture = false) {
        throw new Error("Method not implemented.");
    }
    _addFactorGradient(factorGradients, gradient, factor, factor2) {
        const newGradient = new FactorGradient(gradient, factor, factor2);
        factorGradients.push(newGradient);
        factorGradients.sort((a, b) => {
            if (a.gradient < b.gradient) {
                return -1;
            }
            else if (a.gradient > b.gradient) {
                return 1;
            }
            return 0;
        });
    }
    _removeFactorGradient(factorGradients, gradient) {
        if (!factorGradients) {
            return;
        }
        let index = 0;
        for (const factorGradient of factorGradients) {
            if (factorGradient.gradient === gradient) {
                factorGradients.splice(index, 1);
                break;
            }
            index++;
        }
    }
    /**
     * Adds a new life time gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the life time factor to affect to the specified gradient
     * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
     * @returns the current particle system
     */
    addLifeTimeGradient(gradient, factor, factor2) {
        if (!this._lifeTimeGradients) {
            this._lifeTimeGradients = [];
        }
        this._addFactorGradient(this._lifeTimeGradients, gradient, factor, factor2);
        return this;
    }
    /**
     * Remove a specific life time gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeLifeTimeGradient(gradient) {
        this._removeFactorGradient(this._lifeTimeGradients, gradient);
        return this;
    }
    /**
     * Adds a new size gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the size factor to affect to the specified gradient
     * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
     * @returns the current particle system
     */
    addSizeGradient(gradient, factor, factor2) {
        if (!this._sizeGradients) {
            this._sizeGradients = [];
        }
        this._addFactorGradient(this._sizeGradients, gradient, factor, factor2);
        return this;
    }
    /**
     * Remove a specific size gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeSizeGradient(gradient) {
        this._removeFactorGradient(this._sizeGradients, gradient);
        return this;
    }
    /**
     * Adds a new color remap gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param min defines the color remap minimal range
     * @param max defines the color remap maximal range
     * @returns the current particle system
     */
    addColorRemapGradient(gradient, min, max) {
        if (!this._colorRemapGradients) {
            this._colorRemapGradients = [];
        }
        this._addFactorGradient(this._colorRemapGradients, gradient, min, max);
        return this;
    }
    /**
     * Remove a specific color remap gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeColorRemapGradient(gradient) {
        this._removeFactorGradient(this._colorRemapGradients, gradient);
        return this;
    }
    /**
     * Adds a new alpha remap gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param min defines the alpha remap minimal range
     * @param max defines the alpha remap maximal range
     * @returns the current particle system
     */
    addAlphaRemapGradient(gradient, min, max) {
        if (!this._alphaRemapGradients) {
            this._alphaRemapGradients = [];
        }
        this._addFactorGradient(this._alphaRemapGradients, gradient, min, max);
        return this;
    }
    /**
     * Remove a specific alpha remap gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeAlphaRemapGradient(gradient) {
        this._removeFactorGradient(this._alphaRemapGradients, gradient);
        return this;
    }
    /**
     * Adds a new angular speed gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the angular speed  to affect to the specified gradient
     * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
     * @returns the current particle system
     */
    addAngularSpeedGradient(gradient, factor, factor2) {
        if (!this._angularSpeedGradients) {
            this._angularSpeedGradients = [];
        }
        this._addFactorGradient(this._angularSpeedGradients, gradient, factor, factor2);
        return this;
    }
    /**
     * Remove a specific angular speed gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeAngularSpeedGradient(gradient) {
        this._removeFactorGradient(this._angularSpeedGradients, gradient);
        return this;
    }
    /**
     * Adds a new velocity gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the velocity to affect to the specified gradient
     * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
     * @returns the current particle system
     */
    addVelocityGradient(gradient, factor, factor2) {
        if (!this._velocityGradients) {
            this._velocityGradients = [];
        }
        this._addFactorGradient(this._velocityGradients, gradient, factor, factor2);
        return this;
    }
    /**
     * Remove a specific velocity gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeVelocityGradient(gradient) {
        this._removeFactorGradient(this._velocityGradients, gradient);
        return this;
    }
    /**
     * Adds a new limit velocity gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the limit velocity value to affect to the specified gradient
     * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
     * @returns the current particle system
     */
    addLimitVelocityGradient(gradient, factor, factor2) {
        if (!this._limitVelocityGradients) {
            this._limitVelocityGradients = [];
        }
        this._addFactorGradient(this._limitVelocityGradients, gradient, factor, factor2);
        return this;
    }
    /**
     * Remove a specific limit velocity gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeLimitVelocityGradient(gradient) {
        this._removeFactorGradient(this._limitVelocityGradients, gradient);
        return this;
    }
    /**
     * Adds a new drag gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the drag value to affect to the specified gradient
     * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
     * @returns the current particle system
     */
    addDragGradient(gradient, factor, factor2) {
        if (!this._dragGradients) {
            this._dragGradients = [];
        }
        this._addFactorGradient(this._dragGradients, gradient, factor, factor2);
        return this;
    }
    /**
     * Remove a specific drag gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeDragGradient(gradient) {
        this._removeFactorGradient(this._dragGradients, gradient);
        return this;
    }
    /**
     * Adds a new emit rate gradient (please note that this will only work if you set the targetStopDuration property)
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the emit rate value to affect to the specified gradient
     * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
     * @returns the current particle system
     */
    addEmitRateGradient(gradient, factor, factor2) {
        if (!this._emitRateGradients) {
            this._emitRateGradients = [];
        }
        this._addFactorGradient(this._emitRateGradients, gradient, factor, factor2);
        return this;
    }
    /**
     * Remove a specific emit rate gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeEmitRateGradient(gradient) {
        this._removeFactorGradient(this._emitRateGradients, gradient);
        return this;
    }
    /**
     * Adds a new start size gradient (please note that this will only work if you set the targetStopDuration property)
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the start size value to affect to the specified gradient
     * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
     * @returns the current particle system
     */
    addStartSizeGradient(gradient, factor, factor2) {
        if (!this._startSizeGradients) {
            this._startSizeGradients = [];
        }
        this._addFactorGradient(this._startSizeGradients, gradient, factor, factor2);
        return this;
    }
    /**
     * Remove a specific start size gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeStartSizeGradient(gradient) {
        this._removeFactorGradient(this._startSizeGradients, gradient);
        return this;
    }
    _createRampGradientTexture() {
        if (!this._rampGradients || !this._rampGradients.length || this._rampGradientsTexture || !this._scene) {
            return;
        }
        const data = new Uint8Array(this._rawTextureWidth * 4);
        const tmpColor = math_color/* TmpColors */.IG.Color3[0];
        for (let x = 0; x < this._rawTextureWidth; x++) {
            const ratio = x / this._rawTextureWidth;
            GradientHelper.GetCurrentGradient(ratio, this._rampGradients, (currentGradient, nextGradient, scale) => {
                math_color/* Color3 */.v9.LerpToRef(currentGradient.color, nextGradient.color, scale, tmpColor);
                data[x * 4] = tmpColor.r * 255;
                data[x * 4 + 1] = tmpColor.g * 255;
                data[x * 4 + 2] = tmpColor.b * 255;
                data[x * 4 + 3] = 255;
            });
        }
        this._rampGradientsTexture = rawTexture/* RawTexture */.I.CreateRGBATexture(data, this._rawTextureWidth, 1, this._scene, false, false, 1);
    }
    /**
     * Gets the current list of ramp gradients.
     * You must use addRampGradient and removeRampGradient to update this list
     * @returns the list of ramp gradients
     */
    getRampGradients() {
        return this._rampGradients;
    }
    /** Force the system to rebuild all gradients that need to be resync */
    forceRefreshGradients() {
        this._syncRampGradientTexture();
    }
    _syncRampGradientTexture() {
        if (!this._rampGradients) {
            return;
        }
        this._rampGradients.sort((a, b) => {
            if (a.gradient < b.gradient) {
                return -1;
            }
            else if (a.gradient > b.gradient) {
                return 1;
            }
            return 0;
        });
        if (this._rampGradientsTexture) {
            this._rampGradientsTexture.dispose();
            this._rampGradientsTexture = null;
        }
        this._createRampGradientTexture();
    }
    /**
     * Adds a new ramp gradient used to remap particle colors
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param color defines the color to affect to the specified gradient
     * @returns the current particle system
     */
    addRampGradient(gradient, color) {
        if (!this._rampGradients) {
            this._rampGradients = [];
        }
        const rampGradient = new Color3Gradient(gradient, color);
        this._rampGradients.push(rampGradient);
        this._syncRampGradientTexture();
        return this;
    }
    /**
     * Remove a specific ramp gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeRampGradient(gradient) {
        this._removeGradientAndTexture(gradient, this._rampGradients, this._rampGradientsTexture);
        this._rampGradientsTexture = null;
        if (this._rampGradients && this._rampGradients.length > 0) {
            this._createRampGradientTexture();
        }
        return this;
    }
    /**
     * Adds a new color gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param color1 defines the color to affect to the specified gradient
     * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from
     * @returns this particle system
     */
    addColorGradient(gradient, color1, color2) {
        if (!this._colorGradients) {
            this._colorGradients = [];
        }
        const colorGradient = new ColorGradient(gradient, color1, color2);
        this._colorGradients.push(colorGradient);
        this._colorGradients.sort((a, b) => {
            if (a.gradient < b.gradient) {
                return -1;
            }
            else if (a.gradient > b.gradient) {
                return 1;
            }
            return 0;
        });
        return this;
    }
    /**
     * Remove a specific color gradient
     * @param gradient defines the gradient to remove
     * @returns this particle system
     */
    removeColorGradient(gradient) {
        if (!this._colorGradients) {
            return this;
        }
        let index = 0;
        for (const colorGradient of this._colorGradients) {
            if (colorGradient.gradient === gradient) {
                this._colorGradients.splice(index, 1);
                break;
            }
            index++;
        }
        return this;
    }
    /**
     * Resets the draw wrappers cache
     */
    resetDrawCache() {
        for (const drawWrappers of this._drawWrappers) {
            if (drawWrappers) {
                for (const drawWrapper of drawWrappers) {
                    drawWrapper?.dispose();
                }
            }
        }
        this._drawWrappers = [];
    }
    _fetchR(u, v, width, height, pixels) {
        u = Math.abs(u) * 0.5 + 0.5;
        v = Math.abs(v) * 0.5 + 0.5;
        const wrappedU = (u * width) % width | 0;
        const wrappedV = (v * height) % height | 0;
        const position = (wrappedU + wrappedV * width) * 4;
        return pixels[position] / 255;
    }
    _reset() {
        this._resetEffect();
    }
    _resetEffect() {
        if (this._vertexBuffer) {
            this._vertexBuffer.dispose();
            this._vertexBuffer = null;
        }
        if (this._spriteBuffer) {
            this._spriteBuffer.dispose();
            this._spriteBuffer = null;
        }
        if (this._vertexArrayObject) {
            this._engine.releaseVertexArrayObject(this._vertexArrayObject);
            this._vertexArrayObject = null;
        }
        this._createVertexBuffers();
    }
    _createVertexBuffers() {
        this._vertexBufferSize = this._useInstancing ? 10 : 12;
        if (this._isAnimationSheetEnabled) {
            this._vertexBufferSize += 1;
        }
        if (!this._isBillboardBased ||
            this.billboardMode === 8 ||
            this.billboardMode === 9) {
            this._vertexBufferSize += 3;
        }
        if (this._useRampGradients) {
            this._vertexBufferSize += 4;
        }
        const engine = this._engine;
        const vertexSize = this._vertexBufferSize * (this._useInstancing ? 1 : 4);
        this._vertexData = new Float32Array(this._capacity * vertexSize);
        this._vertexBuffer = new Buffers_buffer/* Buffer */.h(engine, this._vertexData, true, vertexSize);
        let dataOffset = 0;
        const positions = this._vertexBuffer.createVertexBuffer(Buffers_buffer/* VertexBuffer */.R.PositionKind, dataOffset, 3, this._vertexBufferSize, this._useInstancing);
        this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = positions;
        dataOffset += 3;
        const colors = this._vertexBuffer.createVertexBuffer(Buffers_buffer/* VertexBuffer */.R.ColorKind, dataOffset, 4, this._vertexBufferSize, this._useInstancing);
        this._vertexBuffers[Buffers_buffer/* VertexBuffer */.R.ColorKind] = colors;
        dataOffset += 4;
        const options = this._vertexBuffer.createVertexBuffer("angle", dataOffset, 1, this._vertexBufferSize, this._useInstancing);
        this._vertexBuffers["angle"] = options;
        dataOffset += 1;
        const size = this._vertexBuffer.createVertexBuffer("size", dataOffset, 2, this._vertexBufferSize, this._useInstancing);
        this._vertexBuffers["size"] = size;
        dataOffset += 2;
        if (this._isAnimationSheetEnabled) {
            const cellIndexBuffer = this._vertexBuffer.createVertexBuffer("cellIndex", dataOffset, 1, this._vertexBufferSize, this._useInstancing);
            this._vertexBuffers["cellIndex"] = cellIndexBuffer;
            dataOffset += 1;
        }
        if (!this._isBillboardBased ||
            this.billboardMode === 8 ||
            this.billboardMode === 9) {
            const directionBuffer = this._vertexBuffer.createVertexBuffer("direction", dataOffset, 3, this._vertexBufferSize, this._useInstancing);
            this._vertexBuffers["direction"] = directionBuffer;
            dataOffset += 3;
        }
        if (this._useRampGradients) {
            const rampDataBuffer = this._vertexBuffer.createVertexBuffer("remapData", dataOffset, 4, this._vertexBufferSize, this._useInstancing);
            this._vertexBuffers["remapData"] = rampDataBuffer;
            dataOffset += 4;
        }
        let offsets;
        if (this._useInstancing) {
            const spriteData = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);
            this._spriteBuffer = new Buffers_buffer/* Buffer */.h(engine, spriteData, false, 2);
            offsets = this._spriteBuffer.createVertexBuffer("offset", 0, 2);
        }
        else {
            offsets = this._vertexBuffer.createVertexBuffer("offset", dataOffset, 2, this._vertexBufferSize, this._useInstancing);
            dataOffset += 2;
        }
        this._vertexBuffers["offset"] = offsets;
        this.resetDrawCache();
    }
    _createIndexBuffer() {
        if (this._useInstancing) {
            this._linesIndexBufferUseInstancing = this._engine.createIndexBuffer(new Uint32Array([0, 1, 1, 3, 3, 2, 2, 0, 0, 3]));
            return;
        }
        const indices = [];
        const indicesWireframe = [];
        let index = 0;
        for (let count = 0; count < this._capacity; count++) {
            indices.push(index);
            indices.push(index + 1);
            indices.push(index + 2);
            indices.push(index);
            indices.push(index + 2);
            indices.push(index + 3);
            indicesWireframe.push(index, index + 1, index + 1, index + 2, index + 2, index + 3, index + 3, index, index, index + 3);
            index += 4;
        }
        this._indexBuffer = this._engine.createIndexBuffer(indices);
        this._linesIndexBuffer = this._engine.createIndexBuffer(indicesWireframe);
    }
    /**
     * Gets the maximum number of particles active at the same time.
     * @returns The max number of active particles.
     */
    getCapacity() {
        return this._capacity;
    }
    /**
     * Gets whether there are still active particles in the system.
     * @returns True if it is alive, otherwise false.
     */
    isAlive() {
        return this._alive;
    }
    /**
     * Gets if the system has been started. (Note: this will still be true after stop is called)
     * @returns True if it has been started, otherwise false.
     */
    isStarted() {
        return this._started;
    }
    /** @internal */
    _preStart() {
        // Do nothing
    }
    /**
     * Starts the particle system and begins to emit
     * @param delay defines the delay in milliseconds before starting the system (this.startDelay by default)
     */
    start(delay = this.startDelay) {
        if (!this.targetStopDuration && this._hasTargetStopDurationDependantGradient()) {
            // eslint-disable-next-line no-throw-literal
            throw "Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";
        }
        if (delay) {
            setTimeout(() => {
                this.start(0);
            }, delay);
            return;
        }
        this._started = true;
        this._stopped = false;
        this._actualFrame = 0;
        this._preStart();
        // Reset emit gradient so it acts the same on every start
        if (this._emitRateGradients) {
            if (this._emitRateGradients.length > 0) {
                this._currentEmitRateGradient = this._emitRateGradients[0];
                this._currentEmitRate1 = this._currentEmitRateGradient.getFactor();
                this._currentEmitRate2 = this._currentEmitRate1;
            }
            if (this._emitRateGradients.length > 1) {
                this._currentEmitRate2 = this._emitRateGradients[1].getFactor();
            }
        }
        // Reset start size gradient so it acts the same on every start
        if (this._startSizeGradients) {
            if (this._startSizeGradients.length > 0) {
                this._currentStartSizeGradient = this._startSizeGradients[0];
                this._currentStartSize1 = this._currentStartSizeGradient.getFactor();
                this._currentStartSize2 = this._currentStartSize1;
            }
            if (this._startSizeGradients.length > 1) {
                this._currentStartSize2 = this._startSizeGradients[1].getFactor();
            }
        }
        if (this.preWarmCycles) {
            if (this.emitter?.getClassName().indexOf("Mesh") !== -1) {
                this.emitter.computeWorldMatrix(true);
            }
            const noiseTextureAsProcedural = this.noiseTexture;
            if (noiseTextureAsProcedural && noiseTextureAsProcedural.onGeneratedObservable) {
                noiseTextureAsProcedural.onGeneratedObservable.addOnce(() => {
                    setTimeout(() => {
                        for (let index = 0; index < this.preWarmCycles; index++) {
                            this.animate(true);
                            noiseTextureAsProcedural.render();
                        }
                    });
                });
            }
            else {
                for (let index = 0; index < this.preWarmCycles; index++) {
                    this.animate(true);
                }
            }
        }
        // Animations
        if (this.beginAnimationOnStart && this.animations && this.animations.length > 0 && this._scene) {
            this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop);
        }
    }
    /**
     * Stops the particle system.
     * @param stopSubEmitters if true it will stop the current system and all created sub-Systems if false it will stop the current root system only, this param is used by the root particle system only. The default value is true.
     */
    stop(stopSubEmitters = true) {
        if (this._stopped) {
            return;
        }
        this.onStoppedObservable.notifyObservers(this);
        this._stopped = true;
        this._postStop(stopSubEmitters);
    }
    /** @internal */
    _postStop(stopSubEmitters) {
        // Do nothing
    }
    // Animation sheet
    /**
     * Remove all active particles
     */
    reset() {
        this._stockParticles.length = 0;
        this._particles.length = 0;
    }
    /**
     * @internal (for internal use only)
     */
    _appendParticleVertex(index, particle, offsetX, offsetY) {
        let offset = index * this._vertexBufferSize;
        this._vertexData[offset++] = particle.position.x + this.worldOffset.x;
        this._vertexData[offset++] = particle.position.y + this.worldOffset.y;
        this._vertexData[offset++] = particle.position.z + this.worldOffset.z;
        this._vertexData[offset++] = particle.color.r;
        this._vertexData[offset++] = particle.color.g;
        this._vertexData[offset++] = particle.color.b;
        this._vertexData[offset++] = particle.color.a;
        this._vertexData[offset++] = particle.angle;
        this._vertexData[offset++] = particle.scale.x * particle.size;
        this._vertexData[offset++] = particle.scale.y * particle.size;
        if (this._isAnimationSheetEnabled) {
            this._vertexData[offset++] = particle.cellIndex;
        }
        if (!this._isBillboardBased) {
            if (particle._initialDirection) {
                let initialDirection = particle._initialDirection;
                if (this.isLocal) {
                    math_vector/* Vector3 */.Pq.TransformNormalToRef(initialDirection, this._emitterWorldMatrix, math_vector/* TmpVectors */.AA.Vector3[0]);
                    initialDirection = math_vector/* TmpVectors */.AA.Vector3[0];
                }
                if (initialDirection.x === 0 && initialDirection.z === 0) {
                    initialDirection.x = 0.001;
                }
                this._vertexData[offset++] = initialDirection.x;
                this._vertexData[offset++] = initialDirection.y;
                this._vertexData[offset++] = initialDirection.z;
            }
            else {
                let direction = particle.direction;
                if (this.isLocal) {
                    math_vector/* Vector3 */.Pq.TransformNormalToRef(direction, this._emitterWorldMatrix, math_vector/* TmpVectors */.AA.Vector3[0]);
                    direction = math_vector/* TmpVectors */.AA.Vector3[0];
                }
                if (direction.x === 0 && direction.z === 0) {
                    direction.x = 0.001;
                }
                this._vertexData[offset++] = direction.x;
                this._vertexData[offset++] = direction.y;
                this._vertexData[offset++] = direction.z;
            }
        }
        else if (this.billboardMode === 8 || this.billboardMode === 9) {
            this._vertexData[offset++] = particle.direction.x;
            this._vertexData[offset++] = particle.direction.y;
            this._vertexData[offset++] = particle.direction.z;
        }
        if (this._useRampGradients && particle.remapData) {
            this._vertexData[offset++] = particle.remapData.x;
            this._vertexData[offset++] = particle.remapData.y;
            this._vertexData[offset++] = particle.remapData.z;
            this._vertexData[offset++] = particle.remapData.w;
        }
        if (!this._useInstancing) {
            if (this._isAnimationSheetEnabled) {
                if (offsetX === 0) {
                    offsetX = this._epsilon;
                }
                else if (offsetX === 1) {
                    offsetX = 1 - this._epsilon;
                }
                if (offsetY === 0) {
                    offsetY = this._epsilon;
                }
                else if (offsetY === 1) {
                    offsetY = 1 - this._epsilon;
                }
            }
            this._vertexData[offset++] = offsetX;
            this._vertexData[offset++] = offsetY;
        }
    }
    /** @internal */
    _prepareParticle(particle) {
        //Do nothing
    }
    _update(newParticles) {
        // Update current
        this._alive = this._particles.length > 0;
        if (this.emitter.position) {
            const emitterMesh = this.emitter;
            this._emitterWorldMatrix = emitterMesh.getWorldMatrix();
        }
        else {
            const emitterPosition = this.emitter;
            this._emitterWorldMatrix = math_vector/* Matrix */.uq.Translation(emitterPosition.x, emitterPosition.y, emitterPosition.z);
        }
        this._emitterWorldMatrix.invertToRef(this._emitterInverseWorldMatrix);
        this.updateFunction(this._particles);
        // Add new ones
        let particle;
        for (let index = 0; index < newParticles; index++) {
            if (this._particles.length === this._capacity) {
                break;
            }
            particle = this._createParticle();
            this._particles.push(particle);
            // Life time
            if (this.targetStopDuration && this._lifeTimeGradients && this._lifeTimeGradients.length > 0) {
                const ratio = (0,math_scalar_functions.Clamp)(this._actualFrame / this.targetStopDuration);
                GradientHelper.GetCurrentGradient(ratio, this._lifeTimeGradients, (currentGradient, nextGradient) => {
                    const factorGradient1 = currentGradient;
                    const factorGradient2 = nextGradient;
                    const lifeTime1 = factorGradient1.getFactor();
                    const lifeTime2 = factorGradient2.getFactor();
                    const gradient = (ratio - factorGradient1.gradient) / (factorGradient2.gradient - factorGradient1.gradient);
                    particle.lifeTime = (0,math_scalar_functions.Lerp)(lifeTime1, lifeTime2, gradient);
                });
            }
            else {
                particle.lifeTime = (0,math_scalar_functions.RandomRange)(this.minLifeTime, this.maxLifeTime);
            }
            // Emitter
            const emitPower = (0,math_scalar_functions.RandomRange)(this.minEmitPower, this.maxEmitPower);
            if (this.startPositionFunction) {
                this.startPositionFunction(this._emitterWorldMatrix, particle.position, particle, this.isLocal);
            }
            else {
                this.particleEmitterType.startPositionFunction(this._emitterWorldMatrix, particle.position, particle, this.isLocal);
            }
            if (this.isLocal) {
                if (!particle._localPosition) {
                    particle._localPosition = particle.position.clone();
                }
                else {
                    particle._localPosition.copyFrom(particle.position);
                }
                math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(particle._localPosition, this._emitterWorldMatrix, particle.position);
            }
            if (this.startDirectionFunction) {
                this.startDirectionFunction(this._emitterWorldMatrix, particle.direction, particle, this.isLocal);
            }
            else {
                this.particleEmitterType.startDirectionFunction(this._emitterWorldMatrix, particle.direction, particle, this.isLocal, this._emitterInverseWorldMatrix);
            }
            if (emitPower === 0) {
                if (!particle._initialDirection) {
                    particle._initialDirection = particle.direction.clone();
                }
                else {
                    particle._initialDirection.copyFrom(particle.direction);
                }
            }
            else {
                particle._initialDirection = null;
            }
            particle.direction.scaleInPlace(emitPower);
            // Size
            if (!this._sizeGradients || this._sizeGradients.length === 0) {
                particle.size = (0,math_scalar_functions.RandomRange)(this.minSize, this.maxSize);
            }
            else {
                particle._currentSizeGradient = this._sizeGradients[0];
                particle._currentSize1 = particle._currentSizeGradient.getFactor();
                particle.size = particle._currentSize1;
                if (this._sizeGradients.length > 1) {
                    particle._currentSize2 = this._sizeGradients[1].getFactor();
                }
                else {
                    particle._currentSize2 = particle._currentSize1;
                }
            }
            // Size and scale
            particle.scale.copyFromFloats((0,math_scalar_functions.RandomRange)(this.minScaleX, this.maxScaleX), (0,math_scalar_functions.RandomRange)(this.minScaleY, this.maxScaleY));
            // Adjust scale by start size
            if (this._startSizeGradients && this._startSizeGradients[0] && this.targetStopDuration) {
                const ratio = this._actualFrame / this.targetStopDuration;
                GradientHelper.GetCurrentGradient(ratio, this._startSizeGradients, (currentGradient, nextGradient, scale) => {
                    if (currentGradient !== this._currentStartSizeGradient) {
                        this._currentStartSize1 = this._currentStartSize2;
                        this._currentStartSize2 = nextGradient.getFactor();
                        this._currentStartSizeGradient = currentGradient;
                    }
                    const value = (0,math_scalar_functions.Lerp)(this._currentStartSize1, this._currentStartSize2, scale);
                    particle.scale.scaleInPlace(value);
                });
            }
            // Angle
            if (!this._angularSpeedGradients || this._angularSpeedGradients.length === 0) {
                particle.angularSpeed = (0,math_scalar_functions.RandomRange)(this.minAngularSpeed, this.maxAngularSpeed);
            }
            else {
                particle._currentAngularSpeedGradient = this._angularSpeedGradients[0];
                particle.angularSpeed = particle._currentAngularSpeedGradient.getFactor();
                particle._currentAngularSpeed1 = particle.angularSpeed;
                if (this._angularSpeedGradients.length > 1) {
                    particle._currentAngularSpeed2 = this._angularSpeedGradients[1].getFactor();
                }
                else {
                    particle._currentAngularSpeed2 = particle._currentAngularSpeed1;
                }
            }
            particle.angle = (0,math_scalar_functions.RandomRange)(this.minInitialRotation, this.maxInitialRotation);
            // Velocity
            if (this._velocityGradients && this._velocityGradients.length > 0) {
                particle._currentVelocityGradient = this._velocityGradients[0];
                particle._currentVelocity1 = particle._currentVelocityGradient.getFactor();
                if (this._velocityGradients.length > 1) {
                    particle._currentVelocity2 = this._velocityGradients[1].getFactor();
                }
                else {
                    particle._currentVelocity2 = particle._currentVelocity1;
                }
            }
            // Limit velocity
            if (this._limitVelocityGradients && this._limitVelocityGradients.length > 0) {
                particle._currentLimitVelocityGradient = this._limitVelocityGradients[0];
                particle._currentLimitVelocity1 = particle._currentLimitVelocityGradient.getFactor();
                if (this._limitVelocityGradients.length > 1) {
                    particle._currentLimitVelocity2 = this._limitVelocityGradients[1].getFactor();
                }
                else {
                    particle._currentLimitVelocity2 = particle._currentLimitVelocity1;
                }
            }
            // Drag
            if (this._dragGradients && this._dragGradients.length > 0) {
                particle._currentDragGradient = this._dragGradients[0];
                particle._currentDrag1 = particle._currentDragGradient.getFactor();
                if (this._dragGradients.length > 1) {
                    particle._currentDrag2 = this._dragGradients[1].getFactor();
                }
                else {
                    particle._currentDrag2 = particle._currentDrag1;
                }
            }
            // Color
            if (!this._colorGradients || this._colorGradients.length === 0) {
                const step = (0,math_scalar_functions.RandomRange)(0, 1.0);
                math_color/* Color4 */.ov.LerpToRef(this.color1, this.color2, step, particle.color);
                this.colorDead.subtractToRef(particle.color, this._colorDiff);
                this._colorDiff.scaleToRef(1.0 / particle.lifeTime, particle.colorStep);
            }
            else {
                particle._currentColorGradient = this._colorGradients[0];
                particle._currentColorGradient.getColorToRef(particle.color);
                particle._currentColor1.copyFrom(particle.color);
                if (this._colorGradients.length > 1) {
                    this._colorGradients[1].getColorToRef(particle._currentColor2);
                }
                else {
                    particle._currentColor2.copyFrom(particle.color);
                }
            }
            // Sheet
            if (this._isAnimationSheetEnabled) {
                particle._initialStartSpriteCellID = this.startSpriteCellID;
                particle._initialEndSpriteCellID = this.endSpriteCellID;
                particle._initialSpriteCellLoop = this.spriteCellLoop;
            }
            // Inherited Velocity
            particle.direction.addInPlace(this._inheritedVelocityOffset);
            // Ramp
            if (this._useRampGradients) {
                particle.remapData = new math_vector/* Vector4 */.IU(0, 1, 0, 1);
            }
            // Noise texture coordinates
            if (this.noiseTexture) {
                if (particle._randomNoiseCoordinates1) {
                    particle._randomNoiseCoordinates1.copyFromFloats(Math.random(), Math.random(), Math.random());
                    particle._randomNoiseCoordinates2.copyFromFloats(Math.random(), Math.random(), Math.random());
                }
                else {
                    particle._randomNoiseCoordinates1 = new math_vector/* Vector3 */.Pq(Math.random(), Math.random(), Math.random());
                    particle._randomNoiseCoordinates2 = new math_vector/* Vector3 */.Pq(Math.random(), Math.random(), Math.random());
                }
            }
            // Update the position of the attached sub-emitters to match their attached particle
            particle._inheritParticleInfoToSubEmitters();
        }
    }
    /**
     * @internal
     */
    static _GetAttributeNamesOrOptions(isAnimationSheetEnabled = false, isBillboardBased = false, useRampGradients = false) {
        const attributeNamesOrOptions = [Buffers_buffer/* VertexBuffer */.R.PositionKind, Buffers_buffer/* VertexBuffer */.R.ColorKind, "angle", "offset", "size"];
        if (isAnimationSheetEnabled) {
            attributeNamesOrOptions.push("cellIndex");
        }
        if (!isBillboardBased) {
            attributeNamesOrOptions.push("direction");
        }
        if (useRampGradients) {
            attributeNamesOrOptions.push("remapData");
        }
        return attributeNamesOrOptions;
    }
    /**
     * @internal
     */
    static _GetEffectCreationOptions(isAnimationSheetEnabled = false, useLogarithmicDepth = false, applyFog = false) {
        const effectCreationOption = ["invView", "view", "projection", "textureMask", "translationPivot", "eyePosition"];
        (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.TV)(effectCreationOption);
        if (isAnimationSheetEnabled) {
            effectCreationOption.push("particlesInfos");
        }
        if (useLogarithmicDepth) {
            effectCreationOption.push("logarithmicDepthConstant");
        }
        if (applyFog) {
            effectCreationOption.push("vFogInfos");
            effectCreationOption.push("vFogColor");
        }
        return effectCreationOption;
    }
    /**
     * Fill the defines array according to the current settings of the particle system
     * @param defines Array to be updated
     * @param blendMode blend mode to take into account when updating the array
     * @param fillImageProcessing fills the image processing defines
     */
    fillDefines(defines, blendMode, fillImageProcessing = true) {
        if (this._scene) {
            (0,clipPlaneMaterialHelper/* prepareStringDefinesForClipPlanes */.tv)(this, this._scene, defines);
            if (this.applyFog && this._scene.fogEnabled && this._scene.fogMode !== 0) {
                defines.push("#define FOG");
            }
        }
        if (this._isAnimationSheetEnabled) {
            defines.push("#define ANIMATESHEET");
        }
        if (this.useLogarithmicDepth) {
            defines.push("#define LOGARITHMICDEPTH");
        }
        if (blendMode === BaseParticleSystem.BLENDMODE_MULTIPLY) {
            defines.push("#define BLENDMULTIPLYMODE");
        }
        if (this._useRampGradients) {
            defines.push("#define RAMPGRADIENT");
        }
        if (this._isBillboardBased) {
            defines.push("#define BILLBOARD");
            switch (this.billboardMode) {
                case 2:
                    defines.push("#define BILLBOARDY");
                    break;
                case 8:
                case 9:
                    defines.push("#define BILLBOARDSTRETCHED");
                    if (this.billboardMode === 9) {
                        defines.push("#define BILLBOARDSTRETCHED_LOCAL");
                    }
                    break;
                case 7:
                    defines.push("#define BILLBOARDMODE_ALL");
                    break;
                default:
                    break;
            }
        }
        if (fillImageProcessing && this._imageProcessingConfiguration) {
            this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines);
            defines.push(this._imageProcessingConfigurationDefines.toString());
        }
    }
    /**
     * Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system
     * @param uniforms Uniforms array to fill
     * @param attributes Attributes array to fill
     * @param samplers Samplers array to fill
     */
    fillUniformsAttributesAndSamplerNames(uniforms, attributes, samplers) {
        attributes.push(...ThinParticleSystem._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled, this._isBillboardBased &&
            this.billboardMode !== 8 &&
            this.billboardMode !== 9, this._useRampGradients));
        uniforms.push(...ThinParticleSystem._GetEffectCreationOptions(this._isAnimationSheetEnabled, this.useLogarithmicDepth, this.applyFog));
        samplers.push("diffuseSampler", "rampSampler");
        if (this._imageProcessingConfiguration) {
            (0,imageProcessingConfiguration_functions/* PrepareUniformsForImageProcessing */._)(uniforms, this._imageProcessingConfigurationDefines);
            (0,imageProcessingConfiguration_functions/* PrepareSamplersForImageProcessing */.C)(samplers, this._imageProcessingConfigurationDefines);
        }
    }
    /**
     * @internal
     */
    _getWrapper(blendMode) {
        const customWrapper = this._getCustomDrawWrapper(blendMode);
        if (customWrapper?.effect) {
            return customWrapper;
        }
        const defines = [];
        this.fillDefines(defines, blendMode);
        // Effect
        const currentRenderPassId = this._engine._features.supportRenderPasses ? this._engine.currentRenderPassId : 0;
        let drawWrappers = this._drawWrappers[currentRenderPassId];
        if (!drawWrappers) {
            drawWrappers = this._drawWrappers[currentRenderPassId] = [];
        }
        let drawWrapper = drawWrappers[blendMode];
        if (!drawWrapper) {
            drawWrapper = new Materials_drawWrapper/* DrawWrapper */.E(this._engine);
            if (drawWrapper.drawContext) {
                drawWrapper.drawContext.useInstancing = this._useInstancing;
            }
            drawWrappers[blendMode] = drawWrapper;
        }
        const join = defines.join("\n");
        if (drawWrapper.defines !== join) {
            const attributesNamesOrOptions = [];
            const effectCreationOption = [];
            const samplers = [];
            this.fillUniformsAttributesAndSamplerNames(effectCreationOption, attributesNamesOrOptions, samplers);
            drawWrapper.setEffect(this._engine.createEffect("particles", attributesNamesOrOptions, effectCreationOption, samplers, join, undefined, undefined, undefined, undefined, this._shaderLanguage), join);
        }
        return drawWrapper;
    }
    /**
     * Animates the particle system for the current frame by emitting new particles and or animating the living ones.
     * @param preWarmOnly will prevent the system from updating the vertex buffer (default is false)
     */
    animate(preWarmOnly = false) {
        if (!this._started) {
            return;
        }
        if (!preWarmOnly && this._scene) {
            // Check
            if (!this.isReady()) {
                return;
            }
            if (this._currentRenderId === this._scene.getFrameId()) {
                return;
            }
            this._currentRenderId = this._scene.getFrameId();
        }
        this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : this._scene?.getAnimationRatio() || 1);
        // Determine the number of particles we need to create
        let newParticles;
        if (this.manualEmitCount > -1) {
            newParticles = this.manualEmitCount;
            this._newPartsExcess = 0;
            this.manualEmitCount = 0;
        }
        else {
            let rate = this.emitRate;
            if (this._emitRateGradients && this._emitRateGradients.length > 0 && this.targetStopDuration) {
                const ratio = this._actualFrame / this.targetStopDuration;
                GradientHelper.GetCurrentGradient(ratio, this._emitRateGradients, (currentGradient, nextGradient, scale) => {
                    if (currentGradient !== this._currentEmitRateGradient) {
                        this._currentEmitRate1 = this._currentEmitRate2;
                        this._currentEmitRate2 = nextGradient.getFactor();
                        this._currentEmitRateGradient = currentGradient;
                    }
                    rate = (0,math_scalar_functions.Lerp)(this._currentEmitRate1, this._currentEmitRate2, scale);
                });
            }
            newParticles = (rate * this._scaledUpdateSpeed) >> 0;
            this._newPartsExcess += rate * this._scaledUpdateSpeed - newParticles;
        }
        if (this._newPartsExcess > 1.0) {
            newParticles += this._newPartsExcess >> 0;
            this._newPartsExcess -= this._newPartsExcess >> 0;
        }
        this._alive = false;
        if (!this._stopped) {
            this._actualFrame += this._scaledUpdateSpeed;
            if (this.targetStopDuration && this._actualFrame >= this.targetStopDuration) {
                this.stop();
            }
        }
        else {
            newParticles = 0;
        }
        this._update(newParticles);
        // Stopped?
        if (this._stopped) {
            if (!this._alive) {
                this._started = false;
                if (this.onAnimationEnd) {
                    this.onAnimationEnd();
                }
                if (this.disposeOnStop && this._scene) {
                    this._scene._toBeDisposed.push(this);
                }
            }
        }
        if (!preWarmOnly) {
            // Update VBO
            let offset = 0;
            for (let index = 0; index < this._particles.length; index++) {
                const particle = this._particles[index];
                this._appendParticleVertices(offset, particle);
                offset += this._useInstancing ? 1 : 4;
            }
            if (this._vertexBuffer) {
                this._vertexBuffer.updateDirectly(this._vertexData, 0, this._particles.length);
            }
        }
        if (this.manualEmitCount === 0 && this.disposeOnStop) {
            this.stop();
        }
    }
    _appendParticleVertices(offset, particle) {
        this._appendParticleVertex(offset++, particle, 0, 0);
        if (!this._useInstancing) {
            this._appendParticleVertex(offset++, particle, 1, 0);
            this._appendParticleVertex(offset++, particle, 1, 1);
            this._appendParticleVertex(offset++, particle, 0, 1);
        }
    }
    /**
     * Rebuilds the particle system.
     */
    rebuild() {
        if (this._engine.getCaps().vertexArrayObject) {
            this._vertexArrayObject = null;
        }
        this._createIndexBuffer();
        this._spriteBuffer?._rebuild();
        this._createVertexBuffers();
        this.resetDrawCache();
    }
    async _initShaderSourceAsync() {
        const engine = this._engine;
        if (engine.isWebGPU && !ThinParticleSystem.ForceGLSL) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 27323)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 96913))]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 59384)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 16066))]);
        }
        this._shadersLoaded = true;
    }
    /**
     * Is this system ready to be used/rendered
     * @returns true if the system is ready
     */
    isReady() {
        if (!this._shadersLoaded) {
            return false;
        }
        if (!this.emitter || (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady()) || !this.particleTexture || !this.particleTexture.isReady()) {
            return false;
        }
        if (this.blendMode !== BaseParticleSystem.BLENDMODE_MULTIPLYADD) {
            if (!this._getWrapper(this.blendMode).effect.isReady()) {
                return false;
            }
        }
        else {
            if (!this._getWrapper(BaseParticleSystem.BLENDMODE_MULTIPLY).effect.isReady()) {
                return false;
            }
            if (!this._getWrapper(BaseParticleSystem.BLENDMODE_ADD).effect.isReady()) {
                return false;
            }
        }
        return true;
    }
    _render(blendMode) {
        const drawWrapper = this._getWrapper(blendMode);
        const effect = drawWrapper.effect;
        const engine = this._engine;
        // Render
        engine.enableEffect(drawWrapper);
        const viewMatrix = this.defaultViewMatrix ?? this._scene.getViewMatrix();
        effect.setTexture("diffuseSampler", this.particleTexture);
        effect.setMatrix("view", viewMatrix);
        effect.setMatrix("projection", this.defaultProjectionMatrix ?? this._scene.getProjectionMatrix());
        if (this._isAnimationSheetEnabled && this.particleTexture) {
            const baseSize = this.particleTexture.getBaseSize();
            effect.setFloat3("particlesInfos", this.spriteCellWidth / baseSize.width, this.spriteCellHeight / baseSize.height, this.spriteCellWidth / baseSize.width);
        }
        effect.setVector2("translationPivot", this.translationPivot);
        effect.setFloat4("textureMask", this.textureMask.r, this.textureMask.g, this.textureMask.b, this.textureMask.a);
        if (this._isBillboardBased && this._scene) {
            const camera = this._scene.activeCamera;
            effect.setVector3("eyePosition", camera.globalPosition);
        }
        if (this._rampGradientsTexture) {
            if (!this._rampGradients || !this._rampGradients.length) {
                this._rampGradientsTexture.dispose();
                this._rampGradientsTexture = null;
            }
            effect.setTexture("rampSampler", this._rampGradientsTexture);
        }
        const defines = effect.defines;
        if (this._scene) {
            (0,clipPlaneMaterialHelper/* bindClipPlane */.gS)(effect, this, this._scene);
            if (this.applyFog) {
                (0,materialHelper_functions/* BindFogParameters */.Yy)(this._scene, undefined, effect);
            }
        }
        if (defines.indexOf("#define BILLBOARDMODE_ALL") >= 0) {
            viewMatrix.invertToRef(math_vector/* TmpVectors */.AA.Matrix[0]);
            effect.setMatrix("invView", math_vector/* TmpVectors */.AA.Matrix[0]);
        }
        if (this._vertexArrayObject !== undefined) {
            if (this._scene?.forceWireframe) {
                engine.bindBuffers(this._vertexBuffers, this._linesIndexBufferUseInstancing, effect);
            }
            else {
                if (!this._vertexArrayObject) {
                    this._vertexArrayObject = this._engine.recordVertexArrayObject(this._vertexBuffers, null, effect);
                }
                this._engine.bindVertexArrayObject(this._vertexArrayObject, this._scene?.forceWireframe ? this._linesIndexBufferUseInstancing : this._indexBuffer);
            }
        }
        else {
            if (!this._indexBuffer) {
                // Use instancing mode
                engine.bindBuffers(this._vertexBuffers, this._scene?.forceWireframe ? this._linesIndexBufferUseInstancing : null, effect);
            }
            else {
                engine.bindBuffers(this._vertexBuffers, this._scene?.forceWireframe ? this._linesIndexBuffer : this._indexBuffer, effect);
            }
        }
        // Log. depth
        if (this.useLogarithmicDepth && this._scene) {
            (0,materialHelper_functions/* BindLogDepth */.DL)(defines, effect, this._scene);
        }
        // image processing
        if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) {
            this._imageProcessingConfiguration.bind(effect);
        }
        // Draw order
        switch (blendMode) {
            case BaseParticleSystem.BLENDMODE_ADD:
                engine.setAlphaMode(1);
                break;
            case BaseParticleSystem.BLENDMODE_ONEONE:
                engine.setAlphaMode(6);
                break;
            case BaseParticleSystem.BLENDMODE_STANDARD:
                engine.setAlphaMode(2);
                break;
            case BaseParticleSystem.BLENDMODE_MULTIPLY:
                engine.setAlphaMode(4);
                break;
        }
        if (this._onBeforeDrawParticlesObservable) {
            this._onBeforeDrawParticlesObservable.notifyObservers(effect);
        }
        if (this._useInstancing) {
            if (this._scene?.forceWireframe) {
                engine.drawElementsType(6, 0, 10, this._particles.length);
            }
            else {
                engine.drawArraysType(7, 0, 4, this._particles.length);
            }
        }
        else {
            if (this._scene?.forceWireframe) {
                engine.drawElementsType(1, 0, this._particles.length * 10);
            }
            else {
                engine.drawElementsType(0, 0, this._particles.length * 6);
            }
        }
        return this._particles.length;
    }
    /**
     * Renders the particle system in its current state.
     * @returns the current number of particles
     */
    render() {
        // Check
        if (!this.isReady() || !this._particles.length) {
            return 0;
        }
        const engine = this._engine;
        if (engine.setState) {
            engine.setState(false);
            if (this.forceDepthWrite) {
                engine.setDepthWrite(true);
            }
        }
        let outparticles = 0;
        if (this.blendMode === BaseParticleSystem.BLENDMODE_MULTIPLYADD) {
            outparticles = this._render(BaseParticleSystem.BLENDMODE_MULTIPLY) + this._render(BaseParticleSystem.BLENDMODE_ADD);
        }
        else {
            outparticles = this._render(this.blendMode);
        }
        this._engine.unbindInstanceAttributes();
        this._engine.setAlphaMode(0);
        return outparticles;
    }
    /** @internal */
    _onDispose(disposeAttachedSubEmitters = false, disposeEndSubEmitters = false) {
        // Do Nothing
    }
    /**
     * Disposes the particle system and free the associated resources
     * @param disposeTexture defines if the particle texture must be disposed as well (true by default)
     * @param disposeAttachedSubEmitters defines if the attached sub-emitters must be disposed as well (false by default)
     * @param disposeEndSubEmitters defines if the end type sub-emitters must be disposed as well (false by default)
     */
    dispose(disposeTexture = true, disposeAttachedSubEmitters = false, disposeEndSubEmitters = false) {
        this.resetDrawCache();
        if (this._vertexBuffer) {
            this._vertexBuffer.dispose();
            this._vertexBuffer = null;
        }
        if (this._spriteBuffer) {
            this._spriteBuffer.dispose();
            this._spriteBuffer = null;
        }
        if (this._indexBuffer) {
            this._engine._releaseBuffer(this._indexBuffer);
            this._indexBuffer = null;
        }
        if (this._linesIndexBuffer) {
            this._engine._releaseBuffer(this._linesIndexBuffer);
            this._linesIndexBuffer = null;
        }
        if (this._linesIndexBufferUseInstancing) {
            this._engine._releaseBuffer(this._linesIndexBufferUseInstancing);
            this._linesIndexBufferUseInstancing = null;
        }
        if (this._vertexArrayObject) {
            this._engine.releaseVertexArrayObject(this._vertexArrayObject);
            this._vertexArrayObject = null;
        }
        if (disposeTexture && this.particleTexture) {
            this.particleTexture.dispose();
            this.particleTexture = null;
        }
        if (disposeTexture && this.noiseTexture) {
            this.noiseTexture.dispose();
            this.noiseTexture = null;
        }
        if (this._rampGradientsTexture) {
            this._rampGradientsTexture.dispose();
            this._rampGradientsTexture = null;
        }
        this._onDispose(disposeAttachedSubEmitters, disposeEndSubEmitters);
        if (this._onBeforeDrawParticlesObservable) {
            this._onBeforeDrawParticlesObservable.clear();
        }
        // Remove from scene
        if (this._scene) {
            const index = this._scene.particleSystems.indexOf(this);
            if (index > -1) {
                this._scene.particleSystems.splice(index, 1);
            }
            this._scene._activeParticleSystems.dispose();
        }
        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
        this.onStoppedObservable.clear();
        this.reset();
    }
}
/**
 * Force all the particle systems to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
ThinParticleSystem.ForceGLSL = false;
//# sourceMappingURL=thinParticleSystem.js.map
;// ./node_modules/@babylonjs/core/Particles/subEmitter.js



/**
 * Type of sub emitter
 */
var SubEmitterType;
(function (SubEmitterType) {
    /**
     * Attached to the particle over it's lifetime
     */
    SubEmitterType[SubEmitterType["ATTACHED"] = 0] = "ATTACHED";
    /**
     * Created when the particle dies
     */
    SubEmitterType[SubEmitterType["END"] = 1] = "END";
})(SubEmitterType || (SubEmitterType = {}));
/**
 * Sub emitter class used to emit particles from an existing particle
 */
class SubEmitter {
    /**
     * Creates a sub emitter
     * @param particleSystem the particle system to be used by the sub emitter
     */
    constructor(
    /**
     * the particle system to be used by the sub emitter
     */
    particleSystem) {
        this.particleSystem = particleSystem;
        /**
         * Type of the submitter (Default: END)
         */
        this.type = 1 /* SubEmitterType.END */;
        /**
         * If the particle should inherit the direction from the particle it's attached to. (+Y will face the direction the particle is moving) (Default: false)
         * Note: This only is supported when using an emitter of type Mesh
         */
        this.inheritDirection = false;
        /**
         * How much of the attached particles speed should be added to the sub emitted particle (default: 0)
         */
        this.inheritedVelocityAmount = 0;
        // Create mesh as emitter to support rotation
        if (!particleSystem.emitter || !particleSystem.emitter.dispose) {
            const internalClass = (0,typeStore/* GetClass */.n9)("BABYLON.AbstractMesh");
            particleSystem.emitter = new internalClass("SubemitterSystemEmitter", particleSystem.getScene());
            particleSystem._disposeEmitterOnDispose = true;
        }
    }
    /**
     * Clones the sub emitter
     * @returns the cloned sub emitter
     */
    clone() {
        // Clone particle system
        let emitter = this.particleSystem.emitter;
        if (!emitter) {
            emitter = new math_vector/* Vector3 */.Pq();
        }
        else if (emitter instanceof math_vector/* Vector3 */.Pq) {
            emitter = emitter.clone();
        }
        else if (emitter.getClassName().indexOf("Mesh") !== -1) {
            const internalClass = (0,typeStore/* GetClass */.n9)("BABYLON.Mesh");
            emitter = new internalClass("", emitter.getScene());
            emitter.isVisible = false;
        }
        const clone = new SubEmitter(this.particleSystem.clone(this.particleSystem.name, emitter));
        // Clone properties
        clone.particleSystem.name += "Clone";
        clone.type = this.type;
        clone.inheritDirection = this.inheritDirection;
        clone.inheritedVelocityAmount = this.inheritedVelocityAmount;
        clone.particleSystem._disposeEmitterOnDispose = true;
        clone.particleSystem.disposeOnStop = true;
        return clone;
    }
    /**
     * Serialize current object to a JSON object
     * @param serializeTexture defines if the texture must be serialized as well
     * @returns the serialized object
     */
    serialize(serializeTexture = false) {
        const serializationObject = {};
        serializationObject.type = this.type;
        serializationObject.inheritDirection = this.inheritDirection;
        serializationObject.inheritedVelocityAmount = this.inheritedVelocityAmount;
        serializationObject.particleSystem = this.particleSystem.serialize(serializeTexture);
        return serializationObject;
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    static _ParseParticleSystem(system, sceneOrEngine, rootUrl, doNotStart = false) {
        throw (0,devTools/* _WarnImport */.n)("ParseParticle");
    }
    /**
     * Creates a new SubEmitter from a serialized JSON version
     * @param serializationObject defines the JSON object to read from
     * @param sceneOrEngine defines the hosting scene or the hosting engine
     * @param rootUrl defines the rootUrl for data loading
     * @returns a new SubEmitter
     */
    static Parse(serializationObject, sceneOrEngine, rootUrl) {
        const system = serializationObject.particleSystem;
        const subEmitter = new SubEmitter(SubEmitter._ParseParticleSystem(system, sceneOrEngine, rootUrl, true));
        subEmitter.type = serializationObject.type;
        subEmitter.inheritDirection = serializationObject.inheritDirection;
        subEmitter.inheritedVelocityAmount = serializationObject.inheritedVelocityAmount;
        subEmitter.particleSystem._isSubEmitter = true;
        return subEmitter;
    }
    /** Release associated resources */
    dispose() {
        this.particleSystem.dispose();
    }
}
//# sourceMappingURL=subEmitter.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/meshParticleEmitter.js




/**
 * Particle emitter emitting particles from the inside of a box.
 * It emits the particles randomly between 2 given directions.
 */
class MeshParticleEmitter {
    /** Defines the mesh to use as source */
    get mesh() {
        return this._mesh;
    }
    set mesh(value) {
        if (this._mesh === value) {
            return;
        }
        this._mesh = value;
        if (value) {
            this._indices = value.getIndices();
            this._positions = value.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
            this._normals = value.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
        }
        else {
            this._indices = null;
            this._positions = null;
            this._normals = null;
        }
    }
    /**
     * Creates a new instance MeshParticleEmitter
     * @param mesh defines the mesh to use as source
     */
    constructor(mesh = null) {
        this._indices = null;
        this._positions = null;
        this._normals = null;
        this._storedNormal = math_vector/* Vector3 */.Pq.Zero();
        this._mesh = null;
        /**
         * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
         */
        this.direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0);
        /**
         * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
         */
        this.direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0);
        /**
         * Gets or sets a boolean indicating that particle directions must be built from mesh face normals
         */
        this.useMeshNormalsForDirection = true;
        this.mesh = mesh;
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     * @param particle is the particle we are computed the direction for
     * @param isLocal defines if the direction should be set in local space
     */
    startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {
        if (this.useMeshNormalsForDirection && this._normals) {
            math_vector/* Vector3 */.Pq.TransformNormalToRef(this._storedNormal, worldMatrix, directionToUpdate);
            return;
        }
        const randX = (0,math_scalar_functions.RandomRange)(this.direction1.x, this.direction2.x);
        const randY = (0,math_scalar_functions.RandomRange)(this.direction1.y, this.direction2.y);
        const randZ = (0,math_scalar_functions.RandomRange)(this.direction1.z, this.direction2.z);
        if (isLocal) {
            directionToUpdate.copyFromFloats(randX, randY, randZ);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);
    }
    /**
     * Called by the particle System when the position is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param positionToUpdate is the position vector to update with the result
     * @param particle is the particle we are computed the position for
     * @param isLocal defines if the position should be set in local space
     */
    startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {
        if (!this._indices || !this._positions) {
            return;
        }
        const randomFaceIndex = (3 * Math.random() * (this._indices.length / 3)) | 0;
        const bu = Math.random();
        const bv = Math.random() * (1.0 - bu);
        const bw = 1.0 - bu - bv;
        const faceIndexA = this._indices[randomFaceIndex];
        const faceIndexB = this._indices[randomFaceIndex + 1];
        const faceIndexC = this._indices[randomFaceIndex + 2];
        const vertexA = math_vector/* TmpVectors */.AA.Vector3[0];
        const vertexB = math_vector/* TmpVectors */.AA.Vector3[1];
        const vertexC = math_vector/* TmpVectors */.AA.Vector3[2];
        const randomVertex = math_vector/* TmpVectors */.AA.Vector3[3];
        math_vector/* Vector3 */.Pq.FromArrayToRef(this._positions, faceIndexA * 3, vertexA);
        math_vector/* Vector3 */.Pq.FromArrayToRef(this._positions, faceIndexB * 3, vertexB);
        math_vector/* Vector3 */.Pq.FromArrayToRef(this._positions, faceIndexC * 3, vertexC);
        randomVertex.x = bu * vertexA.x + bv * vertexB.x + bw * vertexC.x;
        randomVertex.y = bu * vertexA.y + bv * vertexB.y + bw * vertexC.y;
        randomVertex.z = bu * vertexA.z + bv * vertexB.z + bw * vertexC.z;
        if (isLocal) {
            positionToUpdate.copyFromFloats(randomVertex.x, randomVertex.y, randomVertex.z);
        }
        else {
            math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(randomVertex.x, randomVertex.y, randomVertex.z, worldMatrix, positionToUpdate);
        }
        if (this.useMeshNormalsForDirection && this._normals) {
            math_vector/* Vector3 */.Pq.FromArrayToRef(this._normals, faceIndexA * 3, vertexA);
            math_vector/* Vector3 */.Pq.FromArrayToRef(this._normals, faceIndexB * 3, vertexB);
            math_vector/* Vector3 */.Pq.FromArrayToRef(this._normals, faceIndexC * 3, vertexC);
            this._storedNormal.x = bu * vertexA.x + bv * vertexB.x + bw * vertexC.x;
            this._storedNormal.y = bu * vertexA.y + bv * vertexB.y + bw * vertexC.y;
            this._storedNormal.z = bu * vertexA.z + bv * vertexB.z + bw * vertexC.z;
        }
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new MeshParticleEmitter(this.mesh);
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setVector3("direction1", this.direction1);
        uboOrEffect.setVector3("direction2", this.direction2);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("direction1", 3);
        ubo.addUniform("direction2", 3);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "";
    }
    /**
     * Returns the string "BoxParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "MeshParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.type = this.getClassName();
        serializationObject.direction1 = this.direction1.asArray();
        serializationObject.direction2 = this.direction2.asArray();
        serializationObject.meshId = this.mesh?.id;
        serializationObject.useMeshNormalsForDirection = this.useMeshNormalsForDirection;
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     * @param scene defines the hosting scene
     */
    parse(serializationObject, scene) {
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.direction1, 0, this.direction1);
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.direction2, 0, this.direction2);
        if (serializationObject.meshId && scene) {
            this.mesh = scene.getLastMeshById(serializationObject.meshId);
        }
        this.useMeshNormalsForDirection = serializationObject.useMeshNormalsForDirection;
    }
}
//# sourceMappingURL=meshParticleEmitter.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/customParticleEmitter.js


/**
 * Particle emitter emitting particles from a custom list of positions.
 */
class CustomParticleEmitter {
    /**
     * Creates a new instance CustomParticleEmitter
     */
    constructor() {
        /**
         * Gets or sets the position generator that will create the initial position of each particle.
         * Index will be provided when used with GPU particle. Particle will be provided when used with CPU particles
         */
        this.particlePositionGenerator = () => { };
        /**
         * Gets or sets the destination generator that will create the final destination of each particle.
         *  * Index will be provided when used with GPU particle. Particle will be provided when used with CPU particles
         */
        this.particleDestinationGenerator = () => { };
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     * @param particle is the particle we are computed the direction for
     * @param isLocal defines if the direction should be set in local space
     */
    startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {
        const tmpVector = math_vector/* TmpVectors */.AA.Vector3[0];
        if (this.particleDestinationGenerator) {
            this.particleDestinationGenerator(-1, particle, tmpVector);
            // Get direction
            const diffVector = math_vector/* TmpVectors */.AA.Vector3[1];
            tmpVector.subtractToRef(particle.position, diffVector);
            diffVector.scaleToRef(1 / particle.lifeTime, tmpVector);
        }
        else {
            tmpVector.set(0, 0, 0);
        }
        if (isLocal) {
            directionToUpdate.copyFrom(tmpVector);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformNormalToRef(tmpVector, worldMatrix, directionToUpdate);
    }
    /**
     * Called by the particle System when the position is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param positionToUpdate is the position vector to update with the result
     * @param particle is the particle we are computed the position for
     * @param isLocal defines if the position should be set in local space
     */
    startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {
        const tmpVector = math_vector/* TmpVectors */.AA.Vector3[0];
        if (this.particlePositionGenerator) {
            this.particlePositionGenerator(-1, particle, tmpVector);
        }
        else {
            tmpVector.set(0, 0, 0);
        }
        if (isLocal) {
            positionToUpdate.copyFrom(tmpVector);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(tmpVector, worldMatrix, positionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new CustomParticleEmitter();
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    applyToShader(uboOrEffect) { }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    buildUniformLayout(ubo) { }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "#define CUSTOMEMITTER";
    }
    /**
     * Returns the string "PointParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "CustomParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.type = this.getClassName();
        serializationObject.particlePositionGenerator = this.particlePositionGenerator;
        serializationObject.particleDestinationGenerator = this.particleDestinationGenerator;
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        if (serializationObject.particlePositionGenerator) {
            this.particlePositionGenerator = serializationObject.particlePositionGenerator;
        }
        if (serializationObject.particleDestinationGenerator) {
            this.particleDestinationGenerator = serializationObject.particleDestinationGenerator;
        }
    }
}
//# sourceMappingURL=customParticleEmitter.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/pointParticleEmitter.js



/**
 * Particle emitter emitting particles from a point.
 * It emits the particles randomly between 2 given directions.
 */
class PointParticleEmitter {
    /**
     * Creates a new instance PointParticleEmitter
     */
    constructor() {
        /**
         * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
         */
        this.direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0);
        /**
         * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
         */
        this.direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0);
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     * @param particle is the particle we are computed the direction for
     * @param isLocal defines if the direction should be set in local space
     */
    startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {
        const randX = (0,math_scalar_functions.RandomRange)(this.direction1.x, this.direction2.x);
        const randY = (0,math_scalar_functions.RandomRange)(this.direction1.y, this.direction2.y);
        const randZ = (0,math_scalar_functions.RandomRange)(this.direction1.z, this.direction2.z);
        if (isLocal) {
            directionToUpdate.copyFromFloats(randX, randY, randZ);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);
    }
    /**
     * Called by the particle System when the position is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param positionToUpdate is the position vector to update with the result
     * @param particle is the particle we are computed the position for
     * @param isLocal defines if the position should be set in local space
     */
    startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {
        if (isLocal) {
            positionToUpdate.copyFromFloats(0, 0, 0);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(0, 0, 0, worldMatrix, positionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new PointParticleEmitter();
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setVector3("direction1", this.direction1);
        uboOrEffect.setVector3("direction2", this.direction2);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("direction1", 3);
        ubo.addUniform("direction2", 3);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "#define POINTEMITTER";
    }
    /**
     * Returns the string "PointParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "PointParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.type = this.getClassName();
        serializationObject.direction1 = this.direction1.asArray();
        serializationObject.direction2 = this.direction2.asArray();
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.direction1, 0, this.direction1);
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.direction2, 0, this.direction2);
    }
}
//# sourceMappingURL=pointParticleEmitter.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/hemisphericParticleEmitter.js



/**
 * Particle emitter emitting particles from the inside of a hemisphere.
 * It emits the particles alongside the hemisphere radius. The emission direction might be randomized.
 */
class HemisphericParticleEmitter {
    /**
     * Creates a new instance HemisphericParticleEmitter
     * @param radius the radius of the emission hemisphere (1 by default)
     * @param radiusRange the range of the emission hemisphere [0-1] 0 Surface only, 1 Entire Radius (1 by default)
     * @param directionRandomizer defines how much to randomize the particle direction [0-1]
     */
    constructor(
    /**
     * [1] The radius of the emission hemisphere.
     */
    radius = 1, 
    /**
     * [1] The range of emission [0-1] 0 Surface only, 1 Entire Radius.
     */
    radiusRange = 1, 
    /**
     * [0] How much to randomize the particle direction [0-1].
     */
    directionRandomizer = 0) {
        this.radius = radius;
        this.radiusRange = radiusRange;
        this.directionRandomizer = directionRandomizer;
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     * @param particle is the particle we are computed the direction for
     * @param isLocal defines if the direction should be set in local space
     */
    startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {
        const direction = particle.position.subtract(worldMatrix.getTranslation()).normalize();
        const randX = (0,math_scalar_functions.RandomRange)(0, this.directionRandomizer);
        const randY = (0,math_scalar_functions.RandomRange)(0, this.directionRandomizer);
        const randZ = (0,math_scalar_functions.RandomRange)(0, this.directionRandomizer);
        direction.x += randX;
        direction.y += randY;
        direction.z += randZ;
        direction.normalize();
        if (isLocal) {
            directionToUpdate.copyFrom(direction);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate);
    }
    /**
     * Called by the particle System when the position is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param positionToUpdate is the position vector to update with the result
     * @param particle is the particle we are computed the position for
     * @param isLocal defines if the position should be set in local space
     */
    startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {
        const randRadius = this.radius - (0,math_scalar_functions.RandomRange)(0, this.radius * this.radiusRange);
        const v = (0,math_scalar_functions.RandomRange)(0, 1.0);
        const phi = (0,math_scalar_functions.RandomRange)(0, 2 * Math.PI);
        const theta = Math.acos(2 * v - 1);
        const randX = randRadius * Math.cos(phi) * Math.sin(theta);
        const randY = randRadius * Math.cos(theta);
        const randZ = randRadius * Math.sin(phi) * Math.sin(theta);
        if (isLocal) {
            positionToUpdate.copyFromFloats(randX, Math.abs(randY), randZ);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(randX, Math.abs(randY), randZ, worldMatrix, positionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new HemisphericParticleEmitter(this.radius, this.directionRandomizer);
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setFloat("radius", this.radius);
        uboOrEffect.setFloat("radiusRange", this.radiusRange);
        uboOrEffect.setFloat("directionRandomizer", this.directionRandomizer);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("radius", 1);
        ubo.addUniform("radiusRange", 1);
        ubo.addUniform("directionRandomizer", 1);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "#define HEMISPHERICEMITTER";
    }
    /**
     * Returns the string "HemisphericParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "HemisphericParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.type = this.getClassName();
        serializationObject.radius = this.radius;
        serializationObject.radiusRange = this.radiusRange;
        serializationObject.directionRandomizer = this.directionRandomizer;
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        this.radius = serializationObject.radius;
        this.radiusRange = serializationObject.radiusRange;
        this.directionRandomizer = serializationObject.directionRandomizer;
    }
}
//# sourceMappingURL=hemisphericParticleEmitter.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/sphereParticleEmitter.js



/**
 * Particle emitter emitting particles from the inside of a sphere.
 * It emits the particles alongside the sphere radius. The emission direction might be randomized.
 */
class SphereParticleEmitter {
    /**
     * Creates a new instance SphereParticleEmitter
     * @param radius the radius of the emission sphere (1 by default)
     * @param radiusRange the range of the emission sphere [0-1] 0 Surface only, 1 Entire Radius (1 by default)
     * @param directionRandomizer defines how much to randomize the particle direction [0-1]
     */
    constructor(
    /**
     * [1] The radius of the emission sphere.
     */
    radius = 1, 
    /**
     * [1] The range of emission [0-1] 0 Surface only, 1 Entire Radius.
     */
    radiusRange = 1, 
    /**
     * [0] How much to randomize the particle direction [0-1].
     */
    directionRandomizer = 0) {
        this.radius = radius;
        this.radiusRange = radiusRange;
        this.directionRandomizer = directionRandomizer;
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     * @param particle is the particle we are computed the direction for
     * @param isLocal defines if the direction should be set in local space
     */
    startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {
        const direction = particle.position.subtract(worldMatrix.getTranslation()).normalize();
        const randX = (0,math_scalar_functions.RandomRange)(0, this.directionRandomizer);
        const randY = (0,math_scalar_functions.RandomRange)(0, this.directionRandomizer);
        const randZ = (0,math_scalar_functions.RandomRange)(0, this.directionRandomizer);
        direction.x += randX;
        direction.y += randY;
        direction.z += randZ;
        direction.normalize();
        if (isLocal) {
            directionToUpdate.copyFrom(direction);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate);
    }
    /**
     * Called by the particle System when the position is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param positionToUpdate is the position vector to update with the result
     * @param particle is the particle we are computed the position for
     * @param isLocal defines if the position should be set in local space
     */
    startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {
        const randRadius = this.radius - (0,math_scalar_functions.RandomRange)(0, this.radius * this.radiusRange);
        const v = (0,math_scalar_functions.RandomRange)(0, 1.0);
        const phi = (0,math_scalar_functions.RandomRange)(0, 2 * Math.PI);
        const theta = Math.acos(2 * v - 1);
        const randX = randRadius * Math.cos(phi) * Math.sin(theta);
        const randY = randRadius * Math.cos(theta);
        const randZ = randRadius * Math.sin(phi) * Math.sin(theta);
        if (isLocal) {
            positionToUpdate.copyFromFloats(randX, randY, randZ);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new SphereParticleEmitter(this.radius, this.directionRandomizer);
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setFloat("radius", this.radius);
        uboOrEffect.setFloat("radiusRange", this.radiusRange);
        uboOrEffect.setFloat("directionRandomizer", this.directionRandomizer);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("radius", 1);
        ubo.addUniform("radiusRange", 1);
        ubo.addUniform("directionRandomizer", 1);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "#define SPHEREEMITTER";
    }
    /**
     * Returns the string "SphereParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "SphereParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.type = this.getClassName();
        serializationObject.radius = this.radius;
        serializationObject.radiusRange = this.radiusRange;
        serializationObject.directionRandomizer = this.directionRandomizer;
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        this.radius = serializationObject.radius;
        this.radiusRange = serializationObject.radiusRange;
        this.directionRandomizer = serializationObject.directionRandomizer;
    }
}
/**
 * Particle emitter emitting particles from the inside of a sphere.
 * It emits the particles randomly between two vectors.
 */
class SphereDirectedParticleEmitter extends SphereParticleEmitter {
    /**
     * Creates a new instance SphereDirectedParticleEmitter
     * @param radius the radius of the emission sphere (1 by default)
     * @param direction1 the min limit of the emission direction (up vector by default)
     * @param direction2 the max limit of the emission direction (up vector by default)
     */
    constructor(radius = 1, 
    /**
     * [Up vector] The min limit of the emission direction.
     */
    direction1 = new math_vector/* Vector3 */.Pq(0, 1, 0), 
    /**
     * [Up vector] The max limit of the emission direction.
     */
    direction2 = new math_vector/* Vector3 */.Pq(0, 1, 0)) {
        super(radius);
        this.direction1 = direction1;
        this.direction2 = direction2;
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     */
    startDirectionFunction(worldMatrix, directionToUpdate) {
        const randX = (0,math_scalar_functions.RandomRange)(this.direction1.x, this.direction2.x);
        const randY = (0,math_scalar_functions.RandomRange)(this.direction1.y, this.direction2.y);
        const randZ = (0,math_scalar_functions.RandomRange)(this.direction1.z, this.direction2.z);
        math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new SphereDirectedParticleEmitter(this.radius, this.direction1, this.direction2);
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setFloat("radius", this.radius);
        uboOrEffect.setFloat("radiusRange", this.radiusRange);
        uboOrEffect.setVector3("direction1", this.direction1);
        uboOrEffect.setVector3("direction2", this.direction2);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("radius", 1);
        ubo.addUniform("radiusRange", 1);
        ubo.addUniform("direction1", 3);
        ubo.addUniform("direction2", 3);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER";
    }
    /**
     * Returns the string "SphereDirectedParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "SphereDirectedParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.direction1 = this.direction1.asArray();
        serializationObject.direction2 = this.direction2.asArray();
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        super.parse(serializationObject);
        this.direction1.copyFrom(serializationObject.direction1);
        this.direction2.copyFrom(serializationObject.direction2);
    }
}
//# sourceMappingURL=sphereParticleEmitter.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/cylinderParticleEmitter.js



/**
 * Particle emitter emitting particles from the inside of a cylinder.
 * It emits the particles alongside the cylinder radius. The emission direction might be randomized.
 */
class CylinderParticleEmitter {
    /**
     * Creates a new instance CylinderParticleEmitter
     * @param radius the radius of the emission cylinder (1 by default)
     * @param height the height of the emission cylinder (1 by default)
     * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
     * @param directionRandomizer defines how much to randomize the particle direction [0-1]
     */
    constructor(
    /**
     * [1] The radius of the emission cylinder.
     */
    radius = 1, 
    /**
     * [1] The height of the emission cylinder.
     */
    height = 1, 
    /**
     * [1] The range of emission [0-1] 0 Surface only, 1 Entire Radius.
     */
    radiusRange = 1, 
    /**
     * [0] How much to randomize the particle direction [0-1].
     */
    directionRandomizer = 0) {
        this.radius = radius;
        this.height = height;
        this.radiusRange = radiusRange;
        this.directionRandomizer = directionRandomizer;
        this._tempVector = math_vector/* Vector3 */.Pq.Zero();
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     * @param particle is the particle we are computed the direction for
     * @param isLocal defines if the direction should be set in local space
     * @param inverseWorldMatrix defines the inverted world matrix to use if isLocal is false
     */
    startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal, inverseWorldMatrix) {
        particle.position.subtractToRef(worldMatrix.getTranslation(), this._tempVector);
        this._tempVector.normalize();
        math_vector/* Vector3 */.Pq.TransformNormalToRef(this._tempVector, inverseWorldMatrix, this._tempVector);
        const randY = (0,math_scalar_functions.RandomRange)(-this.directionRandomizer / 2, this.directionRandomizer / 2);
        let angle = Math.atan2(this._tempVector.x, this._tempVector.z);
        angle += (0,math_scalar_functions.RandomRange)(-Math.PI / 2, Math.PI / 2) * this.directionRandomizer;
        this._tempVector.y = randY; // set direction y to rand y to mirror normal of cylinder surface
        this._tempVector.x = Math.sin(angle);
        this._tempVector.z = Math.cos(angle);
        this._tempVector.normalize();
        if (isLocal) {
            directionToUpdate.copyFrom(this._tempVector);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(this._tempVector.x, this._tempVector.y, this._tempVector.z, worldMatrix, directionToUpdate);
    }
    /**
     * Called by the particle System when the position is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param positionToUpdate is the position vector to update with the result
     * @param particle is the particle we are computed the position for
     * @param isLocal defines if the position should be set in local space
     */
    startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {
        const yPos = (0,math_scalar_functions.RandomRange)(-this.height / 2, this.height / 2);
        const angle = (0,math_scalar_functions.RandomRange)(0, 2 * Math.PI);
        // Pick a properly distributed point within the circle https://programming.guide/random-point-within-circle.html
        const radiusDistribution = (0,math_scalar_functions.RandomRange)((1 - this.radiusRange) * (1 - this.radiusRange), 1);
        const positionRadius = Math.sqrt(radiusDistribution) * this.radius;
        const xPos = positionRadius * Math.cos(angle);
        const zPos = positionRadius * Math.sin(angle);
        if (isLocal) {
            positionToUpdate.copyFromFloats(xPos, yPos, zPos);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(xPos, yPos, zPos, worldMatrix, positionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new CylinderParticleEmitter(this.radius, this.directionRandomizer);
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setFloat("radius", this.radius);
        uboOrEffect.setFloat("height", this.height);
        uboOrEffect.setFloat("radiusRange", this.radiusRange);
        uboOrEffect.setFloat("directionRandomizer", this.directionRandomizer);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("radius", 1);
        ubo.addUniform("height", 1);
        ubo.addUniform("radiusRange", 1);
        ubo.addUniform("directionRandomizer", 1);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "#define CYLINDEREMITTER";
    }
    /**
     * Returns the string "CylinderParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "CylinderParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.type = this.getClassName();
        serializationObject.radius = this.radius;
        serializationObject.height = this.height;
        serializationObject.radiusRange = this.radiusRange;
        serializationObject.directionRandomizer = this.directionRandomizer;
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        this.radius = serializationObject.radius;
        this.height = serializationObject.height;
        this.radiusRange = serializationObject.radiusRange;
        this.directionRandomizer = serializationObject.directionRandomizer;
    }
}
/**
 * Particle emitter emitting particles from the inside of a cylinder.
 * It emits the particles randomly between two vectors.
 */
class CylinderDirectedParticleEmitter extends CylinderParticleEmitter {
    /**
     * Creates a new instance CylinderDirectedParticleEmitter
     * @param radius the radius of the emission cylinder (1 by default)
     * @param height the height of the emission cylinder (1 by default)
     * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
     * @param direction1 the min limit of the emission direction (up vector by default)
     * @param direction2 the max limit of the emission direction (up vector by default)
     */
    constructor(radius = 1, height = 1, radiusRange = 1, 
    /**
     * [Up vector] The min limit of the emission direction.
     */
    direction1 = new math_vector/* Vector3 */.Pq(0, 1, 0), 
    /**
     * [Up vector] The max limit of the emission direction.
     */
    direction2 = new math_vector/* Vector3 */.Pq(0, 1, 0)) {
        super(radius, height, radiusRange);
        this.direction1 = direction1;
        this.direction2 = direction2;
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     * @param _particle is the particle we are computed the direction for
     * @param isLocal defines if the direction should be set in local space
     */
    startDirectionFunction(worldMatrix, directionToUpdate, _particle, isLocal) {
        const randX = (0,math_scalar_functions.RandomRange)(this.direction1.x, this.direction2.x);
        const randY = (0,math_scalar_functions.RandomRange)(this.direction1.y, this.direction2.y);
        const randZ = (0,math_scalar_functions.RandomRange)(this.direction1.z, this.direction2.z);
        if (isLocal) {
            directionToUpdate.copyFromFloats(randX, randY, randZ);
            return;
        }
        math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new CylinderDirectedParticleEmitter(this.radius, this.height, this.radiusRange, this.direction1, this.direction2);
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setFloat("radius", this.radius);
        uboOrEffect.setFloat("height", this.height);
        uboOrEffect.setFloat("radiusRange", this.radiusRange);
        uboOrEffect.setVector3("direction1", this.direction1);
        uboOrEffect.setVector3("direction2", this.direction2);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("radius", 1);
        ubo.addUniform("height", 1);
        ubo.addUniform("radiusRange", 1);
        ubo.addUniform("direction1", 3);
        ubo.addUniform("direction2", 3);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER";
    }
    /**
     * Returns the string "CylinderDirectedParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "CylinderDirectedParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.direction1 = this.direction1.asArray();
        serializationObject.direction2 = this.direction2.asArray();
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        super.parse(serializationObject);
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.direction1, 0, this.direction1);
        math_vector/* Vector3 */.Pq.FromArrayToRef(serializationObject.direction2, 0, this.direction2);
    }
}
//# sourceMappingURL=cylinderParticleEmitter.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/coneParticleEmitter.js



/**
 * Particle emitter emitting particles from the inside of a cone.
 * It emits the particles alongside the cone volume from the base to the particle.
 * The emission direction might be randomized.
 */
class ConeParticleEmitter {
    /**
     * Gets or sets the radius of the emission cone
     */
    get radius() {
        return this._radius;
    }
    set radius(value) {
        this._radius = value;
        this._buildHeight();
    }
    /**
     * Gets or sets the angle of the emission cone
     */
    get angle() {
        return this._angle;
    }
    set angle(value) {
        this._angle = value;
        this._buildHeight();
    }
    _buildHeight() {
        if (this._angle !== 0) {
            this._height = this._radius / Math.tan(this._angle / 2);
        }
        else {
            this._height = 1;
        }
    }
    /**
     * Creates a new instance ConeParticleEmitter
     * @param radius the radius of the emission cone (1 by default)
     * @param angle the cone base angle (PI by default)
     * @param directionRandomizer defines how much to randomize the particle direction [0-1] (default is 0)
     */
    constructor(radius = 1, angle = Math.PI, 
    /** [0] defines how much to randomize the particle direction [0-1] (default is 0) */
    directionRandomizer = 0) {
        this.directionRandomizer = directionRandomizer;
        /**
         * Gets or sets a value indicating where on the radius the start position should be picked (1 = everywhere, 0 = only surface)
         */
        this.radiusRange = 1;
        /**
         * Gets or sets a value indicating where on the height the start position should be picked (1 = everywhere, 0 = only surface)
         */
        this.heightRange = 1;
        /**
         * Gets or sets a value indicating if all the particles should be emitted from the spawn point only (the base of the cone)
         */
        this.emitFromSpawnPointOnly = false;
        this.angle = angle;
        this.radius = radius;
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     * @param particle is the particle we are computed the direction for
     * @param isLocal defines if the direction should be set in local space
     */
    startDirectionFunction(worldMatrix, directionToUpdate, particle, isLocal) {
        if (isLocal) {
            math_vector/* TmpVectors */.AA.Vector3[0].copyFrom(particle._localPosition).normalize();
        }
        else {
            particle.position.subtractToRef(worldMatrix.getTranslation(), math_vector/* TmpVectors */.AA.Vector3[0]).normalize();
        }
        const randX = (0,math_scalar_functions.RandomRange)(0, this.directionRandomizer);
        const randY = (0,math_scalar_functions.RandomRange)(0, this.directionRandomizer);
        const randZ = (0,math_scalar_functions.RandomRange)(0, this.directionRandomizer);
        directionToUpdate.x = math_vector/* TmpVectors */.AA.Vector3[0].x + randX;
        directionToUpdate.y = math_vector/* TmpVectors */.AA.Vector3[0].y + randY;
        directionToUpdate.z = math_vector/* TmpVectors */.AA.Vector3[0].z + randZ;
        directionToUpdate.normalize();
    }
    /**
     * Called by the particle System when the position is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param positionToUpdate is the position vector to update with the result
     * @param particle is the particle we are computed the position for
     * @param isLocal defines if the position should be set in local space
     */
    startPositionFunction(worldMatrix, positionToUpdate, particle, isLocal) {
        const s = (0,math_scalar_functions.RandomRange)(0, Math.PI * 2);
        let h;
        if (!this.emitFromSpawnPointOnly) {
            h = (0,math_scalar_functions.RandomRange)(0, this.heightRange);
            // Better distribution in a cone at normal angles.
            h = 1 - h * h;
        }
        else {
            h = 0.0001;
        }
        let radius = this._radius - (0,math_scalar_functions.RandomRange)(0, this._radius * this.radiusRange);
        radius = radius * h;
        const randX = radius * Math.sin(s);
        const randZ = radius * Math.cos(s);
        const randY = h * this._height;
        if (isLocal) {
            positionToUpdate.x = randX;
            positionToUpdate.y = randY;
            positionToUpdate.z = randZ;
            return;
        }
        math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new ConeParticleEmitter(this._radius, this._angle, this.directionRandomizer);
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setFloat2("radius", this._radius, this.radiusRange);
        uboOrEffect.setFloat("coneAngle", this._angle);
        uboOrEffect.setFloat2("height", this._height, this.heightRange);
        uboOrEffect.setFloat("directionRandomizer", this.directionRandomizer);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("radius", 2);
        ubo.addUniform("coneAngle", 1);
        ubo.addUniform("height", 2);
        ubo.addUniform("directionRandomizer", 1);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        let defines = "#define CONEEMITTER";
        if (this.emitFromSpawnPointOnly) {
            defines += "\n#define CONEEMITTERSPAWNPOINT";
        }
        return defines;
    }
    /**
     * Returns the string "ConeParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "ConeParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = {};
        serializationObject.type = this.getClassName();
        serializationObject.radius = this._radius;
        serializationObject.angle = this._angle;
        serializationObject.directionRandomizer = this.directionRandomizer;
        serializationObject.radiusRange = this.radiusRange;
        serializationObject.heightRange = this.heightRange;
        serializationObject.emitFromSpawnPointOnly = this.emitFromSpawnPointOnly;
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        this.radius = serializationObject.radius;
        this.angle = serializationObject.angle;
        this.directionRandomizer = serializationObject.directionRandomizer;
        this.radiusRange = serializationObject.radiusRange !== undefined ? serializationObject.radiusRange : 1;
        this.heightRange = serializationObject.radiusRange !== undefined ? serializationObject.heightRange : 1;
        this.emitFromSpawnPointOnly = serializationObject.emitFromSpawnPointOnly !== undefined ? serializationObject.emitFromSpawnPointOnly : false;
    }
}
class ConeDirectedParticleEmitter extends ConeParticleEmitter {
    constructor(radius = 1, angle = Math.PI, 
    /**
     * [Up vector] The min limit of the emission direction.
     */
    direction1 = new math_vector/* Vector3 */.Pq(0, 1, 0), 
    /**
     * [Up vector] The max limit of the emission direction.
     */
    direction2 = new math_vector/* Vector3 */.Pq(0, 1, 0)) {
        super(radius, angle);
        this.direction1 = direction1;
        this.direction2 = direction2;
    }
    /**
     * Called by the particle System when the direction is computed for the created particle.
     * @param worldMatrix is the world matrix of the particle system
     * @param directionToUpdate is the direction vector to update with the result
     */
    startDirectionFunction(worldMatrix, directionToUpdate) {
        const randX = (0,math_scalar_functions.RandomRange)(this.direction1.x, this.direction2.x);
        const randY = (0,math_scalar_functions.RandomRange)(this.direction1.y, this.direction2.y);
        const randZ = (0,math_scalar_functions.RandomRange)(this.direction1.z, this.direction2.z);
        math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);
    }
    /**
     * Clones the current emitter and returns a copy of it
     * @returns the new emitter
     */
    clone() {
        const newOne = new ConeDirectedParticleEmitter(this.radius, this.angle, this.direction1, this.direction2);
        deepCopier/* DeepCopier */.r.DeepCopy(this, newOne);
        return newOne;
    }
    /**
     * Called by the GPUParticleSystem to setup the update shader
     * @param uboOrEffect defines the update shader
     */
    applyToShader(uboOrEffect) {
        uboOrEffect.setFloat("radius", this.radius);
        uboOrEffect.setFloat("radiusRange", this.radiusRange);
        uboOrEffect.setVector3("direction1", this.direction1);
        uboOrEffect.setVector3("direction2", this.direction2);
    }
    /**
     * Creates the structure of the ubo for this particle emitter
     * @param ubo ubo to create the structure for
     */
    buildUniformLayout(ubo) {
        ubo.addUniform("radius", 1);
        ubo.addUniform("radiusRange", 1);
        ubo.addUniform("direction1", 3);
        ubo.addUniform("direction2", 3);
    }
    /**
     * Returns a string to use to update the GPU particles update shader
     * @returns a string containing the defines string
     */
    getEffectDefines() {
        return "#define CONEEMITTER\n#define DIRECTEDCONEEMITTER";
    }
    /**
     * Returns the string "ConeDirectedParticleEmitter"
     * @returns a string containing the class name
     */
    getClassName() {
        return "ConeDirectedParticleEmitter";
    }
    /**
     * Serializes the particle system to a JSON object.
     * @returns the JSON object
     */
    serialize() {
        const serializationObject = super.serialize();
        serializationObject.direction1 = this.direction1.asArray();
        serializationObject.direction2 = this.direction2.asArray();
        return serializationObject;
    }
    /**
     * Parse properties from a JSON object
     * @param serializationObject defines the JSON object
     */
    parse(serializationObject) {
        super.parse(serializationObject);
        this.direction1.copyFrom(serializationObject.direction1);
        this.direction2.copyFrom(serializationObject.direction2);
    }
}
//# sourceMappingURL=coneParticleEmitter.js.map
;// ./node_modules/@babylonjs/core/Particles/particleSystem.functions.js






/**
 * Creates a Point Emitter for the particle system (emits directly from the emitter position)
 * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
 * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
 * @returns the emitter
 */
function CreatePointEmitter(direction1, direction2) {
    const particleEmitter = new PointParticleEmitter();
    particleEmitter.direction1 = direction1;
    particleEmitter.direction2 = direction2;
    return particleEmitter;
}
/**
 * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)
 * @param radius The radius of the hemisphere to emit from
 * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
 * @returns the emitter
 */
function CreateHemisphericEmitter(radius = 1, radiusRange = 1) {
    return new HemisphericParticleEmitter(radius, radiusRange);
}
/**
 * Creates a Sphere Emitter for the particle system (emits along the sphere radius)
 * @param radius The radius of the sphere to emit from
 * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
 * @returns the emitter
 */
function CreateSphereEmitter(radius = 1, radiusRange = 1) {
    return new SphereParticleEmitter(radius, radiusRange);
}
/**
 * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)
 * @param radius The radius of the sphere to emit from
 * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere
 * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere
 * @returns the emitter
 */
function CreateDirectedSphereEmitter(radius = 1, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
    return new SphereDirectedParticleEmitter(radius, direction1, direction2);
}
/**
 * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)
 * @param radius The radius of the emission cylinder
 * @param height The height of the emission cylinder
 * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius
 * @param directionRandomizer How much to randomize the particle direction [0-1]
 * @returns the emitter
 */
function CreateCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0) {
    return new CylinderParticleEmitter(radius, height, radiusRange, directionRandomizer);
}
/**
 * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)
 * @param radius The radius of the cylinder to emit from
 * @param height The height of the emission cylinder
 * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
 * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder
 * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder
 * @returns the emitter
 */
function CreateDirectedCylinderEmitter(radius = 1, height = 1, radiusRange = 1, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
    return new CylinderDirectedParticleEmitter(radius, height, radiusRange, direction1, direction2);
}
/**
 * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)
 * @param radius The radius of the cone to emit from
 * @param angle The base angle of the cone
 * @returns the emitter
 */
function CreateConeEmitter(radius = 1, angle = Math.PI / 4) {
    return new ConeParticleEmitter(radius, angle);
}
function CreateDirectedConeEmitter(radius = 1, angle = Math.PI / 4, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
    return new ConeDirectedParticleEmitter(radius, angle, direction1, direction2);
}
//# sourceMappingURL=particleSystem.functions.js.map
;// ./node_modules/@babylonjs/core/Particles/particleSystem.js

















/**
 * This represents a particle system in Babylon.
 * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
 * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function.
 * @example https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
 */
class ParticleSystem extends ThinParticleSystem {
    constructor() {
        super(...arguments);
        /**
         * @internal
         * If the particle systems emitter should be disposed when the particle system is disposed
         */
        this._disposeEmitterOnDispose = false;
        this._emitFromParticle = (particle) => {
            if (!this._subEmitters || this._subEmitters.length === 0) {
                return;
            }
            const templateIndex = Math.floor(Math.random() * this._subEmitters.length);
            this._subEmitters[templateIndex].forEach((subEmitter) => {
                if (subEmitter.type === 1 /* SubEmitterType.END */) {
                    const subSystem = subEmitter.clone();
                    particle._inheritParticleInfoToSubEmitter(subSystem);
                    subSystem.particleSystem._rootParticleSystem = this;
                    this.activeSubSystems.push(subSystem.particleSystem);
                    subSystem.particleSystem.start();
                }
            });
        };
    }
    /**
     * Creates a Point Emitter for the particle system (emits directly from the emitter position)
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
     * @returns the emitter
     */
    createPointEmitter(direction1, direction2) {
        const particleEmitter = CreatePointEmitter(direction1, direction2);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)
     * @param radius The radius of the hemisphere to emit from
     * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
     * @returns the emitter
     */
    createHemisphericEmitter(radius = 1, radiusRange = 1) {
        const particleEmitter = CreateHemisphericEmitter(radius, radiusRange);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Sphere Emitter for the particle system (emits along the sphere radius)
     * @param radius The radius of the sphere to emit from
     * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
     * @returns the emitter
     */
    createSphereEmitter(radius = 1, radiusRange = 1) {
        const particleEmitter = CreateSphereEmitter(radius, radiusRange);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)
     * @param radius The radius of the sphere to emit from
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere
     * @returns the emitter
     */
    createDirectedSphereEmitter(radius = 1, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
        const particleEmitter = CreateDirectedSphereEmitter(radius, direction1, direction2);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)
     * @param radius The radius of the emission cylinder
     * @param height The height of the emission cylinder
     * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius
     * @param directionRandomizer How much to randomize the particle direction [0-1]
     * @returns the emitter
     */
    createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0) {
        const particleEmitter = CreateCylinderEmitter(radius, height, radiusRange, directionRandomizer);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)
     * @param radius The radius of the cylinder to emit from
     * @param height The height of the emission cylinder
     * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder
     * @returns the emitter
     */
    createDirectedCylinderEmitter(radius = 1, height = 1, radiusRange = 1, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
        const particleEmitter = CreateDirectedCylinderEmitter(radius, height, radiusRange, direction1, direction2);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)
     * @param radius The radius of the cone to emit from
     * @param angle The base angle of the cone
     * @returns the emitter
     */
    createConeEmitter(radius = 1, angle = Math.PI / 4) {
        const particleEmitter = CreateConeEmitter(radius, angle);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    createDirectedConeEmitter(radius = 1, angle = Math.PI / 4, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
        const particleEmitter = CreateDirectedConeEmitter(radius, angle, direction1, direction2);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
     * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox
     * @param maxEmitBox  Particles are emitted from the box between minEmitBox and maxEmitBox
     * @returns the emitter
     */
    createBoxEmitter(direction1, direction2, minEmitBox, maxEmitBox) {
        const particleEmitter = new BoxParticleEmitter();
        this.particleEmitterType = particleEmitter;
        this.direction1 = direction1;
        this.direction2 = direction2;
        this.minEmitBox = minEmitBox;
        this.maxEmitBox = maxEmitBox;
        return particleEmitter;
    }
    _prepareSubEmitterInternalArray() {
        this._subEmitters = new Array();
        if (this.subEmitters) {
            this.subEmitters.forEach((subEmitter) => {
                if (subEmitter instanceof ParticleSystem) {
                    this._subEmitters.push([new SubEmitter(subEmitter)]);
                }
                else if (subEmitter instanceof SubEmitter) {
                    this._subEmitters.push([subEmitter]);
                }
                else if (subEmitter instanceof Array) {
                    this._subEmitters.push(subEmitter);
                }
            });
        }
    }
    _stopSubEmitters() {
        if (!this.activeSubSystems) {
            return;
        }
        this.activeSubSystems.forEach((subSystem) => {
            subSystem.stop(true);
        });
        this.activeSubSystems = [];
    }
    _removeFromRoot() {
        if (!this._rootParticleSystem) {
            return;
        }
        const index = this._rootParticleSystem.activeSubSystems.indexOf(this);
        if (index !== -1) {
            this._rootParticleSystem.activeSubSystems.splice(index, 1);
        }
        this._rootParticleSystem = null;
    }
    _preStart() {
        // Convert the subEmitters field to the constant type field _subEmitters
        this._prepareSubEmitterInternalArray();
        if (this._subEmitters && this._subEmitters.length != 0) {
            this.activeSubSystems = [];
        }
    }
    _postStop(stopSubEmitters) {
        if (stopSubEmitters) {
            this._stopSubEmitters();
        }
    }
    _prepareParticle(particle) {
        // Attach emitters
        if (this._subEmitters && this._subEmitters.length > 0) {
            const subEmitters = this._subEmitters[Math.floor(Math.random() * this._subEmitters.length)];
            particle._attachedSubEmitters = [];
            subEmitters.forEach((subEmitter) => {
                if (subEmitter.type === 0 /* SubEmitterType.ATTACHED */) {
                    const newEmitter = subEmitter.clone();
                    particle._attachedSubEmitters.push(newEmitter);
                    newEmitter.particleSystem.start();
                }
            });
        }
    }
    /** @internal */
    _onDispose(disposeAttachedSubEmitters = false, disposeEndSubEmitters = false) {
        this._removeFromRoot();
        if (this.subEmitters && !this._subEmitters) {
            this._prepareSubEmitterInternalArray();
        }
        if (disposeAttachedSubEmitters) {
            this.particles?.forEach((particle) => {
                if (particle._attachedSubEmitters) {
                    for (let i = particle._attachedSubEmitters.length - 1; i >= 0; i -= 1) {
                        particle._attachedSubEmitters[i].dispose();
                    }
                }
            });
        }
        if (disposeEndSubEmitters) {
            if (this.activeSubSystems) {
                for (let i = this.activeSubSystems.length - 1; i >= 0; i -= 1) {
                    this.activeSubSystems[i].dispose();
                }
            }
        }
        if (this._subEmitters && this._subEmitters.length) {
            for (let index = 0; index < this._subEmitters.length; index++) {
                for (const subEmitter of this._subEmitters[index]) {
                    subEmitter.dispose();
                }
            }
            this._subEmitters = [];
            this.subEmitters = [];
        }
        if (this._disposeEmitterOnDispose && this.emitter && this.emitter.dispose) {
            this.emitter.dispose(true);
        }
    }
    /**
     * @internal
     */
    static _Parse(parsedParticleSystem, particleSystem, sceneOrEngine, rootUrl) {
        let scene;
        if (sceneOrEngine instanceof abstractEngine/* AbstractEngine */.$) {
            scene = null;
        }
        else {
            scene = sceneOrEngine;
        }
        const internalClass = (0,typeStore/* GetClass */.n9)("BABYLON.Texture");
        if (internalClass && scene) {
            // Texture
            if (parsedParticleSystem.texture) {
                particleSystem.particleTexture = internalClass.Parse(parsedParticleSystem.texture, scene, rootUrl);
            }
            else if (parsedParticleSystem.textureName) {
                particleSystem.particleTexture = new internalClass(rootUrl + parsedParticleSystem.textureName, scene, false, parsedParticleSystem.invertY !== undefined ? parsedParticleSystem.invertY : true);
                particleSystem.particleTexture.name = parsedParticleSystem.textureName;
            }
        }
        // Emitter
        if (!parsedParticleSystem.emitterId && parsedParticleSystem.emitterId !== 0 && parsedParticleSystem.emitter === undefined) {
            particleSystem.emitter = math_vector/* Vector3 */.Pq.Zero();
        }
        else if (parsedParticleSystem.emitterId && scene) {
            particleSystem.emitter = scene.getLastMeshById(parsedParticleSystem.emitterId);
        }
        else {
            particleSystem.emitter = math_vector/* Vector3 */.Pq.FromArray(parsedParticleSystem.emitter);
        }
        particleSystem.isLocal = !!parsedParticleSystem.isLocal;
        // Misc.
        if (parsedParticleSystem.renderingGroupId !== undefined) {
            particleSystem.renderingGroupId = parsedParticleSystem.renderingGroupId;
        }
        if (parsedParticleSystem.isBillboardBased !== undefined) {
            particleSystem.isBillboardBased = parsedParticleSystem.isBillboardBased;
        }
        if (parsedParticleSystem.billboardMode !== undefined) {
            particleSystem.billboardMode = parsedParticleSystem.billboardMode;
        }
        if (parsedParticleSystem.useLogarithmicDepth !== undefined) {
            particleSystem.useLogarithmicDepth = parsedParticleSystem.useLogarithmicDepth;
        }
        // Animations
        if (parsedParticleSystem.animations) {
            for (let animationIndex = 0; animationIndex < parsedParticleSystem.animations.length; animationIndex++) {
                const parsedAnimation = parsedParticleSystem.animations[animationIndex];
                const internalClass = (0,typeStore/* GetClass */.n9)("BABYLON.Animation");
                if (internalClass) {
                    particleSystem.animations.push(internalClass.Parse(parsedAnimation));
                }
            }
            particleSystem.beginAnimationOnStart = parsedParticleSystem.beginAnimationOnStart;
            particleSystem.beginAnimationFrom = parsedParticleSystem.beginAnimationFrom;
            particleSystem.beginAnimationTo = parsedParticleSystem.beginAnimationTo;
            particleSystem.beginAnimationLoop = parsedParticleSystem.beginAnimationLoop;
        }
        if (parsedParticleSystem.autoAnimate && scene) {
            scene.beginAnimation(particleSystem, parsedParticleSystem.autoAnimateFrom, parsedParticleSystem.autoAnimateTo, parsedParticleSystem.autoAnimateLoop, parsedParticleSystem.autoAnimateSpeed || 1.0);
        }
        // Particle system
        particleSystem.startDelay = parsedParticleSystem.startDelay | 0;
        particleSystem.minAngularSpeed = parsedParticleSystem.minAngularSpeed;
        particleSystem.maxAngularSpeed = parsedParticleSystem.maxAngularSpeed;
        particleSystem.minSize = parsedParticleSystem.minSize;
        particleSystem.maxSize = parsedParticleSystem.maxSize;
        if (parsedParticleSystem.minScaleX) {
            particleSystem.minScaleX = parsedParticleSystem.minScaleX;
            particleSystem.maxScaleX = parsedParticleSystem.maxScaleX;
            particleSystem.minScaleY = parsedParticleSystem.minScaleY;
            particleSystem.maxScaleY = parsedParticleSystem.maxScaleY;
        }
        if (parsedParticleSystem.preWarmCycles !== undefined) {
            particleSystem.preWarmCycles = parsedParticleSystem.preWarmCycles;
            particleSystem.preWarmStepOffset = parsedParticleSystem.preWarmStepOffset;
        }
        if (parsedParticleSystem.minInitialRotation !== undefined) {
            particleSystem.minInitialRotation = parsedParticleSystem.minInitialRotation;
            particleSystem.maxInitialRotation = parsedParticleSystem.maxInitialRotation;
        }
        particleSystem.minLifeTime = parsedParticleSystem.minLifeTime;
        particleSystem.maxLifeTime = parsedParticleSystem.maxLifeTime;
        particleSystem.minEmitPower = parsedParticleSystem.minEmitPower;
        particleSystem.maxEmitPower = parsedParticleSystem.maxEmitPower;
        particleSystem.emitRate = parsedParticleSystem.emitRate;
        particleSystem.gravity = math_vector/* Vector3 */.Pq.FromArray(parsedParticleSystem.gravity);
        if (parsedParticleSystem.noiseStrength) {
            particleSystem.noiseStrength = math_vector/* Vector3 */.Pq.FromArray(parsedParticleSystem.noiseStrength);
        }
        particleSystem.color1 = math_color/* Color4 */.ov.FromArray(parsedParticleSystem.color1);
        particleSystem.color2 = math_color/* Color4 */.ov.FromArray(parsedParticleSystem.color2);
        particleSystem.colorDead = math_color/* Color4 */.ov.FromArray(parsedParticleSystem.colorDead);
        particleSystem.updateSpeed = parsedParticleSystem.updateSpeed;
        particleSystem.targetStopDuration = parsedParticleSystem.targetStopDuration;
        particleSystem.blendMode = parsedParticleSystem.blendMode;
        if (parsedParticleSystem.colorGradients) {
            for (const colorGradient of parsedParticleSystem.colorGradients) {
                particleSystem.addColorGradient(colorGradient.gradient, math_color/* Color4 */.ov.FromArray(colorGradient.color1), colorGradient.color2 ? math_color/* Color4 */.ov.FromArray(colorGradient.color2) : undefined);
            }
        }
        if (parsedParticleSystem.rampGradients) {
            for (const rampGradient of parsedParticleSystem.rampGradients) {
                particleSystem.addRampGradient(rampGradient.gradient, math_color/* Color3 */.v9.FromArray(rampGradient.color));
            }
            particleSystem.useRampGradients = parsedParticleSystem.useRampGradients;
        }
        if (parsedParticleSystem.colorRemapGradients) {
            for (const colorRemapGradient of parsedParticleSystem.colorRemapGradients) {
                particleSystem.addColorRemapGradient(colorRemapGradient.gradient, colorRemapGradient.factor1 !== undefined ? colorRemapGradient.factor1 : colorRemapGradient.factor, colorRemapGradient.factor2);
            }
        }
        if (parsedParticleSystem.alphaRemapGradients) {
            for (const alphaRemapGradient of parsedParticleSystem.alphaRemapGradients) {
                particleSystem.addAlphaRemapGradient(alphaRemapGradient.gradient, alphaRemapGradient.factor1 !== undefined ? alphaRemapGradient.factor1 : alphaRemapGradient.factor, alphaRemapGradient.factor2);
            }
        }
        if (parsedParticleSystem.sizeGradients) {
            for (const sizeGradient of parsedParticleSystem.sizeGradients) {
                particleSystem.addSizeGradient(sizeGradient.gradient, sizeGradient.factor1 !== undefined ? sizeGradient.factor1 : sizeGradient.factor, sizeGradient.factor2);
            }
        }
        if (parsedParticleSystem.angularSpeedGradients) {
            for (const angularSpeedGradient of parsedParticleSystem.angularSpeedGradients) {
                particleSystem.addAngularSpeedGradient(angularSpeedGradient.gradient, angularSpeedGradient.factor1 !== undefined ? angularSpeedGradient.factor1 : angularSpeedGradient.factor, angularSpeedGradient.factor2);
            }
        }
        if (parsedParticleSystem.velocityGradients) {
            for (const velocityGradient of parsedParticleSystem.velocityGradients) {
                particleSystem.addVelocityGradient(velocityGradient.gradient, velocityGradient.factor1 !== undefined ? velocityGradient.factor1 : velocityGradient.factor, velocityGradient.factor2);
            }
        }
        if (parsedParticleSystem.dragGradients) {
            for (const dragGradient of parsedParticleSystem.dragGradients) {
                particleSystem.addDragGradient(dragGradient.gradient, dragGradient.factor1 !== undefined ? dragGradient.factor1 : dragGradient.factor, dragGradient.factor2);
            }
        }
        if (parsedParticleSystem.emitRateGradients) {
            for (const emitRateGradient of parsedParticleSystem.emitRateGradients) {
                particleSystem.addEmitRateGradient(emitRateGradient.gradient, emitRateGradient.factor1 !== undefined ? emitRateGradient.factor1 : emitRateGradient.factor, emitRateGradient.factor2);
            }
        }
        if (parsedParticleSystem.startSizeGradients) {
            for (const startSizeGradient of parsedParticleSystem.startSizeGradients) {
                particleSystem.addStartSizeGradient(startSizeGradient.gradient, startSizeGradient.factor1 !== undefined ? startSizeGradient.factor1 : startSizeGradient.factor, startSizeGradient.factor2);
            }
        }
        if (parsedParticleSystem.lifeTimeGradients) {
            for (const lifeTimeGradient of parsedParticleSystem.lifeTimeGradients) {
                particleSystem.addLifeTimeGradient(lifeTimeGradient.gradient, lifeTimeGradient.factor1 !== undefined ? lifeTimeGradient.factor1 : lifeTimeGradient.factor, lifeTimeGradient.factor2);
            }
        }
        if (parsedParticleSystem.limitVelocityGradients) {
            for (const limitVelocityGradient of parsedParticleSystem.limitVelocityGradients) {
                particleSystem.addLimitVelocityGradient(limitVelocityGradient.gradient, limitVelocityGradient.factor1 !== undefined ? limitVelocityGradient.factor1 : limitVelocityGradient.factor, limitVelocityGradient.factor2);
            }
            particleSystem.limitVelocityDamping = parsedParticleSystem.limitVelocityDamping;
        }
        if (parsedParticleSystem.noiseTexture && scene) {
            const internalClass = (0,typeStore/* GetClass */.n9)("BABYLON.ProceduralTexture");
            particleSystem.noiseTexture = internalClass.Parse(parsedParticleSystem.noiseTexture, scene, rootUrl);
        }
        // Emitter
        let emitterType;
        if (parsedParticleSystem.particleEmitterType) {
            switch (parsedParticleSystem.particleEmitterType.type) {
                case "SphereParticleEmitter":
                    emitterType = new SphereParticleEmitter();
                    break;
                case "SphereDirectedParticleEmitter":
                    emitterType = new SphereDirectedParticleEmitter();
                    break;
                case "ConeEmitter":
                case "ConeParticleEmitter":
                    emitterType = new ConeParticleEmitter();
                    break;
                case "ConeDirectedParticleEmitter":
                    emitterType = new ConeDirectedParticleEmitter();
                    break;
                case "CylinderParticleEmitter":
                    emitterType = new CylinderParticleEmitter();
                    break;
                case "CylinderDirectedParticleEmitter":
                    emitterType = new CylinderDirectedParticleEmitter();
                    break;
                case "HemisphericParticleEmitter":
                    emitterType = new HemisphericParticleEmitter();
                    break;
                case "PointParticleEmitter":
                    emitterType = new PointParticleEmitter();
                    break;
                case "MeshParticleEmitter":
                    emitterType = new MeshParticleEmitter();
                    break;
                case "CustomParticleEmitter":
                    emitterType = new CustomParticleEmitter();
                    break;
                case "BoxEmitter":
                case "BoxParticleEmitter":
                default:
                    emitterType = new BoxParticleEmitter();
                    break;
            }
            emitterType.parse(parsedParticleSystem.particleEmitterType, scene);
        }
        else {
            emitterType = new BoxParticleEmitter();
            emitterType.parse(parsedParticleSystem, scene);
        }
        particleSystem.particleEmitterType = emitterType;
        // Animation sheet
        particleSystem.startSpriteCellID = parsedParticleSystem.startSpriteCellID;
        particleSystem.endSpriteCellID = parsedParticleSystem.endSpriteCellID;
        particleSystem.spriteCellLoop = parsedParticleSystem.spriteCellLoop ?? true;
        particleSystem.spriteCellWidth = parsedParticleSystem.spriteCellWidth;
        particleSystem.spriteCellHeight = parsedParticleSystem.spriteCellHeight;
        particleSystem.spriteCellChangeSpeed = parsedParticleSystem.spriteCellChangeSpeed;
        particleSystem.spriteRandomStartCell = parsedParticleSystem.spriteRandomStartCell;
        particleSystem.disposeOnStop = parsedParticleSystem.disposeOnStop ?? false;
        particleSystem.manualEmitCount = parsedParticleSystem.manualEmitCount ?? -1;
    }
    /**
     * Parses a JSON object to create a particle system.
     * @param parsedParticleSystem The JSON object to parse
     * @param sceneOrEngine The scene or the engine to create the particle system in
     * @param rootUrl The root url to use to load external dependencies like texture
     * @param doNotStart Ignore the preventAutoStart attribute and does not start
     * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
     * @returns the Parsed particle system
     */
    static Parse(parsedParticleSystem, sceneOrEngine, rootUrl, doNotStart = false, capacity) {
        const name = parsedParticleSystem.name;
        let custom = null;
        let program = null;
        let engine;
        let scene;
        if (sceneOrEngine instanceof abstractEngine/* AbstractEngine */.$) {
            engine = sceneOrEngine;
        }
        else {
            scene = sceneOrEngine;
            engine = scene.getEngine();
        }
        if (parsedParticleSystem.customShader && engine.createEffectForParticles) {
            program = parsedParticleSystem.customShader;
            const defines = program.shaderOptions.defines.length > 0 ? program.shaderOptions.defines.join("\n") : "";
            custom = engine.createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines);
        }
        const particleSystem = new ParticleSystem(name, capacity || parsedParticleSystem.capacity, sceneOrEngine, custom, parsedParticleSystem.isAnimationSheetEnabled);
        particleSystem.customShader = program;
        particleSystem._rootUrl = rootUrl;
        if (parsedParticleSystem.id) {
            particleSystem.id = parsedParticleSystem.id;
        }
        // SubEmitters
        if (parsedParticleSystem.subEmitters) {
            particleSystem.subEmitters = [];
            for (const cell of parsedParticleSystem.subEmitters) {
                const cellArray = [];
                for (const sub of cell) {
                    cellArray.push(SubEmitter.Parse(sub, sceneOrEngine, rootUrl));
                }
                particleSystem.subEmitters.push(cellArray);
            }
        }
        ParticleSystem._Parse(parsedParticleSystem, particleSystem, sceneOrEngine, rootUrl);
        if (parsedParticleSystem.textureMask) {
            particleSystem.textureMask = math_color/* Color4 */.ov.FromArray(parsedParticleSystem.textureMask);
        }
        if (parsedParticleSystem.worldOffset) {
            particleSystem.worldOffset = math_vector/* Vector3 */.Pq.FromArray(parsedParticleSystem.worldOffset);
        }
        // Auto start
        if (parsedParticleSystem.preventAutoStart) {
            particleSystem.preventAutoStart = parsedParticleSystem.preventAutoStart;
        }
        if (!doNotStart && !particleSystem.preventAutoStart) {
            particleSystem.start();
        }
        return particleSystem;
    }
    /**
     * Serializes the particle system to a JSON object
     * @param serializeTexture defines if the texture must be serialized as well
     * @returns the JSON object
     */
    serialize(serializeTexture = false) {
        const serializationObject = {};
        ParticleSystem._Serialize(serializationObject, this, serializeTexture);
        serializationObject.textureMask = this.textureMask.asArray();
        serializationObject.customShader = this.customShader;
        serializationObject.preventAutoStart = this.preventAutoStart;
        serializationObject.worldOffset = this.worldOffset.asArray();
        // SubEmitters
        if (this.subEmitters) {
            serializationObject.subEmitters = [];
            if (!this._subEmitters) {
                this._prepareSubEmitterInternalArray();
            }
            for (const subs of this._subEmitters) {
                const cell = [];
                for (const sub of subs) {
                    cell.push(sub.serialize(serializeTexture));
                }
                serializationObject.subEmitters.push(cell);
            }
        }
        return serializationObject;
    }
    /**
     * @internal
     */
    static _Serialize(serializationObject, particleSystem, serializeTexture) {
        serializationObject.name = particleSystem.name;
        serializationObject.id = particleSystem.id;
        serializationObject.capacity = particleSystem.getCapacity();
        serializationObject.disposeOnStop = particleSystem.disposeOnStop;
        serializationObject.manualEmitCount = particleSystem.manualEmitCount;
        // Emitter
        if (particleSystem.emitter.position) {
            const emitterMesh = particleSystem.emitter;
            serializationObject.emitterId = emitterMesh.id;
        }
        else {
            const emitterPosition = particleSystem.emitter;
            serializationObject.emitter = emitterPosition.asArray();
        }
        // Emitter
        if (particleSystem.particleEmitterType) {
            serializationObject.particleEmitterType = particleSystem.particleEmitterType.serialize();
        }
        if (particleSystem.particleTexture) {
            if (serializeTexture) {
                serializationObject.texture = particleSystem.particleTexture.serialize();
            }
            else {
                serializationObject.textureName = particleSystem.particleTexture.name;
                serializationObject.invertY = !!particleSystem.particleTexture._invertY;
            }
        }
        serializationObject.isLocal = particleSystem.isLocal;
        // Animations
        decorators_serialization/* SerializationHelper */.p.AppendSerializedAnimations(particleSystem, serializationObject);
        serializationObject.beginAnimationOnStart = particleSystem.beginAnimationOnStart;
        serializationObject.beginAnimationFrom = particleSystem.beginAnimationFrom;
        serializationObject.beginAnimationTo = particleSystem.beginAnimationTo;
        serializationObject.beginAnimationLoop = particleSystem.beginAnimationLoop;
        // Particle system
        serializationObject.startDelay = particleSystem.startDelay;
        serializationObject.renderingGroupId = particleSystem.renderingGroupId;
        serializationObject.isBillboardBased = particleSystem.isBillboardBased;
        serializationObject.billboardMode = particleSystem.billboardMode;
        serializationObject.minAngularSpeed = particleSystem.minAngularSpeed;
        serializationObject.maxAngularSpeed = particleSystem.maxAngularSpeed;
        serializationObject.minSize = particleSystem.minSize;
        serializationObject.maxSize = particleSystem.maxSize;
        serializationObject.minScaleX = particleSystem.minScaleX;
        serializationObject.maxScaleX = particleSystem.maxScaleX;
        serializationObject.minScaleY = particleSystem.minScaleY;
        serializationObject.maxScaleY = particleSystem.maxScaleY;
        serializationObject.minEmitPower = particleSystem.minEmitPower;
        serializationObject.maxEmitPower = particleSystem.maxEmitPower;
        serializationObject.minLifeTime = particleSystem.minLifeTime;
        serializationObject.maxLifeTime = particleSystem.maxLifeTime;
        serializationObject.emitRate = particleSystem.emitRate;
        serializationObject.gravity = particleSystem.gravity.asArray();
        serializationObject.noiseStrength = particleSystem.noiseStrength.asArray();
        serializationObject.color1 = particleSystem.color1.asArray();
        serializationObject.color2 = particleSystem.color2.asArray();
        serializationObject.colorDead = particleSystem.colorDead.asArray();
        serializationObject.updateSpeed = particleSystem.updateSpeed;
        serializationObject.targetStopDuration = particleSystem.targetStopDuration;
        serializationObject.blendMode = particleSystem.blendMode;
        serializationObject.preWarmCycles = particleSystem.preWarmCycles;
        serializationObject.preWarmStepOffset = particleSystem.preWarmStepOffset;
        serializationObject.minInitialRotation = particleSystem.minInitialRotation;
        serializationObject.maxInitialRotation = particleSystem.maxInitialRotation;
        serializationObject.startSpriteCellID = particleSystem.startSpriteCellID;
        serializationObject.spriteCellLoop = particleSystem.spriteCellLoop;
        serializationObject.endSpriteCellID = particleSystem.endSpriteCellID;
        serializationObject.spriteCellChangeSpeed = particleSystem.spriteCellChangeSpeed;
        serializationObject.spriteCellWidth = particleSystem.spriteCellWidth;
        serializationObject.spriteCellHeight = particleSystem.spriteCellHeight;
        serializationObject.spriteRandomStartCell = particleSystem.spriteRandomStartCell;
        serializationObject.isAnimationSheetEnabled = particleSystem.isAnimationSheetEnabled;
        serializationObject.useLogarithmicDepth = particleSystem.useLogarithmicDepth;
        const colorGradients = particleSystem.getColorGradients();
        if (colorGradients) {
            serializationObject.colorGradients = [];
            for (const colorGradient of colorGradients) {
                const serializedGradient = {
                    gradient: colorGradient.gradient,
                    color1: colorGradient.color1.asArray(),
                };
                if (colorGradient.color2) {
                    serializedGradient.color2 = colorGradient.color2.asArray();
                }
                else {
                    serializedGradient.color2 = colorGradient.color1.asArray();
                }
                serializationObject.colorGradients.push(serializedGradient);
            }
        }
        const rampGradients = particleSystem.getRampGradients();
        if (rampGradients) {
            serializationObject.rampGradients = [];
            for (const rampGradient of rampGradients) {
                const serializedGradient = {
                    gradient: rampGradient.gradient,
                    color: rampGradient.color.asArray(),
                };
                serializationObject.rampGradients.push(serializedGradient);
            }
            serializationObject.useRampGradients = particleSystem.useRampGradients;
        }
        const colorRemapGradients = particleSystem.getColorRemapGradients();
        if (colorRemapGradients) {
            serializationObject.colorRemapGradients = [];
            for (const colorRemapGradient of colorRemapGradients) {
                const serializedGradient = {
                    gradient: colorRemapGradient.gradient,
                    factor1: colorRemapGradient.factor1,
                };
                if (colorRemapGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = colorRemapGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = colorRemapGradient.factor1;
                }
                serializationObject.colorRemapGradients.push(serializedGradient);
            }
        }
        const alphaRemapGradients = particleSystem.getAlphaRemapGradients();
        if (alphaRemapGradients) {
            serializationObject.alphaRemapGradients = [];
            for (const alphaRemapGradient of alphaRemapGradients) {
                const serializedGradient = {
                    gradient: alphaRemapGradient.gradient,
                    factor1: alphaRemapGradient.factor1,
                };
                if (alphaRemapGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = alphaRemapGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = alphaRemapGradient.factor1;
                }
                serializationObject.alphaRemapGradients.push(serializedGradient);
            }
        }
        const sizeGradients = particleSystem.getSizeGradients();
        if (sizeGradients) {
            serializationObject.sizeGradients = [];
            for (const sizeGradient of sizeGradients) {
                const serializedGradient = {
                    gradient: sizeGradient.gradient,
                    factor1: sizeGradient.factor1,
                };
                if (sizeGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = sizeGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = sizeGradient.factor1;
                }
                serializationObject.sizeGradients.push(serializedGradient);
            }
        }
        const angularSpeedGradients = particleSystem.getAngularSpeedGradients();
        if (angularSpeedGradients) {
            serializationObject.angularSpeedGradients = [];
            for (const angularSpeedGradient of angularSpeedGradients) {
                const serializedGradient = {
                    gradient: angularSpeedGradient.gradient,
                    factor1: angularSpeedGradient.factor1,
                };
                if (angularSpeedGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = angularSpeedGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = angularSpeedGradient.factor1;
                }
                serializationObject.angularSpeedGradients.push(serializedGradient);
            }
        }
        const velocityGradients = particleSystem.getVelocityGradients();
        if (velocityGradients) {
            serializationObject.velocityGradients = [];
            for (const velocityGradient of velocityGradients) {
                const serializedGradient = {
                    gradient: velocityGradient.gradient,
                    factor1: velocityGradient.factor1,
                };
                if (velocityGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = velocityGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = velocityGradient.factor1;
                }
                serializationObject.velocityGradients.push(serializedGradient);
            }
        }
        const dragGradients = particleSystem.getDragGradients();
        if (dragGradients) {
            serializationObject.dragGradients = [];
            for (const dragGradient of dragGradients) {
                const serializedGradient = {
                    gradient: dragGradient.gradient,
                    factor1: dragGradient.factor1,
                };
                if (dragGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = dragGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = dragGradient.factor1;
                }
                serializationObject.dragGradients.push(serializedGradient);
            }
        }
        const emitRateGradients = particleSystem.getEmitRateGradients();
        if (emitRateGradients) {
            serializationObject.emitRateGradients = [];
            for (const emitRateGradient of emitRateGradients) {
                const serializedGradient = {
                    gradient: emitRateGradient.gradient,
                    factor1: emitRateGradient.factor1,
                };
                if (emitRateGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = emitRateGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = emitRateGradient.factor1;
                }
                serializationObject.emitRateGradients.push(serializedGradient);
            }
        }
        const startSizeGradients = particleSystem.getStartSizeGradients();
        if (startSizeGradients) {
            serializationObject.startSizeGradients = [];
            for (const startSizeGradient of startSizeGradients) {
                const serializedGradient = {
                    gradient: startSizeGradient.gradient,
                    factor1: startSizeGradient.factor1,
                };
                if (startSizeGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = startSizeGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = startSizeGradient.factor1;
                }
                serializationObject.startSizeGradients.push(serializedGradient);
            }
        }
        const lifeTimeGradients = particleSystem.getLifeTimeGradients();
        if (lifeTimeGradients) {
            serializationObject.lifeTimeGradients = [];
            for (const lifeTimeGradient of lifeTimeGradients) {
                const serializedGradient = {
                    gradient: lifeTimeGradient.gradient,
                    factor1: lifeTimeGradient.factor1,
                };
                if (lifeTimeGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = lifeTimeGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = lifeTimeGradient.factor1;
                }
                serializationObject.lifeTimeGradients.push(serializedGradient);
            }
        }
        const limitVelocityGradients = particleSystem.getLimitVelocityGradients();
        if (limitVelocityGradients) {
            serializationObject.limitVelocityGradients = [];
            for (const limitVelocityGradient of limitVelocityGradients) {
                const serializedGradient = {
                    gradient: limitVelocityGradient.gradient,
                    factor1: limitVelocityGradient.factor1,
                };
                if (limitVelocityGradient.factor2 !== undefined) {
                    serializedGradient.factor2 = limitVelocityGradient.factor2;
                }
                else {
                    serializedGradient.factor2 = limitVelocityGradient.factor1;
                }
                serializationObject.limitVelocityGradients.push(serializedGradient);
            }
            serializationObject.limitVelocityDamping = particleSystem.limitVelocityDamping;
        }
        if (particleSystem.noiseTexture) {
            serializationObject.noiseTexture = particleSystem.noiseTexture.serialize();
        }
    }
    // Clone
    /**
     * Clones the particle system.
     * @param name The name of the cloned object
     * @param newEmitter The new emitter to use
     * @param cloneTexture Also clone the textures if true
     * @returns the cloned particle system
     */
    clone(name, newEmitter, cloneTexture = false) {
        const custom = { ...this._customWrappers };
        let program = null;
        const engine = this._engine;
        if (engine.createEffectForParticles) {
            if (this.customShader != null) {
                program = this.customShader;
                const defines = program.shaderOptions.defines.length > 0 ? program.shaderOptions.defines.join("\n") : "";
                const effect = engine.createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines);
                if (!custom[0]) {
                    this.setCustomEffect(effect, 0);
                }
                else {
                    custom[0].effect = effect;
                }
            }
        }
        const serialization = this.serialize(cloneTexture);
        const result = ParticleSystem.Parse(serialization, this._scene || this._engine, this._rootUrl);
        result.name = name;
        result.customShader = program;
        result._customWrappers = custom;
        if (newEmitter === undefined) {
            newEmitter = this.emitter;
        }
        if (this.noiseTexture) {
            result.noiseTexture = this.noiseTexture.clone();
        }
        result.emitter = newEmitter;
        if (!this.preventAutoStart) {
            result.start();
        }
        return result;
    }
}
/**
 * Billboard mode will only apply to Y axis
 */
ParticleSystem.BILLBOARDMODE_Y = 2;
/**
 * Billboard mode will apply to all axes
 */
ParticleSystem.BILLBOARDMODE_ALL = 7;
/**
 * Special billboard mode where the particle will be biilboard to the camera but rotated to align with direction
 */
ParticleSystem.BILLBOARDMODE_STRETCHED = 8;
/**
 * Special billboard mode where the particle will be billboard to the camera but only around the axis of the direction of particle emission
 */
ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL = 9;
SubEmitter._ParseParticleSystem = ParticleSystem.Parse;
//# sourceMappingURL=particleSystem.js.map
;// ./node_modules/@babylonjs/core/Misc/sceneRecorder.js














/**
 * Class used to record delta files between 2 scene states
 */
class SceneRecorder {
    constructor() {
        this._trackedScene = null;
    }
    /**
     * Track a given scene. This means the current scene state will be considered the original state
     * @param scene defines the scene to track
     */
    track(scene) {
        this._trackedScene = scene;
        decorators_serialization/* SerializationHelper */.p.AllowLoadingUniqueId = true;
        this._savedJSON = SceneSerializer.Serialize(scene);
        decorators_serialization/* SerializationHelper */.p.AllowLoadingUniqueId = false;
    }
    /**
     * Get the delta between current state and original state
     * @returns a any containing the delta
     */
    getDelta() {
        if (!this._trackedScene) {
            return null;
        }
        const currentForceSerializeBuffers = Textures_texture/* Texture */.g.ForceSerializeBuffers;
        Textures_texture/* Texture */.g.ForceSerializeBuffers = false;
        decorators_serialization/* SerializationHelper */.p.AllowLoadingUniqueId = true;
        const newJSON = SceneSerializer.Serialize(this._trackedScene);
        decorators_serialization/* SerializationHelper */.p.AllowLoadingUniqueId = false;
        const deltaJSON = {};
        for (const node in newJSON) {
            this._compareCollections(node, this._savedJSON[node], newJSON[node], deltaJSON);
        }
        Textures_texture/* Texture */.g.ForceSerializeBuffers = currentForceSerializeBuffers;
        return deltaJSON;
    }
    _compareArray(key, original, current, deltaJSON) {
        if (original.length === 0 && current.length === 0) {
            return true;
        }
        // Numbers?
        if ((original.length && !isNaN(original[0])) || (current.length && !isNaN(current[0]))) {
            if (original.length !== current.length) {
                return false;
            }
            if (original.length === 0) {
                return true;
            }
            for (let index = 0; index < original.length; index++) {
                if (original[index] !== current[index]) {
                    deltaJSON[key] = current;
                    return false;
                }
            }
            return true;
        }
        // let's use uniqueId to find similar objects
        const originalUniqueIds = [];
        for (let index = 0; index < original.length; index++) {
            const originalObject = original[index];
            const originalUniqueId = originalObject.uniqueId;
            originalUniqueIds.push(originalUniqueId);
            // Look for that object in current state
            const currentObjects = current.filter((c) => c.uniqueId === originalUniqueId);
            if (currentObjects.length) {
                // We have a candidate
                const currentObject = currentObjects[0];
                const newObject = {};
                if (!this._compareObjects(originalObject, currentObject, newObject)) {
                    if (!deltaJSON[key]) {
                        deltaJSON[key] = [];
                    }
                    newObject.__state = {
                        id: currentObject.id || currentObject.name,
                    };
                    deltaJSON[key].push(newObject);
                }
            }
            else {
                // We need to delete
                const newObject = {
                    __state: {
                        deleteId: originalObject.id || originalObject.name,
                    },
                };
                if (!deltaJSON[key]) {
                    deltaJSON[key] = [];
                }
                deltaJSON[key].push(newObject);
            }
        }
        // Checking for new objects
        for (let index = 0; index < current.length; index++) {
            const currentObject = current[index];
            const currentUniqueId = currentObject.uniqueId;
            // Object was added
            if (originalUniqueIds.indexOf(currentUniqueId) === -1) {
                if (!deltaJSON[key]) {
                    deltaJSON[key] = [];
                }
                deltaJSON[key].push(currentObject);
            }
        }
        return true;
    }
    _compareObjects(originalObjet, currentObject, deltaJSON) {
        let aDifferenceWasFound = false;
        for (const prop in originalObjet) {
            if (!Object.prototype.hasOwnProperty.call(originalObjet, prop)) {
                continue;
            }
            const originalValue = originalObjet[prop];
            const currentValue = currentObject[prop];
            let diffFound = false;
            if (Array.isArray(originalValue)) {
                diffFound = JSON.stringify(originalValue) !== JSON.stringify(currentValue);
            }
            else if (!isNaN(originalValue) || Object.prototype.toString.call(originalValue) == "[object String]") {
                diffFound = originalValue !== currentValue;
            }
            else if (typeof originalValue === "object" && typeof currentValue === "object") {
                const newObject = {};
                if (!this._compareObjects(originalValue, currentValue, newObject)) {
                    deltaJSON[prop] = newObject;
                    aDifferenceWasFound = true;
                }
            }
            if (diffFound) {
                aDifferenceWasFound = true;
                deltaJSON[prop] = currentValue;
            }
        }
        return !aDifferenceWasFound;
    }
    _compareCollections(key, original, current, deltaJSON) {
        // Same ?
        if (original === current) {
            return;
        }
        if (original && current) {
            // Array?
            if (Array.isArray(original) && Array.isArray(current)) {
                if (this._compareArray(key, original, current, deltaJSON)) {
                    return;
                }
            }
            else if (typeof original === "object" && typeof current === "object") {
                // Object
                const newObject = {};
                if (!this._compareObjects(original, current, newObject)) {
                    deltaJSON[key] = newObject;
                }
                return;
            }
        }
    }
    static GetShadowGeneratorById(scene, id) {
        const allGenerators = scene.lights.map((l) => l.getShadowGenerators());
        for (const generators of allGenerators) {
            if (generators) {
                const iterator = generators.values();
                for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
                    const generator = key.value;
                    if (generator && generator.id === id) {
                        return generator;
                    }
                }
            }
        }
        return null;
    }
    /**
     * Apply a given delta to a given scene
     * @param deltaJSON defines the JSON containing the delta
     * @param scene defines the scene to apply the delta to
     */
    static ApplyDelta(deltaJSON, scene) {
        if (typeof deltaJSON === "string") {
            deltaJSON = JSON.parse(deltaJSON);
        }
        // Scene
        const anyScene = scene;
        for (const prop in deltaJSON) {
            const source = deltaJSON[prop];
            const property = anyScene[prop];
            if (Array.isArray(property) || prop === "shadowGenerators") {
                // Restore array
                switch (prop) {
                    case "cameras":
                        this._ApplyDeltaForEntity(source, scene, scene.getCameraById.bind(scene), (data) => Cameras_camera/* Camera */.i.Parse(data, scene));
                        break;
                    case "lights":
                        this._ApplyDeltaForEntity(source, scene, scene.getLightById.bind(scene), (data) => Lights_light/* Light */.v.Parse(data, scene));
                        break;
                    case "shadowGenerators":
                        this._ApplyDeltaForEntity(source, scene, (id) => this.GetShadowGeneratorById(scene, id), (data) => ShadowGenerator.Parse(data, scene));
                        break;
                    case "meshes":
                        this._ApplyDeltaForEntity(source, scene, scene.getMeshById.bind(scene), (data) => Meshes_mesh/* Mesh */.e.Parse(data, scene, ""));
                        break;
                    case "skeletons":
                        this._ApplyDeltaForEntity(source, scene, scene.getSkeletonById.bind(scene), (data) => Bones_skeleton/* Skeleton */.E.Parse(data, scene));
                        break;
                    case "materials":
                        this._ApplyDeltaForEntity(source, scene, scene.getMaterialById.bind(scene), (data) => Materials_material/* Material */.i.Parse(data, scene, ""));
                        break;
                    case "multiMaterials":
                        this._ApplyDeltaForEntity(source, scene, scene.getMaterialById.bind(scene), (data) => Materials_multiMaterial/* MultiMaterial */.F.Parse(data, scene, ""));
                        break;
                    case "transformNodes":
                        this._ApplyDeltaForEntity(source, scene, scene.getTransformNodeById.bind(scene), (data) => Meshes_transformNode/* TransformNode */.V.Parse(data, scene, ""));
                        break;
                    case "particleSystems":
                        this._ApplyDeltaForEntity(source, scene, scene.getParticleSystemById.bind(scene), (data) => ParticleSystem.Parse(data, scene, ""));
                        break;
                    case "morphTargetManagers":
                        this._ApplyDeltaForEntity(source, scene, scene.getMorphTargetById.bind(scene), (data) => Morph_morphTargetManager/* MorphTargetManager */.j.Parse(data, scene));
                        break;
                    case "postProcesses":
                        this._ApplyDeltaForEntity(source, scene, scene.getPostProcessByName.bind(scene), (data) => PostProcesses_postProcess/* PostProcess */.w.Parse(data, scene, ""));
                        break;
                }
            }
            else if (!isNaN(property)) {
                anyScene[prop] = source;
            }
            else if (property.fromArray) {
                property.fromArray(source);
            }
        }
    }
    static _ApplyPropertiesToEntity(deltaJSON, entity) {
        for (const prop in deltaJSON) {
            const source = deltaJSON[prop];
            const property = entity[prop];
            if (property === undefined) {
                continue;
            }
            if (!isNaN(property) || Array.isArray(property)) {
                entity[prop] = source;
            }
            else if (property.fromArray) {
                property.fromArray(source);
            }
            else if (typeof property === "object" && property !== null) {
                this._ApplyPropertiesToEntity(source, property);
            }
        }
    }
    static _ApplyDeltaForEntity(sources, scene, finder, addNew) {
        for (const source of sources) {
            // Update
            if (source.__state && source.__state.id !== undefined) {
                const targetEntity = finder(source.__state.id);
                if (targetEntity) {
                    // This first pass applies properties that aren't on the serialization list
                    this._ApplyPropertiesToEntity(source, targetEntity);
                    // The second pass applies the serializable properties
                    decorators_serialization/* SerializationHelper */.p.ParseProperties(source, targetEntity, scene, null);
                }
            }
            else if (source.__state && source.__state.deleteId !== undefined) {
                const target = finder(source.__state.deleteId);
                target?.dispose();
            }
            else {
                // New
                addNew(source);
            }
        }
    }
}
//# sourceMappingURL=sceneRecorder.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/khronosTextureContainer2.js + 1 modules
var khronosTextureContainer2 = __webpack_require__(77502);
;// ./node_modules/@babylonjs/core/Misc/trajectoryClassifier.js

// This implementation was based on the original MIT-licensed TRACE repository
// from https://github.com/septagon/TRACE.
/**
 * Generic implementation of Levenshtein distance.
 */
var Levenshtein;
(function (Levenshtein) {
    /**
     * Alphabet from which to construct sequences to be compared using Levenshtein
     * distance.
     */
    class Alphabet {
        /**
         * Serialize the Alphabet to JSON string.
         * @returns JSON serialization
         */
        serialize() {
            const jsonObject = {};
            const characters = new Array(this._characterToIdx.size);
            this._characterToIdx.forEach((v, k) => {
                characters[v] = k;
            });
            jsonObject["characters"] = characters;
            jsonObject["insertionCosts"] = this._insertionCosts;
            jsonObject["deletionCosts"] = this._deletionCosts;
            jsonObject["substitutionCosts"] = this._substitutionCosts;
            return JSON.stringify(jsonObject);
        }
        /**
         * Parse an Alphabet from a JSON serialization.
         * @param json JSON string to deserialize
         * @returns deserialized Alphabet
         */
        static Deserialize(json) {
            const jsonObject = JSON.parse(json);
            const alphabet = new Alphabet(jsonObject["characters"]);
            alphabet._insertionCosts = jsonObject["insertionCosts"];
            alphabet._deletionCosts = jsonObject["deletionCosts"];
            alphabet._substitutionCosts = jsonObject["substitutionCosts"];
            return alphabet;
        }
        /**
         * Create a new Alphabet.
         * @param characters characters of the alphabet
         * @param charToInsertionCost function mapping characters to insertion costs
         * @param charToDeletionCost function mapping characters to deletion costs
         * @param charsToSubstitutionCost function mapping character pairs to substitution costs
         */
        constructor(characters, charToInsertionCost = null, charToDeletionCost = null, charsToSubstitutionCost = null) {
            charToInsertionCost = charToInsertionCost ?? (() => 1);
            charToDeletionCost = charToDeletionCost ?? (() => 1);
            charsToSubstitutionCost = charsToSubstitutionCost ?? ((a, b) => (a === b ? 0 : 1));
            this._characterToIdx = new Map();
            this._insertionCosts = new Array(characters.length);
            this._deletionCosts = new Array(characters.length);
            this._substitutionCosts = new Array(characters.length);
            let c;
            for (let outerIdx = 0; outerIdx < characters.length; ++outerIdx) {
                c = characters[outerIdx];
                this._characterToIdx.set(c, outerIdx);
                this._insertionCosts[outerIdx] = charToInsertionCost(c);
                this._deletionCosts[outerIdx] = charToDeletionCost(c);
                this._substitutionCosts[outerIdx] = new Array(characters.length);
                for (let innerIdx = outerIdx; innerIdx < characters.length; ++innerIdx) {
                    this._substitutionCosts[outerIdx][innerIdx] = charsToSubstitutionCost(c, characters[innerIdx]);
                }
            }
        }
        /**
         * Get the index (internally-assigned number) for a character.
         * @param char character
         * @returns index
         */
        getCharacterIdx(char) {
            return this._characterToIdx.get(char);
        }
        /**
         * Get the insertion cost of a character from its index.
         * @param idx character index
         * @returns insertion cost
         */
        getInsertionCost(idx) {
            return this._insertionCosts[idx];
        }
        /**
         * Get the deletion cost of a character from its index.
         * @param idx character index
         * @returns deletion cost
         */
        getDeletionCost(idx) {
            return this._deletionCosts[idx];
        }
        /**
         * Gets the cost to substitute two characters. NOTE: this cost is
         * required to be bi-directional, meaning it cannot matter which of
         * the provided characters is being removed and which is being inserted.
         * @param idx1 the first character index
         * @param idx2 the second character index
         * @returns substitution cost
         */
        getSubstitutionCost(idx1, idx2) {
            const min = Math.min(idx1, idx2);
            const max = Math.max(idx1, idx2);
            return this._substitutionCosts[min][max];
        }
    }
    Levenshtein.Alphabet = Alphabet;
    /**
     * Character sequence intended to be compared against other Sequences created
     * with the same Alphabet in order to compute Levenshtein distance.
     */
    class Sequence {
        /**
         * Serialize to JSON string. JSON representation does NOT include the Alphabet
         * from which this Sequence was created; Alphabet must be independently
         * serialized.
         * @returns JSON string
         */
        serialize() {
            return JSON.stringify(this._characters);
        }
        /**
         * Deserialize from JSON string and Alphabet. This should be the same Alphabet
         * from which the Sequence was originally created, which must be serialized and
         * deserialized independently so that it can be passed in here.
         * @param json JSON string representation of Sequence
         * @param alphabet Alphabet from which Sequence was originally created
         * @returns Sequence
         */
        static Deserialize(json, alphabet) {
            const sequence = new Sequence([], alphabet);
            sequence._characters = JSON.parse(json);
            return sequence;
        }
        /**
         * Create a new Sequence.
         * @param characters characters in the new Sequence
         * @param alphabet Alphabet, which must include all used characters
         */
        constructor(characters, alphabet) {
            if (characters.length > Sequence._MAX_SEQUENCE_LENGTH) {
                throw new Error("Sequences longer than " + Sequence._MAX_SEQUENCE_LENGTH + " not supported.");
            }
            this._alphabet = alphabet;
            this._characters = characters.map((c) => this._alphabet.getCharacterIdx(c));
        }
        /**
         * Get the distance between this Sequence and another.
         * @param other sequence to compare to
         * @returns Levenshtein distance
         */
        distance(other) {
            return Sequence._Distance(this, other);
        }
        /**
         * Compute the Levenshtein distance between two Sequences.
         * @param a first Sequence
         * @param b second Sequence
         * @returns Levenshtein distance
         */
        static _Distance(a, b) {
            const alphabet = a._alphabet;
            if (alphabet !== b._alphabet) {
                throw new Error("Cannot Levenshtein compare Sequences built from different alphabets.");
            }
            const aChars = a._characters;
            const bChars = b._characters;
            const aLength = aChars.length;
            const bLength = bChars.length;
            const costMatrix = Sequence._CostMatrix;
            costMatrix[0][0] = 0;
            for (let idx = 0; idx < aLength; ++idx) {
                costMatrix[idx + 1][0] = costMatrix[idx][0] + alphabet.getInsertionCost(aChars[idx]);
            }
            for (let idx = 0; idx < bLength; ++idx) {
                costMatrix[0][idx + 1] = costMatrix[0][idx] + alphabet.getInsertionCost(bChars[idx]);
            }
            for (let aIdx = 0; aIdx < aLength; ++aIdx) {
                for (let bIdx = 0; bIdx < bLength; ++bIdx) {
                    Sequence._InsertionCost = costMatrix[aIdx + 1][bIdx] + alphabet.getInsertionCost(bChars[bIdx]);
                    Sequence._DeletionCost = costMatrix[aIdx][bIdx + 1] + alphabet.getDeletionCost(aChars[aIdx]);
                    Sequence._SubstitutionCost = costMatrix[aIdx][bIdx] + alphabet.getSubstitutionCost(aChars[aIdx], bChars[bIdx]);
                    costMatrix[aIdx + 1][bIdx + 1] = Math.min(Sequence._InsertionCost, Sequence._DeletionCost, Sequence._SubstitutionCost);
                }
            }
            return costMatrix[aLength][bLength];
        }
    }
    // Scratch values
    Sequence._MAX_SEQUENCE_LENGTH = 256;
    Sequence._CostMatrix = [...Array(Sequence._MAX_SEQUENCE_LENGTH + 1)].map(() => new Array(Sequence._MAX_SEQUENCE_LENGTH + 1));
    Levenshtein.Sequence = Sequence;
})(Levenshtein || (Levenshtein = {}));
/**
 * A 3D trajectory consisting of an order list of vectors describing a
 * path of motion through 3D space.
 */
class Trajectory {
    /**
     * Serialize to JSON.
     * @returns serialized JSON string
     */
    serialize() {
        return JSON.stringify(this);
    }
    /**
     * Deserialize from JSON.
     * @param json serialized JSON string
     * @returns deserialized Trajectory
     */
    static Deserialize(json) {
        const jsonObject = JSON.parse(json);
        const trajectory = new Trajectory(jsonObject["_segmentLength"]);
        trajectory._points = jsonObject["_points"].map((pt) => {
            return new math_vector/* Vector3 */.Pq(pt["_x"], pt["_y"], pt["_z"]);
        });
        return trajectory;
    }
    /**
     * Create a new empty Trajectory.
     * @param segmentLength radius of discretization for Trajectory points
     */
    constructor(segmentLength = 0.01) {
        this._points = [];
        this._segmentLength = segmentLength;
    }
    /**
     * Get the length of the Trajectory.
     * @returns length of the Trajectory
     */
    getLength() {
        return this._points.length * this._segmentLength;
    }
    /**
     * Append a new point to the Trajectory.
     * NOTE: This implementation has many allocations.
     * @param point point to append to the Trajectory
     */
    add(point) {
        let numPoints = this._points.length;
        if (numPoints === 0) {
            this._points.push(point.clone());
        }
        else {
            const getT = () => this._segmentLength / math_vector/* Vector3 */.Pq.Distance(this._points[numPoints - 1], point);
            for (let t = getT(); t <= 1.0; t = getT()) {
                const newPoint = this._points[numPoints - 1].scale(1.0 - t);
                point.scaleAndAddToRef(t, newPoint);
                this._points.push(newPoint);
                ++numPoints;
            }
        }
    }
    /**
     * Create a new Trajectory with a segment length chosen to make it
     * probable that the new Trajectory will have a specified number of
     * segments. This operation is imprecise.
     * @param targetResolution number of segments desired
     * @returns new Trajectory with approximately the requested number of segments
     */
    resampleAtTargetResolution(targetResolution) {
        const resampled = new Trajectory(this.getLength() / targetResolution);
        this._points.forEach((pt) => {
            resampled.add(pt);
        });
        return resampled;
    }
    /**
     * Convert Trajectory segments into tokenized representation. This
     * representation is an array of numbers where each nth number is the
     * index of the token which is most similar to the nth segment of the
     * Trajectory.
     * @param tokens list of vectors which serve as discrete tokens
     * @returns list of indices of most similar token per segment
     */
    tokenize(tokens) {
        const tokenization = [];
        const segmentDir = new math_vector/* Vector3 */.Pq();
        for (let idx = 2; idx < this._points.length; ++idx) {
            if (Trajectory._TransformSegmentDirToRef(this._points[idx - 2], this._points[idx - 1], this._points[idx], segmentDir)) {
                tokenization.push(Trajectory._TokenizeSegment(segmentDir, tokens));
            }
        }
        return tokenization;
    }
    /**
     * Transform the rotation (i.e., direction) of a segment to isolate
     * the relative transformation represented by the segment. This operation
     * may or may not succeed due to singularities in the equations that define
     * motion relativity in this context.
     * @param priorVec the origin of the prior segment
     * @param fromVec the origin of the current segment
     * @param toVec the destination of the current segment
     * @param result reference to output variable
     * @returns whether or not transformation was successful
     */
    static _TransformSegmentDirToRef(priorVec, fromVec, toVec, result) {
        const DOT_PRODUCT_SAMPLE_REJECTION_THRESHOLD = 0.98;
        fromVec.subtractToRef(priorVec, Trajectory._ForwardDir);
        Trajectory._ForwardDir.normalize();
        fromVec.scaleToRef(-1, Trajectory._InverseFromVec);
        Trajectory._InverseFromVec.normalize();
        if (Math.abs(math_vector/* Vector3 */.Pq.Dot(Trajectory._ForwardDir, Trajectory._InverseFromVec)) > DOT_PRODUCT_SAMPLE_REJECTION_THRESHOLD) {
            return false;
        }
        math_vector/* Vector3 */.Pq.CrossToRef(Trajectory._ForwardDir, Trajectory._InverseFromVec, Trajectory._UpDir);
        Trajectory._UpDir.normalize();
        math_vector/* Matrix */.uq.LookAtLHToRef(priorVec, fromVec, Trajectory._UpDir, Trajectory._LookMatrix);
        toVec.subtractToRef(fromVec, Trajectory._FromToVec);
        Trajectory._FromToVec.normalize();
        math_vector/* Vector3 */.Pq.TransformNormalToRef(Trajectory._FromToVec, Trajectory._LookMatrix, result);
        return true;
    }
    /**
     * Determine which token vector is most similar to the
     * segment vector.
     * @param segment segment vector
     * @param tokens token vector list
     * @returns index of the most similar token to the segment
     */
    static _TokenizeSegment(segment, tokens) {
        Trajectory._BestMatch = 0;
        Trajectory._Score = math_vector/* Vector3 */.Pq.Dot(segment, tokens[0]);
        Trajectory._BestScore = Trajectory._Score;
        for (let idx = 1; idx < tokens.length; ++idx) {
            Trajectory._Score = math_vector/* Vector3 */.Pq.Dot(segment, tokens[idx]);
            if (Trajectory._Score > Trajectory._BestScore) {
                Trajectory._BestMatch = idx;
                Trajectory._BestScore = Trajectory._Score;
            }
        }
        return Trajectory._BestMatch;
    }
}
Trajectory._ForwardDir = new math_vector/* Vector3 */.Pq();
Trajectory._InverseFromVec = new math_vector/* Vector3 */.Pq();
Trajectory._UpDir = new math_vector/* Vector3 */.Pq();
Trajectory._FromToVec = new math_vector/* Vector3 */.Pq();
Trajectory._LookMatrix = new math_vector/* Matrix */.uq();
/**
 * Collection of vectors intended to be used as the basis of Trajectory
 * tokenization for Levenshtein distance comparison. Canonically, a
 * Vector3Alphabet will resemble a "spikeball" of vectors distributed
 * roughly evenly over the surface of the unit sphere.
 */
class Vector3Alphabet {
    /**
     * Helper method to create new "spikeball" Vector3Alphabets. Uses a naive
     * optimize-from-random strategy to space points around the unit sphere
     * surface as a simple alternative to really doing the math to tile the
     * sphere.
     * @param alphabetSize size of the desired alphabet
     * @param iterations number of iterations over which to optimize the "spikeball"
     * @param startingStepSize distance factor to move points in early optimization iterations
     * @param endingStepSize distance factor to move points in late optimization iterations
     * @param fixedValues alphabet "characters" that are required and cannot be moved by optimization
     * @returns a new randomly generated and optimized Vector3Alphabet of the specified size
     */
    static Generate(alphabetSize = 64, iterations = 256, startingStepSize = 0.1, endingStepSize = 0.001, fixedValues = []) {
        const EPSILON = 0.001;
        const EPSILON_SQUARED = EPSILON * EPSILON;
        const alphabet = new Vector3Alphabet(alphabetSize);
        for (let idx = 0; idx < alphabetSize; ++idx) {
            alphabet.chars[idx] = new math_vector/* Vector3 */.Pq(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);
            alphabet.chars[idx].normalize();
        }
        for (let idx = 0; idx < fixedValues.length; ++idx) {
            alphabet.chars[idx].copyFrom(fixedValues[idx]);
        }
        let stepSize;
        let distSq;
        const force = new math_vector/* Vector3 */.Pq();
        const scratch = new math_vector/* Vector3 */.Pq();
        const lerp = (l, r, t) => (1.0 - t) * l + t * r;
        for (let iteration = 0; iteration < iterations; ++iteration) {
            stepSize = lerp(startingStepSize, endingStepSize, iteration / (iterations - 1));
            for (let idx = fixedValues.length; idx < alphabet.chars.length; ++idx) {
                force.copyFromFloats(0, 0, 0);
                alphabet.chars.forEach((pt) => {
                    alphabet.chars[idx].subtractToRef(pt, scratch);
                    distSq = scratch.lengthSquared();
                    if (distSq > EPSILON_SQUARED) {
                        scratch.scaleAndAddToRef(1 / (scratch.lengthSquared() * distSq), force);
                    }
                });
                force.scaleInPlace(stepSize);
                alphabet.chars[idx].addInPlace(force);
                alphabet.chars[idx].normalize();
            }
        }
        return alphabet;
    }
    /**
     * Serialize to JSON.
     * @returns JSON serialization
     */
    serialize() {
        return JSON.stringify(this.chars);
    }
    /**
     * Deserialize from JSON.
     * @param json JSON serialization
     * @returns deserialized Vector3Alphabet
     */
    static Deserialize(json) {
        const jsonObject = JSON.parse(json);
        const alphabet = new Vector3Alphabet(jsonObject.length);
        for (let idx = 0; idx < jsonObject.length; ++idx) {
            alphabet.chars[idx] = new math_vector/* Vector3 */.Pq(jsonObject[idx]["_x"], jsonObject[idx]["_y"], jsonObject[idx]["_z"]);
        }
        return alphabet;
    }
    constructor(size) {
        this.chars = new Array(size);
    }
}
/**
 * Class which formalizes the manner in which a Vector3Alphabet is used to tokenize and
 * describe a Trajectory. This class houses the functionality which determines what
 * attributes of Trajectories are and are not considered important, such as scale.
 */
class TrajectoryDescriptor {
    /**
     * Serialize to JSON.
     * @returns JSON serialization
     */
    serialize() {
        return JSON.stringify(this._sequences.map((sequence) => sequence.serialize()));
    }
    /**
     * Deserialize from JSON string and Alphabet. This should be the same Alphabet
     * from which the descriptor was originally created, which must be serialized and
     * deserialized independently so that it can be passed in here.
     * @param json JSON serialization
     * @param alphabet Alphabet from which descriptor was originally created
     * @returns deserialized TrajectoryDescriptor
     */
    static Deserialize(json, alphabet) {
        const descriptor = new TrajectoryDescriptor();
        descriptor._sequences = JSON.parse(json).map((s) => Levenshtein.Sequence.Deserialize(s, alphabet));
        return descriptor;
    }
    /**
     * Create a new TrajectoryDescriptor to describe a provided Trajectory according
     * to the provided alphabets.
     * @param trajectory Trajectory to be described
     * @param vector3Alphabet Vector3Alphabet to be used to tokenize the Trajectory
     * @param levenshteinAlphabet Levenshtein.Alphabet to be used as basis for comparison with other descriptors
     * @returns TrajectoryDescriptor describing provided Trajectory
     */
    static CreateFromTrajectory(trajectory, vector3Alphabet, levenshteinAlphabet) {
        return TrajectoryDescriptor.CreateFromTokenizationPyramid(TrajectoryDescriptor._GetTokenizationPyramid(trajectory, vector3Alphabet), levenshteinAlphabet);
    }
    /**
     * Create a new TrajectoryDescriptor from a pre-existing pyramid of tokens.
     * NOTE: This function exists to support an outdated serialization mechanism and should
     * be deleted if it is no longer useful.
     * @param pyramid tokenization pyramid
     * @param levenshteinAlphabet Levenshtein.Alphabet to be uses as basis for comparison with other descriptors
     * @returns TrajectoryDescriptor describing the Trajectory from which the pyramid was built
     */
    static CreateFromTokenizationPyramid(pyramid, levenshteinAlphabet) {
        const descriptor = new TrajectoryDescriptor();
        descriptor._sequences = pyramid.map((tokens) => new Levenshtein.Sequence(tokens, levenshteinAlphabet));
        return descriptor;
    }
    constructor() {
        this._sequences = [];
    }
    /**
     * Create the tokenization pyramid for the provided Trajectory according to the given
     * Vector3Alphabet.
     * @param trajectory Trajectory to be tokenized
     * @param alphabet Vector3Alphabet containing tokens
     * @param targetResolution finest resolution of descriptor
     * @returns tokenization pyramid for Trajectory
     */
    static _GetTokenizationPyramid(trajectory, alphabet, targetResolution = TrajectoryDescriptor._FINEST_DESCRIPTOR_RESOLUTION) {
        const pyramid = [];
        for (let res = targetResolution; res > 4; res = Math.floor(res / 2)) {
            pyramid.push(trajectory.resampleAtTargetResolution(res).tokenize(alphabet.chars));
        }
        return pyramid;
    }
    /**
     * Calculate a distance metric between this TrajectoryDescriptor and another. This is
     * essentially a similarity score and does not directly represent Euclidean distance,
     * edit distance, or any other formal distance metric.
     * @param other TrajectoryDescriptor from which to determine distance
     * @returns distance, a nonnegative similarity score where larger values indicate dissimilarity
     */
    distance(other) {
        let totalDistance = 0;
        let weight;
        for (let idx = 0; idx < this._sequences.length; ++idx) {
            weight = Math.pow(2, idx);
            totalDistance += weight * this._sequences[idx].distance(other._sequences[idx]);
        }
        return totalDistance;
    }
}
TrajectoryDescriptor._FINEST_DESCRIPTOR_RESOLUTION = 32;
/**
 * A set of TrajectoryDescriptors defined to be "the same." This is essentially a helper
 * class to facilitate methods of Trajectory clustering.
 */
class TrajectoryClass {
    /**
     * Serialize to JSON.
     * @returns JSON serialization
     */
    serialize() {
        const jsonObject = {};
        jsonObject.descriptors = this._descriptors.map((desc) => desc.serialize());
        jsonObject.centroidIdx = this._centroidIdx;
        jsonObject.averageDistance = this._averageDistance;
        return JSON.stringify(jsonObject);
    }
    /**
     * Deserialize from JSON string and Alphabet. This should be the same Alphabet
     * from which the descriptors were originally created, which must be serialized and
     * deserialized independently so that it can be passed in here.
     * @param json JSON string representation
     * @param alphabet Alphabet from which TrajectoryDescriptors were originally created
     * @returns deserialized TrajectoryDescriptor
     */
    static Deserialize(json, alphabet) {
        const jsonObject = JSON.parse(json);
        const described = new TrajectoryClass();
        described._descriptors = jsonObject.descriptors.map((s) => TrajectoryDescriptor.Deserialize(s, alphabet));
        described._centroidIdx = jsonObject.centroidIdx;
        described._averageDistance = jsonObject.averageDistance;
        return described;
    }
    /**
     * Create a new DescribedTrajectory.
     * @param descriptors currently-known TrajectoryDescriptors, if any
     */
    constructor(descriptors = []) {
        this._descriptors = descriptors;
        this._centroidIdx = -1;
        this._averageDistance = 0;
        this._refreshDescription();
    }
    /**
     * Add a new TrajectoryDescriptor to the list of descriptors known to describe
     * this same DescribedTrajectory.
     * @param descriptor descriptor to be added
     */
    add(descriptor) {
        this._descriptors.push(descriptor);
        this._refreshDescription();
    }
    /**
     * Compute the cost, which is inversely related to the likelihood that the provided
     * TrajectoryDescriptor describes a Trajectory that is considered to be the same as
     * the class represented by this DescribedTrajectory.
     * @param descriptor the descriptor to be costed
     * @returns cost of the match, which is a nonnegative similarity metric where larger values indicate dissimilarity
     */
    getMatchCost(descriptor) {
        return descriptor.distance(this._descriptors[this._centroidIdx]) / this._averageDistance;
    }
    /**
     * Compute the minimum distance between the queried TrajectoryDescriptor and a
     * descriptor which is a member of this collection. This is an alternative way of
     * conceptualizing match cost from getMatchCost(), and it serves a different function.
     * @param descriptor the descriptor to find the minimum distance to
     * @returns minimum descriptor distance to a member descriptor of this DescribedTrajectory
     */
    getMatchMinimumDistance(descriptor) {
        return Math.min(...this._descriptors.map((desc) => desc.distance(descriptor)));
    }
    /**
     * Refreshes the internal representation of this DescribedTrajectory.
     */
    _refreshDescription() {
        this._centroidIdx = -1;
        let sum;
        const distances = this._descriptors.map((a) => {
            sum = 0;
            this._descriptors.forEach((b) => {
                sum += a.distance(b);
            });
            return sum;
        });
        for (let idx = 0; idx < distances.length; ++idx) {
            if (this._centroidIdx < 0 || distances[idx] < distances[this._centroidIdx]) {
                this._centroidIdx = idx;
            }
        }
        this._averageDistance = 0;
        this._descriptors.forEach((desc) => {
            this._averageDistance += desc.distance(this._descriptors[this._centroidIdx]);
        });
        if (this._descriptors.length > 0) {
            this._averageDistance = Math.max(this._averageDistance / this._descriptors.length, TrajectoryClass._MIN_AVERAGE_DISTANCE);
        }
    }
}
TrajectoryClass._MIN_AVERAGE_DISTANCE = 1;
/**
 * Class representing a set of known, named trajectories to which Trajectories can be
 * added and using which Trajectories can be recognized.
 */
class TrajectoryClassifier {
    /**
     * Serialize to JSON.
     * @returns JSON serialization
     */
    serialize() {
        const jsonObject = {};
        jsonObject.maximumAllowableMatchCost = this._maximumAllowableMatchCost;
        jsonObject.vector3Alphabet = this._vector3Alphabet.serialize();
        jsonObject.levenshteinAlphabet = this._levenshteinAlphabet.serialize();
        jsonObject.nameToDescribedTrajectory = [];
        this._nameToDescribedTrajectory.forEach((described, name) => {
            jsonObject.nameToDescribedTrajectory.push(name);
            jsonObject.nameToDescribedTrajectory.push(described.serialize());
        });
        return JSON.stringify(jsonObject);
    }
    /**
     * Deserialize from JSON.
     * @param json JSON serialization
     * @returns deserialized TrajectorySet
     */
    static Deserialize(json) {
        const jsonObject = JSON.parse(json);
        const classifier = new TrajectoryClassifier();
        classifier._maximumAllowableMatchCost = jsonObject.maximumAllowableMatchCost;
        classifier._vector3Alphabet = Vector3Alphabet.Deserialize(jsonObject.vector3Alphabet);
        classifier._levenshteinAlphabet = Levenshtein.Alphabet.Deserialize(jsonObject.levenshteinAlphabet);
        for (let idx = 0; idx < jsonObject.nameToDescribedTrajectory.length; idx += 2) {
            classifier._nameToDescribedTrajectory.set(jsonObject.nameToDescribedTrajectory[idx], TrajectoryClass.Deserialize(jsonObject.nameToDescribedTrajectory[idx + 1], classifier._levenshteinAlphabet));
        }
        return classifier;
    }
    /**
     * Initialize a new empty TrajectorySet with auto-generated Alphabets.
     * VERY naive, need to be generating these things from known
     * sets. Better version later, probably eliminating this one.
     * @returns auto-generated TrajectorySet
     */
    static Generate() {
        const vecs = Vector3Alphabet.Generate(64, 256, 0.1, 0.001, [math_vector/* Vector3 */.Pq.Forward()]);
        const charIdxs = new Array(vecs.chars.length);
        for (let idx = 0; idx < charIdxs.length; ++idx) {
            charIdxs[idx] = idx;
        }
        const alphabet = new Levenshtein.Alphabet(charIdxs, (idx) => (idx === 0 ? 0 : 1), (idx) => (idx === 0 ? 0 : 1), (a, b) => Math.min(1 - math_vector/* Vector3 */.Pq.Dot(vecs.chars[a], vecs.chars[b]), 1));
        const trajectorySet = new TrajectoryClassifier();
        trajectorySet._vector3Alphabet = vecs;
        trajectorySet._levenshteinAlphabet = alphabet;
        return trajectorySet;
    }
    constructor() {
        this._maximumAllowableMatchCost = 4;
        this._nameToDescribedTrajectory = new Map();
    }
    /**
     * Add a new Trajectory to the set with a given name.
     * @param trajectory new Trajectory to be added
     * @param classification name to which to add the Trajectory
     */
    addTrajectoryToClassification(trajectory, classification) {
        if (!this._nameToDescribedTrajectory.has(classification)) {
            this._nameToDescribedTrajectory.set(classification, new TrajectoryClass());
        }
        this._nameToDescribedTrajectory.get(classification).add(TrajectoryDescriptor.CreateFromTrajectory(trajectory, this._vector3Alphabet, this._levenshteinAlphabet));
    }
    /**
     * Remove a known named trajectory and all Trajectories associated with it.
     * @param classification name to remove
     * @returns whether anything was removed
     */
    deleteClassification(classification) {
        return this._nameToDescribedTrajectory.delete(classification);
    }
    /**
     * Attempt to recognize a Trajectory from among all the classifications
     * already known to the classifier.
     * @param trajectory Trajectory to be recognized
     * @returns classification of Trajectory if recognized, null otherwise
     */
    classifyTrajectory(trajectory) {
        const descriptor = TrajectoryDescriptor.CreateFromTrajectory(trajectory, this._vector3Alphabet, this._levenshteinAlphabet);
        const allowableMatches = [];
        this._nameToDescribedTrajectory.forEach((trajectoryClass, classification) => {
            if (trajectoryClass.getMatchCost(descriptor) < this._maximumAllowableMatchCost) {
                allowableMatches.push(classification);
            }
        });
        if (allowableMatches.length === 0) {
            return null;
        }
        let bestIdx = 0;
        let bestMatch = this._nameToDescribedTrajectory.get(allowableMatches[bestIdx]).getMatchMinimumDistance(descriptor);
        let match;
        for (let idx = 0; idx < allowableMatches.length; ++idx) {
            match = this._nameToDescribedTrajectory.get(allowableMatches[idx]).getMatchMinimumDistance(descriptor);
            if (match < bestMatch) {
                bestMatch = match;
                bestIdx = idx;
            }
        }
        return allowableMatches[bestIdx];
    }
}
//# sourceMappingURL=trajectoryClassifier.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/copyTools.js
var copyTools = __webpack_require__(95625);
;// ./node_modules/@babylonjs/core/Misc/reflector.js


/**
 * Class used to connect with the reflector zone of the sandbox via the reflector bridge
 * @since 5.0.0
 */
class Reflector {
    /**
     * Constructs a reflector object.
     * @param scene The scene to use
     * @param hostname The hostname of the reflector bridge
     * @param port The port of the reflector bridge
     */
    constructor(scene, hostname, port) {
        this._scene = scene;
        logger/* Logger */.V.Log(`[Reflector] Connecting to ws://${hostname}:${port}`);
        this._webSocket = new WebSocket(`ws://${hostname}:${port}`);
        this._webSocket.onmessage = (event) => {
            const message = event.data;
            if (message.startsWith(Reflector._SERVER_PREFIX)) {
                const serverMessage = message.substring(Reflector._SERVER_PREFIX.length);
                logger/* Logger */.V.Log(`[Reflector] Received server message: ${serverMessage.substring(0, 64)}`);
                this._handleServerMessage(serverMessage);
                return;
            }
            else {
                logger/* Logger */.V.Log(`[Reflector] Received client message: ${message.substring(0, 64)}`);
                this._handleClientMessage();
            }
        };
        this._webSocket.onclose = (event) => {
            logger/* Logger */.V.Log(`[Reflector] Disconnected ${event.code} ${event.reason}`);
        };
    }
    /**
     * Closes the reflector connection
     */
    close() {
        this._webSocket.close();
    }
    _handleServerMessage(message) {
        switch (message) {
            case "connected": {
                SceneSerializer.SerializeAsync(this._scene).then((serialized) => {
                    this._webSocket.send(`load|${JSON.stringify(serialized)}`);
                });
                break;
            }
        }
    }
    _handleClientMessage() {
        // do nothing
    }
}
Reflector._SERVER_PREFIX = "$$";
//# sourceMappingURL=reflector.js.map
;// ./node_modules/@babylonjs/core/Misc/pressureObserverWrapper.js

/**
 * A wrapper for the experimental pressure api which allows a callback to be called whenever certain thresholds are met.
 */
class PressureObserverWrapper {
    /**
     * A pressure observer will call this callback, whenever these thresholds are met.
     * @param options An object containing the thresholds used to decide what value to to return for each update property (average of start and end of a threshold boundary).
     */
    constructor(options) {
        this._observer = null;
        this._currentState = [];
        /**
         * An event triggered when the cpu usage/speed meets certain thresholds.
         * Note: pressure is an experimental API.
         */
        this.onPressureChanged = new Misc_observable/* Observable */.cP();
        if (PressureObserverWrapper.IsAvailable) {
            this._observer = new PressureObserver((update) => {
                this._currentState = update;
                this.onPressureChanged.notifyObservers(update);
            }, options);
        }
    }
    /**
     * Returns true if PressureObserver is available for use, false otherwise.
     */
    static get IsAvailable() {
        return typeof PressureObserver !== "undefined" && PressureObserver.knownSources && PressureObserver.knownSources.includes("cpu");
    }
    /**
     * Method that must be called to begin observing changes, and triggering callbacks.
     * @param source defines the source to observe
     */
    observe(source) {
        try {
            this._observer?.observe(source);
            this.onPressureChanged.notifyObservers(this._currentState);
        }
        catch {
            // Ignore error
        }
    }
    /**
     * Method that must be called to stop observing changes and triggering callbacks (cleanup function).
     * @param source defines the source to unobserve
     */
    unobserve(source) {
        try {
            this._observer?.unobserve(source);
        }
        catch {
            // Ignore error
        }
    }
    /**
     * Release the associated resources.
     */
    dispose() {
        this._observer?.disconnect();
        this._observer = null;
        this.onPressureChanged.clear();
    }
}
//# sourceMappingURL=pressureObserverWrapper.js.map
;// ./node_modules/@babylonjs/core/Misc/PerformanceViewer/dynamicFloat32Array.js
const growthFactor = 1.5;
/**
 * A class acting as a dynamic float32array used in the performance viewer
 */
class DynamicFloat32Array {
    /**
     * Creates a new DynamicFloat32Array with the desired item capacity.
     * @param itemCapacity The initial item capacity you would like to set for the array.
     */
    constructor(itemCapacity) {
        this._view = new Float32Array(itemCapacity);
        this._itemLength = 0;
    }
    /**
     * The number of items currently in the array.
     */
    get itemLength() {
        return this._itemLength;
    }
    /**
     * Gets value at index, NaN if no such index exists.
     * @param index the index to get the value at.
     * @returns the value at the index provided.
     */
    at(index) {
        if (index < 0 || index >= this._itemLength) {
            return NaN;
        }
        return this._view[index];
    }
    /**
     * Gets a view of the original array from start to end (exclusive of end).
     * @param start starting index.
     * @param end ending index.
     * @returns a subarray of the original array.
     */
    subarray(start, end) {
        if (start >= end || start < 0) {
            return new Float32Array(0);
        }
        if (end > this._itemLength) {
            end = this._itemLength;
        }
        return this._view.subarray(start, end);
    }
    /**
     * Pushes items to the end of the array.
     * @param item The item to push into the array.
     */
    push(item) {
        this._view[this._itemLength] = item;
        this._itemLength++;
        if (this._itemLength >= this._view.length) {
            this._growArray();
        }
    }
    /**
     * Grows the array by the growth factor when necessary.
     */
    _growArray() {
        const newCapacity = Math.floor(this._view.length * growthFactor);
        const view = new Float32Array(newCapacity);
        view.set(this._view);
        this._view = view;
    }
}
//# sourceMappingURL=dynamicFloat32Array.js.map
;// ./node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollector.js




// the initial size of our array, should be a multiple of two!
const InitialArraySize = 1800;
// three octets in a hexcode. #[AA][BB][CC], i.e. 24 bits of data.
const NumberOfBitsInHexcode = 24;
// Allows single numeral hex numbers to be appended by a 0.
const HexPadding = "0";
// header for the timestamp column
const TimestampColHeader = "timestamp";
// header for the numPoints column
const NumPointsColHeader = "numPoints";
// regex to capture all carriage returns in the string.
const CarriageReturnRegex = /\r/g;
// string to use as separator when exporting extra information along with the dataset id
const ExportedDataSeparator = "@";
/**
 * The collector class handles the collection and storage of data into the appropriate array.
 * The collector also handles notifying any observers of any updates.
 */
class PerformanceViewerCollector {
    /**
     * The offset for when actual data values start appearing inside a slice.
     */
    static get SliceDataOffset() {
        return 2;
    }
    /**
     * The offset for the value of the number of points inside a slice.
     */
    static get NumberOfPointsOffset() {
        return 1;
    }
    /**
     * Handles the creation of a performance viewer collector.
     * @param _scene the scene to collect on.
     * @param _enabledStrategyCallbacks the list of data to collect with callbacks for initialization purposes.
     */
    constructor(_scene, _enabledStrategyCallbacks) {
        this._scene = _scene;
        /**
         * Collects data for every dataset by using the appropriate strategy. This is called every frame.
         * This method will then notify all observers with the latest slice.
         */
        this._collectDataAtFrame = () => {
            const timestamp = precisionDate/* PrecisionDate */.j.Now - this._startingTimestamp;
            const numPoints = this.datasets.ids.length;
            // add the starting index for the slice
            const numberOfIndices = this.datasets.startingIndices.itemLength;
            let startingIndex = 0;
            if (numberOfIndices > 0) {
                const previousStartingIndex = this.datasets.startingIndices.at(numberOfIndices - 1);
                startingIndex =
                    previousStartingIndex + this.datasets.data.at(previousStartingIndex + PerformanceViewerCollector.NumberOfPointsOffset) + PerformanceViewerCollector.SliceDataOffset;
            }
            this.datasets.startingIndices.push(startingIndex);
            // add the first 2 items in our slice.
            this.datasets.data.push(timestamp);
            this.datasets.data.push(numPoints);
            // add the values inside the slice.
            this.datasets.ids.forEach((id) => {
                const strategy = this._strategies.get(id);
                if (!strategy) {
                    return;
                }
                this.datasets.data.push(strategy.getData());
            });
            if (this.datasetObservable.hasObservers()) {
                const slice = [timestamp, numPoints];
                for (let i = 0; i < numPoints; i++) {
                    slice.push(this.datasets.data.at(startingIndex + PerformanceViewerCollector.SliceDataOffset + i));
                }
                this.datasetObservable.notifyObservers(slice);
            }
        };
        this.datasets = {
            ids: [],
            data: new DynamicFloat32Array(InitialArraySize),
            startingIndices: new DynamicFloat32Array(InitialArraySize),
        };
        this._strategies = new Map();
        this._datasetMeta = new Map();
        this._eventRestoreSet = new Set();
        this._customEventObservable = new Misc_observable/* Observable */.cP();
        this.datasetObservable = new Misc_observable/* Observable */.cP();
        this.metadataObservable = new Misc_observable/* Observable */.cP((observer) => observer.callback(this._datasetMeta, new Misc_observable/* EventState */.qO(0)));
        if (_enabledStrategyCallbacks) {
            this.addCollectionStrategies(..._enabledStrategyCallbacks);
        }
    }
    /**
     * Registers a custom string event which will be callable via sendEvent. This method returns an event object which will contain the id of the event.
     * The user can set a value optionally, which will be used in the sendEvent method. If the value is set, we will record this value at the end of each frame,
     * if not we will increment our counter and record the value of the counter at the end of each frame. The value recorded is 0 if no sendEvent method is called, within a frame.
     * @param name The name of the event to register
     * @param forceUpdate if the code should force add an event, and replace the last one.
     * @param category the category for that event
     * @returns The event registered, used in sendEvent
     */
    registerEvent(name, forceUpdate, category) {
        if (this._strategies.has(name) && !forceUpdate) {
            return;
        }
        if (this._strategies.has(name) && forceUpdate) {
            this._strategies.get(name)?.dispose();
            this._strategies.delete(name);
        }
        const strategy = (scene) => {
            let counter = 0;
            let value = 0;
            const afterRenderObserver = scene.onAfterRenderObservable.add(() => {
                value = counter;
                counter = 0;
            });
            const stringObserver = this._customEventObservable.add((eventVal) => {
                if (name !== eventVal.name) {
                    return;
                }
                if (eventVal.value !== undefined) {
                    counter = eventVal.value;
                }
                else {
                    counter++;
                }
            });
            return {
                id: name,
                getData: () => value,
                dispose: () => {
                    scene.onAfterRenderObservable.remove(afterRenderObserver);
                    this._customEventObservable.remove(stringObserver);
                },
            };
        };
        const event = {
            name,
        };
        this._eventRestoreSet.add(name);
        this.addCollectionStrategies({ strategyCallback: strategy, category });
        return event;
    }
    /**
     * Lets the perf collector handle an event, occurences or event value depending on if the event.value params is set.
     * @param event the event to handle an occurence for
     */
    sendEvent(event) {
        this._customEventObservable.notifyObservers(event);
    }
    /**
     * This event restores all custom string events if necessary.
     */
    _restoreStringEvents() {
        if (this._eventRestoreSet.size !== this._customEventObservable.observers.length) {
            this._eventRestoreSet.forEach((event) => {
                this.registerEvent(event, true);
            });
        }
    }
    /**
     * This method adds additional collection strategies for data collection purposes.
     * @param strategyCallbacks the list of data to collect with callbacks.
     */
    addCollectionStrategies(...strategyCallbacks) {
        // eslint-disable-next-line prefer-const
        for (let { strategyCallback, category, hidden } of strategyCallbacks) {
            const strategy = strategyCallback(this._scene);
            if (this._strategies.has(strategy.id)) {
                strategy.dispose();
                continue;
            }
            this.datasets.ids.push(strategy.id);
            if (category) {
                category = category.replace(new RegExp(ExportedDataSeparator, "g"), "");
            }
            this._datasetMeta.set(strategy.id, {
                color: this._getHexColorFromId(strategy.id),
                category,
                hidden,
            });
            this._strategies.set(strategy.id, strategy);
        }
        this.metadataObservable.notifyObservers(this._datasetMeta);
    }
    /**
     * Gets a 6 character hexcode representing the colour from a passed in string.
     * @param id the string to get a hex code for.
     * @returns a hexcode hashed from the id.
     */
    _getHexColorFromId(id) {
        // this first bit is just a known way of hashing a string.
        let hash = 0;
        for (let i = 0; i < id.length; i++) {
            // (hash << 5) - hash is the same as hash * 31
            hash = id.charCodeAt(i) + ((hash << 5) - hash);
        }
        // then we build the string octet by octet.
        let hex = "#";
        for (let i = 0; i < NumberOfBitsInHexcode; i += 8) {
            const octet = (hash >> i) & 0xff;
            const toStr = HexPadding + octet.toString(16);
            hex += toStr.substring(toStr.length - 2);
        }
        return hex;
    }
    /**
     * Collects and then sends the latest slice to any observers by using the appropriate strategy when the user wants.
     * The slice will be of the form [timestamp, numberOfPoints, value1, value2...]
     * This method does not add onto the collected data accessible via the datasets variable.
     */
    getCurrentSlice() {
        const timestamp = precisionDate/* PrecisionDate */.j.Now - this._startingTimestamp;
        const numPoints = this.datasets.ids.length;
        const slice = [timestamp, numPoints];
        // add the values inside the slice.
        this.datasets.ids.forEach((id) => {
            const strategy = this._strategies.get(id);
            if (!strategy) {
                return;
            }
            if (this.datasetObservable.hasObservers()) {
                slice.push(strategy.getData());
            }
        });
        if (this.datasetObservable.hasObservers()) {
            this.datasetObservable.notifyObservers(slice);
        }
    }
    /**
     * Updates a property for a dataset's metadata with the value provided.
     * @param id the id of the dataset which needs its metadata updated.
     * @param prop the property to update.
     * @param value the value to update the property with.
     */
    updateMetadata(id, prop, value) {
        const meta = this._datasetMeta.get(id);
        if (!meta) {
            return;
        }
        meta[prop] = value;
        this.metadataObservable.notifyObservers(this._datasetMeta);
    }
    /**
     * Completely clear, data, ids, and strategies saved to this performance collector.
     * @param preserveStringEventsRestore if it should preserve the string events, by default will clear string events registered when called.
     */
    clear(preserveStringEventsRestore) {
        this.datasets.data = new DynamicFloat32Array(InitialArraySize);
        this.datasets.ids.length = 0;
        this.datasets.startingIndices = new DynamicFloat32Array(InitialArraySize);
        this._datasetMeta.clear();
        this._strategies.forEach((strategy) => strategy.dispose());
        this._strategies.clear();
        if (!preserveStringEventsRestore) {
            this._eventRestoreSet.clear();
        }
        this._hasLoadedData = false;
    }
    /**
     * Accessor which lets the caller know if the performance collector has data loaded from a file or not!
     * Call clear() to reset this value.
     * @returns true if the data is loaded from a file, false otherwise.
     */
    get hasLoadedData() {
        return this._hasLoadedData;
    }
    /**
     * Given a string containing file data, this function parses the file data into the datasets object.
     * It returns a boolean to indicate if this object was successfully loaded with the data.
     * @param data string content representing the file data.
     * @param keepDatasetMeta if it should use reuse the existing dataset metadata
     * @returns true if the data was successfully loaded, false otherwise.
     */
    loadFromFileData(data, keepDatasetMeta) {
        const lines = data
            .replace(CarriageReturnRegex, "")
            .split("\n")
            .map((line) => line.split(",").filter((s) => s.length > 0))
            .filter((line) => line.length > 0);
        const timestampIndex = 0;
        const numPointsIndex = PerformanceViewerCollector.NumberOfPointsOffset;
        if (lines.length < 2) {
            return false;
        }
        const parsedDatasets = {
            ids: [],
            data: new DynamicFloat32Array(InitialArraySize),
            startingIndices: new DynamicFloat32Array(InitialArraySize),
        };
        // parse first line separately to populate ids!
        const [firstLine, ...dataLines] = lines;
        // make sure we have the correct beginning headers
        if (firstLine.length < 2 || firstLine[timestampIndex] !== TimestampColHeader || firstLine[numPointsIndex] !== NumPointsColHeader) {
            return false;
        }
        const idCategoryMap = new Map();
        // populate the ids.
        for (let i = PerformanceViewerCollector.SliceDataOffset; i < firstLine.length; i++) {
            const [id, category] = firstLine[i].split(ExportedDataSeparator);
            parsedDatasets.ids.push(id);
            idCategoryMap.set(id, category);
        }
        let startingIndex = 0;
        for (const line of dataLines) {
            if (line.length < 2) {
                return false;
            }
            const timestamp = parseFloat(line[timestampIndex]);
            const numPoints = parseInt(line[numPointsIndex]);
            if (isNaN(numPoints) || isNaN(timestamp)) {
                return false;
            }
            parsedDatasets.data.push(timestamp);
            parsedDatasets.data.push(numPoints);
            if (numPoints + PerformanceViewerCollector.SliceDataOffset !== line.length) {
                return false;
            }
            for (let i = PerformanceViewerCollector.SliceDataOffset; i < line.length; i++) {
                const val = parseFloat(line[i]);
                if (isNaN(val)) {
                    return false;
                }
                parsedDatasets.data.push(val);
            }
            parsedDatasets.startingIndices.push(startingIndex);
            startingIndex += line.length;
        }
        this.datasets.ids = parsedDatasets.ids;
        this.datasets.data = parsedDatasets.data;
        this.datasets.startingIndices = parsedDatasets.startingIndices;
        if (!keepDatasetMeta) {
            this._datasetMeta.clear();
        }
        this._strategies.forEach((strategy) => strategy.dispose());
        this._strategies.clear();
        // populate metadata.
        if (!keepDatasetMeta) {
            for (const id of this.datasets.ids) {
                const category = idCategoryMap.get(id);
                this._datasetMeta.set(id, { category, color: this._getHexColorFromId(id) });
            }
        }
        this.metadataObservable.notifyObservers(this._datasetMeta);
        this._hasLoadedData = true;
        return true;
    }
    /**
     * Exports the datasets inside of the collector to a csv.
     */
    exportDataToCsv() {
        let csvContent = "";
        // create the header line.
        csvContent += `${TimestampColHeader},${NumPointsColHeader}`;
        for (let i = 0; i < this.datasets.ids.length; i++) {
            csvContent += `,${this.datasets.ids[i]}`;
            if (this._datasetMeta) {
                const meta = this._datasetMeta.get(this.datasets.ids[i]);
                if (meta?.category) {
                    csvContent += `${ExportedDataSeparator}${meta.category}`;
                }
            }
        }
        csvContent += "\n";
        // create the data lines
        for (let i = 0; i < this.datasets.startingIndices.itemLength; i++) {
            const startingIndex = this.datasets.startingIndices.at(i);
            const timestamp = this.datasets.data.at(startingIndex);
            const numPoints = this.datasets.data.at(startingIndex + PerformanceViewerCollector.NumberOfPointsOffset);
            csvContent += `${timestamp},${numPoints}`;
            for (let offset = 0; offset < numPoints; offset++) {
                csvContent += `,${this.datasets.data.at(startingIndex + PerformanceViewerCollector.SliceDataOffset + offset)}`;
            }
            // add extra commas.
            for (let diff = 0; diff < this.datasets.ids.length - numPoints; diff++) {
                csvContent += ",";
            }
            csvContent += "\n";
        }
        const fileName = `${new Date().toISOString()}-perfdata.csv`;
        tools/* Tools */.S0.Download(new Blob([csvContent], { type: "text/csv" }), fileName);
    }
    /**
     * Starts the realtime collection of data.
     * @param shouldPreserve optional boolean param, if set will preserve the dataset between calls of start.
     */
    start(shouldPreserve) {
        if (!shouldPreserve) {
            this.datasets.data = new DynamicFloat32Array(InitialArraySize);
            this.datasets.startingIndices = new DynamicFloat32Array(InitialArraySize);
            this._startingTimestamp = precisionDate/* PrecisionDate */.j.Now;
        }
        else if (this._startingTimestamp === undefined) {
            this._startingTimestamp = precisionDate/* PrecisionDate */.j.Now;
        }
        this._scene.onAfterRenderObservable.add(this._collectDataAtFrame);
        this._restoreStringEvents();
        this._isStarted = true;
    }
    /**
     * Stops the collection of data.
     */
    stop() {
        this._scene.onAfterRenderObservable.removeCallback(this._collectDataAtFrame);
        this._isStarted = false;
    }
    /**
     * Returns if the perf collector has been started or not.
     */
    get isStarted() {
        return this._isStarted;
    }
    /**
     * Disposes of the object
     */
    dispose() {
        this._scene.onAfterRenderObservable.removeCallback(this._collectDataAtFrame);
        this._datasetMeta.clear();
        this._strategies.forEach((strategy) => {
            strategy.dispose();
        });
        this.datasetObservable.clear();
        this.metadataObservable.clear();
        this._isStarted = false;
        this.datasets = null;
    }
}
//# sourceMappingURL=performanceViewerCollector.js.map
;// ./node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js




// Dispose which does nothing.
const defaultDisposeImpl = () => { };
/**
 * Defines the predefined strategies used in the performance viewer.
 */
class PerfCollectionStrategy {
    /**
     * Gets the initializer for the strategy used for collection of fps metrics
     * @returns the initializer for the fps strategy
     */
    static FpsStrategy() {
        return (scene) => {
            const engine = scene.getEngine();
            return {
                id: "FPS",
                getData: () => engine.getFps(),
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of thermal utilization metrics.
     * Needs the experimental pressure API.
     * @returns the initializer for the thermal utilization strategy
     */
    static ThermalStrategy() {
        return this._PressureStrategy("Thermal utilization", "thermal");
    }
    /**
     * Gets the initializer for the strategy used for collection of power supply utilization metrics.
     * Needs the experimental pressure API.
     * @returns the initializer for the power supply utilization strategy
     */
    static PowerSupplyStrategy() {
        return this._PressureStrategy("Power supply utilization", "power-supply");
    }
    /**
     * Gets the initializer for the strategy used for collection of pressure metrics.
     * Needs the experimental pressure API.
     * @returns the initializer for the pressure strategy
     */
    static PressureStrategy() {
        return this._PressureStrategy("Pressure");
    }
    static _PressureStrategy(name, factor = null) {
        return () => {
            let value = 0;
            const wrapper = new PressureObserverWrapper();
            wrapper.observe("cpu");
            wrapper.onPressureChanged.add((update) => {
                for (const record of update) {
                    if ((factor && record.factors.includes(factor)) || (!factor && (record.factors?.length ?? 0) === 0)) {
                        // Let s consider each step being 25% of the total pressure.
                        switch (record.state) {
                            case "nominal":
                                value = 0;
                                break;
                            case "fair":
                                value = 0.25;
                                break;
                            case "serious":
                                value = 0.5;
                                break;
                            case "critical":
                                value = 1;
                                break;
                        }
                    }
                }
            });
            return {
                id: name,
                getData: () => value,
                dispose: () => wrapper.dispose(),
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of total meshes metrics.
     * @returns the initializer for the total meshes strategy
     */
    static TotalMeshesStrategy() {
        return (scene) => {
            return {
                id: "Total meshes",
                getData: () => scene.meshes.length,
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of active meshes metrics.
     * @returns the initializer for the active meshes strategy
     */
    static ActiveMeshesStrategy() {
        return (scene) => {
            return {
                id: "Active meshes",
                getData: () => scene.getActiveMeshes().length,
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of active indices metrics.
     * @returns the initializer for the active indices strategy
     */
    static ActiveIndicesStrategy() {
        return (scene) => {
            return {
                id: "Active indices",
                getData: () => scene.getActiveIndices(),
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of active faces metrics.
     * @returns the initializer for the active faces strategy
     */
    static ActiveFacesStrategy() {
        return (scene) => {
            return {
                id: "Active faces",
                getData: () => scene.getActiveIndices() / 3,
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of active bones metrics.
     * @returns the initializer for the active bones strategy
     */
    static ActiveBonesStrategy() {
        return (scene) => {
            return {
                id: "Active bones",
                getData: () => scene.getActiveBones(),
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of active particles metrics.
     * @returns the initializer for the active particles strategy
     */
    static ActiveParticlesStrategy() {
        return (scene) => {
            return {
                id: "Active particles",
                getData: () => scene.getActiveParticles(),
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of draw calls metrics.
     * @returns the initializer for the draw calls strategy
     */
    static DrawCallsStrategy() {
        return (scene) => {
            let drawCalls = 0;
            const onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {
                scene.getEngine()._drawCalls.fetchNewFrame();
            });
            const onAfterRenderObserver = scene.onAfterRenderObservable.add(() => {
                drawCalls = scene.getEngine()._drawCalls.current;
            });
            return {
                id: "Draw calls",
                getData: () => drawCalls,
                dispose: () => {
                    scene.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver);
                    scene.onAfterRenderObservable.remove(onAfterRenderObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of total lights metrics.
     * @returns the initializer for the total lights strategy
     */
    static TotalLightsStrategy() {
        return (scene) => {
            return {
                id: "Total lights",
                getData: () => scene.lights.length,
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of total vertices metrics.
     * @returns the initializer for the total vertices strategy
     */
    static TotalVerticesStrategy() {
        return (scene) => {
            return {
                id: "Total vertices",
                getData: () => scene.getTotalVertices(),
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of total materials metrics.
     * @returns the initializer for the total materials strategy
     */
    static TotalMaterialsStrategy() {
        return (scene) => {
            return {
                id: "Total materials",
                getData: () => scene.materials.length,
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of total textures metrics.
     * @returns the initializer for the total textures strategy
     */
    static TotalTexturesStrategy() {
        return (scene) => {
            return {
                id: "Total textures",
                getData: () => scene.textures.length,
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of absolute fps metrics.
     * @returns the initializer for the absolute fps strategy
     */
    static AbsoluteFpsStrategy() {
        return (scene) => {
            const sceneInstrumentation = new SceneInstrumentation(scene);
            sceneInstrumentation.captureFrameTime = true;
            return {
                id: "Absolute FPS",
                getData: () => {
                    return 1000.0 / sceneInstrumentation.frameTimeCounter.lastSecAverage;
                },
                dispose: defaultDisposeImpl,
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of meshes selection time metrics.
     * @returns the initializer for the meshes selection time strategy
     */
    static MeshesSelectionStrategy() {
        return (scene) => {
            let startTime = precisionDate/* PrecisionDate */.j.Now;
            let timeTaken = 0;
            const onBeforeActiveMeshesObserver = scene.onBeforeActiveMeshesEvaluationObservable.add(() => {
                startTime = precisionDate/* PrecisionDate */.j.Now;
            });
            const onAfterActiveMeshesObserver = scene.onAfterActiveMeshesEvaluationObservable.add(() => {
                timeTaken = precisionDate/* PrecisionDate */.j.Now - startTime;
            });
            return {
                id: "Meshes Selection",
                getData: () => timeTaken,
                dispose: () => {
                    scene.onBeforeActiveMeshesEvaluationObservable.remove(onBeforeActiveMeshesObserver);
                    scene.onAfterActiveMeshesEvaluationObservable.remove(onAfterActiveMeshesObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of render targets time metrics.
     * @returns the initializer for the render targets time strategy
     */
    static RenderTargetsStrategy() {
        return (scene) => {
            let startTime = precisionDate/* PrecisionDate */.j.Now;
            let timeTaken = 0;
            const onBeforeRenderTargetsObserver = scene.onBeforeRenderTargetsRenderObservable.add(() => {
                startTime = precisionDate/* PrecisionDate */.j.Now;
            });
            const onAfterRenderTargetsObserver = scene.onAfterRenderTargetsRenderObservable.add(() => {
                timeTaken = precisionDate/* PrecisionDate */.j.Now - startTime;
            });
            return {
                id: "Render Targets",
                getData: () => timeTaken,
                dispose: () => {
                    scene.onBeforeRenderTargetsRenderObservable.remove(onBeforeRenderTargetsObserver);
                    scene.onAfterRenderTargetsRenderObservable.remove(onAfterRenderTargetsObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of particles time metrics.
     * @returns the initializer for the particles time strategy
     */
    static ParticlesStrategy() {
        return (scene) => {
            let startTime = precisionDate/* PrecisionDate */.j.Now;
            let timeTaken = 0;
            const onBeforeParticlesObserver = scene.onBeforeParticlesRenderingObservable.add(() => {
                startTime = precisionDate/* PrecisionDate */.j.Now;
            });
            const onAfterParticlesObserver = scene.onAfterParticlesRenderingObservable.add(() => {
                timeTaken = precisionDate/* PrecisionDate */.j.Now - startTime;
            });
            return {
                id: "Particles",
                getData: () => timeTaken,
                dispose: () => {
                    scene.onBeforeParticlesRenderingObservable.remove(onBeforeParticlesObserver);
                    scene.onAfterParticlesRenderingObservable.remove(onAfterParticlesObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of sprites time metrics.
     * @returns the initializer for the sprites time strategy
     */
    static SpritesStrategy() {
        return (scene) => {
            let startTime = precisionDate/* PrecisionDate */.j.Now;
            let timeTaken = 0;
            const onBeforeSpritesObserver = scene.onBeforeSpritesRenderingObservable?.add(() => {
                startTime = precisionDate/* PrecisionDate */.j.Now;
            });
            const onAfterSpritesObserver = scene.onAfterSpritesRenderingObservable?.add(() => {
                timeTaken = precisionDate/* PrecisionDate */.j.Now - startTime;
            });
            return {
                id: "Sprites",
                getData: () => timeTaken,
                dispose: () => {
                    scene.onBeforeSpritesRenderingObservable?.remove(onBeforeSpritesObserver);
                    scene.onAfterSpritesRenderingObservable?.remove(onAfterSpritesObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of animations time metrics.
     * @returns the initializer for the animations time strategy
     */
    static AnimationsStrategy() {
        return (scene) => {
            let startTime = precisionDate/* PrecisionDate */.j.Now;
            let timeTaken = 0;
            const onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {
                startTime = precisionDate/* PrecisionDate */.j.Now;
            });
            const onAfterAnimationsObserver = scene.onAfterAnimationsObservable.add(() => {
                timeTaken = precisionDate/* PrecisionDate */.j.Now - startTime;
            });
            return {
                id: "Animations",
                getData: () => timeTaken,
                dispose: () => {
                    scene.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver);
                    scene.onAfterAnimationsObservable.remove(onAfterAnimationsObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of physics time metrics.
     * @returns the initializer for the physics time strategy
     */
    static PhysicsStrategy() {
        return (scene) => {
            let startTime = precisionDate/* PrecisionDate */.j.Now;
            let timeTaken = 0;
            const onBeforePhysicsObserver = scene.onBeforePhysicsObservable?.add(() => {
                startTime = precisionDate/* PrecisionDate */.j.Now;
            });
            const onAfterPhysicsObserver = scene.onAfterPhysicsObservable?.add(() => {
                timeTaken = precisionDate/* PrecisionDate */.j.Now - startTime;
            });
            return {
                id: "Physics",
                getData: () => timeTaken,
                dispose: () => {
                    scene.onBeforePhysicsObservable?.remove(onBeforePhysicsObserver);
                    scene.onAfterPhysicsObservable?.remove(onAfterPhysicsObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of render time metrics.
     * @returns the initializer for the render time strategy
     */
    static RenderStrategy() {
        return (scene) => {
            let startTime = precisionDate/* PrecisionDate */.j.Now;
            let timeTaken = 0;
            const onBeforeDrawPhaseObserver = scene.onBeforeDrawPhaseObservable.add(() => {
                startTime = precisionDate/* PrecisionDate */.j.Now;
            });
            const onAfterDrawPhaseObserver = scene.onAfterDrawPhaseObservable.add(() => {
                timeTaken = precisionDate/* PrecisionDate */.j.Now - startTime;
            });
            return {
                id: "Render",
                getData: () => timeTaken,
                dispose: () => {
                    scene.onBeforeDrawPhaseObservable.remove(onBeforeDrawPhaseObserver);
                    scene.onAfterDrawPhaseObservable.remove(onAfterDrawPhaseObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of total frame time metrics.
     * @returns the initializer for the total frame time strategy
     */
    static FrameTotalStrategy() {
        return (scene) => {
            let startTime = precisionDate/* PrecisionDate */.j.Now;
            let timeTaken = 0;
            const onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {
                startTime = precisionDate/* PrecisionDate */.j.Now;
            });
            const onAfterRenderObserver = scene.onAfterRenderObservable.add(() => {
                timeTaken = precisionDate/* PrecisionDate */.j.Now - startTime;
            });
            return {
                id: "Frame Total",
                getData: () => timeTaken,
                dispose: () => {
                    scene.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver);
                    scene.onAfterRenderObservable.remove(onAfterRenderObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of inter-frame time metrics.
     * @returns the initializer for the inter-frame time strategy
     */
    static InterFrameStrategy() {
        return (scene) => {
            let startTime = precisionDate/* PrecisionDate */.j.Now;
            let timeTaken = 0;
            const onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {
                timeTaken = precisionDate/* PrecisionDate */.j.Now - startTime;
            });
            const onAfterRenderObserver = scene.onAfterRenderObservable.add(() => {
                startTime = precisionDate/* PrecisionDate */.j.Now;
            });
            return {
                id: "Inter-frame",
                getData: () => timeTaken,
                dispose: () => {
                    scene.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver);
                    scene.onAfterRenderObservable.remove(onAfterRenderObserver);
                },
            };
        };
    }
    /**
     * Gets the initializer for the strategy used for collection of gpu frame time metrics.
     * @returns the initializer for the gpu frame time strategy
     */
    static GpuFrameTimeStrategy() {
        return (scene) => {
            const engineInstrumentation = new EngineInstrumentation(scene.getEngine());
            engineInstrumentation.captureGPUFrameTime = true;
            return {
                id: "GPU frame time",
                getData: () => Math.max(engineInstrumentation.gpuFrameTimeCounter.current * 0.000001, 0),
                dispose: () => {
                    engineInstrumentation.dispose();
                },
            };
        };
    }
}
//# sourceMappingURL=performanceViewerCollectionStrategies.js.map
;// ./node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerSceneExtension.js


core_scene/* Scene */.Z.prototype.getPerfCollector = function () {
    if (!this._perfCollector) {
        this._perfCollector = new PerformanceViewerCollector(this);
    }
    return this._perfCollector;
};
//# sourceMappingURL=performanceViewerSceneExtension.js.map
;// ./node_modules/@babylonjs/core/Misc/PerformanceViewer/index.js
/* eslint-disable import/export */




//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/coroutine.js
var Misc_coroutine = __webpack_require__(80163);
;// ./node_modules/@babylonjs/core/Misc/snapshotRenderingHelper.js


/**
 * A helper class to simplify work with FAST snapshot mode (WebGPU only - can be used in WebGL too, but won't do anything).
 */
class SnapshotRenderingHelper {
    /**
     * Creates a new snapshot rendering helper
     * Note that creating an instance of the helper will set the snapshot rendering mode to SNAPSHOTRENDERING_FAST but will not enable snapshot rendering (engine.snapshotRendering is not updated).
     * Note also that fixMeshes() is called as part of the construction
     * @param scene The scene to use the helper in
     * @param options The options for the helper
     */
    constructor(scene, options) {
        this._disableRenderingRefCount = 0;
        this._currentPerformancePriorityMode = 0 /* ScenePerformancePriority.BackwardCompatible */;
        this._scene = scene;
        this._engine = scene.getEngine();
        if (!this._engine.isWebGPU) {
            return;
        }
        this._options = {
            morphTargetsNumMaxInfluences: 20,
            ...options,
        };
        this._engine.snapshotRenderingMode = 1;
        this.fixMeshes();
        this._onResizeObserver = this._engine.onResizeObservable.add(() => {
            // enableSnapshotRendering() will delay the actual enabling of snapshot rendering by at least a frame, so these two lines are not redundant!
            this.disableSnapshotRendering();
            this.enableSnapshotRendering();
        });
        this._scene.onBeforeRenderObservable.add(() => {
            if (!this._fastSnapshotRenderingEnabled) {
                return;
            }
            // Animate skeletons
            scene.skeletons.forEach((skeleton) => skeleton.prepare(true));
            for (const mesh of scene.meshes) {
                if (mesh.infiniteDistance) {
                    mesh.transferToEffect(mesh.computeWorldMatrix(true));
                }
                if (mesh.skeleton) {
                    mesh.transferToEffect(mesh.computeWorldMatrix(true));
                }
                if (mesh.getClassName() === "GaussianSplattingMesh") {
                    mesh._postToWorker();
                }
                if (mesh.morphTargetManager && mesh.subMeshes) {
                    // Make sure morph target animations work
                    for (const subMesh of mesh.subMeshes) {
                        const dw = subMesh._drawWrapper;
                        const effect = dw.effect;
                        if (effect) {
                            const dataBuffer = dw.drawContext.buffers["LeftOver"];
                            const ubLeftOver = effect._pipelineContext?.uniformBuffer;
                            if (dataBuffer && ubLeftOver && ubLeftOver.setDataBuffer(dataBuffer)) {
                                mesh.morphTargetManager._bind(effect);
                                (0,materialHelper_functions/* BindMorphTargetParameters */.nR)(mesh, effect);
                                ubLeftOver.update();
                            }
                        }
                    }
                }
            }
        });
    }
    /**
     * Enable snapshot rendering
     * Use this method instead of engine.snapshotRendering=true, to make sure everything is ready before enabling snapshot rendering.
     * Note that this method is ref-counted and works in pair with disableSnapshotRendering(): you should call enableSnapshotRendering() as many times as you call disableSnapshotRendering().
     */
    enableSnapshotRendering() {
        if (!this._engine.isWebGPU) {
            return;
        }
        if (--this._disableRenderingRefCount > 0) {
            return;
        }
        this._disableRenderingRefCount = 0;
        this._currentPerformancePriorityMode = this._pendingCurrentPerformancePriorityMode ?? this._scene.performancePriority;
        this._pendingCurrentPerformancePriorityMode = undefined;
        this._scene.performancePriority = 0 /* ScenePerformancePriority.BackwardCompatible */;
        this._scene.executeWhenReady(() => {
            if (this._disableRenderingRefCount > 0) {
                return;
            }
            // Make sure a full frame is rendered before enabling snapshot rendering, so use "+2" instead of "+1"
            this._executeAtFrame(this._engine.frameId + 2, () => {
                this._engine.snapshotRendering = true;
            });
        });
    }
    /**
     * Disable snapshot rendering
     * Note that this method is ref-counted and works in pair with disableSnapshotRendering(): you should call enableSnapshotRendering() as many times as you call disableSnapshotRendering().
     */
    disableSnapshotRendering() {
        if (!this._engine.isWebGPU) {
            return;
        }
        if (this._disableRenderingRefCount === 0) {
            // Snapshot rendering switches from enabled to disabled
            // We reset the performance priority mode to that which it was before enabling snapshot rendering, but first set it to “BackwardCompatible” to allow the system to regenerate resources that may have been optimized for snapshot rendering.
            // We'll then restore the original mode at the next frame.
            this._scene.performancePriority = 0 /* ScenePerformancePriority.BackwardCompatible */;
            if (this._currentPerformancePriorityMode !== 0 /* ScenePerformancePriority.BackwardCompatible */) {
                this._pendingCurrentPerformancePriorityMode = this._currentPerformancePriorityMode;
                this._scene.executeWhenReady(() => {
                    this._executeAtFrame(this._engine.frameId + 2, () => {
                        // if this._disableRenderingRefCount === 0, snapshot rendering has been enabled in the meantime, so do nothing
                        if (this._disableRenderingRefCount > 0 && this._pendingCurrentPerformancePriorityMode !== undefined) {
                            this._scene.performancePriority = this._pendingCurrentPerformancePriorityMode;
                        }
                        this._pendingCurrentPerformancePriorityMode = undefined;
                    }, true);
                });
            }
        }
        this._engine.snapshotRendering = false;
        this._disableRenderingRefCount++;
    }
    /**
     * Fix meshes for snapshot rendering.
     * This method will make sure that some features are disabled or fixed to make sure snapshot rendering works correctly.
     * @param meshes List of meshes to fix. If not provided, all meshes in the scene will be fixed.
     */
    fixMeshes(meshes) {
        if (!this._engine.isWebGPU) {
            return;
        }
        meshes = meshes || this._scene.meshes;
        for (const mesh of meshes) {
            mesh.ignoreCameraMaxZ = false;
            if (mesh.morphTargetManager) {
                mesh.morphTargetManager.numMaxInfluencers = Math.min(mesh.morphTargetManager.numTargets, this._options.morphTargetsNumMaxInfluences);
            }
        }
    }
    /**
     * Call this method to update a mesh on the GPU after some properties have changed (position, rotation, scaling, visibility).
     * @param mesh The mesh to update. Can be a single mesh or an array of meshes to update.
     */
    updateMesh(mesh) {
        if (!this._fastSnapshotRenderingEnabled) {
            return;
        }
        if (Array.isArray(mesh)) {
            for (const m of mesh) {
                m.transferToEffect(m.computeWorldMatrix(true));
            }
            return;
        }
        mesh.transferToEffect(mesh.computeWorldMatrix(true));
    }
    /**
     * Update the meshes used in an effect layer to ensure that snapshot rendering works correctly for these meshes in this layer.
     * @param effectLayer The effect layer
     * @param autoUpdate If true, the helper will automatically update the effect layer meshes with each frame. If false, you'll need to call this method manually when the camera or layer meshes move or rotate.
     */
    updateMeshesForEffectLayer(effectLayer, autoUpdate = true) {
        if (!this._engine.isWebGPU) {
            return;
        }
        const renderPassId = effectLayer.mainTexture.renderPassId;
        if (autoUpdate) {
            this._onBeforeRenderObserverUpdateLayer = this._scene.onBeforeRenderObservable.add(() => {
                this._updateMeshMatricesForRenderPassId(renderPassId);
            });
        }
        else {
            this._updateMeshMatricesForRenderPassId(renderPassId);
        }
    }
    /**
     * Dispose the helper
     */
    dispose() {
        if (!this._engine.isWebGPU) {
            return;
        }
        this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
        this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserverUpdateLayer);
        this._engine.onResizeObservable.remove(this._onResizeObserver);
    }
    get _fastSnapshotRenderingEnabled() {
        return this._engine.snapshotRendering && this._engine.snapshotRenderingMode === 1;
    }
    _updateMeshMatricesForRenderPassId(renderPassId) {
        if (!this._fastSnapshotRenderingEnabled) {
            return;
        }
        const sceneTransformationMatrix = this._scene.getTransformMatrix();
        for (let i = 0; i < this._scene.meshes.length; ++i) {
            const mesh = this._scene.meshes[i];
            if (!mesh.subMeshes) {
                continue;
            }
            for (let j = 0; j < mesh.subMeshes.length; ++j) {
                const dw = mesh.subMeshes[j]._getDrawWrapper(renderPassId);
                const effect = dw?.effect;
                if (effect) {
                    const dataBuffer = dw.drawContext.buffers["LeftOver"];
                    const ubLeftOver = effect._pipelineContext?.uniformBuffer;
                    if (dataBuffer && ubLeftOver && ubLeftOver.setDataBuffer(dataBuffer)) {
                        effect.setMatrix("viewProjection", sceneTransformationMatrix);
                        effect.setMatrix("world", mesh.computeWorldMatrix());
                        ubLeftOver.update();
                    }
                }
            }
        }
    }
    _executeAtFrame(frameId, func, executeWhenModeIsDisabled = false) {
        const obs = this._engine.onEndFrameObservable.add(() => {
            if ((this._disableRenderingRefCount > 0 && !executeWhenModeIsDisabled) || (this._disableRenderingRefCount === 0 && executeWhenModeIsDisabled)) {
                this._engine.onEndFrameObservable.remove(obs);
                return;
            }
            if (this._engine.frameId >= frameId) {
                this._engine.onEndFrameObservable.remove(obs);
                func();
            }
        });
    }
}
//# sourceMappingURL=snapshotRenderingHelper.js.map
;// ./node_modules/@babylonjs/core/Misc/observableCoroutine.js


function CreateObservableScheduler(observable) {
    const coroutines = new Array();
    const onSteps = new Array();
    const onErrors = new Array();
    const observer = observable.add(() => {
        const count = coroutines.length;
        for (let i = 0; i < count; i++) {
            (0,Misc_coroutine/* inlineScheduler */.FE)(coroutines.shift(), onSteps.shift(), onErrors.shift());
        }
    });
    const scheduler = (coroutine, onStep, onError) => {
        coroutines.push(coroutine);
        onSteps.push(onStep);
        onErrors.push(onError);
    };
    return {
        scheduler: scheduler,
        dispose: () => {
            observable.remove(observer);
        },
    };
}
Misc_observable/* Observable */.cP.prototype.runCoroutineAsync = function (coroutine) {
    if (!this._coroutineScheduler) {
        const schedulerAndDispose = CreateObservableScheduler(this);
        this._coroutineScheduler = schedulerAndDispose.scheduler;
        this._coroutineSchedulerDispose = schedulerAndDispose.dispose;
    }
    return (0,Misc_coroutine/* runCoroutineAsync */.kj)(coroutine, this._coroutineScheduler);
};
Misc_observable/* Observable */.cP.prototype.cancelAllCoroutines = function () {
    if (this._coroutineSchedulerDispose) {
        this._coroutineSchedulerDispose();
    }
    this._coroutineScheduler = undefined;
    this._coroutineSchedulerDispose = undefined;
};
//# sourceMappingURL=observableCoroutine.js.map
;// ./node_modules/@babylonjs/core/Shaders/equirectangularPanorama.fragment.js
// Do not edit.

const equirectangularPanorama_fragment_name = "equirectangularPanoramaPixelShader";
const equirectangularPanorama_fragment_shader = `#ifdef GL_ES
precision highp float;
#endif
#define M_PI 3.1415926535897932384626433832795
varying vec2 vUV;uniform samplerCube cubeMap;void main(void) {vec2 uv=vUV;float longitude=uv.x*2.*M_PI-M_PI+M_PI/2.;float latitude=(1.-uv.y)*M_PI;vec3 dir=vec3(
- sin( longitude )*sin( latitude ),
cos( latitude ),
- cos( longitude )*sin( latitude )
);normalize( dir );gl_FragColor=textureCube( cubeMap,dir );}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[equirectangularPanorama_fragment_name] = equirectangularPanorama_fragment_shader;
/** @internal */
const equirectangularPanoramaPixelShader = { name: equirectangularPanorama_fragment_name, shader: equirectangularPanorama_fragment_shader };
//# sourceMappingURL=equirectangularPanorama.fragment.js.map
;// ./node_modules/@babylonjs/core/Misc/equirectangularCapture.js





/**
 * @param scene This refers to the scene which would be rendered in the given equirectangular capture
 * @param options This refers to the options for a given equirectangular capture
 * @returns the requested capture's pixel-data or auto downloads the file if options.filename is specified
 */
async function captureEquirectangularFromScene(scene, options) {
    const probe = options.probe ?? new ReflectionProbe("tempProbe", options.size, scene);
    const wasProbeProvided = !!options.probe;
    if (!wasProbeProvided) {
        if (options.position) {
            probe.position = options.position.clone();
        }
        else if (scene.activeCamera) {
            probe.position = scene.activeCamera.position.clone();
        }
    }
    const meshesToConsider = options.meshesFilter ? scene.meshes.filter(options.meshesFilter) : scene.meshes;
    probe.renderList?.push(...meshesToConsider);
    probe.refreshRate = Textures_renderTargetTexture/* RenderTargetTexture */.$.REFRESHRATE_RENDER_ONCE;
    probe.cubeTexture.render();
    const dumpTexture = new CustomProceduralTexture("tempProceduralTexture", "equirectangularPanorama", { width: options.size * 2, height: options.size }, scene);
    dumpTexture.setTexture("cubeMap", probe.cubeTexture);
    return new Promise((resolve, reject) => {
        dumpTexture.onGeneratedObservable.addOnce(() => {
            const pixelDataPromise = dumpTexture.readPixels();
            if (!pixelDataPromise) {
                reject(new Error("No Pixel Data found on procedural texture"));
                dumpTexture.dispose();
                if (!wasProbeProvided) {
                    probe.dispose();
                }
                return;
            }
            pixelDataPromise.then((pixelData) => {
                dumpTexture.dispose();
                if (!wasProbeProvided) {
                    probe.dispose();
                }
                if (options.filename) {
                    (0,dumpTools.DumpData)(options.size * 2, options.size, pixelData, undefined, "image/png", options.filename);
                    resolve(null);
                }
                else {
                    resolve(pixelData);
                }
            });
        });
    });
}
//# sourceMappingURL=equirectangularCapture.js.map
;// ./node_modules/@babylonjs/core/Misc/asyncLock.js

/**
 * Provides a simple way of creating the rough equivalent of an async critical section.
 *
 * @example
 * ```typescript
 * const myLock = new AsyncLock();
 *
 * private async MyFuncAsync(): Promise<void> {
 *   await myLock.lockAsync(async () => {
 *     await operation1Async();
 *     await operation2Async();
 *   });
 * }
 * ```
 */
class AsyncLock {
    constructor() {
        this._currentOperation = Promise.resolve();
    }
    /**
     * Executes the provided function when the lock is acquired (e.g. when the previous operation finishes).
     * @param func The function to execute.
     * @param signal An optional signal that can be used to abort the operation.
     * @returns A promise that resolves when the func finishes executing.
     */
    lockAsync(func, signal) {
        signal?.throwIfAborted();
        const wrappedFunc = signal
            ? () => {
                signal.throwIfAborted();
                return func();
            }
            : func;
        const newOperation = this._currentOperation.then(wrappedFunc);
        // NOTE: It would be simpler to just hold a Promise<unknown>, but this class should not prevent an object held by the returned promise from being garbage collected.
        this._currentOperation = new Promise((resolve) => newOperation.then(() => resolve(), resolve));
        return newOperation;
    }
    /**
     * Executes the provided function when all the specified locks are acquired.
     * @param func The function to execute.
     * @param locks The locks to acquire.
     * @param signal An optional signal that can be used to abort the operation.
     * @returns A promise that resolves when the func finishes executing.
     */
    static async LockAsync(func, locks, signal) {
        signal?.throwIfAborted();
        if (locks.length === 0) {
            return await func();
        }
        const deferred = new Misc_deferred/* Deferred */.c();
        let acquiredLocks = 0;
        locks.forEach((lock) => lock
            .lockAsync(async () => {
            acquiredLocks++;
            if (acquiredLocks === locks.length) {
                deferred.resolve(await func());
            }
            return deferred.promise;
        }, signal)
            .catch((e) => deferred.reject(e)));
        return deferred.promise;
    }
}
//# sourceMappingURL=asyncLock.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/rgbdDecode.fragment.js
var rgbdDecode_fragment = __webpack_require__(9682);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/rgbdEncode.fragment.js
var rgbdEncode_fragment = __webpack_require__(32646);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/rgbdDecode.fragment.js
var ShadersWGSL_rgbdDecode_fragment = __webpack_require__(30371);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/rgbdEncode.fragment.js
var ShadersWGSL_rgbdEncode_fragment = __webpack_require__(85035);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/copyTextureToTexture.fragment.js
var copyTextureToTexture_fragment = __webpack_require__(45963);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/copyTextureToTexture.fragment.js
var ShadersWGSL_copyTextureToTexture_fragment = __webpack_require__(17770);
;// ./node_modules/@babylonjs/core/Misc/index.js
/* eslint-disable import/no-internal-modules */




















// loaded from texture tools














































// eslint-disable-next-line import/export


/** @deprecated Use individual exports */





// RGBDTextureTools




// CopyTextureToTexture


//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Morph/morphTarget.js
var morphTarget = __webpack_require__(80706);
;// ./node_modules/@babylonjs/core/Morph/index.js


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Navigation/INavigationEngine.js

//# sourceMappingURL=INavigationEngine.js.map
;// ./node_modules/@babylonjs/core/Navigation/Plugins/recastJSPlugin.js






/**
 * RecastJS navigation plugin
 */
class RecastJSPlugin {
    /**
     * Initializes the recastJS plugin
     * @param recastInjection can be used to inject your own recast reference
     */
    constructor(recastInjection = Recast) {
        /**
         * Reference to the Recast library
         */
        this.bjsRECAST = {};
        /**
         * plugin name
         */
        this.name = "RecastJSPlugin";
        this._maximumSubStepCount = 10;
        this._timeStep = 1 / 60;
        this._timeFactor = 1;
        this._worker = null;
        if (typeof recastInjection === "function") {
            logger/* Logger */.V.Error("RecastJS is not ready. Please make sure you await Recast() before using the plugin.");
        }
        else {
            this.bjsRECAST = recastInjection;
        }
        if (!this.isSupported()) {
            logger/* Logger */.V.Error("RecastJS is not available. Please make sure you included the js file.");
            return;
        }
        this.setTimeStep();
        this._tempVec1 = new this.bjsRECAST.Vec3();
        this._tempVec2 = new this.bjsRECAST.Vec3();
    }
    /**
     * Set worker URL to be used when generating a new navmesh
     * @param workerURL url string
     * @returns boolean indicating if worker is created
     */
    setWorkerURL(workerURL) {
        if (window && window.Worker) {
            this._worker = new Worker(workerURL);
            return true;
        }
        return false;
    }
    /**
     * Set the time step of the navigation tick update.
     * Default is 1/60.
     * A value of 0 will disable fixed time update
     * @param newTimeStep the new timestep to apply to this world.
     */
    setTimeStep(newTimeStep = 1 / 60) {
        this._timeStep = newTimeStep;
    }
    /**
     * Get the time step of the navigation tick update.
     * @returns the current time step
     */
    getTimeStep() {
        return this._timeStep;
    }
    /**
     * If delta time in navigation tick update is greater than the time step
     * a number of sub iterations are done. If more iterations are need to reach deltatime
     * they will be discarded.
     * A value of 0 will set to no maximum and update will use as many substeps as needed
     * @param newStepCount the maximum number of iterations
     */
    setMaximumSubStepCount(newStepCount = 10) {
        this._maximumSubStepCount = newStepCount;
    }
    /**
     * Get the maximum number of iterations per navigation tick update
     * @returns the maximum number of iterations
     */
    getMaximumSubStepCount() {
        return this._maximumSubStepCount;
    }
    /**
     * Time factor applied when updating crowd agents (default 1). A value of 0 will pause crowd updates.
     * @param value the time factor applied at update
     */
    set timeFactor(value) {
        this._timeFactor = Math.max(value, 0);
    }
    /**
     * Get the time factor used for crowd agent update
     * @returns the time factor
     */
    get timeFactor() {
        return this._timeFactor;
    }
    /**
     * Creates a navigation mesh
     * @param meshes array of all the geometry used to compute the navigation mesh
     * @param parameters bunch of parameters used to filter geometry
     * @param completion callback when data is available from the worker. Not used without a worker
     */
    createNavMesh(meshes, parameters, completion) {
        if (this._worker && !completion) {
            logger/* Logger */.V.Warn("A worker is avaible but no completion callback. Defaulting to blocking navmesh creation");
        }
        else if (!this._worker && completion) {
            logger/* Logger */.V.Warn("A completion callback is avaible but no worker. Defaulting to blocking navmesh creation");
        }
        this.navMesh = new this.bjsRECAST.NavMesh();
        let index;
        let tri;
        let pt;
        const indices = [];
        const positions = [];
        let offset = 0;
        for (index = 0; index < meshes.length; index++) {
            if (meshes[index]) {
                const mesh = meshes[index];
                const meshIndices = mesh.getIndices();
                if (!meshIndices) {
                    continue;
                }
                const meshPositions = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, false, false);
                if (!meshPositions) {
                    continue;
                }
                const worldMatrices = [];
                const worldMatrix = mesh.computeWorldMatrix(true);
                if (mesh.hasThinInstances) {
                    const thinMatrices = mesh.thinInstanceGetWorldMatrices();
                    for (let instanceIndex = 0; instanceIndex < thinMatrices.length; instanceIndex++) {
                        const tmpMatrix = new math/* Matrix */.uq();
                        const thinMatrix = thinMatrices[instanceIndex];
                        thinMatrix.multiplyToRef(worldMatrix, tmpMatrix);
                        worldMatrices.push(tmpMatrix);
                    }
                }
                else {
                    worldMatrices.push(worldMatrix);
                }
                for (let matrixIndex = 0; matrixIndex < worldMatrices.length; matrixIndex++) {
                    const wm = worldMatrices[matrixIndex];
                    for (tri = 0; tri < meshIndices.length; tri++) {
                        indices.push(meshIndices[tri] + offset);
                    }
                    const transformed = math/* Vector3 */.Pq.Zero();
                    const position = math/* Vector3 */.Pq.Zero();
                    for (pt = 0; pt < meshPositions.length; pt += 3) {
                        math/* Vector3 */.Pq.FromArrayToRef(meshPositions, pt, position);
                        math/* Vector3 */.Pq.TransformCoordinatesToRef(position, wm, transformed);
                        positions.push(transformed.x, transformed.y, transformed.z);
                    }
                    offset += meshPositions.length / 3;
                }
            }
        }
        if (this._worker && completion) {
            // spawn worker and send message
            this._worker.postMessage([positions, offset, indices, indices.length, parameters]);
            this._worker.onmessage = function (e) {
                completion(e.data);
            };
        }
        else {
            // blocking calls
            const rc = new this.bjsRECAST.rcConfig();
            rc.cs = parameters.cs;
            rc.ch = parameters.ch;
            rc.borderSize = parameters.borderSize ? parameters.borderSize : 0;
            rc.tileSize = parameters.tileSize ? parameters.tileSize : 0;
            rc.walkableSlopeAngle = parameters.walkableSlopeAngle;
            rc.walkableHeight = parameters.walkableHeight;
            rc.walkableClimb = parameters.walkableClimb;
            rc.walkableRadius = parameters.walkableRadius;
            rc.maxEdgeLen = parameters.maxEdgeLen;
            rc.maxSimplificationError = parameters.maxSimplificationError;
            rc.minRegionArea = parameters.minRegionArea;
            rc.mergeRegionArea = parameters.mergeRegionArea;
            rc.maxVertsPerPoly = parameters.maxVertsPerPoly;
            rc.detailSampleDist = parameters.detailSampleDist;
            rc.detailSampleMaxError = parameters.detailSampleMaxError;
            this.navMesh.build(positions, offset, indices, indices.length, rc);
        }
    }
    /**
     * Create a navigation mesh debug mesh
     * @param scene is where the mesh will be added
     * @returns debug display mesh
     */
    createDebugNavMesh(scene) {
        let tri;
        let pt;
        const debugNavMesh = this.navMesh.getDebugNavMesh();
        const triangleCount = debugNavMesh.getTriangleCount();
        const indices = [];
        const positions = [];
        for (tri = 0; tri < triangleCount * 3; tri++) {
            indices.push(tri);
        }
        for (tri = 0; tri < triangleCount; tri++) {
            for (pt = 0; pt < 3; pt++) {
                const point = debugNavMesh.getTriangle(tri).getPoint(pt);
                positions.push(point.x, point.y, point.z);
            }
        }
        const mesh = new Meshes_mesh/* Mesh */.e("NavMeshDebug", scene);
        const vertexData = new mesh_vertexData/* VertexData */.P();
        vertexData.indices = indices;
        vertexData.positions = positions;
        vertexData.applyToMesh(mesh, false);
        return mesh;
    }
    /**
     * Get a navigation mesh constrained position, closest to the parameter position
     * @param position world position
     * @returns the closest point to position constrained by the navigation mesh
     */
    getClosestPoint(position) {
        this._tempVec1.x = position.x;
        this._tempVec1.y = position.y;
        this._tempVec1.z = position.z;
        const ret = this.navMesh.getClosestPoint(this._tempVec1);
        const pr = new math/* Vector3 */.Pq(ret.x, ret.y, ret.z);
        return pr;
    }
    /**
     * Get a navigation mesh constrained position, closest to the parameter position
     * @param position world position
     * @param result output the closest point to position constrained by the navigation mesh
     */
    getClosestPointToRef(position, result) {
        this._tempVec1.x = position.x;
        this._tempVec1.y = position.y;
        this._tempVec1.z = position.z;
        const ret = this.navMesh.getClosestPoint(this._tempVec1);
        result.set(ret.x, ret.y, ret.z);
    }
    /**
     * Get a navigation mesh constrained position, within a particular radius
     * @param position world position
     * @param maxRadius the maximum distance to the constrained world position
     * @returns the closest point to position constrained by the navigation mesh
     */
    getRandomPointAround(position, maxRadius) {
        this._tempVec1.x = position.x;
        this._tempVec1.y = position.y;
        this._tempVec1.z = position.z;
        const ret = this.navMesh.getRandomPointAround(this._tempVec1, maxRadius);
        const pr = new math/* Vector3 */.Pq(ret.x, ret.y, ret.z);
        return pr;
    }
    /**
     * Get a navigation mesh constrained position, within a particular radius
     * @param position world position
     * @param maxRadius the maximum distance to the constrained world position
     * @param result output the closest point to position constrained by the navigation mesh
     */
    getRandomPointAroundToRef(position, maxRadius, result) {
        this._tempVec1.x = position.x;
        this._tempVec1.y = position.y;
        this._tempVec1.z = position.z;
        const ret = this.navMesh.getRandomPointAround(this._tempVec1, maxRadius);
        result.set(ret.x, ret.y, ret.z);
    }
    /**
     * Compute the final position from a segment made of destination-position
     * @param position world position
     * @param destination world position
     * @returns the resulting point along the navmesh
     */
    moveAlong(position, destination) {
        this._tempVec1.x = position.x;
        this._tempVec1.y = position.y;
        this._tempVec1.z = position.z;
        this._tempVec2.x = destination.x;
        this._tempVec2.y = destination.y;
        this._tempVec2.z = destination.z;
        const ret = this.navMesh.moveAlong(this._tempVec1, this._tempVec2);
        const pr = new math/* Vector3 */.Pq(ret.x, ret.y, ret.z);
        return pr;
    }
    /**
     * Compute the final position from a segment made of destination-position
     * @param position world position
     * @param destination world position
     * @param result output the resulting point along the navmesh
     */
    moveAlongToRef(position, destination, result) {
        this._tempVec1.x = position.x;
        this._tempVec1.y = position.y;
        this._tempVec1.z = position.z;
        this._tempVec2.x = destination.x;
        this._tempVec2.y = destination.y;
        this._tempVec2.z = destination.z;
        const ret = this.navMesh.moveAlong(this._tempVec1, this._tempVec2);
        result.set(ret.x, ret.y, ret.z);
    }
    _convertNavPathPoints(navPath) {
        let pt;
        const pointCount = navPath.getPointCount();
        const positions = [];
        for (pt = 0; pt < pointCount; pt++) {
            const p = navPath.getPoint(pt);
            positions.push(new math/* Vector3 */.Pq(p.x, p.y, p.z));
        }
        return positions;
    }
    /**
     * Compute a navigation path from start to end. Returns an empty array if no path can be computed
     * Path is straight.
     * @param start world position
     * @param end world position
     * @returns array containing world position composing the path
     */
    computePath(start, end) {
        this._tempVec1.x = start.x;
        this._tempVec1.y = start.y;
        this._tempVec1.z = start.z;
        this._tempVec2.x = end.x;
        this._tempVec2.y = end.y;
        this._tempVec2.z = end.z;
        const navPath = this.navMesh.computePath(this._tempVec1, this._tempVec2);
        return this._convertNavPathPoints(navPath);
    }
    /**
     * Compute a navigation path from start to end. Returns an empty array if no path can be computed.
     * Path follows navigation mesh geometry.
     * @param start world position
     * @param end world position
     * @returns array containing world position composing the path
     */
    computePathSmooth(start, end) {
        this._tempVec1.x = start.x;
        this._tempVec1.y = start.y;
        this._tempVec1.z = start.z;
        this._tempVec2.x = end.x;
        this._tempVec2.y = end.y;
        this._tempVec2.z = end.z;
        const navPath = this.navMesh.computePathSmooth(this._tempVec1, this._tempVec2);
        return this._convertNavPathPoints(navPath);
    }
    /**
     * Create a new Crowd so you can add agents
     * @param maxAgents the maximum agent count in the crowd
     * @param maxAgentRadius the maximum radius an agent can have
     * @param scene to attach the crowd to
     * @returns the crowd you can add agents to
     */
    createCrowd(maxAgents, maxAgentRadius, scene) {
        const crowd = new RecastJSCrowd(this, maxAgents, maxAgentRadius, scene);
        return crowd;
    }
    /**
     * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)
     * The queries will try to find a solution within those bounds
     * default is (1,1,1)
     * @param extent x,y,z value that define the extent around the queries point of reference
     */
    setDefaultQueryExtent(extent) {
        this._tempVec1.x = extent.x;
        this._tempVec1.y = extent.y;
        this._tempVec1.z = extent.z;
        this.navMesh.setDefaultQueryExtent(this._tempVec1);
    }
    /**
     * Get the Bounding box extent specified by setDefaultQueryExtent
     * @returns the box extent values
     */
    getDefaultQueryExtent() {
        const p = this.navMesh.getDefaultQueryExtent();
        return new math/* Vector3 */.Pq(p.x, p.y, p.z);
    }
    /**
     * build the navmesh from a previously saved state using getNavmeshData
     * @param data the Uint8Array returned by getNavmeshData
     */
    buildFromNavmeshData(data) {
        const nDataBytes = data.length * data.BYTES_PER_ELEMENT;
        const dataPtr = this.bjsRECAST._malloc(nDataBytes);
        const dataHeap = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, dataPtr, nDataBytes);
        dataHeap.set(data);
        const buf = new this.bjsRECAST.NavmeshData();
        buf.dataPointer = dataHeap.byteOffset;
        buf.size = data.length;
        this.navMesh = new this.bjsRECAST.NavMesh();
        this.navMesh.buildFromNavmeshData(buf);
        // Free memory
        this.bjsRECAST._free(dataHeap.byteOffset);
    }
    /**
     * returns the navmesh data that can be used later. The navmesh must be built before retrieving the data
     * @returns data the Uint8Array that can be saved and reused
     */
    getNavmeshData() {
        const navmeshData = this.navMesh.getNavmeshData();
        const arrView = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, navmeshData.dataPointer, navmeshData.size);
        const ret = new Uint8Array(navmeshData.size);
        ret.set(arrView);
        this.navMesh.freeNavmeshData(navmeshData);
        return ret;
    }
    /**
     * Get the Bounding box extent result specified by setDefaultQueryExtent
     * @param result output the box extent values
     */
    getDefaultQueryExtentToRef(result) {
        const p = this.navMesh.getDefaultQueryExtent();
        result.set(p.x, p.y, p.z);
    }
    /**
     * Disposes
     */
    dispose() { }
    /**
     * Creates a cylinder obstacle and add it to the navigation
     * @param position world position
     * @param radius cylinder radius
     * @param height cylinder height
     * @returns the obstacle freshly created
     */
    addCylinderObstacle(position, radius, height) {
        this._tempVec1.x = position.x;
        this._tempVec1.y = position.y;
        this._tempVec1.z = position.z;
        return this.navMesh.addCylinderObstacle(this._tempVec1, radius, height);
    }
    /**
     * Creates an oriented box obstacle and add it to the navigation
     * @param position world position
     * @param extent box size
     * @param angle angle in radians of the box orientation on Y axis
     * @returns the obstacle freshly created
     */
    addBoxObstacle(position, extent, angle) {
        this._tempVec1.x = position.x;
        this._tempVec1.y = position.y;
        this._tempVec1.z = position.z;
        this._tempVec2.x = extent.x;
        this._tempVec2.y = extent.y;
        this._tempVec2.z = extent.z;
        return this.navMesh.addBoxObstacle(this._tempVec1, this._tempVec2, angle);
    }
    /**
     * Removes an obstacle created by addCylinderObstacle or addBoxObstacle
     * @param obstacle obstacle to remove from the navigation
     */
    removeObstacle(obstacle) {
        this.navMesh.removeObstacle(obstacle);
    }
    /**
     * If this plugin is supported
     * @returns true if plugin is supported
     */
    isSupported() {
        return this.bjsRECAST !== undefined;
    }
    /**
     * Returns the seed used for randomized functions like `getRandomPointAround`
     * @returns seed number
     */
    getRandomSeed() {
        return this.bjsRECAST._getRandomSeed();
    }
    /**
     * Set the seed used for randomized functions like `getRandomPointAround`
     * @param seed number used as seed for random functions
     */
    setRandomSeed(seed) {
        this.bjsRECAST._setRandomSeed(seed);
    }
}
/**
 * Recast detour crowd implementation
 */
class RecastJSCrowd {
    /**
     * Constructor
     * @param plugin recastJS plugin
     * @param maxAgents the maximum agent count in the crowd
     * @param maxAgentRadius the maximum radius an agent can have
     * @param scene to attach the crowd to
     * @returns the crowd you can add agents to
     */
    constructor(plugin, maxAgents, maxAgentRadius, scene) {
        /**
         * Link to the detour crowd
         */
        this.recastCrowd = {};
        /**
         * One transform per agent
         */
        this.transforms = new Array();
        /**
         * All agents created
         */
        this.agents = new Array();
        /**
         * agents reach radius
         */
        this.reachRadii = new Array();
        /**
         * true when a destination is active for an agent and notifier hasn't been notified of reach
         */
        this._agentDestinationArmed = new Array();
        /**
         * agent current target
         */
        this._agentDestination = new Array();
        /**
         * Observer for crowd updates
         */
        this._onBeforeAnimationsObserver = null;
        /**
         * Fires each time an agent is in reach radius of its destination
         */
        this.onReachTargetObservable = new Misc_observable/* Observable */.cP();
        this.bjsRECASTPlugin = plugin;
        this.recastCrowd = new this.bjsRECASTPlugin.bjsRECAST.Crowd(maxAgents, maxAgentRadius, this.bjsRECASTPlugin.navMesh.getNavMesh());
        this._scene = scene;
        this._onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {
            this.update(scene.getEngine().getDeltaTime() * 0.001 * plugin.timeFactor);
        });
    }
    /**
     * Add a new agent to the crowd with the specified parameter a corresponding transformNode.
     * You can attach anything to that node. The node position is updated in the scene update tick.
     * @param pos world position that will be constrained by the navigation mesh
     * @param parameters agent parameters
     * @param transform hooked to the agent that will be update by the scene
     * @returns agent index
     */
    addAgent(pos, parameters, transform) {
        const agentParams = new this.bjsRECASTPlugin.bjsRECAST.dtCrowdAgentParams();
        agentParams.radius = parameters.radius;
        agentParams.height = parameters.height;
        agentParams.maxAcceleration = parameters.maxAcceleration;
        agentParams.maxSpeed = parameters.maxSpeed;
        agentParams.collisionQueryRange = parameters.collisionQueryRange;
        agentParams.pathOptimizationRange = parameters.pathOptimizationRange;
        agentParams.separationWeight = parameters.separationWeight;
        agentParams.updateFlags = 7;
        agentParams.obstacleAvoidanceType = 0;
        agentParams.queryFilterType = 0;
        agentParams.userData = 0;
        const agentIndex = this.recastCrowd.addAgent(new this.bjsRECASTPlugin.bjsRECAST.Vec3(pos.x, pos.y, pos.z), agentParams);
        this.transforms.push(transform);
        this.agents.push(agentIndex);
        this.reachRadii.push(parameters.reachRadius ? parameters.reachRadius : parameters.radius);
        this._agentDestinationArmed.push(false);
        this._agentDestination.push(new math/* Vector3 */.Pq(0, 0, 0));
        return agentIndex;
    }
    /**
     * Returns the agent position in world space
     * @param index agent index returned by addAgent
     * @returns world space position
     */
    getAgentPosition(index) {
        const agentPos = this.recastCrowd.getAgentPosition(index);
        return new math/* Vector3 */.Pq(agentPos.x, agentPos.y, agentPos.z);
    }
    /**
     * Returns the agent position result in world space
     * @param index agent index returned by addAgent
     * @param result output world space position
     */
    getAgentPositionToRef(index, result) {
        const agentPos = this.recastCrowd.getAgentPosition(index);
        result.set(agentPos.x, agentPos.y, agentPos.z);
    }
    /**
     * Returns the agent velocity in world space
     * @param index agent index returned by addAgent
     * @returns world space velocity
     */
    getAgentVelocity(index) {
        const agentVel = this.recastCrowd.getAgentVelocity(index);
        return new math/* Vector3 */.Pq(agentVel.x, agentVel.y, agentVel.z);
    }
    /**
     * Returns the agent velocity result in world space
     * @param index agent index returned by addAgent
     * @param result output world space velocity
     */
    getAgentVelocityToRef(index, result) {
        const agentVel = this.recastCrowd.getAgentVelocity(index);
        result.set(agentVel.x, agentVel.y, agentVel.z);
    }
    /**
     * Returns the agent next target point on the path
     * @param index agent index returned by addAgent
     * @returns world space position
     */
    getAgentNextTargetPath(index) {
        const pathTargetPos = this.recastCrowd.getAgentNextTargetPath(index);
        return new math/* Vector3 */.Pq(pathTargetPos.x, pathTargetPos.y, pathTargetPos.z);
    }
    /**
     * Returns the agent next target point on the path
     * @param index agent index returned by addAgent
     * @param result output world space position
     */
    getAgentNextTargetPathToRef(index, result) {
        const pathTargetPos = this.recastCrowd.getAgentNextTargetPath(index);
        result.set(pathTargetPos.x, pathTargetPos.y, pathTargetPos.z);
    }
    /**
     * Gets the agent state
     * @param index agent index returned by addAgent
     * @returns agent state
     */
    getAgentState(index) {
        return this.recastCrowd.getAgentState(index);
    }
    /**
     * returns true if the agent in over an off mesh link connection
     * @param index agent index returned by addAgent
     * @returns true if over an off mesh link connection
     */
    overOffmeshConnection(index) {
        return this.recastCrowd.overOffmeshConnection(index);
    }
    /**
     * Asks a particular agent to go to a destination. That destination is constrained by the navigation mesh
     * @param index agent index returned by addAgent
     * @param destination targeted world position
     */
    agentGoto(index, destination) {
        this.recastCrowd.agentGoto(index, new this.bjsRECASTPlugin.bjsRECAST.Vec3(destination.x, destination.y, destination.z));
        // arm observer
        const item = this.agents.indexOf(index);
        if (item > -1) {
            this._agentDestinationArmed[item] = true;
            this._agentDestination[item].set(destination.x, destination.y, destination.z);
        }
    }
    /**
     * Teleport the agent to a new position
     * @param index agent index returned by addAgent
     * @param destination targeted world position
     */
    agentTeleport(index, destination) {
        this.recastCrowd.agentTeleport(index, new this.bjsRECASTPlugin.bjsRECAST.Vec3(destination.x, destination.y, destination.z));
    }
    /**
     * Update agent parameters
     * @param index agent index returned by addAgent
     * @param parameters agent parameters
     */
    updateAgentParameters(index, parameters) {
        const agentParams = this.recastCrowd.getAgentParameters(index);
        if (parameters.radius !== undefined) {
            agentParams.radius = parameters.radius;
        }
        if (parameters.height !== undefined) {
            agentParams.height = parameters.height;
        }
        if (parameters.maxAcceleration !== undefined) {
            agentParams.maxAcceleration = parameters.maxAcceleration;
        }
        if (parameters.maxSpeed !== undefined) {
            agentParams.maxSpeed = parameters.maxSpeed;
        }
        if (parameters.collisionQueryRange !== undefined) {
            agentParams.collisionQueryRange = parameters.collisionQueryRange;
        }
        if (parameters.pathOptimizationRange !== undefined) {
            agentParams.pathOptimizationRange = parameters.pathOptimizationRange;
        }
        if (parameters.separationWeight !== undefined) {
            agentParams.separationWeight = parameters.separationWeight;
        }
        this.recastCrowd.setAgentParameters(index, agentParams);
    }
    /**
     * remove a particular agent previously created
     * @param index agent index returned by addAgent
     */
    removeAgent(index) {
        this.recastCrowd.removeAgent(index);
        const item = this.agents.indexOf(index);
        if (item > -1) {
            this.agents.splice(item, 1);
            this.transforms.splice(item, 1);
            this.reachRadii.splice(item, 1);
            this._agentDestinationArmed.splice(item, 1);
            this._agentDestination.splice(item, 1);
        }
    }
    /**
     * get the list of all agents attached to this crowd
     * @returns list of agent indices
     */
    getAgents() {
        return this.agents;
    }
    /**
     * Tick update done by the Scene. Agent position/velocity/acceleration is updated by this function
     * @param deltaTime in seconds
     */
    update(deltaTime) {
        // update obstacles
        this.bjsRECASTPlugin.navMesh.update();
        if (deltaTime <= math/* Epsilon */.bH) {
            return;
        }
        // update crowd
        const timeStep = this.bjsRECASTPlugin.getTimeStep();
        const maxStepCount = this.bjsRECASTPlugin.getMaximumSubStepCount();
        if (timeStep <= math/* Epsilon */.bH) {
            this.recastCrowd.update(deltaTime);
        }
        else {
            let iterationCount = Math.floor(deltaTime / timeStep);
            if (maxStepCount && iterationCount > maxStepCount) {
                iterationCount = maxStepCount;
            }
            if (iterationCount < 1) {
                iterationCount = 1;
            }
            const step = deltaTime / iterationCount;
            for (let i = 0; i < iterationCount; i++) {
                this.recastCrowd.update(step);
            }
        }
        // update transforms
        for (let index = 0; index < this.agents.length; index++) {
            // update transform position
            const agentIndex = this.agents[index];
            const agentPosition = this.getAgentPosition(agentIndex);
            this.transforms[index].position = agentPosition;
            // check agent reach destination
            if (this._agentDestinationArmed[index]) {
                const dx = agentPosition.x - this._agentDestination[index].x;
                const dz = agentPosition.z - this._agentDestination[index].z;
                const radius = this.reachRadii[index];
                const groundY = this._agentDestination[index].y - this.reachRadii[index];
                const ceilingY = this._agentDestination[index].y + this.reachRadii[index];
                const distanceXZSquared = dx * dx + dz * dz;
                if (agentPosition.y > groundY && agentPosition.y < ceilingY && distanceXZSquared < radius * radius) {
                    this._agentDestinationArmed[index] = false;
                    this.onReachTargetObservable.notifyObservers({ agentIndex: agentIndex, destination: this._agentDestination[index] });
                }
            }
        }
    }
    /**
     * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)
     * The queries will try to find a solution within those bounds
     * default is (1,1,1)
     * @param extent x,y,z value that define the extent around the queries point of reference
     */
    setDefaultQueryExtent(extent) {
        const ext = new this.bjsRECASTPlugin.bjsRECAST.Vec3(extent.x, extent.y, extent.z);
        this.recastCrowd.setDefaultQueryExtent(ext);
    }
    /**
     * Get the Bounding box extent specified by setDefaultQueryExtent
     * @returns the box extent values
     */
    getDefaultQueryExtent() {
        const p = this.recastCrowd.getDefaultQueryExtent();
        return new math/* Vector3 */.Pq(p.x, p.y, p.z);
    }
    /**
     * Get the Bounding box extent result specified by setDefaultQueryExtent
     * @param result output the box extent values
     */
    getDefaultQueryExtentToRef(result) {
        const p = this.recastCrowd.getDefaultQueryExtent();
        result.set(p.x, p.y, p.z);
    }
    /**
     * Get the next corner points composing the path (max 4 points)
     * @param index agent index returned by addAgent
     * @returns array containing world position composing the path
     */
    getCorners(index) {
        let pt;
        const navPath = this.recastCrowd.getCorners(index);
        const pointCount = navPath.getPointCount();
        const positions = [];
        for (pt = 0; pt < pointCount; pt++) {
            const p = navPath.getPoint(pt);
            positions.push(new math/* Vector3 */.Pq(p.x, p.y, p.z));
        }
        return positions;
    }
    /**
     * Release all resources
     */
    dispose() {
        this.recastCrowd.destroy();
        this._scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver);
        this._onBeforeAnimationsObserver = null;
        this.onReachTargetObservable.clear();
    }
}
//# sourceMappingURL=recastJSPlugin.js.map
;// ./node_modules/@babylonjs/core/Navigation/Plugins/index.js

//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Navigation/index.js
/* eslint-disable import/no-internal-modules */


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/ObjectModel/objectModelInterfaces.js

//# sourceMappingURL=objectModelInterfaces.js.map
;// ./node_modules/@babylonjs/core/ObjectModel/index.js

//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Offline/database.js





// Sets the default offline provider to Babylon.js
abstractEngine/* AbstractEngine */.$.OfflineProviderFactory = (urlToScene, callbackManifestChecked, disableManifestCheck = false) => {
    return new Database(urlToScene, callbackManifestChecked, disableManifestCheck);
};
/**
 * Class used to enable access to IndexedDB
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeCached
 */
class Database {
    /**
     * Gets a boolean indicating if scene must be saved in the database
     */
    get enableSceneOffline() {
        return this._enableSceneOffline;
    }
    /**
     * Gets a boolean indicating if textures must be saved in the database
     */
    get enableTexturesOffline() {
        return this._enableTexturesOffline;
    }
    /**
     * Creates a new Database
     * @param urlToScene defines the url to load the scene
     * @param callbackManifestChecked defines the callback to use when manifest is checked
     * @param disableManifestCheck defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)
     */
    constructor(urlToScene, callbackManifestChecked, disableManifestCheck = false) {
        // Handling various flavors of prefixed version of IndexedDB
        this._idbFactory = (typeof indexedDB !== "undefined" ? indexedDB : undefined);
        this._currentSceneUrl = Database._ReturnFullUrlLocation(urlToScene);
        this._db = null;
        this._enableSceneOffline = false;
        this._enableTexturesOffline = false;
        this._manifestVersionFound = 0;
        this._mustUpdateRessources = false;
        this._hasReachedQuota = false;
        if (!Database.IDBStorageEnabled) {
            callbackManifestChecked(true);
        }
        else {
            if (disableManifestCheck) {
                this._enableSceneOffline = true;
                this._enableTexturesOffline = true;
                this._manifestVersionFound = 1;
                tools/* Tools */.S0.SetImmediate(() => {
                    callbackManifestChecked(true);
                });
            }
            else {
                this._checkManifestFile(callbackManifestChecked);
            }
        }
    }
    _checkManifestFile(callbackManifestChecked) {
        const noManifestFile = () => {
            this._enableSceneOffline = false;
            this._enableTexturesOffline = false;
            callbackManifestChecked(false);
        };
        const createManifestURL = () => {
            try {
                // make sure we have a valid URL.
                if (typeof URL === "function" && this._currentSceneUrl.indexOf("http") === 0) {
                    // we don't have the base url, so the URL string must have a protocol
                    const url = new URL(this._currentSceneUrl);
                    url.pathname += ".manifest";
                    return url.toString();
                }
            }
            catch (e) {
                // defensive - if this fails for any reason, fall back to the older method
            }
            return `${this._currentSceneUrl}.manifest`;
        };
        let timeStampUsed = false;
        let manifestURL = createManifestURL();
        const xhr = new webRequest/* WebRequest */.u();
        if (navigator.onLine) {
            // Adding a timestamp to by-pass browsers' cache
            timeStampUsed = true;
            manifestURL = manifestURL + (manifestURL.match(/\?/) == null ? "?" : "&") + Date.now();
        }
        xhr.open("GET", manifestURL);
        xhr.addEventListener("load", () => {
            if (xhr.status === 200 || Database._ValidateXHRData(xhr, 1)) {
                try {
                    const manifestFile = JSON.parse(xhr.response);
                    this._enableSceneOffline = manifestFile.enableSceneOffline;
                    this._enableTexturesOffline = manifestFile.enableTexturesOffline && Database._IsUASupportingBlobStorage;
                    if (manifestFile.version && !isNaN(parseInt(manifestFile.version))) {
                        this._manifestVersionFound = manifestFile.version;
                    }
                    callbackManifestChecked(true);
                }
                catch (ex) {
                    noManifestFile();
                }
            }
            else {
                noManifestFile();
            }
        }, false);
        xhr.addEventListener("error", () => {
            if (timeStampUsed) {
                timeStampUsed = false;
                // Let's retry without the timeStamp
                // It could fail when coupled with HTML5 Offline API
                const retryManifestURL = createManifestURL();
                xhr.open("GET", retryManifestURL);
                xhr.send();
            }
            else {
                noManifestFile();
            }
        }, false);
        try {
            xhr.send();
        }
        catch (ex) {
            logger/* Logger */.V.Error("Error on XHR send request.");
            callbackManifestChecked(false);
        }
    }
    /**
     * Open the database and make it available
     * @param successCallback defines the callback to call on success
     * @param errorCallback defines the callback to call on error
     */
    open(successCallback, errorCallback) {
        const handleError = () => {
            this._isSupported = false;
            if (errorCallback) {
                errorCallback();
            }
        };
        if (!this._idbFactory || !(this._enableSceneOffline || this._enableTexturesOffline)) {
            // Your browser doesn't support IndexedDB
            this._isSupported = false;
            if (errorCallback) {
                errorCallback();
            }
        }
        else {
            // If the DB hasn't been opened or created yet
            if (!this._db) {
                this._hasReachedQuota = false;
                this._isSupported = true;
                const request = this._idbFactory.open("babylonjs", 1);
                // Could occur if user is blocking the quota for the DB and/or doesn't grant access to IndexedDB
                request.onerror = () => {
                    handleError();
                };
                // executes when a version change transaction cannot complete due to other active transactions
                request.onblocked = () => {
                    logger/* Logger */.V.Error("IDB request blocked. Please reload the page.");
                    handleError();
                };
                // DB has been opened successfully
                request.onsuccess = () => {
                    this._db = request.result;
                    successCallback();
                };
                // Initialization of the DB. Creating Scenes & Textures stores
                request.onupgradeneeded = (event) => {
                    this._db = event.target.result;
                    if (this._db) {
                        try {
                            this._db.createObjectStore("scenes", { keyPath: "sceneUrl" });
                            this._db.createObjectStore("versions", { keyPath: "sceneUrl" });
                            this._db.createObjectStore("textures", { keyPath: "textureUrl" });
                        }
                        catch (ex) {
                            logger/* Logger */.V.Error("Error while creating object stores. Exception: " + ex.message);
                            handleError();
                        }
                    }
                };
            }
            // DB has already been created and opened
            else {
                if (successCallback) {
                    successCallback();
                }
            }
        }
    }
    /**
     * Loads an image from the database
     * @param url defines the url to load from
     * @param image defines the target DOM image
     */
    loadImage(url, image) {
        const completeURL = Database._ReturnFullUrlLocation(url);
        const saveAndLoadImage = () => {
            if (!this._hasReachedQuota && this._db !== null) {
                // the texture is not yet in the DB, let's try to save it
                this._saveImageIntoDBAsync(completeURL, image);
            }
            // If the texture is not in the DB and we've reached the DB quota limit
            // let's load it directly from the web
            else {
                image.src = url;
            }
        };
        if (!this._mustUpdateRessources) {
            this._loadImageFromDBAsync(completeURL, image, saveAndLoadImage);
        }
        // First time we're download the images or update requested in the manifest file by a version change
        else {
            saveAndLoadImage();
        }
    }
    _loadImageFromDBAsync(url, image, notInDBCallback) {
        if (this._isSupported && this._db !== null) {
            let texture;
            const transaction = this._db.transaction(["textures"]);
            transaction.onabort = () => {
                image.src = url;
            };
            transaction.oncomplete = () => {
                let blobTextureURL;
                if (texture && typeof URL === "function") {
                    blobTextureURL = URL.createObjectURL(texture.data);
                    image.onerror = () => {
                        logger/* Logger */.V.Error("Error loading image from blob URL: " + blobTextureURL + " switching back to web url: " + url);
                        image.src = url;
                    };
                    image.src = blobTextureURL;
                }
                else {
                    notInDBCallback();
                }
            };
            const getRequest = transaction.objectStore("textures").get(url);
            getRequest.onsuccess = (event) => {
                texture = event.target.result;
            };
            getRequest.onerror = () => {
                logger/* Logger */.V.Error("Error loading texture " + url + " from DB.");
                image.src = url;
            };
        }
        else {
            logger/* Logger */.V.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open.");
            image.src = url;
        }
    }
    _saveImageIntoDBAsync(url, image) {
        let blob;
        if (this._isSupported) {
            // In case of error (type not supported or quota exceeded), we're at least sending back XHR data to allow texture loading later on
            const generateBlobUrl = () => {
                let blobTextureURL;
                if (blob && typeof URL === "function") {
                    try {
                        blobTextureURL = URL.createObjectURL(blob);
                    }
                    catch (ex) {
                        // Chrome is raising a type error if we're setting the oneTimeOnly parameter
                        blobTextureURL = URL.createObjectURL(blob);
                    }
                }
                if (blobTextureURL) {
                    image.src = blobTextureURL;
                }
            };
            if (Database._IsUASupportingBlobStorage) {
                // Create XHR
                const xhr = new webRequest/* WebRequest */.u();
                xhr.open("GET", url);
                xhr.responseType = "blob";
                xhr.addEventListener("load", () => {
                    if (xhr.status === 200 && this._db) {
                        // Blob as response
                        blob = xhr.response;
                        const transaction = this._db.transaction(["textures"], "readwrite");
                        // the transaction could abort because of a QuotaExceededError error
                        transaction.onabort = (event) => {
                            try {
                                //backwards compatibility with ts 1.0, srcElement doesn't have an "error" according to ts 1.3
                                const srcElement = event.target;
                                const error = srcElement.error;
                                if (error && error.name === "QuotaExceededError") {
                                    this._hasReachedQuota = true;
                                }
                            }
                            catch (ex) { }
                            generateBlobUrl();
                        };
                        transaction.oncomplete = () => {
                            generateBlobUrl();
                        };
                        const newTexture = { textureUrl: url, data: blob };
                        try {
                            // Put the blob into the dabase
                            const addRequest = transaction.objectStore("textures").put(newTexture);
                            addRequest.onsuccess = () => { };
                            addRequest.onerror = () => {
                                generateBlobUrl();
                            };
                        }
                        catch (ex) {
                            // "DataCloneError" generated by Chrome when you try to inject blob into IndexedDB
                            if (ex.code === 25) {
                                Database._IsUASupportingBlobStorage = false;
                                this._enableTexturesOffline = false;
                            }
                            image.src = url;
                        }
                    }
                    else {
                        image.src = url;
                    }
                }, false);
                xhr.addEventListener("error", () => {
                    logger/* Logger */.V.Error("Error in XHR request in BABYLON.Database.");
                    image.src = url;
                }, false);
                xhr.send();
            }
            else {
                image.src = url;
            }
        }
        else {
            logger/* Logger */.V.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open.");
            image.src = url;
        }
    }
    _checkVersionFromDB(url, versionLoaded) {
        const updateVersion = () => {
            // the version is not yet in the DB or we need to update it
            this._saveVersionIntoDBAsync(url, versionLoaded);
        };
        this._loadVersionFromDBAsync(url, versionLoaded, updateVersion);
    }
    _loadVersionFromDBAsync(url, callback, updateInDBCallback) {
        if (this._isSupported && this._db) {
            let version;
            try {
                const transaction = this._db.transaction(["versions"]);
                transaction.oncomplete = () => {
                    if (version) {
                        // If the version in the JSON file is different from the version in DB
                        if (this._manifestVersionFound !== version.data) {
                            this._mustUpdateRessources = true;
                            updateInDBCallback();
                        }
                        else {
                            callback(version.data);
                        }
                    }
                    // version was not found in DB
                    else {
                        this._mustUpdateRessources = true;
                        updateInDBCallback();
                    }
                };
                transaction.onabort = () => {
                    callback(-1);
                };
                const getRequest = transaction.objectStore("versions").get(url);
                getRequest.onsuccess = (event) => {
                    version = event.target.result;
                };
                getRequest.onerror = () => {
                    logger/* Logger */.V.Error("Error loading version for scene " + url + " from DB.");
                    callback(-1);
                };
            }
            catch (ex) {
                logger/* Logger */.V.Error("Error while accessing 'versions' object store (READ OP). Exception: " + ex.message);
                callback(-1);
            }
        }
        else {
            logger/* Logger */.V.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open.");
            callback(-1);
        }
    }
    _saveVersionIntoDBAsync(url, callback) {
        if (this._isSupported && !this._hasReachedQuota && this._db) {
            try {
                // Open a transaction to the database
                const transaction = this._db.transaction(["versions"], "readwrite");
                // the transaction could abort because of a QuotaExceededError error
                transaction.onabort = (event) => {
                    try {
                        //backwards compatibility with ts 1.0, srcElement doesn't have an "error" according to ts 1.3
                        const error = event.target["error"];
                        if (error && error.name === "QuotaExceededError") {
                            this._hasReachedQuota = true;
                        }
                    }
                    catch (ex) { }
                    callback(-1);
                };
                transaction.oncomplete = () => {
                    callback(this._manifestVersionFound);
                };
                const newVersion = { sceneUrl: url, data: this._manifestVersionFound };
                // Put the scene into the database
                const addRequest = transaction.objectStore("versions").put(newVersion);
                addRequest.onsuccess = () => { };
                addRequest.onerror = () => {
                    logger/* Logger */.V.Error("Error in DB add version request in BABYLON.Database.");
                };
            }
            catch (ex) {
                logger/* Logger */.V.Error("Error while accessing 'versions' object store (WRITE OP). Exception: " + ex.message);
                callback(-1);
            }
        }
        else {
            callback(-1);
        }
    }
    /**
     * Loads a file from database
     * @param url defines the URL to load from
     * @param sceneLoaded defines a callback to call on success
     * @param progressCallBack defines a callback to call when progress changed
     * @param errorCallback defines a callback to call on error
     * @param useArrayBuffer defines a boolean to use array buffer instead of text string
     */
    loadFile(url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer) {
        const completeUrl = Database._ReturnFullUrlLocation(url);
        const saveAndLoadFile = () => {
            // the scene is not yet in the DB, let's try to save it
            this._saveFileAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback);
        };
        this._checkVersionFromDB(completeUrl, (version) => {
            if (version !== -1) {
                if (!this._mustUpdateRessources) {
                    this._loadFileAsync(completeUrl, sceneLoaded, saveAndLoadFile, progressCallBack);
                }
                else {
                    this._saveFileAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback);
                }
            }
            else {
                if (errorCallback) {
                    errorCallback();
                }
            }
        });
    }
    _loadFileAsync(url, callback, notInDBCallback, progressCallBack) {
        if (this._isSupported && this._db) {
            let targetStore;
            if (url.indexOf(".babylon") !== -1) {
                targetStore = "scenes";
            }
            else {
                targetStore = "textures";
            }
            let file;
            const transaction = this._db.transaction([targetStore]);
            transaction.oncomplete = () => {
                if (file) {
                    if (progressCallBack) {
                        const numberToLoad = file.data?.byteLength || 0;
                        progressCallBack({
                            total: numberToLoad,
                            loaded: numberToLoad,
                            lengthComputable: true,
                        });
                    }
                    callback(file.data);
                }
                // file was not found in DB
                else {
                    notInDBCallback();
                }
            };
            transaction.onabort = () => {
                notInDBCallback();
            };
            const getRequest = transaction.objectStore(targetStore).get(url);
            getRequest.onsuccess = (event) => {
                file = event.target.result;
            };
            getRequest.onerror = () => {
                logger/* Logger */.V.Error("Error loading file " + url + " from DB.");
                notInDBCallback();
            };
        }
        else {
            logger/* Logger */.V.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open.");
            callback();
        }
    }
    _saveFileAsync(url, callback, progressCallback, useArrayBuffer, errorCallback) {
        if (this._isSupported) {
            let targetStore;
            if (url.indexOf(".babylon") !== -1) {
                targetStore = "scenes";
            }
            else {
                targetStore = "textures";
            }
            // Create XHR
            const xhr = new webRequest/* WebRequest */.u();
            let fileData;
            xhr.open("GET", url + (url.match(/\?/) == null ? "?" : "&") + Date.now());
            if (useArrayBuffer) {
                xhr.responseType = "arraybuffer";
            }
            if (progressCallback) {
                xhr.onprogress = progressCallback;
            }
            xhr.addEventListener("load", () => {
                if (xhr.status === 200 || (xhr.status < 400 && Database._ValidateXHRData(xhr, !useArrayBuffer ? 1 : 6))) {
                    // Blob as response
                    fileData = !useArrayBuffer ? xhr.responseText : xhr.response;
                    if (!this._hasReachedQuota && this._db) {
                        // Open a transaction to the database
                        const transaction = this._db.transaction([targetStore], "readwrite");
                        // the transaction could abort because of a QuotaExceededError error
                        transaction.onabort = (event) => {
                            try {
                                //backwards compatibility with ts 1.0, srcElement doesn't have an "error" according to ts 1.3
                                const error = event.target["error"];
                                if (error && error.name === "QuotaExceededError") {
                                    this._hasReachedQuota = true;
                                }
                            }
                            catch (ex) { }
                            callback(fileData);
                        };
                        transaction.oncomplete = () => {
                            callback(fileData);
                        };
                        let newFile;
                        if (targetStore === "scenes") {
                            newFile = { sceneUrl: url, data: fileData, version: this._manifestVersionFound };
                        }
                        else {
                            newFile = { textureUrl: url, data: fileData };
                        }
                        try {
                            // Put the scene into the database
                            const addRequest = transaction.objectStore(targetStore).put(newFile);
                            addRequest.onsuccess = () => { };
                            addRequest.onerror = () => {
                                logger/* Logger */.V.Error("Error in DB add file request in BABYLON.Database.");
                            };
                        }
                        catch (ex) {
                            callback(fileData);
                        }
                    }
                    else {
                        callback(fileData);
                    }
                }
                else {
                    if (xhr.status >= 400 && errorCallback) {
                        errorCallback(xhr);
                    }
                    else {
                        callback();
                    }
                }
            }, false);
            xhr.addEventListener("error", () => {
                logger/* Logger */.V.Error("error on XHR request.");
                errorCallback && errorCallback();
            }, false);
            xhr.send();
        }
        else {
            logger/* Logger */.V.Error("Error: IndexedDB not supported by your browser or Babylon.js database is not open.");
            errorCallback && errorCallback();
        }
    }
    /**
     * Validates if xhr data is correct
     * @param xhr defines the request to validate
     * @param dataType defines the expected data type
     * @returns true if data is correct
     */
    static _ValidateXHRData(xhr, dataType = 7) {
        // 1 for text (.babylon, manifest and shaders), 2 for TGA, 4 for DDS, 7 for all
        try {
            if (dataType & 1) {
                if (xhr.responseText && xhr.responseText.length > 0) {
                    return true;
                }
                else if (dataType === 1) {
                    return false;
                }
            }
            if (dataType & 2) {
                // Check header width and height since there is no "TGA" magic number
                const tgaHeader = (0,tga/* GetTGAHeader */.O_)(xhr.response);
                if (tgaHeader.width && tgaHeader.height && tgaHeader.width > 0 && tgaHeader.height > 0) {
                    return true;
                }
                else if (dataType === 2) {
                    return false;
                }
            }
            if (dataType & 4) {
                // Check for the "DDS" magic number
                const ddsHeader = new Uint8Array(xhr.response, 0, 3);
                if (ddsHeader[0] === 68 && ddsHeader[1] === 68 && ddsHeader[2] === 83) {
                    return true;
                }
                else {
                    return false;
                }
            }
        }
        catch (e) {
            // Global protection
        }
        return false;
    }
}
/** Gets a boolean indicating if the user agent supports blob storage (this value will be updated after creating the first Database object) */
Database._IsUASupportingBlobStorage = true;
/**
 * Gets a boolean indicating if Database storage is enabled (off by default)
 */
Database.IDBStorageEnabled = false;
Database._ParseURL = (url) => {
    const a = document.createElement("a");
    a.href = url;
    const urlWithoutHash = url.substring(0, url.lastIndexOf("#"));
    const fileName = url.substring(urlWithoutHash.lastIndexOf("/") + 1, url.length);
    const absLocation = url.substring(0, url.indexOf(fileName, 0));
    return absLocation;
};
Database._ReturnFullUrlLocation = (url) => {
    if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1 && typeof window !== "undefined") {
        return Database._ParseURL(window.location.href) + url;
    }
    else {
        return url;
    }
};
//# sourceMappingURL=database.js.map
;// ./node_modules/@babylonjs/core/Offline/IOfflineProvider.js

//# sourceMappingURL=IOfflineProvider.js.map
;// ./node_modules/@babylonjs/core/Offline/index.js


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/IParticleEmitterType.js

//# sourceMappingURL=IParticleEmitterType.js.map
;// ./node_modules/@babylonjs/core/Particles/EmitterTypes/index.js









//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Materials/uniformBufferEffectCommonAccessor.js
/** @internal */
class UniformBufferEffectCommonAccessor {
    _isUbo(uboOrEffect) {
        return uboOrEffect.addUniform !== undefined;
    }
    constructor(uboOrEffect) {
        if (this._isUbo(uboOrEffect)) {
            this.setMatrix3x3 = uboOrEffect.updateMatrix3x3.bind(uboOrEffect);
            this.setMatrix2x2 = uboOrEffect.updateMatrix2x2.bind(uboOrEffect);
            this.setFloat = uboOrEffect.updateFloat.bind(uboOrEffect);
            this.setFloat2 = uboOrEffect.updateFloat2.bind(uboOrEffect);
            this.setFloat3 = uboOrEffect.updateFloat3.bind(uboOrEffect);
            this.setFloat4 = uboOrEffect.updateFloat4.bind(uboOrEffect);
            this.setFloatArray = uboOrEffect.updateFloatArray.bind(uboOrEffect);
            this.setArray = uboOrEffect.updateArray.bind(uboOrEffect);
            this.setIntArray = uboOrEffect.updateIntArray.bind(uboOrEffect);
            this.setMatrix = uboOrEffect.updateMatrix.bind(uboOrEffect);
            this.setMatrices = uboOrEffect.updateMatrices.bind(uboOrEffect);
            this.setVector3 = uboOrEffect.updateVector3.bind(uboOrEffect);
            this.setVector4 = uboOrEffect.updateVector4.bind(uboOrEffect);
            this.setColor3 = uboOrEffect.updateColor3.bind(uboOrEffect);
            this.setColor4 = uboOrEffect.updateColor4.bind(uboOrEffect);
            this.setDirectColor4 = uboOrEffect.updateDirectColor4.bind(uboOrEffect);
            this.setInt = uboOrEffect.updateInt.bind(uboOrEffect);
            this.setInt2 = uboOrEffect.updateInt2.bind(uboOrEffect);
            this.setInt3 = uboOrEffect.updateInt3.bind(uboOrEffect);
            this.setInt4 = uboOrEffect.updateInt4.bind(uboOrEffect);
        }
        else {
            this.setMatrix3x3 = uboOrEffect.setMatrix3x3.bind(uboOrEffect);
            this.setMatrix2x2 = uboOrEffect.setMatrix2x2.bind(uboOrEffect);
            this.setFloat = uboOrEffect.setFloat.bind(uboOrEffect);
            this.setFloat2 = uboOrEffect.setFloat2.bind(uboOrEffect);
            this.setFloat3 = uboOrEffect.setFloat3.bind(uboOrEffect);
            this.setFloat4 = uboOrEffect.setFloat4.bind(uboOrEffect);
            this.setFloatArray = uboOrEffect.setFloatArray.bind(uboOrEffect);
            this.setArray = uboOrEffect.setArray.bind(uboOrEffect);
            this.setIntArray = uboOrEffect.setIntArray.bind(uboOrEffect);
            this.setMatrix = uboOrEffect.setMatrix.bind(uboOrEffect);
            this.setMatrices = uboOrEffect.setMatrices.bind(uboOrEffect);
            this.setVector3 = uboOrEffect.setVector3.bind(uboOrEffect);
            this.setVector4 = uboOrEffect.setVector4.bind(uboOrEffect);
            this.setColor3 = uboOrEffect.setColor3.bind(uboOrEffect);
            this.setColor4 = uboOrEffect.setColor4.bind(uboOrEffect);
            this.setDirectColor4 = uboOrEffect.setDirectColor4.bind(uboOrEffect);
            this.setInt = uboOrEffect.setInt.bind(uboOrEffect);
            this.setInt2 = uboOrEffect.setInt2.bind(uboOrEffect);
            this.setInt3 = uboOrEffect.setInt3.bind(uboOrEffect);
            this.setInt4 = uboOrEffect.setInt4.bind(uboOrEffect);
        }
    }
}
//# sourceMappingURL=uniformBufferEffectCommonAccessor.js.map
;// ./node_modules/@babylonjs/core/Shaders/gpuUpdateParticles.fragment.js
// Do not edit.

const gpuUpdateParticles_fragment_name = "gpuUpdateParticlesPixelShader";
const gpuUpdateParticles_fragment_shader = `#version 300 es
void main() {discard;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[gpuUpdateParticles_fragment_name] = gpuUpdateParticles_fragment_shader;
/** @internal */
const gpuUpdateParticlesPixelShader = { name: gpuUpdateParticles_fragment_name, shader: gpuUpdateParticles_fragment_shader };
//# sourceMappingURL=gpuUpdateParticles.fragment.js.map
;// ./node_modules/@babylonjs/core/Shaders/gpuUpdateParticles.vertex.js
// Do not edit.

const gpuUpdateParticles_vertex_name = "gpuUpdateParticlesVertexShader";
const gpuUpdateParticles_vertex_shader = `#version 300 es
#define PI 3.14159
uniform float currentCount;uniform float timeDelta;uniform float stopFactor;
#ifndef LOCAL
uniform mat4 emitterWM;
#endif
uniform vec2 lifeTime;uniform vec2 emitPower;uniform vec2 sizeRange;uniform vec4 scaleRange;
#ifndef COLORGRADIENTS
uniform vec4 color1;uniform vec4 color2;
#endif
uniform vec3 gravity;uniform sampler2D randomSampler;uniform sampler2D randomSampler2;uniform vec4 angleRange;
#ifdef BOXEMITTER
uniform vec3 direction1;uniform vec3 direction2;uniform vec3 minEmitBox;uniform vec3 maxEmitBox;
#endif
#ifdef POINTEMITTER
uniform vec3 direction1;uniform vec3 direction2;
#endif
#ifdef HEMISPHERICEMITTER
uniform float radius;uniform float radiusRange;uniform float directionRandomizer;
#endif
#ifdef SPHEREEMITTER
uniform float radius;uniform float radiusRange;
#ifdef DIRECTEDSPHEREEMITTER
uniform vec3 direction1;uniform vec3 direction2;
#else
uniform float directionRandomizer;
#endif
#endif
#ifdef CYLINDEREMITTER
uniform float radius;uniform float height;uniform float radiusRange;
#ifdef DIRECTEDCYLINDEREMITTER
uniform vec3 direction1;uniform vec3 direction2;
#else
uniform float directionRandomizer;
#endif
#endif
#ifdef CONEEMITTER
uniform vec2 radius;uniform float coneAngle;uniform vec2 height;
#ifdef DIRECTEDCONEEMITTER
uniform vec3 direction1;uniform vec3 direction2;
#else
uniform float directionRandomizer;
#endif
#endif
in vec3 position;
#ifdef CUSTOMEMITTER
in vec3 initialPosition;
#endif
in float age;in float life;in vec4 seed;in vec3 size;
#ifndef COLORGRADIENTS
in vec4 color;
#endif
in vec3 direction;
#ifndef BILLBOARD
in vec3 initialDirection;
#endif
#ifdef ANGULARSPEEDGRADIENTS
in float angle;
#else
in vec2 angle;
#endif
#ifdef ANIMATESHEET
in float cellIndex;
#ifdef ANIMATESHEETRANDOMSTART
in float cellStartOffset;
#endif
#endif
#ifdef NOISE
in vec3 noiseCoordinates1;in vec3 noiseCoordinates2;
#endif
out vec3 outPosition;
#ifdef CUSTOMEMITTER
out vec3 outInitialPosition;
#endif
out float outAge;out float outLife;out vec4 outSeed;out vec3 outSize;
#ifndef COLORGRADIENTS
out vec4 outColor;
#endif
out vec3 outDirection;
#ifndef BILLBOARD
out vec3 outInitialDirection;
#endif
#ifdef ANGULARSPEEDGRADIENTS
out float outAngle;
#else
out vec2 outAngle;
#endif
#ifdef ANIMATESHEET
out float outCellIndex;
#ifdef ANIMATESHEETRANDOMSTART
out float outCellStartOffset;
#endif
#endif
#ifdef NOISE
out vec3 outNoiseCoordinates1;out vec3 outNoiseCoordinates2;
#endif
#ifdef SIZEGRADIENTS
uniform sampler2D sizeGradientSampler;
#endif 
#ifdef ANGULARSPEEDGRADIENTS
uniform sampler2D angularSpeedGradientSampler;
#endif 
#ifdef VELOCITYGRADIENTS
uniform sampler2D velocityGradientSampler;
#endif
#ifdef LIMITVELOCITYGRADIENTS
uniform sampler2D limitVelocityGradientSampler;uniform float limitVelocityDamping;
#endif
#ifdef DRAGGRADIENTS
uniform sampler2D dragGradientSampler;
#endif
#ifdef NOISE
uniform vec3 noiseStrength;uniform sampler2D noiseSampler;
#endif
#ifdef ANIMATESHEET
uniform vec4 cellInfos;
#endif
vec3 getRandomVec3(float offset) {return texture(randomSampler2,vec2(float(gl_VertexID)*offset/currentCount,0)).rgb;}
vec4 getRandomVec4(float offset) {return texture(randomSampler,vec2(float(gl_VertexID)*offset/currentCount,0));}
void main() {float newAge=age+timeDelta; 
if (newAge>=life && stopFactor != 0.) {vec3 newPosition;vec3 newDirection;vec4 randoms=getRandomVec4(seed.x);outLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;outAge=newAge-life;outSeed=seed;
#ifdef SIZEGRADIENTS 
outSize.x=texture(sizeGradientSampler,vec2(0,0)).r;
#else
outSize.x=sizeRange.x+(sizeRange.y-sizeRange.x)*randoms.g;
#endif
outSize.y=scaleRange.x+(scaleRange.y-scaleRange.x)*randoms.b;outSize.z=scaleRange.z+(scaleRange.w-scaleRange.z)*randoms.a; 
#ifndef COLORGRADIENTS
outColor=color1+(color2-color1)*randoms.b;
#endif
#ifndef ANGULARSPEEDGRADIENTS 
outAngle.y=angleRange.x+(angleRange.y-angleRange.x)*randoms.a;outAngle.x=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;
#else
outAngle=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;
#endif 
#ifdef POINTEMITTER
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);newPosition=vec3(0,0,0);newDirection=direction1+(direction2-direction1)*randoms3;
#elif defined(BOXEMITTER)
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);newPosition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;newDirection=direction1+(direction2-direction1)*randoms3; 
#elif defined(HEMISPHERICEMITTER)
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);float phi=2.0*PI*randoms2.x;float theta=acos(2.0*randoms2.y-1.0);float randX=cos(phi)*sin(theta);float randY=cos(theta);float randZ=sin(phi)*sin(theta);newPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);newDirection=newPosition+directionRandomizer*randoms3; 
#elif defined(SPHEREEMITTER)
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);float phi=2.0*PI*randoms2.x;float theta=acos(2.0*randoms2.y-1.0);float randX=cos(phi)*sin(theta);float randY=cos(theta);float randZ=sin(phi)*sin(theta);newPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);
#ifdef DIRECTEDSPHEREEMITTER
newDirection=normalize(direction1+(direction2-direction1)*randoms3);
#else
newDirection=normalize(newPosition+directionRandomizer*randoms3);
#endif
#elif defined(CYLINDEREMITTER)
vec3 randoms2=getRandomVec3(seed.y);vec3 randoms3=getRandomVec3(seed.z);float yPos=(randoms2.x-0.5)*height;float angle=randoms2.y*PI*2.;float inverseRadiusRangeSquared=((1.-radiusRange)*(1.-radiusRange));float positionRadius=radius*sqrt(inverseRadiusRangeSquared+(randoms2.z*(1.-inverseRadiusRangeSquared)));float xPos=positionRadius*cos(angle);float zPos=positionRadius*sin(angle);newPosition=vec3(xPos,yPos,zPos);
#ifdef DIRECTEDCYLINDEREMITTER
newDirection=direction1+(direction2-direction1)*randoms3;
#else
angle=angle+((randoms3.x-0.5)*PI)*directionRandomizer;newDirection=vec3(cos(angle),(randoms3.y-0.5)*directionRandomizer,sin(angle));newDirection=normalize(newDirection);
#endif
#elif defined(CONEEMITTER)
vec3 randoms2=getRandomVec3(seed.y);float s=2.0*PI*randoms2.x;
#ifdef CONEEMITTERSPAWNPOINT
float h=0.0001;
#else
float h=randoms2.y*height.y;h=1.-h*h; 
#endif
float lRadius=radius.x-radius.x*randoms2.z*radius.y;lRadius=lRadius*h;float randX=lRadius*sin(s);float randZ=lRadius*cos(s);float randY=h *height.x;newPosition=vec3(randX,randY,randZ); 
vec3 randoms3=getRandomVec3(seed.z);
#ifdef DIRECTEDCONEEMITTER
newDirection=direction1+(direction2-direction1)*randoms3;
#else
if (abs(cos(coneAngle))==1.0) {newDirection=vec3(0.,1.0,0.);} else {newDirection=normalize(newPosition+directionRandomizer*randoms3); }
#endif
#elif defined(CUSTOMEMITTER)
newPosition=initialPosition;outInitialPosition=initialPosition;
#else 
newPosition=vec3(0.,0.,0.);newDirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));
#endif
float power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;
#ifdef LOCAL
outPosition=newPosition;
#else
outPosition=(emitterWM*vec4(newPosition,1.)).xyz;
#endif
#ifdef CUSTOMEMITTER
outDirection=direction;
#ifndef BILLBOARD 
outInitialDirection=direction;
#endif
#else
#ifdef LOCAL
vec3 initial=newDirection;
#else 
vec3 initial=(emitterWM*vec4(newDirection,0.)).xyz;
#endif
outDirection=initial*power;
#ifndef BILLBOARD 
outInitialDirection=initial;
#endif
#endif
#ifdef ANIMATESHEET 
outCellIndex=cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
outCellStartOffset=randoms.a*outLife;
#endif 
#endif
#ifdef NOISE
outNoiseCoordinates1=noiseCoordinates1;outNoiseCoordinates2=noiseCoordinates2;
#endif
} else {float directionScale=timeDelta;outAge=newAge;float ageGradient=newAge/life;
#ifdef VELOCITYGRADIENTS
directionScale*=texture(velocityGradientSampler,vec2(ageGradient,0)).r;
#endif
#ifdef DRAGGRADIENTS
directionScale*=1.0-texture(dragGradientSampler,vec2(ageGradient,0)).r;
#endif
#if defined(CUSTOMEMITTER)
outPosition=position+(direction-position)*ageGradient; 
outInitialPosition=initialPosition;
#else
outPosition=position+direction*directionScale;
#endif
outLife=life;outSeed=seed;
#ifndef COLORGRADIENTS 
outColor=color;
#endif
#ifdef SIZEGRADIENTS
outSize.x=texture(sizeGradientSampler,vec2(ageGradient,0)).r;outSize.yz=size.yz;
#else
outSize=size;
#endif 
#ifndef BILLBOARD 
outInitialDirection=initialDirection;
#endif
#ifdef CUSTOMEMITTER
outDirection=direction;
#else
vec3 updatedDirection=direction+gravity*timeDelta;
#ifdef LIMITVELOCITYGRADIENTS
float limitVelocity=texture(limitVelocityGradientSampler,vec2(ageGradient,0)).r;float currentVelocity=length(updatedDirection);if (currentVelocity>limitVelocity) {updatedDirection=updatedDirection*limitVelocityDamping;}
#endif
outDirection=updatedDirection;
#ifdef NOISE
float fetchedR=texture(noiseSampler,vec2(noiseCoordinates1.x,noiseCoordinates1.y)*vec2(0.5)+vec2(0.5)).r;float fetchedG=texture(noiseSampler,vec2(noiseCoordinates1.z,noiseCoordinates2.x)*vec2(0.5)+vec2(0.5)).r;float fetchedB=texture(noiseSampler,vec2(noiseCoordinates2.y,noiseCoordinates2.z)*vec2(0.5)+vec2(0.5)).r;vec3 force=vec3(2.*fetchedR-1.,2.*fetchedG-1.,2.*fetchedB-1.)*noiseStrength;outDirection=outDirection+force*timeDelta;outNoiseCoordinates1=noiseCoordinates1;outNoiseCoordinates2=noiseCoordinates2;
#endif 
#endif 
#ifdef ANGULARSPEEDGRADIENTS
float angularSpeed=texture(angularSpeedGradientSampler,vec2(ageGradient,0)).r;outAngle=angle+angularSpeed*timeDelta;
#else
outAngle=vec2(angle.x+angle.y*timeDelta,angle.y);
#endif
#ifdef ANIMATESHEET 
float offsetAge=outAge;float dist=cellInfos.y-cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
outCellStartOffset=cellStartOffset;offsetAge+=cellStartOffset;
#else
float cellStartOffset=0.;
#endif 
float ratio=0.;if (cellInfos.w==1.0) {ratio=clamp(mod(cellStartOffset+cellInfos.z*offsetAge,life)/life,0.,1.0);}
else {ratio=clamp(cellStartOffset+cellInfos.z*offsetAge/life,0.,1.0);}
outCellIndex=float(int(cellInfos.x+ratio*dist));
#endif
}}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[gpuUpdateParticles_vertex_name] = gpuUpdateParticles_vertex_shader;
/** @internal */
const gpuUpdateParticlesVertexShader = { name: gpuUpdateParticles_vertex_name, shader: gpuUpdateParticles_vertex_shader };
//# sourceMappingURL=gpuUpdateParticles.vertex.js.map
;// ./node_modules/@babylonjs/core/Particles/webgl2ParticleSystem.js







/** @internal */
class WebGL2ParticleSystem {
    constructor(parent, engine) {
        this._renderVAO = [];
        this._updateVAO = [];
        this.alignDataInBuffer = false;
        this._parent = parent;
        this._engine = engine;
        this._updateEffectOptions = {
            attributes: [
                "position",
                "initialPosition",
                "age",
                "life",
                "seed",
                "size",
                "color",
                "direction",
                "initialDirection",
                "angle",
                "cellIndex",
                "cellStartOffset",
                "noiseCoordinates1",
                "noiseCoordinates2",
            ],
            uniformsNames: [
                "currentCount",
                "timeDelta",
                "emitterWM",
                "lifeTime",
                "color1",
                "color2",
                "sizeRange",
                "scaleRange",
                "gravity",
                "emitPower",
                "direction1",
                "direction2",
                "minEmitBox",
                "maxEmitBox",
                "radius",
                "directionRandomizer",
                "height",
                "coneAngle",
                "stopFactor",
                "angleRange",
                "radiusRange",
                "cellInfos",
                "noiseStrength",
                "limitVelocityDamping",
            ],
            uniformBuffersNames: [],
            samplers: [
                "randomSampler",
                "randomSampler2",
                "sizeGradientSampler",
                "angularSpeedGradientSampler",
                "velocityGradientSampler",
                "limitVelocityGradientSampler",
                "noiseSampler",
                "dragGradientSampler",
            ],
            defines: "",
            fallbacks: null,
            onCompiled: null,
            onError: null,
            indexParameters: null,
            maxSimultaneousLights: 0,
            transformFeedbackVaryings: [],
        };
    }
    contextLost() {
        this._updateEffect = undefined;
        this._renderVAO.length = 0;
        this._updateVAO.length = 0;
    }
    isUpdateBufferCreated() {
        return !!this._updateEffect;
    }
    isUpdateBufferReady() {
        return this._updateEffect?.isReady() ?? false;
    }
    createUpdateBuffer(defines) {
        this._updateEffectOptions.transformFeedbackVaryings = ["outPosition"];
        this._updateEffectOptions.transformFeedbackVaryings.push("outAge");
        this._updateEffectOptions.transformFeedbackVaryings.push("outSize");
        this._updateEffectOptions.transformFeedbackVaryings.push("outLife");
        this._updateEffectOptions.transformFeedbackVaryings.push("outSeed");
        this._updateEffectOptions.transformFeedbackVaryings.push("outDirection");
        if (this._parent.particleEmitterType instanceof CustomParticleEmitter) {
            this._updateEffectOptions.transformFeedbackVaryings.push("outInitialPosition");
        }
        if (!this._parent._colorGradientsTexture) {
            this._updateEffectOptions.transformFeedbackVaryings.push("outColor");
        }
        if (!this._parent._isBillboardBased) {
            this._updateEffectOptions.transformFeedbackVaryings.push("outInitialDirection");
        }
        if (this._parent.noiseTexture) {
            this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates1");
            this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates2");
        }
        this._updateEffectOptions.transformFeedbackVaryings.push("outAngle");
        if (this._parent.isAnimationSheetEnabled) {
            this._updateEffectOptions.transformFeedbackVaryings.push("outCellIndex");
            if (this._parent.spriteRandomStartCell) {
                this._updateEffectOptions.transformFeedbackVaryings.push("outCellStartOffset");
            }
        }
        this._updateEffectOptions.defines = defines;
        this._updateEffect = new Materials_effect/* Effect */.M("gpuUpdateParticles", this._updateEffectOptions, this._engine);
        return new UniformBufferEffectCommonAccessor(this._updateEffect);
    }
    createVertexBuffers(updateBuffer, renderVertexBuffers) {
        this._updateVAO.push(this._createUpdateVAO(updateBuffer));
        this._renderVAO.push(this._engine.recordVertexArrayObject(renderVertexBuffers, null, this._parent._getWrapper(this._parent.blendMode).effect));
        this._engine.bindArrayBuffer(null);
        this._renderVertexBuffers = renderVertexBuffers;
    }
    createParticleBuffer(data) {
        return data;
    }
    bindDrawBuffers(index, effect, indexBuffer) {
        if (indexBuffer) {
            this._engine.bindBuffers(this._renderVertexBuffers, indexBuffer, effect);
        }
        else {
            this._engine.bindVertexArrayObject(this._renderVAO[index], null);
        }
    }
    preUpdateParticleBuffer() {
        const engine = this._engine;
        this._engine.enableEffect(this._updateEffect);
        if (!engine.setState) {
            throw new Error("GPU particles cannot work without a full Engine. ThinEngine is not supported");
        }
    }
    updateParticleBuffer(index, targetBuffer, currentActiveCount) {
        this._updateEffect.setTexture("randomSampler", this._parent._randomTexture);
        this._updateEffect.setTexture("randomSampler2", this._parent._randomTexture2);
        if (this._parent._sizeGradientsTexture) {
            this._updateEffect.setTexture("sizeGradientSampler", this._parent._sizeGradientsTexture);
        }
        if (this._parent._angularSpeedGradientsTexture) {
            this._updateEffect.setTexture("angularSpeedGradientSampler", this._parent._angularSpeedGradientsTexture);
        }
        if (this._parent._velocityGradientsTexture) {
            this._updateEffect.setTexture("velocityGradientSampler", this._parent._velocityGradientsTexture);
        }
        if (this._parent._limitVelocityGradientsTexture) {
            this._updateEffect.setTexture("limitVelocityGradientSampler", this._parent._limitVelocityGradientsTexture);
        }
        if (this._parent._dragGradientsTexture) {
            this._updateEffect.setTexture("dragGradientSampler", this._parent._dragGradientsTexture);
        }
        if (this._parent.noiseTexture) {
            this._updateEffect.setTexture("noiseSampler", this._parent.noiseTexture);
        }
        // Bind source VAO
        this._engine.bindVertexArrayObject(this._updateVAO[index], null);
        // Update
        const engine = this._engine;
        engine.bindTransformFeedbackBuffer(targetBuffer.getBuffer());
        engine.setRasterizerState(false);
        engine.beginTransformFeedback(true);
        engine.drawArraysType(3, 0, currentActiveCount);
        engine.endTransformFeedback();
        engine.setRasterizerState(true);
        engine.bindTransformFeedbackBuffer(null);
    }
    releaseBuffers() { }
    releaseVertexBuffers() {
        for (let index = 0; index < this._updateVAO.length; index++) {
            this._engine.releaseVertexArrayObject(this._updateVAO[index]);
        }
        this._updateVAO.length = 0;
        for (let index = 0; index < this._renderVAO.length; index++) {
            this._engine.releaseVertexArrayObject(this._renderVAO[index]);
        }
        this._renderVAO.length = 0;
    }
    _createUpdateVAO(source) {
        const updateVertexBuffers = {};
        updateVertexBuffers["position"] = source.createVertexBuffer("position", 0, 3);
        let offset = 3;
        updateVertexBuffers["age"] = source.createVertexBuffer("age", offset, 1);
        offset += 1;
        updateVertexBuffers["size"] = source.createVertexBuffer("size", offset, 3);
        offset += 3;
        updateVertexBuffers["life"] = source.createVertexBuffer("life", offset, 1);
        offset += 1;
        updateVertexBuffers["seed"] = source.createVertexBuffer("seed", offset, 4);
        offset += 4;
        updateVertexBuffers["direction"] = source.createVertexBuffer("direction", offset, 3);
        offset += 3;
        if (this._parent.particleEmitterType instanceof CustomParticleEmitter) {
            updateVertexBuffers["initialPosition"] = source.createVertexBuffer("initialPosition", offset, 3);
            offset += 3;
        }
        if (!this._parent._colorGradientsTexture) {
            updateVertexBuffers["color"] = source.createVertexBuffer("color", offset, 4);
            offset += 4;
        }
        if (!this._parent._isBillboardBased) {
            updateVertexBuffers["initialDirection"] = source.createVertexBuffer("initialDirection", offset, 3);
            offset += 3;
        }
        if (this._parent.noiseTexture) {
            updateVertexBuffers["noiseCoordinates1"] = source.createVertexBuffer("noiseCoordinates1", offset, 3);
            offset += 3;
            updateVertexBuffers["noiseCoordinates2"] = source.createVertexBuffer("noiseCoordinates2", offset, 3);
            offset += 3;
        }
        if (this._parent._angularSpeedGradientsTexture) {
            updateVertexBuffers["angle"] = source.createVertexBuffer("angle", offset, 1);
            offset += 1;
        }
        else {
            updateVertexBuffers["angle"] = source.createVertexBuffer("angle", offset, 2);
            offset += 2;
        }
        if (this._parent._isAnimationSheetEnabled) {
            updateVertexBuffers["cellIndex"] = source.createVertexBuffer("cellIndex", offset, 1);
            offset += 1;
            if (this._parent.spriteRandomStartCell) {
                updateVertexBuffers["cellStartOffset"] = source.createVertexBuffer("cellStartOffset", offset, 1);
                offset += 1;
            }
        }
        const vao = this._engine.recordVertexArrayObject(updateVertexBuffers, null, this._updateEffect);
        this._engine.bindArrayBuffer(null);
        return vao;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.WebGL2ParticleSystem", WebGL2ParticleSystem);
//# sourceMappingURL=webgl2ParticleSystem.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/gpuUpdateParticles.compute.js
// Do not edit.

const gpuUpdateParticles_compute_name = "gpuUpdateParticlesComputeShader";
const gpuUpdateParticles_compute_shader = `struct Particle {position : vec3<f32>,
age : f32,
size : vec3<f32>,
life : f32,
seed : vec4<f32>,
direction : vec3<f32>,
dummy0: f32,
#ifdef CUSTOMEMITTER
initialPosition : vec3<f32>,
dummy1: f32,
#endif
#ifndef COLORGRADIENTS
color : vec4<f32>,
#endif
#ifndef BILLBOARD
initialDirection : vec3<f32>,
dummy2: f32,
#endif
#ifdef NOISE
noiseCoordinates1 : vec3<f32>,
dummy3: f32,
noiseCoordinates2 : vec3<f32>,
dummy4: f32,
#endif
#ifdef ANGULARSPEEDGRADIENTS
angle : f32,
#else
angle : vec2<f32>,
#endif
#ifdef ANIMATESHEET
cellIndex : f32,
#ifdef ANIMATESHEETRANDOMSTART
cellStartOffset : f32,
#endif
#endif
};struct Particles {particles : array<Particle>,};struct SimParams {currentCount : f32,
timeDelta : f32,
stopFactor : f32,
randomTextureSize: i32,
lifeTime : vec2<f32>,
emitPower : vec2<f32>,
#ifndef COLORGRADIENTS
color1 : vec4<f32>,
color2 : vec4<f32>,
#endif
sizeRange : vec2<f32>,
scaleRange : vec4<f32>,
angleRange : vec4<f32>,
gravity : vec3<f32>,
#ifdef LIMITVELOCITYGRADIENTS
limitVelocityDamping : f32,
#endif
#ifdef ANIMATESHEET
cellInfos : vec4<f32>,
#endif
#ifdef NOISE
noiseStrength : vec3<f32>,
#endif
#ifndef LOCAL
emitterWM : mat4x4<f32>,
#endif
#ifdef BOXEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
minEmitBox : vec3<f32>,
maxEmitBox : vec3<f32>,
#endif
#ifdef CONEEMITTER
radius : vec2<f32>,
coneAngle : f32,
height : vec2<f32>,
#ifdef DIRECTEDCONEEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#else
directionRandomizer : f32,
#endif
#endif
#ifdef CYLINDEREMITTER
radius : f32,
height : f32,
radiusRange : f32,
#ifdef DIRECTEDCYLINDEREMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#else
directionRandomizer : f32,
#endif
#endif
#ifdef HEMISPHERICEMITTER
radius : f32,
radiusRange : f32,
directionRandomizer : f32,
#endif
#ifdef POINTEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#endif
#ifdef SPHEREEMITTER
radius : f32,
radiusRange : f32,
#ifdef DIRECTEDSPHEREEMITTER
direction1 : vec3<f32>,
direction2 : vec3<f32>,
#else
directionRandomizer : f32,
#endif
#endif
};@binding(0) @group(0) var<uniform> params : SimParams;@binding(1) @group(0) var<storage,read> particlesIn : Particles;@binding(2) @group(0) var<storage,read_write> particlesOut : Particles;@binding(3) @group(0) var randomTexture : texture_2d<f32>;@binding(4) @group(0) var randomTexture2 : texture_2d<f32>;
#ifdef SIZEGRADIENTS
@binding(0) @group(1) var sizeGradientSampler : sampler;@binding(1) @group(1) var sizeGradientTexture : texture_2d<f32>;
#endif 
#ifdef ANGULARSPEEDGRADIENTS
@binding(2) @group(1) var angularSpeedGradientSampler : sampler;@binding(3) @group(1) var angularSpeedGradientTexture : texture_2d<f32>;
#endif 
#ifdef VELOCITYGRADIENTS
@binding(4) @group(1) var velocityGradientSampler : sampler;@binding(5) @group(1) var velocityGradientTexture : texture_2d<f32>;
#endif
#ifdef LIMITVELOCITYGRADIENTS
@binding(6) @group(1) var limitVelocityGradientSampler : sampler;@binding(7) @group(1) var limitVelocityGradientTexture : texture_2d<f32>;
#endif
#ifdef DRAGGRADIENTS
@binding(8) @group(1) var dragGradientSampler : sampler;@binding(9) @group(1) var dragGradientTexture : texture_2d<f32>;
#endif
#ifdef NOISE
@binding(10) @group(1) var noiseSampler : sampler;@binding(11) @group(1) var noiseTexture : texture_2d<f32>;
#endif
fn getRandomVec3(offset : f32,vertexID : f32)->vec3<f32> {return textureLoad(randomTexture2,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0).rgb;}
fn getRandomVec4(offset : f32,vertexID : f32)->vec4<f32> {return textureLoad(randomTexture,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0);}
@compute @workgroup_size(64)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {let index : u32=GlobalInvocationID.x;let vertexID : f32=f32(index);if (index>=u32(params.currentCount)) {return;}
let PI : f32=3.14159;let timeDelta : f32=params.timeDelta;let newAge : f32=particlesIn.particles[index].age+timeDelta;let life : f32=particlesIn.particles[index].life;let seed : vec4<f32>=particlesIn.particles[index].seed;let direction : vec3<f32>=particlesIn.particles[index].direction;if (newAge>=life && params.stopFactor != 0.) {var newPosition : vec3<f32>;var newDirection : vec3<f32>;let randoms : vec4<f32>=getRandomVec4(seed.x,vertexID);let outLife : f32=params.lifeTime.x+(params.lifeTime.y-params.lifeTime.x)*randoms.r;particlesOut.particles[index].life=outLife;particlesOut.particles[index].age=newAge-life;particlesOut.particles[index].seed=seed;var sizex : f32;
#ifdef SIZEGRADIENTS 
sizex=textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(0.,0.),0.).r;
#else
sizex=params.sizeRange.x+(params.sizeRange.y-params.sizeRange.x)*randoms.g;
#endif
particlesOut.particles[index].size=vec3<f32>(
sizex,
params.scaleRange.x+(params.scaleRange.y-params.scaleRange.x)*randoms.b,
params.scaleRange.z+(params.scaleRange.w-params.scaleRange.z)*randoms.a);
#ifndef COLORGRADIENTS
particlesOut.particles[index].color=params.color1+(params.color2-params.color1)*randoms.b;
#endif
#ifndef ANGULARSPEEDGRADIENTS 
particlesOut.particles[index].angle=vec2<f32>(
params.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r,
params.angleRange.x+(params.angleRange.y-params.angleRange.x)*randoms.a);
#else
particlesOut.particles[index].angle=params.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r;
#endif 
#if defined(POINTEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=vec3<f32>(0.,0.,0.);newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;
#elif defined(BOXEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=params.minEmitBox+(params.maxEmitBox-params.minEmitBox)*randoms2;newDirection=params.direction1+(params.direction2-params.direction1)*randoms3; 
#elif defined(HEMISPHERICEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,abs(randY),randZ);newDirection=normalize(newPosition+params.directionRandomizer*randoms3);
#elif defined(SPHEREEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,randY,randZ);
#ifdef DIRECTEDSPHEREEMITTER
newDirection=normalize(params.direction1+(params.direction2-params.direction1)*randoms3);
#else
newDirection=normalize(newPosition+params.directionRandomizer*randoms3);
#endif
#elif defined(CYLINDEREMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let yPos : f32=(-0.5+randoms2.x)*params.height;var angle : f32=randoms2.y*PI*2.;let inverseRadiusRangeSquared : f32=(1.-params.radiusRange)*(1.-params.radiusRange);let positionRadius : f32=params.radius*sqrt(inverseRadiusRangeSquared+randoms2.z*(1.-inverseRadiusRangeSquared));let xPos : f32=positionRadius*cos(angle);let zPos : f32=positionRadius*sin(angle);newPosition=vec3<f32>(xPos,yPos,zPos);
#ifdef DIRECTEDCYLINDEREMITTER
newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;
#else
angle=angle+(-0.5+randoms3.x)*PI*params.directionRandomizer;newDirection=vec3<f32>(cos(angle),(-0.5+randoms3.y)*params.directionRandomizer,sin(angle));newDirection=normalize(newDirection);
#endif
#elif defined(CONEEMITTER)
let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let s : f32=2.0*PI*randoms2.x;
#ifdef CONEEMITTERSPAWNPOINT
let h : f32=0.0001;
#else
var h : f32=randoms2.y*params.height.y;h=1.-h*h; 
#endif
var lRadius : f32=params.radius.x-params.radius.x*randoms2.z*params.radius.y;lRadius=lRadius*h;let randX : f32=lRadius*sin(s);let randZ : f32=lRadius*cos(s);let randY : f32=h *params.height.x;newPosition=vec3<f32>(randX,randY,randZ); 
let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);
#ifdef DIRECTEDCONEEMITTER
newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;
#else
if (abs(cos(params.coneAngle))==1.0) {newDirection=vec3<f32>(0.,1.0,0.);} else {newDirection=normalize(newPosition+params.directionRandomizer*randoms3); }
#endif
#elif defined(CUSTOMEMITTER)
newPosition=particlesIn.particles[index].initialPosition;particlesOut.particles[index].initialPosition=newPosition;
#else 
newPosition=vec3<f32>(0.,0.,0.);newDirection=2.0*(getRandomVec3(seed.w,vertexID)-vec3<f32>(0.5,0.5,0.5));
#endif
let power : f32=params.emitPower.x+(params.emitPower.y-params.emitPower.x)*randoms.a;
#ifdef LOCAL
particlesOut.particles[index].position=newPosition;
#else
particlesOut.particles[index].position=(params.emitterWM*vec4<f32>(newPosition,1.)).xyz;
#endif
#ifdef CUSTOMEMITTER
particlesOut.particles[index].direction=direction;
#ifndef BILLBOARD 
particlesOut.particles[index].initialDirection=direction;
#endif
#else
#ifdef LOCAL
let initial : vec3<f32>=newDirection;
#else 
let initial : vec3<f32>=(params.emitterWM*vec4<f32>(newDirection,0.)).xyz;
#endif
particlesOut.particles[index].direction=initial*power;
#ifndef BILLBOARD 
particlesOut.particles[index].initialDirection=initial;
#endif
#endif
#ifdef ANIMATESHEET 
particlesOut.particles[index].cellIndex=params.cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
particlesOut.particles[index].cellStartOffset=randoms.a*outLife;
#endif 
#endif
#ifdef NOISE
particlesOut.particles[index].noiseCoordinates1=particlesIn.particles[index].noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=particlesIn.particles[index].noiseCoordinates2;
#endif
} else {var directionScale : f32=timeDelta;particlesOut.particles[index].age=newAge;let ageGradient : f32=newAge/life;
#ifdef VELOCITYGRADIENTS
directionScale=directionScale*textureSampleLevel(velocityGradientTexture,velocityGradientSampler,vec2<f32>(ageGradient,0.),0.).r;
#endif
#ifdef DRAGGRADIENTS
directionScale=directionScale*(1.0-textureSampleLevel(dragGradientTexture,dragGradientSampler,vec2<f32>(ageGradient,0.),0.).r);
#endif
let position : vec3<f32>=particlesIn.particles[index].position;
#if defined(CUSTOMEMITTER)
particlesOut.particles[index].position=position+(direction-position)*ageGradient; 
particlesOut.particles[index].initialPosition=particlesIn.particles[index].initialPosition;
#else
particlesOut.particles[index].position=position+direction*directionScale;
#endif
particlesOut.particles[index].life=life;particlesOut.particles[index].seed=seed;
#ifndef COLORGRADIENTS 
particlesOut.particles[index].color=particlesIn.particles[index].color;
#endif
#ifdef SIZEGRADIENTS
particlesOut.particles[index].size=vec3<f32>(
textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(ageGradient,0.),0.).r,
particlesIn.particles[index].size.yz);
#else
particlesOut.particles[index].size=particlesIn.particles[index].size;
#endif 
#ifndef BILLBOARD 
particlesOut.particles[index].initialDirection=particlesIn.particles[index].initialDirection;
#endif
#ifdef CUSTOMEMITTER
particlesOut.particles[index].direction=direction;
#else
var updatedDirection : vec3<f32>=direction+params.gravity*timeDelta;
#ifdef LIMITVELOCITYGRADIENTS
let limitVelocity : f32=textureSampleLevel(limitVelocityGradientTexture,limitVelocityGradientSampler,vec2<f32>(ageGradient,0.),0.).r;let currentVelocity : f32=length(updatedDirection);if (currentVelocity>limitVelocity) {updatedDirection=updatedDirection*params.limitVelocityDamping;}
#endif
particlesOut.particles[index].direction=updatedDirection;
#ifdef NOISE
let noiseCoordinates1 : vec3<f32>=particlesIn.particles[index].noiseCoordinates1;let noiseCoordinates2 : vec3<f32>=particlesIn.particles[index].noiseCoordinates2;let fetchedR : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.x,noiseCoordinates1.y)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedG : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.z,noiseCoordinates2.x)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedB : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates2.y,noiseCoordinates2.z)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let force : vec3<f32>=vec3<f32>(-1.+2.*fetchedR,-1.+2.*fetchedG,-1.+2.*fetchedB)*params.noiseStrength;particlesOut.particles[index].direction=particlesOut.particles[index].direction+force*timeDelta;particlesOut.particles[index].noiseCoordinates1=noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=noiseCoordinates2;
#endif 
#endif 
#ifdef ANGULARSPEEDGRADIENTS
let angularSpeed : f32=textureSampleLevel(angularSpeedGradientTexture,angularSpeedGradientSampler,vec2<f32>(ageGradient,0.),0.).r;particlesOut.particles[index].angle=particlesIn.particles[index].angle+angularSpeed*timeDelta;
#else
let angle : vec2<f32>=particlesIn.particles[index].angle;particlesOut.particles[index].angle=vec2<f32>(angle.x+angle.y*timeDelta,angle.y);
#endif
#ifdef ANIMATESHEET 
var offsetAge : f32=particlesOut.particles[index].age;let dist : f32=params.cellInfos.y-params.cellInfos.x;
#ifdef ANIMATESHEETRANDOMSTART
let cellStartOffset : f32=particlesIn.particles[index].cellStartOffset;particlesOut.particles[index].cellStartOffset=cellStartOffset;offsetAge=offsetAge+cellStartOffset;
#else
let cellStartOffset : f32=0.;
#endif 
var ratio : f32;if (params.cellInfos.w==1.0) {ratio=clamp(((cellStartOffset+params.cellInfos.z*offsetAge) % life)/life,0.,1.0);}
else {ratio=clamp((cellStartOffset+params.cellInfos.z*offsetAge)/life,0.,1.0);}
particlesOut.particles[index].cellIndex=f32(i32(params.cellInfos.x+ratio*dist));
#endif
}}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[gpuUpdateParticles_compute_name] = gpuUpdateParticles_compute_shader;
/** @internal */
const gpuUpdateParticlesComputeShaderWGSL = { name: gpuUpdateParticles_compute_name, shader: gpuUpdateParticles_compute_shader };
//# sourceMappingURL=gpuUpdateParticles.compute.js.map
;// ./node_modules/@babylonjs/core/Particles/computeShaderParticleSystem.js







/** @internal */
class ComputeShaderParticleSystem {
    constructor(parent, engine) {
        this._bufferComputeShader = [];
        this._renderVertexBuffers = [];
        this.alignDataInBuffer = true;
        this._parent = parent;
        this._engine = engine;
    }
    contextLost() {
        this._updateComputeShader = undefined;
        this._bufferComputeShader.length = 0;
        this._renderVertexBuffers.length = 0;
    }
    isUpdateBufferCreated() {
        return !!this._updateComputeShader;
    }
    isUpdateBufferReady() {
        return this._updateComputeShader?.isReady() ?? false;
    }
    createUpdateBuffer(defines) {
        const bindingsMapping = {
            params: { group: 0, binding: 0 },
            particlesIn: { group: 0, binding: 1 },
            particlesOut: { group: 0, binding: 2 },
            randomTexture: { group: 0, binding: 3 },
            randomTexture2: { group: 0, binding: 4 },
        };
        if (this._parent._sizeGradientsTexture) {
            bindingsMapping["sizeGradientTexture"] = { group: 1, binding: 1 };
        }
        if (this._parent._angularSpeedGradientsTexture) {
            bindingsMapping["angularSpeedGradientTexture"] = { group: 1, binding: 3 };
        }
        if (this._parent._velocityGradientsTexture) {
            bindingsMapping["velocityGradientTexture"] = { group: 1, binding: 5 };
        }
        if (this._parent._limitVelocityGradientsTexture) {
            bindingsMapping["limitVelocityGradientTexture"] = { group: 1, binding: 7 };
        }
        if (this._parent._dragGradientsTexture) {
            bindingsMapping["dragGradientTexture"] = { group: 1, binding: 9 };
        }
        if (this._parent.noiseTexture) {
            bindingsMapping["noiseTexture"] = { group: 1, binding: 11 };
        }
        this._updateComputeShader = new computeShader/* ComputeShader */.H("updateParticles", this._engine, "gpuUpdateParticles", { bindingsMapping, defines: defines.split("\n") });
        this._simParamsComputeShader?.dispose();
        this._simParamsComputeShader = new uniformBuffer/* UniformBuffer */.D(this._engine, undefined, undefined, "ComputeShaderParticleSystemUBO");
        this._simParamsComputeShader.addUniform("currentCount", 1);
        this._simParamsComputeShader.addUniform("timeDelta", 1);
        this._simParamsComputeShader.addUniform("stopFactor", 1);
        this._simParamsComputeShader.addUniform("randomTextureSize", 1);
        this._simParamsComputeShader.addUniform("lifeTime", 2);
        this._simParamsComputeShader.addUniform("emitPower", 2);
        if (!this._parent._colorGradientsTexture) {
            this._simParamsComputeShader.addUniform("color1", 4);
            this._simParamsComputeShader.addUniform("color2", 4);
        }
        this._simParamsComputeShader.addUniform("sizeRange", 2);
        this._simParamsComputeShader.addUniform("scaleRange", 4);
        this._simParamsComputeShader.addUniform("angleRange", 4);
        this._simParamsComputeShader.addUniform("gravity", 3);
        if (this._parent._limitVelocityGradientsTexture) {
            this._simParamsComputeShader.addUniform("limitVelocityDamping", 1);
        }
        if (this._parent.isAnimationSheetEnabled) {
            this._simParamsComputeShader.addUniform("cellInfos", 4);
        }
        if (this._parent.noiseTexture) {
            this._simParamsComputeShader.addUniform("noiseStrength", 3);
        }
        if (!this._parent.isLocal) {
            this._simParamsComputeShader.addUniform("emitterWM", 16);
        }
        if (this._parent.particleEmitterType) {
            this._parent.particleEmitterType.buildUniformLayout(this._simParamsComputeShader);
        }
        this._updateComputeShader.setUniformBuffer("params", this._simParamsComputeShader);
        return new UniformBufferEffectCommonAccessor(this._simParamsComputeShader);
    }
    createVertexBuffers(updateBuffer, renderVertexBuffers) {
        this._renderVertexBuffers.push(renderVertexBuffers);
    }
    createParticleBuffer(data) {
        const buffer = new storageBuffer/* StorageBuffer */.K(this._engine, data.length * 4, 3 | 8, "ComputeShaderParticleSystemBuffer");
        buffer.update(data);
        this._bufferComputeShader.push(buffer);
        return buffer.getBuffer();
    }
    bindDrawBuffers(index, effect, indexBuffer) {
        this._engine.bindBuffers(this._renderVertexBuffers[index], indexBuffer, effect);
    }
    preUpdateParticleBuffer() { }
    updateParticleBuffer(index, targetBuffer, currentActiveCount) {
        this._simParamsComputeShader.update();
        this._updateComputeShader.setTexture("randomTexture", this._parent._randomTexture, false);
        this._updateComputeShader.setTexture("randomTexture2", this._parent._randomTexture2, false);
        if (this._parent._sizeGradientsTexture) {
            this._updateComputeShader.setTexture("sizeGradientTexture", this._parent._sizeGradientsTexture);
        }
        if (this._parent._angularSpeedGradientsTexture) {
            this._updateComputeShader.setTexture("angularSpeedGradientTexture", this._parent._angularSpeedGradientsTexture);
        }
        if (this._parent._velocityGradientsTexture) {
            this._updateComputeShader.setTexture("velocityGradientTexture", this._parent._velocityGradientsTexture);
        }
        if (this._parent._limitVelocityGradientsTexture) {
            this._updateComputeShader.setTexture("limitVelocityGradientTexture", this._parent._limitVelocityGradientsTexture);
        }
        if (this._parent._dragGradientsTexture) {
            this._updateComputeShader.setTexture("dragGradientTexture", this._parent._dragGradientsTexture);
        }
        if (this._parent.noiseTexture) {
            this._updateComputeShader.setTexture("noiseTexture", this._parent.noiseTexture);
        }
        this._updateComputeShader.setStorageBuffer("particlesIn", this._bufferComputeShader[index]);
        this._updateComputeShader.setStorageBuffer("particlesOut", this._bufferComputeShader[index ^ 1]);
        this._updateComputeShader.dispatch(Math.ceil(currentActiveCount / 64));
    }
    releaseBuffers() {
        for (let i = 0; i < this._bufferComputeShader.length; ++i) {
            this._bufferComputeShader[i].dispose();
        }
        this._bufferComputeShader.length = 0;
        this._simParamsComputeShader?.dispose();
        this._simParamsComputeShader = null;
        this._updateComputeShader = null;
    }
    releaseVertexBuffers() {
        this._renderVertexBuffers.length = 0;
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ComputeShaderParticleSystem", ComputeShaderParticleSystem);
//# sourceMappingURL=computeShaderParticleSystem.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration2.js
// Do not edit.

const clipPlaneFragmentDeclaration2_name = "clipPlaneFragmentDeclaration2";
const clipPlaneFragmentDeclaration2_shader = `#ifdef CLIPPLANE
in float fClipDistance;
#endif
#ifdef CLIPPLANE2
in float fClipDistance2;
#endif
#ifdef CLIPPLANE3
in float fClipDistance3;
#endif
#ifdef CLIPPLANE4
in float fClipDistance4;
#endif
#ifdef CLIPPLANE5
in float fClipDistance5;
#endif
#ifdef CLIPPLANE6
in float fClipDistance6;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[clipPlaneFragmentDeclaration2_name] = clipPlaneFragmentDeclaration2_shader;
/** @internal */
const clipPlaneFragmentDeclaration2 = { name: clipPlaneFragmentDeclaration2_name, shader: clipPlaneFragmentDeclaration2_shader };
//# sourceMappingURL=clipPlaneFragmentDeclaration2.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js
var logDepthDeclaration = __webpack_require__(34581);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js
var logDepthFragment = __webpack_require__(29741);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js
var fogFragment = __webpack_require__(2360);
;// ./node_modules/@babylonjs/core/Shaders/gpuRenderParticles.fragment.js
// Do not edit.










const gpuRenderParticles_fragment_name = "gpuRenderParticlesPixelShader";
const gpuRenderParticles_fragment_shader = `precision highp float;
#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
uniform sampler2D diffuseSampler;varying vec2 vUV;varying vec4 vColor;
#include<clipPlaneFragmentDeclaration2> 
#include<imageProcessingDeclaration>
#include<logDepthDeclaration>
#include<helperFunctions>
#include<imageProcessingFunctions>
#include<fogFragmentDeclaration>
void main() {
#include<clipPlaneFragment> 
vec4 textureColor=texture2D(diffuseSampler,vUV);gl_FragColor=textureColor*vColor;
#ifdef BLENDMULTIPLYMODE
float alpha=vColor.a*textureColor.a;gl_FragColor.rgb=gl_FragColor.rgb*alpha+vec3(1.0)*(1.0-alpha);
#endif 
#include<logDepthFragment>
#include<fogFragment>(color,gl_FragColor)
#ifdef IMAGEPROCESSINGPOSTPROCESS
gl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);
#else
#ifdef IMAGEPROCESSING
gl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);gl_FragColor=applyImageProcessing(gl_FragColor);
#endif
#endif
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[gpuRenderParticles_fragment_name] = gpuRenderParticles_fragment_shader;
/** @internal */
const gpuRenderParticlesPixelShader = { name: gpuRenderParticles_fragment_name, shader: gpuRenderParticles_fragment_shader };
//# sourceMappingURL=gpuRenderParticles.fragment.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration2.js
// Do not edit.

const clipPlaneVertexDeclaration2_name = "clipPlaneVertexDeclaration2";
const clipPlaneVertexDeclaration2_shader = `#ifdef CLIPPLANE
uniform vec4 vClipPlane;out float fClipDistance;
#endif
#ifdef CLIPPLANE2
uniform vec4 vClipPlane2;out float fClipDistance2;
#endif
#ifdef CLIPPLANE3
uniform vec4 vClipPlane3;out float fClipDistance3;
#endif
#ifdef CLIPPLANE4
uniform vec4 vClipPlane4;out float fClipDistance4;
#endif
#ifdef CLIPPLANE5
uniform vec4 vClipPlane5;out float fClipDistance5;
#endif
#ifdef CLIPPLANE6
uniform vec4 vClipPlane6;out float fClipDistance6;
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[clipPlaneVertexDeclaration2_name] = clipPlaneVertexDeclaration2_shader;
/** @internal */
const clipPlaneVertexDeclaration2 = { name: clipPlaneVertexDeclaration2_name, shader: clipPlaneVertexDeclaration2_shader };
//# sourceMappingURL=clipPlaneVertexDeclaration2.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js
var fogVertexDeclaration = __webpack_require__(86560);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js
var fogVertex = __webpack_require__(16470);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js
var logDepthVertex = __webpack_require__(2215);
;// ./node_modules/@babylonjs/core/Shaders/gpuRenderParticles.vertex.js
// Do not edit.







const gpuRenderParticles_vertex_name = "gpuRenderParticlesVertexShader";
const gpuRenderParticles_vertex_shader = `precision highp float;uniform mat4 view;uniform mat4 projection;uniform vec2 translationPivot;uniform vec3 worldOffset;
#ifdef LOCAL
uniform mat4 emitterWM;
#endif
attribute vec3 position;attribute float age;attribute float life;attribute vec3 size;
#ifndef BILLBOARD
attribute vec3 initialDirection;
#endif
#ifdef BILLBOARDSTRETCHED
attribute vec3 direction;
#endif
attribute float angle;
#ifdef ANIMATESHEET
attribute float cellIndex;
#endif
attribute vec2 offset;attribute vec2 uv;varying vec2 vUV;varying vec4 vColor;varying vec3 vPositionW;
#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)
uniform mat4 invView;
#endif
#include<clipPlaneVertexDeclaration2>
#include<fogVertexDeclaration>
#include<logDepthDeclaration>
#ifdef COLORGRADIENTS
uniform sampler2D colorGradientSampler;
#else
uniform vec4 colorDead;attribute vec4 color;
#endif
#ifdef ANIMATESHEET
uniform vec3 sheetInfos;
#endif
#ifdef BILLBOARD
uniform vec3 eyePosition;
#endif
vec3 rotate(vec3 yaxis,vec3 rotatedCorner) {vec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));vec3 zaxis=normalize(cross(yaxis,xaxis));vec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);vec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);vec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;
#ifdef LOCAL
return ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;
#else
return (position+worldOffset)+alignedCorner;
#endif
}
#ifdef BILLBOARDSTRETCHED
vec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {vec3 normalizedToCamera=normalize(toCamera);vec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));vec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));vec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);vec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);vec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);mat3 rotMatrix= mat3(row0,row1,row2);vec3 alignedCorner=rotMatrix*rotatedCorner;
#ifdef LOCAL
return ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;
#else
return (position+worldOffset)+alignedCorner;
#endif
}
#endif
void main() {
#ifdef ANIMATESHEET
float rowOffset=floor(cellIndex/sheetInfos.z);float columnOffset=cellIndex-rowOffset*sheetInfos.z;vec2 uvScale=sheetInfos.xy;vec2 uvOffset=vec2(uv.x ,1.0-uv.y);vUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;
#else
vUV=uv;
#endif
float ratio=min(1.0,age/life);
#ifdef COLORGRADIENTS
vColor=texture2D(colorGradientSampler,vec2(ratio,0));
#else
vColor=color*vec4(1.0-ratio)+colorDead*vec4(ratio);
#endif
vec2 cornerPos=(offset-translationPivot)*size.yz*size.x;
#ifdef BILLBOARD
vec4 rotatedCorner;rotatedCorner.w=0.;
#ifdef BILLBOARDY
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.y=0.;rotatedCorner.xz+=translationPivot;vec3 yaxis=(position+worldOffset)-eyePosition;yaxis.y=0.;vPositionW=rotate(normalize(yaxis),rotatedCorner.xyz);vec4 viewPosition=(view*vec4(vPositionW,1.0));
#elif defined(BILLBOARDSTRETCHED)
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;vec3 toCamera=(position+worldOffset)-eyePosition;vPositionW=rotateAlign(toCamera,rotatedCorner.xyz);vec4 viewPosition=(view*vec4(vPositionW,1.0));
#else
rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.z=0.;rotatedCorner.xy+=translationPivot;
#ifdef LOCAL
vec4 viewPosition=view*vec4(((emitterWM*vec4(position,1.0)).xyz+worldOffset),1.0)+rotatedCorner;
#else
vec4 viewPosition=view*vec4((position+worldOffset),1.0)+rotatedCorner;
#endif
vPositionW=(invView*viewPosition).xyz;
#endif
#else
vec3 rotatedCorner;rotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);rotatedCorner.y=0.;rotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);rotatedCorner.xz+=translationPivot;vec3 yaxis=normalize(initialDirection);vPositionW=rotate(yaxis,rotatedCorner);vec4 viewPosition=view*vec4(vPositionW,1.0);
#endif
gl_Position=projection*viewPosition;
#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) || defined(FOG)
vec4 worldPos=vec4(vPositionW,1.0);
#endif
#include<clipPlaneVertex>
#include<fogVertex>
#include<logDepthVertex>
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[gpuRenderParticles_vertex_name] = gpuRenderParticles_vertex_shader;
/** @internal */
const gpuRenderParticlesVertexShader = { name: gpuRenderParticles_vertex_name, shader: gpuRenderParticles_vertex_shader };
//# sourceMappingURL=gpuRenderParticles.vertex.js.map
;// ./node_modules/@babylonjs/core/Particles/gpuParticleSystem.js
























/**
 * This represents a GPU particle system in Babylon
 * This is the fastest particle system in Babylon as it uses the GPU to update the individual particle data
 * @see https://www.babylonjs-playground.com/#PU4WYI#4
 */
class GPUParticleSystem extends BaseParticleSystem {
    /**
     * Gets a boolean indicating if the GPU particles can be rendered on current browser
     */
    static get IsSupported() {
        if (!engineStore/* EngineStore */.q.LastCreatedEngine) {
            return false;
        }
        const caps = engineStore/* EngineStore */.q.LastCreatedEngine.getCaps();
        return caps.supportTransformFeedbacks || caps.supportComputeShaders;
    }
    _createIndexBuffer() {
        this._linesIndexBufferUseInstancing = this._engine.createIndexBuffer(new Uint32Array([0, 1, 1, 3, 3, 2, 2, 0, 0, 3]), undefined, "GPUParticleSystemLinesIndexBuffer");
    }
    /**
     * Gets the maximum number of particles active at the same time.
     * @returns The max number of active particles.
     */
    getCapacity() {
        return this._capacity;
    }
    /**
     * Gets or set the number of active particles
     * The value cannot be greater than "capacity" (if it is, it will be limited to "capacity").
     */
    get maxActiveParticleCount() {
        return this._maxActiveParticleCount;
    }
    set maxActiveParticleCount(value) {
        this._maxActiveParticleCount = Math.min(value, this._capacity);
    }
    /**
     * Gets or set the number of active particles
     * @deprecated Please use maxActiveParticleCount instead.
     */
    get activeParticleCount() {
        return this.maxActiveParticleCount;
    }
    set activeParticleCount(value) {
        this.maxActiveParticleCount = value;
    }
    /**
     * Creates a Point Emitter for the particle system (emits directly from the emitter position)
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
     * @returns the emitter
     */
    createPointEmitter(direction1, direction2) {
        const particleEmitter = CreatePointEmitter(direction1, direction2);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)
     * @param radius The radius of the hemisphere to emit from
     * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
     * @returns the emitter
     */
    createHemisphericEmitter(radius = 1, radiusRange = 1) {
        const particleEmitter = CreateHemisphericEmitter(radius, radiusRange);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Sphere Emitter for the particle system (emits along the sphere radius)
     * @param radius The radius of the sphere to emit from
     * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
     * @returns the emitter
     */
    createSphereEmitter(radius = 1, radiusRange = 1) {
        const particleEmitter = CreateSphereEmitter(radius, radiusRange);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)
     * @param radius The radius of the sphere to emit from
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere
     * @returns the emitter
     */
    createDirectedSphereEmitter(radius = 1, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
        const particleEmitter = CreateDirectedSphereEmitter(radius, direction1, direction2);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)
     * @param radius The radius of the emission cylinder
     * @param height The height of the emission cylinder
     * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius
     * @param directionRandomizer How much to randomize the particle direction [0-1]
     * @returns the emitter
     */
    createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0) {
        const particleEmitter = CreateCylinderEmitter(radius, height, radiusRange, directionRandomizer);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)
     * @param radius The radius of the cylinder to emit from
     * @param height The height of the emission cylinder
     * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder
     * @returns the emitter
     */
    createDirectedCylinderEmitter(radius = 1, height = 1, radiusRange = 1, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
        const particleEmitter = CreateDirectedCylinderEmitter(radius, height, radiusRange, direction1, direction2);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)
     * @param radius The radius of the cone to emit from
     * @param angle The base angle of the cone
     * @returns the emitter
     */
    createConeEmitter(radius = 1, angle = Math.PI / 4) {
        const particleEmitter = CreateConeEmitter(radius, angle);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    createDirectedConeEmitter(radius = 1, angle = Math.PI / 4, direction1 = new math_vector/* Vector3 */.Pq(0, 1.0, 0), direction2 = new math_vector/* Vector3 */.Pq(0, 1.0, 0)) {
        const particleEmitter = CreateDirectedConeEmitter(radius, angle, direction1, direction2);
        this.particleEmitterType = particleEmitter;
        return particleEmitter;
    }
    /**
     * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)
     * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
     * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
     * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox
     * @param maxEmitBox  Particles are emitted from the box between minEmitBox and maxEmitBox
     * @returns the emitter
     */
    createBoxEmitter(direction1, direction2, minEmitBox, maxEmitBox) {
        const particleEmitter = new BoxParticleEmitter();
        this.particleEmitterType = particleEmitter;
        this.direction1 = direction1;
        this.direction2 = direction2;
        this.minEmitBox = minEmitBox;
        this.maxEmitBox = maxEmitBox;
        return particleEmitter;
    }
    /**
     * Is this system ready to be used/rendered
     * @returns true if the system is ready
     */
    isReady() {
        if (!this.emitter ||
            (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady()) ||
            !this.particleTexture ||
            !this.particleTexture.isReady() ||
            this._rebuildingAfterContextLost) {
            return false;
        }
        if (this.blendMode !== ParticleSystem.BLENDMODE_MULTIPLYADD) {
            if (!this._getWrapper(this.blendMode).effect.isReady()) {
                return false;
            }
        }
        else {
            if (!this._getWrapper(ParticleSystem.BLENDMODE_MULTIPLY).effect.isReady()) {
                return false;
            }
            if (!this._getWrapper(ParticleSystem.BLENDMODE_ADD).effect.isReady()) {
                return false;
            }
        }
        if (!this._platform.isUpdateBufferCreated()) {
            this._recreateUpdateEffect();
            return false;
        }
        return this._platform.isUpdateBufferReady();
    }
    /**
     * Gets if the system has been started. (Note: this will still be true after stop is called)
     * @returns True if it has been started, otherwise false.
     */
    isStarted() {
        return this._started;
    }
    /**
     * Gets if the system has been stopped. (Note: rendering is still happening but the system is frozen)
     * @returns True if it has been stopped, otherwise false.
     */
    isStopped() {
        return this._stopped;
    }
    /**
     * Gets a boolean indicating that the system is stopping
     * @returns true if the system is currently stopping
     */
    isStopping() {
        return false; // Stop is immediate on GPU
    }
    /**
     * Gets the number of particles active at the same time.
     * @returns The number of active particles.
     */
    getActiveCount() {
        return this._currentActiveCount;
    }
    /**
     * Starts the particle system and begins to emit
     * @param delay defines the delay in milliseconds before starting the system (this.startDelay by default)
     */
    start(delay = this.startDelay) {
        if (!this.targetStopDuration && this._hasTargetStopDurationDependantGradient()) {
            // eslint-disable-next-line no-throw-literal
            throw "Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";
        }
        if (delay) {
            setTimeout(() => {
                this.start(0);
            }, delay);
            return;
        }
        this._started = true;
        this._stopped = false;
        this._preWarmDone = false;
        // Animations
        if (this.beginAnimationOnStart && this.animations && this.animations.length > 0 && this._scene) {
            this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop);
        }
    }
    /**
     * Stops the particle system.
     */
    stop() {
        if (this._stopped) {
            return;
        }
        this.onStoppedObservable.notifyObservers(this);
        this._stopped = true;
    }
    /**
     * Remove all active particles
     */
    reset() {
        this._releaseBuffers();
        this._platform.releaseVertexBuffers();
        this._currentActiveCount = 0;
        this._targetIndex = 0;
    }
    /**
     * Returns the string "GPUParticleSystem"
     * @returns a string containing the class name
     */
    getClassName() {
        return "GPUParticleSystem";
    }
    /**
     * Gets the custom effect used to render the particles
     * @param blendMode Blend mode for which the effect should be retrieved
     * @returns The effect
     */
    getCustomEffect(blendMode = 0) {
        return this._customWrappers[blendMode]?.effect ?? this._customWrappers[0].effect;
    }
    _getCustomDrawWrapper(blendMode = 0) {
        return this._customWrappers[blendMode] ?? this._customWrappers[0];
    }
    /**
     * Sets the custom effect used to render the particles
     * @param effect The effect to set
     * @param blendMode Blend mode for which the effect should be set
     */
    setCustomEffect(effect, blendMode = 0) {
        this._customWrappers[blendMode] = new Materials_drawWrapper/* DrawWrapper */.E(this._engine);
        this._customWrappers[blendMode].effect = effect;
    }
    /**
     * Observable that will be called just before the particles are drawn
     */
    get onBeforeDrawParticlesObservable() {
        if (!this._onBeforeDrawParticlesObservable) {
            this._onBeforeDrawParticlesObservable = new Misc_observable/* Observable */.cP();
        }
        return this._onBeforeDrawParticlesObservable;
    }
    /**
     * Gets the name of the particle vertex shader
     */
    get vertexShaderName() {
        return "gpuRenderParticles";
    }
    /**
     * Gets the vertex buffers used by the particle system
     * Should be called after render() has been called for the current frame so that the buffers returned are the ones that have been updated
     * in the current frame (there's a ping-pong between two sets of buffers - for a given frame, one set is used as the source and the other as the destination)
     */
    get vertexBuffers() {
        // We return the other buffers than those corresponding to this._targetIndex because it is assumed vertexBuffers will be called in the current frame
        // after render() has been called, meaning that the buffers have already been swapped and this._targetIndex points to the buffers that will be updated
        // in the next frame (and which are the sources in this frame) and (this._targetIndex ^ 1) points to the buffers that have been updated this frame
        // (and that will be the source buffers in the next frame)
        return this._renderVertexBuffers[this._targetIndex ^ 1];
    }
    /**
     * Gets the index buffer used by the particle system (null for GPU particle systems)
     */
    get indexBuffer() {
        return null;
    }
    _removeGradientAndTexture(gradient, gradients, texture) {
        super._removeGradientAndTexture(gradient, gradients, texture);
        this._releaseBuffers();
        return this;
    }
    /**
     * Adds a new color gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param color1 defines the color to affect to the specified gradient
     * @returns the current particle system
     */
    addColorGradient(gradient, color1) {
        if (!this._colorGradients) {
            this._colorGradients = [];
        }
        const colorGradient = new ColorGradient(gradient, color1);
        this._colorGradients.push(colorGradient);
        this._refreshColorGradient(true);
        this._releaseBuffers();
        return this;
    }
    _refreshColorGradient(reorder = false) {
        if (this._colorGradients) {
            if (reorder) {
                this._colorGradients.sort((a, b) => {
                    if (a.gradient < b.gradient) {
                        return -1;
                    }
                    else if (a.gradient > b.gradient) {
                        return 1;
                    }
                    return 0;
                });
            }
            if (this._colorGradientsTexture) {
                this._colorGradientsTexture.dispose();
                this._colorGradientsTexture = null;
            }
        }
    }
    /** Force the system to rebuild all gradients that need to be resync */
    forceRefreshGradients() {
        this._refreshColorGradient();
        this._refreshFactorGradient(this._sizeGradients, "_sizeGradientsTexture");
        this._refreshFactorGradient(this._angularSpeedGradients, "_angularSpeedGradientsTexture");
        this._refreshFactorGradient(this._velocityGradients, "_velocityGradientsTexture");
        this._refreshFactorGradient(this._limitVelocityGradients, "_limitVelocityGradientsTexture");
        this._refreshFactorGradient(this._dragGradients, "_dragGradientsTexture");
        this.reset();
    }
    /**
     * Remove a specific color gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeColorGradient(gradient) {
        this._removeGradientAndTexture(gradient, this._colorGradients, this._colorGradientsTexture);
        this._colorGradientsTexture = null;
        return this;
    }
    /**
     * Resets the draw wrappers cache
     */
    resetDrawCache() {
        for (const blendMode in this._drawWrappers) {
            const drawWrapper = this._drawWrappers[blendMode];
            drawWrapper.drawContext?.reset();
        }
    }
    _addFactorGradient(factorGradients, gradient, factor) {
        const valueGradient = new FactorGradient(gradient, factor);
        factorGradients.push(valueGradient);
        this._releaseBuffers();
    }
    /**
     * Adds a new size gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the size factor to affect to the specified gradient
     * @returns the current particle system
     */
    addSizeGradient(gradient, factor) {
        if (!this._sizeGradients) {
            this._sizeGradients = [];
        }
        this._addFactorGradient(this._sizeGradients, gradient, factor);
        this._refreshFactorGradient(this._sizeGradients, "_sizeGradientsTexture", true);
        this._releaseBuffers();
        return this;
    }
    /**
     * Remove a specific size gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeSizeGradient(gradient) {
        this._removeGradientAndTexture(gradient, this._sizeGradients, this._sizeGradientsTexture);
        this._sizeGradientsTexture = null;
        return this;
    }
    _refreshFactorGradient(factorGradients, textureName, reorder = false) {
        if (!factorGradients) {
            return;
        }
        if (reorder) {
            factorGradients.sort((a, b) => {
                if (a.gradient < b.gradient) {
                    return -1;
                }
                else if (a.gradient > b.gradient) {
                    return 1;
                }
                return 0;
            });
        }
        const that = this;
        if (that[textureName]) {
            that[textureName].dispose();
            that[textureName] = null;
        }
    }
    /**
     * Adds a new angular speed gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the angular speed to affect to the specified gradient
     * @returns the current particle system
     */
    addAngularSpeedGradient(gradient, factor) {
        if (!this._angularSpeedGradients) {
            this._angularSpeedGradients = [];
        }
        this._addFactorGradient(this._angularSpeedGradients, gradient, factor);
        this._refreshFactorGradient(this._angularSpeedGradients, "_angularSpeedGradientsTexture", true);
        this._releaseBuffers();
        return this;
    }
    /**
     * Remove a specific angular speed gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeAngularSpeedGradient(gradient) {
        this._removeGradientAndTexture(gradient, this._angularSpeedGradients, this._angularSpeedGradientsTexture);
        this._angularSpeedGradientsTexture = null;
        return this;
    }
    /**
     * Adds a new velocity gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the velocity to affect to the specified gradient
     * @returns the current particle system
     */
    addVelocityGradient(gradient, factor) {
        if (!this._velocityGradients) {
            this._velocityGradients = [];
        }
        this._addFactorGradient(this._velocityGradients, gradient, factor);
        this._refreshFactorGradient(this._velocityGradients, "_velocityGradientsTexture", true);
        this._releaseBuffers();
        return this;
    }
    /**
     * Remove a specific velocity gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeVelocityGradient(gradient) {
        this._removeGradientAndTexture(gradient, this._velocityGradients, this._velocityGradientsTexture);
        this._velocityGradientsTexture = null;
        return this;
    }
    /**
     * Adds a new limit velocity gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the limit velocity value to affect to the specified gradient
     * @returns the current particle system
     */
    addLimitVelocityGradient(gradient, factor) {
        if (!this._limitVelocityGradients) {
            this._limitVelocityGradients = [];
        }
        this._addFactorGradient(this._limitVelocityGradients, gradient, factor);
        this._refreshFactorGradient(this._limitVelocityGradients, "_limitVelocityGradientsTexture", true);
        this._releaseBuffers();
        return this;
    }
    /**
     * Remove a specific limit velocity gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeLimitVelocityGradient(gradient) {
        this._removeGradientAndTexture(gradient, this._limitVelocityGradients, this._limitVelocityGradientsTexture);
        this._limitVelocityGradientsTexture = null;
        return this;
    }
    /**
     * Adds a new drag gradient
     * @param gradient defines the gradient to use (between 0 and 1)
     * @param factor defines the drag value to affect to the specified gradient
     * @returns the current particle system
     */
    addDragGradient(gradient, factor) {
        if (!this._dragGradients) {
            this._dragGradients = [];
        }
        this._addFactorGradient(this._dragGradients, gradient, factor);
        this._refreshFactorGradient(this._dragGradients, "_dragGradientsTexture", true);
        this._releaseBuffers();
        return this;
    }
    /**
     * Remove a specific drag gradient
     * @param gradient defines the gradient to remove
     * @returns the current particle system
     */
    removeDragGradient(gradient) {
        this._removeGradientAndTexture(gradient, this._dragGradients, this._dragGradientsTexture);
        this._dragGradientsTexture = null;
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    addEmitRateGradient() {
        // Do nothing as emit rate is not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    removeEmitRateGradient() {
        // Do nothing as emit rate is not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    addStartSizeGradient() {
        // Do nothing as start size is not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    removeStartSizeGradient() {
        // Do nothing as start size is not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    addColorRemapGradient() {
        // Do nothing as start size is not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    removeColorRemapGradient() {
        // Do nothing as start size is not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    addAlphaRemapGradient() {
        // Do nothing as start size is not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    removeAlphaRemapGradient() {
        // Do nothing as start size is not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    addRampGradient() {
        //Not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    removeRampGradient() {
        //Not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the list of ramp gradients
     */
    getRampGradients() {
        return null;
    }
    /**
     * Not supported by GPUParticleSystem
     * Gets or sets a boolean indicating that ramp gradients must be used
     * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro#ramp-gradients
     */
    get useRampGradients() {
        //Not supported by GPUParticleSystem
        return false;
    }
    set useRampGradients(value) {
        //Not supported by GPUParticleSystem
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    addLifeTimeGradient() {
        //Not supported by GPUParticleSystem
        return this;
    }
    /**
     * Not supported by GPUParticleSystem
     * @returns the current particle system
     */
    removeLifeTimeGradient() {
        //Not supported by GPUParticleSystem
        return this;
    }
    /**
     * Instantiates a GPU particle system.
     * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
     * @param name The name of the particle system
     * @param options The options used to create the system
     * @param sceneOrEngine The scene the particle system belongs to or the engine to use if no scene
     * @param customEffect a custom effect used to change the way particles are rendered by default
     * @param isAnimationSheetEnabled Must be true if using a spritesheet to animate the particles texture
     */
    constructor(name, options, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = false) {
        super(name);
        /**
         * The layer mask we are rendering the particles through.
         */
        this.layerMask = 0x0fffffff;
        this._accumulatedCount = 0;
        this._renderVertexBuffers = [];
        this._targetIndex = 0;
        this._currentRenderId = -1;
        this._currentRenderingCameraUniqueId = -1;
        this._started = false;
        this._stopped = false;
        this._timeDelta = 0;
        /** Indicates that the update of particles is done in the animate function (and not in render). Default: false */
        this.updateInAnimate = false;
        this._actualFrame = 0;
        this._rawTextureWidth = 256;
        this._rebuildingAfterContextLost = false;
        /**
         * An event triggered when the system is disposed.
         */
        this.onDisposeObservable = new Misc_observable/* Observable */.cP();
        /**
         * An event triggered when the system is stopped
         */
        this.onStoppedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls
         * to override the particles.
         */
        this.forceDepthWrite = false;
        this._preWarmDone = false;
        /**
         * Specifies if the particles are updated in emitter local space or world space.
         */
        this.isLocal = false;
        /** Indicates that the particle system is GPU based */
        this.isGPU = true;
        /** @internal */
        this._onBeforeDrawParticlesObservable = null;
        if (!sceneOrEngine || sceneOrEngine.getClassName() === "Scene") {
            this._scene = sceneOrEngine || engineStore/* EngineStore */.q.LastCreatedScene;
            this._engine = this._scene.getEngine();
            this.uniqueId = this._scene.getUniqueId();
            this._scene.particleSystems.push(this);
        }
        else {
            this._engine = sceneOrEngine;
            this.defaultProjectionMatrix = math_vector/* Matrix */.uq.PerspectiveFovLH(0.8, 1, 0.1, 100, this._engine.isNDCHalfZRange);
        }
        if (this._engine.getCaps().supportComputeShaders) {
            if (!(0,typeStore/* GetClass */.n9)("BABYLON.ComputeShaderParticleSystem")) {
                throw new Error("The ComputeShaderParticleSystem class is not available! Make sure you have imported it.");
            }
            this._platform = new ((0,typeStore/* GetClass */.n9)("BABYLON.ComputeShaderParticleSystem"))(this, this._engine);
        }
        else {
            if (!(0,typeStore/* GetClass */.n9)("BABYLON.WebGL2ParticleSystem")) {
                throw new Error("The WebGL2ParticleSystem class is not available! Make sure you have imported it.");
            }
            this._platform = new ((0,typeStore/* GetClass */.n9)("BABYLON.WebGL2ParticleSystem"))(this, this._engine);
        }
        this._customWrappers = { 0: new Materials_drawWrapper/* DrawWrapper */.E(this._engine) };
        this._customWrappers[0].effect = customEffect;
        this._drawWrappers = { 0: new Materials_drawWrapper/* DrawWrapper */.E(this._engine) };
        if (this._drawWrappers[0].drawContext) {
            this._drawWrappers[0].drawContext.useInstancing = true;
        }
        this._createIndexBuffer();
        // Setup the default processing configuration to the scene.
        this._attachImageProcessingConfiguration(null);
        options = options ?? {};
        if (!options.randomTextureSize) {
            delete options.randomTextureSize;
        }
        const fullOptions = {
            capacity: 50000,
            randomTextureSize: this._engine.getCaps().maxTextureSize,
            ...options,
        };
        const optionsAsNumber = options;
        if (isFinite(optionsAsNumber)) {
            fullOptions.capacity = optionsAsNumber;
        }
        this._capacity = fullOptions.capacity;
        this._maxActiveParticleCount = fullOptions.capacity;
        this._currentActiveCount = 0;
        this._isAnimationSheetEnabled = isAnimationSheetEnabled;
        this.particleEmitterType = new BoxParticleEmitter();
        // Random data
        const maxTextureSize = Math.min(this._engine.getCaps().maxTextureSize, fullOptions.randomTextureSize);
        let d = [];
        for (let i = 0; i < maxTextureSize; ++i) {
            d.push(Math.random());
            d.push(Math.random());
            d.push(Math.random());
            d.push(Math.random());
        }
        this._randomTexture = new rawTexture/* RawTexture */.I(new Float32Array(d), maxTextureSize, 1, 5, sceneOrEngine, false, false, 1, 1);
        this._randomTexture.name = "GPUParticleSystem_random1";
        this._randomTexture.wrapU = 1;
        this._randomTexture.wrapV = 1;
        d = [];
        for (let i = 0; i < maxTextureSize; ++i) {
            d.push(Math.random());
            d.push(Math.random());
            d.push(Math.random());
            d.push(Math.random());
        }
        this._randomTexture2 = new rawTexture/* RawTexture */.I(new Float32Array(d), maxTextureSize, 1, 5, sceneOrEngine, false, false, 1, 1);
        this._randomTexture2.name = "GPUParticleSystem_random2";
        this._randomTexture2.wrapU = 1;
        this._randomTexture2.wrapV = 1;
        this._randomTextureSize = maxTextureSize;
    }
    _reset() {
        this._releaseBuffers();
    }
    _createVertexBuffers(updateBuffer, renderBuffer, spriteSource) {
        const renderVertexBuffers = {};
        renderVertexBuffers["position"] = renderBuffer.createVertexBuffer("position", 0, 3, this._attributesStrideSize, true);
        let offset = 3;
        renderVertexBuffers["age"] = renderBuffer.createVertexBuffer("age", offset, 1, this._attributesStrideSize, true);
        offset += 1;
        renderVertexBuffers["size"] = renderBuffer.createVertexBuffer("size", offset, 3, this._attributesStrideSize, true);
        offset += 3;
        renderVertexBuffers["life"] = renderBuffer.createVertexBuffer("life", offset, 1, this._attributesStrideSize, true);
        offset += 1;
        offset += 4; // seed
        if (this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED) {
            renderVertexBuffers["direction"] = renderBuffer.createVertexBuffer("direction", offset, 3, this._attributesStrideSize, true);
        }
        offset += 3; // direction
        if (this._platform.alignDataInBuffer) {
            offset += 1;
        }
        if (this.particleEmitterType instanceof CustomParticleEmitter) {
            offset += 3;
            if (this._platform.alignDataInBuffer) {
                offset += 1;
            }
        }
        if (!this._colorGradientsTexture) {
            renderVertexBuffers["color"] = renderBuffer.createVertexBuffer("color", offset, 4, this._attributesStrideSize, true);
            offset += 4;
        }
        if (!this._isBillboardBased) {
            renderVertexBuffers["initialDirection"] = renderBuffer.createVertexBuffer("initialDirection", offset, 3, this._attributesStrideSize, true);
            offset += 3;
            if (this._platform.alignDataInBuffer) {
                offset += 1;
            }
        }
        if (this.noiseTexture) {
            renderVertexBuffers["noiseCoordinates1"] = renderBuffer.createVertexBuffer("noiseCoordinates1", offset, 3, this._attributesStrideSize, true);
            offset += 3;
            if (this._platform.alignDataInBuffer) {
                offset += 1;
            }
            renderVertexBuffers["noiseCoordinates2"] = renderBuffer.createVertexBuffer("noiseCoordinates2", offset, 3, this._attributesStrideSize, true);
            offset += 3;
            if (this._platform.alignDataInBuffer) {
                offset += 1;
            }
        }
        renderVertexBuffers["angle"] = renderBuffer.createVertexBuffer("angle", offset, 1, this._attributesStrideSize, true);
        if (this._angularSpeedGradientsTexture) {
            offset++;
        }
        else {
            offset += 2;
        }
        if (this._isAnimationSheetEnabled) {
            renderVertexBuffers["cellIndex"] = renderBuffer.createVertexBuffer("cellIndex", offset, 1, this._attributesStrideSize, true);
            offset += 1;
            if (this.spriteRandomStartCell) {
                renderVertexBuffers["cellStartOffset"] = renderBuffer.createVertexBuffer("cellStartOffset", offset, 1, this._attributesStrideSize, true);
                offset += 1;
            }
        }
        renderVertexBuffers["offset"] = spriteSource.createVertexBuffer("offset", 0, 2);
        renderVertexBuffers["uv"] = spriteSource.createVertexBuffer("uv", 2, 2);
        this._renderVertexBuffers.push(renderVertexBuffers);
        this._platform.createVertexBuffers(updateBuffer, renderVertexBuffers);
        this.resetDrawCache();
    }
    _initialize(force = false) {
        if (this._buffer0 && !force) {
            return;
        }
        const engine = this._engine;
        const data = [];
        this._attributesStrideSize = 21;
        this._targetIndex = 0;
        if (this._platform.alignDataInBuffer) {
            this._attributesStrideSize += 1;
        }
        if (this.particleEmitterType instanceof CustomParticleEmitter) {
            this._attributesStrideSize += 3;
            if (this._platform.alignDataInBuffer) {
                this._attributesStrideSize += 1;
            }
        }
        if (!this.isBillboardBased) {
            this._attributesStrideSize += 3;
            if (this._platform.alignDataInBuffer) {
                this._attributesStrideSize += 1;
            }
        }
        if (this._colorGradientsTexture) {
            this._attributesStrideSize -= 4;
        }
        if (this._angularSpeedGradientsTexture) {
            this._attributesStrideSize -= 1;
        }
        if (this._isAnimationSheetEnabled) {
            this._attributesStrideSize += 1;
            if (this.spriteRandomStartCell) {
                this._attributesStrideSize += 1;
            }
        }
        if (this.noiseTexture) {
            this._attributesStrideSize += 6;
            if (this._platform.alignDataInBuffer) {
                this._attributesStrideSize += 2;
            }
        }
        if (this._platform.alignDataInBuffer) {
            this._attributesStrideSize += 3 - ((this._attributesStrideSize + 3) & 3); // round to multiple of 4
        }
        const usingCustomEmitter = this.particleEmitterType instanceof CustomParticleEmitter;
        const tmpVector = math_vector/* TmpVectors */.AA.Vector3[0];
        let offset = 0;
        for (let particleIndex = 0; particleIndex < this._capacity; particleIndex++) {
            // position
            data.push(0.0);
            data.push(0.0);
            data.push(0.0);
            // Age
            data.push(0.0); // create the particle as a dead one to create a new one at start
            // Size
            data.push(0.0);
            data.push(0.0);
            data.push(0.0);
            // life
            data.push(0.0);
            // Seed
            data.push(Math.random());
            data.push(Math.random());
            data.push(Math.random());
            data.push(Math.random());
            // direction
            if (usingCustomEmitter) {
                this.particleEmitterType.particleDestinationGenerator(particleIndex, null, tmpVector);
                data.push(tmpVector.x);
                data.push(tmpVector.y);
                data.push(tmpVector.z);
            }
            else {
                data.push(0.0);
                data.push(0.0);
                data.push(0.0);
            }
            if (this._platform.alignDataInBuffer) {
                data.push(0.0); // dummy0
            }
            offset += 16; // position, age, size, life, seed, direction, dummy0
            if (usingCustomEmitter) {
                this.particleEmitterType.particlePositionGenerator(particleIndex, null, tmpVector);
                data.push(tmpVector.x);
                data.push(tmpVector.y);
                data.push(tmpVector.z);
                if (this._platform.alignDataInBuffer) {
                    data.push(0.0); // dummy1
                }
                offset += 4;
            }
            if (!this._colorGradientsTexture) {
                // color
                data.push(0.0);
                data.push(0.0);
                data.push(0.0);
                data.push(0.0);
                offset += 4;
            }
            if (!this.isBillboardBased) {
                // initialDirection
                data.push(0.0);
                data.push(0.0);
                data.push(0.0);
                if (this._platform.alignDataInBuffer) {
                    data.push(0.0); // dummy2
                }
                offset += 4;
            }
            if (this.noiseTexture) {
                // Random coordinates for reading into noise texture
                data.push(Math.random());
                data.push(Math.random());
                data.push(Math.random());
                if (this._platform.alignDataInBuffer) {
                    data.push(0.0); // dummy3
                }
                data.push(Math.random());
                data.push(Math.random());
                data.push(Math.random());
                if (this._platform.alignDataInBuffer) {
                    data.push(0.0); // dummy4
                }
                offset += 8;
            }
            // angle
            data.push(0.0);
            offset += 1;
            if (!this._angularSpeedGradientsTexture) {
                data.push(0.0);
                offset += 1;
            }
            if (this._isAnimationSheetEnabled) {
                data.push(0.0);
                offset += 1;
                if (this.spriteRandomStartCell) {
                    data.push(0.0);
                    offset += 1;
                }
            }
            if (this._platform.alignDataInBuffer) {
                let numDummies = 3 - ((offset + 3) & 3);
                offset += numDummies;
                while (numDummies-- > 0) {
                    data.push(0.0);
                }
            }
        }
        // Sprite data
        const spriteData = new Float32Array([0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1, 0.5, -0.5, 1, 0, -0.5, -0.5, 0, 0]);
        const bufferData1 = this._platform.createParticleBuffer(data);
        const bufferData2 = this._platform.createParticleBuffer(data);
        // Buffers
        this._buffer0 = new Buffers_buffer/* Buffer */.h(engine, bufferData1, false, this._attributesStrideSize);
        this._buffer1 = new Buffers_buffer/* Buffer */.h(engine, bufferData2, false, this._attributesStrideSize);
        this._spriteBuffer = new Buffers_buffer/* Buffer */.h(engine, spriteData, false, 4);
        // Update & Render vertex buffers
        this._renderVertexBuffers = [];
        this._createVertexBuffers(this._buffer0, this._buffer1, this._spriteBuffer);
        this._createVertexBuffers(this._buffer1, this._buffer0, this._spriteBuffer);
        // Links
        this._sourceBuffer = this._buffer0;
        this._targetBuffer = this._buffer1;
    }
    /** @internal */
    _recreateUpdateEffect() {
        this._createColorGradientTexture();
        this._createSizeGradientTexture();
        this._createAngularSpeedGradientTexture();
        this._createVelocityGradientTexture();
        this._createLimitVelocityGradientTexture();
        this._createDragGradientTexture();
        let defines = this.particleEmitterType ? this.particleEmitterType.getEffectDefines() : "";
        if (this._isBillboardBased) {
            defines += "\n#define BILLBOARD";
        }
        if (this._colorGradientsTexture) {
            defines += "\n#define COLORGRADIENTS";
        }
        if (this._sizeGradientsTexture) {
            defines += "\n#define SIZEGRADIENTS";
        }
        if (this._angularSpeedGradientsTexture) {
            defines += "\n#define ANGULARSPEEDGRADIENTS";
        }
        if (this._velocityGradientsTexture) {
            defines += "\n#define VELOCITYGRADIENTS";
        }
        if (this._limitVelocityGradientsTexture) {
            defines += "\n#define LIMITVELOCITYGRADIENTS";
        }
        if (this._dragGradientsTexture) {
            defines += "\n#define DRAGGRADIENTS";
        }
        if (this.isAnimationSheetEnabled) {
            defines += "\n#define ANIMATESHEET";
            if (this.spriteRandomStartCell) {
                defines += "\n#define ANIMATESHEETRANDOMSTART";
            }
        }
        if (this.noiseTexture) {
            defines += "\n#define NOISE";
        }
        if (this.isLocal) {
            defines += "\n#define LOCAL";
        }
        if (this._platform.isUpdateBufferCreated() && this._cachedUpdateDefines === defines) {
            return this._platform.isUpdateBufferReady();
        }
        this._cachedUpdateDefines = defines;
        this._updateBuffer = this._platform.createUpdateBuffer(defines);
        return this._platform.isUpdateBufferReady();
    }
    /**
     * @internal
     */
    _getWrapper(blendMode) {
        const customWrapper = this._getCustomDrawWrapper(blendMode);
        if (customWrapper?.effect) {
            return customWrapper;
        }
        const defines = [];
        this.fillDefines(defines, blendMode);
        // Effect
        let drawWrapper = this._drawWrappers[blendMode];
        if (!drawWrapper) {
            drawWrapper = new Materials_drawWrapper/* DrawWrapper */.E(this._engine);
            if (drawWrapper.drawContext) {
                drawWrapper.drawContext.useInstancing = true;
            }
            this._drawWrappers[blendMode] = drawWrapper;
        }
        const join = defines.join("\n");
        if (drawWrapper.defines !== join) {
            const attributes = [];
            const uniforms = [];
            const samplers = [];
            this.fillUniformsAttributesAndSamplerNames(uniforms, attributes, samplers);
            drawWrapper.setEffect(this._engine.createEffect("gpuRenderParticles", attributes, uniforms, samplers, join), join);
        }
        return drawWrapper;
    }
    /**
     * @internal
     */
    static _GetAttributeNamesOrOptions(hasColorGradients = false, isAnimationSheetEnabled = false, isBillboardBased = false, isBillboardStretched = false) {
        const attributeNamesOrOptions = [Buffers_buffer/* VertexBuffer */.R.PositionKind, "age", "life", "size", "angle"];
        if (!hasColorGradients) {
            attributeNamesOrOptions.push(Buffers_buffer/* VertexBuffer */.R.ColorKind);
        }
        if (isAnimationSheetEnabled) {
            attributeNamesOrOptions.push("cellIndex");
        }
        if (!isBillboardBased) {
            attributeNamesOrOptions.push("initialDirection");
        }
        if (isBillboardStretched) {
            attributeNamesOrOptions.push("direction");
        }
        attributeNamesOrOptions.push("offset", Buffers_buffer/* VertexBuffer */.R.UVKind);
        return attributeNamesOrOptions;
    }
    /**
     * @internal
     */
    static _GetEffectCreationOptions(isAnimationSheetEnabled = false, useLogarithmicDepth = false, applyFog = false) {
        const effectCreationOption = ["emitterWM", "worldOffset", "view", "projection", "colorDead", "invView", "translationPivot", "eyePosition"];
        (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.TV)(effectCreationOption);
        if (isAnimationSheetEnabled) {
            effectCreationOption.push("sheetInfos");
        }
        if (useLogarithmicDepth) {
            effectCreationOption.push("logarithmicDepthConstant");
        }
        if (applyFog) {
            effectCreationOption.push("vFogInfos");
            effectCreationOption.push("vFogColor");
        }
        return effectCreationOption;
    }
    /**
     * Fill the defines array according to the current settings of the particle system
     * @param defines Array to be updated
     * @param blendMode blend mode to take into account when updating the array
     * @param fillImageProcessing fills the image processing defines
     */
    fillDefines(defines, blendMode = 0, fillImageProcessing = true) {
        if (this._scene) {
            (0,clipPlaneMaterialHelper/* prepareStringDefinesForClipPlanes */.tv)(this, this._scene, defines);
            if (this.applyFog && this._scene.fogEnabled && this._scene.fogMode !== core_scene/* Scene */.Z.FOGMODE_NONE) {
                defines.push("#define FOG");
            }
        }
        if (blendMode === ParticleSystem.BLENDMODE_MULTIPLY) {
            defines.push("#define BLENDMULTIPLYMODE");
        }
        if (this.isLocal) {
            defines.push("#define LOCAL");
        }
        if (this.useLogarithmicDepth) {
            defines.push("#define LOGARITHMICDEPTH");
        }
        if (this._isBillboardBased) {
            defines.push("#define BILLBOARD");
            switch (this.billboardMode) {
                case ParticleSystem.BILLBOARDMODE_Y:
                    defines.push("#define BILLBOARDY");
                    break;
                case ParticleSystem.BILLBOARDMODE_STRETCHED:
                    defines.push("#define BILLBOARDSTRETCHED");
                    break;
                case ParticleSystem.BILLBOARDMODE_ALL:
                    defines.push("#define BILLBOARDMODE_ALL");
                    break;
                default:
                    break;
            }
        }
        if (this._colorGradientsTexture) {
            defines.push("#define COLORGRADIENTS");
        }
        if (this.isAnimationSheetEnabled) {
            defines.push("#define ANIMATESHEET");
        }
        if (fillImageProcessing && this._imageProcessingConfiguration) {
            this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines);
            defines.push("" + this._imageProcessingConfigurationDefines.toString());
        }
    }
    /**
     * Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system
     * @param uniforms Uniforms array to fill
     * @param attributes Attributes array to fill
     * @param samplers Samplers array to fill
     */
    fillUniformsAttributesAndSamplerNames(uniforms, attributes, samplers) {
        attributes.push(...GPUParticleSystem._GetAttributeNamesOrOptions(!!this._colorGradientsTexture, this._isAnimationSheetEnabled, this._isBillboardBased, this._isBillboardBased && this.billboardMode === ParticleSystem.BILLBOARDMODE_STRETCHED));
        uniforms.push(...GPUParticleSystem._GetEffectCreationOptions(this._isAnimationSheetEnabled, this.useLogarithmicDepth, this.applyFog));
        samplers.push("diffuseSampler", "colorGradientSampler");
        if (this._imageProcessingConfiguration) {
            Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p.PrepareUniforms(uniforms, this._imageProcessingConfigurationDefines);
            Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p.PrepareSamplers(samplers, this._imageProcessingConfigurationDefines);
        }
    }
    /**
     * Animates the particle system for the current frame by emitting new particles and or animating the living ones.
     * @param preWarm defines if we are in the pre-warmimg phase
     */
    animate(preWarm = false) {
        this._timeDelta = this.updateSpeed * (preWarm ? this.preWarmStepOffset : this._scene?.getAnimationRatio() || 1);
        this._actualFrame += this._timeDelta;
        if (!this._stopped) {
            if (this.targetStopDuration && this._actualFrame >= this.targetStopDuration) {
                this.stop();
            }
        }
        if (this.updateInAnimate) {
            this._update();
        }
    }
    _createFactorGradientTexture(factorGradients, textureName) {
        const texture = this[textureName];
        if (!factorGradients || !factorGradients.length || texture) {
            return;
        }
        const data = new Float32Array(this._rawTextureWidth);
        for (let x = 0; x < this._rawTextureWidth; x++) {
            const ratio = x / this._rawTextureWidth;
            GradientHelper.GetCurrentGradient(ratio, factorGradients, (currentGradient, nextGradient, scale) => {
                data[x] = (0,math_scalar_functions.Lerp)(currentGradient.factor1, nextGradient.factor1, scale);
            });
        }
        this[textureName] = rawTexture/* RawTexture */.I.CreateRTexture(data, this._rawTextureWidth, 1, this._scene || this._engine, false, false, 1);
        this[textureName].name = textureName.substring(1);
    }
    _createSizeGradientTexture() {
        this._createFactorGradientTexture(this._sizeGradients, "_sizeGradientsTexture");
    }
    _createAngularSpeedGradientTexture() {
        this._createFactorGradientTexture(this._angularSpeedGradients, "_angularSpeedGradientsTexture");
    }
    _createVelocityGradientTexture() {
        this._createFactorGradientTexture(this._velocityGradients, "_velocityGradientsTexture");
    }
    _createLimitVelocityGradientTexture() {
        this._createFactorGradientTexture(this._limitVelocityGradients, "_limitVelocityGradientsTexture");
    }
    _createDragGradientTexture() {
        this._createFactorGradientTexture(this._dragGradients, "_dragGradientsTexture");
    }
    _createColorGradientTexture() {
        if (!this._colorGradients || !this._colorGradients.length || this._colorGradientsTexture) {
            return;
        }
        const data = new Uint8Array(this._rawTextureWidth * 4);
        const tmpColor = math_color/* TmpColors */.IG.Color4[0];
        for (let x = 0; x < this._rawTextureWidth; x++) {
            const ratio = x / this._rawTextureWidth;
            GradientHelper.GetCurrentGradient(ratio, this._colorGradients, (currentGradient, nextGradient, scale) => {
                math_color/* Color4 */.ov.LerpToRef(currentGradient.color1, nextGradient.color1, scale, tmpColor);
                data[x * 4] = tmpColor.r * 255;
                data[x * 4 + 1] = tmpColor.g * 255;
                data[x * 4 + 2] = tmpColor.b * 255;
                data[x * 4 + 3] = tmpColor.a * 255;
            });
        }
        this._colorGradientsTexture = rawTexture/* RawTexture */.I.CreateRGBATexture(data, this._rawTextureWidth, 1, this._scene, false, false, 1);
        this._colorGradientsTexture.name = "colorGradients";
    }
    _render(blendMode, emitterWM) {
        // Enable render effect
        const drawWrapper = this._getWrapper(blendMode);
        const effect = drawWrapper.effect;
        this._engine.enableEffect(drawWrapper);
        const viewMatrix = this._scene?.getViewMatrix() || math_vector/* Matrix */.uq.IdentityReadOnly;
        effect.setMatrix("view", viewMatrix);
        effect.setMatrix("projection", this.defaultProjectionMatrix ?? this._scene.getProjectionMatrix());
        effect.setTexture("diffuseSampler", this.particleTexture);
        effect.setVector2("translationPivot", this.translationPivot);
        effect.setVector3("worldOffset", this.worldOffset);
        if (this.isLocal) {
            effect.setMatrix("emitterWM", emitterWM);
        }
        if (this._colorGradientsTexture) {
            effect.setTexture("colorGradientSampler", this._colorGradientsTexture);
        }
        else {
            effect.setDirectColor4("colorDead", this.colorDead);
        }
        if (this._isAnimationSheetEnabled && this.particleTexture) {
            const baseSize = this.particleTexture.getBaseSize();
            effect.setFloat3("sheetInfos", this.spriteCellWidth / baseSize.width, this.spriteCellHeight / baseSize.height, baseSize.width / this.spriteCellWidth);
        }
        if (this._isBillboardBased && this._scene) {
            const camera = this._scene.activeCamera;
            effect.setVector3("eyePosition", camera.globalPosition);
        }
        const defines = effect.defines;
        if (this._scene) {
            (0,clipPlaneMaterialHelper/* bindClipPlane */.gS)(effect, this, this._scene);
            if (this.applyFog) {
                (0,materialHelper_functions/* BindFogParameters */.Yy)(this._scene, undefined, effect);
            }
        }
        if (defines.indexOf("#define BILLBOARDMODE_ALL") >= 0) {
            const invView = viewMatrix.clone();
            invView.invert();
            effect.setMatrix("invView", invView);
        }
        // Log. depth
        if (this.useLogarithmicDepth && this._scene) {
            (0,materialHelper_functions/* BindLogDepth */.DL)(defines, effect, this._scene);
        }
        // image processing
        if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) {
            this._imageProcessingConfiguration.bind(effect);
        }
        // Draw order
        switch (blendMode) {
            case ParticleSystem.BLENDMODE_ADD:
                this._engine.setAlphaMode(1);
                break;
            case ParticleSystem.BLENDMODE_ONEONE:
                this._engine.setAlphaMode(6);
                break;
            case ParticleSystem.BLENDMODE_STANDARD:
                this._engine.setAlphaMode(2);
                break;
            case ParticleSystem.BLENDMODE_MULTIPLY:
                this._engine.setAlphaMode(4);
                break;
        }
        // Bind source VAO
        this._platform.bindDrawBuffers(this._targetIndex, effect, this._scene?.forceWireframe ? this._linesIndexBufferUseInstancing : null);
        if (this._onBeforeDrawParticlesObservable) {
            this._onBeforeDrawParticlesObservable.notifyObservers(effect);
        }
        // Render
        if (this._scene?.forceWireframe) {
            this._engine.drawElementsType(6, 0, 10, this._currentActiveCount);
        }
        else {
            this._engine.drawArraysType(7, 0, 4, this._currentActiveCount);
        }
        this._engine.setAlphaMode(0);
        if (this._scene?.forceWireframe) {
            this._engine.unbindInstanceAttributes();
        }
        return this._currentActiveCount;
    }
    /** @internal */
    _update(emitterWM) {
        if (!this.emitter || !this._targetBuffer) {
            return;
        }
        if (!this._recreateUpdateEffect() || this._rebuildingAfterContextLost) {
            return;
        }
        if (!emitterWM) {
            if (this.emitter.position) {
                const emitterMesh = this.emitter;
                emitterWM = emitterMesh.getWorldMatrix();
            }
            else {
                const emitterPosition = this.emitter;
                emitterWM = math_vector/* TmpVectors */.AA.Matrix[0];
                math_vector/* Matrix */.uq.TranslationToRef(emitterPosition.x, emitterPosition.y, emitterPosition.z, emitterWM);
            }
        }
        this._platform.preUpdateParticleBuffer();
        this._updateBuffer.setFloat("currentCount", this._currentActiveCount);
        this._updateBuffer.setFloat("timeDelta", this._timeDelta);
        this._updateBuffer.setFloat("stopFactor", this._stopped ? 0 : 1);
        this._updateBuffer.setInt("randomTextureSize", this._randomTextureSize);
        this._updateBuffer.setFloat2("lifeTime", this.minLifeTime, this.maxLifeTime);
        this._updateBuffer.setFloat2("emitPower", this.minEmitPower, this.maxEmitPower);
        if (!this._colorGradientsTexture) {
            this._updateBuffer.setDirectColor4("color1", this.color1);
            this._updateBuffer.setDirectColor4("color2", this.color2);
        }
        this._updateBuffer.setFloat2("sizeRange", this.minSize, this.maxSize);
        this._updateBuffer.setFloat4("scaleRange", this.minScaleX, this.maxScaleX, this.minScaleY, this.maxScaleY);
        this._updateBuffer.setFloat4("angleRange", this.minAngularSpeed, this.maxAngularSpeed, this.minInitialRotation, this.maxInitialRotation);
        this._updateBuffer.setVector3("gravity", this.gravity);
        if (this._limitVelocityGradientsTexture) {
            this._updateBuffer.setFloat("limitVelocityDamping", this.limitVelocityDamping);
        }
        if (this.particleEmitterType) {
            this.particleEmitterType.applyToShader(this._updateBuffer);
        }
        if (this._isAnimationSheetEnabled) {
            this._updateBuffer.setFloat4("cellInfos", this.startSpriteCellID, this.endSpriteCellID, this.spriteCellChangeSpeed, this.spriteCellLoop ? 1 : 0);
        }
        if (this.noiseTexture) {
            this._updateBuffer.setVector3("noiseStrength", this.noiseStrength);
        }
        if (!this.isLocal) {
            this._updateBuffer.setMatrix("emitterWM", emitterWM);
        }
        this._platform.updateParticleBuffer(this._targetIndex, this._targetBuffer, this._currentActiveCount);
        // Switch VAOs
        this._targetIndex++;
        if (this._targetIndex === 2) {
            this._targetIndex = 0;
        }
        // Switch buffers
        const tmpBuffer = this._sourceBuffer;
        this._sourceBuffer = this._targetBuffer;
        this._targetBuffer = tmpBuffer;
    }
    /**
     * Renders the particle system in its current state
     * @param preWarm defines if the system should only update the particles but not render them
     * @param forceUpdateOnly if true, force to only update the particles and never display them (meaning, even if preWarm=false, when forceUpdateOnly=true the particles won't be displayed)
     * @returns the current number of particles
     */
    render(preWarm = false, forceUpdateOnly = false) {
        if (!this._started) {
            return 0;
        }
        if (!this.isReady()) {
            return 0;
        }
        if (!preWarm && this._scene) {
            if (!this._preWarmDone && this.preWarmCycles) {
                for (let index = 0; index < this.preWarmCycles; index++) {
                    this.animate(true);
                    this.render(true, true);
                }
                this._preWarmDone = true;
            }
            if (this._currentRenderId === this._scene.getRenderId() &&
                (!this._scene.activeCamera || (this._scene.activeCamera && this._currentRenderingCameraUniqueId === this._scene.activeCamera.uniqueId))) {
                return 0;
            }
            this._currentRenderId = this._scene.getRenderId();
            if (this._scene.activeCamera) {
                this._currentRenderingCameraUniqueId = this._scene.activeCamera.uniqueId;
            }
        }
        // Get everything ready to render
        this._initialize();
        this._accumulatedCount += this.emitRate * this._timeDelta;
        if (this._accumulatedCount > 1) {
            const intPart = this._accumulatedCount | 0;
            this._accumulatedCount -= intPart;
            this._currentActiveCount += intPart;
        }
        this._currentActiveCount = Math.min(this._maxActiveParticleCount, this._currentActiveCount);
        if (!this._currentActiveCount) {
            return 0;
        }
        // Enable update effect
        let emitterWM;
        if (this.emitter.position) {
            const emitterMesh = this.emitter;
            emitterWM = emitterMesh.getWorldMatrix();
        }
        else {
            const emitterPosition = this.emitter;
            emitterWM = math_vector/* TmpVectors */.AA.Matrix[0];
            math_vector/* Matrix */.uq.TranslationToRef(emitterPosition.x, emitterPosition.y, emitterPosition.z, emitterWM);
        }
        const engine = this._engine;
        if (!this.updateInAnimate) {
            this._update(emitterWM);
        }
        let outparticles = 0;
        if (!preWarm && !forceUpdateOnly) {
            engine.setState(false);
            if (this.forceDepthWrite) {
                engine.setDepthWrite(true);
            }
            if (this.blendMode === ParticleSystem.BLENDMODE_MULTIPLYADD) {
                outparticles = this._render(ParticleSystem.BLENDMODE_MULTIPLY, emitterWM) + this._render(ParticleSystem.BLENDMODE_ADD, emitterWM);
            }
            else {
                outparticles = this._render(this.blendMode, emitterWM);
            }
            this._engine.setAlphaMode(0);
        }
        return outparticles;
    }
    /**
     * Rebuilds the particle system
     */
    rebuild() {
        const checkUpdateEffect = () => {
            if (!this._recreateUpdateEffect() || !this._platform.isUpdateBufferReady()) {
                setTimeout(checkUpdateEffect, 10);
            }
            else {
                this._initialize(true);
                this._rebuildingAfterContextLost = false;
            }
        };
        this._createIndexBuffer();
        this._cachedUpdateDefines = "";
        this._platform.contextLost();
        this._rebuildingAfterContextLost = true;
        checkUpdateEffect();
    }
    _releaseBuffers() {
        if (this._buffer0) {
            this._buffer0.dispose();
            this._buffer0 = null;
        }
        if (this._buffer1) {
            this._buffer1.dispose();
            this._buffer1 = null;
        }
        if (this._spriteBuffer) {
            this._spriteBuffer.dispose();
            this._spriteBuffer = null;
        }
        this._platform.releaseBuffers();
    }
    /**
     * Disposes the particle system and free the associated resources
     * @param disposeTexture defines if the particule texture must be disposed as well (true by default)
     */
    dispose(disposeTexture = true) {
        for (const blendMode in this._drawWrappers) {
            const drawWrapper = this._drawWrappers[blendMode];
            drawWrapper.dispose();
        }
        this._drawWrappers = {};
        if (this._scene) {
            const index = this._scene.particleSystems.indexOf(this);
            if (index > -1) {
                this._scene.particleSystems.splice(index, 1);
            }
        }
        this._releaseBuffers();
        this._platform.releaseVertexBuffers();
        for (let i = 0; i < this._renderVertexBuffers.length; ++i) {
            const rvb = this._renderVertexBuffers[i];
            for (const key in rvb) {
                rvb[key].dispose();
            }
        }
        this._renderVertexBuffers = [];
        if (this._colorGradientsTexture) {
            this._colorGradientsTexture.dispose();
            this._colorGradientsTexture = null;
        }
        if (this._sizeGradientsTexture) {
            this._sizeGradientsTexture.dispose();
            this._sizeGradientsTexture = null;
        }
        if (this._angularSpeedGradientsTexture) {
            this._angularSpeedGradientsTexture.dispose();
            this._angularSpeedGradientsTexture = null;
        }
        if (this._velocityGradientsTexture) {
            this._velocityGradientsTexture.dispose();
            this._velocityGradientsTexture = null;
        }
        if (this._limitVelocityGradientsTexture) {
            this._limitVelocityGradientsTexture.dispose();
            this._limitVelocityGradientsTexture = null;
        }
        if (this._dragGradientsTexture) {
            this._dragGradientsTexture.dispose();
            this._dragGradientsTexture = null;
        }
        if (this._randomTexture) {
            this._randomTexture.dispose();
            this._randomTexture = null;
        }
        if (this._randomTexture2) {
            this._randomTexture2.dispose();
            this._randomTexture2 = null;
        }
        if (disposeTexture && this.particleTexture) {
            this.particleTexture.dispose();
            this.particleTexture = null;
        }
        if (disposeTexture && this.noiseTexture) {
            this.noiseTexture.dispose();
            this.noiseTexture = null;
        }
        // Callback
        this.onStoppedObservable.clear();
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
    }
    /**
     * Clones the particle system.
     * @param name The name of the cloned object
     * @param newEmitter The new emitter to use
     * @param cloneTexture Also clone the textures if true
     * @returns the cloned particle system
     */
    clone(name, newEmitter, cloneTexture = false) {
        const custom = { ...this._customWrappers };
        let program = null;
        const engine = this._engine;
        if (engine.createEffectForParticles) {
            if (this.customShader != null) {
                program = this.customShader;
                const defines = program.shaderOptions.defines.length > 0 ? program.shaderOptions.defines.join("\n") : "";
                custom[0] = engine.createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines, undefined, undefined, undefined, this);
            }
        }
        const serialization = this.serialize(cloneTexture);
        const result = GPUParticleSystem.Parse(serialization, this._scene || this._engine, this._rootUrl);
        result.name = name;
        result.customShader = program;
        result._customWrappers = custom;
        if (newEmitter === undefined) {
            newEmitter = this.emitter;
        }
        if (this.noiseTexture) {
            result.noiseTexture = this.noiseTexture.clone();
        }
        result.emitter = newEmitter;
        return result;
    }
    /**
     * Serializes the particle system to a JSON object
     * @param serializeTexture defines if the texture must be serialized as well
     * @returns the JSON object
     */
    serialize(serializeTexture = false) {
        const serializationObject = {};
        ParticleSystem._Serialize(serializationObject, this, serializeTexture);
        serializationObject.activeParticleCount = this.activeParticleCount;
        serializationObject.randomTextureSize = this._randomTextureSize;
        serializationObject.customShader = this.customShader;
        return serializationObject;
    }
    /**
     * Parses a JSON object to create a GPU particle system.
     * @param parsedParticleSystem The JSON object to parse
     * @param sceneOrEngine The scene or the engine to create the particle system in
     * @param rootUrl The root url to use to load external dependencies like texture
     * @param doNotStart Ignore the preventAutoStart attribute and does not start
     * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
     * @returns the parsed GPU particle system
     */
    static Parse(parsedParticleSystem, sceneOrEngine, rootUrl, doNotStart = false, capacity) {
        const name = parsedParticleSystem.name;
        let engine;
        let scene;
        if (sceneOrEngine instanceof abstractEngine/* AbstractEngine */.$) {
            engine = sceneOrEngine;
        }
        else {
            scene = sceneOrEngine;
            engine = scene.getEngine();
        }
        const particleSystem = new GPUParticleSystem(name, { capacity: capacity || parsedParticleSystem.capacity, randomTextureSize: parsedParticleSystem.randomTextureSize }, sceneOrEngine, null, parsedParticleSystem.isAnimationSheetEnabled);
        particleSystem._rootUrl = rootUrl;
        if (parsedParticleSystem.customShader && engine.createEffectForParticles) {
            const program = parsedParticleSystem.customShader;
            const defines = program.shaderOptions.defines.length > 0 ? program.shaderOptions.defines.join("\n") : "";
            const custom = engine.createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines, undefined, undefined, undefined, particleSystem);
            particleSystem.setCustomEffect(custom, 0);
            particleSystem.customShader = program;
        }
        if (parsedParticleSystem.id) {
            particleSystem.id = parsedParticleSystem.id;
        }
        if (parsedParticleSystem.activeParticleCount) {
            particleSystem.activeParticleCount = parsedParticleSystem.activeParticleCount;
        }
        ParticleSystem._Parse(parsedParticleSystem, particleSystem, sceneOrEngine, rootUrl);
        // Auto start
        if (parsedParticleSystem.preventAutoStart) {
            particleSystem.preventAutoStart = parsedParticleSystem.preventAutoStart;
        }
        if (!doNotStart && !particleSystem.preventAutoStart) {
            particleSystem.start();
        }
        return particleSystem;
    }
}
//# sourceMappingURL=gpuParticleSystem.js.map
;// ./node_modules/@babylonjs/core/Particles/IParticleSystem.js

//# sourceMappingURL=IParticleSystem.js.map
;// ./node_modules/@babylonjs/core/Particles/particleSystemSet.js






/** Internal class used to store shapes for emitters */
class ParticleSystemSetEmitterCreationOptions {
}
/**
 * Represents a set of particle systems working together to create a specific effect
 */
class ParticleSystemSet {
    constructor() {
        this._emitterNodeIsOwned = true;
        /**
         * Gets the particle system list
         */
        this.systems = [];
    }
    /**
     * Gets or sets the emitter node used with this set
     */
    get emitterNode() {
        return this._emitterNode;
    }
    set emitterNode(value) {
        if (this._emitterNodeIsOwned && this._emitterNode) {
            if (this._emitterNode.dispose) {
                this._emitterNode.dispose();
            }
            this._emitterNodeIsOwned = false;
        }
        for (const system of this.systems) {
            system.emitter = value;
        }
        this._emitterNode = value;
    }
    /**
     * Creates a new emitter mesh as a sphere
     * @param options defines the options used to create the sphere
     * @param options.diameter
     * @param options.segments
     * @param options.color
     * @param renderingGroupId defines the renderingGroupId to use for the sphere
     * @param scene defines the hosting scene
     */
    setEmitterAsSphere(options, renderingGroupId, scene) {
        if (this._emitterNodeIsOwned && this._emitterNode) {
            if (this._emitterNode.dispose) {
                this._emitterNode.dispose();
            }
        }
        this._emitterNodeIsOwned = true;
        this._emitterCreationOptions = {
            kind: "Sphere",
            options: options,
            renderingGroupId: renderingGroupId,
        };
        const emitterMesh = CreateSphere("emitterSphere", { diameter: options.diameter, segments: options.segments }, scene);
        emitterMesh.renderingGroupId = renderingGroupId;
        const material = new standardMaterial/* StandardMaterial */.F("emitterSphereMaterial", scene);
        material.emissiveColor = options.color;
        emitterMesh.material = material;
        for (const system of this.systems) {
            system.emitter = emitterMesh;
        }
        this._emitterNode = emitterMesh;
    }
    /**
     * Starts all particle systems of the set
     * @param emitter defines an optional mesh to use as emitter for the particle systems
     */
    start(emitter) {
        for (const system of this.systems) {
            if (emitter) {
                system.emitter = emitter;
            }
            system.start();
        }
    }
    /**
     * Release all associated resources
     */
    dispose() {
        for (const system of this.systems) {
            system.dispose();
        }
        this.systems.length = 0;
        if (this._emitterNode) {
            if (this._emitterNode.dispose) {
                this._emitterNode.dispose();
            }
            this._emitterNode = null;
        }
    }
    /**
     * Serialize the set into a JSON compatible object
     * @param serializeTexture defines if the texture must be serialized as well
     * @returns a JSON compatible representation of the set
     */
    serialize(serializeTexture = false) {
        const result = {};
        result.systems = [];
        for (const system of this.systems) {
            result.systems.push(system.serialize(serializeTexture));
        }
        if (this._emitterNode) {
            result.emitter = this._emitterCreationOptions;
        }
        return result;
    }
    /**
     * Parse a new ParticleSystemSet from a serialized source
     * @param data defines a JSON compatible representation of the set
     * @param scene defines the hosting scene
     * @param gpu defines if we want GPU particles or CPU particles
     * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
     * @returns a new ParticleSystemSet
     */
    static Parse(data, scene, gpu = false, capacity) {
        const result = new ParticleSystemSet();
        const rootUrl = this.BaseAssetsUrl + "/textures/";
        scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        for (const system of data.systems) {
            result.systems.push(gpu ? GPUParticleSystem.Parse(system, scene, rootUrl, true, capacity) : ParticleSystem.Parse(system, scene, rootUrl, true, capacity));
        }
        if (data.emitter) {
            const options = data.emitter.options;
            switch (data.emitter.kind) {
                case "Sphere":
                    result.setEmitterAsSphere({
                        diameter: options.diameter,
                        segments: options.segments,
                        color: math_color/* Color3 */.v9.FromArray(options.color),
                    }, data.emitter.renderingGroupId, scene);
                    break;
            }
        }
        return result;
    }
}
/**
 * Gets or sets base Assets URL
 */
ParticleSystemSet.BaseAssetsUrl = "https://assets.babylonjs.com/particles";
//# sourceMappingURL=particleSystemSet.js.map
;// ./node_modules/@babylonjs/core/Particles/particleHelper.js









/**
 * This class is made for on one-liner static method to help creating particle system set.
 */
class ParticleHelper {
    /**
     * Create a default particle system that you can tweak
     * @param emitter defines the emitter to use
     * @param capacity defines the system capacity (default is 500 particles)
     * @param scene defines the hosting scene
     * @param useGPU defines if a GPUParticleSystem must be created (default is false)
     * @returns the new Particle system
     */
    static CreateDefault(emitter, capacity = 500, scene, useGPU = false) {
        let system;
        if (useGPU) {
            system = new GPUParticleSystem("default system", { capacity: capacity }, scene);
        }
        else {
            system = new ParticleSystem("default system", capacity, scene);
        }
        system.emitter = emitter;
        system.particleTexture = new Textures_texture/* Texture */.g("https://assets.babylonjs.com/textures/flare.png", system.getScene());
        system.createConeEmitter(0.1, Math.PI / 4);
        // Particle color
        system.color1 = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        system.color2 = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        system.colorDead = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 0.0);
        // Particle Size
        system.minSize = 0.1;
        system.maxSize = 0.1;
        // Emission speed
        system.minEmitPower = 2;
        system.maxEmitPower = 2;
        // Update speed
        system.updateSpeed = 1 / 60;
        system.emitRate = 30;
        return system;
    }
    /**
     * This is the main static method (one-liner) of this helper to create different particle systems
     * @param type This string represents the type to the particle system to create
     * @param scene The scene where the particle system should live
     * @param gpu If the system will use gpu
     * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
     * @returns the ParticleSystemSet created
     */
    static CreateAsync(type, scene, gpu = false, capacity) {
        if (!scene) {
            scene = engineStore/* EngineStore */.q.LastCreatedScene;
        }
        const token = {};
        scene.addPendingData(token);
        return new Promise((resolve, reject) => {
            if (gpu && !GPUParticleSystem.IsSupported) {
                scene.removePendingData(token);
                return reject("Particle system with GPU is not supported.");
            }
            tools/* Tools */.S0.LoadFile(`${ParticleHelper.BaseAssetsUrl}/systems/${type}.json`, (data) => {
                scene.removePendingData(token);
                const newData = JSON.parse(data.toString());
                return resolve(ParticleSystemSet.Parse(newData, scene, gpu, capacity));
            }, undefined, undefined, undefined, () => {
                scene.removePendingData(token);
                return reject(`An error occurred with the creation of your particle system. Check if your type '${type}' exists.`);
            });
        });
    }
    /**
     * Static function used to export a particle system to a ParticleSystemSet variable.
     * Please note that the emitter shape is not exported
     * @param systems defines the particle systems to export
     * @returns the created particle system set
     */
    static ExportSet(systems) {
        const set = new ParticleSystemSet();
        for (const system of systems) {
            set.systems.push(system);
        }
        return set;
    }
    /**
     * Creates a particle system from a snippet saved in a remote file
     * @param name defines the name of the particle system to create (can be null or empty to use the one from the json data)
     * @param url defines the url to load from
     * @param scene defines the hosting scene
     * @param gpu If the system will use gpu
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
     * @returns a promise that will resolve to the new particle system
     */
    static ParseFromFileAsync(name, url, scene, gpu = false, rootUrl = "", capacity) {
        return new Promise((resolve, reject) => {
            const request = new webRequest/* WebRequest */.u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const serializationObject = JSON.parse(request.responseText);
                        let output;
                        if (gpu) {
                            output = GPUParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);
                        }
                        else {
                            output = ParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);
                        }
                        if (name) {
                            output.name = name;
                        }
                        resolve(output);
                    }
                    else {
                        reject("Unable to load the particle system");
                    }
                }
            });
            request.open("GET", url);
            request.send();
        });
    }
    /**
     * Creates a particle system from a snippet saved by the particle system editor
     * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)
     * @param scene defines the hosting scene
     * @param gpu If the system will use gpu
     * @param rootUrl defines the root URL to use to load textures and relative dependencies
     * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
     * @returns a promise that will resolve to the new particle system
     */
    static ParseFromSnippetAsync(snippetId, scene, gpu = false, rootUrl = "", capacity) {
        if (snippetId === "_BLANK") {
            const system = this.CreateDefault(null);
            system.start();
            return Promise.resolve(system);
        }
        return new Promise((resolve, reject) => {
            const request = new webRequest/* WebRequest */.u();
            request.addEventListener("readystatechange", () => {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);
                        const serializationObject = JSON.parse(snippet.particleSystem);
                        let output;
                        if (gpu) {
                            output = GPUParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);
                        }
                        else {
                            output = ParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);
                        }
                        output.snippetId = snippetId;
                        resolve(output);
                    }
                    else {
                        reject("Unable to load the snippet " + snippetId);
                    }
                }
            });
            request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/"));
            request.send();
        });
    }
}
/**
 * Gets or sets base Assets URL
 */
ParticleHelper.BaseAssetsUrl = ParticleSystemSet.BaseAssetsUrl;
/** Define the Url to load snippets */
ParticleHelper.SnippetUrl = `https://snippet.babylonjs.com`;
/**
 * Creates a particle system from a snippet saved by the particle system editor
 * @deprecated Please use ParseFromSnippetAsync instead
 * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)
 * @param scene defines the hosting scene
 * @param gpu If the system will use gpu
 * @param rootUrl defines the root URL to use to load textures and relative dependencies
 * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)
 * @returns a promise that will resolve to the new particle system
 */
ParticleHelper.CreateFromSnippetAsync = ParticleHelper.ParseFromSnippetAsync;
//# sourceMappingURL=particleHelper.js.map
;// ./node_modules/@babylonjs/core/Particles/particleSystemComponent.js






// Adds the parsers to the scene parsers.
(0,babylonFileParser_function/* AddParser */.ji)(sceneComponent/* SceneComponentConstants */.v.NAME_PARTICLESYSTEM, (parsedData, scene, container, rootUrl) => {
    const individualParser = (0,babylonFileParser_function/* GetIndividualParser */.LO)(sceneComponent/* SceneComponentConstants */.v.NAME_PARTICLESYSTEM);
    if (!individualParser) {
        return;
    }
    // Particles Systems
    if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) {
        for (let index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {
            const parsedParticleSystem = parsedData.particleSystems[index];
            container.particleSystems.push(individualParser(parsedParticleSystem, scene, rootUrl));
        }
    }
});
(0,babylonFileParser_function/* AddIndividualParser */.cf)(sceneComponent/* SceneComponentConstants */.v.NAME_PARTICLESYSTEM, (parsedParticleSystem, scene, rootUrl) => {
    if (parsedParticleSystem.activeParticleCount) {
        const ps = GPUParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
        return ps;
    }
    else {
        const ps = ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
        return ps;
    }
});
abstractEngine/* AbstractEngine */.$.prototype.createEffectForParticles = function (fragmentName, uniformsNames = [], samplers = [], defines = "", fallbacks, onCompiled, onError, particleSystem, shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
    let attributesNamesOrOptions = [];
    let effectCreationOption = [];
    const allSamplers = [];
    if (particleSystem) {
        particleSystem.fillUniformsAttributesAndSamplerNames(effectCreationOption, attributesNamesOrOptions, allSamplers);
    }
    else {
        attributesNamesOrOptions = ParticleSystem._GetAttributeNamesOrOptions();
        effectCreationOption = ParticleSystem._GetEffectCreationOptions();
    }
    if (defines.indexOf(" BILLBOARD") === -1) {
        defines += "\n#define BILLBOARD\n";
    }
    if (particleSystem?.isAnimationSheetEnabled) {
        if (defines.indexOf(" ANIMATESHEET") === -1) {
            defines += "\n#define ANIMATESHEET\n";
        }
    }
    if (samplers.indexOf("diffuseSampler") === -1) {
        samplers.push("diffuseSampler");
    }
    return this.createEffect({
        vertex: particleSystem?.vertexShaderName ?? "particles",
        fragmentElement: fragmentName,
    }, attributesNamesOrOptions, effectCreationOption.concat(uniformsNames), allSamplers.concat(samplers), defines, fallbacks, onCompiled, onError, undefined, shaderLanguage, async () => {
        if (shaderLanguage === 0 /* ShaderLanguage.GLSL */) {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 59384));
        }
        else {
            await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 27323));
        }
    });
};
Meshes_mesh/* Mesh */.e.prototype.getEmittedParticleSystems = function () {
    const results = [];
    for (let index = 0; index < this.getScene().particleSystems.length; index++) {
        const particleSystem = this.getScene().particleSystems[index];
        if (particleSystem.emitter === this) {
            results.push(particleSystem);
        }
    }
    return results;
};
Meshes_mesh/* Mesh */.e.prototype.getHierarchyEmittedParticleSystems = function () {
    const results = [];
    const descendants = this.getDescendants();
    descendants.push(this);
    for (let index = 0; index < this.getScene().particleSystems.length; index++) {
        const particleSystem = this.getScene().particleSystems[index];
        const emitter = particleSystem.emitter;
        if (emitter.position && descendants.indexOf(emitter) !== -1) {
            results.push(particleSystem);
        }
    }
    return results;
};
//# sourceMappingURL=particleSystemComponent.js.map
;// ./node_modules/@babylonjs/core/Particles/solidParticle.js





/**
 * Represents one particle of a solid particle system.
 */
class SolidParticle {
    /**
     * Particle BoundingInfo object
     * @returns a BoundingInfo
     */
    getBoundingInfo() {
        return this._boundingInfo;
    }
    /**
     * Returns true if there is already a bounding info
     */
    get hasBoundingInfo() {
        return this._boundingInfo !== null;
    }
    /**
     * Creates a Solid Particle object.
     * Don't create particles manually, use instead the Solid Particle System internal tools like _addParticle()
     * @param particleIndex (integer) is the particle index in the Solid Particle System pool.
     * @param particleId (integer) is the particle identifier. Unless some particles are removed from the SPS, it's the same value than the particle idx.
     * @param positionIndex (integer) is the starting index of the particle vertices in the SPS "positions" array.
     * @param indiceIndex (integer) is the starting index of the particle indices in the SPS "indices" array.
     * @param model (ModelShape) is a reference to the model shape on what the particle is designed.
     * @param shapeId (integer) is the model shape identifier in the SPS.
     * @param idxInShape (integer) is the index of the particle in the current model (ex: the 10th box of addShape(box, 30))
     * @param sps defines the sps it is associated to
     * @param modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.
     * @param materialIndex is the particle material identifier (integer) when the MultiMaterials are enabled in the SPS.
     */
    constructor(particleIndex, particleId, positionIndex, indiceIndex, model, shapeId, idxInShape, sps, modelBoundingInfo = null, materialIndex = null) {
        /**
         * particle global index
         */
        this.idx = 0;
        /**
         * particle identifier
         */
        this.id = 0;
        /**
         * The color of the particle
         */
        this.color = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        /**
         * The world space position of the particle.
         */
        this.position = math_vector/* Vector3 */.Pq.Zero();
        /**
         * The world space rotation of the particle. (Not use if rotationQuaternion is set)
         */
        this.rotation = math_vector/* Vector3 */.Pq.Zero();
        /**
         * The scaling of the particle.
         */
        this.scaling = math_vector/* Vector3 */.Pq.One();
        /**
         * The uvs of the particle.
         */
        this.uvs = new math_vector/* Vector4 */.IU(0.0, 0.0, 1.0, 1.0);
        /**
         * The current speed of the particle.
         */
        this.velocity = math_vector/* Vector3 */.Pq.Zero();
        /**
         * The pivot point in the particle local space.
         */
        this.pivot = math_vector/* Vector3 */.Pq.Zero();
        /**
         * Must the particle be translated from its pivot point in its local space ?
         * In this case, the pivot point is set at the origin of the particle local space and the particle is translated.
         * Default : false
         */
        this.translateFromPivot = false;
        /**
         * Is the particle active or not ?
         */
        this.alive = true;
        /**
         * Is the particle visible or not ?
         */
        this.isVisible = true;
        /**
         * Index of this particle in the global "positions" array (Internal use)
         * @internal
         */
        this._pos = 0;
        /**
         * @internal Index of this particle in the global "indices" array (Internal use)
         */
        this._ind = 0;
        /**
         * ModelShape id of this particle
         */
        this.shapeId = 0;
        /**
         * Index of the particle in its shape id
         */
        this.idxInShape = 0;
        /**
         * @internal Still set as invisible in order to skip useless computations (Internal use)
         */
        this._stillInvisible = false;
        /**
         * @internal Last computed particle rotation matrix
         */
        this._rotationMatrix = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0];
        /**
         * Parent particle Id, if any.
         * Default null.
         */
        this.parentId = null;
        /**
         * The particle material identifier (integer) when MultiMaterials are enabled in the SPS.
         */
        this.materialIndex = null;
        /**
         * Custom object or properties.
         */
        this.props = null;
        /**
         * The culling strategy to use to check whether the solid particle must be culled or not when using isInFrustum().
         * The possible values are :
         * - AbstractMesh.CULLINGSTRATEGY_STANDARD
         * - AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY
         * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION
         * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY
         * The default value for solid particles is AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY
         * Please read each static variable documentation in the class AbstractMesh to get details about the culling process.
         * */
        this.cullingStrategy = abstractMesh/* AbstractMesh */.u.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY;
        /**
         * @internal Internal global position in the SPS.
         */
        this._globalPosition = math_vector/* Vector3 */.Pq.Zero();
        this.idx = particleIndex;
        this.id = particleId;
        this._pos = positionIndex;
        this._ind = indiceIndex;
        this._model = model;
        this.shapeId = shapeId;
        this.idxInShape = idxInShape;
        this._sps = sps;
        if (modelBoundingInfo) {
            this._modelBoundingInfo = modelBoundingInfo;
            this._boundingInfo = new boundingInfo/* BoundingInfo */.j(modelBoundingInfo.minimum, modelBoundingInfo.maximum);
        }
        if (materialIndex !== null) {
            this.materialIndex = materialIndex;
        }
    }
    /**
     * Copies the particle property values into the existing target : position, rotation, scaling, uvs, colors, pivot, parent, visibility, alive
     * @param target the particle target
     * @returns the current particle
     */
    copyToRef(target) {
        target.position.copyFrom(this.position);
        target.rotation.copyFrom(this.rotation);
        if (this.rotationQuaternion) {
            if (target.rotationQuaternion) {
                target.rotationQuaternion.copyFrom(this.rotationQuaternion);
            }
            else {
                target.rotationQuaternion = this.rotationQuaternion.clone();
            }
        }
        target.scaling.copyFrom(this.scaling);
        if (this.color) {
            if (target.color) {
                target.color.copyFrom(this.color);
            }
            else {
                target.color = this.color.clone();
            }
        }
        target.uvs.copyFrom(this.uvs);
        target.velocity.copyFrom(this.velocity);
        target.pivot.copyFrom(this.pivot);
        target.translateFromPivot = this.translateFromPivot;
        target.alive = this.alive;
        target.isVisible = this.isVisible;
        target.parentId = this.parentId;
        target.cullingStrategy = this.cullingStrategy;
        if (this.materialIndex !== null) {
            target.materialIndex = this.materialIndex;
        }
        return this;
    }
    /**
     * Legacy support, changed scale to scaling
     */
    get scale() {
        return this.scaling;
    }
    /**
     * Legacy support, changed scale to scaling
     */
    set scale(scale) {
        this.scaling = scale;
    }
    /**
     * Legacy support, changed quaternion to rotationQuaternion
     */
    get quaternion() {
        return this.rotationQuaternion;
    }
    /**
     * Legacy support, changed quaternion to rotationQuaternion
     */
    set quaternion(q) {
        this.rotationQuaternion = q;
    }
    /**
     * Returns a boolean. True if the particle intersects another particle or another mesh, else false.
     * The intersection is computed on the particle bounding sphere and Axis Aligned Bounding Box (AABB)
     * @param target is the object (solid particle or mesh) what the intersection is computed against.
     * @returns true if it intersects
     */
    intersectsMesh(target) {
        if (!this._boundingInfo || !target.hasBoundingInfo) {
            return false;
        }
        if (this._sps._bSphereOnly) {
            return boundingSphere/* BoundingSphere */.i.Intersects(this._boundingInfo.boundingSphere, target.getBoundingInfo().boundingSphere);
        }
        return this._boundingInfo.intersects(target.getBoundingInfo(), false);
    }
    /**
     * Returns `true` if the solid particle is within the frustum defined by the passed array of planes.
     * A particle is in the frustum if its bounding box intersects the frustum
     * @param frustumPlanes defines the frustum to test
     * @returns true if the particle is in the frustum planes
     */
    isInFrustum(frustumPlanes) {
        return this._boundingInfo !== null && this._boundingInfo.isInFrustum(frustumPlanes, this.cullingStrategy);
    }
    /**
     * get the rotation matrix of the particle
     * @internal
     */
    getRotationMatrix(m) {
        let quaternion;
        if (this.rotationQuaternion) {
            quaternion = this.rotationQuaternion;
        }
        else {
            quaternion = math_vector/* TmpVectors */.AA.Quaternion[0];
            const rotation = this.rotation;
            math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);
        }
        quaternion.toRotationMatrix(m);
    }
}
/**
 * Represents the shape of the model used by one particle of a solid particle system.
 * SPS internal tool, don't use it manually.
 */
class ModelShape {
    /**
     * Get or set the shapeId
     * @deprecated Please use shapeId instead
     */
    get shapeID() {
        return this.shapeId;
    }
    set shapeID(shapeID) {
        this.shapeId = shapeID;
    }
    /**
     * Creates a ModelShape object. This is an internal simplified reference to a mesh used as for a model to replicate particles from by the SPS.
     * SPS internal tool, don't use it manually.
     * @internal
     */
    constructor(id, shape, indices, normals, colors, shapeUV, posFunction, vtxFunction, material) {
        /**
         * length of the shape in the model indices array (internal use)
         * @internal
         */
        this._indicesLength = 0;
        this.shapeId = id;
        this._shape = shape;
        this._indices = indices;
        this._indicesLength = indices.length;
        this._shapeUV = shapeUV;
        this._shapeColors = colors;
        this._normals = normals;
        this._positionFunction = posFunction;
        this._vertexFunction = vtxFunction;
        this._material = material;
    }
}
/**
 * Represents a Depth Sorted Particle in the solid particle system.
 * @internal
 */
class DepthSortedParticle {
    /**
     * Creates a new sorted particle
     * @param idx
     * @param ind
     * @param indLength
     * @param materialIndex
     */
    constructor(idx, ind, indLength, materialIndex) {
        /**
         * Particle index
         */
        this.idx = 0;
        /**
         * Index of the particle in the "indices" array
         */
        this.ind = 0;
        /**
         * Length of the particle shape in the "indices" array
         */
        this.indicesLength = 0;
        /**
         * Squared distance from the particle to the camera
         */
        this.sqDistance = 0.0;
        /**
         * Material index when used with MultiMaterials
         */
        this.materialIndex = 0;
        this.idx = idx;
        this.ind = ind;
        this.indicesLength = indLength;
        this.materialIndex = materialIndex;
    }
}
/**
 * Represents a solid particle vertex
 */
class SolidParticleVertex {
    /**
     * Creates a new solid particle vertex
     */
    constructor() {
        this.position = math_vector/* Vector3 */.Pq.Zero();
        this.color = new math_color/* Color4 */.ov(1.0, 1.0, 1.0, 1.0);
        this.uv = math_vector/* Vector2 */.I9.Zero();
    }
    // Getters and Setters for back-compatibility
    /** Vertex x coordinate */
    get x() {
        return this.position.x;
    }
    set x(val) {
        this.position.x = val;
    }
    /** Vertex y coordinate */
    get y() {
        return this.position.y;
    }
    set y(val) {
        this.position.y = val;
    }
    /** Vertex z coordinate */
    get z() {
        return this.position.z;
    }
    set z(val) {
        this.position.z = val;
    }
}
//# sourceMappingURL=solidParticle.js.map
;// ./node_modules/@babylonjs/core/Particles/solidParticleSystem.js













/**
 * The SPS is a single updatable mesh. The solid particles are simply separate parts or faces of this big mesh.
 *As it is just a mesh, the SPS has all the same properties than any other BJS mesh : not more, not less. It can be scaled, rotated, translated, enlighted, textured, moved, etc.

 * The SPS is also a particle system. It provides some methods to manage the particles.
 * However it is behavior agnostic. This means it has no emitter, no particle physics, no particle recycler. You have to implement your own behavior.
 *
 * Full documentation here : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_intro
 */
class SolidParticleSystem {
    /**
     * Creates a SPS (Solid Particle System) object.
     * @param name (String) is the SPS name, this will be the underlying mesh name.
     * @param scene (Scene) is the scene in which the SPS is added.
     * @param options defines the options of the sps e.g.
     * * updatable (optional boolean, default true) : if the SPS must be updatable or immutable.
     * * isPickable (optional boolean, default false) : if the solid particles must be pickable.
     * * enableDepthSort (optional boolean, default false) : if the solid particles must be sorted in the geometry according to their distance to the camera.
     * * useModelMaterial (optional boolean, default false) : if the model materials must be used to create the SPS multimaterial. This enables the multimaterial supports of the SPS.
     * * enableMultiMaterial (optional boolean, default false) : if the solid particles can be given different materials.
     * * expandable (optional boolean, default false) : if particles can still be added after the initial SPS mesh creation.
     * * particleIntersection (optional boolean, default false) : if the solid particle intersections must be computed.
     * * boundingSphereOnly (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster).
     * * bSphereRadiusFactor (optional float, default 1.0) : a number to multiply the bounding sphere radius by in order to reduce it for instance.
     * * computeBoundingBox (optional boolean, default false): if the bounding box of the entire SPS will be computed (for occlusion detection, for example). If it is false, the bounding box will be the bounding box of the first particle.
     * * autoFixFaceOrientation (optional boolean, default false): if the particle face orientations will be flipped for transformations that change orientation (scale (-1, 1, 1), for example)
     * @param options.updatable
     * @param options.isPickable
     * @param options.enableDepthSort
     * @param options.particleIntersection
     * @param options.boundingSphereOnly
     * @param options.bSphereRadiusFactor
     * @param options.expandable
     * @param options.useModelMaterial
     * @param options.enableMultiMaterial
     * @param options.computeBoundingBox
     * @param options.autoFixFaceOrientation
     * @example bSphereRadiusFactor = 1.0 / Math.sqrt(3.0) => the bounding sphere exactly matches a spherical mesh.
     */
    constructor(name, scene, options) {
        /**
         *  The SPS array of Solid Particle objects. Just access each particle as with any classic array.
         *  Example : var p = SPS.particles[i];
         */
        this.particles = new Array();
        /**
         * The SPS total number of particles. Read only. Use SPS.counter instead if you need to set your own value.
         */
        this.nbParticles = 0;
        /**
         * If the particles must ever face the camera (default false). Useful for planar particles.
         */
        this.billboard = false;
        /**
         * Recompute normals when adding a shape
         */
        this.recomputeNormals = false;
        /**
         * This a counter ofr your own usage. It's not set by any SPS functions.
         */
        this.counter = 0;
        /**
         * This empty object is intended to store some SPS specific or temporary values in order to lower the Garbage Collector activity.
         * Please read : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/optimize_sps#limit-garbage-collection
         */
        this.vars = {};
        /**
         * If the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster). (Internal use only)
         * @internal
         */
        this._bSphereOnly = false;
        /**
         * A number to multiply the bounding sphere radius by in order to reduce it for instance. (Internal use only)
         * @internal
         */
        this._bSphereRadiusFactor = 1.0;
        this._positions = new Array();
        this._indices = new Array();
        this._normals = new Array();
        this._colors = new Array();
        this._uvs = new Array();
        this._index = 0; // indices index
        this._updatable = true;
        this._pickable = false;
        this._isVisibilityBoxLocked = false;
        this._alwaysVisible = false;
        this._depthSort = false;
        this._expandable = false;
        this._shapeCounter = 0;
        this._copy = new SolidParticle(0, 0, 0, 0, null, 0, 0, this);
        this._color = new math_color/* Color4 */.ov(0, 0, 0, 0);
        this._computeParticleColor = true;
        this._computeParticleTexture = true;
        this._computeParticleRotation = true;
        this._computeParticleVertex = false;
        this._computeBoundingBox = false;
        this._autoFixFaceOrientation = false;
        this._depthSortParticles = true;
        this._mustUnrotateFixedNormals = false;
        this._particlesIntersect = false;
        this._needs32Bits = false;
        this._isNotBuilt = true;
        this._lastParticleId = 0;
        this._idxOfId = []; // array : key = particle.id / value = particle.idx
        this._multimaterialEnabled = false;
        this._useModelMaterial = false;
        this._depthSortFunction = (p1, p2) => p2.sqDistance - p1.sqDistance;
        this._materialSortFunction = (p1, p2) => p1.materialIndex - p2.materialIndex;
        this._autoUpdateSubMeshes = false;
        this._recomputeInvisibles = false;
        this.name = name;
        this._scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        this._camera = scene.activeCamera;
        this._pickable = options ? options.isPickable : false;
        this._depthSort = options ? options.enableDepthSort : false;
        this._multimaterialEnabled = options ? options.enableMultiMaterial : false;
        this._useModelMaterial = options ? options.useModelMaterial : false;
        this._multimaterialEnabled = this._useModelMaterial ? true : this._multimaterialEnabled;
        this._expandable = options ? options.expandable : false;
        this._particlesIntersect = options ? options.particleIntersection : false;
        this._bSphereOnly = options ? options.boundingSphereOnly : false;
        this._bSphereRadiusFactor = options && options.bSphereRadiusFactor ? options.bSphereRadiusFactor : 1.0;
        this._computeBoundingBox = options?.computeBoundingBox ? options.computeBoundingBox : false;
        this._autoFixFaceOrientation = options?.autoFixFaceOrientation ? options.autoFixFaceOrientation : false;
        if (options && options.updatable !== undefined) {
            this._updatable = options.updatable;
        }
        else {
            this._updatable = true;
        }
        if (this._pickable) {
            this.pickedBySubMesh = [[]];
            this.pickedParticles = this.pickedBySubMesh[0];
        }
        if (this._depthSort || this._multimaterialEnabled) {
            this.depthSortedParticles = [];
        }
        if (this._multimaterialEnabled) {
            this._multimaterial = new Materials_multiMaterial/* MultiMaterial */.F(this.name + "MultiMaterial", this._scene);
            this._materials = [];
            this._materialIndexesById = {};
        }
        this._tmpVertex = new SolidParticleVertex();
    }
    /**
     * Builds the SPS underlying mesh. Returns a standard Mesh.
     * If no model shape was added to the SPS, the returned mesh is just a single triangular plane.
     * @returns the created mesh
     */
    buildMesh() {
        if (!this._isNotBuilt && this.mesh) {
            return this.mesh;
        }
        if (this.nbParticles === 0 && !this.mesh) {
            const triangle = CreateDisc("", { radius: 1, tessellation: 3 }, this._scene);
            this.addShape(triangle, 1);
            triangle.dispose();
        }
        this._indices32 = this._needs32Bits ? new Uint32Array(this._indices) : new Uint16Array(this._indices);
        this._positions32 = new Float32Array(this._positions);
        this._uvs32 = new Float32Array(this._uvs);
        this._colors32 = new Float32Array(this._colors);
        if (!this.mesh) {
            // in case it's already expanded
            const mesh = new Meshes_mesh/* Mesh */.e(this.name, this._scene);
            this.mesh = mesh;
        }
        if (!this._updatable && this._multimaterialEnabled) {
            this._sortParticlesByMaterial(); // this may reorder the indices32
        }
        if (this.recomputeNormals) {
            mesh_vertexData/* VertexData */.P.ComputeNormals(this._positions32, this._indices32, this._normals);
        }
        this._normals32 = new Float32Array(this._normals);
        this._fixedNormal32 = new Float32Array(this._normals);
        if (this._mustUnrotateFixedNormals) {
            // the particles could be created already rotated in the mesh with a positionFunction
            this._unrotateFixedNormals();
        }
        const vertexData = new mesh_vertexData/* VertexData */.P();
        vertexData.indices = this._depthSort ? this._indices : this._indices32;
        vertexData.set(this._positions32, Buffers_buffer/* VertexBuffer */.R.PositionKind);
        vertexData.set(this._normals32, Buffers_buffer/* VertexBuffer */.R.NormalKind);
        if (this._uvs32.length > 0) {
            vertexData.set(this._uvs32, Buffers_buffer/* VertexBuffer */.R.UVKind);
        }
        if (this._colors32.length > 0) {
            vertexData.set(this._colors32, Buffers_buffer/* VertexBuffer */.R.ColorKind);
        }
        vertexData.applyToMesh(this.mesh, this._updatable);
        this.mesh.isPickable = this._pickable;
        if (this._pickable) {
            let faceId = 0;
            for (let p = 0; p < this.nbParticles; p++) {
                const part = this.particles[p];
                const lind = part._model._indicesLength;
                for (let i = 0; i < lind; i++) {
                    const f = i % 3;
                    if (f == 0) {
                        const pickedData = { idx: part.idx, faceId: faceId };
                        this.pickedParticles[faceId] = pickedData;
                        faceId++;
                    }
                }
            }
        }
        if (this._multimaterialEnabled) {
            this.setMultiMaterial(this._materials);
        }
        if (!this._expandable) {
            // free memory
            if (!this._depthSort && !this._multimaterialEnabled && !this._autoFixFaceOrientation) {
                this._indices = null;
            }
            this._positions = null;
            this._normals = null;
            this._uvs = null;
            this._colors = null;
            if (!this._updatable) {
                this.particles.length = 0;
            }
        }
        this._isNotBuilt = false;
        this.recomputeNormals = false;
        this._recomputeInvisibles = true;
        return this.mesh;
    }
    _getUVKind(mesh, uvKind) {
        if (uvKind === -1) {
            if (mesh.material?.diffuseTexture) {
                uvKind = mesh.material.diffuseTexture.coordinatesIndex;
            }
            else if (mesh.material?.albedoTexture) {
                uvKind = mesh.material.albedoTexture.coordinatesIndex;
            }
        }
        return "uv" + (uvKind ? uvKind + 1 : "");
    }
    /**
     * Digests the mesh and generates as many solid particles in the system as wanted. Returns the SPS.
     * These particles will have the same geometry than the mesh parts and will be positioned at the same localisation than the mesh original places.
     * Thus the particles generated from `digest()` have their property `position` set yet.
     * @param mesh ( Mesh ) is the mesh to be digested
     * @param options {facetNb} (optional integer, default 1) is the number of mesh facets per particle, this parameter is overridden by the parameter `number` if any
     * {delta} (optional integer, default 0) is the random extra number of facets per particle , each particle will have between `facetNb` and `facetNb + delta` facets
     * {number} (optional positive integer) is the wanted number of particles : each particle is built with `mesh_total_facets / number` facets
     * {storage} (optional existing array) is an array where the particles will be stored for a further use instead of being inserted in the SPS.
     * {uvKind} (optional positive integer, default 0) is the kind of UV to read from. Use -1 to deduce it from the diffuse/albedo texture (if any) of the mesh material
     * @param options.facetNb
     * @param options.number
     * @param options.delta
     * @param options.storage
     * @param options.uvKind
     * @returns the current SPS
     */
    digest(mesh, options) {
        let size = (options && options.facetNb) || 1;
        let number = (options && options.number) || 0;
        let delta = (options && options.delta) || 0;
        const meshPos = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const meshInd = mesh.getIndices();
        const meshUV = mesh.getVerticesData(this._getUVKind(mesh, options?.uvKind ?? 0));
        const meshCol = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind);
        const meshNor = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
        const storage = options && options.storage ? options.storage : null;
        let f = 0; // facet counter
        const totalFacets = meshInd.length / 3; // a facet is a triangle, so 3 indices
        // compute size from number
        if (number) {
            number = number > totalFacets ? totalFacets : number;
            size = Math.round(totalFacets / number);
            delta = 0;
        }
        else {
            size = size > totalFacets ? totalFacets : size;
        }
        const facetPos = []; // submesh positions
        const facetNor = [];
        const facetInd = []; // submesh indices
        const facetUV = []; // submesh UV
        const facetCol = []; // submesh colors
        const barycenter = math_vector/* Vector3 */.Pq.Zero();
        const sizeO = size;
        while (f < totalFacets) {
            size = sizeO + Math.floor((1 + delta) * Math.random());
            if (f > totalFacets - size) {
                size = totalFacets - f;
            }
            // reset temp arrays
            facetPos.length = 0;
            facetNor.length = 0;
            facetInd.length = 0;
            facetUV.length = 0;
            facetCol.length = 0;
            // iterate over "size" facets
            let fi = 0;
            for (let j = f * 3; j < (f + size) * 3; j++) {
                facetInd.push(fi);
                const i = meshInd[j];
                const i3 = i * 3;
                facetPos.push(meshPos[i3], meshPos[i3 + 1], meshPos[i3 + 2]);
                facetNor.push(meshNor[i3], meshNor[i3 + 1], meshNor[i3 + 2]);
                if (meshUV) {
                    const i2 = i * 2;
                    facetUV.push(meshUV[i2], meshUV[i2 + 1]);
                }
                if (meshCol) {
                    const i4 = i * 4;
                    facetCol.push(meshCol[i4], meshCol[i4 + 1], meshCol[i4 + 2], meshCol[i4 + 3]);
                }
                fi++;
            }
            // create a model shape for each single particle
            let idx = this.nbParticles;
            const shape = this._posToShape(facetPos);
            const shapeUV = this._uvsToShapeUV(facetUV);
            const shapeInd = facetInd.slice();
            const shapeCol = facetCol.slice();
            const shapeNor = facetNor.slice();
            // compute the barycenter of the shape
            barycenter.copyFromFloats(0, 0, 0);
            let v;
            for (v = 0; v < shape.length; v++) {
                barycenter.addInPlace(shape[v]);
            }
            barycenter.scaleInPlace(1 / shape.length);
            // shift the shape from its barycenter to the origin
            // and compute the BBox required for intersection.
            const minimum = new math_vector/* Vector3 */.Pq(Infinity, Infinity, Infinity);
            const maximum = new math_vector/* Vector3 */.Pq(-Infinity, -Infinity, -Infinity);
            for (v = 0; v < shape.length; v++) {
                shape[v].subtractInPlace(barycenter);
                minimum.minimizeInPlaceFromFloats(shape[v].x, shape[v].y, shape[v].z);
                maximum.maximizeInPlaceFromFloats(shape[v].x, shape[v].y, shape[v].z);
            }
            let bInfo;
            if (this._particlesIntersect) {
                bInfo = new boundingInfo/* BoundingInfo */.j(minimum, maximum);
            }
            let material = null;
            if (this._useModelMaterial) {
                material = mesh.material ? mesh.material : this._setDefaultMaterial();
            }
            const modelShape = new ModelShape(this._shapeCounter, shape, shapeInd, shapeNor, shapeCol, shapeUV, null, null, material);
            // add the particle in the SPS
            const currentPos = this._positions.length;
            const currentInd = this._indices.length;
            this._meshBuilder(this._index, currentInd, shape, this._positions, shapeInd, this._indices, facetUV, this._uvs, shapeCol, this._colors, shapeNor, this._normals, idx, 0, null, modelShape);
            this._addParticle(idx, this._lastParticleId, currentPos, currentInd, modelShape, this._shapeCounter, 0, bInfo, storage);
            // initialize the particle position
            this.particles[this.nbParticles].position.addInPlace(barycenter);
            if (!storage) {
                this._index += shape.length;
                idx++;
                this.nbParticles++;
                this._lastParticleId++;
            }
            this._shapeCounter++;
            f += size;
        }
        this._isNotBuilt = true; // buildMesh() is now expected for setParticles() to work
        return this;
    }
    /**
     * Unrotate the fixed normals in case the mesh was built with pre-rotated particles, ex : use of positionFunction in addShape()
     * @internal
     */
    _unrotateFixedNormals() {
        let index = 0;
        let idx = 0;
        const tmpNormal = math_vector/* TmpVectors */.AA.Vector3[0];
        const quaternion = math_vector/* TmpVectors */.AA.Quaternion[0];
        const invertedRotMatrix = math_vector/* TmpVectors */.AA.Matrix[0];
        for (let p = 0; p < this.particles.length; p++) {
            const particle = this.particles[p];
            const shape = particle._model._shape;
            // computing the inverse of the rotation matrix from the quaternion
            // is equivalent to computing the matrix of the inverse quaternion, i.e of the conjugate quaternion
            if (particle.rotationQuaternion) {
                particle.rotationQuaternion.conjugateToRef(quaternion);
            }
            else {
                const rotation = particle.rotation;
                math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);
                quaternion.conjugateInPlace();
            }
            quaternion.toRotationMatrix(invertedRotMatrix);
            for (let pt = 0; pt < shape.length; pt++) {
                idx = index + pt * 3;
                math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(this._normals32[idx], this._normals32[idx + 1], this._normals32[idx + 2], invertedRotMatrix, tmpNormal);
                tmpNormal.toArray(this._fixedNormal32, idx);
            }
            index = idx + 3;
        }
    }
    /**
     * Resets the temporary working copy particle
     * @internal
     */
    _resetCopy() {
        const copy = this._copy;
        copy.position.setAll(0);
        copy.rotation.setAll(0);
        copy.rotationQuaternion = null;
        copy.scaling.setAll(1);
        copy.uvs.copyFromFloats(0.0, 0.0, 1.0, 1.0);
        copy.color = null;
        copy.translateFromPivot = false;
        copy.shapeId = 0;
        copy.materialIndex = null;
    }
    /**
     * Inserts the shape model geometry in the global SPS mesh by updating the positions, indices, normals, colors, uvs arrays
     * @param p the current index in the positions array to be updated
     * @param ind the current index in the indices array
     * @param shape a Vector3 array, the shape geometry
     * @param positions the positions array to be updated
     * @param meshInd the shape indices array
     * @param indices the indices array to be updated
     * @param meshUV the shape uv array
     * @param uvs the uv array to be updated
     * @param meshCol the shape color array
     * @param colors the color array to be updated
     * @param meshNor the shape normals array
     * @param normals the normals array to be updated
     * @param idx the particle index
     * @param idxInShape the particle index in its shape
     * @param options the addShape() method  passed options
     * @param model
     * @model the particle model
     * @internal
     */
    _meshBuilder(p, ind, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, meshNor, normals, idx, idxInShape, options, model) {
        let i;
        let u = 0;
        let c = 0;
        let n = 0;
        this._resetCopy();
        const copy = this._copy;
        const storeApart = options && options.storage ? true : false;
        copy.idx = idx;
        copy.idxInShape = idxInShape;
        copy.shapeId = model.shapeId;
        if (this._useModelMaterial) {
            const materialId = model._material.uniqueId;
            const materialIndexesById = this._materialIndexesById;
            if (!Object.prototype.hasOwnProperty.call(materialIndexesById, materialId)) {
                materialIndexesById[materialId] = this._materials.length;
                this._materials.push(model._material);
            }
            const matIdx = materialIndexesById[materialId];
            copy.materialIndex = matIdx;
        }
        if (options && options.positionFunction) {
            // call to custom positionFunction
            options.positionFunction(copy, idx, idxInShape);
            this._mustUnrotateFixedNormals = true;
        }
        // in case the particle geometry must NOT be inserted in the SPS mesh geometry
        if (storeApart) {
            return copy;
        }
        const rotMatrix = math_vector/* TmpVectors */.AA.Matrix[0];
        const tmpVertex = this._tmpVertex;
        const tmpVector = tmpVertex.position;
        const tmpColor = tmpVertex.color;
        const tmpUV = tmpVertex.uv;
        const tmpRotated = math_vector/* TmpVectors */.AA.Vector3[1];
        const pivotBackTranslation = math_vector/* TmpVectors */.AA.Vector3[2];
        const scaledPivot = math_vector/* TmpVectors */.AA.Vector3[3];
        math_vector/* Matrix */.uq.IdentityToRef(rotMatrix);
        copy.getRotationMatrix(rotMatrix);
        copy.pivot.multiplyToRef(copy.scaling, scaledPivot);
        if (copy.translateFromPivot) {
            pivotBackTranslation.setAll(0.0);
        }
        else {
            pivotBackTranslation.copyFrom(scaledPivot);
        }
        const someVertexFunction = options && options.vertexFunction;
        for (i = 0; i < shape.length; i++) {
            tmpVector.copyFrom(shape[i]);
            if (copy.color) {
                tmpColor.copyFrom(copy.color);
            }
            if (meshUV) {
                tmpUV.copyFromFloats(meshUV[u], meshUV[u + 1]);
            }
            if (someVertexFunction) {
                options.vertexFunction(copy, tmpVertex, i);
            }
            tmpVector.multiplyInPlace(copy.scaling).subtractInPlace(scaledPivot);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(tmpVector, rotMatrix, tmpRotated);
            tmpRotated.addInPlace(pivotBackTranslation).addInPlace(copy.position);
            positions.push(tmpRotated.x, tmpRotated.y, tmpRotated.z);
            if (meshUV) {
                const copyUvs = copy.uvs;
                uvs.push((copyUvs.z - copyUvs.x) * tmpUV.x + copyUvs.x, (copyUvs.w - copyUvs.y) * tmpUV.y + copyUvs.y);
                u += 2;
            }
            if (copy.color) {
                this._color.copyFrom(tmpColor);
            }
            else {
                const color = this._color;
                if (meshCol && meshCol[c] !== undefined) {
                    color.r = meshCol[c];
                    color.g = meshCol[c + 1];
                    color.b = meshCol[c + 2];
                    color.a = meshCol[c + 3];
                }
                else {
                    color.r = 1.0;
                    color.g = 1.0;
                    color.b = 1.0;
                    color.a = 1.0;
                }
            }
            colors.push(this._color.r, this._color.g, this._color.b, this._color.a);
            c += 4;
            if (!this.recomputeNormals && meshNor) {
                math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(meshNor[n], meshNor[n + 1], meshNor[n + 2], rotMatrix, tmpVector);
                normals.push(tmpVector.x, tmpVector.y, tmpVector.z);
                n += 3;
            }
        }
        for (i = 0; i < meshInd.length; i++) {
            const current_ind = p + meshInd[i];
            indices.push(current_ind);
            if (current_ind > 65535) {
                this._needs32Bits = true;
            }
        }
        if (this._depthSort || this._multimaterialEnabled) {
            const matIndex = copy.materialIndex !== null ? copy.materialIndex : 0;
            this.depthSortedParticles.push(new DepthSortedParticle(idx, ind, meshInd.length, matIndex));
        }
        return copy;
    }
    /**
     * Returns a shape Vector3 array from positions float array
     * @param positions float array
     * @returns a vector3 array
     * @internal
     */
    _posToShape(positions) {
        const shape = [];
        for (let i = 0; i < positions.length; i += 3) {
            shape.push(math_vector/* Vector3 */.Pq.FromArray(positions, i));
        }
        return shape;
    }
    /**
     * Returns a shapeUV array from a float uvs (array deep copy)
     * @param uvs as a float array
     * @returns a shapeUV array
     * @internal
     */
    _uvsToShapeUV(uvs) {
        const shapeUV = [];
        if (uvs) {
            for (let i = 0; i < uvs.length; i++) {
                shapeUV.push(uvs[i]);
            }
        }
        return shapeUV;
    }
    /**
     * Adds a new particle object in the particles array
     * @param idx particle index in particles array
     * @param id particle id
     * @param idxpos positionIndex : the starting index of the particle vertices in the SPS "positions" array
     * @param idxind indiceIndex : he starting index of the particle indices in the SPS "indices" array
     * @param model particle ModelShape object
     * @param shapeId model shape identifier
     * @param idxInShape index of the particle in the current model
     * @param bInfo model bounding info object
     * @param storage target storage array, if any
     * @internal
     */
    _addParticle(idx, id, idxpos, idxind, model, shapeId, idxInShape, bInfo = null, storage = null) {
        const sp = new SolidParticle(idx, id, idxpos, idxind, model, shapeId, idxInShape, this, bInfo);
        const target = storage ? storage : this.particles;
        target.push(sp);
        return sp;
    }
    /**
     * Adds some particles to the SPS from the model shape. Returns the shape id.
     * Please read the doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/immutable_sps
     * @param mesh is any Mesh object that will be used as a model for the solid particles. If the mesh does not have vertex normals, it will turn on the recomputeNormals attribute.
     * @param nb (positive integer) the number of particles to be created from this model
     * @param options {positionFunction} is an optional javascript function to called for each particle on SPS creation.
     * {vertexFunction} is an optional javascript function to called for each vertex of each particle on SPS creation
     * {storage} (optional existing array) is an array where the particles will be stored for a further use instead of being inserted in the SPS.
     * @param options.positionFunction
     * @param options.vertexFunction
     * @param options.storage
     * @returns the number of shapes in the system
     */
    addShape(mesh, nb, options) {
        const meshPos = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const meshInd = mesh.getIndices();
        const meshUV = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind);
        const meshCol = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind);
        const meshNor = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind);
        this.recomputeNormals = meshNor ? false : true;
        const indices = Array.from(meshInd);
        const shapeNormals = meshNor ? Array.from(meshNor) : [];
        const shapeColors = meshCol ? Array.from(meshCol) : [];
        const storage = options && options.storage ? options.storage : null;
        let bbInfo = null;
        if (this._particlesIntersect) {
            bbInfo = mesh.getBoundingInfo();
        }
        const shape = this._posToShape(meshPos);
        const shapeUV = this._uvsToShapeUV(meshUV);
        const posfunc = options ? options.positionFunction : null;
        const vtxfunc = options ? options.vertexFunction : null;
        let material = null;
        if (this._useModelMaterial) {
            material = mesh.material ? mesh.material : this._setDefaultMaterial();
        }
        const modelShape = new ModelShape(this._shapeCounter, shape, indices, shapeNormals, shapeColors, shapeUV, posfunc, vtxfunc, material);
        // particles
        for (let i = 0; i < nb; i++) {
            this._insertNewParticle(this.nbParticles, i, modelShape, shape, meshInd, meshUV, meshCol, meshNor, bbInfo, storage, options);
        }
        this._shapeCounter++;
        this._isNotBuilt = true; // buildMesh() call is now expected for setParticles() to work
        return this._shapeCounter - 1;
    }
    /**
     * Rebuilds a particle back to its just built status : if needed, recomputes the custom positions and vertices
     * @internal
     */
    _rebuildParticle(particle, reset = false) {
        this._resetCopy();
        const copy = this._copy;
        if (particle._model._positionFunction) {
            // recall to stored custom positionFunction
            particle._model._positionFunction(copy, particle.idx, particle.idxInShape);
        }
        const rotMatrix = math_vector/* TmpVectors */.AA.Matrix[0];
        const tmpVertex = math_vector/* TmpVectors */.AA.Vector3[0];
        const tmpRotated = math_vector/* TmpVectors */.AA.Vector3[1];
        const pivotBackTranslation = math_vector/* TmpVectors */.AA.Vector3[2];
        const scaledPivot = math_vector/* TmpVectors */.AA.Vector3[3];
        copy.getRotationMatrix(rotMatrix);
        particle.pivot.multiplyToRef(particle.scaling, scaledPivot);
        if (copy.translateFromPivot) {
            pivotBackTranslation.copyFromFloats(0.0, 0.0, 0.0);
        }
        else {
            pivotBackTranslation.copyFrom(scaledPivot);
        }
        const shape = particle._model._shape;
        for (let pt = 0; pt < shape.length; pt++) {
            tmpVertex.copyFrom(shape[pt]);
            if (particle._model._vertexFunction) {
                particle._model._vertexFunction(copy, tmpVertex, pt); // recall to stored vertexFunction
            }
            tmpVertex.multiplyInPlace(copy.scaling).subtractInPlace(scaledPivot);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(tmpVertex, rotMatrix, tmpRotated);
            tmpRotated
                .addInPlace(pivotBackTranslation)
                .addInPlace(copy.position)
                .toArray(this._positions32, particle._pos + pt * 3);
        }
        if (reset) {
            particle.position.setAll(0.0);
            particle.rotation.setAll(0.0);
            particle.rotationQuaternion = null;
            particle.scaling.setAll(1.0);
            particle.uvs.setAll(0.0);
            particle.pivot.setAll(0.0);
            particle.translateFromPivot = false;
            particle.parentId = null;
        }
    }
    /**
     * Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed.
     * @param reset boolean, default false : if the particles must be reset at position and rotation zero, scaling 1, color white, initial UVs and not parented.
     * @returns the SPS.
     */
    rebuildMesh(reset = false) {
        for (let p = 0; p < this.particles.length; p++) {
            this._rebuildParticle(this.particles[p], reset);
        }
        this.mesh.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, this._positions32, false, false);
        return this;
    }
    /** Removes the particles from the start-th to the end-th included from an expandable SPS (required).
     *  Returns an array with the removed particles.
     *  If the number of particles to remove is lower than zero or greater than the global remaining particle number, then an empty array is returned.
     *  The SPS can't be empty so at least one particle needs to remain in place.
     *  Under the hood, the VertexData array, so the VBO buffer, is recreated each call.
     * @param start index of the first particle to remove
     * @param end index of the last particle to remove (included)
     * @returns an array populated with the removed particles
     */
    removeParticles(start, end) {
        const nb = end - start + 1;
        if (!this._expandable || nb <= 0 || nb >= this.nbParticles || !this._updatable) {
            return [];
        }
        const particles = this.particles;
        const currentNb = this.nbParticles;
        if (end < currentNb - 1) {
            // update the particle indexes in the positions array in case they're remaining particles after the last removed
            const firstRemaining = end + 1;
            const shiftPos = particles[firstRemaining]._pos - particles[start]._pos;
            const shifInd = particles[firstRemaining]._ind - particles[start]._ind;
            for (let i = firstRemaining; i < currentNb; i++) {
                const part = particles[i];
                part._pos -= shiftPos;
                part._ind -= shifInd;
            }
        }
        const removed = particles.splice(start, nb);
        this._positions.length = 0;
        this._indices.length = 0;
        this._colors.length = 0;
        this._uvs.length = 0;
        this._normals.length = 0;
        this._index = 0;
        this._idxOfId.length = 0;
        if (this._depthSort || this._multimaterialEnabled) {
            this.depthSortedParticles = [];
        }
        let ind = 0;
        const particlesLength = particles.length;
        for (let p = 0; p < particlesLength; p++) {
            const particle = particles[p];
            const model = particle._model;
            const shape = model._shape;
            const modelIndices = model._indices;
            const modelNormals = model._normals;
            const modelColors = model._shapeColors;
            const modelUVs = model._shapeUV;
            particle.idx = p;
            this._idxOfId[particle.id] = p;
            this._meshBuilder(this._index, ind, shape, this._positions, modelIndices, this._indices, modelUVs, this._uvs, modelColors, this._colors, modelNormals, this._normals, particle.idx, particle.idxInShape, null, model);
            this._index += shape.length;
            ind += modelIndices.length;
        }
        this.nbParticles -= nb;
        this._isNotBuilt = true; // buildMesh() call is now expected for setParticles() to work
        return removed;
    }
    /**
     * Inserts some pre-created particles in the solid particle system so that they can be managed by setParticles().
     * @param solidParticleArray an array populated with Solid Particles objects
     * @returns the SPS
     */
    insertParticlesFromArray(solidParticleArray) {
        if (!this._expandable) {
            return this;
        }
        let idxInShape = 0;
        let currentShapeId = solidParticleArray[0].shapeId;
        const nb = solidParticleArray.length;
        for (let i = 0; i < nb; i++) {
            const sp = solidParticleArray[i];
            const model = sp._model;
            const shape = model._shape;
            const meshInd = model._indices;
            const meshUV = model._shapeUV;
            const meshCol = model._shapeColors;
            const meshNor = model._normals;
            const noNor = meshNor ? false : true;
            this.recomputeNormals = noNor || this.recomputeNormals;
            const bbInfo = sp.getBoundingInfo();
            const newPart = this._insertNewParticle(this.nbParticles, idxInShape, model, shape, meshInd, meshUV, meshCol, meshNor, bbInfo, null, null);
            sp.copyToRef(newPart);
            idxInShape++;
            if (currentShapeId != sp.shapeId) {
                currentShapeId = sp.shapeId;
                idxInShape = 0;
            }
        }
        this._isNotBuilt = true; // buildMesh() call is now expected for setParticles() to work
        return this;
    }
    /**
     * Creates a new particle and modifies the SPS mesh geometry :
     * - calls _meshBuilder() to increase the SPS mesh geometry step by step
     * - calls _addParticle() to populate the particle array
     * factorized code from addShape() and insertParticlesFromArray()
     * @param idx particle index in the particles array
     * @param i particle index in its shape
     * @param modelShape particle ModelShape object
     * @param shape shape vertex array
     * @param meshInd shape indices array
     * @param meshUV shape uv array
     * @param meshCol shape color array
     * @param meshNor shape normals array
     * @param bbInfo shape bounding info
     * @param storage target particle storage
     * @param options
     * @options addShape() passed options
     * @internal
     */
    _insertNewParticle(idx, i, modelShape, shape, meshInd, meshUV, meshCol, meshNor, bbInfo, storage, options) {
        const currentPos = this._positions.length;
        const currentInd = this._indices.length;
        const currentCopy = this._meshBuilder(this._index, currentInd, shape, this._positions, meshInd, this._indices, meshUV, this._uvs, meshCol, this._colors, meshNor, this._normals, idx, i, options, modelShape);
        let sp = null;
        if (this._updatable) {
            sp = this._addParticle(this.nbParticles, this._lastParticleId, currentPos, currentInd, modelShape, this._shapeCounter, i, bbInfo, storage);
            sp.position.copyFrom(currentCopy.position);
            sp.rotation.copyFrom(currentCopy.rotation);
            if (currentCopy.rotationQuaternion) {
                if (sp.rotationQuaternion) {
                    sp.rotationQuaternion.copyFrom(currentCopy.rotationQuaternion);
                }
                else {
                    sp.rotationQuaternion = currentCopy.rotationQuaternion.clone();
                }
            }
            if (currentCopy.color) {
                if (sp.color) {
                    sp.color.copyFrom(currentCopy.color);
                }
                else {
                    sp.color = currentCopy.color.clone();
                }
            }
            sp.scaling.copyFrom(currentCopy.scaling);
            sp.uvs.copyFrom(currentCopy.uvs);
            if (currentCopy.materialIndex !== null) {
                sp.materialIndex = currentCopy.materialIndex;
            }
            if (this.expandable) {
                this._idxOfId[sp.id] = sp.idx;
            }
        }
        if (!storage) {
            this._index += shape.length;
            this.nbParticles++;
            this._lastParticleId++;
        }
        return sp;
    }
    /**
     *  Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc.
     *  This method calls `updateParticle()` for each particle of the SPS.
     *  For an animated SPS, it is usually called within the render loop.
     * This methods does nothing if called on a non updatable or not yet built SPS. Example : buildMesh() not called after having added or removed particles from an expandable SPS.
     * @param start The particle index in the particle array where to start to compute the particle property values _(default 0)_
     * @param end The particle index in the particle array where to stop to compute the particle property values _(default nbParticle - 1)_
     * @param update If the mesh must be finally updated on this call after all the particle computations _(default true)_
     * @returns the SPS.
     */
    setParticles(start = 0, end = this.nbParticles - 1, update = true) {
        if (!this._updatable || this._isNotBuilt) {
            return this;
        }
        // custom beforeUpdate
        this.beforeUpdateParticles(start, end, update);
        const rotMatrix = math_vector/* TmpVectors */.AA.Matrix[0];
        const invertedMatrix = math_vector/* TmpVectors */.AA.Matrix[1];
        const mesh = this.mesh;
        const colors32 = this._colors32;
        const positions32 = this._positions32;
        const normals32 = this._normals32;
        const uvs32 = this._uvs32;
        const indices32 = this._indices32;
        const indices = this._indices;
        const fixedNormal32 = this._fixedNormal32;
        const depthSortParticles = this._depthSort && this._depthSortParticles;
        const tempVectors = math_vector/* TmpVectors */.AA.Vector3;
        const camAxisX = tempVectors[5].copyFromFloats(1.0, 0.0, 0.0);
        const camAxisY = tempVectors[6].copyFromFloats(0.0, 1.0, 0.0);
        const camAxisZ = tempVectors[7].copyFromFloats(0.0, 0.0, 1.0);
        const minimum = tempVectors[8].setAll(Number.MAX_VALUE);
        const maximum = tempVectors[9].setAll(-Number.MAX_VALUE);
        const camInvertedPosition = tempVectors[10].setAll(0);
        const tmpVertex = this._tmpVertex;
        const tmpVector = tmpVertex.position;
        const tmpColor = tmpVertex.color;
        const tmpUV = tmpVertex.uv;
        // cases when the World Matrix is to be computed first
        if (this.billboard || this._depthSort) {
            this.mesh.computeWorldMatrix(true);
            this.mesh._worldMatrix.invertToRef(invertedMatrix);
        }
        // if the particles will always face the camera
        if (this.billboard) {
            // compute the camera position and un-rotate it by the current mesh rotation
            const tmpVector0 = tempVectors[0];
            this._camera.getDirectionToRef(math_axis/* Axis */._0.Z, tmpVector0);
            math_vector/* Vector3 */.Pq.TransformNormalToRef(tmpVector0, invertedMatrix, camAxisZ);
            camAxisZ.normalize();
            // same for camera up vector extracted from the cam view matrix
            const view = this._camera.getViewMatrix(true);
            math_vector/* Vector3 */.Pq.TransformNormalFromFloatsToRef(view.m[1], view.m[5], view.m[9], invertedMatrix, camAxisY);
            math_vector/* Vector3 */.Pq.CrossToRef(camAxisY, camAxisZ, camAxisX);
            camAxisY.normalize();
            camAxisX.normalize();
        }
        // if depthSort, compute the camera global position in the mesh local system
        if (this._depthSort) {
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._camera.globalPosition, invertedMatrix, camInvertedPosition); // then un-rotate the camera
        }
        math_vector/* Matrix */.uq.IdentityToRef(rotMatrix);
        let idx = 0; // current position index in the global array positions32
        let index = 0; // position start index in the global array positions32 of the current particle
        let colidx = 0; // current color index in the global array colors32
        let colorIndex = 0; // color start index in the global array colors32 of the current particle
        let uvidx = 0; // current uv index in the global array uvs32
        let uvIndex = 0; // uv start index in the global array uvs32 of the current particle
        let pt = 0; // current index in the particle model shape
        if (this.mesh.isFacetDataEnabled) {
            this._computeBoundingBox = true;
        }
        end = end >= this.nbParticles ? this.nbParticles - 1 : end;
        if (this._computeBoundingBox) {
            if (start != 0 || end != this.nbParticles - 1) {
                // only some particles are updated, then use the current existing BBox basis. Note : it can only increase.
                const boundingInfo = this.mesh.getBoundingInfo();
                if (boundingInfo) {
                    minimum.copyFrom(boundingInfo.minimum);
                    maximum.copyFrom(boundingInfo.maximum);
                }
            }
        }
        // particle loop
        index = this.particles[start]._pos;
        const vpos = (index / 3) | 0;
        colorIndex = vpos * 4;
        uvIndex = vpos * 2;
        for (let p = start; p <= end; p++) {
            const particle = this.particles[p];
            // call to custom user function to update the particle properties
            this.updateParticle(particle);
            const shape = particle._model._shape;
            const shapeUV = particle._model._shapeUV;
            const particleRotationMatrix = particle._rotationMatrix;
            const particlePosition = particle.position;
            const particleRotation = particle.rotation;
            const particleScaling = particle.scaling;
            const particleGlobalPosition = particle._globalPosition;
            // camera-particle distance for depth sorting
            if (depthSortParticles) {
                const dsp = this.depthSortedParticles[p];
                dsp.idx = particle.idx;
                dsp.ind = particle._ind;
                dsp.indicesLength = particle._model._indicesLength;
                dsp.sqDistance = math_vector/* Vector3 */.Pq.DistanceSquared(particle.position, camInvertedPosition);
            }
            // skip the computations for inactive or already invisible particles
            if (!particle.alive || (particle._stillInvisible && !particle.isVisible && !this._recomputeInvisibles)) {
                // increment indexes for the next particle
                pt = shape.length;
                index += pt * 3;
                colorIndex += pt * 4;
                uvIndex += pt * 2;
                continue;
            }
            if (particle.isVisible) {
                particle._stillInvisible = false; // un-mark permanent invisibility
                const scaledPivot = tempVectors[12];
                particle.pivot.multiplyToRef(particleScaling, scaledPivot);
                // particle rotation matrix
                if (this.billboard) {
                    particleRotation.x = 0.0;
                    particleRotation.y = 0.0;
                }
                if (this._computeParticleRotation || this.billboard) {
                    particle.getRotationMatrix(rotMatrix);
                }
                const particleHasParent = particle.parentId !== null;
                if (particleHasParent) {
                    const parent = this.getParticleById(particle.parentId);
                    if (parent) {
                        const parentRotationMatrix = parent._rotationMatrix;
                        const parentGlobalPosition = parent._globalPosition;
                        const rotatedY = particlePosition.x * parentRotationMatrix[1] + particlePosition.y * parentRotationMatrix[4] + particlePosition.z * parentRotationMatrix[7];
                        const rotatedX = particlePosition.x * parentRotationMatrix[0] + particlePosition.y * parentRotationMatrix[3] + particlePosition.z * parentRotationMatrix[6];
                        const rotatedZ = particlePosition.x * parentRotationMatrix[2] + particlePosition.y * parentRotationMatrix[5] + particlePosition.z * parentRotationMatrix[8];
                        particleGlobalPosition.x = parentGlobalPosition.x + rotatedX;
                        particleGlobalPosition.y = parentGlobalPosition.y + rotatedY;
                        particleGlobalPosition.z = parentGlobalPosition.z + rotatedZ;
                        if (this._computeParticleRotation || this.billboard) {
                            const rotMatrixValues = rotMatrix.m;
                            particleRotationMatrix[0] =
                                rotMatrixValues[0] * parentRotationMatrix[0] + rotMatrixValues[1] * parentRotationMatrix[3] + rotMatrixValues[2] * parentRotationMatrix[6];
                            particleRotationMatrix[1] =
                                rotMatrixValues[0] * parentRotationMatrix[1] + rotMatrixValues[1] * parentRotationMatrix[4] + rotMatrixValues[2] * parentRotationMatrix[7];
                            particleRotationMatrix[2] =
                                rotMatrixValues[0] * parentRotationMatrix[2] + rotMatrixValues[1] * parentRotationMatrix[5] + rotMatrixValues[2] * parentRotationMatrix[8];
                            particleRotationMatrix[3] =
                                rotMatrixValues[4] * parentRotationMatrix[0] + rotMatrixValues[5] * parentRotationMatrix[3] + rotMatrixValues[6] * parentRotationMatrix[6];
                            particleRotationMatrix[4] =
                                rotMatrixValues[4] * parentRotationMatrix[1] + rotMatrixValues[5] * parentRotationMatrix[4] + rotMatrixValues[6] * parentRotationMatrix[7];
                            particleRotationMatrix[5] =
                                rotMatrixValues[4] * parentRotationMatrix[2] + rotMatrixValues[5] * parentRotationMatrix[5] + rotMatrixValues[6] * parentRotationMatrix[8];
                            particleRotationMatrix[6] =
                                rotMatrixValues[8] * parentRotationMatrix[0] + rotMatrixValues[9] * parentRotationMatrix[3] + rotMatrixValues[10] * parentRotationMatrix[6];
                            particleRotationMatrix[7] =
                                rotMatrixValues[8] * parentRotationMatrix[1] + rotMatrixValues[9] * parentRotationMatrix[4] + rotMatrixValues[10] * parentRotationMatrix[7];
                            particleRotationMatrix[8] =
                                rotMatrixValues[8] * parentRotationMatrix[2] + rotMatrixValues[9] * parentRotationMatrix[5] + rotMatrixValues[10] * parentRotationMatrix[8];
                        }
                    }
                    else {
                        // in case the parent were removed at some moment
                        particle.parentId = null;
                    }
                }
                else {
                    particleGlobalPosition.x = particlePosition.x;
                    particleGlobalPosition.y = particlePosition.y;
                    particleGlobalPosition.z = particlePosition.z;
                    if (this._computeParticleRotation || this.billboard) {
                        const rotMatrixValues = rotMatrix.m;
                        particleRotationMatrix[0] = rotMatrixValues[0];
                        particleRotationMatrix[1] = rotMatrixValues[1];
                        particleRotationMatrix[2] = rotMatrixValues[2];
                        particleRotationMatrix[3] = rotMatrixValues[4];
                        particleRotationMatrix[4] = rotMatrixValues[5];
                        particleRotationMatrix[5] = rotMatrixValues[6];
                        particleRotationMatrix[6] = rotMatrixValues[8];
                        particleRotationMatrix[7] = rotMatrixValues[9];
                        particleRotationMatrix[8] = rotMatrixValues[10];
                    }
                }
                const pivotBackTranslation = tempVectors[11];
                if (particle.translateFromPivot) {
                    pivotBackTranslation.setAll(0.0);
                }
                else {
                    pivotBackTranslation.copyFrom(scaledPivot);
                }
                // particle vertex loop
                for (pt = 0; pt < shape.length; pt++) {
                    idx = index + pt * 3;
                    colidx = colorIndex + pt * 4;
                    uvidx = uvIndex + pt * 2;
                    const iu = 2 * pt;
                    const iv = iu + 1;
                    tmpVector.copyFrom(shape[pt]);
                    if (this._computeParticleColor && particle.color) {
                        tmpColor.copyFrom(particle.color);
                    }
                    if (this._computeParticleTexture) {
                        tmpUV.copyFromFloats(shapeUV[iu], shapeUV[iv]);
                    }
                    if (this._computeParticleVertex) {
                        this.updateParticleVertex(particle, tmpVertex, pt);
                    }
                    // positions
                    const vertexX = tmpVector.x * particleScaling.x - scaledPivot.x;
                    const vertexY = tmpVector.y * particleScaling.y - scaledPivot.y;
                    const vertexZ = tmpVector.z * particleScaling.z - scaledPivot.z;
                    let rotatedX = vertexX * particleRotationMatrix[0] + vertexY * particleRotationMatrix[3] + vertexZ * particleRotationMatrix[6];
                    let rotatedY = vertexX * particleRotationMatrix[1] + vertexY * particleRotationMatrix[4] + vertexZ * particleRotationMatrix[7];
                    let rotatedZ = vertexX * particleRotationMatrix[2] + vertexY * particleRotationMatrix[5] + vertexZ * particleRotationMatrix[8];
                    rotatedX += pivotBackTranslation.x;
                    rotatedY += pivotBackTranslation.y;
                    rotatedZ += pivotBackTranslation.z;
                    const px = (positions32[idx] = particleGlobalPosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ);
                    const py = (positions32[idx + 1] = particleGlobalPosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ);
                    const pz = (positions32[idx + 2] = particleGlobalPosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ);
                    if (this._computeBoundingBox) {
                        minimum.minimizeInPlaceFromFloats(px, py, pz);
                        maximum.maximizeInPlaceFromFloats(px, py, pz);
                    }
                    // normals : if the particles can't be morphed then just rotate the normals, what is much more faster than ComputeNormals()
                    if (!this._computeParticleVertex) {
                        const normalx = fixedNormal32[idx];
                        const normaly = fixedNormal32[idx + 1];
                        const normalz = fixedNormal32[idx + 2];
                        const rotatedx = normalx * particleRotationMatrix[0] + normaly * particleRotationMatrix[3] + normalz * particleRotationMatrix[6];
                        const rotatedy = normalx * particleRotationMatrix[1] + normaly * particleRotationMatrix[4] + normalz * particleRotationMatrix[7];
                        const rotatedz = normalx * particleRotationMatrix[2] + normaly * particleRotationMatrix[5] + normalz * particleRotationMatrix[8];
                        normals32[idx] = camAxisX.x * rotatedx + camAxisY.x * rotatedy + camAxisZ.x * rotatedz;
                        normals32[idx + 1] = camAxisX.y * rotatedx + camAxisY.y * rotatedy + camAxisZ.y * rotatedz;
                        normals32[idx + 2] = camAxisX.z * rotatedx + camAxisY.z * rotatedy + camAxisZ.z * rotatedz;
                    }
                    if (this._computeParticleColor && particle.color) {
                        const colors32 = this._colors32;
                        colors32[colidx] = tmpColor.r;
                        colors32[colidx + 1] = tmpColor.g;
                        colors32[colidx + 2] = tmpColor.b;
                        colors32[colidx + 3] = tmpColor.a;
                    }
                    if (this._computeParticleTexture) {
                        const uvs = particle.uvs;
                        uvs32[uvidx] = tmpUV.x * (uvs.z - uvs.x) + uvs.x;
                        uvs32[uvidx + 1] = tmpUV.y * (uvs.w - uvs.y) + uvs.y;
                    }
                }
            }
            // particle just set invisible : scaled to zero and positioned at the origin
            else {
                particle._stillInvisible = true; // mark the particle as invisible
                for (pt = 0; pt < shape.length; pt++) {
                    idx = index + pt * 3;
                    colidx = colorIndex + pt * 4;
                    uvidx = uvIndex + pt * 2;
                    positions32[idx] = positions32[idx + 1] = positions32[idx + 2] = 0;
                    normals32[idx] = normals32[idx + 1] = normals32[idx + 2] = 0;
                    if (this._computeParticleColor && particle.color) {
                        const color = particle.color;
                        colors32[colidx] = color.r;
                        colors32[colidx + 1] = color.g;
                        colors32[colidx + 2] = color.b;
                        colors32[colidx + 3] = color.a;
                    }
                    if (this._computeParticleTexture) {
                        const uvs = particle.uvs;
                        uvs32[uvidx] = shapeUV[pt * 2] * (uvs.z - uvs.x) + uvs.x;
                        uvs32[uvidx + 1] = shapeUV[pt * 2 + 1] * (uvs.w - uvs.y) + uvs.y;
                    }
                }
            }
            // if the particle intersections must be computed : update the bbInfo
            if (this._particlesIntersect) {
                const bInfo = particle.getBoundingInfo();
                const bBox = bInfo.boundingBox;
                const bSphere = bInfo.boundingSphere;
                const modelBoundingInfo = particle._modelBoundingInfo;
                if (!this._bSphereOnly) {
                    // place, scale and rotate the particle bbox within the SPS local system, then update it
                    const modelBoundingInfoVectors = modelBoundingInfo.boundingBox.vectors;
                    const tempMin = tempVectors[1];
                    const tempMax = tempVectors[2];
                    tempMin.setAll(Number.MAX_VALUE);
                    tempMax.setAll(-Number.MAX_VALUE);
                    for (let b = 0; b < 8; b++) {
                        const scaledX = modelBoundingInfoVectors[b].x * particleScaling.x;
                        const scaledY = modelBoundingInfoVectors[b].y * particleScaling.y;
                        const scaledZ = modelBoundingInfoVectors[b].z * particleScaling.z;
                        const rotatedX = scaledX * particleRotationMatrix[0] + scaledY * particleRotationMatrix[3] + scaledZ * particleRotationMatrix[6];
                        const rotatedY = scaledX * particleRotationMatrix[1] + scaledY * particleRotationMatrix[4] + scaledZ * particleRotationMatrix[7];
                        const rotatedZ = scaledX * particleRotationMatrix[2] + scaledY * particleRotationMatrix[5] + scaledZ * particleRotationMatrix[8];
                        const x = particlePosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ;
                        const y = particlePosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ;
                        const z = particlePosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ;
                        tempMin.minimizeInPlaceFromFloats(x, y, z);
                        tempMax.maximizeInPlaceFromFloats(x, y, z);
                    }
                    bBox.reConstruct(tempMin, tempMax, mesh._worldMatrix);
                }
                // place and scale the particle bouding sphere in the SPS local system, then update it
                const minBbox = modelBoundingInfo.minimum.multiplyToRef(particleScaling, tempVectors[1]);
                const maxBbox = modelBoundingInfo.maximum.multiplyToRef(particleScaling, tempVectors[2]);
                const bSphereCenter = maxBbox.addToRef(minBbox, tempVectors[3]).scaleInPlace(0.5).addInPlace(particleGlobalPosition);
                const halfDiag = maxBbox.subtractToRef(minBbox, tempVectors[4]).scaleInPlace(0.5 * this._bSphereRadiusFactor);
                const bSphereMinBbox = bSphereCenter.subtractToRef(halfDiag, tempVectors[1]);
                const bSphereMaxBbox = bSphereCenter.addToRef(halfDiag, tempVectors[2]);
                bSphere.reConstruct(bSphereMinBbox, bSphereMaxBbox, mesh._worldMatrix);
            }
            // increment indexes for the next particle
            index = idx + 3;
            colorIndex = colidx + 4;
            uvIndex = uvidx + 2;
        }
        // if the VBO must be updated
        if (update) {
            if (this._computeParticleColor) {
                const vb = mesh.getVertexBuffer(Buffers_buffer/* VertexBuffer */.R.ColorKind);
                if (vb && !mesh.isPickable) {
                    vb.updateDirectly(colors32, 0);
                }
                else {
                    mesh.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.ColorKind, colors32, false, false);
                }
            }
            if (this._computeParticleTexture) {
                const vb = mesh.getVertexBuffer(Buffers_buffer/* VertexBuffer */.R.UVKind);
                if (vb && !mesh.isPickable) {
                    vb.updateDirectly(uvs32, 0);
                }
                else {
                    mesh.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.UVKind, uvs32, false, false);
                }
            }
            const vbp = mesh.getVertexBuffer(Buffers_buffer/* VertexBuffer */.R.PositionKind);
            if (vbp && !mesh.isPickable) {
                vbp.updateDirectly(positions32, 0);
            }
            else {
                mesh.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, positions32, false, false);
            }
            if (!mesh.areNormalsFrozen || mesh.isFacetDataEnabled) {
                if (this._computeParticleVertex || mesh.isFacetDataEnabled) {
                    // recompute the normals only if the particles can be morphed, update then also the normal reference array _fixedNormal32[]
                    const params = mesh.isFacetDataEnabled ? mesh.getFacetDataParameters() : null;
                    mesh_vertexData/* VertexData */.P.ComputeNormals(positions32, indices32, normals32, params);
                    for (let i = 0; i < normals32.length; i++) {
                        fixedNormal32[i] = normals32[i];
                    }
                }
                if (!mesh.areNormalsFrozen) {
                    const vb = mesh.getVertexBuffer(Buffers_buffer/* VertexBuffer */.R.NormalKind);
                    if (vb && !mesh.isPickable) {
                        vb.updateDirectly(normals32, 0);
                    }
                    else {
                        mesh.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind, normals32, false, false);
                    }
                }
            }
            if (depthSortParticles) {
                const depthSortedParticles = this.depthSortedParticles;
                depthSortedParticles.sort(this._depthSortFunction);
                const dspl = depthSortedParticles.length;
                let sid = 0;
                let faceId = 0;
                for (let sorted = 0; sorted < dspl; sorted++) {
                    const sortedParticle = depthSortedParticles[sorted];
                    const lind = sortedParticle.indicesLength;
                    const sind = sortedParticle.ind;
                    for (let i = 0; i < lind; i++) {
                        indices32[sid] = indices[sind + i];
                        sid++;
                        if (this._pickable) {
                            const f = i % 3;
                            if (f == 0) {
                                const pickedData = this.pickedParticles[faceId];
                                pickedData.idx = sortedParticle.idx;
                                pickedData.faceId = faceId;
                                faceId++;
                            }
                        }
                    }
                }
            }
            if (this._autoFixFaceOrientation) {
                let particleInd = 0;
                for (let particleIdx = 0; particleIdx < this.particles.length; particleIdx++) {
                    const particle = depthSortParticles ? this.particles[this.depthSortedParticles[particleIdx].idx] : this.particles[particleIdx];
                    const flipFaces = particle.scale.x * particle.scale.y * particle.scale.z < 0;
                    if (flipFaces) {
                        for (let faceInd = 0; faceInd < particle._model._indicesLength; faceInd += 3) {
                            const tmp = indices[particle._ind + faceInd];
                            indices32[particleInd + faceInd] = indices[particle._ind + faceInd + 1];
                            indices32[particleInd + faceInd + 1] = tmp;
                        }
                    }
                    particleInd += particle._model._indicesLength;
                }
            }
            if (depthSortParticles || this._autoFixFaceOrientation) {
                mesh.updateIndices(indices32);
            }
        }
        if (this._computeBoundingBox) {
            if (mesh.hasBoundingInfo) {
                mesh.getBoundingInfo().reConstruct(minimum, maximum, mesh._worldMatrix);
            }
            else {
                mesh.buildBoundingInfo(minimum, maximum, mesh._worldMatrix);
            }
        }
        if (this._autoUpdateSubMeshes) {
            this.computeSubMeshes();
        }
        this._recomputeInvisibles = false;
        this.afterUpdateParticles(start, end, update);
        return this;
    }
    /**
     * Disposes the SPS.
     */
    dispose() {
        this.mesh.dispose();
        this.vars = null;
        // drop references to internal big arrays for the GC
        this._positions = null;
        this._indices = null;
        this._normals = null;
        this._uvs = null;
        this._colors = null;
        this._indices32 = null;
        this._positions32 = null;
        this._normals32 = null;
        this._fixedNormal32 = null;
        this._uvs32 = null;
        this._colors32 = null;
        this.pickedParticles = null;
        this.pickedBySubMesh = null;
        this._materials = null;
        this._materialIndexes = null;
        this._indicesByMaterial = null;
        this._idxOfId = null;
    }
    /** Returns an object {idx: number faceId: number} for the picked particle from the passed pickingInfo object.
     * idx is the particle index in the SPS
     * faceId is the picked face index counted within this particle.
     * Returns null if the pickInfo can't identify a picked particle.
     * @param pickingInfo (PickingInfo object)
     * @returns {idx: number, faceId: number} or null
     */
    pickedParticle(pickingInfo) {
        if (pickingInfo.hit) {
            const subMesh = pickingInfo.subMeshId;
            const faceId = pickingInfo.faceId - this.mesh.subMeshes[subMesh].indexStart / 3;
            const picked = this.pickedBySubMesh;
            if (picked[subMesh] && picked[subMesh][faceId]) {
                return picked[subMesh][faceId];
            }
        }
        return null;
    }
    /**
     * Returns a SolidParticle object from its identifier : particle.id
     * @param id (integer) the particle Id
     * @returns the searched particle or null if not found in the SPS.
     */
    getParticleById(id) {
        const p = this.particles[id];
        if (p && p.id == id) {
            return p;
        }
        const particles = this.particles;
        const idx = this._idxOfId[id];
        if (idx !== undefined) {
            return particles[idx];
        }
        let i = 0;
        const nb = this.nbParticles;
        while (i < nb) {
            const particle = particles[i];
            if (particle.id == id) {
                return particle;
            }
            i++;
        }
        return null;
    }
    /**
     * Returns a new array populated with the particles having the passed shapeId.
     * @param shapeId (integer) the shape identifier
     * @returns a new solid particle array
     */
    getParticlesByShapeId(shapeId) {
        const ref = [];
        this.getParticlesByShapeIdToRef(shapeId, ref);
        return ref;
    }
    /**
     * Populates the passed array "ref" with the particles having the passed shapeId.
     * @param shapeId the shape identifier
     * @param ref array to populate
     * @returns the SPS
     */
    getParticlesByShapeIdToRef(shapeId, ref) {
        ref.length = 0;
        for (let i = 0; i < this.nbParticles; i++) {
            const p = this.particles[i];
            if (p.shapeId == shapeId) {
                ref.push(p);
            }
        }
        return this;
    }
    /**
     * Computes the required SubMeshes according the materials assigned to the particles.
     * @returns the solid particle system.
     * Does nothing if called before the SPS mesh is built.
     */
    computeSubMeshes() {
        if (!this.mesh || !this._multimaterialEnabled) {
            return this;
        }
        const depthSortedParticles = this.depthSortedParticles;
        if (this.particles.length > 0) {
            for (let p = 0; p < this.particles.length; p++) {
                const part = this.particles[p];
                if (!part.materialIndex) {
                    part.materialIndex = 0;
                }
                const sortedPart = depthSortedParticles[p];
                sortedPart.materialIndex = part.materialIndex;
                sortedPart.ind = part._ind;
                sortedPart.indicesLength = part._model._indicesLength;
                sortedPart.idx = part.idx;
            }
        }
        this._sortParticlesByMaterial();
        const indicesByMaterial = this._indicesByMaterial;
        const materialIndexes = this._materialIndexes;
        const mesh = this.mesh;
        mesh.subMeshes = [];
        const vcount = mesh.getTotalVertices();
        for (let m = 0; m < materialIndexes.length; m++) {
            const start = indicesByMaterial[m];
            const count = indicesByMaterial[m + 1] - start;
            const matIndex = materialIndexes[m];
            new subMesh/* SubMesh */.K(matIndex, 0, vcount, start, count, mesh);
        }
        return this;
    }
    /**
     * Sorts the solid particles by material when MultiMaterial is enabled.
     * Updates the indices32 array.
     * Updates the indicesByMaterial array.
     * Updates the mesh indices array.
     * @returns the SPS
     * @internal
     */
    _sortParticlesByMaterial() {
        const indicesByMaterial = [0];
        this._indicesByMaterial = indicesByMaterial;
        const materialIndexes = [];
        this._materialIndexes = materialIndexes;
        const depthSortedParticles = this.depthSortedParticles;
        depthSortedParticles.sort(this._materialSortFunction);
        const length = depthSortedParticles.length;
        const indices32 = this._indices32;
        const indices = this._indices;
        let subMeshIndex = 0;
        let subMeshFaceId = 0;
        let sid = 0;
        let lastMatIndex = depthSortedParticles[0].materialIndex;
        materialIndexes.push(lastMatIndex);
        if (this._pickable) {
            this.pickedBySubMesh = [[]];
            this.pickedParticles = this.pickedBySubMesh[0];
        }
        for (let sorted = 0; sorted < length; sorted++) {
            const sortedPart = depthSortedParticles[sorted];
            const lind = sortedPart.indicesLength;
            const sind = sortedPart.ind;
            if (sortedPart.materialIndex !== lastMatIndex) {
                lastMatIndex = sortedPart.materialIndex;
                indicesByMaterial.push(sid);
                materialIndexes.push(lastMatIndex);
                if (this._pickable) {
                    subMeshIndex++;
                    this.pickedBySubMesh[subMeshIndex] = [];
                    subMeshFaceId = 0;
                }
            }
            let faceId = 0;
            for (let i = 0; i < lind; i++) {
                indices32[sid] = indices[sind + i];
                if (this._pickable) {
                    const f = i % 3;
                    if (f == 0) {
                        const pickedData = this.pickedBySubMesh[subMeshIndex][subMeshFaceId];
                        if (pickedData) {
                            pickedData.idx = sortedPart.idx;
                            pickedData.faceId = faceId;
                        }
                        else {
                            this.pickedBySubMesh[subMeshIndex][subMeshFaceId] = { idx: sortedPart.idx, faceId: faceId };
                        }
                        subMeshFaceId++;
                        faceId++;
                    }
                }
                sid++;
            }
        }
        indicesByMaterial.push(indices32.length); // add the last number to ease the indices start/count values for subMeshes creation
        if (this._updatable) {
            this.mesh.updateIndices(indices32);
        }
        return this;
    }
    /**
     * Sets the material indexes by id materialIndexesById[id] = materialIndex
     * @internal
     */
    _setMaterialIndexesById() {
        this._materialIndexesById = {};
        for (let i = 0; i < this._materials.length; i++) {
            const id = this._materials[i].uniqueId;
            this._materialIndexesById[id] = i;
        }
    }
    /**
     * Returns an array with unique values of Materials from the passed array
     * @param array the material array to be checked and filtered
     * @internal
     */
    _filterUniqueMaterialId(array) {
        const filtered = array.filter(function (value, index, self) {
            return self.indexOf(value) === index;
        });
        return filtered;
    }
    /**
     * Sets a new Standard Material as _defaultMaterial if not already set.
     * @internal
     */
    _setDefaultMaterial() {
        if (!this._defaultMaterial) {
            this._defaultMaterial = new standardMaterial/* StandardMaterial */.F(this.name + "DefaultMaterial", this._scene);
        }
        return this._defaultMaterial;
    }
    /**
     * Visibility helper : Recomputes the visible size according to the mesh bounding box
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
     * @returns the SPS.
     */
    refreshVisibleSize() {
        if (!this._isVisibilityBoxLocked) {
            this.mesh.refreshBoundingInfo();
        }
        return this;
    }
    /**
     * Visibility helper : Sets the size of a visibility box, this sets the underlying mesh bounding box.
     * @param size the size (float) of the visibility box
     * note : this doesn't lock the SPS mesh bounding box.
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
     */
    setVisibilityBox(size) {
        const vis = size / 2;
        this.mesh.buildBoundingInfo(new math_vector/* Vector3 */.Pq(-vis, -vis, -vis), new math_vector/* Vector3 */.Pq(vis, vis, vis));
    }
    /**
     * Gets whether the SPS as always visible or not
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
     */
    get isAlwaysVisible() {
        return this._alwaysVisible;
    }
    /**
     * Sets the SPS as always visible or not
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
     */
    set isAlwaysVisible(val) {
        this._alwaysVisible = val;
        this.mesh.alwaysSelectAsActiveMesh = val;
    }
    /**
     * Sets the SPS visibility box as locked or not. This enables/disables the underlying mesh bounding box updates.
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
     */
    set isVisibilityBoxLocked(val) {
        this._isVisibilityBoxLocked = val;
        const boundingInfo = this.mesh.getBoundingInfo();
        boundingInfo.isLocked = val;
    }
    /**
     * Gets if the SPS visibility box as locked or not. This enables/disables the underlying mesh bounding box updates.
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility
     */
    get isVisibilityBoxLocked() {
        return this._isVisibilityBoxLocked;
    }
    /**
     * Tells to `setParticles()` to compute the particle rotations or not.
     * Default value : true. The SPS is faster when it's set to false.
     * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate.
     */
    set computeParticleRotation(val) {
        this._computeParticleRotation = val;
    }
    /**
     * Tells to `setParticles()` to compute the particle colors or not.
     * Default value : true. The SPS is faster when it's set to false.
     * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
     */
    set computeParticleColor(val) {
        this._computeParticleColor = val;
    }
    set computeParticleTexture(val) {
        this._computeParticleTexture = val;
    }
    /**
     * Tells to `setParticles()` to call the vertex function for each vertex of each particle, or not.
     * Default value : false. The SPS is faster when it's set to false.
     * Note : the particle custom vertex positions aren't stored values.
     */
    set computeParticleVertex(val) {
        this._computeParticleVertex = val;
    }
    /**
     * Tells to `setParticles()` to compute or not the mesh bounding box when computing the particle positions.
     */
    set computeBoundingBox(val) {
        this._computeBoundingBox = val;
    }
    /**
     * Tells to `setParticles()` to sort or not the distance between each particle and the camera.
     * Skipped when `enableDepthSort` is set to `false` (default) at construction time.
     * Default : `true`
     */
    set depthSortParticles(val) {
        this._depthSortParticles = val;
    }
    /**
     * Gets if `setParticles()` computes the particle rotations or not.
     * Default value : true. The SPS is faster when it's set to false.
     * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate.
     */
    get computeParticleRotation() {
        return this._computeParticleRotation;
    }
    /**
     * Gets if `setParticles()` computes the particle colors or not.
     * Default value : true. The SPS is faster when it's set to false.
     * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
     */
    get computeParticleColor() {
        return this._computeParticleColor;
    }
    /**
     * Gets if `setParticles()` computes the particle textures or not.
     * Default value : true. The SPS is faster when it's set to false.
     * Note : the particle textures are stored values, so setting `computeParticleTexture` to false will keep yet the last colors set.
     */
    get computeParticleTexture() {
        return this._computeParticleTexture;
    }
    /**
     * Gets if `setParticles()` calls the vertex function for each vertex of each particle, or not.
     * Default value : false. The SPS is faster when it's set to false.
     * Note : the particle custom vertex positions aren't stored values.
     */
    get computeParticleVertex() {
        return this._computeParticleVertex;
    }
    /**
     * Gets if `setParticles()` computes or not the mesh bounding box when computing the particle positions.
     */
    get computeBoundingBox() {
        return this._computeBoundingBox;
    }
    /**
     * Gets if `setParticles()` sorts or not the distance between each particle and the camera.
     * Skipped when `enableDepthSort` is set to `false` (default) at construction time.
     * Default : `true`
     */
    get depthSortParticles() {
        return this._depthSortParticles;
    }
    /**
     * Gets if the SPS is created as expandable at construction time.
     * Default : `false`
     */
    get expandable() {
        return this._expandable;
    }
    /**
     * Gets if the SPS supports the Multi Materials
     */
    get multimaterialEnabled() {
        return this._multimaterialEnabled;
    }
    /**
     * Gets if the SPS uses the model materials for its own multimaterial.
     */
    get useModelMaterial() {
        return this._useModelMaterial;
    }
    /**
     * The SPS used material array.
     */
    get materials() {
        return this._materials;
    }
    /**
     * Sets the SPS MultiMaterial from the passed materials.
     * Note : the passed array is internally copied and not used then by reference.
     * @param materials an array of material objects. This array indexes are the materialIndex values of the particles.
     */
    setMultiMaterial(materials) {
        this._materials = this._filterUniqueMaterialId(materials);
        this._setMaterialIndexesById();
        if (this._multimaterial) {
            this._multimaterial.dispose();
        }
        this._multimaterial = new Materials_multiMaterial/* MultiMaterial */.F(this.name + "MultiMaterial", this._scene);
        for (let m = 0; m < this._materials.length; m++) {
            this._multimaterial.subMaterials.push(this._materials[m]);
        }
        this.computeSubMeshes();
        this.mesh.material = this._multimaterial;
    }
    /**
     * The SPS computed multimaterial object
     */
    get multimaterial() {
        return this._multimaterial;
    }
    set multimaterial(mm) {
        this._multimaterial = mm;
    }
    /**
     * If the subMeshes must be updated on the next call to setParticles()
     */
    get autoUpdateSubMeshes() {
        return this._autoUpdateSubMeshes;
    }
    set autoUpdateSubMeshes(val) {
        this._autoUpdateSubMeshes = val;
    }
    // =======================================================================
    // Particle behavior logic
    // these following methods may be overwritten by the user to fit his needs
    /**
     * This function does nothing. It may be overwritten to set all the particle first values.
     * The SPS doesn't call this function, you may have to call it by your own.
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/manage_sps_particles
     */
    initParticles() { }
    /**
     * This function does nothing. It may be overwritten to recycle a particle.
     * The SPS doesn't call this function, you may have to call it by your own.
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/manage_sps_particles
     * @param particle The particle to recycle
     * @returns the recycled particle
     */
    recycleParticle(particle) {
        return particle;
    }
    /**
     * Updates a particle : this function should  be overwritten by the user.
     * It is called on each particle by `setParticles()`. This is the place to code each particle behavior.
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/manage_sps_particles
     * @example : just set a particle position or velocity and recycle conditions
     * @param particle The particle to update
     * @returns the updated particle
     */
    updateParticle(particle) {
        return particle;
    }
    /**
     * Updates a vertex of a particle : it can be overwritten by the user.
     * This will be called on each vertex particle by `setParticles()` if `computeParticleVertex` is set to true only.
     * @param particle the current particle
     * @param vertex the current vertex of the current particle : a SolidParticleVertex object
     * @param pt the index of the current vertex in the particle shape
     * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_vertices
     * @example : just set a vertex particle position or color
     * @returns the sps
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    updateParticleVertex(particle, vertex, pt) {
        return this;
    }
    /**
     * This will be called before any other treatment by `setParticles()` and will be passed three parameters.
     * This does nothing and may be overwritten by the user.
     * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
     * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
     * @param update the boolean update value actually passed to setParticles()
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    beforeUpdateParticles(start, stop, update) { }
    /**
     * This will be called  by `setParticles()` after all the other treatments and just before the actual mesh update.
     * This will be passed three parameters.
     * This does nothing and may be overwritten by the user.
     * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
     * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
     * @param update the boolean update value actually passed to setParticles()
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    afterUpdateParticles(start, stop, update) { }
}
//# sourceMappingURL=solidParticleSystem.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Particles/cloudPoint.js
var cloudPoint = __webpack_require__(99083);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Particles/pointsCloudSystem.js
var pointsCloudSystem = __webpack_require__(13833);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/particles.fragment.js
var particles_fragment = __webpack_require__(16066);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/particles.vertex.js
var particles_vertex = __webpack_require__(59384);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/particles.fragment.js
var ShadersWGSL_particles_fragment = __webpack_require__(96913);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/particles.vertex.js
var ShadersWGSL_particles_vertex = __webpack_require__(27323);
;// ./node_modules/@babylonjs/core/Particles/index.js
/* eslint-disable import/export */
/* eslint-disable import/no-internal-modules */










// eslint-disable-next-line no-duplicate-imports











//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/IPhysicsEnginePlugin.js

//# sourceMappingURL=IPhysicsEnginePlugin.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/physicsEngineComponent.js


Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "physicsImpostor", {
    get: function () {
        return this._physicsImpostor;
    },
    set: function (value) {
        if (this._physicsImpostor === value) {
            return;
        }
        if (this._disposePhysicsObserver) {
            this.onDisposeObservable.remove(this._disposePhysicsObserver);
        }
        this._physicsImpostor = value;
        if (value) {
            this._disposePhysicsObserver = this.onDisposeObservable.add(() => {
                // Physics
                if (this.physicsImpostor) {
                    this.physicsImpostor.dispose( /*!doNotRecurse*/);
                    this.physicsImpostor = null;
                }
            });
        }
    },
    enumerable: true,
    configurable: true,
});
/**
 * Gets the current physics impostor
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics
 * @returns a physics impostor or null
 */
abstractMesh/* AbstractMesh */.u.prototype.getPhysicsImpostor = function () {
    return this.physicsImpostor;
};
/**
 * Apply a physic impulse to the mesh
 * @param force defines the force to apply
 * @param contactPoint defines where to apply the force
 * @returns the current mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
abstractMesh/* AbstractMesh */.u.prototype.applyImpulse = function (force, contactPoint) {
    if (!this.physicsImpostor) {
        return this;
    }
    this.physicsImpostor.applyImpulse(force, contactPoint);
    return this;
};
/**
 * Creates a physic joint between two meshes
 * @param otherMesh defines the other mesh to use
 * @param pivot1 defines the pivot to use on this mesh
 * @param pivot2 defines the pivot to use on the other mesh
 * @param options defines additional options (can be plugin dependent)
 * @returns the current mesh
 * @see https://www.babylonjs-playground.com/#0BS5U0#0
 */
abstractMesh/* AbstractMesh */.u.prototype.setPhysicsLinkWith = function (otherMesh, pivot1, pivot2, options) {
    if (!this.physicsImpostor || !otherMesh.physicsImpostor) {
        return this;
    }
    this.physicsImpostor.createJoint(otherMesh.physicsImpostor, PhysicsJoint.HingeJoint, {
        mainPivot: pivot1,
        connectedPivot: pivot2,
        nativeParams: options,
    });
    return this;
};
//# sourceMappingURL=physicsEngineComponent.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/Plugins/index.js



//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Physics/v1/index.js
/* eslint-disable import/no-internal-modules */






//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/physicsEngine.js



/**
 * Class used to control physics engine
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class physicsEngine_PhysicsEngine {
    /**
     *
     * @returns physics plugin version
     */
    getPluginVersion() {
        return this._physicsPlugin.getPluginVersion();
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Factory used to create the default physics plugin.
     * @returns The default physics plugin
     */
    static DefaultPluginFactory() {
        throw (0,devTools/* _WarnImport */.n)("");
    }
    /**
     * Creates a new Physics Engine
     * @param gravity defines the gravity vector used by the simulation
     * @param _physicsPlugin defines the plugin to use (CannonJS by default)
     */
    constructor(gravity, _physicsPlugin = physicsEngine_PhysicsEngine.DefaultPluginFactory()) {
        this._physicsPlugin = _physicsPlugin;
        /** @internal */
        this._physicsBodies = [];
        this._subTimeStep = 0;
        gravity = gravity || new math_vector/* Vector3 */.Pq(0, -9.807, 0);
        this.setGravity(gravity);
        this.setTimeStep();
    }
    /**
     * Sets the gravity vector used by the simulation
     * @param gravity defines the gravity vector to use
     */
    setGravity(gravity) {
        this.gravity = gravity;
        this._physicsPlugin.setGravity(this.gravity);
    }
    /**
     * Set the time step of the physics engine.
     * Default is 1/60.
     * To slow it down, enter 1/600 for example.
     * To speed it up, 1/30
     * Unit is seconds.
     * @param newTimeStep defines the new timestep to apply to this world.
     */
    setTimeStep(newTimeStep = 1 / 60) {
        this._physicsPlugin.setTimeStep(newTimeStep);
    }
    /**
     * Get the time step of the physics engine.
     * @returns the current time step
     */
    getTimeStep() {
        return this._physicsPlugin.getTimeStep();
    }
    /**
     * Set the sub time step of the physics engine.
     * Default is 0 meaning there is no sub steps
     * To increase physics resolution precision, set a small value (like 1 ms)
     * @param subTimeStep defines the new sub timestep used for physics resolution.
     */
    setSubTimeStep(subTimeStep = 0) {
        this._subTimeStep = subTimeStep;
    }
    /**
     * Get the sub time step of the physics engine.
     * @returns the current sub time step
     */
    getSubTimeStep() {
        return this._subTimeStep;
    }
    /**
     * Release all resources
     */
    dispose() {
        this._physicsPlugin.dispose();
    }
    /**
     * Gets the name of the current physics plugin
     * @returns the name of the plugin
     */
    getPhysicsPluginName() {
        return this._physicsPlugin.name;
    }
    /**
     * Set the maximum allowed linear and angular velocities
     * @param maxLinearVelocity maximum allowed linear velocity
     * @param maxAngularVelocity maximum allowed angular velocity
     */
    setVelocityLimits(maxLinearVelocity, maxAngularVelocity) {
        this._physicsPlugin.setVelocityLimits(maxLinearVelocity, maxAngularVelocity);
    }
    /**
     * @returns maximum allowed linear velocity
     */
    getMaxLinearVelocity() {
        return this._physicsPlugin.getMaxLinearVelocity();
    }
    /**
     * @returns maximum allowed angular velocity
     */
    getMaxAngularVelocity() {
        return this._physicsPlugin.getMaxAngularVelocity();
    }
    /**
     * Adding a new impostor for the impostor tracking.
     * This will be done by the impostor itself.
     * @param impostor the impostor to add
     */
    /**
     * Called by the scene. No need to call it.
     * @param delta defines the timespan between frames
     */
    _step(delta) {
        if (delta > 0.1) {
            delta = 0.1;
        }
        else if (delta <= 0) {
            delta = 1.0 / 60.0;
        }
        this._physicsPlugin.executeStep(delta, this._physicsBodies);
    }
    /**
     * Add a body as an active component of this engine
     * @param physicsBody The body to add
     */
    addBody(physicsBody) {
        this._physicsBodies.push(physicsBody);
    }
    /**
     * Removes a particular body from this engine
     * @param physicsBody The body to remove from the simulation
     */
    removeBody(physicsBody) {
        const index = this._physicsBodies.indexOf(physicsBody);
        if (index > -1) {
            /*const removed =*/ this._physicsBodies.splice(index, 1);
        }
    }
    /**
     * @returns an array of bodies added to this engine
     */
    getBodies() {
        return this._physicsBodies;
    }
    /**
     * Gets the current plugin used to run the simulation
     * @returns current plugin
     */
    getPhysicsPlugin() {
        return this._physicsPlugin;
    }
    /**
     * Does a raycast in the physics world
     * @param from when should the ray start?
     * @param to when should the ray end?
     * @param result resulting PhysicsRaycastResult
     * @param query raycast query object
     */
    raycastToRef(from, to, result, query) {
        this._physicsPlugin.raycast(from, to, result, query);
    }
    /**
     * Does a raycast in the physics world
     * @param from when should the ray start?
     * @param to when should the ray end?
     * @param query raycast query object
     * @returns PhysicsRaycastResult
     */
    raycast(from, to, query) {
        const result = new PhysicsRaycastResult();
        this._physicsPlugin.raycast(from, to, result, query);
        return result;
    }
}
//# sourceMappingURL=physicsEngine.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/IPhysicsEnginePlugin.js
/** How a specific axis can be constrained */
var PhysicsConstraintAxisLimitMode;
(function (PhysicsConstraintAxisLimitMode) {
    /*
     * The axis is not restricted at all
     */
    PhysicsConstraintAxisLimitMode[PhysicsConstraintAxisLimitMode["FREE"] = 0] = "FREE";
    /*
     * The axis has a minimum/maximum limit
     */
    PhysicsConstraintAxisLimitMode[PhysicsConstraintAxisLimitMode["LIMITED"] = 1] = "LIMITED";
    /*
     * The axis allows no relative movement of the pivots
     */
    PhysicsConstraintAxisLimitMode[PhysicsConstraintAxisLimitMode["LOCKED"] = 2] = "LOCKED";
})(PhysicsConstraintAxisLimitMode || (PhysicsConstraintAxisLimitMode = {}));
/** The constraint specific axis to use when setting Friction, `ConstraintAxisLimitMode`, max force, ... */
var PhysicsConstraintAxis;
(function (PhysicsConstraintAxis) {
    /*
     * Translation along the primary axis of the constraint (i.e. the
     * direction specified by PhysicsConstraintParameters.axisA/axisB)
     */
    PhysicsConstraintAxis[PhysicsConstraintAxis["LINEAR_X"] = 0] = "LINEAR_X";
    /*
     * Translation along the second axis of the constraint (i.e. the
     * direction specified by PhysicsConstraintParameters.perpAxisA/perpAxisB)
     */
    PhysicsConstraintAxis[PhysicsConstraintAxis["LINEAR_Y"] = 1] = "LINEAR_Y";
    /*
     * Translation along the third axis of the constraint. This axis is
     * computed from the cross product of axisA/axisB and perpAxisA/perpAxisB)
     */
    PhysicsConstraintAxis[PhysicsConstraintAxis["LINEAR_Z"] = 2] = "LINEAR_Z";
    /*
     * Rotation around the primary axis of the constraint (i.e. the
     * axis specified by PhysicsConstraintParameters.axisA/axisB)
     */
    PhysicsConstraintAxis[PhysicsConstraintAxis["ANGULAR_X"] = 3] = "ANGULAR_X";
    /*
     * Rotation around the second axis of the constraint (i.e. the
     * axis specified by PhysicsConstraintParameters.perpAxisA/perpAxisB)
     */
    PhysicsConstraintAxis[PhysicsConstraintAxis["ANGULAR_Y"] = 4] = "ANGULAR_Y";
    /*
     * Rotation around the third axis of the constraint. This axis is
     * computed from the cross product of axisA/axisB and perpAxisA/perpAxisB)
     */
    PhysicsConstraintAxis[PhysicsConstraintAxis["ANGULAR_Z"] = 5] = "ANGULAR_Z";
    /*
     * A 3D distance limit; similar to specifying the LINEAR_X/Y/Z axes
     * individually, but the distance calculation uses all three axes
     * simultaneously, instead of individually.
     */
    PhysicsConstraintAxis[PhysicsConstraintAxis["LINEAR_DISTANCE"] = 6] = "LINEAR_DISTANCE";
})(PhysicsConstraintAxis || (PhysicsConstraintAxis = {}));
/** Type of Constraint */
var PhysicsConstraintType;
(function (PhysicsConstraintType) {
    /**
     * A ball and socket constraint will attempt to line up the pivot
     * positions in each body, and have no restrictions on rotation
     */
    PhysicsConstraintType[PhysicsConstraintType["BALL_AND_SOCKET"] = 1] = "BALL_AND_SOCKET";
    /**
     * A distance constraint will attempt to keep the pivot locations
     * within a specified distance.
     */
    PhysicsConstraintType[PhysicsConstraintType["DISTANCE"] = 2] = "DISTANCE";
    /**
     * A hinge constraint will keep the pivot positions aligned as well
     * as two angular axes. The remaining angular axis will be free to rotate.
     */
    PhysicsConstraintType[PhysicsConstraintType["HINGE"] = 3] = "HINGE";
    /**
     * A slider constraint allows bodies to translate along one axis and
     * rotate about the same axis. The remaining two axes are locked in
     * place
     */
    PhysicsConstraintType[PhysicsConstraintType["SLIDER"] = 4] = "SLIDER";
    /**
     * A lock constraint will attempt to keep the pivots completely lined
     * up between both bodies, allowing no relative movement.
     */
    PhysicsConstraintType[PhysicsConstraintType["LOCK"] = 5] = "LOCK";
    /*
     * A prismatic will lock the rotations of the bodies, and allow translation
     * only along one axis
     */
    PhysicsConstraintType[PhysicsConstraintType["PRISMATIC"] = 6] = "PRISMATIC";
    /*
     * A generic constraint; this starts with no limits on how the bodies can
     * move relative to each other, but limits can be added via the PhysicsConstraint
     * interfaces. This can be used to specify a large variety of constraints
     */
    PhysicsConstraintType[PhysicsConstraintType["SIX_DOF"] = 7] = "SIX_DOF";
})(PhysicsConstraintType || (PhysicsConstraintType = {}));
/** Type of Shape */
var PhysicsShapeType;
(function (PhysicsShapeType) {
    PhysicsShapeType[PhysicsShapeType["SPHERE"] = 0] = "SPHERE";
    PhysicsShapeType[PhysicsShapeType["CAPSULE"] = 1] = "CAPSULE";
    PhysicsShapeType[PhysicsShapeType["CYLINDER"] = 2] = "CYLINDER";
    PhysicsShapeType[PhysicsShapeType["BOX"] = 3] = "BOX";
    PhysicsShapeType[PhysicsShapeType["CONVEX_HULL"] = 4] = "CONVEX_HULL";
    PhysicsShapeType[PhysicsShapeType["CONTAINER"] = 5] = "CONTAINER";
    PhysicsShapeType[PhysicsShapeType["MESH"] = 6] = "MESH";
    PhysicsShapeType[PhysicsShapeType["HEIGHTFIELD"] = 7] = "HEIGHTFIELD";
})(PhysicsShapeType || (PhysicsShapeType = {}));
/** Optional motor which attempts to move a body at a specific velocity, or at a specific position */
var PhysicsConstraintMotorType;
(function (PhysicsConstraintMotorType) {
    PhysicsConstraintMotorType[PhysicsConstraintMotorType["NONE"] = 0] = "NONE";
    PhysicsConstraintMotorType[PhysicsConstraintMotorType["VELOCITY"] = 1] = "VELOCITY";
    PhysicsConstraintMotorType[PhysicsConstraintMotorType["POSITION"] = 2] = "POSITION";
})(PhysicsConstraintMotorType || (PhysicsConstraintMotorType = {}));
var PhysicsEventType;
(function (PhysicsEventType) {
    PhysicsEventType["COLLISION_STARTED"] = "COLLISION_STARTED";
    PhysicsEventType["COLLISION_CONTINUED"] = "COLLISION_CONTINUED";
    PhysicsEventType["COLLISION_FINISHED"] = "COLLISION_FINISHED";
    PhysicsEventType["TRIGGER_ENTERED"] = "TRIGGER_ENTERED";
    PhysicsEventType["TRIGGER_EXITED"] = "TRIGGER_EXITED";
})(PhysicsEventType || (PhysicsEventType = {}));
/**
 * Indicates how the body will behave.
 */
var PhysicsMotionType;
(function (PhysicsMotionType) {
    PhysicsMotionType[PhysicsMotionType["STATIC"] = 0] = "STATIC";
    PhysicsMotionType[PhysicsMotionType["ANIMATED"] = 1] = "ANIMATED";
    PhysicsMotionType[PhysicsMotionType["DYNAMIC"] = 2] = "DYNAMIC";
})(PhysicsMotionType || (PhysicsMotionType = {}));
/**
 * Indicates how to handle position/rotation change of transform node attached to a physics body
 */
var PhysicsPrestepType;
(function (PhysicsPrestepType) {
    PhysicsPrestepType[PhysicsPrestepType["DISABLED"] = 0] = "DISABLED";
    PhysicsPrestepType[PhysicsPrestepType["TELEPORT"] = 1] = "TELEPORT";
    PhysicsPrestepType[PhysicsPrestepType["ACTION"] = 2] = "ACTION";
})(PhysicsPrestepType || (PhysicsPrestepType = {}));
/**
 * Controls the body sleep mode.
 */
var PhysicsActivationControl;
(function (PhysicsActivationControl) {
    PhysicsActivationControl[PhysicsActivationControl["SIMULATION_CONTROLLED"] = 0] = "SIMULATION_CONTROLLED";
    PhysicsActivationControl[PhysicsActivationControl["ALWAYS_ACTIVE"] = 1] = "ALWAYS_ACTIVE";
    PhysicsActivationControl[PhysicsActivationControl["ALWAYS_INACTIVE"] = 2] = "ALWAYS_INACTIVE";
})(PhysicsActivationControl || (PhysicsActivationControl = {}));
//# sourceMappingURL=IPhysicsEnginePlugin.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/physicsBody.js


/**
 * PhysicsBody is useful for creating a physics body that can be used in a physics engine. It allows
 * the user to set the mass and velocity of the body, which can then be used to calculate the
 * motion of the body in the physics engine.
 */
class PhysicsBody {
    /**
     * Disable pre-step that consists in updating Physics Body from Transform Node Translation/Orientation.
     * True by default for maximum performance.
     */
    get disablePreStep() {
        return this._prestepType == PhysicsPrestepType.DISABLED;
    }
    set disablePreStep(value) {
        this._prestepType = value ? PhysicsPrestepType.DISABLED : PhysicsPrestepType.TELEPORT;
    }
    /**
     * Constructs a new physics body for the given node.
     * @param transformNode - The Transform Node to construct the physics body for. For better performance, it is advised that this node does not have a parent.
     * @param motionType - The motion type of the physics body. The options are:
     *  - PhysicsMotionType.STATIC - Static bodies are not moving and unaffected by forces or collisions. They are good for level boundaries or terrain.
     *  - PhysicsMotionType.DYNAMIC - Dynamic bodies are fully simulated. They can move and collide with other objects.
     *  - PhysicsMotionType.ANIMATED - They behave like dynamic bodies, but they won't be affected by other bodies, but still push other bodies out of the way.
     * @param startsAsleep - Whether the physics body should start in a sleeping state (not a guarantee). Defaults to false.
     * @param scene - The scene containing the physics engine.
     *
     * This code is useful for creating a physics body for a given Transform Node in a scene.
     * It checks the version of the physics engine and the physics plugin, and initializes the body accordingly.
     * It also sets the node's rotation quaternion if it is not already set. Finally, it adds the body to the physics engine.
     */
    constructor(transformNode, motionType, startsAsleep, scene) {
        /**
         * V2 Physics plugin private data for single Transform
         */
        this._pluginData = undefined;
        /**
         * V2 Physics plugin private data for instances
         */
        this._pluginDataInstances = [];
        /**
         * If the collision callback is enabled
         */
        this._collisionCBEnabled = false;
        /**
         * If the collision ended callback is enabled
         */
        this._collisionEndedCBEnabled = false;
        /**
         * Disable sync from physics to transformNode. This value is set to true at body creation or at motionType setting when the body is not dynamic.
         */
        this.disableSync = false;
        this._isDisposed = false;
        this._shape = null;
        this._prestepType = PhysicsPrestepType.DISABLED;
        if (!scene) {
            return;
        }
        const physicsEngine = scene.getPhysicsEngine();
        if (!physicsEngine) {
            throw new Error("No Physics Engine available.");
        }
        this._physicsEngine = physicsEngine;
        if (physicsEngine.getPluginVersion() != 2) {
            throw new Error("Plugin version is incorrect. Expected version 2.");
        }
        const physicsPlugin = physicsEngine.getPhysicsPlugin();
        if (!physicsPlugin) {
            throw new Error("No Physics Plugin available.");
        }
        this._physicsPlugin = physicsPlugin;
        if (!transformNode.rotationQuaternion) {
            transformNode.rotationQuaternion = math_vector/* Quaternion */.PT.FromEulerAngles(transformNode.rotation.x, transformNode.rotation.y, transformNode.rotation.z);
        }
        this.startAsleep = startsAsleep;
        this._motionType = motionType;
        // only dynamic and animated body needs sync from physics to transformNode
        this.disableSync = motionType == 0 /* PhysicsMotionType.STATIC */;
        // instances?
        const m = transformNode;
        if (m.hasThinInstances) {
            this._physicsPlugin.initBodyInstances(this, motionType, m);
        }
        else {
            // single instance
            if (transformNode.parent) {
                // Force computation of world matrix so that the parent transforms are correctly reflected in absolutePosition/absoluteRotationQuaternion.
                transformNode.computeWorldMatrix(true);
            }
            this._physicsPlugin.initBody(this, motionType, transformNode.absolutePosition, transformNode.absoluteRotationQuaternion);
        }
        this.transformNode = transformNode;
        transformNode.physicsBody = this;
        physicsEngine.addBody(this);
        this._nodeDisposeObserver = transformNode.onDisposeObservable.add(() => {
            this.dispose();
        });
    }
    /**
     * Returns the string "PhysicsBody".
     * @returns "PhysicsBody"
     */
    getClassName() {
        return "PhysicsBody";
    }
    /**
     * Clone the PhysicsBody to a new body and assign it to the transformNode parameter
     * @param transformNode transformNode that will be used for the cloned PhysicsBody
     * @returns the newly cloned PhysicsBody
     */
    clone(transformNode) {
        const clonedBody = new PhysicsBody(transformNode, this.getMotionType(), this.startAsleep, this.transformNode.getScene());
        clonedBody.shape = this.shape;
        clonedBody.setMassProperties(this.getMassProperties());
        clonedBody.setLinearDamping(this.getLinearDamping());
        clonedBody.setAngularDamping(this.getAngularDamping());
        return clonedBody;
    }
    /**
     * If a physics body is connected to an instanced node, update the number physic instances to match the number of node instances.
     */
    updateBodyInstances() {
        const m = this.transformNode;
        if (m.hasThinInstances) {
            this._physicsPlugin.updateBodyInstances(this, m);
        }
    }
    /**
     * This returns the number of internal instances of the physics body
     */
    get numInstances() {
        return this._pluginDataInstances.length;
    }
    /**
     * Get the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.
     */
    get motionType() {
        return this._motionType;
    }
    /**
     * Sets the shape of the physics body.
     * @param shape - The shape of the physics body.
     *
     * This method is useful for setting the shape of the physics body, which is necessary for the physics engine to accurately simulate the body's behavior.
     * The shape is used to calculate the body's mass, inertia, and other properties.
     */
    set shape(shape) {
        this._shape = shape;
        if (shape) {
            this._physicsPlugin.setShape(this, shape);
        }
    }
    /**
     * Retrieves the physics shape associated with this object.
     *
     * @returns The physics shape associated with this object, or `undefined` if no
     * shape is associated.
     *
     * This method is useful for retrieving the physics shape associated with this object,
     * which can be used to apply physical forces to the object or to detect collisions.
     */
    get shape() {
        return this._shape;
    }
    /**
     * Returns the bounding box of the physics body.
     * @returns The bounding box of the physics body.
     */
    getBoundingBox() {
        return this._physicsPlugin.getBodyBoundingBox(this);
    }
    /**
     * Sets the event mask for the physics engine.
     *
     * @param eventMask - A bitmask that determines which events will be sent to the physics engine.
     * @param instanceIndex - If this body is instanced, the index of the instance to set the event mask for.
     *
     * This method is useful for setting the event mask for the physics engine, which determines which events
     * will be sent to the physics engine. This allows the user to control which events the physics engine will respond to.
     */
    setEventMask(eventMask, instanceIndex) {
        this._physicsPlugin.setEventMask(this, eventMask, instanceIndex);
    }
    /**
     * Gets the event mask of the physics engine.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the event mask for.
     * @returns The event mask of the physics engine.
     *
     * This method is useful for getting the event mask of the physics engine,
     * which is used to determine which events the engine will respond to.
     * This is important for ensuring that the engine is responding to the correct events and not
     * wasting resources on unnecessary events.
     */
    getEventMask(instanceIndex) {
        return this._physicsPlugin.getEventMask(this, instanceIndex);
    }
    /**
     * Sets the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.
     * @param motionType - The motion type to set.
     * @param instanceIndex - If this body is instanced, the index of the instance to set the motion type for.
     */
    setMotionType(motionType, instanceIndex) {
        this.disableSync = motionType == 0 /* PhysicsMotionType.STATIC */;
        this._physicsPlugin.setMotionType(this, motionType, instanceIndex);
    }
    /**
     * Gets the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the motion type for.
     * @returns The motion type of the physics body.
     */
    getMotionType(instanceIndex) {
        return this._physicsPlugin.getMotionType(this, instanceIndex);
    }
    /**
     * Set the prestep type of the body
     * @param prestepType prestep type provided by PhysicsPrestepType
     */
    setPrestepType(prestepType) {
        this._prestepType = prestepType;
    }
    /**
     * Get the current prestep type of the body
     * @returns the type of prestep associated with the body and its instance index
     */
    getPrestepType() {
        return this._prestepType;
    }
    /**
     * Computes the mass properties of the physics object, based on the set of physics shapes this body uses.
     * This method is useful for computing the initial mass properties of a physics object, such as its mass,
     * inertia, and center of mass; these values are important for accurately simulating the physics of the
     * object in the physics engine, and computing values based on the shape will provide you with reasonable
     * initial values, which you can then customize.
     * @param instanceIndex - The index of the instance to compute the mass properties for.
     * @returns The mass properties of the object.
     */
    computeMassProperties(instanceIndex) {
        return this._physicsPlugin.computeMassProperties(this, instanceIndex);
    }
    /**
     * Sets the mass properties of the physics object.
     *
     * @param massProps - The mass properties to set.
     * @param instanceIndex - The index of the instance to set the mass properties for. If not defined, the mass properties will be set for all instances.
     *
     * This method is useful for setting the mass properties of a physics object, such as its mass,
     * inertia, and center of mass. This is important for accurately simulating the physics of the object in the physics engine.
     */
    setMassProperties(massProps, instanceIndex) {
        this._physicsPlugin.setMassProperties(this, massProps, instanceIndex);
    }
    /**
     * Retrieves the mass properties of the object.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the mass properties for.
     * @returns The mass properties of the object.
     *
     * This method is useful for physics simulations, as it allows the user to
     * retrieve the mass properties of the object, such as its mass, center of mass,
     * and moment of inertia. This information is necessary for accurate physics
     * simulations.
     */
    getMassProperties(instanceIndex) {
        return this._physicsPlugin.getMassProperties(this, instanceIndex);
    }
    /**
     * Sets the linear damping of the physics body.
     *
     * @param damping - The linear damping value.
     * @param instanceIndex - If this body is instanced, the index of the instance to set the linear damping for.
     *
     * This method is useful for controlling the linear damping of the physics body,
     * which is the rate at which the body's velocity decreases over time. This is useful for simulating
     * the effects of air resistance or other forms of friction.
     */
    setLinearDamping(damping, instanceIndex) {
        this._physicsPlugin.setLinearDamping(this, damping, instanceIndex);
    }
    /**
     * Gets the linear damping of the physics body.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the linear damping for.
     * @returns The linear damping of the physics body.
     *
     * This method is useful for retrieving the linear damping of the physics body, which is the amount of
     * resistance the body has to linear motion. This is useful for simulating realistic physics behavior
     * in a game.
     */
    getLinearDamping(instanceIndex) {
        return this._physicsPlugin.getLinearDamping(this, instanceIndex);
    }
    /**
     * Sets the angular damping of the physics body.
     * @param damping The angular damping of the body.
     * @param instanceIndex - If this body is instanced, the index of the instance to set the angular damping for.
     *
     * This method is useful for controlling the angular velocity of a physics body.
     * By setting the damping, the body's angular velocity will be reduced over time, simulating the effect of friction.
     * This can be used to create realistic physical behavior in a physics engine.
     */
    setAngularDamping(damping, instanceIndex) {
        this._physicsPlugin.setAngularDamping(this, damping, instanceIndex);
    }
    /**
     * Gets the angular damping of the physics body.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the angular damping for.
     *
     * @returns The angular damping of the physics body.
     *
     * This method is useful for getting the angular damping of the physics body,
     * which is the rate of reduction of the angular velocity over time.
     * This is important for simulating realistic physics behavior in a game.
     */
    getAngularDamping(instanceIndex) {
        return this._physicsPlugin.getAngularDamping(this, instanceIndex);
    }
    /**
     * Sets the linear velocity of the physics object.
     * @param linVel - The linear velocity to set.
     * @param instanceIndex - If this body is instanced, the index of the instance to set the linear velocity for.
     *
     * This method is useful for setting the linear velocity of a physics object,
     * which is necessary for simulating realistic physics in a game engine.
     * By setting the linear velocity, the physics object will move in the direction and speed specified by the vector.
     * This allows for realistic physics simulations, such as simulating the motion of a ball rolling down a hill.
     */
    setLinearVelocity(linVel, instanceIndex) {
        this._physicsPlugin.setLinearVelocity(this, linVel, instanceIndex);
    }
    /**
     * Gets the linear velocity of the physics body and stores it in the given vector3.
     * @param linVel - The vector3 to store the linear velocity in.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the linear velocity for.
     *
     * This method is useful for getting the linear velocity of a physics body in a physics engine.
     * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.
     */
    getLinearVelocityToRef(linVel, instanceIndex) {
        this._physicsPlugin.getLinearVelocityToRef(this, linVel, instanceIndex);
    }
    /**
     * Gets the linear velocity of the physics body as a new vector3.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the linear velocity for.
     * @returns The linear velocity of the physics body.
     *
     * This method is useful for getting the linear velocity of a physics body in a physics engine.
     * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.
     */
    getLinearVelocity(instanceIndex) {
        const ref = new math_vector/* Vector3 */.Pq();
        this.getLinearVelocityToRef(ref, instanceIndex);
        return ref;
    }
    /**
     * Sets the angular velocity of the physics object.
     * @param angVel - The angular velocity to set.
     * @param instanceIndex - If this body is instanced, the index of the instance to set the angular velocity for.
     *
     * This method is useful for setting the angular velocity of a physics object, which is necessary for
     * simulating realistic physics behavior. The angular velocity is used to determine the rate of rotation of the object,
     * which is important for simulating realistic motion.
     */
    setAngularVelocity(angVel, instanceIndex) {
        this._physicsPlugin.setAngularVelocity(this, angVel, instanceIndex);
    }
    /**
     * Gets the angular velocity of the physics body and stores it in the given vector3.
     * @param angVel - The vector3 to store the angular velocity in.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the angular velocity for.
     *
     * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's
     * rotational speed. This information can be used to create realistic physics simulations.
     */
    getAngularVelocityToRef(angVel, instanceIndex) {
        this._physicsPlugin.getAngularVelocityToRef(this, angVel, instanceIndex);
    }
    /**
     * Gets the angular velocity of the physics body as a new vector3.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the angular velocity for.
     * @returns The angular velocity of the physics body.
     *
     * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's
     * rotational speed. This information can be used to create realistic physics simulations.
     */
    getAngularVelocity(instanceIndex) {
        const ref = new math_vector/* Vector3 */.Pq();
        this.getAngularVelocityToRef(ref, instanceIndex);
        return ref;
    }
    /**
     * Applies an impulse to the physics object.
     *
     * @param impulse The impulse vector.
     * @param location The location of the impulse.
     * @param instanceIndex For a instanced body, the instance to where the impulse should be applied. If not specified, the impulse is applied to all instances.
     *
     * This method is useful for applying an impulse to a physics object, which can be used to simulate physical forces such as gravity,
     * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.
     */
    applyImpulse(impulse, location, instanceIndex) {
        this._physicsPlugin.applyImpulse(this, impulse, location, instanceIndex);
    }
    /**
     * Add torque to a physics body
     * @param angularImpulse The angular impulse vector.
     * @param instanceIndex For a instanced body, the instance to where the impulse should be applied. If not specified, the impulse is applied to all instances.
     */
    applyAngularImpulse(angularImpulse, instanceIndex) {
        this._physicsPlugin.applyAngularImpulse(this, angularImpulse, instanceIndex);
    }
    /**
     * Applies a force to the physics object.
     *
     * @param force The force vector.
     * @param location The location of the force.
     * @param instanceIndex For a instanced body, the instance to where the force should be applied. If not specified, the force is applied to all instances.
     *
     * This method is useful for applying a force to a physics object, which can be used to simulate physical forces such as gravity,
     * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.
     */
    applyForce(force, location, instanceIndex) {
        this._physicsPlugin.applyForce(this, force, location, instanceIndex);
    }
    /**
     * Retrieves the geometry of the body from the physics plugin.
     *
     * @returns The geometry of the body.
     *
     * This method is useful for retrieving the geometry of the body from the physics plugin, which can be used for various physics calculations.
     */
    getGeometry() {
        return this._physicsPlugin.getBodyGeometry(this);
    }
    /**
     * Returns an observable that will be notified for when a collision starts or continues for this PhysicsBody
     * @returns Observable
     */
    getCollisionObservable() {
        return this._physicsPlugin.getCollisionObservable(this);
    }
    /**
     * Returns an observable that will be notified when the body has finished colliding with another body
     * @returns
     */
    getCollisionEndedObservable() {
        return this._physicsPlugin.getCollisionEndedObservable(this);
    }
    /**
     * Enable or disable collision callback for this PhysicsBody.
     * @param enabled true if PhysicsBody's collision will rise a collision event and notifies the observable
     */
    setCollisionCallbackEnabled(enabled) {
        this._collisionCBEnabled = enabled;
        this._physicsPlugin.setCollisionCallbackEnabled(this, enabled);
    }
    /**
     * Enable or disable collision ended callback for this PhysicsBody.
     * @param enabled true if PhysicsBody's collision ended will rise a collision event and notifies the observable
     */
    setCollisionEndedCallbackEnabled(enabled) {
        this._collisionEndedCBEnabled = enabled;
        this._physicsPlugin.setCollisionEndedCallbackEnabled(this, enabled);
    }
    /**
     * Get the center of the object in world space.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the center for.
     * @returns geometric center of the associated mesh
     */
    getObjectCenterWorld(instanceIndex) {
        const ref = new math_vector/* Vector3 */.Pq();
        return this.getObjectCenterWorldToRef(ref, instanceIndex);
    }
    /**
     * Get the center of the object in world space.
     * @param ref - The vector3 to store the result in.
     * @param instanceIndex - If this body is instanced, the index of the instance to get the center for.
     * @returns geometric center of the associated mesh
     */
    getObjectCenterWorldToRef(ref, instanceIndex) {
        if (this._pluginDataInstances?.length > 0) {
            const index = instanceIndex || 0;
            const matrixData = this.transformNode._thinInstanceDataStorage.matrixData;
            if (matrixData) {
                ref.set(matrixData[index * 16 + 12], matrixData[index * 16 + 13], matrixData[index * 16 + 14]);
            }
        }
        else {
            ref.copyFrom(this.transformNode.position);
        }
        return ref;
    }
    /**
     * Adds a constraint to the physics engine.
     *
     * @param childBody - The body to which the constraint will be applied.
     * @param constraint - The constraint to be applied.
     * @param instanceIndex - If this body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
     * @param childInstanceIndex - If the child body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
     *
     */
    addConstraint(childBody, constraint, instanceIndex, childInstanceIndex) {
        this._physicsPlugin.addConstraint(this, childBody, constraint, instanceIndex, childInstanceIndex);
    }
    /**
     * Sync with a bone
     * @param bone The bone that the impostor will be synced to.
     * @param boneMesh The mesh that the bone is influencing.
     * @param jointPivot The pivot of the joint / bone in local space.
     * @param distToJoint Optional distance from the impostor to the joint.
     * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.
     * @param boneAxis Optional vector3 axis the bone is aligned with
     */
    syncWithBone(bone, boneMesh, jointPivot, distToJoint, adjustRotation, boneAxis) {
        const mesh = this.transformNode;
        if (mesh.rotationQuaternion) {
            if (adjustRotation) {
                const tempQuat = math_vector/* TmpVectors */.AA.Quaternion[0];
                bone.getRotationQuaternionToRef(1 /* Space.WORLD */, boneMesh, tempQuat);
                tempQuat.multiplyToRef(adjustRotation, mesh.rotationQuaternion);
            }
            else {
                bone.getRotationQuaternionToRef(1 /* Space.WORLD */, boneMesh, mesh.rotationQuaternion);
            }
        }
        const pos = math_vector/* TmpVectors */.AA.Vector3[0];
        const boneDir = math_vector/* TmpVectors */.AA.Vector3[1];
        if (!boneAxis) {
            boneAxis = math_vector/* TmpVectors */.AA.Vector3[2];
            boneAxis.x = 0;
            boneAxis.y = 1;
            boneAxis.z = 0;
        }
        bone.getDirectionToRef(boneAxis, boneMesh, boneDir);
        bone.getAbsolutePositionToRef(boneMesh, pos);
        if ((distToJoint === undefined || distToJoint === null) && jointPivot) {
            distToJoint = jointPivot.length();
        }
        if (distToJoint !== undefined && distToJoint !== null) {
            pos.x += boneDir.x * distToJoint;
            pos.y += boneDir.y * distToJoint;
            pos.z += boneDir.z * distToJoint;
        }
        mesh.setAbsolutePosition(pos);
    }
    /**
     * Executes a callback on the body or all of the instances of a body
     * @param callback the callback to execute
     */
    iterateOverAllInstances(callback) {
        if (this._pluginDataInstances?.length > 0) {
            for (let i = 0; i < this._pluginDataInstances.length; i++) {
                callback(this, i);
            }
        }
        else {
            callback(this, undefined);
        }
    }
    /**
     * Sets the gravity factor of the physics body
     * @param factor the gravity factor to set
     * @param instanceIndex the instance of the body to set, if undefined all instances will be set
     */
    setGravityFactor(factor, instanceIndex) {
        this._physicsPlugin.setGravityFactor(this, factor, instanceIndex);
    }
    /**
     * Gets the gravity factor of the physics body
     * @param instanceIndex the instance of the body to get, if undefined the value of first instance will be returned
     * @returns the gravity factor
     */
    getGravityFactor(instanceIndex) {
        return this._physicsPlugin.getGravityFactor(this, instanceIndex);
    }
    /**
     * Set the target transformation (position and rotation) of the body, such that the body will set its velocity to reach that target
     * @param position The target position
     * @param rotation The target rotation
     * @param instanceIndex The index of the instance in an instanced body
     */
    setTargetTransform(position, rotation, instanceIndex) {
        this._physicsPlugin.setTargetTransform(this, position, rotation, instanceIndex);
    }
    /**
     * Returns if the body has been disposed.
     * @returns true if disposed, false otherwise.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Disposes the body from the physics engine.
     *
     * This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        // Disable collisions CB so it doesn't fire when the body is disposed
        if (this._collisionCBEnabled) {
            this.setCollisionCallbackEnabled(false);
        }
        if (this._collisionEndedCBEnabled) {
            this.setCollisionEndedCallbackEnabled(false);
        }
        if (this._nodeDisposeObserver) {
            this.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver);
            this._nodeDisposeObserver = null;
        }
        this._physicsEngine.removeBody(this);
        this._physicsPlugin.removeBody(this);
        this._physicsPlugin.disposeBody(this);
        this.transformNode.physicsBody = null;
        this._pluginData = null;
        this._pluginDataInstances.length = 0;
        this._isDisposed = true;
        this.shape = null;
    }
}
//# sourceMappingURL=physicsBody.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/physicsShape.js

/**
 * PhysicsShape class.
 * This class is useful for creating a physics shape that can be used in a physics engine.
 * A Physic Shape determine how collision are computed. It must be attached to a body.
 */
class PhysicsShape {
    /**
     * Constructs a new physics shape.
     * @param options The options for the physics shape. These are:
     *  * type: The type of the shape. This can be one of the following: SPHERE, BOX, CAPSULE, CYLINDER, CONVEX_HULL, MESH, HEIGHTFIELD, CONTAINER
     *  * parameters: The parameters of the shape.
     *  * pluginData: The plugin data of the shape. This is used if you already have a reference to the object on the plugin side.
     * You need to specify either type or pluginData.
     * @param scene The scene the shape belongs to.
     *
     * This code is useful for creating a new physics shape with the given type, options, and scene.
     * It also checks that the physics engine and plugin version are correct.
     * If not, it throws an error. This ensures that the shape is created with the correct parameters and is compatible with the physics engine.
     */
    constructor(options, scene) {
        /**
         * V2 Physics plugin private data for single shape
         */
        this._pluginData = undefined;
        this._isTrigger = false;
        this._isDisposed = false;
        if (!scene) {
            return;
        }
        const physicsEngine = scene.getPhysicsEngine();
        if (!physicsEngine) {
            throw new Error("No Physics Engine available.");
        }
        if (physicsEngine.getPluginVersion() != 2) {
            throw new Error("Plugin version is incorrect. Expected version 2.");
        }
        const physicsPlugin = physicsEngine.getPhysicsPlugin();
        if (!physicsPlugin) {
            throw new Error("No Physics Plugin available.");
        }
        this._physicsPlugin = physicsPlugin;
        if (options.pluginData !== undefined && options.pluginData !== null) {
            this._pluginData = options.pluginData;
            this._type = this._physicsPlugin.getShapeType(this);
        }
        else if (options.type !== undefined && options.type !== null) {
            this._type = options.type;
            const parameters = options.parameters ?? {};
            this._physicsPlugin.initShape(this, options.type, parameters);
        }
    }
    /**
     * Returns the string "PhysicsShape".
     * @returns "PhysicsShape"
     */
    getClassName() {
        return "PhysicsShape";
    }
    /**
     * Returns the type of the physics shape.
     * @returns The type of the physics shape.
     */
    get type() {
        return this._type;
    }
    /**
     * Set the membership mask of a shape. This is a bitfield of arbitrary
     * "categories" to which the shape is a member. This is used in combination
     * with the collide mask to determine if this shape should collide with
     * another.
     *
     * @param membershipMask Bitfield of categories of this shape.
     */
    set filterMembershipMask(membershipMask) {
        this._physicsPlugin.setShapeFilterMembershipMask(this, membershipMask);
    }
    /**
     * Get the membership mask of a shape.
     * @returns Bitmask of categories which this shape is a member of.
     */
    get filterMembershipMask() {
        return this._physicsPlugin.getShapeFilterMembershipMask(this);
    }
    /**
     * Sets the collide mask of a shape. This is a bitfield of arbitrary
     * "categories" to which this shape collides with. Given two shapes,
     * the engine will check if the collide mask and membership overlap:
     * shapeA.filterMembershipMask & shapeB.filterCollideMask
     *
     * If this value is zero (i.e. shapeB only collides with categories
     * which shapeA is _not_ a member of) then the shapes will not collide.
     *
     * Note, the engine will also perform the same test with shapeA and
     * shapeB swapped; the shapes will not collide if either shape has
     * a collideMask which prevents collision with the other shape.
     *
     * @param collideMask Bitmask of categories this shape should collide with
     */
    set filterCollideMask(collideMask) {
        this._physicsPlugin.setShapeFilterCollideMask(this, collideMask);
    }
    /**
     *
     * @returns Bitmask of categories that this shape should collide with
     */
    get filterCollideMask() {
        return this._physicsPlugin.getShapeFilterCollideMask(this);
    }
    /**
     *
     * @param material
     */
    set material(material) {
        this._physicsPlugin.setMaterial(this, material);
        this._material = material;
    }
    /**
     * Returns the material of the physics shape.
     * @returns The material of the physics shape.
     */
    get material() {
        if (!this._material) {
            this._material = this._physicsPlugin.getMaterial(this);
        }
        return this._material;
    }
    /**
     * Sets the density of the physics shape.
     * @param density The density of the physics shape.
     */
    set density(density) {
        this._physicsPlugin.setDensity(this, density);
    }
    /**
     * Returns the density of the physics shape.
     * @returns The density of the physics shape.
     */
    get density() {
        return this._physicsPlugin.getDensity(this);
    }
    /**
     * Utility to add a child shape to this container,
     * automatically computing the relative transform between
     * the container shape and the child instance.
     *
     * @param parentTransform The transform node associated with this shape
     * @param newChild The new PhysicsShape to add
     * @param childTransform The transform node associated with the child shape
     */
    addChildFromParent(parentTransform, newChild, childTransform) {
        const childToWorld = childTransform.computeWorldMatrix(true);
        const parentToWorld = parentTransform.computeWorldMatrix(true);
        const childToParent = math_vector/* TmpVectors */.AA.Matrix[0];
        childToWorld.multiplyToRef(math_vector/* Matrix */.uq.Invert(parentToWorld), childToParent);
        const translation = math_vector/* TmpVectors */.AA.Vector3[0];
        const rotation = math_vector/* TmpVectors */.AA.Quaternion[0];
        const scale = math_vector/* TmpVectors */.AA.Vector3[1];
        childToParent.decompose(scale, rotation, translation);
        this._physicsPlugin.addChild(this, newChild, translation, rotation, scale);
    }
    /**
     * Adds a child shape to a container with an optional transform
     * @param newChild The new PhysicsShape to add
     * @param translation Optional position of the child shape relative to this shape
     * @param rotation Optional rotation of the child shape relative to this shape
     * @param scale Optional scale of the child shape relative to this shape
     */
    addChild(newChild, translation, rotation, scale) {
        this._physicsPlugin.addChild(this, newChild, translation, rotation, scale);
    }
    /**
     * Removes a child shape from this shape.
     * @param childIndex The index of the child shape to remove
     */
    removeChild(childIndex) {
        this._physicsPlugin.removeChild(this, childIndex);
    }
    /**
     * Returns the number of children of a physics shape.
     * @returns The number of children of a physics shape.
     */
    getNumChildren() {
        return this._physicsPlugin.getNumChildren(this);
    }
    /**
     * Returns the bounding box of the physics shape.
     * @returns The bounding box of the physics shape.
     */
    getBoundingBox() {
        return this._physicsPlugin.getBoundingBox(this);
    }
    set isTrigger(isTrigger) {
        if (this._isTrigger === isTrigger) {
            return;
        }
        this._isTrigger = isTrigger;
        this._physicsPlugin.setTrigger(this, isTrigger);
    }
    get isTrigger() {
        return this._isTrigger;
    }
    /**
     * Dispose the shape and release its associated resources.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._physicsPlugin.disposeShape(this);
        this._isDisposed = true;
    }
}
/**
 * Helper object to create a sphere shape
 */
class PhysicsShapeSphere extends PhysicsShape {
    /**
     * Constructor for the Sphere Shape
     * @param center local center of the sphere
     * @param radius radius
     * @param scene scene to attach to
     */
    constructor(center, radius, scene) {
        super({ type: 0 /* PhysicsShapeType.SPHERE */, parameters: { center: center, radius: radius } }, scene);
    }
    /**
     * Derive an approximate sphere from the mesh.
     * @param mesh node from which to derive the sphere shape
     * @returns PhysicsShapeSphere
     */
    static FromMesh(mesh) {
        const bounds = mesh.getBoundingInfo();
        const centerLocal = bounds.boundingSphere.center;
        const he = bounds.boundingBox.extendSize;
        const radius = Math.max(he.x, he.y, he.z);
        return new PhysicsShapeSphere(centerLocal, radius, mesh.getScene());
    }
}
/**
 * Helper object to create a capsule shape
 */
class PhysicsShapeCapsule extends PhysicsShape {
    /**
     *
     * @param pointA Starting point that defines the capsule segment
     * @param pointB ending point of that same segment
     * @param radius radius
     * @param scene scene to attach to
     */
    constructor(pointA, pointB, radius, scene) {
        super({ type: 1 /* PhysicsShapeType.CAPSULE */, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);
    }
    /**
     * Derive an approximate capsule from the mesh. Note, this is
     * not the optimal bounding capsule.
     * @param mesh Node from which to derive a cylinder shape
     * @returns Physics Shape Capsule
     */
    static FromMesh(mesh) {
        const boundsLocal = mesh.getBoundingInfo();
        const radius = boundsLocal.boundingBox.extendSize.x;
        const pointFromCenter = new math_vector/* Vector3 */.Pq(0, boundsLocal.boundingBox.extendSize.y - radius, 0);
        const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);
        const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);
        return new PhysicsShapeCapsule(pointA, pointB, radius, mesh.getScene());
    }
}
/**
 * Helper object to create a cylinder shape
 */
class PhysicsShapeCylinder extends PhysicsShape {
    /**
     *
     * @param pointA Starting point that defines the cylinder segment
     * @param pointB ending point of that same segment
     * @param radius radius
     * @param scene scene to attach to
     */
    constructor(pointA, pointB, radius, scene) {
        super({ type: 2 /* PhysicsShapeType.CYLINDER */, parameters: { pointA: pointA, pointB: pointB, radius: radius } }, scene);
    }
    /**
     * Derive an approximate cylinder from the mesh. Note, this is
     * not the optimal bounding cylinder.
     * @param mesh Node from which to derive a cylinder shape
     * @returns Physics Shape Cylinder
     */
    static FromMesh(mesh) {
        const boundsLocal = mesh.getBoundingInfo();
        const radius = boundsLocal.boundingBox.extendSize.x;
        const pointFromCenter = new math_vector/* Vector3 */.Pq(0, boundsLocal.boundingBox.extendSize.y, 0);
        const pointA = boundsLocal.boundingBox.center.add(pointFromCenter);
        const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter);
        return new PhysicsShapeCylinder(pointA, pointB, radius, mesh.getScene());
    }
}
/**
 * Helper object to create a box shape
 */
class PhysicsShapeBox extends PhysicsShape {
    /**
     *
     * @param center local center of the box
     * @param rotation local orientation
     * @param extents size of the box in each direction
     * @param scene scene to attach to
     */
    constructor(center, rotation, extents, scene) {
        super({ type: 3 /* PhysicsShapeType.BOX */, parameters: { center: center, rotation: rotation, extents: extents } }, scene);
    }
    /**
     *
     * @param mesh
     * @returns PhysicsShapeBox
     */
    static FromMesh(mesh) {
        const bounds = mesh.getBoundingInfo();
        const centerLocal = bounds.boundingBox.center;
        const extents = bounds.boundingBox.extendSize.scale(2.0); //<todo.eoin extendSize seems to really be half-extents?
        return new PhysicsShapeBox(centerLocal, math_vector/* Quaternion */.PT.Identity(), extents, mesh.getScene());
    }
}
/**
 * Helper object to create a convex hull shape
 */
class PhysicsShapeConvexHull extends PhysicsShape {
    /**
     *
     * @param mesh the mesh to be used as topology infos for the convex hull
     * @param scene scene to attach to
     */
    constructor(mesh, scene) {
        super({ type: 4 /* PhysicsShapeType.CONVEX_HULL */, parameters: { mesh: mesh } }, scene);
    }
}
/**
 * Helper object to create a mesh shape
 */
class PhysicsShapeMesh extends PhysicsShape {
    /**
     *
     * @param mesh the mesh topology that will be used to create the shape
     * @param scene scene to attach to
     */
    constructor(mesh, scene) {
        super({ type: 6 /* PhysicsShapeType.MESH */, parameters: { mesh: mesh } }, scene);
    }
}
/**
 * A shape container holds a variable number of shapes. Use AddChild to append to newly created parent container.
 */
class PhysicsShapeContainer extends PhysicsShape {
    /**
     * Constructor of the Shape container
     * @param scene scene to attach to
     */
    constructor(scene) {
        super({ type: 5 /* PhysicsShapeType.CONTAINER */, parameters: {} }, scene);
    }
}
/**
 * Helper object to create a heightfield Shape
 */
class PhysicsShapeHeightField extends PhysicsShape {
    /**
     * Constructor of the Shape heightfield
     * @param heightFieldSizeX The size of the heightfield in the X axis
     * @param heightFieldSizeZ The size of the heightfield in the Z axis
     * @param numHeightFieldSamplesX The number of samples along the X axis
     * @param numHeightFieldSamplesZ The number of samples along the Z axis
     * @param heightFieldData The data for the heightfield
     * @param scene scene to attach to
     */
    constructor(heightFieldSizeX, heightFieldSizeZ, numHeightFieldSamplesX, numHeightFieldSamplesZ, heightFieldData, scene) {
        super({
            type: 7 /* PhysicsShapeType.HEIGHTFIELD */,
            parameters: {
                heightFieldSizeX: heightFieldSizeX,
                heightFieldSizeZ: heightFieldSizeZ,
                numHeightFieldSamplesX: numHeightFieldSamplesX,
                numHeightFieldSamplesZ: numHeightFieldSamplesZ,
                heightFieldData: heightFieldData,
            },
        }, scene);
    }
}
/**
 * Helper object to create a ground mesh Shape
 */
class PhysicsShapeGroundMesh extends PhysicsShape {
    /**
     * Constructor of the Shape heightfield
     * @param groundMesh ground mesh used for display
     * @param scene scene to attach to
     */
    constructor(groundMesh, scene) {
        super({ type: 7 /* PhysicsShapeType.HEIGHTFIELD */, parameters: { groundMesh: groundMesh } }, scene);
    }
}
//# sourceMappingURL=physicsShape.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/physicsConstraint.js
/**
 * This is a holder class for the physics constraint created by the physics plugin
 * It holds a set of functions to control the underlying constraint
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
class PhysicsConstraint {
    /**
     * Constructs a new constraint for the physics constraint.
     * @param type The type of constraint to create.
     * @param options The options for the constraint.
     * @param scene The scene the constraint belongs to.
     *
     * This code is useful for creating a new constraint for the physics engine. It checks if the scene has a physics engine, and if the plugin version is correct.
     * If all checks pass, it initializes the constraint with the given type and options.
     */
    constructor(type, options, scene) {
        /**
         * V2 Physics plugin private data for a physics material
         */
        this._pluginData = undefined;
        if (!scene) {
            throw new Error("Missing scene parameter for constraint constructor.");
        }
        const physicsEngine = scene.getPhysicsEngine();
        if (!physicsEngine) {
            throw new Error("No Physics Engine available.");
        }
        if (physicsEngine.getPluginVersion() != 2) {
            throw new Error("Plugin version is incorrect. Expected version 2.");
        }
        const physicsPlugin = physicsEngine.getPhysicsPlugin();
        if (!physicsPlugin) {
            throw new Error("No Physics Plugin available.");
        }
        this._physicsPlugin = physicsPlugin;
        this._options = options;
        this._type = type;
    }
    /**
     * Gets the type of the constraint.
     *
     * @returns The type of the constraint.
     *
     */
    get type() {
        return this._type;
    }
    /**
     * Retrieves the options of the physics constraint.
     *
     * @returns The physics constraint parameters.
     *
     */
    get options() {
        return this._options;
    }
    /**
     * Enable/disable the constraint
     * @param isEnabled value for the constraint
     */
    set isEnabled(isEnabled) {
        this._physicsPlugin.setEnabled(this, isEnabled);
    }
    /**
     *
     * @returns true if constraint is enabled
     */
    get isEnabled() {
        return this._physicsPlugin.getEnabled(this);
    }
    /**
     * Enables or disables collisions for the physics engine.
     *
     * @param isEnabled - A boolean value indicating whether collisions should be enabled or disabled.
     *
     */
    set isCollisionsEnabled(isEnabled) {
        this._physicsPlugin.setCollisionsEnabled(this, isEnabled);
    }
    /**
     * Gets whether collisions are enabled for this physics object.
     *
     * @returns `true` if collisions are enabled, `false` otherwise.
     *
     */
    get isCollisionsEnabled() {
        return this._physicsPlugin.getCollisionsEnabled(this);
    }
    /**
     * Gets all bodies that are using this constraint
     * @returns
     */
    getBodiesUsingConstraint() {
        return this._physicsPlugin.getBodiesUsingConstraint(this);
    }
    /**
     * Disposes the constraint from the physics engine.
     *
     * This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.
     */
    dispose() {
        this._physicsPlugin.disposeConstraint(this);
    }
}
/**
 * This describes a single limit used by Physics6DoFConstraint
 */
class Physics6DoFLimit {
}
/**
 * A generic constraint, which can be used to build more complex constraints than those specified
 * in PhysicsConstraintType. The axis and pivot options in PhysicsConstraintParameters define the space
 * the constraint operates in. This constraint contains a set of limits, which restrict the
 * relative movement of the bodies in that coordinate system
 */
class Physics6DoFConstraint extends PhysicsConstraint {
    constructor(constraintParams, limits, scene) {
        super(7 /* PhysicsConstraintType.SIX_DOF */, constraintParams, scene);
        this.limits = limits;
    }
    /**
     * Sets the friction of the given axis of the physics engine.
     * @param axis - The axis of the physics engine to set the friction for.
     * @param friction - The friction to set for the given axis.
     *
     */
    setAxisFriction(axis, friction) {
        this._physicsPlugin.setAxisFriction(this, axis, friction);
    }
    /**
     * Gets the friction of the given axis of the physics engine.
     * @param axis - The axis of the physics engine.
     * @returns The friction of the given axis, or null if the constraint hasn't been initialized yet.
     *
     */
    getAxisFriction(axis) {
        return this._physicsPlugin.getAxisFriction(this, axis);
    }
    /**
     * Sets the limit mode for the given axis of the constraint.
     * @param axis The axis to set the limit mode for.
     * @param limitMode The limit mode to set.
     *
     * This method is useful for setting the limit mode for a given axis of the constraint. This is important for
     * controlling the behavior of the physics engine when the constraint is reached. By setting the limit mode,
     * the engine can be configured to either stop the motion of the objects, or to allow them to continue
     * moving beyond the constraint.
     */
    setAxisMode(axis, limitMode) {
        this._physicsPlugin.setAxisMode(this, axis, limitMode);
    }
    /**
     * Gets the limit mode of the given axis of the constraint.
     *
     * @param axis - The axis of the constraint.
     * @returns The limit mode of the given axis, or null if the constraint hasn't been initialized yet.
     *
     */
    getAxisMode(axis) {
        return this._physicsPlugin.getAxisMode(this, axis);
    }
    /**
     * Sets the minimum limit of a given axis of a constraint.
     * @param axis - The axis of the constraint.
     * @param minLimit - The minimum limit of the axis.
     *
     */
    setAxisMinLimit(axis, minLimit) {
        this._physicsPlugin.setAxisMinLimit(this, axis, minLimit);
    }
    /**
     * Gets the minimum limit of the given axis of the physics engine.
     * @param axis - The axis of the physics engine.
     * @returns The minimum limit of the given axis, or null if the constraint hasn't been initialized yet.
     *
     */
    getAxisMinLimit(axis) {
        return this._physicsPlugin.getAxisMinLimit(this, axis);
    }
    /**
     * Sets the maximum limit of the given axis for the physics engine.
     * @param axis - The axis to set the limit for.
     * @param limit - The maximum limit of the axis.
     *
     * This method is useful for setting the maximum limit of the given axis for the physics engine,
     * which can be used to control the movement of the physics object. This helps to ensure that the
     * physics object does not move beyond the given limit.
     */
    setAxisMaxLimit(axis, limit) {
        this._physicsPlugin.setAxisMaxLimit(this, axis, limit);
    }
    /**
     * Gets the maximum limit of the given axis of the physics engine.
     * @param axis - The axis of the physics engine.
     * @returns The maximum limit of the given axis, or null if the constraint hasn't been initialized yet.
     *
     */
    getAxisMaxLimit(axis) {
        return this._physicsPlugin.getAxisMaxLimit(this, axis);
    }
    /**
     * Sets the motor type of the given axis of the constraint.
     * @param axis - The axis of the constraint.
     * @param motorType - The type of motor to use.
     */
    setAxisMotorType(axis, motorType) {
        this._physicsPlugin.setAxisMotorType(this, axis, motorType);
    }
    /**
     * Gets the motor type of the specified axis of the constraint.
     *
     * @param axis - The axis of the constraint.
     * @returns The motor type of the specified axis, or null if the constraint hasn't been initialized yet.
     *
     */
    getAxisMotorType(axis) {
        return this._physicsPlugin.getAxisMotorType(this, axis);
    }
    /**
     * Sets the target velocity of the motor associated with the given axis of the constraint.
     * @param axis - The axis of the constraint.
     * @param target - The target velocity of the motor.
     *
     * This method is useful for setting the target velocity of the motor associated with the given axis of the constraint.
     */
    setAxisMotorTarget(axis, target) {
        this._physicsPlugin.setAxisMotorTarget(this, axis, target);
    }
    /**
     * Gets the target velocity of the motor associated to the given constraint axis.
     * @param axis - The constraint axis associated to the motor.
     * @returns The target velocity of the motor, or null if the constraint hasn't been initialized yet.
     *
     */
    getAxisMotorTarget(axis) {
        return this._physicsPlugin.getAxisMotorTarget(this, axis);
    }
    /**
     * Sets the maximum force of the motor of the given axis of the constraint.
     * @param axis - The axis of the constraint.
     * @param maxForce - The maximum force of the motor.
     *
     */
    setAxisMotorMaxForce(axis, maxForce) {
        this._physicsPlugin.setAxisMotorMaxForce(this, axis, maxForce);
    }
    /**
     * Gets the maximum force of the motor of the given axis of the constraint.
     * @param axis - The axis of the constraint.
     * @returns The maximum force of the motor, or null if the constraint hasn't been initialized yet.
     *
     */
    getAxisMotorMaxForce(axis) {
        return this._physicsPlugin.getAxisMotorMaxForce(this, axis);
    }
}
/**
 * Represents a Ball and Socket Constraint, used to simulate a joint
 * This class is useful for simulating a joint between two bodies in a physics engine.
 * It allows for the two bodies to move relative to each other in a way that mimics a ball and socket joint, such as a shoulder or hip joint.
 * @param pivotA - The first pivot, defined locally in the first body frame
 * @param pivotB - The second pivot, defined locally in the second body frame
 * @param axisA - The axis of the first body
 * @param axisB - The axis of the second body
 * @param scene - The scene the constraint is applied to
 * @returns The Ball and Socket Constraint
 */
class BallAndSocketConstraint extends PhysicsConstraint {
    constructor(pivotA, pivotB, axisA, axisB, scene) {
        super(1 /* PhysicsConstraintType.BALL_AND_SOCKET */, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);
    }
}
/**
 * Creates a distance constraint.
 *
 * This code is useful for creating a distance constraint in a physics engine.
 * A distance constraint is a type of constraint that keeps two objects at a certain distance from each other.
 * The scene is used to add the constraint to the physics engine.
 * @param maxDistance distance between bodies
 * @param scene The scene the constraint belongs to
 * @returns DistanceConstraint
 */
class DistanceConstraint extends PhysicsConstraint {
    constructor(maxDistance, scene) {
        super(2 /* PhysicsConstraintType.DISTANCE */, { maxDistance: maxDistance }, scene);
    }
}
/**
 * Creates a HingeConstraint, which is a type of PhysicsConstraint.
 *
 * This code is useful for creating a HingeConstraint, which is a type of PhysicsConstraint.
 * This constraint is used to simulate a hinge joint between two rigid bodies, allowing them to rotate around a single axis.
 * @param pivotA - The first pivot point, in world space.
 * @param pivotB - The second pivot point, in world space.
 * @param scene - The scene the constraint is used in.
 * @returns The new HingeConstraint.
 */
class HingeConstraint extends PhysicsConstraint {
    constructor(pivotA, pivotB, axisA, axisB, scene) {
        super(3 /* PhysicsConstraintType.HINGE */, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);
    }
}
/**
 * Creates a SliderConstraint, which is a type of PhysicsConstraint.
 *
 * This code is useful for creating a SliderConstraint, which is a type of PhysicsConstraint.
 * It allows the user to specify the two pivots and two axes of the constraint in world space, as well as the scene the constraint belongs to.
 * This is useful for creating a constraint between two rigid bodies that allows them to move along a certain axis.
 * @param pivotA - The first pivot of the constraint, in world space.
 * @param pivotB - The second pivot of the constraint, in world space.
 * @param axisA - The first axis of the constraint, in world space.
 * @param axisB - The second axis of the constraint, in world space.
 * @param scene - The scene the constraint belongs to.
 * @returns The created SliderConstraint.
 */
class SliderConstraint extends PhysicsConstraint {
    constructor(pivotA, pivotB, axisA, axisB, scene) {
        super(4 /* PhysicsConstraintType.SLIDER */, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);
    }
}
/**
 * Creates a LockConstraint, which is a type of PhysicsConstraint.
 *
 * This code is useful for creating a LockConstraint, which is a type of PhysicsConstraint.
 * It takes in two pivots and two axes in local space, as well as the scene the constraint belongs to, and creates a LockConstraint.
 * @param pivotA - The first pivot of the constraint in local space.
 * @param pivotB - The second pivot of the constraint in local space.
 * @param axisA - The first axis of the constraint in local space.
 * @param axisB - The second axis of the constraint in local space.
 * @param scene - The scene the constraint belongs to.
 * @returns The created LockConstraint.
 */
class LockConstraint extends PhysicsConstraint {
    constructor(pivotA, pivotB, axisA, axisB, scene) {
        super(5 /* PhysicsConstraintType.LOCK */, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);
    }
}
/**
 * Creates a PrismaticConstraint, which is a type of PhysicsConstraint.
 *
 * This code is useful for creating a PrismaticConstraint, which is a type of PhysicsConstraint.
 * It takes in two pivots and two axes in local space, as well as the scene the constraint belongs to, and creates a PrismaticConstraint.
 * @param pivotA - The first pivot of the constraint in local space.
 * @param pivotB - The second pivot of the constraint in local space.
 * @param axisA - The first axis of the constraint in local space.
 * @param axisB - The second axis of the constraint in local space.
 * @param scene - The scene the constraint belongs to.
 * @returns The created LockConstraint.
 */
class PrismaticConstraint extends PhysicsConstraint {
    constructor(pivotA, pivotB, axisA, axisB, scene) {
        super(6 /* PhysicsConstraintType.PRISMATIC */, { pivotA: pivotA, pivotB: pivotB, axisA: axisA, axisB: axisB }, scene);
    }
}
/**
 * Creates a SpringConstraint, which is a type of Physics6DoFConstraint. This constraint applies a force at the ends which is proportional
 * to the distance between ends, and a stiffness and damping factor. The force is calculated as (stiffness * positionError) - (damping * velocity)
 *
 * @param pivotA - The first pivot of the constraint in local space.
 * @param pivotB - The second pivot of the constraint in local space.
 * @param axisA - The first axis of the constraint in local space.
 * @param axisB - The second axis of the constraint in local space.
 * @param minDistance - The minimum distance between the two pivots.
 * @param maxDistance - The maximum distance between the two pivots.
 * @param stiffness - The stiffness of the spring.
 * @param damping - The damping of the spring.
 * @param scene - The scene the constraint belongs to.
 * @returns The created SpringConstraint.
 */
class SpringConstraint extends Physics6DoFConstraint {
    constructor(pivotA, pivotB, axisA, axisB, minDistance, maxDistance, stiffness, damping, scene) {
        super({ pivotA, pivotB, axisA, axisB }, [{ axis: 6 /* PhysicsConstraintAxis.LINEAR_DISTANCE */, minLimit: minDistance, maxLimit: maxDistance, stiffness, damping }], scene);
    }
}
//# sourceMappingURL=physicsConstraint.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/physicsMaterial.js
/**
 * Determines how values from the PhysicsMaterial are combined when
 * two objects are in contact. When each PhysicsMaterial specifies
 * a different combine mode for some property, the combine mode which
 * is used will be selected based on their order in this enum - i.e.
 * a value later in this list will be preferentially used.
 */
var PhysicsMaterialCombineMode;
(function (PhysicsMaterialCombineMode) {
    /**
     * The final value will be the geometric mean of the two values:
     * sqrt( valueA *  valueB )
     */
    PhysicsMaterialCombineMode[PhysicsMaterialCombineMode["GEOMETRIC_MEAN"] = 0] = "GEOMETRIC_MEAN";
    /**
     * The final value will be the smaller of the two:
     * min( valueA , valueB )
     */
    PhysicsMaterialCombineMode[PhysicsMaterialCombineMode["MINIMUM"] = 1] = "MINIMUM";
    /* The final value will be the larger of the two:
     * max( valueA , valueB )
     */
    PhysicsMaterialCombineMode[PhysicsMaterialCombineMode["MAXIMUM"] = 2] = "MAXIMUM";
    /* The final value will be the arithmetic mean of the two values:
     * (valueA + valueB) / 2
     */
    PhysicsMaterialCombineMode[PhysicsMaterialCombineMode["ARITHMETIC_MEAN"] = 3] = "ARITHMETIC_MEAN";
    /**
     * The final value will be the product of the two values:
     * valueA * valueB
     */
    PhysicsMaterialCombineMode[PhysicsMaterialCombineMode["MULTIPLY"] = 4] = "MULTIPLY";
})(PhysicsMaterialCombineMode || (PhysicsMaterialCombineMode = {}));
//# sourceMappingURL=physicsMaterial.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/physicsAggregate.js






/**
 * Helper class to create and interact with a PhysicsAggregate.
 * This is a transition object that works like Physics Plugin V1 Impostors.
 * This helper instanciate all mandatory physics objects to get a body/shape and material.
 * It's less efficient that handling body and shapes independently but for prototyping or
 * a small numbers of physics objects, it's good enough.
 */
class PhysicsAggregate {
    constructor(
    /**
     * The physics-enabled object used as the physics aggregate
     */
    transformNode, 
    /**
     * The type of the physics aggregate
     */
    type, _options = { mass: 0 }, _scene) {
        this.transformNode = transformNode;
        this.type = type;
        this._options = _options;
        this._scene = _scene;
        this._disposeShapeWhenDisposed = true;
        //sanity check!
        if (!this.transformNode) {
            logger/* Logger */.V.Error("No object was provided. A physics object is obligatory");
            return;
        }
        const m = transformNode;
        if (this.transformNode.parent && this._options.mass !== 0 && m.hasThinInstances) {
            logger/* Logger */.V.Warn("A physics body has been created for an object which has a parent and thin instances. Babylon physics currently works in local space so unexpected issues may occur.");
        }
        // Legacy support for old syntax.
        if (!this._scene && transformNode.getScene) {
            this._scene = transformNode.getScene();
        }
        if (!this._scene) {
            return;
        }
        //default options params
        this._options.mass = _options.mass === void 0 ? 0 : _options.mass;
        this._options.friction = _options.friction === void 0 ? 0.2 : _options.friction;
        this._options.restitution = _options.restitution === void 0 ? 0.2 : _options.restitution;
        const motionType = this._options.mass === 0 ? 0 /* PhysicsMotionType.STATIC */ : 2 /* PhysicsMotionType.DYNAMIC */;
        const startAsleep = this._options.startAsleep ?? false;
        this.body = new PhysicsBody(transformNode, motionType, startAsleep, this._scene);
        this._addSizeOptions();
        if (type.getClassName && type.getClassName() === "PhysicsShape") {
            this.shape = type;
            this._disposeShapeWhenDisposed = false;
        }
        else {
            this.shape = new PhysicsShape({ type: type, parameters: this._options }, this._scene);
        }
        if (this._options.isTriggerShape) {
            this.shape.isTrigger = true;
        }
        this.material = { friction: this._options.friction, restitution: this._options.restitution };
        this.body.shape = this.shape;
        this.shape.material = this.material;
        this.body.setMassProperties({ mass: this._options.mass });
        this._nodeDisposeObserver = this.transformNode.onDisposeObservable.add(() => {
            this.dispose();
        });
    }
    _getObjectBoundingBox() {
        if (this.transformNode.getRawBoundingInfo) {
            return this.transformNode.getRawBoundingInfo().boundingBox;
        }
        else {
            return new boundingBox/* BoundingBox */.I(new math_vector/* Vector3 */.Pq(-0.5, -0.5, -0.5), new math_vector/* Vector3 */.Pq(0.5, 0.5, 0.5));
        }
    }
    _hasVertices(node) {
        return node?.getTotalVertices() > 0;
    }
    _addSizeOptions() {
        this.transformNode.computeWorldMatrix(true);
        const bb = this._getObjectBoundingBox();
        const extents = math_vector/* TmpVectors */.AA.Vector3[0];
        extents.copyFrom(bb.extendSize);
        extents.scaleInPlace(2);
        extents.multiplyInPlace(this.transformNode.absoluteScaling);
        // In case we had any negative scaling, we need to take the absolute value of the extents.
        extents.x = Math.abs(extents.x);
        extents.y = Math.abs(extents.y);
        extents.z = Math.abs(extents.z);
        const min = math_vector/* TmpVectors */.AA.Vector3[1];
        min.copyFrom(bb.minimum);
        min.multiplyInPlace(this.transformNode.absoluteScaling);
        if (!this._options.center) {
            const center = new math_vector/* Vector3 */.Pq();
            center.copyFrom(bb.center);
            center.multiplyInPlace(this.transformNode.absoluteScaling);
            this._options.center = center;
        }
        switch (this.type) {
            case 0 /* PhysicsShapeType.SPHERE */:
                if (!this._options.radius && (0,math_scalar_functions.WithinEpsilon)(extents.x, extents.y, 0.0001) && (0,math_scalar_functions.WithinEpsilon)(extents.x, extents.z, 0.0001)) {
                    this._options.radius = extents.x / 2;
                }
                else if (!this._options.radius) {
                    logger/* Logger */.V.Warn("Non uniform scaling is unsupported for sphere shapes. Setting the radius to the biggest bounding box extent.");
                    this._options.radius = Math.max(extents.x, extents.y, extents.z) / 2;
                }
                break;
            case 1 /* PhysicsShapeType.CAPSULE */:
                {
                    const capRadius = extents.x / 2;
                    this._options.radius = this._options.radius ?? capRadius;
                    this._options.pointA = this._options.pointA ?? new math_vector/* Vector3 */.Pq(0, min.y + capRadius, 0);
                    this._options.pointB = this._options.pointB ?? new math_vector/* Vector3 */.Pq(0, min.y + extents.y - capRadius, 0);
                }
                break;
            case 2 /* PhysicsShapeType.CYLINDER */:
                {
                    const capRadius = extents.x / 2;
                    this._options.radius = this._options.radius ?? capRadius;
                    this._options.pointA = this._options.pointA ?? new math_vector/* Vector3 */.Pq(0, min.y, 0);
                    this._options.pointB = this._options.pointB ?? new math_vector/* Vector3 */.Pq(0, min.y + extents.y, 0);
                }
                break;
            case 6 /* PhysicsShapeType.MESH */:
            case 4 /* PhysicsShapeType.CONVEX_HULL */:
            case 7 /* PhysicsShapeType.HEIGHTFIELD */:
                if (!this._options.mesh && this._hasVertices(this.transformNode)) {
                    this._options.mesh = this.transformNode;
                }
                else if (!this._options.mesh || !this._hasVertices(this._options.mesh)) {
                    throw new Error("No valid mesh was provided for mesh or convex hull shape parameter. Please provide a mesh with valid geometry (number of vertices greater than 0).");
                }
                break;
            case 3 /* PhysicsShapeType.BOX */:
                this._options.extents = this._options.extents ?? new math_vector/* Vector3 */.Pq(extents.x, extents.y, extents.z);
                this._options.rotation = this._options.rotation ?? math_vector/* Quaternion */.PT.Identity();
                break;
        }
    }
    /**
     * Releases the body, shape and material
     */
    dispose() {
        if (this._nodeDisposeObserver) {
            this.body.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver);
            this._nodeDisposeObserver = null;
        }
        this.body.dispose();
        if (this._disposeShapeWhenDisposed) {
            this.shape.dispose();
        }
    }
}
//# sourceMappingURL=physicsAggregate.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/ragdoll.js






/**
 * Ragdoll bone properties
 * @experimental
 */
class RagdollBoneProperties {
}
/**
 * Ragdoll for Physics V2
 * @experimental
 */
class Ragdoll {
    /**
     * Construct a new Ragdoll object. Once ready, it can be made dynamic by calling `Ragdoll` method
     * @param skeleton The skeleton containing bones to be physicalized
     * @param rootTransformNode The mesh or its transform used by the skeleton
     * @param config an array of `RagdollBoneProperties` corresponding to bones and their properties used to instanciate physics bodies
     */
    constructor(skeleton, rootTransformNode, config) {
        this._boxConfigs = new Array();
        this._joints = new Array();
        this._bones = new Array();
        this._initialRotation = new Array();
        // without mesh transform, to figure out later
        this._initialRotation2 = new Array();
        this._boneNames = [];
        this._transforms = new Array();
        this._aggregates = new Array();
        this._ragdollMode = false;
        this._rootBoneName = "";
        this._rootBoneIndex = -1;
        this._mass = 10;
        this._restitution = 0;
        /**
         * Pause synchronization between physics and bone position/orientation
         */
        this.pauseSync = false;
        this._defaultJoint = 3 /* PhysicsConstraintType.HINGE */;
        this._defaultJointMin = -90;
        this._defaultJointMax = 90;
        this._skeleton = skeleton;
        this._scene = skeleton.getScene();
        this._rootTransformNode = rootTransformNode;
        this._config = config; // initial, user defined box configs. May have several box configs jammed into 1 index.
        this._boxConfigs = []; // final box configs. Every element is a separate box config (this.config may have several configs jammed into 1 index).
        this._putBoxesInBoneCenter = false;
        this._defaultJoint = 3 /* PhysicsConstraintType.HINGE */;
        this._init();
    }
    /**
     * Returns the aggregate corresponding to the ragdoll bone index
     * @param index ragdoll bone aggregate index
     * @returns the aggregate for the bone index for the root aggregate if index is invalid
     */
    getAggregate(index) {
        if (index < 0 || index >= this._aggregates.length) {
            return this._aggregates[this._rootBoneIndex];
        }
        return this._aggregates[index];
    }
    _createColliders() {
        this._rootTransformNode.computeWorldMatrix();
        this._skeleton.computeAbsoluteMatrices(true);
        this._skeleton.prepare(true);
        const config = this._config;
        for (let i = 0; i < config.length; i++) {
            const boneNames = config[i].bone !== undefined ? [config[i].bone] : config[i].bones;
            for (let ii = 0; ii < boneNames.length; ii++) {
                const currentBone = this._skeleton.bones[this._skeleton.getBoneIndexByName(boneNames[ii])];
                if (currentBone == undefined) {
                    return;
                }
                // First define the box dimensions, so we can then use them when calling CreateBox().
                const currentRagdollBoneProperties = {
                    width: this._config[i].width,
                    depth: this._config[i].depth,
                    height: this._config[i].height,
                    size: this._config[i].size,
                };
                currentRagdollBoneProperties.width = currentRagdollBoneProperties.width ?? currentRagdollBoneProperties.size;
                currentRagdollBoneProperties.depth = currentRagdollBoneProperties.depth ?? currentRagdollBoneProperties.size;
                currentRagdollBoneProperties.height = currentRagdollBoneProperties.height ?? currentRagdollBoneProperties.size;
                const transform = new Meshes_transformNode/* TransformNode */.V(boneNames[ii] + "_transform", this._scene);
                // Define the rest of the box properties.
                currentRagdollBoneProperties.joint = config[i].joint !== undefined ? config[i].joint : this._defaultJoint;
                currentRagdollBoneProperties.rotationAxis = config[i].rotationAxis !== undefined ? config[i].rotationAxis : math_axis/* Axis */._0.X;
                currentRagdollBoneProperties.min = config[i].min !== undefined ? config[i].min : this._defaultJointMin;
                currentRagdollBoneProperties.max = config[i].max !== undefined ? config[i].max : this._defaultJointMax;
                // Offset value.
                let boxOffset = 0;
                if ((config[i].putBoxInBoneCenter !== undefined && config[i].putBoxInBoneCenter) || this._putBoxesInBoneCenter) {
                    if (currentBone.length === undefined) {
                        logger/* Logger */.V.Log("The length property is not defined for bone " + currentBone.name);
                    }
                    boxOffset = currentBone.length / 2;
                }
                else if (config[i].boxOffset !== undefined) {
                    boxOffset = config[i].boxOffset;
                }
                currentRagdollBoneProperties.boxOffset = boxOffset;
                // Offset axis.
                const boneOffsetAxis = config[i].boneOffsetAxis !== undefined ? config[i].boneOffsetAxis : math_axis/* Axis */._0.Y;
                const boneDir = currentBone.getDirection(boneOffsetAxis, this._rootTransformNode);
                currentRagdollBoneProperties.boneOffsetAxis = boneOffsetAxis;
                transform.position = currentBone.getAbsolutePosition(this._rootTransformNode).add(boneDir.scale(boxOffset));
                const mass = config[i].mass !== undefined ? config[i].mass : this._mass;
                const restitution = config[i].restitution !== undefined ? config[i].restitution : this._restitution;
                const aggregate = new PhysicsAggregate(transform, 3 /* PhysicsShapeType.BOX */, {
                    mass: mass,
                    restitution: restitution,
                    friction: 0.6,
                    extents: new math_vector/* Vector3 */.Pq(currentRagdollBoneProperties.width, currentRagdollBoneProperties.height, currentRagdollBoneProperties.depth),
                }, this._scene);
                aggregate.body.setCollisionCallbackEnabled(true);
                aggregate.body.disablePreStep = false;
                aggregate.body.setMotionType(1 /* PhysicsMotionType.ANIMATED */);
                this._aggregates.push(aggregate);
                this._bones.push(currentBone);
                this._boneNames.push(currentBone.name);
                this._transforms.push(transform);
                this._boxConfigs.push(currentRagdollBoneProperties);
                this._initialRotation.push(currentBone.getRotationQuaternion(1 /* Space.WORLD */, this._rootTransformNode));
                this._initialRotation2.push(currentBone.getRotationQuaternion(1 /* Space.WORLD */));
            }
        }
    }
    _initJoints() {
        this._rootTransformNode.computeWorldMatrix();
        for (let i = 0; i < this._bones.length; i++) {
            // The root bone has no joints.
            if (i == this._rootBoneIndex)
                continue;
            const nearestParent = this._findNearestParent(i);
            if (nearestParent == null) {
                logger/* Logger */.V.Warn("Couldn't find a nearest parent bone in the configs for bone called " + this._boneNames[i]);
                return;
            }
            const boneParentIndex = this._boneNames.indexOf(nearestParent.name);
            let distanceFromParentBoxToBone = this._bones[i].getAbsolutePosition(this._rootTransformNode).subtract(this._transforms[boneParentIndex].position);
            const wmat = this._transforms[boneParentIndex].computeWorldMatrix();
            const invertedWorldMat = math_vector/* Matrix */.uq.Invert(wmat);
            distanceFromParentBoxToBone = math_vector/* Vector3 */.Pq.TransformCoordinates(this._bones[i].getAbsolutePosition(this._rootTransformNode), invertedWorldMat);
            const boneAbsPos = this._bones[i].getAbsolutePosition(this._rootTransformNode);
            const boxAbsPos = this._transforms[i].position.clone();
            const myConnectedPivot = boneAbsPos.subtract(boxAbsPos);
            const joint = new PhysicsConstraint(1 /* PhysicsConstraintType.BALL_AND_SOCKET */, {
                pivotA: distanceFromParentBoxToBone,
                pivotB: myConnectedPivot,
                axisA: this._boxConfigs[i].rotationAxis,
                axisB: this._boxConfigs[i].rotationAxis,
                collision: false,
            }, this._scene);
            this._aggregates[boneParentIndex].body.addConstraint(this._aggregates[i].body, joint);
            joint.isEnabled = false;
            this._joints.push(joint);
        }
    }
    // set physics body orientation/position from bones
    _syncBonesToPhysics() {
        const rootMatrix = this._rootTransformNode.getWorldMatrix();
        for (let i = 0; i < this._bones.length; i++) {
            // position
            const transform = this._aggregates[i].transformNode;
            const rootPos = this._bones[i].getAbsolutePosition();
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(rootPos, rootMatrix, transform.position);
            // added offset
            this._bones[i].getDirectionToRef(this._boxConfigs[i].boneOffsetAxis, this._rootTransformNode, math_vector/* TmpVectors */.AA.Vector3[0]);
            math_vector/* TmpVectors */.AA.Vector3[0].scaleInPlace(this._boxConfigs[i].boxOffset ?? 0);
            transform.position.addInPlace(math_vector/* TmpVectors */.AA.Vector3[0]);
            this._setBoneOrientationToBody(i);
        }
    }
    _setBoneOrientationToBody(boneIndex) {
        const transform = this._aggregates[boneIndex].transformNode;
        const bone = this._bones[boneIndex];
        this._initialRotation[boneIndex].conjugateToRef(math_vector/* TmpVectors */.AA.Quaternion[0]);
        bone.getRotationQuaternionToRef(1 /* Space.WORLD */, this._rootTransformNode, math_vector/* TmpVectors */.AA.Quaternion[1]);
        math_vector/* TmpVectors */.AA.Quaternion[1].multiplyToRef(math_vector/* TmpVectors */.AA.Quaternion[0], transform.rotationQuaternion);
        transform.rotationQuaternion.normalize();
    }
    _syncBonesAndBoxes() {
        if (this.pauseSync) {
            return;
        }
        if (this._ragdollMode) {
            this._setBodyOrientationToBone(this._rootBoneIndex);
            const rootPos = this._aggregates[this._rootBoneIndex].body.transformNode.position;
            this._rootTransformNode.getWorldMatrix().invertToRef(math_vector/* TmpVectors */.AA.Matrix[0]);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(rootPos, math_vector/* TmpVectors */.AA.Matrix[0], math_vector/* TmpVectors */.AA.Vector3[0]);
            this._bones[this._rootBoneIndex].setAbsolutePosition(math_vector/* TmpVectors */.AA.Vector3[0]);
            for (let i = 0; i < this._bones.length; i++) {
                if (i == this._rootBoneIndex)
                    continue;
                this._setBodyOrientationToBone(i);
            }
        }
        else {
            this._syncBonesToPhysics();
        }
    }
    _setBodyOrientationToBone(boneIndex) {
        const qmesh = this._rootTransformNode.rotationQuaternion ??
            math_vector/* Quaternion */.PT.FromEulerAngles(this._rootTransformNode.rotation.x, this._rootTransformNode.rotation.y, this._rootTransformNode.rotation.z);
        const qbind = this._initialRotation2[boneIndex];
        const qphys = this._aggregates[boneIndex].body?.transformNode?.rotationQuaternion;
        qmesh.multiplyToRef(qbind, math_vector/* TmpVectors */.AA.Quaternion[1]);
        qphys.multiplyToRef(math_vector/* TmpVectors */.AA.Quaternion[1], math_vector/* TmpVectors */.AA.Quaternion[0]);
        this._bones[boneIndex].setRotationQuaternion(math_vector/* TmpVectors */.AA.Quaternion[0], 1 /* Space.WORLD */, this._rootTransformNode);
    }
    // Return true if root bone is valid/exists in this.bonesNames. false otherwise.
    _defineRootBone() {
        const skeletonRoots = this._skeleton.getChildren();
        if (skeletonRoots.length != 1) {
            logger/* Logger */.V.Log("Ragdoll creation failed: there can only be one root in the skeleton.");
            return false;
        }
        this._rootBoneName = skeletonRoots[0].name;
        this._rootBoneIndex = this._boneNames.indexOf(this._rootBoneName);
        if (this._rootBoneIndex == -1) {
            logger/* Logger */.V.Log("Ragdoll creation failed: the array boneNames doesn't have the root bone. The root bone is " + this._skeleton.getChildren());
            return false;
        }
        return true;
    }
    _findNearestParent(boneIndex) {
        let nearestParent = this._bones[boneIndex].getParent();
        do {
            if (nearestParent != null && this._boneNames.includes(nearestParent.name)) {
                break;
            }
            nearestParent = nearestParent?.getParent();
        } while (nearestParent != null);
        return nearestParent;
    }
    _init() {
        this._createColliders();
        // If this.defineRootBone() returns ... there is not root bone.
        if (!this._defineRootBone()) {
            return;
        }
        this._initJoints();
        this._scene.registerBeforeRender(() => {
            this._syncBonesAndBoxes();
        });
        this._syncBonesToPhysics();
    }
    /**
     * Enable ragdoll mode. Create physics objects and make them dynamic.
     */
    ragdoll() {
        this._ragdollMode = true;
        // detach bones with link transform to let physics have control
        this._skeleton.bones.forEach((bone) => {
            bone.linkTransformNode(null);
        });
        for (let i = 0; i < this._joints.length; i++) {
            this._joints[i].isEnabled = true;
        }
        for (let i = 0; i < this._aggregates.length; i++) {
            this._aggregates[i].body.setMotionType(2 /* PhysicsMotionType.DYNAMIC */);
        }
    }
    /**
     * Dispose resources and remove physics objects
     */
    dispose() {
        this._aggregates.forEach((aggregate) => {
            aggregate.dispose();
        });
    }
}
//# sourceMappingURL=ragdoll.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/Plugins/havokPlugin.js










class MeshAccumulator {
    /**
     * Constructor of the mesh accumulator
     * @param mesh - The mesh used to compute the world matrix.
     * @param collectIndices - use mesh indices
     * @param scene - The scene used to determine the right handed system.
     *
     * Merge mesh and its children so whole hierarchy can be used as a mesh shape or convex hull
     */
    constructor(mesh, collectIndices, scene) {
        this._vertices = []; /// Vertices in body space
        this._indices = [];
        this._isRightHanded = scene.useRightHandedSystem;
        this._collectIndices = collectIndices;
    }
    /**
     * Adds a mesh to the physics engine.
     * @param mesh The mesh to add.
     * @param includeChildren Whether to include the children of the mesh.
     *
     * This method adds a mesh to the physics engine by computing the world matrix,
     * multiplying it with the body from world matrix, and then transforming the
     * coordinates of the mesh's vertices. It also adds the indices of the mesh
     * to the physics engine. If includeChildren is true, it will also add the
     * children of the mesh to the physics engine, ignoring any children which
     * have a physics impostor. This is useful for creating a physics engine
     * that accurately reflects the mesh and its children.
     */
    addNodeMeshes(mesh, includeChildren) {
        // Force absoluteScaling to be computed; we're going to use that to bake
        // the scale of any parent nodes into this shape, as physics engines
        // usually use rigid transforms, so can't handle arbitrary scale.
        mesh.computeWorldMatrix(true);
        const rootScaled = math_vector/* TmpVectors */.AA.Matrix[0];
        math_vector/* Matrix */.uq.ScalingToRef(mesh.absoluteScaling.x, mesh.absoluteScaling.y, mesh.absoluteScaling.z, rootScaled);
        if (mesh instanceof Meshes_mesh/* Mesh */.e) {
            this._addMesh(mesh, rootScaled);
        }
        else if (mesh instanceof instancedMesh/* InstancedMesh */.Z) {
            this._addMesh(mesh.sourceMesh, rootScaled);
        }
        if (includeChildren) {
            const worldToRoot = math_vector/* TmpVectors */.AA.Matrix[1];
            mesh.computeWorldMatrix().invertToRef(worldToRoot);
            const worldToRootScaled = math_vector/* TmpVectors */.AA.Matrix[2];
            worldToRoot.multiplyToRef(rootScaled, worldToRootScaled);
            const children = mesh.getChildMeshes(false);
            //  Ignore any children which have a physics body.
            //  Other plugin implementations do not have this check, which appears to be
            //  a bug, as otherwise, the mesh will have a duplicate collider
            children
                .filter((m) => !m.physicsBody)
                .forEach((m) => {
                const childToWorld = m.computeWorldMatrix();
                const childToRootScaled = math_vector/* TmpVectors */.AA.Matrix[3];
                childToWorld.multiplyToRef(worldToRootScaled, childToRootScaled);
                if (m instanceof Meshes_mesh/* Mesh */.e) {
                    this._addMesh(m, childToRootScaled);
                }
                else if (m instanceof instancedMesh/* InstancedMesh */.Z) {
                    this._addMesh(m.sourceMesh, childToRootScaled);
                }
            });
        }
    }
    _addMesh(mesh, meshToRoot) {
        const vertexData = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind) || [];
        const numVerts = vertexData.length / 3;
        const indexOffset = this._vertices.length;
        for (let v = 0; v < numVerts; v++) {
            const pos = new math_vector/* Vector3 */.Pq(vertexData[v * 3 + 0], vertexData[v * 3 + 1], vertexData[v * 3 + 2]);
            this._vertices.push(math_vector/* Vector3 */.Pq.TransformCoordinates(pos, meshToRoot));
        }
        if (this._collectIndices) {
            const meshIndices = mesh.getIndices();
            if (meshIndices) {
                for (let i = 0; i < meshIndices.length; i += 3) {
                    // Havok wants the correct triangle winding to enable the interior triangle optimization
                    if (this._isRightHanded) {
                        this._indices.push(meshIndices[i + 0] + indexOffset);
                        this._indices.push(meshIndices[i + 1] + indexOffset);
                        this._indices.push(meshIndices[i + 2] + indexOffset);
                    }
                    else {
                        this._indices.push(meshIndices[i + 2] + indexOffset);
                        this._indices.push(meshIndices[i + 1] + indexOffset);
                        this._indices.push(meshIndices[i + 0] + indexOffset);
                    }
                }
            }
        }
    }
    /**
     * Allocate and populate the vertex positions inside the physics plugin.
     *
     * @param plugin - The plugin to allocate the memory in.
     * @returns An array of floats, whose backing memory is inside the plugin. The array contains the
     * positions of the mesh vertices, where a position is defined by three floats. You must call
     * freeBuffer() on the returned array once you have finished with it, in order to free the
     * memory inside the plugin..
     */
    getVertices(plugin) {
        const nFloats = this._vertices.length * 3;
        const bytesPerFloat = 4;
        const nBytes = nFloats * bytesPerFloat;
        const bufferBegin = plugin._malloc(nBytes);
        const ret = new Float32Array(plugin.HEAPU8.buffer, bufferBegin, nFloats);
        for (let i = 0; i < this._vertices.length; i++) {
            ret[i * 3 + 0] = this._vertices[i].x;
            ret[i * 3 + 1] = this._vertices[i].y;
            ret[i * 3 + 2] = this._vertices[i].z;
        }
        return { offset: bufferBegin, numObjects: nFloats };
    }
    freeBuffer(plugin, arr) {
        plugin._free(arr.offset);
    }
    /**
     * Allocate and populate the triangle indices inside the physics plugin
     *
     * @param plugin - The plugin to allocate the memory in.
     * @returns A new Int32Array, whose backing memory is inside the plugin. The array contains the indices
     * of the triangle positions, where a single triangle is defined by three indices. You must call
     * freeBuffer() on this array once you have finished with it, to free the memory inside the plugin..
     */
    getTriangles(plugin) {
        const bytesPerInt = 4;
        const nBytes = this._indices.length * bytesPerInt;
        const bufferBegin = plugin._malloc(nBytes);
        const ret = new Int32Array(plugin.HEAPU8.buffer, bufferBegin, this._indices.length);
        for (let i = 0; i < this._indices.length; i++) {
            ret[i] = this._indices[i];
        }
        return { offset: bufferBegin, numObjects: this._indices.length };
    }
}
class BodyPluginData {
    constructor(bodyId) {
        this.hpBodyId = bodyId;
        this.userMassProps = { centerOfMass: undefined, mass: undefined, inertia: undefined, inertiaOrientation: undefined };
    }
}
/*
class ShapePath
{
    public colliderId: number;
    public pathData: number;
}
*/
class CollisionContactPoint {
    constructor() {
        this.bodyId = BigInt(0); //0,2
        //public colliderId: number = 0; //2,4
        //public shapePath: ShapePath = new ShapePath(); //4,8
        this.position = new math_vector/* Vector3 */.Pq(); //8,11
        this.normal = new math_vector/* Vector3 */.Pq(); //11,14
        //public triIdx: number = 0; //14,15
    }
}
class CollisionEvent {
    constructor() {
        this.contactOnA = new CollisionContactPoint(); //1
        this.contactOnB = new CollisionContactPoint();
        this.impulseApplied = 0;
        this.type = 0;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static readToRef(buffer, offset, eventOut) {
        const intBuf = new Int32Array(buffer, offset);
        const floatBuf = new Float32Array(buffer, offset);
        const offA = 2;
        eventOut.contactOnA.bodyId = BigInt(intBuf[offA]); //<todo Need to get the high+low words!
        eventOut.contactOnA.position.set(floatBuf[offA + 8], floatBuf[offA + 9], floatBuf[offA + 10]);
        eventOut.contactOnA.normal.set(floatBuf[offA + 11], floatBuf[offA + 12], floatBuf[offA + 13]);
        const offB = 18;
        eventOut.contactOnB.bodyId = BigInt(intBuf[offB]);
        eventOut.contactOnB.position.set(floatBuf[offB + 8], floatBuf[offB + 9], floatBuf[offB + 10]);
        eventOut.contactOnB.normal.set(floatBuf[offB + 11], floatBuf[offB + 12], floatBuf[offB + 13]);
        eventOut.impulseApplied = floatBuf[offB + 13 + 3];
        eventOut.type = intBuf[0];
    }
}
class TriggerEvent {
    constructor() {
        this.bodyIdA = BigInt(0);
        this.bodyIdB = BigInt(0);
        this.type = 0;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    static readToRef(buffer, offset, eventOut) {
        const intBuf = new Int32Array(buffer, offset);
        eventOut.type = intBuf[0];
        eventOut.bodyIdA = BigInt(intBuf[2]);
        eventOut.bodyIdB = BigInt(intBuf[6]);
    }
}
/**
 * The Havok Physics plugin
 */
class HavokPlugin {
    constructor(_useDeltaForWorldStep = true, hpInjection = HK) {
        this._useDeltaForWorldStep = _useDeltaForWorldStep;
        /**
         * Reference to the WASM library
         */
        this._hknp = {};
        /**
         * Name of the plugin
         */
        this.name = "HavokPlugin";
        this._fixedTimeStep = 1 / 60;
        this._tmpVec3 = (0,arrayTools/* BuildArray */.mI)(3, math_vector/* Vector3 */.Pq.Zero);
        this._bodies = new Map();
        this._shapes = new Map();
        this._bodyCollisionObservable = new Map();
        // Map from constraint id to the pair of bodies, where the first is the parent and the second is the child
        this._constraintToBodyIdPair = new Map();
        this._bodyCollisionEndedObservable = new Map();
        /**
         * Observable for collision started and collision continued events
         */
        this.onCollisionObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable for collision ended events
         */
        this.onCollisionEndedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable for trigger entered and trigger exited events
         */
        this.onTriggerCollisionObservable = new Misc_observable/* Observable */.cP();
        if (typeof hpInjection === "function") {
            logger/* Logger */.V.Error("Havok is not ready. Please make sure you await HK() before using the plugin.");
            return;
        }
        else {
            this._hknp = hpInjection;
        }
        if (!this.isSupported()) {
            logger/* Logger */.V.Error("Havok is not available. Please make sure you included the js file.");
            return;
        }
        this.world = this._hknp.HP_World_Create()[1];
        this._queryCollector = this._hknp.HP_QueryCollector_Create(1)[1];
    }
    /**
     * If this plugin is supported
     * @returns true if its supported
     */
    isSupported() {
        return this._hknp !== undefined;
    }
    /**
     * Sets the gravity of the physics world.
     *
     * @param gravity - The gravity vector to set.
     *
     */
    setGravity(gravity) {
        this._hknp.HP_World_SetGravity(this.world, this._bVecToV3(gravity));
    }
    /**
     * Sets the fixed time step for the physics engine.
     *
     * @param timeStep - The fixed time step to use for the physics engine.
     *
     */
    setTimeStep(timeStep) {
        this._fixedTimeStep = timeStep;
    }
    /**
     * Gets the fixed time step used by the physics engine.
     *
     * @returns The fixed time step used by the physics engine.
     *
     */
    getTimeStep() {
        return this._fixedTimeStep;
    }
    /**
     * Executes a single step of the physics engine.
     *
     * @param delta The time delta in seconds since the last step.
     * @param physicsBodies An array of physics bodies to be simulated.
     *
     * This method is useful for simulating the physics engine. It sets the physics body transformation,
     * steps the world, syncs the physics body, and notifies collisions. This allows for the physics engine
     * to accurately simulate the physics bodies in the world.
     */
    executeStep(delta, physicsBodies) {
        for (const physicsBody of physicsBodies) {
            if (physicsBody.disablePreStep) {
                continue;
            }
            this.setPhysicsBodyTransformation(physicsBody, physicsBody.transformNode);
        }
        const deltaTime = this._useDeltaForWorldStep ? delta : this._fixedTimeStep;
        this._hknp.HP_World_SetIdealStepTime(this.world, deltaTime);
        this._hknp.HP_World_Step(this.world, deltaTime);
        this._bodyBuffer = this._hknp.HP_World_GetBodyBuffer(this.world)[1];
        for (const physicsBody of physicsBodies) {
            if (!physicsBody.disableSync) {
                this.sync(physicsBody);
            }
        }
        this._notifyCollisions();
        this._notifyTriggers();
    }
    /**
     * Returns the version of the physics engine plugin.
     *
     * @returns The version of the physics engine plugin.
     *
     * This method is useful for determining the version of the physics engine plugin that is currently running.
     */
    getPluginVersion() {
        return 2;
    }
    /**
     * Set the maximum allowed linear and angular velocities
     * @param maxLinearVelocity maximum allowed linear velocity
     * @param maxAngularVelocity maximum allowed angular velocity
     */
    setVelocityLimits(maxLinearVelocity, maxAngularVelocity) {
        this._hknp.HP_World_SetSpeedLimit(this.world, maxLinearVelocity, maxAngularVelocity);
    }
    /**
     * @returns maximum allowed linear velocity
     */
    getMaxLinearVelocity() {
        const limits = this._hknp.HP_World_GetSpeedLimit(this.world);
        return limits[1];
    }
    /**
     * @returns maximum allowed angular velocity
     */
    getMaxAngularVelocity() {
        const limits = this._hknp.HP_World_GetSpeedLimit(this.world);
        return limits[2];
    }
    /**
     * Initializes a physics body with the given position and orientation.
     *
     * @param body - The physics body to initialize.
     * @param motionType - The motion type of the body.
     * @param position - The position of the body.
     * @param orientation - The orientation of the body.
     * This code is useful for initializing a physics body with the given position and orientation.
     * It creates a plugin data for the body and adds it to the world. It then converts the position
     * and orientation to a transform and sets the body's transform to the given values.
     */
    initBody(body, motionType, position, orientation) {
        body._pluginData = new BodyPluginData(this._hknp.HP_Body_Create()[1]);
        this._internalSetMotionType(body._pluginData, motionType);
        const transform = [this._bVecToV3(position), this._bQuatToV4(orientation)]; //<todo temp transform?
        this._hknp.HP_Body_SetQTransform(body._pluginData.hpBodyId, transform);
        this._hknp.HP_World_AddBody(this.world, body._pluginData.hpBodyId, body.startAsleep);
        this._bodies.set(body._pluginData.hpBodyId[0], { body: body, index: 0 });
    }
    /**
     * Removes a body from the world. To dispose of a body, it is necessary to remove it from the world first.
     *
     * @param body - The body to remove.
     */
    removeBody(body) {
        if (body._pluginDataInstances && body._pluginDataInstances.length > 0) {
            for (const instance of body._pluginDataInstances) {
                this._bodyCollisionObservable.delete(instance.hpBodyId[0]);
                this._hknp.HP_World_RemoveBody(this.world, instance.hpBodyId);
                this._bodies.delete(instance.hpBodyId[0]);
            }
        }
        if (body._pluginData) {
            this._bodyCollisionObservable.delete(body._pluginData.hpBodyId[0]);
            this._hknp.HP_World_RemoveBody(this.world, body._pluginData.hpBodyId);
            this._bodies.delete(body._pluginData.hpBodyId[0]);
        }
    }
    /**
     * Initializes the body instances for a given physics body and mesh.
     *
     * @param body - The physics body to initialize.
     * @param motionType - How the body will be handled by the engine
     * @param mesh - The mesh to initialize.
     *
     * This code is useful for creating a physics body from a mesh. It creates a
     * body instance for each instance of the mesh and adds it to the world. It also
     * sets the position of the body instance to the position of the mesh instance.
     * This allows for the physics engine to accurately simulate the mesh in the
     * world.
     */
    initBodyInstances(body, motionType, mesh) {
        const instancesCount = mesh._thinInstanceDataStorage?.instancesCount ?? 0;
        const matrixData = mesh._thinInstanceDataStorage.matrixData;
        if (!matrixData) {
            return; // TODO: error handling
        }
        this._createOrUpdateBodyInstances(body, motionType, matrixData, 0, instancesCount, false);
        body._pluginDataInstances.forEach((bodyId, index) => {
            this._bodies.set(bodyId.hpBodyId[0], { body: body, index: index });
        });
    }
    _createOrUpdateBodyInstances(body, motionType, matrixData, startIndex, endIndex, update) {
        const rotation = math_vector/* TmpVectors */.AA.Quaternion[0];
        const rotationMatrix = math_vector/* Matrix */.uq.Identity();
        for (let i = startIndex; i < endIndex; i++) {
            const position = [matrixData[i * 16 + 12], matrixData[i * 16 + 13], matrixData[i * 16 + 14]];
            let hkbody;
            if (!update) {
                hkbody = this._hknp.HP_Body_Create()[1];
            }
            else {
                hkbody = body._pluginDataInstances[i].hpBodyId;
            }
            rotationMatrix.setRowFromFloats(0, matrixData[i * 16 + 0], matrixData[i * 16 + 1], matrixData[i * 16 + 2], 0);
            rotationMatrix.setRowFromFloats(1, matrixData[i * 16 + 4], matrixData[i * 16 + 5], matrixData[i * 16 + 6], 0);
            rotationMatrix.setRowFromFloats(2, matrixData[i * 16 + 8], matrixData[i * 16 + 9], matrixData[i * 16 + 10], 0);
            math_vector/* Quaternion */.PT.FromRotationMatrixToRef(rotationMatrix, rotation);
            const transform = [position, [rotation.x, rotation.y, rotation.z, rotation.w]];
            this._hknp.HP_Body_SetQTransform(hkbody, transform);
            if (!update) {
                const pluginData = new BodyPluginData(hkbody);
                if (body._pluginDataInstances.length) {
                    // If an instance already exists, copy any user-provided mass properties
                    pluginData.userMassProps = body._pluginDataInstances[0].userMassProps;
                }
                this._internalSetMotionType(pluginData, motionType);
                this._internalUpdateMassProperties(pluginData);
                body._pluginDataInstances.push(pluginData);
                this._hknp.HP_World_AddBody(this.world, hkbody, body.startAsleep);
                pluginData.worldTransformOffset = this._hknp.HP_Body_GetWorldTransformOffset(hkbody)[1];
            }
        }
    }
    /**
     * Update the internal body instances for a given physics body to match the instances in a mesh.
     * @param body the body that will be updated
     * @param mesh the mesh with reference instances
     */
    updateBodyInstances(body, mesh) {
        const instancesCount = mesh._thinInstanceDataStorage?.instancesCount ?? 0;
        const matrixData = mesh._thinInstanceDataStorage.matrixData;
        if (!matrixData) {
            return; // TODO: error handling
        }
        const pluginInstancesCount = body._pluginDataInstances.length;
        const motionType = this.getMotionType(body);
        if (instancesCount > pluginInstancesCount) {
            this._createOrUpdateBodyInstances(body, motionType, matrixData, pluginInstancesCount, instancesCount, false);
            const firstBodyShape = this._hknp.HP_Body_GetShape(body._pluginDataInstances[0].hpBodyId)[1];
            // firstBodyShape[0] might be 0 in the case where thin instances data is set (with thinInstancesSetBuffer call) after body creation
            // in that case, use the shape provided at body creation.
            if (!firstBodyShape[0]) {
                firstBodyShape[0] = body.shape?._pluginData[0];
            }
            for (let i = pluginInstancesCount; i < instancesCount; i++) {
                this._hknp.HP_Body_SetShape(body._pluginDataInstances[i].hpBodyId, firstBodyShape);
                this._internalUpdateMassProperties(body._pluginDataInstances[i]);
                this._bodies.set(body._pluginDataInstances[i].hpBodyId[0], { body: body, index: i });
            }
        }
        else if (instancesCount < pluginInstancesCount) {
            const instancesToRemove = pluginInstancesCount - instancesCount;
            for (let i = 0; i < instancesToRemove; i++) {
                const hkbody = body._pluginDataInstances.pop();
                this._bodies.delete(hkbody.hpBodyId[0]);
                this._hknp.HP_World_RemoveBody(this.world, hkbody.hpBodyId);
                this._hknp.HP_Body_Release(hkbody.hpBodyId);
            }
            this._createOrUpdateBodyInstances(body, motionType, matrixData, 0, instancesCount, true);
        }
    }
    /**
     * Synchronizes the transform of a physics body with its transform node.
     * @param body - The physics body to synchronize.
     *
     * This function is useful for keeping the physics body's transform in sync with its transform node.
     * This is important for ensuring that the physics body is accurately represented in the physics engine.
     */
    sync(body) {
        this.syncTransform(body, body.transformNode);
    }
    /**
     * Synchronizes the transform of a physics body with the transform of its
     * corresponding transform node.
     *
     * @param body - The physics body to synchronize.
     * @param transformNode - The destination Transform Node.
     *
     * This code is useful for synchronizing the position and orientation of a
     * physics body with the position and orientation of its corresponding
     * transform node. This is important for ensuring that the physics body and
     * the transform node are in the same position and orientation in the scene.
     * This is necessary for the physics engine to accurately simulate the
     * physical behavior of the body.
     */
    syncTransform(body, transformNode) {
        if (body._pluginDataInstances.length) {
            // instances
            const m = transformNode;
            const matrixData = m._thinInstanceDataStorage.matrixData;
            if (!matrixData) {
                return; // TODO: error handling
            }
            const instancesCount = body._pluginDataInstances.length;
            for (let i = 0; i < instancesCount; i++) {
                const bufOffset = body._pluginDataInstances[i].worldTransformOffset;
                const transformBuffer = new Float32Array(this._hknp.HEAPU8.buffer, this._bodyBuffer + bufOffset, 16);
                const index = i * 16;
                for (let mi = 0; mi < 15; mi++) {
                    if ((mi & 3) != 3) {
                        matrixData[index + mi] = transformBuffer[mi];
                    }
                }
                matrixData[index + 15] = 1;
            }
            m.thinInstanceBufferUpdated("matrix");
        }
        else {
            try {
                // regular
                const bodyTransform = this._hknp.HP_Body_GetQTransform(body._pluginData.hpBodyId)[1];
                const bodyTranslation = bodyTransform[0];
                const bodyOrientation = bodyTransform[1];
                const quat = math_vector/* TmpVectors */.AA.Quaternion[0];
                quat.set(bodyOrientation[0], bodyOrientation[1], bodyOrientation[2], bodyOrientation[3]);
                const parent = transformNode.parent;
                // transform position/orientation in parent space
                if (parent && !parent.getWorldMatrix().isIdentity()) {
                    parent.computeWorldMatrix(true);
                    // Save scaling for future use
                    math_vector/* TmpVectors */.AA.Vector3[1].copyFrom(transformNode.scaling);
                    quat.normalize();
                    const finalTransform = math_vector/* TmpVectors */.AA.Matrix[0];
                    const finalTranslation = math_vector/* TmpVectors */.AA.Vector3[0];
                    finalTranslation.copyFromFloats(bodyTranslation[0], bodyTranslation[1], bodyTranslation[2]);
                    math_vector/* Matrix */.uq.ComposeToRef(transformNode.absoluteScaling, quat, finalTranslation, finalTransform);
                    const parentInverseTransform = math_vector/* TmpVectors */.AA.Matrix[1];
                    parent.getWorldMatrix().invertToRef(parentInverseTransform);
                    const localTransform = math_vector/* TmpVectors */.AA.Matrix[2];
                    finalTransform.multiplyToRef(parentInverseTransform, localTransform);
                    localTransform.decomposeToTransformNode(transformNode);
                    transformNode.rotationQuaternion?.normalize();
                    // Keep original scaling. Re-injecting scaling can introduce discontinuity between frames. Basically, it grows or shrinks.
                    transformNode.scaling.copyFrom(math_vector/* TmpVectors */.AA.Vector3[1]);
                }
                else {
                    transformNode.position.set(bodyTranslation[0], bodyTranslation[1], bodyTranslation[2]);
                    if (transformNode.rotationQuaternion) {
                        transformNode.rotationQuaternion.copyFrom(quat);
                    }
                    else {
                        quat.toEulerAnglesToRef(transformNode.rotation);
                    }
                }
            }
            catch (e) {
                logger/* Logger */.V.Error(`Syncing transform failed for node ${transformNode.name}: ${e.message}...`);
            }
        }
    }
    /**
     * Sets the shape of a physics body.
     * @param body - The physics body to set the shape for.
     * @param shape - The physics shape to set.
     *
     * This function is used to set the shape of a physics body. It is useful for
     * creating a physics body with a specific shape, such as a box or a sphere,
     * which can then be used to simulate physical interactions in a physics engine.
     * This function is especially useful for meshes with multiple instances, as it
     * will set the shape for each instance of the mesh.
     */
    setShape(body, shape) {
        const shapeHandle = shape && shape._pluginData ? shape._pluginData : BigInt(0);
        if (!(body.transformNode instanceof Meshes_mesh/* Mesh */.e) || !body.transformNode._thinInstanceDataStorage?.matrixData) {
            this._hknp.HP_Body_SetShape(body._pluginData.hpBodyId, shapeHandle);
            this._internalUpdateMassProperties(body._pluginData);
            return;
        }
        const m = body.transformNode;
        const instancesCount = m._thinInstanceDataStorage?.instancesCount ?? 0;
        for (let i = 0; i < instancesCount; i++) {
            this._hknp.HP_Body_SetShape(body._pluginDataInstances[i].hpBodyId, shapeHandle);
            this._internalUpdateMassProperties(body._pluginDataInstances[i]);
        }
    }
    /**
     * Returns a reference to the first instance of the plugin data for a physics body.
     * @param body
     * @param instanceIndex
     * @returns a reference to the first instance
     */
    _getPluginReference(body, instanceIndex) {
        return body._pluginDataInstances?.length ? body._pluginDataInstances[instanceIndex ?? 0] : body._pluginData;
    }
    /**
     * Gets the shape of a physics body. This will create a new shape object
     *
     * @param body - The physics body.
     * @returns The shape of the physics body.
     *
     */
    getShape(body) {
        const pluginRef = this._getPluginReference(body);
        const shapePluginData = this._hknp.HP_Body_GetShape(pluginRef.hpBodyId)[1];
        if (shapePluginData != 0) {
            const scene = body.transformNode.getScene();
            return new PhysicsShape({ pluginData: shapePluginData }, scene);
        }
        return null;
    }
    /**
     * Gets the type of a physics shape.
     * @param shape - The physics shape to get the type for.
     * @returns The type of the physics shape.
     *
     */
    getShapeType(shape) {
        if (shape.type) {
            return shape.type;
        }
        else {
            //<todo This returns a native type!
            return this._hknp.HP_Shape_GetType(shape._pluginData);
        }
    }
    /**
     * Sets the event mask of a physics body.
     * @param body - The physics body to set the event mask for.
     * @param eventMask - The event mask to set.
     * @param instanceIndex - The index of the instance to set the event mask for
     *
     * This function is useful for setting the event mask of a physics body, which is used to determine which events the body will respond to. This is important for ensuring that the physics engine is able to accurately simulate the behavior of the body in the game world.
     */
    setEventMask(body, eventMask, instanceIndex) {
        this._applyToBodyOrInstances(body, (bodyPluginData) => {
            this._hknp.HP_Body_SetEventMask(bodyPluginData.hpBodyId, eventMask);
        }, instanceIndex);
    }
    /**
     * Retrieves the event mask of a physics body.
     *
     * @param body - The physics body to retrieve the event mask from.
     * @param instanceIndex - The index of the instance to retrieve the event mask from.
     * @returns The event mask of the physics body.
     *
     */
    getEventMask(body, instanceIndex) {
        const pluginRef = this._getPluginReference(body, instanceIndex);
        return this._hknp.HP_Body_GetEventMask(pluginRef.hpBodyId)[1];
    }
    _fromMassPropertiesTuple(massPropsTuple) {
        return {
            centerOfMass: math_vector/* Vector3 */.Pq.FromArray(massPropsTuple[0]),
            mass: massPropsTuple[1],
            inertia: math_vector/* Vector3 */.Pq.FromArray(massPropsTuple[2]),
            inertiaOrientation: math_vector/* Quaternion */.PT.FromArray(massPropsTuple[3]),
        };
    }
    _internalUpdateMassProperties(pluginData) {
        // Recompute the mass based on the shape
        const newProps = this._internalComputeMassProperties(pluginData);
        const massProps = pluginData.userMassProps;
        // Override the computed values with any the user has set
        if (massProps.centerOfMass) {
            newProps[0] = massProps.centerOfMass.asArray();
        }
        if (massProps.mass != undefined) {
            newProps[1] = massProps.mass;
        }
        if (massProps.inertia) {
            newProps[2] = massProps.inertia.asArray();
        }
        if (massProps.inertiaOrientation) {
            newProps[3] = massProps.inertiaOrientation.asArray();
        }
        this._hknp.HP_Body_SetMassProperties(pluginData.hpBodyId, newProps);
    }
    _internalSetMotionType(pluginData, motionType) {
        switch (motionType) {
            case 0 /* PhysicsMotionType.STATIC */:
                this._hknp.HP_Body_SetMotionType(pluginData.hpBodyId, this._hknp.MotionType.STATIC);
                break;
            case 1 /* PhysicsMotionType.ANIMATED */:
                this._hknp.HP_Body_SetMotionType(pluginData.hpBodyId, this._hknp.MotionType.KINEMATIC);
                break;
            case 2 /* PhysicsMotionType.DYNAMIC */:
                this._hknp.HP_Body_SetMotionType(pluginData.hpBodyId, this._hknp.MotionType.DYNAMIC);
                break;
        }
    }
    /**
     * sets the motion type of a physics body.
     * @param body - The physics body to set the motion type for.
     * @param motionType - The motion type to set.
     * @param instanceIndex - The index of the instance to set the motion type for. If undefined, the motion type of all the bodies will be set.
     */
    setMotionType(body, motionType, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginData) => {
            this._internalSetMotionType(pluginData, motionType);
        }, instanceIndex);
    }
    /**
     * Gets the motion type of a physics body.
     * @param body - The physics body to get the motion type from.
     * @param instanceIndex - The index of the instance to get the motion type from. If not specified, the motion type of the first instance will be returned.
     * @returns The motion type of the physics body.
     */
    getMotionType(body, instanceIndex) {
        const pluginRef = this._getPluginReference(body, instanceIndex);
        const type = this._hknp.HP_Body_GetMotionType(pluginRef.hpBodyId)[1];
        switch (type) {
            case this._hknp.MotionType.STATIC:
                return 0 /* PhysicsMotionType.STATIC */;
            case this._hknp.MotionType.KINEMATIC:
                return 1 /* PhysicsMotionType.ANIMATED */;
            case this._hknp.MotionType.DYNAMIC:
                return 2 /* PhysicsMotionType.DYNAMIC */;
        }
        throw new Error("Unknown motion type: " + type);
    }
    /**
     * sets the activation control mode of a physics body, for instance if you need the body to never sleep.
     * @param body - The physics body to set the activation control mode.
     * @param controlMode - The activation control mode.
     */
    setActivationControl(body, controlMode) {
        switch (controlMode) {
            case 1 /* PhysicsActivationControl.ALWAYS_ACTIVE */:
                this._hknp.HP_Body_SetActivationControl(body._pluginData.hpBodyId, this._hknp.ActivationControl.ALWAYS_ACTIVE);
                break;
            case 2 /* PhysicsActivationControl.ALWAYS_INACTIVE */:
                this._hknp.HP_Body_SetActivationControl(body._pluginData.hpBodyId, this._hknp.ActivationControl.ALWAYS_INACTIVE);
                break;
            case 0 /* PhysicsActivationControl.SIMULATION_CONTROLLED */:
                this._hknp.HP_Body_SetActivationControl(body._pluginData.hpBodyId, this._hknp.ActivationControl.SIMULATION_CONTROLLED);
                break;
        }
    }
    _internalComputeMassProperties(pluginData) {
        const shapeRes = this._hknp.HP_Body_GetShape(pluginData.hpBodyId);
        if (shapeRes[0] == this._hknp.Result.RESULT_OK) {
            const shapeMass = this._hknp.HP_Shape_BuildMassProperties(shapeRes[1]);
            if (shapeMass[0] == this._hknp.Result.RESULT_OK) {
                return shapeMass[1];
            }
        }
        // Failed; return a unit inertia
        return [[0, 0, 0], 1, [1, 1, 1], [0, 0, 0, 1]];
    }
    /**
     * Computes the mass properties of a physics body, from it's shape
     *
     * @param body - The physics body to copmute the mass properties of
     * @param instanceIndex - The index of the instance to compute the mass properties of.
     * @returns The mass properties of the physics body.
     */
    computeMassProperties(body, instanceIndex) {
        const pluginRef = this._getPluginReference(body, instanceIndex);
        const computed = this._internalComputeMassProperties(pluginRef);
        return this._fromMassPropertiesTuple(computed);
    }
    /**
     * Sets the mass properties of a physics body.
     *
     * @param body - The physics body to set the mass properties of.
     * @param massProps - The mass properties to set.
     * @param instanceIndex - The index of the instance to set the mass properties of. If undefined, the mass properties of all the bodies will be set.
     * This function is useful for setting the mass properties of a physics body,
     * such as its mass, inertia, and center of mass. This is important for
     * accurately simulating the physics of the body in the physics engine.
     *
     */
    setMassProperties(body, massProps, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginData) => {
            pluginData.userMassProps = massProps;
            this._internalUpdateMassProperties(pluginData);
        }, instanceIndex);
    }
    /**
     * Gets the mass properties of a physics body.
     * @param body - The physics body to get the mass properties from.
     * @param instanceIndex - The index of the instance to get the mass properties from. If not specified, the mass properties of the first instance will be returned.
     * @returns The mass properties of the physics body.
     */
    getMassProperties(body, instanceIndex) {
        const pluginRef = this._getPluginReference(body, instanceIndex);
        const massPropsTuple = this._hknp.HP_Body_GetMassProperties(pluginRef.hpBodyId)[1];
        return this._fromMassPropertiesTuple(massPropsTuple);
    }
    /**
     * Sets the linear damping of the given body.
     * @param body - The body to set the linear damping for.
     * @param damping - The linear damping to set.
     * @param instanceIndex - The index of the instance to set the linear damping for. If not specified, the linear damping of the first instance will be set.
     *
     * This method is useful for controlling the linear damping of a body in a physics engine.
     * Linear damping is a force that opposes the motion of the body, and is proportional to the velocity of the body.
     * This method allows the user to set the linear damping of a body, which can be used to control the motion of the body.
     */
    setLinearDamping(body, damping, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginData) => {
            this._hknp.HP_Body_SetLinearDamping(pluginData.hpBodyId, damping);
        }, instanceIndex);
    }
    /**
     * Gets the linear damping of the given body.
     * @param body - The body to get the linear damping from.
     * @param instanceIndex - The index of the instance to get the linear damping from. If not specified, the linear damping of the first instance will be returned.
     * @returns The linear damping of the given body.
     *
     * This method is useful for getting the linear damping of a body in a physics engine.
     * Linear damping is a force that opposes the motion of the body and is proportional to the velocity of the body.
     * It is used to simulate the effects of air resistance and other forms of friction.
     */
    getLinearDamping(body, instanceIndex) {
        const pluginRef = this._getPluginReference(body, instanceIndex);
        return this._hknp.HP_Body_GetLinearDamping(pluginRef.hpBodyId)[1];
    }
    /**
     * Sets the angular damping of a physics body.
     * @param body - The physics body to set the angular damping for.
     * @param damping - The angular damping value to set.
     * @param instanceIndex - The index of the instance to set the angular damping for. If not specified, the angular damping of the first instance will be set.
     *
     * This function is useful for controlling the angular velocity of a physics body.
     * By setting the angular damping, the body's angular velocity will be reduced over time, allowing for more realistic physics simulations.
     */
    setAngularDamping(body, damping, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginData) => {
            this._hknp.HP_Body_SetAngularDamping(pluginData.hpBodyId, damping);
        }, instanceIndex);
    }
    /**
     * Gets the angular damping of a physics body.
     * @param body - The physics body to get the angular damping from.
     * @param instanceIndex - The index of the instance to get the angular damping from. If not specified, the angular damping of the first instance will be returned.
     * @returns The angular damping of the body.
     *
     * This function is useful for retrieving the angular damping of a physics body,
     * which is used to control the rotational motion of the body. The angular damping is a value between 0 and 1, where 0 is no damping and 1 is full damping.
     */
    getAngularDamping(body, instanceIndex) {
        const pluginRef = this._getPluginReference(body, instanceIndex);
        return this._hknp.HP_Body_GetAngularDamping(pluginRef.hpBodyId)[1];
    }
    /**
     * Sets the linear velocity of a physics body.
     * @param body - The physics body to set the linear velocity of.
     * @param linVel - The linear velocity to set.
     * @param instanceIndex - The index of the instance to set the linear velocity of. If not specified, the linear velocity of the first instance will be set.
     *
     * This function is useful for setting the linear velocity of a physics body, which is necessary for simulating
     * motion in a physics engine. The linear velocity is the speed and direction of the body's movement.
     */
    setLinearVelocity(body, linVel, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginData) => {
            this._hknp.HP_Body_SetLinearVelocity(pluginData.hpBodyId, this._bVecToV3(linVel));
        }, instanceIndex);
    }
    /**
     * Gets the linear velocity of a physics body and stores it in a given vector.
     * @param body - The physics body to get the linear velocity from.
     * @param linVel - The vector to store the linear velocity in.
     * @param instanceIndex - The index of the instance to get the linear velocity from. If not specified, the linear velocity of the first instance will be returned.
     *
     * This function is useful for retrieving the linear velocity of a physics body,
     * which can be used to determine the speed and direction of the body. This
     * information can be used to simulate realistic physics behavior in a game.
     */
    getLinearVelocityToRef(body, linVel, instanceIndex) {
        const pluginRef = this._getPluginReference(body, instanceIndex);
        const lv = this._hknp.HP_Body_GetLinearVelocity(pluginRef.hpBodyId)[1];
        this._v3ToBvecRef(lv, linVel);
    }
    /*
     * Apply an operation either to all instances of a body, if instanceIndex is not specified, or to a specific instance.
     */
    _applyToBodyOrInstances(body, fnToApply, instanceIndex) {
        if (body._pluginDataInstances?.length > 0 && instanceIndex === undefined) {
            for (let i = 0; i < body._pluginDataInstances.length; i++) {
                fnToApply(body._pluginDataInstances[i]);
            }
        }
        else {
            fnToApply(this._getPluginReference(body, instanceIndex));
        }
    }
    /**
     * Applies an impulse to a physics body at a given location.
     * @param body - The physics body to apply the impulse to.
     * @param impulse - The impulse vector to apply.
     * @param location - The location in world space to apply the impulse.
     * @param instanceIndex - The index of the instance to apply the impulse to. If not specified, the impulse will be applied to all instances.
     *
     * This method is useful for applying an impulse to a physics body at a given location.
     * This can be used to simulate physical forces such as explosions, collisions, and gravity.
     */
    applyImpulse(body, impulse, location, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginRef) => {
            this._hknp.HP_Body_ApplyImpulse(pluginRef.hpBodyId, this._bVecToV3(location), this._bVecToV3(impulse));
        }, instanceIndex);
    }
    /**
     * Applies an angular impulse(torque) to a physics body
     * @param body - The physics body to apply the impulse to.
     * @param angularImpulse - The torque value
     * @param instanceIndex - The index of the instance to apply the impulse to. If not specified, the impulse will be applied to all instances.
     */
    applyAngularImpulse(body, angularImpulse, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginRef) => {
            this._hknp.HP_Body_ApplyAngularImpulse(pluginRef.hpBodyId, this._bVecToV3(angularImpulse));
        }, instanceIndex);
    }
    /**
     * Applies a force to a physics body at a given location.
     * @param body - The physics body to apply the impulse to.
     * @param force - The force vector to apply.
     * @param location - The location in world space to apply the impulse.
     * @param instanceIndex - The index of the instance to apply the force to. If not specified, the force will be applied to all instances.
     *
     * This method is useful for applying a force to a physics body at a given location.
     * This can be used to simulate physical forces such as explosions, collisions, and gravity.
     */
    applyForce(body, force, location, instanceIndex) {
        force.scaleToRef(this.getTimeStep(), this._tmpVec3[0]);
        this.applyImpulse(body, this._tmpVec3[0], location, instanceIndex);
    }
    /**
     * Sets the angular velocity of a physics body.
     *
     * @param body - The physics body to set the angular velocity of.
     * @param angVel - The angular velocity to set.
     * @param instanceIndex - The index of the instance to set the angular velocity of. If not specified, the angular velocity of the first instance will be set.
     *
     * This function is useful for setting the angular velocity of a physics body in a physics engine.
     * This allows for more realistic simulations of physical objects, as they can be given a rotational velocity.
     */
    setAngularVelocity(body, angVel, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginRef) => {
            this._hknp.HP_Body_SetAngularVelocity(pluginRef.hpBodyId, this._bVecToV3(angVel));
        }, instanceIndex);
    }
    /**
     * Gets the angular velocity of a body.
     * @param body - The body to get the angular velocity from.
     * @param angVel - The vector3 to store the angular velocity.
     * @param instanceIndex - The index of the instance to get the angular velocity from. If not specified, the angular velocity of the first instance will be returned.
     *
     * This method is useful for getting the angular velocity of a body in a physics engine. It
     * takes the body and a vector3 as parameters and stores the angular velocity of the body
     * in the vector3. This is useful for getting the angular velocity of a body in order to
     * calculate the motion of the body in the physics engine.
     */
    getAngularVelocityToRef(body, angVel, instanceIndex) {
        const pluginRef = this._getPluginReference(body, instanceIndex);
        const av = this._hknp.HP_Body_GetAngularVelocity(pluginRef.hpBodyId)[1];
        this._v3ToBvecRef(av, angVel);
    }
    /**
     * Sets the transformation of the given physics body to the given transform node.
     * @param body The physics body to set the transformation for.
     * @param node The transform node to set the transformation from.
     * Sets the transformation of the given physics body to the given transform node.
     *
     * This function is useful for setting the transformation of a physics body to a
     * transform node, which is necessary for the physics engine to accurately simulate
     * the motion of the body. It also takes into account instances of the transform
     * node, which is necessary for accurate simulation of multiple bodies with the
     * same transformation.
     */
    setPhysicsBodyTransformation(body, node) {
        if (body.getPrestepType() == PhysicsPrestepType.TELEPORT) {
            const transformNode = body.transformNode;
            if (body.numInstances > 0) {
                // instances
                const m = transformNode;
                const matrixData = m._thinInstanceDataStorage.matrixData;
                if (!matrixData) {
                    return; // TODO: error handling
                }
                const instancesCount = body.numInstances;
                this._createOrUpdateBodyInstances(body, body.getMotionType(), matrixData, 0, instancesCount, true);
            }
            else {
                // regular
                this._hknp.HP_Body_SetQTransform(body._pluginData.hpBodyId, this._getTransformInfos(node));
            }
        }
        else if (body.getPrestepType() == PhysicsPrestepType.ACTION) {
            this.setTargetTransform(body, node.absolutePosition, node.absoluteRotationQuaternion);
        }
        else if (body.getPrestepType() == PhysicsPrestepType.DISABLED) {
            logger/* Logger */.V.Warn("Prestep type is set to DISABLED. Unable to set physics body transformation.");
        }
        else {
            logger/* Logger */.V.Warn("Invalid prestep type set to physics body.");
        }
    }
    /**
     * Set the target transformation (position and rotation) of the body, such that the body will set its velocity to reach that target
     * @param body The physics body to set the target transformation for.
     * @param position The target position
     * @param rotation The target rotation
     * @param instanceIndex The index of the instance in an instanced body
     */
    setTargetTransform(body, position, rotation, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginRef) => {
            this._hknp.HP_Body_SetTargetQTransform(pluginRef.hpBodyId, [this._bVecToV3(position), this._bQuatToV4(rotation)]);
        }, instanceIndex);
    }
    /**
     * Sets the gravity factor of a body
     * @param body the physics body to set the gravity factor for
     * @param factor the gravity factor
     * @param instanceIndex the index of the instance in an instanced body
     */
    setGravityFactor(body, factor, instanceIndex) {
        this._applyToBodyOrInstances(body, (pluginRef) => {
            this._hknp.HP_Body_SetGravityFactor(pluginRef.hpBodyId, factor);
        }, instanceIndex);
    }
    /**
     * Get the gravity factor of a body
     * @param body the physics body to get the gravity factor from
     * @param instanceIndex the index of the instance in an instanced body. If not specified, the gravity factor of the first instance will be returned.
     * @returns the gravity factor
     */
    getGravityFactor(body, instanceIndex) {
        const pluginRef = this._getPluginReference(body, instanceIndex);
        return this._hknp.HP_Body_GetGravityFactor(pluginRef.hpBodyId)[1];
    }
    /**
     * Disposes a physics body.
     *
     * @param body - The physics body to dispose.
     *
     * This method is useful for releasing the resources associated with a physics body when it is no longer needed.
     * This is important for avoiding memory leaks in the physics engine.
     */
    disposeBody(body) {
        if (body._pluginDataInstances && body._pluginDataInstances.length > 0) {
            for (const instance of body._pluginDataInstances) {
                this._hknp.HP_Body_Release(instance.hpBodyId);
                instance.hpBodyId = undefined;
            }
        }
        if (body._pluginData) {
            this._hknp.HP_Body_Release(body._pluginData.hpBodyId);
            body._pluginData.hpBodyId = undefined;
        }
    }
    _createOptionsFromGroundMesh(options) {
        const mesh = options.groundMesh;
        if (!mesh) {
            return;
        }
        let pos = mesh.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const transform = mesh.computeWorldMatrix(true);
        // convert rawVerts to object space
        const transformedVertices = [];
        let index;
        for (index = 0; index < pos.length; index += 3) {
            math_vector/* Vector3 */.Pq.FromArrayToRef(pos, index, math_vector/* TmpVectors */.AA.Vector3[0]);
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(math_vector/* TmpVectors */.AA.Vector3[0], transform, math_vector/* TmpVectors */.AA.Vector3[1]);
            math_vector/* TmpVectors */.AA.Vector3[1].toArray(transformedVertices, index);
        }
        pos = transformedVertices;
        const arraySize = ~~(Math.sqrt(pos.length / 3) - 1);
        const boundingInfo = mesh.getBoundingInfo();
        const dim = Math.min(boundingInfo.boundingBox.extendSizeWorld.x, boundingInfo.boundingBox.extendSizeWorld.z);
        const minX = boundingInfo.boundingBox.minimumWorld.x;
        const minY = boundingInfo.boundingBox.minimumWorld.y;
        const minZ = boundingInfo.boundingBox.minimumWorld.z;
        const matrix = new Float32Array((arraySize + 1) * (arraySize + 1));
        const elementSize = (dim * 2) / arraySize;
        for (let i = 0; i < matrix.length; i++) {
            matrix[i] = minY;
        }
        for (let i = 0; i < pos.length; i = i + 3) {
            const x = Math.round((pos[i + 0] - minX) / elementSize);
            const z = arraySize - Math.round((pos[i + 2] - minZ) / elementSize);
            const y = pos[i + 1] - minY;
            matrix[z * (arraySize + 1) + x] = y;
        }
        options.numHeightFieldSamplesX = arraySize + 1;
        options.numHeightFieldSamplesZ = arraySize + 1;
        options.heightFieldSizeX = boundingInfo.boundingBox.extendSizeWorld.x * 2;
        options.heightFieldSizeZ = boundingInfo.boundingBox.extendSizeWorld.z * 2;
        options.heightFieldData = matrix;
    }
    /**
     * Initializes a physics shape with the given type and parameters.
     * @param shape - The physics shape to initialize.
     * @param type - The type of shape to initialize.
     * @param options - The parameters for the shape.
     *
     * This code is useful for initializing a physics shape with the given type and parameters.
     * It allows for the creation of a sphere, box, capsule, container, cylinder, mesh, and heightfield.
     * Depending on the type of shape, different parameters are required.
     * For example, a sphere requires a radius, while a box requires extents and a rotation.
     */
    initShape(shape, type, options) {
        switch (type) {
            case 0 /* PhysicsShapeType.SPHERE */:
                {
                    const radius = options.radius || 1;
                    const center = options.center ? this._bVecToV3(options.center) : [0, 0, 0];
                    shape._pluginData = this._hknp.HP_Shape_CreateSphere(center, radius)[1];
                }
                break;
            case 3 /* PhysicsShapeType.BOX */:
                {
                    const rotation = options.rotation ? this._bQuatToV4(options.rotation) : [0, 0, 0, 1];
                    const extent = options.extents ? this._bVecToV3(options.extents) : [1, 1, 1];
                    const center = options.center ? this._bVecToV3(options.center) : [0, 0, 0];
                    shape._pluginData = this._hknp.HP_Shape_CreateBox(center, rotation, extent)[1];
                }
                break;
            case 1 /* PhysicsShapeType.CAPSULE */:
                {
                    const pointA = options.pointA ? this._bVecToV3(options.pointA) : [0, 0, 0];
                    const pointB = options.pointB ? this._bVecToV3(options.pointB) : [0, 1, 0];
                    const radius = options.radius || 0;
                    shape._pluginData = this._hknp.HP_Shape_CreateCapsule(pointA, pointB, radius)[1];
                }
                break;
            case 5 /* PhysicsShapeType.CONTAINER */:
                {
                    shape._pluginData = this._hknp.HP_Shape_CreateContainer()[1];
                }
                break;
            case 2 /* PhysicsShapeType.CYLINDER */:
                {
                    const pointA = options.pointA ? this._bVecToV3(options.pointA) : [0, 0, 0];
                    const pointB = options.pointB ? this._bVecToV3(options.pointB) : [0, 1, 0];
                    const radius = options.radius || 0;
                    shape._pluginData = this._hknp.HP_Shape_CreateCylinder(pointA, pointB, radius)[1];
                }
                break;
            case 4 /* PhysicsShapeType.CONVEX_HULL */:
            case 6 /* PhysicsShapeType.MESH */:
                {
                    const mesh = options.mesh;
                    if (mesh) {
                        const includeChildMeshes = !!options.includeChildMeshes;
                        const needIndices = type != 4 /* PhysicsShapeType.CONVEX_HULL */;
                        const accum = new MeshAccumulator(mesh, needIndices, mesh?.getScene());
                        accum.addNodeMeshes(mesh, includeChildMeshes);
                        const positions = accum.getVertices(this._hknp);
                        const numVec3s = positions.numObjects / 3;
                        if (type == 4 /* PhysicsShapeType.CONVEX_HULL */) {
                            shape._pluginData = this._hknp.HP_Shape_CreateConvexHull(positions.offset, numVec3s)[1];
                        }
                        else {
                            const triangles = accum.getTriangles(this._hknp);
                            const numTriangles = triangles.numObjects / 3;
                            shape._pluginData = this._hknp.HP_Shape_CreateMesh(positions.offset, numVec3s, triangles.offset, numTriangles)[1];
                            accum.freeBuffer(this._hknp, triangles);
                        }
                        accum.freeBuffer(this._hknp, positions);
                    }
                    else {
                        throw new Error("No mesh provided to create physics shape.");
                    }
                }
                break;
            case 7 /* PhysicsShapeType.HEIGHTFIELD */:
                {
                    if (options.groundMesh) {
                        // update options with datas from groundMesh
                        this._createOptionsFromGroundMesh(options);
                    }
                    if (options.numHeightFieldSamplesX && options.numHeightFieldSamplesZ && options.heightFieldSizeX && options.heightFieldSizeZ && options.heightFieldData) {
                        const totalNumHeights = options.numHeightFieldSamplesX * options.numHeightFieldSamplesZ;
                        const numBytes = totalNumHeights * 4;
                        const bufferBegin = this._hknp._malloc(numBytes);
                        const heightBuffer = new Float32Array(this._hknp.HEAPU8.buffer, bufferBegin, totalNumHeights);
                        for (let x = 0; x < options.numHeightFieldSamplesX; x++) {
                            for (let z = 0; z < options.numHeightFieldSamplesZ; z++) {
                                const hkBufferIndex = z * options.numHeightFieldSamplesX + x;
                                const bjsBufferIndex = (options.numHeightFieldSamplesX - 1 - x) * options.numHeightFieldSamplesZ + z;
                                heightBuffer[hkBufferIndex] = options.heightFieldData[bjsBufferIndex];
                            }
                        }
                        const scaleX = options.heightFieldSizeX / (options.numHeightFieldSamplesX - 1);
                        const scaleZ = options.heightFieldSizeZ / (options.numHeightFieldSamplesZ - 1);
                        shape._pluginData = this._hknp.HP_Shape_CreateHeightField(options.numHeightFieldSamplesX, options.numHeightFieldSamplesZ, [scaleX, 1, scaleZ], bufferBegin)[1];
                        this._hknp._free(bufferBegin);
                    }
                    else {
                        throw new Error("Missing required heightfield parameters");
                    }
                }
                break;
            default:
                throw new Error("Unsupported Shape Type.");
                break;
        }
        this._shapes.set(shape._pluginData[0], shape);
    }
    /**
     * Sets the shape filter membership mask of a body
     * @param shape - The physics body to set the shape filter membership mask for.
     * @param membershipMask - The shape filter membership mask to set.
     */
    setShapeFilterMembershipMask(shape, membershipMask) {
        const collideWith = this._hknp.HP_Shape_GetFilterInfo(shape._pluginData)[1][1];
        this._hknp.HP_Shape_SetFilterInfo(shape._pluginData, [membershipMask, collideWith]);
    }
    /**
     * Gets the shape filter membership mask of a body
     * @param shape - The physics body to get the shape filter membership mask from.
     * @returns The shape filter membership mask of the given body.
     */
    getShapeFilterMembershipMask(shape) {
        return this._hknp.HP_Shape_GetFilterInfo(shape._pluginData)[1][0];
    }
    /**
     * Sets the shape filter collide mask of a body
     * @param shape - The physics body to set the shape filter collide mask for.
     * @param collideMask - The shape filter collide mask to set.
     */
    setShapeFilterCollideMask(shape, collideMask) {
        const membership = this._hknp.HP_Shape_GetFilterInfo(shape._pluginData)[1][0];
        this._hknp.HP_Shape_SetFilterInfo(shape._pluginData, [membership, collideMask]);
    }
    /**
     * Gets the shape filter collide mask of a body
     * @param shape - The physics body to get the shape filter collide mask from.
     * @returns The shape filter collide mask of the given body.
     */
    getShapeFilterCollideMask(shape) {
        return this._hknp.HP_Shape_GetFilterInfo(shape._pluginData)[1][1];
    }
    /**
     * Sets the material of a physics shape.
     * @param shape - The physics shape to set the material of.
     * @param material - The material to set.
     *
     */
    setMaterial(shape, material) {
        const dynamicFriction = material.friction ?? 0.5;
        const staticFriction = material.staticFriction ?? dynamicFriction;
        const restitution = material.restitution ?? 0.0;
        const frictionCombine = material.frictionCombine ?? 1 /* PhysicsMaterialCombineMode.MINIMUM */;
        const restitutionCombine = material.restitutionCombine ?? 2 /* PhysicsMaterialCombineMode.MAXIMUM */;
        const hpMaterial = [staticFriction, dynamicFriction, restitution, this._materialCombineToNative(frictionCombine), this._materialCombineToNative(restitutionCombine)];
        this._hknp.HP_Shape_SetMaterial(shape._pluginData, hpMaterial);
    }
    /**
     * Gets the material associated with a physics shape.
     * @param shape - The shape to get the material from.
     * @returns The material associated with the shape.
     */
    getMaterial(shape) {
        const hkMaterial = this._hknp.HP_Shape_GetMaterial(shape._pluginData)[1];
        return {
            staticFriction: hkMaterial[0],
            friction: hkMaterial[1],
            restitution: hkMaterial[2],
            frictionCombine: this._nativeToMaterialCombine(hkMaterial[3]),
            restitutionCombine: this._nativeToMaterialCombine(hkMaterial[4]),
        };
    }
    /**
     * Sets the density of a physics shape.
     * @param shape - The physics shape to set the density of.
     * @param density - The density to set.
     *
     */
    setDensity(shape, density) {
        this._hknp.HP_Shape_SetDensity(shape._pluginData, density);
    }
    /**
     * Calculates the density of a given physics shape.
     *
     * @param shape - The physics shape to calculate the density of.
     * @returns The density of the given physics shape.
     *
     */
    getDensity(shape) {
        return this._hknp.HP_Shape_GetDensity(shape._pluginData)[1];
    }
    /**
     * Gets the transform infos of a given transform node.
     * This code is useful for getting the position and orientation of a given transform node.
     * It first checks if the node has a rotation quaternion, and if not, it creates one from the node's rotation.
     * It then creates an array containing the position and orientation of the node and returns it.
     * @param node - The transform node.
     * @returns An array containing the position and orientation of the node.
     */
    _getTransformInfos(node) {
        if (node.parent) {
            node.computeWorldMatrix(true);
            return [this._bVecToV3(node.absolutePosition), this._bQuatToV4(node.absoluteRotationQuaternion)];
        }
        let orientation = math_vector/* TmpVectors */.AA.Quaternion[0];
        if (node.rotationQuaternion) {
            orientation = node.rotationQuaternion;
        }
        else {
            const r = node.rotation;
            math_vector/* Quaternion */.PT.FromEulerAnglesToRef(r.x, r.y, r.z, orientation);
        }
        const transform = [this._bVecToV3(node.position), this._bQuatToV4(orientation)];
        return transform;
    }
    /**
     * Adds a child shape to the given shape.
     * @param shape - The parent shape.
     * @param newChild - The child shape to add.
     * @param translation - The relative translation of the child from the parent shape
     * @param rotation - The relative rotation of the child from the parent shape
     * @param scale - The relative scale scale of the child from the parent shaep
     *
     */
    addChild(shape, newChild, translation, rotation, scale) {
        const transformNative = [
            translation ? this._bVecToV3(translation) : [0, 0, 0],
            rotation ? this._bQuatToV4(rotation) : [0, 0, 0, 1],
            scale ? this._bVecToV3(scale) : [1, 1, 1],
        ];
        this._hknp.HP_Shape_AddChild(shape._pluginData, newChild._pluginData, transformNative);
    }
    /**
     * Removes a child shape from a parent shape.
     * @param shape - The parent shape.
     * @param childIndex - The index of the child shape to remove.
     *
     */
    removeChild(shape, childIndex) {
        this._hknp.HP_Shape_RemoveChild(shape._pluginData, childIndex);
    }
    /**
     * Returns the number of children of the given shape.
     *
     * @param shape - The shape to get the number of children from.
     * @returns The number of children of the given shape.
     *
     */
    getNumChildren(shape) {
        return this._hknp.HP_Shape_GetNumChildren(shape._pluginData)[1];
    }
    /**
     * Marks the shape as a trigger
     * @param shape the shape to mark as a trigger
     * @param isTrigger if the shape is a trigger
     */
    setTrigger(shape, isTrigger) {
        this._hknp.HP_Shape_SetTrigger(shape._pluginData, isTrigger);
    }
    /**
     * Calculates the bounding box of a given physics shape.
     *
     * @param _shape - The physics shape to calculate the bounding box for.
     * @returns The calculated bounding box.
     *
     * This method is useful for physics engines as it allows to calculate the
     * boundaries of a given shape. Knowing the boundaries of a shape is important
     * for collision detection and other physics calculations.
     */
    getBoundingBox(_shape) {
        // get local AABB
        const aabb = this._hknp.HP_Shape_GetBoundingBox(_shape._pluginData, [
            [0, 0, 0],
            [0, 0, 0, 1],
        ])[1];
        math_vector/* TmpVectors */.AA.Vector3[0].set(aabb[0][0], aabb[0][1], aabb[0][2]); // min
        math_vector/* TmpVectors */.AA.Vector3[1].set(aabb[1][0], aabb[1][1], aabb[1][2]); // max
        const boundingbox = new boundingBox/* BoundingBox */.I(math_vector/* TmpVectors */.AA.Vector3[0], math_vector/* TmpVectors */.AA.Vector3[1], math_vector/* Matrix */.uq.IdentityReadOnly);
        return boundingbox;
    }
    /**
     * Calculates the world bounding box of a given physics body.
     *
     * @param body - The physics body to calculate the bounding box for.
     * @returns The calculated bounding box.
     *
     * This method is useful for physics engines as it allows to calculate the
     * boundaries of a given body.
     */
    getBodyBoundingBox(body) {
        // get local AABB
        const aabb = this.getBoundingBox(body.shape);
        const boundingbox = new boundingBox/* BoundingBox */.I(aabb.minimum, aabb.maximum, body.transformNode.getWorldMatrix());
        return boundingbox;
    }
    /**
     * Gets the geometry of a physics body.
     *
     * @param body - The physics body.
     * @returns An object containing the positions and indices of the body's geometry.
     *
     */
    getBodyGeometry(body) {
        const dataInfo = body._pluginDataInstances?.length > 0 ? body._pluginDataInstances[0] : body._pluginData;
        const shape = this._hknp.HP_Body_GetShape(dataInfo.hpBodyId)[1];
        const geometryRes = this._hknp.HP_Shape_CreateDebugDisplayGeometry(shape);
        if (geometryRes[0] != this._hknp.Result.RESULT_OK) {
            return { positions: [], indices: [] };
        }
        const geometryInfo = this._hknp.HP_DebugGeometry_GetInfo(geometryRes[1])[1];
        const positionsInPlugin = new Float32Array(this._hknp.HEAPU8.buffer, geometryInfo[0], geometryInfo[1] * 3); // 3 floats per position
        const indicesInPlugin = new Uint32Array(this._hknp.HEAPU8.buffer, geometryInfo[2], geometryInfo[3] * 3); // 3 indices per triangle
        // HP_DebugGeometry_Release will free the buffer in the plugin. To avoid a
        // use-after-free, we need  to make a copy of the data here.
        const positions = positionsInPlugin.slice(0);
        const indices = indicesInPlugin.slice(0);
        this._hknp.HP_DebugGeometry_Release(geometryRes[1]);
        return { positions: positions, indices: indices };
    }
    /**
     * Releases a physics shape from the physics engine.
     *
     * @param shape - The physics shape to be released.
     *
     * This method is useful for releasing a physics shape from the physics engine, freeing up resources and preventing memory leaks.
     */
    disposeShape(shape) {
        this._hknp.HP_Shape_Release(shape._pluginData);
        shape._pluginData = undefined;
    }
    // constraint
    /**
     * Initializes a physics constraint with the given parameters.
     *
     * @param constraint - The physics constraint to be initialized.
     * @param body - The main body
     * @param childBody - The child body.
     * @param instanceIndex - If this body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
     * @param childInstanceIndex - If the child body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
     *
     * This function is useful for setting up a physics constraint in a physics engine.
     */
    initConstraint(constraint, body, childBody, instanceIndex, childInstanceIndex) {
        const type = constraint.type;
        const options = constraint.options;
        if (!type || !options) {
            logger/* Logger */.V.Warn("No constraint type or options. Constraint is invalid.");
            return;
        }
        if ((body._pluginDataInstances.length > 0 && instanceIndex === undefined) || (childBody._pluginDataInstances.length > 0 && childInstanceIndex === undefined)) {
            logger/* Logger */.V.Warn("Body is instanced but no instance index was specified. Constraint will not be applied.");
            return;
        }
        constraint._pluginData = constraint._pluginData ?? [];
        const jointId = this._hknp.HP_Constraint_Create()[1];
        constraint._pluginData.push(jointId);
        // body parenting
        const bodyA = this._getPluginReference(body, instanceIndex).hpBodyId;
        const bodyB = this._getPluginReference(childBody, childInstanceIndex).hpBodyId;
        this._hknp.HP_Constraint_SetParentBody(jointId, bodyA);
        this._hknp.HP_Constraint_SetChildBody(jointId, bodyB);
        this._constraintToBodyIdPair.set(jointId[0], [bodyA[0], bodyB[0]]);
        // anchors
        const pivotA = options.pivotA ? this._bVecToV3(options.pivotA) : this._bVecToV3(math_vector/* Vector3 */.Pq.Zero());
        const axisA = options.axisA ?? new math_vector/* Vector3 */.Pq(1, 0, 0);
        const perpAxisA = this._tmpVec3[0];
        if (options.perpAxisA) {
            perpAxisA.copyFrom(options.perpAxisA);
        }
        else {
            axisA.getNormalToRef(perpAxisA);
        }
        this._hknp.HP_Constraint_SetAnchorInParent(jointId, pivotA, this._bVecToV3(axisA), this._bVecToV3(perpAxisA));
        const pivotB = options.pivotB ? this._bVecToV3(options.pivotB) : this._bVecToV3(math_vector/* Vector3 */.Pq.Zero());
        const axisB = options.axisB ?? new math_vector/* Vector3 */.Pq(1, 0, 0);
        const perpAxisB = this._tmpVec3[0];
        if (options.perpAxisB) {
            perpAxisB.copyFrom(options.perpAxisB);
        }
        else {
            axisB.getNormalToRef(perpAxisB);
        }
        this._hknp.HP_Constraint_SetAnchorInChild(jointId, pivotB, this._bVecToV3(axisB), this._bVecToV3(perpAxisB));
        // Save the options that were used for initializing the constraint for debugging purposes
        // Check first to avoid copying the same options multiple times
        if (!constraint._initOptions) {
            constraint._initOptions = {
                axisA: axisA.clone(),
                axisB: axisB.clone(),
                perpAxisA: perpAxisA.clone(),
                perpAxisB: perpAxisB.clone(),
                pivotA: new math_vector/* Vector3 */.Pq(pivotA[0], pivotA[1], pivotA[2]),
                pivotB: new math_vector/* Vector3 */.Pq(pivotB[0], pivotB[1], pivotB[2]),
            };
        }
        if (type == 5 /* PhysicsConstraintType.LOCK */) {
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
        }
        else if (type == 2 /* PhysicsConstraintType.DISTANCE */) {
            const distance = options.maxDistance || 0;
            const dist3d = this._hknp.ConstraintAxis.LINEAR_DISTANCE;
            this._hknp.HP_Constraint_SetAxisMode(jointId, dist3d, this._hknp.ConstraintAxisLimitMode.LIMITED);
            this._hknp.HP_Constraint_SetAxisMinLimit(jointId, dist3d, distance);
            this._hknp.HP_Constraint_SetAxisMaxLimit(jointId, dist3d, distance);
        }
        else if (type == 3 /* PhysicsConstraintType.HINGE */) {
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
        }
        else if (type == 6 /* PhysicsConstraintType.PRISMATIC */) {
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
        }
        else if (type == 4 /* PhysicsConstraintType.SLIDER */) {
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
        }
        else if (type == 1 /* PhysicsConstraintType.BALL_AND_SOCKET */) {
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED);
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED);
        }
        else if (type == 7 /* PhysicsConstraintType.SIX_DOF */) {
            const sixdofData = constraint;
            for (const l of sixdofData.limits) {
                const axId = this._constraintAxisToNative(l.axis);
                if ((l.minLimit ?? -1) == 0 && (l.maxLimit ?? -1) == 0) {
                    this._hknp.HP_Constraint_SetAxisMode(jointId, axId, this._hknp.ConstraintAxisLimitMode.LOCKED);
                }
                else {
                    if (l.minLimit != undefined) {
                        this._hknp.HP_Constraint_SetAxisMode(jointId, axId, this._hknp.ConstraintAxisLimitMode.LIMITED);
                        this._hknp.HP_Constraint_SetAxisMinLimit(jointId, axId, l.minLimit);
                    }
                    if (l.maxLimit != undefined) {
                        this._hknp.HP_Constraint_SetAxisMode(jointId, axId, this._hknp.ConstraintAxisLimitMode.LIMITED);
                        this._hknp.HP_Constraint_SetAxisMaxLimit(jointId, axId, l.maxLimit);
                    }
                }
                if (l.stiffness) {
                    this._hknp.HP_Constraint_SetAxisStiffness(jointId, axId, l.stiffness);
                }
                if (l.damping) {
                    this._hknp.HP_Constraint_SetAxisDamping(jointId, axId, l.damping);
                }
            }
        }
        else {
            throw new Error("Unsupported Constraint Type.");
        }
        const collisionEnabled = !!options.collision;
        this._hknp.HP_Constraint_SetCollisionsEnabled(jointId, collisionEnabled);
        this._hknp.HP_Constraint_SetEnabled(jointId, true);
    }
    /**
     * Get a list of all the pairs of bodies that are connected by this constraint.
     * @param constraint the constraint to search from
     * @returns a list of parent, child pairs
     */
    getBodiesUsingConstraint(constraint) {
        const pairs = [];
        for (const jointId of constraint._pluginData) {
            const bodyIds = this._constraintToBodyIdPair.get(jointId[0]);
            if (bodyIds) {
                const parentBodyInfo = this._bodies.get(bodyIds[0]);
                const childBodyInfo = this._bodies.get(bodyIds[1]);
                if (parentBodyInfo && childBodyInfo) {
                    pairs.push({ parentBody: parentBodyInfo.body, parentBodyIndex: parentBodyInfo.index, childBody: childBodyInfo.body, childBodyIndex: childBodyInfo.index });
                }
            }
        }
        return pairs;
    }
    /**
     * Adds a constraint to the physics engine.
     *
     * @param body - The main body to which the constraint is applied.
     * @param childBody - The body to which the constraint is applied.
     * @param constraint - The constraint to be applied.
     * @param instanceIndex - If this body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
     * @param childInstanceIndex - If the child body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.
     */
    addConstraint(body, childBody, constraint, instanceIndex, childInstanceIndex) {
        //<todo It's real weird that initConstraint() is called only after adding to a body!
        this.initConstraint(constraint, body, childBody, instanceIndex, childInstanceIndex);
    }
    /**
     * Enables or disables a constraint in the physics engine.
     * @param constraint - The constraint to enable or disable.
     * @param isEnabled - Whether the constraint should be enabled or disabled.
     *
     */
    setEnabled(constraint, isEnabled) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetEnabled(jointId, isEnabled);
        }
    }
    /**
     * Gets the enabled state of the given constraint.
     * @param constraint - The constraint to get the enabled state from.
     * @returns The enabled state of the given constraint.
     *
     */
    getEnabled(constraint) {
        const firstId = constraint._pluginData && constraint._pluginData[0];
        if (firstId) {
            return this._hknp.HP_Constraint_GetEnabled(firstId)[1];
        }
        return false;
    }
    /**
     * Enables or disables collisions for the given constraint.
     * @param constraint - The constraint to enable or disable collisions for.
     * @param isEnabled - Whether collisions should be enabled or disabled.
     *
     */
    setCollisionsEnabled(constraint, isEnabled) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetCollisionsEnabled(jointId, isEnabled);
        }
    }
    /**
     * Gets whether collisions are enabled for the given constraint.
     * @param constraint - The constraint to get collisions enabled for.
     * @returns Whether collisions are enabled for the given constraint.
     *
     */
    getCollisionsEnabled(constraint) {
        const firstId = constraint._pluginData && constraint._pluginData[0];
        if (firstId) {
            return this._hknp.HP_Constraint_GetCollisionsEnabled(firstId)[1];
        }
        return false;
    }
    /**
     * Sets the friction of the given axis of the given constraint.
     *
     * @param constraint - The constraint to set the friction of.
     * @param axis - The axis of the constraint to set the friction of.
     * @param friction - The friction to set.
     *
     */
    setAxisFriction(constraint, axis, friction) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetAxisFriction(jointId, this._constraintAxisToNative(axis), friction);
        }
    }
    /**
     * Gets the friction value of the specified axis of the given constraint.
     *
     * @param constraint - The constraint to get the axis friction from.
     * @param axis - The axis to get the friction from.
     * @returns The friction value of the specified axis.
     *
     */
    getAxisFriction(constraint, axis) {
        const firstId = constraint._pluginData && constraint._pluginData[0];
        if (firstId) {
            return this._hknp.HP_Constraint_GetAxisFriction(firstId, this._constraintAxisToNative(axis))[1];
        }
        return null;
    }
    /**
     * Sets the limit mode of the specified axis of the given constraint.
     * @param constraint - The constraint to set the axis mode of.
     * @param axis - The axis to set the limit mode of.
     * @param limitMode - The limit mode to set.
     */
    setAxisMode(constraint, axis, limitMode) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetAxisMode(jointId, this._constraintAxisToNative(axis), this._limitModeToNative(limitMode));
        }
    }
    /**
     * Gets the axis limit mode of the given constraint.
     *
     * @param constraint - The constraint to get the axis limit mode from.
     * @param axis - The axis to get the limit mode from.
     * @returns The axis limit mode of the given constraint.
     *
     */
    getAxisMode(constraint, axis) {
        const firstId = constraint._pluginData && constraint._pluginData[0];
        if (firstId) {
            const mode = this._hknp.HP_Constraint_GetAxisMode(firstId, this._constraintAxisToNative(axis))[1];
            return this._nativeToLimitMode(mode);
        }
        return null;
    }
    /**
     * Sets the minimum limit of the given axis of the given constraint.
     * @param constraint - The constraint to set the minimum limit of.
     * @param axis - The axis to set the minimum limit of.
     * @param limit - The minimum limit to set.
     *
     */
    setAxisMinLimit(constraint, axis, limit) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetAxisMinLimit(jointId, this._constraintAxisToNative(axis), limit);
        }
    }
    /**
     * Gets the minimum limit of the specified axis of the given constraint.
     * @param constraint - The constraint to get the minimum limit from.
     * @param axis - The axis to get the minimum limit from.
     * @returns The minimum limit of the specified axis of the given constraint.
     *
     */
    getAxisMinLimit(constraint, axis) {
        const firstId = constraint._pluginData && constraint._pluginData[0];
        if (firstId) {
            return this._hknp.HP_Constraint_GetAxisMinLimit(firstId, this._constraintAxisToNative(axis))[1];
        }
        return null;
    }
    /**
     * Sets the maximum limit of the given axis of the given constraint.
     * @param constraint - The constraint to set the maximum limit of the given axis.
     * @param axis - The axis to set the maximum limit of.
     * @param limit - The maximum limit to set.
     *
     */
    setAxisMaxLimit(constraint, axis, limit) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetAxisMaxLimit(jointId, this._constraintAxisToNative(axis), limit);
        }
    }
    /**
     * Gets the maximum limit of the given axis of the given constraint.
     *
     * @param constraint - The constraint to get the maximum limit from.
     * @param axis - The axis to get the maximum limit from.
     * @returns The maximum limit of the given axis of the given constraint.
     *
     */
    getAxisMaxLimit(constraint, axis) {
        const firstId = constraint._pluginData && constraint._pluginData[0];
        if (firstId) {
            return this._hknp.HP_Constraint_GetAxisMaxLimit(firstId, this._constraintAxisToNative(axis))[1];
        }
        return null;
    }
    /**
     * Sets the motor type of the given axis of the given constraint.
     * @param constraint - The constraint to set the motor type of.
     * @param axis - The axis of the constraint to set the motor type of.
     * @param motorType - The motor type to set.
     *
     */
    setAxisMotorType(constraint, axis, motorType) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetAxisMotorType(jointId, this._constraintAxisToNative(axis), this._constraintMotorTypeToNative(motorType));
        }
    }
    /**
     * Gets the motor type of the specified axis of the given constraint.
     * @param constraint - The constraint to get the motor type from.
     * @param axis - The axis of the constraint to get the motor type from.
     * @returns The motor type of the specified axis of the given constraint.
     *
     */
    getAxisMotorType(constraint, axis) {
        const firstId = constraint._pluginData && constraint._pluginData[0];
        if (firstId) {
            return this._nativeToMotorType(this._hknp.HP_Constraint_GetAxisMotorType(firstId, this._constraintAxisToNative(axis))[1]);
        }
        return null;
    }
    /**
     * Sets the target of an axis motor of a constraint.
     *
     * @param constraint - The constraint to set the axis motor target of.
     * @param axis - The axis of the constraint to set the motor target of.
     * @param target - The target of the axis motor.
     *
     */
    setAxisMotorTarget(constraint, axis, target) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetAxisMotorTarget(jointId, this._constraintAxisToNative(axis), target);
        }
    }
    /**
     * Gets the target of the motor of the given axis of the given constraint.
     *
     * @param constraint - The constraint to get the motor target from.
     * @param axis - The axis of the constraint to get the motor target from.
     * @returns The target of the motor of the given axis of the given constraint.
     *
     */
    getAxisMotorTarget(constraint, axis) {
        const firstId = constraint._pluginData && constraint._pluginData[0];
        if (firstId) {
            return this._hknp.HP_Constraint_GetAxisMotorTarget(constraint._pluginData, this._constraintAxisToNative(axis))[1];
        }
        return null;
    }
    /**
     * Sets the maximum force that can be applied by the motor of the given constraint axis.
     * @param constraint - The constraint to set the motor max force for.
     * @param axis - The axis of the constraint to set the motor max force for.
     * @param maxForce - The maximum force that can be applied by the motor.
     *
     */
    setAxisMotorMaxForce(constraint, axis, maxForce) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetAxisMotorMaxForce(jointId, this._constraintAxisToNative(axis), maxForce);
        }
    }
    /**
     * Gets the maximum force of the motor of the given constraint axis.
     *
     * @param constraint - The constraint to get the motor maximum force from.
     * @param axis - The axis of the constraint to get the motor maximum force from.
     * @returns The maximum force of the motor of the given constraint axis.
     *
     */
    getAxisMotorMaxForce(constraint, axis) {
        const firstId = constraint._pluginData && constraint._pluginData[0];
        if (firstId) {
            return this._hknp.HP_Constraint_GetAxisMotorMaxForce(firstId, this._constraintAxisToNative(axis))[1];
        }
        return null;
    }
    /**
     * Disposes a physics constraint.
     *
     * @param constraint - The physics constraint to dispose.
     *
     * This method is useful for releasing the resources associated with a physics constraint, such as
     * the Havok constraint, when it is no longer needed. This is important for avoiding memory leaks.
     */
    disposeConstraint(constraint) {
        for (const jointId of constraint._pluginData) {
            this._hknp.HP_Constraint_SetEnabled(jointId, false);
            this._hknp.HP_Constraint_Release(jointId);
        }
        constraint._pluginData.length = 0;
    }
    _populateHitData(hitData, result) {
        const hitBody = this._bodies.get(hitData[0][0]);
        result.body = hitBody?.body;
        result.bodyIndex = hitBody?.index;
        const hitShape = this._shapes.get(hitData[1][0]);
        result.shape = hitShape;
        const hitPos = hitData[3];
        const hitNormal = hitData[4];
        const hitTriangle = hitData[5];
        result.setHitData({ x: hitNormal[0], y: hitNormal[1], z: hitNormal[2] }, { x: hitPos[0], y: hitPos[1], z: hitPos[2] }, hitTriangle);
    }
    /**
     * Performs a raycast from a given start point to a given end point and stores the result in a given PhysicsRaycastResult object.
     *
     * @param from - The start point of the raycast.
     * @param to - The end point of the raycast.
     * @param result - The PhysicsRaycastResult object to store the result of the raycast.
     * @param query - The raycast query options. See [[IRaycastQuery]] for more information.
     *
     * Performs a raycast. It takes in two points, from and to, and a PhysicsRaycastResult object to store the result of the raycast.
     * It then performs the raycast and stores the hit data in the PhysicsRaycastResult object.
     */
    raycast(from, to, result, query) {
        const queryMembership = query?.membership ?? ~0;
        const queryCollideWith = query?.collideWith ?? ~0;
        const shouldHitTriggers = query?.shouldHitTriggers ?? false;
        result.reset(from, to);
        const bodyToIgnore = [BigInt(0)];
        const hkQuery = [this._bVecToV3(from), this._bVecToV3(to), [queryMembership, queryCollideWith], shouldHitTriggers, bodyToIgnore];
        this._hknp.HP_World_CastRayWithCollector(this.world, this._queryCollector, hkQuery);
        if (this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1] > 0) {
            const [, hitData] = this._hknp.HP_QueryCollector_GetCastRayResult(this._queryCollector, 0)[1];
            this._populateHitData(hitData, result);
            result.calculateHitDistance();
        }
    }
    /**
     * Given a point, returns the closest physics
     * body to that point.
     * @param query the query to perform. @see IPhysicsPointProximityQuery
     * @param result contact point on the hit shape, in world space
     */
    pointProximity(query, result) {
        const queryMembership = query?.collisionFilter?.membership ?? ~0;
        const queryCollideWith = query?.collisionFilter?.collideWith ?? ~0;
        result.reset();
        const bodyToIgnore = query.ignoreBody ? [BigInt(query.ignoreBody._pluginData.hpBodyId[0])] : [BigInt(0)];
        const hkQuery = [this._bVecToV3(query.position), query.maxDistance, [queryMembership, queryCollideWith], query.shouldHitTriggers, bodyToIgnore];
        this._hknp.HP_World_PointProximityWithCollector(this.world, this._queryCollector, hkQuery);
        if (this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1] > 0) {
            const [distance, hitData] = this._hknp.HP_QueryCollector_GetPointProximityResult(this._queryCollector, 0)[1];
            this._populateHitData(hitData, result);
            result.setHitDistance(distance);
        }
    }
    /**
     * Given a shape in a specific position and orientation, returns the closest point to that shape.
     * @param query the query to perform. @see IPhysicsShapeProximityCastQuery
     * @param inputShapeResult contact point on input shape, in input shape space
     * @param hitShapeResult contact point on hit shape, in world space
     */
    shapeProximity(query, inputShapeResult, hitShapeResult) {
        inputShapeResult.reset();
        hitShapeResult.reset();
        const shapeId = query.shape._pluginData;
        const bodyToIgnore = query.ignoreBody ? [BigInt(query.ignoreBody._pluginData.hpBodyId[0])] : [BigInt(0)];
        const hkQuery = [shapeId, this._bVecToV3(query.position), this._bQuatToV4(query.rotation), query.maxDistance, query.shouldHitTriggers, bodyToIgnore];
        this._hknp.HP_World_ShapeProximityWithCollector(this.world, this._queryCollector, hkQuery);
        if (this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1] > 0) {
            const [distance, hitInputData, hitShapeData] = this._hknp.HP_QueryCollector_GetShapeProximityResult(this._queryCollector, 0)[1];
            this._populateHitData(hitInputData, inputShapeResult);
            this._populateHitData(hitShapeData, hitShapeResult);
            inputShapeResult.setHitDistance(distance);
            hitShapeResult.setHitDistance(distance);
        }
    }
    /**
     * Given a shape in a specific orientation, cast it from the start to end position specified by the query, and return the first hit.
     * @param query the query to perform. @see IPhysicsShapeCastQuery
     * @param inputShapeResult contact point on input shape, in input shape space
     * @param hitShapeResult contact point on hit shape, in world space
     */
    shapeCast(query, inputShapeResult, hitShapeResult) {
        inputShapeResult.reset();
        hitShapeResult.reset();
        const shapeId = query.shape._pluginData;
        const bodyToIgnore = query.ignoreBody ? [BigInt(query.ignoreBody._pluginData.hpBodyId[0])] : [BigInt(0)];
        const hkQuery = [shapeId, this._bQuatToV4(query.rotation), this._bVecToV3(query.startPosition), this._bVecToV3(query.endPosition), query.shouldHitTriggers, bodyToIgnore];
        this._hknp.HP_World_ShapeCastWithCollector(this.world, this._queryCollector, hkQuery);
        if (this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1] > 0) {
            const [fractionAlongRay, hitInputData, hitShapeData] = this._hknp.HP_QueryCollector_GetShapeCastResult(this._queryCollector, 0)[1];
            this._populateHitData(hitInputData, inputShapeResult);
            this._populateHitData(hitShapeData, hitShapeResult);
            inputShapeResult.setHitFraction(fractionAlongRay);
            hitShapeResult.setHitFraction(fractionAlongRay);
        }
    }
    /**
     * Return the collision observable for a particular physics body.
     * @param body the physics body
     * @returns the collision observable for the body
     */
    getCollisionObservable(body) {
        const bodyId = body._pluginData.hpBodyId[0];
        let observable = this._bodyCollisionObservable.get(bodyId);
        if (!observable) {
            observable = new Misc_observable/* Observable */.cP();
            this._bodyCollisionObservable.set(bodyId, observable);
        }
        return observable;
    }
    /**
     * Return the collision ended observable for a particular physics body.
     * @param body the physics body
     * @returns
     */
    getCollisionEndedObservable(body) {
        const bodyId = body._pluginData.hpBodyId[0];
        let observable = this._bodyCollisionEndedObservable.get(bodyId);
        if (!observable) {
            observable = new Misc_observable/* Observable */.cP();
            this._bodyCollisionEndedObservable.set(bodyId, observable);
        }
        return observable;
    }
    /**
     * Enable collision to be reported for a body when a callback is setup on the world
     * @param body the physics body
     * @param enabled whether to enable or disable collision events
     */
    setCollisionCallbackEnabled(body, enabled) {
        // Register for collide events by default
        const collideEvents = this._hknp.EventType.COLLISION_STARTED.value | this._hknp.EventType.COLLISION_CONTINUED.value | this._hknp.EventType.COLLISION_FINISHED.value;
        if (body._pluginDataInstances && body._pluginDataInstances.length) {
            body._pluginDataInstances.forEach((bodyId) => {
                this._hknp.HP_Body_SetEventMask(bodyId.hpBodyId, enabled ? collideEvents : 0);
            });
        }
        else if (body._pluginData) {
            this._hknp.HP_Body_SetEventMask(body._pluginData.hpBodyId, enabled ? collideEvents : 0);
        }
    }
    /**
     * Enable collision ended to be reported for a body when a callback is setup on the world
     * @param body the physics body
     * @param enabled whether to enable or disable collision ended events
     */
    setCollisionEndedCallbackEnabled(body, enabled) {
        // Register to collide ended events
        const pluginRef = this._getPluginReference(body);
        let currentCollideEvents = this._hknp.HP_Body_GetEventMask(pluginRef.hpBodyId)[1];
        // update with the ended mask
        currentCollideEvents = enabled
            ? currentCollideEvents | this._hknp.EventType.COLLISION_FINISHED.value
            : currentCollideEvents & ~this._hknp.EventType.COLLISION_FINISHED.value;
        if (body._pluginDataInstances && body._pluginDataInstances.length) {
            body._pluginDataInstances.forEach((bodyId) => {
                this._hknp.HP_Body_SetEventMask(bodyId.hpBodyId, currentCollideEvents);
            });
        }
        else if (body._pluginData) {
            this._hknp.HP_Body_SetEventMask(body._pluginData.hpBodyId, currentCollideEvents);
        }
    }
    _notifyTriggers() {
        let eventAddress = this._hknp.HP_World_GetTriggerEvents(this.world)[1];
        const event = new TriggerEvent();
        while (eventAddress) {
            TriggerEvent.readToRef(this._hknp.HEAPU8.buffer, eventAddress, event);
            const bodyInfoA = this._bodies.get(event.bodyIdA);
            const bodyInfoB = this._bodies.get(event.bodyIdB);
            // Bodies may have been disposed between events. Check both still exist.
            if (bodyInfoA && bodyInfoB) {
                const triggerCollisionInfo = {
                    collider: bodyInfoA.body,
                    colliderIndex: bodyInfoA.index,
                    collidedAgainst: bodyInfoB.body,
                    collidedAgainstIndex: bodyInfoB.index,
                    type: this._nativeTriggerCollisionValueToCollisionType(event.type),
                };
                this.onTriggerCollisionObservable.notifyObservers(triggerCollisionInfo);
            }
            eventAddress = this._hknp.HP_World_GetNextTriggerEvent(this.world, eventAddress);
        }
    }
    /**
     * Runs thru all detected collisions and filter by body
     */
    _notifyCollisions() {
        let eventAddress = this._hknp.HP_World_GetCollisionEvents(this.world)[1];
        const event = new CollisionEvent();
        const worldAddr = Number(this.world);
        while (eventAddress) {
            CollisionEvent.readToRef(this._hknp.HEAPU8.buffer, eventAddress, event);
            const bodyInfoA = this._bodies.get(event.contactOnA.bodyId);
            const bodyInfoB = this._bodies.get(event.contactOnB.bodyId);
            // Bodies may have been disposed between events. Check both still exist.
            if (bodyInfoA && bodyInfoB) {
                const collisionInfo = {
                    collider: bodyInfoA.body,
                    colliderIndex: bodyInfoA.index,
                    collidedAgainst: bodyInfoB.body,
                    collidedAgainstIndex: bodyInfoB.index,
                    type: this._nativeCollisionValueToCollisionType(event.type),
                };
                if (collisionInfo.type === "COLLISION_FINISHED" /* PhysicsEventType.COLLISION_FINISHED */) {
                    this.onCollisionEndedObservable.notifyObservers(collisionInfo);
                }
                else {
                    event.contactOnB.position.subtractToRef(event.contactOnA.position, this._tmpVec3[0]);
                    const distance = math_vector/* Vector3 */.Pq.Dot(this._tmpVec3[0], event.contactOnA.normal);
                    collisionInfo.point = event.contactOnA.position;
                    collisionInfo.distance = distance;
                    collisionInfo.impulse = event.impulseApplied;
                    collisionInfo.normal = event.contactOnA.normal;
                    this.onCollisionObservable.notifyObservers(collisionInfo);
                }
                if (this._bodyCollisionObservable.size && collisionInfo.type !== "COLLISION_FINISHED" /* PhysicsEventType.COLLISION_FINISHED */) {
                    const observableA = this._bodyCollisionObservable.get(event.contactOnA.bodyId);
                    const observableB = this._bodyCollisionObservable.get(event.contactOnB.bodyId);
                    event.contactOnA.position.subtractToRef(event.contactOnB.position, this._tmpVec3[0]);
                    const distance = math_vector/* Vector3 */.Pq.Dot(this._tmpVec3[0], event.contactOnB.normal);
                    if (observableA) {
                        observableA.notifyObservers(collisionInfo);
                    }
                    if (observableB) {
                        const collisionInfoB = {
                            collider: bodyInfoB.body,
                            colliderIndex: bodyInfoB.index,
                            collidedAgainst: bodyInfoA.body,
                            collidedAgainstIndex: bodyInfoA.index,
                            point: event.contactOnB.position,
                            distance: distance,
                            impulse: event.impulseApplied,
                            normal: event.contactOnB.normal,
                            type: this._nativeCollisionValueToCollisionType(event.type),
                        };
                        observableB.notifyObservers(collisionInfoB);
                    }
                }
                else if (this._bodyCollisionEndedObservable.size) {
                    const observableA = this._bodyCollisionEndedObservable.get(event.contactOnA.bodyId);
                    const observableB = this._bodyCollisionEndedObservable.get(event.contactOnB.bodyId);
                    event.contactOnA.position.subtractToRef(event.contactOnB.position, this._tmpVec3[0]);
                    const distance = math_vector/* Vector3 */.Pq.Dot(this._tmpVec3[0], event.contactOnB.normal);
                    if (observableA) {
                        observableA.notifyObservers(collisionInfo);
                    }
                    if (observableB) {
                        const collisionInfoB = {
                            collider: bodyInfoB.body,
                            colliderIndex: bodyInfoB.index,
                            collidedAgainst: bodyInfoA.body,
                            collidedAgainstIndex: bodyInfoA.index,
                            point: event.contactOnB.position,
                            distance: distance,
                            impulse: event.impulseApplied,
                            normal: event.contactOnB.normal,
                            type: this._nativeCollisionValueToCollisionType(event.type),
                        };
                        observableB.notifyObservers(collisionInfoB);
                    }
                }
            }
            eventAddress = this._hknp.HP_World_GetNextCollisionEvent(worldAddr, eventAddress);
        }
    }
    /**
     * Gets the number of bodies in the world
     */
    get numBodies() {
        return this._hknp.HP_World_GetNumBodies(this.world)[1];
    }
    /**
     * Dispose the world and free resources
     */
    dispose() {
        if (this._queryCollector) {
            this._hknp.HP_QueryCollector_Release(this._queryCollector);
            this._queryCollector = undefined;
        }
        if (this.world) {
            this._hknp.HP_World_Release(this.world);
            this.world = undefined;
        }
    }
    _v3ToBvecRef(v, vec3) {
        vec3.set(v[0], v[1], v[2]);
    }
    _bVecToV3(v) {
        return [v._x, v._y, v._z];
    }
    _bQuatToV4(q) {
        return [q._x, q._y, q._z, q._w];
    }
    _constraintMotorTypeToNative(motorType) {
        switch (motorType) {
            case 2 /* PhysicsConstraintMotorType.POSITION */:
                return this._hknp.ConstraintMotorType.POSITION;
            case 1 /* PhysicsConstraintMotorType.VELOCITY */:
                return this._hknp.ConstraintMotorType.VELOCITY;
        }
        return this._hknp.ConstraintMotorType.NONE;
    }
    _nativeToMotorType(motorType) {
        switch (motorType) {
            case this._hknp.ConstraintMotorType.POSITION:
                return 2 /* PhysicsConstraintMotorType.POSITION */;
            case this._hknp.ConstraintMotorType.VELOCITY:
                return 1 /* PhysicsConstraintMotorType.VELOCITY */;
        }
        return 0 /* PhysicsConstraintMotorType.NONE */;
    }
    _materialCombineToNative(mat) {
        switch (mat) {
            case 0 /* PhysicsMaterialCombineMode.GEOMETRIC_MEAN */:
                return this._hknp.MaterialCombine.GEOMETRIC_MEAN;
            case 1 /* PhysicsMaterialCombineMode.MINIMUM */:
                return this._hknp.MaterialCombine.MINIMUM;
            case 2 /* PhysicsMaterialCombineMode.MAXIMUM */:
                return this._hknp.MaterialCombine.MAXIMUM;
            case 3 /* PhysicsMaterialCombineMode.ARITHMETIC_MEAN */:
                return this._hknp.MaterialCombine.ARITHMETIC_MEAN;
            case 4 /* PhysicsMaterialCombineMode.MULTIPLY */:
                return this._hknp.MaterialCombine.MULTIPLY;
        }
    }
    _nativeToMaterialCombine(mat) {
        switch (mat) {
            case this._hknp.MaterialCombine.GEOMETRIC_MEAN:
                return 0 /* PhysicsMaterialCombineMode.GEOMETRIC_MEAN */;
            case this._hknp.MaterialCombine.MINIMUM:
                return 1 /* PhysicsMaterialCombineMode.MINIMUM */;
            case this._hknp.MaterialCombine.MAXIMUM:
                return 2 /* PhysicsMaterialCombineMode.MAXIMUM */;
            case this._hknp.MaterialCombine.ARITHMETIC_MEAN:
                return 3 /* PhysicsMaterialCombineMode.ARITHMETIC_MEAN */;
            case this._hknp.MaterialCombine.MULTIPLY:
                return 4 /* PhysicsMaterialCombineMode.MULTIPLY */;
            default:
                return undefined;
        }
    }
    _constraintAxisToNative(axId) {
        switch (axId) {
            case 0 /* PhysicsConstraintAxis.LINEAR_X */:
                return this._hknp.ConstraintAxis.LINEAR_X;
            case 1 /* PhysicsConstraintAxis.LINEAR_Y */:
                return this._hknp.ConstraintAxis.LINEAR_Y;
            case 2 /* PhysicsConstraintAxis.LINEAR_Z */:
                return this._hknp.ConstraintAxis.LINEAR_Z;
            case 3 /* PhysicsConstraintAxis.ANGULAR_X */:
                return this._hknp.ConstraintAxis.ANGULAR_X;
            case 4 /* PhysicsConstraintAxis.ANGULAR_Y */:
                return this._hknp.ConstraintAxis.ANGULAR_Y;
            case 5 /* PhysicsConstraintAxis.ANGULAR_Z */:
                return this._hknp.ConstraintAxis.ANGULAR_Z;
            case 6 /* PhysicsConstraintAxis.LINEAR_DISTANCE */:
                return this._hknp.ConstraintAxis.LINEAR_DISTANCE;
        }
    }
    _nativeToLimitMode(mode) {
        switch (mode) {
            case this._hknp.ConstraintAxisLimitMode.FREE:
                return 0 /* PhysicsConstraintAxisLimitMode.FREE */;
            case this._hknp.ConstraintAxisLimitMode.LIMITED:
                return 1 /* PhysicsConstraintAxisLimitMode.LIMITED */;
            case this._hknp.ConstraintAxisLimitMode.LOCKED:
                return 2 /* PhysicsConstraintAxisLimitMode.LOCKED */;
        }
        return 0 /* PhysicsConstraintAxisLimitMode.FREE */;
    }
    _limitModeToNative(mode) {
        switch (mode) {
            case 0 /* PhysicsConstraintAxisLimitMode.FREE */:
                return this._hknp.ConstraintAxisLimitMode.FREE;
            case 1 /* PhysicsConstraintAxisLimitMode.LIMITED */:
                return this._hknp.ConstraintAxisLimitMode.LIMITED;
            case 2 /* PhysicsConstraintAxisLimitMode.LOCKED */:
                return this._hknp.ConstraintAxisLimitMode.LOCKED;
        }
    }
    _nativeCollisionValueToCollisionType(type) {
        switch (type) {
            case this._hknp.EventType.COLLISION_STARTED.value:
                return "COLLISION_STARTED" /* PhysicsEventType.COLLISION_STARTED */;
            case this._hknp.EventType.COLLISION_FINISHED.value:
                return "COLLISION_FINISHED" /* PhysicsEventType.COLLISION_FINISHED */;
            case this._hknp.EventType.COLLISION_CONTINUED.value:
                return "COLLISION_CONTINUED" /* PhysicsEventType.COLLISION_CONTINUED */;
        }
        return "COLLISION_STARTED" /* PhysicsEventType.COLLISION_STARTED */;
    }
    _nativeTriggerCollisionValueToCollisionType(type) {
        switch (type) {
            case 8:
                return "TRIGGER_ENTERED" /* PhysicsEventType.TRIGGER_ENTERED */;
            case 16:
                return "TRIGGER_EXITED" /* PhysicsEventType.TRIGGER_EXITED */;
        }
        return "TRIGGER_ENTERED" /* PhysicsEventType.TRIGGER_ENTERED */;
    }
}
//# sourceMappingURL=havokPlugin.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/Plugins/index.js

//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/index.js
/* eslint-disable import/no-internal-modules */








/* eslint-disable import/no-internal-modules */

//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Physics/joinedPhysicsEngineComponent.js






/**
 * Gets the current physics engine
 * @returns a IPhysicsEngine or null if none attached
 */
core_scene/* Scene */.Z.prototype.getPhysicsEngine = function () {
    return this._physicsEngine;
};
/**
 * Enables physics to the current scene
 * @param gravity defines the scene's gravity for the physics engine
 * @param plugin defines the physics engine to be used. defaults to CannonJS.
 * @returns a boolean indicating if the physics engine was initialized
 */
core_scene/* Scene */.Z.prototype.enablePhysics = function (gravity = null, plugin) {
    if (this._physicsEngine) {
        return true;
    }
    // Register the component to the scene
    let component = this._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_PHYSICSENGINE);
    if (!component) {
        component = new PhysicsEngineSceneComponent(this);
        this._addComponent(component);
    }
    try {
        if (!plugin || plugin?.getPluginVersion() === 1) {
            this._physicsEngine = new PhysicsEngine(gravity, plugin);
        }
        else if (plugin?.getPluginVersion() === 2) {
            this._physicsEngine = new physicsEngine_PhysicsEngine(gravity, plugin);
        }
        else {
            throw new Error("Unsupported Physics plugin version.");
        }
        this._physicsTimeAccumulator = 0;
        return true;
    }
    catch (e) {
        logger/* Logger */.V.Error(e.message);
        return false;
    }
};
/**
 * Disables and disposes the physics engine associated with the scene
 */
core_scene/* Scene */.Z.prototype.disablePhysicsEngine = function () {
    if (!this._physicsEngine) {
        return;
    }
    this._physicsEngine.dispose();
    this._physicsEngine = null;
};
/**
 * Gets a boolean indicating if there is an active physics engine
 * @returns a boolean indicating if there is an active physics engine
 */
core_scene/* Scene */.Z.prototype.isPhysicsEnabled = function () {
    return this._physicsEngine !== undefined;
};
/**
 * Deletes a physics compound impostor
 * @param compound defines the compound to delete
 */
core_scene/* Scene */.Z.prototype.deleteCompoundImpostor = function (compound) {
    const mesh = compound.parts[0].mesh;
    if (mesh.physicsImpostor) {
        mesh.physicsImpostor.dispose( /*true*/);
        mesh.physicsImpostor = null;
    }
};
/**
 * @internal
 */
core_scene/* Scene */.Z.prototype._advancePhysicsEngineStep = function (step) {
    if (this._physicsEngine) {
        const subTime = this._physicsEngine.getSubTimeStep();
        if (subTime > 0) {
            this._physicsTimeAccumulator += step;
            while (this._physicsTimeAccumulator > subTime) {
                this.onBeforePhysicsObservable.notifyObservers(this);
                this._physicsEngine._step(subTime / 1000);
                this.onAfterPhysicsObservable.notifyObservers(this);
                this._physicsTimeAccumulator -= subTime;
            }
        }
        else {
            this.onBeforePhysicsObservable.notifyObservers(this);
            this._physicsEngine._step(step / 1000);
            this.onAfterPhysicsObservable.notifyObservers(this);
        }
    }
};
/**
 * Defines the physics engine scene component responsible to manage a physics engine
 */
class PhysicsEngineSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_PHYSICSENGINE;
        this.scene = scene;
        this.scene.onBeforePhysicsObservable = new Misc_observable/* Observable */.cP();
        this.scene.onAfterPhysicsObservable = new Misc_observable/* Observable */.cP();
        // Replace the function used to get the deterministic frame time
        this.scene.getDeterministicFrameTime = () => {
            if (this.scene._physicsEngine) {
                return this.scene._physicsEngine.getTimeStep() * 1000;
            }
            return 1000.0 / 60.0;
        };
    }
    /**
     * Registers the component in a given scene
     */
    register() { }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do for this component
    }
    /**
     * Disposes the component and the associated resources
     */
    dispose() {
        this.scene.onBeforePhysicsObservable.clear();
        this.scene.onAfterPhysicsObservable.clear();
        if (this.scene._physicsEngine) {
            this.scene.disablePhysicsEngine();
        }
    }
}
//# sourceMappingURL=joinedPhysicsEngineComponent.js.map
;// ./node_modules/@babylonjs/core/Physics/v2/physicsEngineComponent.js


Object.defineProperty(Meshes_transformNode/* TransformNode */.V.prototype, "physicsBody", {
    get: function () {
        return this._physicsBody;
    },
    set: function (value) {
        if (this._physicsBody === value) {
            return;
        }
        if (this._disposePhysicsObserver) {
            this.onDisposeObservable.remove(this._disposePhysicsObserver);
        }
        this._physicsBody = value;
        if (value) {
            this._disposePhysicsObserver = this.onDisposeObservable.add(() => {
                // Physics
                if (this.physicsBody) {
                    this.physicsBody.dispose( /*!doNotRecurse*/);
                    this.physicsBody = null;
                }
            });
        }
    },
    enumerable: true,
    configurable: true,
});
/**
 * Gets the current physics body
 * @returns a physics body or null
 */
Meshes_transformNode/* TransformNode */.V.prototype.getPhysicsBody = function () {
    return this.physicsBody;
};
/**
 * Apply a physic impulse to the mesh
 * @param force defines the force to apply
 * @param contactPoint defines where to apply the force
 * @returns the current mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
Meshes_transformNode/* TransformNode */.V.prototype.applyImpulse = function (force, contactPoint) {
    if (!this.physicsBody) {
        throw new Error("No Physics Body for TransformNode");
    }
    this.physicsBody.applyImpulse(force, contactPoint);
    return this;
};
/**
 * Apply a physic angular impulse to the mesh
 * @param angularImpulse defines the torque to apply
 * @returns the current mesh
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
 */
Meshes_transformNode/* TransformNode */.V.prototype.applyAngularImpulse = function (angularImpulse) {
    if (!this.physicsBody) {
        throw new Error("No Physics Body for TransformNode");
    }
    this.physicsBody.applyAngularImpulse(angularImpulse);
    return this;
};
//# sourceMappingURL=physicsEngineComponent.js.map
;// ./node_modules/@babylonjs/core/Physics/physicsEngineComponent.js
// back compat



//# sourceMappingURL=physicsEngineComponent.js.map
;// ./node_modules/@babylonjs/core/Physics/physicsHelper.js





class HelperTools {
    /*
     * Gets the hit contact point between a mesh and a ray. The method varies between
     * the different plugin versions; V1 uses a mesh intersection, V2 uses the physics body instance/object center (to avoid a raycast and improve perf).
     */
    static GetContactPointToRef(mesh, origin, direction, result, instanceIndex) {
        const engine = mesh.getScene().getPhysicsEngine();
        const pluginVersion = engine?.getPluginVersion();
        if (pluginVersion === 1) {
            const ray = new Culling_ray/* Ray */.Rl(origin, direction);
            const hit = ray.intersectsMesh(mesh);
            if (hit.hit && hit.pickedPoint) {
                result.copyFrom(hit.pickedPoint);
                return true;
            }
        }
        else if (pluginVersion === 2) {
            mesh.physicsBody.getObjectCenterWorldToRef(result, instanceIndex);
            return true;
        }
        return false;
    }
    /**
     * Checks if a body will be affected by forces
     * @param body the body to check
     * @param instanceIndex for instanced bodies, the index of the instance to check
     * @returns
     */
    static HasAppliedForces(body, instanceIndex) {
        return (body.getMotionType(instanceIndex) === 0 /* PhysicsMotionType.STATIC */ ||
            (body.getMassProperties(instanceIndex)?.mass ?? 0) === 0 ||
            body.transformNode?.getTotalVertices() === 0);
    }
    /**
     * Checks if a point is inside a cylinder
     * @param point point to check
     * @param origin cylinder origin on the bottom
     * @param radius cylinder radius
     * @param height cylinder height
     * @returns
     */
    static IsInsideCylinder(point, origin, radius, height) {
        const distance = math_vector/* TmpVectors */.AA.Vector3[0];
        point.subtractToRef(origin, distance);
        return Math.abs(distance.x) <= radius && Math.abs(distance.z) <= radius && distance.y >= 0 && distance.y <= height;
    }
}
/**
 * A helper for physics simulations
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
 */
class PhysicsHelper {
    /**
     * Initializes the Physics helper
     * @param scene Babylon.js scene
     */
    constructor(scene) {
        this._hitData = { force: new math_vector/* Vector3 */.Pq(), contactPoint: new math_vector/* Vector3 */.Pq(), distanceFromOrigin: 0 };
        this._scene = scene;
        this._physicsEngine = this._scene.getPhysicsEngine();
        if (!this._physicsEngine) {
            logger/* Logger */.V.Warn("Physics engine not enabled. Please enable the physics before you can use the methods.");
            return;
        }
    }
    /**
     * Applies a radial explosion impulse
     * @param origin the origin of the explosion
     * @param radiusOrEventOptions the radius or the options of radial explosion
     * @param strength the explosion strength
     * @param falloff possible options: Constant & Linear. Defaults to Constant
     * @returns A physics radial explosion event, or null
     */
    applyRadialExplosionImpulse(origin, radiusOrEventOptions, strength, falloff) {
        if (!this._physicsEngine) {
            logger/* Logger */.V.Warn("Physics engine not enabled. Please enable the physics before you call this method.");
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) {
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) {
            return null;
        }
        let useCallback = false;
        if (typeof radiusOrEventOptions === "number") {
            const r = radiusOrEventOptions;
            radiusOrEventOptions = new PhysicsRadialExplosionEventOptions();
            radiusOrEventOptions.radius = r;
            radiusOrEventOptions.strength = strength ?? radiusOrEventOptions.strength;
            radiusOrEventOptions.falloff = falloff ?? radiusOrEventOptions.falloff;
        }
        else {
            useCallback = !!(radiusOrEventOptions.affectedImpostorsCallback || radiusOrEventOptions.affectedBodiesCallback);
        }
        const event = new PhysicsRadialExplosionEvent(this._scene, radiusOrEventOptions);
        const hitData = this._hitData;
        if (this._physicsEngine.getPluginVersion() === 1) {
            const affectedImpostorsWithData = Array();
            const impostors = this._physicsEngine.getImpostors();
            impostors.forEach((impostor) => {
                if (!event.getImpostorHitData(impostor, origin, hitData)) {
                    return;
                }
                impostor.applyImpulse(hitData.force, hitData.contactPoint);
                if (useCallback) {
                    affectedImpostorsWithData.push({
                        impostor: impostor,
                        hitData: this._copyPhysicsHitData(hitData),
                    });
                }
            });
            event.triggerAffectedImpostorsCallback(affectedImpostorsWithData);
        }
        else {
            this._applicationForBodies(event, origin, hitData, useCallback, (body, hitData) => {
                body.applyImpulse(hitData.force, hitData.contactPoint, hitData.instanceIndex);
            });
        }
        event.dispose(false);
        return event;
    }
    /**
     * Applies a radial explosion force
     * @param origin the origin of the explosion
     * @param radiusOrEventOptions the radius or the options of radial explosion
     * @param strength the explosion strength
     * @param falloff possible options: Constant & Linear. Defaults to Constant
     * @returns A physics radial explosion event, or null
     */
    applyRadialExplosionForce(origin, radiusOrEventOptions, strength, falloff) {
        if (!this._physicsEngine) {
            logger/* Logger */.V.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.");
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) {
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) {
            return null;
        }
        let useCallback = false;
        if (typeof radiusOrEventOptions === "number") {
            const r = radiusOrEventOptions;
            radiusOrEventOptions = new PhysicsRadialExplosionEventOptions();
            radiusOrEventOptions.radius = r;
            radiusOrEventOptions.strength = strength ?? radiusOrEventOptions.strength;
            radiusOrEventOptions.falloff = falloff ?? radiusOrEventOptions.falloff;
        }
        else {
            useCallback = !!(radiusOrEventOptions.affectedImpostorsCallback || radiusOrEventOptions.affectedBodiesCallback);
        }
        const event = new PhysicsRadialExplosionEvent(this._scene, radiusOrEventOptions);
        const hitData = this._hitData;
        if (this._physicsEngine.getPluginVersion() === 1) {
            const affectedImpostorsWithData = Array();
            const impostors = this._physicsEngine.getImpostors();
            impostors.forEach((impostor) => {
                if (!event.getImpostorHitData(impostor, origin, hitData)) {
                    return;
                }
                impostor.applyForce(hitData.force, hitData.contactPoint);
                if (useCallback) {
                    affectedImpostorsWithData.push({
                        impostor: impostor,
                        hitData: this._copyPhysicsHitData(hitData),
                    });
                }
            });
            event.triggerAffectedImpostorsCallback(affectedImpostorsWithData);
        }
        else {
            this._applicationForBodies(event, origin, hitData, useCallback, (body, hitData) => {
                body.applyForce(hitData.force, hitData.contactPoint, hitData.instanceIndex);
            });
        }
        event.dispose(false);
        return event;
    }
    _applicationForBodies(event, origin, hitData, useCallback, fnApplication) {
        const affectedBodiesWithData = Array();
        const bodies = this._physicsEngine.getBodies();
        for (const body of bodies) {
            body.iterateOverAllInstances((body, instanceIndex) => {
                if (!event.getBodyHitData(body, origin, hitData, instanceIndex)) {
                    return;
                }
                fnApplication(body, hitData);
                if (useCallback) {
                    affectedBodiesWithData.push({
                        body: body,
                        hitData: this._copyPhysicsHitData(hitData),
                    });
                }
            });
        }
        event.triggerAffectedBodiesCallback(affectedBodiesWithData);
    }
    /**
     * Creates a gravitational field
     * @param origin the origin of the gravitational field
     * @param radiusOrEventOptions the radius or the options of radial gravitational field
     * @param strength the gravitational field strength
     * @param falloff possible options: Constant & Linear. Defaults to Constant
     * @returns A physics gravitational field event, or null
     */
    gravitationalField(origin, radiusOrEventOptions, strength, falloff) {
        if (!this._physicsEngine) {
            logger/* Logger */.V.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.");
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) {
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) {
            return null;
        }
        if (typeof radiusOrEventOptions === "number") {
            const r = radiusOrEventOptions;
            radiusOrEventOptions = new PhysicsRadialExplosionEventOptions();
            radiusOrEventOptions.radius = r;
            radiusOrEventOptions.strength = strength ?? radiusOrEventOptions.strength;
            radiusOrEventOptions.falloff = falloff ?? radiusOrEventOptions.falloff;
        }
        const event = new PhysicsGravitationalFieldEvent(this, this._scene, origin, radiusOrEventOptions);
        event.dispose(false);
        return event;
    }
    /**
     * Creates a physics updraft event
     * @param origin the origin of the updraft
     * @param radiusOrEventOptions the radius or the options of the updraft
     * @param strength the strength of the updraft
     * @param height the height of the updraft
     * @param updraftMode possible options: Center & Perpendicular. Defaults to Center
     * @returns A physics updraft event, or null
     */
    updraft(origin, radiusOrEventOptions, strength, height, updraftMode) {
        if (!this._physicsEngine) {
            logger/* Logger */.V.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.");
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) {
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) {
            return null;
        }
        if (typeof radiusOrEventOptions === "number") {
            const r = radiusOrEventOptions;
            radiusOrEventOptions = new PhysicsUpdraftEventOptions();
            radiusOrEventOptions.radius = r;
            radiusOrEventOptions.strength = strength ?? radiusOrEventOptions.strength;
            radiusOrEventOptions.height = height ?? radiusOrEventOptions.height;
            radiusOrEventOptions.updraftMode = updraftMode ?? radiusOrEventOptions.updraftMode;
        }
        const event = new PhysicsUpdraftEvent(this._scene, origin, radiusOrEventOptions);
        event.dispose(false);
        return event;
    }
    /**
     * Creates a physics vortex event
     * @param origin the of the vortex
     * @param radiusOrEventOptions the radius or the options of the vortex
     * @param strength the strength of the vortex
     * @param height   the height of the vortex
     * @returns a Physics vortex event, or null
     * A physics vortex event or null
     */
    vortex(origin, radiusOrEventOptions, strength, height) {
        if (!this._physicsEngine) {
            logger/* Logger */.V.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.");
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) {
            return null;
        }
        if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) {
            return null;
        }
        if (typeof radiusOrEventOptions === "number") {
            const r = radiusOrEventOptions;
            radiusOrEventOptions = new PhysicsVortexEventOptions();
            radiusOrEventOptions.radius = r;
            radiusOrEventOptions.strength = strength ?? radiusOrEventOptions.strength;
            radiusOrEventOptions.height = height ?? radiusOrEventOptions.height;
        }
        const event = new PhysicsVortexEvent(this._scene, origin, radiusOrEventOptions);
        event.dispose(false);
        return event;
    }
    _copyPhysicsHitData(data) {
        return { force: data.force.clone(), contactPoint: data.contactPoint.clone(), distanceFromOrigin: data.distanceFromOrigin, instanceIndex: data.instanceIndex };
    }
}
/**
 * Represents a physics radial explosion event
 */
class PhysicsRadialExplosionEvent {
    /**
     * Initializes a radial explosion event
     * @param _scene BabylonJS scene
     * @param _options The options for the vortex event
     */
    constructor(_scene, _options) {
        this._scene = _scene;
        this._options = _options;
        this._dataFetched = false; // check if the data has been fetched. If not, do cleanup
        this._options = { ...new PhysicsRadialExplosionEventOptions(), ...this._options };
    }
    /**
     * Returns the data related to the radial explosion event (sphere).
     * @returns The radial explosion event data
     */
    getData() {
        this._dataFetched = true;
        return {
            sphere: this._sphere,
        };
    }
    _getHitData(mesh, center, origin, data) {
        const direction = math_vector/* TmpVectors */.AA.Vector3[0];
        direction.copyFrom(center).subtractInPlace(origin);
        const contactPoint = math_vector/* TmpVectors */.AA.Vector3[1];
        const hasContactPoint = HelperTools.GetContactPointToRef(mesh, origin, direction, contactPoint, data.instanceIndex);
        if (!hasContactPoint) {
            return false;
        }
        const distanceFromOrigin = math_vector/* Vector3 */.Pq.Distance(origin, contactPoint);
        if (distanceFromOrigin > this._options.radius) {
            return false;
        }
        const multiplier = this._options.falloff === 0 /* PhysicsRadialImpulseFalloff.Constant */ ? this._options.strength : this._options.strength * (1 - distanceFromOrigin / this._options.radius);
        // Direction x multiplier equals force
        direction.scaleInPlace(multiplier);
        data.force.copyFrom(direction);
        data.contactPoint.copyFrom(contactPoint);
        data.distanceFromOrigin = distanceFromOrigin;
        return true;
    }
    /**
     * Returns the force and contact point of the body or false, if the body is not affected by the force/impulse.
     * @param body A physics body where the transform node is an AbstractMesh
     * @param origin the origin of the explosion
     * @param data the data of the hit
     * @param instanceIndex the instance index of the body
     * @returns if there was a hit
     */
    getBodyHitData(body, origin, data, instanceIndex) {
        // No force will be applied in these cases, so we skip calculation
        if (HelperTools.HasAppliedForces(body, instanceIndex)) {
            return false;
        }
        const mesh = body.transformNode;
        const bodyObjectCenter = body.getObjectCenterWorld(instanceIndex);
        data.instanceIndex = instanceIndex;
        return this._getHitData(mesh, bodyObjectCenter, origin, data);
    }
    /**
     * Returns the force and contact point of the impostor or false, if the impostor is not affected by the force/impulse.
     * @param impostor A physics imposter
     * @param origin the origin of the explosion
     * @param data the data of the hit
     * @returns A physics force and contact point, or null
     */
    getImpostorHitData(impostor, origin, data) {
        if (impostor.mass === 0) {
            return false;
        }
        if (impostor.object.getClassName() !== "Mesh" && impostor.object.getClassName() !== "InstancedMesh") {
            return false;
        }
        const mesh = impostor.object;
        if (!this._intersectsWithSphere(mesh, origin, this._options.radius)) {
            return false;
        }
        const impostorObjectCenter = impostor.getObjectCenter();
        this._getHitData(mesh, impostorObjectCenter, origin, data);
        return true;
    }
    /**
     * Triggers affected impostors callbacks
     * @param affectedImpostorsWithData defines the list of affected impostors (including associated data)
     */
    triggerAffectedImpostorsCallback(affectedImpostorsWithData) {
        if (this._options.affectedImpostorsCallback) {
            this._options.affectedImpostorsCallback(affectedImpostorsWithData);
        }
    }
    /**
     * Triggers affected bodies callbacks
     * @param affectedBodiesWithData defines the list of affected bodies (including associated data)
     */
    triggerAffectedBodiesCallback(affectedBodiesWithData) {
        if (this._options.affectedBodiesCallback) {
            this._options.affectedBodiesCallback(affectedBodiesWithData);
        }
    }
    /**
     * Disposes the sphere.
     * @param force Specifies if the sphere should be disposed by force
     */
    dispose(force = true) {
        if (this._sphere) {
            if (force) {
                this._sphere.dispose();
            }
            else {
                setTimeout(() => {
                    if (!this._dataFetched) {
                        this._sphere.dispose();
                    }
                }, 0);
            }
        }
    }
    /*** Helpers ***/
    _prepareSphere() {
        if (!this._sphere) {
            this._sphere = CreateSphere("radialExplosionEventSphere", this._options.sphere, this._scene);
            this._sphere.isVisible = false;
        }
    }
    _intersectsWithSphere(mesh, origin, radius) {
        this._prepareSphere();
        this._sphere.position = origin;
        this._sphere.scaling.setAll(radius * 2);
        this._sphere._updateBoundingInfo();
        this._sphere.computeWorldMatrix(true);
        return this._sphere.intersectsMesh(mesh, true);
    }
}
/**
 * Represents a gravitational field event
 */
class PhysicsGravitationalFieldEvent {
    /**
     * Initializes the physics gravitational field event
     * @param _physicsHelper A physics helper
     * @param _scene BabylonJS scene
     * @param _origin The origin position of the gravitational field event
     * @param _options The options for the vortex event
     */
    constructor(_physicsHelper, _scene, _origin, _options) {
        this._physicsHelper = _physicsHelper;
        this._scene = _scene;
        this._origin = _origin;
        this._options = _options;
        this._dataFetched = false; // check if the has been fetched the data. If not, do cleanup
        this._options = { ...new PhysicsRadialExplosionEventOptions(), ...this._options };
        this._tickCallback = () => this._tick();
        this._options.strength = this._options.strength * -1;
    }
    /**
     * Returns the data related to the gravitational field event (sphere).
     * @returns A gravitational field event
     */
    getData() {
        this._dataFetched = true;
        return {
            sphere: this._sphere,
        };
    }
    /**
     * Enables the gravitational field.
     */
    enable() {
        this._tickCallback.call(this);
        this._scene.registerBeforeRender(this._tickCallback);
    }
    /**
     * Disables the gravitational field.
     */
    disable() {
        this._scene.unregisterBeforeRender(this._tickCallback);
    }
    /**
     * Disposes the sphere.
     * @param force The force to dispose from the gravitational field event
     */
    dispose(force = true) {
        if (!this._sphere) {
            return;
        }
        if (force) {
            this._sphere.dispose();
        }
        else {
            setTimeout(() => {
                if (!this._dataFetched) {
                    this._sphere.dispose();
                }
            }, 0);
        }
    }
    _tick() {
        // Since the params won't change, we fetch the event only once
        if (this._sphere) {
            this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);
        }
        else {
            const radialExplosionEvent = this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);
            if (radialExplosionEvent) {
                this._sphere = radialExplosionEvent.getData().sphere?.clone("radialExplosionEventSphereClone");
            }
        }
    }
}
/**
 * Represents a physics updraft event
 */
class PhysicsUpdraftEvent {
    /**
     * Initializes the physics updraft event
     * @param _scene BabylonJS scene
     * @param _origin The origin position of the updraft
     * @param _options The options for the updraft event
     */
    constructor(_scene, _origin, _options) {
        this._scene = _scene;
        this._origin = _origin;
        this._options = _options;
        this._originTop = math_vector/* Vector3 */.Pq.Zero(); // the most upper part of the cylinder
        this._originDirection = math_vector/* Vector3 */.Pq.Zero(); // used if the updraftMode is perpendicular
        this._cylinderPosition = math_vector/* Vector3 */.Pq.Zero(); // to keep the cylinders position, because normally the origin is in the center and not on the bottom
        this._dataFetched = false; // check if the has been fetched the data. If not, do cleanup
        this._physicsEngine = this._scene.getPhysicsEngine();
        this._options = { ...new PhysicsUpdraftEventOptions(), ...this._options };
        this._origin.addToRef(new math_vector/* Vector3 */.Pq(0, this._options.height / 2, 0), this._cylinderPosition);
        this._origin.addToRef(new math_vector/* Vector3 */.Pq(0, this._options.height, 0), this._originTop);
        if (this._options.updraftMode === 1 /* PhysicsUpdraftMode.Perpendicular */) {
            this._originDirection = this._origin.subtract(this._originTop).normalize();
        }
        this._tickCallback = () => this._tick();
        if (this._physicsEngine.getPluginVersion() === 1) {
            this._prepareCylinder();
        }
    }
    /**
     * Returns the data related to the updraft event (cylinder).
     * @returns A physics updraft event
     */
    getData() {
        this._dataFetched = true;
        return {
            cylinder: this._cylinder,
        };
    }
    /**
     * Enables the updraft.
     */
    enable() {
        this._tickCallback.call(this);
        this._scene.registerBeforeRender(this._tickCallback);
    }
    /**
     * Disables the updraft.
     */
    disable() {
        this._scene.unregisterBeforeRender(this._tickCallback);
    }
    /**
     * Disposes the cylinder.
     * @param force Specifies if the updraft should be disposed by force
     */
    dispose(force = true) {
        if (!this._cylinder) {
            return;
        }
        if (force) {
            this._cylinder.dispose();
            this._cylinder = undefined;
        }
        else {
            setTimeout(() => {
                if (!this._dataFetched && this._cylinder) {
                    this._cylinder.dispose();
                    this._cylinder = undefined;
                }
            }, 0);
        }
    }
    _getHitData(center, data) {
        let direction;
        if (this._options.updraftMode === 1 /* PhysicsUpdraftMode.Perpendicular */) {
            direction = this._originDirection;
        }
        else {
            direction = center.subtract(this._originTop);
        }
        const distanceFromOrigin = math_vector/* Vector3 */.Pq.Distance(this._origin, center);
        const multiplier = this._options.strength * -1;
        const force = direction.multiplyByFloats(multiplier, multiplier, multiplier);
        data.force.copyFrom(force);
        data.contactPoint.copyFrom(center);
        data.distanceFromOrigin = distanceFromOrigin;
    }
    _getBodyHitData(body, data, instanceIndex) {
        if (HelperTools.HasAppliedForces(body)) {
            return false;
        }
        const center = body.getObjectCenterWorld(instanceIndex);
        if (!HelperTools.IsInsideCylinder(center, this._origin, this._options.radius, this._options.height)) {
            return false;
        }
        data.instanceIndex = instanceIndex;
        this._getHitData(center, data);
        return true;
    }
    _getImpostorHitData(impostor, data) {
        if (impostor.mass === 0) {
            return false;
        }
        const impostorObject = impostor.object;
        if (!this._intersectsWithCylinder(impostorObject)) {
            return false;
        }
        const center = impostor.getObjectCenter();
        this._getHitData(center, data);
        return true;
    }
    _tick() {
        const hitData = PhysicsUpdraftEvent._HitData;
        if (this._physicsEngine.getPluginVersion() === 1) {
            this._physicsEngine.getImpostors().forEach((impostor) => {
                if (!this._getImpostorHitData(impostor, hitData)) {
                    return;
                }
                impostor.applyForce(hitData.force, hitData.contactPoint);
            });
        }
        else {
            // V2
            this._physicsEngine.getBodies().forEach((body) => {
                body.iterateOverAllInstances((body, instanceIndex) => {
                    if (!this._getBodyHitData(body, hitData, instanceIndex)) {
                        return;
                    }
                    body.applyForce(hitData.force, hitData.contactPoint, hitData.instanceIndex);
                });
            });
        }
    }
    /*** Helpers ***/
    _prepareCylinder() {
        if (!this._cylinder) {
            this._cylinder = CreateCylinder("updraftEventCylinder", {
                height: this._options.height,
                diameter: this._options.radius * 2,
            }, this._scene);
            this._cylinder.isVisible = false;
        }
    }
    _intersectsWithCylinder(mesh) {
        if (!this._cylinder) {
            return false;
        }
        this._cylinder.position = this._cylinderPosition;
        return this._cylinder.intersectsMesh(mesh, true);
    }
}
PhysicsUpdraftEvent._HitData = { force: new math_vector/* Vector3 */.Pq(), contactPoint: new math_vector/* Vector3 */.Pq(), distanceFromOrigin: 0 };
/**
 * Represents a physics vortex event
 */
class PhysicsVortexEvent {
    /**
     * Initializes the physics vortex event
     * @param _scene The BabylonJS scene
     * @param _origin The origin position of the vortex
     * @param _options The options for the vortex event
     */
    constructor(_scene, _origin, _options) {
        this._scene = _scene;
        this._origin = _origin;
        this._options = _options;
        this._originTop = math_vector/* Vector3 */.Pq.Zero(); // the most upper part of the cylinder
        this._cylinderPosition = math_vector/* Vector3 */.Pq.Zero(); // to keep the cylinders position, because normally the origin is in the center and not on the bottom
        this._dataFetched = false; // check if the has been fetched the data. If not, do cleanup
        this._physicsEngine = this._scene.getPhysicsEngine();
        this._options = { ...new PhysicsVortexEventOptions(), ...this._options };
        this._origin.addToRef(new math_vector/* Vector3 */.Pq(0, this._options.height / 2, 0), this._cylinderPosition);
        this._origin.addToRef(new math_vector/* Vector3 */.Pq(0, this._options.height, 0), this._originTop);
        this._tickCallback = () => this._tick();
        if (this._physicsEngine.getPluginVersion() === 1) {
            this._prepareCylinder();
        }
    }
    /**
     * Returns the data related to the vortex event (cylinder).
     * @returns The physics vortex event data
     */
    getData() {
        this._dataFetched = true;
        return {
            cylinder: this._cylinder,
        };
    }
    /**
     * Enables the vortex.
     */
    enable() {
        this._tickCallback.call(this);
        this._scene.registerBeforeRender(this._tickCallback);
    }
    /**
     * Disables the cortex.
     */
    disable() {
        this._scene.unregisterBeforeRender(this._tickCallback);
    }
    /**
     * Disposes the sphere.
     * @param force
     */
    dispose(force = true) {
        if (!this._cylinder) {
            return;
        }
        if (force) {
            this._cylinder.dispose();
        }
        else {
            setTimeout(() => {
                if (!this._dataFetched) {
                    this._cylinder.dispose();
                }
            }, 0);
        }
    }
    _getHitData(mesh, center, data) {
        const originOnPlane = PhysicsVortexEvent._OriginOnPlane;
        originOnPlane.set(this._origin.x, center.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
        const originToImpostorDirection = math_vector/* TmpVectors */.AA.Vector3[0];
        center.subtractToRef(originOnPlane, originToImpostorDirection);
        const contactPoint = math_vector/* TmpVectors */.AA.Vector3[1];
        const hasContactPoint = HelperTools.GetContactPointToRef(mesh, originOnPlane, originToImpostorDirection, contactPoint, data.instanceIndex);
        if (!hasContactPoint) {
            return false;
        }
        const distance = math_vector/* Vector3 */.Pq.Distance(contactPoint, originOnPlane);
        const absoluteDistanceFromOrigin = distance / this._options.radius;
        const directionToOrigin = math_vector/* TmpVectors */.AA.Vector3[2];
        contactPoint.normalizeToRef(directionToOrigin);
        if (absoluteDistanceFromOrigin > this._options.centripetalForceThreshold) {
            directionToOrigin.negateInPlace();
        }
        let forceX;
        let forceY;
        let forceZ;
        if (absoluteDistanceFromOrigin > this._options.centripetalForceThreshold) {
            forceX = directionToOrigin.x * this._options.centripetalForceMultiplier;
            forceY = directionToOrigin.y * this._options.updraftForceMultiplier;
            forceZ = directionToOrigin.z * this._options.centripetalForceMultiplier;
        }
        else {
            const perpendicularDirection = math_vector/* Vector3 */.Pq.Cross(originOnPlane, center).normalize();
            forceX = (perpendicularDirection.x + directionToOrigin.x) * this._options.centrifugalForceMultiplier;
            forceY = this._originTop.y * this._options.updraftForceMultiplier;
            forceZ = (perpendicularDirection.z + directionToOrigin.z) * this._options.centrifugalForceMultiplier;
        }
        const force = math_vector/* TmpVectors */.AA.Vector3[3];
        force.set(forceX, forceY, forceZ);
        force.scaleInPlace(this._options.strength);
        data.force.copyFrom(force);
        data.contactPoint.copyFrom(center);
        data.distanceFromOrigin = absoluteDistanceFromOrigin;
        return true;
    }
    _getBodyHitData(body, data, instanceIndex) {
        if (HelperTools.HasAppliedForces(body, instanceIndex)) {
            return false;
        }
        const bodyObject = body.transformNode;
        const bodyCenter = body.getObjectCenterWorld(instanceIndex);
        if (!HelperTools.IsInsideCylinder(bodyCenter, this._origin, this._options.radius, this._options.height)) {
            return false;
        }
        data.instanceIndex = instanceIndex;
        return this._getHitData(bodyObject, bodyCenter, data);
    }
    _getImpostorHitData(impostor, data) {
        if (impostor.mass === 0) {
            return false;
        }
        if (impostor.object.getClassName() !== "Mesh" && impostor.object.getClassName() !== "InstancedMesh") {
            return false;
        }
        const impostorObject = impostor.object;
        if (!this._intersectsWithCylinder(impostorObject)) {
            return false;
        }
        const impostorObjectCenter = impostor.getObjectCenter();
        this._getHitData(impostorObject, impostorObjectCenter, data);
        return true;
    }
    _tick() {
        const hitData = PhysicsVortexEvent._HitData;
        if (this._physicsEngine.getPluginVersion() === 1) {
            this._physicsEngine.getImpostors().forEach((impostor) => {
                if (!this._getImpostorHitData(impostor, hitData)) {
                    return;
                }
                impostor.applyForce(hitData.force, hitData.contactPoint);
            });
        }
        else {
            this._physicsEngine.getBodies().forEach((body) => {
                body.iterateOverAllInstances((body, instanceIndex) => {
                    if (!this._getBodyHitData(body, hitData, instanceIndex)) {
                        return;
                    }
                    body.applyForce(hitData.force, hitData.contactPoint, hitData.instanceIndex);
                });
            });
        }
    }
    /*** Helpers ***/
    _prepareCylinder() {
        if (!this._cylinder) {
            this._cylinder = CreateCylinder("vortexEventCylinder", {
                height: this._options.height,
                diameter: this._options.radius * 2,
            }, this._scene);
            this._cylinder.isVisible = false;
        }
    }
    _intersectsWithCylinder(mesh) {
        this._cylinder.position = this._cylinderPosition;
        return this._cylinder.intersectsMesh(mesh, true);
    }
}
PhysicsVortexEvent._OriginOnPlane = math_vector/* Vector3 */.Pq.Zero();
PhysicsVortexEvent._HitData = { force: new math_vector/* Vector3 */.Pq(), contactPoint: new math_vector/* Vector3 */.Pq(), distanceFromOrigin: 0 };
/**
 * Options fot the radial explosion event
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
 */
class PhysicsRadialExplosionEventOptions {
    constructor() {
        /**
         * The radius of the sphere for the radial explosion.
         */
        this.radius = 5;
        /**
         * The strength of the explosion.
         */
        this.strength = 10;
        /**
         * The strength of the force in correspondence to the distance of the affected object
         */
        this.falloff = 0 /* PhysicsRadialImpulseFalloff.Constant */;
        /**
         * Sphere options for the radial explosion.
         */
        this.sphere = { segments: 32, diameter: 1 };
    }
}
/**
 * Options fot the updraft event
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
 */
class PhysicsUpdraftEventOptions {
    constructor() {
        /**
         * The radius of the cylinder for the vortex
         */
        this.radius = 5;
        /**
         * The strength of the updraft.
         */
        this.strength = 10;
        /**
         * The height of the cylinder for the updraft.
         */
        this.height = 10;
        /**
         * The mode for the updraft.
         */
        this.updraftMode = 0 /* PhysicsUpdraftMode.Center */;
    }
}
/**
 * Options fot the vortex event
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
 */
class PhysicsVortexEventOptions {
    constructor() {
        /**
         * The radius of the cylinder for the vortex
         */
        this.radius = 5;
        /**
         * The strength of the vortex.
         */
        this.strength = 10;
        /**
         * The height of the cylinder for the vortex.
         */
        this.height = 10;
        /**
         * At which distance, relative to the radius the centripetal forces should kick in? Range: 0-1
         */
        this.centripetalForceThreshold = 0.7;
        /**
         * This multiplier determines with how much force the objects will be pushed sideways/around the vortex, when below the threshold.
         */
        this.centripetalForceMultiplier = 5;
        /**
         * This multiplier determines with how much force the objects will be pushed sideways/around the vortex, when above the threshold.
         */
        this.centrifugalForceMultiplier = 0.5;
        /**
         * This multiplier determines with how much force the objects will be pushed upwards, when in the vortex.
         */
        this.updraftForceMultiplier = 0.02;
    }
}
/**
 * The strength of the force in correspondence to the distance of the affected object
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
 */
var PhysicsRadialImpulseFalloff;
(function (PhysicsRadialImpulseFalloff) {
    /** Defines that impulse is constant in strength across it's whole radius */
    PhysicsRadialImpulseFalloff[PhysicsRadialImpulseFalloff["Constant"] = 0] = "Constant";
    /** Defines that impulse gets weaker if it's further from the origin */
    PhysicsRadialImpulseFalloff[PhysicsRadialImpulseFalloff["Linear"] = 1] = "Linear";
})(PhysicsRadialImpulseFalloff || (PhysicsRadialImpulseFalloff = {}));
/**
 * The strength of the force in correspondence to the distance of the affected object
 * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
 */
var PhysicsUpdraftMode;
(function (PhysicsUpdraftMode) {
    /** Defines that the upstream forces will pull towards the top center of the cylinder */
    PhysicsUpdraftMode[PhysicsUpdraftMode["Center"] = 0] = "Center";
    /** Defines that once a impostor is inside the cylinder, it will shoot out perpendicular from the ground of the cylinder */
    PhysicsUpdraftMode[PhysicsUpdraftMode["Perpendicular"] = 1] = "Perpendicular";
})(PhysicsUpdraftMode || (PhysicsUpdraftMode = {}));
//# sourceMappingURL=physicsHelper.js.map
;// ./node_modules/@babylonjs/core/Physics/proximityCastResult.js

/**
 * Class representing a contact point produced in a proximity cast
 */
class ProximityCastResult extends CastingResult {
    constructor() {
        super(...arguments);
        this._hitDistance = 0;
    }
    /**
     * Gets the distance from the hit
     */
    get hitDistance() {
        return this._hitDistance;
    }
    /**
     * Sets the distance from the start point to the hit point
     * @param distance
     */
    setHitDistance(distance) {
        this._hitDistance = distance;
    }
    /**
     * Resets all the values to default
     */
    reset() {
        super.reset();
        this._hitDistance = 0;
    }
}
//# sourceMappingURL=proximityCastResult.js.map
;// ./node_modules/@babylonjs/core/Physics/physicsPointProximityQuery.js

//# sourceMappingURL=physicsPointProximityQuery.js.map
;// ./node_modules/@babylonjs/core/Physics/physicsShapeProximityCastQuery.js

//# sourceMappingURL=physicsShapeProximityCastQuery.js.map
;// ./node_modules/@babylonjs/core/Physics/shapeCastResult.js

/**
 * Class representing a contact point produced in a shape cast
 */
class ShapeCastResult extends CastingResult {
    constructor() {
        super(...arguments);
        this._hitFraction = 0;
    }
    /**
     * Gets the hit fraction along the casting ray
     */
    get hitFraction() {
        return this._hitFraction;
    }
    /**
     * Sets the hit fraction along the casting ray
     * @param fraction
     */
    setHitFraction(fraction) {
        this._hitFraction = fraction;
    }
}
//# sourceMappingURL=shapeCastResult.js.map
;// ./node_modules/@babylonjs/core/Physics/index.js
/* eslint-disable import/no-internal-modules */










//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/blackAndWhitePostProcess.js






/**
 * Post process used to render in black and white
 */
class BlackAndWhitePostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Linear about to convert he result to black and white (default: 1)
     */
    get degree() {
        return this._effectWrapper.degree;
    }
    set degree(value) {
        this._effectWrapper.degree = value;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "BlackAndWhitePostProcess" string
     */
    getClassName() {
        return "BlackAndWhitePostProcess";
    }
    /**
     * Creates a black and white post process
     * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#black-and-white
     * @param name The name of the effect.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     */
    constructor(name, options, camera = null, samplingMode, engine, reusable) {
        const localOptions = {
            uniforms: ThinBlackAndWhitePostProcess.Uniforms,
            size: typeof options === "number" ? options : undefined,
            camera,
            samplingMode,
            engine,
            reusable,
            ...options,
        };
        super(name, ThinBlackAndWhitePostProcess.FragmentUrl, {
            effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinBlackAndWhitePostProcess(name, engine, localOptions) : undefined,
            ...localOptions,
        });
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new BlackAndWhitePostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BlackAndWhitePostProcess.prototype, "degree", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BlackAndWhitePostProcess", BlackAndWhitePostProcess);
//# sourceMappingURL=blackAndWhitePostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderEffect.js

/**
 * This represents a set of one or more post processes in Babylon.
 * A post process can be used to apply a shader to a texture after it is rendered.
 * @example https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/postProcessRenderPipeline
 */
class PostProcessRenderEffect {
    /**
     * Instantiates a post process render effect.
     * A post process can be used to apply a shader to a texture after it is rendered.
     * @param engine The engine the effect is tied to
     * @param name The name of the effect
     * @param getPostProcesses A function that returns a set of post processes which the effect will run in order to be run.
     * @param singleInstance False if this post process can be run on multiple cameras. (default: true)
     */
    constructor(engine, name, getPostProcesses, singleInstance) {
        this._name = name;
        this._singleInstance = singleInstance || true;
        this._getPostProcesses = getPostProcesses;
        this._cameras = {};
        this._indicesForCamera = {};
        this._postProcesses = {};
    }
    /**
     * Checks if all the post processes in the effect are supported.
     */
    get isSupported() {
        for (const index in this._postProcesses) {
            if (Object.prototype.hasOwnProperty.call(this._postProcesses, index)) {
                const pps = this._postProcesses[index];
                for (let ppIndex = 0; ppIndex < pps.length; ppIndex++) {
                    if (!pps[ppIndex].isSupported) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
    /**
     * Updates the current state of the effect
     * @internal
     */
    _update() { }
    /**
     * Attaches the effect on cameras
     * @param cameras The camera to attach to.
     * @internal
     */
    _attachCameras(cameras) {
        let cameraKey;
        const cams = tools/* Tools */.S0.MakeArray(cameras || this._cameras);
        if (!cams) {
            return;
        }
        for (let i = 0; i < cams.length; i++) {
            const camera = cams[i];
            if (!camera) {
                continue;
            }
            const cameraName = camera.name;
            if (this._singleInstance) {
                cameraKey = 0;
            }
            else {
                cameraKey = cameraName;
            }
            if (!this._postProcesses[cameraKey]) {
                const postProcess = this._getPostProcesses();
                if (postProcess) {
                    this._postProcesses[cameraKey] = Array.isArray(postProcess) ? postProcess : [postProcess];
                }
            }
            if (!this._indicesForCamera[cameraName]) {
                this._indicesForCamera[cameraName] = [];
            }
            this._postProcesses[cameraKey].forEach((postProcess) => {
                const index = camera.attachPostProcess(postProcess);
                this._indicesForCamera[cameraName].push(index);
            });
            if (!this._cameras[cameraName]) {
                this._cameras[cameraName] = camera;
            }
        }
    }
    /**
     * Detaches the effect on cameras
     * @param cameras The camera to detach from.
     * @internal
     */
    _detachCameras(cameras) {
        const cams = tools/* Tools */.S0.MakeArray(cameras || this._cameras);
        if (!cams) {
            return;
        }
        for (let i = 0; i < cams.length; i++) {
            const camera = cams[i];
            const cameraName = camera.name;
            const postProcesses = this._postProcesses[this._singleInstance ? 0 : cameraName];
            if (postProcesses) {
                postProcesses.forEach((postProcess) => {
                    camera.detachPostProcess(postProcess);
                });
            }
            if (this._cameras[cameraName]) {
                this._cameras[cameraName] = null;
            }
            delete this._indicesForCamera[cameraName];
        }
    }
    /**
     * Enables the effect on given cameras
     * @param cameras The camera to enable.
     * @internal
     */
    _enable(cameras) {
        const cams = tools/* Tools */.S0.MakeArray(cameras || this._cameras);
        if (!cams) {
            return;
        }
        for (let i = 0; i < cams.length; i++) {
            const camera = cams[i];
            const cameraName = camera.name;
            const cameraKey = this._singleInstance ? 0 : cameraName;
            for (let j = 0; j < this._indicesForCamera[cameraName].length; j++) {
                const index = this._indicesForCamera[cameraName][j];
                const postProcess = camera._postProcesses[index];
                if (postProcess === undefined || postProcess === null) {
                    cams[i].attachPostProcess(this._postProcesses[cameraKey][j], index);
                }
            }
        }
    }
    /**
     * Disables the effect on the given cameras
     * @param cameras The camera to disable.
     * @internal
     */
    _disable(cameras) {
        const cams = tools/* Tools */.S0.MakeArray(cameras || this._cameras);
        if (!cams) {
            return;
        }
        for (let i = 0; i < cams.length; i++) {
            const camera = cams[i];
            const cameraName = camera.name;
            this._postProcesses[this._singleInstance ? 0 : cameraName].forEach((postProcess) => {
                camera.detachPostProcess(postProcess);
            });
        }
    }
    /**
     * Gets a list of the post processes contained in the effect.
     * @param camera The camera to get the post processes on.
     * @returns The list of the post processes in the effect.
     */
    getPostProcesses(camera) {
        if (this._singleInstance) {
            return this._postProcesses[0];
        }
        else {
            if (!camera) {
                return null;
            }
            return this._postProcesses[camera.name];
        }
    }
}
//# sourceMappingURL=postProcessRenderEffect.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/extractHighlightsPostProcess.js






/**
 * The extract highlights post process sets all pixels to black except pixels above the specified luminance threshold. Used as the first step for a bloom effect.
 */
class ExtractHighlightsPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * The luminance threshold, pixels below this value will be set to black.
     */
    get threshold() {
        return this._effectWrapper.threshold;
    }
    set threshold(value) {
        this._effectWrapper.threshold = value;
    }
    /** @internal */
    get _exposure() {
        return this._effectWrapper._exposure;
    }
    /** @internal */
    set _exposure(value) {
        this._effectWrapper._exposure = value;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "ExtractHighlightsPostProcess" string
     */
    getClassName() {
        return "ExtractHighlightsPostProcess";
    }
    constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        const localOptions = {
            uniforms: ThinExtractHighlightsPostProcess.Uniforms,
            size: typeof options === "number" ? options : undefined,
            camera,
            samplingMode,
            engine,
            reusable,
            textureType,
            blockCompilation,
            ...options,
        };
        super(name, ThinExtractHighlightsPostProcess.FragmentUrl, {
            effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinExtractHighlightsPostProcess(name, engine, localOptions) : undefined,
            ...localOptions,
        });
        /**
         * Post process which has the input texture to be used when performing highlight extraction
         * @internal
         */
        this._inputPostProcess = null;
        this.onApplyObservable.add((effect) => {
            this.externalTextureSamplerBinding = !!this._inputPostProcess;
            if (this._inputPostProcess) {
                effect.setTextureFromPostProcess("textureSampler", this._inputPostProcess);
            }
        });
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ExtractHighlightsPostProcess.prototype, "threshold", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ExtractHighlightsPostProcess", ExtractHighlightsPostProcess);
//# sourceMappingURL=extractHighlightsPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/bloomMergePostProcess.js






/**
 * The BloomMergePostProcess merges blurred images with the original based on the values of the circle of confusion.
 */
class BloomMergePostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /** Weight of the bloom to be added to the original input. */
    get weight() {
        return this._effectWrapper.weight;
    }
    set weight(value) {
        this._effectWrapper.weight = value;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "BloomMergePostProcess" string
     */
    getClassName() {
        return "BloomMergePostProcess";
    }
    /**
     * Creates a new instance of @see BloomMergePostProcess
     * @param name The name of the effect.
     * @param originalFromInput Post process which's input will be used for the merge.
     * @param blurred Blurred highlights post process which's output will be used.
     * @param weight Weight of the bloom to be added to the original input.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(name, originalFromInput, blurred, weight, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        const blockCompilationFinal = typeof options === "number" ? blockCompilation : !!options.blockCompilation;
        const localOptions = {
            uniforms: ThinBloomMergePostProcess.Uniforms,
            samplers: ThinBloomMergePostProcess.Samplers,
            size: typeof options === "number" ? options : undefined,
            camera,
            samplingMode,
            engine,
            reusable,
            textureType,
            ...options,
            blockCompilation: true,
        };
        super(name, ThinBloomMergePostProcess.FragmentUrl, {
            effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinBloomMergePostProcess(name, engine, localOptions) : undefined,
            ...localOptions,
        });
        this.weight = weight;
        this.externalTextureSamplerBinding = true;
        this.onApplyObservable.add((effect) => {
            effect.setTextureFromPostProcess("textureSampler", originalFromInput);
            effect.setTextureFromPostProcessOutput("bloomBlur", blurred);
        });
        if (!blockCompilationFinal) {
            this.updateEffect();
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], BloomMergePostProcess.prototype, "weight", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.BloomMergePostProcess", BloomMergePostProcess);
//# sourceMappingURL=bloomMergePostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/bloomEffect.js






/**
 * The bloom effect spreads bright areas of an image to simulate artifacts seen in cameras
 */
class BloomEffect extends PostProcessRenderEffect {
    /**
     * The luminance threshold to find bright areas of the image to bloom.
     */
    get threshold() {
        return this._thinBloomEffect.threshold;
    }
    set threshold(value) {
        this._thinBloomEffect.threshold = value;
    }
    /**
     * The strength of the bloom.
     */
    get weight() {
        return this._thinBloomEffect.weight;
    }
    set weight(value) {
        this._thinBloomEffect.weight = value;
    }
    /**
     * Specifies the size of the bloom blur kernel, relative to the final output size
     */
    get kernel() {
        return this._thinBloomEffect.kernel;
    }
    set kernel(value) {
        this._thinBloomEffect.kernel = value;
    }
    get bloomScale() {
        return this._thinBloomEffect.scale;
    }
    /**
     * Creates a new instance of @see BloomEffect
     * @param sceneOrEngine The scene or engine the effect belongs to.
     * @param bloomScale The ratio of the blur texture to the input texture that should be used to compute the bloom.
     * @param bloomWeight The strength of bloom.
     * @param bloomKernel The size of the kernel to be used when applying the blur.
     * @param pipelineTextureType The type of texture to be used when performing the post processing.
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(sceneOrEngine, bloomScale, bloomWeight, bloomKernel, pipelineTextureType = 0, blockCompilation = false) {
        const engine = sceneOrEngine._renderForCamera ? sceneOrEngine.getEngine() : sceneOrEngine;
        super(engine, "bloom", () => {
            return this._effects;
        }, true);
        /**
         * @internal Internal
         */
        this._effects = [];
        this._thinBloomEffect = new ThinBloomEffect("bloom", engine, bloomScale, blockCompilation);
        this._downscale = new ExtractHighlightsPostProcess("highlights", {
            size: 1.0,
            samplingMode: Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE,
            engine,
            textureType: pipelineTextureType,
            blockCompilation,
            effectWrapper: this._thinBloomEffect._downscale,
        });
        this._blurX = new BlurPostProcess("horizontal blur", this._thinBloomEffect._blurX.direction, this._thinBloomEffect._blurX.kernel, {
            size: bloomScale,
            samplingMode: Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE,
            engine,
            textureType: pipelineTextureType,
            blockCompilation,
            effectWrapper: this._thinBloomEffect._blurX,
        });
        this._blurX.alwaysForcePOT = true;
        this._blurX.autoClear = false;
        this._blurY = new BlurPostProcess("vertical blur", this._thinBloomEffect._blurY.direction, this._thinBloomEffect._blurY.kernel, {
            size: bloomScale,
            samplingMode: Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE,
            engine,
            textureType: pipelineTextureType,
            blockCompilation,
            effectWrapper: this._thinBloomEffect._blurY,
        });
        this._blurY.alwaysForcePOT = true;
        this._blurY.autoClear = false;
        this.kernel = bloomKernel;
        this._effects = [this._downscale, this._blurX, this._blurY];
        this._merge = new BloomMergePostProcess("bloomMerge", this._downscale, this._blurY, bloomWeight, {
            size: bloomScale,
            samplingMode: Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE,
            engine,
            textureType: pipelineTextureType,
            blockCompilation,
            effectWrapper: this._thinBloomEffect._merge,
        });
        this._merge.autoClear = false;
        this._effects.push(this._merge);
    }
    /**
     * Disposes each of the internal effects for a given camera.
     * @param camera The camera to dispose the effect on.
     */
    disposeEffects(camera) {
        for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {
            this._effects[effectIndex].dispose(camera);
        }
    }
    /**
     * @internal Internal
     */
    _updateEffects() {
        for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {
            this._effects[effectIndex].updateEffect();
        }
    }
    /**
     * Internal
     * @returns if all the contained post processes are ready.
     * @internal
     */
    _isReady() {
        return this._thinBloomEffect.isReady();
    }
}
//# sourceMappingURL=bloomEffect.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/chromaticAberrationPostProcess.js







/**
 * The ChromaticAberrationPostProcess separates the rgb channels in an image to produce chromatic distortion around the edges of the screen
 */
class ChromaticAberrationPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "ChromaticAberrationPostProcess" string
     */
    getClassName() {
        return "ChromaticAberrationPostProcess";
    }
    /**
     * Creates a new instance ChromaticAberrationPostProcess
     * @param name The name of the effect.
     * @param screenWidth The width of the screen to apply the effect on.
     * @param screenHeight The height of the screen to apply the effect on.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(name, screenWidth, screenHeight, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        super(name, "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);
        /**
         * The amount of separation of rgb channels (default: 30)
         */
        this.aberrationAmount = 30;
        /**
         * The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)
         */
        this.radialIntensity = 0;
        /**
         * The normalized direction in which the rgb channels should be separated. If set to 0,0 radial direction will be used. (default: Vector2(0.707,0.707))
         */
        this.direction = new math_vector/* Vector2 */.I9(0.707, 0.707);
        /**
         * The center position where the radialIntensity should be around. [0.5,0.5 is center of screen, 1,1 is top right corner] (default: Vector2(0.5 ,0.5))
         */
        this.centerPosition = new math_vector/* Vector2 */.I9(0.5, 0.5);
        this.screenWidth = screenWidth;
        this.screenHeight = screenHeight;
        this.onApplyObservable.add((effect) => {
            effect.setFloat("chromatic_aberration", this.aberrationAmount);
            effect.setFloat("screen_width", screenWidth);
            effect.setFloat("screen_height", screenHeight);
            effect.setFloat("radialIntensity", this.radialIntensity);
            effect.setFloat2("direction", this.direction.x, this.direction.y);
            effect.setFloat2("centerPosition", this.centerPosition.x, this.centerPosition.y);
        });
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 89619))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 32048))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new ChromaticAberrationPostProcess(parsedPostProcess.name, parsedPostProcess.screenWidth, parsedPostProcess.screenHeight, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType, false);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ChromaticAberrationPostProcess.prototype, "aberrationAmount", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ChromaticAberrationPostProcess.prototype, "radialIntensity", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ChromaticAberrationPostProcess.prototype, "direction", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ChromaticAberrationPostProcess.prototype, "centerPosition", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ChromaticAberrationPostProcess.prototype, "screenWidth", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ChromaticAberrationPostProcess.prototype, "screenHeight", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ChromaticAberrationPostProcess", ChromaticAberrationPostProcess);
//# sourceMappingURL=chromaticAberrationPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/circleOfConfusionPostProcess.js







/**
 * The CircleOfConfusionPostProcess computes the circle of confusion value for each pixel given required lens parameters. See https://en.wikipedia.org/wiki/Circle_of_confusion
 */
class CircleOfConfusionPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.
     */
    get lensSize() {
        return this._effectWrapper.lensSize;
    }
    set lensSize(value) {
        this._effectWrapper.lensSize = value;
    }
    /**
     * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)
     */
    get fStop() {
        return this._effectWrapper.fStop;
    }
    set fStop(value) {
        this._effectWrapper.fStop = value;
    }
    /**
     * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)
     */
    get focusDistance() {
        return this._effectWrapper.focusDistance;
    }
    set focusDistance(value) {
        this._effectWrapper.focusDistance = value;
    }
    /**
     * Focal length of the effect's camera in scene units/1000 (eg. millimeter). (default: 50)
     */
    get focalLength() {
        return this._effectWrapper.focalLength;
    }
    set focalLength(value) {
        this._effectWrapper.focalLength = value;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "CircleOfConfusionPostProcess" string
     */
    getClassName() {
        return "CircleOfConfusionPostProcess";
    }
    /**
     * Creates a new instance CircleOfConfusionPostProcess
     * @param name The name of the effect.
     * @param depthTexture The depth texture of the scene to compute the circle of confusion. This must be set in order for this to function but may be set after initialization if needed.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(name, depthTexture, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        const localOptions = {
            uniforms: ThinCircleOfConfusionPostProcess.Uniforms,
            samplers: ThinCircleOfConfusionPostProcess.Samplers,
            defines: typeof options === "object" && options.depthNotNormalized ? ThinCircleOfConfusionPostProcess.DefinesDepthNotNormalized : undefined,
            size: typeof options === "number" ? options : undefined,
            camera,
            samplingMode,
            engine,
            reusable,
            textureType,
            blockCompilation,
            ...options,
        };
        super(name, ThinCircleOfConfusionPostProcess.FragmentUrl, {
            effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinCircleOfConfusionPostProcess(name, engine, localOptions) : undefined,
            ...localOptions,
        });
        this._depthTexture = null;
        this._depthTexture = depthTexture;
        this.onApplyObservable.add((effect) => {
            if (!this._depthTexture) {
                logger/* Logger */.V.Warn("No depth texture set on CircleOfConfusionPostProcess");
                return;
            }
            effect.setTexture("depthSampler", this._depthTexture);
            this._effectWrapper.camera = this._depthTexture.activeCamera;
        });
    }
    /**
     * Depth texture to be used to compute the circle of confusion. This must be set here or in the constructor in order for the post process to function.
     */
    set depthTexture(value) {
        this._depthTexture = value;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], CircleOfConfusionPostProcess.prototype, "lensSize", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], CircleOfConfusionPostProcess.prototype, "fStop", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], CircleOfConfusionPostProcess.prototype, "focusDistance", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], CircleOfConfusionPostProcess.prototype, "focalLength", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.CircleOfConfusionPostProcess", CircleOfConfusionPostProcess);
//# sourceMappingURL=circleOfConfusionPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/colorCorrectionPostProcess.js






/**
 *
 * This post-process allows the modification of rendered colors by using
 * a 'look-up table' (LUT). This effect is also called Color Grading.
 *
 * The object needs to be provided an url to a texture containing the color
 * look-up table: the texture must be 256 pixels wide and 16 pixels high.
 * Use an image editing software to tweak the LUT to match your needs.
 *
 * For an example of a color LUT, see here:
 * @see http://udn.epicgames.com/Three/rsrc/Three/ColorGrading/RGBTable16x1.png
 * For explanations on color grading, see here:
 * @see http://udn.epicgames.com/Three/ColorGrading.html
 *
 */
class ColorCorrectionPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "ColorCorrectionPostProcess" string
     */
    getClassName() {
        return "ColorCorrectionPostProcess";
    }
    constructor(name, colorTableUrl, options, camera, samplingMode, engine, reusable) {
        super(name, "colorCorrection", null, ["colorTable"], options, camera, samplingMode, engine, reusable);
        const scene = camera?.getScene() || null;
        this._colorTableTexture = new Textures_texture/* Texture */.g(colorTableUrl, scene, true, false, Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE);
        this._colorTableTexture.anisotropicFilteringLevel = 1;
        this._colorTableTexture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._colorTableTexture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this.colorTableUrl = colorTableUrl;
        this.onApply = (effect) => {
            effect.setTexture("colorTable", this._colorTableTexture);
        };
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 53813))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 37670))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new ColorCorrectionPostProcess(parsedPostProcess.name, parsedPostProcess.colorTableUrl, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ColorCorrectionPostProcess.prototype, "colorTableUrl", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ColorCorrectionPostProcess", ColorCorrectionPostProcess);
//# sourceMappingURL=colorCorrectionPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/convolutionPostProcess.js






/**
 * The ConvolutionPostProcess applies a 3x3 kernel to every pixel of the
 * input texture to perform effects such as edge detection or sharpening
 * See http://en.wikipedia.org/wiki/Kernel_(image_processing)
 */
class ConvolutionPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "ConvolutionPostProcess" string
     */
    getClassName() {
        return "ConvolutionPostProcess";
    }
    /**
     * Creates a new instance ConvolutionPostProcess
     * @param name The name of the effect.
     * @param kernel Array of 9 values corresponding to the 3x3 kernel to be applied
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     */
    constructor(name, kernel, options, camera, samplingMode, engine, reusable, textureType = 0) {
        super(name, "convolution", ["kernel", "screenSize"], null, options, camera, samplingMode, engine, reusable, null, textureType);
        this.kernel = kernel;
        this.onApply = (effect) => {
            effect.setFloat2("screenSize", this.width, this.height);
            effect.setArray("kernel", this.kernel);
        };
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 52906))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 51537))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new ConvolutionPostProcess(parsedPostProcess.name, parsedPostProcess.kernel, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType);
        }, parsedPostProcess, scene, rootUrl);
    }
}
// Statics
/**
 * Edge detection 0 see https://en.wikipedia.org/wiki/Kernel_(image_processing)
 */
ConvolutionPostProcess.EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1];
/**
 * Edge detection 1 see https://en.wikipedia.org/wiki/Kernel_(image_processing)
 */
ConvolutionPostProcess.EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0];
/**
 * Edge detection 2 see https://en.wikipedia.org/wiki/Kernel_(image_processing)
 */
ConvolutionPostProcess.EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1];
/**
 * Kernel to sharpen an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)
 */
ConvolutionPostProcess.SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0];
/**
 * Kernel to emboss an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)
 */
ConvolutionPostProcess.EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2];
/**
 * Kernel to blur an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)
 */
ConvolutionPostProcess.GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0];
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ConvolutionPostProcess.prototype, "kernel", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ConvolutionPostProcess", ConvolutionPostProcess);
//# sourceMappingURL=convolutionPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/depthOfFieldBlurPostProcess.js




/**
 * The DepthOfFieldBlurPostProcess applied a blur in a give direction.
 * This blur differs from the standard BlurPostProcess as it attempts to avoid blurring pixels
 * based on samples that have a large difference in distance than the center pixel.
 * See section 2.6.2 http://fileadmin.cs.lth.se/cs/education/edan35/lectures/12dof.pdf
 */
class DepthOfFieldBlurPostProcess extends BlurPostProcess {
    /**
     * Gets a string identifying the name of the class
     * @returns "DepthOfFieldBlurPostProcess" string
     */
    getClassName() {
        return "DepthOfFieldBlurPostProcess";
    }
    /**
     * Creates a new instance DepthOfFieldBlurPostProcess
     * @param name The name of the effect.
     * @param _scene The scene the effect belongs to (not used, you can pass null)
     * @param direction The direction the blur should be applied.
     * @param kernel The size of the kernel used to blur.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param circleOfConfusion The circle of confusion + depth map to be used to avoid blurring across edges
     * @param imageToBlur The image to apply the blur to (default: Current rendered frame)
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)
     */
    constructor(name, _scene, direction, kernel, options, camera, circleOfConfusion, imageToBlur = null, samplingMode = Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, reusable, textureType = 0, blockCompilation = false, textureFormat = 5) {
        super(name, direction, kernel, {
            camera,
            engine,
            reusable,
            textureType,
            defines: `#define DOF 1\n`,
            blockCompilation,
            textureFormat,
            ...options,
            // eslint-disable-next-line @typescript-eslint/no-unused-vars
            samplingMode: (samplingMode = 2),
        });
        this.externalTextureSamplerBinding = !!imageToBlur;
        this.onApplyObservable.add((effect) => {
            if (imageToBlur != null) {
                effect.setTextureFromPostProcess("textureSampler", imageToBlur);
            }
            effect.setTextureFromPostProcessOutput("circleOfConfusionSampler", circleOfConfusion);
        });
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DepthOfFieldBlurPostProcess", DepthOfFieldBlurPostProcess);
//# sourceMappingURL=depthOfFieldBlurPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/depthOfFieldMergePostProcess.js



/**
 * The DepthOfFieldMergePostProcess merges blurred images with the original based on the values of the circle of confusion.
 */
class DepthOfFieldMergePostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "DepthOfFieldMergePostProcess" string
     */
    getClassName() {
        return "DepthOfFieldMergePostProcess";
    }
    /**
     * Creates a new instance of DepthOfFieldMergePostProcess
     * @param name The name of the effect.
     * @param originalFromInput Post process which's input will be used for the merge.
     * @param circleOfConfusion Circle of confusion post process which's output will be used to blur each pixel.
     * @param _blurSteps Blur post processes from low to high which will be mixed with the original image.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(name, originalFromInput, circleOfConfusion, _blurSteps, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        const blockCompilationFinal = typeof options === "number" ? blockCompilation : !!options.blockCompilation;
        const localOptions = {
            samplers: ThinDepthOfFieldMergePostProcess.Samplers,
            size: typeof options === "number" ? options : undefined,
            camera,
            samplingMode,
            engine,
            reusable,
            textureType,
            ...options,
            blockCompilation: true,
        };
        super(name, ThinDepthOfFieldMergePostProcess.FragmentUrl, {
            effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinDepthOfFieldMergePostProcess(name, engine, localOptions) : undefined,
            ...localOptions,
        });
        this._blurSteps = _blurSteps;
        this.externalTextureSamplerBinding = true;
        this.onApplyObservable.add((effect) => {
            effect.setTextureFromPostProcess("textureSampler", originalFromInput);
            effect.setTextureFromPostProcessOutput("circleOfConfusionSampler", circleOfConfusion);
            _blurSteps.forEach((step, index) => {
                effect.setTextureFromPostProcessOutput("blurStep" + (_blurSteps.length - index - 1), step);
            });
        });
        if (!blockCompilationFinal) {
            this.updateEffect();
        }
    }
    /**
     * Updates the effect with the current post process compile time values and recompiles the shader.
     * @param defines Define statements that should be added at the beginning of the shader. (default: null)
     * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)
     * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)
     * @param indexParameters The index parameters to be used for babylons include syntax "#include<kernelBlurVaryingDeclaration>[0..varyingCount]". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx
     * @param onCompiled Called when the shader has been compiled.
     * @param onError Called if there is an error when compiling a shader.
     */
    updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError) {
        if (!defines) {
            defines = "";
            defines += "#define BLUR_LEVEL " + (this._blurSteps.length - 1) + "\n";
        }
        super.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError);
    }
}
//# sourceMappingURL=depthOfFieldMergePostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/depthOfFieldEffect.js







/**
 * Specifies the level of max blur that should be applied when using the depth of field effect
 */
var DepthOfFieldEffectBlurLevel;
(function (DepthOfFieldEffectBlurLevel) {
    /**
     * Subtle blur
     */
    DepthOfFieldEffectBlurLevel[DepthOfFieldEffectBlurLevel["Low"] = 0] = "Low";
    /**
     * Medium blur
     */
    DepthOfFieldEffectBlurLevel[DepthOfFieldEffectBlurLevel["Medium"] = 1] = "Medium";
    /**
     * Large blur
     */
    DepthOfFieldEffectBlurLevel[DepthOfFieldEffectBlurLevel["High"] = 2] = "High";
})(DepthOfFieldEffectBlurLevel || (DepthOfFieldEffectBlurLevel = {}));
/**
 * The depth of field effect applies a blur to objects that are closer or further from where the camera is focusing.
 */
class DepthOfFieldEffect extends PostProcessRenderEffect {
    /**
     * The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)
     */
    set focalLength(value) {
        this._thinDepthOfFieldEffect.focalLength = value;
    }
    get focalLength() {
        return this._thinDepthOfFieldEffect.focalLength;
    }
    /**
     * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)
     */
    set fStop(value) {
        this._thinDepthOfFieldEffect.fStop = value;
    }
    get fStop() {
        return this._thinDepthOfFieldEffect.fStop;
    }
    /**
     * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)
     */
    set focusDistance(value) {
        this._thinDepthOfFieldEffect.focusDistance = value;
    }
    get focusDistance() {
        return this._thinDepthOfFieldEffect.focusDistance;
    }
    /**
     * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.
     */
    set lensSize(value) {
        this._thinDepthOfFieldEffect.lensSize = value;
    }
    get lensSize() {
        return this._thinDepthOfFieldEffect.lensSize;
    }
    /**
     * Creates a new instance DepthOfFieldEffect
     * @param sceneOrEngine The scene or engine the effect belongs to.
     * @param depthTexture The depth texture of the scene to compute the circle of confusion.This must be set in order for this to function but may be set after initialization if needed.
     * @param blurLevel
     * @param pipelineTextureType The type of texture to be used when performing the post processing.
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     * @param depthNotNormalized If the depth from the depth texture is already normalized or if the normalization should be done at runtime in the shader (default: false)
     */
    constructor(sceneOrEngine, depthTexture, blurLevel = 0 /* DepthOfFieldEffectBlurLevel.Low */, pipelineTextureType = 0, blockCompilation = false, depthNotNormalized = false) {
        const engine = sceneOrEngine._renderForCamera ? sceneOrEngine.getEngine() : sceneOrEngine;
        super(engine, "depth of field", () => {
            return this._effects;
        }, true);
        /**
         * @internal Internal post processes in depth of field effect
         */
        this._effects = [];
        this._thinDepthOfFieldEffect = new ThinDepthOfFieldEffect("Depth of Field", engine, blurLevel, false, blockCompilation);
        // Use R-only formats if supported to store the circle of confusion values.
        // This should be more space and bandwidth efficient than using RGBA.
        const circleOfConfusionTextureFormat = engine.isWebGPU || engine.version > 1 ? 6 : 5;
        // Circle of confusion value for each pixel is used to determine how much to blur that pixel
        this._circleOfConfusion = new CircleOfConfusionPostProcess("circleOfConfusion", depthTexture, {
            size: 1,
            samplingMode: Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE,
            engine,
            textureType: pipelineTextureType,
            blockCompilation,
            depthNotNormalized,
            effectWrapper: this._thinDepthOfFieldEffect._circleOfConfusion,
        }, null);
        // Create a pyramid of blurred images (eg. fullSize 1/4 blur, half size 1/2 blur, quarter size 3/4 blur, eith size 4/4 blur)
        // Blur the image but do not blur on sharp far to near distance changes to avoid bleeding artifacts
        // See section 2.6.2 http://fileadmin.cs.lth.se/cs/education/edan35/lectures/12dof.pdf
        this._depthOfFieldBlurY = [];
        this._depthOfFieldBlurX = [];
        const blurCount = this._thinDepthOfFieldEffect._depthOfFieldBlurX.length;
        for (let i = 0; i < blurCount; i++) {
            const [thinBlurY, ratioY] = this._thinDepthOfFieldEffect._depthOfFieldBlurY[i];
            const blurY = new DepthOfFieldBlurPostProcess("vertical blur", null, thinBlurY.direction, thinBlurY.kernel, {
                size: ratioY,
                samplingMode: Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE,
                engine,
                textureType: pipelineTextureType,
                blockCompilation,
                textureFormat: i == 0 ? circleOfConfusionTextureFormat : 5,
                effectWrapper: thinBlurY,
            }, null, this._circleOfConfusion, i == 0 ? this._circleOfConfusion : null);
            blurY.autoClear = false;
            const [thinBlurX, ratioX] = this._thinDepthOfFieldEffect._depthOfFieldBlurX[i];
            const blurX = new DepthOfFieldBlurPostProcess("horizontal blur", null, thinBlurX.direction, thinBlurX.kernel, {
                size: ratioX,
                samplingMode: Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE,
                engine,
                textureType: pipelineTextureType,
                blockCompilation,
                effectWrapper: thinBlurX,
            }, null, this._circleOfConfusion, null);
            blurX.autoClear = false;
            this._depthOfFieldBlurY.push(blurY);
            this._depthOfFieldBlurX.push(blurX);
        }
        // Set all post processes on the effect.
        this._effects = [this._circleOfConfusion];
        for (let i = 0; i < this._depthOfFieldBlurX.length; i++) {
            this._effects.push(this._depthOfFieldBlurY[i]);
            this._effects.push(this._depthOfFieldBlurX[i]);
        }
        // Merge blurred images with original image based on circleOfConfusion
        this._dofMerge = new DepthOfFieldMergePostProcess("dofMerge", this._circleOfConfusion, this._circleOfConfusion, this._depthOfFieldBlurX, {
            size: this._thinDepthOfFieldEffect._depthOfFieldBlurX[blurCount - 1][1],
            samplingMode: Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE,
            engine,
            textureType: pipelineTextureType,
            blockCompilation,
            effectWrapper: this._thinDepthOfFieldEffect._dofMerge,
        }, null);
        this._dofMerge.autoClear = false;
        this._effects.push(this._dofMerge);
    }
    /**
     * Get the current class name of the current effect
     * @returns "DepthOfFieldEffect"
     */
    getClassName() {
        return "DepthOfFieldEffect";
    }
    /**
     * Depth texture to be used to compute the circle of confusion. This must be set here or in the constructor in order for the post process to function.
     */
    set depthTexture(value) {
        this._circleOfConfusion.depthTexture = value;
    }
    /**
     * Disposes each of the internal effects for a given camera.
     * @param camera The camera to dispose the effect on.
     */
    disposeEffects(camera) {
        for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {
            this._effects[effectIndex].dispose(camera);
        }
    }
    /**
     * @internal Internal
     */
    _updateEffects() {
        for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {
            this._effects[effectIndex].updateEffect();
        }
    }
    /**
     * Internal
     * @returns if all the contained post processes are ready.
     * @internal
     */
    _isReady() {
        return this._thinDepthOfFieldEffect.isReady();
    }
}
//# sourceMappingURL=depthOfFieldEffect.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/displayPassPostProcess.js



/**
 * DisplayPassPostProcess which produces an output the same as it's input
 */
class DisplayPassPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "DisplayPassPostProcess" string
     */
    getClassName() {
        return "DisplayPassPostProcess";
    }
    /**
     * Creates the DisplayPassPostProcess
     * @param name The name of the effect.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     */
    constructor(name, options, camera, samplingMode, engine, reusable) {
        super(name, "displayPass", ["passSampler"], ["passSampler"], options, camera, samplingMode, engine, reusable);
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 54069))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 73718))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new DisplayPassPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DisplayPassPostProcess", DisplayPassPostProcess);
//# sourceMappingURL=displayPassPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/filterPostProcess.js





/**
 * Applies a kernel filter to the image
 */
class FilterPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "FilterPostProcess" string
     */
    getClassName() {
        return "FilterPostProcess";
    }
    /**
     *
     * @param name The name of the effect.
     * @param kernelMatrix The matrix to be applied to the image
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     */
    constructor(name, kernelMatrix, options, camera, samplingMode, engine, reusable) {
        super(name, "filter", ["kernelMatrix"], null, options, camera, samplingMode, engine, reusable);
        this.kernelMatrix = kernelMatrix;
        this.onApply = (effect) => {
            effect.setMatrix("kernelMatrix", this.kernelMatrix);
        };
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 57912))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 97961))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new FilterPostProcess(parsedPostProcess.name, parsedPostProcess.kernelMatrix, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsMatrix */.GG)()
], FilterPostProcess.prototype, "kernelMatrix", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.FilterPostProcess", FilterPostProcess);
//# sourceMappingURL=filterPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/grainPostProcess.js






/**
 * The GrainPostProcess adds noise to the image at mid luminance levels
 */
class GrainPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "GrainPostProcess" string
     */
    getClassName() {
        return "GrainPostProcess";
    }
    /**
     * Creates a new instance of @see GrainPostProcess
     * @param name The name of the effect.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        super(name, "grain", ["intensity", "animatedSeed"], [], options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);
        /**
         * The intensity of the grain added (default: 30)
         */
        this.intensity = 30;
        /**
         * If the grain should be randomized on every frame
         */
        this.animated = false;
        this.onApplyObservable.add((effect) => {
            effect.setFloat("intensity", this.intensity);
            effect.setFloat("animatedSeed", this.animated ? Math.random() + 1 : 1);
        });
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 68625))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 50890))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new GrainPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], GrainPostProcess.prototype, "intensity", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], GrainPostProcess.prototype, "animated", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.GrainPostProcess", GrainPostProcess);
//# sourceMappingURL=grainPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/highlightsPostProcess.js


/**
 * Extracts highlights from the image
 * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses
 */
class HighlightsPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "HighlightsPostProcess" string
     */
    getClassName() {
        return "HighlightsPostProcess";
    }
    /**
     * Extracts highlights from the image
     * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses
     * @param name The name of the effect.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of texture for the post process (default: Engine.TEXTURETYPE_UNSIGNED_BYTE)
     */
    constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0) {
        super(name, "highlights", null, null, options, camera, samplingMode, engine, reusable, null, textureType);
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 80265))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 96920))]));
        }
        super._gatherImports(useWebGPU, list);
    }
}
//# sourceMappingURL=highlightsPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/imageProcessingPostProcess.js






/**
 * ImageProcessingPostProcess
 * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#imageprocessing
 */
class ImageProcessingPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets the image processing configuration used either in this material.
     */
    get imageProcessingConfiguration() {
        return this._imageProcessingConfiguration;
    }
    /**
     * Sets the Default image processing configuration used either in the this material.
     *
     * If sets to null, the scene one is in use.
     */
    set imageProcessingConfiguration(value) {
        // We are almost sure it is applied by post process as
        // We are in the post process :-)
        value.applyByPostProcess = true;
        this._attachImageProcessingConfiguration(value);
    }
    /**
     * Attaches a new image processing configuration to the PBR Material.
     * @param configuration
     * @param doNotBuild
     */
    _attachImageProcessingConfiguration(configuration, doNotBuild = false) {
        if (configuration === this._imageProcessingConfiguration) {
            return;
        }
        // Detaches observer.
        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
        }
        // Pick the scene configuration if needed.
        if (!configuration) {
            let scene = null;
            const engine = this.getEngine();
            const camera = this.getCamera();
            if (camera) {
                scene = camera.getScene();
            }
            else if (engine && engine.scenes) {
                const scenes = engine.scenes;
                scene = scenes[scenes.length - 1];
            }
            else {
                scene = engineStore/* EngineStore */.q.LastCreatedScene;
            }
            if (scene) {
                this._imageProcessingConfiguration = scene.imageProcessingConfiguration;
            }
            else {
                this._imageProcessingConfiguration = new Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p();
            }
        }
        else {
            this._imageProcessingConfiguration = configuration;
        }
        // Attaches observer.
        if (this._imageProcessingConfiguration) {
            this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
                this._updateParameters();
            });
        }
        // Ensure the effect will be rebuilt.
        if (!doNotBuild) {
            this._updateParameters();
        }
    }
    /**
     * If the post process is supported.
     */
    get isSupported() {
        const effect = this.getEffect();
        return !effect || effect.isSupported;
    }
    /**
     * Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .
     */
    get colorCurves() {
        return this.imageProcessingConfiguration.colorCurves;
    }
    /**
     * Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .
     */
    set colorCurves(value) {
        this.imageProcessingConfiguration.colorCurves = value;
    }
    /**
     * Gets whether the color curves effect is enabled.
     */
    get colorCurvesEnabled() {
        return this.imageProcessingConfiguration.colorCurvesEnabled;
    }
    /**
     * Sets whether the color curves effect is enabled.
     */
    set colorCurvesEnabled(value) {
        this.imageProcessingConfiguration.colorCurvesEnabled = value;
    }
    /**
     * Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.
     */
    get colorGradingTexture() {
        return this.imageProcessingConfiguration.colorGradingTexture;
    }
    /**
     * Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.
     */
    set colorGradingTexture(value) {
        this.imageProcessingConfiguration.colorGradingTexture = value;
    }
    /**
     * Gets whether the color grading effect is enabled.
     */
    get colorGradingEnabled() {
        return this.imageProcessingConfiguration.colorGradingEnabled;
    }
    /**
     * Gets whether the color grading effect is enabled.
     */
    set colorGradingEnabled(value) {
        this.imageProcessingConfiguration.colorGradingEnabled = value;
    }
    /**
     * Gets exposure used in the effect.
     */
    get exposure() {
        return this.imageProcessingConfiguration.exposure;
    }
    /**
     * Sets exposure used in the effect.
     */
    set exposure(value) {
        this.imageProcessingConfiguration.exposure = value;
    }
    /**
     * Gets whether tonemapping is enabled or not.
     */
    get toneMappingEnabled() {
        return this._imageProcessingConfiguration.toneMappingEnabled;
    }
    /**
     * Sets whether tonemapping is enabled or not
     */
    set toneMappingEnabled(value) {
        this._imageProcessingConfiguration.toneMappingEnabled = value;
    }
    /**
     * Gets the type of tone mapping effect.
     */
    get toneMappingType() {
        return this._imageProcessingConfiguration.toneMappingType;
    }
    /**
     * Sets the type of tone mapping effect.
     */
    set toneMappingType(value) {
        this._imageProcessingConfiguration.toneMappingType = value;
    }
    /**
     * Gets contrast used in the effect.
     */
    get contrast() {
        return this.imageProcessingConfiguration.contrast;
    }
    /**
     * Sets contrast used in the effect.
     */
    set contrast(value) {
        this.imageProcessingConfiguration.contrast = value;
    }
    /**
     * Gets Vignette stretch size.
     */
    get vignetteStretch() {
        return this.imageProcessingConfiguration.vignetteStretch;
    }
    /**
     * Sets Vignette stretch size.
     */
    set vignetteStretch(value) {
        this.imageProcessingConfiguration.vignetteStretch = value;
    }
    /**
     * Gets Vignette center X Offset.
     * @deprecated use vignetteCenterX instead
     */
    get vignetteCentreX() {
        return this.imageProcessingConfiguration.vignetteCenterX;
    }
    /**
     * Sets Vignette center X Offset.
     * @deprecated use vignetteCenterX instead
     */
    set vignetteCentreX(value) {
        this.imageProcessingConfiguration.vignetteCenterX = value;
    }
    /**
     * Gets Vignette center Y Offset.
     * @deprecated use vignetteCenterY instead
     */
    get vignetteCentreY() {
        return this.imageProcessingConfiguration.vignetteCenterY;
    }
    /**
     * Sets Vignette center Y Offset.
     * @deprecated use vignetteCenterY instead
     */
    set vignetteCentreY(value) {
        this.imageProcessingConfiguration.vignetteCenterY = value;
    }
    /**
     * Vignette center Y Offset.
     */
    get vignetteCenterY() {
        return this.imageProcessingConfiguration.vignetteCenterY;
    }
    set vignetteCenterY(value) {
        this.imageProcessingConfiguration.vignetteCenterY = value;
    }
    /**
     * Vignette center X Offset.
     */
    get vignetteCenterX() {
        return this.imageProcessingConfiguration.vignetteCenterX;
    }
    set vignetteCenterX(value) {
        this.imageProcessingConfiguration.vignetteCenterX = value;
    }
    /**
     * Gets Vignette weight or intensity of the vignette effect.
     */
    get vignetteWeight() {
        return this.imageProcessingConfiguration.vignetteWeight;
    }
    /**
     * Sets Vignette weight or intensity of the vignette effect.
     */
    set vignetteWeight(value) {
        this.imageProcessingConfiguration.vignetteWeight = value;
    }
    /**
     * Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)
     * if vignetteEnabled is set to true.
     */
    get vignetteColor() {
        return this.imageProcessingConfiguration.vignetteColor;
    }
    /**
     * Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)
     * if vignetteEnabled is set to true.
     */
    set vignetteColor(value) {
        this.imageProcessingConfiguration.vignetteColor = value;
    }
    /**
     * Gets Camera field of view used by the Vignette effect.
     */
    get vignetteCameraFov() {
        return this.imageProcessingConfiguration.vignetteCameraFov;
    }
    /**
     * Sets Camera field of view used by the Vignette effect.
     */
    set vignetteCameraFov(value) {
        this.imageProcessingConfiguration.vignetteCameraFov = value;
    }
    /**
     * Gets the vignette blend mode allowing different kind of effect.
     */
    get vignetteBlendMode() {
        return this.imageProcessingConfiguration.vignetteBlendMode;
    }
    /**
     * Sets the vignette blend mode allowing different kind of effect.
     */
    set vignetteBlendMode(value) {
        this.imageProcessingConfiguration.vignetteBlendMode = value;
    }
    /**
     * Gets whether the vignette effect is enabled.
     */
    get vignetteEnabled() {
        return this.imageProcessingConfiguration.vignetteEnabled;
    }
    /**
     * Sets whether the vignette effect is enabled.
     */
    set vignetteEnabled(value) {
        this.imageProcessingConfiguration.vignetteEnabled = value;
    }
    /**
     * Gets intensity of the dithering effect.
     */
    get ditheringIntensity() {
        return this.imageProcessingConfiguration.ditheringIntensity;
    }
    /**
     * Sets intensity of the dithering effect.
     */
    set ditheringIntensity(value) {
        this.imageProcessingConfiguration.ditheringIntensity = value;
    }
    /**
     * Gets whether the dithering effect is enabled.
     */
    get ditheringEnabled() {
        return this.imageProcessingConfiguration.ditheringEnabled;
    }
    /**
     * Sets whether the dithering effect is enabled.
     */
    set ditheringEnabled(value) {
        this.imageProcessingConfiguration.ditheringEnabled = value;
    }
    /**
     * Gets whether the input of the processing is in Gamma or Linear Space.
     */
    get fromLinearSpace() {
        return this._fromLinearSpace;
    }
    /**
     * Sets whether the input of the processing is in Gamma or Linear Space.
     */
    set fromLinearSpace(value) {
        if (this._fromLinearSpace === value) {
            return;
        }
        this._fromLinearSpace = value;
        this._updateParameters();
    }
    constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, imageProcessingConfiguration) {
        super(name, "imageProcessing", [], [], options, camera, samplingMode, engine, reusable, null, textureType, "postprocess", null, true);
        this._fromLinearSpace = true;
        /**
         * Defines cache preventing GC.
         */
        this._defines = {
            IMAGEPROCESSING: false,
            VIGNETTE: false,
            VIGNETTEBLENDMODEMULTIPLY: false,
            VIGNETTEBLENDMODEOPAQUE: false,
            TONEMAPPING: 0,
            CONTRAST: false,
            COLORCURVES: false,
            COLORGRADING: false,
            COLORGRADING3D: false,
            FROMLINEARSPACE: false,
            SAMPLER3DGREENDEPTH: false,
            SAMPLER3DBGRMAP: false,
            DITHER: false,
            IMAGEPROCESSINGPOSTPROCESS: false,
            EXPOSURE: false,
            SKIPFINALCOLORCLAMP: false,
        };
        // Setup the configuration as forced by the constructor. This would then not force the
        // scene materials output in linear space and let untouched the default forward pass.
        if (imageProcessingConfiguration) {
            imageProcessingConfiguration.applyByPostProcess = true;
            this._attachImageProcessingConfiguration(imageProcessingConfiguration, true);
            // This will cause the shader to be compiled
            this._updateParameters();
        }
        // Setup the default processing configuration to the scene.
        else {
            this._attachImageProcessingConfiguration(null, true);
            this.imageProcessingConfiguration.applyByPostProcess = true;
        }
        this.onApply = (effect) => {
            this.imageProcessingConfiguration.bind(effect, this.aspectRatio);
        };
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 37614)));
        }
        else {
            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 83153)));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     *  "ImageProcessingPostProcess"
     * @returns "ImageProcessingPostProcess"
     */
    getClassName() {
        return "ImageProcessingPostProcess";
    }
    /**
     * @internal
     */
    _updateParameters() {
        this._defines.FROMLINEARSPACE = this._fromLinearSpace;
        this.imageProcessingConfiguration.prepareDefines(this._defines, true);
        let defines = "";
        for (const prop in this._defines) {
            const value = this._defines[prop];
            const type = typeof value;
            switch (type) {
                case "number":
                case "string":
                    defines += `#define ${prop} ${value};\n`;
                    break;
                default:
                    if (value) {
                        defines += `#define ${prop};\n`;
                    }
                    break;
            }
        }
        const samplers = ["textureSampler"];
        const uniforms = ["scale"];
        if (Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p) {
            Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p.PrepareSamplers(samplers, this._defines);
            Materials_imageProcessingConfiguration/* ImageProcessingConfiguration */.p.PrepareUniforms(uniforms, this._defines);
        }
        this.updateEffect(defines, uniforms, samplers);
    }
    dispose(camera) {
        super.dispose(camera);
        if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
            this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
        }
        if (this._imageProcessingConfiguration) {
            this.imageProcessingConfiguration.applyByPostProcess = false;
        }
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ImageProcessingPostProcess.prototype, "_fromLinearSpace", void 0);
//# sourceMappingURL=imageProcessingPostProcess.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/geometry.fragment.js + 1 modules
var geometry_fragment = __webpack_require__(75007);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/geometry.vertex.js + 2 modules
var geometry_vertex = __webpack_require__(6739);
;// ./node_modules/@babylonjs/core/Rendering/geometryBufferRenderer.js














/** list the uniforms used by the geometry renderer */
const uniforms = [
    "world",
    "mBones",
    "viewProjection",
    "diffuseMatrix",
    "view",
    "previousWorld",
    "previousViewProjection",
    "mPreviousBones",
    "bumpMatrix",
    "reflectivityMatrix",
    "albedoMatrix",
    "reflectivityColor",
    "albedoColor",
    "metallic",
    "glossiness",
    "vTangentSpaceParams",
    "vBumpInfos",
    "morphTargetInfluences",
    "morphTargetCount",
    "morphTargetTextureInfo",
    "morphTargetTextureIndices",
    "boneTextureWidth",
];
(0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.TV)(uniforms);
/**
 * This renderer is helpful to fill one of the render target with a geometry buffer.
 */
class GeometryBufferRenderer {
    /**
     * Gets a boolean indicating if normals are encoded in the [0,1] range in the render target. If true, you should do `normal = normal_rt * 2.0 - 1.0` to get the right normal
     */
    get normalsAreUnsigned() {
        return this._normalsAreUnsigned;
    }
    /**
     * @internal
     * Sets up internal structures to share outputs with PrePassRenderer
     * This method should only be called by the PrePassRenderer itself
     */
    _linkPrePassRenderer(prePassRenderer) {
        this._linkedWithPrePass = true;
        this._prePassRenderer = prePassRenderer;
        if (this._multiRenderTarget) {
            // prevents clearing of the RT since it's done by prepass
            this._multiRenderTarget.onClearObservable.clear();
            this._multiRenderTarget.onClearObservable.add(() => {
                // pass
            });
        }
    }
    /**
     * @internal
     * Separates internal structures from PrePassRenderer so the geometry buffer can now operate by itself.
     * This method should only be called by the PrePassRenderer itself
     */
    _unlinkPrePassRenderer() {
        this._linkedWithPrePass = false;
        this._createRenderTargets();
    }
    /**
     * @internal
     * Resets the geometry buffer layout
     */
    _resetLayout() {
        this._enableDepth = true;
        this._enableNormal = true;
        this._enablePosition = false;
        this._enableReflectivity = false;
        this._enableVelocity = false;
        this._enableVelocityLinear = false;
        this._enableScreenspaceDepth = false;
        this._attachmentsFromPrePass = [];
    }
    /**
     * @internal
     * Replaces a texture in the geometry buffer renderer
     * Useful when linking textures of the prepass renderer
     */
    _forceTextureType(geometryBufferType, index) {
        if (geometryBufferType === GeometryBufferRenderer.POSITION_TEXTURE_TYPE) {
            this._positionIndex = index;
            this._enablePosition = true;
        }
        else if (geometryBufferType === GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE) {
            this._velocityIndex = index;
            this._enableVelocity = true;
        }
        else if (geometryBufferType === GeometryBufferRenderer.VELOCITY_LINEAR_TEXTURE_TYPE) {
            this._velocityLinearIndex = index;
            this._enableVelocityLinear = true;
        }
        else if (geometryBufferType === GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE) {
            this._reflectivityIndex = index;
            this._enableReflectivity = true;
        }
        else if (geometryBufferType === GeometryBufferRenderer.DEPTH_TEXTURE_TYPE) {
            this._depthIndex = index;
            this._enableDepth = true;
        }
        else if (geometryBufferType === GeometryBufferRenderer.NORMAL_TEXTURE_TYPE) {
            this._normalIndex = index;
            this._enableNormal = true;
        }
        else if (geometryBufferType === GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE) {
            this._screenspaceDepthIndex = index;
            this._enableScreenspaceDepth = true;
        }
    }
    /**
     * @internal
     * Sets texture attachments
     * Useful when linking textures of the prepass renderer
     */
    _setAttachments(attachments) {
        this._attachmentsFromPrePass = attachments;
    }
    /**
     * @internal
     * Replaces the first texture which is hard coded as a depth texture in the geometry buffer
     * Useful when linking textures of the prepass renderer
     */
    _linkInternalTexture(internalTexture) {
        this._multiRenderTarget.setInternalTexture(internalTexture, 0, false);
    }
    /**
     * Gets the render list (meshes to be rendered) used in the G buffer.
     */
    get renderList() {
        return this._multiRenderTarget.renderList;
    }
    /**
     * Set the render list (meshes to be rendered) used in the G buffer.
     */
    set renderList(meshes) {
        this._multiRenderTarget.renderList = meshes;
    }
    /**
     * Gets whether or not G buffer are supported by the running hardware.
     * This requires draw buffer supports
     */
    get isSupported() {
        return this._multiRenderTarget.isSupported;
    }
    /**
     * Returns the index of the given texture type in the G-Buffer textures array
     * @param textureType The texture type constant. For example GeometryBufferRenderer.POSITION_TEXTURE_INDEX
     * @returns the index of the given texture type in the G-Buffer textures array
     */
    getTextureIndex(textureType) {
        switch (textureType) {
            case GeometryBufferRenderer.POSITION_TEXTURE_TYPE:
                return this._positionIndex;
            case GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE:
                return this._velocityIndex;
            case GeometryBufferRenderer.VELOCITY_LINEAR_TEXTURE_TYPE:
                return this._velocityLinearIndex;
            case GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE:
                return this._reflectivityIndex;
            case GeometryBufferRenderer.DEPTH_TEXTURE_TYPE:
                return this._depthIndex;
            case GeometryBufferRenderer.NORMAL_TEXTURE_TYPE:
                return this._normalIndex;
            case GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE:
                return this._screenspaceDepthIndex;
            default:
                return -1;
        }
    }
    /**
     * @returns a boolean indicating if object's depths are enabled for the G buffer.
     */
    get enableDepth() {
        return this._enableDepth;
    }
    /**
     * Sets whether or not object's depths are enabled for the G buffer.
     */
    set enableDepth(enable) {
        this._enableDepth = enable;
        if (!this._linkedWithPrePass) {
            this.dispose();
            this._createRenderTargets();
        }
    }
    /**
     * @returns a boolean indicating if object's normals are enabled for the G buffer.
     */
    get enableNormal() {
        return this._enableNormal;
    }
    /**
     * Sets whether or not object's normals are enabled for the G buffer.
     */
    set enableNormal(enable) {
        this._enableNormal = enable;
        if (!this._linkedWithPrePass) {
            this.dispose();
            this._createRenderTargets();
        }
    }
    /**
     * @returns a boolean indicating if objects positions are enabled for the G buffer.
     */
    get enablePosition() {
        return this._enablePosition;
    }
    /**
     * Sets whether or not objects positions are enabled for the G buffer.
     */
    set enablePosition(enable) {
        this._enablePosition = enable;
        // PrePass handles index and texture links
        if (!this._linkedWithPrePass) {
            this.dispose();
            this._createRenderTargets();
        }
    }
    /**
     * @returns a boolean indicating if objects velocities are enabled for the G buffer.
     */
    get enableVelocity() {
        return this._enableVelocity;
    }
    /**
     * Sets whether or not objects velocities are enabled for the G buffer.
     */
    set enableVelocity(enable) {
        this._enableVelocity = enable;
        if (!enable) {
            this._previousTransformationMatrices = {};
        }
        if (!this._linkedWithPrePass) {
            this.dispose();
            this._createRenderTargets();
        }
        this._scene.needsPreviousWorldMatrices = enable;
    }
    /**
     * @returns a boolean indicating if object's linear velocities are enabled for the G buffer.
     */
    get enableVelocityLinear() {
        return this._enableVelocityLinear;
    }
    /**
     * Sets whether or not object's linear velocities are enabled for the G buffer.
     */
    set enableVelocityLinear(enable) {
        this._enableVelocityLinear = enable;
        if (!this._linkedWithPrePass) {
            this.dispose();
            this._createRenderTargets();
        }
    }
    /**
     * Gets a boolean indicating if objects reflectivity are enabled in the G buffer.
     */
    get enableReflectivity() {
        return this._enableReflectivity;
    }
    /**
     * Sets whether or not objects reflectivity are enabled for the G buffer.
     * For Metallic-Roughness workflow with ORM texture, we assume that ORM texture is defined according to the default layout:
     * pbr.useRoughnessFromMetallicTextureAlpha = false;
     * pbr.useRoughnessFromMetallicTextureGreen = true;
     * pbr.useMetallnessFromMetallicTextureBlue = true;
     */
    set enableReflectivity(enable) {
        this._enableReflectivity = enable;
        if (!this._linkedWithPrePass) {
            this.dispose();
            this._createRenderTargets();
        }
    }
    /**
     * Sets whether or not objects screenspace depth are enabled for the G buffer.
     */
    get enableScreenspaceDepth() {
        return this._enableScreenspaceDepth;
    }
    set enableScreenspaceDepth(enable) {
        this._enableScreenspaceDepth = enable;
        if (!this._linkedWithPrePass) {
            this.dispose();
            this._createRenderTargets();
        }
    }
    /**
     * Gets the scene associated with the buffer.
     */
    get scene() {
        return this._scene;
    }
    /**
     * Gets the ratio used by the buffer during its creation.
     * How big is the buffer related to the main canvas.
     */
    get ratio() {
        return typeof this._ratioOrDimensions === "object" ? 1 : this._ratioOrDimensions;
    }
    /**
     * Gets the shader language used in this material.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Creates a new G Buffer for the scene
     * @param scene The scene the buffer belongs to
     * @param ratioOrDimensions How big is the buffer related to the main canvas (default: 1). You can also directly pass a width and height for the generated textures
     * @param depthFormat Format of the depth texture (default: 15)
     * @param textureTypesAndFormats The types and formats of textures to create as render targets. If not provided, all textures will be RGBA and float or half float, depending on the engine capabilities.
     */
    constructor(scene, ratioOrDimensions = 1, depthFormat = 15, textureTypesAndFormats) {
        /**
         * Dictionary used to store the previous transformation matrices of each rendered mesh
         * in order to compute objects velocities when enableVelocity is set to "true"
         * @internal
         */
        this._previousTransformationMatrices = {};
        /**
         * Dictionary used to store the previous bones transformation matrices of each rendered mesh
         * in order to compute objects velocities when enableVelocity is set to "true"
         * @internal
         */
        this._previousBonesTransformationMatrices = {};
        /**
         * Array used to store the ignored skinned meshes while computing velocity map (typically used by the motion blur post-process).
         * Avoids computing bones velocities and computes only mesh's velocity itself (position, rotation, scaling).
         */
        this.excludedSkinnedMeshesFromVelocity = [];
        /** Gets or sets a boolean indicating if transparent meshes should be rendered */
        this.renderTransparentMeshes = true;
        /**
         * Gets or sets a boolean indicating if normals should be generated in world space (default: false, meaning normals are generated in view space)
         */
        this.generateNormalsInWorldSpace = false;
        this._normalsAreUnsigned = false;
        this._resizeObserver = null;
        this._enableDepth = true;
        this._enableNormal = true;
        this._enablePosition = false;
        this._enableVelocity = false;
        this._enableVelocityLinear = false;
        this._enableReflectivity = false;
        this._enableScreenspaceDepth = false;
        this._clearColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
        this._clearDepthColor = new math_color/* Color4 */.ov(1e8, 0, 0, 1); // "infinity" value - depth in the depth texture is view.z, not a 0..1 value!
        this._positionIndex = -1;
        this._velocityIndex = -1;
        this._velocityLinearIndex = -1;
        this._reflectivityIndex = -1;
        this._depthIndex = -1;
        this._normalIndex = -1;
        this._screenspaceDepthIndex = -1;
        this._linkedWithPrePass = false;
        /**
         * If set to true (default: false), the depth texture will be cleared with the depth value corresponding to the far plane (1 in normal mode, 0 in reverse depth buffer mode)
         * If set to false, the depth texture is always cleared with 0.
         */
        this.useSpecificClearForDepthTexture = false;
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._shadersLoaded = false;
        this._scene = scene;
        this._ratioOrDimensions = ratioOrDimensions;
        this._useUbo = scene.getEngine().supportsUniformBuffers;
        this._depthFormat = depthFormat;
        this._textureTypesAndFormats = textureTypesAndFormats || {};
        this._initShaderSourceAsync();
        GeometryBufferRenderer._SceneComponentInitialization(this._scene);
        // Render target
        this._createRenderTargets();
    }
    async _initShaderSourceAsync() {
        const engine = this._scene.getEngine();
        if (engine.isWebGPU && !GeometryBufferRenderer.ForceGLSL) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 2564)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 38574))]);
        }
        else {
            await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 6739)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 75007))]);
        }
        this._shadersLoaded = true;
    }
    /**
     * Checks whether everything is ready to render a submesh to the G buffer.
     * @param subMesh the submesh to check readiness for
     * @param useInstances is the mesh drawn using instance or not
     * @returns true if ready otherwise false
     */
    isReady(subMesh, useInstances) {
        if (!this._shadersLoaded) {
            return false;
        }
        const material = subMesh.getMaterial();
        if (material && material.disableDepthWrite) {
            return false;
        }
        const defines = [];
        const attribs = [Buffers_buffer/* VertexBuffer */.R.PositionKind, Buffers_buffer/* VertexBuffer */.R.NormalKind];
        const mesh = subMesh.getMesh();
        if (material) {
            let needUv = false;
            // Alpha test
            if (material.needAlphaTesting() && material.getAlphaTestTexture()) {
                defines.push("#define ALPHATEST");
                defines.push(`#define ALPHATEST_UV${material.getAlphaTestTexture().coordinatesIndex + 1}`);
                needUv = true;
            }
            // Normal map texture
            if ((material.bumpTexture || material.normalTexture) && materialFlags/* MaterialFlags */.h.BumpTextureEnabled) {
                const texture = material.bumpTexture || material.normalTexture;
                defines.push("#define BUMP");
                defines.push(`#define BUMP_UV${texture.coordinatesIndex + 1}`);
                needUv = true;
            }
            if (this._enableReflectivity) {
                let metallicWorkflow = false;
                // for PBR materials: cf. https://doc.babylonjs.com/features/featuresDeepDive/materials/using/masterPBR
                if (material.getClassName() === "PBRMetallicRoughnessMaterial") {
                    // if it is a PBR material in MetallicRoughness Mode:
                    if (material.metallicRoughnessTexture) {
                        defines.push("#define ORMTEXTURE");
                        defines.push(`#define REFLECTIVITY_UV${material.metallicRoughnessTexture.coordinatesIndex + 1}`);
                        defines.push("#define METALLICWORKFLOW");
                        needUv = true;
                        metallicWorkflow = true;
                    }
                    // null or undefined
                    if (material.metallic != null) {
                        defines.push("#define METALLIC");
                        defines.push("#define METALLICWORKFLOW");
                        metallicWorkflow = true;
                    }
                    // null or undefined
                    if (material.roughness != null) {
                        defines.push("#define ROUGHNESS");
                        defines.push("#define METALLICWORKFLOW");
                        metallicWorkflow = true;
                    }
                    if (metallicWorkflow) {
                        if (material.baseTexture) {
                            defines.push("#define ALBEDOTEXTURE");
                            defines.push(`#define ALBEDO_UV${material.baseTexture.coordinatesIndex + 1}`);
                            if (material.baseTexture.gammaSpace) {
                                defines.push("#define GAMMAALBEDO");
                            }
                            needUv = true;
                        }
                        if (material.baseColor) {
                            defines.push("#define ALBEDOCOLOR");
                        }
                    }
                }
                else if (material.getClassName() === "PBRSpecularGlossinessMaterial") {
                    // if it is a PBR material in Specular/Glossiness Mode:
                    if (material.specularGlossinessTexture) {
                        defines.push("#define SPECULARGLOSSINESSTEXTURE");
                        defines.push(`#define REFLECTIVITY_UV${material.specularGlossinessTexture.coordinatesIndex + 1}`);
                        needUv = true;
                        if (material.specularGlossinessTexture.gammaSpace) {
                            defines.push("#define GAMMAREFLECTIVITYTEXTURE");
                        }
                    }
                    else {
                        if (material.specularColor) {
                            defines.push("#define REFLECTIVITYCOLOR");
                        }
                    }
                    // null or undefined
                    if (material.glossiness != null) {
                        defines.push("#define GLOSSINESS");
                    }
                }
                else if (material.getClassName() === "PBRMaterial") {
                    // if it is the bigger PBRMaterial
                    if (material.metallicTexture) {
                        defines.push("#define ORMTEXTURE");
                        defines.push(`#define REFLECTIVITY_UV${material.metallicTexture.coordinatesIndex + 1}`);
                        defines.push("#define METALLICWORKFLOW");
                        needUv = true;
                        metallicWorkflow = true;
                    }
                    // null or undefined
                    if (material.metallic != null) {
                        defines.push("#define METALLIC");
                        defines.push("#define METALLICWORKFLOW");
                        metallicWorkflow = true;
                    }
                    // null or undefined
                    if (material.roughness != null) {
                        defines.push("#define ROUGHNESS");
                        defines.push("#define METALLICWORKFLOW");
                        metallicWorkflow = true;
                    }
                    if (metallicWorkflow) {
                        if (material.albedoTexture) {
                            defines.push("#define ALBEDOTEXTURE");
                            defines.push(`#define ALBEDO_UV${material.albedoTexture.coordinatesIndex + 1}`);
                            if (material.albedoTexture.gammaSpace) {
                                defines.push("#define GAMMAALBEDO");
                            }
                            needUv = true;
                        }
                        if (material.albedoColor) {
                            defines.push("#define ALBEDOCOLOR");
                        }
                    }
                    else {
                        // SpecularGlossiness Model
                        if (material.reflectivityTexture) {
                            defines.push("#define SPECULARGLOSSINESSTEXTURE");
                            defines.push(`#define REFLECTIVITY_UV${material.reflectivityTexture.coordinatesIndex + 1}`);
                            if (material.reflectivityTexture.gammaSpace) {
                                defines.push("#define GAMMAREFLECTIVITYTEXTURE");
                            }
                            needUv = true;
                        }
                        else if (material.reflectivityColor) {
                            defines.push("#define REFLECTIVITYCOLOR");
                        }
                        // null or undefined
                        if (material.microSurface != null) {
                            defines.push("#define GLOSSINESS");
                        }
                    }
                }
                else if (material.getClassName() === "StandardMaterial") {
                    // if StandardMaterial:
                    if (material.specularTexture) {
                        defines.push("#define REFLECTIVITYTEXTURE");
                        defines.push(`#define REFLECTIVITY_UV${material.specularTexture.coordinatesIndex + 1}`);
                        if (material.specularTexture.gammaSpace) {
                            defines.push("#define GAMMAREFLECTIVITYTEXTURE");
                        }
                        needUv = true;
                    }
                    if (material.specularColor) {
                        defines.push("#define REFLECTIVITYCOLOR");
                    }
                }
            }
            if (needUv) {
                defines.push("#define NEED_UV");
                if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UVKind)) {
                    attribs.push(Buffers_buffer/* VertexBuffer */.R.UVKind);
                    defines.push("#define UV1");
                }
                if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UV2Kind)) {
                    attribs.push(Buffers_buffer/* VertexBuffer */.R.UV2Kind);
                    defines.push("#define UV2");
                }
            }
        }
        // Buffers
        if (this._enableDepth) {
            defines.push("#define DEPTH");
            defines.push("#define DEPTH_INDEX " + this._depthIndex);
        }
        if (this._enableNormal) {
            defines.push("#define NORMAL");
            defines.push("#define NORMAL_INDEX " + this._normalIndex);
        }
        if (this._enablePosition) {
            defines.push("#define POSITION");
            defines.push("#define POSITION_INDEX " + this._positionIndex);
        }
        if (this._enableVelocity) {
            defines.push("#define VELOCITY");
            defines.push("#define VELOCITY_INDEX " + this._velocityIndex);
            if (this.excludedSkinnedMeshesFromVelocity.indexOf(mesh) === -1) {
                defines.push("#define BONES_VELOCITY_ENABLED");
            }
        }
        if (this._enableVelocityLinear) {
            defines.push("#define VELOCITY_LINEAR");
            defines.push("#define VELOCITY_LINEAR_INDEX " + this._velocityLinearIndex);
            if (this.excludedSkinnedMeshesFromVelocity.indexOf(mesh) === -1) {
                defines.push("#define BONES_VELOCITY_ENABLED");
            }
        }
        if (this._enableReflectivity) {
            defines.push("#define REFLECTIVITY");
            defines.push("#define REFLECTIVITY_INDEX " + this._reflectivityIndex);
        }
        if (this._enableScreenspaceDepth) {
            if (this._screenspaceDepthIndex !== -1) {
                defines.push("#define SCREENSPACE_DEPTH_INDEX " + this._screenspaceDepthIndex);
                defines.push("#define SCREENSPACE_DEPTH");
            }
        }
        if (this.generateNormalsInWorldSpace) {
            defines.push("#define NORMAL_WORLDSPACE");
        }
        if (this._normalsAreUnsigned) {
            defines.push("#define ENCODE_NORMAL");
        }
        // Bones
        if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind);
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind);
            if (mesh.numBoneInfluencers > 4) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind);
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind);
            }
            defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
            defines.push("#define BONETEXTURE " + mesh.skeleton.isUsingTextureForMatrices);
            defines.push("#define BonesPerMesh " + (mesh.skeleton.bones.length + 1));
        }
        else {
            defines.push("#define NUM_BONE_INFLUENCERS 0");
            defines.push("#define BONETEXTURE false");
            defines.push("#define BonesPerMesh 0");
        }
        // Morph targets
        const morphTargetManager = mesh.morphTargetManager;
        let numMorphInfluencers = 0;
        if (morphTargetManager) {
            numMorphInfluencers = morphTargetManager.numMaxInfluencers || morphTargetManager.numInfluencers;
            if (numMorphInfluencers > 0) {
                defines.push("#define MORPHTARGETS");
                defines.push("#define NUM_MORPH_INFLUENCERS " + numMorphInfluencers);
                if (morphTargetManager.isUsingTextureForTargets) {
                    defines.push("#define MORPHTARGETS_TEXTURE");
                }
                (0,materialHelper_functions/* PrepareAttributesForMorphTargetsInfluencers */.MF)(attribs, mesh, numMorphInfluencers);
            }
        }
        // Instances
        if (useInstances) {
            defines.push("#define INSTANCES");
            (0,materialHelper_functions/* PushAttributesForInstances */.te)(attribs, this._enableVelocity || this._enableVelocityLinear);
            if (subMesh.getRenderingMesh().hasThinInstances) {
                defines.push("#define THIN_INSTANCES");
            }
        }
        // Setup textures count
        if (this._linkedWithPrePass) {
            defines.push("#define SCENE_MRT_COUNT " + this._attachmentsFromPrePass.length);
        }
        else {
            defines.push("#define SCENE_MRT_COUNT " + this._multiRenderTarget.textures.length);
        }
        (0,clipPlaneMaterialHelper/* prepareStringDefinesForClipPlanes */.tv)(material, this._scene, defines);
        // Get correct effect
        const engine = this._scene.getEngine();
        const drawWrapper = subMesh._getDrawWrapper(undefined, true);
        const cachedDefines = drawWrapper.defines;
        const join = defines.join("\n");
        if (cachedDefines !== join) {
            drawWrapper.setEffect(engine.createEffect("geometry", {
                attributes: attribs,
                uniformsNames: uniforms,
                samplers: ["diffuseSampler", "bumpSampler", "reflectivitySampler", "albedoSampler", "morphTargets", "boneSampler"],
                defines: join,
                onCompiled: null,
                fallbacks: null,
                onError: null,
                uniformBuffersNames: ["Scene"],
                indexParameters: { buffersCount: this._multiRenderTarget.textures.length - 1, maxSimultaneousMorphTargets: numMorphInfluencers },
                shaderLanguage: this.shaderLanguage,
            }, engine), join);
        }
        return drawWrapper.effect.isReady();
    }
    /**
     * Gets the current underlying G Buffer.
     * @returns the buffer
     */
    getGBuffer() {
        return this._multiRenderTarget;
    }
    /**
     * Gets the number of samples used to render the buffer (anti aliasing).
     */
    get samples() {
        return this._multiRenderTarget.samples;
    }
    /**
     * Sets the number of samples used to render the buffer (anti aliasing).
     */
    set samples(value) {
        this._multiRenderTarget.samples = value;
    }
    /**
     * Disposes the renderer and frees up associated resources.
     */
    dispose() {
        if (this._resizeObserver) {
            const engine = this._scene.getEngine();
            engine.onResizeObservable.remove(this._resizeObserver);
            this._resizeObserver = null;
        }
        this.getGBuffer().dispose();
    }
    _assignRenderTargetIndices() {
        const textureNames = [];
        const textureTypesAndFormats = [];
        let count = 0;
        if (this._enableDepth) {
            this._depthIndex = count;
            count++;
            textureNames.push("gBuffer_Depth");
            textureTypesAndFormats.push(this._textureTypesAndFormats[GeometryBufferRenderer.DEPTH_TEXTURE_TYPE]);
        }
        if (this._enableNormal) {
            this._normalIndex = count;
            count++;
            textureNames.push("gBuffer_Normal");
            textureTypesAndFormats.push(this._textureTypesAndFormats[GeometryBufferRenderer.NORMAL_TEXTURE_TYPE]);
        }
        if (this._enablePosition) {
            this._positionIndex = count;
            count++;
            textureNames.push("gBuffer_Position");
            textureTypesAndFormats.push(this._textureTypesAndFormats[GeometryBufferRenderer.POSITION_TEXTURE_TYPE]);
        }
        if (this._enableVelocity) {
            this._velocityIndex = count;
            count++;
            textureNames.push("gBuffer_Velocity");
            textureTypesAndFormats.push(this._textureTypesAndFormats[GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE]);
        }
        if (this._enableVelocityLinear) {
            this._velocityLinearIndex = count;
            count++;
            textureNames.push("gBuffer_VelocityLinear");
            textureTypesAndFormats.push(this._textureTypesAndFormats[GeometryBufferRenderer.VELOCITY_LINEAR_TEXTURE_TYPE]);
        }
        if (this._enableReflectivity) {
            this._reflectivityIndex = count;
            count++;
            textureNames.push("gBuffer_Reflectivity");
            textureTypesAndFormats.push(this._textureTypesAndFormats[GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE]);
        }
        if (this._enableScreenspaceDepth) {
            this._screenspaceDepthIndex = count;
            count++;
            textureNames.push("gBuffer_ScreenspaceDepth");
            textureTypesAndFormats.push(this._textureTypesAndFormats[GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE]);
        }
        return [count, textureNames, textureTypesAndFormats];
    }
    _createRenderTargets() {
        const engine = this._scene.getEngine();
        const [count, textureNames, textureTypesAndFormat] = this._assignRenderTargetIndices();
        let type = 0;
        if (engine._caps.textureFloat && engine._caps.textureFloatLinearFiltering) {
            type = 1;
        }
        else if (engine._caps.textureHalfFloat && engine._caps.textureHalfFloatLinearFiltering) {
            type = 2;
        }
        const dimensions = this._ratioOrDimensions.width !== undefined
            ? this._ratioOrDimensions
            : { width: engine.getRenderWidth() * this._ratioOrDimensions, height: engine.getRenderHeight() * this._ratioOrDimensions };
        const textureTypes = [];
        const textureFormats = [];
        for (const typeAndFormat of textureTypesAndFormat) {
            if (typeAndFormat) {
                textureTypes.push(typeAndFormat.textureType);
                textureFormats.push(typeAndFormat.textureFormat);
            }
            else {
                textureTypes.push(type);
                textureFormats.push(5);
            }
        }
        this._normalsAreUnsigned =
            textureTypes[GeometryBufferRenderer.NORMAL_TEXTURE_TYPE] === 11 ||
                textureTypes[GeometryBufferRenderer.NORMAL_TEXTURE_TYPE] === 13;
        this._multiRenderTarget = new MultiRenderTarget("gBuffer", dimensions, count, this._scene, { generateMipMaps: false, generateDepthTexture: true, types: textureTypes, formats: textureFormats, depthTextureFormat: this._depthFormat }, textureNames.concat("gBuffer_DepthBuffer"));
        if (!this.isSupported) {
            return;
        }
        this._multiRenderTarget.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._multiRenderTarget.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._multiRenderTarget.refreshRate = 1;
        this._multiRenderTarget.renderParticles = false;
        this._multiRenderTarget.renderList = null;
        // Depth is always the first texture in the geometry buffer renderer!
        const layoutAttachmentsAll = [true];
        const layoutAttachmentsAllButDepth = [false];
        const layoutAttachmentsDepthOnly = [true];
        for (let i = 1; i < count; ++i) {
            layoutAttachmentsAll.push(true);
            layoutAttachmentsDepthOnly.push(false);
            layoutAttachmentsAllButDepth.push(true);
        }
        const attachmentsAll = engine.buildTextureLayout(layoutAttachmentsAll);
        const attachmentsAllButDepth = engine.buildTextureLayout(layoutAttachmentsAllButDepth);
        const attachmentsDepthOnly = engine.buildTextureLayout(layoutAttachmentsDepthOnly);
        this._multiRenderTarget.onClearObservable.add((engine) => {
            engine.bindAttachments(this.useSpecificClearForDepthTexture ? attachmentsAllButDepth : attachmentsAll);
            engine.clear(this._clearColor, true, true, true);
            if (this.useSpecificClearForDepthTexture) {
                engine.bindAttachments(attachmentsDepthOnly);
                engine.clear(this._clearDepthColor, true, true, true);
            }
            engine.bindAttachments(attachmentsAll);
        });
        this._resizeObserver = engine.onResizeObservable.add(() => {
            if (this._multiRenderTarget) {
                const dimensions = this._ratioOrDimensions.width !== undefined
                    ? this._ratioOrDimensions
                    : { width: engine.getRenderWidth() * this._ratioOrDimensions, height: engine.getRenderHeight() * this._ratioOrDimensions };
                this._multiRenderTarget.resize(dimensions);
            }
        });
        // Custom render function
        const renderSubMesh = (subMesh) => {
            const renderingMesh = subMesh.getRenderingMesh();
            const effectiveMesh = subMesh.getEffectiveMesh();
            const scene = this._scene;
            const engine = scene.getEngine();
            const material = subMesh.getMaterial();
            if (!material) {
                return;
            }
            effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = false;
            // Velocity
            if ((this._enableVelocity || this._enableVelocityLinear) && !this._previousTransformationMatrices[effectiveMesh.uniqueId]) {
                this._previousTransformationMatrices[effectiveMesh.uniqueId] = {
                    world: math_vector/* Matrix */.uq.Identity(),
                    viewProjection: scene.getTransformMatrix(),
                };
                if (renderingMesh.skeleton) {
                    const bonesTransformations = renderingMesh.skeleton.getTransformMatrices(renderingMesh);
                    this._previousBonesTransformationMatrices[renderingMesh.uniqueId] = this._copyBonesTransformationMatrices(bonesTransformations, new Float32Array(bonesTransformations.length));
                }
            }
            // Managing instances
            const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());
            if (batch.mustReturn) {
                return;
            }
            const hardwareInstancedRendering = engine.getCaps().instancedArrays && (batch.visibleInstances[subMesh._id] !== null || renderingMesh.hasThinInstances);
            const world = effectiveMesh.getWorldMatrix();
            if (this.isReady(subMesh, hardwareInstancedRendering)) {
                const drawWrapper = subMesh._getDrawWrapper();
                if (!drawWrapper) {
                    return;
                }
                const effect = drawWrapper.effect;
                engine.enableEffect(drawWrapper);
                if (!hardwareInstancedRendering) {
                    renderingMesh._bind(subMesh, effect, material.fillMode);
                }
                if (!this._useUbo) {
                    effect.setMatrix("viewProjection", scene.getTransformMatrix());
                    effect.setMatrix("view", scene.getViewMatrix());
                }
                else {
                    (0,materialHelper_functions/* BindSceneUniformBuffer */._8)(effect, this._scene.getSceneUniformBuffer());
                    this._scene.finalizeSceneUbo();
                }
                let sideOrientation;
                const instanceDataStorage = renderingMesh._instanceDataStorage;
                if (!instanceDataStorage.isFrozen && (material.backFaceCulling || material.sideOrientation !== null)) {
                    const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();
                    sideOrientation = material._getEffectiveOrientation(renderingMesh);
                    if (mainDeterminant < 0) {
                        sideOrientation = sideOrientation === Materials_material/* Material */.i.ClockWiseSideOrientation ? Materials_material/* Material */.i.CounterClockWiseSideOrientation : Materials_material/* Material */.i.ClockWiseSideOrientation;
                    }
                }
                else {
                    sideOrientation = instanceDataStorage.sideOrientation;
                }
                material._preBind(drawWrapper, sideOrientation);
                // Alpha test
                if (material.needAlphaTesting()) {
                    const alphaTexture = material.getAlphaTestTexture();
                    if (alphaTexture) {
                        effect.setTexture("diffuseSampler", alphaTexture);
                        effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
                    }
                }
                // Bump
                if ((material.bumpTexture || material.normalTexture) && scene.getEngine().getCaps().standardDerivatives && materialFlags/* MaterialFlags */.h.BumpTextureEnabled) {
                    const texture = material.bumpTexture || material.normalTexture;
                    effect.setFloat3("vBumpInfos", texture.coordinatesIndex, 1.0 / texture.level, material.parallaxScaleBias);
                    effect.setMatrix("bumpMatrix", texture.getTextureMatrix());
                    effect.setTexture("bumpSampler", texture);
                    effect.setFloat2("vTangentSpaceParams", material.invertNormalMapX ? -1.0 : 1.0, material.invertNormalMapY ? -1.0 : 1.0);
                }
                // Reflectivity
                if (this._enableReflectivity) {
                    // for PBR materials: cf. https://doc.babylonjs.com/features/featuresDeepDive/materials/using/masterPBR
                    if (material.getClassName() === "PBRMetallicRoughnessMaterial") {
                        // if it is a PBR material in MetallicRoughness Mode:
                        if (material.metallicRoughnessTexture !== null) {
                            effect.setTexture("reflectivitySampler", material.metallicRoughnessTexture);
                            effect.setMatrix("reflectivityMatrix", material.metallicRoughnessTexture.getTextureMatrix());
                        }
                        if (material.metallic !== null) {
                            effect.setFloat("metallic", material.metallic);
                        }
                        if (material.roughness !== null) {
                            effect.setFloat("glossiness", 1.0 - material.roughness);
                        }
                        if (material.baseTexture !== null) {
                            effect.setTexture("albedoSampler", material.baseTexture);
                            effect.setMatrix("albedoMatrix", material.baseTexture.getTextureMatrix());
                        }
                        if (material.baseColor !== null) {
                            effect.setColor3("albedoColor", material.baseColor);
                        }
                    }
                    else if (material.getClassName() === "PBRSpecularGlossinessMaterial") {
                        // if it is a PBR material in Specular/Glossiness Mode:
                        if (material.specularGlossinessTexture !== null) {
                            effect.setTexture("reflectivitySampler", material.specularGlossinessTexture);
                            effect.setMatrix("reflectivityMatrix", material.specularGlossinessTexture.getTextureMatrix());
                        }
                        else {
                            if (material.specularColor !== null) {
                                effect.setColor3("reflectivityColor", material.specularColor);
                            }
                        }
                        if (material.glossiness !== null) {
                            effect.setFloat("glossiness", material.glossiness);
                        }
                    }
                    else if (material.getClassName() === "PBRMaterial") {
                        // if it is the bigger PBRMaterial
                        if (material.metallicTexture !== null) {
                            effect.setTexture("reflectivitySampler", material.metallicTexture);
                            effect.setMatrix("reflectivityMatrix", material.metallicTexture.getTextureMatrix());
                        }
                        if (material.metallic !== null) {
                            effect.setFloat("metallic", material.metallic);
                        }
                        if (material.roughness !== null) {
                            effect.setFloat("glossiness", 1.0 - material.roughness);
                        }
                        if (material.roughness !== null || material.metallic !== null || material.metallicTexture !== null) {
                            // MetallicRoughness Model
                            if (material.albedoTexture !== null) {
                                effect.setTexture("albedoSampler", material.albedoTexture);
                                effect.setMatrix("albedoMatrix", material.albedoTexture.getTextureMatrix());
                            }
                            if (material.albedoColor !== null) {
                                effect.setColor3("albedoColor", material.albedoColor);
                            }
                        }
                        else {
                            // SpecularGlossiness Model
                            if (material.reflectivityTexture !== null) {
                                effect.setTexture("reflectivitySampler", material.reflectivityTexture);
                                effect.setMatrix("reflectivityMatrix", material.reflectivityTexture.getTextureMatrix());
                            }
                            else if (material.reflectivityColor !== null) {
                                effect.setColor3("reflectivityColor", material.reflectivityColor);
                            }
                            if (material.microSurface !== null) {
                                effect.setFloat("glossiness", material.microSurface);
                            }
                        }
                    }
                    else if (material.getClassName() === "StandardMaterial") {
                        // if StandardMaterial:
                        if (material.specularTexture !== null) {
                            effect.setTexture("reflectivitySampler", material.specularTexture);
                            effect.setMatrix("reflectivityMatrix", material.specularTexture.getTextureMatrix());
                        }
                        if (material.specularColor !== null) {
                            effect.setColor3("reflectivityColor", material.specularColor);
                        }
                    }
                }
                // Clip plane
                (0,clipPlaneMaterialHelper/* bindClipPlane */.gS)(effect, material, this._scene);
                // Bones
                if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {
                    const skeleton = renderingMesh.skeleton;
                    if (skeleton.isUsingTextureForMatrices && effect.getUniformIndex("boneTextureWidth") > -1) {
                        const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);
                        effect.setTexture("boneSampler", boneTexture);
                        effect.setFloat("boneTextureWidth", 4.0 * (skeleton.bones.length + 1));
                    }
                    else {
                        effect.setMatrices("mBones", renderingMesh.skeleton.getTransformMatrices(renderingMesh));
                    }
                    if (this._enableVelocity || this._enableVelocityLinear) {
                        effect.setMatrices("mPreviousBones", this._previousBonesTransformationMatrices[renderingMesh.uniqueId]);
                    }
                }
                // Morph targets
                (0,materialHelper_functions/* BindMorphTargetParameters */.nR)(renderingMesh, effect);
                if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {
                    renderingMesh.morphTargetManager._bind(effect);
                }
                // Velocity
                if (this._enableVelocity || this._enableVelocityLinear) {
                    effect.setMatrix("previousWorld", this._previousTransformationMatrices[effectiveMesh.uniqueId].world);
                    effect.setMatrix("previousViewProjection", this._previousTransformationMatrices[effectiveMesh.uniqueId].viewProjection);
                }
                if (hardwareInstancedRendering && renderingMesh.hasThinInstances) {
                    effect.setMatrix("world", world);
                }
                // Draw
                renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, w) => {
                    if (!isInstance) {
                        effect.setMatrix("world", w);
                    }
                });
            }
            // Velocity
            if (this._enableVelocity || this._enableVelocityLinear) {
                this._previousTransformationMatrices[effectiveMesh.uniqueId].world = world.clone();
                this._previousTransformationMatrices[effectiveMesh.uniqueId].viewProjection = this._scene.getTransformMatrix().clone();
                if (renderingMesh.skeleton) {
                    this._copyBonesTransformationMatrices(renderingMesh.skeleton.getTransformMatrices(renderingMesh), this._previousBonesTransformationMatrices[effectiveMesh.uniqueId]);
                }
            }
        };
        this._multiRenderTarget.customIsReadyFunction = (mesh, refreshRate, preWarm) => {
            if ((preWarm || refreshRate === 0) && mesh.subMeshes) {
                for (let i = 0; i < mesh.subMeshes.length; ++i) {
                    const subMesh = mesh.subMeshes[i];
                    const material = subMesh.getMaterial();
                    const renderingMesh = subMesh.getRenderingMesh();
                    if (!material) {
                        continue;
                    }
                    const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());
                    const hardwareInstancedRendering = engine.getCaps().instancedArrays && (batch.visibleInstances[subMesh._id] !== null || renderingMesh.hasThinInstances);
                    if (!this.isReady(subMesh, hardwareInstancedRendering)) {
                        return false;
                    }
                }
            }
            return true;
        };
        this._multiRenderTarget.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => {
            let index;
            if (this._linkedWithPrePass) {
                if (!this._prePassRenderer.enabled) {
                    return;
                }
                this._scene.getEngine().bindAttachments(this._attachmentsFromPrePass);
            }
            if (depthOnlySubMeshes.length) {
                engine.setColorWrite(false);
                for (index = 0; index < depthOnlySubMeshes.length; index++) {
                    renderSubMesh(depthOnlySubMeshes.data[index]);
                }
                engine.setColorWrite(true);
            }
            for (index = 0; index < opaqueSubMeshes.length; index++) {
                renderSubMesh(opaqueSubMeshes.data[index]);
            }
            engine.setDepthWrite(false);
            for (index = 0; index < alphaTestSubMeshes.length; index++) {
                renderSubMesh(alphaTestSubMeshes.data[index]);
            }
            if (this.renderTransparentMeshes) {
                for (index = 0; index < transparentSubMeshes.length; index++) {
                    renderSubMesh(transparentSubMeshes.data[index]);
                }
            }
            engine.setDepthWrite(true);
        };
    }
    // Copies the bones transformation matrices into the target array and returns the target's reference
    _copyBonesTransformationMatrices(source, target) {
        for (let i = 0; i < source.length; i++) {
            target[i] = source[i];
        }
        return target;
    }
}
/**
 * Force all the standard materials to compile to glsl even on WebGPU engines.
 * False by default. This is mostly meant for backward compatibility.
 */
GeometryBufferRenderer.ForceGLSL = false;
/**
 * Constant used to retrieve the depth texture index in the G-Buffer textures array
 * using getIndex(GeometryBufferRenderer.DEPTH_TEXTURE_INDEX)
 */
GeometryBufferRenderer.DEPTH_TEXTURE_TYPE = 0;
/**
 * Constant used to retrieve the normal texture index in the G-Buffer textures array
 * using getIndex(GeometryBufferRenderer.NORMAL_TEXTURE_INDEX)
 */
GeometryBufferRenderer.NORMAL_TEXTURE_TYPE = 1;
/**
 * Constant used to retrieve the position texture index in the G-Buffer textures array
 * using getIndex(GeometryBufferRenderer.POSITION_TEXTURE_INDEX)
 */
GeometryBufferRenderer.POSITION_TEXTURE_TYPE = 2;
/**
 * Constant used to retrieve the velocity texture index in the G-Buffer textures array
 * using getIndex(GeometryBufferRenderer.VELOCITY_TEXTURE_INDEX)
 */
GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE = 3;
/**
 * Constant used to retrieve the reflectivity texture index in the G-Buffer textures array
 * using the getIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE)
 */
GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE = 4;
/**
 * Constant used to retrieve the screen-space depth texture index in the G-Buffer textures array
 * using getIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE)
 */
GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE = 5;
/**
 * Constant used to retrieve the linear velocity texture index in the G-Buffer textures array
 * using getIndex(GeometryBufferRenderer.VELOCITY_LINEAR_TEXTURE_TYPE)
 */
GeometryBufferRenderer.VELOCITY_LINEAR_TEXTURE_TYPE = 6;
/**
 * @internal
 */
GeometryBufferRenderer._SceneComponentInitialization = (_) => {
    throw (0,devTools/* _WarnImport */.n)("GeometryBufferRendererSceneComponent");
};
//# sourceMappingURL=geometryBufferRenderer.js.map
;// ./node_modules/@babylonjs/core/Rendering/motionBlurConfiguration.js

/**
 * Contains all parameters needed for the prepass to perform
 * motion blur
 */
class MotionBlurConfiguration {
    constructor() {
        /**
         * Is motion blur enabled
         */
        this.enabled = false;
        /**
         * Name of the configuration
         */
        this.name = "motionBlur";
        /**
         * Textures that should be present in the MRT for this effect to work
         */
        this.texturesRequired = [2];
    }
}
//# sourceMappingURL=motionBlurConfiguration.js.map
;// ./node_modules/@babylonjs/core/Rendering/geometryBufferRendererSceneComponent.js




Object.defineProperty(core_scene/* Scene */.Z.prototype, "geometryBufferRenderer", {
    get: function () {
        return this._geometryBufferRenderer;
    },
    set: function (value) {
        if (value && value.isSupported) {
            this._geometryBufferRenderer = value;
        }
    },
    enumerable: true,
    configurable: true,
});
core_scene/* Scene */.Z.prototype.enableGeometryBufferRenderer = function (ratio = 1, depthFormat = 15, textureTypesAndFormats) {
    if (this._geometryBufferRenderer) {
        return this._geometryBufferRenderer;
    }
    this._geometryBufferRenderer = new GeometryBufferRenderer(this, ratio, depthFormat, textureTypesAndFormats);
    if (!this._geometryBufferRenderer.isSupported) {
        this._geometryBufferRenderer = null;
    }
    return this._geometryBufferRenderer;
};
core_scene/* Scene */.Z.prototype.disableGeometryBufferRenderer = function () {
    if (!this._geometryBufferRenderer) {
        return;
    }
    this._geometryBufferRenderer.dispose();
    this._geometryBufferRenderer = null;
};
/**
 * Defines the Geometry Buffer scene component responsible to manage a G-Buffer useful
 * in several rendering techniques.
 */
class GeometryBufferRendererSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_GEOMETRYBUFFERRENDERER;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._gatherRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER, this, this._gatherRenderTargets);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do for this component
    }
    /**
     * Disposes the component and the associated resources
     */
    dispose() {
        // Nothing to do for this component
    }
    _gatherRenderTargets(renderTargets) {
        if (this.scene._geometryBufferRenderer) {
            renderTargets.push(this.scene._geometryBufferRenderer.getGBuffer());
        }
    }
}
GeometryBufferRenderer._SceneComponentInitialization = (scene) => {
    // Register the G Buffer component to the scene.
    let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_GEOMETRYBUFFERRENDERER);
    if (!component) {
        component = new GeometryBufferRendererSceneComponent(scene);
        scene._addComponent(component);
    }
};
//# sourceMappingURL=geometryBufferRendererSceneComponent.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/motionBlurPostProcess.js












/**
 * The Motion Blur Post Process which blurs an image based on the objects velocity in scene.
 * Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.
 * As an example, all you have to do is to create the post-process:
 *  var mb = new BABYLON.MotionBlurPostProcess(
 *      'mb', // The name of the effect.
 *      scene, // The scene containing the objects to blur according to their velocity.
 *      1.0, // The required width/height ratio to downsize to before computing the render pass.
 *      camera // The camera to apply the render pass to.
 * );
 * Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.
 */
class MotionBlurPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets the number of iterations are used for motion blur quality. Default value is equal to 32
     */
    get motionBlurSamples() {
        return this._motionBlurSamples;
    }
    /**
     * Sets the number of iterations to be used for motion blur quality
     */
    set motionBlurSamples(samples) {
        this._motionBlurSamples = samples;
        this._updateEffect();
    }
    /**
     * Gets whether or not the motion blur post-process is in object based mode.
     */
    get isObjectBased() {
        return this._isObjectBased;
    }
    /**
     * Sets whether or not the motion blur post-process is in object based mode.
     */
    set isObjectBased(value) {
        if (this._isObjectBased === value) {
            return;
        }
        this._isObjectBased = value;
        this._applyMode();
    }
    get _geometryBufferRenderer() {
        if (!this._forceGeometryBuffer) {
            return null;
        }
        return this._scene.geometryBufferRenderer;
    }
    get _prePassRenderer() {
        if (this._forceGeometryBuffer) {
            return null;
        }
        return this._scene.prePassRenderer;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "MotionBlurPostProcess" string
     */
    getClassName() {
        return "MotionBlurPostProcess";
    }
    /**
     * Creates a new instance MotionBlurPostProcess
     * @param name The name of the effect.
     * @param scene The scene containing the objects to blur according to their velocity.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: true)
     * @param forceGeometryBuffer If this post process should use geometry buffer instead of prepass (default: false)
     */
    constructor(name, scene, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false, forceGeometryBuffer = false) {
        super(name, "motionBlur", ["motionStrength", "motionScale", "screenSize", "inverseViewProjection", "prevViewProjection", "projection"], ["velocitySampler", "depthSampler"], options, camera, samplingMode, engine, reusable, "#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0\n#define OBJECT_BASED", textureType, undefined, null, blockCompilation);
        /**
         * Defines how much the image is blurred by the movement. Default value is equal to 1
         */
        this.motionStrength = 1;
        this._motionBlurSamples = 32;
        this._isObjectBased = true;
        this._forceGeometryBuffer = false;
        this._invViewProjection = null;
        this._previousViewProjection = null;
        this._forceGeometryBuffer = forceGeometryBuffer;
        // Set up assets
        if (this._forceGeometryBuffer) {
            scene.enableGeometryBufferRenderer();
            if (this._geometryBufferRenderer) {
                this._geometryBufferRenderer.enableVelocity = this._isObjectBased;
            }
        }
        else {
            scene.enablePrePassRenderer();
            if (this._prePassRenderer) {
                this._prePassRenderer.markAsDirty();
                this._prePassEffectConfiguration = new MotionBlurConfiguration();
            }
        }
        this._applyMode();
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 8075))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 25830))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * Excludes the given skinned mesh from computing bones velocities.
     * Computing bones velocities can have a cost and that cost. The cost can be saved by calling this function and by passing the skinned mesh reference to ignore.
     * @param skinnedMesh The mesh containing the skeleton to ignore when computing the velocity map.
     */
    excludeSkinnedMesh(skinnedMesh) {
        if (skinnedMesh.skeleton) {
            let list;
            if (this._geometryBufferRenderer) {
                list = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;
            }
            else if (this._prePassRenderer) {
                list = this._prePassRenderer.excludedSkinnedMesh;
            }
            else {
                return;
            }
            list.push(skinnedMesh);
        }
    }
    /**
     * Removes the given skinned mesh from the excluded meshes to integrate bones velocities while rendering the velocity map.
     * @param skinnedMesh The mesh containing the skeleton that has been ignored previously.
     * @see excludeSkinnedMesh to exclude a skinned mesh from bones velocity computation.
     */
    removeExcludedSkinnedMesh(skinnedMesh) {
        if (skinnedMesh.skeleton) {
            let list;
            if (this._geometryBufferRenderer) {
                list = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;
            }
            else if (this._prePassRenderer) {
                list = this._prePassRenderer.excludedSkinnedMesh;
            }
            else {
                return;
            }
            const index = list.indexOf(skinnedMesh);
            if (index !== -1) {
                list.splice(index, 1);
            }
        }
    }
    /**
     * Disposes the post process.
     * @param camera The camera to dispose the post process on.
     */
    dispose(camera) {
        if (this._geometryBufferRenderer) {
            // Clear previous transformation matrices dictionary used to compute objects velocities
            this._geometryBufferRenderer._previousTransformationMatrices = {};
            this._geometryBufferRenderer._previousBonesTransformationMatrices = {};
            this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity = [];
        }
        super.dispose(camera);
    }
    /**
     * Called on the mode changed (object based or screen based).
     * @returns void
     */
    _applyMode() {
        if (!this._geometryBufferRenderer && !this._prePassRenderer) {
            // We can't get a velocity or depth texture. So, work as a passthrough.
            logger/* Logger */.V.Warn("Multiple Render Target support needed to compute object based motion blur");
            return this.updateEffect();
        }
        if (this._geometryBufferRenderer) {
            this._geometryBufferRenderer.enableVelocity = this._isObjectBased;
        }
        this._updateEffect();
        this._invViewProjection = null;
        this._previousViewProjection = null;
        if (this.isObjectBased) {
            if (this._prePassRenderer && this._prePassEffectConfiguration) {
                this._prePassEffectConfiguration.texturesRequired[0] = 2;
            }
            this.onApply = (effect) => this._onApplyObjectBased(effect);
        }
        else {
            this._invViewProjection = math_vector/* Matrix */.uq.Identity();
            this._previousViewProjection = this._scene.getTransformMatrix().clone();
            if (this._prePassRenderer && this._prePassEffectConfiguration) {
                this._prePassEffectConfiguration.texturesRequired[0] = 5;
            }
            this.onApply = (effect) => this._onApplyScreenBased(effect);
        }
    }
    /**
     * Called on the effect is applied when the motion blur post-process is in object based mode.
     * @param effect
     */
    _onApplyObjectBased(effect) {
        effect.setVector2("screenSize", new math_vector/* Vector2 */.I9(this.width, this.height));
        effect.setFloat("motionScale", this._scene.getAnimationRatio());
        effect.setFloat("motionStrength", this.motionStrength);
        if (this._geometryBufferRenderer) {
            const velocityIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE);
            effect.setTexture("velocitySampler", this._geometryBufferRenderer.getGBuffer().textures[velocityIndex]);
        }
        else if (this._prePassRenderer) {
            const velocityIndex = this._prePassRenderer.getIndex(2);
            effect.setTexture("velocitySampler", this._prePassRenderer.getRenderTarget().textures[velocityIndex]);
        }
    }
    /**
     * Called on the effect is applied when the motion blur post-process is in screen based mode.
     * @param effect
     */
    _onApplyScreenBased(effect) {
        const viewProjection = math_vector/* TmpVectors */.AA.Matrix[0];
        viewProjection.copyFrom(this._scene.getTransformMatrix());
        viewProjection.invertToRef(this._invViewProjection);
        effect.setMatrix("inverseViewProjection", this._invViewProjection);
        effect.setMatrix("prevViewProjection", this._previousViewProjection);
        this._previousViewProjection.copyFrom(viewProjection);
        effect.setMatrix("projection", this._scene.getProjectionMatrix());
        effect.setVector2("screenSize", new math_vector/* Vector2 */.I9(this.width, this.height));
        effect.setFloat("motionScale", this._scene.getAnimationRatio());
        effect.setFloat("motionStrength", this.motionStrength);
        if (this._geometryBufferRenderer) {
            const depthIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE);
            effect.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[depthIndex]);
        }
        else if (this._prePassRenderer) {
            const depthIndex = this._prePassRenderer.getIndex(5);
            effect.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[depthIndex]);
        }
    }
    /**
     * Called on the effect must be updated (changed mode, samples count, etc.).
     */
    _updateEffect() {
        if (this._geometryBufferRenderer || this._prePassRenderer) {
            const defines = [
                "#define GEOMETRY_SUPPORTED",
                "#define SAMPLES " + this._motionBlurSamples.toFixed(1),
                this._isObjectBased ? "#define OBJECT_BASED" : "#define SCREEN_BASED",
            ];
            this.updateEffect(defines.join("\n"));
        }
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new MotionBlurPostProcess(parsedPostProcess.name, scene, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType, false);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MotionBlurPostProcess.prototype, "motionStrength", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MotionBlurPostProcess.prototype, "motionBlurSamples", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], MotionBlurPostProcess.prototype, "isObjectBased", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.MotionBlurPostProcess", MotionBlurPostProcess);
//# sourceMappingURL=motionBlurPostProcess.js.map
;// ./node_modules/@babylonjs/core/Shaders/refraction.fragment.js
// Do not edit.

const refraction_fragment_name = "refractionPixelShader";
const refraction_fragment_shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D refractionSampler;uniform vec3 baseColor;uniform float depth;uniform float colorLevel;void main() {float ref=1.0-texture2D(refractionSampler,vUV).r;vec2 uv=vUV-vec2(0.5);vec2 offset=uv*depth*ref;vec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;gl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[refraction_fragment_name] = refraction_fragment_shader;
/** @internal */
const refractionPixelShader = { name: refraction_fragment_name, shader: refraction_fragment_shader };
//# sourceMappingURL=refraction.fragment.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/refractionPostProcess.js







/**
 * Post process which applies a refraction texture
 * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#refraction
 */
class RefractionPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets or sets the refraction texture
     * Please note that you are responsible for disposing the texture if you set it manually
     */
    get refractionTexture() {
        return this._refTexture;
    }
    set refractionTexture(value) {
        if (this._refTexture && this._ownRefractionTexture) {
            this._refTexture.dispose();
        }
        this._refTexture = value;
        this._ownRefractionTexture = false;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "RefractionPostProcess" string
     */
    getClassName() {
        return "RefractionPostProcess";
    }
    /**
     * Initializes the RefractionPostProcess
     * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#refraction
     * @param name The name of the effect.
     * @param refractionTextureUrl Url of the refraction texture to use
     * @param color the base color of the refraction (used to taint the rendering)
     * @param depth simulated refraction depth
     * @param colorLevel the coefficient of the base color (0 to remove base color tainting)
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     */
    constructor(name, refractionTextureUrl, color, depth, colorLevel, options, camera, samplingMode, engine, reusable) {
        super(name, "refraction", ["baseColor", "depth", "colorLevel"], ["refractionSampler"], options, camera, samplingMode, engine, reusable);
        this._ownRefractionTexture = true;
        this.color = color;
        this.depth = depth;
        this.colorLevel = colorLevel;
        this.refractionTextureUrl = refractionTextureUrl;
        this.onActivateObservable.add((cam) => {
            this._refTexture = this._refTexture || new Textures_texture/* Texture */.g(refractionTextureUrl, cam.getScene());
        });
        this.onApplyObservable.add((effect) => {
            effect.setColor3("baseColor", this.color);
            effect.setFloat("depth", this.depth);
            effect.setFloat("colorLevel", this.colorLevel);
            effect.setTexture("refractionSampler", this._refTexture);
        });
    }
    // Methods
    /**
     * Disposes of the post process
     * @param camera Camera to dispose post process on
     */
    dispose(camera) {
        if (this._refTexture && this._ownRefractionTexture) {
            this._refTexture.dispose();
            this._refTexture = null;
        }
        super.dispose(camera);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new RefractionPostProcess(parsedPostProcess.name, parsedPostProcess.refractionTextureUrl, parsedPostProcess.color, parsedPostProcess.depth, parsedPostProcess.colorLevel, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], RefractionPostProcess.prototype, "color", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], RefractionPostProcess.prototype, "depth", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], RefractionPostProcess.prototype, "colorLevel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], RefractionPostProcess.prototype, "refractionTextureUrl", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.RefractionPostProcess", RefractionPostProcess);
//# sourceMappingURL=refractionPostProcess.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/sharpen.fragment.js
var sharpen_fragment = __webpack_require__(78438);
;// ./node_modules/@babylonjs/core/PostProcesses/sharpenPostProcess.js







/**
 * The SharpenPostProcess applies a sharpen kernel to every pixel
 * See http://en.wikipedia.org/wiki/Kernel_(image_processing)
 */
class SharpenPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "SharpenPostProcess" string
     */
    getClassName() {
        return "SharpenPostProcess";
    }
    /**
     * Creates a new instance ConvolutionPostProcess
     * @param name The name of the effect.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        super(name, "sharpen", ["sharpnessAmounts", "screenSize"], null, options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);
        /**
         * How much of the original color should be applied. Setting this to 0 will display edge detection. (default: 1)
         */
        this.colorAmount = 1.0;
        /**
         * How much sharpness should be applied (default: 0.3)
         */
        this.edgeAmount = 0.3;
        this.onApply = (effect) => {
            effect.setFloat2("screenSize", this.width, this.height);
            effect.setFloat2("sharpnessAmounts", this.edgeAmount, this.colorAmount);
        };
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 35381))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 78438))]));
        }
        super._gatherImports(useWebGPU, list);
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new SharpenPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.textureType, parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SharpenPostProcess.prototype, "colorAmount", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SharpenPostProcess.prototype, "edgeAmount", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SharpenPostProcess", SharpenPostProcess);
//# sourceMappingURL=sharpenPostProcess.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipeline.js



/**
 * PostProcessRenderPipeline
 * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/postProcessRenderPipeline
 */
class PostProcessRenderPipeline {
    /**
     * Gets pipeline name
     */
    get name() {
        return this._name;
    }
    /** Gets the list of attached cameras */
    get cameras() {
        return this._cameras;
    }
    /**
     * Gets the active engine
     */
    get engine() {
        return this._engine;
    }
    /**
     * Initializes a PostProcessRenderPipeline
     * @param _engine engine to add the pipeline to
     * @param name name of the pipeline
     */
    constructor(_engine, name) {
        this._engine = _engine;
        this._name = name;
        this._renderEffects = {};
        this._renderEffectsForIsolatedPass = new Array();
        this._cameras = [];
    }
    /**
     * Gets the class name
     * @returns "PostProcessRenderPipeline"
     */
    getClassName() {
        return "PostProcessRenderPipeline";
    }
    /**
     * If all the render effects in the pipeline are supported
     */
    get isSupported() {
        for (const renderEffectName in this._renderEffects) {
            if (Object.prototype.hasOwnProperty.call(this._renderEffects, renderEffectName)) {
                if (!this._renderEffects[renderEffectName].isSupported) {
                    return false;
                }
            }
        }
        return true;
    }
    /**
     * Adds an effect to the pipeline
     * @param renderEffect the effect to add
     */
    addEffect(renderEffect) {
        this._renderEffects[renderEffect._name] = renderEffect;
    }
    // private
    /** @internal */
    _rebuild() { }
    /**
     * @internal
     */
    _enableEffect(renderEffectName, cameras) {
        const renderEffects = this._renderEffects[renderEffectName];
        if (!renderEffects) {
            return;
        }
        renderEffects._enable(tools/* Tools */.S0.MakeArray(cameras || this._cameras));
    }
    /**
     * @internal
     */
    _disableEffect(renderEffectName, cameras) {
        const renderEffects = this._renderEffects[renderEffectName];
        if (!renderEffects) {
            return;
        }
        renderEffects._disable(tools/* Tools */.S0.MakeArray(cameras || this._cameras));
    }
    /**
     * @internal
     */
    _attachCameras(cameras, unique) {
        const cams = tools/* Tools */.S0.MakeArray(cameras || this._cameras);
        if (!cams) {
            return;
        }
        const indicesToDelete = [];
        let i;
        for (i = 0; i < cams.length; i++) {
            const camera = cams[i];
            if (!camera) {
                continue;
            }
            if (this._cameras.indexOf(camera) === -1) {
                this._cameras.push(camera);
            }
            else if (unique) {
                indicesToDelete.push(i);
            }
        }
        for (i = 0; i < indicesToDelete.length; i++) {
            cams.splice(indicesToDelete[i], 1);
        }
        for (const renderEffectName in this._renderEffects) {
            if (Object.prototype.hasOwnProperty.call(this._renderEffects, renderEffectName)) {
                this._renderEffects[renderEffectName]._attachCameras(cams);
            }
        }
    }
    /**
     * @internal
     */
    _detachCameras(cameras) {
        const cams = tools/* Tools */.S0.MakeArray(cameras || this._cameras);
        if (!cams) {
            return;
        }
        for (const renderEffectName in this._renderEffects) {
            if (Object.prototype.hasOwnProperty.call(this._renderEffects, renderEffectName)) {
                this._renderEffects[renderEffectName]._detachCameras(cams);
            }
        }
        for (let i = 0; i < cams.length; i++) {
            this._cameras.splice(this._cameras.indexOf(cams[i]), 1);
        }
    }
    /** @internal */
    _update() {
        for (const renderEffectName in this._renderEffects) {
            if (Object.prototype.hasOwnProperty.call(this._renderEffects, renderEffectName)) {
                this._renderEffects[renderEffectName]._update();
            }
        }
        for (let i = 0; i < this._cameras.length; i++) {
            if (!this._cameras[i]) {
                continue;
            }
            const cameraName = this._cameras[i].name;
            if (this._renderEffectsForIsolatedPass[cameraName]) {
                this._renderEffectsForIsolatedPass[cameraName]._update();
            }
        }
    }
    /** @internal */
    _reset() {
        this._renderEffects = {};
        this._renderEffectsForIsolatedPass = new Array();
    }
    _enableMSAAOnFirstPostProcess(sampleCount) {
        if (!this._engine._features.supportMSAA) {
            return false;
        }
        // Set samples of the very first post process to 4 to enable native anti-aliasing in browsers that support webGL 2.0 (See: https://github.com/BabylonJS/Babylon.js/issues/3754)
        const effectKeys = Object.keys(this._renderEffects);
        if (effectKeys.length > 0) {
            const postProcesses = this._renderEffects[effectKeys[0]].getPostProcesses();
            if (postProcesses) {
                postProcesses[0].samples = sampleCount;
            }
        }
        return true;
    }
    /**
     * Ensures that all post processes in the pipeline are the correct size according to the
     * the viewport's required size
     */
    _adaptPostProcessesToViewPort() {
        const effectKeys = Object.keys(this._renderEffects);
        for (const effectKey of effectKeys) {
            const postProcesses = this._renderEffects[effectKey].getPostProcesses();
            if (postProcesses) {
                for (const postProcess of postProcesses) {
                    postProcess.adaptScaleToCurrentViewport = true;
                }
            }
        }
    }
    /**
     * Sets the required values to the prepass renderer.
     * @param prePassRenderer defines the prepass renderer to setup.
     * @returns true if the pre pass is needed.
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    setPrePassRenderer(prePassRenderer) {
        // Do Nothing by default
        return false;
    }
    /**
     * Disposes of the pipeline
     */
    dispose() {
        // Must be implemented by children
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], PostProcessRenderPipeline.prototype, "_name", void 0);
//# sourceMappingURL=postProcessRenderPipeline.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js
/**
 * PostProcessRenderPipelineManager class
 * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/postProcessRenderPipeline
 */
class PostProcessRenderPipelineManager {
    /**
     * Initializes a PostProcessRenderPipelineManager
     * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/postProcessRenderPipeline
     */
    constructor() {
        this._renderPipelines = {};
    }
    /**
     * Gets the list of supported render pipelines
     */
    get supportedPipelines() {
        const result = [];
        for (const renderPipelineName in this._renderPipelines) {
            if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {
                const pipeline = this._renderPipelines[renderPipelineName];
                if (pipeline.isSupported) {
                    result.push(pipeline);
                }
            }
        }
        return result;
    }
    /**
     * Adds a pipeline to the manager
     * @param renderPipeline The pipeline to add
     */
    addPipeline(renderPipeline) {
        this._renderPipelines[renderPipeline._name] = renderPipeline;
    }
    /**
     * Remove the pipeline from the manager
     * @param renderPipelineName the name of the pipeline to remove
     */
    removePipeline(renderPipelineName) {
        delete this._renderPipelines[renderPipelineName];
    }
    /**
     * Attaches a camera to the pipeline
     * @param renderPipelineName The name of the pipeline to attach to
     * @param cameras the camera to attach
     * @param unique if the camera can be attached multiple times to the pipeline
     */
    attachCamerasToRenderPipeline(renderPipelineName, cameras, unique = false) {
        const renderPipeline = this._renderPipelines[renderPipelineName];
        if (!renderPipeline) {
            return;
        }
        renderPipeline._attachCameras(cameras, unique);
    }
    /**
     * Detaches a camera from the pipeline
     * @param renderPipelineName The name of the pipeline to detach from
     * @param cameras the camera to detach
     */
    detachCamerasFromRenderPipeline(renderPipelineName, cameras) {
        const renderPipeline = this._renderPipelines[renderPipelineName];
        if (!renderPipeline) {
            return;
        }
        renderPipeline._detachCameras(cameras);
    }
    /**
     * Enables an effect by name on a pipeline
     * @param renderPipelineName the name of the pipeline to enable the effect in
     * @param renderEffectName the name of the effect to enable
     * @param cameras the cameras that the effect should be enabled on
     */
    enableEffectInPipeline(renderPipelineName, renderEffectName, cameras) {
        const renderPipeline = this._renderPipelines[renderPipelineName];
        if (!renderPipeline) {
            return;
        }
        renderPipeline._enableEffect(renderEffectName, cameras);
    }
    /**
     * Disables an effect by name on a pipeline
     * @param renderPipelineName the name of the pipeline to disable the effect in
     * @param renderEffectName the name of the effect to disable
     * @param cameras the cameras that the effect should be disabled on
     */
    disableEffectInPipeline(renderPipelineName, renderEffectName, cameras) {
        const renderPipeline = this._renderPipelines[renderPipelineName];
        if (!renderPipeline) {
            return;
        }
        renderPipeline._disableEffect(renderEffectName, cameras);
    }
    /**
     * Updates the state of all contained render pipelines and disposes of any non supported pipelines
     */
    update() {
        for (const renderPipelineName in this._renderPipelines) {
            if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {
                const pipeline = this._renderPipelines[renderPipelineName];
                if (!pipeline.isSupported) {
                    pipeline.dispose();
                    delete this._renderPipelines[renderPipelineName];
                }
                else {
                    pipeline._update();
                }
            }
        }
    }
    /** @internal */
    _rebuild() {
        for (const renderPipelineName in this._renderPipelines) {
            if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {
                const pipeline = this._renderPipelines[renderPipelineName];
                pipeline._rebuild();
            }
        }
    }
    /**
     * Disposes of the manager and pipelines
     */
    dispose() {
        for (const renderPipelineName in this._renderPipelines) {
            if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {
                const pipeline = this._renderPipelines[renderPipelineName];
                pipeline.dispose();
            }
        }
    }
}
//# sourceMappingURL=postProcessRenderPipelineManager.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js



Object.defineProperty(core_scene/* Scene */.Z.prototype, "postProcessRenderPipelineManager", {
    get: function () {
        if (!this._postProcessRenderPipelineManager) {
            // Register the G Buffer component to the scene.
            let component = this._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_POSTPROCESSRENDERPIPELINEMANAGER);
            if (!component) {
                component = new PostProcessRenderPipelineManagerSceneComponent(this);
                this._addComponent(component);
            }
            this._postProcessRenderPipelineManager = new PostProcessRenderPipelineManager();
        }
        return this._postProcessRenderPipelineManager;
    },
    enumerable: true,
    configurable: true,
});
/**
 * Defines the Render Pipeline scene component responsible to rendering pipelines
 */
class PostProcessRenderPipelineManagerSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_POSTPROCESSRENDERPIPELINEMANAGER;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._gatherRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER, this, this._gatherRenderTargets);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        if (this.scene._postProcessRenderPipelineManager) {
            this.scene._postProcessRenderPipelineManager._rebuild();
        }
    }
    /**
     * Disposes the component and the associated resources
     */
    dispose() {
        if (this.scene._postProcessRenderPipelineManager) {
            this.scene._postProcessRenderPipelineManager.dispose();
        }
    }
    _gatherRenderTargets() {
        if (this.scene._postProcessRenderPipelineManager) {
            this.scene._postProcessRenderPipelineManager.update();
        }
    }
}
//# sourceMappingURL=postProcessRenderPipelineManagerSceneComponent.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js





















/**
 * The default rendering pipeline can be added to a scene to apply common post processing effects such as anti-aliasing or depth of field.
 * See https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/defaultRenderingPipeline
 */
class DefaultRenderingPipeline extends PostProcessRenderPipeline {
    /**
     * Enable or disable automatic building of the pipeline when effects are enabled and disabled.
     * If false, you will have to manually call prepare() to update the pipeline.
     */
    get automaticBuild() {
        return this._buildAllowed;
    }
    set automaticBuild(value) {
        this._buildAllowed = value;
    }
    /**
     * Gets active scene
     */
    get scene() {
        return this._scene;
    }
    /**
     * Enable or disable the sharpen process from the pipeline
     */
    set sharpenEnabled(enabled) {
        if (this._sharpenEnabled === enabled) {
            return;
        }
        this._sharpenEnabled = enabled;
        this._buildPipeline();
    }
    get sharpenEnabled() {
        return this._sharpenEnabled;
    }
    /**
     * Specifies the size of the bloom blur kernel, relative to the final output size
     */
    get bloomKernel() {
        return this._bloomKernel;
    }
    set bloomKernel(value) {
        this._bloomKernel = value;
        this.bloom.kernel = value / this._hardwareScaleLevel;
    }
    /**
     * The strength of the bloom.
     */
    set bloomWeight(value) {
        if (this._bloomWeight === value) {
            return;
        }
        this.bloom.weight = value;
        this._bloomWeight = value;
    }
    get bloomWeight() {
        return this._bloomWeight;
    }
    /**
     * The luminance threshold to find bright areas of the image to bloom.
     */
    set bloomThreshold(value) {
        if (this._bloomThreshold === value) {
            return;
        }
        this.bloom.threshold = value;
        this._bloomThreshold = value;
    }
    get bloomThreshold() {
        return this._bloomThreshold;
    }
    /**
     * The scale of the bloom, lower value will provide better performance.
     */
    set bloomScale(value) {
        if (this._bloomScale === value) {
            return;
        }
        this._bloomScale = value;
        // recreate bloom and dispose old as this setting is not dynamic
        this._rebuildBloom();
        this._buildPipeline();
    }
    get bloomScale() {
        return this._bloomScale;
    }
    /**
     * Enable or disable the bloom from the pipeline
     */
    set bloomEnabled(enabled) {
        if (this._bloomEnabled === enabled) {
            return;
        }
        this._bloomEnabled = enabled;
        this._buildPipeline();
    }
    get bloomEnabled() {
        return this._bloomEnabled;
    }
    _rebuildBloom() {
        // recreate bloom and dispose old as this setting is not dynamic
        const oldBloom = this.bloom;
        this.bloom = new BloomEffect(this._scene, this.bloomScale, this._bloomWeight, this.bloomKernel / this._hardwareScaleLevel, this._defaultPipelineTextureType, false);
        this.bloom.threshold = oldBloom.threshold;
        for (let i = 0; i < this._cameras.length; i++) {
            oldBloom.disposeEffects(this._cameras[i]);
        }
    }
    /**
     * If the depth of field is enabled.
     */
    get depthOfFieldEnabled() {
        return this._depthOfFieldEnabled;
    }
    set depthOfFieldEnabled(enabled) {
        if (this._depthOfFieldEnabled === enabled) {
            return;
        }
        this._depthOfFieldEnabled = enabled;
        this._buildPipeline();
    }
    /**
     * Blur level of the depth of field effect. (Higher blur will effect performance)
     */
    get depthOfFieldBlurLevel() {
        return this._depthOfFieldBlurLevel;
    }
    set depthOfFieldBlurLevel(value) {
        if (this._depthOfFieldBlurLevel === value) {
            return;
        }
        this._depthOfFieldBlurLevel = value;
        // recreate dof and dispose old as this setting is not dynamic
        const oldDof = this.depthOfField;
        this.depthOfField = new DepthOfFieldEffect(this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, false);
        this.depthOfField.focalLength = oldDof.focalLength;
        this.depthOfField.focusDistance = oldDof.focusDistance;
        this.depthOfField.fStop = oldDof.fStop;
        this.depthOfField.lensSize = oldDof.lensSize;
        for (let i = 0; i < this._cameras.length; i++) {
            oldDof.disposeEffects(this._cameras[i]);
        }
        this._buildPipeline();
    }
    /**
     * If the anti aliasing is enabled.
     */
    set fxaaEnabled(enabled) {
        if (this._fxaaEnabled === enabled) {
            return;
        }
        this._fxaaEnabled = enabled;
        this._buildPipeline();
    }
    get fxaaEnabled() {
        return this._fxaaEnabled;
    }
    /**
     * MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)
     */
    set samples(sampleCount) {
        if (this._samples === sampleCount) {
            return;
        }
        this._samples = sampleCount;
        this._buildPipeline();
    }
    get samples() {
        return this._samples;
    }
    /**
     * If image processing is enabled.
     */
    set imageProcessingEnabled(enabled) {
        if (this._imageProcessingEnabled === enabled) {
            return;
        }
        this._scene.imageProcessingConfiguration.isEnabled = enabled;
    }
    get imageProcessingEnabled() {
        return this._imageProcessingEnabled;
    }
    /**
     * If glow layer is enabled. (Adds a glow effect to emmissive materials)
     */
    set glowLayerEnabled(enabled) {
        if (enabled && !this._glowLayer) {
            this._glowLayer = new GlowLayer("", this._scene);
        }
        else if (!enabled && this._glowLayer) {
            this._glowLayer.dispose();
            this._glowLayer = null;
        }
    }
    get glowLayerEnabled() {
        return this._glowLayer != null;
    }
    /**
     * Gets the glow layer (or null if not defined)
     */
    get glowLayer() {
        return this._glowLayer;
    }
    /**
     * Enable or disable the chromaticAberration process from the pipeline
     */
    set chromaticAberrationEnabled(enabled) {
        if (this._chromaticAberrationEnabled === enabled) {
            return;
        }
        this._chromaticAberrationEnabled = enabled;
        this._buildPipeline();
    }
    get chromaticAberrationEnabled() {
        return this._chromaticAberrationEnabled;
    }
    /**
     * Enable or disable the grain process from the pipeline
     */
    set grainEnabled(enabled) {
        if (this._grainEnabled === enabled) {
            return;
        }
        this._grainEnabled = enabled;
        this._buildPipeline();
    }
    get grainEnabled() {
        return this._grainEnabled;
    }
    /**
     * Instantiates a DefaultRenderingPipeline.
     * @param name The rendering pipeline name (default: "")
     * @param hdr If high dynamic range textures should be used (default: true)
     * @param scene The scene linked to this pipeline (default: the last created scene)
     * @param cameras The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)
     * @param automaticBuild If false, you will have to manually call prepare() to update the pipeline (default: true)
     */
    constructor(name = "", hdr = true, scene = engineStore/* EngineStore */.q.LastCreatedScene, cameras, automaticBuild = true) {
        super(scene.getEngine(), name);
        this._camerasToBeAttached = [];
        /**
         * ID of the sharpen post process,
         */
        this.SharpenPostProcessId = "SharpenPostProcessEffect";
        /**
         * @ignore
         * ID of the image processing post process;
         */
        this.ImageProcessingPostProcessId = "ImageProcessingPostProcessEffect";
        /**
         * @ignore
         * ID of the Fast Approximate Anti-Aliasing post process;
         */
        this.FxaaPostProcessId = "FxaaPostProcessEffect";
        /**
         * ID of the chromatic aberration post process,
         */
        this.ChromaticAberrationPostProcessId = "ChromaticAberrationPostProcessEffect";
        /**
         * ID of the grain post process
         */
        this.GrainPostProcessId = "GrainPostProcessEffect";
        /**
         * Glow post process which adds a glow to emissive areas of the image
         */
        this._glowLayer = null;
        /**
         * Animations which can be used to tweak settings over a period of time
         */
        this.animations = [];
        this._imageProcessingConfigurationObserver = null;
        // Values
        this._sharpenEnabled = false;
        this._bloomEnabled = false;
        this._depthOfFieldEnabled = false;
        this._depthOfFieldBlurLevel = 0 /* DepthOfFieldEffectBlurLevel.Low */;
        this._fxaaEnabled = false;
        this._imageProcessingEnabled = true;
        this._bloomScale = 0.5;
        this._chromaticAberrationEnabled = false;
        this._grainEnabled = false;
        this._buildAllowed = true;
        /**
         * This is triggered each time the pipeline has been built.
         */
        this.onBuildObservable = new Misc_observable/* Observable */.cP();
        this._resizeObserver = null;
        this._hardwareScaleLevel = 1.0;
        this._bloomKernel = 64;
        /**
         * Specifies the weight of the bloom in the final rendering
         */
        this._bloomWeight = 0.15;
        /**
         * Specifies the luma threshold for the area that will be blurred by the bloom
         */
        this._bloomThreshold = 0.9;
        this._samples = 1;
        this._hasCleared = false;
        this._prevPostProcess = null;
        this._prevPrevPostProcess = null;
        this._depthOfFieldSceneObserver = null;
        this._activeCameraChangedObserver = null;
        this._activeCamerasChangedObserver = null;
        this._cameras = cameras || scene.cameras;
        this._cameras = this._cameras.slice();
        this._camerasToBeAttached = this._cameras.slice();
        this._buildAllowed = automaticBuild;
        // Initialize
        this._scene = scene;
        const caps = this._scene.getEngine().getCaps();
        this._hdr = hdr && (caps.textureHalfFloatRender || caps.textureFloatRender);
        // Misc
        if (this._hdr) {
            if (caps.textureHalfFloatRender) {
                this._defaultPipelineTextureType = 2;
            }
            else if (caps.textureFloatRender) {
                this._defaultPipelineTextureType = 1;
            }
        }
        else {
            this._defaultPipelineTextureType = 0;
        }
        // Attach
        scene.postProcessRenderPipelineManager.addPipeline(this);
        const engine = this._scene.getEngine();
        // Create post processes before hand so they can be modified before enabled.
        // Block compilation flag is set to true to avoid compilation prior to use, these will be updated on first use in build pipeline.
        this.sharpen = new SharpenPostProcess("sharpen", 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType, true);
        this._sharpenEffect = new PostProcessRenderEffect(engine, this.SharpenPostProcessId, () => {
            return this.sharpen;
        }, true);
        this.depthOfField = new DepthOfFieldEffect(this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, true);
        // To keep the bloom sizes consistent across different display densities, factor in the hardware scaling level.
        this._hardwareScaleLevel = engine.getHardwareScalingLevel();
        this._resizeObserver = engine.onResizeObservable.add(() => {
            this._hardwareScaleLevel = engine.getHardwareScalingLevel();
            this.bloomKernel = this._bloomKernel;
        });
        this.bloom = new BloomEffect(this._scene, this._bloomScale, this._bloomWeight, this.bloomKernel / this._hardwareScaleLevel, this._defaultPipelineTextureType, true);
        this.chromaticAberration = new ChromaticAberrationPostProcess("ChromaticAberration", engine.getRenderWidth(), engine.getRenderHeight(), 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType, true);
        this._chromaticAberrationEffect = new PostProcessRenderEffect(engine, this.ChromaticAberrationPostProcessId, () => {
            return this.chromaticAberration;
        }, true);
        this.grain = new GrainPostProcess("Grain", 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType, true);
        this._grainEffect = new PostProcessRenderEffect(engine, this.GrainPostProcessId, () => {
            return this.grain;
        }, true);
        let avoidReentrancyAtConstructionTime = true;
        this._imageProcessingConfigurationObserver = this._scene.imageProcessingConfiguration.onUpdateParameters.add(() => {
            this.bloom._downscale._exposure = this._scene.imageProcessingConfiguration.exposure;
            if (this.imageProcessingEnabled !== this._scene.imageProcessingConfiguration.isEnabled) {
                this._imageProcessingEnabled = this._scene.imageProcessingConfiguration.isEnabled;
                // Avoid re-entrant problems by deferring the call to _buildPipeline because the call to _buildPipeline
                // at the end of the constructor could end up triggering imageProcessingConfiguration.onUpdateParameters!
                // Note that the pipeline could have been disposed before the deferred call was executed, but in that case
                // _buildAllowed will have been set to false, preventing _buildPipeline from being executed.
                if (avoidReentrancyAtConstructionTime) {
                    tools/* Tools */.S0.SetImmediate(() => {
                        this._buildPipeline();
                    });
                }
                else {
                    this._buildPipeline();
                }
            }
        });
        this._buildPipeline();
        avoidReentrancyAtConstructionTime = false;
    }
    /**
     * Get the class name
     * @returns "DefaultRenderingPipeline"
     */
    getClassName() {
        return "DefaultRenderingPipeline";
    }
    /**
     * Force the compilation of the entire pipeline.
     */
    prepare() {
        const previousState = this._buildAllowed;
        this._buildAllowed = true;
        this._buildPipeline();
        this._buildAllowed = previousState;
    }
    _setAutoClearAndTextureSharing(postProcess, skipTextureSharing = false) {
        if (this._hasCleared) {
            postProcess.autoClear = false;
        }
        else {
            postProcess.autoClear = true;
            this._scene.autoClear = false;
            this._hasCleared = true;
        }
        if (!skipTextureSharing) {
            if (this._prevPrevPostProcess) {
                postProcess.shareOutputWith(this._prevPrevPostProcess);
            }
            else {
                postProcess.useOwnOutput();
            }
            if (this._prevPostProcess) {
                this._prevPrevPostProcess = this._prevPostProcess;
            }
            this._prevPostProcess = postProcess;
        }
    }
    _buildPipeline() {
        if (!this._buildAllowed) {
            return;
        }
        this._scene.autoClear = true;
        const engine = this._scene.getEngine();
        this._disposePostProcesses();
        if (this._cameras !== null) {
            this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
            // get back cameras to be used to reattach pipeline
            this._cameras = this._camerasToBeAttached.slice();
        }
        this._reset();
        this._prevPostProcess = null;
        this._prevPrevPostProcess = null;
        this._hasCleared = false;
        if (this.depthOfFieldEnabled) {
            // Multi camera suport
            if (this._cameras.length > 1) {
                for (const camera of this._cameras) {
                    const depthRenderer = this._scene.enableDepthRenderer(camera);
                    depthRenderer.useOnlyInActiveCamera = true;
                }
                this._depthOfFieldSceneObserver = this._scene.onAfterRenderTargetsRenderObservable.add((scene) => {
                    if (this._cameras.indexOf(scene.activeCamera) > -1) {
                        this.depthOfField.depthTexture = scene.enableDepthRenderer(scene.activeCamera).getDepthMap();
                    }
                });
            }
            else {
                this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);
                const depthRenderer = this._scene.enableDepthRenderer(this._cameras[0]);
                this.depthOfField.depthTexture = depthRenderer.getDepthMap();
            }
            if (!this.depthOfField._isReady()) {
                this.depthOfField._updateEffects();
            }
            this.addEffect(this.depthOfField);
            this._setAutoClearAndTextureSharing(this.depthOfField._effects[0], true);
        }
        else {
            this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);
        }
        if (this.bloomEnabled) {
            if (!this.bloom._isReady()) {
                this.bloom._updateEffects();
            }
            this.addEffect(this.bloom);
            this._setAutoClearAndTextureSharing(this.bloom._effects[0], true);
        }
        if (this._imageProcessingEnabled) {
            this.imageProcessing = new ImageProcessingPostProcess("imageProcessing", 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType, this.scene.imageProcessingConfiguration);
            if (this._hdr) {
                this.addEffect(new PostProcessRenderEffect(engine, this.ImageProcessingPostProcessId, () => {
                    return this.imageProcessing;
                }, true));
                this._setAutoClearAndTextureSharing(this.imageProcessing);
            }
            else {
                this._scene.imageProcessingConfiguration.applyByPostProcess = false;
            }
            if (!this._cameras || this._cameras.length === 0) {
                this._scene.imageProcessingConfiguration.applyByPostProcess = false;
            }
            if (!this.imageProcessing.getEffect()) {
                this.imageProcessing._updateParameters();
            }
        }
        if (this.sharpenEnabled) {
            if (!this.sharpen.isReady()) {
                this.sharpen.updateEffect();
            }
            this.addEffect(this._sharpenEffect);
            this._setAutoClearAndTextureSharing(this.sharpen);
        }
        if (this.grainEnabled) {
            if (!this.grain.isReady()) {
                this.grain.updateEffect();
            }
            this.addEffect(this._grainEffect);
            this._setAutoClearAndTextureSharing(this.grain);
        }
        if (this.chromaticAberrationEnabled) {
            if (!this.chromaticAberration.isReady()) {
                this.chromaticAberration.updateEffect();
            }
            this.addEffect(this._chromaticAberrationEffect);
            this._setAutoClearAndTextureSharing(this.chromaticAberration);
        }
        if (this.fxaaEnabled) {
            this.fxaa = new FxaaPostProcess("fxaa", 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType);
            this.addEffect(new PostProcessRenderEffect(engine, this.FxaaPostProcessId, () => {
                return this.fxaa;
            }, true));
            this._setAutoClearAndTextureSharing(this.fxaa, true);
        }
        if (this._cameras !== null) {
            this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
        }
        // In multicamera mode, the scene needs to autoclear in between cameras.
        if ((this._scene.activeCameras && this._scene.activeCameras.length > 1) || (this._scene.activeCamera && this._cameras.indexOf(this._scene.activeCamera) === -1)) {
            this._scene.autoClear = true;
        }
        // The active camera on the scene can be changed anytime
        if (!this._activeCameraChangedObserver) {
            this._activeCameraChangedObserver = this._scene.onActiveCameraChanged.add(() => {
                if (this._scene.activeCamera && this._cameras.indexOf(this._scene.activeCamera) === -1) {
                    this._scene.autoClear = true;
                }
            });
        }
        if (!this._activeCamerasChangedObserver) {
            this._activeCamerasChangedObserver = this._scene.onActiveCamerasChanged.add(() => {
                if (this._scene.activeCameras && this._scene.activeCameras.length > 1) {
                    this._scene.autoClear = true;
                }
            });
        }
        this._adaptPostProcessesToViewPort();
        if (!this._enableMSAAOnFirstPostProcess(this.samples) && this.samples > 1) {
            logger/* Logger */.V.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
        }
        this.onBuildObservable.notifyObservers(this);
    }
    _disposePostProcesses(disposeNonRecreated = false) {
        for (let i = 0; i < this._cameras.length; i++) {
            const camera = this._cameras[i];
            if (this.imageProcessing) {
                this.imageProcessing.dispose(camera);
            }
            if (this.fxaa) {
                this.fxaa.dispose(camera);
            }
            // These are created in the constructor and should not be disposed on every pipeline change
            if (disposeNonRecreated) {
                if (this.sharpen) {
                    this.sharpen.dispose(camera);
                }
                if (this.depthOfField) {
                    this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);
                    this.depthOfField.disposeEffects(camera);
                }
                if (this.bloom) {
                    this.bloom.disposeEffects(camera);
                }
                if (this.chromaticAberration) {
                    this.chromaticAberration.dispose(camera);
                }
                if (this.grain) {
                    this.grain.dispose(camera);
                }
                if (this._glowLayer) {
                    this._glowLayer.dispose();
                }
            }
        }
        this.imageProcessing = null;
        this.fxaa = null;
        if (disposeNonRecreated) {
            this.sharpen = null;
            this._sharpenEffect = null;
            this.depthOfField = null;
            this.bloom = null;
            this.chromaticAberration = null;
            this._chromaticAberrationEffect = null;
            this.grain = null;
            this._grainEffect = null;
            this._glowLayer = null;
        }
    }
    /**
     * Adds a camera to the pipeline
     * @param camera the camera to be added
     */
    addCamera(camera) {
        this._camerasToBeAttached.push(camera);
        this._buildPipeline();
    }
    /**
     * Removes a camera from the pipeline
     * @param camera the camera to remove
     */
    removeCamera(camera) {
        const index = this._camerasToBeAttached.indexOf(camera);
        this._camerasToBeAttached.splice(index, 1);
        this._buildPipeline();
    }
    /**
     * Dispose of the pipeline and stop all post processes
     */
    dispose() {
        this._buildAllowed = false;
        this.onBuildObservable.clear();
        this._disposePostProcesses(true);
        this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
        this._scene._postProcessRenderPipelineManager.removePipeline(this.name);
        this._scene.autoClear = true;
        if (this._resizeObserver) {
            this._scene.getEngine().onResizeObservable.remove(this._resizeObserver);
            this._resizeObserver = null;
        }
        this._scene.onActiveCameraChanged.remove(this._activeCameraChangedObserver);
        this._scene.onActiveCamerasChanged.remove(this._activeCamerasChangedObserver);
        this._scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigurationObserver);
        super.dispose();
    }
    /**
     * Serialize the rendering pipeline (Used when exporting)
     * @returns the serialized object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.customType = "DefaultRenderingPipeline";
        return serializationObject;
    }
    /**
     * Parse the serialized pipeline
     * @param source Source pipeline.
     * @param scene The scene to load the pipeline to.
     * @param rootUrl The URL of the serialized pipeline.
     * @returns An instantiated pipeline from the serialized object.
     */
    static Parse(source, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => new DefaultRenderingPipeline(source._name, source._name._hdr, scene), source, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "sharpenEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "bloomKernel", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "_bloomWeight", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "_bloomThreshold", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "_hdr", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "bloomWeight", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "bloomThreshold", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "bloomScale", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "bloomEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "depthOfFieldEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "depthOfFieldBlurLevel", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "fxaaEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "samples", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "imageProcessingEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "glowLayerEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "chromaticAberrationEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], DefaultRenderingPipeline.prototype, "grainEnabled", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.DefaultRenderingPipeline", DefaultRenderingPipeline);
//# sourceMappingURL=defaultRenderingPipeline.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/chromaticAberration.fragment.js
var chromaticAberration_fragment = __webpack_require__(32048);
;// ./node_modules/@babylonjs/core/Shaders/lensHighlights.fragment.js
// Do not edit.

const lensHighlights_fragment_name = "lensHighlightsPixelShader";
const lensHighlights_fragment_shader = `uniform sampler2D textureSampler; 
uniform float gain;uniform float threshold;uniform float screen_width;uniform float screen_height;varying vec2 vUV;vec4 highlightColor(vec4 color) {vec4 highlight=color;float luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));float lum_threshold;if (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }
else { lum_threshold=0.5+0.44*threshold; }
luminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);highlight*=luminance*gain;highlight.a=1.0;return highlight;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{vec4 original=texture2D(textureSampler,vUV);if (gain==-1.0) {gl_FragColor=vec4(0.0,0.0,0.0,1.0);return;}
float w=2.0/screen_width;float h=2.0/screen_height;float weight=1.0;vec4 blurred=vec4(0.0,0.0,0.0,0.0);
#ifdef PENTAGON
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));
#else
blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));
#endif
blurred/=39.0;gl_FragColor=blurred;}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[lensHighlights_fragment_name] = lensHighlights_fragment_shader;
/** @internal */
const lensHighlightsPixelShader = { name: lensHighlights_fragment_name, shader: lensHighlights_fragment_shader };
//# sourceMappingURL=lensHighlights.fragment.js.map
;// ./node_modules/@babylonjs/core/Shaders/depthOfField.fragment.js
// Do not edit.

const depthOfField_fragment_name = "depthOfFieldPixelShader";
const depthOfField_fragment_shader = `uniform sampler2D textureSampler;uniform sampler2D highlightsSampler;uniform sampler2D depthSampler;uniform sampler2D grainSampler;uniform float grain_amount;uniform bool blur_noise;uniform float screen_width;uniform float screen_height;uniform float distortion;uniform bool dof_enabled;uniform float screen_distance; 
uniform float aperture;uniform float darken;uniform float edge_blur;uniform bool highlights;uniform float near;uniform float far;varying vec2 vUV;
#define PI 3.14159265
#define TWOPI 6.28318530
#define inverse_focal_length 0.1 
vec2 centered_screen_pos;vec2 distorted_coords;float radius2;float radius;vec2 rand(vec2 co)
{float noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));float noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));return clamp(vec2(noise1,noise2),0.0,1.0);}
vec2 getDistortedCoords(vec2 coords) {if (distortion==0.0) { return coords; }
vec2 direction=1.0*normalize(centered_screen_pos);vec2 dist_coords=vec2(0.5,0.5);dist_coords.x=0.5+direction.x*radius2*1.0;dist_coords.y=0.5+direction.y*radius2*1.0;float dist_amount=clamp(distortion*0.23,0.0,1.0);dist_coords=mix(coords,dist_coords,dist_amount);return dist_coords;}
float sampleScreen(inout vec4 color,in vec2 offset,in float weight) {vec2 coords=distorted_coords;float angle=rand(coords*100.0).x*TWOPI;coords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));color+=texture2D(textureSampler,coords)*weight;return weight;}
float getBlurLevel(float size) {return min(3.0,ceil(size/1.0));}
vec4 getBlurColor(float size) {vec4 col=texture2D(textureSampler,distorted_coords);float blur_level=getBlurLevel(size);float w=(size/screen_width);float h=(size/screen_height);float total_weight=1.0;vec2 sample_coords;total_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);total_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);total_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);total_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);total_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);total_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);total_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);total_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);total_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);total_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);if (blur_level>1.0) {total_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);total_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);total_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);total_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);total_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);total_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);total_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);total_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);total_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);total_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);}
if (blur_level>2.0) {total_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);total_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);total_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);total_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);total_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);total_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);total_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);total_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);total_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);}
col/=total_weight; 
if (darken>0.0) {col.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);}
return col;}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{centered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);radius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;radius=sqrt(radius2);distorted_coords=getDistortedCoords(vUV); 
vec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height); 
float depth=texture2D(depthSampler,distorted_coords).r; 
float distance=near+(far-near)*depth; 
vec4 color=texture2D(textureSampler,vUV); 
float coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));if (dof_enabled==false || coc<0.07) { coc=0.0; }
float edge_blur_amount=0.0;if (edge_blur>0.0) {edge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;}
float blur_amount=max(edge_blur_amount,coc);if (blur_amount==0.0) {gl_FragColor=texture2D(textureSampler,distorted_coords);}
else {gl_FragColor=getBlurColor(blur_amount*1.7);if (highlights) {gl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;}
if (blur_noise) {vec2 noise=rand(distorted_coords)*0.01*blur_amount;vec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);gl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;}}
if (grain_amount>0.0) {vec4 grain_color=texture2D(grainSampler,texels_coords*0.003);gl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;}}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[depthOfField_fragment_name] = depthOfField_fragment_shader;
/** @internal */
const depthOfFieldPixelShader = { name: depthOfField_fragment_name, shader: depthOfField_fragment_shader };
//# sourceMappingURL=depthOfField.fragment.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js











/**
 * BABYLON.JS Chromatic Aberration GLSL Shader
 * Author: Olivier Guyot
 * Separates very slightly R, G and B colors on the edges of the screen
 * Inspired by Francois Tarlier & Martins Upitis
 */
class LensRenderingPipeline extends PostProcessRenderPipeline {
    /**
     * @constructor
     *
     * Effect parameters are as follow:
     * {
     *      chromatic_aberration: number;       // from 0 to x (1 for realism)
     *      edge_blur: number;                  // from 0 to x (1 for realism)
     *      distortion: number;                 // from 0 to x (1 for realism), note that this will effect the pointer position precision
     *      grain_amount: number;               // from 0 to 1
     *      grain_texture: BABYLON.Texture;     // texture to use for grain effect; if unset, use random B&W noise
     *      dof_focus_distance: number;         // depth-of-field: focus distance; unset to disable (disabled by default)
     *      dof_aperture: number;               // depth-of-field: focus blur bias (default: 1)
     *      dof_darken: number;                 // depth-of-field: darken that which is out of focus (from 0 to 1, disabled by default)
     *      dof_pentagon: boolean;              // depth-of-field: makes a pentagon-like "bokeh" effect
     *      dof_gain: number;                   // depth-of-field: highlights gain; unset to disable (disabled by default)
     *      dof_threshold: number;              // depth-of-field: highlights threshold (default: 1)
     *      blur_noise: boolean;                // add a little bit of noise to the blur (default: true)
     * }
     * Note: if an effect parameter is unset, effect is disabled
     *
     * @param name The rendering pipeline name
     * @param parameters - An object containing all parameters (see above)
     * @param scene The scene linked to this pipeline
     * @param ratio The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5)
     * @param cameras The array of cameras that the rendering pipeline will be attached to
     */
    constructor(name, parameters, scene, ratio = 1.0, cameras) {
        super(scene.getEngine(), name);
        // Lens effects can be of the following:
        // - chromatic aberration (slight shift of RGB colors)
        // - blur on the edge of the lens
        // - lens distortion
        // - depth-of-field blur & highlights enhancing
        // - depth-of-field 'bokeh' effect (shapes appearing in blurred areas)
        // - grain effect (noise or custom texture)
        // Two additional texture samplers are needed:
        // - depth map (for depth-of-field)
        // - grain texture
        /**
         * @ignore
         * The chromatic aberration PostProcess id in the pipeline
         */
        this.LensChromaticAberrationEffect = "LensChromaticAberrationEffect";
        /**
         * @ignore
         * The highlights enhancing PostProcess id in the pipeline
         */
        this.HighlightsEnhancingEffect = "HighlightsEnhancingEffect";
        /**
         * @ignore
         * The depth-of-field PostProcess id in the pipeline
         */
        this.LensDepthOfFieldEffect = "LensDepthOfFieldEffect";
        this._pentagonBokehIsEnabled = false;
        this._scene = scene;
        // Fetch texture samplers
        this._depthTexture = scene.enableDepthRenderer().getDepthMap(); // Force depth renderer "on"
        if (parameters.grain_texture) {
            this._grainTexture = parameters.grain_texture;
        }
        else {
            this._createGrainTexture();
        }
        // save parameters
        this._edgeBlur = parameters.edge_blur ? parameters.edge_blur : 0;
        this._grainAmount = parameters.grain_amount ? parameters.grain_amount : 0;
        this._chromaticAberration = parameters.chromatic_aberration ? parameters.chromatic_aberration : 0;
        this._distortion = parameters.distortion ? parameters.distortion : 0;
        this._highlightsGain = parameters.dof_gain !== undefined ? parameters.dof_gain : -1;
        this._highlightsThreshold = parameters.dof_threshold ? parameters.dof_threshold : 1;
        this._dofDistance = parameters.dof_focus_distance !== undefined ? parameters.dof_focus_distance : -1;
        this._dofAperture = parameters.dof_aperture ? parameters.dof_aperture : 1;
        this._dofDarken = parameters.dof_darken ? parameters.dof_darken : 0;
        this._dofPentagon = parameters.dof_pentagon !== undefined ? parameters.dof_pentagon : true;
        this._blurNoise = parameters.blur_noise !== undefined ? parameters.blur_noise : true;
        // Create effects
        this._createChromaticAberrationPostProcess(ratio);
        this._createHighlightsPostProcess(ratio);
        this._createDepthOfFieldPostProcess(ratio / 4);
        // Set up pipeline
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.LensChromaticAberrationEffect, () => {
            return this._chromaticAberrationPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.HighlightsEnhancingEffect, () => {
            return this._highlightsPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.LensDepthOfFieldEffect, () => {
            return this._depthOfFieldPostProcess;
        }, true));
        if (this._highlightsGain === -1) {
            this._disableEffect(this.HighlightsEnhancingEffect, null);
        }
        // Finish
        scene.postProcessRenderPipelineManager.addPipeline(this);
        if (cameras) {
            scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);
        }
    }
    /**
     * Get the class name
     * @returns "LensRenderingPipeline"
     */
    getClassName() {
        return "LensRenderingPipeline";
    }
    // Properties
    /**
     * Gets associated scene
     */
    get scene() {
        return this._scene;
    }
    /**
     * Gets or sets the edge blur
     */
    get edgeBlur() {
        return this._edgeBlur;
    }
    set edgeBlur(value) {
        this.setEdgeBlur(value);
    }
    /**
     * Gets or sets the grain amount
     */
    get grainAmount() {
        return this._grainAmount;
    }
    set grainAmount(value) {
        this.setGrainAmount(value);
    }
    /**
     * Gets or sets the chromatic aberration amount
     */
    get chromaticAberration() {
        return this._chromaticAberration;
    }
    set chromaticAberration(value) {
        this.setChromaticAberration(value);
    }
    /**
     * Gets or sets the depth of field aperture
     */
    get dofAperture() {
        return this._dofAperture;
    }
    set dofAperture(value) {
        this.setAperture(value);
    }
    /**
     * Gets or sets the edge distortion
     */
    get edgeDistortion() {
        return this._distortion;
    }
    set edgeDistortion(value) {
        this.setEdgeDistortion(value);
    }
    /**
     * Gets or sets the depth of field distortion
     */
    get dofDistortion() {
        return this._dofDistance;
    }
    set dofDistortion(value) {
        this.setFocusDistance(value);
    }
    /**
     * Gets or sets the darken out of focus amount
     */
    get darkenOutOfFocus() {
        return this._dofDarken;
    }
    set darkenOutOfFocus(value) {
        this.setDarkenOutOfFocus(value);
    }
    /**
     * Gets or sets a boolean indicating if blur noise is enabled
     */
    get blurNoise() {
        return this._blurNoise;
    }
    set blurNoise(value) {
        this._blurNoise = value;
    }
    /**
     * Gets or sets a boolean indicating if pentagon bokeh is enabled
     */
    get pentagonBokeh() {
        return this._pentagonBokehIsEnabled;
    }
    set pentagonBokeh(value) {
        if (value) {
            this.enablePentagonBokeh();
        }
        else {
            this.disablePentagonBokeh();
        }
    }
    /**
     * Gets or sets the highlight grain amount
     */
    get highlightsGain() {
        return this._highlightsGain;
    }
    set highlightsGain(value) {
        this.setHighlightsGain(value);
    }
    /**
     * Gets or sets the highlight threshold
     */
    get highlightsThreshold() {
        return this._highlightsThreshold;
    }
    set highlightsThreshold(value) {
        this.setHighlightsThreshold(value);
    }
    // public methods (self explanatory)
    /**
     * Sets the amount of blur at the edges
     * @param amount blur amount
     */
    setEdgeBlur(amount) {
        this._edgeBlur = amount;
    }
    /**
     * Sets edge blur to 0
     */
    disableEdgeBlur() {
        this._edgeBlur = 0;
    }
    /**
     * Sets the amount of grain
     * @param amount Amount of grain
     */
    setGrainAmount(amount) {
        this._grainAmount = amount;
    }
    /**
     * Set grain amount to 0
     */
    disableGrain() {
        this._grainAmount = 0;
    }
    /**
     * Sets the chromatic aberration amount
     * @param amount amount of chromatic aberration
     */
    setChromaticAberration(amount) {
        this._chromaticAberration = amount;
    }
    /**
     * Sets chromatic aberration amount to 0
     */
    disableChromaticAberration() {
        this._chromaticAberration = 0;
    }
    /**
     * Sets the EdgeDistortion amount
     * @param amount amount of EdgeDistortion
     */
    setEdgeDistortion(amount) {
        this._distortion = amount;
    }
    /**
     * Sets edge distortion to 0
     */
    disableEdgeDistortion() {
        this._distortion = 0;
    }
    /**
     * Sets the FocusDistance amount
     * @param amount amount of FocusDistance
     */
    setFocusDistance(amount) {
        this._dofDistance = amount;
    }
    /**
     * Disables depth of field
     */
    disableDepthOfField() {
        this._dofDistance = -1;
    }
    /**
     * Sets the Aperture amount
     * @param amount amount of Aperture
     */
    setAperture(amount) {
        this._dofAperture = amount;
    }
    /**
     * Sets the DarkenOutOfFocus amount
     * @param amount amount of DarkenOutOfFocus
     */
    setDarkenOutOfFocus(amount) {
        this._dofDarken = amount;
    }
    /**
     * Creates a pentagon bokeh effect
     */
    enablePentagonBokeh() {
        this._highlightsPostProcess.updateEffect("#define PENTAGON\n");
        this._pentagonBokehIsEnabled = true;
    }
    /**
     * Disables the pentagon bokeh effect
     */
    disablePentagonBokeh() {
        this._pentagonBokehIsEnabled = false;
        this._highlightsPostProcess.updateEffect();
    }
    /**
     * Enables noise blur
     */
    enableNoiseBlur() {
        this._blurNoise = true;
    }
    /**
     * Disables noise blur
     */
    disableNoiseBlur() {
        this._blurNoise = false;
    }
    /**
     * Sets the HighlightsGain amount
     * @param amount amount of HighlightsGain
     */
    setHighlightsGain(amount) {
        this._highlightsGain = amount;
    }
    /**
     * Sets the HighlightsThreshold amount
     * @param amount amount of HighlightsThreshold
     */
    setHighlightsThreshold(amount) {
        if (this._highlightsGain === -1) {
            this._highlightsGain = 1.0;
        }
        this._highlightsThreshold = amount;
    }
    /**
     * Disables highlights
     */
    disableHighlights() {
        this._highlightsGain = -1;
    }
    /**
     * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
     * @param disableDepthRender If the scene's depth rendering should be disabled (default: false)
     */
    dispose(disableDepthRender = false) {
        this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);
        this._chromaticAberrationPostProcess = null;
        this._highlightsPostProcess = null;
        this._depthOfFieldPostProcess = null;
        this._grainTexture.dispose();
        if (disableDepthRender) {
            this._scene.disableDepthRenderer();
        }
    }
    // colors shifting and distortion
    _createChromaticAberrationPostProcess(ratio) {
        this._chromaticAberrationPostProcess = new PostProcesses_postProcess/* PostProcess */.w("LensChromaticAberration", "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], // uniforms
        [], // samplers
        ratio, null, Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false);
        this._chromaticAberrationPostProcess.onApply = (effect) => {
            effect.setFloat("chromatic_aberration", this._chromaticAberration);
            effect.setFloat("screen_width", this._scene.getEngine().getRenderWidth());
            effect.setFloat("screen_height", this._scene.getEngine().getRenderHeight());
            effect.setFloat("radialIntensity", 1);
            effect.setFloat2("direction", 17, 17);
            effect.setFloat2("centerPosition", 0.5, 0.5);
        };
    }
    // highlights enhancing
    _createHighlightsPostProcess(ratio) {
        this._highlightsPostProcess = new PostProcesses_postProcess/* PostProcess */.w("LensHighlights", "lensHighlights", ["gain", "threshold", "screen_width", "screen_height"], // uniforms
        [], // samplers
        ratio, null, Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, this._dofPentagon ? "#define PENTAGON\n" : "");
        this._highlightsPostProcess.externalTextureSamplerBinding = true;
        this._highlightsPostProcess.onApply = (effect) => {
            effect.setFloat("gain", this._highlightsGain);
            effect.setFloat("threshold", this._highlightsThreshold);
            effect.setTextureFromPostProcess("textureSampler", this._chromaticAberrationPostProcess);
            effect.setFloat("screen_width", this._scene.getEngine().getRenderWidth());
            effect.setFloat("screen_height", this._scene.getEngine().getRenderHeight());
        };
    }
    // colors shifting and distortion
    _createDepthOfFieldPostProcess(ratio) {
        this._depthOfFieldPostProcess = new PostProcesses_postProcess/* PostProcess */.w("LensDepthOfField", "depthOfField", [
            "grain_amount",
            "blur_noise",
            "screen_width",
            "screen_height",
            "distortion",
            "dof_enabled",
            "screen_distance",
            "aperture",
            "darken",
            "edge_blur",
            "highlights",
            "near",
            "far",
        ], ["depthSampler", "grainSampler", "highlightsSampler"], ratio, null, Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false);
        this._depthOfFieldPostProcess.externalTextureSamplerBinding = true;
        this._depthOfFieldPostProcess.onApply = (effect) => {
            effect.setTexture("depthSampler", this._depthTexture);
            effect.setTexture("grainSampler", this._grainTexture);
            effect.setTextureFromPostProcess("textureSampler", this._highlightsPostProcess);
            effect.setTextureFromPostProcess("highlightsSampler", this._depthOfFieldPostProcess);
            effect.setFloat("grain_amount", this._grainAmount);
            effect.setBool("blur_noise", this._blurNoise);
            effect.setFloat("screen_width", this._scene.getEngine().getRenderWidth());
            effect.setFloat("screen_height", this._scene.getEngine().getRenderHeight());
            effect.setFloat("distortion", this._distortion);
            effect.setBool("dof_enabled", this._dofDistance !== -1);
            effect.setFloat("screen_distance", 1.0 / (0.1 - 1.0 / this._dofDistance));
            effect.setFloat("aperture", this._dofAperture);
            effect.setFloat("darken", this._dofDarken);
            effect.setFloat("edge_blur", this._edgeBlur);
            effect.setBool("highlights", this._highlightsGain !== -1);
            if (this._scene.activeCamera) {
                effect.setFloat("near", this._scene.activeCamera.minZ);
                effect.setFloat("far", this._scene.activeCamera.maxZ);
            }
        };
    }
    // creates a black and white random noise texture, 512x512
    _createGrainTexture() {
        const size = 512;
        const data = new Uint8Array(size * size * 4);
        for (let index = 0; index < data.length;) {
            const value = Math.floor((0,math_scalar_functions.RandomRange)(0.42, 0.58) * 255);
            data[index++] = value;
            data[index++] = value;
            data[index++] = value;
            data[index++] = 255;
        }
        const texture = rawTexture/* RawTexture */.I.CreateRGBATexture(data, size, size, this._scene, false, false, 2);
        texture.name = "LensNoiseTexture";
        texture.wrapU = Textures_texture/* Texture */.g.WRAP_ADDRESSMODE;
        texture.wrapV = Textures_texture/* Texture */.g.WRAP_ADDRESSMODE;
        this._grainTexture = texture;
    }
}
//# sourceMappingURL=lensRenderingPipeline.js.map
;// ./node_modules/@babylonjs/core/Rendering/ssao2Configuration.js

/**
 * Contains all parameters needed for the prepass to perform
 * screen space subsurface scattering
 */
class SSAO2Configuration {
    constructor() {
        /**
         * Is subsurface enabled
         */
        this.enabled = false;
        /**
         * Name of the configuration
         */
        this.name = "ssao2";
        /**
         * Textures that should be present in the MRT for this effect to work
         */
        this.texturesRequired = [6, 5];
    }
}
//# sourceMappingURL=ssao2Configuration.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js

/* eslint-disable @typescript-eslint/naming-convention */

















/**
 * Render pipeline to produce ssao effect
 */
class SSAO2RenderingPipeline extends PostProcessRenderPipeline {
    /**
     * Used in SSAO calculations to compensate for accuracy issues with depth values. Default 0.02.
     *
     * Normally you do not need to change this value, but you can experiment with it if you get a lot of in false self-occlusion on flat surfaces when using fewer than 16 samples. Useful range is normally [0..0.1] but higher values is allowed.
     */
    set epsilon(n) {
        this._epsilon = n;
        this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO());
    }
    get epsilon() {
        return this._epsilon;
    }
    /**
     * Number of samples used for the SSAO calculations. Default value is 8.
     */
    set samples(n) {
        this._samples = n;
        this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO());
        this._sampleSphere = this._generateHemisphere();
    }
    get samples() {
        return this._samples;
    }
    /**
     * Number of samples to use for antialiasing.
     */
    set textureSamples(n) {
        this._textureSamples = n;
        if (this._prePassRenderer) {
            this._prePassRenderer.samples = n;
        }
        else {
            this._originalColorPostProcess.samples = n;
        }
    }
    get textureSamples() {
        return this._textureSamples;
    }
    get _geometryBufferRenderer() {
        if (!this._forceGeometryBuffer) {
            return null;
        }
        return this._scene.geometryBufferRenderer;
    }
    get _prePassRenderer() {
        if (this._forceGeometryBuffer) {
            return null;
        }
        return this._scene.prePassRenderer;
    }
    /**
     * Skips the denoising (blur) stage of the SSAO calculations.
     *
     * Useful to temporarily set while experimenting with the other SSAO2 settings.
     */
    set bypassBlur(b) {
        const defines = this._getDefinesForBlur(this.expensiveBlur, b);
        const samplers = this._getSamplersForBlur(b);
        this._blurHPostProcess.updateEffect(defines.h, null, samplers);
        this._blurVPostProcess.updateEffect(defines.v, null, samplers);
        this._bypassBlur = b;
    }
    get bypassBlur() {
        return this._bypassBlur;
    }
    /**
     * Enables the configurable bilateral denoising (blurring) filter. Default is true.
     * Set to false to instead use a legacy bilateral filter that can't be configured.
     *
     * The denoising filter runs after the SSAO calculations and is a very important step. Both options results in a so called bilateral being used, but the "expensive" one can be
     * configured in several ways to fit your scene.
     */
    set expensiveBlur(b) {
        const defines = this._getDefinesForBlur(b, this._bypassBlur);
        this._blurHPostProcess.updateEffect(defines.h);
        this._blurVPostProcess.updateEffect(defines.v);
        this._expensiveBlur = b;
    }
    get expensiveBlur() {
        return this._expensiveBlur;
    }
    /**
     *  Support test.
     */
    static get IsSupported() {
        const engine = engineStore/* EngineStore */.q.LastCreatedEngine;
        if (!engine) {
            return false;
        }
        return engine._features.supportSSAO2;
    }
    /**
     * Gets active scene
     */
    get scene() {
        return this._scene;
    }
    /**
     * @constructor
     * @param name The rendering pipeline name
     * @param scene The scene linked to this pipeline
     * @param ratio The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, blurRatio: 1.0 }
     * @param cameras The array of cameras that the rendering pipeline will be attached to
     * @param forceGeometryBuffer Set to true if you want to use the legacy geometry buffer renderer
     * @param textureType The texture type used by the different post processes created by SSAO (default: 0)
     */
    constructor(name, scene, ratio, cameras, forceGeometryBuffer = false, textureType = 0) {
        super(scene.getEngine(), name);
        // Members
        /**
         * @ignore
         * The PassPostProcess id in the pipeline that contains the original scene color
         */
        this.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect";
        /**
         * @ignore
         * The SSAO PostProcess id in the pipeline
         */
        this.SSAORenderEffect = "SSAORenderEffect";
        /**
         * @ignore
         * The horizontal blur PostProcess id in the pipeline
         */
        this.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect";
        /**
         * @ignore
         * The vertical blur PostProcess id in the pipeline
         */
        this.SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect";
        /**
         * @ignore
         * The PostProcess id in the pipeline that combines the SSAO-Blur output with the original scene color (SSAOOriginalSceneColorEffect)
         */
        this.SSAOCombineRenderEffect = "SSAOCombineRenderEffect";
        /**
         * The output strength of the SSAO post-process. Default value is 1.0.
         */
        this.totalStrength = 1.0;
        /**
         * Maximum depth value to still render AO. A smooth falloff makes the dimming more natural, so there will be no abrupt shading change.
         */
        this.maxZ = 100.0;
        /**
         * In order to save performances, SSAO radius is clamped on close geometry. This ratio changes by how much.
         */
        this.minZAspect = 0.2;
        this._epsilon = 0.02;
        this._samples = 8;
        this._textureSamples = 1;
        /**
         * Force rendering the geometry through geometry buffer.
         */
        this._forceGeometryBuffer = false;
        /**
         * The radius around the analyzed pixel used by the SSAO post-process. Default value is 2.0
         */
        this.radius = 2.0;
        /**
         * The base color of the SSAO post-process
         * The final result is "base + ssao" between [0, 1]
         */
        this.base = 0;
        this._bypassBlur = false;
        this._expensiveBlur = true;
        /**
         * The number of samples the bilateral filter uses in both dimensions when denoising the SSAO calculations. Default value is 16.
         *
         * A higher value should result in smoother shadows but will use more processing time in the shaders.
         *
         * A high value can cause the shadows to get to blurry or create visible artifacts (bands) near sharp details in the geometry. The artifacts can sometimes be mitigated by increasing the bilateralSoften setting.
         */
        this.bilateralSamples = 16;
        /**
         * Controls the shape of the denoising kernel used by the bilateral filter. Default value is 0.
         *
         * By default the bilateral filter acts like a box-filter, treating all samples on the same depth with equal weights. This is effective to maximize the denoising effect given a limited set of samples. However, it also often results in visible ghosting around sharp shadow regions and can spread out lines over large areas so they are no longer visible.
         *
         * Increasing this setting will make the filter pay less attention to samples further away from the center sample, reducing many artifacts but at the same time increasing noise.
         *
         * Useful value range is [0..1].
         */
        this.bilateralSoften = 0;
        /**
         * How forgiving the bilateral denoiser should be when rejecting samples. Default value is 0.
         *
         * A higher value results in the bilateral filter being more forgiving and thus doing a better job at denoising slanted and curved surfaces, but can lead to shadows spreading out around corners or between objects that are close to each other depth wise.
         *
         * Useful value range is normally [0..1], but higher values are allowed.
         */
        this.bilateralTolerance = 0;
        this._bits = new Uint32Array(1);
        this._scene = scene;
        this._ratio = ratio;
        this._textureType = textureType;
        this._forceGeometryBuffer = forceGeometryBuffer;
        if (!this.isSupported) {
            logger/* Logger */.V.Error("The current engine does not support SSAO 2.");
            return;
        }
        const ssaoRatio = this._ratio.ssaoRatio || ratio;
        const blurRatio = this._ratio.blurRatio || ratio;
        // Set up assets
        if (this._forceGeometryBuffer) {
            scene.enableGeometryBufferRenderer();
            if (scene.geometryBufferRenderer?.generateNormalsInWorldSpace) {
                logger/* Logger */.V.Error("SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!");
            }
        }
        else {
            scene.enablePrePassRenderer();
            if (scene.prePassRenderer?.generateNormalsInWorldSpace) {
                logger/* Logger */.V.Error("SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the prepass renderer!");
            }
        }
        this._createRandomTexture();
        this._originalColorPostProcess = new passPostProcess/* PassPostProcess */.v("SSAOOriginalSceneColor", 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), undefined, this._textureType);
        this._originalColorPostProcess.samples = this.textureSamples;
        this._createSSAOPostProcess(1.0, textureType);
        this._createBlurPostProcess(ssaoRatio, blurRatio, this._textureType);
        this._createSSAOCombinePostProcess(blurRatio, this._textureType);
        // Set up pipeline
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOOriginalSceneColorEffect, () => {
            return this._originalColorPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAORenderEffect, () => {
            return this._ssaoPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurHRenderEffect, () => {
            return this._blurHPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurVRenderEffect, () => {
            return this._blurVPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOCombineRenderEffect, () => {
            return this._ssaoCombinePostProcess;
        }, true));
        // Finish
        scene.postProcessRenderPipelineManager.addPipeline(this);
        if (cameras) {
            scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);
        }
    }
    // Public Methods
    /**
     * Get the class name
     * @returns "SSAO2RenderingPipeline"
     */
    getClassName() {
        return "SSAO2RenderingPipeline";
    }
    /**
     * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
     * @param disableGeometryBufferRenderer Set to true if you want to disable the Geometry Buffer renderer
     */
    dispose(disableGeometryBufferRenderer = false) {
        for (let i = 0; i < this._scene.cameras.length; i++) {
            const camera = this._scene.cameras[i];
            this._originalColorPostProcess.dispose(camera);
            this._ssaoPostProcess.dispose(camera);
            this._blurHPostProcess.dispose(camera);
            this._blurVPostProcess.dispose(camera);
            this._ssaoCombinePostProcess.dispose(camera);
        }
        this._randomTexture.dispose();
        if (disableGeometryBufferRenderer) {
            this._scene.disableGeometryBufferRenderer();
        }
        this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);
        super.dispose();
    }
    // Private Methods
    /** @internal */
    _rebuild() {
        super._rebuild();
    }
    _getSamplersForBlur(disabled) {
        return disabled ? ["textureSampler"] : ["textureSampler", "depthSampler"];
    }
    _getDefinesForBlur(bilateral, disabled) {
        let define = "#define BLUR\n";
        if (disabled) {
            define += "#define BLUR_BYPASS\n";
        }
        if (!bilateral) {
            define += "#define BLUR_LEGACY\n";
        }
        return { h: define + "#define BLUR_H\n", v: define };
    }
    _createBlurPostProcess(ssaoRatio, blurRatio, textureType) {
        const defines = this._getDefinesForBlur(this.expensiveBlur, this.bypassBlur);
        const samplers = this._getSamplersForBlur(this.bypassBlur);
        this._blurHPostProcess = this._createBlurFilter("BlurH", samplers, ssaoRatio, defines.h, textureType, true);
        this._blurVPostProcess = this._createBlurFilter("BlurV", samplers, blurRatio, defines.v, textureType, false);
    }
    _createBlurFilter(name, samplers, ratio, defines, textureType, horizontal) {
        const blurFilter = new PostProcesses_postProcess/* PostProcess */.w(name, "ssao2", ["outSize", "samples", "soften", "tolerance"], samplers, ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, defines, textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {
            if (useWebGPU) {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 45076)));
            }
            else {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85363)));
            }
        });
        blurFilter.onApply = (effect) => {
            if (!this._scene.activeCamera) {
                return;
            }
            const ssaoCombineSize = horizontal ? this._ssaoCombinePostProcess.width : this._ssaoCombinePostProcess.height;
            const originalColorSize = horizontal ? this._originalColorPostProcess.width : this._originalColorPostProcess.height;
            effect.setFloat("outSize", ssaoCombineSize > 0 ? ssaoCombineSize : originalColorSize);
            effect.setInt("samples", this.bilateralSamples);
            effect.setFloat("soften", this.bilateralSoften);
            effect.setFloat("tolerance", this.bilateralTolerance);
            if (this._geometryBufferRenderer) {
                effect.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[0]);
            }
            else if (this._prePassRenderer) {
                effect.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]);
            }
        };
        blurFilter.samples = this.textureSamples;
        blurFilter.autoClear = false;
        return blurFilter;
    }
    //Van der Corput radical inverse
    _radicalInverse_VdC(i) {
        this._bits[0] = i;
        this._bits[0] = ((this._bits[0] << 16) | (this._bits[0] >> 16)) >>> 0;
        this._bits[0] = ((this._bits[0] & 0x55555555) << 1) | (((this._bits[0] & 0xaaaaaaaa) >>> 1) >>> 0);
        this._bits[0] = ((this._bits[0] & 0x33333333) << 2) | (((this._bits[0] & 0xcccccccc) >>> 2) >>> 0);
        this._bits[0] = ((this._bits[0] & 0x0f0f0f0f) << 4) | (((this._bits[0] & 0xf0f0f0f0) >>> 4) >>> 0);
        this._bits[0] = ((this._bits[0] & 0x00ff00ff) << 8) | (((this._bits[0] & 0xff00ff00) >>> 8) >>> 0);
        return this._bits[0] * 2.3283064365386963e-10; // / 0x100000000 or / 4294967296
    }
    _hammersley(i, n) {
        return [i / n, this._radicalInverse_VdC(i)];
    }
    _hemisphereSample_uniform(u, v) {
        const phi = v * 2.0 * Math.PI;
        // rejecting samples that are close to tangent plane to avoid z-fighting artifacts
        const cosTheta = 1.0 - u * 0.85;
        const sinTheta = Math.sqrt(1.0 - cosTheta * cosTheta);
        return new math_vector/* Vector3 */.Pq(Math.cos(phi) * sinTheta, Math.sin(phi) * sinTheta, cosTheta);
    }
    _generateHemisphere() {
        const numSamples = this.samples;
        const result = [];
        let vector;
        let i = 0;
        while (i < numSamples) {
            if (numSamples < 16) {
                vector = this._hemisphereSample_uniform(Math.random(), Math.random());
            }
            else {
                const rand = this._hammersley(i, numSamples);
                vector = this._hemisphereSample_uniform(rand[0], rand[1]);
            }
            result.push(vector.x, vector.y, vector.z);
            i++;
        }
        return result;
    }
    _getDefinesForSSAO() {
        const defines = `#define SSAO\n#define SAMPLES ${this.samples}\n#define EPSILON ${this.epsilon.toFixed(4)}`;
        return defines;
    }
    _createSSAOPostProcess(ratio, textureType) {
        this._sampleSphere = this._generateHemisphere();
        const defines = this._getDefinesForSSAO();
        const samplers = ["randomSampler", "depthSampler", "normalSampler"];
        this._ssaoPostProcess = new PostProcesses_postProcess/* PostProcess */.w("ssao2", "ssao2", [
            "sampleSphere",
            "samplesFactor",
            "randTextureTiles",
            "totalStrength",
            "radius",
            "base",
            "range",
            "projection",
            "near",
            "texelSize",
            "xViewport",
            "yViewport",
            "maxZ",
            "minZAspect",
            "depthProjection",
        ], samplers, ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, defines, textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {
            if (useWebGPU) {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 45076)));
            }
            else {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85363)));
            }
        });
        this._ssaoPostProcess.autoClear = false;
        this._ssaoPostProcess.onApply = (effect) => {
            if (!this._scene.activeCamera) {
                return;
            }
            effect.setArray3("sampleSphere", this._sampleSphere);
            effect.setFloat("randTextureTiles", 32.0);
            effect.setFloat("samplesFactor", 1 / this.samples);
            effect.setFloat("totalStrength", this.totalStrength);
            effect.setFloat2("texelSize", 1 / this._ssaoPostProcess.width, 1 / this._ssaoPostProcess.height);
            effect.setFloat("radius", this.radius);
            effect.setFloat("maxZ", this.maxZ);
            effect.setFloat("minZAspect", this.minZAspect);
            effect.setFloat("base", this.base);
            effect.setFloat("near", this._scene.activeCamera.minZ);
            if (this._scene.activeCamera.mode === Cameras_camera/* Camera */.i.PERSPECTIVE_CAMERA) {
                effect.setMatrix3x3("depthProjection", SSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION);
                effect.setFloat("xViewport", Math.tan(this._scene.activeCamera.fov / 2) * this._scene.getEngine().getAspectRatio(this._scene.activeCamera, true));
                effect.setFloat("yViewport", Math.tan(this._scene.activeCamera.fov / 2));
            }
            else {
                const halfWidth = this._scene.getEngine().getRenderWidth() / 2.0;
                const halfHeight = this._scene.getEngine().getRenderHeight() / 2.0;
                const orthoLeft = this._scene.activeCamera.orthoLeft ?? -halfWidth;
                const orthoRight = this._scene.activeCamera.orthoRight ?? halfWidth;
                const orthoBottom = this._scene.activeCamera.orthoBottom ?? -halfHeight;
                const orthoTop = this._scene.activeCamera.orthoTop ?? halfHeight;
                effect.setMatrix3x3("depthProjection", SSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION);
                effect.setFloat("xViewport", (orthoRight - orthoLeft) * 0.5);
                effect.setFloat("yViewport", (orthoTop - orthoBottom) * 0.5);
            }
            effect.setMatrix("projection", this._scene.getProjectionMatrix());
            if (this._geometryBufferRenderer) {
                effect.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[0]);
                effect.setTexture("normalSampler", this._geometryBufferRenderer.getGBuffer().textures[1]);
            }
            else if (this._prePassRenderer) {
                effect.setTexture("depthSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]);
                effect.setTexture("normalSampler", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(6)]);
            }
            effect.setTexture("randomSampler", this._randomTexture);
        };
        this._ssaoPostProcess.samples = this.textureSamples;
        if (!this._forceGeometryBuffer) {
            this._ssaoPostProcess._prePassEffectConfiguration = new SSAO2Configuration();
        }
    }
    _createSSAOCombinePostProcess(ratio, textureType) {
        this._ssaoCombinePostProcess = new PostProcesses_postProcess/* PostProcess */.w("ssaoCombine", "ssaoCombine", [], ["originalColor", "viewport"], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, undefined, textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {
            if (useWebGPU) {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 68217)));
            }
            else {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 74154)));
            }
        });
        this._ssaoCombinePostProcess.onApply = (effect) => {
            const viewport = this._scene.activeCamera.viewport;
            effect.setVector4("viewport", math_vector/* TmpVectors */.AA.Vector4[0].copyFromFloats(viewport.x, viewport.y, viewport.width, viewport.height));
            effect.setTextureFromPostProcessOutput("originalColor", this._originalColorPostProcess);
        };
        this._ssaoCombinePostProcess.autoClear = false;
        this._ssaoCombinePostProcess.samples = this.textureSamples;
    }
    _createRandomTexture() {
        const size = 128;
        const data = new Uint8Array(size * size * 4);
        const randVector = math_vector/* Vector2 */.I9.Zero();
        for (let index = 0; index < data.length;) {
            randVector.set((0,math_scalar_functions.RandomRange)(0, 1), (0,math_scalar_functions.RandomRange)(0, 1)).normalize().scaleInPlace(255);
            data[index++] = Math.floor(randVector.x);
            data[index++] = Math.floor(randVector.y);
            data[index++] = 0;
            data[index++] = 255;
        }
        const texture = rawTexture/* RawTexture */.I.CreateRGBATexture(data, size, size, this._scene, false, false, 2);
        texture.name = "SSAORandomTexture";
        texture.wrapU = Textures_texture/* Texture */.g.WRAP_ADDRESSMODE;
        texture.wrapV = Textures_texture/* Texture */.g.WRAP_ADDRESSMODE;
        this._randomTexture = texture;
    }
    /**
     * Serialize the rendering pipeline (Used when exporting)
     * @returns the serialized object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.customType = "SSAO2RenderingPipeline";
        return serializationObject;
    }
    /**
     * Parse the serialized pipeline
     * @param source Source pipeline.
     * @param scene The scene to load the pipeline to.
     * @param rootUrl The URL of the serialized pipeline.
     * @returns An instantiated pipeline from the serialized object.
     */
    static Parse(source, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => new SSAO2RenderingPipeline(source._name, scene, source._ratio, undefined, source._forceGeometryBuffer, source._textureType), source, scene, rootUrl);
    }
}
SSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION = [1, 0, 0, 0, 1, 0, 0, 0, 1];
SSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION = [0, 0, 0, 0, 0, 0, 1, 1, 1];
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "totalStrength", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "maxZ", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "minZAspect", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("epsilon")
], SSAO2RenderingPipeline.prototype, "_epsilon", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("samples")
], SSAO2RenderingPipeline.prototype, "_samples", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("textureSamples")
], SSAO2RenderingPipeline.prototype, "_textureSamples", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "_forceGeometryBuffer", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "_ratio", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "_textureType", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "radius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "base", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("bypassBlur")
], SSAO2RenderingPipeline.prototype, "_bypassBlur", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("expensiveBlur")
], SSAO2RenderingPipeline.prototype, "_expensiveBlur", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "bilateralSamples", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "bilateralSoften", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAO2RenderingPipeline.prototype, "bilateralTolerance", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SSAO2RenderingPipeline", SSAO2RenderingPipeline);
//# sourceMappingURL=ssao2RenderingPipeline.js.map
;// ./node_modules/@babylonjs/core/Shaders/ssao.fragment.js
// Do not edit.

const ssao_fragment_name = "ssaoPixelShader";
const ssao_fragment_shader = `uniform sampler2D textureSampler;varying vec2 vUV;
#ifdef SSAO
uniform sampler2D randomSampler;uniform float randTextureTiles;uniform float samplesFactor;uniform vec3 sampleSphere[SAMPLES];uniform float totalStrength;uniform float radius;uniform float area;uniform float fallOff;uniform float base;vec3 normalFromDepth(float depth,vec2 coords)
{vec2 offset1=vec2(0.0,radius);vec2 offset2=vec2(radius,0.0);float depth1=texture2D(textureSampler,coords+offset1).r;float depth2=texture2D(textureSampler,coords+offset2).r;vec3 p1=vec3(offset1,depth1-depth);vec3 p2=vec3(offset2,depth2-depth);vec3 normal=cross(p1,p2);normal.z=-normal.z;return normalize(normal);}
void main()
{vec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);float depth=texture2D(textureSampler,vUV).r;vec3 position=vec3(vUV,depth);vec3 normal=normalFromDepth(depth,vUV);float radiusDepth=radius/depth;float occlusion=0.0;vec3 ray;vec3 hemiRay;float occlusionDepth;float difference;for (int i=0; i<SAMPLES; i++)
{ray=radiusDepth*reflect(sampleSphere[i],random);hemiRay=position+sign(dot(ray,normal))*ray;occlusionDepth=texture2D(textureSampler,clamp(hemiRay.xy,vec2(0.001,0.001),vec2(0.999,0.999))).r;difference=depth-occlusionDepth;occlusion+=step(fallOff,difference)*(1.0-smoothstep(fallOff,area,difference));}
float ao=1.0-totalStrength*occlusion*samplesFactor;float result=clamp(ao+base,0.0,1.0);gl_FragColor.r=result;gl_FragColor.g=result;gl_FragColor.b=result;gl_FragColor.a=1.0;}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[ssao_fragment_name] = ssao_fragment_shader;
/** @internal */
const ssaoPixelShader = { name: ssao_fragment_name, shader: ssao_fragment_shader };
//# sourceMappingURL=ssao.fragment.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ssaoCombine.fragment.js
var ssaoCombine_fragment = __webpack_require__(74154);
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js

/* eslint-disable @typescript-eslint/naming-convention */














/**
 * Render pipeline to produce ssao effect
 */
class SSAORenderingPipeline extends PostProcessRenderPipeline {
    /**
     * Gets active scene
     */
    get scene() {
        return this._scene;
    }
    /**
     * @constructor
     * @param name - The rendering pipeline name
     * @param scene - The scene linked to this pipeline
     * @param ratio - The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, combineRatio: 1.0 }
     * @param cameras - The array of cameras that the rendering pipeline will be attached to
     */
    constructor(name, scene, ratio, cameras) {
        super(scene.getEngine(), name);
        // Members
        /**
         * @ignore
         * The PassPostProcess id in the pipeline that contains the original scene color
         */
        this.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect";
        /**
         * @ignore
         * The SSAO PostProcess id in the pipeline
         */
        this.SSAORenderEffect = "SSAORenderEffect";
        /**
         * @ignore
         * The horizontal blur PostProcess id in the pipeline
         */
        this.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect";
        /**
         * @ignore
         * The vertical blur PostProcess id in the pipeline
         */
        this.SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect";
        /**
         * @ignore
         * The PostProcess id in the pipeline that combines the SSAO-Blur output with the original scene color (SSAOOriginalSceneColorEffect)
         */
        this.SSAOCombineRenderEffect = "SSAOCombineRenderEffect";
        /**
         * The output strength of the SSAO post-process. Default value is 1.0.
         */
        this.totalStrength = 1.0;
        /**
         * The radius around the analyzed pixel used by the SSAO post-process. Default value is 0.0006
         */
        this.radius = 0.0001;
        /**
         * Related to fallOff, used to interpolate SSAO samples (first interpolate function input) based on the occlusion difference of each pixel
         * Must not be equal to fallOff and superior to fallOff.
         * Default value is 0.0075
         */
        this.area = 0.0075;
        /**
         * Related to area, used to interpolate SSAO samples (second interpolate function input) based on the occlusion difference of each pixel
         * Must not be equal to area and inferior to area.
         * Default value is 0.000001
         */
        this.fallOff = 0.000001;
        /**
         * The base color of the SSAO post-process
         * The final result is "base + ssao" between [0, 1]
         */
        this.base = 0.5;
        this._firstUpdate = true;
        this._scene = scene;
        // Set up assets
        this._createRandomTexture();
        const ssaoRatio = ratio.ssaoRatio || ratio;
        const combineRatio = ratio.combineRatio || ratio;
        this._originalColorPostProcess = new passPostProcess/* PassPostProcess */.v("SSAOOriginalSceneColor", combineRatio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false);
        this._createSSAOPostProcess(ssaoRatio);
        this._createBlurPostProcess(ssaoRatio);
        this._createSSAOCombinePostProcess(combineRatio);
        // Set up pipeline
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOOriginalSceneColorEffect, () => {
            return this._originalColorPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAORenderEffect, () => {
            return this._ssaoPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurHRenderEffect, () => {
            return this._blurHPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurVRenderEffect, () => {
            return this._blurVPostProcess;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOCombineRenderEffect, () => {
            return this._ssaoCombinePostProcess;
        }, true));
        // Finish
        scene.postProcessRenderPipelineManager.addPipeline(this);
        if (cameras) {
            scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);
        }
    }
    /**
     * @internal
     */
    _attachCameras(cameras, unique) {
        super._attachCameras(cameras, unique);
        for (const camera of this._cameras) {
            this._scene.enableDepthRenderer(camera).getDepthMap(); // Force depth renderer "on"
        }
    }
    // Public Methods
    /**
     * Get the class name
     * @returns "SSAORenderingPipeline"
     */
    getClassName() {
        return "SSAORenderingPipeline";
    }
    /**
     * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
     * @param disableDepthRender - If the depth renderer should be disabled on the scene
     */
    dispose(disableDepthRender = false) {
        for (let i = 0; i < this._scene.cameras.length; i++) {
            const camera = this._scene.cameras[i];
            this._originalColorPostProcess.dispose(camera);
            this._ssaoPostProcess.dispose(camera);
            this._blurHPostProcess.dispose(camera);
            this._blurVPostProcess.dispose(camera);
            this._ssaoCombinePostProcess.dispose(camera);
        }
        this._randomTexture.dispose();
        if (disableDepthRender) {
            this._scene.disableDepthRenderer();
        }
        this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);
        super.dispose();
    }
    // Private Methods
    _createBlurPostProcess(ratio) {
        const size = 16;
        this._blurHPostProcess = new BlurPostProcess("BlurH", new math_vector/* Vector2 */.I9(1, 0), size, ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, 0);
        this._blurVPostProcess = new BlurPostProcess("BlurV", new math_vector/* Vector2 */.I9(0, 1), size, ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, 0);
        this._blurHPostProcess.onActivateObservable.add(() => {
            const dw = this._blurHPostProcess.width / this._scene.getEngine().getRenderWidth();
            this._blurHPostProcess.kernel = size * dw;
        });
        this._blurVPostProcess.onActivateObservable.add(() => {
            const dw = this._blurVPostProcess.height / this._scene.getEngine().getRenderHeight();
            this._blurVPostProcess.kernel = size * dw;
        });
    }
    /** @internal */
    _rebuild() {
        this._firstUpdate = true;
        super._rebuild();
    }
    _createSSAOPostProcess(ratio) {
        const numSamples = 16;
        const sampleSphere = [
            0.5381, 0.1856, -0.4319, 0.1379, 0.2486, 0.443, 0.3371, 0.5679, -0.0057, -0.6999, -0.0451, -0.0019, 0.0689, -0.1598, -0.8547, 0.056, 0.0069, -0.1843, -0.0146, 0.1402,
            0.0762, 0.01, -0.1924, -0.0344, -0.3577, -0.5301, -0.4358, -0.3169, 0.1063, 0.0158, 0.0103, -0.5869, 0.0046, -0.0897, -0.494, 0.3287, 0.7119, -0.0154, -0.0918, -0.0533,
            0.0596, -0.5411, 0.0352, -0.0631, 0.546, -0.4776, 0.2847, -0.0271,
        ];
        const samplesFactor = 1.0 / numSamples;
        this._ssaoPostProcess = new PostProcesses_postProcess/* PostProcess */.w("ssao", "ssao", ["sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius", "area", "fallOff", "base", "range", "viewport"], ["randomSampler"], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define SAMPLES " + numSamples + "\n#define SSAO");
        this._ssaoPostProcess.externalTextureSamplerBinding = true;
        this._ssaoPostProcess.onApply = (effect) => {
            if (this._firstUpdate) {
                effect.setArray3("sampleSphere", sampleSphere);
                effect.setFloat("samplesFactor", samplesFactor);
                effect.setFloat("randTextureTiles", 4.0);
            }
            effect.setFloat("totalStrength", this.totalStrength);
            effect.setFloat("radius", this.radius);
            effect.setFloat("area", this.area);
            effect.setFloat("fallOff", this.fallOff);
            effect.setFloat("base", this.base);
            effect.setTexture("textureSampler", this._scene.enableDepthRenderer(this._scene.activeCamera).getDepthMap());
            effect.setTexture("randomSampler", this._randomTexture);
        };
    }
    _createSSAOCombinePostProcess(ratio) {
        this._ssaoCombinePostProcess = new PostProcesses_postProcess/* PostProcess */.w("ssaoCombine", "ssaoCombine", [], ["originalColor", "viewport"], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false);
        this._ssaoCombinePostProcess.onApply = (effect) => {
            effect.setVector4("viewport", math_vector/* TmpVectors */.AA.Vector4[0].copyFromFloats(0, 0, 1.0, 1.0));
            effect.setTextureFromPostProcess("originalColor", this._originalColorPostProcess);
        };
    }
    _createRandomTexture() {
        const size = 512;
        const data = new Uint8Array(size * size * 4);
        for (let index = 0; index < data.length;) {
            data[index++] = Math.floor(Math.max(0.0, (0,math_scalar_functions.RandomRange)(-1.0, 1.0)) * 255);
            data[index++] = Math.floor(Math.max(0.0, (0,math_scalar_functions.RandomRange)(-1.0, 1.0)) * 255);
            data[index++] = Math.floor(Math.max(0.0, (0,math_scalar_functions.RandomRange)(-1.0, 1.0)) * 255);
            data[index++] = 255;
        }
        const texture = rawTexture/* RawTexture */.I.CreateRGBATexture(data, size, size, this._scene, false, false, 2);
        texture.name = "SSAORandomTexture";
        texture.wrapU = Textures_texture/* Texture */.g.WRAP_ADDRESSMODE;
        texture.wrapV = Textures_texture/* Texture */.g.WRAP_ADDRESSMODE;
        this._randomTexture = texture;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAORenderingPipeline.prototype, "totalStrength", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAORenderingPipeline.prototype, "radius", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAORenderingPipeline.prototype, "area", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAORenderingPipeline.prototype, "fallOff", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSAORenderingPipeline.prototype, "base", void 0);
//# sourceMappingURL=ssaoRenderingPipeline.js.map
;// ./node_modules/@babylonjs/core/Rendering/screenSpaceReflectionsConfiguration.js

/**
 * Contains all parameters needed for the prepass to perform
 * screen space reflections
 */
class ScreenSpaceReflectionsConfiguration {
    constructor() {
        /**
         * Is ssr enabled
         */
        this.enabled = false;
        /**
         * Name of the configuration
         */
        this.name = "screenSpaceReflections";
        /**
         * Textures that should be present in the MRT for this effect to work
         */
        this.texturesRequired = [6, 3, 1];
    }
}
//# sourceMappingURL=screenSpaceReflectionsConfiguration.js.map
;// ./node_modules/@babylonjs/core/Shaders/screenSpaceReflection.fragment.js
// Do not edit.

const screenSpaceReflection_fragment_name = "screenSpaceReflectionPixelShader";
const screenSpaceReflection_fragment_shader = `uniform sampler2D textureSampler;
#ifdef SSR_SUPPORTED
uniform sampler2D reflectivitySampler;uniform sampler2D normalSampler;uniform sampler2D positionSampler;
#endif
uniform mat4 view;uniform mat4 projection;uniform float stepSize;uniform float strength;uniform float threshold;uniform float roughnessFactor;uniform float reflectionSpecularFalloffExponent;varying vec2 vUV;
#ifdef SSR_SUPPORTED
struct ReflectionInfo {vec3 color;vec4 coords;};/**
* According to specular,see https:
*/
vec3 fresnelSchlick(float cosTheta,vec3 F0)
{return F0+(1.0-F0)*pow(1.0-cosTheta,5.0);}
/**
* Once the pixel's coordinates has been found,let's adjust (smooth) a little bit
* by sampling multiple reflection pixels.
*/
ReflectionInfo smoothReflectionInfo(vec3 dir,vec3 hitCoord)
{ReflectionInfo info;info.color=vec3(0.0);vec4 projectedCoord;float sampledDepth;for(int i=0; i<SMOOTH_STEPS; i++)
{projectedCoord=projection*vec4(hitCoord,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);sampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;float depth=sampledDepth-hitCoord.z;dir*=0.5;if(depth>0.0)
hitCoord-=dir;else
hitCoord+=dir;info.color+=texture2D(textureSampler,projectedCoord.xy).rgb;}
projectedCoord=projection*vec4(hitCoord,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);info.coords=vec4(projectedCoord.xy,sampledDepth,1.0);info.color+=texture2D(textureSampler,projectedCoord.xy).rgb;info.color/=float(SMOOTH_STEPS+1);return info;}
/**
* Tests the given world position (hitCoord) according to the given reflection vector (dir)
* until it finds a collision (means that depth is enough close to say "it's the pixel to sample!").
*/
ReflectionInfo getReflectionInfo(vec3 dir,vec3 hitCoord)
{ReflectionInfo info;vec4 projectedCoord;float sampledDepth;dir*=stepSize;for(int i=0; i<REFLECTION_SAMPLES; i++)
{hitCoord+=dir;projectedCoord=projection*vec4(hitCoord,1.0);projectedCoord.xy/=projectedCoord.w;projectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);sampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;float depth=sampledDepth-hitCoord.z;
#ifdef RIGHT_HANDED_SCENE
depth*=-1.0;
#endif
if(((depth-dir.z)<threshold) && depth<=0.0)
{
#ifdef ENABLE_SMOOTH_REFLECTIONS
return smoothReflectionInfo(dir,hitCoord);
#else
info.color=texture2D(textureSampler,projectedCoord.xy).rgb;info.coords=vec4(projectedCoord.xy,sampledDepth,0.0);return info;
#endif
}}
info.color=texture2D(textureSampler,projectedCoord.xy).rgb;info.coords=vec4(projectedCoord.xy,sampledDepth,0.0);return info;}
vec3 hash(vec3 a)
{a=fract(a*0.8);a+=dot(a,a.yxz+19.19);return fract((a.xxy+a.yxx)*a.zyx);}
#endif
void main()
{
#ifdef SSR_SUPPORTED
vec4 albedoFull=texture2D(textureSampler,vUV);vec3 albedo=albedoFull.rgb;float spec=texture2D(reflectivitySampler,vUV).r;if (spec==0.0) {gl_FragColor=albedoFull;return;}
vec3 normal=(texture2D(normalSampler,vUV)).xyz;vec3 position=(view*texture2D(positionSampler,vUV)).xyz;vec3 reflected=normalize(reflect(normalize(position),normalize(normal)));float roughness=1.0-texture2D(reflectivitySampler,vUV).a;vec3 jitt=mix(vec3(0.0),hash(position),roughness)*roughnessFactor;ReflectionInfo info=getReflectionInfo(jitt+reflected,position);vec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-info.coords.xy));float screenEdgefactor=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);vec3 F0=vec3(0.04);F0 =mix(F0,albedo,spec);vec3 fresnel=fresnelSchlick(max(dot(normalize(normal),normalize(position)),0.0),F0);
#ifdef RIGHT_HANDED_SCENE
reflected.z*=-1.0;
#endif
float reflectionMultiplier=clamp(pow(spec*strength,reflectionSpecularFalloffExponent)*screenEdgefactor*reflected.z,0.0,0.9);float albedoMultiplier=1.0-reflectionMultiplier;vec3 SSR=info.color*fresnel;gl_FragColor=vec4((albedo*albedoMultiplier)+(SSR*reflectionMultiplier),albedoFull.a);
#else
gl_FragColor=texture2D(textureSampler,vUV);
#endif
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[screenSpaceReflection_fragment_name] = screenSpaceReflection_fragment_shader;
/** @internal */
const screenSpaceReflectionPixelShader = { name: screenSpaceReflection_fragment_name, shader: screenSpaceReflection_fragment_shader };
//# sourceMappingURL=screenSpaceReflection.fragment.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/screenSpaceReflectionPostProcess.js










/**
 * The ScreenSpaceReflectionPostProcess performs realtime reflections using only and only the available informations on the screen (positions and normals).
 * Basically, the screen space reflection post-process will compute reflections according the material's reflectivity.
 * @deprecated Use the new SSRRenderingPipeline instead.
 */
class ScreenSpaceReflectionPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    get _geometryBufferRenderer() {
        if (!this._forceGeometryBuffer) {
            return null;
        }
        return this._scene.geometryBufferRenderer;
    }
    get _prePassRenderer() {
        if (this._forceGeometryBuffer) {
            return null;
        }
        return this._scene.prePassRenderer;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "ScreenSpaceReflectionPostProcess" string
     */
    getClassName() {
        return "ScreenSpaceReflectionPostProcess";
    }
    /**
     * Creates a new instance of ScreenSpaceReflectionPostProcess.
     * @param name The name of the effect.
     * @param scene The scene containing the objects to calculate reflections.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: true)
     * @param forceGeometryBuffer If this post process should use geometry buffer instead of prepass (default: false)
     */
    constructor(name, scene, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false, forceGeometryBuffer = false) {
        super(name, "screenSpaceReflection", ["projection", "view", "threshold", "reflectionSpecularFalloffExponent", "strength", "stepSize", "roughnessFactor"], ["textureSampler", "normalSampler", "positionSampler", "reflectivitySampler"], options, camera, samplingMode, engine, reusable, "#define SSR_SUPPORTED\n#define REFLECTION_SAMPLES 64\n#define SMOOTH_STEPS 5\n", textureType, undefined, null, blockCompilation);
        /**
         * Gets or sets a reflection threshold mainly used to adjust the reflection's height.
         */
        this.threshold = 1.2;
        /**
         * Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results.
         */
        this.strength = 1;
        /**
         * Gets or sets the falloff exponent used while computing fresnel. More the exponent is high, more the reflections will be discrete.
         */
        this.reflectionSpecularFalloffExponent = 3;
        /**
         * Gets or sets the step size used to iterate until the effect finds the color of the reflection's pixel. Typically in interval [0.1, 1.0]
         */
        this.step = 1.0;
        /**
         * Gets or sets the factor applied when computing roughness. Default value is 0.2.
         */
        this.roughnessFactor = 0.2;
        this._forceGeometryBuffer = false;
        this._enableSmoothReflections = false;
        this._reflectionSamples = 64;
        this._smoothSteps = 5;
        this._forceGeometryBuffer = forceGeometryBuffer;
        if (this._forceGeometryBuffer) {
            // Get geometry buffer renderer and update effect
            const geometryBufferRenderer = scene.enableGeometryBufferRenderer();
            if (geometryBufferRenderer) {
                if (geometryBufferRenderer.isSupported) {
                    geometryBufferRenderer.enablePosition = true;
                    geometryBufferRenderer.enableReflectivity = true;
                    if (geometryBufferRenderer.generateNormalsInWorldSpace) {
                        logger/* Logger */.V.Error("ScreenSpaceReflectionPostProcess does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!");
                    }
                }
            }
        }
        else {
            const prePassRenderer = scene.enablePrePassRenderer();
            prePassRenderer?.markAsDirty();
            if (prePassRenderer?.generateNormalsInWorldSpace) {
                logger/* Logger */.V.Error("ScreenSpaceReflectionPostProcess does not support generateNormalsInWorldSpace=true for the prepass renderer!");
            }
            this._prePassEffectConfiguration = new ScreenSpaceReflectionsConfiguration();
        }
        this._updateEffectDefines();
        // On apply, send uniforms
        this.onApply = (effect) => {
            const geometryBufferRenderer = this._geometryBufferRenderer;
            const prePassRenderer = this._prePassRenderer;
            if (!prePassRenderer && !geometryBufferRenderer) {
                return;
            }
            if (geometryBufferRenderer) {
                // Samplers
                const positionIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.POSITION_TEXTURE_TYPE);
                const roughnessIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE);
                effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[1]);
                effect.setTexture("positionSampler", geometryBufferRenderer.getGBuffer().textures[positionIndex]);
                effect.setTexture("reflectivitySampler", geometryBufferRenderer.getGBuffer().textures[roughnessIndex]);
            }
            else if (prePassRenderer) {
                // Samplers
                const positionIndex = prePassRenderer.getIndex(1);
                const roughnessIndex = prePassRenderer.getIndex(3);
                const normalIndex = prePassRenderer.getIndex(6);
                effect.setTexture("normalSampler", prePassRenderer.getRenderTarget().textures[normalIndex]);
                effect.setTexture("positionSampler", prePassRenderer.getRenderTarget().textures[positionIndex]);
                effect.setTexture("reflectivitySampler", prePassRenderer.getRenderTarget().textures[roughnessIndex]);
            }
            // Uniforms
            const camera = scene.activeCamera;
            if (!camera) {
                return;
            }
            const viewMatrix = camera.getViewMatrix(true);
            const projectionMatrix = camera.getProjectionMatrix(true);
            effect.setMatrix("projection", projectionMatrix);
            effect.setMatrix("view", viewMatrix);
            effect.setFloat("threshold", this.threshold);
            effect.setFloat("reflectionSpecularFalloffExponent", this.reflectionSpecularFalloffExponent);
            effect.setFloat("strength", this.strength);
            effect.setFloat("stepSize", this.step);
            effect.setFloat("roughnessFactor", this.roughnessFactor);
        };
        this._isSceneRightHanded = scene.useRightHandedSystem;
    }
    /**
     * Gets whether or not smoothing reflections is enabled.
     * Enabling smoothing will require more GPU power and can generate a drop in FPS.
     */
    get enableSmoothReflections() {
        return this._enableSmoothReflections;
    }
    /**
     * Sets whether or not smoothing reflections is enabled.
     * Enabling smoothing will require more GPU power and can generate a drop in FPS.
     */
    set enableSmoothReflections(enabled) {
        if (enabled === this._enableSmoothReflections) {
            return;
        }
        this._enableSmoothReflections = enabled;
        this._updateEffectDefines();
    }
    /**
     * Gets the number of samples taken while computing reflections. More samples count is high,
     * more the post-process wil require GPU power and can generate a drop in FPS. Basically in interval [25, 100].
     */
    get reflectionSamples() {
        return this._reflectionSamples;
    }
    /**
     * Sets the number of samples taken while computing reflections. More samples count is high,
     * more the post-process wil require GPU power and can generate a drop in FPS. Basically in interval [25, 100].
     */
    set reflectionSamples(samples) {
        if (samples === this._reflectionSamples) {
            return;
        }
        this._reflectionSamples = samples;
        this._updateEffectDefines();
    }
    /**
     * Gets the number of samples taken while smoothing reflections. More samples count is high,
     * more the post-process will require GPU power and can generate a drop in FPS.
     * Default value (5.0) work pretty well in all cases but can be adjusted.
     */
    get smoothSteps() {
        return this._smoothSteps;
    }
    /*
     * Sets the number of samples taken while smoothing reflections. More samples count is high,
     * more the post-process will require GPU power and can generate a drop in FPS.
     * Default value (5.0) work pretty well in all cases but can be adjusted.
     */
    set smoothSteps(steps) {
        if (steps === this._smoothSteps) {
            return;
        }
        this._smoothSteps = steps;
        this._updateEffectDefines();
    }
    _updateEffectDefines() {
        const defines = [];
        if (this._geometryBufferRenderer || this._prePassRenderer) {
            defines.push("#define SSR_SUPPORTED");
        }
        if (this._enableSmoothReflections) {
            defines.push("#define ENABLE_SMOOTH_REFLECTIONS");
        }
        if (this._isSceneRightHanded) {
            defines.push("#define RIGHT_HANDED_SCENE");
        }
        defines.push("#define REFLECTION_SAMPLES " + (this._reflectionSamples >> 0));
        defines.push("#define SMOOTH_STEPS " + (this._smoothSteps >> 0));
        this.updateEffect(defines.join("\n"));
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new ScreenSpaceReflectionPostProcess(parsedPostProcess.name, scene, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.textureType, parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceReflectionPostProcess.prototype, "threshold", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceReflectionPostProcess.prototype, "strength", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceReflectionPostProcess.prototype, "reflectionSpecularFalloffExponent", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceReflectionPostProcess.prototype, "step", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceReflectionPostProcess.prototype, "roughnessFactor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceReflectionPostProcess.prototype, "enableSmoothReflections", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceReflectionPostProcess.prototype, "reflectionSamples", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceReflectionPostProcess.prototype, "smoothSteps", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ScreenSpaceReflectionPostProcess", ScreenSpaceReflectionPostProcess);
//# sourceMappingURL=screenSpaceReflectionPostProcess.js.map
;// ./node_modules/@babylonjs/core/Shaders/standard.fragment.js
// Do not edit.


const standard_fragment_name = "standardPixelShader";
const standard_fragment_shader = `uniform sampler2D textureSampler;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
#if defined(PASS_POST_PROCESS)
void main(void)
{vec4 color=texture2D(textureSampler,vUV);gl_FragColor=color;}
#endif
#if defined(DOWN_SAMPLE_X4)
uniform vec2 dsOffsets[16];void main(void)
{vec4 average=vec4(0.0,0.0,0.0,0.0);average=texture2D(textureSampler,vUV+dsOffsets[0]);average+=texture2D(textureSampler,vUV+dsOffsets[1]);average+=texture2D(textureSampler,vUV+dsOffsets[2]);average+=texture2D(textureSampler,vUV+dsOffsets[3]);average+=texture2D(textureSampler,vUV+dsOffsets[4]);average+=texture2D(textureSampler,vUV+dsOffsets[5]);average+=texture2D(textureSampler,vUV+dsOffsets[6]);average+=texture2D(textureSampler,vUV+dsOffsets[7]);average+=texture2D(textureSampler,vUV+dsOffsets[8]);average+=texture2D(textureSampler,vUV+dsOffsets[9]);average+=texture2D(textureSampler,vUV+dsOffsets[10]);average+=texture2D(textureSampler,vUV+dsOffsets[11]);average+=texture2D(textureSampler,vUV+dsOffsets[12]);average+=texture2D(textureSampler,vUV+dsOffsets[13]);average+=texture2D(textureSampler,vUV+dsOffsets[14]);average+=texture2D(textureSampler,vUV+dsOffsets[15]);average/=16.0;gl_FragColor=average;}
#endif
#if defined(BRIGHT_PASS)
uniform vec2 dsOffsets[4];uniform float brightThreshold;void main(void)
{vec4 average=vec4(0.0,0.0,0.0,0.0);average=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));average+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));average+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));average+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));average*=0.25;float luminance=length(average.rgb);if (luminance<brightThreshold) {average=vec4(0.0,0.0,0.0,1.0);}
gl_FragColor=average;}
#endif
#if defined(TEXTURE_ADDER)
uniform sampler2D otherSampler;uniform sampler2D lensSampler;uniform float exposure;void main(void)
{vec3 colour=texture2D(textureSampler,vUV).rgb;colour*=exposure;vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);vec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);colour=retColor*retColor;colour+=colour*texture2D(lensSampler,vUV).rgb;vec4 finalColor=vec4(colour.rgb,1.0)+texture2D(otherSampler,vUV);gl_FragColor=finalColor;}
#endif
#if defined(VLS)
#define PI 3.1415926535897932384626433832795
uniform mat4 shadowViewProjection;uniform mat4 lightWorld;uniform vec3 cameraPosition;uniform vec3 sunDirection;uniform vec3 sunColor;uniform vec2 depthValues;uniform float scatteringCoefficient;uniform float scatteringPower;uniform sampler2D shadowMapSampler;uniform sampler2D positionSampler;float computeScattering(float lightDotView)
{float result=1.0-scatteringCoefficient*scatteringCoefficient;result/=(4.0*PI*pow(1.0+scatteringCoefficient*scatteringCoefficient-(2.0*scatteringCoefficient)*lightDotView,1.5));return result;}
void main(void)
{vec3 worldPos=texture2D(positionSampler,vUV).rgb;vec3 startPosition=cameraPosition;vec3 rayVector=worldPos-startPosition;float rayLength=length(rayVector);vec3 rayDirection=rayVector/rayLength;float stepLength=rayLength/NB_STEPS;vec3 stepL=rayDirection*stepLength;vec3 currentPosition=startPosition;vec3 accumFog=vec3(0.0);for (int i=0; i<int(NB_STEPS); i++)
{vec4 worldInShadowCameraSpace=shadowViewProjection*vec4(currentPosition,1.0);float depthMetric= (worldInShadowCameraSpace.z+depthValues.x)/(depthValues.y);float shadowPixelDepth=clamp(depthMetric,0.0,1.0);worldInShadowCameraSpace.xyz/=worldInShadowCameraSpace.w;worldInShadowCameraSpace.xyz=0.5*worldInShadowCameraSpace.xyz+vec3(0.5);float shadowMapValue=texture2D(shadowMapSampler,worldInShadowCameraSpace.xy).r;if (shadowMapValue>shadowPixelDepth)
accumFog+=sunColor*computeScattering(dot(rayDirection,sunDirection));currentPosition+=stepL;}
accumFog/=NB_STEPS;vec3 color=accumFog*scatteringPower;gl_FragColor=vec4(color*exp(color) ,1.0);}
#endif
#if defined(VLSMERGE)
uniform sampler2D originalSampler;void main(void)
{gl_FragColor=texture2D(originalSampler,vUV)+texture2D(textureSampler,vUV);}
#endif
#if defined(LUMINANCE)
uniform vec2 lumOffsets[4];void main()
{float average=0.0;vec4 color=vec4(0.0);float maximum=-1e20;vec3 weight=vec3(0.299,0.587,0.114);for (int i=0; i<4; i++)
{color=texture2D(textureSampler,vUV+ lumOffsets[i]);float GreyValue=dot(color.rgb,vec3(0.33,0.33,0.33));
#ifdef WEIGHTED_AVERAGE
float GreyValue=dot(color.rgb,weight);
#endif
#ifdef BRIGHTNESS
float GreyValue=max(color.r,max(color.g,color.b));
#endif
#ifdef HSL_COMPONENT
float GreyValue=0.5*(max(color.r,max(color.g,color.b))+min(color.r,min(color.g,color.b)));
#endif
#ifdef MAGNITUDE
float GreyValue=length(color.rgb);
#endif
maximum=max(maximum,GreyValue);average+=(0.25*log(1e-5+GreyValue));}
average=exp(average);gl_FragColor=vec4(average,maximum,0.0,1.0);}
#endif
#if defined(LUMINANCE_DOWN_SAMPLE)
uniform vec2 dsOffsets[9];uniform float halfDestPixelSize;
#ifdef FINAL_DOWN_SAMPLER
#include<packingFunctions>
#endif
void main()
{vec4 color=vec4(0.0);float average=0.0;for (int i=0; i<9; i++)
{color=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);average+=color.r;}
average/=9.0;
#ifdef FINAL_DOWN_SAMPLER
gl_FragColor=pack(average);
#else
gl_FragColor=vec4(average,average,0.0,1.0);
#endif
}
#endif
#if defined(HDR)
uniform sampler2D textureAdderSampler;uniform float averageLuminance;void main()
{vec4 color=texture2D(textureAdderSampler,vUV);
#ifndef AUTO_EXPOSURE
vec4 adjustedColor=color/averageLuminance;color=adjustedColor;color.a=1.0;
#endif
gl_FragColor=color;}
#endif
#if defined(LENS_FLARE)
#define GHOSTS 3
uniform sampler2D lensColorSampler;uniform float strength;uniform float ghostDispersal;uniform float haloWidth;uniform vec2 resolution;uniform float distortionStrength;float hash(vec2 p)
{float h=dot(p,vec2(127.1,311.7));return -1.0+2.0*fract(sin(h)*43758.5453123);}
float noise(in vec2 p)
{vec2 i=floor(p);vec2 f=fract(p);vec2 u=f*f*(3.0-2.0*f);return mix(mix(hash(i+vec2(0.0,0.0)),
hash(i+vec2(1.0,0.0)),u.x),
mix(hash(i+vec2(0.0,1.0)),
hash(i+vec2(1.0,1.0)),u.x),u.y);}
float fbm(vec2 p)
{float f=0.0;f+=0.5000*noise(p); p*=2.02;f+=0.2500*noise(p); p*=2.03;f+=0.1250*noise(p); p*=2.01;f+=0.0625*noise(p); p*=2.04;f/=0.9375;return f;}
vec3 pattern(vec2 uv)
{vec2 p=-1.0+2.0*uv;float p2=dot(p,p);float f=fbm(vec2(15.0*p2))/2.0;float r=0.2+0.6*sin(12.5*length(uv-vec2(0.5)));float g=0.2+0.6*sin(20.5*length(uv-vec2(0.5)));float b=0.2+0.6*sin(17.2*length(uv-vec2(0.5)));return (1.0-f)*vec3(r,g,b);}
float luminance(vec3 color)
{return dot(color.rgb,vec3(0.2126,0.7152,0.0722));}
vec4 textureDistorted(sampler2D tex,vec2 texcoord,vec2 direction,vec3 distortion)
{return vec4(
texture2D(tex,texcoord+direction*distortion.r).r,
texture2D(tex,texcoord+direction*distortion.g).g,
texture2D(tex,texcoord+direction*distortion.b).b,
1.0
);}
void main(void)
{vec2 uv=-vUV+vec2(1.0);vec2 ghostDir=(vec2(0.5)-uv)*ghostDispersal;vec2 texelSize=1.0/resolution;vec3 distortion=vec3(-texelSize.x*distortionStrength,0.0,texelSize.x*distortionStrength);vec4 result=vec4(0.0);float ghostIndice=1.0;for (int i=0; i<GHOSTS; ++i)
{vec2 offset=fract(uv+ghostDir*ghostIndice);float weight=length(vec2(0.5)-offset)/length(vec2(0.5));weight=pow(1.0-weight,10.0);result+=textureDistorted(textureSampler,offset,normalize(ghostDir),distortion)*weight*strength;ghostIndice+=1.0;}
vec2 haloVec=normalize(ghostDir)*haloWidth;float weight=length(vec2(0.5)-fract(uv+haloVec))/length(vec2(0.5));weight=pow(1.0-weight,10.0);result+=textureDistorted(textureSampler,fract(uv+haloVec),normalize(ghostDir),distortion)*weight*strength;result*=texture2D(lensColorSampler,vec2(length(vec2(0.5)-uv)/length(vec2(0.5))));gl_FragColor=result;}
#endif
#if defined(LENS_FLARE_COMPOSE)
uniform sampler2D otherSampler;uniform sampler2D lensDirtSampler;uniform sampler2D lensStarSampler;uniform mat4 lensStarMatrix;void main(void)
{vec2 lensFlareCoords=(lensStarMatrix*vec4(vUV,1.0,1.0)).xy;vec4 lensMod=texture2D(lensDirtSampler,vUV);lensMod+=texture2D(lensStarSampler,vUV/*lensFlareCoords*/);vec4 result=texture2D(textureSampler,vUV)*lensMod;gl_FragColor=texture2D(otherSampler,vUV)+result;}
#endif
#if defined(DEPTH_OF_FIELD)
uniform sampler2D otherSampler;uniform sampler2D depthSampler;uniform float distance;void main(void)
{vec4 sharp=texture2D(otherSampler,vUV);vec4 blur=texture2D(textureSampler,vUV);float dist=clamp(texture2D(depthSampler,vUV).r*distance,0.0,1.0);float factor=0.0;if (dist<0.05)
factor=1.0;else if (dist<0.1)
factor=20.0*(0.1-dist);else if (dist<0.5)
factor=0.0;else
factor=2.0*(dist-0.5);factor=clamp(factor,0.0,0.90);gl_FragColor=mix(sharp,blur,factor);}
#endif
#if defined(MOTION_BLUR)
uniform mat4 inverseViewProjection;uniform mat4 prevViewProjection;uniform vec2 screenSize;uniform float motionScale;uniform float motionStrength;uniform sampler2D depthSampler;void main(void)
{vec2 texelSize=1.0/screenSize;float depth=texture2D(depthSampler,vUV).r;vec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);cpos=cpos*inverseViewProjection;vec4 ppos=cpos*prevViewProjection;ppos.xyz/=ppos.w;ppos.xy=ppos.xy*0.5+0.5;vec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;float speed=length(velocity/texelSize);int nSamples=int(clamp(speed,1.0,MAX_MOTION_SAMPLES));vec4 result=texture2D(textureSampler,vUV);for (int i=1; i<int(MAX_MOTION_SAMPLES); ++i) {if (i>=nSamples)
break;vec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);result+=texture2D(textureSampler,offset1);}
gl_FragColor=result/float(nSamples);}
#endif
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[standard_fragment_name] = standard_fragment_shader;
/** @internal */
const standardPixelShader = { name: standard_fragment_name, shader: standard_fragment_shader };
//# sourceMappingURL=standard.fragment.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js


















/**
 * Standard rendering pipeline
 * Default pipeline should be used going forward but the standard pipeline will be kept for backwards compatibility.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/standardRenderingPipeline
 */
class StandardRenderingPipeline extends PostProcessRenderPipeline {
    /**
     * Gets the overall exposure used by the pipeline
     */
    get exposure() {
        return this._fixedExposure;
    }
    /**
     * Sets the overall exposure used by the pipeline
     */
    set exposure(value) {
        this._fixedExposure = value;
        this._currentExposure = value;
    }
    /**
     * Gets whether or not the exposure of the overall pipeline should be automatically adjusted by the HDR post-process
     */
    get hdrAutoExposure() {
        return this._hdrAutoExposure;
    }
    /**
     * Sets whether or not the exposure of the overall pipeline should be automatically adjusted by the HDR post-process
     */
    set hdrAutoExposure(value) {
        this._hdrAutoExposure = value;
        if (this.hdrPostProcess) {
            const defines = ["#define HDR"];
            if (value) {
                defines.push("#define AUTO_EXPOSURE");
            }
            this.hdrPostProcess.updateEffect(defines.join("\n"));
        }
    }
    /**
     * Gets how much the image is blurred by the movement while using the motion blur post-process
     */
    get motionStrength() {
        return this._motionStrength;
    }
    /**
     * Sets how much the image is blurred by the movement while using the motion blur post-process
     */
    set motionStrength(strength) {
        this._motionStrength = strength;
        if (this._isObjectBasedMotionBlur && this.motionBlurPostProcess) {
            this.motionBlurPostProcess.motionStrength = strength;
        }
    }
    /**
     * Gets whether or not the motion blur post-process is object based or screen based.
     */
    get objectBasedMotionBlur() {
        return this._isObjectBasedMotionBlur;
    }
    /**
     * Sets whether or not the motion blur post-process should be object based or screen based
     */
    set objectBasedMotionBlur(value) {
        const shouldRebuild = this._isObjectBasedMotionBlur !== value;
        this._isObjectBasedMotionBlur = value;
        if (shouldRebuild) {
            this._buildPipeline();
        }
    }
    /**
     * @ignore
     * Specifies if the bloom pipeline is enabled
     */
    get BloomEnabled() {
        return this._bloomEnabled;
    }
    set BloomEnabled(enabled) {
        if (this._bloomEnabled === enabled) {
            return;
        }
        this._bloomEnabled = enabled;
        this._buildPipeline();
    }
    /**
     * @ignore
     * Specifies if the depth of field pipeline is enabled
     */
    get DepthOfFieldEnabled() {
        return this._depthOfFieldEnabled;
    }
    set DepthOfFieldEnabled(enabled) {
        if (this._depthOfFieldEnabled === enabled) {
            return;
        }
        this._depthOfFieldEnabled = enabled;
        this._buildPipeline();
    }
    /**
     * @ignore
     * Specifies if the lens flare pipeline is enabled
     */
    get LensFlareEnabled() {
        return this._lensFlareEnabled;
    }
    set LensFlareEnabled(enabled) {
        if (this._lensFlareEnabled === enabled) {
            return;
        }
        this._lensFlareEnabled = enabled;
        this._buildPipeline();
    }
    /**
     * @ignore
     * Specifies if the HDR pipeline is enabled
     */
    get HDREnabled() {
        return this._hdrEnabled;
    }
    set HDREnabled(enabled) {
        if (this._hdrEnabled === enabled) {
            return;
        }
        this._hdrEnabled = enabled;
        this._buildPipeline();
    }
    /**
     * @ignore
     * Specifies if the volumetric lights scattering effect is enabled
     */
    get VLSEnabled() {
        return this._vlsEnabled;
    }
    // eslint-disable-next-line @typescript-eslint/naming-convention
    set VLSEnabled(enabled) {
        if (this._vlsEnabled === enabled) {
            return;
        }
        if (enabled) {
            const geometry = this._scene.enableGeometryBufferRenderer();
            if (!geometry) {
                logger/* Logger */.V.Warn("Geometry renderer is not supported, cannot create volumetric lights in Standard Rendering Pipeline");
                return;
            }
        }
        this._vlsEnabled = enabled;
        this._buildPipeline();
    }
    /**
     * @ignore
     * Specifies if the motion blur effect is enabled
     */
    get MotionBlurEnabled() {
        return this._motionBlurEnabled;
    }
    set MotionBlurEnabled(enabled) {
        if (this._motionBlurEnabled === enabled) {
            return;
        }
        this._motionBlurEnabled = enabled;
        this._buildPipeline();
    }
    /**
     * Specifies if anti-aliasing is enabled
     */
    get fxaaEnabled() {
        return this._fxaaEnabled;
    }
    set fxaaEnabled(enabled) {
        if (this._fxaaEnabled === enabled) {
            return;
        }
        this._fxaaEnabled = enabled;
        this._buildPipeline();
    }
    /**
     * Specifies if screen space reflections are enabled.
     */
    get screenSpaceReflectionsEnabled() {
        return this._screenSpaceReflectionsEnabled;
    }
    set screenSpaceReflectionsEnabled(enabled) {
        if (this._screenSpaceReflectionsEnabled === enabled) {
            return;
        }
        this._screenSpaceReflectionsEnabled = enabled;
        this._buildPipeline();
    }
    /**
     * Specifies the number of steps used to calculate the volumetric lights
     * Typically in interval [50, 200]
     */
    get volumetricLightStepsCount() {
        return this._volumetricLightStepsCount;
    }
    set volumetricLightStepsCount(count) {
        if (this.volumetricLightPostProcess) {
            this.volumetricLightPostProcess.updateEffect("#define VLS\n#define NB_STEPS " + count.toFixed(1));
        }
        this._volumetricLightStepsCount = count;
    }
    /**
     * Specifies the number of samples used for the motion blur effect
     * Typically in interval [16, 64]
     */
    get motionBlurSamples() {
        return this._motionBlurSamples;
    }
    set motionBlurSamples(samples) {
        if (this.motionBlurPostProcess) {
            if (this._isObjectBasedMotionBlur) {
                this.motionBlurPostProcess.motionBlurSamples = samples;
            }
            else {
                this.motionBlurPostProcess.updateEffect("#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES " + samples.toFixed(1));
            }
        }
        this._motionBlurSamples = samples;
    }
    /**
     * Specifies MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)
     */
    get samples() {
        return this._samples;
    }
    set samples(sampleCount) {
        if (this._samples === sampleCount) {
            return;
        }
        this._samples = sampleCount;
        this._buildPipeline();
    }
    /**
     * Default pipeline should be used going forward but the standard pipeline will be kept for backwards compatibility.
     * @constructor
     * @param name The rendering pipeline name
     * @param scene The scene linked to this pipeline
     * @param ratio The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5)
     * @param originalPostProcess the custom original color post-process. Must be "reusable". Can be null.
     * @param cameras The array of cameras that the rendering pipeline will be attached to
     */
    constructor(name, scene, ratio, originalPostProcess = null, cameras) {
        super(scene.getEngine(), name);
        /**
         * Post-process used to down scale an image x4
         */
        this.downSampleX4PostProcess = null;
        /**
         * Post-process used to calculate the illuminated surfaces controlled by a threshold
         */
        this.brightPassPostProcess = null;
        /**
         * Post-process array storing all the horizontal blur post-processes used by the pipeline
         */
        this.blurHPostProcesses = [];
        /**
         * Post-process array storing all the vertical blur post-processes used by the pipeline
         */
        this.blurVPostProcesses = [];
        /**
         * Post-process used to add colors of 2 textures (typically brightness + real scene color)
         */
        this.textureAdderPostProcess = null;
        /**
         * Post-process used to create volumetric lighting effect
         */
        this.volumetricLightPostProcess = null;
        /**
         * Post-process used to smooth the previous volumetric light post-process on the X axis
         */
        this.volumetricLightSmoothXPostProcess = null;
        /**
         * Post-process used to smooth the previous volumetric light post-process on the Y axis
         */
        this.volumetricLightSmoothYPostProcess = null;
        /**
         * Post-process used to merge the volumetric light effect and the real scene color
         */
        this.volumetricLightMergePostProces = null;
        /**
         * Post-process used to store the final volumetric light post-process (attach/detach for debug purpose)
         */
        this.volumetricLightFinalPostProcess = null;
        /**
         * Base post-process used to calculate the average luminance of the final image for HDR
         */
        this.luminancePostProcess = null;
        /**
         * Post-processes used to create down sample post-processes in order to get
         * the average luminance of the final image for HDR
         * Array of length "StandardRenderingPipeline.LuminanceSteps"
         */
        this.luminanceDownSamplePostProcesses = [];
        /**
         * Post-process used to create a HDR effect (light adaptation)
         */
        this.hdrPostProcess = null;
        /**
         * Post-process used to store the final texture adder post-process (attach/detach for debug purpose)
         */
        this.textureAdderFinalPostProcess = null;
        /**
         * Post-process used to store the final lens flare post-process (attach/detach for debug purpose)
         */
        this.lensFlareFinalPostProcess = null;
        /**
         * Post-process used to merge the final HDR post-process and the real scene color
         */
        this.hdrFinalPostProcess = null;
        /**
         * Post-process used to create a lens flare effect
         */
        this.lensFlarePostProcess = null;
        /**
         * Post-process that merges the result of the lens flare post-process and the real scene color
         */
        this.lensFlareComposePostProcess = null;
        /**
         * Post-process used to create a motion blur effect
         */
        this.motionBlurPostProcess = null;
        /**
         * Post-process used to create a depth of field effect
         */
        this.depthOfFieldPostProcess = null;
        /**
         * The Fast Approximate Anti-Aliasing post process which attempts to remove aliasing from an image.
         */
        this.fxaaPostProcess = null;
        /**
         * Post-process used to simulate realtime reflections using the screen space and geometry renderer.
         */
        this.screenSpaceReflectionPostProcess = null;
        // Values
        /**
         * Represents the brightness threshold in order to configure the illuminated surfaces
         */
        this.brightThreshold = 1.0;
        /**
         * Configures the blur intensity used for surexposed surfaces are highlighted surfaces (light halo)
         */
        this.blurWidth = 512.0;
        /**
         * Sets if the blur for highlighted surfaces must be only horizontal
         */
        this.horizontalBlur = false;
        /**
         * Texture used typically to simulate "dirty" on camera lens
         */
        this.lensTexture = null;
        /**
         * Represents the offset coefficient based on Rayleigh principle. Typically in interval [-0.2, 0.2]
         */
        this.volumetricLightCoefficient = 0.2;
        /**
         * The overall power of volumetric lights, typically in interval [0, 10] maximum
         */
        this.volumetricLightPower = 4.0;
        /**
         * Used the set the blur intensity to smooth the volumetric lights
         */
        this.volumetricLightBlurScale = 64.0;
        /**
         * Light (spot or directional) used to generate the volumetric lights rays
         * The source light must have a shadow generate so the pipeline can get its
         * depth map
         */
        this.sourceLight = null;
        /**
         * For eye adaptation, represents the minimum luminance the eye can see
         */
        this.hdrMinimumLuminance = 1.0;
        /**
         * For eye adaptation, represents the decrease luminance speed
         */
        this.hdrDecreaseRate = 0.5;
        /**
         * For eye adaptation, represents the increase luminance speed
         */
        this.hdrIncreaseRate = 0.5;
        /**
         * Lens color texture used by the lens flare effect. Mandatory if lens flare effect enabled
         */
        this.lensColorTexture = null;
        /**
         * The overall strength for the lens flare effect
         */
        this.lensFlareStrength = 20.0;
        /**
         * Dispersion coefficient for lens flare ghosts
         */
        this.lensFlareGhostDispersal = 1.4;
        /**
         * Main lens flare halo width
         */
        this.lensFlareHaloWidth = 0.7;
        /**
         * Based on the lens distortion effect, defines how much the lens flare result
         * is distorted
         */
        this.lensFlareDistortionStrength = 16.0;
        /**
         * Configures the blur intensity used for for lens flare (halo)
         */
        this.lensFlareBlurWidth = 512.0;
        /**
         * Lens star texture must be used to simulate rays on the flares and is available
         * in the documentation
         */
        this.lensStarTexture = null;
        /**
         * As the "lensTexture" (can be the same texture or different), it is used to apply the lens
         * flare effect by taking account of the dirt texture
         */
        this.lensFlareDirtTexture = null;
        /**
         * Represents the focal length for the depth of field effect
         */
        this.depthOfFieldDistance = 10.0;
        /**
         * Represents the blur intensity for the blurred part of the depth of field effect
         */
        this.depthOfFieldBlurWidth = 64.0;
        /**
         * List of animations for the pipeline (IAnimatable implementation)
         */
        this.animations = [];
        this._currentDepthOfFieldSource = null;
        this._fixedExposure = 1.0;
        this._currentExposure = 1.0;
        this._hdrAutoExposure = false;
        this._hdrCurrentLuminance = 1.0;
        this._motionStrength = 1.0;
        this._isObjectBasedMotionBlur = false;
        this._camerasToBeAttached = [];
        // Getters and setters
        this._bloomEnabled = false;
        this._depthOfFieldEnabled = false;
        this._vlsEnabled = false;
        this._lensFlareEnabled = false;
        this._hdrEnabled = false;
        this._motionBlurEnabled = false;
        this._fxaaEnabled = false;
        this._screenSpaceReflectionsEnabled = false;
        this._motionBlurSamples = 64.0;
        this._volumetricLightStepsCount = 50.0;
        this._samples = 1;
        this._cameras = cameras || scene.cameras;
        this._cameras = this._cameras.slice();
        this._camerasToBeAttached = this._cameras.slice();
        // Initialize
        this._scene = scene;
        this._basePostProcess = originalPostProcess;
        this._ratio = ratio;
        // Misc
        this._floatTextureType = scene.getEngine().getCaps().textureFloatRender ? 1 : 2;
        // Finish
        scene.postProcessRenderPipelineManager.addPipeline(this);
        this._buildPipeline();
    }
    _buildPipeline() {
        const ratio = this._ratio;
        const scene = this._scene;
        this._disposePostProcesses();
        if (this._cameras !== null) {
            this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
            // get back cameras to be used to reattach pipeline
            this._cameras = this._camerasToBeAttached.slice();
        }
        this._reset();
        // Create pass post-process
        if (this._screenSpaceReflectionsEnabled) {
            this.screenSpaceReflectionPostProcess = new ScreenSpaceReflectionPostProcess("HDRPass", scene, ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, this._floatTextureType);
            this.screenSpaceReflectionPostProcess.onApplyObservable.add(() => {
                this._currentDepthOfFieldSource = this.screenSpaceReflectionPostProcess;
            });
            this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRScreenSpaceReflections", () => this.screenSpaceReflectionPostProcess, true));
        }
        if (!this._basePostProcess) {
            this.originalPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRPass", "standard", [], [], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define PASS_POST_PROCESS", this._floatTextureType);
        }
        else {
            this.originalPostProcess = this._basePostProcess;
        }
        this.originalPostProcess.autoClear = !this.screenSpaceReflectionPostProcess;
        this.originalPostProcess.onApplyObservable.add(() => {
            this._currentDepthOfFieldSource = this.originalPostProcess;
        });
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRPassPostProcess", () => this.originalPostProcess, true));
        if (this._bloomEnabled) {
            // Create down sample X4 post-process
            this._createDownSampleX4PostProcess(scene, ratio / 4);
            // Create bright pass post-process
            this._createBrightPassPostProcess(scene, ratio / 4);
            // Create gaussian blur post-processes (down sampling blurs)
            this._createBlurPostProcesses(scene, ratio / 4, 1);
            // Create texture adder post-process
            this._createTextureAdderPostProcess(scene, ratio);
            // Create depth-of-field source post-process
            this.textureAdderFinalPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRDepthOfFieldSource", "standard", [], [], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define PASS_POST_PROCESS", 0);
            this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRBaseDepthOfFieldSource", () => {
                return this.textureAdderFinalPostProcess;
            }, true));
        }
        if (this._vlsEnabled) {
            // Create volumetric light
            this._createVolumetricLightPostProcess(scene, ratio);
            // Create volumetric light final post-process
            this.volumetricLightFinalPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRVLSFinal", "standard", [], [], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define PASS_POST_PROCESS", 0);
            this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRVLSFinal", () => {
                return this.volumetricLightFinalPostProcess;
            }, true));
        }
        if (this._lensFlareEnabled) {
            // Create lens flare post-process
            this._createLensFlarePostProcess(scene, ratio);
            // Create depth-of-field source post-process post lens-flare and disable it now
            this.lensFlareFinalPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRPostLensFlareDepthOfFieldSource", "standard", [], [], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define PASS_POST_PROCESS", 0);
            this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRPostLensFlareDepthOfFieldSource", () => {
                return this.lensFlareFinalPostProcess;
            }, true));
        }
        if (this._hdrEnabled) {
            // Create luminance
            this._createLuminancePostProcesses(scene, this._floatTextureType);
            // Create HDR
            this._createHdrPostProcess(scene, ratio);
            // Create depth-of-field source post-process post hdr and disable it now
            this.hdrFinalPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRPostHDReDepthOfFieldSource", "standard", [], [], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define PASS_POST_PROCESS", 0);
            this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRPostHDReDepthOfFieldSource", () => {
                return this.hdrFinalPostProcess;
            }, true));
        }
        if (this._depthOfFieldEnabled) {
            // Create gaussian blur used by depth-of-field
            this._createBlurPostProcesses(scene, ratio / 2, 3, "depthOfFieldBlurWidth");
            // Create depth-of-field post-process
            this._createDepthOfFieldPostProcess(scene, ratio);
        }
        if (this._motionBlurEnabled) {
            // Create motion blur post-process
            this._createMotionBlurPostProcess(scene, ratio);
        }
        if (this._fxaaEnabled) {
            // Create fxaa post-process
            this.fxaaPostProcess = new FxaaPostProcess("fxaa", 1.0, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, 0);
            this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRFxaa", () => {
                return this.fxaaPostProcess;
            }, true));
        }
        if (this._cameras !== null) {
            this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
        }
        if (!this._enableMSAAOnFirstPostProcess(this._samples) && this._samples > 1) {
            logger/* Logger */.V.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
        }
    }
    // Down Sample X4 Post-Process
    _createDownSampleX4PostProcess(scene, ratio) {
        const downSampleX4Offsets = new Array(32);
        this.downSampleX4PostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRDownSampleX4", "standard", ["dsOffsets"], [], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define DOWN_SAMPLE_X4", this._floatTextureType);
        this.downSampleX4PostProcess.onApply = (effect) => {
            let id = 0;
            const width = this.downSampleX4PostProcess.width;
            const height = this.downSampleX4PostProcess.height;
            for (let i = -2; i < 2; i++) {
                for (let j = -2; j < 2; j++) {
                    downSampleX4Offsets[id] = (i + 0.5) * (1.0 / width);
                    downSampleX4Offsets[id + 1] = (j + 0.5) * (1.0 / height);
                    id += 2;
                }
            }
            effect.setArray2("dsOffsets", downSampleX4Offsets);
        };
        // Add to pipeline
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRDownSampleX4", () => {
            return this.downSampleX4PostProcess;
        }, true));
    }
    // Brightpass Post-Process
    _createBrightPassPostProcess(scene, ratio) {
        const brightOffsets = new Array(8);
        this.brightPassPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRBrightPass", "standard", ["dsOffsets", "brightThreshold"], [], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define BRIGHT_PASS", this._floatTextureType);
        this.brightPassPostProcess.onApply = (effect) => {
            const sU = 1.0 / this.brightPassPostProcess.width;
            const sV = 1.0 / this.brightPassPostProcess.height;
            brightOffsets[0] = -0.5 * sU;
            brightOffsets[1] = 0.5 * sV;
            brightOffsets[2] = 0.5 * sU;
            brightOffsets[3] = 0.5 * sV;
            brightOffsets[4] = -0.5 * sU;
            brightOffsets[5] = -0.5 * sV;
            brightOffsets[6] = 0.5 * sU;
            brightOffsets[7] = -0.5 * sV;
            effect.setArray2("dsOffsets", brightOffsets);
            effect.setFloat("brightThreshold", this.brightThreshold);
        };
        // Add to pipeline
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRBrightPass", () => {
            return this.brightPassPostProcess;
        }, true));
    }
    // Create blur H&V post-processes
    _createBlurPostProcesses(scene, ratio, indice, blurWidthKey = "blurWidth") {
        const engine = scene.getEngine();
        const blurX = new BlurPostProcess("HDRBlurH" + "_" + indice, new math_vector/* Vector2 */.I9(1, 0), this[blurWidthKey], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, this._floatTextureType);
        const blurY = new BlurPostProcess("HDRBlurV" + "_" + indice, new math_vector/* Vector2 */.I9(0, 1), this[blurWidthKey], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, this._floatTextureType);
        blurX.onActivateObservable.add(() => {
            const dw = blurX.width / engine.getRenderWidth();
            blurX.kernel = this[blurWidthKey] * dw;
        });
        blurY.onActivateObservable.add(() => {
            const dw = blurY.height / engine.getRenderHeight();
            blurY.kernel = this.horizontalBlur ? 64 * dw : this[blurWidthKey] * dw;
        });
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRBlurH" + indice, () => {
            return blurX;
        }, true));
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRBlurV" + indice, () => {
            return blurY;
        }, true));
        this.blurHPostProcesses.push(blurX);
        this.blurVPostProcesses.push(blurY);
    }
    // Create texture adder post-process
    _createTextureAdderPostProcess(scene, ratio) {
        this.textureAdderPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRTextureAdder", "standard", ["exposure"], ["otherSampler", "lensSampler"], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define TEXTURE_ADDER", this._floatTextureType);
        this.textureAdderPostProcess.onApply = (effect) => {
            effect.setTextureFromPostProcess("otherSampler", this._vlsEnabled ? this._currentDepthOfFieldSource : this.originalPostProcess);
            effect.setTexture("lensSampler", this.lensTexture);
            effect.setFloat("exposure", this._currentExposure);
            this._currentDepthOfFieldSource = this.textureAdderFinalPostProcess;
        };
        // Add to pipeline
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRTextureAdder", () => {
            return this.textureAdderPostProcess;
        }, true));
    }
    _createVolumetricLightPostProcess(scene, ratio) {
        const geometryRenderer = scene.enableGeometryBufferRenderer();
        geometryRenderer.enablePosition = true;
        const geometry = geometryRenderer.getGBuffer();
        // Base post-process
        this.volumetricLightPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRVLS", "standard", ["shadowViewProjection", "cameraPosition", "sunDirection", "sunColor", "scatteringCoefficient", "scatteringPower", "depthValues"], ["shadowMapSampler", "positionSampler"], ratio / 8, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define VLS\n#define NB_STEPS " + this._volumetricLightStepsCount.toFixed(1));
        const depthValues = math_vector/* Vector2 */.I9.Zero();
        this.volumetricLightPostProcess.onApply = (effect) => {
            if (this.sourceLight && this.sourceLight.getShadowGenerator() && this._scene.activeCamera) {
                const generator = this.sourceLight.getShadowGenerator();
                effect.setTexture("shadowMapSampler", generator.getShadowMap());
                effect.setTexture("positionSampler", geometry.textures[2]);
                effect.setColor3("sunColor", this.sourceLight.diffuse);
                effect.setVector3("sunDirection", this.sourceLight.getShadowDirection());
                effect.setVector3("cameraPosition", this._scene.activeCamera.globalPosition);
                effect.setMatrix("shadowViewProjection", generator.getTransformMatrix());
                effect.setFloat("scatteringCoefficient", this.volumetricLightCoefficient);
                effect.setFloat("scatteringPower", this.volumetricLightPower);
                depthValues.x = this.sourceLight.getDepthMinZ(this._scene.activeCamera);
                depthValues.y = this.sourceLight.getDepthMaxZ(this._scene.activeCamera);
                effect.setVector2("depthValues", depthValues);
            }
        };
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRVLS", () => {
            return this.volumetricLightPostProcess;
        }, true));
        // Smooth
        this._createBlurPostProcesses(scene, ratio / 4, 0, "volumetricLightBlurScale");
        // Merge
        this.volumetricLightMergePostProces = new PostProcesses_postProcess/* PostProcess */.w("HDRVLSMerge", "standard", [], ["originalSampler"], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define VLSMERGE");
        this.volumetricLightMergePostProces.onApply = (effect) => {
            effect.setTextureFromPostProcess("originalSampler", this._bloomEnabled ? this.textureAdderFinalPostProcess : this.originalPostProcess);
            this._currentDepthOfFieldSource = this.volumetricLightFinalPostProcess;
        };
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRVLSMerge", () => {
            return this.volumetricLightMergePostProces;
        }, true));
    }
    // Create luminance
    _createLuminancePostProcesses(scene, textureType) {
        // Create luminance
        let size = Math.pow(3, StandardRenderingPipeline.LuminanceSteps);
        this.luminancePostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRLuminance", "standard", ["lumOffsets"], [], { width: size, height: size }, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define LUMINANCE", textureType);
        const offsets = [];
        this.luminancePostProcess.onApply = (effect) => {
            const sU = 1.0 / this.luminancePostProcess.width;
            const sV = 1.0 / this.luminancePostProcess.height;
            offsets[0] = -0.5 * sU;
            offsets[1] = 0.5 * sV;
            offsets[2] = 0.5 * sU;
            offsets[3] = 0.5 * sV;
            offsets[4] = -0.5 * sU;
            offsets[5] = -0.5 * sV;
            offsets[6] = 0.5 * sU;
            offsets[7] = -0.5 * sV;
            effect.setArray2("lumOffsets", offsets);
        };
        // Add to pipeline
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLuminance", () => {
            return this.luminancePostProcess;
        }, true));
        // Create down sample luminance
        for (let i = StandardRenderingPipeline.LuminanceSteps - 1; i >= 0; i--) {
            size = Math.pow(3, i);
            let defines = "#define LUMINANCE_DOWN_SAMPLE\n";
            if (i === 0) {
                defines += "#define FINAL_DOWN_SAMPLER";
            }
            const postProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRLuminanceDownSample" + i, "standard", ["dsOffsets", "halfDestPixelSize"], [], { width: size, height: size }, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, defines, textureType);
            this.luminanceDownSamplePostProcesses.push(postProcess);
        }
        // Create callbacks and add effects
        let lastLuminance = this.luminancePostProcess;
        this.luminanceDownSamplePostProcesses.forEach((pp, index) => {
            const downSampleOffsets = new Array(18);
            pp.onApply = (effect) => {
                if (!lastLuminance) {
                    return;
                }
                let id = 0;
                for (let x = -1; x < 2; x++) {
                    for (let y = -1; y < 2; y++) {
                        downSampleOffsets[id] = x / lastLuminance.width;
                        downSampleOffsets[id + 1] = y / lastLuminance.height;
                        id += 2;
                    }
                }
                effect.setArray2("dsOffsets", downSampleOffsets);
                effect.setFloat("halfDestPixelSize", 0.5 / lastLuminance.width);
                if (index === this.luminanceDownSamplePostProcesses.length - 1) {
                    lastLuminance = this.luminancePostProcess;
                }
                else {
                    lastLuminance = pp;
                }
            };
            if (index === this.luminanceDownSamplePostProcesses.length - 1) {
                pp.onAfterRender = () => {
                    const pixel = scene.getEngine().readPixels(0, 0, 1, 1);
                    const bit_shift = new math_vector/* Vector4 */.IU(1.0 / (255.0 * 255.0 * 255.0), 1.0 / (255.0 * 255.0), 1.0 / 255.0, 1.0);
                    pixel.then((pixel) => {
                        const data = new Uint8Array(pixel.buffer);
                        this._hdrCurrentLuminance = (data[0] * bit_shift.x + data[1] * bit_shift.y + data[2] * bit_shift.z + data[3] * bit_shift.w) / 100.0;
                    });
                };
            }
            this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLuminanceDownSample" + index, () => {
                return pp;
            }, true));
        });
    }
    // Create HDR post-process
    _createHdrPostProcess(scene, ratio) {
        const defines = ["#define HDR"];
        if (this._hdrAutoExposure) {
            defines.push("#define AUTO_EXPOSURE");
        }
        this.hdrPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDR", "standard", ["averageLuminance"], ["textureAdderSampler"], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, defines.join("\n"), 0);
        let outputLiminance = 1;
        let time = 0;
        let lastTime = 0;
        this.hdrPostProcess.onApply = (effect) => {
            effect.setTextureFromPostProcess("textureAdderSampler", this._currentDepthOfFieldSource);
            time += scene.getEngine().getDeltaTime();
            if (outputLiminance < 0) {
                outputLiminance = this._hdrCurrentLuminance;
            }
            else {
                const dt = (lastTime - time) / 1000.0;
                if (this._hdrCurrentLuminance < outputLiminance + this.hdrDecreaseRate * dt) {
                    outputLiminance += this.hdrDecreaseRate * dt;
                }
                else if (this._hdrCurrentLuminance > outputLiminance - this.hdrIncreaseRate * dt) {
                    outputLiminance -= this.hdrIncreaseRate * dt;
                }
                else {
                    outputLiminance = this._hdrCurrentLuminance;
                }
            }
            if (this.hdrAutoExposure) {
                this._currentExposure = this._fixedExposure / outputLiminance;
            }
            else {
                outputLiminance = (0,math_scalar_functions.Clamp)(outputLiminance, this.hdrMinimumLuminance, 1e20);
                effect.setFloat("averageLuminance", outputLiminance);
            }
            lastTime = time;
            this._currentDepthOfFieldSource = this.hdrFinalPostProcess;
        };
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDR", () => {
            return this.hdrPostProcess;
        }, true));
    }
    // Create lens flare post-process
    _createLensFlarePostProcess(scene, ratio) {
        this.lensFlarePostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRLensFlare", "standard", ["strength", "ghostDispersal", "haloWidth", "resolution", "distortionStrength"], ["lensColorSampler"], ratio / 2, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define LENS_FLARE", 0);
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLensFlare", () => {
            return this.lensFlarePostProcess;
        }, true));
        this._createBlurPostProcesses(scene, ratio / 4, 2, "lensFlareBlurWidth");
        this.lensFlareComposePostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRLensFlareCompose", "standard", ["lensStarMatrix"], ["otherSampler", "lensDirtSampler", "lensStarSampler"], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define LENS_FLARE_COMPOSE", 0);
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLensFlareCompose", () => {
            return this.lensFlareComposePostProcess;
        }, true));
        const resolution = new math_vector/* Vector2 */.I9(0, 0);
        // Lens flare
        this.lensFlarePostProcess.externalTextureSamplerBinding = true;
        this.lensFlarePostProcess.onApply = (effect) => {
            effect.setTextureFromPostProcess("textureSampler", this._bloomEnabled ? this.blurHPostProcesses[0] : this.originalPostProcess);
            effect.setTexture("lensColorSampler", this.lensColorTexture);
            effect.setFloat("strength", this.lensFlareStrength);
            effect.setFloat("ghostDispersal", this.lensFlareGhostDispersal);
            effect.setFloat("haloWidth", this.lensFlareHaloWidth);
            // Shift
            resolution.x = this.lensFlarePostProcess.width;
            resolution.y = this.lensFlarePostProcess.height;
            effect.setVector2("resolution", resolution);
            effect.setFloat("distortionStrength", this.lensFlareDistortionStrength);
        };
        // Compose
        const scaleBias1 = math_vector/* Matrix */.uq.FromValues(2.0, 0.0, -1.0, 0.0, 0.0, 2.0, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
        const scaleBias2 = math_vector/* Matrix */.uq.FromValues(0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
        this.lensFlareComposePostProcess.onApply = (effect) => {
            if (!this._scene.activeCamera) {
                return;
            }
            effect.setTextureFromPostProcess("otherSampler", this.lensFlarePostProcess);
            effect.setTexture("lensDirtSampler", this.lensFlareDirtTexture);
            effect.setTexture("lensStarSampler", this.lensStarTexture);
            // Lens start rotation matrix
            const camerax = this._scene.activeCamera.getViewMatrix().getRow(0);
            const cameraz = this._scene.activeCamera.getViewMatrix().getRow(2);
            let camRot = math_vector/* Vector3 */.Pq.Dot(camerax.toVector3(), new math_vector/* Vector3 */.Pq(1.0, 0.0, 0.0)) + math_vector/* Vector3 */.Pq.Dot(cameraz.toVector3(), new math_vector/* Vector3 */.Pq(0.0, 0.0, 1.0));
            camRot *= 4.0;
            const starRotation = math_vector/* Matrix */.uq.FromValues(Math.cos(camRot) * 0.5, -Math.sin(camRot), 0.0, 0.0, Math.sin(camRot), Math.cos(camRot) * 0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
            const lensStarMatrix = scaleBias2.multiply(starRotation).multiply(scaleBias1);
            effect.setMatrix("lensStarMatrix", lensStarMatrix);
            this._currentDepthOfFieldSource = this.lensFlareFinalPostProcess;
        };
    }
    // Create depth-of-field post-process
    _createDepthOfFieldPostProcess(scene, ratio) {
        this.depthOfFieldPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRDepthOfField", "standard", ["distance"], ["otherSampler", "depthSampler"], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define DEPTH_OF_FIELD", 0);
        this.depthOfFieldPostProcess.onApply = (effect) => {
            effect.setTextureFromPostProcess("otherSampler", this._currentDepthOfFieldSource);
            effect.setTexture("depthSampler", this._getDepthTexture());
            effect.setFloat("distance", this.depthOfFieldDistance);
        };
        // Add to pipeline
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRDepthOfField", () => {
            return this.depthOfFieldPostProcess;
        }, true));
    }
    // Create motion blur post-process
    _createMotionBlurPostProcess(scene, ratio) {
        if (this._isObjectBasedMotionBlur) {
            const mb = new MotionBlurPostProcess("HDRMotionBlur", scene, ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, 0);
            mb.motionStrength = this.motionStrength;
            mb.motionBlurSamples = this.motionBlurSamples;
            this.motionBlurPostProcess = mb;
        }
        else {
            this.motionBlurPostProcess = new PostProcesses_postProcess/* PostProcess */.w("HDRMotionBlur", "standard", ["inverseViewProjection", "prevViewProjection", "screenSize", "motionScale", "motionStrength"], ["depthSampler"], ratio, null, Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES " + this.motionBlurSamples.toFixed(1), 0);
            let motionScale = 0;
            let prevViewProjection = math_vector/* Matrix */.uq.Identity();
            const invViewProjection = math_vector/* Matrix */.uq.Identity();
            let viewProjection = math_vector/* Matrix */.uq.Identity();
            const screenSize = math_vector/* Vector2 */.I9.Zero();
            this.motionBlurPostProcess.onApply = (effect) => {
                viewProjection = scene.getProjectionMatrix().multiply(scene.getViewMatrix());
                viewProjection.invertToRef(invViewProjection);
                effect.setMatrix("inverseViewProjection", invViewProjection);
                effect.setMatrix("prevViewProjection", prevViewProjection);
                prevViewProjection = viewProjection;
                screenSize.x = this.motionBlurPostProcess.width;
                screenSize.y = this.motionBlurPostProcess.height;
                effect.setVector2("screenSize", screenSize);
                motionScale = scene.getEngine().getFps() / 60.0;
                effect.setFloat("motionScale", motionScale);
                effect.setFloat("motionStrength", this.motionStrength);
                effect.setTexture("depthSampler", this._getDepthTexture());
            };
        }
        this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRMotionBlur", () => {
            return this.motionBlurPostProcess;
        }, true));
    }
    _getDepthTexture() {
        if (this._scene.getEngine().getCaps().drawBuffersExtension) {
            const renderer = this._scene.enableGeometryBufferRenderer();
            return renderer.getGBuffer().textures[0];
        }
        return this._scene.enableDepthRenderer().getDepthMap();
    }
    _disposePostProcesses() {
        for (let i = 0; i < this._cameras.length; i++) {
            const camera = this._cameras[i];
            if (this.originalPostProcess) {
                this.originalPostProcess.dispose(camera);
            }
            if (this.screenSpaceReflectionPostProcess) {
                this.screenSpaceReflectionPostProcess.dispose(camera);
            }
            if (this.downSampleX4PostProcess) {
                this.downSampleX4PostProcess.dispose(camera);
            }
            if (this.brightPassPostProcess) {
                this.brightPassPostProcess.dispose(camera);
            }
            if (this.textureAdderPostProcess) {
                this.textureAdderPostProcess.dispose(camera);
            }
            if (this.volumetricLightPostProcess) {
                this.volumetricLightPostProcess.dispose(camera);
            }
            if (this.volumetricLightSmoothXPostProcess) {
                this.volumetricLightSmoothXPostProcess.dispose(camera);
            }
            if (this.volumetricLightSmoothYPostProcess) {
                this.volumetricLightSmoothYPostProcess.dispose(camera);
            }
            if (this.volumetricLightMergePostProces) {
                this.volumetricLightMergePostProces.dispose(camera);
            }
            if (this.volumetricLightFinalPostProcess) {
                this.volumetricLightFinalPostProcess.dispose(camera);
            }
            if (this.lensFlarePostProcess) {
                this.lensFlarePostProcess.dispose(camera);
            }
            if (this.lensFlareComposePostProcess) {
                this.lensFlareComposePostProcess.dispose(camera);
            }
            for (let j = 0; j < this.luminanceDownSamplePostProcesses.length; j++) {
                this.luminanceDownSamplePostProcesses[j].dispose(camera);
            }
            if (this.luminancePostProcess) {
                this.luminancePostProcess.dispose(camera);
            }
            if (this.hdrPostProcess) {
                this.hdrPostProcess.dispose(camera);
            }
            if (this.hdrFinalPostProcess) {
                this.hdrFinalPostProcess.dispose(camera);
            }
            if (this.depthOfFieldPostProcess) {
                this.depthOfFieldPostProcess.dispose(camera);
            }
            if (this.motionBlurPostProcess) {
                this.motionBlurPostProcess.dispose(camera);
            }
            if (this.fxaaPostProcess) {
                this.fxaaPostProcess.dispose(camera);
            }
            for (let j = 0; j < this.blurHPostProcesses.length; j++) {
                this.blurHPostProcesses[j].dispose(camera);
            }
            for (let j = 0; j < this.blurVPostProcesses.length; j++) {
                this.blurVPostProcesses[j].dispose(camera);
            }
        }
        this.originalPostProcess = null;
        this.downSampleX4PostProcess = null;
        this.brightPassPostProcess = null;
        this.textureAdderPostProcess = null;
        this.textureAdderFinalPostProcess = null;
        this.volumetricLightPostProcess = null;
        this.volumetricLightSmoothXPostProcess = null;
        this.volumetricLightSmoothYPostProcess = null;
        this.volumetricLightMergePostProces = null;
        this.volumetricLightFinalPostProcess = null;
        this.lensFlarePostProcess = null;
        this.lensFlareComposePostProcess = null;
        this.luminancePostProcess = null;
        this.hdrPostProcess = null;
        this.hdrFinalPostProcess = null;
        this.depthOfFieldPostProcess = null;
        this.motionBlurPostProcess = null;
        this.fxaaPostProcess = null;
        this.screenSpaceReflectionPostProcess = null;
        this.luminanceDownSamplePostProcesses.length = 0;
        this.blurHPostProcesses.length = 0;
        this.blurVPostProcesses.length = 0;
    }
    /**
     * Dispose of the pipeline and stop all post processes
     */
    dispose() {
        this._disposePostProcesses();
        this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
        super.dispose();
    }
    /**
     * Serialize the rendering pipeline (Used when exporting)
     * @returns the serialized object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        if (this.sourceLight) {
            serializationObject.sourceLightId = this.sourceLight.id;
        }
        if (this.screenSpaceReflectionPostProcess) {
            serializationObject.screenSpaceReflectionPostProcess = decorators_serialization/* SerializationHelper */.p.Serialize(this.screenSpaceReflectionPostProcess);
        }
        serializationObject.customType = "StandardRenderingPipeline";
        return serializationObject;
    }
    /**
     * Parse the serialized pipeline
     * @param source Source pipeline.
     * @param scene The scene to load the pipeline to.
     * @param rootUrl The URL of the serialized pipeline.
     * @returns An instantiated pipeline from the serialized object.
     */
    static Parse(source, scene, rootUrl) {
        const p = decorators_serialization/* SerializationHelper */.p.Parse(() => new StandardRenderingPipeline(source._name, scene, source._ratio), source, scene, rootUrl);
        if (source.sourceLightId) {
            p.sourceLight = scene.getLightById(source.sourceLightId);
        }
        if (source.screenSpaceReflectionPostProcess) {
            decorators_serialization/* SerializationHelper */.p.Parse(() => p.screenSpaceReflectionPostProcess, source.screenSpaceReflectionPostProcess, scene, rootUrl);
        }
        return p;
    }
}
/**
 * Luminance steps
 */
StandardRenderingPipeline.LuminanceSteps = 6;
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "brightThreshold", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "blurWidth", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "horizontalBlur", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "exposure", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)("lensTexture")
], StandardRenderingPipeline.prototype, "lensTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "volumetricLightCoefficient", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "volumetricLightPower", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "volumetricLightBlurScale", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "hdrMinimumLuminance", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "hdrDecreaseRate", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "hdrIncreaseRate", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "hdrAutoExposure", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)("lensColorTexture")
], StandardRenderingPipeline.prototype, "lensColorTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "lensFlareStrength", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "lensFlareGhostDispersal", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "lensFlareHaloWidth", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "lensFlareDistortionStrength", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "lensFlareBlurWidth", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)("lensStarTexture")
], StandardRenderingPipeline.prototype, "lensStarTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsTexture */.uM)("lensFlareDirtTexture")
], StandardRenderingPipeline.prototype, "lensFlareDirtTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "depthOfFieldDistance", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "depthOfFieldBlurWidth", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "motionStrength", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "objectBasedMotionBlur", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "_ratio", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "BloomEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "DepthOfFieldEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "LensFlareEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "HDREnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
    // eslint-disable-next-line @typescript-eslint/naming-convention
], StandardRenderingPipeline.prototype, "VLSEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "MotionBlurEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "fxaaEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "screenSpaceReflectionsEnabled", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "volumetricLightStepsCount", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "motionBlurSamples", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], StandardRenderingPipeline.prototype, "samples", null);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.StandardRenderingPipeline", StandardRenderingPipeline);
//# sourceMappingURL=standardRenderingPipeline.js.map
;// ./node_modules/@babylonjs/core/Rendering/screenSpaceReflections2Configuration.js

/**
 * Contains all parameters needed for the prepass to perform
 * screen space reflections
 */
class ScreenSpaceReflections2Configuration {
    /**
     * @param useScreenspaceDepth If the effect should use the screenspace depth texture instead of a linear one
     */
    constructor(useScreenspaceDepth = false) {
        /**
         * Is ssr enabled
         */
        this.enabled = false;
        /**
         * Name of the configuration
         */
        this.name = "screenSpaceReflections2";
        /**
         * Textures that should be present in the MRT for this effect to work
         */
        this.texturesRequired = [6, 3];
        this.texturesRequired.push(useScreenspaceDepth ? 10 : 5);
    }
}
//# sourceMappingURL=screenSpaceReflections2Configuration.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js

/* eslint-disable @typescript-eslint/naming-convention */












const trs = math_vector/* Matrix */.uq.Compose(new math_vector/* Vector3 */.Pq(0.5, 0.5, 0.5), math_vector/* Quaternion */.PT.Identity(), new math_vector/* Vector3 */.Pq(0.5, 0.5, 0.5));
const trsWebGPU = math_vector/* Matrix */.uq.Compose(new math_vector/* Vector3 */.Pq(0.5, 0.5, 1), math_vector/* Quaternion */.PT.Identity(), new math_vector/* Vector3 */.Pq(0.5, 0.5, 0));
/**
 * Render pipeline to produce Screen Space Reflections (SSR) effect
 *
 * References:
 *   Screen Space Ray Tracing:
 *     - http://casual-effects.blogspot.com/2014/08/screen-space-ray-tracing.html
 *     - https://sourceforge.net/p/g3d/code/HEAD/tree/G3D10/data-files/shader/screenSpaceRayTrace.glsl
 *     - https://github.com/kode80/kode80SSR
 *   SSR:
 *     - general tips: https://sakibsaikia.github.io/graphics/2016/12/26/Screen-Space-Reflection-in-Killing-Floor-2.html
 *     - computation of blur radius from roughness and distance: https://github.com/godotengine/godot/blob/master/servers/rendering/renderer_rd/shaders/effects/screen_space_reflection.glsl
 *     - blur and usage of back depth buffer: https://github.com/kode80/kode80SSR
 */
class SSRRenderingPipeline extends PostProcessRenderPipeline {
    /**
     * MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)
     */
    set samples(sampleCount) {
        if (this._samples === sampleCount) {
            return;
        }
        this._samples = sampleCount;
        this._buildPipeline();
    }
    get samples() {
        return this._samples;
    }
    /**
     * Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR (default: 0.04).
     * If all r/g/b components of the reflectivity is below or equal this value, the pixel will not be considered reflective and SSR won't be applied.
     */
    get reflectivityThreshold() {
        return this._reflectivityThreshold;
    }
    set reflectivityThreshold(threshold) {
        if (threshold === this._reflectivityThreshold) {
            return;
        }
        if ((threshold === 0 && this._reflectivityThreshold !== 0) || (threshold !== 0 && this._reflectivityThreshold === 0)) {
            this._reflectivityThreshold = threshold;
            this._buildPipeline();
        }
        else {
            this._reflectivityThreshold = threshold;
        }
    }
    /**
     * Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution (default: 0).
     * Use 0 to render the SSR contribution at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
     * Note that it is used only when blurring is enabled (blurDispersionStrength \> 0), because in that mode the SSR contribution is generated in a separate texture.
     */
    get ssrDownsample() {
        return this._ssrDownsample;
    }
    set ssrDownsample(downsample) {
        if (downsample === this._ssrDownsample) {
            return;
        }
        this._ssrDownsample = downsample;
        this._buildPipeline();
    }
    /**
     * Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.05)
     * The reflections are blurred based on the roughness of the surface and the distance between the pixel shaded and the reflected pixel: the higher the distance the more blurry the reflection is.
     * blurDispersionStrength allows to increase or decrease this effect.
     */
    get blurDispersionStrength() {
        return this._blurDispersionStrength;
    }
    set blurDispersionStrength(strength) {
        if (strength === this._blurDispersionStrength) {
            return;
        }
        const rebuild = (strength === 0 && this._blurDispersionStrength !== 0) || (strength !== 0 && this._blurDispersionStrength === 0);
        this._blurDispersionStrength = strength;
        if (rebuild) {
            this._buildPipeline();
        }
    }
    _useBlur() {
        return this._blurDispersionStrength > 0;
    }
    /**
     * Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect (default: 0).
     * Use 0 to blur at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.
     */
    get blurDownsample() {
        return this._blurDownsample;
    }
    set blurDownsample(downsample) {
        if (downsample === this._blurDownsample) {
            return;
        }
        this._blurDownsample = downsample;
        this._buildPipeline();
    }
    /**
     * Gets or sets whether or not smoothing reflections is enabled (default: false)
     * Enabling smoothing will require more GPU power.
     * Note that this setting has no effect if step = 1: it's only used if step \> 1.
     */
    get enableSmoothReflections() {
        return this._enableSmoothReflections;
    }
    set enableSmoothReflections(enabled) {
        if (enabled === this._enableSmoothReflections) {
            return;
        }
        this._enableSmoothReflections = enabled;
        this._updateEffectDefines();
    }
    /**
     * Gets or sets the environment cube texture used to define the reflection when the reflected rays of SSR leave the view space or when the maxDistance/maxSteps is reached.
     */
    get environmentTexture() {
        return this._environmentTexture;
    }
    set environmentTexture(texture) {
        this._environmentTexture = texture;
        this._updateEffectDefines();
    }
    /**
     * Gets or sets the boolean defining if the environment texture is a standard cubemap (false) or a probe (true). Default value is false.
     * Note: a probe cube texture is treated differently than an ordinary cube texture because the Y axis is reversed.
     */
    get environmentTextureIsProbe() {
        return this._environmentTextureIsProbe;
    }
    set environmentTextureIsProbe(isProbe) {
        this._environmentTextureIsProbe = isProbe;
        this._updateEffectDefines();
    }
    /**
     * Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders (default: true).
     */
    get attenuateScreenBorders() {
        return this._attenuateScreenBorders;
    }
    set attenuateScreenBorders(attenuate) {
        if (this._attenuateScreenBorders === attenuate) {
            return;
        }
        this._attenuateScreenBorders = attenuate;
        this._updateEffectDefines();
    }
    /**
     * Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection (default: true).
     */
    get attenuateIntersectionDistance() {
        return this._attenuateIntersectionDistance;
    }
    set attenuateIntersectionDistance(attenuate) {
        if (this._attenuateIntersectionDistance === attenuate) {
            return;
        }
        this._attenuateIntersectionDistance = attenuate;
        this._updateEffectDefines();
    }
    /**
     * Gets or sets a boolean indicating if the reflections should be attenuated according to the number of iterations performed to find the intersection (default: true).
     */
    get attenuateIntersectionIterations() {
        return this._attenuateIntersectionIterations;
    }
    set attenuateIntersectionIterations(attenuate) {
        if (this._attenuateIntersectionIterations === attenuate) {
            return;
        }
        this._attenuateIntersectionIterations = attenuate;
        this._updateEffectDefines();
    }
    /**
     * Gets or sets a boolean indicating if the reflections should be attenuated when the reflection ray is facing the camera (the view direction) (default: false).
     */
    get attenuateFacingCamera() {
        return this._attenuateFacingCamera;
    }
    set attenuateFacingCamera(attenuate) {
        if (this._attenuateFacingCamera === attenuate) {
            return;
        }
        this._attenuateFacingCamera = attenuate;
        this._updateEffectDefines();
    }
    /**
     * Gets or sets a boolean indicating if the backface reflections should be attenuated (default: false).
     */
    get attenuateBackfaceReflection() {
        return this._attenuateBackfaceReflection;
    }
    set attenuateBackfaceReflection(attenuate) {
        if (this._attenuateBackfaceReflection === attenuate) {
            return;
        }
        this._attenuateBackfaceReflection = attenuate;
        this._updateEffectDefines();
    }
    /**
     * Gets or sets a boolean indicating if the ray should be clipped to the frustum (default: true).
     * You can try to set this parameter to false to save some performances: it may produce some artefacts in some cases, but generally they won't really be visible
     */
    get clipToFrustum() {
        return this._clipToFrustum;
    }
    set clipToFrustum(clip) {
        if (this._clipToFrustum === clip) {
            return;
        }
        this._clipToFrustum = clip;
        this._updateEffectDefines();
    }
    /**
     * Gets or sets a boolean indicating whether the blending between the current color pixel and the reflection color should be done with a Fresnel coefficient (default: false).
     * It is more physically accurate to use the Fresnel coefficient (otherwise it uses the reflectivity of the material for blending), but it is also more expensive when you use blur (when blurDispersionStrength \> 0).
     */
    get useFresnel() {
        return this._useFresnel;
    }
    set useFresnel(fresnel) {
        if (this._useFresnel === fresnel) {
            return;
        }
        this._useFresnel = fresnel;
        this._buildPipeline();
    }
    /**
     * Gets or sets a boolean defining if geometry thickness should be computed automatically (default: false).
     * When enabled, a depth renderer is created which will render the back faces of the scene to a depth texture (meaning additional work for the GPU).
     * In that mode, the "thickness" property is still used as an offset to compute the ray intersection, but you can typically use a much lower
     * value than when enableAutomaticThicknessComputation is false (it's even possible to use a value of 0 when using low values for "step")
     * Note that for performance reasons, this option will only apply to the first camera to which the rendering pipeline is attached!
     */
    get enableAutomaticThicknessComputation() {
        return this._enableAutomaticThicknessComputation;
    }
    set enableAutomaticThicknessComputation(automatic) {
        if (this._enableAutomaticThicknessComputation === automatic) {
            return;
        }
        this._enableAutomaticThicknessComputation = automatic;
        this._buildPipeline();
    }
    /**
     * Gets the depth renderer used to render the back faces of the scene to a depth texture.
     */
    get backfaceDepthRenderer() {
        return this._depthRenderer;
    }
    /**
     * Gets or sets the downsample factor (default: 0) used to create the backface depth texture - used only if enableAutomaticThicknessComputation = true.
     * Use 0 to render the depth at full resolution, 1 to render at half resolution, 2 to render at 1/4 resolution, etc.
     * Note that you will get rendering artefacts when using a value different from 0: it's a tradeoff between image quality and performances.
     */
    get backfaceDepthTextureDownsample() {
        return this._backfaceDepthTextureDownsample;
    }
    set backfaceDepthTextureDownsample(factor) {
        if (this._backfaceDepthTextureDownsample === factor) {
            return;
        }
        this._backfaceDepthTextureDownsample = factor;
        this._resizeDepthRenderer();
    }
    /**
     * Gets or sets a boolean (default: true) indicating if the depth of transparent meshes should be written to the backface depth texture (when automatic thickness computation is enabled).
     */
    get backfaceForceDepthWriteTransparentMeshes() {
        return this._backfaceForceDepthWriteTransparentMeshes;
    }
    set backfaceForceDepthWriteTransparentMeshes(force) {
        if (this._backfaceForceDepthWriteTransparentMeshes === force) {
            return;
        }
        this._backfaceForceDepthWriteTransparentMeshes = force;
        if (this._depthRenderer) {
            this._depthRenderer.forceDepthWriteTransparentMeshes = force;
        }
    }
    /**
     * Gets or sets a boolean indicating if the effect is enabled (default: true).
     */
    get isEnabled() {
        return this._isEnabled;
    }
    set isEnabled(value) {
        if (this._isEnabled === value) {
            return;
        }
        this._isEnabled = value;
        if (!value) {
            if (this._cameras !== null) {
                this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
                this._cameras = this._camerasToBeAttached.slice();
            }
        }
        else if (value) {
            if (!this._isDirty) {
                if (this._cameras !== null) {
                    this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
                }
            }
            else {
                this._buildPipeline();
            }
        }
    }
    /**
     * Gets or sets a boolean defining if the input color texture is in gamma space (default: true)
     * The SSR effect works in linear space, so if the input texture is in gamma space, we must convert the texture to linear space before applying the effect
     */
    get inputTextureColorIsInGammaSpace() {
        return this._inputTextureColorIsInGammaSpace;
    }
    set inputTextureColorIsInGammaSpace(gammaSpace) {
        if (this._inputTextureColorIsInGammaSpace === gammaSpace) {
            return;
        }
        this._inputTextureColorIsInGammaSpace = gammaSpace;
        this._buildPipeline();
    }
    /**
     * Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space (default: true)
     * If you have a post-process that comes after the SSR and that post-process needs the input to be in a linear space, you must disable generateOutputInGammaSpace
     */
    get generateOutputInGammaSpace() {
        return this._generateOutputInGammaSpace;
    }
    set generateOutputInGammaSpace(gammaSpace) {
        if (this._generateOutputInGammaSpace === gammaSpace) {
            return;
        }
        this._generateOutputInGammaSpace = gammaSpace;
        this._buildPipeline();
    }
    /**
     * Gets or sets a boolean indicating if the effect should be rendered in debug mode (default: false).
     * In this mode, colors have this meaning:
     *   - blue: the ray hit the max distance (we reached maxDistance)
     *   - red: the ray ran out of steps (we reached maxSteps)
     *   - yellow: the ray went off screen
     *   - green: the ray hit a surface. The brightness of the green color is proportional to the distance between the ray origin and the intersection point: A brighter green means more computation than a darker green.
     * In the first 3 cases, the final color is calculated by mixing the skybox color with the pixel color (if environmentTexture is defined), otherwise the pixel color is not modified
     * You should try to get as few blue/red/yellow pixels as possible, as this means that the ray has gone further than if it had hit a surface.
     */
    get debug() {
        return this._debug;
    }
    set debug(value) {
        if (this._debug === value) {
            return;
        }
        this._debug = value;
        this._buildPipeline();
    }
    /**
     * Gets the scene the effect belongs to.
     * @returns the scene the effect belongs to.
     */
    getScene() {
        return this._scene;
    }
    get _geometryBufferRenderer() {
        if (!this._forceGeometryBuffer) {
            return null;
        }
        return this._scene.geometryBufferRenderer;
    }
    get _prePassRenderer() {
        if (this._forceGeometryBuffer) {
            return null;
        }
        return this._scene.prePassRenderer;
    }
    /**
     * Gets active scene
     */
    get scene() {
        return this._scene;
    }
    /**
     * Returns true if SSR is supported by the running hardware
     */
    get isSupported() {
        const caps = this._scene.getEngine().getCaps();
        return caps.drawBuffersExtension && caps.texelFetch;
    }
    /**
     * Constructor of the SSR rendering pipeline
     * @param name The rendering pipeline name
     * @param scene The scene linked to this pipeline
     * @param cameras The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)
     * @param forceGeometryBuffer Set to true if you want to use the legacy geometry buffer renderer (default: false)
     * @param textureType The texture type used by the different post processes created by SSR (default: 0)
     * @param useScreenspaceDepth Indicates if the depth buffer should be linear or screenspace (default: false). This allows sharing the buffer with other effect pipelines that may require the depth to be in screenspace.
     */
    constructor(name, scene, cameras, forceGeometryBuffer = false, textureType = 0, useScreenspaceDepth = false) {
        super(scene.getEngine(), name);
        /**
         * The SSR PostProcess effect id in the pipeline
         */
        this.SSRRenderEffect = "SSRRenderEffect";
        /**
         * The blur PostProcess effect id in the pipeline
         */
        this.SSRBlurRenderEffect = "SSRBlurRenderEffect";
        /**
         * The PostProcess effect id in the pipeline that combines the SSR-Blur output with the original scene color
         */
        this.SSRCombineRenderEffect = "SSRCombineRenderEffect";
        this._samples = 1;
        /**
         * Gets or sets the maxDistance used to define how far we look for reflection during the ray-marching on the reflected ray (default: 1000).
         * Note that this value is a view (camera) space distance (not pixels!).
         */
        this.maxDistance = 1000.0;
        /**
         * Gets or sets the step size used to iterate until the effect finds the color of the reflection's pixel. Should be an integer \>= 1 as it is the number of pixels we advance at each step (default: 1).
         * Use higher values to improve performances (but at the expense of quality).
         */
        this.step = 1.0;
        /**
         * Gets or sets the thickness value used as tolerance when computing the intersection between the reflected ray and the scene (default: 0.5).
         * If setting "enableAutomaticThicknessComputation" to true, you can use lower values for "thickness" (even 0), as the geometry thickness
         * is automatically computed thank to the regular depth buffer + the backface depth buffer
         */
        this.thickness = 0.5;
        /**
         * Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results (default: 1).
         */
        this.strength = 1;
        /**
         * Gets or sets the falloff exponent used to compute the reflection strength. Higher values lead to fainter reflections (default: 1).
         */
        this.reflectionSpecularFalloffExponent = 1;
        /**
         * Maximum number of steps during the ray marching process after which we consider an intersection could not be found (default: 1000).
         * Should be an integer value.
         */
        this.maxSteps = 1000.0;
        /**
         * Gets or sets the factor applied when computing roughness. Default value is 0.2.
         * When blurring based on roughness is enabled (meaning blurDispersionStrength \> 0), roughnessFactor is used as a global roughness factor applied on all objects.
         * If you want to disable this global roughness set it to 0.
         */
        this.roughnessFactor = 0.2;
        /**
         * Number of steps to skip at start when marching the ray to avoid self collisions (default: 1)
         * 1 should normally be a good value, depending on the scene you may need to use a higher value (2 or 3)
         */
        this.selfCollisionNumSkip = 1;
        this._reflectivityThreshold = 0.04;
        this._ssrDownsample = 0;
        this._blurDispersionStrength = 0.03;
        this._blurDownsample = 0;
        this._enableSmoothReflections = false;
        this._useScreenspaceDepth = false;
        this._environmentTextureIsProbe = false;
        this._attenuateScreenBorders = true;
        this._attenuateIntersectionDistance = true;
        this._attenuateIntersectionIterations = true;
        this._attenuateFacingCamera = false;
        this._attenuateBackfaceReflection = false;
        this._clipToFrustum = true;
        this._useFresnel = false;
        this._enableAutomaticThicknessComputation = false;
        this._backfaceDepthTextureDownsample = 0;
        this._backfaceForceDepthWriteTransparentMeshes = true;
        this._isEnabled = true;
        this._inputTextureColorIsInGammaSpace = true;
        this._generateOutputInGammaSpace = true;
        this._debug = false;
        this._forceGeometryBuffer = false;
        this._isDirty = false;
        this._camerasToBeAttached = [];
        this._cameras = cameras || scene.cameras;
        this._cameras = this._cameras.slice();
        this._camerasToBeAttached = this._cameras.slice();
        this._scene = scene;
        this._textureType = textureType;
        this._forceGeometryBuffer = forceGeometryBuffer;
        this._useScreenspaceDepth = useScreenspaceDepth;
        if (this.isSupported) {
            scene.postProcessRenderPipelineManager.addPipeline(this);
            if (this._forceGeometryBuffer) {
                const geometryBufferRenderer = scene.enableGeometryBufferRenderer();
                if (geometryBufferRenderer) {
                    geometryBufferRenderer.enableReflectivity = true;
                    geometryBufferRenderer.useSpecificClearForDepthTexture = true;
                    geometryBufferRenderer.enableScreenspaceDepth = this._useScreenspaceDepth;
                    geometryBufferRenderer.enableDepth = !this._useScreenspaceDepth;
                }
            }
            else {
                const prePassRenderer = scene.enablePrePassRenderer();
                if (prePassRenderer) {
                    prePassRenderer.useSpecificClearForDepthTexture = true;
                    prePassRenderer.markAsDirty();
                }
            }
            this._buildPipeline();
        }
    }
    /**
     * Get the class name
     * @returns "SSRRenderingPipeline"
     */
    getClassName() {
        return "SSRRenderingPipeline";
    }
    /**
     * Adds a camera to the pipeline
     * @param camera the camera to be added
     */
    addCamera(camera) {
        this._camerasToBeAttached.push(camera);
        this._buildPipeline();
    }
    /**
     * Removes a camera from the pipeline
     * @param camera the camera to remove
     */
    removeCamera(camera) {
        const index = this._camerasToBeAttached.indexOf(camera);
        this._camerasToBeAttached.splice(index, 1);
        this._buildPipeline();
    }
    /**
     * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
     * @param disableGeometryBufferRenderer if the geometry buffer renderer should be disabled
     */
    dispose(disableGeometryBufferRenderer = false) {
        this._disposeDepthRenderer();
        this._disposePostProcesses();
        if (disableGeometryBufferRenderer) {
            this._scene.disableGeometryBufferRenderer();
        }
        this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
        super.dispose();
    }
    _getTextureSize() {
        const engine = this._scene.getEngine();
        const prePassRenderer = this._prePassRenderer;
        let textureSize = { width: engine.getRenderWidth(), height: engine.getRenderHeight() };
        if (prePassRenderer && this._scene.activeCamera?._getFirstPostProcess() === this._ssrPostProcess) {
            const renderTarget = prePassRenderer.getRenderTarget();
            if (renderTarget && renderTarget.textures) {
                textureSize = renderTarget.textures[prePassRenderer.getIndex(4)].getSize();
            }
        }
        else if (this._ssrPostProcess?.inputTexture) {
            textureSize.width = this._ssrPostProcess.inputTexture.width;
            textureSize.height = this._ssrPostProcess.inputTexture.height;
        }
        return textureSize;
    }
    _updateEffectDefines() {
        const defines = [];
        if (this._geometryBufferRenderer || this._prePassRenderer) {
            defines.push("#define SSR_SUPPORTED");
        }
        if (this._enableSmoothReflections) {
            defines.push("#define SSRAYTRACE_ENABLE_REFINEMENT");
        }
        if (this._scene.useRightHandedSystem) {
            defines.push("#define SSRAYTRACE_RIGHT_HANDED_SCENE");
        }
        if (this._useScreenspaceDepth) {
            defines.push("#define SSRAYTRACE_SCREENSPACE_DEPTH");
        }
        if (this._environmentTexture) {
            defines.push("#define SSR_USE_ENVIRONMENT_CUBE");
            if (this._environmentTexture.boundingBoxSize) {
                defines.push("#define SSR_USE_LOCAL_REFLECTIONMAP_CUBIC");
            }
            if (this._environmentTexture.gammaSpace) {
                defines.push("#define SSR_ENVIRONMENT_CUBE_IS_GAMMASPACE");
            }
        }
        if (this._environmentTextureIsProbe) {
            defines.push("#define SSR_INVERTCUBICMAP");
        }
        if (this._enableAutomaticThicknessComputation) {
            defines.push("#define SSRAYTRACE_USE_BACK_DEPTHBUFFER");
        }
        if (this._attenuateScreenBorders) {
            defines.push("#define SSR_ATTENUATE_SCREEN_BORDERS");
        }
        if (this._attenuateIntersectionDistance) {
            defines.push("#define SSR_ATTENUATE_INTERSECTION_DISTANCE");
        }
        if (this._attenuateIntersectionIterations) {
            defines.push("#define SSR_ATTENUATE_INTERSECTION_NUMITERATIONS");
        }
        if (this._attenuateFacingCamera) {
            defines.push("#define SSR_ATTENUATE_FACING_CAMERA");
        }
        if (this._attenuateBackfaceReflection) {
            defines.push("#define SSR_ATTENUATE_BACKFACE_REFLECTION");
        }
        if (this._clipToFrustum) {
            defines.push("#define SSRAYTRACE_CLIP_TO_FRUSTUM");
        }
        if (this._useBlur()) {
            defines.push("#define SSR_USE_BLUR");
        }
        if (this._debug) {
            defines.push("#define SSRAYTRACE_DEBUG");
        }
        if (this._inputTextureColorIsInGammaSpace) {
            defines.push("#define SSR_INPUT_IS_GAMMA_SPACE");
        }
        if (this._generateOutputInGammaSpace) {
            defines.push("#define SSR_OUTPUT_IS_GAMMA_SPACE");
        }
        if (this._useFresnel) {
            defines.push("#define SSR_BLEND_WITH_FRESNEL");
        }
        if (this._reflectivityThreshold === 0) {
            defines.push("#define SSR_DISABLE_REFLECTIVITY_TEST");
        }
        if (this._geometryBufferRenderer?.generateNormalsInWorldSpace ?? this._prePassRenderer?.generateNormalsInWorldSpace) {
            defines.push("#define SSR_NORMAL_IS_IN_WORLDSPACE");
        }
        if (this._geometryBufferRenderer?.normalsAreUnsigned) {
            defines.push("#define SSR_DECODE_NORMAL");
        }
        const camera = this._cameras?.[0];
        if (camera && camera.mode === 1) {
            defines.push("#define ORTHOGRAPHIC_CAMERA");
        }
        this._ssrPostProcess?.updateEffect(defines.join("\n"));
    }
    _buildPipeline() {
        if (!this.isSupported) {
            return;
        }
        if (!this._isEnabled) {
            this._isDirty = true;
            return;
        }
        this._isDirty = false;
        const engine = this._scene.getEngine();
        this._disposeDepthRenderer();
        this._disposePostProcesses();
        if (this._cameras !== null) {
            this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
            // get back cameras to be used to reattach pipeline
            this._cameras = this._camerasToBeAttached.slice();
        }
        this._reset();
        if (this._enableAutomaticThicknessComputation) {
            const camera = this._cameras?.[0];
            if (camera) {
                this._depthRendererCamera = camera;
                this._depthRenderer = new DepthRenderer(this._scene, undefined, undefined, this._useScreenspaceDepth, 1, !this._useScreenspaceDepth, "SSRBackDepth");
                if (!this._useScreenspaceDepth) {
                    this._depthRenderer.clearColor.r = 1e8; // "infinity": put a big value because we use the storeCameraSpaceZ mode
                }
                this._depthRenderer.reverseCulling = true; // we generate depth for the back faces
                this._depthRenderer.forceDepthWriteTransparentMeshes = this._backfaceForceDepthWriteTransparentMeshes;
                this._resizeDepthRenderer();
                camera.customRenderTargets.push(this._depthRenderer.getDepthMap());
            }
        }
        this._createSSRPostProcess();
        this.addEffect(new PostProcessRenderEffect(engine, this.SSRRenderEffect, () => {
            return this._ssrPostProcess;
        }, true));
        if (this._useBlur()) {
            this._createBlurAndCombinerPostProcesses();
            this.addEffect(new PostProcessRenderEffect(engine, this.SSRBlurRenderEffect, () => {
                return [this._blurPostProcessX, this._blurPostProcessY];
            }, true));
            this.addEffect(new PostProcessRenderEffect(engine, this.SSRCombineRenderEffect, () => {
                return this._blurCombinerPostProcess;
            }, true));
        }
        if (this._cameras !== null) {
            this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
        }
    }
    _resizeDepthRenderer() {
        if (!this._depthRenderer) {
            return;
        }
        const textureSize = this._getTextureSize();
        const depthRendererSize = this._depthRenderer.getDepthMap().getSize();
        const width = Math.floor(textureSize.width / (this._backfaceDepthTextureDownsample + 1));
        const height = Math.floor(textureSize.height / (this._backfaceDepthTextureDownsample + 1));
        if (depthRendererSize.width !== width || depthRendererSize.height !== height) {
            this._depthRenderer.getDepthMap().resize({ width, height });
        }
    }
    _disposeDepthRenderer() {
        if (this._depthRenderer) {
            if (this._depthRendererCamera) {
                const idx = this._depthRendererCamera.customRenderTargets.indexOf(this._depthRenderer.getDepthMap()) ?? -1;
                if (idx !== -1) {
                    this._depthRendererCamera.customRenderTargets.splice(idx, 1);
                }
            }
            this._depthRendererCamera = null;
            this._depthRenderer.getDepthMap().dispose();
        }
        this._depthRenderer = null;
    }
    _disposePostProcesses() {
        for (let i = 0; i < this._cameras.length; i++) {
            const camera = this._cameras[i];
            this._ssrPostProcess?.dispose(camera);
            this._blurPostProcessX?.dispose(camera);
            this._blurPostProcessY?.dispose(camera);
            this._blurCombinerPostProcess?.dispose(camera);
        }
        this._ssrPostProcess = null;
        this._blurPostProcessX = null;
        this._blurPostProcessY = null;
        this._blurCombinerPostProcess = null;
    }
    _createSSRPostProcess() {
        this._ssrPostProcess = new PostProcesses_postProcess/* PostProcess */.w("ssr", "screenSpaceReflection2", [
            "projection",
            "invProjectionMatrix",
            "view",
            "invView",
            "thickness",
            "reflectionSpecularFalloffExponent",
            "strength",
            "stepSize",
            "maxSteps",
            "roughnessFactor",
            "projectionPixel",
            "nearPlaneZ",
            "farPlaneZ",
            "maxDistance",
            "selfCollisionNumSkip",
            "vReflectionPosition",
            "vReflectionSize",
            "backSizeFactor",
            "reflectivityThreshold",
        ], ["textureSampler", "normalSampler", "reflectivitySampler", "depthSampler", "envCubeSampler", "backDepthSampler"], 1.0, null, this._textureType, this._scene.getEngine(), false, "", this._textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {
            if (useWebGPU) {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85423)));
            }
            else {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 94354)));
            }
        });
        this._updateEffectDefines();
        this._ssrPostProcess.onApply = (effect) => {
            this._resizeDepthRenderer();
            const geometryBufferRenderer = this._geometryBufferRenderer;
            const prePassRenderer = this._prePassRenderer;
            if (!prePassRenderer && !geometryBufferRenderer) {
                return;
            }
            if (geometryBufferRenderer) {
                const roughnessIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE);
                const normalIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE);
                effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[normalIndex]);
                effect.setTexture("reflectivitySampler", geometryBufferRenderer.getGBuffer().textures[roughnessIndex]);
                if (this._useScreenspaceDepth) {
                    const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);
                    effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
                }
                else {
                    const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE);
                    effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
                }
            }
            else if (prePassRenderer) {
                const depthIndex = prePassRenderer.getIndex(this._useScreenspaceDepth ? 10 : 5);
                const roughnessIndex = prePassRenderer.getIndex(3);
                const normalIndex = prePassRenderer.getIndex(6);
                effect.setTexture("normalSampler", prePassRenderer.getRenderTarget().textures[normalIndex]);
                effect.setTexture("depthSampler", prePassRenderer.getRenderTarget().textures[depthIndex]);
                effect.setTexture("reflectivitySampler", prePassRenderer.getRenderTarget().textures[roughnessIndex]);
            }
            if (this._enableAutomaticThicknessComputation && this._depthRenderer) {
                effect.setTexture("backDepthSampler", this._depthRenderer.getDepthMap());
                effect.setFloat("backSizeFactor", this._backfaceDepthTextureDownsample + 1);
            }
            const camera = this._scene.activeCamera;
            if (!camera) {
                return;
            }
            const viewMatrix = camera.getViewMatrix();
            const projectionMatrix = camera.getProjectionMatrix();
            projectionMatrix.invertToRef(math_vector/* TmpVectors */.AA.Matrix[0]);
            viewMatrix.invertToRef(math_vector/* TmpVectors */.AA.Matrix[1]);
            effect.setMatrix("projection", projectionMatrix);
            effect.setMatrix("view", viewMatrix);
            effect.setMatrix("invView", math_vector/* TmpVectors */.AA.Matrix[1]);
            effect.setMatrix("invProjectionMatrix", math_vector/* TmpVectors */.AA.Matrix[0]);
            effect.setFloat("thickness", this.thickness);
            effect.setFloat("reflectionSpecularFalloffExponent", this.reflectionSpecularFalloffExponent);
            effect.setFloat("strength", this.strength);
            effect.setFloat("stepSize", this.step);
            effect.setFloat("maxSteps", this.maxSteps);
            effect.setFloat("roughnessFactor", this.roughnessFactor);
            effect.setFloat("nearPlaneZ", camera.minZ);
            effect.setFloat("farPlaneZ", camera.maxZ);
            effect.setFloat("maxDistance", this.maxDistance);
            effect.setFloat("selfCollisionNumSkip", this.selfCollisionNumSkip);
            effect.setFloat("reflectivityThreshold", this._reflectivityThreshold);
            const textureSize = this._getTextureSize();
            math_vector/* Matrix */.uq.ScalingToRef(textureSize.width, textureSize.height, 1, math_vector/* TmpVectors */.AA.Matrix[2]);
            projectionMatrix.multiplyToRef(this._scene.getEngine().isWebGPU ? trsWebGPU : trs, math_vector/* TmpVectors */.AA.Matrix[3]);
            math_vector/* TmpVectors */.AA.Matrix[3].multiplyToRef(math_vector/* TmpVectors */.AA.Matrix[2], math_vector/* TmpVectors */.AA.Matrix[4]);
            effect.setMatrix("projectionPixel", math_vector/* TmpVectors */.AA.Matrix[4]);
            if (this._environmentTexture) {
                effect.setTexture("envCubeSampler", this._environmentTexture);
                if (this._environmentTexture.boundingBoxSize) {
                    effect.setVector3("vReflectionPosition", this._environmentTexture.boundingBoxPosition);
                    effect.setVector3("vReflectionSize", this._environmentTexture.boundingBoxSize);
                }
            }
        };
        this._ssrPostProcess.samples = this.samples;
        if (!this._forceGeometryBuffer) {
            this._ssrPostProcess._prePassEffectConfiguration = new ScreenSpaceReflections2Configuration(this._useScreenspaceDepth);
        }
    }
    _createBlurAndCombinerPostProcesses() {
        const engine = this._scene.getEngine();
        this._blurPostProcessX = new PostProcesses_postProcess/* PostProcess */.w("SSRblurX", "screenSpaceReflection2Blur", ["texelOffsetScale"], ["textureSampler"], this._useBlur() ? 1 / (this._ssrDownsample + 1) : 1, null, 2, engine, false, "", this._textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {
            if (useWebGPU) {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 66584)));
            }
            else {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 68133)));
            }
        });
        this._blurPostProcessX.autoClear = false;
        this._blurPostProcessX.onApplyObservable.add((effect) => {
            const width = this._blurPostProcessX?.inputTexture.width ?? this._scene.getEngine().getRenderWidth();
            effect.setFloat2("texelOffsetScale", this._blurDispersionStrength / width, 0);
        });
        this._blurPostProcessY = new PostProcesses_postProcess/* PostProcess */.w("SSRblurY", "screenSpaceReflection2Blur", ["texelOffsetScale"], ["textureSampler"], this._useBlur() ? 1 / (this._blurDownsample + 1) : 1, null, 2, engine, false, "", this._textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {
            if (useWebGPU) {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 66584)));
            }
            else {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 68133)));
            }
        });
        this._blurPostProcessY.autoClear = false;
        this._blurPostProcessY.onApplyObservable.add((effect) => {
            const height = this._blurPostProcessY?.inputTexture.height ?? this._scene.getEngine().getRenderHeight();
            effect.setFloat2("texelOffsetScale", 0, this._blurDispersionStrength / height);
        });
        const uniformNames = ["strength", "reflectionSpecularFalloffExponent", "reflectivityThreshold"];
        const samplerNames = ["textureSampler", "mainSampler", "reflectivitySampler"];
        let defines = "";
        if (this._debug) {
            defines += "#define SSRAYTRACE_DEBUG\n";
        }
        if (this._inputTextureColorIsInGammaSpace) {
            defines += "#define SSR_INPUT_IS_GAMMA_SPACE\n";
        }
        if (this._generateOutputInGammaSpace) {
            defines += "#define SSR_OUTPUT_IS_GAMMA_SPACE\n";
        }
        if (this.useFresnel) {
            defines += "#define SSR_BLEND_WITH_FRESNEL\n";
            uniformNames.push("projection", "invProjectionMatrix", "nearPlaneZ", "farPlaneZ");
            samplerNames.push("depthSampler", "normalSampler");
        }
        if (this._useScreenspaceDepth) {
            defines += "#define SSRAYTRACE_SCREENSPACE_DEPTH";
        }
        if (this._reflectivityThreshold === 0) {
            defines += "#define SSR_DISABLE_REFLECTIVITY_TEST";
        }
        this._blurCombinerPostProcess = new PostProcesses_postProcess/* PostProcess */.w("SSRblurCombiner", "screenSpaceReflection2BlurCombiner", uniformNames, samplerNames, this._useBlur() ? 1 / (this._blurDownsample + 1) : 1, null, 1, engine, false, defines, this._textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {
            if (useWebGPU) {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 44143)));
            }
            else {
                list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 17406)));
            }
        });
        this._blurCombinerPostProcess.autoClear = false;
        this._blurCombinerPostProcess.onApplyObservable.add((effect) => {
            const geometryBufferRenderer = this._geometryBufferRenderer;
            const prePassRenderer = this._prePassRenderer;
            if (!prePassRenderer && !geometryBufferRenderer) {
                return;
            }
            if (prePassRenderer && this._scene.activeCamera?._getFirstPostProcess() === this._ssrPostProcess) {
                const renderTarget = prePassRenderer.getRenderTarget();
                if (renderTarget && renderTarget.textures) {
                    effect.setTexture("mainSampler", renderTarget.textures[prePassRenderer.getIndex(4)]);
                }
            }
            else {
                effect.setTextureFromPostProcess("mainSampler", this._ssrPostProcess);
            }
            if (geometryBufferRenderer) {
                const roughnessIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE);
                effect.setTexture("reflectivitySampler", geometryBufferRenderer.getGBuffer().textures[roughnessIndex]);
                if (this.useFresnel) {
                    const camera = this._scene.activeCamera;
                    if (camera && this._useScreenspaceDepth) {
                        effect.setFloat("nearPlaneZ", camera.minZ);
                        effect.setFloat("farPlaneZ", camera.maxZ);
                    }
                    effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[1]);
                    if (this._useScreenspaceDepth) {
                        const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);
                        effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
                    }
                    else {
                        effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[0]);
                    }
                }
            }
            else if (prePassRenderer) {
                const roughnessIndex = prePassRenderer.getIndex(3);
                effect.setTexture("reflectivitySampler", prePassRenderer.getRenderTarget().textures[roughnessIndex]);
                if (this.useFresnel) {
                    const camera = this._scene.activeCamera;
                    if (camera && this._useScreenspaceDepth) {
                        effect.setFloat("nearPlaneZ", camera.minZ);
                        effect.setFloat("farPlaneZ", camera.maxZ);
                    }
                    const depthIndex = prePassRenderer.getIndex(this._useScreenspaceDepth ? 10 : 5);
                    const normalIndex = prePassRenderer.getIndex(6);
                    effect.setTexture("normalSampler", prePassRenderer.getRenderTarget().textures[normalIndex]);
                    effect.setTexture("depthSampler", prePassRenderer.getRenderTarget().textures[depthIndex]);
                }
            }
            effect.setFloat("strength", this.strength);
            effect.setFloat("reflectionSpecularFalloffExponent", this.reflectionSpecularFalloffExponent);
            effect.setFloat("reflectivityThreshold", this._reflectivityThreshold);
            if (this.useFresnel) {
                const camera = this._scene.activeCamera;
                if (camera) {
                    const projectionMatrix = camera.getProjectionMatrix();
                    projectionMatrix.invertToRef(math_vector/* TmpVectors */.AA.Matrix[0]);
                    effect.setMatrix("projection", projectionMatrix);
                    effect.setMatrix("invProjectionMatrix", math_vector/* TmpVectors */.AA.Matrix[0]);
                }
            }
        });
    }
    /**
     * Serializes the rendering pipeline (Used when exporting)
     * @returns the serialized object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.customType = "SSRRenderingPipeline";
        return serializationObject;
    }
    /**
     * Parse the serialized pipeline
     * @param source Source pipeline.
     * @param scene The scene to load the pipeline to.
     * @param rootUrl The URL of the serialized pipeline.
     * @returns An instantiated pipeline from the serialized object.
     */
    static Parse(source, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => new SSRRenderingPipeline(source._name, scene, source._ratio), source, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "samples", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "maxDistance", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "step", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "thickness", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "strength", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "reflectionSpecularFalloffExponent", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "maxSteps", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "roughnessFactor", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "selfCollisionNumSkip", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "_reflectivityThreshold", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("_ssrDownsample")
], SSRRenderingPipeline.prototype, "_ssrDownsample", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], SSRRenderingPipeline.prototype, "ssrDownsample", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("blurDispersionStrength")
], SSRRenderingPipeline.prototype, "_blurDispersionStrength", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("blurDownsample")
], SSRRenderingPipeline.prototype, "_blurDownsample", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("enableSmoothReflections")
], SSRRenderingPipeline.prototype, "_enableSmoothReflections", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("environmentTexture")
], SSRRenderingPipeline.prototype, "_environmentTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("environmentTextureIsProbe")
], SSRRenderingPipeline.prototype, "_environmentTextureIsProbe", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("attenuateScreenBorders")
], SSRRenderingPipeline.prototype, "_attenuateScreenBorders", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("attenuateIntersectionDistance")
], SSRRenderingPipeline.prototype, "_attenuateIntersectionDistance", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("attenuateIntersectionIterations")
], SSRRenderingPipeline.prototype, "_attenuateIntersectionIterations", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("attenuateFacingCamera")
], SSRRenderingPipeline.prototype, "_attenuateFacingCamera", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("attenuateBackfaceReflection")
], SSRRenderingPipeline.prototype, "_attenuateBackfaceReflection", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("clipToFrustum")
], SSRRenderingPipeline.prototype, "_clipToFrustum", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("useFresnel")
], SSRRenderingPipeline.prototype, "_useFresnel", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("enableAutomaticThicknessComputation")
], SSRRenderingPipeline.prototype, "_enableAutomaticThicknessComputation", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("backfaceDepthTextureDownsample")
], SSRRenderingPipeline.prototype, "_backfaceDepthTextureDownsample", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("backfaceForceDepthWriteTransparentMeshes")
], SSRRenderingPipeline.prototype, "_backfaceForceDepthWriteTransparentMeshes", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("isEnabled")
], SSRRenderingPipeline.prototype, "_isEnabled", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("inputTextureColorIsInGammaSpace")
], SSRRenderingPipeline.prototype, "_inputTextureColorIsInGammaSpace", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("generateOutputInGammaSpace")
], SSRRenderingPipeline.prototype, "_generateOutputInGammaSpace", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("debug")
], SSRRenderingPipeline.prototype, "_debug", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.SSRRenderingPipeline", SSRRenderingPipeline);
//# sourceMappingURL=ssrRenderingPipeline.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js

/* eslint-disable @typescript-eslint/naming-convention */










/**
 * Simple implementation of Temporal Anti-Aliasing (TAA).
 * This can be used to improve image quality for still pictures (screenshots for e.g.).
 */
class TAARenderingPipeline extends PostProcessRenderPipeline {
    /**
     * Number of accumulated samples (default: 16)
     */
    set samples(samples) {
        this._taaThinPostProcess.samples = samples;
    }
    get samples() {
        return this._taaThinPostProcess.samples;
    }
    /**
     * MSAA samples (default: 1)
     */
    set msaaSamples(samples) {
        if (this._msaaSamples === samples) {
            return;
        }
        this._msaaSamples = samples;
        if (this._taaPostProcess) {
            this._taaPostProcess.samples = samples;
        }
    }
    get msaaSamples() {
        return this._msaaSamples;
    }
    /**
     * The factor used to blend the history frame with current frame (default: 0.05)
     */
    get factor() {
        return this._taaThinPostProcess.factor;
    }
    set factor(value) {
        this._taaThinPostProcess.factor = value;
    }
    /**
     * Disable TAA on camera move (default: true).
     * You generally want to keep this enabled, otherwise you will get a ghost effect when the camera moves (but if it's what you want, go for it!)
     */
    get disableOnCameraMove() {
        return this._taaThinPostProcess.disableOnCameraMove;
    }
    set disableOnCameraMove(value) {
        this._taaThinPostProcess.disableOnCameraMove = value;
    }
    /**
     * Gets or sets a boolean indicating if the render pipeline is enabled (default: true).
     */
    get isEnabled() {
        return this._isEnabled;
    }
    set isEnabled(value) {
        if (this._isEnabled === value) {
            return;
        }
        this._isEnabled = value;
        if (!value) {
            if (this._cameras !== null) {
                this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
                this._cameras = this._camerasToBeAttached.slice();
            }
        }
        else if (value) {
            if (!this._isDirty) {
                if (this._cameras !== null) {
                    this._taaThinPostProcess._reset();
                    this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
                }
            }
            else {
                this._buildPipeline();
            }
        }
    }
    /**
     * Gets active scene
     */
    get scene() {
        return this._scene;
    }
    /**
     * Returns true if TAA is supported by the running hardware
     */
    get isSupported() {
        const caps = this._scene.getEngine().getCaps();
        return caps.texelFetch;
    }
    /**
     * Constructor of the TAA rendering pipeline
     * @param name The rendering pipeline name
     * @param scene The scene linked to this pipeline
     * @param cameras The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)
     * @param textureType The type of texture where the scene will be rendered (default: 0)
     */
    constructor(name, scene, cameras, textureType = 0) {
        const engine = scene.getEngine();
        super(engine, name);
        /**
         * The TAA PostProcess effect id in the pipeline
         */
        this.TAARenderEffect = "TAARenderEffect";
        /**
         * The pass PostProcess effect id in the pipeline
         */
        this.TAAPassEffect = "TAAPassEffect";
        this._msaaSamples = 1;
        this._isEnabled = true;
        this._isDirty = false;
        this._camerasToBeAttached = [];
        this._pingpong = 0;
        this._cameras = cameras || scene.cameras;
        this._cameras = this._cameras.slice();
        this._camerasToBeAttached = this._cameras.slice();
        this._scene = scene;
        this._textureType = textureType;
        this._taaThinPostProcess = new ThinTAAPostProcess("TAA", this._scene.getEngine());
        if (this.isSupported) {
            this._createPingPongTextures(engine.getRenderWidth(), engine.getRenderHeight());
            scene.postProcessRenderPipelineManager.addPipeline(this);
            this._buildPipeline();
        }
    }
    /**
     * Get the class name
     * @returns "TAARenderingPipeline"
     */
    getClassName() {
        return "TAARenderingPipeline";
    }
    /**
     * Adds a camera to the pipeline
     * @param camera the camera to be added
     */
    addCamera(camera) {
        this._camerasToBeAttached.push(camera);
        this._buildPipeline();
    }
    /**
     * Removes a camera from the pipeline
     * @param camera the camera to remove
     */
    removeCamera(camera) {
        const index = this._camerasToBeAttached.indexOf(camera);
        this._camerasToBeAttached.splice(index, 1);
        this._buildPipeline();
    }
    /**
     * Removes the internal pipeline assets and detaches the pipeline from the scene cameras
     */
    dispose() {
        this._disposePostProcesses();
        this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
        this._ping.dispose();
        this._pong.dispose();
        super.dispose();
    }
    _createPingPongTextures(width, height) {
        const engine = this._scene.getEngine();
        this._ping?.dispose();
        this._pong?.dispose();
        this._ping = engine.createRenderTargetTexture({ width, height }, { generateMipMaps: false, generateDepthBuffer: false, type: 2, samplingMode: 1 });
        this._pong = engine.createRenderTargetTexture({ width, height }, { generateMipMaps: false, generateDepthBuffer: false, type: 2, samplingMode: 1 });
        this._taaThinPostProcess.textureWidth = width;
        this._taaThinPostProcess.textureHeight = height;
    }
    _buildPipeline() {
        if (!this.isSupported) {
            return;
        }
        if (!this._isEnabled) {
            this._isDirty = true;
            return;
        }
        this._isDirty = false;
        const engine = this._scene.getEngine();
        this._disposePostProcesses();
        if (this._cameras !== null) {
            this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
            // get back cameras to be used to reattach pipeline
            this._cameras = this._camerasToBeAttached.slice();
        }
        this._reset();
        this._createTAAPostProcess();
        this.addEffect(new PostProcessRenderEffect(engine, this.TAARenderEffect, () => {
            return this._taaPostProcess;
        }, true));
        this._createPassPostProcess();
        this.addEffect(new PostProcessRenderEffect(engine, this.TAAPassEffect, () => {
            return this._passPostProcess;
        }, true));
        if (this._cameras !== null) {
            this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras);
        }
    }
    _disposePostProcesses() {
        for (let i = 0; i < this._cameras.length; i++) {
            const camera = this._cameras[i];
            this._taaPostProcess?.dispose(camera);
            this._passPostProcess?.dispose(camera);
            camera.getProjectionMatrix(true); // recompute the projection matrix
        }
        this._taaPostProcess = null;
        this._passPostProcess = null;
    }
    _createTAAPostProcess() {
        this._taaPostProcess = new PostProcesses_postProcess/* PostProcess */.w("TAA", "taa", {
            uniforms: ["factor"],
            samplers: ["historySampler"],
            size: 1.0,
            engine: this._scene.getEngine(),
            textureType: this._textureType,
            effectWrapper: this._taaThinPostProcess,
        });
        this._taaPostProcess.samples = this._msaaSamples;
        this._taaPostProcess.onActivateObservable.add(() => {
            this._taaThinPostProcess.camera = this._scene.activeCamera;
            if (this._taaPostProcess?.width !== this._ping.width || this._taaPostProcess?.height !== this._ping.height) {
                const engine = this._scene.getEngine();
                this._createPingPongTextures(engine.getRenderWidth(), engine.getRenderHeight());
            }
            this._taaThinPostProcess.updateProjectionMatrix();
            if (this._passPostProcess) {
                this._passPostProcess.inputTexture = this._pingpong ? this._ping : this._pong;
            }
            this._pingpong = this._pingpong ^ 1;
        });
        this._taaPostProcess.onApplyObservable.add((effect) => {
            effect._bindTexture("historySampler", this._pingpong ? this._ping.texture : this._pong.texture);
        });
    }
    _createPassPostProcess() {
        const engine = this._scene.getEngine();
        this._passPostProcess = new passPostProcess/* PassPostProcess */.v("TAAPass", 1, null, 1, engine);
        this._passPostProcess.inputTexture = this._ping;
        this._passPostProcess.autoClear = false;
    }
    /**
     * Serializes the rendering pipeline (Used when exporting)
     * @returns the serialized object
     */
    serialize() {
        const serializationObject = decorators_serialization/* SerializationHelper */.p.Serialize(this);
        serializationObject.customType = "TAARenderingPipeline";
        return serializationObject;
    }
    /**
     * Parse the serialized pipeline
     * @param source Source pipeline.
     * @param scene The scene to load the pipeline to.
     * @param rootUrl The URL of the serialized pipeline.
     * @returns An instantiated pipeline from the serialized object.
     */
    static Parse(source, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => new TAARenderingPipeline(source._name, scene, source._ratio), source, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("samples")
], TAARenderingPipeline.prototype, "samples", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("msaaSamples")
], TAARenderingPipeline.prototype, "_msaaSamples", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], TAARenderingPipeline.prototype, "factor", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], TAARenderingPipeline.prototype, "disableOnCameraMove", null);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)("isEnabled")
], TAARenderingPipeline.prototype, "_isEnabled", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.TAARenderingPipeline", TAARenderingPipeline);
//# sourceMappingURL=taaRenderingPipeline.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ssao2.fragment.js
var ssao2_fragment = __webpack_require__(85363);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ssao2.fragment.js
var ShadersWGSL_ssao2_fragment = __webpack_require__(45076);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/ssaoCombine.fragment.js
var ShadersWGSL_ssaoCombine_fragment = __webpack_require__(68217);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/screenSpaceReflection2.fragment.js
var screenSpaceReflection2_fragment = __webpack_require__(94354);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/screenSpaceReflection2Blur.fragment.js
var screenSpaceReflection2Blur_fragment = __webpack_require__(68133);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/screenSpaceReflection2BlurCombiner.fragment.js
var screenSpaceReflection2BlurCombiner_fragment = __webpack_require__(17406);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/screenSpaceReflection2.fragment.js
var ShadersWGSL_screenSpaceReflection2_fragment = __webpack_require__(85423);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/screenSpaceReflection2Blur.fragment.js
var ShadersWGSL_screenSpaceReflection2Blur_fragment = __webpack_require__(66584);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/screenSpaceReflection2BlurCombiner.fragment.js
var ShadersWGSL_screenSpaceReflection2BlurCombiner_fragment = __webpack_require__(44143);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/taa.fragment.js
var taa_fragment = __webpack_require__(71405);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/taa.fragment.js
var ShadersWGSL_taa_fragment = __webpack_require__(37706);
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/index.js







// SSAO2




// SSR








//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/index.js
/* eslint-disable import/no-internal-modules */





//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/tonemapPostProcess.js


/** Defines operator used for tonemapping */
var TonemappingOperator;
(function (TonemappingOperator) {
    /** Hable */
    TonemappingOperator[TonemappingOperator["Hable"] = 0] = "Hable";
    /** Reinhard */
    TonemappingOperator[TonemappingOperator["Reinhard"] = 1] = "Reinhard";
    /** HejiDawson */
    TonemappingOperator[TonemappingOperator["HejiDawson"] = 2] = "HejiDawson";
    /** Photographic */
    TonemappingOperator[TonemappingOperator["Photographic"] = 3] = "Photographic";
})(TonemappingOperator || (TonemappingOperator = {}));
/**
 * Defines a post process to apply tone mapping
 */
class TonemapPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "TonemapPostProcess" string
     */
    getClassName() {
        return "TonemapPostProcess";
    }
    /**
     * Creates a new TonemapPostProcess
     * @param name defines the name of the postprocess
     * @param _operator defines the operator to use
     * @param exposureAdjustment defines the required exposure adjustment
     * @param camera defines the camera to use (can be null)
     * @param samplingMode defines the required sampling mode (BABYLON.Texture.BILINEAR_SAMPLINGMODE by default)
     * @param engine defines the hosting engine (can be ignore if camera is set)
     * @param textureFormat defines the texture format to use (BABYLON.Engine.TEXTURETYPE_UNSIGNED_BYTE by default)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     */
    constructor(name, _operator, 
    /** Defines the required exposure adjustment */
    exposureAdjustment, camera, samplingMode = 2, engine, textureFormat = 0, reusable) {
        super(name, "tonemap", ["_ExposureAdjustment"], null, 1.0, camera, samplingMode, engine, reusable, null, textureFormat);
        this._operator = _operator;
        this.exposureAdjustment = exposureAdjustment;
        let defines = "#define ";
        if (this._operator === 0 /* TonemappingOperator.Hable */) {
            defines += "HABLE_TONEMAPPING";
        }
        else if (this._operator === 1 /* TonemappingOperator.Reinhard */) {
            defines += "REINHARD_TONEMAPPING";
        }
        else if (this._operator === 2 /* TonemappingOperator.HejiDawson */) {
            defines += "OPTIMIZED_HEJIDAWSON_TONEMAPPING";
        }
        else if (this._operator === 3 /* TonemappingOperator.Photographic */) {
            defines += "PHOTOGRAPHIC_TONEMAPPING";
        }
        //sadly a second call to create the effect.
        this.updateEffect(defines);
        this.onApply = (effect) => {
            effect.setFloat("_ExposureAdjustment", this.exposureAdjustment);
        };
    }
    _gatherImports(useWebGPU, list) {
        if (useWebGPU) {
            this._webGPUReady = true;
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 18))]));
        }
        else {
            list.push(Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 17985))]));
        }
        super._gatherImports(useWebGPU, list);
    }
}
//# sourceMappingURL=tonemapPostProcess.js.map
;// ./node_modules/@babylonjs/core/Shaders/volumetricLightScattering.fragment.js
// Do not edit.

const volumetricLightScattering_fragment_name = "volumetricLightScatteringPixelShader";
const volumetricLightScattering_fragment_shader = `uniform sampler2D textureSampler;uniform sampler2D lightScatteringSampler;uniform float decay;uniform float exposure;uniform float weight;uniform float density;uniform vec2 meshPositionOnScreen;varying vec2 vUV;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
vec2 tc=vUV;vec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);deltaTexCoord*=1.0/float(NUM_SAMPLES)*density;float illuminationDecay=1.0;vec4 color=texture2D(lightScatteringSampler,tc)*0.4;for(int i=0; i<NUM_SAMPLES; i++) {tc-=deltaTexCoord;vec4 dataSample=texture2D(lightScatteringSampler,tc)*0.4;dataSample*=illuminationDecay*weight;color+=dataSample;illuminationDecay*=decay;}
vec4 realColor=texture2D(textureSampler,vUV);gl_FragColor=((vec4((vec3(color.r,color.g,color.b)*exposure),realColor.a))+(realColor*(1.5-0.4)));
#define CUSTOM_FRAGMENT_MAIN_END
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[volumetricLightScattering_fragment_name] = volumetricLightScattering_fragment_shader;
/** @internal */
const volumetricLightScatteringPixelShader = { name: volumetricLightScattering_fragment_name, shader: volumetricLightScattering_fragment_shader };
//# sourceMappingURL=volumetricLightScattering.fragment.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js
var ShadersInclude_bakedVertexAnimationDeclaration = __webpack_require__(18959);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js
var ShadersInclude_bakedVertexAnimation = __webpack_require__(65523);
;// ./node_modules/@babylonjs/core/Shaders/volumetricLightScatteringPass.vertex.js
// Do not edit.











const volumetricLightScatteringPass_vertex_name = "volumetricLightScatteringPassVertexShader";
const volumetricLightScatteringPass_vertex_shader = `attribute vec3 position;
#include<bonesDeclaration>
#include<bakedVertexAnimationDeclaration>
#include<morphTargetsVertexGlobalDeclaration>
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
#include<instancesDeclaration>
uniform mat4 viewProjection;uniform vec2 depthValues;
#if defined(ALPHATEST) || defined(NEED_UV)
varying vec2 vUV;uniform mat4 diffuseMatrix;
#ifdef UV1
attribute vec2 uv;
#endif
#ifdef UV2
attribute vec2 uv2;
#endif
#endif
#define CUSTOM_VERTEX_DEFINITIONS
void main(void)
{vec3 positionUpdated=position;
#if (defined(ALPHATEST) || defined(NEED_UV)) && defined(UV1)
vec2 uvUpdated=uv;
#endif
#include<morphTargetsVertexGlobal>
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
#include<instancesVertex>
#include<bonesVertex>
#include<bakedVertexAnimation>
gl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);
#if defined(ALPHATEST) || defined(BASIC_RENDER)
#ifdef UV1
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
#endif
#ifdef UV2
vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));
#endif
#endif
}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[volumetricLightScatteringPass_vertex_name] = volumetricLightScatteringPass_vertex_shader;
/** @internal */
const volumetricLightScatteringPassVertexShader = { name: volumetricLightScatteringPass_vertex_name, shader: volumetricLightScatteringPass_vertex_shader };
//# sourceMappingURL=volumetricLightScatteringPass.vertex.js.map
;// ./node_modules/@babylonjs/core/Shaders/volumetricLightScatteringPass.fragment.js
// Do not edit.

const volumetricLightScatteringPass_fragment_name = "volumetricLightScatteringPassPixelShader";
const volumetricLightScatteringPass_fragment_shader = `#if defined(ALPHATEST) || defined(NEED_UV)
varying vec2 vUV;
#endif
#if defined(ALPHATEST)
uniform sampler2D diffuseSampler;
#endif
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void)
{
#if defined(ALPHATEST)
vec4 diffuseColor=texture2D(diffuseSampler,vUV);if (diffuseColor.a<0.4)
discard;
#endif
gl_FragColor=vec4(0.0,0.0,0.0,1.0);}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[volumetricLightScatteringPass_fragment_name] = volumetricLightScatteringPass_fragment_shader;
/** @internal */
const volumetricLightScatteringPassPixelShader = { name: volumetricLightScatteringPass_fragment_name, shader: volumetricLightScatteringPass_fragment_shader };
//# sourceMappingURL=volumetricLightScatteringPass.fragment.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/volumetricLightScatteringPostProcess.js






















/**
 *  Inspired by https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-13-volumetric-light-scattering-post-process
 */
class VolumetricLightScatteringPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * @internal
     * VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead
     */
    get useDiffuseColor() {
        logger/* Logger */.V.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead");
        return false;
    }
    set useDiffuseColor(useDiffuseColor) {
        logger/* Logger */.V.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead");
    }
    /**
     * @constructor
     * @param name The post-process name
     * @param ratio The size of the post-process and/or internal pass (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5)
     * @param camera The camera that the post-process will be attached to
     * @param mesh The mesh used to create the light scattering
     * @param samples The post-process quality, default 100
     * @param samplingMode The post-process filtering mode
     * @param engine The babylon engine
     * @param reusable If the post-process is reusable
     * @param scene The constructor needs a scene reference to initialize internal components. If "camera" is null a "scene" must be provided
     */
    constructor(name, ratio, camera, mesh, samples = 100, samplingMode = Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, reusable, scene) {
        super(name, "volumetricLightScattering", ["decay", "exposure", "weight", "meshPositionOnScreen", "density"], ["lightScatteringSampler"], ratio.postProcessRatio || ratio, camera, samplingMode, engine, reusable, "#define NUM_SAMPLES " + samples);
        this._screenCoordinates = math_vector/* Vector2 */.I9.Zero();
        /**
         * Custom position of the mesh. Used if "useCustomMeshPosition" is set to "true"
         */
        this.customMeshPosition = math_vector/* Vector3 */.Pq.Zero();
        /**
         * Set if the post-process should use a custom position for the light source (true) or the internal mesh position (false)
         */
        this.useCustomMeshPosition = false;
        /**
         * If the post-process should inverse the light scattering direction
         */
        this.invert = true;
        /**
         * Array containing the excluded meshes not rendered in the internal pass
         */
        this.excludedMeshes = [];
        /**
         * Array containing the only meshes rendered in the internal pass.
         * If this array is not empty, only the meshes from this array are rendered in the internal pass
         */
        this.includedMeshes = [];
        /**
         * Controls the overall intensity of the post-process
         */
        this.exposure = 0.3;
        /**
         * Dissipates each sample's contribution in range [0, 1]
         */
        this.decay = 0.96815;
        /**
         * Controls the overall intensity of each sample
         */
        this.weight = 0.58767;
        /**
         * Controls the density of each sample
         */
        this.density = 0.926;
        scene = camera?.getScene() ?? scene ?? this._scene; // parameter "scene" can be null.
        engine = scene.getEngine();
        this._viewPort = new math_viewport/* Viewport */.L(0, 0, 1, 1).toGlobal(engine.getRenderWidth(), engine.getRenderHeight());
        // Configure mesh
        this.mesh = mesh ?? VolumetricLightScatteringPostProcess.CreateDefaultMesh("VolumetricLightScatteringMesh", scene);
        // Configure
        this._createPass(scene, ratio.passRatio || ratio);
        this.onActivate = (camera) => {
            if (!this.isSupported) {
                this.dispose(camera);
            }
            this.onActivate = null;
        };
        this.onApplyObservable.add((effect) => {
            this._updateMeshScreenCoordinates(scene);
            effect.setTexture("lightScatteringSampler", this._volumetricLightScatteringRTT);
            effect.setFloat("exposure", this.exposure);
            effect.setFloat("decay", this.decay);
            effect.setFloat("weight", this.weight);
            effect.setFloat("density", this.density);
            effect.setVector2("meshPositionOnScreen", this._screenCoordinates);
        });
    }
    /**
     * Returns the string "VolumetricLightScatteringPostProcess"
     * @returns "VolumetricLightScatteringPostProcess"
     */
    getClassName() {
        return "VolumetricLightScatteringPostProcess";
    }
    _isReady(subMesh, useInstances) {
        const mesh = subMesh.getMesh();
        // Render this.mesh as default
        if (mesh === this.mesh && mesh.material) {
            return mesh.material.isReady(mesh);
        }
        const renderingMaterial = mesh._internalAbstractMeshDataInfo._materialForRenderPass?.[this._scene.getEngine().currentRenderPassId];
        if (renderingMaterial) {
            return renderingMaterial.isReadyForSubMesh(mesh, subMesh, useInstances);
        }
        const defines = [];
        const attribs = [Buffers_buffer/* VertexBuffer */.R.PositionKind];
        const material = subMesh.getMaterial();
        // Alpha test
        if (material) {
            if (material.needAlphaTesting()) {
                defines.push("#define ALPHATEST");
            }
            if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UVKind)) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.UVKind);
                defines.push("#define UV1");
            }
            if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UV2Kind)) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.UV2Kind);
                defines.push("#define UV2");
            }
        }
        // Bones
        const fallbacks = new effectFallbacks/* EffectFallbacks */.J();
        if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind);
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind);
            if (mesh.numBoneInfluencers > 4) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind);
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind);
            }
            defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
            if (mesh.numBoneInfluencers > 0) {
                fallbacks.addCPUSkinningFallback(0, mesh);
            }
            const skeleton = mesh.skeleton;
            if (skeleton.isUsingTextureForMatrices) {
                defines.push("#define BONETEXTURE");
            }
            else {
                defines.push("#define BonesPerMesh " + (skeleton.bones.length + 1));
            }
        }
        else {
            defines.push("#define NUM_BONE_INFLUENCERS 0");
        }
        // Morph targets
        const morphTargetManager = mesh.morphTargetManager;
        let numMorphInfluencers = 0;
        if (morphTargetManager) {
            numMorphInfluencers = morphTargetManager.numMaxInfluencers || morphTargetManager.numInfluencers;
            if (numMorphInfluencers > 0) {
                defines.push("#define MORPHTARGETS");
                defines.push("#define NUM_MORPH_INFLUENCERS " + numMorphInfluencers);
                if (morphTargetManager.isUsingTextureForTargets) {
                    defines.push("#define MORPHTARGETS_TEXTURE");
                }
                (0,materialHelper_functions/* PrepareAttributesForMorphTargetsInfluencers */.MF)(attribs, mesh, numMorphInfluencers);
            }
        }
        // Instances
        if (useInstances) {
            defines.push("#define INSTANCES");
            (0,materialHelper_functions/* PushAttributesForInstances */.te)(attribs);
            if (subMesh.getRenderingMesh().hasThinInstances) {
                defines.push("#define THIN_INSTANCES");
            }
        }
        // Baked vertex animations
        const bvaManager = mesh.bakedVertexAnimationManager;
        if (bvaManager && bvaManager.isEnabled) {
            defines.push("#define BAKED_VERTEX_ANIMATION_TEXTURE");
            if (useInstances) {
                attribs.push("bakedVertexAnimationSettingsInstanced");
            }
        }
        // Get correct effect
        const drawWrapper = subMesh._getDrawWrapper(undefined, true);
        const cachedDefines = drawWrapper.defines;
        const join = defines.join("\n");
        if (cachedDefines !== join) {
            const uniforms = [
                "world",
                "mBones",
                "boneTextureWidth",
                "viewProjection",
                "diffuseMatrix",
                "morphTargetInfluences",
                "morphTargetCount",
                "morphTargetTextureInfo",
                "morphTargetTextureIndices",
                "bakedVertexAnimationSettings",
                "bakedVertexAnimationTextureSizeInverted",
                "bakedVertexAnimationTime",
                "bakedVertexAnimationTexture",
            ];
            const samplers = ["diffuseSampler", "morphTargets", "boneSampler", "bakedVertexAnimationTexture"];
            drawWrapper.setEffect(mesh
                .getScene()
                .getEngine()
                .createEffect("volumetricLightScatteringPass", {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: [],
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: null,
                onError: null,
                indexParameters: { maxSimultaneousMorphTargets: numMorphInfluencers },
            }, mesh.getScene().getEngine()), join);
        }
        return drawWrapper.effect.isReady();
    }
    /**
     * Sets the new light position for light scattering effect
     * @param position The new custom light position
     */
    setCustomMeshPosition(position) {
        this.customMeshPosition = position;
    }
    /**
     * Returns the light position for light scattering effect
     * @returns Vector3 The custom light position
     */
    getCustomMeshPosition() {
        return this.customMeshPosition;
    }
    /**
     * Disposes the internal assets and detaches the post-process from the camera
     * @param camera The camera from which to detach the post-process
     */
    dispose(camera) {
        const rttIndex = camera.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT);
        if (rttIndex !== -1) {
            camera.getScene().customRenderTargets.splice(rttIndex, 1);
        }
        this._volumetricLightScatteringRTT.dispose();
        super.dispose(camera);
    }
    /**
     * Returns the render target texture used by the post-process
     * @returns the render target texture used by the post-process
     */
    getPass() {
        return this._volumetricLightScatteringRTT;
    }
    // Private methods
    _meshExcluded(mesh) {
        if ((this.includedMeshes.length > 0 && this.includedMeshes.indexOf(mesh) === -1) || (this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1)) {
            return true;
        }
        return false;
    }
    _createPass(scene, ratio) {
        const engine = scene.getEngine();
        this._volumetricLightScatteringRTT = new Textures_renderTargetTexture/* RenderTargetTexture */.$("volumetricLightScatteringMap", { width: engine.getRenderWidth() * ratio, height: engine.getRenderHeight() * ratio }, scene, false, true, 0);
        this._volumetricLightScatteringRTT.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._volumetricLightScatteringRTT.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._volumetricLightScatteringRTT.renderList = null;
        this._volumetricLightScatteringRTT.renderParticles = false;
        this._volumetricLightScatteringRTT.ignoreCameraViewport = true;
        const camera = this.getCamera();
        if (camera) {
            camera.customRenderTargets.push(this._volumetricLightScatteringRTT);
        }
        else {
            scene.customRenderTargets.push(this._volumetricLightScatteringRTT);
        }
        // Custom render function for submeshes
        const renderSubMesh = (subMesh) => {
            const renderingMesh = subMesh.getRenderingMesh();
            const effectiveMesh = subMesh.getEffectiveMesh();
            if (this._meshExcluded(renderingMesh)) {
                return;
            }
            effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = false;
            const material = subMesh.getMaterial();
            if (!material) {
                return;
            }
            const scene = renderingMesh.getScene();
            const engine = scene.getEngine();
            // Culling
            engine.setState(material.backFaceCulling, undefined, undefined, undefined, material.cullBackFaces);
            // Managing instances
            const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());
            if (batch.mustReturn) {
                return;
            }
            const hardwareInstancedRendering = engine.getCaps().instancedArrays && (batch.visibleInstances[subMesh._id] !== null || renderingMesh.hasThinInstances);
            if (this._isReady(subMesh, hardwareInstancedRendering)) {
                const renderingMaterial = effectiveMesh._internalAbstractMeshDataInfo._materialForRenderPass?.[engine.currentRenderPassId];
                let drawWrapper = subMesh._getDrawWrapper();
                if (renderingMesh === this.mesh && !drawWrapper) {
                    drawWrapper = material._getDrawWrapper();
                }
                if (!drawWrapper) {
                    return;
                }
                const effect = drawWrapper.effect;
                engine.enableEffect(drawWrapper);
                if (!hardwareInstancedRendering) {
                    renderingMesh._bind(subMesh, effect, material.fillMode);
                }
                if (renderingMesh === this.mesh) {
                    material.bind(effectiveMesh.getWorldMatrix(), renderingMesh);
                }
                else if (renderingMaterial) {
                    renderingMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), effectiveMesh, subMesh);
                }
                else {
                    effect.setMatrix("viewProjection", scene.getTransformMatrix());
                    // Alpha test
                    if (material.needAlphaTesting()) {
                        const alphaTexture = material.getAlphaTestTexture();
                        if (alphaTexture) {
                            effect.setTexture("diffuseSampler", alphaTexture);
                            effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
                        }
                    }
                    // Bones
                    (0,materialHelper_functions/* BindBonesParameters */.f$)(renderingMesh, effect);
                    // Morph targets
                    (0,materialHelper_functions/* BindMorphTargetParameters */.nR)(renderingMesh, effect);
                    if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {
                        renderingMesh.morphTargetManager._bind(effect);
                    }
                    // Baked vertex animations
                    const bvaManager = subMesh.getMesh().bakedVertexAnimationManager;
                    if (bvaManager && bvaManager.isEnabled) {
                        bvaManager.bind(effect, hardwareInstancedRendering);
                    }
                }
                if (hardwareInstancedRendering && renderingMesh.hasThinInstances) {
                    effect.setMatrix("world", effectiveMesh.getWorldMatrix());
                }
                // Draw
                renderingMesh._processRendering(effectiveMesh, subMesh, effect, Materials_material/* Material */.i.TriangleFillMode, batch, hardwareInstancedRendering, (isInstance, world) => {
                    if (!isInstance) {
                        effect.setMatrix("world", world);
                    }
                });
            }
        };
        // Render target texture callbacks
        let savedSceneClearColor;
        const sceneClearColor = new math_color/* Color4 */.ov(0.0, 0.0, 0.0, 1.0);
        this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(() => {
            savedSceneClearColor = scene.clearColor;
            scene.clearColor = sceneClearColor;
        });
        this._volumetricLightScatteringRTT.onAfterRenderObservable.add(() => {
            scene.clearColor = savedSceneClearColor;
        });
        this._volumetricLightScatteringRTT.customIsReadyFunction = (mesh, refreshRate, preWarm) => {
            if ((preWarm || refreshRate === 0) && mesh.subMeshes) {
                for (let i = 0; i < mesh.subMeshes.length; ++i) {
                    const subMesh = mesh.subMeshes[i];
                    const material = subMesh.getMaterial();
                    const renderingMesh = subMesh.getRenderingMesh();
                    if (!material) {
                        continue;
                    }
                    const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());
                    const hardwareInstancedRendering = engine.getCaps().instancedArrays && (batch.visibleInstances[subMesh._id] !== null || renderingMesh.hasThinInstances);
                    if (!this._isReady(subMesh, hardwareInstancedRendering)) {
                        return false;
                    }
                }
            }
            return true;
        };
        this._volumetricLightScatteringRTT.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => {
            const engine = scene.getEngine();
            let index;
            if (depthOnlySubMeshes.length) {
                engine.setColorWrite(false);
                for (index = 0; index < depthOnlySubMeshes.length; index++) {
                    renderSubMesh(depthOnlySubMeshes.data[index]);
                }
                engine.setColorWrite(true);
            }
            for (index = 0; index < opaqueSubMeshes.length; index++) {
                renderSubMesh(opaqueSubMeshes.data[index]);
            }
            for (index = 0; index < alphaTestSubMeshes.length; index++) {
                renderSubMesh(alphaTestSubMeshes.data[index]);
            }
            if (transparentSubMeshes.length) {
                // Sort sub meshes
                for (index = 0; index < transparentSubMeshes.length; index++) {
                    const submesh = transparentSubMeshes.data[index];
                    const boundingInfo = submesh.getBoundingInfo();
                    if (boundingInfo && scene.activeCamera) {
                        submesh._alphaIndex = submesh.getMesh().alphaIndex;
                        submesh._distanceToCamera = boundingInfo.boundingSphere.centerWorld.subtract(scene.activeCamera.position).length();
                    }
                }
                const sortedArray = transparentSubMeshes.data.slice(0, transparentSubMeshes.length);
                sortedArray.sort((a, b) => {
                    // Alpha index first
                    if (a._alphaIndex > b._alphaIndex) {
                        return 1;
                    }
                    if (a._alphaIndex < b._alphaIndex) {
                        return -1;
                    }
                    // Then distance to camera
                    if (a._distanceToCamera < b._distanceToCamera) {
                        return 1;
                    }
                    if (a._distanceToCamera > b._distanceToCamera) {
                        return -1;
                    }
                    return 0;
                });
                // Render sub meshes
                engine.setAlphaMode(2);
                for (index = 0; index < sortedArray.length; index++) {
                    renderSubMesh(sortedArray[index]);
                }
                engine.setAlphaMode(0);
            }
        };
    }
    _updateMeshScreenCoordinates(scene) {
        const transform = scene.getTransformMatrix();
        let meshPosition;
        if (this.useCustomMeshPosition) {
            meshPosition = this.customMeshPosition;
        }
        else if (this.attachedNode) {
            meshPosition = this.attachedNode.position;
        }
        else {
            meshPosition = this.mesh.parent ? this.mesh.getAbsolutePosition() : this.mesh.position;
        }
        const pos = math_vector/* Vector3 */.Pq.Project(meshPosition, math_vector/* Matrix */.uq.Identity(), transform, this._viewPort);
        this._screenCoordinates.x = pos.x / this._viewPort.width;
        this._screenCoordinates.y = pos.y / this._viewPort.height;
        if (this.invert) {
            this._screenCoordinates.y = 1.0 - this._screenCoordinates.y;
        }
    }
    // Static methods
    /**
     * Creates a default mesh for the Volumeric Light Scattering post-process
     * @param name The mesh name
     * @param scene The scene where to create the mesh
     * @returns the default mesh
     */
    static CreateDefaultMesh(name, scene) {
        const mesh = (0,planeBuilder/* CreatePlane */.x)(name, { size: 1 }, scene);
        mesh.billboardMode = abstractMesh/* AbstractMesh */.u.BILLBOARDMODE_ALL;
        const material = new standardMaterial/* StandardMaterial */.F(name + "Material", scene);
        material.emissiveColor = new math_color/* Color3 */.v9(1, 1, 1);
        mesh.material = material;
        return mesh;
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsVector3 */.P_)()
], VolumetricLightScatteringPostProcess.prototype, "customMeshPosition", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], VolumetricLightScatteringPostProcess.prototype, "useCustomMeshPosition", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], VolumetricLightScatteringPostProcess.prototype, "invert", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serializeAsMeshReference */.xG)()
], VolumetricLightScatteringPostProcess.prototype, "mesh", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], VolumetricLightScatteringPostProcess.prototype, "excludedMeshes", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], VolumetricLightScatteringPostProcess.prototype, "includedMeshes", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], VolumetricLightScatteringPostProcess.prototype, "exposure", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], VolumetricLightScatteringPostProcess.prototype, "decay", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], VolumetricLightScatteringPostProcess.prototype, "weight", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], VolumetricLightScatteringPostProcess.prototype, "density", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.VolumetricLightScatteringPostProcess", VolumetricLightScatteringPostProcess);
//# sourceMappingURL=volumetricLightScatteringPostProcess.js.map
;// ./node_modules/@babylonjs/core/Shaders/screenSpaceCurvature.fragment.js
// Do not edit.

const screenSpaceCurvature_fragment_name = "screenSpaceCurvaturePixelShader";
const screenSpaceCurvature_fragment_shader = `precision highp float;varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D normalSampler;uniform float curvature_ridge;uniform float curvature_valley;
#ifndef CURVATURE_OFFSET
#define CURVATURE_OFFSET 1
#endif
float curvature_soft_clamp(float curvature,float control)
{if (curvature<0.5/control)
return curvature*(1.0-curvature*control);return 0.25/control;}
float calculate_curvature(ivec2 texel,float ridge,float valley)
{vec2 normal_up =texelFetch(normalSampler,texel+ivec2(0, CURVATURE_OFFSET),0).rb;vec2 normal_down =texelFetch(normalSampler,texel+ivec2(0,-CURVATURE_OFFSET),0).rb;vec2 normal_left =texelFetch(normalSampler,texel+ivec2(-CURVATURE_OFFSET,0),0).rb;vec2 normal_right=texelFetch(normalSampler,texel+ivec2( CURVATURE_OFFSET,0),0).rb;float normal_diff=((normal_up.g-normal_down.g)+(normal_right.r-normal_left.r));if (normal_diff<0.0)
return -2.0*curvature_soft_clamp(-normal_diff,valley);return 2.0*curvature_soft_clamp(normal_diff,ridge);}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{ivec2 texel=ivec2(gl_FragCoord.xy);vec4 baseColor=texture2D(textureSampler,vUV);float curvature=calculate_curvature(texel,curvature_ridge,curvature_valley);baseColor.rgb*=curvature+1.0;gl_FragColor=baseColor;}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[screenSpaceCurvature_fragment_name] = screenSpaceCurvature_fragment_shader;
/** @internal */
const screenSpaceCurvaturePixelShader = { name: screenSpaceCurvature_fragment_name, shader: screenSpaceCurvature_fragment_shader };
//# sourceMappingURL=screenSpaceCurvature.fragment.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/screenSpaceCurvaturePostProcess.js










/**
 * The Screen Space curvature effect can help highlighting ridge and valley of a model.
 */
class ScreenSpaceCurvaturePostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "ScreenSpaceCurvaturePostProcess" string
     */
    getClassName() {
        return "ScreenSpaceCurvaturePostProcess";
    }
    /**
     * Creates a new instance ScreenSpaceCurvaturePostProcess
     * @param name The name of the effect.
     * @param scene The scene containing the objects to blur according to their velocity.
     * @param options The required width/height ratio to downsize to before computing the render pass.
     * @param camera The camera to apply the render pass to.
     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
     * @param engine The engine which the post process will be applied. (default: current engine)
     * @param reusable If the post process can be reused on the same frame. (default: false)
     * @param textureType Type of textures used when performing the post process. (default: 0)
     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
     */
    constructor(name, scene, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
        super(name, "screenSpaceCurvature", ["curvature_ridge", "curvature_valley"], ["textureSampler", "normalSampler"], options, camera, samplingMode, engine, reusable, undefined, textureType, undefined, null, blockCompilation);
        /**
         * Defines how much ridge the curvature effect displays.
         */
        this.ridge = 1;
        /**
         * Defines how much valley the curvature effect displays.
         */
        this.valley = 1;
        this._geometryBufferRenderer = scene.enableGeometryBufferRenderer();
        if (!this._geometryBufferRenderer) {
            // Geometry buffer renderer is not supported. So, work as a passthrough.
            logger/* Logger */.V.Error("Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first.");
        }
        else {
            if (this._geometryBufferRenderer.generateNormalsInWorldSpace) {
                logger/* Logger */.V.Error("ScreenSpaceCurvaturePostProcess does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!");
            }
            // Geometry buffer renderer is supported.
            this.onApply = (effect) => {
                effect.setFloat("curvature_ridge", 0.5 / Math.max(this.ridge * this.ridge, 1e-4));
                effect.setFloat("curvature_valley", 0.7 / Math.max(this.valley * this.valley, 1e-4));
                const normalTexture = this._geometryBufferRenderer.getGBuffer().textures[1];
                effect.setTexture("normalSampler", normalTexture);
            };
        }
    }
    /**
     * Support test.
     */
    static get IsSupported() {
        const engine = engineStore/* EngineStore */.q.LastCreatedEngine;
        if (!engine) {
            return false;
        }
        return engine.getCaps().drawBuffersExtension;
    }
    /**
     * @internal
     */
    static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
        return decorators_serialization/* SerializationHelper */.p.Parse(() => {
            return new ScreenSpaceCurvaturePostProcess(parsedPostProcess.name, scene, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.textureType, parsedPostProcess.reusable);
        }, parsedPostProcess, scene, rootUrl);
    }
}
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceCurvaturePostProcess.prototype, "ridge", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], ScreenSpaceCurvaturePostProcess.prototype, "valley", void 0);
(0,typeStore/* RegisterClass */.Y5)("BABYLON.ScreenSpaceCurvaturePostProcess", ScreenSpaceCurvaturePostProcess);
//# sourceMappingURL=screenSpaceCurvaturePostProcess.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/postprocess.vertex.js
var postprocess_vertex = __webpack_require__(16612);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/postprocess.vertex.js
var ShadersWGSL_postprocess_vertex = __webpack_require__(32083);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/kernelBlur.fragment.js + 2 modules
var kernelBlur_fragment = __webpack_require__(54509);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/kernelBlur.vertex.js + 1 modules
var kernelBlur_vertex = __webpack_require__(83802);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/kernelBlur.fragment.js + 2 modules
var ShadersWGSL_kernelBlur_fragment = __webpack_require__(12850);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/kernelBlur.vertex.js + 1 modules
var ShadersWGSL_kernelBlur_vertex = __webpack_require__(85417);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/pass.fragment.js
var pass_fragment = __webpack_require__(79820);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/passCube.fragment.js
var passCube_fragment = __webpack_require__(4511);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/pass.fragment.js
var ShadersWGSL_pass_fragment = __webpack_require__(99965);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/passCube.fragment.js
var ShadersWGSL_passCube_fragment = __webpack_require__(67682);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/vrDistortionCorrection.fragment.js
var vrDistortionCorrection_fragment = __webpack_require__(21830);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/vrDistortionCorrection.fragment.js
var ShadersWGSL_vrDistortionCorrection_fragment = __webpack_require__(57811);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/imageProcessing.fragment.js
var imageProcessing_fragment = __webpack_require__(37614);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/imageProcessing.fragment.js
var Shaders_imageProcessing_fragment = __webpack_require__(83153);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/sharpen.fragment.js
var ShadersWGSL_sharpen_fragment = __webpack_require__(35381);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/grain.fragment.js
var grain_fragment = __webpack_require__(50890);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/grain.fragment.js
var ShadersWGSL_grain_fragment = __webpack_require__(68625);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/chromaticAberration.fragment.js
var ShadersWGSL_chromaticAberration_fragment = __webpack_require__(89619);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/depthOfFieldMerge.fragment.js
var depthOfFieldMerge_fragment = __webpack_require__(19411);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/depthOfFieldMerge.fragment.js
var ShadersWGSL_depthOfFieldMerge_fragment = __webpack_require__(89480);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/circleOfConfusion.fragment.js
var circleOfConfusion_fragment = __webpack_require__(97694);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/circleOfConfusion.fragment.js
var ShadersWGSL_circleOfConfusion_fragment = __webpack_require__(22217);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/bloomMerge.fragment.js
var bloomMerge_fragment = __webpack_require__(39336);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/bloomMerge.fragment.js
var ShadersWGSL_bloomMerge_fragment = __webpack_require__(96645);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/extractHighlights.fragment.js
var extractHighlights_fragment = __webpack_require__(55491);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/extractHighlights.fragment.js
var ShadersWGSL_extractHighlights_fragment = __webpack_require__(95516);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fxaa.fragment.js
var fxaa_fragment = __webpack_require__(5499);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fxaa.vertex.js
var fxaa_vertex = __webpack_require__(9669);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fxaa.fragment.js
var ShadersWGSL_fxaa_fragment = __webpack_require__(72578);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fxaa.vertex.js
var ShadersWGSL_fxaa_vertex = __webpack_require__(53208);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/blackAndWhite.fragment.js
var blackAndWhite_fragment = __webpack_require__(3996);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/blackAndWhite.fragment.js
var ShadersWGSL_blackAndWhite_fragment = __webpack_require__(65783);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/anaglyph.fragment.js
var anaglyph_fragment = __webpack_require__(69723);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/anaglyph.fragment.js
var ShadersWGSL_anaglyph_fragment = __webpack_require__(91506);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/convolution.fragment.js
var convolution_fragment = __webpack_require__(51537);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/convolution.fragment.js
var ShadersWGSL_convolution_fragment = __webpack_require__(52906);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/colorCorrection.fragment.js
var colorCorrection_fragment = __webpack_require__(37670);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/colorCorrection.fragment.js
var ShadersWGSL_colorCorrection_fragment = __webpack_require__(53813);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/motionBlur.fragment.js
var motionBlur_fragment = __webpack_require__(25830);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/motionBlur.fragment.js
var ShadersWGSL_motionBlur_fragment = __webpack_require__(8075);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/filter.fragment.js
var filter_fragment = __webpack_require__(97961);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/filter.fragment.js
var ShadersWGSL_filter_fragment = __webpack_require__(57912);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/highlights.fragment.js
var highlights_fragment = __webpack_require__(96920);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/highlights.fragment.js
var ShadersWGSL_highlights_fragment = __webpack_require__(80265);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/displayPass.fragment.js
var displayPass_fragment = __webpack_require__(73718);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/displayPass.fragment.js
var ShadersWGSL_displayPass_fragment = __webpack_require__(54069);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/tonemap.fragment.js
var tonemap_fragment = __webpack_require__(17985);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/tonemap.fragment.js
var ShadersWGSL_tonemap_fragment = __webpack_require__(18);
;// ./node_modules/@babylonjs/core/PostProcesses/index.js
/* eslint-disable import/no-internal-modules */







































// Postprocess


// Blur postprocess




// Pass postprocess




// vrDFistortionCorrection postprocess


// Image processing postprocess


// Sharpen


// Grain


// Chromatic Aberration


// Depth of field merge


// Circle of confusion


// Bloom


// Extract highlights


// FXAA




// B&W


// Anaglyph


// Convolution


// Color correction


// Motion blur


// Filter


// Highlights


// Display


// Tonemap


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Probes/index.js

//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Rendering/boundingBoxRenderer.js
var boundingBoxRenderer = __webpack_require__(90505);
;// ./node_modules/@babylonjs/core/Rendering/depthRendererSceneComponent.js




core_scene/* Scene */.Z.prototype.enableDepthRenderer = function (camera, storeNonLinearDepth = false, force32bitsFloat = false, samplingMode = 3, storeCameraSpaceZ = false) {
    camera = camera || this.activeCamera;
    if (!camera) {
        // eslint-disable-next-line no-throw-literal
        throw "No camera available to enable depth renderer";
    }
    if (!this._depthRenderer) {
        this._depthRenderer = {};
    }
    if (!this._depthRenderer[camera.id]) {
        const supportFullfloat = !!this.getEngine().getCaps().textureFloatRender;
        let textureType = 0;
        if (this.getEngine().getCaps().textureHalfFloatRender && (!force32bitsFloat || !supportFullfloat)) {
            textureType = 2;
        }
        else if (supportFullfloat) {
            textureType = 1;
        }
        else {
            textureType = 0;
        }
        this._depthRenderer[camera.id] = new DepthRenderer(this, textureType, camera, storeNonLinearDepth, samplingMode, storeCameraSpaceZ);
    }
    return this._depthRenderer[camera.id];
};
core_scene/* Scene */.Z.prototype.disableDepthRenderer = function (camera) {
    camera = camera || this.activeCamera;
    if (!camera || !this._depthRenderer || !this._depthRenderer[camera.id]) {
        return;
    }
    this._depthRenderer[camera.id].dispose();
};
/**
 * Defines the Depth Renderer scene component responsible to manage a depth buffer useful
 * in several rendering techniques.
 */
class DepthRendererSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_DEPTHRENDERER;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._gatherRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_GATHERRENDERTARGETS_DEPTHRENDERER, this, this._gatherRenderTargets);
        this.scene._gatherActiveCameraRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER, this, this._gatherActiveCameraRenderTargets);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do for this component
    }
    /**
     * Disposes the component and the associated resources
     */
    dispose() {
        for (const key in this.scene._depthRenderer) {
            this.scene._depthRenderer[key].dispose();
        }
    }
    _gatherRenderTargets(renderTargets) {
        if (this.scene._depthRenderer) {
            for (const key in this.scene._depthRenderer) {
                const depthRenderer = this.scene._depthRenderer[key];
                if (depthRenderer.enabled && !depthRenderer.useOnlyInActiveCamera) {
                    renderTargets.push(depthRenderer.getDepthMap());
                }
            }
        }
    }
    _gatherActiveCameraRenderTargets(renderTargets) {
        if (this.scene._depthRenderer) {
            for (const key in this.scene._depthRenderer) {
                const depthRenderer = this.scene._depthRenderer[key];
                if (depthRenderer.enabled && depthRenderer.useOnlyInActiveCamera && this.scene.activeCamera.id === key) {
                    renderTargets.push(depthRenderer.getDepthMap());
                }
            }
        }
    }
}
DepthRenderer._SceneComponentInitialization = (scene) => {
    // Register the G Buffer component to the scene.
    let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_DEPTHRENDERER);
    if (!component) {
        component = new DepthRendererSceneComponent(scene);
        scene._addComponent(component);
    }
};
//# sourceMappingURL=depthRendererSceneComponent.js.map
;// ./node_modules/@babylonjs/core/Rendering/depthPeelingRenderer.js
/**
 * Implementation based on https://medium.com/@shrekshao_71662/dual-depth-peeling-implementation-in-webgl-11baa061ba4b
 */










class DepthPeelingEffectConfiguration {
    constructor() {
        /**
         * Is this effect enabled
         */
        this.enabled = true;
        /**
         * Name of the configuration
         */
        this.name = "depthPeeling";
        /**
         * Textures that should be present in the MRT for this effect to work
         */
        this.texturesRequired = [4];
    }
}
/**
 * The depth peeling renderer that performs
 * Order independant transparency (OIT).
 * This should not be instanciated directly, as it is part of a scene component
 */
class DepthPeelingRenderer {
    /**
     * Number of depth peeling passes. As we are using dual depth peeling, each pass two levels of transparency are processed.
     */
    get passCount() {
        return this._passCount;
    }
    set passCount(count) {
        if (this._passCount === count) {
            return;
        }
        this._passCount = count;
        this._createRenderPassIds();
    }
    /**
     * Instructs the renderer to use render passes. It is an optimization that makes the rendering faster for some engines (like WebGPU) but that consumes more memory, so it is disabled by default.
     */
    get useRenderPasses() {
        return this._useRenderPasses;
    }
    set useRenderPasses(usePasses) {
        if (this._useRenderPasses === usePasses) {
            return;
        }
        this._useRenderPasses = usePasses;
        this._createRenderPassIds();
    }
    /**
     * Add a mesh in the exclusion list to prevent it to be handled by the depth peeling renderer
     * @param mesh The mesh to exclude from the depth peeling renderer
     */
    addExcludedMesh(mesh) {
        if (this._excludedMeshes.indexOf(mesh.uniqueId) === -1) {
            this._excludedMeshes.push(mesh.uniqueId);
        }
    }
    /**
     * Remove a mesh from the exclusion list of the depth peeling renderer
     * @param mesh The mesh to remove
     */
    removeExcludedMesh(mesh) {
        const index = this._excludedMeshes.indexOf(mesh.uniqueId);
        if (index !== -1) {
            this._excludedMeshes.splice(index, 1);
        }
    }
    /**
     * Gets the shader language used in this renderer
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Instanciates the depth peeling renderer
     * @param scene Scene to attach to
     * @param passCount Number of depth layers to peel
     * @returns The depth peeling renderer
     */
    constructor(scene, passCount = 5) {
        this._thinTextures = [];
        this._currentPingPongState = 0;
        this._layoutCacheFormat = [[true], [true, true], [true, true, true]];
        this._layoutCache = [];
        this._candidateSubMeshes = new smartArray/* SmartArray */.L(10);
        this._excludedSubMeshes = new smartArray/* SmartArray */.L(10);
        this._excludedMeshes = [];
        this._colorCache = [
            new math_color/* Color4 */.ov(DepthPeelingRenderer._DEPTH_CLEAR_VALUE, DepthPeelingRenderer._DEPTH_CLEAR_VALUE, 0, 0),
            new math_color/* Color4 */.ov(-DepthPeelingRenderer._MIN_DEPTH, DepthPeelingRenderer._MAX_DEPTH, 0, 0),
            new math_color/* Color4 */.ov(0, 0, 0, 0),
        ];
        /** Shader language used by the renderer */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._scene = scene;
        this._engine = scene.getEngine();
        this._passCount = passCount;
        //  We need a depth texture for opaque
        if (!scene.enablePrePassRenderer()) {
            logger/* Logger */.V.Warn("Depth peeling for order independant transparency could not enable PrePass, aborting.");
            return;
        }
        for (let i = 0; i < this._layoutCacheFormat.length; ++i) {
            this._layoutCache[i] = this._engine.buildTextureLayout(this._layoutCacheFormat[i]);
        }
        this._renderPassIds = [];
        this.useRenderPasses = false;
        if (this._engine.isWebGPU) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
        this._prePassEffectConfiguration = new DepthPeelingEffectConfiguration();
        this._createTextures();
        this._createEffects();
    }
    _createRenderPassIds() {
        this._releaseRenderPassIds();
        if (this._useRenderPasses) {
            for (let i = 0; i < this._passCount + 1; ++i) {
                if (!this._renderPassIds[i]) {
                    this._renderPassIds[i] = this._engine.createRenderPassId(`DepthPeelingRenderer - pass #${i}`);
                }
            }
        }
    }
    _releaseRenderPassIds() {
        for (let i = 0; i < this._renderPassIds.length; ++i) {
            this._engine.releaseRenderPassId(this._renderPassIds[i]);
        }
        this._renderPassIds = [];
    }
    _createTextures() {
        const size = {
            width: this._engine.getRenderWidth(),
            height: this._engine.getRenderHeight(),
        };
        // 2 for ping pong
        this._depthMrts = [
            new MultiRenderTarget("depthPeelingDepth0MRT", size, 3, this._scene, undefined, [
                "depthPeelingDepth0MRT_depth",
                "depthPeelingDepth0MRT_frontColor",
                "depthPeelingDepth0MRT_backColor",
            ]),
            new MultiRenderTarget("depthPeelingDepth1MRT", size, 3, this._scene, undefined, [
                "depthPeelingDepth1MRT_depth",
                "depthPeelingDepth1MRT_frontColor",
                "depthPeelingDepth1MRT_backColor",
            ]),
        ];
        this._colorMrts = [
            new MultiRenderTarget("depthPeelingColor0MRT", size, 2, this._scene, { generateDepthBuffer: false }, [
                "depthPeelingColor0MRT_frontColor",
                "depthPeelingColor0MRT_backColor",
            ]),
            new MultiRenderTarget("depthPeelingColor1MRT", size, 2, this._scene, { generateDepthBuffer: false }, [
                "depthPeelingColor1MRT_frontColor",
                "depthPeelingColor1MRT_backColor",
            ]),
        ];
        this._blendBackMrt = new MultiRenderTarget("depthPeelingBackMRT", size, 1, this._scene, { generateDepthBuffer: false }, ["depthPeelingBackMRT_blendBack"]);
        this._outputRT = new Textures_renderTargetTexture/* RenderTargetTexture */.$("depthPeelingOutputRTT", size, this._scene, false);
        // 0 is a depth texture
        // 1 is a color texture
        const optionsArray = [
            {
                format: 7, // For MSAA we need RGBA
                samplingMode: 1,
                type: this._engine.getCaps().textureFloatLinearFiltering ? 1 : 2,
                label: "DepthPeelingRenderer-DepthTexture",
            },
            {
                format: 5,
                samplingMode: 1,
                type: 2, // For MSAA we need FLOAT
                label: "DepthPeelingRenderer-ColorTexture",
            },
        ];
        for (let i = 0; i < 2; i++) {
            const depthTexture = this._engine._createInternalTexture(size, optionsArray[0], false);
            const frontColorTexture = this._engine._createInternalTexture(size, optionsArray[1], false);
            const backColorTexture = this._engine._createInternalTexture(size, optionsArray[1], false);
            this._depthMrts[i].setInternalTexture(depthTexture, 0);
            this._depthMrts[i].setInternalTexture(frontColorTexture, 1);
            this._depthMrts[i].setInternalTexture(backColorTexture, 2);
            this._colorMrts[i].setInternalTexture(frontColorTexture, 0);
            this._colorMrts[i].setInternalTexture(backColorTexture, 1);
            this._thinTextures.push(new thinTexture/* ThinTexture */.D(depthTexture), new thinTexture/* ThinTexture */.D(frontColorTexture), new thinTexture/* ThinTexture */.D(backColorTexture));
        }
    }
    // TODO : explore again MSAA with depth peeling when
    // we are able to fetch individual samples in a multisampled renderbuffer
    // public set samples(value: number) {
    //     for (let i = 0; i < 2; i++) {
    //         this._depthMrts[i].samples = value;
    //         this._colorMrts[i].samples = value;
    //     }
    //     this._scene.prePassRenderer!.samples = value;
    // }
    _disposeTextures() {
        for (let i = 0; i < this._thinTextures.length; i++) {
            if (i === 6) {
                // Do not dispose the shared texture with the prepass
                continue;
            }
            this._thinTextures[i].dispose();
        }
        for (let i = 0; i < 2; i++) {
            this._depthMrts[i].dispose(true);
            this._colorMrts[i].dispose(true);
            this._blendBackMrt.dispose(true);
        }
        this._outputRT.dispose();
        this._thinTextures = [];
        this._colorMrts = [];
        this._depthMrts = [];
    }
    _updateTextures() {
        if (this._depthMrts[0].getSize().width !== this._engine.getRenderWidth() || this._depthMrts[0].getSize().height !== this._engine.getRenderHeight()) {
            this._disposeTextures();
            this._createTextures();
        }
        return this._updateTextureReferences();
    }
    _updateTextureReferences() {
        const prePassRenderer = this._scene.prePassRenderer;
        if (!prePassRenderer) {
            return false;
        }
        // Retrieve opaque color texture
        const textureIndex = prePassRenderer.getIndex(4);
        const prePassTexture = prePassRenderer.defaultRT.textures?.length ? prePassRenderer.defaultRT.textures[textureIndex].getInternalTexture() : null;
        if (!prePassTexture) {
            return false;
        }
        if (this._blendBackTexture !== prePassTexture) {
            this._blendBackTexture = prePassTexture;
            this._blendBackMrt.setInternalTexture(this._blendBackTexture, 0);
            if (this._thinTextures[6]) {
                this._thinTextures[6].dispose();
            }
            this._thinTextures[6] = new thinTexture/* ThinTexture */.D(this._blendBackTexture);
            prePassRenderer.defaultRT.renderTarget.shareDepth(this._depthMrts[0].renderTarget);
        }
        return true;
    }
    _createEffects() {
        this._blendBackEffectWrapper = new effectRenderer/* EffectWrapper */.$({
            fragmentShader: "oitBackBlend",
            useShaderStore: true,
            engine: this._engine,
            samplerNames: ["uBackColor"],
            uniformNames: [],
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: async () => {
                if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 47312));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 20449));
                }
            },
        });
        this._blendBackEffectWrapperPingPong = new effectRenderer/* EffectWrapper */.$({
            fragmentShader: "oitBackBlend",
            useShaderStore: true,
            engine: this._engine,
            samplerNames: ["uBackColor"],
            uniformNames: [],
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: async () => {
                if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 47312));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 20449));
                }
            },
        });
        this._finalEffectWrapper = new effectRenderer/* EffectWrapper */.$({
            fragmentShader: "oitFinal",
            useShaderStore: true,
            engine: this._engine,
            samplerNames: ["uFrontColor", "uBackColor"],
            uniformNames: [],
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: async () => {
                if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 14958));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 19015));
                }
            },
        });
        this._effectRenderer = new effectRenderer/* EffectRenderer */.J(this._engine);
    }
    /**
     * Links to the prepass renderer
     * @param prePassRenderer The scene PrePassRenderer
     */
    setPrePassRenderer(prePassRenderer) {
        prePassRenderer.addEffectConfiguration(this._prePassEffectConfiguration);
    }
    /**
     * Binds depth peeling textures on an effect
     * @param effect The effect to bind textures on
     */
    bind(effect) {
        effect.setTexture("oitDepthSampler", this._thinTextures[this._currentPingPongState * 3]);
        effect.setTexture("oitFrontColorSampler", this._thinTextures[this._currentPingPongState * 3 + 1]);
    }
    _renderSubMeshes(transparentSubMeshes) {
        let mapMaterialContext;
        if (this._useRenderPasses) {
            mapMaterialContext = {};
        }
        for (let j = 0; j < transparentSubMeshes.length; j++) {
            const material = transparentSubMeshes.data[j].getMaterial();
            let previousShaderHotSwapping = true;
            let previousBFC = false;
            const subMesh = transparentSubMeshes.data[j];
            let drawWrapper;
            let firstDraw = false;
            if (this._useRenderPasses) {
                drawWrapper = subMesh._getDrawWrapper();
                firstDraw = !drawWrapper;
            }
            if (material) {
                previousShaderHotSwapping = material.allowShaderHotSwapping;
                previousBFC = material.backFaceCulling;
                material.allowShaderHotSwapping = false;
                material.backFaceCulling = false;
            }
            subMesh.render(false);
            if (firstDraw) {
                // first time we draw this submesh: we replace the material context
                drawWrapper = subMesh._getDrawWrapper(); // we are sure it is now non empty as we just rendered the submesh
                if (drawWrapper.materialContext) {
                    let newMaterialContext = mapMaterialContext[drawWrapper.materialContext.uniqueId];
                    if (!newMaterialContext) {
                        newMaterialContext = mapMaterialContext[drawWrapper.materialContext.uniqueId] = this._engine.createMaterialContext();
                    }
                    subMesh._getDrawWrapper().materialContext = newMaterialContext;
                }
            }
            if (material) {
                material.allowShaderHotSwapping = previousShaderHotSwapping;
                material.backFaceCulling = previousBFC;
            }
        }
    }
    _finalCompose(writeId) {
        const output = this._scene.prePassRenderer?.setCustomOutput(this._outputRT);
        if (output) {
            this._engine.bindFramebuffer(this._outputRT.renderTarget);
        }
        else {
            this._engine.restoreDefaultFramebuffer();
        }
        this._engine.setAlphaMode(0);
        this._engine.applyStates();
        this._engine.enableEffect(this._finalEffectWrapper.drawWrapper);
        this._finalEffectWrapper.effect.setTexture("uFrontColor", this._thinTextures[writeId * 3 + 1]);
        this._finalEffectWrapper.effect.setTexture("uBackColor", this._thinTextures[6]);
        this._effectRenderer.render(this._finalEffectWrapper);
    }
    /**
     * Checks if the depth peeling renderer is ready to render transparent meshes
     * @returns true if the depth peeling renderer is ready to render the transparent meshes
     */
    isReady() {
        return (this._blendBackEffectWrapper.effect.isReady() &&
            this._blendBackEffectWrapperPingPong.effect.isReady() &&
            this._finalEffectWrapper.effect.isReady() &&
            this._updateTextures());
    }
    /**
     * Renders transparent submeshes with depth peeling
     * @param transparentSubMeshes List of transparent meshes to render
     * @returns The array of submeshes that could not be handled by this renderer
     */
    render(transparentSubMeshes) {
        this._candidateSubMeshes.length = 0;
        this._excludedSubMeshes.length = 0;
        if (!this.isReady()) {
            return this._excludedSubMeshes;
        }
        if (this._scene.activeCamera) {
            this._engine.setViewport(this._scene.activeCamera.viewport);
        }
        for (let i = 0; i < transparentSubMeshes.length; i++) {
            const subMesh = transparentSubMeshes.data[i];
            const material = subMesh.getMaterial();
            const fillMode = material && subMesh.getRenderingMesh()._getRenderingFillMode(material.fillMode);
            if (material &&
                (fillMode === Materials_material/* Material */.i.TriangleFanDrawMode || fillMode === Materials_material/* Material */.i.TriangleFillMode || fillMode === Materials_material/* Material */.i.TriangleStripDrawMode) &&
                this._excludedMeshes.indexOf(subMesh.getMesh().uniqueId) === -1) {
                this._candidateSubMeshes.push(subMesh);
            }
            else {
                this._excludedSubMeshes.push(subMesh);
            }
        }
        if (!this._candidateSubMeshes.length) {
            this._engine.bindFramebuffer(this._colorMrts[1].renderTarget);
            this._engine.bindAttachments(this._layoutCache[1]);
            this._engine.clear(this._colorCache[2], true, false, false);
            this._engine.unBindFramebuffer(this._colorMrts[1].renderTarget);
            this._finalCompose(1);
            return this._excludedSubMeshes;
        }
        const currentRenderPassId = this._engine.currentRenderPassId;
        this._scene.prePassRenderer._enabled = false;
        if (this._useRenderPasses) {
            this._engine.currentRenderPassId = this._renderPassIds[0];
        }
        // Clears
        this._engine.bindFramebuffer(this._depthMrts[0].renderTarget);
        this._engine.bindAttachments(this._layoutCache[0]);
        this._engine.clear(this._colorCache[0], true, false, false);
        this._engine.unBindFramebuffer(this._depthMrts[0].renderTarget);
        this._engine.bindFramebuffer(this._depthMrts[1].renderTarget);
        this._engine.bindAttachments(this._layoutCache[0]);
        this._engine.clear(this._colorCache[1], true, false, false);
        this._engine.unBindFramebuffer(this._depthMrts[1].renderTarget);
        this._engine.bindFramebuffer(this._colorMrts[0].renderTarget);
        this._engine.bindAttachments(this._layoutCache[1]);
        this._engine.clear(this._colorCache[2], true, false, false);
        this._engine.unBindFramebuffer(this._colorMrts[0].renderTarget);
        this._engine.bindFramebuffer(this._colorMrts[1].renderTarget);
        this._engine.bindAttachments(this._layoutCache[1]);
        this._engine.clear(this._colorCache[2], true, false, false);
        this._engine.unBindFramebuffer(this._colorMrts[1].renderTarget);
        // Draw depth for first pass
        this._engine.bindFramebuffer(this._depthMrts[0].renderTarget);
        this._engine.bindAttachments(this._layoutCache[0]);
        this._engine.setAlphaMode(11); // in WebGPU, when using MIN or MAX equation, the src / dst color factors should not use SRC_ALPHA and the src / dst alpha factors must be 1 else WebGPU will throw a validation error
        this._engine.setAlphaEquation(3);
        this._engine.depthCullingState.depthMask = false;
        this._engine.depthCullingState.depthTest = true;
        this._engine.applyStates();
        this._currentPingPongState = 1;
        // Render
        this._renderSubMeshes(this._candidateSubMeshes);
        this._engine.unBindFramebuffer(this._depthMrts[0].renderTarget);
        this._scene.resetCachedMaterial();
        // depth peeling ping-pong
        let readId = 0;
        let writeId = 0;
        for (let i = 0; i < this._passCount; i++) {
            readId = i % 2;
            writeId = 1 - readId;
            this._currentPingPongState = readId;
            if (this._useRenderPasses) {
                this._engine.currentRenderPassId = this._renderPassIds[i + 1];
            }
            if (this._scene.activeCamera) {
                this._engine.setViewport(this._scene.activeCamera.viewport);
            }
            // Clears
            this._engine.bindFramebuffer(this._depthMrts[writeId].renderTarget);
            this._engine.bindAttachments(this._layoutCache[0]);
            this._engine.clear(this._colorCache[0], true, false, false);
            this._engine.unBindFramebuffer(this._depthMrts[writeId].renderTarget);
            this._engine.bindFramebuffer(this._colorMrts[writeId].renderTarget);
            this._engine.bindAttachments(this._layoutCache[1]);
            this._engine.clear(this._colorCache[2], true, false, false);
            this._engine.unBindFramebuffer(this._colorMrts[writeId].renderTarget);
            this._engine.bindFramebuffer(this._depthMrts[writeId].renderTarget);
            this._engine.bindAttachments(this._layoutCache[2]);
            this._engine.setAlphaMode(11); // the value does not matter (as MAX operation does not use them) but the src and dst color factors should not use SRC_ALPHA else WebGPU will throw a validation error
            this._engine.setAlphaEquation(3);
            this._engine.depthCullingState.depthTest = false;
            this._engine.applyStates();
            // Render
            this._renderSubMeshes(this._candidateSubMeshes);
            this._engine.unBindFramebuffer(this._depthMrts[writeId].renderTarget);
            this._scene.resetCachedMaterial();
            // Back color
            this._engine.bindFramebuffer(this._blendBackMrt.renderTarget);
            this._engine.bindAttachments(this._layoutCache[0]);
            this._engine.setAlphaEquation(0);
            this._engine.setAlphaMode(17);
            this._engine.applyStates();
            const blendBackEffectWrapper = writeId === 0 || !this._useRenderPasses ? this._blendBackEffectWrapper : this._blendBackEffectWrapperPingPong;
            this._engine.enableEffect(blendBackEffectWrapper.drawWrapper);
            blendBackEffectWrapper.effect.setTexture("uBackColor", this._thinTextures[writeId * 3 + 2]);
            this._effectRenderer.render(blendBackEffectWrapper);
            this._engine.unBindFramebuffer(this._blendBackMrt.renderTarget);
        }
        this._engine.currentRenderPassId = currentRenderPassId;
        // Final composition on default FB
        this._finalCompose(writeId);
        this._scene.prePassRenderer._enabled = true;
        this._engine.depthCullingState.depthMask = true;
        this._engine.depthCullingState.depthTest = true;
        return this._excludedSubMeshes;
    }
    /**
     * Disposes the depth peeling renderer and associated ressources
     */
    dispose() {
        this._disposeTextures();
        this._blendBackEffectWrapper.dispose();
        this._finalEffectWrapper.dispose();
        this._effectRenderer.dispose();
        this._releaseRenderPassIds();
    }
}
DepthPeelingRenderer._DEPTH_CLEAR_VALUE = -99999.0;
DepthPeelingRenderer._MIN_DEPTH = 0;
DepthPeelingRenderer._MAX_DEPTH = 1;
//# sourceMappingURL=depthPeelingRenderer.js.map
;// ./node_modules/@babylonjs/core/Rendering/depthPeelingSceneComponent.js




Object.defineProperty(core_scene/* Scene */.Z.prototype, "depthPeelingRenderer", {
    get: function () {
        if (!this._depthPeelingRenderer) {
            let component = this._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_DEPTHPEELINGRENDERER);
            if (!component) {
                component = new DepthPeelingSceneComponent(this);
                this._addComponent(component);
            }
        }
        return this._depthPeelingRenderer;
    },
    set: function (value) {
        this._depthPeelingRenderer = value;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(core_scene/* Scene */.Z.prototype, "useOrderIndependentTransparency", {
    get: function () {
        return this._useOrderIndependentTransparency;
    },
    set: function (value) {
        if (this._useOrderIndependentTransparency === value) {
            return;
        }
        this._useOrderIndependentTransparency = value;
        this.markAllMaterialsAsDirty(63);
        this.prePassRenderer?.markAsDirty();
    },
    enumerable: true,
    configurable: true,
});
/**
 * Scene component to render order independent transparency with depth peeling
 */
class DepthPeelingSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_DEPTHPEELINGRENDERER;
        this.scene = scene;
        scene.depthPeelingRenderer = new DepthPeelingRenderer(scene);
    }
    /**
     * Registers the component in a given scene
     */
    register() { }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() { }
    /**
     * Disposes the component and the associated resources.
     */
    dispose() {
        this.scene.depthPeelingRenderer?.dispose();
        this.scene.depthPeelingRenderer = null;
    }
}
//# sourceMappingURL=depthPeelingSceneComponent.js.map
;// ./node_modules/@babylonjs/core/Rendering/edgesRenderer.js










abstractMesh/* AbstractMesh */.u.prototype.disableEdgesRendering = function () {
    if (this._edgesRenderer) {
        this._edgesRenderer.dispose();
        this._edgesRenderer = null;
    }
    return this;
};
abstractMesh/* AbstractMesh */.u.prototype.enableEdgesRendering = function (epsilon = 0.95, checkVerticesInsteadOfIndices = false, options) {
    this.disableEdgesRendering();
    this._edgesRenderer = new EdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices, true, options);
    return this;
};
Object.defineProperty(abstractMesh/* AbstractMesh */.u.prototype, "edgesRenderer", {
    get: function () {
        return this._edgesRenderer;
    },
    enumerable: true,
    configurable: true,
});
linesMesh/* LinesMesh */.l.prototype.enableEdgesRendering = function (epsilon = 0.95, checkVerticesInsteadOfIndices = false) {
    this.disableEdgesRendering();
    this._edgesRenderer = new LineEdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices);
    return this;
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
linesMesh/* InstancedLinesMesh */.Q.prototype.enableEdgesRendering = function (epsilon = 0.95, checkVerticesInsteadOfIndices = false) {
    linesMesh/* LinesMesh */.l.prototype.enableEdgesRendering.apply(this, arguments);
    return this;
};
/**
 * FaceAdjacencies Helper class to generate edges
 */
class FaceAdjacencies {
    constructor() {
        this.edges = [];
        this.edgesConnectedCount = 0;
    }
}
/**
 * This class is used to generate edges of the mesh that could then easily be rendered in a scene.
 */
class EdgesRenderer {
    /** Gets the vertices generated by the edge renderer */
    get linesPositions() {
        return this._linesPositions;
    }
    /** Gets the normals generated by the edge renderer */
    get linesNormals() {
        return this._linesNormals;
    }
    /** Gets the indices generated by the edge renderer */
    get linesIndices() {
        return this._linesIndices;
    }
    /**
     * Gets or sets the shader used to draw the lines
     */
    get lineShader() {
        return this._lineShader;
    }
    set lineShader(shader) {
        this._lineShader = shader;
    }
    static _GetShader(scene, shaderLanguage) {
        if (!scene._edgeRenderLineShader) {
            const shader = new shaderMaterial/* ShaderMaterial */.B("lineShader", scene, "line", {
                attributes: ["position", "normal"],
                uniforms: ["world", "viewProjection", "color", "width", "aspectRatio"],
                uniformBuffers: ["Scene", "Mesh"],
                shaderLanguage: shaderLanguage,
                extraInitializationsAsync: async () => {
                    if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 80574)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85264))]);
                    }
                    else {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 26149)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 861))]);
                    }
                },
            }, false);
            shader.disableDepthWrite = true;
            shader.backFaceCulling = false;
            shader.checkReadyOnEveryCall = scene.getEngine().isWebGPU;
            scene._edgeRenderLineShader = shader;
        }
        return scene._edgeRenderLineShader;
    }
    /**
     * Gets the shader language used.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Creates an instance of the EdgesRenderer. It is primarily use to display edges of a mesh.
     * Beware when you use this class with complex objects as the adjacencies computation can be really long
     * @param  source Mesh used to create edges
     * @param  epsilon sum of angles in adjacency to check for edge
     * @param  checkVerticesInsteadOfIndices bases the edges detection on vertices vs indices. Note that this parameter is not used if options.useAlternateEdgeFinder = true
     * @param  generateEdgesLines - should generate Lines or only prepare resources.
     * @param  options The options to apply when generating the edges
     */
    constructor(source, epsilon = 0.95, checkVerticesInsteadOfIndices = false, generateEdgesLines = true, options) {
        /**
         * Define the size of the edges with an orthographic camera
         */
        this.edgesWidthScalerForOrthographic = 1000.0;
        /**
         * Define the size of the edges with a perspective camera
         */
        this.edgesWidthScalerForPerspective = 50.0;
        this._linesPositions = new Array();
        this._linesNormals = new Array();
        this._linesIndices = new Array();
        this._buffers = {};
        this._buffersForInstances = {};
        this._checkVerticesInsteadOfIndices = false;
        /** Gets or sets a boolean indicating if the edgesRenderer is active */
        this.isEnabled = true;
        /**
         * List of instances to render in case the source mesh has instances
         */
        this.customInstances = new smartArray/* SmartArray */.L(32);
        /** Shader language used*/
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._source = source;
        this._checkVerticesInsteadOfIndices = checkVerticesInsteadOfIndices;
        this._options = options ?? null;
        this._epsilon = epsilon;
        const engine = this._source.getScene().getEngine();
        if (engine.isWebGPU) {
            this._drawWrapper = new Materials_drawWrapper/* DrawWrapper */.E(engine);
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
        this._prepareRessources();
        if (generateEdgesLines) {
            if (options?.useAlternateEdgeFinder ?? true) {
                this._generateEdgesLinesAlternate();
            }
            else {
                this._generateEdgesLines();
            }
        }
        this._meshRebuildObserver = this._source.onRebuildObservable.add(() => {
            this._rebuild();
        });
        this._meshDisposeObserver = this._source.onDisposeObservable.add(() => {
            this.dispose();
        });
    }
    _prepareRessources() {
        if (this._lineShader) {
            return;
        }
        this._lineShader = EdgesRenderer._GetShader(this._source.getScene(), this._shaderLanguage);
    }
    /** @internal */
    _rebuild() {
        let buffer = this._buffers[Buffers_buffer/* VertexBuffer */.R.PositionKind];
        if (buffer) {
            buffer._rebuild();
        }
        buffer = this._buffers[Buffers_buffer/* VertexBuffer */.R.NormalKind];
        if (buffer) {
            buffer._rebuild();
        }
        const scene = this._source.getScene();
        const engine = scene.getEngine();
        this._ib = engine.createIndexBuffer(this._linesIndices);
    }
    /**
     * Releases the required resources for the edges renderer
     */
    dispose() {
        this._source.onRebuildObservable.remove(this._meshRebuildObserver);
        this._source.onDisposeObservable.remove(this._meshDisposeObserver);
        let buffer = this._buffers[Buffers_buffer/* VertexBuffer */.R.PositionKind];
        if (buffer) {
            buffer.dispose();
            this._buffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = null;
        }
        buffer = this._buffers[Buffers_buffer/* VertexBuffer */.R.NormalKind];
        if (buffer) {
            buffer.dispose();
            this._buffers[Buffers_buffer/* VertexBuffer */.R.NormalKind] = null;
        }
        if (this._ib) {
            this._source.getScene().getEngine()._releaseBuffer(this._ib);
        }
        this._lineShader.dispose();
        this._drawWrapper?.dispose();
    }
    _processEdgeForAdjacencies(pa, pb, p0, p1, p2) {
        if ((pa === p0 && pb === p1) || (pa === p1 && pb === p0)) {
            return 0;
        }
        if ((pa === p1 && pb === p2) || (pa === p2 && pb === p1)) {
            return 1;
        }
        if ((pa === p2 && pb === p0) || (pa === p0 && pb === p2)) {
            return 2;
        }
        return -1;
    }
    _processEdgeForAdjacenciesWithVertices(pa, pb, p0, p1, p2) {
        const eps = 1e-10;
        if ((pa.equalsWithEpsilon(p0, eps) && pb.equalsWithEpsilon(p1, eps)) || (pa.equalsWithEpsilon(p1, eps) && pb.equalsWithEpsilon(p0, eps))) {
            return 0;
        }
        if ((pa.equalsWithEpsilon(p1, eps) && pb.equalsWithEpsilon(p2, eps)) || (pa.equalsWithEpsilon(p2, eps) && pb.equalsWithEpsilon(p1, eps))) {
            return 1;
        }
        if ((pa.equalsWithEpsilon(p2, eps) && pb.equalsWithEpsilon(p0, eps)) || (pa.equalsWithEpsilon(p0, eps) && pb.equalsWithEpsilon(p2, eps))) {
            return 2;
        }
        return -1;
    }
    /**
     * Checks if the pair of p0 and p1 is en edge
     * @param faceIndex
     * @param edge
     * @param faceNormals
     * @param  p0
     * @param  p1
     * @private
     */
    _checkEdge(faceIndex, edge, faceNormals, p0, p1) {
        let needToCreateLine;
        if (edge === undefined) {
            needToCreateLine = true;
        }
        else {
            const dotProduct = math_vector/* Vector3 */.Pq.Dot(faceNormals[faceIndex], faceNormals[edge]);
            needToCreateLine = dotProduct < this._epsilon;
        }
        if (needToCreateLine) {
            this.createLine(p0, p1, this._linesPositions.length / 3);
        }
    }
    /**
     * push line into the position, normal and index buffer
     * @param p0
     * @param p1
     * @param offset
     * @protected
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    createLine(p0, p1, offset) {
        // Positions
        this._linesPositions.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z, p1.x, p1.y, p1.z, p1.x, p1.y, p1.z);
        // Normals
        this._linesNormals.push(p1.x, p1.y, p1.z, -1, p1.x, p1.y, p1.z, 1, p0.x, p0.y, p0.z, -1, p0.x, p0.y, p0.z, 1);
        // Indices
        this._linesIndices.push(offset, offset + 1, offset + 2, offset, offset + 2, offset + 3);
    }
    /**
     * See https://playground.babylonjs.com/#R3JR6V#1 for a visual display of the algorithm
     * @param edgePoints
     * @param indexTriangle
     * @param indices
     * @param remapVertexIndices
     */
    _tessellateTriangle(edgePoints, indexTriangle, indices, remapVertexIndices) {
        const makePointList = (edgePoints, pointIndices, firstIndex) => {
            if (firstIndex >= 0) {
                pointIndices.push(firstIndex);
            }
            for (let i = 0; i < edgePoints.length; ++i) {
                pointIndices.push(edgePoints[i][0]);
            }
        };
        let startEdge = 0;
        if (edgePoints[1].length >= edgePoints[0].length && edgePoints[1].length >= edgePoints[2].length) {
            startEdge = 1;
        }
        else if (edgePoints[2].length >= edgePoints[0].length && edgePoints[2].length >= edgePoints[1].length) {
            startEdge = 2;
        }
        for (let e = 0; e < 3; ++e) {
            if (e === startEdge) {
                edgePoints[e].sort((a, b) => (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0));
            }
            else {
                edgePoints[e].sort((a, b) => (a[1] > b[1] ? -1 : a[1] < b[1] ? 1 : 0));
            }
        }
        const mainPointIndices = [], otherPointIndices = [];
        makePointList(edgePoints[startEdge], mainPointIndices, -1);
        const numMainPoints = mainPointIndices.length;
        for (let i = startEdge + 2; i >= startEdge + 1; --i) {
            makePointList(edgePoints[i % 3], otherPointIndices, i !== startEdge + 2 ? remapVertexIndices[indices[indexTriangle + ((i + 1) % 3)]] : -1);
        }
        const numOtherPoints = otherPointIndices.length;
        const idxMain = 0;
        const idxOther = 0;
        indices.push(remapVertexIndices[indices[indexTriangle + startEdge]], mainPointIndices[0], otherPointIndices[0]);
        indices.push(remapVertexIndices[indices[indexTriangle + ((startEdge + 1) % 3)]], otherPointIndices[numOtherPoints - 1], mainPointIndices[numMainPoints - 1]);
        const bucketIsMain = numMainPoints <= numOtherPoints;
        const bucketStep = bucketIsMain ? numMainPoints : numOtherPoints;
        const bucketLimit = bucketIsMain ? numOtherPoints : numMainPoints;
        const bucketIdxLimit = bucketIsMain ? numMainPoints - 1 : numOtherPoints - 1;
        const winding = bucketIsMain ? 0 : 1;
        let numTris = numMainPoints + numOtherPoints - 2;
        let bucketIdx = bucketIsMain ? idxMain : idxOther;
        let nbucketIdx = bucketIsMain ? idxOther : idxMain;
        const bucketPoints = bucketIsMain ? mainPointIndices : otherPointIndices;
        const nbucketPoints = bucketIsMain ? otherPointIndices : mainPointIndices;
        let bucket = 0;
        while (numTris-- > 0) {
            if (winding) {
                indices.push(bucketPoints[bucketIdx], nbucketPoints[nbucketIdx]);
            }
            else {
                indices.push(nbucketPoints[nbucketIdx], bucketPoints[bucketIdx]);
            }
            bucket += bucketStep;
            let lastIdx;
            if (bucket >= bucketLimit && bucketIdx < bucketIdxLimit) {
                lastIdx = bucketPoints[++bucketIdx];
                bucket -= bucketLimit;
            }
            else {
                lastIdx = nbucketPoints[++nbucketIdx];
            }
            indices.push(lastIdx);
        }
        indices[indexTriangle + 0] = indices[indices.length - 3];
        indices[indexTriangle + 1] = indices[indices.length - 2];
        indices[indexTriangle + 2] = indices[indices.length - 1];
        indices.length = indices.length - 3;
    }
    _generateEdgesLinesAlternate() {
        const positions = this._source.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        let indices = this._source.getIndices();
        if (!indices || !positions) {
            return;
        }
        if (!Array.isArray(indices)) {
            indices = Array.from(indices);
        }
        /**
         * Find all vertices that are at the same location (with an epsilon) and remapp them on the same vertex
         */
        const useFastVertexMerger = this._options?.useFastVertexMerger ?? true;
        const epsVertexMerge = useFastVertexMerger ? Math.round(-Math.log(this._options?.epsilonVertexMerge ?? 1e-6) / Math.log(10)) : (this._options?.epsilonVertexMerge ?? 1e-6);
        const remapVertexIndices = [];
        const uniquePositions = []; // list of unique index of vertices - needed for tessellation
        if (useFastVertexMerger) {
            const mapVertices = {};
            for (let v1 = 0; v1 < positions.length; v1 += 3) {
                const x1 = positions[v1 + 0], y1 = positions[v1 + 1], z1 = positions[v1 + 2];
                const key = x1.toFixed(epsVertexMerge) + "|" + y1.toFixed(epsVertexMerge) + "|" + z1.toFixed(epsVertexMerge);
                if (mapVertices[key] !== undefined) {
                    remapVertexIndices.push(mapVertices[key]);
                }
                else {
                    const idx = v1 / 3;
                    mapVertices[key] = idx;
                    remapVertexIndices.push(idx);
                    uniquePositions.push(idx);
                }
            }
        }
        else {
            for (let v1 = 0; v1 < positions.length; v1 += 3) {
                const x1 = positions[v1 + 0], y1 = positions[v1 + 1], z1 = positions[v1 + 2];
                let found = false;
                for (let v2 = 0; v2 < v1 && !found; v2 += 3) {
                    const x2 = positions[v2 + 0], y2 = positions[v2 + 1], z2 = positions[v2 + 2];
                    if (Math.abs(x1 - x2) < epsVertexMerge && Math.abs(y1 - y2) < epsVertexMerge && Math.abs(z1 - z2) < epsVertexMerge) {
                        remapVertexIndices.push(v2 / 3);
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    remapVertexIndices.push(v1 / 3);
                    uniquePositions.push(v1 / 3);
                }
            }
        }
        if (this._options?.applyTessellation) {
            /**
             * Tessellate triangles if necessary:
             *
             *               A
             *               +
             *               |\
             *               | \
             *               |  \
             *             E +   \
             *              /|    \
             *             / |     \
             *            /  |      \
             *           +---+-------+ B
             *           D   C
             *
             * For the edges to be rendered correctly, the ABC triangle has to be split into ABE and BCE, else AC is considered to be an edge, whereas only AE should be.
             *
             * The tessellation process looks for the vertices like E that are in-between two other vertices making of an edge and create new triangles as necessary
             */
            // First step: collect the triangles to tessellate
            const epsVertexAligned = this._options?.epsilonVertexAligned ?? 1e-6;
            const mustTesselate = []; // liste of triangles that must be tessellated
            for (let index = 0; index < indices.length; index += 3) {
                // loop over all triangles
                let triangleToTessellate;
                for (let i = 0; i < 3; ++i) {
                    // loop over the 3 edges of the triangle
                    const p0Index = remapVertexIndices[indices[index + i]];
                    const p1Index = remapVertexIndices[indices[index + ((i + 1) % 3)]];
                    const p2Index = remapVertexIndices[indices[index + ((i + 2) % 3)]];
                    if (p0Index === p1Index) {
                        continue;
                    } // degenerated triangle - don't process
                    const p0x = positions[p0Index * 3 + 0], p0y = positions[p0Index * 3 + 1], p0z = positions[p0Index * 3 + 2];
                    const p1x = positions[p1Index * 3 + 0], p1y = positions[p1Index * 3 + 1], p1z = positions[p1Index * 3 + 2];
                    const p0p1 = Math.sqrt((p1x - p0x) * (p1x - p0x) + (p1y - p0y) * (p1y - p0y) + (p1z - p0z) * (p1z - p0z));
                    for (let v = 0; v < uniquePositions.length - 1; v++) {
                        // loop over all (unique) vertices and look for the ones that would be in-between p0 and p1
                        const vIndex = uniquePositions[v];
                        if (vIndex === p0Index || vIndex === p1Index || vIndex === p2Index) {
                            continue;
                        } // don't handle the vertex if it is a vertex of the current triangle
                        const x = positions[vIndex * 3 + 0], y = positions[vIndex * 3 + 1], z = positions[vIndex * 3 + 2];
                        const p0p = Math.sqrt((x - p0x) * (x - p0x) + (y - p0y) * (y - p0y) + (z - p0z) * (z - p0z));
                        const pp1 = Math.sqrt((x - p1x) * (x - p1x) + (y - p1y) * (y - p1y) + (z - p1z) * (z - p1z));
                        if (Math.abs(p0p + pp1 - p0p1) < epsVertexAligned) {
                            // vertices are aligned and p in-between p0 and p1 if distance(p0, p) + distance (p, p1) ~ distance(p0, p1)
                            if (!triangleToTessellate) {
                                triangleToTessellate = {
                                    index: index,
                                    edgesPoints: [[], [], []],
                                };
                                mustTesselate.push(triangleToTessellate);
                            }
                            triangleToTessellate.edgesPoints[i].push([vIndex, p0p]);
                        }
                    }
                }
            }
            // Second step: tesselate the triangles
            for (let t = 0; t < mustTesselate.length; ++t) {
                const triangle = mustTesselate[t];
                this._tessellateTriangle(triangle.edgesPoints, triangle.index, indices, remapVertexIndices);
            }
            mustTesselate.length = 0;
        }
        /**
         * Collect the edges to render
         */
        const edges = {};
        for (let index = 0; index < indices.length; index += 3) {
            let faceNormal;
            for (let i = 0; i < 3; ++i) {
                let p0Index = remapVertexIndices[indices[index + i]];
                let p1Index = remapVertexIndices[indices[index + ((i + 1) % 3)]];
                const p2Index = remapVertexIndices[indices[index + ((i + 2) % 3)]];
                if (p0Index === p1Index || ((p0Index === p2Index || p1Index === p2Index) && this._options?.removeDegeneratedTriangles)) {
                    continue;
                }
                math_vector/* TmpVectors */.AA.Vector3[0].copyFromFloats(positions[p0Index * 3 + 0], positions[p0Index * 3 + 1], positions[p0Index * 3 + 2]);
                math_vector/* TmpVectors */.AA.Vector3[1].copyFromFloats(positions[p1Index * 3 + 0], positions[p1Index * 3 + 1], positions[p1Index * 3 + 2]);
                math_vector/* TmpVectors */.AA.Vector3[2].copyFromFloats(positions[p2Index * 3 + 0], positions[p2Index * 3 + 1], positions[p2Index * 3 + 2]);
                if (!faceNormal) {
                    math_vector/* TmpVectors */.AA.Vector3[1].subtractToRef(math_vector/* TmpVectors */.AA.Vector3[0], math_vector/* TmpVectors */.AA.Vector3[3]);
                    math_vector/* TmpVectors */.AA.Vector3[2].subtractToRef(math_vector/* TmpVectors */.AA.Vector3[1], math_vector/* TmpVectors */.AA.Vector3[4]);
                    faceNormal = math_vector/* Vector3 */.Pq.Cross(math_vector/* TmpVectors */.AA.Vector3[3], math_vector/* TmpVectors */.AA.Vector3[4]);
                    faceNormal.normalize();
                }
                if (p0Index > p1Index) {
                    const tmp = p0Index;
                    p0Index = p1Index;
                    p1Index = tmp;
                }
                const key = p0Index + "_" + p1Index;
                const ei = edges[key];
                if (ei) {
                    if (!ei.done) {
                        const dotProduct = math_vector/* Vector3 */.Pq.Dot(faceNormal, ei.normal);
                        if (dotProduct < this._epsilon) {
                            this.createLine(math_vector/* TmpVectors */.AA.Vector3[0], math_vector/* TmpVectors */.AA.Vector3[1], this._linesPositions.length / 3);
                        }
                        ei.done = true;
                    }
                }
                else {
                    edges[key] = { normal: faceNormal, done: false, index: index, i: i };
                }
            }
        }
        for (const key in edges) {
            const ei = edges[key];
            if (!ei.done) {
                // Orphaned edge - we must display it
                const p0Index = remapVertexIndices[indices[ei.index + ei.i]];
                const p1Index = remapVertexIndices[indices[ei.index + ((ei.i + 1) % 3)]];
                math_vector/* TmpVectors */.AA.Vector3[0].copyFromFloats(positions[p0Index * 3 + 0], positions[p0Index * 3 + 1], positions[p0Index * 3 + 2]);
                math_vector/* TmpVectors */.AA.Vector3[1].copyFromFloats(positions[p1Index * 3 + 0], positions[p1Index * 3 + 1], positions[p1Index * 3 + 2]);
                this.createLine(math_vector/* TmpVectors */.AA.Vector3[0], math_vector/* TmpVectors */.AA.Vector3[1], this._linesPositions.length / 3);
            }
        }
        /**
         * Merge into a single mesh
         */
        const engine = this._source.getScene().getEngine();
        this._buffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = new Buffers_buffer/* VertexBuffer */.R(engine, this._linesPositions, Buffers_buffer/* VertexBuffer */.R.PositionKind, false);
        this._buffers[Buffers_buffer/* VertexBuffer */.R.NormalKind] = new Buffers_buffer/* VertexBuffer */.R(engine, this._linesNormals, Buffers_buffer/* VertexBuffer */.R.NormalKind, false, false, 4);
        this._buffersForInstances[Buffers_buffer/* VertexBuffer */.R.PositionKind] = this._buffers[Buffers_buffer/* VertexBuffer */.R.PositionKind];
        this._buffersForInstances[Buffers_buffer/* VertexBuffer */.R.NormalKind] = this._buffers[Buffers_buffer/* VertexBuffer */.R.NormalKind];
        this._ib = engine.createIndexBuffer(this._linesIndices);
        this._indicesCount = this._linesIndices.length;
    }
    /**
     * Generates lines edges from adjacencjes
     * @private
     */
    _generateEdgesLines() {
        const positions = this._source.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const indices = this._source.getIndices();
        if (!indices || !positions) {
            return;
        }
        // First let's find adjacencies
        const adjacencies = [];
        const faceNormals = [];
        let index;
        let faceAdjacencies;
        // Prepare faces
        for (index = 0; index < indices.length; index += 3) {
            faceAdjacencies = new FaceAdjacencies();
            const p0Index = indices[index];
            const p1Index = indices[index + 1];
            const p2Index = indices[index + 2];
            faceAdjacencies.p0 = new math_vector/* Vector3 */.Pq(positions[p0Index * 3], positions[p0Index * 3 + 1], positions[p0Index * 3 + 2]);
            faceAdjacencies.p1 = new math_vector/* Vector3 */.Pq(positions[p1Index * 3], positions[p1Index * 3 + 1], positions[p1Index * 3 + 2]);
            faceAdjacencies.p2 = new math_vector/* Vector3 */.Pq(positions[p2Index * 3], positions[p2Index * 3 + 1], positions[p2Index * 3 + 2]);
            const faceNormal = math_vector/* Vector3 */.Pq.Cross(faceAdjacencies.p1.subtract(faceAdjacencies.p0), faceAdjacencies.p2.subtract(faceAdjacencies.p1));
            faceNormal.normalize();
            faceNormals.push(faceNormal);
            adjacencies.push(faceAdjacencies);
        }
        // Scan
        for (index = 0; index < adjacencies.length; index++) {
            faceAdjacencies = adjacencies[index];
            for (let otherIndex = index + 1; otherIndex < adjacencies.length; otherIndex++) {
                const otherFaceAdjacencies = adjacencies[otherIndex];
                if (faceAdjacencies.edgesConnectedCount === 3) {
                    // Full
                    break;
                }
                if (otherFaceAdjacencies.edgesConnectedCount === 3) {
                    // Full
                    continue;
                }
                const otherP0 = indices[otherIndex * 3];
                const otherP1 = indices[otherIndex * 3 + 1];
                const otherP2 = indices[otherIndex * 3 + 2];
                for (let edgeIndex = 0; edgeIndex < 3; edgeIndex++) {
                    let otherEdgeIndex = 0;
                    if (faceAdjacencies.edges[edgeIndex] !== undefined) {
                        continue;
                    }
                    switch (edgeIndex) {
                        case 0:
                            if (this._checkVerticesInsteadOfIndices) {
                                otherEdgeIndex = this._processEdgeForAdjacenciesWithVertices(faceAdjacencies.p0, faceAdjacencies.p1, otherFaceAdjacencies.p0, otherFaceAdjacencies.p1, otherFaceAdjacencies.p2);
                            }
                            else {
                                otherEdgeIndex = this._processEdgeForAdjacencies(indices[index * 3], indices[index * 3 + 1], otherP0, otherP1, otherP2);
                            }
                            break;
                        case 1:
                            if (this._checkVerticesInsteadOfIndices) {
                                otherEdgeIndex = this._processEdgeForAdjacenciesWithVertices(faceAdjacencies.p1, faceAdjacencies.p2, otherFaceAdjacencies.p0, otherFaceAdjacencies.p1, otherFaceAdjacencies.p2);
                            }
                            else {
                                otherEdgeIndex = this._processEdgeForAdjacencies(indices[index * 3 + 1], indices[index * 3 + 2], otherP0, otherP1, otherP2);
                            }
                            break;
                        case 2:
                            if (this._checkVerticesInsteadOfIndices) {
                                otherEdgeIndex = this._processEdgeForAdjacenciesWithVertices(faceAdjacencies.p2, faceAdjacencies.p0, otherFaceAdjacencies.p0, otherFaceAdjacencies.p1, otherFaceAdjacencies.p2);
                            }
                            else {
                                otherEdgeIndex = this._processEdgeForAdjacencies(indices[index * 3 + 2], indices[index * 3], otherP0, otherP1, otherP2);
                            }
                            break;
                    }
                    if (otherEdgeIndex === -1) {
                        continue;
                    }
                    faceAdjacencies.edges[edgeIndex] = otherIndex;
                    otherFaceAdjacencies.edges[otherEdgeIndex] = index;
                    faceAdjacencies.edgesConnectedCount++;
                    otherFaceAdjacencies.edgesConnectedCount++;
                    if (faceAdjacencies.edgesConnectedCount === 3) {
                        break;
                    }
                }
            }
        }
        // Create lines
        for (index = 0; index < adjacencies.length; index++) {
            // We need a line when a face has no adjacency on a specific edge or if all the adjacencies has an angle greater than epsilon
            const current = adjacencies[index];
            this._checkEdge(index, current.edges[0], faceNormals, current.p0, current.p1);
            this._checkEdge(index, current.edges[1], faceNormals, current.p1, current.p2);
            this._checkEdge(index, current.edges[2], faceNormals, current.p2, current.p0);
        }
        // Merge into a single mesh
        const engine = this._source.getScene().getEngine();
        this._buffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = new Buffers_buffer/* VertexBuffer */.R(engine, this._linesPositions, Buffers_buffer/* VertexBuffer */.R.PositionKind, false);
        this._buffers[Buffers_buffer/* VertexBuffer */.R.NormalKind] = new Buffers_buffer/* VertexBuffer */.R(engine, this._linesNormals, Buffers_buffer/* VertexBuffer */.R.NormalKind, false, false, 4);
        this._buffersForInstances[Buffers_buffer/* VertexBuffer */.R.PositionKind] = this._buffers[Buffers_buffer/* VertexBuffer */.R.PositionKind];
        this._buffersForInstances[Buffers_buffer/* VertexBuffer */.R.NormalKind] = this._buffers[Buffers_buffer/* VertexBuffer */.R.NormalKind];
        this._ib = engine.createIndexBuffer(this._linesIndices);
        this._indicesCount = this._linesIndices.length;
    }
    /**
     * Checks whether or not the edges renderer is ready to render.
     * @returns true if ready, otherwise false.
     */
    isReady() {
        return this._lineShader.isReady(this._source, (this._source.hasInstances && this.customInstances.length > 0) || this._source.hasThinInstances);
    }
    /**
     * Renders the edges of the attached mesh,
     */
    render() {
        const scene = this._source.getScene();
        const currentDrawWrapper = this._lineShader._getDrawWrapper();
        if (this._drawWrapper) {
            this._lineShader._setDrawWrapper(this._drawWrapper);
        }
        if (!this.isReady() || !scene.activeCamera) {
            this._lineShader._setDrawWrapper(currentDrawWrapper);
            return;
        }
        const hasInstances = this._source.hasInstances && this.customInstances.length > 0;
        const useBuffersWithInstances = hasInstances || this._source.hasThinInstances;
        let instanceCount = 0;
        if (useBuffersWithInstances) {
            this._buffersForInstances["world0"] = this._source.getVertexBuffer("world0");
            this._buffersForInstances["world1"] = this._source.getVertexBuffer("world1");
            this._buffersForInstances["world2"] = this._source.getVertexBuffer("world2");
            this._buffersForInstances["world3"] = this._source.getVertexBuffer("world3");
            if (hasInstances) {
                const instanceStorage = this._source._instanceDataStorage;
                instanceCount = this.customInstances.length;
                if (!instanceStorage.instancesData) {
                    if (!this._source.getScene()._activeMeshesFrozen) {
                        this.customInstances.reset();
                    }
                    return;
                }
                if (!instanceStorage.isFrozen) {
                    let offset = 0;
                    for (let i = 0; i < instanceCount; ++i) {
                        this.customInstances.data[i].copyToArray(instanceStorage.instancesData, offset);
                        offset += 16;
                    }
                    instanceStorage.instancesBuffer.updateDirectly(instanceStorage.instancesData, 0, instanceCount);
                }
            }
            else {
                instanceCount = this._source.thinInstanceCount;
            }
        }
        const engine = scene.getEngine();
        this._lineShader._preBind();
        if (this._source.edgesColor.a !== 1) {
            engine.setAlphaMode(2);
        }
        else {
            engine.setAlphaMode(0);
        }
        // VBOs
        engine.bindBuffers(useBuffersWithInstances ? this._buffersForInstances : this._buffers, this._ib, this._lineShader.getEffect());
        scene.resetCachedMaterial();
        this._lineShader.setColor4("color", this._source.edgesColor);
        if (scene.activeCamera.mode === Cameras_camera/* Camera */.i.ORTHOGRAPHIC_CAMERA) {
            this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForOrthographic);
        }
        else {
            this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForPerspective);
        }
        this._lineShader.setFloat("aspectRatio", engine.getAspectRatio(scene.activeCamera));
        this._lineShader.bind(this._source.getWorldMatrix(), this._source);
        // Draw order
        engine.drawElementsType(Materials_material/* Material */.i.TriangleFillMode, 0, this._indicesCount, instanceCount);
        this._lineShader.unbind();
        if (useBuffersWithInstances) {
            engine.unbindInstanceAttributes();
        }
        if (!this._source.getScene()._activeMeshesFrozen) {
            this.customInstances.reset();
        }
        this._lineShader._setDrawWrapper(currentDrawWrapper);
    }
}
/**
 * LineEdgesRenderer for LineMeshes to remove unnecessary triangulation
 */
class LineEdgesRenderer extends EdgesRenderer {
    /**
     * This constructor turns off auto generating edges line in Edges Renderer to make it here.
     * @param  source LineMesh used to generate edges
     * @param  epsilon not important (specified angle for edge detection)
     * @param  checkVerticesInsteadOfIndices not important for LineMesh
     */
    constructor(source, epsilon = 0.95, checkVerticesInsteadOfIndices = false) {
        super(source, epsilon, checkVerticesInsteadOfIndices, false);
        this._generateEdgesLines();
    }
    /**
     * Generate edges for each line in LinesMesh. Every Line should be rendered as edge.
     */
    _generateEdgesLines() {
        const positions = this._source.getVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind);
        const indices = this._source.getIndices();
        if (!indices || !positions) {
            return;
        }
        const p0 = math_vector/* TmpVectors */.AA.Vector3[0];
        const p1 = math_vector/* TmpVectors */.AA.Vector3[1];
        const len = indices.length - 1;
        for (let i = 0, offset = 0; i < len; i += 2, offset += 4) {
            math_vector/* Vector3 */.Pq.FromArrayToRef(positions, 3 * indices[i], p0);
            math_vector/* Vector3 */.Pq.FromArrayToRef(positions, 3 * indices[i + 1], p1);
            this.createLine(p0, p1, offset);
        }
        // Merge into a single mesh
        const engine = this._source.getScene().getEngine();
        this._buffers[Buffers_buffer/* VertexBuffer */.R.PositionKind] = new Buffers_buffer/* VertexBuffer */.R(engine, this._linesPositions, Buffers_buffer/* VertexBuffer */.R.PositionKind, false);
        this._buffers[Buffers_buffer/* VertexBuffer */.R.NormalKind] = new Buffers_buffer/* VertexBuffer */.R(engine, this._linesNormals, Buffers_buffer/* VertexBuffer */.R.NormalKind, false, false, 4);
        this._ib = engine.createIndexBuffer(this._linesIndices);
        this._indicesCount = this._linesIndices.length;
    }
}
//# sourceMappingURL=edgesRenderer.js.map
;// ./node_modules/@babylonjs/core/Rendering/IBLShadows/iblShadowsVoxelRenderer.js












/**
 * Voxel-based shadow rendering for IBL's.
 * This should not be instanciated directly, as it is part of a scene component
 * @internal
 * #8R5SSE#222
 */
class _IblShadowsVoxelRenderer {
    /**
     * Return the voxel grid texture.
     * @returns The voxel grid texture.
     */
    getVoxelGrid() {
        if (this._triPlanarVoxelization) {
            return this._voxelGridRT;
        }
        else {
            return this._voxelGridZaxis;
        }
    }
    /**
     * The debug pass post process
     * @returns The debug pass post process
     */
    getDebugPassPP() {
        if (!this._voxelDebugPass) {
            this._createDebugPass();
        }
        return this._voxelDebugPass;
    }
    /**
     * Whether to use tri-planar voxelization. More expensive, but can help with artifacts.
     */
    get triPlanarVoxelization() {
        return this._triPlanarVoxelization;
    }
    /**
     * Whether to use tri-planar voxelization. More expensive, but can help with artifacts.
     */
    set triPlanarVoxelization(enabled) {
        if (this._triPlanarVoxelization === enabled) {
            return;
        }
        this._triPlanarVoxelization = enabled;
        this._disposeVoxelTextures();
        this._createTextures();
    }
    /**
     * Set the matrix to use for scaling the world space to voxel space
     * @param matrix The matrix to use for scaling the world space to voxel space
     */
    setWorldScaleMatrix(matrix) {
        this._invWorldScaleMatrix = matrix;
    }
    /**
     * @returns Whether voxelization is currently happening.
     */
    isVoxelizationInProgress() {
        return this._voxelizationInProgress;
    }
    /**
     * Resolution of the voxel grid. The final resolution will be 2^resolutionExp.
     */
    get voxelResolutionExp() {
        return this._voxelResolutionExp;
    }
    /**
     * Resolution of the voxel grid. The final resolution will be 2^resolutionExp.
     */
    set voxelResolutionExp(resolutionExp) {
        if (this._voxelResolutionExp === resolutionExp && this._voxelGridZaxis) {
            return;
        }
        this._voxelResolutionExp = Math.round(Math.min(Math.max(resolutionExp, 3), 9));
        this._voxelResolution = Math.pow(2.0, this._voxelResolutionExp);
        this._disposeVoxelTextures();
        this._createTextures();
    }
    /**
     * Shows only the voxels that were rendered along a particular axis (while using triPlanarVoxelization).
     * If not set, the combined voxel grid will be shown.
     * Note: This only works when the debugMipNumber is set to 0 because we don't generate mips for each axis.
     * @param axis The axis to show (0 = x, 1 = y, 2 = z)
     */
    set voxelDebugAxis(axis) {
        this._voxelDebugAxis = axis;
    }
    get voxelDebugAxis() {
        return this._voxelDebugAxis;
    }
    /**
     * Sets params that control the position and scaling of the debug display on the screen.
     * @param x Screen X offset of the debug display (0-1)
     * @param y Screen Y offset of the debug display (0-1)
     * @param widthScale X scale of the debug display (0-1)
     * @param heightScale Y scale of the debug display (0-1)
     */
    setDebugDisplayParams(x, y, widthScale, heightScale) {
        this._debugSizeParams.set(x, y, widthScale, heightScale);
    }
    /**
     * The mip level to show in the debug display
     * @param mipNum The mip level to show in the debug display
     */
    setDebugMipNumber(mipNum) {
        this._debugMipNumber = mipNum;
    }
    /**
     * Sets the name of the debug pass
     */
    get debugPassName() {
        return this._debugPassName;
    }
    /**
     * Enable or disable the debug view for this pass
     */
    get voxelDebugEnabled() {
        return this._voxelDebugEnabled;
    }
    set voxelDebugEnabled(enabled) {
        if (this._voxelDebugEnabled === enabled) {
            return;
        }
        this._voxelDebugEnabled = enabled;
        if (enabled) {
            this._voxelSlabDebugRT = new Textures_renderTargetTexture/* RenderTargetTexture */.$("voxelSlabDebug", { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, this._scene, {
                generateDepthBuffer: true,
                generateMipMaps: false,
                type: 0,
                format: 5,
                samplingMode: 1,
            });
            this._voxelSlabDebugRT.noPrePassRenderer = true;
        }
        if (this._voxelSlabDebugRT) {
            this._removeVoxelRTs([this._voxelSlabDebugRT]);
        }
        // Add the slab debug RT if needed.
        if (this._voxelDebugEnabled) {
            this._addRTsForRender([this._voxelSlabDebugRT], this._includedMeshes, this._voxelDebugAxis, 1, true);
            this._setDebugBindingsBound = this._setDebugBindings.bind(this);
            this._scene.onBeforeRenderObservable.add(this._setDebugBindingsBound);
        }
        else {
            this._scene.onBeforeRenderObservable.removeCallback(this._setDebugBindingsBound);
        }
    }
    /**
     * Creates the debug post process effect for this pass
     */
    _createDebugPass() {
        const isWebGPU = this._engine.isWebGPU;
        if (!this._voxelDebugPass) {
            const debugOptions = {
                width: this._engine.getRenderWidth(),
                height: this._engine.getRenderHeight(),
                textureFormat: 5,
                textureType: 0,
                samplingMode: 1,
                uniforms: ["sizeParams", "mipNumber"],
                samplers: ["voxelTexture", "voxelSlabTexture"],
                engine: this._engine,
                reusable: false,
                shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
                extraInitializations: (useWebGPU, list) => {
                    if (this._isVoxelGrid3D) {
                        if (useWebGPU) {
                            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 84237)));
                        }
                        else {
                            list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 96214)));
                        }
                        return;
                    }
                    if (useWebGPU) {
                        list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 17537)));
                    }
                    else {
                        list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 88188)));
                    }
                },
            };
            this._voxelDebugPass = new PostProcesses_postProcess/* PostProcess */.w(this.debugPassName, this._isVoxelGrid3D ? "iblVoxelGrid3dDebug" : "iblVoxelGrid2dArrayDebug", debugOptions);
            this._voxelDebugPass.onApplyObservable.add((effect) => {
                if (this._voxelDebugAxis === 0) {
                    effect.setTexture("voxelTexture", this._voxelGridXaxis);
                }
                else if (this._voxelDebugAxis === 1) {
                    effect.setTexture("voxelTexture", this._voxelGridYaxis);
                }
                else if (this._voxelDebugAxis === 2) {
                    effect.setTexture("voxelTexture", this._voxelGridZaxis);
                }
                else {
                    effect.setTexture("voxelTexture", this.getVoxelGrid());
                }
                effect.setTexture("voxelSlabTexture", this._voxelSlabDebugRT);
                effect.setVector4("sizeParams", this._debugSizeParams);
                effect.setFloat("mipNumber", this._debugMipNumber);
            });
        }
    }
    /**
     * Instanciates the voxel renderer
     * @param scene Scene to attach to
     * @param iblShadowsRenderPipeline The render pipeline this pass is associated with
     * @param resolutionExp Resolution of the voxel grid. The final resolution will be 2^resolutionExp.
     * @param triPlanarVoxelization Whether to use tri-planar voxelization. More expensive, but can help with artifacts.
     * @returns The voxel renderer
     */
    constructor(scene, iblShadowsRenderPipeline, resolutionExp = 6, triPlanarVoxelization = true) {
        this._voxelMrtsXaxis = [];
        this._voxelMrtsYaxis = [];
        this._voxelMrtsZaxis = [];
        this._isVoxelGrid3D = true;
        this._renderTargets = [];
        this._triPlanarVoxelization = true;
        this._voxelizationInProgress = false;
        this._invWorldScaleMatrix = math_vector/* Matrix */.uq.Identity();
        this._voxelResolution = 64;
        this._voxelResolutionExp = 6;
        this._mipArray = [];
        this._voxelDebugEnabled = false;
        this._voxelDebugAxis = -1;
        this._debugSizeParams = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this._includedMeshes = [];
        this._debugMipNumber = 0;
        this._debugPassName = "Voxelization Debug Pass";
        this._scene = scene;
        this._engine = scene.getEngine();
        this._triPlanarVoxelization = triPlanarVoxelization;
        if (!this._engine.getCaps().drawBuffersExtension) {
            logger/* Logger */.V.Error("Can't do voxel rendering without the draw buffers extension.");
        }
        const isWebGPU = this._engine.isWebGPU;
        this._maxDrawBuffers = this._engine.getCaps().maxDrawBuffers || 0;
        this._copyMipEffectRenderer = new effectRenderer/* EffectRenderer */.J(this._engine);
        this._copyMipEffectWrapper = new effectRenderer/* EffectWrapper */.$({
            engine: this._engine,
            fragmentShader: "copyTexture3DLayerToTexture",
            useShaderStore: true,
            uniformNames: ["layerNum"],
            samplerNames: ["textureSampler"],
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 95176));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 47383));
                }
            },
        });
        this.voxelResolutionExp = resolutionExp;
    }
    _generateMipMaps() {
        const iterations = Math.ceil(Math.log2(this._voxelResolution));
        for (let i = 1; i < iterations + 1; i++) {
            this._generateMipMap(i);
        }
    }
    _generateMipMap(lodLevel) {
        // Generate a mip map for the given level by triggering the render of the procedural mip texture.
        const mipTarget = this._mipArray[lodLevel - 1];
        if (!mipTarget) {
            return;
        }
        mipTarget.setTexture("srcMip", lodLevel === 1 ? this.getVoxelGrid() : this._mipArray[lodLevel - 2]);
        mipTarget.render();
    }
    _copyMipMaps() {
        const iterations = Math.ceil(Math.log2(this._voxelResolution));
        for (let i = 1; i < iterations + 1; i++) {
            this._copyMipMap(i);
        }
    }
    _copyMipMap(lodLevel) {
        // Now, copy this mip into the mip chain of the voxel grid.
        // TODO - this currently isn't working. "textureSampler" isn't being properly set to mipTarget.
        const mipTarget = this._mipArray[lodLevel - 1];
        if (!mipTarget) {
            return;
        }
        const voxelGrid = this.getVoxelGrid();
        let rt;
        if (voxelGrid instanceof Textures_renderTargetTexture/* RenderTargetTexture */.$ && voxelGrid.renderTarget) {
            rt = voxelGrid.renderTarget;
        }
        else {
            rt = voxelGrid._rtWrapper;
        }
        if (rt) {
            this._copyMipEffectRenderer.saveStates();
            const bindSize = mipTarget.getSize().width;
            // Render to each layer of the voxel grid.
            for (let layer = 0; layer < bindSize; layer++) {
                this._engine.bindFramebuffer(rt, 0, bindSize, bindSize, true, lodLevel, layer);
                this._copyMipEffectRenderer.applyEffectWrapper(this._copyMipEffectWrapper);
                this._copyMipEffectWrapper.effect.setTexture("textureSampler", mipTarget);
                this._copyMipEffectWrapper.effect.setInt("layerNum", layer);
                this._copyMipEffectRenderer.draw();
                this._engine.unBindFramebuffer(rt, true);
            }
            this._copyMipEffectRenderer.restoreStates();
        }
    }
    _computeNumberOfSlabs() {
        return Math.ceil(this._voxelResolution / this._maxDrawBuffers);
    }
    _createTextures() {
        const isWebGPU = this._engine.isWebGPU;
        const size = {
            width: this._voxelResolution,
            height: this._voxelResolution,
            layers: this._isVoxelGrid3D ? undefined : this._voxelResolution,
            depth: this._isVoxelGrid3D ? this._voxelResolution : undefined,
        };
        const voxelAxisOptions = {
            generateDepthBuffer: false,
            generateMipMaps: false,
            type: 0,
            format: 6,
            samplingMode: 1,
        };
        // We can render up to maxDrawBuffers voxel slices of the grid per render.
        // We call this a slab.
        const numSlabs = this._computeNumberOfSlabs();
        const voxelCombinedOptions = {
            generateDepthBuffer: false,
            generateMipMaps: true,
            type: 0,
            format: 6,
            samplingMode: 4,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 92199));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 18162));
                }
            },
        };
        if (this._triPlanarVoxelization) {
            this._voxelGridXaxis = new Textures_renderTargetTexture/* RenderTargetTexture */.$("voxelGridXaxis", size, this._scene, voxelAxisOptions);
            this._voxelGridYaxis = new Textures_renderTargetTexture/* RenderTargetTexture */.$("voxelGridYaxis", size, this._scene, voxelAxisOptions);
            this._voxelGridZaxis = new Textures_renderTargetTexture/* RenderTargetTexture */.$("voxelGridZaxis", size, this._scene, voxelAxisOptions);
            this._voxelMrtsXaxis = this._createVoxelMRTs("x_axis_", this._voxelGridXaxis, numSlabs);
            this._voxelMrtsYaxis = this._createVoxelMRTs("y_axis_", this._voxelGridYaxis, numSlabs);
            this._voxelMrtsZaxis = this._createVoxelMRTs("z_axis_", this._voxelGridZaxis, numSlabs);
            this._voxelGridRT = new ProceduralTexture("combinedVoxelGrid", size, "iblCombineVoxelGrids", this._scene, voxelCombinedOptions, false);
            this._scene.proceduralTextures.splice(this._scene.proceduralTextures.indexOf(this._voxelGridRT), 1);
            this._voxelGridRT.setFloat("layer", 0.0);
            this._voxelGridRT.setTexture("voxelXaxisSampler", this._voxelGridXaxis);
            this._voxelGridRT.setTexture("voxelYaxisSampler", this._voxelGridYaxis);
            this._voxelGridRT.setTexture("voxelZaxisSampler", this._voxelGridZaxis);
            // We will render this only after voxelization is completed for the 3 axes.
            this._voxelGridRT.autoClear = false;
            this._voxelGridRT.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
            this._voxelGridRT.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        }
        else {
            this._voxelGridZaxis = new Textures_renderTargetTexture/* RenderTargetTexture */.$("voxelGridZaxis", size, this._scene, voxelCombinedOptions);
            this._voxelMrtsZaxis = this._createVoxelMRTs("z_axis_", this._voxelGridZaxis, numSlabs);
        }
        const generateVoxelMipOptions = {
            generateDepthBuffer: false,
            generateMipMaps: false,
            type: 0,
            format: 6,
            samplingMode: 1,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 23584));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 46043));
                }
            },
        };
        this._mipArray = new Array(Math.ceil(Math.log2(this._voxelResolution)));
        for (let mipIdx = 1; mipIdx <= this._mipArray.length; mipIdx++) {
            const mipDim = this._voxelResolution >> mipIdx;
            const mipSize = { width: mipDim, height: mipDim, depth: mipDim };
            this._mipArray[mipIdx - 1] = new ProceduralTexture("voxelMip" + mipIdx, mipSize, "iblGenerateVoxelMip", this._scene, generateVoxelMipOptions, false);
            this._scene.proceduralTextures.splice(this._scene.proceduralTextures.indexOf(this._mipArray[mipIdx - 1]), 1);
            const mipTarget = this._mipArray[mipIdx - 1];
            mipTarget.autoClear = false;
            mipTarget.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
            mipTarget.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
            mipTarget.setTexture("srcMip", mipIdx > 1 ? this._mipArray[mipIdx - 2] : this.getVoxelGrid());
            mipTarget.setInt("layerNum", 0);
        }
        this._createVoxelMaterials();
    }
    _createVoxelMRTs(name, voxelRT, numSlabs) {
        voxelRT.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        voxelRT.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        voxelRT.noPrePassRenderer = true;
        const mrtArray = [];
        const targetTypes = new Array(this._maxDrawBuffers).fill(this._isVoxelGrid3D ? 32879 : 35866);
        for (let mrt_index = 0; mrt_index < numSlabs; mrt_index++) {
            let layerIndices = new Array(this._maxDrawBuffers).fill(0);
            layerIndices = layerIndices.map((value, index) => mrt_index * this._maxDrawBuffers + index);
            let textureNames = new Array(this._maxDrawBuffers).fill("");
            textureNames = textureNames.map((value, index) => "voxel_grid_" + name + (mrt_index * this._maxDrawBuffers + index));
            const mrt = new MultiRenderTarget("mrt_" + name + mrt_index, { width: this._voxelResolution, height: this._voxelResolution, depth: this._isVoxelGrid3D ? this._voxelResolution : undefined }, this._maxDrawBuffers, // number of draw buffers
            this._scene, {
                types: new Array(this._maxDrawBuffers).fill(0),
                samplingModes: new Array(this._maxDrawBuffers).fill(3),
                generateMipMaps: false,
                targetTypes,
                formats: new Array(this._maxDrawBuffers).fill(6),
                faceIndex: new Array(this._maxDrawBuffers).fill(0),
                layerIndex: layerIndices,
                layerCounts: new Array(this._maxDrawBuffers).fill(this._voxelResolution),
                generateDepthBuffer: false,
                generateStencilBuffer: false,
            }, textureNames);
            mrt.clearColor = new math_color/* Color4 */.ov(0, 0, 0, 1);
            mrt.noPrePassRenderer = true;
            for (let i = 0; i < this._maxDrawBuffers; i++) {
                mrt.setInternalTexture(voxelRT.getInternalTexture(), i);
            }
            mrtArray.push(mrt);
        }
        return mrtArray;
    }
    _disposeVoxelTextures() {
        this._stopVoxelization();
        for (let i = 0; i < this._voxelMrtsZaxis.length; i++) {
            if (this._triPlanarVoxelization) {
                this._voxelMrtsXaxis[i].dispose(true);
                this._voxelMrtsYaxis[i].dispose(true);
            }
            this._voxelMrtsZaxis[i].dispose(true);
        }
        if (this._triPlanarVoxelization) {
            this._voxelGridXaxis?.dispose();
            this._voxelGridYaxis?.dispose();
            this._voxelGridRT?.dispose();
        }
        this._voxelGridZaxis?.dispose();
        this._mipArray.forEach((mip) => {
            mip.dispose();
        });
        this._voxelMaterial?.dispose();
        this._voxelSlabDebugMaterial?.dispose();
        this._mipArray = [];
        this._voxelMrtsXaxis = [];
        this._voxelMrtsYaxis = [];
        this._voxelMrtsZaxis = [];
    }
    _createVoxelMaterials() {
        const isWebGPU = this._engine.isWebGPU;
        this._voxelMaterial = new shaderMaterial/* ShaderMaterial */.B("voxelization", this._scene, "iblVoxelGrid", {
            uniforms: ["world", "viewMatrix", "invWorldScale", "nearPlane", "farPlane", "stepSize"],
            defines: ["MAX_DRAW_BUFFERS " + this._maxDrawBuffers],
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 39107)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 43965))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3414)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 8444))]);
                }
            },
        });
        this._voxelMaterial.cullBackFaces = false;
        this._voxelMaterial.backFaceCulling = false;
        this._voxelMaterial.depthFunction = Engines_engine/* Engine */.N.ALWAYS;
        this._voxelSlabDebugMaterial = new shaderMaterial/* ShaderMaterial */.B("voxelSlabDebug", this._scene, "iblVoxelSlabDebug", {
            uniforms: ["world", "viewMatrix", "cameraViewMatrix", "projection", "invWorldScale", "nearPlane", "farPlane", "stepSize"],
            defines: ["MAX_DRAW_BUFFERS " + this._maxDrawBuffers],
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 1138)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 26472))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85257)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 71587))]);
                }
            },
        });
    }
    _setDebugBindings() {
        this._voxelSlabDebugMaterial.setMatrix("projection", this._scene.activeCamera.getProjectionMatrix());
        this._voxelSlabDebugMaterial.setMatrix("cameraViewMatrix", this._scene.activeCamera.getViewMatrix());
    }
    /**
     * Checks if the voxel renderer is ready to voxelize scene
     * @returns true if the voxel renderer is ready to voxelize scene
     */
    isReady() {
        let allReady = this.getVoxelGrid().isReady();
        for (let i = 0; i < this._mipArray.length; i++) {
            const mipReady = this._mipArray[i].isReady();
            allReady && (allReady = mipReady);
        }
        if (!allReady || this._voxelizationInProgress) {
            return false;
        }
        return true;
    }
    /**
     * If the MRT's are already in the list of render targets, this will
     * remove them so that they don't get rendered again.
     */
    _stopVoxelization() {
        // If the MRT's are already in the list of render targets, remove them.
        this._removeVoxelRTs(this._voxelMrtsXaxis);
        this._removeVoxelRTs(this._voxelMrtsYaxis);
        this._removeVoxelRTs(this._voxelMrtsZaxis);
    }
    _removeVoxelRTs(rts) {
        // const currentRTs = this._scene.customRenderTargets;
        const rtIdx = this._renderTargets.findIndex((rt) => {
            if (rt === rts[0])
                return true;
            return false;
        });
        if (rtIdx >= 0) {
            this._renderTargets.splice(rtIdx, rts.length);
        }
        else {
            const rtIdx = this._scene.customRenderTargets.findIndex((rt) => {
                if (rt === rts[0])
                    return true;
                return false;
            });
            if (rtIdx >= 0) {
                this._scene.customRenderTargets.splice(rtIdx, rts.length);
            }
        }
    }
    /**
     * Renders voxel grid of scene for IBL shadows
     * @param includedMeshes
     */
    updateVoxelGrid(includedMeshes) {
        this._stopVoxelization();
        this._includedMeshes = includedMeshes;
        this._voxelizationInProgress = true;
        if (this._triPlanarVoxelization) {
            this._addRTsForRender(this._voxelMrtsXaxis, includedMeshes, 0);
            this._addRTsForRender(this._voxelMrtsYaxis, includedMeshes, 1);
            this._addRTsForRender(this._voxelMrtsZaxis, includedMeshes, 2);
        }
        else {
            this._addRTsForRender(this._voxelMrtsZaxis, includedMeshes, 2);
        }
        if (this._voxelDebugEnabled) {
            this._addRTsForRender([this._voxelSlabDebugRT], includedMeshes, this._voxelDebugAxis, 1, true);
        }
        this._renderVoxelGridBound = this._renderVoxelGrid.bind(this);
        this._scene.onAfterRenderObservable.add(this._renderVoxelGridBound);
    }
    _renderVoxelGrid() {
        if (this._voxelizationInProgress) {
            let allReady = this.getVoxelGrid().isReady();
            for (let i = 0; i < this._mipArray.length; i++) {
                const mipReady = this._mipArray[i].isReady();
                allReady && (allReady = mipReady);
            }
            for (let i = 0; i < this._renderTargets.length; i++) {
                const rttReady = this._renderTargets[i].isReadyForRendering();
                allReady && (allReady = rttReady);
            }
            if (allReady) {
                this._renderTargets.forEach((rt) => {
                    rt.render();
                });
                this._stopVoxelization();
                if (this._triPlanarVoxelization) {
                    this._voxelGridRT.render();
                }
                this._generateMipMaps();
                this._copyMipMaps();
                this._scene.onAfterRenderObservable.removeCallback(this._renderVoxelGridBound);
                this._voxelizationInProgress = false;
            }
        }
    }
    _addRTsForRender(mrts, includedMeshes, axis, shaderType = 0, continuousRender = false) {
        const slabSize = 1.0 / this._computeNumberOfSlabs();
        let voxelMaterial;
        if (shaderType === 0) {
            voxelMaterial = this._voxelMaterial;
        }
        else {
            voxelMaterial = this._voxelSlabDebugMaterial;
        }
        // We need to update the world scale uniform for every mesh being rendered to the voxel grid.
        mrts.forEach((mrt, mrtIndex) => {
            mrt.renderList = [];
            const nearPlane = mrtIndex * slabSize;
            const farPlane = (mrtIndex + 1) * slabSize;
            const stepSize = slabSize / this._maxDrawBuffers;
            const cameraPosition = new math_vector/* Vector3 */.Pq(0, 0, 0);
            let targetPosition = new math_vector/* Vector3 */.Pq(0, 0, 1);
            if (axis === 0) {
                targetPosition = new math_vector/* Vector3 */.Pq(1, 0, 0);
            }
            else if (axis === 1) {
                targetPosition = new math_vector/* Vector3 */.Pq(0, 1, 0);
            }
            let upDirection = new math_vector/* Vector3 */.Pq(0, 1, 0);
            if (axis === 1) {
                upDirection = new math_vector/* Vector3 */.Pq(1, 0, 0);
            }
            mrt.onBeforeRenderObservable.add(() => {
                voxelMaterial.setMatrix("viewMatrix", math_vector/* Matrix */.uq.LookAtLH(cameraPosition, targetPosition, upDirection));
                voxelMaterial.setMatrix("invWorldScale", this._invWorldScaleMatrix);
                voxelMaterial.setFloat("nearPlane", nearPlane);
                voxelMaterial.setFloat("farPlane", farPlane);
                voxelMaterial.setFloat("stepSize", stepSize);
            });
            // Set this material on every mesh in the scene (for this RT)
            if (includedMeshes.length === 0) {
                return;
            }
            includedMeshes.forEach((mesh) => {
                if (mesh) {
                    if (mesh.subMeshes && mesh.subMeshes.length > 0) {
                        mrt.renderList?.push(mesh);
                        mrt.setMaterialForRendering(mesh, voxelMaterial);
                    }
                    mesh.getChildMeshes().forEach((childMesh) => {
                        if (childMesh.subMeshes && childMesh.subMeshes.length > 0) {
                            mrt.renderList?.push(childMesh);
                            mrt.setMaterialForRendering(childMesh, voxelMaterial);
                        }
                    });
                }
            });
        });
        // Add the MRT's to render.
        if (continuousRender) {
            mrts.forEach((mrt) => {
                if (this._scene.customRenderTargets.indexOf(mrt) === -1) {
                    this._scene.customRenderTargets.push(mrt);
                }
            });
        }
        else {
            this._renderTargets = this._renderTargets.concat(mrts);
        }
    }
    /**
     * Called by the pipeline to resize resources.
     */
    resize() {
        this._voxelSlabDebugRT?.resize({ width: this._scene.getEngine().getRenderWidth(), height: this._scene.getEngine().getRenderHeight() });
    }
    /**
     * Disposes the voxel renderer and associated resources
     */
    dispose() {
        this._disposeVoxelTextures();
        if (this._voxelSlabDebugRT) {
            this._removeVoxelRTs([this._voxelSlabDebugRT]);
            this._voxelSlabDebugRT.dispose();
        }
        if (this._voxelDebugPass) {
            this._voxelDebugPass.dispose();
        }
        // TODO - dispose all created voxel materials.
    }
}
//# sourceMappingURL=iblShadowsVoxelRenderer.js.map
;// ./node_modules/@babylonjs/core/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js





/**
 * Build cdf maps for IBL importance sampling during IBL shadow computation.
 * This should not be instanciated directly, as it is part of a scene component
 * @internal
 */
class _IblShadowsVoxelTracingPass {
    /**
     * The opacity of the shadow cast from the voxel grid
     */
    get voxelShadowOpacity() {
        return this._voxelShadowOpacity;
    }
    /**
     * The opacity of the shadow cast from the voxel grid
     */
    set voxelShadowOpacity(value) {
        this._voxelShadowOpacity = value;
    }
    /**
     * The opacity of the screen-space shadow
     */
    get ssShadowOpacity() {
        return this._ssShadowOpacity;
    }
    /**
     * The opacity of the screen-space shadow
     */
    set ssShadowOpacity(value) {
        this._ssShadowOpacity = value;
    }
    /**
     * The number of samples used in the screen space shadow pass.
     */
    get sssSamples() {
        return this._sssSamples;
    }
    /**
     * The number of samples used in the screen space shadow pass.
     */
    set sssSamples(value) {
        this._sssSamples = value;
    }
    /**
     * The stride used in the screen space shadow pass. This controls the distance between samples.
     */
    get sssStride() {
        return this._sssStride;
    }
    /**
     * The stride used in the screen space shadow pass. This controls the distance between samples.
     */
    set sssStride(value) {
        this._sssStride = value;
    }
    /**
     * The maximum distance that the screen-space shadow will be able to occlude.
     */
    get sssMaxDist() {
        return this._sssMaxDist;
    }
    /**
     * The maximum distance that the screen-space shadow will be able to occlude.
     */
    set sssMaxDist(value) {
        this._sssMaxDist = value;
    }
    /**
     * The thickness of the screen-space shadow
     */
    get sssThickness() {
        return this._sssThickness;
    }
    /**
     * The thickness of the screen-space shadow
     */
    set sssThickness(value) {
        this._sssThickness = value;
    }
    /**
     * The bias to apply to the voxel sampling in the direction of the surface normal of the geometry.
     */
    get voxelNormalBias() {
        return this._voxelNormalBias;
    }
    set voxelNormalBias(value) {
        this._voxelNormalBias = value;
    }
    /**
     * The bias to apply to the voxel sampling in the direction of the light.
     */
    get voxelDirectionBias() {
        return this._voxelDirectionBias;
    }
    set voxelDirectionBias(value) {
        this._voxelDirectionBias = value;
    }
    /**
     * The number of directions to sample for the voxel tracing.
     */
    get sampleDirections() {
        return this._sampleDirections;
    }
    /**
     * The number of directions to sample for the voxel tracing.
     */
    set sampleDirections(value) {
        this._sampleDirections = value;
    }
    /**
     * The current rotation of the environment map, in radians.
     */
    get envRotation() {
        return this._envRotation;
    }
    /**
     * The current rotation of the environment map, in radians.
     */
    set envRotation(value) {
        this._envRotation = value;
    }
    /**
     * Returns the output texture of the pass.
     * @returns The output texture.
     */
    getOutputTexture() {
        return this._outputTexture;
    }
    /**
     * Gets the debug pass post process. This will create the resources for the pass
     * if they don't already exist.
     * @returns The post process
     */
    getDebugPassPP() {
        if (!this._debugPassPP) {
            this._createDebugPass();
        }
        return this._debugPassPP;
    }
    /**
     * The name of the debug pass
     */
    get debugPassName() {
        return this._debugPassName;
    }
    /**
     * Set the matrix to use for scaling the world space to voxel space
     * @param matrix The matrix to use for scaling the world space to voxel space
     */
    setWorldScaleMatrix(matrix) {
        this._invWorldScaleMatrix = matrix;
    }
    /**
     * Sets params that control the position and scaling of the debug display on the screen.
     * @param x Screen X offset of the debug display (0-1)
     * @param y Screen Y offset of the debug display (0-1)
     * @param widthScale X scale of the debug display (0-1)
     * @param heightScale Y scale of the debug display (0-1)
     */
    setDebugDisplayParams(x, y, widthScale, heightScale) {
        this._debugSizeParams.set(x, y, widthScale, heightScale);
    }
    /**
     * Creates the debug post process effect for this pass
     */
    _createDebugPass() {
        const isWebGPU = this._engine.isWebGPU;
        if (!this._debugPassPP) {
            const debugOptions = {
                width: this._engine.getRenderWidth(),
                height: this._engine.getRenderHeight(),
                uniforms: ["sizeParams"],
                samplers: ["debugSampler"],
                engine: this._engine,
                reusable: false,
                shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
                extraInitializations: (useWebGPU, list) => {
                    if (useWebGPU) {
                        list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 2730)));
                    }
                    else {
                        list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22495)));
                    }
                },
            };
            this._debugPassPP = new PostProcesses_postProcess/* PostProcess */.w(this.debugPassName, "iblShadowDebug", debugOptions);
            this._debugPassPP.autoClear = false;
            this._debugPassPP.onApplyObservable.add((effect) => {
                // update the caustic texture with what we just rendered.
                effect.setTexture("debugSampler", this._outputTexture);
                effect.setVector4("sizeParams", this._debugSizeParams);
            });
        }
    }
    /**
     * Instantiates the shadow voxel-tracing pass
     * @param scene Scene to attach to
     * @param iblShadowsRenderPipeline The IBL shadows render pipeline
     * @returns The shadow voxel-tracing pass
     */
    constructor(scene, iblShadowsRenderPipeline) {
        this._voxelShadowOpacity = 1.0;
        this._sssSamples = 16;
        this._sssStride = 8;
        this._sssMaxDist = 0.05;
        this._sssThickness = 0.5;
        this._ssShadowOpacity = 1.0;
        this._cameraInvView = math_vector/* Matrix */.uq.Identity();
        this._cameraInvProj = math_vector/* Matrix */.uq.Identity();
        this._invWorldScaleMatrix = math_vector/* Matrix */.uq.Identity();
        this._frameId = 0;
        this._sampleDirections = 4;
        this._shadowParameters = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this._sssParameters = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this._opacityParameters = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this._voxelBiasParameters = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this._voxelNormalBias = 1.4;
        this._voxelDirectionBias = 1.75;
        /**
         * Is the effect enabled
         */
        this.enabled = true;
        /** Enable the debug view for this pass */
        this.debugEnabled = false;
        this._debugPassName = "Voxel Tracing Debug Pass";
        /** The default rotation of the environment map will align the shadows with the default lighting orientation */
        this._envRotation = 0.0;
        this._debugVoxelMarchEnabled = false;
        this._debugSizeParams = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this._scene = scene;
        this._engine = scene.getEngine();
        this._renderPipeline = iblShadowsRenderPipeline;
        this._createTextures();
    }
    _createTextures() {
        let defines = "";
        if (this._scene.useRightHandedSystem) {
            defines += "#define RIGHT_HANDED\n";
        }
        if (this._debugVoxelMarchEnabled) {
            defines += "#define VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION 1u\n";
        }
        const isWebGPU = this._engine.isWebGPU;
        const textureOptions = {
            type: 0,
            format: 5,
            samplingMode: 1,
            generateDepthBuffer: false,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 9461))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 16990))]);
                }
            },
        };
        this._outputTexture = new ProceduralTexture("voxelTracingPass", {
            width: this._engine.getRenderWidth(),
            height: this._engine.getRenderHeight(),
        }, "iblShadowVoxelTracing", this._scene, textureOptions);
        this._outputTexture.refreshRate = -1;
        this._outputTexture.autoClear = false;
        this._outputTexture.defines = defines;
        // Need to set all the textures first so that the effect gets created with the proper uniforms.
        this._setBindings(this._scene.activeCamera);
        let counter = 0;
        this._scene.onBeforeRenderObservable.add(() => {
            counter = 0;
        });
        this._scene.onAfterRenderTargetsRenderObservable.add(() => {
            if (++counter == 2) {
                if (this.enabled && this._outputTexture.isReady()) {
                    this._setBindings(this._scene.activeCamera);
                    this._outputTexture.render();
                }
            }
        });
    }
    _setBindings(camera) {
        if (this._scene.useRightHandedSystem) {
            this._outputTexture.defines = "#define RIGHT_HANDED\n";
        }
        this._outputTexture.setMatrix("viewMtx", camera.getViewMatrix());
        this._outputTexture.setMatrix("projMtx", camera.getProjectionMatrix());
        camera.getProjectionMatrix().invertToRef(this._cameraInvProj);
        camera.getViewMatrix().invertToRef(this._cameraInvView);
        this._outputTexture.setMatrix("invProjMtx", this._cameraInvProj);
        this._outputTexture.setMatrix("invViewMtx", this._cameraInvView);
        this._outputTexture.setMatrix("wsNormalizationMtx", this._invWorldScaleMatrix);
        this._frameId++;
        let rotation = this._scene.useRightHandedSystem ? -(this._envRotation + 0.5 * Math.PI) : this._envRotation - 0.5 * Math.PI;
        rotation = rotation % (2.0 * Math.PI);
        this._shadowParameters.set(this._sampleDirections, this._frameId, 1.0, rotation);
        this._outputTexture.setVector4("shadowParameters", this._shadowParameters);
        const voxelGrid = this._renderPipeline._getVoxelGridTexture();
        const highestMip = Math.floor(Math.log2(voxelGrid.getSize().width));
        this._voxelBiasParameters.set(this._voxelNormalBias, this._voxelDirectionBias, highestMip, 0.0);
        this._outputTexture.setVector4("voxelBiasParameters", this._voxelBiasParameters);
        // SSS Options.
        this._sssParameters.set(this._sssSamples, this._sssStride, this._sssMaxDist, this._sssThickness);
        this._outputTexture.setVector4("sssParameters", this._sssParameters);
        this._opacityParameters.set(this._voxelShadowOpacity, this._ssShadowOpacity, 0.0, 0.0);
        this._outputTexture.setVector4("shadowOpacity", this._opacityParameters);
        this._outputTexture.setTexture("voxelGridSampler", voxelGrid);
        this._outputTexture.setTexture("blueNoiseSampler", this._renderPipeline._getNoiseTexture());
        this._outputTexture.setTexture("icdfySampler", this._renderPipeline._getIcdfyTexture());
        this._outputTexture.setTexture("icdfxSampler", this._renderPipeline._getIcdfxTexture());
        if (this._debugVoxelMarchEnabled) {
            this._outputTexture.defines += "#define VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION 1u\n";
        }
        const geometryBufferRenderer = this._scene.geometryBufferRenderer;
        if (!geometryBufferRenderer) {
            return;
        }
        const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);
        this._outputTexture.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
        const wnormalIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE);
        this._outputTexture.setTexture("worldNormalSampler", geometryBufferRenderer.getGBuffer().textures[wnormalIndex]);
    }
    /**
     * Called by render pipeline when canvas resized.
     * @param scaleFactor The factor by which to scale the canvas size.
     */
    resize(scaleFactor = 1.0) {
        const newSize = {
            width: Math.max(1.0, Math.floor(this._engine.getRenderWidth() * scaleFactor)),
            height: Math.max(1.0, Math.floor(this._engine.getRenderHeight() * scaleFactor)),
        };
        this._outputTexture.resize(newSize, false);
    }
    /**
     * Checks if the pass is ready
     * @returns true if the pass is ready
     */
    isReady() {
        return (this._outputTexture.isReady() &&
            !(this._debugPassPP && !this._debugPassPP.isReady()) &&
            this._renderPipeline._getIcdfyTexture().isReady() &&
            this._renderPipeline._getIcdfxTexture().isReady() &&
            this._renderPipeline._getVoxelGridTexture().isReady());
    }
    /**
     * Disposes the associated resources
     */
    dispose() {
        this._outputTexture.dispose();
        if (this._debugPassPP) {
            this._debugPassPP.dispose();
        }
    }
}
//# sourceMappingURL=iblShadowsVoxelTracingPass.js.map
;// ./node_modules/@babylonjs/core/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.js







/**
 * Build cdf maps for IBL importance sampling during IBL shadow computation.
 * This should not be instanciated directly, as it is part of a scene component
 * @internal
 */
class _IblShadowsImportanceSamplingRenderer {
    /**
     * Gets the IBL source texture being used by the importance sampling renderer
     */
    get iblSource() {
        return this._iblSource;
    }
    /**
     * Sets the IBL source texture to be used by the importance sampling renderer.
     * This will trigger recreation of the importance sampling assets.
     */
    set iblSource(source) {
        if (this._iblSource === source) {
            return;
        }
        this._disposeTextures();
        this._iblSource = source;
        if (source.isCube) {
            if (source.isReadyOrNotBlocking()) {
                this._recreateAssetsFromNewIbl(source);
            }
            else {
                source.onLoadObservable.addOnce(this._recreateAssetsFromNewIbl.bind(this, source));
            }
        }
        else {
            if (source.isReadyOrNotBlocking()) {
                this._recreateAssetsFromNewIbl(source);
            }
            else {
                source.onLoadObservable.addOnce(this._recreateAssetsFromNewIbl.bind(this, source));
            }
        }
    }
    _recreateAssetsFromNewIbl(source) {
        if (this._debugPass) {
            this._debugPass.dispose();
        }
        this._createTextures();
        if (this._debugPass) {
            // Recreate the debug pass because of the new textures
            this._createDebugPass();
        }
        // Once the textures are generated, notify that they are ready to use.
        this._icdfxPT.onGeneratedObservable.addOnce(() => {
            this.onReadyObservable.notifyObservers();
        });
    }
    /**
     * Return the cumulative distribution function (CDF) Y texture
     * @returns Return the cumulative distribution function (CDF) Y texture
     */
    getIcdfyTexture() {
        return this._icdfyPT;
    }
    /**
     * Return the cumulative distribution function (CDF) X texture
     * @returns Return the cumulative distribution function (CDF) X texture
     */
    getIcdfxTexture() {
        return this._icdfxPT;
    }
    /**
     * Sets params that control the position and scaling of the debug display on the screen.
     * @param x Screen X offset of the debug display (0-1)
     * @param y Screen Y offset of the debug display (0-1)
     * @param widthScale X scale of the debug display (0-1)
     * @param heightScale Y scale of the debug display (0-1)
     */
    setDebugDisplayParams(x, y, widthScale, heightScale) {
        this._debugSizeParams.set(x, y, widthScale, heightScale);
    }
    /**
     * The name of the debug pass post process
     */
    get debugPassName() {
        return this._debugPassName;
    }
    /**
     * Gets the debug pass post process
     * @returns The post process
     */
    getDebugPassPP() {
        if (!this._debugPass) {
            this._createDebugPass();
        }
        return this._debugPass;
    }
    /**
     * Instanciates the importance sampling renderer
     * @param scene Scene to attach to
     * @returns The importance sampling renderer
     */
    constructor(scene) {
        /** Enable the debug view for this pass */
        this.debugEnabled = false;
        this._debugSizeParams = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this._debugPassName = "Importance Sample Debug";
        /**
         * Observable that triggers when the importance sampling renderer is ready
         */
        this.onReadyObservable = new Misc_observable/* Observable */.cP();
        this._scene = scene;
        this._engine = scene.getEngine();
    }
    _createTextures() {
        const size = this._iblSource ? this._iblSource.getSize() : { width: 1, height: 1 };
        if (!this._iblSource) {
            this._iblSource = rawTexture/* RawTexture */.I.CreateRTexture(new Uint8Array([255]), 1, 1, this._scene, false, false, 1, 0);
            this._iblSource.name = "Placeholder IBL Source";
        }
        if (this._iblSource.isCube) {
            size.width *= 4;
            size.height *= 2;
        }
        const isWebGPU = this._engine.isWebGPU;
        // Create CDF maps (Cumulative Distribution Function) to assist in importance sampling
        const cdfOptions = {
            generateDepthBuffer: false,
            generateMipMaps: false,
            format: 6,
            type: 1,
            samplingMode: 1,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 53411)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 73034))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 62386)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 28043))]);
                }
            },
        };
        const icdfOptions = {
            generateDepthBuffer: false,
            generateMipMaps: false,
            format: 6,
            type: 2,
            samplingMode: 1,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 48232)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 70065))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 61391)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 77142))]);
                }
            },
        };
        this._cdfyPT = new ProceduralTexture("cdfyTexture", { width: size.width, height: size.height + 1 }, "iblShadowsCdfy", this._scene, cdfOptions, false, false);
        this._cdfyPT.autoClear = false;
        this._cdfyPT.setTexture("iblSource", this._iblSource);
        this._cdfyPT.setInt("iblHeight", size.height);
        if (this._iblSource.isCube) {
            this._cdfyPT.defines = "#define IBL_USE_CUBE_MAP\n";
        }
        this._cdfyPT.refreshRate = 0;
        this._icdfyPT = new ProceduralTexture("icdfyTexture", { width: size.width, height: size.height }, "iblShadowsIcdfy", this._scene, icdfOptions, false, false);
        this._icdfyPT.autoClear = false;
        this._icdfyPT.setTexture("cdfy", this._cdfyPT);
        this._icdfyPT.refreshRate = 0;
        this._cdfxPT = new ProceduralTexture("cdfxTexture", { width: size.width + 1, height: 1 }, "iblShadowsCdfx", this._scene, cdfOptions, false, false);
        this._cdfxPT.autoClear = false;
        this._cdfxPT.setTexture("cdfy", this._cdfyPT);
        this._cdfxPT.refreshRate = 0;
        this._icdfxPT = new ProceduralTexture("icdfxTexture", { width: size.width, height: 1 }, "iblShadowsIcdfx", this._scene, icdfOptions, false, false);
        this._icdfxPT.autoClear = false;
        this._icdfxPT.setTexture("cdfx", this._cdfxPT);
        this._icdfxPT.refreshRate = 0;
    }
    _disposeTextures() {
        this._cdfyPT?.dispose();
        this._icdfyPT?.dispose();
        this._cdfxPT?.dispose();
        this._icdfxPT?.dispose();
    }
    _createDebugPass() {
        if (this._debugPass) {
            this._debugPass.dispose();
        }
        const isWebGPU = this._engine.isWebGPU;
        const debugOptions = {
            width: this._scene.getEngine().getRenderWidth(),
            height: this._scene.getEngine().getRenderHeight(),
            samplingMode: Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE,
            engine: this._engine,
            textureType: 0,
            uniforms: ["sizeParams"],
            samplers: ["cdfy", "icdfy", "cdfx", "icdfx", "iblSource"],
            defines: this._iblSource?.isCube ? "#define IBL_USE_CUBE_MAP\n" : "",
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializations: (useWebGPU, list) => {
                if (useWebGPU) {
                    list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79040)));
                }
                else {
                    list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 16339)));
                }
            },
        };
        this._debugPass = new PostProcesses_postProcess/* PostProcess */.w(this._debugPassName, "iblShadowsImportanceSamplingDebug", debugOptions);
        const debugEffect = this._debugPass.getEffect();
        if (debugEffect) {
            debugEffect.defines = this._iblSource?.isCube ? "#define IBL_USE_CUBE_MAP\n" : "";
        }
        if (this._iblSource?.isCube) {
            this._debugPass.updateEffect("#define IBL_USE_CUBE_MAP\n");
        }
        this._debugPass.onApplyObservable.add((effect) => {
            effect.setTexture("cdfy", this._cdfyPT);
            effect.setTexture("icdfy", this._icdfyPT);
            effect.setTexture("cdfx", this._cdfxPT);
            effect.setTexture("icdfx", this._icdfxPT);
            effect.setTexture("iblSource", this._iblSource);
            effect.setFloat4("sizeParams", this._debugSizeParams.x, this._debugSizeParams.y, this._debugSizeParams.z, this._debugSizeParams.w);
        });
    }
    /**
     * Checks if the importance sampling renderer is ready
     * @returns true if the importance sampling renderer is ready
     */
    isReady() {
        return (this._iblSource &&
            this._iblSource.name !== "Placeholder IBL Source" &&
            this._iblSource.isReady() &&
            this._cdfyPT &&
            this._cdfyPT.isReady() &&
            this._icdfyPT &&
            this._icdfyPT.isReady() &&
            this._cdfxPT &&
            this._cdfxPT.isReady() &&
            this._icdfxPT &&
            this._icdfxPT.isReady());
    }
    /**
     * Disposes the importance sampling renderer and associated resources
     */
    dispose() {
        this._disposeTextures();
        if (this._debugPass) {
            this._debugPass.dispose();
        }
        this.onReadyObservable.clear();
    }
}
//# sourceMappingURL=iblShadowsImportanceSamplingRenderer.js.map
;// ./node_modules/@babylonjs/core/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js





/**
 * This should not be instanciated directly, as it is part of a scene component
 * @internal
 */
class _IblShadowsSpatialBlurPass {
    /**
     * Returns the output texture of the pass.
     * @returns The output texture.
     */
    getOutputTexture() {
        return this._outputTexture;
    }
    /**
     * Gets the debug pass post process
     * @returns The post process
     */
    getDebugPassPP() {
        if (!this._debugPassPP) {
            this._createDebugPass();
        }
        return this._debugPassPP;
    }
    /**
     * Sets the name of the debug pass
     */
    get debugPassName() {
        return this._debugPassName;
    }
    /**
     * The scale of the voxel grid in world space. This is used to scale the blur radius in world space.
     * @param scale The scale of the voxel grid in world space.
     */
    setWorldScale(scale) {
        this._worldScale = scale;
    }
    /**
     * Sets params that control the position and scaling of the debug display on the screen.
     * @param x Screen X offset of the debug display (0-1)
     * @param y Screen Y offset of the debug display (0-1)
     * @param widthScale X scale of the debug display (0-1)
     * @param heightScale Y scale of the debug display (0-1)
     */
    setDebugDisplayParams(x, y, widthScale, heightScale) {
        this._debugSizeParams.set(x, y, widthScale, heightScale);
    }
    /**
     * Creates the debug post process effect for this pass
     */
    _createDebugPass() {
        if (!this._debugPassPP) {
            const isWebGPU = this._engine.isWebGPU;
            const debugOptions = {
                width: this._engine.getRenderWidth(),
                height: this._engine.getRenderHeight(),
                textureFormat: 6,
                textureType: 0,
                samplingMode: 1,
                uniforms: ["sizeParams"],
                samplers: ["debugSampler"],
                engine: this._engine,
                reusable: false,
                shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
                extraInitializations: (useWebGPU, list) => {
                    if (useWebGPU) {
                        list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 2730)));
                    }
                    else {
                        list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22495)));
                    }
                },
            };
            this._debugPassPP = new PostProcesses_postProcess/* PostProcess */.w(this.debugPassName, "iblShadowDebug", debugOptions);
            this._debugPassPP.autoClear = false;
            this._debugPassPP.onApplyObservable.add((effect) => {
                // update the caustic texture with what we just rendered.
                effect.setTexture("debugSampler", this._outputTexture);
                effect.setVector4("sizeParams", this._debugSizeParams);
            });
        }
    }
    /**
     * Instanciates the importance sampling renderer
     * @param scene Scene to attach to
     * @param iblShadowsRenderPipeline The IBL shadows render pipeline
     * @returns The importance sampling renderer
     */
    constructor(scene, iblShadowsRenderPipeline) {
        this._worldScale = 1.0;
        this._blurParameters = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        /**
         * Is the effect enabled
         */
        this.enabled = true;
        this._debugPassName = "Spatial Blur Debug Pass";
        /** Enable the debug view for this pass */
        this.debugEnabled = false;
        this._debugSizeParams = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this._scene = scene;
        this._engine = scene.getEngine();
        this._renderPipeline = iblShadowsRenderPipeline;
        this._createTextures();
    }
    _createTextures() {
        const isWebGPU = this._engine.isWebGPU;
        const textureOptions = {
            type: 0,
            format: 5,
            samplingMode: 1,
            generateDepthBuffer: false,
            generateMipMaps: false,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 68772))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 8605))]);
                }
            },
        };
        this._outputTexture = new ProceduralTexture("spatialBlurPass", {
            width: this._engine.getRenderWidth(),
            height: this._engine.getRenderHeight(),
        }, "iblShadowSpatialBlur", this._scene, textureOptions, false, false, 0);
        this._outputTexture.refreshRate = -1;
        this._outputTexture.autoClear = false;
        // Need to set all the textures first so that the effect gets created with the proper uniforms.
        this._setBindings();
        let counter = 0;
        this._scene.onBeforeRenderObservable.add(() => {
            counter = 0;
        });
        this._scene.onAfterRenderTargetsRenderObservable.add(() => {
            if (++counter == 2) {
                if (this.enabled && this._outputTexture.isReady()) {
                    this._setBindings();
                    this._outputTexture.render();
                }
            }
        });
    }
    _setBindings() {
        this._outputTexture.setTexture("voxelTracingSampler", this._renderPipeline._getVoxelTracingTexture());
        const iterationCount = 1;
        this._blurParameters.set(iterationCount, this._worldScale, 0.0, 0.0);
        this._outputTexture.setVector4("blurParameters", this._blurParameters);
        const geometryBufferRenderer = this._scene.geometryBufferRenderer;
        if (!geometryBufferRenderer) {
            return;
        }
        const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);
        this._outputTexture.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[depthIndex]);
        const wnormalIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE);
        this._outputTexture.setTexture("worldNormalSampler", geometryBufferRenderer.getGBuffer().textures[wnormalIndex]);
    }
    /**
     * Called by render pipeline when canvas resized.
     * @param scaleFactor The factor by which to scale the canvas size.
     */
    resize(scaleFactor = 1.0) {
        const newSize = {
            width: Math.max(1.0, Math.floor(this._engine.getRenderWidth() * scaleFactor)),
            height: Math.max(1.0, Math.floor(this._engine.getRenderHeight() * scaleFactor)),
        };
        this._outputTexture.resize(newSize, false);
    }
    /**
     * Checks if the pass is ready
     * @returns true if the pass is ready
     */
    isReady() {
        return this._outputTexture.isReady() && !(this._debugPassPP && !this._debugPassPP.isReady());
    }
    /**
     * Disposes the associated resources
     */
    dispose() {
        this._outputTexture.dispose();
        if (this._debugPassPP) {
            this._debugPassPP.dispose();
        }
    }
}
//# sourceMappingURL=iblShadowsSpatialBlurPass.js.map
;// ./node_modules/@babylonjs/core/Rendering/IBLShadows/iblShadowsAccumulationPass.js






/**
 * This should not be instanciated directly, as it is part of a scene component
 * @internal
 */
class _IblShadowsAccumulationPass {
    /**
     * Returns the output texture of the pass.
     * @returns The output texture.
     */
    getOutputTexture() {
        return this._outputTexture;
    }
    /**
     * Gets the debug pass post process
     * @returns The post process
     */
    getDebugPassPP() {
        if (!this._debugPassPP) {
            this._createDebugPass();
        }
        return this._debugPassPP;
    }
    /**
     * Gets the name of the debug pass
     * @returns The name of the debug pass
     */
    get debugPassName() {
        return this._debugPassName;
    }
    /**
     * A value that controls how much of the previous frame's accumulation to keep.
     * The higher the value, the faster the shadows accumulate but the more potential ghosting you'll see.
     */
    get remanence() {
        return this._remanence;
    }
    /**
     * A value that controls how much of the previous frame's accumulation to keep.
     * The higher the value, the faster the shadows accumulate but the more potential ghosting you'll see.
     */
    set remanence(value) {
        this._remanence = value;
    }
    /**
     * Reset the accumulation.
     */
    get reset() {
        return this._reset;
    }
    /**
     * Reset the accumulation.
     */
    set reset(value) {
        this._reset = value;
    }
    /**
     * Tell the pass that the camera is moving. This will cause the accumulation
     * rate to change.
     */
    set isMoving(value) {
        this._isMoving = value;
    }
    /**
     * Sets params that control the position and scaling of the debug display on the screen.
     * @param x Screen X offset of the debug display (0-1)
     * @param y Screen Y offset of the debug display (0-1)
     * @param widthScale X scale of the debug display (0-1)
     * @param heightScale Y scale of the debug display (0-1)
     */
    setDebugDisplayParams(x, y, widthScale, heightScale) {
        this._debugSizeParams.set(x, y, widthScale, heightScale);
    }
    /**
     * Creates the debug post process effect for this pass
     */
    _createDebugPass() {
        if (!this._debugPassPP) {
            const isWebGPU = this._engine.isWebGPU;
            const debugOptions = {
                width: this._engine.getRenderWidth(),
                height: this._engine.getRenderHeight(),
                textureFormat: 5,
                textureType: 0,
                samplingMode: 1,
                uniforms: ["sizeParams"],
                samplers: ["debugSampler"],
                engine: this._engine,
                reusable: false,
                shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
                extraInitializations: (useWebGPU, list) => {
                    if (useWebGPU) {
                        list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 2730)));
                    }
                    else {
                        list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 22495)));
                    }
                },
            };
            this._debugPassPP = new PostProcesses_postProcess/* PostProcess */.w(this.debugPassName, "iblShadowDebug", debugOptions);
            this._debugPassPP.autoClear = false;
            this._debugPassPP.onApplyObservable.add((effect) => {
                // update the caustic texture with what we just rendered.
                effect.setTexture("debugSampler", this._outputTexture);
                effect.setVector4("sizeParams", this._debugSizeParams);
            });
        }
    }
    /**
     * Instantiates the accumulation pass
     * @param scene Scene to attach to
     * @param iblShadowsRenderPipeline The IBL shadows render pipeline
     * @returns The accumulation pass
     */
    constructor(scene, iblShadowsRenderPipeline) {
        this._accumulationParams = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        /** Enable the debug view for this pass */
        this.debugEnabled = false;
        /**
         * Is the effect enabled
         */
        this.enabled = true;
        /**
         * Observable that triggers when the accumulation texture is ready
         */
        this.onReadyObservable = new Misc_observable/* Observable */.cP();
        this._debugPassName = "Shadow Accumulation Debug Pass";
        this._remanence = 0.9;
        this._reset = true;
        this._isMoving = false;
        this._debugSizeParams = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this._scene = scene;
        this._engine = scene.getEngine();
        this._renderPipeline = iblShadowsRenderPipeline;
        this._createTextures();
    }
    _createTextures() {
        const isWebGPU = this._engine.isWebGPU;
        const outputTextureOptions = {
            type: 2,
            format: 5,
            samplingMode: 1,
            generateDepthBuffer: false,
            generateMipMaps: false,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 27122))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 61089))]);
                }
            },
        };
        this._outputTexture = new ProceduralTexture("shadowAccumulationPass", {
            width: this._engine.getRenderWidth(),
            height: this._engine.getRenderHeight(),
        }, "iblShadowAccumulation", this._scene, outputTextureOptions);
        this._outputTexture.refreshRate = -1;
        this._outputTexture.autoClear = false;
        this._outputTexture.onGeneratedObservable.addOnce(() => {
            this.onReadyObservable.notifyObservers();
        });
        // Need to set all the textures first so that the effect gets created with the proper uniforms.
        this._setOutputTextureBindings();
        let counter = 0;
        this._scene.onBeforeRenderObservable.add(() => {
            counter = 0;
        });
        this._scene.onAfterRenderTargetsRenderObservable.add(() => {
            if (++counter == 2) {
                if (this.enabled && this._outputTexture.isReady()) {
                    this._setOutputTextureBindings();
                    this._outputTexture.render();
                }
            }
        });
        // Create the accumulation texture for the previous frame.
        // We'll copy the output of the accumulation pass to this texture at the start of every frame.
        const accumulationOptions = {
            type: 2,
            format: 5,
            samplingMode: 1,
            generateDepthBuffer: false,
            generateMipMaps: false,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99965))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79820))]);
                }
            },
        };
        this._oldAccumulationCopy = new ProceduralTexture("oldAccumulationRT", { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, "pass", this._scene, accumulationOptions, false);
        this._oldAccumulationCopy.autoClear = false;
        this._oldAccumulationCopy.refreshRate = 1;
        this._oldAccumulationCopy.onBeforeGenerationObservable.add(this._setAccumulationCopyBindings.bind(this));
        this._setAccumulationCopyBindings();
        // Create the local position texture for the previous frame.
        // We'll copy the previous local position texture to this texture at the start of every frame.
        const localPositionOptions = {
            type: 2,
            format: 5,
            samplingMode: 1,
            generateDepthBuffer: false,
            generateMipMaps: false,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializationsAsync: async () => {
                if (isWebGPU) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99965))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 79820))]);
                }
            },
        };
        this._oldPositionCopy = new ProceduralTexture("oldLocalPositionRT", { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, "pass", this._scene, localPositionOptions, false);
        this._updatePositionCopy();
        this._oldPositionCopy.autoClear = false;
        this._oldPositionCopy.refreshRate = 1;
        this._oldPositionCopy.onBeforeGenerationObservable.add(this._updatePositionCopy.bind(this));
    }
    _setOutputTextureBindings() {
        const remanence = this._isMoving ? this.remanence : 0.99;
        this._accumulationParams.set(remanence, this.reset ? 1.0 : 0.0, this._renderPipeline.voxelGridSize, 0.0);
        this._outputTexture.setTexture("spatialBlurSampler", this._renderPipeline._getSpatialBlurTexture());
        this._outputTexture.setVector4("accumulationParameters", this._accumulationParams);
        this._outputTexture.setTexture("oldAccumulationSampler", this._oldAccumulationCopy ? this._oldAccumulationCopy : this._renderPipeline._dummyTexture2d);
        this._outputTexture.setTexture("prevPositionSampler", this._oldPositionCopy ? this._oldPositionCopy : this._renderPipeline._dummyTexture2d);
        const geometryBufferRenderer = this._scene.geometryBufferRenderer;
        if (!geometryBufferRenderer) {
            return;
        }
        const velocityIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.VELOCITY_LINEAR_TEXTURE_TYPE);
        this._outputTexture.setTexture("motionSampler", geometryBufferRenderer.getGBuffer().textures[velocityIndex]);
        const wPositionIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.POSITION_TEXTURE_TYPE);
        this._outputTexture.setTexture("positionSampler", geometryBufferRenderer.getGBuffer().textures[wPositionIndex]);
        this.reset = false;
        this._isMoving = false;
    }
    _updatePositionCopy() {
        const geometryBufferRenderer = this._scene.geometryBufferRenderer;
        const index = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.POSITION_TEXTURE_TYPE);
        this._oldPositionCopy.setTexture("textureSampler", geometryBufferRenderer.getGBuffer().textures[index]);
    }
    _setAccumulationCopyBindings() {
        this._oldAccumulationCopy.setTexture("textureSampler", this._outputTexture);
    }
    /**
     * Called by render pipeline when canvas resized.
     * @param scaleFactor The factor by which to scale the canvas size.
     */
    resize(scaleFactor = 1.0) {
        const newSize = {
            width: Math.max(1.0, Math.floor(this._engine.getRenderWidth() * scaleFactor)),
            height: Math.max(1.0, Math.floor(this._engine.getRenderHeight() * scaleFactor)),
        };
        this._outputTexture.resize(newSize, false);
        this._oldAccumulationCopy.resize(newSize, false);
        this._oldPositionCopy.resize({ width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, false);
        this.reset = true;
    }
    _disposeTextures() {
        this._oldAccumulationCopy.dispose();
        this._oldPositionCopy.dispose();
        this._outputTexture.dispose();
    }
    /**
     * Checks if the pass is ready
     * @returns true if the pass is ready
     */
    isReady() {
        return (this._oldAccumulationCopy &&
            this._oldAccumulationCopy.isReady() &&
            this._oldPositionCopy &&
            this._oldPositionCopy.isReady() &&
            this._outputTexture.isReady() &&
            !(this._debugPassPP && !this._debugPassPP.isReady()));
    }
    /**
     * Disposes the associated resources
     */
    dispose() {
        this._disposeTextures();
        if (this._debugPassPP) {
            this._debugPassPP.dispose();
        }
        this.onReadyObservable.clear();
    }
}
//# sourceMappingURL=iblShadowsAccumulationPass.js.map
;// ./node_modules/@babylonjs/core/Rendering/IBLShadows/iblShadowsPluginMaterial.js







/**
 * @internal
 */
class MaterialIBLShadowsRenderDefines extends materialDefines/* MaterialDefines */.M {
    constructor() {
        super(...arguments);
        this.RENDER_WITH_IBL_SHADOWS = false;
    }
}
/**
 * Plugin used to render the contribution from IBL shadows.
 */
class IBLShadowsPluginMaterial extends materialPluginBase/* MaterialPluginBase */.y {
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a give shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    constructor(material) {
        super(material, IBLShadowsPluginMaterial.Name, 310, new MaterialIBLShadowsRenderDefines());
        /**
         * The opacity of the shadows.
         */
        this.shadowOpacity = 1.0;
        this._isEnabled = false;
        /**
         * Defines if the plugin is enabled in the material.
         */
        this.isEnabled = false;
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
    }
    prepareDefines(defines) {
        defines.RENDER_WITH_IBL_SHADOWS = this._isEnabled;
    }
    getClassName() {
        return "IBLShadowsPluginMaterial";
    }
    getUniforms() {
        return {
            ubo: [
                { name: "renderTargetSize", size: 2, type: "vec2" },
                { name: "shadowOpacity", size: 1, type: "float" },
            ],
            fragment: `#ifdef RENDER_WITH_IBL_SHADOWS
                    uniform vec2 renderTargetSize;
                    uniform float shadowOpacity;
                #endif`,
        };
    }
    getSamplers(samplers) {
        samplers.push("iblShadowsTexture");
    }
    bindForSubMesh(uniformBuffer) {
        if (this._isEnabled) {
            uniformBuffer.bindTexture("iblShadowsTexture", this.iblShadowsTexture);
            uniformBuffer.updateFloat2("renderTargetSize", this._material.getScene().getEngine().getRenderWidth(), this._material.getScene().getEngine().getRenderHeight());
            uniformBuffer.updateFloat("shadowOpacity", this.shadowOpacity);
        }
    }
    getCustomCode(shaderType, shaderLanguage) {
        let frag;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            frag = {
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_DEFINITIONS: `
                #ifdef RENDER_WITH_IBL_SHADOWS
                    var iblShadowsTextureSampler: sampler;
                    var iblShadowsTexture: texture_2d<f32>;

                    fn computeIndirectShadow() -> vec2f {
                        var uv = fragmentInputs.position.xy / uniforms.renderTargetSize;
                        var shadowValue: vec2f = textureSample(iblShadowsTexture, iblShadowsTextureSampler, uv).rg;
                        return mix(shadowValue, vec2f(1.0), 1.0 - uniforms.shadowOpacity);
                    }
                #endif
            `,
            };
            if (this._material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d) {
                // eslint-disable-next-line @typescript-eslint/naming-convention
                frag["CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION"] = `
                #ifdef RENDER_WITH_IBL_SHADOWS
                    #ifdef REFLECTION
                        var shadowValue: vec2f = computeIndirectShadow();
                        finalIrradiance *= vec3f(shadowValue.x);
                        finalRadianceScaled *= vec3f(mix(pow(shadowValue.y, 4.0), shadowValue.x, roughness));
                    #endif
                #endif
            `;
            }
            else {
                frag["CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR"] = `
                #ifdef RENDER_WITH_IBL_SHADOWS
                    var shadowValue: vec2f = computeIndirectShadow();
                    color *= toGammaSpace(vec4f(shadowValue.x, shadowValue.x, shadowValue.x, 1.0f));
                #endif
            `;
            }
        }
        else {
            frag = {
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_DEFINITIONS: `
                #ifdef RENDER_WITH_IBL_SHADOWS
                    uniform sampler2D iblShadowsTexture;

                    vec2 computeIndirectShadow() {
                        vec2 uv = gl_FragCoord.xy / renderTargetSize;
                        vec2 shadowValue = texture2D(iblShadowsTexture, uv).rg;
                        return mix(shadowValue.rg, vec2(1.0), 1.0 - shadowOpacity);
                    }
                #endif
            `,
            };
            if (this._material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d) {
                // eslint-disable-next-line @typescript-eslint/naming-convention
                frag["CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION"] = `
                #ifdef RENDER_WITH_IBL_SHADOWS
                    #ifdef REFLECTION
                        vec2 shadowValue = computeIndirectShadow();
                        finalIrradiance *= shadowValue.x;
                        finalRadianceScaled *= mix(pow(shadowValue.y, 4.0), shadowValue.x, roughness);
                    #endif
                #endif
            `;
            }
            else {
                frag["CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR"] = `
                #ifdef RENDER_WITH_IBL_SHADOWS
                    vec2 shadowValue = computeIndirectShadow();
                    color.rgb *= toGammaSpace(shadowValue.x);
                #endif
            `;
            }
        }
        return shaderType === "vertex" ? null : frag;
    }
}
/**
 * Defines the name of the plugin.
 */
IBLShadowsPluginMaterial.Name = "IBLShadowsPluginMaterial";
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], IBLShadowsPluginMaterial.prototype, "iblShadowsTexture", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], IBLShadowsPluginMaterial.prototype, "shadowOpacity", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], IBLShadowsPluginMaterial.prototype, "isEnabled", void 0);
(0,typeStore/* RegisterClass */.Y5)(`BABYLON.IBLShadowsPluginMaterial`, IBLShadowsPluginMaterial);
//# sourceMappingURL=iblShadowsPluginMaterial.js.map
;// ./node_modules/@babylonjs/core/Rendering/IBLShadows/iblShadowsRenderPipeline.js





















/**
 * Voxel-based shadow rendering for IBL's.
 * This should not be instanciated directly, as it is part of a scene component
 */
class IblShadowsRenderPipeline extends PostProcessRenderPipeline {
    /**
     * Reset the shadow accumulation. This has a similar affect to lowering the remanence for a single frame.
     * This is useful when making a sudden change to the IBL.
     */
    resetAccumulation() {
        this._accumulationPass.reset = true;
    }
    /**
     * How dark the shadows appear. 1.0 is full opacity, 0.0 is no shadows.
     */
    get shadowOpacity() {
        return this._shadowOpacity;
    }
    set shadowOpacity(value) {
        this._shadowOpacity = value;
        this._setPluginParameters();
    }
    /**
     * A multiplier for the render size of the shadows. Used for rendering lower-resolution shadows.
     */
    get shadowRenderSizeFactor() {
        return this._renderSizeFactor;
    }
    set shadowRenderSizeFactor(value) {
        this._renderSizeFactor = Math.max(Math.min(value, 1.0), 0.0);
        this._voxelTracingPass.resize(value);
        this._spatialBlurPass.resize(value);
        this._accumulationPass.resize(value);
        this._setPluginParameters();
    }
    /**
     * How dark the voxel shadows appear. 1.0 is full opacity, 0.0 is no shadows.
     */
    get voxelShadowOpacity() {
        return this._voxelTracingPass?.voxelShadowOpacity;
    }
    set voxelShadowOpacity(value) {
        if (!this._voxelTracingPass)
            return;
        this._voxelTracingPass.voxelShadowOpacity = value;
    }
    /**
     * How dark the screen-space shadows appear. 1.0 is full opacity, 0.0 is no shadows.
     */
    get ssShadowOpacity() {
        return this._voxelTracingPass?.ssShadowOpacity;
    }
    set ssShadowOpacity(value) {
        if (!this._voxelTracingPass)
            return;
        this._voxelTracingPass.ssShadowOpacity = value;
    }
    /**
     * The number of samples used in the screen space shadow pass.
     */
    get ssShadowSampleCount() {
        return this._voxelTracingPass?.sssSamples;
    }
    set ssShadowSampleCount(value) {
        if (!this._voxelTracingPass)
            return;
        this._voxelTracingPass.sssSamples = value;
    }
    /**
     * The stride of the screen-space shadow pass. This controls the distance between samples
     * in pixels.
     */
    get ssShadowStride() {
        return this._voxelTracingPass?.sssStride;
    }
    set ssShadowStride(value) {
        if (!this._voxelTracingPass)
            return;
        this._voxelTracingPass.sssStride = value;
    }
    /**
     * A scale for the maximum distance a screen-space shadow can be cast in world-space.
     * The maximum distance that screen-space shadows cast is derived from the voxel size
     * and this value so shouldn't need to change if you scale your scene
     */
    get ssShadowDistanceScale() {
        return this._sssMaxDistScale;
    }
    set ssShadowDistanceScale(value) {
        this._sssMaxDistScale = value;
        this._updateSSShadowParams();
    }
    /**
     * Screen-space shadow thickness scale. This value controls the assumed thickness of
     * on-screen surfaces in world-space. It scales with the size of the shadow-casting
     * region so shouldn't need to change if you scale your scene.
     */
    get ssShadowThicknessScale() {
        return this._sssThicknessScale;
    }
    set ssShadowThicknessScale(value) {
        this._sssThicknessScale = value;
        this._updateSSShadowParams();
    }
    /**
     * Set the IBL image to be used for shadowing. It can be either a cubemap
     * or a 2D equirectangular texture.
     * @param iblSource The texture to use for IBL shadowing
     */
    setIblTexture(iblSource) {
        if (!this._importanceSamplingRenderer)
            return;
        this._importanceSamplingRenderer.iblSource = iblSource;
    }
    /**
     * Returns the texture containing the voxel grid data
     * @returns The texture containing the voxel grid data
     * @internal
     */
    _getVoxelGridTexture() {
        const tex = this._voxelRenderer?.getVoxelGrid();
        if (tex && tex.isReady()) {
            return tex;
        }
        return this._dummyTexture3d;
    }
    /**
     * Returns the texture containing the importance sampling CDF data for the IBL shadow pipeline
     * @returns The texture containing the importance sampling CDF data for the IBL shadow pipeline
     * @internal
     */
    _getIcdfyTexture() {
        const tex = this._importanceSamplingRenderer.getIcdfyTexture();
        if (tex && tex.isReady()) {
            return tex;
        }
        return this._dummyTexture2d;
    }
    /**
     * Returns the texture containing the importance sampling CDF data for the IBL shadow pipeline
     * @returns The texture containing the importance sampling CDF data for the IBL shadow pipeline
     * @internal
     */
    _getIcdfxTexture() {
        const tex = this._importanceSamplingRenderer.getIcdfxTexture();
        if (tex && tex.isReady()) {
            return tex;
        }
        return this._dummyTexture2d;
    }
    /**
     * Returns the noise texture.
     * @returns The noise texture.
     * @internal
     */
    _getNoiseTexture() {
        const tex = this._noiseTexture;
        if (tex && tex.isReady()) {
            return tex;
        }
        return this._dummyTexture2d;
    }
    /**
     * Returns the voxel-tracing texture.
     * @returns The voxel-tracing texture.
     * @internal
     */
    _getVoxelTracingTexture() {
        const tex = this._voxelTracingPass?.getOutputTexture();
        if (tex && tex.isReady()) {
            return tex;
        }
        return this._dummyTexture2d;
    }
    /**
     * Returns the spatial blur texture.
     * @returns The spatial blur texture.
     * @internal
     */
    _getSpatialBlurTexture() {
        const tex = this._spatialBlurPass.getOutputTexture();
        if (tex && tex.isReady()) {
            return tex;
        }
        return this._dummyTexture2d;
    }
    /**
     * Returns the accumulated shadow texture.
     * @returns The accumulated shadow texture.
     * @internal
     */
    _getAccumulatedTexture() {
        const tex = this._accumulationPass?.getOutputTexture();
        if (tex && tex.isReady()) {
            return tex;
        }
        return this._dummyTexture2d;
    }
    /**
     * Turn on or off the debug view of the G-Buffer. This will display only the targets
     * of the g-buffer that are used by the shadow pipeline.
     */
    get gbufferDebugEnabled() {
        return this._gbufferDebugEnabled;
    }
    set gbufferDebugEnabled(enabled) {
        if (enabled && !this.allowDebugPasses) {
            logger/* Logger */.V.Warn("Can't enable G-Buffer debug view without setting allowDebugPasses to true.");
            return;
        }
        this._gbufferDebugEnabled = enabled;
        if (enabled) {
            this._enableEffect(this._getGBufferDebugPass().name, this.cameras);
        }
        else {
            this._disableEffect(this._getGBufferDebugPass().name, this.cameras);
        }
    }
    /**
     * Turn on or off the debug view of the CDF importance sampling data
     */
    get importanceSamplingDebugEnabled() {
        return this._importanceSamplingRenderer?.debugEnabled;
    }
    /**
     * Turn on or off the debug view of the CDF importance sampling data
     */
    set importanceSamplingDebugEnabled(enabled) {
        if (!this._importanceSamplingRenderer)
            return;
        if (enabled && !this.allowDebugPasses) {
            logger/* Logger */.V.Warn("Can't enable importance sampling debug view without setting allowDebugPasses to true.");
            return;
        }
        if (enabled === this._importanceSamplingRenderer.debugEnabled)
            return;
        this._importanceSamplingRenderer.debugEnabled = enabled;
        if (enabled) {
            this._enableEffect(this._importanceSamplingRenderer.debugPassName, this.cameras);
        }
        else {
            this._disableEffect(this._importanceSamplingRenderer.debugPassName, this.cameras);
        }
    }
    /**
     * This displays the voxel grid in slices spread across the screen.
     * It also displays what slices of the model are stored in each layer
     * of the voxel grid. Each red stripe represents one layer while each gradient
     * (from bright red to black) represents the layers rendered in a single draw call.
     */
    get voxelDebugEnabled() {
        return this._voxelRenderer?.voxelDebugEnabled;
    }
    set voxelDebugEnabled(enabled) {
        if (!this._voxelRenderer)
            return;
        if (enabled && !this.allowDebugPasses) {
            logger/* Logger */.V.Warn("Can't enable voxel debug view without setting allowDebugPasses to true.");
            return;
        }
        this._voxelRenderer.voxelDebugEnabled = enabled;
        if (enabled) {
            this._enableEffect(this._voxelRenderer.debugPassName, this.cameras);
        }
        else {
            this._disableEffect(this._voxelRenderer.debugPassName, this.cameras);
        }
    }
    /**
     * When using tri-planar voxelization (the default), this value can be used to
     * display only the voxelization result for that axis. z-axis = 0, y-axis = 1, x-axis = 2
     */
    get voxelDebugAxis() {
        return this._voxelRenderer?.voxelDebugAxis;
    }
    set voxelDebugAxis(axisNum) {
        if (!this._voxelRenderer)
            return;
        this._voxelRenderer.voxelDebugAxis = axisNum;
    }
    /**
     * Displays a given mip of the voxel grid. `voxelDebugAxis` must be undefined in this
     * case because we only generate mips for the combined voxel grid.
     */
    set voxelDebugDisplayMip(mipNum) {
        if (!this._voxelRenderer)
            return;
        this._voxelRenderer.setDebugMipNumber(mipNum);
    }
    /**
     * Display the debug view for just the shadow samples taken this frame.
     */
    get voxelTracingDebugEnabled() {
        return this._voxelTracingPass?.debugEnabled;
    }
    set voxelTracingDebugEnabled(enabled) {
        if (!this._voxelTracingPass)
            return;
        if (enabled && !this.allowDebugPasses) {
            logger/* Logger */.V.Warn("Can't enable voxel tracing debug view without setting allowDebugPasses to true.");
            return;
        }
        if (enabled === this._voxelTracingPass.debugEnabled)
            return;
        this._voxelTracingPass.debugEnabled = enabled;
        if (enabled) {
            this._enableEffect(this._voxelTracingPass.debugPassName, this.cameras);
        }
        else {
            this._disableEffect(this._voxelTracingPass.debugPassName, this.cameras);
        }
    }
    /**
     * Display the debug view for the spatial blur pass
     */
    get spatialBlurPassDebugEnabled() {
        return this._spatialBlurPass.debugEnabled;
    }
    set spatialBlurPassDebugEnabled(enabled) {
        if (!this._spatialBlurPass)
            return;
        if (enabled && !this.allowDebugPasses) {
            logger/* Logger */.V.Warn("Can't enable spatial blur debug view without setting allowDebugPasses to true.");
            return;
        }
        if (enabled === this._spatialBlurPass.debugEnabled)
            return;
        this._spatialBlurPass.debugEnabled = enabled;
        if (enabled) {
            this._enableEffect(this._spatialBlurPass.debugPassName, this.cameras);
        }
        else {
            this._disableEffect(this._spatialBlurPass.debugPassName, this.cameras);
        }
    }
    /**
     * Display the debug view for the shadows accumulated over time.
     */
    get accumulationPassDebugEnabled() {
        return this._accumulationPass?.debugEnabled;
    }
    set accumulationPassDebugEnabled(enabled) {
        if (!this._accumulationPass)
            return;
        if (enabled && !this.allowDebugPasses) {
            logger/* Logger */.V.Warn("Can't enable accumulation pass debug view without setting allowDebugPasses to true.");
            return;
        }
        if (enabled === this._accumulationPass.debugEnabled)
            return;
        this._accumulationPass.debugEnabled = enabled;
        if (enabled) {
            this._enableEffect(this._accumulationPass.debugPassName, this.cameras);
        }
        else {
            this._disableEffect(this._accumulationPass.debugPassName, this.cameras);
        }
    }
    /**
     * Add a mesh to be used for shadow-casting in the IBL shadow pipeline.
     * These meshes will be written to the voxel grid.
     * @param mesh A mesh or list of meshes that you want to cast shadows
     */
    addShadowCastingMesh(mesh) {
        if (Array.isArray(mesh)) {
            for (const m of mesh) {
                if (m && this._shadowCastingMeshes.indexOf(m) === -1) {
                    this._shadowCastingMeshes.push(m);
                }
            }
        }
        else {
            if (mesh && this._shadowCastingMeshes.indexOf(mesh) === -1) {
                this._shadowCastingMeshes.push(mesh);
            }
        }
    }
    /**
     * Remove a mesh from the shadow-casting list. The mesh will no longer be written
     * to the voxel grid and will not cast shadows.
     * @param mesh The mesh or list of meshes that you don't want to cast shadows.
     */
    removeShadowCastingMesh(mesh) {
        if (Array.isArray(mesh)) {
            for (const m of mesh) {
                const index = this._shadowCastingMeshes.indexOf(m);
                if (index !== -1) {
                    this._shadowCastingMeshes.splice(index, 1);
                }
            }
        }
        else {
            const index = this._shadowCastingMeshes.indexOf(mesh);
            if (index !== -1) {
                this._shadowCastingMeshes.splice(index, 1);
            }
        }
    }
    /**
     * The exponent of the resolution of the voxel shadow grid. Higher resolutions will result in sharper
     * shadows but are more expensive to compute and require more memory.
     * The resolution is calculated as 2 to the power of this number.
     */
    get resolutionExp() {
        return this._voxelRenderer.voxelResolutionExp;
    }
    set resolutionExp(newResolution) {
        if (newResolution === this._voxelRenderer.voxelResolutionExp)
            return;
        if (this._voxelRenderer.isVoxelizationInProgress()) {
            logger/* Logger */.V.Warn("Can't change the resolution of the voxel grid while voxelization is in progress.");
            return;
        }
        this._voxelRenderer.voxelResolutionExp = Math.max(1, Math.min(newResolution, 8));
        this._accumulationPass.reset = true;
    }
    /**
     * The number of different directions to sample during the voxel tracing pass
     */
    get sampleDirections() {
        return this._voxelTracingPass?.sampleDirections;
    }
    /**
     * The number of different directions to sample during the voxel tracing pass
     */
    set sampleDirections(value) {
        if (!this._voxelTracingPass)
            return;
        this._voxelTracingPass.sampleDirections = value;
    }
    /**
     * The decree to which the shadows persist between frames. 0.0 is no persistence, 1.0 is full persistence.
     **/
    get shadowRemanence() {
        return this._accumulationPass?.remanence;
    }
    /**
     * The decree to which the shadows persist between frames. 0.0 is no persistence, 1.0 is full persistence.
     **/
    set shadowRemanence(value) {
        if (!this._accumulationPass)
            return;
        this._accumulationPass.remanence = value;
    }
    /**
     * The global Y-axis rotation of the IBL for shadows. This should match the Y-rotation of the environment map applied to materials, skybox, etc.
     */
    get envRotation() {
        return this._voxelTracingPass?.envRotation;
    }
    /**
     * The global Y-axis rotation of the IBL for shadows. This should match the Y-rotation of the environment map applied to materials, skybox, etc.
     */
    set envRotation(value) {
        if (!this._voxelTracingPass)
            return;
        this._voxelTracingPass.envRotation = value;
        this._accumulationPass.reset = true;
    }
    /**
     * Allow debug passes to be enabled. Default is false.
     */
    get allowDebugPasses() {
        return this._allowDebugPasses;
    }
    /**
     * Allow debug passes to be enabled. Default is false.
     */
    set allowDebugPasses(value) {
        if (this._allowDebugPasses === value)
            return;
        this._allowDebugPasses = value;
        if (value) {
            if (this._importanceSamplingRenderer.isReady()) {
                this._createDebugPasses();
            }
            else {
                this._importanceSamplingRenderer.onReadyObservable.addOnce(() => {
                    this._createDebugPasses();
                });
            }
        }
        else {
            this._disposeDebugPasses();
        }
    }
    /**
     *  Support test.
     */
    static get IsSupported() {
        const engine = engineStore/* EngineStore */.q.LastCreatedEngine;
        if (!engine) {
            return false;
        }
        return engine._features.supportIBLShadows;
    }
    /**
     * Toggle the shadow tracing on or off
     * @param enabled Toggle the shadow tracing on or off
     */
    toggleShadow(enabled) {
        this._enabled = enabled;
        this._voxelTracingPass.enabled = enabled;
        this._spatialBlurPass.enabled = enabled;
        this._accumulationPass.enabled = enabled;
        this._materialsWithRenderPlugin.forEach((mat) => {
            if (mat.pluginManager) {
                const plugin = mat.pluginManager.getPlugin(IBLShadowsPluginMaterial.Name);
                plugin.isEnabled = enabled;
            }
        });
        this._setPluginParameters();
    }
    /**
     * Trigger the scene to be re-voxelized. This should be run when any shadow-casters have been added, removed or moved.
     */
    updateVoxelization() {
        if (this._shadowCastingMeshes.length === 0) {
            logger/* Logger */.V.Warn("IBL Shadows: updateVoxelization called with no shadow-casting meshes to voxelize.");
            return;
        }
        this._voxelRenderer.updateVoxelGrid(this._shadowCastingMeshes);
        this._updateSSShadowParams();
    }
    /**
     * Trigger the scene bounds of shadow-casters to be calculated. This is the world size that the voxel grid will cover and will always be a cube.
     */
    updateSceneBounds() {
        const bounds = {
            min: new math_vector/* Vector3 */.Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE),
            max: new math_vector/* Vector3 */.Pq(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE),
        };
        this._shadowCastingMeshes.forEach((mesh) => {
            const localBounds = mesh.getHierarchyBoundingVectors(true);
            bounds.min = math_vector/* Vector3 */.Pq.Minimize(bounds.min, localBounds.min);
            bounds.max = math_vector/* Vector3 */.Pq.Maximize(bounds.max, localBounds.max);
        });
        const size = bounds.max.subtract(bounds.min);
        this.voxelGridSize = Math.max(size.x, size.y, size.z);
        if (this._shadowCastingMeshes.length === 0 || !isFinite(this.voxelGridSize) || this.voxelGridSize === 0) {
            logger/* Logger */.V.Warn("IBL Shadows: Scene size is invalid. Can't update bounds.");
            this.voxelGridSize = 1.0;
            return;
        }
        const halfSize = this.voxelGridSize / 2.0;
        const centre = bounds.max.add(bounds.min).multiplyByFloats(-0.5, -0.5, -0.5);
        const invWorldScaleMatrix = math_vector/* Matrix */.uq.Compose(new math_vector/* Vector3 */.Pq(1.0 / halfSize, 1.0 / halfSize, 1.0 / halfSize), new math_vector/* Quaternion */.PT(), new math_vector/* Vector3 */.Pq(0, 0, 0));
        const invTranslationMatrix = math_vector/* Matrix */.uq.Compose(new math_vector/* Vector3 */.Pq(1.0, 1.0, 1.0), new math_vector/* Quaternion */.PT(), centre);
        invTranslationMatrix.multiplyToRef(invWorldScaleMatrix, invWorldScaleMatrix);
        this._voxelTracingPass.setWorldScaleMatrix(invWorldScaleMatrix);
        this._voxelRenderer.setWorldScaleMatrix(invWorldScaleMatrix);
        // Set world scale for spatial blur.
        this._spatialBlurPass.setWorldScale(halfSize * 2.0);
        this._updateSSShadowParams();
    }
    /**
     * @param name The rendering pipeline name
     * @param scene The scene linked to this pipeline
     * @param options Options to configure the pipeline
     * @param cameras Cameras to apply the pipeline to.
     */
    constructor(name, scene, options = {}, cameras) {
        super(scene.getEngine(), name);
        this._allowDebugPasses = false;
        this._debugPasses = [];
        this._shadowCastingMeshes = [];
        this._shadowOpacity = 0.8;
        this._enabled = true;
        this._materialsWithRenderPlugin = [];
        /**
         * Observable that triggers when the shadow renderer is ready
         */
        this.onShadowTextureReadyObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observable that triggers when a new IBL is set and the importance sampling is ready
         */
        this.onNewIblReadyObservable = new Misc_observable/* Observable */.cP();
        /**
         * The current world-space size of that the voxel grid covers in the scene.
         */
        this.voxelGridSize = 1.0;
        this._renderSizeFactor = 1.0;
        this._gbufferDebugEnabled = false;
        this._gBufferDebugSizeParams = new math_vector/* Vector4 */.IU(0.0, 0.0, 0.0, 0.0);
        this.scene = scene;
        this._cameras = cameras || [scene.activeCamera];
        // Create the dummy textures to be used when the pipeline is not ready
        const blackPixels = new Uint8Array([0, 0, 0, 255]);
        this._dummyTexture2d = new rawTexture/* RawTexture */.I(blackPixels, 1, 1, Engines_engine/* Engine */.N.TEXTUREFORMAT_RGBA, scene, false);
        this._dummyTexture3d = new RawTexture3D(blackPixels, 1, 1, 1, Engines_engine/* Engine */.N.TEXTUREFORMAT_RGBA, scene, false);
        // Setup the geometry buffer target formats
        const textureTypesAndFormats = {};
        textureTypesAndFormats[GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE] = {
            textureFormat: 6,
            textureType: 1,
        };
        textureTypesAndFormats[GeometryBufferRenderer.VELOCITY_LINEAR_TEXTURE_TYPE] = {
            textureFormat: 7,
            textureType: 2,
        };
        textureTypesAndFormats[GeometryBufferRenderer.POSITION_TEXTURE_TYPE] = {
            textureFormat: 5,
            textureType: 2,
        };
        textureTypesAndFormats[GeometryBufferRenderer.NORMAL_TEXTURE_TYPE] = {
            textureFormat: 5,
            textureType: 2,
        };
        const geometryBufferRenderer = scene.enableGeometryBufferRenderer(undefined, 14, textureTypesAndFormats);
        if (!geometryBufferRenderer) {
            logger/* Logger */.V.Error("Geometry buffer renderer is required for IBL shadows to work.");
            return;
        }
        this._geometryBufferRenderer = geometryBufferRenderer;
        this._geometryBufferRenderer.enableScreenspaceDepth = true;
        this._geometryBufferRenderer.enableVelocityLinear = true;
        this._geometryBufferRenderer.enablePosition = true;
        this._geometryBufferRenderer.enableNormal = true;
        this._geometryBufferRenderer.generateNormalsInWorldSpace = true;
        this.shadowOpacity = options.shadowOpacity || 0.8;
        this._voxelRenderer = new _IblShadowsVoxelRenderer(this.scene, this, options ? options.resolutionExp : 6, options.triPlanarVoxelization !== undefined ? options.triPlanarVoxelization : true);
        this._importanceSamplingRenderer = new _IblShadowsImportanceSamplingRenderer(this.scene);
        this._voxelTracingPass = new _IblShadowsVoxelTracingPass(this.scene, this);
        this._spatialBlurPass = new _IblShadowsSpatialBlurPass(this.scene, this);
        this._accumulationPass = new _IblShadowsAccumulationPass(this.scene, this);
        this._accumulationPass.onReadyObservable.addOnce(() => {
            this.onShadowTextureReadyObservable.notifyObservers();
        });
        this.sampleDirections = options.sampleDirections || 2;
        this.voxelShadowOpacity = options.voxelShadowOpacity ?? 1.0;
        this.envRotation = options.envRotation ?? 0.0;
        this.shadowRenderSizeFactor = options.shadowRenderSizeFactor || 1.0;
        this.ssShadowOpacity = options.ssShadowsEnabled === undefined || options.ssShadowsEnabled ? 1.0 : 0.0;
        this.ssShadowDistanceScale = options.ssShadowDistanceScale || 1.25;
        this.ssShadowSampleCount = options.ssShadowSampleCount || 16;
        this.ssShadowStride = options.ssShadowStride || 8;
        this.ssShadowThicknessScale = options.ssShadowThicknessScale || 1.0;
        this.shadowRemanence = options.shadowRemanence ?? 0.75;
        this._noiseTexture = new Textures_texture/* Texture */.g("https://assets.babylonjs.com/textures/blue_noise/blue_noise_rgb.png", this.scene, false, true, 1);
        if (this.scene.environmentTexture) {
            this._importanceSamplingRenderer.iblSource = this.scene.environmentTexture;
        }
        scene.postProcessRenderPipelineManager.addPipeline(this);
        this.scene.onActiveCameraChanged.add(this._listenForCameraChanges.bind(this));
        this.scene.onBeforeRenderObservable.add(this._updateBeforeRender.bind(this));
        this._listenForCameraChanges();
        this.scene.getEngine().onResizeObservable.add(this._handleResize.bind(this));
        // Assigning the shadow texture to the materials needs to be done after the RT's are created.
        this._importanceSamplingRenderer.onReadyObservable.add(() => {
            this._setPluginParameters();
            this.onNewIblReadyObservable.notifyObservers();
        });
    }
    _handleResize() {
        this._voxelRenderer.resize();
        this._voxelTracingPass.resize(this.shadowRenderSizeFactor);
        this._spatialBlurPass.resize(this.shadowRenderSizeFactor);
        this._accumulationPass.resize(this.shadowRenderSizeFactor);
        this._setPluginParameters();
    }
    _getGBufferDebugPass() {
        if (this._gbufferDebugPass) {
            return this._gbufferDebugPass;
        }
        const isWebGPU = this.engine.isWebGPU;
        const textureNames = ["depthSampler", "normalSampler", "positionSampler", "velocitySampler"];
        const options = {
            width: this.scene.getEngine().getRenderWidth(),
            height: this.scene.getEngine().getRenderHeight(),
            samplingMode: 1,
            engine: this.scene.getEngine(),
            textureType: 0,
            textureFormat: 5,
            uniforms: ["sizeParams"],
            samplers: textureNames,
            reusable: false,
            shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,
            extraInitializations: (useWebGPU, list) => {
                if (useWebGPU) {
                    list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 29533)));
                }
                else {
                    list.push(Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 95634)));
                }
            },
        };
        this._gbufferDebugPass = new PostProcesses_postProcess/* PostProcess */.w("iblShadowGBufferDebug", "iblShadowGBufferDebug", options);
        this._gbufferDebugPass.autoClear = false;
        this._gbufferDebugPass.onApplyObservable.add((effect) => {
            const depthIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);
            effect.setTexture("depthSampler", this._geometryBufferRenderer.getGBuffer().textures[depthIndex]);
            const normalIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE);
            effect.setTexture("normalSampler", this._geometryBufferRenderer.getGBuffer().textures[normalIndex]);
            const positionIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.POSITION_TEXTURE_TYPE);
            effect.setTexture("positionSampler", this._geometryBufferRenderer.getGBuffer().textures[positionIndex]);
            const velocityIndex = this._geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.VELOCITY_LINEAR_TEXTURE_TYPE);
            effect.setTexture("velocitySampler", this._geometryBufferRenderer.getGBuffer().textures[velocityIndex]);
            effect.setVector4("sizeParams", this._gBufferDebugSizeParams);
            if (this.scene.activeCamera) {
                effect.setFloat("maxDepth", this.scene.activeCamera.maxZ);
            }
        });
        return this._gbufferDebugPass;
    }
    _createDebugPasses() {
        this._debugPasses = [
            { pass: this._importanceSamplingRenderer.getDebugPassPP(), enabled: this.importanceSamplingDebugEnabled },
            { pass: this._voxelRenderer.getDebugPassPP(), enabled: this.voxelDebugEnabled },
            { pass: this._voxelTracingPass.getDebugPassPP(), enabled: this.voxelTracingDebugEnabled },
            { pass: this._spatialBlurPass.getDebugPassPP(), enabled: this.spatialBlurPassDebugEnabled },
            { pass: this._accumulationPass.getDebugPassPP(), enabled: this.accumulationPassDebugEnabled },
            { pass: this._getGBufferDebugPass(), enabled: this.gbufferDebugEnabled },
        ];
        for (let i = 0; i < this._debugPasses.length; i++) {
            if (!this._debugPasses[i].pass)
                continue;
            this.addEffect(new PostProcessRenderEffect(this.scene.getEngine(), this._debugPasses[i].pass.name, () => {
                return this._debugPasses[i].pass;
            }, true));
        }
        const cameras = this.cameras.slice();
        this.scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this.name, this.cameras);
        this.scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this.name, cameras);
        for (let i = 0; i < this._debugPasses.length; i++) {
            if (!this._debugPasses[i].pass)
                continue;
            if (this._debugPasses[i].enabled) {
                this._enableEffect(this._debugPasses[i].pass.name, this.cameras);
            }
            else {
                this._disableEffect(this._debugPasses[i].pass.name, this.cameras);
            }
        }
    }
    _disposeEffectPasses() {
        this.scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this.name, this.cameras);
        this._disposeDebugPasses();
        this._reset();
    }
    _disposeDebugPasses() {
        for (let i = 0; i < this._debugPasses.length; i++) {
            this._disableEffect(this._debugPasses[i].pass.name, this.cameras);
            this._debugPasses[i].pass.dispose();
        }
        this._debugPasses = [];
    }
    _updateDebugPasses() {
        let count = 0;
        if (this._gbufferDebugEnabled)
            count++;
        if (this.importanceSamplingDebugEnabled)
            count++;
        if (this.voxelDebugEnabled)
            count++;
        if (this.voxelTracingDebugEnabled)
            count++;
        if (this.spatialBlurPassDebugEnabled)
            count++;
        if (this.accumulationPassDebugEnabled)
            count++;
        const rows = Math.ceil(Math.sqrt(count));
        const cols = Math.ceil(count / rows);
        const width = 1.0 / cols;
        const height = 1.0 / rows;
        let x = 0;
        let y = 0;
        if (this.gbufferDebugEnabled) {
            this._gBufferDebugSizeParams.set(x, y, cols, rows);
            x -= width;
            if (x <= -1) {
                x = 0;
                y -= height;
            }
        }
        if (this.importanceSamplingDebugEnabled) {
            this._importanceSamplingRenderer.setDebugDisplayParams(x, y, cols, rows);
            x -= width;
            if (x <= -1) {
                x = 0;
                y -= height;
            }
        }
        if (this.voxelDebugEnabled) {
            this._voxelRenderer.setDebugDisplayParams(x, y, cols, rows);
            x -= width;
            if (x <= -1) {
                x = 0;
                y -= height;
            }
        }
        if (this.voxelTracingDebugEnabled) {
            this._voxelTracingPass.setDebugDisplayParams(x, y, cols, rows);
            x -= width;
            if (x <= -1) {
                x = 0;
                y -= height;
            }
        }
        if (this.spatialBlurPassDebugEnabled) {
            this._spatialBlurPass.setDebugDisplayParams(x, y, cols, rows);
            x -= width;
            if (x <= -1) {
                x = 0;
                y -= height;
            }
        }
        if (this.accumulationPassDebugEnabled) {
            this._accumulationPass.setDebugDisplayParams(x, y, cols, rows);
            x -= width;
            if (x <= -1) {
                x = 0;
                y -= height;
            }
        }
    }
    /**
     * Update the SS shadow max distance and thickness based on the voxel grid size and resolution.
     * The max distance should be just a little larger than the world size of a single voxel.
     */
    _updateSSShadowParams() {
        this._voxelTracingPass.sssMaxDist = (this._sssMaxDistScale * this.voxelGridSize) / (1 << this.resolutionExp);
        this._voxelTracingPass.sssThickness = this._sssThicknessScale * 0.005 * this.voxelGridSize;
    }
    /**
     * Apply the shadows to a material or array of materials. If no material is provided, all
     * materials in the scene will be added.
     * @param material Material that will be affected by the shadows. If not provided, all materials of the scene will be affected.
     */
    addShadowReceivingMaterial(material) {
        if (material) {
            if (Array.isArray(material)) {
                material.forEach((m) => {
                    this._addShadowSupportToMaterial(m);
                });
            }
            else {
                this._addShadowSupportToMaterial(material);
            }
        }
        else {
            this.scene.materials.forEach((mat) => {
                this._addShadowSupportToMaterial(mat);
            });
        }
    }
    /**
     * Remove a material from the list of materials that receive shadows. If no material
     * is provided, all materials in the scene will be removed.
     * @param material The material or array of materials that will no longer receive shadows
     */
    removeShadowReceivingMaterial(material) {
        if (Array.isArray(material)) {
            material.forEach((m) => {
                const matIndex = this._materialsWithRenderPlugin.indexOf(m);
                if (matIndex !== -1) {
                    this._materialsWithRenderPlugin.splice(matIndex, 1);
                    const plugin = m.pluginManager?.getPlugin(IBLShadowsPluginMaterial.Name);
                    plugin.isEnabled = false;
                }
            });
        }
        else {
            const matIndex = this._materialsWithRenderPlugin.indexOf(material);
            if (matIndex !== -1) {
                this._materialsWithRenderPlugin.splice(matIndex, 1);
                const plugin = material.pluginManager.getPlugin(IBLShadowsPluginMaterial.Name);
                plugin.isEnabled = false;
            }
        }
    }
    _addShadowSupportToMaterial(material) {
        if (!(material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d) && !(material instanceof standardMaterial/* StandardMaterial */.F)) {
            return;
        }
        let plugin = material.pluginManager?.getPlugin(IBLShadowsPluginMaterial.Name);
        if (!plugin) {
            plugin = new IBLShadowsPluginMaterial(material);
        }
        if (this._materialsWithRenderPlugin.indexOf(material) !== -1) {
            return;
        }
        if (this._enabled) {
            plugin.iblShadowsTexture = this._getAccumulatedTexture().getInternalTexture();
            plugin.shadowOpacity = this.shadowOpacity;
        }
        plugin.isEnabled = this._enabled;
        this._materialsWithRenderPlugin.push(material);
    }
    _setPluginParameters() {
        if (!this._enabled) {
            return;
        }
        this._materialsWithRenderPlugin.forEach((mat) => {
            if (mat.pluginManager) {
                const plugin = mat.pluginManager.getPlugin(IBLShadowsPluginMaterial.Name);
                plugin.iblShadowsTexture = this._getAccumulatedTexture().getInternalTexture();
                plugin.shadowOpacity = this.shadowOpacity;
            }
        });
    }
    _updateBeforeRender() {
        this._updateDebugPasses();
    }
    _listenForCameraChanges() {
        // We want to listen for camera changes and change settings while the camera is moving.
        this.scene.activeCamera?.onViewMatrixChangedObservable.add(() => {
            this._accumulationPass.isMoving = true;
        });
    }
    /**
     * Checks if the IBL shadow pipeline is ready to render shadows
     * @returns true if the IBL shadow pipeline is ready to render the shadows
     */
    isReady() {
        return (this._noiseTexture.isReady() &&
            this._voxelRenderer.isReady() &&
            this._importanceSamplingRenderer.isReady() &&
            (!this._voxelTracingPass || this._voxelTracingPass.isReady()) &&
            (!this._spatialBlurPass || this._spatialBlurPass.isReady()) &&
            (!this._accumulationPass || this._accumulationPass.isReady()));
    }
    /**
     * Get the class name
     * @returns "IBLShadowsRenderPipeline"
     */
    getClassName() {
        return "IBLShadowsRenderPipeline";
    }
    /**
     * Disposes the IBL shadow pipeline and associated resources
     */
    dispose() {
        const materials = this._materialsWithRenderPlugin.splice(0);
        materials.forEach((mat) => {
            this.removeShadowReceivingMaterial(mat);
        });
        this._disposeEffectPasses();
        this._noiseTexture.dispose();
        this._voxelRenderer.dispose();
        this._importanceSamplingRenderer.dispose();
        this._voxelTracingPass.dispose();
        this._spatialBlurPass.dispose();
        this._accumulationPass.dispose();
        this._dummyTexture2d.dispose();
        this._dummyTexture3d.dispose();
        this.onNewIblReadyObservable.clear();
        this.onShadowTextureReadyObservable.clear();
        super.dispose();
    }
}
//# sourceMappingURL=iblShadowsRenderPipeline.js.map
;// ./node_modules/@babylonjs/core/Materials/Textures/prePassRenderTarget.js


/**
 * A multi render target designed to render the prepass.
 * Prepass is a scene component used to render information in multiple textures
 * alongside with the scene materials rendering.
 * Note : This is an internal class, and you should NOT need to instanciate this.
 * Only the `PrePassRenderer` should instanciate this class.
 * It is more likely that you need a regular `MultiRenderTarget`
 * @internal
 */
class PrePassRenderTarget extends MultiRenderTarget {
    constructor(name, renderTargetTexture, size, count, scene, options) {
        super(name, size, count, scene, options);
        /**
         * @internal
         */
        this._beforeCompositionPostProcesses = [];
        /**
         * @internal
         */
        this._internalTextureDirty = false;
        /**
         * Is this render target enabled for prepass rendering
         */
        this.enabled = false;
        /**
         * Render target associated with this prePassRenderTarget
         * If this is `null`, it means this prePassRenderTarget is associated with the scene
         */
        this.renderTargetTexture = null;
        this.renderTargetTexture = renderTargetTexture;
    }
    /**
     * Creates a composition effect for this RT
     * @internal
     */
    _createCompositionEffect() {
        this.imageProcessingPostProcess = new ImageProcessingPostProcess("prePassComposition", 1, null, undefined, this._engine);
        this.imageProcessingPostProcess._updateParameters();
    }
    /**
     * Checks that the size of this RT is still adapted to the desired render size.
     * @internal
     */
    _checkSize() {
        const requiredWidth = this._engine.getRenderWidth(true);
        const requiredHeight = this._engine.getRenderHeight(true);
        const width = this.getRenderWidth();
        const height = this.getRenderHeight();
        if (width !== requiredWidth || height !== requiredHeight) {
            this.resize({ width: requiredWidth, height: requiredHeight });
            this._internalTextureDirty = true;
        }
    }
    /**
     * Changes the number of render targets in this MRT
     * Be careful as it will recreate all the data in the new texture.
     * @param count new texture count
     * @param options Specifies texture types and sampling modes for new textures
     * @param textureNames Specifies the names of the textures (optional)
     */
    updateCount(count, options, textureNames) {
        super.updateCount(count, options, textureNames);
        this._internalTextureDirty = true;
    }
    /**
     * Resets the post processes chains applied to this RT.
     * @internal
     */
    _resetPostProcessChain() {
        this._beforeCompositionPostProcesses.length = 0;
    }
    /**
     * Diposes this render target
     */
    dispose() {
        const scene = this._scene;
        super.dispose();
        if (scene && scene.prePassRenderer) {
            const index = scene.prePassRenderer.renderTargets.indexOf(this);
            if (index !== -1) {
                scene.prePassRenderer.renderTargets.splice(index, 1);
            }
        }
        if (this.imageProcessingPostProcess) {
            this.imageProcessingPostProcess.dispose();
        }
        if (this.renderTargetTexture) {
            this.renderTargetTexture._prePassRenderTarget = null;
        }
        if (this._outputPostProcess) {
            this._outputPostProcess.autoClear = true;
            this._outputPostProcess.restoreDefaultInputTexture();
        }
    }
}
//# sourceMappingURL=prePassRenderTarget.js.map
;// ./node_modules/@babylonjs/core/Rendering/prePassRenderer.js







/**
 * Renders a pre pass of the scene
 * This means every mesh in the scene will be rendered to a render target texture
 * And then this texture will be composited to the rendering canvas with post processes
 * It is necessary for effects like subsurface scattering or deferred shading
 */
class PrePassRenderer {
    /**
     * Indicates if the prepass renderer is generating normals in world space or camera space (default: camera space)
     */
    get generateNormalsInWorldSpace() {
        return this._generateNormalsInWorldSpace;
    }
    set generateNormalsInWorldSpace(value) {
        if (this._generateNormalsInWorldSpace === value) {
            return;
        }
        this._generateNormalsInWorldSpace = value;
        this._markAllMaterialsAsPrePassDirty();
    }
    /**
     * Returns the index of a texture in the multi render target texture array.
     * @param type Texture type
     * @returns The index
     */
    getIndex(type) {
        return this._textureIndices[type];
    }
    /**
     * How many samples are used for MSAA of the scene render target
     */
    get samples() {
        return this.defaultRT.samples;
    }
    set samples(n) {
        this.defaultRT.samples = n;
    }
    /**
     * If set to true (default: false), the depth texture will be cleared with the depth value corresponding to the far plane (1 in normal mode, 0 in reverse depth buffer mode)
     * If set to false, the depth texture is always cleared with 0.
     */
    get useSpecificClearForDepthTexture() {
        return this._useSpecificClearForDepthTexture;
    }
    set useSpecificClearForDepthTexture(value) {
        if (this._useSpecificClearForDepthTexture === value) {
            return;
        }
        this._useSpecificClearForDepthTexture = value;
        this._isDirty = true;
    }
    /**
     * @returns the prepass render target for the rendering pass.
     * If we are currently rendering a render target, it returns the PrePassRenderTarget
     * associated with that render target. Otherwise, it returns the scene default PrePassRenderTarget
     */
    getRenderTarget() {
        return this._currentTarget;
    }
    /**
     * @internal
     * Managed by the scene component
     * @param prePassRenderTarget
     */
    _setRenderTarget(prePassRenderTarget) {
        if (prePassRenderTarget) {
            this._currentTarget = prePassRenderTarget;
        }
        else {
            this._currentTarget = this.defaultRT;
            this._engine.currentRenderPassId = this._scene.activeCamera?.renderPassId ?? this._currentTarget.renderPassId;
        }
    }
    /**
     * Returns true if the currently rendered prePassRenderTarget is the one
     * associated with the scene.
     */
    get currentRTisSceneRT() {
        return this._currentTarget === this.defaultRT;
    }
    _refreshGeometryBufferRendererLink() {
        if (!this.doNotUseGeometryRendererFallback) {
            this._geometryBuffer = this._scene.enableGeometryBufferRenderer();
            if (!this._geometryBuffer) {
                // Not supported
                this.doNotUseGeometryRendererFallback = true;
                return;
            }
            this._geometryBuffer._linkPrePassRenderer(this);
        }
        else {
            if (this._geometryBuffer) {
                this._geometryBuffer._unlinkPrePassRenderer();
            }
            this._geometryBuffer = null;
            this._scene.disableGeometryBufferRenderer();
        }
    }
    /**
     * Indicates if the prepass is enabled
     */
    get enabled() {
        return this._enabled;
    }
    /**
     * Instantiates a prepass renderer
     * @param scene The scene
     */
    constructor(scene) {
        /**
         * To save performance, we can excluded skinned meshes from the prepass
         */
        this.excludedSkinnedMesh = [];
        /**
         * Force material to be excluded from the prepass
         * Can be useful when `useGeometryBufferFallback` is set to `true`
         * and you don't want a material to show in the effect.
         */
        this.excludedMaterials = [];
        /**
         * Number of textures in the multi render target texture where the scene is directly rendered
         */
        this.mrtCount = 0;
        this._mrtTypes = [];
        this._mrtFormats = [];
        this._mrtLayout = [];
        this._mrtNames = [];
        this._textureIndices = [];
        this._generateNormalsInWorldSpace = false;
        this._useSpecificClearForDepthTexture = false;
        this._isDirty = true;
        /**
         * Configuration for prepass effects
         */
        this._effectConfigurations = [];
        /**
         * Prevents the PrePassRenderer from using the GeometryBufferRenderer as a fallback
         */
        this.doNotUseGeometryRendererFallback = true;
        /**
         * All the render targets generated by prepass
         */
        this.renderTargets = [];
        this._clearColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
        this._clearDepthColor = new math_color/* Color4 */.ov(1e8, 0, 0, 1); // "infinity" value - depth in the depth texture is view.z, not a 0..1 value!
        this._enabled = false;
        this._needsCompositionForThisPass = false;
        /**
         * Set to true to disable gamma transform in PrePass.
         * Can be useful in case you already proceed to gamma transform on a material level
         * and your post processes don't need to be in linear color space.
         */
        this.disableGammaTransform = false;
        this._scene = scene;
        this._engine = scene.getEngine();
        let type = 0;
        if (this._engine._caps.textureFloat && this._engine._caps.textureFloatLinearFiltering) {
            type = 1;
        }
        else if (this._engine._caps.textureHalfFloat && this._engine._caps.textureHalfFloatLinearFiltering) {
            type = 2;
        }
        for (let i = 0; i < PrePassRenderer.TextureFormats.length; ++i) {
            const format = PrePassRenderer.TextureFormats[i].format;
            if (PrePassRenderer.TextureFormats[i].type === 1) {
                PrePassRenderer.TextureFormats[i].type = type;
                if (type === 1 &&
                    (format === 6 || format === 7 || format === 5) &&
                    !this._engine._caps.supportFloatTexturesResolve) {
                    // We don't know in advance if the texture will be used as a resolve target, so we revert to half_float if the extension to resolve full float textures is not supported
                    PrePassRenderer.TextureFormats[i].type = 2;
                }
            }
        }
        PrePassRenderer._SceneComponentInitialization(this._scene);
        this.defaultRT = this._createRenderTarget("sceneprePassRT", null);
        this._currentTarget = this.defaultRT;
    }
    /**
     * Creates a new PrePassRenderTarget
     * This should be the only way to instantiate a `PrePassRenderTarget`
     * @param name Name of the `PrePassRenderTarget`
     * @param renderTargetTexture RenderTarget the `PrePassRenderTarget` will be attached to.
     * Can be `null` if the created `PrePassRenderTarget` is attached to the scene (default framebuffer).
     * @internal
     */
    _createRenderTarget(name, renderTargetTexture) {
        const rt = new PrePassRenderTarget(name, renderTargetTexture, { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, 0, this._scene, {
            generateMipMaps: false,
            generateStencilBuffer: this._engine.isStencilEnable,
            defaultType: 0,
            types: [],
            drawOnlyOnFirstAttachmentByDefault: true,
        });
        this.renderTargets.push(rt);
        if (this._enabled) {
            // The pre-pass renderer is already enabled, so make sure we create the render target with the correct number of textures
            this._update();
        }
        return rt;
    }
    /**
     * Indicates if rendering a prepass is supported
     */
    get isSupported() {
        return this._scene.getEngine().getCaps().drawBuffersExtension;
    }
    /**
     * Sets the proper output textures to draw in the engine.
     * @param effect The effect that is drawn. It can be or not be compatible with drawing to several output textures.
     * @param subMesh Submesh on which the effect is applied
     */
    bindAttachmentsForEffect(effect, subMesh) {
        const material = subMesh.getMaterial();
        const isPrePassCapable = material && material.isPrePassCapable;
        const excluded = material && this.excludedMaterials.indexOf(material) !== -1;
        if (this.enabled && this._currentTarget.enabled) {
            if (effect._multiTarget && isPrePassCapable && !excluded) {
                this._engine.bindAttachments(this._multiRenderAttachments);
            }
            else {
                if (this._engine._currentRenderTarget) {
                    this._engine.bindAttachments(this._defaultAttachments);
                }
                else {
                    this._engine.restoreSingleAttachment();
                }
                if (this._geometryBuffer && this.currentRTisSceneRT && !excluded) {
                    this._geometryBuffer.renderList.push(subMesh.getRenderingMesh());
                }
            }
        }
    }
    _reinitializeAttachments() {
        const multiRenderLayout = [];
        const clearLayout = [false];
        const clearDepthLayout = [false];
        const defaultLayout = [true];
        for (let i = 0; i < this.mrtCount; i++) {
            multiRenderLayout.push(true);
            if (i > 0) {
                if (this._useSpecificClearForDepthTexture && this._mrtLayout[i] === 5) {
                    clearLayout.push(false);
                    clearDepthLayout.push(true);
                }
                else {
                    clearLayout.push(true);
                    clearDepthLayout.push(false);
                }
                defaultLayout.push(false);
            }
        }
        this._multiRenderAttachments = this._engine.buildTextureLayout(multiRenderLayout);
        this._clearAttachments = this._engine.buildTextureLayout(clearLayout);
        this._clearDepthAttachments = this._engine.buildTextureLayout(clearDepthLayout);
        this._defaultAttachments = this._engine.buildTextureLayout(defaultLayout);
    }
    _resetLayout() {
        for (let i = 0; i < PrePassRenderer.TextureFormats.length; i++) {
            this._textureIndices[PrePassRenderer.TextureFormats[i].purpose] = -1;
        }
        this._textureIndices[4] = 0;
        this._mrtLayout = [4];
        this._mrtTypes = [PrePassRenderer.TextureFormats[4].type];
        this._mrtFormats = [PrePassRenderer.TextureFormats[4].format];
        this._mrtNames = [PrePassRenderer.TextureFormats[4].name];
        this.mrtCount = 1;
    }
    _updateGeometryBufferLayout() {
        this._refreshGeometryBufferRendererLink();
        if (this._geometryBuffer) {
            this._geometryBuffer._resetLayout();
            const texturesActivated = [];
            for (let i = 0; i < this._mrtLayout.length; i++) {
                texturesActivated.push(false);
            }
            this._geometryBuffer._linkInternalTexture(this.defaultRT.getInternalTexture());
            const matches = [
                {
                    prePassConstant: 5,
                    geometryBufferConstant: GeometryBufferRenderer.DEPTH_TEXTURE_TYPE,
                },
                {
                    prePassConstant: 6,
                    geometryBufferConstant: GeometryBufferRenderer.NORMAL_TEXTURE_TYPE,
                },
                {
                    prePassConstant: 1,
                    geometryBufferConstant: GeometryBufferRenderer.POSITION_TEXTURE_TYPE,
                },
                {
                    prePassConstant: 3,
                    geometryBufferConstant: GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE,
                },
                {
                    prePassConstant: 2,
                    geometryBufferConstant: GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE,
                },
            ];
            // replace textures in the geometryBuffer RT
            for (let i = 0; i < matches.length; i++) {
                const index = this._mrtLayout.indexOf(matches[i].prePassConstant);
                if (index !== -1) {
                    this._geometryBuffer._forceTextureType(matches[i].geometryBufferConstant, index);
                    texturesActivated[index] = true;
                }
            }
            this._geometryBuffer._setAttachments(this._engine.buildTextureLayout(texturesActivated));
        }
    }
    /**
     * Restores attachments for single texture draw.
     */
    restoreAttachments() {
        if (this.enabled && this._currentTarget.enabled && this._defaultAttachments) {
            if (this._engine._currentRenderTarget) {
                this._engine.bindAttachments(this._defaultAttachments);
            }
            else {
                this._engine.restoreSingleAttachment();
            }
        }
    }
    /**
     * @internal
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _beforeDraw(camera, faceIndex, layer) {
        // const previousEnabled = this._enabled && this._currentTarget.enabled;
        if (this._isDirty) {
            this._update();
        }
        if (!this._enabled || !this._currentTarget.enabled) {
            return;
        }
        if (this._geometryBuffer) {
            this._geometryBuffer.renderList = [];
        }
        this._setupOutputForThisPass(this._currentTarget, camera);
    }
    _prepareFrame(prePassRenderTarget, faceIndex, layer) {
        if (prePassRenderTarget.renderTargetTexture) {
            prePassRenderTarget.renderTargetTexture._prepareFrame(this._scene, faceIndex, layer, prePassRenderTarget.renderTargetTexture.useCameraPostProcesses);
        }
        else if (this._postProcessesSourceForThisPass.length) {
            this._scene.postProcessManager._prepareFrame();
        }
        else {
            this._engine.restoreDefaultFramebuffer();
        }
    }
    /**
     * Sets an intermediary texture between prepass and postprocesses. This texture
     * will be used as input for post processes
     * @param rt The render target texture to use
     * @returns true if there are postprocesses that will use this texture,
     * false if there is no postprocesses - and the function has no effect
     */
    setCustomOutput(rt) {
        const firstPP = this._postProcessesSourceForThisPass[0];
        if (!firstPP) {
            return false;
        }
        firstPP.inputTexture = rt.renderTarget;
        return true;
    }
    _renderPostProcesses(prePassRenderTarget, faceIndex) {
        const firstPP = this._postProcessesSourceForThisPass[0];
        const outputTexture = firstPP ? firstPP.inputTexture : prePassRenderTarget.renderTargetTexture ? prePassRenderTarget.renderTargetTexture.renderTarget : null;
        // Build post process chain for this prepass post draw
        let postProcessChain = this._currentTarget._beforeCompositionPostProcesses;
        if (this._needsCompositionForThisPass) {
            postProcessChain = postProcessChain.concat([this._currentTarget.imageProcessingPostProcess]);
        }
        // Activates and renders the chain
        if (postProcessChain.length) {
            this._scene.postProcessManager._prepareFrame(this._currentTarget.renderTarget?.texture, postProcessChain);
            this._scene.postProcessManager.directRender(postProcessChain, outputTexture, false, faceIndex);
        }
    }
    /**
     * @internal
     */
    _afterDraw(faceIndex, layer) {
        if (this._enabled && this._currentTarget.enabled) {
            this._prepareFrame(this._currentTarget, faceIndex, layer);
            this._renderPostProcesses(this._currentTarget, faceIndex);
        }
    }
    /**
     * Clears the current prepass render target (in the sense of settings pixels to the scene clear color value)
     * @internal
     */
    _clear() {
        if (this._isDirty) {
            this._update();
        }
        if (this._enabled && this._currentTarget.enabled) {
            this._bindFrameBuffer();
            // Clearing other attachment with 0 on all other attachments
            this._engine.bindAttachments(this._clearAttachments);
            this._engine.clear(this._clearColor, true, false, false);
            if (this._useSpecificClearForDepthTexture) {
                this._engine.bindAttachments(this._clearDepthAttachments);
                this._engine.clear(this._clearDepthColor, true, false, false);
            }
            // Regular clear color with the scene clear color of the 1st attachment
            this._engine.bindAttachments(this._defaultAttachments);
        }
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    _bindFrameBuffer() {
        if (this._enabled && this._currentTarget.enabled) {
            this._currentTarget._checkSize();
            const internalTexture = this._currentTarget.renderTarget;
            if (internalTexture) {
                this._engine.bindFramebuffer(internalTexture);
            }
        }
    }
    _setEnabled(enabled) {
        this._enabled = enabled;
    }
    _setRenderTargetEnabled(prePassRenderTarget, enabled) {
        prePassRenderTarget.enabled = enabled;
        if (!enabled) {
            this._unlinkInternalTexture(prePassRenderTarget);
        }
    }
    /**
     * Adds an effect configuration to the prepass render target.
     * If an effect has already been added, it won't add it twice and will return the configuration
     * already present.
     * @param cfg the effect configuration
     * @returns the effect configuration now used by the prepass
     */
    addEffectConfiguration(cfg) {
        // Do not add twice
        for (let i = 0; i < this._effectConfigurations.length; i++) {
            if (this._effectConfigurations[i].name === cfg.name) {
                return this._effectConfigurations[i];
            }
        }
        this._effectConfigurations.push(cfg);
        return cfg;
    }
    /**
     * Retrieves an effect configuration by name
     * @param name the name of the effect configuration
     * @returns the effect configuration, or null if not present
     */
    getEffectConfiguration(name) {
        for (let i = 0; i < this._effectConfigurations.length; i++) {
            if (this._effectConfigurations[i].name === name) {
                return this._effectConfigurations[i];
            }
        }
        return null;
    }
    _enable() {
        const previousMrtCount = this.mrtCount;
        for (let i = 0; i < this._effectConfigurations.length; i++) {
            if (this._effectConfigurations[i].enabled) {
                this._enableTextures(this._effectConfigurations[i].texturesRequired);
            }
        }
        for (let i = 0; i < this.renderTargets.length; i++) {
            if (this.mrtCount !== previousMrtCount || this.renderTargets[i].count !== this.mrtCount) {
                this.renderTargets[i].updateCount(this.mrtCount, { types: this._mrtTypes, formats: this._mrtFormats }, this._mrtNames.concat("prePass_DepthBuffer"));
            }
            this.renderTargets[i]._resetPostProcessChain();
            for (let j = 0; j < this._effectConfigurations.length; j++) {
                if (this._effectConfigurations[j].enabled) {
                    // TODO : subsurface scattering has 1 scene-wide effect configuration
                    // solution : do not stock postProcess on effectConfiguration, but in the prepassRenderTarget (hashmap configuration => postProcess)
                    // And call createPostProcess whenever the post process does not exist in the RT
                    if (!this._effectConfigurations[j].postProcess && this._effectConfigurations[j].createPostProcess) {
                        this._effectConfigurations[j].createPostProcess();
                    }
                    if (this._effectConfigurations[j].postProcess) {
                        this.renderTargets[i]._beforeCompositionPostProcesses.push(this._effectConfigurations[j].postProcess);
                    }
                }
            }
        }
        this._reinitializeAttachments();
        this._setEnabled(true);
        this._updateGeometryBufferLayout();
    }
    _disable() {
        this._setEnabled(false);
        for (let i = 0; i < this.renderTargets.length; i++) {
            this._setRenderTargetEnabled(this.renderTargets[i], false);
        }
        this._resetLayout();
        for (let i = 0; i < this._effectConfigurations.length; i++) {
            this._effectConfigurations[i].enabled = false;
        }
    }
    _getPostProcessesSource(prePassRenderTarget, camera) {
        if (camera) {
            return camera._postProcesses;
        }
        else if (prePassRenderTarget.renderTargetTexture) {
            if (prePassRenderTarget.renderTargetTexture.useCameraPostProcesses) {
                const camera = prePassRenderTarget.renderTargetTexture.activeCamera ? prePassRenderTarget.renderTargetTexture.activeCamera : this._scene.activeCamera;
                return camera ? camera._postProcesses : [];
            }
            else if (prePassRenderTarget.renderTargetTexture.postProcesses) {
                return prePassRenderTarget.renderTargetTexture.postProcesses;
            }
            else {
                return [];
            }
        }
        else {
            return this._scene.activeCamera ? this._scene.activeCamera._postProcesses : [];
        }
    }
    _setupOutputForThisPass(prePassRenderTarget, camera) {
        // Order is : draw ===> prePassRenderTarget._postProcesses ==> ipp ==> camera._postProcesses
        const secondaryCamera = camera && this._scene.activeCameras && !!this._scene.activeCameras.length && this._scene.activeCameras.indexOf(camera) !== 0;
        this._postProcessesSourceForThisPass = this._getPostProcessesSource(prePassRenderTarget, camera);
        this._postProcessesSourceForThisPass = this._postProcessesSourceForThisPass.filter((pp) => {
            return pp != null;
        });
        this._scene.autoClear = true;
        const cameraHasImageProcessing = this._hasImageProcessing(this._postProcessesSourceForThisPass);
        this._needsCompositionForThisPass = !cameraHasImageProcessing && !this.disableGammaTransform && this._needsImageProcessing() && !secondaryCamera;
        const firstCameraPP = this._getFirstPostProcess(this._postProcessesSourceForThisPass);
        const firstPrePassPP = prePassRenderTarget._beforeCompositionPostProcesses && prePassRenderTarget._beforeCompositionPostProcesses[0];
        let firstPP = null;
        // Setting the scene-wide post process configuration
        this._scene.imageProcessingConfiguration.applyByPostProcess = this._needsCompositionForThisPass || cameraHasImageProcessing;
        // Create composition effect if needed
        if (this._needsCompositionForThisPass && !prePassRenderTarget.imageProcessingPostProcess) {
            prePassRenderTarget._createCompositionEffect();
        }
        // Setting the prePassRenderTarget as input texture of the first PP
        if (firstPrePassPP) {
            firstPP = firstPrePassPP;
        }
        else if (this._needsCompositionForThisPass) {
            firstPP = prePassRenderTarget.imageProcessingPostProcess;
        }
        else if (firstCameraPP) {
            firstPP = firstCameraPP;
        }
        this._bindFrameBuffer();
        this._linkInternalTexture(prePassRenderTarget, firstPP);
    }
    _linkInternalTexture(prePassRenderTarget, postProcess) {
        if (postProcess) {
            postProcess.autoClear = false;
            postProcess.inputTexture = prePassRenderTarget.renderTarget;
        }
        if (prePassRenderTarget._outputPostProcess !== postProcess) {
            if (prePassRenderTarget._outputPostProcess) {
                this._unlinkInternalTexture(prePassRenderTarget);
            }
            prePassRenderTarget._outputPostProcess = postProcess;
        }
        if (prePassRenderTarget._internalTextureDirty) {
            this._updateGeometryBufferLayout();
            prePassRenderTarget._internalTextureDirty = false;
        }
    }
    /**
     * @internal
     */
    _unlinkInternalTexture(prePassRenderTarget) {
        if (prePassRenderTarget._outputPostProcess) {
            prePassRenderTarget._outputPostProcess.autoClear = true;
            prePassRenderTarget._outputPostProcess.restoreDefaultInputTexture();
            prePassRenderTarget._outputPostProcess = null;
        }
    }
    _needsImageProcessing() {
        for (let i = 0; i < this._effectConfigurations.length; i++) {
            if (this._effectConfigurations[i].enabled && this._effectConfigurations[i].needsImageProcessing) {
                return true;
            }
        }
        return false;
    }
    _hasImageProcessing(postProcesses) {
        let isIPPAlreadyPresent = false;
        if (postProcesses) {
            for (let i = 0; i < postProcesses.length; i++) {
                if (postProcesses[i]?.getClassName() === "ImageProcessingPostProcess") {
                    isIPPAlreadyPresent = true;
                    break;
                }
            }
        }
        return isIPPAlreadyPresent;
    }
    /**
     * Internal, gets the first post proces.
     * @param postProcesses
     * @returns the first post process to be run on this camera.
     */
    _getFirstPostProcess(postProcesses) {
        for (let ppIndex = 0; ppIndex < postProcesses.length; ppIndex++) {
            if (postProcesses[ppIndex] !== null) {
                return postProcesses[ppIndex];
            }
        }
        return null;
    }
    /**
     * Marks the prepass renderer as dirty, triggering a check if the prepass is necessary for the next rendering.
     */
    markAsDirty() {
        this._isDirty = true;
    }
    /**
     * Enables a texture on the MultiRenderTarget for prepass
     * @param types
     */
    _enableTextures(types) {
        // For velocity : enable storage of previous matrices for instances
        this._scene.needsPreviousWorldMatrices = false;
        for (let i = 0; i < types.length; i++) {
            const type = types[i];
            if (this._textureIndices[type] === -1) {
                this._textureIndices[type] = this._mrtLayout.length;
                this._mrtLayout.push(type);
                this._mrtTypes.push(PrePassRenderer.TextureFormats[type].type);
                this._mrtFormats.push(PrePassRenderer.TextureFormats[type].format);
                this._mrtNames.push(PrePassRenderer.TextureFormats[type].name);
                this.mrtCount++;
            }
            if (type === 2 || type === 11) {
                this._scene.needsPreviousWorldMatrices = true;
            }
        }
    }
    /**
     * Makes sure that the prepass renderer is up to date if it has been dirtified.
     */
    update() {
        if (this._isDirty) {
            this._update();
        }
    }
    _update() {
        this._disable();
        let enablePrePass = false;
        this._scene.imageProcessingConfiguration.applyByPostProcess = false;
        if (this._scene._depthPeelingRenderer && this._scene.useOrderIndependentTransparency) {
            this._scene._depthPeelingRenderer.setPrePassRenderer(this);
            enablePrePass = true;
        }
        for (let i = 0; i < this._scene.materials.length; i++) {
            if (this._scene.materials[i].setPrePassRenderer(this)) {
                enablePrePass = true;
            }
        }
        if (enablePrePass) {
            this._setRenderTargetEnabled(this.defaultRT, true);
        }
        let postProcesses;
        for (let i = 0; i < this.renderTargets.length; i++) {
            if (this.renderTargets[i].renderTargetTexture) {
                postProcesses = this._getPostProcessesSource(this.renderTargets[i]);
            }
            else {
                const camera = this._scene.activeCamera;
                if (!camera) {
                    continue;
                }
                postProcesses = camera._postProcesses;
            }
            if (!postProcesses) {
                continue;
            }
            postProcesses = postProcesses.filter((pp) => {
                return pp != null;
            });
            if (postProcesses) {
                for (let j = 0; j < postProcesses.length; j++) {
                    if (postProcesses[j].setPrePassRenderer(this)) {
                        this._setRenderTargetEnabled(this.renderTargets[i], true);
                        enablePrePass = true;
                    }
                }
                if (this._hasImageProcessing(postProcesses)) {
                    this._scene.imageProcessingConfiguration.applyByPostProcess = true;
                }
            }
        }
        this._markAllMaterialsAsPrePassDirty();
        this._isDirty = false;
        if (enablePrePass) {
            this._enable();
        }
    }
    _markAllMaterialsAsPrePassDirty() {
        const materials = this._scene.materials;
        for (let i = 0; i < materials.length; i++) {
            materials[i].markAsDirty(Materials_material/* Material */.i.PrePassDirtyFlag);
        }
    }
    /**
     * Disposes the prepass renderer.
     */
    dispose() {
        for (let i = this.renderTargets.length - 1; i >= 0; i--) {
            this.renderTargets[i].dispose();
        }
        for (let i = 0; i < this._effectConfigurations.length; i++) {
            if (this._effectConfigurations[i].dispose) {
                this._effectConfigurations[i].dispose();
            }
        }
    }
}
/**
 * @internal
 */
PrePassRenderer._SceneComponentInitialization = (_) => {
    throw (0,devTools/* _WarnImport */.n)("PrePassRendererSceneComponent");
};
/**
 * Describes the types and formats of the textures used by the pre-pass renderer
 */
PrePassRenderer.TextureFormats = [
    {
        purpose: 0,
        type: 2,
        format: 5,
        name: "prePass_Irradiance",
    },
    {
        purpose: 1,
        type: 2,
        format: 5,
        name: "prePass_Position",
    },
    {
        purpose: 2,
        type: 0,
        format: 5,
        name: "prePass_Velocity",
    },
    {
        purpose: 3,
        type: 0,
        format: 5,
        name: "prePass_Reflectivity",
    },
    {
        purpose: 4,
        type: 2,
        format: 5,
        name: "prePass_Color",
    },
    {
        purpose: 5,
        type: 1,
        format: 6,
        name: "prePass_Depth",
    },
    {
        purpose: 6,
        type: 2,
        format: 5,
        name: "prePass_Normal",
    },
    {
        purpose: 7,
        type: 0,
        format: 5,
        name: "prePass_Albedo",
    },
    {
        purpose: 8,
        type: 0,
        format: 5,
        name: "prePass_WorldNormal",
    },
    {
        purpose: 9,
        type: 2,
        format: 5,
        name: "prePass_LocalPosition",
    },
    {
        purpose: 10,
        type: 1,
        format: 6,
        name: "prePass_ScreenDepth",
    },
    {
        purpose: 11,
        type: 2,
        format: 5,
        name: "prePass_VelocityLinear",
    },
];
//# sourceMappingURL=prePassRenderer.js.map
;// ./node_modules/@babylonjs/core/Rendering/prePassRendererSceneComponent.js




Object.defineProperty(core_scene/* Scene */.Z.prototype, "prePassRenderer", {
    get: function () {
        return this._prePassRenderer;
    },
    set: function (value) {
        if (value && value.isSupported) {
            this._prePassRenderer = value;
        }
    },
    enumerable: true,
    configurable: true,
});
core_scene/* Scene */.Z.prototype.enablePrePassRenderer = function () {
    if (this._prePassRenderer) {
        return this._prePassRenderer;
    }
    this._prePassRenderer = new PrePassRenderer(this);
    if (!this._prePassRenderer.isSupported) {
        this._prePassRenderer = null;
        logger/* Logger */.V.Error("PrePassRenderer needs WebGL 2 support.\n" + "Maybe you tried to use the following features that need the PrePassRenderer :\n" + " + Subsurface Scattering");
    }
    return this._prePassRenderer;
};
core_scene/* Scene */.Z.prototype.disablePrePassRenderer = function () {
    if (!this._prePassRenderer) {
        return;
    }
    this._prePassRenderer.dispose();
    this._prePassRenderer = null;
};
/**
 * Defines the Geometry Buffer scene component responsible to manage a G-Buffer useful
 * in several rendering techniques.
 */
class PrePassRendererSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_PREPASSRENDERER;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._beforeCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_BEFORECAMERADRAW_PREPASS, this, this._beforeCameraDraw);
        this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_AFTERCAMERADRAW_PREPASS, this, this._afterCameraDraw);
        this.scene._beforeRenderTargetDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_BEFORERENDERTARGETDRAW_PREPASS, this, this._beforeRenderTargetDraw);
        this.scene._afterRenderTargetDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_AFTERCAMERADRAW_PREPASS, this, this._afterRenderTargetDraw);
        this.scene._beforeClearStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_BEFORECLEAR_PREPASS, this, this._beforeClearStage);
        this.scene._beforeRenderTargetClearStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_BEFORERENDERTARGETCLEAR_PREPASS, this, this._beforeRenderTargetClearStage);
        this.scene._beforeRenderingMeshStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_BEFORERENDERINGMESH_PREPASS, this, this._beforeRenderingMeshStage);
        this.scene._afterRenderingMeshStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_AFTERRENDERINGMESH_PREPASS, this, this._afterRenderingMeshStage);
    }
    _beforeRenderTargetDraw(renderTarget, faceIndex, layer) {
        if (this.scene.prePassRenderer && !renderTarget.noPrePassRenderer) {
            this.scene.prePassRenderer._setRenderTarget(renderTarget._prePassRenderTarget);
            this.scene.prePassRenderer._beforeDraw(undefined, faceIndex, layer);
        }
    }
    _afterRenderTargetDraw(renderTarget, faceIndex, layer) {
        if (this.scene.prePassRenderer && !renderTarget.noPrePassRenderer) {
            this.scene.prePassRenderer._afterDraw(faceIndex, layer);
        }
    }
    _beforeRenderTargetClearStage(renderTarget) {
        if (this.scene.prePassRenderer && !renderTarget.noPrePassRenderer) {
            if (!renderTarget._prePassRenderTarget) {
                renderTarget._prePassRenderTarget = this.scene.prePassRenderer._createRenderTarget(renderTarget.name + "_prePassRTT", renderTarget);
            }
            this.scene.prePassRenderer._setRenderTarget(renderTarget._prePassRenderTarget);
            this.scene.prePassRenderer._clear();
        }
    }
    _beforeCameraDraw(camera) {
        if (this.scene.prePassRenderer) {
            this.scene.prePassRenderer._setRenderTarget(null);
            this.scene.prePassRenderer._beforeDraw(camera);
        }
    }
    _afterCameraDraw() {
        if (this.scene.prePassRenderer) {
            this.scene.prePassRenderer._afterDraw();
        }
    }
    _beforeClearStage() {
        if (this.scene.prePassRenderer) {
            this.scene.prePassRenderer._setRenderTarget(null);
            this.scene.prePassRenderer._clear();
        }
    }
    _beforeRenderingMeshStage(mesh, subMesh, batch, effect) {
        if (!effect) {
            return;
        }
        // Render to MRT
        const scene = mesh.getScene();
        if (scene.prePassRenderer) {
            scene.prePassRenderer.bindAttachmentsForEffect(effect, subMesh);
        }
    }
    _afterRenderingMeshStage(mesh) {
        const scene = mesh.getScene();
        if (scene.prePassRenderer) {
            scene.prePassRenderer.restoreAttachments();
        }
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do for this component
    }
    /**
     * Disposes the component and the associated resources
     */
    dispose() {
        this.scene.disablePrePassRenderer();
    }
}
PrePassRenderer._SceneComponentInitialization = (scene) => {
    // Register the G Buffer component to the scene.
    let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_PREPASSRENDERER);
    if (!component) {
        component = new PrePassRendererSceneComponent(scene);
        scene._addComponent(component);
    }
};
//# sourceMappingURL=prePassRendererSceneComponent.js.map
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/fibonacci.js
// Do not edit.

const fibonacci_name = "fibonacci";
const fibonacci_shader = `#define rcp(x) 1./x
#define GOLDEN_RATIO 1.618033988749895
#define TWO_PI 6.2831855
vec2 Golden2dSeq(int i,float n)
{return vec2(float(i)/n+(0.5/n),fract(float(i)*rcp(GOLDEN_RATIO)));}
vec2 SampleDiskGolden(int i,int sampleCount)
{vec2 f=Golden2dSeq(i,float(sampleCount));return vec2(sqrt(f.x),TWO_PI*f.y);}`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[fibonacci_name] = fibonacci_shader;
/** @internal */
const fibonacci = { name: fibonacci_name, shader: fibonacci_shader };
//# sourceMappingURL=fibonacci.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/ShadersInclude/subSurfaceScatteringFunctions.js
var subSurfaceScatteringFunctions = __webpack_require__(96044);
;// ./node_modules/@babylonjs/core/Shaders/ShadersInclude/diffusionProfile.js
// Do not edit.

const diffusionProfile_name = "diffusionProfile";
const diffusionProfile_shader = `uniform vec3 diffusionS[5];uniform float diffusionD[5];uniform float filterRadii[5];`;
// Sideeffect
shaderStore/* ShaderStore */.l.IncludesShadersStore[diffusionProfile_name] = diffusionProfile_shader;
/** @internal */
const diffusionProfile = { name: diffusionProfile_name, shader: diffusionProfile_shader };
//# sourceMappingURL=diffusionProfile.js.map
;// ./node_modules/@babylonjs/core/Shaders/subSurfaceScattering.fragment.js
// Do not edit.





const subSurfaceScattering_fragment_name = "subSurfaceScatteringPixelShader";
const subSurfaceScattering_fragment_shader = `#include<fibonacci>
#include<helperFunctions>
#include<subSurfaceScatteringFunctions>
#include<diffusionProfile>
varying vec2 vUV;uniform vec2 texelSize;uniform sampler2D textureSampler;uniform sampler2D irradianceSampler;uniform sampler2D depthSampler;uniform sampler2D albedoSampler;uniform vec2 viewportSize;uniform float metersPerUnit;const float LOG2_E=1.4426950408889634;const float SSS_PIXELS_PER_SAMPLE=4.;const int _SssSampleBudget=40;
#define rcp(x) 1./x
#define Sq(x) x*x
#define SSS_BILATERAL_FILTER true
vec3 EvalBurleyDiffusionProfile(float r,vec3 S)
{vec3 exp_13=exp2(((LOG2_E*(-1.0/3.0))*r)*S); 
vec3 expSum=exp_13*(1.+exp_13*exp_13); 
return (S*rcp(8.*PI))*expSum; }
vec2 SampleBurleyDiffusionProfile(float u,float rcpS)
{u=1.-u; 
float g=1.+(4.*u)*(2.*u+sqrt(1.+(4.*u)*u));float n=exp2(log2(g)*(-1.0/3.0)); 
float p=(g*n)*n; 
float c=1.+p+n; 
float d=(3./LOG2_E*2.)+(3./LOG2_E)*log2(u); 
float x=(3./LOG2_E)*log2(c)-d; 
float rcpExp=((c*c)*c)*rcp((4.*u)*((c*c)+(4.*u)*(4.*u)));float r=x*rcpS;float rcpPdf=(8.*PI*rcpS)*rcpExp; 
return vec2(r,rcpPdf);}
vec3 ComputeBilateralWeight(float xy2,float z,float mmPerUnit,vec3 S,float rcpPdf)
{
#ifndef SSS_BILATERAL_FILTER
z=0.;
#endif
float r=sqrt(xy2+(z*mmPerUnit)*(z*mmPerUnit));float area=rcpPdf;
#if SSS_CLAMP_ARTIFACT
return clamp(EvalBurleyDiffusionProfile(r,S)*area,0.0,1.0);
#else
return EvalBurleyDiffusionProfile(r,S)*area;
#endif
}
void EvaluateSample(int i,int n,vec3 S,float d,vec3 centerPosVS,float mmPerUnit,float pixelsPerMm,
float phase,inout vec3 totalIrradiance,inout vec3 totalWeight)
{float scale =rcp(float(n));float offset=rcp(float(n))*0.5;float sinPhase,cosPhase;sinPhase=sin(phase);cosPhase=cos(phase);vec2 bdp=SampleBurleyDiffusionProfile(float(i)*scale+offset,d);float r=bdp.x;float rcpPdf=bdp.y;float phi=SampleDiskGolden(i,n).y;float sinPhi,cosPhi;sinPhi=sin(phi);cosPhi=cos(phi);float sinPsi=cosPhase*sinPhi+sinPhase*cosPhi; 
float cosPsi=cosPhase*cosPhi-sinPhase*sinPhi; 
vec2 vec=r*vec2(cosPsi,sinPsi);vec2 position; 
float xy2;position=vUV+round((pixelsPerMm*r)*vec2(cosPsi,sinPsi))*texelSize;xy2 =r*r;vec4 textureSample=texture2D(irradianceSampler,position);float viewZ=texture2D(depthSampler,position).r;vec3 irradiance =textureSample.rgb;if (testLightingForSSS(textureSample.a))
{float relZ=viewZ-centerPosVS.z;vec3 weight=ComputeBilateralWeight(xy2,relZ,mmPerUnit,S,rcpPdf);totalIrradiance+=weight*irradiance;totalWeight +=weight;}
else
{}}
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) 
{vec4 irradianceAndDiffusionProfile =texture2D(irradianceSampler,vUV);vec3 centerIrradiance=irradianceAndDiffusionProfile.rgb;int diffusionProfileIndex=int(round(irradianceAndDiffusionProfile.a*255.));float centerDepth =0.;vec4 inputColor=texture2D(textureSampler,vUV);bool passedStencilTest=testLightingForSSS(irradianceAndDiffusionProfile.a);if (passedStencilTest)
{centerDepth=texture2D(depthSampler,vUV).r;}
if (!passedStencilTest) { 
gl_FragColor=inputColor;return;}
float distScale =1.;vec3 S =diffusionS[diffusionProfileIndex];float d =diffusionD[diffusionProfileIndex];float filterRadius=filterRadii[diffusionProfileIndex];vec2 centerPosNDC=vUV;vec2 cornerPosNDC=vUV+0.5*texelSize;vec3 centerPosVS =vec3(centerPosNDC*viewportSize,1.0)*centerDepth; 
vec3 cornerPosVS =vec3(cornerPosNDC*viewportSize,1.0)*centerDepth; 
float mmPerUnit =1000.*(metersPerUnit*rcp(distScale));float unitsPerMm=rcp(mmPerUnit);float unitsPerPixel=2.*abs(cornerPosVS.x-centerPosVS.x);float pixelsPerMm =rcp(unitsPerPixel)*unitsPerMm;float filterArea =PI*Sq(filterRadius*pixelsPerMm);int sampleCount =int(filterArea*rcp(SSS_PIXELS_PER_SAMPLE));int sampleBudget=_SssSampleBudget;int texturingMode=0;vec3 albedo =texture2D(albedoSampler,vUV).rgb;if (distScale==0. || sampleCount<1)
{
#ifdef DEBUG_SSS_SAMPLES
vec3 green=vec3(0.,1.,0.);gl_FragColor=vec4(green,1.0);return;
#endif
gl_FragColor=vec4(inputColor.rgb+albedo*centerIrradiance,1.0);return;}
#ifdef DEBUG_SSS_SAMPLES
vec3 red =vec3(1.,0.,0.);vec3 blue=vec3(0.,0.,1.);gl_FragColor=vec4(mix(blue,red,clamp(float(sampleCount)/float(sampleBudget),0.0,1.0)),1.0);return;
#endif
float phase=0.;int n=min(sampleCount,sampleBudget);vec3 centerWeight =vec3(0.); 
vec3 totalIrradiance=vec3(0.);vec3 totalWeight =vec3(0.);for (int i=0; i<n; i++)
{EvaluateSample(i,n,S,d,centerPosVS,mmPerUnit,pixelsPerMm,
phase,totalIrradiance,totalWeight);}
totalWeight=max(totalWeight,HALF_MIN);gl_FragColor=vec4(inputColor.rgb+albedo*max(totalIrradiance/totalWeight,vec3(0.0)),1.);}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[subSurfaceScattering_fragment_name] = subSurfaceScattering_fragment_shader;
/** @internal */
const subSurfaceScatteringPixelShader = { name: subSurfaceScattering_fragment_name, shader: subSurfaceScattering_fragment_shader };
//# sourceMappingURL=subSurfaceScattering.fragment.js.map
;// ./node_modules/@babylonjs/core/PostProcesses/subSurfaceScatteringPostProcess.js







/**
 * Sub surface scattering post process
 */
class SubSurfaceScatteringPostProcess extends PostProcesses_postProcess/* PostProcess */.w {
    /**
     * Gets a string identifying the name of the class
     * @returns "SubSurfaceScatteringPostProcess" string
     */
    getClassName() {
        return "SubSurfaceScatteringPostProcess";
    }
    constructor(name, scene, options, camera = null, samplingMode, engine, reusable, textureType = 0) {
        super(name, "subSurfaceScattering", ["texelSize", "viewportSize", "metersPerUnit"], ["diffusionS", "diffusionD", "filterRadii", "irradianceSampler", "depthSampler", "albedoSampler"], options, camera, samplingMode || Textures_texture/* Texture */.g.BILINEAR_SAMPLINGMODE, engine, reusable, null, textureType, "postprocess", undefined, true);
        this._scene = scene;
        this.updateEffect();
        this.onApplyObservable.add((effect) => {
            if (!scene.prePassRenderer || !scene.subSurfaceConfiguration) {
                logger/* Logger */.V.Error("PrePass and subsurface configuration needs to be enabled for subsurface scattering.");
                return;
            }
            const texelSize = this.texelSize;
            effect.setFloat("metersPerUnit", scene.subSurfaceConfiguration.metersPerUnit);
            effect.setFloat2("texelSize", texelSize.x, texelSize.y);
            effect.setTexture("irradianceSampler", scene.prePassRenderer.getRenderTarget().textures[scene.prePassRenderer.getIndex(0)]);
            effect.setTexture("depthSampler", scene.prePassRenderer.getRenderTarget().textures[scene.prePassRenderer.getIndex(5)]);
            effect.setTexture("albedoSampler", scene.prePassRenderer.getRenderTarget().textures[scene.prePassRenderer.getIndex(7)]);
            effect.setFloat2("viewportSize", Math.tan(scene.activeCamera.fov / 2) * scene.getEngine().getAspectRatio(scene.activeCamera, true), Math.tan(scene.activeCamera.fov / 2));
            effect.setArray3("diffusionS", scene.subSurfaceConfiguration.ssDiffusionS);
            effect.setArray("diffusionD", scene.subSurfaceConfiguration.ssDiffusionD);
            effect.setArray("filterRadii", scene.subSurfaceConfiguration.ssFilterRadii);
        });
    }
}
//# sourceMappingURL=subSurfaceScatteringPostProcess.js.map
;// ./node_modules/@babylonjs/core/Rendering/subSurfaceConfiguration.js






/**
 * Contains all parameters needed for the prepass to perform
 * screen space subsurface scattering
 */
class SubSurfaceConfiguration {
    /**
     * Diffusion profile color for subsurface scattering
     */
    get ssDiffusionS() {
        return this._ssDiffusionS;
    }
    /**
     * Diffusion profile max color channel value for subsurface scattering
     */
    get ssDiffusionD() {
        return this._ssDiffusionD;
    }
    /**
     * Diffusion profile filter radius for subsurface scattering
     */
    get ssFilterRadii() {
        return this._ssFilterRadii;
    }
    /**
     * Builds a subsurface configuration object
     * @param scene The scene
     */
    constructor(scene) {
        this._ssDiffusionS = [];
        this._ssFilterRadii = [];
        this._ssDiffusionD = [];
        /**
         * Is subsurface enabled
         */
        this.enabled = false;
        /**
         * Does the output of this prepass need to go through imageprocessing
         */
        this.needsImageProcessing = true;
        /**
         * Name of the configuration
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_SUBSURFACE;
        /**
         * Diffusion profile colors for subsurface scattering
         * You can add one diffusion color using `addDiffusionProfile` on `scene.prePassRenderer`
         * See ...
         * Note that you can only store up to 5 of them
         */
        this.ssDiffusionProfileColors = [];
        /**
         * Defines the ratio real world => scene units.
         * Used for subsurface scattering
         */
        this.metersPerUnit = 1;
        /**
         * Textures that should be present in the MRT for this effect to work
         */
        this.texturesRequired = [
            5,
            7,
            4,
            0,
        ];
        // Adding default diffusion profile
        this.addDiffusionProfile(new math_color/* Color3 */.v9(1, 1, 1));
        this._scene = scene;
        SubSurfaceConfiguration._SceneComponentInitialization(this._scene);
    }
    /**
     * Adds a new diffusion profile.
     * Useful for more realistic subsurface scattering on diverse materials.
     * @param color The color of the diffusion profile. Should be the average color of the material.
     * @returns The index of the diffusion profile for the material subsurface configuration
     */
    addDiffusionProfile(color) {
        if (this.ssDiffusionD.length >= 5) {
            // We only suppport 5 diffusion profiles
            logger/* Logger */.V.Error("You already reached the maximum number of diffusion profiles.");
            return 0; // default profile
        }
        // Do not add doubles
        for (let i = 0; i < this._ssDiffusionS.length / 3; i++) {
            if (this._ssDiffusionS[i * 3] === color.r && this._ssDiffusionS[i * 3 + 1] === color.g && this._ssDiffusionS[i * 3 + 2] === color.b) {
                return i;
            }
        }
        this._ssDiffusionS.push(color.r, color.b, color.g);
        this._ssDiffusionD.push(Math.max(Math.max(color.r, color.b), color.g));
        this._ssFilterRadii.push(this.getDiffusionProfileParameters(color));
        this.ssDiffusionProfileColors.push(color);
        return this._ssDiffusionD.length - 1;
    }
    /**
     * Creates the sss post process
     * @returns The created post process
     */
    createPostProcess() {
        this.postProcess = new SubSurfaceScatteringPostProcess("subSurfaceScattering", this._scene, 1, null, undefined, this._scene.getEngine());
        this.postProcess.autoClear = false;
        return this.postProcess;
    }
    /**
     * Deletes all diffusion profiles.
     * Note that in order to render subsurface scattering, you should have at least 1 diffusion profile.
     */
    clearAllDiffusionProfiles() {
        this._ssDiffusionD = [];
        this._ssDiffusionS = [];
        this._ssFilterRadii = [];
        this.ssDiffusionProfileColors = [];
    }
    /**
     * Disposes this object
     */
    dispose() {
        this.clearAllDiffusionProfiles();
        if (this.postProcess) {
            this.postProcess.dispose();
        }
    }
    /**
     * @internal
     * https://zero-radiance.github.io/post/sampling-diffusion/
     *
     * Importance sample the normalized diffuse reflectance profile for the computed value of 's'.
     * ------------------------------------------------------------------------------------
     * R[r, phi, s]   = s * (Exp[-r * s] + Exp[-r * s / 3]) / (8 * Pi * r)
     * PDF[r, phi, s] = r * R[r, phi, s]
     * CDF[r, s]      = 1 - 1/4 * Exp[-r * s] - 3/4 * Exp[-r * s / 3]
     * ------------------------------------------------------------------------------------
     * We importance sample the color channel with the widest scattering distance.
     */
    getDiffusionProfileParameters(color) {
        const cdf = 0.997;
        const maxScatteringDistance = Math.max(color.r, color.g, color.b);
        return this._sampleBurleyDiffusionProfile(cdf, maxScatteringDistance);
    }
    /**
     * Performs sampling of a Normalized Burley diffusion profile in polar coordinates.
     * 'u' is the random number (the value of the CDF): [0, 1).
     * rcp(s) = 1 / ShapeParam = ScatteringDistance.
     * Returns the sampled radial distance, s.t. (u = 0 -> r = 0) and (u = 1 -> r = Inf).
     * @param u
     * @param rcpS
     * @returns The sampled radial distance
     */
    _sampleBurleyDiffusionProfile(u, rcpS) {
        u = 1 - u; // Convert CDF to CCDF
        const g = 1 + 4 * u * (2 * u + Math.sqrt(1 + 4 * u * u));
        const n = Math.pow(g, -1.0 / 3.0); // g^(-1/3)
        const p = g * n * n; // g^(+1/3)
        const c = 1 + p + n; // 1 + g^(+1/3) + g^(-1/3)
        const x = 3 * Math.log(c / (4 * u));
        return x * rcpS;
    }
}
/**
 * @internal
 */
SubSurfaceConfiguration._SceneComponentInitialization = (_) => {
    throw (0,devTools/* _WarnImport */.n)("SubSurfaceSceneComponent");
};
//# sourceMappingURL=subSurfaceConfiguration.js.map
;// ./node_modules/@babylonjs/core/Rendering/subSurfaceSceneComponent.js





// Adds the parser to the scene parsers.
(0,babylonFileParser_function/* AddParser */.ji)(sceneComponent/* SceneComponentConstants */.v.NAME_SUBSURFACE, (parsedData, scene) => {
    // Diffusion profiles
    if (parsedData.ssDiffusionProfileColors !== undefined && parsedData.ssDiffusionProfileColors !== null) {
        scene.enableSubSurfaceForPrePass();
        if (scene.subSurfaceConfiguration) {
            for (let index = 0, cache = parsedData.ssDiffusionProfileColors.length; index < cache; index++) {
                const color = parsedData.ssDiffusionProfileColors[index];
                scene.subSurfaceConfiguration.addDiffusionProfile(new math_color/* Color3 */.v9(color.r, color.g, color.b));
            }
        }
    }
});
Object.defineProperty(core_scene/* Scene */.Z.prototype, "subSurfaceConfiguration", {
    get: function () {
        return this._subSurfaceConfiguration;
    },
    set: function (value) {
        if (value) {
            if (this.enablePrePassRenderer()) {
                this._subSurfaceConfiguration = value;
            }
        }
    },
    enumerable: true,
    configurable: true,
});
core_scene/* Scene */.Z.prototype.enableSubSurfaceForPrePass = function () {
    if (this._subSurfaceConfiguration) {
        return this._subSurfaceConfiguration;
    }
    const prePassRenderer = this.enablePrePassRenderer();
    if (prePassRenderer) {
        this._subSurfaceConfiguration = new SubSurfaceConfiguration(this);
        prePassRenderer.addEffectConfiguration(this._subSurfaceConfiguration);
        return this._subSurfaceConfiguration;
    }
    return null;
};
core_scene/* Scene */.Z.prototype.disableSubSurfaceForPrePass = function () {
    if (!this._subSurfaceConfiguration) {
        return;
    }
    this._subSurfaceConfiguration.dispose();
    this._subSurfaceConfiguration = null;
};
/**
 * Defines the Geometry Buffer scene component responsible to manage a G-Buffer useful
 * in several rendering techniques.
 */
class SubSurfaceSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_PREPASSRENDERER;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() { }
    /**
     * Serializes the component data to the specified json object
     * @param serializationObject The object to serialize to
     */
    serialize(serializationObject) {
        if (!this.scene.subSurfaceConfiguration) {
            return;
        }
        const ssDiffusionProfileColors = this.scene.subSurfaceConfiguration.ssDiffusionProfileColors;
        serializationObject.ssDiffusionProfileColors = [];
        for (let i = 0; i < ssDiffusionProfileColors.length; i++) {
            serializationObject.ssDiffusionProfileColors.push({
                r: ssDiffusionProfileColors[i].r,
                g: ssDiffusionProfileColors[i].g,
                b: ssDiffusionProfileColors[i].b,
            });
        }
    }
    /**
     * Adds all the elements from the container to the scene
     */
    addFromContainer() {
        // Nothing to do
    }
    /**
     * Removes all the elements in the container from the scene
     */
    removeFromContainer() {
        // Make sure nothing will be serialized
        if (!this.scene.prePassRenderer) {
            return;
        }
        if (this.scene.subSurfaceConfiguration) {
            this.scene.subSurfaceConfiguration.clearAllDiffusionProfiles();
        }
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do for this component
    }
    /**
     * Disposes the component and the associated resources
     */
    dispose() {
        // Nothing to do for this component
    }
}
SubSurfaceConfiguration._SceneComponentInitialization = (scene) => {
    // Register the G Buffer component to the scene.
    let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_SUBSURFACE);
    if (!component) {
        component = new SubSurfaceSceneComponent(scene);
        scene._addComponent(component);
    }
};
//# sourceMappingURL=subSurfaceSceneComponent.js.map
;// ./node_modules/@babylonjs/core/Rendering/outlineRenderer.js









/**
 * Gets the outline renderer associated with the scene
 * @returns a OutlineRenderer
 */
core_scene/* Scene */.Z.prototype.getOutlineRenderer = function () {
    if (!this._outlineRenderer) {
        this._outlineRenderer = new OutlineRenderer(this);
    }
    return this._outlineRenderer;
};
Object.defineProperty(Meshes_mesh/* Mesh */.e.prototype, "renderOutline", {
    get: function () {
        return this._renderOutline;
    },
    set: function (value) {
        if (value) {
            // Lazy Load the component.
            this.getScene().getOutlineRenderer();
        }
        this._renderOutline = value;
    },
    enumerable: true,
    configurable: true,
});
Object.defineProperty(Meshes_mesh/* Mesh */.e.prototype, "renderOverlay", {
    get: function () {
        return this._renderOverlay;
    },
    set: function (value) {
        if (value) {
            // Lazy Load the component.
            this.getScene().getOutlineRenderer();
        }
        this._renderOverlay = value;
    },
    enumerable: true,
    configurable: true,
});
/**
 * This class is responsible to draw the outline/overlay of meshes.
 * It should not be used directly but through the available method on mesh.
 */
class OutlineRenderer {
    /**
     * Gets the shader language used in the Outline renderer.
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Instantiates a new outline renderer. (There could be only one per scene).
     * @param scene Defines the scene it belongs to
     */
    constructor(scene) {
        /**
         * The name of the component. Each component must have a unique name.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_OUTLINERENDERER;
        /**
         * Defines a zOffset default Factor to prevent zFighting between the overlay and the mesh.
         */
        this.zOffset = 1;
        /**
         * Defines a zOffset default Unit to prevent zFighting between the overlay and the mesh.
         */
        this.zOffsetUnits = 4; // 4 to account for projection a bit by default
        /** Shader language used by the Outline renderer. */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this.scene = scene;
        this._engine = scene.getEngine();
        this.scene._addComponent(this);
        this._passIdForDrawWrapper = [];
        for (let i = 0; i < 4; ++i) {
            this._passIdForDrawWrapper[i] = this._engine.createRenderPassId(`Outline Renderer (${i})`);
        }
        const engine = this._engine;
        if (engine.isWebGPU) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
    }
    /**
     * Register the component to one instance of a scene.
     */
    register() {
        this.scene._beforeRenderingMeshStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_BEFORERENDERINGMESH_OUTLINE, this, this._beforeRenderingMesh);
        this.scene._afterRenderingMeshStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_AFTERRENDERINGMESH_OUTLINE, this, this._afterRenderingMesh);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        // Nothing to do here.
    }
    /**
     * Disposes the component and the associated resources.
     */
    dispose() {
        for (let i = 0; i < this._passIdForDrawWrapper.length; ++i) {
            this._engine.releaseRenderPassId(this._passIdForDrawWrapper[i]);
        }
    }
    /**
     * Renders the outline in the canvas.
     * @param subMesh Defines the sumesh to render
     * @param batch Defines the batch of meshes in case of instances
     * @param useOverlay Defines if the rendering is for the overlay or the outline
     * @param renderPassId Render pass id to use to render the mesh
     */
    render(subMesh, batch, useOverlay = false, renderPassId) {
        renderPassId = renderPassId ?? this._passIdForDrawWrapper[0];
        const scene = this.scene;
        const engine = scene.getEngine();
        const hardwareInstancedRendering = engine.getCaps().instancedArrays &&
            ((batch.visibleInstances[subMesh._id] !== null && batch.visibleInstances[subMesh._id] !== undefined) || subMesh.getRenderingMesh().hasThinInstances);
        if (!this.isReady(subMesh, hardwareInstancedRendering, renderPassId)) {
            return;
        }
        const ownerMesh = subMesh.getMesh();
        const replacementMesh = ownerMesh._internalAbstractMeshDataInfo._actAsRegularMesh ? ownerMesh : null;
        const renderingMesh = subMesh.getRenderingMesh();
        const effectiveMesh = replacementMesh ? replacementMesh : renderingMesh;
        const material = subMesh.getMaterial();
        if (!material || !scene.activeCamera) {
            return;
        }
        const drawWrapper = subMesh._getDrawWrapper(renderPassId);
        const effect = Materials_drawWrapper/* DrawWrapper */.E.GetEffect(drawWrapper);
        engine.enableEffect(drawWrapper);
        // Logarithmic depth
        if (material.useLogarithmicDepth) {
            effect.setFloat("logarithmicDepthConstant", 2.0 / (Math.log(scene.activeCamera.maxZ + 1.0) / Math.LN2));
        }
        effect.setFloat("offset", useOverlay ? 0 : renderingMesh.outlineWidth);
        effect.setColor4("color", useOverlay ? renderingMesh.overlayColor : renderingMesh.outlineColor, useOverlay ? renderingMesh.overlayAlpha : material.alpha);
        effect.setMatrix("viewProjection", scene.getTransformMatrix());
        effect.setMatrix("world", effectiveMesh.getWorldMatrix());
        // Bones
        (0,materialHelper_functions/* BindBonesParameters */.f$)(renderingMesh, effect);
        // Morph targets
        (0,materialHelper_functions/* BindMorphTargetParameters */.nR)(renderingMesh, effect);
        if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {
            renderingMesh.morphTargetManager._bind(effect);
        }
        if (!hardwareInstancedRendering) {
            renderingMesh._bind(subMesh, effect, material.fillMode);
        }
        // Baked vertex animations
        const bvaManager = subMesh.getMesh().bakedVertexAnimationManager;
        if (bvaManager && bvaManager.isEnabled) {
            bvaManager.bind(effect, hardwareInstancedRendering);
        }
        // Alpha test
        if (material && material.needAlphaTesting()) {
            const alphaTexture = material.getAlphaTestTexture();
            if (alphaTexture) {
                effect.setTexture("diffuseSampler", alphaTexture);
                effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
            }
        }
        // Clip plane
        (0,clipPlaneMaterialHelper/* bindClipPlane */.gS)(effect, material, scene);
        engine.setZOffset(-this.zOffset);
        engine.setZOffsetUnits(-this.zOffsetUnits);
        renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, world) => {
            effect.setMatrix("world", world);
        });
        engine.setZOffset(0);
        engine.setZOffsetUnits(0);
    }
    /**
     * Returns whether or not the outline renderer is ready for a given submesh.
     * All the dependencies e.g. submeshes, texture, effect... mus be ready
     * @param subMesh Defines the submesh to check readiness for
     * @param useInstances Defines whether wee are trying to render instances or not
     * @param renderPassId Render pass id to use to render the mesh
     * @returns true if ready otherwise false
     */
    isReady(subMesh, useInstances, renderPassId) {
        renderPassId = renderPassId ?? this._passIdForDrawWrapper[0];
        const defines = [];
        const attribs = [Buffers_buffer/* VertexBuffer */.R.PositionKind, Buffers_buffer/* VertexBuffer */.R.NormalKind];
        const mesh = subMesh.getMesh();
        const material = subMesh.getMaterial();
        if (!material) {
            return false;
        }
        const scene = mesh.getScene();
        // Alpha test
        if (material.needAlphaTesting()) {
            defines.push("#define ALPHATEST");
            if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UVKind)) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.UVKind);
                defines.push("#define UV1");
            }
            if (mesh.isVerticesDataPresent(Buffers_buffer/* VertexBuffer */.R.UV2Kind)) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.UV2Kind);
                defines.push("#define UV2");
            }
        }
        //Logarithmic depth
        if (material.useLogarithmicDepth) {
            defines.push("#define LOGARITHMICDEPTH");
        }
        // Clip planes
        (0,clipPlaneMaterialHelper/* prepareStringDefinesForClipPlanes */.tv)(material, scene, defines);
        // Bones
        const fallbacks = new effectFallbacks/* EffectFallbacks */.J();
        if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesKind);
            attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsKind);
            if (mesh.numBoneInfluencers > 4) {
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesIndicesExtraKind);
                attribs.push(Buffers_buffer/* VertexBuffer */.R.MatricesWeightsExtraKind);
            }
            const skeleton = mesh.skeleton;
            defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
            if (mesh.numBoneInfluencers > 0) {
                fallbacks.addCPUSkinningFallback(0, mesh);
            }
            if (skeleton.isUsingTextureForMatrices) {
                defines.push("#define BONETEXTURE");
            }
            else {
                defines.push("#define BonesPerMesh " + (skeleton.bones.length + 1));
            }
        }
        else {
            defines.push("#define NUM_BONE_INFLUENCERS 0");
        }
        // Morph targets
        const morphTargetManager = mesh.morphTargetManager;
        let numMorphInfluencers = 0;
        if (morphTargetManager) {
            numMorphInfluencers = morphTargetManager.numMaxInfluencers || morphTargetManager.numInfluencers;
            if (numMorphInfluencers > 0) {
                defines.push("#define MORPHTARGETS");
                defines.push("#define NUM_MORPH_INFLUENCERS " + numMorphInfluencers);
                if (morphTargetManager.isUsingTextureForTargets) {
                    defines.push("#define MORPHTARGETS_TEXTURE");
                }
                (0,materialHelper_functions/* PrepareAttributesForMorphTargetsInfluencers */.MF)(attribs, mesh, numMorphInfluencers);
            }
        }
        // Instances
        if (useInstances) {
            defines.push("#define INSTANCES");
            (0,materialHelper_functions/* PushAttributesForInstances */.te)(attribs);
            if (subMesh.getRenderingMesh().hasThinInstances) {
                defines.push("#define THIN_INSTANCES");
            }
        }
        // Baked vertex animations
        const bvaManager = mesh.bakedVertexAnimationManager;
        if (bvaManager && bvaManager.isEnabled) {
            defines.push("#define BAKED_VERTEX_ANIMATION_TEXTURE");
            if (useInstances) {
                attribs.push("bakedVertexAnimationSettingsInstanced");
            }
        }
        // Get correct effect
        const drawWrapper = subMesh._getDrawWrapper(renderPassId, true);
        const cachedDefines = drawWrapper.defines;
        const join = defines.join("\n");
        if (cachedDefines !== join) {
            const uniforms = [
                "world",
                "mBones",
                "viewProjection",
                "diffuseMatrix",
                "offset",
                "color",
                "logarithmicDepthConstant",
                "morphTargetInfluences",
                "boneTextureWidth",
                "morphTargetCount",
                "morphTargetTextureInfo",
                "morphTargetTextureIndices",
                "bakedVertexAnimationSettings",
                "bakedVertexAnimationTextureSizeInverted",
                "bakedVertexAnimationTime",
                "bakedVertexAnimationTexture",
            ];
            const samplers = ["diffuseSampler", "boneSampler", "morphTargets", "bakedVertexAnimationTexture"];
            (0,clipPlaneMaterialHelper/* addClipPlaneUniforms */.TV)(uniforms);
            drawWrapper.setEffect(this.scene.getEngine().createEffect("outline", {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: [],
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: null,
                onError: null,
                indexParameters: { maxSimultaneousMorphTargets: numMorphInfluencers },
                shaderLanguage: this._shaderLanguage,
                extraInitializationsAsync: async () => {
                    if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 13802)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 85520))]);
                    }
                    else {
                        await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 2641)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 99899))]);
                    }
                },
            }, this.scene.getEngine()), join);
        }
        return drawWrapper.effect.isReady();
    }
    _beforeRenderingMesh(mesh, subMesh, batch) {
        // Outline - step 1
        this._savedDepthWrite = this._engine.getDepthWrite();
        if (mesh.renderOutline) {
            const material = subMesh.getMaterial();
            if (material && material.needAlphaBlendingForMesh(mesh)) {
                this._engine.cacheStencilState();
                // Draw only to stencil buffer for the original mesh
                // The resulting stencil buffer will be used so the outline is not visible inside the mesh when the mesh is transparent
                this._engine.setDepthWrite(false);
                this._engine.setColorWrite(false);
                this._engine.setStencilBuffer(true);
                this._engine.setStencilOperationPass(7681);
                this._engine.setStencilFunction(519);
                this._engine.setStencilMask(OutlineRenderer._StencilReference);
                this._engine.setStencilFunctionReference(OutlineRenderer._StencilReference);
                this._engine.stencilStateComposer.useStencilGlobalOnly = true;
                this.render(subMesh, batch, /* This sets offset to 0 */ true, this._passIdForDrawWrapper[1]);
                this._engine.setColorWrite(true);
                this._engine.setStencilFunction(517);
            }
            // Draw the outline using the above stencil if needed to avoid drawing within the mesh
            this._engine.setDepthWrite(false);
            this.render(subMesh, batch, false, this._passIdForDrawWrapper[0]);
            this._engine.setDepthWrite(this._savedDepthWrite);
            if (material && material.needAlphaBlendingForMesh(mesh)) {
                this._engine.stencilStateComposer.useStencilGlobalOnly = false;
                this._engine.restoreStencilState();
            }
        }
    }
    _afterRenderingMesh(mesh, subMesh, batch) {
        // Overlay
        if (mesh.renderOverlay) {
            const currentMode = this._engine.getAlphaMode();
            const alphaBlendState = this._engine.alphaState.alphaBlend;
            this._engine.setAlphaMode(2);
            this.render(subMesh, batch, true, this._passIdForDrawWrapper[3]);
            this._engine.setAlphaMode(currentMode);
            this._engine.setDepthWrite(this._savedDepthWrite);
            this._engine.alphaState.alphaBlend = alphaBlendState;
        }
        // Outline - step 2
        if (mesh.renderOutline && this._savedDepthWrite) {
            this._engine.setDepthWrite(true);
            this._engine.setColorWrite(false);
            this.render(subMesh, batch, false, this._passIdForDrawWrapper[2]);
            this._engine.setColorWrite(true);
        }
    }
}
/**
 * Stencil value used to avoid outline being seen within the mesh when the mesh is transparent
 */
OutlineRenderer._StencilReference = 0x04;
//# sourceMappingURL=outlineRenderer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Rendering/renderingGroup.js
var renderingGroup = __webpack_require__(11628);
;// ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObject.js



/**
 * Defines the base object used for fluid rendering.
 * It is based on a list of vertices (particles)
 */
class FluidRenderingObject {
    /** Gets or sets the size of the particle */
    get particleSize() {
        return this._particleSize;
    }
    set particleSize(size) {
        if (size === this._particleSize) {
            return;
        }
        this._particleSize = size;
        this.onParticleSizeChanged.notifyObservers(this);
    }
    /** Indicates if the object uses instancing or not */
    get useInstancing() {
        return !this.indexBuffer;
    }
    /** Indicates if velocity of particles should be used when rendering the object. The vertex buffer set must contain a "velocity" buffer for this to work! */
    get useVelocity() {
        return this._useVelocity;
    }
    set useVelocity(use) {
        if (this._useVelocity === use || !this._hasVelocity()) {
            return;
        }
        this._useVelocity = use;
        this._effectsAreDirty = true;
    }
    _hasVelocity() {
        return !!this.vertexBuffers?.velocity;
    }
    /**
     * Gets the index buffer (or null if the object is using instancing)
     */
    get indexBuffer() {
        return null;
    }
    /**
     * @returns the name of the class
     */
    getClassName() {
        return "FluidRenderingObject";
    }
    /**
     * Gets the shader language used in this object
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Instantiates a fluid rendering object
     * @param scene The scene the object is part of
     * @param shaderLanguage The shader language to use
     */
    constructor(scene, shaderLanguage) {
        /** Defines the priority of the object. Objects will be rendered in ascending order of priority */
        this.priority = 0;
        this._particleSize = 0.1;
        /** Observable triggered when the size of the particle is changed */
        this.onParticleSizeChanged = new Misc_observable/* Observable */.cP();
        /** Defines the alpha value of a particle */
        this.particleThicknessAlpha = 0.05;
        this._useVelocity = false;
        /** Shader language used by the object */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._scene = scene;
        this._engine = scene.getEngine();
        this._effectsAreDirty = true;
        this._depthEffectWrapper = null;
        this._thicknessEffectWrapper = null;
        this._shaderLanguage = shaderLanguage ?? (this._engine.isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */);
    }
    _createEffects() {
        const uniformNames = ["view", "projection", "particleRadius", "size"];
        const attributeNames = ["position", "offset"];
        const defines = [];
        this._effectsAreDirty = false;
        if (this.useVelocity) {
            attributeNames.push("velocity");
            defines.push("#define FLUIDRENDERING_VELOCITY");
        }
        if (this._scene.useRightHandedSystem) {
            defines.push("#define FLUIDRENDERING_RHS");
        }
        this._depthEffectWrapper = new effectRenderer/* EffectWrapper */.$({
            engine: this._engine,
            useShaderStore: true,
            vertexShader: "fluidRenderingParticleDepth",
            fragmentShader: "fluidRenderingParticleDepth",
            attributeNames,
            uniformNames,
            samplerNames: [],
            defines,
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: async () => {
                if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 27499)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 67297))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 13172)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3934))]);
                }
            },
        });
        uniformNames.push("particleAlpha");
        this._thicknessEffectWrapper = new effectRenderer/* EffectWrapper */.$({
            engine: this._engine,
            useShaderStore: true,
            vertexShader: "fluidRenderingParticleThickness",
            fragmentShader: "fluidRenderingParticleThickness",
            attributeNames: ["position", "offset"],
            uniformNames,
            samplerNames: [],
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: async () => {
                if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 63866)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 84556))]);
                }
                else {
                    await Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 54577)), Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 49079))]);
                }
            },
        });
    }
    /**
     * Indicates if the object is ready to be rendered
     * @returns True if everything is ready for the object to be rendered, otherwise false
     */
    isReady() {
        if (this._effectsAreDirty) {
            this._createEffects();
        }
        if (!this._depthEffectWrapper || !this._thicknessEffectWrapper) {
            return false;
        }
        const depthEffect = this._depthEffectWrapper.drawWrapper.effect;
        const thicknessEffect = this._thicknessEffectWrapper.drawWrapper.effect;
        return depthEffect.isReady() && thicknessEffect.isReady();
    }
    /**
     * Render the depth texture for this object
     */
    renderDepthTexture() {
        const numParticles = this.numParticles;
        if (!this._depthEffectWrapper || numParticles === 0) {
            return;
        }
        const depthDrawWrapper = this._depthEffectWrapper.drawWrapper;
        const depthEffect = depthDrawWrapper.effect;
        this._engine.enableEffect(depthDrawWrapper);
        this._engine.bindBuffers(this.vertexBuffers, this.indexBuffer, depthEffect);
        depthEffect.setMatrix("view", this._scene.getViewMatrix());
        depthEffect.setMatrix("projection", this._scene.getProjectionMatrix());
        depthEffect.setFloat2("size", this._particleSize, this._particleSize);
        depthEffect.setFloat("particleRadius", this._particleSize / 2);
        if (this.useInstancing) {
            this._engine.drawArraysType(7, 0, 4, numParticles);
        }
        else {
            this._engine.drawElementsType(0, 0, numParticles);
        }
    }
    /**
     * Render the thickness texture for this object
     */
    renderThicknessTexture() {
        const numParticles = this.numParticles;
        if (!this._thicknessEffectWrapper || numParticles === 0) {
            return;
        }
        const thicknessDrawWrapper = this._thicknessEffectWrapper.drawWrapper;
        const thicknessEffect = thicknessDrawWrapper.effect;
        this._engine.setAlphaMode(6);
        this._engine.setDepthWrite(false);
        this._engine.enableEffect(thicknessDrawWrapper);
        this._engine.bindBuffers(this.vertexBuffers, this.indexBuffer, thicknessEffect);
        thicknessEffect.setMatrix("view", this._scene.getViewMatrix());
        thicknessEffect.setMatrix("projection", this._scene.getProjectionMatrix());
        thicknessEffect.setFloat("particleAlpha", this.particleThicknessAlpha);
        thicknessEffect.setFloat2("size", this._particleSize, this._particleSize);
        if (this.useInstancing) {
            this._engine.drawArraysType(7, 0, 4, numParticles);
        }
        else {
            this._engine.drawElementsType(0, 0, numParticles);
        }
        this._engine.setDepthWrite(true);
        this._engine.setAlphaMode(0);
    }
    /**
     * Render the diffuse texture for this object
     */
    renderDiffuseTexture() {
        // do nothing by default
    }
    /**
     * Releases the ressources used by the class
     */
    dispose() {
        this._depthEffectWrapper?.dispose(false);
        this._thicknessEffectWrapper?.dispose(false);
        this.onParticleSizeChanged.clear();
    }
}
//# sourceMappingURL=fluidRenderingObject.js.map
;// ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js


/**
 * Defines a rendering object based on a particle system
 */
class FluidRenderingObjectParticleSystem extends FluidRenderingObject {
    /** Gets the particle system */
    get particleSystem() {
        return this._particleSystem;
    }
    /**
     * @returns the name of the class
     */
    getClassName() {
        return "FluidRenderingObjectParticleSystem";
    }
    /**
     * Gets or sets a boolean indicating that the diffuse texture should be generated based on the regular rendering of the particle system (default: true).
     * Sometimes, generating the diffuse texture this way may be sub-optimal. In that case, you can disable this property, in which case the particle system will be
     * rendered using a ALPHA_COMBINE mode instead of the one used by the particle system.
     */
    get useTrueRenderingForDiffuseTexture() {
        return this._useTrueRenderingForDiffuseTexture;
    }
    set useTrueRenderingForDiffuseTexture(use) {
        if (this._useTrueRenderingForDiffuseTexture === use) {
            return;
        }
        this._useTrueRenderingForDiffuseTexture = use;
        if (use) {
            this._particleSystem.blendMode = this._blendMode;
            this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver);
            this._onBeforeDrawParticleObserver = null;
        }
        else {
            this._particleSystem.blendMode = -1;
            this._onBeforeDrawParticleObserver = this._particleSystem.onBeforeDrawParticlesObservable.add(() => {
                this._engine.setAlphaMode(2);
            });
        }
    }
    /**
     * Gets the vertex buffers
     */
    get vertexBuffers() {
        return this._particleSystem.vertexBuffers;
    }
    /**
     * Gets the index buffer (or null if the object is using instancing)
     */
    get indexBuffer() {
        return this._particleSystem.indexBuffer;
    }
    /**
     * Creates a new instance of the class
     * @param scene The scene the particle system is part of
     * @param ps The particle system
     * @param shaderLanguage The shader language to use
     */
    constructor(scene, ps, shaderLanguage) {
        super(scene, shaderLanguage);
        this._useTrueRenderingForDiffuseTexture = true;
        this._particleSystem = ps;
        this._originalRender = ps.render.bind(ps);
        this._blendMode = ps.blendMode;
        this._onBeforeDrawParticleObserver = null;
        this._updateInAnimate = this._particleSystem.updateInAnimate;
        this._particleSystem.updateInAnimate = true;
        this._particleSystem.render = () => 0;
        this.particleSize = (ps.minSize + ps.maxSize) / 2;
        this.useTrueRenderingForDiffuseTexture = false;
    }
    /**
     * Indicates if the object is ready to be rendered
     * @returns True if everything is ready for the object to be rendered, otherwise false
     */
    isReady() {
        return super.isReady() && this._particleSystem.isReady();
    }
    /**
     * Gets the number of particles in this particle system
     * @returns The number of particles
     */
    get numParticles() {
        return this._particleSystem.getActiveCount();
    }
    /**
     * Render the diffuse texture for this object
     */
    renderDiffuseTexture() {
        this._originalRender();
    }
    /**
     * Releases the ressources used by the class
     */
    dispose() {
        super.dispose();
        this._particleSystem.onBeforeDrawParticlesObservable.remove(this._onBeforeDrawParticleObserver);
        this._onBeforeDrawParticleObserver = null;
        this._particleSystem.render = this._originalRender;
        this._particleSystem.blendMode = this._blendMode;
        this._particleSystem.updateInAnimate = this._updateInAnimate;
    }
}
//# sourceMappingURL=fluidRenderingObjectParticleSystem.js.map
;// ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingTextures.js





/** @internal */
class FluidRenderingTextures {
    get blurNumIterations() {
        return this._blurNumIterations;
    }
    set blurNumIterations(numIterations) {
        if (this._blurNumIterations === numIterations) {
            return;
        }
        this._blurNumIterations = numIterations;
        if (this._blurPostProcesses !== null) {
            const blurX = this._blurPostProcesses[0];
            const blurY = this._blurPostProcesses[1];
            this._blurPostProcesses = [];
            for (let i = 0; i < this._blurNumIterations * 2; ++i) {
                this._blurPostProcesses[i] = i & 1 ? blurY : blurX;
            }
        }
    }
    get renderTarget() {
        return this._rt;
    }
    get renderTargetBlur() {
        return this._rtBlur;
    }
    get texture() {
        return this._texture;
    }
    get textureBlur() {
        return this._textureBlurred;
    }
    /**
     * Gets the shader language used in the texture
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    constructor(name, scene, width, height, blurTextureSizeX, blurTextureSizeY, textureType = 1, textureFormat = 6, blurTextureType = 1, blurTextureFormat = 6, useStandardBlur = false, camera = null, generateDepthBuffer = true, samples = 1, shaderLanguage) {
        this.enableBlur = true;
        this.blurSizeDivisor = 1;
        this.blurFilterSize = 7;
        this._blurNumIterations = 3;
        this.blurMaxFilterSize = 100;
        this.blurDepthScale = 10;
        this.particleSize = 0.02;
        this.onDisposeObservable = new Misc_observable/* Observable */.cP();
        /** Shader language used by the texture */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._name = name;
        this._scene = scene;
        this._camera = camera;
        this._engine = scene.getEngine();
        this._width = width;
        this._height = height;
        this._blurTextureSizeX = blurTextureSizeX;
        this._blurTextureSizeY = blurTextureSizeY;
        this._textureType = textureType;
        this._textureFormat = textureFormat;
        this._blurTextureType = blurTextureType;
        this._blurTextureFormat = blurTextureFormat;
        this._useStandardBlur = useStandardBlur;
        this._generateDepthBuffer = generateDepthBuffer;
        this._samples = samples;
        this._postProcessRunningIndex = 0;
        this.enableBlur = blurTextureSizeX !== 0 && blurTextureSizeY !== 0;
        this._rt = null;
        this._texture = null;
        this._rtBlur = null;
        this._textureBlurred = null;
        this._blurPostProcesses = null;
        this._shaderLanguage = shaderLanguage ?? (this._engine.isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */);
    }
    initialize() {
        this.dispose();
        this._createRenderTarget();
        if (this.enableBlur && this._texture) {
            const [rtBlur, textureBlurred, blurPostProcesses] = this._createBlurPostProcesses(this._texture, this._blurTextureType, this._blurTextureFormat, this.blurSizeDivisor, this._name, this._useStandardBlur);
            this._rtBlur = rtBlur;
            this._textureBlurred = textureBlurred;
            this._blurPostProcesses = blurPostProcesses;
        }
    }
    applyBlurPostProcesses() {
        if (this.enableBlur && this._blurPostProcesses) {
            this._postProcessRunningIndex = 0;
            this._scene.postProcessManager.directRender(this._blurPostProcesses, this._rtBlur, true);
            this._engine.unBindFramebuffer(this._rtBlur);
        }
    }
    _createRenderTarget() {
        this._rt = this._engine.createRenderTargetTexture({ width: this._width, height: this._height }, {
            generateMipMaps: false,
            type: this._textureType,
            format: this._textureFormat,
            samplingMode: 1,
            generateDepthBuffer: this._generateDepthBuffer,
            generateStencilBuffer: false,
            samples: this._samples,
            label: `FluidRenderingRTT-${this._name}`,
        });
        const renderTexture = this._rt.texture;
        renderTexture.incrementReferences();
        this._texture = new Textures_texture/* Texture */.g(null, this._scene);
        this._texture.name = "rtt" + this._name;
        this._texture._texture = renderTexture;
        this._texture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._texture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        this._texture.anisotropicFilteringLevel = 1;
    }
    _createBlurPostProcesses(textureBlurSource, textureType, textureFormat, blurSizeDivisor, debugName, useStandardBlur = false) {
        const engine = this._scene.getEngine();
        const targetSize = new math_vector/* Vector2 */.I9(Math.floor(this._blurTextureSizeX / blurSizeDivisor), Math.floor(this._blurTextureSizeY / blurSizeDivisor));
        const useBilinearFiltering = (textureType === 1 && engine.getCaps().textureFloatLinearFiltering) ||
            (textureType === 2 && engine.getCaps().textureHalfFloatLinearFiltering);
        const rtBlur = this._engine.createRenderTargetTexture({ width: targetSize.x, height: targetSize.y }, {
            generateMipMaps: false,
            type: textureType,
            format: textureFormat,
            samplingMode: useBilinearFiltering ? 2 : 1,
            generateDepthBuffer: false,
            generateStencilBuffer: false,
            samples: this._samples,
            label: `FluidRenderingRTTBlur-${debugName}`,
        });
        const renderTexture = rtBlur.texture;
        renderTexture.incrementReferences();
        const texture = new Textures_texture/* Texture */.g(null, this._scene);
        texture.name = "rttBlurred" + debugName;
        texture._texture = renderTexture;
        texture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        texture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
        texture.anisotropicFilteringLevel = 1;
        if (useStandardBlur) {
            const kernelBlurXPostprocess = new PostProcesses_postProcess/* PostProcess */.w("BilateralBlurX", "fluidRenderingStandardBlur", ["filterSize", "blurDir"], null, 1, null, 1, engine, true, null, textureType, undefined, undefined, undefined, textureFormat, this._shaderLanguage, async () => {
                if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 21570));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 75679));
                }
            });
            kernelBlurXPostprocess.samples = this._samples;
            kernelBlurXPostprocess.externalTextureSamplerBinding = true;
            kernelBlurXPostprocess.onApplyObservable.add((effect) => {
                if (this._postProcessRunningIndex === 0) {
                    effect.setTexture("textureSampler", textureBlurSource);
                }
                else {
                    effect._bindTexture("textureSampler", kernelBlurXPostprocess.inputTexture.texture);
                }
                effect.setInt("filterSize", this.blurFilterSize);
                effect.setFloat2("blurDir", 1 / this._blurTextureSizeX, 0);
                this._postProcessRunningIndex++;
            });
            kernelBlurXPostprocess.onSizeChangedObservable.add(() => {
                kernelBlurXPostprocess._textures.forEach((rt) => {
                    rt.texture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                    rt.texture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                });
            });
            this._fixReusablePostProcess(kernelBlurXPostprocess);
            const kernelBlurYPostprocess = new PostProcesses_postProcess/* PostProcess */.w("BilateralBlurY", "fluidRenderingStandardBlur", ["filterSize", "blurDir"], null, 1, null, 1, engine, true, null, textureType, undefined, undefined, undefined, textureFormat, this._shaderLanguage, async () => {
                if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 21570));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 75679));
                }
            });
            kernelBlurYPostprocess.samples = this._samples;
            kernelBlurYPostprocess.onApplyObservable.add((effect) => {
                effect.setInt("filterSize", this.blurFilterSize);
                effect.setFloat2("blurDir", 0, 1 / this._blurTextureSizeY);
                this._postProcessRunningIndex++;
            });
            kernelBlurYPostprocess.onSizeChangedObservable.add(() => {
                kernelBlurYPostprocess._textures.forEach((rt) => {
                    rt.texture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                    rt.texture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                });
            });
            this._fixReusablePostProcess(kernelBlurYPostprocess);
            kernelBlurXPostprocess.autoClear = false;
            kernelBlurYPostprocess.autoClear = false;
            const blurList = [];
            for (let i = 0; i < this._blurNumIterations * 2; ++i) {
                blurList[i] = i & 1 ? kernelBlurYPostprocess : kernelBlurXPostprocess;
            }
            return [rtBlur, texture, blurList];
        }
        else {
            const uniforms = ["maxFilterSize", "blurDir", "projectedParticleConstant", "depthThreshold"];
            const kernelBlurXPostprocess = new PostProcesses_postProcess/* PostProcess */.w("BilateralBlurX", "fluidRenderingBilateralBlur", uniforms, null, 1, null, 1, engine, true, null, textureType, undefined, undefined, undefined, textureFormat, this._shaderLanguage, async () => {
                if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 97163));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 91932));
                }
            });
            kernelBlurXPostprocess.samples = this._samples;
            kernelBlurXPostprocess.externalTextureSamplerBinding = true;
            kernelBlurXPostprocess.onApplyObservable.add((effect) => {
                if (this._postProcessRunningIndex === 0) {
                    effect.setTexture("textureSampler", textureBlurSource);
                }
                else {
                    effect._bindTexture("textureSampler", kernelBlurXPostprocess.inputTexture.texture);
                }
                effect.setInt("maxFilterSize", this.blurMaxFilterSize);
                effect.setFloat2("blurDir", 1 / this._blurTextureSizeX, 0);
                effect.setFloat("projectedParticleConstant", this._getProjectedParticleConstant());
                effect.setFloat("depthThreshold", this._getDepthThreshold());
                this._postProcessRunningIndex++;
            });
            kernelBlurXPostprocess.onSizeChangedObservable.add(() => {
                kernelBlurXPostprocess._textures.forEach((rt) => {
                    rt.texture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                    rt.texture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                });
            });
            this._fixReusablePostProcess(kernelBlurXPostprocess);
            const kernelBlurYPostprocess = new PostProcesses_postProcess/* PostProcess */.w("BilateralBlurY", "fluidRenderingBilateralBlur", uniforms, null, 1, null, 1, engine, true, null, textureType, undefined, undefined, undefined, textureFormat, this._shaderLanguage, async () => {
                if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 97163));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 91932));
                }
            });
            kernelBlurYPostprocess.samples = this._samples;
            kernelBlurYPostprocess.onApplyObservable.add((effect) => {
                effect.setInt("maxFilterSize", this.blurMaxFilterSize);
                effect.setFloat2("blurDir", 0, 1 / this._blurTextureSizeY);
                effect.setFloat("projectedParticleConstant", this._getProjectedParticleConstant());
                effect.setFloat("depthThreshold", this._getDepthThreshold());
                this._postProcessRunningIndex++;
            });
            kernelBlurYPostprocess.onSizeChangedObservable.add(() => {
                kernelBlurYPostprocess._textures.forEach((rt) => {
                    rt.texture.wrapU = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                    rt.texture.wrapV = Textures_texture/* Texture */.g.CLAMP_ADDRESSMODE;
                });
            });
            this._fixReusablePostProcess(kernelBlurYPostprocess);
            kernelBlurXPostprocess.autoClear = false;
            kernelBlurYPostprocess.autoClear = false;
            const blurList = [];
            for (let i = 0; i < this._blurNumIterations * 2; ++i) {
                blurList[i] = i & 1 ? kernelBlurYPostprocess : kernelBlurXPostprocess;
            }
            return [rtBlur, texture, blurList];
        }
    }
    _fixReusablePostProcess(pp) {
        if (!pp.isReusable()) {
            return;
        }
        pp.onActivateObservable.add(() => {
            // undo what calling activate() does which will make sure we will retrieve the right texture when getting the input for the post process
            pp._currentRenderTextureInd = (pp._currentRenderTextureInd + 1) % 2;
        });
        pp.onApplyObservable.add(() => {
            // now we can advance to the next texture
            pp._currentRenderTextureInd = (pp._currentRenderTextureInd + 1) % 2;
        });
    }
    _getProjectedParticleConstant() {
        return (this.blurFilterSize * this.particleSize * 0.05 * (this._height / 2)) / Math.tan((this._camera?.fov ?? (45 * Math.PI) / 180) / 2);
    }
    _getDepthThreshold() {
        return (this.particleSize / 2) * this.blurDepthScale;
    }
    dispose() {
        if (this.onDisposeObservable.hasObservers()) {
            this.onDisposeObservable.notifyObservers(this);
        }
        this.onDisposeObservable.clear();
        this._rt?.dispose();
        this._rt = null;
        this._texture?.dispose();
        this._texture = null;
        this._rtBlur?.dispose();
        this._rtBlur = null;
        this._textureBlurred?.dispose();
        this._textureBlurred = null;
        if (this._blurPostProcesses) {
            this._blurPostProcesses[0].dispose();
            this._blurPostProcesses[1].dispose();
        }
        this._blurPostProcesses = null;
    }
}
//# sourceMappingURL=fluidRenderingTextures.js.map
;// ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js






/**
 * Textures that can be displayed as a debugging tool
 */
var FluidRenderingDebug;
(function (FluidRenderingDebug) {
    FluidRenderingDebug[FluidRenderingDebug["DepthTexture"] = 0] = "DepthTexture";
    FluidRenderingDebug[FluidRenderingDebug["DepthBlurredTexture"] = 1] = "DepthBlurredTexture";
    FluidRenderingDebug[FluidRenderingDebug["ThicknessTexture"] = 2] = "ThicknessTexture";
    FluidRenderingDebug[FluidRenderingDebug["ThicknessBlurredTexture"] = 3] = "ThicknessBlurredTexture";
    FluidRenderingDebug[FluidRenderingDebug["DiffuseTexture"] = 4] = "DiffuseTexture";
    FluidRenderingDebug[FluidRenderingDebug["Normals"] = 5] = "Normals";
    FluidRenderingDebug[FluidRenderingDebug["DiffuseRendering"] = 6] = "DiffuseRendering";
})(FluidRenderingDebug || (FluidRenderingDebug = {}));
/**
 * Class used to render an object as a fluid thanks to different render target textures (depth, thickness, diffuse)
 */
class FluidRenderingTargetRenderer {
    /**
     * Returns true if the class needs to be reinitialized (because of changes in parameterization)
     */
    get needInitialization() {
        return this._needInitialization;
    }
    /**
     * Gets or sets a boolean indicating that the diffuse texture should be generated and used for the rendering
     */
    get generateDiffuseTexture() {
        return this._generateDiffuseTexture;
    }
    set generateDiffuseTexture(generate) {
        if (this._generateDiffuseTexture === generate) {
            return;
        }
        this._generateDiffuseTexture = generate;
        this._needInitialization = true;
    }
    /**
     * Gets or sets the feature (texture) to be debugged. Not used if debug is false
     */
    get debugFeature() {
        return this._debugFeature;
    }
    set debugFeature(feature) {
        if (this._debugFeature === feature) {
            return;
        }
        this._needInitialization = true;
        this._debugFeature = feature;
    }
    /**
     * Gets or sets a boolean indicating if we should display a specific texture (given by debugFeature) for debugging purpose
     */
    get debug() {
        return this._debug;
    }
    set debug(debug) {
        if (this._debug === debug) {
            return;
        }
        this._debug = debug;
        this._needInitialization = true;
    }
    /**
     * Gets or sets the environment map used for the reflection part of the shading
     * If null, no map will be used. If undefined, the scene.environmentMap will be used (if defined)
     */
    get environmentMap() {
        return this._environmentMap;
    }
    set environmentMap(map) {
        if (this._environmentMap === map) {
            return;
        }
        this._needInitialization = true;
        this._environmentMap = map;
    }
    /**
     * Gets or sets a boolean indicating that the depth texture should be blurred
     */
    get enableBlurDepth() {
        return this._enableBlurDepth;
    }
    set enableBlurDepth(enable) {
        if (this._enableBlurDepth === enable) {
            return;
        }
        this._enableBlurDepth = enable;
        this._needInitialization = true;
    }
    /**
     * Gets or sets the depth size divisor (positive number, generally between 1 and 4), which is used as a divisor when creating the texture used for blurring the depth
     * For eg. if blurDepthSizeDivisor=2, the texture used to blur the depth will be half the size of the depth texture
     */
    get blurDepthSizeDivisor() {
        return this._blurDepthSizeDivisor;
    }
    set blurDepthSizeDivisor(scale) {
        if (this._blurDepthSizeDivisor === scale) {
            return;
        }
        this._blurDepthSizeDivisor = scale;
        this._needInitialization = true;
    }
    /**
     * Size of the kernel used to filter the depth blur texture (positive number, generally between 1 and 20 - higher values will require more processing power from the GPU)
     */
    get blurDepthFilterSize() {
        return this._blurDepthFilterSize;
    }
    set blurDepthFilterSize(filterSize) {
        if (this._blurDepthFilterSize === filterSize) {
            return;
        }
        this._blurDepthFilterSize = filterSize;
        this._setBlurParameters();
    }
    /**
     * Number of blurring iterations used to generate the depth blur texture (positive number, generally between 1 and 10 - higher values will require more processing power from the GPU)
     */
    get blurDepthNumIterations() {
        return this._blurDepthNumIterations;
    }
    set blurDepthNumIterations(numIterations) {
        if (this._blurDepthNumIterations === numIterations) {
            return;
        }
        this._blurDepthNumIterations = numIterations;
        this._setBlurParameters();
    }
    /**
     * Maximum size of the kernel used to blur the depth texture (positive number, generally between 1 and 200 - higher values will require more processing power from the GPU when the particles are larger on screen)
     */
    get blurDepthMaxFilterSize() {
        return this._blurDepthMaxFilterSize;
    }
    set blurDepthMaxFilterSize(maxFilterSize) {
        if (this._blurDepthMaxFilterSize === maxFilterSize) {
            return;
        }
        this._blurDepthMaxFilterSize = maxFilterSize;
        this._setBlurParameters();
    }
    /**
     * Depth weight in the calculation when applying the bilateral blur to generate the depth blur texture (positive number, generally between 0 and 100)
     */
    get blurDepthDepthScale() {
        return this._blurDepthDepthScale;
    }
    set blurDepthDepthScale(scale) {
        if (this._blurDepthDepthScale === scale) {
            return;
        }
        this._blurDepthDepthScale = scale;
        this._setBlurParameters();
    }
    /**
     * Gets or sets a boolean indicating that the thickness texture should be blurred
     */
    get enableBlurThickness() {
        return this._enableBlurThickness;
    }
    set enableBlurThickness(enable) {
        if (this._enableBlurThickness === enable) {
            return;
        }
        this._enableBlurThickness = enable;
        this._needInitialization = true;
    }
    /**
     * Gets or sets the thickness size divisor (positive number, generally between 1 and 4), which is used as a divisor when creating the texture used for blurring the thickness
     * For eg. if blurThicknessSizeDivisor=2, the texture used to blur the thickness will be half the size of the thickness texture
     */
    get blurThicknessSizeDivisor() {
        return this._blurThicknessSizeDivisor;
    }
    set blurThicknessSizeDivisor(scale) {
        if (this._blurThicknessSizeDivisor === scale) {
            return;
        }
        this._blurThicknessSizeDivisor = scale;
        this._needInitialization = true;
    }
    /**
     * Size of the kernel used to filter the thickness blur texture (positive number, generally between 1 and 20 - higher values will require more processing power from the GPU)
     */
    get blurThicknessFilterSize() {
        return this._blurThicknessFilterSize;
    }
    set blurThicknessFilterSize(filterSize) {
        if (this._blurThicknessFilterSize === filterSize) {
            return;
        }
        this._blurThicknessFilterSize = filterSize;
        this._setBlurParameters();
    }
    /**
     * Number of blurring iterations used to generate the thickness blur texture (positive number, generally between 1 and 10 - higher values will require more processing power from the GPU)
     */
    get blurThicknessNumIterations() {
        return this._blurThicknessNumIterations;
    }
    set blurThicknessNumIterations(numIterations) {
        if (this._blurThicknessNumIterations === numIterations) {
            return;
        }
        this._blurThicknessNumIterations = numIterations;
        this._setBlurParameters();
    }
    /**
     * Gets or sets a boolean indicating that a fixed thickness should be used instead of generating a thickness texture
     */
    get useFixedThickness() {
        return this._useFixedThickness;
    }
    set useFixedThickness(use) {
        if (this._useFixedThickness === use) {
            return;
        }
        this._useFixedThickness = use;
        this._needInitialization = true;
    }
    /**
     * Gets or sets a boolean indicating that the velocity should be used when rendering the particles as a fluid.
     * Note: the vertex buffers must contain a "velocity" buffer for this to work!
     */
    get useVelocity() {
        return this._useVelocity;
    }
    set useVelocity(use) {
        if (this._useVelocity === use) {
            return;
        }
        this._useVelocity = use;
        this._needInitialization = true;
        this._onUseVelocityChanged.notifyObservers(this);
    }
    /**
     * Defines the size of the depth texture.
     * If null, the texture will have the size of the screen
     */
    get depthMapSize() {
        return this._depthMapSize;
    }
    set depthMapSize(size) {
        if (this._depthMapSize === size) {
            return;
        }
        this._depthMapSize = size;
        this._needInitialization = true;
    }
    /**
     * Defines the size of the thickness texture.
     * If null, the texture will have the size of the screen
     */
    get thicknessMapSize() {
        return this._thicknessMapSize;
    }
    set thicknessMapSize(size) {
        if (this._thicknessMapSize === size) {
            return;
        }
        this._thicknessMapSize = size;
        this._needInitialization = true;
    }
    /**
     * Defines the size of the diffuse texture.
     * If null, the texture will have the size of the screen
     */
    get diffuseMapSize() {
        return this._diffuseMapSize;
    }
    set diffuseMapSize(size) {
        if (this._diffuseMapSize === size) {
            return;
        }
        this._diffuseMapSize = size;
        this._needInitialization = true;
    }
    /**
     * Gets or sets the number of samples used by MSAA
     * Note: changing this value in WebGL does not work because depth/stencil textures can't be created with MSAA (see https://github.com/BabylonJS/Babylon.js/issues/12444)
     */
    get samples() {
        return this._samples;
    }
    set samples(samples) {
        if (this._samples === samples) {
            return;
        }
        this._samples = samples;
        this._needInitialization = true;
    }
    /**
     * If compositeMode is true (default: false), when the alpha value of the background (the scene rendered without the fluid objects) is 0, the final alpha value of the pixel will be set to the thickness value.
     * This way, it is possible to composite the fluid rendering on top of the HTML background.
     */
    get compositeMode() {
        return this._compositeMode;
    }
    set compositeMode(value) {
        if (this._compositeMode === value) {
            return;
        }
        this._compositeMode = value;
        this._needInitialization = true;
    }
    /**
     * Gets the camera used for the rendering
     */
    get camera() {
        return this._camera;
    }
    /**
     * Gets the shader language used in this renderer
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Creates an instance of the class
     * @param scene Scene used to render the fluid object into
     * @param camera Camera used to render the fluid object. If not provided, use the active camera of the scene instead
     * @param shaderLanguage The shader language to use
     */
    constructor(scene, camera, shaderLanguage) {
        this._generateDiffuseTexture = false;
        /**
         * Fluid color. Not used if generateDiffuseTexture is true
         */
        this.fluidColor = new math_color/* Color3 */.v9(0.085, 0.6375, 0.765);
        /**
         * Density of the fluid (positive number). The higher the value, the more opaque the fluid.
         */
        this.density = 2;
        /**
         * Strength of the refraction (positive number, but generally between 0 and 0.3).
         */
        this.refractionStrength = 0.1;
        /**
         * Strength of the fresnel effect (value between 0 and 1). Lower the value if you want to soften the specular effect
         */
        this.fresnelClamp = 1.0;
        /**
         * Strength of the specular power (positive number). Increase the value to make the specular effect more concentrated
         */
        this.specularPower = 250;
        /**
         * Minimum thickness of the particles (positive number). If useFixedThickness is true, minimumThickness is the thickness used
         */
        this.minimumThickness = 0;
        /**
         * Direction of the light. The fluid is assumed to be lit by a directional light
         */
        this.dirLight = new math_vector/* Vector3 */.Pq(-2, -1, 1).normalize();
        this._debugFeature = 1 /* FluidRenderingDebug.DepthBlurredTexture */;
        this._debug = false;
        this._enableBlurDepth = true;
        this._blurDepthSizeDivisor = 1;
        this._blurDepthFilterSize = 7;
        this._blurDepthNumIterations = 3;
        this._blurDepthMaxFilterSize = 100;
        this._blurDepthDepthScale = 10;
        this._enableBlurThickness = true;
        this._blurThicknessSizeDivisor = 1;
        this._blurThicknessFilterSize = 5;
        this._blurThicknessNumIterations = 1;
        this._useFixedThickness = false;
        /** @internal */
        this._onUseVelocityChanged = new Misc_observable/* Observable */.cP();
        this._useVelocity = false;
        this._depthMapSize = null;
        this._thicknessMapSize = null;
        this._diffuseMapSize = null;
        this._samples = 1;
        this._compositeMode = false;
        /** Shader language used by the renderer */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._scene = scene;
        this._engine = scene.getEngine();
        this._camera = camera ?? scene.activeCamera;
        this._needInitialization = true;
        this._bgDepthTexture = null;
        this._invProjectionMatrix = new math_vector/* Matrix */.uq();
        this._depthClearColor = new math_color/* Color4 */.ov(1e6, 1e6, 1e6, 1);
        this._thicknessClearColor = new math_color/* Color4 */.ov(0, 0, 0, 1);
        this._depthRenderTarget = null;
        this._diffuseRenderTarget = null;
        this._thicknessRenderTarget = null;
        this._renderPostProcess = null;
        this._shaderLanguage = shaderLanguage ?? (this._engine.isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */);
    }
    /** @internal */
    _initialize() {
        this.dispose();
        this._needInitialization = false;
        const depthWidth = this._depthMapSize ?? this._engine.getRenderWidth();
        const depthHeight = this._depthMapSize !== null ? Math.round((this._depthMapSize * this._engine.getRenderHeight()) / this._engine.getRenderWidth()) : this._engine.getRenderHeight();
        this._depthRenderTarget = new FluidRenderingTextures("Depth", this._scene, depthWidth, depthHeight, depthWidth, depthHeight, 1, 7, 1, 7, false, this._camera, true, this._samples, this._shaderLanguage);
        this._initializeRenderTarget(this._depthRenderTarget);
        if (this.generateDiffuseTexture) {
            const diffuseWidth = this._diffuseMapSize ?? this._engine.getRenderWidth();
            const diffuseHeight = this._diffuseMapSize !== null
                ? Math.round((this._diffuseMapSize * this._engine.getRenderHeight()) / this._engine.getRenderWidth())
                : this._engine.getRenderHeight();
            this._diffuseRenderTarget = new FluidRenderingTextures("Diffuse", this._scene, diffuseWidth, diffuseHeight, 0, 0, 0, 5, 0, 5, true, this._camera, true, this._samples, this._shaderLanguage);
            this._initializeRenderTarget(this._diffuseRenderTarget);
        }
        const thicknessWidth = this._thicknessMapSize ?? this._engine.getRenderWidth();
        const thicknessHeight = this._thicknessMapSize !== null
            ? Math.round((this._thicknessMapSize * this._engine.getRenderHeight()) / this._engine.getRenderWidth())
            : this._engine.getRenderHeight();
        if (!this._useFixedThickness) {
            this._thicknessRenderTarget = new FluidRenderingTextures("Thickness", this._scene, thicknessWidth, thicknessHeight, thicknessWidth, thicknessHeight, 2, 6, 2, 6, true, this._camera, false, this._samples, this._shaderLanguage);
            this._initializeRenderTarget(this._thicknessRenderTarget);
        }
        this._createLiquidRenderingPostProcess();
    }
    _setBlurParameters(renderTarget = null) {
        if (renderTarget === null || renderTarget === this._depthRenderTarget) {
            this._setBlurDepthParameters();
        }
        if (renderTarget === null || renderTarget === this._thicknessRenderTarget) {
            this._setBlurThicknessParameters();
        }
    }
    _setBlurDepthParameters() {
        if (!this._depthRenderTarget) {
            return;
        }
        this._depthRenderTarget.blurFilterSize = this.blurDepthFilterSize;
        this._depthRenderTarget.blurMaxFilterSize = this.blurDepthMaxFilterSize;
        this._depthRenderTarget.blurNumIterations = this.blurDepthNumIterations;
        this._depthRenderTarget.blurDepthScale = this.blurDepthDepthScale;
    }
    _setBlurThicknessParameters() {
        if (!this._thicknessRenderTarget) {
            return;
        }
        this._thicknessRenderTarget.blurFilterSize = this.blurThicknessFilterSize;
        this._thicknessRenderTarget.blurNumIterations = this.blurThicknessNumIterations;
    }
    _initializeRenderTarget(renderTarget) {
        if (renderTarget !== this._diffuseRenderTarget) {
            renderTarget.enableBlur = renderTarget === this._depthRenderTarget ? this.enableBlurDepth : this.enableBlurThickness;
            renderTarget.blurSizeDivisor = renderTarget === this._depthRenderTarget ? this.blurDepthSizeDivisor : this.blurThicknessSizeDivisor;
        }
        this._setBlurParameters(renderTarget);
        renderTarget.initialize();
    }
    _createLiquidRenderingPostProcess() {
        const engine = this._scene.getEngine();
        const uniformNames = [
            "viewMatrix",
            "projectionMatrix",
            "invProjectionMatrix",
            "texelSize",
            "dirLight",
            "cameraFar",
            "density",
            "refractionStrength",
            "fresnelClamp",
            "specularPower",
        ];
        const samplerNames = ["depthSampler"];
        const defines = [];
        this.dispose(true);
        if (!this._camera) {
            return;
        }
        const texture = this._depthRenderTarget.enableBlur ? this._depthRenderTarget.textureBlur : this._depthRenderTarget.texture;
        const texelSize = new math_vector/* Vector2 */.I9(1 / texture.getSize().width, 1 / texture.getSize().height);
        if (this._scene.useRightHandedSystem) {
            defines.push("#define FLUIDRENDERING_RHS");
        }
        if (this._environmentMap !== null) {
            const envMap = this._environmentMap ?? this._scene.environmentTexture;
            if (envMap) {
                samplerNames.push("reflectionSampler");
                defines.push("#define FLUIDRENDERING_ENVIRONMENT");
            }
        }
        if (this._diffuseRenderTarget) {
            samplerNames.push("diffuseSampler");
            defines.push("#define FLUIDRENDERING_DIFFUSETEXTURE");
        }
        else {
            uniformNames.push("diffuseColor");
        }
        if (this._useVelocity) {
            samplerNames.push("velocitySampler");
            defines.push("#define FLUIDRENDERING_VELOCITY");
        }
        if (this._useFixedThickness) {
            uniformNames.push("thickness");
            samplerNames.push("bgDepthSampler");
            defines.push("#define FLUIDRENDERING_FIXED_THICKNESS");
        }
        else {
            uniformNames.push("minimumThickness");
            samplerNames.push("thicknessSampler");
        }
        if (this._compositeMode) {
            defines.push("#define FLUIDRENDERING_COMPOSITE_MODE");
        }
        if (this._debug) {
            defines.push("#define FLUIDRENDERING_DEBUG");
            if (this._debugFeature === 5 /* FluidRenderingDebug.Normals */) {
                defines.push("#define FLUIDRENDERING_DEBUG_SHOWNORMAL");
            }
            else if (this._debugFeature === 6 /* FluidRenderingDebug.DiffuseRendering */) {
                defines.push("#define FLUIDRENDERING_DEBUG_DIFFUSERENDERING");
            }
            else {
                defines.push("#define FLUIDRENDERING_DEBUG_TEXTURE");
                samplerNames.push("debugSampler");
                if (this._debugFeature === 0 /* FluidRenderingDebug.DepthTexture */ || this._debugFeature === 1 /* FluidRenderingDebug.DepthBlurredTexture */) {
                    defines.push("#define FLUIDRENDERING_DEBUG_DEPTH");
                }
            }
        }
        this._renderPostProcess = new PostProcesses_postProcess/* PostProcess */.w("FluidRendering", "fluidRenderingRender", uniformNames, samplerNames, 1, null, 2, engine, false, null, 0, undefined, undefined, true, undefined, this._shaderLanguage, async () => {
            if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 52150));
            }
            else {
                await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3399));
            }
        });
        this._renderPostProcess.updateEffect(defines.join("\n"));
        this._renderPostProcess.samples = this._samples;
        const engineWebGPU = engine;
        const setTextureSampler = engineWebGPU.setTextureSampler;
        this._renderPostProcess.onApplyObservable.add((effect) => {
            this._invProjectionMatrix.copyFrom(this._scene.getProjectionMatrix());
            this._invProjectionMatrix.invert();
            if (setTextureSampler) {
                setTextureSampler.call(engineWebGPU, "textureSamplerSampler", this._renderPostProcess.inputTexture.texture);
            }
            if (!this._depthRenderTarget.enableBlur) {
                effect.setTexture("depthSampler", this._depthRenderTarget.texture);
                if (setTextureSampler) {
                    setTextureSampler.call(engineWebGPU, "depthSamplerSampler", this._depthRenderTarget.texture?.getInternalTexture() ?? null);
                }
            }
            else {
                effect.setTexture("depthSampler", this._depthRenderTarget.textureBlur);
                if (setTextureSampler) {
                    setTextureSampler.call(engineWebGPU, "depthSamplerSampler", this._depthRenderTarget.textureBlur?.getInternalTexture() ?? null);
                }
            }
            if (this._diffuseRenderTarget) {
                if (!this._diffuseRenderTarget.enableBlur) {
                    effect.setTexture("diffuseSampler", this._diffuseRenderTarget.texture);
                    if (setTextureSampler) {
                        setTextureSampler.call(engineWebGPU, "diffuseSamplerSampler", this._diffuseRenderTarget.texture?.getInternalTexture() ?? null);
                    }
                }
                else {
                    effect.setTexture("diffuseSampler", this._diffuseRenderTarget.textureBlur);
                    if (setTextureSampler) {
                        setTextureSampler.call(engineWebGPU, "diffuseSamplerSampler", this._diffuseRenderTarget.textureBlur?.getInternalTexture() ?? null);
                    }
                }
            }
            else {
                effect.setColor3("diffuseColor", this.fluidColor);
            }
            if (this._useFixedThickness) {
                effect.setFloat("thickness", this.minimumThickness);
                effect._bindTexture("bgDepthSampler", this._bgDepthTexture);
                if (setTextureSampler) {
                    setTextureSampler.call(engineWebGPU, "bgDepthSamplerSampler", this._bgDepthTexture ?? null);
                }
            }
            else {
                if (!this._thicknessRenderTarget.enableBlur) {
                    effect.setTexture("thicknessSampler", this._thicknessRenderTarget.texture);
                    if (setTextureSampler) {
                        setTextureSampler.call(engineWebGPU, "thicknessSamplerSampler", this._thicknessRenderTarget.texture?.getInternalTexture() ?? null);
                    }
                }
                else {
                    effect.setTexture("thicknessSampler", this._thicknessRenderTarget.textureBlur);
                    if (setTextureSampler) {
                        setTextureSampler.call(engineWebGPU, "thicknessSamplerSampler", this._thicknessRenderTarget.textureBlur?.getInternalTexture() ?? null);
                    }
                }
                effect.setFloat("minimumThickness", this.minimumThickness);
            }
            if (this._environmentMap !== null) {
                const envMap = this._environmentMap ?? this._scene.environmentTexture;
                if (envMap) {
                    effect.setTexture("reflectionSampler", envMap);
                    if (setTextureSampler) {
                        setTextureSampler.call(engineWebGPU, "reflectionSamplerSampler", envMap?.getInternalTexture() ?? null);
                    }
                }
            }
            effect.setMatrix("viewMatrix", this._scene.getViewMatrix());
            effect.setMatrix("invProjectionMatrix", this._invProjectionMatrix);
            effect.setMatrix("projectionMatrix", this._scene.getProjectionMatrix());
            effect.setVector2("texelSize", texelSize);
            effect.setFloat("density", this.density);
            effect.setFloat("refractionStrength", this.refractionStrength);
            effect.setFloat("fresnelClamp", this.fresnelClamp);
            effect.setFloat("specularPower", this.specularPower);
            effect.setVector3("dirLight", this.dirLight);
            effect.setFloat("cameraFar", this._camera.maxZ);
            if (this._debug) {
                let texture = null;
                switch (this._debugFeature) {
                    case 0 /* FluidRenderingDebug.DepthTexture */:
                        texture = this._depthRenderTarget.texture;
                        break;
                    case 1 /* FluidRenderingDebug.DepthBlurredTexture */:
                        texture = this._depthRenderTarget.enableBlur ? this._depthRenderTarget.textureBlur : this._depthRenderTarget.texture;
                        break;
                    case 2 /* FluidRenderingDebug.ThicknessTexture */:
                        texture = this._thicknessRenderTarget?.texture ?? null;
                        break;
                    case 3 /* FluidRenderingDebug.ThicknessBlurredTexture */:
                        texture = this._thicknessRenderTarget?.enableBlur ? (this._thicknessRenderTarget?.textureBlur ?? null) : (this._thicknessRenderTarget?.texture ?? null);
                        break;
                    case 4 /* FluidRenderingDebug.DiffuseTexture */:
                        if (this._diffuseRenderTarget) {
                            texture = this._diffuseRenderTarget.texture;
                        }
                        break;
                }
                if (this._debugFeature !== 5 /* FluidRenderingDebug.Normals */) {
                    effect.setTexture("debugSampler", texture);
                    if (setTextureSampler) {
                        setTextureSampler.call(engineWebGPU, "debugSamplerSampler", texture?.getInternalTexture() ?? null);
                    }
                }
            }
        });
    }
    /** @internal */
    _clearTargets() {
        if (this._depthRenderTarget?.renderTarget) {
            this._engine.bindFramebuffer(this._depthRenderTarget.renderTarget);
            this._engine.clear(this._depthClearColor, true, true, false);
            this._engine.unBindFramebuffer(this._depthRenderTarget.renderTarget);
        }
        if (this._diffuseRenderTarget?.renderTarget) {
            this._engine.bindFramebuffer(this._diffuseRenderTarget.renderTarget);
            this._engine.clear(this._thicknessClearColor, true, true, false);
            this._engine.unBindFramebuffer(this._diffuseRenderTarget.renderTarget);
        }
        if (this._thicknessRenderTarget?.renderTarget) {
            this._engine.bindFramebuffer(this._thicknessRenderTarget.renderTarget);
            // we don't clear the depth buffer because it is the depth buffer that is coming from the scene and that we reuse in the thickness rendering pass
            this._engine.clear(this._thicknessClearColor, true, false, false);
            this._engine.unBindFramebuffer(this._thicknessRenderTarget.renderTarget);
        }
    }
    /** @internal */
    _render(fluidObject) {
        if (this._needInitialization || !fluidObject.isReady()) {
            return;
        }
        const currentRenderTarget = this._engine._currentRenderTarget;
        this._engine.setState(false, undefined, undefined, undefined, true);
        this._engine.setDepthBuffer(true);
        this._engine.setDepthWrite(true);
        this._engine.setAlphaMode(0);
        // Render the particles in the depth texture
        if (this._depthRenderTarget?.renderTarget) {
            this._engine.bindFramebuffer(this._depthRenderTarget.renderTarget);
            fluidObject.renderDepthTexture();
            this._engine.unbindInstanceAttributes();
            this._engine.unBindFramebuffer(this._depthRenderTarget.renderTarget);
        }
        // Render the particles in the diffuse texture
        if (this._diffuseRenderTarget?.renderTarget) {
            this._engine.bindFramebuffer(this._diffuseRenderTarget.renderTarget);
            fluidObject.renderDiffuseTexture();
            this._engine.unbindInstanceAttributes();
            this._engine.unBindFramebuffer(this._diffuseRenderTarget.renderTarget);
        }
        // Render the particles in the thickness texture
        if (this._thicknessRenderTarget?.renderTarget) {
            this._engine.bindFramebuffer(this._thicknessRenderTarget.renderTarget);
            fluidObject.renderThicknessTexture();
            this._engine.unbindInstanceAttributes();
            this._engine.unBindFramebuffer(this._thicknessRenderTarget.renderTarget);
        }
        // Run the blur post processes
        this._depthRenderTarget?.applyBlurPostProcesses();
        this._diffuseRenderTarget?.applyBlurPostProcesses();
        this._thicknessRenderTarget?.applyBlurPostProcesses();
        if (currentRenderTarget) {
            this._engine.bindFramebuffer(currentRenderTarget);
        }
    }
    /**
     * Releases all the ressources used by the class
     * @param onlyPostProcesses If true, releases only the ressources used by the render post processes
     */
    dispose(onlyPostProcesses = false) {
        if (!onlyPostProcesses) {
            this._depthRenderTarget?.dispose();
            this._depthRenderTarget = null;
            this._diffuseRenderTarget?.dispose();
            this._diffuseRenderTarget = null;
            this._thicknessRenderTarget?.dispose();
            this._thicknessRenderTarget = null;
        }
        if (this._renderPostProcess && this._camera) {
            this._camera.detachPostProcess(this._renderPostProcess);
        }
        this._renderPostProcess?.dispose();
        this._renderPostProcess = null;
        this._onUseVelocityChanged.clear();
        this._needInitialization = false;
    }
}
//# sourceMappingURL=fluidRenderingTargetRenderer.js.map
;// ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js




/**
 * Defines a rendering object based on a list of custom buffers
 * The list must contain at least a "position" buffer!
 */
class FluidRenderingObjectCustomParticles extends FluidRenderingObject {
    /**
     * @returns the name of the class
     */
    getClassName() {
        return "FluidRenderingObjectCustomParticles";
    }
    /**
     * Gets the vertex buffers
     */
    get vertexBuffers() {
        return this._vertexBuffers;
    }
    /**
     * Creates a new instance of the class
     * @param scene The scene the particles should be rendered into
     * @param buffers The list of buffers (must contain at least one "position" buffer!). Note that you don't have to pass all (or any!) buffers at once in the constructor, you can use the addBuffers method to add more later.
     * @param numParticles Number of vertices to take into account from the buffers
     * @param shaderLanguage The shader language to use
     */
    constructor(scene, buffers, numParticles, shaderLanguage) {
        super(scene, shaderLanguage);
        this._numParticles = numParticles;
        this._diffuseEffectWrapper = null;
        this._vertexBuffers = {};
        this.addBuffers(buffers);
    }
    /**
     * Add some new buffers
     * @param buffers List of buffers
     */
    addBuffers(buffers) {
        for (const name in buffers) {
            let stride;
            let instanced = true;
            switch (name) {
                case "velocity":
                    stride = 3;
                    break;
                case "offset":
                    instanced = false;
                    break;
            }
            this._vertexBuffers[name] = new Buffers_buffer/* VertexBuffer */.R(this._engine, buffers[name], name, true, false, stride, instanced);
        }
    }
    _createEffects() {
        super._createEffects();
        const uniformNames = ["view", "projection", "size"];
        const attributeNames = ["position", "offset", "color"];
        this._diffuseEffectWrapper = new effectRenderer/* EffectWrapper */.$({
            engine: this._engine,
            useShaderStore: true,
            vertexShader: "fluidRenderingParticleDiffuse",
            fragmentShader: "fluidRenderingParticleDiffuse",
            attributeNames,
            uniformNames,
            samplerNames: [],
            shaderLanguage: this._shaderLanguage,
            extraInitializationsAsync: async () => {
                if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 75636));
                }
                else {
                    await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 23483));
                }
            },
        });
    }
    /**
     * Indicates if the object is ready to be rendered
     * @returns True if everything is ready for the object to be rendered, otherwise false
     */
    isReady() {
        if (!this._vertexBuffers["offset"]) {
            this._vertexBuffers["offset"] = new Buffers_buffer/* VertexBuffer */.R(this._engine, [0, 0, 1, 0, 0, 1, 1, 1], "offset", false, false, 2);
        }
        return super.isReady() && (this._diffuseEffectWrapper?.effect.isReady() ?? false);
    }
    /**
     * Gets the number of particles in this object
     * @returns The number of particles
     */
    get numParticles() {
        return this._numParticles;
    }
    /**
     * Sets the number of particles in this object
     * @param num The number of particles to take into account
     */
    setNumParticles(num) {
        this._numParticles = num;
    }
    /**
     * Render the diffuse texture for this object
     */
    renderDiffuseTexture() {
        const numParticles = this.numParticles;
        if (!this._diffuseEffectWrapper || numParticles === 0) {
            return;
        }
        const diffuseDrawWrapper = this._diffuseEffectWrapper.drawWrapper;
        const diffuseEffect = diffuseDrawWrapper.effect;
        this._engine.enableEffect(diffuseDrawWrapper);
        this._engine.bindBuffers(this.vertexBuffers, this.indexBuffer, diffuseEffect);
        diffuseEffect.setMatrix("view", this._scene.getViewMatrix());
        diffuseEffect.setMatrix("projection", this._scene.getProjectionMatrix());
        if (this._particleSize !== null) {
            diffuseEffect.setFloat2("size", this._particleSize, this._particleSize);
        }
        if (this.useInstancing) {
            this._engine.drawArraysType(7, 0, 4, numParticles);
        }
        else {
            this._engine.drawElementsType(0, 0, numParticles);
        }
    }
    /**
     * Releases the ressources used by the class
     */
    dispose() {
        super.dispose();
        this._diffuseEffectWrapper?.dispose();
        for (const name in this._vertexBuffers) {
            this._vertexBuffers[name].dispose();
        }
        this._vertexBuffers = {};
    }
}
//# sourceMappingURL=fluidRenderingObjectCustomParticles.js.map
;// ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js


/** @internal */
class FluidRenderingDepthTextureCopy {
    get depthRTWrapper() {
        return this._depthRTWrapper;
    }
    constructor(engine, width, height, samples = 1) {
        this._engine = engine;
        this._copyTextureToTexture = new CopyTextureToTexture(engine, true);
        this._depthRTWrapper = this._engine.createRenderTargetTexture({ width, height }, {
            generateMipMaps: false,
            type: 0,
            format: 6,
            samplingMode: 1,
            generateDepthBuffer: true,
            generateStencilBuffer: false,
            samples,
            noColorAttachment: true,
            label: "FluidRenderingDepthTextureCopyRTT",
        });
        const depthTexture = this._depthRTWrapper.createDepthStencilTexture(0, false, false, 1, undefined, "FluidRenderingDepthTextureCopyRTTDepthStencil");
        depthTexture.label = `FluidDepthTextureCopy${width}x${height}x${samples}`;
    }
    copy(source) {
        return this._copyTextureToTexture.copy(source, this._depthRTWrapper);
    }
    dispose() {
        this._depthRTWrapper.dispose();
        this._copyTextureToTexture.dispose();
    }
}
//# sourceMappingURL=fluidRenderingDepthTextureCopy.js.map
;// ./node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderer.js







Object.defineProperty(core_scene/* Scene */.Z.prototype, "fluidRenderer", {
    get: function () {
        return this._fluidRenderer;
    },
    set: function (value) {
        this._fluidRenderer = value;
    },
    enumerable: true,
    configurable: true,
});
core_scene/* Scene */.Z.prototype.enableFluidRenderer = function () {
    if (this._fluidRenderer) {
        return this._fluidRenderer;
    }
    this._fluidRenderer = new FluidRenderer(this);
    return this._fluidRenderer;
};
core_scene/* Scene */.Z.prototype.disableFluidRenderer = function () {
    this._fluidRenderer?.dispose();
    this._fluidRenderer = null;
};
function IsParticleSystemObject(obj) {
    return !!obj.particleSystem;
}
function IsCustomParticlesObject(obj) {
    return !!obj.addBuffers;
}
/**
 * Defines the fluid renderer scene component responsible to render objects as fluids
 */
class FluidRendererSceneComponent {
    /**
     * Creates a new instance of the component for the given scene
     * @param scene Defines the scene to register the component in
     */
    constructor(scene) {
        /**
         * The component name helpful to identify the component in the list of scene components.
         */
        this.name = sceneComponent/* SceneComponentConstants */.v.NAME_FLUIDRENDERER;
        this.scene = scene;
    }
    /**
     * Registers the component in a given scene
     */
    register() {
        this.scene._gatherActiveCameraRenderTargetsStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER, this, this._gatherActiveCameraRenderTargets);
        this.scene._afterCameraDrawStage.registerStep(sceneComponent/* SceneComponentConstants */.v.STEP_AFTERCAMERADRAW_FLUIDRENDERER, this, this._afterCameraDraw);
    }
    _gatherActiveCameraRenderTargets(_renderTargets) {
        this.scene.fluidRenderer?._prepareRendering();
    }
    _afterCameraDraw(camera) {
        this.scene.fluidRenderer?._render(camera);
    }
    /**
     * Rebuilds the elements related to this component in case of
     * context lost for instance.
     */
    rebuild() {
        const fluidRenderer = this.scene.fluidRenderer;
        if (!fluidRenderer) {
            return;
        }
        const buffers = new Set();
        for (let i = 0; i < fluidRenderer.renderObjects.length; ++i) {
            const obj = fluidRenderer.renderObjects[i].object;
            if (IsCustomParticlesObject(obj)) {
                const vbuffers = obj.vertexBuffers;
                for (const name in vbuffers) {
                    buffers.add(vbuffers[name].getWrapperBuffer());
                }
            }
        }
        buffers.forEach((buffer) => {
            buffer._rebuild();
        });
    }
    /**
     * Disposes the component and the associated resources
     */
    dispose() {
        this.scene.disableFluidRenderer();
    }
}
/**
 * Class responsible for fluid rendering.
 * It is implementing the method described in https://developer.download.nvidia.com/presentations/2010/gdc/Direct3D_Effects.pdf
 */
class FluidRenderer {
    /** @internal */
    static _SceneComponentInitialization(scene) {
        let component = scene._getComponent(sceneComponent/* SceneComponentConstants */.v.NAME_FLUIDRENDERER);
        if (!component) {
            component = new FluidRendererSceneComponent(scene);
            scene._addComponent(component);
        }
    }
    /**
     * Gets the shader language used in this renderer
     */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Initializes the class
     * @param scene Scene in which the objects are part of
     */
    constructor(scene) {
        /** Shader language used by the renderer */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._scene = scene;
        this._engine = scene.getEngine();
        this._onEngineResizeObserver = null;
        this.renderObjects = [];
        this.targetRenderers = [];
        this._cameras = new Map();
        FluidRenderer._SceneComponentInitialization(this._scene);
        this._onEngineResizeObserver = this._engine.onResizeObservable.add(() => {
            this._initialize();
        });
        const engine = this._engine;
        if (engine.isWebGPU) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
        }
    }
    /**
     * Reinitializes the class
     * Can be used if you change the object priority (FluidRenderingObject.priority), to make sure the objects are rendered in the right order
     */
    recreate() {
        this._sortRenderingObjects();
        this._initialize();
    }
    /**
     * Gets the render object corresponding to a particle system (null if the particle system is not rendered as a fluid)
     * @param ps The particle system
     * @returns the render object corresponding to this particle system if any, otherwise null
     */
    getRenderObjectFromParticleSystem(ps) {
        const index = this._getParticleSystemIndex(ps);
        return index !== -1 ? this.renderObjects[index] : null;
    }
    /**
     * Adds a particle system to the fluid renderer.
     * @param ps particle system
     * @param generateDiffuseTexture True if you want to generate a diffuse texture from the particle system and use it as part of the fluid rendering (default: false)
     * @param targetRenderer The target renderer used to display the particle system as a fluid. If not provided, the method will create a new one
     * @param camera The camera used by the target renderer (if the target renderer is created by the method)
     * @returns the render object corresponding to the particle system
     */
    addParticleSystem(ps, generateDiffuseTexture, targetRenderer, camera) {
        const object = new FluidRenderingObjectParticleSystem(this._scene, ps, this._shaderLanguage);
        object.onParticleSizeChanged.add(() => this._setParticleSizeForRenderTargets());
        if (!targetRenderer) {
            targetRenderer = new FluidRenderingTargetRenderer(this._scene, camera, this._shaderLanguage);
            this.targetRenderers.push(targetRenderer);
        }
        if (!targetRenderer._onUseVelocityChanged.hasObservers()) {
            targetRenderer._onUseVelocityChanged.add(() => this._setUseVelocityForRenderObject());
        }
        if (generateDiffuseTexture !== undefined) {
            targetRenderer.generateDiffuseTexture = generateDiffuseTexture;
        }
        const renderObject = { object, targetRenderer };
        this.renderObjects.push(renderObject);
        this._sortRenderingObjects();
        this._setParticleSizeForRenderTargets();
        return renderObject;
    }
    /**
     * Adds a custom particle set to the fluid renderer.
     * @param buffers The list of buffers (should contain at least a "position" buffer!)
     * @param numParticles Number of particles in each buffer
     * @param generateDiffuseTexture True if you want to generate a diffuse texture from buffers and use it as part of the fluid rendering (default: false). For the texture to be generated correctly, you need a "color" buffer in the set!
     * @param targetRenderer The target renderer used to display the particle system as a fluid. If not provided, the method will create a new one
     * @param camera The camera used by the target renderer (if the target renderer is created by the method)
     * @returns the render object corresponding to the custom particle set
     */
    addCustomParticles(buffers, numParticles, generateDiffuseTexture, targetRenderer, camera) {
        const object = new FluidRenderingObjectCustomParticles(this._scene, buffers, numParticles, this._shaderLanguage);
        object.onParticleSizeChanged.add(() => this._setParticleSizeForRenderTargets());
        if (!targetRenderer) {
            targetRenderer = new FluidRenderingTargetRenderer(this._scene, camera, this._shaderLanguage);
            this.targetRenderers.push(targetRenderer);
        }
        if (!targetRenderer._onUseVelocityChanged.hasObservers()) {
            targetRenderer._onUseVelocityChanged.add(() => this._setUseVelocityForRenderObject());
        }
        if (generateDiffuseTexture !== undefined) {
            targetRenderer.generateDiffuseTexture = generateDiffuseTexture;
        }
        const renderObject = { object, targetRenderer };
        this.renderObjects.push(renderObject);
        this._sortRenderingObjects();
        this._setParticleSizeForRenderTargets();
        return renderObject;
    }
    /**
     * Removes a render object from the fluid renderer
     * @param renderObject the render object to remove
     * @param removeUnusedTargetRenderer True to remove/dispose of the target renderer if it's not used anymore (default: true)
     * @returns True if the render object has been found and released, else false
     */
    removeRenderObject(renderObject, removeUnusedTargetRenderer = true) {
        const index = this.renderObjects.indexOf(renderObject);
        if (index === -1) {
            return false;
        }
        renderObject.object.dispose();
        this.renderObjects.splice(index, 1);
        if (removeUnusedTargetRenderer && this._removeUnusedTargetRenderers()) {
            this._initialize();
        }
        else {
            this._setParticleSizeForRenderTargets();
        }
        return true;
    }
    _sortRenderingObjects() {
        this.renderObjects.sort((a, b) => {
            return a.object.priority < b.object.priority ? -1 : a.object.priority > b.object.priority ? 1 : 0;
        });
    }
    _removeUnusedTargetRenderers() {
        const indexes = {};
        for (let i = 0; i < this.renderObjects.length; ++i) {
            const targetRenderer = this.renderObjects[i].targetRenderer;
            indexes[this.targetRenderers.indexOf(targetRenderer)] = true;
        }
        let removed = false;
        const newList = [];
        for (let i = 0; i < this.targetRenderers.length; ++i) {
            if (!indexes[i]) {
                this.targetRenderers[i].dispose();
                removed = true;
            }
            else {
                newList.push(this.targetRenderers[i]);
            }
        }
        if (removed) {
            this.targetRenderers.length = 0;
            this.targetRenderers.push(...newList);
        }
        return removed;
    }
    _getParticleSystemIndex(ps) {
        for (let i = 0; i < this.renderObjects.length; ++i) {
            const obj = this.renderObjects[i].object;
            if (IsParticleSystemObject(obj) && obj.particleSystem === ps) {
                return i;
            }
        }
        return -1;
    }
    _initialize() {
        for (let i = 0; i < this.targetRenderers.length; ++i) {
            this.targetRenderers[i].dispose();
        }
        const cameras = new Map();
        for (let i = 0; i < this.targetRenderers.length; ++i) {
            const targetRenderer = this.targetRenderers[i];
            targetRenderer._initialize();
            if (targetRenderer.camera && targetRenderer._renderPostProcess) {
                let list = cameras.get(targetRenderer.camera);
                if (!list) {
                    list = [[], {}];
                    cameras.set(targetRenderer.camera, list);
                }
                list[0].push(targetRenderer);
                targetRenderer.camera.attachPostProcess(targetRenderer._renderPostProcess, i);
            }
        }
        let iterator = cameras.keys();
        for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
            const camera = key.value;
            const list = cameras.get(camera);
            const firstPostProcess = camera._getFirstPostProcess();
            if (!firstPostProcess) {
                continue;
            }
            const [targetRenderers, copyDepthTextures] = list;
            firstPostProcess.onSizeChangedObservable.add(() => {
                if (!firstPostProcess.inputTexture.depthStencilTexture) {
                    firstPostProcess.inputTexture.createDepthStencilTexture(0, true, this._engine.isStencilEnable, targetRenderers[0].samples, this._engine.isStencilEnable ? 13 : 14, `PostProcessRTTDepthStencil-${firstPostProcess.name}`);
                }
                for (const targetRenderer of targetRenderers) {
                    const thicknessRT = targetRenderer._thicknessRenderTarget?.renderTarget;
                    const thicknessTexture = thicknessRT?.texture;
                    if (thicknessRT && thicknessTexture) {
                        const key = thicknessTexture.width + "_" + thicknessTexture.height;
                        let copyDepthTexture = copyDepthTextures[key];
                        if (!copyDepthTexture) {
                            copyDepthTexture = copyDepthTextures[key] = new FluidRenderingDepthTextureCopy(this._engine, thicknessTexture.width, thicknessTexture.height);
                        }
                        copyDepthTexture.depthRTWrapper.shareDepth(thicknessRT);
                    }
                }
            });
        }
        // Dispose the CopyDepthTexture instances that we don't need anymore
        iterator = this._cameras.keys();
        for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
            const camera = key.value;
            const list = this._cameras.get(camera);
            const copyDepthTextures = list[1];
            const list2 = cameras.get(camera);
            if (!list2) {
                for (const key in copyDepthTextures) {
                    copyDepthTextures[key].dispose();
                }
            }
            else {
                for (const key in copyDepthTextures) {
                    if (!list2[1][key]) {
                        copyDepthTextures[key].dispose();
                    }
                }
            }
        }
        this._cameras.clear();
        this._cameras = cameras;
        this._setParticleSizeForRenderTargets();
    }
    _setParticleSizeForRenderTargets() {
        const particleSizes = new Map();
        for (let i = 0; i < this.renderObjects.length; ++i) {
            const renderingObject = this.renderObjects[i];
            let curSize = particleSizes.get(renderingObject.targetRenderer);
            if (curSize === undefined) {
                curSize = 0;
            }
            particleSizes.set(renderingObject.targetRenderer, Math.max(curSize, renderingObject.object.particleSize));
        }
        particleSizes.forEach((particleSize, targetRenderer) => {
            if (targetRenderer._depthRenderTarget) {
                targetRenderer._depthRenderTarget.particleSize = particleSize;
            }
        });
    }
    _setUseVelocityForRenderObject() {
        for (const renderingObject of this.renderObjects) {
            renderingObject.object.useVelocity = renderingObject.targetRenderer.useVelocity;
        }
    }
    /** @internal */
    _prepareRendering() {
        for (const renderer of this.targetRenderers) {
            if (renderer.needInitialization) {
                this._initialize();
                return;
            }
        }
    }
    /** @internal */
    _render(forCamera) {
        for (let i = 0; i < this.targetRenderers.length; ++i) {
            if (!forCamera || this.targetRenderers[i].camera === forCamera) {
                this.targetRenderers[i]._clearTargets();
            }
        }
        const iterator = this._cameras.keys();
        for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
            const camera = key.value;
            const list = this._cameras.get(camera);
            if (forCamera && camera !== forCamera) {
                continue;
            }
            const firstPostProcess = camera._getFirstPostProcess();
            if (!firstPostProcess) {
                continue;
            }
            const sourceCopyDepth = firstPostProcess.inputTexture?.depthStencilTexture;
            if (sourceCopyDepth) {
                const [targetRenderers, copyDepthTextures] = list;
                for (const targetRenderer of targetRenderers) {
                    targetRenderer._bgDepthTexture = sourceCopyDepth;
                }
                for (const key in copyDepthTextures) {
                    copyDepthTextures[key].copy(sourceCopyDepth);
                }
            }
        }
        for (let i = 0; i < this.renderObjects.length; ++i) {
            const renderingObject = this.renderObjects[i];
            if (!forCamera || renderingObject.targetRenderer.camera === forCamera) {
                renderingObject.targetRenderer._render(renderingObject.object);
            }
        }
    }
    /**
     * Disposes of all the ressources used by the class
     */
    dispose() {
        this._engine.onResizeObservable.remove(this._onEngineResizeObserver);
        this._onEngineResizeObserver = null;
        for (let i = 0; i < this.renderObjects.length; ++i) {
            this.renderObjects[i].object.dispose();
        }
        for (let i = 0; i < this.targetRenderers.length; ++i) {
            this.targetRenderers[i].dispose();
        }
        this._cameras.forEach((list) => {
            const copyDepthTextures = list[1];
            for (const key in copyDepthTextures) {
                copyDepthTextures[key].dispose();
            }
        });
        this.renderObjects = [];
        this.targetRenderers = [];
        this._cameras.clear();
    }
}
//# sourceMappingURL=fluidRenderer.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDepth.vertex.js
var fluidRenderingParticleDepth_vertex = __webpack_require__(13172);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDepth.fragment.js
var fluidRenderingParticleDepth_fragment = __webpack_require__(3934);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleThickness.vertex.js
var fluidRenderingParticleThickness_vertex = __webpack_require__(54577);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleThickness.fragment.js
var fluidRenderingParticleThickness_fragment = __webpack_require__(49079);
;// ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDiffuse.vertex.js
// Do not edit.

const fluidRenderingParticleDiffuse_vertex_name = "fluidRenderingParticleDiffuseVertexShader";
const fluidRenderingParticleDiffuse_vertex_shader = `attribute vec3 position;attribute vec2 offset;attribute vec4 color;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;diffuseColor=color.rgb;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[fluidRenderingParticleDiffuse_vertex_name] = fluidRenderingParticleDiffuse_vertex_shader;
/** @internal */
const fluidRenderingParticleDiffuseVertexShader = { name: fluidRenderingParticleDiffuse_vertex_name, shader: fluidRenderingParticleDiffuse_vertex_shader };
//# sourceMappingURL=fluidRenderingParticleDiffuse.vertex.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDiffuse.fragment.js
var fluidRenderingParticleDiffuse_fragment = __webpack_require__(23483);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingBilateralBlur.fragment.js
var fluidRenderingBilateralBlur_fragment = __webpack_require__(91932);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingStandardBlur.fragment.js
var fluidRenderingStandardBlur_fragment = __webpack_require__(75679);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/fluidRenderingRender.fragment.js
var fluidRenderingRender_fragment = __webpack_require__(3399);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fluidRenderingParticleDepth.vertex.js
var ShadersWGSL_fluidRenderingParticleDepth_vertex = __webpack_require__(27499);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fluidRenderingParticleDepth.fragment.js
var ShadersWGSL_fluidRenderingParticleDepth_fragment = __webpack_require__(67297);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fluidRenderingParticleThickness.vertex.js
var ShadersWGSL_fluidRenderingParticleThickness_vertex = __webpack_require__(63866);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fluidRenderingParticleThickness.fragment.js
var ShadersWGSL_fluidRenderingParticleThickness_fragment = __webpack_require__(84556);
;// ./node_modules/@babylonjs/core/ShadersWGSL/fluidRenderingParticleDiffuse.vertex.js
// Do not edit.

const ShadersWGSL_fluidRenderingParticleDiffuse_vertex_name = "fluidRenderingParticleDiffuseVertexShader";
const ShadersWGSL_fluidRenderingParticleDiffuse_vertex_shader = `attribute position: vec3f;attribute offset: vec2f;attribute color: vec4f;uniform view: mat4x4f;uniform projection: mat4x4f;uniform size: vec2f;varying uv: vec2f;varying diffuseColor: vec3f;@vertex
fn main(input: VertexInputs)->FragmentInputs {var cornerPos: vec3f=vec3f(
vec2f(input.offset.x-0.5,input.offset.y-0.5)*uniforms.size,
0.0
);var viewPos: vec3f=(uniforms.view*vec4f(input.position,1.0)).xyz+cornerPos;vertexOutputs.position=uniforms.projection*vec4f(viewPos,1.0);vertexOutputs.uv=input.offset;vertexOutputs.diffuseColor=input.color.rgb;}
`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[ShadersWGSL_fluidRenderingParticleDiffuse_vertex_name] = ShadersWGSL_fluidRenderingParticleDiffuse_vertex_shader;
/** @internal */
const fluidRenderingParticleDiffuseVertexShaderWGSL = { name: ShadersWGSL_fluidRenderingParticleDiffuse_vertex_name, shader: ShadersWGSL_fluidRenderingParticleDiffuse_vertex_shader };
//# sourceMappingURL=fluidRenderingParticleDiffuse.vertex.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fluidRenderingParticleDiffuse.fragment.js
var ShadersWGSL_fluidRenderingParticleDiffuse_fragment = __webpack_require__(75636);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fluidRenderingBilateralBlur.fragment.js
var ShadersWGSL_fluidRenderingBilateralBlur_fragment = __webpack_require__(97163);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fluidRenderingStandardBlur.fragment.js
var ShadersWGSL_fluidRenderingStandardBlur_fragment = __webpack_require__(21570);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/fluidRenderingRender.fragment.js
var ShadersWGSL_fluidRenderingRender_fragment = __webpack_require__(52150);
;// ./node_modules/@babylonjs/core/Rendering/fluidRenderer/index.js























//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Rendering/reflectiveShadowMap.js

/**
 * Reflective Shadow Maps were first described in http://www.klayge.org/material/3_12/GI/rsm.pdf by Carsten Dachsbacher and Marc Stamminger
 * The ReflectiveShadowMap class only implements the position / normal / flux texture generation part.
 * For the global illumination effect, see the GIRSMManager class.
 */










/**
 * Class used to generate the RSM (Reflective Shadow Map) textures for a given light.
 * The textures are: position (in world space), normal (in world space) and flux (light intensity)
 */
class ReflectiveShadowMap {
    /**
     * Enables or disables the RSM generation.
     */
    get enable() {
        return this._enable;
    }
    set enable(value) {
        if (this._enable === value) {
            return;
        }
        this._enable = value;
        this._customRenderTarget(value);
    }
    /**
     * Gets the position texture generated by the RSM process.
     */
    get positionWorldTexture() {
        return this._mrt.textures[0];
    }
    /**
     * Gets the normal texture generated by the RSM process.
     */
    get normalWorldTexture() {
        return this._mrt.textures[1];
    }
    /**
     * Gets the flux texture generated by the RSM process.
     */
    get fluxTexture() {
        return this._mrt.textures[2];
    }
    /**
     * Gets the render list used to generate the RSM textures.
     */
    get renderList() {
        return this._mrt.renderList;
    }
    /**
     * Gets the light used to generate the RSM textures.
     */
    get light() {
        return this._light;
    }
    /**
     * Creates a new RSM for the given light.
     * @param scene The scene
     * @param light The light to use to generate the RSM textures
     * @param textureDimensions The dimensions of the textures to generate. Default: \{ width: 512, height: 512 \}
     */
    constructor(scene, light, textureDimensions = { width: 512, height: 512 }) {
        this._lightTransformMatrix = math_vector/* Matrix */.uq.Identity();
        this._enable = false;
        /**
         * Gets or sets a boolean indicating if the light parameters should be recomputed even if the light parameters (position, direction) did not change.
         * You should not set this value to true, except for debugging purpose (if you want to see changes from the inspector, for eg).
         * Instead, you should call updateLightParameters() explicitely at the right time (once the light parameters changed).
         */
        this.forceUpdateLightParameters = false;
        this._scene = scene;
        this._light = light;
        this._textureDimensions = textureDimensions;
        this._regularMatToMatWithPlugin = new Map();
        this._counters = [{ name: "RSM Generation " + light.name, value: 0 }];
        this._createMultiRenderTarget();
        this._recomputeLightTransformationMatrix();
        this.enable = true;
    }
    /**
     * Sets the dimensions of the textures to generate.
     * @param dimensions The dimensions of the textures to generate.
     */
    setTextureDimensions(dimensions) {
        const renderList = this._mrt.renderList;
        this._textureDimensions = dimensions;
        this._disposeMultiRenderTarget();
        this._createMultiRenderTarget();
        renderList?.forEach((mesh) => {
            this._addMeshToMRT(mesh);
        });
    }
    /**
     * Adds the given mesh to the render list used to generate the RSM textures.
     * @param mesh The mesh to add to the render list used to generate the RSM textures. If not provided, all scene meshes will be added to the render list.
     */
    addMesh(mesh) {
        if (mesh) {
            this._addMeshToMRT(mesh);
        }
        else {
            this._scene.meshes.forEach((mesh) => {
                this._addMeshToMRT(mesh);
            });
        }
        this._recomputeLightTransformationMatrix();
    }
    /**
     * Recomputes the light transformation matrix. Call this method if you manually changed the light position / direction / etc. and you want to update the RSM textures accordingly.
     * You should also call this method if you add/remove meshes to/from the render list.
     */
    updateLightParameters() {
        this._recomputeLightTransformationMatrix();
    }
    /**
     * Gets the light transformation matrix used to generate the RSM textures.
     */
    get lightTransformationMatrix() {
        if (this.forceUpdateLightParameters) {
            this.updateLightParameters();
        }
        return this._lightTransformMatrix;
    }
    /**
     * Gets the GPU time spent to generate the RSM textures.
     */
    get countersGPU() {
        return this._counters;
    }
    /**
     * Disposes the RSM.
     */
    dispose() {
        this._disposeMultiRenderTarget();
    }
    _createMultiRenderTarget() {
        const name = this._light.name;
        const caps = this._scene.getEngine().getCaps();
        const fluxTextureType = caps.rg11b10ufColorRenderable ? 13 : 2;
        const fluxTextureFormat = caps.rg11b10ufColorRenderable ? 4 : 5;
        this._mrt = new MultiRenderTarget("RSMmrt_" + name, this._textureDimensions, 3, // number of RTT - position / normal / flux
        this._scene, {
            types: [2, 11, fluxTextureType],
            samplingModes: [2, 2, 2],
            generateMipMaps: false,
            targetTypes: [3553, 3553, 3553],
            formats: [5, 5, fluxTextureFormat],
        }, ["RSMPosition_" + name, "RSMNormal_" + name, "RSMFlux_" + name]);
        this._mrt.renderList = [];
        this._mrt.clearColor = new math_color/* Color4 */.ov(0, 0, 0, 1);
        this._mrt.noPrePassRenderer = true;
        let sceneUBO;
        let currentSceneUBO;
        const useUBO = this._scene.getEngine().supportsUniformBuffers;
        if (useUBO) {
            sceneUBO = this._scene.createSceneUniformBuffer(`Scene for RSM (light "${name}")`);
        }
        let shadowEnabled;
        this._mrt.onBeforeBindObservable.add(() => {
            currentSceneUBO = this._scene.getSceneUniformBuffer();
            shadowEnabled = this._light.shadowEnabled;
            this._light.shadowEnabled = false; // we render from the light point of view, so we won't have any shadow anyway!
        });
        this._mrt.onBeforeRenderObservable.add((faceIndex) => {
            if (sceneUBO) {
                this._scene.setSceneUniformBuffer(sceneUBO);
            }
            const viewMatrix = this._light.getViewMatrix(faceIndex);
            const projectionMatrix = this._light.getProjectionMatrix(viewMatrix || undefined, this._mrt.renderList || undefined);
            if (viewMatrix && projectionMatrix) {
                this._scene.setTransformMatrix(viewMatrix, projectionMatrix);
            }
            if (useUBO) {
                this._scene.getSceneUniformBuffer().unbindEffect();
                this._scene.finalizeSceneUbo();
            }
        });
        this._mrt.onAfterUnbindObservable.add(() => {
            if (sceneUBO) {
                this._scene.setSceneUniformBuffer(currentSceneUBO);
            }
            this._scene.updateTransformMatrix(); // restore the view/projection matrices of the active camera
            this._light.shadowEnabled = shadowEnabled;
            this._counters[0].value = this._mrt.renderTarget.gpuTimeInFrame?.counter.lastSecAverage ?? 0;
        });
        this._customRenderTarget(true);
    }
    _customRenderTarget(add) {
        const idx = this._scene.customRenderTargets.indexOf(this._mrt);
        if (add) {
            if (idx === -1) {
                this._scene.customRenderTargets.push(this._mrt);
            }
        }
        else if (idx !== -1) {
            this._scene.customRenderTargets.splice(idx, 1);
        }
    }
    _recomputeLightTransformationMatrix() {
        const viewMatrix = this._light.getViewMatrix();
        const projectionMatrix = this._light.getProjectionMatrix(viewMatrix || undefined, this._mrt.renderList || undefined);
        if (viewMatrix && projectionMatrix) {
            viewMatrix.multiplyToRef(projectionMatrix, this._lightTransformMatrix);
        }
    }
    _addMeshToMRT(mesh) {
        this._mrt.renderList?.push(mesh);
        const material = mesh.material;
        if (mesh.getTotalVertices() === 0 || !material) {
            return;
        }
        let rsmMaterial = this._regularMatToMatWithPlugin.get(material);
        if (!rsmMaterial) {
            rsmMaterial = material.clone("RSMCreate_" + material.name) || undefined;
            if (rsmMaterial) {
                // Disable the prepass renderer for this material
                Object.defineProperty(rsmMaterial, "canRenderToMRT", {
                    get: function () {
                        return false;
                    },
                    enumerable: true,
                    configurable: true,
                });
                rsmMaterial.disableLighting = true;
                const rsmCreatePlugin = new RSMCreatePluginMaterial(rsmMaterial);
                rsmCreatePlugin.isEnabled = true;
                rsmCreatePlugin.light = this._light;
                this._regularMatToMatWithPlugin.set(material, rsmMaterial);
            }
        }
        this._mrt.setMaterialForRendering(mesh, rsmMaterial);
    }
    _disposeMultiRenderTarget() {
        this._customRenderTarget(false);
        this._mrt.dispose();
    }
}
/**
 * @internal
 */
class MaterialRSMCreateDefines extends materialDefines/* MaterialDefines */.M {
    constructor() {
        super(...arguments);
        this.RSMCREATE = false;
        this.RSMCREATE_PROJTEXTURE = false;
        this.RSMCREATE_LIGHT_IS_SPOT = false;
    }
}
/**
 * Plugin that implements the creation of the RSM textures
 */
class RSMCreatePluginMaterial extends materialPluginBase/* MaterialPluginBase */.y {
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a give shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    /**
     * Create a new RSMCreatePluginMaterial
     * @param material Parent material of the plugin
     */
    constructor(material) {
        super(material, RSMCreatePluginMaterial.Name, 300, new MaterialRSMCreateDefines());
        this._lightColor = new math_color/* Color3 */.v9();
        this._hasProjectionTexture = false;
        this._isEnabled = false;
        /**
         * Defines if the plugin is enabled in the material.
         */
        this.isEnabled = false;
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
        this._varAlbedoName = material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d ? "surfaceAlbedo" : "baseColor.rgb";
    }
    prepareDefines(defines) {
        defines.RSMCREATE = this._isEnabled;
        this._hasProjectionTexture = false;
        const isSpot = this.light.getTypeID() === Lights_light/* Light */.v.LIGHTTYPEID_SPOTLIGHT;
        if (isSpot) {
            const spot = this.light;
            this._hasProjectionTexture = spot.projectionTexture ? spot.projectionTexture.isReady() : false;
        }
        defines.RSMCREATE_PROJTEXTURE = this._hasProjectionTexture;
        defines.RSMCREATE_LIGHT_IS_SPOT = isSpot;
        defines.SCENE_MRT_COUNT = 3;
    }
    getClassName() {
        return "RSMCreatePluginMaterial";
    }
    getUniforms() {
        return {
            ubo: [
                { name: "rsmTextureProjectionMatrix", size: 16, type: "mat4" },
                { name: "rsmSpotInfo", size: 4, type: "vec4" },
                { name: "rsmLightColor", size: 3, type: "vec3" },
                { name: "rsmLightPosition", size: 3, type: "vec3" },
            ],
            fragment: `#ifdef RSMCREATE
                    uniform mat4 rsmTextureProjectionMatrix;
                    uniform vec4 rsmSpotInfo;
                    uniform vec3 rsmLightColor;
                    uniform vec3 rsmLightPosition;
                #endif`,
        };
    }
    getSamplers(samplers) {
        samplers.push("rsmTextureProjectionSampler");
    }
    bindForSubMesh(uniformBuffer) {
        if (!this._isEnabled) {
            return;
        }
        this.light.diffuse.scaleToRef(this.light.getScaledIntensity(), this._lightColor);
        uniformBuffer.updateColor3("rsmLightColor", this._lightColor);
        if (this.light.getTypeID() === Lights_light/* Light */.v.LIGHTTYPEID_SPOTLIGHT) {
            const spot = this.light;
            if (this._hasProjectionTexture) {
                uniformBuffer.updateMatrix("rsmTextureProjectionMatrix", spot.projectionTextureMatrix);
                uniformBuffer.setTexture("rsmTextureProjectionSampler", spot.projectionTexture);
            }
            const normalizeDirection = math_vector/* TmpVectors */.AA.Vector3[0];
            if (spot.computeTransformedInformation()) {
                uniformBuffer.updateFloat3("rsmLightPosition", this.light.transformedPosition.x, this.light.transformedPosition.y, this.light.transformedPosition.z);
                spot.transformedDirection.normalizeToRef(normalizeDirection);
            }
            else {
                uniformBuffer.updateFloat3("rsmLightPosition", this.light.position.x, this.light.position.y, this.light.position.z);
                spot.direction.normalizeToRef(normalizeDirection);
            }
            uniformBuffer.updateFloat4("rsmSpotInfo", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, Math.cos(spot.angle * 0.5));
        }
    }
    getCustomCode(shaderType, shaderLanguage) {
        if (shaderType === "vertex") {
            return null;
        }
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            return {
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_DEFINITIONS: `
                #ifdef RSMCREATE
                    #ifdef RSMCREATE_PROJTEXTURE
                        var rsmTextureProjectionSamplerSampler: sampler;
                        var rsmTextureProjectionSampler: texture_2d<f32>;
                    #endif
                #endif
            `,
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR: `
                #ifdef RSMCREATE
                    var rsmColor = ${this._varAlbedoName} * uniforms.rsmLightColor;
                    #ifdef RSMCREATE_PROJTEXTURE
                    {
                        var strq = uniforms.rsmTextureProjectionMatrix * vec4f(fragmentInputs.vPositionW, 1.0);
                        strq /= strq.w;
                        rsmColor *= textureSample(rsmTextureProjectionSampler, rsmTextureProjectionSamplerSampler, strq.xy).rgb;
                    }
                    #endif
                    #ifdef RSMCREATE_LIGHT_IS_SPOT
                    {
                        var cosAngle = max(0., dot(uniforms.rsmSpotInfo.xyz, normalize(fragmentInputs.vPositionW - uniforms.rsmLightPosition)));
                        rsmColor = sign(cosAngle - uniforms.rsmSpotInfo.w) * rsmColor;
                    }
                    #endif

                    #define MRT_AND_COLOR
                    fragmentOutputs.fragData0 = vec4f(fragmentInputs.vPositionW, 1.);
                    fragmentOutputs.fragData1 = vec4f(normalize(normalW) * 0.5 + 0.5, 1.);
                    fragmentOutputs.fragData2 = vec4f(rsmColor, 1.);
                #endif
            `,
            };
        }
        return {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            CUSTOM_FRAGMENT_BEGIN: `
                #ifdef RSMCREATE
                    #extension GL_EXT_draw_buffers : require
                #endif
            `,
            // eslint-disable-next-line @typescript-eslint/naming-convention
            CUSTOM_FRAGMENT_DEFINITIONS: `
                #ifdef RSMCREATE
                    #ifdef RSMCREATE_PROJTEXTURE
                        uniform highp sampler2D rsmTextureProjectionSampler;                    
                    #endif
                    layout(location = 0) out highp vec4 glFragData[3];
                    vec4 glFragColor;
                #endif
            `,
            // eslint-disable-next-line @typescript-eslint/naming-convention
            CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR: `
                #ifdef RSMCREATE
                    vec3 rsmColor = ${this._varAlbedoName} * rsmLightColor;
                    #ifdef RSMCREATE_PROJTEXTURE
                    {
                        vec4 strq = rsmTextureProjectionMatrix * vec4(vPositionW, 1.0);
                        strq /= strq.w;
                        rsmColor *= texture2D(rsmTextureProjectionSampler, strq.xy).rgb;
                    }
                    #endif
                    #ifdef RSMCREATE_LIGHT_IS_SPOT
                    {
                        float cosAngle = max(0., dot(rsmSpotInfo.xyz, normalize(vPositionW - rsmLightPosition)));
                        rsmColor = sign(cosAngle - rsmSpotInfo.w) * rsmColor;
                    }
                    #endif
                    glFragData[0] = vec4(vPositionW, 1.);
                    glFragData[1] = vec4(normalize(normalW) * 0.5 + 0.5, 1.);
                    glFragData[2] = vec4(rsmColor, 1.);
                #endif
            `,
        };
    }
}
/**
 * Defines the name of the plugin.
 */
RSMCreatePluginMaterial.Name = "RSMCreate";
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], RSMCreatePluginMaterial.prototype, "light", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], RSMCreatePluginMaterial.prototype, "isEnabled", void 0);
(0,typeStore/* RegisterClass */.Y5)(`BABYLON.RSMCreatePluginMaterial`, RSMCreatePluginMaterial);
//# sourceMappingURL=reflectiveShadowMap.js.map
;// ./node_modules/@babylonjs/core/Rendering/GlobalIllumination/giRSM.js
/**
 * Class used to store the global illumination parameters for a reflective shadow map.
 * Instances of this class are used by the GIRSMManager class to generate global illumination for a scene.
 */
class GIRSM {
    /**
     * Creates a new GIRSM instance
     * @param rsm The reflective shadow map
     */
    constructor(rsm) {
        /**
         * The number of samples to use to generate the global illumination. Default value is 400.
         */
        this.numSamples = 400;
        /**
         * Radius of the circle in the RSM flux texture to read samples from. Default value is 0.1.
         * Valid values are between 0 and 1.
         */
        this.radius = 0.1;
        /**
         * Intensity of the global illumination effect. Default value is 0.1.
         */
        this.intensity = 0.1;
        /**
         * value used to correct for edge artifacts when calculating the global illumination effect. Default value is 0.1.
         * Will depend on your scene.
         */
        this.edgeArtifactCorrection = 0.1;
        /**
         * Defines if samples should be rotated when generating the global illumination effect. Default value is true.
         * Rotating samples will improve the quality of the global illumination effect by trading banding for noise, at the cost of a bit of performance.
         */
        this.rotateSample = true;
        /**
         * Noise scale factor, only used if rotateSample is true. Default value is 100.
         * Will depend on your scene.
         */
        this.noiseFactor = 100;
        /**
         * Defines if the full texture should be used when generating the global illumination effect. Default value is false.
         * If true, values for numSamples, radius, rotateSample and noiseFactor will be ignored and the full texture will be used to generate the global illumination effect.
         * Be careful to use a RSM texture size small enough to limit the number of samples! For eg. a 32x32 texture will generate 1024 samples per pixel!
         */
        this.useFullTexture = false;
        this.rsm = rsm;
    }
    /**
     * Disposes the GIRSM
     */
    dispose() {
        this.rsm.dispose();
    }
}
//# sourceMappingURL=giRSM.js.map
;// ./node_modules/@babylonjs/core/Rendering/GlobalIllumination/giRSMManager.js















/**
 * Class used to manage the global illumination contribution calculated from reflective shadow maps (RSM).
 */
class GIRSMManager {
    /**
     * Enables or disables the manager. Default is false.
     * If disabled, the global illumination won't be calculated and the scene will be rendered normally, without any global illumination contribution.
     */
    get enable() {
        return this._enable;
    }
    set enable(enable) {
        if (this._giRSM.length === 0) {
            enable = false;
        }
        if (enable === this._enable) {
            return;
        }
        this._enable = enable;
        this._debugLayer.isEnabled = this._showOnlyGI && enable;
        this._materialsWithRenderPlugin.forEach((mat) => {
            if (mat.pluginManager) {
                const plugin = mat.pluginManager.getPlugin(GIRSMRenderPluginMaterial.Name);
                plugin.isEnabled = enable;
            }
        });
        this.recreateResources(!enable);
    }
    /**
     * Defines if the global illumination contribution should be blurred or not (using a bilateral blur). Default is true.
     */
    get enableBlur() {
        return this._enableBlur;
    }
    set enableBlur(enable) {
        if (enable === this._enableBlur) {
            return;
        }
        this._enableBlur = enable;
        this.recreateResources();
    }
    /**
     * Defines if the blur should be done with a better quality but slower or not. Default is false.
     */
    get useQualityBlur() {
        return this._useQualityBlur;
    }
    set useQualityBlur(enable) {
        if (enable === this._useQualityBlur) {
            return;
        }
        this._useQualityBlur = enable;
        this.recreateResources();
    }
    /**
     * Defines if the blur should be done at full resolution or not. Default is false.
     * If this setting is enabled, upampling will be disabled (ignored) as it is not needed anymore.
     */
    get fullSizeBlur() {
        return this._forceFullSizeBlur;
    }
    set fullSizeBlur(mode) {
        if (this._forceFullSizeBlur === mode) {
            return;
        }
        this._forceFullSizeBlur = mode;
        this.recreateResources();
    }
    /**
     * Defines if the upsampling should be done with a better quality but slower or not. Default is false.
     */
    get useQualityUpsampling() {
        return this._useQualityUpsampling;
    }
    set useQualityUpsampling(enable) {
        if (enable === this._useQualityUpsampling) {
            return;
        }
        this._useQualityUpsampling = enable;
        this.recreateResources();
    }
    /**
     * Defines if the debug layer should be enabled or not. Default is false.
     * Use this setting for debugging purpose, to show the global illumination contribution only.
     */
    get showOnlyGI() {
        return this._showOnlyGI;
    }
    set showOnlyGI(show) {
        if (this._showOnlyGI === show) {
            return;
        }
        this._showOnlyGI = show;
        this._debugLayer.isEnabled = show;
    }
    /**
     * Defines if the depth buffer used by the geometry buffer renderer should be 32 bits or not. Default is false (16 bits).
     */
    get use32BitsDepthBuffer() {
        return this._use32BitsDepthBuffer;
    }
    set use32BitsDepthBuffer(enable) {
        if (this._use32BitsDepthBuffer === enable) {
            return;
        }
        this._use32BitsDepthBuffer = enable;
        this.recreateResources();
    }
    /**
     * Sets the output dimensions of the final process. It should normally be the same as the output dimensions of the screen.
     * @param dimensions The dimensions of the output texture (width and height)
     */
    setOutputDimensions(dimensions) {
        this._outputDimensions = dimensions;
        this.recreateResources();
    }
    /**
     * Sets the dimensions of the GI texture. Try to use the smallest size possible for better performance.
     * @param dimensions The dimensions of the GI texture (width and height)
     */
    setGITextureDimensions(dimensions) {
        this._giTextureDimensions = dimensions;
        this.recreateResources();
    }
    /**
     * Gets or sets the texture type used by the GI texture. Default is 11.
     */
    get giTextureType() {
        return this._giTextureType;
    }
    set giTextureType(textureType) {
        if (this._giTextureType === textureType) {
            return;
        }
        this._giTextureType = textureType;
        this.recreateResources();
    }
    /** Gets the shader language used in this material. */
    get shaderLanguage() {
        return this._shaderLanguage;
    }
    /**
     * Gets the list of GIRSM used by the manager.
     */
    get giRSM() {
        return this._giRSM;
    }
    /**
     * Adds a (list of) GIRSM to the manager.
     * @param rsm The GIRSM (or array of GIRSM) to add to the manager
     */
    addGIRSM(rsm) {
        if (Array.isArray(rsm)) {
            this._giRSM.push(...rsm);
        }
        else {
            this._giRSM.push(rsm);
        }
        this.recreateResources();
    }
    /**
     * Removes a (list of) GIRSM from the manager.
     * @param rsm The GIRSM (or array of GIRSM) to remove from the manager
     */
    removeGIRSM(rsm) {
        if (Array.isArray(rsm)) {
            for (let i = 0; i < rsm.length; ++i) {
                const idx = this._giRSM.indexOf(rsm[i]);
                if (idx !== -1) {
                    this._giRSM.splice(idx, 1);
                }
            }
        }
        else {
            const idx = this._giRSM.indexOf(rsm);
            if (idx !== -1) {
                this._giRSM.splice(idx, 1);
            }
        }
        if (this._giRSM.length === 0) {
            this.enable = false;
        }
        else {
            this.recreateResources();
        }
    }
    /**
     * Add a material to the manager. This will enable the global illumination contribution for the material.
     * @param material Material that will be affected by the global illumination contribution. If not provided, all materials of the scene will be affected.
     */
    addMaterial(material) {
        if (material) {
            this._addGISupportToMaterial(material);
        }
        else {
            this._scene.meshes.forEach((mesh) => {
                if (mesh.getTotalVertices() > 0 && mesh.isEnabled() && mesh.material) {
                    this._addGISupportToMaterial(mesh.material);
                }
            });
        }
    }
    /**
     * Gets the list of GPU counters used by the manager.
     * GPU timing measurements must be enabled for the counters to be filled (engine.enableGPUTimingMeasurements = true).
     * Only available with WebGPU. You will still get the list of counters with other engines but the values will always be 0.
     */
    get countersGPU() {
        return this._counters;
    }
    /**
     * Recreates the resources used by the manager.
     * You should normally not have to call this method manually, except if you change the useFullTexture property of a GIRSM, because the manager won't track this change.
     * @param disposeGeometryBufferRenderer Defines if the geometry buffer renderer should be disposed and recreated. Default is false.
     */
    recreateResources(disposeGeometryBufferRenderer = false) {
        if (!this._shadersLoaded) {
            this._onShaderLoadedObservable.addOnce(() => {
                this.recreateResources(disposeGeometryBufferRenderer);
            });
            return;
        }
        this._disposePostProcesses(disposeGeometryBufferRenderer);
        this._createPostProcesses();
        this._setPluginParameters();
    }
    /**
     * Generates the sample texture used by the the global illumination calculation process.
     * @param maxSamples The maximum number of samples to generate in the texture. Default value is 2048. The numSamples property of the GIRSM should be less than or equal to this value!
     */
    generateSampleTexture(maxSamples) {
        this._sampleTexture?.dispose();
        this._maxSamples = maxSamples;
        const data = new Float32Array(this._maxSamples * 4);
        for (let i = 0; i < this._maxSamples; i++) {
            const xi1 = Math.random();
            const xi2 = Math.random();
            const x = xi1 * Math.sin(2 * Math.PI * xi2);
            const y = xi1 * Math.cos(2 * Math.PI * xi2);
            data[i * 4 + 0] = x;
            data[i * 4 + 1] = y;
            data[i * 4 + 2] = xi1 * xi1;
            data[i * 4 + 3] = 1;
        }
        this._sampleTexture = new rawTexture/* RawTexture */.I(data, this._maxSamples, 1, 5, this._scene, false, false, 1, 1);
        this._sampleTexture.name = "GIRSMSamples";
    }
    /**
     * Disposes the manager.
     */
    dispose() {
        this._disposePostProcesses(true);
        this._debugLayer.texture?.dispose();
        this._debugLayer.dispose();
        this._scene.onBeforeDrawPhaseObservable.remove(this._drawPhaseObserver);
        this._onShaderLoadedObservable.clear();
    }
    /**
     * Creates a new GIRSMManager
     * @param scene The scene
     * @param outputDimensions The dimensions of the output texture (width and height). Should normally be the same as the output dimensions of the screen.
     * @param giTextureDimensions The dimensions of the GI texture (width and height). Try to use the smallest size possible for better performance.
     * @param maxSamples The maximum number of samples to generate in the sample texture. Default value is 2048. The numSamples property of the GIRSM should be less than or equal to this value!
     * @param giTextureType The texture type used by the GI texture. Default is 11.
     */
    constructor(scene, outputDimensions, giTextureDimensions = { width: 256, height: 256 }, maxSamples = 2048, giTextureType = 11) {
        this._giRSM = [];
        this._blurRTT = null;
        this._blurPostProcesses = null;
        this._blurXPostprocess = null;
        this._blurYPostprocess = null;
        this._upsamplingXPostprocess = null;
        this._upsamplingYPostprocess = null;
        this._ppGlobalIllumination = [];
        this._firstActivation = true;
        this._geomBufferEnabled = false;
        this._geomBufferEnablePosition = false;
        this._tempMatrix = new math_vector/* Matrix */.uq();
        this._enable = false;
        /**
         * Defines if the global illumination calculation is paused or not.
         * Use this setting to pause the global illumination calculation when you know that the scene (camera/mesh/light positions) is not changing anymore to save some GPU power.
         * The scene will still be rendered with the latest global illumination contribution.
         */
        this.pause = false;
        this._enableBlur = true;
        this._useQualityBlur = false;
        /**
         * Defines the depth threshold used by the bilateral blur post-processes (also used by the upsampling, if enabled).
         * You may have to change this value, depending on your scene.
         */
        this.blurDepthThreshold = 0.05;
        /**
         * Defines the normal threshold used by the bilateral blur post-processes (also used by the upsampling, if enabled).
         * You may have to change this value, depending on your scene.
         */
        this.blurNormalThreshold = 0.25;
        /**
         * Defines the kernel size used by the bilateral blur post-processes. Default is 12.
         */
        this.blurKernel = 12;
        this._forceFullSizeBlur = false;
        this._useQualityUpsampling = false;
        /**
         * Defines the kernel size used by the bilateral upsampling post-processes. Default is 6.
         */
        this.upsamplerKernel = 6;
        this._showOnlyGI = false;
        this._use32BitsDepthBuffer = false;
        /** Shader language used by the material */
        this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;
        this._shadersLoaded = false;
        this._onShaderLoadedObservable = new Misc_observable/* Observable */.cP();
        this._scene = scene;
        this._engine = scene.getEngine();
        this._outputDimensions = outputDimensions;
        this._giTextureDimensions = giTextureDimensions;
        this._giTextureType = giTextureType;
        this._materialsWithRenderPlugin = [];
        this._maxSamples = maxSamples;
        this._debugLayer = new Layers_layer/* Layer */.W("debug layer", null, this._scene, false);
        this._debugLayer.isEnabled = false;
        this._counters = [];
        this._countersRTW = [];
        this._initShaderSourceAsync();
        this.generateSampleTexture(maxSamples);
        this._drawPhaseObserver = this._scene.onBeforeDrawPhaseObservable.add(() => {
            const currentRenderTarget = this._engine._currentRenderTarget;
            let rebindCurrentRenderTarget = false;
            if (this._enable) {
                if (!this.pause) {
                    this._scene.postProcessManager.directRender(this._ppGlobalIllumination, this._ppGlobalIllumination[0].inputTexture);
                    this._engine.unBindFramebuffer(this._ppGlobalIllumination[0].inputTexture, true);
                    this._engine.setAlphaMode(0);
                    rebindCurrentRenderTarget = true;
                    if (this.enableBlur && this._blurPostProcesses) {
                        this._scene.postProcessManager.directRender(this._blurPostProcesses, this._blurRTT.renderTarget, true);
                        this._engine.unBindFramebuffer(this._blurRTT.renderTarget, true);
                    }
                }
                for (let i = 0; i < this._counters.length; ++i) {
                    const rtws = this._countersRTW[i];
                    for (let t = 0; t < rtws.length; ++t) {
                        if (t === 0) {
                            this._counters[i].value = this.pause ? 0 : (rtws[t].gpuTimeInFrame?.counter.lastSecAverage ?? 0);
                        }
                        else if (!this.pause) {
                            this._counters[i].value += rtws[t].gpuTimeInFrame?.counter.lastSecAverage ?? 0;
                        }
                    }
                }
                if (this._scene.activeCamera) {
                    this._engine.setViewport(this._scene.activeCamera.viewport);
                }
            }
            if (rebindCurrentRenderTarget && currentRenderTarget) {
                this._engine.bindFramebuffer(currentRenderTarget);
            }
        });
    }
    async _initShaderSourceAsync() {
        const engine = this._engine;
        if (engine.isWebGPU) {
            this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 91807)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 11084)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 13118)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 82365)),
            ]);
        }
        else {
            await Promise.all([
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 18516)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 97621)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3157)),
                Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 88826)),
            ]);
        }
        this._shadersLoaded = true;
        this._onShaderLoadedObservable.notifyObservers();
    }
    _disposePostProcesses(disposeGeometryBufferRenderer = false) {
        this._blurRTT?.dispose();
        this._blurRTT = null;
        this._blurPostProcesses = [];
        this._blurXPostprocess?.dispose();
        this._blurXPostprocess = null;
        this._blurYPostprocess?.dispose();
        this._blurYPostprocess = null;
        this._upsamplingXPostprocess?.dispose();
        this._upsamplingXPostprocess = null;
        this._upsamplingYPostprocess?.dispose();
        this._upsamplingYPostprocess = null;
        for (const ppGlobalIllumination of this._ppGlobalIllumination) {
            ppGlobalIllumination.dispose();
        }
        this._ppGlobalIllumination = [];
        if (disposeGeometryBufferRenderer) {
            if (this._geomBufferEnabled) {
                this._scene.enableGeometryBufferRenderer();
                this._scene.geometryBufferRenderer.enablePosition = this._geomBufferEnablePosition;
            }
            else {
                this._scene.disableGeometryBufferRenderer();
            }
        }
        this._counters = [];
        this._countersRTW = [];
    }
    _setPluginParameters() {
        if (!this._enable) {
            return;
        }
        this._materialsWithRenderPlugin.forEach((mat) => {
            if (mat.pluginManager) {
                const plugin = mat.pluginManager.getPlugin(GIRSMRenderPluginMaterial.Name);
                plugin.textureGIContrib = this.enableBlur ? this._blurRTT.renderTarget.texture : this._ppGlobalIllumination[0].inputTexture.texture;
                plugin.outputTextureWidth = this._outputDimensions.width;
                plugin.outputTextureHeight = this._outputDimensions.height;
            }
        });
    }
    _createPostProcesses() {
        if (!this._enable) {
            return;
        }
        const textureFormat = this._giTextureType === 13 ? 4 : 5;
        if (this._firstActivation) {
            this._firstActivation = false;
            this._geomBufferEnabled = !!this._scene.geometryBufferRenderer;
            this._geomBufferEnablePosition = this._scene.geometryBufferRenderer?.enablePosition ?? false;
        }
        if (!this._geomBufferEnabled) {
            this._scene.disableGeometryBufferRenderer();
        }
        const geometryBufferRenderer = this._scene.enableGeometryBufferRenderer(this._enableBlur ? this._outputDimensions : this._giTextureDimensions, this._use32BitsDepthBuffer ? 14 : 15, GIRSMManager.GeometryBufferTextureTypesAndFormats);
        if (!geometryBufferRenderer) {
            throw new Error("Geometry buffer renderer is not supported but is required for GIRSMManager.");
        }
        geometryBufferRenderer.enablePosition = true;
        if (!this._geomBufferEnabled) {
            geometryBufferRenderer.generateNormalsInWorldSpace = true;
        }
        const decodeGeometryBufferNormals = geometryBufferRenderer.normalsAreUnsigned;
        const normalsAreInWorldSpace = geometryBufferRenderer.generateNormalsInWorldSpace;
        this._counters.push({ name: "Geometry buffer renderer", value: 0 });
        this._countersRTW.push([this._scene.geometryBufferRenderer.getGBuffer().renderTarget]);
        let defines = "";
        if (decodeGeometryBufferNormals) {
            defines += "#define DECODE_NORMAL\n";
        }
        if (!normalsAreInWorldSpace) {
            defines += "#define TRANSFORM_NORMAL\n";
        }
        for (let i = 0; i < this._giRSM.length; ++i) {
            const giRSM = this._giRSM[i];
            const rsm = giRSM.rsm;
            const ppGlobalIllumination = new PostProcesses_postProcess/* PostProcess */.w("RSMGlobalIllumination" + i, giRSM.useFullTexture ? "rsmFullGlobalIllumination" : "rsmGlobalIllumination", {
                ...this._giTextureDimensions,
                uniforms: ["rsmLightMatrix", "rsmInfo", "rsmInfo2", "invView"],
                samplers: ["normalSampler", "rsmPositionW", "rsmNormalW", "rsmFlux", "rsmSamples"],
                defines,
                samplingMode: 2,
                engine: this._engine,
                textureType: this._giTextureType,
                textureFormat,
                shaderLanguage: this._shaderLanguage,
            });
            this._ppGlobalIllumination.push(ppGlobalIllumination);
            if (i !== 0) {
                ppGlobalIllumination.shareOutputWith(this._ppGlobalIllumination[0]);
                ppGlobalIllumination.alphaMode = 1;
            }
            ppGlobalIllumination.autoClear = false;
            ppGlobalIllumination.externalTextureSamplerBinding = true;
            ppGlobalIllumination.onApplyObservable.add((effect) => {
                effect.setTexture("textureSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.POSITION_TEXTURE_TYPE)]);
                effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE)]);
                effect.setTexture("rsmPositionW", rsm.positionWorldTexture);
                effect.setTexture("rsmNormalW", rsm.normalWorldTexture);
                effect.setTexture("rsmFlux", rsm.fluxTexture);
                effect.setMatrix("rsmLightMatrix", rsm.lightTransformationMatrix);
                if (!giRSM.useFullTexture) {
                    effect.setTexture("rsmSamples", this._sampleTexture);
                    effect.setFloat4("rsmInfo", giRSM.numSamples, giRSM.radius, giRSM.intensity, giRSM.edgeArtifactCorrection);
                    effect.setFloat4("rsmInfo2", giRSM.noiseFactor, giRSM.rotateSample ? 1 : 0, rsm.fluxTexture.getInternalTexture().width, rsm.fluxTexture.getInternalTexture().height);
                }
                else {
                    effect.setFloat4("rsmInfo", rsm.fluxTexture.getInternalTexture().width, rsm.fluxTexture.getInternalTexture().height, giRSM.intensity, giRSM.edgeArtifactCorrection);
                }
                if (!normalsAreInWorldSpace) {
                    this._tempMatrix.copyFrom(this._scene.activeCamera.getViewMatrix());
                    this._tempMatrix.invert();
                    effect.setMatrix("invView", this._tempMatrix);
                }
            });
        }
        for (const ppGlobalIllumination of this._ppGlobalIllumination) {
            if (!ppGlobalIllumination.inputTexture) {
                ppGlobalIllumination.resize(this._giTextureDimensions.width, this._giTextureDimensions.height);
            }
        }
        this._counters.push({ name: "GI generation", value: 0 });
        this._countersRTW.push([this._ppGlobalIllumination[0].inputTexture]);
        if (this._enableBlur) {
            const blurTextureSize = this._forceFullSizeBlur ? this._outputDimensions : this._giTextureDimensions;
            this._blurRTT = new Textures_renderTargetTexture/* RenderTargetTexture */.$("GIRSMContribution", this._outputDimensions, this._scene, {
                type: this._giTextureType,
                format: textureFormat,
                generateDepthBuffer: false,
            });
            this._blurRTT.wrapU = 0;
            this._blurRTT.wrapV = 0;
            this._blurRTT.updateSamplingMode(1);
            this._blurRTT.skipInitialClear = true;
            const blurRTWs = [];
            this._counters.push({ name: "GI blur", value: 0 });
            this._countersRTW.push(blurRTWs);
            // Bilateral blur
            this._blurXPostprocess = new PostProcesses_postProcess/* PostProcess */.w(this._useQualityBlur ? "BilateralBlur" : "BilateralBlurX", this._useQualityBlur ? "bilateralBlurQuality" : "bilateralBlur", {
                uniforms: ["filterSize", "blurDir", "depthThreshold", "normalThreshold"],
                samplers: ["depthSampler", "normalSampler"],
                defines: decodeGeometryBufferNormals ? "#define DECODE_NORMAL" : undefined,
                size: blurTextureSize,
                samplingMode: 2,
                engine: this._engine,
                textureType: this._giTextureType,
                textureFormat,
                shaderLanguage: this._shaderLanguage,
            });
            this._blurXPostprocess.onApplyObservable.add((effect) => {
                effect._bindTexture("textureSampler", this._ppGlobalIllumination[0].inputTexture.texture);
                effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE)]);
                effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE)]);
                effect.setInt("filterSize", this.blurKernel);
                effect.setFloat2("blurDir", 1 / this._giTextureDimensions.width, this._useQualityBlur ? 1 / this._giTextureDimensions.height : 0);
                effect.setFloat("depthThreshold", this.blurDepthThreshold);
                effect.setFloat("normalThreshold", this.blurNormalThreshold);
            });
            this._blurXPostprocess.externalTextureSamplerBinding = true;
            this._blurXPostprocess.autoClear = false;
            if (!this._useQualityBlur) {
                this._blurYPostprocess = new PostProcesses_postProcess/* PostProcess */.w("BilateralBlurY", "bilateralBlur", {
                    uniforms: ["filterSize", "blurDir", "depthThreshold", "normalThreshold"],
                    samplers: ["depthSampler", "normalSampler"],
                    defines: decodeGeometryBufferNormals ? "#define DECODE_NORMAL" : undefined,
                    size: blurTextureSize,
                    samplingMode: 2,
                    engine: this._engine,
                    textureType: this._giTextureType,
                    textureFormat,
                    shaderLanguage: this._shaderLanguage,
                });
                this._blurYPostprocess.autoClear = false;
                this._blurYPostprocess.onApplyObservable.add((effect) => {
                    effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE)]);
                    effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE)]);
                    effect.setInt("filterSize", this.blurKernel);
                    effect.setFloat2("blurDir", 0, 1 / this._giTextureDimensions.height);
                    effect.setFloat("depthThreshold", this.blurDepthThreshold);
                    effect.setFloat("normalThreshold", this.blurNormalThreshold);
                });
                this._blurYPostprocess.resize(blurTextureSize.width, blurTextureSize.height);
                blurRTWs.push(this._blurYPostprocess.inputTexture);
            }
            this._blurPostProcesses = [this._blurXPostprocess];
            if (this._blurYPostprocess) {
                this._blurPostProcesses.push(this._blurYPostprocess);
            }
            // Bilateral upsampling
            const giFullDimensions = this._giTextureDimensions.width >= this._outputDimensions.width && this._giTextureDimensions.height >= this._outputDimensions.height;
            if (!giFullDimensions && !this._forceFullSizeBlur) {
                const upsamplingRTWs = [];
                this._counters.push({ name: "GI upsampling", value: 0 });
                this._countersRTW.push(upsamplingRTWs);
                this._upsamplingXPostprocess = new PostProcesses_postProcess/* PostProcess */.w(this._useQualityUpsampling ? "BilateralUpsampling" : "BilateralUpsamplingX", this._useQualityUpsampling ? "bilateralBlurQuality" : "bilateralBlur", {
                    uniforms: ["filterSize", "blurDir", "depthThreshold", "normalThreshold"],
                    samplers: ["depthSampler", "normalSampler"],
                    defines: decodeGeometryBufferNormals ? "#define DECODE_NORMAL" : undefined,
                    size: blurTextureSize,
                    samplingMode: 2,
                    engine: this._engine,
                    textureType: this._giTextureType,
                    textureFormat,
                    shaderLanguage: this._shaderLanguage,
                });
                this._upsamplingXPostprocess.autoClear = false;
                this._upsamplingXPostprocess.onApplyObservable.add((effect) => {
                    effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE)]);
                    effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE)]);
                    effect.setInt("filterSize", this.upsamplerKernel);
                    effect.setFloat2("blurDir", 1 / this._outputDimensions.width, this._useQualityUpsampling ? 1 / this._outputDimensions.height : 0);
                    effect.setFloat("depthThreshold", this.blurDepthThreshold);
                    effect.setFloat("normalThreshold", this.blurNormalThreshold);
                });
                this._upsamplingXPostprocess.resize(blurTextureSize.width, blurTextureSize.height);
                blurRTWs.push(this._upsamplingXPostprocess.inputTexture);
                if (!this.useQualityUpsampling) {
                    this._upsamplingYPostprocess = new PostProcesses_postProcess/* PostProcess */.w("BilateralUpsamplingY", "bilateralBlur", {
                        uniforms: ["filterSize", "blurDir", "depthThreshold", "normalThreshold"],
                        samplers: ["depthSampler", "normalSampler"],
                        defines: decodeGeometryBufferNormals ? "#define DECODE_NORMAL" : undefined,
                        size: this._outputDimensions,
                        samplingMode: 2,
                        engine: this._engine,
                        textureType: this._giTextureType,
                        textureFormat,
                        shaderLanguage: this._shaderLanguage,
                    });
                    this._upsamplingYPostprocess.autoClear = false;
                    this._upsamplingYPostprocess.onApplyObservable.add((effect) => {
                        effect.setTexture("depthSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.DEPTH_TEXTURE_TYPE)]);
                        effect.setTexture("normalSampler", geometryBufferRenderer.getGBuffer().textures[geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE)]);
                        effect.setInt("filterSize", this.upsamplerKernel);
                        effect.setFloat2("blurDir", 0, 1 / this._outputDimensions.height);
                        effect.setFloat("depthThreshold", this.blurDepthThreshold);
                        effect.setFloat("normalThreshold", this.blurNormalThreshold);
                    });
                    this._upsamplingYPostprocess.resize(this._outputDimensions.width, this._outputDimensions.height);
                    upsamplingRTWs.push(this._upsamplingYPostprocess.inputTexture);
                }
                upsamplingRTWs.push(this._blurRTT.renderTarget);
                this._blurPostProcesses.push(this._upsamplingXPostprocess);
                if (this._upsamplingYPostprocess) {
                    this._blurPostProcesses.push(this._upsamplingYPostprocess);
                }
            }
            else {
                blurRTWs.push(this._blurRTT.renderTarget);
            }
        }
        this._debugLayer.texture?.dispose();
        this._debugLayer.texture = new baseTexture/* BaseTexture */.t(this._scene, this._enableBlur ? this._blurRTT.renderTarget.texture : this._ppGlobalIllumination[0].inputTexture.texture);
    }
    _addGISupportToMaterial(material) {
        if (material.pluginManager?.getPlugin(GIRSMRenderPluginMaterial.Name)) {
            return;
        }
        const plugin = new GIRSMRenderPluginMaterial(material);
        if (this._enable && this._ppGlobalIllumination.length > 0) {
            plugin.textureGIContrib = this._ppGlobalIllumination[0].inputTexture.texture;
            plugin.outputTextureWidth = this._outputDimensions.width;
            plugin.outputTextureHeight = this._outputDimensions.height;
        }
        plugin.isEnabled = this._enable;
        this._materialsWithRenderPlugin.push(material);
    }
}
/**
 * Defines the default texture types and formats used by the geometry buffer renderer.
 */
GIRSMManager.GeometryBufferTextureTypesAndFormats = {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    0: { textureType: 2, textureFormat: 6 }, // depth
    // eslint-disable-next-line @typescript-eslint/naming-convention
    1: { textureType: 11, textureFormat: 5 }, // normal
    // eslint-disable-next-line @typescript-eslint/naming-convention
    2: { textureType: 2, textureFormat: 5 }, // position
};
/**
 * @internal
 */
class MaterialGIRSMRenderDefines extends materialDefines/* MaterialDefines */.M {
    constructor() {
        super(...arguments);
        this.RENDER_WITH_GIRSM = false;
        this.RSMCREATE_PROJTEXTURE = false;
    }
}
/**
 * Plugin used to render the global illumination contribution.
 */
class GIRSMRenderPluginMaterial extends materialPluginBase/* MaterialPluginBase */.y {
    _markAllSubMeshesAsTexturesDirty() {
        this._enable(this._isEnabled);
        this._internalMarkAllSubMeshesAsTexturesDirty();
    }
    /**
     * Gets a boolean indicating that the plugin is compatible with a give shader language.
     * @returns true if the plugin is compatible with the shader language
     */
    isCompatible() {
        return true;
    }
    constructor(material) {
        super(material, GIRSMRenderPluginMaterial.Name, 310, new MaterialGIRSMRenderDefines());
        this._isEnabled = false;
        /**
         * Defines if the plugin is enabled in the material.
         */
        this.isEnabled = false;
        this._internalMarkAllSubMeshesAsTexturesDirty = material._dirtyCallbacks[1];
        this._isPBR = material instanceof pbrBaseMaterial/* PBRBaseMaterial */.d;
    }
    prepareDefines(defines) {
        defines.RENDER_WITH_GIRSM = this._isEnabled;
    }
    getClassName() {
        return "GIRSMRenderPluginMaterial";
    }
    getUniforms() {
        return {
            ubo: [{ name: "girsmTextureOutputSize", size: 2, type: "vec2" }],
            fragment: `#ifdef RENDER_WITH_GIRSM
                    uniform vec2 girsmTextureOutputSize;
                #endif`,
        };
    }
    getSamplers(samplers) {
        samplers.push("girsmTextureGIContrib");
    }
    bindForSubMesh(uniformBuffer) {
        if (this._isEnabled) {
            uniformBuffer.bindTexture("girsmTextureGIContrib", this.textureGIContrib);
            uniformBuffer.updateFloat2("girsmTextureOutputSize", this.outputTextureWidth, this.outputTextureHeight);
        }
    }
    getCustomCode(shaderType, shaderLanguage) {
        let frag;
        if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
            frag = {
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_DEFINITIONS: `
                #ifdef RENDER_WITH_GIRSM
                    var girsmTextureGIContribSampler: sampler;
                    var girsmTextureGIContrib: texture_2d<f32>;

                    fn computeIndirect() -> vec3f {
                        var uv = fragmentInputs.position.xy / uniforms.girsmTextureOutputSize;
                        return textureSample(girsmTextureGIContrib, girsmTextureGIContribSampler, uv).rgb;
                    }
                #endif
            `,
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION: `
                #ifdef RENDER_WITH_GIRSM
                    finalDiffuse += computeIndirect() * surfaceAlbedo.rgb;
                #endif
            `,
            };
            if (!this._isPBR) {
                frag["CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR"] = `
                #ifdef RENDER_WITH_GIRSM
                    color = vec4f(color.rgb + computeIndirect() * baseColor.rgb, color.a);
                #endif
            `;
            }
        }
        else {
            frag = {
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_DEFINITIONS: `
                #ifdef RENDER_WITH_GIRSM
                    uniform sampler2D girsmTextureGIContrib;

                    vec3 computeIndirect() {
                        vec2 uv = gl_FragCoord.xy / girsmTextureOutputSize;
                        return texture2D(girsmTextureGIContrib, uv).rgb;
                    }
                #endif
            `,
                // eslint-disable-next-line @typescript-eslint/naming-convention
                CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION: `
                #ifdef RENDER_WITH_GIRSM
                    finalDiffuse += computeIndirect() * surfaceAlbedo.rgb;
                #endif
            `,
            };
            if (!this._isPBR) {
                frag["CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR"] = `
                #ifdef RENDER_WITH_GIRSM
                    color.rgb += computeIndirect() * baseColor.rgb;
                #endif
            `;
            }
        }
        return shaderType === "vertex" ? null : frag;
    }
}
/**
 * Defines the name of the plugin.
 */
GIRSMRenderPluginMaterial.Name = "GIRSMRender";
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], GIRSMRenderPluginMaterial.prototype, "textureGIContrib", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], GIRSMRenderPluginMaterial.prototype, "outputTextureWidth", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)()
], GIRSMRenderPluginMaterial.prototype, "outputTextureHeight", void 0);
(0,tslib_es6/* __decorate */.Cg)([
    (0,decorators/* serialize */.lK)(),
    (0,decorators/* expandToProperty */.$z)("_markAllSubMeshesAsTexturesDirty")
], GIRSMRenderPluginMaterial.prototype, "isEnabled", void 0);
(0,typeStore/* RegisterClass */.Y5)(`BABYLON.GIRSMRenderPluginMaterial`, GIRSMRenderPluginMaterial);
//# sourceMappingURL=giRSMManager.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/bilateralBlur.fragment.js
var bilateralBlur_fragment = __webpack_require__(18516);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/bilateralBlurQuality.fragment.js
var bilateralBlurQuality_fragment = __webpack_require__(97621);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/rsmGlobalIllumination.fragment.js
var rsmGlobalIllumination_fragment = __webpack_require__(3157);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/rsmFullGlobalIllumination.fragment.js
var rsmFullGlobalIllumination_fragment = __webpack_require__(88826);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/bilateralBlur.fragment.js
var ShadersWGSL_bilateralBlur_fragment = __webpack_require__(91807);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/bilateralBlurQuality.fragment.js
var ShadersWGSL_bilateralBlurQuality_fragment = __webpack_require__(11084);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/rsmGlobalIllumination.fragment.js
var ShadersWGSL_rsmGlobalIllumination_fragment = __webpack_require__(13118);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/rsmFullGlobalIllumination.fragment.js
var ShadersWGSL_rsmFullGlobalIllumination_fragment = __webpack_require__(82365);
;// ./node_modules/@babylonjs/core/Rendering/GlobalIllumination/index.js










//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/depth.fragment.js
var ShadersWGSL_depth_fragment = __webpack_require__(38939);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/depth.vertex.js
var ShadersWGSL_depth_vertex = __webpack_require__(48453);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/geometry.fragment.js
var ShadersWGSL_geometry_fragment = __webpack_require__(38574);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/geometry.vertex.js
var ShadersWGSL_geometry_vertex = __webpack_require__(2564);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.fragment.js + 1 modules
var boundingBoxRenderer_fragment = __webpack_require__(33495);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.vertex.js + 1 modules
var boundingBoxRenderer_vertex = __webpack_require__(82187);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/boundingBoxRenderer.fragment.js
var ShadersWGSL_boundingBoxRenderer_fragment = __webpack_require__(12814);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/boundingBoxRenderer.vertex.js
var ShadersWGSL_boundingBoxRenderer_vertex = __webpack_require__(89252);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/line.fragment.js
var line_fragment = __webpack_require__(861);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/line.vertex.js + 2 modules
var line_vertex = __webpack_require__(26149);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/line.fragment.js
var ShadersWGSL_line_fragment = __webpack_require__(85264);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/line.vertex.js
var ShadersWGSL_line_vertex = __webpack_require__(80574);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/outline.fragment.js
var outline_fragment = __webpack_require__(2641);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/outline.vertex.js
var outline_vertex = __webpack_require__(99899);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/outline.fragment.js
var ShadersWGSL_outline_fragment = __webpack_require__(13802);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/outline.vertex.js
var ShadersWGSL_outline_vertex = __webpack_require__(85520);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/copyTexture3DLayerToTexture.fragment.js
var copyTexture3DLayerToTexture_fragment = __webpack_require__(47383);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/copyTexture3DLayerToTexture.fragment.js
var ShadersWGSL_copyTexture3DLayerToTexture_fragment = __webpack_require__(95176);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowVoxelTracing.fragment.js
var iblShadowVoxelTracing_fragment = __webpack_require__(16990);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowVoxelTracing.fragment.js
var ShadersWGSL_iblShadowVoxelTracing_fragment = __webpack_require__(9461);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowDebug.fragment.js
var iblShadowDebug_fragment = __webpack_require__(22495);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowDebug.fragment.js
var ShadersWGSL_iblShadowDebug_fragment = __webpack_require__(2730);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowSpatialBlur.fragment.js
var iblShadowSpatialBlur_fragment = __webpack_require__(68772);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowSpatialBlur.fragment.js
var Shaders_iblShadowSpatialBlur_fragment = __webpack_require__(8605);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowAccumulation.fragment.js
var iblShadowAccumulation_fragment = __webpack_require__(27122);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowAccumulation.fragment.js
var Shaders_iblShadowAccumulation_fragment = __webpack_require__(61089);
;// ./node_modules/@babylonjs/core/Shaders/iblShadowsCombine.fragment.js
// Do not edit.

const iblShadowsCombine_fragment_name = "iblShadowsCombinePixelShader";
const iblShadowsCombine_fragment_shader = `precision highp float;varying vec2 vUV;uniform sampler2D shadowSampler;uniform sampler2D textureSampler;uniform float shadowOpacity;void main(void)
{vec3 shadow=texture(shadowSampler,vUV).rgb;vec3 sceneColor=texture(textureSampler,vUV).rgb;float shadowValue=mix(1.0,shadow.x,shadowOpacity);gl_FragColor=vec4(sceneColor*shadowValue,1.0);}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[iblShadowsCombine_fragment_name] = iblShadowsCombine_fragment_shader;
/** @internal */
const iblShadowsCombinePixelShader = { name: iblShadowsCombine_fragment_name, shader: iblShadowsCombine_fragment_shader };
//# sourceMappingURL=iblShadowsCombine.fragment.js.map
;// ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowsCombine.fragment.js
// Do not edit.

const ShadersWGSL_iblShadowsCombine_fragment_name = "iblShadowsCombinePixelShader";
const ShadersWGSL_iblShadowsCombine_fragment_shader = `varying vUV: vec2f;var shadowSamplerSampler : sampler;var shadowSampler : texture_2d<f32>;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform shadowOpacity: f32;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var shadow
: vec3f =
textureSample(shadowSampler,shadowSamplerSampler,input.vUV).rgb;var color
: vec3f =
textureSample(textureSampler,textureSamplerSampler,input.vUV).rgb;var shadowValue: f32=mix(1.0,shadow.x,uniforms.shadowOpacity);fragmentOutputs.color=vec4f(color*shadowValue,1.0);}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStoreWGSL[ShadersWGSL_iblShadowsCombine_fragment_name] = ShadersWGSL_iblShadowsCombine_fragment_shader;
/** @internal */
const iblShadowsCombinePixelShaderWGSL = { name: ShadersWGSL_iblShadowsCombine_fragment_name, shader: ShadersWGSL_iblShadowsCombine_fragment_shader };
//# sourceMappingURL=iblShadowsCombine.fragment.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblCombineVoxelGrids.fragment.js
var iblCombineVoxelGrids_fragment = __webpack_require__(92199);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblCombineVoxelGrids.fragment.js
var Shaders_iblCombineVoxelGrids_fragment = __webpack_require__(18162);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblGenerateVoxelMip.fragment.js
var iblGenerateVoxelMip_fragment = __webpack_require__(46043);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblGenerateVoxelMip.fragment.js
var ShadersWGSL_iblGenerateVoxelMip_fragment = __webpack_require__(23584);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowGBufferDebug.fragment.js
var iblShadowGBufferDebug_fragment = __webpack_require__(95634);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowGBufferDebug.fragment.js
var ShadersWGSL_iblShadowGBufferDebug_fragment = __webpack_require__(29533);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowsCdfx.fragment.js
var iblShadowsCdfx_fragment = __webpack_require__(53411);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowsCdfx.fragment.js
var Shaders_iblShadowsCdfx_fragment = __webpack_require__(62386);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowsCdfy.fragment.js
var iblShadowsCdfy_fragment = __webpack_require__(73034);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowsCdfy.fragment.js
var Shaders_iblShadowsCdfy_fragment = __webpack_require__(28043);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowsIcdfx.fragment.js
var iblShadowsIcdfx_fragment = __webpack_require__(48232);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowsIcdfx.fragment.js
var Shaders_iblShadowsIcdfx_fragment = __webpack_require__(61391);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowsIcdfy.fragment.js
var iblShadowsIcdfy_fragment = __webpack_require__(70065);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowsIcdfy.fragment.js
var Shaders_iblShadowsIcdfy_fragment = __webpack_require__(77142);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.js
var iblShadowsImportanceSamplingDebug_fragment = __webpack_require__(79040);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblShadowsImportanceSamplingDebug.fragment.js
var Shaders_iblShadowsImportanceSamplingDebug_fragment = __webpack_require__(16339);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblVoxelGrid2dArrayDebug.fragment.js
var iblVoxelGrid2dArrayDebug_fragment = __webpack_require__(88188);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblVoxelGrid2dArrayDebug.fragment.js
var ShadersWGSL_iblVoxelGrid2dArrayDebug_fragment = __webpack_require__(17537);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblVoxelGrid.fragment.js
var iblVoxelGrid_fragment = __webpack_require__(3414);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblVoxelGrid.vertex.js
var iblVoxelGrid_vertex = __webpack_require__(8444);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblVoxelGrid.fragment.js
var ShadersWGSL_iblVoxelGrid_fragment = __webpack_require__(39107);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblVoxelGrid.vertex.js
var ShadersWGSL_iblVoxelGrid_vertex = __webpack_require__(43965);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblVoxelGrid3dDebug.fragment.js
var iblVoxelGrid3dDebug_fragment = __webpack_require__(96214);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblVoxelGrid3dDebug.fragment.js
var ShadersWGSL_iblVoxelGrid3dDebug_fragment = __webpack_require__(84237);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblVoxelSlabDebug.vertex.js
var iblVoxelSlabDebug_vertex = __webpack_require__(71587);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/iblVoxelSlabDebug.fragment.js
var iblVoxelSlabDebug_fragment = __webpack_require__(85257);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblVoxelSlabDebug.vertex.js
var ShadersWGSL_iblVoxelSlabDebug_vertex = __webpack_require__(26472);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/iblVoxelSlabDebug.fragment.js
var ShadersWGSL_iblVoxelSlabDebug_fragment = __webpack_require__(1138);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/oitBackBlend.fragment.js
var oitBackBlend_fragment = __webpack_require__(20449);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/oitFinal.fragment.js
var oitFinal_fragment = __webpack_require__(19015);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/oitBackBlend.fragment.js
var ShadersWGSL_oitBackBlend_fragment = __webpack_require__(47312);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/oitFinal.fragment.js
var ShadersWGSL_oitFinal_fragment = __webpack_require__(14958);
;// ./node_modules/@babylonjs/core/Rendering/index.js
/* eslint-disable import/no-internal-modules */




















// Depth




// Geometry




// Bounding Box Renderer




// Edges Renderer




// Outline Renderer




// IBL Shadows








































// Depth Peeling Renderer




//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/Sprites/ISprites.js

//# sourceMappingURL=ISprites.js.map
;// ./node_modules/@babylonjs/core/Shaders/spriteMap.fragment.js
// Do not edit.





const spriteMap_fragment_name = "spriteMapPixelShader";
const spriteMap_fragment_shader = `#ifdef LOGARITHMICDEPTH
#extension GL_EXT_frag_depth : enable
#endif
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)
#else
#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)
#endif
precision highp float;varying vec3 vPosition;varying vec2 vUV;varying vec2 tUV;uniform float time;uniform float spriteCount;uniform sampler2D spriteSheet;uniform vec2 spriteMapSize;uniform vec2 outputSize;uniform vec2 stageSize;uniform sampler2D frameMap;uniform sampler2D tileMaps[LAYERS];uniform sampler2D animationMap;uniform vec3 colorMul;
#include<fogFragmentDeclaration>
#include<logDepthDeclaration>
float mt;const float fdStep=1.0*0.25;const float aFrameSteps=MAX_ANIMATION_FRAMES==0.0 ? 0.0 : 1.0/MAX_ANIMATION_FRAMES;mat4 getFrameData(float frameID) {float fX=frameID/spriteCount;return mat4(
TEXTUREFUNC(frameMap,vec2(fX,0.0),0.0),
TEXTUREFUNC(frameMap,vec2(fX,fdStep*1.0),0.0),
TEXTUREFUNC(frameMap,vec2(fX,fdStep*2.0),0.0),
vec4(0.0)
);}
void main() {vec4 color=vec4(0.0);vec2 tileUV=fract(tUV);vec2 tileID=floor(tUV);vec2 sheetUnits=1.0/spriteMapSize;float spriteUnits=1.0/spriteCount;vec2 stageUnits=1.0/stageSize;for(int i=0; i<LAYERS; i++) {float frameID;
#define LAYER_ID_SWITCH
vec4 animationData=TEXTUREFUNC(animationMap,vec2((frameID+0.5)/spriteCount,0.0),0.0);if(animationData.y>0.0) {mt=mod(time*animationData.z,1.0);for(float f=0.0; f<MAX_ANIMATION_FRAMES; f++) {if(animationData.y>mt) {frameID=animationData.x;break;}
animationData=TEXTUREFUNC(animationMap,vec2((frameID+0.5)/spriteCount,aFrameSteps*f),0.0);}}
mat4 frameData=getFrameData(frameID+0.5);vec2 frameSize=(frameData[0].zw)/spriteMapSize;vec2 offset=frameData[0].xy*sheetUnits;vec2 ratio=frameData[2].xy/frameData[0].zw;
#ifdef FR_CW
if (frameData[2].z==1.0) {tileUV.xy=tileUV.yx;} else {tileUV.xy=fract(tUV).xy;}
#ifdef FLIPU
tileUV.y=1.0-tileUV.y;
#endif
#else
if (frameData[2].z==1.0) {
#ifdef FLIPU
tileUV.y=1.0-tileUV.y;
#endif
tileUV.xy=tileUV.yx;} else {tileUV.xy=fract(tUV).xy;
#ifdef FLIPU
tileUV.y=1.0-tileUV.y;
#endif
}
#endif
vec4 nc=TEXTUREFUNC(spriteSheet,tileUV*frameSize+offset,0.0);if (i==0) {color=nc;} else {float alpha=min(color.a+nc.a,1.0);vec3 mixed=mix(color.xyz,nc.xyz,nc.a);color=vec4(mixed,alpha);}}
color.xyz*=colorMul;
#include<logDepthFragment>
#include<fogFragment>
gl_FragColor=color;}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[spriteMap_fragment_name] = spriteMap_fragment_shader;
/** @internal */
const spriteMapPixelShader = { name: spriteMap_fragment_name, shader: spriteMap_fragment_shader };
//# sourceMappingURL=spriteMap.fragment.js.map
;// ./node_modules/@babylonjs/core/Shaders/spriteMap.vertex.js
// Do not edit.




const spriteMap_vertex_name = "spriteMapVertexShader";
const spriteMap_vertex_shader = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;varying vec3 vPosition;varying vec2 vUV;varying vec2 tUV;uniform float time;uniform mat4 world;uniform mat4 view;uniform mat4 projection;uniform vec2 stageSize;uniform float stageScale;
#include<fogVertexDeclaration>
#include<logDepthDeclaration>
void main() {vec4 p=vec4( position,1. );vPosition=p.xyz;vUV=uv;tUV=uv*stageSize; 
vec3 viewPos=(view*world*p).xyz; 
gl_Position=projection*vec4(viewPos,1.0); 
#ifdef FOG
vFogDistance=viewPos;
#endif
#include<logDepthVertex>
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[spriteMap_vertex_name] = spriteMap_vertex_shader;
/** @internal */
const spriteMapVertexShader = { name: spriteMap_vertex_name, shader: spriteMap_vertex_shader };
//# sourceMappingURL=spriteMap.vertex.js.map
;// ./node_modules/@babylonjs/core/Sprites/spriteMap.js









var SpriteMapFrameRotationDirection;
(function (SpriteMapFrameRotationDirection) {
    SpriteMapFrameRotationDirection[SpriteMapFrameRotationDirection["CCW"] = 0] = "CCW";
    SpriteMapFrameRotationDirection[SpriteMapFrameRotationDirection["CW"] = 1] = "CW";
})(SpriteMapFrameRotationDirection || (SpriteMapFrameRotationDirection = {}));
/**
 * Class used to manage a grid restricted sprite deployment on an Output plane.
 */
class SpriteMap {
    /** Returns the Number of Sprites in the System */
    get spriteCount() {
        return this.sprites.length;
    }
    /** Returns the Position of Output Plane*/
    get position() {
        return this._output.position;
    }
    /** Returns the Position of Output Plane*/
    set position(v) {
        this._output.position = v;
    }
    /** Returns the Rotation of Output Plane*/
    get rotation() {
        return this._output.rotation;
    }
    /** Returns the Rotation of Output Plane*/
    set rotation(v) {
        this._output.rotation = v;
    }
    /** Sets the AnimationMap*/
    get animationMap() {
        return this._animationMap;
    }
    /** Sets the AnimationMap*/
    set animationMap(v) {
        const buffer = v._texture._bufferView;
        const am = this._createTileAnimationBuffer(buffer);
        this._animationMap.dispose();
        this._animationMap = am;
        this._material.setTexture("animationMap", this._animationMap);
    }
    /** Gets or sets a boolean indicating if the sprite map must consider scene fog when rendering */
    get fogEnabled() {
        return this._material.fogEnabled;
    }
    set fogEnabled(value) {
        this._material.fogEnabled = value;
    }
    /** Gets or sets a boolean indicating if the sprite map must use logarithmic depth when rendering */
    get useLogarithmicDepth() {
        return this._material.useLogarithmicDepth;
    }
    set useLogarithmicDepth(value) {
        this._material.useLogarithmicDepth = value;
    }
    /**
     * Creates a new SpriteMap
     * @param name defines the SpriteMaps Name
     * @param atlasJSON is the JSON file that controls the Sprites Frames and Meta
     * @param spriteSheet is the Texture that the Sprites are on.
     * @param options a basic deployment configuration
     * @param scene The Scene that the map is deployed on
     */
    constructor(name, atlasJSON, spriteSheet, options, scene) {
        this.name = name;
        this.sprites = [];
        this.atlasJSON = atlasJSON;
        this.sprites = this.atlasJSON["frames"];
        this.spriteSheet = spriteSheet;
        /**
         * Run through the options and set what ever defaults are needed that where not declared.
         */
        this.options = options;
        options.stageSize = options.stageSize || new math_vector/* Vector2 */.I9(1, 1);
        options.outputSize = options.outputSize || options.stageSize;
        options.outputPosition = options.outputPosition || math_vector/* Vector3 */.Pq.Zero();
        options.outputRotation = options.outputRotation || math_vector/* Vector3 */.Pq.Zero();
        options.layerCount = options.layerCount || 1;
        options.maxAnimationFrames = options.maxAnimationFrames || 0;
        options.baseTile = options.baseTile || 0;
        options.flipU = options.flipU || false;
        options.colorMultiply = options.colorMultiply || new math_vector/* Vector3 */.Pq(1, 1, 1);
        this._scene = scene;
        this._frameMap = this._createFrameBuffer();
        this._tileMaps = new Array();
        for (let i = 0; i < options.layerCount; i++) {
            this._tileMaps.push(this._createTileBuffer(null, i));
        }
        this._animationMap = this._createTileAnimationBuffer(null);
        const defines = [];
        defines.push("#define LAYERS " + options.layerCount);
        if (options?.frameRotationDirection === SpriteMapFrameRotationDirection.CW) {
            defines.push("#define FR_CW");
        }
        if (options.flipU) {
            defines.push("#define FLIPU");
        }
        defines.push(`#define MAX_ANIMATION_FRAMES ${options.maxAnimationFrames}.0`);
        const shaderString = Materials_effect/* Effect */.M.ShadersStore["spriteMapPixelShader"];
        let layerSampleString;
        if (!scene.getEngine()._features.supportSwitchCaseInShader) {
            layerSampleString = "";
            for (let i = 0; i < options.layerCount; i++) {
                layerSampleString += `if (${i} == i) { frameID = texture2D(tileMaps[${i}], (tileID + 0.5) / stageSize, 0.).x; }`;
            }
        }
        else {
            layerSampleString = "switch(i) {";
            for (let i = 0; i < options.layerCount; i++) {
                layerSampleString += "case " + i + " : frameID = texture(tileMaps[" + i + "], (tileID + 0.5) / stageSize, 0.).x;";
                layerSampleString += "break;";
            }
            layerSampleString += "}";
        }
        Materials_effect/* Effect */.M.ShadersStore["spriteMap" + this.name + "PixelShader"] = shaderString.replace("#define LAYER_ID_SWITCH", layerSampleString);
        this._material = new shaderMaterial/* ShaderMaterial */.B("spriteMap:" + this.name, this._scene, {
            vertex: "spriteMap",
            fragment: "spriteMap" + this.name,
        }, {
            defines,
            attributes: ["position", "normal", "uv"],
            uniforms: [
                "world",
                "view",
                "projection",
                "time",
                "stageSize",
                "outputSize",
                "spriteMapSize",
                "spriteCount",
                "time",
                "colorMul",
                "mousePosition",
                "curTile",
                "flipU",
            ],
            samplers: ["spriteSheet", "frameMap", "tileMaps", "animationMap"],
            needAlphaBlending: true,
        });
        this._time = 0;
        this._material.setFloat("spriteCount", this.spriteCount);
        this._material.setVector2("stageSize", options.stageSize);
        this._material.setVector2("outputSize", options.outputSize);
        this._material.setTexture("spriteSheet", this.spriteSheet);
        this._material.setVector2("spriteMapSize", new math_vector/* Vector2 */.I9(1, 1));
        this._material.setVector3("colorMul", options.colorMultiply);
        let tickSave = 0;
        const bindSpriteTexture = () => {
            if (this.spriteSheet && this.spriteSheet.isReady()) {
                if (this.spriteSheet._texture) {
                    this._material.setVector2("spriteMapSize", new math_vector/* Vector2 */.I9(this.spriteSheet._texture.baseWidth || 1, this.spriteSheet._texture.baseHeight || 1));
                    return;
                }
            }
            if (tickSave < 100) {
                setTimeout(() => {
                    tickSave++;
                    bindSpriteTexture();
                }, 100);
            }
        };
        bindSpriteTexture();
        this._material.setVector3("colorMul", options.colorMultiply);
        this._material.setTexture("frameMap", this._frameMap);
        this._material.setTextureArray("tileMaps", this._tileMaps);
        this._material.setTexture("animationMap", this._animationMap);
        this._material.setFloat("time", this._time);
        this._output = (0,planeBuilder/* CreatePlane */.x)(name + ":output", { size: 1, updatable: true }, scene);
        this._output.scaling.x = options.outputSize.x;
        this._output.scaling.y = options.outputSize.y;
        this.position = options.outputPosition;
        this.rotation = options.outputRotation;
        const obfunction = () => {
            this._time += this._scene.getEngine().getDeltaTime();
            this._material.setFloat("time", this._time);
        };
        this._scene.onBeforeRenderObservable.add(obfunction);
        this._output.material = this._material;
    }
    /**
     * Returns the index of the frame for a given filename
     * @param name filename of the frame
     * @returns index of the frame
     */
    getTileIdxByName(name) {
        const idx = this.atlasJSON.frames.findIndex((f) => f.filename === name);
        return idx;
    }
    /**
     * Returns tileID location
     * @returns Vector2 the cell position ID
     */
    getTileID() {
        const p = this.getMousePosition();
        p.multiplyInPlace(this.options.stageSize || math_vector/* Vector2 */.I9.Zero());
        p.x = Math.floor(p.x);
        p.y = Math.floor(p.y);
        return p;
    }
    /**
     * Gets the UV location of the mouse over the SpriteMap.
     * @returns Vector2 the UV position of the mouse interaction
     */
    getMousePosition() {
        const out = this._output;
        const pickinfo = this._scene.pick(this._scene.pointerX, this._scene.pointerY, (mesh) => {
            if (mesh !== out) {
                return false;
            }
            return true;
        });
        if (!pickinfo || !pickinfo.hit || !pickinfo.getTextureCoordinates) {
            return new math_vector/* Vector2 */.I9(-1, -1);
        }
        const coords = pickinfo.getTextureCoordinates();
        if (coords) {
            return coords;
        }
        return new math_vector/* Vector2 */.I9(-1, -1);
    }
    /**
     * Creates the "frame" texture Buffer
     * -------------------------------------
     * Structure of frames
     *  "filename": "Falling-Water-2.png",
     * "frame": {"x":69,"y":103,"w":24,"h":32},
     * "rotated": true,
     * "trimmed": true,
     * "spriteSourceSize": {"x":4,"y":0,"w":24,"h":32},
     * "sourceSize": {"w":32,"h":32}
     * @returns RawTexture of the frameMap
     */
    _createFrameBuffer() {
        const data = [];
        //Do two Passes
        for (let i = 0; i < this.spriteCount; i++) {
            data.push(0, 0, 0, 0); //frame
            data.push(0, 0, 0, 0); //spriteSourceSize
            data.push(0, 0, 0, 0); //sourceSize, rotated, trimmed
            data.push(0, 0, 0, 0); //Keep it pow2 cause I"m cool like that... it helps with sampling accuracy as well. Plus then we have 4 other parameters for future stuff.
        }
        //Second Pass
        for (let i = 0; i < this.spriteCount; i++) {
            const f = this.sprites[i]["frame"];
            const sss = this.sprites[i]["spriteSourceSize"];
            const ss = this.sprites[i]["sourceSize"];
            const r = this.sprites[i]["rotated"] ? 1 : 0;
            const t = this.sprites[i]["trimmed"] ? 1 : 0;
            //frame
            data[i * 4] = f.x;
            data[i * 4 + 1] = f.y;
            data[i * 4 + 2] = f.w;
            data[i * 4 + 3] = f.h;
            //spriteSourceSize
            data[i * 4 + this.spriteCount * 4] = sss.x;
            data[i * 4 + 1 + this.spriteCount * 4] = sss.y;
            data[i * 4 + 3 + this.spriteCount * 4] = sss.h;
            //sourceSize, rotated, trimmed
            data[i * 4 + this.spriteCount * 8] = ss.w;
            data[i * 4 + 1 + this.spriteCount * 8] = ss.h;
            data[i * 4 + 2 + this.spriteCount * 8] = r;
            data[i * 4 + 3 + this.spriteCount * 8] = t;
        }
        const floatArray = new Float32Array(data);
        const t = rawTexture/* RawTexture */.I.CreateRGBATexture(floatArray, this.spriteCount, 4, this._scene, false, false, Textures_texture/* Texture */.g.NEAREST_NEAREST, 1);
        return t;
    }
    /**
     * Creates the tileMap texture Buffer
     * @param buffer normally and array of numbers, or a false to generate from scratch
     * @param _layer indicates what layer for a logic trigger dealing with the baseTile.  The system uses this
     * @returns RawTexture of the tileMap
     */
    _createTileBuffer(buffer, _layer = 0) {
        let data = [];
        const _ty = this.options.stageSize.y || 0;
        const _tx = this.options.stageSize.x || 0;
        if (!buffer) {
            let bt = this.options.baseTile;
            if (_layer != 0) {
                bt = 0;
            }
            for (let y = 0; y < _ty; y++) {
                for (let x = 0; x < _tx * 4; x += 4) {
                    data.push(bt, 0, 0, 0);
                }
            }
        }
        else {
            data = buffer;
        }
        const floatArray = new Float32Array(data);
        const t = rawTexture/* RawTexture */.I.CreateRGBATexture(floatArray, _tx, _ty, this._scene, false, false, Textures_texture/* Texture */.g.NEAREST_NEAREST, 1);
        return t;
    }
    /**
     * Modifies the data of the tileMaps
     * @param _layer is the ID of the layer you want to edit on the SpriteMap
     * @param pos is the iVector2 Coordinates of the Tile
     * @param tile The SpriteIndex of the new Tile
     */
    changeTiles(_layer = 0, pos, tile = 0) {
        const buffer = this._tileMaps[_layer]._texture._bufferView;
        if (buffer === null) {
            return;
        }
        let p = [];
        if (pos instanceof math_vector/* Vector2 */.I9) {
            p.push(pos);
        }
        else {
            p = pos;
        }
        const _tx = this.options.stageSize.x || 0;
        for (let i = 0; i < p.length; i++) {
            const _p = p[i];
            _p.x = Math.floor(_p.x);
            _p.y = Math.floor(_p.y);
            const id = _p.x * 4 + _p.y * (_tx * 4);
            buffer[id] = tile;
        }
        const t = this._createTileBuffer(buffer);
        this._tileMaps[_layer].dispose();
        this._tileMaps[_layer] = t;
        this._material.setTextureArray("tileMap", this._tileMaps);
    }
    /**
     * Creates the animationMap texture Buffer
     * @param buffer normally and array of numbers, or a false to generate from scratch
     * @returns RawTexture of the animationMap
     */
    _createTileAnimationBuffer(buffer) {
        const data = [];
        let floatArray;
        if (!buffer) {
            for (let i = 0; i < this.spriteCount; i++) {
                data.push(0, 0, 0, 0);
                let count = 1;
                while (count < (this.options.maxAnimationFrames || 4)) {
                    data.push(0, 0, 0, 0);
                    count++;
                }
            }
            floatArray = new Float32Array(data);
        }
        else {
            floatArray = buffer;
        }
        const t = rawTexture/* RawTexture */.I.CreateRGBATexture(floatArray, this.spriteCount, this.options.maxAnimationFrames || 4, this._scene, false, false, Textures_texture/* Texture */.g.NEAREST_NEAREST, 1);
        return t;
    }
    /**
     * Modifies the data of the animationMap
     * @param cellID is the Index of the Sprite
     * @param _frame is the target Animation frame
     * @param toCell is the Target Index of the next frame of the animation
     * @param time is a value between 0-1 that is the trigger for when the frame should change tiles
     * @param speed is a global scalar of the time variable on the map.
     */
    addAnimationToTile(cellID = 0, _frame = 0, toCell = 0, time = 0, speed = 1) {
        const buffer = this._animationMap._texture._bufferView;
        const id = cellID * 4 + this.spriteCount * 4 * _frame;
        if (!buffer) {
            return;
        }
        buffer[id] = toCell;
        buffer[id + 1] = time;
        buffer[id + 2] = speed;
        const t = this._createTileAnimationBuffer(buffer);
        this._animationMap.dispose();
        this._animationMap = t;
        this._material.setTexture("animationMap", this._animationMap);
    }
    /**
     * Exports the .tilemaps file
     */
    saveTileMaps() {
        let maps = "";
        for (let i = 0; i < this._tileMaps.length; i++) {
            if (i > 0) {
                maps += "\n\r";
            }
            maps += this._tileMaps[i]._texture._bufferView.toString();
        }
        const hiddenElement = document.createElement("a");
        hiddenElement.href = "data:octet/stream;charset=utf-8," + encodeURI(maps);
        hiddenElement.target = "_blank";
        hiddenElement.download = this.name + ".tilemaps";
        hiddenElement.click();
        hiddenElement.remove();
    }
    /**
     * Imports the .tilemaps file
     * @param url of the .tilemaps file
     */
    loadTileMaps(url) {
        const xhr = new XMLHttpRequest();
        xhr.open("GET", url);
        const _lc = this.options.layerCount || 0;
        xhr.onload = () => {
            const data = xhr.response.split("\n\r");
            for (let i = 0; i < _lc; i++) {
                const d = data[i].split(",").map(Number);
                const t = this._createTileBuffer(d);
                this._tileMaps[i].dispose();
                this._tileMaps[i] = t;
            }
            this._material.setTextureArray("tileMap", this._tileMaps);
        };
        xhr.send();
    }
    /**
     * Release associated resources
     */
    dispose() {
        this._output.dispose();
        this._material.dispose();
        this._animationMap.dispose();
        this._tileMaps.forEach((tm) => {
            tm.dispose();
        });
        this._frameMap.dispose();
    }
}
//# sourceMappingURL=spriteMap.js.map
;// ./node_modules/@babylonjs/core/Sprites/spritePackedManager.js


/**
 * Class used to manage multiple sprites of different sizes on the same spritesheet
 * @see https://doc.babylonjs.com/features/featuresDeepDive/sprites
 */
/**
 *
 */
class SpritePackedManager extends SpriteManager {
    /**
     * Creates a new sprite manager from a packed sprite sheet
     * @param name defines the manager's name
     * @param imgUrl defines the sprite sheet url
     * @param capacity defines the maximum allowed number of sprites
     * @param scene defines the hosting scene
     * @param spriteJSON null otherwise a JSON object defining sprite sheet data
     * @param epsilon defines the epsilon value to align texture (0.01 by default)
     * @param samplingMode defines the sampling mode to use with spritesheet
     * @param fromPacked set to true; do not alter
     * @param options options for the sprite manager
     */
    constructor(
    /** defines the packed manager's name */
    name, imgUrl, capacity, scene, spriteJSON = null, epsilon = 0.01, samplingMode = Textures_texture/* Texture */.g.TRILINEAR_SAMPLINGMODE, options) {
        //the cellSize parameter is not used when built from JSON which provides individual cell data, defaults to 64 if JSON load fails
        super(name, imgUrl, capacity, 64, scene, epsilon, samplingMode, true, spriteJSON, options);
        this.name = name;
    }
}
//# sourceMappingURL=spritePackedManager.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/sprites.fragment.js
var sprites_fragment = __webpack_require__(12093);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Shaders/sprites.vertex.js
var sprites_vertex = __webpack_require__(79831);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/sprites.fragment.js + 1 modules
var ShadersWGSL_sprites_fragment = __webpack_require__(62843);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/ShadersWGSL/sprites.vertex.js
var ShadersWGSL_sprites_vertex = __webpack_require__(24448);
;// ./node_modules/@babylonjs/core/Sprites/index.js










//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/alphaCullingState.js
var alphaCullingState = __webpack_require__(26614);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/States/stencilState.js
var stencilState = __webpack_require__(56194);
;// ./node_modules/@babylonjs/core/States/index.js




//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/types.js

//# sourceMappingURL=types.js.map
;// ./node_modules/@babylonjs/core/XR/webXRTypes.js
/**
 * States of the webXR experience
 */
var WebXRState;
(function (WebXRState) {
    /**
     * Transitioning to being in XR mode
     */
    WebXRState[WebXRState["ENTERING_XR"] = 0] = "ENTERING_XR";
    /**
     * Transitioning to non XR mode
     */
    WebXRState[WebXRState["EXITING_XR"] = 1] = "EXITING_XR";
    /**
     * In XR mode and presenting
     */
    WebXRState[WebXRState["IN_XR"] = 2] = "IN_XR";
    /**
     * Not entered XR mode
     */
    WebXRState[WebXRState["NOT_IN_XR"] = 3] = "NOT_IN_XR";
})(WebXRState || (WebXRState = {}));
/**
 * The state of the XR camera's tracking
 */
var WebXRTrackingState;
(function (WebXRTrackingState) {
    /**
     * No transformation received, device is not being tracked
     */
    WebXRTrackingState[WebXRTrackingState["NOT_TRACKING"] = 0] = "NOT_TRACKING";
    /**
     * Tracking lost - using emulated position
     */
    WebXRTrackingState[WebXRTrackingState["TRACKING_LOST"] = 1] = "TRACKING_LOST";
    /**
     * Transformation tracking works normally
     */
    WebXRTrackingState[WebXRTrackingState["TRACKING"] = 2] = "TRACKING";
})(WebXRTrackingState || (WebXRTrackingState = {}));
//# sourceMappingURL=webXRTypes.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRHitTestLegacy.js





/**
 * The currently-working hit-test module.
 * Hit test (or Ray-casting) is used to interact with the real world.
 * For further information read here - https://github.com/immersive-web/hit-test
 */
class WebXRHitTestLegacy extends WebXRAbstractFeature {
    /**
     * Creates a new instance of the (legacy version) hit test feature
     * @param _xrSessionManager an instance of WebXRSessionManager
     * @param options options to use when constructing this feature
     */
    constructor(_xrSessionManager, 
    /**
     * [Empty Object] options to use when constructing this feature
     */
    options = {}) {
        super(_xrSessionManager);
        this.options = options;
        // in XR space z-forward is negative
        this._direction = new math_vector/* Vector3 */.Pq(0, 0, -1);
        this._mat = new math_vector/* Matrix */.uq();
        this._onSelectEnabled = false;
        this._origin = new math_vector/* Vector3 */.Pq(0, 0, 0);
        /**
         * Populated with the last native XR Hit Results
         */
        this.lastNativeXRHitResults = [];
        /**
         * Triggered when new babylon (transformed) hit test results are available
         */
        this.onHitTestResultObservable = new Misc_observable/* Observable */.cP();
        this._onHitTestResults = (xrResults) => {
            const mats = xrResults.map((result) => {
                const mat = math_vector/* Matrix */.uq.FromArray(result.hitMatrix);
                if (!this._xrSessionManager.scene.useRightHandedSystem) {
                    mat.toggleModelMatrixHandInPlace();
                }
                // if (this.options.coordinatesSpace === Space.WORLD) {
                if (this.options.worldParentNode) {
                    mat.multiplyToRef(this.options.worldParentNode.getWorldMatrix(), mat);
                }
                return {
                    xrHitResult: result,
                    transformationMatrix: mat,
                };
            });
            this.lastNativeXRHitResults = xrResults;
            this.onHitTestResultObservable.notifyObservers(mats);
        };
        // can be done using pointerdown event, and xrSessionManager.currentFrame
        this._onSelect = (event) => {
            if (!this._onSelectEnabled) {
                return;
            }
            WebXRHitTestLegacy.XRHitTestWithSelectEvent(event, this._xrSessionManager.referenceSpace);
        };
        this.xrNativeFeatureName = "hit-test";
        tools/* Tools */.S0.Warn("A newer version of this plugin is available");
    }
    /**
     * execute a hit test with an XR Ray
     *
     * @param xrSession a native xrSession that will execute this hit test
     * @param xrRay the ray (position and direction) to use for ray-casting
     * @param referenceSpace native XR reference space to use for the hit-test
     * @param filter filter function that will filter the results
     * @returns a promise that resolves with an array of native XR hit result in xr coordinates system
     */
    static XRHitTestWithRay(xrSession, xrRay, referenceSpace, filter) {
        return xrSession.requestHitTest(xrRay, referenceSpace).then((results) => {
            const filterFunction = filter || ((result) => !!result.hitMatrix);
            return results.filter(filterFunction);
        });
    }
    /**
     * Execute a hit test on the current running session using a select event returned from a transient input (such as touch)
     * @param event the (select) event to use to select with
     * @param referenceSpace the reference space to use for this hit test
     * @returns a promise that resolves with an array of native XR hit result in xr coordinates system
     */
    static XRHitTestWithSelectEvent(event, referenceSpace) {
        const targetRayPose = event.frame.getPose(event.inputSource.targetRaySpace, referenceSpace);
        if (!targetRayPose) {
            return Promise.resolve([]);
        }
        const targetRay = new XRRay(targetRayPose.transform);
        return this.XRHitTestWithRay(event.frame.session, targetRay, referenceSpace);
    }
    /**
     * attach this feature
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        if (this.options.testOnPointerDownOnly) {
            this._xrSessionManager.session.addEventListener("select", this._onSelect, false);
        }
        return true;
    }
    /**
     * detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        // disable select
        this._onSelectEnabled = false;
        this._xrSessionManager.session.removeEventListener("select", this._onSelect);
        return true;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        super.dispose();
        this.onHitTestResultObservable.clear();
    }
    _onXRFrame(frame) {
        // make sure we do nothing if (async) not attached
        if (!this.attached || this.options.testOnPointerDownOnly) {
            return;
        }
        const pose = frame.getViewerPose(this._xrSessionManager.referenceSpace);
        if (!pose) {
            return;
        }
        math_vector/* Matrix */.uq.FromArrayToRef(pose.transform.matrix, 0, this._mat);
        math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(0, 0, 0, this._mat, this._origin);
        math_vector/* Vector3 */.Pq.TransformCoordinatesFromFloatsToRef(0, 0, -1, this._mat, this._direction);
        this._direction.subtractInPlace(this._origin);
        this._direction.normalize();
        const ray = new XRRay({ x: this._origin.x, y: this._origin.y, z: this._origin.z, w: 0 }, { x: this._direction.x, y: this._direction.y, z: this._direction.z, w: 0 });
        WebXRHitTestLegacy.XRHitTestWithRay(this._xrSessionManager.session, ray, this._xrSessionManager.referenceSpace).then(this._onHitTestResults);
    }
}
/**
 * The module's name
 */
WebXRHitTestLegacy.Name = webXRFeaturesManager/* WebXRFeatureName */._.HIT_TEST;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRHitTestLegacy.Version = 1;
//register the plugin versions
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRHitTestLegacy.Name, (xrSessionManager, options) => {
    return () => new WebXRHitTestLegacy(xrSessionManager, options);
}, WebXRHitTestLegacy.Version, false);
//# sourceMappingURL=WebXRHitTestLegacy.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRAnchorSystem.js





let anchorIdProvider = 0;
/**
 * An implementation of the anchor system for WebXR.
 * For further information see https://github.com/immersive-web/anchors/
 */
class WebXRAnchorSystem extends WebXRAbstractFeature {
    /**
     * Set the reference space to use for anchor creation, when not using a hit test.
     * Will default to the session's reference space if not defined
     */
    set referenceSpaceForFrameAnchors(referenceSpace) {
        this._referenceSpaceForFrameAnchors = referenceSpace;
    }
    /**
     * constructs a new anchor system
     * @param _xrSessionManager an instance of WebXRSessionManager
     * @param _options configuration object for this feature
     */
    constructor(_xrSessionManager, _options = {}) {
        super(_xrSessionManager);
        this._options = _options;
        this._lastFrameDetected = new Set();
        this._trackedAnchors = [];
        this._futureAnchors = [];
        /**
         * Observers registered here will be executed when a new anchor was added to the session
         */
        this.onAnchorAddedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will be executed when an anchor was removed from the session
         */
        this.onAnchorRemovedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will be executed when an existing anchor updates
         * This can execute N times every frame
         */
        this.onAnchorUpdatedObservable = new Misc_observable/* Observable */.cP();
        this._tmpVector = new math_vector/* Vector3 */.Pq();
        this._tmpQuaternion = new math_vector/* Quaternion */.PT();
        this.xrNativeFeatureName = "anchors";
        if (this._options.clearAnchorsOnSessionInit) {
            this._xrSessionManager.onXRSessionInit.add(() => {
                this._trackedAnchors.length = 0;
                this._futureAnchors.length = 0;
                this._lastFrameDetected.clear();
            });
        }
    }
    _populateTmpTransformation(position, rotationQuaternion) {
        this._tmpVector.copyFrom(position);
        this._tmpQuaternion.copyFrom(rotationQuaternion);
        if (!this._xrSessionManager.scene.useRightHandedSystem) {
            this._tmpVector.z *= -1;
            this._tmpQuaternion.z *= -1;
            this._tmpQuaternion.w *= -1;
        }
        return {
            position: this._tmpVector,
            rotationQuaternion: this._tmpQuaternion,
        };
    }
    /**
     * Create a new anchor point using a hit test result at a specific point in the scene
     * An anchor is tracked only after it is added to the trackerAnchors in xrFrame. The promise returned here does not yet guaranty that.
     * Use onAnchorAddedObservable to get newly added anchors if you require tracking guaranty.
     *
     * @param hitTestResult The hit test result to use for this anchor creation
     * @param position an optional position offset for this anchor
     * @param rotationQuaternion an optional rotation offset for this anchor
     * @returns A promise that fulfills when babylon has created the corresponding WebXRAnchor object and tracking has begun
     */
    async addAnchorPointUsingHitTestResultAsync(hitTestResult, position = new math_vector/* Vector3 */.Pq(), rotationQuaternion = new math_vector/* Quaternion */.PT()) {
        // convert to XR space (right handed) if needed
        this._populateTmpTransformation(position, rotationQuaternion);
        // the matrix that we'll use
        const m = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w });
        if (!hitTestResult.xrHitResult.createAnchor) {
            this.detach();
            throw new Error("Anchors not enabled in this environment/browser");
        }
        else {
            try {
                const nativeAnchor = await hitTestResult.xrHitResult.createAnchor(m);
                return new Promise((resolve, reject) => {
                    this._futureAnchors.push({
                        nativeAnchor,
                        resolved: false,
                        submitted: true,
                        xrTransformation: m,
                        resolve,
                        reject,
                    });
                });
            }
            catch (error) {
                throw new Error(error);
            }
        }
    }
    /**
     * Add a new anchor at a specific position and rotation
     * This function will add a new anchor per default in the next available frame. Unless forced, the createAnchor function
     * will be called in the next xrFrame loop to make sure that the anchor can be created correctly.
     * An anchor is tracked only after it is added to the trackerAnchors in xrFrame. The promise returned here does not yet guaranty that.
     * Use onAnchorAddedObservable to get newly added anchors if you require tracking guaranty.
     *
     * @param position the position in which to add an anchor
     * @param rotationQuaternion an optional rotation for the anchor transformation
     * @param forceCreateInCurrentFrame force the creation of this anchor in the current frame. Must be called inside xrFrame loop!
     * @returns A promise that fulfills when babylon has created the corresponding WebXRAnchor object and tracking has begun
     */
    async addAnchorAtPositionAndRotationAsync(position, rotationQuaternion = new math_vector/* Quaternion */.PT(), forceCreateInCurrentFrame = false) {
        // convert to XR space (right handed) if needed
        this._populateTmpTransformation(position, rotationQuaternion);
        // the matrix that we'll use
        const xrTransformation = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w });
        const xrAnchor = forceCreateInCurrentFrame && this.attached && this._xrSessionManager.currentFrame
            ? await this._createAnchorAtTransformation(xrTransformation, this._xrSessionManager.currentFrame)
            : undefined;
        // add the transformation to the future anchors list
        return new Promise((resolve, reject) => {
            this._futureAnchors.push({
                nativeAnchor: xrAnchor,
                resolved: false,
                submitted: false,
                xrTransformation,
                resolve,
                reject,
            });
        });
    }
    /**
     * Get the list of anchors currently being tracked by the system
     */
    get anchors() {
        return this._trackedAnchors;
    }
    /**
     * detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        if (!this._options.doNotRemoveAnchorsOnSessionEnded) {
            while (this._trackedAnchors.length) {
                const toRemove = this._trackedAnchors.pop();
                if (toRemove) {
                    // as the xr frame loop is removed, we need to notify manually
                    this.onAnchorRemovedObservable.notifyObservers(toRemove);
                    // no need to call the remove fn as the anchor is already removed from the session
                }
            }
        }
        return true;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        this._futureAnchors.length = 0;
        super.dispose();
        this.onAnchorAddedObservable.clear();
        this.onAnchorRemovedObservable.clear();
        this.onAnchorUpdatedObservable.clear();
    }
    _onXRFrame(frame) {
        if (!this.attached || !frame) {
            return;
        }
        const trackedAnchors = frame.trackedAnchors;
        if (trackedAnchors) {
            const toRemove = this._trackedAnchors
                .filter((anchor) => !trackedAnchors.has(anchor.xrAnchor))
                .map((anchor) => {
                const index = this._trackedAnchors.indexOf(anchor);
                return index;
            });
            let idxTracker = 0;
            toRemove.forEach((index) => {
                const anchor = this._trackedAnchors.splice(index - idxTracker, 1)[0];
                this.onAnchorRemovedObservable.notifyObservers(anchor);
                idxTracker++;
            });
            // now check for new ones
            trackedAnchors.forEach((xrAnchor) => {
                if (!this._lastFrameDetected.has(xrAnchor)) {
                    const newAnchor = {
                        id: anchorIdProvider++,
                        xrAnchor: xrAnchor,
                        remove: () => xrAnchor.delete(),
                    };
                    const anchor = this._updateAnchorWithXRFrame(xrAnchor, newAnchor, frame);
                    this._trackedAnchors.push(anchor);
                    this.onAnchorAddedObservable.notifyObservers(anchor);
                    // search for the future anchor promise that matches this
                    const results = this._futureAnchors.filter((futureAnchor) => futureAnchor.nativeAnchor === xrAnchor);
                    const result = results[0];
                    if (result) {
                        result.resolve(anchor);
                        result.resolved = true;
                    }
                }
                else {
                    const index = this._findIndexInAnchorArray(xrAnchor);
                    const anchor = this._trackedAnchors[index];
                    try {
                        // anchors update every frame
                        this._updateAnchorWithXRFrame(xrAnchor, anchor, frame);
                        if (anchor.attachedNode) {
                            anchor.attachedNode.rotationQuaternion = anchor.attachedNode.rotationQuaternion || new math_vector/* Quaternion */.PT();
                            anchor.transformationMatrix.decompose(anchor.attachedNode.scaling, anchor.attachedNode.rotationQuaternion, anchor.attachedNode.position);
                        }
                        this.onAnchorUpdatedObservable.notifyObservers(anchor);
                    }
                    catch (e) {
                        tools/* Tools */.S0.Warn(`Anchor could not be updated`);
                    }
                }
            });
            this._lastFrameDetected = trackedAnchors;
        }
        // process future anchors
        this._futureAnchors.forEach((futureAnchor) => {
            if (!futureAnchor.resolved && !futureAnchor.submitted) {
                this._createAnchorAtTransformation(futureAnchor.xrTransformation, frame).then((nativeAnchor) => {
                    futureAnchor.nativeAnchor = nativeAnchor;
                }, (error) => {
                    futureAnchor.resolved = true;
                    futureAnchor.reject(error);
                });
                futureAnchor.submitted = true;
            }
        });
    }
    /**
     * avoiding using Array.find for global support.
     * @param xrAnchor the plane to find in the array
     * @returns the index of the anchor in the array or -1 if not found
     */
    _findIndexInAnchorArray(xrAnchor) {
        for (let i = 0; i < this._trackedAnchors.length; ++i) {
            if (this._trackedAnchors[i].xrAnchor === xrAnchor) {
                return i;
            }
        }
        return -1;
    }
    _updateAnchorWithXRFrame(xrAnchor, anchor, xrFrame) {
        // matrix
        const pose = xrFrame.getPose(xrAnchor.anchorSpace, this._xrSessionManager.referenceSpace);
        if (pose) {
            const mat = anchor.transformationMatrix || new math_vector/* Matrix */.uq();
            math_vector/* Matrix */.uq.FromArrayToRef(pose.transform.matrix, 0, mat);
            if (!this._xrSessionManager.scene.useRightHandedSystem) {
                mat.toggleModelMatrixHandInPlace();
            }
            anchor.transformationMatrix = mat;
            if (!this._options.worldParentNode) {
                // Logger.Warn("Please provide a world parent node to apply world transformation");
            }
            else {
                mat.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), mat);
            }
        }
        return anchor;
    }
    async _createAnchorAtTransformation(xrTransformation, xrFrame) {
        if (xrFrame.createAnchor) {
            try {
                return xrFrame.createAnchor(xrTransformation, this._referenceSpaceForFrameAnchors ?? this._xrSessionManager.referenceSpace);
            }
            catch (error) {
                throw new Error(error);
            }
        }
        else {
            this.detach();
            throw new Error("Anchors are not enabled in your browser");
        }
    }
}
/**
 * The module's name
 */
WebXRAnchorSystem.Name = webXRFeaturesManager/* WebXRFeatureName */._.ANCHOR_SYSTEM;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRAnchorSystem.Version = 1;
// register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRAnchorSystem.Name, (xrSessionManager, options) => {
    return () => new WebXRAnchorSystem(xrSessionManager, options);
}, WebXRAnchorSystem.Version);
//# sourceMappingURL=WebXRAnchorSystem.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRPlaneDetector.js




let planeIdProvider = 0;
/**
 * The plane detector is used to detect planes in the real world when in AR
 * For more information see https://github.com/immersive-web/real-world-geometry/
 */
class WebXRPlaneDetector extends WebXRAbstractFeature {
    /**
     * construct a new Plane Detector
     * @param _xrSessionManager an instance of xr Session manager
     * @param _options configuration to use when constructing this feature
     */
    constructor(_xrSessionManager, _options = {}) {
        super(_xrSessionManager);
        this._options = _options;
        this._detectedPlanes = [];
        this._enabled = false;
        this._lastFrameDetected = new Set();
        /**
         * Observers registered here will be executed when a new plane was added to the session
         */
        this.onPlaneAddedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will be executed when a plane is no longer detected in the session
         */
        this.onPlaneRemovedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will be executed when an existing plane updates (for example - expanded)
         * This can execute N times every frame
         */
        this.onPlaneUpdatedObservable = new Misc_observable/* Observable */.cP();
        this.xrNativeFeatureName = "plane-detection";
        if (this._xrSessionManager.session) {
            this._init();
        }
        else {
            this._xrSessionManager.onXRSessionInit.addOnce(() => {
                this._init();
            });
        }
    }
    /**
     * detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        if (!this._options.doNotRemovePlanesOnSessionEnded) {
            while (this._detectedPlanes.length) {
                const toRemove = this._detectedPlanes.pop();
                if (toRemove) {
                    this.onPlaneRemovedObservable.notifyObservers(toRemove);
                }
            }
        }
        return true;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        super.dispose();
        this.onPlaneAddedObservable.clear();
        this.onPlaneRemovedObservable.clear();
        this.onPlaneUpdatedObservable.clear();
    }
    /**
     * Check if the needed objects are defined.
     * This does not mean that the feature is enabled, but that the objects needed are well defined.
     * @returns true if the initial compatibility test passed
     */
    isCompatible() {
        return typeof XRPlane !== "undefined";
    }
    /**
     * Enable room capture mode.
     * When enabled and supported by the system,
     * the detectedPlanes array will be populated with the detected room boundaries
     * @see https://immersive-web.github.io/real-world-geometry/plane-detection.html#dom-xrsession-initiateroomcapture
     * @returns true if plane detection is enabled and supported. Will reject if not supported.
     */
    async initiateRoomCapture() {
        if (this._xrSessionManager.session.initiateRoomCapture) {
            return this._xrSessionManager.session.initiateRoomCapture();
        }
        return Promise.reject("initiateRoomCapture is not supported on this session");
    }
    _onXRFrame(frame) {
        if (!this.attached || !this._enabled || !frame) {
            return;
        }
        const detectedPlanes = frame.detectedPlanes || frame.worldInformation?.detectedPlanes;
        if (detectedPlanes) {
            // remove all planes that are not currently detected in the frame
            for (let planeIdx = 0; planeIdx < this._detectedPlanes.length; planeIdx++) {
                const plane = this._detectedPlanes[planeIdx];
                if (!detectedPlanes.has(plane.xrPlane)) {
                    this._detectedPlanes.splice(planeIdx--, 1);
                    this.onPlaneRemovedObservable.notifyObservers(plane);
                }
            }
            // now check for new ones
            detectedPlanes.forEach((xrPlane) => {
                if (!this._lastFrameDetected.has(xrPlane)) {
                    const newPlane = {
                        id: planeIdProvider++,
                        xrPlane: xrPlane,
                        polygonDefinition: [],
                    };
                    const plane = this._updatePlaneWithXRPlane(xrPlane, newPlane, frame);
                    this._detectedPlanes.push(plane);
                    this.onPlaneAddedObservable.notifyObservers(plane);
                }
                else {
                    // updated?
                    if (xrPlane.lastChangedTime === this._xrSessionManager.currentTimestamp) {
                        const index = this._findIndexInPlaneArray(xrPlane);
                        const plane = this._detectedPlanes[index];
                        this._updatePlaneWithXRPlane(xrPlane, plane, frame);
                        this.onPlaneUpdatedObservable.notifyObservers(plane);
                    }
                }
            });
            this._lastFrameDetected = detectedPlanes;
        }
    }
    _init() {
        const internalInit = () => {
            this._enabled = true;
            if (this._detectedPlanes.length) {
                this._detectedPlanes.length = 0;
            }
        };
        // Only supported by BabylonNative
        if (!!this._xrSessionManager.isNative && !!this._options.preferredDetectorOptions && !!this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions) {
            this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions(this._options.preferredDetectorOptions);
        }
        if (!this._xrSessionManager.session.updateWorldTrackingState) {
            internalInit();
            return;
        }
        this._xrSessionManager.session.updateWorldTrackingState({ planeDetectionState: { enabled: true } });
        internalInit();
    }
    _updatePlaneWithXRPlane(xrPlane, plane, xrFrame) {
        plane.polygonDefinition = xrPlane.polygon.map((xrPoint) => {
            const rightHandedSystem = this._xrSessionManager.scene.useRightHandedSystem ? 1 : -1;
            return new math_vector/* Vector3 */.Pq(xrPoint.x, xrPoint.y, xrPoint.z * rightHandedSystem);
        });
        // matrix
        const pose = xrFrame.getPose(xrPlane.planeSpace, this._xrSessionManager.referenceSpace);
        if (pose) {
            const mat = plane.transformationMatrix || new math_vector/* Matrix */.uq();
            math_vector/* Matrix */.uq.FromArrayToRef(pose.transform.matrix, 0, mat);
            if (!this._xrSessionManager.scene.useRightHandedSystem) {
                mat.toggleModelMatrixHandInPlace();
            }
            plane.transformationMatrix = mat;
            if (this._options.worldParentNode) {
                mat.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), mat);
            }
        }
        return plane;
    }
    /**
     * avoiding using Array.find for global support.
     * @param xrPlane the plane to find in the array
     * @returns the index of the plane in the array or -1 if not found
     */
    _findIndexInPlaneArray(xrPlane) {
        for (let i = 0; i < this._detectedPlanes.length; ++i) {
            if (this._detectedPlanes[i].xrPlane === xrPlane) {
                return i;
            }
        }
        return -1;
    }
}
/**
 * The module's name
 */
WebXRPlaneDetector.Name = webXRFeaturesManager/* WebXRFeatureName */._.PLANE_DETECTION;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRPlaneDetector.Version = 1;
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRPlaneDetector.Name, (xrSessionManager, options) => {
    return () => new WebXRPlaneDetector(xrSessionManager, options);
}, WebXRPlaneDetector.Version);
//# sourceMappingURL=WebXRPlaneDetector.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRBackgroundRemover.js



/**
 * A module that will automatically disable background meshes when entering AR and will enable them when leaving AR.
 */
class WebXRBackgroundRemover extends WebXRAbstractFeature {
    /**
     * constructs a new background remover module
     * @param _xrSessionManager the session manager for this module
     * @param options read-only options to be used in this module
     */
    constructor(_xrSessionManager, 
    /**
     * [Empty Object] read-only options to be used in this module
     */
    options = {}) {
        super(_xrSessionManager);
        this.options = options;
        /**
         * registered observers will be triggered when the background state changes
         */
        this.onBackgroundStateChangedObservable = new Misc_observable/* Observable */.cP();
    }
    /**
     * attach this feature
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    attach() {
        this._setBackgroundState(false);
        return super.attach();
    }
    /**
     * detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        this._setBackgroundState(true);
        return super.detach();
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        super.dispose();
        this.onBackgroundStateChangedObservable.clear();
    }
    _onXRFrame(_xrFrame) {
        // no-op
    }
    _setBackgroundState(newState) {
        const scene = this._xrSessionManager.scene;
        if (!this.options.ignoreEnvironmentHelper) {
            if (this.options.environmentHelperRemovalFlags) {
                if (this.options.environmentHelperRemovalFlags.skyBox) {
                    const backgroundSkybox = scene.getMeshByName("BackgroundSkybox");
                    if (backgroundSkybox) {
                        backgroundSkybox.setEnabled(newState);
                    }
                }
                if (this.options.environmentHelperRemovalFlags.ground) {
                    const backgroundPlane = scene.getMeshByName("BackgroundPlane");
                    if (backgroundPlane) {
                        backgroundPlane.setEnabled(newState);
                    }
                }
            }
            else {
                const backgroundHelper = scene.getMeshByName("BackgroundHelper");
                if (backgroundHelper) {
                    backgroundHelper.setEnabled(newState);
                }
            }
        }
        if (this.options.backgroundMeshes) {
            this.options.backgroundMeshes.forEach((mesh) => mesh.setEnabled(newState));
        }
        this.onBackgroundStateChangedObservable.notifyObservers(newState);
    }
}
/**
 * The module's name
 */
WebXRBackgroundRemover.Name = webXRFeaturesManager/* WebXRFeatureName */._.BACKGROUND_REMOVER;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRBackgroundRemover.Version = 1;
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRBackgroundRemover.Name, (xrSessionManager, options) => {
    return () => new WebXRBackgroundRemover(xrSessionManager, options);
}, WebXRBackgroundRemover.Version, true);
//# sourceMappingURL=WebXRBackgroundRemover.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRControllerPhysics.js






/**
 * Options for the controller physics feature
 */
class IWebXRControllerPhysicsOptions {
}
/**
 * Add physics impostor to your webxr controllers,
 * including naive calculation of their linear and angular velocity
 */
class WebXRControllerPhysics extends WebXRAbstractFeature {
    _createPhysicsImpostor(xrController) {
        const impostorType = this._options.physicsProperties.impostorType || PhysicsImpostor.SphereImpostor;
        const impostorSize = this._options.physicsProperties.impostorSize || 0.1;
        const impostorMesh = CreateSphere("impostor-mesh-" + xrController.uniqueId, {
            diameterX: typeof impostorSize === "number" ? impostorSize : impostorSize.width,
            diameterY: typeof impostorSize === "number" ? impostorSize : impostorSize.height,
            diameterZ: typeof impostorSize === "number" ? impostorSize : impostorSize.depth,
        });
        impostorMesh.isVisible = this._debugMode;
        impostorMesh.isPickable = false;
        impostorMesh.rotationQuaternion = new math_vector/* Quaternion */.PT();
        const controllerMesh = xrController.grip || xrController.pointer;
        impostorMesh.position.copyFrom(controllerMesh.position);
        impostorMesh.rotationQuaternion.copyFrom(controllerMesh.rotationQuaternion);
        const impostor = new PhysicsImpostor(impostorMesh, impostorType, {
            mass: 0,
            ...this._options.physicsProperties,
        });
        this._controllers[xrController.uniqueId] = {
            xrController,
            impostor,
            impostorMesh,
        };
    }
    /**
     * Construct a new Controller Physics Feature
     * @param _xrSessionManager the corresponding xr session manager
     * @param _options options to create this feature with
     */
    constructor(_xrSessionManager, _options) {
        super(_xrSessionManager);
        this._options = _options;
        this._attachController = (xrController) => {
            if (this._controllers[xrController.uniqueId]) {
                // already attached
                return;
            }
            if (!this._xrSessionManager.scene.isPhysicsEnabled()) {
                logger/* Logger */.V.Warn("physics engine not enabled, skipped. Please add this controller manually.");
            }
            // if no motion controller available, create impostors!
            if (this._options.physicsProperties.useControllerMesh && xrController.inputSource.gamepad) {
                xrController.onMotionControllerInitObservable.addOnce((motionController) => {
                    if (!motionController._doNotLoadControllerMesh) {
                        motionController.onModelLoadedObservable.addOnce(() => {
                            const impostor = new PhysicsImpostor(motionController.rootMesh, PhysicsImpostor.MeshImpostor, {
                                mass: 0,
                                ...this._options.physicsProperties,
                            });
                            const controllerMesh = xrController.grip || xrController.pointer;
                            this._controllers[xrController.uniqueId] = {
                                xrController,
                                impostor,
                                oldPos: controllerMesh.position.clone(),
                                oldRotation: controllerMesh.rotationQuaternion.clone(),
                            };
                        });
                    }
                    else {
                        // This controller isn't using a model, create impostors instead
                        this._createPhysicsImpostor(xrController);
                    }
                });
            }
            else {
                this._createPhysicsImpostor(xrController);
            }
        };
        this._controllers = {};
        this._debugMode = false;
        this._delta = 0;
        this._lastTimestamp = 0;
        this._tmpQuaternion = new math_vector/* Quaternion */.PT();
        this._tmpVector = new math_vector/* Vector3 */.Pq();
        if (!this._options.physicsProperties) {
            this._options.physicsProperties = {};
        }
    }
    /**
     * @internal
     * enable debugging - will show console outputs and the impostor mesh
     */
    _enablePhysicsDebug() {
        this._debugMode = true;
        Object.keys(this._controllers).forEach((controllerId) => {
            const controllerData = this._controllers[controllerId];
            if (controllerData.impostorMesh) {
                controllerData.impostorMesh.isVisible = true;
            }
        });
    }
    /**
     * Manually add a controller (if no xrInput was provided or physics engine was not enabled)
     * @param xrController the controller to add
     */
    addController(xrController) {
        this._attachController(xrController);
    }
    /**
     * attach this feature
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        if (!this._options.xrInput) {
            return true;
        }
        this._options.xrInput.controllers.forEach(this._attachController);
        this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController);
        this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, (controller) => {
            // REMOVE the controller
            this._detachController(controller.uniqueId);
        });
        if (this._options.enableHeadsetImpostor) {
            const params = this._options.headsetImpostorParams || {
                impostorType: PhysicsImpostor.SphereImpostor,
                restitution: 0.8,
                impostorSize: 0.3,
            };
            const impostorSize = params.impostorSize || 0.3;
            this._headsetMesh = CreateSphere("headset-mesh", {
                diameterX: typeof impostorSize === "number" ? impostorSize : impostorSize.width,
                diameterY: typeof impostorSize === "number" ? impostorSize : impostorSize.height,
                diameterZ: typeof impostorSize === "number" ? impostorSize : impostorSize.depth,
            });
            this._headsetMesh.rotationQuaternion = new math_vector/* Quaternion */.PT();
            this._headsetMesh.isVisible = false;
            this._headsetImpostor = new PhysicsImpostor(this._headsetMesh, params.impostorType, { mass: 0, ...params });
        }
        return true;
    }
    /**
     * detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        Object.keys(this._controllers).forEach((controllerId) => {
            this._detachController(controllerId);
        });
        if (this._headsetMesh) {
            this._headsetMesh.dispose();
        }
        return true;
    }
    /**
     * Get the headset impostor, if enabled
     * @returns the impostor
     */
    getHeadsetImpostor() {
        return this._headsetImpostor;
    }
    /**
     * Get the physics impostor of a specific controller.
     * The impostor is not attached to a mesh because a mesh for each controller is not obligatory
     * @param controller the controller or the controller id of which to get the impostor
     * @returns the impostor or null
     */
    getImpostorForController(controller) {
        const id = typeof controller === "string" ? controller : controller.uniqueId;
        if (this._controllers[id]) {
            return this._controllers[id].impostor;
        }
        else {
            return null;
        }
    }
    /**
     * Update the physics properties provided in the constructor
     * @param newProperties the new properties object
     * @param newProperties.impostorType
     * @param newProperties.impostorSize
     * @param newProperties.friction
     * @param newProperties.restitution
     */
    setPhysicsProperties(newProperties) {
        this._options.physicsProperties = {
            ...this._options.physicsProperties,
            ...newProperties,
        };
    }
    _onXRFrame(_xrFrame) {
        this._delta = this._xrSessionManager.currentTimestamp - this._lastTimestamp;
        this._lastTimestamp = this._xrSessionManager.currentTimestamp;
        if (this._headsetMesh && this._headsetImpostor) {
            this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.globalPosition);
            this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.absoluteRotation);
            if (this._options.xrInput.xrCamera._lastXRViewerPose?.linearVelocity) {
                const lv = this._options.xrInput.xrCamera._lastXRViewerPose.linearVelocity;
                this._tmpVector.set(lv.x, lv.y, lv.z);
                this._headsetImpostor.setLinearVelocity(this._tmpVector);
            }
            if (this._options.xrInput.xrCamera._lastXRViewerPose?.angularVelocity) {
                const av = this._options.xrInput.xrCamera._lastXRViewerPose.angularVelocity;
                this._tmpVector.set(av.x, av.y, av.z);
                this._headsetImpostor.setAngularVelocity(this._tmpVector);
            }
        }
        Object.keys(this._controllers).forEach((controllerId) => {
            const controllerData = this._controllers[controllerId];
            const controllerMesh = controllerData.xrController.grip || controllerData.xrController.pointer;
            const comparedPosition = controllerData.oldPos || controllerData.impostorMesh.position;
            if (controllerData.xrController._lastXRPose?.linearVelocity) {
                const lv = controllerData.xrController._lastXRPose.linearVelocity;
                this._tmpVector.set(lv.x, lv.y, lv.z);
                controllerData.impostor.setLinearVelocity(this._tmpVector);
            }
            else {
                controllerMesh.position.subtractToRef(comparedPosition, this._tmpVector);
                this._tmpVector.scaleInPlace(1000 / this._delta);
                controllerData.impostor.setLinearVelocity(this._tmpVector);
            }
            comparedPosition.copyFrom(controllerMesh.position);
            if (this._debugMode) {
                logger/* Logger */.V.Log([this._tmpVector, "linear"]);
            }
            const comparedQuaternion = controllerData.oldRotation || controllerData.impostorMesh.rotationQuaternion;
            if (controllerData.xrController._lastXRPose?.angularVelocity) {
                const av = controllerData.xrController._lastXRPose.angularVelocity;
                this._tmpVector.set(av.x, av.y, av.z);
                controllerData.impostor.setAngularVelocity(this._tmpVector);
            }
            else {
                if (!comparedQuaternion.equalsWithEpsilon(controllerMesh.rotationQuaternion)) {
                    // roughly based on this - https://www.gamedev.net/forums/topic/347752-quaternion-and-angular-velocity/
                    comparedQuaternion.conjugateInPlace().multiplyToRef(controllerMesh.rotationQuaternion, this._tmpQuaternion);
                    const len = Math.sqrt(this._tmpQuaternion.x * this._tmpQuaternion.x + this._tmpQuaternion.y * this._tmpQuaternion.y + this._tmpQuaternion.z * this._tmpQuaternion.z);
                    this._tmpVector.set(this._tmpQuaternion.x, this._tmpQuaternion.y, this._tmpQuaternion.z);
                    // define a better epsilon
                    if (len < 0.001) {
                        this._tmpVector.scaleInPlace(2);
                    }
                    else {
                        const angle = 2 * Math.atan2(len, this._tmpQuaternion.w);
                        this._tmpVector.scaleInPlace(angle / (len * (this._delta / 1000)));
                    }
                    controllerData.impostor.setAngularVelocity(this._tmpVector);
                }
            }
            comparedQuaternion.copyFrom(controllerMesh.rotationQuaternion);
            if (this._debugMode) {
                logger/* Logger */.V.Log([this._tmpVector, this._tmpQuaternion, "angular"]);
            }
        });
    }
    _detachController(xrControllerUniqueId) {
        const controllerData = this._controllers[xrControllerUniqueId];
        if (!controllerData) {
            return;
        }
        if (controllerData.impostorMesh) {
            controllerData.impostorMesh.dispose();
        }
        // remove from the map
        delete this._controllers[xrControllerUniqueId];
    }
}
/**
 * The module's name
 */
WebXRControllerPhysics.Name = webXRFeaturesManager/* WebXRFeatureName */._.PHYSICS_CONTROLLERS;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the webxr specs version
 */
WebXRControllerPhysics.Version = 1;
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRControllerPhysics.Name, (xrSessionManager, options) => {
    return () => new WebXRControllerPhysics(xrSessionManager, options);
}, WebXRControllerPhysics.Version, true);
//# sourceMappingURL=WebXRControllerPhysics.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRHitTest.js





/**
 * The currently-working hit-test module.
 * Hit test (or Ray-casting) is used to interact with the real world.
 * For further information read here - https://github.com/immersive-web/hit-test
 *
 * Tested on chrome (mobile) 80.
 */
class WebXRHitTest extends WebXRAbstractFeature {
    /**
     * Creates a new instance of the hit test feature
     * @param _xrSessionManager an instance of WebXRSessionManager
     * @param options options to use when constructing this feature
     */
    constructor(_xrSessionManager, 
    /**
     * [Empty Object] options to use when constructing this feature
     */
    options = {}) {
        super(_xrSessionManager);
        this.options = options;
        this._tmpMat = new math_vector/* Matrix */.uq();
        this._tmpPos = new math_vector/* Vector3 */.Pq();
        this._tmpQuat = new math_vector/* Quaternion */.PT();
        this._initHitTestSource = (referenceSpace) => {
            if (!referenceSpace) {
                return;
            }
            const offsetRay = new XRRay(this.options.offsetRay || {});
            const hitTestOptions = {
                space: this.options.useReferenceSpace ? referenceSpace : this._xrSessionManager.viewerReferenceSpace,
                offsetRay: offsetRay,
            };
            if (this.options.entityTypes) {
                hitTestOptions.entityTypes = this.options.entityTypes;
            }
            if (!hitTestOptions.space) {
                tools/* Tools */.S0.Warn("waiting for viewer reference space to initialize");
                return;
            }
            this._xrSessionManager.session.requestHitTestSource(hitTestOptions).then((hitTestSource) => {
                if (this._xrHitTestSource) {
                    this._xrHitTestSource.cancel();
                }
                this._xrHitTestSource = hitTestSource;
            });
        };
        /**
         * When set to true, each hit test will have its own position/rotation objects
         * When set to false, position and rotation objects will be reused for each hit test. It is expected that
         * the developers will clone them or copy them as they see fit.
         */
        this.autoCloneTransformation = false;
        /**
         * Triggered when new babylon (transformed) hit test results are available
         * Note - this will be called when results come back from the device. It can be an empty array!!
         */
        this.onHitTestResultObservable = new Misc_observable/* Observable */.cP();
        /**
         * Use this to temporarily pause hit test checks.
         */
        this.paused = false;
        this.xrNativeFeatureName = "hit-test";
        tools/* Tools */.S0.Warn("Hit test is an experimental and unstable feature.");
    }
    /**
     * attach this feature
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        // Feature enabled, but not available
        if (!this._xrSessionManager.session.requestHitTestSource) {
            return false;
        }
        if (!this.options.disablePermanentHitTest) {
            if (this._xrSessionManager.referenceSpace) {
                this._initHitTestSource(this._xrSessionManager.referenceSpace);
            }
            this._xrSessionManager.onXRReferenceSpaceChanged.add(this._initHitTestSource);
        }
        if (this.options.enableTransientHitTest) {
            const offsetRay = new XRRay(this.options.transientOffsetRay || {});
            this._xrSessionManager.session.requestHitTestSourceForTransientInput({
                profile: this.options.transientHitTestProfile || "generic-touchscreen",
                offsetRay,
                entityTypes: this.options.entityTypes,
            }).then((hitSource) => {
                this._transientXrHitTestSource = hitSource;
            });
        }
        return true;
    }
    /**
     * detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        if (this._xrHitTestSource) {
            this._xrHitTestSource.cancel();
            this._xrHitTestSource = null;
        }
        this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this._initHitTestSource);
        if (this._transientXrHitTestSource) {
            this._transientXrHitTestSource.cancel();
            this._transientXrHitTestSource = null;
        }
        return true;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        super.dispose();
        this.onHitTestResultObservable.clear();
    }
    _onXRFrame(frame) {
        // make sure we do nothing if (async) not attached
        if (!this.attached || this.paused) {
            return;
        }
        if (this._xrHitTestSource) {
            const results = frame.getHitTestResults(this._xrHitTestSource);
            this._processWebXRHitTestResult(results);
        }
        if (this._transientXrHitTestSource) {
            const hitTestResultsPerInputSource = frame.getHitTestResultsForTransientInput(this._transientXrHitTestSource);
            hitTestResultsPerInputSource.forEach((resultsPerInputSource) => {
                this._processWebXRHitTestResult(resultsPerInputSource.results, resultsPerInputSource.inputSource);
            });
        }
    }
    _processWebXRHitTestResult(hitTestResults, inputSource) {
        const results = [];
        hitTestResults.forEach((hitTestResult) => {
            const pose = hitTestResult.getPose(this._xrSessionManager.referenceSpace);
            if (!pose) {
                return;
            }
            const pos = pose.transform.position;
            const quat = pose.transform.orientation;
            this._tmpPos.set(pos.x, pos.y, pos.z).scaleInPlace(this._xrSessionManager.worldScalingFactor);
            this._tmpQuat.set(quat.x, quat.y, quat.z, quat.w);
            math_vector/* Matrix */.uq.FromFloat32ArrayToRefScaled(pose.transform.matrix, 0, 1, this._tmpMat);
            if (!this._xrSessionManager.scene.useRightHandedSystem) {
                this._tmpPos.z *= -1;
                this._tmpQuat.z *= -1;
                this._tmpQuat.w *= -1;
                this._tmpMat.toggleModelMatrixHandInPlace();
            }
            const result = {
                position: this.autoCloneTransformation ? this._tmpPos.clone() : this._tmpPos,
                rotationQuaternion: this.autoCloneTransformation ? this._tmpQuat.clone() : this._tmpQuat,
                transformationMatrix: this.autoCloneTransformation ? this._tmpMat.clone() : this._tmpMat,
                inputSource: inputSource,
                isTransient: !!inputSource,
                xrHitResult: hitTestResult,
            };
            results.push(result);
        });
        this.onHitTestResultObservable.notifyObservers(results);
    }
}
/**
 * The module's name
 */
WebXRHitTest.Name = webXRFeaturesManager/* WebXRFeatureName */._.HIT_TEST;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRHitTest.Version = 2;
//register the plugin versions
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRHitTest.Name, (xrSessionManager, options) => {
    return () => new WebXRHitTest(xrSessionManager, options);
}, WebXRHitTest.Version, false);
//# sourceMappingURL=WebXRHitTest.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRFeaturePointSystem.js




/**
 * The feature point system is used to detect feature points from real world geometry.
 * This feature is currently experimental and only supported on BabylonNative, and should not be used in the browser.
 * The newly introduced API can be seen in webxr.nativeextensions.d.ts and described in FeaturePoints.md.
 */
class WebXRFeaturePointSystem extends WebXRAbstractFeature {
    /**
     * The current feature point cloud maintained across frames.
     */
    get featurePointCloud() {
        return this._featurePointCloud;
    }
    /**
     * construct the feature point system
     * @param _xrSessionManager an instance of xr Session manager
     */
    constructor(_xrSessionManager) {
        super(_xrSessionManager);
        this._enabled = false;
        this._featurePointCloud = [];
        /**
         * Observers registered here will be executed whenever new feature points are added (on XRFrame while the session is tracking).
         * Will notify the observers about which feature points have been added.
         */
        this.onFeaturePointsAddedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will be executed whenever a feature point has been updated (on XRFrame while the session is tracking).
         * Will notify the observers about which feature points have been updated.
         */
        this.onFeaturePointsUpdatedObservable = new Misc_observable/* Observable */.cP();
        this.xrNativeFeatureName = "bjsfeature-points";
        if (this._xrSessionManager.session) {
            this._init();
        }
        else {
            this._xrSessionManager.onXRSessionInit.addOnce(() => {
                this._init();
            });
        }
    }
    /**
     * Detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        this.featurePointCloud.length = 0;
        return true;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        super.dispose();
        this._featurePointCloud.length = 0;
        this.onFeaturePointsUpdatedObservable.clear();
        this.onFeaturePointsAddedObservable.clear();
    }
    /**
     * On receiving a new XR frame if this feature is attached notify observers new feature point data is available.
     * @param frame
     */
    _onXRFrame(frame) {
        if (!this.attached || !this._enabled || !frame) {
            return;
        }
        const featurePointRawData = frame.featurePointCloud;
        if (!featurePointRawData || featurePointRawData.length === 0) {
            return;
        }
        else {
            if (featurePointRawData.length % 5 !== 0) {
                throw new Error("Received malformed feature point cloud of length: " + featurePointRawData.length);
            }
            const numberOfFeaturePoints = featurePointRawData.length / 5;
            const updatedFeaturePoints = [];
            const addedFeaturePoints = [];
            for (let i = 0; i < numberOfFeaturePoints; i++) {
                const rawIndex = i * 5;
                const id = featurePointRawData[rawIndex + 4];
                // IDs should be durable across frames and strictly increasing from 0 up, so use them as indexing into the feature point array.
                if (!this._featurePointCloud[id]) {
                    this._featurePointCloud[id] = { position: new math_vector/* Vector3 */.Pq(), confidenceValue: 0 };
                    addedFeaturePoints.push(id);
                }
                else {
                    updatedFeaturePoints.push(id);
                }
                // Set the feature point values.
                this._featurePointCloud[id].position.x = featurePointRawData[rawIndex];
                this._featurePointCloud[id].position.y = featurePointRawData[rawIndex + 1];
                this._featurePointCloud[id].position.z = featurePointRawData[rawIndex + 2];
                this._featurePointCloud[id].confidenceValue = featurePointRawData[rawIndex + 3];
            }
            // Signal observers that feature points have been added if necessary.
            if (addedFeaturePoints.length > 0) {
                this.onFeaturePointsAddedObservable.notifyObservers(addedFeaturePoints);
            }
            // Signal observers that feature points have been updated if necessary.
            if (updatedFeaturePoints.length > 0) {
                this.onFeaturePointsUpdatedObservable.notifyObservers(updatedFeaturePoints);
            }
        }
    }
    /**
     * Initializes the feature. If the feature point feature is not available for this environment do not mark the feature as enabled.
     */
    _init() {
        if (!this._xrSessionManager.session.trySetFeaturePointCloudEnabled || !this._xrSessionManager.session.trySetFeaturePointCloudEnabled(true)) {
            // fail silently
            return;
        }
        this._enabled = true;
    }
}
/**
 * The module's name
 */
WebXRFeaturePointSystem.Name = webXRFeaturesManager/* WebXRFeatureName */._.FEATURE_POINTS;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRFeaturePointSystem.Version = 1;
// register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRFeaturePointSystem.Name, (xrSessionManager) => {
    return () => new WebXRFeaturePointSystem(xrSessionManager);
}, WebXRFeaturePointSystem.Version);
//# sourceMappingURL=WebXRFeaturePointSystem.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRMeshDetector.js







let meshIdProvider = 0;
/**
 * The mesh detector is used to detect meshes in the real world when in AR
 */
class WebXRMeshDetector extends WebXRAbstractFeature {
    constructor(_xrSessionManager, _options = {}) {
        super(_xrSessionManager);
        this._options = _options;
        this._detectedMeshes = new Map();
        /**
         * Observers registered here will be executed when a new mesh was added to the session
         */
        this.onMeshAddedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will be executed when a mesh is no longer detected in the session
         */
        this.onMeshRemovedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Observers registered here will be executed when an existing mesh updates
         */
        this.onMeshUpdatedObservable = new Misc_observable/* Observable */.cP();
        this.xrNativeFeatureName = "mesh-detection";
        if (this._options.generateMeshes) {
            this._options.convertCoordinateSystems = true;
        }
        if (this._xrSessionManager.session) {
            this._init();
        }
        else {
            this._xrSessionManager.onXRSessionInit.addOnce(() => {
                this._init();
            });
        }
    }
    detach() {
        if (!super.detach()) {
            return false;
        }
        // Only supported by BabylonNative
        if (!!this._xrSessionManager.isNative && !!this._xrSessionManager.session.trySetMeshDetectorEnabled) {
            this._xrSessionManager.session.trySetMeshDetectorEnabled(false);
        }
        if (!this._options.doNotRemoveMeshesOnSessionEnded) {
            this._detectedMeshes.forEach((mesh) => {
                this.onMeshRemovedObservable.notifyObservers(mesh);
            });
            this._detectedMeshes.clear();
        }
        return true;
    }
    dispose() {
        super.dispose();
        this.onMeshAddedObservable.clear();
        this.onMeshRemovedObservable.clear();
        this.onMeshUpdatedObservable.clear();
    }
    _onXRFrame(frame) {
        // TODO remove try catch
        try {
            if (!this.attached || !frame) {
                return;
            }
            // babylon native XR and webxr support
            const detectedMeshes = frame.detectedMeshes || frame.worldInformation?.detectedMeshes;
            if (detectedMeshes) {
                const toRemove = new Set();
                this._detectedMeshes.forEach((vertexData, xrMesh) => {
                    if (!detectedMeshes.has(xrMesh)) {
                        toRemove.add(xrMesh);
                    }
                });
                toRemove.forEach((xrMesh) => {
                    const vertexData = this._detectedMeshes.get(xrMesh);
                    if (vertexData) {
                        this.onMeshRemovedObservable.notifyObservers(vertexData);
                        this._detectedMeshes.delete(xrMesh);
                    }
                });
                // now check for new ones
                detectedMeshes.forEach((xrMesh) => {
                    if (!this._detectedMeshes.has(xrMesh)) {
                        const partialVertexData = {
                            id: meshIdProvider++,
                            xrMesh: xrMesh,
                        };
                        const vertexData = this._updateVertexDataWithXRMesh(xrMesh, partialVertexData, frame);
                        this._detectedMeshes.set(xrMesh, vertexData);
                        this.onMeshAddedObservable.notifyObservers(vertexData);
                    }
                    else {
                        // updated?
                        if (xrMesh.lastChangedTime === this._xrSessionManager.currentTimestamp) {
                            const vertexData = this._detectedMeshes.get(xrMesh);
                            if (vertexData) {
                                this._updateVertexDataWithXRMesh(xrMesh, vertexData, frame);
                                this.onMeshUpdatedObservable.notifyObservers(vertexData);
                            }
                        }
                    }
                });
            }
        }
        catch (error) {
            logger/* Logger */.V.Log(error.stack);
        }
    }
    _init() {
        // Only supported by BabylonNative
        if (this._xrSessionManager.isNative) {
            if (this._xrSessionManager.session.trySetMeshDetectorEnabled) {
                this._xrSessionManager.session.trySetMeshDetectorEnabled(true);
            }
            if (!!this._options.preferredDetectorOptions && !!this._xrSessionManager.session.trySetPreferredMeshDetectorOptions) {
                this._xrSessionManager.session.trySetPreferredMeshDetectorOptions(this._options.preferredDetectorOptions);
            }
        }
    }
    _updateVertexDataWithXRMesh(xrMesh, mesh, xrFrame) {
        mesh.xrMesh = xrMesh;
        mesh.worldParentNode = this._options.worldParentNode;
        const positions = xrMesh.vertices || xrMesh.positions;
        if (this._options.convertCoordinateSystems) {
            if (!this._xrSessionManager.scene.useRightHandedSystem) {
                mesh.positions = new Float32Array(positions.length);
                for (let i = 0; i < positions.length; i += 3) {
                    mesh.positions[i] = positions[i];
                    mesh.positions[i + 1] = positions[i + 1];
                    mesh.positions[i + 2] = -1 * positions[i + 2];
                }
                if (xrMesh.normals) {
                    mesh.normals = new Float32Array(xrMesh.normals.length);
                    for (let i = 0; i < xrMesh.normals.length; i += 3) {
                        mesh.normals[i] = xrMesh.normals[i];
                        mesh.normals[i + 1] = xrMesh.normals[i + 1];
                        mesh.normals[i + 2] = -1 * xrMesh.normals[i + 2];
                    }
                }
            }
            else {
                mesh.positions = positions;
                mesh.normals = xrMesh.normals;
            }
            // WebXR should provide indices in a counterclockwise winding order regardless of coordinate system handedness
            mesh.indices = xrMesh.indices;
            // matrix
            const pose = xrFrame.getPose(xrMesh.meshSpace, this._xrSessionManager.referenceSpace);
            if (pose) {
                const mat = mesh.transformationMatrix || new math/* Matrix */.uq();
                math/* Matrix */.uq.FromArrayToRef(pose.transform.matrix, 0, mat);
                if (!this._xrSessionManager.scene.useRightHandedSystem) {
                    mat.toggleModelMatrixHandInPlace();
                }
                mesh.transformationMatrix = mat;
                if (this._options.worldParentNode) {
                    mat.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), mat);
                }
            }
            if (this._options.generateMeshes) {
                if (!mesh.mesh) {
                    const generatedMesh = new Meshes_mesh/* Mesh */.e("xr mesh " + mesh.id, this._xrSessionManager.scene);
                    generatedMesh.rotationQuaternion = new math/* Quaternion */.PT();
                    generatedMesh.setVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, mesh.positions);
                    if (mesh.normals) {
                        generatedMesh.setVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind, mesh.normals);
                    }
                    else {
                        generatedMesh.createNormals(true);
                    }
                    generatedMesh.setIndices(mesh.indices, undefined, true);
                    mesh.mesh = generatedMesh;
                }
                else {
                    const generatedMesh = mesh.mesh;
                    generatedMesh.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.PositionKind, mesh.positions);
                    if (mesh.normals) {
                        generatedMesh.updateVerticesData(Buffers_buffer/* VertexBuffer */.R.NormalKind, mesh.normals);
                    }
                    else {
                        generatedMesh.createNormals(true);
                    }
                    generatedMesh.updateIndices(mesh.indices);
                }
                mesh.transformationMatrix?.decompose(mesh.mesh.scaling, mesh.mesh.rotationQuaternion, mesh.mesh.position);
            }
        }
        return mesh;
    }
}
/**
 * The module's name
 */
WebXRMeshDetector.Name = webXRFeaturesManager/* WebXRFeatureName */._.MESH_DETECTION;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRMeshDetector.Version = 1;
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRMeshDetector.Name, (xrSessionManager, options) => {
    return () => new WebXRMeshDetector(xrSessionManager, options);
}, WebXRMeshDetector.Version, false);
//# sourceMappingURL=WebXRMeshDetector.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRImageTracking.js





/**
 * Enum that describes the state of the image trackability score status for this session.
 */
var ImageTrackingScoreStatus;
(function (ImageTrackingScoreStatus) {
    // AR Session has not yet assessed image trackability scores.
    ImageTrackingScoreStatus[ImageTrackingScoreStatus["NotReceived"] = 0] = "NotReceived";
    // A request to retrieve trackability scores has been sent, but no response has been received.
    ImageTrackingScoreStatus[ImageTrackingScoreStatus["Waiting"] = 1] = "Waiting";
    // Image trackability scores have been received for this session
    ImageTrackingScoreStatus[ImageTrackingScoreStatus["Received"] = 2] = "Received";
})(ImageTrackingScoreStatus || (ImageTrackingScoreStatus = {}));
/**
 * Image tracking for immersive AR sessions.
 * Providing a list of images and their estimated widths will enable tracking those images in the real world.
 */
class WebXRImageTracking extends WebXRAbstractFeature {
    /**
     * constructs the image tracking feature
     * @param _xrSessionManager the session manager for this module
     * @param options read-only options to be used in this module
     */
    constructor(_xrSessionManager, 
    /**
     * read-only options to be used in this module
     */
    options) {
        super(_xrSessionManager);
        this.options = options;
        /**
         * This will be triggered if the underlying system deems an image untrackable.
         * The index is the index of the image from the array used to initialize the feature.
         */
        this.onUntrackableImageFoundObservable = new Misc_observable/* Observable */.cP();
        /**
         * An image was deemed trackable, and the system will start tracking it.
         */
        this.onTrackableImageFoundObservable = new Misc_observable/* Observable */.cP();
        /**
         * The image was found and its state was updated.
         */
        this.onTrackedImageUpdatedObservable = new Misc_observable/* Observable */.cP();
        this._trackableScoreStatus = ImageTrackingScoreStatus.NotReceived;
        this._trackedImages = [];
        this.xrNativeFeatureName = "image-tracking";
    }
    /**
     * attach this feature
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    attach() {
        return super.attach();
    }
    /**
     * detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        return super.detach();
    }
    /**
     * Get a tracked image by its ID.
     *
     * @param id the id of the image to load (position in the init array)
     * @returns a trackable image, if exists in this location
     */
    getTrackedImageById(id) {
        return this._trackedImages[id] || null;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        super.dispose();
        this._trackedImages.forEach((trackedImage) => {
            trackedImage.originalBitmap.close();
        });
        this._trackedImages.length = 0;
        this.onTrackableImageFoundObservable.clear();
        this.onUntrackableImageFoundObservable.clear();
        this.onTrackedImageUpdatedObservable.clear();
    }
    /**
     * Extends the session init object if needed
     * @returns augmentation object fo the xr session init object.
     */
    async getXRSessionInitExtension() {
        if (!this.options.images || !this.options.images.length) {
            return {};
        }
        const promises = this.options.images.map((image) => {
            if (typeof image.src === "string") {
                return this._xrSessionManager.scene.getEngine()._createImageBitmapFromSource(image.src);
            }
            else {
                return Promise.resolve(image.src); // resolve is probably unneeded
            }
        });
        try {
            const images = await Promise.all(promises);
            this._originalTrackingRequest = images.map((image, idx) => {
                return {
                    image,
                    widthInMeters: this.options.images[idx].estimatedRealWorldWidth,
                };
            });
            return {
                trackedImages: this._originalTrackingRequest,
            };
        }
        catch (ex) {
            tools/* Tools */.S0.Error("Error loading images for tracking, WebXRImageTracking disabled for this session.");
            return {};
        }
    }
    _onXRFrame(_xrFrame) {
        if (!_xrFrame.getImageTrackingResults || this._trackableScoreStatus === ImageTrackingScoreStatus.Waiting) {
            return;
        }
        // Image tracking scores may be generated a few frames after the XR Session initializes.
        // If we haven't received scores yet, then kick off the task to check scores and return immediately.
        if (this._trackableScoreStatus === ImageTrackingScoreStatus.NotReceived) {
            this._checkScoresAsync();
            return;
        }
        const imageTrackedResults = _xrFrame.getImageTrackingResults();
        for (const result of imageTrackedResults) {
            let changed = false;
            const imageIndex = result.index;
            const imageObject = this._trackedImages[imageIndex];
            if (!imageObject) {
                // something went wrong!
                continue;
            }
            imageObject.xrTrackingResult = result;
            if (imageObject.realWorldWidth !== result.measuredWidthInMeters) {
                imageObject.realWorldWidth = result.measuredWidthInMeters;
                changed = true;
            }
            // Get the pose of the image relative to a reference space.
            const pose = _xrFrame.getPose(result.imageSpace, this._xrSessionManager.referenceSpace);
            if (pose) {
                const mat = imageObject.transformationMatrix;
                math_vector/* Matrix */.uq.FromArrayToRef(pose.transform.matrix, 0, mat);
                if (!this._xrSessionManager.scene.useRightHandedSystem) {
                    mat.toggleModelMatrixHandInPlace();
                }
                changed = true;
            }
            const state = result.trackingState;
            const emulated = state === "emulated";
            if (imageObject.emulated !== emulated) {
                imageObject.emulated = emulated;
                changed = true;
            }
            if (changed) {
                this.onTrackedImageUpdatedObservable.notifyObservers(imageObject);
            }
        }
    }
    async _checkScoresAsync() {
        if (!this._xrSessionManager.session.getTrackedImageScores || this._trackableScoreStatus !== ImageTrackingScoreStatus.NotReceived) {
            return;
        }
        this._trackableScoreStatus = ImageTrackingScoreStatus.Waiting;
        const imageScores = await this._xrSessionManager.session.getTrackedImageScores();
        if (!imageScores || imageScores.length === 0) {
            this._trackableScoreStatus = ImageTrackingScoreStatus.NotReceived;
            return;
        }
        // check the scores for all
        for (let idx = 0; idx < imageScores.length; ++idx) {
            if (imageScores[idx] == "untrackable") {
                this.onUntrackableImageFoundObservable.notifyObservers(idx);
            }
            else {
                const originalBitmap = this._originalTrackingRequest[idx].image;
                const imageObject = {
                    id: idx,
                    originalBitmap,
                    transformationMatrix: new math_vector/* Matrix */.uq(),
                    ratio: originalBitmap.width / originalBitmap.height,
                };
                this._trackedImages[idx] = imageObject;
                this.onTrackableImageFoundObservable.notifyObservers(imageObject);
            }
        }
        this._trackableScoreStatus = imageScores.length > 0 ? ImageTrackingScoreStatus.Received : ImageTrackingScoreStatus.NotReceived;
    }
}
/**
 * The module's name
 */
WebXRImageTracking.Name = webXRFeaturesManager/* WebXRFeatureName */._.IMAGE_TRACKING;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRImageTracking.Version = 1;
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRImageTracking.Name, (xrSessionManager, options) => {
    return () => new WebXRImageTracking(xrSessionManager, options);
}, WebXRImageTracking.Version, false);
//# sourceMappingURL=WebXRImageTracking.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRDOMOverlay.js



/**
 * DOM Overlay Feature
 *
 * @since 5.0.0
 */
class WebXRDomOverlay extends WebXRAbstractFeature {
    /**
     * Creates a new instance of the dom-overlay feature
     * @param _xrSessionManager an instance of WebXRSessionManager
     * @param options options to use when constructing this feature
     */
    constructor(_xrSessionManager, 
    /**
     * options to use when constructing this feature
     */
    options) {
        super(_xrSessionManager);
        this.options = options;
        /**
         * Type of overlay - non-null when available
         */
        this._domOverlayType = null;
        /**
         * Event Listener to supress "beforexrselect" events.
         */
        this._beforeXRSelectListener = null;
        /**
         * Element used for overlay
         */
        this._element = null;
        this.xrNativeFeatureName = "dom-overlay";
        // https://immersive-web.github.io/dom-overlays/
        tools/* Tools */.S0.Warn("dom-overlay is an experimental and unstable feature.");
    }
    /**
     * attach this feature
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        // Feature not available
        if (!this._xrSessionManager.session.domOverlayState || this._xrSessionManager.session.domOverlayState.type === null) {
            return false;
        }
        this._domOverlayType = this._xrSessionManager.session.domOverlayState.type;
        if (this._element !== null && this.options.supressXRSelectEvents === true) {
            this._beforeXRSelectListener = (ev) => {
                ev.preventDefault();
            };
            this._element.addEventListener("beforexrselect", this._beforeXRSelectListener);
        }
        return true;
    }
    /**
     * The type of DOM overlay (null when not supported).  Provided by UA and remains unchanged for duration of session.
     */
    get domOverlayType() {
        return this._domOverlayType;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        super.dispose();
        if (this._element !== null && this._beforeXRSelectListener) {
            this._element.removeEventListener("beforexrselect", this._beforeXRSelectListener);
        }
    }
    _onXRFrame(_xrFrame) {
        /* empty */
    }
    /**
     * Extends the session init object if needed
     * @returns augmentation object for the xr session init object.
     */
    async getXRSessionInitExtension() {
        if (this.options.element === undefined) {
            tools/* Tools */.S0.Warn('"element" option must be provided to attach xr-dom-overlay feature.');
            return {};
        }
        else if (typeof this.options.element === "string") {
            const selectedElement = document.querySelector(this.options.element);
            if (selectedElement === null) {
                tools/* Tools */.S0.Warn(`element not found '${this.options.element}' (not requesting xr-dom-overlay)`);
                return {};
            }
            this._element = selectedElement;
        }
        else {
            this._element = this.options.element;
        }
        return {
            domOverlay: {
                root: this._element,
            },
        };
    }
}
/**
 * The module's name
 */
WebXRDomOverlay.Name = webXRFeaturesManager/* WebXRFeatureName */._.DOM_OVERLAY;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRDomOverlay.Version = 1;
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRDomOverlay.Name, (xrSessionManager, options) => {
    return () => new WebXRDomOverlay(xrSessionManager, options);
}, WebXRDomOverlay.Version, false);
//# sourceMappingURL=WebXRDOMOverlay.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRControllerMovement.js





/**
 * This is a movement feature to be used with WebXR-enabled motion controllers.
 * When enabled and attached, the feature will allow a user to move around and rotate in the scene using
 * the input of the attached controllers.
 */
class WebXRControllerMovement extends WebXRAbstractFeature {
    /**
     * Current movement direction.  Will be null before XR Frames have been processed.
     */
    get movementDirection() {
        return this._movementDirection;
    }
    /**
     * Is movement enabled
     */
    get movementEnabled() {
        return this._featureContext.movementEnabled;
    }
    /**
     * Sets whether movement is enabled or not
     * @param enabled is movement enabled
     */
    set movementEnabled(enabled) {
        this._featureContext.movementEnabled = enabled;
    }
    /**
     * If movement follows viewer pose
     */
    get movementOrientationFollowsViewerPose() {
        return this._featureContext.movementOrientationFollowsViewerPose;
    }
    /**
     * Sets whether movement follows viewer pose
     * @param followsPose is movement should follow viewer pose
     */
    set movementOrientationFollowsViewerPose(followsPose) {
        this._featureContext.movementOrientationFollowsViewerPose = followsPose;
    }
    /**
     * Gets movement speed
     */
    get movementSpeed() {
        return this._featureContext.movementSpeed;
    }
    /**
     * Sets movement speed
     * @param movementSpeed movement speed
     */
    set movementSpeed(movementSpeed) {
        this._featureContext.movementSpeed = movementSpeed;
    }
    /**
     * Gets minimum threshold the controller's thumbstick/touchpad must pass before being recognized for movement (avoids jitter/unintentional movement)
     */
    get movementThreshold() {
        return this._featureContext.movementThreshold;
    }
    /**
     * Sets minimum threshold the controller's thumbstick/touchpad must pass before being recognized for movement (avoids jitter/unintentional movement)
     * @param movementThreshold new threshold
     */
    set movementThreshold(movementThreshold) {
        this._featureContext.movementThreshold = movementThreshold;
    }
    /**
     * Is rotation enabled
     */
    get rotationEnabled() {
        return this._featureContext.rotationEnabled;
    }
    /**
     * Sets whether rotation is enabled or not
     * @param enabled is rotation enabled
     */
    set rotationEnabled(enabled) {
        this._featureContext.rotationEnabled = enabled;
    }
    /**
     * Gets rotation speed factor
     */
    get rotationSpeed() {
        return this._featureContext.rotationSpeed;
    }
    /**
     * Sets rotation speed factor (1.0 is default)
     * @param rotationSpeed new rotation speed factor
     */
    set rotationSpeed(rotationSpeed) {
        this._featureContext.rotationSpeed = rotationSpeed;
    }
    /**
     * Gets minimum threshold the controller's thumbstick/touchpad must pass before being recognized for rotation (avoids jitter/unintentional rotation)
     */
    get rotationThreshold() {
        return this._featureContext.rotationThreshold;
    }
    /**
     * Sets minimum threshold the controller's thumbstick/touchpad must pass before being recognized for rotation (avoids jitter/unintentional rotation)
     * @param threshold new threshold
     */
    set rotationThreshold(threshold) {
        this._featureContext.rotationThreshold = threshold;
    }
    /**
     * constructs a new movement controller system
     * @param _xrSessionManager an instance of WebXRSessionManager
     * @param options configuration object for this feature
     */
    constructor(_xrSessionManager, options) {
        super(_xrSessionManager);
        this._controllers = {};
        this._currentRegistrationConfigurations = [];
        // forward direction for movement, which may differ from viewer pose.
        this._movementDirection = new math_vector/* Quaternion */.PT();
        // unused
        this._tmpRotationMatrix = math_vector/* Matrix */.uq.Identity();
        this._tmpTranslationDirection = new math_vector/* Vector3 */.Pq();
        this._tmpMovementTranslation = new math_vector/* Vector3 */.Pq();
        this._tempCacheQuaternion = new math_vector/* Quaternion */.PT();
        this._attachController = (xrController) => {
            if (this._controllers[xrController.uniqueId]) {
                // already attached
                return;
            }
            this._controllers[xrController.uniqueId] = {
                xrController,
                registeredComponents: [],
            };
            const controllerData = this._controllers[xrController.uniqueId];
            // movement controller only available to gamepad-enabled input sources.
            if (controllerData.xrController.inputSource.targetRayMode === "tracked-pointer" && controllerData.xrController.inputSource.gamepad) {
                // motion controller support
                const initController = () => {
                    if (xrController.motionController) {
                        for (const registration of this._currentRegistrationConfigurations) {
                            let component = null;
                            if (registration.allowedComponentTypes) {
                                for (const componentType of registration.allowedComponentTypes) {
                                    const componentOfType = xrController.motionController.getComponentOfType(componentType);
                                    if (componentOfType !== null) {
                                        component = componentOfType;
                                        break;
                                    }
                                }
                            }
                            if (registration.mainComponentOnly) {
                                const mainComponent = xrController.motionController.getMainComponent();
                                if (mainComponent === null) {
                                    continue;
                                }
                                component = mainComponent;
                            }
                            if (typeof registration.componentSelectionPredicate === "function") {
                                // if does not match we do want to ignore a previously found component
                                component = registration.componentSelectionPredicate(xrController);
                            }
                            if (component && registration.forceHandedness) {
                                if (xrController.inputSource.handedness !== registration.forceHandedness) {
                                    continue; // do not register
                                }
                            }
                            if (component === null) {
                                continue; // do not register
                            }
                            const registeredComponent = {
                                registrationConfiguration: registration,
                                component,
                            };
                            controllerData.registeredComponents.push(registeredComponent);
                            if ("axisChangedHandler" in registration) {
                                registeredComponent.onAxisChangedObserver = component.onAxisValueChangedObservable.add((axesData) => {
                                    registration.axisChangedHandler(axesData, this._movementState, this._featureContext, this._xrInput);
                                });
                            }
                            if ("buttonChangedHandler" in registration) {
                                registeredComponent.onButtonChangedObserver = component.onButtonStateChangedObservable.add((component) => {
                                    if (component.changes.pressed) {
                                        registration.buttonChangedHandler(component.changes.pressed, this._movementState, this._featureContext, this._xrInput);
                                    }
                                });
                            }
                        }
                    }
                };
                if (xrController.motionController) {
                    initController();
                }
                else {
                    xrController.onMotionControllerInitObservable.addOnce(() => {
                        initController();
                    });
                }
            }
        };
        if (!options || options.xrInput === undefined) {
            tools/* Tools */.S0.Error('WebXRControllerMovement feature requires "xrInput" option.');
            return;
        }
        if (Array.isArray(options.customRegistrationConfigurations)) {
            this._currentRegistrationConfigurations = options.customRegistrationConfigurations;
        }
        else {
            this._currentRegistrationConfigurations = WebXRControllerMovement.REGISTRATIONS.default;
        }
        // synchronized from feature setter properties
        this._featureContext = {
            movementEnabled: options.movementEnabled || true,
            movementOrientationFollowsViewerPose: options.movementOrientationFollowsViewerPose ?? true,
            movementOrientationFollowsController: options.movementOrientationFollowsController ?? false,
            orientationPreferredHandedness: options.orientationPreferredHandedness,
            movementSpeed: options.movementSpeed ?? 1,
            movementThreshold: options.movementThreshold ?? 0.25,
            rotationEnabled: options.rotationEnabled ?? true,
            rotationSpeed: options.rotationSpeed ?? 1.0,
            rotationThreshold: options.rotationThreshold ?? 0.25,
        };
        this._movementState = {
            moveX: 0,
            moveY: 0,
            rotateX: 0,
            rotateY: 0,
        };
        this._xrInput = options.xrInput;
    }
    attach() {
        if (!super.attach()) {
            return false;
        }
        this._xrInput.controllers.forEach(this._attachController);
        this._addNewAttachObserver(this._xrInput.onControllerAddedObservable, this._attachController);
        this._addNewAttachObserver(this._xrInput.onControllerRemovedObservable, (controller) => {
            // REMOVE the controller
            this._detachController(controller.uniqueId);
        });
        return true;
    }
    detach() {
        if (!super.detach()) {
            return false;
        }
        Object.keys(this._controllers).forEach((controllerId) => {
            this._detachController(controllerId);
        });
        this._controllers = {};
        return true;
    }
    /**
     * Occurs on every XR frame.
     * @param _xrFrame
     */
    _onXRFrame(_xrFrame) {
        if (!this.attached) {
            return;
        }
        if (this._movementState.rotateX !== 0 && this._featureContext.rotationEnabled) {
            // smooth rotation
            const deltaMillis = this._xrSessionManager.scene.getEngine().getDeltaTime();
            const rotationY = deltaMillis * 0.001 * this._featureContext.rotationSpeed * this._movementState.rotateX * (this._xrSessionManager.scene.useRightHandedSystem ? -1 : 1);
            if (this._featureContext.movementOrientationFollowsViewerPose) {
                this._xrInput.xrCamera.cameraRotation.y += rotationY;
                math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(rotationY, 0, 0, this._tempCacheQuaternion);
                this._xrInput.xrCamera.rotationQuaternion.multiplyToRef(this._tempCacheQuaternion, this._movementDirection);
            }
            else if (this._featureContext.movementOrientationFollowsController) {
                this._xrInput.xrCamera.cameraRotation.y += rotationY;
                // get the correct controller
                const handedness = this._featureContext.orientationPreferredHandedness || "right";
                const key = Object.keys(this._controllers).find((key) => this._controllers[key]?.xrController?.inputSource.handedness === handedness) || Object.keys(this._controllers)[0];
                const controller = this._controllers[key];
                math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(rotationY, 0, 0, this._tempCacheQuaternion);
                (controller?.xrController.pointer.rotationQuaternion || math_vector/* Quaternion */.PT.Identity()).multiplyToRef(this._tempCacheQuaternion, this._movementDirection);
            }
            else {
                // movement orientation direction does not affect camera.  We use rotation speed multiplier
                // otherwise need to implement inertia and constraints for same feel as TargetCamera.
                math_vector/* Quaternion */.PT.RotationYawPitchRollToRef(rotationY * 3.0, 0, 0, this._tempCacheQuaternion);
                this._movementDirection.multiplyInPlace(this._tempCacheQuaternion);
            }
        }
        else if (this._featureContext.movementOrientationFollowsViewerPose) {
            this._movementDirection.copyFrom(this._xrInput.xrCamera.rotationQuaternion);
        }
        else if (this._featureContext.movementOrientationFollowsController) {
            // get the correct controller
            const handedness = this._featureContext.orientationPreferredHandedness || "right";
            const key = Object.keys(this._controllers).find((key) => this._controllers[key]?.xrController.inputSource.handedness === handedness) || Object.keys(this._controllers)[0];
            const controller = this._controllers[key];
            this._movementDirection.copyFrom(controller?.xrController.pointer.rotationQuaternion || math_vector/* Quaternion */.PT.Identity());
        }
        if ((this._movementState.moveX || this._movementState.moveY) && this._featureContext.movementEnabled) {
            math_vector/* Matrix */.uq.FromQuaternionToRef(this._movementDirection, this._tmpRotationMatrix);
            this._tmpTranslationDirection.set(this._movementState.moveX, 0, this._movementState.moveY * (this._xrSessionManager.scene.useRightHandedSystem ? 1.0 : -1.0));
            // move according to forward direction based on camera speed
            math_vector/* Vector3 */.Pq.TransformCoordinatesToRef(this._tmpTranslationDirection, this._tmpRotationMatrix, this._tmpMovementTranslation);
            this._tmpMovementTranslation.scaleInPlace(this._xrInput.xrCamera._computeLocalCameraSpeed() * this._featureContext.movementSpeed);
            this._xrInput.xrCamera.cameraDirection.addInPlace(this._tmpMovementTranslation);
        }
    }
    _detachController(xrControllerUniqueId) {
        const controllerData = this._controllers[xrControllerUniqueId];
        if (!controllerData) {
            return;
        }
        for (const registeredComponent of controllerData.registeredComponents) {
            if (registeredComponent.onAxisChangedObserver) {
                registeredComponent.component.onAxisValueChangedObservable.remove(registeredComponent.onAxisChangedObserver);
            }
            if (registeredComponent.onButtonChangedObserver) {
                registeredComponent.component.onButtonStateChangedObservable.remove(registeredComponent.onButtonChangedObserver);
            }
        }
        // remove from the map
        delete this._controllers[xrControllerUniqueId];
    }
}
/**
 * The module's name
 */
WebXRControllerMovement.Name = webXRFeaturesManager/* WebXRFeatureName */._.MOVEMENT;
/**
 * Standard controller configurations.
 */
WebXRControllerMovement.REGISTRATIONS = {
    default: [
        {
            allowedComponentTypes: [WebXRControllerComponent.THUMBSTICK_TYPE, WebXRControllerComponent.TOUCHPAD_TYPE],
            forceHandedness: "left",
            axisChangedHandler: (axes, movementState, featureContext) => {
                movementState.rotateX = Math.abs(axes.x) > featureContext.rotationThreshold ? axes.x : 0;
                movementState.rotateY = Math.abs(axes.y) > featureContext.rotationThreshold ? axes.y : 0;
            },
        },
        {
            allowedComponentTypes: [WebXRControllerComponent.THUMBSTICK_TYPE, WebXRControllerComponent.TOUCHPAD_TYPE],
            forceHandedness: "right",
            axisChangedHandler: (axes, movementState, featureContext) => {
                movementState.moveX = Math.abs(axes.x) > featureContext.movementThreshold ? axes.x : 0;
                movementState.moveY = Math.abs(axes.y) > featureContext.movementThreshold ? axes.y : 0;
            },
        },
    ],
};
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the webxr specs version
 */
WebXRControllerMovement.Version = 1;
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRControllerMovement.Name, (xrSessionManager, options) => {
    return () => new WebXRControllerMovement(xrSessionManager, options);
}, WebXRControllerMovement.Version, true);
//# sourceMappingURL=WebXRControllerMovement.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/lightConstants.js
var lightConstants = __webpack_require__(75515);
;// ./node_modules/@babylonjs/core/XR/features/WebXRLightEstimation.js














/**
 * Light Estimation Feature
 *
 * @since 5.0.0
 */
class WebXRLightEstimation extends WebXRAbstractFeature {
    /**
     * Creates a new instance of the light estimation feature
     * @param _xrSessionManager an instance of WebXRSessionManager
     * @param options options to use when constructing this feature
     */
    constructor(_xrSessionManager, 
    /**
     * options to use when constructing this feature
     */
    options) {
        super(_xrSessionManager);
        this.options = options;
        this._canvasContext = null;
        this._reflectionCubeMap = null;
        this._xrLightEstimate = null;
        this._xrLightProbe = null;
        this._xrWebGLBinding = null;
        this._lightDirection = math_vector/* Vector3 */.Pq.Up().negateInPlace();
        this._lightColor = math_color/* Color3 */.v9.White();
        this._intensity = 1;
        this._sphericalHarmonics = new sphericalPolynomial/* SphericalHarmonics */.O();
        this._cubeMapPollTime = Date.now();
        this._lightEstimationPollTime = Date.now();
        /**
         * ARCore's reflection cube map size is 16x16.
         * Once other systems support this feature we will need to change this to be dynamic.
         * see https://github.com/immersive-web/lighting-estimation/blob/main/lighting-estimation-explainer.md#cube-map-open-questions
         */
        this._reflectionCubeMapTextureSize = 16;
        /**
         * If createDirectionalLightSource is set to true this light source will be created automatically.
         * Otherwise this can be set with an external directional light source.
         * This light will be updated whenever the light estimation values change.
         */
        this.directionalLight = null;
        /**
         * This observable will notify when the reflection cube map is updated.
         */
        this.onReflectionCubeMapUpdatedObservable = new Misc_observable/* Observable */.cP();
        /**
         * Event Listener for "reflectionchange" events.
         */
        this._updateReflectionCubeMap = () => {
            if (!this._xrLightProbe) {
                return;
            }
            // check poll time, do not update if it has not been long enough
            if (this.options.cubeMapPollInterval) {
                const now = Date.now();
                if (now - this._cubeMapPollTime < this.options.cubeMapPollInterval) {
                    return;
                }
                this._cubeMapPollTime = now;
            }
            const lp = this._getXRGLBinding().getReflectionCubeMap(this._xrLightProbe);
            if (lp && this._reflectionCubeMap) {
                if (!this._reflectionCubeMap._texture) {
                    const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(this._xrSessionManager.scene.getEngine(), 0 /* InternalTextureSource.Unknown */);
                    internalTexture.isCube = true;
                    internalTexture.invertY = false;
                    internalTexture._useSRGBBuffer = this.options.reflectionFormat === "srgba8";
                    internalTexture.format = 5;
                    internalTexture.generateMipMaps = true;
                    internalTexture.type = this.options.reflectionFormat !== "srgba8" ? 2 : 0;
                    internalTexture.samplingMode = 3;
                    internalTexture.width = this._reflectionCubeMapTextureSize;
                    internalTexture.height = this._reflectionCubeMapTextureSize;
                    internalTexture._cachedWrapU = 1;
                    internalTexture._cachedWrapV = 1;
                    internalTexture._hardwareTexture = new webGLHardwareTexture/* WebGLHardwareTexture */.d(lp, this._getCanvasContext());
                    this._reflectionCubeMap._texture = internalTexture;
                }
                else {
                    this._reflectionCubeMap._texture._hardwareTexture?.set(lp);
                    this._reflectionCubeMap._texture.getEngine().resetTextureCache();
                }
                this._reflectionCubeMap._texture.isReady = true;
                if (!this.options.disablePreFiltering) {
                    this._xrLightProbe.removeEventListener("reflectionchange", this._updateReflectionCubeMap);
                    this._hdrFilter.prefilter(this._reflectionCubeMap).then(() => {
                        this._xrSessionManager.scene.markAllMaterialsAsDirty(1);
                        this.onReflectionCubeMapUpdatedObservable.notifyObservers(this._reflectionCubeMap);
                        this._xrLightProbe.addEventListener("reflectionchange", this._updateReflectionCubeMap);
                    });
                }
                else {
                    this._xrSessionManager.scene.markAllMaterialsAsDirty(1);
                    this.onReflectionCubeMapUpdatedObservable.notifyObservers(this._reflectionCubeMap);
                }
            }
        };
        this.xrNativeFeatureName = "light-estimation";
        if (this.options.createDirectionalLightSource) {
            this.directionalLight = new directionalLight/* DirectionalLight */.Z("light estimation directional", this._lightDirection, this._xrSessionManager.scene);
            this.directionalLight.position = new math_vector/* Vector3 */.Pq(0, 8, 0);
            // intensity will be set later
            this.directionalLight.intensity = 0;
            this.directionalLight.falloffType = lightConstants/* LightConstants */.c.FALLOFF_GLTF;
        }
        this._hdrFilter = new HDRFiltering(this._xrSessionManager.scene.getEngine());
        // https://immersive-web.github.io/lighting-estimation/
        tools/* Tools */.S0.Warn("light-estimation is an experimental and unstable feature.");
    }
    /**
     * While the estimated cube map is expected to update over time to better reflect the user's environment as they move around those changes are unlikely to happen with every XRFrame.
     * Since creating and processing the cube map is potentially expensive, especially if mip maps are needed, you can listen to the onReflectionCubeMapUpdatedObservable to determine
     * when it has been updated.
     */
    get reflectionCubeMapTexture() {
        return this._reflectionCubeMap;
    }
    /**
     * The most recent light estimate.  Available starting on the first frame where the device provides a light probe.
     */
    get xrLightingEstimate() {
        if (this._xrLightEstimate) {
            return {
                lightColor: this._lightColor,
                lightDirection: this._lightDirection,
                lightIntensity: this._intensity,
                sphericalHarmonics: this._sphericalHarmonics,
            };
        }
        return this._xrLightEstimate;
    }
    _getCanvasContext() {
        if (this._canvasContext === null) {
            this._canvasContext = this._xrSessionManager.scene.getEngine()._gl;
        }
        return this._canvasContext;
    }
    _getXRGLBinding() {
        if (this._xrWebGLBinding === null) {
            const context = this._getCanvasContext();
            this._xrWebGLBinding = new XRWebGLBinding(this._xrSessionManager.session, context);
        }
        return this._xrWebGLBinding;
    }
    /**
     * attach this feature
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        const reflectionFormat = this.options.reflectionFormat ?? (this._xrSessionManager.session.preferredReflectionFormat || "srgba8");
        this.options.reflectionFormat = reflectionFormat;
        this._xrSessionManager.session
            .requestLightProbe({
            reflectionFormat,
        })
            .then((xrLightProbe) => {
            this._xrLightProbe = xrLightProbe;
            if (!this.options.disableCubeMapReflection) {
                if (!this._reflectionCubeMap) {
                    this._reflectionCubeMap = new baseTexture/* BaseTexture */.t(this._xrSessionManager.scene);
                    this._reflectionCubeMap._isCube = true;
                    this._reflectionCubeMap.coordinatesMode = 3;
                    if (this.options.setSceneEnvironmentTexture) {
                        this._xrSessionManager.scene.environmentTexture = this._reflectionCubeMap;
                    }
                }
                this._xrLightProbe.addEventListener("reflectionchange", this._updateReflectionCubeMap);
            }
        });
        return true;
    }
    /**
     * detach this feature.
     * Will usually be called by the features manager
     *
     * @returns true if successful.
     */
    detach() {
        const detached = super.detach();
        if (this._xrLightProbe !== null && !this.options.disableCubeMapReflection) {
            this._xrLightProbe.removeEventListener("reflectionchange", this._updateReflectionCubeMap);
            this._xrLightProbe = null;
        }
        this._canvasContext = null;
        this._xrLightEstimate = null;
        // When the session ends (on detach) we must clear our XRWebGLBinging instance, which references the ended session.
        this._xrWebGLBinding = null;
        return detached;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        super.dispose();
        this.onReflectionCubeMapUpdatedObservable.clear();
        if (this.directionalLight) {
            this.directionalLight.dispose();
            this.directionalLight = null;
        }
        if (this._reflectionCubeMap !== null) {
            if (this._reflectionCubeMap._texture) {
                this._reflectionCubeMap._texture.dispose();
            }
            this._reflectionCubeMap.dispose();
            this._reflectionCubeMap = null;
        }
    }
    _onXRFrame(_xrFrame) {
        if (this._xrLightProbe !== null) {
            if (this.options.lightEstimationPollInterval) {
                const now = Date.now();
                if (now - this._lightEstimationPollTime < this.options.lightEstimationPollInterval) {
                    return;
                }
                this._lightEstimationPollTime = now;
            }
            this._xrLightEstimate = _xrFrame.getLightEstimate(this._xrLightProbe);
            if (this._xrLightEstimate) {
                this._intensity = Math.max(1.0, this._xrLightEstimate.primaryLightIntensity.x, this._xrLightEstimate.primaryLightIntensity.y, this._xrLightEstimate.primaryLightIntensity.z);
                const rhsFactor = this._xrSessionManager.scene.useRightHandedSystem ? 1.0 : -1.0;
                // recreate the vector caches, so that the last one provided to the user will persist
                if (this.options.disableVectorReuse) {
                    this._lightDirection = new math_vector/* Vector3 */.Pq();
                    this._lightColor = new math_color/* Color3 */.v9();
                    if (this.directionalLight) {
                        this.directionalLight.direction = this._lightDirection;
                        this.directionalLight.diffuse = this._lightColor;
                    }
                }
                this._lightDirection.copyFromFloats(this._xrLightEstimate.primaryLightDirection.x, this._xrLightEstimate.primaryLightDirection.y, this._xrLightEstimate.primaryLightDirection.z * rhsFactor);
                this._lightColor.copyFromFloats(this._xrLightEstimate.primaryLightIntensity.x / this._intensity, this._xrLightEstimate.primaryLightIntensity.y / this._intensity, this._xrLightEstimate.primaryLightIntensity.z / this._intensity);
                this._sphericalHarmonics.updateFromFloatsArray(this._xrLightEstimate.sphericalHarmonicsCoefficients);
                if (this._reflectionCubeMap && !this.options.disableSphericalPolynomial) {
                    this._reflectionCubeMap.sphericalPolynomial = this._reflectionCubeMap.sphericalPolynomial || new sphericalPolynomial/* SphericalPolynomial */.Q();
                    this._reflectionCubeMap.sphericalPolynomial?.updateFromHarmonics(this._sphericalHarmonics);
                }
                // direction from instead of direction to
                this._lightDirection.negateInPlace();
                // set the values after calculating them
                if (this.directionalLight) {
                    this.directionalLight.direction.copyFrom(this._lightDirection);
                    this.directionalLight.intensity = Math.min(this._intensity, 1.0);
                    this.directionalLight.diffuse.copyFrom(this._lightColor);
                }
            }
        }
    }
}
/**
 * The module's name
 */
WebXRLightEstimation.Name = webXRFeaturesManager/* WebXRFeatureName */._.LIGHT_ESTIMATION;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRLightEstimation.Version = 1;
// register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRLightEstimation.Name, (xrSessionManager, options) => {
    return () => new WebXRLightEstimation(xrSessionManager, options);
}, WebXRLightEstimation.Version, false);
//# sourceMappingURL=WebXRLightEstimation.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXREyeTracking.js





/**
 * The WebXR Eye Tracking feature grabs eye data from the device and provides it in an easy-access format.
 * Currently only enabled for BabylonNative applications.
 */
class WebXREyeTracking extends WebXRAbstractFeature {
    /**
     * Creates a new instance of the XR eye tracking feature.
     * @param _xrSessionManager An instance of WebXRSessionManager.
     */
    constructor(_xrSessionManager) {
        super(_xrSessionManager);
        /**
         * This observable will notify registered observers when eye tracking starts
         */
        this.onEyeTrackingStartedObservable = new Misc_observable/* Observable */.cP();
        /**
         * This observable will notify registered observers when eye tracking ends
         */
        this.onEyeTrackingEndedObservable = new Misc_observable/* Observable */.cP();
        /**
         * This observable will notify registered observers on each frame that has valid tracking
         */
        this.onEyeTrackingFrameUpdateObservable = new Misc_observable/* Observable */.cP();
        this._eyeTrackingStartListener = (event) => {
            this._latestEyeSpace = event.gazeSpace;
            this._gazeRay = new Culling_ray/* Ray */.Rl(math_vector/* Vector3 */.Pq.Zero(), math_vector/* Vector3 */.Pq.Forward());
            this.onEyeTrackingStartedObservable.notifyObservers(this._gazeRay);
        };
        this._eyeTrackingEndListener = () => {
            this._latestEyeSpace = null;
            this._gazeRay = null;
            this.onEyeTrackingEndedObservable.notifyObservers();
        };
        this.xrNativeFeatureName = "eye-tracking";
        if (this._xrSessionManager.session) {
            this._init();
        }
        else {
            this._xrSessionManager.onXRSessionInit.addOnce(() => {
                this._init();
            });
        }
    }
    /**
     * Dispose this feature and all of the resources attached.
     */
    dispose() {
        super.dispose();
        this._xrSessionManager.session.removeEventListener("eyetrackingstart", this._eyeTrackingStartListener);
        this._xrSessionManager.session.removeEventListener("eyetrackingend", this._eyeTrackingEndListener);
        this.onEyeTrackingStartedObservable.clear();
        this.onEyeTrackingEndedObservable.clear();
        this.onEyeTrackingFrameUpdateObservable.clear();
    }
    /**
     * Returns whether the gaze data is valid or not
     * @returns true if the data is valid
     */
    get isEyeGazeValid() {
        return !!this._gazeRay;
    }
    /**
     * Get a reference to the gaze ray. This data is valid while eye tracking persists, and will be set to null when gaze data is no longer available
     * @returns a reference to the gaze ray if it exists and is valid, returns null otherwise.
     */
    getEyeGaze() {
        return this._gazeRay;
    }
    _onXRFrame(frame) {
        if (!this.attached || !frame) {
            return;
        }
        if (this._latestEyeSpace && this._gazeRay) {
            const pose = frame.getPose(this._latestEyeSpace, this._xrSessionManager.referenceSpace);
            if (pose) {
                this._gazeRay.origin.set(pose.transform.position.x, pose.transform.position.y, pose.transform.position.z).scaleInPlace(this._xrSessionManager.worldScalingFactor);
                const quat = pose.transform.orientation;
                math_vector/* TmpVectors */.AA.Quaternion[0].set(quat.x, quat.y, quat.z, quat.w);
                if (!this._xrSessionManager.scene.useRightHandedSystem) {
                    this._gazeRay.origin.z *= -1;
                    math_vector/* TmpVectors */.AA.Quaternion[0].z *= -1;
                    math_vector/* TmpVectors */.AA.Quaternion[0].w *= -1;
                    math_vector/* Vector3 */.Pq.LeftHandedForwardReadOnly.rotateByQuaternionToRef(math_vector/* TmpVectors */.AA.Quaternion[0], this._gazeRay.direction);
                }
                else {
                    math_vector/* Vector3 */.Pq.RightHandedForwardReadOnly.rotateByQuaternionToRef(math_vector/* TmpVectors */.AA.Quaternion[0], this._gazeRay.direction);
                }
                this.onEyeTrackingFrameUpdateObservable.notifyObservers(this._gazeRay);
            }
        }
    }
    _init() {
        // Only supported by BabylonNative
        if (this._xrSessionManager.isNative) {
            this._xrSessionManager.session.addEventListener("eyetrackingstart", this._eyeTrackingStartListener);
            this._xrSessionManager.session.addEventListener("eyetrackingend", this._eyeTrackingEndListener);
        }
    }
}
/**
 * The module's name
 */
WebXREyeTracking.Name = webXRFeaturesManager/* WebXRFeatureName */._.EYE_TRACKING;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXREyeTracking.Version = 1;
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXREyeTracking.Name, (xrSessionManager) => {
    return () => new WebXREyeTracking(xrSessionManager);
}, WebXREyeTracking.Version, false);
//# sourceMappingURL=WebXREyeTracking.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRWalkingLocomotion.js





class CircleBuffer {
    constructor(numSamples, initializer) {
        this._samples = [];
        this._idx = 0;
        for (let idx = 0; idx < numSamples; ++idx) {
            this._samples.push(initializer ? initializer() : math_vector/* Vector2 */.I9.Zero());
        }
    }
    get length() {
        return this._samples.length;
    }
    push(x, y) {
        this._idx = (this._idx + this._samples.length - 1) % this._samples.length;
        this.at(0).copyFromFloats(x, y);
    }
    at(idx) {
        if (idx >= this._samples.length) {
            throw new Error("Index out of bounds");
        }
        return this._samples[(this._idx + idx) % this._samples.length];
    }
}
class FirstStepDetector {
    constructor() {
        this._samples = new CircleBuffer(20);
        this._entropy = 0;
        this.onFirstStepDetected = new Misc_observable/* Observable */.cP();
    }
    update(posX, posY, forwardX, forwardY) {
        this._samples.push(posX, posY);
        const origin = this._samples.at(0);
        this._entropy *= this._entropyDecayFactor;
        this._entropy += math_vector/* Vector2 */.I9.Distance(origin, this._samples.at(1));
        if (this._entropy > this._entropyThreshold) {
            return;
        }
        let samePointIdx;
        for (samePointIdx = this._samePointCheckStartIdx; samePointIdx < this._samples.length; ++samePointIdx) {
            if (math_vector/* Vector2 */.I9.DistanceSquared(origin, this._samples.at(samePointIdx)) < this._samePointSquaredDistanceThreshold) {
                break;
            }
        }
        if (samePointIdx === this._samples.length) {
            return;
        }
        let apexDistSquared = -1;
        let apexIdx = 0;
        for (let distSquared, idx = 1; idx < samePointIdx; ++idx) {
            distSquared = math_vector/* Vector2 */.I9.DistanceSquared(origin, this._samples.at(idx));
            if (distSquared > apexDistSquared) {
                apexIdx = idx;
                apexDistSquared = distSquared;
            }
        }
        if (apexDistSquared < this._apexSquaredDistanceThreshold) {
            return;
        }
        const apex = this._samples.at(apexIdx);
        const axis = apex.subtract(origin);
        axis.normalize();
        const vec = math_vector/* TmpVectors */.AA.Vector2[0];
        let dot;
        let sample;
        let sumSquaredProjectionDistances = 0;
        for (let idx = 1; idx < samePointIdx; ++idx) {
            sample = this._samples.at(idx);
            sample.subtractToRef(origin, vec);
            dot = math_vector/* Vector2 */.I9.Dot(axis, vec);
            sumSquaredProjectionDistances += vec.lengthSquared() - dot * dot;
        }
        if (sumSquaredProjectionDistances > samePointIdx * this._squaredProjectionDistanceThreshold) {
            return;
        }
        const forwardVec = math_vector/* TmpVectors */.AA.Vector3[0];
        forwardVec.set(forwardX, forwardY, 0);
        const axisVec = math_vector/* TmpVectors */.AA.Vector3[1];
        axisVec.set(axis.x, axis.y, 0);
        const isApexLeft = math_vector/* Vector3 */.Pq.Cross(forwardVec, axisVec).z > 0;
        const leftApex = origin.clone();
        const rightApex = origin.clone();
        apex.subtractToRef(origin, axis);
        if (isApexLeft) {
            axis.scaleAndAddToRef(this._axisToApexShrinkFactor, leftApex);
            axis.scaleAndAddToRef(this._axisToApexExtendFactor, rightApex);
        }
        else {
            axis.scaleAndAddToRef(this._axisToApexExtendFactor, leftApex);
            axis.scaleAndAddToRef(this._axisToApexShrinkFactor, rightApex);
        }
        this.onFirstStepDetected.notifyObservers({
            leftApex: leftApex,
            rightApex: rightApex,
            currentPosition: origin,
            currentStepDirection: isApexLeft ? "right" : "left",
        });
    }
    reset() {
        for (let idx = 0; idx < this._samples.length; ++idx) {
            this._samples.at(idx).copyFromFloats(0, 0);
        }
    }
    get _samePointCheckStartIdx() {
        return Math.floor(this._samples.length / 3);
    }
    get _samePointSquaredDistanceThreshold() {
        return 0.03 * 0.03;
    }
    get _apexSquaredDistanceThreshold() {
        return 0.09 * 0.09;
    }
    get _squaredProjectionDistanceThreshold() {
        return 0.03 * 0.03;
    }
    get _axisToApexShrinkFactor() {
        return 0.8;
    }
    get _axisToApexExtendFactor() {
        return -1.6;
    }
    get _entropyDecayFactor() {
        return 0.93;
    }
    get _entropyThreshold() {
        return 0.4;
    }
}
class WalkingTracker {
    constructor(leftApex, rightApex, currentPosition, currentStepDirection) {
        this._leftApex = new math_vector/* Vector2 */.I9();
        this._rightApex = new math_vector/* Vector2 */.I9();
        this._currentPosition = new math_vector/* Vector2 */.I9();
        this._axis = new math_vector/* Vector2 */.I9();
        this._axisLength = -1;
        this._forward = new math_vector/* Vector2 */.I9();
        this._steppingLeft = false;
        this._t = -1;
        this._maxT = -1;
        this._maxTPosition = new math_vector/* Vector2 */.I9();
        this._vitality = 0;
        this.onMovement = new Misc_observable/* Observable */.cP();
        this.onFootfall = new Misc_observable/* Observable */.cP();
        this._reset(leftApex, rightApex, currentPosition, currentStepDirection === "left");
    }
    _reset(leftApex, rightApex, currentPosition, steppingLeft) {
        this._leftApex.copyFrom(leftApex);
        this._rightApex.copyFrom(rightApex);
        this._steppingLeft = steppingLeft;
        if (this._steppingLeft) {
            this._leftApex.subtractToRef(this._rightApex, this._axis);
            this._forward.copyFromFloats(-this._axis.y, this._axis.x);
        }
        else {
            this._rightApex.subtractToRef(this._leftApex, this._axis);
            this._forward.copyFromFloats(this._axis.y, -this._axis.x);
        }
        this._axisLength = this._axis.length();
        this._forward.scaleInPlace(1 / this._axisLength);
        this._updateTAndVitality(currentPosition.x, currentPosition.y);
        this._maxT = this._t;
        this._maxTPosition.copyFrom(currentPosition);
        this._vitality = 1;
    }
    _updateTAndVitality(x, y) {
        this._currentPosition.copyFromFloats(x, y);
        if (this._steppingLeft) {
            this._currentPosition.subtractInPlace(this._rightApex);
        }
        else {
            this._currentPosition.subtractInPlace(this._leftApex);
        }
        const priorT = this._t;
        const dot = math_vector/* Vector2 */.I9.Dot(this._currentPosition, this._axis);
        this._t = dot / (this._axisLength * this._axisLength);
        const projDistSquared = this._currentPosition.lengthSquared() - (dot / this._axisLength) * (dot / this._axisLength);
        // TODO: Extricate the magic.
        this._vitality *= 0.92 - 100 * Math.max(projDistSquared - 0.0016, 0) + Math.max(this._t - priorT, 0);
    }
    update(x, y) {
        if (this._vitality < this._vitalityThreshold) {
            return false;
        }
        const priorT = this._t;
        this._updateTAndVitality(x, y);
        if (this._t > this._maxT) {
            this._maxT = this._t;
            this._maxTPosition.copyFromFloats(x, y);
        }
        if (this._vitality < this._vitalityThreshold) {
            return false;
        }
        if (this._t > priorT) {
            this.onMovement.notifyObservers({ deltaT: this._t - priorT });
            if (priorT < 0.5 && this._t >= 0.5) {
                this.onFootfall.notifyObservers({ foot: this._steppingLeft ? "left" : "right" });
            }
        }
        if (this._t < 0.95 * this._maxT) {
            this._currentPosition.copyFromFloats(x, y);
            if (this._steppingLeft) {
                this._leftApex.copyFrom(this._maxTPosition);
            }
            else {
                this._rightApex.copyFrom(this._maxTPosition);
            }
            this._reset(this._leftApex, this._rightApex, this._currentPosition, !this._steppingLeft);
        }
        if (this._axisLength < 0.03) {
            return false;
        }
        return true;
    }
    get _vitalityThreshold() {
        return 0.1;
    }
    get forward() {
        return this._forward;
    }
}
class Walker {
    static get _MillisecondsPerUpdate() {
        // 15 FPS
        return 1000 / 15;
    }
    constructor(engine) {
        this._detector = new FirstStepDetector();
        this._walker = null;
        this._movement = new math_vector/* Vector2 */.I9();
        this._millisecondsSinceLastUpdate = Walker._MillisecondsPerUpdate;
        this.movementThisFrame = math_vector/* Vector3 */.Pq.Zero();
        this._engine = engine;
        this._detector.onFirstStepDetected.add((event) => {
            if (!this._walker) {
                this._walker = new WalkingTracker(event.leftApex, event.rightApex, event.currentPosition, event.currentStepDirection);
                this._walker.onFootfall.add(() => {
                    logger/* Logger */.V.Log("Footfall!");
                });
                this._walker.onMovement.add((event) => {
                    this._walker.forward.scaleAndAddToRef(0.024 * event.deltaT, this._movement);
                });
            }
        });
    }
    update(position, forward) {
        forward.y = 0;
        forward.normalize();
        // Enforce reduced framerate
        this._millisecondsSinceLastUpdate += this._engine.getDeltaTime();
        if (this._millisecondsSinceLastUpdate >= Walker._MillisecondsPerUpdate) {
            this._millisecondsSinceLastUpdate -= Walker._MillisecondsPerUpdate;
            this._detector.update(position.x, position.z, forward.x, forward.z);
            if (this._walker) {
                const updated = this._walker.update(position.x, position.z);
                if (!updated) {
                    this._walker = null;
                }
            }
            this._movement.scaleInPlace(0.85);
        }
        this.movementThisFrame.set(this._movement.x, 0, this._movement.y);
    }
}
/**
 * A module that will enable VR locomotion by detecting when the user walks in place.
 */
class WebXRWalkingLocomotion extends WebXRAbstractFeature {
    /**
     * The module's name.
     */
    static get Name() {
        return webXRFeaturesManager/* WebXRFeatureName */._.WALKING_LOCOMOTION;
    }
    /**
     * The (Babylon) version of this module.
     * This is an integer representing the implementation version.
     * This number has no external basis.
     */
    static get Version() {
        return 1;
    }
    /**
     * The target to be articulated by walking locomotion.
     * When the walking locomotion feature detects walking in place, this element's
     * X and Z coordinates will be modified to reflect locomotion. This target should
     * be either the XR space's origin (i.e., the parent node of the WebXRCamera) or
     * the WebXRCamera itself. Note that the WebXRCamera path will modify the position
     * of the WebXRCamera directly and is thus discouraged.
     */
    get locomotionTarget() {
        return this._locomotionTarget;
    }
    /**
     * The target to be articulated by walking locomotion.
     * When the walking locomotion feature detects walking in place, this element's
     * X and Z coordinates will be modified to reflect locomotion. This target should
     * be either the XR space's origin (i.e., the parent node of the WebXRCamera) or
     * the WebXRCamera itself. Note that the WebXRCamera path will modify the position
     * of the WebXRCamera directly and is thus discouraged.
     */
    set locomotionTarget(locomotionTarget) {
        this._locomotionTarget = locomotionTarget;
        this._isLocomotionTargetWebXRCamera = this._locomotionTarget.getClassName() === "WebXRCamera";
    }
    /**
     * Construct a new Walking Locomotion feature.
     * @param sessionManager manager for the current XR session
     * @param options creation options, prominently including the vector target for locomotion
     */
    constructor(sessionManager, options) {
        super(sessionManager);
        this._up = new math_vector/* Vector3 */.Pq();
        this._forward = new math_vector/* Vector3 */.Pq();
        this._position = new math_vector/* Vector3 */.Pq();
        this._movement = new math_vector/* Vector3 */.Pq();
        this._sessionManager = sessionManager;
        this.locomotionTarget = options.locomotionTarget;
        if (this._isLocomotionTargetWebXRCamera) {
            logger/* Logger */.V.Warn("Using walking locomotion directly on a WebXRCamera may have unintended interactions with other XR techniques. Using an XR space parent is highly recommended");
        }
    }
    /**
     * Checks whether this feature is compatible with the current WebXR session.
     * Walking locomotion is only compatible with "immersive-vr" sessions.
     * @returns true if compatible, false otherwise
     */
    isCompatible() {
        return this._sessionManager.sessionMode === undefined || this._sessionManager.sessionMode === "immersive-vr";
    }
    /**
     * Attaches the feature.
     * Typically called automatically by the features manager.
     * @returns true if attach succeeded, false otherwise
     */
    attach() {
        if (!this.isCompatible || !super.attach()) {
            return false;
        }
        this._walker = new Walker(this._sessionManager.scene.getEngine());
        return true;
    }
    /**
     * Detaches the feature.
     * Typically called automatically by the features manager.
     * @returns true if detach succeeded, false otherwise
     */
    detach() {
        if (!super.detach()) {
            return false;
        }
        this._walker = null;
        return true;
    }
    _onXRFrame(frame) {
        const pose = frame.getViewerPose(this._sessionManager.baseReferenceSpace);
        if (!pose) {
            return;
        }
        const handednessScalar = this.locomotionTarget.getScene().useRightHandedSystem ? 1 : -1;
        const m = pose.transform.matrix;
        this._up.copyFromFloats(m[4], m[5], handednessScalar * m[6]);
        this._forward.copyFromFloats(m[8], m[9], handednessScalar * m[10]);
        this._position.copyFromFloats(m[12], m[13], handednessScalar * m[14]);
        // Compute the nape position
        this._forward.scaleAndAddToRef(0.05, this._position);
        this._up.scaleAndAddToRef(-0.05, this._position);
        this._walker.update(this._position, this._forward);
        this._movement.copyFrom(this._walker.movementThisFrame);
        if (!this._isLocomotionTargetWebXRCamera) {
            math_vector/* Vector3 */.Pq.TransformNormalToRef(this._movement, this.locomotionTarget.getWorldMatrix(), this._movement);
        }
        this.locomotionTarget.position.addInPlace(this._movement);
    }
}
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRWalkingLocomotion.Name, (xrSessionManager, options) => {
    return () => new WebXRWalkingLocomotion(xrSessionManager, options);
}, WebXRWalkingLocomotion.Version, false);
//# sourceMappingURL=WebXRWalkingLocomotion.js.map
;// ./node_modules/@babylonjs/core/XR/features/Layers/WebXRCompositionLayer.js



/**
 * Wraps xr composition layers.
 * @internal
 */
class WebXRCompositionLayerWrapper extends WebXRLayerWrapper {
    constructor(getWidth, getHeight, layer, layerType, isMultiview, createRTTProvider, _originalInternalTexture = null) {
        super(getWidth, getHeight, layer, layerType, createRTTProvider);
        this.getWidth = getWidth;
        this.getHeight = getHeight;
        this.layer = layer;
        this.layerType = layerType;
        this.isMultiview = isMultiview;
        this.createRTTProvider = createRTTProvider;
        this._originalInternalTexture = _originalInternalTexture;
    }
}
/**
 * Provides render target textures and other important rendering information for a given XRCompositionLayer.
 * @internal
 */
class WebXRCompositionLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetTextureProvider {
    constructor(_xrSessionManager, _xrWebGLBinding, layerWrapper) {
        super(_xrSessionManager.scene, layerWrapper);
        this._xrSessionManager = _xrSessionManager;
        this._xrWebGLBinding = _xrWebGLBinding;
        this.layerWrapper = layerWrapper;
        this._lastSubImages = new Map();
        /**
         * Fires every time a new render target texture is created (either for eye, for view, or for the entire frame)
         */
        this.onRenderTargetTextureCreatedObservable = new Misc_observable/* Observable */.cP();
        this._compositionLayer = layerWrapper.layer;
    }
    _getRenderTargetForSubImage(subImage, eye = "none") {
        const lastSubImage = this._lastSubImages.get(eye);
        const eyeIndex = eye == "right" ? 1 : 0;
        const colorTextureWidth = subImage.colorTextureWidth ?? subImage.textureWidth;
        const colorTextureHeight = subImage.colorTextureHeight ?? subImage.textureHeight;
        if (!this._renderTargetTextures[eyeIndex] || lastSubImage?.textureWidth !== colorTextureWidth || lastSubImage?.textureHeight !== colorTextureHeight) {
            let depthStencilTexture;
            const depthStencilTextureWidth = subImage.depthStencilTextureWidth ?? colorTextureWidth;
            const depthStencilTextureHeight = subImage.depthStencilTextureHeight ?? colorTextureHeight;
            if (colorTextureWidth === depthStencilTextureWidth || colorTextureHeight === depthStencilTextureHeight) {
                depthStencilTexture = subImage.depthStencilTexture;
            }
            this._renderTargetTextures[eyeIndex] = this._createRenderTargetTexture(colorTextureWidth, colorTextureHeight, null, subImage.colorTexture, depthStencilTexture, this.layerWrapper.isMultiview);
            this._framebufferDimensions = {
                framebufferWidth: colorTextureWidth,
                framebufferHeight: colorTextureHeight,
            };
            this.onRenderTargetTextureCreatedObservable.notifyObservers({ texture: this._renderTargetTextures[eyeIndex], eye });
        }
        this._lastSubImages.set(eye, subImage);
        return this._renderTargetTextures[eyeIndex];
    }
    _getSubImageForEye(eye) {
        const currentFrame = this._xrSessionManager.currentFrame;
        if (currentFrame) {
            return this._xrWebGLBinding.getSubImage(this._compositionLayer, currentFrame, eye);
        }
        return null;
    }
    getRenderTargetTextureForEye(eye) {
        const subImage = this._getSubImageForEye(eye);
        if (subImage) {
            return this._getRenderTargetForSubImage(subImage, eye);
        }
        return null;
    }
    getRenderTargetTextureForView(view) {
        return this.getRenderTargetTextureForEye(view?.eye);
    }
    _setViewportForSubImage(viewport, subImage) {
        const textureWidth = subImage.colorTextureWidth ?? subImage.textureWidth;
        const textureHeight = subImage.colorTextureHeight ?? subImage.textureHeight;
        const xrViewport = subImage.viewport;
        viewport.x = xrViewport.x / textureWidth;
        viewport.y = xrViewport.y / textureHeight;
        viewport.width = xrViewport.width / textureWidth;
        viewport.height = xrViewport.height / textureHeight;
    }
    trySetViewportForView(viewport, view) {
        const subImage = this._lastSubImages.get(view.eye) || this._getSubImageForEye(view.eye);
        if (subImage) {
            this._setViewportForSubImage(viewport, subImage);
            return true;
        }
        return false;
    }
}
//# sourceMappingURL=WebXRCompositionLayer.js.map
;// ./node_modules/@babylonjs/core/XR/features/Layers/WebXRProjectionLayer.js

/**
 * Wraps xr projection layers.
 * @internal
 */
class WebXRProjectionLayerWrapper extends WebXRCompositionLayerWrapper {
    constructor(layer, isMultiview, xrGLBinding) {
        super(() => layer.textureWidth, () => layer.textureHeight, layer, "XRProjectionLayer", isMultiview, (sessionManager) => new WebXRProjectionLayerRenderTargetTextureProvider(sessionManager, xrGLBinding, this));
        this.layer = layer;
    }
}
/**
 * Provides render target textures and other important rendering information for a given XRProjectionLayer.
 * @internal
 */
class WebXRProjectionLayerRenderTargetTextureProvider extends WebXRCompositionLayerRenderTargetTextureProvider {
    constructor(_xrSessionManager, _xrWebGLBinding, layerWrapper) {
        super(_xrSessionManager, _xrWebGLBinding, layerWrapper);
        this.layerWrapper = layerWrapper;
        this._projectionLayer = layerWrapper.layer;
    }
    _getSubImageForView(view) {
        return this._xrWebGLBinding.getViewSubImage(this._projectionLayer, view);
    }
    getRenderTargetTextureForView(view) {
        return this._getRenderTargetForSubImage(this._getSubImageForView(view), view.eye);
    }
    getRenderTargetTextureForEye(eye) {
        const lastSubImage = this._lastSubImages.get(eye);
        if (lastSubImage) {
            return this._getRenderTargetForSubImage(lastSubImage, eye);
        }
        return null;
    }
    trySetViewportForView(viewport, view) {
        const subImage = this._lastSubImages.get(view.eye) || this._getSubImageForView(view);
        if (subImage) {
            this._setViewportForSubImage(viewport, subImage);
            return true;
        }
        return false;
    }
}
const defaultXRProjectionLayerInit = {
    textureType: "texture",
    colorFormat: 0x1908 /* WebGLRenderingContext.RGBA */,
    depthFormat: 0x88f0 /* WebGLRenderingContext.DEPTH24_STENCIL8 */,
    scaleFactor: 1.0,
    clearOnAccess: false,
};
//# sourceMappingURL=WebXRProjectionLayer.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRLayers.js






const defaultXRWebGLLayerInit = {};
/**
 * Exposes the WebXR Layers API.
 */
class WebXRLayers extends WebXRAbstractFeature {
    constructor(_xrSessionManager, _options = {}) {
        super(_xrSessionManager);
        this._options = _options;
        /**
         * Already-created layers
         */
        this._existingLayers = [];
        this._isMultiviewEnabled = false;
        this._projectionLayerInitialized = false;
        this._compositionLayerTextureMapping = new WeakMap();
        this._layerToRTTProviderMapping = new WeakMap();
        this.xrNativeFeatureName = "layers";
    }
    /**
     * Attach this feature.
     * Will usually be called by the features manager.
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        const engine = this._xrSessionManager.scene.getEngine();
        this._glContext = engine._gl;
        this._xrWebGLBinding = new XRWebGLBinding(this._xrSessionManager.session, this._glContext);
        this._existingLayers.length = 0;
        const projectionLayerInit = { ...defaultXRProjectionLayerInit, ...this._options.projectionLayerInit };
        this._isMultiviewEnabled = this._options.preferMultiviewOnInit && engine.getCaps().multiview;
        this.createProjectionLayer(projectionLayerInit /*, projectionLayerMultiview*/);
        this._projectionLayerInitialized = true;
        return true;
    }
    detach() {
        if (!super.detach()) {
            return false;
        }
        this._existingLayers.forEach((layer) => {
            layer.dispose();
        });
        this._existingLayers.length = 0;
        this._projectionLayerInitialized = false;
        return true;
    }
    /**
     * Creates a new XRWebGLLayer.
     * @param params an object providing configuration options for the new XRWebGLLayer
     * @returns the XRWebGLLayer
     */
    createXRWebGLLayer(params = defaultXRWebGLLayerInit) {
        const layer = new XRWebGLLayer(this._xrSessionManager.session, this._glContext, params);
        return new WebXRWebGLLayerWrapper(layer);
    }
    _validateLayerInit(params, multiview = this._isMultiviewEnabled) {
        // check if we are in session
        if (!this._xrSessionManager.inXRSession) {
            throw new Error("Cannot create a layer outside of a WebXR session. Make sure the session has started before creating layers.");
        }
        if (multiview && params.textureType !== "texture-array") {
            throw new Error("Projection layers can only be made multiview if they use texture arrays. Set the textureType parameter to 'texture-array'.");
        }
        // TODO (rgerd): Support RTT's that are bound to sub-images in the texture array.
        if (!multiview && params.textureType === "texture-array") {
            throw new Error("We currently only support multiview rendering when the textureType parameter is set to 'texture-array'.");
        }
    }
    _extendXRLayerInit(params, multiview = this._isMultiviewEnabled) {
        if (multiview) {
            params.textureType = "texture-array";
        }
        return params;
    }
    /**
     * Creates a new XRProjectionLayer.
     * @param params an object providing configuration options for the new XRProjectionLayer.
     * @param multiview whether the projection layer should render with multiview. Will be tru automatically if the extension initialized with multiview.
     * @returns the projection layer
     */
    createProjectionLayer(params = defaultXRProjectionLayerInit, multiview = this._isMultiviewEnabled) {
        this._extendXRLayerInit(params, multiview);
        this._validateLayerInit(params, multiview);
        const projLayer = this._xrWebGLBinding.createProjectionLayer(params);
        const layer = new WebXRProjectionLayerWrapper(projLayer, multiview, this._xrWebGLBinding);
        this.addXRSessionLayer(layer);
        return layer;
    }
    /**
     * Note about making it private - this function will be exposed once I decide on a proper API to support all of the XR layers' options
     * @param options an object providing configuration options for the new XRQuadLayer.
     * @param babylonTexture the texture to display in the layer
     * @returns the quad layer
     */
    _createQuadLayer(options = { params: {} }, babylonTexture) {
        this._extendXRLayerInit(options.params, false);
        const width = this._existingLayers[0].layer.textureWidth;
        const height = this._existingLayers[0].layer.textureHeight;
        const populatedParams = {
            space: this._xrSessionManager.referenceSpace,
            viewPixelWidth: width,
            viewPixelHeight: height,
            clearOnAccess: true,
            ...options.params,
        };
        this._validateLayerInit(populatedParams, false);
        const quadLayer = this._xrWebGLBinding.createQuadLayer(populatedParams);
        quadLayer.width = this._isMultiviewEnabled ? 1 : 2;
        quadLayer.height = 1;
        // this wrapper is not really needed, but it's here for consistency
        const wrapper = new WebXRCompositionLayerWrapper(() => quadLayer.width, () => quadLayer.height, quadLayer, "XRQuadLayer", false, (sessionManager) => new WebXRCompositionLayerRenderTargetTextureProvider(sessionManager, this._xrWebGLBinding, wrapper));
        if (babylonTexture) {
            this._compositionLayerTextureMapping.set(quadLayer, babylonTexture);
        }
        const rtt = wrapper.createRenderTargetTextureProvider(this._xrSessionManager);
        this._layerToRTTProviderMapping.set(quadLayer, rtt);
        this.addXRSessionLayer(wrapper);
        return wrapper;
    }
    /**
     * @experimental
     * This will support full screen ADT when used with WebXR Layers. This API might change in the future.
     * Note that no interaction will be available with the ADT when using this method
     * @param texture the texture to display in the layer
     * @param options optional parameters for the layer
     * @returns a composition layer containing the texture
     */
    addFullscreenAdvancedDynamicTexture(texture, options = { distanceFromHeadset: 1.5 }) {
        const wrapper = this._createQuadLayer({
            params: {
                space: this._xrSessionManager.viewerReferenceSpace,
                textureType: "texture",
                layout: "mono",
            },
        }, texture);
        const layer = wrapper.layer;
        const distance = Math.max(0.1, options.distanceFromHeadset);
        const pos = { x: 0, y: 0, z: -distance };
        const orient = { x: 0, y: 0, z: 0, w: 1 };
        layer.transform = new XRRigidTransform(pos, orient);
        const rttProvider = this._layerToRTTProviderMapping.get(layer);
        if (!rttProvider) {
            throw new Error("Could not find the RTT provider for the layer");
        }
        const babylonLayer = this._xrSessionManager.scene.layers.find((babylonLayer) => {
            return babylonLayer.texture === texture;
        });
        if (!babylonLayer) {
            throw new Error("Could not find the babylon layer for the texture");
        }
        rttProvider.onRenderTargetTextureCreatedObservable.add((data) => {
            if (data.eye && data.eye === "right") {
                return;
            }
            data.texture.clearColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
            babylonLayer.renderTargetTextures.push(data.texture);
            babylonLayer.renderOnlyInRenderTargetTextures = true;
            // for stereo (not for gui) it should be onBeforeCameraRenderObservable
            this._xrSessionManager.scene.onBeforeRenderObservable.add(() => {
                data.texture.render();
            });
            babylonLayer.renderTargetTextures.push(data.texture);
            babylonLayer.renderOnlyInRenderTargetTextures = true;
            // add it back when the session ends
            this._xrSessionManager.onXRSessionEnded.addOnce(() => {
                babylonLayer.renderTargetTextures.splice(babylonLayer.renderTargetTextures.indexOf(data.texture), 1);
                babylonLayer.renderOnlyInRenderTargetTextures = false;
            });
        });
        return wrapper;
    }
    /**
     * @experimental
     * This functions allows you to add a lens flare system to the XR scene.
     * Note - this will remove the lens flare system from the scene and add it to the XR scene.
     * This feature is experimental and might change in the future.
     * @param flareSystem the flare system to add
     * @returns a composition layer containing the flare system
     */
    _addLensFlareSystem(flareSystem) {
        const wrapper = this._createQuadLayer({
            params: {
                space: this._xrSessionManager.viewerReferenceSpace,
                textureType: "texture",
                layout: "mono",
            },
        });
        const layer = wrapper.layer;
        layer.width = 2;
        layer.height = 1;
        const distance = 10;
        const pos = { x: 0, y: 0, z: -distance };
        const orient = { x: 0, y: 0, z: 0, w: 1 };
        layer.transform = new XRRigidTransform(pos, orient);
        // get the rtt wrapper
        const rttProvider = this._layerToRTTProviderMapping.get(layer);
        if (!rttProvider) {
            throw new Error("Could not find the RTT provider for the layer");
        }
        // render the flare system to the rtt
        rttProvider.onRenderTargetTextureCreatedObservable.add((data) => {
            data.texture.clearColor = new math_color/* Color4 */.ov(0, 0, 0, 0);
            data.texture.customRenderFunction = () => {
                flareSystem.render();
            };
            // add to the scene's render targets
            // this._xrSessionManager.scene.onBeforeCameraRenderObservable.add(() => {
            //     data.texture.render();
            // });
        });
        // remove the lens flare system from the scene
        this._xrSessionManager.onXRSessionInit.add(() => {
            this._xrSessionManager.scene.lensFlareSystems.splice(this._xrSessionManager.scene.lensFlareSystems.indexOf(flareSystem), 1);
        });
        // add it back when the session ends
        this._xrSessionManager.onXRSessionEnded.add(() => {
            this._xrSessionManager.scene.lensFlareSystems.push(flareSystem);
        });
        return wrapper;
    }
    /**
     * Add a new layer to the already-existing list of layers
     * @param wrappedLayer the new layer to add to the existing ones
     */
    addXRSessionLayer(wrappedLayer) {
        this._existingLayers.push(wrappedLayer);
        this.setXRSessionLayers(this._existingLayers);
    }
    /**
     * Sets the layers to be used by the XR session.
     * Note that you must call this function with any layers you wish to render to
     * since it adds them to the XR session's render state
     * (replacing any layers that were added in a previous call to setXRSessionLayers or updateRenderState).
     * This method also sets up the session manager's render target texture provider
     * as the first layer in the array, which feeds the WebXR camera(s) attached to the session.
     * @param wrappedLayers An array of WebXRLayerWrapper, usually returned from the WebXRLayers createLayer functions.
     */
    setXRSessionLayers(wrappedLayers = this._existingLayers) {
        // this._existingLayers = wrappedLayers;
        const renderStateInit = { ...this._xrSessionManager.session.renderState };
        // Clear out the layer-related fields.
        renderStateInit.baseLayer = undefined;
        renderStateInit.layers = wrappedLayers.map((wrappedLayer) => wrappedLayer.layer);
        this._xrSessionManager.updateRenderState(renderStateInit);
        if (!this._projectionLayerInitialized) {
            this._xrSessionManager._setBaseLayerWrapper(wrappedLayers.length > 0 ? wrappedLayers.at(0) : null);
        }
    }
    isCompatible() {
        // TODO (rgerd): Add native support.
        return !this._xrSessionManager.isNative && typeof XRWebGLBinding !== "undefined" && !!XRWebGLBinding.prototype.createProjectionLayer;
    }
    /**
     * Dispose this feature and all of the resources attached.
     */
    dispose() {
        super.dispose();
    }
    _onXRFrame(_xrFrame) {
        // Replace once the mapped internal texture of each available composition layer, apart from the last one, which is the projection layer that needs an RTT
        const layers = this._existingLayers;
        for (let i = 0; i < layers.length; ++i) {
            const layer = layers[i];
            if (layer.layerType !== "XRProjectionLayer") {
                // get the rtt provider
                const rttProvider = this._layerToRTTProviderMapping.get(layer.layer);
                if (!rttProvider) {
                    continue;
                }
                if (rttProvider.layerWrapper.isMultiview) {
                    // get the views, if we are in multiview
                    const pose = _xrFrame.getViewerPose(this._xrSessionManager.referenceSpace);
                    if (pose) {
                        const views = pose.views;
                        for (let j = 0; j < views.length; ++j) {
                            const view = views[j];
                            rttProvider.getRenderTargetTextureForView(view);
                        }
                    }
                }
                else {
                    rttProvider.getRenderTargetTextureForView();
                }
            }
        }
    }
}
/**
 * The module's name
 */
WebXRLayers.Name = webXRFeaturesManager/* WebXRFeatureName */._.LAYERS;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRLayers.Version = 1;
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRLayers.Name, (xrSessionManager, options) => {
    return () => new WebXRLayers(xrSessionManager, options);
}, WebXRLayers.Version, false);
//# sourceMappingURL=WebXRLayers.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRDepthSensing.js









/**
 * WebXR Feature for WebXR Depth Sensing Module
 * @since 5.49.1
 */
class WebXRDepthSensing extends WebXRAbstractFeature {
    /**
     * Width of depth data. If depth data is not exist, returns null.
     */
    get width() {
        return this._width;
    }
    /**
     * Height of depth data. If depth data is not exist, returns null.
     */
    get height() {
        return this._height;
    }
    /**
     * Scale factor by which the raw depth values must be multiplied in order to get the depths in meters.
     */
    get rawValueToMeters() {
        return this._rawValueToMeters;
    }
    /**
     * An XRRigidTransform that needs to be applied when indexing into the depth buffer.
     */
    get normDepthBufferFromNormView() {
        return this._normDepthBufferFromNormView;
    }
    /**
     * Describes which depth-sensing usage ("cpu" or "gpu") is used.
     */
    get depthUsage() {
        switch (this._xrSessionManager.session.depthUsage) {
            case "cpu-optimized":
                return "cpu";
            case "gpu-optimized":
                return "gpu";
        }
    }
    /**
     * Describes which depth sensing data format ("ushort" or "float") is used.
     */
    get depthDataFormat() {
        switch (this._xrSessionManager.session.depthDataFormat) {
            case "luminance-alpha":
                return "ushort";
            case "float32":
                return "float";
        }
    }
    /**
     * Latest cached InternalTexture which containing depth buffer information.
     * This can be used when the depth usage is "gpu".
     */
    get latestInternalTexture() {
        if (!this._cachedWebGLTexture) {
            return null;
        }
        const engine = this._xrSessionManager.scene.getEngine();
        const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(engine, 0 /* InternalTextureSource.Unknown */);
        internalTexture.isCube = false;
        internalTexture.invertY = false;
        internalTexture._useSRGBBuffer = false;
        internalTexture.format = this.depthDataFormat === "ushort" ? 2 : 5;
        internalTexture.generateMipMaps = false;
        internalTexture.type = this.depthDataFormat === "ushort" ? 5 : 1;
        internalTexture.samplingMode = 7;
        internalTexture.width = this.width ?? 0;
        internalTexture.height = this.height ?? 0;
        internalTexture._cachedWrapU = 1;
        internalTexture._cachedWrapV = 1;
        internalTexture._hardwareTexture = new webGLHardwareTexture/* WebGLHardwareTexture */.d(this._cachedWebGLTexture, engine._gl);
        return internalTexture;
    }
    /**
     * cached depth buffer
     */
    get latestDepthBuffer() {
        if (!this._cachedDepthBuffer) {
            return null;
        }
        return this.depthDataFormat === "ushort" ? new Uint16Array(this._cachedDepthBuffer) : new Float32Array(this._cachedDepthBuffer);
    }
    /**
     * Latest cached Texture of depth image which is made from the depth buffer data.
     */
    get latestDepthImageTexture() {
        return this._cachedDepthImageTexture;
    }
    /**
     * Creates a new instance of the depth sensing feature
     * @param _xrSessionManager the WebXRSessionManager
     * @param options options for WebXR Depth Sensing Feature
     */
    constructor(_xrSessionManager, options) {
        super(_xrSessionManager);
        this.options = options;
        this._width = null;
        this._height = null;
        this._rawValueToMeters = null;
        this._normDepthBufferFromNormView = null;
        this._cachedDepthBuffer = null;
        this._cachedWebGLTexture = null;
        this._cachedDepthImageTexture = null;
        /**
         * Event that notify when `DepthInformation.getDepthInMeters` is available.
         * `getDepthInMeters` method needs active XRFrame (not available for cached XRFrame)
         */
        this.onGetDepthInMetersAvailable = new Misc_observable/* Observable */.cP();
        this.xrNativeFeatureName = "depth-sensing";
        // https://immersive-web.github.io/depth-sensing/
        tools/* Tools */.S0.Warn("depth-sensing is an experimental and unstable feature.");
    }
    /**
     * attach this feature
     * Will usually be called by the features manager
     * @param force should attachment be forced (even when already attached)
     * @returns true if successful.
     */
    attach(force) {
        if (!super.attach(force)) {
            return false;
        }
        const isBothDepthUsageAndFormatNull = this._xrSessionManager.session.depthDataFormat == null || this._xrSessionManager.session.depthUsage == null;
        if (isBothDepthUsageAndFormatNull) {
            return false;
        }
        this._glBinding = new XRWebGLBinding(this._xrSessionManager.session, this._xrSessionManager.scene.getEngine()._gl);
        return true;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        this._cachedDepthImageTexture?.dispose();
        this.onGetDepthInMetersAvailable.clear();
    }
    _onXRFrame(_xrFrame) {
        const referenceSPace = this._xrSessionManager.referenceSpace;
        const pose = _xrFrame.getViewerPose(referenceSPace);
        if (pose == null) {
            return;
        }
        for (const view of pose.views) {
            switch (this.depthUsage) {
                case "cpu":
                    this._updateDepthInformationAndTextureCPUDepthUsage(_xrFrame, view, this.depthDataFormat);
                    break;
                case "gpu":
                    if (!this._glBinding) {
                        break;
                    }
                    this._updateDepthInformationAndTextureWebGLDepthUsage(this._glBinding, view, this.depthDataFormat);
                    break;
                default:
                    tools/* Tools */.S0.Error("Unknown depth usage");
                    this.detach();
                    break;
            }
        }
    }
    _updateDepthInformationAndTextureCPUDepthUsage(frame, view, dataFormat) {
        const depthInfo = frame.getDepthInformation(view);
        if (depthInfo === null) {
            return;
        }
        const { data, width, height, rawValueToMeters, getDepthInMeters } = depthInfo;
        this._width = width;
        this._height = height;
        this._rawValueToMeters = rawValueToMeters;
        this._cachedDepthBuffer = data;
        // to avoid Illegal Invocation error, bind `this`
        this.onGetDepthInMetersAvailable.notifyObservers(getDepthInMeters.bind(depthInfo));
        if (!this._cachedDepthImageTexture) {
            this._cachedDepthImageTexture = rawTexture/* RawTexture */.I.CreateRTexture(null, width, height, this._xrSessionManager.scene, false, true, Textures_texture/* Texture */.g.NEAREST_SAMPLINGMODE, 1);
        }
        switch (dataFormat) {
            case "ushort":
                this._cachedDepthImageTexture.update(Float32Array.from(new Uint16Array(data)).map((value) => value * rawValueToMeters));
                break;
            case "float":
                this._cachedDepthImageTexture.update(new Float32Array(data).map((value) => value * rawValueToMeters));
                break;
            default:
                break;
        }
    }
    _updateDepthInformationAndTextureWebGLDepthUsage(webglBinding, view, dataFormat) {
        const depthInfo = webglBinding.getDepthInformation(view);
        if (depthInfo === null) {
            return;
        }
        const { texture, width, height } = depthInfo;
        this._width = width;
        this._height = height;
        this._cachedWebGLTexture = texture;
        const scene = this._xrSessionManager.scene;
        const engine = scene.getEngine();
        const internalTexture = engine.wrapWebGLTexture(texture);
        if (!this._cachedDepthImageTexture) {
            this._cachedDepthImageTexture = rawTexture/* RawTexture */.I.CreateRTexture(null, width, height, scene, false, true, Textures_texture/* Texture */.g.NEAREST_SAMPLINGMODE, dataFormat === "ushort" ? 0 : 1);
        }
        this._cachedDepthImageTexture._texture = internalTexture;
    }
    /**
     * Extends the session init object if needed
     * @returns augmentation object for the xr session init object.
     */
    getXRSessionInitExtension() {
        const isDepthUsageDeclared = this.options.usagePreference != null && this.options.usagePreference.length !== 0;
        const isDataFormatDeclared = this.options.dataFormatPreference != null && this.options.dataFormatPreference.length !== 0;
        return new Promise((resolve) => {
            if (isDepthUsageDeclared && isDataFormatDeclared) {
                const usages = this.options.usagePreference.map((usage) => {
                    switch (usage) {
                        case "cpu":
                            return "cpu-optimized";
                        case "gpu":
                            return "gpu-optimized";
                    }
                });
                const dataFormats = this.options.dataFormatPreference.map((format) => {
                    switch (format) {
                        case "ushort":
                            return "luminance-alpha";
                        case "float":
                            return "float32";
                    }
                });
                resolve({
                    depthSensing: {
                        usagePreference: usages,
                        dataFormatPreference: dataFormats,
                    },
                });
            }
            else {
                resolve({});
            }
        });
    }
}
/**
 * The module's name
 */
WebXRDepthSensing.Name = webXRFeaturesManager/* WebXRFeatureName */._.DEPTH_SENSING;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRDepthSensing.Version = 1;
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRDepthSensing.Name, (xrSessionManager, options) => {
    return () => new WebXRDepthSensing(xrSessionManager, options);
}, WebXRDepthSensing.Version, false);
//# sourceMappingURL=WebXRDepthSensing.js.map
;// ./node_modules/@babylonjs/core/Shaders/velocity.fragment.js
// Do not edit.

const velocity_fragment_name = "velocityPixelShader";
const velocity_fragment_shader = `precision highp float;
#define CUSTOM_FRAGMENT_BEGIN
varying vec4 clipPos;varying vec4 previousClipPos;
#define CUSTOM_FRAGMENT_DEFINITIONS
void main(void) {
#define CUSTOM_FRAGMENT_MAIN_BEGIN
highp vec4 motionVector=( clipPos/clipPos.w-previousClipPos/previousClipPos.w );gl_FragColor=motionVector;
#define CUSTOM_FRAGMENT_MAIN_END
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[velocity_fragment_name] = velocity_fragment_shader;
/** @internal */
const velocityPixelShader = { name: velocity_fragment_name, shader: velocity_fragment_shader };
//# sourceMappingURL=velocity.fragment.js.map
;// ./node_modules/@babylonjs/core/Shaders/velocity.vertex.js
// Do not edit.



const velocity_vertex_name = "velocityVertexShader";
const velocity_vertex_shader = `#define CUSTOM_VERTEX_BEGIN
#define VELOCITY
attribute vec3 position;
#include<instancesDeclaration>
uniform mat4 viewProjection;uniform mat4 previousViewProjection;
#ifdef MULTIVIEW
uniform mat4 viewProjectionR;uniform mat4 previousViewProjectionR;
#endif
varying vec4 clipPos;varying vec4 previousClipPos;
#define CUSTOM_VERTEX_DEFINITIONS
void main(void) {
#define CUSTOM_VERTEX_MAIN_BEGIN
vec3 positionUpdated=position;
#include<instancesVertex>
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);vec4 previousWorldPos=finalPreviousWorld*vec4(positionUpdated,1.0);
#ifdef MULTIVIEW
if (gl_ViewID_OVR==0u) {clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousWorldPos;gl_Position=clipPos;} else {clipPos=viewProjectionR*worldPos;previousClipPos=previousViewProjectionR*previousWorldPos;gl_Position=clipPos;}
#elif
clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousWorldPos;gl_Position=clipPos;
#endif
#define CUSTOM_VERTEX_MAIN_END
}`;
// Sideeffect
shaderStore/* ShaderStore */.l.ShadersStore[velocity_vertex_name] = velocity_vertex_shader;
/** @internal */
const velocityVertexShader = { name: velocity_vertex_name, shader: velocity_vertex_shader };
//# sourceMappingURL=velocity.vertex.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRSpaceWarp.js








/**
 * Used for Space Warp render process
 */
class XRSpaceWarpRenderTarget extends Textures_renderTargetTexture/* RenderTargetTexture */.$ {
    /**
     * Creates a Space Warp render target
     * @param motionVectorTexture WebGLTexture provided by WebGLSubImage
     * @param depthStencilTexture WebGLTexture provided by WebGLSubImage
     * @param scene scene used with the render target
     * @param size the size of the render target (used for each view)
     */
    constructor(motionVectorTexture, depthStencilTexture, scene, size = 512) {
        super("spacewarp rtt", size, scene, false, true, 2, false, undefined, false, false, true, undefined, true);
        this._originalPairing = [];
        this._previousWorldMatrices = [];
        this._previousTransforms = [math_vector/* Matrix */.uq.Identity(), math_vector/* Matrix */.uq.Identity()];
        this._renderTarget = this.getScene().getEngine().createMultiviewRenderTargetTexture(this.getRenderWidth(), this.getRenderHeight(), motionVectorTexture, depthStencilTexture);
        this._renderTarget._disposeOnlyFramebuffers = true;
        this._texture = this._renderTarget.texture;
        this._texture.isMultiview = true;
        this._texture.format = 5;
        if (scene) {
            this._velocityMaterial = new shaderMaterial/* ShaderMaterial */.B("velocity shader material", scene, {
                vertex: "velocity",
                fragment: "velocity",
            }, {
                uniforms: ["world", "previousWorld", "viewProjection", "viewProjectionR", "previousViewProjection", "previousViewProjectionR"],
            });
            this._velocityMaterial._materialHelperNeedsPreviousMatrices = true;
            this._velocityMaterial.onBindObservable.add((mesh) => {
                // mesh. getWorldMatrix can be incorrect under rare conditions (e.g. when using a effective mesh in the render function).
                // If the case arise that will require changing it we will need to change the bind process in the material class to also provide the world matrix as a parameter
                this._previousWorldMatrices[mesh.uniqueId] = this._previousWorldMatrices[mesh.uniqueId] || mesh.getWorldMatrix();
                this._velocityMaterial.getEffect().setMatrix("previousWorld", this._previousWorldMatrices[mesh.uniqueId]);
                this._previousWorldMatrices[mesh.uniqueId] = mesh.getWorldMatrix();
                // now set the scene's previous matrix
                this._velocityMaterial.getEffect().setMatrix("previousViewProjection", this._previousTransforms[0]);
                // multiview for sure
                this._velocityMaterial.getEffect().setMatrix("previousViewProjectionR", this._previousTransforms[1]);
                // store the previous (current, to be exact) transforms
                this._previousTransforms[0].copyFrom(scene.getTransformMatrix());
                this._previousTransforms[1].copyFrom(scene._transformMatrixR);
            });
            this._velocityMaterial.freeze();
        }
    }
    render(useCameraPostProcess = false, dumpForDebug = false) {
        // Swap to use velocity material
        this._originalPairing.length = 0;
        const scene = this.getScene();
        // set the velocity material to render the velocity RTT
        if (scene && this._velocityMaterial) {
            scene.getActiveMeshes().forEach((mesh) => {
                this._originalPairing.push([mesh, mesh.material]);
                mesh.material = this._velocityMaterial;
            });
        }
        super.render(useCameraPostProcess, dumpForDebug);
        // Restore original materials
        this._originalPairing.forEach((tuple) => {
            tuple[0].material = tuple[1];
        });
    }
    /**
     * @internal
     */
    _bindFrameBuffer() {
        if (!this._renderTarget) {
            return;
        }
        this.getScene().getEngine().bindSpaceWarpFramebuffer(this._renderTarget);
    }
    /**
     * Gets the number of views the corresponding to the texture (eg. a SpaceWarpRenderTarget will have > 1)
     * @returns the view count
     */
    getViewCount() {
        return 2;
    }
    dispose() {
        super.dispose();
        this._velocityMaterial.dispose();
        this._previousTransforms.length = 0;
        this._previousWorldMatrices.length = 0;
        this._originalPairing.length = 0;
    }
}
/**
 * WebXR Space Warp Render Target Texture Provider
 */
class WebXRSpaceWarpRenderTargetTextureProvider {
    constructor(_scene, _xrSessionManager, _xrWebGLBinding) {
        this._scene = _scene;
        this._xrSessionManager = _xrSessionManager;
        this._xrWebGLBinding = _xrWebGLBinding;
        this._lastSubImages = new Map();
        this._renderTargetTextures = new Map();
        this._engine = _scene.getEngine();
    }
    _getSubImageForView(view) {
        const layerWrapper = this._xrSessionManager._getBaseLayerWrapper();
        if (!layerWrapper) {
            throw new Error("For Space Warp, the base layer should be a WebXR Projection Layer.");
        }
        if (layerWrapper.layerType !== "XRProjectionLayer") {
            throw new Error('For Space Warp, the base layer type should "XRProjectionLayer".');
        }
        const layer = layerWrapper.layer;
        return this._xrWebGLBinding.getViewSubImage(layer, view);
    }
    _setViewportForSubImage(viewport, subImage) {
        viewport.x = 0;
        viewport.y = 0;
        viewport.width = subImage.motionVectorTextureWidth;
        viewport.height = subImage.motionVectorTextureHeight;
    }
    _createRenderTargetTexture(width, height, framebuffer, motionVectorTexture, depthStencilTexture) {
        if (!this._engine) {
            throw new Error("Engine is disposed");
        }
        const textureSize = { width, height };
        // Create render target texture from the internal texture
        const renderTargetTexture = new XRSpaceWarpRenderTarget(motionVectorTexture, depthStencilTexture, this._scene, textureSize);
        const renderTargetWrapper = renderTargetTexture.renderTarget;
        if (framebuffer) {
            renderTargetWrapper._framebuffer = framebuffer;
        }
        // Create internal texture
        renderTargetWrapper._colorTextureArray = motionVectorTexture;
        renderTargetWrapper._depthStencilTextureArray = depthStencilTexture;
        renderTargetTexture.disableRescaling();
        renderTargetTexture.renderListPredicate = () => true;
        return renderTargetTexture;
    }
    _getRenderTargetForSubImage(subImage, view) {
        const lastSubImage = this._lastSubImages.get(view);
        let renderTargetTexture = this._renderTargetTextures.get(view.eye);
        const width = subImage.motionVectorTextureWidth;
        const height = subImage.motionVectorTextureHeight;
        if (!renderTargetTexture || lastSubImage?.textureWidth !== width || lastSubImage?.textureHeight != height) {
            renderTargetTexture = this._createRenderTargetTexture(width, height, null, subImage.motionVectorTexture, subImage.depthStencilTexture);
            this._renderTargetTextures.set(view.eye, renderTargetTexture);
            this._framebufferDimensions = {
                framebufferWidth: width,
                framebufferHeight: height,
            };
        }
        this._lastSubImages.set(view, subImage);
        return renderTargetTexture;
    }
    trySetViewportForView(viewport, view) {
        const subImage = this._lastSubImages.get(view) || this._getSubImageForView(view);
        if (subImage) {
            this._setViewportForSubImage(viewport, subImage);
            return true;
        }
        return false;
    }
    /**
     * Access the motion vector (which will turn on Space Warp)
     * @param view the view to access the motion vector texture for
     */
    accessMotionVector(view) {
        const subImage = this._getSubImageForView(view);
        if (subImage) {
            // Meta Quest Browser uses accessing these textures as a sign for turning on Space Warp
            subImage.motionVectorTexture;
            subImage.depthStencilTexture;
        }
    }
    getRenderTargetTextureForEye(_eye) {
        return null;
    }
    getRenderTargetTextureForView(view) {
        const subImage = this._getSubImageForView(view);
        if (subImage) {
            return this._getRenderTargetForSubImage(subImage, view);
        }
        return null;
    }
    dispose() {
        this._renderTargetTextures.forEach((rtt) => rtt.dispose());
        this._renderTargetTextures.clear();
    }
}
/**
 * the WebXR Space Warp feature.
 */
class WebXRSpaceWarp extends WebXRAbstractFeature {
    /**
     * constructor for the space warp feature
     * @param _xrSessionManager the xr session manager for this feature
     */
    constructor(_xrSessionManager) {
        super(_xrSessionManager);
        this._onAfterRenderObserver = null;
        this.dependsOn = [webXRFeaturesManager/* WebXRFeatureName */._.LAYERS];
        this.xrNativeFeatureName = "space-warp";
        this._xrSessionManager.scene.needsPreviousWorldMatrices = true;
    }
    /**
     * Attach this feature.
     * Will usually be called by the features manager.
     *
     * @returns true if successful.
     */
    attach() {
        if (!super.attach()) {
            return false;
        }
        const engine = this._xrSessionManager.scene.getEngine();
        this._glContext = engine._gl;
        this._xrWebGLBinding = new XRWebGLBinding(this._xrSessionManager.session, this._glContext);
        this.spaceWarpRTTProvider = new WebXRSpaceWarpRenderTargetTextureProvider(this._xrSessionManager.scene, this._xrSessionManager, this._xrWebGLBinding);
        this._onAfterRenderObserver = this._xrSessionManager.scene.onAfterRenderObservable.add(() => this._onAfterRender());
        return true;
    }
    detach() {
        this._xrSessionManager.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver);
        return super.detach();
    }
    _onAfterRender() {
        if (this.attached && this._renderTargetTexture) {
            this._renderTargetTexture.render(false, false);
        }
    }
    isCompatible() {
        return this._xrSessionManager.scene.getEngine().getCaps().colorBufferHalfFloat || false;
    }
    dispose() {
        super.dispose();
    }
    _onXRFrame(_xrFrame) {
        const pose = _xrFrame.getViewerPose(this._xrSessionManager.referenceSpace);
        if (!pose) {
            return;
        }
        // get the first view to which we will create a texture (or update it)
        const view = pose.views[0];
        this._renderTargetTexture = this._renderTargetTexture || this.spaceWarpRTTProvider.getRenderTargetTextureForView(view);
        this.spaceWarpRTTProvider.accessMotionVector(view);
    }
}
/**
 * The module's name
 */
WebXRSpaceWarp.Name = webXRFeaturesManager/* WebXRFeatureName */._.SPACE_WARP;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRSpaceWarp.Version = 1;
//register the plugin
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRSpaceWarp.Name, (xrSessionManager) => {
    return () => new WebXRSpaceWarp(xrSessionManager);
}, WebXRSpaceWarp.Version, false);
//# sourceMappingURL=WebXRSpaceWarp.js.map
;// ./node_modules/@babylonjs/core/XR/features/WebXRRawCameraAccess.js







/**
 * WebXR Feature for WebXR raw camera access
 * @since 6.31.0
 * @see https://immersive-web.github.io/raw-camera-access/
 */
class WebXRRawCameraAccess extends WebXRAbstractFeature {
    /**
     * Creates a new instance of the feature
     * @param _xrSessionManager the WebXRSessionManager
     * @param options options for the Feature
     */
    constructor(_xrSessionManager, options = {}) {
        super(_xrSessionManager);
        this.options = options;
        this._cachedInternalTextures = [];
        /**
         * This is an array of camera views
         * Note that mostly the array will contain a single view
         * If you want to know the order of the views, use the `viewIndex` array
         */
        this.texturesData = [];
        /**
         * If needed, this array will contain the eye definition of each texture in `texturesArray`
         */
        this.viewIndex = [];
        /**
         * If needed, this array will contain the camera's intrinsics
         * You can use this data to convert from camera space to screen space and vice versa
         */
        this.cameraIntrinsics = [];
        /**
         * An observable that will notify when the camera's textures are updated
         */
        this.onTexturesUpdatedObservable = new Misc_observable/* Observable */.cP();
        this.xrNativeFeatureName = "camera-access";
    }
    attach(force) {
        if (!super.attach(force)) {
            return false;
        }
        this._glContext = this._xrSessionManager.scene.getEngine()._gl;
        this._glBinding = new XRWebGLBinding(this._xrSessionManager.session, this._glContext);
        return true;
    }
    detach() {
        if (!super.detach()) {
            return false;
        }
        this._glBinding = undefined;
        if (!this.options.doNotDisposeOnDetach) {
            this._cachedInternalTextures.forEach((t) => t.dispose());
            this.texturesData.forEach((t) => t.dispose());
            this._cachedInternalTextures.length = 0;
            this.texturesData.length = 0;
            this.cameraIntrinsics.length = 0;
        }
        return true;
    }
    /**
     * Dispose this feature and all of the resources attached
     */
    dispose() {
        super.dispose();
        this.onTexturesUpdatedObservable.clear();
    }
    /**
     * @see https://github.com/immersive-web/raw-camera-access/blob/main/explainer.md
     * @param view the XRView to update
     * @param index the index of the view in the views array
     */
    _updateCameraIntrinsics(view, index) {
        const cameraViewport = {
            width: view.camera.width,
            height: view.camera.height,
            x: 0,
            y: 0,
        };
        const p = view.projectionMatrix;
        // Principal point in pixels (typically at or near the center of the viewport)
        const u0 = ((1 - p[8]) * cameraViewport.width) / 2 + cameraViewport.x;
        const v0 = ((1 - p[9]) * cameraViewport.height) / 2 + cameraViewport.y;
        // Focal lengths in pixels (these are equal for square pixels)
        const ax = (cameraViewport.width / 2) * p[0];
        const ay = (cameraViewport.height / 2) * p[5];
        // Skew factor in pixels (nonzero for rhomboid pixels)
        const gamma = (cameraViewport.width / 2) * p[4];
        this.cameraIntrinsics[index] = {
            u0,
            v0,
            ax,
            ay,
            gamma,
            width: cameraViewport.width,
            height: cameraViewport.height,
            viewportX: cameraViewport.x,
            viewportY: cameraViewport.y,
        };
    }
    _updateInternalTextures(view, index = 0) {
        if (!view.camera) {
            return false;
        }
        this.viewIndex[index] = view.eye;
        const lp = this._glBinding?.getCameraImage(view.camera);
        if (!this._cachedInternalTextures[index]) {
            const internalTexture = new Textures_internalTexture/* InternalTexture */.hV(this._xrSessionManager.scene.getEngine(), 0 /* InternalTextureSource.Unknown */, true);
            internalTexture.invertY = false;
            internalTexture.format = 5;
            internalTexture.generateMipMaps = true;
            internalTexture.type = 0;
            internalTexture.samplingMode = 3;
            internalTexture.width = view.camera.width;
            internalTexture.height = view.camera.height;
            internalTexture._cachedWrapU = 1;
            internalTexture._cachedWrapV = 1;
            internalTexture._hardwareTexture = new webGLHardwareTexture/* WebGLHardwareTexture */.d(lp, this._glContext);
            this._cachedInternalTextures[index] = internalTexture;
            // create the base texture
            const texture = new baseTexture/* BaseTexture */.t(this._xrSessionManager.scene);
            texture.name = `WebXR Raw Camera Access (${index})`;
            texture._texture = this._cachedInternalTextures[index];
            this.texturesData[index] = texture;
            // get the camera intrinsics
            this._updateCameraIntrinsics(view, index);
        }
        else {
            // make sure the webgl texture is updated. Should happen automatically
            this._cachedInternalTextures[index]._hardwareTexture?.set(lp);
        }
        this._cachedInternalTextures[index].isReady = true;
        return true;
    }
    _onXRFrame(_xrFrame) {
        const referenceSPace = this._xrSessionManager.referenceSpace;
        const pose = _xrFrame.getViewerPose(referenceSPace);
        if (!pose || !pose.views) {
            return;
        }
        let updated = true;
        pose.views.forEach((view, index) => {
            updated = updated && this._updateInternalTextures(view, index);
        });
        if (updated) {
            this.onTexturesUpdatedObservable.notifyObservers(this.texturesData);
        }
    }
}
/**
 * The module's name
 */
WebXRRawCameraAccess.Name = webXRFeaturesManager/* WebXRFeatureName */._.RAW_CAMERA_ACCESS;
/**
 * The (Babylon) version of this module.
 * This is an integer representing the implementation version.
 * This number does not correspond to the WebXR specs version
 */
WebXRRawCameraAccess.Version = 1;
webXRFeaturesManager/* WebXRFeaturesManager */.n.AddWebXRFeature(WebXRRawCameraAccess.Name, (xrSessionManager, options) => {
    return () => new WebXRRawCameraAccess(xrSessionManager, options);
}, WebXRRawCameraAccess.Version, false);
//# sourceMappingURL=WebXRRawCameraAccess.js.map
;// ./node_modules/@babylonjs/core/XR/features/index.js























//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/XR/motionController/webXRGenericHandController.js


/**
 * A generic hand controller class that supports select and a secondary grasp
 */
class WebXRGenericHandController extends WebXRAbstractMotionController {
    /**
     * Create a new hand controller object, without loading a controller model
     * @param scene the scene to use to create this controller
     * @param gamepadObject the corresponding gamepad object
     * @param handedness the handedness of the controller
     */
    constructor(scene, gamepadObject, handedness) {
        // Don't load the controller model - for now, hands have no real model.
        super(scene, GenericHandSelectGraspProfile[handedness], gamepadObject, handedness, true);
        this.profileId = "generic-hand-select-grasp";
    }
    _getFilenameAndPath() {
        return {
            filename: "generic.babylon",
            path: "https://controllers.babylonjs.com/generic/",
        };
    }
    _getModelLoadingConstraints() {
        return true;
    }
    _processLoadedModel(_meshes) {
        // no-op
    }
    _setRootMesh(meshes) {
        // no-op
    }
    _updateModel() {
        // no-op
    }
}
// register the profiles
WebXRMotionControllerManager.RegisterController("generic-hand-select-grasp", (xrInput, scene) => {
    return new WebXRGenericHandController(scene, xrInput.gamepad, xrInput.handedness);
});
// https://github.com/immersive-web/webxr-input-profiles/blob/main/packages/registry/profiles/generic/generic-hand-select-grasp.json
const GenericHandSelectGraspProfile = {
    left: {
        selectComponentId: "xr-standard-trigger",
        components: {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr-standard-trigger",
                visualResponses: {},
            },
            grasp: {
                type: "trigger",
                gamepadIndices: {
                    button: 4,
                },
                rootNodeName: "grasp",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "generic-hand-select-grasp-left",
        assetPath: "left.glb",
    },
    right: {
        selectComponentId: "xr-standard-trigger",
        components: {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr-standard-trigger",
                visualResponses: {},
            },
            grasp: {
                type: "trigger",
                gamepadIndices: {
                    button: 4,
                },
                rootNodeName: "grasp",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "generic-hand-select-grasp-right",
        assetPath: "right.glb",
    },
    none: {
        selectComponentId: "xr-standard-trigger",
        components: {
            // eslint-disable-next-line @typescript-eslint/naming-convention
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr-standard-trigger",
                visualResponses: {},
            },
            grasp: {
                type: "trigger",
                gamepadIndices: {
                    button: 4,
                },
                rootNodeName: "grasp",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "generic-hand-select-grasp-none",
        assetPath: "none.glb",
    },
};
//# sourceMappingURL=webXRGenericHandController.js.map
;// ./node_modules/@babylonjs/core/XR/motionController/webXRMicrosoftMixedRealityController.js






/**
 * The motion controller class for all microsoft mixed reality controllers
 */
class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
    constructor(scene, gamepadObject, handedness) {
        super(scene, MixedRealityProfile["left-right"], gamepadObject, handedness);
        // use this in the future - https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/assets/profiles/microsoft
        this._mapping = {
            defaultButton: {
                valueNodeName: "VALUE",
                unpressedNodeName: "UNPRESSED",
                pressedNodeName: "PRESSED",
            },
            defaultAxis: {
                valueNodeName: "VALUE",
                minNodeName: "MIN",
                maxNodeName: "MAX",
            },
            buttons: {
                "xr-standard-trigger": {
                    rootNodeName: "SELECT",
                    componentProperty: "button",
                    states: ["default", "touched", "pressed"],
                },
                "xr-standard-squeeze": {
                    rootNodeName: "GRASP",
                    componentProperty: "state",
                    states: ["pressed"],
                },
                "xr-standard-touchpad": {
                    rootNodeName: "TOUCHPAD_PRESS",
                    labelAnchorNodeName: "squeeze-label",
                    touchPointNodeName: "TOUCH", // TODO - use this for visual feedback
                },
                "xr-standard-thumbstick": {
                    rootNodeName: "THUMBSTICK_PRESS",
                    componentProperty: "state",
                    states: ["pressed"],
                },
            },
            axes: {
                "xr-standard-touchpad": {
                    "x-axis": {
                        rootNodeName: "TOUCHPAD_TOUCH_X",
                    },
                    "y-axis": {
                        rootNodeName: "TOUCHPAD_TOUCH_Y",
                    },
                },
                "xr-standard-thumbstick": {
                    "x-axis": {
                        rootNodeName: "THUMBSTICK_X",
                    },
                    "y-axis": {
                        rootNodeName: "THUMBSTICK_Y",
                    },
                },
            },
        };
        this.profileId = "microsoft-mixed-reality";
    }
    _getFilenameAndPath() {
        let filename = "";
        if (this.handedness === "left") {
            filename = WebXRMicrosoftMixedRealityController.MODEL_LEFT_FILENAME;
        }
        else {
            // Right is the default if no hand is specified
            filename = WebXRMicrosoftMixedRealityController.MODEL_RIGHT_FILENAME;
        }
        const device = "default";
        const path = WebXRMicrosoftMixedRealityController.MODEL_BASE_URL + device + "/";
        return {
            filename,
            path,
        };
    }
    _getModelLoadingConstraints() {
        const glbLoaded = sceneLoader/* SceneLoader */.cn.IsPluginForExtensionAvailable(".glb");
        if (!glbLoaded) {
            logger/* Logger */.V.Warn("glTF / glb loaded was not registered, using generic controller instead");
        }
        return glbLoaded;
    }
    _processLoadedModel(_meshes) {
        if (!this.rootMesh) {
            return;
        }
        // Button Meshes
        this.getComponentIds().forEach((id, i) => {
            if (this.disableAnimation) {
                return;
            }
            if (id && this.rootMesh) {
                const buttonMap = this._mapping.buttons[id];
                const buttonMeshName = buttonMap.rootNodeName;
                if (!buttonMeshName) {
                    logger/* Logger */.V.Log("Skipping unknown button at index: " + i + " with mapped name: " + id);
                    return;
                }
                const buttonMesh = this._getChildByName(this.rootMesh, buttonMeshName);
                if (!buttonMesh) {
                    logger/* Logger */.V.Warn("Missing button mesh with name: " + buttonMeshName);
                    return;
                }
                buttonMap.valueMesh = this._getImmediateChildByName(buttonMesh, this._mapping.defaultButton.valueNodeName);
                buttonMap.pressedMesh = this._getImmediateChildByName(buttonMesh, this._mapping.defaultButton.pressedNodeName);
                buttonMap.unpressedMesh = this._getImmediateChildByName(buttonMesh, this._mapping.defaultButton.unpressedNodeName);
                if (buttonMap.valueMesh && buttonMap.pressedMesh && buttonMap.unpressedMesh) {
                    const comp = this.getComponent(id);
                    if (comp) {
                        comp.onButtonStateChangedObservable.add((component) => {
                            this._lerpTransform(buttonMap, component.value);
                        }, undefined, true);
                    }
                }
                else {
                    // If we didn't find the mesh, it simply means this button won't have transforms applied as mapped button value changes.
                    logger/* Logger */.V.Warn("Missing button submesh under mesh with name: " + buttonMeshName);
                }
            }
        });
        // Axis Meshes
        this.getComponentIds().forEach((id) => {
            const comp = this.getComponent(id);
            if (!comp.isAxes()) {
                return;
            }
            ["x-axis", "y-axis"].forEach((axis) => {
                if (!this.rootMesh) {
                    return;
                }
                const axisMap = this._mapping.axes[id][axis];
                const axisMesh = this._getChildByName(this.rootMesh, axisMap.rootNodeName);
                if (!axisMesh) {
                    logger/* Logger */.V.Warn("Missing axis mesh with name: " + axisMap.rootNodeName);
                    return;
                }
                axisMap.valueMesh = this._getImmediateChildByName(axisMesh, this._mapping.defaultAxis.valueNodeName);
                axisMap.minMesh = this._getImmediateChildByName(axisMesh, this._mapping.defaultAxis.minNodeName);
                axisMap.maxMesh = this._getImmediateChildByName(axisMesh, this._mapping.defaultAxis.maxNodeName);
                if (axisMap.valueMesh && axisMap.minMesh && axisMap.maxMesh) {
                    if (comp) {
                        comp.onAxisValueChangedObservable.add((axisValues) => {
                            const value = axis === "x-axis" ? axisValues.x : axisValues.y;
                            this._lerpTransform(axisMap, value, true);
                        }, undefined, true);
                    }
                }
                else {
                    // If we didn't find the mesh, it simply means this button won't have transforms applied as mapped button value changes.
                    logger/* Logger */.V.Warn("Missing axis submesh under mesh with name: " + axisMap.rootNodeName);
                }
            });
        });
    }
    _setRootMesh(meshes) {
        this.rootMesh = new Meshes_mesh/* Mesh */.e(this.profileId + " " + this.handedness, this.scene);
        this.rootMesh.isPickable = false;
        let rootMesh;
        // Find the root node in the loaded glTF scene, and attach it as a child of 'parentMesh'
        for (let i = 0; i < meshes.length; i++) {
            const mesh = meshes[i];
            mesh.isPickable = false;
            if (!mesh.parent) {
                // Handle root node, attach to the new parentMesh
                rootMesh = mesh;
            }
        }
        if (rootMesh) {
            rootMesh.setParent(this.rootMesh);
        }
        if (!this.scene.useRightHandedSystem) {
            this.rootMesh.rotationQuaternion = math_vector/* Quaternion */.PT.FromEulerAngles(0, Math.PI, 0);
        }
    }
    _updateModel() {
        // no-op. model is updated using observables.
    }
}
/**
 * The base url used to load the left and right controller models
 */
WebXRMicrosoftMixedRealityController.MODEL_BASE_URL = "https://controllers.babylonjs.com/microsoft/";
/**
 * The name of the left controller model file
 */
WebXRMicrosoftMixedRealityController.MODEL_LEFT_FILENAME = "left.glb";
/**
 * The name of the right controller model file
 */
WebXRMicrosoftMixedRealityController.MODEL_RIGHT_FILENAME = "right.glb";
// register the profile
WebXRMotionControllerManager.RegisterController("windows-mixed-reality", (xrInput, scene) => {
    return new WebXRMicrosoftMixedRealityController(scene, xrInput.gamepad, xrInput.handedness);
});
// https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/microsoft/microsoft-mixed-reality.json
const MixedRealityProfile = {
    left: {
        selectComponentId: "xr-standard-trigger",
        components: {
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {
                    xr_standard_trigger_pressed: {
                        componentProperty: "button",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_trigger_pressed_value",
                        minNodeName: "xr_standard_trigger_pressed_min",
                        maxNodeName: "xr_standard_trigger_pressed_max",
                    },
                },
            },
            "xr-standard-squeeze": {
                type: "squeeze",
                gamepadIndices: {
                    button: 1,
                },
                rootNodeName: "xr_standard_squeeze",
                visualResponses: {
                    xr_standard_squeeze_pressed: {
                        componentProperty: "button",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_squeeze_pressed_value",
                        minNodeName: "xr_standard_squeeze_pressed_min",
                        maxNodeName: "xr_standard_squeeze_pressed_max",
                    },
                },
            },
            "xr-standard-touchpad": {
                type: "touchpad",
                gamepadIndices: {
                    button: 2,
                    xAxis: 0,
                    yAxis: 1,
                },
                rootNodeName: "xr_standard_touchpad",
                visualResponses: {
                    xr_standard_touchpad_pressed: {
                        componentProperty: "button",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_pressed_value",
                        minNodeName: "xr_standard_touchpad_pressed_min",
                        maxNodeName: "xr_standard_touchpad_pressed_max",
                    },
                    xr_standard_touchpad_xaxis_pressed: {
                        componentProperty: "xAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_xaxis_pressed_value",
                        minNodeName: "xr_standard_touchpad_xaxis_pressed_min",
                        maxNodeName: "xr_standard_touchpad_xaxis_pressed_max",
                    },
                    xr_standard_touchpad_yaxis_pressed: {
                        componentProperty: "yAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_yaxis_pressed_value",
                        minNodeName: "xr_standard_touchpad_yaxis_pressed_min",
                        maxNodeName: "xr_standard_touchpad_yaxis_pressed_max",
                    },
                    xr_standard_touchpad_xaxis_touched: {
                        componentProperty: "xAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_xaxis_touched_value",
                        minNodeName: "xr_standard_touchpad_xaxis_touched_min",
                        maxNodeName: "xr_standard_touchpad_xaxis_touched_max",
                    },
                    xr_standard_touchpad_yaxis_touched: {
                        componentProperty: "yAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_yaxis_touched_value",
                        minNodeName: "xr_standard_touchpad_yaxis_touched_min",
                        maxNodeName: "xr_standard_touchpad_yaxis_touched_max",
                    },
                    xr_standard_touchpad_axes_touched: {
                        componentProperty: "state",
                        states: ["touched", "pressed"],
                        valueNodeProperty: "visibility",
                        valueNodeName: "xr_standard_touchpad_axes_touched_value",
                    },
                },
                touchPointNodeName: "xr_standard_touchpad_axes_touched_value",
            },
            "xr-standard-thumbstick": {
                type: "thumbstick",
                gamepadIndices: {
                    button: 3,
                    xAxis: 2,
                    yAxis: 3,
                },
                rootNodeName: "xr_standard_thumbstick",
                visualResponses: {
                    xr_standard_thumbstick_pressed: {
                        componentProperty: "button",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_thumbstick_pressed_value",
                        minNodeName: "xr_standard_thumbstick_pressed_min",
                        maxNodeName: "xr_standard_thumbstick_pressed_max",
                    },
                    xr_standard_thumbstick_xaxis_pressed: {
                        componentProperty: "xAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value",
                        minNodeName: "xr_standard_thumbstick_xaxis_pressed_min",
                        maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max",
                    },
                    xr_standard_thumbstick_yaxis_pressed: {
                        componentProperty: "yAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value",
                        minNodeName: "xr_standard_thumbstick_yaxis_pressed_min",
                        maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max",
                    },
                },
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "microsoft-mixed-reality-left",
        assetPath: "left.glb",
    },
    right: {
        selectComponentId: "xr-standard-trigger",
        components: {
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {
                    xr_standard_trigger_pressed: {
                        componentProperty: "button",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_trigger_pressed_value",
                        minNodeName: "xr_standard_trigger_pressed_min",
                        maxNodeName: "xr_standard_trigger_pressed_max",
                    },
                },
            },
            "xr-standard-squeeze": {
                type: "squeeze",
                gamepadIndices: {
                    button: 1,
                },
                rootNodeName: "xr_standard_squeeze",
                visualResponses: {
                    xr_standard_squeeze_pressed: {
                        componentProperty: "button",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_squeeze_pressed_value",
                        minNodeName: "xr_standard_squeeze_pressed_min",
                        maxNodeName: "xr_standard_squeeze_pressed_max",
                    },
                },
            },
            "xr-standard-touchpad": {
                type: "touchpad",
                gamepadIndices: {
                    button: 2,
                    xAxis: 0,
                    yAxis: 1,
                },
                rootNodeName: "xr_standard_touchpad",
                visualResponses: {
                    xr_standard_touchpad_pressed: {
                        componentProperty: "button",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_pressed_value",
                        minNodeName: "xr_standard_touchpad_pressed_min",
                        maxNodeName: "xr_standard_touchpad_pressed_max",
                    },
                    xr_standard_touchpad_xaxis_pressed: {
                        componentProperty: "xAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_xaxis_pressed_value",
                        minNodeName: "xr_standard_touchpad_xaxis_pressed_min",
                        maxNodeName: "xr_standard_touchpad_xaxis_pressed_max",
                    },
                    xr_standard_touchpad_yaxis_pressed: {
                        componentProperty: "yAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_yaxis_pressed_value",
                        minNodeName: "xr_standard_touchpad_yaxis_pressed_min",
                        maxNodeName: "xr_standard_touchpad_yaxis_pressed_max",
                    },
                    xr_standard_touchpad_xaxis_touched: {
                        componentProperty: "xAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_xaxis_touched_value",
                        minNodeName: "xr_standard_touchpad_xaxis_touched_min",
                        maxNodeName: "xr_standard_touchpad_xaxis_touched_max",
                    },
                    xr_standard_touchpad_yaxis_touched: {
                        componentProperty: "yAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_touchpad_yaxis_touched_value",
                        minNodeName: "xr_standard_touchpad_yaxis_touched_min",
                        maxNodeName: "xr_standard_touchpad_yaxis_touched_max",
                    },
                    xr_standard_touchpad_axes_touched: {
                        componentProperty: "state",
                        states: ["touched", "pressed"],
                        valueNodeProperty: "visibility",
                        valueNodeName: "xr_standard_touchpad_axes_touched_value",
                    },
                },
                touchPointNodeName: "xr_standard_touchpad_axes_touched_value",
            },
            "xr-standard-thumbstick": {
                type: "thumbstick",
                gamepadIndices: {
                    button: 3,
                    xAxis: 2,
                    yAxis: 3,
                },
                rootNodeName: "xr_standard_thumbstick",
                visualResponses: {
                    xr_standard_thumbstick_pressed: {
                        componentProperty: "button",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_thumbstick_pressed_value",
                        minNodeName: "xr_standard_thumbstick_pressed_min",
                        maxNodeName: "xr_standard_thumbstick_pressed_max",
                    },
                    xr_standard_thumbstick_xaxis_pressed: {
                        componentProperty: "xAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value",
                        minNodeName: "xr_standard_thumbstick_xaxis_pressed_min",
                        maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max",
                    },
                    xr_standard_thumbstick_yaxis_pressed: {
                        componentProperty: "yAxis",
                        states: ["default", "touched", "pressed"],
                        valueNodeProperty: "transform",
                        valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value",
                        minNodeName: "xr_standard_thumbstick_yaxis_pressed_min",
                        maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max",
                    },
                },
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "microsoft-mixed-reality-right",
        assetPath: "right.glb",
    },
};
//# sourceMappingURL=webXRMicrosoftMixedRealityController.js.map
;// ./node_modules/@babylonjs/core/XR/motionController/webXROculusTouchMotionController.js




/**
 * The motion controller class for oculus touch (quest, rift).
 * This class supports legacy mapping as well the standard xr mapping
 */
class WebXROculusTouchMotionController extends WebXRAbstractMotionController {
    constructor(scene, gamepadObject, handedness, _legacyMapping = false, _forceLegacyControllers = false) {
        super(scene, OculusTouchLayouts[handedness], gamepadObject, handedness);
        this._forceLegacyControllers = _forceLegacyControllers;
        this.profileId = "oculus-touch";
    }
    _getFilenameAndPath() {
        let filename = "";
        if (this.handedness === "left") {
            filename = WebXROculusTouchMotionController.MODEL_LEFT_FILENAME;
        }
        else {
            // Right is the default if no hand is specified
            filename = WebXROculusTouchMotionController.MODEL_RIGHT_FILENAME;
        }
        const path = this._isQuest() ? WebXROculusTouchMotionController.QUEST_MODEL_BASE_URL : WebXROculusTouchMotionController.MODEL_BASE_URL;
        return {
            filename,
            path,
        };
    }
    _getModelLoadingConstraints() {
        return true;
    }
    _processLoadedModel(_meshes) {
        const isQuest = this._isQuest();
        const triggerDirection = this.handedness === "right" ? -1 : 1;
        this.getComponentIds().forEach((id) => {
            const comp = id && this.getComponent(id);
            if (comp) {
                comp.onButtonStateChangedObservable.add((component) => {
                    if (!this.rootMesh || this.disableAnimation) {
                        return;
                    }
                    switch (id) {
                        case "xr-standard-trigger": // index trigger
                            if (!isQuest) {
                                this._modelRootNode.getChildren()[3].rotation.x = -component.value * 0.2;
                                this._modelRootNode.getChildren()[3].position.y = -component.value * 0.005;
                                this._modelRootNode.getChildren()[3].position.z = -component.value * 0.005;
                            }
                            return;
                        case "xr-standard-squeeze": // secondary trigger
                            if (!isQuest) {
                                this._modelRootNode.getChildren()[4].position.x = triggerDirection * component.value * 0.0035;
                            }
                            return;
                        case "xr-standard-thumbstick": // thumbstick
                            return;
                        case "a-button":
                        case "x-button":
                            if (!isQuest) {
                                if (component.pressed) {
                                    this._modelRootNode.getChildren()[1].position.y = -0.001;
                                }
                                else {
                                    this._modelRootNode.getChildren()[1].position.y = 0;
                                }
                            }
                            return;
                        case "b-button":
                        case "y-button":
                            if (!isQuest) {
                                if (component.pressed) {
                                    this._modelRootNode.getChildren()[2].position.y = -0.001;
                                }
                                else {
                                    this._modelRootNode.getChildren()[2].position.y = 0;
                                }
                            }
                            return;
                    }
                }, undefined, true);
            }
        });
    }
    _setRootMesh(meshes) {
        this.rootMesh = new Meshes_mesh/* Mesh */.e(this.profileId + " " + this.handedness, this.scene);
        if (!this.scene.useRightHandedSystem) {
            this.rootMesh.rotationQuaternion = math_vector/* Quaternion */.PT.FromEulerAngles(0, Math.PI, 0);
        }
        meshes.forEach((mesh) => {
            mesh.isPickable = false;
        });
        if (this._isQuest()) {
            this._modelRootNode = meshes[0];
        }
        else {
            this._modelRootNode = meshes[1];
            this.rootMesh.position.y = 0.034;
            this.rootMesh.position.z = 0.052;
        }
        this._modelRootNode.parent = this.rootMesh;
    }
    _updateModel() {
        // no-op. model is updated using observables.
    }
    /**
     * Is this the new type of oculus touch. At the moment both have the same profile and it is impossible to differentiate
     * between the touch and touch 2.
     * @returns true if this is the new type of oculus touch controllers.
     */
    _isQuest() {
        // this is SADLY the only way to currently check. Until proper profiles will be available.
        return !!navigator.userAgent.match(/Quest/gi) && !this._forceLegacyControllers;
    }
}
/**
 * The base url used to load the left and right controller models
 */
WebXROculusTouchMotionController.MODEL_BASE_URL = "https://controllers.babylonjs.com/oculus/";
/**
 * The name of the left controller model file
 */
WebXROculusTouchMotionController.MODEL_LEFT_FILENAME = "left.babylon";
/**
 * The name of the right controller model file
 */
WebXROculusTouchMotionController.MODEL_RIGHT_FILENAME = "right.babylon";
/**
 * Base Url for the Quest controller model.
 */
WebXROculusTouchMotionController.QUEST_MODEL_BASE_URL = "https://controllers.babylonjs.com/oculusQuest/";
// register the profile
WebXRMotionControllerManager.RegisterController("oculus-touch", (xrInput, scene) => {
    return new WebXROculusTouchMotionController(scene, xrInput.gamepad, xrInput.handedness);
});
WebXRMotionControllerManager.RegisterController("oculus-touch-legacy", (xrInput, scene) => {
    return new WebXROculusTouchMotionController(scene, xrInput.gamepad, xrInput.handedness, true);
});
const OculusTouchLayouts = {
    left: {
        selectComponentId: "xr-standard-trigger",
        components: {
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {},
            },
            "xr-standard-squeeze": {
                type: "squeeze",
                gamepadIndices: {
                    button: 1,
                },
                rootNodeName: "xr_standard_squeeze",
                visualResponses: {},
            },
            "xr-standard-thumbstick": {
                type: "thumbstick",
                gamepadIndices: {
                    button: 3,
                    xAxis: 2,
                    yAxis: 3,
                },
                rootNodeName: "xr_standard_thumbstick",
                visualResponses: {},
            },
            "x-button": {
                type: "button",
                gamepadIndices: {
                    button: 4,
                },
                rootNodeName: "x_button",
                visualResponses: {},
            },
            "y-button": {
                type: "button",
                gamepadIndices: {
                    button: 5,
                },
                rootNodeName: "y_button",
                visualResponses: {},
            },
            thumbrest: {
                type: "button",
                gamepadIndices: {
                    button: 6,
                },
                rootNodeName: "thumbrest",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "oculus-touch-v2-left",
        assetPath: "left.glb",
    },
    right: {
        selectComponentId: "xr-standard-trigger",
        components: {
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {},
            },
            "xr-standard-squeeze": {
                type: "squeeze",
                gamepadIndices: {
                    button: 1,
                },
                rootNodeName: "xr_standard_squeeze",
                visualResponses: {},
            },
            "xr-standard-thumbstick": {
                type: "thumbstick",
                gamepadIndices: {
                    button: 3,
                    xAxis: 2,
                    yAxis: 3,
                },
                rootNodeName: "xr_standard_thumbstick",
                visualResponses: {},
            },
            "a-button": {
                type: "button",
                gamepadIndices: {
                    button: 4,
                },
                rootNodeName: "a_button",
                visualResponses: {},
            },
            "b-button": {
                type: "button",
                gamepadIndices: {
                    button: 5,
                },
                rootNodeName: "b_button",
                visualResponses: {},
            },
            thumbrest: {
                type: "button",
                gamepadIndices: {
                    button: 6,
                },
                rootNodeName: "thumbrest",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "oculus-touch-v2-right",
        assetPath: "right.glb",
    },
};
//# sourceMappingURL=webXROculusTouchMotionController.js.map
;// ./node_modules/@babylonjs/core/XR/motionController/webXRHTCViveMotionController.js




/**
 * The motion controller class for the standard HTC-Vive controllers
 */
class WebXRHTCViveMotionController extends WebXRAbstractMotionController {
    /**
     * Create a new Vive motion controller object
     * @param scene the scene to use to create this controller
     * @param gamepadObject the corresponding gamepad object
     * @param handedness the handedness of the controller
     */
    constructor(scene, gamepadObject, handedness) {
        super(scene, HTCViveLayout[handedness], gamepadObject, handedness);
        this.profileId = "htc-vive";
    }
    _getFilenameAndPath() {
        const filename = WebXRHTCViveMotionController.MODEL_FILENAME;
        const path = WebXRHTCViveMotionController.MODEL_BASE_URL;
        return {
            filename,
            path,
        };
    }
    _getModelLoadingConstraints() {
        return true;
    }
    _processLoadedModel(_meshes) {
        this.getComponentIds().forEach((id) => {
            const comp = id && this.getComponent(id);
            if (comp) {
                comp.onButtonStateChangedObservable.add((component) => {
                    if (!this.rootMesh || this.disableAnimation) {
                        return;
                    }
                    switch (id) {
                        case "xr-standard-trigger":
                            this._modelRootNode.getChildren()[6].rotation.x = -component.value * 0.15;
                            return;
                        case "xr-standard-touchpad":
                            return;
                        case "xr-standard-squeeze":
                            return;
                    }
                }, undefined, true);
            }
        });
    }
    _setRootMesh(meshes) {
        this.rootMesh = new Meshes_mesh/* Mesh */.e(this.profileId + " " + this.handedness, this.scene);
        meshes.forEach((mesh) => {
            mesh.isPickable = false;
        });
        this._modelRootNode = meshes[1];
        this._modelRootNode.parent = this.rootMesh;
        if (!this.scene.useRightHandedSystem) {
            this.rootMesh.rotationQuaternion = math_vector/* Quaternion */.PT.FromEulerAngles(0, Math.PI, 0);
        }
    }
    _updateModel() {
        // no-op. model is updated using observables.
    }
}
/**
 * The base url used to load the left and right controller models
 */
WebXRHTCViveMotionController.MODEL_BASE_URL = "https://controllers.babylonjs.com/vive/";
/**
 * File name for the controller model.
 */
WebXRHTCViveMotionController.MODEL_FILENAME = "wand.babylon";
// register the profile
WebXRMotionControllerManager.RegisterController("htc-vive", (xrInput, scene) => {
    return new WebXRHTCViveMotionController(scene, xrInput.gamepad, xrInput.handedness);
});
// WebXRMotionControllerManager.RegisterController("htc-vive-legacy", (xrInput: XRInputSource, scene: Scene) => {
//     return new WebXRHTCViveMotionController(scene, <any>(xrInput.gamepad), xrInput.handedness, true);
// });
const HTCViveLayout = {
    left: {
        selectComponentId: "xr-standard-trigger",
        components: {
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {},
            },
            "xr-standard-squeeze": {
                type: "squeeze",
                gamepadIndices: {
                    button: 1,
                },
                rootNodeName: "xr_standard_squeeze",
                visualResponses: {},
            },
            "xr-standard-touchpad": {
                type: "touchpad",
                gamepadIndices: {
                    button: 2,
                    xAxis: 0,
                    yAxis: 1,
                },
                rootNodeName: "xr_standard_touchpad",
                visualResponses: {},
            },
            menu: {
                type: "button",
                gamepadIndices: {
                    button: 4,
                },
                rootNodeName: "menu",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "htc_vive_none",
        assetPath: "none.glb",
    },
    right: {
        selectComponentId: "xr-standard-trigger",
        components: {
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {},
            },
            "xr-standard-squeeze": {
                type: "squeeze",
                gamepadIndices: {
                    button: 1,
                },
                rootNodeName: "xr_standard_squeeze",
                visualResponses: {},
            },
            "xr-standard-touchpad": {
                type: "touchpad",
                gamepadIndices: {
                    button: 2,
                    xAxis: 0,
                    yAxis: 1,
                },
                rootNodeName: "xr_standard_touchpad",
                visualResponses: {},
            },
            menu: {
                type: "button",
                gamepadIndices: {
                    button: 4,
                },
                rootNodeName: "menu",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "htc_vive_none",
        assetPath: "none.glb",
    },
    none: {
        selectComponentId: "xr-standard-trigger",
        components: {
            "xr-standard-trigger": {
                type: "trigger",
                gamepadIndices: {
                    button: 0,
                },
                rootNodeName: "xr_standard_trigger",
                visualResponses: {},
            },
            "xr-standard-squeeze": {
                type: "squeeze",
                gamepadIndices: {
                    button: 1,
                },
                rootNodeName: "xr_standard_squeeze",
                visualResponses: {},
            },
            "xr-standard-touchpad": {
                type: "touchpad",
                gamepadIndices: {
                    button: 2,
                    xAxis: 0,
                    yAxis: 1,
                },
                rootNodeName: "xr_standard_touchpad",
                visualResponses: {},
            },
            menu: {
                type: "button",
                gamepadIndices: {
                    button: 4,
                },
                rootNodeName: "menu",
                visualResponses: {},
            },
        },
        gamepadMapping: "xr-standard",
        rootNodeName: "htc-vive-none",
        assetPath: "none.glb",
    },
};
//# sourceMappingURL=webXRHTCViveMotionController.js.map
;// ./node_modules/@babylonjs/core/XR/motionController/index.js









//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/XR/native/nativeXRFrame.js

/** @internal */
class NativeXRFrame {
    get session() {
        return this._nativeImpl.session;
    }
    constructor(_nativeImpl) {
        this._nativeImpl = _nativeImpl;
        this._xrTransform = new XRRigidTransform();
        this._xrPose = {
            transform: this._xrTransform,
            emulatedPosition: false,
        };
        // Enough space for position, orientation
        this._xrPoseVectorData = new Float32Array(4 + 4);
        this.fillPoses = this._nativeImpl.fillPoses.bind(this._nativeImpl);
        this.getViewerPose = this._nativeImpl.getViewerPose.bind(this._nativeImpl);
        this.getHitTestResults = this._nativeImpl.getHitTestResults.bind(this._nativeImpl);
        this.getHitTestResultsForTransientInput = () => {
            throw new Error("XRFrame.getHitTestResultsForTransientInput not supported on native.");
        };
        this.createAnchor = this._nativeImpl.createAnchor.bind(this._nativeImpl);
        this.getJointPose = this._nativeImpl.getJointPose.bind(this._nativeImpl);
        this.fillJointRadii = this._nativeImpl.fillJointRadii.bind(this._nativeImpl);
        this.getLightEstimate = () => {
            throw new Error("XRFrame.getLightEstimate not supported on native.");
        };
        this.getImageTrackingResults = () => {
            return this._nativeImpl._imageTrackingResults ?? [];
        };
    }
    getPose(space, baseSpace) {
        if (!this._nativeImpl.getPoseData(space, baseSpace, this._xrPoseVectorData.buffer, this._xrTransform.matrix.buffer)) {
            return undefined;
        }
        const position = this._xrTransform.position;
        position.x = this._xrPoseVectorData[0];
        position.y = this._xrPoseVectorData[1];
        position.z = this._xrPoseVectorData[2];
        position.w = this._xrPoseVectorData[3];
        const orientation = this._xrTransform.orientation;
        orientation.x = this._xrPoseVectorData[4];
        orientation.y = this._xrPoseVectorData[5];
        orientation.z = this._xrPoseVectorData[6];
        orientation.w = this._xrPoseVectorData[7];
        return this._xrPose;
    }
    get trackedAnchors() {
        return this._nativeImpl.trackedAnchors;
    }
    get worldInformation() {
        return this._nativeImpl.worldInformation;
    }
    get detectedPlanes() {
        return this._nativeImpl.detectedPlanes;
    }
    get featurePointCloud() {
        return this._nativeImpl.featurePointCloud;
    }
    getDepthInformation(view) {
        throw new Error("This function is not available in Babylon Native");
        // return this._nativeImpl.getDepthInformation(view);
    }
}
RegisterNativeTypeAsync("NativeXRFrame", NativeXRFrame);
//# sourceMappingURL=nativeXRFrame.js.map
;// ./node_modules/@babylonjs/core/XR/native/index.js


//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/XR/index.js
/* eslint-disable import/no-internal-modules */














//# sourceMappingURL=index.js.map
;// ./node_modules/@babylonjs/core/index.js
/* eslint-disable import/no-internal-modules */















































//# sourceMappingURL=index.js.map

/***/ }),

/***/ 4870:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   b: () => (/* binding */ Node)
/* harmony export */ });
/* harmony import */ var _tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75524);
/* harmony import */ var _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79923);
/* harmony import */ var _Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79259);
/* harmony import */ var _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99848);
/* harmony import */ var _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6315);
/* harmony import */ var _Misc_devTools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45503);
/* harmony import */ var _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26877);







/** @internal */
class _InternalNodeDataInfo {
    constructor() {
        this._doNotSerialize = false;
        this._isDisposed = false;
        this._sceneRootNodesIndex = -1;
        this._isEnabled = true;
        this._isParentEnabled = true;
        this._isReady = true;
        this._onEnabledStateChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .cP();
        this._onClonedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .cP();
    }
}
/**
 * Node is the basic class for all scene objects (Mesh, Light, Camera.)
 */
class Node {
    /**
     * Add a new node constructor
     * @param type defines the type name of the node to construct
     * @param constructorFunc defines the constructor function
     */
    static AddNodeConstructor(type, constructorFunc) {
        this._NodeConstructors[type] = constructorFunc;
    }
    /**
     * Returns a node constructor based on type name
     * @param type defines the type name
     * @param name defines the new node name
     * @param scene defines the hosting scene
     * @param options defines optional options to transmit to constructors
     * @returns the new constructor or null
     */
    static Construct(type, name, scene, options) {
        const constructorFunc = this._NodeConstructors[type];
        if (!constructorFunc) {
            return null;
        }
        return constructorFunc(name, scene, options);
    }
    /**
     * Gets or sets the accessibility tag to describe the node for accessibility purpose.
     */
    set accessibilityTag(value) {
        this._accessibilityTag = value;
        this.onAccessibilityTagChangedObservable.notifyObservers(value);
    }
    get accessibilityTag() {
        return this._accessibilityTag;
    }
    /**
     * Gets or sets a boolean used to define if the node must be serialized
     */
    get doNotSerialize() {
        if (this._nodeDataStorage._doNotSerialize) {
            return true;
        }
        if (this._parentNode) {
            return this._parentNode.doNotSerialize;
        }
        return false;
    }
    set doNotSerialize(value) {
        this._nodeDataStorage._doNotSerialize = value;
    }
    /**
     * Gets a boolean indicating if the node has been disposed
     * @returns true if the node was disposed
     */
    isDisposed() {
        return this._nodeDataStorage._isDisposed;
    }
    /**
     * Gets or sets the parent of the node (without keeping the current position in the scene)
     * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/parent
     */
    set parent(parent) {
        if (this._parentNode === parent) {
            return;
        }
        const previousParentNode = this._parentNode;
        // Remove self from list of children of parent
        if (this._parentNode && this._parentNode._children !== undefined && this._parentNode._children !== null) {
            const index = this._parentNode._children.indexOf(this);
            if (index !== -1) {
                this._parentNode._children.splice(index, 1);
            }
            if (!parent && !this._nodeDataStorage._isDisposed) {
                this._addToSceneRootNodes();
            }
        }
        // Store new parent
        this._parentNode = parent;
        this._isDirty = true;
        // Add as child to new parent
        if (this._parentNode) {
            if (this._parentNode._children === undefined || this._parentNode._children === null) {
                this._parentNode._children = new Array();
            }
            this._parentNode._children.push(this);
            if (!previousParentNode) {
                this._removeFromSceneRootNodes();
            }
        }
        // Enabled state
        this._syncParentEnabledState();
    }
    get parent() {
        return this._parentNode;
    }
    /**
     * @internal
     */
    _serializeAsParent(serializationObject) {
        serializationObject.parentId = this.uniqueId;
    }
    /** @internal */
    _addToSceneRootNodes() {
        if (this._nodeDataStorage._sceneRootNodesIndex === -1) {
            this._nodeDataStorage._sceneRootNodesIndex = this._scene.rootNodes.length;
            this._scene.rootNodes.push(this);
        }
    }
    /** @internal */
    _removeFromSceneRootNodes() {
        if (this._nodeDataStorage._sceneRootNodesIndex !== -1) {
            const rootNodes = this._scene.rootNodes;
            const lastIdx = rootNodes.length - 1;
            rootNodes[this._nodeDataStorage._sceneRootNodesIndex] = rootNodes[lastIdx];
            rootNodes[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex = this._nodeDataStorage._sceneRootNodesIndex;
            this._scene.rootNodes.pop();
            this._nodeDataStorage._sceneRootNodesIndex = -1;
        }
    }
    /**
     * Gets or sets the animation properties override
     */
    get animationPropertiesOverride() {
        if (!this._animationPropertiesOverride) {
            return this._scene.animationPropertiesOverride;
        }
        return this._animationPropertiesOverride;
    }
    set animationPropertiesOverride(value) {
        this._animationPropertiesOverride = value;
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "Node" string
     */
    getClassName() {
        return "Node";
    }
    /**
     * Sets a callback that will be raised when the node will be disposed
     */
    set onDispose(callback) {
        if (this._onDisposeObserver) {
            this.onDisposeObservable.remove(this._onDisposeObserver);
        }
        this._onDisposeObserver = this.onDisposeObservable.add(callback);
    }
    /**
     * An event triggered when the enabled state of the node changes
     */
    get onEnabledStateChangedObservable() {
        return this._nodeDataStorage._onEnabledStateChangedObservable;
    }
    /**
     * An event triggered when the node is cloned
     */
    get onClonedObservable() {
        return this._nodeDataStorage._onClonedObservable;
    }
    /**
     * Creates a new Node
     * @param name the name and id to be given to this node
     * @param scene the scene this node will be added to
     * @param isPure indicates this Node is just a Node, and not a derived class like Mesh or Camera
     */
    constructor(name, scene = null, isPure = true) {
        this._isDirty = false;
        this._nodeDataStorage = new _InternalNodeDataInfo();
        /**
         * Gets or sets a string used to store user defined state for the node
         */
        this.state = "";
        /**
         * Gets or sets an object used to store user defined information for the node
         */
        this.metadata = null;
        /**
         * For internal use only. Please do not use.
         */
        this.reservedDataStore = null;
        this._accessibilityTag = null;
        /**
         * Observable fired when an accessibility tag is changed
         */
        this.onAccessibilityTagChangedObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .cP();
        /** @internal */
        this._parentContainer = null;
        /**
         * Gets a list of Animations associated with the node
         */
        this.animations = [];
        this._ranges = {};
        /**
         * Callback raised when the node is ready to be used
         */
        this.onReady = null;
        /** @internal */
        this._currentRenderId = -1;
        this._parentUpdateId = -1;
        /** @internal */
        this._childUpdateId = -1;
        /** @internal */
        this._waitingParentId = null;
        /** @internal */
        this._waitingParentInstanceIndex = null;
        /** @internal */
        this._waitingParsedUniqueId = null;
        /** @internal */
        this._cache = {};
        this._parentNode = null;
        /** @internal */
        this._children = null;
        /** @internal */
        this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity();
        /** @internal */
        this._worldMatrixDeterminant = 0;
        /** @internal */
        this._worldMatrixDeterminantIsDirty = true;
        this._animationPropertiesOverride = null;
        /** @internal */
        this._isNode = true;
        /**
         * An event triggered when the mesh is disposed
         */
        this.onDisposeObservable = new _Misc_observable_js__WEBPACK_IMPORTED_MODULE_3__/* .Observable */ .cP();
        this._onDisposeObserver = null;
        // Behaviors
        this._behaviors = new Array();
        this.name = name;
        this.id = name;
        this._scene = (scene || _Engines_engineStore_js__WEBPACK_IMPORTED_MODULE_4__/* .EngineStore */ .q.LastCreatedScene);
        this.uniqueId = this._scene.getUniqueId();
        this._initCache();
        if (isPure) {
            this._addToSceneRootNodes();
        }
    }
    /**
     * Gets the scene of the node
     * @returns a scene
     */
    getScene() {
        return this._scene;
    }
    /**
     * Gets the engine of the node
     * @returns a Engine
     */
    getEngine() {
        return this._scene.getEngine();
    }
    /**
     * Attach a behavior to the node
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors
     * @param behavior defines the behavior to attach
     * @param attachImmediately defines that the behavior must be attached even if the scene is still loading
     * @returns the current Node
     */
    addBehavior(behavior, attachImmediately = false) {
        const index = this._behaviors.indexOf(behavior);
        if (index !== -1) {
            return this;
        }
        behavior.init();
        if (this._scene.isLoading && !attachImmediately) {
            // We defer the attach when the scene will be loaded
            this._scene.onDataLoadedObservable.addOnce(() => {
                behavior.attach(this);
            });
        }
        else {
            behavior.attach(this);
        }
        this._behaviors.push(behavior);
        return this;
    }
    /**
     * Remove an attached behavior
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors
     * @param behavior defines the behavior to attach
     * @returns the current Node
     */
    removeBehavior(behavior) {
        const index = this._behaviors.indexOf(behavior);
        if (index === -1) {
            return this;
        }
        this._behaviors[index].detach();
        this._behaviors.splice(index, 1);
        return this;
    }
    /**
     * Gets the list of attached behaviors
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors
     */
    get behaviors() {
        return this._behaviors;
    }
    /**
     * Gets an attached behavior by name
     * @param name defines the name of the behavior to look for
     * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors
     * @returns null if behavior was not found else the requested behavior
     */
    getBehaviorByName(name) {
        for (const behavior of this._behaviors) {
            if (behavior.name === name) {
                return behavior;
            }
        }
        return null;
    }
    /**
     * Returns the latest update of the World matrix
     * @returns a Matrix
     */
    getWorldMatrix() {
        if (this._currentRenderId !== this._scene.getRenderId()) {
            this.computeWorldMatrix();
        }
        return this._worldMatrix;
    }
    /** @internal */
    _getWorldMatrixDeterminant() {
        if (this._worldMatrixDeterminantIsDirty) {
            this._worldMatrixDeterminantIsDirty = false;
            this._worldMatrixDeterminant = this._worldMatrix.determinant();
        }
        return this._worldMatrixDeterminant;
    }
    /**
     * Returns directly the latest state of the mesh World matrix.
     * A Matrix is returned.
     */
    get worldMatrixFromCache() {
        return this._worldMatrix;
    }
    // override it in derived class if you add new variables to the cache
    // and call the parent class method
    /** @internal */
    _initCache() {
        this._cache = {};
    }
    /**
     * @internal
     */
    updateCache(force) {
        if (!force && this.isSynchronized()) {
            return;
        }
        this._updateCache();
    }
    /**
     * @internal
     */
    _getActionManagerForTrigger(trigger, _initialCall = true) {
        if (!this.parent) {
            return null;
        }
        return this.parent._getActionManagerForTrigger(trigger, false);
    }
    // override it in derived class if you add new variables to the cache
    // and call the parent class method if !ignoreParentClass
    /**
     * @internal
     */
    _updateCache(_ignoreParentClass) { }
    // override it in derived class if you add new variables to the cache
    /** @internal */
    _isSynchronized() {
        return true;
    }
    /** @internal */
    _markSyncedWithParent() {
        if (this._parentNode) {
            this._parentUpdateId = this._parentNode._childUpdateId;
        }
    }
    /** @internal */
    isSynchronizedWithParent() {
        if (!this._parentNode) {
            return true;
        }
        if (this._parentNode._isDirty || this._parentUpdateId !== this._parentNode._childUpdateId) {
            return false;
        }
        return this._parentNode.isSynchronized();
    }
    /** @internal */
    isSynchronized() {
        if (this._parentNode && !this.isSynchronizedWithParent()) {
            return false;
        }
        return this._isSynchronized();
    }
    /**
     * Is this node ready to be used/rendered
     * @param _completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
     * @returns true if the node is ready
     */
    isReady(_completeCheck = false) {
        return this._nodeDataStorage._isReady;
    }
    /**
     * Flag the  node as dirty (Forcing it to update everything)
     * @param _property helps children apply precise "dirtyfication"
     * @returns this node
     */
    markAsDirty(_property) {
        this._currentRenderId = Number.MAX_VALUE;
        this._isDirty = true;
        return this;
    }
    /**
     * Is this node enabled?
     * If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true
     * @param checkAncestors indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors
     * @returns whether this node (and its parent) is enabled
     */
    isEnabled(checkAncestors = true) {
        if (checkAncestors === false) {
            return this._nodeDataStorage._isEnabled;
        }
        if (!this._nodeDataStorage._isEnabled) {
            return false;
        }
        return this._nodeDataStorage._isParentEnabled;
    }
    /** @internal */
    _syncParentEnabledState() {
        this._nodeDataStorage._isParentEnabled = this._parentNode ? this._parentNode.isEnabled() : true;
        if (this._children) {
            this._children.forEach((c) => {
                c._syncParentEnabledState(); // Force children to update accordingly
            });
        }
    }
    /**
     * Set the enabled state of this node
     * @param value defines the new enabled state
     */
    setEnabled(value) {
        if (this._nodeDataStorage._isEnabled === value) {
            return;
        }
        this._nodeDataStorage._isEnabled = value;
        this._syncParentEnabledState();
        this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(value);
    }
    /**
     * Is this node a descendant of the given node?
     * The function will iterate up the hierarchy until the ancestor was found or no more parents defined
     * @param ancestor defines the parent node to inspect
     * @returns a boolean indicating if this node is a descendant of the given node
     */
    isDescendantOf(ancestor) {
        if (this.parent) {
            if (this.parent === ancestor) {
                return true;
            }
            return this.parent.isDescendantOf(ancestor);
        }
        return false;
    }
    /**
     * @internal
     */
    _getDescendants(results, directDescendantsOnly = false, predicate) {
        if (!this._children) {
            return;
        }
        for (let index = 0; index < this._children.length; index++) {
            const item = this._children[index];
            if (!predicate || predicate(item)) {
                results.push(item);
            }
            if (!directDescendantsOnly) {
                item._getDescendants(results, false, predicate);
            }
        }
    }
    /**
     * Will return all nodes that have this node 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
     * @returns all children nodes of all types
     */
    getDescendants(directDescendantsOnly, predicate) {
        const results = [];
        this._getDescendants(results, directDescendantsOnly, predicate);
        return results;
    }
    /**
     * Get all child-meshes of this node
     * @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 (Default: false)
     * @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
     * @returns an array of AbstractMesh
     */
    getChildMeshes(directDescendantsOnly, predicate) {
        const results = [];
        this._getDescendants(results, directDescendantsOnly, (node) => {
            return (!predicate || predicate(node)) && node.cullingStrategy !== undefined;
        });
        return results;
    }
    /**
     * Get all direct children of this node
     * @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
     * @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 (Default: true)
     * @returns an array of Node
     */
    getChildren(predicate, directDescendantsOnly = true) {
        return this.getDescendants(directDescendantsOnly, predicate);
    }
    /**
     * @internal
     */
    _setReady(state) {
        if (state === this._nodeDataStorage._isReady) {
            return;
        }
        if (!state) {
            this._nodeDataStorage._isReady = false;
            return;
        }
        if (this.onReady) {
            this.onReady(this);
        }
        this._nodeDataStorage._isReady = true;
    }
    /**
     * Get an animation by name
     * @param name defines the name of the animation to look for
     * @returns null if not found else the requested animation
     */
    getAnimationByName(name) {
        for (let i = 0; i < this.animations.length; i++) {
            const animation = this.animations[i];
            if (animation.name === name) {
                return animation;
            }
        }
        return null;
    }
    /**
     * Creates an animation range for this node
     * @param name defines the name of the range
     * @param from defines the starting key
     * @param to defines the end key
     */
    createAnimationRange(name, from, to) {
        // check name not already in use
        if (!this._ranges[name]) {
            this._ranges[name] = Node._AnimationRangeFactory(name, from, to);
            for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {
                if (this.animations[i]) {
                    this.animations[i].createRange(name, from, to);
                }
            }
        }
    }
    /**
     * Delete a specific animation range
     * @param name defines the name of the range to delete
     * @param deleteFrames defines if animation frames from the range must be deleted as well
     */
    deleteAnimationRange(name, deleteFrames = true) {
        for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {
            if (this.animations[i]) {
                this.animations[i].deleteRange(name, deleteFrames);
            }
        }
        this._ranges[name] = null; // said much faster than 'delete this._range[name]'
    }
    /**
     * Get an animation range by name
     * @param name defines the name of the animation range to look for
     * @returns null if not found else the requested animation range
     */
    getAnimationRange(name) {
        return this._ranges[name] || null;
    }
    /**
     * Clone the current node
     * @param name Name of the new clone
     * @param newParent New parent for the clone
     * @param doNotCloneChildren Do not clone children hierarchy
     * @returns the new transform node
     */
    clone(name, newParent, doNotCloneChildren) {
        const result = _Misc_decorators_serialization_js__WEBPACK_IMPORTED_MODULE_6__/* .SerializationHelper */ .p.Clone(() => new Node(name, this.getScene()), this);
        if (newParent) {
            result.parent = newParent;
        }
        if (!doNotCloneChildren) {
            // Children
            const directDescendants = this.getDescendants(true);
            for (let index = 0; index < directDescendants.length; index++) {
                const child = directDescendants[index];
                child.clone(name + "." + child.name, result);
            }
        }
        return result;
    }
    /**
     * Gets the list of all animation ranges defined on this node
     * @returns an array
     */
    getAnimationRanges() {
        const animationRanges = [];
        let name;
        for (name in this._ranges) {
            animationRanges.push(this._ranges[name]);
        }
        return animationRanges;
    }
    /**
     * Will start the animation sequence
     * @param name defines the range frames for animation sequence
     * @param loop defines if the animation should loop (false by default)
     * @param speedRatio defines the speed factor in which to run the animation (1 by default)
     * @param onAnimationEnd defines a function to be executed when the animation ended (undefined by default)
     * @returns the object created for this animation. If range does not exist, it will return null
     */
    beginAnimation(name, loop, speedRatio, onAnimationEnd) {
        const range = this.getAnimationRange(name);
        if (!range) {
            return null;
        }
        return this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd);
    }
    /**
     * Serialize animation ranges into a JSON compatible object
     * @returns serialization object
     */
    serializeAnimationRanges() {
        const serializationRanges = [];
        for (const name in this._ranges) {
            const localRange = this._ranges[name];
            if (!localRange) {
                continue;
            }
            const range = {};
            range.name = name;
            range.from = localRange.from;
            range.to = localRange.to;
            serializationRanges.push(range);
        }
        return serializationRanges;
    }
    /**
     * Computes the world matrix of the node
     * @param _force defines if the cache version should be invalidated forcing the world matrix to be created from scratch
     * @returns the world matrix
     */
    computeWorldMatrix(_force) {
        if (!this._worldMatrix) {
            this._worldMatrix = _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Matrix */ .uq.Identity();
        }
        return this._worldMatrix;
    }
    /**
     * Releases resources associated with this node.
     * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
     * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
     */
    dispose(doNotRecurse, disposeMaterialAndTextures = false) {
        this._nodeDataStorage._isDisposed = true;
        if (!doNotRecurse) {
            const nodes = this.getDescendants(true);
            for (const node of nodes) {
                node.dispose(doNotRecurse, disposeMaterialAndTextures);
            }
        }
        if (!this.parent) {
            this._removeFromSceneRootNodes();
        }
        else {
            this.parent = null;
        }
        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
        this.onEnabledStateChangedObservable.clear();
        this.onClonedObservable.clear();
        // Behaviors
        for (const behavior of this._behaviors) {
            behavior.detach();
        }
        this._behaviors.length = 0;
        this.metadata = null;
    }
    /**
     * Parse animation range data from a serialization object and store them into a given node
     * @param node defines where to store the animation ranges
     * @param parsedNode defines the serialization object to read data from
     * @param _scene defines the hosting scene
     */
    static ParseAnimationRanges(node, parsedNode, _scene) {
        if (parsedNode.ranges) {
            for (let index = 0; index < parsedNode.ranges.length; index++) {
                const data = parsedNode.ranges[index];
                node.createAnimationRange(data.name, data.from, data.to);
            }
        }
    }
    /**
     * Return the minimum and maximum world vectors of the entire hierarchy under current node
     * @param includeDescendants Include bounding info from descendants as well (true by default)
     * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
     * @returns the new bounding vectors
     */
    getHierarchyBoundingVectors(includeDescendants = true, predicate = null) {
        // Ensures that all world matrix will be recomputed.
        this.getScene().incrementRenderId();
        this.computeWorldMatrix(true);
        let min;
        let max;
        const thisAbstractMesh = this;
        if (thisAbstractMesh.getBoundingInfo && thisAbstractMesh.subMeshes) {
            // If this is an abstract mesh get its bounding info
            const boundingInfo = thisAbstractMesh.getBoundingInfo();
            min = boundingInfo.boundingBox.minimumWorld.clone();
            max = boundingInfo.boundingBox.maximumWorld.clone();
        }
        else {
            min = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
            max = new _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
        }
        if (includeDescendants) {
            const descendants = this.getDescendants(false);
            for (const descendant of descendants) {
                const childMesh = descendant;
                childMesh.computeWorldMatrix(true);
                // Filters meshes based on custom predicate function.
                if (predicate && !predicate(childMesh)) {
                    continue;
                }
                //make sure we have the needed params to get mix and max
                if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {
                    continue;
                }
                const childBoundingInfo = childMesh.getBoundingInfo();
                const boundingBox = childBoundingInfo.boundingBox;
                const minBox = boundingBox.minimumWorld;
                const maxBox = boundingBox.maximumWorld;
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CheckExtends(minBox, min, max);
                _Maths_math_vector_js__WEBPACK_IMPORTED_MODULE_1__/* .Vector3 */ .Pq.CheckExtends(maxBox, min, max);
            }
        }
        return {
            min: min,
            max: max,
        };
    }
}
/**
 * @internal
 */
Node._AnimationRangeFactory = (_name, _from, _to) => {
    throw (0,_Misc_devTools_js__WEBPACK_IMPORTED_MODULE_5__/* ._WarnImport */ .n)("AnimationRange");
};
Node._NodeConstructors = {};
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], Node.prototype, "name", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], Node.prototype, "id", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], Node.prototype, "uniqueId", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], Node.prototype, "state", void 0);
(0,_tslib_es6_js__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
    (0,_Misc_decorators_js__WEBPACK_IMPORTED_MODULE_2__/* .serialize */ .lK)()
], Node.prototype, "metadata", void 0);
//# sourceMappingURL=node.js.map

/***/ }),

/***/ 87491:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  Z: () => (/* binding */ Scene),
  F: () => (/* binding */ ScenePerformancePriority)
});

// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tools.js
var tools = __webpack_require__(998);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/precisionDate.js
var precisionDate = __webpack_require__(76237);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/observable.js
var observable = __webpack_require__(99848);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/smartArray.js
var smartArray = __webpack_require__(17931);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/stringDictionary.js
var stringDictionary = __webpack_require__(87216);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/tags.js
var tags = __webpack_require__(27152);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.vector.js
var math_vector = __webpack_require__(79923);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js
var imageProcessingConfiguration = __webpack_require__(32033);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Materials/uniformBuffer.js
var uniformBuffer = __webpack_require__(80935);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Collisions/pickingInfo.js
var pickingInfo = __webpack_require__(30311);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Actions/actionEvent.js
var actionEvent = __webpack_require__(61466);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/PostProcesses/postProcessManager.js
var postProcessManager = __webpack_require__(36096);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Rendering/renderingManager.js
var renderingManager = __webpack_require__(15808);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/sceneComponent.js
var sceneComponent = __webpack_require__(16945);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/domManagement.js
var domManagement = __webpack_require__(18790);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Engines/engineStore.js
var engineStore = __webpack_require__(6315);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/devTools.js
var devTools = __webpack_require__(45503);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/pointerEvents.js
var pointerEvents = __webpack_require__(66240);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Actions/abstractActionManager.js
var abstractActionManager = __webpack_require__(99451);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Events/keyboardEvents.js
var keyboardEvents = __webpack_require__(24146);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js
var deviceEnums = __webpack_require__(24153);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js + 4 modules
var deviceSourceManager = __webpack_require__(64100);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/import.helper.js
var import_helper = __webpack_require__(65877);
;// ./node_modules/@babylonjs/core/Inputs/scene.inputManager.js











/** @internal */
// eslint-disable-next-line @typescript-eslint/naming-convention
class _ClickInfo {
    constructor() {
        this._singleClick = false;
        this._doubleClick = false;
        this._hasSwiped = false;
        this._ignore = false;
    }
    get singleClick() {
        return this._singleClick;
    }
    get doubleClick() {
        return this._doubleClick;
    }
    get hasSwiped() {
        return this._hasSwiped;
    }
    get ignore() {
        return this._ignore;
    }
    set singleClick(b) {
        this._singleClick = b;
    }
    set doubleClick(b) {
        this._doubleClick = b;
    }
    set hasSwiped(b) {
        this._hasSwiped = b;
    }
    set ignore(b) {
        this._ignore = b;
    }
}
/**
 * Class used to manage all inputs for the scene.
 */
class InputManager {
    /**
     * Creates a new InputManager
     * @param scene - defines the hosting scene
     */
    constructor(scene) {
        /** This is a defensive check to not allow control attachment prior to an already active one. If already attached, previous control is unattached before attaching the new one. */
        this._alreadyAttached = false;
        this._meshPickProceed = false;
        this._currentPickResult = null;
        this._previousPickResult = null;
        this._activePointerIds = new Array();
        /** Tracks the count of used slots in _activePointerIds for perf */
        this._activePointerIdsCount = 0;
        this._doubleClickOccured = false;
        this._isSwiping = false;
        this._swipeButtonPressed = -1;
        this._skipPointerTap = false;
        this._isMultiTouchGesture = false;
        this._pointerX = 0;
        this._pointerY = 0;
        this._startingPointerPosition = new math_vector/* Vector2 */.I9(0, 0);
        this._previousStartingPointerPosition = new math_vector/* Vector2 */.I9(0, 0);
        this._startingPointerTime = 0;
        this._previousStartingPointerTime = 0;
        this._pointerCaptures = {};
        this._meshUnderPointerId = {};
        this._movePointerInfo = null;
        this._cameraObserverCount = 0;
        this._delayedClicks = [null, null, null, null, null];
        this._deviceSourceManager = null;
        this._scene = scene || engineStore/* EngineStore */.q.LastCreatedScene;
        if (!this._scene) {
            return;
        }
    }
    /**
     * Gets the mesh that is currently under the pointer
     * @returns Mesh that the pointer is pointer is hovering over
     */
    get meshUnderPointer() {
        if (this._movePointerInfo) {
            // Because _pointerOverMesh is populated as part of _pickMove, we need to force a pick to update it.
            // Calling _pickMove calls _setCursorAndPointerOverMesh which calls setPointerOverMesh
            this._movePointerInfo._generatePickInfo();
            // Once we have what we need, we can clear _movePointerInfo because we don't need it anymore
            this._movePointerInfo = null;
        }
        return this._pointerOverMesh;
    }
    /**
     * When using more than one pointer (for example in XR) you can get the mesh under the specific pointer
     * @param pointerId - the pointer id to use
     * @returns The mesh under this pointer id or null if not found
     */
    getMeshUnderPointerByPointerId(pointerId) {
        return this._meshUnderPointerId[pointerId] || null;
    }
    /**
     * Gets the pointer coordinates in 2D without any translation (ie. straight out of the pointer event)
     * @returns Vector with X/Y values directly from pointer event
     */
    get unTranslatedPointer() {
        return new math_vector/* Vector2 */.I9(this._unTranslatedPointerX, this._unTranslatedPointerY);
    }
    /**
     * Gets or sets the current on-screen X position of the pointer
     * @returns Translated X with respect to screen
     */
    get pointerX() {
        return this._pointerX;
    }
    set pointerX(value) {
        this._pointerX = value;
    }
    /**
     * Gets or sets the current on-screen Y position of the pointer
     * @returns Translated Y with respect to screen
     */
    get pointerY() {
        return this._pointerY;
    }
    set pointerY(value) {
        this._pointerY = value;
    }
    _updatePointerPosition(evt) {
        const canvasRect = this._scene.getEngine().getInputElementClientRect();
        if (!canvasRect) {
            return;
        }
        this._pointerX = evt.clientX - canvasRect.left;
        this._pointerY = evt.clientY - canvasRect.top;
        this._unTranslatedPointerX = this._pointerX;
        this._unTranslatedPointerY = this._pointerY;
    }
    _processPointerMove(pickResult, evt) {
        const scene = this._scene;
        const engine = scene.getEngine();
        const canvas = engine.getInputElement();
        if (canvas) {
            canvas.tabIndex = engine.canvasTabIndex;
            // Restore pointer
            if (!scene.doNotHandleCursors) {
                canvas.style.cursor = scene.defaultCursor;
            }
        }
        this._setCursorAndPointerOverMesh(pickResult, evt, scene);
        for (const step of scene._pointerMoveStage) {
            // If _pointerMoveState is defined, we have an active spriteManager and can't use Lazy Picking
            // Therefore, we need to force a pick to update the pickResult
            pickResult = pickResult || this._pickMove(evt);
            const isMeshPicked = pickResult?.pickedMesh ? true : false;
            pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, isMeshPicked, canvas);
        }
        const type = evt.inputIndex >= deviceEnums/* PointerInput */.ST.MouseWheelX && evt.inputIndex <= deviceEnums/* PointerInput */.ST.MouseWheelZ ? pointerEvents/* PointerEventTypes */.Zp.POINTERWHEEL : pointerEvents/* PointerEventTypes */.Zp.POINTERMOVE;
        if (scene.onPointerMove) {
            // Because of lazy picking, we need to force a pick to update the pickResult
            pickResult = pickResult || this._pickMove(evt);
            scene.onPointerMove(evt, pickResult, type);
        }
        let pointerInfo;
        if (pickResult) {
            pointerInfo = new pointerEvents/* PointerInfo */.mx(type, evt, pickResult);
            this._setRayOnPointerInfo(pickResult, evt);
        }
        else {
            pointerInfo = new pointerEvents/* PointerInfo */.mx(type, evt, null, this);
            this._movePointerInfo = pointerInfo;
        }
        if (scene.onPointerObservable.hasObservers()) {
            scene.onPointerObservable.notifyObservers(pointerInfo, type);
        }
    }
    // Pointers handling
    /** @internal */
    _setRayOnPointerInfo(pickInfo, event) {
        const scene = this._scene;
        if (pickInfo && import_helper/* _ImportHelper */.h._IsPickingAvailable) {
            if (!pickInfo.ray) {
                pickInfo.ray = scene.createPickingRay(event.offsetX, event.offsetY, math_vector/* Matrix */.uq.Identity(), scene.activeCamera);
            }
        }
    }
    /** @internal */
    _addCameraPointerObserver(observer, mask) {
        this._cameraObserverCount++;
        return this._scene.onPointerObservable.add(observer, mask);
    }
    /** @internal */
    _removeCameraPointerObserver(observer) {
        this._cameraObserverCount--;
        return this._scene.onPointerObservable.remove(observer);
    }
    _checkForPicking() {
        return !!(this._scene.onPointerObservable.observers.length > this._cameraObserverCount || this._scene.onPointerPick);
    }
    _checkPrePointerObservable(pickResult, evt, type) {
        const scene = this._scene;
        const pi = new pointerEvents/* PointerInfoPre */.tT(type, evt, this._unTranslatedPointerX, this._unTranslatedPointerY);
        if (pickResult) {
            pi.originalPickingInfo = pickResult;
            pi.ray = pickResult.ray;
            if (evt.pointerType === "xr-near" && pickResult.originMesh) {
                pi.nearInteractionPickingInfo = pickResult;
            }
        }
        scene.onPrePointerObservable.notifyObservers(pi, type);
        if (pi.skipOnPointerObservable) {
            return true;
        }
        else {
            return false;
        }
    }
    /** @internal */
    _pickMove(evt) {
        const scene = this._scene;
        const pickResult = scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, scene.pointerMovePredicate, scene.pointerMoveFastCheck, scene.cameraToUseForPointers, scene.pointerMoveTrianglePredicate);
        this._setCursorAndPointerOverMesh(pickResult, evt, scene);
        return pickResult;
    }
    _setCursorAndPointerOverMesh(pickResult, evt, scene) {
        const engine = scene.getEngine();
        const canvas = engine.getInputElement();
        if (pickResult?.pickedMesh) {
            this.setPointerOverMesh(pickResult.pickedMesh, evt.pointerId, pickResult, evt);
            if (!scene.doNotHandleCursors && canvas && this._pointerOverMesh) {
                const actionManager = this._pointerOverMesh._getActionManagerForTrigger();
                if (actionManager && actionManager.hasPointerTriggers) {
                    canvas.style.cursor = actionManager.hoverCursor || scene.hoverCursor;
                }
            }
        }
        else {
            this.setPointerOverMesh(null, evt.pointerId, pickResult, evt);
        }
    }
    /**
     * Use this method to simulate a pointer move on a mesh
     * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
     * @param pickResult - pickingInfo of the object wished to simulate pointer event on
     * @param pointerEventInit - pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
     */
    simulatePointerMove(pickResult, pointerEventInit) {
        const evt = new PointerEvent("pointermove", pointerEventInit);
        evt.inputIndex = deviceEnums/* PointerInput */.ST.Move;
        if (this._checkPrePointerObservable(pickResult, evt, pointerEvents/* PointerEventTypes */.Zp.POINTERMOVE)) {
            return;
        }
        this._processPointerMove(pickResult, evt);
    }
    /**
     * Use this method to simulate a pointer down on a mesh
     * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
     * @param pickResult - pickingInfo of the object wished to simulate pointer event on
     * @param pointerEventInit - pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
     */
    simulatePointerDown(pickResult, pointerEventInit) {
        const evt = new PointerEvent("pointerdown", pointerEventInit);
        evt.inputIndex = evt.button + 2;
        if (this._checkPrePointerObservable(pickResult, evt, pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN)) {
            return;
        }
        this._processPointerDown(pickResult, evt);
    }
    _processPointerDown(pickResult, evt) {
        const scene = this._scene;
        if (pickResult?.pickedMesh) {
            this._pickedDownMesh = pickResult.pickedMesh;
            const actionManager = pickResult.pickedMesh._getActionManagerForTrigger();
            if (actionManager) {
                if (actionManager.hasPickTriggers) {
                    actionManager.processTrigger(5, actionEvent/* ActionEvent */.X.CreateNew(pickResult.pickedMesh, evt, pickResult));
                    switch (evt.button) {
                        case 0:
                            actionManager.processTrigger(2, actionEvent/* ActionEvent */.X.CreateNew(pickResult.pickedMesh, evt, pickResult));
                            break;
                        case 1:
                            actionManager.processTrigger(4, actionEvent/* ActionEvent */.X.CreateNew(pickResult.pickedMesh, evt, pickResult));
                            break;
                        case 2:
                            actionManager.processTrigger(3, actionEvent/* ActionEvent */.X.CreateNew(pickResult.pickedMesh, evt, pickResult));
                            break;
                    }
                }
                if (actionManager.hasSpecificTrigger(8)) {
                    window.setTimeout(() => {
                        const pickResult = scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, (mesh) => ((mesh.isPickable &&
                            mesh.isVisible &&
                            mesh.isReady() &&
                            mesh.actionManager &&
                            mesh.actionManager.hasSpecificTrigger(8) &&
                            mesh === this._pickedDownMesh)), false, scene.cameraToUseForPointers);
                        if (pickResult?.pickedMesh && actionManager) {
                            if (this._activePointerIdsCount !== 0 && Date.now() - this._startingPointerTime > InputManager.LongPressDelay && !this._isPointerSwiping()) {
                                this._startingPointerTime = 0;
                                actionManager.processTrigger(8, actionEvent/* ActionEvent */.X.CreateNew(pickResult.pickedMesh, evt));
                            }
                        }
                    }, InputManager.LongPressDelay);
                }
            }
        }
        else {
            for (const step of scene._pointerDownStage) {
                pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, evt, false);
            }
        }
        let pointerInfo;
        const type = pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN;
        if (pickResult) {
            if (scene.onPointerDown) {
                scene.onPointerDown(evt, pickResult, type);
            }
            pointerInfo = new pointerEvents/* PointerInfo */.mx(type, evt, pickResult);
            this._setRayOnPointerInfo(pickResult, evt);
        }
        else {
            pointerInfo = new pointerEvents/* PointerInfo */.mx(type, evt, null, this);
        }
        if (scene.onPointerObservable.hasObservers()) {
            scene.onPointerObservable.notifyObservers(pointerInfo, type);
        }
    }
    /**
     * @internal
     * @internals Boolean if delta for pointer exceeds drag movement threshold
     */
    _isPointerSwiping() {
        return this._isSwiping;
    }
    /**
     * Use this method to simulate a pointer up on a mesh
     * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
     * @param pickResult - pickingInfo of the object wished to simulate pointer event on
     * @param pointerEventInit - pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
     * @param doubleTap - indicates that the pointer up event should be considered as part of a double click (false by default)
     */
    simulatePointerUp(pickResult, pointerEventInit, doubleTap) {
        const evt = new PointerEvent("pointerup", pointerEventInit);
        evt.inputIndex = deviceEnums/* PointerInput */.ST.Move;
        const clickInfo = new _ClickInfo();
        if (doubleTap) {
            clickInfo.doubleClick = true;
        }
        else {
            clickInfo.singleClick = true;
        }
        if (this._checkPrePointerObservable(pickResult, evt, pointerEvents/* PointerEventTypes */.Zp.POINTERUP)) {
            return;
        }
        this._processPointerUp(pickResult, evt, clickInfo);
    }
    _processPointerUp(pickResult, evt, clickInfo) {
        const scene = this._scene;
        if (pickResult?.pickedMesh) {
            this._pickedUpMesh = pickResult.pickedMesh;
            if (this._pickedDownMesh === this._pickedUpMesh) {
                if (scene.onPointerPick) {
                    scene.onPointerPick(evt, pickResult);
                }
                if (clickInfo.singleClick && !clickInfo.ignore && scene.onPointerObservable.observers.length > this._cameraObserverCount) {
                    const type = pointerEvents/* PointerEventTypes */.Zp.POINTERPICK;
                    const pi = new pointerEvents/* PointerInfo */.mx(type, evt, pickResult);
                    this._setRayOnPointerInfo(pickResult, evt);
                    scene.onPointerObservable.notifyObservers(pi, type);
                }
            }
            const actionManager = pickResult.pickedMesh._getActionManagerForTrigger();
            if (actionManager && !clickInfo.ignore) {
                actionManager.processTrigger(7, actionEvent/* ActionEvent */.X.CreateNew(pickResult.pickedMesh, evt, pickResult));
                if (!clickInfo.hasSwiped && clickInfo.singleClick) {
                    actionManager.processTrigger(1, actionEvent/* ActionEvent */.X.CreateNew(pickResult.pickedMesh, evt, pickResult));
                }
                const doubleClickActionManager = pickResult.pickedMesh._getActionManagerForTrigger(6);
                if (clickInfo.doubleClick && doubleClickActionManager) {
                    doubleClickActionManager.processTrigger(6, actionEvent/* ActionEvent */.X.CreateNew(pickResult.pickedMesh, evt, pickResult));
                }
            }
        }
        else {
            if (!clickInfo.ignore) {
                for (const step of scene._pointerUpStage) {
                    pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, evt, clickInfo.doubleClick);
                }
            }
        }
        if (this._pickedDownMesh && this._pickedDownMesh !== this._pickedUpMesh) {
            const pickedDownActionManager = this._pickedDownMesh._getActionManagerForTrigger(16);
            if (pickedDownActionManager) {
                pickedDownActionManager.processTrigger(16, actionEvent/* ActionEvent */.X.CreateNew(this._pickedDownMesh, evt));
            }
        }
        if (!clickInfo.ignore) {
            const pi = new pointerEvents/* PointerInfo */.mx(pointerEvents/* PointerEventTypes */.Zp.POINTERUP, evt, pickResult);
            // Set ray on picking info.  Note that this info will also be reused for the tap notification.
            this._setRayOnPointerInfo(pickResult, evt);
            scene.onPointerObservable.notifyObservers(pi, pointerEvents/* PointerEventTypes */.Zp.POINTERUP);
            if (scene.onPointerUp) {
                scene.onPointerUp(evt, pickResult, pointerEvents/* PointerEventTypes */.Zp.POINTERUP);
            }
            if (!clickInfo.hasSwiped && !this._skipPointerTap && !this._isMultiTouchGesture) {
                let type = 0;
                if (clickInfo.singleClick) {
                    type = pointerEvents/* PointerEventTypes */.Zp.POINTERTAP;
                }
                else if (clickInfo.doubleClick) {
                    type = pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP;
                }
                if (type) {
                    const pi = new pointerEvents/* PointerInfo */.mx(type, evt, pickResult);
                    if (scene.onPointerObservable.hasObservers() && scene.onPointerObservable.hasSpecificMask(type)) {
                        scene.onPointerObservable.notifyObservers(pi, type);
                    }
                }
            }
        }
    }
    /**
     * Gets a boolean indicating if the current pointer event is captured (meaning that the scene has already handled the pointer down)
     * @param pointerId - defines the pointer id to use in a multi-touch scenario (0 by default)
     * @returns true if the pointer was captured
     */
    isPointerCaptured(pointerId = 0) {
        return this._pointerCaptures[pointerId];
    }
    /**
     * Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp
     * @param attachUp - defines if you want to attach events to pointerup
     * @param attachDown - defines if you want to attach events to pointerdown
     * @param attachMove - defines if you want to attach events to pointermove
     * @param elementToAttachTo - defines the target DOM element to attach to (will use the canvas by default)
     */
    attachControl(attachUp = true, attachDown = true, attachMove = true, elementToAttachTo = null) {
        const scene = this._scene;
        const engine = scene.getEngine();
        if (!elementToAttachTo) {
            elementToAttachTo = engine.getInputElement();
        }
        if (this._alreadyAttached) {
            this.detachControl();
        }
        if (elementToAttachTo) {
            this._alreadyAttachedTo = elementToAttachTo;
        }
        this._deviceSourceManager = new deviceSourceManager/* DeviceSourceManager */.Z(engine);
        // Because this is only called from _initClickEvent, which is called in _onPointerUp, we'll use the pointerUpPredicate for the pick call
        this._initActionManager = (act) => {
            if (!this._meshPickProceed) {
                const pickResult = scene.skipPointerUpPicking || (scene._registeredActions === 0 && !this._checkForPicking() && !scene.onPointerUp)
                    ? null
                    : scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, scene.pointerUpPredicate, scene.pointerUpFastCheck, scene.cameraToUseForPointers, scene.pointerUpTrianglePredicate);
                this._currentPickResult = pickResult;
                if (pickResult) {
                    act = pickResult.hit && pickResult.pickedMesh ? pickResult.pickedMesh._getActionManagerForTrigger() : null;
                }
                this._meshPickProceed = true;
            }
            return act;
        };
        this._delayedSimpleClick = (btn, clickInfo, cb) => {
            // double click delay is over and that no double click has been raised since, or the 2 consecutive keys pressed are different
            if ((Date.now() - this._previousStartingPointerTime > InputManager.DoubleClickDelay && !this._doubleClickOccured) || btn !== this._previousButtonPressed) {
                this._doubleClickOccured = false;
                clickInfo.singleClick = true;
                clickInfo.ignore = false;
                // If we have a delayed click, we need to resolve the TAP event
                if (this._delayedClicks[btn]) {
                    const evt = this._delayedClicks[btn].evt;
                    const type = pointerEvents/* PointerEventTypes */.Zp.POINTERTAP;
                    const pi = new pointerEvents/* PointerInfo */.mx(type, evt, this._currentPickResult);
                    if (scene.onPointerObservable.hasObservers() && scene.onPointerObservable.hasSpecificMask(type)) {
                        scene.onPointerObservable.notifyObservers(pi, type);
                    }
                    // Clear the delayed click
                    this._delayedClicks[btn] = null;
                }
            }
        };
        this._initClickEvent = (obs1, obs2, evt, cb) => {
            const clickInfo = new _ClickInfo();
            this._currentPickResult = null;
            let act = null;
            let checkPicking = obs1.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERPICK) ||
                obs2.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERPICK) ||
                obs1.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERTAP) ||
                obs2.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERTAP) ||
                obs1.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP) ||
                obs2.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP);
            if (!checkPicking && abstractActionManager/* AbstractActionManager */.G) {
                act = this._initActionManager(act, clickInfo);
                if (act) {
                    checkPicking = act.hasPickTriggers;
                }
            }
            let needToIgnoreNext = false;
            if (checkPicking) {
                const btn = evt.button;
                clickInfo.hasSwiped = this._isPointerSwiping();
                if (!clickInfo.hasSwiped) {
                    let checkSingleClickImmediately = !InputManager.ExclusiveDoubleClickMode;
                    if (!checkSingleClickImmediately) {
                        checkSingleClickImmediately = !obs1.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP) && !obs2.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP);
                        if (checkSingleClickImmediately && !abstractActionManager/* AbstractActionManager */.G.HasSpecificTrigger(6)) {
                            act = this._initActionManager(act, clickInfo);
                            if (act) {
                                checkSingleClickImmediately = !act.hasSpecificTrigger(6);
                            }
                        }
                    }
                    if (checkSingleClickImmediately) {
                        // single click detected if double click delay is over or two different successive keys pressed without exclusive double click or no double click required
                        if (Date.now() - this._previousStartingPointerTime > InputManager.DoubleClickDelay || btn !== this._previousButtonPressed) {
                            clickInfo.singleClick = true;
                            cb(clickInfo, this._currentPickResult);
                            needToIgnoreNext = true;
                        }
                    }
                    // at least one double click is required to be check and exclusive double click is enabled
                    else {
                        // Queue up a delayed click, just in case this isn't a double click
                        // It should be noted that while this delayed event happens
                        // because of user input, it shouldn't be considered as a direct,
                        // timing-dependent result of that input.  It's meant to just fire the TAP event
                        const delayedClick = {
                            evt: evt,
                            clickInfo: clickInfo,
                            timeoutId: window.setTimeout(this._delayedSimpleClick.bind(this, btn, clickInfo, cb), InputManager.DoubleClickDelay),
                        };
                        this._delayedClicks[btn] = delayedClick;
                    }
                    let checkDoubleClick = obs1.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP) || obs2.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP);
                    if (!checkDoubleClick && abstractActionManager/* AbstractActionManager */.G.HasSpecificTrigger(6)) {
                        act = this._initActionManager(act, clickInfo);
                        if (act) {
                            checkDoubleClick = act.hasSpecificTrigger(6);
                        }
                    }
                    if (checkDoubleClick) {
                        // two successive keys pressed are equal, double click delay is not over and double click has not just occurred
                        if (btn === this._previousButtonPressed && Date.now() - this._previousStartingPointerTime < InputManager.DoubleClickDelay && !this._doubleClickOccured) {
                            // pointer has not moved for 2 clicks, it's a double click
                            if (!clickInfo.hasSwiped && !this._isPointerSwiping()) {
                                this._previousStartingPointerTime = 0;
                                this._doubleClickOccured = true;
                                clickInfo.doubleClick = true;
                                clickInfo.ignore = false;
                                // If we have a pending click, we need to cancel it
                                if (InputManager.ExclusiveDoubleClickMode && this._delayedClicks[btn]) {
                                    clearTimeout(this._delayedClicks[btn]?.timeoutId);
                                    this._delayedClicks[btn] = null;
                                }
                                cb(clickInfo, this._currentPickResult);
                            }
                            // if the two successive clicks are too far, it's just two simple clicks
                            else {
                                this._doubleClickOccured = false;
                                this._previousStartingPointerTime = this._startingPointerTime;
                                this._previousStartingPointerPosition.x = this._startingPointerPosition.x;
                                this._previousStartingPointerPosition.y = this._startingPointerPosition.y;
                                this._previousButtonPressed = btn;
                                if (InputManager.ExclusiveDoubleClickMode) {
                                    // If we have a delayed click, we need to cancel it
                                    if (this._delayedClicks[btn]) {
                                        clearTimeout(this._delayedClicks[btn]?.timeoutId);
                                        this._delayedClicks[btn] = null;
                                    }
                                    cb(clickInfo, this._previousPickResult);
                                }
                                else {
                                    cb(clickInfo, this._currentPickResult);
                                }
                            }
                            needToIgnoreNext = true;
                        }
                        // just the first click of the double has been raised
                        else {
                            this._doubleClickOccured = false;
                            this._previousStartingPointerTime = this._startingPointerTime;
                            this._previousStartingPointerPosition.x = this._startingPointerPosition.x;
                            this._previousStartingPointerPosition.y = this._startingPointerPosition.y;
                            this._previousButtonPressed = btn;
                        }
                    }
                }
            }
            // Even if ExclusiveDoubleClickMode is true, we need to always handle
            // up events at time of execution, unless we're explicitly ignoring them.
            if (!needToIgnoreNext) {
                cb(clickInfo, this._currentPickResult);
            }
        };
        this._onPointerMove = (evt) => {
            this._updatePointerPosition(evt);
            // Check if pointer leaves DragMovementThreshold range to determine if swipe is occurring
            if (!this._isSwiping && this._swipeButtonPressed !== -1) {
                this._isSwiping =
                    Math.abs(this._startingPointerPosition.x - this._pointerX) > InputManager.DragMovementThreshold ||
                        Math.abs(this._startingPointerPosition.y - this._pointerY) > InputManager.DragMovementThreshold;
            }
            // Because there's a race condition between pointermove and pointerlockchange events, we need to
            // verify that the pointer is still locked after each pointermove event.
            if (engine.isPointerLock) {
                engine._verifyPointerLock();
            }
            // PreObservable support
            if (this._checkPrePointerObservable(null, evt, evt.inputIndex >= deviceEnums/* PointerInput */.ST.MouseWheelX && evt.inputIndex <= deviceEnums/* PointerInput */.ST.MouseWheelZ ? pointerEvents/* PointerEventTypes */.Zp.POINTERWHEEL : pointerEvents/* PointerEventTypes */.Zp.POINTERMOVE)) {
                return;
            }
            if (!scene.cameraToUseForPointers && !scene.activeCamera) {
                return;
            }
            if (scene.skipPointerMovePicking) {
                this._processPointerMove(new pickingInfo/* PickingInfo */.G(), evt);
                return;
            }
            if (!scene.pointerMovePredicate) {
                scene.pointerMovePredicate = (mesh) => mesh.isPickable &&
                    mesh.isVisible &&
                    mesh.isReady() &&
                    mesh.isEnabled() &&
                    (mesh.enablePointerMoveEvents || scene.constantlyUpdateMeshUnderPointer || mesh._getActionManagerForTrigger() !== null) &&
                    (!scene.cameraToUseForPointers || (scene.cameraToUseForPointers.layerMask & mesh.layerMask) !== 0);
            }
            const pickResult = scene._registeredActions > 0 || scene.constantlyUpdateMeshUnderPointer ? this._pickMove(evt) : null;
            this._processPointerMove(pickResult, evt);
        };
        this._onPointerDown = (evt) => {
            const freeIndex = this._activePointerIds.indexOf(-1);
            if (freeIndex === -1) {
                this._activePointerIds.push(evt.pointerId);
            }
            else {
                this._activePointerIds[freeIndex] = evt.pointerId;
            }
            this._activePointerIdsCount++;
            this._pickedDownMesh = null;
            this._meshPickProceed = false;
            // If ExclusiveDoubleClickMode is true, we need to resolve any pending delayed clicks
            if (InputManager.ExclusiveDoubleClickMode) {
                for (let i = 0; i < this._delayedClicks.length; i++) {
                    if (this._delayedClicks[i]) {
                        // If the button that was pressed is the same as the one that was released,
                        // just clear the timer.  This will be resolved in the up event.
                        if (evt.button === i) {
                            clearTimeout(this._delayedClicks[i]?.timeoutId);
                        }
                        else {
                            // Otherwise, we need to resolve the click
                            const clickInfo = this._delayedClicks[i].clickInfo;
                            this._doubleClickOccured = false;
                            clickInfo.singleClick = true;
                            clickInfo.ignore = false;
                            const prevEvt = this._delayedClicks[i].evt;
                            const type = pointerEvents/* PointerEventTypes */.Zp.POINTERTAP;
                            const pi = new pointerEvents/* PointerInfo */.mx(type, prevEvt, this._currentPickResult);
                            if (scene.onPointerObservable.hasObservers() && scene.onPointerObservable.hasSpecificMask(type)) {
                                scene.onPointerObservable.notifyObservers(pi, type);
                            }
                            // Clear the delayed click
                            this._delayedClicks[i] = null;
                        }
                    }
                }
            }
            this._updatePointerPosition(evt);
            if (this._swipeButtonPressed === -1) {
                this._swipeButtonPressed = evt.button;
            }
            if (scene.preventDefaultOnPointerDown && elementToAttachTo) {
                evt.preventDefault();
                elementToAttachTo.focus();
            }
            this._startingPointerPosition.x = this._pointerX;
            this._startingPointerPosition.y = this._pointerY;
            this._startingPointerTime = Date.now();
            // PreObservable support
            if (this._checkPrePointerObservable(null, evt, pointerEvents/* PointerEventTypes */.Zp.POINTERDOWN)) {
                return;
            }
            if (!scene.cameraToUseForPointers && !scene.activeCamera) {
                return;
            }
            this._pointerCaptures[evt.pointerId] = true;
            if (!scene.pointerDownPredicate) {
                scene.pointerDownPredicate = (mesh) => {
                    return (mesh.isPickable &&
                        mesh.isVisible &&
                        mesh.isReady() &&
                        mesh.isEnabled() &&
                        (!scene.cameraToUseForPointers || (scene.cameraToUseForPointers.layerMask & mesh.layerMask) !== 0));
                };
            }
            // Meshes
            this._pickedDownMesh = null;
            let pickResult;
            if (scene.skipPointerDownPicking || (scene._registeredActions === 0 && !this._checkForPicking() && !scene.onPointerDown)) {
                pickResult = new pickingInfo/* PickingInfo */.G();
            }
            else {
                pickResult = scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, scene.pointerDownPredicate, scene.pointerDownFastCheck, scene.cameraToUseForPointers, scene.pointerDownTrianglePredicate);
            }
            this._processPointerDown(pickResult, evt);
        };
        this._onPointerUp = (evt) => {
            const pointerIdIndex = this._activePointerIds.indexOf(evt.pointerId);
            if (pointerIdIndex === -1) {
                // We are attaching the pointer up to windows because of a bug in FF
                // If this pointerId is not paired with an _onPointerDown call, ignore it
                return;
            }
            this._activePointerIds[pointerIdIndex] = -1;
            this._activePointerIdsCount--;
            this._pickedUpMesh = null;
            this._meshPickProceed = false;
            this._updatePointerPosition(evt);
            if (scene.preventDefaultOnPointerUp && elementToAttachTo) {
                evt.preventDefault();
                elementToAttachTo.focus();
            }
            this._initClickEvent(scene.onPrePointerObservable, scene.onPointerObservable, evt, (clickInfo, pickResult) => {
                // PreObservable support
                if (scene.onPrePointerObservable.hasObservers()) {
                    this._skipPointerTap = false;
                    if (!clickInfo.ignore) {
                        if (this._checkPrePointerObservable(null, evt, pointerEvents/* PointerEventTypes */.Zp.POINTERUP)) {
                            // If we're skipping the next observable, we need to reset the swipe state before returning
                            if (this._swipeButtonPressed === evt.button) {
                                this._isSwiping = false;
                                this._swipeButtonPressed = -1;
                            }
                            // If we're going to skip the POINTERUP, we need to reset the pointer capture
                            if (evt.buttons === 0) {
                                this._pointerCaptures[evt.pointerId] = false;
                            }
                            return;
                        }
                        if (!clickInfo.hasSwiped) {
                            if (clickInfo.singleClick && scene.onPrePointerObservable.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERTAP)) {
                                if (this._checkPrePointerObservable(null, evt, pointerEvents/* PointerEventTypes */.Zp.POINTERTAP)) {
                                    this._skipPointerTap = true;
                                }
                            }
                            if (clickInfo.doubleClick && scene.onPrePointerObservable.hasSpecificMask(pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP)) {
                                if (this._checkPrePointerObservable(null, evt, pointerEvents/* PointerEventTypes */.Zp.POINTERDOUBLETAP)) {
                                    this._skipPointerTap = true;
                                }
                            }
                        }
                    }
                }
                // There should be a pointer captured at this point so if there isn't we should reset and return
                if (!this._pointerCaptures[evt.pointerId]) {
                    if (this._swipeButtonPressed === evt.button) {
                        this._isSwiping = false;
                        this._swipeButtonPressed = -1;
                    }
                    return;
                }
                // Only release capture if all buttons are released
                if (evt.buttons === 0) {
                    this._pointerCaptures[evt.pointerId] = false;
                }
                if (!scene.cameraToUseForPointers && !scene.activeCamera) {
                    return;
                }
                if (!scene.pointerUpPredicate) {
                    scene.pointerUpPredicate = (mesh) => {
                        return (mesh.isPickable &&
                            mesh.isVisible &&
                            mesh.isReady() &&
                            mesh.isEnabled() &&
                            (!scene.cameraToUseForPointers || (scene.cameraToUseForPointers.layerMask & mesh.layerMask) !== 0));
                    };
                }
                // Meshes
                if (!this._meshPickProceed && ((abstractActionManager/* AbstractActionManager */.G && abstractActionManager/* AbstractActionManager */.G.HasTriggers) || this._checkForPicking() || scene.onPointerUp)) {
                    this._initActionManager(null, clickInfo);
                }
                if (!pickResult) {
                    pickResult = this._currentPickResult;
                }
                this._processPointerUp(pickResult, evt, clickInfo);
                this._previousPickResult = this._currentPickResult;
                if (this._swipeButtonPressed === evt.button) {
                    this._isSwiping = false;
                    this._swipeButtonPressed = -1;
                }
            });
        };
        this._onKeyDown = (evt) => {
            const type = keyboardEvents/* KeyboardEventTypes */.TB.KEYDOWN;
            if (scene.onPreKeyboardObservable.hasObservers()) {
                const pi = new keyboardEvents/* KeyboardInfoPre */.Bu(type, evt);
                scene.onPreKeyboardObservable.notifyObservers(pi, type);
                if (pi.skipOnKeyboardObservable) {
                    return;
                }
            }
            if (scene.onKeyboardObservable.hasObservers()) {
                const pi = new keyboardEvents/* KeyboardInfo */.W0(type, evt);
                scene.onKeyboardObservable.notifyObservers(pi, type);
            }
            if (scene.actionManager) {
                scene.actionManager.processTrigger(14, actionEvent/* ActionEvent */.X.CreateNewFromScene(scene, evt));
            }
        };
        this._onKeyUp = (evt) => {
            const type = keyboardEvents/* KeyboardEventTypes */.TB.KEYUP;
            if (scene.onPreKeyboardObservable.hasObservers()) {
                const pi = new keyboardEvents/* KeyboardInfoPre */.Bu(type, evt);
                scene.onPreKeyboardObservable.notifyObservers(pi, type);
                if (pi.skipOnKeyboardObservable) {
                    return;
                }
            }
            if (scene.onKeyboardObservable.hasObservers()) {
                const pi = new keyboardEvents/* KeyboardInfo */.W0(type, evt);
                scene.onKeyboardObservable.notifyObservers(pi, type);
            }
            if (scene.actionManager) {
                scene.actionManager.processTrigger(15, actionEvent/* ActionEvent */.X.CreateNewFromScene(scene, evt));
            }
        };
        // If a device connects that we can handle, wire up the observable
        this._deviceSourceManager.onDeviceConnectedObservable.add((deviceSource) => {
            if (deviceSource.deviceType === deviceEnums/* DeviceType */.bq.Mouse) {
                deviceSource.onInputChangedObservable.add((eventData) => {
                    this._originMouseEvent = eventData;
                    if (eventData.inputIndex === deviceEnums/* PointerInput */.ST.LeftClick ||
                        eventData.inputIndex === deviceEnums/* PointerInput */.ST.MiddleClick ||
                        eventData.inputIndex === deviceEnums/* PointerInput */.ST.RightClick ||
                        eventData.inputIndex === deviceEnums/* PointerInput */.ST.BrowserBack ||
                        eventData.inputIndex === deviceEnums/* PointerInput */.ST.BrowserForward) {
                        if (attachDown && deviceSource.getInput(eventData.inputIndex) === 1) {
                            this._onPointerDown(eventData);
                        }
                        else if (attachUp && deviceSource.getInput(eventData.inputIndex) === 0) {
                            this._onPointerUp(eventData);
                        }
                    }
                    else if (attachMove) {
                        if (eventData.inputIndex === deviceEnums/* PointerInput */.ST.Move) {
                            this._onPointerMove(eventData);
                        }
                        else if (eventData.inputIndex === deviceEnums/* PointerInput */.ST.MouseWheelX ||
                            eventData.inputIndex === deviceEnums/* PointerInput */.ST.MouseWheelY ||
                            eventData.inputIndex === deviceEnums/* PointerInput */.ST.MouseWheelZ) {
                            this._onPointerMove(eventData);
                        }
                    }
                });
            }
            else if (deviceSource.deviceType === deviceEnums/* DeviceType */.bq.Touch) {
                deviceSource.onInputChangedObservable.add((eventData) => {
                    if (eventData.inputIndex === deviceEnums/* PointerInput */.ST.LeftClick) {
                        if (attachDown && deviceSource.getInput(eventData.inputIndex) === 1) {
                            this._onPointerDown(eventData);
                            if (this._activePointerIdsCount > 1) {
                                this._isMultiTouchGesture = true;
                            }
                        }
                        else if (attachUp && deviceSource.getInput(eventData.inputIndex) === 0) {
                            this._onPointerUp(eventData);
                            if (this._activePointerIdsCount === 0) {
                                this._isMultiTouchGesture = false;
                            }
                        }
                    }
                    if (attachMove && eventData.inputIndex === deviceEnums/* PointerInput */.ST.Move) {
                        this._onPointerMove(eventData);
                    }
                });
            }
            else if (deviceSource.deviceType === deviceEnums/* DeviceType */.bq.Keyboard) {
                deviceSource.onInputChangedObservable.add((eventData) => {
                    if (eventData.type === "keydown") {
                        this._onKeyDown(eventData);
                    }
                    else if (eventData.type === "keyup") {
                        this._onKeyUp(eventData);
                    }
                });
            }
        });
        this._alreadyAttached = true;
    }
    /**
     * Detaches all event handlers
     */
    detachControl() {
        if (this._alreadyAttached) {
            this._deviceSourceManager.dispose();
            this._deviceSourceManager = null;
            // Cursor
            if (this._alreadyAttachedTo && !this._scene.doNotHandleCursors) {
                this._alreadyAttachedTo.style.cursor = this._scene.defaultCursor;
            }
            this._alreadyAttached = false;
            this._alreadyAttachedTo = null;
        }
    }
    /**
     * Force the value of meshUnderPointer
     * @param mesh - defines the mesh to use
     * @param pointerId - optional pointer id when using more than one pointer. Defaults to 0
     * @param pickResult - optional pickingInfo data used to find mesh
     * @param evt - optional pointer event
     */
    setPointerOverMesh(mesh, pointerId = 0, pickResult, evt) {
        if (this._meshUnderPointerId[pointerId] === mesh && (!mesh || !mesh._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting)) {
            return;
        }
        const underPointerMesh = this._meshUnderPointerId[pointerId];
        let actionManager;
        if (underPointerMesh) {
            actionManager = underPointerMesh._getActionManagerForTrigger(10);
            if (actionManager) {
                actionManager.processTrigger(10, actionEvent/* ActionEvent */.X.CreateNew(underPointerMesh, evt, { pointerId }));
            }
        }
        if (mesh) {
            this._meshUnderPointerId[pointerId] = mesh;
            this._pointerOverMesh = mesh;
            actionManager = mesh._getActionManagerForTrigger(9);
            if (actionManager) {
                actionManager.processTrigger(9, actionEvent/* ActionEvent */.X.CreateNew(mesh, evt, { pointerId, pickResult }));
            }
        }
        else {
            delete this._meshUnderPointerId[pointerId];
            this._pointerOverMesh = null;
        }
    }
    /**
     * Gets the mesh under the pointer
     * @returns a Mesh or null if no mesh is under the pointer
     */
    getPointerOverMesh() {
        return this.meshUnderPointer;
    }
    /**
     * @param mesh - Mesh to invalidate
     * @internal
     */
    _invalidateMesh(mesh) {
        if (this._pointerOverMesh === mesh) {
            this._pointerOverMesh = null;
        }
        if (this._pickedDownMesh === mesh) {
            this._pickedDownMesh = null;
        }
        if (this._pickedUpMesh === mesh) {
            this._pickedUpMesh = null;
        }
        for (const pointerId in this._meshUnderPointerId) {
            if (this._meshUnderPointerId[pointerId] === mesh) {
                delete this._meshUnderPointerId[pointerId];
            }
        }
    }
}
/** The distance in pixel that you have to move to prevent some events */
InputManager.DragMovementThreshold = 10; // in pixels
/** Time in milliseconds to wait to raise long press events if button is still pressed */
InputManager.LongPressDelay = 500; // in milliseconds
/** Time in milliseconds with two consecutive clicks will be considered as a double click */
InputManager.DoubleClickDelay = 300; // in milliseconds
/**
 * This flag will modify the behavior so that, when true, a click will happen if and only if
 * another click DOES NOT happen within the DoubleClickDelay time frame.  If another click does
 * happen within that time frame, the first click will not fire an event and and a double click will occur.
 */
InputManager.ExclusiveDoubleClickMode = false;
//# sourceMappingURL=scene.inputManager.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/perfCounter.js
var perfCounter = __webpack_require__(24296);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.color.js
var math_color = __webpack_require__(26041);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Maths/math.frustum.js
var math_frustum = __webpack_require__(22572);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/uniqueIdGenerator.js
var uniqueIdGenerator = __webpack_require__(82678);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/fileTools.js
var fileTools = __webpack_require__(8532);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Lights/lightConstants.js
var lightConstants = __webpack_require__(75515);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/arrayTools.js
var arrayTools = __webpack_require__(27309);
;// ./node_modules/@babylonjs/core/Inputs/pointerPickingConfiguration.js
/**
 * Class used to store configuration data associated with pointer picking
 */
class PointerPickingConfiguration {
    constructor() {
        /**
         * Gets or sets a predicate used to select candidate meshes for a pointer down event
         */
        this.pointerDownFastCheck = false;
        /**
         * Gets or sets a predicate used to select candidate meshes for a pointer up event
         */
        this.pointerUpFastCheck = false;
        /**
         * Gets or sets a predicate used to select candidate meshes for a pointer move event
         */
        this.pointerMoveFastCheck = false;
        /**
         * Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer move event occurs.
         */
        this.skipPointerMovePicking = false;
        /**
         * Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer down event occurs.
         */
        this.skipPointerDownPicking = false;
        /**
         * Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer up event occurs.  Off by default.
         */
        this.skipPointerUpPicking = false;
    }
}
//# sourceMappingURL=pointerPickingConfiguration.js.map
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/logger.js
var logger = __webpack_require__(51137);
// EXTERNAL MODULE: ./node_modules/@babylonjs/core/Misc/typeStore.js
var typeStore = __webpack_require__(56552);
;// ./node_modules/@babylonjs/core/scene.js





























/**
 * Define how the scene should favor performance over ease of use
 */
var ScenePerformancePriority;
(function (ScenePerformancePriority) {
    /** Default mode. No change. Performance will be treated as less important than backward compatibility */
    ScenePerformancePriority[ScenePerformancePriority["BackwardCompatible"] = 0] = "BackwardCompatible";
    /** Some performance options will be turned on trying to strike a balance between perf and ease of use */
    ScenePerformancePriority[ScenePerformancePriority["Intermediate"] = 1] = "Intermediate";
    /** Performance will be top priority */
    ScenePerformancePriority[ScenePerformancePriority["Aggressive"] = 2] = "Aggressive";
})(ScenePerformancePriority || (ScenePerformancePriority = {}));
/**
 * Represents a scene to be rendered by the engine.
 * @see https://doc.babylonjs.com/features/featuresDeepDive/scene
 */
class Scene {
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Factory used to create the default material.
     * @param scene The scene to create the material for
     * @returns The default material
     */
    static DefaultMaterialFactory(scene) {
        throw (0,devTools/* _WarnImport */.n)("StandardMaterial");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Factory used to create the a collision coordinator.
     * @returns The collision coordinator
     */
    static CollisionCoordinatorFactory() {
        throw (0,devTools/* _WarnImport */.n)("DefaultCollisionCoordinator");
    }
    /**
     * Defines the color used to clear the render buffer (Default is (0.2, 0.2, 0.3, 1.0))
     */
    get clearColor() {
        return this._clearColor;
    }
    set clearColor(value) {
        if (value !== this._clearColor) {
            this._clearColor = value;
            this.onClearColorChangedObservable.notifyObservers(this._clearColor);
        }
    }
    /**
     * Default image processing configuration used either in the rendering
     * Forward main pass or through the imageProcessingPostProcess if present.
     * As in the majority of the scene they are the same (exception for multi camera),
     * this is easier to reference from here than from all the materials and post process.
     *
     * No setter as we it is a shared configuration, you can set the values instead.
     */
    get imageProcessingConfiguration() {
        return this._imageProcessingConfiguration;
    }
    /**
     * Gets or sets a value indicating how to treat performance relatively to ease of use and backward compatibility
     */
    get performancePriority() {
        return this._performancePriority;
    }
    set performancePriority(value) {
        if (value === this._performancePriority) {
            return;
        }
        this._performancePriority = value;
        switch (value) {
            case 0 /* ScenePerformancePriority.BackwardCompatible */:
                this.skipFrustumClipping = false;
                this._renderingManager.maintainStateBetweenFrames = false;
                this.skipPointerMovePicking = false;
                this.autoClear = true;
                break;
            case 1 /* ScenePerformancePriority.Intermediate */:
                this.skipFrustumClipping = false;
                this._renderingManager.maintainStateBetweenFrames = false;
                this.skipPointerMovePicking = true;
                this.autoClear = false;
                break;
            case 2 /* ScenePerformancePriority.Aggressive */:
                this.skipFrustumClipping = true;
                this._renderingManager.maintainStateBetweenFrames = true;
                this.skipPointerMovePicking = true;
                this.autoClear = false;
                break;
        }
        this.onScenePerformancePriorityChangedObservable.notifyObservers(value);
    }
    /**
     * Gets or sets a boolean indicating if all rendering must be done in wireframe
     */
    set forceWireframe(value) {
        if (this._forceWireframe === value) {
            return;
        }
        this._forceWireframe = value;
        this.markAllMaterialsAsDirty(16);
    }
    get forceWireframe() {
        return this._forceWireframe;
    }
    /**
     * Gets or sets a boolean indicating if we should skip the frustum clipping part of the active meshes selection
     */
    set skipFrustumClipping(value) {
        if (this._skipFrustumClipping === value) {
            return;
        }
        this._skipFrustumClipping = value;
    }
    get skipFrustumClipping() {
        return this._skipFrustumClipping;
    }
    /**
     * Gets or sets a boolean indicating if all rendering must be done in point cloud
     */
    set forcePointsCloud(value) {
        if (this._forcePointsCloud === value) {
            return;
        }
        this._forcePointsCloud = value;
        this.markAllMaterialsAsDirty(16);
    }
    get forcePointsCloud() {
        return this._forcePointsCloud;
    }
    /**
     * Texture used in all pbr material as the reflection texture.
     * As in the majority of the scene they are the same (exception for multi room and so on),
     * this is easier to reference from here than from all the materials.
     */
    get environmentTexture() {
        return this._environmentTexture;
    }
    /**
     * Texture used in all pbr material as the reflection texture.
     * As in the majority of the scene they are the same (exception for multi room and so on),
     * this is easier to set here than in all the materials.
     */
    set environmentTexture(value) {
        if (this._environmentTexture === value) {
            return;
        }
        this._environmentTexture = value;
        this.markAllMaterialsAsDirty(1);
    }
    /**
     * @returns all meshes, lights, cameras, transformNodes and bones
     */
    getNodes() {
        let nodes = [];
        nodes = nodes.concat(this.meshes);
        nodes = nodes.concat(this.lights);
        nodes = nodes.concat(this.cameras);
        nodes = nodes.concat(this.transformNodes); // dummies
        this.skeletons.forEach((skeleton) => (nodes = nodes.concat(skeleton.bones)));
        return nodes;
    }
    /**
     * Gets or sets the animation properties override
     */
    get animationPropertiesOverride() {
        return this._animationPropertiesOverride;
    }
    set animationPropertiesOverride(value) {
        this._animationPropertiesOverride = value;
    }
    /** Sets a function to be executed when this scene is disposed. */
    set onDispose(callback) {
        if (this._onDisposeObserver) {
            this.onDisposeObservable.remove(this._onDisposeObserver);
        }
        this._onDisposeObserver = this.onDisposeObservable.add(callback);
    }
    /** Sets a function to be executed before rendering this scene */
    set beforeRender(callback) {
        if (this._onBeforeRenderObserver) {
            this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
        }
        if (callback) {
            this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);
        }
    }
    /** Sets a function to be executed after rendering this scene */
    set afterRender(callback) {
        if (this._onAfterRenderObserver) {
            this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
        }
        if (callback) {
            this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);
        }
    }
    /** Sets a function to be executed before rendering a camera*/
    set beforeCameraRender(callback) {
        if (this._onBeforeCameraRenderObserver) {
            this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver);
        }
        this._onBeforeCameraRenderObserver = this.onBeforeCameraRenderObservable.add(callback);
    }
    /** Sets a function to be executed after rendering a camera*/
    set afterCameraRender(callback) {
        if (this._onAfterCameraRenderObserver) {
            this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver);
        }
        this._onAfterCameraRenderObserver = this.onAfterCameraRenderObservable.add(callback);
    }
    /**
     * Gets or sets a predicate used to select candidate meshes for a pointer down event
     */
    get pointerDownPredicate() {
        return this._pointerPickingConfiguration.pointerDownPredicate;
    }
    set pointerDownPredicate(value) {
        this._pointerPickingConfiguration.pointerDownPredicate = value;
    }
    /**
     * Gets or sets a predicate used to select candidate meshes for a pointer up event
     */
    get pointerUpPredicate() {
        return this._pointerPickingConfiguration.pointerUpPredicate;
    }
    set pointerUpPredicate(value) {
        this._pointerPickingConfiguration.pointerUpPredicate = value;
    }
    /**
     * Gets or sets a predicate used to select candidate meshes for a pointer move event
     */
    get pointerMovePredicate() {
        return this._pointerPickingConfiguration.pointerMovePredicate;
    }
    set pointerMovePredicate(value) {
        this._pointerPickingConfiguration.pointerMovePredicate = value;
    }
    /**
     * Gets or sets a predicate used to select candidate meshes for a pointer down event
     */
    get pointerDownFastCheck() {
        return this._pointerPickingConfiguration.pointerDownFastCheck;
    }
    set pointerDownFastCheck(value) {
        this._pointerPickingConfiguration.pointerDownFastCheck = value;
    }
    /**
     * Gets or sets a predicate used to select candidate meshes for a pointer up event
     */
    get pointerUpFastCheck() {
        return this._pointerPickingConfiguration.pointerUpFastCheck;
    }
    set pointerUpFastCheck(value) {
        this._pointerPickingConfiguration.pointerUpFastCheck = value;
    }
    /**
     * Gets or sets a predicate used to select candidate meshes for a pointer move event
     */
    get pointerMoveFastCheck() {
        return this._pointerPickingConfiguration.pointerMoveFastCheck;
    }
    set pointerMoveFastCheck(value) {
        this._pointerPickingConfiguration.pointerMoveFastCheck = value;
    }
    /**
     * Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer move event occurs.
     */
    get skipPointerMovePicking() {
        return this._pointerPickingConfiguration.skipPointerMovePicking;
    }
    set skipPointerMovePicking(value) {
        this._pointerPickingConfiguration.skipPointerMovePicking = value;
    }
    /**
     * Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer down event occurs.
     */
    get skipPointerDownPicking() {
        return this._pointerPickingConfiguration.skipPointerDownPicking;
    }
    set skipPointerDownPicking(value) {
        this._pointerPickingConfiguration.skipPointerDownPicking = value;
    }
    /**
     * Gets or sets a boolean indicating if the user want to entirely skip the picking phase when a pointer up event occurs.  Off by default.
     */
    get skipPointerUpPicking() {
        return this._pointerPickingConfiguration.skipPointerUpPicking;
    }
    set skipPointerUpPicking(value) {
        this._pointerPickingConfiguration.skipPointerUpPicking = value;
    }
    /**
     * Gets the pointer coordinates without any translation (ie. straight out of the pointer event)
     */
    get unTranslatedPointer() {
        return this._inputManager.unTranslatedPointer;
    }
    /**
     * Gets or sets the distance in pixel that you have to move to prevent some events. Default is 10 pixels
     */
    static get DragMovementThreshold() {
        return InputManager.DragMovementThreshold;
    }
    static set DragMovementThreshold(value) {
        InputManager.DragMovementThreshold = value;
    }
    /**
     * Time in milliseconds to wait to raise long press events if button is still pressed. Default is 500 ms
     */
    static get LongPressDelay() {
        return InputManager.LongPressDelay;
    }
    static set LongPressDelay(value) {
        InputManager.LongPressDelay = value;
    }
    /**
     * Time in milliseconds to wait to raise long press events if button is still pressed. Default is 300 ms
     */
    static get DoubleClickDelay() {
        return InputManager.DoubleClickDelay;
    }
    static set DoubleClickDelay(value) {
        InputManager.DoubleClickDelay = value;
    }
    /** If you need to check double click without raising a single click at first click, enable this flag */
    static get ExclusiveDoubleClickMode() {
        return InputManager.ExclusiveDoubleClickMode;
    }
    static set ExclusiveDoubleClickMode(value) {
        InputManager.ExclusiveDoubleClickMode = value;
    }
    /**
     * Bind the current view position to an effect.
     * @param effect The effect to be bound
     * @param variableName name of the shader variable that will hold the eye position
     * @param isVector3 true to indicates that variableName is a Vector3 and not a Vector4
     * @returns the computed eye position
     */
    bindEyePosition(effect, variableName = "vEyePosition", isVector3 = false) {
        const eyePosition = this._forcedViewPosition ? this._forcedViewPosition : this._mirroredCameraPosition ? this._mirroredCameraPosition : this.activeCamera.globalPosition;
        const invertNormal = this.useRightHandedSystem === (this._mirroredCameraPosition != null);
        math_vector/* TmpVectors */.AA.Vector4[0].set(eyePosition.x, eyePosition.y, eyePosition.z, invertNormal ? -1 : 1);
        if (effect) {
            if (isVector3) {
                effect.setFloat3(variableName, math_vector/* TmpVectors */.AA.Vector4[0].x, math_vector/* TmpVectors */.AA.Vector4[0].y, math_vector/* TmpVectors */.AA.Vector4[0].z);
            }
            else {
                effect.setVector4(variableName, math_vector/* TmpVectors */.AA.Vector4[0]);
            }
        }
        return math_vector/* TmpVectors */.AA.Vector4[0];
    }
    /**
     * Update the scene ubo before it can be used in rendering processing
     * @returns the scene UniformBuffer
     */
    finalizeSceneUbo() {
        const ubo = this.getSceneUniformBuffer();
        const eyePosition = this.bindEyePosition(null);
        ubo.updateFloat4("vEyePosition", eyePosition.x, eyePosition.y, eyePosition.z, eyePosition.w);
        ubo.update();
        return ubo;
    }
    /**
     * Gets or sets a boolean indicating if the scene must use right-handed coordinates system
     */
    set useRightHandedSystem(value) {
        if (this._useRightHandedSystem === value) {
            return;
        }
        this._useRightHandedSystem = value;
        this.markAllMaterialsAsDirty(16);
    }
    get useRightHandedSystem() {
        return this._useRightHandedSystem;
    }
    /**
     * Sets the step Id used by deterministic lock step
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
     * @param newStepId defines the step Id
     */
    setStepId(newStepId) {
        this._currentStepId = newStepId;
    }
    /**
     * Gets the step Id used by deterministic lock step
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
     * @returns the step Id
     */
    getStepId() {
        return this._currentStepId;
    }
    /**
     * Gets the internal step used by deterministic lock step
     * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
     * @returns the internal step
     */
    getInternalStep() {
        return this._currentInternalStep;
    }
    /**
     * Gets or sets a boolean indicating if fog is enabled on this scene
     * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
     * (Default is true)
     */
    set fogEnabled(value) {
        if (this._fogEnabled === value) {
            return;
        }
        this._fogEnabled = value;
        this.markAllMaterialsAsDirty(16);
    }
    get fogEnabled() {
        return this._fogEnabled;
    }
    /**
     * Gets or sets the fog mode to use
     * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
     * | mode | value |
     * | --- | --- |
     * | FOGMODE_NONE | 0 |
     * | FOGMODE_EXP | 1 |
     * | FOGMODE_EXP2 | 2 |
     * | FOGMODE_LINEAR | 3 |
     */
    set fogMode(value) {
        if (this._fogMode === value) {
            return;
        }
        this._fogMode = value;
        this.markAllMaterialsAsDirty(16);
    }
    get fogMode() {
        return this._fogMode;
    }
    /**
     * Flag indicating that the frame buffer binding is handled by another component
     */
    get prePass() {
        return !!this.prePassRenderer && this.prePassRenderer.defaultRT.enabled;
    }
    /**
     * Gets or sets a boolean indicating if shadows are enabled on this scene
     */
    set shadowsEnabled(value) {
        if (this._shadowsEnabled === value) {
            return;
        }
        this._shadowsEnabled = value;
        this.markAllMaterialsAsDirty(2);
    }
    get shadowsEnabled() {
        return this._shadowsEnabled;
    }
    /**
     * Gets or sets a boolean indicating if lights are enabled on this scene
     */
    set lightsEnabled(value) {
        if (this._lightsEnabled === value) {
            return;
        }
        this._lightsEnabled = value;
        this.markAllMaterialsAsDirty(2);
    }
    get lightsEnabled() {
        return this._lightsEnabled;
    }
    /** All of the active cameras added to this scene. */
    get activeCameras() {
        return this._activeCameras;
    }
    set activeCameras(cameras) {
        if (this._unObserveActiveCameras) {
            this._unObserveActiveCameras();
            this._unObserveActiveCameras = null;
        }
        if (cameras) {
            this._unObserveActiveCameras = (0,arrayTools/* _ObserveArray */.lL)(cameras, () => {
                this.onActiveCamerasChanged.notifyObservers(this);
            });
        }
        this._activeCameras = cameras;
    }
    /** Gets or sets the current active camera */
    get activeCamera() {
        return this._activeCamera;
    }
    set activeCamera(value) {
        if (value === this._activeCamera) {
            return;
        }
        this._activeCamera = value;
        this.onActiveCameraChanged.notifyObservers(this);
    }
    /** The default material used on meshes when no material is affected */
    get defaultMaterial() {
        if (!this._defaultMaterial) {
            this._defaultMaterial = Scene.DefaultMaterialFactory(this);
        }
        return this._defaultMaterial;
    }
    /** The default material used on meshes when no material is affected */
    set defaultMaterial(value) {
        this._defaultMaterial = value;
    }
    /**
     * Gets or sets a boolean indicating if textures are enabled on this scene
     */
    set texturesEnabled(value) {
        if (this._texturesEnabled === value) {
            return;
        }
        this._texturesEnabled = value;
        this.markAllMaterialsAsDirty(1);
    }
    get texturesEnabled() {
        return this._texturesEnabled;
    }
    /**
     * Gets or sets the frame graph used to render the scene. If set, the scene will use the frame graph to render the scene instead of the default render loop.
     */
    get frameGraph() {
        return this._frameGraph;
    }
    set frameGraph(value) {
        if (this._frameGraph) {
            this._frameGraph = value;
            if (!value) {
                this.customRenderFunction = this._currentCustomRenderFunction;
            }
            return;
        }
        this._frameGraph = value;
        if (value) {
            this._currentCustomRenderFunction = this.customRenderFunction;
            this.customRenderFunction = this._renderWithFrameGraph;
        }
    }
    /**
     * Gets or sets a boolean indicating if skeletons are enabled on this scene
     */
    set skeletonsEnabled(value) {
        if (this._skeletonsEnabled === value) {
            return;
        }
        this._skeletonsEnabled = value;
        this.markAllMaterialsAsDirty(8);
    }
    get skeletonsEnabled() {
        return this._skeletonsEnabled;
    }
    /** @internal */
    get collisionCoordinator() {
        if (!this._collisionCoordinator) {
            this._collisionCoordinator = Scene.CollisionCoordinatorFactory();
            this._collisionCoordinator.init(this);
        }
        return this._collisionCoordinator;
    }
    /**
     * Gets the scene's rendering manager
     */
    get renderingManager() {
        return this._renderingManager;
    }
    /**
     * Gets the list of frustum planes (built from the active camera)
     */
    get frustumPlanes() {
        return this._frustumPlanes;
    }
    /**
     * Registers the transient components if needed.
     */
    _registerTransientComponents() {
        // Register components that have been associated lately to the scene.
        if (this._transientComponents.length > 0) {
            for (const component of this._transientComponents) {
                component.register();
            }
            this._transientComponents.length = 0;
        }
    }
    /**
     * @internal
     * Add a component to the scene.
     * Note that the ccomponent could be registered on th next frame if this is called after
     * the register component stage.
     * @param component Defines the component to add to the scene
     */
    _addComponent(component) {
        this._components.push(component);
        this._transientComponents.push(component);
        const serializableComponent = component;
        if (serializableComponent.addFromContainer && serializableComponent.serialize) {
            this._serializableComponents.push(serializableComponent);
        }
    }
    /**
     * @internal
     * Gets a component from the scene.
     * @param name defines the name of the component to retrieve
     * @returns the component or null if not present
     */
    _getComponent(name) {
        for (const component of this._components) {
            if (component.name === name) {
                return component;
            }
        }
        return null;
    }
    /**
     * Creates a new Scene
     * @param engine defines the engine to use to render this scene
     * @param options defines the scene options
     */
    constructor(engine, options) {
        /** @internal */
        this._inputManager = new InputManager(this);
        /** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */
        this.cameraToUseForPointers = null;
        /** @internal */
        this._isScene = true;
        /** @internal */
        this._blockEntityCollection = false;
        /**
         * Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame
         */
        this.autoClear = true;
        /**
         * Gets or sets a boolean that indicates if the scene must clear the depth and stencil buffers before rendering a frame
         */
        this.autoClearDepthAndStencil = true;
        this._clearColor = new math_color/* Color4 */.ov(0.2, 0.2, 0.3, 1.0);
        /**
         * Observable triggered when the performance priority is changed
         */
        this.onClearColorChangedObservable = new observable/* Observable */.cP();
        /**
         * Defines the color used to simulate the ambient color (Default is (0, 0, 0))
         */
        this.ambientColor = new math_color/* Color3 */.v9(0, 0, 0);
        /**
         * Intensity of the environment in all pbr material.
         * This dims or reinforces the IBL lighting overall (reflection and diffuse).
         * As in the majority of the scene they are the same (exception for multi room and so on),
         * this is easier to reference from here than from all the materials.
         */
        this.environmentIntensity = 1;
        this._performancePriority = 0 /* ScenePerformancePriority.BackwardCompatible */;
        /**
         * Observable triggered when the performance priority is changed
         */
        this.onScenePerformancePriorityChangedObservable = new observable/* Observable */.cP();
        this._forceWireframe = false;
        this._skipFrustumClipping = false;
        this._forcePointsCloud = false;
        /**
         * Gets the list of root nodes (ie. nodes with no parent)
         */
        this.rootNodes = [];
        /** All of the cameras added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
         */
        this.cameras = [];
        /**
         * All of the lights added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
         */
        this.lights = [];
        /**
         * All of the (abstract) meshes added to this scene
         */
        this.meshes = [];
        /**
         * The list of skeletons added to the scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
         */
        this.skeletons = [];
        /**
         * All of the particle systems added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
         */
        this.particleSystems = [];
        /**
         * Gets a list of Animations associated with the scene
         */
        this.animations = [];
        /**
         * All of the animation groups added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations
         */
        this.animationGroups = [];
        /**
         * All of the multi-materials added to this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials
         */
        this.multiMaterials = [];
        /**
         * All of the materials added to this scene
         * In the context of a Scene, it is not supposed to be modified manually.
         * Any addition or removal should be done using the addMaterial and removeMaterial Scene methods.
         * Note also that the order of the Material within the array is not significant and might change.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
         */
        this.materials = [];
        /**
         * The list of morph target managers added to the scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph
         */
        this.morphTargetManagers = [];
        /**
         * The list of geometries used in the scene.
         */
        this.geometries = [];
        /**
         * All of the transform nodes added to this scene
         * In the context of a Scene, it is not supposed to be modified manually.
         * Any addition or removal should be done using the addTransformNode and removeTransformNode Scene methods.
         * Note also that the order of the TransformNode within the array is not significant and might change.
         * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/transform_node
         */
        this.transformNodes = [];
        /**
         * ActionManagers available on the scene.
         * @deprecated
         */
        this.actionManagers = [];
        /**
         * Textures to keep.
         */
        this.textures = [];
        /** @internal */
        this._environmentTexture = null;
        /**
         * The list of postprocesses added to the scene
         */
        this.postProcesses = [];
        /**
         * The list of effect layers (highlights/glow) added to the scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/highlightLayer
         * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/glowLayer
         */
        this.effectLayers = [];
        /**
         * The list of sounds used in the scene.
         */
        this.sounds = null;
        /**
         * The list of layers (background and foreground) of the scene
         */
        this.layers = [];
        /**
         * The list of lens flare system added to the scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
         */
        this.lensFlareSystems = [];
        /**
         * The list of procedural textures added to the scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures
         */
        this.proceduralTextures = [];
        /**
         * Gets or sets a boolean indicating if animations are enabled
         */
        this.animationsEnabled = true;
        this._animationPropertiesOverride = null;
        /**
         * Gets or sets a boolean indicating if a constant deltatime has to be used
         * This is mostly useful for testing purposes when you do not want the animations to scale with the framerate
         */
        this.useConstantAnimationDeltaTime = false;
        /**
         * Gets or sets a boolean indicating if the scene must keep the meshUnderPointer property updated
         * Please note that it requires to run a ray cast through the scene on every frame
         */
        this.constantlyUpdateMeshUnderPointer = false;
        /**
         * Defines the HTML cursor to use when hovering over interactive elements
         */
        this.hoverCursor = "pointer";
        /**
         * Defines the HTML default cursor to use (empty by default)
         */
        this.defaultCursor = "";
        /**
         * Defines whether cursors are handled by the scene.
         */
        this.doNotHandleCursors = false;
        /**
         * This is used to call preventDefault() on pointer down
         * in order to block unwanted artifacts like system double clicks
         */
        this.preventDefaultOnPointerDown = true;
        /**
         * This is used to call preventDefault() on pointer up
         * in order to block unwanted artifacts like system double clicks
         */
        this.preventDefaultOnPointerUp = true;
        // Metadata
        /**
         * Gets or sets user defined metadata
         */
        this.metadata = null;
        /**
         * For internal use only. Please do not use.
         */
        this.reservedDataStore = null;
        /**
         * Use this array to add regular expressions used to disable offline support for specific urls
         */
        this.disableOfflineSupportExceptionRules = [];
        /**
         * An event triggered when the scene is disposed.
         */
        this.onDisposeObservable = new observable/* Observable */.cP();
        this._onDisposeObserver = null;
        /**
         * An event triggered before rendering the scene (right after animations and physics)
         */
        this.onBeforeRenderObservable = new observable/* Observable */.cP();
        this._onBeforeRenderObserver = null;
        /**
         * An event triggered after rendering the scene
         */
        this.onAfterRenderObservable = new observable/* Observable */.cP();
        /**
         * An event triggered after rendering the scene for an active camera (When scene.render is called this will be called after each camera)
         * This is triggered for each "sub" camera in a Camera Rig unlike onAfterCameraRenderObservable
         */
        this.onAfterRenderCameraObservable = new observable/* Observable */.cP();
        this._onAfterRenderObserver = null;
        /**
         * An event triggered before animating the scene
         */
        this.onBeforeAnimationsObservable = new observable/* Observable */.cP();
        /**
         * An event triggered after animations processing
         */
        this.onAfterAnimationsObservable = new observable/* Observable */.cP();
        /**
         * An event triggered before draw calls are ready to be sent
         */
        this.onBeforeDrawPhaseObservable = new observable/* Observable */.cP();
        /**
         * An event triggered after draw calls have been sent
         */
        this.onAfterDrawPhaseObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when the scene is ready
         */
        this.onReadyObservable = new observable/* Observable */.cP();
        /**
         * An event triggered before rendering a camera
         */
        this.onBeforeCameraRenderObservable = new observable/* Observable */.cP();
        this._onBeforeCameraRenderObserver = null;
        /**
         * An event triggered after rendering a camera
         * This is triggered for the full rig Camera only unlike onAfterRenderCameraObservable
         */
        this.onAfterCameraRenderObservable = new observable/* Observable */.cP();
        this._onAfterCameraRenderObserver = null;
        /**
         * An event triggered when active meshes evaluation is about to start
         */
        this.onBeforeActiveMeshesEvaluationObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when active meshes evaluation is done
         */
        this.onAfterActiveMeshesEvaluationObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when particles rendering is about to start
         * Note: This event can be trigger more than once per frame (because particles can be rendered by render target textures as well)
         */
        this.onBeforeParticlesRenderingObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when particles rendering is done
         * Note: This event can be trigger more than once per frame (because particles can be rendered by render target textures as well)
         */
        this.onAfterParticlesRenderingObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when SceneLoader.Append or SceneLoader.Load or SceneLoader.ImportMesh were successfully executed
         */
        this.onDataLoadedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a camera is created
         */
        this.onNewCameraAddedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a camera is removed
         */
        this.onCameraRemovedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a light is created
         */
        this.onNewLightAddedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a light is removed
         */
        this.onLightRemovedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a geometry is created
         */
        this.onNewGeometryAddedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a geometry is removed
         */
        this.onGeometryRemovedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a transform node is created
         */
        this.onNewTransformNodeAddedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a transform node is removed
         */
        this.onTransformNodeRemovedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a mesh is created
         */
        this.onNewMeshAddedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a mesh is removed
         */
        this.onMeshRemovedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a skeleton is created
         */
        this.onNewSkeletonAddedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a skeleton is removed
         */
        this.onSkeletonRemovedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a material is created
         */
        this.onNewMaterialAddedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a multi material is created
         */
        this.onNewMultiMaterialAddedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a material is removed
         */
        this.onMaterialRemovedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a multi material is removed
         */
        this.onMultiMaterialRemovedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a texture is created
         */
        this.onNewTextureAddedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when a texture is removed
         */
        this.onTextureRemovedObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when render targets are about to be rendered
         * Can happen multiple times per frame.
         */
        this.onBeforeRenderTargetsRenderObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when render targets were rendered.
         * Can happen multiple times per frame.
         */
        this.onAfterRenderTargetsRenderObservable = new observable/* Observable */.cP();
        /**
         * An event triggered before calculating deterministic simulation step
         */
        this.onBeforeStepObservable = new observable/* Observable */.cP();
        /**
         * An event triggered after calculating deterministic simulation step
         */
        this.onAfterStepObservable = new observable/* Observable */.cP();
        /**
         * An event triggered when the activeCamera property is updated
         */
        this.onActiveCameraChanged = new observable/* Observable */.cP();
        /**
         * An event triggered when the activeCameras property is updated
         */
        this.onActiveCamerasChanged = new observable/* Observable */.cP();
        /**
         * This Observable will be triggered before rendering each renderingGroup of each rendered camera.
         * The RenderingGroupInfo class contains all the information about the context in which the observable is called
         * If you wish to register an Observer only for a given set of renderingGroup, use the mask with a combination of the renderingGroup index elevated to the power of two (1 for renderingGroup 0, 2 for renderingrOup1, 4 for 2 and 8 for 3)
         */
        this.onBeforeRenderingGroupObservable = new observable/* Observable */.cP();
        /**
         * This Observable will be triggered after rendering each renderingGroup of each rendered camera.
         * The RenderingGroupInfo class contains all the information about the context in which the observable is called
         * If you wish to register an Observer only for a given set of renderingGroup, use the mask with a combination of the renderingGroup index elevated to the power of two (1 for renderingGroup 0, 2 for renderingrOup1, 4 for 2 and 8 for 3)
         */
        this.onAfterRenderingGroupObservable = new observable/* Observable */.cP();
        /**
         * This Observable will when a mesh has been imported into the scene.
         */
        this.onMeshImportedObservable = new observable/* Observable */.cP();
        /**
         * This Observable will when an animation file has been imported into the scene.
         */
        this.onAnimationFileImportedObservable = new observable/* Observable */.cP();
        // Animations
        /** @internal */
        this._registeredForLateAnimationBindings = new smartArray/* SmartArrayNoDuplicate */.b(256);
        // Pointers
        this._pointerPickingConfiguration = new PointerPickingConfiguration();
        /**
         * This observable event is triggered when any ponter event is triggered. It is registered during Scene.attachControl() and it is called BEFORE the 3D engine process anything (mesh/sprite picking for instance).
         * You have the possibility to skip the process and the call to onPointerObservable by setting PointerInfoPre.skipOnPointerObservable to true
         */
        this.onPrePointerObservable = new observable/* Observable */.cP();
        /**
         * Observable event triggered each time an input event is received from the rendering canvas
         */
        this.onPointerObservable = new observable/* Observable */.cP();
        // Keyboard
        /**
         * This observable event is triggered when any keyboard event si raised and registered during Scene.attachControl()
         * You have the possibility to skip the process and the call to onKeyboardObservable by setting KeyboardInfoPre.skipOnPointerObservable to true
         */
        this.onPreKeyboardObservable = new observable/* Observable */.cP();
        /**
         * Observable event triggered each time an keyboard event is received from the hosting window
         */
        this.onKeyboardObservable = new observable/* Observable */.cP();
        // Coordinates system
        this._useRightHandedSystem = false;
        // Deterministic lockstep
        this._timeAccumulator = 0;
        this._currentStepId = 0;
        this._currentInternalStep = 0;
        // Fog
        this._fogEnabled = true;
        this._fogMode = Scene.FOGMODE_NONE;
        /**
         * Gets or sets the fog color to use
         * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
         * (Default is Color3(0.2, 0.2, 0.3))
         */
        this.fogColor = new math_color/* Color3 */.v9(0.2, 0.2, 0.3);
        /**
         * Gets or sets the fog density to use
         * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
         * (Default is 0.1)
         */
        this.fogDensity = 0.1;
        /**
         * Gets or sets the fog start distance to use
         * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
         * (Default is 0)
         */
        this.fogStart = 0;
        /**
         * Gets or sets the fog end distance to use
         * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/environment_introduction#fog
         * (Default is 1000)
         */
        this.fogEnd = 1000.0;
        /**
         * Flag indicating if we need to store previous matrices when rendering
         */
        this.needsPreviousWorldMatrices = false;
        // Lights
        this._shadowsEnabled = true;
        this._lightsEnabled = true;
        this._unObserveActiveCameras = null;
        // Textures
        this._texturesEnabled = true;
        this._frameGraph = null;
        // Physics
        /**
         * Gets or sets a boolean indicating if physic engines are enabled on this scene
         */
        this.physicsEnabled = true;
        // Particles
        /**
         * Gets or sets a boolean indicating if particles are enabled on this scene
         */
        this.particlesEnabled = true;
        // Sprites
        /**
         * Gets or sets a boolean indicating if sprites are enabled on this scene
         */
        this.spritesEnabled = true;
        // Skeletons
        this._skeletonsEnabled = true;
        // Lens flares
        /**
         * Gets or sets a boolean indicating if lens flares are enabled on this scene
         */
        this.lensFlaresEnabled = true;
        // Collisions
        /**
         * Gets or sets a boolean indicating if collisions are enabled on this scene
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
         */
        this.collisionsEnabled = true;
        /**
         * Defines the gravity applied to this scene (used only for collisions)
         * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
         */
        this.gravity = new math_vector/* Vector3 */.Pq(0, -9.807, 0);
        // Postprocesses
        /**
         * Gets or sets a boolean indicating if postprocesses are enabled on this scene
         */
        this.postProcessesEnabled = true;
        // Customs render targets
        /**
         * Gets or sets a boolean indicating if render targets are enabled on this scene
         */
        this.renderTargetsEnabled = true;
        /**
         * Gets or sets a boolean indicating if next render targets must be dumped as image for debugging purposes
         * We recommend not using it and instead rely on Spector.js: http://spector.babylonjs.com
         */
        this.dumpNextRenderTargets = false;
        /**
         * The list of user defined render targets added to the scene
         */
        this.customRenderTargets = [];
        /**
         * Gets the list of meshes imported to the scene through SceneLoader
         */
        this.importedMeshesFiles = [];
        // Probes
        /**
         * Gets or sets a boolean indicating if probes are enabled on this scene
         */
        this.probesEnabled = true;
        this._meshesForIntersections = new smartArray/* SmartArrayNoDuplicate */.b(256);
        // Procedural textures
        /**
         * Gets or sets a boolean indicating if procedural textures are enabled on this scene
         */
        this.proceduralTexturesEnabled = true;
        // Performance counters
        this._totalVertices = new perfCounter/* PerfCounter */.A();
        /** @internal */
        this._activeIndices = new perfCounter/* PerfCounter */.A();
        /** @internal */
        this._activeParticles = new perfCounter/* PerfCounter */.A();
        /** @internal */
        this._activeBones = new perfCounter/* PerfCounter */.A();
        /** @internal */
        this._animationTime = 0;
        /**
         * Gets or sets a general scale for animation speed
         * @see https://www.babylonjs-playground.com/#IBU2W7#3
         */
        this.animationTimeScale = 1;
        this._renderId = 0;
        this._frameId = 0;
        this._executeWhenReadyTimeoutId = null;
        this._intermediateRendering = false;
        this._defaultFrameBufferCleared = false;
        this._viewUpdateFlag = -1;
        this._projectionUpdateFlag = -1;
        /** @internal */
        this._toBeDisposed = new Array(256);
        this._activeRequests = new Array();
        /** @internal */
        this._pendingData = new Array();
        this._isDisposed = false;
        /**
         * Gets or sets a boolean indicating that all submeshes of active meshes must be rendered
         * Use this boolean to avoid computing frustum clipping on submeshes (This could help when you are CPU bound)
         */
        this.dispatchAllSubMeshesOfActiveMeshes = false;
        this._activeMeshes = new smartArray/* SmartArray */.L(256);
        this._processedMaterials = new smartArray/* SmartArray */.L(256);
        this._renderTargets = new smartArray/* SmartArrayNoDuplicate */.b(256);
        this._materialsRenderTargets = new smartArray/* SmartArrayNoDuplicate */.b(256);
        /** @internal */
        this._activeParticleSystems = new smartArray/* SmartArray */.L(256);
        this._activeSkeletons = new smartArray/* SmartArrayNoDuplicate */.b(32);
        this._softwareSkinnedMeshes = new smartArray/* SmartArrayNoDuplicate */.b(32);
        /** @internal */
        this._activeAnimatables = new Array();
        this._transformMatrix = math_vector/* Matrix */.uq.Zero();
        /**
         * Gets or sets a boolean indicating if lights must be sorted by priority (off by default)
         * This is useful if there are more lights that the maximum simulteanous authorized
         */
        this.requireLightSorting = false;
        /**
         * @internal
         * Backing store of defined scene components.
         */
        this._components = [];
        /**
         * @internal
         * Backing store of defined scene components.
         */
        this._serializableComponents = [];
        /**
         * List of components to register on the next registration step.
         */
        this._transientComponents = [];
        /**
         * @internal
         * Defines the actions happening before camera updates.
         */
        this._beforeCameraUpdateStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening before clear the canvas.
         */
        this._beforeClearStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening before clear the canvas.
         */
        this._beforeRenderTargetClearStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions when collecting render targets for the frame.
         */
        this._gatherRenderTargetsStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening for one camera in the frame.
         */
        this._gatherActiveCameraRenderTargetsStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening during the per mesh ready checks.
         */
        this._isReadyForMeshStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening before evaluate active mesh checks.
         */
        this._beforeEvaluateActiveMeshStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening during the evaluate sub mesh checks.
         */
        this._evaluateSubMeshStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening during the active mesh stage.
         */
        this._preActiveMeshStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening during the per camera render target step.
         */
        this._cameraDrawRenderTargetStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just before the active camera is drawing.
         */
        this._beforeCameraDrawStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just before a render target is drawing.
         */
        this._beforeRenderTargetDrawStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just before a rendering group is drawing.
         */
        this._beforeRenderingGroupDrawStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just before a mesh is drawing.
         */
        this._beforeRenderingMeshStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just after a mesh has been drawn.
         */
        this._afterRenderingMeshStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just after a rendering group has been drawn.
         */
        this._afterRenderingGroupDrawStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just after the active camera has been drawn.
         */
        this._afterCameraDrawStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just after the post processing
         */
        this._afterCameraPostProcessStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just after a render target has been drawn.
         */
        this._afterRenderTargetDrawStage = sceneComponent/* Stage */.B.Create();
        /**
         * Defines the actions happening just after the post processing on a render target
         */
        this._afterRenderTargetPostProcessStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening just after rendering all cameras and computing intersections.
         */
        this._afterRenderStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening when a pointer move event happens.
         */
        this._pointerMoveStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening when a pointer down event happens.
         */
        this._pointerDownStage = sceneComponent/* Stage */.B.Create();
        /**
         * @internal
         * Defines the actions happening when a pointer up event happens.
         */
        this._pointerUpStage = sceneComponent/* Stage */.B.Create();
        /**
         * an optional map from Geometry Id to Geometry index in the 'geometries' array
         */
        this._geometriesByUniqueId = null;
        this._defaultMeshCandidates = {
            data: [],
            length: 0,
        };
        this._defaultSubMeshCandidates = {
            data: [],
            length: 0,
        };
        this._preventFreeActiveMeshesAndRenderingGroups = false;
        /** @internal */
        this._activeMeshesFrozen = false;
        /** @internal */
        this._activeMeshesFrozenButKeepClipping = false;
        this._skipEvaluateActiveMeshesCompletely = false;
        /** @internal */
        this._allowPostProcessClearColor = true;
        /**
         * User updatable function that will return a deterministic frame time when engine is in deterministic lock step mode
         * @returns the frame time
         */
        this.getDeterministicFrameTime = () => {
            return this._engine.getTimeStep();
        };
        /** @internal */
        this._registeredActions = 0;
        this._blockMaterialDirtyMechanism = false;
        /**
         * Internal perfCollector instance used for sharing between inspector and playground.
         * Marked as protected to allow sharing between prototype extensions, but disallow access at toplevel.
         */
        this._perfCollector = null;
        this.activeCameras = [];
        const fullOptions = {
            useGeometryUniqueIdsMap: true,
            useMaterialMeshMap: true,
            useClonedMeshMap: true,
            virtual: false,
            ...options,
        };
        engine = this._engine = engine || engineStore/* EngineStore */.q.LastCreatedEngine;
        if (fullOptions.virtual) {
            engine._virtualScenes.push(this);
        }
        else {
            engineStore/* EngineStore */.q._LastCreatedScene = this;
            engine.scenes.push(this);
        }
        this._uid = null;
        this._renderingManager = new renderingManager/* RenderingManager */.m(this);
        if (postProcessManager/* PostProcessManager */.X) {
            this.postProcessManager = new postProcessManager/* PostProcessManager */.X(this);
        }
        if ((0,domManagement/* IsWindowObjectExist */.BA)()) {
            this.attachControl();
        }
        // Uniform Buffer
        this._createUbo();
        // Default Image processing definition
        if (imageProcessingConfiguration/* ImageProcessingConfiguration */.p) {
            this._imageProcessingConfiguration = new imageProcessingConfiguration/* ImageProcessingConfiguration */.p();
        }
        this.setDefaultCandidateProviders();
        if (fullOptions.useGeometryUniqueIdsMap) {
            this._geometriesByUniqueId = {};
        }
        this.useMaterialMeshMap = fullOptions.useMaterialMeshMap;
        this.useClonedMeshMap = fullOptions.useClonedMeshMap;
        if (!options || !options.virtual) {
            engine.onNewSceneAddedObservable.notifyObservers(this);
        }
    }
    /**
     * Gets a string identifying the name of the class
     * @returns "Scene" string
     */
    getClassName() {
        return "Scene";
    }
    /**
     * @internal
     */
    _getDefaultMeshCandidates() {
        this._defaultMeshCandidates.data = this.meshes;
        this._defaultMeshCandidates.length = this.meshes.length;
        return this._defaultMeshCandidates;
    }
    /**
     * @internal
     */
    _getDefaultSubMeshCandidates(mesh) {
        this._defaultSubMeshCandidates.data = mesh.subMeshes;
        this._defaultSubMeshCandidates.length = mesh.subMeshes.length;
        return this._defaultSubMeshCandidates;
    }
    /**
     * Sets the default candidate providers for the scene.
     * This sets the getActiveMeshCandidates, getActiveSubMeshCandidates, getIntersectingSubMeshCandidates
     * and getCollidingSubMeshCandidates to their default function
     */
    setDefaultCandidateProviders() {
        this.getActiveMeshCandidates = () => this._getDefaultMeshCandidates();
        this.getActiveSubMeshCandidates = (mesh) => this._getDefaultSubMeshCandidates(mesh);
        this.getIntersectingSubMeshCandidates = (mesh, localRay) => this._getDefaultSubMeshCandidates(mesh);
        this.getCollidingSubMeshCandidates = (mesh, collider) => this._getDefaultSubMeshCandidates(mesh);
    }
    /**
     * Gets the mesh that is currently under the pointer
     */
    get meshUnderPointer() {
        return this._inputManager.meshUnderPointer;
    }
    /**
     * Gets or sets the current on-screen X position of the pointer
     */
    get pointerX() {
        return this._inputManager.pointerX;
    }
    set pointerX(value) {
        this._inputManager.pointerX = value;
    }
    /**
     * Gets or sets the current on-screen Y position of the pointer
     */
    get pointerY() {
        return this._inputManager.pointerY;
    }
    set pointerY(value) {
        this._inputManager.pointerY = value;
    }
    /**
     * Gets the cached material (ie. the latest rendered one)
     * @returns the cached material
     */
    getCachedMaterial() {
        return this._cachedMaterial;
    }
    /**
     * Gets the cached effect (ie. the latest rendered one)
     * @returns the cached effect
     */
    getCachedEffect() {
        return this._cachedEffect;
    }
    /**
     * Gets the cached visibility state (ie. the latest rendered one)
     * @returns the cached visibility state
     */
    getCachedVisibility() {
        return this._cachedVisibility;
    }
    /**
     * Gets a boolean indicating if the current material / effect / visibility must be bind again
     * @param material defines the current material
     * @param effect defines the current effect
     * @param visibility defines the current visibility state
     * @returns true if one parameter is not cached
     */
    isCachedMaterialInvalid(material, effect, visibility = 1) {
        return this._cachedEffect !== effect || this._cachedMaterial !== material || this._cachedVisibility !== visibility;
    }
    /**
     * Gets the engine associated with the scene
     * @returns an Engine
     */
    getEngine() {
        return this._engine;
    }
    /**
     * Gets the total number of vertices rendered per frame
     * @returns the total number of vertices rendered per frame
     */
    getTotalVertices() {
        return this._totalVertices.current;
    }
    /**
     * Gets the performance counter for total vertices
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
     */
    get totalVerticesPerfCounter() {
        return this._totalVertices;
    }
    /**
     * Gets the total number of active indices rendered per frame (You can deduce the number of rendered triangles by dividing this number by 3)
     * @returns the total number of active indices rendered per frame
     */
    getActiveIndices() {
        return this._activeIndices.current;
    }
    /**
     * Gets the performance counter for active indices
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
     */
    get totalActiveIndicesPerfCounter() {
        return this._activeIndices;
    }
    /**
     * Gets the total number of active particles rendered per frame
     * @returns the total number of active particles rendered per frame
     */
    getActiveParticles() {
        return this._activeParticles.current;
    }
    /**
     * Gets the performance counter for active particles
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
     */
    get activeParticlesPerfCounter() {
        return this._activeParticles;
    }
    /**
     * Gets the total number of active bones rendered per frame
     * @returns the total number of active bones rendered per frame
     */
    getActiveBones() {
        return this._activeBones.current;
    }
    /**
     * Gets the performance counter for active bones
     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#instrumentation
     */
    get activeBonesPerfCounter() {
        return this._activeBones;
    }
    /**
     * Gets the array of active meshes
     * @returns an array of AbstractMesh
     */
    getActiveMeshes() {
        return this._activeMeshes;
    }
    /**
     * Gets the animation ratio (which is 1.0 is the scene renders at 60fps and 2 if the scene renders at 30fps, etc.)
     * @returns a number
     */
    getAnimationRatio() {
        return this._animationRatio !== undefined ? this._animationRatio : 1;
    }
    /**
     * Gets an unique Id for the current render phase
     * @returns a number
     */
    getRenderId() {
        return this._renderId;
    }
    /**
     * Gets an unique Id for the current frame
     * @returns a number
     */
    getFrameId() {
        return this._frameId;
    }
    /** Call this function if you want to manually increment the render Id*/
    incrementRenderId() {
        this._renderId++;
    }
    _createUbo() {
        this.setSceneUniformBuffer(this.createSceneUniformBuffer());
    }
    /**
     * Use this method to simulate a pointer move on a mesh
     * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
     * @param pickResult pickingInfo of the object wished to simulate pointer event on
     * @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
     * @returns the current scene
     */
    simulatePointerMove(pickResult, pointerEventInit) {
        this._inputManager.simulatePointerMove(pickResult, pointerEventInit);
        return this;
    }
    /**
     * Use this method to simulate a pointer down on a mesh
     * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
     * @param pickResult pickingInfo of the object wished to simulate pointer event on
     * @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
     * @returns the current scene
     */
    simulatePointerDown(pickResult, pointerEventInit) {
        this._inputManager.simulatePointerDown(pickResult, pointerEventInit);
        return this;
    }
    /**
     * Use this method to simulate a pointer up on a mesh
     * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
     * @param pickResult pickingInfo of the object wished to simulate pointer event on
     * @param pointerEventInit pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)
     * @param doubleTap indicates that the pointer up event should be considered as part of a double click (false by default)
     * @returns the current scene
     */
    simulatePointerUp(pickResult, pointerEventInit, doubleTap) {
        this._inputManager.simulatePointerUp(pickResult, pointerEventInit, doubleTap);
        return this;
    }
    /**
     * Gets a boolean indicating if the current pointer event is captured (meaning that the scene has already handled the pointer down)
     * @param pointerId defines the pointer id to use in a multi-touch scenario (0 by default)
     * @returns true if the pointer was captured
     */
    isPointerCaptured(pointerId = 0) {
        return this._inputManager.isPointerCaptured(pointerId);
    }
    /**
     * Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp
     * @param attachUp defines if you want to attach events to pointerup
     * @param attachDown defines if you want to attach events to pointerdown
     * @param attachMove defines if you want to attach events to pointermove
     */
    attachControl(attachUp = true, attachDown = true, attachMove = true) {
        this._inputManager.attachControl(attachUp, attachDown, attachMove);
    }
    /** Detaches all event handlers*/
    detachControl() {
        this._inputManager.detachControl();
    }
    /**
     * This function will check if the scene can be rendered (textures are loaded, shaders are compiled)
     * Delay loaded resources are not taking in account
     * @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: true)
     * @returns true if all required resources are ready
     */
    isReady(checkRenderTargets = true) {
        if (this._isDisposed) {
            return false;
        }
        let index;
        const engine = this.getEngine();
        const currentRenderPassId = engine.currentRenderPassId;
        engine.currentRenderPassId = this.activeCamera?.renderPassId ?? currentRenderPassId;
        let isReady = true;
        // Pending data
        if (this._pendingData.length > 0) {
            isReady = false;
        }
        // Ensures that the pre-pass renderer is enabled if it is to be enabled.
        this.prePassRenderer?.update();
        // OIT
        if (this.useOrderIndependentTransparency && this.depthPeelingRenderer) {
            isReady && (isReady = this.depthPeelingRenderer.isReady());
        }
        // Meshes
        if (checkRenderTargets) {
            this._processedMaterials.reset();
            this._materialsRenderTargets.reset();
        }
        for (index = 0; index < this.meshes.length; index++) {
            const mesh = this.meshes[index];
            if (!mesh.subMeshes || mesh.subMeshes.length === 0) {
                continue;
            }
            // Do not stop at the first encountered "unready" object as we want to ensure
            // all materials are starting off their compilation in parallel.
            if (!mesh.isReady(true)) {
                isReady = false;
                continue;
            }
            const hardwareInstancedRendering = mesh.hasThinInstances ||
                mesh.getClassName() === "InstancedMesh" ||
                mesh.getClassName() === "InstancedLinesMesh" ||
                (engine.getCaps().instancedArrays && mesh.instances.length > 0);
            // Is Ready For Mesh
            for (const step of this._isReadyForMeshStage) {
                if (!step.action(mesh, hardwareInstancedRendering)) {
                    isReady = false;
                }
            }
            if (!checkRenderTargets) {
                continue;
            }
            const mat = mesh.material || this.defaultMaterial;
            if (mat) {
                if (mat._storeEffectOnSubMeshes) {
                    for (const subMesh of mesh.subMeshes) {
                        const material = subMesh.getMaterial();
                        if (material && material.hasRenderTargetTextures && material.getRenderTargetTextures != null) {
                            if (this._processedMaterials.indexOf(material) === -1) {
                                this._processedMaterials.push(material);
                                this._materialsRenderTargets.concatWithNoDuplicate(material.getRenderTargetTextures());
                            }
                        }
                    }
                }
                else {
                    if (mat.hasRenderTargetTextures && mat.getRenderTargetTextures != null) {
                        if (this._processedMaterials.indexOf(mat) === -1) {
                            this._processedMaterials.push(mat);
                            this._materialsRenderTargets.concatWithNoDuplicate(mat.getRenderTargetTextures());
                        }
                    }
                }
            }
        }
        // Render targets
        if (checkRenderTargets) {
            for (index = 0; index < this._materialsRenderTargets.length; ++index) {
                const rtt = this._materialsRenderTargets.data[index];
                if (!rtt.isReadyForRendering()) {
                    isReady = false;
                }
            }
        }
        // Geometries
        for (index = 0; index < this.geometries.length; index++) {
            const geometry = this.geometries[index];
            if (geometry.delayLoadState === 2) {
                isReady = false;
            }
        }
        // Post-processes
        if (this.activeCameras && this.activeCameras.length > 0) {
            for (const camera of this.activeCameras) {
                if (!camera.isReady(true)) {
                    isReady = false;
                }
            }
        }
        else if (this.activeCamera) {
            if (!this.activeCamera.isReady(true)) {
                isReady = false;
            }
        }
        // Particles
        for (const particleSystem of this.particleSystems) {
            if (!particleSystem.isReady()) {
                isReady = false;
            }
        }
        // Layers
        if (this.layers) {
            for (const layer of this.layers) {
                if (!layer.isReady()) {
                    isReady = false;
                }
            }
        }
        // Effects
        if (!engine.areAllEffectsReady()) {
            isReady = false;
        }
        engine.currentRenderPassId = currentRenderPassId;
        return isReady;
    }
    /** Resets all cached information relative to material (including effect and visibility) */
    resetCachedMaterial() {
        this._cachedMaterial = null;
        this._cachedEffect = null;
        this._cachedVisibility = null;
    }
    /**
     * Registers a function to be called before every frame render
     * @param func defines the function to register
     */
    registerBeforeRender(func) {
        this.onBeforeRenderObservable.add(func);
    }
    /**
     * Unregisters a function called before every frame render
     * @param func defines the function to unregister
     */
    unregisterBeforeRender(func) {
        this.onBeforeRenderObservable.removeCallback(func);
    }
    /**
     * Registers a function to be called after every frame render
     * @param func defines the function to register
     */
    registerAfterRender(func) {
        this.onAfterRenderObservable.add(func);
    }
    /**
     * Unregisters a function called after every frame render
     * @param func defines the function to unregister
     */
    unregisterAfterRender(func) {
        this.onAfterRenderObservable.removeCallback(func);
    }
    _executeOnceBeforeRender(func) {
        const execFunc = () => {
            func();
            setTimeout(() => {
                this.unregisterBeforeRender(execFunc);
            });
        };
        this.registerBeforeRender(execFunc);
    }
    /**
     * The provided function will run before render once and will be disposed afterwards.
     * A timeout delay can be provided so that the function will be executed in N ms.
     * The timeout is using the browser's native setTimeout so time percision cannot be guaranteed.
     * @param func The function to be executed.
     * @param timeout optional delay in ms
     */
    executeOnceBeforeRender(func, timeout) {
        if (timeout !== undefined) {
            setTimeout(() => {
                this._executeOnceBeforeRender(func);
            }, timeout);
        }
        else {
            this._executeOnceBeforeRender(func);
        }
    }
    /**
     * This function can help adding any object to the list of data awaited to be ready in order to check for a complete scene loading.
     * @param data defines the object to wait for
     */
    addPendingData(data) {
        this._pendingData.push(data);
    }
    /**
     * Remove a pending data from the loading list which has previously been added with addPendingData.
     * @param data defines the object to remove from the pending list
     */
    removePendingData(data) {
        const wasLoading = this.isLoading;
        const index = this._pendingData.indexOf(data);
        if (index !== -1) {
            this._pendingData.splice(index, 1);
        }
        if (wasLoading && !this.isLoading) {
            this.onDataLoadedObservable.notifyObservers(this);
        }
    }
    /**
     * Returns the number of items waiting to be loaded
     * @returns the number of items waiting to be loaded
     */
    getWaitingItemsCount() {
        return this._pendingData.length;
    }
    /**
     * Returns a boolean indicating if the scene is still loading data
     */
    get isLoading() {
        return this._pendingData.length > 0;
    }
    /**
     * Registers a function to be executed when the scene is ready
     * @param func - the function to be executed
     * @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: false)
     */
    executeWhenReady(func, checkRenderTargets = false) {
        this.onReadyObservable.addOnce(func);
        if (this._executeWhenReadyTimeoutId !== null) {
            return;
        }
        this._checkIsReady(checkRenderTargets);
    }
    /**
     * Returns a promise that resolves when the scene is ready
     * @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: false)
     * @returns A promise that resolves when the scene is ready
     */
    whenReadyAsync(checkRenderTargets = false) {
        return new Promise((resolve) => {
            this.executeWhenReady(() => {
                resolve();
            }, checkRenderTargets);
        });
    }
    /**
     * @internal
     */
    _checkIsReady(checkRenderTargets = false) {
        this._registerTransientComponents();
        if (this.isReady(checkRenderTargets)) {
            this.onReadyObservable.notifyObservers(this);
            this.onReadyObservable.clear();
            this._executeWhenReadyTimeoutId = null;
            return;
        }
        if (this._isDisposed) {
            this.onReadyObservable.clear();
            this._executeWhenReadyTimeoutId = null;
            return;
        }
        this._executeWhenReadyTimeoutId = setTimeout(() => {
            // Ensure materials effects are checked outside render loops
            this.incrementRenderId();
            this._checkIsReady(checkRenderTargets);
        }, 100);
    }
    /**
     * Gets all animatable attached to the scene
     */
    get animatables() {
        return this._activeAnimatables;
    }
    /**
     * Resets the last animation time frame.
     * Useful to override when animations start running when loading a scene for the first time.
     */
    resetLastAnimationTimeFrame() {
        this._animationTimeLast = precisionDate/* PrecisionDate */.j.Now;
    }
    // Matrix
    /**
     * Gets the current view matrix
     * @returns a Matrix
     */
    getViewMatrix() {
        return this._viewMatrix;
    }
    /**
     * Gets the current projection matrix
     * @returns a Matrix
     */
    getProjectionMatrix() {
        return this._projectionMatrix;
    }
    /**
     * Gets the current transform matrix
     * @returns a Matrix made of View * Projection
     */
    getTransformMatrix() {
        return this._transformMatrix;
    }
    /**
     * Sets the current transform matrix
     * @param viewL defines the View matrix to use
     * @param projectionL defines the Projection matrix to use
     * @param viewR defines the right View matrix to use (if provided)
     * @param projectionR defines the right Projection matrix to use (if provided)
     */
    setTransformMatrix(viewL, projectionL, viewR, projectionR) {
        // clear the multiviewSceneUbo if no viewR and projectionR are defined
        if (!viewR && !projectionR && this._multiviewSceneUbo) {
            this._multiviewSceneUbo.dispose();
            this._multiviewSceneUbo = null;
        }
        if (this._viewUpdateFlag === viewL.updateFlag && this._projectionUpdateFlag === projectionL.updateFlag) {
            return;
        }
        this._viewUpdateFlag = viewL.updateFlag;
        this._projectionUpdateFlag = projectionL.updateFlag;
        this._viewMatrix = viewL;
        this._projectionMatrix = projectionL;
        this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);
        // Update frustum
        if (!this._frustumPlanes) {
            this._frustumPlanes = math_frustum/* Frustum */.P.GetPlanes(this._transformMatrix);
        }
        else {
            math_frustum/* Frustum */.P.GetPlanesToRef(this._transformMatrix, this._frustumPlanes);
        }
        if (this._multiviewSceneUbo && this._multiviewSceneUbo.useUbo) {
            this._updateMultiviewUbo(viewR, projectionR);
        }
        else if (this._sceneUbo.useUbo) {
            this._sceneUbo.updateMatrix("viewProjection", this._transformMatrix);
            this._sceneUbo.updateMatrix("view", this._viewMatrix);
            this._sceneUbo.updateMatrix("projection", this._projectionMatrix);
        }
    }
    /**
     * Gets the uniform buffer used to store scene data
     * @returns a UniformBuffer
     */
    getSceneUniformBuffer() {
        return this._multiviewSceneUbo ? this._multiviewSceneUbo : this._sceneUbo;
    }
    /**
     * Creates a scene UBO
     * @param name name of the uniform buffer (optional, for debugging purpose only)
     * @returns a new ubo
     */
    createSceneUniformBuffer(name) {
        const sceneUbo = new uniformBuffer/* UniformBuffer */.D(this._engine, undefined, false, name ?? "scene");
        sceneUbo.addUniform("viewProjection", 16);
        sceneUbo.addUniform("view", 16);
        sceneUbo.addUniform("projection", 16);
        sceneUbo.addUniform("vEyePosition", 4);
        return sceneUbo;
    }
    /**
     * Sets the scene ubo
     * @param ubo the ubo to set for the scene
     */
    setSceneUniformBuffer(ubo) {
        this._sceneUbo = ubo;
        this._viewUpdateFlag = -1;
        this._projectionUpdateFlag = -1;
    }
    /**
     * Gets an unique (relatively to the current scene) Id
     * @returns an unique number for the scene
     */
    getUniqueId() {
        return uniqueIdGenerator/* UniqueIdGenerator */.K.UniqueId;
    }
    /**
     * Add a mesh to the list of scene's meshes
     * @param newMesh defines the mesh to add
     * @param recursive if all child meshes should also be added to the scene
     */
    addMesh(newMesh, recursive = false) {
        if (this._blockEntityCollection) {
            return;
        }
        this.meshes.push(newMesh);
        newMesh._resyncLightSources();
        if (!newMesh.parent) {
            newMesh._addToSceneRootNodes();
        }
        tools/* Tools */.S0.SetImmediate(() => {
            this.onNewMeshAddedObservable.notifyObservers(newMesh);
        });
        if (recursive) {
            newMesh.getChildMeshes().forEach((m) => {
                this.addMesh(m);
            });
        }
    }
    /**
     * Remove a mesh for the list of scene's meshes
     * @param toRemove defines the mesh to remove
     * @param recursive if all child meshes should also be removed from the scene
     * @returns the index where the mesh was in the mesh list
     */
    removeMesh(toRemove, recursive = false) {
        const index = this.meshes.indexOf(toRemove);
        if (index !== -1) {
            // Remove from the scene if the mesh found
            this.meshes.splice(index, 1);
            if (!toRemove.parent) {
                toRemove._removeFromSceneRootNodes();
            }
        }
        this._inputManager._invalidateMesh(toRemove);
        this.onMeshRemovedObservable.notifyObservers(toRemove);
        if (recursive) {
            toRemove.getChildMeshes().forEach((m) => {
                this.removeMesh(m);
            });
        }
        return index;
    }
    /**
     * Add a transform node to the list of scene's transform nodes
     * @param newTransformNode defines the transform node to add
     */
    addTransformNode(newTransformNode) {
        if (this._blockEntityCollection) {
            return;
        }
        if (newTransformNode.getScene() === this && newTransformNode._indexInSceneTransformNodesArray !== -1) {
            // Already there?
            return;
        }
        newTransformNode._indexInSceneTransformNodesArray = this.transformNodes.length;
        this.transformNodes.push(newTransformNode);
        if (!newTransformNode.parent) {
            newTransformNode._addToSceneRootNodes();
        }
        this.onNewTransformNodeAddedObservable.notifyObservers(newTransformNode);
    }
    /**
     * Remove a transform node for the list of scene's transform nodes
     * @param toRemove defines the transform node to remove
     * @returns the index where the transform node was in the transform node list
     */
    removeTransformNode(toRemove) {
        const index = toRemove._indexInSceneTransformNodesArray;
        if (index !== -1) {
            if (index !== this.transformNodes.length - 1) {
                const lastNode = this.transformNodes[this.transformNodes.length - 1];
                this.transformNodes[index] = lastNode;
                lastNode._indexInSceneTransformNodesArray = index;
            }
            toRemove._indexInSceneTransformNodesArray = -1;
            this.transformNodes.pop();
            if (!toRemove.parent) {
                toRemove._removeFromSceneRootNodes();
            }
        }
        this.onTransformNodeRemovedObservable.notifyObservers(toRemove);
        return index;
    }
    /**
     * Remove a skeleton for the list of scene's skeletons
     * @param toRemove defines the skeleton to remove
     * @returns the index where the skeleton was in the skeleton list
     */
    removeSkeleton(toRemove) {
        const index = this.skeletons.indexOf(toRemove);
        if (index !== -1) {
            // Remove from the scene if found
            this.skeletons.splice(index, 1);
            this.onSkeletonRemovedObservable.notifyObservers(toRemove);
            // Clean active container
            this._executeActiveContainerCleanup(this._activeSkeletons);
        }
        return index;
    }
    /**
     * Remove a morph target for the list of scene's morph targets
     * @param toRemove defines the morph target to remove
     * @returns the index where the morph target was in the morph target list
     */
    removeMorphTargetManager(toRemove) {
        const index = this.morphTargetManagers.indexOf(toRemove);
        if (index !== -1) {
            // Remove from the scene if found
            this.morphTargetManagers.splice(index, 1);
        }
        return index;
    }
    /**
     * Remove a light for the list of scene's lights
     * @param toRemove defines the light to remove
     * @returns the index where the light was in the light list
     */
    removeLight(toRemove) {
        const index = this.lights.indexOf(toRemove);
        if (index !== -1) {
            // Remove from meshes
            for (const mesh of this.meshes) {
                mesh._removeLightSource(toRemove, false);
            }
            // Remove from the scene if mesh found
            this.lights.splice(index, 1);
            this.sortLightsByPriority();
            if (!toRemove.parent) {
                toRemove._removeFromSceneRootNodes();
            }
        }
        this.onLightRemovedObservable.notifyObservers(toRemove);
        return index;
    }
    /**
     * Remove a camera for the list of scene's cameras
     * @param toRemove defines the camera to remove
     * @returns the index where the camera was in the camera list
     */
    removeCamera(toRemove) {
        const index = this.cameras.indexOf(toRemove);
        if (index !== -1) {
            // Remove from the scene if mesh found
            this.cameras.splice(index, 1);
            if (!toRemove.parent) {
                toRemove._removeFromSceneRootNodes();
            }
        }
        // Remove from activeCameras
        if (this.activeCameras) {
            const index2 = this.activeCameras.indexOf(toRemove);
            if (index2 !== -1) {
                // Remove from the scene if mesh found
                this.activeCameras.splice(index2, 1);
            }
        }
        // Reset the activeCamera
        if (this.activeCamera === toRemove) {
            if (this.cameras.length > 0) {
                this.activeCamera = this.cameras[0];
            }
            else {
                this.activeCamera = null;
            }
        }
        this.onCameraRemovedObservable.notifyObservers(toRemove);
        return index;
    }
    /**
     * Remove a particle system for the list of scene's particle systems
     * @param toRemove defines the particle system to remove
     * @returns the index where the particle system was in the particle system list
     */
    removeParticleSystem(toRemove) {
        const index = this.particleSystems.indexOf(toRemove);
        if (index !== -1) {
            this.particleSystems.splice(index, 1);
            // Clean active container
            this._executeActiveContainerCleanup(this._activeParticleSystems);
        }
        return index;
    }
    /**
     * Remove a animation for the list of scene's animations
     * @param toRemove defines the animation to remove
     * @returns the index where the animation was in the animation list
     */
    removeAnimation(toRemove) {
        const index = this.animations.indexOf(toRemove);
        if (index !== -1) {
            this.animations.splice(index, 1);
        }
        return index;
    }
    /**
     * Will stop the animation of the given target
     * @param target - the target
     * @param animationName - the name of the animation to stop (all animations will be stopped if both this and targetMask are empty)
     * @param targetMask - a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)
     */
    stopAnimation(target, animationName, targetMask) {
        // Do nothing as code will be provided by animation component
    }
    /**
     * Removes the given animation group from this scene.
     * @param toRemove The animation group to remove
     * @returns The index of the removed animation group
     */
    removeAnimationGroup(toRemove) {
        const index = this.animationGroups.indexOf(toRemove);
        if (index !== -1) {
            this.animationGroups.splice(index, 1);
        }
        return index;
    }
    /**
     * Removes the given multi-material from this scene.
     * @param toRemove The multi-material to remove
     * @returns The index of the removed multi-material
     */
    removeMultiMaterial(toRemove) {
        const index = this.multiMaterials.indexOf(toRemove);
        if (index !== -1) {
            this.multiMaterials.splice(index, 1);
        }
        this.onMultiMaterialRemovedObservable.notifyObservers(toRemove);
        return index;
    }
    /**
     * Removes the given material from this scene.
     * @param toRemove The material to remove
     * @returns The index of the removed material
     */
    removeMaterial(toRemove) {
        const index = toRemove._indexInSceneMaterialArray;
        if (index !== -1 && index < this.materials.length) {
            if (index !== this.materials.length - 1) {
                const lastMaterial = this.materials[this.materials.length - 1];
                this.materials[index] = lastMaterial;
                lastMaterial._indexInSceneMaterialArray = index;
            }
            toRemove._indexInSceneMaterialArray = -1;
            this.materials.pop();
        }
        this.onMaterialRemovedObservable.notifyObservers(toRemove);
        return index;
    }
    /**
     * Removes the given action manager from this scene.
     * @deprecated
     * @param toRemove The action manager to remove
     * @returns The index of the removed action manager
     */
    removeActionManager(toRemove) {
        const index = this.actionManagers.indexOf(toRemove);
        if (index !== -1) {
            this.actionManagers.splice(index, 1);
        }
        return index;
    }
    /**
     * Removes the given texture from this scene.
     * @param toRemove The texture to remove
     * @returns The index of the removed texture
     */
    removeTexture(toRemove) {
        const index = this.textures.indexOf(toRemove);
        if (index !== -1) {
            this.textures.splice(index, 1);
        }
        this.onTextureRemovedObservable.notifyObservers(toRemove);
        return index;
    }
    /**
     * Adds the given light to this scene
     * @param newLight The light to add
     */
    addLight(newLight) {
        if (this._blockEntityCollection) {
            return;
        }
        this.lights.push(newLight);
        this.sortLightsByPriority();
        if (!newLight.parent) {
            newLight._addToSceneRootNodes();
        }
        // Add light to all meshes (To support if the light is removed and then re-added)
        for (const mesh of this.meshes) {
            if (mesh.lightSources.indexOf(newLight) === -1) {
                mesh.lightSources.push(newLight);
                mesh._resyncLightSources();
            }
        }
        tools/* Tools */.S0.SetImmediate(() => {
            this.onNewLightAddedObservable.notifyObservers(newLight);
        });
    }
    /**
     * Sorts the list list based on light priorities
     */
    sortLightsByPriority() {
        if (this.requireLightSorting) {
            this.lights.sort(lightConstants/* LightConstants */.c.CompareLightsPriority);
        }
    }
    /**
     * Adds the given camera to this scene
     * @param newCamera The camera to add
     */
    addCamera(newCamera) {
        if (this._blockEntityCollection) {
            return;
        }
        this.cameras.push(newCamera);
        tools/* Tools */.S0.SetImmediate(() => {
            this.onNewCameraAddedObservable.notifyObservers(newCamera);
        });
        if (!newCamera.parent) {
            newCamera._addToSceneRootNodes();
        }
    }
    /**
     * Adds the given skeleton to this scene
     * @param newSkeleton The skeleton to add
     */
    addSkeleton(newSkeleton) {
        if (this._blockEntityCollection) {
            return;
        }
        this.skeletons.push(newSkeleton);
        tools/* Tools */.S0.SetImmediate(() => {
            this.onNewSkeletonAddedObservable.notifyObservers(newSkeleton);
        });
    }
    /**
     * Adds the given particle system to this scene
     * @param newParticleSystem The particle system to add
     */
    addParticleSystem(newParticleSystem) {
        if (this._blockEntityCollection) {
            return;
        }
        this.particleSystems.push(newParticleSystem);
    }
    /**
     * Adds the given animation to this scene
     * @param newAnimation The animation to add
     */
    addAnimation(newAnimation) {
        if (this._blockEntityCollection) {
            return;
        }
        this.animations.push(newAnimation);
    }
    /**
     * Adds the given animation group to this scene.
     * @param newAnimationGroup The animation group to add
     */
    addAnimationGroup(newAnimationGroup) {
        if (this._blockEntityCollection) {
            return;
        }
        this.animationGroups.push(newAnimationGroup);
    }
    /**
     * Adds the given multi-material to this scene
     * @param newMultiMaterial The multi-material to add
     */
    addMultiMaterial(newMultiMaterial) {
        if (this._blockEntityCollection) {
            return;
        }
        this.multiMaterials.push(newMultiMaterial);
        tools/* Tools */.S0.SetImmediate(() => {
            this.onNewMultiMaterialAddedObservable.notifyObservers(newMultiMaterial);
        });
    }
    /**
     * Adds the given material to this scene
     * @param newMaterial The material to add
     */
    addMaterial(newMaterial) {
        if (this._blockEntityCollection) {
            return;
        }
        if (newMaterial.getScene() === this && newMaterial._indexInSceneMaterialArray !== -1) {
            // Already there??
            return;
        }
        newMaterial._indexInSceneMaterialArray = this.materials.length;
        this.materials.push(newMaterial);
        tools/* Tools */.S0.SetImmediate(() => {
            this.onNewMaterialAddedObservable.notifyObservers(newMaterial);
        });
    }
    /**
     * Adds the given morph target to this scene
     * @param newMorphTargetManager The morph target to add
     */
    addMorphTargetManager(newMorphTargetManager) {
        if (this._blockEntityCollection) {
            return;
        }
        this.morphTargetManagers.push(newMorphTargetManager);
    }
    /**
     * Adds the given geometry to this scene
     * @param newGeometry The geometry to add
     */
    addGeometry(newGeometry) {
        if (this._blockEntityCollection) {
            return;
        }
        if (this._geometriesByUniqueId) {
            this._geometriesByUniqueId[newGeometry.uniqueId] = this.geometries.length;
        }
        this.geometries.push(newGeometry);
    }
    /**
     * Adds the given action manager to this scene
     * @deprecated
     * @param newActionManager The action manager to add
     */
    addActionManager(newActionManager) {
        this.actionManagers.push(newActionManager);
    }
    /**
     * Adds the given texture to this scene.
     * @param newTexture The texture to add
     */
    addTexture(newTexture) {
        if (this._blockEntityCollection) {
            return;
        }
        this.textures.push(newTexture);
        this.onNewTextureAddedObservable.notifyObservers(newTexture);
    }
    /**
     * Switch active camera
     * @param newCamera defines the new active camera
     * @param attachControl defines if attachControl must be called for the new active camera (default: true)
     */
    switchActiveCamera(newCamera, attachControl = true) {
        const canvas = this._engine.getInputElement();
        if (!canvas) {
            return;
        }
        if (this.activeCamera) {
            this.activeCamera.detachControl();
        }
        this.activeCamera = newCamera;
        if (attachControl) {
            newCamera.attachControl();
        }
    }
    /**
     * sets the active camera of the scene using its Id
     * @param id defines the camera's Id
     * @returns the new active camera or null if none found.
     */
    setActiveCameraById(id) {
        const camera = this.getCameraById(id);
        if (camera) {
            this.activeCamera = camera;
            return camera;
        }
        return null;
    }
    /**
     * sets the active camera of the scene using its name
     * @param name defines the camera's name
     * @returns the new active camera or null if none found.
     */
    setActiveCameraByName(name) {
        const camera = this.getCameraByName(name);
        if (camera) {
            this.activeCamera = camera;
            return camera;
        }
        return null;
    }
    /**
     * get an animation group using its name
     * @param name defines the material's name
     * @returns the animation group or null if none found.
     */
    getAnimationGroupByName(name) {
        for (let index = 0; index < this.animationGroups.length; index++) {
            if (this.animationGroups[index].name === name) {
                return this.animationGroups[index];
            }
        }
        return null;
    }
    _getMaterial(allowMultiMaterials, predicate) {
        for (let index = 0; index < this.materials.length; index++) {
            const material = this.materials[index];
            if (predicate(material)) {
                return material;
            }
        }
        if (allowMultiMaterials) {
            for (let index = 0; index < this.multiMaterials.length; index++) {
                const material = this.multiMaterials[index];
                if (predicate(material)) {
                    return material;
                }
            }
        }
        return null;
    }
    /**
     * Get a material using its unique id
     * @param uniqueId defines the material's unique id
     * @param allowMultiMaterials determines whether multimaterials should be considered
     * @returns the material or null if none found.
     */
    getMaterialByUniqueID(uniqueId, allowMultiMaterials = false) {
        return this._getMaterial(allowMultiMaterials, (m) => m.uniqueId === uniqueId);
    }
    /**
     * get a material using its id
     * @param id defines the material's Id
     * @param allowMultiMaterials determines whether multimaterials should be considered
     * @returns the material or null if none found.
     */
    getMaterialById(id, allowMultiMaterials = false) {
        return this._getMaterial(allowMultiMaterials, (m) => m.id === id);
    }
    /**
     * Gets a material using its name
     * @param name defines the material's name
     * @param allowMultiMaterials determines whether multimaterials should be considered
     * @returns the material or null if none found.
     */
    getMaterialByName(name, allowMultiMaterials = false) {
        return this._getMaterial(allowMultiMaterials, (m) => m.name === name);
    }
    /**
     * Gets a last added material using a given id
     * @param id defines the material's id
     * @param allowMultiMaterials determines whether multimaterials should be considered
     * @returns the last material with the given id or null if none found.
     */
    getLastMaterialById(id, allowMultiMaterials = false) {
        for (let index = this.materials.length - 1; index >= 0; index--) {
            if (this.materials[index].id === id) {
                return this.materials[index];
            }
        }
        if (allowMultiMaterials) {
            for (let index = this.multiMaterials.length - 1; index >= 0; index--) {
                if (this.multiMaterials[index].id === id) {
                    return this.multiMaterials[index];
                }
            }
        }
        return null;
    }
    /**
     * Get a texture using its unique id
     * @param uniqueId defines the texture's unique id
     * @returns the texture or null if none found.
     */
    getTextureByUniqueId(uniqueId) {
        for (let index = 0; index < this.textures.length; index++) {
            if (this.textures[index].uniqueId === uniqueId) {
                return this.textures[index];
            }
        }
        return null;
    }
    /**
     * Gets a texture using its name
     * @param name defines the texture's name
     * @returns the texture or null if none found.
     */
    getTextureByName(name) {
        for (let index = 0; index < this.textures.length; index++) {
            if (this.textures[index].name === name) {
                return this.textures[index];
            }
        }
        return null;
    }
    /**
     * Gets a camera using its Id
     * @param id defines the Id to look for
     * @returns the camera or null if not found
     */
    getCameraById(id) {
        for (let index = 0; index < this.cameras.length; index++) {
            if (this.cameras[index].id === id) {
                return this.cameras[index];
            }
        }
        return null;
    }
    /**
     * Gets a camera using its unique Id
     * @param uniqueId defines the unique Id to look for
     * @returns the camera or null if not found
     */
    getCameraByUniqueId(uniqueId) {
        for (let index = 0; index < this.cameras.length; index++) {
            if (this.cameras[index].uniqueId === uniqueId) {
                return this.cameras[index];
            }
        }
        return null;
    }
    /**
     * Gets a camera using its name
     * @param name defines the camera's name
     * @returns the camera or null if none found.
     */
    getCameraByName(name) {
        for (let index = 0; index < this.cameras.length; index++) {
            if (this.cameras[index].name === name) {
                return this.cameras[index];
            }
        }
        return null;
    }
    /**
     * Gets a bone using its Id
     * @param id defines the bone's Id
     * @returns the bone or null if not found
     */
    getBoneById(id) {
        for (let skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) {
            const skeleton = this.skeletons[skeletonIndex];
            for (let boneIndex = 0; boneIndex < skeleton.bones.length; boneIndex++) {
                if (skeleton.bones[boneIndex].id === id) {
                    return skeleton.bones[boneIndex];
                }
            }
        }
        return null;
    }
    /**
     * Gets a bone using its id
     * @param name defines the bone's name
     * @returns the bone or null if not found
     */
    getBoneByName(name) {
        for (let skeletonIndex = 0; skeletonIndex < this.skeletons.length; skeletonIndex++) {
            const skeleton = this.skeletons[skeletonIndex];
            for (let boneIndex = 0; boneIndex < skeleton.bones.length; boneIndex++) {
                if (skeleton.bones[boneIndex].name === name) {
                    return skeleton.bones[boneIndex];
                }
            }
        }
        return null;
    }
    /**
     * Gets a light node using its name
     * @param name defines the light's name
     * @returns the light or null if none found.
     */
    getLightByName(name) {
        for (let index = 0; index < this.lights.length; index++) {
            if (this.lights[index].name === name) {
                return this.lights[index];
            }
        }
        return null;
    }
    /**
     * Gets a light node using its Id
     * @param id defines the light's Id
     * @returns the light or null if none found.
     */
    getLightById(id) {
        for (let index = 0; index < this.lights.length; index++) {
            if (this.lights[index].id === id) {
                return this.lights[index];
            }
        }
        return null;
    }
    /**
     * Gets a light node using its scene-generated unique Id
     * @param uniqueId defines the light's unique Id
     * @returns the light or null if none found.
     */
    getLightByUniqueId(uniqueId) {
        for (let index = 0; index < this.lights.length; index++) {
            if (this.lights[index].uniqueId === uniqueId) {
                return this.lights[index];
            }
        }
        return null;
    }
    /**
     * Gets a particle system by Id
     * @param id defines the particle system Id
     * @returns the corresponding system or null if none found
     */
    getParticleSystemById(id) {
        for (let index = 0; index < this.particleSystems.length; index++) {
            if (this.particleSystems[index].id === id) {
                return this.particleSystems[index];
            }
        }
        return null;
    }
    /**
     * Gets a geometry using its Id
     * @param id defines the geometry's Id
     * @returns the geometry or null if none found.
     */
    getGeometryById(id) {
        for (let index = 0; index < this.geometries.length; index++) {
            if (this.geometries[index].id === id) {
                return this.geometries[index];
            }
        }
        return null;
    }
    _getGeometryByUniqueId(uniqueId) {
        if (this._geometriesByUniqueId) {
            const index = this._geometriesByUniqueId[uniqueId];
            if (index !== undefined) {
                return this.geometries[index];
            }
        }
        else {
            for (let index = 0; index < this.geometries.length; index++) {
                if (this.geometries[index].uniqueId === uniqueId) {
                    return this.geometries[index];
                }
            }
        }
        return null;
    }
    /**
     * Add a new geometry to this scene
     * @param geometry defines the geometry to be added to the scene.
     * @param force defines if the geometry must be pushed even if a geometry with this id already exists
     * @returns a boolean defining if the geometry was added or not
     */
    pushGeometry(geometry, force) {
        if (!force && this._getGeometryByUniqueId(geometry.uniqueId)) {
            return false;
        }
        this.addGeometry(geometry);
        tools/* Tools */.S0.SetImmediate(() => {
            this.onNewGeometryAddedObservable.notifyObservers(geometry);
        });
        return true;
    }
    /**
     * Removes an existing geometry
     * @param geometry defines the geometry to be removed from the scene
     * @returns a boolean defining if the geometry was removed or not
     */
    removeGeometry(geometry) {
        let index;
        if (this._geometriesByUniqueId) {
            index = this._geometriesByUniqueId[geometry.uniqueId];
            if (index === undefined) {
                return false;
            }
        }
        else {
            index = this.geometries.indexOf(geometry);
            if (index < 0) {
                return false;
            }
        }
        if (index !== this.geometries.length - 1) {
            const lastGeometry = this.geometries[this.geometries.length - 1];
            if (lastGeometry) {
                this.geometries[index] = lastGeometry;
                if (this._geometriesByUniqueId) {
                    this._geometriesByUniqueId[lastGeometry.uniqueId] = index;
                }
            }
        }
        if (this._geometriesByUniqueId) {
            this._geometriesByUniqueId[geometry.uniqueId] = undefined;
        }
        this.geometries.pop();
        this.onGeometryRemovedObservable.notifyObservers(geometry);
        return true;
    }
    /**
     * Gets the list of geometries attached to the scene
     * @returns an array of Geometry
     */
    getGeometries() {
        return this.geometries;
    }
    /**
     * Gets the first added mesh found of a given Id
     * @param id defines the Id to search for
     * @returns the mesh found or null if not found at all
     */
    getMeshById(id) {
        for (let index = 0; index < this.meshes.length; index++) {
            if (this.meshes[index].id === id) {
                return this.meshes[index];
            }
        }
        return null;
    }
    /**
     * Gets a list of meshes using their Id
     * @param id defines the Id to search for
     * @returns a list of meshes
     */
    getMeshesById(id) {
        return this.meshes.filter(function (m) {
            return m.id === id;
        });
    }
    /**
     * Gets the first added transform node found of a given Id
     * @param id defines the Id to search for
     * @returns the found transform node or null if not found at all.
     */
    getTransformNodeById(id) {
        for (let index = 0; index < this.transformNodes.length; index++) {
            if (this.transformNodes[index].id === id) {
                return this.transformNodes[index];
            }
        }
        return null;
    }
    /**
     * Gets a transform node with its auto-generated unique Id
     * @param uniqueId defines the unique Id to search for
     * @returns the found transform node or null if not found at all.
     */
    getTransformNodeByUniqueId(uniqueId) {
        for (let index = 0; index < this.transformNodes.length; index++) {
            if (this.transformNodes[index].uniqueId === uniqueId) {
                return this.transformNodes[index];
            }
        }
        return null;
    }
    /**
     * Gets a list of transform nodes using their Id
     * @param id defines the Id to search for
     * @returns a list of transform nodes
     */
    getTransformNodesById(id) {
        return this.transformNodes.filter(function (m) {
            return m.id === id;
        });
    }
    /**
     * Gets a mesh with its auto-generated unique Id
     * @param uniqueId defines the unique Id to search for
     * @returns the found mesh or null if not found at all.
     */
    getMeshByUniqueId(uniqueId) {
        for (let index = 0; index < this.meshes.length; index++) {
            if (this.meshes[index].uniqueId === uniqueId) {
                return this.meshes[index];
            }
        }
        return null;
    }
    /**
     * Gets a the last added mesh using a given Id
     * @param id defines the Id to search for
     * @returns the found mesh or null if not found at all.
     */
    getLastMeshById(id) {
        for (let index = this.meshes.length - 1; index >= 0; index--) {
            if (this.meshes[index].id === id) {
                return this.meshes[index];
            }
        }
        return null;
    }
    /**
     * Gets a the last transform node using a given Id
     * @param id defines the Id to search for
     * @returns the found mesh or null if not found at all.
     */
    getLastTransformNodeById(id) {
        for (let index = this.transformNodes.length - 1; index >= 0; index--) {
            if (this.transformNodes[index].id === id) {
                return this.transformNodes[index];
            }
        }
        return null;
    }
    /**
     * Gets a the last added node (Mesh, Camera, Light) using a given Id
     * @param id defines the Id to search for
     * @returns the found node or null if not found at all
     */
    getLastEntryById(id) {
        let index;
        for (index = this.meshes.length - 1; index >= 0; index--) {
            if (this.meshes[index].id === id) {
                return this.meshes[index];
            }
        }
        for (index = this.transformNodes.length - 1; index >= 0; index--) {
            if (this.transformNodes[index].id === id) {
                return this.transformNodes[index];
            }
        }
        for (index = this.cameras.length - 1; index >= 0; index--) {
            if (this.cameras[index].id === id) {
                return this.cameras[index];
            }
        }
        for (index = this.lights.length - 1; index >= 0; index--) {
            if (this.lights[index].id === id) {
                return this.lights[index];
            }
        }
        return null;
    }
    /**
     * Gets a node (Mesh, Camera, Light) using a given Id
     * @param id defines the Id to search for
     * @returns the found node or null if not found at all
     */
    getNodeById(id) {
        const mesh = this.getMeshById(id);
        if (mesh) {
            return mesh;
        }
        const transformNode = this.getTransformNodeById(id);
        if (transformNode) {
            return transformNode;
        }
        const light = this.getLightById(id);
        if (light) {
            return light;
        }
        const camera = this.getCameraById(id);
        if (camera) {
            return camera;
        }
        const bone = this.getBoneById(id);
        if (bone) {
            return bone;
        }
        return null;
    }
    /**
     * Gets a node (Mesh, Camera, Light) using a given name
     * @param name defines the name to search for
     * @returns the found node or null if not found at all.
     */
    getNodeByName(name) {
        const mesh = this.getMeshByName(name);
        if (mesh) {
            return mesh;
        }
        const transformNode = this.getTransformNodeByName(name);
        if (transformNode) {
            return transformNode;
        }
        const light = this.getLightByName(name);
        if (light) {
            return light;
        }
        const camera = this.getCameraByName(name);
        if (camera) {
            return camera;
        }
        const bone = this.getBoneByName(name);
        if (bone) {
            return bone;
        }
        return null;
    }
    /**
     * Gets a mesh using a given name
     * @param name defines the name to search for
     * @returns the found mesh or null if not found at all.
     */
    getMeshByName(name) {
        for (let index = 0; index < this.meshes.length; index++) {
            if (this.meshes[index].name === name) {
                return this.meshes[index];
            }
        }
        return null;
    }
    /**
     * Gets a transform node using a given name
     * @param name defines the name to search for
     * @returns the found transform node or null if not found at all.
     */
    getTransformNodeByName(name) {
        for (let index = 0; index < this.transformNodes.length; index++) {
            if (this.transformNodes[index].name === name) {
                return this.transformNodes[index];
            }
        }
        return null;
    }
    /**
     * Gets a skeleton using a given Id (if many are found, this function will pick the last one)
     * @param id defines the Id to search for
     * @returns the found skeleton or null if not found at all.
     */
    getLastSkeletonById(id) {
        for (let index = this.skeletons.length - 1; index >= 0; index--) {
            if (this.skeletons[index].id === id) {
                return this.skeletons[index];
            }
        }
        return null;
    }
    /**
     * Gets a skeleton using a given auto generated unique id
     * @param  uniqueId defines the unique id to search for
     * @returns the found skeleton or null if not found at all.
     */
    getSkeletonByUniqueId(uniqueId) {
        for (let index = 0; index < this.skeletons.length; index++) {
            if (this.skeletons[index].uniqueId === uniqueId) {
                return this.skeletons[index];
            }
        }
        return null;
    }
    /**
     * Gets a skeleton using a given id (if many are found, this function will pick the first one)
     * @param id defines the id to search for
     * @returns the found skeleton or null if not found at all.
     */
    getSkeletonById(id) {
        for (let index = 0; index < this.skeletons.length; index++) {
            if (this.skeletons[index].id === id) {
                return this.skeletons[index];
            }
        }
        return null;
    }
    /**
     * Gets a skeleton using a given name
     * @param name defines the name to search for
     * @returns the found skeleton or null if not found at all.
     */
    getSkeletonByName(name) {
        for (let index = 0; index < this.skeletons.length; index++) {
            if (this.skeletons[index].name === name) {
                return this.skeletons[index];
            }
        }
        return null;
    }
    /**
     * Gets a morph target manager  using a given id (if many are found, this function will pick the last one)
     * @param id defines the id to search for
     * @returns the found morph target manager or null if not found at all.
     */
    getMorphTargetManagerById(id) {
        for (let index = 0; index < this.morphTargetManagers.length; index++) {
            if (this.morphTargetManagers[index].uniqueId === id) {
                return this.morphTargetManagers[index];
            }
        }
        return null;
    }
    /**
     * Gets a morph target using a given id (if many are found, this function will pick the first one)
     * @param id defines the id to search for
     * @returns the found morph target or null if not found at all.
     */
    getMorphTargetById(id) {
        for (let managerIndex = 0; managerIndex < this.morphTargetManagers.length; ++managerIndex) {
            const morphTargetManager = this.morphTargetManagers[managerIndex];
            for (let index = 0; index < morphTargetManager.numTargets; ++index) {
                const target = morphTargetManager.getTarget(index);
                if (target.id === id) {
                    return target;
                }
            }
        }
        return null;
    }
    /**
     * Gets a morph target using a given name (if many are found, this function will pick the first one)
     * @param name defines the name to search for
     * @returns the found morph target or null if not found at all.
     */
    getMorphTargetByName(name) {
        for (let managerIndex = 0; managerIndex < this.morphTargetManagers.length; ++managerIndex) {
            const morphTargetManager = this.morphTargetManagers[managerIndex];
            for (let index = 0; index < morphTargetManager.numTargets; ++index) {
                const target = morphTargetManager.getTarget(index);
                if (target.name === name) {
                    return target;
                }
            }
        }
        return null;
    }
    /**
     * Gets a post process using a given name (if many are found, this function will pick the first one)
     * @param name defines the name to search for
     * @returns the found post process or null if not found at all.
     */
    getPostProcessByName(name) {
        for (let postProcessIndex = 0; postProcessIndex < this.postProcesses.length; ++postProcessIndex) {
            const postProcess = this.postProcesses[postProcessIndex];
            if (postProcess.name === name) {
                return postProcess;
            }
        }
        return null;
    }
    /**
     * Gets a boolean indicating if the given mesh is active
     * @param mesh defines the mesh to look for
     * @returns true if the mesh is in the active list
     */
    isActiveMesh(mesh) {
        return this._activeMeshes.indexOf(mesh) !== -1;
    }
    /**
     * Return a unique id as a string which can serve as an identifier for the scene
     */
    get uid() {
        if (!this._uid) {
            this._uid = tools/* Tools */.S0.RandomId();
        }
        return this._uid;
    }
    /**
     * Add an externally attached data from its key.
     * This method call will fail and return false, if such key already exists.
     * If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method.
     * @param key the unique key that identifies the data
     * @param data the data object to associate to the key for this Engine instance
     * @returns true if no such key were already present and the data was added successfully, false otherwise
     */
    addExternalData(key, data) {
        if (!this._externalData) {
            this._externalData = new stringDictionary/* StringDictionary */.w();
        }
        return this._externalData.add(key, data);
    }
    /**
     * Get an externally attached data from its key
     * @param key the unique key that identifies the data
     * @returns the associated data, if present (can be null), or undefined if not present
     */
    getExternalData(key) {
        if (!this._externalData) {
            return null;
        }
        return this._externalData.get(key);
    }
    /**
     * Get an externally attached data from its key, create it using a factory if it's not already present
     * @param key the unique key that identifies the data
     * @param factory the factory that will be called to create the instance if and only if it doesn't exists
     * @returns the associated data, can be null if the factory returned null.
     */
    getOrAddExternalDataWithFactory(key, factory) {
        if (!this._externalData) {
            this._externalData = new stringDictionary/* StringDictionary */.w();
        }
        return this._externalData.getOrAddWithFactory(key, factory);
    }
    /**
     * Remove an externally attached data from the Engine instance
     * @param key the unique key that identifies the data
     * @returns true if the data was successfully removed, false if it doesn't exist
     */
    removeExternalData(key) {
        return this._externalData.remove(key);
    }
    _evaluateSubMesh(subMesh, mesh, initialMesh, forcePush) {
        if (forcePush || subMesh.isInFrustum(this._frustumPlanes)) {
            for (const step of this._evaluateSubMeshStage) {
                step.action(mesh, subMesh);
            }
            const material = subMesh.getMaterial();
            if (material !== null && material !== undefined) {
                // Render targets
                if (material.hasRenderTargetTextures && material.getRenderTargetTextures != null) {
                    if (this._processedMaterials.indexOf(material) === -1) {
                        this._processedMaterials.push(material);
                        this._materialsRenderTargets.concatWithNoDuplicate(material.getRenderTargetTextures());
                    }
                }
                // Dispatch
                this._renderingManager.dispatch(subMesh, mesh, material);
            }
        }
    }
    /**
     * Clear the processed materials smart array preventing retention point in material dispose.
     */
    freeProcessedMaterials() {
        this._processedMaterials.dispose();
    }
    /** Gets or sets a boolean blocking all the calls to freeActiveMeshes and freeRenderingGroups
     * It can be used in order to prevent going through methods freeRenderingGroups and freeActiveMeshes several times to improve performance
     * when disposing several meshes in a row or a hierarchy of meshes.
     * When used, it is the responsibility of the user to blockfreeActiveMeshesAndRenderingGroups back to false.
     */
    get blockfreeActiveMeshesAndRenderingGroups() {
        return this._preventFreeActiveMeshesAndRenderingGroups;
    }
    set blockfreeActiveMeshesAndRenderingGroups(value) {
        if (this._preventFreeActiveMeshesAndRenderingGroups === value) {
            return;
        }
        if (value) {
            this.freeActiveMeshes();
            this.freeRenderingGroups();
        }
        this._preventFreeActiveMeshesAndRenderingGroups = value;
    }
    /**
     * Clear the active meshes smart array preventing retention point in mesh dispose.
     */
    freeActiveMeshes() {
        if (this.blockfreeActiveMeshesAndRenderingGroups) {
            return;
        }
        this._activeMeshes.dispose();
        if (this.activeCamera && this.activeCamera._activeMeshes) {
            this.activeCamera._activeMeshes.dispose();
        }
        if (this.activeCameras) {
            for (let i = 0; i < this.activeCameras.length; i++) {
                const activeCamera = this.activeCameras[i];
                if (activeCamera && activeCamera._activeMeshes) {
                    activeCamera._activeMeshes.dispose();
                }
            }
        }
    }
    /**
     * Clear the info related to rendering groups preventing retention points during dispose.
     */
    freeRenderingGroups() {
        if (this.blockfreeActiveMeshesAndRenderingGroups) {
            return;
        }
        if (this._renderingManager) {
            this._renderingManager.freeRenderingGroups();
        }
        if (this.textures) {
            for (let i = 0; i < this.textures.length; i++) {
                const texture = this.textures[i];
                if (texture && texture.renderList) {
                    texture.freeRenderingGroups();
                }
            }
        }
    }
    /** @internal */
    _isInIntermediateRendering() {
        return this._intermediateRendering;
    }
    /**
     * Use this function to stop evaluating active meshes. The current list will be keep alive between frames
     * @param skipEvaluateActiveMeshes defines an optional boolean indicating that the evaluate active meshes step must be completely skipped
     * @param onSuccess optional success callback
     * @param onError optional error callback
     * @param freezeMeshes defines if meshes should be frozen (true by default)
     * @param keepFrustumCulling defines if you want to keep running the frustum clipping (false by default)
     * @returns the current scene
     */
    freezeActiveMeshes(skipEvaluateActiveMeshes = false, onSuccess, onError, freezeMeshes = true, keepFrustumCulling = false) {
        this.executeWhenReady(() => {
            if (!this.activeCamera) {
                onError && onError("No active camera found");
                return;
            }
            if (!this._frustumPlanes) {
                this.updateTransformMatrix();
            }
            this._evaluateActiveMeshes();
            this._activeMeshesFrozen = true;
            this._activeMeshesFrozenButKeepClipping = keepFrustumCulling;
            this._skipEvaluateActiveMeshesCompletely = skipEvaluateActiveMeshes;
            if (freezeMeshes) {
                for (let index = 0; index < this._activeMeshes.length; index++) {
                    this._activeMeshes.data[index]._freeze();
                }
            }
            onSuccess && onSuccess();
        });
        return this;
    }
    /**
     * Use this function to restart evaluating active meshes on every frame
     * @returns the current scene
     */
    unfreezeActiveMeshes() {
        for (let index = 0; index < this.meshes.length; index++) {
            const mesh = this.meshes[index];
            if (mesh._internalAbstractMeshDataInfo) {
                mesh._internalAbstractMeshDataInfo._isActive = false;
            }
        }
        for (let index = 0; index < this._activeMeshes.length; index++) {
            this._activeMeshes.data[index]._unFreeze();
        }
        this._activeMeshesFrozen = false;
        return this;
    }
    _executeActiveContainerCleanup(container) {
        const isInFastMode = this._engine.snapshotRendering && this._engine.snapshotRenderingMode === 1;
        if (!isInFastMode && this._activeMeshesFrozen && this._activeMeshes.length) {
            return; // Do not execute in frozen mode
        }
        // We need to ensure we are not in the rendering loop
        this.onBeforeRenderObservable.addOnce(() => container.dispose());
    }
    _evaluateActiveMeshes() {
        if (this._engine.snapshotRendering && this._engine.snapshotRenderingMode === 1) {
            if (this._activeMeshes.length > 0) {
                this.activeCamera?._activeMeshes.reset();
                this._activeMeshes.reset();
                this._renderingManager.reset();
                this._processedMaterials.reset();
                this._activeParticleSystems.reset();
                this._activeSkeletons.reset();
                this._softwareSkinnedMeshes.reset();
            }
            return;
        }
        if (this._activeMeshesFrozen && this._activeMeshes.length) {
            if (!this._skipEvaluateActiveMeshesCompletely) {
                const len = this._activeMeshes.length;
                for (let i = 0; i < len; i++) {
                    const mesh = this._activeMeshes.data[i];
                    mesh.computeWorldMatrix();
                }
            }
            if (this._activeParticleSystems) {
                const psLength = this._activeParticleSystems.length;
                for (let i = 0; i < psLength; i++) {
                    this._activeParticleSystems.data[i].animate();
                }
            }
            this._renderingManager.resetSprites();
            return;
        }
        if (!this.activeCamera) {
            return;
        }
        this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this);
        this.activeCamera._activeMeshes.reset();
        this._activeMeshes.reset();
        this._renderingManager.reset();
        this._processedMaterials.reset();
        this._activeParticleSystems.reset();
        this._activeSkeletons.reset();
        this._softwareSkinnedMeshes.reset();
        this._materialsRenderTargets.reset();
        for (const step of this._beforeEvaluateActiveMeshStage) {
            step.action();
        }
        // Determine mesh candidates
        const meshes = this.getActiveMeshCandidates();
        // Check each mesh
        const len = meshes.length;
        for (let i = 0; i < len; i++) {
            const mesh = meshes.data[i];
            mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate = false;
            if (mesh.isBlocked) {
                continue;
            }
            this._totalVertices.addCount(mesh.getTotalVertices(), false);
            if (!mesh.isReady() || !mesh.isEnabled() || mesh.scaling.hasAZeroComponent) {
                continue;
            }
            mesh.computeWorldMatrix();
            // Intersections
            if (mesh.actionManager && mesh.actionManager.hasSpecificTriggers2(12, 13)) {
                this._meshesForIntersections.pushNoDuplicate(mesh);
            }
            // Switch to current LOD
            let meshToRender = this.customLODSelector ? this.customLODSelector(mesh, this.activeCamera) : mesh.getLOD(this.activeCamera);
            mesh._internalAbstractMeshDataInfo._currentLOD = meshToRender;
            mesh._internalAbstractMeshDataInfo._currentLODIsUpToDate = true;
            if (meshToRender === undefined || meshToRender === null) {
                continue;
            }
            // Compute world matrix if LOD is billboard
            if (meshToRender !== mesh && meshToRender.billboardMode !== 0) {
                meshToRender.computeWorldMatrix();
            }
            mesh._preActivate();
            if (mesh.isVisible &&
                mesh.visibility > 0 &&
                (mesh.layerMask & this.activeCamera.layerMask) !== 0 &&
                (this._skipFrustumClipping || mesh.alwaysSelectAsActiveMesh || mesh.isInFrustum(this._frustumPlanes))) {
                this._activeMeshes.push(mesh);
                this.activeCamera._activeMeshes.push(mesh);
                if (meshToRender !== mesh) {
                    meshToRender._activate(this._renderId, false);
                }
                for (const step of this._preActiveMeshStage) {
                    step.action(mesh);
                }
                if (mesh._activate(this._renderId, false)) {
                    if (!mesh.isAnInstance) {
                        meshToRender._internalAbstractMeshDataInfo._onlyForInstances = false;
                    }
                    else {
                        if (mesh._internalAbstractMeshDataInfo._actAsRegularMesh) {
                            meshToRender = mesh;
                        }
                    }
                    meshToRender._internalAbstractMeshDataInfo._isActive = true;
                    this._activeMesh(mesh, meshToRender);
                }
                mesh._postActivate();
            }
        }
        this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this);
        // Particle systems
        if (this.particlesEnabled) {
            this.onBeforeParticlesRenderingObservable.notifyObservers(this);
            for (let particleIndex = 0; particleIndex < this.particleSystems.length; particleIndex++) {
                const particleSystem = this.particleSystems[particleIndex];
                if (!particleSystem.isStarted() || !particleSystem.emitter) {
                    continue;
                }
                const emitter = particleSystem.emitter;
                if (!emitter.position || emitter.isEnabled()) {
                    this._activeParticleSystems.push(particleSystem);
                    particleSystem.animate();
                    this._renderingManager.dispatchParticles(particleSystem);
                }
            }
            this.onAfterParticlesRenderingObservable.notifyObservers(this);
        }
    }
    /** @internal */
    _prepareSkeleton(mesh) {
        if (!this._skeletonsEnabled || !mesh.skeleton) {
            return;
        }
        if (this._activeSkeletons.pushNoDuplicate(mesh.skeleton)) {
            mesh.skeleton.prepare();
            this._activeBones.addCount(mesh.skeleton.bones.length, false);
        }
        if (!mesh.computeBonesUsingShaders) {
            if (this._softwareSkinnedMeshes.pushNoDuplicate(mesh) && this.frameGraph) {
                mesh.applySkeleton(mesh.skeleton);
            }
        }
    }
    _activeMesh(sourceMesh, mesh) {
        this._prepareSkeleton(mesh);
        let forcePush = sourceMesh.hasInstances || sourceMesh.isAnInstance || this.dispatchAllSubMeshesOfActiveMeshes || this._skipFrustumClipping || mesh.alwaysSelectAsActiveMesh;
        if (mesh && mesh.subMeshes && mesh.subMeshes.length > 0) {
            const subMeshes = this.getActiveSubMeshCandidates(mesh);
            const len = subMeshes.length;
            forcePush = forcePush || len === 1;
            for (let i = 0; i < len; i++) {
                const subMesh = subMeshes.data[i];
                this._evaluateSubMesh(subMesh, mesh, sourceMesh, forcePush);
            }
        }
    }
    /**
     * Update the transform matrix to update from the current active camera
     * @param force defines a boolean used to force the update even if cache is up to date
     */
    updateTransformMatrix(force) {
        const activeCamera = this.activeCamera;
        if (!activeCamera) {
            return;
        }
        if (activeCamera._renderingMultiview) {
            const leftCamera = activeCamera._rigCameras[0];
            const rightCamera = activeCamera._rigCameras[1];
            this.setTransformMatrix(leftCamera.getViewMatrix(), leftCamera.getProjectionMatrix(force), rightCamera.getViewMatrix(), rightCamera.getProjectionMatrix(force));
        }
        else {
            this.setTransformMatrix(activeCamera.getViewMatrix(), activeCamera.getProjectionMatrix(force));
        }
    }
    _bindFrameBuffer(camera, clear = true) {
        if (camera && camera._multiviewTexture) {
            camera._multiviewTexture._bindFrameBuffer();
        }
        else if (camera && camera.outputRenderTarget) {
            camera.outputRenderTarget._bindFrameBuffer();
        }
        else {
            if (!this._engine._currentFrameBufferIsDefaultFrameBuffer()) {
                this._engine.restoreDefaultFramebuffer();
            }
        }
        if (clear) {
            this._clearFrameBuffer(camera);
        }
    }
    _clearFrameBuffer(camera) {
        // we assume the framebuffer currently bound is the right one
        if (camera && camera._multiviewTexture) {
            // no clearing
        }
        else if (camera && camera.outputRenderTarget && !camera._renderingMultiview) {
            const rtt = camera.outputRenderTarget;
            if (rtt.onClearObservable.hasObservers()) {
                rtt.onClearObservable.notifyObservers(this._engine);
            }
            else if (!rtt.skipInitialClear && !camera.isRightCamera) {
                if (this.autoClear) {
                    this._engine.clear(rtt.clearColor || this._clearColor, !rtt._cleared, true, true);
                }
                rtt._cleared = true;
            }
        }
        else {
            if (!this._defaultFrameBufferCleared) {
                this._defaultFrameBufferCleared = true;
                this._clear();
            }
            else {
                this._engine.clear(null, false, true, true);
            }
        }
    }
    /**
     * @internal
     */
    _renderForCamera(camera, rigParent, bindFrameBuffer = true) {
        if (camera && camera._skipRendering) {
            return;
        }
        const engine = this._engine;
        // Use _activeCamera instead of activeCamera to avoid onActiveCameraChanged
        this._activeCamera = camera;
        if (!this.activeCamera) {
            throw new Error("Active camera not set");
        }
        // Viewport
        engine.setViewport(this.activeCamera.viewport);
        // Camera
        this.resetCachedMaterial();
        this._renderId++;
        if (!this.prePass && bindFrameBuffer) {
            let skipInitialClear = true;
            if (camera._renderingMultiview && camera.outputRenderTarget) {
                skipInitialClear = camera.outputRenderTarget.skipInitialClear;
                if (this.autoClear) {
                    this._defaultFrameBufferCleared = false;
                    camera.outputRenderTarget.skipInitialClear = false;
                }
            }
            this._bindFrameBuffer(this._activeCamera);
            if (camera._renderingMultiview && camera.outputRenderTarget) {
                camera.outputRenderTarget.skipInitialClear = skipInitialClear;
            }
        }
        this.updateTransformMatrix();
        this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera);
        // Meshes
        this._evaluateActiveMeshes();
        // Software skinning
        for (let softwareSkinnedMeshIndex = 0; softwareSkinnedMeshIndex < this._softwareSkinnedMeshes.length; softwareSkinnedMeshIndex++) {
            const mesh = this._softwareSkinnedMeshes.data[softwareSkinnedMeshIndex];
            mesh.applySkeleton(mesh.skeleton);
        }
        // Render targets
        this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);
        this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets);
        if (camera.customRenderTargets && camera.customRenderTargets.length > 0) {
            this._renderTargets.concatWithNoDuplicate(camera.customRenderTargets);
        }
        if (rigParent && rigParent.customRenderTargets && rigParent.customRenderTargets.length > 0) {
            this._renderTargets.concatWithNoDuplicate(rigParent.customRenderTargets);
        }
        if (this.environmentTexture && this.environmentTexture.isRenderTarget) {
            this._renderTargets.pushNoDuplicate(this.environmentTexture);
        }
        // Collects render targets from external components.
        for (const step of this._gatherActiveCameraRenderTargetsStage) {
            step.action(this._renderTargets);
        }
        let needRebind = false;
        if (this.renderTargetsEnabled) {
            this._intermediateRendering = true;
            if (this._renderTargets.length > 0) {
                tools/* Tools */.S0.StartPerformanceCounter("Render targets", this._renderTargets.length > 0);
                for (let renderIndex = 0; renderIndex < this._renderTargets.length; renderIndex++) {
                    const renderTarget = this._renderTargets.data[renderIndex];
                    if (renderTarget._shouldRender()) {
                        this._renderId++;
                        const hasSpecialRenderTargetCamera = renderTarget.activeCamera && renderTarget.activeCamera !== this.activeCamera;
                        renderTarget.render(hasSpecialRenderTargetCamera, this.dumpNextRenderTargets);
                        needRebind = true;
                    }
                }
                tools/* Tools */.S0.EndPerformanceCounter("Render targets", this._renderTargets.length > 0);
                this._renderId++;
            }
            for (const step of this._cameraDrawRenderTargetStage) {
                needRebind = step.action(this.activeCamera) || needRebind;
            }
            this._intermediateRendering = false;
        }
        this._engine.currentRenderPassId = camera.outputRenderTarget?.renderPassId ?? camera.renderPassId ?? 0;
        // Restore framebuffer after rendering to targets
        if (needRebind && !this.prePass) {
            this._bindFrameBuffer(this._activeCamera, false);
            this.updateTransformMatrix();
        }
        this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
        // Prepare Frame
        if (this.postProcessManager && !camera._multiviewTexture && !this.prePass) {
            this.postProcessManager._prepareFrame();
        }
        // Before Camera Draw
        for (const step of this._beforeCameraDrawStage) {
            step.action(this.activeCamera);
        }
        // Render
        this.onBeforeDrawPhaseObservable.notifyObservers(this);
        if (engine.snapshotRendering && engine.snapshotRenderingMode === 1) {
            this.finalizeSceneUbo();
        }
        this._renderingManager.render(null, null, true, true);
        this.onAfterDrawPhaseObservable.notifyObservers(this);
        // After Camera Draw
        for (const step of this._afterCameraDrawStage) {
            step.action(this.activeCamera);
        }
        // Finalize frame
        if (this.postProcessManager && !camera._multiviewTexture) {
            // if the camera has an output render target, render the post process to the render target
            const texture = camera.outputRenderTarget ? camera.outputRenderTarget.renderTarget : undefined;
            this.postProcessManager._finalizeFrame(camera.isIntermediate, texture);
        }
        // After post process
        for (const step of this._afterCameraPostProcessStage) {
            step.action(this.activeCamera);
        }
        // Reset some special arrays
        this._renderTargets.reset();
        this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera);
    }
    _processSubCameras(camera, bindFrameBuffer = true) {
        if (camera.cameraRigMode === 0 || camera._renderingMultiview) {
            if (camera._renderingMultiview && !this._multiviewSceneUbo) {
                this._createMultiviewUbo();
            }
            this._renderForCamera(camera, undefined, bindFrameBuffer);
            this.onAfterRenderCameraObservable.notifyObservers(camera);
            return;
        }
        if (camera._useMultiviewToSingleView) {
            this._renderMultiviewToSingleView(camera);
        }
        else {
            // rig cameras
            this.onBeforeCameraRenderObservable.notifyObservers(camera);
            for (let index = 0; index < camera._rigCameras.length; index++) {
                this._renderForCamera(camera._rigCameras[index], camera);
            }
        }
        // Use _activeCamera instead of activeCamera to avoid onActiveCameraChanged
        this._activeCamera = camera;
        this.updateTransformMatrix();
        this.onAfterRenderCameraObservable.notifyObservers(camera);
    }
    _checkIntersections() {
        for (let index = 0; index < this._meshesForIntersections.length; index++) {
            const sourceMesh = this._meshesForIntersections.data[index];
            if (!sourceMesh.actionManager) {
                continue;
            }
            for (let actionIndex = 0; sourceMesh.actionManager && actionIndex < sourceMesh.actionManager.actions.length; actionIndex++) {
                const action = sourceMesh.actionManager.actions[actionIndex];
                if (action.trigger === 12 || action.trigger === 13) {
                    const parameters = action.getTriggerParameter();
                    const otherMesh = parameters.mesh ? parameters.mesh : parameters;
                    const areIntersecting = otherMesh.intersectsMesh(sourceMesh, parameters.usePreciseIntersection);
                    const currentIntersectionInProgress = sourceMesh._intersectionsInProgress.indexOf(otherMesh);
                    if (areIntersecting && currentIntersectionInProgress === -1) {
                        if (action.trigger === 12) {
                            action._executeCurrent(actionEvent/* ActionEvent */.X.CreateNew(sourceMesh, undefined, otherMesh));
                            sourceMesh._intersectionsInProgress.push(otherMesh);
                        }
                        else if (action.trigger === 13) {
                            sourceMesh._intersectionsInProgress.push(otherMesh);
                        }
                    }
                    else if (!areIntersecting && currentIntersectionInProgress > -1) {
                        //They intersected, and now they don't.
                        //is this trigger an exit trigger? execute an event.
                        if (action.trigger === 13) {
                            action._executeCurrent(actionEvent/* ActionEvent */.X.CreateNew(sourceMesh, undefined, otherMesh));
                        }
                        //if this is an exit trigger, or no exit trigger exists, remove the id from the intersection in progress array.
                        if (!sourceMesh.actionManager.hasSpecificTrigger(13, (parameter) => {
                            const parameterMesh = parameter.mesh ? parameter.mesh : parameter;
                            return otherMesh === parameterMesh;
                        }) ||
                            action.trigger === 13) {
                            sourceMesh._intersectionsInProgress.splice(currentIntersectionInProgress, 1);
                        }
                    }
                }
            }
        }
    }
    /**
     * @internal
     */
    _advancePhysicsEngineStep(step) {
        // Do nothing. Code will be replaced if physics engine component is referenced
    }
    /** @internal */
    _animate(customDeltaTime) {
        // Nothing to do as long as Animatable have not been imported.
    }
    /** Execute all animations (for a frame) */
    animate() {
        if (this._engine.isDeterministicLockStep()) {
            let deltaTime = Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime)) + this._timeAccumulator;
            const defaultFrameTime = this._engine.getTimeStep();
            const defaultFPS = 1000.0 / defaultFrameTime / 1000.0;
            let stepsTaken = 0;
            const maxSubSteps = this._engine.getLockstepMaxSteps();
            let internalSteps = Math.floor(deltaTime / defaultFrameTime);
            internalSteps = Math.min(internalSteps, maxSubSteps);
            while (deltaTime > 0 && stepsTaken < internalSteps) {
                this.onBeforeStepObservable.notifyObservers(this);
                // Animations
                this._animationRatio = defaultFrameTime * defaultFPS;
                this._animate(defaultFrameTime);
                this.onAfterAnimationsObservable.notifyObservers(this);
                // Physics
                if (this.physicsEnabled) {
                    this._advancePhysicsEngineStep(defaultFrameTime);
                }
                this.onAfterStepObservable.notifyObservers(this);
                this._currentStepId++;
                stepsTaken++;
                deltaTime -= defaultFrameTime;
            }
            this._timeAccumulator = deltaTime < 0 ? 0 : deltaTime;
        }
        else {
            // Animations
            const deltaTime = this.useConstantAnimationDeltaTime ? 16 : Math.max(Scene.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Scene.MaxDeltaTime));
            this._animationRatio = deltaTime * (60.0 / 1000.0);
            this._animate();
            this.onAfterAnimationsObservable.notifyObservers(this);
            // Physics
            if (this.physicsEnabled) {
                this._advancePhysicsEngineStep(deltaTime);
            }
        }
    }
    _clear() {
        if (this.autoClearDepthAndStencil || this.autoClear) {
            this._engine.clear(this._clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);
        }
    }
    _checkCameraRenderTarget(camera) {
        if (camera?.outputRenderTarget && !camera?.isRigCamera) {
            camera.outputRenderTarget._cleared = false;
        }
        if (camera?.rigCameras?.length) {
            for (let i = 0; i < camera.rigCameras.length; ++i) {
                const rtt = camera.rigCameras[i].outputRenderTarget;
                if (rtt) {
                    rtt._cleared = false;
                }
            }
        }
    }
    /**
     * Resets the draw wrappers cache of all meshes
     * @param passId If provided, releases only the draw wrapper corresponding to this render pass id
     */
    resetDrawCache(passId) {
        if (!this.meshes) {
            return;
        }
        for (const mesh of this.meshes) {
            mesh.resetDrawCache(passId);
        }
    }
    _renderWithFrameGraph(updateCameras = true, ignoreAnimations = false) {
        this.activeCamera = null;
        this._activeParticleSystems.reset();
        this._activeSkeletons.reset();
        // Update Cameras
        if (updateCameras) {
            for (const camera of this.cameras) {
                camera.update();
                if (camera.cameraRigMode !== 0) {
                    // rig cameras
                    for (let index = 0; index < camera._rigCameras.length; index++) {
                        camera._rigCameras[index].update();
                    }
                }
            }
        }
        // We must keep these steps because the procedural texture component relies on them.
        // TODO: move the procedural texture component to the frame graph.
        for (const step of this._beforeClearStage) {
            step.action();
        }
        // Process meshes
        const meshes = this.getActiveMeshCandidates();
        const len = meshes.length;
        for (let i = 0; i < len; i++) {
            const mesh = meshes.data[i];
            if (mesh.isBlocked) {
                continue;
            }
            this._totalVertices.addCount(mesh.getTotalVertices(), false);
            if (!mesh.isReady() || !mesh.isEnabled() || mesh.scaling.hasAZeroComponent) {
                continue;
            }
            mesh.computeWorldMatrix();
            if (mesh.actionManager && mesh.actionManager.hasSpecificTriggers2(12, 13)) {
                this._meshesForIntersections.pushNoDuplicate(mesh);
            }
        }
        // Animate Particle systems
        if (this.particlesEnabled) {
            for (let particleIndex = 0; particleIndex < this.particleSystems.length; particleIndex++) {
                const particleSystem = this.particleSystems[particleIndex];
                if (!particleSystem.isStarted() || !particleSystem.emitter) {
                    continue;
                }
                const emitter = particleSystem.emitter;
                if (!emitter.position || emitter.isEnabled()) {
                    this._activeParticleSystems.push(particleSystem);
                    particleSystem.animate();
                }
            }
        }
        // Render the graph
        this.frameGraph?.execute();
    }
    /**
     * Render the scene
     * @param updateCameras defines a boolean indicating if cameras must update according to their inputs (true by default)
     * @param ignoreAnimations defines a boolean indicating if animations should not be executed (false by default)
     */
    render(updateCameras = true, ignoreAnimations = false) {
        if (this.isDisposed) {
            return;
        }
        if (this.onReadyObservable.hasObservers() && this._executeWhenReadyTimeoutId === null) {
            this._checkIsReady();
        }
        this._frameId++;
        this._defaultFrameBufferCleared = false;
        this._checkCameraRenderTarget(this.activeCamera);
        if (this.activeCameras?.length) {
            this.activeCameras.forEach(this._checkCameraRenderTarget);
        }
        // Register components that have been associated lately to the scene.
        this._registerTransientComponents();
        this._activeParticles.fetchNewFrame();
        this._totalVertices.fetchNewFrame();
        this._activeIndices.fetchNewFrame();
        this._activeBones.fetchNewFrame();
        this._meshesForIntersections.reset();
        this.resetCachedMaterial();
        this.onBeforeAnimationsObservable.notifyObservers(this);
        // Actions
        if (this.actionManager) {
            this.actionManager.processTrigger(11);
        }
        // Animations
        if (!ignoreAnimations) {
            this.animate();
        }
        // Before camera update steps
        for (const step of this._beforeCameraUpdateStage) {
            step.action();
        }
        // Update Cameras
        if (updateCameras) {
            if (this.activeCameras && this.activeCameras.length > 0) {
                for (let cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {
                    const camera = this.activeCameras[cameraIndex];
                    camera.update();
                    if (camera.cameraRigMode !== 0) {
                        // rig cameras
                        for (let index = 0; index < camera._rigCameras.length; index++) {
                            camera._rigCameras[index].update();
                        }
                    }
                }
            }
            else if (this.activeCamera) {
                this.activeCamera.update();
                if (this.activeCamera.cameraRigMode !== 0) {
                    // rig cameras
                    for (let index = 0; index < this.activeCamera._rigCameras.length; index++) {
                        this.activeCamera._rigCameras[index].update();
                    }
                }
            }
        }
        // Before render
        this.onBeforeRenderObservable.notifyObservers(this);
        // Custom render function?
        if (this.customRenderFunction) {
            this._renderId++;
            this._engine.currentRenderPassId = 0;
            this.customRenderFunction(updateCameras, ignoreAnimations);
        }
        else {
            const engine = this.getEngine();
            // Customs render targets
            this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);
            const currentActiveCamera = this.activeCameras?.length ? this.activeCameras[0] : this.activeCamera;
            if (this.renderTargetsEnabled) {
                tools/* Tools */.S0.StartPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0);
                this._intermediateRendering = true;
                for (let customIndex = 0; customIndex < this.customRenderTargets.length; customIndex++) {
                    const renderTarget = this.customRenderTargets[customIndex];
                    if (renderTarget._shouldRender()) {
                        this._renderId++;
                        this.activeCamera = renderTarget.activeCamera || this.activeCamera;
                        if (!this.activeCamera) {
                            throw new Error("Active camera not set");
                        }
                        // Viewport
                        engine.setViewport(this.activeCamera.viewport);
                        // Camera
                        this.updateTransformMatrix();
                        renderTarget.render(currentActiveCamera !== this.activeCamera, this.dumpNextRenderTargets);
                    }
                }
                tools/* Tools */.S0.EndPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0);
                this._intermediateRendering = false;
                this._renderId++;
            }
            this._engine.currentRenderPassId = currentActiveCamera?.renderPassId ?? 0;
            // Restore back buffer
            this.activeCamera = currentActiveCamera;
            if (this._activeCamera && this._activeCamera.cameraRigMode !== 22 && !this.prePass) {
                this._bindFrameBuffer(this._activeCamera, false);
            }
            this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
            for (const step of this._beforeClearStage) {
                step.action();
            }
            // Clear
            this._clearFrameBuffer(this.activeCamera);
            // Collects render targets from external components.
            for (const step of this._gatherRenderTargetsStage) {
                step.action(this._renderTargets);
            }
            // Multi-cameras?
            if (this.activeCameras && this.activeCameras.length > 0) {
                for (let cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {
                    this._processSubCameras(this.activeCameras[cameraIndex], cameraIndex > 0);
                }
            }
            else {
                if (!this.activeCamera) {
                    throw new Error("No camera defined");
                }
                this._processSubCameras(this.activeCamera, !!this.activeCamera.outputRenderTarget);
            }
        }
        // Intersection checks
        this._checkIntersections();
        // Executes the after render stage actions.
        for (const step of this._afterRenderStage) {
            step.action();
        }
        // After render
        if (this.afterRender) {
            this.afterRender();
        }
        this.onAfterRenderObservable.notifyObservers(this);
        // Cleaning
        if (this._toBeDisposed.length) {
            for (let index = 0; index < this._toBeDisposed.length; index++) {
                const data = this._toBeDisposed[index];
                if (data) {
                    data.dispose();
                }
            }
            this._toBeDisposed.length = 0;
        }
        if (this.dumpNextRenderTargets) {
            this.dumpNextRenderTargets = false;
        }
        this._activeBones.addCount(0, true);
        this._activeIndices.addCount(0, true);
        this._activeParticles.addCount(0, true);
        this._engine.restoreDefaultFramebuffer();
    }
    /**
     * Freeze all materials
     * A frozen material will not be updatable but should be faster to render
     * Note: multimaterials will not be frozen, but their submaterials will
     */
    freezeMaterials() {
        for (let i = 0; i < this.materials.length; i++) {
            this.materials[i].freeze();
        }
    }
    /**
     * Unfreeze all materials
     * A frozen material will not be updatable but should be faster to render
     */
    unfreezeMaterials() {
        for (let i = 0; i < this.materials.length; i++) {
            this.materials[i].unfreeze();
        }
    }
    /**
     * Releases all held resources
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.beforeRender = null;
        this.afterRender = null;
        this.metadata = null;
        this.skeletons.length = 0;
        this.morphTargetManagers.length = 0;
        this._transientComponents.length = 0;
        this._isReadyForMeshStage.clear();
        this._beforeEvaluateActiveMeshStage.clear();
        this._evaluateSubMeshStage.clear();
        this._preActiveMeshStage.clear();
        this._cameraDrawRenderTargetStage.clear();
        this._beforeCameraDrawStage.clear();
        this._beforeRenderTargetDrawStage.clear();
        this._beforeRenderingGroupDrawStage.clear();
        this._beforeRenderingMeshStage.clear();
        this._afterRenderingMeshStage.clear();
        this._afterRenderingGroupDrawStage.clear();
        this._afterCameraDrawStage.clear();
        this._afterRenderTargetDrawStage.clear();
        this._afterRenderStage.clear();
        this._beforeCameraUpdateStage.clear();
        this._beforeClearStage.clear();
        this._gatherRenderTargetsStage.clear();
        this._gatherActiveCameraRenderTargetsStage.clear();
        this._pointerMoveStage.clear();
        this._pointerDownStage.clear();
        this._pointerUpStage.clear();
        this.importedMeshesFiles = [];
        if (this._activeAnimatables && this.stopAllAnimations) {
            // Ensures that no animatable notifies a callback that could start a new animation group, constantly adding new animatables to the active list...
            this._activeAnimatables.forEach((animatable) => {
                animatable.onAnimationEndObservable.clear();
                animatable.onAnimationEnd = null;
            });
            this.stopAllAnimations();
        }
        this.resetCachedMaterial();
        // Smart arrays
        if (this.activeCamera) {
            this.activeCamera._activeMeshes.dispose();
            this.activeCamera = null;
        }
        this.activeCameras = null;
        this._activeMeshes.dispose();
        this._renderingManager.dispose();
        this._processedMaterials.dispose();
        this._activeParticleSystems.dispose();
        this._activeSkeletons.dispose();
        this._softwareSkinnedMeshes.dispose();
        this._renderTargets.dispose();
        this._materialsRenderTargets.dispose();
        this._registeredForLateAnimationBindings.dispose();
        this._meshesForIntersections.dispose();
        this._toBeDisposed.length = 0;
        // Abort active requests
        const activeRequests = this._activeRequests.slice();
        for (const request of activeRequests) {
            request.abort();
        }
        this._activeRequests.length = 0;
        // Events
        try {
            this.onDisposeObservable.notifyObservers(this);
        }
        catch (e) {
            logger/* Logger */.V.Error("An error occurred while calling onDisposeObservable!", e);
        }
        this.detachControl();
        // Detach cameras
        const canvas = this._engine.getInputElement();
        if (canvas) {
            for (let index = 0; index < this.cameras.length; index++) {
                this.cameras[index].detachControl();
            }
        }
        // Release animation groups
        this._disposeList(this.animationGroups);
        // Release lights
        this._disposeList(this.lights);
        // Release materials
        if (this._defaultMaterial) {
            this._defaultMaterial.dispose();
        }
        this._disposeList(this.multiMaterials);
        this._disposeList(this.materials);
        // Release meshes
        this._disposeList(this.meshes, (item) => item.dispose(true));
        this._disposeList(this.transformNodes, (item) => item.dispose(true));
        // Release cameras
        const cameras = this.cameras;
        this._disposeList(cameras);
        // Release particles
        this._disposeList(this.particleSystems);
        // Release postProcesses
        this._disposeList(this.postProcesses);
        // Release textures
        this._disposeList(this.textures);
        // Release morph targets
        this._disposeList(this.morphTargetManagers);
        // Release UBO
        this._sceneUbo.dispose();
        if (this._multiviewSceneUbo) {
            this._multiviewSceneUbo.dispose();
        }
        // Post-processes
        this.postProcessManager.dispose();
        // Components
        this._disposeList(this._components);
        // Remove from engine
        let index = this._engine.scenes.indexOf(this);
        if (index > -1) {
            this._engine.scenes.splice(index, 1);
        }
        if (engineStore/* EngineStore */.q._LastCreatedScene === this) {
            if (this._engine.scenes.length > 0) {
                engineStore/* EngineStore */.q._LastCreatedScene = this._engine.scenes[this._engine.scenes.length - 1];
            }
            else {
                engineStore/* EngineStore */.q._LastCreatedScene = null;
            }
        }
        index = this._engine._virtualScenes.indexOf(this);
        if (index > -1) {
            this._engine._virtualScenes.splice(index, 1);
        }
        this._engine.wipeCaches(true);
        this.onDisposeObservable.clear();
        this.onBeforeRenderObservable.clear();
        this.onAfterRenderObservable.clear();
        this.onBeforeRenderTargetsRenderObservable.clear();
        this.onAfterRenderTargetsRenderObservable.clear();
        this.onAfterStepObservable.clear();
        this.onBeforeStepObservable.clear();
        this.onBeforeActiveMeshesEvaluationObservable.clear();
        this.onAfterActiveMeshesEvaluationObservable.clear();
        this.onBeforeParticlesRenderingObservable.clear();
        this.onAfterParticlesRenderingObservable.clear();
        this.onBeforeDrawPhaseObservable.clear();
        this.onAfterDrawPhaseObservable.clear();
        this.onBeforeAnimationsObservable.clear();
        this.onAfterAnimationsObservable.clear();
        this.onDataLoadedObservable.clear();
        this.onBeforeRenderingGroupObservable.clear();
        this.onAfterRenderingGroupObservable.clear();
        this.onMeshImportedObservable.clear();
        this.onBeforeCameraRenderObservable.clear();
        this.onAfterCameraRenderObservable.clear();
        this.onAfterRenderCameraObservable.clear();
        this.onReadyObservable.clear();
        this.onNewCameraAddedObservable.clear();
        this.onCameraRemovedObservable.clear();
        this.onNewLightAddedObservable.clear();
        this.onLightRemovedObservable.clear();
        this.onNewGeometryAddedObservable.clear();
        this.onGeometryRemovedObservable.clear();
        this.onNewTransformNodeAddedObservable.clear();
        this.onTransformNodeRemovedObservable.clear();
        this.onNewMeshAddedObservable.clear();
        this.onMeshRemovedObservable.clear();
        this.onNewSkeletonAddedObservable.clear();
        this.onSkeletonRemovedObservable.clear();
        this.onNewMaterialAddedObservable.clear();
        this.onNewMultiMaterialAddedObservable.clear();
        this.onMaterialRemovedObservable.clear();
        this.onMultiMaterialRemovedObservable.clear();
        this.onNewTextureAddedObservable.clear();
        this.onTextureRemovedObservable.clear();
        this.onPrePointerObservable.clear();
        this.onPointerObservable.clear();
        this.onPreKeyboardObservable.clear();
        this.onKeyboardObservable.clear();
        this.onActiveCameraChanged.clear();
        this.onScenePerformancePriorityChangedObservable.clear();
        this.onClearColorChangedObservable.clear();
        this._isDisposed = true;
    }
    _disposeList(items, callback) {
        const itemsCopy = items.slice(0);
        callback = callback ?? ((item) => item.dispose());
        for (const item of itemsCopy) {
            callback(item);
        }
        items.length = 0;
    }
    /**
     * Gets if the scene is already disposed
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Call this function to reduce memory footprint of the scene.
     * Vertex buffers will not store CPU data anymore (this will prevent picking, collisions or physics to work correctly)
     */
    clearCachedVertexData() {
        for (let meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) {
            const mesh = this.meshes[meshIndex];
            const geometry = mesh.geometry;
            if (geometry) {
                geometry.clearCachedData();
            }
        }
    }
    /**
     * This function will remove the local cached buffer data from texture.
     * It will save memory but will prevent the texture from being rebuilt
     */
    cleanCachedTextureBuffer() {
        for (const baseTexture of this.textures) {
            const buffer = baseTexture._buffer;
            if (buffer) {
                baseTexture._buffer = null;
            }
        }
    }
    /**
     * Get the world extend vectors with an optional filter
     *
     * @param filterPredicate the predicate - which meshes should be included when calculating the world size
     * @returns {{ min: Vector3; max: Vector3 }} min and max vectors
     */
    getWorldExtends(filterPredicate) {
        const min = new math_vector/* Vector3 */.Pq(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
        const max = new math_vector/* Vector3 */.Pq(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
        filterPredicate = filterPredicate || (() => true);
        this.meshes.filter(filterPredicate).forEach((mesh) => {
            mesh.computeWorldMatrix(true);
            if (!mesh.subMeshes || mesh.subMeshes.length === 0 || mesh.infiniteDistance) {
                return;
            }
            const boundingInfo = mesh.getBoundingInfo();
            const minBox = boundingInfo.boundingBox.minimumWorld;
            const maxBox = boundingInfo.boundingBox.maximumWorld;
            math_vector/* Vector3 */.Pq.CheckExtends(minBox, min, max);
            math_vector/* Vector3 */.Pq.CheckExtends(maxBox, min, max);
        });
        return {
            min: min,
            max: max,
        };
    }
    // Picking
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Creates a ray that can be used to pick in the scene
     * @param x defines the x coordinate of the origin (on-screen)
     * @param y defines the y coordinate of the origin (on-screen)
     * @param world defines the world matrix to use if you want to pick in object space (instead of world space)
     * @param camera defines the camera to use for the picking
     * @param cameraViewSpace defines if picking will be done in view space (false by default)
     * @returns a Ray
     */
    createPickingRay(x, y, world, camera, cameraViewSpace = false) {
        throw (0,devTools/* _WarnImport */.n)("Ray");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Creates a ray that can be used to pick in the scene
     * @param x defines the x coordinate of the origin (on-screen)
     * @param y defines the y coordinate of the origin (on-screen)
     * @param world defines the world matrix to use if you want to pick in object space (instead of world space)
     * @param result defines the ray where to store the picking ray
     * @param camera defines the camera to use for the picking
     * @param cameraViewSpace defines if picking will be done in view space (false by default)
     * @param enableDistantPicking defines if picking should handle large values for mesh position/scaling (false by default)
     * @returns the current scene
     */
    createPickingRayToRef(x, y, world, result, camera, cameraViewSpace = false, enableDistantPicking = false) {
        throw (0,devTools/* _WarnImport */.n)("Ray");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Creates a ray that can be used to pick in the scene
     * @param x defines the x coordinate of the origin (on-screen)
     * @param y defines the y coordinate of the origin (on-screen)
     * @param camera defines the camera to use for the picking
     * @returns a Ray
     */
    createPickingRayInCameraSpace(x, y, camera) {
        throw (0,devTools/* _WarnImport */.n)("Ray");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Creates a ray that can be used to pick in the scene
     * @param x defines the x coordinate of the origin (on-screen)
     * @param y defines the y coordinate of the origin (on-screen)
     * @param result defines the ray where to store the picking ray
     * @param camera defines the camera to use for the picking
     * @returns the current scene
     */
    createPickingRayInCameraSpaceToRef(x, y, result, camera) {
        throw (0,devTools/* _WarnImport */.n)("Ray");
    }
    /** Launch a ray to try to pick a mesh in the scene
     * @param x position on screen
     * @param y position on screen
     * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
     * @param fastCheck defines if the first intersection will be used (and not the closest)
     * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
     * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
     * @returns a PickingInfo
     */
    pick(x, y, predicate, fastCheck, camera, trianglePredicate) {
        const warn = (0,devTools/* _WarnImport */.n)("Ray", true);
        if (warn) {
            logger/* Logger */.V.Warn(warn);
        }
        // Dummy info if picking as not been imported
        return new pickingInfo/* PickingInfo */.G();
    }
    /** Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)
     * @param x position on screen
     * @param y position on screen
     * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
     * @param fastCheck defines if the first intersection will be used (and not the closest)
     * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
     * @returns a PickingInfo (Please note that some info will not be set like distance, bv, bu and everything that cannot be capture by only using bounding infos)
     */
    pickWithBoundingInfo(x, y, predicate, fastCheck, camera) {
        const warn = (0,devTools/* _WarnImport */.n)("Ray", true);
        if (warn) {
            logger/* Logger */.V.Warn(warn);
        }
        // Dummy info if picking as not been imported
        return new pickingInfo/* PickingInfo */.G();
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Use the given ray to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
     * irrespective of orientation.
     * @param ray The ray to use to pick meshes
     * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must have isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
     * @param fastCheck defines if the first intersection will be used (and not the closest)
     * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
     * @returns a PickingInfo
     */
    pickWithRay(ray, predicate, fastCheck, trianglePredicate) {
        throw (0,devTools/* _WarnImport */.n)("Ray");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Launch a ray to try to pick a mesh in the scene. A mesh triangle can be picked both from its front and back sides,
     * irrespective of orientation.
     * @param x X position on screen
     * @param y Y position on screen
     * @param predicate Predicate function used to determine eligible meshes and instances. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
     * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
     * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
     * @returns an array of PickingInfo
     */
    multiPick(x, y, predicate, camera, trianglePredicate) {
        throw (0,devTools/* _WarnImport */.n)("Ray");
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * Launch a ray to try to pick a mesh in the scene
     * @param ray Ray to use
     * @param predicate Predicate function used to determine eligible meshes and instances. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced
     * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
     * @returns an array of PickingInfo
     */
    multiPickWithRay(ray, predicate, trianglePredicate) {
        throw (0,devTools/* _WarnImport */.n)("Ray");
    }
    /**
     * Force the value of meshUnderPointer
     * @param mesh defines the mesh to use
     * @param pointerId optional pointer id when using more than one pointer
     * @param pickResult optional pickingInfo data used to find mesh
     */
    setPointerOverMesh(mesh, pointerId, pickResult) {
        this._inputManager.setPointerOverMesh(mesh, pointerId, pickResult);
    }
    /**
     * Gets the mesh under the pointer
     * @returns a Mesh or null if no mesh is under the pointer
     */
    getPointerOverMesh() {
        return this._inputManager.getPointerOverMesh();
    }
    // Misc.
    /** @internal */
    _rebuildGeometries() {
        for (const geometry of this.geometries) {
            geometry._rebuild();
        }
        for (const mesh of this.meshes) {
            mesh._rebuild();
        }
        if (this.postProcessManager) {
            this.postProcessManager._rebuild();
        }
        for (const component of this._components) {
            component.rebuild();
        }
        for (const system of this.particleSystems) {
            system.rebuild();
        }
        if (this.spriteManagers) {
            for (const spriteMgr of this.spriteManagers) {
                spriteMgr.rebuild();
            }
        }
    }
    /** @internal */
    _rebuildTextures() {
        for (const texture of this.textures) {
            texture._rebuild(true);
        }
        this.markAllMaterialsAsDirty(1);
    }
    /**
     * Get from a list of objects by tags
     * @param list the list of objects to use
     * @param tagsQuery the query to use
     * @param filter a predicate to filter for tags
     * @returns
     */
    _getByTags(list, tagsQuery, filter) {
        if (tagsQuery === undefined) {
            // returns the complete list (could be done with Tags.MatchesQuery but no need to have a for-loop here)
            return list;
        }
        const listByTags = [];
        for (const i in list) {
            const item = list[i];
            if (tags/* Tags */.Y && tags/* Tags */.Y.MatchesQuery(item, tagsQuery) && (!filter || filter(item))) {
                listByTags.push(item);
            }
        }
        return listByTags;
    }
    /**
     * Get a list of meshes by tags
     * @param tagsQuery defines the tags query to use
     * @param filter defines a predicate used to filter results
     * @returns an array of Mesh
     */
    getMeshesByTags(tagsQuery, filter) {
        return this._getByTags(this.meshes, tagsQuery, filter);
    }
    /**
     * Get a list of cameras by tags
     * @param tagsQuery defines the tags query to use
     * @param filter defines a predicate used to filter results
     * @returns an array of Camera
     */
    getCamerasByTags(tagsQuery, filter) {
        return this._getByTags(this.cameras, tagsQuery, filter);
    }
    /**
     * Get a list of lights by tags
     * @param tagsQuery defines the tags query to use
     * @param filter defines a predicate used to filter results
     * @returns an array of Light
     */
    getLightsByTags(tagsQuery, filter) {
        return this._getByTags(this.lights, tagsQuery, filter);
    }
    /**
     * Get a list of materials by tags
     * @param tagsQuery defines the tags query to use
     * @param filter defines a predicate used to filter results
     * @returns an array of Material
     */
    getMaterialByTags(tagsQuery, filter) {
        return this._getByTags(this.materials, tagsQuery, filter).concat(this._getByTags(this.multiMaterials, tagsQuery, filter));
    }
    /**
     * Get a list of transform nodes by tags
     * @param tagsQuery defines the tags query to use
     * @param filter defines a predicate used to filter results
     * @returns an array of TransformNode
     */
    getTransformNodesByTags(tagsQuery, filter) {
        return this._getByTags(this.transformNodes, tagsQuery, filter);
    }
    /**
     * Overrides the default sort function applied in the rendering group to prepare the meshes.
     * This allowed control for front to back rendering or reversly depending of the special needs.
     *
     * @param renderingGroupId The rendering group id corresponding to its index
     * @param opaqueSortCompareFn The opaque queue comparison function use to sort.
     * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
     * @param transparentSortCompareFn The transparent queue comparison function use to sort.
     */
    setRenderingOrder(renderingGroupId, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {
        this._renderingManager.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn);
    }
    /**
     * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
     *
     * @param renderingGroupId The rendering group id corresponding to its index
     * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
     * @param depth Automatically clears depth between groups if true and autoClear is true.
     * @param stencil Automatically clears stencil between groups if true and autoClear is true.
     */
    setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil, depth = true, stencil = true) {
        this._renderingManager.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil, depth, stencil);
    }
    /**
     * Gets the current auto clear configuration for one rendering group of the rendering
     * manager.
     * @param index the rendering group index to get the information for
     * @returns The auto clear setup for the requested rendering group
     */
    getAutoClearDepthStencilSetup(index) {
        return this._renderingManager.getAutoClearDepthStencilSetup(index);
    }
    /** @internal */
    _forceBlockMaterialDirtyMechanism(value) {
        this._blockMaterialDirtyMechanism = value;
    }
    /** Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync) */
    get blockMaterialDirtyMechanism() {
        return this._blockMaterialDirtyMechanism;
    }
    set blockMaterialDirtyMechanism(value) {
        if (this._blockMaterialDirtyMechanism === value) {
            return;
        }
        this._blockMaterialDirtyMechanism = value;
        if (!value) {
            // Do a complete update
            this.markAllMaterialsAsDirty(63);
        }
    }
    /**
     * Will flag all materials as dirty to trigger new shader compilation
     * @param flag defines the flag used to specify which material part must be marked as dirty
     * @param predicate If not null, it will be used to specify if a material has to be marked as dirty
     */
    markAllMaterialsAsDirty(flag, predicate) {
        if (this._blockMaterialDirtyMechanism) {
            return;
        }
        for (const material of this.materials) {
            if (predicate && !predicate(material)) {
                continue;
            }
            material.markAsDirty(flag);
        }
    }
    /**
     * @internal
     */
    _loadFile(fileOrUrl, onSuccess, onProgress, useOfflineSupport, useArrayBuffer, onError, onOpened) {
        const request = (0,fileTools/* LoadFile */.zU)(fileOrUrl, onSuccess, onProgress, useOfflineSupport ? this.offlineProvider : undefined, useArrayBuffer, onError, onOpened);
        this._activeRequests.push(request);
        request.onCompleteObservable.add((request) => {
            this._activeRequests.splice(this._activeRequests.indexOf(request), 1);
        });
        return request;
    }
    /**
     * @internal
     */
    _loadFileAsync(fileOrUrl, onProgress, useOfflineSupport, useArrayBuffer, onOpened) {
        return new Promise((resolve, reject) => {
            this._loadFile(fileOrUrl, (data) => {
                resolve(data);
            }, onProgress, useOfflineSupport, useArrayBuffer, (request, exception) => {
                reject(exception);
            }, onOpened);
        });
    }
    /**
     * @internal
     */
    _requestFile(url, onSuccess, onProgress, useOfflineSupport, useArrayBuffer, onError, onOpened) {
        const request = (0,fileTools/* RequestFile */.sh)(url, onSuccess, onProgress, useOfflineSupport ? this.offlineProvider : undefined, useArrayBuffer, onError, onOpened);
        this._activeRequests.push(request);
        request.onCompleteObservable.add((request) => {
            this._activeRequests.splice(this._activeRequests.indexOf(request), 1);
        });
        return request;
    }
    /**
     * @internal
     */
    _requestFileAsync(url, onProgress, useOfflineSupport, useArrayBuffer, onOpened) {
        return new Promise((resolve, reject) => {
            this._requestFile(url, (data) => {
                resolve(data);
            }, onProgress, useOfflineSupport, useArrayBuffer, (error) => {
                reject(error);
            }, onOpened);
        });
    }
    /**
     * @internal
     */
    _readFile(file, onSuccess, onProgress, useArrayBuffer, onError) {
        const request = (0,fileTools/* ReadFile */.NJ)(file, onSuccess, onProgress, useArrayBuffer, onError);
        this._activeRequests.push(request);
        request.onCompleteObservable.add((request) => {
            this._activeRequests.splice(this._activeRequests.indexOf(request), 1);
        });
        return request;
    }
    /**
     * @internal
     */
    _readFileAsync(file, onProgress, useArrayBuffer) {
        return new Promise((resolve, reject) => {
            this._readFile(file, (data) => {
                resolve(data);
            }, onProgress, useArrayBuffer, (error) => {
                reject(error);
            });
        });
    }
    // eslint-disable-next-line jsdoc/require-returns-check
    /**
     * This method gets the performance collector belonging to the scene, which is generally shared with the inspector.
     * @returns the perf collector belonging to the scene.
     */
    getPerfCollector() {
        throw (0,devTools/* _WarnImport */.n)("performanceViewerSceneExtension");
    }
    // deprecated
    /**
     * Sets the active camera of the scene using its Id
     * @param id defines the camera's Id
     * @returns the new active camera or null if none found.
     * @deprecated Please use setActiveCameraById instead
     */
    setActiveCameraByID(id) {
        return this.setActiveCameraById(id);
    }
    /**
     * Get a material using its id
     * @param id defines the material's Id
     * @returns the material or null if none found.
     * @deprecated Please use getMaterialById instead
     */
    getMaterialByID(id) {
        return this.getMaterialById(id);
    }
    /**
     * Gets a the last added material using a given id
     * @param id defines the material's Id
     * @returns the last material with the given id or null if none found.
     * @deprecated Please use getLastMaterialById instead
     */
    getLastMaterialByID(id) {
        return this.getLastMaterialById(id);
    }
    /**
     * Get a texture using its unique id
     * @param uniqueId defines the texture's unique id
     * @returns the texture or null if none found.
     * @deprecated Please use getTextureByUniqueId instead
     */
    getTextureByUniqueID(uniqueId) {
        return this.getTextureByUniqueId(uniqueId);
    }
    /**
     * Gets a camera using its Id
     * @param id defines the Id to look for
     * @returns the camera or null if not found
     * @deprecated Please use getCameraById instead
     */
    getCameraByID(id) {
        return this.getCameraById(id);
    }
    /**
     * Gets a camera using its unique Id
     * @param uniqueId defines the unique Id to look for
     * @returns the camera or null if not found
     * @deprecated Please use getCameraByUniqueId instead
     */
    getCameraByUniqueID(uniqueId) {
        return this.getCameraByUniqueId(uniqueId);
    }
    /**
     * Gets a bone using its Id
     * @param id defines the bone's Id
     * @returns the bone or null if not found
     * @deprecated Please use getBoneById instead
     */
    getBoneByID(id) {
        return this.getBoneById(id);
    }
    /**
     * Gets a light node using its Id
     * @param id defines the light's Id
     * @returns the light or null if none found.
     * @deprecated Please use getLightById instead
     */
    getLightByID(id) {
        return this.getLightById(id);
    }
    /**
     * Gets a light node using its scene-generated unique Id
     * @param uniqueId defines the light's unique Id
     * @returns the light or null if none found.
     * @deprecated Please use getLightByUniqueId instead
     */
    getLightByUniqueID(uniqueId) {
        return this.getLightByUniqueId(uniqueId);
    }
    /**
     * Gets a particle system by Id
     * @param id defines the particle system Id
     * @returns the corresponding system or null if none found
     * @deprecated Please use getParticleSystemById instead
     */
    getParticleSystemByID(id) {
        return this.getParticleSystemById(id);
    }
    /**
     * Gets a geometry using its Id
     * @param id defines the geometry's Id
     * @returns the geometry or null if none found.
     * @deprecated Please use getGeometryById instead
     */
    getGeometryByID(id) {
        return this.getGeometryById(id);
    }
    /**
     * Gets the first added mesh found of a given Id
     * @param id defines the Id to search for
     * @returns the mesh found or null if not found at all
     * @deprecated Please use getMeshById instead
     */
    getMeshByID(id) {
        return this.getMeshById(id);
    }
    /**
     * Gets a mesh with its auto-generated unique Id
     * @param uniqueId defines the unique Id to search for
     * @returns the found mesh or null if not found at all.
     * @deprecated Please use getMeshByUniqueId instead
     */
    getMeshByUniqueID(uniqueId) {
        return this.getMeshByUniqueId(uniqueId);
    }
    /**
     * Gets a the last added mesh using a given Id
     * @param id defines the Id to search for
     * @returns the found mesh or null if not found at all.
     * @deprecated Please use getLastMeshById instead
     */
    getLastMeshByID(id) {
        return this.getLastMeshById(id);
    }
    /**
     * Gets a list of meshes using their Id
     * @param id defines the Id to search for
     * @returns a list of meshes
     * @deprecated Please use getMeshesById instead
     */
    getMeshesByID(id) {
        return this.getMeshesById(id);
    }
    /**
     * Gets the first added transform node found of a given Id
     * @param id defines the Id to search for
     * @returns the found transform node or null if not found at all.
     * @deprecated Please use getTransformNodeById instead
     */
    getTransformNodeByID(id) {
        return this.getTransformNodeById(id);
    }
    /**
     * Gets a transform node with its auto-generated unique Id
     * @param uniqueId defines the unique Id to search for
     * @returns the found transform node or null if not found at all.
     * @deprecated Please use getTransformNodeByUniqueId instead
     */
    getTransformNodeByUniqueID(uniqueId) {
        return this.getTransformNodeByUniqueId(uniqueId);
    }
    /**
     * Gets a list of transform nodes using their Id
     * @param id defines the Id to search for
     * @returns a list of transform nodes
     * @deprecated Please use getTransformNodesById instead
     */
    getTransformNodesByID(id) {
        return this.getTransformNodesById(id);
    }
    /**
     * Gets a node (Mesh, Camera, Light) using a given Id
     * @param id defines the Id to search for
     * @returns the found node or null if not found at all
     * @deprecated Please use getNodeById instead
     */
    getNodeByID(id) {
        return this.getNodeById(id);
    }
    /**
     * Gets a the last added node (Mesh, Camera, Light) using a given Id
     * @param id defines the Id to search for
     * @returns the found node or null if not found at all
     * @deprecated Please use getLastEntryById instead
     */
    getLastEntryByID(id) {
        return this.getLastEntryById(id);
    }
    /**
     * Gets a skeleton using a given Id (if many are found, this function will pick the last one)
     * @param id defines the Id to search for
     * @returns the found skeleton or null if not found at all.
     * @deprecated Please use getLastSkeletonById instead
     */
    getLastSkeletonByID(id) {
        return this.getLastSkeletonById(id);
    }
}
/** The fog is deactivated */
Scene.FOGMODE_NONE = 0;
/** The fog density is following an exponential function */
Scene.FOGMODE_EXP = 1;
/** The fog density is following an exponential function faster than FOGMODE_EXP */
Scene.FOGMODE_EXP2 = 2;
/** The fog density is following a linear function. */
Scene.FOGMODE_LINEAR = 3;
/**
 * Gets or sets the minimum deltatime when deterministic lock step is enabled
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
 */
Scene.MinDeltaTime = 1.0;
/**
 * Gets or sets the maximum deltatime when deterministic lock step is enabled
 * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
 */
Scene.MaxDeltaTime = 1000.0;
// Register Class Name
(0,typeStore/* RegisterClass */.Y5)("BABYLON.Scene", Scene);
//# sourceMappingURL=scene.js.map

/***/ }),

/***/ 16945:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   B: () => (/* binding */ Stage),
/* harmony export */   v: () => (/* binding */ SceneComponentConstants)
/* harmony export */ });
/**
 * Groups all the scene component constants in one place to ease maintenance.
 * @internal
 */
class SceneComponentConstants {
}
SceneComponentConstants.NAME_EFFECTLAYER = "EffectLayer";
SceneComponentConstants.NAME_LAYER = "Layer";
SceneComponentConstants.NAME_LENSFLARESYSTEM = "LensFlareSystem";
SceneComponentConstants.NAME_BOUNDINGBOXRENDERER = "BoundingBoxRenderer";
SceneComponentConstants.NAME_PARTICLESYSTEM = "ParticleSystem";
SceneComponentConstants.NAME_GAMEPAD = "Gamepad";
SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE = "SimplificationQueue";
SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER = "GeometryBufferRenderer";
SceneComponentConstants.NAME_PREPASSRENDERER = "PrePassRenderer";
SceneComponentConstants.NAME_DEPTHRENDERER = "DepthRenderer";
SceneComponentConstants.NAME_DEPTHPEELINGRENDERER = "DepthPeelingRenderer";
SceneComponentConstants.NAME_IBLSHADOWSRENDERER = "IblShadowsRenderer";
SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER = "PostProcessRenderPipelineManager";
SceneComponentConstants.NAME_SPRITE = "Sprite";
SceneComponentConstants.NAME_SUBSURFACE = "SubSurface";
SceneComponentConstants.NAME_OUTLINERENDERER = "Outline";
SceneComponentConstants.NAME_PROCEDURALTEXTURE = "ProceduralTexture";
SceneComponentConstants.NAME_SHADOWGENERATOR = "ShadowGenerator";
SceneComponentConstants.NAME_OCTREE = "Octree";
SceneComponentConstants.NAME_PHYSICSENGINE = "PhysicsEngine";
SceneComponentConstants.NAME_AUDIO = "Audio";
SceneComponentConstants.NAME_FLUIDRENDERER = "FluidRenderer";
SceneComponentConstants.STEP_ISREADYFORMESH_EFFECTLAYER = 0;
SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0;
SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0;
SceneComponentConstants.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER = 0;
SceneComponentConstants.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1;
SceneComponentConstants.STEP_BEFORECAMERADRAW_PREPASS = 0;
SceneComponentConstants.STEP_BEFORECAMERADRAW_EFFECTLAYER = 1;
SceneComponentConstants.STEP_BEFORECAMERADRAW_LAYER = 2;
SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_PREPASS = 0;
SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_LAYER = 1;
SceneComponentConstants.STEP_BEFORERENDERINGMESH_PREPASS = 0;
SceneComponentConstants.STEP_BEFORERENDERINGMESH_OUTLINE = 1;
SceneComponentConstants.STEP_AFTERRENDERINGMESH_PREPASS = 0;
SceneComponentConstants.STEP_AFTERRENDERINGMESH_OUTLINE = 1;
SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0;
SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1;
SceneComponentConstants.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0;
SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0;
SceneComponentConstants.STEP_BEFORECLEAR_PREPASS = 1;
SceneComponentConstants.STEP_BEFORERENDERTARGETCLEAR_PREPASS = 0;
SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_PREPASS = 0;
SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_LAYER = 1;
SceneComponentConstants.STEP_AFTERCAMERADRAW_PREPASS = 0;
SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER = 1;
SceneComponentConstants.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 2;
SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 3;
SceneComponentConstants.STEP_AFTERCAMERADRAW_LAYER = 4;
SceneComponentConstants.STEP_AFTERCAMERADRAW_FLUIDRENDERER = 5;
SceneComponentConstants.STEP_AFTERCAMERAPOSTPROCESS_LAYER = 0;
SceneComponentConstants.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER = 0;
SceneComponentConstants.STEP_AFTERRENDER_AUDIO = 0;
SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 0;
SceneComponentConstants.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1;
SceneComponentConstants.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 2;
SceneComponentConstants.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3;
SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0;
SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER = 1;
SceneComponentConstants.STEP_POINTERMOVE_SPRITE = 0;
SceneComponentConstants.STEP_POINTERDOWN_SPRITE = 0;
SceneComponentConstants.STEP_POINTERUP_SPRITE = 0;
/**
 * Representation of a stage in the scene (Basically a list of ordered steps)
 * @internal
 */
class Stage extends Array {
    /**
     * Hide ctor from the rest of the world.
     * @param items The items to add.
     */
    constructor(items) {
        super(...items);
    }
    /**
     * Creates a new Stage.
     * @returns A new instance of a Stage
     */
    static Create() {
        return Object.create(Stage.prototype);
    }
    /**
     * Registers a step in an ordered way in the targeted stage.
     * @param index Defines the position to register the step in
     * @param component Defines the component attached to the step
     * @param action Defines the action to launch during the step
     */
    registerStep(index, component, action) {
        let i = 0;
        let maxIndex = Number.MAX_VALUE;
        for (; i < this.length; i++) {
            const step = this[i];
            maxIndex = step.index;
            if (index < maxIndex) {
                break;
            }
        }
        this.splice(i, 0, { index, component, action: action.bind(component) });
    }
    /**
     * Clears all the steps from the stage.
     */
    clear() {
        this.length = 0;
    }
}
//# sourceMappingURL=sceneComponent.js.map

/***/ }),

/***/ 75524:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Cg: () => (/* binding */ __decorate)
/* harmony export */ });
/* unused harmony exports __extends, __assign, __rest, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn */

/******************************************************************************
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)